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=''
701 d_old_pthread_create_joinable=''
702 old_pthread_create_joinable=''
704 d_pthread_attr_setscope=''
752 sethostent_r_proto=''
769 setprotoent_r_proto=''
781 setservent_r_proto=''
792 d_siginfo_si_errno=''
796 d_siginfo_si_status=''
798 d_siginfo_si_value=''
810 d_ipv6_mreq_source=''
827 d_sprintf_returns_strlen=''
840 perl_static_inline=''
845 d_stdio_ptr_lval_nochange_cnt=''
846 d_stdio_ptr_lval_sets_cnt=''
998 d_gdbm_ndbm_h_uses_prototypes=''
999 d_gdbmndbm_h_uses_prototypes=''
1001 d_ndbm_h_uses_prototypes=''
1077 d_inc_version_list=''
1079 inc_version_list_init=''
1087 installusrbinperl=''
1103 ignore_versioned_solibs=''
1167 d_perl_otherlibdirs=''
1175 api_versionstring=''
1181 version_patchlevel_string=''
1185 d_nv_preserves_uv=''
1186 d_nv_zero_is_allbits_zero=''
1197 nv_overflows_integers_at=''
1198 nv_preserves_uv_bits=''
1271 installsitehtml1dir=''
1274 installsitehtml3dir=''
1281 installsiteman1dir=''
1284 installsiteman3dir=''
1289 installsitescript=''
1307 d_stdio_stream_array=''
1308 stdio_stream_array=''
1327 usekernprocpathname=''
1328 ccflags_uselargefiles=''
1329 ldflags_uselargefiles=''
1330 libswanted_uselargefiles=''
1339 usensgetexecutablepath=''
1353 installvendorarch=''
1360 installvendorhtml1dir=''
1362 vendorhtml1direxp=''
1363 installvendorhtml3dir=''
1365 vendorhtml3direxp=''
1371 installvendorman1dir=''
1374 installvendorman3dir=''
1381 installvendorscript=''
1392 smallmach='pdp11 i8086 z8000 i80286 iAPX286'
1395 : We must find out about Eunice early
1397 if test -f /etc/unixtovms; then
1398 eunicefix=/etc/unixtovms
1400 if test -f /etc/unixtovms.exe; then
1401 eunicefix=/etc/unixtovms.exe
1404 : Set executable suffix now -- needed before hints available
1405 if test -f "/libs/version.library"; then
1408 elif test -f "/system/gnu_library/bin/ar.pm"; then
1411 elif test -n "$DJGPP"; then
1414 elif test -f /kern/cookiejar; then
1417 elif test -d c:/. -o -n "$is_os2" ; then
1424 : Trailing extension. Override this in a hint file, if needed.
1425 : Extra object files, if any, needed on this platform.
1428 : Possible local include directories to search.
1429 : Set locincpth to "" in a hint file to defeat local include searches.
1430 locincpth="/usr/local/include /opt/local/include /usr/gnu/include"
1431 locincpth="$locincpth /opt/gnu/include /usr/GNU/include /opt/GNU/include"
1433 : no include file wanted by default
1436 : Enable -DEBUGGING and -DDEBUGGING from the command line
1441 : change the next line if compiling for Xenix/286 on Xenix/386
1442 xlibpth='/usr/lib/386 /lib/386'
1443 : Possible local library directories to search.
1444 loclibpth="/usr/local/lib /opt/local/lib /usr/gnu/lib"
1445 loclibpth="$loclibpth /opt/gnu/lib /usr/GNU/lib /opt/GNU/lib"
1447 : general looking path for locating libraries
1448 glibpth="/lib /usr/lib $xlibpth"
1449 glibpth="$glibpth /usr/ccs/lib /usr/ucblib /usr/local/lib"
1450 test -f /usr/shlib/libc.so && glibpth="/usr/shlib $glibpth"
1451 test -f /shlib/libc.so && glibpth="/shlib $glibpth"
1452 test -d /usr/lib64 && glibpth="$glibpth /lib64 /usr/lib64 /usr/local/lib64"
1454 : Private path used by Configure to find libraries. Its value
1455 : is prepended to libpth. This variable takes care of special
1456 : machines, like the mips. Usually, it should be empty.
1459 : default library list
1461 : some systems want to use only the non-versioned libso:s
1462 ignore_versioned_solibs=''
1463 : set usethreads on the Configure command line to enable threads.
1464 usereentrant='undef'
1468 : set useposix=false in your hint file to disable the POSIX extension.
1470 : set useopcode=false in your hint file to disable the Opcode extension.
1473 ccflags_uselargefiles=''
1474 ldflags_uselargefiles=''
1475 libswanted_uselargefiles=''
1476 : set usemultiplicity on the Configure command line to enable multiplicity.
1477 : set usesocks on the Configure command line to enable socks.
1478 : List of libraries we want.
1479 : If anyone needs extra -lxxx, put those in a hint file.
1480 libswanted="cl pthread socket bind inet nsl ndbm gdbm dbm db malloc dl ld"
1481 libswanted="$libswanted sun m crypt sec util c cposix posix ucb bsd BSD"
1482 : We probably want to search /usr/shlib before most other libraries.
1483 : This is only used by the lib/ExtUtils/MakeMaker.pm routine extliblist.
1484 glibpth=`echo " $glibpth " | sed -e 's! /usr/shlib ! !'`
1485 glibpth="/usr/shlib $glibpth"
1486 : Do not use vfork unless overridden by a hint file.
1489 : Find the basic shell for Bourne shell scripts
1493 *bsd*|sys5*) xxx="/$SYSTYPE/bin/sh";;
1496 if test -f "$xxx"; then
1499 : Build up a list and do a single loop so we can 'break' out.
1500 pth=`echo $PATH | sed -e "s/$p_/ /g"`
1501 for xxx in sh bash ksh pdksh ash; do
1503 try="$try ${p}/${xxx}"
1507 if test -f "$xxx"; then
1510 elif test "X$_exe" != X -a -f "$xxx$_exe"; then
1513 elif test -f "$xxx.exe"; then
1524 $me: Fatal Error: I can't find a Bourne Shell anywhere.
1526 Usually it's in /bin/sh. How did you even get this far?
1527 Please contact me (Perl Maintainers) at perlbug@perl.org and
1528 we'll try to straighten this all out.
1534 : When cross-compiling we need to separate the sh-to-run-Configure-with from the sh-to-use-in-Perl
1535 : default both to the same thing, cross-compilers can then set targetsh differently if they like
1538 : see if sh knows # comments
1539 if `$sh -c '#' >/dev/null 2>&1`; then
1543 test -f $xcat$_exe || xcat=/usr/bin/cat
1544 if test ! -f $xcat$_exe; then
1545 for p in `echo $PATH | sed -e "s/$p_/ /g"` $paths; do
1546 if test -f $p/cat$_exe; then
1551 if test ! -f $xcat$_exe; then
1552 echo "Can't find cat anywhere!"
1556 echo "#!$xcat" >sharp
1559 ./sharp > today 2>/dev/null
1560 if test -s today; then
1563 echo "#! $xcat" > sharp
1566 ./sharp > today 2>/dev/null
1567 if test -s today; then
1575 echo "Your $sh doesn't grok # comments--I will strip them later on."
1578 echo "exec grep -v '^[ ]*#'" >spitshell
1580 $eunicefix spitshell
1581 spitshell=`pwd`/spitshell
1583 echo "I presume that if # doesn't work, #! won't work either!"
1588 : figure out how to guarantee sh startup
1590 '') startsh=${sharpbang}${sh} ;;
1602 : echo "Yup, it does."
1604 echo "Hmm... '$startsh' does not guarantee sh startup..."
1605 echo "You may have to fix up the shell scripts to make sure $sh runs them."
1609 : Save command line options in file UU/cmdline.opt for later use in
1610 : generating config.sh.
1611 cat > cmdline.opt <<EOSH
1612 : Configure command line arguments.
1621 cat >>cmdline.opt <<EOSH
1622 config_arg$argn='$arg'
1624 cat <<EOC | sed -e "s/'/'"'"'"'"'"'"'/g" > cmdl.opt
1627 arg_exp=`cat cmdl.opt`
1628 args_exp="$args_exp$args_sep'$arg_exp'"
1629 argn=`expr $argn + 1`
1634 : produce awk script to parse command line options
1635 cat >options.awk <<'EOF'
1637 optstr = "A:dD:eEf:hKOrsSU:V"; # getopt-style specification
1639 len = length(optstr);
1640 for (i = 1; i <= len; i++) {
1641 c = substr(optstr, i, 1);
1642 if (i < len) a = substr(optstr, i + 1, 1); else a = "";
1653 if (substr(str, 1, 1) != "-") {
1654 printf("'%s'\n", str);
1658 for (i = 2; i <= len; i++) {
1659 c = substr(str, i, 1);
1661 printf("-%s\n", substr(str, i));
1667 printf("'%s'\n", substr(str, i + 1));
1680 : process the command line options
1681 set X `for arg in "$@"; do echo "X$arg"; done |
1682 sed -e s/X// | awk -f options.awk`
1687 : set up default values
1696 rm -f optdef.sh posthint.sh
1697 cat >optdef.sh <<EOS
1703 while test $# -gt 0; do
1705 -d) shift; fastread=yes;;
1706 -e) shift; alldone=cont;;
1710 if test -r "$1"; then
1713 echo "$me: cannot read config file $1." >&2
1719 -h) shift; error=true;;
1720 -r) shift; reuseval=true;;
1721 -s) shift; silent=true; realsilent=true;;
1722 -E) shift; alldone=exit;;
1723 -K) shift; knowitall=true;;
1725 -S) shift; silent=true; extractsh=true;;
1730 echo "$me: use '-U symbol=', not '-D symbol='." >&2
1731 echo "$me: ignoring -D $1" >&2
1734 sed -e "s/'/'\"'\"'/g" -e "s/=\(.*\)/='\1'/" >> optdef.sh;;
1735 *) echo "$1='define'" >> optdef.sh;;
1742 *=) echo "$1" >> optdef.sh;;
1744 echo "$me: use '-D symbol=val', not '-U symbol=val'." >&2
1745 echo "$me: ignoring -U $1" >&2
1747 *) echo "$1='undef'" >> optdef.sh;;
1758 *=*) zzz=`echo "$yyy"|sed 's!=.*!!'`
1762 zzz=" "`echo "$yyy"|sed 's!^[^=]*=!!'`
1763 yyy=`echo "$yyy"|sed 's!=.*!!'` ;;
1769 *:*) xxx=`echo "$yyy"|sed 's!:.*!!'`
1770 yyy=`echo "$yyy"|sed 's!^[^:]*:!!'`
1771 zzz=`echo "$yyy"|sed 's!^[^=]*=!!'`
1772 yyy=`echo "$yyy"|sed 's!=.*!!'` ;;
1773 *) xxx=`echo "$yyy"|sed 's!:.*!!'`
1774 yyy=`echo "$yyy"|sed 's!^[^:]*:!!'` ;;
1780 echo "$yyy=\"\${$yyy}$zzz\"" >> posthint.sh ;;
1782 echo "$yyy=''" >> posthint.sh ;;
1787 echo "$yyy='$zzz'" >> posthint.sh ;;
1789 echo "eval \"$yyy=$zzz\"" >> posthint.sh ;;
1791 echo "$yyy=\"$zzz\${$yyy}\"" >> posthint.sh ;;
1796 echo "$yyy=$zzz" >> posthint.sh ;;
1797 *) echo "$me: unknown -A command '$xxx', ignoring -A $1" >&2 ;;
1801 -V) echo "$me generated by metaconfig 3.5 PL0." >&2
1804 -*) echo "$me: unknown option $1" >&2; shift; error=true;;
1812 Usage: $me [-dehrsEKOSV] [-f config.sh] [-D symbol] [-D symbol=value]
1813 [-U symbol] [-U symbol=] [-A command:symbol...]
1814 -d : use defaults for all answers.
1815 -e : go on without questioning past the production of config.sh.
1816 -f : specify an alternate default configuration file.
1817 -h : print this help message and exit (with an error status).
1818 -r : reuse C symbols value if possible (skips costly nm extraction).
1819 -s : silent mode, only echoes questions and essential information.
1820 -D : define symbol to have some value:
1821 -D symbol symbol gets the value 'define'
1822 -D symbol=value symbol gets the value 'value'
1823 common used examples (see INSTALL for more info):
1824 -Duse64bitint use 64bit integers
1825 -Duse64bitall use 64bit integers and pointers
1826 -Dusethreads use thread support
1827 -Dinc_version_list=none do not include older perl trees in @INC
1828 -DEBUGGING=none DEBUGGING options
1829 -Dcc=gcc choose your compiler
1830 -Dprefix=/opt/perl5 choose your destination
1831 -E : stop at the end of questions, after having produced config.sh.
1832 -K : do not use unless you know what you are doing.
1833 -O : ignored for backward compatibility
1834 -S : perform variable substitutions on all .SH files (can mix with -f)
1835 -U : undefine symbol:
1836 -U symbol symbol gets the value 'undef'
1837 -U symbol= symbol gets completely empty
1839 -A : manipulate symbol after the platform specific hints have been applied:
1840 -A append:symbol=value append value to symbol
1841 -A symbol=value like append:, but with a separating space
1842 -A define:symbol=value define symbol to have value
1843 -A clear:symbol define symbol to be ''
1844 -A define:symbol define symbol to be 'define'
1845 -A eval:symbol=value define symbol to be eval of value
1846 -A prepend:symbol=value prepend value to symbol
1847 -A undef:symbol define symbol to be 'undef'
1848 -A undef:symbol= define symbol to be ''
1849 e.g.: -A prepend:libswanted='cl pthread '
1850 -A ccflags=-DSOME_MACRO
1851 -V : print version number and exit (with a zero status).
1858 case "$fastread$alldone" in
1861 case "$extractsh" in
1864 if test ! -t 0; then
1865 echo "Say 'sh Configure', not 'sh <Configure'"
1875 true) exec 1>/dev/null;;
1878 : run the defines and the undefines, if any, but leave the file out there...
1880 grep '\\' optdef.sh >/dev/null 2>&1
1881 if test $? = 0; then
1882 echo "Configure does not support \\ in -D arguments"
1886 : create the posthint manipulation script and leave the file out there...
1891 first=`echo $package | sed -e 's/^\(.\).*/\1/'`
1892 last=`echo $package | sed -e 's/^.\(.*\)/\1/'`
1893 case "`echo AbyZ | tr '[:lower:]' '[:upper:]' 2>/dev/null`"-"`echo AbyZ | tr '[:upper:]' '[:lower:]' 2>/dev/null`" in
1894 ABYZ-abyz) spackage=`echo $first | tr '[:lower:]' '[:upper:]'`$last;;
1895 *) spackage=`echo $first | tr '[a-z]' '[A-Z]'`$last;;
1898 : Some greps do not return status, grrr.
1899 echo "grimblepritz" >grimble
1900 if grep blurfldyick grimble >/dev/null 2>&1 ; then
1902 elif grep grimblepritz grimble >/dev/null 2>&1 ; then
1908 : the following should work in any shell
1912 echo "AGH! Grep doesn't return a status. Attempting remedial action."
1913 cat >contains <<'EOSS'
1914 grep "$1" "$2" >.greptmp && cat .greptmp && test -s .greptmp
1919 : Find the path to the source tree
1922 */*) src=`echo $0 | sed -e 's%/[^/][^/]*$%%'`
1926 *) src=`cd ../$src && pwd` ;;
1939 if test -f $rsrc/Configure && \
1940 $contains "^package='$package'\$" $rsrc/Configure >/dev/null 2>&1
1942 : found it, so we are ok.
1945 for src in . .. ../.. ../../.. ../../../..; do
1946 if test -f ../$src/Configure && \
1947 $contains "^package=$package$" ../$src/Configure >/dev/null 2>&1
1958 Sorry, I can't seem to locate the source dir for $package. Please start
1959 Configure with an explicit path -- i.e. /some/path/Configure.
1967 echo "Sources for $package found in \"$src\"." >&4
1971 : script used to extract .SH files with variable substitutions
1972 cat >extract <<'EOS'
1974 echo "Doing variable substitutions on .SH files..."
1975 if test -f MANIFEST; then
1976 set x `awk '{print $1}' < MANIFEST | grep '\.SH$'`
1978 echo "(Looking for .SH files under the source directory.)"
1979 set x `(cd "$src"; find . -name "*.SH" -print)`
1983 0) set x `(cd "$src"; echo *.SH)`; shift;;
1985 if test ! -f "$src/$1"; then
1991 while test $name; do
1992 if test ! -d "$name"; then
1993 create="$name $create";
1994 name=`echo $name | sed -e "s|^[^/]*$||"`;
1995 name=`echo $name | sed -e "s|\(.*\)/.*|\1|"`;
2000 for file in $create; do
2009 dir=`expr X$file : 'X\(.*\)/'`
2010 file=`expr X$file : 'X.*/\(.*\)'`
2011 (cd "$dir" && . ./$file)
2021 dir=`expr X$file : 'X\(.*\)/'`
2022 file=`expr X$file : 'X.*/\(.*\)'`
2023 (set x $dir; shift; eval $mkdir_p)
2024 sh <"$src/$dir/$file"
2033 if test -f "$src/config_h.SH"; then
2034 if test ! -f config.h; then
2035 : oops, they left it out of MANIFEST, probably, so do it anyway.
2036 . "$src/config_h.SH"
2041 : extract files and exit if asked to do so
2042 case "$extractsh" in
2044 case "$realsilent" in
2048 case "$config_sh" in
2049 '') config_sh='config.sh';;
2052 echo "Fetching answers from $config_sh..."
2059 echo "Extraction done."
2064 : Eunice requires " " instead of "", can you believe it
2067 echo "Beginning of configuration questions for $package."
2069 trap 'echo " "; test -d ../UU && rm -rf X $rmlist; exit 1' 1 2 3 15
2071 : first determine how to suppress newline on echo command
2073 echo "Checking echo to see how to suppress newlines..."
2074 (echo "hi there\c" ; echo " ") >.echotmp
2075 if $contains c .echotmp >/dev/null 2>&1 ; then
2086 echo $n "The star should be here-->$c"
2090 : Now test for existence of everything in MANIFEST
2092 if test -f "$rsrc/MANIFEST"; then
2093 echo "First let's make sure your kit is complete. Checking..." >&4
2094 awk '$1 !~ /PACK[A-Z]+/ {print $1}' "$rsrc/MANIFEST" | \
2095 (split -l 50 2>/dev/null || split -50)
2098 for filelist in x??; do
2099 (cd "$rsrc"; ls `cat "$tmppwd/$filelist"` \
2100 >/dev/null 2>>"$tmppwd/missing")
2102 if test -s missing; then
2106 THIS PACKAGE SEEMS TO BE INCOMPLETE.
2108 You have the option of continuing the configuration process, despite the
2109 distinct possibility that your kit is damaged, by typing 'y'es. If you
2110 do, don't blame me if something goes wrong. I advise you to type 'n'o
2111 and contact the author (perlbug@perl.org).
2114 echo $n "Continue? [n] $c" >&4
2118 echo "Continuing..." >&4
2122 echo "ABORTING..." >&4
2127 echo "Looks good..."
2130 echo "There is no MANIFEST file. I hope your kit is complete !"
2134 : Find the appropriate value for a newline for tr
2136 if test -n "$DJGPP"; then
2139 if test X"$trnl" = X; then
2140 case "`echo foo|tr '\n' x 2>/dev/null`" in
2144 if test X"$trnl" = X; then
2145 case "`echo foo|tr '\012' x 2>/dev/null`" in
2146 foox) trnl='\012' ;;
2149 if test X"$trnl" = X; then
2150 case "`echo foo|tr '\r\n' xy 2>/dev/null`" in
2151 fooxy) trnl='\n\r' ;;
2154 if test X"$trnl" = X; then
2157 $me: Fatal Error: cannot figure out how to translate newlines with 'tr'.
2163 : compute the number of columns on the terminal for proper question formatting
2168 : set up the echo used in my read
2169 myecho="case \"\$xxxm\" in
2170 '') echo $n \"\$rp $c\" >&4;;
2172 '') echo $n \"[\$xxxm] $c\";;
2174 if test \`echo \"\$rp [\$xxxm] \" | wc -c\` -ge $COLUMNS; then
2176 echo $n \"[\$xxxm] $c\" >&4
2178 echo $n \"\$rp [\$xxxm] $c\" >&4
2184 : now set up to do reads with possible shell escape and default assignment
2190 case "\$fastread" in
2191 yes) case "\$dflt" in
2194 case "\$silent-\$rp" in
2199 *) case "\$silent" in
2200 true) case "\$rp" in
2205 while expr "X\$ans" : "X!" >/dev/null; do
2209 aok=''; eval "ans=\\"\$answ\\"" && aok=y
2217 set x \`expr "X\$ans" : "X!\(.*\)\$"\`
2226 set x \`expr "X\$ans" : "X&\(.*\)\$"\`
2231 echo "(OK, I'll run with -d after this question.)" >&4
2234 echo "*** Sorry, \$1 not supported yet." >&4
2244 echo "*** Substitution done -- please confirm."
2246 ans=\`echo $n "\$ans$c" | tr '$trnl' ' '\`
2251 echo "*** Error -- try again."
2258 case "\$ans\$xxxm\$nostick" in
2270 : create .config dir to save info across Configure sessions
2271 test -d ../.config || mkdir ../.config
2272 cat >../.config/README <<EOF
2273 This directory created by Configure to save information that should
2274 persist across sessions for $package.
2276 You may safely delete it if you wish.
2279 : See if we are using a devel version and want that
2280 xversion=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
2283 usedevel="$define" ;;
2284 *) case "$xversion" in
2287 *** WHOA THERE!!! ***
2289 This is an UNSTABLE DEVELOPMENT release.
2290 The version of this $package distribution is $xversion, that is, odd,
2291 (as opposed to even) and that signifies a development release.
2292 If you want a maintenance release, you want an even-numbered version.
2294 Do ***NOT*** install this into production use.
2295 Data corruption and crashes are possible.
2297 It is most seriously suggested that you do not continue any further
2298 unless you want to help in developing and debugging Perl.
2300 If you *still* want to build perl, you can answer 'y' now,
2301 or pass -Dusedevel to Configure.
2304 rp='Do you really want to continue?'
2308 [yY]) echo >&4 "Okay, continuing."
2309 usedevel="$define" ;;
2310 *) echo >&4 "Okay, bye."
2321 case "$versiononly" in
2322 '') versiononly="$define" ;;
2324 case "$installusrbinperl" in
2325 '') installusrbinperl="$undef" ;;
2330 : general instructions
2333 user=`(logname) 2>/dev/null`
2335 '') user=`whoami 2>&1`;;
2337 if $contains "^$user\$" ../.config/instruct >/dev/null 2>&1; then
2340 rp='Would you like to see the instructions?'
2351 This installation shell script will examine your system and ask you questions
2352 to determine how the perl5 package should be installed. If you get
2353 stuck on a question, you may use a ! shell escape to start a subshell or
2354 execute a command. Many of the questions will have default answers in square
2355 brackets; typing carriage return will give you the default.
2357 On some of the questions which ask for file or directory names you are allowed
2358 to use the ~name construct to specify the login directory belonging to "name",
2359 even if you don't have a shell which knows about that. Questions where this is
2360 allowed will be marked "(~name ok)".
2364 dflt='Type carriage return to continue'
2368 The prompter used in this script allows you to use shell variables and
2369 backticks in your answers. You may use $1, $2, etc... to refer to the words
2370 in the default answer, as if the default line was a set of arguments given to a
2371 script shell. This means you may also use $* to repeat the whole default line,
2372 so you do not have to re-type everything to add something to the default.
2374 Every time there is a substitution, you will have to confirm. If there is an
2375 error (e.g. an unmatched backtick), the default answer will remain unchanged
2376 and you will be prompted again.
2378 If you are in a hurry, you may run 'Configure -d'. This will bypass nearly all
2379 the questions and use the computed defaults (or the previous answers if there
2380 was already a config.sh file). Type 'Configure -h' for a list of options.
2381 You may also start interactively and then answer '& -d' at any prompt to turn
2382 on the non-interactive behaviour for the remainder of the execution.
2388 Much effort has been expended to ensure that this shell script will run on any
2389 Unix system. If despite that it blows up on yours, your best bet is to edit
2390 Configure and run it again. If you can't run Configure for some reason,
2391 you'll have to generate a config.sh file by hand. Whatever problems you
2392 have, let me (perlbug@perl.org) know how I blew it.
2394 This installation script affects things in two ways:
2396 1) it may do direct variable substitutions on some of the files included
2398 2) it builds a config.h file for inclusion in C programs. You may edit
2399 any of these files as the need arises after running this script.
2401 If you make a mistake on a question, there is no easy way to back up to it
2402 currently. The easiest thing to do is to edit config.sh and rerun all the SH
2403 files. Configure will offer to let you do this before it runs the SH files.
2406 dflt='Type carriage return to continue'
2408 case "$firsttime" in
2409 true) echo $user >>../.config/instruct;;
2413 : Set 'sysroot' to change the logical root directory to your headers and libraries see man gcc
2414 : This is primarily meant for cross-compile environments, and may fail to be useful in other cases
2415 if test "X$sysroot" = X; then
2420 echo "Using $sysroot to find your headers and libraries, adding to ccflags"
2421 # _sysroot is used in places where we need --sysroot=foo
2422 # but using the rest of the flags could cause issues.
2423 _sysroot="--sysroot=$sysroot";
2427 ccflags="$ccflags $_sysroot"
2432 ldflags="$ldflags $_sysroot"
2437 cppflags="$cppflags $_sysroot"
2439 # lddlflags updated below in lddlflags section;
2440 # same with cccdlflags
2444 # Adjust some defaults to also use $sysroot
2445 for var in xlibpth loclibpth locincpth glibpth; do
2448 for path in $xxx; do
2449 eval $var=\"\$$var $sysroot$path\"
2455 : find out where common programs are
2457 echo "Locating common programs..." >&4
2470 if test -d \$dir/\$thing; then
2476 for thisthing in \$dir/\$thing; do
2477 : just loop through to pick last item
2479 if test -f \$thisthing; then
2482 elif test "X$_exe" != X -a -f \$thisthing$_exe; then
2485 elif test -f \$dir/\$thing.exe; then
2486 if test -n "$DJGPP"; then
2487 echo \$dir/\$thing.exe
2488 elif test "$eunicefix" != ":"; then
2489 : on Eunice apparently
2542 pth=`echo $PATH | sed -e "s/$p_/ /g"`
2543 pth="$pth $sysroot/lib $sysroot/usr/lib"
2544 for file in $loclist; do
2548 if test -f "$xxx"; then
2551 echo "WARNING: no $xxx -- ignoring your setting for $file." >&4
2552 xxx=`./loc $file $file $pth`
2555 '') xxx=`./loc $file $file $pth`;;
2556 *) xxx=`./loc $xxx $xxx $pth`;;
2558 eval $file=$xxx$_exe
2562 echo $file is in $xxx.
2565 echo $file is in $xxx.
2568 echo "I don't know where '$file' is, and my life depends on it." >&4
2569 echo "Go find a public domain implementation or fix your PATH setting!" >&4
2575 echo "Don't worry if any of the following aren't found..."
2577 for file in $trylist; do
2581 if test -f "$xxx"; then
2584 echo "WARNING: no $xxx -- ignoring your setting for $file." >&4
2585 xxx=`./loc $file $file $pth`
2588 '') xxx=`./loc $file $file $pth`;;
2589 *) xxx=`./loc $xxx $xxx $pth`;;
2591 eval $file=$xxx$_exe
2595 echo $file is in $xxx.
2598 echo $file is in $xxx.
2601 echo "I don't see $file out there, $say."
2608 echo "Substituting grep for egrep."
2615 *) if $less -R </dev/null >/dev/null 2>&1; then
2616 echo "Substituting less -R for less."
2624 echo "Substituting cp for ln."
2633 echo "I can't find make or gmake, and my life depends on it." >&4
2634 echo "Go find a public domain implementation or fix your PATH setting!" >&4
2642 *) # We can't have osname yet.
2643 if test -f "/system/gnu_library/bin/ar.pm"; then # Stratus VOS
2644 # Assume that gmake, if found, is definitely GNU make
2645 # and prefer it over the system make.
2646 echo "Substituting gmake for make."
2654 echo "Hopefully test is built into your sh."
2657 if `sh -c "PATH= test true" >/dev/null 2>&1`; then
2658 echo "Using the test built into your sh."
2666 echo "Hopefully echo is built into your sh."
2671 echo "Checking compatibility between $echo and builtin echo (if any)..." >&4
2672 $echo $n "hi there$c" >foo1
2673 echo $n "hi there$c" >foo2
2674 if cmp foo1 foo2 >/dev/null 2>&1; then
2675 echo "They are compatible. In fact, they may be identical."
2682 They are not compatible! You are probably running ksh on a non-USG system.
2683 I'll have to use $echo instead of the builtin, since Bourne shell doesn't
2684 have echo built in and we may have to run some Bourne shell scripts. That
2685 means I'll have to use '$n$c' to suppress newlines now. Life is ridiculous.
2688 $echo $n "The star should be here-->$c"
2695 # This question was auctioned at YAPC::Europe-2007 in Vienna
2696 # I never promised you could answer it. I only auctioned the question.
2698 The following message is sponsored by
2700 Dresden.pm<--The stars should be here.
2702 Dear Perl user, system administrator or package
2703 maintainer, the Perl community sends greetings to
2704 you. Do you (emblematical) greet back [Y/n]? n
2708 : Check what type of C compiler we use
2712 cat <<'EOSC' >>trygcc
2717 int main(int argc, char *argv[]) {
2721 if $cc -o try $ccflags $ldflags try.c; then
2724 echo "Uh-oh, the C compiler '$cc' doesn't seem to be working." >&4
2730 # Skip this test because it gives a false match on output like:
2731 # ./trygcc: line 23: cc: command not found
2732 # case "`$cc -v -c try.c 2>&1`" in
2733 # *gcc*) trygcc=no ;;
2735 if $test X"$trygcc" = Xyes; then
2736 if gcc -o try -c try.c; then
2738 echo "You seem to have a working gcc, though." >&4
2739 # Switching compilers may undo the work of hints files.
2740 # The most common problem is -D_REENTRANT for threads.
2741 # This heuristic catches that case, but gets false positives
2742 # if -Dusethreads was not actually specified. Better to
2743 # bail out here with a useful message than fail
2744 # mysteriously later. Should we perhaps just try to
2745 # re-invoke Configure -Dcc=gcc config_args ?
2746 if $test -f usethreads.cbu; then
2749 *** However, any setting of the C compiler flags (e.g. for thread support)
2750 *** will be lost. It may be necessary for you to restart Configure and
2751 *** add -Dcc=gcc to your Configure command line.
2754 rp="Would you like to go ahead and try gcc anyway?"
2757 rp="Would you like to use it?"
2760 if $test -f myread; then
2763 if $test -f UU/myread; then
2766 echo "Cannot find myread, sorry. Aborting." >&2
2771 [yY]*) cc=gcc; ccname=gcc; ccflags=''; despair=no;
2784 cat <<'EOSC' >>checkcc
2789 int main(int argc, char *argv[]) {
2793 if $cc -o try $ccflags $ldflags try.c; then
2796 if $test X"$despair" = Xyes; then
2797 echo "Uh-oh, the C compiler '$cc' doesn't seem to be working." >&4
2800 You need to find a working C compiler.
2801 Either (purchase and) install the C compiler supplied by your OS vendor,
2802 or for a free C compiler try http://gcc.gnu.org/
2803 I cannot continue any further, aborting.
2812 : determine whether symbolic links are supported
2815 if $ln -s blurfl sym > /dev/null 2>&1 ; then
2816 echo "Symbolic links are supported." >&4
2819 echo "Symbolic links are NOT supported." >&4
2824 : determine whether symbolic links are supported
2828 echo "Checking how to test for symbolic links..." >&4
2830 if $test "X$issymlink" = X; then
2832 '') sh -c "PATH= test -h sym" >/dev/null 2>&1 ;;
2833 *) $newsh -c "PATH= test -h sym" >/dev/null 2>&1 ;;
2835 if test $? = 0; then
2838 echo "Your builtin 'test -h' may be broken." >&4
2841 *) pth=`echo $PATH | sed -e "s/$p_/ /g"`
2844 if test -f "$p/$test"; then
2853 echo "Trying external '$test -h'." >&4
2854 issymlink="$test -h"
2855 if $test ! -h sym >/dev/null 2>&1; then
2856 echo "External '$test -h' is broken, too." >&4
2864 if $test "X$issymlink" = X; then
2865 if $test -L sym 2>/dev/null; then
2866 issymlink="$test -L"
2867 echo "The builtin '$test -L' worked." >&4
2870 if $test "X$issymlink" != X; then
2871 echo "You can test for symbolic links with '$issymlink'." >&4
2873 echo "I do not know how you can test for symbolic links." >&4
2877 *) echo "No symbolic links, so not testing for their testing..." >&4
2882 : Make symlinks util
2883 case "$mksymlinks" in
2886 ''|'.') echo "Cannot create symlinks in the original directory." >&4
2889 *) case "$lns:$issymlink" in
2890 *"ln"*" -s:"*"test -"?)
2891 echo "Creating the symbolic links..." >&4
2893 awk '{print $1}' $src/MANIFEST | sed -e 's:/\([^/]*\)$: \1:' |
2903 print "# dir = ", dir, "file = ", file
2904 mf[dir] = mf[dir]" "source"/"dir"/"file;
2907 if (d != ".") { print("mkdir -p "d) }
2908 print("ln -sf "mf[d]" "d);
2910 }' source="$src" > UU/mksymlinks.$$
2914 if test ! -d t/base; then
2915 echo "Failed to create the subdirectories. Aborting." >&4
2919 if test ! -f t/base/lex.t; then
2920 echo "Failed to create the symlinks (t/base/lex.t missing). Aborting." >&4
2923 if test ! -f win32/win32.c; then
2924 echo "Failed to create the symlinks (win32/win32.c missing). Aborting." >&4
2929 *) echo "(I cannot figure out how to do symbolic links, ignoring mksymlinks)." >&4
2937 : Check for Cross-Compilation
2938 if $test "X$targethost" = "X"; then
2941 if $test "X$targetenv" = "X"; then
2944 case "$usecrosscompile" in
2946 $echo "Cross-compiling..."
2949 *-gcc*|*-g++*) # A cross-compiling gcc, probably.
2950 # arm-linux-androideabi-gcc -> arm-linux-androideabi
2951 # x86_64-w64-mingw32-gcc.exe -> x86_64-w64-mingw32
2952 targetarch=`$echo $cc|$sed 's/-g[c\+][c\+].*$//'`
2953 ar=`$echo $cc|$sed 's/-g[c\+][c\+]/-ar/'`
2954 # leave out ld, choosing it is more complex
2955 nm=`$echo $cc|$sed 's/-g[c\+][c\+]/-nm/'`
2956 ranlib=`$echo $cc|$sed 's/-g[c\+][c\+]/-ranlib/'`
2957 # We are in a weird spot. Just before us, some values
2958 # were 'saved', to be restored after the hints are
2959 # run. This means that the changes we made to ar,
2960 # nm and ranlib will get reverted.
2961 # To avoid that, we hijack the saving mechanism and
2962 # have it save our new values.
2963 for file in ar nm ranlib; do
2965 eval $file=$xxx$_exe
2970 case "$targetarch" in
2971 '') echo "Targetarch not defined." >&4; croak=y ;;
2972 *) echo "Using targetarch $targetarch." >&4 ;;
2974 case "$targethost" in
2975 '') echo "Targethost not defined." >&4; croak=y ;;
2976 *) echo "Using targethost $targethost." >&4
2981 y) echo "Cannot continue, aborting." >&4; exit 1 ;;
2983 : compile a host miniperl and generate_uudmap, unless we got passed them
2984 if $test "X$hostperl" = X; then
2985 echo "Building host miniperl and generate_uudmap binaries" >&4
2993 $src/Configure -des -Dusedevel -Dmksymlinks
2995 case "$hostgenerate" in
2996 '') $make generate_uudmap
2997 hostgenerate=$src/host/generate_uudmap
2999 "$undef") hostgenerate=''
3002 hostperl=$src/host/miniperl
3005 hostosname=`$hostperl -le 'print $^O'`
3008 usecrosscompile="$undef"
3012 : Define -Dtargethost=somecomputer to run compiled tests on another machine
3013 case "$targethost" in
3014 '') echo "Checking for cross-compile" >&4
3015 case "$usecrosscompile$multiarch" in
3016 *$define*) echo "Skipping the try tests in the rest of Configure as no targethost was defined when cross-compiling" >&4
3017 if [ -f Makefile ]; then
3019 echo "Now you must ensure config.sh, config.h and the generated headers exist and run a $make."
3021 echo "Configure done."
3025 *) echo "No targethost for running compiler tests against defined, running locally" >&4
3032 *) echo "Using targethost $targethost." >&4
3034 /*) run=$src/Cross/run
3035 targetmkdir=$src/Cross/mkdir
3037 from=$src/Cross/from
3039 *) pwd=`$test -f ../Configure & cd ..; pwd`
3041 targetmkdir=$pwd/Cross/mkdir
3043 from=$pwd/Cross/from
3046 case "$targetrun" in
3047 '') targetrun=ssh ;;
3052 case "$targetfrom" in
3053 '') targetfrom=scp ;;
3057 from=$from-$targetfrom
3058 case "$targetdir" in
3060 echo "Guessing targetdir $targetdir." >&4
3063 case "$targetuser" in
3065 echo "Guessing targetuser $targetuser." >&4
3068 case "$targetport" in
3070 echo "Guessing targetport $targetport." >&4
3073 case "$targetfrom" in
3077 case "$targetrun" in
3097 '') cwd=$targetdir ;;
3102 $targetrun -p $targetport -l $targetuser $targethost "cd \$cwd && \$env \$exe \$@"
3108 *) echo "Unknown targetrun '$targetrun'" >&4
3112 case "$targetmkdir" in
3114 cat >$targetmkdir <<EOF
3116 $targetrun -p $targetport -l $targetuser $targethost "mkdir -p \$@"
3118 $chmod a+rx $targetmkdir
3120 *) echo "Unknown targetmkdir '$targetmkdir'" >&4
3132 $targetmkdir \`dirname \$f\`
3133 $targetto -P $targetport -r $q \$f $targetuser@$targethost:\$f 2>/dev/null || exit 1
3136 $targetmkdir $targetdir/\`dirname \$f\`
3137 $targetto -P $targetport -r $q \$f $targetuser@$targethost:$targetdir/\$f 2>/dev/null || exit 1
3150 $mkdir -p $targetdir/\`dirname \$f\`
3151 $cp \$f $targetdir/\$f || exit 1
3154 $targetmkdir $targetdir/\`dirname \$f\`
3155 $cp \$f $targetdir/\$f || exit 1
3162 *) echo "Unknown targetto '$targetto'" >&4
3166 case "$targetfrom" in
3173 $targetfrom -P $targetport $q $targetuser@$targethost:$targetdir/\$f . || exit 1
3178 cp) cat >$from <<EOF
3183 cp $targetdir/\$f . || exit 1
3188 *) echo "Unknown targetfrom '$targetfrom'" >&4
3192 if $test ! -f $run; then
3193 echo "Target 'run' script '$run' not found." >&4
3197 if $test ! -f $to; then
3198 echo "Target 'to' script '$to' not found." >&4
3202 if $test ! -f $from; then
3203 echo "Target 'from' script '$from' not found." >&4
3207 if $test ! -f $run -o ! -f $to -o ! -f $from; then
3211 Using '$run' for remote execution,
3212 and '$from' and '$to'
3213 for remote file transfer.
3219 usecrosscompile="$undef"
3224 : see whether [:lower:] and [:upper:] are supported character classes
3226 case "`echo AbyZ | $tr '[:lower:]' '[:upper:]' 2>/dev/null`"-"`echo AbyZ | $tr '[:upper:]' '[:lower:]' 2>/dev/null`" in
3228 echo "Good, your tr supports [:lower:] and [:upper:] to convert case." >&4
3232 *) # There is a discontinuity in EBCDIC between 'R' and 'S'
3233 # (0xd9 and 0xe2), therefore that is a nice testing point.
3234 if test "X$up" = X -o "X$low" = X; then
3235 case "`echo RS | $tr '[R-S]' '[r-s]' 2>/dev/null`" in
3241 if test "X$up" = X -o "X$low" = X; then
3242 case "`echo RS | $tr R-S r-s 2>/dev/null`" in
3248 if test "X$up" = X -o "X$low" = X; then
3249 case "`echo RS | od -x 2>/dev/null`" in
3251 echo "Hey, this might be EBCDIC." >&4
3252 if test "X$up" = X -o "X$low" = X; then
3253 case "`echo RS | $tr '[A-IJ-RS-Z]' '[a-ij-rs-z]' 2>/dev/null`" in
3254 rs) up='[A-IJ-RS-Z]'
3259 if test "X$up" = X -o "X$low" = X; then
3260 case "`echo RS | $tr A-IJ-RS-Z a-ij-rs-z 2>/dev/null`" in
3270 case "`echo RS | $tr \"$up\" \"$low\" 2>/dev/null`" in
3272 echo "Using $up and $low to convert case." >&4
3275 echo "I don't know how to translate letters from upper to lower case." >&4
3276 echo "Your tr is not acting any way I know of." >&4
3280 : set up the translation script tr, must be called with ./tr of course
3284 '[A-Z][a-z]') exec $tr '$up' '$low';;
3285 '[a-z][A-Z]') exec $tr '$low' '$up';;
3292 : Try to determine whether config.sh was made on this system
3293 case "$config_sh" in
3295 myuname=`$uname -a 2>/dev/null`
3296 $test -z "$myuname" && myuname=`hostname 2>/dev/null`
3297 # Downcase everything to avoid ambiguity.
3298 # Remove slashes and single quotes so we can use parts of this in
3299 # directory and file names.
3300 # Remove newlines so myuname is sane to use elsewhere.
3301 # tr '[A-Z]' '[a-z]' would not work in EBCDIC
3302 # because the A-Z/a-z are not consecutive.
3303 myuname=`echo $myuname | $sed -e "s,['/],,g" | \
3304 ./tr '[A-Z]' '[a-z]' | $tr $trnl ' '`
3305 newmyuname="$myuname"
3307 case "$knowitall" in
3309 if test -f ../config.sh; then
3310 if $contains myuname= ../config.sh >/dev/null 2>&1; then
3311 eval "`grep myuname= ../config.sh`"
3313 if test "X$myuname" = "X$newmyuname"; then
3321 : Get old answers from old config file if Configure was run on the
3322 : same system, otherwise use the hints.
3325 if test -f config.sh; then
3327 rp="I see a config.sh file. Shall I use it to set the defaults?"
3330 n*|N*) echo "OK, I'll ignore it."
3331 mv config.sh config.sh.old
3332 myuname="$newmyuname"
3334 *) echo "Fetching default answers from your old config.sh file..." >&4
3342 : Older versions did not always set $sh. Catch re-use of such
3352 if test ! -f config.sh; then
3355 First time through, eh? I have some defaults handy for some systems
3356 that need some extra help getting the Configure answers right:
3359 (cd $src/hints; ls -C *.sh) | $sed 's/\.sh/ /g' >&4
3361 : Half the following guesses are probably wrong... If you have better
3362 : tests or hints, please send them to perlbug@perl.org
3363 : The metaconfig authors would also appreciate a copy...
3364 $test -f /irix && osname=irix
3365 $test -f /xenix && osname=sco_xenix
3366 $test -f /dynix && osname=dynix
3367 $test -f /dnix && osname=dnix
3368 $test -f /lynx.os && osname=lynxos
3369 $test -f /unicos && osname=unicos && osvers=`$uname -r`
3370 $test -f /unicosmk && osname=unicosmk && osvers=`$uname -r`
3371 $test -f /unicosmk.ar && osname=unicosmk && osvers=`$uname -r`
3372 $test -f /bin/mips && /bin/mips && osname=mips
3373 $test -d /usr/apollo/bin && osname=apollo
3374 $test -f /etc/saf/_sactab && osname=svr4
3375 $test -d /usr/include/minix && osname=minix && osvers=`$uname -r`
3376 $test -f /system/gnu_library/bin/ar.pm && osname=vos
3377 $test -f /sys/utilities/MultiView && osname=amigaos
3378 if $test -d /MachTen -o -d /MachTen_Folder; then
3380 if $test -x /sbin/version; then
3381 osvers=`/sbin/version | $awk '{print $2}' |
3382 $sed -e 's/[A-Za-z]$//'`
3383 elif $test -x /usr/etc/version; then
3384 osvers=`/usr/etc/version | $awk '{print $2}' |
3385 $sed -e 's/[A-Za-z]$//'`
3391 $test -f /sys/posix.dll &&
3392 $test -f /usr/bin/what &&
3393 set X `/usr/bin/what /sys/posix.dll` &&
3394 $test "$3" = UWIN &&
3398 if $test -f $uname; then
3406 umips) osname=umips ;;
3409 [23]100) osname=mips ;;
3411 tmp=`/bin/uname -X 2>/dev/null|awk '/3\.2v[45]/{ print $(NF) }'`
3412 if $test "$tmp" != "" -a "$3" = "3.2" -a -f '/etc/systemid'; then
3415 elif $test -f /etc/kconfig; then
3417 if test "$lns" = "$ln -s"; then
3419 elif $contains _SYSV3 /usr/include/stdio.h > /dev/null 2>&1 ; then
3421 elif $contains _POSIX_SOURCE /usr/include/stdio.h > /dev/null 2>&1 ; then
3428 if test -n "$DJGPP"; then
3437 tmp=`( (oslevel) 2>/dev/null || echo "not found") 2>&1`
3439 # oslevel can fail with:
3440 # oslevel: Unable to acquire lock.
3441 *not\ found) osvers="$4"."$3" ;;
3442 '<3240'|'<>3240') osvers=3.2.0 ;;
3443 '=3240'|'>3240'|'<3250'|'<>3250') osvers=3.2.4 ;;
3444 '=3250'|'>3250') osvers=3.2.5 ;;
3448 bitrig) osname=bitrig
3451 bsd386) osname=bsd386
3454 cygwin*) osname=cygwin
3457 *dc.osx) osname=dcosx
3463 domainos) osname=apollo
3469 dragonfly) osname=dragonfly
3472 dynixptx*) osname=dynixptx
3473 osvers=`echo "$4"|sed 's/^v//'`
3475 freebsd) osname=freebsd
3477 genix) osname=genix ;;
3481 osvers=`echo "$3" | $sed 's,.*\.\([0-9]*\.[0-9]*\),\1,'`
3494 $test -f /system/lib/libandroid.so && osname=linux-android
3498 netbsd*) osname=netbsd
3501 news-os) osvers="$3"
3503 4*) osname=newsos4 ;;
3507 nonstop-ux) osname=nonstopux ;;
3508 openbsd) osname=openbsd
3514 POSIX-BC | posix-bc ) osname=posix-bc
3517 powerux | power_ux | powermax_os | powermaxos | \
3518 powerunix | power_unix) osname=powerux
3524 solaris) osname=solaris
3526 5*) osvers=`echo $3 | $sed 's/^5/2/g'` ;;
3533 osvers=`echo $3 | $sed 's/^5/2/g'` ;;
3537 titanos) osname=titanos
3546 ultrix) osname=ultrix
3549 osf1|mls+) case "$5" in
3552 osvers=`sizer -v | awk -FUNIX '{print $2}' | awk '{print $1}' | tr '[A-Z]' '[a-z]' | sed 's/^[xvt]//'`
3555 *) osvers=`echo "$3" | sed 's/^[xvt]//'` ;;
3558 hp*) osname=hp_osf1 ;;
3559 mips) osname=mips_osf1 ;;
3562 # UnixWare 7.1.2 is known as Open UNIX 8
3563 openunix|unixware) osname=svr5
3571 $2) case "$osname" in
3575 : svr4.x or possibly later
3585 if test -f /stand/boot ; then
3586 eval `grep '^INITPROG=[a-z/0-9]*$' /stand/boot`
3587 if test -n "$INITPROG" -a -f "$INITPROG"; then
3588 isesix=`strings -a $INITPROG|grep 'ESIX SYSTEM V/386 Release 4.0'`
3589 if test -n "$isesix"; then
3597 *) if test -f /etc/systemid; then
3599 set `echo $3 | $sed 's/\./ /g'` $4
3600 if $test -f $src/hints/sco_$1_$2_$3.sh; then
3602 elif $test -f $src/hints/sco_$1_$2.sh; then
3604 elif $test -f $src/hints/sco_$1.sh; then
3609 '') : Still unknown. Probably a generic Sys V.
3618 *) case "$osname" in
3619 '') : Still unknown. Probably a generic BSD.
3627 if test -f /vmunix -a -f $src/hints/news_os.sh; then
3628 (what /vmunix | UU/tr '[A-Z]' '[a-z]') > UU/kernel.what 2>&1
3629 if $contains news-os UU/kernel.what >/dev/null 2>&1; then
3632 $rm -f UU/kernel.what
3633 elif test -d c:/. -o -n "$is_os2" ; then
3640 case "$targetarch" in
3643 case "$targetarch" in
3645 # Will load qnx.sh, which should change osname to nto
3650 # Catch arm-linux-androideabi, mipsel-linux-android,
3651 # and i686-linux-android
3652 osname=linux-android
3656 # Something like arm-linux-gnueabihf is really just
3663 # XXX perhaps we should just assume
3664 # osvers to be 2, or maybe take the value
3665 # from targetarch. Using $run before the
3666 # hints are run is somewhat icky.
3667 set X `$run $uname -a 2>/dev/null`
3670 5*) osvers=`echo $3 | $sed 's/^5/2/g'` ;;
3675 osname=`echo $targetarch|sed 's,^[^-]*-,,'`
3682 : Now look for a hint file osname_osvers, unless one has been
3683 : specified already.
3686 file=`echo "${osname}_${osvers}" | $sed -e 's%\.%_%g' -e 's%_$%%'`
3687 : Also try without trailing minor version numbers.
3688 xfile=`echo $file | $sed -e 's%_[^_]*$%%'`
3689 xxfile=`echo $xfile | $sed -e 's%_[^_]*$%%'`
3690 xxxfile=`echo $xxfile | $sed -e 's%_[^_]*$%%'`
3691 xxxxfile=`echo $xxxfile | $sed -e 's%_[^_]*$%%'`
3694 *) case "$osvers" in
3697 *) if $test -f $src/hints/$file.sh ; then
3699 elif $test -f $src/hints/$xfile.sh ; then
3701 elif $test -f $src/hints/$xxfile.sh ; then
3703 elif $test -f $src/hints/$xxxfile.sh ; then
3705 elif $test -f $src/hints/$xxxxfile.sh ; then
3707 elif $test -f "$src/hints/${osname}.sh" ; then
3716 if $test -f Policy.sh ; then
3719 none) dflt="Policy" ;;
3720 *) dflt="Policy $dflt" ;;
3725 dflt=`echo $hintfile | $sed 's/\.sh$//'`
3729 if $test -f Policy.sh ; then
3732 There's also a Policy hint file available, which should make the
3733 site-specific (policy) questions easier to answer.
3740 You may give one or more space-separated answers, or "none" if appropriate.
3741 If you have a handcrafted Policy.sh file or a Policy.sh file generated by a
3742 previous run of Configure, you may specify it as well as or instead of
3743 OS-specific hints. If hints are provided for your OS, you should use them:
3744 although Perl can probably be built without hints on many platforms, using
3745 hints often improve performance and may enable features that Configure can't
3746 set up on its own. If there are no hints that match your OS, specify "none";
3747 DO NOT give a wrong version or a wrong OS.
3751 rp="Which of these apply, if any?"
3754 for file in $tans; do
3755 if $test X$file = XPolicy -a -f Policy.sh; then
3757 $cat Policy.sh >> UU/config.sh
3758 elif $test -f $src/hints/$file.sh; then
3759 . $src/hints/$file.sh
3760 $cat $src/hints/$file.sh >> UU/config.sh
3761 elif $test X"$tans" = X -o X"$tans" = Xnone ; then
3764 : Give one chance to correct a possible typo.
3765 echo "$file.sh does not exist"
3767 rp="hint to use instead?"
3769 for file in $ans; do
3770 if $test -f "$src/hints/$file.sh"; then
3771 . $src/hints/$file.sh
3772 $cat $src/hints/$file.sh >> UU/config.sh
3773 elif $test X$ans = X -o X$ans = Xnone ; then
3776 echo "$file.sh does not exist -- ignored."
3783 : Remember our hint file for later.
3784 if $test -f "$src/hints/$file.sh" ; then
3794 echo "Fetching default answers from $config_sh..." >&4
3798 cp $config_sh config.sh 2>/dev/null
3810 : Restore computed paths
3811 for file in $loclist $trylist; do
3812 eval $file="\$_$file"
3817 Configure uses the operating system name and version to set some defaults.
3818 The default value is probably right if the name rings a bell. Otherwise,
3819 since spelling matters for me, either accept the default or answer "none"
3826 ''|' '|none) dflt=none ;;
3827 *) dflt=`echo $hintfile | $sed -e 's/\.sh$//' -e 's/_.*$//'` ;;
3830 *) dflt="$osname" ;;
3832 rp="Operating system name?"
3836 *) osname=`echo "$ans" | $sed -e 's/[ ][ ]*/_/g' | ./tr '[A-Z]' '[a-z]'`;;
3842 ''|' '|none) dflt=none ;;
3843 *) dflt=`echo $hintfile | $sed -e 's/\.sh$//' -e 's/^[^_]*//'`
3844 dflt=`echo $dflt | $sed -e 's/^_//' -e 's/_/./g'`
3846 ''|' ') dflt=none ;;
3851 *) dflt="$osvers" ;;
3853 rp="Operating system version?"
3863 : who configured the system
3864 cf_time=`LC_ALL=C; LANGUAGE=C; export LC_ALL; export LANGUAGE; $date 2>&1`
3867 cf_by=`(logname) 2>/dev/null`
3870 cf_by=`(whoami) 2>/dev/null`
3872 "") cf_by=unknown ;;
3877 : decide how portable to be. Allow command line overrides.
3878 case "$d_portable" in
3880 *) d_portable="$define" ;;
3883 : set up shell script to do ~ expansion
3889 echo \$1 | $sed "s|~|\${HOME-\$LOGDIR}|"
3892 if $test -f /bin/csh; then
3893 /bin/csh -f -c "glob \$1"
3898 name=\`$expr x\$1 : '..\([^/]*\)'\`
3899 dir=\`$sed -n -e "/^\${name}:/{s/^[^:]*:[^:]*:[^:]*:[^:]*:[^:]*:\([^:]*\).*"'\$'"/\1/" -e p -e q -e '}' </etc/passwd\`
3900 if $test ! -d "\$dir"; then
3902 echo "\$me: can't locate home directory for: \$name" >&2
3907 echo \$dir/\`$expr x\$1 : '..[^/]*/\(.*\)'\`
3923 : now set up to get a file name
3927 cat <<'EOSC' >>getfile
3943 : getfile will accept an answer from the comma-separated list
3944 : enclosed in parentheses even if it does not meet other criteria.
3945 expr "$fn" : '.*(\(.*\)).*' | $tr ',' $trnl >getfile.ok
3946 fn=`echo $fn | sed 's/(.*)//'`
3952 loc_file=`expr $fn : '.*:\(.*\)'`
3953 fn=`expr $fn : '\(.*\):.*'`
3961 */*) fullpath=true;;
3970 *e*) exp_file=true;;
3973 *p*) nopath_ok=true;;
3978 *d*) type='Directory';;
3979 *l*) type='Locate';;
3984 Locate) what='File';;
3989 case "$d_portable" in
3997 while test "$type"; do
4002 true) rp="$rp (~name ok)";;
4005 if test -f UU/getfile.ok && \
4006 $contains "^$ans\$" UU/getfile.ok >/dev/null 2>&1
4025 value=`UU/filexp $ans`
4028 if test "$ans" != "$value"; then
4029 echo "(That expands to $value on this system.)"
4043 /*) value="$ansexp" ;;
4044 [a-zA-Z]:/*) value="$ansexp" ;;
4049 echo "I shall only accept a full path name, as in /bin/ls." >&4
4050 echo "Use a ! shell escape if you wish to check pathnames." >&4
4053 echo "Please give a full path name, starting with slash." >&4
4056 echo "Note that using ~name is ok provided it expands well." >&4
4069 for fp in $gfpth; do
4070 if test "X$fp" = X.; then
4075 if test -f "$pf"; then
4077 elif test -r "$pf" || (test -h "$pf") >/dev/null 2>&1
4079 echo "($value is not a plain file, but that's ok.)"
4082 if test X"$type" = X; then
4089 for fp in $gfpth; do
4090 if test "X$fp" = X.; then
4095 direxp="$fp/$ansexp"
4097 if test -d "$direxp"; then
4105 if test -d "$ansexp"; then
4106 echo "(Looking for $loc_file in directory $value.)"
4107 value="$value/$loc_file"
4108 ansexp="$ansexp/$loc_file"
4110 if test -f "$ansexp"; then
4113 case "$nopath_ok" in
4114 true) case "$value" in
4116 *) echo "Assuming $value will be in people's path."
4132 if test "$fastread" = yes; then
4137 rp="$what $value doesn't exist. Use that name anyway?"
4156 test "X$gfpthkeep" != Xy && gfpth=""
4159 : determine root of directory hierarchy where package will be installed.
4162 dflt=`./loc . /usr/local /usr/local /local /opt /usr`
4165 dflt=`echo "$prefix" | sed 's/.$//'`
4173 By default, $package will be installed in $dflt/bin, manual pages
4174 under $dflt/man, etc..., i.e. with $dflt as prefix for all
4175 installation directories. Typically this is something like /usr/local.
4176 If you wish to have binaries under /usr/bin but other parts of the
4177 installation under /usr/local, that's ok: you will be prompted
4178 separately for each of the installation directories, the prefix being
4179 only used to set the defaults.
4183 rp='Installation prefix to use?'
4191 *) oldprefix="$prefix";;
4198 : allow them to override the AFS root
4201 *) afsroot=$afsroot ;;
4207 $define|true) afs=true ;;
4208 $undef|false) afs=false ;;
4209 *) if $test -d $afsroot; then
4217 echo "AFS may be running... I'll be extra cautious then..." >&4
4219 echo "AFS does not seem to be running..." >&4
4222 : determine installation prefix for where package is to be installed.
4226 Since you are running AFS, I need to distinguish the directory in which
4227 files will reside from the directory in which they are installed (and from
4228 which they are presumably copied to the former directory by occult means).
4231 case "$installprefix" in
4232 '') dflt=`echo $prefix | sed 's#^/afs/#/afs/.#'`;;
4233 *) dflt="$installprefix";;
4238 In some special cases, particularly when building $package for distribution,
4239 it is convenient to distinguish the directory in which files should be
4240 installed from the directory ($prefix) in which they will
4241 eventually reside. For most users, these two directories are the same.
4244 case "$installprefix" in
4246 *) dflt=$installprefix;;
4250 rp='What installation prefix should I use for installing files?'
4252 installprefix="$ans"
4253 installprefixexp="$ansexp"
4255 : Perform the prefixexp/installprefixexp correction if necessary
4256 cat <<EOS >installprefix
4259 cat <<'EOSC' >>installprefix
4260 : Change installation prefix, if necessary.
4261 if $test X"$prefix" != X"$installprefix"; then
4262 eval "install${prefixvar}=\`echo \$${prefixvar}exp | sed \"s#^\$prefixexp#\$installprefixexp#\"\`"
4264 eval "install${prefixvar}=\"\$${prefixvar}exp\""
4267 chmod +x installprefix
4268 $eunicefix installprefix
4270 : Set variables such as privlib and privlibexp from the output of ./getfile
4271 : performing the prefixexp/installprefixexp correction if necessary.
4272 cat <<EOS >setprefixvar
4275 cat <<'EOSC' >>setprefixvar
4276 eval "${prefixvar}=\"\$ans\""
4277 eval "${prefixvar}exp=\"\$ansexp\""
4280 chmod +x setprefixvar
4281 $eunicefix setprefixvar
4283 : set up the script used to warn in case of inconsistency
4292 '') echo "The $hint value for \$$var on this machine was \"$was\"!" >&4
4294 *) echo "Hmm. Based on the hints in hints/$hintfile.sh, " >&4
4295 echo "the $hint value for \$$var on this machine was \"$was\"!" >&4
4300 echo "*** WHOA THERE!!! ***" >&4
4301 echo " The $hint value for \$$var on this machine was \"$was\"!" >&4
4304 rp=" Keep the $hint value?"
4307 y) td=$was; tu=$was;;
4311 : function used to set '$1' to '$val'
4312 setvar='var=$1; eval "was=\$$1"; td=$define; tu=$undef;
4314 $define$undef) . ./whoa; eval "$var=\$td";;
4315 $undef$define) . ./whoa; eval "$var=\$tu";;
4316 *) eval "$var=$val";;
4319 : get the patchlevel
4321 echo "Getting the current patchlevel..." >&4
4322 if $test -r $rsrc/patchlevel.h;then
4323 revision=`awk '/define[ ]+PERL_REVISION/ {print $3}' $rsrc/patchlevel.h`
4324 patchlevel=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
4325 subversion=`awk '/define[ ]+PERL_SUBVERSION/ {print $3}' $rsrc/patchlevel.h`
4326 api_revision=`awk '/define[ ]+PERL_API_REVISION/ {print $3}' $rsrc/patchlevel.h`
4327 api_version=`awk '/define[ ]+PERL_API_VERSION/ {print $3}' $rsrc/patchlevel.h`
4328 api_subversion=`awk '/define[ ]+PERL_API_SUBVERSION/ {print $3}' $rsrc/patchlevel.h`
4329 perl_patchlevel=`egrep ',"(MAINT|SMOKE)[0-9][0-9]*"' $rsrc/patchlevel.h|tail -1|sed 's/[^0-9]//g'`
4338 $echo "(You do not have patchlevel.h. Eek.)"
4340 : Define a handy string here to avoid duplication in myconfig.SH and configpm.
4341 version_patchlevel_string="version $patchlevel subversion $subversion"
4342 case "$perl_patchlevel" in
4344 *) perl_patchlevel=`echo $perl_patchlevel | sed 's/.* //'`
4345 version_patchlevel_string="$version_patchlevel_string patch $perl_patchlevel"
4349 $echo "(You have $package $version_patchlevel_string.)"
4353 : XXX Should be a Configure test for double-dots in filenames.
4354 version=`echo $revision $patchlevel $subversion | \
4355 $awk '{ printf "%d_%d_%d", $1, $2, $3 }'`
4356 api_versionstring=`echo $api_revision $api_version $api_subversion | \
4357 $awk '{ printf "%d_%d_%d", $1, $2, $3 }'`
4360 version=`echo $revision $patchlevel $subversion | \
4361 $awk '{ printf "%d.%d.%d", $1, $2, $3 }'`
4362 api_versionstring=`echo $api_revision $api_version $api_subversion | \
4363 $awk '{ printf "%d.%d.%d", $1, $2, $3 }'`
4366 : Special case the 5.005_xx maintenance series, which used 5.005
4367 : without any subversion label as a subdirectory in $sitelib
4368 if test "${api_revision}${api_version}${api_subversion}" = "550"; then
4369 api_versionstring='5.005'
4372 : Do we want threads support and if so, what type
4373 case "$usethreads" in
4374 $define|true|[yY]*) dflt='y';;
4375 *) # Catch case where user specified ithreads or 5005threads but
4376 # forgot -Dusethreads (A.D. 4/2002)
4377 case "$useithreads$use5005threads" in
4378 *$define*) dflt='y';;
4385 Perl can be built to offer a form of threading support on some systems
4386 To do so, Configure can be run with -Dusethreads.
4388 Note that Perl built with threading support runs slightly slower
4389 and uses slightly more memory than plain Perl.
4391 If this doesn't make any sense to you, just accept the default '$dflt'.
4393 rp='Build a threading Perl?'
4396 y|Y) val="$define" ;;
4402 if $test $patchlevel -lt 9; then
4403 case "$usethreads" in
4405 : Default to ithreads unless overridden on command line or with
4408 case "$use5005threads" in
4410 echo "5.005 threads are no longer supported"
4414 case "$useithreads" in
4415 $undef|false|[nN]*) dflt='n';;
4417 rp='Use the newer interpreter-based ithreads?'
4420 y|Y) val="$define" ;;
4425 : Now set use5005threads to the opposite value.
4426 case "$useithreads" in
4427 $define) val="$undef" ;;
4434 useithreads="$undef"
4435 use5005threads="$undef"
4439 case "$useithreads$use5005threads" in
4443 You cannot have both the ithreads and the 5.005 threads enabled
4444 at the same time. Disabling the 5.005 threads since they are
4445 much less stable than the ithreads.
4448 use5005threads="$undef"
4453 : perl-5.9.x and later
4455 if test X"$usethreads" = "X$define"; then
4456 case "$use5005threads" in
4460 5.005 threads has been removed for 5.10. Perl will be built using ithreads.
4467 use5005threads="$undef"
4468 useithreads="$usethreads"
4471 case "$d_oldpthreads" in
4472 '') : Configure tests would be welcome here. For now, assume undef.
4474 *) val="$d_oldpthreads" ;;
4480 : Look for a hint-file generated 'call-back-unit'. If the
4481 : user has specified that a threading perl is to be built,
4482 : we may need to set or change some other defaults.
4483 if $test -f usethreads.cbu; then
4484 echo "Your platform has some specific hints regarding threaded builds, using them..."
4487 case "$usethreads" in
4488 "$define"|true|[yY]*)
4490 (Your platform does not have any specific hints for threaded builds.
4491 Assuming POSIX threads, then.)
4497 : Check if multiplicity is required
4500 Perl can be built so that multiple Perl interpreters can coexist
4501 within the same Perl executable.
4504 case "$useithreads" in
4507 This multiple interpreter support is required for interpreter-based threads.
4511 *) case "$usemultiplicity" in
4512 $define|true|[yY]*) dflt='y';;
4516 echo "If this doesn't make any sense to you, just accept the default '$dflt'."
4517 rp='Build Perl for multiplicity?'
4520 y|Y) val="$define" ;;
4528 : Check if morebits is requested
4529 case "$usemorebits" in
4530 "$define"|true|[yY]*)
4531 use64bitint="$define"
4532 uselongdouble="$define"
4533 usemorebits="$define"
4535 *) usemorebits="$undef"
4539 : Determine the C compiler to be used
4545 rp="Use which C compiler?"
4549 : See whether they have no cc but they do have gcc
4551 if $test -f cc.cbu; then
4556 : make some quick guesses about what we are up against
4558 $echo $n "Hmm... $c"
4568 $cat $sysroot/usr/include/signal.h $sysroot/usr/include/sys/signal.h >foo 2>/dev/null
4569 if test -f /osf_boot || $contains 'OSF/1' $sysroot/usr/include/ctype.h >/dev/null 2>&1
4571 echo "Looks kind of like an OSF/1 system, but we'll see..."
4573 elif test `echo abc | $tr a-z A-Z` = Abc ; then
4574 xxx=`./loc addbib blurfl $pth`
4575 if $test -f $xxx; then
4576 echo "Looks kind of like a USG system with BSD features, but we'll see..."
4580 if $contains SIGTSTP foo >/dev/null 2>&1 ; then
4581 echo "Looks kind of like an extended USG system, but we'll see..."
4583 echo "Looks kind of like a USG system, but we'll see..."
4587 elif $contains SIGTSTP foo >/dev/null 2>&1 ; then
4588 echo "Looks kind of like a BSD system, but we'll see..."
4592 echo "Looks kind of like a Version 7 system, but we'll see..."
4595 case "$eunicefix" in
4598 There is, however, a strange, musty smell in the air that reminds me of
4599 something...hmm...yes...I've got it...there's a VMS nearby, or I'm a Blit.
4603 : it so happens the Eunice I know will not run shell scripts in Unix format
4607 echo "Congratulations. You aren't running Eunice."
4611 : Detect OS2. The p_ variable is set above in the Head.U unit.
4612 : Note that this also -- wrongly -- detects e.g. dos-djgpp, which also uses
4613 : semicolon as a patch separator
4618 I have the feeling something is not exactly right, however...don't tell me...
4619 lemme think...does HAL ring a bell?...no, of course, you're only running OS/2!
4620 (Or you may be running DOS with DJGPP.)
4625 if test -f /xenix; then
4626 echo "Actually, this looks more like a XENIX system..."
4631 echo "It's not Xenix..."
4636 if test -f /venix; then
4637 echo "Actually, this looks more like a VENIX system..."
4644 echo "Nor is it Venix..."
4647 chmod +x bsd usg v7 osf1 eunice xenix venix os2
4648 $eunicefix bsd usg v7 osf1 eunice xenix venix os2
4651 : Check if we are using GNU gcc and what its version is
4653 echo "Checking for GNU cc in disguise and/or its version number..." >&4
4657 #if defined(__GNUC__) && !defined(__INTEL_COMPILER)
4659 printf("%s\n", __VERSION__);
4661 printf("%s\n", "1");
4667 if $cc -o try $ccflags $ldflags try.c; then
4668 gccversion=`$run ./try`
4669 case "$gccversion" in
4670 '') echo "You are not using GNU cc." ;;
4671 *) echo "You are using GNU cc $gccversion."
4677 echo "*** WHOA THERE!!! ***" >&4
4678 echo " Your C compiler \"$cc\" doesn't seem to be working!" >&4
4679 case "$knowitall" in
4681 echo " You'd better start hunting for one and let me know about it." >&4
4687 case "$gccversion" in
4688 1*) cpp=`./loc gcc-cpp $cpp $pth` ;;
4690 case "$gccversion" in
4691 '') gccosandvers='' ;;
4692 *) gccshortvers=`echo "$gccversion"|sed 's/ .*//'`
4693 gccosandvers=`$cc -v 2>&1|grep '/specs$'|sed "s!.*/[^-/]*-[^-/]*-\([^-/]*\)/$gccshortvers/specs!\1!"`
4695 case "$gccosandvers" in
4696 $osname) gccosandvers='' ;; # linux gccs seem to have no linux osvers, grr
4697 $osname$osvers) ;; # looking good
4698 $osname*) cat <<EOM >&4
4700 *** WHOA THERE!!! ***
4702 Your gcc has not been compiled for the exact release of
4703 your operating system ($gccosandvers versus $osname$osvers).
4705 In general it is a good idea to keep gcc synchronized with
4706 the operating system because otherwise serious problems
4707 may ensue when trying to compile software, like Perl.
4709 I'm trying to be optimistic here, though, and will continue.
4710 If later during the configuration and build icky compilation
4711 problems appear (headerfile conflicts being the most common
4712 manifestation), I suggest reinstalling the gcc to match
4713 your operating system release.
4717 *) gccosandvers='' ;; # failed to parse, better be silent
4725 # gcc 3.* complain about adding -Idirectories that they already know about,
4726 # so we will take those off from locincpth.
4727 case "$gccversion" in
4729 echo "main(){}">try.c
4730 for incdir in $locincpth; do
4731 warn=`$cc $ccflags -I$incdir -c try.c 2>&1 | \
4732 grep '^c[cp]p*[01]: warning: changing search order '`
4733 if test "X$warn" != X; then
4734 locincpth=`echo " $locincpth " | sed "s! $incdir ! !"`
4740 # gcc 4.9 by default does some optimizations that break perl.
4741 # see ticket 121505.
4743 # The -fwrapv disables those optimizations (and probably others,) so
4744 # for gcc 4.9 (and later, since the optimizations probably won't go
4745 # away), add -fwrapv unless the user requests -fno-wrapv, which
4746 # disables -fwrapv, or if the user requests -fsanitize=undefined,
4747 # which turns the overflows -fwrapv ignores into runtime errors.
4748 case "$gccversion" in
4749 4.[3-9].*|4.[1-9][0-9]*|[5-9].*|[1-9][0-9]*)
4751 *-fno-wrapv*|*-fsanitize=undefined*|*-fwrapv*) ;;
4752 *) ccflags="$ccflags -fwrapv" ;;
4756 : What should the include directory be ?
4757 : Use sysroot if set, so findhdr looks in the right place.
4759 $echo $n "Hmm... $c"
4760 dflt="$sysroot/usr/include"
4763 if $test -f /bin/mips && /bin/mips; then
4764 echo "Looks like a MIPS system..."
4765 $cat >usr.c <<'EOCP'
4766 #ifdef SYSTYPE_BSD43
4770 if $cc $cppflags -E usr.c > usr.out && $contains / usr.out >/dev/null 2>&1; then
4771 dflt='/bsd43/usr/include'
4775 mips_type='System V'
4777 $rm -f usr.c usr.out
4778 echo "and you're compiling with the $mips_type compiler and libraries."
4782 echo "Doesn't look like a MIPS system."
4792 case "$xxx_prompt" in
4795 rp='Where are the include files you want to use?'
4803 : see how we invoke the C preprocessor
4805 echo "Now, how can we feed standard input to your C preprocessor..." >&4
4806 cat <<'EOT' >testcpp.c
4812 if test ! -f cppstdin; then
4813 if test "X$osname" = "Xaix" -a "X$gccversion" = X; then
4814 # AIX cc -E doesn't show the absolute headerfile
4815 # locations but we'll cheat by using the -M flag.
4816 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
4818 echo 'cat >.$$.c; '"$cc $cppflags"' -E ${1+"$@"} .$$.c; rm .$$.c' >cppstdin
4821 echo "Keeping your $hint cppstdin wrapper."
4824 wrapper=`pwd`/cppstdin
4828 if $test "X$cppstdin" != "X" && \
4829 $cppstdin $cppminus <testcpp.c >testcpp.out 2>&1 && \
4830 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
4832 echo "You used to use $cppstdin $cppminus so we'll use that again."
4834 '') echo "But let's see if we can live without a wrapper..." ;;
4836 if $cpprun $cpplast <testcpp.c >testcpp.out 2>&1 && \
4837 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
4839 echo "(And we'll use $cpprun $cpplast to preprocess directly.)"
4842 echo "(However, $cpprun $cpplast does not work, let's see...)"
4850 echo "Good old $cppstdin $cppminus does not seem to be of any help..."
4857 elif echo 'Maybe "'"$cc"' -E" will work...'; \
4858 $cc -E <testcpp.c >testcpp.out 2>&1; \
4859 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4860 echo "Yup, it does."
4861 x_cpp="$cc $cppflags -E"
4863 elif echo 'Nope...maybe "'"$cc"' -E -" will work...'; \
4864 $cc -E - <testcpp.c >testcpp.out 2>&1; \
4865 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4866 echo "Yup, it does."
4867 x_cpp="$cc $cppflags -E"
4869 elif echo 'Nope...maybe "'"$cc"' -P" will work...'; \
4870 $cc -P <testcpp.c >testcpp.out 2>&1; \
4871 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4872 echo "Yipee, that works!"
4873 x_cpp="$cc $cppflags -P"
4875 elif echo 'Nope...maybe "'"$cc"' -P -" will work...'; \
4876 $cc -P - <testcpp.c >testcpp.out 2>&1; \
4877 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4878 echo "At long last!"
4879 x_cpp="$cc $cppflags -P"
4881 elif echo 'No such luck, maybe "'$cpp'" will work...'; \
4882 $cpp <testcpp.c >testcpp.out 2>&1; \
4883 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4885 x_cpp="$cpp $cppflags"
4887 elif echo 'Nixed again...maybe "'$cpp' -" will work...'; \
4888 $cpp - <testcpp.c >testcpp.out 2>&1; \
4889 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4890 echo "Hooray, it works! I was beginning to wonder."
4891 x_cpp="$cpp $cppflags"
4893 elif echo 'Uh-uh. Time to get fancy. Trying a wrapper...'; \
4894 $wrapper <testcpp.c >testcpp.out 2>&1; \
4895 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4901 rp="No dice. I can't find a C preprocessor. Name one:"
4905 $x_cpp <testcpp.c >testcpp.out 2>&1
4906 if $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4907 echo "OK, that will do." >&4
4909 echo "Sorry, I can't get that to work. Go find one and rerun Configure." >&4
4924 echo "Perhaps can we force $cc -E using a wrapper..."
4925 if $wrapper <testcpp.c >testcpp.out 2>&1; \
4926 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
4932 echo "Nope, we'll have to live without it..."
4946 "$wrapper"|'cppstdin') ;;
4947 *) $rm -f $wrapper;;
4949 $rm -f testcpp.c testcpp.out
4951 : Adjust cppfilter for path component separator
4953 vos) cppfilter="tr '\\\\>' '/' |" ;; # path component separator is >
4954 os2) cppfilter="sed -e 's|\\\\\\\\|/|g' |" ;; # path component separator is \
4958 : Use gcc to determine libpth and incpth
4959 # If using gcc or clang, we can get better values for libpth, incpth
4960 # and usrinc directly from the compiler.
4961 # Note that ccname for clang is also gcc.
4964 $echo 'extern int foo;' > try.c
4965 set X `$cppstdin -v try.c 2>&1 | $awk '/^#include </,/^End of search /'|$cppfilter $grep '/include'`
4967 if $test $# -gt 0; then
4969 incpth="`$echo $incpth|$sed 's/^ //'`"
4971 j="`$echo $i|$sed 's,/include$,/lib,'`"
4972 if $test -d $j; then
4976 libpth="`$echo $libpth|$sed 's/^ //'`"
4977 for xxx in $libpth $loclibpth $plibpth $glibpth; do
4978 if $test -d $xxx; then
4981 *) libpth="$libpth $xxx";;
4988 '') for i in $incpth; do
4989 if $test -f $i/errno.h -a -f $i/stdio.h -a -f $i/time.h; then
4997 case "$usecrosscompile" in
5000 '') echo "Incpth not defined." >&4; croak=y ;;
5001 *) echo "Using incpth '$incpth'." >&4 ;;
5004 '') echo "Libpth not defined." >&4; croak=y ;;
5005 *) echo "Using libpth '$libpth'." >&4 ;;
5008 '') echo "Usrinc not defined." >&4; croak=y ;;
5009 *) echo "Using usrinc $usrinc." >&4 ;;
5013 if test "X$sysroot" = X; then
5014 echo "Cannot continue, aborting." >&4; exit 1
5016 echo "Cross-compiling using sysroot $sysroot, failing to guess inc/lib paths is not fatal" >&4
5025 : Default value for incpth is just usrinc
5027 '') incpth="$usrinc";;
5030 : Set private lib path
5033 plibpth="$incpath/usr/lib $sysroot/usr/local/lib $sysroot/usr/ccs/lib"
5038 '') dlist="$loclibpth $plibpth $glibpth";;
5039 *) dlist="$libpth";;
5042 : Now check and see which directories actually exist, avoiding duplicates
5045 if $test -d $xxx; then
5048 *) libpth="$libpth $xxx";;
5054 Some systems have incompatible or broken versions of libraries. Among
5055 the directories listed in the question below, please remove any you
5056 know not to be holding relevant libraries, and add any that are needed.
5057 Say "none" for none.
5061 if test "X$sysroot" != X; then
5063 You have set sysroot to $sysroot, please supply the directories excluding sysroot
5076 rp="Directories to use for library searches?"
5083 : compute shared library extension
5086 if xxx=`./loc libc.sl X $libpth`; $test -f "$xxx"; then
5096 On some systems, shared libraries may be available. Answer 'none' if
5097 you want to suppress searching of shared libraries for the remainder
5098 of this configuration.
5101 rp='What is the file extension used for shared libraries?'
5105 : Does target system insist that shared library basenames are unique
5108 Some dynamic loaders assume that the *basename* of shared library filenames
5109 are globally unique. We'll default this to undef as we assume your system
5110 is not this weird. Set to defined if you're on one of them.
5115 rp='Make shared library basenames unique?'
5118 y|Y) val="$define" ;;
5121 set d_libname_unique
5124 : Define several unixisms.
5125 : Hints files or command line option can be used to override them.
5126 : The convoluted testing is in case hints files set either the old
5129 '') case "$exe_ext" in
5131 *) _exe="$exe_ext" ;;
5136 '') case "$lib_ext" in
5143 '') case "$obj_ext" in
5150 '') case "$path_sep" in
5161 rm_try="$rm -f try try$_exe a.out .out try.[cho] try.$_o core core.try* try.core*"
5163 : Which makefile gets called first. This is used by make depend.
5164 case "$firstmakefile" in
5165 '') firstmakefile='makefile';;
5168 : Check is we will use socks
5170 $define|true|[yY]*) dflt='y';;
5175 Perl can be built to use the SOCKS proxy protocol library. To do so,
5176 Configure must be run with -Dusesocks. If you use SOCKS you also need
5177 to use the PerlIO abstraction layer, this will be implicitly selected.
5179 If this doesn't make any sense to you, just accept the default '$dflt'.
5181 rp='Build Perl for SOCKS?'
5184 y|Y) val="$define" ;;
5190 : Check for uselongdouble support
5192 *-DUSE_LONG_DOUBLE*|*-DUSE_MORE_BITS*) uselongdouble="$define" ;;
5195 case "$uselongdouble" in
5196 $define|true|[yY]*) dflt='y';;
5201 Perl can be built to take advantage of long doubles which
5202 (if available) may give more accuracy and range for floating point numbers.
5204 If this doesn't make any sense to you, just accept the default '$dflt'.
5206 rp='Try to use long doubles if available?'
5209 y|Y) val="$define" ;;
5215 case "$uselongdouble" in
5216 true|[yY]*) uselongdouble="$define" ;;
5219 : Look for a hint-file generated 'call-back-unit'. If the
5220 : user has specified that long doubles should be used,
5221 : we may need to set or change some other defaults.
5222 if $test -f uselongdouble.cbu; then
5223 echo "Your platform has some specific hints regarding long doubles, using them..."
5224 . ./uselongdouble.cbu
5226 case "$uselongdouble" in
5229 (Your platform does not have any specific hints for long doubles.)
5235 : Check if quadmath is requested
5236 case "$usequadmath" in
5237 "$define"|true|[yY]*) usequadmath="$define" ;;
5238 *) usequadmath="$undef" ;;
5241 : Looking for optional libraries
5243 echo "Checking for optional libraries..." >&4
5248 case "$libswanted" in
5249 '') libswanted='c_s';;
5252 "$define") libswanted="$libswanted socks5 socks5_sh" ;;
5254 case "$usecbacktrace" in
5255 "$define") libswanted="$libswanted bfd" ;;
5257 case "$usequadmath" in
5258 "$define") libswanted="$libswanted quadmath" ;;
5264 for thisdir in $libpth $xlibpth; do
5265 test -d $thisdir && libspath="$libspath $thisdir"
5267 for thislib in $libswanted; do
5268 for thisdir in $libspath; do
5270 if $test ! -f "$xxx" -a "X$ignore_versioned_solibs" = "X"; then
5271 xxx=`ls $thisdir/lib$thislib.$so.[0-9] 2>/dev/null|sed -n '$p'`
5272 $test -f "$xxx" && eval $libscheck
5273 $test -f "$xxx" && libstyle=shared
5274 xxx=`ls $thisdir/lib$thislib.[0-9].$so 2>/dev/null|sed -n '$p'`
5275 $test -f "$xxx" && eval $libscheck
5276 $test -f "$xxx" && libstyle=shared
5278 if test ! -f "$xxx"; then
5279 xxx=$thisdir/lib$thislib.$so
5280 $test -f "$xxx" && eval $libscheck
5281 $test -f "$xxx" && libstyle=shared
5283 if test ! -f "$xxx"; then
5284 xxx=$thisdir/lib$thislib$_a
5285 $test -f "$xxx" && eval $libscheck
5286 $test -f "$xxx" && libstyle=static
5288 if test ! -f "$xxx"; then
5289 xxx=$thisdir/$thislib$_a
5290 $test -f "$xxx" && eval $libscheck
5291 $test -f "$xxx" && libstyle=static
5293 if test ! -f "$xxx"; then
5294 xxx=$thisdir/lib${thislib}_s$_a
5295 $test -f "$xxx" && eval $libscheck
5296 $test -f "$xxx" && libstyle=static
5297 $test -f "$xxx" && thislib=${thislib}_s
5299 if test ! -f "$xxx"; then
5300 xxx=$thisdir/Slib$thislib$_a
5301 $test -f "$xxx" && eval $libscheck
5302 $test -f "$xxx" && libstyle=static
5304 if $test -f "$xxx"; then
5306 shared) echo "Found -l$thislib (shared)." ;;
5307 static) echo "Found -l$thislib." ;;
5308 *) echo "Found -l$thislib ($libstyle)." ;;
5312 *) dflt="$dflt -l$thislib"
5313 libsfound="$libsfound $xxx"
5315 libsfiles="$libsfiles $yyy"
5316 yyy=`echo $xxx|$sed -e "s%/$yyy\\$%%"`
5317 case " $libsdirs " in
5319 *) libsdirs="$libsdirs $yyy" ;;
5326 if $test ! -f "$xxx"; then
5327 echo "No -l$thislib."
5338 ' '|'') dflt='none';;
5343 In order to compile $package on your machine, a number of libraries
5344 are usually needed. Include any other special libraries here as well.
5345 Say "none" for none. The default list is almost always right.
5349 rp="What libraries to use?"
5356 : determine optimization, if desired, or use for debug flag also
5358 ' '|$undef) dflt='none';;
5360 *) dflt="$optimize";;
5364 By default, $package compiles with the -O flag to use the optimizer.
5365 Alternately, you might want to use the symbolic debugger, which uses
5366 the -g flag (on traditional Unix systems). Either flag can be
5367 specified here. To use neither flag, specify the word "none".
5370 rp="What optimizer/debugger flag should be used?"
5374 'none') optimize=" ";;
5377 : Check what DEBUGGING is required from the command line
5378 : -DEBUGGING or -DDEBUGGING or
5379 : -DEBUGGING=both = -g + -DDEBUGGING
5380 : -DEBUGGING=-g or -Doptimize=-g = -g
5381 : -DEBUGGING=none or -UDEBUGGING =
5382 : -DEBUGGING=old or -DEBUGGING=default = ? $optimize
5385 *) DEBUGGING=$EBUGGING ;;
5388 case "$DEBUGGING" in
5392 *) optimize="$optimize -g" ;;
5396 *-g*) set `echo "X $optimize " | sed 's/ -g / /'`
5404 case "$DEBUGGING" in
5405 both|$define) dflt='-DDEBUGGING'
5408 : argument order is deliberate, as the flag will start with - which set could
5409 : think is an option
5410 checkccflag='check=$1; flag=$2; callback=$3;
5412 echo "Checking if your compiler accepts $flag" 2>&1;
5413 [ "X$sysroot" != "X" ] && echo "For sysroot = $sysroot";
5414 echo "int main(void) { return 0; }" > gcctest.c;
5415 if $cc $_sysroot -O2 $flag -o gcctest gcctest.c 2>gcctest.out && $run ./gcctest; then
5416 echo "Yes, it does." 2>&1;
5417 if $test -s gcctest.out ; then
5418 echo "But your platform does not like it:";
5423 echo "Leaving current flags $ccflags alone." 2>&1
5425 *) dflt="$dflt $flag";
5431 echo "Nope, it does not, but that is ok." 2>&1;
5435 : We will not override a previous value, but we might want to
5436 : augment a hint file
5438 default|recommended)
5439 case "$gccversion" in
5440 1*) dflt="$dflt -fpcc-struct-return" ;;
5442 case "$optimize:$DEBUGGING" in
5443 *-g*:old) dflt="$dflt -DDEBUGGING";;
5445 case "$gccversion" in
5446 2*) if $test -d /etc/conf/kconfig.d &&
5447 $contains _POSIX_VERSION $usrinc/sys/unistd.h >/dev/null 2>&1
5449 # Interactive Systems (ISC) POSIX mode.
5454 case "$gccversion" in
5457 ?*) set strict-aliasing -fno-strict-aliasing
5461 # For gcc, adding -pipe speeds up compilations for some, but apparently
5462 # some assemblers can't read from stdin. (It also slows down compilations
5463 # in other cases, but those are apparently rarer these days.) AD 5/2004.
5464 case "$gccversion" in
5470 # on x86_64 (at least) we require an extra library (libssp) in the
5471 # link command line. This library is not named, so I infer that it is
5472 # an implementation detail that may change. Hence the safest approach
5473 # is to add the flag to the flags passed to the compiler at link time,
5474 # as that way the compiler can do the right implementation dependant
5477 amigaos) ;; # -fstack-protector builds but doesn't work
5478 *) case "$gccversion" in
5479 ?*) set stack-protector-strong -fstack-protector-strong
5482 *-fstack-protector-strong*) ;; # It got added.
5483 *) # Try the plain/older -fstack-protector.
5484 set stack-protector -fstack-protector
5495 case "$mips_type" in
5496 *BSD*|'') inclwanted="$locincpth $usrinc";;
5497 *) inclwanted="$locincpth $inclwanted $usrinc/bsd";;
5499 for thisincl in $inclwanted; do
5500 if $test -d $thisincl; then
5501 if $test x$thisincl != x$usrinc; then
5503 *" -I$thisincl "*);;
5504 *) dflt="$dflt -I$thisincl ";;
5510 inctest='if $contains $2 $usrinc/$1 >/dev/null 2>&1; then
5512 elif $contains $2 $usrinc/sys/$1 >/dev/null 2>&1; then
5520 *) dflt="$dflt -D$2";;
5524 set signal.h LANGUAGE_C; eval $inctest
5528 ccflags="$ccflags -DSOCKS"
5533 default|recommended) dflt="$ccflags $dflt" ;;
5534 *) dflt="$ccflags";;
5543 Your C compiler may want other flags. For this question you should include
5544 -I/whatever and -DWHATEVER flags and any other flags used by the C compiler,
5545 but you should NOT include libraries or ld flags like -lwhatever. If you
5546 want $package to honor its debug switch, you should include -DDEBUGGING here.
5547 Your C compiler might also need additional flags, such as -D_POSIX_SOURCE.
5549 To use no flags, specify the word "none".
5555 rp="Any additional cc flags?"
5562 : the following weeds options from ccflags that are of no interest to cpp
5564 '') cppflags="$ccflags" ;;
5565 *) set X $ccflags; shift
5566 case " $cppflags " in
5567 *" $1 "*) ;; # Try to avoid doubling the cppflags.
5568 *) cppflags="$cppflags $ccflags" ;;
5572 case "$gccversion" in
5573 1*) cppflags="$cppflags -D__GNUC__"
5575 case "$mips_type" in
5577 *BSD*) cppflags="$cppflags -DSYSTYPE_BSD43";;
5583 echo "Let me guess what the preprocessor flags are..." >&4
5597 *) ftry="$previous $flag";;
5599 if $cppstdin -DLFRULB=bar $cppflags $ftry $cppminus <cpp.c \
5600 >cpp1.out 2>/dev/null && \
5601 $cpprun -DLFRULB=bar $cppflags $ftry $cpplast <cpp.c \
5602 >cpp2.out 2>/dev/null && \
5603 $contains 'foo.*xx.*bar' cpp1.out >/dev/null 2>&1 && \
5604 $contains 'foo.*xx.*bar' cpp2.out >/dev/null 2>&1
5606 cppflags="$cppflags $ftry"
5616 *-*) echo "They appear to be: $cppflags";;
5618 $rm -f cpp.c cpp?.out
5622 : flags used in final linking phase
5624 '') if ./venix; then
5630 *-posix*) dflt="$dflt -posix" ;;
5633 *) dflt="$ldflags";;
5635 # See note above about -fstack-protector
5637 *-fstack-protector-strong*)
5639 *-fstack-protector-strong*) ;; # Don't add it again
5640 *) dflt="$dflt -fstack-protector-strong" ;;
5643 *-fstack-protector*)
5645 *-fstack-protector*) ;; # Don't add it again
5646 *) dflt="$dflt -fstack-protector" ;;
5651 : Try to guess additional flags to pick up local libraries.
5652 for thislibdir in $libpth; do
5653 case " $loclibpth " in
5656 *"-L$thislibdir "*) ;;
5657 *) dflt="$dflt -L$thislibdir" ;;
5669 Your C linker may need flags. For this question you should
5670 include -L/whatever and any other flags used by the C linker, but you
5671 should NOT include libraries like -lwhatever.
5673 Make sure you include the appropriate -L/path flags if your C linker
5674 does not normally search all of the directories you specified above,
5677 To use no flags, specify the word "none".
5681 rp="Any additional ld flags (NOT including libraries)?"
5687 rmlist="$rmlist pdp11"
5691 echo "Checking your choice of C compiler and flags for coherency..." >&4
5692 $cat > try.c <<'EOF'
5694 int main() { printf("Ok\n"); return(0); }
5696 set X $cc -o try $optimize $ccflags $ldflags try.c $libs
5698 $cat >try.msg <<'EOM'
5699 I've tried to compile and run the following simple program:
5702 $cat try.c >> try.msg
5704 $cat >> try.msg <<EOM
5711 and I got the following output:
5715 if $sh -c "$cc -o try $optimize $ccflags $ldflags try.c $libs" >>try.msg 2>&1; then
5716 if $sh -c "$run ./try " >>try.msg 2>&1; then
5720 *) echo 'The program compiled OK, but produced no output.' >> try.msg ;;
5723 echo "The program compiled OK, but exited with status $?." >>try.msg
5724 rp="You have a problem. Shall I abort Configure"
5728 echo "I can't compile the test program." >>try.msg
5729 rp="You have a BIG problem. Shall I abort Configure"
5735 case "$knowitall" in
5737 echo "(The supplied flags or libraries might be incorrect.)"
5745 *) echo "Ok. Stopping Configure." >&4
5750 n) echo "OK, that should do.";;
5752 $rm_try gcctest gcctest.out
5754 : define a shorthand compile call
5758 case "$usedevel" in $define|true|[yY]*) if $test ! -f "${mc_file}.c"; then
5759 echo "Internal Configure script bug - compiler test file ${mc_file}.c is missing. Please report this to perlbug@perl.org" >&4;
5763 $cc -o ${mc_file} $optimize $ccflags $ldflags $* ${mc_file}.c $libs > /dev/null 2>&1;'
5764 : define a shorthand compile call for compilations that should be ok.
5768 $cc -o ${mc_file} $optimize $ccflags $ldflags $* ${mc_file}.c $libs;'
5770 : determine filename position in cpp output
5772 echo "Computing filename position in cpp output for #include directives..." >&4
5774 amigaos) fieldn=3 ;; # Workaround for a bug in abc (pdksh).
5779 vos) testaccess=-e ;;
5782 echo '#include <stdio.h>' > foo.c
5785 $cppstdin $cppflags $cppminus <foo.c 2>/dev/null | \
5786 $grep '^[ ]*#.*stdio\.h' | \
5787 while read cline; do
5790 while $test \$# -gt 0; do
5791 if $test $testaccess \`echo \$1 | $tr -d '"'\`; then
5796 pos=\`expr \$pos + 1\`
5810 *) pos="${fieldn}th";;
5812 echo "Your cpp writes the filename in the $pos field of the line."
5814 : locate header file
5819 for usrincdir in $incpth
5821 if test -f \$usrincdir/\$wanted; then
5822 echo "\$usrincdir/\$wanted"
5826 awkprg='{ print \$$fieldn }'
5827 echo "#include <\$wanted>" > foo\$\$.c
5828 $cppstdin $cppminus $cppflags < foo\$\$.c 2>/dev/null | \
5829 $cppfilter $grep "^[ ]*#.*\$wanted" | \
5830 while read cline; do
5831 name=\`echo \$cline | $awk "\$awkprg" | $tr -d '"'\`
5833 *[/\\\\]\$wanted) echo "\$name"; exit 1;;
5834 *[\\\\/]\$wanted) echo "\$name"; exit 1;;
5839 # status = 0: grep returned 0 lines, case statement not executed
5840 # status = 1: headerfile found
5841 # status = 2: while loop executed, no headerfile found
5845 if test \$status -eq 1; then
5852 : define an alternate in-header-list? function
5853 inhdr='echo " "; td=$define; tu=$undef; yyy=$@;
5854 cont=true; xxf="echo \"<\$1> found.\" >&4";
5855 case $# in 2) xxnf="echo \"<\$1> NOT found.\" >&4";;
5856 *) xxnf="echo \"<\$1> NOT found, ...\" >&4";;
5858 case $# in 4) instead=instead;; *) instead="at last";; esac;
5859 while $test "$cont"; do
5861 var=$2; eval "was=\$$2";
5862 if $test "$xxx" && $test -r "$xxx";
5864 eval "case \"\$$var\" in $undef) . ./whoa; esac"; eval "$var=\$td";
5867 eval "case \"\$$var\" in $define) . ./whoa; esac"; eval "$var=\$tu"; fi;
5868 set $yyy; shift; shift; yyy=$@;
5869 case $# in 0) cont="";;
5870 2) xxf="echo \"but I found <\$1> $instead.\" >&4";
5871 xxnf="echo \"and I did not find <\$1> either.\" >&4";;
5872 *) xxf="echo \"but I found <\$1\> instead.\" >&4";
5873 xxnf="echo \"there is no <\$1>, ...\" >&4";;
5877 do set $yyy; var=$2; eval "was=\$$2";
5878 eval "case \"\$$var\" in $define) . ./whoa; esac"; eval "$var=\$tu";
5879 set $yyy; shift; shift; yyy=$@;
5882 : see if stdlib is available
5883 set stdlib.h i_stdlib
5886 : check for lengths of integral types
5890 echo "Checking to see how big your integers are..." >&4
5899 printf("intsize=%d;\n", (int)sizeof(int));
5900 printf("longsize=%d;\n", (int)sizeof(long));
5901 printf("shortsize=%d;\n", (int)sizeof(short));
5906 if eval $compile_ok && $run ./try > /dev/null; then
5908 echo "Your integers are $intsize bytes long."
5909 echo "Your long integers are $longsize bytes long."
5910 echo "Your short integers are $shortsize bytes long."
5914 Help! I can't compile and run the intsize test program: please enlighten me!
5915 (This is probably a misconfiguration in your system or libraries, and
5916 you really ought to fix it. Still, I'll try anyway.)
5920 rp="What is the size of an integer (in bytes)?"
5924 rp="What is the size of a long integer (in bytes)?"
5928 rp="What is the size of a short integer (in bytes)?"
5936 : check for long long
5938 echo "Checking to see if you have long long..." >&4
5939 echo 'int main() { long long x = 7; return 0; }' > try.c
5941 if eval $compile; then
5943 echo "You have long long."
5946 echo "You do not have long long."
5952 : check for length of long long
5953 case "${d_longlong}${longlongsize}" in
5956 echo "Checking to see how big your long longs are..." >&4
5957 $cat >try.c <<'EOCP'
5961 printf("%d\n", (int)sizeof(long long));
5966 if eval $compile_ok; then
5967 longlongsize=`$run ./try`
5968 echo "Your long longs are $longlongsize bytes long."
5972 echo "(I can't seem to compile the test program. Guessing...)"
5973 rp="What is the size of a long long (in bytes)?"
5977 if $test "X$longsize" = "X$longlongsize"; then
5978 echo "(That isn't any different from an ordinary long.)"
5984 : see if inttypes.h is available
5985 : we want a real compile instead of Inhdr because some systems
5986 : have an inttypes.h which includes non-existent headers
5989 #include <inttypes.h>
5991 static int32_t foo32 = 0x12345678;
5995 if eval $compile; then
5996 echo "<inttypes.h> found." >&4
5999 echo "<inttypes.h> NOT found." >&4
6008 echo "Checking to see if you have int64_t..." >&4
6010 #include <sys/types.h>
6011 #$i_inttypes I_INTTYPES
6013 #include <inttypes.h>
6015 int main() { int64_t x = 7; }
6018 if eval $compile; then
6020 echo "You have int64_t."
6023 echo "You do not have int64_t."
6029 : Check if 64bit ints have a quad type
6031 echo "Checking which 64-bit integer type we could use..." >&4
6037 val='"unsigned int"'
6042 *) case "$longsize" in
6046 val='"unsigned long"'
6051 *) case "$d_longlong:$longlongsize" in
6056 val='"unsigned long long"'
6061 *) case "$d_int64_t" in
6080 '') echo "Alas, no 64-bit integer types in sight." >&4
6083 *) echo "We could use '$quadtype' for 64-bit integers." >&4
6088 : Do we want 64bit support
6089 case "$uselonglong" in
6090 "$define"|true|[yY]*)
6093 *** Configure -Duselonglong is deprecated, using -Duse64bitint instead.
6095 use64bitint="$define"
6098 case "$use64bits" in
6099 "$define"|true|[yY]*)
6102 *** Configure -Duse64bits is deprecated, using -Duse64bitint instead.
6104 use64bitint="$define"
6107 case "$use64bitints" in
6108 "$define"|true|[yY]*)
6111 *** There is no Configure -Duse64bitints, using -Duse64bitint instead.
6113 use64bitint="$define"
6116 case "$use64bitsint" in
6117 "$define"|true|[yY]*)
6120 *** There is no Configure -Duse64bitsint, using -Duse64bitint instead.
6122 use64bitint="$define"
6125 case "$uselonglongs" in
6126 "$define"|true|[yY]*)
6129 *** There is no Configure -Duselonglongs, using -Duse64bitint instead.
6131 use64bitint="$define"
6134 case "$use64bitsall" in
6135 "$define"|true|[yY]*)
6138 *** There is no Configure -Duse64bitsall, using -Duse64bitall instead.
6140 use64bitall="$define"
6145 *-DUSE_LONG_LONG*|*-DUSE_64_BIT_INT*|*-DUSE_64_BIT_ALL*) use64bitint="$define";;
6147 case "$use64bitall" in
6148 "$define"|true|[yY]*) use64bitint="$define" ;;
6154 You have natively 64-bit long integers.
6158 *) case "$use64bitint" in
6159 "$define"|true|[yY]*) dflt='y';;
6168 Perl can be built to take advantage of 64-bit integer types
6169 on some systems. To do so, Configure can be run with -Duse64bitint.
6170 Choosing this option will most probably introduce binary incompatibilities.
6172 If this doesn't make any sense to you, just accept the default '$dflt'.
6173 (The default has been chosen based on your configuration.)
6175 rp='Try to use 64-bit integers, if available?'
6178 [yY]*) val="$define" ;;
6186 case "$use64bitall" in
6187 "$define"|true|[yY]*) dflt='y' ;;
6188 *) case "$longsize" in
6196 You may also choose to try maximal 64-bitness. It means using as much
6197 64-bitness as possible on the platform. This in turn means even more
6198 binary incompatibilities. On the other hand, your platform may not
6199 have any more 64-bitness available than what you already have chosen.
6201 If this doesn't make any sense to you, just accept the default '$dflt'.
6202 (The default has been chosen based on your configuration.)
6204 rp='Try to use maximal 64-bit support, if available?'
6207 [yY]*) val="$define" ;;
6212 case "$use64bitall" in
6214 case "$use64bitint" in
6218 Since you have chosen a maximally 64-bit build, I'm also turning on
6219 the use of 64-bit integers.
6221 use64bitint="$define" ;;
6226 : Look for a hint-file generated 'call-back-unit'. If the
6227 : user has specified that a 64-bit perl is to be built,
6228 : we may need to set or change some other defaults.
6229 if $test -f use64bitint.cbu; then
6230 echo "Your platform has some specific hints regarding 64-bit integers, using them..."
6233 case "$use64bitint" in
6234 "$define"|true|[yY]*)
6235 : This test was common to all the OpenBSD forks, and seems harmless for
6238 echo "Checking if your C library has broken 64-bit functions..." >&4
6241 typedef $uquadtype myULL;
6248 {4294967303.15, 4294967303ULL},
6249 {4294967294.2, 4294967294ULL},
6250 {4294967295.7, 4294967295ULL},
6253 for (p = test; p->u; p++) {
6254 myULL x = (myULL)p->d;
6265 if eval $compile_ok; then
6266 libcquad=`$run ./try`
6267 echo "Your C library's 64-bit functions are $libcquad."
6269 echo "(I can't seem to compile the test program.)"
6270 echo "Assuming that your C library's 64-bit functions are ok."
6279 *** You have a C library with broken 64-bit functions.
6280 *** 64-bit support does not work reliably in this configuration.
6281 *** Please rerun Configure without -Duse64bitint and/or -Dusemorebits.
6282 *** Cannot continue, aborting.
6289 4) case "$archname64" in
6290 '') archname64=64int ;;
6297 : Look for a hint-file generated 'call-back-unit'. If the
6298 : user has specified that a maximally 64-bit perl is to be built,
6299 : we may need to set or change some other defaults.
6300 if $test -f use64bitall.cbu; then
6301 echo "Your platform has some specific hints regarding 64-bit builds, using them..."
6304 case "$use64bitall" in
6305 "$define"|true|[yY]*)
6307 4) case "$archname64" in
6308 ''|64int) archname64=64all ;;
6315 case "$d_quad:$use64bitint" in
6319 *** You have chosen to use 64-bit integers,
6320 *** but none can be found.
6321 *** Please rerun Configure without -Duse64bitint and/or -Dusemorebits.
6322 *** Cannot continue, aborting.
6329 : Check if we are using the GNU C library
6331 echo "Checking for GNU C Library..." >&4
6333 /* Find out version of GNU C library. __GLIBC__ and __GLIBC_MINOR__
6334 alone are insufficient to distinguish different versions, such as
6335 2.0.6 and 2.0.7. The function gnu_get_libc_version() appeared in
6336 libc version 2.1.0. A. Dougherty, June 3, 2002.
6342 # ifdef __GLIBC_MINOR__
6343 # if __GLIBC__ >= 2 && __GLIBC_MINOR__ >= 1 && !defined(__cplusplus)
6344 # include <gnu/libc-version.h>
6345 printf("%s\n", gnu_get_libc_version());
6347 printf("%d.%d\n", __GLIBC__, __GLIBC_MINOR__);
6350 printf("%d\n", __GLIBC__);
6359 if eval $compile_ok && $run ./try > glibc.ver; then
6361 gnulibc_version=`$cat glibc.ver`
6362 echo "You are using the GNU C Library version $gnulibc_version"
6366 echo "You are not using the GNU C Library"
6372 : see if nm is to be used to determine whether a symbol is defined or not
6376 case "$d_gnulibc" in
6379 echo "nm probably won't work on the GNU C Library." >&4
6385 if $test "$osname" = aix -a "X$PASE" != "Xdefine" -a ! -f /lib/syscalls.exp; then
6387 echo "Whoops! This is an AIX system without /lib/syscalls.exp!" >&4
6388 echo "'nm' won't be sufficient on this system." >&4
6394 '') dflt=`$egrep 'inlibc|csym' $rsrc/Configure | wc -l 2>/dev/null`
6395 if $test $dflt -gt 20; then
6405 true|$define) dflt=y;;
6412 I can use $nm to extract the symbols from your C libraries. This
6413 is a time consuming task which may generate huge output on the disk (up
6414 to 3 megabytes) but that should make the symbols extraction faster. The
6415 alternative is to skip the 'nm' extraction part and to compile a small
6416 test program instead to determine whether each symbol is present. If
6417 you have a fast C compiler and/or if your 'nm' output cannot be parsed,
6418 this may be the best solution.
6420 You probably shouldn't let me use 'nm' if you are using the GNU C Library.
6423 rp="Shall I use $nm to extract C symbols from the libraries?"
6426 [Nn]*) usenm=false;;
6435 : nm options which may be necessary
6437 '') if $test -f /mach_boot; then
6439 elif $test -d /usr/ccs/lib; then
6440 nm_opt='-p' # Solaris (and SunOS?)
6441 elif $test -f /dgux; then
6443 elif $test -f /lib64/rld; then
6444 nm_opt='-p' # 64-bit Irix
6450 : nm options which may be necessary for shared libraries but illegal
6451 : for archive libraries. Thank you, Linux.
6452 case "$nm_so_opt" in
6453 '') case "$myuname" in
6455 if $nm --help | $grep 'dynamic' > /dev/null 2>&1; then
6456 nm_so_opt='--dynamic'
6463 : Figure out where the libc is located
6466 : get list of predefined functions in a handy place
6471 *-lc_s*) libc=`./loc libc_s$_a $libc $libpth`
6477 *) for thislib in $libs; do
6480 : Handle C library specially below.
6483 thislib=`echo $thislib | $sed -e 's/^-l//'`
6484 if try=`./loc lib$thislib.$so.'*' X $libpth`; $test -f "$try"; then
6486 elif try=`./loc lib$thislib.$so X $libpth`; $test -f "$try"; then
6488 elif try=`./loc lib$thislib$_a X $libpth`; $test -f "$try"; then
6490 elif try=`./loc $thislib$_a X $libpth`; $test -f "$try"; then
6492 elif try=`./loc lib$thislib X $libpth`; $test -f "$try"; then
6494 elif try=`./loc $thislib X $libpth`; $test -f "$try"; then
6496 elif try=`./loc Slib$thislib$_a X $xlibpth`; $test -f "$try"; then
6501 libnames="$libnames $try"
6503 *) libnames="$libnames $thislib" ;;
6512 for xxx in $libpth; do
6513 $test -r $1 || set $xxx/libc.$so
6514 : The messy sed command sorts on library version numbers.
6516 set `echo blurfl; echo $xxx/libc.$so.[0-9]* | \
6517 tr ' ' $trnl | egrep -v '\.[A-Za-z]*$' | $sed -e '
6519 s/[0-9][0-9]*/0000&/g
6520 s/0*\([0-9][0-9][0-9][0-9][0-9]\)/\1/g
6523 $sort | $sed -e 's/^.* //'`
6526 $test -r $1 || set $sysroot/usr/ccs/lib/libc.$so
6527 $test -r $1 || set $sysroot/lib/libsys_s$_a
6533 if $test -r "$1"; then
6534 echo "Your (shared) C library seems to be in $1."
6536 elif $test -r /lib/libc && $test -r /lib/clib; then
6537 echo "Your C library seems to be in both /lib/clib and /lib/libc."
6539 libc='/lib/clib /lib/libc'
6540 if $test -r /lib/syslib; then
6541 echo "(Your math library is in /lib/syslib.)"
6542 libc="$libc /lib/syslib"
6544 elif $test -r "$libc" || (test -h "$libc") >/dev/null 2>&1; then
6545 echo "Your C library seems to be in $libc, as you said before."
6546 elif $test -r $incpath/usr/lib/libc$_a; then
6547 libc=$incpath/usr/lib/libc$_a;
6548 echo "Your C library seems to be in $libc. That's fine."
6549 elif $test -r /lib/libc$_a; then
6551 echo "Your C library seems to be in $libc. You're normal."
6553 if tans=`./loc libc$_a blurfl/dyick $libpth`; $test -r "$tans"; then
6555 elif tans=`./loc libc blurfl/dyick $libpth`; $test -r "$tans"; then
6556 libnames="$libnames "`./loc clib blurfl/dyick $libpth`
6557 elif tans=`./loc clib blurfl/dyick $libpth`; $test -r "$tans"; then
6559 elif tans=`./loc Slibc$_a blurfl/dyick $xlibpth`; $test -r "$tans"; then
6561 elif tans=`./loc Mlibc$_a blurfl/dyick $xlibpth`; $test -r "$tans"; then
6564 tans=`./loc Llibc$_a blurfl/dyick $xlibpth`
6566 if $test -r "$tans"; then
6567 echo "Your C library seems to be in $tans, of all places."
6573 if $test $xxx = apollo -o -r "$libc" || (test -h "$libc") >/dev/null 2>&1; then
6577 If the guess above is wrong (which it might be if you're using a strange
6578 compiler, or your machine supports multiple models), you can override it here.
6583 echo $libpth | $tr ' ' $trnl | $sort | $uniq > libpath
6585 I can't seem to find your C library. I've looked in the following places:
6588 $sed 's/^/ /' libpath
6591 None of these seems to contain your C library. I need to get its name...
6596 rp='Where is your C library?'
6601 echo $libc $libnames | $tr ' ' $trnl | $sort | $uniq > libnames
6602 set X `cat libnames`
6605 case $# in 1) xxx=file; esac
6606 echo "Extracting names from the following $xxx for later perusal:" >&4
6608 $sed 's/^/ /' libnames >&4
6610 $echo $n "This may take a while...$c" >&4
6614 *$so*) $nm $nm_so_opt $nm_opt $file 2>/dev/null;;
6615 *) $nm $nm_opt $file 2>/dev/null;;
6620 $grep fprintf libc.tmp > libc.ptf
6621 xscan='eval "<libc.ptf $com >libc.list"; $echo $n ".$c" >&4'
6622 xrun='eval "<libc.tmp $com >libc.list"; echo "done." >&4'
6624 if com="$sed -n -e 's/__IO//' -e 's/^.* $xxx *//p'";\
6626 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6628 elif com="$sed -n -e 's/^__*//' -e 's/^\([a-zA-Z_0-9$]*\).*xtern.*/\1/p'";\
6630 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6632 elif com="$sed -n -e '/|UNDEF/d' -e '/FUNC..GL/s/^.*|__*//p'";\
6634 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6636 elif com="$sed -n -e 's/^.* D __*//p' -e 's/^.* D //p'";\
6638 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6640 elif com="$sed -n -e 's/^_//' -e 's/^\([a-zA-Z_0-9]*\).*xtern.*text.*/\1/p'";\
6642 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6644 elif com="$sed -n -e 's/^.*|FUNC |GLOB .*|//p'";\
6646 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6648 elif com="$grep '|' | $sed -n -e '/|COMMON/d' -e '/|DATA/d' \
6649 -e '/ file/d' -e 's/^\([^ ]*\).*/\1/p'";\
6651 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6653 elif com="$sed -n -e 's/^.*|FUNC |GLOB .*|//p' -e 's/^.*|FUNC |WEAK .*|//p'";\
6655 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6657 elif com="$sed -n -e 's/^__//' -e '/|Undef/d' -e '/|Proc/s/ .*//p'";\
6659 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6661 elif com="$sed -n -e 's/^.*|Proc .*|Text *| *//p'";\
6663 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6665 elif com="$sed -n -e '/Def. Text/s/.* \([^ ]*\)\$/\1/p'";\
6667 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6669 elif com="$sed -n -e 's/^[-0-9a-f ]*_\(.*\)=.*/\1/p'";\
6671 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6673 elif com="$sed -n -e 's/.*\.text n\ \ \ \.//p'";\
6675 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6677 elif com="sed -n -e 's/^__.*//' -e 's/[ ]*D[ ]*[0-9]*.*//p'";\
6679 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6682 $nm -p $* 2>/dev/null >libc.tmp
6683 $grep fprintf libc.tmp > libc.ptf
6684 if com="$sed -n -e 's/^.* [ADTSIW] *_[_.]*//p' -e 's/^.* [ADTSIW] //p'";\
6685 eval $xscan; $contains '^fprintf$' libc.list >/dev/null 2>&1
6691 echo "$nm didn't seem to work right. Trying $ar instead..." >&4
6693 if $ar t $libc > libc.tmp && \
6694 $contains '^fprintf$' libc.tmp >/dev/null 2>&1
6696 for thisname in $libnames $libc; do
6697 $ar t $thisname >>libc.tmp
6699 $sed -e "s/\\$_o\$//" < libc.tmp > libc.list
6701 elif test "X$osname" = "Xos2" && $ar tv $libc > libc.tmp; then
6702 for thisname in $libnames $libc; do
6703 $ar tv $thisname >>libc.tmp
6704 emximp -o tmp.imp $thisname \
6706 $sed -e 's/^\([_a-zA-Z0-9]*\) .*$/\1/p' \
6707 < tmp.imp >>libc.tmp
6710 $sed -e "s/\\$_o\$//" -e 's/^ \+//' < libc.tmp > libc.list
6713 echo "$ar didn't seem to work right." >&4
6714 echo "Maybe this is a Cray...trying bld instead..." >&4
6716 $sed -e 's/.*\///' -e "s/\\$_o:.*\$//" > libc.list &&
6719 for thisname in $libnames; do
6721 $sed -e 's/.*\///' -e "s/\\$_o:.*\$//" >>libc.list
6722 $ar t $thisname >>libc.tmp
6726 echo "That didn't work either. Giving up." >&4
6736 echo "Since you are compiling for PASE, extracting more symbols from libc.a ...">&4
6737 dump -Tv /lib/libc.a | awk '$7 == "/unix" {print $5 " " $8}' | grep "^SV" | awk '{print $2}' >> libc.list
6739 *) if $test -f /lib/syscalls.exp; then
6741 echo "Also extracting names from /lib/syscalls.exp for good ole AIX..." >&4
6742 $sed -n 's/^\([^ ]*\)[ ]*syscall[0-9]*[ ]*$/\1/p' \
6743 /lib/syscalls.exp >>libc.list
6749 $rm -f libnames libpath
6751 : Check if we are using C++
6753 echo "Checking for C++..." >&4
6754 $cat >try.c <<'EOCP'
6766 if eval $compile_ok && $run ./try; then
6768 echo "You are using a C++ compiler."
6771 echo "You are not using a C++ compiler."
6777 : is a C symbol defined?
6780 -v) tf=libc.tmp; tdc="";;
6781 -a) tf=libc.tmp; tdc="[]";;
6782 *) tlook="^$1\$"; tf=libc.list; tdc="()";;
6784 case "$d_cplusplus" in
6785 $define) extern_C="extern \"C\"" ;;
6786 *) extern_C="extern" ;;
6789 case "$reuseval-$4" in
6791 true-*) tx=no; eval "tval=\$$4"; case "$tval" in "") tx=yes;; esac;;
6796 if $test "$runnm" = true; then
6797 if $contains $tlook $tf >/dev/null 2>&1; then
6799 elif $test "$mistrustnm" = compile -o "$mistrustnm" = run; then
6800 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;
6801 $cc -o try $optimize $ccflags $ldflags try.c >/dev/null 2>&1 $libs && tval=true;
6802 $test "$mistrustnm" = run -a -x try && { $run ./try$_exe >/dev/null 2>&1 || tval=false; };
6806 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;
6807 $cc -o try $optimize $ccflags $ldflags try.c $libs >/dev/null 2>&1 && tval=true;
6813 $define) tval=true;;
6820 : define an is-in-libc? function
6821 inlibc='echo " "; td=$define; tu=$undef;
6822 sym=$1; var=$2; eval "was=\$$2";
6824 case "$reuseval$was" in
6834 echo "$sym() found." >&4;
6835 case "$was" in $undef) . ./whoa; esac; eval "$var=\$td";;
6837 echo "$sym() NOT found." >&4;
6838 case "$was" in $define) . ./whoa; esac; eval "$var=\$tu";;
6842 $define) echo "$sym() found." >&4;;
6843 *) echo "$sym() NOT found." >&4;;
6847 : check for length of double
6849 case "$doublesize" in
6851 echo "Checking to see how big your double precision numbers are..." >&4
6860 printf("%d\n", (int)sizeof(double));
6865 if eval $compile_ok; then
6866 doublesize=`$run ./try`
6867 echo "Your double is $doublesize bytes long."
6870 echo "(I can't seem to compile the test program. Guessing...)"
6871 rp="What is the size of a double precision number (in bytes)?"
6879 : see if this is a float.h system
6883 : check for long doubles
6885 echo "Checking to see if you have long double..." >&4
6886 echo 'int main() { long double x = 7.0; }' > try.c
6888 if eval $compile; then
6890 echo "You have long double."
6893 echo "You do not have long double."
6899 : see if ldexpl exists
6903 : check for length of long double
6904 case "${d_longdbl}${longdblsize}" in
6907 echo "Checking to see how big your long doubles are..." >&4
6908 $cat >try.c <<'EOCP'
6912 printf("%d\n", sizeof(long double));
6917 if eval $compile; then
6918 longdblsize=`$run ./try`
6919 echo "Your long doubles are $longdblsize bytes long."
6923 echo "(I can't seem to compile the test program. Guessing...)" >&4
6924 rp="What is the size of a long double (in bytes)?"
6928 if $test "X$doublesize" = "X$longdblsize"; then
6929 echo "That isn't any different from an ordinary double."
6930 echo "I'll keep your setting anyway, but you may see some"
6931 echo "harmless compilation warnings."
6937 $echo "Checking the kind of long doubles you have..." >&4
6938 case "$d_longdbl" in
6943 #define LONGDBLSIZE $longdblsize
6944 #define DOUBLESIZE $doublesize
6952 static const long double d = -0.1L;
6954 unsigned const char* b = (unsigned const char*)(&d);
6955 #if DOUBLESIZE == LONGDBLSIZE
6956 printf("0\n"); /* if it floats like double */
6959 #if (LDBL_MANT_DIG == 113 || FLT128_MANT_DIG == 113) && LONGDBLSIZE == 16
6960 if (b[0] == 0x9A && b[1] == 0x99 && b[15] == 0xBF) {
6961 /* IEEE 754 128-bit little-endian */
6965 if (b[0] == 0xBF && b[14] == 0x99 && b[15] == 0x9A) {
6966 /* IEEE 128-bit big-endian, e.g. solaris sparc */
6971 /* For alignment 32-bit platforms have the 80 bits in 12 bytes,
6972 * while 64-bits platforms have it in 16 bytes. The trailing bytes
6973 * cannot be trusted. */
6974 #if LDBL_MANT_DIG == 64 && (LONGDBLSIZE == 16 || LONGDBLSIZE == 12)
6975 if (b[0] == 0xCD && b[9] == 0xBF) {
6976 /* x86 80-bit little-endian, sizeof 12 (ILP32, Solaris x86)
6977 * or 16 (LP64, Linux and OS X), 4 or 6 bytes of padding.
6978 * Also known as "extended precision". */
6982 if (b[0] == 0xBF && b[9] == 0xCD) {
6983 /* Is there ever big-endian 80-bit, really?
6985 * The Motorola 68881 had another "extended precision" format:
6986 * sign:1 exp:15 zero:16 integer:1 mantissa:63
6987 * for total of 96 bits of bytes. The zero bits were unused.
6988 * See "M68000 FAMILY PROGRAMMER’S REFERENCE MANUAL" for more details.
6989 * If it ever becomes relevant, this format should be allocated
6990 * a new doublekind code since it's quite different from the Intel x87.
6996 #if (LDBL_MANT_DIG == 106 || LDBL_MANT_DIG == 107) && LONGDBLSIZE == 16
6997 /* software "double double", the 106 is 53+53.
6998 * but irix thinks it is 107. */
6999 if (b[0] == 0x9A && b[7] == 0x3C && b[8] == 0x9A && b[15] == 0xBF) {
7000 /* double double 128-bit fully little-endian,
7001 * little-endian doubles in little-endian order,
7002 * 9a 99 99 99 99 99 59 3c 9a 99 99 99 99 99 b9 bf */
7006 if (b[0] == 0xBF && b[7] == 0x9A && b[8] == 0x3C && b[15] == 0x9A) {
7007 /* double double 128-bit fully big-endian,
7008 * big-endian doubles in big-endian order,
7009 * e.g. PPC/Power and MIPS:
7010 * bf b9 99 99 99 99 99 9a 3c 59 99 99 99 99 99 9a */
7014 if (b[0] == 0x9A && b[7] == 0xBF && b[8] == 0x9A && b[15] == 0x3C) {
7015 /* double double 128-bit mixed endian.
7016 * little-endian doubles in big-endian order,
7018 * 9a 99 99 99 99 99 b9 bf 9a 99 99 99 99 99 59 3c */
7022 if (b[0] == 0x3C && b[7] == 0x9A && b[8] == 0xBF && b[15] == 0x9A) {
7023 /* double double 128-bit mixed endian,
7024 * big-endian doubles in little-endian order,
7025 * 3c 59 99 99 99 99 99 9a bf b9 99 99 99 99 99 9a */
7030 printf("-1\n"); /* unknown */
7035 if eval $compile; then
7036 longdblkind=`$run ./try`
7043 case "$longdblkind" in
7044 0) echo "Your long doubles are doubles." >&4 ;;
7045 1) echo "You have IEEE 754 128-bit little endian long doubles." >&4 ;;
7046 2) echo "You have IEEE 754 128-bit big endian long doubles." >&4 ;;
7047 3) echo "You have x86 80-bit little endian long doubles." >& 4 ;;
7048 4) echo "You have x86 80-bit big endian long doubles." >& 4 ;;
7049 5) echo "You have 128-bit fully little-endian double-double long doubles (64-bit LEs in LE)." >& 4 ;;
7050 6) echo "You have 128-bit fully big-endian double-double long doubles (64-bit BEs in BE)." >& 4 ;;
7051 7) echo "You have 128-bit mixed double-double long doubles (64-bit LEs in BE)." >& 4 ;;
7052 8) echo "You have 128-bit mixed double-double long doubles (64-bit BEs in LE)." >& 4 ;;
7053 *) echo "Cannot figure out your long double." >&4 ;;
7057 : determine the architecture name
7059 if xxx=`./loc arch blurfl $pth`; $test -f "$xxx"; then
7060 tarch=`arch`"-$osname"
7061 elif xxx=`./loc uname blurfl $pth`; $test -f "$xxx" ; then
7062 if uname -m > tmparch 2>&1 ; then
7063 tarch=`$sed -e 's/ *$//' -e 's/ /_/g' \
7064 -e 's/$/'"-$osname/" tmparch`
7072 case "$myarchname" in
7075 echo "(Your architecture name used to be $myarchname.)"
7079 case "$targetarch" in
7081 *) archname=`echo $targetarch|sed 's,^[^-]*-,,'` ;;
7086 *) dflt="$archname";;
7088 rp='What is your architecture name'
7092 : optionally add API version to the architecture for versioned archlibs
7093 case "$useversionedarchname" in
7094 $define|true|[yY]*) dflt='y';;
7097 rp='Add the Perl API version to your archname?'
7100 y|Y) useversionedarchname="$define" ;;
7101 *) useversionedarchname="$undef" ;;
7103 case "$useversionedarchname" in
7106 *-$api_versionstring)
7107 echo "...and architecture name already has -$api_versionstring" >&4
7110 archname="$archname-$api_versionstring"
7111 echo "...setting architecture name to $archname." >&4
7117 case "$usethreads" in
7119 echo "Threads selected." >&4
7121 *-thread*) echo "...and architecture name already has -thread." >&4
7123 *) archname="$archname-thread"
7124 echo "...setting architecture name to $archname." >&4
7129 case "$usemultiplicity" in
7131 echo "Multiplicity selected." >&4
7133 *-multi*) echo "...and architecture name already has -multi." >&4
7135 *) archname="$archname-multi"
7136 echo "...setting architecture name to $archname." >&4
7141 case "$use64bitint$use64bitall" in
7143 case "$archname64" in
7145 echo "This architecture is naturally 64-bit, not changing architecture name." >&4
7148 case "$use64bitint" in
7149 "$define") echo "64 bit integers selected." >&4 ;;
7151 case "$use64bitall" in
7152 "$define") echo "Maximal 64 bitness selected." >&4 ;;
7155 *-$archname64*) echo "...and architecture name already has $archname64." >&4
7157 *) archname="$archname-$archname64"
7158 echo "...setting architecture name to $archname." >&4
7164 case "$uselongdouble" in
7166 echo "Long doubles selected." >&4
7167 case "$longdblsize" in
7169 echo "...but long doubles are equal to doubles, not changing architecture name." >&4
7173 *-ld*) echo "...and architecture name already has -ld." >&4
7175 *) archname="$archname-ld"
7176 echo "...setting architecture name to $archname." >&4
7183 case "$usequadmath" in
7185 echo "quadmath selected." >&4
7187 *-ld*) echo "...and architecture name already has -quadmath." >&4
7189 *) archname="$archname-quadmath"
7190 echo "...setting architecture name to $archname." >&4
7195 if $test -f archname.cbu; then
7196 echo "Your platform has some specific hints for architecture name, using them..."
7200 : set the prefixit variable, to compute a suitable default value
7201 prefixit='case "$3" in
7203 case "$oldprefix" in
7204 "") eval "$1=\"\$$2\"";;
7211 ""|" ") eval "$1=\"\$$2\"";;
7217 eval "tp=\"$oldprefix-\$$2-\""; eval "tp=\"$tp\"";
7219 --|/*--|\~*--) eval "$1=\"$prefix/$3\"";;
7220 /*-$oldprefix/*|\~*-$oldprefix/*)
7221 eval "$1=\`echo \$$2 | sed \"s,^$oldprefix,$prefix,\"\`";;
7222 *) eval "$1=\"\$$2\"";;
7226 : determine installation style
7227 : For now, try to deduce it from prefix unless it is already set.
7228 : Reproduce behavior of 5.005 and earlier, maybe drop that in 5.7.
7229 case "$installstyle" in
7230 '') case "$prefix" in
7231 *perl*) dflt='lib';;
7232 *) dflt='lib/perl5' ;;
7235 *) dflt="$installstyle" ;;
7237 : Probably not worth prompting for this since we prompt for all
7238 : the directories individually, and the prompt would be too long and
7242 : determine where public executables go
7247 rp='Pathname where the public executables will reside?'
7249 if $test "X$ansexp" != "X$binexp"; then
7253 : XXX Bug? -- ignores Configure -Dinstallprefix setting.
7254 : XXX If this is fixed, also fix the "start perl" hunk below, which relies on
7255 : this via initialinstalllocation
7258 case "$userelocatableinc" in
7259 $define|true|[yY]*) dflt='y' ;;
7264 Would you like to build Perl so that the installation is relocatable, so that
7265 library paths in @INC are determined relative to the path of the perl binary?
7266 This is not advised for system Perl installs, or if you need to run setid
7267 scripts or scripts under taint mode.
7269 If this doesn't make any sense to you, just accept the default '$dflt'.
7271 rp='Use relocatable @INC?'
7274 y|Y) val="$define" ;;
7277 set userelocatableinc
7280 initialinstalllocation="$binexp"
7281 : Default prefix is now "up one level from where the binaries are"
7282 case "$userelocatableinc" in
7288 installprefixexp=".../.."
7292 : determine where private library files go
7293 : Usual default is /usr/local/lib/perl5/$version.
7294 : Also allow things like /opt/perl/lib/$version, since
7295 : /opt/perl/lib/perl5... would be redundant.
7296 : The default "style" setting is made in installstyle.U
7297 case "$installstyle" in
7298 *lib/perl5*) set dflt privlib lib/$package/$version ;;
7299 *) set dflt privlib lib/$version ;;
7304 There are some auxiliary files for $package that need to be put into a
7305 private library directory that is accessible by everyone.
7310 rp='Pathname where the private library files will reside?'
7315 : set the prefixup variable, to restore leading tilda escape
7316 prefixup='case "$prefixexp" in
7318 *) eval "$1=\`echo \$$1 | sed \"s,^$prefixexp,$prefix,\"\`";;
7321 : determine where public architecture dependent libraries go
7324 : privlib default is /usr/local/lib/$package/$version
7325 : archlib default is /usr/local/lib/$package/$version/$archname
7326 : privlib may have an optional trailing /share.
7327 tdflt=`echo $privlib | $sed 's,/share$,,'`
7328 tdflt=$tdflt/$archname
7337 $spackage contains architecture-dependent library files. If you are
7338 sharing libraries in a heterogeneous environment, you might store
7339 these files in a separate location. Otherwise, you can just include
7340 them with the rest of the public library files.
7345 rp='Where do you want to put the public architecture-dependent libraries?'
7349 if $test X"$archlib" = X"$privlib"; then
7355 : see if setuid scripts can be secure
7358 Some kernels have a bug that prevents setuid #! scripts from being
7359 secure. Some sites have disabled setuid #! scripts because of this.
7361 First let's decide if your kernel supports secure setuid #! scripts.
7362 (If setuid #! scripts would be secure but have been disabled anyway,
7363 don't say that they are secure if asked.)
7368 if $test -d /dev/fd; then
7369 echo "#!$ls" >reflect
7370 chmod +x,u+s reflect
7371 ./reflect >flect 2>&1
7372 if $contains "/dev/fd" flect >/dev/null; then
7373 echo "Congratulations, your kernel has secure setuid scripts!" >&4
7377 If you are not sure if they are secure, I can check but I'll need a
7378 username and password different from the one you are using right now.
7379 If you don't have such a username or don't want me to test, simply
7383 rp='Other username to test security of setuid scripts with?'
7388 case "$d_suidsafe" in
7389 '') echo "I'll assume setuid scripts are *not* secure." >&4
7392 echo "Well, the $hint value is *not* secure." >&4
7394 *) echo "Well, the $hint value *is* secure." >&4
7399 $rm -f reflect flect
7400 echo "#!$ls" >reflect
7401 chmod +x,u+s reflect
7404 echo '"su" will (probably) prompt you for '"$ans's password."
7405 su $ans -c './reflect >flect'
7406 if $contains "/dev/fd" flect >/dev/null; then
7407 echo "Okay, it looks like setuid scripts are secure." >&4
7410 echo "I don't think setuid scripts are secure." >&4
7415 rp='Does your kernel have *secure* setuid scripts?'
7418 [yY]*) val="$define";;
7423 echo "I don't think setuid scripts are secure (no /dev/fd directory)." >&4
7424 echo "(That's for file descriptors, not floppy disks.)"
7430 $rm -f reflect flect
7432 : now see if they want to do setuid emulation
7433 if $test $patchlevel -lt 11; then
7436 case "$d_suidsafe" in
7439 echo "No need to emulate SUID scripts since they are secure here." >&4
7443 Some systems have disabled setuid scripts, especially systems where
7444 setuid scripts cannot be secure. On systems where setuid scripts have
7445 been disabled, the setuid/setgid bits on scripts are currently
7446 useless. It is possible for $package to detect those bits and emulate
7447 setuid/setgid in a secure fashion. This emulation will only work if
7448 setuid scripts have been disabled in your kernel.
7452 "$define") dflt=y ;;
7455 rp="Do you want to do setuid/setgid emulation?"
7458 [yY]*) val="$define";;
7470 SUID emulation has been removed for 5.12
7471 Please re-run Configure without -Dd_dosuid
7480 : Find perl5.005 or later.
7481 echo "Looking for a previously installed perl5.005 or later... "
7483 '') for tdir in `echo "$binexp$path_sep$PATH" | $sed "s/$path_sep/ /g"`; do
7484 : Check if this perl is recent and can load a simple module
7485 if $test -x $tdir/perl$exe_ext && $tdir/perl -Mless -e 'use 5.005;' >/dev/null 2>&1; then
7488 elif $test -x $tdir/perl5$exe_ext && $tdir/perl5 -Mless -e 'use 5.005;' >/dev/null 2>&1; then
7498 '') echo "None found. That's ok.";;
7499 *) echo "Using $perl5." ;;
7502 : Set the siteprefix variables
7505 After $package is installed, you may wish to install various
7506 add-on modules and utilities. Typically, these add-ons will
7507 be installed under $prefix with the rest
7508 of this package. However, you may wish to install such add-ons
7509 elsewhere under a different prefix.
7511 If you do not wish to put everything under a single prefix, that's
7512 ok. You will be prompted for the individual locations; this siteprefix
7513 is only used to suggest the defaults.
7515 The default should be fine for most people.
7519 rp='Installation prefix to use for add-on modules and utilities?'
7520 : XXX Here might be another good place for an installstyle setting.
7521 case "$siteprefix" in
7523 *) dflt=$siteprefix ;;
7526 : XXX Prefixit unit does not yet support siteprefix and vendorprefix
7528 case "$siteprefix" in
7532 *) oldsiteprefix="$prefix";;
7537 siteprefixexp="$ansexp"
7539 : determine where site specific libraries go.
7540 : Usual default is /usr/local/lib/perl5/site_perl/$version
7541 : The default "style" setting is made in installstyle.U
7542 : XXX No longer works with Prefixit stuff.
7543 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
7545 '') case "$installstyle" in
7546 *lib/perl5*) dflt=$siteprefix/lib/$package/site_$prog/$version ;;
7547 *) dflt=$siteprefix/lib/site_$prog/$version ;;
7555 The installation process will create a directory for
7556 site-specific extensions and modules. Most users find it convenient
7557 to place all site-specific files in this directory rather than in the
7558 main distribution directory.
7562 rp='Pathname for the site-specific library files?'
7566 sitelib_stem=`echo "$sitelibexp" | sed "s,/$version$,,"`
7568 : Determine list of previous versions to include in @INC
7569 $cat > getverlist <<EOPL
7572 \$api_versionstring = "$api_versionstring";
7573 \$version = "$version";
7574 \$stem = "$sitelib_stem";
7575 \$archname = "$archname";
7577 $cat >> getverlist <<'EOPL'
7578 # The list found is store twice for each entry: the original name, and
7579 # the binary broken down version as pack "sss", so sorting is easy and
7580 # unambiguous. This will work for all versions that have a maximum of
7581 # three digit groups, separate by '.'s or '_'s. Names are extended with
7582 # ".0.0" to ensure at least three elements for the pack.
7583 # -- H.Merijn Brand (m)'06 23-10-2006
7585 # Can't have leading @ because metaconfig interprets it as a command!
7586 ;@inc_version_list=();
7587 # XXX Redo to do opendir/readdir?
7590 ;@candidates = map {
7591 [ $_, pack "sss", split m/[._]/, "$_.0.0" ] } glob("5.*");
7592 ;@candidates = sort { $a->[1] cmp $b->[1]} @candidates;
7598 ($pversion, $aversion, $vsn5005) = map {
7599 pack "sss", split m/[._]/, "$_.0.0" } $version, $api_versionstring, "5.005";
7600 foreach $d (@candidates) {
7601 if ($d->[1] lt $pversion) {
7602 if ($d->[1] ge $aversion) {
7603 unshift(@inc_version_list, grep { -d } $d->[0]."/$archname", $d->[0]);
7605 elsif ($d->[1] ge $vsn5005) {
7606 unshift(@inc_version_list, grep { -d } $d->[0]);
7610 # Skip newer version. I.e. don't look in
7611 # 5.7.0 if we're installing 5.6.1.
7615 if (@inc_version_list) {
7616 print join(' ', @inc_version_list);
7619 # Blank space to preserve value for next Configure run.
7624 case "$inc_version_list" in
7625 '') if test -x "$perl5$exe_ext"; then
7626 dflt=`$perl5 getverlist`
7631 $undef) dflt='none' ;;
7632 *) eval dflt=\"$inc_version_list\" ;;
7635 ''|' ') dflt=none ;;
7642 In order to ease the process of upgrading, this version of perl
7643 can be configured to use modules built and installed with earlier
7644 versions of perl that were installed under $prefix. Specify here
7645 the list of earlier versions that this version of perl should check.
7646 If Configure detected no earlier versions of perl installed under
7647 $prefix, then the list will be empty. Answer 'none' to tell perl
7648 to not search earlier versions.
7650 The default should almost always be sensible, so if you're not sure,
7651 just accept the default.
7654 rp='List of earlier versions to include in @INC?'
7657 [Nn]one|''|' '|$undef) inc_version_list=' ' ;;
7658 *) inc_version_list="$ans" ;;
7660 case "$inc_version_list" in
7662 inc_version_list_init='0'
7663 d_inc_version_list="$undef"
7665 *) inc_version_list_init=`echo $inc_version_list |
7666 $sed -e 's/^/"/' -e 's/ /","/g' -e 's/$/",0/'`
7667 d_inc_version_list="$define"
7672 : see if malloc/malloc.h has to be included
7673 set malloc/malloc.h i_mallocmalloc
7676 : see if this is a malloc.h system
7677 : we want a real compile instead of Inhdr because some systems have a
7678 : malloc.h that just gives a compile error saying to use stdlib.h instead
7683 #$i_mallocmalloc I_MALLOCMALLOC
7684 #ifdef I_MALLOCMALLOC
7685 # include <malloc/malloc.h>
7688 int main () { return 0; }
7691 if eval $compile; then
7692 echo "<malloc.h> found." >&4
7695 echo "<malloc.h> NOT found." >&4
7702 : check for length of pointer
7706 echo "Checking to see how big your pointers are..." >&4
7715 printf("%d\n", (int)sizeof(void *));
7720 if eval $compile_ok; then
7721 ptrsize=`$run ./try`
7722 echo "Your pointers are $ptrsize bytes long."
7725 echo "(I can't seem to compile the test program. Guessing...)" >&4
7726 rp="What is the size of a pointer (in bytes)?"
7733 case "$use64bitall" in
7734 "$define"|true|[yY]*)
7738 *** You have chosen a maximally 64-bit build,
7739 *** but your pointers are only 4 bytes wide.
7740 *** Please rerun Configure without -Duse64bitall.
7745 *** Since you have quads, you could possibly try with -Duse64bitint.
7750 *** Cannot continue, aborting.
7761 : determine whether to use malloc wrapping
7763 case "$usemallocwrap" in
7764 [yY]*|true|$define) dflt='y' ;;
7765 [nN]*|false|$undef) dflt='n' ;;
7766 *) case "$usedevel" in
7767 [yY]*|true|$define) dflt='y' ;;
7772 rp="Do you wish to wrap malloc calls to protect against potential overflows?"
7774 usemallocwrap="$ans"
7777 usemallocwrap="$define" ;;
7779 usemallocwrap="$undef" ;;
7782 : determine which malloc to compile in
7784 case "$usemymalloc" in
7785 [yY]*|true|$define) dflt='y' ;;
7786 [nN]*|false|$undef) dflt='n' ;;
7787 *) case "$ptrsize" in
7791 if test "$useithreads" = "$define"; then dflt='n'; fi
7794 rp="Do you wish to attempt to use the malloc that comes with $package?"
7800 mallocsrc='malloc.c'
7801 mallocobj="malloc$_o"
7802 d_mymalloc="$define"
7805 : Remove malloc from list of libraries to use
7806 echo "Removing unneeded -lmalloc from library list" >&4
7807 set `echo X $libs | $sed -e 's/-lmalloc / /' -e 's/-lmalloc$//'`
7810 echo "libs = $libs" >&4
7822 : compute the return types of malloc and free
7824 $cat >malloc.c <<END
7828 #include <sys/types.h>
7842 case "$malloctype" in
7844 if $cc $ccflags -c -DTRY_MALLOC malloc.c >/dev/null 2>&1; then
7851 echo "Your system wants malloc to return '$malloctype', it would seem." >&4
7855 if $cc $ccflags -c -DTRY_FREE malloc.c >/dev/null 2>&1; then
7862 echo "Your system uses $freetype free(), it would seem." >&4
7864 : determine where site specific architecture-dependent libraries go.
7865 : sitelib default is /usr/local/lib/perl5/site_perl/$version
7866 : sitearch default is /usr/local/lib/perl5/site_perl/$version/$archname
7867 : sitelib may have an optional trailing /share.
7869 '') dflt=`echo $sitelib | $sed 's,/share$,,'`
7870 dflt="$dflt/$archname"
7875 set sitearch sitearch none
7879 The installation process will also create a directory for
7880 architecture-dependent site-specific extensions and modules.
7884 rp='Pathname for the site-specific architecture-dependent library files?'
7888 if $test X"$sitearch" = X"$sitelib"; then
7891 d_sitearch="$define"
7894 : Set the vendorprefix variables
7897 The installation process will also create a directory for
7898 vendor-supplied add-ons. Vendors who supply perl with their system
7899 may find it convenient to place all vendor-supplied files in this
7900 directory rather than in the main distribution directory. This will
7901 ease upgrades between binary-compatible maintenance versions of perl.
7903 Of course you may also use these directories in whatever way you see
7904 fit. For example, you might use them to access modules shared over a
7905 company-wide network.
7907 The default answer should be fine for most people.
7908 This causes further questions about vendor add-ons to be skipped
7909 and no vendor-specific directories will be configured for perl.
7912 rp='Do you want to configure vendor-specific add-on directories?'
7913 case "$usevendorprefix" in
7914 define|true|[yY]*) dflt=y ;;
7915 *) : User may have set vendorprefix directly on Configure command line.
7916 case "$vendorprefix" in
7925 rp='Installation prefix to use for vendor-supplied add-ons?'
7926 case "$vendorprefix" in
7927 '') dflt="$prefix" ;;
7928 *) dflt=$vendorprefix ;;
7931 : XXX Prefixit unit does not yet support siteprefix and vendorprefix
7933 case "$vendorprefix" in
7937 *) oldvendorprefix="$prefix";;
7941 usevendorprefix="$define"
7943 vendorprefixexp="$ansexp"
7945 *) usevendorprefix="$undef"
7951 : Set the vendorlib variables
7952 case "$vendorprefix" in
7953 '') d_vendorlib="$undef"
7957 *) d_vendorlib="$define"
7958 : determine where vendor-supplied modules go.
7959 : Usual default is /usr/local/lib/perl5/vendor_perl/$version
7960 case "$vendorlib" in
7962 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
7963 case "$installstyle" in
7964 *lib/perl5*) dflt=$vendorprefix/lib/$package/vendor_$prog/$version ;;
7965 *) dflt=$vendorprefix/lib/vendor_$prog/$version ;;
7968 *) dflt="$vendorlib"
7972 rp='Pathname for the vendor-supplied library files?'
7975 vendorlibexp="$ansexp"
7978 vendorlib_stem=`echo "$vendorlibexp" | sed "s,/$version$,,"`
7982 : Set the vendorarch variables
7983 case "$vendorprefix" in
7984 '') d_vendorarch="$undef"
7988 *) d_vendorarch="$define"
7989 : determine where vendor-supplied architecture-dependent libraries go.
7990 : vendorlib default is /usr/local/lib/perl5/vendor_perl/$version
7991 : vendorarch default is /usr/local/lib/perl5/vendor_perl/$version/$archname
7992 : vendorlib may have an optional trailing /share.
7993 case "$vendorarch" in
7994 '') dflt=`echo $vendorlib | $sed 's,/share$,,'`
7995 dflt="$dflt/$archname"
7997 *) dflt="$vendorarch" ;;
8000 rp='Pathname for vendor-supplied architecture-dependent files?'
8003 vendorarchexp="$ansexp"
8006 prefixvar=vendorarch
8008 if $test X"$vendorarch" = X"$vendorlib"; then
8009 d_vendorarch="$undef"
8011 d_vendorarch="$define"
8014 : Final catch-all directories to search
8017 Lastly, you can have perl look in other directories for extensions and
8018 modules in addition to those already specified.
8019 These directories will be searched after
8023 test X"$vendorlib" != "X" && echo ' ' $vendorlib
8024 test X"$vendorarch" != "X" && echo ' ' $vendorarch
8026 case "$otherlibdirs" in
8027 ''|' ') dflt='none' ;;
8028 *) dflt="$otherlibdirs" ;;
8031 Enter a colon-separated set of extra paths to include in perl's @INC
8032 search path, or enter 'none' for no extra paths.
8036 rp='Colon-separated list of additional directories for perl to search?'
8039 ' '|''|none) otherlibdirs=' ' ;;
8040 *) otherlibdirs="$ans" ;;
8042 case "$otherlibdirs" in
8046 set d_perl_otherlibdirs
8049 : Cruising for prototypes
8051 echo "Checking out function prototypes..." >&4
8052 $cat >prototype.c <<EOCP
8057 int main(int argc, char *argv[]) {
8060 if $cc $ccflags -c prototype.c >prototype.out 2>&1 ; then
8061 echo "Your C compiler appears to support function prototypes."
8064 echo "Your C compiler doesn't seem to understand function prototypes."
8071 : Check if ansi2knr is required
8072 case "$prototype" in
8074 *) ansi2knr='ansi2knr'
8079 This version of $package can only be compiled by a compiler that
8080 understands function prototypes. Unfortunately, your C compiler
8082 doesn't seem to understand them. Sorry about that.
8084 If GNU cc is available for your system, perhaps you could try that instead.
8086 Eventually, we hope to support building Perl with pre-ANSI compilers.
8087 If you would like to help in that effort, please contact <perlbug@perl.org>.
8089 Aborting Configure now.
8096 dflt_dtrace='/usr/sbin/dtrace'
8097 $test -x /usr/bin/dtrace && dflt_dtrace='/usr/bin/dtrace'
8101 Perl can be built to support DTrace on platforms that support it.
8102 DTrace is a diagnosis and performance analysis tool from Sun.
8104 If this doesn't make any sense to you, just accept the default.
8108 case "$usedtrace" in
8114 dflt_dtrace=$usedtrace
8121 rp='Support DTrace if available?'
8124 y|Y) val="$define" ;;
8130 test "X$usedtrace" != "X$define" && break
8133 rp='Where is the dtrace executable?'
8142 if $dtrace -h -s ../perldtrace.d \
8143 -o perldtrace.tmp >/dev/null 2>&1 \
8144 && rm -f perldtrace.tmp
8147 echo "Good: your $dtrace knows about the -h flag."
8151 *** $me: Fatal Error: $dtrace doesn't support -h flag
8153 *** Your installed dtrace doesn't support the -h switch to compile a D
8154 *** program into a C header. Can't continue.
8166 *** $me: Fatal Error: $dtrace not found.
8173 echo "*** $dtrace was not found."
8179 case "$usedtrace" in
8181 case "$dtraceobject" in
8183 dtraceobject=$define
8186 $dtrace -h -s ../perldtrace.d -o perldtrace.h
8188 #include "perldtrace.h"
8190 PERL_LOADED_FILE("dummy");
8195 if $cc -c -o try.o $optimize $ccflags try.c \
8196 && $dtrace -G -s ../perldtrace.d try.o >/dev/null 2>&1; then
8197 dtraceobject=$define
8198 echo "Your dtrace builds an object file"
8200 $rm -f try.c try.o perldtrace.o
8202 *) dtraceobject=$undef ;;
8206 : See if we want extra modules installed
8213 Perl can be built with extra modules or bundles of modules which
8214 will be fetched from the CPAN and installed alongside Perl.
8216 Notice that you will need access to the CPAN; either via the Internet,
8217 or a local copy, for example a CD-ROM or a local CPAN mirror. (You will
8218 be asked later to configure the CPAN.pm module which will in turn do
8219 the installation of the rest of the extra modules or bundles.)
8221 Notice also that if the modules require any external software such as
8222 libraries and headers (the libz library and the zlib.h header for the
8223 Compress::Zlib module, for example) you MUST have any such software
8224 already installed, this configuration process will NOT install such
8227 If this doesn't make any sense to you, just accept the default '$dflt'.
8229 rp='Install any extra modules (y or n)?'
8235 Please list any extra modules or bundles to be installed from CPAN,
8236 with spaces between the names. The names can be in any format the
8237 'install' command of CPAN.pm will understand. (Answer 'none',
8238 without the quotes, to install no extra modules or bundles.)
8248 $rm -f ../extras.lst
8250 *) echo "(Saving the list of extras for later...)"
8251 echo "$extras" > ../extras.lst
8259 : determine where html pages for programs go
8260 set html1dir html1dir none
8264 If you wish to install html files for programs in $spackage, indicate
8265 the appropriate directory here. To skip installing html files,
8269 ''|none|$undef|' ') dflt=none ;;
8270 *) dflt=$html1dir ;;
8273 rp="Directory for the main $spackage html pages?"
8277 : Use ' ' for none so value is preserved next time through Configure
8278 $test X"$html1dir" = "X" && html1dir=' '
8280 : determine where html pages for libraries and modules go
8281 set html3dir html3dir none
8285 If you wish to install html files for modules associated with $spackage,
8286 indicate the appropriate directory here. To skip installing html files,
8289 : There is no obvious default. If they have specified html1dir, then
8290 : try to key off that, possibly changing .../html1 into .../html3.
8292 '') html3dir=`echo "$html1dir" | $sed 's/1$/3$/'` ;;
8293 *) dflt=$html3dir ;;
8296 rp="Directory for the $spackage module html pages?"
8300 : Use ' ' for none so value is preserved next time through Configure
8301 $test X"$html3dir" = "X" && html3dir=' '
8303 : determine whether to install perl also as /usr/bin/perl
8306 if $test -d /usr/bin -a "X$installbin" != X/usr/bin; then
8308 Many scripts expect perl to be installed as /usr/bin/perl.
8310 If you want to, I can install the perl you are about to compile
8311 as /usr/bin/perl (in addition to $bin/perl).
8313 if test -f /usr/bin/perl; then
8316 However, please note that because you already have a /usr/bin/perl,
8317 overwriting that with a new Perl would very probably cause problems.
8318 Therefore I'm assuming you don't want to do that (unless you insist).
8321 case "$installusrbinperl" in
8322 "$define"|[yY]*) dflt='y';;
8328 Since you don't have a /usr/bin/perl I'm assuming creating one is okay.
8331 case "$installusrbinperl" in
8332 "$undef"|[nN]*) dflt='n';;
8336 rp="Do you want to install perl as /usr/bin/perl?"
8339 [yY]*) val="$define";;
8345 set installusrbinperl
8348 : see if dlopen exists
8350 xxx_ccflags="$ccflags"
8352 : with g++ one needs -shared to get is-in-libc to work for dlopen
8353 case "$gccversion" in
8356 *) case "$d_cplusplus" in
8357 "$define") ccflags="$ccflags -shared" ;;
8364 ccflags="$xxx_ccflags"
8366 : see if this is a unistd.h system
8367 set unistd.h i_unistd
8370 : determine which dynamic loading, if any, to compile in
8372 dldir="ext/DynaLoader"
8385 $define) dflt='y' ;;
8387 : Does a dl_xxx.xs file exist for this operating system
8388 $test -f $rsrc/$dldir/dl_${osname}.xs && dflt='y'
8391 rp="Do you wish to use dynamic loading?"
8398 '') if $test -f $rsrc/$dldir/dl_${osname}.xs ; then
8399 dflt="$dldir/dl_${osname}.xs"
8400 elif $test "$d_dlopen" = "$define" ; then
8401 dflt="$dldir/dl_dlopen.xs"
8406 *) dflt="$dldir/$dlsrc"
8409 echo "The following dynamic loading files are available:"
8410 : Can not go over to $dldir because getfile has path hard-coded in.
8411 tdir=`pwd`; cd "$rsrc"; $ls -C $dldir/dl*.xs; cd "$tdir"
8412 rp="Source file to use for dynamic loading"
8418 dlsrc=`echo $ans | $sed -e 's%.*/\([^/]*\)$%\1%'`
8422 Some systems may require passing special flags to $cc -c to
8423 compile modules that will be used to create a shared library.
8424 To use no flags, say "none".
8427 case "$cccdlflags" in
8428 '') case "$gccversion" in
8429 '') case "$osname" in
8431 irix*) dflt='-KPIC' ;;
8432 svr4*|esix*|solaris|nonstopux) dflt='-KPIC' ;;
8433 sunos) dflt='-pic' ;;
8437 *) case "$osname" in
8438 darwin) dflt='none' ;;
8439 *linux*|svr4*|esix*|solaris|nonstopux) dflt='-fPIC' ;;
8444 *) dflt="$cccdlflags" ;;
8451 # If -Dsysroot was specified, now's the time to add it
8453 if test "X$sysroot" != X; then
8454 case "$gccversion" in
8459 dflt="$dflt --sysroot=$sysroot" ;;
8469 rp="Any special flags to pass to $cc -c to compile shared library modules?"
8472 none) cccdlflags=' ' ;;
8473 *) cccdlflags="$ans" ;;
8478 Some systems use ld to create libraries that can be dynamically loaded,
8479 while other systems (such as those using ELF) use $cc.
8483 : Determine if this is ELF
8485 /* Test for whether ELF binaries are produced */
8497 int i = open("a.out",O_RDONLY);
8500 if(read(i,b,4)==4 && b[0]==127 && b[1]=='E' && b[2]=='L' && b[3]=='F')
8501 exit(0); /* succeed (yes, it is ELF) */
8505 if $cc $ccflags $ldflags -o a.out try.c >/dev/null 2>&1 && $run ./a.out; then
8511 '') if $test $bin_ELF = "$define"; then
8513 You appear to have ELF support. I'll use $cc to build dynamic libraries.
8517 echo "I'll use ld to build dynamic libraries."
8525 rp="What command should be used to create dynamic libraries?"
8531 Some systems may require passing special flags to $ld to create a
8532 library that can be dynamically loaded. If your ld flags include
8533 -L/other/path options to locate libraries outside your loader's normal
8534 search path, you may need to specify those -L options here as well. To
8535 use no flags, say "none".
8538 case "$lddlflags" in
8539 '') case "$osname" in
8540 haiku) dflt='-shared' ;;
8542 case "$gccversion" in
8543 '') dflt="$dflt +vnocompatwarnings" ;;
8546 *linux*|irix*|gnu*) dflt="-shared $optimize" ;;
8547 solaris) # See [perl #66604].
8548 # On Solaris 11, gcc -m64 on amd64
8549 # appears not to understand -G. gcc versions at
8550 # least as old as 3.4.3 support -shared, so just
8551 # use that with Solaris 11 and later, but keep
8552 # the old behavior for older Solaris versions.
8553 case "$gccversion" in
8555 *) case "$osvers" in
8556 2.?|2.10) dflt='-G' ;;
8557 *) dflt='-shared' ;;
8562 sunos) dflt='-assert nodefinitions' ;;
8563 svr4*|esix*|nonstopux) dflt="-G $ldflags" ;;
8567 *) dflt="$lddlflags" ;;
8570 : Only do this for gcc, since, for example, qcc has no concept
8572 if $test "X$sysroot" != X; then
8573 case "$gccversion" in
8575 *) dflt="$dflt --sysroot $sysroot" ;;
8579 : Try to guess additional flags to pick up local libraries.
8580 : Be careful not to append to a plain 'none'
8584 for thisflag in $ldflags; do
8589 *) dflt="$dflt $thisflag" ;;
8596 ''|' ') dflt='none' ;;
8600 *-fstack-protector-strong*)
8602 *-fstack-protector-strong*) ;; # Don't add it again
8603 *) dflt="$dflt -fstack-protector-strong" ;;
8606 *-fstack-protector*)
8608 *-fstack-protector*) ;; # Don't add it again
8609 *) dflt="$dflt -fstack-protector" ;;
8614 rp="Any special flags to pass to $ld to create a dynamically loaded library?"
8617 none) lddlflags=' ' ;;
8618 *) lddlflags="$ans" ;;
8623 Some systems may require passing special flags to $cc to indicate that
8624 the resulting executable will use dynamic linking. To use no flags,
8628 case "$ccdlflags" in
8629 '') case "$osname" in
8630 *linux*|hpux|gnu*) dflt='-Wl,-E' ;;
8631 sunos) dflt='none' ;;
8635 *) dflt="$ccdlflags" ;;
8637 rp="Any special flags to pass to $cc to use dynamic linking?"
8640 none) ccdlflags=' ' ;;
8641 *) ccdlflags="$ans" ;;
8653 ld_can_script="$undef"
8654 case "$bin_ELF$usedl" in
8656 # Abuse try.h and a.out names for neat cleanup
8668 if $cc $cccdlflags $ccdlflags $ccflags \
8669 $ldflags $lddlflags -o a.out try.c \
8670 -Wl,--version-script=try.h >/dev/null 2>&1 \
8671 && $test -s a.out ; then
8672 echo "ld supports scripting" >&4
8673 ld_can_script="$define"
8675 echo "ld does not support scripting" >&4
8681 : Do we want a shared libperl?
8685 # No dynamic loading being used, so don't bother even to prompt.
8688 *) case "$useshrplib" in
8689 '') case "$osname" in
8690 svr4*|nonstopux|dgux|dynixptx|esix|powerux|haiku|cygwin*)
8692 also='Building a shared libperl is required for dynamic loading to work on your system.'
8706 The perl executable is normally obtained by linking perlmain.c with
8707 libperl${_a}, any static extensions (usually just DynaLoader), and
8708 any other libraries needed on this system (such as -lm, etc.). Since
8709 your system supports dynamic loading, it is probably possible to build
8710 a shared libperl.$so. If you will have more than one executable linked
8711 to libperl.$so, this will significantly reduce the size of each
8712 executable, but it may have a noticeable effect on performance. The
8713 default is probably sensible for your system.
8717 rp="Build a shared libperl.$so (y/n)"
8721 useshrplib='true' ;;
8722 *) useshrplib='false' ;;
8727 case "$useshrplib" in
8729 case "$userelocatableinc" in
8731 echo "Cannot build with both -Duserelocatableinc and -Duseshrplib" >&4
8732 echo "See INSTALL for an explanation why that won't work." >&4
8738 # Figure out a good name for libperl.so. Since it gets stored in
8739 # a version-specific architecture-dependent library, the version
8740 # number isn't really that important, except for making cc/ld happy.
8742 # A name such as libperl.so.10.1
8743 majmin="libperl.$so.$patchlevel.$subversion"
8744 # A name such as libperl.so.100
8745 majonly=`echo $patchlevel $subversion |
8746 $awk '{printf "%d%02d", $1, $2}'`
8747 majonly=libperl.$so.$majonly
8748 # I'd prefer to keep the os-specific stuff here to a minimum, and
8749 # rely on figuring it out from the naming of libc.
8750 case "${osname}${osvers}" in
8751 *linux*|gnu*) # ld won't link with a bare -lperl otherwise.
8754 cygwin*) # ld links now against the dll directly
8755 majmin="cygperl5_${patchlevel}_${subversion}.${so}"
8756 majonly=`echo $patchlevel $subversion |
8757 $awk '{printf "%03d%03d", $1, $2}'`
8758 majonly=cygperl5.$majonly.$so
8761 *) # Try to guess based on whether libc has major.minor.
8763 *libc.$so.[0-9]*.[0-9]*) dflt=$majmin ;;
8764 *libc.$so.[0-9]*) dflt=$majonly ;;
8765 *) dflt=libperl.$so ;;
8775 I need to select a good name for the shared libperl. If your system uses
8776 library names with major and minor numbers, then you might want something
8777 like $majmin. Alternatively, if your system uses a single version
8778 number for shared libraries, then you might want to use $majonly.
8779 Or, your system might be quite happy with a simple libperl.$so.
8781 Since the shared libperl will get installed into a version-specific
8782 architecture-dependent directory, the version number of the shared perl
8783 library probably isn't important, so the default should be o.k.
8786 rp='What name do you want to give to the shared libperl?'
8789 echo "Ok, I'll use $libperl"
8792 libperl="libperl${_a}"
8796 # Detect old use of shrpdir via undocumented Configure -Dshrpdir
8800 WARNING: Use of the shrpdir variable for the installation location of
8801 the shared $libperl is not supported. It was never documented and
8802 will not work in this version. Let me (perlbug@perl.org)
8803 know of any problems this may cause.
8809 But your current setting of $shrpdir is
8810 the default anyway, so it's harmless.
8815 Further, your current attempted setting of $shrpdir
8816 conflicts with the value of $archlibexp/CORE
8817 that installperl will use.
8824 # How will the perl executable find the installed shared $libperl?
8825 # Add $xxx to ccdlflags.
8826 # If we can't figure out a command-line option, use $shrpenv to
8827 # set env LD_RUN_PATH. The main perl makefile uses this.
8828 shrpdir=$archlibexp/CORE
8831 if "$useshrplib"; then
8834 # We'll set it in Makefile.SH...
8839 freebsd|mirbsd|netbsd|openbsd|interix|dragonfly|bitrig)
8840 xxx="-Wl,-R$shrpdir"
8842 bsdos|linux|irix*|dec_osf|gnu*|haiku)
8843 xxx="-Wl,-rpath,$shrpdir"
8846 # hpux doesn't like the default, either.
8847 tmp_shrpenv="env LDOPTS=\"+s +b${shrpdir}\""
8850 # cygwin needs only ldlibpth
8853 tmp_shrpenv="env LD_RUN_PATH=$shrpdir"
8859 # Only add $xxx if it isn't already in ccdlflags.
8860 case " $ccdlflags " in
8862 *) ccdlflags="$ccdlflags $xxx"
8865 Adding $xxx to the flags
8866 passed to $ld so that the perl executable will find the
8867 installed shared $libperl.
8875 # Fix ccdlflags in AIX for building external extensions.
8876 # (For building Perl itself bare -bE:perl.exp is needed,
8877 # Makefile.SH takes care of this.)
8879 aix) ccdlflags="$ccdlflags -bE:$installarchlib/CORE/perl.exp" ;;
8881 # Respect a hint or command-line value.
8883 '') shrpenv="$tmp_shrpenv" ;;
8885 case "$ldlibpthname" in
8886 '') ldlibpthname=LD_LIBRARY_PATH ;;
8887 none) ldlibpthname='' ;;
8890 : determine where manual pages are on this system
8894 syspath='/usr/share/man/man1 /usr/man/man1'
8895 syspath="$syspath /usr/man/mann /usr/man/manl /usr/man/local/man1"
8896 syspath="$syspath /usr/man/u_man/man1"
8897 syspath="$syspath /usr/catman/u_man/man1 /usr/man/l_man/man1"
8898 syspath="$syspath /usr/local/man/u_man/man1 /usr/local/man/l_man/man1"
8899 syspath="$syspath /usr/man/man.L /local/man/man1 /usr/local/man/man1"
8900 sysman=`./loc . /usr/man/man1 $syspath`
8903 if $test -d "$sysman"; then
8904 echo "System manual is in $sysman." >&4
8906 echo "Could not find manual pages in source form." >&4
8909 : determine where manual pages go
8910 set man1dir man1dir none
8914 $spackage has manual pages available in source form.
8918 echo "However, you don't have nroff, so they're probably useless to you."
8920 '') man1dir="none";;
8923 echo "If you don't want the manual sources installed, answer 'none'."
8928 lookpath="$prefixexp/share/man/man1"
8929 lookpath="$lookpath $prefixexp/man/man1 $prefixexp/man/l_man/man1"
8930 lookpath="$lookpath $prefixexp/man/p_man/man1"
8931 lookpath="$lookpath $prefixexp/man/u_man/man1"
8932 lookpath="$lookpath $prefixexp/man/man.1"
8934 */?_man*) dflt=`./loc . $prefixexp/l_man/man1 $lookpath` ;;
8935 *) dflt=`./loc . $prefixexp/man/man1 $lookpath` ;;
8945 rp="Where do the main $spackage manual pages (source) go?"
8947 if $test "X$man1direxp" != "X$ansexp"; then
8958 : What suffix to use on installed man pages
8965 rp="What suffix should be used for the main $spackage man pages?"
8967 '') case "$man1dir" in
8981 *) dflt="$man1ext";;
8988 : see if we can have long filenames
8990 first=123456789abcdef
8992 if (echo hi >$first) 2>/dev/null; then
8993 if $test -f 123456789abcde; then
8994 echo 'You cannot have filenames longer than 14 characters. Sigh.' >&4
8997 echo 'You can have filenames longer than 14 characters.'>&4
9002 You can't have filenames longer than 14 chars.
9003 You can't even think about them!
9009 $rm -rf 123456789abcde*
9011 : determine where library module manual pages go
9012 set man3dir man3dir none
9016 $spackage has manual pages for many of the library modules.
9022 However, you don't have nroff, so they're probably useless to you.
9025 '') man3dir="none";;
9029 case "$d_flexfnam" in
9032 However, your system can't handle the long file names like File::Basename.3.
9035 '') man3dir="none";;
9039 echo "If you don't want the manual sources installed, answer 'none'."
9040 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
9042 '') dflt=`echo "$man1dir" | $sed -e 's/man1/man3/g' -e 's/man\.1/man\.3/g'`
9043 if $test -d "$privlib/man/man3"; then
9046 WARNING: Previous versions of perl installed man3 pages into
9047 $privlib/man/man3. This version will suggest a
9048 new default of $dflt.
9052 rp='Do you wish to preserve the old behavior?(y/n)'
9055 y*) dflt="$privlib/man/man3" ;;
9060 *) dflt="$man3dir" ;;
9067 rp="Where do the $package library man pages (source) go?"
9077 : What suffix to use on installed man pages
9083 rp="What suffix should be used for the $package library man pages?"
9085 '') case "$man3dir" in
9099 *) dflt="$man3ext";;
9106 : see if we have to deal with yellow pages, now NIS.
9107 if $test -d /usr/etc/yp || $test -d /etc/yp || $test -d /usr/lib/yp; then
9113 '') if $contains '^\+' /etc/passwd >/dev/null 2>&1; then
9121 rp='Are you getting the hosts file via yellow pages?'
9124 y*) hostcat='ypcat hosts';;
9125 *) hostcat='cat /etc/hosts';;
9131 '') test -f /etc/hosts && hostcat='cat /etc/hosts';;
9134 '') test -f /etc/group && groupcat='cat /etc/group';;
9137 '') test -f /etc/passwd && passcat='cat /etc/passwd';;
9140 : now get the host name
9142 echo "Figuring out host name..." >&4
9143 case "$myhostname" in
9145 echo 'Maybe "hostname" will work...'
9146 if tans=`sh -c hostname 2>&1` ; then
9154 if $test "$cont"; then
9156 echo 'Oh, dear. Maybe "/etc/systemid" is the key...'
9157 if tans=`cat /etc/systemid 2>&1` ; then
9159 phostname='cat /etc/systemid'
9160 echo "Whadyaknow. Xenix always was a bit strange..."
9163 elif $test -r /etc/systemid; then
9164 echo "(What is a non-Xenix system doing with /etc/systemid?)"
9167 if $test "$cont"; then
9168 echo 'No, maybe "uuname -l" will work...'
9169 if tans=`sh -c 'uuname -l' 2>&1` ; then
9171 phostname='uuname -l'
9173 echo 'Strange. Maybe "uname -n" will work...'
9174 if tans=`sh -c 'uname -n' 2>&1` ; then
9176 phostname='uname -n'
9178 echo 'Oh well, maybe I can mine it out of whoami.h...'
9179 if tans=`sh -c $contains' sysname $usrinc/whoami.h' 2>&1` ; then
9180 myhostname=`echo "$tans" | $sed 's/^.*"\(.*\)"/\1/'`
9181 phostname="sed -n -e '"'/sysname/s/^.*\"\\(.*\\)\"/\1/{'"' -e p -e q -e '}' <$usrinc/whoami.h"
9183 case "$myhostname" in
9184 '') echo "Does this machine have an identity crisis or something?"
9187 echo "Well, you said $myhostname before..."
9188 phostname='echo $myhostname';;
9194 case "$myhostname" in
9195 '') myhostname=noname ;;
9197 : you do not want to know about this
9202 if $test "$myhostname" ; then
9204 rp='Your host name appears to be "'$myhostname'".'" Right?"
9212 : bad guess or no guess
9213 while $test "X$myhostname" = X ; do
9215 rp="Please type the (one word) name of your host:"
9220 : translate upper to lower if necessary
9221 case "$myhostname" in
9223 echo "(Normalizing case in your host name)"
9224 myhostname=`echo $myhostname | ./tr '[A-Z]' '[a-z]'`
9228 case "$myhostname" in
9230 dflt=`expr "X$myhostname" : "X[^.]*\(\..*\)"`
9231 myhostname=`expr "X$myhostname" : "X\([^.]*\)\."`
9232 echo "(Trimming domain name from host name--host name is now $myhostname)"
9234 *) case "$mydomain" in
9237 test "X$hostcat" = "Xypcat hosts" &&
9238 ypmatch "$myhostname" hosts 2>/dev/null |\
9239 $sed -e 's/[ ]*#.*//; s/$/ /' > hosts && \
9242 test "X$hostcat" != "X" &&
9243 $hostcat | $sed -n -e "s/[ ]*#.*//; s/\$/ /
9244 /[ ]$myhostname[ . ]/p" > hosts
9247 if $test -f hosts; then
9248 $test x`$awk "/[0-9].*[ ]$myhostname$tmp_re/ { sum++ }
9249 END { print sum }" hosts` = x1 || tmp_re="[ ]"
9250 dflt=.`$awk "/[0-9].*[ ]$myhostname$tmp_re/ {for(i=2; i<=NF;i++) print \\\$i}" \
9251 hosts | $sort | $uniq | \
9252 $sed -n -e "s/$myhostname\.\([-a-zA-Z0-9_.]\)/\1/p"`
9253 case `$echo X$dflt` in
9254 X*\ *) echo "(Several hosts in the database matched hostname)"
9257 X.) echo "(You do not have fully-qualified names in the hosts database)"
9261 echo "(I cannot locate a hosts database anywhere)"
9266 tans=`./loc resolv.conf X /etc /usr/etc`
9267 if $test -f "$tans"; then
9268 echo "(Attempting domain name extraction from $tans)"
9269 dflt=.`$sed -n -e 's/ / /g' \
9270 -e 's/^search *\([^ ]*\).*/\1/p' $tans \
9273 .) dflt=.`$sed -n -e 's/ / /g' \
9274 -e 's/^domain *\([^ ]*\).*/\1/p' $tans \
9282 .) echo "(No help from resolv.conf either -- attempting clever guess)"
9283 dflt=.`sh -c domainname 2>/dev/null`
9286 .nis.*|.yp.*|.main.*) dflt=`echo $dflt | $sed -e 's/^\.[^.]*//'`;;
9290 case "$dflt$osname" in
9291 .os390) echo "(Attempting domain name extraction from //'SYS1.TCPPARMS(TCPDATA)')"
9292 dflt=.`awk '/^DOMAINORIGIN/ {print $2}' "//'SYS1.TCPPARMS(TCPDATA)'" 2>/dev/null`
9296 .) echo "(Lost all hope -- silly guess then)"
9302 *) dflt="$mydomain";;
9306 rp="What is your domain name?"
9316 : translate upper to lower if necessary
9319 echo "(Normalizing case in your domain name)"
9320 mydomain=`echo $mydomain | ./tr '[A-Z]' '[a-z]'`
9324 : a little sanity check here
9325 case "$phostname" in
9328 case `$phostname | ./tr '[A-Z]' '[a-z]'` in
9329 $myhostname$mydomain|$myhostname) ;;
9331 case "$phostname" in
9333 echo "(That doesn't agree with your whoami.h file, by the way.)"
9336 echo "(That doesn't agree with your $phostname command, by the way.)"
9344 : determine the e-mail address of the user who is running us
9347 I need to get your e-mail address in Internet format if possible, i.e.
9348 something like user@host.domain. Please answer accurately since I have
9349 no easy means to double check it. The default value provided below
9350 is most probably close to reality but may not be valid from outside
9351 your organization...
9355 while test "$cont"; do
9356 case "$MAILDOMAIN" in
9358 if $test -s /etc/mailname; then
9359 maildomain=`$cat /etc/mailname`
9361 maildomain="$myhostname$mydomain"
9364 *) maildomain="$MAILDOMAIN";;
9367 '') dflt="$cf_by@$maildomain";;
9368 *) dflt="$cf_email";;
9370 rp='What is your e-mail address?'
9376 rp='Address does not look like an Internet one. Use it anyway?'
9390 : Ask e-mail of administrator
9393 If you or somebody else will be maintaining perl at your site, please
9394 fill in the correct e-mail address here so that they may be contacted
9395 if necessary. Currently, the "perlbug" program included with perl
9396 will send mail to this address in addition to perlbug@perl.org. You may
9397 enter "none" for no administrator.
9400 case "$perladmin" in
9401 '') dflt="$cf_email";;
9402 *) dflt="$perladmin";;
9404 rp='Perl administrator e-mail address'
9408 : determine whether to only install version-specific parts.
9411 Do you want to install only the version-specific parts of the perl
9412 distribution? Usually you do *not* want to do this.
9414 case "$versiononly" in
9415 "$define"|[Yy]*|true) dflt='y' ;;
9418 rp="Do you want to install only the version-specific parts of perl?"
9421 [yY]*) val="$define";;
9427 case "$versiononly" in
9428 "$define") inc_version_list=''
9429 inc_version_list_init=0
9433 : figure out how to guarantee perl startup
9434 : XXX Note that this currently takes advantage of the bug that binexp ignores
9435 : the Configure -Dinstallprefix setting, which in turn means that under
9436 : relocatable @INC, initialinstalllocation is what binexp started as.
9437 case "$startperl" in
9439 case "$sharpbang" in
9443 I can use the #! construct to start perl on your system. This will
9444 make startup of perl scripts faster, but may cause problems if you
9445 want to share those scripts and perl is not in a standard place
9446 ($initialinstalllocation/perl) on all your platforms. The alternative
9447 is to force a shell by starting the script with a single ':' character.
9450 case "$versiononly" in
9451 "$define") dflt="$initialinstalllocation/perl$version";;
9452 *) dflt="$initialinstalllocation/perl";;
9454 rp='What shall I put after the #! to start up perl ("none" to not use #!)?'
9457 none) startperl=": # use perl";;
9458 *) startperl="#!$ans"
9459 if $test 30 -lt `echo "$ans" | wc -c`; then
9462 WARNING: Some systems limit the #! command to 32 characters.
9463 If you experience difficulty running Perl scripts with #!, try
9464 installing Perl in a directory with a shorter pathname.
9470 *) startperl=": # use perl"
9475 echo "I'll use $startperl to start perl scripts."
9477 : figure best path for perl in scripts
9480 case "$versiononly" in
9481 "$define") perlpath="$initialinstalllocation/perl$version";;
9482 *) perlpath="$initialinstalllocation/perl";;
9484 case "$startperl" in
9489 I will use the "eval 'exec'" idiom to start Perl on your system.
9490 I can use the full path of your Perl binary for this purpose, but
9491 doing so may cause problems if you want to share those scripts and
9492 Perl is not always in a standard place ($initialinstalllocation/perl).
9495 dflt="$initialinstalllocation/perl"
9496 rp="What path shall I use in \"eval 'exec'\"?"
9503 case "$startperl" in
9505 *) echo "I'll use $perlpath in \"eval 'exec'\"" ;;
9508 : determine where public executable scripts go
9509 set scriptdir scriptdir
9511 case "$scriptdir" in
9514 : guess some guesses
9515 $test -d /usr/share/scripts && dflt=/usr/share/scripts
9516 $test -d /usr/share/bin && dflt=/usr/share/bin
9517 $test -d /usr/local/script && dflt=/usr/local/script
9518 $test -d /usr/local/scripts && dflt=/usr/local/scripts
9519 $test -d $prefixexp/script && dflt=$prefixexp/script
9523 *) dflt="$scriptdir"
9528 Some installations have a separate directory just for executable scripts so
9529 that they can mount it across multiple architectures but keep the scripts in
9530 one spot. You might, for example, have a subdirectory of /usr/share for this.
9531 Or you might just lump your scripts in with all your other executables.
9535 rp='Where do you keep publicly executable scripts?'
9537 if $test "X$ansexp" != "X$scriptdirexp"; then
9543 : A little fix up for an irregularly named variable.
9544 installscript="$installscriptdir"
9546 : determine where add-on public executables go
9548 '') dflt=$siteprefix/bin ;;
9552 rp='Pathname where the add-on public executables should be installed?'
9557 : determine where add-on html pages go
9558 : There is no standard location, so try to copy the previously-selected
9559 : directory structure for the core html pages.
9560 case "$sitehtml1dir" in
9561 '') dflt=`echo "$html1dir" | $sed "s#^$prefix#$siteprefix#"` ;;
9562 *) dflt=$sitehtml1dir ;;
9565 ''|' ') dflt=none ;;
9568 rp='Pathname where the site-specific html pages should be installed?'
9570 prefixvar=sitehtml1dir
9573 : determine where add-on library html pages go
9574 : There is no standard location, so try to copy the previously-selected
9575 : directory structure for the core html pages.
9576 case "$sitehtml3dir" in
9577 '') dflt=`echo "$html3dir" | $sed "s#^$prefix#$siteprefix#"` ;;
9578 *) dflt=$sitehtml3dir ;;
9581 ''|' ') dflt=none ;;
9584 rp='Pathname where the site-specific library html pages should be installed?'
9586 prefixvar=sitehtml3dir
9589 : determine where add-on manual pages go
9590 case "$siteman1dir" in
9591 '') dflt=`echo $man1dir | $sed "s#^$prefix#$siteprefix#"` ;;
9592 *) dflt=$siteman1dir ;;
9595 ''|' ') dflt=none ;;
9598 rp='Pathname where the site-specific manual pages should be installed?'
9600 prefixvar=siteman1dir
9603 : determine where add-on library man pages go
9604 case "$siteman3dir" in
9605 '') dflt=`echo $man3dir | $sed "s#^$prefix#$siteprefix#"` ;;
9606 *) dflt=$siteman3dir ;;
9609 ''|' ') dflt=none ;;
9612 rp='Pathname where the site-specific library manual pages should be installed?'
9614 prefixvar=siteman3dir
9617 : determine where add-on public executable scripts go
9618 case "$sitescript" in
9619 '') dflt=$siteprefix/script
9620 $test -d $dflt || dflt=$sitebin ;;
9621 *) dflt="$sitescript" ;;
9624 rp='Pathname where add-on public executable scripts should be installed?'
9626 prefixvar=sitescript
9629 : see if backtrace exists
9630 set backtrace d_backtrace
9633 : add flags if using c backtrace
9634 case "$usecbacktrace" in
9635 "") usecbacktrace=$undef ;;
9637 case "$d_backtrace" in
9639 case " $ccflags " in
9640 *" -DUSE_C_BACKTRACE "*) ;; # Already there.
9641 *) ccflags="$ccflags -DUSE_C_BACKTRACE -g" ;;
9645 echo "This system does not support backtrace" >&4
9646 usecbacktrace=$undef
9652 : Check if faststdio is requested and available
9653 case "$usefaststdio" in
9654 $define|true|[yY]*|'')
9655 xversion=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
9665 Perl can be built to use 'fast stdio', which means using the stdio
9666 library but also directly manipulating the stdio buffers to enable
9667 faster I/O. Using stdio is better for backward compatibility (especially
9668 for Perl extensions), but on the other hand since Perl 5.8 the 'perlio'
9669 interface has been preferred instead of stdio.
9671 If this doesn't make any sense to you, just accept the default '$dflt'.
9673 rp='Use the "fast stdio" if available?'
9676 y|Y) val="$define" ;;
9683 : define an is-a-typedef? function
9684 typedef='type=$1; var=$2; def=$3; shift; shift; shift; inclist=$@;
9686 "") inclist="sys/types.h";;
9688 eval "varval=\$$var";
9692 for inc in $inclist; do
9693 echo "#include <$inc>" >>temp.c;
9695 echo "#ifdef $type" >> temp.c;
9696 echo "printf(\"We have $type\");" >> temp.c;
9697 echo "#endif" >> temp.c;
9698 $cppstdin $cppflags $cppminus < temp.c >temp.E 2>/dev/null;
9699 if $contains $type temp.E >/dev/null 2>&1; then
9705 *) eval "$var=\$varval";;
9708 : define an is-a-typedef? function that prompts if the type is not available.
9709 typedef_ask='type=$1; var=$2; def=$3; shift; shift; shift; inclist=$@;
9711 "") inclist="sys/types.h";;
9713 eval "varval=\$$var";
9717 for inc in $inclist; do
9718 echo "#include <$inc>" >>temp.c;
9720 echo "#ifdef $type" >> temp.c;
9721 echo "printf(\"We have $type\");" >> temp.c;
9722 echo "#endif" >> temp.c;
9723 $cppstdin $cppflags $cppminus < temp.c >temp.E 2>/dev/null;
9725 echo "$rp" | $sed -e "s/What is/Looking for/" -e "s/?/./";
9726 if $contains $type temp.E >/dev/null 2>&1; then
9727 echo "$type found." >&4;
9730 echo "$type NOT found." >&4;
9736 *) eval "$var=\$varval";;
9739 : see what type lseek is declared as in the kernel
9740 rp="What is the type used for lseek's offset on this system?"
9741 set off_t lseektype long stdio.h sys/types.h
9745 echo "Checking to see how big your file offsets are..." >&4
9747 #include <sys/types.h>
9751 printf("%d\n", (int)sizeof($lseektype));
9756 if eval $compile_ok; then
9757 lseeksize=`$run ./try`
9758 echo "Your file offsets are $lseeksize bytes long."
9762 echo "(I can't seem to compile the test program. Guessing...)"
9763 rp="What is the size of your file offsets (in bytes)?"
9769 : see what type file positions are declared as in the library
9770 rp="What is the type for file position used by fsetpos()?"
9771 set fpos_t fpostype long stdio.h sys/types.h
9774 : Check size for Fpos_t
9777 *_t) zzz="$fpostype" ;;
9780 echo "Checking the size of $zzz..." >&4
9782 #include <sys/types.h>
9789 printf("%d\n", (int)sizeof($fpostype));
9794 if eval $compile_ok; then
9798 echo "(I can't execute the test program--guessing $fpossize.)" >&4
9801 echo "Your $zzz is $fpossize bytes long."
9807 echo "(I can't compile the test program. Guessing...)" >&4
9808 rp="What is the size of your file positions (in bytes)?"
9813 : Check for large file support
9814 # Backward compatibility (uselfs is deprecated).
9816 "$define"|true|[yY]*)
9819 *** Configure -Duselfs is deprecated, using -Duselargefiles instead.
9821 uselargefiles="$define"
9825 case "$lseeksize:$fpossize" in
9828 You can have files larger than 2 gigabytes.
9831 *) case "$uselargefiles" in
9832 "$undef"|false|[nN]*) dflt='n' ;;
9837 Perl can be built to understand large files (files larger than 2 gigabytes)
9838 on some systems. To do so, Configure can be run with -Duselargefiles.
9840 If this doesn't make any sense to you, just accept the default '$dflt'.
9842 rp='Try to understand large files, if available?'
9845 y|Y) val="$define" ;;
9852 : Look for a hint-file generated 'call-back-unit'. If the
9853 : user has specified that a large files perl is to be built,
9854 : we may need to set or change some other defaults.
9855 if $test -f uselargefiles.cbu; then
9856 echo "Your platform has some specific hints regarding large file builds, using them..."
9857 . ./uselargefiles.cbu
9859 case "$uselargefiles" in
9861 if $test -f uselargefiles.cbu; then
9863 echo "Rechecking to see how big your file offsets are..." >&4
9865 #include <sys/types.h>
9869 printf("%d\n", (int)sizeof($lseektype));
9874 if eval $compile_ok; then
9875 lseeksize=`$run ./try`
9876 $echo "Your file offsets are now $lseeksize bytes long."
9880 echo "(I can't seem to compile the test program. Guessing...)"
9881 rp="What is the size of your file offsets (in bytes)?"
9886 *_t) zzz="$fpostype" ;;
9889 $echo $n "Rechecking the size of $zzz...$c" >&4
9891 #include <sys/types.h>
9898 printf("%d\n", (int)sizeof($fpostype));
9903 if eval $compile_ok; then
9908 echo "(I can't execute the test program--guessing $fpossize.)" >&4
9911 echo " $fpossize bytes." >&4
9917 echo "(I can't compile the test program. Guessing...)" >&4
9918 rp="What is the size of your file positions (in bytes)?"
9927 : Check if we want perlio
9930 : Set the vendorbin variables
9931 case "$vendorprefix" in
9932 '') d_vendorbin="$undef"
9936 *) d_vendorbin="$define"
9937 : determine where vendor-supplied executables go.
9938 case "$vendorbin" in
9939 '') dflt=$vendorprefix/bin ;;
9940 *) dflt="$vendorbin" ;;
9943 rp='Pathname for the vendor-supplied executables directory?'
9946 vendorbinexp="$ansexp"
9952 : Set the vendorhtml1dir variables
9953 case "$vendorprefix" in
9954 '') vendorhtml1dir=''
9955 vendorhtml1direxp=''
9957 *) : determine where vendor-supplied html pages go.
9958 : There is no standard location, so try to copy the previously-selected
9959 : directory structure for the core html pages.
9960 : XXX Better default suggestions would be welcome.
9961 case "$vendorhtml1dir" in
9962 '') dflt=`echo "$html1dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
9963 *) dflt=$vendorhtml1dir ;;
9966 ''|' ') dflt=none ;;
9969 rp='Pathname for the vendor-supplied html pages?'
9971 vendorhtml1dir="$ans"
9972 vendorhtml1direxp="$ansexp"
9975 : Use ' ' for none so value is preserved next time through Configure
9976 $test X"$vendorhtml1dir" = "X" && vendorhtml1dir=' '
9977 prefixvar=vendorhtml1dir
9980 : Set the vendorhtml3dir variables
9981 case "$vendorprefix" in
9982 '') vendorhtml3dir=''
9983 vendorhtml3direxp=''
9985 *) : determine where vendor-supplied module html pages go.
9986 : There is no standard location, so try to copy the previously-selected
9987 : directory structure for the core html pages.
9988 : XXX Better default suggestions would be welcome.
9989 case "$vendorhtml3dir" in
9990 '') dflt=`echo "$html3dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
9991 *) dflt=$vendorhtml3dir ;;
9994 ''|' ') dflt=none ;;
9997 rp='Pathname for the vendor-supplied html pages?'
9999 vendorhtml3dir="$ans"
10000 vendorhtml3direxp="$ansexp"
10003 : Use ' ' for none so value is preserved next time through Configure
10004 $test X"$vendorhtml3dir" = "X" && vendorhtml3dir=' '
10005 prefixvar=vendorhtml3dir
10008 : Set the vendorman1dir variables
10009 case "$vendorprefix" in
10010 '') vendorman1dir=''
10011 vendorman1direxp=''
10013 *) : determine where vendor-supplied manual pages go.
10014 case "$vendorman1dir" in
10015 '') dflt=`echo "$man1dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
10016 *) dflt=$vendorman1dir ;;
10019 ''|' ') dflt=none ;;
10022 rp='Pathname for the vendor-supplied manual section 1 pages?'
10024 vendorman1dir="$ans"
10025 vendorman1direxp="$ansexp"
10028 : Use ' ' for none so value is preserved next time through Configure
10029 $test X"$vendorman1dir" = "X" && vendorman1dir=' '
10030 prefixvar=vendorman1dir
10033 : Set the vendorman3dir variables
10034 case "$vendorprefix" in
10035 '') vendorman3dir=''
10036 vendorman3direxp=''
10038 *) : determine where vendor-supplied module manual pages go.
10039 case "$vendorman3dir" in
10040 '') dflt=`echo "$man3dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
10041 *) dflt=$vendorman3dir ;;
10044 ''|' ') dflt=none ;;
10047 rp='Pathname for the vendor-supplied manual section 3 pages?'
10049 vendorman3dir="$ans"
10050 vendorman3direxp="$ansexp"
10053 : Use ' ' for none so value is preserved next time through Configure
10054 $test X"$vendorman3dir" = "X" && vendorman3dir=' '
10055 prefixvar=vendorman3dir
10058 : Set the vendorscript variables
10059 case "$vendorprefix" in
10060 '') d_vendorscript="$undef"
10064 *) d_vendorscript="$define"
10065 : determine where vendor-supplied scripts go.
10066 case "$vendorscript" in
10067 '') dflt=$vendorprefix/script
10068 $test -d $dflt || dflt=$vendorbin ;;
10069 *) dflt="$vendorscript" ;;
10073 The installation process will create a directory for
10074 vendor-supplied scripts.
10078 rp='Pathname for the vendor-supplied scripts directory?'
10080 vendorscript="$ans"
10081 vendorscriptexp="$ansexp"
10084 prefixvar=vendorscript
10087 : script used to emit important warnings
10090 if test \$# -gt 0; then
10095 echo "*** WARNING:" >&4
10096 sed -e 's/^/*** /' <msg >&4
10098 cat msg >>config.msg
10099 echo " " >>config.msg
10105 : see which of string.h or strings.h is needed
10107 strings=`./findhdr string.h`
10108 if $test "$strings" && $test -r "$strings"; then
10109 echo "Using <string.h> instead of <strings.h>." >&4
10113 strings=`./findhdr strings.h`
10114 if $test "$strings" && $test -r "$strings"; then
10115 echo "Using <strings.h> instead of <string.h>." >&4
10117 ./warn "No string header found -- You'll surely have problems."
10122 case "$i_string" in
10123 "$undef") strings=`./findhdr strings.h`;;
10124 *) strings=`./findhdr string.h`;;
10127 : see if qgcvt exists
10131 : Check what kind of doubles your system has
10132 $echo "Checking the kind of doubles you have..." >&4
10134 #$i_stdlib I_STDLIB
10135 #define DOUBLESIZE $doublesize
10137 #include <stdlib.h>
10140 static const double d = -0.1;
10142 unsigned const char* b = (unsigned const char*)(&d);
10143 #if DOUBLESIZE == 4
10144 if (b[0] == 0xCD && b[3] == 0xBD) {
10145 /* IEEE 754 32-bit little-endian */
10149 if (b[0] == 0xBD && b[3] == 0xCD) {
10150 /* IEEE 754 32-bit big-endian */
10155 #if DOUBLESIZE == 8
10156 if (b[0] == 0x9A && b[7] == 0xBF) {
10157 /* IEEE 754 64-bit little-endian */
10161 if (b[0] == 0xBF && b[7] == 0x9A) {
10162 /* IEEE 754 64-bit big-endian */
10166 if (b[0] == 0x99 && b[3] == 0xBF && b[4] == 0x9A && b[7] == 0x99) {
10167 /* ARM mixed endian: two little-endian 32-bit floats, in big endian order:
10168 * 4 5 6 7 0 1 2 3 (MSB = 7, LSB = 0)
10169 * 99 99 b9 bf 9a 99 99 99 */
10173 if (b[0] == 0x99 && b[3] == 0x9A && b[4] == 0xBF && b[7] == 0x99) {
10174 /* The opposite of case 7, mixed endian: two big-endian 32-bit floats,
10175 * in little endian order: 3 2 1 0 7 6 5 4 (MSB = 7, LSB = 0)
10176 * 99 99 99 9a bf b9 99 99 */
10181 #if DOUBLESIZE == 16
10182 if (b[0] == 0x9A && b[15] == 0xBF) {
10183 /* IEEE 754 128-bit little-endian */
10187 if (b[0] == 0xBF && b[15] == 0x9A) {
10188 /* IEEE 754 128-bit big-endian */
10193 /* Then there are old mainframe/miniframe formats like VAX, IBM, and CRAY.
10194 * Whether those environments can still build Perl is debatable. */
10195 printf("-1\n"); /* unknown */
10200 if eval $compile; then
10201 doublekind=`$run ./try`
10205 case "$doublekind" in
10206 1) echo "You have IEEE 754 32-bit little endian doubles." >&4 ;;
10207 2) echo "You have IEEE 754 32-bit big endian doubles." >&4 ;;
10208 3) echo "You have IEEE 754 64-bit little endian doubles." >&4 ;;
10209 4) echo "You have IEEE 754 64-bit big endian doubles." >&4 ;;
10210 5) echo "You have IEEE 754 128-bit little endian doubles." >&4 ;;
10211 6) echo "You have IEEE 754 128-bit big endian doubles." >&4 ;;
10212 7) echo "You have IEEE 754 64-bit mixed endian doubles (32-bit LEs in BE)." >&4 ;;
10213 8) echo "You have IEEE 754 64-bit mixed endian doubles (32-bit BEs in LE)." >&4 ;;
10214 *) echo "Cannot figure out your double. You VAX, or something?" >&4 ;;
10218 : Check print/scan long double stuff
10221 if $test X"$d_longdbl" = X"$define"; then
10223 echo "Checking how to print long doubles..." >&4
10225 if $test X"$sPRIfldbl" = X -a X"$doublesize" = X"$longdblsize"; then
10226 $cat >try.c <<'EOCP'
10227 #include <sys/types.h>
10230 double d = 123.456;
10231 printf("%.3f\n", d);
10235 if eval $compile; then
10239 sPRIfldbl='"f"'; sPRIgldbl='"g"'; sPRIeldbl='"e"';
10240 sPRIFUldbl='"F"'; sPRIGUldbl='"G"'; sPRIEUldbl='"E"';
10241 echo "We will use %f."
10247 if $test X"$sPRIfldbl" = X; then
10248 $cat >try.c <<'EOCP'
10249 #include <sys/types.h>
10252 long double d = 123.456;
10253 printf("%.3Lf\n", d);
10257 if eval $compile; then
10261 sPRIfldbl='"Lf"'; sPRIgldbl='"Lg"'; sPRIeldbl='"Le"';
10262 sPRIFUldbl='"LF"'; sPRIGUldbl='"LG"'; sPRIEUldbl='"LE"';
10263 echo "We will use %Lf."
10269 if $test X"$sPRIfldbl" = X; then
10270 $cat >try.c <<'EOCP'
10271 #include <sys/types.h>
10274 long double d = 123.456;
10275 printf("%.3llf\n", d);
10279 if eval $compile; then
10283 sPRIfldbl='"llf"'; sPRIgldbl='"llg"'; sPRIeldbl='"lle"';
10284 sPRIFUldbl='"llF"'; sPRIGUldbl='"llG"'; sPRIEUldbl='"llE"';
10285 echo "We will use %llf."
10291 if $test X"$sPRIfldbl" = X; then
10292 $cat >try.c <<'EOCP'
10293 #include <sys/types.h>
10296 long double d = 123.456;
10297 printf("%.3lf\n", d);
10301 if eval $compile; then
10305 sPRIfldbl='"lf"'; sPRIgldbl='"lg"'; sPRIeldbl='"le"';
10306 sPRIFUldbl='"lF"'; sPRIGUldbl='"lG"'; sPRIEUldbl='"lE"';
10307 echo "We will use %lf."
10313 if $test X"$sPRIfldbl" = X; then
10314 echo "Cannot figure out how to print long doubles." >&4
10316 sSCNfldbl=$sPRIfldbl # expect consistency
10323 case "$sPRIfldbl" in
10324 '') d_PRIfldbl="$undef"; d_PRIgldbl="$undef"; d_PRIeldbl="$undef";
10325 d_PRIFUldbl="$undef"; d_PRIGUldbl="$undef"; d_PRIEUldbl="$undef";
10326 d_SCNfldbl="$undef";
10328 *) d_PRIfldbl="$define"; d_PRIgldbl="$define"; d_PRIeldbl="$define";
10329 d_PRIFUldbl="$define"; d_PRIGUldbl="$define"; d_PRIEUldbl="$define";
10330 d_SCNfldbl="$define";
10334 : Before committing on uselongdouble, see whether that looks sane.
10335 if $test "$uselongdouble" = "$define"; then
10338 echo "Checking if your long double math functions work right..." >&4
10343 printf("%"$sPRIgldbl"\n", sqrtl(logl(expl(cosl(sinl(0.0L))))+powl(2.0L, 3.0L)));
10346 case "$osname:$gccversion" in
10347 aix:) saveccflags="$ccflags"
10348 ccflags="$ccflags -qlongdouble" ;; # to avoid core dump
10351 if eval $compile_ok; then
10355 3) echo "Your long double math functions are working correctly." >&4 ;;
10356 *) echo "Your long double math functions are broken, not using long doubles." >&4
10357 uselongdouble=$undef
10361 case "$osname:$gccversion" in
10362 aix:) ccflags="$saveccflags" ;; # restore
10366 : Check how to convert floats to strings.
10368 if test "X$d_Gconvert" = X; then
10371 echo "Checking for an efficient way to convert floats to strings."
10373 case "$uselongdouble" in
10374 "$define") echo "#define USE_LONG_DOUBLE" >>try.c ;;
10376 case "$d_longdbl" in
10377 "$define") echo "#define HAS_LONG_DOUBLE" >>try.c ;;
10379 case "$d_PRIgldbl" in
10380 "$define") echo "#define HAS_PRIgldbl" >>try.c ;;
10383 #ifdef TRY_gconvert
10384 #define Gconvert(x,n,t,b) gconvert((x),(n),(t),(b))
10385 char *myname = "gconvert";
10388 #define Gconvert(x,n,t,b) gcvt((x),(n),(b))
10389 char *myname = "gcvt";
10392 #define Gconvert(x,n,t,b) qgcvt((x),(n),(b))
10393 char *myname = "qgcvt";
10394 #define DOUBLETYPE long double
10397 #if defined(USE_LONG_DOUBLE) && defined(HAS_LONG_DOUBLE)
10398 #ifdef HAS_PRIgldbl
10399 #define Gconvert(x,n,t,b) sprintf((b),"%.*"$sPRIgldbl,(n),(x))
10401 #define Gconvert(x,n,t,b) sprintf((b),"%.*g",(n),(double)(x))
10404 #define Gconvert(x,n,t,b) sprintf((b),"%.*g",(n),(x))
10406 char *myname = "sprintf";
10410 #if defined(USE_LONG_DOUBLE) && defined(HAS_LONG_DOUBLE)
10411 #define DOUBLETYPE long double
10413 #define DOUBLETYPE double
10419 #$i_stdlib I_STDLIB
10421 #include <stdlib.h>
10423 #$i_string I_STRING
10425 # include <string.h>
10427 # include <strings.h>
10430 int checkit(char *expect, char *got)
10432 if (strcmp(expect, got)) {
10433 printf("%s oddity: Expected %s, got %s\n",
10434 myname, expect, got);
10444 /* This must be 1st test on (which?) platform */
10445 /* Alan Burlison <AlanBurlsin@unn.unisys.com> */
10446 Gconvert((DOUBLETYPE)0.1, 8, 0, buf);
10447 checkit("0.1", buf);
10449 Gconvert((DOUBLETYPE)0.01, 8, 0, buf);
10450 checkit("0.01", buf);
10452 Gconvert((DOUBLETYPE)0.001, 8, 0, buf);
10453 checkit("0.001", buf);
10455 Gconvert((DOUBLETYPE)0.0001, 8, 0, buf);
10456 checkit("0.0001", buf);
10458 Gconvert((DOUBLETYPE)0.00009, 8, 0, buf);
10459 if (strlen(buf) > 5)
10460 checkit("9e-005", buf); /* for Microsoft ?? */
10462 checkit("9e-05", buf);
10464 Gconvert((DOUBLETYPE)1.0, 8, 0, buf);
10467 Gconvert((DOUBLETYPE)1.1, 8, 0, buf);
10468 checkit("1.1", buf);
10470 Gconvert((DOUBLETYPE)1.01, 8, 0, buf);
10471 checkit("1.01", buf);
10473 Gconvert((DOUBLETYPE)1.001, 8, 0, buf);
10474 checkit("1.001", buf);
10476 Gconvert((DOUBLETYPE)1.0001, 8, 0, buf);
10477 checkit("1.0001", buf);
10479 Gconvert((DOUBLETYPE)1.00001, 8, 0, buf);
10480 checkit("1.00001", buf);
10482 Gconvert((DOUBLETYPE)1.000001, 8, 0, buf);
10483 checkit("1.000001", buf);
10485 Gconvert((DOUBLETYPE)0.0, 8, 0, buf);
10488 Gconvert((DOUBLETYPE)-1.0, 8, 0, buf);
10489 checkit("-1", buf);
10491 /* Some Linux gcvt's give 1.e+5 here. */
10492 Gconvert((DOUBLETYPE)100000.0, 8, 0, buf);
10493 checkit("100000", buf);
10495 /* Some Linux gcvt's give -1.e+5 here. */
10496 Gconvert((DOUBLETYPE)-100000.0, 8, 0, buf);
10497 checkit("-100000", buf);
10499 Gconvert((DOUBLETYPE)123.456, 8, 0, buf);
10500 checkit("123.456", buf);
10502 /* Testing of 1e+129 in bigintpm.t must not get extra '.' here. */
10503 Gconvert((DOUBLETYPE)1e34, 8, 0, buf);
10504 /* 34 should be enough to scare even long double
10505 * places into using the e notation. */
10506 if (strlen(buf) > 5)
10507 checkit("1e+034", buf); /* for Microsoft */
10509 checkit("1e+34", buf);
10511 /* For Perl, if you add additional tests here, also add them to
10512 * t/base/num.t for benefit of platforms not using Configure or
10513 * overriding d_Gconvert */
10518 : first add preferred functions to our list
10520 for xxx_convert in $gconvert_preference; do
10521 case $xxx_convert in
10522 gcvt|gconvert|sprintf) xxx_list="$xxx_list $xxx_convert" ;;
10523 *) echo "Discarding unrecognized gconvert_preference $xxx_convert" >&4 ;;
10526 : then add any others
10527 for xxx_convert in gconvert gcvt sprintf; do
10528 case "$xxx_list" in
10530 *) xxx_list="$xxx_list $xxx_convert" ;;
10534 case "$d_longdbl$uselongdouble" in
10536 : again, add preferred functions to our list first
10538 for xxx_convert in $gconvert_ld_preference; do
10539 case $xxx_convert in
10540 qgcvt|gcvt|gconvert|sprintf) xxx_ld_list="$xxx_ld_list $xxx_convert" ;;
10541 *) echo "Discarding unrecognized gconvert_ld_preference $xxx_convert" ;;
10544 : then add qgcvt, sprintf--then, in xxx_list order, gconvert and gcvt
10545 for xxx_convert in qgcvt sprintf $xxx_list; do
10546 case "$xxx_ld_list" in
10547 $xxx_convert*|*" $xxx_convert"*) ;;
10548 *) xxx_ld_list="$xxx_ld_list $xxx_convert" ;;
10551 : if sprintf cannot do long doubles, move it to the end
10552 if test "$d_PRIgldbl" != "$define"; then
10553 xxx_ld_list="`echo $xxx_ld_list|sed s/sprintf//` sprintf"
10555 : if no qgcvt, remove it
10556 if test "$d_qgcvt" != "$define"; then
10557 xxx_ld_list="`echo $xxx_ld_list|sed s/qgcvt//`"
10560 xxx_list="$xxx_ld_list"
10564 for xxx_convert in $xxx_list; do
10565 echo "Trying $xxx_convert..."
10566 $rm -f try try$_o core
10567 set try -DTRY_$xxx_convert
10568 if eval $compile; then
10569 echo "$xxx_convert() found." >&4
10570 if $run ./try; then
10571 echo "I'll use $xxx_convert to convert floats into a string." >&4
10574 echo "...But $xxx_convert didn't work as I expected."
10578 echo "$xxx_convert NOT found." >&4
10582 if test X$xxx_convert = X; then
10583 echo "*** WHOA THERE!!! ***" >&4
10584 echo "None of ($xxx_list) seemed to work properly. I'll use sprintf." >&4
10585 xxx_convert=sprintf
10588 case "$xxx_convert" in
10589 gconvert) d_Gconvert='gconvert((x),(n),(t),(b))' ;;
10590 gcvt) d_Gconvert='gcvt((x),(n),(b))' ;;
10591 qgcvt) d_Gconvert='qgcvt((x),(n),(b))' ;;
10592 *) case "$uselongdouble$d_longdbl$d_PRIgldbl" in
10593 "$define$define$define")
10594 d_Gconvert="sprintf((b),\"%.*\"$sPRIgldbl,(n),(x))" ;;
10595 "$define$define$undef")
10596 d_Gconvert='sprintf((b),"%.*g",(n),(double)(x))' ;;
10597 *) d_Gconvert='sprintf((b),"%.*g",(n),(x))' ;;
10605 : see if _fwalk exists
10609 : Initialize h_fcntl
10612 : Initialize h_sysfile
10615 : access call always available on UNIX
10616 set access d_access
10619 : locate the flags for 'access()'
10620 case "$d_access" in
10623 $cat >access.c <<EOCP
10624 #include <sys/types.h>
10629 #include <sys/file.h>
10632 #include <unistd.h>
10634 #$i_stdlib I_STDLIB
10636 #include <stdlib.h>
10642 : check sys/file.h first, no particular reason here
10643 if $test `./findhdr sys/file.h` && \
10644 $cc -o access $cppflags -DI_SYS_FILE access.c >/dev/null 2>&1 ; then
10646 echo "<sys/file.h> defines the *_OK access constants." >&4
10647 elif $test `./findhdr fcntl.h` && \
10648 $cc -o access $cppflags -DI_FCNTL access.c >/dev/null 2>&1 ; then
10650 echo "<fcntl.h> defines the *_OK access constants." >&4
10651 elif $test `./findhdr unistd.h` && \
10652 $cc -o access $cppflags -DI_UNISTD access.c >/dev/null 2>&1 ; then
10653 echo "<unistd.h> defines the *_OK access constants." >&4
10655 echo "I can't find the four *_OK access constants--I'll use mine." >&4
10661 : see if accessx exists
10662 set accessx d_accessx
10665 : see if acosh exists
10669 : see if aintl exists
10673 : see if alarm exists
10677 : see if 64bit time functions exists
10679 set ctime64 d_ctime64
10682 set localtime64 d_localtime64
10685 set gmtime64 d_gmtime64
10688 set mktime64 d_mktime64
10691 set difftime64 d_difftime64
10694 set asctime64 d_asctime64
10697 : see if POSIX threads are available
10698 set pthread.h i_pthread
10701 : define a function to check prototypes
10702 $cat > protochk <<EOSH
10705 optimize="$optimize"
10707 prototype="$prototype"
10710 usethreads=$usethreads
10711 i_pthread=$i_pthread
10712 pthread_h_first=$pthread_h_first
10715 $cat >> protochk <<'EOSH'
10720 while test $# -ge 2; do
10722 $define) echo "#include <$2>" >> try.c ;;
10723 literal) echo "$2" >> try.c ;;
10725 # Extra magic for the benefit of systems that need pthread.h
10726 # to be included early to correctly detect threadsafe functions.
10727 # Such functions must guarantee themselves, though, that the usethreads
10728 # and i_pthread have been defined, before calling protochk.
10729 if test "$usethreads" = "$define" -a "$i_pthread" = "$define" -a "$pthread_h_first" = "$define" -a "$pthread_h_done" = ""; then
10730 echo "#include <pthread.h>" >> try.c
10735 test "$prototype" = "$define" && echo '#define CAN_PROTOTYPE' >> try.c
10736 cat >> try.c <<'EOCP'
10737 #ifdef CAN_PROTOTYPE
10738 #define _(args) args
10743 echo "$foo" >> try.c
10744 echo 'int no_real_function_has_this_name _((void)) { return 0; }' >> try.c
10745 $cc $optimize $ccflags -c try.c > /dev/null 2>&1
10751 $eunicefix protochk
10753 : Define hasproto macro for Configure internal use
10754 hasproto='varname=$1; func=$2; shift; shift;
10755 while $test $# -ge 2; do
10757 $define) echo "#include <$2>";;
10761 $cppstdin $cppflags $cppminus < try.c > tryout.c 2>/dev/null;
10762 if $contains "$func.*(" tryout.c >/dev/null 2>&1; then
10763 echo "$func() prototype found.";
10766 echo "$func() prototype NOT found.";
10773 : see if sys/types.h has to be included
10774 set sys/types.h i_systypes
10777 : see if sys/select.h has to be included
10778 set sys/select.h i_sysselct
10781 : Define hasfield macro for Configure internal use
10782 hasfield='varname=$1; struct=$2; field=$3; shift; shift; shift;
10783 while $test $# -ge 2; do
10785 $define) echo "#include <$2>";;
10789 echo "int main () { struct $struct foo; char* bar; bar = (char*)foo.$field; }" >> try.c;
10791 if eval $compile; then
10800 : Define hasfield_t macro for Configure internal use
10801 hasfield_t='varname=$1; struct=$2; type=$3; field=$4; shift; shift; shift; shift;
10802 while $test $# -ge 2; do
10804 $define) echo "#include <$2>";;
10808 echo "int main () { $struct foo; $type bar = foo.$field; }" >> try.c;
10810 if eval $compile; then
10819 : see if we should include time.h, sys/time.h, or both
10821 if test "X$timeincl" = X; then
10822 echo "Testing to see if we should include <time.h>, <sys/time.h> or both." >&4
10823 $echo $n "I'm now running the test program...$c"
10825 #include <sys/types.h>
10830 #ifdef SYSTIMEKERNEL
10833 #include <sys/time.h>
10836 #include <sys/select.h>
10838 #$i_stdlib I_STDLIB
10840 #include <stdlib.h>
10846 struct timeval bar;
10849 struct timezone tzp;
10851 if (foo.tm_sec == foo.tm_sec)
10854 if (bar.tv_sec == bar.tv_sec)
10861 for s_timezone in '-DS_TIMEZONE' ''; do
10863 for s_timeval in '-DS_TIMEVAL' ''; do
10864 for i_systimek in '' '-DSYSTIMEKERNEL'; do
10865 for i_time in '' '-DI_TIME'; do
10866 for i_systime in '-DI_SYSTIME' ''; do
10869 set try $i_time $i_systime $i_systimek $sysselect $s_timeval $s_timezone
10870 if eval $compile; then
10871 set X $i_time $i_systime $i_systimek $sysselect $s_timeval
10875 $echo $n "Succeeded with $flags$c"
10887 *SYSTIMEKERNEL*) i_systimek="$define"
10888 timeincl=`./findhdr sys/time.h`
10889 echo "We'll include <sys/time.h> with KERNEL defined." >&4;;
10890 *) i_systimek="$undef";;
10893 *I_TIME*) i_time="$define"
10894 timeincl=`./findhdr time.h`" $timeincl"
10895 echo "We'll include <time.h>." >&4;;
10896 *) i_time="$undef";;
10899 *I_SYSTIME*) i_systime="$define"
10900 timeincl=`./findhdr sys/time.h`" $timeincl"
10901 echo "We'll include <sys/time.h>." >&4;;
10902 *) i_systime="$undef";;
10906 : see if struct tm knows about tm_zone
10907 case "$i_systime$i_time" in
10910 echo "Checking to see if your struct tm has tm_zone field..." >&4
10911 set d_tm_tm_zone tm tm_zone $i_systime sys/time.h $i_time time.h
10919 case "$d_tm_tm_zone" in
10920 "$define") echo "Yes, it does." ;;
10921 *) echo "No, it doesn't." ;;
10923 : see if struct tm knows about tm_gmtoff
10924 case "$i_systime$i_time" in
10927 echo "Checking to see if your struct tm has tm_gmtoff field..." >&4
10928 set d_tm_tm_gmtoff tm tm_gmtoff $i_systime sys/time.h $i_time time.h
10936 case "$d_tm_tm_gmtoff" in
10937 "$define") echo "Yes, it does." ;;
10938 *) echo "No, it doesn't." ;;
10941 : see if asctime_r exists
10942 set asctime_r d_asctime_r
10944 case "$d_asctime_r" in
10946 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
10947 case "$d_asctime_r_proto:$usethreads" in
10948 ":define") d_asctime_r_proto=define
10949 set d_asctime_r_proto asctime_r $hdrs
10953 case "$d_asctime_r_proto" in
10955 case "$asctime_r_proto" in
10956 ''|0) try='char* asctime_r(const struct tm*, char*);'
10957 ./protochk "$extern_C $try" $hdrs && asctime_r_proto=B_SB ;;
10959 case "$asctime_r_proto" in
10960 ''|0) try='char* asctime_r(const struct tm*, char*, int);'
10961 ./protochk "$extern_C $try" $hdrs && asctime_r_proto=B_SBI ;;
10963 case "$asctime_r_proto" in
10964 ''|0) try='int asctime_r(const struct tm*, char*);'
10965 ./protochk "$extern_C $try" $hdrs && asctime_r_proto=I_SB ;;
10967 case "$asctime_r_proto" in
10968 ''|0) try='int asctime_r(const struct tm*, char*, int);'
10969 ./protochk "$extern_C $try" $hdrs && asctime_r_proto=I_SBI ;;
10971 case "$asctime_r_proto" in
10972 ''|0) d_asctime_r=undef
10974 echo "Disabling asctime_r, cannot determine prototype." >&4 ;;
10975 * ) case "$asctime_r_proto" in
10976 REENTRANT_PROTO*) ;;
10977 *) asctime_r_proto="REENTRANT_PROTO_$asctime_r_proto" ;;
10979 echo "Prototype: $try" ;;
10982 *) case "$usethreads" in
10983 define) echo "asctime_r has no prototype, not using it." >&4 ;;
10990 *) asctime_r_proto=0
10994 : see if asinh exists
10998 : see if atanh exists
11002 : see if atolf exists
11006 : see if atoll exists
11010 : Look for GCC-style attribute format
11011 case "$d_attribute_format" in
11014 echo "Checking whether your compiler can handle __attribute__((format)) ..." >&4
11015 $cat >attrib.c <<'EOCP'
11017 void my_special_printf(char* pat,...) __attribute__((__format__(__printf__,1,2)));
11019 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
11020 if $contains 'warning' attrib.out >/dev/null 2>&1; then
11021 echo "Your C compiler doesn't support __attribute__((format))."
11024 echo "Your C compiler supports __attribute__((format))."
11028 echo "Your C compiler doesn't seem to understand __attribute__ at all."
11032 *) val="$d_attribute_format" ;;
11034 set d_attribute_format
11038 : Look for GCC-style attribute format with null format allowed
11039 case "$d_printf_format_null" in
11040 '') case "$d_attribute_format" in
11043 echo "Checking whether your compiler allows __printf__ format to be null ..." >&4
11044 $cat >attrib.c <<EOCP
11046 #$i_stdlib I_STDLIB
11048 #include <stdlib.h>
11050 int null_printf (char* pat,...) __attribute__((__format__(__printf__,1,2)));
11051 int null_printf (char* pat,...) { return (int)pat; }
11052 int main () { exit(null_printf(NULL)); }
11054 if $cc $ccflags -o attrib attrib.c >attrib.out 2>&1 ; then
11055 : run the executable in case it produces a run-time warning
11056 if $run ./attrib >>attrib.out 2>&1; then
11057 if $contains 'warning' attrib.out >/dev/null 2>&1; then
11058 echo "Your C compiler doesn't allow __printf__ format to be null."
11061 echo "Your C compiler allows __printf__ format to be null."
11065 echo "Your C compiler executable failed with __printf__ format null."
11069 echo "Your C compiler fails with __printf__ format null."
11076 *) val="$d_printf_format_null" ;;
11078 set d_printf_format_null
11082 : Look for GCC-style attribute malloc
11083 case "$d_attribute_malloc" in
11086 echo "Checking whether your compiler can handle __attribute__((malloc)) ..." >&4
11087 $cat >attrib.c <<'EOCP'
11089 char *go_get_some_memory( int how_many_bytes ) __attribute__((malloc));
11091 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
11092 if $contains 'warning' attrib.out >/dev/null 2>&1; then
11093 echo "Your C compiler doesn't support __attribute__((malloc))."
11096 echo "Your C compiler supports __attribute__((malloc))."
11100 echo "Your C compiler doesn't seem to understand __attribute__ at all."
11104 *) val="$d_attribute_malloc" ;;
11106 set d_attribute_malloc
11110 : Look for GCC-style attribute nonnull
11111 case "$d_attribute_nonnull" in
11114 echo "Checking whether your compiler can handle __attribute__((nonnull(1))) ..." >&4
11115 $cat >attrib.c <<'EOCP'
11117 void do_something (char *some_pointer,...) __attribute__((nonnull(1)));
11119 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
11120 if $contains 'warning' attrib.out >/dev/null 2>&1; then
11121 echo "Your C compiler doesn't support __attribute__((nonnull))."
11124 echo "Your C compiler supports __attribute__((nonnull))."
11128 echo "Your C compiler doesn't seem to understand __attribute__ at all."
11132 *) val="$d_attribute_nonnull" ;;
11134 set d_attribute_nonnull
11138 : Look for GCC-style attribute noreturn
11139 case "$d_attribute_noreturn" in
11142 echo "Checking whether your compiler can handle __attribute__((noreturn)) ..." >&4
11143 $cat >attrib.c <<'EOCP'
11145 void fall_over_dead( void ) __attribute__((noreturn));
11147 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
11148 if $contains 'warning' attrib.out >/dev/null 2>&1; then
11149 echo "Your C compiler doesn't support __attribute__((noreturn))."
11152 echo "Your C compiler supports __attribute__((noreturn))."
11156 echo "Your C compiler doesn't seem to understand __attribute__ at all."
11160 *) val="$d_attribute_noreturn" ;;
11162 set d_attribute_noreturn
11166 : Look for GCC-style attribute pure
11167 case "$d_attribute_pure" in
11170 echo "Checking whether your compiler can handle __attribute__((pure)) ..." >&4
11171 $cat >attrib.c <<'EOCP'
11173 int square( int n ) __attribute__((pure));
11175 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
11176 if $contains 'warning' attrib.out >/dev/null 2>&1; then
11177 echo "Your C compiler doesn't support __attribute__((pure))."
11180 echo "Your C compiler supports __attribute__((pure))."
11184 echo "Your C compiler doesn't seem to understand __attribute__ at all."
11188 *) val="$d_attribute_pure" ;;
11190 set d_attribute_pure
11194 : Look for GCC-style attribute unused
11195 case "$d_attribute_unused" in
11198 echo "Checking whether your compiler can handle __attribute__((unused)) ..." >&4
11199 $cat >attrib.c <<'EOCP'
11201 int do_something( int dummy __attribute__((unused)), int n );
11203 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
11204 if $contains 'warning' attrib.out >/dev/null 2>&1; then
11205 echo "Your C compiler doesn't support __attribute__((unused))."
11208 echo "Your C compiler supports __attribute__((unused))."
11212 echo "Your C compiler doesn't seem to understand __attribute__ at all."
11216 *) val="$d_attribute_unused" ;;
11218 set d_attribute_unused
11222 : Look for GCC-style attribute deprecated
11223 case "$d_attribute_deprecated" in
11226 echo "Checking whether your compiler can handle __attribute__((deprecated)) ..." >&4
11227 $cat >attrib.c <<'EOCP'
11229 int I_am_deprecated(void) __attribute__((deprecated));
11231 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
11232 if $contains 'warning' attrib.out >/dev/null 2>&1; then
11233 echo "Your C compiler doesn't support __attribute__((deprecated))."
11236 echo "Your C compiler supports __attribute__((deprecated))."
11240 echo "Your C compiler doesn't seem to understand __attribute__ at all."
11244 *) val="$d_attribute_deprecated" ;;
11246 set d_attribute_deprecated
11250 : Look for GCC-style attribute warn_unused_result
11251 case "$d_attribute_warn_unused_result" in
11254 echo "Checking whether your compiler can handle __attribute__((warn_unused_result)) ..." >&4
11255 $cat >attrib.c <<'EOCP'
11257 int I_will_not_be_ignored(void) __attribute__((warn_unused_result));
11259 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
11260 if $contains 'warning' attrib.out >/dev/null 2>&1; then
11261 echo "Your C compiler doesn't support __attribute__((warn_unused_result))."
11264 echo "Your C compiler supports __attribute__((warn_unused_result))."
11268 echo "Your C compiler doesn't seem to understand __attribute__ at all."
11272 *) val="$d_attribute_warn_unused_result" ;;
11274 set d_attribute_warn_unused_result
11278 : see if bcmp exists
11282 : see if bcopy exists
11286 : see if getpgrp exists
11287 set getpgrp d_getpgrp
11290 case "$d_getpgrp" in
11293 echo "Checking to see which flavor of getpgrp is in use..."
11295 #$i_unistd I_UNISTD
11296 #include <sys/types.h>
11298 # include <unistd.h>
11300 #$i_stdlib I_STDLIB
11302 #include <stdlib.h>
11306 if (getuid() == 0) {
11307 printf("(I see you are running Configure as super-user...)\n");
11310 #ifdef TRY_BSD_PGRP
11311 if (getpgrp(1) == 0)
11320 if $cc -o try -DTRY_BSD_PGRP $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
11321 echo "You have to use getpgrp(pid) instead of getpgrp()." >&4
11323 elif $cc -o try $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
11324 echo "You have to use getpgrp() instead of getpgrp(pid)." >&4
11327 echo "I can't seem to compile and run the test program."
11329 xxx="a USG one, i.e. you use getpgrp()."
11331 # SVR4 systems can appear rather BSD-ish.
11332 case "$i_unistd" in
11334 xxx="a BSD one, i.e. you use getpgrp(pid)."
11338 xxx="probably a USG one, i.e. you use getpgrp()."
11343 echo "Assuming your getpgrp is $xxx" >&4
11352 : see if setpgrp exists
11353 set setpgrp d_setpgrp
11356 case "$d_setpgrp" in
11359 echo "Checking to see which flavor of setpgrp is in use..."
11361 #$i_unistd I_UNISTD
11362 #include <sys/types.h>
11364 # include <unistd.h>
11366 #$i_stdlib I_STDLIB
11368 #include <stdlib.h>
11372 if (getuid() == 0) {
11373 printf("(I see you are running Configure as super-user...)\n");
11376 #ifdef TRY_BSD_PGRP
11377 if (-1 == setpgrp(1, 1))
11380 if (setpgrp() != -1)
11386 if $cc -o try -DTRY_BSD_PGRP $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
11387 echo 'You have to use setpgrp(pid,pgrp) instead of setpgrp().' >&4
11389 elif $cc -o try $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
11390 echo 'You have to use setpgrp() instead of setpgrp(pid,pgrp).' >&4
11393 echo "(I can't seem to compile and run the test program.)"
11395 xxx="a USG one, i.e. you use setpgrp()."
11397 # SVR4 systems can appear rather BSD-ish.
11398 case "$i_unistd" in
11400 xxx="a BSD one, i.e. you use setpgrp(pid,pgrp)."
11404 xxx="probably a USG one, i.e. you use setpgrp()."
11409 echo "Assuming your setpgrp is $xxx" >&4
11418 : Look for GCC-style __builtin_choose_expr
11419 case "$d_builtin_choose_expr" in
11422 echo "Checking whether your compiler can handle __builtin_choose_expr ..." >&4
11423 $cat >try.c <<'EOCP'
11424 #include <assert.h>
11425 #include <stdlib.h>
11428 #define SYRINX(x) __builtin_choose_expr( x, (1056*2), (103*50) )
11431 assert( SYRINX(1) == 2112 );
11432 assert( SYRINX(1) != 5150 );
11433 assert( SYRINX(0) == 5150 );
11434 assert( SYRINX(0) != 2112 );
11435 puts( "All good!" );
11441 if eval $compile && $run ./try; then
11442 echo "Your C compiler supports __builtin_choose_expr."
11445 echo "Your C compiler doesn't seem to understand __builtin_choose_expr."
11449 *) val="$d_builtin_choose_expr" ;;
11452 set d_builtin_choose_expr
11456 : Look for GCC-style __builtin_expect
11457 case "$d_builtin_expect" in
11460 echo "Checking whether your compiler can handle __builtin_expect ..." >&4
11461 $cat >try.c <<'EOCP'
11464 if ( __builtin_expect(n, 0) ) n = 1;
11465 /* Remember shell exit code truth is 0, C truth is non-zero */
11470 if eval $compile && $run ./try; then
11471 echo "Your C compiler supports __builtin_expect."
11474 echo "Your C compiler doesn't seem to understand __builtin_expect."
11478 *) val="$d_builtin_expect" ;;
11481 set d_builtin_expect
11485 : see if bzero exists
11489 : see if stdarg is available
11491 if $test `./findhdr stdarg.h`; then
11492 echo "<stdarg.h> found." >&4
11495 echo "<stdarg.h> NOT found." >&4
11499 : see if varargs is available
11501 if $test `./findhdr varargs.h`; then
11502 echo "<varargs.h> found." >&4
11504 echo "<varargs.h> NOT found, but that's ok (I hope)." >&4
11507 : set up the varargs testing programs
11508 $cat > varargs.c <<EOP
11510 #include <stdarg.h>
11513 #include <varargs.h>
11517 int f(char *p, ...)
11531 p = va_arg(ap, char *);
11537 $cat > varargs <<EOP
11539 if $cc -c $ccflags -D\$1 varargs.c >/dev/null 2>&1; then
11548 : now check which varargs header should be included
11554 if `./varargs I_STDARG`; then
11556 elif `./varargs I_VARARGS`; then
11561 if `./varargs I_VARARGS`; then
11569 echo "*** WHOA THERE!!! ***" >&4
11570 echo " Your C compiler \"$cc\" doesn't seem to support stdarg or varargs!" >&4
11571 case "$knowitall" in
11573 echo " I'm giving up; maybe you can try again with a different compiler?" >&4
11577 echo "I could not find the definition for va_dcl... You have problems..." >&4
11578 val="$undef"; set i_stdarg; eval $setvar
11579 val="$undef"; set i_varargs; eval $setvar
11584 case "$i_varhdr" in
11586 val="$define"; set i_stdarg; eval $setvar
11587 val="$undef"; set i_varargs; eval $setvar
11590 val="$undef"; set i_stdarg; eval $setvar
11591 val="$define"; set i_varargs; eval $setvar
11594 echo "We'll include <$i_varhdr> to get va_dcl definition." >&4;;
11598 : see if the Compiler supports C99 variadic macros
11599 case "$i_stdarg$i_stdlib" in
11601 echo "You have <stdarg.h> and <stdlib.h>, so checking for C99 variadic macros." >&4
11604 #include <stdarg.h>
11606 #define foo(buffer, format, ...) sprintf(buffer, format, __VA_ARGS__)
11610 foo(buf, "%d %g %.*s", 123, 456.0, (int)3, "789fail");
11616 if eval $compile && $run ./try 2>&1 >/dev/null; then
11617 case "`$run ./try`" in
11619 echo "You have C99 variadic macros." >&4
11620 d_c99_variadic_macros="$define"
11623 echo "You don't have functional C99 variadic macros." >&4
11624 d_c99_variadic_macros="$undef"
11628 echo "I couldn't compile and run the test program, so I assume that you don't have functional C99 variadic macros." >&4
11629 d_c99_variadic_macros="$undef"
11634 echo "You don't have <stdarg.h> and <stdlib.h>, so not checking for C99 variadic macros." >&4
11635 d_c99_variadic_macros="$undef"
11639 : see if signal is declared as pointer to function returning int or void
11641 xxx=`./findhdr signal.h`
11642 $test "$xxx" && $cppstdin $cppminus $cppflags < $xxx >$$.tmp 2>/dev/null
11643 if $contains 'int.*\*[ ]*signal' $$.tmp >/dev/null 2>&1 ; then
11644 echo "You have int (*signal())() instead of void." >&4
11646 elif $contains 'void.*\*[ ]*signal' $$.tmp >/dev/null 2>&1 ; then
11647 echo "You have void (*signal())()." >&4
11649 elif $contains 'extern[ ]*[(\*]*signal' $$.tmp >/dev/null 2>&1 ; then
11650 echo "You have int (*signal())() instead of void." >&4
11652 elif $contains 'void.*\*.*sig' $$.tmp >/dev/null 2>&1 ; then
11653 echo "You have void (*signal())()." >&4
11656 case "$d_voidsig" in
11658 echo "I can't determine whether signal handler returns void or int..." >&4
11660 rp="What type does your signal handler return?"
11663 v*) val="$define";;
11667 echo "As you already told me, signal handler returns void." >&4
11670 *) echo "As you already told me, signal handler returns int." >&4
11677 case "$d_voidsig" in
11678 "$define") signal_t="void";;
11679 *) signal_t="int";;
11683 : check for ability to cast large floats to 32-bit ints.
11685 echo 'Checking whether your C compiler can cast large floats to int32.' >&4
11686 if $test "$intsize" -ge 4; then
11693 #$i_stdlib I_STDLIB
11695 #include <stdlib.h>
11697 #include <sys/types.h>
11698 #include <signal.h>
11699 $signal_t blech(int s) { exit(3); }
11706 signal(SIGFPE, blech);
11708 /* Don't let compiler optimize the test away. Store the number
11709 in a writable string for gcc to pass to sscanf under HP-UX.
11711 sprintf(str, "2147483647");
11712 sscanf(str, "%lf", &f); /* f = (double) 0x7fffffff; */
11716 /* x86 processors will probably give 0x8000 0000, which is a
11717 sign change. We don't want that. We want to mimic SPARC
11718 behavior here, which is to preserve the sign and give
11721 if (i32 != ($xxx) f)
11727 if eval $compile_ok; then
11728 $run ./try 2>/dev/null
11731 echo "(I can't seem to compile the test program--assuming it can't)"
11736 echo "Yup, it can."
11739 echo "Nope, it can't."
11746 : check for ability to cast negative floats to unsigned
11748 echo 'Checking whether your C compiler can cast negative float to unsigned.' >&4
11751 #$i_stdlib I_STDLIB
11753 #include <stdlib.h>
11755 #include <sys/types.h>
11756 #include <signal.h>
11757 $signal_t blech(int s) { exit(7); }
11758 $signal_t blech_in_list(int s) { exit(4); }
11759 unsigned long dummy_long(unsigned long p) { return p; }
11760 unsigned int dummy_int(unsigned int p) { return p; }
11761 unsigned short dummy_short(unsigned short p) { return p; }
11765 unsigned long along;
11767 unsigned short ashort;
11771 /* Frustrate gcc-2.7.2's optimizer which failed this test with
11772 a direct f = -123. assignment. gcc-2.8.0 reportedly
11773 optimized the whole file away
11775 /* Store the number in a writable string for gcc to pass to
11776 sscanf under HP-UX.
11778 sprintf(str, "-123");
11779 sscanf(str, "%lf", &f); /* f = -123.; */
11781 signal(SIGFPE, blech);
11782 along = (unsigned long)f;
11783 aint = (unsigned int)f;
11784 ashort = (unsigned short)f;
11785 if (along != (unsigned long)-123)
11787 if (aint != (unsigned int)-123)
11789 if (ashort != (unsigned short)-123)
11791 sprintf(str, "1073741824.");
11792 sscanf(str, "%lf", &f); /* f = (double)0x40000000; */
11795 along = (unsigned long)f;
11796 if (along != 0x80000000)
11800 along = (unsigned long)f;
11801 if (along != 0x7fffffff)
11805 along = (unsigned long)f;
11806 if (along != 0x80000001)
11810 signal(SIGFPE, blech_in_list);
11811 sprintf(str, "123.");
11812 sscanf(str, "%lf", &f); /* f = 123.; */
11813 along = dummy_long((unsigned long)f);
11814 aint = dummy_int((unsigned int)f);
11815 ashort = dummy_short((unsigned short)f);
11816 if (along != (unsigned long)123)
11818 if (aint != (unsigned int)123)
11820 if (ashort != (unsigned short)123)
11827 if eval $compile_ok; then
11828 $run ./try 2>/dev/null
11831 echo "(I can't seem to compile the test program--assuming it can't)"
11834 case "$castflags" in
11836 echo "Yup, it can."
11839 echo "Nope, it can't."
11846 : see if cbrt exists
11850 : see if vprintf exists
11852 if set vprintf val -f d_vprintf; eval $csym; $val; then
11853 echo 'vprintf() found.' >&4
11856 #$i_stdarg I_STDARG /* Only one of these can be defined by i_varhrd */
11857 #$i_varargs I_VARARGS
11859 #$i_stdlib I_STDLIB
11860 #$i_unistd I_UNISTD
11863 # include <stdarg.h>
11864 #else /* I_VARARGS */
11865 # include <varargs.h>
11869 # include <unistd.h>
11873 # include <stdlib.h>
11876 #include <stdio.h> /* vsprintf prototype */
11879 void xxx(int n, ...)
11884 exit((unsigned long)vsprintf(buf,"%s",args) > 10L);
11886 int main() { xxx(1, "foo"); }
11888 #else /* I_VARARGS */
11896 exit((unsigned long)vsprintf(buf,"%s",args) > 10L);
11898 int main() { xxx("foo"); }
11904 if eval $compile_ok; then
11905 if $run ./try; then
11906 echo "Your vsprintf() returns (int)." >&4
11909 echo "Your vsprintf() returns (char*)." >&4
11913 echo 'I am unable to compile the vsprintf() test program.' >&4
11914 # We shouldn't get here. If we do, assume the standard signature,
11915 # not the old BSD one.
11916 echo 'Guessing that vsprintf() returns (int).' >&4
11920 echo 'vprintf() NOT found.' >&4
11931 : see if chown exists
11935 : see if chroot exists
11936 set chroot d_chroot
11939 : see if chsize exists
11940 set chsize d_chsize
11943 : see if class exists
11947 : see if clearenv exists
11948 set clearenv d_clearenv
11951 : Define hasstruct macro for Configure internal use
11952 hasstruct='varname=$1; struct=$2; shift; shift;
11953 while $test $# -ge 2; do
11955 $define) echo "#include <$2>";;
11959 echo "int main () { struct $struct foo; }" >> try.c;
11961 if eval $compile; then
11970 : see whether socket exists
11974 $echo $n "Hmm... $c" >&4
11975 if set socket val -f d_socket; eval $csym; $val; then
11976 echo "Looks like you have Berkeley networking support." >&4
11978 if set setsockopt val -f; eval $csym; $val; then
11981 echo "...but it uses the old BSD 4.1c interface, rather than 4.2." >&4
11982 d_oldsock="$define"
11985 if $contains socklib libc.list >/dev/null 2>&1; then
11986 echo "Looks like you have Berkeley networking support." >&4
11988 : we will have to assume that it supports the 4.2 BSD interface
11991 echo "You don't have Berkeley networking in libc$_a..." >&4
11992 if test "X$d_socket" = "X$define"; then
11993 echo "...but you seem to believe that you have sockets." >&4
11995 for net in net socket
11997 if test -f $sysroot/usr/lib/lib$net$_a; then
11998 ( ($nm $nm_opt $sysroot/usr/lib/lib$net$_a | eval $nm_extract) || \
11999 $ar t $sysroot/usr/lib/lib$net$_a) 2>/dev/null >> libc.list
12000 if $contains socket libc.list >/dev/null 2>&1; then
12005 echo "...but the Wollongong group seems to have hacked it in." >&4
12006 sockethdr="-I$sysroot/usr/netinclude"
12009 echo "Found Berkeley sockets interface in lib$net." >&4
12010 if $contains setsockopt libc.list >/dev/null 2>&1; then
12013 echo "...using the old BSD 4.1c interface, rather than 4.2." >&4
12014 d_oldsock="$define"
12020 if test "X$d_socket" != "X$define"; then
12021 echo "or anywhere else I see." >&4
12029 : see if socketpair exists
12030 set socketpair d_sockpair
12035 echo "Checking the availability sa_len in the sock struct ..." >&4
12037 #include <sys/types.h>
12038 #include <sys/socket.h>
12040 struct sockaddr sa;
12041 return (sa.sa_len);
12045 set try; if eval $compile; then
12048 set d_sockaddr_sa_len; eval $setvar
12052 echo "Checking the availability struct sockaddr_in6 ..." >&4
12054 #include <sys/types.h>
12055 #include <sys/socket.h>
12056 #include <netinet/in.h>
12058 struct sockaddr_in6 sin6;
12059 return (sin6.sin6_family);
12063 set try; if eval $compile; then
12066 set d_sockaddr_in6; eval $setvar
12070 echo "Checking the availability sin6_scope_id in struct sockaddr_in6 ..." >&4
12072 #include <sys/types.h>
12073 #include <sys/socket.h>
12074 #include <netinet/in.h>
12076 struct sockaddr_in6 sin6;
12077 return (sin6.sin6_scope_id);
12081 set try; if eval $compile; then
12084 set d_sin6_scope_id; eval $setvar
12088 echo "Checking the availability struct ip_mreq ..." >&4
12090 #include <sys/types.h>
12091 #include <sys/socket.h>
12092 #include <netinet/in.h>
12094 struct ip_mreq mreq;
12095 return (mreq.imr_multiaddr.s_addr);
12099 set try; if eval $compile; then
12102 set d_ip_mreq; eval $setvar
12106 echo "Checking the availability struct ip_mreq_source ..." >&4
12108 #include <sys/types.h>
12109 #include <sys/socket.h>
12110 #include <netinet/in.h>
12112 struct ip_mreq_source mreq;
12113 return (mreq.imr_multiaddr.s_addr);
12117 set try; if eval $compile; then
12120 set d_ip_mreq_source; eval $setvar
12124 echo "Checking the availability struct ipv6_mreq ..." >&4
12126 #include <sys/types.h>
12127 #include <sys/socket.h>
12128 #include <netinet/in.h>
12130 struct ipv6_mreq mreq;
12131 return (mreq.ipv6mr_interface);
12135 set try; if eval $compile; then
12138 set d_ipv6_mreq; eval $setvar
12142 echo "Checking the availability struct ipv6_mreq_source ..." >&4
12144 #include <sys/types.h>
12145 #include <sys/socket.h>
12146 #include <netinet/in.h>
12148 struct ipv6_mreq_source mreq;
12149 return (mreq.imr_multiaddr.s_addr);
12153 set try; if eval $compile; then
12156 set d_ipv6_mreq_source; eval $setvar
12160 echo "Checking the availability of certain socket constants..." >&4
12161 for ENUM in MSG_CTRUNC MSG_DONTROUTE MSG_OOB MSG_PEEK MSG_PROXY SCM_RIGHTS; do
12162 enum=`$echo $ENUM|./tr '[A-Z]' '[a-z]'`
12164 #include <sys/types.h>
12165 #include <sys/socket.h>
12171 set try; if eval $compile; then
12174 set d_${enum}; eval $setvar
12178 : see if this is a sys/uio.h system
12179 set sys/uio.h i_sysuio
12182 : Check for cmsghdr support
12184 echo "Checking to see if your system supports struct cmsghdr..." >&4
12185 set d_cmsghdr_s cmsghdr $i_systypes sys/types.h $d_socket sys/socket.h $i_sysuio sys/uio.h
12187 case "$d_cmsghdr_s" in
12188 "$define") echo "Yes, it does." ;;
12189 *) echo "No, it doesn't." ;;
12193 : check for const keyword
12195 echo 'Checking to see if your C compiler knows about "const"...' >&4
12196 $cat >const.c <<'EOCP'
12197 typedef struct spug { int drokk; } spug;
12201 const spug y = { 0 };
12204 if $cc -c $ccflags const.c >/dev/null 2>&1 ; then
12206 echo "Yup, it does."
12209 echo "Nope, it doesn't."
12214 : see if copysign exists
12215 set copysign d_copysign
12218 : see if copysignl exists
12219 set copysignl d_copysignl
12222 : see if crypt exists
12227 $define) cryptlib='' ;;
12228 *) if set crypt val -f d_crypt; eval $csym; $val; then
12229 echo 'crypt() found.' >&4
12233 cryptlib=`./loc Slibcrypt$_a "" $xlibpth`
12234 if $test -z "$cryptlib"; then
12235 cryptlib=`./loc Mlibcrypt$_a "" $xlibpth`
12239 if $test -z "$cryptlib"; then
12240 cryptlib=`./loc Llibcrypt$_a "" $xlibpth`
12244 if $test -z "$cryptlib"; then
12245 cryptlib=`./loc libcrypt$_a "" $libpth`
12249 if $test -z "$cryptlib"; then
12250 echo 'crypt() NOT found.' >&4
12261 : see if this is a crypt.h system
12262 set crypt.h i_crypt
12265 : see if crypt_r exists
12266 set crypt_r d_crypt_r
12268 case "$d_crypt_r" in
12270 hdrs="$i_systypes sys/types.h define stdio.h $i_crypt crypt.h"
12271 case "$d_crypt_r_proto:$usethreads" in
12272 ":define") d_crypt_r_proto=define
12273 set d_crypt_r_proto crypt_r $hdrs
12277 case "$d_crypt_r_proto" in
12279 case "$crypt_r_proto" in
12280 ''|0) try='char* crypt_r(const char*, const char*, struct crypt_data*);'
12281 ./protochk "$extern_C $try" $hdrs && crypt_r_proto=B_CCS ;;
12283 case "$crypt_r_proto" in
12284 ''|0) try='char* crypt_r(const char*, const char*, CRYPTD*);'
12285 ./protochk "$extern_C $try" $hdrs && crypt_r_proto=B_CCD ;;
12287 case "$crypt_r_proto" in
12288 ''|0) d_crypt_r=undef
12290 echo "Disabling crypt_r, cannot determine prototype." >&4 ;;
12291 * ) case "$crypt_r_proto" in
12292 REENTRANT_PROTO*) ;;
12293 *) crypt_r_proto="REENTRANT_PROTO_$crypt_r_proto" ;;
12295 echo "Prototype: $try" ;;
12298 *) case "$usethreads" in
12299 define) echo "crypt_r has no prototype, not using it." >&4 ;;
12310 : get csh whereabouts
12312 'csh') val="$undef" ;;
12313 *) val="$define" ;;
12317 : Respect a hint or command line value for full_csh.
12318 case "$full_csh" in
12319 '') full_csh=$csh ;;
12322 : see if ctermid exists
12323 set ctermid d_ctermid
12326 : see if ctermid_r exists
12327 set ctermid_r d_ctermid_r
12329 case "$d_ctermid_r" in
12331 hdrs="$i_systypes sys/types.h define stdio.h "
12332 case "$d_ctermid_r_proto:$usethreads" in
12333 ":define") d_ctermid_r_proto=define
12334 set d_ctermid_r_proto ctermid_r $hdrs
12338 case "$d_ctermid_r_proto" in
12340 case "$ctermid_r_proto" in
12341 ''|0) try='char* ctermid_r(char*);'
12342 ./protochk "$extern_C $try" $hdrs && ctermid_r_proto=B_B ;;
12344 case "$ctermid_r_proto" in
12345 ''|0) d_ctermid_r=undef
12347 echo "Disabling ctermid_r, cannot determine prototype." >&4 ;;
12348 * ) case "$ctermid_r_proto" in
12349 REENTRANT_PROTO*) ;;
12350 *) ctermid_r_proto="REENTRANT_PROTO_$ctermid_r_proto" ;;
12352 echo "Prototype: $try" ;;
12355 *) case "$usethreads" in
12356 define) echo "ctermid_r has no prototype, not using it." >&4 ;;
12363 *) ctermid_r_proto=0
12367 : see if ctime_r exists
12368 set ctime_r d_ctime_r
12370 case "$d_ctime_r" in
12372 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
12373 case "$d_ctime_r_proto:$usethreads" in
12374 ":define") d_ctime_r_proto=define
12375 set d_ctime_r_proto ctime_r $hdrs
12379 case "$d_ctime_r_proto" in
12381 case "$ctime_r_proto" in
12382 ''|0) try='char* ctime_r(const time_t*, char*);'
12383 ./protochk "$extern_C $try" $hdrs && ctime_r_proto=B_SB ;;
12385 case "$ctime_r_proto" in
12386 ''|0) try='char* ctime_r(const time_t*, char*, int);'
12387 ./protochk "$extern_C $try" $hdrs && ctime_r_proto=B_SBI ;;
12389 case "$ctime_r_proto" in
12390 ''|0) try='int ctime_r(const time_t*, char*);'
12391 ./protochk "$extern_C $try" $hdrs && ctime_r_proto=I_SB ;;
12393 case "$ctime_r_proto" in
12394 ''|0) try='int ctime_r(const time_t*, char*, int);'
12395 ./protochk "$extern_C $try" $hdrs && ctime_r_proto=I_SBI ;;
12397 case "$ctime_r_proto" in
12398 ''|0) d_ctime_r=undef
12400 echo "Disabling ctime_r, cannot determine prototype." >&4 ;;
12401 * ) case "$ctime_r_proto" in
12402 REENTRANT_PROTO*) ;;
12403 *) ctime_r_proto="REENTRANT_PROTO_$ctime_r_proto" ;;
12405 echo "Prototype: $try" ;;
12408 *) case "$usethreads" in
12409 define) echo "ctime_r has no prototype, not using it." >&4 ;;
12420 : see if cuserid exists
12421 set cuserid d_cuserid
12424 : see if this is a limits.h system
12425 set limits.h i_limits
12428 : See if number of significant digits in a double precision number is known
12430 $cat >dbl_dig.c <<EOM
12431 #$i_limits I_LIMITS
12434 #include <limits.h>
12440 printf("Contains DBL_DIG");
12443 $cppstdin $cppflags $cppminus < dbl_dig.c >dbl_dig.E 2>/dev/null
12444 if $contains 'DBL_DIG' dbl_dig.E >/dev/null 2>&1; then
12445 echo "DBL_DIG found." >&4
12448 echo "DBL_DIG NOT found." >&4
12455 : see if dbm.h is available
12456 : see if dbmclose exists
12457 set dbmclose d_dbmclose
12460 case "$d_dbmclose" in
12470 *) set rpcsvc/dbm.h i_rpcsvcdbm
12475 *) echo "We won't be including <dbm.h>"
12485 : see if prototype for dbminit is available
12487 set d_dbminitproto dbminit $i_dbm dbm.h
12490 : see if difftime exists
12491 set difftime d_difftime
12494 : see if this is a dirent system
12496 if xinc=`./findhdr dirent.h`; $test "$xinc"; then
12498 echo "<dirent.h> found." >&4
12501 if xinc=`./findhdr sys/dir.h`; $test "$xinc"; then
12502 echo "<sys/dir.h> found." >&4
12505 xinc=`./findhdr sys/ndir.h`
12507 echo "<dirent.h> NOT found." >&4
12512 : Look for type of directory structure.
12514 $cppstdin $cppflags $cppminus < "$xinc" > try.c
12516 case "$direntrytype" in
12518 case "$i_dirent" in
12519 $define) guess1='struct dirent' ;;
12520 *) guess1='struct direct' ;;
12523 *) guess1="$direntrytype"
12528 'struct dirent') guess2='struct direct' ;;
12529 *) guess2='struct dirent' ;;
12532 if $contains "$guess1" try.c >/dev/null 2>&1; then
12533 direntrytype="$guess1"
12534 echo "Your directory entries are $direntrytype." >&4
12535 elif $contains "$guess2" try.c >/dev/null 2>&1; then
12536 direntrytype="$guess2"
12537 echo "Your directory entries seem to be $direntrytype." >&4
12539 echo "I don't recognize your system's directory entries." >&4
12540 rp="What type is used for directory entries on this system?"
12543 direntrytype="$ans"
12547 : see if the directory entry stores field length
12549 $cppstdin $cppflags $cppminus < "$xinc" > try.c
12550 if $contains 'd_namlen' try.c >/dev/null 2>&1; then
12551 echo "Good, your directory entry keeps length information in d_namlen." >&4
12554 echo "Your directory entry does not know about the d_namlen field." >&4
12561 : Look for DIR.dd_fd
12562 case "$i_dirent" in
12564 echo "Checking to see if DIR has a dd_fd member variable" >&4
12566 #$i_stdlib I_STDLIB
12568 #include <stdlib.h>
12570 #include <dirent.h>
12580 if eval $compile; then
12581 echo "Yes, it does."
12584 echo "No, it does not."
12589 echo "You don't have a <dirent.h>, so not checking for dd_fd." >&4
12597 : see if this is an sysdir system
12598 set sys/dir.h i_sysdir
12601 : see if this is an sysndir system
12602 set sys/ndir.h i_sysndir
12607 $cat >dirfd.c <<EOM
12609 #$i_stdlib I_STDLIB
12611 #include <stdlib.h>
12613 #$i_dirent I_DIRENT /**/
12614 #$i_sysdir I_SYS_DIR /**/
12615 #$i_sysndir I_SYS_NDIR /**/
12616 #$i_systypes I_SYS_TYPES /**/
12617 #if defined(I_SYS_TYPES)
12618 #include <sys/types.h>
12620 #if defined(I_DIRENT)
12621 #include <dirent.h>
12624 #include <sys/ndir.h>
12628 #include <ndir.h> /* may be wrong in the future */
12630 #include <sys/dir.h>
12636 DIR *dirp = opendir(".");
12637 if (dirfd(dirp) >= 0)
12645 if eval $compile; then
12649 $define) echo "dirfd() found." >&4 ;;
12650 *) echo "dirfd() NOT found." >&4 ;;
12656 : see if dladdr exists
12657 set dladdr d_dladdr
12660 : see if dlerror exists
12663 set dlerror d_dlerror
12667 : see if dlfcn is available
12668 set dlfcn.h i_dlfcn
12671 : Check what extension to use for shared libs
12676 On a few systems, the dynamically loaded modules that perl generates and uses
12677 will need a different extension than shared libs. The default will probably
12683 *) dflt="$dlext" ;;
12685 rp='What is the extension of dynamically loaded modules'
12694 : Check if dlsym need a leading underscore
12700 echo "Checking whether your dlsym() needs a leading underscore ..." >&4
12701 $cat >dyna.c <<'EOM'
12708 #$i_stdlib I_STDLIB
12710 #include <stdlib.h>
12714 #include <dlfcn.h> /* the dynamic linker include file for SunOS/Solaris */
12716 #include <sys/types.h>
12721 extern int fred() ;
12730 int mode = RTLD_LAZY ;
12732 handle = dlopen("./dyna.$dlext", mode) ;
12733 if (handle == NULL) {
12738 symbol = dlsym(handle, "fred") ;
12739 if (symbol == NULL) {
12740 /* try putting a leading underscore */
12741 symbol = dlsym(handle, "_fred") ;
12742 if (symbol == NULL) {
12755 : Call the object file tmp-dyna.o in case dlext=o.
12756 if $cc $ccflags $cccdlflags -c dyna.c > /dev/null 2>&1 &&
12757 mv dyna${_o} tmp-dyna${_o} > /dev/null 2>&1 &&
12758 $ld -o dyna.$dlext $ldflags $lddlflags tmp-dyna${_o} > /dev/null 2>&1 &&
12759 $cc -o fred $ccflags $ldflags $cccdlflags $ccdlflags fred.c $libs > /dev/null 2>&1 && $to dyna.$dlext; then
12762 1) echo "Test program failed using dlopen." >&4
12763 echo "Perhaps you should not use dynamic loading." >&4;;
12764 2) echo "Test program failed using dlsym." >&4
12765 echo "Perhaps you should not use dynamic loading." >&4;;
12766 3) echo "dlsym needs a leading underscore" >&4
12768 4) echo "dlsym doesn't need a leading underscore." >&4;;
12771 echo "I can't compile and run the test program." >&4
12772 echo "I'm guessing that dlsym doesn't need a leading underscore." >&4
12777 $rm -f fred fred.* dyna.$dlext dyna.* tmp-dyna.*
12782 : see if drand48_r exists
12783 set drand48_r d_drand48_r
12785 case "$d_drand48_r" in
12787 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
12788 case "$d_drand48_r_proto:$usethreads" in
12789 ":define") d_drand48_r_proto=define
12790 set d_drand48_r_proto drand48_r $hdrs
12794 case "$d_drand48_r_proto" in
12796 case "$drand48_r_proto" in
12797 ''|0) try='int drand48_r(struct drand48_data*, double*);'
12798 ./protochk "$extern_C $try" $hdrs && drand48_r_proto=I_ST ;;
12800 case "$drand48_r_proto" in
12801 ''|0) d_drand48_r=undef
12803 echo "Disabling drand48_r, cannot determine prototype." >&4 ;;
12804 * ) case "$drand48_r_proto" in
12805 REENTRANT_PROTO*) ;;
12806 *) drand48_r_proto="REENTRANT_PROTO_$drand48_r_proto" ;;
12808 echo "Prototype: $try" ;;
12811 *) case "$usethreads" in
12812 define) echo "drand48_r has no prototype, not using it." >&4 ;;
12819 *) drand48_r_proto=0
12823 : see if prototype for drand48 is available
12825 set d_drand48proto drand48 $i_stdlib stdlib.h $i_unistd unistd.h
12828 : see if dup2 exists
12832 : see if eaccess exists
12833 set eaccess d_eaccess
12836 : see if endgrent exists
12837 set endgrent d_endgrent
12840 : see if this is an grp system
12846 xxx=`./findhdr grp.h`
12847 $cppstdin $cppflags $cppminus < $xxx >$$.h
12849 if $contains 'gr_passwd' $$.h >/dev/null 2>&1; then
12861 set d_grpasswd; eval $setvar
12865 : see if endgrent_r exists
12866 set endgrent_r d_endgrent_r
12868 case "$d_endgrent_r" in
12870 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
12871 case "$d_endgrent_r_proto:$usethreads" in
12872 ":define") d_endgrent_r_proto=define
12873 set d_endgrent_r_proto endgrent_r $hdrs
12877 case "$d_endgrent_r_proto" in
12879 case "$endgrent_r_proto" in
12880 ''|0) try='int endgrent_r(FILE**);'
12881 ./protochk "$extern_C $try" $hdrs && endgrent_r_proto=I_H ;;
12883 case "$endgrent_r_proto" in
12884 ''|0) try='void endgrent_r(FILE**);'
12885 ./protochk "$extern_C $try" $hdrs && endgrent_r_proto=V_H ;;
12887 case "$endgrent_r_proto" in
12888 ''|0) d_endgrent_r=undef
12890 echo "Disabling endgrent_r, cannot determine prototype." >&4 ;;
12891 * ) case "$endgrent_r_proto" in
12892 REENTRANT_PROTO*) ;;
12893 *) endgrent_r_proto="REENTRANT_PROTO_$endgrent_r_proto" ;;
12895 echo "Prototype: $try" ;;
12898 *) case "$usethreads" in
12899 define) echo "endgrent_r has no prototype, not using it." >&4 ;;
12906 *) endgrent_r_proto=0
12910 : see if endhostent exists
12911 set endhostent d_endhent
12914 : see if this is a netdb.h system
12915 set netdb.h i_netdb
12918 : see if endhostent_r exists
12919 set endhostent_r d_endhostent_r
12921 case "$d_endhostent_r" in
12923 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
12924 case "$d_endhostent_r_proto:$usethreads" in
12925 ":define") d_endhostent_r_proto=define
12926 set d_endhostent_r_proto endhostent_r $hdrs
12930 case "$d_endhostent_r_proto" in
12932 case "$endhostent_r_proto" in
12933 ''|0) try='int endhostent_r(struct hostent_data*);'
12934 ./protochk "$extern_C $try" $hdrs && endhostent_r_proto=I_D ;;
12936 case "$endhostent_r_proto" in
12937 ''|0) try='void endhostent_r(struct hostent_data*);'
12938 ./protochk "$extern_C $try" $hdrs && endhostent_r_proto=V_D ;;
12940 case "$endhostent_r_proto" in
12941 ''|0) d_endhostent_r=undef
12942 endhostent_r_proto=0
12943 echo "Disabling endhostent_r, cannot determine prototype." >&4 ;;
12944 * ) case "$endhostent_r_proto" in
12945 REENTRANT_PROTO*) ;;
12946 *) endhostent_r_proto="REENTRANT_PROTO_$endhostent_r_proto" ;;
12948 echo "Prototype: $try" ;;
12951 *) case "$usethreads" in
12952 define) echo "endhostent_r has no prototype, not using it." >&4 ;;
12954 d_endhostent_r=undef
12955 endhostent_r_proto=0
12959 *) endhostent_r_proto=0
12963 : see if endnetent exists
12964 set endnetent d_endnent
12967 : see if endnetent_r exists
12968 set endnetent_r d_endnetent_r
12970 case "$d_endnetent_r" in
12972 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
12973 case "$d_endnetent_r_proto:$usethreads" in
12974 ":define") d_endnetent_r_proto=define
12975 set d_endnetent_r_proto endnetent_r $hdrs
12979 case "$d_endnetent_r_proto" in
12981 case "$endnetent_r_proto" in
12982 ''|0) try='int endnetent_r(struct netent_data*);'
12983 ./protochk "$extern_C $try" $hdrs && endnetent_r_proto=I_D ;;
12985 case "$endnetent_r_proto" in
12986 ''|0) try='void endnetent_r(struct netent_data*);'
12987 ./protochk "$extern_C $try" $hdrs && endnetent_r_proto=V_D ;;
12989 case "$endnetent_r_proto" in
12990 ''|0) d_endnetent_r=undef
12991 endnetent_r_proto=0
12992 echo "Disabling endnetent_r, cannot determine prototype." >&4 ;;
12993 * ) case "$endnetent_r_proto" in
12994 REENTRANT_PROTO*) ;;
12995 *) endnetent_r_proto="REENTRANT_PROTO_$endnetent_r_proto" ;;
12997 echo "Prototype: $try" ;;
13000 *) case "$usethreads" in
13001 define) echo "endnetent_r has no prototype, not using it." >&4 ;;
13003 d_endnetent_r=undef
13004 endnetent_r_proto=0
13008 *) endnetent_r_proto=0
13012 : see if endprotoent exists
13013 set endprotoent d_endpent
13016 : see if endprotoent_r exists
13017 set endprotoent_r d_endprotoent_r
13019 case "$d_endprotoent_r" in
13021 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13022 case "$d_endprotoent_r_proto:$usethreads" in
13023 ":define") d_endprotoent_r_proto=define
13024 set d_endprotoent_r_proto endprotoent_r $hdrs
13028 case "$d_endprotoent_r_proto" in
13030 case "$endprotoent_r_proto" in
13031 ''|0) try='int endprotoent_r(struct protoent_data*);'
13032 ./protochk "$extern_C $try" $hdrs && endprotoent_r_proto=I_D ;;
13034 case "$endprotoent_r_proto" in
13035 ''|0) try='void endprotoent_r(struct protoent_data*);'
13036 ./protochk "$extern_C $try" $hdrs && endprotoent_r_proto=V_D ;;
13038 case "$endprotoent_r_proto" in
13039 ''|0) d_endprotoent_r=undef
13040 endprotoent_r_proto=0
13041 echo "Disabling endprotoent_r, cannot determine prototype." >&4 ;;
13042 * ) case "$endprotoent_r_proto" in
13043 REENTRANT_PROTO*) ;;
13044 *) endprotoent_r_proto="REENTRANT_PROTO_$endprotoent_r_proto" ;;
13046 echo "Prototype: $try" ;;
13049 *) case "$usethreads" in
13050 define) echo "endprotoent_r has no prototype, not using it." >&4 ;;
13052 d_endprotoent_r=undef
13053 endprotoent_r_proto=0
13057 *) endprotoent_r_proto=0
13061 : see if endpwent exists
13062 set endpwent d_endpwent
13065 : see if this is a pwd.h system
13071 xxx=`./findhdr pwd.h`
13072 $cppstdin $cppflags $cppminus < $xxx >$$.h
13074 if $contains 'pw_quota' $$.h >/dev/null 2>&1; then
13082 if $contains 'pw_age' $$.h >/dev/null 2>&1; then
13090 if $contains 'pw_change' $$.h >/dev/null 2>&1; then
13098 if $contains 'pw_class' $$.h >/dev/null 2>&1; then
13106 if $contains 'pw_expire' $$.h >/dev/null 2>&1; then
13114 if $contains 'pw_comment' $$.h >/dev/null 2>&1; then
13122 if $contains 'pw_gecos' $$.h >/dev/null 2>&1; then
13130 if $contains 'pw_passwd' $$.h >/dev/null 2>&1; then
13142 set d_pwquota; eval $setvar
13143 set d_pwage; eval $setvar
13144 set d_pwchange; eval $setvar
13145 set d_pwclass; eval $setvar
13146 set d_pwexpire; eval $setvar
13147 set d_pwcomment; eval $setvar
13148 set d_pwgecos; eval $setvar
13149 set d_pwpasswd; eval $setvar
13153 : see if endpwent_r exists
13154 set endpwent_r d_endpwent_r
13156 case "$d_endpwent_r" in
13158 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
13159 case "$d_endpwent_r_proto:$usethreads" in
13160 ":define") d_endpwent_r_proto=define
13161 set d_endpwent_r_proto endpwent_r $hdrs
13165 case "$d_endpwent_r_proto" in
13167 case "$endpwent_r_proto" in
13168 ''|0) try='int endpwent_r(FILE**);'
13169 ./protochk "$extern_C $try" $hdrs && endpwent_r_proto=I_H ;;
13171 case "$endpwent_r_proto" in
13172 ''|0) try='void endpwent_r(FILE**);'
13173 ./protochk "$extern_C $try" $hdrs && endpwent_r_proto=V_H ;;
13175 case "$endpwent_r_proto" in
13176 ''|0) d_endpwent_r=undef
13178 echo "Disabling endpwent_r, cannot determine prototype." >&4 ;;
13179 * ) case "$endpwent_r_proto" in
13180 REENTRANT_PROTO*) ;;
13181 *) endpwent_r_proto="REENTRANT_PROTO_$endpwent_r_proto" ;;
13183 echo "Prototype: $try" ;;
13186 *) case "$usethreads" in
13187 define) echo "endpwent_r has no prototype, not using it." >&4 ;;
13194 *) endpwent_r_proto=0
13198 : see if endservent exists
13199 set endservent d_endsent
13202 : see if endservent_r exists
13203 set endservent_r d_endservent_r
13205 case "$d_endservent_r" in
13207 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13208 case "$d_endservent_r_proto:$usethreads" in
13209 ":define") d_endservent_r_proto=define
13210 set d_endservent_r_proto endservent_r $hdrs
13214 case "$d_endservent_r_proto" in
13216 case "$endservent_r_proto" in
13217 ''|0) try='int endservent_r(struct servent_data*);'
13218 ./protochk "$extern_C $try" $hdrs && endservent_r_proto=I_D ;;
13220 case "$endservent_r_proto" in
13221 ''|0) try='void endservent_r(struct servent_data*);'
13222 ./protochk "$extern_C $try" $hdrs && endservent_r_proto=V_D ;;
13224 case "$endservent_r_proto" in
13225 ''|0) d_endservent_r=undef
13226 endservent_r_proto=0
13227 echo "Disabling endservent_r, cannot determine prototype." >&4 ;;
13228 * ) case "$endservent_r_proto" in
13229 REENTRANT_PROTO*) ;;
13230 *) endservent_r_proto="REENTRANT_PROTO_$endservent_r_proto" ;;
13232 echo "Prototype: $try" ;;
13235 *) case "$usethreads" in
13236 define) echo "endservent_r has no prototype, not using it." >&4 ;;
13238 d_endservent_r=undef
13239 endservent_r_proto=0
13243 *) endservent_r_proto=0
13247 : Locate the flags for 'open()'
13250 #include <sys/types.h>
13255 #include <sys/file.h>
13257 #$i_stdlib I_STDLIB
13259 #include <stdlib.h>
13270 : check sys/file.h first to get FREAD on Sun
13271 if $test `./findhdr sys/file.h` && \
13272 set try -DI_SYS_FILE && eval $compile; then
13274 echo "<sys/file.h> defines the O_* constants..." >&4
13275 if $run ./try; then
13276 echo "and you have the 3 argument form of open()." >&4
13279 echo "but not the 3 argument form of open(). Oh, well." >&4
13282 elif $test `./findhdr fcntl.h` && \
13283 set try -DI_FCNTL && eval $compile; then
13285 echo "<fcntl.h> defines the O_* constants..." >&4
13286 if $run ./try; then
13287 echo "and you have the 3 argument form of open()." >&4
13290 echo "but not the 3 argument form of open(). Oh, well." >&4
13295 echo "I can't find the O_* constant definitions! You got problems." >&4
13301 : see if this is a sys/file.h system
13306 : do we need to include sys/file.h ?
13310 if $h_sysfile; then
13312 echo "We'll be including <sys/file.h>." >&4
13315 echo "We won't be including <sys/file.h>." >&4
13325 : see if fcntl.h is there
13330 : see if we can include fcntl.h
13336 echo "We'll be including <fcntl.h>." >&4
13339 if $h_sysfile; then
13340 echo "We don't need to include <fcntl.h> if we include <sys/file.h>." >&4
13342 echo "We won't be including <fcntl.h>." >&4
13354 : see if fork exists
13358 : see if pipe exists
13362 : check for non-blocking I/O stuff
13363 case "$h_sysfile" in
13364 true) echo "#include <sys/file.h>" > head.c;;
13367 true) echo "#include <fcntl.h>" > head.c;;
13368 *) echo "#include <sys/fcntl.h>" > head.c;;
13373 echo "Figuring out the flag used by open() for non-blocking I/O..." >&4
13374 case "$o_nonblock" in
13376 $cat head.c > try.c
13377 $cat >>try.c <<EOCP
13379 #$i_stdlib I_STDLIB
13381 #include <stdlib.h>
13389 printf("O_NONBLOCK\n");
13393 printf("O_NDELAY\n");
13397 printf("FNDELAY\n");
13404 if eval $compile_ok; then
13405 o_nonblock=`$run ./try`
13406 case "$o_nonblock" in
13407 '') echo "I can't figure it out, assuming O_NONBLOCK will do.";;
13408 *) echo "Seems like we can use $o_nonblock.";;
13411 echo "(I can't compile the test program; pray O_NONBLOCK is right!)"
13414 *) echo "Using $hint value $o_nonblock.";;
13419 echo "Let's see what value errno gets from read() on a $o_nonblock file..." >&4
13422 case "$d_fork:$d_pipe:$d_alarm" in
13423 define:define:define)
13424 $cat head.c > try.c
13425 $cat >>try.c <<EOCP
13427 #include <sys/types.h>
13428 #include <signal.h>
13430 #$i_stdlib I_STDLIB
13432 #include <stdlib.h>
13438 #define MY_O_NONBLOCK $o_nonblock
13439 #ifndef errno /* XXX need better Configure test */
13442 #$i_unistd I_UNISTD
13444 #include <unistd.h>
13446 #$i_string I_STRING
13448 #include <string.h>
13450 #include <strings.h>
13452 $signal_t blech(int x) { exit(3); }
13454 $cat >> try.c <<'EOCP'
13463 ret = pipe(pd); /* Down: child -> parent */
13466 ret = pipe(pu); /* Up: parent -> child */
13470 close(pd[1]); /* Parent reads from pd[0] */
13471 close(pu[0]); /* Parent writes (blocking) to pu[1] */
13473 if (-1 == fcntl(pd[0], F_SETFL, MY_O_NONBLOCK))
13478 signal(SIGALRM, blech);
13480 if ((ret = read(pd[0], buf, 1)) > 0) /* Nothing to read! */
13482 sprintf(string, "%d\n", ret);
13483 ret = write(2, string, strlen(string));
13484 if (ret != strlen(string))
13488 if (errno == EAGAIN) {
13489 printf("EAGAIN\n");
13494 if (errno == EWOULDBLOCK)
13495 printf("EWOULDBLOCK\n");
13498 ret = write(pu[1], buf, 1); /* Unblocks child, tell it to close our pipe */
13501 sleep(2); /* Give it time to close our pipe */
13503 ret = read(pd[0], buf, 1); /* Should read EOF */
13505 sprintf(string, "%d\n", ret);
13506 ret = write(4, string, strlen(string));
13507 if (ret != strlen(string))
13512 close(pd[0]); /* We write to pd[1] */
13513 close(pu[1]); /* We read from pu[0] */
13514 ret = read(pu[0], buf, 1); /* Wait for parent to signal us we may continue */
13517 close(pd[1]); /* Pipe pd is now fully closed! */
13518 exit(0); /* Bye bye, thank you for playing! */
13522 if eval $compile_ok; then
13523 echo "$startsh" >mtry
13524 echo "$run ./try >try.out 2>try.ret 4>try.err || exit 4" >>mtry
13526 $run ./mtry >/dev/null 2>&1
13528 0) eagain=`$cat try.out`;;
13529 1) echo "Could not perform non-blocking setting!";;
13530 2) echo "I did a successful read() for something that was not there!";;
13531 3) echo "Hmm... non-blocking I/O does not seem to be working!";;
13532 4) echo "Could not find F_SETFL!";;
13533 *) echo "Something terribly wrong happened during testing.";;
13535 rd_nodata=`$cat try.ret`
13536 echo "A read() system call with no data present returns $rd_nodata."
13537 case "$rd_nodata" in
13540 echo "(That's peculiar, fixing that to be -1.)"
13546 echo "Forcing errno EAGAIN on read() with no data available."
13550 echo "Your read() sets errno to $eagain when no data is available."
13553 status=`$cat try.err`
13555 0) echo "And it correctly returns 0 to signal EOF.";;
13556 -1) echo "But it also returns -1 to signal EOF, so be careful!";;
13557 *) echo "However, your read() returns '$status' on EOF??";;
13560 if test "$status" = "$rd_nodata"; then
13561 echo "WARNING: you can't distinguish between EOF and no data!"
13565 echo "I can't compile the test program--assuming errno EAGAIN will do."
13569 *) echo "Can't figure out how to test this--assuming errno EAGAIN will do."
13578 echo "Using $hint value $eagain."
13579 echo "Your read() returns $rd_nodata when no data is present."
13580 case "$d_eofnblk" in
13581 "$define") echo "And you can see EOF because read() returns 0.";;
13582 "$undef") echo "But you can't see EOF status from read() returned value.";;
13584 echo "(Assuming you can't see EOF status from read anyway.)"
13590 $rm_try head.c mtry
13592 : see if erf exists
13596 : see if erfc exists
13600 : see if exp2 exists
13604 : see if expm1 exists
13608 : see if _ptr and _cnt from stdio act std
13611 if $contains '_lbfsize' `./findhdr stdio.h` >/dev/null 2>&1 ; then
13612 echo "(Looks like you have stdio.h from BSD.)"
13613 case "$stdio_ptr" in
13614 '') stdio_ptr='((fp)->_p)'
13617 *) ptr_lval=$d_stdio_ptr_lval;;
13619 case "$stdio_cnt" in
13620 '') stdio_cnt='((fp)->_r)'
13623 *) cnt_lval=$d_stdio_cnt_lval;;
13625 case "$stdio_base" in
13626 '') stdio_base='((fp)->_ub._base ? (fp)->_ub._base : (fp)->_bf._base)';;
13628 case "$stdio_bufsiz" in
13629 '') stdio_bufsiz='((fp)->_ub._base ? (fp)->_ub._size : (fp)->_bf._size)';;
13631 elif $contains '_IO_fpos_t' `./findhdr stdio.h` `./findhdr libio.h` >/dev/null 2>&1 ; then
13632 echo "(Looks like you have stdio.h from Linux.)"
13633 case "$stdio_ptr" in
13634 '') stdio_ptr='((fp)->_IO_read_ptr)'
13637 *) ptr_lval=$d_stdio_ptr_lval;;
13639 case "$stdio_cnt" in
13640 '') stdio_cnt='((fp)->_IO_read_end - (fp)->_IO_read_ptr)'
13643 *) cnt_lval=$d_stdio_cnt_lval;;
13645 case "$stdio_base" in
13646 '') stdio_base='((fp)->_IO_read_base)';;
13648 case "$stdio_bufsiz" in
13649 '') stdio_bufsiz='((fp)->_IO_read_end - (fp)->_IO_read_base)';;
13652 case "$stdio_ptr" in
13653 '') stdio_ptr='((fp)->_ptr)'
13656 *) ptr_lval=$d_stdio_ptr_lval;;
13658 case "$stdio_cnt" in
13659 '') stdio_cnt='((fp)->_cnt)'
13662 *) cnt_lval=$d_stdio_cnt_lval;;
13664 case "$stdio_base" in
13665 '') stdio_base='((fp)->_base)';;
13667 case "$stdio_bufsiz" in
13668 '') stdio_bufsiz='((fp)->_cnt + (fp)->_ptr - (fp)->_base)';;
13672 : test whether _ptr and _cnt really work
13673 echo "Checking how std your stdio is..." >&4
13676 #$i_stdlib I_STDLIB
13678 #include <stdlib.h>
13680 #define FILE_ptr(fp) $stdio_ptr
13681 #define FILE_cnt(fp) $stdio_cnt
13683 FILE *fp = fopen("try.c", "r");
13686 18 <= FILE_cnt(fp) &&
13687 strncmp(FILE_ptr(fp), "include <stdio.h>\n", 18) == 0
13695 if eval $compile && $to try.c; then
13696 if $run ./try; then
13697 echo "Your stdio acts pretty std."
13700 echo "Your stdio isn't very std."
13703 echo "Your stdio doesn't appear very std."
13707 # glibc 2.2.90 and above apparently change stdio streams so Perl's
13708 # direct buffer manipulation no longer works. The Configure tests
13709 # should be changed to correctly detect this, but until then,
13710 # the following check should at least let perl compile and run.
13711 # (This quick fix should be updated before 5.8.1.)
13712 # To be defensive, reject all unknown versions, and all versions > 2.2.9.
13713 # A. Dougherty, June 3, 2002.
13714 case "$d_gnulibc" in
13716 case "$gnulibc_version" in
13720 *) echo "But I will not snoop inside glibc $gnulibc_version stdio buffers."
13729 : Can _ptr be used as an lvalue?
13730 case "$d_stdstdio$ptr_lval" in
13731 $define$define) val=$define ;;
13734 set d_stdio_ptr_lval
13737 : Can _cnt be used as an lvalue?
13738 case "$d_stdstdio$cnt_lval" in
13739 $define$define) val=$define ;;
13742 set d_stdio_cnt_lval
13746 : test whether setting _ptr sets _cnt as a side effect
13747 d_stdio_ptr_lval_sets_cnt="$undef"
13748 d_stdio_ptr_lval_nochange_cnt="$undef"
13749 case "$d_stdio_ptr_lval$d_stdstdio" in
13751 echo "Checking to see what happens if we set the stdio ptr..." >&4
13754 /* Can we scream? */
13755 /* Eat dust sed :-) */
13756 /* In the buffer space, no one can hear you scream. */
13757 #$i_stdlib I_STDLIB
13759 #include <stdlib.h>
13761 #define FILE_ptr(fp) $stdio_ptr
13762 #define FILE_cnt(fp) $stdio_cnt
13763 #include <sys/types.h>
13765 FILE *fp = fopen("try.c", "r");
13770 puts("Fail even to read");
13773 c = getc(fp); /* Read away the first # */
13775 puts("Fail even to read");
13779 18 <= FILE_cnt(fp) &&
13780 strncmp(FILE_ptr(fp), "include <stdio.h>\n", 18) == 0
13782 puts("Fail even to read");
13785 ptr = (char*) FILE_ptr(fp);
13786 cnt = (size_t)FILE_cnt(fp);
13788 FILE_ptr(fp) += 42;
13790 if ((char*)FILE_ptr(fp) != (ptr + 42)) {
13791 printf("Fail ptr check %p != %p", FILE_ptr(fp), (ptr + 42));
13794 if (FILE_cnt(fp) <= 20) {
13795 printf ("Fail (<20 chars to test)");
13798 if (strncmp(FILE_ptr(fp), "Eat dust sed :-) */\n", 20) != 0) {
13799 puts("Fail compare");
13802 if (cnt == FILE_cnt(fp)) {
13803 puts("Pass_unchanged");
13806 if (FILE_cnt(fp) == (cnt - 42)) {
13807 puts("Pass_changed");
13810 printf("Fail count was %d now %d\n", cnt, FILE_cnt(fp));
13816 if eval $compile && $to try.c; then
13817 case `$run ./try` in
13819 echo "Increasing ptr in your stdio decreases cnt by the same amount. Good." >&4
13820 d_stdio_ptr_lval_sets_cnt="$define" ;;
13822 echo "Increasing ptr in your stdio leaves cnt unchanged. Good." >&4
13823 d_stdio_ptr_lval_nochange_cnt="$define" ;;
13825 echo "Increasing ptr in your stdio didn't do exactly what I expected. We'll not be doing that then." >&4 ;;
13827 echo "It appears attempting to set ptr in your stdio is a bad plan." >&4 ;;
13830 echo "It seems we can't set ptr in your stdio. Nevermind." >&4
13836 : see if _base is also standard
13838 case "$d_stdstdio" in
13842 #$i_stdlib I_STDLIB
13844 #include <stdlib.h>
13846 #define FILE_base(fp) $stdio_base
13847 #define FILE_bufsiz(fp) $stdio_bufsiz
13849 FILE *fp = fopen("try.c", "r");
13852 19 <= FILE_bufsiz(fp) &&
13853 strncmp(FILE_base(fp), "#include <stdio.h>\n", 19) == 0
13860 if eval $compile && $to try.c; then
13861 if $run ./try; then
13862 echo "And its _base field acts std."
13865 echo "But its _base field isn't std."
13868 echo "However, it seems to be lacking the _base field."
13876 : see if fast_stdio exists
13878 case "$d_stdstdio:$d_stdio_ptr_lval" in
13880 case "$d_stdio_cnt_lval$d_stdio_ptr_lval_sets_cnt" in
13882 echo "You seem to have 'fast stdio' to directly manipulate the stdio buffers." >& 4
13893 : see if fchdir exists
13894 set fchdir d_fchdir
13897 : see if fchmod exists
13898 set fchmod d_fchmod
13901 : see if fchown exists
13902 set fchown d_fchown
13905 : see if this is an fcntl system
13909 : See if fcntl-based locking works.
13912 #$i_stdlib I_STDLIB
13914 #include <stdlib.h>
13916 #include <unistd.h>
13918 #include <signal.h>
13919 $signal_t blech(int x) { exit(3); }
13921 #if defined(F_SETLK) && defined(F_SETLKW)
13922 struct flock flock;
13924 fd = open("try.c", O_RDONLY);
13925 flock.l_type = F_RDLCK;
13926 flock.l_whence = SEEK_SET;
13927 flock.l_start = flock.l_len = 0;
13928 signal(SIGALRM, blech);
13930 retval = fcntl(fd, F_SETLK, &flock);
13932 (retval < 0 ? exit(2) : exit(0));
13938 echo "Checking if fcntl-based file locking works... "
13942 if eval $compile_ok; then
13943 if $run ./try; then
13944 echo "Yes, it seems to work."
13947 echo "Nope, it didn't work."
13952 *** I had to forcibly timeout from fcntl(..., F_SETLK, ...).
13953 *** This is (almost) impossible.
13954 *** If your NFS lock daemons are not feeling well, something like
13955 *** this may happen, please investigate. Cannot continue, aborting.
13963 echo "I'm unable to compile the test program, so I'll assume not."
13968 echo "Nope, since you don't even have fcntl()."
13971 set d_fcntl_can_lock
13975 : check for fd_set items
13978 Checking to see how well your C compiler handles fd_set and friends ...
13981 #$i_stdlib I_STDLIB
13983 #include <stdlib.h>
13985 #$i_systime I_SYS_TIME
13986 #$i_sysselct I_SYS_SELECT
13987 #$d_socket HAS_SOCKET
13988 #include <sys/types.h>
13990 #include <sys/socket.h> /* Might include <sys/bsdtypes.h> */
13993 #include <sys/time.h>
13995 #ifdef I_SYS_SELECT
13996 #include <sys/select.h>
14005 #if defined(FD_SET) && defined(FD_CLR) && defined(FD_ISSET) && defined(FD_ZERO)
14013 if eval $compile; then
14014 d_fds_bits="$define"
14016 echo "Well, your system knows about the normal fd_set typedef..." >&4
14017 if $run ./try; then
14018 echo "and you have the normal fd_set macros (just as I'd expect)." >&4
14019 d_fd_macros="$define"
14022 but not the normal fd_set macros! Gaaack! I'll have to cover for you.
14024 d_fd_macros="$undef"
14028 Hmm, your compiler has some difficulty with fd_set. Checking further...
14031 if eval $compile; then
14032 d_fds_bits="$undef"
14034 echo "Well, your system has some sort of fd_set available..." >&4
14035 if $run ./try; then
14036 echo "and you have the normal fd_set macros." >&4
14037 d_fd_macros="$define"
14040 but not the normal fd_set macros! Gross! More work for me...
14042 d_fd_macros="$undef"
14045 echo "Well, you got zip. That's OK, I can roll my own fd_set stuff." >&4
14047 d_fds_bits="$undef"
14048 d_fd_macros="$undef"
14053 : see if fdclose exists
14054 set fdclose d_fdclose
14057 : see if fdim exists
14061 : see if fegetround exists
14062 set fegetround d_fegetround
14065 : see if fgetpos exists
14066 set fgetpos d_fgetpos
14069 : see if finite exists
14070 set finite d_finite
14073 : see if finitel exists
14074 set finitel d_finitel
14077 : see if flock exists
14081 : see if prototype for flock is available
14083 set d_flockproto flock $i_sysfile sys/file.h
14086 : see if fma exists
14090 : see if fmax exists
14094 : see if fmin exists
14098 : see if fp_class exists
14099 set fp_class d_fp_class
14102 : see if this is a math.h system
14106 : check for fpclassify
14107 echo "Checking to see if you have fpclassify..." >&4
14113 int main() { return fpclassify(1.0) == FP_NORMAL ? 0 : 1; }
14116 if eval $compile; then
14118 echo "You have fpclassify."
14121 echo "You do not have fpclassify."
14127 : see if fp_classify exists
14128 set fp_classify d_fp_classify
14131 : see if fp_classl exists
14132 set fp_classl d_fp_classl
14135 : see if pathconf exists
14136 set pathconf d_pathconf
14139 : see if fpathconf exists
14140 set fpathconf d_fpathconf
14143 : see if fpclass exists
14144 set fpclass d_fpclass
14147 : see if fpclassl exists
14148 set fpclassl d_fpclassl
14151 : see if fpgetround exists
14152 set fpgetround d_fpgetround
14155 : check for fpos64_t
14157 echo "Checking to see if you have fpos64_t..." >&4
14160 int main() { fpos64_t x = 7; }
14163 if eval $compile; then
14165 echo "You have fpos64_t."
14168 echo "You do not have fpos64_t."
14169 case "$fpossize" in
14170 8) echo "(Your fpos_t is 64 bits, so you could use that.)" ;;
14177 : see if frexpl exists
14178 set frexpl d_frexpl
14181 : see if this is a sys/param system
14182 set sys/param.h i_sysparam
14185 : see if this is a sys/mount.h system
14186 set sys/mount.h i_sysmount
14189 : Check for fs_data_s
14191 echo "Checking to see if your system supports struct fs_data..." >&4
14192 set d_fs_data_s fs_data $i_systypes sys/types.h $i_sysparam sys/param.h $i_sysmount sys/mount.h
14194 case "$d_fs_data_s" in
14195 "$define") echo "Yes, it does." ;;
14196 *) echo "No, it doesn't." ;;
14199 : see if fseeko exists
14200 set fseeko d_fseeko
14202 case "$longsize" in
14203 8) echo "(Your long is 64 bits, so you could use fseek.)" ;;
14206 : see if fsetpos exists
14207 set fsetpos d_fsetpos
14210 : see if fstatfs exists
14211 set fstatfs d_fstatfs
14214 : see if statvfs exists
14215 set statvfs d_statvfs
14218 : see if fstatvfs exists
14219 set fstatvfs d_fstatvfs
14223 : see if fsync exists
14227 : see if ftello exists
14228 set ftello d_ftello
14230 case "$longsize" in
14231 8) echo "(Your long is 64 bits, so you could use ftell.)" ;;
14234 : check for a working futimes
14237 echo "Checking if you have a working futimes()" >&4
14240 #include <sys/time.h>
14247 fd = open ("try.c", O_RDWR);
14248 if (-1 == fd) exit (1);
14249 rv = futimes (fd, NULL);
14250 exit (rv == -1 ? errno : 0);
14254 if eval $compile; then
14258 0) echo "Yes, you have" >&4
14259 d_futimes="$define"
14261 *) echo "No, you have futimes, but it isn't working ($rc) (probably harmless)" >&4
14265 echo "No, it does not (probably harmless)" >&4
14269 : see if ndbm.h is available
14272 : Compatibility location for RedHat 7.1
14273 set gdbm/ndbm.h i_gdbmndbm
14275 : Compatibility location for Debian 4.0
14276 set gdbm-ndbm.h i_gdbm_ndbm
14280 if $test "$i_ndbm" = "$define" -o "$i_gdbmndbm" = "$define" -o "$i_gdbm_ndbm" = "$define"; then
14281 : see if dbm_open exists
14282 set dbm_open d_dbm_open
14284 case "$d_dbm_open" in
14287 i_gdbmndbm="$undef"
14288 i_gdbm_ndbm="$undef"
14289 echo "We won't be including <ndbm.h>"
14299 ndbm_hdr_protochk='name=$1; hdr=$2;
14300 eval "ihdr=\$""i_$name";
14302 if $test "$ihdr" = "$define"; then
14303 $echo "Checking if your <$hdr> uses prototypes..." >&4;
14304 case "$d_cplusplus" in
14305 $define) ./protochk "$extern_C void dbm_close(DBM *);" literal "extern \"C\" {" $ihdr $hdr literal "}" && val="$define" ;;
14306 *) ./protochk "$extern_C void dbm_close(int, int);" $ihdr $hdr || val="$define" ;;
14309 $define) $echo "Your <$hdr> seems to have prototypes";;
14310 *) $echo "Your <$hdr> does not seem to have prototypes";;
14313 set "d_${name}_h_uses_prototypes";
14317 eval $ndbm_hdr_protochk
14318 set gdbmndbm gdbm/ndbm.h
14319 eval $ndbm_hdr_protochk
14320 set gdbm_ndbm gdbm-ndbm.h
14321 eval $ndbm_hdr_protochk
14323 : see if getaddrinfo exists
14324 set getaddrinfo d_getaddrinfo
14327 : see if getcwd exists
14328 set getcwd d_getcwd
14331 : see if getespwnam exists
14332 set getespwnam d_getespwnam
14335 : see if getfsstat exists
14336 set getfsstat d_getfsstat
14339 : see if getgrent exists
14340 set getgrent d_getgrent
14343 : see if getgrent_r exists
14344 set getgrent_r d_getgrent_r
14346 case "$d_getgrent_r" in
14348 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
14349 case "$d_getgrent_r_proto:$usethreads" in
14350 ":define") d_getgrent_r_proto=define
14351 set d_getgrent_r_proto getgrent_r $hdrs
14355 case "$d_getgrent_r_proto" in
14357 case "$getgrent_r_proto" in
14358 ''|0) try='int getgrent_r(struct group*, char*, size_t, struct group**);'
14359 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=I_SBWR ;;
14361 case "$getgrent_r_proto" in
14362 ''|0) try='int getgrent_r(struct group*, char*, int, struct group**);'
14363 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=I_SBIR ;;
14365 case "$getgrent_r_proto" in
14366 ''|0) try='struct group* getgrent_r(struct group*, char*, size_t);'
14367 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=S_SBW ;;
14369 case "$getgrent_r_proto" in
14370 ''|0) try='struct group* getgrent_r(struct group*, char*, int);'
14371 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=S_SBI ;;
14373 case "$getgrent_r_proto" in
14374 ''|0) try='int getgrent_r(struct group*, char*, int);'
14375 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=I_SBI ;;
14377 case "$getgrent_r_proto" in
14378 ''|0) try='int getgrent_r(struct group*, char*, int, FILE**);'
14379 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=I_SBIH ;;
14381 case "$getgrent_r_proto" in
14382 ''|0) d_getgrent_r=undef
14384 echo "Disabling getgrent_r, cannot determine prototype." >&4 ;;
14385 * ) case "$getgrent_r_proto" in
14386 REENTRANT_PROTO*) ;;
14387 *) getgrent_r_proto="REENTRANT_PROTO_$getgrent_r_proto" ;;
14389 echo "Prototype: $try" ;;
14392 *) case "$usethreads" in
14393 define) echo "getgrent_r has no prototype, not using it." >&4 ;;
14400 *) getgrent_r_proto=0
14404 : see if getgrgid_r exists
14405 set getgrgid_r d_getgrgid_r
14407 case "$d_getgrgid_r" in
14409 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
14410 case "$d_getgrgid_r_proto:$usethreads" in
14411 ":define") d_getgrgid_r_proto=define
14412 set d_getgrgid_r_proto getgrgid_r $hdrs
14416 case "$d_getgrgid_r_proto" in
14418 case "$getgrgid_r_proto" in
14419 ''|0) try='int getgrgid_r(gid_t, struct group*, char*, size_t, struct group**);'
14420 ./protochk "$extern_C $try" $hdrs && getgrgid_r_proto=I_TSBWR ;;
14422 case "$getgrgid_r_proto" in
14423 ''|0) try='int getgrgid_r(gid_t, struct group*, char*, int, struct group**);'
14424 ./protochk "$extern_C $try" $hdrs && getgrgid_r_proto=I_TSBIR ;;
14426 case "$getgrgid_r_proto" in
14427 ''|0) try='int getgrgid_r(gid_t, struct group*, char*, int);'
14428 ./protochk "$extern_C $try" $hdrs && getgrgid_r_proto=I_TSBI ;;
14430 case "$getgrgid_r_proto" in
14431 ''|0) try='struct group* getgrgid_r(gid_t, struct group*, char*, int);'
14432 ./protochk "$extern_C $try" $hdrs && getgrgid_r_proto=S_TSBI ;;
14434 case "$getgrgid_r_proto" in
14435 ''|0) d_getgrgid_r=undef
14437 echo "Disabling getgrgid_r, cannot determine prototype." >&4 ;;
14438 * ) case "$getgrgid_r_proto" in
14439 REENTRANT_PROTO*) ;;
14440 *) getgrgid_r_proto="REENTRANT_PROTO_$getgrgid_r_proto" ;;
14442 echo "Prototype: $try" ;;
14445 *) case "$usethreads" in
14446 define) echo "getgrgid_r has no prototype, not using it." >&4 ;;
14453 *) getgrgid_r_proto=0
14457 : see if getgrnam_r exists
14458 set getgrnam_r d_getgrnam_r
14460 case "$d_getgrnam_r" in
14462 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
14463 case "$d_getgrnam_r_proto:$usethreads" in
14464 ":define") d_getgrnam_r_proto=define
14465 set d_getgrnam_r_proto getgrnam_r $hdrs
14469 case "$d_getgrnam_r_proto" in
14471 case "$getgrnam_r_proto" in
14472 ''|0) try='int getgrnam_r(const char*, struct group*, char*, size_t, struct group**);'
14473 ./protochk "$extern_C $try" $hdrs && getgrnam_r_proto=I_CSBWR ;;
14475 case "$getgrnam_r_proto" in
14476 ''|0) try='int getgrnam_r(const char*, struct group*, char*, int, struct group**);'
14477 ./protochk "$extern_C $try" $hdrs && getgrnam_r_proto=I_CSBIR ;;
14479 case "$getgrnam_r_proto" in
14480 ''|0) try='struct group* getgrnam_r(const char*, char*, int);'
14481 ./protochk "$extern_C $try" $hdrs && getgrnam_r_proto=S_CBI ;;
14483 case "$getgrnam_r_proto" in
14484 ''|0) try='int getgrnam_r(const char*, struct group*, char*, int);'
14485 ./protochk "$extern_C $try" $hdrs && getgrnam_r_proto=I_CSBI ;;
14487 case "$getgrnam_r_proto" in
14488 ''|0) try='struct group* getgrnam_r(const char*, struct group*, char*, int);'
14489 ./protochk "$extern_C $try" $hdrs && getgrnam_r_proto=S_CSBI ;;
14491 case "$getgrnam_r_proto" in
14492 ''|0) d_getgrnam_r=undef
14494 echo "Disabling getgrnam_r, cannot determine prototype." >&4 ;;
14495 * ) case "$getgrnam_r_proto" in
14496 REENTRANT_PROTO*) ;;
14497 *) getgrnam_r_proto="REENTRANT_PROTO_$getgrnam_r_proto" ;;
14499 echo "Prototype: $try" ;;
14502 *) case "$usethreads" in
14503 define) echo "getgrnam_r has no prototype, not using it." >&4 ;;
14510 *) getgrnam_r_proto=0
14514 : see if gethostbyaddr exists
14515 set gethostbyaddr d_gethbyaddr
14518 : see if gethostbyname exists
14519 set gethostbyname d_gethbyname
14522 : see if gethostent exists
14523 set gethostent d_gethent
14526 : see how we will look up host name
14529 if set gethostname val -f d_gethname; eval $csym; $val; then
14530 echo 'gethostname() found.' >&4
14531 d_gethname="$define"
14534 if set uname val -f d_uname; eval $csym; $val; then
14537 uname() was found, but you're running xenix, and older versions of xenix
14538 have a broken uname(). If you don't really know whether your xenix is old
14539 enough to have a broken system call, use the default answer.
14544 "$define") dflt=n;;
14546 rp='Is your uname() broken?'
14549 n*) d_uname="$define"; call=uname;;
14552 echo 'uname() found.' >&4
14559 case "$d_gethname" in
14560 '') d_gethname="$undef";;
14563 '') d_uname="$undef";;
14565 case "$d_uname$d_gethname" in
14570 Every now and then someone has a $call() that lies about the hostname
14571 but can't be fixed for political or economic reasons. If you wish, I can
14572 pretend $call() isn't there and maybe compute hostname at run-time
14573 thanks to the '$phostname' command.
14576 rp="Shall I ignore $call() from now on?"
14579 y*) d_uname="$undef" d_gethname="$undef"; $echo $n "Okay...$c";;
14582 case "$phostname" in
14583 '') aphostname='';;
14584 *) case "$aphostname" in
14586 *) set X $phostname
14590 file=`./loc $file $file $pth`
14591 aphostname=`echo $file $*`
14596 case "$d_uname$d_gethname" in
14599 case "$phostname" in
14601 echo "There will be no way for $package to get your hostname." >&4;;
14603 echo "I'll use 'popen("'"'$aphostname'", "r")'"' to get your hostname." >&4
14607 case "$d_phostname" in
14608 '') d_phostname="$undef";;
14611 : see if gethostbyaddr_r exists
14612 set gethostbyaddr_r d_gethostbyaddr_r
14614 case "$d_gethostbyaddr_r" in
14616 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14617 case "$d_gethostbyaddr_r_proto:$usethreads" in
14618 ":define") d_gethostbyaddr_r_proto=define
14619 set d_gethostbyaddr_r_proto gethostbyaddr_r $hdrs
14623 case "$d_gethostbyaddr_r_proto" in
14625 case "$gethostbyaddr_r_proto" in
14626 ''|0) try='int gethostbyaddr_r(const char*, size_t, int, struct hostent*, char*, size_t, struct hostent**, int*);'
14627 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=I_CWISBWRE ;;
14629 case "$gethostbyaddr_r_proto" in
14630 ''|0) try='struct hostent* gethostbyaddr_r(const char*, size_t, int, struct hostent*, char*, size_t, int, int*);'
14631 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_CWISBWIE ;;
14633 case "$gethostbyaddr_r_proto" in
14634 ''|0) try='struct hostent* gethostbyaddr_r(const char*, size_t, int, struct hostent*, char*, int, int*);'
14635 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_CWISBIE ;;
14637 case "$gethostbyaddr_r_proto" in
14638 ''|0) try='struct hostent* gethostbyaddr_r(const void*, size_t, int, struct hostent*, char*, int, int*);'
14639 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_TWISBIE ;;
14641 case "$gethostbyaddr_r_proto" in
14642 ''|0) try='struct hostent* gethostbyaddr_r(const char*, int, int, struct hostent*, char*, int, int*);'
14643 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_CIISBIE ;;
14645 case "$gethostbyaddr_r_proto" in
14646 ''|0) try='struct hostent* gethostbyaddr_r(const char*, struct hostent*, char*, int, int*);'
14647 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_CSBIE ;;
14649 case "$gethostbyaddr_r_proto" in
14650 ''|0) try='struct hostent* gethostbyaddr_r(const void*, struct hostent*, char*, int, int*);'
14651 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_TSBIE ;;
14653 case "$gethostbyaddr_r_proto" in
14654 ''|0) try='int gethostbyaddr_r(const char*, size_t, int, struct hostent*, struct hostent_data*);'
14655 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=I_CWISD ;;
14657 case "$gethostbyaddr_r_proto" in
14658 ''|0) try='int gethostbyaddr_r(const char*, int, int, struct hostent*, struct hostent_data*);'
14659 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=I_CIISD ;;
14661 case "$gethostbyaddr_r_proto" in
14662 ''|0) try='int gethostbyaddr_r(const char*, int, int);'
14663 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=I_CII ;;
14665 case "$gethostbyaddr_r_proto" in
14666 ''|0) try='int gethostbyaddr_r(const void*, socklen_t, int, struct hostent*, char*, size_t, struct hostent**, int*);'
14667 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=I_TsISBWRE ;;
14669 case "$gethostbyaddr_r_proto" in
14670 ''|0) d_gethostbyaddr_r=undef
14671 gethostbyaddr_r_proto=0
14672 echo "Disabling gethostbyaddr_r, cannot determine prototype." >&4 ;;
14673 * ) case "$gethostbyaddr_r_proto" in
14674 REENTRANT_PROTO*) ;;
14675 *) gethostbyaddr_r_proto="REENTRANT_PROTO_$gethostbyaddr_r_proto" ;;
14677 echo "Prototype: $try" ;;
14680 *) case "$usethreads" in
14681 define) echo "gethostbyaddr_r has no prototype, not using it." >&4 ;;
14683 d_gethostbyaddr_r=undef
14684 gethostbyaddr_r_proto=0
14688 *) gethostbyaddr_r_proto=0
14692 : see if gethostbyname_r exists
14693 set gethostbyname_r d_gethostbyname_r
14695 case "$d_gethostbyname_r" in
14697 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14698 case "$d_gethostbyname_r_proto:$usethreads" in
14699 ":define") d_gethostbyname_r_proto=define
14700 set d_gethostbyname_r_proto gethostbyname_r $hdrs
14704 case "$d_gethostbyname_r_proto" in
14706 case "$gethostbyname_r_proto" in
14707 ''|0) try='int gethostbyname_r(const char*, struct hostent*, char*, size_t, struct hostent**, int*);'
14708 ./protochk "$extern_C $try" $hdrs && gethostbyname_r_proto=I_CSBWRE ;;
14710 case "$gethostbyname_r_proto" in
14711 ''|0) try='struct hostent* gethostbyname_r(const char*, struct hostent*, char*, int, int*);'
14712 ./protochk "$extern_C $try" $hdrs && gethostbyname_r_proto=S_CSBIE ;;
14714 case "$gethostbyname_r_proto" in
14715 ''|0) try='int gethostbyname_r(const char*, struct hostent*, struct hostent_data*);'
14716 ./protochk "$extern_C $try" $hdrs && gethostbyname_r_proto=I_CSD ;;
14718 case "$gethostbyname_r_proto" in
14719 ''|0) d_gethostbyname_r=undef
14720 gethostbyname_r_proto=0
14721 echo "Disabling gethostbyname_r, cannot determine prototype." >&4 ;;
14722 * ) case "$gethostbyname_r_proto" in
14723 REENTRANT_PROTO*) ;;
14724 *) gethostbyname_r_proto="REENTRANT_PROTO_$gethostbyname_r_proto" ;;
14726 echo "Prototype: $try" ;;
14729 *) case "$usethreads" in
14730 define) echo "gethostbyname_r has no prototype, not using it." >&4 ;;
14732 d_gethostbyname_r=undef
14733 gethostbyname_r_proto=0
14737 *) gethostbyname_r_proto=0
14741 : see if gethostent_r exists
14742 set gethostent_r d_gethostent_r
14744 case "$d_gethostent_r" in
14746 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14747 case "$d_gethostent_r_proto:$usethreads" in
14748 ":define") d_gethostent_r_proto=define
14749 set d_gethostent_r_proto gethostent_r $hdrs
14753 case "$d_gethostent_r_proto" in
14755 case "$gethostent_r_proto" in
14756 ''|0) try='int gethostent_r(struct hostent*, char*, size_t, struct hostent**, int*);'
14757 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=I_SBWRE ;;
14759 case "$gethostent_r_proto" in
14760 ''|0) try='int gethostent_r(struct hostent*, char*, int, int*);'
14761 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=I_SBIE ;;
14763 case "$gethostent_r_proto" in
14764 ''|0) try='struct hostent* gethostent_r(struct hostent*, char*, int, int*);'
14765 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=S_SBIE ;;
14767 case "$gethostent_r_proto" in
14768 ''|0) try='struct hostent* gethostent_r(struct hostent*, char*, int);'
14769 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=S_SBI ;;
14771 case "$gethostent_r_proto" in
14772 ''|0) try='int gethostent_r(struct hostent*, char*, int);'
14773 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=I_SBI ;;
14775 case "$gethostent_r_proto" in
14776 ''|0) try='int gethostent_r(struct hostent*, struct hostent_data*);'
14777 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=I_SD ;;
14779 case "$gethostent_r_proto" in
14780 ''|0) d_gethostent_r=undef
14781 gethostent_r_proto=0
14782 echo "Disabling gethostent_r, cannot determine prototype." >&4 ;;
14783 * ) case "$gethostent_r_proto" in
14784 REENTRANT_PROTO*) ;;
14785 *) gethostent_r_proto="REENTRANT_PROTO_$gethostent_r_proto" ;;
14787 echo "Prototype: $try" ;;
14790 *) case "$usethreads" in
14791 define) echo "gethostent_r has no prototype, not using it." >&4 ;;
14793 d_gethostent_r=undef
14794 gethostent_r_proto=0
14798 *) gethostent_r_proto=0
14802 : see if prototypes for various gethostxxx netdb.h functions are available
14804 set d_gethostprotos gethostent $i_netdb netdb.h
14807 : see if getitimer exists
14808 set getitimer d_getitimer
14811 : see if getlogin exists
14812 set getlogin d_getlogin
14815 : see if getlogin_r exists
14816 set getlogin_r d_getlogin_r
14818 case "$d_getlogin_r" in
14820 hdrs="$i_systypes sys/types.h define stdio.h $i_unistd unistd.h"
14821 case "$d_getlogin_r_proto:$usethreads" in
14822 ":define") d_getlogin_r_proto=define
14823 set d_getlogin_r_proto getlogin_r $hdrs
14827 case "$d_getlogin_r_proto" in
14829 case "$getlogin_r_proto" in
14830 ''|0) try='int getlogin_r(char*, size_t);'
14831 ./protochk "$extern_C $try" $hdrs && getlogin_r_proto=I_BW ;;
14833 case "$getlogin_r_proto" in
14834 ''|0) try='int getlogin_r(char*, int);'
14835 ./protochk "$extern_C $try" $hdrs && getlogin_r_proto=I_BI ;;
14837 case "$getlogin_r_proto" in
14838 ''|0) try='char* getlogin_r(char*, size_t);'
14839 ./protochk "$extern_C $try" $hdrs && getlogin_r_proto=B_BW ;;
14841 case "$getlogin_r_proto" in
14842 ''|0) try='char* getlogin_r(char*, int);'
14843 ./protochk "$extern_C $try" $hdrs && getlogin_r_proto=B_BI ;;
14845 case "$getlogin_r_proto" in
14846 ''|0) d_getlogin_r=undef
14848 echo "Disabling getlogin_r, cannot determine prototype." >&4 ;;
14849 * ) case "$getlogin_r_proto" in
14850 REENTRANT_PROTO*) ;;
14851 *) getlogin_r_proto="REENTRANT_PROTO_$getlogin_r_proto" ;;
14853 echo "Prototype: $try" ;;
14856 *) case "$usethreads" in
14857 define) echo "getlogin_r has no prototype, not using it." >&4 ;;
14864 *) getlogin_r_proto=0
14868 : see if getmnt exists
14869 set getmnt d_getmnt
14872 : see if getmntent exists
14873 set getmntent d_getmntent
14876 : see if getnameinfo exists
14877 set getnameinfo d_getnameinfo
14880 : see if getnetbyaddr exists
14881 set getnetbyaddr d_getnbyaddr
14884 : see if getnetbyname exists
14885 set getnetbyname d_getnbyname
14888 : see if getnetent exists
14889 set getnetent d_getnent
14892 : see if getnetbyaddr_r exists
14893 set getnetbyaddr_r d_getnetbyaddr_r
14895 case "$d_getnetbyaddr_r" in
14897 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14898 case "$d_getnetbyaddr_r_proto:$usethreads" in
14899 ":define") d_getnetbyaddr_r_proto=define
14900 set d_getnetbyaddr_r_proto getnetbyaddr_r $hdrs
14904 case "$d_getnetbyaddr_r_proto" in
14906 case "$getnetbyaddr_r_proto" in
14907 ''|0) try='int getnetbyaddr_r(unsigned long, int, struct netent*, char*, size_t, struct netent**, int*);'
14908 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_UISBWRE ;;
14910 case "$getnetbyaddr_r_proto" in
14911 ''|0) try='int getnetbyaddr_r(long, int, struct netent*, char*, int);'
14912 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_LISBI ;;
14914 case "$getnetbyaddr_r_proto" in
14915 ''|0) try='struct netent* getnetbyaddr_r(in_addr_t, int, struct netent*, char*, int);'
14916 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=S_TISBI ;;
14918 case "$getnetbyaddr_r_proto" in
14919 ''|0) try='struct netent* getnetbyaddr_r(long, int, struct netent*, char*, int);'
14920 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=S_LISBI ;;
14922 case "$getnetbyaddr_r_proto" in
14923 ''|0) try='int getnetbyaddr_r(in_addr_t, int, struct netent*, struct netent_data*);'
14924 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_TISD ;;
14926 case "$getnetbyaddr_r_proto" in
14927 ''|0) try='int getnetbyaddr_r(long, int, struct netent*, struct netent_data*);'
14928 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_LISD ;;
14930 case "$getnetbyaddr_r_proto" in
14931 ''|0) try='int getnetbyaddr_r(int, int, struct netent*, struct netent_data*);'
14932 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_IISD ;;
14934 case "$getnetbyaddr_r_proto" in
14935 ''|0) try='int getnetbyaddr_r(uint32_t, int, struct netent*, char*, size_t, struct netent**, int*);'
14936 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_uISBWRE ;;
14938 case "$getnetbyaddr_r_proto" in
14939 ''|0) d_getnetbyaddr_r=undef
14940 getnetbyaddr_r_proto=0
14941 echo "Disabling getnetbyaddr_r, cannot determine prototype." >&4 ;;
14942 * ) case "$getnetbyaddr_r_proto" in
14943 REENTRANT_PROTO*) ;;
14944 *) getnetbyaddr_r_proto="REENTRANT_PROTO_$getnetbyaddr_r_proto" ;;
14946 echo "Prototype: $try" ;;
14949 *) case "$usethreads" in
14950 define) echo "getnetbyaddr_r has no prototype, not using it." >&4 ;;
14952 d_getnetbyaddr_r=undef
14953 getnetbyaddr_r_proto=0
14957 *) getnetbyaddr_r_proto=0
14961 : see if getnetbyname_r exists
14962 set getnetbyname_r d_getnetbyname_r
14964 case "$d_getnetbyname_r" in
14966 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14967 case "$d_getnetbyname_r_proto:$usethreads" in
14968 ":define") d_getnetbyname_r_proto=define
14969 set d_getnetbyname_r_proto getnetbyname_r $hdrs
14973 case "$d_getnetbyname_r_proto" in
14975 case "$getnetbyname_r_proto" in
14976 ''|0) try='int getnetbyname_r(const char*, struct netent*, char*, size_t, struct netent**, int*);'
14977 ./protochk "$extern_C $try" $hdrs && getnetbyname_r_proto=I_CSBWRE ;;
14979 case "$getnetbyname_r_proto" in
14980 ''|0) try='int getnetbyname_r(const char*, struct netent*, char*, int);'
14981 ./protochk "$extern_C $try" $hdrs && getnetbyname_r_proto=I_CSBI ;;
14983 case "$getnetbyname_r_proto" in
14984 ''|0) try='struct netent* getnetbyname_r(const char*, struct netent*, char*, int);'
14985 ./protochk "$extern_C $try" $hdrs && getnetbyname_r_proto=S_CSBI ;;
14987 case "$getnetbyname_r_proto" in
14988 ''|0) try='int getnetbyname_r(const char*, struct netent*, struct netent_data*);'
14989 ./protochk "$extern_C $try" $hdrs && getnetbyname_r_proto=I_CSD ;;
14991 case "$getnetbyname_r_proto" in
14992 ''|0) d_getnetbyname_r=undef
14993 getnetbyname_r_proto=0
14994 echo "Disabling getnetbyname_r, cannot determine prototype." >&4 ;;
14995 * ) case "$getnetbyname_r_proto" in
14996 REENTRANT_PROTO*) ;;
14997 *) getnetbyname_r_proto="REENTRANT_PROTO_$getnetbyname_r_proto" ;;
14999 echo "Prototype: $try" ;;
15002 *) case "$usethreads" in
15003 define) echo "getnetbyname_r has no prototype, not using it." >&4 ;;
15005 d_getnetbyname_r=undef
15006 getnetbyname_r_proto=0
15010 *) getnetbyname_r_proto=0
15014 : see if getnetent_r exists
15015 set getnetent_r d_getnetent_r
15017 case "$d_getnetent_r" in
15019 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
15020 case "$d_getnetent_r_proto:$usethreads" in
15021 ":define") d_getnetent_r_proto=define
15022 set d_getnetent_r_proto getnetent_r $hdrs
15026 case "$d_getnetent_r_proto" in
15028 case "$getnetent_r_proto" in
15029 ''|0) try='int getnetent_r(struct netent*, char*, size_t, struct netent**, int*);'
15030 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=I_SBWRE ;;
15032 case "$getnetent_r_proto" in
15033 ''|0) try='int getnetent_r(struct netent*, char*, int, int*);'
15034 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=I_SBIE ;;
15036 case "$getnetent_r_proto" in
15037 ''|0) try='struct netent* getnetent_r(struct netent*, char*, int, int*);'
15038 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=S_SBIE ;;
15040 case "$getnetent_r_proto" in
15041 ''|0) try='struct netent* getnetent_r(struct netent*, char*, int);'
15042 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=S_SBI ;;
15044 case "$getnetent_r_proto" in
15045 ''|0) try='int getnetent_r(struct netent*, char*, int);'
15046 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=I_SBI ;;
15048 case "$getnetent_r_proto" in
15049 ''|0) try='int getnetent_r(struct netent*, struct netent_data*);'
15050 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=I_SD ;;
15052 case "$getnetent_r_proto" in
15053 ''|0) d_getnetent_r=undef
15054 getnetent_r_proto=0
15055 echo "Disabling getnetent_r, cannot determine prototype." >&4 ;;
15056 * ) case "$getnetent_r_proto" in
15057 REENTRANT_PROTO*) ;;
15058 *) getnetent_r_proto="REENTRANT_PROTO_$getnetent_r_proto" ;;
15060 echo "Prototype: $try" ;;
15063 *) case "$usethreads" in
15064 define) echo "getnetent_r has no prototype, not using it." >&4 ;;
15066 d_getnetent_r=undef
15067 getnetent_r_proto=0
15071 *) getnetent_r_proto=0
15075 : see if prototypes for various getnetxxx netdb.h functions are available
15077 set d_getnetprotos getnetent $i_netdb netdb.h
15080 : see if getpagesize exists
15081 set getpagesize d_getpagsz
15084 : Optional checks for getprotobyname and getprotobynumber
15086 : see if getprotobyname exists
15087 set getprotobyname d_getpbyname
15090 : see if getprotobynumber exists
15091 set getprotobynumber d_getpbynumber
15094 : see if getprotoent exists
15095 set getprotoent d_getpent
15098 : see if getpgid exists
15099 set getpgid d_getpgid
15102 : see if getpgrp2 exists
15103 set getpgrp2 d_getpgrp2
15106 : see if getppid exists
15107 set getppid d_getppid
15110 : see if getpriority exists
15111 set getpriority d_getprior
15114 : see if getprotobyname_r exists
15115 set getprotobyname_r d_getprotobyname_r
15117 case "$d_getprotobyname_r" in
15119 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
15120 case "$d_getprotobyname_r_proto:$usethreads" in
15121 ":define") d_getprotobyname_r_proto=define
15122 set d_getprotobyname_r_proto getprotobyname_r $hdrs
15126 case "$d_getprotobyname_r_proto" in
15128 case "$getprotobyname_r_proto" in
15129 ''|0) try='int getprotobyname_r(const char*, struct protoent*, char*, size_t, struct protoent**);'
15130 ./protochk "$extern_C $try" $hdrs && getprotobyname_r_proto=I_CSBWR ;;
15132 case "$getprotobyname_r_proto" in
15133 ''|0) try='struct protoent* getprotobyname_r(const char*, struct protoent*, char*, int);'
15134 ./protochk "$extern_C $try" $hdrs && getprotobyname_r_proto=S_CSBI ;;
15136 case "$getprotobyname_r_proto" in
15137 ''|0) try='int getprotobyname_r(const char*, struct protoent*, struct protoent_data*);'
15138 ./protochk "$extern_C $try" $hdrs && getprotobyname_r_proto=I_CSD ;;
15140 case "$getprotobyname_r_proto" in
15141 ''|0) d_getprotobyname_r=undef
15142 getprotobyname_r_proto=0
15143 echo "Disabling getprotobyname_r, cannot determine prototype." >&4 ;;
15144 * ) case "$getprotobyname_r_proto" in
15145 REENTRANT_PROTO*) ;;
15146 *) getprotobyname_r_proto="REENTRANT_PROTO_$getprotobyname_r_proto" ;;
15148 echo "Prototype: $try" ;;
15151 *) case "$usethreads" in
15152 define) echo "getprotobyname_r has no prototype, not using it." >&4 ;;
15154 d_getprotobyname_r=undef
15155 getprotobyname_r_proto=0
15159 *) getprotobyname_r_proto=0
15163 : see if getprotobynumber_r exists
15164 set getprotobynumber_r d_getprotobynumber_r
15166 case "$d_getprotobynumber_r" in
15168 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
15169 case "$d_getprotobynumber_r_proto:$usethreads" in
15170 ":define") d_getprotobynumber_r_proto=define
15171 set d_getprotobynumber_r_proto getprotobynumber_r $hdrs
15175 case "$d_getprotobynumber_r_proto" in
15177 case "$getprotobynumber_r_proto" in
15178 ''|0) try='int getprotobynumber_r(int, struct protoent*, char*, size_t, struct protoent**);'
15179 ./protochk "$extern_C $try" $hdrs && getprotobynumber_r_proto=I_ISBWR ;;
15181 case "$getprotobynumber_r_proto" in
15182 ''|0) try='struct protoent* getprotobynumber_r(int, struct protoent*, char*, int);'
15183 ./protochk "$extern_C $try" $hdrs && getprotobynumber_r_proto=S_ISBI ;;
15185 case "$getprotobynumber_r_proto" in
15186 ''|0) try='int getprotobynumber_r(int, struct protoent*, struct protoent_data*);'
15187 ./protochk "$extern_C $try" $hdrs && getprotobynumber_r_proto=I_ISD ;;
15189 case "$getprotobynumber_r_proto" in
15190 ''|0) d_getprotobynumber_r=undef
15191 getprotobynumber_r_proto=0
15192 echo "Disabling getprotobynumber_r, cannot determine prototype." >&4 ;;
15193 * ) case "$getprotobynumber_r_proto" in
15194 REENTRANT_PROTO*) ;;
15195 *) getprotobynumber_r_proto="REENTRANT_PROTO_$getprotobynumber_r_proto" ;;
15197 echo "Prototype: $try" ;;
15200 *) case "$usethreads" in
15201 define) echo "getprotobynumber_r has no prototype, not using it." >&4 ;;
15203 d_getprotobynumber_r=undef
15204 getprotobynumber_r_proto=0
15208 *) getprotobynumber_r_proto=0
15212 : see if getprotoent_r exists
15213 set getprotoent_r d_getprotoent_r
15215 case "$d_getprotoent_r" in
15217 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
15218 case "$d_getprotoent_r_proto:$usethreads" in
15219 ":define") d_getprotoent_r_proto=define
15220 set d_getprotoent_r_proto getprotoent_r $hdrs
15224 case "$d_getprotoent_r_proto" in
15226 case "$getprotoent_r_proto" in
15227 ''|0) try='int getprotoent_r(struct protoent*, char*, size_t, struct protoent**);'
15228 ./protochk "$extern_C $try" $hdrs && getprotoent_r_proto=I_SBWR ;;
15230 case "$getprotoent_r_proto" in
15231 ''|0) try='int getprotoent_r(struct protoent*, char*, int);'
15232 ./protochk "$extern_C $try" $hdrs && getprotoent_r_proto=I_SBI ;;
15234 case "$getprotoent_r_proto" in
15235 ''|0) try='struct protoent* getprotoent_r(struct protoent*, char*, int);'
15236 ./protochk "$extern_C $try" $hdrs && getprotoent_r_proto=S_SBI ;;
15238 case "$getprotoent_r_proto" in
15239 ''|0) try='int getprotoent_r(struct protoent*, struct protoent_data*);'
15240 ./protochk "$extern_C $try" $hdrs && getprotoent_r_proto=I_SD ;;
15242 case "$getprotoent_r_proto" in
15243 ''|0) d_getprotoent_r=undef
15244 getprotoent_r_proto=0
15245 echo "Disabling getprotoent_r, cannot determine prototype." >&4 ;;
15246 * ) case "$getprotoent_r_proto" in
15247 REENTRANT_PROTO*) ;;
15248 *) getprotoent_r_proto="REENTRANT_PROTO_$getprotoent_r_proto" ;;
15250 echo "Prototype: $try" ;;
15253 *) case "$usethreads" in
15254 define) echo "getprotoent_r has no prototype, not using it." >&4 ;;
15256 d_getprotoent_r=undef
15257 getprotoent_r_proto=0
15261 *) getprotoent_r_proto=0
15265 : see if prototypes for various getprotoxxx netdb.h functions are available
15267 set d_getprotoprotos getprotoent $i_netdb netdb.h
15270 : see if getprpwnam exists
15271 set getprpwnam d_getprpwnam
15274 : see if getpwent exists
15275 set getpwent d_getpwent
15278 : see if getpwent_r exists
15279 set getpwent_r d_getpwent_r
15281 case "$d_getpwent_r" in
15283 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
15284 case "$d_getpwent_r_proto:$usethreads" in
15285 ":define") d_getpwent_r_proto=define
15286 set d_getpwent_r_proto getpwent_r $hdrs
15290 case "$d_getpwent_r_proto" in
15292 case "$getpwent_r_proto" in
15293 ''|0) try='int getpwent_r(struct passwd*, char*, size_t, struct passwd**);'
15294 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=I_SBWR ;;
15296 case "$getpwent_r_proto" in
15297 ''|0) try='int getpwent_r(struct passwd*, char*, int, struct passwd**);'
15298 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=I_SBIR ;;
15300 case "$getpwent_r_proto" in
15301 ''|0) try='struct passwd* getpwent_r(struct passwd*, char*, size_t);'
15302 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=S_SBW ;;
15304 case "$getpwent_r_proto" in
15305 ''|0) try='struct passwd* getpwent_r(struct passwd*, char*, int);'
15306 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=S_SBI ;;
15308 case "$getpwent_r_proto" in
15309 ''|0) try='int getpwent_r(struct passwd*, char*, int);'
15310 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=I_SBI ;;
15312 case "$getpwent_r_proto" in
15313 ''|0) try='int getpwent_r(struct passwd*, char*, int, FILE**);'
15314 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=I_SBIH ;;
15316 case "$getpwent_r_proto" in
15317 ''|0) d_getpwent_r=undef
15319 echo "Disabling getpwent_r, cannot determine prototype." >&4 ;;
15320 * ) case "$getpwent_r_proto" in
15321 REENTRANT_PROTO*) ;;
15322 *) getpwent_r_proto="REENTRANT_PROTO_$getpwent_r_proto" ;;
15324 echo "Prototype: $try" ;;
15327 *) case "$usethreads" in
15328 define) echo "getpwent_r has no prototype, not using it." >&4 ;;
15335 *) getpwent_r_proto=0
15339 : see if getpwnam_r exists
15340 set getpwnam_r d_getpwnam_r
15342 case "$d_getpwnam_r" in
15344 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
15345 case "$d_getpwnam_r_proto:$usethreads" in
15346 ":define") d_getpwnam_r_proto=define
15347 set d_getpwnam_r_proto getpwnam_r $hdrs
15351 case "$d_getpwnam_r_proto" in
15353 case "$getpwnam_r_proto" in
15354 ''|0) try='int getpwnam_r(const char*, struct passwd*, char*, size_t, struct passwd**);'
15355 ./protochk "$extern_C $try" $hdrs && getpwnam_r_proto=I_CSBWR ;;
15357 case "$getpwnam_r_proto" in
15358 ''|0) try='int getpwnam_r(const char*, struct passwd*, char*, int, struct passwd**);'
15359 ./protochk "$extern_C $try" $hdrs && getpwnam_r_proto=I_CSBIR ;;
15361 case "$getpwnam_r_proto" in
15362 ''|0) try='struct passwd* getpwnam_r(const char*, struct passwd*, char*, int);'
15363 ./protochk "$extern_C $try" $hdrs && getpwnam_r_proto=S_CSBI ;;
15365 case "$getpwnam_r_proto" in
15366 ''|0) try='int getpwnam_r(const char*, struct passwd*, char*, int);'
15367 ./protochk "$extern_C $try" $hdrs && getpwnam_r_proto=I_CSBI ;;
15369 case "$getpwnam_r_proto" in
15370 ''|0) d_getpwnam_r=undef
15372 echo "Disabling getpwnam_r, cannot determine prototype." >&4 ;;
15373 * ) case "$getpwnam_r_proto" in
15374 REENTRANT_PROTO*) ;;
15375 *) getpwnam_r_proto="REENTRANT_PROTO_$getpwnam_r_proto" ;;
15377 echo "Prototype: $try" ;;
15380 *) case "$usethreads" in
15381 define) echo "getpwnam_r has no prototype, not using it." >&4 ;;
15388 *) getpwnam_r_proto=0
15392 : see if getpwuid_r exists
15393 set getpwuid_r d_getpwuid_r
15395 case "$d_getpwuid_r" in
15397 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
15398 case "$d_getpwuid_r_proto:$usethreads" in
15399 ":define") d_getpwuid_r_proto=define
15400 set d_getpwuid_r_proto getpwuid_r $hdrs
15404 case "$d_getpwuid_r_proto" in
15406 case "$getpwuid_r_proto" in
15407 ''|0) try='int getpwuid_r(uid_t, struct passwd*, char*, size_t, struct passwd**);'
15408 ./protochk "$extern_C $try" $hdrs && getpwuid_r_proto=I_TSBWR ;;
15410 case "$getpwuid_r_proto" in
15411 ''|0) try='int getpwuid_r(uid_t, struct passwd*, char*, int, struct passwd**);'
15412 ./protochk "$extern_C $try" $hdrs && getpwuid_r_proto=I_TSBIR ;;
15414 case "$getpwuid_r_proto" in
15415 ''|0) try='int getpwuid_r(uid_t, struct passwd*, char*, int);'
15416 ./protochk "$extern_C $try" $hdrs && getpwuid_r_proto=I_TSBI ;;
15418 case "$getpwuid_r_proto" in
15419 ''|0) try='struct passwd* getpwuid_r(uid_t, struct passwd*, char*, int);'
15420 ./protochk "$extern_C $try" $hdrs && getpwuid_r_proto=S_TSBI ;;
15422 case "$getpwuid_r_proto" in
15423 ''|0) d_getpwuid_r=undef
15425 echo "Disabling getpwuid_r, cannot determine prototype." >&4 ;;
15426 * ) case "$getpwuid_r_proto" in
15427 REENTRANT_PROTO*) ;;
15428 *) getpwuid_r_proto="REENTRANT_PROTO_$getpwuid_r_proto" ;;
15430 echo "Prototype: $try" ;;
15433 *) case "$usethreads" in
15434 define) echo "getpwuid_r has no prototype, not using it." >&4 ;;
15441 *) getpwuid_r_proto=0
15445 : Optional checks for getsbyname and getsbyport
15447 : see if getservbyname exists
15448 set getservbyname d_getsbyname
15451 : see if getservbyport exists
15452 set getservbyport d_getsbyport
15455 : see if getservent exists
15456 set getservent d_getsent
15459 : see if getservbyname_r exists
15460 set getservbyname_r d_getservbyname_r
15462 case "$d_getservbyname_r" in
15464 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
15465 case "$d_getservbyname_r_proto:$usethreads" in
15466 ":define") d_getservbyname_r_proto=define
15467 set d_getservbyname_r_proto getservbyname_r $hdrs
15471 case "$d_getservbyname_r_proto" in
15473 case "$getservbyname_r_proto" in
15474 ''|0) try='int getservbyname_r(const char*, const char*, struct servent*, char*, size_t, struct servent**);'
15475 ./protochk "$extern_C $try" $hdrs && getservbyname_r_proto=I_CCSBWR ;;
15477 case "$getservbyname_r_proto" in
15478 ''|0) try='struct servent* getservbyname_r(const char*, const char*, struct servent*, char*, int);'
15479 ./protochk "$extern_C $try" $hdrs && getservbyname_r_proto=S_CCSBI ;;
15481 case "$getservbyname_r_proto" in
15482 ''|0) try='int getservbyname_r(const char*, const char*, struct servent*, struct servent_data*);'
15483 ./protochk "$extern_C $try" $hdrs && getservbyname_r_proto=I_CCSD ;;
15485 case "$getservbyname_r_proto" in
15486 ''|0) d_getservbyname_r=undef
15487 getservbyname_r_proto=0
15488 echo "Disabling getservbyname_r, cannot determine prototype." >&4 ;;
15489 * ) case "$getservbyname_r_proto" in
15490 REENTRANT_PROTO*) ;;
15491 *) getservbyname_r_proto="REENTRANT_PROTO_$getservbyname_r_proto" ;;
15493 echo "Prototype: $try" ;;
15496 *) case "$usethreads" in
15497 define) echo "getservbyname_r has no prototype, not using it." >&4 ;;
15499 d_getservbyname_r=undef
15500 getservbyname_r_proto=0
15504 *) getservbyname_r_proto=0
15508 : see if getservbyport_r exists
15509 set getservbyport_r d_getservbyport_r
15511 case "$d_getservbyport_r" in
15513 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
15514 case "$d_getservbyport_r_proto:$usethreads" in
15515 ":define") d_getservbyport_r_proto=define
15516 set d_getservbyport_r_proto getservbyport_r $hdrs
15520 case "$d_getservbyport_r_proto" in
15522 case "$getservbyport_r_proto" in
15523 ''|0) try='int getservbyport_r(int, const char*, struct servent*, char*, size_t, struct servent**);'
15524 ./protochk "$extern_C $try" $hdrs && getservbyport_r_proto=I_ICSBWR ;;
15526 case "$getservbyport_r_proto" in
15527 ''|0) try='struct servent* getservbyport_r(int, const char*, struct servent*, char*, int);'
15528 ./protochk "$extern_C $try" $hdrs && getservbyport_r_proto=S_ICSBI ;;
15530 case "$getservbyport_r_proto" in
15531 ''|0) try='int getservbyport_r(int, const char*, struct servent*, struct servent_data*);'
15532 ./protochk "$extern_C $try" $hdrs && getservbyport_r_proto=I_ICSD ;;
15534 case "$getservbyport_r_proto" in
15535 ''|0) d_getservbyport_r=undef
15536 getservbyport_r_proto=0
15537 echo "Disabling getservbyport_r, cannot determine prototype." >&4 ;;
15538 * ) case "$getservbyport_r_proto" in
15539 REENTRANT_PROTO*) ;;
15540 *) getservbyport_r_proto="REENTRANT_PROTO_$getservbyport_r_proto" ;;
15542 echo "Prototype: $try" ;;
15545 *) case "$usethreads" in
15546 define) echo "getservbyport_r has no prototype, not using it." >&4 ;;
15548 d_getservbyport_r=undef
15549 getservbyport_r_proto=0
15553 *) getservbyport_r_proto=0
15557 : see if getservent_r exists
15558 set getservent_r d_getservent_r
15560 case "$d_getservent_r" in
15562 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
15563 case "$d_getservent_r_proto:$usethreads" in
15564 ":define") d_getservent_r_proto=define
15565 set d_getservent_r_proto getservent_r $hdrs
15569 case "$d_getservent_r_proto" in
15571 case "$getservent_r_proto" in
15572 ''|0) try='int getservent_r(struct servent*, char*, size_t, struct servent**);'
15573 ./protochk "$extern_C $try" $hdrs && getservent_r_proto=I_SBWR ;;
15575 case "$getservent_r_proto" in
15576 ''|0) try='int getservent_r(struct servent*, char*, int);'
15577 ./protochk "$extern_C $try" $hdrs && getservent_r_proto=I_SBI ;;
15579 case "$getservent_r_proto" in
15580 ''|0) try='struct servent* getservent_r(struct servent*, char*, int);'
15581 ./protochk "$extern_C $try" $hdrs && getservent_r_proto=S_SBI ;;
15583 case "$getservent_r_proto" in
15584 ''|0) try='int getservent_r(struct servent*, struct servent_data*);'
15585 ./protochk "$extern_C $try" $hdrs && getservent_r_proto=I_SD ;;
15587 case "$getservent_r_proto" in
15588 ''|0) d_getservent_r=undef
15589 getservent_r_proto=0
15590 echo "Disabling getservent_r, cannot determine prototype." >&4 ;;
15591 * ) case "$getservent_r_proto" in
15592 REENTRANT_PROTO*) ;;
15593 *) getservent_r_proto="REENTRANT_PROTO_$getservent_r_proto" ;;
15595 echo "Prototype: $try" ;;
15598 *) case "$usethreads" in
15599 define) echo "getservent_r has no prototype, not using it." >&4 ;;
15601 d_getservent_r=undef
15602 getservent_r_proto=0
15606 *) getservent_r_proto=0
15610 : see if prototypes for various getservxxx netdb.h functions are available
15612 set d_getservprotos getservent $i_netdb netdb.h
15615 : see if getspnam exists
15616 set getspnam d_getspnam
15619 : see if this is a shadow.h system
15620 set shadow.h i_shadow
15623 : see if getspnam_r exists
15624 set getspnam_r d_getspnam_r
15626 case "$d_getspnam_r" in
15628 hdrs="$i_systypes sys/types.h define stdio.h $i_shadow shadow.h"
15629 case "$d_getspnam_r_proto:$usethreads" in
15630 ":define") d_getspnam_r_proto=define
15631 set d_getspnam_r_proto getspnam_r $hdrs
15635 case "$d_getspnam_r_proto" in
15637 case "$getspnam_r_proto" in
15638 ''|0) try='int getspnam_r(const char*, struct spwd*, char*, size_t, struct spwd**);'
15639 ./protochk "$extern_C $try" $hdrs && getspnam_r_proto=I_CSBWR ;;
15641 case "$getspnam_r_proto" in
15642 ''|0) try='struct spwd* getspnam_r(const char*, struct spwd*, char*, int);'
15643 ./protochk "$extern_C $try" $hdrs && getspnam_r_proto=S_CSBI ;;
15645 case "$getspnam_r_proto" in
15646 ''|0) d_getspnam_r=undef
15648 echo "Disabling getspnam_r, cannot determine prototype." >&4 ;;
15649 * ) case "$getspnam_r_proto" in
15650 REENTRANT_PROTO*) ;;
15651 *) getspnam_r_proto="REENTRANT_PROTO_$getspnam_r_proto" ;;
15653 echo "Prototype: $try" ;;
15656 *) case "$usethreads" in
15657 define) echo "getspnam_r has no prototype, not using it." >&4 ;;
15664 *) getspnam_r_proto=0
15668 : see if gettimeofday or ftime exists
15669 set gettimeofday d_gettimeod
15671 case "$d_gettimeod" in
15677 val="$undef"; set d_ftime; eval $setvar
15680 case "$d_gettimeod$d_ftime" in
15683 echo 'No ftime() nor gettimeofday() -- timing may be less accurate.' >&4
15687 : see if gmtime_r exists
15688 set gmtime_r d_gmtime_r
15690 case "$d_gmtime_r" in
15692 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
15693 case "$d_gmtime_r_proto:$usethreads" in
15694 ":define") d_gmtime_r_proto=define
15695 set d_gmtime_r_proto gmtime_r $hdrs
15699 case "$d_gmtime_r_proto" in
15701 case "$gmtime_r_proto" in
15702 ''|0) try='struct tm* gmtime_r(const time_t*, struct tm*);'
15703 ./protochk "$extern_C $try" $hdrs && gmtime_r_proto=S_TS ;;
15705 case "$gmtime_r_proto" in
15706 ''|0) try='int gmtime_r(const time_t*, struct tm*);'
15707 ./protochk "$extern_C $try" $hdrs && gmtime_r_proto=I_TS ;;
15709 case "$gmtime_r_proto" in
15710 ''|0) d_gmtime_r=undef
15712 echo "Disabling gmtime_r, cannot determine prototype." >&4 ;;
15713 * ) case "$gmtime_r_proto" in
15714 REENTRANT_PROTO*) ;;
15715 *) gmtime_r_proto="REENTRANT_PROTO_$gmtime_r_proto" ;;
15717 echo "Prototype: $try" ;;
15720 *) case "$usethreads" in
15721 define) echo "gmtime_r has no prototype, not using it." >&4 ;;
15728 *) gmtime_r_proto=0
15732 : see if hasmntopt exists
15733 set hasmntopt d_hasmntopt
15736 : see if this is a netinet/in.h or sys/in.h system
15737 set netinet/in.h i_niin sys/in.h i_sysin
15740 : see if arpa/inet.h has to be included
15741 set arpa/inet.h i_arpainet
15744 : see if htonl --and friends-- exists
15749 : Maybe they are macros.
15752 $cat >htonl.c <<EOM
15754 #include <sys/types.h>
15755 #$i_niin I_NETINET_IN
15757 #$i_arpainet I_ARPA_INET
15758 #ifdef I_NETINET_IN
15759 #include <netinet/in.h>
15762 #include <sys/in.h>
15765 #include <arpa/inet.h>
15768 printf("Defined as a macro.");
15771 $cppstdin $cppflags $cppminus < htonl.c >htonl.E 2>/dev/null
15772 if $contains 'Defined as a macro' htonl.E >/dev/null 2>&1; then
15774 echo "But it seems to be defined as a macro." >&4
15782 : see if hypot exists
15786 : see if ilogb exists
15790 : see if ilogbl exists
15791 set ilogbl d_ilogbl
15796 if set index val -f; eval $csym; $val; then
15797 if set strchr val -f d_strchr; eval $csym; $val; then
15798 if $contains strchr "$strings" >/dev/null 2>&1 ; then
15801 echo "strchr() found." >&4
15805 echo "index() found." >&4
15810 echo "index() found." >&4
15813 if set strchr val -f d_strchr; eval $csym; $val; then
15816 echo "strchr() found." >&4
15818 echo "No index() or strchr() found!" >&4
15823 set d_strchr; eval $setvar
15825 set d_index; eval $setvar
15827 : check whether inet_aton exists
15828 set inet_aton d_inetaton
15831 : see if inet_ntop exists
15832 set inet_ntop d_inetntop
15835 : see if inet_pton exists
15836 set inet_pton d_inetpton
15841 $cat >isascii.c <<EOCP
15844 #$i_stdlib I_STDLIB
15846 #include <stdlib.h>
15857 if eval $compile; then
15858 echo "isascii() found." >&4
15861 echo "isascii() NOT found." >&4
15870 $cat >isblank.c <<'EOCP'
15881 if $cc $ccflags $ldflags -o isblank isblank.c $libs >/dev/null 2>&1 ; then
15882 echo "isblank() found." >&4
15885 echo "isblank() NOT found." >&4
15892 : check for isfinite
15893 echo "Checking to see if you have isfinite..." >&4
15899 int main() { return isfinite(0.0); }
15902 if eval $compile; then
15904 echo "You have isfinite."
15907 echo "You do not have isfinite."
15913 : see if isfinitel exists
15914 set isfinitel d_isfinitel
15918 echo "Checking to see if you have isinf..." >&4
15924 int main() { return isinf(0.0); }
15927 if eval $compile; then
15929 echo "You have isinf."
15932 echo "You do not have isinf."
15938 : see if isinfl exists
15939 set isinfl d_isinfl
15943 echo "Checking to see if you have isless..." >&4
15949 int main() { return isless(0.0); }
15952 if eval $compile; then
15954 echo "You have isless."
15957 echo "You do not have isless."
15964 echo "Checking to see if you have isnan..." >&4
15970 int main() { return isnan(0.0); }
15973 if eval $compile; then
15975 echo "You have isnan."
15978 echo "You do not have isnan."
15984 : see if isnanl exists
15985 set isnanl d_isnanl
15988 : check for isnormal
15989 echo "Checking to see if you have isnormal..." >&4
15995 int main() { return isnormal(0.0); }
15998 if eval $compile; then
16000 echo "You have isnormal."
16003 echo "You do not have isnormal."
16013 : see if j0l exists
16017 : see if killpg exists
16018 set killpg d_killpg
16021 : see if localeconv exists
16022 set localeconv d_locconv
16025 : see if libc has the POSIX.1-2008 currency locale rules
16026 case "$d_locconv:$d_lc_monetary_2008" in
16029 #include <locale.h>
16031 struct lconv *lc = localeconv();
16032 char int_p_cs_precedes = lc->int_p_cs_precedes;
16037 if eval $compile; then
16038 d_lc_monetary_2008="$define"
16040 d_lc_monetary_2008="$undef"
16046 : see if lchown exists
16048 $cat > try.c <<'EOCP'
16049 /* System header to define __stub macros and hopefully few prototypes,
16050 which can conflict with char lchown(); below. */
16051 #include <assert.h>
16052 /* Override any gcc2 internal prototype to avoid an error. */
16053 /* We use char because int might match the return type of a gcc2
16054 builtin and then its argument prototype would still apply. */
16057 /* The GNU C library defines this for functions which it implements
16058 to always fail with ENOSYS. Some functions are actually named
16059 something starting with __ and the normal name is an alias. */
16060 #if defined (__stub_lchown) || defined (__stub___lchown)
16068 if eval $compile; then
16069 $echo "lchown() found." >&4
16072 $echo "lchown() NOT found." >&4
16078 : See if number of significant digits in a double precision number is known
16080 $cat >ldbl_dig.c <<EOM
16081 #$i_limits I_LIMITS
16084 #include <limits.h>
16090 printf("Contains LDBL_DIG");
16093 $cppstdin $cppflags $cppminus < ldbl_dig.c >ldbl_dig.E 2>/dev/null
16094 if $contains 'LDBL_DIG' ldbl_dig.E >/dev/null 2>&1; then
16095 echo "LDBL_DIG found." >&4
16098 echo "LDBL_DIG NOT found." >&4
16105 : see if lgamma exists
16106 set lgamma d_lgamma
16109 : see if lgamma_r exists
16110 set lgamma_r d_lgamma_r
16113 : check to see if math.h defines _LIB_VERSION
16114 d_libm_lib_version="$undef"
16118 echo "Checking to see if your libm supports _LIB_VERSION..." >&4
16120 #include <unistd.h>
16122 int main (int argc, char *argv[])
16124 printf ("%d\n", _LIB_VERSION);
16129 if eval $compile; then
16131 echo "Yes, it does ($foo)" >&4
16132 d_libm_lib_version="$define"
16134 echo "No, it does not (probably harmless)" >&4
16141 : see if link exists
16145 : see if llrint exists
16146 set llrint d_llrint
16149 : see if llrintl exists
16150 set llrintl d_llrintl
16153 : see if llround exists
16154 set llround d_llround
16157 : see if llroundl exists
16158 set llroundl d_llroundl
16161 : see if localtime_r exists
16162 set localtime_r d_localtime_r
16164 case "$d_localtime_r" in
16166 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
16167 case "$d_localtime_r_proto:$usethreads" in
16168 ":define") d_localtime_r_proto=define
16169 set d_localtime_r_proto localtime_r $hdrs
16173 case "$d_localtime_r_proto" in
16175 case "$localtime_r_proto" in
16176 ''|0) try='struct tm* localtime_r(const time_t*, struct tm*);'
16177 ./protochk "$extern_C $try" $hdrs && localtime_r_proto=S_TS ;;
16179 case "$localtime_r_proto" in
16180 ''|0) try='int localtime_r(const time_t*, struct tm*);'
16181 ./protochk "$extern_C $try" $hdrs && localtime_r_proto=I_TS ;;
16183 case "$localtime_r_proto" in
16184 ''|0) d_localtime_r=undef
16185 localtime_r_proto=0
16186 echo "Disabling localtime_r, cannot determine prototype." >&4 ;;
16187 * ) case "$localtime_r_proto" in
16188 REENTRANT_PROTO*) ;;
16189 *) localtime_r_proto="REENTRANT_PROTO_$localtime_r_proto" ;;
16191 echo "Prototype: $try" ;;
16194 *) case "$usethreads" in
16195 define) echo "localtime_r has no prototype, not using it." >&4 ;;
16197 d_localtime_r=undef
16198 localtime_r_proto=0
16202 *) localtime_r_proto=0
16206 : see if localtime_r calls tzset
16207 case "$localtime_r_proto" in
16210 /* Does our libc's localtime_r call tzset ?
16211 * return 0 if so, 1 otherwise.
16213 #$i_systypes I_SYS_TYPES
16214 #$i_unistd I_UNISTD
16216 #$i_stdlib I_STDLIB
16217 #$i_string I_STRING
16218 #$i_malloc I_MALLOC
16220 # include <sys/types.h>
16223 # include <unistd.h>
16229 #include <stdlib.h>
16232 # include <string.h>
16234 # include <strings.h>
16237 # include <malloc.h>
16241 time_t t = time(0L);
16242 char w_tz[]="TZ" "=GMT+5",
16243 e_tz[]="TZ" "=GMT-5",
16244 *tz_e = (char*)malloc(16),
16245 *tz_w = (char*)malloc(16);
16246 struct tm tm_e, tm_w;
16247 memset(&tm_e,'\0',sizeof(struct tm));
16248 memset(&tm_w,'\0',sizeof(struct tm));
16253 localtime_r(&t, &tm_e);
16256 localtime_r(&t, &tm_w);
16258 if( memcmp(&tm_e, &tm_w, sizeof(struct tm)) == 0 )
16264 if eval $compile; then
16265 if $run ./try; then
16266 d_localtime_r_needs_tzset=undef;
16268 d_localtime_r_needs_tzset=define;
16271 d_localtime_r_needs_tzset=undef;
16275 d_localtime_r_needs_tzset=undef;
16280 : see if lockf exists
16284 : see if log1p exists
16288 : see if log2 exists
16292 : see if logb exists
16296 : see if lrint exists
16300 : see if lrintl exists
16301 set lrintl d_lrintl
16304 : see if lround exists
16305 set lround d_lround
16308 : see if lroundl exists
16309 set lroundl d_lroundl
16312 : see if prototype for lseek is available
16314 set d_lseekproto lseek $i_systypes sys/types.h $i_unistd unistd.h
16317 : see if lstat exists
16321 : see if madvise exists
16322 set madvise d_madvise
16325 : see if malloc_size exists
16326 set malloc_size d_malloc_size
16329 : see if malloc_size_good exists
16330 set malloc_good_size d_malloc_good_size
16333 : see if mblen exists
16337 : see if mbstowcs exists
16338 set mbstowcs d_mbstowcs
16341 : see if mbtowc exists
16342 set mbtowc d_mbtowc
16345 : see if memchr exists
16346 set memchr d_memchr
16349 : see if memcmp exists
16350 set memcmp d_memcmp
16353 : see if memcpy exists
16354 set memcpy d_memcpy
16357 : see if memmem exists
16358 set memmem d_memmem
16361 : see if memmove exists
16362 set memmove d_memmove
16365 : see if memset exists
16366 set memset d_memset
16369 : see if mkdir exists
16373 : see if mkdtemp exists
16374 set mkdtemp d_mkdtemp
16377 : see if mkfifo exists
16378 set mkfifo d_mkfifo
16381 : see if mkstemp exists
16382 set mkstemp d_mkstemp
16385 : see if mkstemps exists
16386 set mkstemps d_mkstemps
16389 : see if mktime exists
16390 set mktime d_mktime
16393 : see if this is a sys/mman.h system
16394 set sys/mman.h i_sysmman
16397 : see if mmap exists
16400 : see what shmat returns
16401 : default to something harmless
16403 case "$i_sysmman$d_mmap" in
16405 $cat >mmap.c <<'END'
16406 #include <sys/mman.h>
16409 if $cc $ccflags -c mmap.c >/dev/null 2>&1; then
16414 echo "and it returns ($mmaptype)." >&4
16420 : see if sqrtl exists
16424 : see if scalbnl exists
16425 set scalbnl d_scalbnl
16428 : see if truncl exists
16429 set truncl d_truncl
16432 : see if modfl exists
16436 : see if prototype for modfl is available
16438 set d_modflproto modfl $i_math math.h
16441 d_modfl_pow32_bug="$undef"
16443 case "$d_longdbl$d_modfl" in
16446 Checking to see whether your modfl() is okay for large values...
16452 if $test "X$d_modflproto" != "X$define"; then
16453 $cat >>try.c <<EOCP
16454 /* Sigh. many current glibcs provide the function, but do not prototype it. */
16455 long double modfl (long double, long double *);
16458 $cat >>try.c <<EOCP
16460 long double nv = 4294967303.15;
16466 printf(" %"$sPRIfldbl" %"$sPRIfldbl" %"$sPRIfldbl"\n", nv, v, w);
16470 case "$osname:$gccversion" in
16471 aix:) saveccflags="$ccflags"
16472 ccflags="$ccflags -qlongdouble" ;; # to avoid core dump
16475 if eval $compile; then
16478 *" 4294967303.150000 1.150000 4294967302.000000")
16479 echo >&4 "Your modfl() is broken for large values."
16480 d_modfl_pow32_bug="$define"
16482 glibc) echo >&4 "You should upgrade your glibc to at least 2.2.2 to get a fixed modfl()."
16486 *" 4294967303.150000 0.150000 4294967303.000000")
16487 echo >&4 "Your modfl() seems okay for large values."
16489 *) echo >&4 "I don't understand your modfl() at all."
16495 echo "I cannot figure out whether your modfl() is okay, assuming it isn't."
16498 case "$osname:$gccversion" in
16499 aix:) ccflags="$saveccflags" ;; # restore
16504 if $test "$uselongdouble" = "$define"; then
16506 if $test "$d_sqrtl" != "$define"; then
16507 message="$message sqrtl"
16509 if $test "$d_modfl" != "$define"; then
16510 if $test "$d_truncl:$d_copysignl" = "$define:$define"; then
16511 echo "You have both truncl and copysignl, so I can emulate modfl."
16513 if $test "$d_aintl:$d_copysignl" = "$define:$define"; then
16514 echo "You have both aintl and copysignl, so I can emulate modfl."
16516 message="$message modfl"
16520 if $test "$d_frexpl" != "$define"; then
16521 if $test "$d_ilogbl:$d_scalbnl" = "$define:$define"; then
16522 echo "You have both ilogbl and scalbnl, so I can emulate frexpl."
16524 message="$message frexpl"
16527 if $test "$d_ldexpl" != "$define"; then
16528 message="$message ldexpl"
16531 if $test "$message" != ""; then
16534 *** You requested the use of long doubles but you do not seem to have
16535 *** the following mathematical functions needed for long double support:
16537 *** Please rerun Configure without -Duselongdouble and/or -Dusemorebits.
16538 *** Cannot continue, aborting.
16546 : see if mprotect exists
16547 set mprotect d_mprotect
16550 : see if msgctl exists
16551 set msgctl d_msgctl
16554 : see if msgget exists
16555 set msgget d_msgget
16558 : see if msgsnd exists
16559 set msgsnd d_msgsnd
16562 : see if msgrcv exists
16563 set msgrcv d_msgrcv
16566 : see how much of the 'msg*(2)' library is present.
16569 case "$d_msgctl$d_msgget$d_msgsnd$d_msgrcv" in
16570 *"$undef"*) h_msg=false;;
16574 case "`ipcs 2>&1`" in
16575 "SVID messages"*"not configured"*)
16576 echo "Your $osname does not have the msg*(2) configured." >&4
16579 set msgctl d_msgctl
16581 set msgget d_msgget
16583 set msgsnd d_msgsnd
16585 set msgrcv d_msgrcv
16591 : we could also check for sys/ipc.h ...
16592 if $h_msg && $test `./findhdr sys/msg.h`; then
16593 echo "You have the full msg*(2) library." >&4
16596 echo "You don't have the full msg*(2) library." >&4
16602 : Check for msghdr_s
16604 echo "Checking to see if your system supports struct msghdr..." >&4
16605 set d_msghdr_s msghdr $i_systypes sys/types.h $d_socket sys/socket.h $i_sysuio sys/uio.h
16607 case "$d_msghdr_s" in
16608 "$define") echo "Yes, it does." ;;
16609 *) echo "No, it doesn't." ;;
16613 : see if msync exists
16617 : see if munmap exists
16618 set munmap d_munmap
16621 : see if nan exists
16625 : see if nearbyint exists
16626 set nearbyint d_nearbyint
16629 : see if newlocale exists
16630 set newlocale d_newlocale
16633 : see if freelocale exists
16634 set freelocale d_freelocale
16637 : see if uselocale exists
16638 set uselocale d_uselocale
16641 : see if nextafter exists
16642 set nextafter d_nextafter
16645 : see if nexttoward exists
16646 set nexttoward d_nexttoward
16649 : see if nice exists
16653 : see if this is a langinfo.h system
16654 set langinfo.h i_langinfo
16657 : see if nl_langinfo exists
16658 set nl_langinfo d_nl_langinfo
16661 : see if this is a quadmath.h system
16662 set quadmath.h i_quadmath
16665 : check for volatile keyword
16667 echo 'Checking to see if your C compiler knows about "volatile"...' >&4
16668 $cat >try.c <<'EOCP'
16671 typedef struct _goo_struct goo_struct;
16672 goo_struct * volatile goo = ((goo_struct *)0);
16673 struct _goo_struct {
16678 typedef unsigned short foo_t;
16679 char *volatile foo;
16681 volatile foo_t blech;
16685 if $cc -c $ccflags try.c >/dev/null 2>&1 ; then
16687 echo "Yup, it does."
16690 echo "Nope, it doesn't."
16696 : Check basic sizes
16698 $echo "Choosing the C types to be used for Perl's internal types..." >&4
16700 case "$use64bitint:$d_quad:$quadtype" in
16703 uvtype="$uquadtype"
16708 uvtype="unsigned long"
16714 case "$uselongdouble:$d_longdbl" in
16716 nvtype="long double"
16717 nvsize=$longdblsize
16724 case "$usequadmath:$i_quadmath" in
16726 nvtype="__float128"
16732 *** You requested the use of the quadmath library, but you
16733 *** do not seem to have the quadmath library installed.
16734 *** Cannot continue, aborting.
16740 define:*) $cat <<EOM >&4
16742 *** You requested the use of the quadmath library, but you
16743 *** do not seem to have the required header, <quadmath.h>.
16745 case "$gccversion" in
16748 *** Your gcc looks a bit old:
16754 *** You are not running a gcc.
16759 *** For the quadmath library you need at least gcc 4.6.
16760 *** Cannot continue, aborting.
16766 $echo "(IV will be "$ivtype", $ivsize bytes)"
16767 $echo "(UV will be "$uvtype", $uvsize bytes)"
16768 $echo "(NV will be "$nvtype", $nvsize bytes)"
16771 #$i_inttypes I_INTTYPES
16773 #include <inttypes.h>
16778 int8_t i = INT8_MAX;
16779 uint8_t u = UINT8_MAX;
16780 printf("int8_t\n");
16783 int16_t i = INT16_MAX;
16784 uint16_t u = UINT16_MAX;
16785 printf("int16_t\n");
16788 int32_t i = INT32_MAX;
16789 uint32_t u = UINT32_MAX;
16790 printf("int32_t\n");
16795 i8type="signed char"
16796 u8type="unsigned char"
16801 '') case "$shortsize" in
16803 u16type="unsigned short"
16811 '') set try -DINT16
16812 if eval $compile; then
16813 case "`$run ./try`" in
16825 '') if $test $shortsize -ge 2; then
16827 u16type="unsigned short"
16835 '') case "$longsize" in
16837 u32type="unsigned long"
16841 *) case "$intsize" in
16843 u32type="unsigned int"
16853 '') set try -DINT32
16854 if eval $compile; then
16855 case "`$run ./try`" in
16867 '') if $test $intsize -ge 4; then
16869 u32type="unsigned int"
16877 '') case "$d_quad:$quadtype" in
16879 i64type="$quadtype"
16880 u64type="$uquadtype"
16888 $echo "Checking how many bits of your UVs your NVs can preserve..." >&4
16889 : volatile so that the compiler has to store it out to memory.
16890 if test X"$d_volatile" = X"$define"; then
16895 #$i_stdlib I_STDLIB
16897 #include <stdlib.h>
16899 #include <sys/types.h>
16900 #include <signal.h>
16902 $volatile int bletched = 0;
16903 $signal_t blech(int s) { bletched = 1; }
16908 int n = 8 * $uvsize;
16911 signal(SIGFPE, blech);
16914 for (i = 0; i < n; i++) {
16915 u = u << 1 | ($uvtype)1;
16917 if (($uvtype)d != u)
16921 d = ($nvtype)(u - 1);
16922 if (($uvtype)d != (u - 1))
16929 printf("%d\n", ((i == n) ? -n : i));
16935 d_nv_preserves_uv="$undef"
16936 if eval $compile; then
16937 nv_preserves_uv_bits="`$run ./try`"
16939 case "$nv_preserves_uv_bits" in
16941 nv_preserves_uv_bits=`expr 0 - $nv_preserves_uv_bits`
16942 $echo "Your NVs can preserve all $nv_preserves_uv_bits bits of your UVs." 2>&1
16943 d_nv_preserves_uv="$define"
16945 [1-9]*) $echo "Your NVs can preserve only $nv_preserves_uv_bits bits of your UVs." 2>&1
16946 d_nv_preserves_uv="$undef" ;;
16947 *) $echo "Can't figure out how many bits your NVs preserve." 2>&1
16948 nv_preserves_uv_bits="0" ;;
16952 $echo "Checking to find the largest integer value your NVs can hold..." >&4
16953 : volatile so that the compiler has to store it out to memory.
16954 if test X"$d_volatile" = X"$define"; then
16960 typedef $nvtype NV;
16967 while(count < 256) {
16968 $volatile NV up = value + 1.0;
16969 $volatile NV negated = -value;
16970 $volatile NV down = negated - 1.0;
16971 $volatile NV got_up = up - value;
16972 int up_good = got_up == 1.0;
16973 int got_down = down - negated;
16974 int down_good = got_down == -1.0;
16976 if (down_good != up_good) {
16978 "Inconsistency - up %d %f; down %d %f; for 2**%d (%.20f)\n",
16979 up_good, (double) got_up, down_good, (double) got_down,
16980 count, (double) value);
16987 fputs("256.0", stdout);
16990 fputs("2.0", stdout);
16996 fputs("*", stdout);
17002 fprintf(stderr, "Cannot overflow integer range, even at 2**%d (%.20f)\n",
17003 count, (double) value);
17009 nv_overflows_integers_at='0'
17010 if eval $compile; then
17016 The largest integer your NVs can preserve is equal to $xxx
17018 nv_overflows_integers_at="$xxx"
17021 Cannot determine the largest integer value your NVs can hold, unexpected output
17028 Cannot determine the largest integer value your NVs can hold
17035 $echo "Checking whether NV 0.0 is all bits zero in memory..." >&4
17036 : volatile so that the compiler has to store it out to memory.
17037 if test X"$d_volatile" = X"$define"; then
17042 #$i_stdlib I_STDLIB
17044 #include <stdlib.h>
17046 #$i_string I_STRING
17048 # include <string.h>
17050 # include <strings.h>
17052 #include <sys/types.h>
17053 #include <signal.h>
17055 $volatile int bletched = 0;
17056 $signal_t blech(int s) { bletched = 1; }
17059 int checkit($nvtype d, char *where) {
17060 unsigned char *p = (char *)&d;
17061 unsigned char *end = p + sizeof(d);
17071 printf("No - %s: 0x", where);
17073 printf ("%02X", *p++);
17078 int main(int argc, char **argv) {
17081 fail += checkit(d, "0.0");
17083 /* The compiler shouldn't be assuming that bletched is 0 */
17086 fail += checkit(d, "bleched");
17089 signal(SIGFPE, blech);
17092 /* Paranoia - the compiler should have no way of knowing that ANSI says
17093 that argv[argc] will always be NULL. Actually, if it did assume this it
17094 would be buggy, as this is C and main() can be called from elsewhere in
17096 d = argv[argc] ? 1 : 0;
17099 printf("Odd argv[argc]=%p, d=%g\n", argv[argc], d);
17102 fail += checkit(d, "ternary");
17104 memset(&d, sizeof(d), argv[argc] ? 1 : 0);
17107 printf("No - memset doesn't give 0.0\n");
17108 /* This might just blow up: */
17109 printf("(gives %g)\n", d);
17115 printf("No - something bleched\n");
17120 printf("No - %d fail(s)\n", fail);
17129 d_nv_zero_is_allbits_zero="$undef"
17130 if eval $compile; then
17136 0.0 is represented as all bits zero in memory
17138 d_nv_zero_is_allbits_zero="$define"
17141 0.0 is not represented as all bits zero in memory
17143 d_nv_zero_is_allbits_zero="$undef"
17148 0.0 is not represented as all bits zero in memory
17150 d_nv_zero_is_allbits_zero="$undef"
17156 : check for off64_t
17158 echo "Checking to see if you have off64_t..." >&4
17160 #include <sys/types.h>
17161 #include <unistd.h>
17162 int main() { off64_t x = 7; }
17165 if eval $compile; then
17167 echo "You have off64_t."
17170 echo "You do not have off64_t."
17171 case "$lseeksize" in
17172 8) echo "(Your off_t is 64 bits, so you could use that.)" ;;
17179 : how to create joinable pthreads
17180 if test "X$usethreads" = "X$define" -a "X$i_pthread" = "X$define"; then
17182 echo "Checking what constant to use for creating joinable pthreads..." >&4
17183 $cat >try.c <<'EOCP'
17184 #include <pthread.h>
17186 int detachstate = JOINABLE;
17189 set try -DJOINABLE=PTHREAD_CREATE_JOINABLE
17190 if eval $compile; then
17191 echo "You seem to use PTHREAD_CREATE_JOINABLE." >&4
17192 val="$undef" # Yes, undef.
17193 set d_old_pthread_create_joinable
17196 set old_pthread_create_joinable
17199 set try -DJOINABLE=PTHREAD_CREATE_UNDETACHED
17200 if eval $compile; then
17201 echo "You seem to use PTHREAD_CREATE_UNDETACHED." >&4
17203 set d_old_pthread_create_joinable
17205 val=PTHREAD_CREATE_UNDETACHED
17206 set old_pthread_create_joinable
17209 set try -DJOINABLE=__UNDETACHED
17210 if eval $compile; then
17211 echo "You seem to use __UNDETACHED." >&4
17213 set d_old_pthread_create_joinable
17216 set old_pthread_create_joinable
17219 echo "Egads, nothing obvious found. Guessing that you use 0." >&4
17221 set d_old_pthread_create_joinable
17224 set old_pthread_create_joinable
17231 d_old_pthread_create_joinable="$undef"
17232 old_pthread_create_joinable=""
17235 : see if pause exists
17239 : see if poll exists
17243 : see if prctl exists
17247 : see if prctl supports PR_SET_NAME
17248 d_prctl_set_name=$undef
17253 #include <unistd.h>
17255 #include <sys/prctl.h>
17257 int main (int argc, char *argv[])
17259 return (prctl (PR_SET_NAME, "Test"));
17263 if eval $compile_ok && $run ./try; then
17264 echo "Your prctl (PR_SET_NAME, ...) works"
17265 d_prctl_set_name=$define
17271 : see if readlink exists
17272 set readlink d_readlink
17275 : Check if there is a /proc symlink to the abs path of
17276 : the executing program. We will honor hints of d_procselfexe=$undef
17277 : or procselfexe being non-empty, otherwise will try to determine both
17278 : if we have readlink.
17279 : AmigaOS will attempt to mount proc: aka /proc, if /proc/... is
17280 : referenced, and AmigaOS does not have a proc filesystem anyway.
17283 if $test "X$d_procselfexe" = Xundef; then
17285 elif $test "X$procselfexe" != X -a "X$procselfexe" != 'X '; then
17287 elif $test "X$d_readlink" = Xdefine; then
17288 : NetBSD first as /proc/self is a symlink to /proc/curproc,
17289 : and it feels more tidy to avoid an extra level of symlink
17290 set NetBSD /proc/curproc/exe Linux /proc/self/exe FreeBSD /proc/curproc/file Solaris /proc/self/path/a.out
17291 while test $# -gt 0; do
17294 if $issymlink $try; then
17295 $ls -l $try > reflect
17296 if $contains /`basename $ls` reflect >/dev/null 2>&1; then
17297 echo "You have $type-like $try."
17298 procselfexe='"'$try'"'
17300 : This will break out of the loop
17310 : backward compatibility for d_hvfork
17311 if test X$d_hvfork != X; then
17312 d_vfork="$d_hvfork"
17315 : see if there is a vfork
17320 d_pseudofork=$undef
17322 : Ok, but do we want to use it. vfork is reportedly unreliable in
17323 : perl on Solaris 2.x, and probably elsewhere.
17327 case "$usevfork" in
17333 Perl can only use a vfork() that doesn't suffer from strict
17334 restrictions on calling functions or modifying global data in
17335 the child. For example, glibc-2.1 contains such a vfork()
17336 that is unsuitable. If your system provides a proper fork()
17337 call, chances are that you do NOT want perl to use vfork().
17340 rp="Do you still want to use vfork()?"
17345 echo "Ok, we won't use vfork()."
17354 $define) usevfork='true';;
17355 *) usevfork='false';;
17358 : see whether the pthread_atfork exists
17360 #include <pthread.h>
17363 #ifdef PTHREAD_ATFORK
17364 pthread_atfork(NULL,NULL,NULL);
17369 : see if pthread_atfork exists
17370 set try -DPTHREAD_ATFORK
17371 if eval $compile; then
17376 case "$usethreads" in
17379 $define) echo 'pthread_atfork found.' >&4 ;;
17380 *) echo 'pthread_atfork NOT found.' >&4 ;;
17383 set d_pthread_atfork
17386 : see if pthread_attr_setscope exists
17387 set pthread_attr_setscope d_pthread_attr_setscope
17390 : see whether the various POSIXish _yields exist
17392 #include <pthread.h>
17398 #ifdef PTHREAD_YIELD
17401 #ifdef PTHREAD_YIELD_NULL
17402 pthread_yield(NULL);
17408 : see if sched_yield exists
17409 set try -DSCHED_YIELD
17410 if eval $compile; then
17412 sched_yield='sched_yield()'
17416 case "$usethreads" in
17419 $define) echo 'sched_yield() found.' >&4 ;;
17420 *) echo 'sched_yield() NOT found.' >&4 ;;
17426 : see if pthread_yield exists
17427 set try -DPTHREAD_YIELD
17428 if eval $compile; then
17430 case "$sched_yield" in
17431 '') sched_yield='pthread_yield()' ;;
17434 set try -DPTHREAD_YIELD_NULL
17435 if eval $compile; then
17437 case "$sched_yield" in
17438 '') sched_yield='pthread_yield(NULL)' ;;
17444 case "$usethreads" in
17447 $define) echo 'pthread_yield() found.' >&4 ;;
17448 *) echo 'pthread_yield() NOT found.' >&4 ;;
17452 set d_pthread_yield
17454 case "$sched_yield" in
17455 '') sched_yield=undef ;;
17459 : check for ptrdiff_t
17461 echo "Checking to see if you have ptrdiff_t..." >&4
17463 #include <stddef.h>
17464 int main() { ptrdiff_t x = 7; }
17467 if eval $compile; then
17469 echo "You have ptrdiff_t."
17472 echo "You do not have ptrdiff_t."
17478 : see if random_r exists
17479 set random_r d_random_r
17481 case "$d_random_r" in
17483 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
17484 case "$d_random_r_proto:$usethreads" in
17485 ":define") d_random_r_proto=define
17486 set d_random_r_proto random_r $hdrs
17490 case "$d_random_r_proto" in
17492 case "$random_r_proto" in
17493 ''|0) try='int random_r(int*, struct random_data*);'
17494 ./protochk "$extern_C $try" $hdrs && random_r_proto=I_iS ;;
17496 case "$random_r_proto" in
17497 ''|0) try='int random_r(long*, struct random_data*);'
17498 ./protochk "$extern_C $try" $hdrs && random_r_proto=I_lS ;;
17500 case "$random_r_proto" in
17501 ''|0) try='int random_r(struct random_data*, int32_t*);'
17502 ./protochk "$extern_C $try" $hdrs && random_r_proto=I_St ;;
17504 case "$random_r_proto" in
17505 ''|0) d_random_r=undef
17507 echo "Disabling random_r, cannot determine prototype." >&4 ;;
17508 * ) case "$random_r_proto" in
17509 REENTRANT_PROTO*) ;;
17510 *) random_r_proto="REENTRANT_PROTO_$random_r_proto" ;;
17512 echo "Prototype: $try" ;;
17515 *) case "$usethreads" in
17516 define) echo "random_r has no prototype, not using it." >&4 ;;
17523 *) random_r_proto=0
17527 : see if readdir and friends exist
17528 set readdir d_readdir
17530 set seekdir d_seekdir
17532 set telldir d_telldir
17534 set rewinddir d_rewinddir
17537 : see if readdir64_r exists
17538 set readdir64_r d_readdir64_r
17540 case "$d_readdir64_r" in
17542 hdrs="$i_systypes sys/types.h define stdio.h $i_dirent dirent.h"
17543 case "$d_readdir64_r_proto:$usethreads" in
17544 ":define") d_readdir64_r_proto=define
17545 set d_readdir64_r_proto readdir64_r $hdrs
17549 case "$d_readdir64_r_proto" in
17551 case "$readdir64_r_proto" in
17552 ''|0) try='int readdir64_r(DIR*, struct dirent64*, struct dirent64**);'
17553 ./protochk "$extern_C $try" $hdrs && readdir64_r_proto=I_TSR ;;
17555 case "$readdir64_r_proto" in
17556 ''|0) try='int readdir64_r(DIR*, struct dirent64*);'
17557 ./protochk "$extern_C $try" $hdrs && readdir64_r_proto=I_TS ;;
17559 case "$readdir64_r_proto" in
17560 ''|0) d_readdir64_r=undef
17561 readdir64_r_proto=0
17562 echo "Disabling readdir64_r, cannot determine prototype." >&4 ;;
17563 * ) case "$readdir64_r_proto" in
17564 REENTRANT_PROTO*) ;;
17565 *) readdir64_r_proto="REENTRANT_PROTO_$readdir64_r_proto" ;;
17567 echo "Prototype: $try" ;;
17570 *) case "$usethreads" in
17571 define) echo "readdir64_r has no prototype, not using it." >&4 ;;
17573 d_readdir64_r=undef
17574 readdir64_r_proto=0
17578 *) readdir64_r_proto=0
17582 : see if readdir_r exists
17583 set readdir_r d_readdir_r
17585 case "$d_readdir_r" in
17587 hdrs="$i_systypes sys/types.h define stdio.h $i_dirent dirent.h"
17588 case "$d_readdir_r_proto:$usethreads" in
17589 ":define") d_readdir_r_proto=define
17590 set d_readdir_r_proto readdir_r $hdrs
17594 case "$d_readdir_r_proto" in
17596 case "$readdir_r_proto" in
17597 ''|0) try='int readdir_r(DIR*, struct dirent*, struct dirent**);'
17598 ./protochk "$extern_C $try" $hdrs && readdir_r_proto=I_TSR ;;
17600 case "$readdir_r_proto" in
17601 ''|0) try='int readdir_r(DIR*, struct dirent*);'
17602 ./protochk "$extern_C $try" $hdrs && readdir_r_proto=I_TS ;;
17604 case "$readdir_r_proto" in
17605 ''|0) d_readdir_r=undef
17607 echo "Disabling readdir_r, cannot determine prototype." >&4 ;;
17608 * ) case "$readdir_r_proto" in
17609 REENTRANT_PROTO*) ;;
17610 *) readdir_r_proto="REENTRANT_PROTO_$readdir_r_proto" ;;
17612 echo "Prototype: $try" ;;
17615 *) case "$usethreads" in
17616 define) echo "readdir_r has no prototype, not using it." >&4 ;;
17623 *) readdir_r_proto=0
17627 : see if readv exists
17631 : see if recvmsg exists
17632 set recvmsg d_recvmsg
17635 : see if regcomp, regcmp, or re_comp exist, for regular pattern matching
17637 if set regcomp val -f d_regcomp; eval $csym; $val; then
17638 echo 'regcomp() found.' >&4
17639 d_regcomp="$define"
17642 elif set regcmp val -f d_regcmp; eval $csym; $val; then
17643 echo 'regcmp() found.' >&4
17647 elif set re_comp val -f d_re_comp; eval $csym; $val; then
17648 echo 're_comp() found, assuming re_exec() also exists.' >&4
17649 d_re_comp="$define"
17654 No regcomp(), regcmp() nor re_comp() found !! No regular pattern matching.
17661 : see if remainder exists
17662 set remainder d_remainder
17665 : see if remquo exists
17666 set remquo d_remquo
17669 : see if rename exists
17670 set rename d_rename
17673 : see if rint exists
17677 : see if rmdir exists
17681 : see if round exists
17685 : see if memory.h is available.
17690 : See if it conflicts with string.h
17696 $cppstdin $cppflags $cppminus < $strings > mem.h
17697 if $contains 'memcpy' mem.h >/dev/null 2>&1; then
17699 echo "We won't be including <memory.h>."
17709 : can bcopy handle overlapping blocks?
17712 case "$d_memmove" in
17713 "$define") echo "I'll use memmove() instead of bcopy() for overlapping copies." ;;
17714 *) case "$d_bcopy" in
17716 echo "Checking to see if bcopy() can do overlapping copies..." >&4
17718 #$i_memory I_MEMORY
17719 #$i_stdlib I_STDLIB
17720 #$i_string I_STRING
17721 #$i_unistd I_UNISTD
17723 $cat >>try.c <<'EOCP'
17726 # include <memory.h>
17729 # include <stdlib.h>
17732 # include <string.h>
17734 # include <strings.h>
17737 # include <unistd.h> /* Needed for NetBSD */
17741 char buf[128], abc[128];
17747 /* Copy "abcde..." string to char abc[] so that gcc doesn't
17748 try to store the string in read-only memory. */
17749 bcopy("abcdefghijklmnopqrstuvwxyz0123456789", abc, 36);
17751 for (align = 7; align >= 0; align--) {
17752 for (len = 36; len; len--) {
17754 bcopy(abc, b, len);
17755 for (off = 1; off <= len; off++) {
17756 bcopy(b, b+off, len);
17757 bcopy(b+off, b, len);
17758 if (bcmp(b, abc, len))
17767 if eval $compile_ok; then
17768 if $run ./try 2>/dev/null; then
17769 echo "Yes, it can."
17772 echo "It can't, sorry."
17775 echo "(I can't compile the test program, so we'll assume not...)"
17785 : can memcpy handle overlapping blocks?
17788 case "$d_memmove" in
17789 "$define") echo "I'll use memmove() instead of memcpy() for overlapping copies." ;;
17790 *) case "$d_memcpy" in
17792 echo "Checking to see if memcpy() can do overlapping copies..." >&4
17794 #$i_memory I_MEMORY
17795 #$i_stdlib I_STDLIB
17796 #$i_string I_STRING
17797 #$i_unistd I_UNISTD
17799 $cat >>try.c <<'EOCP'
17802 # include <memory.h>
17805 # include <stdlib.h>
17808 # include <string.h>
17810 # include <strings.h>
17813 # include <unistd.h> /* Needed for NetBSD */
17817 char buf[128], abc[128];
17823 /* Copy "abcde..." string to char abc[] so that gcc doesn't
17824 try to store the string in read-only memory. */
17825 memcpy(abc, "abcdefghijklmnopqrstuvwxyz0123456789", 36);
17827 for (align = 7; align >= 0; align--) {
17828 for (len = 36; len; len--) {
17830 memcpy(b, abc, len);
17831 for (off = 1; off <= len; off++) {
17832 memcpy(b+off, b, len);
17833 memcpy(b, b+off, len);
17834 if (memcmp(b, abc, len))
17843 if eval $compile_ok; then
17844 if $run ./try 2>/dev/null; then
17845 echo "Yes, it can."
17848 echo "It can't, sorry."
17851 echo "(I can't compile the test program, so we'll assume not...)"
17861 : can memcmp be trusted to compare relative magnitude?
17863 case "$d_memcmp" in
17866 echo "Checking if your memcmp() can compare relative magnitude..." >&4
17868 #$i_memory I_MEMORY
17869 #$i_stdlib I_STDLIB
17870 #$i_string I_STRING
17871 #$i_unistd I_UNISTD
17873 $cat >>try.c <<'EOCP'
17876 # include <memory.h>
17879 # include <stdlib.h>
17882 # include <string.h>
17884 # include <strings.h>
17887 # include <unistd.h> /* Needed for NetBSD */
17893 if ((a < b) && memcmp(&a, &b, 1) < 0)
17899 if eval $compile_ok; then
17900 if $run ./try 2>/dev/null; then
17901 echo "Yes, it can."
17904 echo "No, it can't (it uses signed chars)."
17907 echo "(I can't compile the test program, so we'll assume not...)"
17915 : see if prototype for sbrk is available
17917 set d_sbrkproto sbrk $i_unistd unistd.h
17920 : see if scalbn exists
17921 set scalbn d_scalbn
17924 : see if select exists
17925 set select d_select
17928 : see if semctl exists
17929 set semctl d_semctl
17932 : see if semget exists
17933 set semget d_semget
17936 : see if semop exists
17940 : see how much of the 'sem*(2)' library is present.
17943 case "$d_semctl$d_semget$d_semop" in
17944 *"$undef"*) h_sem=false;;
17948 case "`ipcs 2>&1`" in
17949 "SVID messages"*"not configured"*)
17950 echo "Your $osname does not have the sem*(2) configured." >&4
17953 set semctl d_semctl
17955 set semget d_semget
17963 : we could also check for sys/ipc.h ...
17964 if $h_sem && $test `./findhdr sys/sem.h`; then
17965 echo "You have the full sem*(2) library." >&4
17968 echo "You don't have the full sem*(2) library." >&4
17974 : see whether sys/sem.h defines union semun
17976 $cat > try.c <<'END'
17977 #include <sys/types.h>
17978 #include <sys/ipc.h>
17979 #include <sys/sem.h>
17980 int main () { union semun semun; semun.buf = 0; }
17983 if eval $compile; then
17984 echo "You have union semun in <sys/sem.h>." >&4
17987 echo "You do not have union semun in <sys/sem.h>." >&4
17994 : see how to do semctl IPC_STAT
17998 $cat > tryh.h <<END
18001 # define S_IRUSR S_IREAD
18002 # define S_IWUSR S_IWRITE
18003 # define S_IXUSR S_IEXEC
18005 # define S_IRUSR 0400
18006 # define S_IWUSR 0200
18007 # define S_IXUSR 0100
18009 # define S_IRGRP (S_IRUSR>>3)
18010 # define S_IWGRP (S_IWUSR>>3)
18011 # define S_IXGRP (S_IXUSR>>3)
18012 # define S_IROTH (S_IRUSR>>6)
18013 # define S_IWOTH (S_IWUSR>>6)
18014 # define S_IXOTH (S_IXUSR>>6)
18017 # define S_IRWXU (S_IRUSR|S_IWUSR|S_IXUSR)
18018 # define S_IRWXG (S_IRGRP|S_IWGRP|S_IXGRP)
18019 # define S_IRWXO (S_IROTH|S_IWOTH|S_IXOTH)
18022 : see whether semctl IPC_STAT can use union semun
18023 case "$d_semctl_semun" in
18027 #include <sys/types.h>
18028 #include <sys/ipc.h>
18029 #include <sys/sem.h>
18030 #include <sys/stat.h>
18037 #$d_union_semun HAS_UNION_SEMUN
18040 #ifndef HAS_UNION_SEMUN
18043 struct semid_ds *buf;
18044 unsigned short *array;
18050 #if defined(IPC_PRIVATE) && defined(S_IRWXU) && defined(S_IRWXG) && defined(S_IRWXO) && defined(IPC_CREAT)
18051 sem = semget(IPC_PRIVATE, 1, S_IRWXU|S_IRWXG|S_IRWXO|IPC_CREAT);
18053 struct semid_ds argbuf;
18056 st = semctl(sem, 0, IPC_STAT, arg);
18060 # endif /* IPC_STAT */
18061 printf("semctl IPC_STAT failed: errno = %d\n", errno);
18063 if (semctl(sem, 0, IPC_RMID, arg) != 0)
18064 # endif /* IPC_RMID */
18065 printf("semctl IPC_RMID failed: errno = %d\n", errno);
18067 #endif /* IPC_PRIVATE && ... */
18068 printf("semget failed: errno = %d\n", errno);
18073 if eval $compile; then
18076 semun) val="$define" ;;
18084 case "$d_semctl_semun" in
18086 echo "You can use union semun for semctl IPC_STAT." >&4
18089 *) echo "You cannot use union semun for semctl IPC_STAT." >&4
18094 : see whether semctl IPC_STAT can use struct semid_ds pointer
18095 case "$d_semctl_semid_ds" in
18098 $cat > try.c <<'END'
18099 #include <sys/types.h>
18100 #include <sys/ipc.h>
18101 #include <sys/sem.h>
18102 #include <sys/stat.h>
18110 struct semid_ds arg;
18113 #if defined(IPC_PRIVATE) && defined(S_IRWXU) && defined(S_IRWXG) && defined(S_IRWXO) && defined(IPC_CREAT)
18114 sem = semget(IPC_PRIVATE, 1, S_IRWXU|S_IRWXG|S_IRWXO|IPC_CREAT);
18117 st = semctl(sem, 0, IPC_STAT, &arg);
18119 printf("semid_ds\n");
18121 # endif /* IPC_STAT */
18122 printf("semctl IPC_STAT failed: errno = %d\n", errno);
18124 if (semctl(sem, 0, IPC_RMID, &arg) != 0)
18125 # endif /* IPC_RMID */
18126 printf("semctl IPC_RMID failed: errno = %d\n", errno);
18128 #endif /* IPC_PRIVATE && ... */
18129 printf("semget failed: errno = %d\n", errno);
18135 if eval $compile; then
18138 semid_ds) val="$define" ;;
18142 set d_semctl_semid_ds
18146 case "$d_semctl_semid_ds" in
18148 echo "You can $also use struct semid_ds* for semctl IPC_STAT." >&4
18150 *) echo "You cannot use struct semid_ds* for semctl IPC_STAT." >&4
18156 # We do not have the full sem*(2) library, so assume we can not
18162 set d_semctl_semid_ds
18168 : see if sendmsg exists
18169 set sendmsg d_sendmsg
18172 : see if setegid exists
18173 set setegid d_setegid
18176 : see if seteuid exists
18177 set seteuid d_seteuid
18180 : see if setgrent exists
18181 set setgrent d_setgrent
18184 : see if setgrent_r exists
18185 set setgrent_r d_setgrent_r
18187 case "$d_setgrent_r" in
18189 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
18190 case "$d_setgrent_r_proto:$usethreads" in
18191 ":define") d_setgrent_r_proto=define
18192 set d_setgrent_r_proto setgrent_r $hdrs
18196 case "$d_setgrent_r_proto" in
18198 case "$setgrent_r_proto" in
18199 ''|0) try='int setgrent_r(FILE**);'
18200 ./protochk "$extern_C $try" $hdrs && setgrent_r_proto=I_H ;;
18202 case "$setgrent_r_proto" in
18203 ''|0) try='void setgrent_r(FILE**);'
18204 ./protochk "$extern_C $try" $hdrs && setgrent_r_proto=V_H ;;
18206 case "$setgrent_r_proto" in
18207 ''|0) d_setgrent_r=undef
18209 echo "Disabling setgrent_r, cannot determine prototype." >&4 ;;
18210 * ) case "$setgrent_r_proto" in
18211 REENTRANT_PROTO*) ;;
18212 *) setgrent_r_proto="REENTRANT_PROTO_$setgrent_r_proto" ;;
18214 echo "Prototype: $try" ;;
18217 *) case "$usethreads" in
18218 define) echo "setgrent_r has no prototype, not using it." >&4 ;;
18225 *) setgrent_r_proto=0
18229 : see if sethostent exists
18230 set sethostent d_sethent
18233 : see if sethostent_r exists
18234 set sethostent_r d_sethostent_r
18236 case "$d_sethostent_r" in
18238 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
18239 case "$d_sethostent_r_proto:$usethreads" in
18240 ":define") d_sethostent_r_proto=define
18241 set d_sethostent_r_proto sethostent_r $hdrs
18245 case "$d_sethostent_r_proto" in
18247 case "$sethostent_r_proto" in
18248 ''|0) try='int sethostent_r(int, struct hostent_data*);'
18249 ./protochk "$extern_C $try" $hdrs && sethostent_r_proto=I_ID ;;
18251 case "$sethostent_r_proto" in
18252 ''|0) try='void sethostent_r(int, struct hostent_data*);'
18253 ./protochk "$extern_C $try" $hdrs && sethostent_r_proto=V_ID ;;
18255 case "$sethostent_r_proto" in
18256 ''|0) d_sethostent_r=undef
18257 sethostent_r_proto=0
18258 echo "Disabling sethostent_r, cannot determine prototype." >&4 ;;
18259 * ) case "$sethostent_r_proto" in
18260 REENTRANT_PROTO*) ;;
18261 *) sethostent_r_proto="REENTRANT_PROTO_$sethostent_r_proto" ;;
18263 echo "Prototype: $try" ;;
18266 *) case "$usethreads" in
18267 define) echo "sethostent_r has no prototype, not using it." >&4 ;;
18269 d_sethostent_r=undef
18270 sethostent_r_proto=0
18274 *) sethostent_r_proto=0
18278 : see if setitimer exists
18279 set setitimer d_setitimer
18282 : see if setlinebuf exists
18283 set setlinebuf d_setlinebuf
18286 : see if setlocale exists
18287 set setlocale d_setlocale
18290 : see if locale.h is available
18291 set locale.h i_locale
18294 : see if setlocale_r exists
18295 set setlocale_r d_setlocale_r
18297 case "$d_setlocale_r" in
18299 hdrs="$i_systypes sys/types.h define stdio.h $i_locale locale.h"
18300 case "$d_setlocale_r_proto:$usethreads" in
18301 ":define") d_setlocale_r_proto=define
18302 set d_setlocale_r_proto setlocale_r $hdrs
18306 case "$d_setlocale_r_proto" in
18308 case "$setlocale_r_proto" in
18309 ''|0) try='int setlocale_r(int, const char*, char*, int);'
18310 ./protochk "$extern_C $try" $hdrs && setlocale_r_proto=I_ICBI ;;
18312 case "$setlocale_r_proto" in
18313 ''|0) d_setlocale_r=undef
18314 setlocale_r_proto=0
18315 echo "Disabling setlocale_r, cannot determine prototype." >&4 ;;
18316 * ) case "$setlocale_r_proto" in
18317 REENTRANT_PROTO*) ;;
18318 *) setlocale_r_proto="REENTRANT_PROTO_$setlocale_r_proto" ;;
18320 echo "Prototype: $try" ;;
18323 *) case "$usethreads" in
18324 define) echo "setlocale_r has no prototype, not using it." >&4 ;;
18326 d_setlocale_r=undef
18327 setlocale_r_proto=0
18331 *) setlocale_r_proto=0
18335 : see if setnetent exists
18336 set setnetent d_setnent
18339 : see if setnetent_r exists
18340 set setnetent_r d_setnetent_r
18342 case "$d_setnetent_r" in
18344 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
18345 case "$d_setnetent_r_proto:$usethreads" in
18346 ":define") d_setnetent_r_proto=define
18347 set d_setnetent_r_proto setnetent_r $hdrs
18351 case "$d_setnetent_r_proto" in
18353 case "$setnetent_r_proto" in
18354 ''|0) try='int setnetent_r(int, struct netent_data*);'
18355 ./protochk "$extern_C $try" $hdrs && setnetent_r_proto=I_ID ;;
18357 case "$setnetent_r_proto" in
18358 ''|0) try='void setnetent_r(int, struct netent_data*);'
18359 ./protochk "$extern_C $try" $hdrs && setnetent_r_proto=V_ID ;;
18361 case "$setnetent_r_proto" in
18362 ''|0) d_setnetent_r=undef
18363 setnetent_r_proto=0
18364 echo "Disabling setnetent_r, cannot determine prototype." >&4 ;;
18365 * ) case "$setnetent_r_proto" in
18366 REENTRANT_PROTO*) ;;
18367 *) setnetent_r_proto="REENTRANT_PROTO_$setnetent_r_proto" ;;
18369 echo "Prototype: $try" ;;
18372 *) case "$usethreads" in
18373 define) echo "setnetent_r has no prototype, not using it." >&4 ;;
18375 d_setnetent_r=undef
18376 setnetent_r_proto=0
18380 *) setnetent_r_proto=0
18384 : see if setprotoent exists
18385 set setprotoent d_setpent
18388 : see if setpgid exists
18389 set setpgid d_setpgid
18392 : see if setpgrp2 exists
18393 set setpgrp2 d_setpgrp2
18396 : see if setpriority exists
18397 set setpriority d_setprior
18400 : see if setproctitle exists
18401 set setproctitle d_setproctitle
18404 : see if setprotoent_r exists
18405 set setprotoent_r d_setprotoent_r
18407 case "$d_setprotoent_r" in
18409 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
18410 case "$d_setprotoent_r_proto:$usethreads" in
18411 ":define") d_setprotoent_r_proto=define
18412 set d_setprotoent_r_proto setprotoent_r $hdrs
18416 case "$d_setprotoent_r_proto" in
18418 case "$setprotoent_r_proto" in
18419 ''|0) try='int setprotoent_r(int, struct protoent_data*);'
18420 ./protochk "$extern_C $try" $hdrs && setprotoent_r_proto=I_ID ;;
18422 case "$setprotoent_r_proto" in
18423 ''|0) try='void setprotoent_r(int, struct protoent_data*);'
18424 ./protochk "$extern_C $try" $hdrs && setprotoent_r_proto=V_ID ;;
18426 case "$setprotoent_r_proto" in
18427 ''|0) d_setprotoent_r=undef
18428 setprotoent_r_proto=0
18429 echo "Disabling setprotoent_r, cannot determine prototype." >&4 ;;
18430 * ) case "$setprotoent_r_proto" in
18431 REENTRANT_PROTO*) ;;
18432 *) setprotoent_r_proto="REENTRANT_PROTO_$setprotoent_r_proto" ;;
18434 echo "Prototype: $try" ;;
18437 *) case "$usethreads" in
18438 define) echo "setprotoent_r has no prototype, not using it." >&4 ;;
18440 d_setprotoent_r=undef
18441 setprotoent_r_proto=0
18445 *) setprotoent_r_proto=0
18449 : see if setpwent exists
18450 set setpwent d_setpwent
18453 : see if setpwent_r exists
18454 set setpwent_r d_setpwent_r
18456 case "$d_setpwent_r" in
18458 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
18459 case "$d_setpwent_r_proto:$usethreads" in
18460 ":define") d_setpwent_r_proto=define
18461 set d_setpwent_r_proto setpwent_r $hdrs
18465 case "$d_setpwent_r_proto" in
18467 case "$setpwent_r_proto" in
18468 ''|0) try='int setpwent_r(FILE**);'
18469 ./protochk "$extern_C $try" $hdrs && setpwent_r_proto=I_H ;;
18471 case "$setpwent_r_proto" in
18472 ''|0) try='void setpwent_r(FILE**);'
18473 ./protochk "$extern_C $try" $hdrs && setpwent_r_proto=V_H ;;
18475 case "$setpwent_r_proto" in
18476 ''|0) d_setpwent_r=undef
18478 echo "Disabling setpwent_r, cannot determine prototype." >&4 ;;
18479 * ) case "$setpwent_r_proto" in
18480 REENTRANT_PROTO*) ;;
18481 *) setpwent_r_proto="REENTRANT_PROTO_$setpwent_r_proto" ;;
18483 echo "Prototype: $try" ;;
18486 *) case "$usethreads" in
18487 define) echo "setpwent_r has no prototype, not using it." >&4 ;;
18494 *) setpwent_r_proto=0
18498 : see if setregid exists
18499 set setregid d_setregid
18501 set setresgid d_setresgid
18504 : see if setreuid exists
18505 set setreuid d_setreuid
18507 set setresuid d_setresuid
18510 : see if setrgid exists
18511 set setrgid d_setrgid
18514 : see if setruid exists
18515 set setruid d_setruid
18518 : see if setservent exists
18519 set setservent d_setsent
18522 : see if setservent_r exists
18523 set setservent_r d_setservent_r
18525 case "$d_setservent_r" in
18527 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
18528 case "$d_setservent_r_proto:$usethreads" in
18529 ":define") d_setservent_r_proto=define
18530 set d_setservent_r_proto setservent_r $hdrs
18534 case "$d_setservent_r_proto" in
18536 case "$setservent_r_proto" in
18537 ''|0) try='int setservent_r(int, struct servent_data*);'
18538 ./protochk "$extern_C $try" $hdrs && setservent_r_proto=I_ID ;;
18540 case "$setservent_r_proto" in
18541 ''|0) try='void setservent_r(int, struct servent_data*);'
18542 ./protochk "$extern_C $try" $hdrs && setservent_r_proto=V_ID ;;
18544 case "$setservent_r_proto" in
18545 ''|0) d_setservent_r=undef
18546 setservent_r_proto=0
18547 echo "Disabling setservent_r, cannot determine prototype." >&4 ;;
18548 * ) case "$setservent_r_proto" in
18549 REENTRANT_PROTO*) ;;
18550 *) setservent_r_proto="REENTRANT_PROTO_$setservent_r_proto" ;;
18552 echo "Prototype: $try" ;;
18555 *) case "$usethreads" in
18556 define) echo "setservent_r has no prototype, not using it." >&4 ;;
18558 d_setservent_r=undef
18559 setservent_r_proto=0
18563 *) setservent_r_proto=0
18567 : see if setsid exists
18568 set setsid d_setsid
18571 : see if setvbuf exists
18572 set setvbuf d_setvbuf
18575 : see if shmctl exists
18576 set shmctl d_shmctl
18579 : see if shmget exists
18580 set shmget d_shmget
18583 : see if shmat exists
18586 : see what shmat returns
18589 $cat >shmat.c <<'END'
18590 #include <sys/shm.h>
18593 if $cc $ccflags -c shmat.c >/dev/null 2>&1; then
18598 echo "and it returns ($shmattype)." >&4
18599 : see if a prototype for shmat is available
18600 xxx=`./findhdr sys/shm.h`
18601 $cppstdin $cppflags $cppminus < $xxx > shmat.c 2>/dev/null
18602 if $contains 'shmat.*(' shmat.c >/dev/null 2>&1; then
18613 set d_shmatprototype
18616 : see if shmdt exists
18620 : see how much of the 'shm*(2)' library is present.
18623 case "$d_shmctl$d_shmget$d_shmat$d_shmdt" in
18624 *"$undef"*) h_shm=false;;
18628 case "`ipcs 2>&1`" in
18629 "SVID shared memory"*"not configured"*)
18630 echo "Your $osname does not have the shm*(2) configured." >&4
18633 set shmctl d_shmctl
18635 set shmget d_shmget
18645 : we could also check for sys/ipc.h ...
18646 if $h_shm && $test `./findhdr sys/shm.h`; then
18647 echo "You have the full shm*(2) library." >&4
18650 echo "You don't have the full shm*(2) library." >&4
18656 : see if we have sigaction
18658 if set sigaction val -f d_sigaction; eval $csym; $val; then
18659 echo 'sigaction() found.' >&4
18662 #include <sys/types.h>
18663 #include <signal.h>
18664 #$i_stdlib I_STDLIB
18666 #include <stdlib.h>
18670 struct sigaction act, oact;
18672 oact.sa_handler = 0;
18673 /* so that act and oact are used */
18674 exit(act.sa_flags == 0 && oact.sa_handler == 0);
18678 if eval $compile_ok; then
18681 echo "But you don't seem to have a usable struct sigaction." >&4
18685 echo 'sigaction NOT found.' >&4
18688 set d_sigaction; eval $setvar
18691 : see if this is a sunmath.h system
18692 set sunmath.h i_sunmath
18695 : see if signbit exists
18696 $echo $n "Checking to see if you have signbit() available to work on $nvtype... $c" >&4
18699 #$i_sunmath I_SUNMATH
18703 #ifdef I_SUNMATH /* Solaris special math library */
18704 # include <sunmath.h>
18707 int main(int argc, char **argv)
18711 if ((signbit(x) == 0) && (signbit(y) != 0))
18719 if eval $compile; then
18720 if $run ./try; then
18724 $echo "Signbit seems to be available, but doesn't work as I expected."
18725 $echo "I won't use it." >&4
18736 : see if sigprocmask exists
18737 set sigprocmask d_sigprocmask
18740 : see if sigsetjmp exists
18742 case "$d_sigsetjmp" in
18745 #include <setjmp.h>
18746 #$i_stdlib I_STDLIB
18748 #include <stdlib.h>
18754 if (sigsetjmp(env,1))
18757 siglongjmp(env, 1);
18762 if eval $compile; then
18763 if $run ./try >/dev/null 2>&1; then
18764 echo "POSIX sigsetjmp found." >&4
18768 Uh-Oh! You have POSIX sigsetjmp and siglongjmp, but they do not work properly!!
18774 echo "sigsetjmp not found." >&4
18778 *) val="$d_sigsetjmp"
18779 case "$d_sigsetjmp" in
18780 $define) echo "POSIX sigsetjmp found." >&4;;
18781 $undef) echo "sigsetjmp not found." >&4;;
18789 : see if snprintf exists
18790 set snprintf d_snprintf
18793 : see if vsnprintf exists
18794 set vsnprintf d_vsnprintf
18797 case "$d_snprintf-$d_vsnprintf" in
18800 Checking whether your snprintf() and vsnprintf() work okay...
18802 $cat >try.c <<'EOCP'
18803 /* v?snprintf testing logic courtesy of Russ Allbery.
18804 * According to C99:
18805 * - if the buffer is too short it still must be \0-terminated
18806 * - if the buffer is too short the potentially required length
18807 * must be returned and not -1
18808 * - if the buffer is NULL the potentially required length
18809 * must be returned and not -1 or core dump
18812 #include <stdarg.h>
18816 int test (char *format, ...)
18821 va_start (args, format);
18822 count = vsnprintf (buf, sizeof buf, format, args);
18829 return ((test ("%s", "abcd") == 4 && buf[0] == 'a' && buf[1] == '\0'
18830 && snprintf (NULL, 0, "%s", "abcd") == 4) ? 0 : 1);
18834 if eval $compile; then
18837 0) echo "Your snprintf() and vsnprintf() seem to be working okay." ;;
18839 Your snprintf() and snprintf() don't seem to be working okay.
18841 d_snprintf="$undef"
18842 d_vsnprintf="$undef"
18846 echo "(I can't seem to compile the test program--assuming they don't)"
18847 d_snprintf="$undef"
18848 d_vsnprintf="$undef"
18854 : see if sockatmark exists
18855 set sockatmark d_sockatmark
18858 : see if prototype for sockatmark is available
18860 set d_sockatmarkproto sockatmark $d_socket sys/socket.h
18863 : see if socks5_init exists
18864 set socks5_init d_socks5_init
18867 : see if sprintf returns the length of the string in the buffer as per ANSI
18868 $echo "Checking whether sprintf returns the length of the string..." >&4
18871 #$i_stdlib I_STDLIB
18873 #include <stdlib.h>
18875 #$i_string I_STRING
18877 # include <string.h>
18879 # include <strings.h>
18888 int check (size_t expect, int test) {
18889 size_t got = strlen(buffer);
18893 printf("expected %ld, got %ld in test %d '%s'\n", (long) expect, (long) got,
18898 int main(int argc, char **argv) {
18901 check(sprintf(buffer, ""), ++test);
18902 check(sprintf(buffer, "%s %s", "perl", "rules"), ++test);
18903 check(sprintf(buffer, "I like %g", atan2(0,-1)), ++test);
18910 if eval $compile; then
18914 sprintf returns the length of the string (as ANSI says it should)
18916 d_sprintf_returns_strlen="$define"
18919 sprintf does not return the length of the string (how old is this system?)
18921 d_sprintf_returns_strlen="$undef"
18925 echo "(I can't seem to compile the test program--assuming it doesn't)" >&4
18926 d_sprintf_returns_strlen="$undef"
18930 : see if srand48_r exists
18931 set srand48_r d_srand48_r
18933 case "$d_srand48_r" in
18935 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
18936 case "$d_srand48_r_proto:$usethreads" in
18937 ":define") d_srand48_r_proto=define
18938 set d_srand48_r_proto srand48_r $hdrs
18942 case "$d_srand48_r_proto" in
18944 case "$srand48_r_proto" in
18945 ''|0) try='int srand48_r(long, struct drand48_data*);'
18946 ./protochk "$extern_C $try" $hdrs && srand48_r_proto=I_LS ;;
18948 case "$srand48_r_proto" in
18949 ''|0) d_srand48_r=undef
18951 echo "Disabling srand48_r, cannot determine prototype." >&4 ;;
18952 * ) case "$srand48_r_proto" in
18953 REENTRANT_PROTO*) ;;
18954 *) srand48_r_proto="REENTRANT_PROTO_$srand48_r_proto" ;;
18956 echo "Prototype: $try" ;;
18959 *) case "$usethreads" in
18960 define) echo "srand48_r has no prototype, not using it." >&4 ;;
18967 *) srand48_r_proto=0
18971 : see if srandom_r exists
18972 set srandom_r d_srandom_r
18974 case "$d_srandom_r" in
18976 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
18977 case "$d_srandom_r_proto:$usethreads" in
18978 ":define") d_srandom_r_proto=define
18979 set d_srandom_r_proto srandom_r $hdrs
18983 case "$d_srandom_r_proto" in
18985 case "$srandom_r_proto" in
18986 ''|0) try='int srandom_r(unsigned int, struct random_data*);'
18987 ./protochk "$extern_C $try" $hdrs && srandom_r_proto=I_TS ;;
18989 case "$srandom_r_proto" in
18990 ''|0) d_srandom_r=undef
18992 echo "Disabling srandom_r, cannot determine prototype." >&4 ;;
18993 * ) case "$srandom_r_proto" in
18994 REENTRANT_PROTO*) ;;
18995 *) srandom_r_proto="REENTRANT_PROTO_$srandom_r_proto" ;;
18997 echo "Prototype: $try" ;;
19000 *) case "$usethreads" in
19001 define) echo "srandom_r has no prototype, not using it." >&4 ;;
19008 *) srandom_r_proto=0
19012 : see if prototype for setresgid is available
19014 set d_sresgproto setresgid $i_unistd unistd.h
19017 : see if prototype for setresuid is available
19019 set d_sresuproto setresuid $i_unistd unistd.h
19022 : see if stat exists
19026 : see if sys/stat.h is available
19027 set sys/stat.h i_sysstat
19030 : see if stat knows about block sizes
19032 echo "Checking to see if your struct stat has st_blocks field..." >&4
19033 set d_statblks stat st_blocks $i_sysstat sys/stat.h
19036 : see if this is a sys/vfs.h system
19037 set sys/vfs.h i_sysvfs
19040 : see if this is a sys/statfs.h system
19041 set sys/statfs.h i_sysstatfs
19044 : Check for statfs_s
19046 echo "Checking to see if your system supports struct statfs..." >&4
19047 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
19049 case "$d_statfs_s" in
19050 "$define") echo "Yes, it does." ;;
19051 *) echo "No, it doesn't." ;;
19055 : see if struct statfs knows about f_flags
19056 case "$d_statfs_s" in
19059 echo "Checking to see if your struct statfs has f_flags field..." >&4
19060 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
19064 set d_statfs_f_flags
19068 case "$d_statfs_f_flags" in
19069 "$define") echo "Yes, it does." ;;
19070 *) echo "No, it doesn't." ;;
19073 : see what flavor, if any, of static inline is supported
19075 echo "Checking to see if your system supports static inline..."
19076 $cat > try.c <<'EOCP'
19077 #include <stdlib.h>
19078 extern int f_via_a(int x);
19079 extern int f_via_b(int x);
19080 int main(int argc, char **argv)
19089 return EXIT_SUCCESS;
19092 return EXIT_FAILURE;
19096 $cat > a.c <<'EOCP'
19097 static INLINE int f(int x) {
19108 $cat > b.c <<'EOCP'
19109 extern int f(int x);
19117 # Respect a hint (or previous) value for perl_static_inline, if there is one.
19118 case "$perl_static_inline" in
19119 '') # Check the various possibilities, and break out on success.
19120 # For gcc, prefer __inline__, which will still permit
19121 # cflags.SH to add in -ansi.
19122 case "$gccversion" in
19123 '') xxx="inline __inline__ __inline _inline";;
19124 *) xxx="__inline__ inline __inline _inline";;
19126 for inline in $xxx; do
19127 set try -DINLINE=$inline a.c
19128 if eval $compile && $run ./try; then
19129 # Now make sure there is no external linkage of static
19131 set try -DINLINE=$inline -DUSE_B a.c b.c
19132 if eval $compile && $run ./try; then
19133 $echo "Your compiler supports static $inline, " >&4
19134 $echo "but it also creates an external definition," >&4
19135 $echo "so I won't use it." >&4
19138 $echo "Your compiler supports static $inline." >&4
19140 perl_static_inline="static $inline";
19144 $echo "Your compiler does NOT support static $inline." >&4
19149 *inline*) # Some variant of inline exists.
19150 echo "Keeping your $hint value of $perl_static_inline."
19153 static) # No inline capabilities
19154 echo "Keeping your $hint value of $perl_static_inline."
19157 *) # Unrecognized previous value -- blindly trust the supplied
19158 # value and hope it makes sense. Use old value for
19159 # d_static_inline, if there is one.
19160 echo "Keeping your $hint value of $perl_static_inline."
19161 case "$d_static_inline" in
19163 *) val=$d_static_inline ;;
19167 # Fallback to plain 'static' if nothing worked.
19168 case "$perl_static_inline" in
19170 perl_static_inline="static"
19174 set d_static_inline
19176 $rm -f a.[co] b.[co]
19179 : Check stream access
19181 Checking how to access stdio streams by file descriptor number...
19183 case "$stdio_stream_array" in
19184 '') $cat >try.c <<EOCP
19187 if (&STDIO_STREAM_ARRAY[fileno(stdin)] == stdin)
19191 for s in _iob __iob __sF
19193 set try -DSTDIO_STREAM_ARRAY=$s
19194 if eval $compile; then
19195 case "`$run ./try`" in
19196 yes) stdio_stream_array=$s; break ;;
19202 case "$stdio_stream_array" in
19204 I can't figure out how to access stdio streams by file descriptor number.
19206 d_stdio_stream_array="$undef"
19209 You can access stdio streams by file descriptor number by the $stdio_stream_array array.
19211 d_stdio_stream_array="$define"
19215 : see if strcoll exists
19216 set strcoll d_strcoll
19219 : check for structure copying
19221 echo "Checking to see if your C compiler can copy structs..." >&4
19222 $cat >try.c <<'EOCP'
19232 if $cc -c try.c >/dev/null 2>&1 ; then
19234 echo "Yup, it can."
19237 echo "Nope, it can't."
19243 : see if strerror and/or sys_errlist[] exist
19245 if test "X$d_strerror" = X -o "X$d_syserrlst" = X; then
19246 if set strerror val -f d_strerror; eval $csym; $val; then
19247 echo 'strerror() found.' >&4
19248 d_strerror="$define"
19249 d_strerrm='strerror(e)'
19250 if set sys_errlist val -a d_syserrlst; eval $csym; $val; then
19251 echo "(You also have sys_errlist[], so we could roll our own strerror.)"
19252 d_syserrlst="$define"
19254 echo "(Since you don't have sys_errlist[], strerror() is welcome.)"
19255 d_syserrlst="$undef"
19257 elif xxx=`./findhdr string.h`; test "$xxx" || xxx=`./findhdr strings.h`; \
19258 $contains '#[ ]*define.*strerror' "$xxx" >/dev/null 2>&1; then
19259 echo 'strerror() found in string header.' >&4
19260 d_strerror="$define"
19261 d_strerrm='strerror(e)'
19262 if set sys_errlist val -a d_syserrlst; eval $csym; $val; then
19263 echo "(Most probably, strerror() uses sys_errlist[] for descriptions.)"
19264 d_syserrlst="$define"
19266 echo "(You don't appear to have any sys_errlist[], how can this be?)"
19267 d_syserrlst="$undef"
19269 elif set sys_errlist val -a d_syserrlst; eval $csym; $val; then
19270 echo "strerror() not found, but you have sys_errlist[] so we'll use that." >&4
19271 d_strerror="$undef"
19272 d_syserrlst="$define"
19273 d_strerrm='((e)<0||(e)>=sys_nerr?"unknown":sys_errlist[e])'
19275 echo 'strerror() and sys_errlist[] NOT found.' >&4
19276 d_strerror="$undef"
19277 d_syserrlst="$undef"
19278 d_strerrm='"unknown"'
19282 : see if strerror_r exists
19283 set strerror_r d_strerror_r
19285 case "$d_strerror_r" in
19287 hdrs="$i_systypes sys/types.h define stdio.h $i_string string.h"
19288 case "$d_strerror_r_proto:$usethreads" in
19289 ":define") d_strerror_r_proto=define
19290 set d_strerror_r_proto strerror_r $hdrs
19294 case "$d_strerror_r_proto" in
19296 case "$strerror_r_proto" in
19297 ''|0) try='int strerror_r(int, char*, size_t);'
19298 ./protochk "$extern_C $try" $hdrs && strerror_r_proto=I_IBW ;;
19300 case "$strerror_r_proto" in
19301 ''|0) try='int strerror_r(int, char*, int);'
19302 ./protochk "$extern_C $try" $hdrs && strerror_r_proto=I_IBI ;;
19304 case "$strerror_r_proto" in
19305 ''|0) try='char* strerror_r(int, char*, size_t);'
19306 ./protochk "$extern_C $try" $hdrs && strerror_r_proto=B_IBW ;;
19308 case "$strerror_r_proto" in
19309 ''|0) d_strerror_r=undef
19311 echo "Disabling strerror_r, cannot determine prototype." >&4 ;;
19312 * ) case "$strerror_r_proto" in
19313 REENTRANT_PROTO*) ;;
19314 *) strerror_r_proto="REENTRANT_PROTO_$strerror_r_proto" ;;
19316 echo "Prototype: $try" ;;
19319 *) case "$usethreads" in
19320 define) echo "strerror_r has no prototype, not using it." >&4 ;;
19327 *) strerror_r_proto=0
19331 : see if strftime exists
19332 set strftime d_strftime
19335 : see if strlcat exists
19336 set strlcat d_strlcat
19339 : see if strlcpy exists
19340 set strlcpy d_strlcpy
19343 : see if strtod exists
19344 set strtod d_strtod
19347 : see if strtol exists
19348 set strtol d_strtol
19351 : see if strtold exists
19352 set strtold d_strtold
19355 : see if strtoll exists
19356 set strtoll d_strtoll
19359 case "$d_longlong-$d_strtoll" in
19362 Checking whether your strtoll() works okay...
19364 $cat >try.c <<'EOCP'
19367 #define strtoll __strtoll
19370 #define strtoll _strtoll
19373 extern long long int strtoll(char *s, char **, int);
19374 static int bad = 0;
19375 int check(char *s, long long ell, int een) {
19378 gll = strtoll(s, 0, 10);
19379 if (!((gll == ell) && (errno == een)))
19383 check(" 1", 1LL, 0);
19384 check(" 0", 0LL, 0);
19385 check("-1", -1LL, 0);
19386 check("-9223372036854775808", -9223372036854775808LL, 0);
19387 check("-9223372036854775808", -9223372036854775808LL, 0);
19388 check(" 9223372036854775807", 9223372036854775807LL, 0);
19389 check("-9223372036854775808", -9223372036854775808LL, 0);
19390 check(" 9223372036854775808", 9223372036854775807LL, ERANGE);
19391 check("-9223372036854775809", -9223372036854775808LL, ERANGE);
19397 if eval $compile; then
19400 ok) echo "Your strtoll() seems to be working okay." ;;
19402 Your strtoll() doesn't seem to be working okay.
19408 echo "(I can't seem to compile the test program--assuming it doesn't)"
19414 : see if strtoq exists
19415 set strtoq d_strtoq
19418 : see if strtoul exists
19419 set strtoul d_strtoul
19422 case "$d_strtoul" in
19425 Checking whether your strtoul() works okay...
19427 $cat >try.c <<'EOCP'
19430 extern unsigned long int strtoul(char *s, char **, int);
19431 static int bad = 0;
19432 void check(char *s, unsigned long eul, int een) {
19435 gul = strtoul(s, 0, 10);
19436 if (!((gul == eul) && (errno == een)))
19440 check(" 1", 1L, 0);
19441 check(" 0", 0L, 0);
19443 case "$longsize" in
19445 $cat >>try.c <<'EOCP'
19446 check("18446744073709551615", 18446744073709551615UL, 0);
19447 check("18446744073709551616", 18446744073709551615UL, ERANGE);
19448 #if 0 /* strtoul() for /^-/ strings is undefined. */
19449 check("-1", 18446744073709551615UL, 0);
19450 check("-18446744073709551614", 2, 0);
19451 check("-18446744073709551615", 1, 0);
19452 check("-18446744073709551616", 18446744073709551615UL, ERANGE);
19453 check("-18446744073709551617", 18446744073709551615UL, ERANGE);
19458 $cat >>try.c <<'EOCP'
19459 check("4294967295", 4294967295UL, 0);
19460 check("4294967296", 4294967295UL, ERANGE);
19461 #if 0 /* strtoul() for /^-/ strings is undefined. */
19462 check("-1", 4294967295UL, 0);
19463 check("-4294967294", 2, 0);
19464 check("-4294967295", 1, 0);
19465 check("-4294967296", 4294967295UL, ERANGE);
19466 check("-4294967297", 4294967295UL, ERANGE);
19471 : Should we write these tests to be more portable by sprintf-ing
19472 : ~0 and then manipulating that char string as input for strtol?
19475 $cat >>try.c <<'EOCP'
19482 if eval $compile; then
19483 case "`$run ./try`" in
19484 ok) echo "Your strtoul() seems to be working okay." ;;
19486 Your strtoul() doesn't seem to be working okay.
19492 echo "(I can't seem to compile the test program--assuming it doesn't)"
19498 : see if strtoull exists
19499 set strtoull d_strtoull
19502 case "$d_longlong-$d_strtoull" in
19505 Checking whether your strtoull() works okay...
19507 $cat >try.c <<'EOCP'
19510 #define strtoull __strtoull
19513 extern unsigned long long int strtoull(char *s, char **, int);
19514 static int bad = 0;
19515 int check(char *s, long long eull, int een) {
19518 gull = strtoull(s, 0, 10);
19519 if (!((gull == eull) && (errno == een)))
19523 check(" 1", 1LL, 0);
19524 check(" 0", 0LL, 0);
19525 check("18446744073709551615", 18446744073709551615ULL, 0);
19526 check("18446744073709551616", 18446744073709551615ULL, ERANGE);
19527 #if 0 /* strtoull() for /^-/ strings is undefined. */
19528 check("-1", 18446744073709551615ULL, 0);
19529 check("-18446744073709551614", 2LL, 0);
19530 check("-18446744073709551615", 1LL, 0);
19531 check("-18446744073709551616", 18446744073709551615ULL, ERANGE);
19532 check("-18446744073709551617", 18446744073709551615ULL, ERANGE);
19539 if eval $compile; then
19540 case "`$run ./try`" in
19541 ok) echo "Your strtoull() seems to be working okay." ;;
19543 Your strtoull() doesn't seem to be working okay.
19545 d_strtoull="$undef"
19549 echo "(I can't seem to compile the test program--assuming it doesn't)"
19550 d_strtoull="$undef"
19555 : see if strtouq exists
19556 set strtouq d_strtouq
19559 case "$d_strtouq" in
19562 Checking whether your strtouq() works okay...
19564 $cat >try.c <<'EOCP'
19567 extern unsigned long long int strtouq(char *s, char **, int);
19568 static int bad = 0;
19569 void check(char *s, unsigned long long eull, int een) {
19570 unsigned long long gull;
19572 gull = strtouq(s, 0, 10);
19573 if (!((gull == eull) && (errno == een)))
19577 check(" 1", 1LL, 0);
19578 check(" 0", 0LL, 0);
19579 check("18446744073709551615", 18446744073709551615ULL, 0);
19580 check("18446744073709551616", 18446744073709551615ULL, ERANGE);
19581 #if 0 /* strtouq() for /^-/ strings is undefined. */
19582 check("-1", 18446744073709551615ULL, 0);
19583 check("-18446744073709551614", 2LL, 0);
19584 check("-18446744073709551615", 1LL, 0);
19585 check("-18446744073709551616", 18446744073709551615ULL, ERANGE);
19586 check("-18446744073709551617", 18446744073709551615ULL, ERANGE);
19594 if eval $compile; then
19595 case "`$run ./try`" in
19596 ok) echo "Your strtouq() seems to be working okay." ;;
19598 Your strtouq() doesn't seem to be working okay.
19604 echo "(I can't seem to compile the test program--assuming it doesn't)"
19610 : see if strxfrm exists
19611 set strxfrm d_strxfrm
19614 : see if symlink exists
19615 set symlink d_symlink
19618 : see if syscall exists
19619 set syscall d_syscall
19622 : see if prototype for syscall is available
19624 set d_syscallproto syscall $i_unistd unistd.h
19627 : see if sysconf exists
19628 set sysconf d_sysconf
19631 : see if system exists
19632 set system d_system
19635 : see if tcgetpgrp exists
19636 set tcgetpgrp d_tcgetpgrp
19639 : see if tcsetpgrp exists
19640 set tcsetpgrp d_tcsetpgrp
19643 : see if prototype for telldir is available
19645 set d_telldirproto telldir $i_systypes sys/types.h $i_dirent dirent.h
19648 : see if tgamma exists
19649 set tgamma d_tgamma
19652 : see if time exists
19654 if test "X$d_time" = X -o X"$timetype" = X; then
19655 if set time val -f d_time; eval $csym; $val; then
19656 echo 'time() found.' >&4
19658 rp="What is the type returned by time() on this system?"
19659 set time_t timetype long stdio.h sys/types.h
19662 echo 'time() not found, hope that will do.' >&4
19670 : see if timegm exists
19671 set timegm d_timegm
19674 : see if this is a sys/times.h system
19675 set sys/times.h i_systimes
19678 : see if times exists
19680 if set times val -f d_times; eval $csym; $val; then
19681 echo 'times() found.' >&4
19684 case "$i_systimes" in
19685 "$define") inc='sys/times.h';;
19687 rp="What is the type returned by times() on this system?"
19688 set clock_t clocktype long stdio.h sys/types.h $inc
19691 echo 'times() NOT found, hope that will do.' >&4
19696 : see if tmpnam_r exists
19697 set tmpnam_r d_tmpnam_r
19699 case "$d_tmpnam_r" in
19701 hdrs="$i_systypes sys/types.h define stdio.h "
19702 case "$d_tmpnam_r_proto:$usethreads" in
19703 ":define") d_tmpnam_r_proto=define
19704 set d_tmpnam_r_proto tmpnam_r $hdrs
19708 case "$d_tmpnam_r_proto" in
19710 case "$tmpnam_r_proto" in
19711 ''|0) try='char* tmpnam_r(char*);'
19712 ./protochk "$extern_C $try" $hdrs && tmpnam_r_proto=B_B ;;
19714 case "$tmpnam_r_proto" in
19715 ''|0) d_tmpnam_r=undef
19717 echo "Disabling tmpnam_r, cannot determine prototype." >&4 ;;
19718 * ) case "$tmpnam_r_proto" in
19719 REENTRANT_PROTO*) ;;
19720 *) tmpnam_r_proto="REENTRANT_PROTO_$tmpnam_r_proto" ;;
19722 echo "Prototype: $try" ;;
19725 *) case "$usethreads" in
19726 define) echo "tmpnam_r has no prototype, not using it." >&4 ;;
19733 *) tmpnam_r_proto=0
19737 : see if trunc exists
19741 : see if truncate exists
19742 set truncate d_truncate
19745 : see if ttyname_r exists
19746 set ttyname_r d_ttyname_r
19748 case "$d_ttyname_r" in
19750 hdrs="$i_systypes sys/types.h define stdio.h $i_unistd unistd.h"
19751 case "$d_ttyname_r_proto:$usethreads" in
19752 ":define") d_ttyname_r_proto=define
19753 set d_ttyname_r_proto ttyname_r $hdrs
19757 case "$d_ttyname_r_proto" in
19759 case "$ttyname_r_proto" in
19760 ''|0) try='int ttyname_r(int, char*, size_t);'
19761 ./protochk "$extern_C $try" $hdrs && ttyname_r_proto=I_IBW ;;
19763 case "$ttyname_r_proto" in
19764 ''|0) try='int ttyname_r(int, char*, int);'
19765 ./protochk "$extern_C $try" $hdrs && ttyname_r_proto=I_IBI ;;
19767 case "$ttyname_r_proto" in
19768 ''|0) try='char* ttyname_r(int, char*, int);'
19769 ./protochk "$extern_C $try" $hdrs && ttyname_r_proto=B_IBI ;;
19771 case "$ttyname_r_proto" in
19772 ''|0) d_ttyname_r=undef
19774 echo "Disabling ttyname_r, cannot determine prototype." >&4 ;;
19775 * ) case "$ttyname_r_proto" in
19776 REENTRANT_PROTO*) ;;
19777 *) ttyname_r_proto="REENTRANT_PROTO_$ttyname_r_proto" ;;
19779 echo "Prototype: $try" ;;
19782 *) case "$usethreads" in
19783 define) echo "ttyname_r has no prototype, not using it." >&4 ;;
19790 *) ttyname_r_proto=0
19794 : see if tzname[] exists
19796 if set tzname val -a d_tzname; eval $csym; $val; then
19798 echo 'tzname[] found.' >&4
19801 echo 'tzname[] NOT found.' >&4
19806 : Check if is a multiplatform env
19808 darwin) multiarch="$define" ;;
19810 case "$multiarch" in
19811 ''|[nN]*) multiarch="$undef" ;;
19814 : check for ordering of bytes in a UV
19816 case "$multiarch" in
19819 You seem to be doing a multiarchitecture build,
19820 skipping the byteorder check.
19826 case "$byteorder" in
19829 In the following, larger digits indicate more significance. A big-endian
19830 machine like a Pyramid or a Motorola 680?0 chip will come out to 4321. A
19831 little-endian machine like a Vax or an Intel 80?86 chip would be 1234. Other
19832 machines may have weird orders like 3412. A Cray will report 87654321,
19833 an Alpha will report 12345678. If the test program works the default is
19835 I'm now running the test program...
19839 #$i_stdlib I_STDLIB
19841 #include <stdlib.h>
19843 #include <sys/types.h>
19844 typedef $uvtype UV;
19854 u.l = (((UV)0x08070605) << 32) | (UV)0x04030201;
19856 u.l = (UV)0x04030201;
19857 for (i = 0; i < $uvsize; i++)
19858 printf("%c", u.c[i]+'0');
19865 if eval $compile && $run ./try > /dev/null; then
19868 [1-4][1-4][1-4][1-4]|12345678|87654321)
19869 echo "(The test program ran ok.)"
19870 echo "byteorder=$dflt"
19873 ????|????????) echo "(The test program ran ok.)" ;;
19874 *) echo "(The test program didn't run right for some reason.)" ;;
19879 (I can't seem to compile the test program. Guessing big-endian...)
19882 case "$xxx_prompt" in
19884 rp="What is the order of bytes in $uvtype?"
19897 : Checking 32bit alignedness
19900 Checking to see whether you can access character data unalignedly...
19902 case "$d_u32align" in
19903 '') $cat >try.c <<EOCP
19905 #$i_stdlib I_STDLIB
19907 #include <stdlib.h>
19909 #define U32 $u32type
19910 #define BYTEORDER 0x$byteorder
19912 #include <signal.h>
19914 $signal_t bletch(int s) { exit(4); }
19917 #if BYTEORDER == 0x1234 || BYTEORDER == 0x4321
19918 volatile U8 buf[8];
19922 if (sizeof(U32) != 4) {
19923 printf("sizeof(U32) is not 4, but %d\n", sizeof(U32));
19930 signal(SIGBUS, bletch);
19942 for (i = 0; i < 4; i++) {
19943 up = (U32*)(buf + i);
19944 if (! ((*up == 1 << (8*i)) || /* big-endian */
19945 (*up == 1 << (8*(3-i))) /* little-endian */
19949 printf("read failed (%x)\n", *up);
19955 for (i = 0; i < 4; i++) {
19956 up = (U32*)(buf + i);
19958 if (*up != 0xBeef) {
19959 printf("write failed (%x)\n", *up);
19973 if eval $compile_ok; then
19974 echo "(Testing for character data alignment may crash the test. That's okay.)" >&4
19975 $run ./try 2>&1 >/dev/null
19978 You can access character data pretty unalignedly.
19980 d_u32align="$undef"
19983 It seems that you must access character data in an aligned manner.
19985 d_u32align="$define"
19989 rp='Can you access character data at unaligned addresses?'
19993 [yY]*) d_u32align="$undef" ;;
19994 *) d_u32align="$define" ;;
20001 : see if ualarm exists
20002 set ualarm d_ualarm
20005 : see if umask exists
20009 : see if unordered exists
20010 set unordered d_unordered
20013 : see if unsetenv exists
20014 set unsetenv d_unsetenv
20017 : see if usleep exists
20018 set usleep d_usleep
20021 : see if prototype for usleep is available
20023 set d_usleepproto usleep $i_unistd unistd.h
20026 : see if ustat exists
20030 : see if closedir exists
20031 set closedir d_closedir
20034 case "$d_closedir" in
20037 echo "Checking whether closedir() returns a status..." >&4
20039 #$i_dirent I_DIRENT /**/
20040 #$i_sysdir I_SYS_DIR /**/
20041 #$i_sysndir I_SYS_NDIR /**/
20042 #$i_systypes I_SYS_TYPES /**/
20044 #if defined(I_SYS_TYPES)
20045 #include <sys/types.h>
20047 #if defined(I_DIRENT)
20048 #include <dirent.h>
20051 #include <sys/ndir.h>
20055 #include <ndir.h> /* may be wrong in the future */
20057 #include <sys/dir.h>
20062 int main() { return closedir(opendir(".")); }
20065 if eval $compile_ok; then
20066 if $run ./try > /dev/null 2>&1 ; then
20067 echo "Yes, it does."
20070 echo "No, it doesn't."
20074 echo "(I can't seem to compile the test program--assuming it doesn't)"
20082 set d_void_closedir
20086 : see if there is a wait4
20090 : see if waitpid exists
20091 set waitpid d_waitpid
20096 $cat >try.c <<'EOCP'
20102 return (wcscmp (s, s) ? 1 : 0);
20107 if eval $compile; then
20110 0) echo "A working wcscmp() found." >&4
20112 *) echo "wcscmp() found, but it doesn't work" >&4
20116 echo "wcscmp() NOT found." >&4
20122 : see if wcstombs exists
20123 set wcstombs d_wcstombs
20128 $cat >try.c <<'EOCP'
20133 wchar_t dst[4], *src = L" ";
20135 return (wcsxfrm (dst, src, 1) ? errno ? errno : 0 : 1);
20140 if eval $compile; then
20143 0) echo "A working wcsxfrm() found." >&4
20145 *) echo "wcsxfrm() found, but it doesn't work" >&4
20149 echo "wcsxfrm() NOT found." >&4
20155 : see if wctomb exists
20156 set wctomb d_wctomb
20159 : see if writev exists
20160 set writev d_writev
20163 : check for alignment requirements
20165 case "$alignbytes" in
20166 '') echo "Checking alignment constraints..." >&4
20167 if $test "X$uselongdouble" = Xdefine -a "X$d_longdbl" = Xdefine; then
20168 $cat >try.c <<'EOCP'
20169 typedef long double NV;
20172 $cat >try.c <<'EOCP'
20176 $cat >>try.c <<'EOCP'
20184 printf("%d\n", (int)((char *)&try_algn.bar - (char *)&try_algn.foo));
20189 if eval $compile_ok; then
20193 echo "(I can't seem to compile the test program...)"
20195 case "$multiarch" in
20197 : The usual safe value is 8, but Darwin with -Duselongdouble
20198 : needs 16. Hence, we will take 8 as a minimum, but allow
20199 : Configure to pick a larger value if needed.
20200 if $test "$dflt" -lt 8; then
20202 echo "Setting alignment to 8 for multiarch support.">&4
20207 *) dflt="$alignbytes"
20210 rp="Doubles must be aligned on a how-many-byte boundary?"
20215 : set the base revision
20218 : length of character in bytes. Is always 1, otherwise it is not C
20219 : This used to be a test using sizeof
20222 : Check for the number of bits in a character
20223 case "$charbits" in
20224 '') echo "Checking how long a character is (in bits)..." >&4
20231 for (c = 1, n = 0; c; c <<= 1, n++) ;
20232 printf ("%d\n", n);
20237 if eval $compile_ok; then
20241 echo "(I can't seem to compile the test program. Guessing...)"
20248 rp="What is the length of a character (in bits)?"
20252 case "$charbits" in
20255 Your system has an unsigned character size of $charbits bits, which
20256 is rather unusual (normally it is 8 bits). Perl likely will not work
20257 correctly on your system, with subtle bugs in various places.
20259 rp='Do you really want to continue?'
20263 [yY]) echo >&4 "Okay, continuing." ;;
20268 : how do we concatenate cpp tokens here?
20270 echo "Checking to see how your cpp does stuff like concatenate tokens..." >&4
20271 $cat >cpp_stuff.c <<'EOCP'
20272 #define RCAT(a,b)a/**/b
20273 #define ACAT(a,b)a ## b
20277 $cppstdin $cppflags $cppminus <cpp_stuff.c >cpp_stuff.out 2>&1
20278 if $contains 'Circus' cpp_stuff.out >/dev/null 2>&1; then
20279 echo "Oh! Smells like ANSI's been here." >&4
20280 echo "We can catify or stringify, separately or together!"
20282 elif $contains 'Reiser' cpp_stuff.out >/dev/null 2>&1; then
20283 echo "Ah, yes! The good old days!" >&4
20284 echo "However, in the good old days we don't know how to stringify and"
20285 echo "catify at the same time."
20289 Hmm, I don't seem to be able to concatenate tokens with your cpp.
20290 You're going to have to edit the values of CAT[2-5] in config.h...
20292 cpp_stuff="/* Help! How do we handle cpp_stuff? */*/"
20296 : see if this is a db.h system
20302 : Check db version.
20304 echo "Checking Berkeley DB version ..." >&4
20310 #include <sys/types.h>
20312 #$i_stdlib I_STDLIB
20314 #include <stdlib.h>
20317 int main(int argc, char *argv[])
20319 #ifdef DB_VERSION_MAJOR /* DB version >= 2 */
20320 int Major, Minor, Patch ;
20321 unsigned long Version ;
20322 (void)db_version(&Major, &Minor, &Patch) ;
20324 printf("%d %d %d %d %d %d\n",
20325 DB_VERSION_MAJOR, DB_VERSION_MINOR, DB_VERSION_PATCH,
20326 Major, Minor, Patch);
20329 printf("You have Berkeley DB Version 2 or greater.\n");
20331 printf("db.h is from Berkeley DB Version %d.%d.%d\n",
20332 DB_VERSION_MAJOR, DB_VERSION_MINOR, DB_VERSION_PATCH);
20333 printf("libdb is from Berkeley DB Version %d.%d.%d\n",
20334 Major, Minor, Patch) ;
20336 /* check that db.h & libdb are compatible */
20337 if (DB_VERSION_MAJOR != Major || DB_VERSION_MINOR != Minor || DB_VERSION_PATCH != Patch) {
20338 printf("db.h and libdb are incompatible.\n") ;
20342 printf("db.h and libdb are compatible.\n") ;
20344 Version = DB_VERSION_MAJOR * 1000000 + DB_VERSION_MINOR * 1000
20345 + DB_VERSION_PATCH ;
20347 /* needs to be >= 2.3.4 */
20348 if (Version < 2003004) {
20349 /* if (DB_VERSION_MAJOR == 2 && DB_VERSION_MINOR == 0 && DB_VERSION_PATCH < 5) { */
20350 printf("Perl needs Berkeley DB 2.3.4 or greater.\n") ;
20356 #if defined(_DB_H_) && defined(BTREEMAGIC) && defined(HASHMAGIC)
20361 printf("You have Berkeley DB Version 1.\n");
20362 exit(0); /* DB version < 2: the coast is clear. */
20364 exit(1); /* <db.h> not Berkeley DB? */
20370 if eval $compile_ok && $run ./try; then
20371 echo 'Looks OK.' >&4
20373 db_version_major=$1
20374 db_version_minor=$2
20375 db_version_patch=$3
20377 echo "I can't use Berkeley DB with your <db.h>. I'll disable Berkeley DB." >&4
20381 : Remove db from list of libraries to use
20382 echo "Removing unusable -ldb from library list" >&4
20383 set `echo X $libs | $sed -e 's/-ldb / /' -e 's/-ldb$//'`
20386 echo "libs = $libs" >&4
20396 : Check the return type needed for hash
20398 echo "Checking return type needed for hash for Berkeley DB ..." >&4
20404 #include <sys/types.h>
20407 #ifndef DB_VERSION_MAJOR
20408 u_int32_t hash_cb (const void* ptr, size_t size)
20414 info.hash = hash_cb;
20418 if $cc $ccflags -c try.c >try.out 2>&1 ; then
20419 if $contains warning try.out >>/dev/null 2>&1 ; then
20422 db_hashtype='u_int32_t'
20425 : XXX Maybe we should just give up here.
20426 db_hashtype=u_int32_t
20428 echo "Help: I can't seem to compile the db test program." >&4
20429 echo "Something's wrong, but I'll assume you use $db_hashtype." >&4
20432 echo "Your version of Berkeley DB uses $db_hashtype for hash."
20434 *) db_hashtype=u_int32_t
20439 : Check the return type needed for prefix
20441 echo "Checking return type needed for prefix for Berkeley DB ..." >&4
20447 #include <sys/types.h>
20450 #ifndef DB_VERSION_MAJOR
20451 size_t prefix_cb (const DBT *key1, const DBT *key2)
20457 info.prefix = prefix_cb;
20461 if $cc $ccflags -c try.c >try.out 2>&1 ; then
20462 if $contains warning try.out >>/dev/null 2>&1 ; then
20463 db_prefixtype='int'
20465 db_prefixtype='size_t'
20468 db_prefixtype='size_t'
20469 : XXX Maybe we should just give up here.
20471 echo "Help: I can't seem to compile the db test program." >&4
20472 echo "Something's wrong, but I'll assume you use $db_prefixtype." >&4
20475 echo "Your version of Berkeley DB uses $db_prefixtype for prefix."
20477 *) db_prefixtype='size_t'
20481 : Check what kind of inf/nan your system has
20482 $echo "Checking the kind of infinities and nans you have..." >&4
20484 #define DOUBLESIZE $doublesize
20485 #$d_longdbl HAS_LONG_DOUBLE
20486 #ifdef HAS_LONG_DOUBLE
20487 #define LONGDBLSIZE $longdblsize
20488 #define LONGDBLKIND $longdblkind
20495 /* Note that whether the sign bit is on or off
20496 * for NaN depends on the CPU/FPU, and possibly
20497 * can be affected by the build toolchain.
20499 * For example for older MIPS and HP-PA 2.0 the quiet NaN is:
20500 * 0x7f, 0xf7, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff
20501 * 0x7f, 0xf4, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
20502 * (respectively) as opposed to the more usual
20503 * 0x7f, 0xf8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
20505 static void bytes(unsigned char *p, unsigned int n) {
20507 for (i = 0; i < n; i++) {
20508 printf("0x%02x%s", p[i], i < n - 1 ? ", " : "\n");
20511 int main(int argc, char *argv[]) {
20512 /* We cannot use 1.0/0.0 and 0.0/0.0 (with L suffixes for long double)
20513 * because some compilers are 'smart' and not only warn but refuse to
20514 * compile such 'illegal' values. */
20515 double dinf = exp(1e9);
20516 double dnan = sqrt(-1.0);
20517 #ifdef HAS_LONG_DOUBLE
20518 long double ldinf = (long double)exp(1e9);
20519 long double ldnan = (long double)sqrt(-1.0);
20522 switch (argv[1][0]) {
20523 case '1': bytes(&dinf, sizeof(dinf)); break;
20524 case '2': bytes(&dnan, sizeof(dnan)); break;
20525 #ifdef HAS_LONG_DOUBLE
20526 # if LONG_DOUBLEKIND == 3 || LONG_DOUBLEKIND == 4
20527 /* the 80-bit long doubles might have garbage in their excess bytes */
20528 memset((char *)&ldinf + 10, '\0', LONG_DOUBLESIZE - 10);
20530 case '3': bytes(&ldinf, sizeof(ldinf)); break;
20531 case '4': bytes(&ldnan, sizeof(ldnan)); break;
20539 if eval $compile; then
20540 doubleinfbytes=`$run ./try 1`
20541 doublenanbytes=`$run ./try 2`
20542 case "$d_longdbl" in
20544 longdblinfbytes=`$run ./try 3`
20545 longdblnanbytes=`$run ./try 4`
20549 # Defaults in case the above test program failed.
20550 case "$doublekind" in
20551 1) # IEEE 754 32-bit LE
20552 doubleinfbytes='0x00, 0x00, 0xf0, 0x7f'
20553 doublenanbytes='0x00, 0x00, 0xf8, 0x7f'
20555 2) # IEEE 754 32-bit BE
20556 doubleinfbytes='0x7f, 0xf0, 0x00, 0x00'
20557 doublenanbytes='0x7f, 0xf8, 0x00, 0x00'
20559 3) # IEEE 754 64-bit LE
20560 doubleinfbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x7f'
20561 doublenanbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0x7f'
20563 4) # IEEE 754 64-bit BE
20564 doubleinfbytes='0x7f, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20565 doublenanbytes='0x7f, 0xf8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20567 5) # IEEE 754 128-bit LE
20568 doubleinfbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x7f'
20569 doublenanbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0x7f'
20571 6) # IEEE 754 128-bit BE
20572 doubleinfbytes='0x7f, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20573 doublenanbytes='0x7f, 0xf8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20575 7) # IEEE 754 64-bit mixed: 32-bit LEs in BE
20576 doubleinfbytes='0x00, 0x00, 0xf0, 0x7f, 0x00, 0x00, 0x00, 0x00'
20577 doublenanbytes='0x00, 0x00, 0xf8, 0x7f, 0x00, 0x00, 0x00, 0x00'
20579 8) # IEEE 754 64-bit mixed: 32-bit BEs in LE
20580 doubleinfbytes='0x00, 0x00, 0x00, 0x00, 0x7f, 0xf0, 0x00, 0x00'
20581 doublenanbytes='0x00, 0x00, 0x00, 0x00, 0x7f, 0xf8, 0x00, 0x00'
20584 doubleinfbytes=$undef
20585 doublenanbytes=$undef
20588 case "$longdblkind" in
20589 1) # IEEE 754 128-bit LE
20590 longdblinfbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x7f'
20591 longdblnanbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xff, 0x7f'
20593 2) # IEEE 754 128-bit BE
20594 longdblinfbytes='0x7f, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20595 longdblnanbytes='0x7f, 0xff, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20597 3) # IEEE 754 80-bit LE, 12 or 16 bytes (x86)
20598 case "$longdblsize" in
20599 12) # x86 32-bit (96 bits, or 4 x 32, or 12 x 8)
20600 longdblinfbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xff, 0x7f, 0x00, 0x00'
20601 longdblnanbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0xff, 0x7f, 0x00, 0x00'
20604 longdblinfbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xff, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20605 longdblnanbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0xff, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20608 longdblinfbytes=$undef
20609 longdblnanbytes=$undef
20613 4) # IEEE 754 80-bit BE, 12 or 16 bytes
20614 case "$longdblsize" in
20615 12) # 32-bit system
20616 longdblinfbytes='0x7f, 0xff, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20617 longdblnanbytes='0x7f, 0xff, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20619 16) # 64-bit system
20620 longdblinfbytes='0x7f, 0xff, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20621 longdblnanbytes='0x7f, 0xff, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20624 longdblinfbytes=$undef
20625 longdblnanbytes=$undef
20629 5) # 128-bit LE-LE "double double"
20630 longdblinfbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x7f'
20631 longdblnanbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0x7f'
20633 6) # 128-bit BE-BE "double double"
20634 longdblinfbytes='0x7f, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20635 longdblnanbytes='0x7f, 0xf8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20637 7) # 128-bit LE-BE "double double"
20638 longdblinfbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20639 longdblnanbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20641 8) # 128-bit BE-LE "double double"
20642 longdblinfbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7f, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20643 longdblnanbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7f, 0xf8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20646 longdblinfbytes=$undef
20647 longdblnanbytes=$undef
20653 : Check the length of the double mantissa
20654 $echo "Checking how many mantissa bits your doubles have..." >&4
20657 #$i_sunmath I_SUNMATH
20659 # include <float.h>
20662 # include <sunmath.h>
20664 #ifdef DBL_MANT_DIG
20665 # define BITS (DBL_MANT_DIG - 1) /* the implicit bit does not count */
20668 int main(int argc, char *argv[]) {
20670 printf("%d\n", BITS);
20676 if eval $compile; then
20677 doublemantbits=`$run ./try`
20679 doublemantbits="$undef"
20683 : Check the length of the longdouble mantissa
20684 $echo "Checking how many mantissa bits your long doubles have..." >&4
20687 #$i_sunmath I_SUNMATH
20689 # include <float.h>
20692 # include <sunmath.h>
20694 #$d_longdbl HAS_LONG_DOUBLE
20695 #if defined(HAS_LONG_DOUBLE) && defined(LDBL_MANT_DIG)
20696 # if ($longdblkind == 3) || ($longdblkind == 4) /* 80-bit extended precision */
20697 /* This format has no implicit bit. Beware, however, that for
20698 * this format the bare LDBL_MANT_DIG is misleading for inf/nan:
20699 * the top three bits are used for inf (100) / qnan (11x) / snan (101),
20700 * and the top bit must have been one since 387, zero is plain invalid.
20701 * For normal fp values, the LDBL_MANT_DIG is fine, though. */
20702 # define BITS LDBL_MANT_DIG
20703 # elif ($longdblkind == 5 || $longdblkind == 6 || $longdblkind == 7 || $longdblkind == 8) /* double double */
20704 /* LDBL_MANT_DIG of 106 (twice 53) would be logical, but for some
20705 * reason e.g. Irix thinks 107. But in any case, we want only
20706 * the number of real bits, the implicit bits are of no interest. */
20707 # define BITS 2 * (DBL_MANT_DIG - 1)
20709 # define BITS (LDBL_MANT_DIG - 1) /* the implicit bit does not count */
20713 int main(int argc, char *argv[]) {
20715 printf("%d\n", BITS);
20721 if eval $compile; then
20722 longdblmantbits=`$run ./try`
20724 longdblmantbits="$undef"
20728 : Check the length of the NV mantissa
20729 $echo "Checking how many mantissa bits your NVs have..." >&4
20730 if test "X$usequadmath" = "X$define"; then
20731 nvmantbits=112 # 128-1-15
20733 if test "X$nvsize" = "X$doublesize"; then
20734 nvmantbits="$doublemantbits"
20736 if test "X$nvsize" = "X$longdblsize"; then
20737 nvmantbits="$longdblmantbits"
20739 nvmantbits="$undef"
20744 : How can we generate normalized random numbers ?
20746 echo "Using our internal random number implementation..." >&4
20749 *-Dmy_rand=*|*-Dmy_srand=*)
20750 echo "Removing obsolete -Dmy_rand, -Dmy_srand, and -Drandbits from ccflags." >&4
20751 ccflags="`echo $ccflags | sed -e 's/-Dmy_rand=random/ /'`"
20752 ccflags="`echo $ccflags | sed -e 's/-Dmy_srand=srandom/ /'`"
20753 ccflags="`echo $ccflags | sed -e 's/-Drandbits=[0-9][0-9]*/ /'`"
20757 randfunc=Perl_drand48
20758 drand01="Perl_drand48()"
20759 seedfunc="Perl_drand48_init"
20763 : Determine if this is an EBCDIC system
20765 echo "Determining whether or not we are on an EBCDIC system..." >&4
20766 $cat >try.c <<'EOM'
20769 if ('M'==0xd4) return 0;
20776 if eval $compile_ok; then
20777 if $run ./try; then
20778 echo "You seem to speak EBCDIC." >&4
20781 echo "Nope, no EBCDIC, probably ASCII or some ISO Latin. Or UTF-8." >&4
20784 echo "I'm unable to compile the test program." >&4
20785 echo "I'll assume ASCII or some ISO Latin. Or UTF8." >&4
20791 : Check how to flush
20794 Checking how to flush all pending stdio output...
20796 # I only know how to find the first 32 possibly open files on SunOS.
20797 # See also hints/sunos_4_1.sh and util.c --AD
20799 sunos) $echo '#define PERL_FFLUSH_ALL_FOPEN_MAX 32' > try.c ;;
20801 $cat >>try.c <<EOCP
20803 #$i_stdlib I_STDLIB
20805 #include <stdlib.h>
20807 #$i_unistd I_UNISTD
20809 # include <unistd.h>
20811 #$d_sysconf HAS_SYSCONF
20812 #$d_stdio_stream_array HAS_STDIO_STREAM_ARRAY
20813 #ifdef HAS_STDIO_STREAM_ARRAY
20814 # define STDIO_STREAM_ARRAY $stdio_stream_array
20819 p = fopen("try.out", "w");
20823 # ifdef TRY_FPRINTF
20827 #ifdef TRY_FFLUSH_NULL
20830 #ifdef TRY_FFLUSH_ALL
20832 long open_max = -1;
20833 # ifdef PERL_FFLUSH_ALL_FOPEN_MAX
20834 open_max = PERL_FFLUSH_ALL_FOPEN_MAX;
20836 # if defined(HAS_SYSCONF) && defined(_SC_OPEN_MAX)
20837 open_max = sysconf(_SC_OPEN_MAX);
20840 open_max = FOPEN_MAX;
20843 open_max = OPEN_MAX;
20852 # ifdef HAS_STDIO_STREAM_ARRAY
20853 if (open_max > 0) {
20855 for (i = 0; i < open_max; i++)
20856 if (STDIO_STREAM_ARRAY[i]._file >= 0 &&
20857 STDIO_STREAM_ARRAY[i]._file < open_max &&
20858 STDIO_STREAM_ARRAY[i]._flag)
20859 fflush(&STDIO_STREAM_ARRAY[i]);
20867 : first we have to find out how _not_ to flush
20869 if $test "X$fflushNULL" = X -o "X$fflushall" = X; then
20871 set try -DTRY_FPUTC
20872 if eval $compile; then
20873 $run ./try 2>/dev/null
20876 if $test ! -s try.out -a "X$code" = X42; then
20882 set try -DTRY_FPRINTF
20883 if eval $compile; then
20884 $run ./try 2>/dev/null
20887 if $test ! -s try.out -a "X$code" = X42; then
20888 output=-DTRY_FPRINTF
20894 : check for fflush NULL behavior
20895 case "$fflushNULL" in
20896 '') set try -DTRY_FFLUSH_NULL $output
20897 if eval $compile; then
20898 $run ./try 2>/dev/null
20901 if $test -s try.out -a "X$code" = X42; then
20902 fflushNULL="`$cat try.out`"
20904 if $test "X$code" != X42; then
20906 (If this test failed, don't worry, we'll try another method shortly.)
20911 $rm -f core try.core core.try.*
20912 case "$fflushNULL" in
20914 Your fflush(NULL) works okay for output streams.
20915 Let's see if it clobbers input pipes...
20917 # As of mid-March 2000 all versions of Solaris appear to have a stdio
20918 # bug that improperly flushes the input end of pipes. So we avoid the
20919 # autoflush on fork/system/exec support for now. :-(
20920 $cat >tryp.c <<EOCP
20923 main(int argc, char **argv)
20929 while ((i = getc(stdin)) != -1
20930 && (*bp++ = i) != '\n'
20931 && bp < &buf[1024])
20934 fprintf(stdout, "%s", buf);
20942 fflushNULL="$define"
20944 if eval $compile; then
20946 # Copy the .c file to the remote host ($to is an ssh-alike if targethost is set)
20947 if $test "X$targethost" != X; then
20950 $run "cat tryp.c | ./tryp " 2>/dev/null > tryp.out
20952 $cat tryp.c | $run ./tryp 2>/dev/null > tryp.out
20954 if cmp tryp.c tryp.out >/dev/null 2>&1; then
20956 fflush(NULL) seems to behave okay with input streams.
20958 fflushNULL="$define"
20961 Ouch, fflush(NULL) clobbers input pipes! We will not use it.
20963 fflushNULL="$undef"
20966 $rm -f core tryp.c tryp.core core.tryp.*
20969 Your fflush(NULL) isn't working (contrary to ANSI C).
20971 fflushNULL="$undef"
20974 Cannot figure out whether your fflush(NULL) works or not.
20975 I'm assuming it doesn't (contrary to ANSI C).
20977 fflushNULL="$undef"
20981 $define|true|[yY]*)
20982 fflushNULL="$define"
20985 fflushNULL="$undef"
20988 : check explicit looping only if NULL did not work, and if the pipe
20989 : bug does not show up on an explicit flush too
20990 case "$fflushNULL" in
20992 $cat >tryp.c <<EOCP
20995 main(int argc, char **argv)
21001 while ((i = getc(stdin)) != -1
21002 && (*bp++ = i) != '\n'
21003 && bp < &buf[1024])
21006 fprintf(stdout, "%s", buf);
21015 if eval $compile; then
21017 if $test "X$targethost" != X; then
21020 $run "cat tryp.c | ./tryp " 2>/dev/null > tryp.out
21022 $cat tryp.c | $run ./tryp 2>/dev/null > tryp.out
21024 if cmp tryp.c tryp.out >/dev/null 2>&1; then
21026 Good, at least fflush(stdin) seems to behave okay when stdin is a pipe.
21028 : now check for fflushall behaviour
21029 case "$fflushall" in
21030 '') set try -DTRY_FFLUSH_ALL $output
21031 if eval $compile; then
21033 (Now testing the other method--but note that this also may fail.)
21035 $run ./try 2>/dev/null
21038 if $test -s try.out -a "X$code" = X42; then
21039 fflushall="`$cat try.out`"
21043 case "$fflushall" in
21045 Whew. Flushing explicitly all the stdio streams works.
21047 fflushall="$define"
21050 Sigh. Flushing explicitly all the stdio streams doesn't work.
21055 Cannot figure out whether flushing stdio streams explicitly works or not.
21056 I'm assuming it doesn't.
21062 "$define"|true|[yY]*)
21063 fflushall="$define"
21071 All is futile. Even fflush(stdin) clobbers input pipes!
21078 $rm -f core tryp.c tryp.core core.tryp.*
21080 *) fflushall="$undef"
21084 case "$fflushNULL$fflushall" in
21087 OK, I give up. I cannot figure out how to flush pending stdio output.
21088 We won't be flushing handles at all before fork/exec/popen.
21094 : Store the full pathname to the ar program for use in the C program
21095 : Respect a hint or command line value for full_ar.
21100 : Store the full pathname to the sed program for use in the C program
21103 : see what type gids are declared as in the kernel
21105 echo "Looking for the type for group ids returned by getgid()."
21106 set gid_t gidtype xxx stdio.h sys/types.h
21110 xxx=`./findhdr sys/user.h`
21111 set `grep 'groups\[NGROUPS\];' "$xxx" 2>/dev/null` unsigned short
21113 unsigned) dflt="$1 $2" ;;
21117 *) dflt="$gidtype";;
21120 gid_t) echo "gid_t found." ;;
21121 *) rp="What is the type for group ids returned by getgid()?"
21127 : Check the size of GID
21130 *_t) zzz="$gidtype" ;;
21133 echo "Checking the size of $zzz..." >&4
21135 #include <sys/types.h>
21137 #$i_stdlib I_STDLIB
21139 #include <stdlib.h>
21142 printf("%d\n", (int)sizeof($gidtype));
21147 if eval $compile_ok; then
21151 echo "(I can't execute the test program--guessing $gidsize.)" >&4
21154 echo "Your $zzz is $gidsize bytes long."
21159 echo "(I can't compile the test program--guessing $gidsize.)" >&4
21163 : Check if GID is signed
21166 *_t) zzz="$gidtype" ;;
21169 echo "Checking the sign of $zzz..." >&4
21171 #include <sys/types.h>
21182 if eval $compile; then
21186 echo "(I can't execute the test program--guessing unsigned.)" >&4
21190 1) echo "Your $zzz is unsigned." ;;
21191 -1) echo "Your $zzz is signed." ;;
21197 echo "(I can't compile the test program--guessing unsigned.)" >&4
21201 : Check 64bit sizes
21204 if $test X"$quadtype" != X; then
21206 echo "Checking how to print 64-bit integers..." >&4
21208 if $test X"$sPRId64" = X -a X"$quadtype" = Xint; then
21209 $cat >try.c <<'EOCP'
21210 #include <sys/types.h>
21213 int q = 12345678901;
21214 printf("%ld\n", q);
21218 if eval $compile; then
21222 sPRId64='"d"'; sPRIi64='"i"'; sPRIu64='"u"';
21223 sPRIo64='"o"'; sPRIx64='"x"'; sPRIXU64='"X"';
21224 echo "We will use %d."
21230 if $test X"$sPRId64" = X -a X"$quadtype" = Xlong; then
21231 $cat >try.c <<'EOCP'
21232 #include <sys/types.h>
21235 long q = 12345678901;
21236 printf("%ld\n", q);
21240 if eval $compile; then
21244 sPRId64='"ld"'; sPRIi64='"li"'; sPRIu64='"lu"';
21245 sPRIo64='"lo"'; sPRIx64='"lx"'; sPRIXU64='"lX"';
21246 echo "We will use %ld."
21252 if $test X"$sPRId64" = X -a X"$i_inttypes" = X"$define" -a X"$quadtype" = Xint64_t; then
21253 $cat >try.c <<'EOCP'
21254 #include <sys/types.h>
21255 #include <inttypes.h>
21258 int64_t q = 12345678901;
21259 printf("%" PRId64 "\n", q);
21263 if eval $compile; then
21267 sPRId64=PRId64; sPRIi64=PRIi64; sPRIu64=PRIu64;
21268 sPRIo64=PRIo64; sPRIx64=PRIx64; sPRIXU64=PRIXU64;
21269 echo "We will use the C9X style."
21275 if $test X"$sPRId64" = X -a X"$quadtype" != X; then
21277 #include <sys/types.h>
21280 $quadtype q = 12345678901;
21281 printf("%Ld\n", q);
21285 if eval $compile; then
21289 sPRId64='"Ld"'; sPRIi64='"Li"'; sPRIu64='"Lu"';
21290 sPRIo64='"Lo"'; sPRIx64='"Lx"'; sPRIXU64='"LX"';
21291 echo "We will use %Ld."
21297 if $test X"$sPRId64" = X -a X"$quadtype" = X"long long"; then
21298 $cat >try.c <<'EOCP'
21299 #include <sys/types.h>
21302 long long q = 12345678901LL; /* AIX cc requires the LL suffix. */
21303 printf("%lld\n", q);
21307 if eval $compile; then
21311 sPRId64='"lld"'; sPRIi64='"lli"'; sPRIu64='"llu"';
21312 sPRIo64='"llo"'; sPRIx64='"llx"'; sPRIXU64='"llX"';
21313 echo "We will use the %lld style."
21319 if $test X"$sPRId64" = X -a X"$quadtype" != X; then
21321 #include <sys/types.h>
21324 $quadtype q = 12345678901;
21325 printf("%qd\n", q);
21329 if eval $compile; then
21333 sPRId64='"qd"'; sPRIi64='"qi"'; sPRIu64='"qu"';
21334 sPRIo64='"qo"'; sPRIx64='"qx"'; sPRIXU64='"qX"';
21335 echo "We will use %qd."
21341 if $test X"$sPRId64" = X; then
21342 echo "Cannot figure out how to print 64-bit integers." >&4
21349 '') d_PRId64="$undef"; d_PRIi64="$undef"; d_PRIu64="$undef";
21350 d_PRIo64="$undef"; d_PRIx64="$undef"; d_PRIXU64="$undef";
21352 *) d_PRId64="$define"; d_PRIi64="$define"; d_PRIu64="$define";
21353 d_PRIo64="$define"; d_PRIx64="$define"; d_PRIXU64="$define";
21357 : Check format strings for internal types
21359 $echo "Checking the format strings to be used for Perl's internal types..." >&4
21361 if $test X"$ivsize" = X8; then
21362 ivdformat="$sPRId64"
21363 uvuformat="$sPRIu64"
21364 uvoformat="$sPRIo64"
21365 uvxformat="$sPRIx64"
21366 uvXUformat="$sPRIXU64"
21368 if $test X"$ivsize" = X"$longsize"; then
21375 if $test X"$ivsize" = X"$intsize"; then
21383 if $test X"$ivsize" = X"$shortsize"; then
21394 if $test X"$usequadmath" = X"$define"; then
21402 if $test X"$uselongdouble" = X"$define" -a X"$d_longdbl" = X"$define" -a X"$d_PRIgldbl" = X"$define"; then
21403 nveformat="$sPRIeldbl"
21404 nvfformat="$sPRIfldbl"
21405 nvgformat="$sPRIgldbl"
21406 nvEUformat="$sPRIEUldbl"
21407 nvFUformat="$sPRIFUldbl"
21408 nvGUformat="$sPRIGUldbl"
21419 case "$ivdformat" in
21420 '') echo "$0: Fatal: failed to find format strings, cannot continue." >&4
21425 : Check format string for GID
21428 $echo "Checking the format string to be used for gids..." >&4
21431 -1) if $test X"$gidsize" = X"$ivsize"; then
21432 gidformat="$ivdformat"
21434 if $test X"$gidsize" = X"$longsize"; then
21437 if $test X"$gidsize" = X"$intsize"; then
21440 if $test X"$gidsize" = X"$shortsize"; then
21447 *) if $test X"$gidsize" = X"$uvsize"; then
21448 gidformat="$uvuformat"
21450 if $test X"$gidsize" = X"$longsize"; then
21453 if $test X"$gidsize" = X"$intsize"; then
21456 if $test X"$gidsize" = X"$shortsize"; then
21465 : see if getgroups exists
21466 set getgroups d_getgrps
21469 : see if setgroups exists
21470 set setgroups d_setgrps
21473 : Find type of 2nd arg to 'getgroups()' and 'setgroups()'
21475 case "$d_getgrps$d_setgrps" in
21477 case "$groupstype" in
21478 '') dflt="$gidtype" ;;
21479 *) dflt="$groupstype" ;;
21482 What type of pointer is the second argument to getgroups() and setgroups()?
21483 Usually this is the same as group ids, $gidtype, but not always.
21486 rp='What type pointer is the second argument to getgroups() and setgroups()?'
21490 *) groupstype="$gidtype";;
21493 : check whether make sets MAKE
21495 echo "Checking if your $make program sets \$(MAKE)..." >&4
21496 case "$make_set_make" in
21498 $sed 's/^X //' > testmake.mak << 'EOF'
21500 X @echo 'maketemp="$(MAKE)"'
21502 case "`$make -f testmake.mak 2>/dev/null`" in
21503 *maketemp=*) make_set_make='#' ;;
21504 *) make_set_make="MAKE=$make" ;;
21506 $rm -f testmake.mak
21509 case "$make_set_make" in
21510 '#') echo "Yup, it does.";;
21511 *) echo "Nope, it doesn't.";;
21514 : see what type is used for mode_t
21515 rp="What is the type used for file modes for system calls (e.g. fchmod())?"
21516 set mode_t modetype int stdio.h sys/types.h
21519 : see if we need va_copy
21521 case "$i_stdarg" in
21524 #include <stdarg.h>
21526 #$i_stdlib I_STDLIB
21528 #include <stdlib.h>
21530 #include <signal.h>
21533 ivfprintf(FILE *f, const char *fmt, va_list *valp)
21535 return vfprintf(f, fmt, *valp);
21539 myvfprintf(FILE *f, const char *fmt, va_list val)
21541 return ivfprintf(f, fmt, &val);
21545 myprintf(char *fmt, ...)
21548 va_start(val, fmt);
21549 return myvfprintf(stdout, fmt, val);
21553 main(int ac, char **av)
21555 signal(SIGSEGV, exit);
21557 myprintf("%s%cs all right, then\n", "that", '\'');
21562 if eval $compile && $run ./try 2>&1 >/dev/null; then
21563 case "`$run ./try`" in
21564 "that's all right, then")
21570 yes) echo "It seems that you don't need va_copy()." >&4
21571 need_va_copy="$undef"
21573 *) echo "It seems that va_copy() or similar will be needed." >&4
21574 need_va_copy="$define"
21579 *) echo "You don't have <stdarg.h>, not checking for va_copy()." >&4
21580 need_va_copy="$undef"
21584 : see what type is used for size_t
21585 rp="What is the type used for the length parameter for string functions?"
21586 set size_t sizetype 'unsigned int' stdio.h sys/types.h
21589 : check for type of arguments to gethostbyaddr.
21590 if test "X$netdb_host_type" = X -o "X$netdb_hlen_type" = X; then
21591 case "$d_gethbyaddr" in
21595 Checking to see what type of arguments are accepted by gethostbyaddr().
21597 hdrs="$define sys/types.h
21598 $d_socket sys/socket.h
21599 $i_niin netinet/in.h
21601 $i_unistd unistd.h"
21602 : The first arg can 'char *' or 'void *'
21603 : The second arg is some of integral type
21604 for xxx in in_addr_t 'const void *' 'const char *' 'void *' 'char *'; do
21605 for yyy in size_t long int; do
21606 case "$netdb_host_type" in
21607 '') try="$extern_C struct hostent *gethostbyaddr($xxx, $yyy, int);"
21608 if ./protochk "$try" $hdrs; then
21609 echo "Your system accepts $xxx for the first arg."
21610 echo "...and $yyy for the second arg."
21611 netdb_host_type="$xxx"
21612 netdb_hlen_type="$yyy"
21618 : In case none of those worked, prompt the user.
21619 case "$netdb_host_type" in
21620 '') rp='What is the type for the 1st argument to gethostbyaddr?'
21623 netdb_host_type=$ans
21624 rp='What is the type for the 2nd argument to gethostbyaddr?'
21627 netdb_hlen_type=$ans
21631 *) : no gethostbyaddr, so pick harmless defaults
21632 netdb_host_type='char *'
21633 netdb_hlen_type="$sizetype"
21636 # Remove the "const" if needed. -- but then we'll have a
21638 # netdb_host_type=`echo "$netdb_host_type" | sed 's/^const //'`
21641 : check for type of argument to gethostbyname.
21642 if test "X$netdb_name_type" = X ; then
21643 case "$d_gethbyname" in
21647 Checking to see what type of argument is accepted by gethostbyname().
21649 hdrs="$define sys/types.h
21650 $d_socket sys/socket.h
21651 $i_niin netinet/in.h
21653 $i_unistd unistd.h"
21654 for xxx in "const char *" "char *"; do
21655 case "$netdb_name_type" in
21656 '') try="$extern_C struct hostent *gethostbyname($xxx);"
21657 if ./protochk "$try" $hdrs; then
21658 echo "Your system accepts $xxx."
21659 netdb_name_type="$xxx"
21664 : In case none of those worked, prompt the user.
21665 case "$netdb_name_type" in
21666 '') rp='What is the type for the 1st argument to gethostbyname?'
21669 netdb_name_type=$ans
21673 *) : no gethostbyname, so pick harmless default
21674 netdb_name_type='char *'
21679 : check for type of 1st argument to getnetbyaddr.
21680 if test "X$netdb_net_type" = X ; then
21681 case "$d_getnbyaddr" in
21685 Checking to see what type of 1st argument is accepted by getnetbyaddr().
21687 hdrs="$define sys/types.h
21688 $d_socket sys/socket.h
21689 $i_niin netinet/in.h
21691 $i_unistd unistd.h"
21692 for xxx in in_addr_t "unsigned long" long "unsigned int" int; do
21693 case "$netdb_net_type" in
21694 '') try="$extern_C struct netent *getnetbyaddr($xxx, int);"
21695 if ./protochk "$try" $hdrs; then
21696 echo "Your system accepts $xxx."
21697 netdb_net_type="$xxx"
21702 : In case none of those worked, prompt the user.
21703 case "$netdb_net_type" in
21704 '') rp='What is the type for the 1st argument to getnetbyaddr?'
21707 netdb_net_type=$ans
21711 *) : no getnetbyaddr, so pick harmless default
21712 netdb_net_type='long'
21716 : locate the preferred pager for this system
21723 [a-zA-Z]:/*) dflt=$pg;;
21727 [a-zA-Z]:/*) dflt=$more;;
21731 [a-zA-Z]:/*) dflt=$less;;
21734 '') dflt=/usr/ucb/more;;
21742 rp='What pager is used on your system?'
21746 : see what type pids are declared as in the kernel
21747 rp="What is the type of process ids on this system?"
21748 set pid_t pidtype int stdio.h sys/types.h
21751 : see if ar generates random libraries by itself
21753 echo "Checking how to generate random libraries on your machine..." >&4
21754 echo 'int bar1() { return bar2(); }' > bar1.c
21755 echo 'int bar2() { return 2; }' > bar2.c
21757 #$i_stdlib I_STDLIB
21759 #include <stdlib.h>
21761 int main() { printf("%d\n", bar1()); exit(0); }
21763 $cc $ccflags -c bar1.c >/dev/null 2>&1
21764 $cc $ccflags -c bar2.c >/dev/null 2>&1
21765 $cc $ccflags -c foo.c >/dev/null 2>&1
21766 $ar rc bar$_a bar2$_o bar1$_o >/dev/null 2>&1
21767 if $cc -o foobar $ccflags $ldflags foo$_o bar$_a $libs > /dev/null 2>&1 &&
21768 $run ./foobar >/dev/null 2>&1; then
21769 echo "$ar appears to generate random libraries itself."
21771 if [ "X$ranlib" = "X" ]; then
21774 elif $ar s bar$_a >/dev/null 2>&1 &&
21775 $cc -o foobar $ccflags $ldflags foo$_o bar$_a $libs > /dev/null 2>&1 &&
21776 $run ./foobar >/dev/null 2>&1; then
21777 echo "a table of contents needs to be added with '$ar s'."
21780 elif $ar ts bar$_a >/dev/null 2>&1 &&
21781 $cc -o foobar $ccflags $ldflags foo$_o bar$_a $libs > /dev/null 2>&1 &&
21782 $run ./foobar >/dev/null 2>&1; then
21783 echo "a table of contents needs to be added with '$ar ts'."
21790 ranlib=`./loc ranlib X /usr/bin /bin /usr/local/bin`
21791 $test -f $ranlib || ranlib=''
21794 if $test -n "$ranlib"; then
21795 echo "your system has '$ranlib'; we'll use that."
21798 echo "your system doesn't seem to support random libraries"
21799 echo "so we'll use lorder and tsort to order the libraries."
21806 : see if this is a values.h system
21807 set values.h i_values
21810 : Check the max offset that gmtime and localtime accept
21811 echo "Checking max offsets that gmtime () accepts"
21814 define) yyy="#include <values.h>" ;;
21818 case "$sGMTIME_min/$sGMTIME_max" in
21821 #include <sys/types.h>
21830 void gm_check (time_t t, int min_year, int max_year)
21833 if ( tmp == NULL ||
21834 /* Check tm_year overflow */
21835 tmp->tm_year < min_year || tmp->tm_year > max_year)
21846 gm_check (MAXLONG, 69, 0x7fffffff);
21848 if (tmp == NULL || tmp->tm_year < 0) {
21849 for (i = 63; i >= 0; i--) {
21850 time_t x = pt | ((time_t)1 << i);
21851 if (x < 0 || x < pt) continue;
21852 gm_check (x, 69, 0x7fffffff);
21855 printf ("sGMTIME_max=%ld\n", pt);
21864 gm_check (MINLONG, -1900, 70);
21867 for (i = 36; i >= 0; i--) {
21868 time_t x = pt - ((time_t)1 << i);
21869 if (x > 0) continue;
21870 gm_check (x, -1900, 70);
21873 printf ("sGMTIME_min=%ld\n", pt);
21877 int main (int argc, char *argv[])
21879 /* fprintf (stderr, "Sizeof time_t = %ld\n", sizeof (time_t)); */
21886 if eval $compile; then
21887 eval `$run ./try 2>/dev/null`
21889 echo "Cannot determine sGMTIME_max and sGMTIME_min." >&4
21895 echo "Checking max offsets that localtime () accepts"
21897 case "$sLOCALTIME_min/$sLOCALTIME_max" in
21900 #include <sys/types.h>
21909 void local_check (time_t t, int min_year, int max_year)
21911 if (sizeof (time_t) > 4 && t > 0x7ffffffffffff000LL)
21914 tmp = localtime (&t);
21915 if ( tmp == NULL ||
21916 /* Check tm_year overflow */
21917 tmp->tm_year < min_year || tmp->tm_year > max_year)
21921 } /* local_check */
21928 local_check (MAXLONG, 69, 0x7fffffff);
21930 if (tmp == NULL || tmp->tm_year < 0) {
21931 for (i = 63; i >= 0; i--) {
21932 time_t x = pt | ((time_t)1 << i);
21933 if (x < 0 || x < pt) continue;
21934 local_check (x, 69, 0x7fffffff);
21937 printf ("sLOCALTIME_max=%ld\n", pt);
21946 local_check (MINLONG, -1900, 70);
21949 for (i = 36; i >= 0; i--) {
21950 time_t x = pt - ((time_t)1 << i);
21951 if (x > 0) continue;
21952 local_check (x, -1900, 70);
21955 printf ("sLOCALTIME_min=%ld\n", pt);
21959 int main (int argc, char *argv[])
21967 if eval $compile; then
21968 eval `$run ./try 2>/dev/null`
21970 echo "Cannot determine sLOCALTIME_max and sLOCALTIME_min." >&4
21976 : check for type of arguments to select.
21977 case "$selecttype" in
21978 '') case "$d_select" in
21982 Checking to see what type of arguments are accepted by select().
21984 hdrs="$define sys/types.h
21985 $i_systime sys/time.h
21986 $i_sysselct sys/select.h
21987 $d_socket sys/socket.h"
21988 : The first arg can be int, unsigned, or size_t
21989 : The last arg may or may not be 'const'
21991 : void pointer has been seen but using that
21992 : breaks the selectminbits test
21993 for xxx in 'fd_set *' 'int *'; do
21994 for nfd in 'int' 'size_t' 'unsigned long' 'unsigned' ; do
21995 for tmo in 'struct timeval *' 'const struct timeval *'; do
21997 '') try="$extern_C select _(($nfd, $xxx, $xxx, $xxx, $tmo));"
21998 if ./protochk "$try" $hdrs; then
21999 echo "Your system accepts $xxx."
22008 '') rp='What is the type for the 2nd, 3rd, and 4th arguments to select?'
22009 case "$d_fd_set" in
22010 $define) dflt="fd_set *" ;;
22019 *) : no select, so pick a harmless default
22026 : check for the select 'width'
22027 case "$selectminbits" in
22028 '') safebits=`expr $ptrsize \* 8`
22029 case "$d_select" in
22033 Checking to see on how many bits at a time your select() operates...
22036 #include <sys/types.h>
22038 #$i_systime I_SYS_TIME
22039 #$i_systimek I_SYS_TIME_KERNEL
22044 # ifdef I_SYS_TIME_KERNEL
22047 # include <sys/time.h>
22048 # ifdef I_SYS_TIME_KERNEL
22052 #$i_sysselct I_SYS_SELECT
22053 #ifdef I_SYS_SELECT
22054 #include <sys/select.h>
22056 #$d_socket HAS_SOCKET
22058 # include <sys/socket.h> /* Might include <sys/bsdtypes.h> */
22061 #$i_stdlib I_STDLIB
22063 #include <stdlib.h>
22066 #define S sizeof(*(b))
22068 #define NBYTES (S * 8 > MINBITS ? S : MINBITS/8)
22069 #define NBITS (NBYTES * 8)
22071 char *s = (char *)malloc(NBYTES);
22080 fp = fopen("try.c", "r");
22086 b = ($selecttype)s;
22087 for (i = 0; i < NBITS; i++)
22091 select(fd + 1, b, 0, 0, &t);
22092 for (i = NBITS - 1; i > fd && FD_ISSET(i, b); i--);
22094 printf("%d\n", i + 1);
22099 if eval $compile_ok; then
22100 selectminbits=`$run ./try 2>/dev/null`
22101 case "$selectminbits" in
22103 Cannot figure out on how many bits at a time your select() operates.
22104 I'll play safe and guess it is $safebits bits.
22106 selectminbits=$safebits
22107 bits="$safebits bits"
22110 *) bits="$selectminbits bits" ;;
22112 echo "Your select() operates on $bits at a time." >&4
22114 rp='What is the minimum number of bits your select() operates on?'
22115 case "$byteorder" in
22116 12345678) dflt=64 ;;
22122 selectminbits="$val"
22126 *) : no select, so pick a harmless default
22127 selectminbits=$safebits
22133 : Trace out the files included by signal.h, then look for SIGxxx names.
22134 case "$sig_num_init" in
22136 if [ "X$fieldn" = X ]; then
22137 : Just make some guesses. We check them later.
22138 xxx="$sysroot/usr/include/signal.h $sysroot/usr/include/sys/signal.h"
22140 xxx=`echo '#include <signal.h>' |
22141 $cppstdin $cppminus $cppflags 2>/dev/null |
22142 $grep '^[ ]*#.*include' |
22143 $awk "{print \\$$fieldn}" | $sed 's!"!!g' |\
22144 $sed 's!\\\\\\\\!/!g' | $sort | $uniq`
22147 for xx in $xxx /dev/null ; do
22148 $test -f "$xx" && xxxfiles="$xxxfiles $xx"
22150 case "$xxxfiles" in
22151 '') xxxfiles=`./findhdr signal.h` ;;
22154 $1 ~ /^#define$/ && $2 ~ /^SIG[A-Z0-9]*$/ && $2 !~ /SIGARRAYSIZE/ && $2 !~ /SIGSTKSIZE/ && $2 !~ /SIGSTKSZ/ && $3 !~ /void/ {
22155 print substr($2, 4, 20)
22157 $1 == "#" && $2 ~ /^define$/ && $3 ~ /^SIG[A-Z0-9]*$/ && $3 !~ /SIGARRAYSIZE/ && $4 !~ /void/ {
22158 print substr($3, 4, 20)
22160 : Append some common names just in case the awk scan failed.
22161 xxx="$xxx ABRT ALRM BUS CANCEL CHLD CLD CONT DIL EMT FPE"
22162 xxx="$xxx FREEZE HUP ILL INT IO IOT KILL LOST LWP PHONE"
22163 xxx="$xxx PIPE POLL PROF PWR QUIT RTMAX RTMIN SEGV STKFLT STOP"
22164 xxx="$xxx SYS TERM THAW TRAP TSTP TTIN TTOU URG USR1 USR2"
22165 xxx="$xxx USR3 USR4 VTALRM WAITING WINCH WIND WINDOW XCPU XFSZ"
22167 : generate a few handy files for later
22168 $cat > signal.c <<EOCP
22169 #include <sys/types.h>
22170 #include <signal.h>
22171 #$i_stdlib I_STDLIB
22173 #include <stdlib.h>
22178 /* Strange style to avoid deeply-nested #if/#else/#endif */
22181 # define NSIG (_NSIG)
22187 # define NSIG (SIGMAX+1)
22193 # define NSIG (SIG_MAX+1)
22199 # define NSIG (_SIG_MAX+1)
22205 # define NSIG (MAXSIG+1)
22211 # define NSIG (MAX_SIG+1)
22216 # ifdef SIGARRAYSIZE
22217 # define NSIG SIGARRAYSIZE /* Assume ary[SIGARRAYSIZE] */
22223 # define NSIG (_sys_nsig) /* Solaris 2.5 */
22227 /* Default to some arbitrary number that's big enough to get most
22228 of the common signals.
22234 printf("NSIG %d\n", NSIG);
22240 echo $xxx | $tr ' ' $trnl | $sort | $uniq | $awk '
22242 printf "#ifdef SIG"; printf $1; printf "\n"
22243 printf "printf(\""; printf $1; printf " %%d\\n\",SIG";
22244 printf $1; printf ");\n"
22248 printf "#endif /* JUST_NSIG */\n";
22249 printf "exit(0);\n}\n";
22252 $cat >signal.awk <<'EOP'
22253 BEGIN { ndups = 0 }
22254 $1 ~ /^NSIG$/ { nsig = $2 }
22255 ($1 !~ /^NSIG$/) && (NF == 2) && ($2 ~ /^[0-9][0-9]*$/) {
22256 if ($2 > maxsig) { maxsig = $2 }
22257 if (sig_name[$2]) {
22258 dup_name[ndups] = $1
22259 dup_num[ndups] = $2
22271 printf("NSIG %d\n", nsig);
22272 for (n = 1; n < nsig; n++) {
22274 printf("%s %d\n", sig_name[n], sig_num[n])
22277 printf("NUM%d %d\n", n, n)
22280 for (n = 0; n < ndups; n++) {
22281 printf("%s %d\n", dup_name[n], dup_num[n])
22285 $cat >signal_cmd <<EOS
22287 if $test -s signal.lst; then
22288 echo "Using your existing signal.lst file"
22293 $cat >>signal_cmd <<'EOS'
22296 if eval $compile_ok; then
22297 $run ./signal$_exe | ($sort -n -k 2 2>/dev/null || $sort -n +1) |\
22298 $uniq | $awk -f signal.awk >signal.lst
22300 echo "(I can't seem be able to compile the whole test program)" >&4
22301 echo "(I'll try it in little pieces.)" >&4
22302 set signal -DJUST_NSIG
22303 if eval $compile_ok; then
22304 $run ./signal$_exe > signal.nsg
22307 echo "I can't seem to figure out how many signals you have." >&4
22308 echo "Guessing 50." >&4
22309 echo 'NSIG 50' > signal.nsg
22311 : Now look at all the signal names, one at a time.
22312 for xx in `echo $xxx | $tr ' ' $trnl | $sort | $uniq`; do
22313 $cat > signal.c <<EOCP
22314 #include <sys/types.h>
22315 #include <signal.h>
22318 printf("$xx %d\n", SIG${xx});
22323 if eval $compile; then
22324 echo "SIG${xx} found."
22325 $run ./signal$_exe >> signal.ls1
22327 echo "SIG${xx} NOT found."
22330 if $test -s signal.ls1; then
22331 $cat signal.nsg signal.ls1 |
22332 $sort -n | $uniq | $awk -f signal.awk >signal.lst
22336 if $test -s signal.lst; then
22339 echo "(AAK! I can't compile the test programs -- Guessing)" >&4
22340 echo 'kill -l' >signal
22341 set X `csh -f <signal`
22345 0) set HUP INT QUIT ILL TRAP ABRT EMT FPE KILL BUS SEGV SYS PIPE ALRM TERM;;
22347 echo $@ | $tr ' ' $trnl | \
22348 $awk '{ printf "%s %d\n", $1, ++s; }
22349 END { printf "NSIG %d\n", ++s }' >signal.lst
22351 $rm -f signal.c signal$_exe signal$_o signal.nsg signal.ls1
22353 chmod a+x signal_cmd
22354 $eunicefix signal_cmd
22356 : generate list of signal names
22358 case "$sig_name_init" in
22360 *) case "$sig_num_init" in
22361 ''|*,*) doinit=yes ;;
22366 echo "Generating a list of signal names and numbers..." >&4
22368 sig_count=`$awk '/^NSIG/ { printf "%d", $2 }' signal.lst`
22369 sig_name=`$awk 'BEGIN { printf "ZERO " }
22370 !/^NSIG/ { printf "%s ", $1 }' signal.lst`
22371 sig_num=`$awk 'BEGIN { printf "0 " }
22372 !/^NSIG/ { printf "%d ", $2 }' signal.lst`
22373 sig_name_init=`$awk 'BEGIN { printf "\"ZERO\", " }
22374 !/^NSIG/ { printf "\"%s\", ", $1 }
22375 END { printf "0\n" }' signal.lst`
22376 sig_num_init=`$awk 'BEGIN { printf "0, " }
22377 !/^NSIG/ { printf "%d, ", $2}
22378 END { printf "0\n"}' signal.lst`
22381 echo "The following $sig_count signals are available:"
22383 echo $sig_name | $awk \
22384 'BEGIN { linelen = 0 }
22386 for (i = 1; i <= NF; i++) {
22387 name = "SIG" $i " "
22388 linelen = linelen + length(name)
22389 if (linelen > 70) {
22391 linelen = length(name)
22397 sig_size=`echo $sig_name | awk '{print NF}'`
22398 $rm -f signal signal.c signal.awk signal.lst signal_cmd
22402 : Check size of size
22404 case "$sizetype" in
22405 *_t) zzz="$sizetype" ;;
22406 *) zzz="filesize" ;;
22408 echo "Checking the size of $zzz..." >&4
22410 #include <sys/types.h>
22412 #$i_stdlib I_STDLIB
22414 #include <stdlib.h>
22417 printf("%d\n", (int)sizeof($sizetype));
22422 if eval $compile_ok; then
22426 echo "(I can't execute the test program--guessing $sizesize.)" >&4
22429 echo "Your $zzz size is $sizesize bytes."
22434 echo "(I can't compile the test program--guessing $sizesize.)" >&4
22438 : check for socklen_t
22440 echo "Checking to see if you have socklen_t..." >&4
22442 #include <sys/types.h>
22443 #$d_socket HAS_SOCKET
22445 #include <sys/socket.h>
22447 int main() { socklen_t x = 16; }
22450 if eval $compile; then
22452 echo "You have socklen_t."
22455 echo "You do not have socklen_t."
22456 case "$sizetype" in
22457 size_t) echo "(You do have size_t, that might work. Some people are happy with just an int.)" ;;
22464 : see if this is a socks.h system
22465 set socks.h i_socks
22468 : check for type of the size argument to socket calls
22469 case "$d_socket" in
22473 Checking to see what type is the last argument of accept().
22476 case "$d_socklen_t" in
22477 "$define") yyy="$yyy socklen_t"
22479 yyy="$yyy $sizetype int long unsigned"
22480 for xxx in $yyy; do
22481 case "$socksizetype" in
22482 '') try="$extern_C int accept(int, struct sockaddr *, $xxx *);"
22483 case "$usesocks" in
22485 if ./protochk "$try" $i_systypes sys/types.h $d_socket sys/socket.h literal '#define INCLUDE_PROTOTYPES' $i_socks socks.h.; then
22486 echo "Your system accepts '$xxx *' for the last argument of accept()."
22487 socksizetype="$xxx"
22490 *) if ./protochk "$try" $i_systypes sys/types.h $d_socket sys/socket.h; then
22491 echo "Your system accepts '$xxx *' for the last argument of accept()."
22492 socksizetype="$xxx"
22499 : In case none of those worked, prompt the user.
22500 case "$socksizetype" in
22501 '') rp='What is the type for socket address structure sizes?'
22508 *) : no sockets, so pick relatively harmless default
22513 : see what type is used for signed size_t
22514 set ssize_t ssizetype int stdio.h sys/types.h
22519 #$i_stdlib I_STDLIB
22521 #include <stdlib.h>
22523 #include <sys/types.h>
22524 #define Size_t $sizetype
22525 #define SSize_t $dflt
22528 if (sizeof(Size_t) == sizeof(SSize_t))
22530 else if (sizeof(Size_t) == sizeof(int))
22539 if eval $compile_ok && $run ./try > /dev/null; then
22540 ssizetype=`$run ./try`
22541 echo "I'll be using $ssizetype for functions returning a byte count." >&4
22544 Help! I can't compile and run the ssize_t test program: please enlighten me!
22545 (This is probably a misconfiguration in your system or libraries, and
22546 you really ought to fix it. Still, I'll try anyway.)
22548 I need a type that is the same size as $sizetype, but is guaranteed to
22549 be signed. Common values are ssize_t, int and long.
22552 rp="What signed type is the same size as $sizetype?"
22558 : Check the size of st_ino
22560 $echo "Checking the size of st_ino..." >&4
22561 $cat > try.c <<EOCP
22562 #include <sys/stat.h>
22564 #$i_stdlib I_STDLIB
22566 #include <stdlib.h>
22570 printf("%d\n", (int)sizeof(st.st_ino));
22575 if eval $compile_ok; then
22579 $echo "(I can't execute the test program--guessing $st_ino_size.)" >&4
22581 *) st_ino_size=$val
22582 $echo "Your st_ino is $st_ino_size bytes long."
22587 $echo "(I can't compile the test program--guessing $st_ino_size.)" >&4
22591 : Check if st_ino is signed
22593 $echo "Checking the sign of st_ino..." >&4
22594 $cat > try.c <<EOCP
22595 #include <sys/stat.h>
22600 if (foo.st_ino < 0)
22607 if eval $compile; then
22611 $echo "(I can't execute the test program--guessing unsigned.)" >&4
22613 *) st_ino_sign=$val
22614 case "$st_ino_sign" in
22615 1) $echo "Your st_ino is unsigned." ;;
22616 -1) $echo "Your st_ino is signed." ;;
22622 $echo "(I can't compile the test program--guessing unsigned.)" >&4
22626 : see what type of char stdio uses.
22628 echo '#include <stdio.h>' | $cppstdin $cppminus > stdioh
22629 if $contains 'unsigned.*char.*_ptr;' stdioh >/dev/null 2>&1 ; then
22630 echo "Your stdio uses unsigned chars." >&4
22631 stdchar="unsigned char"
22633 echo "Your stdio uses signed chars." >&4
22638 : see what type uids are declared as in the kernel
22640 echo "Looking for the type for user ids returned by getuid()."
22641 set uid_t uidtype xxx stdio.h sys/types.h
22645 xxx=`./findhdr sys/user.h`
22646 set `grep '_ruid;' "$xxx" 2>/dev/null` unsigned short
22648 unsigned) dflt="$1 $2" ;;
22652 *) dflt="$uidtype";;
22655 uid_t) echo "uid_t found." ;;
22656 *) rp="What is the type for user ids returned by getuid()?"
22662 : Check size of UID
22665 *_t) zzz="$uidtype" ;;
22668 echo "Checking the size of $zzz..." >&4
22670 #include <sys/types.h>
22672 #$i_stdlib I_STDLIB
22674 #include <stdlib.h>
22677 printf("%d\n", (int)sizeof($uidtype));
22682 if eval $compile_ok; then
22686 echo "(I can't execute the test program--guessing $uidsize.)" >&4
22689 echo "Your $zzz is $uidsize bytes long."
22694 echo "(I can't compile the test program--guessing $uidsize.)" >&4
22697 : Check if UID is signed
22700 *_t) zzz="$uidtype" ;;
22703 echo "Checking the sign of $zzz..." >&4
22705 #include <sys/types.h>
22716 if eval $compile; then
22720 echo "(I can't execute the test program--guessing unsigned.)" >&4
22724 1) echo "Your $zzz is unsigned." ;;
22725 -1) echo "Your $zzz is signed." ;;
22731 echo "(I can't compile the test program--guessing unsigned.)" >&4
22735 : Check format string for UID
22737 $echo "Checking the format string to be used for uids..." >&4
22740 -1) if $test X"$uidsize" = X"$ivsize"; then
22741 uidformat="$ivdformat"
22743 if $test X"$uidsize" = X"$longsize"; then
22746 if $test X"$uidsize" = X"$intsize"; then
22749 if $test X"$uidsize" = X"$shortsize"; then
22756 *) if $test X"$uidsize" = X"$uvsize"; then
22757 uidformat="$uvuformat"
22759 if $test X"$uidsize" = X"$longsize"; then
22762 if $test X"$uidsize" = X"$intsize"; then
22765 if $test X"$uidsize" = X"$shortsize"; then
22774 : see what siginfo fields we have
22775 case "$d_sigaction" in
22777 echo "Checking if your siginfo_t has si_errno field...">&4
22778 set d_siginfo_si_errno siginfo_t int si_errno $d_sigaction signal.h
22781 echo "Checking if your siginfo_t has si_pid field...">&4
22782 set d_siginfo_si_pid siginfo_t $pidtype si_pid $d_sigaction signal.h
22785 echo "Checking if your siginfo_t has si_uid field...">&4
22786 set d_siginfo_si_uid siginfo_t $uidtype si_uid $d_sigaction signal.h
22789 echo "Checking if your siginfo_t has si_addr field...">&4
22790 set d_siginfo_si_addr siginfo_t "void *" si_addr $d_sigaction signal.h
22793 echo "Checking if your siginfo_t has si_status field...">&4
22794 set d_siginfo_si_status siginfo_t int si_status $d_sigaction signal.h
22797 echo "Checking if your siginfo_t has si_band field...">&4
22798 set d_siginfo_si_band siginfo_t long si_band $d_sigaction signal.h
22801 echo "Checking if your siginfo_t has si_value field...">&4
22802 set d_siginfo_si_value siginfo_t "union sigval" si_value $d_sigaction signal.h
22807 d_siginfo_si_errno="$undef"
22808 d_siginfo_si_pid="$undef"
22809 d_siginfo_si_uid="$undef"
22810 d_siginfo_si_addr="$undef"
22811 d_siginfo_si_status="$undef"
22812 d_siginfo_si_band="$undef"
22813 d_siginfo_si_value="$undef"
22817 : Determine if we can use sysctl with KERN_PROC_PATHNAME to find executing program
22819 echo "Determining whether we can use sysctl with KERN_PROC_PATHNAME to find executing program..." >&4
22820 $cat >try.c <<'EOM'
22821 /* Intentionally a long probe as I'd like to sanity check that the exact
22822 approach is going to work, as thinking it will work, but only having it
22823 part working at runtime is worse than not having it. */
22825 #include <sys/types.h>
22826 #include <sys/sysctl.h>
22827 #include <sys/param.h>
22829 #include <string.h>
22830 #include <stdlib.h>
22831 #include <unistd.h>
22834 main(int argc, char **argv) {
22836 char *argv_leaf = strrchr(argv[0], '/');
22842 mib[1] = KERN_PROC;
22843 mib[2] = KERN_PROC_PATHNAME;
22847 fprintf(stderr, "Can't locate / in '%s'\n", argv[0]);
22851 if (sysctl(mib, 4, NULL, &size, NULL, 0)) {
22856 if (size < strlen(argv_leaf) + 1) {
22857 fprintf(stderr, "size %lu is too short for a path\n",
22858 (unsigned long) size);
22862 if (size > MAXPATHLEN * MAXPATHLEN) {
22863 fprintf(stderr, "size %lu is too long for a path\n",
22864 (unsigned long) size);
22868 buffer = malloc(size);
22874 if (sysctl(mib, 4, buffer, &size, NULL, 0)) {
22879 if (strlen(buffer) + 1 != size) {
22880 fprintf(stderr, "size != strlen(buffer) + 1 (%lu != %lu)\n",
22881 (unsigned long)size, (unsigned long)strlen(buffer) + 1);
22886 if (*buffer != '/') {
22887 fprintf(stderr, "Not an absolute path: '%s'\n", buffer);
22891 if (strstr(buffer, "/./")) {
22892 fprintf(stderr, "Contains /./: '%s'\n", buffer);
22896 if (strstr(buffer, "/../")) {
22897 fprintf(stderr, "Contains /../: '%s'\n", buffer);
22901 buffer_leaf = strrchr(buffer, '/');
22902 if (strcmp(buffer_leaf, argv_leaf) != 0) {
22903 fprintf(stderr, "Leafnames differ: '%s' vs '%s'\n", argv[0], buffer);
22915 if eval $compile; then
22916 if $run ./try; then
22917 echo "You can use sysctl with KERN_PROC_PATHNAME to find the executing program." >&4
22920 echo "Nope, sysctl with KERN_PROC_PATHNAME doesn't work here." >&4
22924 echo "I'm unable to compile the test program." >&4
22925 echo "I'll assume no sysctl with KERN_PROC_PATHNAME here." >&4
22929 set usekernprocpathname
22932 : Determine if we can use _NSGetExecutablePath to find executing program
22934 echo "Determining whether we can use _NSGetExecutablePath to find executing program..." >&4
22935 $cat >try.c <<'EOM'
22936 /* Intentionally a long probe as I'd like to sanity check that the exact
22937 approach is going to work, as thinking it will work, but only having it
22938 part working at runtime is worse than not having it. */
22939 #include <mach-o/dyld.h>
22941 #include <stdlib.h>
22942 #include <sys/param.h>
22943 #include <string.h>
22946 main(int argc, char **argv) {
22948 uint32_t size = sizeof(buf);
22952 char *argv_leaf = strrchr(argv[0], '/');
22956 fprintf(stderr, "Can't locate / in '%s'\n", argv[0]);
22960 _NSGetExecutablePath(buf, &size);
22961 if (size > MAXPATHLEN * MAXPATHLEN) {
22962 fprintf(stderr, "_NSGetExecutablePath size %u is too long for a path\n",
22963 (unsigned int) size);
22967 buffer = malloc(size);
22973 result = _NSGetExecutablePath(buffer, &size);
22975 fprintf(stderr, "_NSGetExecutablePath returned %i for a size of %u\n",
22976 result, (unsigned int) size);
22980 tidied = realpath(buffer, NULL);
22982 perror("realpath");
22988 if (*tidied != '/') {
22989 fprintf(stderr, "Not an absolute path: '%s'\n", tidied);
22993 if (strstr(tidied, "/./")) {
22994 fprintf(stderr, "Contains /./: '%s'\n", tidied);
22998 if (strstr(tidied, "/../")) {
22999 fprintf(stderr, "Contains /../: '%s'\n", tidied);
23003 tidied_leaf = strrchr(tidied, '/');
23004 if (strcmp(tidied_leaf, argv_leaf) != 0) {
23005 fprintf(stderr, "Leafnames differ: '%s' vs '%s'\n", argv[0], tidied);
23017 if eval $compile; then
23018 if $run ./try; then
23019 echo "You can use _NSGetExecutablePath to find the executing program." >&4
23022 echo "Nope, _NSGetExecutablePath doesn't work here." >&4
23025 echo "I'm unable to compile the test program." >&4
23026 echo "I'll assume no _NSGetExecutablePath here." >&4
23029 set usensgetexecutablepath
23032 : Check if site customization support was requested
23033 case "$usesitecustomize" in
23034 $define|true|[Yy]*)
23035 usesitecustomize="$define"
23038 usesitecustomize="$undef"
23042 : see if prototypes support variable argument declarations
23044 case "$prototype$i_stdarg" in
23046 echo "It appears we'll be able to prototype varargs functions." >&4
23050 echo "Too bad... We won't be using prototyped varargs functions..." >&4
23057 : determine compiler compiler
23066 if $test -f "$byacc$_exe"; then
23068 comp="byacc or $comp"
23070 if $test -f "$bison$_exe"; then
23071 comp="$comp or bison -y"
23073 rp="Which compiler compiler ($comp) shall I use?"
23082 echo "(Adding -y option to bison to get yacc-compatible behavior.)"
23088 : see if this is a assert.h system
23089 set assert.h i_assert
23092 : see if this is a bfd.h system
23096 : see if this is an execinfo.h system
23097 set execinfo.h i_execinfo
23100 : see if this is a fenv.h system
23104 : see if this is a fp.h system
23108 : see if this is a fp_class.h system
23109 set fp_class.h i_fp_class
23112 : see if gdbm.h is available
23117 : see if gdbm_open exists
23118 set gdbm_open d_gdbm_open
23120 case "$d_gdbm_open" in
23123 echo "We won't be including <gdbm.h>"
23132 : see if this is a ieeefp.h system
23133 case "$i_ieeefp" in
23134 '' ) set ieeefp.h i_ieeefp
23139 : see if this is a libutil.h system
23140 set libutil.h i_libutil
23143 : see if mach cthreads are available
23144 if test "X$usethreads" = "X$define"; then
23145 set mach/cthreads.h i_machcthr
23148 i_machcthr="$undef"
23151 : see if this is a mntent.h system
23152 set mntent.h i_mntent
23155 : see if net/errno.h is available
23157 set net/errno.h val
23160 : Unfortunately, it causes problems on some systems. Arrgh.
23163 cat > try.c <<'EOM'
23166 #include <net/errno.h>
23172 if $cc $ccflags -c try.c >/dev/null 2>&1; then
23173 echo "We'll be including <net/errno.h>." >&4
23175 echo "We won't be including <net/errno.h>." >&4
23184 : see if netinet/tcp.h is available
23185 set netinet/tcp.h i_netinettcp
23188 : see if this is a poll.h system
23192 : see if this is a prot.h system
23196 : Preprocessor symbols
23198 $echo "Guessing which symbols your C compiler and preprocessor define..." >&4
23199 $cat <<'EOSH' > Cppsym.know
23200 a29k aarch64 ABI64 aegis AES_SOURCE AIX AIX32 AIX370 AIX41 AIX42
23201 AIX43 aixpc AIX_SOURCE alliant ALL_SOURCE alpha AM29000 am29000
23202 AMD64 amd64 amiga AMIGAOS AMIX ansi ANSI_C_SOURCE apollo arch_ppc
23203 arch_pwr ardent ARM ARM32 atarist att386 att3b
23204 BeOS BIG_ENDIAN BIT_MSF BSD bsd bsd43 bsd4_2 BSD4_3 bsd4_3 bsd4_4
23205 BSDCOMPAT bsdi BSD_4_3 BSD_4_4 BSD_NET2 BSD_TIME BSD_TYPES bull
23206 byteorder byte_order
23207 c cadmus clang clipper CMU COFF COMPILER_VERSION concurrent
23208 convex cpu CRAY cray CRAYMPP ctix CX_UX CYGWIN
23209 DECC DGUX DGUX_SOURCE DJGPP dmert DOLPHIN DPX2 DSO Dynix DynixPTX
23210 ELF encore EPI EXTENSIONS
23211 FAVOR_BSD FILE_OFFSET_BITS FORTIFY_SOURCE FreeBSD
23212 GCC_NEW_VARARGS gcos gcx gimpel GLIBC GLIBC_MINOR GNUC GNUC_MINOR
23213 GNU_LIBRARY GNU_SOURCE GO32 gould GOULD_PN
23214 H3050R H3050RX hbullx20 hcx host_mips hp200 hp300 HP700 hp700
23215 hp800 hp9000 hp9000s200 hp9000s300 hp9000s400 hp9000s500
23216 hp9000s700 hp9000s800 hp9k8 hppa hpux HPUX_SOURCE hp_osf
23217 i186 i286 i386 i486 i586 i686 i8086 i80960 i860 I960 IA32 IA64
23218 iAPX286 ibm ibm032 ibmesa IBMR2 ibmrt ILP32 ILP64
23219 INLINE_INTRINSICS INT64 INTEL interdata INTRINSICS is68k itanium
23221 LANGUAGE_C LARGEFILE64_SOURCE LARGEFILE_SOURCE LARGE_FILE_API
23222 LFS64_LARGEFILE LFS_LARGEFILE LIBCATAMOUNT Linux LITTLE_ENDIAN
23223 LONG64 LONGDOUBLE LONGLONG LONG_DOUBLE LONG_LONG LP64 luna
23225 M68000 m68k m88100 m88k M88KBCS_TARGET MACH machine MachTen
23226 MATH_HAS_NO_SIDE_EFFECTS mc300 mc500 mc68000 mc68010 mc68020
23227 mc68030 mc68040 mc68060 mc68k mc68k32 mc700 mc88000 mc88100
23228 merlin mert MiNT mips MIPSEB MIPSEL MIPS_FPSET MIPS_ISA MIPS_SIM
23229 MIPS_SZINT MIPS_SZLONG MIPS_SZPTR MODERN_C motorola mpeix MSDOS
23230 MTXINU MULTIMAX MVS mvs M_AMD64 M_ARM M_ARMT M_COFF M_I186 M_I286
23231 M_I386 M_I8086 M_I86 M_I86SM M_IA64 M_IX86 M_PPC M_SYS3 M_SYS5
23232 M_SYSIII M_SYSV M_UNIX M_X86 M_XENIX
23233 n16 ncl_el ncl_mr NetBSD news1500 news1700 news1800 news1900
23234 news3700 news700 news800 news900 NeXT NLS nonstopux ns16000
23235 ns32000 ns32016 ns32332 ns32k nsc32000
23236 OCS88 OEMVS OpenBSD os OS2 OS390 osf OSF1 OSF_SOURCE
23237 PARAGON parisc pa_risc PA_RISC1_1 PA_RISC2_0 pc532 pdp11 PGC PIC
23238 plexus PORTAR posix POSIX1B_SOURCE POSIX2_SOURCE POSIX4_SOURCE
23239 POSIX_C_SOURCE POSIX_SOURCE POWER powerpc ppc PROTOTYPES PWB pyr
23241 R3000 REENTRANT RES Rhapsody RISC6000 riscix riscos RT
23242 S390 S390x SA110 SCO scs sequent sgi SGI_SOURCE SH SH3 sinix
23243 SIZE_INT SIZE_LONG SIZE_PTR SOCKETS_SOURCE SOCKET_SOURCE sony
23244 sonyrisc sony_news sparc sparclite sparcv8 sparcv9 spectrum
23245 stardent stdc STDC_EXT stratos sun sun3 sun386 Sun386i svr3 svr4
23246 SVR4_2 SVR4_SOURCE svr5 SX system SYSTYPE_BSD SYSTYPE_BSD43
23247 SYSTYPE_BSD44 SYSTYPE_SVR4 SYSTYPE_SVR5 SYSTYPE_SYSV SYSV SYSV3
23248 SYSV4 SYSV5 sysV68 sysV88
23249 Tek4132 Tek4300 thumb thw_370 thw_intel thw_rs6000 titan TM3200
23250 TM5400 TM5600 tower tower32 tower32_200 tower32_600 tower32_700
23251 tower32_800 tower32_850 tss
23252 u370 u3b u3b2 u3b20 u3b200 u3b20d u3b5 ultrix UMAXV UnicomPBB
23253 UnicomPBD UNICOS UNICOSMK unix UNIX95 UNIX99 unixpc unos USE_BSD
23254 USE_FILE_OFFSET64 USE_GNU USE_ISOC9X USE_LARGEFILE
23255 USE_LARGEFILE64 USE_MISC USE_POSIX USE_POSIX199309
23256 USE_POSIX199506 USE_POSIX2 USE_REENTRANT USE_SVID USE_UNIX98
23257 USE_XOPEN USE_XOPEN_EXTENDED USGr4 USGr4_2 UTek Utek UTS UWIN
23259 vax venix VMESA vms
23260 x86_64 xenix Xenix286 XOPEN_SOURCE XOPEN_SOURCE_EXTENDED XPG2
23261 XPG2_EXTENDED XPG3 XPG3_EXTENDED XPG4 XPG4_EXTENDED
23264 # Maybe put other stuff here too.
23265 ./tr '-' '_' <<EOSH >>Cppsym.know
23268 ./tr '[a-z]' '[A-Z]' < Cppsym.know > Cppsym.a
23269 ./tr '[A-Z]' '[a-z]' < Cppsym.know > Cppsym.b
23270 $cat Cppsym.know > Cppsym.c
23271 $cat Cppsym.a Cppsym.b Cppsym.c | $tr ' ' $trnl | $sort | $uniq > Cppsym.know
23272 $rm -f Cppsym.a Cppsym.b Cppsym.c
23273 cat <<EOSH > Cppsym
23275 if $test \$# -gt 0; then
23276 echo \$* | $tr " " "$trnl" | ./Cppsym.try > Cppsym.got
23277 if $test -s Cppsym.got; then
23284 $tr " " "$trnl" | ./Cppsym.try
23290 cat <<EOSH > Cppsym.try
23292 cat <<'EOCP' > try.c
23295 #define STRINGIFY(a) "a"
23297 #if cpp_stuff == 42
23298 #define StGiFy(a) #a
23299 #define STRINGIFY(a) StGiFy(a)
23301 #if $cpp_stuff != 1 && $cpp_stuff != 42
23302 # include "Bletch: How does this C preprocessor stringify macros?"
23308 cat <<'EOSH' >> Cppsym.try
23310 printf "#ifdef %s\nprintf(\"%s=%%s\\n\", STRINGIFY(%s));\n#endif\n", $1, $1, $1
23311 printf "#ifdef _%s\nprintf(\"_%s=%%s\\n\", STRINGIFY(_%s));\n#endif\n", $1, $1, $1
23312 printf "#ifdef __%s\nprintf(\"__%s=%%s\\n\", STRINGIFY(__%s));\n#endif\n", $1, $1, $1
23313 printf "#ifdef __%s__\nprintf(\"__%s__=%%s\\n\", STRINGIFY(__%s__));\n#endif\n", $1, $1, $1
23315 echo 'return 0;}' >> try.c
23317 cat <<EOSH >> Cppsym.try
23319 case "$osname-$gccversion" in
23320 irix-) ccflags="\$ccflags -woff 1178" ;;
23321 os2-*) ccflags="\$ccflags -Zlinker /PM:VIO" ;;
23323 $cc -o try -Dcpp_stuff=$cpp_stuff $optimize \$ccflags $ldflags try.c $libs 2>/dev/null && $run ./try | $sed 's/ /\\\\ /g'
23325 chmod +x Cppsym.try
23326 $eunicefix Cppsym.try
23327 ./Cppsym < Cppsym.know | $sort | $uniq > Cppsym.true
23328 : Add in any Linux cpp "predefined macros":
23329 case "$osname::$gccversion" in
23330 *linux*::*.*|*gnukfreebsd*::*.*|gnu::*.*)
23332 rm -f $tHdrH'.h' $tHdrH
23334 # Filter out macro arguments, such as Linux's __INT8_C(c)
23335 if $cpp -dM $tHdrH'.h' > $tHdrH'_cppsym.h' && [ -s $tHdrH'_cppsym.h' ]; then
23336 sed -e 's/#define[\ \ ]*//;s/[\ \ ].*$//' -e 's/(.*//' <$tHdrH'_cppsym.h' >$tHdrH'_cppsym.real'
23337 if [ -s $tHdrH'_cppsym.real' ]; then
23338 cat $tHdrH'_cppsym.real' Cppsym.know | sort | uniq | ./Cppsym | sort | uniq > Cppsym.true
23341 rm -f $tHdrH'.h' $tHdrH'_cppsym.h' $tHdrH'_cppsym.real'
23344 : now check the C compiler for additional symbols
23345 postprocess_cc_v=''
23347 aix) postprocess_cc_v="|$tr , ' '" ;;
23354 for i in \`$cc -v -c tmp.c 2>&1 $postprocess_cc_v\`
23357 -D*) echo "\$i" | $sed 's/^-D//';;
23358 -A*) $test "$gccversion" && echo "\$i" | $sed 's/^-A//' | $sed 's/\(.*\)(\(.*\))/\1=\2/';;
23363 postprocess_cc_v=''
23366 ./ccsym > ccsym1.raw
23367 if $test -s ccsym1.raw; then
23368 $sort ccsym1.raw | $uniq >ccsym.raw
23370 mv ccsym1.raw ccsym.raw
23373 $awk '/\=/ { print $0; next }
23374 { print $0"=1" }' ccsym.raw >ccsym.list
23375 $comm -13 Cppsym.true ccsym.list >ccsym.own
23376 $comm -12 Cppsym.true ccsym.list >ccsym.com
23377 $comm -23 Cppsym.true ccsym.list >ccsym.cpp
23379 if $test -z ccsym.raw; then
23380 echo "Your C compiler doesn't seem to define any symbols!" >&4
23382 echo "However, your C preprocessor defines the following symbols:"
23385 cppsymbols=`$cat Cppsym.true`
23386 cppsymbols=`echo $cppsymbols`
23387 cppccsymbols="$cppsymbols"
23389 if $test -s ccsym.com; then
23390 echo "Your C compiler and pre-processor define these symbols:"
23391 $sed -e 's/\(..*\)=.*/\1/' ccsym.com
23394 cppccsymbols=`$cat ccsym.com`
23395 cppccsymbols=`echo $cppccsymbols`
23396 $test "$silent" || sleep 1
23398 if $test -s ccsym.cpp; then
23399 $test "$also" && echo " "
23400 echo "Your C pre-processor ${also}defines the following symbols:"
23401 $sed -e 's/\(..*\)=.*/\1/' ccsym.cpp
23403 cppsymbols=`$cat ccsym.cpp`
23404 cppsymbols=`echo $cppsymbols`
23405 $test "$silent" || sleep 1
23407 if $test -s ccsym.own; then
23408 $test "$also" && echo " "
23409 echo "Your C compiler ${also}defines the following cpp symbols:"
23410 $sed -e 's/\(..*\)=1/\1/' ccsym.own
23411 $sed -e 's/\(..*\)=.*/\1/' ccsym.own | $uniq >>Cppsym.true
23412 ccsymbols=`$cat ccsym.own`
23413 ccsymbols=`echo $ccsymbols`
23414 $test "$silent" || sleep 1
23418 : add -D_FORTIFY_SOURCE if feasible and not already there
23419 case "$gccversion" in
23420 [45].*) case "$optimize$ccflags" in
23421 *-O*) case "$ccflags$cppsymbols" in
23422 *_FORTIFY_SOURCE=*) # Don't add it again.
23423 echo "You seem to have -D_FORTIFY_SOURCE already, not adding it." >&4
23425 *) echo "Adding -D_FORTIFY_SOURCE=2 to ccflags..." >&4
23426 ccflags="$ccflags -D_FORTIFY_SOURCE=2"
23430 *) echo "You have gcc 4.* or later but not optimizing, not adding -D_FORTIFY_SOURCE." >&4
23434 *) echo "You seem not to have gcc 4.* or later, not adding -D_FORTIFY_SOURCE." >&4
23438 : see if this is a termio system
23442 if $test `./findhdr termios.h`; then
23443 set tcsetattr i_termios
23449 "$define") echo "You have POSIX termios.h... good!" >&4;;
23450 *) if ./Cppsym pyr; then
23451 case "`$run /bin/universe`" in
23452 ucb) if $test `./findhdr sgtty.h`; then
23454 echo "<sgtty.h> found." >&4
23456 echo "System is pyramid with BSD universe."
23457 ./warn "<sgtty.h> not found--you could have problems."
23459 *) if $test `./findhdr termio.h`; then
23461 echo "<termio.h> found." >&4
23463 echo "System is pyramid with USG universe."
23464 ./warn "<termio.h> not found--you could have problems."
23468 if $test `./findhdr termio.h`; then
23469 echo "<termio.h> found." >&4
23471 elif $test `./findhdr sgtty.h`; then
23472 echo "<sgtty.h> found." >&4
23475 ./warn "Neither <termio.h> nor <sgtty.h> found--cross fingers!"
23478 if $test `./findhdr sgtty.h`; then
23479 echo "<sgtty.h> found." >&4
23481 elif $test `./findhdr termio.h`; then
23482 echo "<termio.h> found." >&4
23485 ./warn "Neither <sgtty.h> nor <termio.h> found--cross fingers!"
23489 set i_termio; eval $setvar
23490 val=$val2; set i_sgtty; eval $setvar
23491 val=$val3; set i_termios; eval $setvar
23493 : see if stdbool is available
23494 : we want a real compile instead of Inhdr because some Solaris systems
23495 : have stdbool.h, but it can only be used if the compiler indicates it
23496 : is sufficiently c99-compliant.
23500 #include <stdbool.h>
23505 int main(int argc, char **argv)
23511 if eval $compile; then
23512 echo "<stdbool.h> found." >&4
23515 echo "<stdbool.h> NOT found." >&4
23522 : see if stddef is available
23523 set stddef.h i_stddef
23526 : see if stdint is available
23527 set stdint.h i_stdint
23530 : see if sys/access.h is available
23531 set sys/access.h i_sysaccess
23534 : see if ioctl defs are in sgtty, termio, sys/filio or sys/ioctl
23535 set sys/filio.h i_sysfilio
23538 if $test `./findhdr sys/ioctl.h`; then
23540 echo '<sys/ioctl.h> found.' >&4
23543 if $test $i_sysfilio = "$define"; then
23544 echo '<sys/ioctl.h> NOT found.' >&4
23546 $test $i_sgtty = "$define" && xxx="sgtty.h"
23547 $test $i_termio = "$define" && xxx="termio.h"
23548 $test $i_termios = "$define" && xxx="termios.h"
23549 echo "No <sys/ioctl.h> found, assuming ioctl args are defined in <$xxx>." >&4
23555 : see if socket ioctl defs are in sys/sockio.h
23557 xxx=`./findhdr sys/sockio.h`
23558 if $test "$xxx"; then
23559 if $contains SIOCATMARK $xxx >/dev/null 2>&1; then
23561 echo "You have socket ioctls defined in <sys/sockio.h>." >&4
23564 echo "No socket ioctls found in <sys/sockio.h>." >&4
23569 <sys/sockio.h> not found, assuming socket ioctls are in <sys/ioctl.h>.
23575 : see if this is a syslog.h system
23576 set syslog.h i_syslog
23579 : see if this is a sys/mode.h system
23580 set sys/mode.h i_sysmode
23583 : see if there is a sys/poll.h file
23584 set sys/poll.h i_syspoll
23587 : see if sys/resource.h has to be included
23588 set sys/resource.h i_sysresrc
23591 : see if sys/security.h is available
23592 set sys/security.h i_syssecrt
23595 : see if this is a sys/statvfs.h system
23596 set sys/statvfs.h i_sysstatvfs
23599 : see if this is a sys/un.h system
23600 set sys/un.h i_sysun
23603 : see if this is a sys/utsname.h system
23604 set sys/utsname.h i_sysutsname
23607 : see if this is a syswait system
23608 set sys/wait.h i_syswait
23611 : see if this is a ustat.h system
23612 set ustat.h i_ustat
23615 : see if this is an utime system
23616 set utime.h i_utime
23619 : see if this is a vfork system
23622 set vfork.h i_vfork
23632 echo "Looking for extensions..." >&4
23633 : If we are using the old config.sh, nonxs_extensions and xs_extensions may
23634 : contain old or inaccurate or duplicate values.
23635 nonxs_extensions=''
23637 : We do not use find because it might not be available.
23638 : We do not just use MANIFEST because the user may have dropped
23639 : some additional extensions into the source tree and expect them
23642 : Function to recursively find available extensions, ignoring DynaLoader
23643 : NOTE: recursion limit of 10 to prevent runaway in case of symlink madness
23644 : In 5.10.1 and later, extensions are stored in directories
23645 : like File-Glob instead of the older File/Glob/.
23649 DynaLoader|dynaload) ;;
23651 this_ext=`echo "$xxx" | $sed -e s/-/\\\//g`;
23652 case "$this_ext" in
23653 Scalar/List/Utils) this_ext="List/Util" ;;
23654 PathTools) this_ext="Cwd" ;;
23656 echo " $xs_extensions $nonxs_extensions" > "$tdir/$$.tmp";
23657 if $contains " $this_ext " "$tdir/$$.tmp"; then
23659 echo "Duplicate directories detected for extension $xxx" >&4;
23660 echo "Configure cannot correctly recover from this - shall I abort?" >&4;
23661 case "$knowitall" in
23669 echo "Ok. Stopping Configure." >&4;
23670 echo "Please remove the duplicate directory (e.g. using git clean) and then re-run Configure" >&4;
23673 echo "Ok. You will need to correct config.sh before running make." >&4;
23675 $ls -1 "$xxx" > "$tdir/$$.tmp";
23676 if $contains "\.xs$" "$tdir/$$.tmp" > /dev/null 2>&1; then
23677 xs_extensions="$xs_extensions $this_ext";
23678 elif $contains "\.c$" "$tdir/$$.tmp" > /dev/null 2>&1; then
23679 xs_extensions="$xs_extensions $this_ext";
23680 elif $test -d "$xxx"; then
23681 nonxs_extensions="$nonxs_extensions $this_ext";
23683 $rm -f "$tdir/$$.tmp";
23691 eval $find_extensions
23695 eval $find_extensions
23699 eval $find_extensions
23700 set X $xs_extensions
23702 xs_extensions=`echo "$*" | tr ' ' $trnl | $sort | tr $trnl ' '`
23703 set X $nonxs_extensions
23705 nonxs_extensions=`echo "$*" | tr ' ' $trnl | $sort | tr $trnl ' '`
23707 known_extensions=`echo $nonxs_extensions $xs_extensions | tr ' ' $trnl | $sort | tr $trnl ' '`
23709 : Now see which are supported on this system.
23711 for xxx in $xs_extensions ; do
23715 amigaos) avail_ext="$avail_ext $xxx" ;;
23720 $define) avail_ext="$avail_ext $xxx" ;;
23723 GDBM_File|gdbm_fil)
23725 $define) avail_ext="$avail_ext $xxx" ;;
23728 I18N/Langinfo|i18n_lan)
23729 case "$i_langinfo$d_nl_langinfo" in
23730 $define$define) avail_ext="$avail_ext $xxx" ;;
23734 : XXX Do we need a useipcsysv variable here
23735 case "${d_msg}${d_sem}${d_shm}" in
23736 *"${define}"*) avail_ext="$avail_ext $xxx" ;;
23739 NDBM_File|ndbm_fil)
23742 case "$osname-$use64bitint" in
23745 *-lndbm*) avail_ext="$avail_ext $xxx" ;;
23748 *) avail_ext="$avail_ext $xxx" ;;
23753 ODBM_File|odbm_fil)
23754 case "${i_dbm}${i_rpcsvcdbm}" in
23756 case "$d_cplusplus" in
23757 define) ;; # delete as a function name will not work
23758 *) case "$osname-$use64bitint" in
23761 *-ldbm*) avail_ext="$avail_ext $xxx" ;;
23764 *) avail_ext="$avail_ext $xxx" ;;
23772 case "$useopcode" in
23773 true|define|y) avail_ext="$avail_ext $xxx" ;;
23777 case "$useposix" in
23778 true|define|y) avail_ext="$avail_ext $xxx" ;;
23782 case "$d_socket" in
23783 true|$define|y) avail_ext="$avail_ext $xxx" ;;
23786 Sys/Syslog|sys/syslog)
23788 amigaos) ;; # not really very useful on AmigaOS
23790 : XXX syslog requires socket
23791 case "$d_socket" in
23792 true|$define|y) avail_ext="$avail_ext $xxx" ;;
23798 case "$usethreads" in
23800 case "$use5005threads" in
23801 $define|true|[yY]*) avail_ext="$avail_ext $xxx" ;;
23805 threads|threads/shared)
23806 # threads and threads::shared are special cases.
23807 # To stop people from asking "Perl 5.8.0 was supposed
23808 # to have this new fancy threads implementation but my
23809 # perl doesn't have it" and from people trying to
23810 # (re)install the threads module using CPAN.pm and
23811 # CPAN.pm then offering to reinstall Perl 5.8.0,
23812 # the threads.pm and threads/shared.pm will always be
23813 # there, croaking informatively ("you need to rebuild
23814 # all of Perl with threads, sorry") when threads haven't
23815 # been compiled in.
23817 avail_ext="$avail_ext $xxx"
23823 cygwin) avail_ext="$avail_ext $xxx" ;;
23826 XS/APItest|xs/apitest)
23827 # This is just for testing. Skip it unless we have dynamic loading.
23830 $define) avail_ext="$avail_ext $xxx" ;;
23833 XS/Typemap|xs/typemap)
23834 # This is just for testing. Skip it unless we have dynamic loading.
23836 $define) avail_ext="$avail_ext $xxx" ;;
23839 *) avail_ext="$avail_ext $xxx"
23848 case "$onlyextensions" in
23850 *) keepextensions=''
23851 echo "You have requested that only certain extensions be included..." >&4
23852 for i in $onlyextensions; do
23853 case " $avail_ext " in
23855 echo "Keeping extension $i."
23856 keepextensions="$keepextensions $i"
23858 *) echo "Ignoring extension $i." ;;
23861 avail_ext="$keepextensions"
23865 case "$noextensions" in
23867 *) keepextensions=''
23868 echo "You have requested that certain extensions be ignored..." >&4
23869 for i in $avail_ext; do
23870 case " $noextensions " in
23871 *" $i "*) echo "Ignoring extension $i." ;;
23872 *) echo "Keeping extension $i.";
23873 keepextensions="$keepextensions $i"
23877 avail_ext="$keepextensions"
23881 : Now see which nonxs extensions are supported on this system.
23882 : For now assume all are.
23884 for xxx in $nonxs_extensions ; do
23888 *) nonxs_ext="$nonxs_ext $xxx"
23900 A number of extensions are supplied with $package. You may choose to
23901 compile these extensions for dynamic loading (the default), compile
23902 them into the $package executable (static loading), or not include
23903 them at all. Answer "none" to include no extensions.
23904 Note that DynaLoader is always built and need not be mentioned here.
23907 case "$dynamic_ext" in
23909 : Exclude those listed in static_ext
23911 for xxx in $avail_ext; do
23912 case " $static_ext " in
23914 *) dflt="$dflt $xxx" ;;
23921 *) dflt="$dynamic_ext"
23922 # Perhaps we are reusing an old out-of-date config.sh.
23925 if test X"$dynamic_ext" != X"$avail_ext"; then
23927 NOTICE: Your previous config.sh list may be incorrect.
23928 The extensions now available to you are
23930 but the default list from your previous config.sh is
23942 rp="What extensions do you wish to load dynamically?"
23945 none) dynamic_ext=' ' ;;
23946 *) dynamic_ext="$ans" ;;
23949 case "$static_ext" in
23951 : Exclude those already listed in dynamic linking
23953 for xxx in $avail_ext; do
23954 case " $dynamic_ext " in
23956 *) dflt="$dflt $xxx" ;;
23963 *) dflt="$static_ext"
23970 rp="What extensions do you wish to load statically?"
23973 none) static_ext=' ' ;;
23974 *) static_ext="$ans" ;;
23979 A number of extensions are supplied with $package. Answer "none"
23980 to include no extensions.
23981 Note that DynaLoader is always built and need not be mentioned here.
23984 case "$static_ext" in
23985 '') dflt="$avail_ext" ;;
23986 *) dflt="$static_ext"
23987 # Perhaps we are reusing an old out-of-date config.sh.
23990 if test X"$static_ext" != X"$avail_ext"; then
23992 NOTICE: Your previous config.sh list may be incorrect.
23993 The extensions now available to you are
23995 but the default list from your previous config.sh is
24004 : Exclude those that are not xs extensions
24008 rp="What extensions do you wish to include?"
24011 none) static_ext=' ' ;;
24012 *) static_ext="$ans" ;;
24017 # Encode is a special case. If we are building Encode as a static
24018 # extension, we need to explicitly list its subextensions as well.
24019 # For other nested extensions, this is handled automatically by
24020 # the appropriate Makefile.PL.
24021 case " $static_ext " in
24022 *" Encode "*) # Add the subextensions of Encode
24024 for xxx in `ls Encode/*/Makefile.PL|awk -F/ '{print $2}'`; do
24025 static_ext="$static_ext Encode/$xxx"
24026 known_extensions="$known_extensions Encode/$xxx"
24032 set X $dynamic_ext $static_ext $nonxs_ext
24036 # Sanity check: We require an extension suitable for use with
24037 # AnyDBM_File, as well as Fcntl and IO. (Failure to have these
24038 # should show up as failures in the test suite, but it's helpful to
24039 # catch them now.) The 'extensions' list is normally sorted
24040 # alphabetically, so we need to accept either
24041 # DB_File ... Fcntl ... IO ....
24042 # or something like
24043 # Fcntl ... NDBM_File ... IO ....
24044 case " $extensions" in
24045 *"_File "*" Fcntl "*" IO "*) ;; # DB_File
24046 *" Fcntl "*"_File "*" IO "*) ;; # GDBM_File
24047 *" Fcntl "*" IO "*"_File "*) ;; # NDBM_File
24048 *) echo "WARNING: Extensions DB_File or *DBM_File, Fcntl, and IO not configured." >&4
24049 echo "WARNING: The Perl you are building will be quite crippled." >& 4
24053 : Remove libraries needed only for extensions
24054 : The appropriate ext/Foo/Makefile.PL will add them back in, if necessary.
24055 : The exception is SunOS 4.x, which needs them.
24056 case "${osname}X${osvers}" in
24060 *) case "$usedl" in
24061 $define|true|[yY]*)
24062 set X `echo " $libs " | sed -e 's@ -lndbm @ @' -e 's@ -lgdbm @ @' -e 's@ -lgdbm_compat @ @' -e 's@ -ldbm @ @' -e 's@ -ldb @ @'`
24066 *) perllibs="$libs"
24072 : Remove build directory name from cppstdin so it can be used from
24073 : either the present location or the final installed location.
24075 : Get out of the UU directory to get correct path name.
24077 case "$cppstdin" in
24079 echo "Stripping down cppstdin path name"
24085 : end of configuration questions
24087 echo "End of configuration questions."
24090 : back to where it started
24091 if test -d ../UU; then
24095 : configuration may be unconditionally patched via a 'config.arch' file
24096 if $test -f config.arch; then
24097 echo "I see a config.arch file, loading it." >&4
24101 : configuration may be patched via a 'config.over' file
24102 if $test -f config.over; then
24105 rp='I see a config.over file. Do you wish to load it?'
24108 n*) echo "OK, I'll ignore it.";;
24110 echo "Configuration override changes have been loaded."
24115 : in case they want portability, strip down executable paths
24116 case "$d_portable" in
24119 echo "Stripping down executable paths..." >&4
24120 for file in $loclist $trylist; do
24122 eval $file=`basename $temp`
24127 : create config.sh file
24129 echo "Creating config.sh..." >&4
24130 $spitshell <<EOT >config.sh
24133 # This file was produced by running the Configure script. It holds all the
24134 # definitions figured out by Configure. Should you modify one of these values,
24135 # do not forget to propagate your changes by running "Configure -der". You may
24136 # instead choose to run each of the .SH files by yourself, or "Configure -S".
24139 # Package name : $package
24140 # Source directory : $src
24141 # Configuration time: $cf_time
24142 # Configured by : $cf_by
24143 # Target system : $myuname
24146 : Add in command line options if available
24147 $test -f UU/cmdline.opt && $cat UU/cmdline.opt >> config.sh
24149 $spitshell <<EOT >>config.sh
24158 Revision='$Revision'
24166 alignbytes='$alignbytes'
24167 ansi2knr='$ansi2knr'
24168 aphostname='$aphostname'
24169 api_revision='$api_revision'
24170 api_subversion='$api_subversion'
24171 api_version='$api_version'
24172 api_versionstring='$api_versionstring'
24175 archlibexp='$archlibexp'
24176 archname64='$archname64'
24177 archname='$archname'
24178 archobjs='$archobjs'
24179 asctime_r_proto='$asctime_r_proto'
24188 byteorder='$byteorder'
24190 castflags='$castflags'
24193 cccdlflags='$cccdlflags'
24194 ccdlflags='$ccdlflags'
24196 ccflags_uselargefiles='$ccflags_uselargefiles'
24198 ccsymbols='$ccsymbols'
24199 ccversion='$ccversion'
24201 cf_email='$cf_email'
24203 charbits='$charbits'
24204 charsize='$charsize'
24208 clocktype='$clocktype'
24210 compress='$compress'
24211 contains='$contains'
24215 cpp_stuff='$cpp_stuff'
24216 cppccsymbols='$cppccsymbols'
24217 cppflags='$cppflags'
24219 cppminus='$cppminus'
24221 cppstdin='$cppstdin'
24222 cppsymbols='$cppsymbols'
24223 crypt_r_proto='$crypt_r_proto'
24224 cryptlib='$cryptlib'
24226 ctermid_r_proto='$ctermid_r_proto'
24227 ctime_r_proto='$ctime_r_proto'
24228 d_Gconvert='$d_Gconvert'
24229 d_PRIEUldbl='$d_PRIEUldbl'
24230 d_PRIFUldbl='$d_PRIFUldbl'
24231 d_PRIGUldbl='$d_PRIGUldbl'
24232 d_PRIXU64='$d_PRIXU64'
24233 d_PRId64='$d_PRId64'
24234 d_PRIeldbl='$d_PRIeldbl'
24235 d_PRIfldbl='$d_PRIfldbl'
24236 d_PRIgldbl='$d_PRIgldbl'
24237 d_PRIi64='$d_PRIi64'
24238 d_PRIo64='$d_PRIo64'
24239 d_PRIu64='$d_PRIu64'
24240 d_PRIx64='$d_PRIx64'
24241 d_SCNfldbl='$d_SCNfldbl'
24242 d__fwalk='$d__fwalk'
24243 d_access='$d_access'
24244 d_accessx='$d_accessx'
24248 d_archlib='$d_archlib'
24249 d_asctime64='$d_asctime64'
24250 d_asctime_r='$d_asctime_r'
24255 d_attribute_deprecated='$d_attribute_deprecated'
24256 d_attribute_format='$d_attribute_format'
24257 d_attribute_malloc='$d_attribute_malloc'
24258 d_attribute_nonnull='$d_attribute_nonnull'
24259 d_attribute_noreturn='$d_attribute_noreturn'
24260 d_attribute_pure='$d_attribute_pure'
24261 d_attribute_unused='$d_attribute_unused'
24262 d_attribute_warn_unused_result='$d_attribute_warn_unused_result'
24263 d_backtrace='$d_backtrace'
24267 d_bsdgetpgrp='$d_bsdgetpgrp'
24268 d_bsdsetpgrp='$d_bsdsetpgrp'
24269 d_builtin_choose_expr='$d_builtin_choose_expr'
24270 d_builtin_expect='$d_builtin_expect'
24272 d_c99_variadic_macros='$d_c99_variadic_macros'
24273 d_casti32='$d_casti32'
24274 d_castneg='$d_castneg'
24276 d_charvspr='$d_charvspr'
24278 d_chroot='$d_chroot'
24279 d_chsize='$d_chsize'
24281 d_clearenv='$d_clearenv'
24282 d_closedir='$d_closedir'
24283 d_cmsghdr_s='$d_cmsghdr_s'
24285 d_copysign='$d_copysign'
24286 d_copysignl='$d_copysignl'
24287 d_cplusplus='$d_cplusplus'
24289 d_crypt_r='$d_crypt_r'
24291 d_ctermid='$d_ctermid'
24292 d_ctermid_r='$d_ctermid_r'
24293 d_ctime64='$d_ctime64'
24294 d_ctime_r='$d_ctime_r'
24295 d_cuserid='$d_cuserid'
24296 d_dbl_dig='$d_dbl_dig'
24297 d_dbminitproto='$d_dbminitproto'
24298 d_difftime64='$d_difftime64'
24299 d_difftime='$d_difftime'
24300 d_dir_dd_fd='$d_dir_dd_fd'
24302 d_dirnamlen='$d_dirnamlen'
24303 d_dladdr='$d_dladdr'
24304 d_dlerror='$d_dlerror'
24305 d_dlopen='$d_dlopen'
24306 d_dlsymun='$d_dlsymun'
24307 d_dosuid='$d_dosuid'
24308 d_drand48_r='$d_drand48_r'
24309 d_drand48proto='$d_drand48proto'
24311 d_eaccess='$d_eaccess'
24312 d_endgrent='$d_endgrent'
24313 d_endgrent_r='$d_endgrent_r'
24314 d_endhent='$d_endhent'
24315 d_endhostent_r='$d_endhostent_r'
24316 d_endnent='$d_endnent'
24317 d_endnetent_r='$d_endnetent_r'
24318 d_endpent='$d_endpent'
24319 d_endprotoent_r='$d_endprotoent_r'
24320 d_endpwent='$d_endpwent'
24321 d_endpwent_r='$d_endpwent_r'
24322 d_endsent='$d_endsent'
24323 d_endservent_r='$d_endservent_r'
24324 d_eofnblk='$d_eofnblk'
24327 d_eunice='$d_eunice'
24330 d_faststdio='$d_faststdio'
24331 d_fchdir='$d_fchdir'
24332 d_fchmod='$d_fchmod'
24333 d_fchown='$d_fchown'
24335 d_fcntl_can_lock='$d_fcntl_can_lock'
24336 d_fd_macros='$d_fd_macros'
24337 d_fd_set='$d_fd_set'
24338 d_fdclose='$d_fdclose'
24340 d_fds_bits='$d_fds_bits'
24341 d_fegetround='$d_fegetround'
24342 d_fgetpos='$d_fgetpos'
24343 d_finite='$d_finite'
24344 d_finitel='$d_finitel'
24345 d_flexfnam='$d_flexfnam'
24347 d_flockproto='$d_flockproto'
24352 d_fp_class='$d_fp_class'
24353 d_fp_classify='$d_fp_classify'
24354 d_fp_classl='$d_fp_classl'
24355 d_fpathconf='$d_fpathconf'
24356 d_fpclass='$d_fpclass'
24357 d_fpclassify='$d_fpclassify'
24358 d_fpclassl='$d_fpclassl'
24359 d_fpgetround='$d_fpgetround'
24360 d_fpos64_t='$d_fpos64_t'
24361 d_freelocale='$d_freelocale'
24362 d_frexpl='$d_frexpl'
24363 d_fs_data_s='$d_fs_data_s'
24364 d_fseeko='$d_fseeko'
24365 d_fsetpos='$d_fsetpos'
24366 d_fstatfs='$d_fstatfs'
24367 d_fstatvfs='$d_fstatvfs'
24369 d_ftello='$d_ftello'
24371 d_futimes='$d_futimes'
24372 d_gdbm_ndbm_h_uses_prototypes='$d_gdbm_ndbm_h_uses_prototypes'
24373 d_gdbmndbm_h_uses_prototypes='$d_gdbmndbm_h_uses_prototypes'
24374 d_getaddrinfo='$d_getaddrinfo'
24375 d_getcwd='$d_getcwd'
24376 d_getespwnam='$d_getespwnam'
24377 d_getfsstat='$d_getfsstat'
24378 d_getgrent='$d_getgrent'
24379 d_getgrent_r='$d_getgrent_r'
24380 d_getgrgid_r='$d_getgrgid_r'
24381 d_getgrnam_r='$d_getgrnam_r'
24382 d_getgrps='$d_getgrps'
24383 d_gethbyaddr='$d_gethbyaddr'
24384 d_gethbyname='$d_gethbyname'
24385 d_gethent='$d_gethent'
24386 d_gethname='$d_gethname'
24387 d_gethostbyaddr_r='$d_gethostbyaddr_r'
24388 d_gethostbyname_r='$d_gethostbyname_r'
24389 d_gethostent_r='$d_gethostent_r'
24390 d_gethostprotos='$d_gethostprotos'
24391 d_getitimer='$d_getitimer'
24392 d_getlogin='$d_getlogin'
24393 d_getlogin_r='$d_getlogin_r'
24394 d_getmnt='$d_getmnt'
24395 d_getmntent='$d_getmntent'
24396 d_getnameinfo='$d_getnameinfo'
24397 d_getnbyaddr='$d_getnbyaddr'
24398 d_getnbyname='$d_getnbyname'
24399 d_getnent='$d_getnent'
24400 d_getnetbyaddr_r='$d_getnetbyaddr_r'
24401 d_getnetbyname_r='$d_getnetbyname_r'
24402 d_getnetent_r='$d_getnetent_r'
24403 d_getnetprotos='$d_getnetprotos'
24404 d_getpagsz='$d_getpagsz'
24405 d_getpbyname='$d_getpbyname'
24406 d_getpbynumber='$d_getpbynumber'
24407 d_getpent='$d_getpent'
24408 d_getpgid='$d_getpgid'
24409 d_getpgrp2='$d_getpgrp2'
24410 d_getpgrp='$d_getpgrp'
24411 d_getppid='$d_getppid'
24412 d_getprior='$d_getprior'
24413 d_getprotobyname_r='$d_getprotobyname_r'
24414 d_getprotobynumber_r='$d_getprotobynumber_r'
24415 d_getprotoent_r='$d_getprotoent_r'
24416 d_getprotoprotos='$d_getprotoprotos'
24417 d_getprpwnam='$d_getprpwnam'
24418 d_getpwent='$d_getpwent'
24419 d_getpwent_r='$d_getpwent_r'
24420 d_getpwnam_r='$d_getpwnam_r'
24421 d_getpwuid_r='$d_getpwuid_r'
24422 d_getsbyname='$d_getsbyname'
24423 d_getsbyport='$d_getsbyport'
24424 d_getsent='$d_getsent'
24425 d_getservbyname_r='$d_getservbyname_r'
24426 d_getservbyport_r='$d_getservbyport_r'
24427 d_getservent_r='$d_getservent_r'
24428 d_getservprotos='$d_getservprotos'
24429 d_getspnam='$d_getspnam'
24430 d_getspnam_r='$d_getspnam_r'
24431 d_gettimeod='$d_gettimeod'
24432 d_gmtime64='$d_gmtime64'
24433 d_gmtime_r='$d_gmtime_r'
24434 d_gnulibc='$d_gnulibc'
24435 d_grpasswd='$d_grpasswd'
24436 d_hasmntopt='$d_hasmntopt'
24440 d_ilogbl='$d_ilogbl'
24441 d_inc_version_list='$d_inc_version_list'
24443 d_inetaton='$d_inetaton'
24444 d_inetntop='$d_inetntop'
24445 d_inetpton='$d_inetpton'
24446 d_int64_t='$d_int64_t'
24447 d_ip_mreq='$d_ip_mreq'
24448 d_ip_mreq_source='$d_ip_mreq_source'
24449 d_ipv6_mreq='$d_ipv6_mreq'
24450 d_ipv6_mreq_source='$d_ipv6_mreq_source'
24451 d_isascii='$d_isascii'
24452 d_isblank='$d_isblank'
24453 d_isfinite='$d_isfinite'
24454 d_isfinitel='$d_isfinitel'
24456 d_isinfl='$d_isinfl'
24457 d_isless='$d_isless'
24459 d_isnanl='$d_isnanl'
24460 d_isnormal='$d_isnormal'
24463 d_killpg='$d_killpg'
24464 d_lc_monetary_2008='$d_lc_monetary_2008'
24465 d_lchown='$d_lchown'
24466 d_ldbl_dig='$d_ldbl_dig'
24467 d_ldexpl='$d_ldexpl'
24468 d_lgamma='$d_lgamma'
24469 d_lgamma_r='$d_lgamma_r'
24470 d_libm_lib_version='$d_libm_lib_version'
24471 d_libname_unique='$d_libname_unique'
24473 d_llrint='$d_llrint'
24474 d_llrintl='$d_llrintl'
24475 d_llround='$d_llround'
24476 d_llroundl='$d_llroundl'
24477 d_localtime64='$d_localtime64'
24478 d_localtime_r='$d_localtime_r'
24479 d_localtime_r_needs_tzset='$d_localtime_r_needs_tzset'
24480 d_locconv='$d_locconv'
24485 d_longdbl='$d_longdbl'
24486 d_longlong='$d_longlong'
24488 d_lrintl='$d_lrintl'
24489 d_lround='$d_lround'
24490 d_lroundl='$d_lroundl'
24491 d_lseekproto='$d_lseekproto'
24493 d_madvise='$d_madvise'
24494 d_malloc_good_size='$d_malloc_good_size'
24495 d_malloc_size='$d_malloc_size'
24497 d_mbstowcs='$d_mbstowcs'
24498 d_mbtowc='$d_mbtowc'
24499 d_memchr='$d_memchr'
24500 d_memcmp='$d_memcmp'
24501 d_memcpy='$d_memcpy'
24502 d_memmem='$d_memmem'
24503 d_memmove='$d_memmove'
24504 d_memset='$d_memset'
24506 d_mkdtemp='$d_mkdtemp'
24507 d_mkfifo='$d_mkfifo'
24508 d_mkstemp='$d_mkstemp'
24509 d_mkstemps='$d_mkstemps'
24510 d_mktime64='$d_mktime64'
24511 d_mktime='$d_mktime'
24514 d_modfl_pow32_bug='$d_modfl_pow32_bug'
24515 d_modflproto='$d_modflproto'
24516 d_mprotect='$d_mprotect'
24518 d_msg_ctrunc='$d_msg_ctrunc'
24519 d_msg_dontroute='$d_msg_dontroute'
24520 d_msg_oob='$d_msg_oob'
24521 d_msg_peek='$d_msg_peek'
24522 d_msg_proxy='$d_msg_proxy'
24523 d_msgctl='$d_msgctl'
24524 d_msgget='$d_msgget'
24525 d_msghdr_s='$d_msghdr_s'
24526 d_msgrcv='$d_msgrcv'
24527 d_msgsnd='$d_msgsnd'
24529 d_munmap='$d_munmap'
24530 d_mymalloc='$d_mymalloc'
24533 d_ndbm_h_uses_prototypes='$d_ndbm_h_uses_prototypes'
24534 d_nearbyint='$d_nearbyint'
24535 d_newlocale='$d_newlocale'
24536 d_nextafter='$d_nextafter'
24537 d_nexttoward='$d_nexttoward'
24539 d_nl_langinfo='$d_nl_langinfo'
24540 d_nv_preserves_uv='$d_nv_preserves_uv'
24541 d_nv_zero_is_allbits_zero='$d_nv_zero_is_allbits_zero'
24542 d_off64_t='$d_off64_t'
24543 d_old_pthread_create_joinable='$d_old_pthread_create_joinable'
24544 d_oldpthreads='$d_oldpthreads'
24545 d_oldsock='$d_oldsock'
24547 d_pathconf='$d_pathconf'
24549 d_perl_otherlibdirs='$d_perl_otherlibdirs'
24550 d_phostname='$d_phostname'
24553 d_portable='$d_portable'
24555 d_prctl_set_name='$d_prctl_set_name'
24556 d_printf_format_null='$d_printf_format_null'
24557 d_procselfexe='$d_procselfexe'
24558 d_pseudofork='$d_pseudofork'
24559 d_pthread_atfork='$d_pthread_atfork'
24560 d_pthread_attr_setscope='$d_pthread_attr_setscope'
24561 d_pthread_yield='$d_pthread_yield'
24562 d_ptrdiff_t='$d_ptrdiff_t'
24564 d_pwchange='$d_pwchange'
24565 d_pwclass='$d_pwclass'
24566 d_pwcomment='$d_pwcomment'
24567 d_pwexpire='$d_pwexpire'
24568 d_pwgecos='$d_pwgecos'
24569 d_pwpasswd='$d_pwpasswd'
24570 d_pwquota='$d_pwquota'
24573 d_random_r='$d_random_r'
24574 d_re_comp='$d_re_comp'
24575 d_readdir64_r='$d_readdir64_r'
24576 d_readdir='$d_readdir'
24577 d_readdir_r='$d_readdir_r'
24578 d_readlink='$d_readlink'
24580 d_recvmsg='$d_recvmsg'
24581 d_regcmp='$d_regcmp'
24582 d_regcomp='$d_regcomp'
24583 d_remainder='$d_remainder'
24584 d_remquo='$d_remquo'
24585 d_rename='$d_rename'
24586 d_rewinddir='$d_rewinddir'
24590 d_safebcpy='$d_safebcpy'
24591 d_safemcpy='$d_safemcpy'
24592 d_sanemcmp='$d_sanemcmp'
24593 d_sbrkproto='$d_sbrkproto'
24594 d_scalbn='$d_scalbn'
24595 d_scalbnl='$d_scalbnl'
24596 d_sched_yield='$d_sched_yield'
24597 d_scm_rights='$d_scm_rights'
24598 d_seekdir='$d_seekdir'
24599 d_select='$d_select'
24601 d_semctl='$d_semctl'
24602 d_semctl_semid_ds='$d_semctl_semid_ds'
24603 d_semctl_semun='$d_semctl_semun'
24604 d_semget='$d_semget'
24606 d_sendmsg='$d_sendmsg'
24607 d_setegid='$d_setegid'
24608 d_seteuid='$d_seteuid'
24609 d_setgrent='$d_setgrent'
24610 d_setgrent_r='$d_setgrent_r'
24611 d_setgrps='$d_setgrps'
24612 d_sethent='$d_sethent'
24613 d_sethostent_r='$d_sethostent_r'
24614 d_setitimer='$d_setitimer'
24615 d_setlinebuf='$d_setlinebuf'
24616 d_setlocale='$d_setlocale'
24617 d_setlocale_r='$d_setlocale_r'
24618 d_setnent='$d_setnent'
24619 d_setnetent_r='$d_setnetent_r'
24620 d_setpent='$d_setpent'
24621 d_setpgid='$d_setpgid'
24622 d_setpgrp2='$d_setpgrp2'
24623 d_setpgrp='$d_setpgrp'
24624 d_setprior='$d_setprior'
24625 d_setproctitle='$d_setproctitle'
24626 d_setprotoent_r='$d_setprotoent_r'
24627 d_setpwent='$d_setpwent'
24628 d_setpwent_r='$d_setpwent_r'
24629 d_setregid='$d_setregid'
24630 d_setresgid='$d_setresgid'
24631 d_setresuid='$d_setresuid'
24632 d_setreuid='$d_setreuid'
24633 d_setrgid='$d_setrgid'
24634 d_setruid='$d_setruid'
24635 d_setsent='$d_setsent'
24636 d_setservent_r='$d_setservent_r'
24637 d_setsid='$d_setsid'
24638 d_setvbuf='$d_setvbuf'
24641 d_shmatprototype='$d_shmatprototype'
24642 d_shmctl='$d_shmctl'
24644 d_shmget='$d_shmget'
24645 d_sigaction='$d_sigaction'
24646 d_siginfo_si_errno='$d_siginfo_si_errno'
24647 d_siginfo_si_pid='$d_siginfo_si_pid'
24648 d_siginfo_si_uid='$d_siginfo_si_uid'
24649 d_siginfo_si_addr='$d_siginfo_si_addr'
24650 d_siginfo_si_status='$d_siginfo_si_status'
24651 d_siginfo_si_band='$d_siginfo_si_band'
24652 d_siginfo_si_value='$d_siginfo_si_value'
24653 d_signbit='$d_signbit'
24654 d_sigprocmask='$d_sigprocmask'
24655 d_sigsetjmp='$d_sigsetjmp'
24656 d_sin6_scope_id='$d_sin6_scope_id'
24657 d_sitearch='$d_sitearch'
24658 d_snprintf='$d_snprintf'
24659 d_sockaddr_in6='$d_sockaddr_in6'
24660 d_sockaddr_sa_len='$d_sockaddr_sa_len'
24661 d_sockatmark='$d_sockatmark'
24662 d_sockatmarkproto='$d_sockatmarkproto'
24663 d_socket='$d_socket'
24664 d_socklen_t='$d_socklen_t'
24665 d_sockpair='$d_sockpair'
24666 d_socks5_init='$d_socks5_init'
24667 d_sprintf_returns_strlen='$d_sprintf_returns_strlen'
24669 d_srand48_r='$d_srand48_r'
24670 d_srandom_r='$d_srandom_r'
24671 d_sresgproto='$d_sresgproto'
24672 d_sresuproto='$d_sresuproto'
24674 d_statblks='$d_statblks'
24675 d_statfs_f_flags='$d_statfs_f_flags'
24676 d_statfs_s='$d_statfs_s'
24677 d_static_inline='$d_static_inline'
24678 d_statvfs='$d_statvfs'
24679 d_stdio_cnt_lval='$d_stdio_cnt_lval'
24680 d_stdio_ptr_lval='$d_stdio_ptr_lval'
24681 d_stdio_ptr_lval_nochange_cnt='$d_stdio_ptr_lval_nochange_cnt'
24682 d_stdio_ptr_lval_sets_cnt='$d_stdio_ptr_lval_sets_cnt'
24683 d_stdio_stream_array='$d_stdio_stream_array'
24684 d_stdiobase='$d_stdiobase'
24685 d_stdstdio='$d_stdstdio'
24686 d_strchr='$d_strchr'
24687 d_strcoll='$d_strcoll'
24688 d_strctcpy='$d_strctcpy'
24689 d_strerrm='$d_strerrm'
24690 d_strerror='$d_strerror'
24691 d_strerror_r='$d_strerror_r'
24692 d_strftime='$d_strftime'
24693 d_strlcat='$d_strlcat'
24694 d_strlcpy='$d_strlcpy'
24695 d_strtod='$d_strtod'
24696 d_strtol='$d_strtol'
24697 d_strtold='$d_strtold'
24698 d_strtoll='$d_strtoll'
24699 d_strtoq='$d_strtoq'
24700 d_strtoul='$d_strtoul'
24701 d_strtoull='$d_strtoull'
24702 d_strtouq='$d_strtouq'
24703 d_strxfrm='$d_strxfrm'
24704 d_suidsafe='$d_suidsafe'
24705 d_symlink='$d_symlink'
24706 d_syscall='$d_syscall'
24707 d_syscallproto='$d_syscallproto'
24708 d_sysconf='$d_sysconf'
24709 d_sysernlst='$d_sysernlst'
24710 d_syserrlst='$d_syserrlst'
24711 d_system='$d_system'
24712 d_tcgetpgrp='$d_tcgetpgrp'
24713 d_tcsetpgrp='$d_tcsetpgrp'
24714 d_telldir='$d_telldir'
24715 d_telldirproto='$d_telldirproto'
24716 d_tgamma='$d_tgamma'
24718 d_timegm='$d_timegm'
24720 d_tm_tm_gmtoff='$d_tm_tm_gmtoff'
24721 d_tm_tm_zone='$d_tm_tm_zone'
24722 d_tmpnam_r='$d_tmpnam_r'
24724 d_truncate='$d_truncate'
24725 d_truncl='$d_truncl'
24726 d_ttyname_r='$d_ttyname_r'
24727 d_tzname='$d_tzname'
24728 d_u32align='$d_u32align'
24729 d_ualarm='$d_ualarm'
24732 d_union_semun='$d_union_semun'
24733 d_unordered='$d_unordered'
24734 d_unsetenv='$d_unsetenv'
24735 d_uselocale='$d_uselocale'
24736 d_usleep='$d_usleep'
24737 d_usleepproto='$d_usleepproto'
24739 d_vendorarch='$d_vendorarch'
24740 d_vendorbin='$d_vendorbin'
24741 d_vendorlib='$d_vendorlib'
24742 d_vendorscript='$d_vendorscript'
24744 d_void_closedir='$d_void_closedir'
24745 d_voidsig='$d_voidsig'
24746 d_voidtty='$d_voidtty'
24747 d_volatile='$d_volatile'
24748 d_vprintf='$d_vprintf'
24749 d_vsnprintf='$d_vsnprintf'
24751 d_waitpid='$d_waitpid'
24752 d_wcscmp='$d_wcscmp'
24753 d_wcstombs='$d_wcstombs'
24754 d_wcsxfrm='$d_wcsxfrm'
24755 d_wctomb='$d_wctomb'
24756 d_writev='$d_writev'
24759 db_hashtype='$db_hashtype'
24760 db_prefixtype='$db_prefixtype'
24761 db_version_major='$db_version_major'
24762 db_version_minor='$db_version_minor'
24763 db_version_patch='$db_version_patch'
24764 direntrytype='$direntrytype'
24767 doubleinfbytes='$doubleinfbytes'
24768 doublekind='$doublekind'
24769 doublemantbits='$doublemantbits'
24770 doublenanbytes='$doublenanbytes'
24771 doublesize='$doublesize'
24773 drand48_r_proto='$drand48_r_proto'
24775 dtraceobject='$dtraceobject'
24776 dynamic_ext='$dynamic_ext'
24782 endgrent_r_proto='$endgrent_r_proto'
24783 endhostent_r_proto='$endhostent_r_proto'
24784 endnetent_r_proto='$endnetent_r_proto'
24785 endprotoent_r_proto='$endprotoent_r_proto'
24786 endpwent_r_proto='$endpwent_r_proto'
24787 endservent_r_proto='$endservent_r_proto'
24788 eunicefix='$eunicefix'
24791 extensions='$extensions'
24792 extern_C='$extern_C'
24794 fflushNULL='$fflushNULL'
24795 fflushall='$fflushall'
24797 firstmakefile='$firstmakefile'
24799 fpossize='$fpossize'
24800 fpostype='$fpostype'
24801 freetype='$freetype'
24804 full_csh='$full_csh'
24805 full_sed='$full_sed'
24806 gccansipedantic='$gccansipedantic'
24807 gccosandvers='$gccosandvers'
24808 gccversion='$gccversion'
24809 getgrent_r_proto='$getgrent_r_proto'
24810 getgrgid_r_proto='$getgrgid_r_proto'
24811 getgrnam_r_proto='$getgrnam_r_proto'
24812 gethostbyaddr_r_proto='$gethostbyaddr_r_proto'
24813 gethostbyname_r_proto='$gethostbyname_r_proto'
24814 gethostent_r_proto='$gethostent_r_proto'
24815 getlogin_r_proto='$getlogin_r_proto'
24816 getnetbyaddr_r_proto='$getnetbyaddr_r_proto'
24817 getnetbyname_r_proto='$getnetbyname_r_proto'
24818 getnetent_r_proto='$getnetent_r_proto'
24819 getprotobyname_r_proto='$getprotobyname_r_proto'
24820 getprotobynumber_r_proto='$getprotobynumber_r_proto'
24821 getprotoent_r_proto='$getprotoent_r_proto'
24822 getpwent_r_proto='$getpwent_r_proto'
24823 getpwnam_r_proto='$getpwnam_r_proto'
24824 getpwuid_r_proto='$getpwuid_r_proto'
24825 getservbyname_r_proto='$getservbyname_r_proto'
24826 getservbyport_r_proto='$getservbyport_r_proto'
24827 getservent_r_proto='$getservent_r_proto'
24828 getspnam_r_proto='$getspnam_r_proto'
24829 gidformat='$gidformat'
24835 gmtime_r_proto='$gmtime_r_proto'
24836 gnulibc_version='$gnulibc_version'
24838 groupcat='$groupcat'
24839 groupstype='$groupstype'
24842 h_sysfile='$h_sysfile'
24845 hostgenerate='$hostgenerate'
24846 hostosname='$hostosname'
24847 hostperl='$hostperl'
24848 html1dir='$html1dir'
24849 html1direxp='$html1direxp'
24850 html3dir='$html3dir'
24851 html3direxp='$html3direxp'
24860 i_arpainet='$i_arpainet'
24861 i_assert='$i_assert'
24863 i_bsdioctl='$i_bsdioctl'
24867 i_dirent='$i_dirent'
24869 i_execinfo='$i_execinfo'
24874 i_fp_class='$i_fp_class'
24876 i_gdbm_ndbm='$i_gdbm_ndbm'
24877 i_gdbmndbm='$i_gdbmndbm'
24879 i_ieeefp='$i_ieeefp'
24880 i_inttypes='$i_inttypes'
24881 i_langinfo='$i_langinfo'
24882 i_libutil='$i_libutil'
24883 i_limits='$i_limits'
24884 i_locale='$i_locale'
24885 i_machcthr='$i_machcthr'
24886 i_malloc='$i_malloc'
24887 i_mallocmalloc='$i_mallocmalloc'
24889 i_memory='$i_memory'
24890 i_mntent='$i_mntent'
24893 i_neterrno='$i_neterrno'
24894 i_netinettcp='$i_netinettcp'
24898 i_pthread='$i_pthread'
24900 i_quadmath='$i_quadmath'
24901 i_rpcsvcdbm='$i_rpcsvcdbm'
24903 i_shadow='$i_shadow'
24905 i_stdarg='$i_stdarg'
24906 i_stdbool='$i_stdbool'
24907 i_stddef='$i_stddef'
24908 i_stdint='$i_stdint'
24909 i_stdlib='$i_stdlib'
24910 i_string='$i_string'
24911 i_sunmath='$i_sunmath'
24912 i_sysaccess='$i_sysaccess'
24913 i_sysdir='$i_sysdir'
24914 i_sysfile='$i_sysfile'
24915 i_sysfilio='$i_sysfilio'
24917 i_sysioctl='$i_sysioctl'
24918 i_syslog='$i_syslog'
24919 i_sysmman='$i_sysmman'
24920 i_sysmode='$i_sysmode'
24921 i_sysmount='$i_sysmount'
24922 i_sysndir='$i_sysndir'
24923 i_sysparam='$i_sysparam'
24924 i_syspoll='$i_syspoll'
24925 i_sysresrc='$i_sysresrc'
24926 i_syssecrt='$i_syssecrt'
24927 i_sysselct='$i_sysselct'
24928 i_syssockio='$i_syssockio'
24929 i_sysstat='$i_sysstat'
24930 i_sysstatfs='$i_sysstatfs'
24931 i_sysstatvfs='$i_sysstatvfs'
24932 i_systime='$i_systime'
24933 i_systimek='$i_systimek'
24934 i_systimes='$i_systimes'
24935 i_systypes='$i_systypes'
24936 i_sysuio='$i_sysuio'
24938 i_sysutsname='$i_sysutsname'
24939 i_sysvfs='$i_sysvfs'
24940 i_syswait='$i_syswait'
24941 i_termio='$i_termio'
24942 i_termios='$i_termios'
24944 i_unistd='$i_unistd'
24947 i_values='$i_values'
24948 i_varargs='$i_varargs'
24949 i_varhdr='$i_varhdr'
24951 ignore_versioned_solibs='$ignore_versioned_solibs'
24952 inc_version_list='$inc_version_list'
24953 inc_version_list_init='$inc_version_list_init'
24957 initialinstalllocation='$initialinstalllocation'
24958 installarchlib='$installarchlib'
24959 installbin='$installbin'
24960 installhtml1dir='$installhtml1dir'
24961 installhtml3dir='$installhtml3dir'
24962 installman1dir='$installman1dir'
24963 installman3dir='$installman3dir'
24964 installprefix='$installprefix'
24965 installprefixexp='$installprefixexp'
24966 installprivlib='$installprivlib'
24967 installscript='$installscript'
24968 installsitearch='$installsitearch'
24969 installsitebin='$installsitebin'
24970 installsitehtml1dir='$installsitehtml1dir'
24971 installsitehtml3dir='$installsitehtml3dir'
24972 installsitelib='$installsitelib'
24973 installsiteman1dir='$installsiteman1dir'
24974 installsiteman3dir='$installsiteman3dir'
24975 installsitescript='$installsitescript'
24976 installstyle='$installstyle'
24977 installusrbinperl='$installusrbinperl'
24978 installvendorarch='$installvendorarch'
24979 installvendorbin='$installvendorbin'
24980 installvendorhtml1dir='$installvendorhtml1dir'
24981 installvendorhtml3dir='$installvendorhtml3dir'
24982 installvendorlib='$installvendorlib'
24983 installvendorman1dir='$installvendorman1dir'
24984 installvendorman3dir='$installvendorman3dir'
24985 installvendorscript='$installvendorscript'
24987 issymlink='$issymlink'
24988 ivdformat='$ivdformat'
24991 known_extensions='$known_extensions'
24994 ld_can_script='$ld_can_script'
24995 lddlflags='$lddlflags'
24997 ldflags_uselargefiles='$ldflags_uselargefiles'
24998 ldlibpthname='$ldlibpthname'
25005 libsdirs='$libsdirs'
25006 libsfiles='$libsfiles'
25007 libsfound='$libsfound'
25008 libspath='$libspath'
25009 libswanted='$libswanted'
25010 libswanted_uselargefiles='$libswanted_uselargefiles'
25016 localtime_r_proto='$localtime_r_proto'
25017 locincpth='$locincpth'
25018 loclibpth='$loclibpth'
25019 longdblinfbytes='$longdblinfbytes'
25020 longdblkind='$longdblkind'
25021 longdblmantbits='$longdblmantbits'
25022 longdblnanbytes='$longdblnanbytes'
25023 longdblsize='$longdblsize'
25024 longlongsize='$longlongsize'
25025 longsize='$longsize'
25029 lseeksize='$lseeksize'
25030 lseektype='$lseektype'
25034 make_set_make='$make_set_make'
25035 mallocobj='$mallocobj'
25036 mallocsrc='$mallocsrc'
25037 malloctype='$malloctype'
25039 man1direxp='$man1direxp'
25042 man3direxp='$man3direxp'
25044 mips_type='$mips_type'
25045 mistrustnm='$mistrustnm'
25047 mmaptype='$mmaptype'
25048 modetype='$modetype'
25050 multiarch='$multiarch'
25052 myarchname='$myarchname'
25053 mydomain='$mydomain'
25054 myhostname='$myhostname'
25057 need_va_copy='$need_va_copy'
25058 netdb_hlen_type='$netdb_hlen_type'
25059 netdb_host_type='$netdb_host_type'
25060 netdb_name_type='$netdb_name_type'
25061 netdb_net_type='$netdb_net_type'
25064 nm_so_opt='$nm_so_opt'
25065 nonxs_ext='$nonxs_ext'
25067 nvEUformat='$nvEUformat'
25068 nvFUformat='$nvFUformat'
25069 nvGUformat='$nvGUformat'
25070 nv_overflows_integers_at='$nv_overflows_integers_at'
25071 nv_preserves_uv_bits='$nv_preserves_uv_bits'
25072 nveformat='$nveformat'
25073 nvfformat='$nvfformat'
25074 nvgformat='$nvgformat'
25075 nvmantbits='$nvmantbits'
25078 o_nonblock='$o_nonblock'
25080 old_pthread_create_joinable='$old_pthread_create_joinable'
25081 optimize='$optimize'
25082 orderlib='$orderlib'
25085 otherlibdirs='$otherlibdirs'
25089 patchlevel='$patchlevel'
25090 path_sep='$path_sep'
25093 perl_patchlevel='$perl_patchlevel'
25094 perl_static_inline='$perl_static_inline'
25095 perladmin='$perladmin'
25096 perllibs='$perllibs'
25097 perlpath='$perlpath'
25099 phostname='$phostname'
25105 prefixexp='$prefixexp'
25107 privlibexp='$privlibexp'
25108 procselfexe='$procselfexe'
25109 prototype='$prototype'
25111 quadkind='$quadkind'
25112 quadtype='$quadtype'
25113 randbits='$randbits'
25114 randfunc='$randfunc'
25115 random_r_proto='$random_r_proto'
25116 randseedtype='$randseedtype'
25118 rd_nodata='$rd_nodata'
25119 readdir64_r_proto='$readdir64_r_proto'
25120 readdir_r_proto='$readdir_r_proto'
25121 revision='$revision'
25127 sGMTIME_max='$sGMTIME_max'
25128 sGMTIME_min='$sGMTIME_min'
25129 sLOCALTIME_max='$sLOCALTIME_max'
25130 sLOCALTIME_min='$sLOCALTIME_min'
25131 sPRIEUldbl='$sPRIEUldbl'
25132 sPRIFUldbl='$sPRIFUldbl'
25133 sPRIGUldbl='$sPRIGUldbl'
25134 sPRIXU64='$sPRIXU64'
25136 sPRIeldbl='$sPRIeldbl'
25137 sPRIfldbl='$sPRIfldbl'
25138 sPRIgldbl='$sPRIgldbl'
25143 sSCNfldbl='$sSCNfldbl'
25144 sched_yield='$sched_yield'
25145 scriptdir='$scriptdir'
25146 scriptdirexp='$scriptdirexp'
25148 seedfunc='$seedfunc'
25149 selectminbits='$selectminbits'
25150 selecttype='$selecttype'
25151 sendmail='$sendmail'
25152 setgrent_r_proto='$setgrent_r_proto'
25153 sethostent_r_proto='$sethostent_r_proto'
25154 setlocale_r_proto='$setlocale_r_proto'
25155 setnetent_r_proto='$setnetent_r_proto'
25156 setprotoent_r_proto='$setprotoent_r_proto'
25157 setpwent_r_proto='$setpwent_r_proto'
25158 setservent_r_proto='$setservent_r_proto'
25161 sharpbang='$sharpbang'
25162 shmattype='$shmattype'
25163 shortsize='$shortsize'
25166 sig_count='$sig_count'
25167 sig_name='$sig_name'
25168 sig_name_init='$sig_name_init'
25170 sig_num_init='$sig_num_init'
25171 sig_size='$sig_size'
25172 signal_t='$signal_t'
25173 sitearch='$sitearch'
25174 sitearchexp='$sitearchexp'
25176 sitebinexp='$sitebinexp'
25177 sitehtml1dir='$sitehtml1dir'
25178 sitehtml1direxp='$sitehtml1direxp'
25179 sitehtml3dir='$sitehtml3dir'
25180 sitehtml3direxp='$sitehtml3direxp'
25182 sitelib_stem='$sitelib_stem'
25183 sitelibexp='$sitelibexp'
25184 siteman1dir='$siteman1dir'
25185 siteman1direxp='$siteman1direxp'
25186 siteman3dir='$siteman3dir'
25187 siteman3direxp='$siteman3direxp'
25188 siteprefix='$siteprefix'
25189 siteprefixexp='$siteprefixexp'
25190 sitescript='$sitescript'
25191 sitescriptexp='$sitescriptexp'
25192 sizesize='$sizesize'
25193 sizetype='$sizetype'
25197 sockethdr='$sockethdr'
25198 socketlib='$socketlib'
25199 socksizetype='$socksizetype'
25201 spackage='$spackage'
25202 spitshell='$spitshell'
25203 srand48_r_proto='$srand48_r_proto'
25204 srandom_r_proto='$srandom_r_proto'
25206 ssizetype='$ssizetype'
25207 st_ino_sign='$st_ino_sign'
25208 st_ino_size='$st_ino_size'
25209 startperl='$startperl'
25211 static_ext='$static_ext'
25213 stdio_base='$stdio_base'
25214 stdio_bufsiz='$stdio_bufsiz'
25215 stdio_cnt='$stdio_cnt'
25216 stdio_filbuf='$stdio_filbuf'
25217 stdio_ptr='$stdio_ptr'
25218 stdio_stream_array='$stdio_stream_array'
25219 strerror_r_proto='$strerror_r_proto'
25222 subversion='$subversion'
25227 targetarch='$targetarch'
25228 targetdir='$targetdir'
25229 targetenv='$targetenv'
25230 targethost='$targethost'
25231 targetmkdir='$targetmkdir'
25232 targetport='$targetport'
25233 targetsh='$targetsh'
25237 timeincl='$timeincl'
25238 timetype='$timetype'
25239 tmpnam_r_proto='$tmpnam_r_proto'
25245 ttyname_r_proto='$ttyname_r_proto'
25254 uidformat='$uidformat'
25260 uquadtype='$uquadtype'
25261 use5005threads='$use5005threads'
25262 use64bitall='$use64bitall'
25263 use64bitint='$use64bitint'
25264 usecbacktrace='$usecbacktrace'
25265 usecrosscompile='$usecrosscompile'
25266 usedevel='$usedevel'
25268 usedtrace='$usedtrace'
25269 usefaststdio='$usefaststdio'
25270 useithreads='$useithreads'
25271 usekernprocpathname='$usekernprocpathname'
25272 uselargefiles='$uselargefiles'
25273 uselongdouble='$uselongdouble'
25274 usemallocwrap='$usemallocwrap'
25275 usemorebits='$usemorebits'
25276 usemultiplicity='$usemultiplicity'
25277 usemymalloc='$usemymalloc'
25279 usensgetexecutablepath='$usensgetexecutablepath'
25280 useopcode='$useopcode'
25281 useperlio='$useperlio'
25282 useposix='$useposix'
25283 usequadmath='$usequadmath'
25284 usereentrant='$usereentrant'
25285 userelocatableinc='$userelocatableinc'
25286 useshrplib='$useshrplib'
25287 usesitecustomize='$usesitecustomize'
25288 usesocks='$usesocks'
25289 usethreads='$usethreads'
25290 usevendorprefix='$usevendorprefix'
25291 useversionedarchname='$useversionedarchname'
25292 usevfork='$usevfork'
25295 uvXUformat='$uvXUformat'
25296 uvoformat='$uvoformat'
25299 uvuformat='$uvuformat'
25300 uvxformat='$uvxformat'
25302 vendorarch='$vendorarch'
25303 vendorarchexp='$vendorarchexp'
25304 vendorbin='$vendorbin'
25305 vendorbinexp='$vendorbinexp'
25306 vendorhtml1dir='$vendorhtml1dir'
25307 vendorhtml1direxp='$vendorhtml1direxp'
25308 vendorhtml3dir='$vendorhtml3dir'
25309 vendorhtml3direxp='$vendorhtml3direxp'
25310 vendorlib='$vendorlib'
25311 vendorlib_stem='$vendorlib_stem'
25312 vendorlibexp='$vendorlibexp'
25313 vendorman1dir='$vendorman1dir'
25314 vendorman1direxp='$vendorman1direxp'
25315 vendorman3dir='$vendorman3dir'
25316 vendorman3direxp='$vendorman3direxp'
25317 vendorprefix='$vendorprefix'
25318 vendorprefixexp='$vendorprefixexp'
25319 vendorscript='$vendorscript'
25320 vendorscriptexp='$vendorscriptexp'
25322 version_patchlevel_string='$version_patchlevel_string'
25323 versiononly='$versiononly'
25327 yaccflags='$yaccflags'
25332 : add special variables
25333 $test -f $src/patchlevel.h && \
25334 awk '/^#define[ ]+PERL_/ {printf "%s=%s\n",$2,$3}' $src/patchlevel.h >>config.sh
25335 echo "PERL_PATCHLEVEL='$perl_patchlevel'" >>config.sh
25336 echo "PERL_CONFIG_SH=true" >>config.sh
25338 : propagate old symbols
25339 if $test -f UU/config.sh; then
25340 <UU/config.sh $sort | $uniq >UU/oldconfig.sh
25341 $sed -n 's/^\([a-zA-Z_0-9]*\)=.*/\1/p' \
25342 config.sh config.sh UU/oldconfig.sh |\
25343 $sort | $uniq -u >UU/oldsyms
25344 set X `$cat UU/oldsyms`
25350 Hmm...You had some extra variables I don't know about...I'll try to keep 'em...
25352 echo ": Variables propagated from previous config.sh file." >>config.sh
25353 for sym in `$cat UU/oldsyms`; do
25354 echo " Propagating $hint variable "'$'"$sym..."
25355 eval 'tmp="$'"${sym}"'"'
25357 sed -e "s/'/'\"'\"'/g" -e "s/^/$sym='/" -e "s/$/'/" >>config.sh
25363 : preserve RCS keywords in files with variable substitution, grrr
25366 : Finish up by extracting the .SH files
25370 echo "Extraction done."
25380 If you'd like to make any changes to the config.sh file before I begin
25381 to configure things, do it as a shell escape now (e.g. !vi config.sh).
25384 rp="Press return or use a shell escape to edit config.sh:"
25389 *) : in case they cannot read
25390 sh 1>&4 -c "$ans";;
25395 : if this fails, just run all the .SH files by hand
25404 if $contains '^depend:' [Mm]akefile >/dev/null 2>&1; then
25411 Now you need to generate make dependencies by running "$make depend".
25412 You might prefer to run it in background: "$make depend > makedepend.out &"
25413 It can take a while, so you might not want to run it right now.
25418 rp="Run $make depend now?"
25422 $make depend && echo "Now you must run '$make'."
25425 echo "You must run '$make depend' then '$make'."
25428 elif test -f [Mm]akefile; then
25430 echo "Now you must run a $make."
25432 echo "Configure done."
25435 if $test -f Policy.sh; then
25438 If you compile $package on a different machine or from a different object
25439 directory, copy the Policy.sh file from this object directory to the
25440 new one before you run Configure -- this will help you with most of
25441 the policy defaults.
25445 if $test -f config.msg; then
25446 echo "Hmm. I also noted the following information while running:"
25448 $cat config.msg >&4
25451 $rm -f kit*isdone ark*isdone