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=''
703 d_old_pthread_create_joinable=''
704 old_pthread_create_joinable=''
706 d_pthread_attr_setscope=''
754 sethostent_r_proto=''
771 setprotoent_r_proto=''
783 setservent_r_proto=''
796 d_siginfo_si_errno=''
799 d_siginfo_si_status=''
801 d_siginfo_si_value=''
813 d_ipv6_mreq_source=''
830 d_sprintf_returns_strlen=''
843 perl_static_inline=''
848 d_stdio_ptr_lval_nochange_cnt=''
849 d_stdio_ptr_lval_sets_cnt=''
1003 d_gdbm_ndbm_h_uses_prototypes=''
1004 d_gdbmndbm_h_uses_prototypes=''
1006 d_ndbm_h_uses_prototypes=''
1082 d_inc_version_list=''
1084 inc_version_list_init=''
1092 installusrbinperl=''
1108 ignore_versioned_solibs=''
1172 d_perl_otherlibdirs=''
1180 api_versionstring=''
1186 version_patchlevel_string=''
1190 d_nv_preserves_uv=''
1191 d_nv_zero_is_allbits_zero=''
1202 nv_overflows_integers_at=''
1203 nv_preserves_uv_bits=''
1276 installsitehtml1dir=''
1279 installsitehtml3dir=''
1286 installsiteman1dir=''
1289 installsiteman3dir=''
1294 installsitescript=''
1312 d_stdio_stream_array=''
1313 stdio_stream_array=''
1331 usekernprocpathname=''
1332 ccflags_uselargefiles=''
1333 ldflags_uselargefiles=''
1334 libswanted_uselargefiles=''
1343 usensgetexecutablepath=''
1357 installvendorarch=''
1364 installvendorhtml1dir=''
1366 vendorhtml1direxp=''
1367 installvendorhtml3dir=''
1369 vendorhtml3direxp=''
1375 installvendorman1dir=''
1378 installvendorman3dir=''
1385 installvendorscript=''
1396 smallmach='pdp11 i8086 z8000 i80286 iAPX286'
1399 : We must find out about Eunice early
1401 if test -f /etc/unixtovms; then
1402 eunicefix=/etc/unixtovms
1404 if test -f /etc/unixtovms.exe; then
1405 eunicefix=/etc/unixtovms.exe
1408 : Set executable suffix now -- needed before hints available
1409 if test -f "/libs/version.library"; then
1412 elif test -f "/system/gnu_library/bin/ar.pm"; then
1415 elif test -n "$DJGPP"; then
1418 elif test -f /kern/cookiejar; then
1421 elif test -d c:/. -o -n "$is_os2" ; then
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
1440 : Trailing extension. Override this in a hint file, if needed.
1441 : Extra object files, if any, needed on this platform.
1444 : change the next line if compiling for Xenix/286 on Xenix/386
1445 xlibpth='/usr/lib/386 /lib/386'
1446 : Possible local library directories to search.
1447 loclibpth="/usr/local/lib /opt/local/lib /usr/gnu/lib"
1448 loclibpth="$loclibpth /opt/gnu/lib /usr/GNU/lib /opt/GNU/lib"
1450 : general looking path for locating libraries
1451 glibpth="/lib /usr/lib $xlibpth"
1452 glibpth="$glibpth /usr/ccs/lib /usr/ucblib /usr/local/lib"
1453 test -f /usr/shlib/libc.so && glibpth="/usr/shlib $glibpth"
1454 test -f /shlib/libc.so && glibpth="/shlib $glibpth"
1455 test -d /usr/lib64 && glibpth="$glibpth /lib64 /usr/lib64 /usr/local/lib64"
1457 : Private path used by Configure to find libraries. Its value
1458 : is prepended to libpth. This variable takes care of special
1459 : machines, like the mips. Usually, it should be empty.
1462 : default library list
1464 : some systems want to use only the non-versioned libso:s
1465 ignore_versioned_solibs=''
1469 : set useposix=false in your hint file to disable the POSIX extension.
1471 : set useopcode=false in your hint file to disable the Opcode extension.
1474 ccflags_uselargefiles=''
1475 ldflags_uselargefiles=''
1476 libswanted_uselargefiles=''
1477 : set usemultiplicity on the Configure command line to enable multiplicity.
1478 : set usesocks on the Configure command line to enable socks.
1480 : set usethreads on the Configure command line to enable threads.
1481 usereentrant='undef'
1482 : List of libraries we want.
1483 : If anyone needs extra -lxxx, put those in a hint file.
1484 libswanted="cl pthread socket bind inet nsl ndbm gdbm dbm db malloc dl ld"
1485 libswanted="$libswanted sun m crypt sec util c cposix posix ucb bsd BSD"
1486 : We probably want to search /usr/shlib before most other libraries.
1487 : This is only used by the lib/ExtUtils/MakeMaker.pm routine extliblist.
1488 glibpth=`echo " $glibpth " | sed -e 's! /usr/shlib ! !'`
1489 glibpth="/usr/shlib $glibpth"
1490 : Do not use vfork unless overridden by a hint file.
1493 : Find the basic shell for Bourne shell scripts
1497 *bsd*|sys5*) xxx="/$SYSTYPE/bin/sh";;
1500 if test -f "$xxx"; then
1503 : Build up a list and do a single loop so we can 'break' out.
1504 pth=`echo $PATH | sed -e "s/$p_/ /g"`
1505 for xxx in sh bash ksh pdksh ash; do
1507 try="$try ${p}/${xxx}"
1511 if test -f "$xxx"; then
1514 elif test "X$_exe" != X -a -f "$xxx$_exe"; then
1517 elif test -f "$xxx.exe"; then
1528 $me: Fatal Error: I can't find a Bourne Shell anywhere.
1530 Usually it's in /bin/sh. How did you even get this far?
1531 Please contact me (Perl Maintainers) at perlbug@perl.org and
1532 we'll try to straighten this all out.
1538 : When cross-compiling we need to separate the sh-to-run-Configure-with from the sh-to-use-in-Perl
1539 : default both to the same thing, cross-compilers can then set targetsh differently if they like
1542 : see if sh knows # comments
1543 if `$sh -c '#' >/dev/null 2>&1`; then
1547 test -f $xcat$_exe || xcat=/usr/bin/cat
1548 if test ! -f $xcat$_exe; then
1549 for p in `echo $PATH | sed -e "s/$p_/ /g"` $paths; do
1550 if test -f $p/cat$_exe; then
1555 if test ! -f $xcat$_exe; then
1556 echo "Can't find cat anywhere!"
1560 echo "#!$xcat" >sharp
1563 ./sharp > today 2>/dev/null
1564 if test -s today; then
1567 echo "#! $xcat" > sharp
1570 ./sharp > today 2>/dev/null
1571 if test -s today; then
1579 echo "Your $sh doesn't grok # comments--I will strip them later on."
1582 echo "exec grep -v '^[ ]*#'" >spitshell
1584 $eunicefix spitshell
1585 spitshell=`pwd`/spitshell
1587 echo "I presume that if # doesn't work, #! won't work either!"
1592 : figure out how to guarantee sh startup
1594 '') startsh=${sharpbang}${sh} ;;
1606 : echo "Yup, it does."
1608 echo "Hmm... '$startsh' does not guarantee sh startup..."
1609 echo "You may have to fix up the shell scripts to make sure $sh runs them."
1613 : Save command line options in file UU/cmdline.opt for later use in
1614 : generating config.sh.
1615 cat > cmdline.opt <<EOSH
1616 : Configure command line arguments.
1625 cat >>cmdline.opt <<EOSH
1626 config_arg$argn='$arg'
1628 cat <<EOC | sed -e "s/'/'"'"'"'"'"'"'/g" > cmdl.opt
1631 arg_exp=`cat cmdl.opt`
1632 args_exp="$args_exp$args_sep'$arg_exp'"
1633 argn=`expr $argn + 1`
1638 : produce awk script to parse command line options
1639 cat >options.awk <<'EOF'
1641 optstr = "A:dD:eEf:hKOrsSU:V"; # getopt-style specification
1643 len = length(optstr);
1644 for (i = 1; i <= len; i++) {
1645 c = substr(optstr, i, 1);
1646 if (i < len) a = substr(optstr, i + 1, 1); else a = "";
1657 if (substr(str, 1, 1) != "-") {
1658 printf("'%s'\n", str);
1662 for (i = 2; i <= len; i++) {
1663 c = substr(str, i, 1);
1665 printf("-%s\n", substr(str, i));
1671 printf("'%s'\n", substr(str, i + 1));
1684 : process the command line options
1685 set X `for arg in "$@"; do echo "X$arg"; done |
1686 sed -e s/X// | awk -f options.awk`
1691 : set up default values
1700 rm -f optdef.sh posthint.sh
1701 cat >optdef.sh <<EOS
1707 while test $# -gt 0; do
1709 -d) shift; fastread=yes;;
1710 -e) shift; alldone=cont;;
1714 if test -r "$1"; then
1717 echo "$me: cannot read config file $1." >&2
1723 -h) shift; error=true;;
1724 -r) shift; reuseval=true;;
1725 -s) shift; silent=true; realsilent=true;;
1726 -E) shift; alldone=exit;;
1727 -K) shift; knowitall=true;;
1729 -S) shift; silent=true; extractsh=true;;
1734 echo "$me: use '-U symbol=', not '-D symbol='." >&2
1735 echo "$me: ignoring -D $1" >&2
1738 sed -e "s/'/'\"'\"'/g" -e "s/=\(.*\)/='\1'/" >> optdef.sh;;
1739 *) echo "$1='define'" >> optdef.sh;;
1746 *=) echo "$1" >> optdef.sh;;
1748 echo "$me: use '-D symbol=val', not '-U symbol=val'." >&2
1749 echo "$me: ignoring -U $1" >&2
1751 *) echo "$1='undef'" >> optdef.sh;;
1762 *=*) zzz=`echo "$yyy"|sed 's!=.*!!'`
1766 zzz=" "`echo "$yyy"|sed 's!^[^=]*=!!'`
1767 yyy=`echo "$yyy"|sed 's!=.*!!'` ;;
1773 *:*) xxx=`echo "$yyy"|sed 's!:.*!!'`
1774 yyy=`echo "$yyy"|sed 's!^[^:]*:!!'`
1775 zzz=`echo "$yyy"|sed 's!^[^=]*=!!'`
1776 yyy=`echo "$yyy"|sed 's!=.*!!'` ;;
1777 *) xxx=`echo "$yyy"|sed 's!:.*!!'`
1778 yyy=`echo "$yyy"|sed 's!^[^:]*:!!'` ;;
1784 echo "$yyy=\"\${$yyy}$zzz\"" >> posthint.sh ;;
1786 echo "$yyy=''" >> posthint.sh ;;
1791 echo "$yyy='$zzz'" >> posthint.sh ;;
1793 echo "eval \"$yyy=$zzz\"" >> posthint.sh ;;
1795 echo "$yyy=\"$zzz\${$yyy}\"" >> posthint.sh ;;
1800 echo "$yyy=$zzz" >> posthint.sh ;;
1801 *) echo "$me: unknown -A command '$xxx', ignoring -A $1" >&2 ;;
1805 -V) echo "$me generated by metaconfig 3.5 PL0." >&2
1808 -*) echo "$me: unknown option $1" >&2; shift; error=true;;
1816 Usage: $me [-dehrsEKOSV] [-f config.sh] [-D symbol] [-D symbol=value]
1817 [-U symbol] [-U symbol=] [-A command:symbol...]
1818 -d : use defaults for all answers.
1819 -e : go on without questioning past the production of config.sh.
1820 -f : specify an alternate default configuration file.
1821 -h : print this help message and exit (with an error status).
1822 -r : reuse C symbols value if possible (skips costly nm extraction).
1823 -s : silent mode, only echoes questions and essential information.
1824 -D : define symbol to have some value:
1825 -D symbol symbol gets the value 'define'
1826 -D symbol=value symbol gets the value 'value'
1827 common used examples (see INSTALL for more info):
1828 -Duse64bitint use 64bit integers
1829 -Duse64bitall use 64bit integers and pointers
1830 -Dusethreads use thread support
1831 -Dinc_version_list=none do not include older perl trees in @INC
1832 -DEBUGGING=none DEBUGGING options
1833 -Dcc=gcc choose your compiler
1834 -Dprefix=/opt/perl5 choose your destination
1835 -E : stop at the end of questions, after having produced config.sh.
1836 -K : do not use unless you know what you are doing.
1837 -O : ignored for backward compatibility
1838 -S : perform variable substitutions on all .SH files (can mix with -f)
1839 -U : undefine symbol:
1840 -U symbol symbol gets the value 'undef'
1841 -U symbol= symbol gets completely empty
1843 -A : manipulate symbol after the platform specific hints have been applied:
1844 -A append:symbol=value append value to symbol
1845 -A symbol=value like append:, but with a separating space
1846 -A define:symbol=value define symbol to have value
1847 -A clear:symbol define symbol to be ''
1848 -A define:symbol define symbol to be 'define'
1849 -A eval:symbol=value define symbol to be eval of value
1850 -A prepend:symbol=value prepend value to symbol
1851 -A undef:symbol define symbol to be 'undef'
1852 -A undef:symbol= define symbol to be ''
1853 e.g.: -A prepend:libswanted='cl pthread '
1854 -A ccflags=-DSOME_MACRO
1855 -V : print version number and exit (with a zero status).
1862 case "$fastread$alldone" in
1865 case "$extractsh" in
1868 if test ! -t 0; then
1869 echo "Say 'sh Configure', not 'sh <Configure'"
1879 true) exec 1>/dev/null;;
1882 : run the defines and the undefines, if any, but leave the file out there...
1884 grep '\\' optdef.sh >/dev/null 2>&1
1885 if test $? = 0; then
1886 echo "Configure does not support \\ in -D arguments"
1890 : create the posthint manipulation script and leave the file out there...
1895 first=`echo $package | sed -e 's/^\(.\).*/\1/'`
1896 last=`echo $package | sed -e 's/^.\(.*\)/\1/'`
1897 case "`echo AbyZ | tr '[:lower:]' '[:upper:]' 2>/dev/null`"-"`echo AbyZ | tr '[:upper:]' '[:lower:]' 2>/dev/null`" in
1898 ABYZ-abyz) spackage=`echo $first | tr '[:lower:]' '[:upper:]'`$last;;
1899 *) spackage=`echo $first | tr '[a-z]' '[A-Z]'`$last;;
1902 : Some greps do not return status, grrr.
1903 echo "grimblepritz" >grimble
1904 if grep blurfldyick grimble >/dev/null 2>&1 ; then
1906 elif grep grimblepritz grimble >/dev/null 2>&1 ; then
1912 : the following should work in any shell
1916 echo "AGH! Grep doesn't return a status. Attempting remedial action."
1917 cat >contains <<'EOSS'
1918 grep "$1" "$2" >.greptmp && cat .greptmp && test -s .greptmp
1923 : Find the path to the source tree
1926 */*) src=`echo $0 | sed -e 's%/[^/][^/]*$%%'`
1930 *) src=`cd ../$src && pwd` ;;
1943 if test -f $rsrc/Configure && \
1944 $contains "^package='$package'\$" $rsrc/Configure >/dev/null 2>&1
1946 : found it, so we are ok.
1949 for src in . .. ../.. ../../.. ../../../..; do
1950 if test -f ../$src/Configure && \
1951 $contains "^package=$package$" ../$src/Configure >/dev/null 2>&1
1962 Sorry, I can't seem to locate the source dir for $package. Please start
1963 Configure with an explicit path -- i.e. /some/path/Configure.
1971 echo "Sources for $package found in \"$src\"." >&4
1975 : script used to extract .SH files with variable substitutions
1976 cat >extract <<'EOS'
1978 echo "Doing variable substitutions on .SH files..."
1979 if test -f MANIFEST; then
1980 set x `awk '{print $1}' < MANIFEST | grep '\.SH$'`
1982 echo "(Looking for .SH files under the source directory.)"
1983 set x `(cd "$src"; find . -name "*.SH" -print)`
1987 0) set x `(cd "$src"; echo *.SH)`; shift;;
1989 if test ! -f "$src/$1"; then
1995 while test $name; do
1996 if test ! -d "$name"; then
1997 create="$name $create";
1998 name=`echo $name | sed -e "s|^[^/]*$||"`;
1999 name=`echo $name | sed -e "s|\(.*\)/.*|\1|"`;
2004 for file in $create; do
2013 dir=`expr X$file : 'X\(.*\)/'`
2014 file=`expr X$file : 'X.*/\(.*\)'`
2015 (cd "$dir" && . ./$file)
2025 dir=`expr X$file : 'X\(.*\)/'`
2026 file=`expr X$file : 'X.*/\(.*\)'`
2027 (set x $dir; shift; eval $mkdir_p)
2028 sh <"$src/$dir/$file"
2037 if test -f "$src/config_h.SH"; then
2038 if test ! -f config.h; then
2039 : oops, they left it out of MANIFEST, probably, so do it anyway.
2040 . "$src/config_h.SH"
2045 : extract files and exit if asked to do so
2046 case "$extractsh" in
2048 case "$realsilent" in
2052 case "$config_sh" in
2053 '') config_sh='config.sh';;
2056 echo "Fetching answers from $config_sh..."
2063 echo "Extraction done."
2068 : Eunice requires " " instead of "", can you believe it
2071 echo "Beginning of configuration questions for $package."
2073 trap 'echo " "; test -d ../UU && rm -rf X $rmlist; exit 1' 1 2 3 15
2075 : first determine how to suppress newline on echo command
2077 echo "Checking echo to see how to suppress newlines..."
2078 (echo "hi there\c" ; echo " ") >.echotmp
2079 if $contains c .echotmp >/dev/null 2>&1 ; then
2090 echo $n "The star should be here-->$c"
2094 : Now test for existence of everything in MANIFEST
2096 if test -f "$rsrc/MANIFEST"; then
2097 echo "First let's make sure your kit is complete. Checking..." >&4
2098 awk '$1 !~ /PACK[A-Z]+/ {print $1}' "$rsrc/MANIFEST" | \
2099 (split -l 50 2>/dev/null || split -50)
2102 for filelist in x??; do
2103 (cd "$rsrc"; ls `cat "$tmppwd/$filelist"` \
2104 >/dev/null 2>>"$tmppwd/missing")
2106 if test -s missing; then
2110 THIS PACKAGE SEEMS TO BE INCOMPLETE.
2112 You have the option of continuing the configuration process, despite the
2113 distinct possibility that your kit is damaged, by typing 'y'es. If you
2114 do, don't blame me if something goes wrong. I advise you to type 'n'o
2115 and contact the author (perlbug@perl.org).
2118 echo $n "Continue? [n] $c" >&4
2122 echo "Continuing..." >&4
2126 echo "ABORTING..." >&4
2131 echo "Looks good..."
2134 echo "There is no MANIFEST file. I hope your kit is complete !"
2138 : Find the appropriate value for a newline for tr
2139 if test -n "$DJGPP"; then
2142 if test X"$trnl" = X; then
2143 case "`echo foo | tr '\n' x 2>/dev/null`" in
2147 if test X"$trnl" = X; then
2148 case "`echo foo | tr '\012' x 2>/dev/null`" in
2149 foox) trnl='\012' ;;
2152 if test X"$trnl" = X; then
2153 case "`echo foo | tr '\r\n' xy 2>/dev/null`" in
2154 fooxy) trnl='\n\r' ;;
2157 if test X"$trnl" = X; then
2160 $me: Fatal Error: cannot figure out how to translate newlines with 'tr'.
2166 : compute the number of columns on the terminal for proper question formatting
2171 : set up the echo used in my read
2172 myecho="case \"\$xxxm\" in
2173 '') echo $n \"\$rp $c\" >&4;;
2175 '') echo $n \"[\$xxxm] $c\";;
2177 if test \`echo \"\$rp [\$xxxm] \" | wc -c\` -ge $COLUMNS; then
2179 echo $n \"[\$xxxm] $c\" >&4
2181 echo $n \"\$rp [\$xxxm] $c\" >&4
2187 : now set up to do reads with possible shell escape and default assignment
2193 case "\$fastread" in
2194 yes) case "\$dflt" in
2197 case "\$silent-\$rp" in
2202 *) case "\$silent" in
2203 true) case "\$rp" in
2208 while expr "X\$ans" : "X!" >/dev/null; do
2212 aok=''; eval "ans=\\"\$answ\\"" && aok=y
2220 set x \`expr "X\$ans" : "X!\(.*\)\$"\`
2229 set x \`expr "X\$ans" : "X&\(.*\)\$"\`
2234 echo "(OK, I'll run with -d after this question.)" >&4
2237 echo "*** Sorry, \$1 not supported yet." >&4
2247 echo "*** Substitution done -- please confirm."
2249 ans=\`echo $n "\$ans$c" | tr '$trnl' ' '\`
2254 echo "*** Error -- try again."
2261 case "\$ans\$xxxm\$nostick" in
2273 : create .config dir to save info across Configure sessions
2274 test -d ../.config || mkdir ../.config
2275 cat >../.config/README <<EOF
2276 This directory created by Configure to save information that should
2277 persist across sessions for $package.
2279 You may safely delete it if you wish.
2282 : See if we are using a devel version and want that
2283 xversion=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
2286 usedevel="$define" ;;
2287 *) case "$xversion" in
2290 *** WHOA THERE!!! ***
2292 This is an UNSTABLE DEVELOPMENT release.
2293 The version of this $package distribution is $xversion, that is, odd,
2294 (as opposed to even) and that signifies a development release.
2295 If you want a maintenance release, you want an even-numbered version.
2297 Do ***NOT*** install this into production use.
2298 Data corruption and crashes are possible.
2300 It is most seriously suggested that you do not continue any further
2301 unless you want to help in developing and debugging Perl.
2303 If you *still* want to build perl, you can answer 'y' now,
2304 or pass -Dusedevel to Configure.
2307 rp='Do you really want to continue?'
2311 [yY]) echo >&4 "Okay, continuing."
2312 usedevel="$define" ;;
2313 *) echo >&4 "Okay, bye."
2324 case "$versiononly" in
2325 '') versiononly="$define" ;;
2327 case "$installusrbinperl" in
2328 '') installusrbinperl="$undef" ;;
2333 : general instructions
2336 user=`(logname) 2>/dev/null`
2338 '') user=`whoami 2>&1`;;
2340 if $contains "^$user\$" ../.config/instruct >/dev/null 2>&1; then
2343 rp='Would you like to see the instructions?'
2354 This installation shell script will examine your system and ask you questions
2355 to determine how the perl5 package should be installed. If you get
2356 stuck on a question, you may use a ! shell escape to start a subshell or
2357 execute a command. Many of the questions will have default answers in square
2358 brackets; typing carriage return will give you the default.
2360 On some of the questions which ask for file or directory names you are allowed
2361 to use the ~name construct to specify the login directory belonging to "name",
2362 even if you don't have a shell which knows about that. Questions where this is
2363 allowed will be marked "(~name ok)".
2367 dflt='Type carriage return to continue'
2371 The prompter used in this script allows you to use shell variables and
2372 backticks in your answers. You may use $1, $2, etc... to refer to the words
2373 in the default answer, as if the default line was a set of arguments given to a
2374 script shell. This means you may also use $* to repeat the whole default line,
2375 so you do not have to re-type everything to add something to the default.
2377 Every time there is a substitution, you will have to confirm. If there is an
2378 error (e.g. an unmatched backtick), the default answer will remain unchanged
2379 and you will be prompted again.
2381 If you are in a hurry, you may run 'Configure -d'. This will bypass nearly all
2382 the questions and use the computed defaults (or the previous answers if there
2383 was already a config.sh file). Type 'Configure -h' for a list of options.
2384 You may also start interactively and then answer '& -d' at any prompt to turn
2385 on the non-interactive behaviour for the remainder of the execution.
2391 Much effort has been expended to ensure that this shell script will run on any
2392 Unix system. If despite that it blows up on yours, your best bet is to edit
2393 Configure and run it again. If you can't run Configure for some reason,
2394 you'll have to generate a config.sh file by hand. Whatever problems you
2395 have, let me (perlbug@perl.org) know how I blew it.
2397 This installation script affects things in two ways:
2399 1) it may do direct variable substitutions on some of the files included
2401 2) it builds a config.h file for inclusion in C programs. You may edit
2402 any of these files as the need arises after running this script.
2404 If you make a mistake on a question, there is no easy way to back up to it
2405 currently. The easiest thing to do is to edit config.sh and rerun all the SH
2406 files. Configure will offer to let you do this before it runs the SH files.
2409 dflt='Type carriage return to continue'
2411 case "$firsttime" in
2412 true) echo $user >>../.config/instruct;;
2416 : Set 'sysroot' to change the logical root directory to your headers and libraries see man gcc
2417 : This is primarily meant for cross-compile environments, and may fail to be useful in other cases
2418 if test "X$sysroot" = X; then
2423 echo "Using $sysroot to find your headers and libraries, adding to ccflags"
2424 # _sysroot is used in places where we need --sysroot=foo
2425 # but using the rest of the flags could cause issues.
2426 _sysroot="--sysroot=$sysroot";
2430 ccflags="$ccflags $_sysroot"
2435 ldflags="$ldflags $_sysroot"
2440 cppflags="$cppflags $_sysroot"
2442 # lddlflags updated below in lddlflags section;
2443 # same with cccdlflags
2447 # Adjust some defaults to also use $sysroot
2448 for var in xlibpth loclibpth locincpth glibpth; do
2451 for path in $xxx; do
2452 eval $var=\"\$$var $sysroot$path\"
2458 : find out where common programs are
2460 echo "Locating common programs..." >&4
2473 if test -d \$dir/\$thing; then
2479 for thisthing in \$dir/\$thing; do
2480 : just loop through to pick last item
2482 if test -f \$thisthing; then
2485 elif test "X$_exe" != X -a -f \$thisthing$_exe; then
2488 elif test -f \$dir/\$thing.exe; then
2489 if test -n "$DJGPP"; then
2490 echo \$dir/\$thing.exe
2491 elif test "$eunicefix" != ":"; then
2492 : on Eunice apparently
2545 pth=`echo $PATH | sed -e "s/$p_/ /g"`
2546 pth="$pth $sysroot/lib $sysroot/usr/lib"
2547 for file in $loclist; do
2551 if test -f "$xxx"; then
2554 echo "WARNING: no $xxx -- ignoring your setting for $file." >&4
2555 xxx=`./loc $file $file $pth`
2558 '') xxx=`./loc $file $file $pth`;;
2559 *) xxx=`./loc $xxx $xxx $pth`;;
2561 eval $file=$xxx$_exe
2565 echo $file is in $xxx.
2568 echo $file is in $xxx.
2571 echo "I don't know where '$file' is, and my life depends on it." >&4
2572 echo "Go find a public domain implementation or fix your PATH setting!" >&4
2578 echo "Don't worry if any of the following aren't found..."
2580 for file in $trylist; do
2584 if test -f "$xxx"; then
2587 echo "WARNING: no $xxx -- ignoring your setting for $file." >&4
2588 xxx=`./loc $file $file $pth`
2591 '') xxx=`./loc $file $file $pth`;;
2592 *) xxx=`./loc $xxx $xxx $pth`;;
2594 eval $file=$xxx$_exe
2598 echo $file is in $xxx.
2601 echo $file is in $xxx.
2604 echo "I don't see $file out there, $say."
2611 echo "Substituting grep for egrep."
2618 *) if $less -R </dev/null >/dev/null 2>&1; then
2619 echo "Substituting less -R for less."
2627 echo "Substituting cp for ln."
2636 echo "I can't find make or gmake, and my life depends on it." >&4
2637 echo "Go find a public domain implementation or fix your PATH setting!" >&4
2645 *) # We can't have osname yet.
2646 if test -f "/system/gnu_library/bin/ar.pm"; then # Stratus VOS
2647 # Assume that gmake, if found, is definitely GNU make
2648 # and prefer it over the system make.
2649 echo "Substituting gmake for make."
2657 echo "Hopefully test is built into your sh."
2660 if `sh -c "PATH= test true" >/dev/null 2>&1`; then
2661 echo "Using the test built into your sh."
2669 echo "Hopefully echo is built into your sh."
2674 echo "Checking compatibility between $echo and builtin echo (if any)..." >&4
2675 $echo $n "hi there$c" >foo1
2676 echo $n "hi there$c" >foo2
2677 if cmp foo1 foo2 >/dev/null 2>&1; then
2678 echo "They are compatible. In fact, they may be identical."
2685 They are not compatible! You are probably running ksh on a non-USG system.
2686 I'll have to use $echo instead of the builtin, since Bourne shell doesn't
2687 have echo built in and we may have to run some Bourne shell scripts. That
2688 means I'll have to use '$n$c' to suppress newlines now. Life is ridiculous.
2691 $echo $n "The star should be here-->$c"
2698 # This question was auctioned at YAPC::Europe-2007 in Vienna
2699 # I never promised you could answer it. I only auctioned the question.
2701 The following message is sponsored by
2703 Dresden.pm<--The stars should be here.
2705 Dear Perl user, system administrator or package
2706 maintainer, the Perl community sends greetings to
2707 you. Do you (emblematical) greet back [Y/n]? n
2711 : Check what type of C compiler we use
2715 cat <<'EOSC' >>trygcc
2720 int main(int argc, char *argv[]) {
2724 if $cc -o try $ccflags $ldflags try.c; then
2727 echo "Uh-oh, the C compiler '$cc' doesn't seem to be working." >&4
2733 # Skip this test because it gives a false match on output like:
2734 # ./trygcc: line 23: cc: command not found
2735 # case "`$cc -v -c try.c 2>&1`" in
2736 # *gcc*) trygcc=no ;;
2738 if $test X"$trygcc" = Xyes; then
2739 if gcc -o try -c try.c; then
2741 echo "You seem to have a working gcc, though." >&4
2742 # Switching compilers may undo the work of hints files.
2743 # The most common problem is -D_REENTRANT for threads.
2744 # This heuristic catches that case, but gets false positives
2745 # if -Dusethreads was not actually specified. Better to
2746 # bail out here with a useful message than fail
2747 # mysteriously later. Should we perhaps just try to
2748 # re-invoke Configure -Dcc=gcc config_args ?
2749 if $test -f usethreads.cbu; then
2752 *** However, any setting of the C compiler flags (e.g. for thread support)
2753 *** will be lost. It may be necessary for you to restart Configure and
2754 *** add -Dcc=gcc to your Configure command line.
2757 rp="Would you like to go ahead and try gcc anyway?"
2760 rp="Would you like to use it?"
2763 if $test -f myread; then
2766 if $test -f UU/myread; then
2769 echo "Cannot find myread, sorry. Aborting." >&2
2774 [yY]*) cc=gcc; ccname=gcc; ccflags=''; despair=no;
2787 cat <<'EOSC' >>checkcc
2792 int main(int argc, char *argv[]) {
2796 if $cc -o try $ccflags $ldflags try.c; then
2799 if $test X"$despair" = Xyes; then
2800 echo "Uh-oh, the C compiler '$cc' doesn't seem to be working." >&4
2803 You need to find a working C compiler.
2804 Either (purchase and) install the C compiler supplied by your OS vendor,
2805 or for a free C compiler try http://gcc.gnu.org/
2806 I cannot continue any further, aborting.
2815 : determine whether symbolic links are supported
2818 if $ln -s blurfl sym > /dev/null 2>&1 ; then
2819 echo "Symbolic links are supported." >&4
2822 echo "Symbolic links are NOT supported." >&4
2827 : determine whether symbolic links are supported
2831 echo "Checking how to test for symbolic links..." >&4
2833 if $test "X$issymlink" = X; then
2835 '') sh -c "PATH= test -h sym" >/dev/null 2>&1 ;;
2836 *) $newsh -c "PATH= test -h sym" >/dev/null 2>&1 ;;
2838 if test $? = 0; then
2841 echo "Your builtin 'test -h' may be broken." >&4
2844 *) pth=`echo $PATH | sed -e "s/$p_/ /g"`
2847 if test -f "$p/$test"; then
2856 echo "Trying external '$test -h'." >&4
2857 issymlink="$test -h"
2858 if $test ! -h sym >/dev/null 2>&1; then
2859 echo "External '$test -h' is broken, too." >&4
2867 if $test "X$issymlink" = X; then
2868 if $test -L sym 2>/dev/null; then
2869 issymlink="$test -L"
2870 echo "The builtin '$test -L' worked." >&4
2873 if $test "X$issymlink" != X; then
2874 echo "You can test for symbolic links with '$issymlink'." >&4
2876 echo "I do not know how you can test for symbolic links." >&4
2880 *) echo "No symbolic links, so not testing for their testing..." >&4
2885 : Make symlinks util
2886 case "$mksymlinks" in
2889 ''|'.') echo "Cannot create symlinks in the original directory." >&4
2892 *) case "$lns:$issymlink" in
2893 *"ln"*" -s:"*"test -"?)
2894 echo "Creating the symbolic links..." >&4
2896 awk '{print $1}' $src/MANIFEST | sed -e 's:/\([^/]*\)$: \1:' |
2906 print "# dir = ", dir, "file = ", file
2907 mf[dir] = mf[dir]" "source"/"dir"/"file;
2910 if (d != ".") { print("mkdir -p "d) }
2911 print("ln -sf "mf[d]" "d);
2913 }' source="$src" > UU/mksymlinks.$$
2917 if test ! -d t/base; then
2918 echo "Failed to create the subdirectories. Aborting." >&4
2922 if test ! -f t/base/lex.t; then
2923 echo "Failed to create the symlinks (t/base/lex.t missing). Aborting." >&4
2926 if test ! -f win32/win32.c; then
2927 echo "Failed to create the symlinks (win32/win32.c missing). Aborting." >&4
2932 *) echo "(I cannot figure out how to do symbolic links, ignoring mksymlinks)." >&4
2940 : Check for Cross-Compilation
2941 if $test "X$targethost" = "X"; then
2944 if $test "X$targetenv" = "X"; then
2947 case "$usecrosscompile" in
2949 $echo "Cross-compiling..."
2952 *-gcc*|*-g++*) # A cross-compiling gcc, probably.
2953 # arm-linux-androideabi-gcc -> arm-linux-androideabi
2954 # x86_64-w64-mingw32-gcc.exe -> x86_64-w64-mingw32
2955 targetarch=`$echo $cc|$sed 's/-g[c\+][c\+].*$//'`
2956 ar=`$echo $cc|$sed 's/-g[c\+][c\+]/-ar/'`
2957 # leave out ld, choosing it is more complex
2958 nm=`$echo $cc|$sed 's/-g[c\+][c\+]/-nm/'`
2959 ranlib=`$echo $cc|$sed 's/-g[c\+][c\+]/-ranlib/'`
2960 # We are in a weird spot. Just before us, some values
2961 # were 'saved', to be restored after the hints are
2962 # run. This means that the changes we made to ar,
2963 # nm and ranlib will get reverted.
2964 # To avoid that, we hijack the saving mechanism and
2965 # have it save our new values.
2966 for file in ar nm ranlib; do
2968 eval $file=$xxx$_exe
2973 case "$targetarch" in
2974 '') echo "Targetarch not defined." >&4; croak=y ;;
2975 *) echo "Using targetarch $targetarch." >&4 ;;
2977 case "$targethost" in
2978 '') echo "Targethost not defined." >&4; croak=n ;;
2979 *) echo "Using targethost $targethost." >&4
2984 y) echo "Cannot continue, aborting." >&4; exit 1 ;;
2986 : compile a host miniperl and generate_uudmap, unless we got passed them
2987 if $test "X$hostperl" = X; then
2988 echo "Building host miniperl and generate_uudmap binaries" >&4
2996 $src/Configure -des -Dusedevel -Dmksymlinks
2998 case "$hostgenerate" in
2999 '') $make generate_uudmap
3000 hostgenerate=$src/host/generate_uudmap
3002 "$undef") hostgenerate=''
3005 hostperl=$src/host/miniperl
3008 hostosname=`$hostperl -le 'print $^O'`
3011 usecrosscompile="$undef"
3015 : Define -Dtargethost=somecomputer to run compiled tests on another machine
3016 case "$targethost" in
3017 '') echo "Checking for cross-compile" >&4
3018 case "$usecrosscompile$multiarch" in
3019 *$define*) echo "Skipping the try tests in the rest of Configure as no targethost was defined when cross-compiling" >&4
3020 if [ -f Makefile ]; then
3022 echo "Now you must ensure config.sh, config.h and the generated headers exist and run a $make."
3024 echo "Configure done."
3028 *) echo "No targethost for running compiler tests against defined, running locally" >&4
3035 *) echo "Using targethost $targethost." >&4
3037 /*) run=$src/Cross/run
3038 targetmkdir=$src/Cross/mkdir
3040 from=$src/Cross/from
3042 *) pwd=`$test -f ../Configure & cd ..; pwd`
3044 targetmkdir=$pwd/Cross/mkdir
3046 from=$pwd/Cross/from
3049 case "$targetrun" in
3050 '') targetrun=ssh ;;
3055 case "$targetfrom" in
3056 '') targetfrom=scp ;;
3060 from=$from-$targetfrom
3061 case "$targetdir" in
3063 echo "Guessing targetdir $targetdir." >&4
3066 case "$targetuser" in
3068 echo "Guessing targetuser $targetuser." >&4
3071 case "$targetport" in
3073 echo "Guessing targetport $targetport." >&4
3076 case "$targetfrom" in
3080 case "$targetrun" in
3100 '') cwd=$targetdir ;;
3105 $targetrun -p $targetport -l $targetuser $targethost "cd \$cwd && \$env \$exe \$@"
3111 *) echo "Unknown targetrun '$targetrun'" >&4
3115 case "$targetmkdir" in
3117 cat >$targetmkdir <<EOF
3119 $targetrun -p $targetport -l $targetuser $targethost "mkdir -p \$@"
3121 $chmod a+rx $targetmkdir
3123 *) echo "Unknown targetmkdir '$targetmkdir'" >&4
3135 $targetmkdir \`dirname \$f\`
3136 $targetto -P $targetport -r $q \$f $targetuser@$targethost:\$f 2>/dev/null || exit 1
3139 $targetmkdir $targetdir/\`dirname \$f\`
3140 $targetto -P $targetport -r $q \$f $targetuser@$targethost:$targetdir/\$f 2>/dev/null || exit 1
3153 $mkdir -p $targetdir/\`dirname \$f\`
3154 $cp \$f $targetdir/\$f || exit 1
3157 $targetmkdir $targetdir/\`dirname \$f\`
3158 $cp \$f $targetdir/\$f || exit 1
3165 *) echo "Unknown targetto '$targetto'" >&4
3169 case "$targetfrom" in
3176 $targetfrom -P $targetport $q $targetuser@$targethost:$targetdir/\$f . || exit 1
3181 cp) cat >$from <<EOF
3186 cp $targetdir/\$f . || exit 1
3191 *) echo "Unknown targetfrom '$targetfrom'" >&4
3195 if $test ! -f $run; then
3196 echo "Target 'run' script '$run' not found." >&4
3200 if $test ! -f $to; then
3201 echo "Target 'to' script '$to' not found." >&4
3205 if $test ! -f $from; then
3206 echo "Target 'from' script '$from' not found." >&4
3210 if $test ! -f $run -o ! -f $to -o ! -f $from; then
3214 Using '$run' for remote execution,
3215 and '$from' and '$to'
3216 for remote file transfer.
3222 usecrosscompile="$undef"
3227 : see whether [:lower:] and [:upper:] are supported character classes
3229 case "`echo AbyZ | $tr '[:lower:]' '[:upper:]' 2>/dev/null`"-"`echo AbyZ | $tr '[:upper:]' '[:lower:]' 2>/dev/null`" in
3231 echo "Good, your tr supports [:lower:] and [:upper:] to convert case." >&4
3235 *) # There is a discontinuity in EBCDIC between 'R' and 'S'
3236 # (0xd9 and 0xe2), therefore that is a nice testing point.
3237 if test "X$up" = X -o "X$low" = X; then
3238 case "`echo RS | $tr '[R-S]' '[r-s]' 2>/dev/null`" in
3244 if test "X$up" = X -o "X$low" = X; then
3245 case "`echo RS | $tr R-S r-s 2>/dev/null`" in
3251 if test "X$up" = X -o "X$low" = X; then
3252 case "`echo RS | od -x 2>/dev/null`" in
3254 echo "Hey, this might be EBCDIC." >&4
3255 if test "X$up" = X -o "X$low" = X; then
3256 case "`echo RS | $tr '[A-IJ-RS-Z]' '[a-ij-rs-z]' 2>/dev/null`" in
3257 rs) up='[A-IJ-RS-Z]'
3262 if test "X$up" = X -o "X$low" = X; then
3263 case "`echo RS | $tr A-IJ-RS-Z a-ij-rs-z 2>/dev/null`" in
3273 case "`echo RS | $tr \"$up\" \"$low\" 2>/dev/null`" in
3275 echo "Using $up and $low to convert case." >&4
3278 echo "I don't know how to translate letters from upper to lower case." >&4
3279 echo "Your tr is not acting any way I know of." >&4
3283 : set up the translation script tr, must be called with ./tr of course
3287 '[A-Z][a-z]') exec $tr '$up' '$low';;
3288 '[a-z][A-Z]') exec $tr '$low' '$up';;
3295 : Try to determine whether config.sh was made on this system
3296 case "$config_sh" in
3298 myuname=`$uname -a 2>/dev/null`
3299 $test -z "$myuname" && myuname=`hostname 2>/dev/null`
3300 # Downcase everything to avoid ambiguity.
3301 # Remove slashes and single quotes so we can use parts of this in
3302 # directory and file names.
3303 # Remove newlines so myuname is sane to use elsewhere.
3304 # tr '[A-Z]' '[a-z]' would not work in EBCDIC
3305 # because the A-Z/a-z are not consecutive.
3306 myuname=`echo $myuname | $sed -e "s,['/],,g" | \
3307 ./tr '[A-Z]' '[a-z]' | $tr $trnl ' '`
3308 newmyuname="$myuname"
3310 case "$knowitall" in
3312 if test -f ../config.sh; then
3313 if $contains myuname= ../config.sh >/dev/null 2>&1; then
3314 eval "`grep myuname= ../config.sh`"
3316 if test "X$myuname" = "X$newmyuname"; then
3324 : Get old answers from old config file if Configure was run on the
3325 : same system, otherwise use the hints.
3328 if test -f config.sh; then
3330 rp="I see a config.sh file. Shall I use it to set the defaults?"
3333 n*|N*) echo "OK, I'll ignore it."
3334 mv config.sh config.sh.old
3335 myuname="$newmyuname"
3337 *) echo "Fetching default answers from your old config.sh file..." >&4
3345 : Older versions did not always set $sh. Catch re-use of such
3355 if test ! -f config.sh; then
3358 First time through, eh? I have some defaults handy for some systems
3359 that need some extra help getting the Configure answers right:
3362 (cd $src/hints; ls -C *.sh) | $sed 's/\.sh/ /g' >&4
3364 : Half the following guesses are probably wrong... If you have better
3365 : tests or hints, please send them to perlbug@perl.org
3366 : The metaconfig authors would also appreciate a copy...
3367 $test -f /irix && osname=irix
3368 $test -f /xenix && osname=sco_xenix
3369 $test -f /dynix && osname=dynix
3370 $test -f /dnix && osname=dnix
3371 $test -f /lynx.os && osname=lynxos
3372 $test -f /unicos && osname=unicos && osvers=`$uname -r`
3373 $test -f /unicosmk && osname=unicosmk && osvers=`$uname -r`
3374 $test -f /unicosmk.ar && osname=unicosmk && osvers=`$uname -r`
3375 $test -f /bin/mips && /bin/mips && osname=mips
3376 $test -d /usr/apollo/bin && osname=apollo
3377 $test -f /etc/saf/_sactab && osname=svr4
3378 $test -d /usr/include/minix && osname=minix && osvers=`$uname -r`
3379 $test -f /system/gnu_library/bin/ar.pm && osname=vos
3380 $test -f /sys/utilities/MultiView && osname=amigaos
3381 if $test -d /MachTen -o -d /MachTen_Folder; then
3383 if $test -x /sbin/version; then
3384 osvers=`/sbin/version | $awk '{print $2}' |
3385 $sed -e 's/[A-Za-z]$//'`
3386 elif $test -x /usr/etc/version; then
3387 osvers=`/usr/etc/version | $awk '{print $2}' |
3388 $sed -e 's/[A-Za-z]$//'`
3394 $test -f /sys/posix.dll &&
3395 $test -f /usr/bin/what &&
3396 set X `/usr/bin/what /sys/posix.dll` &&
3397 $test "$3" = UWIN &&
3401 if $test -f $uname; then
3409 umips) osname=umips ;;
3412 [23]100) osname=mips ;;
3414 tmp=`/bin/uname -X 2>/dev/null|awk '/3\.2v[45]/{ print $(NF) }'`
3415 if $test "$tmp" != "" -a "$3" = "3.2" -a -f '/etc/systemid'; then
3418 elif $test -f /etc/kconfig; then
3420 if test "$lns" = "$ln -s"; then
3422 elif $contains _SYSV3 /usr/include/stdio.h > /dev/null 2>&1 ; then
3424 elif $contains _POSIX_SOURCE /usr/include/stdio.h > /dev/null 2>&1 ; then
3431 if test -n "$DJGPP"; then
3440 tmp=`( (oslevel) 2>/dev/null || echo "not found") 2>&1`
3442 # oslevel can fail with:
3443 # oslevel: Unable to acquire lock.
3444 *not\ found) osvers="$4"."$3" ;;
3445 '<3240'|'<>3240') osvers=3.2.0 ;;
3446 '=3240'|'>3240'|'<3250'|'<>3250') osvers=3.2.4 ;;
3447 '=3250'|'>3250') osvers=3.2.5 ;;
3451 bitrig) osname=bitrig
3454 bsd386) osname=bsd386
3457 cygwin*) osname=cygwin
3460 *dc.osx) osname=dcosx
3466 domainos) osname=apollo
3472 dragonfly) osname=dragonfly
3475 dynixptx*) osname=dynixptx
3476 osvers=`echo "$4"|sed 's/^v//'`
3478 freebsd) osname=freebsd
3480 genix) osname=genix ;;
3484 osvers=`echo "$3" | $sed 's,.*\.\([0-9]*\.[0-9]*\),\1,'`
3497 $test -f /system/lib/libandroid.so && osname=linux-android
3501 netbsd*) osname=netbsd
3504 news-os) osvers="$3"
3506 4*) osname=newsos4 ;;
3510 nonstop-ux) osname=nonstopux ;;
3511 openbsd) osname=openbsd
3517 POSIX-BC | posix-bc ) osname=posix-bc
3520 powerux | power_ux | powermax_os | powermaxos | \
3521 powerunix | power_unix) osname=powerux
3527 solaris) osname=solaris
3529 5*) osvers=`echo $3 | $sed 's/^5/2/g'` ;;
3536 osvers=`echo $3 | $sed 's/^5/2/g'` ;;
3540 titanos) osname=titanos
3549 ultrix) osname=ultrix
3552 osf1|mls+) case "$5" in
3555 osvers=`sizer -v | awk -FUNIX '{print $2}' | awk '{print $1}' | tr '[A-Z]' '[a-z]' | sed 's/^[xvt]//'`
3558 *) osvers=`echo "$3" | sed 's/^[xvt]//'` ;;
3561 hp*) osname=hp_osf1 ;;
3562 mips) osname=mips_osf1 ;;
3565 # UnixWare 7.1.2 is known as Open UNIX 8
3566 openunix|unixware) osname=svr5
3574 $2) case "$osname" in
3578 : svr4.x or possibly later
3588 if test -f /stand/boot ; then
3589 eval `grep '^INITPROG=[a-z/0-9]*$' /stand/boot`
3590 if test -n "$INITPROG" -a -f "$INITPROG"; then
3591 isesix=`strings -a $INITPROG|grep 'ESIX SYSTEM V/386 Release 4.0'`
3592 if test -n "$isesix"; then
3600 *) if test -f /etc/systemid; then
3602 set `echo $3 | $sed 's/\./ /g'` $4
3603 if $test -f $src/hints/sco_$1_$2_$3.sh; then
3605 elif $test -f $src/hints/sco_$1_$2.sh; then
3607 elif $test -f $src/hints/sco_$1.sh; then
3612 '') : Still unknown. Probably a generic Sys V.
3621 *) case "$osname" in
3622 '') : Still unknown. Probably a generic BSD.
3630 if test -f /vmunix -a -f $src/hints/news_os.sh; then
3631 (what /vmunix | UU/tr '[A-Z]' '[a-z]') > UU/kernel.what 2>&1
3632 if $contains news-os UU/kernel.what >/dev/null 2>&1; then
3635 $rm -f UU/kernel.what
3636 elif test -d c:/. -o -n "$is_os2" ; then
3643 case "$targetarch" in
3646 case "$targetarch" in
3648 # Will load qnx.sh, which should change osname to nto
3653 # Catch arm-linux-androideabi, mipsel-linux-android,
3654 # and i686-linux-android
3655 osname=linux-android
3659 # Something like arm-linux-gnueabihf is really just
3666 # XXX perhaps we should just assume
3667 # osvers to be 2, or maybe take the value
3668 # from targetarch. Using $run before the
3669 # hints are run is somewhat icky.
3670 set X `$run $uname -a 2>/dev/null`
3673 5*) osvers=`echo $3 | $sed 's/^5/2/g'` ;;
3678 osname=`echo $targetarch|sed 's,^[^-]*-,,'`
3685 : Now look for a hint file osname_osvers, unless one has been
3686 : specified already.
3689 file=`echo "${osname}_${osvers}" | $sed -e 's%\.%_%g' -e 's%_$%%'`
3690 : Also try without trailing minor version numbers.
3691 xfile=`echo $file | $sed -e 's%_[^_]*$%%'`
3692 xxfile=`echo $xfile | $sed -e 's%_[^_]*$%%'`
3693 xxxfile=`echo $xxfile | $sed -e 's%_[^_]*$%%'`
3694 xxxxfile=`echo $xxxfile | $sed -e 's%_[^_]*$%%'`
3697 *) case "$osvers" in
3700 *) if $test -f $src/hints/$file.sh ; then
3702 elif $test -f $src/hints/$xfile.sh ; then
3704 elif $test -f $src/hints/$xxfile.sh ; then
3706 elif $test -f $src/hints/$xxxfile.sh ; then
3708 elif $test -f $src/hints/$xxxxfile.sh ; then
3710 elif $test -f "$src/hints/${osname}.sh" ; then
3719 if $test -f Policy.sh ; then
3722 none) dflt="Policy" ;;
3723 *) dflt="Policy $dflt" ;;
3728 dflt=`echo $hintfile | $sed 's/\.sh$//'`
3732 if $test -f Policy.sh ; then
3735 There's also a Policy hint file available, which should make the
3736 site-specific (policy) questions easier to answer.
3743 You may give one or more space-separated answers, or "none" if appropriate.
3744 If you have a handcrafted Policy.sh file or a Policy.sh file generated by a
3745 previous run of Configure, you may specify it as well as or instead of
3746 OS-specific hints. If hints are provided for your OS, you should use them:
3747 although Perl can probably be built without hints on many platforms, using
3748 hints often improve performance and may enable features that Configure can't
3749 set up on its own. If there are no hints that match your OS, specify "none";
3750 DO NOT give a wrong version or a wrong OS.
3754 rp="Which of these apply, if any?"
3757 for file in $tans; do
3758 if $test X$file = XPolicy -a -f Policy.sh; then
3760 $cat Policy.sh >> UU/config.sh
3761 elif $test -f $src/hints/$file.sh; then
3762 . $src/hints/$file.sh
3763 $cat $src/hints/$file.sh >> UU/config.sh
3764 elif $test X"$tans" = X -o X"$tans" = Xnone ; then
3767 : Give one chance to correct a possible typo.
3768 echo "$file.sh does not exist"
3770 rp="hint to use instead?"
3772 for file in $ans; do
3773 if $test -f "$src/hints/$file.sh"; then
3774 . $src/hints/$file.sh
3775 $cat $src/hints/$file.sh >> UU/config.sh
3776 elif $test X$ans = X -o X$ans = Xnone ; then
3779 echo "$file.sh does not exist -- ignored."
3786 : Remember our hint file for later.
3787 if $test -f "$src/hints/$file.sh" ; then
3797 echo "Fetching default answers from $config_sh..." >&4
3801 cp $config_sh config.sh 2>/dev/null
3813 : Restore computed paths
3814 for file in $loclist $trylist; do
3815 eval $file="\$_$file"
3820 Configure uses the operating system name and version to set some defaults.
3821 The default value is probably right if the name rings a bell. Otherwise,
3822 since spelling matters for me, either accept the default or answer "none"
3829 ''|' '|none) dflt=none ;;
3830 *) dflt=`echo $hintfile | $sed -e 's/\.sh$//' -e 's/_.*$//'` ;;
3833 *) dflt="$osname" ;;
3835 rp="Operating system name?"
3839 *) osname=`echo "$ans" | $sed -e 's/[ ][ ]*/_/g' | ./tr '[A-Z]' '[a-z]'`;;
3845 ''|' '|none) dflt=none ;;
3846 *) dflt=`echo $hintfile | $sed -e 's/\.sh$//' -e 's/^[^_]*//'`
3847 dflt=`echo $dflt | $sed -e 's/^_//' -e 's/_/./g'`
3849 ''|' ') dflt=none ;;
3854 *) dflt="$osvers" ;;
3856 rp="Operating system version?"
3866 : who configured the system
3867 cf_time=`LC_ALL=C; LANGUAGE=C; export LC_ALL; export LANGUAGE; $date 2>&1`
3870 cf_by=`(logname) 2>/dev/null`
3873 cf_by=`(whoami) 2>/dev/null`
3875 "") cf_by=unknown ;;
3880 : decide how portable to be. Allow command line overrides.
3881 case "$d_portable" in
3883 *) d_portable="$define" ;;
3886 : set up shell script to do ~ expansion
3892 echo \$1 | $sed "s|~|\${HOME-\$LOGDIR}|"
3895 if $test -f /bin/csh; then
3896 /bin/csh -f -c "glob \$1"
3901 name=\`$expr x\$1 : '..\([^/]*\)'\`
3902 dir=\`$sed -n -e "/^\${name}:/{s/^[^:]*:[^:]*:[^:]*:[^:]*:[^:]*:\([^:]*\).*"'\$'"/\1/" -e p -e q -e '}' </etc/passwd\`
3903 if $test ! -d "\$dir"; then
3905 echo "\$me: can't locate home directory for: \$name" >&2
3910 echo \$dir/\`$expr x\$1 : '..[^/]*/\(.*\)'\`
3926 : now set up to get a file name
3930 cat <<'EOSC' >>getfile
3946 : getfile will accept an answer from the comma-separated list
3947 : enclosed in parentheses even if it does not meet other criteria.
3948 expr "$fn" : '.*(\(.*\)).*' | $tr ',' $trnl >getfile.ok
3949 fn=`echo $fn | sed 's/(.*)//'`
3955 loc_file=`expr $fn : '.*:\(.*\)'`
3956 fn=`expr $fn : '\(.*\):.*'`
3964 */*) fullpath=true;;
3973 *e*) exp_file=true;;
3976 *p*) nopath_ok=true;;
3981 *d*) type='Directory';;
3982 *l*) type='Locate';;
3987 Locate) what='File';;
3992 case "$d_portable" in
4000 while test "$type"; do
4005 true) rp="$rp (~name ok)";;
4008 if test -f UU/getfile.ok && \
4009 $contains "^$ans\$" UU/getfile.ok >/dev/null 2>&1
4028 value=`UU/filexp $ans`
4031 if test "$ans" != "$value"; then
4032 echo "(That expands to $value on this system.)"
4046 /*) value="$ansexp" ;;
4047 [a-zA-Z]:/*) value="$ansexp" ;;
4052 echo "I shall only accept a full path name, as in /bin/ls." >&4
4053 echo "Use a ! shell escape if you wish to check pathnames." >&4
4056 echo "Please give a full path name, starting with slash." >&4
4059 echo "Note that using ~name is ok provided it expands well." >&4
4072 for fp in $gfpth; do
4073 if test "X$fp" = X.; then
4078 if test -f "$pf"; then
4080 elif test -r "$pf" || (test -h "$pf") >/dev/null 2>&1
4082 echo "($value is not a plain file, but that's ok.)"
4085 if test X"$type" = X; then
4092 for fp in $gfpth; do
4093 if test "X$fp" = X.; then
4098 direxp="$fp/$ansexp"
4100 if test -d "$direxp"; then
4108 if test -d "$ansexp"; then
4109 echo "(Looking for $loc_file in directory $value.)"
4110 value="$value/$loc_file"
4111 ansexp="$ansexp/$loc_file"
4113 if test -f "$ansexp"; then
4116 case "$nopath_ok" in
4117 true) case "$value" in
4119 *) echo "Assuming $value will be in people's path."
4135 if test "$fastread" = yes; then
4140 rp="$what $value doesn't exist. Use that name anyway?"
4159 test "X$gfpthkeep" != Xy && gfpth=""
4162 : determine root of directory hierarchy where package will be installed.
4165 dflt=`./loc . /usr/local /usr/local /local /opt /usr`
4168 dflt=`echo "$prefix" | sed 's/.$//'`
4176 By default, $package will be installed in $dflt/bin, manual pages
4177 under $dflt/man, etc..., i.e. with $dflt as prefix for all
4178 installation directories. Typically this is something like /usr/local.
4179 If you wish to have binaries under /usr/bin but other parts of the
4180 installation under /usr/local, that's ok: you will be prompted
4181 separately for each of the installation directories, the prefix being
4182 only used to set the defaults.
4186 rp='Installation prefix to use?'
4194 *) oldprefix="$prefix";;
4201 : allow them to override the AFS root
4204 *) afsroot=$afsroot ;;
4210 $define|true) afs=true ;;
4211 $undef|false) afs=false ;;
4212 *) if $test -d $afsroot; then
4220 echo "AFS may be running... I'll be extra cautious then..." >&4
4222 echo "AFS does not seem to be running..." >&4
4225 : determine installation prefix for where package is to be installed.
4229 Since you are running AFS, I need to distinguish the directory in which
4230 files will reside from the directory in which they are installed (and from
4231 which they are presumably copied to the former directory by occult means).
4234 case "$installprefix" in
4235 '') dflt=`echo $prefix | sed 's#^/afs/#/afs/.#'`;;
4236 *) dflt="$installprefix";;
4241 In some special cases, particularly when building $package for distribution,
4242 it is convenient to distinguish the directory in which files should be
4243 installed from the directory ($prefix) in which they will
4244 eventually reside. For most users, these two directories are the same.
4247 case "$installprefix" in
4249 *) dflt=$installprefix;;
4253 rp='What installation prefix should I use for installing files?'
4255 installprefix="$ans"
4256 installprefixexp="$ansexp"
4258 : Perform the prefixexp/installprefixexp correction if necessary
4259 cat <<EOS >installprefix
4262 cat <<'EOSC' >>installprefix
4263 : Change installation prefix, if necessary.
4264 if $test X"$prefix" != X"$installprefix"; then
4265 eval "install${prefixvar}=\`echo \$${prefixvar}exp | sed \"s#^\$prefixexp#\$installprefixexp#\"\`"
4267 eval "install${prefixvar}=\"\$${prefixvar}exp\""
4270 chmod +x installprefix
4271 $eunicefix installprefix
4273 : Set variables such as privlib and privlibexp from the output of ./getfile
4274 : performing the prefixexp/installprefixexp correction if necessary.
4275 cat <<EOS >setprefixvar
4278 cat <<'EOSC' >>setprefixvar
4279 eval "${prefixvar}=\"\$ans\""
4280 eval "${prefixvar}exp=\"\$ansexp\""
4283 chmod +x setprefixvar
4284 $eunicefix setprefixvar
4286 : set up the script used to warn in case of inconsistency
4295 '') echo "The $hint value for \$$var on this machine was \"$was\"!" >&4
4297 *) echo "Hmm. Based on the hints in hints/$hintfile.sh, " >&4
4298 echo "the $hint value for \$$var on this machine was \"$was\"!" >&4
4303 echo "*** WHOA THERE!!! ***" >&4
4304 echo " The $hint value for \$$var on this machine was \"$was\"!" >&4
4307 rp=" Keep the $hint value?"
4310 y) td=$was; tu=$was;;
4314 : function used to set '$1' to '$val'
4315 setvar='var=$1; eval "was=\$$1"; td=$define; tu=$undef;
4317 $define$undef) . ./whoa; eval "$var=\$td";;
4318 $undef$define) . ./whoa; eval "$var=\$tu";;
4319 *) eval "$var=$val";;
4322 : get the patchlevel
4324 echo "Getting the current patchlevel..." >&4
4325 if $test -r $rsrc/patchlevel.h;then
4326 revision=`awk '/define[ ]+PERL_REVISION/ {print $3}' $rsrc/patchlevel.h`
4327 patchlevel=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
4328 subversion=`awk '/define[ ]+PERL_SUBVERSION/ {print $3}' $rsrc/patchlevel.h`
4329 api_revision=`awk '/define[ ]+PERL_API_REVISION/ {print $3}' $rsrc/patchlevel.h`
4330 api_version=`awk '/define[ ]+PERL_API_VERSION/ {print $3}' $rsrc/patchlevel.h`
4331 api_subversion=`awk '/define[ ]+PERL_API_SUBVERSION/ {print $3}' $rsrc/patchlevel.h`
4332 perl_patchlevel=`egrep ',"(MAINT|SMOKE)[0-9][0-9]*"' $rsrc/patchlevel.h|tail -1|sed 's/[^0-9]//g'`
4341 $echo "(You do not have patchlevel.h. Eek.)"
4343 : Define a handy string here to avoid duplication in myconfig.SH and configpm.
4344 version_patchlevel_string="version $patchlevel subversion $subversion"
4345 case "$perl_patchlevel" in
4347 *) perl_patchlevel=`echo $perl_patchlevel | sed 's/.* //'`
4348 version_patchlevel_string="$version_patchlevel_string patch $perl_patchlevel"
4352 $echo "(You have $package $version_patchlevel_string.)"
4356 : XXX Should be a Configure test for double-dots in filenames.
4357 version=`echo $revision $patchlevel $subversion | \
4358 $awk '{ printf "%d_%d_%d", $1, $2, $3 }'`
4359 api_versionstring=`echo $api_revision $api_version $api_subversion | \
4360 $awk '{ printf "%d_%d_%d", $1, $2, $3 }'`
4363 version=`echo $revision $patchlevel $subversion | \
4364 $awk '{ printf "%d.%d.%d", $1, $2, $3 }'`
4365 api_versionstring=`echo $api_revision $api_version $api_subversion | \
4366 $awk '{ printf "%d.%d.%d", $1, $2, $3 }'`
4369 : Special case the 5.005_xx maintenance series, which used 5.005
4370 : without any subversion label as a subdirectory in $sitelib
4371 if test "${api_revision}${api_version}${api_subversion}" = "550"; then
4372 api_versionstring='5.005'
4375 : Do we want threads support and if so, what type
4376 case "$usethreads" in
4377 $define|true|[yY]*) dflt='y';;
4378 *) # Catch case where user specified ithreads or 5005threads but
4379 # forgot -Dusethreads (A.D. 4/2002)
4380 case "$useithreads$use5005threads" in
4381 *$define*) dflt='y';;
4388 Perl can be built to offer a form of threading support on some systems
4389 To do so, Configure can be run with -Dusethreads.
4391 Note that Perl built with threading support runs slightly slower
4392 and uses slightly more memory than plain Perl.
4394 If this doesn't make any sense to you, just accept the default '$dflt'.
4396 rp='Build a threading Perl?'
4399 y|Y) val="$define" ;;
4405 if $test $patchlevel -lt 9; then
4406 case "$usethreads" in
4408 : Default to ithreads unless overridden on command line or with
4411 case "$use5005threads" in
4413 echo "5.005 threads are no longer supported"
4417 case "$useithreads" in
4418 $undef|false|[nN]*) dflt='n';;
4420 rp='Use the newer interpreter-based ithreads?'
4423 y|Y) val="$define" ;;
4428 : Now set use5005threads to the opposite value.
4429 case "$useithreads" in
4430 $define) val="$undef" ;;
4437 useithreads="$undef"
4438 use5005threads="$undef"
4442 case "$useithreads$use5005threads" in
4446 You cannot have both the ithreads and the 5.005 threads enabled
4447 at the same time. Disabling the 5.005 threads since they are
4448 much less stable than the ithreads.
4451 use5005threads="$undef"
4456 : perl-5.9.x and later
4458 if test X"$usethreads" = "X$define"; then
4459 case "$use5005threads" in
4463 5.005 threads has been removed for 5.10. Perl will be built using ithreads.
4470 use5005threads="$undef"
4471 useithreads="$usethreads"
4474 case "$d_oldpthreads" in
4475 '') : Configure tests would be welcome here. For now, assume undef.
4477 *) val="$d_oldpthreads" ;;
4483 : Look for a hint-file generated 'call-back-unit'. If the
4484 : user has specified that a threading perl is to be built,
4485 : we may need to set or change some other defaults.
4486 if $test -f usethreads.cbu; then
4487 echo "Your platform has some specific hints regarding threaded builds, using them..."
4490 case "$usethreads" in
4491 "$define"|true|[yY]*)
4493 (Your platform does not have any specific hints for threaded builds.
4494 Assuming POSIX threads, then.)
4500 : Check if multiplicity is required
4503 Perl can be built so that multiple Perl interpreters can coexist
4504 within the same Perl executable.
4507 case "$useithreads" in
4510 This multiple interpreter support is required for interpreter-based threads.
4514 *) case "$usemultiplicity" in
4515 $define|true|[yY]*) dflt='y';;
4519 echo "If this doesn't make any sense to you, just accept the default '$dflt'."
4520 rp='Build Perl for multiplicity?'
4523 y|Y) val="$define" ;;
4531 : Check if morebits is requested
4532 case "$usemorebits" in
4533 "$define"|true|[yY]*)
4534 use64bitint="$define"
4535 uselongdouble="$define"
4536 usemorebits="$define"
4538 *) usemorebits="$undef"
4542 : Determine the C compiler to be used
4548 rp="Use which C compiler?"
4552 : See whether they have no cc but they do have gcc
4554 if $test -f cc.cbu; then
4559 : make some quick guesses about what we are up against
4561 $echo $n "Hmm... $c"
4571 $cat $sysroot/usr/include/signal.h $sysroot/usr/include/sys/signal.h >foo 2>/dev/null
4572 if test -f /osf_boot || $contains 'OSF/1' $sysroot/usr/include/ctype.h >/dev/null 2>&1
4574 echo "Looks kind of like an OSF/1 system, but we'll see..."
4576 elif test `echo abc | $tr a-z A-Z` = Abc ; then
4577 xxx=`./loc addbib blurfl $pth`
4578 if $test -f $xxx; then
4579 echo "Looks kind of like a USG system with BSD features, but we'll see..."
4583 if $contains SIGTSTP foo >/dev/null 2>&1 ; then
4584 echo "Looks kind of like an extended USG system, but we'll see..."
4586 echo "Looks kind of like a USG system, but we'll see..."
4590 elif $contains SIGTSTP foo >/dev/null 2>&1 ; then
4591 echo "Looks kind of like a BSD system, but we'll see..."
4595 echo "Looks kind of like a Version 7 system, but we'll see..."
4598 case "$eunicefix" in
4601 There is, however, a strange, musty smell in the air that reminds me of
4602 something...hmm...yes...I've got it...there's a VMS nearby, or I'm a Blit.
4606 : it so happens the Eunice I know will not run shell scripts in Unix format
4610 echo "Congratulations. You aren't running Eunice."
4614 : Detect OS2. The p_ variable is set above in the Head.U unit.
4615 : Note that this also -- wrongly -- detects e.g. dos-djgpp, which also uses
4616 : semicolon as a patch separator
4621 I have the feeling something is not exactly right, however...don't tell me...
4622 lemme think...does HAL ring a bell?...no, of course, you're only running OS/2!
4623 (Or you may be running DOS with DJGPP.)
4628 if test -f /xenix; then
4629 echo "Actually, this looks more like a XENIX system..."
4634 echo "It's not Xenix..."
4639 if test -f /venix; then
4640 echo "Actually, this looks more like a VENIX system..."
4647 echo "Nor is it Venix..."
4650 chmod +x bsd usg v7 osf1 eunice xenix venix os2
4651 $eunicefix bsd usg v7 osf1 eunice xenix venix os2
4654 : Check if we are using GNU gcc and what its version is
4656 echo "Checking for GNU cc in disguise and/or its version number..." >&4
4660 #if defined(__GNUC__) && !defined(__INTEL_COMPILER)
4662 printf("%s\n", __VERSION__);
4664 printf("%s\n", "1");
4670 if $cc -o try $ccflags $ldflags try.c; then
4671 gccversion=`$run ./try`
4672 case "$gccversion" in
4673 '') echo "You are not using GNU cc." ;;
4674 *) echo "You are using GNU cc $gccversion."
4680 echo "*** WHOA THERE!!! ***" >&4
4681 echo " Your C compiler \"$cc\" doesn't seem to be working!" >&4
4682 case "$knowitall" in
4684 echo " You'd better start hunting for one and let me know about it." >&4
4690 case "$gccversion" in
4691 1*) cpp=`./loc gcc-cpp $cpp $pth` ;;
4693 case "$gccversion" in
4694 '') gccosandvers='' ;;
4695 *) gccshortvers=`echo "$gccversion"|sed 's/ .*//'`
4696 gccosandvers=`$cc -v 2>&1|grep '/specs$'|sed "s!.*/[^-/]*-[^-/]*-\([^-/]*\)/$gccshortvers/specs!\1!"`
4698 case "$gccosandvers" in
4699 $osname) gccosandvers='' ;; # linux gccs seem to have no linux osvers, grr
4700 $osname$osvers) ;; # looking good
4701 $osname*) cat <<EOM >&4
4703 *** WHOA THERE!!! ***
4705 Your gcc has not been compiled for the exact release of
4706 your operating system ($gccosandvers versus $osname$osvers).
4708 In general it is a good idea to keep gcc synchronized with
4709 the operating system because otherwise serious problems
4710 may ensue when trying to compile software, like Perl.
4712 I'm trying to be optimistic here, though, and will continue.
4713 If later during the configuration and build icky compilation
4714 problems appear (headerfile conflicts being the most common
4715 manifestation), I suggest reinstalling the gcc to match
4716 your operating system release.
4720 *) gccosandvers='' ;; # failed to parse, better be silent
4728 # gcc 3.* complain about adding -Idirectories that they already know about,
4729 # so we will take those off from locincpth.
4730 case "$gccversion" in
4732 echo "main(){}">try.c
4733 for incdir in $locincpth; do
4734 warn=`$cc $ccflags -I$incdir -c try.c 2>&1 | \
4735 grep '^c[cp]p*[01]: warning: changing search order '`
4736 if test "X$warn" != X; then
4737 locincpth=`echo " $locincpth " | sed "s! $incdir ! !"`
4743 # gcc 4.9 by default does some optimizations that break perl.
4744 # see ticket 121505.
4746 # The -fwrapv disables those optimizations (and probably others,) so
4747 # for gcc 4.9 (and later, since the optimizations probably won't go
4748 # away), add -fwrapv unless the user requests -fno-wrapv, which
4749 # disables -fwrapv, or if the user requests -fsanitize=undefined,
4750 # which turns the overflows -fwrapv ignores into runtime errors.
4751 case "$gccversion" in
4752 4.[3-9].*|4.[1-9][0-9]*|[5-9].*|[1-9][0-9]*)
4754 *-fno-wrapv*|*-fsanitize=undefined*|*-fwrapv*) ;;
4755 *) ccflags="$ccflags -fwrapv" ;;
4759 : What should the include directory be ?
4760 : Use sysroot if set, so findhdr looks in the right place.
4762 $echo $n "Hmm... $c"
4763 dflt="$sysroot/usr/include"
4766 if $test -f /bin/mips && /bin/mips; then
4767 echo "Looks like a MIPS system..."
4768 $cat >usr.c <<'EOCP'
4769 #ifdef SYSTYPE_BSD43
4773 if $cc $cppflags -E usr.c > usr.out && $contains / usr.out >/dev/null 2>&1; then
4774 dflt='/bsd43/usr/include'
4778 mips_type='System V'
4780 $rm -f usr.c usr.out
4781 echo "and you're compiling with the $mips_type compiler and libraries."
4785 echo "Doesn't look like a MIPS system."
4795 case "$xxx_prompt" in
4798 rp='Where are the include files you want to use?'
4806 : see how we invoke the C preprocessor
4808 echo "Now, how can we feed standard input to your C preprocessor..." >&4
4809 cat <<'EOT' >testcpp.c
4815 if test ! -f cppstdin; then
4816 if test "X$osname" = "Xaix" -a "X$gccversion" = X; then
4817 # AIX cc -E doesn't show the absolute headerfile
4818 # locations but we'll cheat by using the -M flag.
4819 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
4821 echo 'cat >.$$.c; '"$cc $cppflags"' -E ${1+"$@"} .$$.c; rm .$$.c' >cppstdin
4824 echo "Keeping your $hint cppstdin wrapper."
4827 wrapper=`pwd`/cppstdin
4831 if $test "X$cppstdin" != "X" && \
4832 $cppstdin $cppminus <testcpp.c >testcpp.out 2>&1 && \
4833 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
4835 echo "You used to use $cppstdin $cppminus so we'll use that again."
4837 '') echo "But let's see if we can live without a wrapper..." ;;
4839 if $cpprun $cpplast <testcpp.c >testcpp.out 2>&1 && \
4840 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
4842 echo "(And we'll use $cpprun $cpplast to preprocess directly.)"
4845 echo "(However, $cpprun $cpplast does not work, let's see...)"
4853 echo "Good old $cppstdin $cppminus does not seem to be of any help..."
4860 elif echo 'Maybe "'"$cc"' -E" will work...'; \
4861 $cc -E <testcpp.c >testcpp.out 2>&1; \
4862 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4863 echo "Yup, it does."
4864 x_cpp="$cc $cppflags -E"
4866 elif echo 'Nope...maybe "'"$cc"' -E -" will work...'; \
4867 $cc -E - <testcpp.c >testcpp.out 2>&1; \
4868 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4869 echo "Yup, it does."
4870 x_cpp="$cc $cppflags -E"
4872 elif echo 'Nope...maybe "'"$cc"' -P" will work...'; \
4873 $cc -P <testcpp.c >testcpp.out 2>&1; \
4874 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4875 echo "Yipee, that works!"
4876 x_cpp="$cc $cppflags -P"
4878 elif echo 'Nope...maybe "'"$cc"' -P -" will work...'; \
4879 $cc -P - <testcpp.c >testcpp.out 2>&1; \
4880 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4881 echo "At long last!"
4882 x_cpp="$cc $cppflags -P"
4884 elif echo 'No such luck, maybe "'$cpp'" will work...'; \
4885 $cpp <testcpp.c >testcpp.out 2>&1; \
4886 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4888 x_cpp="$cpp $cppflags"
4890 elif echo 'Nixed again...maybe "'$cpp' -" will work...'; \
4891 $cpp - <testcpp.c >testcpp.out 2>&1; \
4892 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4893 echo "Hooray, it works! I was beginning to wonder."
4894 x_cpp="$cpp $cppflags"
4896 elif echo 'Uh-uh. Time to get fancy. Trying a wrapper...'; \
4897 $wrapper <testcpp.c >testcpp.out 2>&1; \
4898 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4904 rp="No dice. I can't find a C preprocessor. Name one:"
4908 $x_cpp <testcpp.c >testcpp.out 2>&1
4909 if $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4910 echo "OK, that will do." >&4
4912 echo "Sorry, I can't get that to work. Go find one and rerun Configure." >&4
4927 echo "Perhaps can we force $cc -E using a wrapper..."
4928 if $wrapper <testcpp.c >testcpp.out 2>&1; \
4929 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
4935 echo "Nope, we'll have to live without it..."
4949 "$wrapper"|'cppstdin') ;;
4950 *) $rm -f $wrapper;;
4952 $rm -f testcpp.c testcpp.out
4954 : Adjust cppfilter for path component separator
4956 vos) cppfilter="tr '\\\\>' '/' |" ;; # path component separator is >
4957 os2) cppfilter="sed -e 's|\\\\\\\\|/|g' |" ;; # path component separator is \
4961 : Use gcc to determine libpth and incpth
4962 # If using gcc or clang, we can get better values for libpth, incpth
4963 # and usrinc directly from the compiler.
4964 # Note that ccname for clang is also gcc.
4967 $echo 'extern int foo;' > try.c
4968 set X `$cppstdin -v try.c 2>&1 | $awk '/^#include </,/^End of search /'|$cppfilter $grep '/include'`
4970 if $test $# -gt 0; then
4972 incpth="`$echo $incpth|$sed 's/^ //'`"
4974 j="`$echo $i|$sed 's,/include$,/lib,'`"
4975 if $test -d $j; then
4979 libpth="`$echo $libpth|$sed 's/^ //'`"
4980 for xxx in $libpth $loclibpth $plibpth $glibpth; do
4981 if $test -d $xxx; then
4984 *) libpth="$libpth $xxx";;
4991 '') for i in $incpth; do
4992 if $test -f $i/errno.h -a -f $i/stdio.h -a -f $i/time.h; then
5000 case "$usecrosscompile" in
5003 '') echo "Incpth not defined." >&4; croak=y ;;
5004 *) echo "Using incpth '$incpth'." >&4 ;;
5007 '') echo "Libpth not defined." >&4; croak=y ;;
5008 *) echo "Using libpth '$libpth'." >&4 ;;
5011 '') echo "Usrinc not defined." >&4; croak=y ;;
5012 *) echo "Using usrinc $usrinc." >&4 ;;
5016 if test "X$sysroot" = X; then
5017 echo "Cannot continue, aborting." >&4; exit 1
5019 echo "Cross-compiling using sysroot $sysroot, failing to guess inc/lib paths is not fatal" >&4
5028 : Default value for incpth is just usrinc
5030 '') incpth="$usrinc";;
5033 : Set private lib path
5036 plibpth="$incpath/usr/lib $sysroot/usr/local/lib $sysroot/usr/ccs/lib"
5041 '') dlist="$loclibpth $plibpth $glibpth";;
5042 *) dlist="$libpth";;
5045 : Now check and see which directories actually exist, avoiding duplicates
5048 if $test -d $xxx; then
5051 *) libpth="$libpth $xxx";;
5057 Some systems have incompatible or broken versions of libraries. Among
5058 the directories listed in the question below, please remove any you
5059 know not to be holding relevant libraries, and add any that are needed.
5060 Say "none" for none.
5064 if test "X$sysroot" != X; then
5066 You have set sysroot to $sysroot, please supply the directories excluding sysroot
5079 rp="Directories to use for library searches?"
5086 : compute shared library extension
5089 if xxx=`./loc libc.sl X $libpth`; $test -f "$xxx"; then
5099 On some systems, shared libraries may be available. Answer 'none' if
5100 you want to suppress searching of shared libraries for the remainder
5101 of this configuration.
5104 rp='What is the file extension used for shared libraries?'
5108 : Does target system insist that shared library basenames are unique
5111 Some dynamic loaders assume that the *basename* of shared library filenames
5112 are globally unique. We'll default this to undef as we assume your system
5113 is not this weird. Set to defined if you're on one of them.
5118 rp='Make shared library basenames unique?'
5121 y|Y) val="$define" ;;
5124 set d_libname_unique
5127 : Define several unixisms.
5128 : Hints files or command line option can be used to override them.
5129 : The convoluted testing is in case hints files set either the old
5132 '') case "$exe_ext" in
5134 *) _exe="$exe_ext" ;;
5139 '') case "$lib_ext" in
5146 '') case "$obj_ext" in
5153 '') case "$path_sep" in
5164 rm_try="$rm -f try try$_exe a.out .out try.[cho] try.$_o core core.try* try.core*"
5166 : Which makefile gets called first. This is used by make depend.
5167 case "$firstmakefile" in
5168 '') firstmakefile='makefile';;
5171 : Check is we will use socks
5173 $define|true|[yY]*) dflt='y';;
5178 Perl can be built to use the SOCKS proxy protocol library. To do so,
5179 Configure must be run with -Dusesocks. If you use SOCKS you also need
5180 to use the PerlIO abstraction layer, this will be implicitly selected.
5182 If this doesn't make any sense to you, just accept the default '$dflt'.
5184 rp='Build Perl for SOCKS?'
5187 y|Y) val="$define" ;;
5193 : Check for uselongdouble support
5195 *-DUSE_LONG_DOUBLE*|*-DUSE_MORE_BITS*) uselongdouble="$define" ;;
5198 case "$uselongdouble" in
5199 $define|true|[yY]*) dflt='y';;
5204 Perl can be built to take advantage of long doubles which
5205 (if available) may give more accuracy and range for floating point numbers.
5207 If this doesn't make any sense to you, just accept the default '$dflt'.
5209 rp='Try to use long doubles if available?'
5212 y|Y) val="$define" ;;
5218 case "$uselongdouble" in
5219 true|[yY]*) uselongdouble="$define" ;;
5222 : Look for a hint-file generated 'call-back-unit'. If the
5223 : user has specified that long doubles should be used,
5224 : we may need to set or change some other defaults.
5225 if $test -f uselongdouble.cbu; then
5226 echo "Your platform has some specific hints regarding long doubles, using them..."
5227 . ./uselongdouble.cbu
5229 case "$uselongdouble" in
5232 (Your platform does not have any specific hints for long doubles.)
5238 : Check if quadmath is requested
5239 case "$usequadmath" in
5240 "$define"|true|[yY]*) usequadmath="$define" ;;
5241 *) usequadmath="$undef" ;;
5244 : Fail if both uselongdouble and usequadmath are requested
5245 case "$usequadmath:$uselongdouble" in
5249 *** You requested the use of the quadmath library and use
5250 *** of long doubles.
5252 *** Please select one or the other.
5258 : Looking for optional libraries
5260 echo "Checking for optional libraries..." >&4
5265 case "$libswanted" in
5266 '') libswanted='c_s';;
5269 "$define") libswanted="$libswanted socks5 socks5_sh" ;;
5271 case "$usecbacktrace" in
5272 "$define") libswanted="$libswanted bfd" ;;
5274 case "$usequadmath" in
5275 "$define") libswanted="$libswanted quadmath" ;;
5281 for thisdir in $libpth $xlibpth; do
5282 test -d $thisdir && libspath="$libspath $thisdir"
5284 for thislib in $libswanted; do
5285 for thisdir in $libspath; do
5287 if $test ! -f "$xxx" -a "X$ignore_versioned_solibs" = "X"; then
5288 xxx=`ls $thisdir/lib$thislib.$so.[0-9] 2>/dev/null|sed -n '$p'`
5289 $test -f "$xxx" && eval $libscheck
5290 $test -f "$xxx" && libstyle=shared
5291 xxx=`ls $thisdir/lib$thislib.[0-9].$so 2>/dev/null|sed -n '$p'`
5292 $test -f "$xxx" && eval $libscheck
5293 $test -f "$xxx" && libstyle=shared
5295 if test ! -f "$xxx"; then
5296 xxx=$thisdir/lib$thislib.$so
5297 $test -f "$xxx" && eval $libscheck
5298 $test -f "$xxx" && libstyle=shared
5300 if test ! -f "$xxx"; then
5301 xxx=$thisdir/lib$thislib$_a
5302 $test -f "$xxx" && eval $libscheck
5303 $test -f "$xxx" && libstyle=static
5305 if test ! -f "$xxx"; then
5306 xxx=$thisdir/$thislib$_a
5307 $test -f "$xxx" && eval $libscheck
5308 $test -f "$xxx" && libstyle=static
5310 if test ! -f "$xxx"; then
5311 xxx=$thisdir/lib${thislib}_s$_a
5312 $test -f "$xxx" && eval $libscheck
5313 $test -f "$xxx" && libstyle=static
5314 $test -f "$xxx" && thislib=${thislib}_s
5316 if test ! -f "$xxx"; then
5317 xxx=$thisdir/Slib$thislib$_a
5318 $test -f "$xxx" && eval $libscheck
5319 $test -f "$xxx" && libstyle=static
5321 if $test -f "$xxx"; then
5323 shared) echo "Found -l$thislib (shared)." ;;
5324 static) echo "Found -l$thislib." ;;
5325 *) echo "Found -l$thislib ($libstyle)." ;;
5329 *) dflt="$dflt -l$thislib"
5330 libsfound="$libsfound $xxx"
5332 libsfiles="$libsfiles $yyy"
5333 yyy=`echo $xxx|$sed -e "s%/$yyy\\$%%"`
5334 case " $libsdirs " in
5336 *) libsdirs="$libsdirs $yyy" ;;
5343 if $test ! -f "$xxx"; then
5344 echo "No -l$thislib."
5355 ' '|'') dflt='none';;
5360 In order to compile $package on your machine, a number of libraries
5361 are usually needed. Include any other special libraries here as well.
5362 Say "none" for none. The default list is almost always right.
5366 rp="What libraries to use?"
5373 : determine optimization, if desired, or use for debug flag also
5375 ' '|$undef) dflt='none';;
5377 *) dflt="$optimize";;
5381 By default, $package compiles with the -O flag to use the optimizer.
5382 Alternately, you might want to use the symbolic debugger, which uses
5383 the -g flag (on traditional Unix systems). Either flag can be
5384 specified here. To use neither flag, specify the word "none".
5387 rp="What optimizer/debugger flag should be used?"
5391 'none') optimize=" ";;
5394 : Check what DEBUGGING is required from the command line
5395 : -DEBUGGING or -DDEBUGGING or
5396 : -DEBUGGING=both = -g + -DDEBUGGING
5397 : -DEBUGGING=-g or -Doptimize=-g = -g
5398 : -DEBUGGING=none or -UDEBUGGING =
5399 : -DEBUGGING=old or -DEBUGGING=default = ? $optimize
5402 *) DEBUGGING=$EBUGGING ;;
5405 case "$DEBUGGING" in
5409 *) optimize="$optimize -g" ;;
5413 *-g*) set `echo "X $optimize " | sed 's/ -g / /'`
5421 case "$DEBUGGING" in
5422 both|$define) dflt='-DDEBUGGING'
5425 : argument order is deliberate, as the flag will start with - which set could
5426 : think is an option
5427 checkccflag='check=$1; flag=$2; callback=$3;
5429 echo "Checking if your compiler accepts $flag" 2>&1;
5430 [ "X$sysroot" != "X" ] && echo "For sysroot = $sysroot";
5431 echo "int main(void) { return 0; }" > gcctest.c;
5432 if $cc $_sysroot -O2 $flag -o gcctest gcctest.c 2>gcctest.out && $run ./gcctest; then
5433 echo "Yes, it does." 2>&1;
5434 if $test -s gcctest.out ; then
5435 echo "But your platform does not like it:";
5440 echo "Leaving current flags $ccflags alone." 2>&1
5442 *) dflt="$dflt $flag";
5448 echo "Nope, it does not, but that is ok." 2>&1;
5452 : We will not override a previous value, but we might want to
5453 : augment a hint file
5455 default|recommended)
5456 case "$gccversion" in
5457 1*) dflt="$dflt -fpcc-struct-return" ;;
5459 case "$optimize:$DEBUGGING" in
5460 *-g*:old) dflt="$dflt -DDEBUGGING";;
5462 case "$gccversion" in
5463 2*) if $test -d /etc/conf/kconfig.d &&
5464 $contains _POSIX_VERSION $usrinc/sys/unistd.h >/dev/null 2>&1
5466 # Interactive Systems (ISC) POSIX mode.
5471 case "$gccversion" in
5474 ?*) set strict-aliasing -fno-strict-aliasing
5478 # For gcc, adding -pipe speeds up compilations for some, but apparently
5479 # some assemblers can't read from stdin. (It also slows down compilations
5480 # in other cases, but those are apparently rarer these days.) AD 5/2004.
5481 case "$gccversion" in
5487 # on x86_64 (at least) we require an extra library (libssp) in the
5488 # link command line. This library is not named, so I infer that it is
5489 # an implementation detail that may change. Hence the safest approach
5490 # is to add the flag to the flags passed to the compiler at link time,
5491 # as that way the compiler can do the right implementation dependant
5494 amigaos) ;; # -fstack-protector builds but doesn't work
5495 *) case "$gccversion" in
5496 ?*) set stack-protector-strong -fstack-protector-strong
5499 *-fstack-protector-strong*) ;; # It got added.
5500 *) # Try the plain/older -fstack-protector.
5501 set stack-protector -fstack-protector
5512 case "$mips_type" in
5513 *BSD*|'') inclwanted="$locincpth $usrinc";;
5514 *) inclwanted="$locincpth $inclwanted $usrinc/bsd";;
5516 for thisincl in $inclwanted; do
5517 if $test -d $thisincl; then
5518 if $test x$thisincl != x$usrinc; then
5520 *" -I$thisincl "*);;
5521 *) dflt="$dflt -I$thisincl ";;
5527 inctest='if $contains $2 $usrinc/$1 >/dev/null 2>&1; then
5529 elif $contains $2 $usrinc/sys/$1 >/dev/null 2>&1; then
5537 *) dflt="$dflt -D$2";;
5541 set signal.h LANGUAGE_C; eval $inctest
5545 ccflags="$ccflags -DSOCKS"
5550 default|recommended) dflt="$ccflags $dflt" ;;
5551 *) dflt="$ccflags";;
5560 Your C compiler may want other flags. For this question you should include
5561 -I/whatever and -DWHATEVER flags and any other flags used by the C compiler,
5562 but you should NOT include libraries or ld flags like -lwhatever. If you
5563 want $package to honor its debug switch, you should include -DDEBUGGING here.
5564 Your C compiler might also need additional flags, such as -D_POSIX_SOURCE.
5566 To use no flags, specify the word "none".
5572 rp="Any additional cc flags?"
5579 : the following weeds options from ccflags that are of no interest to cpp
5581 '') cppflags="$ccflags" ;;
5582 *) set X $ccflags; shift
5583 case " $cppflags " in
5584 *" $1 "*) ;; # Try to avoid doubling the cppflags.
5585 *) cppflags="$cppflags $ccflags" ;;
5589 case "$gccversion" in
5590 1*) cppflags="$cppflags -D__GNUC__"
5592 case "$mips_type" in
5594 *BSD*) cppflags="$cppflags -DSYSTYPE_BSD43";;
5600 echo "Let me guess what the preprocessor flags are..." >&4
5614 *) ftry="$previous $flag";;
5616 if $cppstdin -DLFRULB=bar $cppflags $ftry $cppminus <cpp.c \
5617 >cpp1.out 2>/dev/null && \
5618 $cpprun -DLFRULB=bar $cppflags $ftry $cpplast <cpp.c \
5619 >cpp2.out 2>/dev/null && \
5620 $contains 'foo.*xx.*bar' cpp1.out >/dev/null 2>&1 && \
5621 $contains 'foo.*xx.*bar' cpp2.out >/dev/null 2>&1
5623 cppflags="$cppflags $ftry"
5633 *-*) echo "They appear to be: $cppflags";;
5635 $rm -f cpp.c cpp?.out
5639 : flags used in final linking phase
5641 '') if ./venix; then
5647 *-posix*) dflt="$dflt -posix" ;;
5650 *) dflt="$ldflags";;
5652 # See note above about -fstack-protector
5654 *-fstack-protector-strong*)
5656 *-fstack-protector-strong*) ;; # Don't add it again
5657 *) dflt="$dflt -fstack-protector-strong" ;;
5660 *-fstack-protector*)
5662 *-fstack-protector*) ;; # Don't add it again
5663 *) dflt="$dflt -fstack-protector" ;;
5668 : Try to guess additional flags to pick up local libraries.
5669 for thislibdir in $libpth; do
5670 case " $loclibpth " in
5673 *"-L$thislibdir "*) ;;
5674 *) dflt="$dflt -L$thislibdir" ;;
5686 Your C linker may need flags. For this question you should
5687 include -L/whatever and any other flags used by the C linker, but you
5688 should NOT include libraries like -lwhatever.
5690 Make sure you include the appropriate -L/path flags if your C linker
5691 does not normally search all of the directories you specified above,
5694 To use no flags, specify the word "none".
5698 rp="Any additional ld flags (NOT including libraries)?"
5704 rmlist="$rmlist pdp11"
5708 echo "Checking your choice of C compiler and flags for coherency..." >&4
5709 $cat > try.c <<'EOF'
5711 int main() { printf("Ok\n"); return(0); }
5713 set X $cc -o try $optimize $ccflags $ldflags try.c $libs
5715 $cat >try.msg <<'EOM'
5716 I've tried to compile and run the following simple program:
5719 $cat try.c >> try.msg
5721 $cat >> try.msg <<EOM
5728 and I got the following output:
5732 if $sh -c "$cc -o try $optimize $ccflags $ldflags try.c $libs" >>try.msg 2>&1; then
5733 if $sh -c "$run ./try " >>try.msg 2>&1; then
5737 *) echo 'The program compiled OK, but produced no output.' >> try.msg ;;
5740 echo "The program compiled OK, but exited with status $?." >>try.msg
5741 rp="You have a problem. Shall I abort Configure"
5745 echo "I can't compile the test program." >>try.msg
5746 rp="You have a BIG problem. Shall I abort Configure"
5752 case "$knowitall" in
5754 echo "(The supplied flags or libraries might be incorrect.)"
5762 *) echo "Ok. Stopping Configure." >&4
5767 n) echo "OK, that should do.";;
5769 $rm_try gcctest gcctest.out
5771 : define a shorthand compile call
5775 case "$usedevel" in $define|true|[yY]*) if $test ! -f "${mc_file}.c"; then
5776 echo "Internal Configure script bug - compiler test file ${mc_file}.c is missing. Please report this to perlbug@perl.org" >&4;
5780 $cc -o ${mc_file} $optimize $ccflags $ldflags $* ${mc_file}.c $libs > /dev/null 2>&1;'
5781 : define a shorthand compile call for compilations that should be ok.
5785 $cc -o ${mc_file} $optimize $ccflags $ldflags $* ${mc_file}.c $libs;'
5787 : determine filename position in cpp output
5789 echo "Computing filename position in cpp output for #include directives..." >&4
5791 amigaos) fieldn=3 ;; # Workaround for a bug in abc (pdksh).
5796 vos) testaccess=-e ;;
5799 echo '#include <stdio.h>' > foo.c
5802 $cppstdin $cppflags $cppminus <foo.c 2>/dev/null | \
5803 $grep '^[ ]*#.*stdio\.h' | \
5804 while read cline; do
5807 while $test \$# -gt 0; do
5808 if $test $testaccess \`echo \$1 | $tr -d '"'\`; then
5813 pos=\`expr \$pos + 1\`
5827 *) pos="${fieldn}th";;
5829 echo "Your cpp writes the filename in the $pos field of the line."
5831 : locate header file
5836 for usrincdir in $incpth
5838 if test -f \$usrincdir/\$wanted; then
5839 echo "\$usrincdir/\$wanted"
5843 awkprg='{ print \$$fieldn }'
5844 echo "#include <\$wanted>" > foo\$\$.c
5845 $cppstdin $cppminus $cppflags < foo\$\$.c 2>/dev/null | \
5846 $cppfilter $grep "^[ ]*#.*\$wanted" | \
5847 while read cline; do
5848 name=\`echo \$cline | $awk "\$awkprg" | $tr -d '"'\`
5850 *[/\\\\]\$wanted) echo "\$name"; exit 1;;
5851 *[\\\\/]\$wanted) echo "\$name"; exit 1;;
5856 # status = 0: grep returned 0 lines, case statement not executed
5857 # status = 1: headerfile found
5858 # status = 2: while loop executed, no headerfile found
5862 if test \$status -eq 1; then
5869 : define an alternate in-header-list? function
5870 inhdr='echo " "; td=$define; tu=$undef; yyy=$@;
5871 cont=true; xxf="echo \"<\$1> found.\" >&4";
5872 case $# in 2) xxnf="echo \"<\$1> NOT found.\" >&4";;
5873 *) xxnf="echo \"<\$1> NOT found, ...\" >&4";;
5875 case $# in 4) instead=instead;; *) instead="at last";; esac;
5876 while $test "$cont"; do
5878 var=$2; eval "was=\$$2";
5879 if $test "$xxx" && $test -r "$xxx";
5881 eval "case \"\$$var\" in $undef) . ./whoa; esac"; eval "$var=\$td";
5884 eval "case \"\$$var\" in $define) . ./whoa; esac"; eval "$var=\$tu"; fi;
5885 set $yyy; shift; shift; yyy=$@;
5886 case $# in 0) cont="";;
5887 2) xxf="echo \"but I found <\$1> $instead.\" >&4";
5888 xxnf="echo \"and I did not find <\$1> either.\" >&4";;
5889 *) xxf="echo \"but I found <\$1\> instead.\" >&4";
5890 xxnf="echo \"there is no <\$1>, ...\" >&4";;
5894 do set $yyy; var=$2; eval "was=\$$2";
5895 eval "case \"\$$var\" in $define) . ./whoa; esac"; eval "$var=\$tu";
5896 set $yyy; shift; shift; yyy=$@;
5899 : see if stdlib is available
5900 set stdlib.h i_stdlib
5903 : check for lengths of integral types
5907 echo "Checking to see how big your integers are..." >&4
5916 printf("intsize=%d;\n", (int)sizeof(int));
5917 printf("longsize=%d;\n", (int)sizeof(long));
5918 printf("shortsize=%d;\n", (int)sizeof(short));
5923 if eval $compile_ok && $run ./try > /dev/null; then
5925 echo "Your integers are $intsize bytes long."
5926 echo "Your long integers are $longsize bytes long."
5927 echo "Your short integers are $shortsize bytes long."
5931 Help! I can't compile and run the intsize test program: please enlighten me!
5932 (This is probably a misconfiguration in your system or libraries, and
5933 you really ought to fix it. Still, I'll try anyway.)
5937 rp="What is the size of an integer (in bytes)?"
5941 rp="What is the size of a long integer (in bytes)?"
5945 rp="What is the size of a short integer (in bytes)?"
5953 : check for long long
5955 echo "Checking to see if you have long long..." >&4
5956 echo 'int main() { long long x = 7; return 0; }' > try.c
5958 if eval $compile; then
5960 echo "You have long long."
5963 echo "You do not have long long."
5969 : check for length of long long
5970 case "${d_longlong}${longlongsize}" in
5973 echo "Checking to see how big your long longs are..." >&4
5974 $cat >try.c <<'EOCP'
5978 printf("%d\n", (int)sizeof(long long));
5983 if eval $compile_ok; then
5984 longlongsize=`$run ./try`
5985 echo "Your long longs are $longlongsize bytes long."
5989 echo "(I can't seem to compile the test program. Guessing...)"
5990 rp="What is the size of a long long (in bytes)?"
5994 if $test "X$longsize" = "X$longlongsize"; then
5995 echo "(That isn't any different from an ordinary long.)"
6001 : see if inttypes.h is available
6002 : we want a real compile instead of Inhdr because some systems
6003 : have an inttypes.h which includes non-existent headers
6006 #include <inttypes.h>
6008 static int32_t foo32 = 0x12345678;
6012 if eval $compile; then
6013 echo "<inttypes.h> found." >&4
6016 echo "<inttypes.h> NOT found." >&4
6025 echo "Checking to see if you have int64_t..." >&4
6027 #include <sys/types.h>
6028 #$i_inttypes I_INTTYPES
6030 #include <inttypes.h>
6032 int main() { int64_t x = 7; }
6035 if eval $compile; then
6037 echo "You have int64_t."
6040 echo "You do not have int64_t."
6046 : Check if 64bit ints have a quad type
6048 echo "Checking which 64-bit integer type we could use..." >&4
6054 val='"unsigned int"'
6059 *) case "$longsize" in
6063 val='"unsigned long"'
6068 *) case "$d_longlong:$longlongsize" in
6073 val='"unsigned long long"'
6078 *) case "$d_int64_t" in
6097 '') echo "Alas, no 64-bit integer types in sight." >&4
6100 *) echo "We could use '$quadtype' for 64-bit integers." >&4
6105 : Do we want 64bit support
6106 case "$uselonglong" in
6107 "$define"|true|[yY]*)
6110 *** Configure -Duselonglong is deprecated, using -Duse64bitint instead.
6112 use64bitint="$define"
6115 case "$use64bits" in
6116 "$define"|true|[yY]*)
6119 *** Configure -Duse64bits is deprecated, using -Duse64bitint instead.
6121 use64bitint="$define"
6124 case "$use64bitints" in
6125 "$define"|true|[yY]*)
6128 *** There is no Configure -Duse64bitints, using -Duse64bitint instead.
6130 use64bitint="$define"
6133 case "$use64bitsint" in
6134 "$define"|true|[yY]*)
6137 *** There is no Configure -Duse64bitsint, using -Duse64bitint instead.
6139 use64bitint="$define"
6142 case "$uselonglongs" in
6143 "$define"|true|[yY]*)
6146 *** There is no Configure -Duselonglongs, using -Duse64bitint instead.
6148 use64bitint="$define"
6151 case "$use64bitsall" in
6152 "$define"|true|[yY]*)
6155 *** There is no Configure -Duse64bitsall, using -Duse64bitall instead.
6157 use64bitall="$define"
6162 *-DUSE_LONG_LONG*|*-DUSE_64_BIT_INT*|*-DUSE_64_BIT_ALL*) use64bitint="$define";;
6164 case "$use64bitall" in
6165 "$define"|true|[yY]*) use64bitint="$define" ;;
6171 You have natively 64-bit long integers.
6175 *) case "$use64bitint" in
6176 "$define"|true|[yY]*) dflt='y';;
6185 Perl can be built to take advantage of 64-bit integer types
6186 on some systems. To do so, Configure can be run with -Duse64bitint.
6187 Choosing this option will most probably introduce binary incompatibilities.
6189 If this doesn't make any sense to you, just accept the default '$dflt'.
6190 (The default has been chosen based on your configuration.)
6192 rp='Try to use 64-bit integers, if available?'
6195 [yY]*) val="$define" ;;
6203 case "$use64bitall" in
6204 "$define"|true|[yY]*) dflt='y' ;;
6205 *) case "$longsize" in
6213 You may also choose to try maximal 64-bitness. It means using as much
6214 64-bitness as possible on the platform. This in turn means even more
6215 binary incompatibilities. On the other hand, your platform may not
6216 have any more 64-bitness available than what you already have chosen.
6218 If this doesn't make any sense to you, just accept the default '$dflt'.
6219 (The default has been chosen based on your configuration.)
6221 rp='Try to use maximal 64-bit support, if available?'
6224 [yY]*) val="$define" ;;
6229 case "$use64bitall" in
6231 case "$use64bitint" in
6235 Since you have chosen a maximally 64-bit build, I'm also turning on
6236 the use of 64-bit integers.
6238 use64bitint="$define" ;;
6243 : Look for a hint-file generated 'call-back-unit'. If the
6244 : user has specified that a 64-bit perl is to be built,
6245 : we may need to set or change some other defaults.
6246 if $test -f use64bitint.cbu; then
6247 echo "Your platform has some specific hints regarding 64-bit integers, using them..."
6250 case "$use64bitint" in
6251 "$define"|true|[yY]*)
6252 : This test was common to all the OpenBSD forks, and seems harmless for
6255 echo "Checking if your C library has broken 64-bit functions..." >&4
6258 typedef $uquadtype myULL;
6265 {4294967303.15, 4294967303ULL},
6266 {4294967294.2, 4294967294ULL},
6267 {4294967295.7, 4294967295ULL},
6270 for (p = test; p->u; p++) {
6271 myULL x = (myULL)p->d;
6282 if eval $compile_ok; then
6283 libcquad=`$run ./try`
6284 echo "Your C library's 64-bit functions are $libcquad."
6286 echo "(I can't seem to compile the test program.)"
6287 echo "Assuming that your C library's 64-bit functions are ok."
6296 *** You have a C library with broken 64-bit functions.
6297 *** 64-bit support does not work reliably in this configuration.
6298 *** Please rerun Configure without -Duse64bitint and/or -Dusemorebits.
6299 *** Cannot continue, aborting.
6306 4) case "$archname64" in
6307 '') archname64=64int ;;
6314 : Look for a hint-file generated 'call-back-unit'. If the
6315 : user has specified that a maximally 64-bit perl is to be built,
6316 : we may need to set or change some other defaults.
6317 if $test -f use64bitall.cbu; then
6318 echo "Your platform has some specific hints regarding 64-bit builds, using them..."
6321 case "$use64bitall" in
6322 "$define"|true|[yY]*)
6324 4) case "$archname64" in
6325 ''|64int) archname64=64all ;;
6332 case "$d_quad:$use64bitint" in
6336 *** You have chosen to use 64-bit integers,
6337 *** but none can be found.
6338 *** Please rerun Configure without -Duse64bitint and/or -Dusemorebits.
6339 *** Cannot continue, aborting.
6346 : Check if we are using the GNU C library
6348 echo "Checking for GNU C Library..." >&4
6350 /* Find out version of GNU C library. __GLIBC__ and __GLIBC_MINOR__
6351 alone are insufficient to distinguish different versions, such as
6352 2.0.6 and 2.0.7. The function gnu_get_libc_version() appeared in
6353 libc version 2.1.0. A. Dougherty, June 3, 2002.
6359 # ifdef __GLIBC_MINOR__
6360 # if __GLIBC__ >= 2 && __GLIBC_MINOR__ >= 1 && !defined(__cplusplus)
6361 # include <gnu/libc-version.h>
6362 printf("%s\n", gnu_get_libc_version());
6364 printf("%d.%d\n", __GLIBC__, __GLIBC_MINOR__);
6367 printf("%d\n", __GLIBC__);
6376 if eval $compile_ok && $run ./try > glibc.ver; then
6378 gnulibc_version=`$cat glibc.ver`
6379 echo "You are using the GNU C Library version $gnulibc_version"
6383 echo "You are not using the GNU C Library"
6389 : see if nm is to be used to determine whether a symbol is defined or not
6393 case "$d_gnulibc" in
6396 echo "nm probably won't work on the GNU C Library." >&4
6402 if $test "$osname" = aix -a "X$PASE" != "Xdefine" -a ! -f /lib/syscalls.exp; then
6404 echo "Whoops! This is an AIX system without /lib/syscalls.exp!" >&4
6405 echo "'nm' won't be sufficient on this system." >&4
6411 '') dflt=`$egrep 'inlibc|csym' $rsrc/Configure | wc -l 2>/dev/null`
6412 if $test $dflt -gt 20; then
6422 true|$define) dflt=y;;
6429 I can use $nm to extract the symbols from your C libraries. This
6430 is a time consuming task which may generate huge output on the disk (up
6431 to 3 megabytes) but that should make the symbols extraction faster. The
6432 alternative is to skip the 'nm' extraction part and to compile a small
6433 test program instead to determine whether each symbol is present. If
6434 you have a fast C compiler and/or if your 'nm' output cannot be parsed,
6435 this may be the best solution.
6437 You probably shouldn't let me use 'nm' if you are using the GNU C Library.
6440 rp="Shall I use $nm to extract C symbols from the libraries?"
6443 [Nn]*) usenm=false;;
6452 : nm options which may be necessary
6454 '') if $test -f /mach_boot; then
6456 elif $test -d /usr/ccs/lib; then
6457 nm_opt='-p' # Solaris (and SunOS?)
6458 elif $test -f /dgux; then
6460 elif $test -f /lib64/rld; then
6461 nm_opt='-p' # 64-bit Irix
6467 : nm options which may be necessary for shared libraries but illegal
6468 : for archive libraries. Thank you, Linux.
6469 case "$nm_so_opt" in
6470 '') case "$myuname" in
6472 if $nm --help | $grep 'dynamic' > /dev/null 2>&1; then
6473 nm_so_opt='--dynamic'
6480 : Figure out where the libc is located
6483 : get list of predefined functions in a handy place
6488 *-lc_s*) libc=`./loc libc_s$_a $libc $libpth`
6494 *) for thislib in $libs; do
6497 : Handle C library specially below.
6500 thislib=`echo $thislib | $sed -e 's/^-l//'`
6501 if try=`./loc lib$thislib.$so.'*' X $libpth`; $test -f "$try"; then
6503 elif try=`./loc lib$thislib.$so X $libpth`; $test -f "$try"; then
6505 elif try=`./loc lib$thislib$_a X $libpth`; $test -f "$try"; then
6507 elif try=`./loc $thislib$_a X $libpth`; $test -f "$try"; then
6509 elif try=`./loc lib$thislib X $libpth`; $test -f "$try"; then
6511 elif try=`./loc $thislib X $libpth`; $test -f "$try"; then
6513 elif try=`./loc Slib$thislib$_a X $xlibpth`; $test -f "$try"; then
6518 libnames="$libnames $try"
6520 *) libnames="$libnames $thislib" ;;
6529 for xxx in $libpth; do
6530 $test -r $1 || set $xxx/libc.$so
6531 : The messy sed command sorts on library version numbers.
6533 set `echo blurfl; echo $xxx/libc.$so.[0-9]* | \
6534 tr ' ' $trnl | egrep -v '\.[A-Za-z]*$' | $sed -e '
6536 s/[0-9][0-9]*/0000&/g
6537 s/0*\([0-9][0-9][0-9][0-9][0-9]\)/\1/g
6540 $sort | $sed -e 's/^.* //'`
6543 $test -r $1 || set $sysroot/usr/ccs/lib/libc.$so
6544 $test -r $1 || set $sysroot/lib/libsys_s$_a
6550 if $test -r "$1"; then
6551 echo "Your (shared) C library seems to be in $1."
6553 elif $test -r /lib/libc && $test -r /lib/clib; then
6554 echo "Your C library seems to be in both /lib/clib and /lib/libc."
6556 libc='/lib/clib /lib/libc'
6557 if $test -r /lib/syslib; then
6558 echo "(Your math library is in /lib/syslib.)"
6559 libc="$libc /lib/syslib"
6561 elif $test -r "$libc" || (test -h "$libc") >/dev/null 2>&1; then
6562 echo "Your C library seems to be in $libc, as you said before."
6563 elif $test -r $incpath/usr/lib/libc$_a; then
6564 libc=$incpath/usr/lib/libc$_a;
6565 echo "Your C library seems to be in $libc. That's fine."
6566 elif $test -r /lib/libc$_a; then
6568 echo "Your C library seems to be in $libc. You're normal."
6570 if tans=`./loc libc$_a blurfl/dyick $libpth`; $test -r "$tans"; then
6572 elif tans=`./loc libc blurfl/dyick $libpth`; $test -r "$tans"; then
6573 libnames="$libnames "`./loc clib blurfl/dyick $libpth`
6574 elif tans=`./loc clib blurfl/dyick $libpth`; $test -r "$tans"; then
6576 elif tans=`./loc Slibc$_a blurfl/dyick $xlibpth`; $test -r "$tans"; then
6578 elif tans=`./loc Mlibc$_a blurfl/dyick $xlibpth`; $test -r "$tans"; then
6581 tans=`./loc Llibc$_a blurfl/dyick $xlibpth`
6583 if $test -r "$tans"; then
6584 echo "Your C library seems to be in $tans, of all places."
6590 if $test $xxx = apollo -o -r "$libc" || (test -h "$libc") >/dev/null 2>&1; then
6594 If the guess above is wrong (which it might be if you're using a strange
6595 compiler, or your machine supports multiple models), you can override it here.
6600 echo $libpth | $tr ' ' $trnl | $sort | $uniq > libpath
6602 I can't seem to find your C library. I've looked in the following places:
6605 $sed 's/^/ /' libpath
6608 None of these seems to contain your C library. I need to get its name...
6613 rp='Where is your C library?'
6618 echo $libc $libnames | $tr ' ' $trnl | $sort | $uniq > libnames
6619 set X `cat libnames`
6622 case $# in 1) xxx=file; esac
6623 echo "Extracting names from the following $xxx for later perusal:" >&4
6625 $sed 's/^/ /' libnames >&4
6627 $echo $n "This may take a while...$c" >&4
6631 *$so*) $nm $nm_so_opt $nm_opt $file 2>/dev/null;;
6632 *) $nm $nm_opt $file 2>/dev/null;;
6637 $grep fprintf libc.tmp > libc.ptf
6638 xscan='eval "<libc.ptf $com >libc.list"; $echo $n ".$c" >&4'
6639 xrun='eval "<libc.tmp $com >libc.list"; echo "done." >&4'
6641 if com="$sed -n -e 's/__IO//' -e 's/^.* $xxx *//p'";\
6643 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6645 elif com="$sed -n -e 's/^__*//' -e 's/^\([a-zA-Z_0-9$]*\).*xtern.*/\1/p'";\
6647 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6649 elif com="$sed -n -e '/|UNDEF/d' -e '/FUNC..GL/s/^.*|__*//p'";\
6651 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6653 elif com="$sed -n -e 's/^.* D __*//p' -e 's/^.* D //p'";\
6655 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6657 elif com="$sed -n -e 's/^_//' -e 's/^\([a-zA-Z_0-9]*\).*xtern.*text.*/\1/p'";\
6659 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6661 elif com="$sed -n -e 's/^.*|FUNC |GLOB .*|//p'";\
6663 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6665 elif com="$grep '|' | $sed -n -e '/|COMMON/d' -e '/|DATA/d' \
6666 -e '/ file/d' -e 's/^\([^ ]*\).*/\1/p'";\
6668 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6670 elif com="$sed -n -e 's/^.*|FUNC |GLOB .*|//p' -e 's/^.*|FUNC |WEAK .*|//p'";\
6672 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6674 elif com="$sed -n -e 's/^__//' -e '/|Undef/d' -e '/|Proc/s/ .*//p'";\
6676 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6678 elif com="$sed -n -e 's/^.*|Proc .*|Text *| *//p'";\
6680 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6682 elif com="$sed -n -e '/Def. Text/s/.* \([^ ]*\)\$/\1/p'";\
6684 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6686 elif com="$sed -n -e 's/^[-0-9a-f ]*_\(.*\)=.*/\1/p'";\
6688 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6690 elif com="$sed -n -e 's/.*\.text n\ \ \ \.//p'";\
6692 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6694 elif com="sed -n -e 's/^__.*//' -e 's/[ ]*D[ ]*[0-9]*.*//p'";\
6696 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6699 $nm -p $* 2>/dev/null >libc.tmp
6700 $grep fprintf libc.tmp > libc.ptf
6701 if com="$sed -n -e 's/^.* [ADTSIW] *_[_.]*//p' -e 's/^.* [ADTSIW] //p'";\
6702 eval $xscan; $contains '^fprintf$' libc.list >/dev/null 2>&1
6708 echo "$nm didn't seem to work right. Trying $ar instead..." >&4
6710 if $ar t $libc > libc.tmp && \
6711 $contains '^fprintf$' libc.tmp >/dev/null 2>&1
6713 for thisname in $libnames $libc; do
6714 $ar t $thisname >>libc.tmp
6716 $sed -e "s/\\$_o\$//" < libc.tmp > libc.list
6718 elif test "X$osname" = "Xos2" && $ar tv $libc > libc.tmp; then
6719 for thisname in $libnames $libc; do
6720 $ar tv $thisname >>libc.tmp
6721 emximp -o tmp.imp $thisname \
6723 $sed -e 's/^\([_a-zA-Z0-9]*\) .*$/\1/p' \
6724 < tmp.imp >>libc.tmp
6727 $sed -e "s/\\$_o\$//" -e 's/^ \+//' < libc.tmp > libc.list
6730 echo "$ar didn't seem to work right." >&4
6731 echo "Maybe this is a Cray...trying bld instead..." >&4
6733 $sed -e 's/.*\///' -e "s/\\$_o:.*\$//" > libc.list &&
6736 for thisname in $libnames; do
6738 $sed -e 's/.*\///' -e "s/\\$_o:.*\$//" >>libc.list
6739 $ar t $thisname >>libc.tmp
6743 echo "That didn't work either. Giving up." >&4
6753 echo "Since you are compiling for PASE, extracting more symbols from libc.a ...">&4
6754 dump -Tv /lib/libc.a | awk '$7 == "/unix" {print $5 " " $8}' | grep "^SV" | awk '{print $2}' >> libc.list
6756 *) if $test -f /lib/syscalls.exp; then
6758 echo "Also extracting names from /lib/syscalls.exp for good ole AIX..." >&4
6759 $sed -n 's/^\([^ ]*\)[ ]*syscall[0-9]*[ ]*$/\1/p' \
6760 /lib/syscalls.exp >>libc.list
6766 $rm -f libnames libpath
6768 : Check if we are using C++
6770 echo "Checking for C++..." >&4
6771 $cat >try.c <<'EOCP'
6783 if eval $compile_ok && $run ./try; then
6785 echo "You are using a C++ compiler."
6788 echo "You are not using a C++ compiler."
6794 : is a C symbol defined?
6797 -v) tf=libc.tmp; tdc="";;
6798 -a) tf=libc.tmp; tdc="[]";;
6799 *) tlook="^$1\$"; tf=libc.list; tdc="()";;
6801 case "$d_cplusplus" in
6802 $define) extern_C="extern \"C\"" ;;
6803 *) extern_C="extern" ;;
6806 case "$reuseval-$4" in
6808 true-*) tx=no; eval "tval=\$$4"; case "$tval" in "") tx=yes;; esac;;
6813 if $test "$runnm" = true; then
6814 if $contains $tlook $tf >/dev/null 2>&1; then
6816 elif $test "$mistrustnm" = compile -o "$mistrustnm" = run; then
6817 echo "$extern_C void *$1$tdc; void *(*(p()))$tdc { return &$1; } int main(int argc, char **argv) { if(p() && p() != (void *)argv[0]) return(0); else return(1); }"> try.c;
6818 $cc -o try $optimize $ccflags $ldflags try.c >/dev/null 2>&1 $libs && tval=true;
6819 $test "$mistrustnm" = run -a -x try && { $run ./try$_exe >/dev/null 2>&1 || tval=false; };
6823 echo "$extern_C void *$1$tdc; void *(*(p()))$tdc { return &$1; } int main(int argc, char **argv) { if(p() && p() != (void *)argv[0]) return(0); else return(1); }"> try.c;
6824 $cc -o try $optimize $ccflags $ldflags try.c $libs >/dev/null 2>&1 && tval=true;
6830 $define) tval=true;;
6837 : define an is-in-libc? function
6838 inlibc='echo " "; td=$define; tu=$undef;
6839 sym=$1; var=$2; eval "was=\$$2";
6841 case "$reuseval$was" in
6851 echo "$sym() found." >&4;
6852 case "$was" in $undef) . ./whoa; esac; eval "$var=\$td";;
6854 echo "$sym() NOT found." >&4;
6855 case "$was" in $define) . ./whoa; esac; eval "$var=\$tu";;
6859 $define) echo "$sym() found." >&4;;
6860 *) echo "$sym() NOT found." >&4;;
6864 : check for length of double
6866 case "$doublesize" in
6868 echo "Checking to see how big your double precision numbers are..." >&4
6877 printf("%d\n", (int)sizeof(double));
6882 if eval $compile_ok; then
6883 doublesize=`$run ./try`
6884 echo "Your double is $doublesize bytes long."
6887 echo "(I can't seem to compile the test program. Guessing...)"
6888 rp="What is the size of a double precision number (in bytes)?"
6896 : see if this is a float.h system
6900 : check for long doubles
6902 echo "Checking to see if you have long double..." >&4
6903 echo 'int main() { long double x = 7.0; }' > try.c
6905 if eval $compile; then
6907 echo "You have long double."
6910 echo "You do not have long double."
6916 : see if ldexpl exists
6920 : check for length of long double
6921 case "${d_longdbl}${longdblsize}" in
6924 echo "Checking to see how big your long doubles are..." >&4
6925 $cat >try.c <<'EOCP'
6929 printf("%d\n", sizeof(long double));
6934 if eval $compile; then
6935 longdblsize=`$run ./try`
6936 echo "Your long doubles are $longdblsize bytes long."
6940 echo "(I can't seem to compile the test program. Guessing...)" >&4
6941 rp="What is the size of a long double (in bytes)?"
6945 if $test "X$doublesize" = "X$longdblsize"; then
6946 echo "That isn't any different from an ordinary double."
6947 echo "I'll keep your setting anyway, but you may see some"
6948 echo "harmless compilation warnings."
6954 $echo "Checking the kind of long doubles you have..." >&4
6955 case "$d_longdbl" in
6960 #define LONGDBLSIZE $longdblsize
6961 #define DOUBLESIZE $doublesize
6969 static const long double d = -0.1L;
6971 unsigned const char* b = (unsigned const char*)(&d);
6972 #if DOUBLESIZE == LONGDBLSIZE
6973 printf("0\n"); /* if it floats like double */
6976 #if (LDBL_MANT_DIG == 113 || FLT128_MANT_DIG == 113) && LONGDBLSIZE == 16
6977 if (b[0] == 0x9A && b[1] == 0x99 && b[15] == 0xBF) {
6978 /* IEEE 754 128-bit little-endian */
6982 if (b[0] == 0xBF && b[14] == 0x99 && b[15] == 0x9A) {
6983 /* IEEE 128-bit big-endian, e.g. solaris sparc */
6988 /* For alignment 32-bit platforms have the 80 bits in 12 bytes,
6989 * while 64-bits platforms have it in 16 bytes. The trailing bytes
6990 * cannot be trusted. */
6991 #if LDBL_MANT_DIG == 64 && (LONGDBLSIZE == 16 || LONGDBLSIZE == 12)
6992 if (b[0] == 0xCD && b[9] == 0xBF) {
6993 /* x86 80-bit little-endian, sizeof 12 (ILP32, Solaris x86)
6994 * or 16 (LP64, Linux and OS X), 4 or 6 bytes of padding.
6995 * Also known as "extended precision". */
6999 if (b[0] == 0xBF && b[9] == 0xCD) {
7000 /* Is there ever big-endian 80-bit, really?
7002 * The Motorola 68881 had another "extended precision" format:
7003 * sign:1 exp:15 zero:16 integer:1 mantissa:63
7004 * for total of 96 bits of bytes. The zero bits were unused.
7005 * See "M68000 FAMILY PROGRAMMER’S REFERENCE MANUAL" for more details.
7006 * If it ever becomes relevant, this format should be allocated
7007 * a new doublekind code since it's quite different from the Intel x87.
7013 #if (LDBL_MANT_DIG == 106 || LDBL_MANT_DIG == 107) && LONGDBLSIZE == 16
7014 /* software "double double", the 106 is 53+53.
7015 * but irix thinks it is 107. */
7016 if (b[0] == 0x9A && b[7] == 0x3C && b[8] == 0x9A && b[15] == 0xBF) {
7017 /* double double 128-bit fully little-endian,
7018 * little-endian doubles in little-endian order,
7019 * 9a 99 99 99 99 99 59 3c 9a 99 99 99 99 99 b9 bf */
7023 if (b[0] == 0xBF && b[7] == 0x9A && b[8] == 0x3C && b[15] == 0x9A) {
7024 /* double double 128-bit fully big-endian,
7025 * big-endian doubles in big-endian order,
7026 * e.g. PPC/Power and MIPS:
7027 * bf b9 99 99 99 99 99 9a 3c 59 99 99 99 99 99 9a */
7031 if (b[0] == 0x9A && b[7] == 0xBF && b[8] == 0x9A && b[15] == 0x3C) {
7032 /* double double 128-bit mixed endian.
7033 * little-endian doubles in big-endian order,
7035 * 9a 99 99 99 99 99 b9 bf 9a 99 99 99 99 99 59 3c */
7039 if (b[0] == 0x3C && b[7] == 0x9A && b[8] == 0xBF && b[15] == 0x9A) {
7040 /* double double 128-bit mixed endian,
7041 * big-endian doubles in little-endian order,
7042 * 3c 59 99 99 99 99 99 9a bf b9 99 99 99 99 99 9a */
7047 printf("-1\n"); /* unknown */
7052 if eval $compile; then
7053 longdblkind=`$run ./try`
7060 case "$longdblkind" in
7061 0) echo "Your long doubles are doubles." >&4 ;;
7062 1) echo "You have IEEE 754 128-bit little endian long doubles." >&4 ;;
7063 2) echo "You have IEEE 754 128-bit big endian long doubles." >&4 ;;
7064 3) echo "You have x86 80-bit little endian long doubles." >& 4 ;;
7065 4) echo "You have x86 80-bit big endian long doubles." >& 4 ;;
7066 5) echo "You have 128-bit fully little-endian double-double long doubles (64-bit LEs in LE)." >& 4 ;;
7067 6) echo "You have 128-bit fully big-endian double-double long doubles (64-bit BEs in BE)." >& 4 ;;
7068 7) echo "You have 128-bit mixed double-double long doubles (64-bit LEs in BE)." >& 4 ;;
7069 8) echo "You have 128-bit mixed double-double long doubles (64-bit BEs in LE)." >& 4 ;;
7070 *) echo "Cannot figure out your long double." >&4 ;;
7074 : determine the architecture name
7076 if xxx=`./loc arch blurfl $pth`; $test -f "$xxx"; then
7077 tarch=`arch`"-$osname"
7078 elif xxx=`./loc uname blurfl $pth`; $test -f "$xxx" ; then
7079 if uname -m > tmparch 2>&1 ; then
7080 tarch=`$sed -e 's/ *$//' -e 's/ /_/g' \
7081 -e 's/$/'"-$osname/" tmparch`
7089 case "$myarchname" in
7092 echo "(Your architecture name used to be $myarchname.)"
7096 case "$targetarch" in
7098 *) archname=`echo $targetarch|sed 's,^[^-]*-,,'` ;;
7103 *) dflt="$archname";;
7105 rp='What is your architecture name'
7109 : optionally add API version to the architecture for versioned archlibs
7110 case "$useversionedarchname" in
7111 $define|true|[yY]*) dflt='y';;
7114 rp='Add the Perl API version to your archname?'
7117 y|Y) useversionedarchname="$define" ;;
7118 *) useversionedarchname="$undef" ;;
7120 case "$useversionedarchname" in
7123 *-$api_versionstring)
7124 echo "...and architecture name already has -$api_versionstring" >&4
7127 archname="$archname-$api_versionstring"
7128 echo "...setting architecture name to $archname." >&4
7134 case "$usethreads" in
7136 echo "Threads selected." >&4
7138 *-thread*) echo "...and architecture name already has -thread." >&4
7140 *) archname="$archname-thread"
7141 echo "...setting architecture name to $archname." >&4
7146 case "$usemultiplicity" in
7148 echo "Multiplicity selected." >&4
7150 *-multi*) echo "...and architecture name already has -multi." >&4
7152 *) archname="$archname-multi"
7153 echo "...setting architecture name to $archname." >&4
7158 case "$use64bitint$use64bitall" in
7160 case "$archname64" in
7162 echo "This architecture is naturally 64-bit, not changing architecture name." >&4
7165 case "$use64bitint" in
7166 "$define") echo "64 bit integers selected." >&4 ;;
7168 case "$use64bitall" in
7169 "$define") echo "Maximal 64 bitness selected." >&4 ;;
7172 *-$archname64*) echo "...and architecture name already has $archname64." >&4
7174 *) archname="$archname-$archname64"
7175 echo "...setting architecture name to $archname." >&4
7181 case "$uselongdouble" in
7183 echo "Long doubles selected." >&4
7184 case "$longdblsize" in
7186 echo "...but long doubles are equal to doubles, not changing architecture name." >&4
7190 *-ld*) echo "...and architecture name already has -ld." >&4
7192 *) archname="$archname-ld"
7193 echo "...setting architecture name to $archname." >&4
7200 case "$usequadmath" in
7202 echo "quadmath selected." >&4
7204 *-quadmath*) echo "...and architecture name already has -quadmath." >&4
7206 *) archname="$archname-quadmath"
7207 echo "...setting architecture name to $archname." >&4
7212 if $test -f archname.cbu; then
7213 echo "Your platform has some specific hints for architecture name, using them..."
7217 : set the prefixit variable, to compute a suitable default value
7218 prefixit='case "$3" in
7220 case "$oldprefix" in
7221 "") eval "$1=\"\$$2\"";;
7228 ""|" ") eval "$1=\"\$$2\"";;
7234 eval "tp=\"$oldprefix-\$$2-\""; eval "tp=\"$tp\"";
7236 --|/*--|\~*--) eval "$1=\"$prefix/$3\"";;
7237 /*-$oldprefix/*|\~*-$oldprefix/*)
7238 eval "$1=\`echo \$$2 | sed \"s,^$oldprefix,$prefix,\"\`";;
7239 *) eval "$1=\"\$$2\"";;
7243 : determine installation style
7244 : For now, try to deduce it from prefix unless it is already set.
7245 : Reproduce behavior of 5.005 and earlier, maybe drop that in 5.7.
7246 case "$installstyle" in
7247 '') case "$prefix" in
7248 *perl*) dflt='lib';;
7249 *) dflt='lib/perl5' ;;
7252 *) dflt="$installstyle" ;;
7254 : Probably not worth prompting for this since we prompt for all
7255 : the directories individually, and the prompt would be too long and
7259 : determine where public executables go
7264 rp='Pathname where the public executables will reside?'
7266 if $test "X$ansexp" != "X$binexp"; then
7270 : XXX Bug? -- ignores Configure -Dinstallprefix setting.
7271 : XXX If this is fixed, also fix the "start perl" hunk below, which relies on
7272 : this via initialinstalllocation
7275 case "$userelocatableinc" in
7276 $define|true|[yY]*) dflt='y' ;;
7281 Would you like to build Perl so that the installation is relocatable, so that
7282 library paths in @INC are determined relative to the path of the perl binary?
7283 This is not advised for system Perl installs, or if you need to run setid
7284 scripts or scripts under taint mode.
7286 If this doesn't make any sense to you, just accept the default '$dflt'.
7288 rp='Use relocatable @INC?'
7291 y|Y) val="$define" ;;
7294 set userelocatableinc
7297 initialinstalllocation="$binexp"
7298 : Default prefix is now "up one level from where the binaries are"
7299 case "$userelocatableinc" in
7305 installprefixexp=".../.."
7309 : determine where private library files go
7310 : Usual default is /usr/local/lib/perl5/$version.
7311 : Also allow things like /opt/perl/lib/$version, since
7312 : /opt/perl/lib/perl5... would be redundant.
7313 : The default "style" setting is made in installstyle.U
7314 case "$installstyle" in
7315 *lib/perl5*) set dflt privlib lib/$package/$version ;;
7316 *) set dflt privlib lib/$version ;;
7321 There are some auxiliary files for $package that need to be put into a
7322 private library directory that is accessible by everyone.
7327 rp='Pathname where the private library files will reside?'
7332 : set the prefixup variable, to restore leading tilda escape
7333 prefixup='case "$prefixexp" in
7335 *) eval "$1=\`echo \$$1 | sed \"s,^$prefixexp,$prefix,\"\`";;
7338 : determine where public architecture dependent libraries go
7341 : privlib default is /usr/local/lib/$package/$version
7342 : archlib default is /usr/local/lib/$package/$version/$archname
7343 : privlib may have an optional trailing /share.
7344 tdflt=`echo $privlib | $sed 's,/share$,,'`
7345 tdflt=$tdflt/$archname
7354 $spackage contains architecture-dependent library files. If you are
7355 sharing libraries in a heterogeneous environment, you might store
7356 these files in a separate location. Otherwise, you can just include
7357 them with the rest of the public library files.
7362 rp='Where do you want to put the public architecture-dependent libraries?'
7366 if $test X"$archlib" = X"$privlib"; then
7372 : see if setuid scripts can be secure
7375 Some kernels have a bug that prevents setuid #! scripts from being
7376 secure. Some sites have disabled setuid #! scripts because of this.
7378 First let's decide if your kernel supports secure setuid #! scripts.
7379 (If setuid #! scripts would be secure but have been disabled anyway,
7380 don't say that they are secure if asked.)
7385 if $test -d /dev/fd; then
7386 echo "#!$ls" >reflect
7387 chmod +x,u+s reflect
7388 ./reflect >flect 2>&1
7389 if $contains "/dev/fd" flect >/dev/null; then
7390 echo "Congratulations, your kernel has secure setuid scripts!" >&4
7394 If you are not sure if they are secure, I can check but I'll need a
7395 username and password different from the one you are using right now.
7396 If you don't have such a username or don't want me to test, simply
7400 rp='Other username to test security of setuid scripts with?'
7405 case "$d_suidsafe" in
7406 '') echo "I'll assume setuid scripts are *not* secure." >&4
7409 echo "Well, the $hint value is *not* secure." >&4
7411 *) echo "Well, the $hint value *is* secure." >&4
7416 $rm -f reflect flect
7417 echo "#!$ls" >reflect
7418 chmod +x,u+s reflect
7421 echo '"su" will (probably) prompt you for '"$ans's password."
7422 su $ans -c './reflect >flect'
7423 if $contains "/dev/fd" flect >/dev/null; then
7424 echo "Okay, it looks like setuid scripts are secure." >&4
7427 echo "I don't think setuid scripts are secure." >&4
7432 rp='Does your kernel have *secure* setuid scripts?'
7435 [yY]*) val="$define";;
7440 echo "I don't think setuid scripts are secure (no /dev/fd directory)." >&4
7441 echo "(That's for file descriptors, not floppy disks.)"
7447 $rm -f reflect flect
7449 : now see if they want to do setuid emulation
7450 if $test $patchlevel -lt 11; then
7453 case "$d_suidsafe" in
7456 echo "No need to emulate SUID scripts since they are secure here." >&4
7460 Some systems have disabled setuid scripts, especially systems where
7461 setuid scripts cannot be secure. On systems where setuid scripts have
7462 been disabled, the setuid/setgid bits on scripts are currently
7463 useless. It is possible for $package to detect those bits and emulate
7464 setuid/setgid in a secure fashion. This emulation will only work if
7465 setuid scripts have been disabled in your kernel.
7469 "$define") dflt=y ;;
7472 rp="Do you want to do setuid/setgid emulation?"
7475 [yY]*) val="$define";;
7487 SUID emulation has been removed for 5.12
7488 Please re-run Configure without -Dd_dosuid
7497 : Find perl5.005 or later.
7498 echo "Looking for a previously installed perl5.005 or later... "
7500 '') for tdir in `echo "$binexp$path_sep$PATH" | $sed "s/$path_sep/ /g"`; do
7501 : Check if this perl is recent and can load a simple module
7502 if $test -x $tdir/perl$exe_ext && $tdir/perl -Mless -e 'use 5.005;' >/dev/null 2>&1; then
7505 elif $test -x $tdir/perl5$exe_ext && $tdir/perl5 -Mless -e 'use 5.005;' >/dev/null 2>&1; then
7515 '') echo "None found. That's ok.";;
7516 *) echo "Using $perl5." ;;
7519 : Set the siteprefix variables
7522 After $package is installed, you may wish to install various
7523 add-on modules and utilities. Typically, these add-ons will
7524 be installed under $prefix with the rest
7525 of this package. However, you may wish to install such add-ons
7526 elsewhere under a different prefix.
7528 If you do not wish to put everything under a single prefix, that's
7529 ok. You will be prompted for the individual locations; this siteprefix
7530 is only used to suggest the defaults.
7532 The default should be fine for most people.
7536 rp='Installation prefix to use for add-on modules and utilities?'
7537 : XXX Here might be another good place for an installstyle setting.
7538 case "$siteprefix" in
7540 *) dflt=$siteprefix ;;
7543 : XXX Prefixit unit does not yet support siteprefix and vendorprefix
7545 case "$siteprefix" in
7549 *) oldsiteprefix="$prefix";;
7554 siteprefixexp="$ansexp"
7556 : determine where site specific libraries go.
7557 : Usual default is /usr/local/lib/perl5/site_perl/$version
7558 : The default "style" setting is made in installstyle.U
7559 : XXX No longer works with Prefixit stuff.
7560 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
7562 '') case "$installstyle" in
7563 *lib/perl5*) dflt=$siteprefix/lib/$package/site_$prog/$version ;;
7564 *) dflt=$siteprefix/lib/site_$prog/$version ;;
7572 The installation process will create a directory for
7573 site-specific extensions and modules. Most users find it convenient
7574 to place all site-specific files in this directory rather than in the
7575 main distribution directory.
7579 rp='Pathname for the site-specific library files?'
7583 sitelib_stem=`echo "$sitelibexp" | sed "s,/$version$,,"`
7585 : Determine list of previous versions to include in @INC
7586 $cat > getverlist <<EOPL
7589 \$api_versionstring = "$api_versionstring";
7590 \$version = "$version";
7591 \$stem = "$sitelib_stem";
7592 \$archname = "$archname";
7594 $cat >> getverlist <<'EOPL'
7595 # The list found is store twice for each entry: the original name, and
7596 # the binary broken down version as pack "sss", so sorting is easy and
7597 # unambiguous. This will work for all versions that have a maximum of
7598 # three digit groups, separate by '.'s or '_'s. Names are extended with
7599 # ".0.0" to ensure at least three elements for the pack.
7600 # -- H.Merijn Brand (m)'06 23-10-2006
7602 # Can't have leading @ because metaconfig interprets it as a command!
7603 ;@inc_version_list=();
7604 # XXX Redo to do opendir/readdir?
7607 ;@candidates = map {
7608 [ $_, pack "sss", split m/[._]/, "$_.0.0" ] } glob("5.*");
7609 ;@candidates = sort { $a->[1] cmp $b->[1]} @candidates;
7615 ($pversion, $aversion, $vsn5005) = map {
7616 pack "sss", split m/[._]/, "$_.0.0" } $version, $api_versionstring, "5.005";
7617 foreach $d (@candidates) {
7618 if ($d->[1] lt $pversion) {
7619 if ($d->[1] ge $aversion) {
7620 unshift(@inc_version_list, grep { -d } $d->[0]."/$archname", $d->[0]);
7622 elsif ($d->[1] ge $vsn5005) {
7623 unshift(@inc_version_list, grep { -d } $d->[0]);
7627 # Skip newer version. I.e. don't look in
7628 # 5.7.0 if we're installing 5.6.1.
7632 if (@inc_version_list) {
7633 print join(' ', @inc_version_list);
7636 # Blank space to preserve value for next Configure run.
7641 case "$inc_version_list" in
7642 '') if test -x "$perl5$exe_ext"; then
7643 dflt=`$perl5 getverlist`
7648 $undef) dflt='none' ;;
7649 *) eval dflt=\"$inc_version_list\" ;;
7652 ''|' ') dflt=none ;;
7659 In order to ease the process of upgrading, this version of perl
7660 can be configured to use modules built and installed with earlier
7661 versions of perl that were installed under $prefix. Specify here
7662 the list of earlier versions that this version of perl should check.
7663 If Configure detected no earlier versions of perl installed under
7664 $prefix, then the list will be empty. Answer 'none' to tell perl
7665 to not search earlier versions.
7667 The default should almost always be sensible, so if you're not sure,
7668 just accept the default.
7671 rp='List of earlier versions to include in @INC?'
7674 [Nn]one|''|' '|$undef) inc_version_list=' ' ;;
7675 *) inc_version_list="$ans" ;;
7677 case "$inc_version_list" in
7679 inc_version_list_init='0'
7680 d_inc_version_list="$undef"
7682 *) inc_version_list_init=`echo $inc_version_list |
7683 $sed -e 's/^/"/' -e 's/ /","/g' -e 's/$/",0/'`
7684 d_inc_version_list="$define"
7689 : see if malloc/malloc.h has to be included
7690 set malloc/malloc.h i_mallocmalloc
7693 : see if this is a malloc.h system
7694 : we want a real compile instead of Inhdr because some systems have a
7695 : malloc.h that just gives a compile error saying to use stdlib.h instead
7700 #$i_mallocmalloc I_MALLOCMALLOC
7701 #ifdef I_MALLOCMALLOC
7702 # include <malloc/malloc.h>
7705 int main () { return 0; }
7708 if eval $compile; then
7709 echo "<malloc.h> found." >&4
7712 echo "<malloc.h> NOT found." >&4
7719 : check for length of pointer
7723 echo "Checking to see how big your pointers are..." >&4
7732 printf("%d\n", (int)sizeof(void *));
7737 if eval $compile_ok; then
7738 ptrsize=`$run ./try`
7739 echo "Your pointers are $ptrsize bytes long."
7742 echo "(I can't seem to compile the test program. Guessing...)" >&4
7743 rp="What is the size of a pointer (in bytes)?"
7750 case "$use64bitall" in
7751 "$define"|true|[yY]*)
7755 *** You have chosen a maximally 64-bit build,
7756 *** but your pointers are only 4 bytes wide.
7757 *** Please rerun Configure without -Duse64bitall.
7762 *** Since you have quads, you could possibly try with -Duse64bitint.
7767 *** Cannot continue, aborting.
7778 : determine whether to use malloc wrapping
7780 case "$usemallocwrap" in
7781 [yY]*|true|$define) dflt='y' ;;
7782 [nN]*|false|$undef) dflt='n' ;;
7783 *) case "$usedevel" in
7784 [yY]*|true|$define) dflt='y' ;;
7789 rp="Do you wish to wrap malloc calls to protect against potential overflows?"
7791 usemallocwrap="$ans"
7794 usemallocwrap="$define" ;;
7796 usemallocwrap="$undef" ;;
7799 : determine which malloc to compile in
7801 case "$usemymalloc" in
7802 [yY]*|true|$define) dflt='y' ;;
7803 [nN]*|false|$undef) dflt='n' ;;
7804 *) case "$ptrsize" in
7808 if test "$useithreads" = "$define"; then dflt='n'; fi
7811 rp="Do you wish to attempt to use the malloc that comes with $package?"
7817 mallocsrc='malloc.c'
7818 mallocobj="malloc$_o"
7819 d_mymalloc="$define"
7822 : Remove malloc from list of libraries to use
7823 echo "Removing unneeded -lmalloc from library list" >&4
7824 set `echo X $libs | $sed -e 's/-lmalloc / /' -e 's/-lmalloc$//'`
7827 echo "libs = $libs" >&4
7839 : compute the return types of malloc and free
7841 $cat >malloc.c <<END
7845 #include <sys/types.h>
7859 case "$malloctype" in
7861 if $cc $ccflags -c -DTRY_MALLOC malloc.c >/dev/null 2>&1; then
7868 echo "Your system wants malloc to return '$malloctype', it would seem." >&4
7872 if $cc $ccflags -c -DTRY_FREE malloc.c >/dev/null 2>&1; then
7879 echo "Your system uses $freetype free(), it would seem." >&4
7881 : determine where site specific architecture-dependent libraries go.
7882 : sitelib default is /usr/local/lib/perl5/site_perl/$version
7883 : sitearch default is /usr/local/lib/perl5/site_perl/$version/$archname
7884 : sitelib may have an optional trailing /share.
7886 '') dflt=`echo $sitelib | $sed 's,/share$,,'`
7887 dflt="$dflt/$archname"
7892 set sitearch sitearch none
7896 The installation process will also create a directory for
7897 architecture-dependent site-specific extensions and modules.
7901 rp='Pathname for the site-specific architecture-dependent library files?'
7905 if $test X"$sitearch" = X"$sitelib"; then
7908 d_sitearch="$define"
7911 : Set the vendorprefix variables
7914 The installation process will also create a directory for
7915 vendor-supplied add-ons. Vendors who supply perl with their system
7916 may find it convenient to place all vendor-supplied files in this
7917 directory rather than in the main distribution directory. This will
7918 ease upgrades between binary-compatible maintenance versions of perl.
7920 Of course you may also use these directories in whatever way you see
7921 fit. For example, you might use them to access modules shared over a
7922 company-wide network.
7924 The default answer should be fine for most people.
7925 This causes further questions about vendor add-ons to be skipped
7926 and no vendor-specific directories will be configured for perl.
7929 rp='Do you want to configure vendor-specific add-on directories?'
7930 case "$usevendorprefix" in
7931 define|true|[yY]*) dflt=y ;;
7932 *) : User may have set vendorprefix directly on Configure command line.
7933 case "$vendorprefix" in
7942 rp='Installation prefix to use for vendor-supplied add-ons?'
7943 case "$vendorprefix" in
7944 '') dflt="$prefix" ;;
7945 *) dflt=$vendorprefix ;;
7948 : XXX Prefixit unit does not yet support siteprefix and vendorprefix
7950 case "$vendorprefix" in
7954 *) oldvendorprefix="$prefix";;
7958 usevendorprefix="$define"
7960 vendorprefixexp="$ansexp"
7962 *) usevendorprefix="$undef"
7968 : Set the vendorlib variables
7969 case "$vendorprefix" in
7970 '') d_vendorlib="$undef"
7974 *) d_vendorlib="$define"
7975 : determine where vendor-supplied modules go.
7976 : Usual default is /usr/local/lib/perl5/vendor_perl/$version
7977 case "$vendorlib" in
7979 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
7980 case "$installstyle" in
7981 *lib/perl5*) dflt=$vendorprefix/lib/$package/vendor_$prog/$version ;;
7982 *) dflt=$vendorprefix/lib/vendor_$prog/$version ;;
7985 *) dflt="$vendorlib"
7989 rp='Pathname for the vendor-supplied library files?'
7992 vendorlibexp="$ansexp"
7995 vendorlib_stem=`echo "$vendorlibexp" | sed "s,/$version$,,"`
7999 : Set the vendorarch variables
8000 case "$vendorprefix" in
8001 '') d_vendorarch="$undef"
8005 *) d_vendorarch="$define"
8006 : determine where vendor-supplied architecture-dependent libraries go.
8007 : vendorlib default is /usr/local/lib/perl5/vendor_perl/$version
8008 : vendorarch default is /usr/local/lib/perl5/vendor_perl/$version/$archname
8009 : vendorlib may have an optional trailing /share.
8010 case "$vendorarch" in
8011 '') dflt=`echo $vendorlib | $sed 's,/share$,,'`
8012 dflt="$dflt/$archname"
8014 *) dflt="$vendorarch" ;;
8017 rp='Pathname for vendor-supplied architecture-dependent files?'
8020 vendorarchexp="$ansexp"
8023 prefixvar=vendorarch
8025 if $test X"$vendorarch" = X"$vendorlib"; then
8026 d_vendorarch="$undef"
8028 d_vendorarch="$define"
8031 : Final catch-all directories to search
8034 Lastly, you can have perl look in other directories for extensions and
8035 modules in addition to those already specified.
8036 These directories will be searched after
8040 test X"$vendorlib" != "X" && echo ' ' $vendorlib
8041 test X"$vendorarch" != "X" && echo ' ' $vendorarch
8043 case "$otherlibdirs" in
8044 ''|' ') dflt='none' ;;
8045 *) dflt="$otherlibdirs" ;;
8048 Enter a colon-separated set of extra paths to include in perl's @INC
8049 search path, or enter 'none' for no extra paths.
8053 rp='Colon-separated list of additional directories for perl to search?'
8056 ' '|''|none) otherlibdirs=' ' ;;
8057 *) otherlibdirs="$ans" ;;
8059 case "$otherlibdirs" in
8063 set d_perl_otherlibdirs
8066 : Cruising for prototypes
8068 echo "Checking out function prototypes..." >&4
8069 $cat >prototype.c <<EOCP
8074 int main(int argc, char *argv[]) {
8077 if $cc $ccflags -c prototype.c >prototype.out 2>&1 ; then
8078 echo "Your C compiler appears to support function prototypes."
8081 echo "Your C compiler doesn't seem to understand function prototypes."
8088 : Check if ansi2knr is required
8089 case "$prototype" in
8091 *) ansi2knr='ansi2knr'
8096 This version of $package can only be compiled by a compiler that
8097 understands function prototypes. Unfortunately, your C compiler
8099 doesn't seem to understand them. Sorry about that.
8101 If GNU cc is available for your system, perhaps you could try that instead.
8103 Eventually, we hope to support building Perl with pre-ANSI compilers.
8104 If you would like to help in that effort, please contact <perlbug@perl.org>.
8106 Aborting Configure now.
8113 dflt_dtrace='/usr/sbin/dtrace'
8114 $test -x /usr/bin/dtrace && dflt_dtrace='/usr/bin/dtrace'
8118 Perl can be built to support DTrace on platforms that support it.
8119 DTrace is a diagnosis and performance analysis tool from Sun.
8121 If this doesn't make any sense to you, just accept the default.
8125 case "$usedtrace" in
8131 dflt_dtrace=$usedtrace
8138 rp='Support DTrace if available?'
8141 y|Y) val="$define" ;;
8147 test "X$usedtrace" != "X$define" && break
8150 rp='Where is the dtrace executable?'
8159 if $dtrace -h -s ../perldtrace.d \
8160 -o perldtrace.tmp >/dev/null 2>&1 \
8161 && rm -f perldtrace.tmp
8164 echo "Good: your $dtrace knows about the -h flag."
8168 *** $me: Fatal Error: $dtrace doesn't support -h flag
8170 *** Your installed dtrace doesn't support the -h switch to compile a D
8171 *** program into a C header. Can't continue.
8183 *** $me: Fatal Error: $dtrace not found.
8190 echo "*** $dtrace was not found."
8196 : See if we want extra modules installed
8203 Perl can be built with extra modules or bundles of modules which
8204 will be fetched from the CPAN and installed alongside Perl.
8206 Notice that you will need access to the CPAN; either via the Internet,
8207 or a local copy, for example a CD-ROM or a local CPAN mirror. (You will
8208 be asked later to configure the CPAN.pm module which will in turn do
8209 the installation of the rest of the extra modules or bundles.)
8211 Notice also that if the modules require any external software such as
8212 libraries and headers (the libz library and the zlib.h header for the
8213 Compress::Zlib module, for example) you MUST have any such software
8214 already installed, this configuration process will NOT install such
8217 If this doesn't make any sense to you, just accept the default '$dflt'.
8219 rp='Install any extra modules (y or n)?'
8225 Please list any extra modules or bundles to be installed from CPAN,
8226 with spaces between the names. The names can be in any format the
8227 'install' command of CPAN.pm will understand. (Answer 'none',
8228 without the quotes, to install no extra modules or bundles.)
8238 $rm -f ../extras.lst
8240 *) echo "(Saving the list of extras for later...)"
8241 echo "$extras" > ../extras.lst
8249 : determine where html pages for programs go
8250 set html1dir html1dir none
8254 If you wish to install html files for programs in $spackage, indicate
8255 the appropriate directory here. To skip installing html files,
8259 ''|none|$undef|' ') dflt=none ;;
8260 *) dflt=$html1dir ;;
8263 rp="Directory for the main $spackage html pages?"
8267 : Use ' ' for none so value is preserved next time through Configure
8268 $test X"$html1dir" = "X" && html1dir=' '
8270 : determine where html pages for libraries and modules go
8271 set html3dir html3dir none
8275 If you wish to install html files for modules associated with $spackage,
8276 indicate the appropriate directory here. To skip installing html files,
8279 : There is no obvious default. If they have specified html1dir, then
8280 : try to key off that, possibly changing .../html1 into .../html3.
8282 '') html3dir=`echo "$html1dir" | $sed 's/1$/3$/'` ;;
8283 *) dflt=$html3dir ;;
8286 rp="Directory for the $spackage module html pages?"
8290 : Use ' ' for none so value is preserved next time through Configure
8291 $test X"$html3dir" = "X" && html3dir=' '
8293 : determine whether to install perl also as /usr/bin/perl
8296 if $test -d /usr/bin -a "X$installbin" != X/usr/bin; then
8298 Many scripts expect perl to be installed as /usr/bin/perl.
8300 If you want to, I can install the perl you are about to compile
8301 as /usr/bin/perl (in addition to $bin/perl).
8303 if test -f /usr/bin/perl; then
8306 However, please note that because you already have a /usr/bin/perl,
8307 overwriting that with a new Perl would very probably cause problems.
8308 Therefore I'm assuming you don't want to do that (unless you insist).
8311 case "$installusrbinperl" in
8312 "$define"|[yY]*) dflt='y';;
8318 Since you don't have a /usr/bin/perl I'm assuming creating one is okay.
8321 case "$installusrbinperl" in
8322 "$undef"|[nN]*) dflt='n';;
8326 rp="Do you want to install perl as /usr/bin/perl?"
8329 [yY]*) val="$define";;
8335 set installusrbinperl
8338 : see if dlopen exists
8340 xxx_ccflags="$ccflags"
8342 : with g++ one needs -shared to get is-in-libc to work for dlopen
8343 case "$gccversion" in
8346 *) case "$d_cplusplus" in
8347 "$define") ccflags="$ccflags -shared" ;;
8354 ccflags="$xxx_ccflags"
8356 : see if this is a unistd.h system
8357 set unistd.h i_unistd
8360 : determine which dynamic loading, if any, to compile in
8362 dldir="ext/DynaLoader"
8375 $define) dflt='y' ;;
8377 : Does a dl_xxx.xs file exist for this operating system
8378 $test -f $rsrc/$dldir/dl_${osname}.xs && dflt='y'
8381 rp="Do you wish to use dynamic loading?"
8388 '') if $test -f $rsrc/$dldir/dl_${osname}.xs ; then
8389 dflt="$dldir/dl_${osname}.xs"
8390 elif $test "$d_dlopen" = "$define" ; then
8391 dflt="$dldir/dl_dlopen.xs"
8396 *) dflt="$dldir/$dlsrc"
8399 echo "The following dynamic loading files are available:"
8400 : Can not go over to $dldir because getfile has path hard-coded in.
8401 tdir=`pwd`; cd "$rsrc"; $ls -C $dldir/dl*.xs; cd "$tdir"
8402 rp="Source file to use for dynamic loading"
8408 dlsrc=`echo $ans | $sed -e 's%.*/\([^/]*\)$%\1%'`
8412 Some systems may require passing special flags to $cc -c to
8413 compile modules that will be used to create a shared library.
8414 To use no flags, say "none".
8417 case "$cccdlflags" in
8418 '') case "$gccversion" in
8419 '') case "$osname" in
8421 irix*) dflt='-KPIC' ;;
8422 svr4*|esix*|solaris|nonstopux) dflt='-KPIC' ;;
8423 sunos) dflt='-pic' ;;
8427 *) case "$osname" in
8428 darwin) dflt='none' ;;
8429 *linux*|svr4*|esix*|solaris|nonstopux) dflt='-fPIC' ;;
8434 *) dflt="$cccdlflags" ;;
8441 # If -Dsysroot was specified, now's the time to add it
8443 if test "X$sysroot" != X; then
8444 case "$gccversion" in
8449 dflt="$dflt --sysroot=$sysroot" ;;
8459 rp="Any special flags to pass to $cc -c to compile shared library modules?"
8462 none) cccdlflags=' ' ;;
8463 *) cccdlflags="$ans" ;;
8468 Some systems use ld to create libraries that can be dynamically loaded,
8469 while other systems (such as those using ELF) use $cc.
8473 : Determine if this is ELF
8475 /* Test for whether ELF binaries are produced */
8487 int i = open("a.out",O_RDONLY);
8490 if(read(i,b,4)==4 && b[0]==127 && b[1]=='E' && b[2]=='L' && b[3]=='F')
8491 exit(0); /* succeed (yes, it is ELF) */
8495 if $cc $ccflags $ldflags -o a.out try.c >/dev/null 2>&1 && $run ./a.out; then
8501 '') if $test $bin_ELF = "$define"; then
8503 You appear to have ELF support. I'll use $cc to build dynamic libraries.
8507 echo "I'll use ld to build dynamic libraries."
8515 rp="What command should be used to create dynamic libraries?"
8521 Some systems may require passing special flags to $ld to create a
8522 library that can be dynamically loaded. If your ld flags include
8523 -L/other/path options to locate libraries outside your loader's normal
8524 search path, you may need to specify those -L options here as well. To
8525 use no flags, say "none".
8528 case "$lddlflags" in
8529 '') case "$osname" in
8530 haiku) dflt='-shared' ;;
8532 case "$gccversion" in
8533 '') dflt="$dflt +vnocompatwarnings" ;;
8536 *linux*|irix*|gnu*) dflt="-shared $optimize" ;;
8537 solaris) # See [perl #66604].
8538 # On Solaris 11, gcc -m64 on amd64
8539 # appears not to understand -G. gcc versions at
8540 # least as old as 3.4.3 support -shared, so just
8541 # use that with Solaris 11 and later, but keep
8542 # the old behavior for older Solaris versions.
8543 case "$gccversion" in
8545 *) case "$osvers" in
8546 2.?|2.10) dflt='-G' ;;
8547 *) dflt='-shared' ;;
8552 sunos) dflt='-assert nodefinitions' ;;
8553 svr4*|esix*|nonstopux) dflt="-G $ldflags" ;;
8557 *) dflt="$lddlflags" ;;
8560 : Only do this for gcc, since, for example, qcc has no concept
8562 if $test "X$sysroot" != X; then
8563 case "$gccversion" in
8565 *) dflt="$dflt --sysroot $sysroot" ;;
8569 : Try to guess additional flags to pick up local libraries.
8570 : Be careful not to append to a plain 'none'
8574 for thisflag in $ldflags; do
8579 *) dflt="$dflt $thisflag" ;;
8586 ''|' ') dflt='none' ;;
8590 *-fstack-protector-strong*)
8592 *-fstack-protector-strong*) ;; # Don't add it again
8593 *) dflt="$dflt -fstack-protector-strong" ;;
8596 *-fstack-protector*)
8598 *-fstack-protector*) ;; # Don't add it again
8599 *) dflt="$dflt -fstack-protector" ;;
8604 rp="Any special flags to pass to $ld to create a dynamically loaded library?"
8607 none) lddlflags=' ' ;;
8608 *) lddlflags="$ans" ;;
8613 Some systems may require passing special flags to $cc to indicate that
8614 the resulting executable will use dynamic linking. To use no flags,
8618 case "$ccdlflags" in
8619 '') case "$osname" in
8620 *linux*|hpux|gnu*) dflt='-Wl,-E' ;;
8621 sunos) dflt='none' ;;
8625 *) dflt="$ccdlflags" ;;
8627 rp="Any special flags to pass to $cc to use dynamic linking?"
8630 none) ccdlflags=' ' ;;
8631 *) ccdlflags="$ans" ;;
8643 ld_can_script="$undef"
8644 case "$bin_ELF$usedl" in
8646 # Abuse try.h and a.out names for neat cleanup
8658 if $cc $cccdlflags $ccdlflags $ccflags \
8659 $ldflags $lddlflags -o a.out try.c \
8660 -Wl,--version-script=try.h >/dev/null 2>&1 \
8661 && $test -s a.out ; then
8662 echo "ld supports scripting" >&4
8663 ld_can_script="$define"
8665 echo "ld does not support scripting" >&4
8671 : Do we want a shared libperl?
8675 # No dynamic loading being used, so don't bother even to prompt.
8678 *) case "$useshrplib" in
8679 '') case "$osname" in
8680 svr4*|nonstopux|dgux|dynixptx|esix|powerux|haiku|cygwin*)
8682 also='Building a shared libperl is required for dynamic loading to work on your system.'
8696 The perl executable is normally obtained by linking perlmain.c with
8697 libperl${_a}, any static extensions (usually just DynaLoader), and
8698 any other libraries needed on this system (such as -lm, etc.). Since
8699 your system supports dynamic loading, it is probably possible to build
8700 a shared libperl.$so. If you will have more than one executable linked
8701 to libperl.$so, this will significantly reduce the size of each
8702 executable, but it may have a noticeable effect on performance. The
8703 default is probably sensible for your system.
8707 rp="Build a shared libperl.$so (y/n)"
8711 useshrplib='true' ;;
8712 *) useshrplib='false' ;;
8717 case "$useshrplib" in
8719 case "$userelocatableinc" in
8721 echo "Cannot build with both -Duserelocatableinc and -Duseshrplib" >&4
8722 echo "See INSTALL for an explanation why that won't work." >&4
8728 # Figure out a good name for libperl.so. Since it gets stored in
8729 # a version-specific architecture-dependent library, the version
8730 # number isn't really that important, except for making cc/ld happy.
8732 # A name such as libperl.so.10.1
8733 majmin="libperl.$so.$patchlevel.$subversion"
8734 # A name such as libperl.so.100
8735 majonly=`echo $patchlevel $subversion |
8736 $awk '{printf "%d%02d", $1, $2}'`
8737 majonly=libperl.$so.$majonly
8738 # I'd prefer to keep the os-specific stuff here to a minimum, and
8739 # rely on figuring it out from the naming of libc.
8740 case "${osname}${osvers}" in
8741 *linux*|gnu*) # ld won't link with a bare -lperl otherwise.
8744 cygwin*) # ld links now against the dll directly
8745 majmin="cygperl5_${patchlevel}_${subversion}.${so}"
8746 majonly=`echo $patchlevel $subversion |
8747 $awk '{printf "%03d%03d", $1, $2}'`
8748 majonly=cygperl5.$majonly.$so
8751 *) # Try to guess based on whether libc has major.minor.
8753 *libc.$so.[0-9]*.[0-9]*) dflt=$majmin ;;
8754 *libc.$so.[0-9]*) dflt=$majonly ;;
8755 *) dflt=libperl.$so ;;
8765 I need to select a good name for the shared libperl. If your system uses
8766 library names with major and minor numbers, then you might want something
8767 like $majmin. Alternatively, if your system uses a single version
8768 number for shared libraries, then you might want to use $majonly.
8769 Or, your system might be quite happy with a simple libperl.$so.
8771 Since the shared libperl will get installed into a version-specific
8772 architecture-dependent directory, the version number of the shared perl
8773 library probably isn't important, so the default should be o.k.
8776 rp='What name do you want to give to the shared libperl?'
8779 echo "Ok, I'll use $libperl"
8782 libperl="libperl${_a}"
8786 # Detect old use of shrpdir via undocumented Configure -Dshrpdir
8790 WARNING: Use of the shrpdir variable for the installation location of
8791 the shared $libperl is not supported. It was never documented and
8792 will not work in this version. Let me (perlbug@perl.org)
8793 know of any problems this may cause.
8799 But your current setting of $shrpdir is
8800 the default anyway, so it's harmless.
8805 Further, your current attempted setting of $shrpdir
8806 conflicts with the value of $archlibexp/CORE
8807 that installperl will use.
8814 # How will the perl executable find the installed shared $libperl?
8815 # Add $xxx to ccdlflags.
8816 # If we can't figure out a command-line option, use $shrpenv to
8817 # set env LD_RUN_PATH. The main perl makefile uses this.
8818 shrpdir=$archlibexp/CORE
8821 if "$useshrplib"; then
8824 # We'll set it in Makefile.SH...
8829 freebsd|mirbsd|netbsd|openbsd|interix|dragonfly|bitrig)
8830 xxx="-Wl,-R$shrpdir"
8832 bsdos|linux|irix*|dec_osf|gnu*|haiku)
8833 xxx="-Wl,-rpath,$shrpdir"
8836 # hpux doesn't like the default, either.
8837 tmp_shrpenv="env LDOPTS=\"+s +b${shrpdir}\""
8840 # cygwin needs only ldlibpth
8843 tmp_shrpenv="env LD_RUN_PATH=$shrpdir"
8849 # Only add $xxx if it isn't already in ccdlflags.
8850 case " $ccdlflags " in
8852 *) ccdlflags="$ccdlflags $xxx"
8855 Adding $xxx to the flags
8856 passed to $ld so that the perl executable will find the
8857 installed shared $libperl.
8865 # Fix ccdlflags in AIX for building external extensions.
8866 # (For building Perl itself bare -bE:perl.exp is needed,
8867 # Makefile.SH takes care of this.)
8869 aix) ccdlflags="$ccdlflags -bE:$installarchlib/CORE/perl.exp" ;;
8871 # Respect a hint or command-line value.
8873 '') shrpenv="$tmp_shrpenv" ;;
8875 case "$ldlibpthname" in
8876 '') ldlibpthname=LD_LIBRARY_PATH ;;
8877 none) ldlibpthname='' ;;
8880 : determine where manual pages are on this system
8884 syspath='/usr/share/man/man1 /usr/man/man1'
8885 syspath="$syspath /usr/man/mann /usr/man/manl /usr/man/local/man1"
8886 syspath="$syspath /usr/man/u_man/man1"
8887 syspath="$syspath /usr/catman/u_man/man1 /usr/man/l_man/man1"
8888 syspath="$syspath /usr/local/man/u_man/man1 /usr/local/man/l_man/man1"
8889 syspath="$syspath /usr/man/man.L /local/man/man1 /usr/local/man/man1"
8890 sysman=`./loc . /usr/man/man1 $syspath`
8893 if $test -d "$sysman"; then
8894 echo "System manual is in $sysman." >&4
8896 echo "Could not find manual pages in source form." >&4
8899 : determine where manual pages go
8900 set man1dir man1dir none
8904 $spackage has manual pages available in source form.
8908 echo "However, you don't have nroff, so they're probably useless to you."
8910 '') man1dir="none";;
8913 echo "If you don't want the manual sources installed, answer 'none'."
8918 lookpath="$prefixexp/share/man/man1"
8919 lookpath="$lookpath $prefixexp/man/man1 $prefixexp/man/l_man/man1"
8920 lookpath="$lookpath $prefixexp/man/p_man/man1"
8921 lookpath="$lookpath $prefixexp/man/u_man/man1"
8922 lookpath="$lookpath $prefixexp/man/man.1"
8924 */?_man*) dflt=`./loc . $prefixexp/l_man/man1 $lookpath` ;;
8925 *) dflt=`./loc . $prefixexp/man/man1 $lookpath` ;;
8935 rp="Where do the main $spackage manual pages (source) go?"
8937 if $test "X$man1direxp" != "X$ansexp"; then
8948 : What suffix to use on installed man pages
8955 rp="What suffix should be used for the main $spackage man pages?"
8957 '') case "$man1dir" in
8971 *) dflt="$man1ext";;
8978 : see if we can have long filenames
8980 first=123456789abcdef
8982 if (echo hi >$first) 2>/dev/null; then
8983 if $test -f 123456789abcde; then
8984 echo 'You cannot have filenames longer than 14 characters. Sigh.' >&4
8987 echo 'You can have filenames longer than 14 characters.'>&4
8992 You can't have filenames longer than 14 chars.
8993 You can't even think about them!
8999 $rm -rf 123456789abcde*
9001 : determine where library module manual pages go
9002 set man3dir man3dir none
9006 $spackage has manual pages for many of the library modules.
9012 However, you don't have nroff, so they're probably useless to you.
9015 '') man3dir="none";;
9019 case "$d_flexfnam" in
9022 However, your system can't handle the long file names like File::Basename.3.
9025 '') man3dir="none";;
9029 echo "If you don't want the manual sources installed, answer 'none'."
9030 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
9032 '') dflt=`echo "$man1dir" | $sed -e 's/man1/man3/g' -e 's/man\.1/man\.3/g'`
9033 if $test -d "$privlib/man/man3"; then
9036 WARNING: Previous versions of perl installed man3 pages into
9037 $privlib/man/man3. This version will suggest a
9038 new default of $dflt.
9042 rp='Do you wish to preserve the old behavior?(y/n)'
9045 y*) dflt="$privlib/man/man3" ;;
9050 *) dflt="$man3dir" ;;
9057 rp="Where do the $package library man pages (source) go?"
9067 : What suffix to use on installed man pages
9073 rp="What suffix should be used for the $package library man pages?"
9075 '') case "$man3dir" in
9089 *) dflt="$man3ext";;
9096 : see if we have to deal with yellow pages, now NIS.
9097 if $test -d /usr/etc/yp || $test -d /etc/yp || $test -d /usr/lib/yp; then
9103 '') if $contains '^\+' /etc/passwd >/dev/null 2>&1; then
9111 rp='Are you getting the hosts file via yellow pages?'
9114 y*) hostcat='ypcat hosts';;
9115 *) hostcat='cat /etc/hosts';;
9121 '') test -f /etc/hosts && hostcat='cat /etc/hosts';;
9124 '') test -f /etc/group && groupcat='cat /etc/group';;
9127 '') test -f /etc/passwd && passcat='cat /etc/passwd';;
9130 : now get the host name
9132 echo "Figuring out host name..." >&4
9133 case "$myhostname" in
9135 echo 'Maybe "hostname" will work...'
9136 if tans=`sh -c hostname 2>&1` ; then
9144 if $test "$cont"; then
9146 echo 'Oh, dear. Maybe "/etc/systemid" is the key...'
9147 if tans=`cat /etc/systemid 2>&1` ; then
9149 phostname='cat /etc/systemid'
9150 echo "Whadyaknow. Xenix always was a bit strange..."
9153 elif $test -r /etc/systemid; then
9154 echo "(What is a non-Xenix system doing with /etc/systemid?)"
9157 if $test "$cont"; then
9158 echo 'No, maybe "uuname -l" will work...'
9159 if tans=`sh -c 'uuname -l' 2>&1` ; then
9161 phostname='uuname -l'
9163 echo 'Strange. Maybe "uname -n" will work...'
9164 if tans=`sh -c 'uname -n' 2>&1` ; then
9166 phostname='uname -n'
9168 echo 'Oh well, maybe I can mine it out of whoami.h...'
9169 if tans=`sh -c $contains' sysname $usrinc/whoami.h' 2>&1` ; then
9170 myhostname=`echo "$tans" | $sed 's/^.*"\(.*\)"/\1/'`
9171 phostname="sed -n -e '"'/sysname/s/^.*\"\\(.*\\)\"/\1/{'"' -e p -e q -e '}' <$usrinc/whoami.h"
9173 case "$myhostname" in
9174 '') echo "Does this machine have an identity crisis or something?"
9177 echo "Well, you said $myhostname before..."
9178 phostname='echo $myhostname';;
9184 case "$myhostname" in
9185 '') myhostname=noname ;;
9187 : you do not want to know about this
9192 if $test "$myhostname" ; then
9194 rp='Your host name appears to be "'$myhostname'".'" Right?"
9202 : bad guess or no guess
9203 while $test "X$myhostname" = X ; do
9205 rp="Please type the (one word) name of your host:"
9210 : translate upper to lower if necessary
9211 case "$myhostname" in
9213 echo "(Normalizing case in your host name)"
9214 myhostname=`echo $myhostname | ./tr '[A-Z]' '[a-z]'`
9218 case "$myhostname" in
9220 dflt=`expr "X$myhostname" : "X[^.]*\(\..*\)"`
9221 myhostname=`expr "X$myhostname" : "X\([^.]*\)\."`
9222 echo "(Trimming domain name from host name--host name is now $myhostname)"
9224 *) case "$mydomain" in
9227 test "X$hostcat" = "Xypcat hosts" &&
9228 ypmatch "$myhostname" hosts 2>/dev/null |\
9229 $sed -e 's/[ ]*#.*//; s/$/ /' > hosts && \
9232 test "X$hostcat" != "X" &&
9233 $hostcat | $sed -n -e "s/[ ]*#.*//; s/\$/ /
9234 /[ ]$myhostname[ . ]/p" > hosts
9237 if $test -f hosts; then
9238 $test x`$awk "/[0-9].*[ ]$myhostname$tmp_re/ { sum++ }
9239 END { print sum }" hosts` = x1 || tmp_re="[ ]"
9240 dflt=.`$awk "/[0-9].*[ ]$myhostname$tmp_re/ {for(i=2; i<=NF;i++) print \\\$i}" \
9241 hosts | $sort | $uniq | \
9242 $sed -n -e "s/$myhostname\.\([-a-zA-Z0-9_.]\)/\1/p"`
9243 case `$echo X$dflt` in
9244 X*\ *) echo "(Several hosts in the database matched hostname)"
9247 X.) echo "(You do not have fully-qualified names in the hosts database)"
9251 echo "(I cannot locate a hosts database anywhere)"
9256 tans=`./loc resolv.conf X /etc /usr/etc`
9257 if $test -f "$tans"; then
9258 echo "(Attempting domain name extraction from $tans)"
9259 dflt=.`$sed -n -e 's/ / /g' \
9260 -e 's/^search *\([^ ]*\).*/\1/p' $tans \
9263 .) dflt=.`$sed -n -e 's/ / /g' \
9264 -e 's/^domain *\([^ ]*\).*/\1/p' $tans \
9272 .) echo "(No help from resolv.conf either -- attempting clever guess)"
9273 dflt=.`sh -c domainname 2>/dev/null`
9276 .nis.*|.yp.*|.main.*) dflt=`echo $dflt | $sed -e 's/^\.[^.]*//'`;;
9280 case "$dflt$osname" in
9281 .os390) echo "(Attempting domain name extraction from //'SYS1.TCPPARMS(TCPDATA)')"
9282 dflt=.`awk '/^DOMAINORIGIN/ {print $2}' "//'SYS1.TCPPARMS(TCPDATA)'" 2>/dev/null`
9286 .) echo "(Lost all hope -- silly guess then)"
9292 *) dflt="$mydomain";;
9296 rp="What is your domain name?"
9306 : translate upper to lower if necessary
9309 echo "(Normalizing case in your domain name)"
9310 mydomain=`echo $mydomain | ./tr '[A-Z]' '[a-z]'`
9314 : a little sanity check here
9315 case "$phostname" in
9318 case `$phostname | ./tr '[A-Z]' '[a-z]'` in
9319 $myhostname$mydomain|$myhostname) ;;
9321 case "$phostname" in
9323 echo "(That doesn't agree with your whoami.h file, by the way.)"
9326 echo "(That doesn't agree with your $phostname command, by the way.)"
9334 : determine the e-mail address of the user who is running us
9337 I need to get your e-mail address in Internet format if possible, i.e.
9338 something like user@host.domain. Please answer accurately since I have
9339 no easy means to double check it. The default value provided below
9340 is most probably close to reality but may not be valid from outside
9341 your organization...
9345 while test "$cont"; do
9346 case "$MAILDOMAIN" in
9348 if $test -s /etc/mailname; then
9349 maildomain=`$cat /etc/mailname`
9351 maildomain="$myhostname$mydomain"
9354 *) maildomain="$MAILDOMAIN";;
9357 '') dflt="$cf_by@$maildomain";;
9358 *) dflt="$cf_email";;
9360 rp='What is your e-mail address?'
9366 rp='Address does not look like an Internet one. Use it anyway?'
9380 : Ask e-mail of administrator
9383 If you or somebody else will be maintaining perl at your site, please
9384 fill in the correct e-mail address here so that they may be contacted
9385 if necessary. Currently, the "perlbug" program included with perl
9386 will send mail to this address in addition to perlbug@perl.org. You may
9387 enter "none" for no administrator.
9390 case "$perladmin" in
9391 '') dflt="$cf_email";;
9392 *) dflt="$perladmin";;
9394 rp='Perl administrator e-mail address'
9398 : determine whether to only install version-specific parts.
9401 Do you want to install only the version-specific parts of the perl
9402 distribution? Usually you do *not* want to do this.
9404 case "$versiononly" in
9405 "$define"|[Yy]*|true) dflt='y' ;;
9408 rp="Do you want to install only the version-specific parts of perl?"
9411 [yY]*) val="$define";;
9417 case "$versiononly" in
9418 "$define") inc_version_list=''
9419 inc_version_list_init=0
9423 : figure out how to guarantee perl startup
9424 : XXX Note that this currently takes advantage of the bug that binexp ignores
9425 : the Configure -Dinstallprefix setting, which in turn means that under
9426 : relocatable @INC, initialinstalllocation is what binexp started as.
9427 case "$startperl" in
9429 case "$sharpbang" in
9433 I can use the #! construct to start perl on your system. This will
9434 make startup of perl scripts faster, but may cause problems if you
9435 want to share those scripts and perl is not in a standard place
9436 ($initialinstalllocation/perl) on all your platforms. The alternative
9437 is to force a shell by starting the script with a single ':' character.
9440 case "$versiononly" in
9441 "$define") dflt="$initialinstalllocation/perl$version";;
9442 *) dflt="$initialinstalllocation/perl";;
9444 rp='What shall I put after the #! to start up perl ("none" to not use #!)?'
9447 none) startperl=": # use perl";;
9448 *) startperl="#!$ans"
9449 if $test 30 -lt `echo "$ans" | wc -c`; then
9452 WARNING: Some systems limit the #! command to 32 characters.
9453 If you experience difficulty running Perl scripts with #!, try
9454 installing Perl in a directory with a shorter pathname.
9460 *) startperl=": # use perl"
9465 echo "I'll use $startperl to start perl scripts."
9467 : figure best path for perl in scripts
9470 case "$versiononly" in
9471 "$define") perlpath="$initialinstalllocation/perl$version";;
9472 *) perlpath="$initialinstalllocation/perl";;
9474 case "$startperl" in
9479 I will use the "eval 'exec'" idiom to start Perl on your system.
9480 I can use the full path of your Perl binary for this purpose, but
9481 doing so may cause problems if you want to share those scripts and
9482 Perl is not always in a standard place ($initialinstalllocation/perl).
9485 dflt="$initialinstalllocation/perl"
9486 rp="What path shall I use in \"eval 'exec'\"?"
9493 case "$startperl" in
9495 *) echo "I'll use $perlpath in \"eval 'exec'\"" ;;
9498 : determine where public executable scripts go
9499 set scriptdir scriptdir
9501 case "$scriptdir" in
9504 : guess some guesses
9505 $test -d /usr/share/scripts && dflt=/usr/share/scripts
9506 $test -d /usr/share/bin && dflt=/usr/share/bin
9507 $test -d /usr/local/script && dflt=/usr/local/script
9508 $test -d /usr/local/scripts && dflt=/usr/local/scripts
9509 $test -d $prefixexp/script && dflt=$prefixexp/script
9513 *) dflt="$scriptdir"
9518 Some installations have a separate directory just for executable scripts so
9519 that they can mount it across multiple architectures but keep the scripts in
9520 one spot. You might, for example, have a subdirectory of /usr/share for this.
9521 Or you might just lump your scripts in with all your other executables.
9525 rp='Where do you keep publicly executable scripts?'
9527 if $test "X$ansexp" != "X$scriptdirexp"; then
9533 : A little fix up for an irregularly named variable.
9534 installscript="$installscriptdir"
9536 : determine where add-on public executables go
9538 '') dflt=$siteprefix/bin ;;
9542 rp='Pathname where the add-on public executables should be installed?'
9547 : determine where add-on html pages go
9548 : There is no standard location, so try to copy the previously-selected
9549 : directory structure for the core html pages.
9550 case "$sitehtml1dir" in
9551 '') dflt=`echo "$html1dir" | $sed "s#^$prefix#$siteprefix#"` ;;
9552 *) dflt=$sitehtml1dir ;;
9555 ''|' ') dflt=none ;;
9558 rp='Pathname where the site-specific html pages should be installed?'
9560 prefixvar=sitehtml1dir
9563 : determine where add-on library html pages go
9564 : There is no standard location, so try to copy the previously-selected
9565 : directory structure for the core html pages.
9566 case "$sitehtml3dir" in
9567 '') dflt=`echo "$html3dir" | $sed "s#^$prefix#$siteprefix#"` ;;
9568 *) dflt=$sitehtml3dir ;;
9571 ''|' ') dflt=none ;;
9574 rp='Pathname where the site-specific library html pages should be installed?'
9576 prefixvar=sitehtml3dir
9579 : determine where add-on manual pages go
9580 case "$siteman1dir" in
9581 '') dflt=`echo $man1dir | $sed "s#^$prefix#$siteprefix#"` ;;
9582 *) dflt=$siteman1dir ;;
9585 ''|' ') dflt=none ;;
9588 rp='Pathname where the site-specific manual pages should be installed?'
9590 prefixvar=siteman1dir
9593 : determine where add-on library man pages go
9594 case "$siteman3dir" in
9595 '') dflt=`echo $man3dir | $sed "s#^$prefix#$siteprefix#"` ;;
9596 *) dflt=$siteman3dir ;;
9599 ''|' ') dflt=none ;;
9602 rp='Pathname where the site-specific library manual pages should be installed?'
9604 prefixvar=siteman3dir
9607 : determine where add-on public executable scripts go
9608 case "$sitescript" in
9609 '') dflt=$siteprefix/script
9610 $test -d $dflt || dflt=$sitebin ;;
9611 *) dflt="$sitescript" ;;
9614 rp='Pathname where add-on public executable scripts should be installed?'
9616 prefixvar=sitescript
9619 : see if backtrace exists
9620 set backtrace d_backtrace
9623 : add flags if using c backtrace
9624 case "$usecbacktrace" in
9625 "") usecbacktrace=$undef ;;
9627 case "$d_backtrace" in
9629 case " $ccflags " in
9630 *" -DUSE_C_BACKTRACE "*) ;; # Already there.
9631 *) ccflags="$ccflags -DUSE_C_BACKTRACE -g" ;;
9635 echo "This system does not support backtrace" >&4
9636 usecbacktrace=$undef
9642 : Check if faststdio is requested and available
9643 case "$usefaststdio" in
9644 $define|true|[yY]*|'')
9645 xversion=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
9655 Perl can be built to use 'fast stdio', which means using the stdio
9656 library but also directly manipulating the stdio buffers to enable
9657 faster I/O. Using stdio is better for backward compatibility (especially
9658 for Perl extensions), but on the other hand since Perl 5.8 the 'perlio'
9659 interface has been preferred instead of stdio.
9661 If this doesn't make any sense to you, just accept the default '$dflt'.
9663 rp='Use the "fast stdio" if available?'
9666 y|Y) val="$define" ;;
9673 : define an is-a-typedef? function
9674 typedef='type=$1; var=$2; def=$3; shift; shift; shift; inclist=$@;
9676 "") inclist="sys/types.h";;
9678 eval "varval=\$$var";
9682 for inc in $inclist; do
9683 echo "#include <$inc>" >>temp.c;
9685 echo "#ifdef $type" >> temp.c;
9686 echo "printf(\"We have $type\");" >> temp.c;
9687 echo "#endif" >> temp.c;
9688 $cppstdin $cppflags $cppminus < temp.c >temp.E 2>/dev/null;
9689 if $contains $type temp.E >/dev/null 2>&1; then
9695 *) eval "$var=\$varval";;
9698 : define an is-a-typedef? function that prompts if the type is not available.
9699 typedef_ask='type=$1; var=$2; def=$3; shift; shift; shift; inclist=$@;
9701 "") inclist="sys/types.h";;
9703 eval "varval=\$$var";
9707 for inc in $inclist; do
9708 echo "#include <$inc>" >>temp.c;
9710 echo "#ifdef $type" >> temp.c;
9711 echo "printf(\"We have $type\");" >> temp.c;
9712 echo "#endif" >> temp.c;
9713 $cppstdin $cppflags $cppminus < temp.c >temp.E 2>/dev/null;
9715 echo "$rp" | $sed -e "s/What is/Looking for/" -e "s/?/./";
9716 if $contains $type temp.E >/dev/null 2>&1; then
9717 echo "$type found." >&4;
9720 echo "$type NOT found." >&4;
9726 *) eval "$var=\$varval";;
9729 : see what type lseek is declared as in the kernel
9730 rp="What is the type used for lseek's offset on this system?"
9731 set off_t lseektype long stdio.h sys/types.h
9735 echo "Checking to see how big your file offsets are..." >&4
9737 #include <sys/types.h>
9741 printf("%d\n", (int)sizeof($lseektype));
9746 if eval $compile_ok; then
9747 lseeksize=`$run ./try`
9748 echo "Your file offsets are $lseeksize bytes long."
9752 echo "(I can't seem to compile the test program. Guessing...)"
9753 rp="What is the size of your file offsets (in bytes)?"
9759 : see what type file positions are declared as in the library
9760 rp="What is the type for file position used by fsetpos()?"
9761 set fpos_t fpostype long stdio.h sys/types.h
9764 : Check size for Fpos_t
9767 *_t) zzz="$fpostype" ;;
9770 echo "Checking the size of $zzz..." >&4
9772 #include <sys/types.h>
9779 printf("%d\n", (int)sizeof($fpostype));
9784 if eval $compile_ok; then
9788 echo "(I can't execute the test program--guessing $fpossize.)" >&4
9791 echo "Your $zzz is $fpossize bytes long."
9797 echo "(I can't compile the test program. Guessing...)" >&4
9798 rp="What is the size of your file positions (in bytes)?"
9803 : Check for large file support
9804 # Backward compatibility (uselfs is deprecated).
9806 "$define"|true|[yY]*)
9809 *** Configure -Duselfs is deprecated, using -Duselargefiles instead.
9811 uselargefiles="$define"
9815 case "$lseeksize:$fpossize" in
9818 You can have files larger than 2 gigabytes.
9821 *) case "$uselargefiles" in
9822 "$undef"|false|[nN]*) dflt='n' ;;
9827 Perl can be built to understand large files (files larger than 2 gigabytes)
9828 on some systems. To do so, Configure can be run with -Duselargefiles.
9830 If this doesn't make any sense to you, just accept the default '$dflt'.
9832 rp='Try to understand large files, if available?'
9835 y|Y) val="$define" ;;
9842 : Look for a hint-file generated 'call-back-unit'. If the
9843 : user has specified that a large files perl is to be built,
9844 : we may need to set or change some other defaults.
9845 if $test -f uselargefiles.cbu; then
9846 echo "Your platform has some specific hints regarding large file builds, using them..."
9847 . ./uselargefiles.cbu
9849 case "$uselargefiles" in
9851 if $test -f uselargefiles.cbu; then
9853 echo "Rechecking to see how big your file offsets are..." >&4
9855 #include <sys/types.h>
9859 printf("%d\n", (int)sizeof($lseektype));
9864 if eval $compile_ok; then
9865 lseeksize=`$run ./try`
9866 $echo "Your file offsets are now $lseeksize bytes long."
9870 echo "(I can't seem to compile the test program. Guessing...)"
9871 rp="What is the size of your file offsets (in bytes)?"
9876 *_t) zzz="$fpostype" ;;
9879 $echo $n "Rechecking the size of $zzz...$c" >&4
9881 #include <sys/types.h>
9888 printf("%d\n", (int)sizeof($fpostype));
9893 if eval $compile_ok; then
9898 echo "(I can't execute the test program--guessing $fpossize.)" >&4
9901 echo " $fpossize bytes." >&4
9907 echo "(I can't compile the test program. Guessing...)" >&4
9908 rp="What is the size of your file positions (in bytes)?"
9917 : Check if we want perlio
9920 : Set the vendorbin variables
9921 case "$vendorprefix" in
9922 '') d_vendorbin="$undef"
9926 *) d_vendorbin="$define"
9927 : determine where vendor-supplied executables go.
9928 case "$vendorbin" in
9929 '') dflt=$vendorprefix/bin ;;
9930 *) dflt="$vendorbin" ;;
9933 rp='Pathname for the vendor-supplied executables directory?'
9936 vendorbinexp="$ansexp"
9942 : Set the vendorhtml1dir variables
9943 case "$vendorprefix" in
9944 '') vendorhtml1dir=''
9945 vendorhtml1direxp=''
9947 *) : determine where vendor-supplied html pages go.
9948 : There is no standard location, so try to copy the previously-selected
9949 : directory structure for the core html pages.
9950 : XXX Better default suggestions would be welcome.
9951 case "$vendorhtml1dir" in
9952 '') dflt=`echo "$html1dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
9953 *) dflt=$vendorhtml1dir ;;
9956 ''|' ') dflt=none ;;
9959 rp='Pathname for the vendor-supplied html pages?'
9961 vendorhtml1dir="$ans"
9962 vendorhtml1direxp="$ansexp"
9965 : Use ' ' for none so value is preserved next time through Configure
9966 $test X"$vendorhtml1dir" = "X" && vendorhtml1dir=' '
9967 prefixvar=vendorhtml1dir
9970 : Set the vendorhtml3dir variables
9971 case "$vendorprefix" in
9972 '') vendorhtml3dir=''
9973 vendorhtml3direxp=''
9975 *) : determine where vendor-supplied module html pages go.
9976 : There is no standard location, so try to copy the previously-selected
9977 : directory structure for the core html pages.
9978 : XXX Better default suggestions would be welcome.
9979 case "$vendorhtml3dir" in
9980 '') dflt=`echo "$html3dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
9981 *) dflt=$vendorhtml3dir ;;
9984 ''|' ') dflt=none ;;
9987 rp='Pathname for the vendor-supplied html pages?'
9989 vendorhtml3dir="$ans"
9990 vendorhtml3direxp="$ansexp"
9993 : Use ' ' for none so value is preserved next time through Configure
9994 $test X"$vendorhtml3dir" = "X" && vendorhtml3dir=' '
9995 prefixvar=vendorhtml3dir
9998 : Set the vendorman1dir variables
9999 case "$vendorprefix" in
10000 '') vendorman1dir=''
10001 vendorman1direxp=''
10003 *) : determine where vendor-supplied manual pages go.
10004 case "$vendorman1dir" in
10005 '') dflt=`echo "$man1dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
10006 *) dflt=$vendorman1dir ;;
10009 ''|' ') dflt=none ;;
10012 rp='Pathname for the vendor-supplied manual section 1 pages?'
10014 vendorman1dir="$ans"
10015 vendorman1direxp="$ansexp"
10018 : Use ' ' for none so value is preserved next time through Configure
10019 $test X"$vendorman1dir" = "X" && vendorman1dir=' '
10020 prefixvar=vendorman1dir
10023 : Set the vendorman3dir variables
10024 case "$vendorprefix" in
10025 '') vendorman3dir=''
10026 vendorman3direxp=''
10028 *) : determine where vendor-supplied module manual pages go.
10029 case "$vendorman3dir" in
10030 '') dflt=`echo "$man3dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
10031 *) dflt=$vendorman3dir ;;
10034 ''|' ') dflt=none ;;
10037 rp='Pathname for the vendor-supplied manual section 3 pages?'
10039 vendorman3dir="$ans"
10040 vendorman3direxp="$ansexp"
10043 : Use ' ' for none so value is preserved next time through Configure
10044 $test X"$vendorman3dir" = "X" && vendorman3dir=' '
10045 prefixvar=vendorman3dir
10048 : Set the vendorscript variables
10049 case "$vendorprefix" in
10050 '') d_vendorscript="$undef"
10054 *) d_vendorscript="$define"
10055 : determine where vendor-supplied scripts go.
10056 case "$vendorscript" in
10057 '') dflt=$vendorprefix/script
10058 $test -d $dflt || dflt=$vendorbin ;;
10059 *) dflt="$vendorscript" ;;
10063 The installation process will create a directory for
10064 vendor-supplied scripts.
10068 rp='Pathname for the vendor-supplied scripts directory?'
10070 vendorscript="$ans"
10071 vendorscriptexp="$ansexp"
10074 prefixvar=vendorscript
10077 : script used to emit important warnings
10080 if test \$# -gt 0; then
10085 echo "*** WARNING:" >&4
10086 sed -e 's/^/*** /' <msg >&4
10088 cat msg >>config.msg
10089 echo " " >>config.msg
10095 : see which of string.h or strings.h is needed
10097 strings=`./findhdr string.h`
10098 if $test "$strings" && $test -r "$strings"; then
10099 echo "Using <string.h> instead of <strings.h>." >&4
10103 strings=`./findhdr strings.h`
10104 if $test "$strings" && $test -r "$strings"; then
10105 echo "Using <strings.h> instead of <string.h>." >&4
10107 ./warn "No string header found -- You'll surely have problems."
10112 case "$i_string" in
10113 "$undef") strings=`./findhdr strings.h`;;
10114 *) strings=`./findhdr string.h`;;
10117 : see if qgcvt exists
10121 : Check what kind of doubles your system has
10122 $echo "Checking the kind of doubles you have..." >&4
10124 #$i_stdlib I_STDLIB
10125 #define DOUBLESIZE $doublesize
10127 #include <stdlib.h>
10130 static const double d = -0.1;
10132 unsigned const char* b = (unsigned const char*)(&d);
10133 #if DOUBLESIZE == 4
10134 if (b[0] == 0xCD && b[3] == 0xBD) {
10135 /* IEEE 754 32-bit little-endian */
10139 if (b[0] == 0xBD && b[3] == 0xCD) {
10140 /* IEEE 754 32-bit big-endian */
10144 if (b[0] == 0xCC && b[3] == 0xCC) {
10150 #if DOUBLESIZE == 8
10151 if (b[0] == 0x9A && b[7] == 0xBF) {
10152 /* IEEE 754 64-bit little-endian */
10156 if (b[0] == 0xBF && b[7] == 0x9A) {
10157 /* IEEE 754 64-bit big-endian */
10161 if (b[0] == 0x99 && b[3] == 0xBF && b[4] == 0x9A && b[7] == 0x99) {
10162 /* ARM mixed endian: two little-endian 32-bit floats, in big endian order:
10163 * 4 5 6 7 0 1 2 3 (MSB = 7, LSB = 0)
10164 * 99 99 b9 bf 9a 99 99 99 */
10168 if (b[0] == 0x99 && b[3] == 0x9A && b[4] == 0xBF && b[7] == 0x99) {
10169 /* The opposite of case 7, mixed endian: two big-endian 32-bit floats,
10170 * in little endian order: 3 2 1 0 7 6 5 4 (MSB = 7, LSB = 0)
10171 * 99 99 99 9a bf b9 99 99 */
10175 if (b[0] == 0xCC && b[7] == 0xCC) {
10176 /* VAX format D, 64-bit little-endian. */
10180 if (b[0] == 0xD9 && b[7] == 0x99) {
10181 /* VAX format G, 64-bit little-endian. */
10186 #if DOUBLESIZE == 16
10187 if (b[0] == 0x9A && b[15] == 0xBF) {
10188 /* IEEE 754 128-bit little-endian */
10192 if (b[0] == 0xBF && b[15] == 0x9A) {
10193 /* IEEE 754 128-bit big-endian */
10198 /* Then there are old mainframe/miniframe formats like IBM and CRAY.
10199 * Whether those environments can still build Perl is debatable. */
10200 printf("-1\n"); /* unknown */
10205 if eval $compile; then
10206 doublekind=`$run ./try`
10210 case "$doublekind" in
10211 1) echo "You have IEEE 754 32-bit little endian doubles." >&4 ;;
10212 2) echo "You have IEEE 754 32-bit big endian doubles." >&4 ;;
10213 3) echo "You have IEEE 754 64-bit little endian doubles." >&4 ;;
10214 4) echo "You have IEEE 754 64-bit big endian doubles." >&4 ;;
10215 5) echo "You have IEEE 754 128-bit little endian doubles." >&4 ;;
10216 6) echo "You have IEEE 754 128-bit big endian doubles." >&4 ;;
10217 7) echo "You have IEEE 754 64-bit mixed endian doubles (32-bit LEs in BE)." >&4 ;;
10218 8) echo "You have IEEE 754 64-bit mixed endian doubles (32-bit BEs in LE)." >&4 ;;
10219 9) echo "You have VAX format F 32-bit little-endian doubles." >&4 ;;
10220 10) echo "You have VAX format D 64-bit little-endian doubles." >&4 ;;
10221 11) echo "You have VAX format G 64-bit little-endian doubles." >&4 ;;
10222 *) echo "Cannot figure out your double. You CRAY, or something?" >&4 ;;
10226 : Check print/scan long double stuff
10229 if $test X"$d_longdbl" = X"$define"; then
10231 echo "Checking how to print long doubles..." >&4
10233 if $test X"$sPRIfldbl" = X -a X"$doublesize" = X"$longdblsize"; then
10234 $cat >try.c <<'EOCP'
10235 #include <sys/types.h>
10238 double d = 123.456;
10239 printf("%.3f\n", d);
10243 if eval $compile; then
10247 sPRIfldbl='"f"'; sPRIgldbl='"g"'; sPRIeldbl='"e"';
10248 sPRIFUldbl='"F"'; sPRIGUldbl='"G"'; sPRIEUldbl='"E"';
10249 echo "We will use %f."
10255 if $test X"$sPRIfldbl" = X; then
10256 $cat >try.c <<'EOCP'
10257 #include <sys/types.h>
10260 long double d = 123.456;
10261 printf("%.3Lf\n", d);
10265 if eval $compile; then
10269 sPRIfldbl='"Lf"'; sPRIgldbl='"Lg"'; sPRIeldbl='"Le"';
10270 sPRIFUldbl='"LF"'; sPRIGUldbl='"LG"'; sPRIEUldbl='"LE"';
10271 echo "We will use %Lf."
10277 if $test X"$sPRIfldbl" = X; then
10278 $cat >try.c <<'EOCP'
10279 #include <sys/types.h>
10282 long double d = 123.456;
10283 printf("%.3llf\n", d);
10287 if eval $compile; then
10291 sPRIfldbl='"llf"'; sPRIgldbl='"llg"'; sPRIeldbl='"lle"';
10292 sPRIFUldbl='"llF"'; sPRIGUldbl='"llG"'; sPRIEUldbl='"llE"';
10293 echo "We will use %llf."
10299 if $test X"$sPRIfldbl" = X; then
10300 $cat >try.c <<'EOCP'
10301 #include <sys/types.h>
10304 long double d = 123.456;
10305 printf("%.3lf\n", d);
10309 if eval $compile; then
10313 sPRIfldbl='"lf"'; sPRIgldbl='"lg"'; sPRIeldbl='"le"';
10314 sPRIFUldbl='"lF"'; sPRIGUldbl='"lG"'; sPRIEUldbl='"lE"';
10315 echo "We will use %lf."
10321 if $test X"$sPRIfldbl" = X; then
10322 echo "Cannot figure out how to print long doubles." >&4
10324 sSCNfldbl=$sPRIfldbl # expect consistency
10331 case "$sPRIfldbl" in
10332 '') d_PRIfldbl="$undef"; d_PRIgldbl="$undef"; d_PRIeldbl="$undef";
10333 d_PRIFUldbl="$undef"; d_PRIGUldbl="$undef"; d_PRIEUldbl="$undef";
10334 d_SCNfldbl="$undef";
10336 *) d_PRIfldbl="$define"; d_PRIgldbl="$define"; d_PRIeldbl="$define";
10337 d_PRIFUldbl="$define"; d_PRIGUldbl="$define"; d_PRIEUldbl="$define";
10338 d_SCNfldbl="$define";
10342 : Before committing on uselongdouble, see whether that looks sane.
10343 if $test "$uselongdouble" = "$define"; then
10346 echo "Checking if your long double math functions work right..." >&4
10351 printf("%"$sPRIgldbl"\n", sqrtl(logl(expl(cosl(sinl(0.0L))))+powl(2.0L, 3.0L)));
10354 case "$osname:$gccversion" in
10355 aix:) saveccflags="$ccflags"
10356 ccflags="$ccflags -qlongdouble" ;; # to avoid core dump
10359 if eval $compile_ok; then
10363 3) echo "Your long double math functions are working correctly." >&4 ;;
10364 *) echo "Your long double math functions are broken, not using long doubles." >&4
10365 uselongdouble=$undef
10369 case "$osname:$gccversion" in
10370 aix:) ccflags="$saveccflags" ;; # restore
10374 : Check how to convert floats to strings.
10376 if test "X$d_Gconvert" = X; then
10379 echo "Checking for an efficient way to convert floats to strings."
10381 case "$uselongdouble" in
10382 "$define") echo "#define USE_LONG_DOUBLE" >>try.c ;;
10384 case "$d_longdbl" in
10385 "$define") echo "#define HAS_LONG_DOUBLE" >>try.c ;;
10387 case "$d_PRIgldbl" in
10388 "$define") echo "#define HAS_PRIgldbl" >>try.c ;;
10391 #ifdef TRY_gconvert
10392 #define Gconvert(x,n,t,b) gconvert((x),(n),(t),(b))
10393 char *myname = "gconvert";
10396 #define Gconvert(x,n,t,b) gcvt((x),(n),(b))
10397 char *myname = "gcvt";
10400 #define Gconvert(x,n,t,b) qgcvt((x),(n),(b))
10401 char *myname = "qgcvt";
10402 #define DOUBLETYPE long double
10405 #if defined(USE_LONG_DOUBLE) && defined(HAS_LONG_DOUBLE)
10406 #ifdef HAS_PRIgldbl
10407 #define Gconvert(x,n,t,b) sprintf((b),"%.*"$sPRIgldbl,(n),(x))
10409 #define Gconvert(x,n,t,b) sprintf((b),"%.*g",(n),(double)(x))
10412 #define Gconvert(x,n,t,b) sprintf((b),"%.*g",(n),(x))
10414 char *myname = "sprintf";
10418 #if defined(USE_LONG_DOUBLE) && defined(HAS_LONG_DOUBLE)
10419 #define DOUBLETYPE long double
10421 #define DOUBLETYPE double
10427 #$i_stdlib I_STDLIB
10429 #include <stdlib.h>
10431 #$i_string I_STRING
10433 # include <string.h>
10435 # include <strings.h>
10438 int checkit(char *expect, char *got)
10440 if (strcmp(expect, got)) {
10441 printf("%s oddity: Expected %s, got %s\n",
10442 myname, expect, got);
10452 /* This must be 1st test on (which?) platform */
10453 /* Alan Burlison <AlanBurlsin@unn.unisys.com> */
10454 Gconvert((DOUBLETYPE)0.1, 8, 0, buf);
10455 checkit("0.1", buf);
10457 Gconvert((DOUBLETYPE)0.01, 8, 0, buf);
10458 checkit("0.01", buf);
10460 Gconvert((DOUBLETYPE)0.001, 8, 0, buf);
10461 checkit("0.001", buf);
10463 Gconvert((DOUBLETYPE)0.0001, 8, 0, buf);
10464 checkit("0.0001", buf);
10466 Gconvert((DOUBLETYPE)0.00009, 8, 0, buf);
10467 if (strlen(buf) > 5)
10468 checkit("9e-005", buf); /* for Microsoft ?? */
10470 checkit("9e-05", buf);
10472 Gconvert((DOUBLETYPE)1.0, 8, 0, buf);
10475 Gconvert((DOUBLETYPE)1.1, 8, 0, buf);
10476 checkit("1.1", buf);
10478 Gconvert((DOUBLETYPE)1.01, 8, 0, buf);
10479 checkit("1.01", buf);
10481 Gconvert((DOUBLETYPE)1.001, 8, 0, buf);
10482 checkit("1.001", buf);
10484 Gconvert((DOUBLETYPE)1.0001, 8, 0, buf);
10485 checkit("1.0001", buf);
10487 Gconvert((DOUBLETYPE)1.00001, 8, 0, buf);
10488 checkit("1.00001", buf);
10490 Gconvert((DOUBLETYPE)1.000001, 8, 0, buf);
10491 checkit("1.000001", buf);
10493 Gconvert((DOUBLETYPE)0.0, 8, 0, buf);
10496 Gconvert((DOUBLETYPE)-1.0, 8, 0, buf);
10497 checkit("-1", buf);
10499 /* Some Linux gcvt's give 1.e+5 here. */
10500 Gconvert((DOUBLETYPE)100000.0, 8, 0, buf);
10501 checkit("100000", buf);
10503 /* Some Linux gcvt's give -1.e+5 here. */
10504 Gconvert((DOUBLETYPE)-100000.0, 8, 0, buf);
10505 checkit("-100000", buf);
10507 Gconvert((DOUBLETYPE)123.456, 8, 0, buf);
10508 checkit("123.456", buf);
10510 /* Testing of 1e+129 in bigintpm.t must not get extra '.' here. */
10511 Gconvert((DOUBLETYPE)1e34, 8, 0, buf);
10512 /* 34 should be enough to scare even long double
10513 * places into using the e notation. */
10514 if (strlen(buf) > 5)
10515 checkit("1e+034", buf); /* for Microsoft */
10517 checkit("1e+34", buf);
10519 /* For Perl, if you add additional tests here, also add them to
10520 * t/base/num.t for benefit of platforms not using Configure or
10521 * overriding d_Gconvert */
10526 : first add preferred functions to our list
10528 for xxx_convert in $gconvert_preference; do
10529 case $xxx_convert in
10530 gcvt|gconvert|sprintf) xxx_list="$xxx_list $xxx_convert" ;;
10531 *) echo "Discarding unrecognized gconvert_preference $xxx_convert" >&4 ;;
10534 : then add any others
10535 for xxx_convert in gconvert gcvt sprintf; do
10536 case "$xxx_list" in
10538 *) xxx_list="$xxx_list $xxx_convert" ;;
10542 case "$d_longdbl$uselongdouble" in
10544 : again, add preferred functions to our list first
10546 for xxx_convert in $gconvert_ld_preference; do
10547 case $xxx_convert in
10548 qgcvt|gcvt|gconvert|sprintf) xxx_ld_list="$xxx_ld_list $xxx_convert" ;;
10549 *) echo "Discarding unrecognized gconvert_ld_preference $xxx_convert" ;;
10552 : then add qgcvt, sprintf--then, in xxx_list order, gconvert and gcvt
10553 for xxx_convert in qgcvt sprintf $xxx_list; do
10554 case "$xxx_ld_list" in
10555 $xxx_convert*|*" $xxx_convert"*) ;;
10556 *) xxx_ld_list="$xxx_ld_list $xxx_convert" ;;
10559 : if sprintf cannot do long doubles, move it to the end
10560 if test "$d_PRIgldbl" != "$define"; then
10561 xxx_ld_list="`echo $xxx_ld_list|sed s/sprintf//` sprintf"
10563 : if no qgcvt, remove it
10564 if test "$d_qgcvt" != "$define"; then
10565 xxx_ld_list="`echo $xxx_ld_list|sed s/qgcvt//`"
10568 xxx_list="$xxx_ld_list"
10572 for xxx_convert in $xxx_list; do
10573 echo "Trying $xxx_convert..."
10574 $rm -f try try$_o core
10575 set try -DTRY_$xxx_convert
10576 if eval $compile; then
10577 echo "$xxx_convert() found." >&4
10578 if $run ./try; then
10579 echo "I'll use $xxx_convert to convert floats into a string." >&4
10582 echo "...But $xxx_convert didn't work as I expected."
10586 echo "$xxx_convert NOT found." >&4
10590 if test X$xxx_convert = X; then
10591 echo "*** WHOA THERE!!! ***" >&4
10592 echo "None of ($xxx_list) seemed to work properly. I'll use sprintf." >&4
10593 xxx_convert=sprintf
10596 case "$xxx_convert" in
10597 gconvert) d_Gconvert='gconvert((x),(n),(t),(b))' ;;
10598 gcvt) d_Gconvert='gcvt((x),(n),(b))' ;;
10599 qgcvt) d_Gconvert='qgcvt((x),(n),(b))' ;;
10600 *) case "$uselongdouble$d_longdbl$d_PRIgldbl" in
10601 "$define$define$define")
10602 d_Gconvert="sprintf((b),\"%.*\"$sPRIgldbl,(n),(x))" ;;
10603 "$define$define$undef")
10604 d_Gconvert='sprintf((b),"%.*g",(n),(double)(x))' ;;
10605 *) d_Gconvert='sprintf((b),"%.*g",(n),(x))' ;;
10613 : see if _fwalk exists
10617 : Initialize h_fcntl
10620 : Initialize h_sysfile
10623 : access call always available on UNIX
10624 set access d_access
10627 : locate the flags for 'access()'
10628 case "$d_access" in
10631 $cat >access.c <<EOCP
10632 #include <sys/types.h>
10637 #include <sys/file.h>
10640 #include <unistd.h>
10642 #$i_stdlib I_STDLIB
10644 #include <stdlib.h>
10650 : check sys/file.h first, no particular reason here
10651 if $test `./findhdr sys/file.h` && \
10652 $cc -o access $cppflags -DI_SYS_FILE access.c >/dev/null 2>&1 ; then
10654 echo "<sys/file.h> defines the *_OK access constants." >&4
10655 elif $test `./findhdr fcntl.h` && \
10656 $cc -o access $cppflags -DI_FCNTL access.c >/dev/null 2>&1 ; then
10658 echo "<fcntl.h> defines the *_OK access constants." >&4
10659 elif $test `./findhdr unistd.h` && \
10660 $cc -o access $cppflags -DI_UNISTD access.c >/dev/null 2>&1 ; then
10661 echo "<unistd.h> defines the *_OK access constants." >&4
10663 echo "I can't find the four *_OK access constants--I'll use mine." >&4
10669 : see if accessx exists
10670 set accessx d_accessx
10673 : see if acosh exists
10677 : see if aintl exists
10681 : see if alarm exists
10685 : see if 64bit time functions exists
10687 set ctime64 d_ctime64
10690 set localtime64 d_localtime64
10693 set gmtime64 d_gmtime64
10696 set mktime64 d_mktime64
10699 set difftime64 d_difftime64
10702 set asctime64 d_asctime64
10705 : see if POSIX threads are available
10706 set pthread.h i_pthread
10709 : define a function to check prototypes
10710 $cat > protochk <<EOSH
10713 optimize="$optimize"
10715 prototype="$prototype"
10718 usethreads=$usethreads
10719 i_pthread=$i_pthread
10720 pthread_h_first=$pthread_h_first
10723 $cat >> protochk <<'EOSH'
10728 while test $# -ge 2; do
10730 $define) echo "#include <$2>" >> try.c ;;
10731 literal) echo "$2" >> try.c ;;
10733 # Extra magic for the benefit of systems that need pthread.h
10734 # to be included early to correctly detect threadsafe functions.
10735 # Such functions must guarantee themselves, though, that the usethreads
10736 # and i_pthread have been defined, before calling protochk.
10737 if test "$usethreads" = "$define" -a "$i_pthread" = "$define" -a "$pthread_h_first" = "$define" -a "$pthread_h_done" = ""; then
10738 echo "#include <pthread.h>" >> try.c
10743 test "$prototype" = "$define" && echo '#define CAN_PROTOTYPE' >> try.c
10744 cat >> try.c <<'EOCP'
10745 #ifdef CAN_PROTOTYPE
10746 #define _(args) args
10751 echo "$foo" >> try.c
10752 echo 'int no_real_function_has_this_name _((void)) { return 0; }' >> try.c
10753 $cc $optimize $ccflags -c try.c > /dev/null 2>&1
10759 $eunicefix protochk
10761 : Define hasproto macro for Configure internal use
10762 hasproto='varname=$1; func=$2; shift; shift;
10763 while $test $# -ge 2; do
10765 $define) echo "#include <$2>";;
10769 $cppstdin $cppflags $cppminus < try.c > tryout.c 2>/dev/null;
10770 if $contains "$func.*(" tryout.c >/dev/null 2>&1; then
10771 echo "$func() prototype found.";
10774 echo "$func() prototype NOT found.";
10781 : see if sys/types.h has to be included
10782 set sys/types.h i_systypes
10785 : see if sys/select.h has to be included
10786 set sys/select.h i_sysselct
10789 : Define hasfield macro for Configure internal use
10790 hasfield='varname=$1; struct=$2; field=$3; shift; shift; shift;
10791 while $test $# -ge 2; do
10793 $define) echo "#include <$2>";;
10797 echo "int main () { struct $struct foo; char* bar; bar = (char*)foo.$field; }" >> try.c;
10799 if eval $compile; then
10808 : see if we should include time.h, sys/time.h, or both
10810 if test "X$timeincl" = X; then
10811 echo "Testing to see if we should include <time.h>, <sys/time.h> or both." >&4
10812 $echo $n "I'm now running the test program...$c"
10814 #include <sys/types.h>
10819 #ifdef SYSTIMEKERNEL
10822 #include <sys/time.h>
10825 #include <sys/select.h>
10827 #$i_stdlib I_STDLIB
10829 #include <stdlib.h>
10835 struct timeval bar;
10838 struct timezone tzp;
10840 if (foo.tm_sec == foo.tm_sec)
10843 if (bar.tv_sec == bar.tv_sec)
10850 for s_timezone in '-DS_TIMEZONE' ''; do
10852 for s_timeval in '-DS_TIMEVAL' ''; do
10853 for i_systimek in '' '-DSYSTIMEKERNEL'; do
10854 for i_time in '' '-DI_TIME'; do
10855 for i_systime in '-DI_SYSTIME' ''; do
10858 set try $i_time $i_systime $i_systimek $sysselect $s_timeval $s_timezone
10859 if eval $compile; then
10860 set X $i_time $i_systime $i_systimek $sysselect $s_timeval
10864 $echo $n "Succeeded with $flags$c"
10876 *SYSTIMEKERNEL*) i_systimek="$define"
10877 timeincl=`./findhdr sys/time.h`
10878 echo "We'll include <sys/time.h> with KERNEL defined." >&4;;
10879 *) i_systimek="$undef";;
10882 *I_TIME*) i_time="$define"
10883 timeincl=`./findhdr time.h`" $timeincl"
10884 echo "We'll include <time.h>." >&4;;
10885 *) i_time="$undef";;
10888 *I_SYSTIME*) i_systime="$define"
10889 timeincl=`./findhdr sys/time.h`" $timeincl"
10890 echo "We'll include <sys/time.h>." >&4;;
10891 *) i_systime="$undef";;
10895 : see if struct tm knows about tm_zone
10896 case "$i_systime$i_time" in
10899 echo "Checking to see if your struct tm has tm_zone field..." >&4
10900 set d_tm_tm_zone tm tm_zone $i_systime sys/time.h $i_time time.h
10908 case "$d_tm_tm_zone" in
10909 "$define") echo "Yes, it does." ;;
10910 *) echo "No, it doesn't." ;;
10912 : see if struct tm knows about tm_gmtoff
10913 case "$i_systime$i_time" in
10916 echo "Checking to see if your struct tm has tm_gmtoff field..." >&4
10917 set d_tm_tm_gmtoff tm tm_gmtoff $i_systime sys/time.h $i_time time.h
10925 case "$d_tm_tm_gmtoff" in
10926 "$define") echo "Yes, it does." ;;
10927 *) echo "No, it doesn't." ;;
10930 : see if asctime_r exists
10931 set asctime_r d_asctime_r
10933 case "$d_asctime_r" in
10935 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
10936 case "$d_asctime_r_proto:$usethreads" in
10937 ":define") d_asctime_r_proto=define
10938 set d_asctime_r_proto asctime_r $hdrs
10942 case "$d_asctime_r_proto" in
10944 case "$asctime_r_proto" in
10945 ''|0) try='char* asctime_r(const struct tm*, char*);'
10946 ./protochk "$extern_C $try" $hdrs && asctime_r_proto=B_SB ;;
10948 case "$asctime_r_proto" in
10949 ''|0) try='char* asctime_r(const struct tm*, char*, int);'
10950 ./protochk "$extern_C $try" $hdrs && asctime_r_proto=B_SBI ;;
10952 case "$asctime_r_proto" in
10953 ''|0) try='int asctime_r(const struct tm*, char*);'
10954 ./protochk "$extern_C $try" $hdrs && asctime_r_proto=I_SB ;;
10956 case "$asctime_r_proto" in
10957 ''|0) try='int asctime_r(const struct tm*, char*, int);'
10958 ./protochk "$extern_C $try" $hdrs && asctime_r_proto=I_SBI ;;
10960 case "$asctime_r_proto" in
10961 ''|0) d_asctime_r=undef
10963 echo "Disabling asctime_r, cannot determine prototype." >&4 ;;
10964 * ) case "$asctime_r_proto" in
10965 REENTRANT_PROTO*) ;;
10966 *) asctime_r_proto="REENTRANT_PROTO_$asctime_r_proto" ;;
10968 echo "Prototype: $try" ;;
10971 *) case "$usethreads" in
10972 define) echo "asctime_r has no prototype, not using it." >&4 ;;
10979 *) asctime_r_proto=0
10983 : see if asinh exists
10987 : see if atanh exists
10991 : see if atolf exists
10995 : see if atoll exists
10999 : Look for GCC-style attribute format
11000 case "$d_attribute_format" in
11003 echo "Checking whether your compiler can handle __attribute__((format)) ..." >&4
11004 $cat >attrib.c <<'EOCP'
11006 void my_special_printf(char* pat,...) __attribute__((__format__(__printf__,1,2)));
11008 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
11009 if $contains 'warning' attrib.out >/dev/null 2>&1; then
11010 echo "Your C compiler doesn't support __attribute__((format))."
11013 echo "Your C compiler supports __attribute__((format))."
11017 echo "Your C compiler doesn't seem to understand __attribute__ at all."
11021 *) val="$d_attribute_format" ;;
11023 set d_attribute_format
11027 : Look for GCC-style attribute format with null format allowed
11028 case "$d_printf_format_null" in
11029 '') case "$d_attribute_format" in
11032 echo "Checking whether your compiler allows __printf__ format to be null ..." >&4
11033 $cat >attrib.c <<EOCP
11035 #$i_stdlib I_STDLIB
11037 #include <stdlib.h>
11039 int null_printf (char* pat,...) __attribute__((__format__(__printf__,1,2)));
11040 int null_printf (char* pat,...) { return (int)pat; }
11041 int main () { exit(null_printf(NULL)); }
11043 if $cc $ccflags -o attrib attrib.c >attrib.out 2>&1 ; then
11044 : run the executable in case it produces a run-time warning
11045 if $run ./attrib >>attrib.out 2>&1; then
11046 if $contains 'warning' attrib.out >/dev/null 2>&1; then
11047 echo "Your C compiler doesn't allow __printf__ format to be null."
11050 echo "Your C compiler allows __printf__ format to be null."
11054 echo "Your C compiler executable failed with __printf__ format null."
11058 echo "Your C compiler fails with __printf__ format null."
11065 *) val="$d_printf_format_null" ;;
11067 set d_printf_format_null
11071 : Look for GCC-style attribute malloc
11072 case "$d_attribute_malloc" in
11075 echo "Checking whether your compiler can handle __attribute__((malloc)) ..." >&4
11076 $cat >attrib.c <<'EOCP'
11078 char *go_get_some_memory( int how_many_bytes ) __attribute__((malloc));
11080 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
11081 if $contains 'warning' attrib.out >/dev/null 2>&1; then
11082 echo "Your C compiler doesn't support __attribute__((malloc))."
11085 echo "Your C compiler supports __attribute__((malloc))."
11089 echo "Your C compiler doesn't seem to understand __attribute__ at all."
11093 *) val="$d_attribute_malloc" ;;
11095 set d_attribute_malloc
11099 : Look for GCC-style attribute nonnull
11100 case "$d_attribute_nonnull" in
11103 echo "Checking whether your compiler can handle __attribute__((nonnull(1))) ..." >&4
11104 $cat >attrib.c <<'EOCP'
11106 void do_something (char *some_pointer,...) __attribute__((nonnull(1)));
11108 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
11109 if $contains 'warning' attrib.out >/dev/null 2>&1; then
11110 echo "Your C compiler doesn't support __attribute__((nonnull))."
11113 echo "Your C compiler supports __attribute__((nonnull))."
11117 echo "Your C compiler doesn't seem to understand __attribute__ at all."
11121 *) val="$d_attribute_nonnull" ;;
11123 set d_attribute_nonnull
11127 : Look for GCC-style attribute noreturn
11128 case "$d_attribute_noreturn" in
11131 echo "Checking whether your compiler can handle __attribute__((noreturn)) ..." >&4
11132 $cat >attrib.c <<'EOCP'
11134 void fall_over_dead( void ) __attribute__((noreturn));
11136 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
11137 if $contains 'warning' attrib.out >/dev/null 2>&1; then
11138 echo "Your C compiler doesn't support __attribute__((noreturn))."
11141 echo "Your C compiler supports __attribute__((noreturn))."
11145 echo "Your C compiler doesn't seem to understand __attribute__ at all."
11149 *) val="$d_attribute_noreturn" ;;
11151 set d_attribute_noreturn
11155 : Look for GCC-style attribute pure
11156 case "$d_attribute_pure" in
11159 echo "Checking whether your compiler can handle __attribute__((pure)) ..." >&4
11160 $cat >attrib.c <<'EOCP'
11162 int square( int n ) __attribute__((pure));
11164 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
11165 if $contains 'warning' attrib.out >/dev/null 2>&1; then
11166 echo "Your C compiler doesn't support __attribute__((pure))."
11169 echo "Your C compiler supports __attribute__((pure))."
11173 echo "Your C compiler doesn't seem to understand __attribute__ at all."
11177 *) val="$d_attribute_pure" ;;
11179 set d_attribute_pure
11183 : Look for GCC-style attribute unused
11184 case "$d_attribute_unused" in
11187 echo "Checking whether your compiler can handle __attribute__((unused)) ..." >&4
11188 $cat >attrib.c <<'EOCP'
11190 int do_something( int dummy __attribute__((unused)), int n );
11192 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
11193 if $contains 'warning' attrib.out >/dev/null 2>&1; then
11194 echo "Your C compiler doesn't support __attribute__((unused))."
11197 echo "Your C compiler supports __attribute__((unused))."
11201 echo "Your C compiler doesn't seem to understand __attribute__ at all."
11205 *) val="$d_attribute_unused" ;;
11207 set d_attribute_unused
11211 : Look for GCC-style attribute deprecated
11212 case "$d_attribute_deprecated" in
11215 echo "Checking whether your compiler can handle __attribute__((deprecated)) ..." >&4
11216 $cat >attrib.c <<'EOCP'
11218 int I_am_deprecated(void) __attribute__((deprecated));
11220 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
11221 if $contains 'warning' attrib.out >/dev/null 2>&1; then
11222 echo "Your C compiler doesn't support __attribute__((deprecated))."
11225 echo "Your C compiler supports __attribute__((deprecated))."
11229 echo "Your C compiler doesn't seem to understand __attribute__ at all."
11233 *) val="$d_attribute_deprecated" ;;
11235 set d_attribute_deprecated
11239 : Look for GCC-style attribute warn_unused_result
11240 case "$d_attribute_warn_unused_result" in
11243 echo "Checking whether your compiler can handle __attribute__((warn_unused_result)) ..." >&4
11244 $cat >attrib.c <<'EOCP'
11246 int I_will_not_be_ignored(void) __attribute__((warn_unused_result));
11248 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
11249 if $contains 'warning' attrib.out >/dev/null 2>&1; then
11250 echo "Your C compiler doesn't support __attribute__((warn_unused_result))."
11253 echo "Your C compiler supports __attribute__((warn_unused_result))."
11257 echo "Your C compiler doesn't seem to understand __attribute__ at all."
11261 *) val="$d_attribute_warn_unused_result" ;;
11263 set d_attribute_warn_unused_result
11267 : see if bcmp exists
11271 : see if bcopy exists
11275 : see if getpgrp exists
11276 set getpgrp d_getpgrp
11279 case "$d_getpgrp" in
11282 echo "Checking to see which flavor of getpgrp is in use..."
11284 #$i_unistd I_UNISTD
11285 #include <sys/types.h>
11287 # include <unistd.h>
11289 #$i_stdlib I_STDLIB
11291 #include <stdlib.h>
11295 if (getuid() == 0) {
11296 printf("(I see you are running Configure as super-user...)\n");
11299 #ifdef TRY_BSD_PGRP
11300 if (getpgrp(1) == 0)
11309 if $cc -o try -DTRY_BSD_PGRP $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
11310 echo "You have to use getpgrp(pid) instead of getpgrp()." >&4
11312 elif $cc -o try $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
11313 echo "You have to use getpgrp() instead of getpgrp(pid)." >&4
11316 echo "I can't seem to compile and run the test program."
11318 xxx="a USG one, i.e. you use getpgrp()."
11320 # SVR4 systems can appear rather BSD-ish.
11321 case "$i_unistd" in
11323 xxx="a BSD one, i.e. you use getpgrp(pid)."
11327 xxx="probably a USG one, i.e. you use getpgrp()."
11332 echo "Assuming your getpgrp is $xxx" >&4
11341 : see if setpgrp exists
11342 set setpgrp d_setpgrp
11345 case "$d_setpgrp" in
11348 echo "Checking to see which flavor of setpgrp is in use..."
11350 #$i_unistd I_UNISTD
11351 #include <sys/types.h>
11353 # include <unistd.h>
11355 #$i_stdlib I_STDLIB
11357 #include <stdlib.h>
11361 if (getuid() == 0) {
11362 printf("(I see you are running Configure as super-user...)\n");
11365 #ifdef TRY_BSD_PGRP
11366 if (-1 == setpgrp(1, 1))
11369 if (setpgrp() != -1)
11375 if $cc -o try -DTRY_BSD_PGRP $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
11376 echo 'You have to use setpgrp(pid,pgrp) instead of setpgrp().' >&4
11378 elif $cc -o try $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
11379 echo 'You have to use setpgrp() instead of setpgrp(pid,pgrp).' >&4
11382 echo "(I can't seem to compile and run the test program.)"
11384 xxx="a USG one, i.e. you use setpgrp()."
11386 # SVR4 systems can appear rather BSD-ish.
11387 case "$i_unistd" in
11389 xxx="a BSD one, i.e. you use setpgrp(pid,pgrp)."
11393 xxx="probably a USG one, i.e. you use setpgrp()."
11398 echo "Assuming your setpgrp is $xxx" >&4
11407 : Look for GCC-style __builtin_choose_expr
11408 case "$d_builtin_choose_expr" in
11411 echo "Checking whether your compiler can handle __builtin_choose_expr ..." >&4
11412 $cat >try.c <<'EOCP'
11413 #include <assert.h>
11414 #include <stdlib.h>
11417 #define SYRINX(x) __builtin_choose_expr( x, (1056*2), (103*50) )
11420 assert( SYRINX(1) == 2112 );
11421 assert( SYRINX(1) != 5150 );
11422 assert( SYRINX(0) == 5150 );
11423 assert( SYRINX(0) != 2112 );
11424 puts( "All good!" );
11430 if eval $compile && $run ./try; then
11431 echo "Your C compiler supports __builtin_choose_expr."
11434 echo "Your C compiler doesn't seem to understand __builtin_choose_expr."
11438 *) val="$d_builtin_choose_expr" ;;
11441 set d_builtin_choose_expr
11445 : Look for GCC-style __builtin_expect
11446 case "$d_builtin_expect" in
11449 echo "Checking whether your compiler can handle __builtin_expect ..." >&4
11450 $cat >try.c <<'EOCP'
11453 if ( __builtin_expect(n, 0) ) n = 1;
11454 /* Remember shell exit code truth is 0, C truth is non-zero */
11459 if eval $compile && $run ./try; then
11460 echo "Your C compiler supports __builtin_expect."
11463 echo "Your C compiler doesn't seem to understand __builtin_expect."
11467 *) val="$d_builtin_expect" ;;
11470 set d_builtin_expect
11474 : see if bzero exists
11478 : see if stdarg is available
11480 if $test `./findhdr stdarg.h`; then
11481 echo "<stdarg.h> found." >&4
11484 echo "<stdarg.h> NOT found." >&4
11488 : see if varargs is available
11490 if $test `./findhdr varargs.h`; then
11491 echo "<varargs.h> found." >&4
11493 echo "<varargs.h> NOT found, but that's ok (I hope)." >&4
11496 : set up the varargs testing programs
11497 $cat > varargs.c <<EOP
11499 #include <stdarg.h>
11502 #include <varargs.h>
11506 int f(char *p, ...)
11520 p = va_arg(ap, char *);
11526 $cat > varargs <<EOP
11528 if $cc -c $ccflags -D\$1 varargs.c >/dev/null 2>&1; then
11537 : now check which varargs header should be included
11543 if `./varargs I_STDARG`; then
11545 elif `./varargs I_VARARGS`; then
11550 if `./varargs I_VARARGS`; then
11558 echo "*** WHOA THERE!!! ***" >&4
11559 echo " Your C compiler \"$cc\" doesn't seem to support stdarg or varargs!" >&4
11560 case "$knowitall" in
11562 echo " I'm giving up; maybe you can try again with a different compiler?" >&4
11566 echo "I could not find the definition for va_dcl... You have problems..." >&4
11567 val="$undef"; set i_stdarg; eval $setvar
11568 val="$undef"; set i_varargs; eval $setvar
11573 case "$i_varhdr" in
11575 val="$define"; set i_stdarg; eval $setvar
11576 val="$undef"; set i_varargs; eval $setvar
11579 val="$undef"; set i_stdarg; eval $setvar
11580 val="$define"; set i_varargs; eval $setvar
11583 echo "We'll include <$i_varhdr> to get va_dcl definition." >&4;;
11587 : see if the Compiler supports C99 variadic macros
11588 case "$i_stdarg$i_stdlib" in
11590 echo "You have <stdarg.h> and <stdlib.h>, so checking for C99 variadic macros." >&4
11593 #include <stdarg.h>
11595 #define foo(buffer, format, ...) sprintf(buffer, format, __VA_ARGS__)
11599 foo(buf, "%d %g %.*s", 123, 456.0, (int)3, "789fail");
11605 if eval $compile && $run ./try 2>&1 >/dev/null; then
11606 case "`$run ./try`" in
11608 echo "You have C99 variadic macros." >&4
11609 d_c99_variadic_macros="$define"
11612 echo "You don't have functional C99 variadic macros." >&4
11613 d_c99_variadic_macros="$undef"
11617 echo "I couldn't compile and run the test program, so I assume that you don't have functional C99 variadic macros." >&4
11618 d_c99_variadic_macros="$undef"
11623 echo "You don't have <stdarg.h> and <stdlib.h>, so not checking for C99 variadic macros." >&4
11624 d_c99_variadic_macros="$undef"
11628 : see if signal is declared as pointer to function returning int or void
11630 xxx=`./findhdr signal.h`
11631 $test "$xxx" && $cppstdin $cppminus $cppflags < $xxx >$$.tmp 2>/dev/null
11632 if $contains 'int.*\*[ ]*signal' $$.tmp >/dev/null 2>&1 ; then
11633 echo "You have int (*signal())() instead of void." >&4
11635 elif $contains 'void.*\*[ ]*signal' $$.tmp >/dev/null 2>&1 ; then
11636 echo "You have void (*signal())()." >&4
11638 elif $contains 'extern[ ]*[(\*]*signal' $$.tmp >/dev/null 2>&1 ; then
11639 echo "You have int (*signal())() instead of void." >&4
11641 elif $contains 'void.*\*.*sig' $$.tmp >/dev/null 2>&1 ; then
11642 echo "You have void (*signal())()." >&4
11645 case "$d_voidsig" in
11647 echo "I can't determine whether signal handler returns void or int..." >&4
11649 rp="What type does your signal handler return?"
11652 v*) val="$define";;
11656 echo "As you already told me, signal handler returns void." >&4
11659 *) echo "As you already told me, signal handler returns int." >&4
11666 case "$d_voidsig" in
11667 "$define") signal_t="void";;
11668 *) signal_t="int";;
11672 : check for ability to cast large floats to 32-bit ints.
11674 echo 'Checking whether your C compiler can cast large floats to int32.' >&4
11675 if $test "$intsize" -ge 4; then
11682 #$i_stdlib I_STDLIB
11684 #include <stdlib.h>
11686 #include <sys/types.h>
11687 #include <signal.h>
11688 $signal_t blech(int s) { exit(3); }
11695 signal(SIGFPE, blech);
11697 /* Don't let compiler optimize the test away. Store the number
11698 in a writable string for gcc to pass to sscanf under HP-UX.
11700 sprintf(str, "2147483647");
11701 sscanf(str, "%lf", &f); /* f = (double) 0x7fffffff; */
11705 /* x86 processors will probably give 0x8000 0000, which is a
11706 sign change. We don't want that. We want to mimic SPARC
11707 behavior here, which is to preserve the sign and give
11710 if (i32 != ($xxx) f)
11716 if eval $compile_ok; then
11717 $run ./try 2>/dev/null
11720 echo "(I can't seem to compile the test program--assuming it can't)"
11725 echo "Yup, it can."
11728 echo "Nope, it can't."
11735 : check for ability to cast negative floats to unsigned
11737 echo 'Checking whether your C compiler can cast negative float to unsigned.' >&4
11740 #$i_stdlib I_STDLIB
11742 #include <stdlib.h>
11744 #include <sys/types.h>
11745 #include <signal.h>
11746 $signal_t blech(int s) { exit(7); }
11747 $signal_t blech_in_list(int s) { exit(4); }
11748 unsigned long dummy_long(unsigned long p) { return p; }
11749 unsigned int dummy_int(unsigned int p) { return p; }
11750 unsigned short dummy_short(unsigned short p) { return p; }
11754 unsigned long along;
11756 unsigned short ashort;
11760 /* Frustrate gcc-2.7.2's optimizer which failed this test with
11761 a direct f = -123. assignment. gcc-2.8.0 reportedly
11762 optimized the whole file away
11764 /* Store the number in a writable string for gcc to pass to
11765 sscanf under HP-UX.
11767 sprintf(str, "-123");
11768 sscanf(str, "%lf", &f); /* f = -123.; */
11770 signal(SIGFPE, blech);
11771 along = (unsigned long)f;
11772 aint = (unsigned int)f;
11773 ashort = (unsigned short)f;
11774 if (along != (unsigned long)-123)
11776 if (aint != (unsigned int)-123)
11778 if (ashort != (unsigned short)-123)
11780 sprintf(str, "1073741824.");
11781 sscanf(str, "%lf", &f); /* f = (double)0x40000000; */
11784 along = (unsigned long)f;
11785 if (along != 0x80000000)
11789 along = (unsigned long)f;
11790 if (along != 0x7fffffff)
11794 along = (unsigned long)f;
11795 if (along != 0x80000001)
11799 signal(SIGFPE, blech_in_list);
11800 sprintf(str, "123.");
11801 sscanf(str, "%lf", &f); /* f = 123.; */
11802 along = dummy_long((unsigned long)f);
11803 aint = dummy_int((unsigned int)f);
11804 ashort = dummy_short((unsigned short)f);
11805 if (along != (unsigned long)123)
11807 if (aint != (unsigned int)123)
11809 if (ashort != (unsigned short)123)
11816 if eval $compile_ok; then
11817 $run ./try 2>/dev/null
11820 echo "(I can't seem to compile the test program--assuming it can't)"
11823 case "$castflags" in
11825 echo "Yup, it can."
11828 echo "Nope, it can't."
11835 : see if cbrt exists
11839 : see if vprintf exists
11841 if set vprintf val -f d_vprintf; eval $csym; $val; then
11842 echo 'vprintf() found.' >&4
11845 #$i_stdarg I_STDARG /* Only one of these can be defined by i_varhrd */
11846 #$i_varargs I_VARARGS
11848 #$i_stdlib I_STDLIB
11849 #$i_unistd I_UNISTD
11852 # include <stdarg.h>
11853 #else /* I_VARARGS */
11854 # include <varargs.h>
11858 # include <unistd.h>
11862 # include <stdlib.h>
11865 #include <stdio.h> /* vsprintf prototype */
11868 void xxx(int n, ...)
11873 exit((unsigned long)vsprintf(buf,"%s",args) > 10L);
11875 int main() { xxx(1, "foo"); }
11877 #else /* I_VARARGS */
11885 exit((unsigned long)vsprintf(buf,"%s",args) > 10L);
11887 int main() { xxx("foo"); }
11893 if eval $compile_ok; then
11894 if $run ./try; then
11895 echo "Your vsprintf() returns (int)." >&4
11898 echo "Your vsprintf() returns (char*)." >&4
11902 echo 'I am unable to compile the vsprintf() test program.' >&4
11903 # We shouldn't get here. If we do, assume the standard signature,
11904 # not the old BSD one.
11905 echo 'Guessing that vsprintf() returns (int).' >&4
11909 echo 'vprintf() NOT found.' >&4
11920 : see if chown exists
11924 : see if chroot exists
11925 set chroot d_chroot
11928 : see if chsize exists
11929 set chsize d_chsize
11932 : see if class exists
11936 : see if clearenv exists
11937 set clearenv d_clearenv
11940 : Define hasstruct macro for Configure internal use
11941 hasstruct='varname=$1; struct=$2; shift; shift;
11942 while $test $# -ge 2; do
11944 $define) echo "#include <$2>";;
11948 echo "int main () { struct $struct foo; }" >> try.c;
11950 if eval $compile; then
11959 : see whether socket exists
11963 $echo $n "Hmm... $c" >&4
11964 if set socket val -f d_socket; eval $csym; $val; then
11965 echo "Looks like you have Berkeley networking support." >&4
11967 if set setsockopt val -f; eval $csym; $val; then
11970 echo "...but it uses the old BSD 4.1c interface, rather than 4.2." >&4
11971 d_oldsock="$define"
11974 if $contains socklib libc.list >/dev/null 2>&1; then
11975 echo "Looks like you have Berkeley networking support." >&4
11977 : we will have to assume that it supports the 4.2 BSD interface
11980 echo "You don't have Berkeley networking in libc$_a..." >&4
11981 if test "X$d_socket" = "X$define"; then
11982 echo "...but you seem to believe that you have sockets." >&4
11984 for net in net socket
11986 if test -f $sysroot/usr/lib/lib$net$_a; then
11987 ( ($nm $nm_opt $sysroot/usr/lib/lib$net$_a | eval $nm_extract) || \
11988 $ar t $sysroot/usr/lib/lib$net$_a) 2>/dev/null >> libc.list
11989 if $contains socket libc.list >/dev/null 2>&1; then
11994 echo "...but the Wollongong group seems to have hacked it in." >&4
11995 sockethdr="-I$sysroot/usr/netinclude"
11998 echo "Found Berkeley sockets interface in lib$net." >&4
11999 if $contains setsockopt libc.list >/dev/null 2>&1; then
12002 echo "...using the old BSD 4.1c interface, rather than 4.2." >&4
12003 d_oldsock="$define"
12009 if test "X$d_socket" != "X$define"; then
12010 echo "or anywhere else I see." >&4
12018 : see if socketpair exists
12019 set socketpair d_sockpair
12024 echo "Checking the availability sa_len in the sock struct ..." >&4
12026 #include <sys/types.h>
12027 #include <sys/socket.h>
12029 struct sockaddr sa;
12030 return (sa.sa_len);
12034 set try; if eval $compile; then
12037 set d_sockaddr_sa_len; eval $setvar
12041 echo "Checking the availability struct sockaddr_in6 ..." >&4
12043 #include <sys/types.h>
12044 #include <sys/socket.h>
12045 #include <netinet/in.h>
12047 struct sockaddr_in6 sin6;
12048 return (sin6.sin6_family);
12052 set try; if eval $compile; then
12055 set d_sockaddr_in6; eval $setvar
12059 echo "Checking the availability sin6_scope_id in struct sockaddr_in6 ..." >&4
12061 #include <sys/types.h>
12062 #include <sys/socket.h>
12063 #include <netinet/in.h>
12065 struct sockaddr_in6 sin6;
12066 return (sin6.sin6_scope_id);
12070 set try; if eval $compile; then
12073 set d_sin6_scope_id; eval $setvar
12077 echo "Checking the availability struct ip_mreq ..." >&4
12079 #include <sys/types.h>
12080 #include <sys/socket.h>
12081 #include <netinet/in.h>
12083 struct ip_mreq mreq;
12084 return (mreq.imr_multiaddr.s_addr);
12088 set try; if eval $compile; then
12091 set d_ip_mreq; eval $setvar
12095 echo "Checking the availability struct ip_mreq_source ..." >&4
12097 #include <sys/types.h>
12098 #include <sys/socket.h>
12099 #include <netinet/in.h>
12101 struct ip_mreq_source mreq;
12102 return (mreq.imr_multiaddr.s_addr);
12106 set try; if eval $compile; then
12109 set d_ip_mreq_source; eval $setvar
12113 echo "Checking the availability struct ipv6_mreq ..." >&4
12115 #include <sys/types.h>
12116 #include <sys/socket.h>
12117 #include <netinet/in.h>
12119 struct ipv6_mreq mreq;
12120 return (mreq.ipv6mr_interface);
12124 set try; if eval $compile; then
12127 set d_ipv6_mreq; eval $setvar
12131 echo "Checking the availability struct ipv6_mreq_source ..." >&4
12133 #include <sys/types.h>
12134 #include <sys/socket.h>
12135 #include <netinet/in.h>
12137 struct ipv6_mreq_source mreq;
12138 return (mreq.imr_multiaddr.s_addr);
12142 set try; if eval $compile; then
12145 set d_ipv6_mreq_source; eval $setvar
12149 echo "Checking the availability of certain socket constants..." >&4
12150 for ENUM in MSG_CTRUNC MSG_DONTROUTE MSG_OOB MSG_PEEK MSG_PROXY SCM_RIGHTS; do
12151 enum=`$echo $ENUM|./tr '[A-Z]' '[a-z]'`
12153 #include <sys/types.h>
12154 #include <sys/socket.h>
12160 set try; if eval $compile; then
12163 set d_${enum}; eval $setvar
12167 : see if this is a sys/uio.h system
12168 set sys/uio.h i_sysuio
12171 : Check for cmsghdr support
12173 echo "Checking to see if your system supports struct cmsghdr..." >&4
12174 set d_cmsghdr_s cmsghdr $i_systypes sys/types.h $d_socket sys/socket.h $i_sysuio sys/uio.h
12176 case "$d_cmsghdr_s" in
12177 "$define") echo "Yes, it does." ;;
12178 *) echo "No, it doesn't." ;;
12182 : check for const keyword
12184 echo 'Checking to see if your C compiler knows about "const"...' >&4
12185 $cat >const.c <<'EOCP'
12186 typedef struct spug { int drokk; } spug;
12190 const spug y = { 0 };
12193 if $cc -c $ccflags const.c >/dev/null 2>&1 ; then
12195 echo "Yup, it does."
12198 echo "Nope, it doesn't."
12203 : see if copysign exists
12204 set copysign d_copysign
12207 : see if copysignl exists
12208 set copysignl d_copysignl
12211 : see if crypt exists
12216 $define) cryptlib='' ;;
12217 *) if set crypt val -f d_crypt; eval $csym; $val; then
12218 echo 'crypt() found.' >&4
12222 cryptlib=`./loc Slibcrypt$_a "" $xlibpth`
12223 if $test -z "$cryptlib"; then
12224 cryptlib=`./loc Mlibcrypt$_a "" $xlibpth`
12228 if $test -z "$cryptlib"; then
12229 cryptlib=`./loc Llibcrypt$_a "" $xlibpth`
12233 if $test -z "$cryptlib"; then
12234 cryptlib=`./loc libcrypt$_a "" $libpth`
12238 if $test -z "$cryptlib"; then
12239 echo 'crypt() NOT found.' >&4
12250 : see if this is a crypt.h system
12251 set crypt.h i_crypt
12254 : see if crypt_r exists
12255 set crypt_r d_crypt_r
12257 case "$d_crypt_r" in
12259 hdrs="$i_systypes sys/types.h define stdio.h $i_crypt crypt.h"
12260 case "$d_crypt_r_proto:$usethreads" in
12261 ":define") d_crypt_r_proto=define
12262 set d_crypt_r_proto crypt_r $hdrs
12266 case "$d_crypt_r_proto" in
12268 case "$crypt_r_proto" in
12269 ''|0) try='char* crypt_r(const char*, const char*, struct crypt_data*);'
12270 ./protochk "$extern_C $try" $hdrs && crypt_r_proto=B_CCS ;;
12272 case "$crypt_r_proto" in
12273 ''|0) try='char* crypt_r(const char*, const char*, CRYPTD*);'
12274 ./protochk "$extern_C $try" $hdrs && crypt_r_proto=B_CCD ;;
12276 case "$crypt_r_proto" in
12277 ''|0) d_crypt_r=undef
12279 echo "Disabling crypt_r, cannot determine prototype." >&4 ;;
12280 * ) case "$crypt_r_proto" in
12281 REENTRANT_PROTO*) ;;
12282 *) crypt_r_proto="REENTRANT_PROTO_$crypt_r_proto" ;;
12284 echo "Prototype: $try" ;;
12287 *) case "$usethreads" in
12288 define) echo "crypt_r has no prototype, not using it." >&4 ;;
12299 : get csh whereabouts
12301 'csh') val="$undef" ;;
12302 *) val="$define" ;;
12306 : Respect a hint or command line value for full_csh.
12307 case "$full_csh" in
12308 '') full_csh=$csh ;;
12311 : see if ctermid exists
12312 set ctermid d_ctermid
12315 : see if ctermid_r exists
12316 set ctermid_r d_ctermid_r
12318 case "$d_ctermid_r" in
12320 hdrs="$i_systypes sys/types.h define stdio.h "
12321 case "$d_ctermid_r_proto:$usethreads" in
12322 ":define") d_ctermid_r_proto=define
12323 set d_ctermid_r_proto ctermid_r $hdrs
12327 case "$d_ctermid_r_proto" in
12329 case "$ctermid_r_proto" in
12330 ''|0) try='char* ctermid_r(char*);'
12331 ./protochk "$extern_C $try" $hdrs && ctermid_r_proto=B_B ;;
12333 case "$ctermid_r_proto" in
12334 ''|0) d_ctermid_r=undef
12336 echo "Disabling ctermid_r, cannot determine prototype." >&4 ;;
12337 * ) case "$ctermid_r_proto" in
12338 REENTRANT_PROTO*) ;;
12339 *) ctermid_r_proto="REENTRANT_PROTO_$ctermid_r_proto" ;;
12341 echo "Prototype: $try" ;;
12344 *) case "$usethreads" in
12345 define) echo "ctermid_r has no prototype, not using it." >&4 ;;
12352 *) ctermid_r_proto=0
12356 : see if ctime_r exists
12357 set ctime_r d_ctime_r
12359 case "$d_ctime_r" in
12361 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
12362 case "$d_ctime_r_proto:$usethreads" in
12363 ":define") d_ctime_r_proto=define
12364 set d_ctime_r_proto ctime_r $hdrs
12368 case "$d_ctime_r_proto" in
12370 case "$ctime_r_proto" in
12371 ''|0) try='char* ctime_r(const time_t*, char*);'
12372 ./protochk "$extern_C $try" $hdrs && ctime_r_proto=B_SB ;;
12374 case "$ctime_r_proto" in
12375 ''|0) try='char* ctime_r(const time_t*, char*, int);'
12376 ./protochk "$extern_C $try" $hdrs && ctime_r_proto=B_SBI ;;
12378 case "$ctime_r_proto" in
12379 ''|0) try='int ctime_r(const time_t*, char*);'
12380 ./protochk "$extern_C $try" $hdrs && ctime_r_proto=I_SB ;;
12382 case "$ctime_r_proto" in
12383 ''|0) try='int ctime_r(const time_t*, char*, int);'
12384 ./protochk "$extern_C $try" $hdrs && ctime_r_proto=I_SBI ;;
12386 case "$ctime_r_proto" in
12387 ''|0) d_ctime_r=undef
12389 echo "Disabling ctime_r, cannot determine prototype." >&4 ;;
12390 * ) case "$ctime_r_proto" in
12391 REENTRANT_PROTO*) ;;
12392 *) ctime_r_proto="REENTRANT_PROTO_$ctime_r_proto" ;;
12394 echo "Prototype: $try" ;;
12397 *) case "$usethreads" in
12398 define) echo "ctime_r has no prototype, not using it." >&4 ;;
12409 : see if cuserid exists
12410 set cuserid d_cuserid
12413 : see if this is a limits.h system
12414 set limits.h i_limits
12417 : See if number of significant digits in a double precision number is known
12419 $cat >dbl_dig.c <<EOM
12420 #$i_limits I_LIMITS
12423 #include <limits.h>
12429 printf("Contains DBL_DIG");
12432 $cppstdin $cppflags $cppminus < dbl_dig.c >dbl_dig.E 2>/dev/null
12433 if $contains 'DBL_DIG' dbl_dig.E >/dev/null 2>&1; then
12434 echo "DBL_DIG found." >&4
12437 echo "DBL_DIG NOT found." >&4
12444 : see if dbm.h is available
12445 : see if dbmclose exists
12446 set dbmclose d_dbmclose
12449 case "$d_dbmclose" in
12459 *) set rpcsvc/dbm.h i_rpcsvcdbm
12464 *) echo "We won't be including <dbm.h>"
12474 : see if prototype for dbminit is available
12476 set d_dbminitproto dbminit $i_dbm dbm.h
12479 : see if difftime exists
12480 set difftime d_difftime
12483 : see if this is a dirent system
12485 if xinc=`./findhdr dirent.h`; $test "$xinc"; then
12487 echo "<dirent.h> found." >&4
12490 if xinc=`./findhdr sys/dir.h`; $test "$xinc"; then
12491 echo "<sys/dir.h> found." >&4
12494 xinc=`./findhdr sys/ndir.h`
12496 echo "<dirent.h> NOT found." >&4
12501 : Look for type of directory structure.
12503 $cppstdin $cppflags $cppminus < "$xinc" > try.c
12505 case "$direntrytype" in
12507 case "$i_dirent" in
12508 $define) guess1='struct dirent' ;;
12509 *) guess1='struct direct' ;;
12512 *) guess1="$direntrytype"
12517 'struct dirent') guess2='struct direct' ;;
12518 *) guess2='struct dirent' ;;
12521 if $contains "$guess1" try.c >/dev/null 2>&1; then
12522 direntrytype="$guess1"
12523 echo "Your directory entries are $direntrytype." >&4
12524 elif $contains "$guess2" try.c >/dev/null 2>&1; then
12525 direntrytype="$guess2"
12526 echo "Your directory entries seem to be $direntrytype." >&4
12528 echo "I don't recognize your system's directory entries." >&4
12529 rp="What type is used for directory entries on this system?"
12532 direntrytype="$ans"
12536 : see if the directory entry stores field length
12538 $cppstdin $cppflags $cppminus < "$xinc" > try.c
12539 if $contains 'd_namlen' try.c >/dev/null 2>&1; then
12540 echo "Good, your directory entry keeps length information in d_namlen." >&4
12543 echo "Your directory entry does not know about the d_namlen field." >&4
12550 : Look for DIR.dd_fd
12551 case "$i_dirent" in
12553 echo "Checking to see if DIR has a dd_fd member variable" >&4
12555 #$i_stdlib I_STDLIB
12557 #include <stdlib.h>
12559 #include <dirent.h>
12569 if eval $compile; then
12570 echo "Yes, it does."
12573 echo "No, it does not."
12578 echo "You don't have a <dirent.h>, so not checking for dd_fd." >&4
12586 : see if this is an sysdir system
12587 set sys/dir.h i_sysdir
12590 : see if this is an sysndir system
12591 set sys/ndir.h i_sysndir
12596 $cat >dirfd.c <<EOM
12598 #$i_stdlib I_STDLIB
12600 #include <stdlib.h>
12602 #$i_dirent I_DIRENT /**/
12603 #$i_sysdir I_SYS_DIR /**/
12604 #$i_sysndir I_SYS_NDIR /**/
12605 #$i_systypes I_SYS_TYPES /**/
12606 #if defined(I_SYS_TYPES)
12607 #include <sys/types.h>
12609 #if defined(I_DIRENT)
12610 #include <dirent.h>
12613 #include <sys/ndir.h>
12617 #include <ndir.h> /* may be wrong in the future */
12619 #include <sys/dir.h>
12625 DIR *dirp = opendir(".");
12626 if (dirfd(dirp) >= 0)
12634 if eval $compile; then
12638 $define) echo "dirfd() found." >&4 ;;
12639 *) echo "dirfd() NOT found." >&4 ;;
12645 : see if dladdr exists
12646 set dladdr d_dladdr
12649 : see if dlerror exists
12652 set dlerror d_dlerror
12656 : see if dlfcn is available
12657 set dlfcn.h i_dlfcn
12660 : Check what extension to use for shared libs
12665 On a few systems, the dynamically loaded modules that perl generates and uses
12666 will need a different extension than shared libs. The default will probably
12672 *) dflt="$dlext" ;;
12674 rp='What is the extension of dynamically loaded modules'
12683 : Check if dlsym need a leading underscore
12689 echo "Checking whether your dlsym() needs a leading underscore ..." >&4
12690 $cat >dyna.c <<'EOM'
12697 #$i_stdlib I_STDLIB
12699 #include <stdlib.h>
12703 #include <dlfcn.h> /* the dynamic linker include file for SunOS/Solaris */
12705 #include <sys/types.h>
12710 extern int fred() ;
12719 int mode = RTLD_LAZY ;
12721 handle = dlopen("./dyna.$dlext", mode) ;
12722 if (handle == NULL) {
12727 symbol = dlsym(handle, "fred") ;
12728 if (symbol == NULL) {
12729 /* try putting a leading underscore */
12730 symbol = dlsym(handle, "_fred") ;
12731 if (symbol == NULL) {
12744 : Call the object file tmp-dyna.o in case dlext=o.
12745 if $cc $ccflags $cccdlflags -c dyna.c > /dev/null 2>&1 &&
12746 mv dyna${_o} tmp-dyna${_o} > /dev/null 2>&1 &&
12747 $ld -o dyna.$dlext $ldflags $lddlflags tmp-dyna${_o} > /dev/null 2>&1 &&
12748 $cc -o fred $ccflags $ldflags $cccdlflags $ccdlflags fred.c $libs > /dev/null 2>&1 && $to dyna.$dlext; then
12751 1) echo "Test program failed using dlopen." >&4
12752 echo "Perhaps you should not use dynamic loading." >&4;;
12753 2) echo "Test program failed using dlsym." >&4
12754 echo "Perhaps you should not use dynamic loading." >&4;;
12755 3) echo "dlsym needs a leading underscore" >&4
12757 4) echo "dlsym doesn't need a leading underscore." >&4;;
12760 echo "I can't compile and run the test program." >&4
12761 echo "I'm guessing that dlsym doesn't need a leading underscore." >&4
12766 $rm -f fred fred.* dyna.$dlext dyna.* tmp-dyna.*
12771 : see if drand48_r exists
12772 set drand48_r d_drand48_r
12774 case "$d_drand48_r" in
12776 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
12777 case "$d_drand48_r_proto:$usethreads" in
12778 ":define") d_drand48_r_proto=define
12779 set d_drand48_r_proto drand48_r $hdrs
12783 case "$d_drand48_r_proto" in
12785 case "$drand48_r_proto" in
12786 ''|0) try='int drand48_r(struct drand48_data*, double*);'
12787 ./protochk "$extern_C $try" $hdrs && drand48_r_proto=I_ST ;;
12789 case "$drand48_r_proto" in
12790 ''|0) d_drand48_r=undef
12792 echo "Disabling drand48_r, cannot determine prototype." >&4 ;;
12793 * ) case "$drand48_r_proto" in
12794 REENTRANT_PROTO*) ;;
12795 *) drand48_r_proto="REENTRANT_PROTO_$drand48_r_proto" ;;
12797 echo "Prototype: $try" ;;
12800 *) case "$usethreads" in
12801 define) echo "drand48_r has no prototype, not using it." >&4 ;;
12808 *) drand48_r_proto=0
12812 : see if prototype for drand48 is available
12814 set d_drand48proto drand48 $i_stdlib stdlib.h $i_unistd unistd.h
12817 : see if dup2 exists
12821 : see if eaccess exists
12822 set eaccess d_eaccess
12825 : see if endgrent exists
12826 set endgrent d_endgrent
12829 : see if this is an grp system
12835 xxx=`./findhdr grp.h`
12836 $cppstdin $cppflags $cppminus < $xxx >$$.h
12838 if $contains 'gr_passwd' $$.h >/dev/null 2>&1; then
12850 set d_grpasswd; eval $setvar
12854 : see if endgrent_r exists
12855 set endgrent_r d_endgrent_r
12857 case "$d_endgrent_r" in
12859 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
12860 case "$d_endgrent_r_proto:$usethreads" in
12861 ":define") d_endgrent_r_proto=define
12862 set d_endgrent_r_proto endgrent_r $hdrs
12866 case "$d_endgrent_r_proto" in
12868 case "$endgrent_r_proto" in
12869 ''|0) try='int endgrent_r(FILE**);'
12870 ./protochk "$extern_C $try" $hdrs && endgrent_r_proto=I_H ;;
12872 case "$endgrent_r_proto" in
12873 ''|0) try='void endgrent_r(FILE**);'
12874 ./protochk "$extern_C $try" $hdrs && endgrent_r_proto=V_H ;;
12876 case "$endgrent_r_proto" in
12877 ''|0) d_endgrent_r=undef
12879 echo "Disabling endgrent_r, cannot determine prototype." >&4 ;;
12880 * ) case "$endgrent_r_proto" in
12881 REENTRANT_PROTO*) ;;
12882 *) endgrent_r_proto="REENTRANT_PROTO_$endgrent_r_proto" ;;
12884 echo "Prototype: $try" ;;
12887 *) case "$usethreads" in
12888 define) echo "endgrent_r has no prototype, not using it." >&4 ;;
12895 *) endgrent_r_proto=0
12899 : see if endhostent exists
12900 set endhostent d_endhent
12903 : see if this is a netdb.h system
12904 set netdb.h i_netdb
12907 : see if endhostent_r exists
12908 set endhostent_r d_endhostent_r
12910 case "$d_endhostent_r" in
12912 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
12913 case "$d_endhostent_r_proto:$usethreads" in
12914 ":define") d_endhostent_r_proto=define
12915 set d_endhostent_r_proto endhostent_r $hdrs
12919 case "$d_endhostent_r_proto" in
12921 case "$endhostent_r_proto" in
12922 ''|0) try='int endhostent_r(struct hostent_data*);'
12923 ./protochk "$extern_C $try" $hdrs && endhostent_r_proto=I_D ;;
12925 case "$endhostent_r_proto" in
12926 ''|0) try='void endhostent_r(struct hostent_data*);'
12927 ./protochk "$extern_C $try" $hdrs && endhostent_r_proto=V_D ;;
12929 case "$endhostent_r_proto" in
12930 ''|0) d_endhostent_r=undef
12931 endhostent_r_proto=0
12932 echo "Disabling endhostent_r, cannot determine prototype." >&4 ;;
12933 * ) case "$endhostent_r_proto" in
12934 REENTRANT_PROTO*) ;;
12935 *) endhostent_r_proto="REENTRANT_PROTO_$endhostent_r_proto" ;;
12937 echo "Prototype: $try" ;;
12940 *) case "$usethreads" in
12941 define) echo "endhostent_r has no prototype, not using it." >&4 ;;
12943 d_endhostent_r=undef
12944 endhostent_r_proto=0
12948 *) endhostent_r_proto=0
12952 : see if endnetent exists
12953 set endnetent d_endnent
12956 : see if endnetent_r exists
12957 set endnetent_r d_endnetent_r
12959 case "$d_endnetent_r" in
12961 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
12962 case "$d_endnetent_r_proto:$usethreads" in
12963 ":define") d_endnetent_r_proto=define
12964 set d_endnetent_r_proto endnetent_r $hdrs
12968 case "$d_endnetent_r_proto" in
12970 case "$endnetent_r_proto" in
12971 ''|0) try='int endnetent_r(struct netent_data*);'
12972 ./protochk "$extern_C $try" $hdrs && endnetent_r_proto=I_D ;;
12974 case "$endnetent_r_proto" in
12975 ''|0) try='void endnetent_r(struct netent_data*);'
12976 ./protochk "$extern_C $try" $hdrs && endnetent_r_proto=V_D ;;
12978 case "$endnetent_r_proto" in
12979 ''|0) d_endnetent_r=undef
12980 endnetent_r_proto=0
12981 echo "Disabling endnetent_r, cannot determine prototype." >&4 ;;
12982 * ) case "$endnetent_r_proto" in
12983 REENTRANT_PROTO*) ;;
12984 *) endnetent_r_proto="REENTRANT_PROTO_$endnetent_r_proto" ;;
12986 echo "Prototype: $try" ;;
12989 *) case "$usethreads" in
12990 define) echo "endnetent_r has no prototype, not using it." >&4 ;;
12992 d_endnetent_r=undef
12993 endnetent_r_proto=0
12997 *) endnetent_r_proto=0
13001 : see if endprotoent exists
13002 set endprotoent d_endpent
13005 : see if endprotoent_r exists
13006 set endprotoent_r d_endprotoent_r
13008 case "$d_endprotoent_r" in
13010 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13011 case "$d_endprotoent_r_proto:$usethreads" in
13012 ":define") d_endprotoent_r_proto=define
13013 set d_endprotoent_r_proto endprotoent_r $hdrs
13017 case "$d_endprotoent_r_proto" in
13019 case "$endprotoent_r_proto" in
13020 ''|0) try='int endprotoent_r(struct protoent_data*);'
13021 ./protochk "$extern_C $try" $hdrs && endprotoent_r_proto=I_D ;;
13023 case "$endprotoent_r_proto" in
13024 ''|0) try='void endprotoent_r(struct protoent_data*);'
13025 ./protochk "$extern_C $try" $hdrs && endprotoent_r_proto=V_D ;;
13027 case "$endprotoent_r_proto" in
13028 ''|0) d_endprotoent_r=undef
13029 endprotoent_r_proto=0
13030 echo "Disabling endprotoent_r, cannot determine prototype." >&4 ;;
13031 * ) case "$endprotoent_r_proto" in
13032 REENTRANT_PROTO*) ;;
13033 *) endprotoent_r_proto="REENTRANT_PROTO_$endprotoent_r_proto" ;;
13035 echo "Prototype: $try" ;;
13038 *) case "$usethreads" in
13039 define) echo "endprotoent_r has no prototype, not using it." >&4 ;;
13041 d_endprotoent_r=undef
13042 endprotoent_r_proto=0
13046 *) endprotoent_r_proto=0
13050 : see if endpwent exists
13051 set endpwent d_endpwent
13054 : see if this is a pwd.h system
13060 xxx=`./findhdr pwd.h`
13061 $cppstdin $cppflags $cppminus < $xxx >$$.h
13063 if $contains 'pw_quota' $$.h >/dev/null 2>&1; then
13071 if $contains 'pw_age' $$.h >/dev/null 2>&1; then
13079 if $contains 'pw_change' $$.h >/dev/null 2>&1; then
13087 if $contains 'pw_class' $$.h >/dev/null 2>&1; then
13095 if $contains 'pw_expire' $$.h >/dev/null 2>&1; then
13103 if $contains 'pw_comment' $$.h >/dev/null 2>&1; then
13111 if $contains 'pw_gecos' $$.h >/dev/null 2>&1; then
13119 if $contains 'pw_passwd' $$.h >/dev/null 2>&1; then
13131 set d_pwquota; eval $setvar
13132 set d_pwage; eval $setvar
13133 set d_pwchange; eval $setvar
13134 set d_pwclass; eval $setvar
13135 set d_pwexpire; eval $setvar
13136 set d_pwcomment; eval $setvar
13137 set d_pwgecos; eval $setvar
13138 set d_pwpasswd; eval $setvar
13142 : see if endpwent_r exists
13143 set endpwent_r d_endpwent_r
13145 case "$d_endpwent_r" in
13147 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
13148 case "$d_endpwent_r_proto:$usethreads" in
13149 ":define") d_endpwent_r_proto=define
13150 set d_endpwent_r_proto endpwent_r $hdrs
13154 case "$d_endpwent_r_proto" in
13156 case "$endpwent_r_proto" in
13157 ''|0) try='int endpwent_r(FILE**);'
13158 ./protochk "$extern_C $try" $hdrs && endpwent_r_proto=I_H ;;
13160 case "$endpwent_r_proto" in
13161 ''|0) try='void endpwent_r(FILE**);'
13162 ./protochk "$extern_C $try" $hdrs && endpwent_r_proto=V_H ;;
13164 case "$endpwent_r_proto" in
13165 ''|0) d_endpwent_r=undef
13167 echo "Disabling endpwent_r, cannot determine prototype." >&4 ;;
13168 * ) case "$endpwent_r_proto" in
13169 REENTRANT_PROTO*) ;;
13170 *) endpwent_r_proto="REENTRANT_PROTO_$endpwent_r_proto" ;;
13172 echo "Prototype: $try" ;;
13175 *) case "$usethreads" in
13176 define) echo "endpwent_r has no prototype, not using it." >&4 ;;
13183 *) endpwent_r_proto=0
13187 : see if endservent exists
13188 set endservent d_endsent
13191 : see if endservent_r exists
13192 set endservent_r d_endservent_r
13194 case "$d_endservent_r" in
13196 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13197 case "$d_endservent_r_proto:$usethreads" in
13198 ":define") d_endservent_r_proto=define
13199 set d_endservent_r_proto endservent_r $hdrs
13203 case "$d_endservent_r_proto" in
13205 case "$endservent_r_proto" in
13206 ''|0) try='int endservent_r(struct servent_data*);'
13207 ./protochk "$extern_C $try" $hdrs && endservent_r_proto=I_D ;;
13209 case "$endservent_r_proto" in
13210 ''|0) try='void endservent_r(struct servent_data*);'
13211 ./protochk "$extern_C $try" $hdrs && endservent_r_proto=V_D ;;
13213 case "$endservent_r_proto" in
13214 ''|0) d_endservent_r=undef
13215 endservent_r_proto=0
13216 echo "Disabling endservent_r, cannot determine prototype." >&4 ;;
13217 * ) case "$endservent_r_proto" in
13218 REENTRANT_PROTO*) ;;
13219 *) endservent_r_proto="REENTRANT_PROTO_$endservent_r_proto" ;;
13221 echo "Prototype: $try" ;;
13224 *) case "$usethreads" in
13225 define) echo "endservent_r has no prototype, not using it." >&4 ;;
13227 d_endservent_r=undef
13228 endservent_r_proto=0
13232 *) endservent_r_proto=0
13236 : Locate the flags for 'open()'
13239 #include <sys/types.h>
13244 #include <sys/file.h>
13246 #$i_stdlib I_STDLIB
13248 #include <stdlib.h>
13259 : check sys/file.h first to get FREAD on Sun
13260 if $test `./findhdr sys/file.h` && \
13261 set try -DI_SYS_FILE && eval $compile; then
13263 echo "<sys/file.h> defines the O_* constants..." >&4
13264 if $run ./try; then
13265 echo "and you have the 3 argument form of open()." >&4
13268 echo "but not the 3 argument form of open(). Oh, well." >&4
13271 elif $test `./findhdr fcntl.h` && \
13272 set try -DI_FCNTL && eval $compile; then
13274 echo "<fcntl.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
13284 echo "I can't find the O_* constant definitions! You got problems." >&4
13290 : see if this is a sys/file.h system
13295 : do we need to include sys/file.h ?
13299 if $h_sysfile; then
13301 echo "We'll be including <sys/file.h>." >&4
13304 echo "We won't be including <sys/file.h>." >&4
13314 : see if fcntl.h is there
13319 : see if we can include fcntl.h
13325 echo "We'll be including <fcntl.h>." >&4
13328 if $h_sysfile; then
13329 echo "We don't need to include <fcntl.h> if we include <sys/file.h>." >&4
13331 echo "We won't be including <fcntl.h>." >&4
13343 : see if fork exists
13347 : see if pipe exists
13351 : check for non-blocking I/O stuff
13352 case "$h_sysfile" in
13353 true) echo "#include <sys/file.h>" > head.c;;
13356 true) echo "#include <fcntl.h>" > head.c;;
13357 *) echo "#include <sys/fcntl.h>" > head.c;;
13362 echo "Figuring out the flag used by open() for non-blocking I/O..." >&4
13363 case "$o_nonblock" in
13365 $cat head.c > try.c
13366 $cat >>try.c <<EOCP
13368 #$i_stdlib I_STDLIB
13370 #include <stdlib.h>
13378 printf("O_NONBLOCK\n");
13382 printf("O_NDELAY\n");
13386 printf("FNDELAY\n");
13393 if eval $compile_ok; then
13394 o_nonblock=`$run ./try`
13395 case "$o_nonblock" in
13396 '') echo "I can't figure it out, assuming O_NONBLOCK will do.";;
13397 *) echo "Seems like we can use $o_nonblock.";;
13400 echo "(I can't compile the test program; pray O_NONBLOCK is right!)"
13403 *) echo "Using $hint value $o_nonblock.";;
13408 echo "Let's see what value errno gets from read() on a $o_nonblock file..." >&4
13411 case "$d_fork:$d_pipe:$d_alarm" in
13412 define:define:define)
13413 $cat head.c > try.c
13414 $cat >>try.c <<EOCP
13416 #include <sys/types.h>
13417 #include <signal.h>
13419 #$i_stdlib I_STDLIB
13421 #include <stdlib.h>
13427 #define MY_O_NONBLOCK $o_nonblock
13428 #ifndef errno /* XXX need better Configure test */
13431 #$i_unistd I_UNISTD
13433 #include <unistd.h>
13435 #$i_string I_STRING
13437 #include <string.h>
13439 #include <strings.h>
13441 $signal_t blech(int x) { exit(3); }
13443 $cat >> try.c <<'EOCP'
13452 ret = pipe(pd); /* Down: child -> parent */
13455 ret = pipe(pu); /* Up: parent -> child */
13459 close(pd[1]); /* Parent reads from pd[0] */
13460 close(pu[0]); /* Parent writes (blocking) to pu[1] */
13462 if (-1 == fcntl(pd[0], F_SETFL, MY_O_NONBLOCK))
13467 signal(SIGALRM, blech);
13469 if ((ret = read(pd[0], buf, 1)) > 0) /* Nothing to read! */
13471 sprintf(string, "%d\n", ret);
13472 ret = write(2, string, strlen(string));
13473 if (ret != strlen(string))
13477 if (errno == EAGAIN) {
13478 printf("EAGAIN\n");
13483 if (errno == EWOULDBLOCK)
13484 printf("EWOULDBLOCK\n");
13487 ret = write(pu[1], buf, 1); /* Unblocks child, tell it to close our pipe */
13490 sleep(2); /* Give it time to close our pipe */
13492 ret = read(pd[0], buf, 1); /* Should read EOF */
13494 sprintf(string, "%d\n", ret);
13495 ret = write(4, string, strlen(string));
13496 if (ret != strlen(string))
13501 close(pd[0]); /* We write to pd[1] */
13502 close(pu[1]); /* We read from pu[0] */
13503 ret = read(pu[0], buf, 1); /* Wait for parent to signal us we may continue */
13506 close(pd[1]); /* Pipe pd is now fully closed! */
13507 exit(0); /* Bye bye, thank you for playing! */
13511 if eval $compile_ok; then
13512 echo "$startsh" >mtry
13513 echo "$run ./try >try.out 2>try.ret 4>try.err || exit 4" >>mtry
13515 $run ./mtry >/dev/null 2>&1
13517 0) eagain=`$cat try.out`;;
13518 1) echo "Could not perform non-blocking setting!";;
13519 2) echo "I did a successful read() for something that was not there!";;
13520 3) echo "Hmm... non-blocking I/O does not seem to be working!";;
13521 4) echo "Could not find F_SETFL!";;
13522 *) echo "Something terribly wrong happened during testing.";;
13524 rd_nodata=`$cat try.ret`
13525 echo "A read() system call with no data present returns $rd_nodata."
13526 case "$rd_nodata" in
13529 echo "(That's peculiar, fixing that to be -1.)"
13535 echo "Forcing errno EAGAIN on read() with no data available."
13539 echo "Your read() sets errno to $eagain when no data is available."
13542 status=`$cat try.err`
13544 0) echo "And it correctly returns 0 to signal EOF.";;
13545 -1) echo "But it also returns -1 to signal EOF, so be careful!";;
13546 *) echo "However, your read() returns '$status' on EOF??";;
13549 if test "$status" = "$rd_nodata"; then
13550 echo "WARNING: you can't distinguish between EOF and no data!"
13554 echo "I can't compile the test program--assuming errno EAGAIN will do."
13558 *) echo "Can't figure out how to test this--assuming errno EAGAIN will do."
13567 echo "Using $hint value $eagain."
13568 echo "Your read() returns $rd_nodata when no data is present."
13569 case "$d_eofnblk" in
13570 "$define") echo "And you can see EOF because read() returns 0.";;
13571 "$undef") echo "But you can't see EOF status from read() returned value.";;
13573 echo "(Assuming you can't see EOF status from read anyway.)"
13579 $rm_try head.c mtry
13581 : see if erf exists
13585 : see if erfc exists
13589 : see if exp2 exists
13593 : see if expm1 exists
13597 : see if _ptr and _cnt from stdio act std
13600 if $contains '_lbfsize' `./findhdr stdio.h` >/dev/null 2>&1 ; then
13601 echo "(Looks like you have stdio.h from BSD.)"
13602 case "$stdio_ptr" in
13603 '') stdio_ptr='((fp)->_p)'
13606 *) ptr_lval=$d_stdio_ptr_lval;;
13608 case "$stdio_cnt" in
13609 '') stdio_cnt='((fp)->_r)'
13612 *) cnt_lval=$d_stdio_cnt_lval;;
13614 case "$stdio_base" in
13615 '') stdio_base='((fp)->_ub._base ? (fp)->_ub._base : (fp)->_bf._base)';;
13617 case "$stdio_bufsiz" in
13618 '') stdio_bufsiz='((fp)->_ub._base ? (fp)->_ub._size : (fp)->_bf._size)';;
13620 elif $contains '_IO_fpos_t' `./findhdr stdio.h` `./findhdr libio.h` >/dev/null 2>&1 ; then
13621 echo "(Looks like you have stdio.h from Linux.)"
13622 case "$stdio_ptr" in
13623 '') stdio_ptr='((fp)->_IO_read_ptr)'
13626 *) ptr_lval=$d_stdio_ptr_lval;;
13628 case "$stdio_cnt" in
13629 '') stdio_cnt='((fp)->_IO_read_end - (fp)->_IO_read_ptr)'
13632 *) cnt_lval=$d_stdio_cnt_lval;;
13634 case "$stdio_base" in
13635 '') stdio_base='((fp)->_IO_read_base)';;
13637 case "$stdio_bufsiz" in
13638 '') stdio_bufsiz='((fp)->_IO_read_end - (fp)->_IO_read_base)';;
13641 case "$stdio_ptr" in
13642 '') stdio_ptr='((fp)->_ptr)'
13645 *) ptr_lval=$d_stdio_ptr_lval;;
13647 case "$stdio_cnt" in
13648 '') stdio_cnt='((fp)->_cnt)'
13651 *) cnt_lval=$d_stdio_cnt_lval;;
13653 case "$stdio_base" in
13654 '') stdio_base='((fp)->_base)';;
13656 case "$stdio_bufsiz" in
13657 '') stdio_bufsiz='((fp)->_cnt + (fp)->_ptr - (fp)->_base)';;
13661 : test whether _ptr and _cnt really work
13662 echo "Checking how std your stdio is..." >&4
13665 #$i_stdlib I_STDLIB
13667 #include <stdlib.h>
13669 #define FILE_ptr(fp) $stdio_ptr
13670 #define FILE_cnt(fp) $stdio_cnt
13672 FILE *fp = fopen("try.c", "r");
13675 18 <= FILE_cnt(fp) &&
13676 strncmp(FILE_ptr(fp), "include <stdio.h>\n", 18) == 0
13684 if eval $compile && $to try.c; then
13685 if $run ./try; then
13686 echo "Your stdio acts pretty std."
13689 echo "Your stdio isn't very std."
13692 echo "Your stdio doesn't appear very std."
13696 # glibc 2.2.90 and above apparently change stdio streams so Perl's
13697 # direct buffer manipulation no longer works. The Configure tests
13698 # should be changed to correctly detect this, but until then,
13699 # the following check should at least let perl compile and run.
13700 # (This quick fix should be updated before 5.8.1.)
13701 # To be defensive, reject all unknown versions, and all versions > 2.2.9.
13702 # A. Dougherty, June 3, 2002.
13703 case "$d_gnulibc" in
13705 case "$gnulibc_version" in
13709 *) echo "But I will not snoop inside glibc $gnulibc_version stdio buffers."
13718 : Can _ptr be used as an lvalue?
13719 case "$d_stdstdio$ptr_lval" in
13720 $define$define) val=$define ;;
13723 set d_stdio_ptr_lval
13726 : Can _cnt be used as an lvalue?
13727 case "$d_stdstdio$cnt_lval" in
13728 $define$define) val=$define ;;
13731 set d_stdio_cnt_lval
13735 : test whether setting _ptr sets _cnt as a side effect
13736 d_stdio_ptr_lval_sets_cnt="$undef"
13737 d_stdio_ptr_lval_nochange_cnt="$undef"
13738 case "$d_stdio_ptr_lval$d_stdstdio" in
13740 echo "Checking to see what happens if we set the stdio ptr..." >&4
13743 /* Can we scream? */
13744 /* Eat dust sed :-) */
13745 /* In the buffer space, no one can hear you scream. */
13746 #$i_stdlib I_STDLIB
13748 #include <stdlib.h>
13750 #define FILE_ptr(fp) $stdio_ptr
13751 #define FILE_cnt(fp) $stdio_cnt
13752 #include <sys/types.h>
13754 FILE *fp = fopen("try.c", "r");
13759 puts("Fail even to read");
13762 c = getc(fp); /* Read away the first # */
13764 puts("Fail even to read");
13768 18 <= FILE_cnt(fp) &&
13769 strncmp(FILE_ptr(fp), "include <stdio.h>\n", 18) == 0
13771 puts("Fail even to read");
13774 ptr = (char*) FILE_ptr(fp);
13775 cnt = (size_t)FILE_cnt(fp);
13777 FILE_ptr(fp) += 42;
13779 if ((char*)FILE_ptr(fp) != (ptr + 42)) {
13780 printf("Fail ptr check %p != %p", FILE_ptr(fp), (ptr + 42));
13783 if (FILE_cnt(fp) <= 20) {
13784 printf ("Fail (<20 chars to test)");
13787 if (strncmp(FILE_ptr(fp), "Eat dust sed :-) */\n", 20) != 0) {
13788 puts("Fail compare");
13791 if (cnt == FILE_cnt(fp)) {
13792 puts("Pass_unchanged");
13795 if (FILE_cnt(fp) == (cnt - 42)) {
13796 puts("Pass_changed");
13799 printf("Fail count was %d now %d\n", cnt, FILE_cnt(fp));
13805 if eval $compile && $to try.c; then
13806 case `$run ./try` in
13808 echo "Increasing ptr in your stdio decreases cnt by the same amount. Good." >&4
13809 d_stdio_ptr_lval_sets_cnt="$define" ;;
13811 echo "Increasing ptr in your stdio leaves cnt unchanged. Good." >&4
13812 d_stdio_ptr_lval_nochange_cnt="$define" ;;
13814 echo "Increasing ptr in your stdio didn't do exactly what I expected. We'll not be doing that then." >&4 ;;
13816 echo "It appears attempting to set ptr in your stdio is a bad plan." >&4 ;;
13819 echo "It seems we can't set ptr in your stdio. Nevermind." >&4
13825 : see if _base is also standard
13827 case "$d_stdstdio" in
13831 #$i_stdlib I_STDLIB
13833 #include <stdlib.h>
13835 #define FILE_base(fp) $stdio_base
13836 #define FILE_bufsiz(fp) $stdio_bufsiz
13838 FILE *fp = fopen("try.c", "r");
13841 19 <= FILE_bufsiz(fp) &&
13842 strncmp(FILE_base(fp), "#include <stdio.h>\n", 19) == 0
13849 if eval $compile && $to try.c; then
13850 if $run ./try; then
13851 echo "And its _base field acts std."
13854 echo "But its _base field isn't std."
13857 echo "However, it seems to be lacking the _base field."
13865 : see if fast_stdio exists
13867 case "$d_stdstdio:$d_stdio_ptr_lval" in
13869 case "$d_stdio_cnt_lval$d_stdio_ptr_lval_sets_cnt" in
13871 echo "You seem to have 'fast stdio' to directly manipulate the stdio buffers." >& 4
13882 : see if fchdir exists
13883 set fchdir d_fchdir
13886 : see if fchmod exists
13887 set fchmod d_fchmod
13890 : see if fchown exists
13891 set fchown d_fchown
13894 : see if this is an fcntl system
13898 : See if fcntl-based locking works.
13901 #$i_stdlib I_STDLIB
13903 #include <stdlib.h>
13905 #include <unistd.h>
13907 #include <signal.h>
13908 $signal_t blech(int x) { exit(3); }
13910 #if defined(F_SETLK) && defined(F_SETLKW)
13911 struct flock flock;
13913 fd = open("try.c", O_RDONLY);
13914 flock.l_type = F_RDLCK;
13915 flock.l_whence = SEEK_SET;
13916 flock.l_start = flock.l_len = 0;
13917 signal(SIGALRM, blech);
13919 retval = fcntl(fd, F_SETLK, &flock);
13921 (retval < 0 ? exit(2) : exit(0));
13927 echo "Checking if fcntl-based file locking works... "
13931 if eval $compile_ok; then
13932 if $run ./try; then
13933 echo "Yes, it seems to work."
13936 echo "Nope, it didn't work."
13941 *** I had to forcibly timeout from fcntl(..., F_SETLK, ...).
13942 *** This is (almost) impossible.
13943 *** If your NFS lock daemons are not feeling well, something like
13944 *** this may happen, please investigate. Cannot continue, aborting.
13952 echo "I'm unable to compile the test program, so I'll assume not."
13957 echo "Nope, since you don't even have fcntl()."
13960 set d_fcntl_can_lock
13964 : check for fd_set items
13967 Checking to see how well your C compiler handles fd_set and friends ...
13970 #$i_stdlib I_STDLIB
13972 #include <stdlib.h>
13974 #$i_systime I_SYS_TIME
13975 #$i_sysselct I_SYS_SELECT
13976 #$d_socket HAS_SOCKET
13977 #include <sys/types.h>
13979 #include <sys/socket.h> /* Might include <sys/bsdtypes.h> */
13982 #include <sys/time.h>
13984 #ifdef I_SYS_SELECT
13985 #include <sys/select.h>
13994 #if defined(FD_SET) && defined(FD_CLR) && defined(FD_ISSET) && defined(FD_ZERO)
14002 if eval $compile; then
14003 d_fds_bits="$define"
14005 echo "Well, your system knows about the normal fd_set typedef..." >&4
14006 if $run ./try; then
14007 echo "and you have the normal fd_set macros (just as I'd expect)." >&4
14008 d_fd_macros="$define"
14011 but not the normal fd_set macros! Gaaack! I'll have to cover for you.
14013 d_fd_macros="$undef"
14017 Hmm, your compiler has some difficulty with fd_set. Checking further...
14020 if eval $compile; then
14021 d_fds_bits="$undef"
14023 echo "Well, your system has some sort of fd_set available..." >&4
14024 if $run ./try; then
14025 echo "and you have the normal fd_set macros." >&4
14026 d_fd_macros="$define"
14029 but not the normal fd_set macros! Gross! More work for me...
14031 d_fd_macros="$undef"
14034 echo "Well, you got zip. That's OK, I can roll my own fd_set stuff." >&4
14036 d_fds_bits="$undef"
14037 d_fd_macros="$undef"
14042 : see if fdclose exists
14043 set fdclose d_fdclose
14046 : see if fdim exists
14050 : see if fegetround exists
14051 set fegetround d_fegetround
14054 : see if fgetpos exists
14055 set fgetpos d_fgetpos
14058 : see if finite exists
14059 set finite d_finite
14062 : see if finitel exists
14063 set finitel d_finitel
14066 : see if flock exists
14070 : see if prototype for flock is available
14072 set d_flockproto flock $i_sysfile sys/file.h
14075 : see if fma exists
14079 : see if fmax exists
14083 : see if fmin exists
14087 : see if fp_class exists
14088 set fp_class d_fp_class
14091 : see if this is a math.h system
14095 : check for fpclassify
14096 echo "Checking to see if you have fpclassify..." >&4
14102 int main() { return fpclassify(1.0) == FP_NORMAL ? 0 : 1; }
14105 if eval $compile; then
14107 echo "You have fpclassify."
14110 echo "You do not have fpclassify."
14116 : see if fp_classify exists
14117 set fp_classify d_fp_classify
14120 : see if fp_classl exists
14121 set fp_classl d_fp_classl
14124 : see if pathconf exists
14125 set pathconf d_pathconf
14128 : see if fpathconf exists
14129 set fpathconf d_fpathconf
14132 : see if fpclass exists
14133 set fpclass d_fpclass
14136 : see if fpclassl exists
14137 set fpclassl d_fpclassl
14140 : see if fpgetround exists
14141 set fpgetround d_fpgetround
14144 : check for fpos64_t
14146 echo "Checking to see if you have fpos64_t..." >&4
14149 int main() { fpos64_t x = 7; }
14152 if eval $compile; then
14154 echo "You have fpos64_t."
14157 echo "You do not have fpos64_t."
14158 case "$fpossize" in
14159 8) echo "(Your fpos_t is 64 bits, so you could use that.)" ;;
14166 : see if this is an xlocale.h system
14167 set xlocale.h i_xlocale
14170 : see if newlocale exists
14171 set newlocale d_newlocale
14174 : see if freelocale exists
14175 set freelocale d_freelocale
14178 : see if uselocale exists
14179 set uselocale d_uselocale
14182 : see if duplocale exists
14183 set duplocale d_duplocale
14186 : see if querylocale exists
14187 set querylocale d_querylocale
14190 : see if frexpl exists
14191 set frexpl d_frexpl
14194 : see if this is a sys/param system
14195 set sys/param.h i_sysparam
14198 : see if this is a sys/mount.h system
14199 set sys/mount.h i_sysmount
14202 : Check for fs_data_s
14204 echo "Checking to see if your system supports struct fs_data..." >&4
14205 set d_fs_data_s fs_data $i_systypes sys/types.h $i_sysparam sys/param.h $i_sysmount sys/mount.h
14207 case "$d_fs_data_s" in
14208 "$define") echo "Yes, it does." ;;
14209 *) echo "No, it doesn't." ;;
14212 : see if fseeko exists
14213 set fseeko d_fseeko
14215 case "$longsize" in
14216 8) echo "(Your long is 64 bits, so you could use fseek.)" ;;
14219 : see if fsetpos exists
14220 set fsetpos d_fsetpos
14223 : see if fstatfs exists
14224 set fstatfs d_fstatfs
14227 : see if statvfs exists
14228 set statvfs d_statvfs
14231 : see if fstatvfs exists
14232 set fstatvfs d_fstatvfs
14236 : see if fsync exists
14240 : see if ftello exists
14241 set ftello d_ftello
14243 case "$longsize" in
14244 8) echo "(Your long is 64 bits, so you could use ftell.)" ;;
14247 : check for a working futimes
14250 echo "Checking if you have a working futimes()" >&4
14253 #include <sys/time.h>
14260 fd = open ("try.c", O_RDWR);
14261 if (-1 == fd) exit (1);
14262 rv = futimes (fd, NULL);
14263 exit (rv == -1 ? errno : 0);
14267 if eval $compile; then
14271 0) echo "Yes, you have" >&4
14272 d_futimes="$define"
14274 *) echo "No, you have futimes, but it isn't working ($rc) (probably harmless)" >&4
14278 echo "No, it does not (probably harmless)" >&4
14282 : see if ndbm.h is available
14285 : Compatibility location for RedHat 7.1
14286 set gdbm/ndbm.h i_gdbmndbm
14288 : Compatibility location for Debian 4.0
14289 set gdbm-ndbm.h i_gdbm_ndbm
14293 if $test "$i_ndbm" = "$define" -o "$i_gdbmndbm" = "$define" -o "$i_gdbm_ndbm" = "$define"; then
14294 : see if dbm_open exists
14295 set dbm_open d_dbm_open
14297 case "$d_dbm_open" in
14300 i_gdbmndbm="$undef"
14301 i_gdbm_ndbm="$undef"
14302 echo "We won't be including <ndbm.h>"
14312 ndbm_hdr_protochk='name=$1; hdr=$2;
14313 eval "ihdr=\$""i_$name";
14315 if $test "$ihdr" = "$define"; then
14316 $echo "Checking if your <$hdr> uses prototypes..." >&4;
14317 case "$d_cplusplus" in
14318 $define) ./protochk "$extern_C void dbm_close(DBM *);" literal "extern \"C\" {" $ihdr $hdr literal "}" && val="$define" ;;
14319 *) ./protochk "$extern_C void dbm_close(int, int);" $ihdr $hdr || val="$define" ;;
14322 $define) $echo "Your <$hdr> seems to have prototypes";;
14323 *) $echo "Your <$hdr> does not seem to have prototypes";;
14326 set "d_${name}_h_uses_prototypes";
14330 eval $ndbm_hdr_protochk
14331 set gdbmndbm gdbm/ndbm.h
14332 eval $ndbm_hdr_protochk
14333 set gdbm_ndbm gdbm-ndbm.h
14334 eval $ndbm_hdr_protochk
14336 : see if getaddrinfo exists
14337 set getaddrinfo d_getaddrinfo
14340 : see if getcwd exists
14341 set getcwd d_getcwd
14344 : see if getespwnam exists
14345 set getespwnam d_getespwnam
14348 : see if getfsstat exists
14349 set getfsstat d_getfsstat
14352 : see if getgrent exists
14353 set getgrent d_getgrent
14356 : see if getgrent_r exists
14357 set getgrent_r d_getgrent_r
14359 case "$d_getgrent_r" in
14361 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
14362 case "$d_getgrent_r_proto:$usethreads" in
14363 ":define") d_getgrent_r_proto=define
14364 set d_getgrent_r_proto getgrent_r $hdrs
14368 case "$d_getgrent_r_proto" in
14370 case "$getgrent_r_proto" in
14371 ''|0) try='int getgrent_r(struct group*, char*, size_t, struct group**);'
14372 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=I_SBWR ;;
14374 case "$getgrent_r_proto" in
14375 ''|0) try='int getgrent_r(struct group*, char*, int, struct group**);'
14376 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=I_SBIR ;;
14378 case "$getgrent_r_proto" in
14379 ''|0) try='struct group* getgrent_r(struct group*, char*, size_t);'
14380 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=S_SBW ;;
14382 case "$getgrent_r_proto" in
14383 ''|0) try='struct group* getgrent_r(struct group*, char*, int);'
14384 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=S_SBI ;;
14386 case "$getgrent_r_proto" in
14387 ''|0) try='int getgrent_r(struct group*, char*, int);'
14388 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=I_SBI ;;
14390 case "$getgrent_r_proto" in
14391 ''|0) try='int getgrent_r(struct group*, char*, int, FILE**);'
14392 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=I_SBIH ;;
14394 case "$getgrent_r_proto" in
14395 ''|0) d_getgrent_r=undef
14397 echo "Disabling getgrent_r, cannot determine prototype." >&4 ;;
14398 * ) case "$getgrent_r_proto" in
14399 REENTRANT_PROTO*) ;;
14400 *) getgrent_r_proto="REENTRANT_PROTO_$getgrent_r_proto" ;;
14402 echo "Prototype: $try" ;;
14405 *) case "$usethreads" in
14406 define) echo "getgrent_r has no prototype, not using it." >&4 ;;
14413 *) getgrent_r_proto=0
14417 : see if getgrgid_r exists
14418 set getgrgid_r d_getgrgid_r
14420 case "$d_getgrgid_r" in
14422 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
14423 case "$d_getgrgid_r_proto:$usethreads" in
14424 ":define") d_getgrgid_r_proto=define
14425 set d_getgrgid_r_proto getgrgid_r $hdrs
14429 case "$d_getgrgid_r_proto" in
14431 case "$getgrgid_r_proto" in
14432 ''|0) try='int getgrgid_r(gid_t, struct group*, char*, size_t, struct group**);'
14433 ./protochk "$extern_C $try" $hdrs && getgrgid_r_proto=I_TSBWR ;;
14435 case "$getgrgid_r_proto" in
14436 ''|0) try='int getgrgid_r(gid_t, struct group*, char*, int, struct group**);'
14437 ./protochk "$extern_C $try" $hdrs && getgrgid_r_proto=I_TSBIR ;;
14439 case "$getgrgid_r_proto" in
14440 ''|0) try='int getgrgid_r(gid_t, struct group*, char*, int);'
14441 ./protochk "$extern_C $try" $hdrs && getgrgid_r_proto=I_TSBI ;;
14443 case "$getgrgid_r_proto" in
14444 ''|0) try='struct group* getgrgid_r(gid_t, struct group*, char*, int);'
14445 ./protochk "$extern_C $try" $hdrs && getgrgid_r_proto=S_TSBI ;;
14447 case "$getgrgid_r_proto" in
14448 ''|0) d_getgrgid_r=undef
14450 echo "Disabling getgrgid_r, cannot determine prototype." >&4 ;;
14451 * ) case "$getgrgid_r_proto" in
14452 REENTRANT_PROTO*) ;;
14453 *) getgrgid_r_proto="REENTRANT_PROTO_$getgrgid_r_proto" ;;
14455 echo "Prototype: $try" ;;
14458 *) case "$usethreads" in
14459 define) echo "getgrgid_r has no prototype, not using it." >&4 ;;
14466 *) getgrgid_r_proto=0
14470 : see if getgrnam_r exists
14471 set getgrnam_r d_getgrnam_r
14473 case "$d_getgrnam_r" in
14475 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
14476 case "$d_getgrnam_r_proto:$usethreads" in
14477 ":define") d_getgrnam_r_proto=define
14478 set d_getgrnam_r_proto getgrnam_r $hdrs
14482 case "$d_getgrnam_r_proto" in
14484 case "$getgrnam_r_proto" in
14485 ''|0) try='int getgrnam_r(const char*, struct group*, char*, size_t, struct group**);'
14486 ./protochk "$extern_C $try" $hdrs && getgrnam_r_proto=I_CSBWR ;;
14488 case "$getgrnam_r_proto" in
14489 ''|0) try='int getgrnam_r(const char*, struct group*, char*, int, struct group**);'
14490 ./protochk "$extern_C $try" $hdrs && getgrnam_r_proto=I_CSBIR ;;
14492 case "$getgrnam_r_proto" in
14493 ''|0) try='struct group* getgrnam_r(const char*, char*, int);'
14494 ./protochk "$extern_C $try" $hdrs && getgrnam_r_proto=S_CBI ;;
14496 case "$getgrnam_r_proto" in
14497 ''|0) try='int getgrnam_r(const char*, struct group*, char*, int);'
14498 ./protochk "$extern_C $try" $hdrs && getgrnam_r_proto=I_CSBI ;;
14500 case "$getgrnam_r_proto" in
14501 ''|0) try='struct group* getgrnam_r(const char*, struct group*, char*, int);'
14502 ./protochk "$extern_C $try" $hdrs && getgrnam_r_proto=S_CSBI ;;
14504 case "$getgrnam_r_proto" in
14505 ''|0) d_getgrnam_r=undef
14507 echo "Disabling getgrnam_r, cannot determine prototype." >&4 ;;
14508 * ) case "$getgrnam_r_proto" in
14509 REENTRANT_PROTO*) ;;
14510 *) getgrnam_r_proto="REENTRANT_PROTO_$getgrnam_r_proto" ;;
14512 echo "Prototype: $try" ;;
14515 *) case "$usethreads" in
14516 define) echo "getgrnam_r has no prototype, not using it." >&4 ;;
14523 *) getgrnam_r_proto=0
14527 : see if gethostbyaddr exists
14528 set gethostbyaddr d_gethbyaddr
14531 : see if gethostbyname exists
14532 set gethostbyname d_gethbyname
14535 : see if gethostent exists
14536 set gethostent d_gethent
14539 : see how we will look up host name
14542 if set gethostname val -f d_gethname; eval $csym; $val; then
14543 echo 'gethostname() found.' >&4
14544 d_gethname="$define"
14547 if set uname val -f d_uname; eval $csym; $val; then
14550 uname() was found, but you're running xenix, and older versions of xenix
14551 have a broken uname(). If you don't really know whether your xenix is old
14552 enough to have a broken system call, use the default answer.
14557 "$define") dflt=n;;
14559 rp='Is your uname() broken?'
14562 n*) d_uname="$define"; call=uname;;
14565 echo 'uname() found.' >&4
14572 case "$d_gethname" in
14573 '') d_gethname="$undef";;
14576 '') d_uname="$undef";;
14578 case "$d_uname$d_gethname" in
14583 Every now and then someone has a $call() that lies about the hostname
14584 but can't be fixed for political or economic reasons. If you wish, I can
14585 pretend $call() isn't there and maybe compute hostname at run-time
14586 thanks to the '$phostname' command.
14589 rp="Shall I ignore $call() from now on?"
14592 y*) d_uname="$undef" d_gethname="$undef"; $echo $n "Okay...$c";;
14595 case "$phostname" in
14596 '') aphostname='';;
14597 *) case "$aphostname" in
14599 *) set X $phostname
14603 file=`./loc $file $file $pth`
14604 aphostname=`echo $file $*`
14609 case "$d_uname$d_gethname" in
14612 case "$phostname" in
14614 echo "There will be no way for $package to get your hostname." >&4;;
14616 echo "I'll use 'popen("'"'$aphostname'", "r")'"' to get your hostname." >&4
14620 case "$d_phostname" in
14621 '') d_phostname="$undef";;
14624 : see if gethostbyaddr_r exists
14625 set gethostbyaddr_r d_gethostbyaddr_r
14627 case "$d_gethostbyaddr_r" in
14629 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14630 case "$d_gethostbyaddr_r_proto:$usethreads" in
14631 ":define") d_gethostbyaddr_r_proto=define
14632 set d_gethostbyaddr_r_proto gethostbyaddr_r $hdrs
14636 case "$d_gethostbyaddr_r_proto" in
14638 case "$gethostbyaddr_r_proto" in
14639 ''|0) try='int gethostbyaddr_r(const char*, size_t, int, struct hostent*, char*, size_t, struct hostent**, int*);'
14640 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=I_CWISBWRE ;;
14642 case "$gethostbyaddr_r_proto" in
14643 ''|0) try='struct hostent* gethostbyaddr_r(const char*, size_t, int, struct hostent*, char*, size_t, int, int*);'
14644 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_CWISBWIE ;;
14646 case "$gethostbyaddr_r_proto" in
14647 ''|0) try='struct hostent* gethostbyaddr_r(const char*, size_t, int, struct hostent*, char*, int, int*);'
14648 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_CWISBIE ;;
14650 case "$gethostbyaddr_r_proto" in
14651 ''|0) try='struct hostent* gethostbyaddr_r(const void*, size_t, int, struct hostent*, char*, int, int*);'
14652 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_TWISBIE ;;
14654 case "$gethostbyaddr_r_proto" in
14655 ''|0) try='struct hostent* gethostbyaddr_r(const char*, int, int, struct hostent*, char*, int, int*);'
14656 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_CIISBIE ;;
14658 case "$gethostbyaddr_r_proto" in
14659 ''|0) try='struct hostent* gethostbyaddr_r(const char*, struct hostent*, char*, int, int*);'
14660 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_CSBIE ;;
14662 case "$gethostbyaddr_r_proto" in
14663 ''|0) try='struct hostent* gethostbyaddr_r(const void*, struct hostent*, char*, int, int*);'
14664 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_TSBIE ;;
14666 case "$gethostbyaddr_r_proto" in
14667 ''|0) try='int gethostbyaddr_r(const char*, size_t, int, struct hostent*, struct hostent_data*);'
14668 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=I_CWISD ;;
14670 case "$gethostbyaddr_r_proto" in
14671 ''|0) try='int gethostbyaddr_r(const char*, int, int, struct hostent*, struct hostent_data*);'
14672 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=I_CIISD ;;
14674 case "$gethostbyaddr_r_proto" in
14675 ''|0) try='int gethostbyaddr_r(const char*, int, int);'
14676 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=I_CII ;;
14678 case "$gethostbyaddr_r_proto" in
14679 ''|0) try='int gethostbyaddr_r(const void*, socklen_t, int, struct hostent*, char*, size_t, struct hostent**, int*);'
14680 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=I_TsISBWRE ;;
14682 case "$gethostbyaddr_r_proto" in
14683 ''|0) d_gethostbyaddr_r=undef
14684 gethostbyaddr_r_proto=0
14685 echo "Disabling gethostbyaddr_r, cannot determine prototype." >&4 ;;
14686 * ) case "$gethostbyaddr_r_proto" in
14687 REENTRANT_PROTO*) ;;
14688 *) gethostbyaddr_r_proto="REENTRANT_PROTO_$gethostbyaddr_r_proto" ;;
14690 echo "Prototype: $try" ;;
14693 *) case "$usethreads" in
14694 define) echo "gethostbyaddr_r has no prototype, not using it." >&4 ;;
14696 d_gethostbyaddr_r=undef
14697 gethostbyaddr_r_proto=0
14701 *) gethostbyaddr_r_proto=0
14705 : see if gethostbyname_r exists
14706 set gethostbyname_r d_gethostbyname_r
14708 case "$d_gethostbyname_r" in
14710 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14711 case "$d_gethostbyname_r_proto:$usethreads" in
14712 ":define") d_gethostbyname_r_proto=define
14713 set d_gethostbyname_r_proto gethostbyname_r $hdrs
14717 case "$d_gethostbyname_r_proto" in
14719 case "$gethostbyname_r_proto" in
14720 ''|0) try='int gethostbyname_r(const char*, struct hostent*, char*, size_t, struct hostent**, int*);'
14721 ./protochk "$extern_C $try" $hdrs && gethostbyname_r_proto=I_CSBWRE ;;
14723 case "$gethostbyname_r_proto" in
14724 ''|0) try='struct hostent* gethostbyname_r(const char*, struct hostent*, char*, int, int*);'
14725 ./protochk "$extern_C $try" $hdrs && gethostbyname_r_proto=S_CSBIE ;;
14727 case "$gethostbyname_r_proto" in
14728 ''|0) try='int gethostbyname_r(const char*, struct hostent*, struct hostent_data*);'
14729 ./protochk "$extern_C $try" $hdrs && gethostbyname_r_proto=I_CSD ;;
14731 case "$gethostbyname_r_proto" in
14732 ''|0) d_gethostbyname_r=undef
14733 gethostbyname_r_proto=0
14734 echo "Disabling gethostbyname_r, cannot determine prototype." >&4 ;;
14735 * ) case "$gethostbyname_r_proto" in
14736 REENTRANT_PROTO*) ;;
14737 *) gethostbyname_r_proto="REENTRANT_PROTO_$gethostbyname_r_proto" ;;
14739 echo "Prototype: $try" ;;
14742 *) case "$usethreads" in
14743 define) echo "gethostbyname_r has no prototype, not using it." >&4 ;;
14745 d_gethostbyname_r=undef
14746 gethostbyname_r_proto=0
14750 *) gethostbyname_r_proto=0
14754 : see if gethostent_r exists
14755 set gethostent_r d_gethostent_r
14757 case "$d_gethostent_r" in
14759 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14760 case "$d_gethostent_r_proto:$usethreads" in
14761 ":define") d_gethostent_r_proto=define
14762 set d_gethostent_r_proto gethostent_r $hdrs
14766 case "$d_gethostent_r_proto" in
14768 case "$gethostent_r_proto" in
14769 ''|0) try='int gethostent_r(struct hostent*, char*, size_t, struct hostent**, int*);'
14770 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=I_SBWRE ;;
14772 case "$gethostent_r_proto" in
14773 ''|0) try='int gethostent_r(struct hostent*, char*, int, int*);'
14774 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=I_SBIE ;;
14776 case "$gethostent_r_proto" in
14777 ''|0) try='struct hostent* gethostent_r(struct hostent*, char*, int, int*);'
14778 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=S_SBIE ;;
14780 case "$gethostent_r_proto" in
14781 ''|0) try='struct hostent* gethostent_r(struct hostent*, char*, int);'
14782 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=S_SBI ;;
14784 case "$gethostent_r_proto" in
14785 ''|0) try='int gethostent_r(struct hostent*, char*, int);'
14786 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=I_SBI ;;
14788 case "$gethostent_r_proto" in
14789 ''|0) try='int gethostent_r(struct hostent*, struct hostent_data*);'
14790 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=I_SD ;;
14792 case "$gethostent_r_proto" in
14793 ''|0) d_gethostent_r=undef
14794 gethostent_r_proto=0
14795 echo "Disabling gethostent_r, cannot determine prototype." >&4 ;;
14796 * ) case "$gethostent_r_proto" in
14797 REENTRANT_PROTO*) ;;
14798 *) gethostent_r_proto="REENTRANT_PROTO_$gethostent_r_proto" ;;
14800 echo "Prototype: $try" ;;
14803 *) case "$usethreads" in
14804 define) echo "gethostent_r has no prototype, not using it." >&4 ;;
14806 d_gethostent_r=undef
14807 gethostent_r_proto=0
14811 *) gethostent_r_proto=0
14815 : see if prototypes for various gethostxxx netdb.h functions are available
14817 set d_gethostprotos gethostent $i_netdb netdb.h
14820 : see if getitimer exists
14821 set getitimer d_getitimer
14824 : see if getlogin exists
14825 set getlogin d_getlogin
14828 : see if getlogin_r exists
14829 set getlogin_r d_getlogin_r
14831 case "$d_getlogin_r" in
14833 hdrs="$i_systypes sys/types.h define stdio.h $i_unistd unistd.h"
14834 case "$d_getlogin_r_proto:$usethreads" in
14835 ":define") d_getlogin_r_proto=define
14836 set d_getlogin_r_proto getlogin_r $hdrs
14840 case "$d_getlogin_r_proto" in
14842 case "$getlogin_r_proto" in
14843 ''|0) try='int getlogin_r(char*, size_t);'
14844 ./protochk "$extern_C $try" $hdrs && getlogin_r_proto=I_BW ;;
14846 case "$getlogin_r_proto" in
14847 ''|0) try='int getlogin_r(char*, int);'
14848 ./protochk "$extern_C $try" $hdrs && getlogin_r_proto=I_BI ;;
14850 case "$getlogin_r_proto" in
14851 ''|0) try='char* getlogin_r(char*, size_t);'
14852 ./protochk "$extern_C $try" $hdrs && getlogin_r_proto=B_BW ;;
14854 case "$getlogin_r_proto" in
14855 ''|0) try='char* getlogin_r(char*, int);'
14856 ./protochk "$extern_C $try" $hdrs && getlogin_r_proto=B_BI ;;
14858 case "$getlogin_r_proto" in
14859 ''|0) d_getlogin_r=undef
14861 echo "Disabling getlogin_r, cannot determine prototype." >&4 ;;
14862 * ) case "$getlogin_r_proto" in
14863 REENTRANT_PROTO*) ;;
14864 *) getlogin_r_proto="REENTRANT_PROTO_$getlogin_r_proto" ;;
14866 echo "Prototype: $try" ;;
14869 *) case "$usethreads" in
14870 define) echo "getlogin_r has no prototype, not using it." >&4 ;;
14877 *) getlogin_r_proto=0
14881 : see if getmnt exists
14882 set getmnt d_getmnt
14885 : see if getmntent exists
14886 set getmntent d_getmntent
14889 : see if getnameinfo exists
14890 set getnameinfo d_getnameinfo
14893 : see if getnetbyaddr exists
14894 set getnetbyaddr d_getnbyaddr
14897 : see if getnetbyname exists
14898 set getnetbyname d_getnbyname
14901 : see if getnetent exists
14902 set getnetent d_getnent
14905 : see if getnetbyaddr_r exists
14906 set getnetbyaddr_r d_getnetbyaddr_r
14908 case "$d_getnetbyaddr_r" in
14910 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14911 case "$d_getnetbyaddr_r_proto:$usethreads" in
14912 ":define") d_getnetbyaddr_r_proto=define
14913 set d_getnetbyaddr_r_proto getnetbyaddr_r $hdrs
14917 case "$d_getnetbyaddr_r_proto" in
14919 case "$getnetbyaddr_r_proto" in
14920 ''|0) try='int getnetbyaddr_r(unsigned long, int, struct netent*, char*, size_t, struct netent**, int*);'
14921 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_UISBWRE ;;
14923 case "$getnetbyaddr_r_proto" in
14924 ''|0) try='int getnetbyaddr_r(long, int, struct netent*, char*, int);'
14925 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_LISBI ;;
14927 case "$getnetbyaddr_r_proto" in
14928 ''|0) try='struct netent* getnetbyaddr_r(in_addr_t, int, struct netent*, char*, int);'
14929 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=S_TISBI ;;
14931 case "$getnetbyaddr_r_proto" in
14932 ''|0) try='struct netent* getnetbyaddr_r(long, int, struct netent*, char*, int);'
14933 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=S_LISBI ;;
14935 case "$getnetbyaddr_r_proto" in
14936 ''|0) try='int getnetbyaddr_r(in_addr_t, int, struct netent*, struct netent_data*);'
14937 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_TISD ;;
14939 case "$getnetbyaddr_r_proto" in
14940 ''|0) try='int getnetbyaddr_r(long, int, struct netent*, struct netent_data*);'
14941 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_LISD ;;
14943 case "$getnetbyaddr_r_proto" in
14944 ''|0) try='int getnetbyaddr_r(int, int, struct netent*, struct netent_data*);'
14945 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_IISD ;;
14947 case "$getnetbyaddr_r_proto" in
14948 ''|0) try='int getnetbyaddr_r(uint32_t, int, struct netent*, char*, size_t, struct netent**, int*);'
14949 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_uISBWRE ;;
14951 case "$getnetbyaddr_r_proto" in
14952 ''|0) d_getnetbyaddr_r=undef
14953 getnetbyaddr_r_proto=0
14954 echo "Disabling getnetbyaddr_r, cannot determine prototype." >&4 ;;
14955 * ) case "$getnetbyaddr_r_proto" in
14956 REENTRANT_PROTO*) ;;
14957 *) getnetbyaddr_r_proto="REENTRANT_PROTO_$getnetbyaddr_r_proto" ;;
14959 echo "Prototype: $try" ;;
14962 *) case "$usethreads" in
14963 define) echo "getnetbyaddr_r has no prototype, not using it." >&4 ;;
14965 d_getnetbyaddr_r=undef
14966 getnetbyaddr_r_proto=0
14970 *) getnetbyaddr_r_proto=0
14974 : see if getnetbyname_r exists
14975 set getnetbyname_r d_getnetbyname_r
14977 case "$d_getnetbyname_r" in
14979 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14980 case "$d_getnetbyname_r_proto:$usethreads" in
14981 ":define") d_getnetbyname_r_proto=define
14982 set d_getnetbyname_r_proto getnetbyname_r $hdrs
14986 case "$d_getnetbyname_r_proto" in
14988 case "$getnetbyname_r_proto" in
14989 ''|0) try='int getnetbyname_r(const char*, struct netent*, char*, size_t, struct netent**, int*);'
14990 ./protochk "$extern_C $try" $hdrs && getnetbyname_r_proto=I_CSBWRE ;;
14992 case "$getnetbyname_r_proto" in
14993 ''|0) try='int getnetbyname_r(const char*, struct netent*, char*, int);'
14994 ./protochk "$extern_C $try" $hdrs && getnetbyname_r_proto=I_CSBI ;;
14996 case "$getnetbyname_r_proto" in
14997 ''|0) try='struct netent* getnetbyname_r(const char*, struct netent*, char*, int);'
14998 ./protochk "$extern_C $try" $hdrs && getnetbyname_r_proto=S_CSBI ;;
15000 case "$getnetbyname_r_proto" in
15001 ''|0) try='int getnetbyname_r(const char*, struct netent*, struct netent_data*);'
15002 ./protochk "$extern_C $try" $hdrs && getnetbyname_r_proto=I_CSD ;;
15004 case "$getnetbyname_r_proto" in
15005 ''|0) d_getnetbyname_r=undef
15006 getnetbyname_r_proto=0
15007 echo "Disabling getnetbyname_r, cannot determine prototype." >&4 ;;
15008 * ) case "$getnetbyname_r_proto" in
15009 REENTRANT_PROTO*) ;;
15010 *) getnetbyname_r_proto="REENTRANT_PROTO_$getnetbyname_r_proto" ;;
15012 echo "Prototype: $try" ;;
15015 *) case "$usethreads" in
15016 define) echo "getnetbyname_r has no prototype, not using it." >&4 ;;
15018 d_getnetbyname_r=undef
15019 getnetbyname_r_proto=0
15023 *) getnetbyname_r_proto=0
15027 : see if getnetent_r exists
15028 set getnetent_r d_getnetent_r
15030 case "$d_getnetent_r" in
15032 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
15033 case "$d_getnetent_r_proto:$usethreads" in
15034 ":define") d_getnetent_r_proto=define
15035 set d_getnetent_r_proto getnetent_r $hdrs
15039 case "$d_getnetent_r_proto" in
15041 case "$getnetent_r_proto" in
15042 ''|0) try='int getnetent_r(struct netent*, char*, size_t, struct netent**, int*);'
15043 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=I_SBWRE ;;
15045 case "$getnetent_r_proto" in
15046 ''|0) try='int getnetent_r(struct netent*, char*, int, int*);'
15047 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=I_SBIE ;;
15049 case "$getnetent_r_proto" in
15050 ''|0) try='struct netent* getnetent_r(struct netent*, char*, int, int*);'
15051 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=S_SBIE ;;
15053 case "$getnetent_r_proto" in
15054 ''|0) try='struct netent* getnetent_r(struct netent*, char*, int);'
15055 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=S_SBI ;;
15057 case "$getnetent_r_proto" in
15058 ''|0) try='int getnetent_r(struct netent*, char*, int);'
15059 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=I_SBI ;;
15061 case "$getnetent_r_proto" in
15062 ''|0) try='int getnetent_r(struct netent*, struct netent_data*);'
15063 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=I_SD ;;
15065 case "$getnetent_r_proto" in
15066 ''|0) d_getnetent_r=undef
15067 getnetent_r_proto=0
15068 echo "Disabling getnetent_r, cannot determine prototype." >&4 ;;
15069 * ) case "$getnetent_r_proto" in
15070 REENTRANT_PROTO*) ;;
15071 *) getnetent_r_proto="REENTRANT_PROTO_$getnetent_r_proto" ;;
15073 echo "Prototype: $try" ;;
15076 *) case "$usethreads" in
15077 define) echo "getnetent_r has no prototype, not using it." >&4 ;;
15079 d_getnetent_r=undef
15080 getnetent_r_proto=0
15084 *) getnetent_r_proto=0
15088 : see if prototypes for various getnetxxx netdb.h functions are available
15090 set d_getnetprotos getnetent $i_netdb netdb.h
15093 : see if getpagesize exists
15094 set getpagesize d_getpagsz
15097 : Optional checks for getprotobyname and getprotobynumber
15099 : see if getprotobyname exists
15100 set getprotobyname d_getpbyname
15103 : see if getprotobynumber exists
15104 set getprotobynumber d_getpbynumber
15107 : see if getprotoent exists
15108 set getprotoent d_getpent
15111 : see if getpgid exists
15112 set getpgid d_getpgid
15115 : see if getpgrp2 exists
15116 set getpgrp2 d_getpgrp2
15119 : see if getppid exists
15120 set getppid d_getppid
15123 : see if getpriority exists
15124 set getpriority d_getprior
15127 : see if getprotobyname_r exists
15128 set getprotobyname_r d_getprotobyname_r
15130 case "$d_getprotobyname_r" in
15132 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
15133 case "$d_getprotobyname_r_proto:$usethreads" in
15134 ":define") d_getprotobyname_r_proto=define
15135 set d_getprotobyname_r_proto getprotobyname_r $hdrs
15139 case "$d_getprotobyname_r_proto" in
15141 case "$getprotobyname_r_proto" in
15142 ''|0) try='int getprotobyname_r(const char*, struct protoent*, char*, size_t, struct protoent**);'
15143 ./protochk "$extern_C $try" $hdrs && getprotobyname_r_proto=I_CSBWR ;;
15145 case "$getprotobyname_r_proto" in
15146 ''|0) try='struct protoent* getprotobyname_r(const char*, struct protoent*, char*, int);'
15147 ./protochk "$extern_C $try" $hdrs && getprotobyname_r_proto=S_CSBI ;;
15149 case "$getprotobyname_r_proto" in
15150 ''|0) try='int getprotobyname_r(const char*, struct protoent*, struct protoent_data*);'
15151 ./protochk "$extern_C $try" $hdrs && getprotobyname_r_proto=I_CSD ;;
15153 case "$getprotobyname_r_proto" in
15154 ''|0) d_getprotobyname_r=undef
15155 getprotobyname_r_proto=0
15156 echo "Disabling getprotobyname_r, cannot determine prototype." >&4 ;;
15157 * ) case "$getprotobyname_r_proto" in
15158 REENTRANT_PROTO*) ;;
15159 *) getprotobyname_r_proto="REENTRANT_PROTO_$getprotobyname_r_proto" ;;
15161 echo "Prototype: $try" ;;
15164 *) case "$usethreads" in
15165 define) echo "getprotobyname_r has no prototype, not using it." >&4 ;;
15167 d_getprotobyname_r=undef
15168 getprotobyname_r_proto=0
15172 *) getprotobyname_r_proto=0
15176 : see if getprotobynumber_r exists
15177 set getprotobynumber_r d_getprotobynumber_r
15179 case "$d_getprotobynumber_r" in
15181 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
15182 case "$d_getprotobynumber_r_proto:$usethreads" in
15183 ":define") d_getprotobynumber_r_proto=define
15184 set d_getprotobynumber_r_proto getprotobynumber_r $hdrs
15188 case "$d_getprotobynumber_r_proto" in
15190 case "$getprotobynumber_r_proto" in
15191 ''|0) try='int getprotobynumber_r(int, struct protoent*, char*, size_t, struct protoent**);'
15192 ./protochk "$extern_C $try" $hdrs && getprotobynumber_r_proto=I_ISBWR ;;
15194 case "$getprotobynumber_r_proto" in
15195 ''|0) try='struct protoent* getprotobynumber_r(int, struct protoent*, char*, int);'
15196 ./protochk "$extern_C $try" $hdrs && getprotobynumber_r_proto=S_ISBI ;;
15198 case "$getprotobynumber_r_proto" in
15199 ''|0) try='int getprotobynumber_r(int, struct protoent*, struct protoent_data*);'
15200 ./protochk "$extern_C $try" $hdrs && getprotobynumber_r_proto=I_ISD ;;
15202 case "$getprotobynumber_r_proto" in
15203 ''|0) d_getprotobynumber_r=undef
15204 getprotobynumber_r_proto=0
15205 echo "Disabling getprotobynumber_r, cannot determine prototype." >&4 ;;
15206 * ) case "$getprotobynumber_r_proto" in
15207 REENTRANT_PROTO*) ;;
15208 *) getprotobynumber_r_proto="REENTRANT_PROTO_$getprotobynumber_r_proto" ;;
15210 echo "Prototype: $try" ;;
15213 *) case "$usethreads" in
15214 define) echo "getprotobynumber_r has no prototype, not using it." >&4 ;;
15216 d_getprotobynumber_r=undef
15217 getprotobynumber_r_proto=0
15221 *) getprotobynumber_r_proto=0
15225 : see if getprotoent_r exists
15226 set getprotoent_r d_getprotoent_r
15228 case "$d_getprotoent_r" in
15230 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
15231 case "$d_getprotoent_r_proto:$usethreads" in
15232 ":define") d_getprotoent_r_proto=define
15233 set d_getprotoent_r_proto getprotoent_r $hdrs
15237 case "$d_getprotoent_r_proto" in
15239 case "$getprotoent_r_proto" in
15240 ''|0) try='int getprotoent_r(struct protoent*, char*, size_t, struct protoent**);'
15241 ./protochk "$extern_C $try" $hdrs && getprotoent_r_proto=I_SBWR ;;
15243 case "$getprotoent_r_proto" in
15244 ''|0) try='int getprotoent_r(struct protoent*, char*, int);'
15245 ./protochk "$extern_C $try" $hdrs && getprotoent_r_proto=I_SBI ;;
15247 case "$getprotoent_r_proto" in
15248 ''|0) try='struct protoent* getprotoent_r(struct protoent*, char*, int);'
15249 ./protochk "$extern_C $try" $hdrs && getprotoent_r_proto=S_SBI ;;
15251 case "$getprotoent_r_proto" in
15252 ''|0) try='int getprotoent_r(struct protoent*, struct protoent_data*);'
15253 ./protochk "$extern_C $try" $hdrs && getprotoent_r_proto=I_SD ;;
15255 case "$getprotoent_r_proto" in
15256 ''|0) d_getprotoent_r=undef
15257 getprotoent_r_proto=0
15258 echo "Disabling getprotoent_r, cannot determine prototype." >&4 ;;
15259 * ) case "$getprotoent_r_proto" in
15260 REENTRANT_PROTO*) ;;
15261 *) getprotoent_r_proto="REENTRANT_PROTO_$getprotoent_r_proto" ;;
15263 echo "Prototype: $try" ;;
15266 *) case "$usethreads" in
15267 define) echo "getprotoent_r has no prototype, not using it." >&4 ;;
15269 d_getprotoent_r=undef
15270 getprotoent_r_proto=0
15274 *) getprotoent_r_proto=0
15278 : see if prototypes for various getprotoxxx netdb.h functions are available
15280 set d_getprotoprotos getprotoent $i_netdb netdb.h
15283 : see if getprpwnam exists
15284 set getprpwnam d_getprpwnam
15287 : see if getpwent exists
15288 set getpwent d_getpwent
15291 : see if getpwent_r exists
15292 set getpwent_r d_getpwent_r
15294 case "$d_getpwent_r" in
15296 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
15297 case "$d_getpwent_r_proto:$usethreads" in
15298 ":define") d_getpwent_r_proto=define
15299 set d_getpwent_r_proto getpwent_r $hdrs
15303 case "$d_getpwent_r_proto" in
15305 case "$getpwent_r_proto" in
15306 ''|0) try='int getpwent_r(struct passwd*, char*, size_t, struct passwd**);'
15307 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=I_SBWR ;;
15309 case "$getpwent_r_proto" in
15310 ''|0) try='int getpwent_r(struct passwd*, char*, int, struct passwd**);'
15311 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=I_SBIR ;;
15313 case "$getpwent_r_proto" in
15314 ''|0) try='struct passwd* getpwent_r(struct passwd*, char*, size_t);'
15315 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=S_SBW ;;
15317 case "$getpwent_r_proto" in
15318 ''|0) try='struct passwd* getpwent_r(struct passwd*, char*, int);'
15319 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=S_SBI ;;
15321 case "$getpwent_r_proto" in
15322 ''|0) try='int getpwent_r(struct passwd*, char*, int);'
15323 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=I_SBI ;;
15325 case "$getpwent_r_proto" in
15326 ''|0) try='int getpwent_r(struct passwd*, char*, int, FILE**);'
15327 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=I_SBIH ;;
15329 case "$getpwent_r_proto" in
15330 ''|0) d_getpwent_r=undef
15332 echo "Disabling getpwent_r, cannot determine prototype." >&4 ;;
15333 * ) case "$getpwent_r_proto" in
15334 REENTRANT_PROTO*) ;;
15335 *) getpwent_r_proto="REENTRANT_PROTO_$getpwent_r_proto" ;;
15337 echo "Prototype: $try" ;;
15340 *) case "$usethreads" in
15341 define) echo "getpwent_r has no prototype, not using it." >&4 ;;
15348 *) getpwent_r_proto=0
15352 : see if getpwnam_r exists
15353 set getpwnam_r d_getpwnam_r
15355 case "$d_getpwnam_r" in
15357 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
15358 case "$d_getpwnam_r_proto:$usethreads" in
15359 ":define") d_getpwnam_r_proto=define
15360 set d_getpwnam_r_proto getpwnam_r $hdrs
15364 case "$d_getpwnam_r_proto" in
15366 case "$getpwnam_r_proto" in
15367 ''|0) try='int getpwnam_r(const char*, struct passwd*, char*, size_t, struct passwd**);'
15368 ./protochk "$extern_C $try" $hdrs && getpwnam_r_proto=I_CSBWR ;;
15370 case "$getpwnam_r_proto" in
15371 ''|0) try='int getpwnam_r(const char*, struct passwd*, char*, int, struct passwd**);'
15372 ./protochk "$extern_C $try" $hdrs && getpwnam_r_proto=I_CSBIR ;;
15374 case "$getpwnam_r_proto" in
15375 ''|0) try='struct passwd* getpwnam_r(const char*, struct passwd*, char*, int);'
15376 ./protochk "$extern_C $try" $hdrs && getpwnam_r_proto=S_CSBI ;;
15378 case "$getpwnam_r_proto" in
15379 ''|0) try='int getpwnam_r(const char*, struct passwd*, char*, int);'
15380 ./protochk "$extern_C $try" $hdrs && getpwnam_r_proto=I_CSBI ;;
15382 case "$getpwnam_r_proto" in
15383 ''|0) d_getpwnam_r=undef
15385 echo "Disabling getpwnam_r, cannot determine prototype." >&4 ;;
15386 * ) case "$getpwnam_r_proto" in
15387 REENTRANT_PROTO*) ;;
15388 *) getpwnam_r_proto="REENTRANT_PROTO_$getpwnam_r_proto" ;;
15390 echo "Prototype: $try" ;;
15393 *) case "$usethreads" in
15394 define) echo "getpwnam_r has no prototype, not using it." >&4 ;;
15401 *) getpwnam_r_proto=0
15405 : see if getpwuid_r exists
15406 set getpwuid_r d_getpwuid_r
15408 case "$d_getpwuid_r" in
15410 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
15411 case "$d_getpwuid_r_proto:$usethreads" in
15412 ":define") d_getpwuid_r_proto=define
15413 set d_getpwuid_r_proto getpwuid_r $hdrs
15417 case "$d_getpwuid_r_proto" in
15419 case "$getpwuid_r_proto" in
15420 ''|0) try='int getpwuid_r(uid_t, struct passwd*, char*, size_t, struct passwd**);'
15421 ./protochk "$extern_C $try" $hdrs && getpwuid_r_proto=I_TSBWR ;;
15423 case "$getpwuid_r_proto" in
15424 ''|0) try='int getpwuid_r(uid_t, struct passwd*, char*, int, struct passwd**);'
15425 ./protochk "$extern_C $try" $hdrs && getpwuid_r_proto=I_TSBIR ;;
15427 case "$getpwuid_r_proto" in
15428 ''|0) try='int getpwuid_r(uid_t, struct passwd*, char*, int);'
15429 ./protochk "$extern_C $try" $hdrs && getpwuid_r_proto=I_TSBI ;;
15431 case "$getpwuid_r_proto" in
15432 ''|0) try='struct passwd* getpwuid_r(uid_t, struct passwd*, char*, int);'
15433 ./protochk "$extern_C $try" $hdrs && getpwuid_r_proto=S_TSBI ;;
15435 case "$getpwuid_r_proto" in
15436 ''|0) d_getpwuid_r=undef
15438 echo "Disabling getpwuid_r, cannot determine prototype." >&4 ;;
15439 * ) case "$getpwuid_r_proto" in
15440 REENTRANT_PROTO*) ;;
15441 *) getpwuid_r_proto="REENTRANT_PROTO_$getpwuid_r_proto" ;;
15443 echo "Prototype: $try" ;;
15446 *) case "$usethreads" in
15447 define) echo "getpwuid_r has no prototype, not using it." >&4 ;;
15454 *) getpwuid_r_proto=0
15458 : Optional checks for getsbyname and getsbyport
15460 : see if getservbyname exists
15461 set getservbyname d_getsbyname
15464 : see if getservbyport exists
15465 set getservbyport d_getsbyport
15468 : see if getservent exists
15469 set getservent d_getsent
15472 : see if getservbyname_r exists
15473 set getservbyname_r d_getservbyname_r
15475 case "$d_getservbyname_r" in
15477 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
15478 case "$d_getservbyname_r_proto:$usethreads" in
15479 ":define") d_getservbyname_r_proto=define
15480 set d_getservbyname_r_proto getservbyname_r $hdrs
15484 case "$d_getservbyname_r_proto" in
15486 case "$getservbyname_r_proto" in
15487 ''|0) try='int getservbyname_r(const char*, const char*, struct servent*, char*, size_t, struct servent**);'
15488 ./protochk "$extern_C $try" $hdrs && getservbyname_r_proto=I_CCSBWR ;;
15490 case "$getservbyname_r_proto" in
15491 ''|0) try='struct servent* getservbyname_r(const char*, const char*, struct servent*, char*, int);'
15492 ./protochk "$extern_C $try" $hdrs && getservbyname_r_proto=S_CCSBI ;;
15494 case "$getservbyname_r_proto" in
15495 ''|0) try='int getservbyname_r(const char*, const char*, struct servent*, struct servent_data*);'
15496 ./protochk "$extern_C $try" $hdrs && getservbyname_r_proto=I_CCSD ;;
15498 case "$getservbyname_r_proto" in
15499 ''|0) d_getservbyname_r=undef
15500 getservbyname_r_proto=0
15501 echo "Disabling getservbyname_r, cannot determine prototype." >&4 ;;
15502 * ) case "$getservbyname_r_proto" in
15503 REENTRANT_PROTO*) ;;
15504 *) getservbyname_r_proto="REENTRANT_PROTO_$getservbyname_r_proto" ;;
15506 echo "Prototype: $try" ;;
15509 *) case "$usethreads" in
15510 define) echo "getservbyname_r has no prototype, not using it." >&4 ;;
15512 d_getservbyname_r=undef
15513 getservbyname_r_proto=0
15517 *) getservbyname_r_proto=0
15521 : see if getservbyport_r exists
15522 set getservbyport_r d_getservbyport_r
15524 case "$d_getservbyport_r" in
15526 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
15527 case "$d_getservbyport_r_proto:$usethreads" in
15528 ":define") d_getservbyport_r_proto=define
15529 set d_getservbyport_r_proto getservbyport_r $hdrs
15533 case "$d_getservbyport_r_proto" in
15535 case "$getservbyport_r_proto" in
15536 ''|0) try='int getservbyport_r(int, const char*, struct servent*, char*, size_t, struct servent**);'
15537 ./protochk "$extern_C $try" $hdrs && getservbyport_r_proto=I_ICSBWR ;;
15539 case "$getservbyport_r_proto" in
15540 ''|0) try='struct servent* getservbyport_r(int, const char*, struct servent*, char*, int);'
15541 ./protochk "$extern_C $try" $hdrs && getservbyport_r_proto=S_ICSBI ;;
15543 case "$getservbyport_r_proto" in
15544 ''|0) try='int getservbyport_r(int, const char*, struct servent*, struct servent_data*);'
15545 ./protochk "$extern_C $try" $hdrs && getservbyport_r_proto=I_ICSD ;;
15547 case "$getservbyport_r_proto" in
15548 ''|0) d_getservbyport_r=undef
15549 getservbyport_r_proto=0
15550 echo "Disabling getservbyport_r, cannot determine prototype." >&4 ;;
15551 * ) case "$getservbyport_r_proto" in
15552 REENTRANT_PROTO*) ;;
15553 *) getservbyport_r_proto="REENTRANT_PROTO_$getservbyport_r_proto" ;;
15555 echo "Prototype: $try" ;;
15558 *) case "$usethreads" in
15559 define) echo "getservbyport_r has no prototype, not using it." >&4 ;;
15561 d_getservbyport_r=undef
15562 getservbyport_r_proto=0
15566 *) getservbyport_r_proto=0
15570 : see if getservent_r exists
15571 set getservent_r d_getservent_r
15573 case "$d_getservent_r" in
15575 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
15576 case "$d_getservent_r_proto:$usethreads" in
15577 ":define") d_getservent_r_proto=define
15578 set d_getservent_r_proto getservent_r $hdrs
15582 case "$d_getservent_r_proto" in
15584 case "$getservent_r_proto" in
15585 ''|0) try='int getservent_r(struct servent*, char*, size_t, struct servent**);'
15586 ./protochk "$extern_C $try" $hdrs && getservent_r_proto=I_SBWR ;;
15588 case "$getservent_r_proto" in
15589 ''|0) try='int getservent_r(struct servent*, char*, int);'
15590 ./protochk "$extern_C $try" $hdrs && getservent_r_proto=I_SBI ;;
15592 case "$getservent_r_proto" in
15593 ''|0) try='struct servent* getservent_r(struct servent*, char*, int);'
15594 ./protochk "$extern_C $try" $hdrs && getservent_r_proto=S_SBI ;;
15596 case "$getservent_r_proto" in
15597 ''|0) try='int getservent_r(struct servent*, struct servent_data*);'
15598 ./protochk "$extern_C $try" $hdrs && getservent_r_proto=I_SD ;;
15600 case "$getservent_r_proto" in
15601 ''|0) d_getservent_r=undef
15602 getservent_r_proto=0
15603 echo "Disabling getservent_r, cannot determine prototype." >&4 ;;
15604 * ) case "$getservent_r_proto" in
15605 REENTRANT_PROTO*) ;;
15606 *) getservent_r_proto="REENTRANT_PROTO_$getservent_r_proto" ;;
15608 echo "Prototype: $try" ;;
15611 *) case "$usethreads" in
15612 define) echo "getservent_r has no prototype, not using it." >&4 ;;
15614 d_getservent_r=undef
15615 getservent_r_proto=0
15619 *) getservent_r_proto=0
15623 : see if prototypes for various getservxxx netdb.h functions are available
15625 set d_getservprotos getservent $i_netdb netdb.h
15628 : see if getspnam exists
15629 set getspnam d_getspnam
15632 : see if this is a shadow.h system
15633 set shadow.h i_shadow
15636 : see if getspnam_r exists
15637 set getspnam_r d_getspnam_r
15639 case "$d_getspnam_r" in
15641 hdrs="$i_systypes sys/types.h define stdio.h $i_shadow shadow.h"
15642 case "$d_getspnam_r_proto:$usethreads" in
15643 ":define") d_getspnam_r_proto=define
15644 set d_getspnam_r_proto getspnam_r $hdrs
15648 case "$d_getspnam_r_proto" in
15650 case "$getspnam_r_proto" in
15651 ''|0) try='int getspnam_r(const char*, struct spwd*, char*, size_t, struct spwd**);'
15652 ./protochk "$extern_C $try" $hdrs && getspnam_r_proto=I_CSBWR ;;
15654 case "$getspnam_r_proto" in
15655 ''|0) try='struct spwd* getspnam_r(const char*, struct spwd*, char*, int);'
15656 ./protochk "$extern_C $try" $hdrs && getspnam_r_proto=S_CSBI ;;
15658 case "$getspnam_r_proto" in
15659 ''|0) d_getspnam_r=undef
15661 echo "Disabling getspnam_r, cannot determine prototype." >&4 ;;
15662 * ) case "$getspnam_r_proto" in
15663 REENTRANT_PROTO*) ;;
15664 *) getspnam_r_proto="REENTRANT_PROTO_$getspnam_r_proto" ;;
15666 echo "Prototype: $try" ;;
15669 *) case "$usethreads" in
15670 define) echo "getspnam_r has no prototype, not using it." >&4 ;;
15677 *) getspnam_r_proto=0
15681 : see if gettimeofday or ftime exists
15682 set gettimeofday d_gettimeod
15684 case "$d_gettimeod" in
15690 val="$undef"; set d_ftime; eval $setvar
15693 case "$d_gettimeod$d_ftime" in
15696 echo 'No ftime() nor gettimeofday() -- timing may be less accurate.' >&4
15700 : see if gmtime_r exists
15701 set gmtime_r d_gmtime_r
15703 case "$d_gmtime_r" in
15705 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
15706 case "$d_gmtime_r_proto:$usethreads" in
15707 ":define") d_gmtime_r_proto=define
15708 set d_gmtime_r_proto gmtime_r $hdrs
15712 case "$d_gmtime_r_proto" in
15714 case "$gmtime_r_proto" in
15715 ''|0) try='struct tm* gmtime_r(const time_t*, struct tm*);'
15716 ./protochk "$extern_C $try" $hdrs && gmtime_r_proto=S_TS ;;
15718 case "$gmtime_r_proto" in
15719 ''|0) try='int gmtime_r(const time_t*, struct tm*);'
15720 ./protochk "$extern_C $try" $hdrs && gmtime_r_proto=I_TS ;;
15722 case "$gmtime_r_proto" in
15723 ''|0) d_gmtime_r=undef
15725 echo "Disabling gmtime_r, cannot determine prototype." >&4 ;;
15726 * ) case "$gmtime_r_proto" in
15727 REENTRANT_PROTO*) ;;
15728 *) gmtime_r_proto="REENTRANT_PROTO_$gmtime_r_proto" ;;
15730 echo "Prototype: $try" ;;
15733 *) case "$usethreads" in
15734 define) echo "gmtime_r has no prototype, not using it." >&4 ;;
15741 *) gmtime_r_proto=0
15745 : see if hasmntopt exists
15746 set hasmntopt d_hasmntopt
15749 : see if this is a netinet/in.h or sys/in.h system
15750 set netinet/in.h i_niin sys/in.h i_sysin
15753 : see if arpa/inet.h has to be included
15754 set arpa/inet.h i_arpainet
15757 : see if htonl --and friends-- exists
15762 : Maybe they are macros.
15765 $cat >htonl.c <<EOM
15767 #include <sys/types.h>
15768 #$i_niin I_NETINET_IN
15770 #$i_arpainet I_ARPA_INET
15771 #ifdef I_NETINET_IN
15772 #include <netinet/in.h>
15775 #include <sys/in.h>
15778 #include <arpa/inet.h>
15781 printf("Defined as a macro.");
15784 $cppstdin $cppflags $cppminus < htonl.c >htonl.E 2>/dev/null
15785 if $contains 'Defined as a macro' htonl.E >/dev/null 2>&1; then
15787 echo "But it seems to be defined as a macro." >&4
15795 : see if hypot exists
15799 : see if ilogb exists
15803 : see if ilogbl exists
15804 set ilogbl d_ilogbl
15809 if set index val -f; eval $csym; $val; then
15810 if set strchr val -f d_strchr; eval $csym; $val; then
15811 if $contains strchr "$strings" >/dev/null 2>&1 ; then
15814 echo "strchr() found." >&4
15818 echo "index() found." >&4
15823 echo "index() found." >&4
15826 if set strchr val -f d_strchr; eval $csym; $val; then
15829 echo "strchr() found." >&4
15831 echo "No index() or strchr() found!" >&4
15836 set d_strchr; eval $setvar
15838 set d_index; eval $setvar
15840 : check whether inet_aton exists
15841 set inet_aton d_inetaton
15844 : see if inet_ntop exists
15845 set inet_ntop d_inetntop
15848 : see if inet_pton exists
15849 set inet_pton d_inetpton
15854 $cat >isascii.c <<EOCP
15857 #$i_stdlib I_STDLIB
15859 #include <stdlib.h>
15870 if eval $compile; then
15871 echo "isascii() found." >&4
15874 echo "isascii() NOT found." >&4
15883 $cat >isblank.c <<'EOCP'
15894 if $cc $ccflags $ldflags -o isblank isblank.c $libs >/dev/null 2>&1 ; then
15895 echo "isblank() found." >&4
15898 echo "isblank() NOT found." >&4
15905 : check for isfinite
15906 echo "Checking to see if you have isfinite..." >&4
15912 int main() { return isfinite(0.0); }
15915 if eval $compile; then
15917 echo "You have isfinite."
15920 echo "You do not have isfinite."
15926 : see if isfinitel exists
15927 set isfinitel d_isfinitel
15931 echo "Checking to see if you have isinf..." >&4
15937 int main() { return isinf(0.0); }
15940 if eval $compile; then
15942 echo "You have isinf."
15945 echo "You do not have isinf."
15951 : see if isinfl exists
15952 set isinfl d_isinfl
15956 echo "Checking to see if you have isless..." >&4
15962 int main() { return isless(0.0); }
15965 if eval $compile; then
15967 echo "You have isless."
15970 echo "You do not have isless."
15977 echo "Checking to see if you have isnan..." >&4
15983 int main() { return isnan(0.0); }
15986 if eval $compile; then
15988 echo "You have isnan."
15991 echo "You do not have isnan."
15997 : see if isnanl exists
15998 set isnanl d_isnanl
16001 : check for isnormal
16002 echo "Checking to see if you have isnormal..." >&4
16008 int main() { return isnormal(0.0); }
16011 if eval $compile; then
16013 echo "You have isnormal."
16016 echo "You do not have isnormal."
16026 : see if j0l exists
16030 : see if killpg exists
16031 set killpg d_killpg
16034 : see if localeconv exists
16035 set localeconv d_locconv
16038 : see if libc has the POSIX.1-2008 currency locale rules
16039 case "$d_locconv:$d_lc_monetary_2008" in
16042 #include <locale.h>
16044 struct lconv *lc = localeconv();
16045 char int_p_cs_precedes = lc->int_p_cs_precedes;
16050 if eval $compile; then
16051 d_lc_monetary_2008="$define"
16053 d_lc_monetary_2008="$undef"
16059 : see if lchown exists
16061 $cat > try.c <<'EOCP'
16062 /* System header to define __stub macros and hopefully few prototypes,
16063 which can conflict with char lchown(); below. */
16064 #include <assert.h>
16065 /* Override any gcc2 internal prototype to avoid an error. */
16066 /* We use char because int might match the return type of a gcc2
16067 builtin and then its argument prototype would still apply. */
16070 /* The GNU C library defines this for functions which it implements
16071 to always fail with ENOSYS. Some functions are actually named
16072 something starting with __ and the normal name is an alias. */
16073 #if defined (__stub_lchown) || defined (__stub___lchown)
16081 if eval $compile; then
16082 $echo "lchown() found." >&4
16085 $echo "lchown() NOT found." >&4
16091 : See if number of significant digits in a double precision number is known
16093 $cat >ldbl_dig.c <<EOM
16094 #$i_limits I_LIMITS
16097 #include <limits.h>
16103 printf("Contains LDBL_DIG");
16106 $cppstdin $cppflags $cppminus < ldbl_dig.c >ldbl_dig.E 2>/dev/null
16107 if $contains 'LDBL_DIG' ldbl_dig.E >/dev/null 2>&1; then
16108 echo "LDBL_DIG found." >&4
16111 echo "LDBL_DIG NOT found." >&4
16118 : see if lgamma exists
16119 set lgamma d_lgamma
16122 : see if lgamma_r exists
16123 set lgamma_r d_lgamma_r
16126 : check to see if math.h defines _LIB_VERSION
16127 d_libm_lib_version="$undef"
16131 echo "Checking to see if your libm supports _LIB_VERSION..." >&4
16133 #include <unistd.h>
16135 int main (int argc, char *argv[])
16137 printf ("%d\n", _LIB_VERSION);
16142 if eval $compile; then
16144 echo "Yes, it does ($foo)" >&4
16145 d_libm_lib_version="$define"
16147 echo "No, it does not (probably harmless)" >&4
16154 : see if link exists
16158 : see if llrint exists
16159 set llrint d_llrint
16162 : see if llrintl exists
16163 set llrintl d_llrintl
16166 : see if llround exists
16167 set llround d_llround
16170 : see if llroundl exists
16171 set llroundl d_llroundl
16174 : see if localtime_r exists
16175 set localtime_r d_localtime_r
16177 case "$d_localtime_r" in
16179 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
16180 case "$d_localtime_r_proto:$usethreads" in
16181 ":define") d_localtime_r_proto=define
16182 set d_localtime_r_proto localtime_r $hdrs
16186 case "$d_localtime_r_proto" in
16188 case "$localtime_r_proto" in
16189 ''|0) try='struct tm* localtime_r(const time_t*, struct tm*);'
16190 ./protochk "$extern_C $try" $hdrs && localtime_r_proto=S_TS ;;
16192 case "$localtime_r_proto" in
16193 ''|0) try='int localtime_r(const time_t*, struct tm*);'
16194 ./protochk "$extern_C $try" $hdrs && localtime_r_proto=I_TS ;;
16196 case "$localtime_r_proto" in
16197 ''|0) d_localtime_r=undef
16198 localtime_r_proto=0
16199 echo "Disabling localtime_r, cannot determine prototype." >&4 ;;
16200 * ) case "$localtime_r_proto" in
16201 REENTRANT_PROTO*) ;;
16202 *) localtime_r_proto="REENTRANT_PROTO_$localtime_r_proto" ;;
16204 echo "Prototype: $try" ;;
16207 *) case "$usethreads" in
16208 define) echo "localtime_r has no prototype, not using it." >&4 ;;
16210 d_localtime_r=undef
16211 localtime_r_proto=0
16215 *) localtime_r_proto=0
16219 : see if localtime_r calls tzset
16220 case "$localtime_r_proto" in
16223 /* Does our libc's localtime_r call tzset ?
16224 * return 0 if so, 1 otherwise.
16226 #$i_systypes I_SYS_TYPES
16227 #$i_unistd I_UNISTD
16229 #$i_stdlib I_STDLIB
16230 #$i_string I_STRING
16231 #$i_malloc I_MALLOC
16233 # include <sys/types.h>
16236 # include <unistd.h>
16242 #include <stdlib.h>
16245 # include <string.h>
16247 # include <strings.h>
16250 # include <malloc.h>
16254 time_t t = time(0L);
16255 char w_tz[]="TZ" "=GMT+5",
16256 e_tz[]="TZ" "=GMT-5",
16257 *tz_e = (char*)malloc(16),
16258 *tz_w = (char*)malloc(16);
16259 struct tm tm_e, tm_w;
16260 memset(&tm_e,'\0',sizeof(struct tm));
16261 memset(&tm_w,'\0',sizeof(struct tm));
16266 localtime_r(&t, &tm_e);
16269 localtime_r(&t, &tm_w);
16271 if( memcmp(&tm_e, &tm_w, sizeof(struct tm)) == 0 )
16277 if eval $compile; then
16278 if $run ./try; then
16279 d_localtime_r_needs_tzset=undef;
16281 d_localtime_r_needs_tzset=define;
16284 d_localtime_r_needs_tzset=undef;
16288 d_localtime_r_needs_tzset=undef;
16293 : see if lockf exists
16297 : see if log1p exists
16301 : see if log2 exists
16305 : see if logb exists
16309 : see if lrint exists
16313 : see if lrintl exists
16314 set lrintl d_lrintl
16317 : see if lround exists
16318 set lround d_lround
16321 : see if lroundl exists
16322 set lroundl d_lroundl
16325 : see if prototype for lseek is available
16327 set d_lseekproto lseek $i_systypes sys/types.h $i_unistd unistd.h
16330 : see if lstat exists
16334 : see if madvise exists
16335 set madvise d_madvise
16338 : see if malloc_size exists
16339 set malloc_size d_malloc_size
16342 : see if malloc_size_good exists
16343 set malloc_good_size d_malloc_good_size
16346 : see if mblen exists
16350 : see if mbstowcs exists
16351 set mbstowcs d_mbstowcs
16354 : see if mbtowc exists
16355 set mbtowc d_mbtowc
16358 : see if memchr exists
16359 set memchr d_memchr
16362 : see if memcmp exists
16363 set memcmp d_memcmp
16366 : see if memcpy exists
16367 set memcpy d_memcpy
16370 : see if memmem exists
16371 set memmem d_memmem
16374 : see if memmove exists
16375 set memmove d_memmove
16378 : see if memset exists
16379 set memset d_memset
16382 : see if mkdir exists
16386 : see if mkdtemp exists
16387 set mkdtemp d_mkdtemp
16390 : see if mkfifo exists
16391 set mkfifo d_mkfifo
16394 : see if mkstemp exists
16395 set mkstemp d_mkstemp
16398 : see if mkstemps exists
16399 set mkstemps d_mkstemps
16402 : see if mktime exists
16403 set mktime d_mktime
16406 : see if this is a sys/mman.h system
16407 set sys/mman.h i_sysmman
16410 : see if mmap exists
16413 : see what shmat returns
16414 : default to something harmless
16416 case "$i_sysmman$d_mmap" in
16418 $cat >mmap.c <<'END'
16419 #include <sys/mman.h>
16422 if $cc $ccflags -c mmap.c >/dev/null 2>&1; then
16427 echo "and it returns ($mmaptype)." >&4
16433 : see if sqrtl exists
16437 : see if scalbnl exists
16438 set scalbnl d_scalbnl
16441 : see if truncl exists
16442 set truncl d_truncl
16445 : see if modfl exists
16449 : see if prototype for modfl is available
16451 set d_modflproto modfl $i_math math.h
16454 if $test "$uselongdouble" = "$define"; then
16456 if $test "$d_sqrtl" != "$define"; then
16457 message="$message sqrtl"
16459 if $test "$d_modfl" != "$define"; then
16460 if $test "$d_truncl:$d_copysignl" = "$define:$define"; then
16461 echo "You have both truncl and copysignl, so I can emulate modfl."
16463 if $test "$d_aintl:$d_copysignl" = "$define:$define"; then
16464 echo "You have both aintl and copysignl, so I can emulate modfl."
16466 message="$message modfl"
16470 if $test "$d_frexpl" != "$define"; then
16471 if $test "$d_ilogbl:$d_scalbnl" = "$define:$define"; then
16472 echo "You have both ilogbl and scalbnl, so I can emulate frexpl."
16474 message="$message frexpl"
16477 if $test "$d_ldexpl" != "$define"; then
16478 message="$message ldexpl"
16481 if $test "$message" != ""; then
16484 *** You requested the use of long doubles but you do not seem to have
16485 *** the following mathematical functions needed for long double support:
16487 *** Please rerun Configure without -Duselongdouble and/or -Dusemorebits.
16488 *** Cannot continue, aborting.
16496 : see if mprotect exists
16497 set mprotect d_mprotect
16500 : see if msgctl exists
16501 set msgctl d_msgctl
16504 : see if msgget exists
16505 set msgget d_msgget
16508 : see if msgsnd exists
16509 set msgsnd d_msgsnd
16512 : see if msgrcv exists
16513 set msgrcv d_msgrcv
16516 : see how much of the 'msg*(2)' library is present.
16519 case "$d_msgctl$d_msgget$d_msgsnd$d_msgrcv" in
16520 *"$undef"*) h_msg=false;;
16524 case "`ipcs 2>&1`" in
16525 "SVID messages"*"not configured"*)
16526 echo "Your $osname does not have the msg*(2) configured." >&4
16529 set msgctl d_msgctl
16531 set msgget d_msgget
16533 set msgsnd d_msgsnd
16535 set msgrcv d_msgrcv
16541 : we could also check for sys/ipc.h ...
16542 if $h_msg && $test `./findhdr sys/msg.h`; then
16543 echo "You have the full msg*(2) library." >&4
16546 echo "You don't have the full msg*(2) library." >&4
16552 : Check for msghdr_s
16554 echo "Checking to see if your system supports struct msghdr..." >&4
16555 set d_msghdr_s msghdr $i_systypes sys/types.h $d_socket sys/socket.h $i_sysuio sys/uio.h
16557 case "$d_msghdr_s" in
16558 "$define") echo "Yes, it does." ;;
16559 *) echo "No, it doesn't." ;;
16563 : see if msync exists
16567 : see if munmap exists
16568 set munmap d_munmap
16571 : see if nan exists
16575 : see if nearbyint exists
16576 set nearbyint d_nearbyint
16579 : see if nextafter exists
16580 set nextafter d_nextafter
16583 : see if nexttoward exists
16584 set nexttoward d_nexttoward
16587 : see if nice exists
16591 : see if this is a langinfo.h system
16592 set langinfo.h i_langinfo
16595 : see if nl_langinfo exists
16596 set nl_langinfo d_nl_langinfo
16599 : see if this is a quadmath.h system
16600 set quadmath.h i_quadmath
16603 : check for volatile keyword
16605 echo 'Checking to see if your C compiler knows about "volatile"...' >&4
16606 $cat >try.c <<'EOCP'
16609 typedef struct _goo_struct goo_struct;
16610 goo_struct * volatile goo = ((goo_struct *)0);
16611 struct _goo_struct {
16616 typedef unsigned short foo_t;
16617 char *volatile foo;
16619 volatile foo_t blech;
16623 if $cc -c $ccflags try.c >/dev/null 2>&1 ; then
16625 echo "Yup, it does."
16628 echo "Nope, it doesn't."
16634 : Check basic sizes
16636 $echo "Choosing the C types to be used for Perl's internal types..." >&4
16638 case "$use64bitint:$d_quad:$quadtype" in
16641 uvtype="$uquadtype"
16646 uvtype="unsigned long"
16652 case "$uselongdouble:$d_longdbl" in
16654 nvtype="long double"
16655 nvsize=$longdblsize
16662 case "$usequadmath:$i_quadmath" in
16664 nvtype="__float128"
16670 *** You requested the use of the quadmath library, but you
16671 *** do not seem to have the quadmath library installed.
16672 *** Cannot continue, aborting.
16678 define:*) $cat <<EOM >&4
16680 *** You requested the use of the quadmath library, but you
16681 *** do not seem to have the required header, <quadmath.h>.
16683 case "$gccversion" in
16686 *** Your gcc looks a bit old:
16692 *** You are not running a gcc.
16697 *** For the quadmath library you need at least gcc 4.6.
16698 *** Cannot continue, aborting.
16704 $echo "(IV will be "$ivtype", $ivsize bytes)"
16705 $echo "(UV will be "$uvtype", $uvsize bytes)"
16706 $echo "(NV will be "$nvtype", $nvsize bytes)"
16709 #$i_inttypes I_INTTYPES
16711 #include <inttypes.h>
16716 int8_t i = INT8_MAX;
16717 uint8_t u = UINT8_MAX;
16718 printf("int8_t\n");
16721 int16_t i = INT16_MAX;
16722 uint16_t u = UINT16_MAX;
16723 printf("int16_t\n");
16726 int32_t i = INT32_MAX;
16727 uint32_t u = UINT32_MAX;
16728 printf("int32_t\n");
16733 i8type="signed char"
16734 u8type="unsigned char"
16739 '') case "$shortsize" in
16741 u16type="unsigned short"
16749 '') set try -DINT16
16750 if eval $compile; then
16751 case "`$run ./try`" in
16763 '') if $test $shortsize -ge 2; then
16765 u16type="unsigned short"
16773 '') case "$longsize" in
16775 u32type="unsigned long"
16779 *) case "$intsize" in
16781 u32type="unsigned int"
16791 '') set try -DINT32
16792 if eval $compile; then
16793 case "`$run ./try`" in
16805 '') if $test $intsize -ge 4; then
16807 u32type="unsigned int"
16815 '') case "$d_quad:$quadtype" in
16817 i64type="$quadtype"
16818 u64type="$uquadtype"
16826 $echo "Checking how many bits of your UVs your NVs can preserve..." >&4
16827 : volatile so that the compiler has to store it out to memory.
16828 if test X"$d_volatile" = X"$define"; then
16833 #$i_stdlib I_STDLIB
16835 #include <stdlib.h>
16837 #include <sys/types.h>
16838 #include <signal.h>
16840 $volatile int bletched = 0;
16841 $signal_t blech(int s) { bletched = 1; }
16846 int n = 8 * $uvsize;
16849 signal(SIGFPE, blech);
16852 for (i = 0; i < n; i++) {
16853 u = u << 1 | ($uvtype)1;
16855 if (($uvtype)d != u)
16859 d = ($nvtype)(u - 1);
16860 if (($uvtype)d != (u - 1))
16867 printf("%d\n", ((i == n) ? -n : i));
16873 d_nv_preserves_uv="$undef"
16874 if eval $compile; then
16875 nv_preserves_uv_bits="`$run ./try`"
16877 case "$nv_preserves_uv_bits" in
16879 nv_preserves_uv_bits=`expr 0 - $nv_preserves_uv_bits`
16880 $echo "Your NVs can preserve all $nv_preserves_uv_bits bits of your UVs." 2>&1
16881 d_nv_preserves_uv="$define"
16883 [1-9]*) $echo "Your NVs can preserve only $nv_preserves_uv_bits bits of your UVs." 2>&1
16884 d_nv_preserves_uv="$undef" ;;
16885 *) $echo "Can't figure out how many bits your NVs preserve." 2>&1
16886 nv_preserves_uv_bits="0" ;;
16890 $echo "Checking to find the largest integer value your NVs can hold..." >&4
16891 : volatile so that the compiler has to store it out to memory.
16892 if test X"$d_volatile" = X"$define"; then
16898 typedef $nvtype NV;
16905 while(count < 256) {
16906 $volatile NV up = value + 1.0;
16907 $volatile NV negated = -value;
16908 $volatile NV down = negated - 1.0;
16909 $volatile NV got_up = up - value;
16910 int up_good = got_up == 1.0;
16911 int got_down = down - negated;
16912 int down_good = got_down == -1.0;
16914 if (down_good != up_good) {
16916 "Inconsistency - up %d %f; down %d %f; for 2**%d (%.20f)\n",
16917 up_good, (double) got_up, down_good, (double) got_down,
16918 count, (double) value);
16925 fputs("256.0", stdout);
16928 fputs("2.0", stdout);
16934 fputs("*", stdout);
16940 fprintf(stderr, "Cannot overflow integer range, even at 2**%d (%.20f)\n",
16941 count, (double) value);
16947 nv_overflows_integers_at='0'
16948 if eval $compile; then
16954 The largest integer your NVs can preserve is equal to $xxx
16956 nv_overflows_integers_at="$xxx"
16959 Cannot determine the largest integer value your NVs can hold, unexpected output
16966 Cannot determine the largest integer value your NVs can hold
16973 $echo "Checking whether NV 0.0 is all bits zero in memory..." >&4
16974 : volatile so that the compiler has to store it out to memory.
16975 if test X"$d_volatile" = X"$define"; then
16980 #$i_stdlib I_STDLIB
16982 #include <stdlib.h>
16984 #$i_string I_STRING
16986 # include <string.h>
16988 # include <strings.h>
16990 #include <sys/types.h>
16991 #include <signal.h>
16993 $volatile int bletched = 0;
16994 $signal_t blech(int s) { bletched = 1; }
16997 int checkit($nvtype d, char *where) {
16998 unsigned char *p = (char *)&d;
16999 unsigned char *end = p + sizeof(d);
17009 printf("No - %s: 0x", where);
17011 printf ("%02X", *p++);
17016 int main(int argc, char **argv) {
17019 fail += checkit(d, "0.0");
17021 /* The compiler shouldn't be assuming that bletched is 0 */
17024 fail += checkit(d, "bleched");
17027 signal(SIGFPE, blech);
17030 /* Paranoia - the compiler should have no way of knowing that ANSI says
17031 that argv[argc] will always be NULL. Actually, if it did assume this it
17032 would be buggy, as this is C and main() can be called from elsewhere in
17034 d = argv[argc] ? 1 : 0;
17037 printf("Odd argv[argc]=%p, d=%g\n", argv[argc], d);
17040 fail += checkit(d, "ternary");
17042 memset(&d, sizeof(d), argv[argc] ? 1 : 0);
17045 printf("No - memset doesn't give 0.0\n");
17046 /* This might just blow up: */
17047 printf("(gives %g)\n", d);
17053 printf("No - something bleched\n");
17058 printf("No - %d fail(s)\n", fail);
17067 d_nv_zero_is_allbits_zero="$undef"
17068 if eval $compile; then
17074 0.0 is represented as all bits zero in memory
17076 d_nv_zero_is_allbits_zero="$define"
17079 0.0 is not represented as all bits zero in memory
17081 d_nv_zero_is_allbits_zero="$undef"
17086 0.0 is not represented as all bits zero in memory
17088 d_nv_zero_is_allbits_zero="$undef"
17094 : check for off64_t
17096 echo "Checking to see if you have off64_t..." >&4
17098 #include <sys/types.h>
17099 #include <unistd.h>
17100 int main() { off64_t x = 7; }
17103 if eval $compile; then
17105 echo "You have off64_t."
17108 echo "You do not have off64_t."
17109 case "$lseeksize" in
17110 8) echo "(Your off_t is 64 bits, so you could use that.)" ;;
17117 : how to create joinable pthreads
17118 if test "X$usethreads" = "X$define" -a "X$i_pthread" = "X$define"; then
17120 echo "Checking what constant to use for creating joinable pthreads..." >&4
17121 $cat >try.c <<'EOCP'
17122 #include <pthread.h>
17124 int detachstate = JOINABLE;
17127 set try -DJOINABLE=PTHREAD_CREATE_JOINABLE
17128 if eval $compile; then
17129 echo "You seem to use PTHREAD_CREATE_JOINABLE." >&4
17130 val="$undef" # Yes, undef.
17131 set d_old_pthread_create_joinable
17134 set old_pthread_create_joinable
17137 set try -DJOINABLE=PTHREAD_CREATE_UNDETACHED
17138 if eval $compile; then
17139 echo "You seem to use PTHREAD_CREATE_UNDETACHED." >&4
17141 set d_old_pthread_create_joinable
17143 val=PTHREAD_CREATE_UNDETACHED
17144 set old_pthread_create_joinable
17147 set try -DJOINABLE=__UNDETACHED
17148 if eval $compile; then
17149 echo "You seem to use __UNDETACHED." >&4
17151 set d_old_pthread_create_joinable
17154 set old_pthread_create_joinable
17157 echo "Egads, nothing obvious found. Guessing that you use 0." >&4
17159 set d_old_pthread_create_joinable
17162 set old_pthread_create_joinable
17169 d_old_pthread_create_joinable="$undef"
17170 old_pthread_create_joinable=""
17173 : see if pause exists
17177 : see if poll exists
17181 : see if prctl exists
17185 : see if prctl supports PR_SET_NAME
17186 d_prctl_set_name=$undef
17191 #include <unistd.h>
17193 #include <sys/prctl.h>
17195 int main (int argc, char *argv[])
17197 return (prctl (PR_SET_NAME, "Test"));
17201 if eval $compile_ok && $run ./try; then
17202 echo "Your prctl (PR_SET_NAME, ...) works"
17203 d_prctl_set_name=$define
17209 : see if readlink exists
17210 set readlink d_readlink
17213 : Check if there is a /proc symlink to the abs path of
17214 : the executing program. We will honor hints of d_procselfexe=$undef
17215 : or procselfexe being non-empty, otherwise will try to determine both
17216 : if we have readlink.
17217 : AmigaOS will attempt to mount proc: aka /proc, if /proc/... is
17218 : referenced, and AmigaOS does not have a proc filesystem anyway.
17221 if $test "X$d_procselfexe" = Xundef; then
17223 elif $test "X$procselfexe" != X -a "X$procselfexe" != 'X '; then
17225 elif $test "X$d_readlink" = Xdefine; then
17226 : NetBSD first as /proc/self is a symlink to /proc/curproc,
17227 : and it feels more tidy to avoid an extra level of symlink
17228 set NetBSD /proc/curproc/exe Linux /proc/self/exe FreeBSD /proc/curproc/file Solaris /proc/self/path/a.out
17229 while test $# -gt 0; do
17232 if $issymlink $try; then
17233 $ls -l $try > reflect
17234 if $contains /`basename $ls` reflect >/dev/null 2>&1; then
17235 echo "You have $type-like $try."
17236 procselfexe='"'$try'"'
17238 : This will break out of the loop
17248 : backward compatibility for d_hvfork
17249 if test X$d_hvfork != X; then
17250 d_vfork="$d_hvfork"
17253 : see if there is a vfork
17258 d_pseudofork=$undef
17260 : Ok, but do we want to use it. vfork is reportedly unreliable in
17261 : perl on Solaris 2.x, and probably elsewhere.
17265 case "$usevfork" in
17271 Perl can only use a vfork() that doesn't suffer from strict
17272 restrictions on calling functions or modifying global data in
17273 the child. For example, glibc-2.1 contains such a vfork()
17274 that is unsuitable. If your system provides a proper fork()
17275 call, chances are that you do NOT want perl to use vfork().
17278 rp="Do you still want to use vfork()?"
17283 echo "Ok, we won't use vfork()."
17292 $define) usevfork='true';;
17293 *) usevfork='false';;
17296 : see whether the pthread_atfork exists
17298 #include <pthread.h>
17301 #ifdef PTHREAD_ATFORK
17302 pthread_atfork(NULL,NULL,NULL);
17307 : see if pthread_atfork exists
17308 set try -DPTHREAD_ATFORK
17309 if eval $compile; then
17314 case "$usethreads" in
17317 $define) echo 'pthread_atfork found.' >&4 ;;
17318 *) echo 'pthread_atfork NOT found.' >&4 ;;
17321 set d_pthread_atfork
17324 : see if pthread_attr_setscope exists
17325 set pthread_attr_setscope d_pthread_attr_setscope
17328 : see whether the various POSIXish _yields exist
17330 #include <pthread.h>
17336 #ifdef PTHREAD_YIELD
17339 #ifdef PTHREAD_YIELD_NULL
17340 pthread_yield(NULL);
17346 : see if sched_yield exists
17347 set try -DSCHED_YIELD
17348 if eval $compile; then
17350 sched_yield='sched_yield()'
17354 case "$usethreads" in
17357 $define) echo 'sched_yield() found.' >&4 ;;
17358 *) echo 'sched_yield() NOT found.' >&4 ;;
17364 : see if pthread_yield exists
17365 set try -DPTHREAD_YIELD
17366 if eval $compile; then
17368 case "$sched_yield" in
17369 '') sched_yield='pthread_yield()' ;;
17372 set try -DPTHREAD_YIELD_NULL
17373 if eval $compile; then
17375 case "$sched_yield" in
17376 '') sched_yield='pthread_yield(NULL)' ;;
17382 case "$usethreads" in
17385 $define) echo 'pthread_yield() found.' >&4 ;;
17386 *) echo 'pthread_yield() NOT found.' >&4 ;;
17390 set d_pthread_yield
17392 case "$sched_yield" in
17393 '') sched_yield=undef ;;
17397 : check for ptrdiff_t
17399 echo "Checking to see if you have ptrdiff_t..." >&4
17401 #include <stddef.h>
17402 int main() { ptrdiff_t x = 7; }
17405 if eval $compile; then
17407 echo "You have ptrdiff_t."
17410 echo "You do not have ptrdiff_t."
17416 : see if random_r exists
17417 set random_r d_random_r
17419 case "$d_random_r" in
17421 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
17422 case "$d_random_r_proto:$usethreads" in
17423 ":define") d_random_r_proto=define
17424 set d_random_r_proto random_r $hdrs
17428 case "$d_random_r_proto" in
17430 case "$random_r_proto" in
17431 ''|0) try='int random_r(int*, struct random_data*);'
17432 ./protochk "$extern_C $try" $hdrs && random_r_proto=I_iS ;;
17434 case "$random_r_proto" in
17435 ''|0) try='int random_r(long*, struct random_data*);'
17436 ./protochk "$extern_C $try" $hdrs && random_r_proto=I_lS ;;
17438 case "$random_r_proto" in
17439 ''|0) try='int random_r(struct random_data*, int32_t*);'
17440 ./protochk "$extern_C $try" $hdrs && random_r_proto=I_St ;;
17442 case "$random_r_proto" in
17443 ''|0) d_random_r=undef
17445 echo "Disabling random_r, cannot determine prototype." >&4 ;;
17446 * ) case "$random_r_proto" in
17447 REENTRANT_PROTO*) ;;
17448 *) random_r_proto="REENTRANT_PROTO_$random_r_proto" ;;
17450 echo "Prototype: $try" ;;
17453 *) case "$usethreads" in
17454 define) echo "random_r has no prototype, not using it." >&4 ;;
17461 *) random_r_proto=0
17465 : see if readdir and friends exist
17466 set readdir d_readdir
17468 set seekdir d_seekdir
17470 set telldir d_telldir
17472 set rewinddir d_rewinddir
17475 : see if readdir64_r exists
17476 set readdir64_r d_readdir64_r
17478 case "$d_readdir64_r" in
17480 hdrs="$i_systypes sys/types.h define stdio.h $i_dirent dirent.h"
17481 case "$d_readdir64_r_proto:$usethreads" in
17482 ":define") d_readdir64_r_proto=define
17483 set d_readdir64_r_proto readdir64_r $hdrs
17487 case "$d_readdir64_r_proto" in
17489 case "$readdir64_r_proto" in
17490 ''|0) try='int readdir64_r(DIR*, struct dirent64*, struct dirent64**);'
17491 ./protochk "$extern_C $try" $hdrs && readdir64_r_proto=I_TSR ;;
17493 case "$readdir64_r_proto" in
17494 ''|0) try='int readdir64_r(DIR*, struct dirent64*);'
17495 ./protochk "$extern_C $try" $hdrs && readdir64_r_proto=I_TS ;;
17497 case "$readdir64_r_proto" in
17498 ''|0) d_readdir64_r=undef
17499 readdir64_r_proto=0
17500 echo "Disabling readdir64_r, cannot determine prototype." >&4 ;;
17501 * ) case "$readdir64_r_proto" in
17502 REENTRANT_PROTO*) ;;
17503 *) readdir64_r_proto="REENTRANT_PROTO_$readdir64_r_proto" ;;
17505 echo "Prototype: $try" ;;
17508 *) case "$usethreads" in
17509 define) echo "readdir64_r has no prototype, not using it." >&4 ;;
17511 d_readdir64_r=undef
17512 readdir64_r_proto=0
17516 *) readdir64_r_proto=0
17520 : see if readdir_r exists
17521 set readdir_r d_readdir_r
17523 case "$d_readdir_r" in
17525 hdrs="$i_systypes sys/types.h define stdio.h $i_dirent dirent.h"
17526 case "$d_readdir_r_proto:$usethreads" in
17527 ":define") d_readdir_r_proto=define
17528 set d_readdir_r_proto readdir_r $hdrs
17532 case "$d_readdir_r_proto" in
17534 case "$readdir_r_proto" in
17535 ''|0) try='int readdir_r(DIR*, struct dirent*, struct dirent**);'
17536 ./protochk "$extern_C $try" $hdrs && readdir_r_proto=I_TSR ;;
17538 case "$readdir_r_proto" in
17539 ''|0) try='int readdir_r(DIR*, struct dirent*);'
17540 ./protochk "$extern_C $try" $hdrs && readdir_r_proto=I_TS ;;
17542 case "$readdir_r_proto" in
17543 ''|0) d_readdir_r=undef
17545 echo "Disabling readdir_r, cannot determine prototype." >&4 ;;
17546 * ) case "$readdir_r_proto" in
17547 REENTRANT_PROTO*) ;;
17548 *) readdir_r_proto="REENTRANT_PROTO_$readdir_r_proto" ;;
17550 echo "Prototype: $try" ;;
17553 *) case "$usethreads" in
17554 define) echo "readdir_r has no prototype, not using it." >&4 ;;
17561 *) readdir_r_proto=0
17565 : see if readv exists
17569 : see if recvmsg exists
17570 set recvmsg d_recvmsg
17573 : see if regcomp, regcmp, or re_comp exist, for regular pattern matching
17575 if set regcomp val -f d_regcomp; eval $csym; $val; then
17576 echo 'regcomp() found.' >&4
17577 d_regcomp="$define"
17580 elif set regcmp val -f d_regcmp; eval $csym; $val; then
17581 echo 'regcmp() found.' >&4
17585 elif set re_comp val -f d_re_comp; eval $csym; $val; then
17586 echo 're_comp() found, assuming re_exec() also exists.' >&4
17587 d_re_comp="$define"
17592 No regcomp(), regcmp() nor re_comp() found !! No regular pattern matching.
17599 : see if remainder exists
17600 set remainder d_remainder
17603 : see if remquo exists
17604 set remquo d_remquo
17607 : see if rename exists
17608 set rename d_rename
17611 : see if rint exists
17615 : see if rmdir exists
17619 : see if round exists
17623 : see if memory.h is available.
17628 : See if it conflicts with string.h
17634 $cppstdin $cppflags $cppminus < $strings > mem.h
17635 if $contains 'memcpy' mem.h >/dev/null 2>&1; then
17637 echo "We won't be including <memory.h>."
17647 : can bcopy handle overlapping blocks?
17650 case "$d_memmove" in
17651 "$define") echo "I'll use memmove() instead of bcopy() for overlapping copies." ;;
17652 *) case "$d_bcopy" in
17654 echo "Checking to see if bcopy() can do overlapping copies..." >&4
17656 #$i_memory I_MEMORY
17657 #$i_stdlib I_STDLIB
17658 #$i_string I_STRING
17659 #$i_unistd I_UNISTD
17661 $cat >>try.c <<'EOCP'
17664 # include <memory.h>
17667 # include <stdlib.h>
17670 # include <string.h>
17672 # include <strings.h>
17675 # include <unistd.h> /* Needed for NetBSD */
17679 char buf[128], abc[128];
17685 /* Copy "abcde..." string to char abc[] so that gcc doesn't
17686 try to store the string in read-only memory. */
17687 bcopy("abcdefghijklmnopqrstuvwxyz0123456789", abc, 36);
17689 for (align = 7; align >= 0; align--) {
17690 for (len = 36; len; len--) {
17692 bcopy(abc, b, len);
17693 for (off = 1; off <= len; off++) {
17694 bcopy(b, b+off, len);
17695 bcopy(b+off, b, len);
17696 if (bcmp(b, abc, len))
17705 if eval $compile_ok; then
17706 if $run ./try 2>/dev/null; then
17707 echo "Yes, it can."
17710 echo "It can't, sorry."
17713 echo "(I can't compile the test program, so we'll assume not...)"
17723 : can memcpy handle overlapping blocks?
17726 case "$d_memmove" in
17727 "$define") echo "I'll use memmove() instead of memcpy() for overlapping copies." ;;
17728 *) case "$d_memcpy" in
17730 echo "Checking to see if memcpy() can do overlapping copies..." >&4
17732 #$i_memory I_MEMORY
17733 #$i_stdlib I_STDLIB
17734 #$i_string I_STRING
17735 #$i_unistd I_UNISTD
17737 $cat >>try.c <<'EOCP'
17740 # include <memory.h>
17743 # include <stdlib.h>
17746 # include <string.h>
17748 # include <strings.h>
17751 # include <unistd.h> /* Needed for NetBSD */
17755 char buf[128], abc[128];
17761 /* Copy "abcde..." string to char abc[] so that gcc doesn't
17762 try to store the string in read-only memory. */
17763 memcpy(abc, "abcdefghijklmnopqrstuvwxyz0123456789", 36);
17765 for (align = 7; align >= 0; align--) {
17766 for (len = 36; len; len--) {
17768 memcpy(b, abc, len);
17769 for (off = 1; off <= len; off++) {
17770 memcpy(b+off, b, len);
17771 memcpy(b, b+off, len);
17772 if (memcmp(b, abc, len))
17781 if eval $compile_ok; then
17782 if $run ./try 2>/dev/null; then
17783 echo "Yes, it can."
17786 echo "It can't, sorry."
17789 echo "(I can't compile the test program, so we'll assume not...)"
17799 : can memcmp be trusted to compare relative magnitude?
17801 case "$d_memcmp" in
17804 echo "Checking if your memcmp() can compare relative magnitude..." >&4
17806 #$i_memory I_MEMORY
17807 #$i_stdlib I_STDLIB
17808 #$i_string I_STRING
17809 #$i_unistd I_UNISTD
17811 $cat >>try.c <<'EOCP'
17814 # include <memory.h>
17817 # include <stdlib.h>
17820 # include <string.h>
17822 # include <strings.h>
17825 # include <unistd.h> /* Needed for NetBSD */
17831 if ((a < b) && memcmp(&a, &b, 1) < 0)
17837 if eval $compile_ok; then
17838 if $run ./try 2>/dev/null; then
17839 echo "Yes, it can."
17842 echo "No, it can't (it uses signed chars)."
17845 echo "(I can't compile the test program, so we'll assume not...)"
17853 : see if prototype for sbrk is available
17855 set d_sbrkproto sbrk $i_unistd unistd.h
17858 : see if scalbn exists
17859 set scalbn d_scalbn
17862 : see if select exists
17863 set select d_select
17866 : see if semctl exists
17867 set semctl d_semctl
17870 : see if semget exists
17871 set semget d_semget
17874 : see if semop exists
17878 : see how much of the 'sem*(2)' library is present.
17881 case "$d_semctl$d_semget$d_semop" in
17882 *"$undef"*) h_sem=false;;
17886 case "`ipcs 2>&1`" in
17887 "SVID messages"*"not configured"*)
17888 echo "Your $osname does not have the sem*(2) configured." >&4
17891 set semctl d_semctl
17893 set semget d_semget
17901 : we could also check for sys/ipc.h ...
17902 if $h_sem && $test `./findhdr sys/sem.h`; then
17903 echo "You have the full sem*(2) library." >&4
17906 echo "You don't have the full sem*(2) library." >&4
17912 : see whether sys/sem.h defines union semun
17914 $cat > try.c <<'END'
17915 #include <sys/types.h>
17916 #include <sys/ipc.h>
17917 #include <sys/sem.h>
17918 int main () { union semun semun; semun.buf = 0; }
17921 if eval $compile; then
17922 echo "You have union semun in <sys/sem.h>." >&4
17925 echo "You do not have union semun in <sys/sem.h>." >&4
17932 : see how to do semctl IPC_STAT
17936 $cat > tryh.h <<END
17939 # define S_IRUSR S_IREAD
17940 # define S_IWUSR S_IWRITE
17941 # define S_IXUSR S_IEXEC
17943 # define S_IRUSR 0400
17944 # define S_IWUSR 0200
17945 # define S_IXUSR 0100
17947 # define S_IRGRP (S_IRUSR>>3)
17948 # define S_IWGRP (S_IWUSR>>3)
17949 # define S_IXGRP (S_IXUSR>>3)
17950 # define S_IROTH (S_IRUSR>>6)
17951 # define S_IWOTH (S_IWUSR>>6)
17952 # define S_IXOTH (S_IXUSR>>6)
17955 # define S_IRWXU (S_IRUSR|S_IWUSR|S_IXUSR)
17956 # define S_IRWXG (S_IRGRP|S_IWGRP|S_IXGRP)
17957 # define S_IRWXO (S_IROTH|S_IWOTH|S_IXOTH)
17960 : see whether semctl IPC_STAT can use union semun
17961 case "$d_semctl_semun" in
17965 #include <sys/types.h>
17966 #include <sys/ipc.h>
17967 #include <sys/sem.h>
17968 #include <sys/stat.h>
17975 #$d_union_semun HAS_UNION_SEMUN
17978 #ifndef HAS_UNION_SEMUN
17981 struct semid_ds *buf;
17982 unsigned short *array;
17988 #if defined(IPC_PRIVATE) && defined(S_IRWXU) && defined(S_IRWXG) && defined(S_IRWXO) && defined(IPC_CREAT)
17989 sem = semget(IPC_PRIVATE, 1, S_IRWXU|S_IRWXG|S_IRWXO|IPC_CREAT);
17991 struct semid_ds argbuf;
17994 st = semctl(sem, 0, IPC_STAT, arg);
17998 # endif /* IPC_STAT */
17999 printf("semctl IPC_STAT failed: errno = %d\n", errno);
18001 if (semctl(sem, 0, IPC_RMID, arg) != 0)
18002 # endif /* IPC_RMID */
18003 printf("semctl IPC_RMID failed: errno = %d\n", errno);
18005 #endif /* IPC_PRIVATE && ... */
18006 printf("semget failed: errno = %d\n", errno);
18011 if eval $compile; then
18014 semun) val="$define" ;;
18022 case "$d_semctl_semun" in
18024 echo "You can use union semun for semctl IPC_STAT." >&4
18027 *) echo "You cannot use union semun for semctl IPC_STAT." >&4
18032 : see whether semctl IPC_STAT can use struct semid_ds pointer
18033 case "$d_semctl_semid_ds" in
18036 $cat > try.c <<'END'
18037 #include <sys/types.h>
18038 #include <sys/ipc.h>
18039 #include <sys/sem.h>
18040 #include <sys/stat.h>
18048 struct semid_ds arg;
18051 #if defined(IPC_PRIVATE) && defined(S_IRWXU) && defined(S_IRWXG) && defined(S_IRWXO) && defined(IPC_CREAT)
18052 sem = semget(IPC_PRIVATE, 1, S_IRWXU|S_IRWXG|S_IRWXO|IPC_CREAT);
18055 st = semctl(sem, 0, IPC_STAT, &arg);
18057 printf("semid_ds\n");
18059 # endif /* IPC_STAT */
18060 printf("semctl IPC_STAT failed: errno = %d\n", errno);
18062 if (semctl(sem, 0, IPC_RMID, &arg) != 0)
18063 # endif /* IPC_RMID */
18064 printf("semctl IPC_RMID failed: errno = %d\n", errno);
18066 #endif /* IPC_PRIVATE && ... */
18067 printf("semget failed: errno = %d\n", errno);
18073 if eval $compile; then
18076 semid_ds) val="$define" ;;
18080 set d_semctl_semid_ds
18084 case "$d_semctl_semid_ds" in
18086 echo "You can $also use struct semid_ds* for semctl IPC_STAT." >&4
18088 *) echo "You cannot use struct semid_ds* for semctl IPC_STAT." >&4
18094 # We do not have the full sem*(2) library, so assume we can not
18100 set d_semctl_semid_ds
18106 : see if sendmsg exists
18107 set sendmsg d_sendmsg
18110 : see if setegid exists
18111 set setegid d_setegid
18114 : see if seteuid exists
18115 set seteuid d_seteuid
18118 : see if setgrent exists
18119 set setgrent d_setgrent
18122 : see if setgrent_r exists
18123 set setgrent_r d_setgrent_r
18125 case "$d_setgrent_r" in
18127 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
18128 case "$d_setgrent_r_proto:$usethreads" in
18129 ":define") d_setgrent_r_proto=define
18130 set d_setgrent_r_proto setgrent_r $hdrs
18134 case "$d_setgrent_r_proto" in
18136 case "$setgrent_r_proto" in
18137 ''|0) try='int setgrent_r(FILE**);'
18138 ./protochk "$extern_C $try" $hdrs && setgrent_r_proto=I_H ;;
18140 case "$setgrent_r_proto" in
18141 ''|0) try='void setgrent_r(FILE**);'
18142 ./protochk "$extern_C $try" $hdrs && setgrent_r_proto=V_H ;;
18144 case "$setgrent_r_proto" in
18145 ''|0) d_setgrent_r=undef
18147 echo "Disabling setgrent_r, cannot determine prototype." >&4 ;;
18148 * ) case "$setgrent_r_proto" in
18149 REENTRANT_PROTO*) ;;
18150 *) setgrent_r_proto="REENTRANT_PROTO_$setgrent_r_proto" ;;
18152 echo "Prototype: $try" ;;
18155 *) case "$usethreads" in
18156 define) echo "setgrent_r has no prototype, not using it." >&4 ;;
18163 *) setgrent_r_proto=0
18167 : see if sethostent exists
18168 set sethostent d_sethent
18171 : see if sethostent_r exists
18172 set sethostent_r d_sethostent_r
18174 case "$d_sethostent_r" in
18176 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
18177 case "$d_sethostent_r_proto:$usethreads" in
18178 ":define") d_sethostent_r_proto=define
18179 set d_sethostent_r_proto sethostent_r $hdrs
18183 case "$d_sethostent_r_proto" in
18185 case "$sethostent_r_proto" in
18186 ''|0) try='int sethostent_r(int, struct hostent_data*);'
18187 ./protochk "$extern_C $try" $hdrs && sethostent_r_proto=I_ID ;;
18189 case "$sethostent_r_proto" in
18190 ''|0) try='void sethostent_r(int, struct hostent_data*);'
18191 ./protochk "$extern_C $try" $hdrs && sethostent_r_proto=V_ID ;;
18193 case "$sethostent_r_proto" in
18194 ''|0) d_sethostent_r=undef
18195 sethostent_r_proto=0
18196 echo "Disabling sethostent_r, cannot determine prototype." >&4 ;;
18197 * ) case "$sethostent_r_proto" in
18198 REENTRANT_PROTO*) ;;
18199 *) sethostent_r_proto="REENTRANT_PROTO_$sethostent_r_proto" ;;
18201 echo "Prototype: $try" ;;
18204 *) case "$usethreads" in
18205 define) echo "sethostent_r has no prototype, not using it." >&4 ;;
18207 d_sethostent_r=undef
18208 sethostent_r_proto=0
18212 *) sethostent_r_proto=0
18216 : see if setitimer exists
18217 set setitimer d_setitimer
18220 : see if setlinebuf exists
18221 set setlinebuf d_setlinebuf
18224 : see if setlocale exists
18225 set setlocale d_setlocale
18228 : see if locale.h is available
18229 set locale.h i_locale
18232 : see if setlocale_r exists
18233 set setlocale_r d_setlocale_r
18235 case "$d_setlocale_r" in
18237 hdrs="$i_systypes sys/types.h define stdio.h $i_locale locale.h"
18238 case "$d_setlocale_r_proto:$usethreads" in
18239 ":define") d_setlocale_r_proto=define
18240 set d_setlocale_r_proto setlocale_r $hdrs
18244 case "$d_setlocale_r_proto" in
18246 case "$setlocale_r_proto" in
18247 ''|0) try='int setlocale_r(int, const char*, char*, int);'
18248 ./protochk "$extern_C $try" $hdrs && setlocale_r_proto=I_ICBI ;;
18250 case "$setlocale_r_proto" in
18251 ''|0) d_setlocale_r=undef
18252 setlocale_r_proto=0
18253 echo "Disabling setlocale_r, cannot determine prototype." >&4 ;;
18254 * ) case "$setlocale_r_proto" in
18255 REENTRANT_PROTO*) ;;
18256 *) setlocale_r_proto="REENTRANT_PROTO_$setlocale_r_proto" ;;
18258 echo "Prototype: $try" ;;
18261 *) case "$usethreads" in
18262 define) echo "setlocale_r has no prototype, not using it." >&4 ;;
18264 d_setlocale_r=undef
18265 setlocale_r_proto=0
18269 *) setlocale_r_proto=0
18273 : see if setnetent exists
18274 set setnetent d_setnent
18277 : see if setnetent_r exists
18278 set setnetent_r d_setnetent_r
18280 case "$d_setnetent_r" in
18282 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
18283 case "$d_setnetent_r_proto:$usethreads" in
18284 ":define") d_setnetent_r_proto=define
18285 set d_setnetent_r_proto setnetent_r $hdrs
18289 case "$d_setnetent_r_proto" in
18291 case "$setnetent_r_proto" in
18292 ''|0) try='int setnetent_r(int, struct netent_data*);'
18293 ./protochk "$extern_C $try" $hdrs && setnetent_r_proto=I_ID ;;
18295 case "$setnetent_r_proto" in
18296 ''|0) try='void setnetent_r(int, struct netent_data*);'
18297 ./protochk "$extern_C $try" $hdrs && setnetent_r_proto=V_ID ;;
18299 case "$setnetent_r_proto" in
18300 ''|0) d_setnetent_r=undef
18301 setnetent_r_proto=0
18302 echo "Disabling setnetent_r, cannot determine prototype." >&4 ;;
18303 * ) case "$setnetent_r_proto" in
18304 REENTRANT_PROTO*) ;;
18305 *) setnetent_r_proto="REENTRANT_PROTO_$setnetent_r_proto" ;;
18307 echo "Prototype: $try" ;;
18310 *) case "$usethreads" in
18311 define) echo "setnetent_r has no prototype, not using it." >&4 ;;
18313 d_setnetent_r=undef
18314 setnetent_r_proto=0
18318 *) setnetent_r_proto=0
18322 : see if setprotoent exists
18323 set setprotoent d_setpent
18326 : see if setpgid exists
18327 set setpgid d_setpgid
18330 : see if setpgrp2 exists
18331 set setpgrp2 d_setpgrp2
18334 : see if setpriority exists
18335 set setpriority d_setprior
18338 : see if setproctitle exists
18339 set setproctitle d_setproctitle
18342 : see if setprotoent_r exists
18343 set setprotoent_r d_setprotoent_r
18345 case "$d_setprotoent_r" in
18347 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
18348 case "$d_setprotoent_r_proto:$usethreads" in
18349 ":define") d_setprotoent_r_proto=define
18350 set d_setprotoent_r_proto setprotoent_r $hdrs
18354 case "$d_setprotoent_r_proto" in
18356 case "$setprotoent_r_proto" in
18357 ''|0) try='int setprotoent_r(int, struct protoent_data*);'
18358 ./protochk "$extern_C $try" $hdrs && setprotoent_r_proto=I_ID ;;
18360 case "$setprotoent_r_proto" in
18361 ''|0) try='void setprotoent_r(int, struct protoent_data*);'
18362 ./protochk "$extern_C $try" $hdrs && setprotoent_r_proto=V_ID ;;
18364 case "$setprotoent_r_proto" in
18365 ''|0) d_setprotoent_r=undef
18366 setprotoent_r_proto=0
18367 echo "Disabling setprotoent_r, cannot determine prototype." >&4 ;;
18368 * ) case "$setprotoent_r_proto" in
18369 REENTRANT_PROTO*) ;;
18370 *) setprotoent_r_proto="REENTRANT_PROTO_$setprotoent_r_proto" ;;
18372 echo "Prototype: $try" ;;
18375 *) case "$usethreads" in
18376 define) echo "setprotoent_r has no prototype, not using it." >&4 ;;
18378 d_setprotoent_r=undef
18379 setprotoent_r_proto=0
18383 *) setprotoent_r_proto=0
18387 : see if setpwent exists
18388 set setpwent d_setpwent
18391 : see if setpwent_r exists
18392 set setpwent_r d_setpwent_r
18394 case "$d_setpwent_r" in
18396 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
18397 case "$d_setpwent_r_proto:$usethreads" in
18398 ":define") d_setpwent_r_proto=define
18399 set d_setpwent_r_proto setpwent_r $hdrs
18403 case "$d_setpwent_r_proto" in
18405 case "$setpwent_r_proto" in
18406 ''|0) try='int setpwent_r(FILE**);'
18407 ./protochk "$extern_C $try" $hdrs && setpwent_r_proto=I_H ;;
18409 case "$setpwent_r_proto" in
18410 ''|0) try='void setpwent_r(FILE**);'
18411 ./protochk "$extern_C $try" $hdrs && setpwent_r_proto=V_H ;;
18413 case "$setpwent_r_proto" in
18414 ''|0) d_setpwent_r=undef
18416 echo "Disabling setpwent_r, cannot determine prototype." >&4 ;;
18417 * ) case "$setpwent_r_proto" in
18418 REENTRANT_PROTO*) ;;
18419 *) setpwent_r_proto="REENTRANT_PROTO_$setpwent_r_proto" ;;
18421 echo "Prototype: $try" ;;
18424 *) case "$usethreads" in
18425 define) echo "setpwent_r has no prototype, not using it." >&4 ;;
18432 *) setpwent_r_proto=0
18436 : see if setregid exists
18437 set setregid d_setregid
18439 set setresgid d_setresgid
18442 : see if setreuid exists
18443 set setreuid d_setreuid
18445 set setresuid d_setresuid
18448 : see if setrgid exists
18449 set setrgid d_setrgid
18452 : see if setruid exists
18453 set setruid d_setruid
18456 : see if setservent exists
18457 set setservent d_setsent
18460 : see if setservent_r exists
18461 set setservent_r d_setservent_r
18463 case "$d_setservent_r" in
18465 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
18466 case "$d_setservent_r_proto:$usethreads" in
18467 ":define") d_setservent_r_proto=define
18468 set d_setservent_r_proto setservent_r $hdrs
18472 case "$d_setservent_r_proto" in
18474 case "$setservent_r_proto" in
18475 ''|0) try='int setservent_r(int, struct servent_data*);'
18476 ./protochk "$extern_C $try" $hdrs && setservent_r_proto=I_ID ;;
18478 case "$setservent_r_proto" in
18479 ''|0) try='void setservent_r(int, struct servent_data*);'
18480 ./protochk "$extern_C $try" $hdrs && setservent_r_proto=V_ID ;;
18482 case "$setservent_r_proto" in
18483 ''|0) d_setservent_r=undef
18484 setservent_r_proto=0
18485 echo "Disabling setservent_r, cannot determine prototype." >&4 ;;
18486 * ) case "$setservent_r_proto" in
18487 REENTRANT_PROTO*) ;;
18488 *) setservent_r_proto="REENTRANT_PROTO_$setservent_r_proto" ;;
18490 echo "Prototype: $try" ;;
18493 *) case "$usethreads" in
18494 define) echo "setservent_r has no prototype, not using it." >&4 ;;
18496 d_setservent_r=undef
18497 setservent_r_proto=0
18501 *) setservent_r_proto=0
18505 : see if setsid exists
18506 set setsid d_setsid
18509 : see if setvbuf exists
18510 set setvbuf d_setvbuf
18513 : see if shmctl exists
18514 set shmctl d_shmctl
18517 : see if shmget exists
18518 set shmget d_shmget
18521 : see if shmat exists
18524 : see what shmat returns
18527 $cat >shmat.c <<'END'
18528 #include <sys/shm.h>
18531 if $cc $ccflags -c shmat.c >/dev/null 2>&1; then
18536 echo "and it returns ($shmattype)." >&4
18537 : see if a prototype for shmat is available
18538 xxx=`./findhdr sys/shm.h`
18539 $cppstdin $cppflags $cppminus < $xxx > shmat.c 2>/dev/null
18540 if $contains 'shmat.*(' shmat.c >/dev/null 2>&1; then
18551 set d_shmatprototype
18554 : see if shmdt exists
18558 : see how much of the 'shm*(2)' library is present.
18561 case "$d_shmctl$d_shmget$d_shmat$d_shmdt" in
18562 *"$undef"*) h_shm=false;;
18566 case "`ipcs 2>&1`" in
18567 "SVID shared memory"*"not configured"*)
18568 echo "Your $osname does not have the shm*(2) configured." >&4
18571 set shmctl d_shmctl
18573 set shmget d_shmget
18583 : we could also check for sys/ipc.h ...
18584 if $h_shm && $test `./findhdr sys/shm.h`; then
18585 echo "You have the full shm*(2) library." >&4
18588 echo "You don't have the full shm*(2) library." >&4
18594 : see if we have sigaction
18596 if set sigaction val -f d_sigaction; eval $csym; $val; then
18597 echo 'sigaction() found.' >&4
18600 #include <sys/types.h>
18601 #include <signal.h>
18602 #$i_stdlib I_STDLIB
18604 #include <stdlib.h>
18608 struct sigaction act, oact;
18610 oact.sa_handler = 0;
18611 /* so that act and oact are used */
18612 exit(act.sa_flags == 0 && oact.sa_handler == 0);
18616 if eval $compile_ok; then
18619 echo "But you don't seem to have a usable struct sigaction." >&4
18623 echo 'sigaction NOT found.' >&4
18626 set d_sigaction; eval $setvar
18629 : see what type pids are declared as in the kernel
18630 rp="What is the type of process ids on this system?"
18631 set pid_t pidtype int stdio.h sys/types.h
18634 : see what type uids are declared as in the kernel
18636 echo "Looking for the type for user ids returned by getuid()."
18637 set uid_t uidtype xxx stdio.h sys/types.h
18641 xxx=`./findhdr sys/user.h`
18642 set `grep '_ruid;' "$xxx" 2>/dev/null` unsigned short
18644 unsigned) dflt="$1 $2" ;;
18648 *) dflt="$uidtype";;
18651 uid_t) echo "uid_t found." ;;
18652 *) rp="What is the type for user ids returned by getuid()?"
18658 : Define hasfield_t macro for Configure internal use
18659 hasfield_t='varname=$1; struct=$2; type=$3; field=$4; shift; shift; shift; shift;
18660 while $test $# -ge 2; do
18662 $define) echo "#include <$2>";;
18666 echo "int main () { $struct foo; $type bar = foo.$field; }" >> try.c;
18668 if eval $compile; then
18677 : see what siginfo fields we have
18678 case "$d_sigaction" in
18680 echo "Checking if your siginfo_t has si_errno field...">&4
18681 set d_siginfo_si_errno siginfo_t int si_errno $d_sigaction signal.h
18684 echo "Checking if your siginfo_t has si_pid field...">&4
18685 set d_siginfo_si_pid siginfo_t $pidtype si_pid $d_sigaction signal.h
18688 echo "Checking if your siginfo_t has si_uid field...">&4
18689 set d_siginfo_si_uid siginfo_t $uidtype si_uid $d_sigaction signal.h
18692 echo "Checking if your siginfo_t has si_addr field...">&4
18693 set d_siginfo_si_addr siginfo_t "void *" si_addr $d_sigaction signal.h
18696 echo "Checking if your siginfo_t has si_status field...">&4
18697 set d_siginfo_si_status siginfo_t int si_status $d_sigaction signal.h
18700 echo "Checking if your siginfo_t has si_band field...">&4
18701 set d_siginfo_si_band siginfo_t long si_band $d_sigaction signal.h
18704 echo "Checking if your siginfo_t has si_value field...">&4
18705 set d_siginfo_si_value siginfo_t "union sigval" si_value $d_sigaction signal.h
18708 echo "Checking if your siginfo_t has si_fd field...">&4
18709 set d_siginfo_si_fd siginfo_t int si_fd $d_sigaction signal.h
18714 d_siginfo_si_errno="$undef"
18715 d_siginfo_si_pid="$undef"
18716 d_siginfo_si_uid="$undef"
18717 d_siginfo_si_addr="$undef"
18718 d_siginfo_si_status="$undef"
18719 d_siginfo_si_band="$undef"
18720 d_siginfo_si_value="$undef"
18721 d_siginfo_si_fd="$undef"
18725 : see if this is a sunmath.h system
18726 set sunmath.h i_sunmath
18729 : see if signbit exists
18730 $echo $n "Checking to see if you have signbit() available to work on $nvtype... $c" >&4
18733 #$i_sunmath I_SUNMATH
18737 #ifdef I_SUNMATH /* Solaris special math library */
18738 # include <sunmath.h>
18741 int main(int argc, char **argv)
18745 if ((signbit(x) == 0) && (signbit(y) != 0))
18753 if eval $compile; then
18754 if $run ./try; then
18758 $echo "Signbit seems to be available, but doesn't work as I expected."
18759 $echo "I won't use it." >&4
18770 : see if sigprocmask exists
18771 set sigprocmask d_sigprocmask
18774 : see if sigsetjmp exists
18776 case "$d_sigsetjmp" in
18779 #include <setjmp.h>
18780 #$i_stdlib I_STDLIB
18782 #include <stdlib.h>
18788 if (sigsetjmp(env,1))
18791 siglongjmp(env, 1);
18796 if eval $compile; then
18797 if $run ./try >/dev/null 2>&1; then
18798 echo "POSIX sigsetjmp found." >&4
18802 Uh-Oh! You have POSIX sigsetjmp and siglongjmp, but they do not work properly!!
18808 echo "sigsetjmp not found." >&4
18812 *) val="$d_sigsetjmp"
18813 case "$d_sigsetjmp" in
18814 $define) echo "POSIX sigsetjmp found." >&4;;
18815 $undef) echo "sigsetjmp not found." >&4;;
18823 : see if snprintf exists
18824 set snprintf d_snprintf
18827 : see if vsnprintf exists
18828 set vsnprintf d_vsnprintf
18831 case "$d_snprintf-$d_vsnprintf" in
18834 Checking whether your snprintf() and vsnprintf() work okay...
18836 $cat >try.c <<'EOCP'
18837 /* v?snprintf testing logic courtesy of Russ Allbery.
18838 * According to C99:
18839 * - if the buffer is too short it still must be \0-terminated
18840 * - if the buffer is too short the potentially required length
18841 * must be returned and not -1
18842 * - if the buffer is NULL the potentially required length
18843 * must be returned and not -1 or core dump
18846 #include <stdarg.h>
18850 int test (char *format, ...)
18855 va_start (args, format);
18856 count = vsnprintf (buf, sizeof buf, format, args);
18863 return ((test ("%s", "abcd") == 4 && buf[0] == 'a' && buf[1] == '\0'
18864 && snprintf (NULL, 0, "%s", "abcd") == 4) ? 0 : 1);
18868 if eval $compile; then
18871 0) echo "Your snprintf() and vsnprintf() seem to be working okay." ;;
18873 Your snprintf() and snprintf() don't seem to be working okay.
18875 d_snprintf="$undef"
18876 d_vsnprintf="$undef"
18880 echo "(I can't seem to compile the test program--assuming they don't)"
18881 d_snprintf="$undef"
18882 d_vsnprintf="$undef"
18888 : see if sockatmark exists
18889 set sockatmark d_sockatmark
18892 : see if prototype for sockatmark is available
18894 set d_sockatmarkproto sockatmark $d_socket sys/socket.h
18897 : see if socks5_init exists
18898 set socks5_init d_socks5_init
18901 : see if sprintf returns the length of the string in the buffer as per ANSI
18902 $echo "Checking whether sprintf returns the length of the string..." >&4
18905 #$i_stdlib I_STDLIB
18907 #include <stdlib.h>
18909 #$i_string I_STRING
18911 # include <string.h>
18913 # include <strings.h>
18922 int check (size_t expect, int test) {
18923 size_t got = strlen(buffer);
18927 printf("expected %ld, got %ld in test %d '%s'\n", (long) expect, (long) got,
18932 int main(int argc, char **argv) {
18935 check(sprintf(buffer, ""), ++test);
18936 check(sprintf(buffer, "%s %s", "perl", "rules"), ++test);
18937 check(sprintf(buffer, "I like %g", atan2(0,-1)), ++test);
18944 if eval $compile; then
18948 sprintf returns the length of the string (as ANSI says it should)
18950 d_sprintf_returns_strlen="$define"
18953 sprintf does not return the length of the string (how old is this system?)
18955 d_sprintf_returns_strlen="$undef"
18959 echo "(I can't seem to compile the test program--assuming it doesn't)" >&4
18960 d_sprintf_returns_strlen="$undef"
18964 : see if srand48_r exists
18965 set srand48_r d_srand48_r
18967 case "$d_srand48_r" in
18969 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
18970 case "$d_srand48_r_proto:$usethreads" in
18971 ":define") d_srand48_r_proto=define
18972 set d_srand48_r_proto srand48_r $hdrs
18976 case "$d_srand48_r_proto" in
18978 case "$srand48_r_proto" in
18979 ''|0) try='int srand48_r(long, struct drand48_data*);'
18980 ./protochk "$extern_C $try" $hdrs && srand48_r_proto=I_LS ;;
18982 case "$srand48_r_proto" in
18983 ''|0) d_srand48_r=undef
18985 echo "Disabling srand48_r, cannot determine prototype." >&4 ;;
18986 * ) case "$srand48_r_proto" in
18987 REENTRANT_PROTO*) ;;
18988 *) srand48_r_proto="REENTRANT_PROTO_$srand48_r_proto" ;;
18990 echo "Prototype: $try" ;;
18993 *) case "$usethreads" in
18994 define) echo "srand48_r has no prototype, not using it." >&4 ;;
19001 *) srand48_r_proto=0
19005 : see if srandom_r exists
19006 set srandom_r d_srandom_r
19008 case "$d_srandom_r" in
19010 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
19011 case "$d_srandom_r_proto:$usethreads" in
19012 ":define") d_srandom_r_proto=define
19013 set d_srandom_r_proto srandom_r $hdrs
19017 case "$d_srandom_r_proto" in
19019 case "$srandom_r_proto" in
19020 ''|0) try='int srandom_r(unsigned int, struct random_data*);'
19021 ./protochk "$extern_C $try" $hdrs && srandom_r_proto=I_TS ;;
19023 case "$srandom_r_proto" in
19024 ''|0) d_srandom_r=undef
19026 echo "Disabling srandom_r, cannot determine prototype." >&4 ;;
19027 * ) case "$srandom_r_proto" in
19028 REENTRANT_PROTO*) ;;
19029 *) srandom_r_proto="REENTRANT_PROTO_$srandom_r_proto" ;;
19031 echo "Prototype: $try" ;;
19034 *) case "$usethreads" in
19035 define) echo "srandom_r has no prototype, not using it." >&4 ;;
19042 *) srandom_r_proto=0
19046 : see if prototype for setresgid is available
19048 set d_sresgproto setresgid $i_unistd unistd.h
19051 : see if prototype for setresuid is available
19053 set d_sresuproto setresuid $i_unistd unistd.h
19056 : see if stat exists
19060 : see if sys/stat.h is available
19061 set sys/stat.h i_sysstat
19064 : see if stat knows about block sizes
19066 echo "Checking to see if your struct stat has st_blocks field..." >&4
19067 set d_statblks stat st_blocks $i_sysstat sys/stat.h
19070 : see if this is a sys/vfs.h system
19071 set sys/vfs.h i_sysvfs
19074 : see if this is a sys/statfs.h system
19075 set sys/statfs.h i_sysstatfs
19078 : Check for statfs_s
19080 echo "Checking to see if your system supports struct statfs..." >&4
19081 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
19083 case "$d_statfs_s" in
19084 "$define") echo "Yes, it does." ;;
19085 *) echo "No, it doesn't." ;;
19089 : see if struct statfs knows about f_flags
19090 case "$d_statfs_s" in
19093 echo "Checking to see if your struct statfs has f_flags field..." >&4
19094 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
19098 set d_statfs_f_flags
19102 case "$d_statfs_f_flags" in
19103 "$define") echo "Yes, it does." ;;
19104 *) echo "No, it doesn't." ;;
19107 : see what flavor, if any, of static inline is supported
19109 echo "Checking to see if your system supports static inline..."
19110 $cat > try.c <<'EOCP'
19111 #include <stdlib.h>
19112 extern int f_via_a(int x);
19113 extern int f_via_b(int x);
19114 int main(int argc, char **argv)
19123 return EXIT_SUCCESS;
19126 return EXIT_FAILURE;
19130 $cat > a.c <<'EOCP'
19131 static INLINE int f(int x) {
19142 $cat > b.c <<'EOCP'
19143 extern int f(int x);
19151 # Respect a hint (or previous) value for perl_static_inline, if there is one.
19152 case "$perl_static_inline" in
19153 '') # Check the various possibilities, and break out on success.
19154 # For gcc, prefer __inline__, which will still permit
19155 # cflags.SH to add in -ansi.
19156 case "$gccversion" in
19157 '') xxx="inline __inline__ __inline _inline";;
19158 *) xxx="__inline__ inline __inline _inline";;
19160 for inline in $xxx; do
19161 set try -DINLINE=$inline a.c
19162 if eval $compile && $run ./try; then
19163 # Now make sure there is no external linkage of static
19165 set try -DINLINE=$inline -DUSE_B a.c b.c
19166 if eval $compile && $run ./try; then
19167 $echo "Your compiler supports static $inline, " >&4
19168 $echo "but it also creates an external definition," >&4
19169 $echo "so I won't use it." >&4
19172 $echo "Your compiler supports static $inline." >&4
19174 perl_static_inline="static $inline";
19178 $echo "Your compiler does NOT support static $inline." >&4
19183 *inline*) # Some variant of inline exists.
19184 echo "Keeping your $hint value of $perl_static_inline."
19187 static) # No inline capabilities
19188 echo "Keeping your $hint value of $perl_static_inline."
19191 *) # Unrecognized previous value -- blindly trust the supplied
19192 # value and hope it makes sense. Use old value for
19193 # d_static_inline, if there is one.
19194 echo "Keeping your $hint value of $perl_static_inline."
19195 case "$d_static_inline" in
19197 *) val=$d_static_inline ;;
19201 # Fallback to plain 'static' if nothing worked.
19202 case "$perl_static_inline" in
19204 perl_static_inline="static"
19208 set d_static_inline
19210 $rm -f a.[co] b.[co]
19213 : Check stream access
19215 Checking how to access stdio streams by file descriptor number...
19217 case "$stdio_stream_array" in
19218 '') $cat >try.c <<EOCP
19221 if (&STDIO_STREAM_ARRAY[fileno(stdin)] == stdin)
19225 for s in _iob __iob __sF
19227 set try -DSTDIO_STREAM_ARRAY=$s
19228 if eval $compile; then
19229 case "`$run ./try`" in
19230 yes) stdio_stream_array=$s; break ;;
19236 case "$stdio_stream_array" in
19238 I can't figure out how to access stdio streams by file descriptor number.
19240 d_stdio_stream_array="$undef"
19243 You can access stdio streams by file descriptor number by the $stdio_stream_array array.
19245 d_stdio_stream_array="$define"
19249 : see if strcoll exists
19250 set strcoll d_strcoll
19253 : check for structure copying
19255 echo "Checking to see if your C compiler can copy structs..." >&4
19256 $cat >try.c <<'EOCP'
19266 if $cc -c try.c >/dev/null 2>&1 ; then
19268 echo "Yup, it can."
19271 echo "Nope, it can't."
19277 : see if strerror and/or sys_errlist[] exist
19279 if test "X$d_strerror" = X -o "X$d_syserrlst" = X; then
19280 if set strerror val -f d_strerror; eval $csym; $val; then
19281 echo 'strerror() found.' >&4
19282 d_strerror="$define"
19283 d_strerrm='strerror(e)'
19284 if set sys_errlist val -a d_syserrlst; eval $csym; $val; then
19285 echo "(You also have sys_errlist[], so we could roll our own strerror.)"
19286 d_syserrlst="$define"
19288 echo "(Since you don't have sys_errlist[], strerror() is welcome.)"
19289 d_syserrlst="$undef"
19291 elif xxx=`./findhdr string.h`; test "$xxx" || xxx=`./findhdr strings.h`; \
19292 $contains '#[ ]*define.*strerror' "$xxx" >/dev/null 2>&1; then
19293 echo 'strerror() found in string header.' >&4
19294 d_strerror="$define"
19295 d_strerrm='strerror(e)'
19296 if set sys_errlist val -a d_syserrlst; eval $csym; $val; then
19297 echo "(Most probably, strerror() uses sys_errlist[] for descriptions.)"
19298 d_syserrlst="$define"
19300 echo "(You don't appear to have any sys_errlist[], how can this be?)"
19301 d_syserrlst="$undef"
19303 elif set sys_errlist val -a d_syserrlst; eval $csym; $val; then
19304 echo "strerror() not found, but you have sys_errlist[] so we'll use that." >&4
19305 d_strerror="$undef"
19306 d_syserrlst="$define"
19307 d_strerrm='((e)<0||(e)>=sys_nerr?"unknown":sys_errlist[e])'
19309 echo 'strerror() and sys_errlist[] NOT found.' >&4
19310 d_strerror="$undef"
19311 d_syserrlst="$undef"
19312 d_strerrm='"unknown"'
19316 : see if strerror_l exists
19317 set strerror_l d_strerror_l
19320 : see if strerror_r exists
19321 set strerror_r d_strerror_r
19323 case "$d_strerror_r" in
19325 hdrs="$i_systypes sys/types.h define stdio.h $i_string string.h"
19326 case "$d_strerror_r_proto:$usethreads" in
19327 ":define") d_strerror_r_proto=define
19328 set d_strerror_r_proto strerror_r $hdrs
19332 case "$d_strerror_r_proto" in
19334 case "$strerror_r_proto" in
19335 ''|0) try='int strerror_r(int, char*, size_t);'
19336 ./protochk "$extern_C $try" $hdrs && strerror_r_proto=I_IBW ;;
19338 case "$strerror_r_proto" in
19339 ''|0) try='int strerror_r(int, char*, int);'
19340 ./protochk "$extern_C $try" $hdrs && strerror_r_proto=I_IBI ;;
19342 case "$strerror_r_proto" in
19343 ''|0) try='char* strerror_r(int, char*, size_t);'
19344 ./protochk "$extern_C $try" $hdrs && strerror_r_proto=B_IBW ;;
19346 case "$strerror_r_proto" in
19347 ''|0) d_strerror_r=undef
19349 echo "Disabling strerror_r, cannot determine prototype." >&4 ;;
19350 * ) case "$strerror_r_proto" in
19351 REENTRANT_PROTO*) ;;
19352 *) strerror_r_proto="REENTRANT_PROTO_$strerror_r_proto" ;;
19354 echo "Prototype: $try" ;;
19357 *) case "$usethreads" in
19358 define) echo "strerror_r has no prototype, not using it." >&4 ;;
19365 *) strerror_r_proto=0
19369 : see if strftime exists
19370 set strftime d_strftime
19373 : see if strlcat exists
19374 set strlcat d_strlcat
19377 : see if strlcpy exists
19378 set strlcpy d_strlcpy
19381 : see if strtod exists
19382 set strtod d_strtod
19385 : see if strtol exists
19386 set strtol d_strtol
19389 : see if strtold exists
19390 set strtold d_strtold
19393 : see if strtoll exists
19394 set strtoll d_strtoll
19397 case "$d_longlong-$d_strtoll" in
19400 Checking whether your strtoll() works okay...
19402 $cat >try.c <<'EOCP'
19405 #define strtoll __strtoll
19408 #define strtoll _strtoll
19411 extern long long int strtoll(char *s, char **, int);
19412 static int bad = 0;
19413 int check(char *s, long long ell, int een) {
19416 gll = strtoll(s, 0, 10);
19417 if (!((gll == ell) && (errno == een)))
19421 check(" 1", 1LL, 0);
19422 check(" 0", 0LL, 0);
19423 check("-1", -1LL, 0);
19424 check("-9223372036854775808", -9223372036854775808LL, 0);
19425 check("-9223372036854775808", -9223372036854775808LL, 0);
19426 check(" 9223372036854775807", 9223372036854775807LL, 0);
19427 check("-9223372036854775808", -9223372036854775808LL, 0);
19428 check(" 9223372036854775808", 9223372036854775807LL, ERANGE);
19429 check("-9223372036854775809", -9223372036854775808LL, ERANGE);
19435 if eval $compile; then
19438 ok) echo "Your strtoll() seems to be working okay." ;;
19440 Your strtoll() doesn't seem to be working okay.
19446 echo "(I can't seem to compile the test program--assuming it doesn't)"
19452 : see if strtoq exists
19453 set strtoq d_strtoq
19456 : see if strtoul exists
19457 set strtoul d_strtoul
19460 case "$d_strtoul" in
19463 Checking whether your strtoul() works okay...
19465 $cat >try.c <<'EOCP'
19468 extern unsigned long int strtoul(char *s, char **, int);
19469 static int bad = 0;
19470 void check(char *s, unsigned long eul, int een) {
19473 gul = strtoul(s, 0, 10);
19474 if (!((gul == eul) && (errno == een)))
19478 check(" 1", 1L, 0);
19479 check(" 0", 0L, 0);
19481 case "$longsize" in
19483 $cat >>try.c <<'EOCP'
19484 check("18446744073709551615", 18446744073709551615UL, 0);
19485 check("18446744073709551616", 18446744073709551615UL, ERANGE);
19486 #if 0 /* strtoul() for /^-/ strings is undefined. */
19487 check("-1", 18446744073709551615UL, 0);
19488 check("-18446744073709551614", 2, 0);
19489 check("-18446744073709551615", 1, 0);
19490 check("-18446744073709551616", 18446744073709551615UL, ERANGE);
19491 check("-18446744073709551617", 18446744073709551615UL, ERANGE);
19496 $cat >>try.c <<'EOCP'
19497 check("4294967295", 4294967295UL, 0);
19498 check("4294967296", 4294967295UL, ERANGE);
19499 #if 0 /* strtoul() for /^-/ strings is undefined. */
19500 check("-1", 4294967295UL, 0);
19501 check("-4294967294", 2, 0);
19502 check("-4294967295", 1, 0);
19503 check("-4294967296", 4294967295UL, ERANGE);
19504 check("-4294967297", 4294967295UL, ERANGE);
19509 : Should we write these tests to be more portable by sprintf-ing
19510 : ~0 and then manipulating that char string as input for strtol?
19513 $cat >>try.c <<'EOCP'
19520 if eval $compile; then
19521 case "`$run ./try`" in
19522 ok) echo "Your strtoul() seems to be working okay." ;;
19524 Your strtoul() doesn't seem to be working okay.
19530 echo "(I can't seem to compile the test program--assuming it doesn't)"
19536 : see if strtoull exists
19537 set strtoull d_strtoull
19540 case "$d_longlong-$d_strtoull" in
19543 Checking whether your strtoull() works okay...
19545 $cat >try.c <<'EOCP'
19548 #define strtoull __strtoull
19551 extern unsigned long long int strtoull(char *s, char **, int);
19552 static int bad = 0;
19553 int check(char *s, long long eull, int een) {
19556 gull = strtoull(s, 0, 10);
19557 if (!((gull == eull) && (errno == een)))
19561 check(" 1", 1LL, 0);
19562 check(" 0", 0LL, 0);
19563 check("18446744073709551615", 18446744073709551615ULL, 0);
19564 check("18446744073709551616", 18446744073709551615ULL, ERANGE);
19565 #if 0 /* strtoull() for /^-/ strings is undefined. */
19566 check("-1", 18446744073709551615ULL, 0);
19567 check("-18446744073709551614", 2LL, 0);
19568 check("-18446744073709551615", 1LL, 0);
19569 check("-18446744073709551616", 18446744073709551615ULL, ERANGE);
19570 check("-18446744073709551617", 18446744073709551615ULL, ERANGE);
19577 if eval $compile; then
19578 case "`$run ./try`" in
19579 ok) echo "Your strtoull() seems to be working okay." ;;
19581 Your strtoull() doesn't seem to be working okay.
19583 d_strtoull="$undef"
19587 echo "(I can't seem to compile the test program--assuming it doesn't)"
19588 d_strtoull="$undef"
19593 : see if strtouq exists
19594 set strtouq d_strtouq
19597 case "$d_strtouq" in
19600 Checking whether your strtouq() works okay...
19602 $cat >try.c <<'EOCP'
19605 extern unsigned long long int strtouq(char *s, char **, int);
19606 static int bad = 0;
19607 void check(char *s, unsigned long long eull, int een) {
19608 unsigned long long gull;
19610 gull = strtouq(s, 0, 10);
19611 if (!((gull == eull) && (errno == een)))
19615 check(" 1", 1LL, 0);
19616 check(" 0", 0LL, 0);
19617 check("18446744073709551615", 18446744073709551615ULL, 0);
19618 check("18446744073709551616", 18446744073709551615ULL, ERANGE);
19619 #if 0 /* strtouq() for /^-/ strings is undefined. */
19620 check("-1", 18446744073709551615ULL, 0);
19621 check("-18446744073709551614", 2LL, 0);
19622 check("-18446744073709551615", 1LL, 0);
19623 check("-18446744073709551616", 18446744073709551615ULL, ERANGE);
19624 check("-18446744073709551617", 18446744073709551615ULL, ERANGE);
19632 if eval $compile; then
19633 case "`$run ./try`" in
19634 ok) echo "Your strtouq() seems to be working okay." ;;
19636 Your strtouq() doesn't seem to be working okay.
19642 echo "(I can't seem to compile the test program--assuming it doesn't)"
19648 : see if strxfrm exists
19649 set strxfrm d_strxfrm
19652 : see if symlink exists
19653 set symlink d_symlink
19656 : see if syscall exists
19657 set syscall d_syscall
19660 : see if prototype for syscall is available
19662 set d_syscallproto syscall $i_unistd unistd.h
19665 : see if sysconf exists
19666 set sysconf d_sysconf
19669 : see if system exists
19670 set system d_system
19673 : see if tcgetpgrp exists
19674 set tcgetpgrp d_tcgetpgrp
19677 : see if tcsetpgrp exists
19678 set tcsetpgrp d_tcsetpgrp
19681 : see if prototype for telldir is available
19683 set d_telldirproto telldir $i_systypes sys/types.h $i_dirent dirent.h
19686 : see if tgamma exists
19687 set tgamma d_tgamma
19690 : see if time exists
19692 if test "X$d_time" = X -o X"$timetype" = X; then
19693 if set time val -f d_time; eval $csym; $val; then
19694 echo 'time() found.' >&4
19696 rp="What is the type returned by time() on this system?"
19697 set time_t timetype long stdio.h sys/types.h
19700 echo 'time() not found, hope that will do.' >&4
19708 : see if timegm exists
19709 set timegm d_timegm
19712 : see if this is a sys/times.h system
19713 set sys/times.h i_systimes
19716 : see if times exists
19718 if set times val -f d_times; eval $csym; $val; then
19719 echo 'times() found.' >&4
19722 case "$i_systimes" in
19723 "$define") inc='sys/times.h';;
19725 rp="What is the type returned by times() on this system?"
19726 set clock_t clocktype long stdio.h sys/types.h $inc
19729 echo 'times() NOT found, hope that will do.' >&4
19734 : see if tmpnam_r exists
19735 set tmpnam_r d_tmpnam_r
19737 case "$d_tmpnam_r" in
19739 hdrs="$i_systypes sys/types.h define stdio.h "
19740 case "$d_tmpnam_r_proto:$usethreads" in
19741 ":define") d_tmpnam_r_proto=define
19742 set d_tmpnam_r_proto tmpnam_r $hdrs
19746 case "$d_tmpnam_r_proto" in
19748 case "$tmpnam_r_proto" in
19749 ''|0) try='char* tmpnam_r(char*);'
19750 ./protochk "$extern_C $try" $hdrs && tmpnam_r_proto=B_B ;;
19752 case "$tmpnam_r_proto" in
19753 ''|0) d_tmpnam_r=undef
19755 echo "Disabling tmpnam_r, cannot determine prototype." >&4 ;;
19756 * ) case "$tmpnam_r_proto" in
19757 REENTRANT_PROTO*) ;;
19758 *) tmpnam_r_proto="REENTRANT_PROTO_$tmpnam_r_proto" ;;
19760 echo "Prototype: $try" ;;
19763 *) case "$usethreads" in
19764 define) echo "tmpnam_r has no prototype, not using it." >&4 ;;
19771 *) tmpnam_r_proto=0
19775 : see if trunc exists
19779 : see if truncate exists
19780 set truncate d_truncate
19783 : see if ttyname_r exists
19784 set ttyname_r d_ttyname_r
19786 case "$d_ttyname_r" in
19788 hdrs="$i_systypes sys/types.h define stdio.h $i_unistd unistd.h"
19789 case "$d_ttyname_r_proto:$usethreads" in
19790 ":define") d_ttyname_r_proto=define
19791 set d_ttyname_r_proto ttyname_r $hdrs
19795 case "$d_ttyname_r_proto" in
19797 case "$ttyname_r_proto" in
19798 ''|0) try='int ttyname_r(int, char*, size_t);'
19799 ./protochk "$extern_C $try" $hdrs && ttyname_r_proto=I_IBW ;;
19801 case "$ttyname_r_proto" in
19802 ''|0) try='int ttyname_r(int, char*, int);'
19803 ./protochk "$extern_C $try" $hdrs && ttyname_r_proto=I_IBI ;;
19805 case "$ttyname_r_proto" in
19806 ''|0) try='char* ttyname_r(int, char*, int);'
19807 ./protochk "$extern_C $try" $hdrs && ttyname_r_proto=B_IBI ;;
19809 case "$ttyname_r_proto" in
19810 ''|0) d_ttyname_r=undef
19812 echo "Disabling ttyname_r, cannot determine prototype." >&4 ;;
19813 * ) case "$ttyname_r_proto" in
19814 REENTRANT_PROTO*) ;;
19815 *) ttyname_r_proto="REENTRANT_PROTO_$ttyname_r_proto" ;;
19817 echo "Prototype: $try" ;;
19820 *) case "$usethreads" in
19821 define) echo "ttyname_r has no prototype, not using it." >&4 ;;
19828 *) ttyname_r_proto=0
19832 : see if tzname[] exists
19834 if set tzname val -a d_tzname; eval $csym; $val; then
19836 echo 'tzname[] found.' >&4
19839 echo 'tzname[] NOT found.' >&4
19844 : Check if is a multiplatform env
19846 darwin) multiarch="$define" ;;
19848 case "$multiarch" in
19849 ''|[nN]*) multiarch="$undef" ;;
19852 : check for ordering of bytes in a UV
19854 case "$multiarch" in
19857 You seem to be doing a multiarchitecture build,
19858 skipping the byteorder check.
19864 case "$byteorder" in
19867 In the following, larger digits indicate more significance. A big-endian
19868 machine like a Pyramid or a Motorola 680?0 chip will come out to 4321. A
19869 little-endian machine like a Vax or an Intel 80?86 chip would be 1234. Other
19870 machines may have weird orders like 3412. A Cray will report 87654321,
19871 an Alpha will report 12345678. If the test program works the default is
19873 I'm now running the test program...
19877 #$i_stdlib I_STDLIB
19879 #include <stdlib.h>
19881 #include <sys/types.h>
19882 typedef $uvtype UV;
19892 u.l = (((UV)0x08070605) << 32) | (UV)0x04030201;
19894 u.l = (UV)0x04030201;
19895 for (i = 0; i < $uvsize; i++)
19896 printf("%c", u.c[i]+'0');
19903 if eval $compile && $run ./try > /dev/null; then
19906 [1-4][1-4][1-4][1-4]|12345678|87654321)
19907 echo "(The test program ran ok.)"
19908 echo "byteorder=$dflt"
19911 ????|????????) echo "(The test program ran ok.)" ;;
19912 *) echo "(The test program didn't run right for some reason.)" ;;
19917 (I can't seem to compile the test program. Guessing big-endian...)
19920 case "$xxx_prompt" in
19922 rp="What is the order of bytes in $uvtype?"
19935 : Checking 32bit alignedness
19938 Checking to see whether you can access character data unalignedly...
19940 case "$d_u32align" in
19941 '') $cat >try.c <<EOCP
19943 #$i_stdlib I_STDLIB
19945 #include <stdlib.h>
19947 #define U32 $u32type
19948 #define BYTEORDER 0x$byteorder
19950 #include <signal.h>
19952 $signal_t bletch(int s) { exit(4); }
19955 #if BYTEORDER == 0x1234 || BYTEORDER == 0x4321
19956 volatile U8 buf[8];
19960 if (sizeof(U32) != 4) {
19961 printf("sizeof(U32) is not 4, but %d\n", sizeof(U32));
19968 signal(SIGBUS, bletch);
19980 for (i = 0; i < 4; i++) {
19981 up = (U32*)(buf + i);
19982 if (! ((*up == 1 << (8*i)) || /* big-endian */
19983 (*up == 1 << (8*(3-i))) /* little-endian */
19987 printf("read failed (%x)\n", *up);
19993 for (i = 0; i < 4; i++) {
19994 up = (U32*)(buf + i);
19996 if (*up != 0xBeef) {
19997 printf("write failed (%x)\n", *up);
20011 if eval $compile_ok; then
20012 echo "(Testing for character data alignment may crash the test. That's okay.)" >&4
20013 $run ./try 2>&1 >/dev/null
20016 You can access character data pretty unalignedly.
20018 d_u32align="$undef"
20021 It seems that you must access character data in an aligned manner.
20023 d_u32align="$define"
20027 rp='Can you access character data at unaligned addresses?'
20031 [yY]*) d_u32align="$undef" ;;
20032 *) d_u32align="$define" ;;
20039 : see if ualarm exists
20040 set ualarm d_ualarm
20043 : see if umask exists
20047 : see if unordered exists
20048 set unordered d_unordered
20051 : see if unsetenv exists
20052 set unsetenv d_unsetenv
20055 : see if usleep exists
20056 set usleep d_usleep
20059 : see if prototype for usleep is available
20061 set d_usleepproto usleep $i_unistd unistd.h
20064 : see if ustat exists
20068 : see if closedir exists
20069 set closedir d_closedir
20072 case "$d_closedir" in
20075 echo "Checking whether closedir() returns a status..." >&4
20077 #$i_dirent I_DIRENT /**/
20078 #$i_sysdir I_SYS_DIR /**/
20079 #$i_sysndir I_SYS_NDIR /**/
20080 #$i_systypes I_SYS_TYPES /**/
20082 #if defined(I_SYS_TYPES)
20083 #include <sys/types.h>
20085 #if defined(I_DIRENT)
20086 #include <dirent.h>
20089 #include <sys/ndir.h>
20093 #include <ndir.h> /* may be wrong in the future */
20095 #include <sys/dir.h>
20100 int main() { return closedir(opendir(".")); }
20103 if eval $compile_ok; then
20104 if $run ./try > /dev/null 2>&1 ; then
20105 echo "Yes, it does."
20108 echo "No, it doesn't."
20112 echo "(I can't seem to compile the test program--assuming it doesn't)"
20120 set d_void_closedir
20124 : see if there is a wait4
20128 : see if waitpid exists
20129 set waitpid d_waitpid
20134 $cat >try.c <<'EOCP'
20140 return (wcscmp (s, s) ? 1 : 0);
20145 if eval $compile; then
20148 0) echo "A working wcscmp() found." >&4
20150 *) echo "wcscmp() found, but it doesn't work" >&4
20154 echo "wcscmp() NOT found." >&4
20160 : see if wcstombs exists
20161 set wcstombs d_wcstombs
20166 $cat >try.c <<'EOCP'
20171 wchar_t dst[4], *src = L" ";
20173 return (wcsxfrm (dst, src, 1) ? errno ? errno : 0 : 1);
20178 if eval $compile; then
20181 0) echo "A working wcsxfrm() found." >&4
20183 *) echo "wcsxfrm() found, but it doesn't work" >&4
20187 echo "wcsxfrm() NOT found." >&4
20193 : see if wctomb exists
20194 set wctomb d_wctomb
20197 : see if writev exists
20198 set writev d_writev
20201 : check for alignment requirements
20203 case "$alignbytes" in
20204 '') echo "Checking alignment constraints..." >&4
20213 printf("%d\n", (int)((char *)&try_algn.bar - (char *)&try_algn.foo));
20218 if eval $compile_ok; then
20222 echo "(I can't seem to compile the test program...)"
20224 case "$multiarch" in
20226 : The usual safe value is 8, but Darwin with -Duselongdouble
20227 : needs 16. Hence, we will take 8 as a minimum, but allow
20228 : Configure to pick a larger value if needed.
20229 if $test "$dflt" -lt 8; then
20231 echo "Setting alignment to 8 for multiarch support.">&4
20236 *) dflt="$alignbytes"
20239 rp="Doubles must be aligned on a how-many-byte boundary?"
20244 : set the base revision
20247 : length of character in bytes. Is always 1, otherwise it is not C
20248 : This used to be a test using sizeof
20251 : Check for the number of bits in a character
20252 case "$charbits" in
20253 '') echo "Checking how long a character is (in bits)..." >&4
20260 for (c = 1, n = 0; c; c <<= 1, n++) ;
20261 printf ("%d\n", n);
20266 if eval $compile_ok; then
20270 echo "(I can't seem to compile the test program. Guessing...)"
20277 rp="What is the length of a character (in bits)?"
20281 case "$charbits" in
20284 Your system has an unsigned character size of $charbits bits, which
20285 is rather unusual (normally it is 8 bits). Perl likely will not work
20286 correctly on your system, with subtle bugs in various places.
20288 rp='Do you really want to continue?'
20292 [yY]) echo >&4 "Okay, continuing." ;;
20297 : how do we concatenate cpp tokens here?
20299 echo "Checking to see how your cpp does stuff like concatenate tokens..." >&4
20300 $cat >cpp_stuff.c <<'EOCP'
20301 #define RCAT(a,b)a/**/b
20302 #define ACAT(a,b)a ## b
20306 $cppstdin $cppflags $cppminus <cpp_stuff.c >cpp_stuff.out 2>&1
20307 if $contains 'Circus' cpp_stuff.out >/dev/null 2>&1; then
20308 echo "Oh! Smells like ANSI's been here." >&4
20309 echo "We can catify or stringify, separately or together!"
20311 elif $contains 'Reiser' cpp_stuff.out >/dev/null 2>&1; then
20312 echo "Ah, yes! The good old days!" >&4
20313 echo "However, in the good old days we don't know how to stringify and"
20314 echo "catify at the same time."
20318 Hmm, I don't seem to be able to concatenate tokens with your cpp.
20319 You're going to have to edit the values of CAT[2-5] in config.h...
20321 cpp_stuff="/* Help! How do we handle cpp_stuff? */*/"
20325 : see if this is a db.h system
20331 : Check db version.
20333 echo "Checking Berkeley DB version ..." >&4
20339 #include <sys/types.h>
20341 #$i_stdlib I_STDLIB
20343 #include <stdlib.h>
20346 int main(int argc, char *argv[])
20348 #ifdef DB_VERSION_MAJOR /* DB version >= 2 */
20349 int Major, Minor, Patch ;
20350 unsigned long Version ;
20351 (void)db_version(&Major, &Minor, &Patch) ;
20353 printf("%d %d %d %d %d %d\n",
20354 DB_VERSION_MAJOR, DB_VERSION_MINOR, DB_VERSION_PATCH,
20355 Major, Minor, Patch);
20358 printf("You have Berkeley DB Version 2 or greater.\n");
20360 printf("db.h is from Berkeley DB Version %d.%d.%d\n",
20361 DB_VERSION_MAJOR, DB_VERSION_MINOR, DB_VERSION_PATCH);
20362 printf("libdb is from Berkeley DB Version %d.%d.%d\n",
20363 Major, Minor, Patch) ;
20365 /* check that db.h & libdb are compatible */
20366 if (DB_VERSION_MAJOR != Major || DB_VERSION_MINOR != Minor || DB_VERSION_PATCH != Patch) {
20367 printf("db.h and libdb are incompatible.\n") ;
20371 printf("db.h and libdb are compatible.\n") ;
20373 Version = DB_VERSION_MAJOR * 1000000 + DB_VERSION_MINOR * 1000
20374 + DB_VERSION_PATCH ;
20376 /* needs to be >= 2.3.4 */
20377 if (Version < 2003004) {
20378 /* if (DB_VERSION_MAJOR == 2 && DB_VERSION_MINOR == 0 && DB_VERSION_PATCH < 5) { */
20379 printf("Perl needs Berkeley DB 2.3.4 or greater.\n") ;
20385 #if defined(_DB_H_) && defined(BTREEMAGIC) && defined(HASHMAGIC)
20390 printf("You have Berkeley DB Version 1.\n");
20391 exit(0); /* DB version < 2: the coast is clear. */
20393 exit(1); /* <db.h> not Berkeley DB? */
20399 if eval $compile_ok && $run ./try; then
20400 echo 'Looks OK.' >&4
20402 db_version_major=$1
20403 db_version_minor=$2
20404 db_version_patch=$3
20406 echo "I can't use Berkeley DB with your <db.h>. I'll disable Berkeley DB." >&4
20410 : Remove db from list of libraries to use
20411 echo "Removing unusable -ldb from library list" >&4
20412 set `echo X $libs | $sed -e 's/-ldb / /' -e 's/-ldb$//'`
20415 echo "libs = $libs" >&4
20425 : Check the return type needed for hash
20427 echo "Checking return type needed for hash for Berkeley DB ..." >&4
20433 #include <sys/types.h>
20436 #ifndef DB_VERSION_MAJOR
20437 u_int32_t hash_cb (const void* ptr, size_t size)
20443 info.hash = hash_cb;
20447 if $cc $ccflags -c try.c >try.out 2>&1 ; then
20448 if $contains warning try.out >>/dev/null 2>&1 ; then
20451 db_hashtype='u_int32_t'
20454 : XXX Maybe we should just give up here.
20455 db_hashtype=u_int32_t
20457 echo "Help: I can't seem to compile the db test program." >&4
20458 echo "Something's wrong, but I'll assume you use $db_hashtype." >&4
20461 echo "Your version of Berkeley DB uses $db_hashtype for hash."
20463 *) db_hashtype=u_int32_t
20468 : Check the return type needed for prefix
20470 echo "Checking return type needed for prefix for Berkeley DB ..." >&4
20476 #include <sys/types.h>
20479 #ifndef DB_VERSION_MAJOR
20480 size_t prefix_cb (const DBT *key1, const DBT *key2)
20486 info.prefix = prefix_cb;
20490 if $cc $ccflags -c try.c >try.out 2>&1 ; then
20491 if $contains warning try.out >>/dev/null 2>&1 ; then
20492 db_prefixtype='int'
20494 db_prefixtype='size_t'
20497 db_prefixtype='size_t'
20498 : XXX Maybe we should just give up here.
20500 echo "Help: I can't seem to compile the db test program." >&4
20501 echo "Something's wrong, but I'll assume you use $db_prefixtype." >&4
20504 echo "Your version of Berkeley DB uses $db_prefixtype for prefix."
20506 *) db_prefixtype='size_t'
20510 : Check what kind of inf/nan your system has
20511 $echo "Checking the kind of infinities and nans you have..." >&4
20513 #define DOUBLESIZE $doublesize
20514 #$d_longdbl HAS_LONG_DOUBLE
20515 #ifdef HAS_LONG_DOUBLE
20516 #define LONGDBLSIZE $longdblsize
20517 #define LONGDBLKIND $longdblkind
20524 /* Note that whether the sign bit is on or off
20525 * for NaN depends on the CPU/FPU, and possibly
20526 * can be affected by the build toolchain.
20528 * For example for older MIPS and HP-PA 2.0 the quiet NaN is:
20529 * 0x7f, 0xf7, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff
20530 * 0x7f, 0xf4, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
20531 * (respectively) as opposed to the more usual
20532 * 0x7f, 0xf8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
20534 static void bytes(unsigned char *p, unsigned int n) {
20536 for (i = 0; i < n; i++) {
20537 printf("0x%02x%s", p[i], i < n - 1 ? ", " : "\n");
20540 int main(int argc, char *argv[]) {
20541 /* We cannot use 1.0/0.0 and 0.0/0.0 (with L suffixes for long double)
20542 * because some compilers are 'smart' and not only warn but refuse to
20543 * compile such 'illegal' values. */
20544 double dinf = exp(1e9);
20545 double dnan = sqrt(-1.0);
20546 #ifdef HAS_LONG_DOUBLE
20547 long double ldinf = (long double)exp(1e9);
20548 long double ldnan = (long double)sqrt(-1.0);
20551 switch (argv[1][0]) {
20552 case '1': bytes(&dinf, sizeof(dinf)); break;
20553 case '2': bytes(&dnan, sizeof(dnan)); break;
20554 #ifdef HAS_LONG_DOUBLE
20555 # if LONG_DOUBLEKIND == 3 || LONG_DOUBLEKIND == 4
20556 /* the 80-bit long doubles might have garbage in their excess bytes */
20557 memset((char *)&ldinf + 10, '\0', LONG_DOUBLESIZE - 10);
20559 case '3': bytes(&ldinf, sizeof(ldinf)); break;
20560 case '4': bytes(&ldnan, sizeof(ldnan)); break;
20568 if eval $compile; then
20569 doubleinfbytes=`$run ./try 1`
20570 doublenanbytes=`$run ./try 2`
20571 case "$d_longdbl" in
20573 longdblinfbytes=`$run ./try 3`
20574 longdblnanbytes=`$run ./try 4`
20578 # Defaults in case the above test program failed.
20579 case "$doublekind" in
20580 1) # IEEE 754 32-bit LE
20581 doubleinfbytes='0x00, 0x00, 0xf0, 0x7f'
20582 doublenanbytes='0x00, 0x00, 0xf8, 0x7f'
20584 2) # IEEE 754 32-bit BE
20585 doubleinfbytes='0x7f, 0xf0, 0x00, 0x00'
20586 doublenanbytes='0x7f, 0xf8, 0x00, 0x00'
20588 3) # IEEE 754 64-bit LE
20589 doubleinfbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x7f'
20590 doublenanbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0x7f'
20592 4) # IEEE 754 64-bit BE
20593 doubleinfbytes='0x7f, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20594 doublenanbytes='0x7f, 0xf8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20596 5) # IEEE 754 128-bit LE
20597 doubleinfbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x7f'
20598 doublenanbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0x7f'
20600 6) # IEEE 754 128-bit BE
20601 doubleinfbytes='0x7f, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20602 doublenanbytes='0x7f, 0xf8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20604 7) # IEEE 754 64-bit mixed: 32-bit LEs in BE
20605 doubleinfbytes='0x00, 0x00, 0xf0, 0x7f, 0x00, 0x00, 0x00, 0x00'
20606 doublenanbytes='0x00, 0x00, 0xf8, 0x7f, 0x00, 0x00, 0x00, 0x00'
20608 8) # IEEE 754 64-bit mixed: 32-bit BEs in LE
20609 doubleinfbytes='0x00, 0x00, 0x00, 0x00, 0x7f, 0xf0, 0x00, 0x00'
20610 doublenanbytes='0x00, 0x00, 0x00, 0x00, 0x7f, 0xf8, 0x00, 0x00'
20613 doubleinfbytes=$undef
20614 doublenanbytes=$undef
20617 case "$longdblkind" in
20618 1) # IEEE 754 128-bit LE
20619 longdblinfbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x7f'
20620 longdblnanbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xff, 0x7f'
20622 2) # IEEE 754 128-bit BE
20623 longdblinfbytes='0x7f, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20624 longdblnanbytes='0x7f, 0xff, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20626 3) # IEEE 754 80-bit LE, 12 or 16 bytes (x86)
20627 case "$longdblsize" in
20628 12) # x86 32-bit (96 bits, or 4 x 32, or 12 x 8)
20629 longdblinfbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xff, 0x7f, 0x00, 0x00'
20630 longdblnanbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0xff, 0x7f, 0x00, 0x00'
20633 longdblinfbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xff, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20634 longdblnanbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0xff, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20637 longdblinfbytes=$undef
20638 longdblnanbytes=$undef
20642 4) # IEEE 754 80-bit BE, 12 or 16 bytes
20643 case "$longdblsize" in
20644 12) # 32-bit system
20645 longdblinfbytes='0x7f, 0xff, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20646 longdblnanbytes='0x7f, 0xff, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20648 16) # 64-bit system
20649 longdblinfbytes='0x7f, 0xff, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20650 longdblnanbytes='0x7f, 0xff, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20653 longdblinfbytes=$undef
20654 longdblnanbytes=$undef
20658 5) # 128-bit LE-LE "double double"
20659 longdblinfbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x7f'
20660 longdblnanbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0x7f'
20662 6) # 128-bit BE-BE "double double"
20663 longdblinfbytes='0x7f, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20664 longdblnanbytes='0x7f, 0xf8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20666 7) # 128-bit LE-BE "double double"
20667 longdblinfbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20668 longdblnanbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20670 8) # 128-bit BE-LE "double double"
20671 longdblinfbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7f, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20672 longdblnanbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7f, 0xf8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20675 longdblinfbytes=$undef
20676 longdblnanbytes=$undef
20682 : Check the length of the double mantissa
20683 $echo "Checking how many mantissa bits your doubles have..." >&4
20686 #$i_sunmath I_SUNMATH
20688 # include <float.h>
20691 # include <sunmath.h>
20693 #ifdef DBL_MANT_DIG
20694 # define BITS (DBL_MANT_DIG - 1) /* the implicit bit does not count */
20697 int main(int argc, char *argv[]) {
20699 printf("%d\n", BITS);
20705 if eval $compile; then
20706 doublemantbits=`$run ./try`
20708 doublemantbits="$undef"
20712 : Check the length of the longdouble mantissa
20713 $echo "Checking how many mantissa bits your long doubles have..." >&4
20716 #$i_sunmath I_SUNMATH
20718 # include <float.h>
20721 # include <sunmath.h>
20723 #$d_longdbl HAS_LONG_DOUBLE
20724 #if defined(HAS_LONG_DOUBLE) && defined(LDBL_MANT_DIG)
20725 # if ($longdblkind == 3) || ($longdblkind == 4) /* 80-bit extended precision */
20726 /* This format has no implicit bit. Beware, however, that for
20727 * this format the bare LDBL_MANT_DIG is misleading for inf/nan:
20728 * the top three bits are used for inf (100) / qnan (11x) / snan (101),
20729 * and the top bit must have been one since 387, zero is plain invalid.
20730 * For normal fp values, the LDBL_MANT_DIG is fine, though. */
20731 # define BITS LDBL_MANT_DIG
20732 # elif ($longdblkind == 5 || $longdblkind == 6 || $longdblkind == 7 || $longdblkind == 8) /* double double */
20733 /* LDBL_MANT_DIG of 106 (twice 53) would be logical, but for some
20734 * reason e.g. Irix thinks 107. But in any case, we want only
20735 * the number of real bits, the implicit bits are of no interest. */
20736 # define BITS 2 * (DBL_MANT_DIG - 1)
20738 # define BITS (LDBL_MANT_DIG - 1) /* the implicit bit does not count */
20742 int main(int argc, char *argv[]) {
20744 printf("%d\n", BITS);
20750 if eval $compile; then
20751 longdblmantbits=`$run ./try`
20753 longdblmantbits="$undef"
20757 : Check the length of the NV mantissa
20758 $echo "Checking how many mantissa bits your NVs have..." >&4
20759 if test "X$usequadmath" = "X$define"; then
20760 nvmantbits=112 # 128-1-15
20762 if test "X$nvsize" = "X$doublesize"; then
20763 nvmantbits="$doublemantbits"
20765 if test "X$nvsize" = "X$longdblsize"; then
20766 nvmantbits="$longdblmantbits"
20768 nvmantbits="$undef"
20773 : How can we generate normalized random numbers ?
20775 echo "Using our internal random number implementation..." >&4
20778 *-Dmy_rand=*|*-Dmy_srand=*)
20779 echo "Removing obsolete -Dmy_rand, -Dmy_srand, and -Drandbits from ccflags." >&4
20780 ccflags="`echo $ccflags | sed -e 's/-Dmy_rand=random/ /'`"
20781 ccflags="`echo $ccflags | sed -e 's/-Dmy_srand=srandom/ /'`"
20782 ccflags="`echo $ccflags | sed -e 's/-Drandbits=[0-9][0-9]*/ /'`"
20786 randfunc=Perl_drand48
20787 drand01="Perl_drand48()"
20788 seedfunc="Perl_drand48_init"
20792 : Probe whether dtrace builds an object, as newer Illumos requires an input
20793 : object file that uses at least one of the probes defined in the .d file
20794 case "$usedtrace" in
20796 case "$dtraceobject" in
20797 $define|true|[yY]*)
20798 dtraceobject=$define
20801 $dtrace -h -s ../perldtrace.d -o perldtrace.h
20803 #include "perldtrace.h"
20805 PERL_LOADED_FILE("dummy");
20809 dtraceobject=$undef
20810 if $cc -c -o try.o $optimize $ccflags try.c \
20811 && $dtrace -G -s ../perldtrace.d try.o >/dev/null 2>&1; then
20812 dtraceobject=$define
20813 echo "Your dtrace builds an object file"
20815 $rm -f try.c try.o perldtrace.o
20817 *) dtraceobject=$undef ;;
20821 : Determine if this is an EBCDIC system
20823 echo "Determining whether or not we are on an EBCDIC system..." >&4
20824 $cat >try.c <<'EOM'
20827 if ('M'==0xd4) return 0;
20834 if eval $compile_ok; then
20835 if $run ./try; then
20836 echo "You seem to speak EBCDIC." >&4
20839 echo "Nope, no EBCDIC, probably ASCII or some ISO Latin. Or UTF-8." >&4
20842 echo "I'm unable to compile the test program." >&4
20843 echo "I'll assume ASCII or some ISO Latin. Or UTF8." >&4
20849 : Check how to flush
20852 Checking how to flush all pending stdio output...
20854 # I only know how to find the first 32 possibly open files on SunOS.
20855 # See also hints/sunos_4_1.sh and util.c --AD
20857 sunos) $echo '#define PERL_FFLUSH_ALL_FOPEN_MAX 32' > try.c ;;
20859 $cat >>try.c <<EOCP
20861 #$i_stdlib I_STDLIB
20863 #include <stdlib.h>
20865 #$i_unistd I_UNISTD
20867 # include <unistd.h>
20869 #$d_sysconf HAS_SYSCONF
20870 #$d_stdio_stream_array HAS_STDIO_STREAM_ARRAY
20871 #ifdef HAS_STDIO_STREAM_ARRAY
20872 # define STDIO_STREAM_ARRAY $stdio_stream_array
20877 p = fopen("try.out", "w");
20881 # ifdef TRY_FPRINTF
20885 #ifdef TRY_FFLUSH_NULL
20888 #ifdef TRY_FFLUSH_ALL
20890 long open_max = -1;
20891 # ifdef PERL_FFLUSH_ALL_FOPEN_MAX
20892 open_max = PERL_FFLUSH_ALL_FOPEN_MAX;
20894 # if defined(HAS_SYSCONF) && defined(_SC_OPEN_MAX)
20895 open_max = sysconf(_SC_OPEN_MAX);
20898 open_max = FOPEN_MAX;
20901 open_max = OPEN_MAX;
20910 # ifdef HAS_STDIO_STREAM_ARRAY
20911 if (open_max > 0) {
20913 for (i = 0; i < open_max; i++)
20914 if (STDIO_STREAM_ARRAY[i]._file >= 0 &&
20915 STDIO_STREAM_ARRAY[i]._file < open_max &&
20916 STDIO_STREAM_ARRAY[i]._flag)
20917 fflush(&STDIO_STREAM_ARRAY[i]);
20925 : first we have to find out how _not_ to flush
20927 if $test "X$fflushNULL" = X -o "X$fflushall" = X; then
20929 set try -DTRY_FPUTC
20930 if eval $compile; then
20931 $run ./try 2>/dev/null
20934 if $test ! -s try.out -a "X$code" = X42; then
20940 set try -DTRY_FPRINTF
20941 if eval $compile; then
20942 $run ./try 2>/dev/null
20945 if $test ! -s try.out -a "X$code" = X42; then
20946 output=-DTRY_FPRINTF
20952 : check for fflush NULL behavior
20953 case "$fflushNULL" in
20954 '') set try -DTRY_FFLUSH_NULL $output
20955 if eval $compile; then
20956 $run ./try 2>/dev/null
20959 if $test -s try.out -a "X$code" = X42; then
20960 fflushNULL="`$cat try.out`"
20962 if $test "X$code" != X42; then
20964 (If this test failed, don't worry, we'll try another method shortly.)
20969 $rm -f core try.core core.try.*
20970 case "$fflushNULL" in
20972 Your fflush(NULL) works okay for output streams.
20973 Let's see if it clobbers input pipes...
20975 # As of mid-March 2000 all versions of Solaris appear to have a stdio
20976 # bug that improperly flushes the input end of pipes. So we avoid the
20977 # autoflush on fork/system/exec support for now. :-(
20978 $cat >tryp.c <<EOCP
20981 main(int argc, char **argv)
20987 while ((i = getc(stdin)) != -1
20988 && (*bp++ = i) != '\n'
20989 && bp < &buf[1024])
20992 fprintf(stdout, "%s", buf);
21000 fflushNULL="$define"
21002 if eval $compile; then
21004 # Copy the .c file to the remote host ($to is an ssh-alike if targethost is set)
21005 if $test "X$targethost" != X; then
21008 $run "cat tryp.c | ./tryp " 2>/dev/null > tryp.out
21010 $cat tryp.c | $run ./tryp 2>/dev/null > tryp.out
21012 if cmp tryp.c tryp.out >/dev/null 2>&1; then
21014 fflush(NULL) seems to behave okay with input streams.
21016 fflushNULL="$define"
21019 Ouch, fflush(NULL) clobbers input pipes! We will not use it.
21021 fflushNULL="$undef"
21024 $rm -f core tryp.c tryp.core core.tryp.*
21027 Your fflush(NULL) isn't working (contrary to ANSI C).
21029 fflushNULL="$undef"
21032 Cannot figure out whether your fflush(NULL) works or not.
21033 I'm assuming it doesn't (contrary to ANSI C).
21035 fflushNULL="$undef"
21039 $define|true|[yY]*)
21040 fflushNULL="$define"
21043 fflushNULL="$undef"
21046 : check explicit looping only if NULL did not work, and if the pipe
21047 : bug does not show up on an explicit flush too
21048 case "$fflushNULL" in
21050 $cat >tryp.c <<EOCP
21053 main(int argc, char **argv)
21059 while ((i = getc(stdin)) != -1
21060 && (*bp++ = i) != '\n'
21061 && bp < &buf[1024])
21064 fprintf(stdout, "%s", buf);
21073 if eval $compile; then
21075 if $test "X$targethost" != X; then
21078 $run "cat tryp.c | ./tryp " 2>/dev/null > tryp.out
21080 $cat tryp.c | $run ./tryp 2>/dev/null > tryp.out
21082 if cmp tryp.c tryp.out >/dev/null 2>&1; then
21084 Good, at least fflush(stdin) seems to behave okay when stdin is a pipe.
21086 : now check for fflushall behaviour
21087 case "$fflushall" in
21088 '') set try -DTRY_FFLUSH_ALL $output
21089 if eval $compile; then
21091 (Now testing the other method--but note that this also may fail.)
21093 $run ./try 2>/dev/null
21096 if $test -s try.out -a "X$code" = X42; then
21097 fflushall="`$cat try.out`"
21101 case "$fflushall" in
21103 Whew. Flushing explicitly all the stdio streams works.
21105 fflushall="$define"
21108 Sigh. Flushing explicitly all the stdio streams doesn't work.
21113 Cannot figure out whether flushing stdio streams explicitly works or not.
21114 I'm assuming it doesn't.
21120 "$define"|true|[yY]*)
21121 fflushall="$define"
21129 All is futile. Even fflush(stdin) clobbers input pipes!
21136 $rm -f core tryp.c tryp.core core.tryp.*
21138 *) fflushall="$undef"
21142 case "$fflushNULL$fflushall" in
21145 OK, I give up. I cannot figure out how to flush pending stdio output.
21146 We won't be flushing handles at all before fork/exec/popen.
21152 : Store the full pathname to the ar program for use in the C program
21153 : Respect a hint or command line value for full_ar.
21158 : Store the full pathname to the sed program for use in the C program
21161 : see what type gids are declared as in the kernel
21163 echo "Looking for the type for group ids returned by getgid()."
21164 set gid_t gidtype xxx stdio.h sys/types.h
21168 xxx=`./findhdr sys/user.h`
21169 set `grep 'groups\[NGROUPS\];' "$xxx" 2>/dev/null` unsigned short
21171 unsigned) dflt="$1 $2" ;;
21175 *) dflt="$gidtype";;
21178 gid_t) echo "gid_t found." ;;
21179 *) rp="What is the type for group ids returned by getgid()?"
21185 : Check the size of GID
21188 *_t) zzz="$gidtype" ;;
21191 echo "Checking the size of $zzz..." >&4
21193 #include <sys/types.h>
21195 #$i_stdlib I_STDLIB
21197 #include <stdlib.h>
21200 printf("%d\n", (int)sizeof($gidtype));
21205 if eval $compile_ok; then
21209 echo "(I can't execute the test program--guessing $gidsize.)" >&4
21212 echo "Your $zzz is $gidsize bytes long."
21217 echo "(I can't compile the test program--guessing $gidsize.)" >&4
21221 : Check if GID is signed
21224 *_t) zzz="$gidtype" ;;
21227 echo "Checking the sign of $zzz..." >&4
21229 #include <sys/types.h>
21240 if eval $compile; then
21244 echo "(I can't execute the test program--guessing unsigned.)" >&4
21248 1) echo "Your $zzz is unsigned." ;;
21249 -1) echo "Your $zzz is signed." ;;
21255 echo "(I can't compile the test program--guessing unsigned.)" >&4
21259 : Check 64bit sizes
21262 if $test X"$quadtype" != X; then
21264 echo "Checking how to print 64-bit integers..." >&4
21266 if $test X"$sPRId64" = X -a X"$quadtype" = Xint; then
21267 $cat >try.c <<'EOCP'
21268 #include <sys/types.h>
21271 int q = 12345678901;
21272 printf("%ld\n", q);
21276 if eval $compile; then
21280 sPRId64='"d"'; sPRIi64='"i"'; sPRIu64='"u"';
21281 sPRIo64='"o"'; sPRIx64='"x"'; sPRIXU64='"X"';
21282 echo "We will use %d."
21288 if $test X"$sPRId64" = X -a X"$quadtype" = Xlong; then
21289 $cat >try.c <<'EOCP'
21290 #include <sys/types.h>
21293 long q = 12345678901;
21294 printf("%ld\n", q);
21298 if eval $compile; then
21302 sPRId64='"ld"'; sPRIi64='"li"'; sPRIu64='"lu"';
21303 sPRIo64='"lo"'; sPRIx64='"lx"'; sPRIXU64='"lX"';
21304 echo "We will use %ld."
21310 if $test X"$sPRId64" = X -a X"$i_inttypes" = X"$define" -a X"$quadtype" = Xint64_t; then
21311 $cat >try.c <<'EOCP'
21312 #include <sys/types.h>
21313 #include <inttypes.h>
21316 int64_t q = 12345678901;
21317 printf("%" PRId64 "\n", q);
21321 if eval $compile; then
21325 sPRId64=PRId64; sPRIi64=PRIi64; sPRIu64=PRIu64;
21326 sPRIo64=PRIo64; sPRIx64=PRIx64; sPRIXU64=PRIXU64;
21327 echo "We will use the C9X style."
21333 if $test X"$sPRId64" = X -a X"$quadtype" != X; then
21335 #include <sys/types.h>
21338 $quadtype q = 12345678901;
21339 printf("%Ld\n", q);
21343 if eval $compile; then
21347 sPRId64='"Ld"'; sPRIi64='"Li"'; sPRIu64='"Lu"';
21348 sPRIo64='"Lo"'; sPRIx64='"Lx"'; sPRIXU64='"LX"';
21349 echo "We will use %Ld."
21355 if $test X"$sPRId64" = X -a X"$quadtype" = X"long long"; then
21356 $cat >try.c <<'EOCP'
21357 #include <sys/types.h>
21360 long long q = 12345678901LL; /* AIX cc requires the LL suffix. */
21361 printf("%lld\n", q);
21365 if eval $compile; then
21369 sPRId64='"lld"'; sPRIi64='"lli"'; sPRIu64='"llu"';
21370 sPRIo64='"llo"'; sPRIx64='"llx"'; sPRIXU64='"llX"';
21371 echo "We will use the %lld style."
21377 if $test X"$sPRId64" = X -a X"$quadtype" != X; then
21379 #include <sys/types.h>
21382 $quadtype q = 12345678901;
21383 printf("%qd\n", q);
21387 if eval $compile; then
21391 sPRId64='"qd"'; sPRIi64='"qi"'; sPRIu64='"qu"';
21392 sPRIo64='"qo"'; sPRIx64='"qx"'; sPRIXU64='"qX"';
21393 echo "We will use %qd."
21399 if $test X"$sPRId64" = X; then
21400 echo "Cannot figure out how to print 64-bit integers." >&4
21407 '') d_PRId64="$undef"; d_PRIi64="$undef"; d_PRIu64="$undef";
21408 d_PRIo64="$undef"; d_PRIx64="$undef"; d_PRIXU64="$undef";
21410 *) d_PRId64="$define"; d_PRIi64="$define"; d_PRIu64="$define";
21411 d_PRIo64="$define"; d_PRIx64="$define"; d_PRIXU64="$define";
21415 : Check format strings for internal types
21417 $echo "Checking the format strings to be used for Perl's internal types..." >&4
21419 if $test X"$ivsize" = X8; then
21420 ivdformat="$sPRId64"
21421 uvuformat="$sPRIu64"
21422 uvoformat="$sPRIo64"
21423 uvxformat="$sPRIx64"
21424 uvXUformat="$sPRIXU64"
21426 if $test X"$ivsize" = X"$longsize"; then
21433 if $test X"$ivsize" = X"$intsize"; then
21441 if $test X"$ivsize" = X"$shortsize"; then
21452 if $test X"$usequadmath" = X"$define"; then
21460 if $test X"$uselongdouble" = X"$define" -a X"$d_longdbl" = X"$define" -a X"$d_PRIgldbl" = X"$define"; then
21461 nveformat="$sPRIeldbl"
21462 nvfformat="$sPRIfldbl"
21463 nvgformat="$sPRIgldbl"
21464 nvEUformat="$sPRIEUldbl"
21465 nvFUformat="$sPRIFUldbl"
21466 nvGUformat="$sPRIGUldbl"
21477 case "$ivdformat" in
21478 '') echo "$0: Fatal: failed to find format strings, cannot continue." >&4
21483 : Check format string for GID
21486 $echo "Checking the format string to be used for gids..." >&4
21489 -1) if $test X"$gidsize" = X"$ivsize"; then
21490 gidformat="$ivdformat"
21492 if $test X"$gidsize" = X"$longsize"; then
21495 if $test X"$gidsize" = X"$intsize"; then
21498 if $test X"$gidsize" = X"$shortsize"; then
21505 *) if $test X"$gidsize" = X"$uvsize"; then
21506 gidformat="$uvuformat"
21508 if $test X"$gidsize" = X"$longsize"; then
21511 if $test X"$gidsize" = X"$intsize"; then
21514 if $test X"$gidsize" = X"$shortsize"; then
21523 : see if getgroups exists
21524 set getgroups d_getgrps
21527 : see if setgroups exists
21528 set setgroups d_setgrps
21531 : Find type of 2nd arg to 'getgroups()' and 'setgroups()'
21533 case "$d_getgrps$d_setgrps" in
21535 case "$groupstype" in
21536 '') dflt="$gidtype" ;;
21537 *) dflt="$groupstype" ;;
21540 What type of pointer is the second argument to getgroups() and setgroups()?
21541 Usually this is the same as group ids, $gidtype, but not always.
21544 rp='What type pointer is the second argument to getgroups() and setgroups()?'
21548 *) groupstype="$gidtype";;
21551 : check whether make sets MAKE
21553 echo "Checking if your $make program sets \$(MAKE)..." >&4
21554 case "$make_set_make" in
21556 $sed 's/^X //' > testmake.mak << 'EOF'
21558 X @echo 'maketemp="$(MAKE)"'
21560 case "`$make -f testmake.mak 2>/dev/null`" in
21561 *maketemp=*) make_set_make='#' ;;
21562 *) make_set_make="MAKE=$make" ;;
21564 $rm -f testmake.mak
21567 case "$make_set_make" in
21568 '#') echo "Yup, it does.";;
21569 *) echo "Nope, it doesn't.";;
21572 : see what type is used for mode_t
21573 rp="What is the type used for file modes for system calls (e.g. fchmod())?"
21574 set mode_t modetype int stdio.h sys/types.h
21577 : see if we need va_copy
21579 case "$i_stdarg" in
21582 #include <stdarg.h>
21584 #$i_stdlib I_STDLIB
21586 #include <stdlib.h>
21588 #include <signal.h>
21591 ivfprintf(FILE *f, const char *fmt, va_list *valp)
21593 return vfprintf(f, fmt, *valp);
21597 myvfprintf(FILE *f, const char *fmt, va_list val)
21599 return ivfprintf(f, fmt, &val);
21603 myprintf(char *fmt, ...)
21606 va_start(val, fmt);
21607 return myvfprintf(stdout, fmt, val);
21611 main(int ac, char **av)
21613 signal(SIGSEGV, exit);
21615 myprintf("%s%cs all right, then\n", "that", '\'');
21620 if eval $compile && $run ./try 2>&1 >/dev/null; then
21621 case "`$run ./try`" in
21622 "that's all right, then")
21628 yes) echo "It seems that you don't need va_copy()." >&4
21629 need_va_copy="$undef"
21631 *) echo "It seems that va_copy() or similar will be needed." >&4
21632 need_va_copy="$define"
21637 *) echo "You don't have <stdarg.h>, not checking for va_copy()." >&4
21638 need_va_copy="$undef"
21642 : see what type is used for size_t
21643 rp="What is the type used for the length parameter for string functions?"
21644 set size_t sizetype 'unsigned int' stdio.h sys/types.h
21647 : check for type of arguments to gethostbyaddr.
21648 if test "X$netdb_host_type" = X -o "X$netdb_hlen_type" = X; then
21649 case "$d_gethbyaddr" in
21653 Checking to see what type of arguments are accepted by gethostbyaddr().
21655 hdrs="$define sys/types.h
21656 $d_socket sys/socket.h
21657 $i_niin netinet/in.h
21659 $i_unistd unistd.h"
21660 : The first arg can 'char *' or 'void *'
21661 : The second arg is some of integral type
21662 for xxx in in_addr_t 'const void *' 'const char *' 'void *' 'char *'; do
21663 for yyy in size_t long int; do
21664 case "$netdb_host_type" in
21665 '') try="$extern_C struct hostent *gethostbyaddr($xxx, $yyy, int);"
21666 if ./protochk "$try" $hdrs; then
21667 echo "Your system accepts $xxx for the first arg."
21668 echo "...and $yyy for the second arg."
21669 netdb_host_type="$xxx"
21670 netdb_hlen_type="$yyy"
21676 : In case none of those worked, prompt the user.
21677 case "$netdb_host_type" in
21678 '') rp='What is the type for the 1st argument to gethostbyaddr?'
21681 netdb_host_type=$ans
21682 rp='What is the type for the 2nd argument to gethostbyaddr?'
21685 netdb_hlen_type=$ans
21689 *) : no gethostbyaddr, so pick harmless defaults
21690 netdb_host_type='char *'
21691 netdb_hlen_type="$sizetype"
21694 # Remove the "const" if needed. -- but then we'll have a
21696 # netdb_host_type=`echo "$netdb_host_type" | sed 's/^const //'`
21699 : check for type of argument to gethostbyname.
21700 if test "X$netdb_name_type" = X ; then
21701 case "$d_gethbyname" in
21705 Checking to see what type of argument is accepted by gethostbyname().
21707 hdrs="$define sys/types.h
21708 $d_socket sys/socket.h
21709 $i_niin netinet/in.h
21711 $i_unistd unistd.h"
21712 for xxx in "const char *" "char *"; do
21713 case "$netdb_name_type" in
21714 '') try="$extern_C struct hostent *gethostbyname($xxx);"
21715 if ./protochk "$try" $hdrs; then
21716 echo "Your system accepts $xxx."
21717 netdb_name_type="$xxx"
21722 : In case none of those worked, prompt the user.
21723 case "$netdb_name_type" in
21724 '') rp='What is the type for the 1st argument to gethostbyname?'
21727 netdb_name_type=$ans
21731 *) : no gethostbyname, so pick harmless default
21732 netdb_name_type='char *'
21737 : check for type of 1st argument to getnetbyaddr.
21738 if test "X$netdb_net_type" = X ; then
21739 case "$d_getnbyaddr" in
21743 Checking to see what type of 1st argument is accepted by getnetbyaddr().
21745 hdrs="$define sys/types.h
21746 $d_socket sys/socket.h
21747 $i_niin netinet/in.h
21749 $i_unistd unistd.h"
21750 for xxx in in_addr_t "unsigned long" long "unsigned int" int; do
21751 case "$netdb_net_type" in
21752 '') try="$extern_C struct netent *getnetbyaddr($xxx, int);"
21753 if ./protochk "$try" $hdrs; then
21754 echo "Your system accepts $xxx."
21755 netdb_net_type="$xxx"
21760 : In case none of those worked, prompt the user.
21761 case "$netdb_net_type" in
21762 '') rp='What is the type for the 1st argument to getnetbyaddr?'
21765 netdb_net_type=$ans
21769 *) : no getnetbyaddr, so pick harmless default
21770 netdb_net_type='long'
21774 : locate the preferred pager for this system
21781 [a-zA-Z]:/*) dflt=$pg;;
21785 [a-zA-Z]:/*) dflt=$more;;
21789 [a-zA-Z]:/*) dflt=$less;;
21792 '') dflt=/usr/ucb/more;;
21800 rp='What pager is used on your system?'
21804 : see if ar generates random libraries by itself
21806 echo "Checking how to generate random libraries on your machine..." >&4
21807 echo 'int bar1() { return bar2(); }' > bar1.c
21808 echo 'int bar2() { return 2; }' > bar2.c
21810 #$i_stdlib I_STDLIB
21812 #include <stdlib.h>
21814 int main() { printf("%d\n", bar1()); exit(0); }
21816 $cc $ccflags -c bar1.c >/dev/null 2>&1
21817 $cc $ccflags -c bar2.c >/dev/null 2>&1
21818 $cc $ccflags -c foo.c >/dev/null 2>&1
21819 $ar rc bar$_a bar2$_o bar1$_o >/dev/null 2>&1
21820 if $cc -o foobar $ccflags $ldflags foo$_o bar$_a $libs > /dev/null 2>&1 &&
21821 $run ./foobar >/dev/null 2>&1; then
21822 echo "$ar appears to generate random libraries itself."
21824 if [ "X$ranlib" = "X" ]; then
21827 elif $ar s bar$_a >/dev/null 2>&1 &&
21828 $cc -o foobar $ccflags $ldflags foo$_o bar$_a $libs > /dev/null 2>&1 &&
21829 $run ./foobar >/dev/null 2>&1; then
21830 echo "a table of contents needs to be added with '$ar s'."
21833 elif $ar ts bar$_a >/dev/null 2>&1 &&
21834 $cc -o foobar $ccflags $ldflags foo$_o bar$_a $libs > /dev/null 2>&1 &&
21835 $run ./foobar >/dev/null 2>&1; then
21836 echo "a table of contents needs to be added with '$ar ts'."
21843 ranlib=`./loc ranlib X /usr/bin /bin /usr/local/bin`
21844 $test -f $ranlib || ranlib=''
21847 if $test -n "$ranlib"; then
21848 echo "your system has '$ranlib'; we'll use that."
21851 echo "your system doesn't seem to support random libraries"
21852 echo "so we'll use lorder and tsort to order the libraries."
21859 : see if this is a values.h system
21860 set values.h i_values
21863 : Check the max offset that gmtime and localtime accept
21864 echo "Checking max offsets that gmtime () accepts"
21867 define) yyy="#include <values.h>" ;;
21871 case "$sGMTIME_min/$sGMTIME_max" in
21874 #include <sys/types.h>
21883 void gm_check (time_t t, int min_year, int max_year)
21886 if ( tmp == NULL ||
21887 /* Check tm_year overflow */
21888 tmp->tm_year < min_year || tmp->tm_year > max_year)
21899 gm_check (MAXLONG, 69, 0x7fffffff);
21901 if (tmp == NULL || tmp->tm_year < 0) {
21902 for (i = 63; i >= 0; i--) {
21903 time_t x = pt | ((time_t)1 << i);
21904 if (x < 0 || x < pt) continue;
21905 gm_check (x, 69, 0x7fffffff);
21908 printf ("sGMTIME_max=%ld\n", pt);
21917 gm_check (MINLONG, -1900, 70);
21920 for (i = 36; i >= 0; i--) {
21921 time_t x = pt - ((time_t)1 << i);
21922 if (x > 0) continue;
21923 gm_check (x, -1900, 70);
21926 printf ("sGMTIME_min=%ld\n", pt);
21930 int main (int argc, char *argv[])
21932 /* fprintf (stderr, "Sizeof time_t = %ld\n", sizeof (time_t)); */
21939 if eval $compile; then
21940 eval `$run ./try 2>/dev/null`
21942 echo "Cannot determine sGMTIME_max and sGMTIME_min." >&4
21948 echo "Checking max offsets that localtime () accepts"
21950 case "$sLOCALTIME_min/$sLOCALTIME_max" in
21953 #include <sys/types.h>
21962 void local_check (time_t t, int min_year, int max_year)
21964 if (sizeof (time_t) > 4 && t > 0x7ffffffffffff000LL)
21967 tmp = localtime (&t);
21968 if ( tmp == NULL ||
21969 /* Check tm_year overflow */
21970 tmp->tm_year < min_year || tmp->tm_year > max_year)
21974 } /* local_check */
21981 local_check (MAXLONG, 69, 0x7fffffff);
21983 if (tmp == NULL || tmp->tm_year < 0) {
21984 for (i = 63; i >= 0; i--) {
21985 time_t x = pt | ((time_t)1 << i);
21986 if (x < 0 || x < pt) continue;
21987 local_check (x, 69, 0x7fffffff);
21990 printf ("sLOCALTIME_max=%ld\n", pt);
21999 local_check (MINLONG, -1900, 70);
22002 for (i = 36; i >= 0; i--) {
22003 time_t x = pt - ((time_t)1 << i);
22004 if (x > 0) continue;
22005 local_check (x, -1900, 70);
22008 printf ("sLOCALTIME_min=%ld\n", pt);
22012 int main (int argc, char *argv[])
22020 if eval $compile; then
22021 eval `$run ./try 2>/dev/null`
22023 echo "Cannot determine sLOCALTIME_max and sLOCALTIME_min." >&4
22029 : check for type of arguments to select.
22030 case "$selecttype" in
22031 '') case "$d_select" in
22035 Checking to see what type of arguments are accepted by select().
22037 hdrs="$define sys/types.h
22038 $i_systime sys/time.h
22039 $i_sysselct sys/select.h
22040 $d_socket sys/socket.h"
22041 : The first arg can be int, unsigned, or size_t
22042 : The last arg may or may not be 'const'
22044 : void pointer has been seen but using that
22045 : breaks the selectminbits test
22046 for xxx in 'fd_set *' 'int *'; do
22047 for nfd in 'int' 'size_t' 'unsigned long' 'unsigned' ; do
22048 for tmo in 'struct timeval *' 'const struct timeval *'; do
22050 '') try="$extern_C select _(($nfd, $xxx, $xxx, $xxx, $tmo));"
22051 if ./protochk "$try" $hdrs; then
22052 echo "Your system accepts $xxx."
22061 '') rp='What is the type for the 2nd, 3rd, and 4th arguments to select?'
22062 case "$d_fd_set" in
22063 $define) dflt="fd_set *" ;;
22072 *) : no select, so pick a harmless default
22079 : check for the select 'width'
22080 case "$selectminbits" in
22081 '') safebits=`expr $ptrsize \* 8`
22082 case "$d_select" in
22086 Checking to see on how many bits at a time your select() operates...
22089 #include <sys/types.h>
22091 #$i_systime I_SYS_TIME
22092 #$i_systimek I_SYS_TIME_KERNEL
22097 # ifdef I_SYS_TIME_KERNEL
22100 # include <sys/time.h>
22101 # ifdef I_SYS_TIME_KERNEL
22105 #$i_sysselct I_SYS_SELECT
22106 #ifdef I_SYS_SELECT
22107 #include <sys/select.h>
22109 #$d_socket HAS_SOCKET
22111 # include <sys/socket.h> /* Might include <sys/bsdtypes.h> */
22114 #$i_stdlib I_STDLIB
22116 #include <stdlib.h>
22119 #define S sizeof(*(b))
22121 #define NBYTES (S * 8 > MINBITS ? S : MINBITS/8)
22122 #define NBITS (NBYTES * 8)
22124 char *s = (char *)malloc(NBYTES);
22133 fp = fopen("try.c", "r");
22139 b = ($selecttype)s;
22140 for (i = 0; i < NBITS; i++)
22144 select(fd + 1, b, 0, 0, &t);
22145 for (i = NBITS - 1; i > fd && FD_ISSET(i, b); i--);
22147 printf("%d\n", i + 1);
22152 if eval $compile_ok; then
22153 selectminbits=`$run ./try 2>/dev/null`
22154 case "$selectminbits" in
22156 Cannot figure out on how many bits at a time your select() operates.
22157 I'll play safe and guess it is $safebits bits.
22159 selectminbits=$safebits
22160 bits="$safebits bits"
22163 *) bits="$selectminbits bits" ;;
22165 echo "Your select() operates on $bits at a time." >&4
22167 rp='What is the minimum number of bits your select() operates on?'
22168 case "$byteorder" in
22169 12345678) dflt=64 ;;
22175 selectminbits="$val"
22179 *) : no select, so pick a harmless default
22180 selectminbits=$safebits
22186 : Trace out the files included by signal.h, then look for SIGxxx names.
22187 case "$sig_num_init" in
22189 if [ "X$fieldn" = X ]; then
22190 : Just make some guesses. We check them later.
22191 xxx="$sysroot/usr/include/signal.h $sysroot/usr/include/sys/signal.h"
22193 xxx=`echo '#include <signal.h>' |
22194 $cppstdin $cppminus $cppflags 2>/dev/null |
22195 $grep '^[ ]*#.*include' |
22196 $awk "{print \\$$fieldn}" | $sed 's!"!!g' |\
22197 $sed 's!\\\\\\\\!/!g' | $sort | $uniq`
22200 for xx in $xxx /dev/null ; do
22201 $test -f "$xx" && xxxfiles="$xxxfiles $xx"
22203 case "$xxxfiles" in
22204 '') xxxfiles=`./findhdr signal.h` ;;
22207 $1 ~ /^#define$/ && $2 ~ /^SIG[A-Z0-9]*$/ && $2 !~ /SIGARRAYSIZE/ && $2 !~ /SIGSTKSIZE/ && $2 !~ /SIGSTKSZ/ && $3 !~ /void/ {
22208 print substr($2, 4, 20)
22210 $1 == "#" && $2 ~ /^define$/ && $3 ~ /^SIG[A-Z0-9]*$/ && $3 !~ /SIGARRAYSIZE/ && $4 !~ /void/ {
22211 print substr($3, 4, 20)
22213 : Append some common names just in case the awk scan failed.
22214 xxx="$xxx ABRT ALRM BUS CANCEL CHLD CLD CONT DIL EMT FPE"
22215 xxx="$xxx FREEZE HUP ILL INT IO IOT KILL LOST LWP PHONE"
22216 xxx="$xxx PIPE POLL PROF PWR QUIT RTMAX RTMIN SEGV STKFLT STOP"
22217 xxx="$xxx SYS TERM THAW TRAP TSTP TTIN TTOU URG USR1 USR2"
22218 xxx="$xxx USR3 USR4 VTALRM WAITING WINCH WIND WINDOW XCPU XFSZ"
22220 : generate a few handy files for later
22221 $cat > signal.c <<EOCP
22222 #include <sys/types.h>
22223 #include <signal.h>
22224 #$i_stdlib I_STDLIB
22226 #include <stdlib.h>
22231 /* Strange style to avoid deeply-nested #if/#else/#endif */
22234 # define NSIG (_NSIG)
22240 # define NSIG (SIGMAX+1)
22246 # define NSIG (SIG_MAX+1)
22252 # define NSIG (_SIG_MAX+1)
22258 # define NSIG (MAXSIG+1)
22264 # define NSIG (MAX_SIG+1)
22269 # ifdef SIGARRAYSIZE
22270 # define NSIG SIGARRAYSIZE /* Assume ary[SIGARRAYSIZE] */
22276 # define NSIG (_sys_nsig) /* Solaris 2.5 */
22280 /* Default to some arbitrary number that's big enough to get most
22281 of the common signals.
22287 printf("NSIG %d\n", NSIG);
22293 echo $xxx | $tr ' ' $trnl | $sort | $uniq | $awk '
22295 printf "#ifdef SIG"; printf $1; printf "\n"
22296 printf "printf(\""; printf $1; printf " %%d\\n\",SIG";
22297 printf $1; printf ");\n"
22301 printf "#endif /* JUST_NSIG */\n";
22302 printf "exit(0);\n}\n";
22305 $cat >signal.awk <<'EOP'
22306 BEGIN { ndups = 0 }
22307 $1 ~ /^NSIG$/ { nsig = $2 }
22308 ($1 !~ /^NSIG$/) && (NF == 2) && ($2 ~ /^[0-9][0-9]*$/) {
22309 if ($2 > maxsig) { maxsig = $2 }
22310 if (sig_name[$2]) {
22311 dup_name[ndups] = $1
22312 dup_num[ndups] = $2
22324 printf("NSIG %d\n", nsig);
22325 for (n = 1; n < nsig; n++) {
22327 printf("%s %d\n", sig_name[n], sig_num[n])
22330 printf("NUM%d %d\n", n, n)
22333 for (n = 0; n < ndups; n++) {
22334 printf("%s %d\n", dup_name[n], dup_num[n])
22338 $cat >signal_cmd <<EOS
22340 if $test -s signal.lst; then
22341 echo "Using your existing signal.lst file"
22346 $cat >>signal_cmd <<'EOS'
22349 if eval $compile_ok; then
22350 $run ./signal$_exe | ($sort -n -k 2 2>/dev/null || $sort -n +1) |\
22351 $uniq | $awk -f signal.awk >signal.lst
22353 echo "(I can't seem be able to compile the whole test program)" >&4
22354 echo "(I'll try it in little pieces.)" >&4
22355 set signal -DJUST_NSIG
22356 if eval $compile_ok; then
22357 $run ./signal$_exe > signal.nsg
22360 echo "I can't seem to figure out how many signals you have." >&4
22361 echo "Guessing 50." >&4
22362 echo 'NSIG 50' > signal.nsg
22364 : Now look at all the signal names, one at a time.
22365 for xx in `echo $xxx | $tr ' ' $trnl | $sort | $uniq`; do
22366 $cat > signal.c <<EOCP
22367 #include <sys/types.h>
22368 #include <signal.h>
22371 printf("$xx %d\n", SIG${xx});
22376 if eval $compile; then
22377 echo "SIG${xx} found."
22378 $run ./signal$_exe >> signal.ls1
22380 echo "SIG${xx} NOT found."
22383 if $test -s signal.ls1; then
22384 $cat signal.nsg signal.ls1 |
22385 $sort -n | $uniq | $awk -f signal.awk >signal.lst
22389 if $test -s signal.lst; then
22392 echo "(AAK! I can't compile the test programs -- Guessing)" >&4
22393 echo 'kill -l' >signal
22394 set X `csh -f <signal`
22398 0) set HUP INT QUIT ILL TRAP ABRT EMT FPE KILL BUS SEGV SYS PIPE ALRM TERM;;
22400 echo $@ | $tr ' ' $trnl | \
22401 $awk '{ printf "%s %d\n", $1, ++s; }
22402 END { printf "NSIG %d\n", ++s }' >signal.lst
22404 $rm -f signal.c signal$_exe signal$_o signal.nsg signal.ls1
22406 chmod a+x signal_cmd
22407 $eunicefix signal_cmd
22411 : generate list of signal names
22412 case "$sig_num_init" in
22415 case "$sig_name_init" in
22417 *) case "$sig_num_init" in
22418 ''|*,*) doinit=yes ;;
22423 echo "Generating a list of signal names and numbers..." >&4
22425 sig_count=`$awk '/^NSIG/ { printf "%d", $2 }' signal.lst`
22426 sig_name=`$awk 'BEGIN { printf "ZERO " }
22427 !/^NSIG/ { printf "%s ", $1 }' signal.lst`
22428 sig_num=`$awk 'BEGIN { printf "0 " }
22429 !/^NSIG/ { printf "%d ", $2 }' signal.lst`
22430 sig_name_init=`$awk 'BEGIN { printf "\"ZERO\", " }
22431 !/^NSIG/ { printf "\"%s\", ", $1 }
22432 END { printf "0\n" }' signal.lst`
22433 sig_num_init=`$awk 'BEGIN { printf "0, " }
22434 !/^NSIG/ { printf "%d, ", $2}
22435 END { printf "0\n"}' signal.lst`
22438 echo "The following $sig_count signals are available:"
22440 echo $sig_name | $awk \
22441 'BEGIN { linelen = 0 }
22443 for (i = 1; i <= NF; i++) {
22444 name = "SIG" $i " "
22445 linelen = linelen + length(name)
22446 if (linelen > 70) {
22448 linelen = length(name)
22454 sig_size=`echo $sig_name | awk '{print NF}'`
22455 $rm -f signal signal.c signal.awk signal.lst signal_cmd
22459 : Check size of size
22461 case "$sizetype" in
22462 *_t) zzz="$sizetype" ;;
22463 *) zzz="filesize" ;;
22465 echo "Checking the size of $zzz..." >&4
22467 #include <sys/types.h>
22469 #$i_stdlib I_STDLIB
22471 #include <stdlib.h>
22474 printf("%d\n", (int)sizeof($sizetype));
22479 if eval $compile_ok; then
22483 echo "(I can't execute the test program--guessing $sizesize.)" >&4
22486 echo "Your $zzz size is $sizesize bytes."
22491 echo "(I can't compile the test program--guessing $sizesize.)" >&4
22495 : check for socklen_t
22497 echo "Checking to see if you have socklen_t..." >&4
22499 #include <sys/types.h>
22500 #$d_socket HAS_SOCKET
22502 #include <sys/socket.h>
22504 int main() { socklen_t x = 16; }
22507 if eval $compile; then
22509 echo "You have socklen_t."
22512 echo "You do not have socklen_t."
22513 case "$sizetype" in
22514 size_t) echo "(You do have size_t, that might work. Some people are happy with just an int.)" ;;
22521 : see if this is a socks.h system
22522 set socks.h i_socks
22525 : check for type of the size argument to socket calls
22526 case "$d_socket" in
22530 Checking to see what type is the last argument of accept().
22533 case "$d_socklen_t" in
22534 "$define") yyy="$yyy socklen_t"
22536 yyy="$yyy $sizetype int long unsigned"
22537 for xxx in $yyy; do
22538 case "$socksizetype" in
22539 '') try="$extern_C int accept(int, struct sockaddr *, $xxx *);"
22540 case "$usesocks" in
22542 if ./protochk "$try" $i_systypes sys/types.h $d_socket sys/socket.h literal '#define INCLUDE_PROTOTYPES' $i_socks socks.h.; then
22543 echo "Your system accepts '$xxx *' for the last argument of accept()."
22544 socksizetype="$xxx"
22547 *) if ./protochk "$try" $i_systypes sys/types.h $d_socket sys/socket.h; then
22548 echo "Your system accepts '$xxx *' for the last argument of accept()."
22549 socksizetype="$xxx"
22556 : In case none of those worked, prompt the user.
22557 case "$socksizetype" in
22558 '') rp='What is the type for socket address structure sizes?'
22565 *) : no sockets, so pick relatively harmless default
22570 : see what type is used for signed size_t
22571 set ssize_t ssizetype int stdio.h sys/types.h
22576 #$i_stdlib I_STDLIB
22578 #include <stdlib.h>
22580 #include <sys/types.h>
22581 #define Size_t $sizetype
22582 #define SSize_t $dflt
22585 if (sizeof(Size_t) == sizeof(SSize_t))
22587 else if (sizeof(Size_t) == sizeof(int))
22596 if eval $compile_ok && $run ./try > /dev/null; then
22597 ssizetype=`$run ./try`
22598 echo "I'll be using $ssizetype for functions returning a byte count." >&4
22601 Help! I can't compile and run the ssize_t test program: please enlighten me!
22602 (This is probably a misconfiguration in your system or libraries, and
22603 you really ought to fix it. Still, I'll try anyway.)
22605 I need a type that is the same size as $sizetype, but is guaranteed to
22606 be signed. Common values are ssize_t, int and long.
22609 rp="What signed type is the same size as $sizetype?"
22615 : Check the size of st_ino
22617 $echo "Checking the size of st_ino..." >&4
22618 $cat > try.c <<EOCP
22619 #include <sys/stat.h>
22621 #$i_stdlib I_STDLIB
22623 #include <stdlib.h>
22627 printf("%d\n", (int)sizeof(st.st_ino));
22632 if eval $compile_ok; then
22636 $echo "(I can't execute the test program--guessing $st_ino_size.)" >&4
22638 *) st_ino_size=$val
22639 $echo "Your st_ino is $st_ino_size bytes long."
22644 $echo "(I can't compile the test program--guessing $st_ino_size.)" >&4
22648 : Check if st_ino is signed
22650 $echo "Checking the sign of st_ino..." >&4
22651 $cat > try.c <<EOCP
22652 #include <sys/stat.h>
22657 if (foo.st_ino < 0)
22664 if eval $compile; then
22668 $echo "(I can't execute the test program--guessing unsigned.)" >&4
22670 *) st_ino_sign=$val
22671 case "$st_ino_sign" in
22672 1) $echo "Your st_ino is unsigned." ;;
22673 -1) $echo "Your st_ino is signed." ;;
22679 $echo "(I can't compile the test program--guessing unsigned.)" >&4
22683 : see what type of char stdio uses.
22685 echo '#include <stdio.h>' | $cppstdin $cppminus > stdioh
22686 if $contains 'unsigned.*char.*_ptr;' stdioh >/dev/null 2>&1 ; then
22687 echo "Your stdio uses unsigned chars." >&4
22688 stdchar="unsigned char"
22690 echo "Your stdio uses signed chars." >&4
22695 : Check size of UID
22698 *_t) zzz="$uidtype" ;;
22701 echo "Checking the size of $zzz..." >&4
22703 #include <sys/types.h>
22705 #$i_stdlib I_STDLIB
22707 #include <stdlib.h>
22710 printf("%d\n", (int)sizeof($uidtype));
22715 if eval $compile_ok; then
22719 echo "(I can't execute the test program--guessing $uidsize.)" >&4
22722 echo "Your $zzz is $uidsize bytes long."
22727 echo "(I can't compile the test program--guessing $uidsize.)" >&4
22730 : Check if UID is signed
22733 *_t) zzz="$uidtype" ;;
22736 echo "Checking the sign of $zzz..." >&4
22738 #include <sys/types.h>
22749 if eval $compile; then
22753 echo "(I can't execute the test program--guessing unsigned.)" >&4
22757 1) echo "Your $zzz is unsigned." ;;
22758 -1) echo "Your $zzz is signed." ;;
22764 echo "(I can't compile the test program--guessing unsigned.)" >&4
22768 : Check format string for UID
22770 $echo "Checking the format string to be used for uids..." >&4
22773 -1) if $test X"$uidsize" = X"$ivsize"; then
22774 uidformat="$ivdformat"
22776 if $test X"$uidsize" = X"$longsize"; then
22779 if $test X"$uidsize" = X"$intsize"; then
22782 if $test X"$uidsize" = X"$shortsize"; then
22789 *) if $test X"$uidsize" = X"$uvsize"; then
22790 uidformat="$uvuformat"
22792 if $test X"$uidsize" = X"$longsize"; then
22795 if $test X"$uidsize" = X"$intsize"; then
22798 if $test X"$uidsize" = X"$shortsize"; then
22807 : Determine if we can use sysctl with KERN_PROC_PATHNAME to find executing program
22809 echo "Determining whether we can use sysctl with KERN_PROC_PATHNAME to find executing program..." >&4
22810 $cat >try.c <<'EOM'
22811 /* Intentionally a long probe as I'd like to sanity check that the exact
22812 approach is going to work, as thinking it will work, but only having it
22813 part working at runtime is worse than not having it. */
22815 #include <sys/types.h>
22816 #include <sys/sysctl.h>
22817 #include <sys/param.h>
22819 #include <string.h>
22820 #include <stdlib.h>
22821 #include <unistd.h>
22824 main(int argc, char **argv) {
22826 char *argv_leaf = strrchr(argv[0], '/');
22832 mib[1] = KERN_PROC;
22833 mib[2] = KERN_PROC_PATHNAME;
22837 fprintf(stderr, "Can't locate / in '%s'\n", argv[0]);
22841 if (sysctl(mib, 4, NULL, &size, NULL, 0)) {
22846 if (size < strlen(argv_leaf) + 1) {
22847 fprintf(stderr, "size %lu is too short for a path\n",
22848 (unsigned long) size);
22852 if (size > MAXPATHLEN * MAXPATHLEN) {
22853 fprintf(stderr, "size %lu is too long for a path\n",
22854 (unsigned long) size);
22858 buffer = malloc(size);
22864 if (sysctl(mib, 4, buffer, &size, NULL, 0)) {
22869 if (strlen(buffer) + 1 != size) {
22870 fprintf(stderr, "size != strlen(buffer) + 1 (%lu != %lu)\n",
22871 (unsigned long)size, (unsigned long)strlen(buffer) + 1);
22876 if (*buffer != '/') {
22877 fprintf(stderr, "Not an absolute path: '%s'\n", buffer);
22881 if (strstr(buffer, "/./")) {
22882 fprintf(stderr, "Contains /./: '%s'\n", buffer);
22886 if (strstr(buffer, "/../")) {
22887 fprintf(stderr, "Contains /../: '%s'\n", buffer);
22891 buffer_leaf = strrchr(buffer, '/');
22892 if (strcmp(buffer_leaf, argv_leaf) != 0) {
22893 fprintf(stderr, "Leafnames differ: '%s' vs '%s'\n", argv[0], buffer);
22905 if eval $compile; then
22906 if $run ./try; then
22907 echo "You can use sysctl with KERN_PROC_PATHNAME to find the executing program." >&4
22910 echo "Nope, sysctl with KERN_PROC_PATHNAME doesn't work here." >&4
22914 echo "I'm unable to compile the test program." >&4
22915 echo "I'll assume no sysctl with KERN_PROC_PATHNAME here." >&4
22919 set usekernprocpathname
22922 : Determine if we can use _NSGetExecutablePath to find executing program
22924 echo "Determining whether we can use _NSGetExecutablePath to find executing program..." >&4
22925 $cat >try.c <<'EOM'
22926 /* Intentionally a long probe as I'd like to sanity check that the exact
22927 approach is going to work, as thinking it will work, but only having it
22928 part working at runtime is worse than not having it. */
22929 #include <mach-o/dyld.h>
22931 #include <stdlib.h>
22932 #include <sys/param.h>
22933 #include <string.h>
22936 main(int argc, char **argv) {
22938 uint32_t size = sizeof(buf);
22942 char *argv_leaf = strrchr(argv[0], '/');
22946 fprintf(stderr, "Can't locate / in '%s'\n", argv[0]);
22950 _NSGetExecutablePath(buf, &size);
22951 if (size > MAXPATHLEN * MAXPATHLEN) {
22952 fprintf(stderr, "_NSGetExecutablePath size %u is too long for a path\n",
22953 (unsigned int) size);
22957 buffer = malloc(size);
22963 result = _NSGetExecutablePath(buffer, &size);
22965 fprintf(stderr, "_NSGetExecutablePath returned %i for a size of %u\n",
22966 result, (unsigned int) size);
22970 tidied = realpath(buffer, NULL);
22972 perror("realpath");
22978 if (*tidied != '/') {
22979 fprintf(stderr, "Not an absolute path: '%s'\n", tidied);
22983 if (strstr(tidied, "/./")) {
22984 fprintf(stderr, "Contains /./: '%s'\n", tidied);
22988 if (strstr(tidied, "/../")) {
22989 fprintf(stderr, "Contains /../: '%s'\n", tidied);
22993 tidied_leaf = strrchr(tidied, '/');
22994 if (strcmp(tidied_leaf, argv_leaf) != 0) {
22995 fprintf(stderr, "Leafnames differ: '%s' vs '%s'\n", argv[0], tidied);
23007 if eval $compile; then
23008 if $run ./try; then
23009 echo "You can use _NSGetExecutablePath to find the executing program." >&4
23012 echo "Nope, _NSGetExecutablePath doesn't work here." >&4
23015 echo "I'm unable to compile the test program." >&4
23016 echo "I'll assume no _NSGetExecutablePath here." >&4
23019 set usensgetexecutablepath
23022 : Check if site customization support was requested
23023 case "$usesitecustomize" in
23024 $define|true|[Yy]*)
23025 usesitecustomize="$define"
23028 usesitecustomize="$undef"
23032 : see if prototypes support variable argument declarations
23034 case "$prototype$i_stdarg" in
23036 echo "It appears we'll be able to prototype varargs functions." >&4
23040 echo "Too bad... We won't be using prototyped varargs functions..." >&4
23047 : determine compiler compiler
23056 if $test -f "$byacc$_exe"; then
23058 comp="byacc or $comp"
23060 if $test -f "$bison$_exe"; then
23061 comp="$comp or bison -y"
23063 rp="Which compiler compiler ($comp) shall I use?"
23072 echo "(Adding -y option to bison to get yacc-compatible behavior.)"
23078 : see if this is a assert.h system
23079 set assert.h i_assert
23082 : see if this is a bfd.h system
23086 : see if this is an execinfo.h system
23087 set execinfo.h i_execinfo
23090 : see if this is a fenv.h system
23094 : see if this is a fp.h system
23098 : see if this is a fp_class.h system
23099 set fp_class.h i_fp_class
23102 : see if gdbm.h is available
23107 : see if gdbm_open exists
23108 set gdbm_open d_gdbm_open
23110 case "$d_gdbm_open" in
23113 echo "We won't be including <gdbm.h>"
23122 : see if this is a ieeefp.h system
23123 case "$i_ieeefp" in
23124 '' ) set ieeefp.h i_ieeefp
23129 : see if this is a libutil.h system
23130 set libutil.h i_libutil
23133 : see if mach cthreads are available
23134 if test "X$usethreads" = "X$define"; then
23135 set mach/cthreads.h i_machcthr
23138 i_machcthr="$undef"
23141 : see if this is a mntent.h system
23142 set mntent.h i_mntent
23145 : see if net/errno.h is available
23147 set net/errno.h val
23150 : Unfortunately, it causes problems on some systems. Arrgh.
23153 cat > try.c <<'EOM'
23156 #include <net/errno.h>
23162 if $cc $ccflags -c try.c >/dev/null 2>&1; then
23163 echo "We'll be including <net/errno.h>." >&4
23165 echo "We won't be including <net/errno.h>." >&4
23174 : see if netinet/tcp.h is available
23175 set netinet/tcp.h i_netinettcp
23178 : see if this is a poll.h system
23182 : see if this is a prot.h system
23186 : Preprocessor symbols
23188 $echo "Guessing which symbols your C compiler and preprocessor define..." >&4
23189 $cat <<'EOSH' > Cppsym.know
23190 a29k aarch64 ABI64 aegis AES_SOURCE AIX AIX32 AIX370 AIX41 AIX42
23191 AIX43 aixpc AIX_SOURCE alliant ALL_SOURCE alpha AM29000 am29000
23192 AMD64 amd64 amiga AMIGAOS AMIX ansi ANSI_C_SOURCE apollo arch_ppc
23193 arch_pwr ardent ARM ARM32 atarist att386 att3b
23194 BeOS BIG_ENDIAN BIT_MSF BSD bsd bsd43 bsd4_2 BSD4_3 bsd4_3 bsd4_4
23195 BSDCOMPAT bsdi BSD_4_3 BSD_4_4 BSD_NET2 BSD_TIME BSD_TYPES bull
23196 byteorder byte_order
23197 c cadmus clang clipper CMU COFF COMPILER_VERSION concurrent
23198 convex cpu CRAY cray CRAYMPP ctix CX_UX CYGWIN
23199 DECC DGUX DGUX_SOURCE DJGPP dmert DOLPHIN DPX2 DSO Dynix DynixPTX
23200 ELF encore EPI EXTENSIONS
23201 FAVOR_BSD FILE_OFFSET_BITS FORTIFY_SOURCE FreeBSD
23202 GCC_NEW_VARARGS gcos gcx gimpel GLIBC GLIBC_MINOR GNUC GNUC_MINOR
23203 GNU_LIBRARY GNU_SOURCE GO32 gould GOULD_PN
23204 H3050R H3050RX hbullx20 hcx host_mips hp200 hp300 HP700 hp700
23205 hp800 hp9000 hp9000s200 hp9000s300 hp9000s400 hp9000s500
23206 hp9000s700 hp9000s800 hp9k8 hppa hpux HPUX_SOURCE hp_osf
23207 i186 i286 i386 i486 i586 i686 i8086 i80960 i860 I960 IA32 IA64
23208 iAPX286 ibm ibm032 ibmesa IBMR2 ibmrt ILP32 ILP64
23209 INLINE_INTRINSICS INT64 INTEL interdata INTRINSICS is68k itanium
23211 LANGUAGE_C LARGEFILE64_SOURCE LARGEFILE_SOURCE LARGE_FILE_API
23212 LFS64_LARGEFILE LFS_LARGEFILE LIBCATAMOUNT Linux LITTLE_ENDIAN
23213 LONG64 LONGDOUBLE LONGLONG LONG_DOUBLE LONG_LONG LP64 luna
23215 M68000 m68k m88100 m88k M88KBCS_TARGET MACH machine MachTen
23216 MATH_HAS_NO_SIDE_EFFECTS mc300 mc500 mc68000 mc68010 mc68020
23217 mc68030 mc68040 mc68060 mc68k mc68k32 mc700 mc88000 mc88100
23218 merlin mert MiNT mips MIPSEB MIPSEL MIPS_FPSET MIPS_ISA MIPS_SIM
23219 MIPS_SZINT MIPS_SZLONG MIPS_SZPTR MODERN_C motorola mpeix MSDOS
23220 MTXINU MULTIMAX MVS mvs M_AMD64 M_ARM M_ARMT M_COFF M_I186 M_I286
23221 M_I386 M_I8086 M_I86 M_I86SM M_IA64 M_IX86 M_PPC M_SYS3 M_SYS5
23222 M_SYSIII M_SYSV M_UNIX M_X86 M_XENIX
23223 n16 ncl_el ncl_mr NetBSD news1500 news1700 news1800 news1900
23224 news3700 news700 news800 news900 NeXT NLS nonstopux ns16000
23225 ns32000 ns32016 ns32332 ns32k nsc32000
23226 OCS88 OEMVS OpenBSD os OS2 OS390 osf OSF1 OSF_SOURCE
23227 PARAGON parisc pa_risc PA_RISC1_1 PA_RISC2_0 pc532 pdp11 PGC PIC
23228 plexus PORTAR posix POSIX1B_SOURCE POSIX2_SOURCE POSIX4_SOURCE
23229 POSIX_C_SOURCE POSIX_SOURCE POWER powerpc ppc PROTOTYPES PWB pyr
23231 R3000 REENTRANT RES Rhapsody RISC6000 riscix riscos RT
23232 S390 S390x SA110 SCO scs sequent sgi SGI_SOURCE SH SH3 sinix
23233 SIZE_INT SIZE_LONG SIZE_PTR SOCKETS_SOURCE SOCKET_SOURCE sony
23234 sonyrisc sony_news sparc sparclite sparcv8 sparcv9 spectrum
23235 stardent stdc STDC_EXT stratos sun sun3 sun386 Sun386i svr3 svr4
23236 SVR4_2 SVR4_SOURCE svr5 SX system SYSTYPE_BSD SYSTYPE_BSD43
23237 SYSTYPE_BSD44 SYSTYPE_SVR4 SYSTYPE_SVR5 SYSTYPE_SYSV SYSV SYSV3
23238 SYSV4 SYSV5 sysV68 sysV88
23239 Tek4132 Tek4300 thumb thw_370 thw_intel thw_rs6000 titan TM3200
23240 TM5400 TM5600 tower tower32 tower32_200 tower32_600 tower32_700
23241 tower32_800 tower32_850 tss
23242 u370 u3b u3b2 u3b20 u3b200 u3b20d u3b5 ultrix UMAXV UnicomPBB
23243 UnicomPBD UNICOS UNICOSMK unix UNIX95 UNIX99 unixpc unos USE_BSD
23244 USE_FILE_OFFSET64 USE_GNU USE_ISOC9X USE_LARGEFILE
23245 USE_LARGEFILE64 USE_MISC USE_POSIX USE_POSIX199309
23246 USE_POSIX199506 USE_POSIX2 USE_REENTRANT USE_SVID USE_UNIX98
23247 USE_XOPEN USE_XOPEN_EXTENDED USGr4 USGr4_2 UTek Utek UTS UWIN
23249 vax venix VMESA vms
23250 x86_64 xenix Xenix286 XOPEN_SOURCE XOPEN_SOURCE_EXTENDED XPG2
23251 XPG2_EXTENDED XPG3 XPG3_EXTENDED XPG4 XPG4_EXTENDED
23254 # Maybe put other stuff here too.
23255 ./tr '-' '_' <<EOSH >>Cppsym.know
23258 ./tr '[a-z]' '[A-Z]' < Cppsym.know > Cppsym.a
23259 ./tr '[A-Z]' '[a-z]' < Cppsym.know > Cppsym.b
23260 $cat Cppsym.know > Cppsym.c
23261 $cat Cppsym.a Cppsym.b Cppsym.c | $tr ' ' $trnl | $sort | $uniq > Cppsym.know
23262 $rm -f Cppsym.a Cppsym.b Cppsym.c
23263 cat <<EOSH > Cppsym
23265 if $test \$# -gt 0; then
23266 echo \$* | $tr " " "$trnl" | ./Cppsym.try > Cppsym.got
23267 if $test -s Cppsym.got; then
23274 $tr " " "$trnl" | ./Cppsym.try
23280 cat <<EOSH > Cppsym.try
23282 cat <<'EOCP' > try.c
23285 #define STRINGIFY(a) "a"
23287 #if cpp_stuff == 42
23288 #define StGiFy(a) #a
23289 #define STRINGIFY(a) StGiFy(a)
23291 #if $cpp_stuff != 1 && $cpp_stuff != 42
23292 # include "Bletch: How does this C preprocessor stringify macros?"
23298 cat <<'EOSH' >> Cppsym.try
23300 printf "#ifdef %s\nprintf(\"%s=%%s\\n\", STRINGIFY(%s));\n#endif\n", $1, $1, $1
23301 printf "#ifdef _%s\nprintf(\"_%s=%%s\\n\", STRINGIFY(_%s));\n#endif\n", $1, $1, $1
23302 printf "#ifdef __%s\nprintf(\"__%s=%%s\\n\", STRINGIFY(__%s));\n#endif\n", $1, $1, $1
23303 printf "#ifdef __%s__\nprintf(\"__%s__=%%s\\n\", STRINGIFY(__%s__));\n#endif\n", $1, $1, $1
23305 echo 'return 0;}' >> try.c
23307 cat <<EOSH >> Cppsym.try
23309 case "$osname-$gccversion" in
23310 irix-) ccflags="\$ccflags -woff 1178" ;;
23311 os2-*) ccflags="\$ccflags -Zlinker /PM:VIO" ;;
23313 $cc -o try -Dcpp_stuff=$cpp_stuff $optimize \$ccflags $ldflags try.c $libs 2>/dev/null && $run ./try | $sed 's/ /\\\\ /g'
23315 chmod +x Cppsym.try
23316 $eunicefix Cppsym.try
23317 ./Cppsym < Cppsym.know | $sort | $uniq > Cppsym.true
23318 : Add in any Linux cpp "predefined macros":
23319 case "$osname::$gccversion" in
23320 *linux*::*.*|*gnukfreebsd*::*.*|gnu::*.*)
23322 rm -f $tHdrH'.h' $tHdrH
23324 # Filter out macro arguments, such as Linux's __INT8_C(c)
23325 if $cpp -dM $tHdrH'.h' > $tHdrH'_cppsym.h' && [ -s $tHdrH'_cppsym.h' ]; then
23326 sed -e 's/#define[\ \ ]*//;s/[\ \ ].*$//' -e 's/(.*//' <$tHdrH'_cppsym.h' >$tHdrH'_cppsym.real'
23327 if [ -s $tHdrH'_cppsym.real' ]; then
23328 cat $tHdrH'_cppsym.real' Cppsym.know | sort | uniq | ./Cppsym | sort | uniq > Cppsym.true
23331 rm -f $tHdrH'.h' $tHdrH'_cppsym.h' $tHdrH'_cppsym.real'
23334 : now check the C compiler for additional symbols
23335 postprocess_cc_v=''
23337 aix) postprocess_cc_v="|$tr , ' '" ;;
23344 for i in \`$cc -v -c tmp.c 2>&1 $postprocess_cc_v\`
23347 -D*) echo "\$i" | $sed 's/^-D//';;
23348 -A*) $test "$gccversion" && echo "\$i" | $sed 's/^-A//' | $sed 's/\(.*\)(\(.*\))/\1=\2/';;
23353 postprocess_cc_v=''
23356 ./ccsym > ccsym1.raw
23357 if $test -s ccsym1.raw; then
23358 $sort ccsym1.raw | $uniq >ccsym.raw
23360 mv ccsym1.raw ccsym.raw
23363 $awk '/\=/ { print $0; next }
23364 { print $0"=1" }' ccsym.raw >ccsym.list
23365 $comm -13 Cppsym.true ccsym.list >ccsym.own
23366 $comm -12 Cppsym.true ccsym.list >ccsym.com
23367 $comm -23 Cppsym.true ccsym.list >ccsym.cpp
23369 if $test -z ccsym.raw; then
23370 echo "Your C compiler doesn't seem to define any symbols!" >&4
23372 echo "However, your C preprocessor defines the following symbols:"
23375 cppsymbols=`$cat Cppsym.true`
23376 cppsymbols=`echo $cppsymbols`
23377 cppccsymbols="$cppsymbols"
23379 if $test -s ccsym.com; then
23380 echo "Your C compiler and pre-processor define these symbols:"
23381 $sed -e 's/\(..*\)=.*/\1/' ccsym.com
23384 cppccsymbols=`$cat ccsym.com`
23385 cppccsymbols=`echo $cppccsymbols`
23386 $test "$silent" || sleep 1
23388 if $test -s ccsym.cpp; then
23389 $test "$also" && echo " "
23390 echo "Your C pre-processor ${also}defines the following symbols:"
23391 $sed -e 's/\(..*\)=.*/\1/' ccsym.cpp
23393 cppsymbols=`$cat ccsym.cpp`
23394 cppsymbols=`echo $cppsymbols`
23395 $test "$silent" || sleep 1
23397 if $test -s ccsym.own; then
23398 $test "$also" && echo " "
23399 echo "Your C compiler ${also}defines the following cpp symbols:"
23400 $sed -e 's/\(..*\)=1/\1/' ccsym.own
23401 $sed -e 's/\(..*\)=.*/\1/' ccsym.own | $uniq >>Cppsym.true
23402 ccsymbols=`$cat ccsym.own`
23403 ccsymbols=`echo $ccsymbols`
23404 $test "$silent" || sleep 1
23408 : add -D_FORTIFY_SOURCE if feasible and not already there
23409 case "$gccversion" in
23410 [45].*) case "$optimize$ccflags" in
23411 *-O*) case "$ccflags$cppsymbols" in
23412 *_FORTIFY_SOURCE=*) # Don't add it again.
23413 echo "You seem to have -D_FORTIFY_SOURCE already, not adding it." >&4
23415 *) echo "Adding -D_FORTIFY_SOURCE=2 to ccflags..." >&4
23416 ccflags="$ccflags -D_FORTIFY_SOURCE=2"
23420 *) echo "You have gcc 4.* or later but not optimizing, not adding -D_FORTIFY_SOURCE." >&4
23424 *) echo "You seem not to have gcc 4.* or later, not adding -D_FORTIFY_SOURCE." >&4
23428 : see if this is a termio system
23432 if $test `./findhdr termios.h`; then
23433 set tcsetattr i_termios
23439 "$define") echo "You have POSIX termios.h... good!" >&4;;
23440 *) if ./Cppsym pyr; then
23441 case "`$run /bin/universe`" in
23442 ucb) if $test `./findhdr sgtty.h`; then
23444 echo "<sgtty.h> found." >&4
23446 echo "System is pyramid with BSD universe."
23447 ./warn "<sgtty.h> not found--you could have problems."
23449 *) if $test `./findhdr termio.h`; then
23451 echo "<termio.h> found." >&4
23453 echo "System is pyramid with USG universe."
23454 ./warn "<termio.h> not found--you could have problems."
23458 if $test `./findhdr termio.h`; then
23459 echo "<termio.h> found." >&4
23461 elif $test `./findhdr sgtty.h`; then
23462 echo "<sgtty.h> found." >&4
23465 ./warn "Neither <termio.h> nor <sgtty.h> found--cross fingers!"
23468 if $test `./findhdr sgtty.h`; then
23469 echo "<sgtty.h> found." >&4
23471 elif $test `./findhdr termio.h`; then
23472 echo "<termio.h> found." >&4
23475 ./warn "Neither <sgtty.h> nor <termio.h> found--cross fingers!"
23479 set i_termio; eval $setvar
23480 val=$val2; set i_sgtty; eval $setvar
23481 val=$val3; set i_termios; eval $setvar
23483 : see if stdbool is available
23484 : we want a real compile instead of Inhdr because some Solaris systems
23485 : have stdbool.h, but it can only be used if the compiler indicates it
23486 : is sufficiently c99-compliant.
23490 #include <stdbool.h>
23495 int main(int argc, char **argv)
23501 if eval $compile; then
23502 echo "<stdbool.h> found." >&4
23505 echo "<stdbool.h> NOT found." >&4
23512 : see if stddef is available
23513 set stddef.h i_stddef
23516 : see if stdint is available
23517 set stdint.h i_stdint
23520 : see if sys/access.h is available
23521 set sys/access.h i_sysaccess
23524 : see if ioctl defs are in sgtty, termio, sys/filio or sys/ioctl
23525 set sys/filio.h i_sysfilio
23528 if $test `./findhdr sys/ioctl.h`; then
23530 echo '<sys/ioctl.h> found.' >&4
23533 if $test $i_sysfilio = "$define"; then
23534 echo '<sys/ioctl.h> NOT found.' >&4
23536 $test $i_sgtty = "$define" && xxx="sgtty.h"
23537 $test $i_termio = "$define" && xxx="termio.h"
23538 $test $i_termios = "$define" && xxx="termios.h"
23539 echo "No <sys/ioctl.h> found, assuming ioctl args are defined in <$xxx>." >&4
23545 : see if socket ioctl defs are in sys/sockio.h
23547 xxx=`./findhdr sys/sockio.h`
23548 if $test "$xxx"; then
23549 if $contains SIOCATMARK $xxx >/dev/null 2>&1; then
23551 echo "You have socket ioctls defined in <sys/sockio.h>." >&4
23554 echo "No socket ioctls found in <sys/sockio.h>." >&4
23559 <sys/sockio.h> not found, assuming socket ioctls are in <sys/ioctl.h>.
23565 : see if this is a syslog.h system
23566 set syslog.h i_syslog
23569 : see if this is a sys/mode.h system
23570 set sys/mode.h i_sysmode
23573 : see if there is a sys/poll.h file
23574 set sys/poll.h i_syspoll
23577 : see if sys/resource.h has to be included
23578 set sys/resource.h i_sysresrc
23581 : see if sys/security.h is available
23582 set sys/security.h i_syssecrt
23585 : see if this is a sys/statvfs.h system
23586 set sys/statvfs.h i_sysstatvfs
23589 : see if this is a sys/un.h system
23590 set sys/un.h i_sysun
23593 : see if this is a sys/utsname.h system
23594 set sys/utsname.h i_sysutsname
23597 : see if this is a syswait system
23598 set sys/wait.h i_syswait
23601 : see if this is a ustat.h system
23602 set ustat.h i_ustat
23605 : see if this is an utime system
23606 set utime.h i_utime
23609 : see if this is a vfork system
23612 set vfork.h i_vfork
23622 echo "Looking for extensions..." >&4
23623 : If we are using the old config.sh, nonxs_extensions and xs_extensions may
23624 : contain old or inaccurate or duplicate values.
23625 nonxs_extensions=''
23627 : We do not use find because it might not be available.
23628 : We do not just use MANIFEST because the user may have dropped
23629 : some additional extensions into the source tree and expect them
23632 : Function to recursively find available extensions, ignoring DynaLoader
23633 : NOTE: recursion limit of 10 to prevent runaway in case of symlink madness
23634 : In 5.10.1 and later, extensions are stored in directories
23635 : like File-Glob instead of the older File/Glob/.
23639 DynaLoader|dynaload) ;;
23641 this_ext=`echo "$xxx" | $sed -e s/-/\\\//g`;
23642 case "$this_ext" in
23643 Scalar/List/Utils) this_ext="List/Util" ;;
23644 PathTools) this_ext="Cwd" ;;
23646 echo " $xs_extensions $nonxs_extensions" > "$tdir/$$.tmp";
23647 if $contains " $this_ext " "$tdir/$$.tmp"; then
23649 echo "Duplicate directories detected for extension $xxx" >&4;
23650 echo "Configure cannot correctly recover from this - shall I abort?" >&4;
23651 case "$knowitall" in
23659 echo "Ok. Stopping Configure." >&4;
23660 echo "Please remove the duplicate directory (e.g. using git clean) and then re-run Configure" >&4;
23663 echo "Ok. You will need to correct config.sh before running make." >&4;
23665 $ls -1 "$xxx" > "$tdir/$$.tmp";
23666 if $contains "\.xs$" "$tdir/$$.tmp" > /dev/null 2>&1; then
23667 xs_extensions="$xs_extensions $this_ext";
23668 elif $contains "\.c$" "$tdir/$$.tmp" > /dev/null 2>&1; then
23669 xs_extensions="$xs_extensions $this_ext";
23670 elif $test -d "$xxx"; then
23671 nonxs_extensions="$nonxs_extensions $this_ext";
23673 $rm -f "$tdir/$$.tmp";
23681 eval $find_extensions
23685 eval $find_extensions
23689 eval $find_extensions
23690 set X $xs_extensions
23692 xs_extensions=`echo "$*" | tr ' ' $trnl | $sort | tr $trnl ' '`
23693 set X $nonxs_extensions
23695 nonxs_extensions=`echo "$*" | tr ' ' $trnl | $sort | tr $trnl ' '`
23697 known_extensions=`echo $nonxs_extensions $xs_extensions | tr ' ' $trnl | $sort | tr $trnl ' '`
23699 : Now see which are supported on this system.
23701 for xxx in $xs_extensions ; do
23705 amigaos) avail_ext="$avail_ext $xxx" ;;
23710 $define) avail_ext="$avail_ext $xxx" ;;
23713 GDBM_File|gdbm_fil)
23715 $define) avail_ext="$avail_ext $xxx" ;;
23718 I18N/Langinfo|i18n_lan)
23719 case "$i_langinfo$d_nl_langinfo" in
23720 $define$define) avail_ext="$avail_ext $xxx" ;;
23724 : XXX Do we need a useipcsysv variable here
23725 case "${d_msg}${d_sem}${d_shm}" in
23726 *"${define}"*) avail_ext="$avail_ext $xxx" ;;
23729 NDBM_File|ndbm_fil)
23732 case "$osname-$use64bitint" in
23735 *-lndbm*) avail_ext="$avail_ext $xxx" ;;
23738 *) avail_ext="$avail_ext $xxx" ;;
23743 ODBM_File|odbm_fil)
23744 case "${i_dbm}${i_rpcsvcdbm}" in
23746 case "$d_cplusplus" in
23747 define) ;; # delete as a function name will not work
23748 *) case "$osname-$use64bitint" in
23751 *-ldbm*) avail_ext="$avail_ext $xxx" ;;
23754 *) avail_ext="$avail_ext $xxx" ;;
23762 case "$useopcode" in
23763 true|define|y) avail_ext="$avail_ext $xxx" ;;
23767 case "$useposix" in
23768 true|define|y) avail_ext="$avail_ext $xxx" ;;
23772 case "$d_socket" in
23773 true|$define|y) avail_ext="$avail_ext $xxx" ;;
23776 Sys/Syslog|sys/syslog)
23778 amigaos) ;; # not really very useful on AmigaOS
23780 : XXX syslog requires socket
23781 case "$d_socket" in
23782 true|$define|y) avail_ext="$avail_ext $xxx" ;;
23788 case "$usethreads" in
23790 case "$use5005threads" in
23791 $define|true|[yY]*) avail_ext="$avail_ext $xxx" ;;
23795 threads|threads/shared)
23796 # threads and threads::shared are special cases.
23797 # To stop people from asking "Perl 5.8.0 was supposed
23798 # to have this new fancy threads implementation but my
23799 # perl doesn't have it" and from people trying to
23800 # (re)install the threads module using CPAN.pm and
23801 # CPAN.pm then offering to reinstall Perl 5.8.0,
23802 # the threads.pm and threads/shared.pm will always be
23803 # there, croaking informatively ("you need to rebuild
23804 # all of Perl with threads, sorry") when threads haven't
23805 # been compiled in.
23807 avail_ext="$avail_ext $xxx"
23813 cygwin) avail_ext="$avail_ext $xxx" ;;
23816 XS/APItest|xs/apitest)
23817 # This is just for testing. Skip it unless we have dynamic loading.
23820 $define) avail_ext="$avail_ext $xxx" ;;
23823 XS/Typemap|xs/typemap)
23824 # This is just for testing. Skip it unless we have dynamic loading.
23826 $define) avail_ext="$avail_ext $xxx" ;;
23829 *) avail_ext="$avail_ext $xxx"
23838 case "$onlyextensions" in
23840 *) keepextensions=''
23841 echo "You have requested that only certain extensions be included..." >&4
23842 for i in $onlyextensions; do
23843 case " $avail_ext " in
23845 echo "Keeping extension $i."
23846 keepextensions="$keepextensions $i"
23848 *) echo "Ignoring extension $i." ;;
23851 avail_ext="$keepextensions"
23855 case "$noextensions" in
23857 *) keepextensions=''
23858 echo "You have requested that certain extensions be ignored..." >&4
23859 for i in $avail_ext; do
23860 case " $noextensions " in
23861 *" $i "*) echo "Ignoring extension $i." ;;
23862 *) echo "Keeping extension $i.";
23863 keepextensions="$keepextensions $i"
23867 avail_ext="$keepextensions"
23871 : Now see which nonxs extensions are supported on this system.
23872 : For now assume all are.
23874 for xxx in $nonxs_extensions ; do
23878 *) nonxs_ext="$nonxs_ext $xxx"
23890 A number of extensions are supplied with $package. You may choose to
23891 compile these extensions for dynamic loading (the default), compile
23892 them into the $package executable (static loading), or not include
23893 them at all. Answer "none" to include no extensions.
23894 Note that DynaLoader is always built and need not be mentioned here.
23897 case "$dynamic_ext" in
23899 : Exclude those listed in static_ext
23901 for xxx in $avail_ext; do
23902 case " $static_ext " in
23904 *) dflt="$dflt $xxx" ;;
23911 *) dflt="$dynamic_ext"
23912 # Perhaps we are reusing an old out-of-date config.sh.
23915 if test X"$dynamic_ext" != X"$avail_ext"; then
23917 NOTICE: Your previous config.sh list may be incorrect.
23918 The extensions now available to you are
23920 but the default list from your previous config.sh is
23932 rp="What extensions do you wish to load dynamically?"
23935 none) dynamic_ext=' ' ;;
23936 *) dynamic_ext="$ans" ;;
23939 case "$static_ext" in
23941 : Exclude those already listed in dynamic linking
23943 for xxx in $avail_ext; do
23944 case " $dynamic_ext " in
23946 *) dflt="$dflt $xxx" ;;
23953 *) dflt="$static_ext"
23960 rp="What extensions do you wish to load statically?"
23963 none) static_ext=' ' ;;
23964 *) static_ext="$ans" ;;
23969 A number of extensions are supplied with $package. Answer "none"
23970 to include no extensions.
23971 Note that DynaLoader is always built and need not be mentioned here.
23974 case "$static_ext" in
23975 '') dflt="$avail_ext" ;;
23976 *) dflt="$static_ext"
23977 # Perhaps we are reusing an old out-of-date config.sh.
23980 if test X"$static_ext" != X"$avail_ext"; then
23982 NOTICE: Your previous config.sh list may be incorrect.
23983 The extensions now available to you are
23985 but the default list from your previous config.sh is
23994 : Exclude those that are not xs extensions
23998 rp="What extensions do you wish to include?"
24001 none) static_ext=' ' ;;
24002 *) static_ext="$ans" ;;
24007 # Encode is a special case. If we are building Encode as a static
24008 # extension, we need to explicitly list its subextensions as well.
24009 # For other nested extensions, this is handled automatically by
24010 # the appropriate Makefile.PL.
24011 case " $static_ext " in
24012 *" Encode "*) # Add the subextensions of Encode
24014 for xxx in `ls Encode/*/Makefile.PL|awk -F/ '{print $2}'`; do
24015 static_ext="$static_ext Encode/$xxx"
24016 known_extensions="$known_extensions Encode/$xxx"
24022 set X $dynamic_ext $static_ext $nonxs_ext
24026 # Sanity check: We require an extension suitable for use with
24027 # AnyDBM_File, as well as Fcntl and IO. (Failure to have these
24028 # should show up as failures in the test suite, but it's helpful to
24029 # catch them now.) The 'extensions' list is normally sorted
24030 # alphabetically, so we need to accept either
24031 # DB_File ... Fcntl ... IO ....
24032 # or something like
24033 # Fcntl ... NDBM_File ... IO ....
24034 case " $extensions" in
24035 *"_File "*" Fcntl "*" IO "*) ;; # DB_File
24036 *" Fcntl "*"_File "*" IO "*) ;; # GDBM_File
24037 *" Fcntl "*" IO "*"_File "*) ;; # NDBM_File
24038 *) echo "WARNING: Extensions DB_File or *DBM_File, Fcntl, and IO not configured." >&4
24039 echo "WARNING: The Perl you are building will be quite crippled." >& 4
24043 : Remove libraries needed only for extensions
24044 : The appropriate ext/Foo/Makefile.PL will add them back in, if necessary.
24045 : The exception is SunOS 4.x, which needs them.
24046 case "${osname}X${osvers}" in
24050 *) case "$usedl" in
24051 $define|true|[yY]*)
24052 set X `echo " $libs " | sed -e 's@ -lndbm @ @' -e 's@ -lgdbm @ @' -e 's@ -lgdbm_compat @ @' -e 's@ -ldbm @ @' -e 's@ -ldb @ @'`
24056 *) perllibs="$libs"
24062 : Remove build directory name from cppstdin so it can be used from
24063 : either the present location or the final installed location.
24065 : Get out of the UU directory to get correct path name.
24067 case "$cppstdin" in
24069 echo "Stripping down cppstdin path name"
24075 : end of configuration questions
24077 echo "End of configuration questions."
24080 : back to where it started
24081 if test -d ../UU; then
24085 : configuration may be unconditionally patched via a 'config.arch' file
24086 if $test -f config.arch; then
24087 echo "I see a config.arch file, loading it." >&4
24091 : configuration may be patched via a 'config.over' file
24092 if $test -f config.over; then
24095 rp='I see a config.over file. Do you wish to load it?'
24098 n*) echo "OK, I'll ignore it.";;
24100 echo "Configuration override changes have been loaded."
24105 : in case they want portability, strip down executable paths
24106 case "$d_portable" in
24109 echo "Stripping down executable paths..." >&4
24110 for file in $loclist $trylist; do
24112 eval $file=`basename $temp`
24117 : create config.sh file
24119 echo "Creating config.sh..." >&4
24120 $spitshell <<EOT >config.sh
24123 # This file was produced by running the Configure script. It holds all the
24124 # definitions figured out by Configure. Should you modify one of these values,
24125 # do not forget to propagate your changes by running "Configure -der". You may
24126 # instead choose to run each of the .SH files by yourself, or "Configure -S".
24129 # Package name : $package
24130 # Source directory : $src
24131 # Configuration time: $cf_time
24132 # Configured by : $cf_by
24133 # Target system : $myuname
24136 : Add in command line options if available
24137 $test -f UU/cmdline.opt && $cat UU/cmdline.opt >> config.sh
24139 $spitshell <<EOT >>config.sh
24148 Revision='$Revision'
24156 alignbytes='$alignbytes'
24157 ansi2knr='$ansi2knr'
24158 aphostname='$aphostname'
24159 api_revision='$api_revision'
24160 api_subversion='$api_subversion'
24161 api_version='$api_version'
24162 api_versionstring='$api_versionstring'
24165 archlibexp='$archlibexp'
24166 archname64='$archname64'
24167 archname='$archname'
24168 archobjs='$archobjs'
24169 asctime_r_proto='$asctime_r_proto'
24178 byteorder='$byteorder'
24180 castflags='$castflags'
24183 cccdlflags='$cccdlflags'
24184 ccdlflags='$ccdlflags'
24186 ccflags_uselargefiles='$ccflags_uselargefiles'
24188 ccsymbols='$ccsymbols'
24189 ccversion='$ccversion'
24191 cf_email='$cf_email'
24193 charbits='$charbits'
24194 charsize='$charsize'
24198 clocktype='$clocktype'
24200 compress='$compress'
24201 contains='$contains'
24205 cpp_stuff='$cpp_stuff'
24206 cppccsymbols='$cppccsymbols'
24207 cppflags='$cppflags'
24209 cppminus='$cppminus'
24211 cppstdin='$cppstdin'
24212 cppsymbols='$cppsymbols'
24213 crypt_r_proto='$crypt_r_proto'
24214 cryptlib='$cryptlib'
24216 ctermid_r_proto='$ctermid_r_proto'
24217 ctime_r_proto='$ctime_r_proto'
24218 d_Gconvert='$d_Gconvert'
24219 d_PRIEUldbl='$d_PRIEUldbl'
24220 d_PRIFUldbl='$d_PRIFUldbl'
24221 d_PRIGUldbl='$d_PRIGUldbl'
24222 d_PRIXU64='$d_PRIXU64'
24223 d_PRId64='$d_PRId64'
24224 d_PRIeldbl='$d_PRIeldbl'
24225 d_PRIfldbl='$d_PRIfldbl'
24226 d_PRIgldbl='$d_PRIgldbl'
24227 d_PRIi64='$d_PRIi64'
24228 d_PRIo64='$d_PRIo64'
24229 d_PRIu64='$d_PRIu64'
24230 d_PRIx64='$d_PRIx64'
24231 d_SCNfldbl='$d_SCNfldbl'
24232 d__fwalk='$d__fwalk'
24233 d_access='$d_access'
24234 d_accessx='$d_accessx'
24238 d_archlib='$d_archlib'
24239 d_asctime64='$d_asctime64'
24240 d_asctime_r='$d_asctime_r'
24245 d_attribute_deprecated='$d_attribute_deprecated'
24246 d_attribute_format='$d_attribute_format'
24247 d_attribute_malloc='$d_attribute_malloc'
24248 d_attribute_nonnull='$d_attribute_nonnull'
24249 d_attribute_noreturn='$d_attribute_noreturn'
24250 d_attribute_pure='$d_attribute_pure'
24251 d_attribute_unused='$d_attribute_unused'
24252 d_attribute_warn_unused_result='$d_attribute_warn_unused_result'
24253 d_backtrace='$d_backtrace'
24257 d_bsdgetpgrp='$d_bsdgetpgrp'
24258 d_bsdsetpgrp='$d_bsdsetpgrp'
24259 d_builtin_choose_expr='$d_builtin_choose_expr'
24260 d_builtin_expect='$d_builtin_expect'
24262 d_c99_variadic_macros='$d_c99_variadic_macros'
24263 d_casti32='$d_casti32'
24264 d_castneg='$d_castneg'
24266 d_charvspr='$d_charvspr'
24268 d_chroot='$d_chroot'
24269 d_chsize='$d_chsize'
24271 d_clearenv='$d_clearenv'
24272 d_closedir='$d_closedir'
24273 d_cmsghdr_s='$d_cmsghdr_s'
24275 d_copysign='$d_copysign'
24276 d_copysignl='$d_copysignl'
24277 d_cplusplus='$d_cplusplus'
24279 d_crypt_r='$d_crypt_r'
24281 d_ctermid='$d_ctermid'
24282 d_ctermid_r='$d_ctermid_r'
24283 d_ctime64='$d_ctime64'
24284 d_ctime_r='$d_ctime_r'
24285 d_cuserid='$d_cuserid'
24286 d_dbl_dig='$d_dbl_dig'
24287 d_dbminitproto='$d_dbminitproto'
24288 d_difftime64='$d_difftime64'
24289 d_difftime='$d_difftime'
24290 d_dir_dd_fd='$d_dir_dd_fd'
24292 d_dirnamlen='$d_dirnamlen'
24293 d_dladdr='$d_dladdr'
24294 d_dlerror='$d_dlerror'
24295 d_dlopen='$d_dlopen'
24296 d_dlsymun='$d_dlsymun'
24297 d_dosuid='$d_dosuid'
24298 d_drand48_r='$d_drand48_r'
24299 d_drand48proto='$d_drand48proto'
24301 d_duplocale='$d_duplocale'
24302 d_eaccess='$d_eaccess'
24303 d_endgrent='$d_endgrent'
24304 d_endgrent_r='$d_endgrent_r'
24305 d_endhent='$d_endhent'
24306 d_endhostent_r='$d_endhostent_r'
24307 d_endnent='$d_endnent'
24308 d_endnetent_r='$d_endnetent_r'
24309 d_endpent='$d_endpent'
24310 d_endprotoent_r='$d_endprotoent_r'
24311 d_endpwent='$d_endpwent'
24312 d_endpwent_r='$d_endpwent_r'
24313 d_endsent='$d_endsent'
24314 d_endservent_r='$d_endservent_r'
24315 d_eofnblk='$d_eofnblk'
24318 d_eunice='$d_eunice'
24321 d_faststdio='$d_faststdio'
24322 d_fchdir='$d_fchdir'
24323 d_fchmod='$d_fchmod'
24324 d_fchown='$d_fchown'
24326 d_fcntl_can_lock='$d_fcntl_can_lock'
24327 d_fd_macros='$d_fd_macros'
24328 d_fd_set='$d_fd_set'
24329 d_fdclose='$d_fdclose'
24331 d_fds_bits='$d_fds_bits'
24332 d_fegetround='$d_fegetround'
24333 d_fgetpos='$d_fgetpos'
24334 d_finite='$d_finite'
24335 d_finitel='$d_finitel'
24336 d_flexfnam='$d_flexfnam'
24338 d_flockproto='$d_flockproto'
24343 d_fp_class='$d_fp_class'
24344 d_fp_classify='$d_fp_classify'
24345 d_fp_classl='$d_fp_classl'
24346 d_fpathconf='$d_fpathconf'
24347 d_fpclass='$d_fpclass'
24348 d_fpclassify='$d_fpclassify'
24349 d_fpclassl='$d_fpclassl'
24350 d_fpgetround='$d_fpgetround'
24351 d_fpos64_t='$d_fpos64_t'
24352 d_freelocale='$d_freelocale'
24353 d_frexpl='$d_frexpl'
24354 d_fs_data_s='$d_fs_data_s'
24355 d_fseeko='$d_fseeko'
24356 d_fsetpos='$d_fsetpos'
24357 d_fstatfs='$d_fstatfs'
24358 d_fstatvfs='$d_fstatvfs'
24360 d_ftello='$d_ftello'
24362 d_futimes='$d_futimes'
24363 d_gdbm_ndbm_h_uses_prototypes='$d_gdbm_ndbm_h_uses_prototypes'
24364 d_gdbmndbm_h_uses_prototypes='$d_gdbmndbm_h_uses_prototypes'
24365 d_getaddrinfo='$d_getaddrinfo'
24366 d_getcwd='$d_getcwd'
24367 d_getespwnam='$d_getespwnam'
24368 d_getfsstat='$d_getfsstat'
24369 d_getgrent='$d_getgrent'
24370 d_getgrent_r='$d_getgrent_r'
24371 d_getgrgid_r='$d_getgrgid_r'
24372 d_getgrnam_r='$d_getgrnam_r'
24373 d_getgrps='$d_getgrps'
24374 d_gethbyaddr='$d_gethbyaddr'
24375 d_gethbyname='$d_gethbyname'
24376 d_gethent='$d_gethent'
24377 d_gethname='$d_gethname'
24378 d_gethostbyaddr_r='$d_gethostbyaddr_r'
24379 d_gethostbyname_r='$d_gethostbyname_r'
24380 d_gethostent_r='$d_gethostent_r'
24381 d_gethostprotos='$d_gethostprotos'
24382 d_getitimer='$d_getitimer'
24383 d_getlogin='$d_getlogin'
24384 d_getlogin_r='$d_getlogin_r'
24385 d_getmnt='$d_getmnt'
24386 d_getmntent='$d_getmntent'
24387 d_getnameinfo='$d_getnameinfo'
24388 d_getnbyaddr='$d_getnbyaddr'
24389 d_getnbyname='$d_getnbyname'
24390 d_getnent='$d_getnent'
24391 d_getnetbyaddr_r='$d_getnetbyaddr_r'
24392 d_getnetbyname_r='$d_getnetbyname_r'
24393 d_getnetent_r='$d_getnetent_r'
24394 d_getnetprotos='$d_getnetprotos'
24395 d_getpagsz='$d_getpagsz'
24396 d_getpbyname='$d_getpbyname'
24397 d_getpbynumber='$d_getpbynumber'
24398 d_getpent='$d_getpent'
24399 d_getpgid='$d_getpgid'
24400 d_getpgrp2='$d_getpgrp2'
24401 d_getpgrp='$d_getpgrp'
24402 d_getppid='$d_getppid'
24403 d_getprior='$d_getprior'
24404 d_getprotobyname_r='$d_getprotobyname_r'
24405 d_getprotobynumber_r='$d_getprotobynumber_r'
24406 d_getprotoent_r='$d_getprotoent_r'
24407 d_getprotoprotos='$d_getprotoprotos'
24408 d_getprpwnam='$d_getprpwnam'
24409 d_getpwent='$d_getpwent'
24410 d_getpwent_r='$d_getpwent_r'
24411 d_getpwnam_r='$d_getpwnam_r'
24412 d_getpwuid_r='$d_getpwuid_r'
24413 d_getsbyname='$d_getsbyname'
24414 d_getsbyport='$d_getsbyport'
24415 d_getsent='$d_getsent'
24416 d_getservbyname_r='$d_getservbyname_r'
24417 d_getservbyport_r='$d_getservbyport_r'
24418 d_getservent_r='$d_getservent_r'
24419 d_getservprotos='$d_getservprotos'
24420 d_getspnam='$d_getspnam'
24421 d_getspnam_r='$d_getspnam_r'
24422 d_gettimeod='$d_gettimeod'
24423 d_gmtime64='$d_gmtime64'
24424 d_gmtime_r='$d_gmtime_r'
24425 d_gnulibc='$d_gnulibc'
24426 d_grpasswd='$d_grpasswd'
24427 d_hasmntopt='$d_hasmntopt'
24431 d_ilogbl='$d_ilogbl'
24432 d_inc_version_list='$d_inc_version_list'
24434 d_inetaton='$d_inetaton'
24435 d_inetntop='$d_inetntop'
24436 d_inetpton='$d_inetpton'
24437 d_int64_t='$d_int64_t'
24438 d_ip_mreq='$d_ip_mreq'
24439 d_ip_mreq_source='$d_ip_mreq_source'
24440 d_ipv6_mreq='$d_ipv6_mreq'
24441 d_ipv6_mreq_source='$d_ipv6_mreq_source'
24442 d_isascii='$d_isascii'
24443 d_isblank='$d_isblank'
24444 d_isfinite='$d_isfinite'
24445 d_isfinitel='$d_isfinitel'
24447 d_isinfl='$d_isinfl'
24448 d_isless='$d_isless'
24450 d_isnanl='$d_isnanl'
24451 d_isnormal='$d_isnormal'
24454 d_killpg='$d_killpg'
24455 d_lc_monetary_2008='$d_lc_monetary_2008'
24456 d_lchown='$d_lchown'
24457 d_ldbl_dig='$d_ldbl_dig'
24458 d_ldexpl='$d_ldexpl'
24459 d_lgamma='$d_lgamma'
24460 d_lgamma_r='$d_lgamma_r'
24461 d_libm_lib_version='$d_libm_lib_version'
24462 d_libname_unique='$d_libname_unique'
24464 d_llrint='$d_llrint'
24465 d_llrintl='$d_llrintl'
24466 d_llround='$d_llround'
24467 d_llroundl='$d_llroundl'
24468 d_localtime64='$d_localtime64'
24469 d_localtime_r='$d_localtime_r'
24470 d_localtime_r_needs_tzset='$d_localtime_r_needs_tzset'
24471 d_locconv='$d_locconv'
24476 d_longdbl='$d_longdbl'
24477 d_longlong='$d_longlong'
24479 d_lrintl='$d_lrintl'
24480 d_lround='$d_lround'
24481 d_lroundl='$d_lroundl'
24482 d_lseekproto='$d_lseekproto'
24484 d_madvise='$d_madvise'
24485 d_malloc_good_size='$d_malloc_good_size'
24486 d_malloc_size='$d_malloc_size'
24488 d_mbstowcs='$d_mbstowcs'
24489 d_mbtowc='$d_mbtowc'
24490 d_memchr='$d_memchr'
24491 d_memcmp='$d_memcmp'
24492 d_memcpy='$d_memcpy'
24493 d_memmem='$d_memmem'
24494 d_memmove='$d_memmove'
24495 d_memset='$d_memset'
24497 d_mkdtemp='$d_mkdtemp'
24498 d_mkfifo='$d_mkfifo'
24499 d_mkstemp='$d_mkstemp'
24500 d_mkstemps='$d_mkstemps'
24501 d_mktime64='$d_mktime64'
24502 d_mktime='$d_mktime'
24505 d_modflproto='$d_modflproto'
24506 d_mprotect='$d_mprotect'
24508 d_msg_ctrunc='$d_msg_ctrunc'
24509 d_msg_dontroute='$d_msg_dontroute'
24510 d_msg_oob='$d_msg_oob'
24511 d_msg_peek='$d_msg_peek'
24512 d_msg_proxy='$d_msg_proxy'
24513 d_msgctl='$d_msgctl'
24514 d_msgget='$d_msgget'
24515 d_msghdr_s='$d_msghdr_s'
24516 d_msgrcv='$d_msgrcv'
24517 d_msgsnd='$d_msgsnd'
24519 d_munmap='$d_munmap'
24520 d_mymalloc='$d_mymalloc'
24523 d_ndbm_h_uses_prototypes='$d_ndbm_h_uses_prototypes'
24524 d_nearbyint='$d_nearbyint'
24525 d_newlocale='$d_newlocale'
24526 d_nextafter='$d_nextafter'
24527 d_nexttoward='$d_nexttoward'
24529 d_nl_langinfo='$d_nl_langinfo'
24530 d_nv_preserves_uv='$d_nv_preserves_uv'
24531 d_nv_zero_is_allbits_zero='$d_nv_zero_is_allbits_zero'
24532 d_off64_t='$d_off64_t'
24533 d_old_pthread_create_joinable='$d_old_pthread_create_joinable'
24534 d_oldpthreads='$d_oldpthreads'
24535 d_oldsock='$d_oldsock'
24537 d_pathconf='$d_pathconf'
24539 d_perl_otherlibdirs='$d_perl_otherlibdirs'
24540 d_phostname='$d_phostname'
24543 d_portable='$d_portable'
24545 d_prctl_set_name='$d_prctl_set_name'
24546 d_printf_format_null='$d_printf_format_null'
24547 d_procselfexe='$d_procselfexe'
24548 d_pseudofork='$d_pseudofork'
24549 d_pthread_atfork='$d_pthread_atfork'
24550 d_pthread_attr_setscope='$d_pthread_attr_setscope'
24551 d_pthread_yield='$d_pthread_yield'
24552 d_ptrdiff_t='$d_ptrdiff_t'
24554 d_pwchange='$d_pwchange'
24555 d_pwclass='$d_pwclass'
24556 d_pwcomment='$d_pwcomment'
24557 d_pwexpire='$d_pwexpire'
24558 d_pwgecos='$d_pwgecos'
24559 d_pwpasswd='$d_pwpasswd'
24560 d_pwquota='$d_pwquota'
24563 d_querylocale='$d_querylocale'
24564 d_random_r='$d_random_r'
24565 d_re_comp='$d_re_comp'
24566 d_readdir64_r='$d_readdir64_r'
24567 d_readdir='$d_readdir'
24568 d_readdir_r='$d_readdir_r'
24569 d_readlink='$d_readlink'
24571 d_recvmsg='$d_recvmsg'
24572 d_regcmp='$d_regcmp'
24573 d_regcomp='$d_regcomp'
24574 d_remainder='$d_remainder'
24575 d_remquo='$d_remquo'
24576 d_rename='$d_rename'
24577 d_rewinddir='$d_rewinddir'
24581 d_safebcpy='$d_safebcpy'
24582 d_safemcpy='$d_safemcpy'
24583 d_sanemcmp='$d_sanemcmp'
24584 d_sbrkproto='$d_sbrkproto'
24585 d_scalbn='$d_scalbn'
24586 d_scalbnl='$d_scalbnl'
24587 d_sched_yield='$d_sched_yield'
24588 d_scm_rights='$d_scm_rights'
24589 d_seekdir='$d_seekdir'
24590 d_select='$d_select'
24592 d_semctl='$d_semctl'
24593 d_semctl_semid_ds='$d_semctl_semid_ds'
24594 d_semctl_semun='$d_semctl_semun'
24595 d_semget='$d_semget'
24597 d_sendmsg='$d_sendmsg'
24598 d_setegid='$d_setegid'
24599 d_seteuid='$d_seteuid'
24600 d_setgrent='$d_setgrent'
24601 d_setgrent_r='$d_setgrent_r'
24602 d_setgrps='$d_setgrps'
24603 d_sethent='$d_sethent'
24604 d_sethostent_r='$d_sethostent_r'
24605 d_setitimer='$d_setitimer'
24606 d_setlinebuf='$d_setlinebuf'
24607 d_setlocale='$d_setlocale'
24608 d_setlocale_r='$d_setlocale_r'
24609 d_setnent='$d_setnent'
24610 d_setnetent_r='$d_setnetent_r'
24611 d_setpent='$d_setpent'
24612 d_setpgid='$d_setpgid'
24613 d_setpgrp2='$d_setpgrp2'
24614 d_setpgrp='$d_setpgrp'
24615 d_setprior='$d_setprior'
24616 d_setproctitle='$d_setproctitle'
24617 d_setprotoent_r='$d_setprotoent_r'
24618 d_setpwent='$d_setpwent'
24619 d_setpwent_r='$d_setpwent_r'
24620 d_setregid='$d_setregid'
24621 d_setresgid='$d_setresgid'
24622 d_setresuid='$d_setresuid'
24623 d_setreuid='$d_setreuid'
24624 d_setrgid='$d_setrgid'
24625 d_setruid='$d_setruid'
24626 d_setsent='$d_setsent'
24627 d_setservent_r='$d_setservent_r'
24628 d_setsid='$d_setsid'
24629 d_setvbuf='$d_setvbuf'
24632 d_shmatprototype='$d_shmatprototype'
24633 d_shmctl='$d_shmctl'
24635 d_shmget='$d_shmget'
24636 d_sigaction='$d_sigaction'
24637 d_siginfo_si_addr='$d_siginfo_si_addr'
24638 d_siginfo_si_band='$d_siginfo_si_band'
24639 d_siginfo_si_errno='$d_siginfo_si_errno'
24640 d_siginfo_si_fd='$d_siginfo_si_fd'
24641 d_siginfo_si_pid='$d_siginfo_si_pid'
24642 d_siginfo_si_status='$d_siginfo_si_status'
24643 d_siginfo_si_uid='$d_siginfo_si_uid'
24644 d_siginfo_si_value='$d_siginfo_si_value'
24645 d_signbit='$d_signbit'
24646 d_sigprocmask='$d_sigprocmask'
24647 d_sigsetjmp='$d_sigsetjmp'
24648 d_sin6_scope_id='$d_sin6_scope_id'
24649 d_sitearch='$d_sitearch'
24650 d_snprintf='$d_snprintf'
24651 d_sockaddr_in6='$d_sockaddr_in6'
24652 d_sockaddr_sa_len='$d_sockaddr_sa_len'
24653 d_sockatmark='$d_sockatmark'
24654 d_sockatmarkproto='$d_sockatmarkproto'
24655 d_socket='$d_socket'
24656 d_socklen_t='$d_socklen_t'
24657 d_sockpair='$d_sockpair'
24658 d_socks5_init='$d_socks5_init'
24659 d_sprintf_returns_strlen='$d_sprintf_returns_strlen'
24661 d_srand48_r='$d_srand48_r'
24662 d_srandom_r='$d_srandom_r'
24663 d_sresgproto='$d_sresgproto'
24664 d_sresuproto='$d_sresuproto'
24666 d_statblks='$d_statblks'
24667 d_statfs_f_flags='$d_statfs_f_flags'
24668 d_statfs_s='$d_statfs_s'
24669 d_static_inline='$d_static_inline'
24670 d_statvfs='$d_statvfs'
24671 d_stdio_cnt_lval='$d_stdio_cnt_lval'
24672 d_stdio_ptr_lval='$d_stdio_ptr_lval'
24673 d_stdio_ptr_lval_nochange_cnt='$d_stdio_ptr_lval_nochange_cnt'
24674 d_stdio_ptr_lval_sets_cnt='$d_stdio_ptr_lval_sets_cnt'
24675 d_stdio_stream_array='$d_stdio_stream_array'
24676 d_stdiobase='$d_stdiobase'
24677 d_stdstdio='$d_stdstdio'
24678 d_strchr='$d_strchr'
24679 d_strcoll='$d_strcoll'
24680 d_strctcpy='$d_strctcpy'
24681 d_strerrm='$d_strerrm'
24682 d_strerror='$d_strerror'
24683 d_strerror_l='$d_strerror_l'
24684 d_strerror_r='$d_strerror_r'
24685 d_strftime='$d_strftime'
24686 d_strlcat='$d_strlcat'
24687 d_strlcpy='$d_strlcpy'
24688 d_strtod='$d_strtod'
24689 d_strtol='$d_strtol'
24690 d_strtold='$d_strtold'
24691 d_strtoll='$d_strtoll'
24692 d_strtoq='$d_strtoq'
24693 d_strtoul='$d_strtoul'
24694 d_strtoull='$d_strtoull'
24695 d_strtouq='$d_strtouq'
24696 d_strxfrm='$d_strxfrm'
24697 d_suidsafe='$d_suidsafe'
24698 d_symlink='$d_symlink'
24699 d_syscall='$d_syscall'
24700 d_syscallproto='$d_syscallproto'
24701 d_sysconf='$d_sysconf'
24702 d_sysernlst='$d_sysernlst'
24703 d_syserrlst='$d_syserrlst'
24704 d_system='$d_system'
24705 d_tcgetpgrp='$d_tcgetpgrp'
24706 d_tcsetpgrp='$d_tcsetpgrp'
24707 d_telldir='$d_telldir'
24708 d_telldirproto='$d_telldirproto'
24709 d_tgamma='$d_tgamma'
24711 d_timegm='$d_timegm'
24713 d_tm_tm_gmtoff='$d_tm_tm_gmtoff'
24714 d_tm_tm_zone='$d_tm_tm_zone'
24715 d_tmpnam_r='$d_tmpnam_r'
24717 d_truncate='$d_truncate'
24718 d_truncl='$d_truncl'
24719 d_ttyname_r='$d_ttyname_r'
24720 d_tzname='$d_tzname'
24721 d_u32align='$d_u32align'
24722 d_ualarm='$d_ualarm'
24725 d_union_semun='$d_union_semun'
24726 d_unordered='$d_unordered'
24727 d_unsetenv='$d_unsetenv'
24728 d_uselocale='$d_uselocale'
24729 d_usleep='$d_usleep'
24730 d_usleepproto='$d_usleepproto'
24732 d_vendorarch='$d_vendorarch'
24733 d_vendorbin='$d_vendorbin'
24734 d_vendorlib='$d_vendorlib'
24735 d_vendorscript='$d_vendorscript'
24737 d_void_closedir='$d_void_closedir'
24738 d_voidsig='$d_voidsig'
24739 d_voidtty='$d_voidtty'
24740 d_volatile='$d_volatile'
24741 d_vprintf='$d_vprintf'
24742 d_vsnprintf='$d_vsnprintf'
24744 d_waitpid='$d_waitpid'
24745 d_wcscmp='$d_wcscmp'
24746 d_wcstombs='$d_wcstombs'
24747 d_wcsxfrm='$d_wcsxfrm'
24748 d_wctomb='$d_wctomb'
24749 d_writev='$d_writev'
24752 db_hashtype='$db_hashtype'
24753 db_prefixtype='$db_prefixtype'
24754 db_version_major='$db_version_major'
24755 db_version_minor='$db_version_minor'
24756 db_version_patch='$db_version_patch'
24757 direntrytype='$direntrytype'
24760 doubleinfbytes='$doubleinfbytes'
24761 doublekind='$doublekind'
24762 doublemantbits='$doublemantbits'
24763 doublenanbytes='$doublenanbytes'
24764 doublesize='$doublesize'
24766 drand48_r_proto='$drand48_r_proto'
24768 dtraceobject='$dtraceobject'
24769 dynamic_ext='$dynamic_ext'
24775 endgrent_r_proto='$endgrent_r_proto'
24776 endhostent_r_proto='$endhostent_r_proto'
24777 endnetent_r_proto='$endnetent_r_proto'
24778 endprotoent_r_proto='$endprotoent_r_proto'
24779 endpwent_r_proto='$endpwent_r_proto'
24780 endservent_r_proto='$endservent_r_proto'
24781 eunicefix='$eunicefix'
24784 extensions='$extensions'
24785 extern_C='$extern_C'
24787 fflushNULL='$fflushNULL'
24788 fflushall='$fflushall'
24790 firstmakefile='$firstmakefile'
24792 fpossize='$fpossize'
24793 fpostype='$fpostype'
24794 freetype='$freetype'
24797 full_csh='$full_csh'
24798 full_sed='$full_sed'
24799 gccansipedantic='$gccansipedantic'
24800 gccosandvers='$gccosandvers'
24801 gccversion='$gccversion'
24802 getgrent_r_proto='$getgrent_r_proto'
24803 getgrgid_r_proto='$getgrgid_r_proto'
24804 getgrnam_r_proto='$getgrnam_r_proto'
24805 gethostbyaddr_r_proto='$gethostbyaddr_r_proto'
24806 gethostbyname_r_proto='$gethostbyname_r_proto'
24807 gethostent_r_proto='$gethostent_r_proto'
24808 getlogin_r_proto='$getlogin_r_proto'
24809 getnetbyaddr_r_proto='$getnetbyaddr_r_proto'
24810 getnetbyname_r_proto='$getnetbyname_r_proto'
24811 getnetent_r_proto='$getnetent_r_proto'
24812 getprotobyname_r_proto='$getprotobyname_r_proto'
24813 getprotobynumber_r_proto='$getprotobynumber_r_proto'
24814 getprotoent_r_proto='$getprotoent_r_proto'
24815 getpwent_r_proto='$getpwent_r_proto'
24816 getpwnam_r_proto='$getpwnam_r_proto'
24817 getpwuid_r_proto='$getpwuid_r_proto'
24818 getservbyname_r_proto='$getservbyname_r_proto'
24819 getservbyport_r_proto='$getservbyport_r_proto'
24820 getservent_r_proto='$getservent_r_proto'
24821 getspnam_r_proto='$getspnam_r_proto'
24822 gidformat='$gidformat'
24828 gmtime_r_proto='$gmtime_r_proto'
24829 gnulibc_version='$gnulibc_version'
24831 groupcat='$groupcat'
24832 groupstype='$groupstype'
24835 h_sysfile='$h_sysfile'
24838 hostgenerate='$hostgenerate'
24839 hostosname='$hostosname'
24840 hostperl='$hostperl'
24841 html1dir='$html1dir'
24842 html1direxp='$html1direxp'
24843 html3dir='$html3dir'
24844 html3direxp='$html3direxp'
24853 i_arpainet='$i_arpainet'
24854 i_assert='$i_assert'
24856 i_bsdioctl='$i_bsdioctl'
24860 i_dirent='$i_dirent'
24862 i_execinfo='$i_execinfo'
24867 i_fp_class='$i_fp_class'
24869 i_gdbm_ndbm='$i_gdbm_ndbm'
24870 i_gdbmndbm='$i_gdbmndbm'
24872 i_ieeefp='$i_ieeefp'
24873 i_inttypes='$i_inttypes'
24874 i_langinfo='$i_langinfo'
24875 i_libutil='$i_libutil'
24876 i_limits='$i_limits'
24877 i_locale='$i_locale'
24878 i_machcthr='$i_machcthr'
24879 i_malloc='$i_malloc'
24880 i_mallocmalloc='$i_mallocmalloc'
24882 i_memory='$i_memory'
24883 i_mntent='$i_mntent'
24886 i_neterrno='$i_neterrno'
24887 i_netinettcp='$i_netinettcp'
24891 i_pthread='$i_pthread'
24893 i_quadmath='$i_quadmath'
24894 i_rpcsvcdbm='$i_rpcsvcdbm'
24896 i_shadow='$i_shadow'
24898 i_stdarg='$i_stdarg'
24899 i_stdbool='$i_stdbool'
24900 i_stddef='$i_stddef'
24901 i_stdint='$i_stdint'
24902 i_stdlib='$i_stdlib'
24903 i_string='$i_string'
24904 i_sunmath='$i_sunmath'
24905 i_sysaccess='$i_sysaccess'
24906 i_sysdir='$i_sysdir'
24907 i_sysfile='$i_sysfile'
24908 i_sysfilio='$i_sysfilio'
24910 i_sysioctl='$i_sysioctl'
24911 i_syslog='$i_syslog'
24912 i_sysmman='$i_sysmman'
24913 i_sysmode='$i_sysmode'
24914 i_sysmount='$i_sysmount'
24915 i_sysndir='$i_sysndir'
24916 i_sysparam='$i_sysparam'
24917 i_syspoll='$i_syspoll'
24918 i_sysresrc='$i_sysresrc'
24919 i_syssecrt='$i_syssecrt'
24920 i_sysselct='$i_sysselct'
24921 i_syssockio='$i_syssockio'
24922 i_sysstat='$i_sysstat'
24923 i_sysstatfs='$i_sysstatfs'
24924 i_sysstatvfs='$i_sysstatvfs'
24925 i_systime='$i_systime'
24926 i_systimek='$i_systimek'
24927 i_systimes='$i_systimes'
24928 i_systypes='$i_systypes'
24929 i_sysuio='$i_sysuio'
24931 i_sysutsname='$i_sysutsname'
24932 i_sysvfs='$i_sysvfs'
24933 i_syswait='$i_syswait'
24934 i_termio='$i_termio'
24935 i_termios='$i_termios'
24937 i_unistd='$i_unistd'
24940 i_values='$i_values'
24941 i_varargs='$i_varargs'
24942 i_varhdr='$i_varhdr'
24944 i_xlocale='$i_xlocale'
24945 ignore_versioned_solibs='$ignore_versioned_solibs'
24946 inc_version_list='$inc_version_list'
24947 inc_version_list_init='$inc_version_list_init'
24951 initialinstalllocation='$initialinstalllocation'
24952 installarchlib='$installarchlib'
24953 installbin='$installbin'
24954 installhtml1dir='$installhtml1dir'
24955 installhtml3dir='$installhtml3dir'
24956 installman1dir='$installman1dir'
24957 installman3dir='$installman3dir'
24958 installprefix='$installprefix'
24959 installprefixexp='$installprefixexp'
24960 installprivlib='$installprivlib'
24961 installscript='$installscript'
24962 installsitearch='$installsitearch'
24963 installsitebin='$installsitebin'
24964 installsitehtml1dir='$installsitehtml1dir'
24965 installsitehtml3dir='$installsitehtml3dir'
24966 installsitelib='$installsitelib'
24967 installsiteman1dir='$installsiteman1dir'
24968 installsiteman3dir='$installsiteman3dir'
24969 installsitescript='$installsitescript'
24970 installstyle='$installstyle'
24971 installusrbinperl='$installusrbinperl'
24972 installvendorarch='$installvendorarch'
24973 installvendorbin='$installvendorbin'
24974 installvendorhtml1dir='$installvendorhtml1dir'
24975 installvendorhtml3dir='$installvendorhtml3dir'
24976 installvendorlib='$installvendorlib'
24977 installvendorman1dir='$installvendorman1dir'
24978 installvendorman3dir='$installvendorman3dir'
24979 installvendorscript='$installvendorscript'
24981 issymlink='$issymlink'
24982 ivdformat='$ivdformat'
24985 known_extensions='$known_extensions'
24988 ld_can_script='$ld_can_script'
24989 lddlflags='$lddlflags'
24991 ldflags_uselargefiles='$ldflags_uselargefiles'
24992 ldlibpthname='$ldlibpthname'
24999 libsdirs='$libsdirs'
25000 libsfiles='$libsfiles'
25001 libsfound='$libsfound'
25002 libspath='$libspath'
25003 libswanted='$libswanted'
25004 libswanted_uselargefiles='$libswanted_uselargefiles'
25010 localtime_r_proto='$localtime_r_proto'
25011 locincpth='$locincpth'
25012 loclibpth='$loclibpth'
25013 longdblinfbytes='$longdblinfbytes'
25014 longdblkind='$longdblkind'
25015 longdblmantbits='$longdblmantbits'
25016 longdblnanbytes='$longdblnanbytes'
25017 longdblsize='$longdblsize'
25018 longlongsize='$longlongsize'
25019 longsize='$longsize'
25023 lseeksize='$lseeksize'
25024 lseektype='$lseektype'
25028 make_set_make='$make_set_make'
25029 mallocobj='$mallocobj'
25030 mallocsrc='$mallocsrc'
25031 malloctype='$malloctype'
25033 man1direxp='$man1direxp'
25036 man3direxp='$man3direxp'
25038 mips_type='$mips_type'
25039 mistrustnm='$mistrustnm'
25041 mmaptype='$mmaptype'
25042 modetype='$modetype'
25044 multiarch='$multiarch'
25046 myarchname='$myarchname'
25047 mydomain='$mydomain'
25048 myhostname='$myhostname'
25051 need_va_copy='$need_va_copy'
25052 netdb_hlen_type='$netdb_hlen_type'
25053 netdb_host_type='$netdb_host_type'
25054 netdb_name_type='$netdb_name_type'
25055 netdb_net_type='$netdb_net_type'
25058 nm_so_opt='$nm_so_opt'
25059 nonxs_ext='$nonxs_ext'
25061 nvEUformat='$nvEUformat'
25062 nvFUformat='$nvFUformat'
25063 nvGUformat='$nvGUformat'
25064 nv_overflows_integers_at='$nv_overflows_integers_at'
25065 nv_preserves_uv_bits='$nv_preserves_uv_bits'
25066 nveformat='$nveformat'
25067 nvfformat='$nvfformat'
25068 nvgformat='$nvgformat'
25069 nvmantbits='$nvmantbits'
25072 o_nonblock='$o_nonblock'
25074 old_pthread_create_joinable='$old_pthread_create_joinable'
25075 optimize='$optimize'
25076 orderlib='$orderlib'
25079 otherlibdirs='$otherlibdirs'
25083 patchlevel='$patchlevel'
25084 path_sep='$path_sep'
25087 perl_patchlevel='$perl_patchlevel'
25088 perl_static_inline='$perl_static_inline'
25089 perladmin='$perladmin'
25090 perllibs='$perllibs'
25091 perlpath='$perlpath'
25093 phostname='$phostname'
25099 prefixexp='$prefixexp'
25101 privlibexp='$privlibexp'
25102 procselfexe='$procselfexe'
25103 prototype='$prototype'
25105 quadkind='$quadkind'
25106 quadtype='$quadtype'
25107 randbits='$randbits'
25108 randfunc='$randfunc'
25109 random_r_proto='$random_r_proto'
25110 randseedtype='$randseedtype'
25112 rd_nodata='$rd_nodata'
25113 readdir64_r_proto='$readdir64_r_proto'
25114 readdir_r_proto='$readdir_r_proto'
25115 revision='$revision'
25121 sGMTIME_max='$sGMTIME_max'
25122 sGMTIME_min='$sGMTIME_min'
25123 sLOCALTIME_max='$sLOCALTIME_max'
25124 sLOCALTIME_min='$sLOCALTIME_min'
25125 sPRIEUldbl='$sPRIEUldbl'
25126 sPRIFUldbl='$sPRIFUldbl'
25127 sPRIGUldbl='$sPRIGUldbl'
25128 sPRIXU64='$sPRIXU64'
25130 sPRIeldbl='$sPRIeldbl'
25131 sPRIfldbl='$sPRIfldbl'
25132 sPRIgldbl='$sPRIgldbl'
25137 sSCNfldbl='$sSCNfldbl'
25138 sched_yield='$sched_yield'
25139 scriptdir='$scriptdir'
25140 scriptdirexp='$scriptdirexp'
25142 seedfunc='$seedfunc'
25143 selectminbits='$selectminbits'
25144 selecttype='$selecttype'
25145 sendmail='$sendmail'
25146 setgrent_r_proto='$setgrent_r_proto'
25147 sethostent_r_proto='$sethostent_r_proto'
25148 setlocale_r_proto='$setlocale_r_proto'
25149 setnetent_r_proto='$setnetent_r_proto'
25150 setprotoent_r_proto='$setprotoent_r_proto'
25151 setpwent_r_proto='$setpwent_r_proto'
25152 setservent_r_proto='$setservent_r_proto'
25155 sharpbang='$sharpbang'
25156 shmattype='$shmattype'
25157 shortsize='$shortsize'
25160 sig_count='$sig_count'
25161 sig_name='$sig_name'
25162 sig_name_init='$sig_name_init'
25164 sig_num_init='$sig_num_init'
25165 sig_size='$sig_size'
25166 signal_t='$signal_t'
25167 sitearch='$sitearch'
25168 sitearchexp='$sitearchexp'
25170 sitebinexp='$sitebinexp'
25171 sitehtml1dir='$sitehtml1dir'
25172 sitehtml1direxp='$sitehtml1direxp'
25173 sitehtml3dir='$sitehtml3dir'
25174 sitehtml3direxp='$sitehtml3direxp'
25176 sitelib_stem='$sitelib_stem'
25177 sitelibexp='$sitelibexp'
25178 siteman1dir='$siteman1dir'
25179 siteman1direxp='$siteman1direxp'
25180 siteman3dir='$siteman3dir'
25181 siteman3direxp='$siteman3direxp'
25182 siteprefix='$siteprefix'
25183 siteprefixexp='$siteprefixexp'
25184 sitescript='$sitescript'
25185 sitescriptexp='$sitescriptexp'
25186 sizesize='$sizesize'
25187 sizetype='$sizetype'
25191 sockethdr='$sockethdr'
25192 socketlib='$socketlib'
25193 socksizetype='$socksizetype'
25195 spackage='$spackage'
25196 spitshell='$spitshell'
25197 srand48_r_proto='$srand48_r_proto'
25198 srandom_r_proto='$srandom_r_proto'
25200 ssizetype='$ssizetype'
25201 st_ino_sign='$st_ino_sign'
25202 st_ino_size='$st_ino_size'
25203 startperl='$startperl'
25205 static_ext='$static_ext'
25207 stdio_base='$stdio_base'
25208 stdio_bufsiz='$stdio_bufsiz'
25209 stdio_cnt='$stdio_cnt'
25210 stdio_filbuf='$stdio_filbuf'
25211 stdio_ptr='$stdio_ptr'
25212 stdio_stream_array='$stdio_stream_array'
25213 strerror_r_proto='$strerror_r_proto'
25216 subversion='$subversion'
25221 targetarch='$targetarch'
25222 targetdir='$targetdir'
25223 targetenv='$targetenv'
25224 targethost='$targethost'
25225 targetmkdir='$targetmkdir'
25226 targetport='$targetport'
25227 targetsh='$targetsh'
25231 timeincl='$timeincl'
25232 timetype='$timetype'
25233 tmpnam_r_proto='$tmpnam_r_proto'
25239 ttyname_r_proto='$ttyname_r_proto'
25248 uidformat='$uidformat'
25254 uquadtype='$uquadtype'
25255 use5005threads='$use5005threads'
25256 use64bitall='$use64bitall'
25257 use64bitint='$use64bitint'
25258 usecbacktrace='$usecbacktrace'
25259 usecrosscompile='$usecrosscompile'
25260 usedevel='$usedevel'
25262 usedtrace='$usedtrace'
25263 usefaststdio='$usefaststdio'
25264 useithreads='$useithreads'
25265 usekernprocpathname='$usekernprocpathname'
25266 uselargefiles='$uselargefiles'
25267 uselongdouble='$uselongdouble'
25268 usemallocwrap='$usemallocwrap'
25269 usemorebits='$usemorebits'
25270 usemultiplicity='$usemultiplicity'
25271 usemymalloc='$usemymalloc'
25273 usensgetexecutablepath='$usensgetexecutablepath'
25274 useopcode='$useopcode'
25275 useperlio='$useperlio'
25276 useposix='$useposix'
25277 usequadmath='$usequadmath'
25278 usereentrant='$usereentrant'
25279 userelocatableinc='$userelocatableinc'
25280 useshrplib='$useshrplib'
25281 usesitecustomize='$usesitecustomize'
25282 usesocks='$usesocks'
25283 usethreads='$usethreads'
25284 usevendorprefix='$usevendorprefix'
25285 useversionedarchname='$useversionedarchname'
25286 usevfork='$usevfork'
25289 uvXUformat='$uvXUformat'
25290 uvoformat='$uvoformat'
25293 uvuformat='$uvuformat'
25294 uvxformat='$uvxformat'
25296 vendorarch='$vendorarch'
25297 vendorarchexp='$vendorarchexp'
25298 vendorbin='$vendorbin'
25299 vendorbinexp='$vendorbinexp'
25300 vendorhtml1dir='$vendorhtml1dir'
25301 vendorhtml1direxp='$vendorhtml1direxp'
25302 vendorhtml3dir='$vendorhtml3dir'
25303 vendorhtml3direxp='$vendorhtml3direxp'
25304 vendorlib='$vendorlib'
25305 vendorlib_stem='$vendorlib_stem'
25306 vendorlibexp='$vendorlibexp'
25307 vendorman1dir='$vendorman1dir'
25308 vendorman1direxp='$vendorman1direxp'
25309 vendorman3dir='$vendorman3dir'
25310 vendorman3direxp='$vendorman3direxp'
25311 vendorprefix='$vendorprefix'
25312 vendorprefixexp='$vendorprefixexp'
25313 vendorscript='$vendorscript'
25314 vendorscriptexp='$vendorscriptexp'
25316 version_patchlevel_string='$version_patchlevel_string'
25317 versiononly='$versiononly'
25321 yaccflags='$yaccflags'
25326 : add special variables
25327 $test -f $src/patchlevel.h && \
25328 awk '/^#define[ ]+PERL_/ {printf "%s=%s\n",$2,$3}' $src/patchlevel.h >>config.sh
25329 echo "PERL_PATCHLEVEL='$perl_patchlevel'" >>config.sh
25330 echo "PERL_CONFIG_SH=true" >>config.sh
25332 : propagate old symbols
25333 if $test -f UU/config.sh; then
25334 <UU/config.sh $sort | $uniq >UU/oldconfig.sh
25335 $sed -n 's/^\([a-zA-Z_0-9]*\)=.*/\1/p' \
25336 config.sh config.sh UU/oldconfig.sh |\
25337 $sort | $uniq -u >UU/oldsyms
25338 set X `$cat UU/oldsyms`
25344 Hmm...You had some extra variables I don't know about...I'll try to keep 'em...
25346 echo ": Variables propagated from previous config.sh file." >>config.sh
25347 for sym in `$cat UU/oldsyms`; do
25348 echo " Propagating $hint variable "'$'"$sym..."
25349 eval 'tmp="$'"${sym}"'"'
25351 sed -e "s/'/'\"'\"'/g" -e "s/^/$sym='/" -e "s/$/'/" >>config.sh
25357 : preserve RCS keywords in files with variable substitution, grrr
25360 : Finish up by extracting the .SH files
25363 echo "Stopping at your request, leaving temporary files around."
25373 If you'd like to make any changes to the config.sh file before I begin
25374 to configure things, do it as a shell escape now (e.g. !vi config.sh).
25377 rp="Press return or use a shell escape to edit config.sh:"
25382 *) : in case they cannot read
25383 sh 1>&4 -c "$ans";;
25388 : if this fails, just run all the .SH files by hand
25397 if $contains '^depend:' [Mm]akefile >/dev/null 2>&1; then
25404 Now you need to generate make dependencies by running "$make depend".
25405 You might prefer to run it in background: "$make depend > makedepend.out &"
25406 It can take a while, so you might not want to run it right now.
25411 rp="Run $make depend now?"
25415 $make depend && echo "Now you must run '$make'."
25418 echo "You must run '$make depend' then '$make'."
25421 elif test -f [Mm]akefile; then
25423 echo "Now you must run a $make."
25425 echo "Configure done."
25428 if $test -f Policy.sh; then
25431 If you compile $package on a different machine or from a different object
25432 directory, copy the Policy.sh file from this object directory to the
25433 new one before you run Configure -- this will help you with most of
25434 the policy defaults.
25438 if $test -f UU/config.msg; then
25439 echo "Hmm. I also noted the following information while running:"
25441 $cat UU/config.msg >&4
25443 $rm -f kit*isdone ark*isdone