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. Rather than
15 # working with this copy of Configure, you may wish to get metaconfig.
16 # The dist-3.0 package (which contains metaconfig) was posted in
17 # comp.sources.misc and is available on CPAN under authors/id/RAM so
18 # you may fetch it yourself from your nearest archive site.)
21 # Though this script was generated by metaconfig, it is OK to send
22 # patches against it. It's up to the Configure pumpkin to backport
23 # the patch to the metaunits if it is accepted.
24 # See Porting/pumpkin.pod for more information on metaconfig.
27 # $Id: Head.U,v 3.0.1.9 1997/02/28 15:02:09 ram Exp $
29 # Generated on Mon Apr 23 22:54:24 CEST 2007 [metaconfig 3.0 PL70]
30 # (with additional metaconfig patches by perlbug@perl.org)
35 SCO csh still thinks true is false. Write to SCO today and tell them that next
36 year Configure ought to "rm /bin/csh" unless they fix their blasted shell. :-)
38 (Actually, Configure ought to just patch csh in place. Hmm. Hmmmmm. All
39 we'd have to do is go in and swap the && and || tokens, wherever they are.)
41 [End of diatribe. We now return you to your regularly scheduled programming...]
45 OOPS! You naughty creature! You didn't run Configure with sh!
46 I will attempt to remedy the situation by running sh for you...
50 true || exec sh $0 $argv:q
52 (exit $?0) || cat c2$$
53 (exit $?0) || exec sh $0 $argv:q
56 if test -f /dev/cputype -a -f /dev/drivers -a -f /dev/osversion; then
59 *** I'm sorry but this system looks like Plan 9 and Plan 9 doesn't do
60 *** Configure that well. (Plan 9 is close to UNIX but not close enough.)
61 *** Please read the README.plan9 for further instructions.
62 *** Cannot continue, aborting.
68 if test ! -c /dev/null ; then
71 *** I'm sorry, but /dev/null appears to be a file rather than a device.
72 *** Please consult your operating sytem's notes for making a device
74 *** Cannot continue, aborting.
80 : compute my invocation name
84 me=`echo $0 | sed -e 's!.*/\(.*\)!\1!' 2>/dev/null`
89 : Proper separator for the PATH environment variable
91 : On OS/2 this directory should exist if this is not floppy only system :-]
92 if test -d c:/. || ( uname -a | grep -i 'os\(/\|\)2' ) 2>&1 >/dev/null ; then
93 if test -n "$OS2_SHELL"; then
95 PATH=`cmd /c "echo %PATH%" | tr '\\\\' / `
96 OS2_SHELL=`cmd /c "echo %OS2_SHELL%" | tr '\\\\' / | tr '[A-Z]' '[a-z]'`
98 elif test -n "$DJGPP"; then
99 case "X${MACHTYPE:-nonesuchmach}" in
106 : Proper PATH setting
107 paths='/bin /usr/bin /usr/local/bin /usr/ucb /usr/local /usr/lbin'
108 paths="$paths /opt/bin /opt/local/bin /opt/local /opt/lbin"
109 paths="$paths /usr/5bin /etc /usr/gnu/bin /usr/new /usr/new/bin /usr/nbin"
110 paths="$paths /opt/gnu/bin /opt/new /opt/new/bin /opt/nbin"
111 paths="$paths /sys5.3/bin /sys5.3/usr/bin /bsd4.3/bin /bsd4.3/usr/ucb"
112 paths="$paths /bsd4.3/usr/bin /usr/bsd /bsd43/bin /opt/ansic/bin /usr/ccs/bin"
113 paths="$paths /etc /usr/lib /usr/ucblib /lib /usr/ccs/lib"
114 paths="$paths /sbin /usr/sbin /usr/libexec"
115 paths="$paths /system/gnu_library/bin"
119 case "$p_$PATH$p_" in
121 *) test -d $p && PATH=$PATH$p_$p ;;
128 : shall we be using ksh?
134 if (PATH=.; alias -x) >/dev/null 2>&1; then
137 if test -f /hp-ux -a -f /bin/ksh; then
138 needksh='to avoid sh bug in "here document" expansion'
140 if test -d /usr/lpp -a -f /usr/bin/bsh -a -f /usr/bin/uname; then
141 if test X`/usr/bin/uname -v` = X4; then
142 avoidksh="to avoid AIX 4's /bin/sh"
146 if test -f /osf_boot -a -f /usr/sbin/setld; then
147 if test X`/usr/bin/uname -s` = XOSF1; then
148 avoidksh="to avoid Digital UNIX' ksh"
150 unset BIN_SH # if this is 'xpg4' sh will start up ksh
153 case "$inksh/$needksh" in
160 case "$inksh/$avoidksh" in
166 case "$inksh/$needksh-$avoidksh-" in
169 (I see you are using the Korn shell. Some ksh's blow up on $me,
170 mainly on older exotic systems. If yours does, try the Bourne shell instead.)
177 echo "(Feeding myself to $newsh $reason.)"
179 Configure|*/Configure) exec $newsh $0 "$@";;
180 *) exec $newsh Configure "$@";;
185 : if needed set CDPATH to a harmless value that is not chatty
186 : avoid bash 2.02 problems with empty CDPATH.
190 *bash*) CDPATH='.' ;;
195 : Configure runs within the UU subdirectory
196 test -d UU || mkdir UU
335 initialinstalllocation=''
363 d_attribute_format=''
364 d_attribute_malloc=''
365 d_attribute_nonnull=''
366 d_attribute_noreturn=''
368 d_attribute_unused=''
369 d_attribute_warn_unused_result=''
370 d_printf_format_null=''
373 d_builtin_choose_expr=''
376 d_c99_variadic_macros=''
423 endhostent_r_proto=''
429 endprotoent_r_proto=''
435 endservent_r_proto=''
487 gethostbyaddr_r_proto=''
489 gethostbyname_r_proto=''
491 gethostent_r_proto=''
503 getnetbyaddr_r_proto=''
505 getnetbyname_r_proto=''
519 d_getprotobyname_r=''
520 getprotobyname_r_proto=''
521 d_getprotobynumber_r=''
522 getprotobynumber_r_proto=''
524 getprotoent_r_proto=''
536 getservbyname_r_proto=''
538 getservbyport_r_proto=''
540 getservent_r_proto=''
564 d_libm_lib_version=''
567 d_localtime_r_needs_tzset=''
578 d_malloc_good_size=''
620 d_old_pthread_create_joinable=''
621 old_pthread_create_joinable=''
623 d_pthread_attr_setscope=''
662 sethostent_r_proto=''
679 setprotoent_r_proto=''
691 setservent_r_proto=''
725 d_sprintf_returns_strlen=''
740 d_stdio_ptr_lval_nochange_cnt=''
741 d_stdio_ptr_lval_sets_cnt=''
945 d_inc_version_list=''
947 inc_version_list_init=''
966 ignore_versioned_solibs=''
1030 d_perl_otherlibdirs=''
1038 api_versionstring=''
1044 version_patchlevel_string=''
1048 d_nv_preserves_uv=''
1049 d_nv_zero_is_allbits_zero=''
1060 nv_preserves_uv_bits=''
1132 installsitehtml1dir=''
1135 installsitehtml3dir=''
1142 installsiteman1dir=''
1145 installsiteman3dir=''
1150 installsitescript=''
1165 d_stdio_stream_array=''
1166 stdio_stream_array=''
1177 ccflags_uselargefiles=''
1178 ldflags_uselargefiles=''
1179 libswanted_uselargefiles=''
1199 installvendorarch=''
1206 installvendorhtml1dir=''
1208 vendorhtml1direxp=''
1209 installvendorhtml3dir=''
1211 vendorhtml3direxp=''
1217 installvendorman1dir=''
1220 installvendorman3dir=''
1227 installvendorscript=''
1239 smallmach='pdp11 i8086 z8000 i80286 iAPX286'
1242 : We must find out about Eunice early
1244 if test -f /etc/unixtovms; then
1245 eunicefix=/etc/unixtovms
1247 if test -f /etc/unixtovms.exe; then
1248 eunicefix=/etc/unixtovms.exe
1251 : Set executable suffix now -- needed before hints available
1252 if test -f "/libs/version.library"; then
1255 elif test -f "/system/gnu_library/bin/ar.pm"; then
1258 elif test -n "$DJGPP"; then
1261 elif test -d c:/. -o -n "$is_os2" ; then
1267 : Trailing extension. Override this in a hint file, if needed.
1268 : Extra object files, if any, needed on this platform.
1273 : change the next line if compiling for Xenix/286 on Xenix/386
1274 xlibpth='/usr/lib/386 /lib/386'
1275 : Possible local library directories to search.
1276 loclibpth="/usr/local/lib /opt/local/lib /usr/gnu/lib"
1277 loclibpth="$loclibpth /opt/gnu/lib /usr/GNU/lib /opt/GNU/lib"
1279 : general looking path for locating libraries
1280 glibpth="/lib /usr/lib $xlibpth"
1281 glibpth="$glibpth /usr/ccs/lib /usr/ucblib /usr/local/lib"
1282 test -f /usr/shlib/libc.so && glibpth="/usr/shlib $glibpth"
1283 test -f /shlib/libc.so && glibpth="/shlib $glibpth"
1284 test -d /usr/lib64 && glibpth="$glibpth /lib64 /usr/lib64 /usr/local/lib64"
1286 : Private path used by Configure to find libraries. Its value
1287 : is prepended to libpth. This variable takes care of special
1288 : machines, like the mips. Usually, it should be empty.
1291 : default library list
1293 : some systems want to use only the non-versioned libso:s
1294 ignore_versioned_solibs=''
1298 : set usethreads on the Configure command line to enable threads.
1299 usereentrant='undef'
1300 : full support for void wanted by default
1303 : Possible local include directories to search.
1304 : Set locincpth to "" in a hint file to defeat local include searches.
1305 locincpth="/usr/local/include /opt/local/include /usr/gnu/include"
1306 locincpth="$locincpth /opt/gnu/include /usr/GNU/include /opt/GNU/include"
1308 : no include file wanted by default
1311 : Enable -DEBUGGING and -DDEBUGGING from the command line
1318 : set useposix=false in your hint file to disable the POSIX extension.
1320 : set useopcode=false in your hint file to disable the Opcode extension.
1323 ccflags_uselargefiles=''
1324 ldflags_uselargefiles=''
1325 libswanted_uselargefiles=''
1326 : set usemultiplicity on the Configure command line to enable multiplicity.
1327 : set usesocks on the Configure command line to enable socks.
1328 : List of libraries we want.
1329 : If anyone needs extra -lxxx, put those in a hint file.
1330 libswanted="sfio socket bind inet nsl nm ndbm gdbm dbm db malloc dl dld ld sun"
1331 libswanted="$libswanted m crypt sec util c cposix posix ucb bsd BSD"
1332 : We probably want to search /usr/shlib before most other libraries.
1333 : This is only used by the lib/ExtUtils/MakeMaker.pm routine extliblist.
1334 glibpth=`echo " $glibpth " | sed -e 's! /usr/shlib ! !'`
1335 glibpth="/usr/shlib $glibpth"
1336 : Do not use vfork unless overridden by a hint file.
1339 : Find the basic shell for Bourne shell scripts
1343 *bsd*|sys5*) xxx="/$SYSTYPE/bin/sh";;
1346 if test -f "$xxx"; then
1349 : Build up a list and do a single loop so we can 'break' out.
1350 pth=`echo $PATH | sed -e "s/$p_/ /g"`
1351 for xxx in sh bash ksh pdksh ash; do
1353 try="$try ${p}/${xxx}"
1357 if test -f "$xxx"; then
1360 elif test "X$_exe" != X -a -f "$xxx$_exe"; then
1363 elif test -f "$xxx.exe"; then
1374 $me: Fatal Error: I can't find a Bourne Shell anywhere.
1376 Usually it's in /bin/sh. How did you even get this far?
1377 Please contact me (Perl Maintainers) at perlbug@perl.org and
1378 we'll try to straighten this all out.
1384 : see if sh knows # comments
1385 if `$sh -c '#' >/dev/null 2>&1`; then
1389 test -f $xcat$_exe || xcat=/usr/bin/cat
1390 if test ! -f $xcat$_exe; then
1391 for p in `echo $PATH | sed -e "s/$p_/ /g"` $paths; do
1392 if test -f $p/cat$_exe; then
1397 if test ! -f $xcat$_exe; then
1398 echo "Can't find cat anywhere!"
1402 echo "#!$xcat" >sharp
1406 if test -s today; then
1409 echo "#! $xcat" > sharp
1413 if test -s today; then
1421 echo "Your $sh doesn't grok # comments--I will strip them later on."
1424 echo "exec grep -v '^[ ]*#'" >spitshell
1426 $eunicefix spitshell
1427 spitshell=`pwd`/spitshell
1429 echo "I presume that if # doesn't work, #! won't work either!"
1434 : figure out how to guarantee sh startup
1436 '') startsh=${sharpbang}${sh} ;;
1448 : echo "Yup, it does."
1450 echo "Hmm... '$startsh' does not guarantee sh startup..."
1451 echo "You may have to fix up the shell scripts to make sure $sh runs them."
1456 : Save command line options in file UU/cmdline.opt for later use in
1457 : generating config.sh.
1458 cat > cmdline.opt <<EOSH
1459 # Configure command line arguments.
1468 cat >>cmdline.opt <<EOSH
1469 config_arg$argn='$arg'
1471 # Extreme backslashitis: replace each ' by '"'"'
1472 cat <<EOC | sed -e "s/'/'"'"'"'"'"'"'/g" > cmdl.opt
1475 arg_exp=`cat cmdl.opt`
1476 args_exp="$args_exp$args_sep'$arg_exp'"
1477 argn=`expr $argn + 1`
1480 # args_exp is good for restarting self: eval "set X $args_exp"; shift; $0 "$@"
1481 # used by ./hints/os2.sh
1484 : produce awk script to parse command line options
1485 cat >options.awk <<'EOF'
1487 optstr = "A:dD:eEf:hKOrsSU:V"; # getopt-style specification
1489 len = length(optstr);
1490 for (i = 1; i <= len; i++) {
1491 c = substr(optstr, i, 1);
1492 if (i < len) a = substr(optstr, i + 1, 1); else a = "";
1503 if (substr(str, 1, 1) != "-") {
1504 printf("'%s'\n", str);
1508 for (i = 2; i <= len; i++) {
1509 c = substr(str, i, 1);
1511 printf("-%s\n", substr(str, i));
1517 printf("'%s'\n", substr(str, i + 1));
1530 : process the command line options
1531 set X `for arg in "$@"; do echo "X$arg"; done |
1532 sed -e s/X// | awk -f options.awk`
1537 : set up default values
1547 rm -f optdef.sh posthint.sh
1548 cat >optdef.sh <<EOS
1554 while test $# -gt 0; do
1556 -d) shift; fastread=yes;;
1557 -e) shift; alldone=cont;;
1561 if test -r "$1"; then
1564 echo "$me: cannot read config file $1." >&2
1569 -h) shift; error=true;;
1570 -r) shift; reuseval=true;;
1571 -s) shift; silent=true; realsilent=true;;
1572 -E) shift; alldone=exit;;
1573 -K) shift; knowitall=true;;
1574 -O) shift; override=true;;
1575 -S) shift; silent=true; extractsh=true;;
1580 echo "$me: use '-U symbol=', not '-D symbol='." >&2
1581 echo "$me: ignoring -D $1" >&2
1584 sed -e "s/'/'\"'\"'/g" -e "s/=\(.*\)/='\1'/" >> optdef.sh;;
1585 *) echo "$1='define'" >> optdef.sh;;
1592 *=) echo "$1" >> optdef.sh;;
1594 echo "$me: use '-D symbol=val', not '-U symbol=val'." >&2
1595 echo "$me: ignoring -U $1" >&2
1597 *) echo "$1='undef'" >> optdef.sh;;
1608 *=*) zzz=`echo "$yyy"|sed 's!=.*!!'`
1612 zzz=" "`echo "$yyy"|sed 's!^[^=]*=!!'`
1613 yyy=`echo "$yyy"|sed 's!=.*!!'` ;;
1619 *:*) xxx=`echo "$yyy"|sed 's!:.*!!'`
1620 yyy=`echo "$yyy"|sed 's!^[^:]*:!!'`
1621 zzz=`echo "$yyy"|sed 's!^[^=]*=!!'`
1622 yyy=`echo "$yyy"|sed 's!=.*!!'` ;;
1623 *) xxx=`echo "$yyy"|sed 's!:.*!!'`
1624 yyy=`echo "$yyy"|sed 's!^[^:]*:!!'` ;;
1630 echo "$yyy=\"\${$yyy}$zzz\"" >> posthint.sh ;;
1632 echo "$yyy=''" >> posthint.sh ;;
1637 echo "$yyy='$zzz'" >> posthint.sh ;;
1639 echo "eval \"$yyy=$zzz\"" >> posthint.sh ;;
1641 echo "$yyy=\"$zzz\${$yyy}\"" >> posthint.sh ;;
1646 echo "$yyy=$zzz" >> posthint.sh ;;
1647 *) echo "$me: unknown -A command '$xxx', ignoring -A $1" >&2 ;;
1651 -V) echo "$me generated by metaconfig 3.0 PL70." >&2
1654 -*) echo "$me: unknown option $1" >&2; shift; error=true;;
1662 Usage: $me [-dehrsEKOSV] [-f config.sh] [-D symbol] [-D symbol=value]
1663 [-U symbol] [-U symbol=] [-A command:symbol...]
1664 -d : use defaults for all answers.
1665 -e : go on without questioning past the production of config.sh.
1666 -f : specify an alternate default configuration file.
1667 -h : print this help message and exit (with an error status).
1668 -r : reuse C symbols value if possible (skips costly nm extraction).
1669 -s : silent mode, only echoes questions and essential information.
1670 -D : define symbol to have some value:
1671 -D symbol symbol gets the value 'define'
1672 -D symbol=value symbol gets the value 'value'
1673 -E : stop at the end of questions, after having produced config.sh.
1674 -K : do not use unless you know what you are doing.
1675 -O : let -D and -U override definitions from loaded configuration file.
1676 -S : perform variable substitutions on all .SH files (can mix with -f)
1677 -U : undefine symbol:
1678 -U symbol symbol gets the value 'undef'
1679 -U symbol= symbol gets completely empty
1680 -A : manipulate symbol after the platform specific hints have been applied:
1681 -A symbol=value append " "value to symbol
1682 -A append:symbol=value append value to symbol
1683 -A define:symbol=value define symbol to have value
1684 -A clear:symbol define symbol to be ''
1685 -A define:symbol define symbol to be 'define'
1686 -A eval:symbol=value define symbol to be eval of value
1687 -A prepend:symbol=value prepend value to symbol
1688 -A undef:symbol define symbol to be 'undef'
1689 -A undef:symbol= define symbol to be ''
1690 -V : print version number and exit (with a zero status).
1697 case "$fastread$alldone" in
1700 case "$extractsh" in
1703 if test ! -t 0; then
1704 echo "Say 'sh Configure', not 'sh <Configure'"
1714 true) exec 1>/dev/null;;
1717 : run the defines and the undefines, if any, but leave the file out there...
1720 : create the posthint manipulation script and leave the file out there...
1725 first=`echo $package | sed -e 's/^\(.\).*/\1/'`
1726 last=`echo $package | sed -e 's/^.\(.*\)/\1/'`
1727 case "`echo AbyZ | tr '[:lower:]' '[:upper:]' 2>/dev/null`" in
1728 ABYZ) spackage=`echo $first | tr '[:lower:]' '[:upper:]'`$last;;
1729 *) spackage=`echo $first | tr '[a-z]' '[A-Z]'`$last;;
1732 : Some greps do not return status, grrr.
1733 echo "grimblepritz" >grimble
1734 if grep blurfldyick grimble >/dev/null 2>&1 ; then
1736 elif grep grimblepritz grimble >/dev/null 2>&1 ; then
1742 : the following should work in any shell
1746 echo "AGH! Grep doesn't return a status. Attempting remedial action."
1747 cat >contains <<'EOSS'
1748 grep "$1" "$2" >.greptmp && cat .greptmp && test -s .greptmp
1753 : Find the path to the source tree
1756 */*) src=`echo $0 | sed -e 's%/[^/][^/]*$%%'`
1760 *) src=`cd ../$src && pwd` ;;
1773 if test -f $rsrc/Configure && \
1774 $contains "^package=$package$" $rsrc/Configure >/dev/null 2>&1
1776 : found it, so we are ok.
1779 for src in . .. ../.. ../../.. ../../../..; do
1780 if test -f ../$src/Configure && \
1781 $contains "^package=$package$" ../$src/Configure >/dev/null 2>&1
1792 Sorry, I can't seem to locate the source dir for $package. Please start
1793 Configure with an explicit path -- i.e. /some/path/Configure.
1801 echo "Sources for $package found in \"$src\"." >&4
1805 : script used to extract .SH files with variable substitutions
1806 cat >extract <<'EOS'
1808 echo "Doing variable substitutions on .SH files..."
1809 if test -f MANIFEST; then
1810 set x `awk '{print $1}' < MANIFEST | grep '\.SH$'`
1812 echo "(Looking for .SH files under the source directory.)"
1813 set x `(cd "$src"; find . -name "*.SH" -print)`
1817 0) set x `(cd "$src"; echo *.SH)`; shift;;
1819 if test ! -f "$src/$1"; then
1825 while test $name; do
1826 if test ! -d "$name"; then
1827 create="$name $create";
1828 name=`echo $name | sed -e "s|^[^/]*$||"`;
1829 name=`echo $name | sed -e "s|\(.*\)/.*|\1|"`;
1834 for file in $create; do
1843 dir=`expr X$file : 'X\(.*\)/'`
1844 file=`expr X$file : 'X.*/\(.*\)'`
1845 (cd "$dir" && . ./$file)
1855 dir=`expr X$file : 'X\(.*\)/'`
1856 file=`expr X$file : 'X.*/\(.*\)'`
1857 (set x $dir; shift; eval $mkdir_p)
1858 sh <"$src/$dir/$file"
1867 if test -f "$src/config_h.SH"; then
1868 if test ! -f config.h; then
1869 : oops, they left it out of MANIFEST, probably, so do it anyway.
1870 . "$src/config_h.SH"
1875 : extract files and exit if asked to do so
1876 case "$extractsh" in
1878 case "$realsilent" in
1882 case "$config_sh" in
1883 '') config_sh='config.sh';;
1886 echo "Fetching answers from $config_sh..."
1889 test "$override" && . ./optdef.sh
1893 echo "Extraction done."
1898 : Eunice requires " " instead of "", can you believe it
1901 echo "Beginning of configuration questions for $package."
1903 trap 'echo " "; test -d ../UU && rm -rf X $rmlist; exit 1' 1 2 3 15
1905 : first determine how to suppress newline on echo command
1907 echo "Checking echo to see how to suppress newlines..."
1908 (echo "hi there\c" ; echo " ") >.echotmp
1909 if $contains c .echotmp >/dev/null 2>&1 ; then
1920 echo $n "The star should be here-->$c"
1924 : Now test for existence of everything in MANIFEST
1926 if test -f "$rsrc/MANIFEST"; then
1927 echo "First let's make sure your kit is complete. Checking..." >&4
1928 awk '$1 !~ /PACK[A-Z]+/ {print $1}' "$rsrc/MANIFEST" | (split -l 50 2>/dev/null || split -50)
1931 for filelist in x??; do
1932 (cd "$rsrc"; ls `cat "$tmppwd/$filelist"` >/dev/null 2>>"$tmppwd/missing")
1934 if test -s missing; then
1938 THIS PACKAGE SEEMS TO BE INCOMPLETE.
1940 You have the option of continuing the configuration process, despite the
1941 distinct possibility that your kit is damaged, by typing 'y'es. If you
1942 do, don't blame me if something goes wrong. I advise you to type 'n'o
1943 and contact the author (perlbug@perl.org).
1946 echo $n "Continue? [n] $c" >&4
1950 echo "Continuing..." >&4
1954 echo "ABORTING..." >&4
1959 echo "Looks good..."
1962 echo "There is no MANIFEST file. I hope your kit is complete !"
1967 : Find the appropriate value for a newline for tr
1968 if test -n "$DJGPP"; then
1971 if test X"$trnl" = X; then
1972 case "`echo foo|tr '\n' x 2>/dev/null`" in
1976 if test X"$trnl" = X; then
1977 case "`echo foo|tr '\012' x 2>/dev/null`" in
1978 foox) trnl='\012' ;;
1981 if test X"$trnl" = X; then
1982 case "`echo foo|tr '\r\n' xy 2>/dev/null`" in
1983 fooxy) trnl='\n\r' ;;
1986 if test X"$trnl" = X; then
1989 $me: Fatal Error: cannot figure out how to translate newlines with 'tr'.
1995 : compute the number of columns on the terminal for proper question formatting
2000 : set up the echo used in my read
2001 myecho="case \"\$xxxm\" in
2002 '') echo $n \"\$rp $c\" >&4;;
2004 '') echo $n \"[\$xxxm] $c\";;
2006 if test \`echo \"\$rp [\$xxxm] \" | wc -c\` -ge $COLUMNS; then
2008 echo $n \"[\$xxxm] $c\" >&4
2010 echo $n \"\$rp [\$xxxm] $c\" >&4
2016 : now set up to do reads with possible shell escape and default assignment
2022 case "\$fastread" in
2023 yes) case "\$dflt" in
2026 case "\$silent-\$rp" in
2031 *) case "\$silent" in
2032 true) case "\$rp" in
2037 while expr "X\$ans" : "X!" >/dev/null; do
2041 aok=''; eval "ans=\\"\$answ\\"" && aok=y
2049 set x \`expr "X\$ans" : "X!\(.*\)\$"\`
2058 set x \`expr "X\$ans" : "X&\(.*\)\$"\`
2063 echo "(OK, I'll run with -d after this question.)" >&4
2066 echo "*** Sorry, \$1 not supported yet." >&4
2076 echo "*** Substitution done -- please confirm."
2078 ans=\`echo $n "\$ans$c" | tr '$trnl' ' '\`
2083 echo "*** Error -- try again."
2090 case "\$ans\$xxxm\$nostick" in
2102 : create .config dir to save info across Configure sessions
2103 test -d ../.config || mkdir ../.config
2104 cat >../.config/README <<EOF
2105 This directory created by Configure to save information that should
2106 persist across sessions for $package.
2108 You may safely delete it if you wish.
2111 xversion=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
2113 $define|true|[yY]*) ;;
2114 *) case "$xversion" in
2117 *** WHOA THERE!!! ***
2119 This is an UNSTABLE DEVELOPMENT release.
2120 The version of this $package distribution is $xversion, that is, odd,
2121 (as opposed to even) and that signifies a development release.
2122 If you want a maintenance release, you want an even-numbered version.
2124 Do ***NOT*** install this into production use.
2125 Data corruption and crashes are possible.
2127 It is most seriously suggested that you do not continue any further
2128 unless you want to help in developing and debugging Perl.
2130 If you *still* want to build perl, you can answer 'y' now,
2131 or pass -Dusedevel to Configure.
2134 rp='Do you really want to continue?'
2138 [yY]) echo >&4 "Okay, continuing."
2139 usedevel="$define" ;;
2140 *) echo >&4 "Okay, bye."
2150 case "$versiononly" in
2151 '') versiononly="$define" ;;
2153 case "$installusrbinperl" in
2154 '') installusrbinperl="$undef" ;;
2159 : general instructions
2162 user=`(logname) 2>/dev/null`
2164 '') user=`whoami 2>&1`;;
2166 if $contains "^$user\$" ../.config/instruct >/dev/null 2>&1; then
2169 rp='Would you like to see the instructions?'
2180 This installation shell script will examine your system and ask you questions
2181 to determine how the perl5 package should be installed. If you get
2182 stuck on a question, you may use a ! shell escape to start a subshell or
2183 execute a command. Many of the questions will have default answers in square
2184 brackets; typing carriage return will give you the default.
2186 On some of the questions which ask for file or directory names you are allowed
2187 to use the ~name construct to specify the login directory belonging to "name",
2188 even if you don't have a shell which knows about that. Questions where this is
2189 allowed will be marked "(~name ok)".
2193 dflt='Type carriage return to continue'
2197 The prompter used in this script allows you to use shell variables and
2198 backticks in your answers. You may use $1, $2, etc... to refer to the words
2199 in the default answer, as if the default line was a set of arguments given to a
2200 script shell. This means you may also use $* to repeat the whole default line,
2201 so you do not have to re-type everything to add something to the default.
2203 Everytime there is a substitution, you will have to confirm. If there is an
2204 error (e.g. an unmatched backtick), the default answer will remain unchanged
2205 and you will be prompted again.
2207 If you are in a hurry, you may run 'Configure -d'. This will bypass nearly all
2208 the questions and use the computed defaults (or the previous answers if there
2209 was already a config.sh file). Type 'Configure -h' for a list of options.
2210 You may also start interactively and then answer '& -d' at any prompt to turn
2211 on the non-interactive behaviour for the remainder of the execution.
2217 Much effort has been expended to ensure that this shell script will run on any
2218 Unix system. If despite that it blows up on yours, your best bet is to edit
2219 Configure and run it again. If you can't run Configure for some reason,
2220 you'll have to generate a config.sh file by hand. Whatever problems you
2221 have, let me (perlbug@perl.org) know how I blew it.
2223 This installation script affects things in two ways:
2225 1) it may do direct variable substitutions on some of the files included
2227 2) it builds a config.h file for inclusion in C programs. You may edit
2228 any of these files as the need arises after running this script.
2230 If you make a mistake on a question, there is no easy way to back up to it
2231 currently. The easiest thing to do is to edit config.sh and rerun all the SH
2232 files. Configure will offer to let you do this before it runs the SH files.
2235 dflt='Type carriage return to continue'
2237 case "$firsttime" in
2238 true) echo $user >>../.config/instruct;;
2242 : find out where common programs are
2244 echo "Locating common programs..." >&4
2257 if test -d \$dir/\$thing; then
2263 for thisthing in \$dir/\$thing; do
2264 : just loop through to pick last item
2266 if test -f \$thisthing; then
2269 elif test "X$_exe" != X -a -f \$thisthing$_exe; then
2272 elif test -f \$dir/\$thing.exe; then
2273 if test -n "$DJGPP"; then
2274 echo \$dir/\$thing.exe
2275 elif test "$eunicefix" != ":"; then
2276 : on Eunice apparently
2330 pth=`echo $PATH | sed -e "s/$p_/ /g"`
2331 pth="$pth /lib /usr/lib"
2332 for file in $loclist; do
2336 if test -f "$xxx"; then
2339 echo "WARNING: no $xxx -- ignoring your setting for $file." >&4
2340 xxx=`./loc $file $file $pth`
2343 '') xxx=`./loc $file $file $pth`;;
2344 *) xxx=`./loc $xxx $xxx $pth`;;
2346 eval $file=$xxx$_exe
2350 echo $file is in $xxx.
2353 echo $file is in $xxx.
2356 echo "I don't know where '$file' is, and my life depends on it." >&4
2357 echo "Go find a public domain implementation or fix your PATH setting!" >&4
2363 echo "Don't worry if any of the following aren't found..."
2365 for file in $trylist; do
2369 if test -f "$xxx"; then
2372 echo "WARNING: no $xxx -- ignoring your setting for $file." >&4
2373 xxx=`./loc $file $file $pth`
2376 '') xxx=`./loc $file $file $pth`;;
2377 *) xxx=`./loc $xxx $xxx $pth`;;
2379 eval $file=$xxx$_exe
2383 echo $file is in $xxx.
2386 echo $file is in $xxx.
2389 echo "I don't see $file out there, $say."
2396 echo "Substituting grep for egrep."
2403 echo "Substituting cp for ln."
2412 echo "I can't find make or gmake, and my life depends on it." >&4
2413 echo "Go find a public domain implementation or fix your PATH setting!" >&4
2421 *) # We can't have osname yet.
2422 if test -f "/system/gnu_library/bin/ar.pm"; then # Stratus VOS
2423 # Assume that gmake, if found, is definitely GNU make
2424 # and prefer it over the system make.
2425 echo "Substituting gmake for make."
2433 echo "Hopefully test is built into your sh."
2436 if `sh -c "PATH= test true" >/dev/null 2>&1`; then
2437 echo "Using the test built into your sh."
2445 echo "Hopefully echo is built into your sh."
2450 echo "Checking compatibility between $echo and builtin echo (if any)..." >&4
2451 $echo $n "hi there$c" >foo1
2452 echo $n "hi there$c" >foo2
2453 if cmp foo1 foo2 >/dev/null 2>&1; then
2454 echo "They are compatible. In fact, they may be identical."
2461 They are not compatible! You are probably running ksh on a non-USG system.
2462 I'll have to use $echo instead of the builtin, since Bourne shell doesn't
2463 have echo built in and we may have to run some Bourne shell scripts. That
2464 means I'll have to use '$n$c' to suppress newlines now. Life is ridiculous.
2467 $echo $n "The star should be here-->$c"
2477 cat <<'EOSC' >>trygcc
2482 int main(int argc, char *argv[]) {
2486 if $cc -o try $ccflags $ldflags try.c; then
2489 echo "Uh-oh, the C compiler '$cc' doesn't seem to be working." >&4
2495 case "`$cc -v -c try.c 2>&1`" in
2498 if $test X"$trygcc" = Xyes; then
2499 if gcc -o try -c try.c; then
2501 echo "You seem to have a working gcc, though." >&4
2502 rp="Would you like to use it?"
2504 if $test -f myread; then
2507 if $test -f UU/myread; then
2510 echo "Cannot find myread, sorry. Aborting." >&2
2515 [yY]*) cc=gcc; ccname=gcc; ccflags=''; despair=no;
2516 if $test -f usethreads.cbu; then
2519 *** However, any setting of the C compiler flags (e.g. for thread support)
2520 *** has been lost. It may be necessary to pass -Dcc=gcc to Configure
2521 *** (together with e.g. -Dusethreads).
2537 cat <<'EOSC' >>checkcc
2542 int main(int argc, char *argv[]) {
2546 if $cc -o try $ccflags $ldflags try.c; then
2549 if $test X"$despair" = Xyes; then
2550 echo "Uh-oh, the C compiler '$cc' doesn't seem to be working." >&4
2553 You need to find a working C compiler.
2554 Either (purchase and) install the C compiler supplied by your OS vendor,
2555 or for a free C compiler try http://gcc.gnu.org/
2556 I cannot continue any further, aborting.
2565 : determine whether symbolic links are supported
2568 if $ln -s blurfl sym > /dev/null 2>&1 ; then
2569 echo "Symbolic links are supported." >&4
2572 echo "Symbolic links are NOT supported." >&4
2577 : determine whether symbolic links are supported
2581 echo "Checking how to test for symbolic links..." >&4
2583 if $test "X$issymlink" = X; then
2585 '') sh -c "PATH= test -h sym" >/dev/null 2>&1 ;;
2586 *) $newsh -c "PATH= test -h sym" >/dev/null 2>&1 ;;
2588 if test $? = 0; then
2591 echo "Your builtin 'test -h' may be broken." >&4
2594 *) pth=`echo $PATH | sed -e "s/$p_/ /g"`
2597 if test -f "$p/$test"; then
2606 echo "Trying external '$test -h'." >&4
2607 issymlink="$test -h"
2608 if $test ! -h sym >/dev/null 2>&1; then
2609 echo "External '$test -h' is broken, too." >&4
2617 if $test "X$issymlink" = X; then
2618 if $test -L sym 2>/dev/null; then
2619 issymlink="$test -L"
2620 echo "The builtin '$test -L' worked." >&4
2623 if $test "X$issymlink" != X; then
2624 echo "You can test for symbolic links with '$issymlink'." >&4
2626 echo "I do not know how you can test for symbolic links." >&4
2630 *) echo "No symbolic links, so not testing for their testing..." >&4
2636 case "$mksymlinks" in
2639 ''|'.') echo "Cannot create symlinks in the original directory." >&4
2642 *) case "$lns:$issymlink" in
2643 *"ln"*" -s:"*"test -"?)
2644 echo "Creating the symbolic links..." >&4
2645 echo "(First creating the subdirectories...)" >&4
2647 awk '{print $1}' $src/MANIFEST | grep / | sed 's:/[^/]*$::' | sort -u | while true; do
2649 test -z "$directory" && break
2653 if test ! -d t/base; then
2654 echo "Failed to create the subdirectories. Aborting." >&4
2657 echo "(Then creating the symlinks...)" >&4
2658 awk '{print $1}' $src/MANIFEST | while true; do
2660 test -z "$filename" && break
2661 if test -f $filename; then
2662 if $issymlink $filename; then
2666 if test -f $filename; then
2667 echo "$filename already exists, not symlinking."
2669 ln -s $src/$filename $filename
2673 if test ! -f t/base/lex.t; then
2674 echo "Failed to create the symlinks (t/base/lex.t missing). Aborting." >&4
2679 *) echo "(I cannot figure out how to do symbolic links, ignoring mksymlinks)." >&4
2688 case "$usecrosscompile" in
2690 $echo "Cross-compiling..."
2693 *-*-gcc) # A cross-compiling gcc, probably.
2694 targetarch=`$echo $cc|$sed 's/-gcc$//'`
2696 # leave out ld, choosing it is more complex
2698 ranlib=$targetarch-ranlib
2699 $echo 'extern int foo;' > try.c
2700 set X `$cc -v -E try.c 2>&1 | $awk '/^#include </,/^End of search /'|$grep '/include'`
2702 if $test $# -gt 0; then
2704 incpth="`$echo $incpth|$sed 's/^ //'`"
2705 echo "Guessing incpth '$incpth'." >&4
2707 j="`$echo $i|$sed 's,/include$,/lib,'`"
2708 if $test -d $j; then
2712 libpth="`$echo $libpth|$sed 's/^ //'`"
2713 echo "Guessing libpth '$libpth'." >&4
2718 case "$targetarch" in
2719 '') echo "Targetarch not defined." >&4; croak=y ;;
2720 *) echo "Using targetarch $targetarch." >&4 ;;
2723 '') echo "Incpth not defined." >&4; croak=y ;;
2724 *) echo "Using incpth '$incpth'." >&4 ;;
2727 '') echo "Libpth not defined." >&4; croak=y ;;
2728 *) echo "Using libpth '$libpth'." >&4 ;;
2731 '') for i in $incpth; do
2732 if $test -f $i/errno.h -a -f $i/stdio.h -a -f $i/time.h; then
2734 echo "Guessing usrinc $usrinc." >&4
2739 '') echo "Usrinc not defined." >&4; croak=y ;;
2742 *) echo "Using usrinc $usrinc." >&4 ;;
2744 case "$targethost" in
2745 '') echo "Targethost not defined." >&4; croak=y ;;
2746 *) echo "Using targethost $targethost." >&4
2751 y) echo "Cannot continue, aborting." >&4; exit 1 ;;
2754 /*) run=$src/Cross/run
2755 targetmkdir=$src/Cross/mkdir
2757 from=$src/Cross/from
2759 *) pwd=`$test -f ../Configure & cd ..; pwd`
2761 targetmkdir=$pwd/Cross/mkdir
2763 from=$pwd/Cross/from
2766 case "$targetrun" in
2767 '') targetrun=ssh ;;
2772 case "$targetfrom" in
2773 '') targetfrom=scp ;;
2777 from=$from-$targetfrom
2778 case "$targetdir" in
2780 echo "Guessing targetdir $targetdir." >&4
2783 case "$targetuser" in
2785 echo "Guessing targetuser $targetuser." >&4
2788 case "$targetfrom" in
2792 case "$targetrun" in
2804 '') cwd=$targetdir ;;
2808 if $test ! -f \$exe.xok; then
2812 $targetrun -l $targetuser $targethost "cd \$cwd && ./\$exe \$@"
2815 *) echo "Unknown targetrun '$targetrun'" >&4
2819 case "$targetmkdir" in
2821 cat >$targetmkdir <<EOF
2823 $targetrun -l $targetuser $targethost "mkdir -p \$@"
2825 $chmod a+rx $targetmkdir
2827 *) echo "Unknown targetmkdir '$targetmkdir'" >&4
2839 $targetmkdir \`dirname \$f\`
2840 $targetto $q \$f $targetuser@$targethost:\$f || exit 1
2843 $targetmkdir $targetdir/\`dirname \$f\`
2844 $targetto $q \$f $targetuser@$targethost:$targetdir/\$f || exit 1
2857 $mkdir -p $targetdir/\`dirname \$f\`
2858 $cp \$f $targetdir/\$f || exit 1
2861 $targetmkdir $targetdir/\`dirname \$f\`
2862 $cp \$f $targetdir/\$f || exit 1
2869 *) echo "Unknown targetto '$targetto'" >&4
2873 case "$targetfrom" in
2880 $targetfrom $q $targetuser@$targethost:$targetdir/\$f . || exit 1
2885 cp) cat >$from <<EOF
2890 cp $targetdir/\$f . || exit 1
2895 *) echo "Unknown targetfrom '$targetfrom'" >&4
2899 if $test ! -f $run; then
2900 echo "Target 'run' script '$run' not found." >&4
2904 if $test ! -f $to; then
2905 echo "Target 'to' script '$to' not found." >&4
2909 if $test ! -f $from; then
2910 echo "Target 'from' script '$from' not found." >&4
2914 if $test ! -f $run -o ! -f $to -o ! -f $from; then
2918 Using '$run' for remote execution,
2919 and '$from' and '$to'
2920 for remote file transfer.
2926 usecrosscompile='undef'
2931 : see whether [:lower:] and [:upper:] are supported character classes
2933 case "`echo AbyZ | $tr '[:lower:]' '[:upper:]' 2>/dev/null`" in
2935 echo "Good, your tr supports [:lower:] and [:upper:] to convert case." >&4
2939 *) # There is a discontinuity in EBCDIC between 'R' and 'S'
2940 # (0xd9 and 0xe2), therefore that is a nice testing point.
2941 if test "X$up" = X -o "X$low" = X; then
2942 case "`echo RS | $tr '[R-S]' '[r-s]' 2>/dev/null`" in
2948 if test "X$up" = X -o "X$low" = X; then
2949 case "`echo RS | $tr R-S r-s 2>/dev/null`" in
2955 if test "X$up" = X -o "X$low" = X; then
2956 case "`echo RS | od -x 2>/dev/null`" in
2958 echo "Hey, this might be EBCDIC." >&4
2959 if test "X$up" = X -o "X$low" = X; then
2960 case "`echo RS | $tr '[A-IJ-RS-Z]' '[a-ij-rs-z]' 2>/dev/null`" in
2961 rs) up='[A-IJ-RS-Z]'
2966 if test "X$up" = X -o "X$low" = X; then
2967 case "`echo RS | $tr A-IJ-RS-Z a-ij-rs-z 2>/dev/null`" in
2977 case "`echo RS | $tr \"$up\" \"$low\" 2>/dev/null`" in
2979 echo "Using $up and $low to convert case." >&4
2982 echo "I don't know how to translate letters from upper to lower case." >&4
2983 echo "Your tr is not acting any way I know of." >&4
2987 : set up the translation script tr, must be called with ./tr of course
2991 '[A-Z][a-z]') exec $tr '$up' '$low';;
2992 '[a-z][A-Z]') exec $tr '$low' '$up';;
2999 : Try to determine whether config.sh was made on this system
3000 case "$config_sh" in
3002 myuname=`$uname -a 2>/dev/null`
3003 $test -z "$myuname" && myuname=`hostname 2>/dev/null`
3004 # tr '[A-Z]' '[a-z]' would not work in EBCDIC
3005 # because the A-Z/a-z are not consecutive.
3006 myuname=`echo $myuname | $sed -e 's/^[^=]*=//' -e 's/\///g' | \
3007 ./tr '[A-Z]' '[a-z]' | $tr $trnl ' '`
3008 newmyuname="$myuname"
3010 case "$knowitall" in
3012 if test -f ../config.sh; then
3013 if $contains myuname= ../config.sh >/dev/null 2>&1; then
3014 eval "`grep myuname= ../config.sh`"
3016 if test "X$myuname" = "X$newmyuname"; then
3024 : Get old answers from old config file if Configure was run on the
3025 : same system, otherwise use the hints.
3028 if test -f config.sh; then
3030 rp="I see a config.sh file. Shall I use it to set the defaults?"
3033 n*|N*) echo "OK, I'll ignore it."
3034 mv config.sh config.sh.old
3035 myuname="$newmyuname"
3037 *) echo "Fetching default answers from your old config.sh file..." >&4
3045 : Older versions did not always set $sh. Catch re-use of such
3055 if test ! -f config.sh; then
3058 First time through, eh? I have some defaults handy for some systems
3059 that need some extra help getting the Configure answers right:
3062 (cd $src/hints; ls -C *.sh) | $sed 's/\.sh/ /g' >&4
3064 : Half the following guesses are probably wrong... If you have better
3065 : tests or hints, please send them to perlbug@perl.org
3066 : The metaconfig authors would also appreciate a copy...
3067 $test -f /irix && osname=irix
3068 $test -f /xenix && osname=sco_xenix
3069 $test -f /dynix && osname=dynix
3070 $test -f /dnix && osname=dnix
3071 $test -f /lynx.os && osname=lynxos
3072 $test -f /unicos && osname=unicos && osvers=`$uname -r`
3073 $test -f /unicosmk && osname=unicosmk && osvers=`$uname -r`
3074 $test -f /unicosmk.ar && osname=unicosmk && osvers=`$uname -r`
3075 $test -f /bin/mips && /bin/mips && osname=mips
3076 $test -d /NextApps && set X `hostinfo | grep 'NeXT Mach.*:' | \
3077 $sed -e 's/://' -e 's/\./_/'` && osname=next && osvers=$4
3078 $test -d /usr/apollo/bin && osname=apollo
3079 $test -f /etc/saf/_sactab && osname=svr4
3080 $test -d /usr/include/minix && osname=minix
3081 $test -f /system/gnu_library/bin/ar.pm && osname=vos
3082 if $test -d /MachTen -o -d /MachTen_Folder; then
3084 if $test -x /sbin/version; then
3085 osvers=`/sbin/version | $awk '{print $2}' |
3086 $sed -e 's/[A-Za-z]$//'`
3087 elif $test -x /usr/etc/version; then
3088 osvers=`/usr/etc/version | $awk '{print $2}' |
3089 $sed -e 's/[A-Za-z]$//'`
3095 $test -f /sys/posix.dll &&
3096 $test -f /usr/bin/what &&
3097 set X `/usr/bin/what /sys/posix.dll` &&
3098 $test "$3" = UWIN &&
3102 if $test -f $uname; then
3110 umips) osname=umips ;;
3113 [23]100) osname=mips ;;
3114 next*) osname=next ;;
3116 tmp=`/bin/uname -X 2>/dev/null|awk '/3\.2v[45]/{ print $(NF) }'`
3117 if $test "$tmp" != "" -a "$3" = "3.2" -a -f '/etc/systemid'; then
3120 elif $test -f /etc/kconfig; then
3122 if test "$lns" = "$ln -s"; then
3124 elif $contains _SYSV3 /usr/include/stdio.h > /dev/null 2>&1 ; then
3126 elif $contains _POSIX_SOURCE /usr/include/stdio.h > /dev/null 2>&1 ; then
3133 if test -n "$DJGPP"; then
3142 tmp=`( (oslevel) 2>/dev/null || echo "not found") 2>&1`
3144 # oslevel can fail with:
3145 # oslevel: Unable to acquire lock.
3146 *not\ found) osvers="$4"."$3" ;;
3147 '<3240'|'<>3240') osvers=3.2.0 ;;
3148 '=3240'|'>3240'|'<3250'|'<>3250') osvers=3.2.4 ;;
3149 '=3250'|'>3250') osvers=3.2.5 ;;
3153 bsd386) osname=bsd386
3156 cygwin*) osname=cygwin
3159 *dc.osx) osname=dcosx
3165 domainos) osname=apollo
3171 dragonfly) osname=dragonfly
3174 dynixptx*) osname=dynixptx
3175 osvers=`echo "$4"|sed 's/^v//'`
3177 freebsd) osname=freebsd
3179 genix) osname=genix ;;
3183 osvers=`echo "$3" | $sed 's,.*\.\([0-9]*\.[0-9]*\),\1,'`
3199 netbsd*) osname=netbsd
3202 news-os) osvers="$3"
3204 4*) osname=newsos4 ;;
3208 next*) osname=next ;;
3209 nonstop-ux) osname=nonstopux ;;
3210 openbsd) osname=openbsd
3216 POSIX-BC | posix-bc ) osname=posix-bc
3219 powerux | power_ux | powermax_os | powermaxos | \
3220 powerunix | power_unix) osname=powerux
3226 solaris) osname=solaris
3228 5*) osvers=`echo $3 | $sed 's/^5/2/g'` ;;
3235 osvers=`echo $3 | $sed 's/^5/2/g'` ;;
3239 titanos) osname=titanos
3248 ultrix) osname=ultrix
3251 osf1|mls+) case "$5" in
3254 osvers=`sizer -v | awk -FUNIX '{print $2}' | awk '{print $1}' | tr '[A-Z]' '[a-z]' | sed 's/^[xvt]//'`
3257 *) osvers=`echo "$3" | sed 's/^[xvt]//'` ;;
3260 hp*) osname=hp_osf1 ;;
3261 mips) osname=mips_osf1 ;;
3264 # UnixWare 7.1.2 is known as Open UNIX 8
3265 openunix|unixware) osname=svr5
3273 $2) case "$osname" in
3277 : svr4.x or possibly later
3287 if test -f /stand/boot ; then
3288 eval `grep '^INITPROG=[a-z/0-9]*$' /stand/boot`
3289 if test -n "$INITPROG" -a -f "$INITPROG"; then
3290 isesix=`strings -a $INITPROG|grep 'ESIX SYSTEM V/386 Release 4.0'`
3291 if test -n "$isesix"; then
3299 *) if test -f /etc/systemid; then
3301 set `echo $3 | $sed 's/\./ /g'` $4
3302 if $test -f $src/hints/sco_$1_$2_$3.sh; then
3304 elif $test -f $src/hints/sco_$1_$2.sh; then
3306 elif $test -f $src/hints/sco_$1.sh; then
3311 '') : Still unknown. Probably a generic Sys V.
3320 *) case "$osname" in
3321 '') : Still unknown. Probably a generic BSD.
3329 if test -f /vmunix -a -f $src/hints/news_os.sh; then
3330 (what /vmunix | UU/tr '[A-Z]' '[a-z]') > UU/kernel.what 2>&1
3331 if $contains news-os UU/kernel.what >/dev/null 2>&1; then
3334 $rm -f UU/kernel.what
3335 elif test -d c:/. -o -n "$is_os2" ; then
3342 case "$targetarch" in
3345 osname=`echo $targetarch|sed 's,^[^-]*-,,'`
3350 : Now look for a hint file osname_osvers, unless one has been
3351 : specified already.
3354 file=`echo "${osname}_${osvers}" | $sed -e 's%\.%_%g' -e 's%_$%%'`
3355 : Also try without trailing minor version numbers.
3356 xfile=`echo $file | $sed -e 's%_[^_]*$%%'`
3357 xxfile=`echo $xfile | $sed -e 's%_[^_]*$%%'`
3358 xxxfile=`echo $xxfile | $sed -e 's%_[^_]*$%%'`
3359 xxxxfile=`echo $xxxfile | $sed -e 's%_[^_]*$%%'`
3362 *) case "$osvers" in
3365 *) if $test -f $src/hints/$file.sh ; then
3367 elif $test -f $src/hints/$xfile.sh ; then
3369 elif $test -f $src/hints/$xxfile.sh ; then
3371 elif $test -f $src/hints/$xxxfile.sh ; then
3373 elif $test -f $src/hints/$xxxxfile.sh ; then
3375 elif $test -f "$src/hints/${osname}.sh" ; then
3384 if $test -f Policy.sh ; then
3387 none) dflt="Policy" ;;
3388 *) dflt="Policy $dflt" ;;
3393 dflt=`echo $hintfile | $sed 's/\.sh$//'`
3397 if $test -f Policy.sh ; then
3400 There's also a Policy hint file available, which should make the
3401 site-specific (policy) questions easier to answer.
3408 You may give one or more space-separated answers, or "none" if appropriate.
3409 If you have a handcrafted Policy.sh file or a Policy.sh file generated by a
3410 previous run of Configure, you may specify it as well as or instead of
3411 OS-specific hints. If hints are provided for your OS, you should use them:
3412 although Perl can probably be built without hints on many platforms, using
3413 hints often improve performance and may enable features that Configure can't
3414 set up on its own. If there are no hints that match your OS, specify "none";
3415 DO NOT give a wrong version or a wrong OS.
3419 rp="Which of these apply, if any?"
3422 for file in $tans; do
3423 if $test X$file = XPolicy -a -f Policy.sh; then
3425 $cat Policy.sh >> UU/config.sh
3426 elif $test -f $src/hints/$file.sh; then
3427 . $src/hints/$file.sh
3428 $cat $src/hints/$file.sh >> UU/config.sh
3429 elif $test X"$tans" = X -o X"$tans" = Xnone ; then
3432 : Give one chance to correct a possible typo.
3433 echo "$file.sh does not exist"
3435 rp="hint to use instead?"
3437 for file in $ans; do
3438 if $test -f "$src/hints/$file.sh"; then
3439 . $src/hints/$file.sh
3440 $cat $src/hints/$file.sh >> UU/config.sh
3441 elif $test X$ans = X -o X$ans = Xnone ; then
3444 echo "$file.sh does not exist -- ignored."
3451 : Remember our hint file for later.
3452 if $test -f "$src/hints/$file.sh" ; then
3462 echo "Fetching default answers from $config_sh..." >&4
3466 cp $config_sh config.sh 2>/dev/null
3476 test "$override" && . ./optdef.sh
3478 : Restore computed paths
3479 for file in $loclist $trylist; do
3480 eval $file="\$_$file"
3485 Configure uses the operating system name and version to set some defaults.
3486 The default value is probably right if the name rings a bell. Otherwise,
3487 since spelling matters for me, either accept the default or answer "none"
3494 ''|' '|none) dflt=none ;;
3495 *) dflt=`echo $hintfile | $sed -e 's/\.sh$//' -e 's/_.*$//'` ;;
3498 *) dflt="$osname" ;;
3500 rp="Operating system name?"
3504 *) osname=`echo "$ans" | $sed -e 's/[ ][ ]*/_/g' | ./tr '[A-Z]' '[a-z]'`;;
3510 ''|' '|none) dflt=none ;;
3511 *) dflt=`echo $hintfile | $sed -e 's/\.sh$//' -e 's/^[^_]*//'`
3512 dflt=`echo $dflt | $sed -e 's/^_//' -e 's/_/./g'`
3514 ''|' ') dflt=none ;;
3519 *) dflt="$osvers" ;;
3521 rp="Operating system version?"
3531 : who configured the system
3532 cf_time=`LC_ALL=C; LANGUAGE=C; export LC_ALL; export LANGUAGE; $date 2>&1`
3535 cf_by=`(logname) 2>/dev/null`
3538 cf_by=`(whoami) 2>/dev/null`
3540 "") cf_by=unknown ;;
3545 : decide how portable to be. Allow command line overrides.
3546 case "$d_portable" in
3548 *) d_portable="$define" ;;
3551 : set up shell script to do ~ expansion
3557 echo \$1 | $sed "s|~|\${HOME-\$LOGDIR}|"
3560 if $test -f /bin/csh; then
3561 /bin/csh -f -c "glob \$1"
3566 name=\`$expr x\$1 : '..\([^/]*\)'\`
3567 dir=\`$sed -n -e "/^\${name}:/{s/^[^:]*:[^:]*:[^:]*:[^:]*:[^:]*:\([^:]*\).*"'\$'"/\1/" -e p -e q -e '}' </etc/passwd\`
3568 if $test ! -d "\$dir"; then
3570 echo "\$me: can't locate home directory for: \$name" >&2
3575 echo \$dir/\`$expr x\$1 : '..[^/]*/\(.*\)'\`
3591 : now set up to get a file name
3595 cat <<'EOSC' >>getfile
3611 : getfile will accept an answer from the comma-separated list
3612 : enclosed in parentheses even if it does not meet other criteria.
3613 expr "$fn" : '.*(\(.*\)).*' | $tr ',' $trnl >getfile.ok
3614 fn=`echo $fn | sed 's/(.*)//'`
3620 loc_file=`expr $fn : '.*:\(.*\)'`
3621 fn=`expr $fn : '\(.*\):.*'`
3629 */*) fullpath=true;;
3638 *e*) exp_file=true;;
3641 *p*) nopath_ok=true;;
3646 *d*) type='Directory';;
3647 *l*) type='Locate';;
3652 Locate) what='File';;
3657 case "$d_portable" in
3665 while test "$type"; do
3670 true) rp="$rp (~name ok)";;
3673 if test -f UU/getfile.ok && \
3674 $contains "^$ans\$" UU/getfile.ok >/dev/null 2>&1
3693 value=`UU/filexp $ans`
3696 if test "$ans" != "$value"; then
3697 echo "(That expands to $value on this system.)"
3711 /*) value="$ansexp" ;;
3712 [a-zA-Z]:/*) value="$ansexp" ;;
3717 echo "I shall only accept a full path name, as in /bin/ls." >&4
3718 echo "Use a ! shell escape if you wish to check pathnames." >&4
3721 echo "Please give a full path name, starting with slash." >&4
3724 echo "Note that using ~name is ok provided it expands well." >&4
3737 for fp in $gfpth; do
3738 if test "X$fp" = X.; then
3743 if test -f "$pf"; then
3745 elif test -r "$pf" || (test -h "$pf") >/dev/null 2>&1
3747 echo "($value is not a plain file, but that's ok.)"
3750 if test X"$type" = X; then
3757 for fp in $gfpth; do
3758 if test "X$fp" = X.; then
3763 direxp="$fp/$ansexp"
3765 if test -d "$direxp"; then
3773 if test -d "$ansexp"; then
3774 echo "(Looking for $loc_file in directory $value.)"
3775 value="$value/$loc_file"
3776 ansexp="$ansexp/$loc_file"
3778 if test -f "$ansexp"; then
3781 case "$nopath_ok" in
3782 true) case "$value" in
3784 *) echo "Assuming $value will be in people's path."
3800 if test "$fastread" = yes; then
3805 rp="$what $value doesn't exist. Use that name anyway?"
3824 test "X$gfpthkeep" != Xy && gfpth=""
3827 : determine root of directory hierarchy where package will be installed.
3830 dflt=`./loc . /usr/local /usr/local /local /opt /usr`
3833 dflt=`echo "$prefix" | sed 's/.$//'`
3841 By default, $package will be installed in $dflt/bin, manual pages
3842 under $dflt/man, etc..., i.e. with $dflt as prefix for all
3843 installation directories. Typically this is something like /usr/local.
3844 If you wish to have binaries under /usr/bin but other parts of the
3845 installation under /usr/local, that's ok: you will be prompted
3846 separately for each of the installation directories, the prefix being
3847 only used to set the defaults.
3851 rp='Installation prefix to use?'
3859 *) oldprefix="$prefix";;
3868 *) afsroot=$afsroot ;;
3874 $define|true) afs=true ;;
3875 $undef|false) afs=false ;;
3876 *) if test -d $afsroot; then
3884 echo "AFS may be running... I'll be extra cautious then..." >&4
3886 echo "AFS does not seem to be running..." >&4
3889 : determine installation prefix for where package is to be installed.
3893 Since you are running AFS, I need to distinguish the directory in which
3894 files will reside from the directory in which they are installed (and from
3895 which they are presumably copied to the former directory by occult means).
3898 case "$installprefix" in
3899 '') dflt=`echo $prefix | sed 's#^/afs/#/afs/.#'`;;
3900 *) dflt="$installprefix";;
3905 In some special cases, particularly when building $package for distribution,
3906 it is convenient to distinguish the directory in which files should be
3907 installed from the directory ($prefix) in which they will
3908 eventually reside. For most users, these two directories are the same.
3911 case "$installprefix" in
3913 *) dflt=$installprefix;;
3917 rp='What installation prefix should I use for installing files?'
3919 installprefix="$ans"
3920 installprefixexp="$ansexp"
3922 : Perform the prefixexp/installprefixexp correction if necessary
3923 cat <<EOS >installprefix
3926 cat <<'EOSC' >>installprefix
3927 : Change installation prefix, if necessary.
3928 if $test X"$prefix" != X"$installprefix"; then
3929 eval "install${prefixvar}=\`echo \$${prefixvar}exp | sed \"s#^\$prefixexp#\$installprefixexp#\"\`"
3931 eval "install${prefixvar}=\"\$${prefixvar}exp\""
3934 chmod +x installprefix
3935 $eunicefix installprefix
3937 : Set variables such as privlib and privlibexp from the output of ./getfile
3938 : performing the prefixexp/installprefixexp correction if necessary.
3939 cat <<EOS >setprefixvar
3942 cat <<'EOSC' >>setprefixvar
3943 eval "${prefixvar}=\"\$ans\""
3944 eval "${prefixvar}exp=\"\$ansexp\""
3947 chmod +x setprefixvar
3948 $eunicefix setprefixvar
3950 : set up the script used to warn in case of inconsistency
3959 '') echo "The $hint value for \$$var on this machine was \"$was\"!" >&4
3961 *) echo "Hmm. Based on the hints in hints/$hintfile.sh, " >&4
3962 echo "the $hint value for \$$var on this machine was \"$was\"!" >&4
3967 echo "*** WHOA THERE!!! ***" >&4
3968 echo " The $hint value for \$$var on this machine was \"$was\"!" >&4
3971 rp=" Keep the $hint value?"
3974 y) td=$was; tu=$was;;
3978 : function used to set $1 to $val
3979 setvar='var=$1; eval "was=\$$1"; td=$define; tu=$undef;
3981 $define$undef) . ./whoa; eval "$var=\$td";;
3982 $undef$define) . ./whoa; eval "$var=\$tu";;
3983 *) eval "$var=$val";;
3987 $define|true|[yY]*) dflt='y';;
3992 Perl can be built to use the SOCKS proxy protocol library. To do so,
3993 Configure must be run with -Dusesocks. If you use SOCKS you also need
3994 to use the PerlIO abstraction layer, this will be implicitly selected.
3996 If this doesn't make any sense to you, just accept the default '$dflt'.
3998 rp='Build Perl for SOCKS?'
4001 y|Y) val="$define" ;;
4008 $define|true|[yY]*) useperlio="$define";;
4011 case "$useperlio" in
4012 $define|true|[yY]*|'') dflt='y';;
4017 Previous version of $package used the standard IO mechanisms as
4018 defined in <stdio.h>. Versions 5.003_02 and later of $package allow
4019 alternate IO mechanisms via the PerlIO abstraction layer, but the
4020 stdio mechanism is still available if needed. The abstraction layer
4021 can use AT&T's sfio (if you already have sfio installed) or regular stdio.
4022 Using PerlIO with sfio may cause problems with some extension modules.
4024 If this doesn't make any sense to you, just accept the default '$dflt'.
4026 rp='Use the PerlIO abstraction layer?'
4033 echo "Ok, doing things the stdio way."
4042 case "$useperlio" in
4043 $define|true|[yY]*) ;;
4046 You are using the SOCKS proxy protocol library which means that you
4047 should also use the PerlIO layer. You may be headed for trouble.
4056 : get the patchlevel
4058 echo "Getting the current patchlevel..." >&4
4059 if $test -r $rsrc/patchlevel.h;then
4060 revision=`awk '/define[ ]+PERL_REVISION/ {print $3}' $rsrc/patchlevel.h`
4061 patchlevel=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
4062 subversion=`awk '/define[ ]+PERL_SUBVERSION/ {print $3}' $rsrc/patchlevel.h`
4063 api_revision=`awk '/define[ ]+PERL_API_REVISION/ {print $3}' $rsrc/patchlevel.h`
4064 api_version=`awk '/define[ ]+PERL_API_VERSION/ {print $3}' $rsrc/patchlevel.h`
4065 api_subversion=`awk '/define[ ]+PERL_API_SUBVERSION/ {print $3}' $rsrc/patchlevel.h`
4066 perl_patchlevel=`egrep 'define PERL_PATCHNUM [0-9][0-9]|,"MAINT[0-9][0-9]*"' $rsrc/patchlevel.h|sed 's/[^0-9]//g'`
4075 $echo "(You do not have patchlevel.h. Eek.)"
4077 if $test -r $rsrc/.patch ; then
4078 if $test "X$perl_patchlevel" = "X" || $test "`cat $rsrc/.patch`" -gt "$perl_patchlevel" ; then
4079 perl_patchlevel=`cat $rsrc/.patch`
4082 : Define a handy string here to avoid duplication in myconfig.SH and configpm.
4083 version_patchlevel_string="version $patchlevel subversion $subversion"
4084 case "$perl_patchlevel" in
4086 *) version_patchlevel_string="$version_patchlevel_string patch $perl_patchlevel" ;;
4089 $echo "(You have $package $version_patchlevel_string.)"
4093 : XXX Should be a Configure test for double-dots in filenames.
4094 version=`echo $revision $patchlevel $subversion | \
4095 $awk '{ printf "%d_%d_%d\n", $1, $2, $3 }'`
4096 api_versionstring=`echo $api_revision $api_version $api_subversion | \
4097 $awk '{ printf "%d_%d_%d\n", $1, $2, $3 }'`
4100 version=`echo $revision $patchlevel $subversion | \
4101 $awk '{ printf "%d.%d.%d\n", $1, $2, $3 }'`
4102 api_versionstring=`echo $api_revision $api_version $api_subversion | \
4103 $awk '{ printf "%d.%d.%d\n", $1, $2, $3 }'`
4106 : Special case the 5.005_xx maintenance series, which used 5.005
4107 : without any subversion label as a subdirectory in $sitelib
4108 if test "${api_revision}${api_version}${api_subversion}" = "550"; then
4109 api_versionstring='5.005'
4112 case "$usethreads" in
4113 $define|true|[yY]*) dflt='y';;
4114 *) # Catch case where user specified ithreads or 5005threads but
4115 # forgot -Dusethreads (A.D. 4/2002)
4116 case "$useithreads$use5005threads" in
4118 case "$useperlio" in
4119 "$define") dflt='y' ;;
4129 Perl can be built to take advantage of threads on some systems.
4130 To do so, Configure can be run with -Dusethreads.
4132 Note that Perl built with threading support runs slightly slower
4133 and uses more memory than plain Perl. The current implementation
4134 is believed to be stable, but it is fairly new, and so should be
4135 treated with caution.
4137 If this doesn't make any sense to you, just accept the default '$dflt'.
4139 rp='Build a threading Perl?'
4142 y|Y) val="$define" ;;
4148 if $test $patchlevel -lt 9; then
4149 case "$usethreads" in
4153 Since release 5.6, Perl has had two different threading implementations,
4154 the newer interpreter-based version (ithreads) with one interpreter per
4155 thread, and the older 5.005 version (5005threads).
4156 The 5005threads version is effectively unmaintained and will probably be
4157 removed in Perl 5.10, so there should be no need to build a Perl using it
4158 unless needed for backwards compatibility with some existing 5.005threads
4162 : Default to ithreads unless overridden on command line or with
4165 case "$use5005threads" in
4166 $define|true|[yY]*) dflt='n';;
4168 case "$useithreads" in
4169 $undef|false|[nN]*) dflt='n';;
4171 rp='Use the newer interpreter-based ithreads?'
4174 y|Y) val="$define" ;;
4179 : Now set use5005threads to the opposite value.
4180 case "$useithreads" in
4181 $define) val="$undef" ;;
4188 useithreads="$undef"
4189 use5005threads="$undef"
4193 case "$useithreads$use5005threads" in
4197 You cannot have both the ithreads and the 5.005 threads enabled
4198 at the same time. Disabling the 5.005 threads since they are
4199 much less stable than the ithreads.
4202 use5005threads="$undef"
4207 : perl-5.9.x and later
4209 use5005threads="$undef"
4210 case "$usethreads" in
4212 : Default to ithreads unless overridden on command line or with
4215 case "$useithreads" in
4216 $undef|false|[nN]*) dflt='n';;
4218 rp='Use the newer interpreter-based ithreads?'
4221 y|Y) val="$define" ;;
4228 useithreads="$undef"
4234 if test X"$usethreads" = "X$define" -a "X$useperlio" = "Xundef"; then
4237 *** To build with ithreads you must also use the PerlIO layer.
4238 *** Cannot continue, aborting.
4244 case "$d_oldpthreads" in
4245 '') : Configure tests would be welcome here. For now, assume undef.
4247 *) val="$d_oldpthreads" ;;
4253 : Look for a hint-file generated 'call-back-unit'. If the
4254 : user has specified that a threading perl is to be built,
4255 : we may need to set or change some other defaults.
4256 if $test -f usethreads.cbu; then
4257 echo "Your platform has some specific hints regarding threaded builds, using them..."
4260 case "$usethreads" in
4261 "$define"|true|[yY]*)
4263 (Your platform does not have any specific hints for threaded builds.
4264 Assuming POSIX threads, then.)
4272 Perl can be built so that multiple Perl interpreters can coexist
4273 within the same Perl executable.
4276 case "$useithreads" in
4279 This multiple interpreter support is required for interpreter-based threads.
4283 *) case "$usemultiplicity" in
4284 $define|true|[yY]*) dflt='y';;
4288 echo "If this doesn't make any sense to you, just accept the default '$dflt'."
4289 rp='Build Perl for multiplicity?'
4292 y|Y) val="$define" ;;
4301 case "$usemorebits" in
4302 "$define"|true|[yY]*)
4303 use64bitint="$define"
4304 uselongdouble="$define"
4305 usemorebits="$define"
4307 *) usemorebits="$undef"
4311 : make some quick guesses about what we are up against
4313 $echo $n "Hmm... $c"
4323 $cat /usr/include/signal.h /usr/include/sys/signal.h >foo 2>/dev/null
4324 if test -f /osf_boot || $contains 'OSF/1' /usr/include/ctype.h >/dev/null 2>&1
4326 echo "Looks kind of like an OSF/1 system, but we'll see..."
4328 elif test `echo abc | $tr a-z A-Z` = Abc ; then
4329 xxx=`./loc addbib blurfl $pth`
4330 if $test -f $xxx; then
4331 echo "Looks kind of like a USG system with BSD features, but we'll see..."
4335 if $contains SIGTSTP foo >/dev/null 2>&1 ; then
4336 echo "Looks kind of like an extended USG system, but we'll see..."
4338 echo "Looks kind of like a USG system, but we'll see..."
4342 elif $contains SIGTSTP foo >/dev/null 2>&1 ; then
4343 echo "Looks kind of like a BSD system, but we'll see..."
4347 echo "Looks kind of like a Version 7 system, but we'll see..."
4350 case "$eunicefix" in
4353 There is, however, a strange, musty smell in the air that reminds me of
4354 something...hmm...yes...I've got it...there's a VMS nearby, or I'm a Blit.
4358 : it so happens the Eunice I know will not run shell scripts in Unix format
4362 echo "Congratulations. You aren't running Eunice."
4366 : Detect OS2. The p_ variable is set above in the Head.U unit.
4367 : Note that this also -- wrongly -- detects e.g. dos-djgpp, which also uses
4368 : semicolon as a patch separator
4373 I have the feeling something is not exactly right, however...don't tell me...
4374 lemme think...does HAL ring a bell?...no, of course, you're only running OS/2!
4375 (Or you may be running DOS with DJGPP.)
4380 if test -f /xenix; then
4381 echo "Actually, this looks more like a XENIX system..."
4386 echo "It's not Xenix..."
4391 if test -f /venix; then
4392 echo "Actually, this looks more like a VENIX system..."
4399 echo "Nor is it Venix..."
4402 chmod +x bsd usg v7 osf1 eunice xenix venix os2
4403 $eunicefix bsd usg v7 osf1 eunice xenix venix os2
4410 rp="Use which C compiler?"
4414 : See if they have not cc but they do have gcc
4416 : Look for a hint-file generated 'call-back-unit'. Now that the
4417 : user has specified the compiler, we may need to set or change some
4419 if $test -f cc.cbu; then
4425 echo "Checking for GNU cc in disguise and/or its version number..." >&4
4429 #if defined(__GNUC__) && !defined(__INTEL_COMPILER)
4431 printf("%s\n", __VERSION__);
4433 printf("%s\n", "1");
4439 if $cc -o try $ccflags $ldflags try.c; then
4440 gccversion=`$run ./try`
4441 case "$gccversion" in
4442 '') echo "You are not using GNU cc." ;;
4443 *) echo "You are using GNU cc $gccversion."
4449 echo "*** WHOA THERE!!! ***" >&4
4450 echo " Your C compiler \"$cc\" doesn't seem to be working!" >&4
4451 case "$knowitall" in
4453 echo " You'd better start hunting for one and let me know about it." >&4
4459 case "$gccversion" in
4460 1*) cpp=`./loc gcc-cpp $cpp $pth` ;;
4462 case "$gccversion" in
4463 '') gccosandvers='' ;;
4464 *) gccshortvers=`echo "$gccversion"|sed 's/ .*//'`
4465 gccosandvers=`$cc -v 2>&1|grep '/specs$'|sed "s!.*/[^-/]*-[^-/]*-\([^-/]*\)/$gccshortvers/specs!\1!"`
4467 case "$gccosandvers" in
4468 $osname) gccosandvers='' ;; # linux gccs seem to have no linux osvers, grr
4469 $osname$osvers) ;; # looking good
4470 $osname*) cat <<EOM >&4
4472 *** WHOA THERE!!! ***
4474 Your gcc has not been compiled for the exact release of
4475 your operating system ($gccosandvers versus $osname$osvers).
4477 In general it is a good idea to keep gcc synchronized with
4478 the operating system because otherwise serious problems
4479 may ensue when trying to compile software, like Perl.
4481 I'm trying to be optimistic here, though, and will continue.
4482 If later during the configuration and build icky compilation
4483 problems appear (headerfile conflicts being the most common
4484 manifestation), I suggest reinstalling the gcc to match
4485 your operating system release.
4489 *) gccosandvers='' ;; # failed to parse, better be silent
4497 # gcc 3.* complain about adding -Idirectories that they already know about,
4498 # so we will take those off from locincpth.
4499 case "$gccversion" in
4501 echo "main(){}">try.c
4502 for incdir in $locincpth; do
4503 warn=`$cc $ccflags -I$incdir -c try.c 2>&1 | \
4504 grep '^c[cp]p*[01]: warning: changing search order '`
4505 if test "X$warn" != X; then
4506 locincpth=`echo " $locincpth " | sed "s! $incdir ! !"`
4512 : What should the include directory be ?
4514 $echo $n "Hmm... $c"
4518 if $test -f /bin/mips && /bin/mips; then
4519 echo "Looks like a MIPS system..."
4520 $cat >usr.c <<'EOCP'
4521 #ifdef SYSTYPE_BSD43
4525 if cc -E usr.c > usr.out && $contains / usr.out >/dev/null 2>&1; then
4526 dflt='/bsd43/usr/include'
4530 mips_type='System V'
4532 $rm -f usr.c usr.out
4533 echo "and you're compiling with the $mips_type compiler and libraries."
4537 echo "Doesn't look like a MIPS system."
4547 case "$xxx_prompt" in
4550 rp='Where are the include files you want to use?'
4558 : see how we invoke the C preprocessor
4560 echo "Now, how can we feed standard input to your C preprocessor..." >&4
4561 cat <<'EOT' >testcpp.c
4567 if test ! -f cppstdin; then
4568 if test "X$osname" = "Xaix" -a "X$gccversion" = X; then
4569 # AIX cc -E doesn't show the absolute headerfile
4570 # locations but we'll cheat by using the -M flag.
4571 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
4573 echo 'cat >.$$.c; '"$cc"' -E ${1+"$@"} .$$.c; rm .$$.c' >cppstdin
4576 echo "Keeping your $hint cppstdin wrapper."
4579 wrapper=`pwd`/cppstdin
4583 if $test "X$cppstdin" != "X" && \
4584 $cppstdin $cppminus <testcpp.c >testcpp.out 2>&1 && \
4585 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
4587 echo "You used to use $cppstdin $cppminus so we'll use that again."
4589 '') echo "But let's see if we can live without a wrapper..." ;;
4591 if $cpprun $cpplast <testcpp.c >testcpp.out 2>&1 && \
4592 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
4594 echo "(And we'll use $cpprun $cpplast to preprocess directly.)"
4597 echo "(However, $cpprun $cpplast does not work, let's see...)"
4605 echo "Good old $cppstdin $cppminus does not seem to be of any help..."
4612 elif echo 'Maybe "'"$cc"' -E" will work...'; \
4613 $cc -E <testcpp.c >testcpp.out 2>&1; \
4614 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4615 echo "Yup, it does."
4618 elif echo 'Nope...maybe "'"$cc"' -E -" will work...'; \
4619 $cc -E - <testcpp.c >testcpp.out 2>&1; \
4620 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4621 echo "Yup, it does."
4624 elif echo 'Nope...maybe "'"$cc"' -P" will work...'; \
4625 $cc -P <testcpp.c >testcpp.out 2>&1; \
4626 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4627 echo "Yipee, that works!"
4630 elif echo 'Nope...maybe "'"$cc"' -P -" will work...'; \
4631 $cc -P - <testcpp.c >testcpp.out 2>&1; \
4632 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4633 echo "At long last!"
4636 elif echo 'No such luck, maybe "'$cpp'" will work...'; \
4637 $cpp <testcpp.c >testcpp.out 2>&1; \
4638 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4642 elif echo 'Nixed again...maybe "'$cpp' -" will work...'; \
4643 $cpp - <testcpp.c >testcpp.out 2>&1; \
4644 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4645 echo "Hooray, it works! I was beginning to wonder."
4648 elif echo 'Uh-uh. Time to get fancy. Trying a wrapper...'; \
4649 $wrapper <testcpp.c >testcpp.out 2>&1; \
4650 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4656 rp="No dice. I can't find a C preprocessor. Name one:"
4660 $x_cpp <testcpp.c >testcpp.out 2>&1
4661 if $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4662 echo "OK, that will do." >&4
4664 echo "Sorry, I can't get that to work. Go find one and rerun Configure." >&4
4679 echo "Perhaps can we force $cc -E using a wrapper..."
4680 if $wrapper <testcpp.c >testcpp.out 2>&1; \
4681 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
4687 echo "Nope, we'll have to live without it..."
4701 "$wrapper"|'cppstdin') ;;
4702 *) $rm -f $wrapper;;
4704 $rm -f testcpp.c testcpp.out
4706 : Set private lib path
4709 plibpth="$incpath/usr/lib /usr/local/lib /usr/ccs/lib"
4714 '') dlist="$loclibpth $plibpth $glibpth";;
4715 *) dlist="$libpth";;
4718 : Now check and see which directories actually exist, avoiding duplicates
4722 if $test -d $xxx; then
4725 *) libpth="$libpth $xxx";;
4731 Some systems have incompatible or broken versions of libraries. Among
4732 the directories listed in the question below, please remove any you
4733 know not to be holding relevant libraries, and add any that are needed.
4734 Say "none" for none.
4745 rp="Directories to use for library searches?"
4752 : compute shared library extension
4755 if xxx=`./loc libc.sl X $libpth`; $test -f "$xxx"; then
4765 On some systems, shared libraries may be available. Answer 'none' if
4766 you want to suppress searching of shared libraries for the remainder
4767 of this configuration.
4770 rp='What is the file extension used for shared libraries?'
4774 : Define several unixisms.
4775 : Hints files or command line option can be used to override them.
4776 : The convoluted testing is in case hints files set either the old
4779 '') case "$exe_ext" in
4781 *) _exe="$exe_ext" ;;
4786 '') case "$lib_ext" in
4793 '') case "$obj_ext" in
4800 '') case "$path_sep" in
4811 rm_try="$rm -f try try$_exe a.out .out try.[cho] try.$_o core core.try* try.core*"
4813 : Which makefile gets called first. This is used by make depend.
4814 case "$firstmakefile" in
4815 '') firstmakefile='makefile';;
4819 *-DUSE_LONG_DOUBLE*|*-DUSE_MORE_BITS*) uselongdouble="$define" ;;
4822 case "$uselongdouble" in
4823 $define|true|[yY]*) dflt='y';;
4828 Perl can be built to take advantage of long doubles which
4829 (if available) may give more accuracy and range for floating point numbers.
4831 If this doesn't make any sense to you, just accept the default '$dflt'.
4833 rp='Try to use long doubles if available?'
4836 y|Y) val="$define" ;;
4842 case "$uselongdouble" in
4843 true|[yY]*) uselongdouble="$define" ;;
4846 : Look for a hint-file generated 'call-back-unit'. If the
4847 : user has specified that long doubles should be used,
4848 : we may need to set or change some other defaults.
4849 if $test -f uselongdouble.cbu; then
4850 echo "Your platform has some specific hints regarding long doubles, using them..."
4851 . ./uselongdouble.cbu
4853 case "$uselongdouble" in
4856 (Your platform does not have any specific hints for long doubles.)
4862 : Looking for optional libraries
4864 echo "Checking for optional libraries..." >&4
4869 case "$libswanted" in
4870 '') libswanted='c_s';;
4873 "$define") libswanted="$libswanted socks5 socks5_sh" ;;
4879 for thisdir in $libpth $xlibpth; do
4880 test -d $thisdir && libspath="$libspath $thisdir"
4882 for thislib in $libswanted; do
4883 for thisdir in $libspath; do
4885 if $test ! -f "$xxx" -a "X$ignore_versioned_solibs" = "X"; then
4886 xxx=`ls $thisdir/lib$thislib.$so.[0-9] 2>/dev/null|sed -n '$p'`
4887 $test -f "$xxx" && eval $libscheck
4888 $test -f "$xxx" && libstyle=shared
4890 if test ! -f "$xxx"; then
4891 xxx=$thisdir/lib$thislib.$so
4892 $test -f "$xxx" && eval $libscheck
4893 $test -f "$xxx" && libstyle=shared
4895 if test ! -f "$xxx"; then
4896 xxx=$thisdir/lib$thislib$_a
4897 $test -f "$xxx" && eval $libscheck
4898 $test -f "$xxx" && libstyle=static
4900 if test ! -f "$xxx"; then
4901 xxx=$thisdir/$thislib$_a
4902 $test -f "$xxx" && eval $libscheck
4903 $test -f "$xxx" && libstyle=static
4905 if test ! -f "$xxx"; then
4906 xxx=$thisdir/lib${thislib}_s$_a
4907 $test -f "$xxx" && eval $libscheck
4908 $test -f "$xxx" && libstyle=static
4909 $test -f "$xxx" && thislib=${thislib}_s
4911 if test ! -f "$xxx"; then
4912 xxx=$thisdir/Slib$thislib$_a
4913 $test -f "$xxx" && eval $libscheck
4914 $test -f "$xxx" && libstyle=static
4916 if $test -f "$xxx"; then
4918 shared) echo "Found -l$thislib (shared)." ;;
4919 static) echo "Found -l$thislib." ;;
4920 *) echo "Found -l$thislib ($libstyle)." ;;
4924 *) dflt="$dflt -l$thislib"
4925 libsfound="$libsfound $xxx"
4927 libsfiles="$libsfiles $yyy"
4928 yyy=`echo $xxx|$sed -e "s%/$yyy\\$%%"`
4929 case " $libsdirs " in
4931 *) libsdirs="$libsdirs $yyy" ;;
4938 if $test ! -f "$xxx"; then
4939 echo "No -l$thislib."
4950 ' '|'') dflt='none';;
4955 In order to compile $package on your machine, a number of libraries
4956 are usually needed. Include any other special libraries here as well.
4957 Say "none" for none. The default list is almost always right.
4961 rp="What libraries to use?"
4968 : determine optimization, if desired, or use for debug flag also
4970 ' '|$undef) dflt='none';;
4972 *) dflt="$optimize";;
4976 By default, $package compiles with the -O flag to use the optimizer.
4977 Alternately, you might want to use the symbolic debugger, which uses
4978 the -g flag (on traditional Unix systems). Either flag can be
4979 specified here. To use neither flag, specify the word "none".
4982 rp="What optimizer/debugger flag should be used?"
4986 'none') optimize=" ";;
4989 : Check what DEBUGGING is required from the command line
4990 : -DEBUGGING or -DDEBUGGING or
4991 : -DEBUGGING=both = -g + -DDEBUGGING
4992 : -DEBUGGING=-g or -Doptimize=-g = -g
4993 : -DEBUGGING=none or -UDEBUGGING =
4994 : -DEBUGGING=old or -DEBUGGING=default = ? $optimize
4997 *) DEBUGGING=$EBUGGING ;;
5000 case "$DEBUGGING" in
5004 *) optimize="$optimize -g" ;;
5008 *-g*) set `echo "X $optimize " | sed 's/ -g / /'`
5016 case "$DEBUGGING" in
5017 both|$define) dflt='-DDEBUGGING'
5020 : We will not override a previous value, but we might want to
5021 : augment a hint file
5023 default|recommended)
5024 case "$gccversion" in
5025 1*) dflt="$dflt -fpcc-struct-return" ;;
5027 case "$optimize:$DEBUGGING" in
5028 *-g*:old) dflt="$dflt -DDEBUGGING";;
5030 case "$gccversion" in
5031 2*) if test -d /etc/conf/kconfig.d &&
5032 $contains _POSIX_VERSION $usrinc/sys/unistd.h >/dev/null 2>&1
5034 # Interactive Systems (ISC) POSIX mode.
5039 case "$gccversion" in
5043 echo "Checking if your compiler accepts -fno-strict-aliasing" 2>&1
5044 echo 'int main(void) { return 0; }' > gcctest.c
5045 if $cc -O2 -fno-strict-aliasing -o gcctest gcctest.c; then
5046 echo "Yes, it does." 2>&1
5049 echo "Leaving current flags $ccflags alone." 2>&1
5051 *) dflt="$dflt -fno-strict-aliasing" ;;
5054 echo "Nope, it doesn't, but that's ok." 2>&1
5058 # For gcc, adding -pipe speeds up compilations for some, but apparently
5059 # some assemblers can't read from stdin. (It also slows down compilations
5060 # in other cases, but those are apparently rarer these days.) AD 5/2004.
5061 case "$gccversion" in
5063 echo "Checking if your compiler accepts -pipe" 2>&1
5064 echo 'int main(void) { return 0; }' > gcctest.c
5065 if $cc -pipe -o gcctest gcctest.c; then
5066 echo "Yes, it does." 2>&1
5069 echo "Leaving current flags $ccflags alone." 2>&1
5071 *) dflt="$dflt -pipe" ;;
5074 echo "Nope, it doesn't, but that's ok." 2>&1
5081 case "$mips_type" in
5082 *BSD*|'') inclwanted="$locincpth $usrinc";;
5083 *) inclwanted="$locincpth $inclwanted $usrinc/bsd";;
5085 for thisincl in $inclwanted; do
5086 if $test -d $thisincl; then
5087 if $test x$thisincl != x$usrinc; then
5089 *" -I$thisincl "*);;
5090 *) dflt="$dflt -I$thisincl ";;
5096 inctest='if $contains $2 $usrinc/$1 >/dev/null 2>&1; then
5098 elif $contains $2 $usrinc/sys/$1 >/dev/null 2>&1; then
5106 *) dflt="$dflt -D$2";;
5110 set signal.h LANGUAGE_C; eval $inctest
5114 ccflags="$ccflags -DSOCKS"
5119 default|recommended) dflt="$ccflags $dflt" ;;
5120 *) dflt="$ccflags";;
5129 Your C compiler may want other flags. For this question you should include
5130 -I/whatever and -DWHATEVER flags and any other flags used by the C compiler,
5131 but you should NOT include libraries or ld flags like -lwhatever. If you
5132 want $package to honor its debug switch, you should include -DDEBUGGING here.
5133 Your C compiler might also need additional flags, such as -D_POSIX_SOURCE.
5135 To use no flags, specify the word "none".
5141 rp="Any additional cc flags?"
5148 : the following weeds options from ccflags that are of no interest to cpp
5150 '') cppflags="$ccflags" ;;
5151 *) cppflags="$cppflags $ccflags" ;;
5153 case "$gccversion" in
5154 1*) cppflags="$cppflags -D__GNUC__"
5156 case "$mips_type" in
5158 *BSD*) cppflags="$cppflags -DSYSTYPE_BSD43";;
5164 echo "Let me guess what the preprocessor flags are..." >&4
5178 *) ftry="$previous $flag";;
5180 if $cppstdin -DLFRULB=bar $cppflags $ftry $cppminus <cpp.c \
5181 >cpp1.out 2>/dev/null && \
5182 $cpprun -DLFRULB=bar $cppflags $ftry $cpplast <cpp.c \
5183 >cpp2.out 2>/dev/null && \
5184 $contains 'foo.*xx.*bar' cpp1.out >/dev/null 2>&1 && \
5185 $contains 'foo.*xx.*bar' cpp2.out >/dev/null 2>&1
5187 cppflags="$cppflags $ftry"
5197 *-*) echo "They appear to be: $cppflags";;
5199 $rm -f cpp.c cpp?.out
5203 : flags used in final linking phase
5205 '') if ./venix; then
5211 *-posix*) dflt="$dflt -posix" ;;
5214 *) dflt="$ldflags";;
5217 : Try to guess additional flags to pick up local libraries.
5218 for thislibdir in $libpth; do
5219 case " $loclibpth " in
5222 *"-L$thislibdir "*) ;;
5223 *) dflt="$dflt -L$thislibdir" ;;
5235 Your C linker may need flags. For this question you should
5236 include -L/whatever and any other flags used by the C linker, but you
5237 should NOT include libraries like -lwhatever.
5239 Make sure you include the appropriate -L/path flags if your C linker
5240 does not normally search all of the directories you specified above,
5243 To use no flags, specify the word "none".
5247 rp="Any additional ld flags (NOT including libraries)?"
5253 rmlist="$rmlist pdp11"
5257 echo "Checking your choice of C compiler and flags for coherency..." >&4
5258 $cat > try.c <<'EOF'
5260 int main() { printf("Ok\n"); return(0); }
5262 set X $cc -o try $optimize $ccflags $ldflags try.c $libs
5264 $cat >try.msg <<'EOM'
5265 I've tried to compile and run the following simple program:
5268 $cat try.c >> try.msg
5270 $cat >> try.msg <<EOM
5277 and I got the following output:
5281 if $sh -c "$cc -o try $optimize $ccflags $ldflags try.c $libs" >>try.msg 2>&1; then
5282 if $sh -c "$run ./try" >>try.msg 2>&1; then
5286 *) echo 'The program compiled OK, but produced no output.' >> try.msg
5289 cat >> try.msg <<'EOQS'
5290 If $libs contains -lsfio, and sfio is mis-configured, then it
5291 sometimes (apparently) runs and exits with a 0 status, but with no
5292 output! It may have to do with sfio's use of _exit vs. exit.
5295 rp="You have a big problem. Shall I abort Configure"
5302 echo "The program compiled OK, but exited with status $?." >>try.msg
5303 rp="You have a problem. Shall I abort Configure"
5307 echo "I can't compile the test program." >>try.msg
5308 rp="You have a BIG problem. Shall I abort Configure"
5314 case "$knowitall" in
5316 echo "(The supplied flags or libraries might be incorrect.)"
5324 *) echo "Ok. Stopping Configure." >&4
5329 n) echo "OK, that should do.";;
5333 : define a shorthand compile call
5337 $cc -o ${mc_file} $optimize $ccflags $ldflags $* ${mc_file}.c $libs > /dev/null 2>&1;'
5338 : define a shorthand compile call for compilations that should be ok.
5342 $cc -o ${mc_file} $optimize $ccflags $ldflags $* ${mc_file}.c $libs;'
5344 : determine filename position in cpp output
5346 echo "Computing filename position in cpp output for #include directives..." >&4
5348 vos) testaccess=-e ;;
5351 echo '#include <stdio.h>' > foo.c
5354 $cppstdin $cppflags $cppminus <foo.c 2>/dev/null | \
5355 $grep '^[ ]*#.*stdio\.h' | \
5356 while read cline; do
5359 while $test \$# -gt 0; do
5360 if $test $testaccess \`echo \$1 | $tr -d '"'\`; then
5365 pos=\`expr \$pos + 1\`
5377 *) pos="${fieldn}th";;
5379 echo "Your cpp writes the filename in the $pos field of the line."
5382 vos) cppfilter="tr '\\\\>' '/' |" ;; # path component separator is >
5383 os2) cppfilter="sed -e 's|\\\\\\\\|/|g' |" ;; # path component separator is \
5386 : locate header file
5391 for usrincdir in $usrinc
5393 if test -f \$usrincdir/\$wanted; then
5394 echo "\$usrincdir/\$wanted"
5398 awkprg='{ print \$$fieldn }'
5399 echo "#include <\$wanted>" > foo\$\$.c
5400 $cppstdin $cppminus $cppflags < foo\$\$.c 2>/dev/null | \
5401 $cppfilter $grep "^[ ]*#.*\$wanted" | \
5402 while read cline; do
5403 name=\`echo \$cline | $awk "\$awkprg" | $tr -d '"'\`
5405 *[/\\\\]\$wanted) echo "\$name"; exit 1;;
5406 *[\\\\/]\$wanted) echo "\$name"; exit 1;;
5411 # status = 0: grep returned 0 lines, case statement not executed
5412 # status = 1: headerfile found
5413 # status = 2: while loop executed, no headerfile found
5417 if test \$status -eq 1; then
5424 : define an alternate in-header-list? function
5425 inhdr='echo " "; td=$define; tu=$undef; yyy=$@;
5426 cont=true; xxf="echo \"<\$1> found.\" >&4";
5427 case $# in 2) xxnf="echo \"<\$1> NOT found.\" >&4";;
5428 *) xxnf="echo \"<\$1> NOT found, ...\" >&4";;
5430 case $# in 4) instead=instead;; *) instead="at last";; esac;
5431 while $test "$cont"; do
5433 var=$2; eval "was=\$$2";
5434 if $test "$xxx" && $test -r "$xxx";
5436 eval "case \"\$$var\" in $undef) . ./whoa; esac"; eval "$var=\$td";
5439 eval "case \"\$$var\" in $define) . ./whoa; esac"; eval "$var=\$tu"; fi;
5440 set $yyy; shift; shift; yyy=$@;
5441 case $# in 0) cont="";;
5442 2) xxf="echo \"but I found <\$1> $instead.\" >&4";
5443 xxnf="echo \"and I did not find <\$1> either.\" >&4";;
5444 *) xxf="echo \"but I found <\$1\> instead.\" >&4";
5445 xxnf="echo \"there is no <\$1>, ...\" >&4";;
5449 do set $yyy; var=$2; eval "was=\$$2";
5450 eval "case \"\$$var\" in $define) . ./whoa; esac"; eval "$var=\$tu";
5451 set $yyy; shift; shift; yyy=$@;
5454 : see if stdlib is available
5455 set stdlib.h i_stdlib
5458 : check for lengths of integral types
5462 echo "Checking to see how big your integers are..." >&4
5471 printf("intsize=%d;\n", (int)sizeof(int));
5472 printf("longsize=%d;\n", (int)sizeof(long));
5473 printf("shortsize=%d;\n", (int)sizeof(short));
5478 if eval $compile_ok && $run ./try > /dev/null; then
5480 echo "Your integers are $intsize bytes long."
5481 echo "Your long integers are $longsize bytes long."
5482 echo "Your short integers are $shortsize bytes long."
5486 Help! I can't compile and run the intsize test program: please enlighten me!
5487 (This is probably a misconfiguration in your system or libraries, and
5488 you really ought to fix it. Still, I'll try anyway.)
5492 rp="What is the size of an integer (in bytes)?"
5496 rp="What is the size of a long integer (in bytes)?"
5500 rp="What is the size of a short integer (in bytes)?"
5508 : check for long long
5510 echo "Checking to see if you have long long..." >&4
5511 echo 'int main() { long long x = 7; return 0; }' > try.c
5513 if eval $compile; then
5515 echo "You have long long."
5518 echo "You do not have long long."
5524 : check for length of long long
5525 case "${d_longlong}${longlongsize}" in
5528 echo "Checking to see how big your long longs are..." >&4
5529 $cat >try.c <<'EOCP'
5533 printf("%d\n", (int)sizeof(long long));
5538 if eval $compile_ok; then
5539 longlongsize=`$run ./try`
5540 echo "Your long longs are $longlongsize bytes long."
5544 echo "(I can't seem to compile the test program. Guessing...)"
5545 rp="What is the size of a long long (in bytes)?"
5549 if $test "X$longsize" = "X$longlongsize"; then
5550 echo "(That isn't any different from an ordinary long.)"
5556 : see if inttypes.h is available
5557 : we want a real compile instead of Inhdr because some systems
5558 : have an inttypes.h which includes non-existent headers
5561 #include <inttypes.h>
5563 static int32_t foo32 = 0x12345678;
5567 if eval $compile; then
5568 echo "<inttypes.h> found." >&4
5571 echo "<inttypes.h> NOT found." >&4
5580 echo "Checking to see if you have int64_t..." >&4
5582 #include <sys/types.h>
5583 #$i_inttypes I_INTTYPES
5585 #include <inttypes.h>
5587 int main() { int64_t x = 7; }
5590 if eval $compile; then
5592 echo "You have int64_t."
5595 echo "You do not have int64_t."
5603 echo "Checking which 64-bit integer type we could use..." >&4
5609 val='"unsigned int"'
5614 *) case "$longsize" in
5618 val='"unsigned long"'
5623 *) case "$d_longlong:$longlongsize" in
5628 val='"unsigned long long"'
5633 *) case "$d_int64_t" in
5652 '') echo "Alas, no 64-bit integer types in sight." >&4
5655 *) echo "We could use '$quadtype' for 64-bit integers." >&4
5661 case "$uselonglong" in
5662 "$define"|true|[yY]*)
5665 *** Configure -Duselonglong is deprecated, using -Duse64bitint instead.
5667 use64bitint="$define"
5670 case "$use64bits" in
5671 "$define"|true|[yY]*)
5674 *** Configure -Duse64bits is deprecated, using -Duse64bitint instead.
5676 use64bitint="$define"
5679 case "$use64bitints" in
5680 "$define"|true|[yY]*)
5683 *** There is no Configure -Duse64bitints, using -Duse64bitint instead.
5685 use64bitint="$define"
5688 case "$use64bitsint" in
5689 "$define"|true|[yY]*)
5692 *** There is no Configure -Duse64bitsint, using -Duse64bitint instead.
5694 use64bitint="$define"
5697 case "$uselonglongs" in
5698 "$define"|true|[yY]*)
5701 *** There is no Configure -Duselonglongs, using -Duse64bitint instead.
5703 use64bitint="$define"
5706 case "$use64bitsall" in
5707 "$define"|true|[yY]*)
5710 *** There is no Configure -Duse64bitsall, using -Duse64bitall instead.
5712 use64bitall="$define"
5717 *-DUSE_LONG_LONG*|*-DUSE_64_BIT_INT*|*-DUSE_64_BIT_ALL*) use64bitint="$define";;
5719 case "$use64bitall" in
5720 "$define"|true|[yY]*) use64bitint="$define" ;;
5726 You have natively 64-bit long integers.
5730 *) case "$use64bitint" in
5731 "$define"|true|[yY]*) dflt='y';;
5740 Perl can be built to take advantage of 64-bit integer types
5741 on some systems. To do so, Configure can be run with -Duse64bitint.
5742 Choosing this option will most probably introduce binary incompatibilities.
5744 If this doesn't make any sense to you, just accept the default '$dflt'.
5745 (The default has been chosen based on your configuration.)
5747 rp='Try to use 64-bit integers, if available?'
5750 [yY]*) val="$define" ;;
5758 case "$use64bitall" in
5759 "$define"|true|[yY]*) dflt='y' ;;
5760 *) case "$longsize" in
5768 You may also choose to try maximal 64-bitness. It means using as much
5769 64-bitness as possible on the platform. This in turn means even more
5770 binary incompatibilities. On the other hand, your platform may not
5771 have any more 64-bitness available than what you already have chosen.
5773 If this doesn't make any sense to you, just accept the default '$dflt'.
5774 (The default has been chosen based on your configuration.)
5776 rp='Try to use maximal 64-bit support, if available?'
5779 [yY]*) val="$define" ;;
5784 case "$use64bitall" in
5786 case "$use64bitint" in
5790 Since you have chosen a maximally 64-bit build, I'm also turning on
5791 the use of 64-bit integers.
5793 use64bitint="$define" ;;
5798 : Look for a hint-file generated 'call-back-unit'. If the
5799 : user has specified that a 64-bit perl is to be built,
5800 : we may need to set or change some other defaults.
5801 if $test -f use64bitint.cbu; then
5802 echo "Your platform has some specific hints regarding 64-bit integers, using them..."
5805 case "$use64bitint" in
5806 "$define"|true|[yY]*)
5808 4) case "$archname64" in
5809 '') archname64=64int ;;
5816 : Look for a hint-file generated 'call-back-unit'. If the
5817 : user has specified that a maximally 64-bit perl is to be built,
5818 : we may need to set or change some other defaults.
5819 if $test -f use64bitall.cbu; then
5820 echo "Your platform has some specific hints regarding 64-bit builds, using them..."
5823 case "$use64bitall" in
5824 "$define"|true|[yY]*)
5826 4) case "$archname64" in
5827 ''|64int) archname64=64all ;;
5834 case "$d_quad:$use64bitint" in
5838 *** You have chosen to use 64-bit integers,
5839 *** but none can be found.
5840 *** Please rerun Configure without -Duse64bitint and/or -Dusemorebits.
5841 *** Cannot continue, aborting.
5848 : check for length of double
5850 case "$doublesize" in
5852 echo "Checking to see how big your double precision numbers are..." >&4
5861 printf("%d\n", (int)sizeof(double));
5866 if eval $compile_ok; then
5867 doublesize=`$run ./try`
5868 echo "Your double is $doublesize bytes long."
5871 echo "(I can't seem to compile the test program. Guessing...)"
5872 rp="What is the size of a double precision number (in bytes)?"
5880 : check for long doubles
5882 echo "Checking to see if you have long double..." >&4
5883 echo 'int main() { long double x = 7.0; }' > try.c
5885 if eval $compile; then
5887 echo "You have long double."
5890 echo "You do not have long double."
5896 : check for length of long double
5897 case "${d_longdbl}${longdblsize}" in
5900 echo "Checking to see how big your long doubles are..." >&4
5901 $cat >try.c <<'EOCP'
5905 printf("%d\n", sizeof(long double));
5910 if eval $compile; then
5911 longdblsize=`$run ./try`
5912 echo "Your long doubles are $longdblsize bytes long."
5916 echo "(I can't seem to compile the test program. Guessing...)" >&4
5917 rp="What is the size of a long double (in bytes)?"
5921 if $test "X$doublesize" = "X$longdblsize"; then
5922 echo "That isn't any different from an ordinary double."
5923 echo "I'll keep your setting anyway, but you may see some"
5924 echo "harmless compilation warnings."
5930 : determine the architecture name
5932 if xxx=`./loc arch blurfl $pth`; $test -f "$xxx"; then
5933 tarch=`arch`"-$osname"
5934 elif xxx=`./loc uname blurfl $pth`; $test -f "$xxx" ; then
5935 if uname -m > tmparch 2>&1 ; then
5936 tarch=`$sed -e 's/ *$//' -e 's/ /_/g' \
5937 -e 's/$/'"-$osname/" tmparch`
5945 case "$myarchname" in
5948 echo "(Your architecture name used to be $myarchname.)"
5952 case "$targetarch" in
5954 *) archname=`echo $targetarch|sed 's,^[^-]*-,,'` ;;
5959 *) dflt="$archname";;
5961 rp='What is your architecture name'
5964 case "$usethreads" in
5966 echo "Threads selected." >&4
5968 *-thread*) echo "...and architecture name already has -thread." >&4
5970 *) archname="$archname-thread"
5971 echo "...setting architecture name to $archname." >&4
5976 case "$usemultiplicity" in
5978 echo "Multiplicity selected." >&4
5980 *-multi*) echo "...and architecture name already has -multi." >&4
5982 *) archname="$archname-multi"
5983 echo "...setting architecture name to $archname." >&4
5988 case "$use64bitint$use64bitall" in
5990 case "$archname64" in
5992 echo "This architecture is naturally 64-bit, not changing architecture name." >&4
5995 case "$use64bitint" in
5996 "$define") echo "64 bit integers selected." >&4 ;;
5998 case "$use64bitall" in
5999 "$define") echo "Maximal 64 bitness selected." >&4 ;;
6002 *-$archname64*) echo "...and architecture name already has $archname64." >&4
6004 *) archname="$archname-$archname64"
6005 echo "...setting architecture name to $archname." >&4
6011 case "$uselongdouble" in
6013 echo "Long doubles selected." >&4
6014 case "$longdblsize" in
6016 echo "...but long doubles are equal to doubles, not changing architecture name." >&4
6020 *-ld*) echo "...and architecture name already has -ld." >&4
6022 *) archname="$archname-ld"
6023 echo "...setting architecture name to $archname." >&4
6030 case "$useperlio" in
6032 echo "Perlio selected." >&4
6035 echo "Perlio not selected, using stdio." >&4
6037 *-stdio*) echo "...and architecture name already has -stdio." >&4
6039 *) archname="$archname-stdio"
6040 echo "...setting architecture name to $archname." >&4
6045 if $test -f archname.cbu; then
6046 echo "Your platform has some specific hints for architecture name, using them..."
6050 : set the prefixit variable, to compute a suitable default value
6051 prefixit='case "$3" in
6053 case "$oldprefix" in
6054 "") eval "$1=\"\$$2\"";;
6061 ""|" ") eval "$1=\"\$$2\"";;
6067 eval "tp=\"$oldprefix-\$$2-\""; eval "tp=\"$tp\"";
6069 --|/*--|\~*--) eval "$1=\"$prefix/$3\"";;
6070 /*-$oldprefix/*|\~*-$oldprefix/*)
6071 eval "$1=\`echo \$$2 | sed \"s,^$oldprefix,$prefix,\"\`";;
6072 *) eval "$1=\"\$$2\"";;
6076 : determine installation style
6077 : For now, try to deduce it from prefix unless it is already set.
6078 : Reproduce behavior of 5.005 and earlier, maybe drop that in 5.7.
6079 case "$installstyle" in
6080 '') case "$prefix" in
6081 *perl*) dflt='lib';;
6082 *) dflt='lib/perl5' ;;
6085 *) dflt="$installstyle" ;;
6087 : Probably not worth prompting for this since we prompt for all
6088 : the directories individually, and the prompt would be too long and
6092 : determine where public executables go
6097 rp='Pathname where the public executables will reside?'
6099 if $test "X$ansexp" != "X$binexp"; then
6103 : XXX Bug? -- ignores Configure -Dinstallprefix setting.
6104 : XXX If this is fixed, also fix the "start perl" hunk below, which relies on
6105 : this via initialinstalllocation
6108 case "$userelocatableinc" in
6109 $define|true|[yY]*) dflt='y' ;;
6114 Would you like to build Perl so that the installation is relocatable, so that
6115 library paths in @INC are determined relative to the path of the perl binary?
6116 This is not advised for system Perl installs, or if you need to run setid
6117 scripts or scripts under taint mode.
6119 If this doesn't make any sense to you, just accept the default '$dflt'.
6121 rp='Use relocatable @INC?'
6124 y|Y) val="$define" ;;
6127 set userelocatableinc
6130 initialinstalllocation="$binexp"
6131 : Default prefix is now "up one level from where the binaries are"
6132 case "$userelocatableinc" in
6138 installprefixexp=".../.."
6142 : determine where private library files go
6143 : Usual default is /usr/local/lib/perl5/$version.
6144 : Also allow things like /opt/perl/lib/$version, since
6145 : /opt/perl/lib/perl5... would be redundant.
6146 : The default "style" setting is made in installstyle.U
6147 case "$installstyle" in
6148 *lib/perl5*) set dflt privlib lib/$package/$version ;;
6149 *) set dflt privlib lib/$version ;;
6154 There are some auxiliary files for $package that need to be put into a
6155 private library directory that is accessible by everyone.
6160 rp='Pathname where the private library files will reside?'
6165 : set the prefixup variable, to restore leading tilda escape
6166 prefixup='case "$prefixexp" in
6168 *) eval "$1=\`echo \$$1 | sed \"s,^$prefixexp,$prefix,\"\`";;
6171 : determine where public architecture dependent libraries go
6174 : privlib default is /usr/local/lib/$package/$version
6175 : archlib default is /usr/local/lib/$package/$version/$archname
6176 : privlib may have an optional trailing /share.
6177 tdflt=`echo $privlib | $sed 's,/share$,,'`
6178 tdflt=$tdflt/$archname
6187 $spackage contains architecture-dependent library files. If you are
6188 sharing libraries in a heterogeneous environment, you might store
6189 these files in a separate location. Otherwise, you can just include
6190 them with the rest of the public library files.
6195 rp='Where do you want to put the public architecture-dependent libraries?'
6199 if $test X"$archlib" = X"$privlib"; then
6205 : see if setuid scripts can be secure
6208 Some kernels have a bug that prevents setuid #! scripts from being
6209 secure. Some sites have disabled setuid #! scripts because of this.
6211 First let's decide if your kernel supports secure setuid #! scripts.
6212 (If setuid #! scripts would be secure but have been disabled anyway,
6213 don't say that they are secure if asked.)
6218 if $test -d /dev/fd; then
6219 echo "#!$ls" >reflect
6220 chmod +x,u+s reflect
6221 ./reflect >flect 2>&1
6222 if $contains "/dev/fd" flect >/dev/null; then
6223 echo "Congratulations, your kernel has secure setuid scripts!" >&4
6227 If you are not sure if they are secure, I can check but I'll need a
6228 username and password different from the one you are using right now.
6229 If you don't have such a username or don't want me to test, simply
6233 rp='Other username to test security of setuid scripts with?'
6238 case "$d_suidsafe" in
6239 '') echo "I'll assume setuid scripts are *not* secure." >&4
6242 echo "Well, the $hint value is *not* secure." >&4
6244 *) echo "Well, the $hint value *is* secure." >&4
6249 $rm -f reflect flect
6250 echo "#!$ls" >reflect
6251 chmod +x,u+s reflect
6254 echo '"su" will (probably) prompt you for '"$ans's password."
6255 su $ans -c './reflect >flect'
6256 if $contains "/dev/fd" flect >/dev/null; then
6257 echo "Okay, it looks like setuid scripts are secure." >&4
6260 echo "I don't think setuid scripts are secure." >&4
6265 rp='Does your kernel have *secure* setuid scripts?'
6268 [yY]*) val="$define";;
6273 echo "I don't think setuid scripts are secure (no /dev/fd directory)." >&4
6274 echo "(That's for file descriptors, not floppy disks.)"
6280 $rm -f reflect flect
6282 : now see if they want to do setuid emulation
6285 case "$d_suidsafe" in
6288 echo "No need to emulate SUID scripts since they are secure here." >&4
6292 Some systems have disabled setuid scripts, especially systems where
6293 setuid scripts cannot be secure. On systems where setuid scripts have
6294 been disabled, the setuid/setgid bits on scripts are currently
6295 useless. It is possible for $package to detect those bits and emulate
6296 setuid/setgid in a secure fashion. This emulation will only work if
6297 setuid scripts have been disabled in your kernel.
6301 "$define") dflt=y ;;
6304 rp="Do you want to do setuid/setgid emulation?"
6307 [yY]*) val="$define";;
6315 : Find perl5.005 or later.
6316 echo "Looking for a previously installed perl5.005 or later... "
6318 '') for tdir in `echo "$binexp$path_sep$PATH" | $sed "s/$path_sep/ /g"`; do
6319 : Check if this perl is recent and can load a simple module
6320 if $test -x $tdir/perl$exe_ext && $tdir/perl -Mless -e 'use 5.005;' >/dev/null 2>&1; then
6323 elif $test -x $tdir/perl5$exe_ext && $tdir/perl5 -Mless -e 'use 5.005;' >/dev/null 2>&1; then
6333 '') echo "None found. That's ok.";;
6334 *) echo "Using $perl5." ;;
6339 After $package is installed, you may wish to install various
6340 add-on modules and utilities. Typically, these add-ons will
6341 be installed under $prefix with the rest
6342 of this package. However, you may wish to install such add-ons
6343 elsewhere under a different prefix.
6345 If you do not wish to put everything under a single prefix, that's
6346 ok. You will be prompted for the individual locations; this siteprefix
6347 is only used to suggest the defaults.
6349 The default should be fine for most people.
6353 rp='Installation prefix to use for add-on modules and utilities?'
6354 : XXX Here might be another good place for an installstyle setting.
6355 case "$siteprefix" in
6357 *) dflt=$siteprefix ;;
6360 : XXX Prefixit unit does not yet support siteprefix and vendorprefix
6362 case "$siteprefix" in
6366 *) oldsiteprefix="$prefix";;
6371 siteprefixexp="$ansexp"
6373 : determine where site specific libraries go.
6374 : Usual default is /usr/local/lib/perl5/site_perl/$version
6375 : The default "style" setting is made in installstyle.U
6376 : XXX No longer works with Prefixit stuff.
6377 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
6379 '') case "$installstyle" in
6380 *lib/perl5*) dflt=$siteprefix/lib/$package/site_$prog/$version ;;
6381 *) dflt=$siteprefix/lib/site_$prog/$version ;;
6389 The installation process will create a directory for
6390 site-specific extensions and modules. Most users find it convenient
6391 to place all site-specific files in this directory rather than in the
6392 main distribution directory.
6396 rp='Pathname for the site-specific library files?'
6400 sitelib_stem=`echo "$sitelibexp" | sed "s,/$version$,,"`
6402 : Determine list of previous versions to include in @INC
6403 $cat > getverlist <<EOPL
6406 \$api_versionstring = "$api_versionstring";
6407 \$version = "$version";
6408 \$stem = "$sitelib_stem";
6409 \$archname = "$archname";
6411 $cat >> getverlist <<'EOPL'
6412 # The list found is store twice for each entry: the original name, and
6413 # the binary broken down version as pack "sss", so sorting is easy and
6414 # unambiguous. This will work for all versions that have a maximum of
6415 # three digit groups, separate by '.'s or '_'s. Names are extended with
6416 # ".0.0" to ensure at least three elements for the pack.
6417 # -- H.Merijn Brand (m)'06 23-10-2006
6419 # Can't have leading @ because metaconfig interprets it as a command!
6420 ;@inc_version_list=();
6421 # XXX Redo to do opendir/readdir?
6424 ;@candidates = map {
6425 [ $_, pack "sss", split m/[._]/, "$_.0.0" ] } glob("5.*");
6431 ($pversion, $aversion, $vsn5005) = map {
6432 pack "sss", split m/[._]/, "$_.0.0" } $version, $api_versionstring, "5.005";
6433 foreach $d (@candidates) {
6434 if ($d->[1] lt $pversion) {
6435 if ($d->[1] ge $aversion) {
6436 unshift(@inc_version_list, grep { -d } $d->[0]."/$archname", $d->[0]);
6438 elsif ($d->[1] ge $vsn5005) {
6439 unshift(@inc_version_list, grep { -d } $d->[0]);
6443 # Skip newer version. I.e. don't look in
6444 # 5.7.0 if we're installing 5.6.1.
6448 if (@inc_version_list) {
6449 print join(' ', @inc_version_list);
6452 # Blank space to preserve value for next Configure run.
6457 case "$inc_version_list" in
6458 '') if test -x "$perl5$exe_ext"; then
6459 dflt=`$perl5 getverlist`
6464 $undef) dflt='none' ;;
6465 *) eval dflt=\"$inc_version_list\" ;;
6468 ''|' ') dflt=none ;;
6475 In order to ease the process of upgrading, this version of perl
6476 can be configured to use modules built and installed with earlier
6477 versions of perl that were installed under $prefix. Specify here
6478 the list of earlier versions that this version of perl should check.
6479 If Configure detected no earlier versions of perl installed under
6480 $prefix, then the list will be empty. Answer 'none' to tell perl
6481 to not search earlier versions.
6483 The default should almost always be sensible, so if you're not sure,
6484 just accept the default.
6487 rp='List of earlier versions to include in @INC?'
6490 [Nn]one|''|' '|$undef) inc_version_list=' ' ;;
6491 *) inc_version_list="$ans" ;;
6493 case "$inc_version_list" in
6495 inc_version_list_init='0'
6496 d_inc_version_list="$undef"
6498 *) inc_version_list_init=`echo $inc_version_list |
6499 $sed -e 's/^/"/' -e 's/ /","/g' -e 's/$/",0/'`
6500 d_inc_version_list="$define"
6505 : see if this is a malloc.h system
6506 : we want a real compile instead of Inhdr because some systems have a
6507 : malloc.h that just gives a compile error saying to use stdlib.h instead
6512 int main () { return 0; }
6515 if eval $compile; then
6516 echo "<malloc.h> found." >&4
6519 echo "<malloc.h> NOT found." >&4
6526 : check for void type
6528 echo "Checking to see how well your C compiler groks the void type..." >&4
6529 case "$voidflags" in
6541 extern void moo(); /* function returning void */
6542 void (*goo)(); /* ptr to func returning void */
6544 void *hue; /* generic ptr */
6557 int main() { sub(); }
6559 if $cc $ccflags -c -DTRY=$defvoidused try.c >.out 2>&1 ; then
6560 voidflags=$defvoidused
6561 echo "Good. It appears to support void to the level $package wants.">&4
6562 if $contains warning .out >/dev/null 2>&1; then
6563 echo "However, you might get some warnings that look like this:"
6567 echo "Hmm, your compiler has some difficulty with void. Checking further..." >&4
6568 if $cc $ccflags -c -DTRY=1 try.c >/dev/null 2>&1; then
6569 echo "It supports 1..."
6570 if $cc $ccflags -c -DTRY=3 try.c >/dev/null 2>&1; then
6571 echo "It also supports 2..."
6572 if $cc $ccflags -c -DTRY=7 try.c >/dev/null 2>&1; then
6574 echo "And it supports 4 but not 8 definitely."
6576 echo "It doesn't support 4..."
6577 if $cc $ccflags -c -DTRY=11 try.c >/dev/null 2>&1; then
6579 echo "But it supports 8."
6582 echo "Neither does it support 8."
6586 echo "It does not support 2..."
6587 if $cc $ccflags -c -DTRY=13 try.c >/dev/null 2>&1; then
6589 echo "But it supports 4 and 8."
6591 if $cc $ccflags -c -DTRY=5 try.c >/dev/null 2>&1; then
6593 echo "And it supports 4 but has not heard about 8."
6595 echo "However it supports 8 but not 4."
6600 echo "There is no support at all for void."
6605 case "$voidflags" in
6608 Support flag bits are:
6609 1: basic void declarations.
6610 2: arrays of pointers to functions returning void.
6611 4: operations between pointers to and addresses of void functions.
6612 8: generic void pointers.
6615 rp="Your void support flags add up to what?"
6622 : check for length of pointer
6626 echo "Checking to see how big your pointers are..." >&4
6627 if test "$voidflags" -gt 7; then
6628 echo '#define VOID_PTR char *' > try.c
6630 echo '#define VOID_PTR void *' > try.c
6640 printf("%d\n", (int)sizeof(VOID_PTR));
6645 if eval $compile_ok; then
6646 ptrsize=`$run ./try`
6647 echo "Your pointers are $ptrsize bytes long."
6650 echo "(I can't seem to compile the test program. Guessing...)" >&4
6651 rp="What is the size of a pointer (in bytes)?"
6658 case "$use64bitall" in
6659 "$define"|true|[yY]*)
6663 *** You have chosen a maximally 64-bit build,
6664 *** but your pointers are only 4 bytes wide.
6665 *** Please rerun Configure without -Duse64bitall.
6670 *** Since you have quads, you could possibly try with -Duse64bitint.
6675 *** Cannot continue, aborting.
6686 : determine whether to use malloc wrapping
6688 case "$usemallocwrap" in
6689 [yY]*|true|$define) dflt='y' ;;
6690 [nN]*|false|$undef) dflt='n' ;;
6691 *) case "$usedevel" in
6692 [yY]*|true|$define) dflt='y' ;;
6697 rp="Do you wish to wrap malloc calls to protect against potential overflows?"
6699 usemallocwrap="$ans"
6702 usemallocwrap="$define" ;;
6704 usemallocwrap="$undef" ;;
6707 : determine which malloc to compile in
6709 case "$usemymalloc" in
6710 [yY]*|true|$define) dflt='y' ;;
6711 [nN]*|false|$undef) dflt='n' ;;
6712 *) case "$ptrsize" in
6718 rp="Do you wish to attempt to use the malloc that comes with $package?"
6724 mallocsrc='malloc.c'
6725 mallocobj="malloc$_o"
6726 d_mymalloc="$define"
6729 : Remove malloc from list of libraries to use
6730 echo "Removing unneeded -lmalloc from library list" >&4
6731 set `echo X $libs | $sed -e 's/-lmalloc / /' -e 's/-lmalloc$//'`
6734 echo "libs = $libs" >&4
6746 : compute the return types of malloc and free
6748 $cat >malloc.c <<END
6752 #include <sys/types.h>
6766 case "$malloctype" in
6768 if $cc $ccflags -c -DTRY_MALLOC malloc.c >/dev/null 2>&1; then
6775 echo "Your system wants malloc to return '$malloctype', it would seem." >&4
6779 if $cc $ccflags -c -DTRY_FREE malloc.c >/dev/null 2>&1; then
6786 echo "Your system uses $freetype free(), it would seem." >&4
6788 : determine where site specific architecture-dependent libraries go.
6789 : sitelib default is /usr/local/lib/perl5/site_perl/$version
6790 : sitearch default is /usr/local/lib/perl5/site_perl/$version/$archname
6791 : sitelib may have an optional trailing /share.
6793 '') dflt=`echo $sitelib | $sed 's,/share$,,'`
6794 dflt="$dflt/$archname"
6799 set sitearch sitearch none
6803 The installation process will also create a directory for
6804 architecture-dependent site-specific extensions and modules.
6808 rp='Pathname for the site-specific architecture-dependent library files?'
6812 if $test X"$sitearch" = X"$sitelib"; then
6815 d_sitearch="$define"
6820 The installation process will also create a directory for
6821 vendor-supplied add-ons. Vendors who supply perl with their system
6822 may find it convenient to place all vendor-supplied files in this
6823 directory rather than in the main distribution directory. This will
6824 ease upgrades between binary-compatible maintenance versions of perl.
6826 Of course you may also use these directories in whatever way you see
6827 fit. For example, you might use them to access modules shared over a
6828 company-wide network.
6830 The default answer should be fine for most people.
6831 This causes further questions about vendor add-ons to be skipped
6832 and no vendor-specific directories will be configured for perl.
6835 rp='Do you want to configure vendor-specific add-on directories?'
6836 case "$usevendorprefix" in
6837 define|true|[yY]*) dflt=y ;;
6838 *) : User may have set vendorprefix directly on Configure command line.
6839 case "$vendorprefix" in
6848 rp='Installation prefix to use for vendor-supplied add-ons?'
6849 case "$vendorprefix" in
6851 *) dflt=$vendorprefix ;;
6854 : XXX Prefixit unit does not yet support siteprefix and vendorprefix
6856 case "$vendorprefix" in
6860 *) oldvendorprefix="$prefix";;
6864 usevendorprefix="$define"
6866 vendorprefixexp="$ansexp"
6868 *) usevendorprefix="$undef"
6874 case "$vendorprefix" in
6875 '') d_vendorlib="$undef"
6879 *) d_vendorlib="$define"
6880 : determine where vendor-supplied modules go.
6881 : Usual default is /usr/local/lib/perl5/vendor_perl/$version
6882 case "$vendorlib" in
6884 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
6885 case "$installstyle" in
6886 *lib/perl5*) dflt=$vendorprefix/lib/$package/vendor_$prog/$version ;;
6887 *) dflt=$vendorprefix/lib/vendor_$prog/$version ;;
6890 *) dflt="$vendorlib"
6894 rp='Pathname for the vendor-supplied library files?'
6897 vendorlibexp="$ansexp"
6900 vendorlib_stem=`echo "$vendorlibexp" | sed "s,/$version$,,"`
6904 case "$vendorprefix" in
6905 '') d_vendorarch="$undef"
6909 *) d_vendorarch="$define"
6910 : determine where vendor-supplied architecture-dependent libraries go.
6911 : vendorlib default is /usr/local/lib/perl5/vendor_perl/$version
6912 : vendorarch default is /usr/local/lib/perl5/vendor_perl/$version/$archname
6913 : vendorlib may have an optional trailing /share.
6914 case "$vendorarch" in
6915 '') dflt=`echo $vendorlib | $sed 's,/share$,,'`
6916 dflt="$dflt/$archname"
6918 *) dflt="$vendorarch" ;;
6921 rp='Pathname for vendor-supplied architecture-dependent files?'
6924 vendorarchexp="$ansexp"
6927 prefixvar=vendorarch
6930 : Final catch-all directories to search
6933 Lastly, you can have perl look in other directories for extensions and
6934 modules in addition to those already specified.
6935 These directories will be searched after
6939 test X"$vendorlib" != "X" && echo ' ' $vendorlib
6940 test X"$vendorarch" != "X" && echo ' ' $vendorarch
6942 case "$otherlibdirs" in
6943 ''|' ') dflt='none' ;;
6944 *) dflt="$otherlibdirs" ;;
6947 Enter a colon-separated set of extra paths to include in perl's @INC
6948 search path, or enter 'none' for no extra paths.
6952 rp='Colon-separated list of additional directories for perl to search?'
6955 ' '|''|none) otherlibdirs=' ' ;;
6956 *) otherlibdirs="$ans" ;;
6958 case "$otherlibdirs" in
6962 set d_perl_otherlibdirs
6965 : Cruising for prototypes
6967 echo "Checking out function prototypes..." >&4
6968 $cat >prototype.c <<EOCP
6973 int main(int argc, char *argv[]) {
6976 if $cc $ccflags -c prototype.c >prototype.out 2>&1 ; then
6977 echo "Your C compiler appears to support function prototypes."
6980 echo "Your C compiler doesn't seem to understand function prototypes."
6987 case "$prototype" in
6989 *) ansi2knr='ansi2knr'
6994 This version of $package can only be compiled by a compiler that
6995 understands function prototypes. Unfortunately, your C compiler
6997 doesn't seem to understand them. Sorry about that.
6999 If GNU cc is available for your system, perhaps you could try that instead.
7001 Eventually, we hope to support building Perl with pre-ANSI compilers.
7002 If you would like to help in that effort, please contact <perlbug@perl.org>.
7004 Aborting Configure now.
7016 Perl can be built with extra modules or bundles of modules which
7017 will be fetched from the CPAN and installed alongside Perl.
7019 Notice that you will need access to the CPAN; either via the Internet,
7020 or a local copy, for example a CD-ROM or a local CPAN mirror. (You will
7021 be asked later to configure the CPAN.pm module which will in turn do
7022 the installation of the rest of the extra modules or bundles.)
7024 Notice also that if the modules require any external software such as
7025 libraries and headers (the libz library and the zlib.h header for the
7026 Compress::Zlib module, for example) you MUST have any such software
7027 already installed, this configuration process will NOT install such
7030 If this doesn't make any sense to you, just accept the default '$dflt'.
7032 rp='Install any extra modules (y or n)?'
7038 Please list any extra modules or bundles to be installed from CPAN,
7039 with spaces between the names. The names can be in any format the
7040 'install' command of CPAN.pm will understand. (Answer 'none',
7041 without the quotes, to install no extra modules or bundles.)
7051 $rm -f ../extras.lst
7053 *) echo "(Saving the list of extras for later...)"
7054 echo "$extras" > ../extras.lst
7062 : determine where html pages for programs go
7063 set html1dir html1dir none
7067 If you wish to install html files for programs in $spackage, indicate
7068 the appropriate directory here. To skip installing html files,
7072 ''|none|$undef|' ') dflt=none ;;
7073 *) dflt=$html1dir ;;
7076 rp="Directory for the main $spackage html pages?"
7080 : Use ' ' for none so value is preserved next time through Configure
7081 $test X"$html1dir" = "X" && html1dir=' '
7083 : determine where html pages for libraries and modules go
7084 set html3dir html3dir none
7088 If you wish to install html files for modules associated with $spackage,
7089 indicate the appropriate directory here. To skip installing html files,
7092 : There is no obvious default. If they have specified html1dir, then
7093 : try to key off that, possibly changing .../html1 into .../html3.
7095 '') html3dir=`echo "$html1dir" | $sed 's/1$/3$/'` ;;
7096 *) dflt=$html3dir ;;
7099 rp="Directory for the $spackage module html pages?"
7103 : Use ' ' for none so value is preserved next time through Configure
7104 $test X"$html3dir" = "X" && html3dir=' '
7106 : determine whether to install perl also as /usr/bin/perl
7109 if $test -d /usr/bin -a "X$installbin" != X/usr/bin; then
7111 Many scripts expect perl to be installed as /usr/bin/perl.
7113 If you want to, I can install the perl you are about to compile
7114 as /usr/bin/perl (in addition to $bin/perl).
7116 if test -f /usr/bin/perl; then
7119 However, please note that because you already have a /usr/bin/perl,
7120 overwriting that with a new Perl would very probably cause problems.
7121 Therefore I'm assuming you don't want to do that (unless you insist).
7124 case "$installusrbinperl" in
7125 "$define"|[yY]*) dflt='y';;
7131 Since you don't have a /usr/bin/perl I'm assuming creating one is okay.
7134 case "$installusrbinperl" in
7135 "$undef"|[nN]*) dflt='n';;
7139 rp="Do you want to install perl as /usr/bin/perl?"
7142 [yY]*) val="$define";;
7148 set installusrbinperl
7152 echo "Checking for GNU C Library..." >&4
7154 /* Find out version of GNU C library. __GLIBC__ and __GLIBC_MINOR__
7155 alone are insufficient to distinguish different versions, such as
7156 2.0.6 and 2.0.7. The function gnu_get_libc_version() appeared in
7157 libc version 2.1.0. A. Dougherty, June 3, 2002.
7163 # ifdef __GLIBC_MINOR__
7164 # if __GLIBC__ >= 2 && __GLIBC_MINOR__ >= 1 && !defined(__cplusplus)
7165 # include <gnu/libc-version.h>
7166 printf("%s\n", gnu_get_libc_version());
7168 printf("%d.%d\n", __GLIBC__, __GLIBC_MINOR__);
7171 printf("%d\n", __GLIBC__);
7180 if eval $compile_ok && $run ./try > glibc.ver; then
7182 gnulibc_version=`$cat glibc.ver`
7183 echo "You are using the GNU C Library version $gnulibc_version"
7187 echo "You are not using the GNU C Library"
7193 : see if nm is to be used to determine whether a symbol is defined or not
7197 case "$d_gnulibc" in
7200 echo "nm probably won't work on the GNU C Library." >&4
7206 if $test "$osname" = aix -a "X$PASE" != "Xdefine" -a ! -f /lib/syscalls.exp; then
7208 echo "Whoops! This is an AIX system without /lib/syscalls.exp!" >&4
7209 echo "'nm' won't be sufficient on this sytem." >&4
7215 '') dflt=`$egrep 'inlibc|csym' $rsrc/Configure | wc -l 2>/dev/null`
7216 if $test $dflt -gt 20; then
7226 true|$define) dflt=y;;
7233 I can use $nm to extract the symbols from your C libraries. This
7234 is a time consuming task which may generate huge output on the disk (up
7235 to 3 megabytes) but that should make the symbols extraction faster. The
7236 alternative is to skip the 'nm' extraction part and to compile a small
7237 test program instead to determine whether each symbol is present. If
7238 you have a fast C compiler and/or if your 'nm' output cannot be parsed,
7239 this may be the best solution.
7241 You probably shouldn't let me use 'nm' if you are using the GNU C Library.
7244 rp="Shall I use $nm to extract C symbols from the libraries?"
7247 [Nn]*) usenm=false;;
7256 : nm options which may be necessary
7258 '') if $test -f /mach_boot; then
7260 elif $test -d /usr/ccs/lib; then
7261 nm_opt='-p' # Solaris (and SunOS?)
7262 elif $test -f /dgux; then
7264 elif $test -f /lib64/rld; then
7265 nm_opt='-p' # 64-bit Irix
7271 : nm options which may be necessary for shared libraries but illegal
7272 : for archive libraries. Thank you, Linux.
7273 case "$nm_so_opt" in
7274 '') case "$myuname" in
7276 if $nm --help | $grep 'dynamic' > /dev/null 2>&1; then
7277 nm_so_opt='--dynamic'
7286 : get list of predefined functions in a handy place
7291 *-lc_s*) libc=`./loc libc_s$_a $libc $libpth`
7297 *) for thislib in $libs; do
7300 : Handle C library specially below.
7303 thislib=`echo $thislib | $sed -e 's/^-l//'`
7304 if try=`./loc lib$thislib.$so.'*' X $libpth`; $test -f "$try"; then
7306 elif try=`./loc lib$thislib.$so X $libpth`; $test -f "$try"; then
7308 elif try=`./loc lib$thislib$_a X $libpth`; $test -f "$try"; then
7310 elif try=`./loc $thislib$_a X $libpth`; $test -f "$try"; then
7312 elif try=`./loc lib$thislib X $libpth`; $test -f "$try"; then
7314 elif try=`./loc $thislib X $libpth`; $test -f "$try"; then
7316 elif try=`./loc Slib$thislib$_a X $xlibpth`; $test -f "$try"; then
7321 libnames="$libnames $try"
7323 *) libnames="$libnames $thislib" ;;
7332 for xxx in $libpth; do
7333 $test -r $1 || set $xxx/libc.$so
7334 : The messy sed command sorts on library version numbers.
7336 set `echo blurfl; echo $xxx/libc.$so.[0-9]* | \
7337 tr ' ' $trnl | egrep -v '\.[A-Za-z]*$' | $sed -e '
7339 s/[0-9][0-9]*/0000&/g
7340 s/0*\([0-9][0-9][0-9][0-9][0-9]\)/\1/g
7343 $sort | $sed -e 's/^.* //'`
7346 $test -r $1 || set /usr/ccs/lib/libc.$so
7347 $test -r $1 || set /lib/libsys_s$_a
7353 if $test -r "$1"; then
7354 echo "Your (shared) C library seems to be in $1."
7356 elif $test -r /lib/libc && $test -r /lib/clib; then
7357 echo "Your C library seems to be in both /lib/clib and /lib/libc."
7359 libc='/lib/clib /lib/libc'
7360 if $test -r /lib/syslib; then
7361 echo "(Your math library is in /lib/syslib.)"
7362 libc="$libc /lib/syslib"
7364 elif $test -r "$libc" || (test -h "$libc") >/dev/null 2>&1; then
7365 echo "Your C library seems to be in $libc, as you said before."
7366 elif $test -r $incpath/usr/lib/libc$_a; then
7367 libc=$incpath/usr/lib/libc$_a;
7368 echo "Your C library seems to be in $libc. That's fine."
7369 elif $test -r /lib/libc$_a; then
7371 echo "Your C library seems to be in $libc. You're normal."
7373 if tans=`./loc libc$_a blurfl/dyick $libpth`; $test -r "$tans"; then
7375 elif tans=`./loc libc blurfl/dyick $libpth`; $test -r "$tans"; then
7376 libnames="$libnames "`./loc clib blurfl/dyick $libpth`
7377 elif tans=`./loc clib blurfl/dyick $libpth`; $test -r "$tans"; then
7379 elif tans=`./loc Slibc$_a blurfl/dyick $xlibpth`; $test -r "$tans"; then
7381 elif tans=`./loc Mlibc$_a blurfl/dyick $xlibpth`; $test -r "$tans"; then
7384 tans=`./loc Llibc$_a blurfl/dyick $xlibpth`
7386 if $test -r "$tans"; then
7387 echo "Your C library seems to be in $tans, of all places."
7393 if $test $xxx = apollo -o -r "$libc" || (test -h "$libc") >/dev/null 2>&1; then
7397 If the guess above is wrong (which it might be if you're using a strange
7398 compiler, or your machine supports multiple models), you can override it here.
7403 echo $libpth | $tr ' ' $trnl | $sort | $uniq > libpath
7405 I can't seem to find your C library. I've looked in the following places:
7408 $sed 's/^/ /' libpath
7411 None of these seems to contain your C library. I need to get its name...
7416 rp='Where is your C library?'
7421 echo $libc $libnames | $tr ' ' $trnl | $sort | $uniq > libnames
7422 set X `cat libnames`
7425 case $# in 1) xxx=file; esac
7426 echo "Extracting names from the following $xxx for later perusal:" >&4
7428 $sed 's/^/ /' libnames >&4
7430 $echo $n "This may take a while...$c" >&4
7434 *$so*) $nm $nm_so_opt $nm_opt $file 2>/dev/null;;
7435 *) $nm $nm_opt $file 2>/dev/null;;
7440 $grep fprintf libc.tmp > libc.ptf
7441 xscan='eval "<libc.ptf $com >libc.list"; $echo $n ".$c" >&4'
7442 xrun='eval "<libc.tmp $com >libc.list"; echo "done." >&4'
7444 if com="$sed -n -e 's/__IO//' -e 's/^.* $xxx *//p'";\
7446 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7448 elif com="$sed -n -e 's/^__*//' -e 's/^\([a-zA-Z_0-9$]*\).*xtern.*/\1/p'";\
7450 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7452 elif com="$sed -n -e '/|UNDEF/d' -e '/FUNC..GL/s/^.*|__*//p'";\
7454 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7456 elif com="$sed -n -e 's/^.* D __*//p' -e 's/^.* D //p'";\
7458 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7460 elif com="$sed -n -e 's/^_//' -e 's/^\([a-zA-Z_0-9]*\).*xtern.*text.*/\1/p'";\
7462 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7464 elif com="$sed -n -e 's/^.*|FUNC |GLOB .*|//p'";\
7466 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7468 elif com="$grep '|' | $sed -n -e '/|COMMON/d' -e '/|DATA/d' \
7469 -e '/ file/d' -e 's/^\([^ ]*\).*/\1/p'";\
7471 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7473 elif com="$sed -n -e 's/^.*|FUNC |GLOB .*|//p' -e 's/^.*|FUNC |WEAK .*|//p'";\
7475 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7477 elif com="$sed -n -e 's/^__//' -e '/|Undef/d' -e '/|Proc/s/ .*//p'";\
7479 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7481 elif com="$sed -n -e 's/^.*|Proc .*|Text *| *//p'";\
7483 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7485 elif com="$sed -n -e '/Def. Text/s/.* \([^ ]*\)\$/\1/p'";\
7487 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7489 elif com="$sed -n -e 's/^[-0-9a-f ]*_\(.*\)=.*/\1/p'";\
7491 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7493 elif com="$sed -n -e 's/.*\.text n\ \ \ \.//p'";\
7495 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7497 elif com="sed -n -e 's/^__.*//' -e 's/[ ]*D[ ]*[0-9]*.*//p'";\
7499 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7502 $nm -p $* 2>/dev/null >libc.tmp
7503 $grep fprintf libc.tmp > libc.ptf
7504 if com="$sed -n -e 's/^.* [ADTSIW] *_[_.]*//p' -e 's/^.* [ADTSIW] //p'";\
7505 eval $xscan; $contains '^fprintf$' libc.list >/dev/null 2>&1
7511 echo "$nm didn't seem to work right. Trying $ar instead..." >&4
7513 if $ar t $libc > libc.tmp && $contains '^fprintf$' libc.tmp >/dev/null 2>&1; then
7514 for thisname in $libnames $libc; do
7515 $ar t $thisname >>libc.tmp
7517 $sed -e "s/\\$_o\$//" < libc.tmp > libc.list
7519 elif test "X$osname" = "Xos2" && $ar tv $libc > libc.tmp; then
7520 # Repeat libc to extract forwarders to DLL entries too
7521 for thisname in $libnames $libc; do
7522 $ar tv $thisname >>libc.tmp
7523 # Revision 50 of EMX has bug in $ar.
7524 # it will not extract forwarders to DLL entries
7525 # Use emximp which will extract exactly them.
7526 emximp -o tmp.imp $thisname \
7528 $sed -e 's/^\([_a-zA-Z0-9]*\) .*$/\1/p' \
7529 < tmp.imp >>libc.tmp
7532 $sed -e "s/\\$_o\$//" -e 's/^ \+//' < libc.tmp > libc.list
7535 echo "$ar didn't seem to work right." >&4
7536 echo "Maybe this is a Cray...trying bld instead..." >&4
7537 if bld t $libc | $sed -e 's/.*\///' -e "s/\\$_o:.*\$//" > libc.list
7539 for thisname in $libnames; do
7541 $sed -e 's/.*\///' -e "s/\\$_o:.*\$//" >>libc.list
7542 $ar t $thisname >>libc.tmp
7546 echo "That didn't work either. Giving up." >&4
7556 echo "Since you are compiling for PASE, extracting more symbols from libc.a ...">&4
7557 dump -Tv /lib/libc.a | awk '$7 == "/unix" {print $5 " " $8}' | grep "^SV" | awk '{print $2}' >> libc.list
7559 *) if $test -f /lib/syscalls.exp; then
7561 echo "Also extracting names from /lib/syscalls.exp for good ole AIX..." >&4
7562 $sed -n 's/^\([^ ]*\)[ ]*syscall[0-9]*[ ]*$/\1/p' /lib/syscalls.exp >>libc.list
7568 $rm -f libnames libpath
7570 : see if dld is available
7576 echo "Checking for C++..." >&4
7590 if eval $compile_ok && $run ./try >cplusplus$$; then
7591 val=`$cat cplusplus$$`
7592 echo "You are using a C++ compiler."
7595 echo "You are not using a C++ compiler."
7601 : is a C symbol defined?
7604 -v) tf=libc.tmp; tdc="";;
7605 -a) tf=libc.tmp; tdc="[]";;
7606 *) tlook="^$1\$"; tf=libc.list; tdc="()";;
7609 case "$reuseval-$4" in
7611 true-*) tx=no; eval "tval=\$$4"; case "$tval" in "") tx=yes;; esac;;
7616 case "$d_cplusplus" in
7617 $define) extern_C=\"C\";;
7619 if $test "$runnm" = true; then
7620 if $contains $tlook $tf >/dev/null 2>&1; then
7622 elif $test "$mistrustnm" = compile -o "$mistrustnm" = run; then
7623 echo "extern $extern_C void *$1$tdc; void *(*(p()))$tdc { return &$1; } int main() { if(p()) return(0); else return(1); }"> try.c;
7624 $cc -o try $optimize $ccflags $ldflags try.c >/dev/null 2>&1 $libs && tval=true;
7625 $test "$mistrustnm" = run -a -x try && { $run ./try$_exe >/dev/null 2>&1 || tval=false; };
7629 echo "extern $extern_C void *$1$tdc; void *(*(p()))$tdc { return &$1; } int main() { if(p()) return(0); else return(1); }"> try.c;
7630 $cc -o try $optimize $ccflags $ldflags try.c $libs >/dev/null 2>&1 && tval=true;
7636 $define) tval=true;;
7643 : define an is-in-libc? function
7644 inlibc='echo " "; td=$define; tu=$undef;
7645 sym=$1; var=$2; eval "was=\$$2";
7647 case "$reuseval$was" in
7657 echo "$sym() found." >&4;
7658 case "$was" in $undef) . ./whoa; esac; eval "$var=\$td";;
7660 echo "$sym() NOT found." >&4;
7661 case "$was" in $define) . ./whoa; esac; eval "$var=\$tu";;
7665 $define) echo "$sym() found." >&4;;
7666 *) echo "$sym() NOT found." >&4;;
7670 : see if dlopen exists
7672 xxx_ccflags="$ccflags"
7674 : with g++ one needs -shared to get is-in-libc to work for dlopen
7675 case "$gccversion" in
7677 *) case "$d_cplusplus" in
7678 "$define") ccflags="$ccflags -shared" ;;
7685 ccflags="$xxx_ccflags"
7687 : see if this is a unistd.h system
7688 set unistd.h i_unistd
7691 : determine which dynamic loading, if any, to compile in
7693 dldir="ext/DynaLoader"
7706 $define) dflt='y' ;;
7709 $define) dflt='y' ;;
7711 : Does a dl_xxx.xs file exist for this operating system
7712 $test -f $rsrc/$dldir/dl_${osname}.xs && dflt='y'
7715 rp="Do you wish to use dynamic loading?"
7722 if $test -f $rsrc/$dldir/dl_${osname}.xs ; then
7723 dflt="$dldir/dl_${osname}.xs"
7724 elif $test "$d_dlopen" = "$define" ; then
7725 dflt="$dldir/dl_dlopen.xs"
7726 elif $test "$i_dld" = "$define" ; then
7727 dflt="$dldir/dl_dld.xs"
7732 *) dflt="$dldir/$dlsrc"
7735 echo "The following dynamic loading files are available:"
7736 : Can not go over to $dldir because getfile has path hard-coded in.
7737 tdir=`pwd`; cd "$rsrc"; $ls -C $dldir/dl*.xs; cd "$tdir"
7738 rp="Source file to use for dynamic loading"
7744 dlsrc=`echo $ans | $sed -e 's%.*/\([^/]*\)$%\1%'`
7748 Some systems may require passing special flags to $cc -c to
7749 compile modules that will be used to create a shared library.
7750 To use no flags, say "none".
7753 case "$cccdlflags" in
7754 '') case "$gccversion" in
7755 '') case "$osname" in
7757 next) dflt='none' ;;
7758 irix*) dflt='-KPIC' ;;
7759 svr4*|esix*|solaris|nonstopux) dflt='-KPIC' ;;
7760 sunos) dflt='-pic' ;;
7764 *) case "$osname" in
7765 darwin) dflt='none' ;;
7766 linux*|svr4*|esix*|solaris|nonstopux) dflt='-fPIC' ;;
7771 *) dflt="$cccdlflags" ;;
7773 rp="Any special flags to pass to $cc -c to compile shared library modules?"
7776 none) cccdlflags=' ' ;;
7777 *) cccdlflags="$ans" ;;
7782 Some systems use ld to create libraries that can be dynamically loaded,
7783 while other systems (such as those using ELF) use $cc.
7787 '') $cat >try.c <<EOM
7788 /* Test for whether ELF binaries are produced */
7800 int i = open("a.out",O_RDONLY);
7803 if(read(i,b,4)==4 && b[0]==127 && b[1]=='E' && b[2]=='L' && b[3]=='F')
7804 exit(0); /* succeed (yes, it's ELF) */
7809 if $cc $ccflags $ldflags try.c >/dev/null 2>&1 && $run ./a.out; then
7811 You appear to have ELF support. I'll use $cc to build dynamic libraries.
7815 echo "I'll use ld to build dynamic libraries."
7824 rp="What command should be used to create dynamic libraries?"
7830 Some systems may require passing special flags to $ld to create a
7831 library that can be dynamically loaded. If your ld flags include
7832 -L/other/path options to locate libraries outside your loader's normal
7833 search path, you may need to specify those -L options here as well. To
7834 use no flags, say "none".
7837 case "$lddlflags" in
7838 '') case "$osname" in
7839 beos) dflt='-nostart' ;;
7841 case "$gccversion" in
7842 '') dflt="$dflt +vnocompatwarnings" ;;
7845 linux|irix*|gnu*) dflt="-shared $optimize" ;;
7846 next) dflt='none' ;;
7847 solaris) dflt='-G' ;;
7848 sunos) dflt='-assert nodefinitions' ;;
7849 svr4*|esix*|nonstopux) dflt="-G $ldflags" ;;
7853 *) dflt="$lddlflags" ;;
7856 : Try to guess additional flags to pick up local libraries.
7857 : Be careful not to append to a plain 'none'
7861 for thisflag in $ldflags; do
7866 *) dflt="$dflt $thisflag" ;;
7873 ''|' ') dflt='none' ;;
7876 rp="Any special flags to pass to $ld to create a dynamically loaded library?"
7879 none) lddlflags=' ' ;;
7880 *) lddlflags="$ans" ;;
7885 Some systems may require passing special flags to $cc to indicate that
7886 the resulting executable will use dynamic linking. To use no flags,
7890 case "$ccdlflags" in
7891 '') case "$osname" in
7892 linux|hpux|gnu*) dflt='-Wl,-E' ;;
7893 next|sunos) dflt='none' ;;
7897 *) dflt="$ccdlflags" ;;
7899 rp="Any special flags to pass to $cc to use dynamic linking?"
7902 none) ccdlflags=' ' ;;
7903 *) ccdlflags="$ans" ;;
7917 # No dynamic loading being used, so don't bother even to prompt.
7920 *) case "$useshrplib" in
7921 '') case "$osname" in
7922 svr4*|nonstopux|dgux|dynixptx|esix|powerux|beos|cygwin*)
7924 also='Building a shared libperl is required for dynamic loading to work on your system.'
7929 also='Building a shared libperl is needed for MAB support.'
7947 The perl executable is normally obtained by linking perlmain.c with
7948 libperl${_a}, any static extensions (usually just DynaLoader), and
7949 any other libraries needed on this system (such as -lm, etc.). Since
7950 your system supports dynamic loading, it is probably possible to build
7951 a shared libperl.$so. If you will have more than one executable linked
7952 to libperl.$so, this will significantly reduce the size of each
7953 executable, but it may have a noticeable effect on performance. The
7954 default is probably sensible for your system.
7958 rp="Build a shared libperl.$so (y/n)"
7962 useshrplib='true' ;;
7963 *) useshrplib='false' ;;
7968 case "$useshrplib" in
7972 # Figure out a good name for libperl.so. Since it gets stored in
7973 # a version-specific architecture-dependent library, the version
7974 # number isn't really that important, except for making cc/ld happy.
7976 # A name such as libperl.so.3.1
7977 majmin="libperl.$so.$patchlevel.$subversion"
7978 # A name such as libperl.so.301
7979 majonly=`echo $patchlevel $subversion |
7980 $awk '{printf "%d%02d", $1, $2}'`
7981 majonly=libperl.$so.$majonly
7982 # I'd prefer to keep the os-specific stuff here to a minimum, and
7983 # rely on figuring it out from the naming of libc.
7984 case "${osname}${osvers}" in
7987 # XXX How handle the --version stuff for MAB?
7989 linux*|gnu*) # ld won't link with a bare -lperl otherwise.
7992 cygwin*) # ld links against an importlib
7993 dflt=libperl$lib_ext
7995 *) # Try to guess based on whether libc has major.minor.
7997 *libc.$so.[0-9]*.[0-9]*) dflt=$majmin ;;
7998 *libc.$so.[0-9]*) dflt=$majonly ;;
7999 *) dflt=libperl.$so ;;
8009 I need to select a good name for the shared libperl. If your system uses
8010 library names with major and minor numbers, then you might want something
8011 like $majmin. Alternatively, if your system uses a single version
8012 number for shared libraries, then you might want to use $majonly.
8013 Or, your system might be quite happy with a simple libperl.$so.
8015 Since the shared libperl will get installed into a version-specific
8016 architecture-dependent directory, the version number of the shared perl
8017 library probably isn't important, so the default should be o.k.
8020 rp='What name do you want to give to the shared libperl?'
8023 echo "Ok, I'll use $libperl"
8026 libperl="libperl${_a}"
8030 # Detect old use of shrpdir via undocumented Configure -Dshrpdir
8034 WARNING: Use of the shrpdir variable for the installation location of
8035 the shared $libperl is not supported. It was never documented and
8036 will not work in this version. Let me (perlbug@perl.org)
8037 know of any problems this may cause.
8043 But your current setting of $shrpdir is
8044 the default anyway, so it's harmless.
8049 Further, your current attempted setting of $shrpdir
8050 conflicts with the value of $archlibexp/CORE
8051 that installperl will use.
8058 # How will the perl executable find the installed shared $libperl?
8059 # Add $xxx to ccdlflags.
8060 # If we can't figure out a command-line option, use $shrpenv to
8061 # set env LD_RUN_PATH. The main perl makefile uses this.
8062 shrpdir=$archlibexp/CORE
8065 if "$useshrplib"; then
8068 # We'll set it in Makefile.SH...
8073 freebsd|netbsd|openbsd|interix|dragonfly)
8074 xxx="-Wl,-R$shrpdir"
8076 bsdos|linux|irix*|dec_osf|gnu*)
8077 xxx="-Wl,-rpath,$shrpdir"
8080 # next doesn't like the default...
8083 # beos doesn't like the default, either.
8086 # hpux doesn't like the default, either.
8087 tmp_shrpenv="env LDOPTS=\"+s +b${shrpdir}\""
8090 tmp_shrpenv="env LD_RUN_PATH=$shrpdir"
8096 # Only add $xxx if it isn't already in ccdlflags.
8097 case " $ccdlflags " in
8099 *) ccdlflags="$ccdlflags $xxx"
8102 Adding $xxx to the flags
8103 passed to $ld so that the perl executable will find the
8104 installed shared $libperl.
8112 # Fix ccdlflags in AIX for building external extensions.
8113 # (For building Perl itself bare -bE:perl.exp is needed,
8114 # Makefile.SH takes care of this.)
8116 aix) ccdlflags="$ccdlflags -bE:$installarchlib/CORE/perl.exp" ;;
8118 # Respect a hint or command-line value.
8120 '') shrpenv="$tmp_shrpenv" ;;
8122 case "$ldlibpthname" in
8123 '') ldlibpthname=LD_LIBRARY_PATH ;;
8124 none) ldlibpthname='' ;;
8127 : determine where manual pages are on this system
8131 syspath='/usr/share/man/man1 /usr/man/man1'
8132 syspath="$syspath /usr/man/mann /usr/man/manl /usr/man/local/man1"
8133 syspath="$syspath /usr/man/u_man/man1"
8134 syspath="$syspath /usr/catman/u_man/man1 /usr/man/l_man/man1"
8135 syspath="$syspath /usr/local/man/u_man/man1 /usr/local/man/l_man/man1"
8136 syspath="$syspath /usr/man/man.L /local/man/man1 /usr/local/man/man1"
8137 sysman=`./loc . /usr/man/man1 $syspath`
8140 if $test -d "$sysman"; then
8141 echo "System manual is in $sysman." >&4
8143 echo "Could not find manual pages in source form." >&4
8146 : determine where manual pages go
8147 set man1dir man1dir none
8151 $spackage has manual pages available in source form.
8155 echo "However, you don't have nroff, so they're probably useless to you."
8157 '') man1dir="none";;
8160 echo "If you don't want the manual sources installed, answer 'none'."
8165 lookpath="$prefixexp/share/man/man1"
8166 lookpath="$lookpath $prefixexp/man/man1 $prefixexp/man/l_man/man1"
8167 lookpath="$lookpath $prefixexp/man/p_man/man1"
8168 lookpath="$lookpath $prefixexp/man/u_man/man1"
8169 lookpath="$lookpath $prefixexp/man/man.1"
8171 */?_man*) dflt=`./loc . $prefixexp/l_man/man1 $lookpath` ;;
8172 *) dflt=`./loc . $prefixexp/man/man1 $lookpath` ;;
8182 rp="Where do the main $spackage manual pages (source) go?"
8184 if $test "X$man1direxp" != "X$ansexp"; then
8195 : What suffix to use on installed man pages
8202 rp="What suffix should be used for the main $spackage man pages?"
8204 '') case "$man1dir" in
8218 *) dflt="$man1ext";;
8225 : see if we can have long filenames
8227 first=123456789abcdef
8229 if (echo hi >$first) 2>/dev/null; then
8230 if $test -f 123456789abcde; then
8231 echo 'You cannot have filenames longer than 14 characters. Sigh.' >&4
8234 echo 'You can have filenames longer than 14 characters.'>&4
8239 You can't have filenames longer than 14 chars.
8240 You can't even think about them!
8246 $rm -rf 123456789abcde*
8248 : determine where library module manual pages go
8249 set man3dir man3dir none
8253 $spackage has manual pages for many of the library modules.
8259 However, you don't have nroff, so they're probably useless to you.
8262 '') man3dir="none";;
8266 case "$d_flexfnam" in
8269 However, your system can't handle the long file names like File::Basename.3.
8272 '') man3dir="none";;
8276 echo "If you don't want the manual sources installed, answer 'none'."
8277 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
8279 '') dflt=`echo "$man1dir" | $sed -e 's/man1/man3/g' -e 's/man\.1/man\.3/g'`
8280 if $test -d "$privlib/man/man3"; then
8283 WARNING: Previous versions of perl installed man3 pages into
8284 $privlib/man/man3. This version will suggest a
8285 new default of $dflt.
8289 rp='Do you wish to preserve the old behavior?(y/n)'
8292 y*) dflt="$privlib/man/man3" ;;
8297 *) dflt="$man3dir" ;;
8304 rp="Where do the $package library man pages (source) go?"
8314 : What suffix to use on installed man pages
8320 rp="What suffix should be used for the $package library man pages?"
8322 '') case "$man3dir" in
8336 *) dflt="$man3ext";;
8343 : see if we have to deal with yellow pages, now NIS.
8344 if $test -d /usr/etc/yp || $test -d /etc/yp || $test -d /usr/lib/yp; then
8345 if $test -f /usr/etc/nibindd; then
8347 echo "I'm fairly confident you're on a NeXT."
8349 rp='Do you get the hosts file via NetInfo?'
8358 y*) hostcat='nidump hosts .';;
8359 *) case "$hostcat" in
8360 nidump*) hostcat='';;
8370 '') if $contains '^\+' /etc/passwd >/dev/null 2>&1; then
8378 rp='Are you getting the hosts file via yellow pages?'
8381 y*) hostcat='ypcat hosts';;
8382 *) hostcat='cat /etc/hosts';;
8388 '') test -f /etc/hosts && hostcat='cat /etc/hosts';;
8391 '') test -f /etc/group && groupcat='cat /etc/group';;
8394 '') test -f /etc/passwd && passcat='cat /etc/passwd';;
8397 : now get the host name
8399 echo "Figuring out host name..." >&4
8400 case "$myhostname" in
8402 echo 'Maybe "hostname" will work...'
8403 if tans=`sh -c hostname 2>&1` ; then
8411 if $test "$cont"; then
8413 echo 'Oh, dear. Maybe "/etc/systemid" is the key...'
8414 if tans=`cat /etc/systemid 2>&1` ; then
8416 phostname='cat /etc/systemid'
8417 echo "Whadyaknow. Xenix always was a bit strange..."
8420 elif $test -r /etc/systemid; then
8421 echo "(What is a non-Xenix system doing with /etc/systemid?)"
8424 if $test "$cont"; then
8425 echo 'No, maybe "uuname -l" will work...'
8426 if tans=`sh -c 'uuname -l' 2>&1` ; then
8428 phostname='uuname -l'
8430 echo 'Strange. Maybe "uname -n" will work...'
8431 if tans=`sh -c 'uname -n' 2>&1` ; then
8433 phostname='uname -n'
8435 echo 'Oh well, maybe I can mine it out of whoami.h...'
8436 if tans=`sh -c $contains' sysname $usrinc/whoami.h' 2>&1` ; then
8437 myhostname=`echo "$tans" | $sed 's/^.*"\(.*\)"/\1/'`
8438 phostname="sed -n -e '"'/sysname/s/^.*\"\\(.*\\)\"/\1/{'"' -e p -e q -e '}' <$usrinc/whoami.h"
8440 case "$myhostname" in
8441 '') echo "Does this machine have an identity crisis or something?"
8444 echo "Well, you said $myhostname before..."
8445 phostname='echo $myhostname';;
8451 case "$myhostname" in
8452 '') myhostname=noname ;;
8454 : you do not want to know about this
8459 if $test "$myhostname" ; then
8461 rp='Your host name appears to be "'$myhostname'".'" Right?"
8469 : bad guess or no guess
8470 while $test "X$myhostname" = X ; do
8472 rp="Please type the (one word) name of your host:"
8477 : translate upper to lower if necessary
8478 case "$myhostname" in
8480 echo "(Normalizing case in your host name)"
8481 myhostname=`echo $myhostname | ./tr '[A-Z]' '[a-z]'`
8485 case "$myhostname" in
8487 dflt=`expr "X$myhostname" : "X[^.]*\(\..*\)"`
8488 myhostname=`expr "X$myhostname" : "X\([^.]*\)\."`
8489 echo "(Trimming domain name from host name--host name is now $myhostname)"
8491 *) case "$mydomain" in
8494 test "X$hostcat" = "Xypcat hosts" &&
8495 ypmatch "$myhostname" hosts 2>/dev/null |\
8496 $sed -e 's/[ ]*#.*//; s/$/ /' > hosts && \
8499 test "X$hostcat" != "X" &&
8500 $hostcat | $sed -n -e "s/[ ]*#.*//; s/\$/ /
8501 /[ ]$myhostname[ . ]/p" > hosts
8504 if $test -f hosts; then
8505 $test x`$awk "/[0-9].*[ ]$myhostname$tmp_re/ { sum++ }
8506 END { print sum }" hosts` = x1 || tmp_re="[ ]"
8507 dflt=.`$awk "/[0-9].*[ ]$myhostname$tmp_re/ {for(i=2; i<=NF;i++) print \\\$i}" \
8508 hosts | $sort | $uniq | \
8509 $sed -n -e "s/$myhostname\.\([-a-zA-Z0-9_.]\)/\1/p"`
8510 case `$echo X$dflt` in
8511 X*\ *) echo "(Several hosts in the database matched hostname)"
8514 X.) echo "(You do not have fully-qualified names in the hosts database)"
8518 echo "(I cannot locate a hosts database anywhere)"
8523 tans=`./loc resolv.conf X /etc /usr/etc`
8524 if $test -f "$tans"; then
8525 echo "(Attempting domain name extraction from $tans)"
8526 dflt=.`$sed -n -e 's/ / /g' \
8527 -e 's/^search *\([^ ]*\).*/\1/p' $tans \
8528 | ./tr '[A-Z]' '[a-z]' 2>/dev/null`
8530 .) dflt=.`$sed -n -e 's/ / /g' \
8531 -e 's/^domain *\([^ ]*\).*/\1/p' $tans \
8532 | ./tr '[A-Z]' '[a-z]' 2>/dev/null`
8539 .) echo "(No help from resolv.conf either -- attempting clever guess)"
8540 dflt=.`sh -c domainname 2>/dev/null`
8543 .nis.*|.yp.*|.main.*) dflt=`echo $dflt | $sed -e 's/^\.[^.]*//'`;;
8547 case "$dflt$osname" in
8548 .os390) echo "(Attempting domain name extraction from //'SYS1.TCPPARMS(TCPDATA)')"
8549 dflt=.`awk '/^DOMAINORIGIN/ {print $2}' "//'SYS1.TCPPARMS(TCPDATA)'" 2>/dev/null`
8553 .) echo "(Lost all hope -- silly guess then)"
8559 *) dflt="$mydomain";;
8563 rp="What is your domain name?"
8573 : translate upper to lower if necessary
8576 echo "(Normalizing case in your domain name)"
8577 mydomain=`echo $mydomain | ./tr '[A-Z]' '[a-z]'`
8581 : a little sanity check here
8582 case "$phostname" in
8585 case `$phostname | ./tr '[A-Z]' '[a-z]'` in
8586 $myhostname$mydomain|$myhostname) ;;
8588 case "$phostname" in
8590 echo "(That doesn't agree with your whoami.h file, by the way.)"
8593 echo "(That doesn't agree with your $phostname command, by the way.)"
8603 I need to get your e-mail address in Internet format if possible, i.e.
8604 something like user@host.domain. Please answer accurately since I have
8605 no easy means to double check it. The default value provided below
8606 is most probably close to reality but may not be valid from outside
8607 your organization...
8611 while test "$cont"; do
8613 '') dflt="$cf_by@$myhostname$mydomain";;
8614 *) dflt="$cf_email";;
8616 rp='What is your e-mail address?'
8622 rp='Address does not look like an Internet one. Use it anyway?'
8638 If you or somebody else will be maintaining perl at your site, please
8639 fill in the correct e-mail address here so that they may be contacted
8640 if necessary. Currently, the "perlbug" program included with perl
8641 will send mail to this address in addition to perlbug@perl.org. You may
8642 enter "none" for no administrator.
8645 case "$perladmin" in
8646 '') dflt="$cf_email";;
8647 *) dflt="$perladmin";;
8649 rp='Perl administrator e-mail address'
8653 : determine whether to only install version-specific parts.
8656 Do you want to install only the version-specific parts of the perl
8657 distribution? Usually you do *not* want to do this.
8659 case "$versiononly" in
8660 "$define"|[Yy]*|true) dflt='y' ;;
8663 rp="Do you want to install only the version-specific parts of perl?"
8666 [yY]*) val="$define";;
8672 case "$versiononly" in
8673 "$define") inc_version_list=''
8674 inc_version_list_init=0
8678 : figure out how to guarantee perl startup
8679 : XXX Note that this currently takes advantage of the bug that binexp ignores
8680 : the Configure -Dinstallprefix setting, which in turn means that under
8681 : relocatable @INC, initialinstalllocation is what binexp started as.
8682 case "$startperl" in
8684 case "$sharpbang" in
8688 I can use the #! construct to start perl on your system. This will
8689 make startup of perl scripts faster, but may cause problems if you
8690 want to share those scripts and perl is not in a standard place
8691 ($initialinstalllocation/perl) on all your platforms. The alternative
8692 is to force a shell by starting the script with a single ':' character.
8695 case "$versiononly" in
8696 "$define") dflt="$initialinstalllocation/perl$version";;
8697 *) dflt="$initialinstalllocation/perl";;
8699 rp='What shall I put after the #! to start up perl ("none" to not use #!)?'
8702 none) startperl=": # use perl";;
8703 *) startperl="#!$ans"
8704 if $test 30 -lt `echo "$ans" | wc -c`; then
8707 WARNING: Some systems limit the #! command to 32 characters.
8708 If you experience difficulty running Perl scripts with #!, try
8709 installing Perl in a directory with a shorter pathname.
8715 *) startperl=": # use perl"
8720 echo "I'll use $startperl to start perl scripts."
8722 : figure best path for perl in scripts
8725 case "$versiononly" in
8726 "$define") perlpath="$initialinstalllocation/perl$version";;
8727 *) perlpath="$initialinstalllocation/perl";;
8729 case "$startperl" in
8734 I will use the "eval 'exec'" idiom to start Perl on your system.
8735 I can use the full path of your Perl binary for this purpose, but
8736 doing so may cause problems if you want to share those scripts and
8737 Perl is not always in a standard place ($initialinstalllocation/perl).
8740 dflt="$initialinstalllocation/perl"
8741 rp="What path shall I use in \"eval 'exec'\"?"
8748 case "$startperl" in
8750 *) echo "I'll use $perlpath in \"eval 'exec'\"" ;;
8753 : determine where public executable scripts go
8754 set scriptdir scriptdir
8756 case "$scriptdir" in
8759 : guess some guesses
8760 $test -d /usr/share/scripts && dflt=/usr/share/scripts
8761 $test -d /usr/share/bin && dflt=/usr/share/bin
8762 $test -d /usr/local/script && dflt=/usr/local/script
8763 $test -d /usr/local/scripts && dflt=/usr/local/scripts
8764 $test -d $prefixexp/script && dflt=$prefixexp/script
8768 *) dflt="$scriptdir"
8773 Some installations have a separate directory just for executable scripts so
8774 that they can mount it across multiple architectures but keep the scripts in
8775 one spot. You might, for example, have a subdirectory of /usr/share for this.
8776 Or you might just lump your scripts in with all your other executables.
8780 rp='Where do you keep publicly executable scripts?'
8782 if $test "X$ansexp" != "X$scriptdirexp"; then
8788 : A little fix up for an irregularly named variable.
8789 installscript="$installscriptdir"
8791 : determine where add-on public executables go
8793 '') dflt=$siteprefix/bin ;;
8797 rp='Pathname where the add-on public executables should be installed?'
8802 : determine where add-on html pages go
8803 : There is no standard location, so try to copy the previously-selected
8804 : directory structure for the core html pages.
8805 case "$sitehtml1dir" in
8806 '') dflt=`echo "$html1dir" | $sed "s#^$prefix#$siteprefix#"` ;;
8807 *) dflt=$sitehtml1dir ;;
8810 ''|' ') dflt=none ;;
8813 rp='Pathname where the site-specific html pages should be installed?'
8815 prefixvar=sitehtml1dir
8818 : determine where add-on library html pages go
8819 : There is no standard location, so try to copy the previously-selected
8820 : directory structure for the core html pages.
8821 case "$sitehtml3dir" in
8822 '') dflt=`echo "$html3dir" | $sed "s#^$prefix#$siteprefix#"` ;;
8823 *) dflt=$sitehtml3dir ;;
8826 ''|' ') dflt=none ;;
8829 rp='Pathname where the site-specific library html pages should be installed?'
8831 prefixvar=sitehtml3dir
8834 : determine where add-on manual pages go
8835 case "$siteman1dir" in
8836 '') dflt=`echo $man1dir | $sed "s#^$prefix#$siteprefix#"` ;;
8837 *) dflt=$siteman1dir ;;
8840 ''|' ') dflt=none ;;
8843 rp='Pathname where the site-specific manual pages should be installed?'
8845 prefixvar=siteman1dir
8848 : determine where add-on library man pages go
8849 case "$siteman3dir" in
8850 '') dflt=`echo $man3dir | $sed "s#^$prefix#$siteprefix#"` ;;
8851 *) dflt=$siteman3dir ;;
8854 ''|' ') dflt=none ;;
8857 rp='Pathname where the site-specific library manual pages should be installed?'
8859 prefixvar=siteman3dir
8862 : determine where add-on public executable scripts go
8863 case "$sitescript" in
8864 '') dflt=$siteprefix/script
8865 $test -d $dflt || dflt=$sitebin ;;
8866 *) dflt="$sitescript" ;;
8869 rp='Pathname where add-on public executable scripts should be installed?'
8871 prefixvar=sitescript
8874 case "$usefaststdio" in
8875 $define|true|[yY]*|'')
8876 xversion=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
8886 Perl can be built to use 'fast stdio', which means using the stdio
8887 library but also directly manipulating the stdio buffers to enable
8888 faster I/O. Using stdio is better for backward compatibility (especially
8889 for Perl extensions), but on the other hand since Perl 5.8 the 'perlio'
8890 interface has been preferred instead of stdio.
8892 If this doesn't make any sense to you, just accept the default '$dflt'.
8894 rp='Use the "fast stdio" if available?'
8897 y|Y) val="$define" ;;
8904 : define an is-a-typedef? function
8905 typedef='type=$1; var=$2; def=$3; shift; shift; shift; inclist=$@;
8907 "") inclist="sys/types.h";;
8909 eval "varval=\$$var";
8913 for inc in $inclist; do
8914 echo "#include <$inc>" >>temp.c;
8916 echo "#ifdef $type" >> temp.c;
8917 echo "printf(\"We have $type\");" >> temp.c;
8918 echo "#endif" >> temp.c;
8919 $cppstdin $cppflags $cppminus < temp.c >temp.E 2>/dev/null;
8920 if $contains $type temp.E >/dev/null 2>&1; then
8926 *) eval "$var=\$varval";;
8929 : define an is-a-typedef? function that prompts if the type is not available.
8930 typedef_ask='type=$1; var=$2; def=$3; shift; shift; shift; inclist=$@;
8932 "") inclist="sys/types.h";;
8934 eval "varval=\$$var";
8938 for inc in $inclist; do
8939 echo "#include <$inc>" >>temp.c;
8941 echo "#ifdef $type" >> temp.c;
8942 echo "printf(\"We have $type\");" >> temp.c;
8943 echo "#endif" >> temp.c;
8944 $cppstdin $cppflags $cppminus < temp.c >temp.E 2>/dev/null;
8946 echo "$rp" | $sed -e "s/What is/Looking for/" -e "s/?/./";
8947 if $contains $type temp.E >/dev/null 2>&1; then
8948 echo "$type found." >&4;
8951 echo "$type NOT found." >&4;
8957 *) eval "$var=\$varval";;
8960 : see what type lseek is declared as in the kernel
8961 rp="What is the type used for lseek's offset on this system?"
8962 set off_t lseektype long stdio.h sys/types.h
8966 echo "Checking to see how big your file offsets are..." >&4
8968 #include <sys/types.h>
8972 printf("%d\n", (int)sizeof($lseektype));
8977 if eval $compile_ok; then
8978 lseeksize=`$run ./try`
8979 echo "Your file offsets are $lseeksize bytes long."
8983 echo "(I can't seem to compile the test program. Guessing...)"
8984 rp="What is the size of your file offsets (in bytes)?"
8990 : see what type file positions are declared as in the library
8991 rp="What is the type for file position used by fsetpos()?"
8992 set fpos_t fpostype long stdio.h sys/types.h
8997 *_t) zzz="$fpostype" ;;
9000 echo "Checking the size of $zzz..." >&4
9002 #include <sys/types.h>
9009 printf("%d\n", (int)sizeof($fpostype));
9014 if eval $compile_ok; then
9018 echo "(I can't execute the test program--guessing $fpossize.)" >&4
9021 echo "Your $zzz is $fpossize bytes long."
9027 echo "(I can't compile the test program. Guessing...)" >&4
9028 rp="What is the size of your file positions (in bytes)?"
9033 # Backward compatibility (uselfs is deprecated).
9035 "$define"|true|[yY]*)
9038 *** Configure -Duselfs is deprecated, using -Duselargefiles instead.
9040 uselargefiles="$define"
9044 case "$lseeksize:$fpossize" in
9047 You can have files larger than 2 gigabytes.
9050 *) case "$uselargefiles" in
9051 "$undef"|false|[nN]*) dflt='n' ;;
9056 Perl can be built to understand large files (files larger than 2 gigabytes)
9057 on some systems. To do so, Configure can be run with -Duselargefiles.
9059 If this doesn't make any sense to you, just accept the default '$dflt'.
9061 rp='Try to understand large files, if available?'
9064 y|Y) val="$define" ;;
9071 : Look for a hint-file generated 'call-back-unit'. If the
9072 : user has specified that a large files perl is to be built,
9073 : we may need to set or change some other defaults.
9074 if $test -f uselargefiles.cbu; then
9075 echo "Your platform has some specific hints regarding large file builds, using them..."
9076 . ./uselargefiles.cbu
9078 case "$uselargefiles" in
9080 if $test -f uselargefiles.cbu; then
9082 echo "Rechecking to see how big your file offsets are..." >&4
9084 #include <sys/types.h>
9088 printf("%d\n", (int)sizeof($lseektype));
9093 if eval $compile_ok; then
9094 lseeksize=`$run ./try`
9095 $echo "Your file offsets are now $lseeksize bytes long."
9099 echo "(I can't seem to compile the test program. Guessing...)"
9100 rp="What is the size of your file offsets (in bytes)?"
9105 *_t) zzz="$fpostype" ;;
9108 $echo $n "Rechecking the size of $zzz...$c" >&4
9110 #include <sys/types.h>
9117 printf("%d\n", (int)sizeof($fpostype));
9122 if eval $compile_ok; then
9127 echo "(I can't execute the test program--guessing $fpossize.)" >&4
9130 echo " $fpossize bytes." >&4
9136 echo "(I can't compile the test program. Guessing...)" >&4
9137 rp="What is the size of your file positions (in bytes)?"
9146 case "$vendorprefix" in
9147 '') d_vendorbin="$undef"
9151 *) d_vendorbin="$define"
9152 : determine where vendor-supplied executables go.
9153 case "$vendorbin" in
9154 '') dflt=$vendorprefix/bin ;;
9155 *) dflt="$vendorbin" ;;
9158 rp='Pathname for the vendor-supplied executables directory?'
9161 vendorbinexp="$ansexp"
9167 case "$vendorprefix" in
9168 '') vendorhtml1dir=''
9169 vendorhtml1direxp=''
9171 *) : determine where vendor-supplied html pages go.
9172 : There is no standard location, so try to copy the previously-selected
9173 : directory structure for the core html pages.
9174 : XXX Better default suggestions would be welcome.
9175 case "$vendorhtml1dir" in
9176 '') dflt=`echo "$html1dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
9177 *) dflt=$vendorhtml1dir ;;
9180 ''|' ') dflt=none ;;
9183 rp='Pathname for the vendor-supplied html pages?'
9185 vendorhtml1dir="$ans"
9186 vendorhtml1direxp="$ansexp"
9189 : Use ' ' for none so value is preserved next time through Configure
9190 $test X"$vendorhtml1dir" = "X" && vendorhtml1dir=' '
9191 prefixvar=vendorhtml1dir
9194 case "$vendorprefix" in
9195 '') vendorhtml3dir=''
9196 vendorhtml3direxp=''
9198 *) : determine where vendor-supplied module html pages go.
9199 : There is no standard location, so try to copy the previously-selected
9200 : directory structure for the core html pages.
9201 : XXX Better default suggestions would be welcome.
9202 case "$vendorhtml3dir" in
9203 '') dflt=`echo "$html3dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
9204 *) dflt=$vendorhtml3dir ;;
9207 ''|' ') dflt=none ;;
9210 rp='Pathname for the vendor-supplied html pages?'
9212 vendorhtml3dir="$ans"
9213 vendorhtml3direxp="$ansexp"
9216 : Use ' ' for none so value is preserved next time through Configure
9217 $test X"$vendorhtml3dir" = "X" && vendorhtml3dir=' '
9218 prefixvar=vendorhtml3dir
9221 case "$vendorprefix" in
9222 '') vendorman1dir=''
9225 *) : determine where vendor-supplied manual pages go.
9226 case "$vendorman1dir" in
9227 '') dflt=`echo "$man1dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
9228 *) dflt=$vendorman1dir ;;
9231 ''|' ') dflt=none ;;
9234 rp='Pathname for the vendor-supplied manual section 1 pages?'
9236 vendorman1dir="$ans"
9237 vendorman1direxp="$ansexp"
9240 : Use ' ' for none so value is preserved next time through Configure
9241 $test X"$vendorman1dir" = "X" && vendorman1dir=' '
9242 prefixvar=vendorman1dir
9245 case "$vendorprefix" in
9246 '') vendorman3dir=''
9249 *) : determine where vendor-supplied module manual pages go.
9250 case "$vendorman3dir" in
9251 '') dflt=`echo "$man3dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
9252 *) dflt=$vendorman3dir ;;
9255 ''|' ') dflt=none ;;
9258 rp='Pathname for the vendor-supplied manual section 3 pages?'
9260 vendorman3dir="$ans"
9261 vendorman3direxp="$ansexp"
9264 : Use ' ' for none so value is preserved next time through Configure
9265 $test X"$vendorman3dir" = "X" && vendorman3dir=' '
9266 prefixvar=vendorman3dir
9269 case "$vendorprefix" in
9270 '') d_vendorscript="$undef"
9274 *) d_vendorscript="$define"
9275 : determine where vendor-supplied scripts go.
9276 case "$vendorscript" in
9277 '') dflt=$vendorprefix/script
9278 $test -d $dflt || dflt=$vendorbin ;;
9279 *) dflt="$vendorscript" ;;
9283 The installation process will create a directory for
9284 vendor-supplied scripts.
9288 rp='Pathname for the vendor-supplied scripts directory?'
9291 vendorscriptexp="$ansexp"
9294 prefixvar=vendorscript
9297 : see if qgcvt exists
9303 if $test X"$d_longdbl" = X"$define"; then
9305 echo "Checking how to print long doubles..." >&4
9307 if $test X"$sPRIfldbl" = X -a X"$doublesize" = X"$longdblsize"; then
9308 $cat >try.c <<'EOCP'
9309 #include <sys/types.h>
9313 printf("%.3f\n", d);
9317 if eval $compile; then
9321 sPRIfldbl='"f"'; sPRIgldbl='"g"'; sPRIeldbl='"e"';
9322 sPRIFUldbl='"F"'; sPRIGUldbl='"G"'; sPRIEUldbl='"E"';
9323 echo "We will use %f."
9329 if $test X"$sPRIfldbl" = X; then
9330 $cat >try.c <<'EOCP'
9331 #include <sys/types.h>
9334 long double d = 123.456;
9335 printf("%.3Lf\n", d);
9339 if eval $compile; then
9343 sPRIfldbl='"Lf"'; sPRIgldbl='"Lg"'; sPRIeldbl='"Le"';
9344 sPRIFUldbl='"LF"'; sPRIGUldbl='"LG"'; sPRIEUldbl='"LE"';
9345 echo "We will use %Lf."
9351 if $test X"$sPRIfldbl" = X; then
9352 $cat >try.c <<'EOCP'
9353 #include <sys/types.h>
9356 long double d = 123.456;
9357 printf("%.3llf\n", d);
9361 if eval $compile; then
9365 sPRIfldbl='"llf"'; sPRIgldbl='"llg"'; sPRIeldbl='"lle"';
9366 sPRIFUldbl='"llF"'; sPRIGUldbl='"llG"'; sPRIEUldbl='"llE"';
9367 echo "We will use %llf."
9373 if $test X"$sPRIfldbl" = X; then
9374 $cat >try.c <<'EOCP'
9375 #include <sys/types.h>
9378 long double d = 123.456;
9379 printf("%.3lf\n", d);
9383 if eval $compile; then
9387 sPRIfldbl='"lf"'; sPRIgldbl='"lg"'; sPRIeldbl='"le"';
9388 sPRIFUldbl='"lF"'; sPRIGUldbl='"lG"'; sPRIEUldbl='"lE"';
9389 echo "We will use %lf."
9395 if $test X"$sPRIfldbl" = X; then
9396 echo "Cannot figure out how to print long doubles." >&4
9398 sSCNfldbl=$sPRIfldbl # expect consistency
9405 case "$sPRIfldbl" in
9406 '') d_PRIfldbl="$undef"; d_PRIgldbl="$undef"; d_PRIeldbl="$undef";
9407 d_PRIFUldbl="$undef"; d_PRIGUldbl="$undef"; d_PRIEUldbl="$undef";
9408 d_SCNfldbl="$undef";
9410 *) d_PRIfldbl="$define"; d_PRIgldbl="$define"; d_PRIeldbl="$define";
9411 d_PRIFUldbl="$define"; d_PRIGUldbl="$define"; d_PRIEUldbl="$define";
9412 d_SCNfldbl="$define";
9416 : Check how to convert floats to strings.
9418 if test "X$d_Gconvert" = X; then
9421 echo "Checking for an efficient way to convert floats to strings."
9423 case "$uselongdouble" in
9424 "$define") echo "#define USE_LONG_DOUBLE" >>try.c ;;
9426 case "$d_longdbl" in
9427 "$define") echo "#define HAS_LONG_DOUBLE" >>try.c ;;
9429 case "$d_PRIgldbl" in
9430 "$define") echo "#define HAS_PRIgldbl" >>try.c ;;
9434 #define Gconvert(x,n,t,b) gconvert((x),(n),(t),(b))
9435 char *myname = "gconvert";
9438 #define Gconvert(x,n,t,b) gcvt((x),(n),(b))
9439 char *myname = "gcvt";
9442 #define Gconvert(x,n,t,b) qgcvt((x),(n),(b))
9443 char *myname = "qgcvt";
9444 #define DOUBLETYPE long double
9447 #if defined(USE_LONG_DOUBLE) && defined(HAS_LONG_DOUBLE)
9449 #define Gconvert(x,n,t,b) sprintf((b),"%.*"$sPRIgldbl,(n),(x))
9451 #define Gconvert(x,n,t,b) sprintf((b),"%.*g",(n),(double)(x))
9454 #define Gconvert(x,n,t,b) sprintf((b),"%.*g",(n),(x))
9456 char *myname = "sprintf";
9460 #if defined(USE_LONG_DOUBLE) && defined(HAS_LONG_DOUBLE)
9461 #define DOUBLETYPE long double
9463 #define DOUBLETYPE double
9469 #define I_STDLIB $i_stdlib
9475 checkit(expect, got)
9479 if (strcmp(expect, got)) {
9480 printf("%s oddity: Expected %s, got %s\n",
9481 myname, expect, got);
9491 /* This must be 1st test on (which?) platform */
9492 /* Alan Burlison <AlanBurlsin@unn.unisys.com> */
9493 Gconvert((DOUBLETYPE)0.1, 8, 0, buf);
9494 checkit("0.1", buf);
9496 Gconvert((DOUBLETYPE)0.01, 8, 0, buf);
9497 checkit("0.01", buf);
9499 Gconvert((DOUBLETYPE)0.001, 8, 0, buf);
9500 checkit("0.001", buf);
9502 Gconvert((DOUBLETYPE)0.0001, 8, 0, buf);
9503 checkit("0.0001", buf);
9505 Gconvert((DOUBLETYPE)0.00009, 8, 0, buf);
9506 if (strlen(buf) > 5)
9507 checkit("9e-005", buf); /* for Microsoft ?? */
9509 checkit("9e-05", buf);
9511 Gconvert((DOUBLETYPE)1.0, 8, 0, buf);
9514 Gconvert((DOUBLETYPE)1.1, 8, 0, buf);
9515 checkit("1.1", buf);
9517 Gconvert((DOUBLETYPE)1.01, 8, 0, buf);
9518 checkit("1.01", buf);
9520 Gconvert((DOUBLETYPE)1.001, 8, 0, buf);
9521 checkit("1.001", buf);
9523 Gconvert((DOUBLETYPE)1.0001, 8, 0, buf);
9524 checkit("1.0001", buf);
9526 Gconvert((DOUBLETYPE)1.00001, 8, 0, buf);
9527 checkit("1.00001", buf);
9529 Gconvert((DOUBLETYPE)1.000001, 8, 0, buf);
9530 checkit("1.000001", buf);
9532 Gconvert((DOUBLETYPE)0.0, 8, 0, buf);
9535 Gconvert((DOUBLETYPE)-1.0, 8, 0, buf);
9538 /* Some Linux gcvt's give 1.e+5 here. */
9539 Gconvert((DOUBLETYPE)100000.0, 8, 0, buf);
9540 checkit("100000", buf);
9542 /* Some Linux gcvt's give -1.e+5 here. */
9543 Gconvert((DOUBLETYPE)-100000.0, 8, 0, buf);
9544 checkit("-100000", buf);
9546 Gconvert((DOUBLETYPE)123.456, 8, 0, buf);
9547 checkit("123.456", buf);
9549 /* Testing of 1e+129 in bigintpm.t must not get extra '.' here. */
9550 Gconvert((DOUBLETYPE)1e34, 8, 0, buf);
9551 /* 34 should be enough to scare even long double
9552 * places into using the e notation. */
9553 if (strlen(buf) > 5)
9554 checkit("1e+034", buf); /* for Microsoft */
9556 checkit("1e+34", buf);
9558 /* For Perl, if you add additional tests here, also add them to
9559 * t/base/num.t for benefit of platforms not using Configure or
9560 * overriding d_Gconvert */
9565 : first add preferred functions to our list
9567 for xxx_convert in $gconvert_preference; do
9568 case $xxx_convert in
9569 gcvt|gconvert|sprintf) xxx_list="$xxx_list $xxx_convert" ;;
9570 *) echo "Discarding unrecognized gconvert_preference $xxx_convert" >&4 ;;
9573 : then add any others
9574 for xxx_convert in gconvert gcvt sprintf; do
9577 *) xxx_list="$xxx_list $xxx_convert" ;;
9581 case "$d_longdbl$uselongdouble" in
9583 : again, add prefered functions to our list first
9585 for xxx_convert in $gconvert_ld_preference; do
9586 case $xxx_convert in
9587 qgcvt|gcvt|gconvert|sprintf) xxx_ld_list="$xxx_ld_list $xxx_convert" ;;
9588 *) echo "Discarding unrecognized gconvert_ld_preference $xxx_convert" ;;
9591 : then add qgcvt, sprintf--then, in xxx_list order, gconvert and gcvt
9592 for xxx_convert in qgcvt sprintf $xxx_list; do
9593 case "$xxx_ld_list" in
9594 $xxx_convert*|*" $xxx_convert"*) ;;
9595 *) xxx_ld_list="$xxx_ld_list $xxx_convert" ;;
9598 : if sprintf cannot do long doubles, move it to the end
9599 if test "$d_PRIgldbl" != "$define"; then
9600 xxx_ld_list="`echo $xxx_ld_list|sed s/sprintf//` sprintf"
9602 : if no qgcvt, remove it
9603 if test "$d_qgcvt" != "$define"; then
9604 xxx_ld_list="`echo $xxx_ld_list|sed s/qgcvt//`"
9607 xxx_list="$xxx_ld_list"
9611 for xxx_convert in $xxx_list; do
9612 echo "Trying $xxx_convert..."
9614 set try -DTRY_$xxx_convert
9615 if eval $compile; then
9616 echo "$xxx_convert() found." >&4
9618 echo "I'll use $xxx_convert to convert floats into a string." >&4
9621 echo "...But $xxx_convert didn't work as I expected."
9625 echo "$xxx_convert NOT found." >&4
9629 if test X$xxx_convert = X; then
9630 echo "*** WHOA THERE!!! ***" >&4
9631 echo "None of ($xxx_list) seemed to work properly. I'll use sprintf." >&4
9635 case "$xxx_convert" in
9636 gconvert) d_Gconvert='gconvert((x),(n),(t),(b))' ;;
9637 gcvt) d_Gconvert='gcvt((x),(n),(b))' ;;
9638 qgcvt) d_Gconvert='qgcvt((x),(n),(b))' ;;
9639 *) case "$uselongdouble$d_longdbl$d_PRIgldbl" in
9640 "$define$define$define")
9641 d_Gconvert="sprintf((b),\"%.*\"$sPRIgldbl,(n),(x))" ;;
9642 "$define$define$undef")
9643 d_Gconvert='sprintf((b),"%.*g",(n),(double)(x))' ;;
9644 *) d_Gconvert='sprintf((b),"%.*g",(n),(x))' ;;
9651 : see if _fwalk exists
9655 : Initialize h_fcntl
9658 : Initialize h_sysfile
9661 : access call always available on UNIX
9665 : locate the flags for 'access()'
9669 $cat >access.c <<EOCP
9670 #include <sys/types.h>
9675 #include <sys/file.h>
9688 : check sys/file.h first, no particular reason here
9689 if $test `./findhdr sys/file.h` && \
9690 $cc -o access $cppflags -DI_SYS_FILE access.c >/dev/null 2>&1 ; then
9692 echo "<sys/file.h> defines the *_OK access constants." >&4
9693 elif $test `./findhdr fcntl.h` && \
9694 $cc -o access $cppflags -DI_FCNTL access.c >/dev/null 2>&1 ; then
9696 echo "<fcntl.h> defines the *_OK access constants." >&4
9697 elif $test `./findhdr unistd.h` && \
9698 $cc -o access $cppflags -DI_UNISTD access.c >/dev/null 2>&1 ; then
9699 echo "<unistd.h> defines the *_OK access constants." >&4
9701 echo "I can't find the four *_OK access constants--I'll use mine." >&4
9707 : see if accessx exists
9708 set accessx d_accessx
9711 : see if aintl exists
9715 : see if alarm exists
9719 : see if POSIX threads are available
9720 set pthread.h i_pthread
9723 : define a fucntion to check prototypes
9724 $cat > protochk <<EOSH
9727 optimize="$optimize"
9729 prototype="$prototype"
9732 usethreads=$usethreads
9733 i_pthread=$i_pthread
9734 pthread_h_first=$pthread_h_first
9737 $cat >> protochk <<'EOSH'
9742 while test $# -ge 2; do
9744 $define) echo "#include <$2>" >> try.c ;;
9745 literal) echo "$2" >> try.c ;;
9747 # Extra magic for the benefit of systems that need pthread.h
9748 # to be included early to correctly detect threadsafe functions.
9749 # Such functions must guarantee themselves, though, that the usethreads
9750 # and i_pthread have been defined, before calling protochk.
9751 if test "$usethreads" = "$define" -a "$i_pthread" = "$define" -a "$pthread_h_first" = "$define" -a "$pthread_h_done" = ""; then
9752 echo "#include <pthread.h>" >> try.c
9757 test "$prototype" = "$define" && echo '#define CAN_PROTOTYPE' >> try.c
9758 cat >> try.c <<'EOCP'
9759 #ifdef CAN_PROTOTYPE
9760 #define _(args) args
9765 echo "$foo" >> try.c
9766 echo 'int no_real_function_has_this_name _((void)) { return 0; }' >> try.c
9767 $cc $optimize $ccflags -c try.c > /dev/null 2>&1
9775 hasproto='varname=$1; func=$2; shift; shift;
9776 while $test $# -ge 2; do
9778 $define) echo "#include <$2>";;
9782 $cppstdin $cppflags $cppminus < try.c > tryout.c 2>/dev/null;
9783 if $contains "$func.*(" tryout.c >/dev/null 2>&1; then
9784 echo "$func() prototype found.";
9787 echo "$func() prototype NOT found.";
9794 : see if sys/types.h has to be included
9795 set sys/types.h i_systypes
9798 : see if sys/select.h has to be included
9799 set sys/select.h i_sysselct
9802 hasfield='varname=$1; struct=$2; field=$3; shift; shift; shift;
9803 while $test $# -ge 2; do
9805 $define) echo "#include <$2>";;
9809 echo "int main () { struct $struct foo; char* bar; bar = (char*)foo.$field; }" >> try.c;
9811 if eval $compile; then
9820 : see if we should include time.h, sys/time.h, or both
9822 if test "X$timeincl" = X; then
9823 echo "Testing to see if we should include <time.h>, <sys/time.h> or both." >&4
9824 $echo $n "I'm now running the test program...$c"
9826 #include <sys/types.h>
9831 #ifdef SYSTIMEKERNEL
9834 #include <sys/time.h>
9837 #include <sys/select.h>
9850 struct timezone tzp;
9852 if (foo.tm_sec == foo.tm_sec)
9855 if (bar.tv_sec == bar.tv_sec)
9862 for s_timezone in '-DS_TIMEZONE' ''; do
9864 for s_timeval in '-DS_TIMEVAL' ''; do
9865 for i_systimek in '' '-DSYSTIMEKERNEL'; do
9866 for i_time in '' '-DI_TIME'; do
9867 for i_systime in '-DI_SYSTIME' ''; do
9870 set try $i_time $i_systime $i_systimek $sysselect $s_timeval $s_timezone
9871 if eval $compile; then
9872 set X $i_time $i_systime $i_systimek $sysselect $s_timeval
9876 $echo $n "Succeeded with $flags$c"
9888 *SYSTIMEKERNEL*) i_systimek="$define"
9889 timeincl=`./findhdr sys/time.h`
9890 echo "We'll include <sys/time.h> with KERNEL defined." >&4;;
9891 *) i_systimek="$undef";;
9894 *I_TIME*) i_time="$define"
9895 timeincl=`./findhdr time.h`" $timeincl"
9896 echo "We'll include <time.h>." >&4;;
9897 *) i_time="$undef";;
9900 *I_SYSTIME*) i_systime="$define"
9901 timeincl=`./findhdr sys/time.h`" $timeincl"
9902 echo "We'll include <sys/time.h>." >&4;;
9903 *) i_systime="$undef";;
9907 : see if struct tm knows about tm_zone
9908 case "$i_systime$i_time" in
9911 echo "Checking to see if your struct tm has tm_zone field..." >&4
9912 set d_tm_tm_zone tm tm_zone $i_systime sys/time.h $i_time time.h
9920 case "$d_tm_tm_zone" in
9921 "$define") echo "Yes, it does." ;;
9922 *) echo "No, it doesn't." ;;
9924 : see if struct tm knows about tm_gmtoff
9925 case "$i_systime$i_time" in
9928 echo "Checking to see if your struct tm has tm_gmtoff field..." >&4
9929 set d_tm_tm_gmtoff tm tm_gmtoff $i_systime sys/time.h $i_time time.h
9937 case "$d_tm_tm_gmtoff" in
9938 "$define") echo "Yes, it does." ;;
9939 *) echo "No, it doesn't." ;;
9942 : see if asctime_r exists
9943 set asctime_r d_asctime_r
9945 case "$d_asctime_r" in
9947 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
9948 case "$d_asctime_r_proto:$usethreads" in
9949 ":define") d_asctime_r_proto=define
9950 set d_asctime_r_proto asctime_r $hdrs
9954 case "$d_asctime_r_proto" in
9956 case "$asctime_r_proto" in
9957 ''|0) try='char* asctime_r(const struct tm*, char*);'
9958 ./protochk "extern $try" $hdrs && asctime_r_proto=B_SB ;;
9960 case "$asctime_r_proto" in
9961 ''|0) try='char* asctime_r(const struct tm*, char*, int);'
9962 ./protochk "extern $try" $hdrs && asctime_r_proto=B_SBI ;;
9964 case "$asctime_r_proto" in
9965 ''|0) try='int asctime_r(const struct tm*, char*);'
9966 ./protochk "extern $try" $hdrs && asctime_r_proto=I_SB ;;
9968 case "$asctime_r_proto" in
9969 ''|0) try='int asctime_r(const struct tm*, char*, int);'
9970 ./protochk "extern $try" $hdrs && asctime_r_proto=I_SBI ;;
9972 case "$asctime_r_proto" in
9973 ''|0) d_asctime_r=undef
9975 echo "Disabling asctime_r, cannot determine prototype." >&4 ;;
9976 * ) case "$asctime_r_proto" in
9977 REENTRANT_PROTO*) ;;
9978 *) asctime_r_proto="REENTRANT_PROTO_$asctime_r_proto" ;;
9980 echo "Prototype: $try" ;;
9983 *) case "$usethreads" in
9984 define) echo "asctime_r has no prototype, not using it." >&4 ;;
9991 *) asctime_r_proto=0
9995 : see if atolf exists
9999 : see if atoll exists
10003 : Look for GCC-style attribute format
10004 case "$d_attribute_format" in
10007 echo "Checking whether your compiler can handle __attribute__((format)) ..." >&4
10008 $cat >attrib.c <<'EOCP'
10010 void my_special_printf(char* pat,...) __attribute__((__format__(__printf__,1,2)));
10012 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10013 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10014 echo "Your C compiler doesn't support __attribute__((format))."
10017 echo "Your C compiler supports __attribute__((format))."
10021 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10025 *) val="$d_attribute_format" ;;
10027 set d_attribute_format
10031 : Look for GCC-style attribute format with null format allowed
10032 case "$d_printf_format_null" in
10033 '') case "$d_attribute_format" in
10036 echo "Checking whether your compiler allows __printf__ format to be null ..." >&4
10037 $cat >attrib.c <<EOCP
10039 #$i_stdlib I_STDLIB
10041 #include <stdlib.h>
10043 int null_printf (char* pat,...) __attribute__((__format__(__printf__,1,2)));
10044 int null_printf (char* pat,...) { return (int)pat; }
10045 int main () { exit(null_printf(NULL)); }
10047 if $cc $ccflags -o attrib attrib.c >attrib.out 2>&1 ; then
10048 : run the executable in case it produces a run-time warning
10049 if $run ./attrib >>attrib.out 2>&1; then
10050 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10051 echo "Your C compiler doesn't allow __printf__ format to be null."
10054 echo "Your C compiler allows __printf__ format to be null."
10058 echo "Your C compiler executable failed with __printf__ format null."
10062 echo "Your C compiler fails with __printf__ format null."
10069 *) val="$d_printf_format_null" ;;
10071 set d_printf_format_null
10075 : Look for GCC-style attribute malloc
10076 case "$d_attribute_malloc" in
10079 echo "Checking whether your compiler can handle __attribute__((malloc)) ..." >&4
10080 $cat >attrib.c <<'EOCP'
10082 char *go_get_some_memory( int how_many_bytes ) __attribute__((malloc));
10084 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10085 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10086 echo "Your C compiler doesn't support __attribute__((malloc))."
10089 echo "Your C compiler supports __attribute__((malloc))."
10093 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10097 *) val="$d_attribute_malloc" ;;
10099 set d_attribute_malloc
10103 : Look for GCC-style attribute nonnull
10104 case "$d_attribute_nonnull" in
10107 echo "Checking whether your compiler can handle __attribute__((nonnull(1))) ..." >&4
10108 $cat >attrib.c <<'EOCP'
10110 void do_something (char *some_pointer,...) __attribute__((nonnull(1)));
10112 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10113 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10114 echo "Your C compiler doesn't support __attribute__((nonnull))."
10117 echo "Your C compiler supports __attribute__((nonnull))."
10121 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10125 *) val="$d_attribute_nonnull" ;;
10127 set d_attribute_nonnull
10131 : Look for GCC-style attribute noreturn
10132 case "$d_attribute_noreturn" in
10135 echo "Checking whether your compiler can handle __attribute__((noreturn)) ..." >&4
10136 $cat >attrib.c <<'EOCP'
10138 void fall_over_dead( void ) __attribute__((noreturn));
10140 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10141 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10142 echo "Your C compiler doesn't support __attribute__((noreturn))."
10145 echo "Your C compiler supports __attribute__((noreturn))."
10149 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10153 *) val="$d_attribute_noreturn" ;;
10155 set d_attribute_noreturn
10159 : Look for GCC-style attribute pure
10160 case "$d_attribute_pure" in
10163 echo "Checking whether your compiler can handle __attribute__((pure)) ..." >&4
10164 $cat >attrib.c <<'EOCP'
10166 int square( int n ) __attribute__((pure));
10168 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10169 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10170 echo "Your C compiler doesn't support __attribute__((pure))."
10173 echo "Your C compiler supports __attribute__((pure))."
10177 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10181 *) val="$d_attribute_pure" ;;
10183 set d_attribute_pure
10187 : Look for GCC-style attribute unused
10188 case "$d_attribute_unused" in
10191 echo "Checking whether your compiler can handle __attribute__((unused)) ..." >&4
10192 $cat >attrib.c <<'EOCP'
10194 int do_something( int dummy __attribute__((unused)), int n );
10196 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10197 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10198 echo "Your C compiler doesn't support __attribute__((unused))."
10201 echo "Your C compiler supports __attribute__((unused))."
10205 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10209 *) val="$d_attribute_unused" ;;
10211 set d_attribute_unused
10215 : Look for GCC-style attribute warn_unused_result
10216 case "$d_attribute_warn_unused_result" in
10219 echo "Checking whether your compiler can handle __attribute__((warn_unused_result)) ..." >&4
10220 $cat >attrib.c <<'EOCP'
10222 int I_will_not_be_ignored(void) __attribute__((warn_unused_result));
10224 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10225 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10226 echo "Your C compiler doesn't support __attribute__((warn_unused_result))."
10229 echo "Your C compiler supports __attribute__((warn_unused_result))."
10233 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10237 *) val="$d_attribute_warn_unused_result" ;;
10239 set d_attribute_warn_unused_result
10243 : see if bcmp exists
10247 : see if bcopy exists
10251 : see if getpgrp exists
10252 set getpgrp d_getpgrp
10255 case "$d_getpgrp" in
10258 echo "Checking to see which flavor of getpgrp is in use..."
10260 #$i_unistd I_UNISTD
10261 #include <sys/types.h>
10263 # include <unistd.h>
10265 #$i_stdlib I_STDLIB
10267 #include <stdlib.h>
10271 if (getuid() == 0) {
10272 printf("(I see you are running Configure as super-user...)\n");
10275 #ifdef TRY_BSD_PGRP
10276 if (getpgrp(1) == 0)
10285 if $cc -o try -DTRY_BSD_PGRP $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
10286 echo "You have to use getpgrp(pid) instead of getpgrp()." >&4
10288 elif $cc -o try $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
10289 echo "You have to use getpgrp() instead of getpgrp(pid)." >&4
10292 echo "I can't seem to compile and run the test program."
10294 xxx="a USG one, i.e. you use getpgrp()."
10296 # SVR4 systems can appear rather BSD-ish.
10297 case "$i_unistd" in
10299 xxx="a BSD one, i.e. you use getpgrp(pid)."
10303 xxx="probably a USG one, i.e. you use getpgrp()."
10308 echo "Assuming your getpgrp is $xxx" >&4
10317 : see if setpgrp exists
10318 set setpgrp d_setpgrp
10321 case "$d_setpgrp" in
10324 echo "Checking to see which flavor of setpgrp is in use..."
10326 #$i_unistd I_UNISTD
10327 #include <sys/types.h>
10329 # include <unistd.h>
10331 #$i_stdlib I_STDLIB
10333 #include <stdlib.h>
10337 if (getuid() == 0) {
10338 printf("(I see you are running Configure as super-user...)\n");
10341 #ifdef TRY_BSD_PGRP
10342 if (-1 == setpgrp(1, 1))
10345 if (setpgrp() != -1)
10351 if $cc -o try -DTRY_BSD_PGRP $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
10352 echo 'You have to use setpgrp(pid,pgrp) instead of setpgrp().' >&4
10354 elif $cc -o try $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
10355 echo 'You have to use setpgrp() instead of setpgrp(pid,pgrp).' >&4
10358 echo "(I can't seem to compile and run the test program.)"
10360 xxx="a USG one, i.e. you use setpgrp()."
10362 # SVR4 systems can appear rather BSD-ish.
10363 case "$i_unistd" in
10365 xxx="a BSD one, i.e. you use setpgrp(pid,pgrp)."
10369 xxx="probably a USG one, i.e. you use setpgrp()."
10374 echo "Assuming your setpgrp is $xxx" >&4
10383 : Look for GCC-style __builtin_choose_expr
10384 case "$d_builtin_choose_expr" in
10387 echo "Checking whether your compiler can handle __builtin_choose_expr ..." >&4
10388 $cat >try.c <<'EOCP'
10389 #include <assert.h>
10390 #include <stdlib.h>
10393 #define SYRINX(x) __builtin_choose_expr( x, (1056*2), (103*50) )
10396 assert( SYRINX(1) == 2112 );
10397 assert( SYRINX(1) != 5150 );
10398 assert( SYRINX(0) == 5150 );
10399 assert( SYRINX(0) != 2112 );
10400 puts( "All good!" );
10406 if eval $compile; then
10407 echo "Your C compiler supports __builtin_choose_expr."
10410 echo "Your C compiler doesn't seem to understand __builtin_choose_expr."
10414 *) val="$d_builtin_choose_expr" ;;
10417 set d_builtin_choose_expr
10421 : Look for GCC-style __builtin_expect
10422 case "$d_builtin_expect" in
10425 echo "Checking whether your compiler can handle __builtin_expect ..." >&4
10426 $cat >builtin.c <<'EOCP'
10429 if ( __builtin_expect(n, 0) ) n = 1;
10433 if eval $compile; then
10434 echo "Your C compiler supports __builtin_choose_expr."
10437 echo "Your C compiler doesn't seem to understand __builtin_choose_expr."
10441 *) val="$d_builtin_expect" ;;
10444 set d_builtin_expect
10448 : see if bzero exists
10452 : see if stdarg is available
10454 if $test `./findhdr stdarg.h`; then
10455 echo "<stdarg.h> found." >&4
10458 echo "<stdarg.h> NOT found." >&4
10462 : see if varags is available
10464 if $test `./findhdr varargs.h`; then
10465 echo "<varargs.h> found." >&4
10467 echo "<varargs.h> NOT found, but that's ok (I hope)." >&4
10470 : set up the varargs testing programs
10471 $cat > varargs.c <<EOP
10473 #include <stdarg.h>
10476 #include <varargs.h>
10480 int f(char *p, ...)
10494 p = va_arg(ap, char *);
10500 $cat > varargs <<EOP
10502 if $cc -c $ccflags -D\$1 varargs.c >/dev/null 2>&1; then
10511 : now check which varargs header should be included
10516 if `./varargs I_STDARG`; then
10518 elif `./varargs I_VARARGS`; then
10523 if `./varargs I_VARARGS`; then
10530 echo "I could not find the definition for va_dcl... You have problems..." >&4
10531 val="$undef"; set i_stdarg; eval $setvar
10532 val="$undef"; set i_varargs; eval $setvar
10537 case "$i_varhdr" in
10539 val="$define"; set i_stdarg; eval $setvar
10540 val="$undef"; set i_varargs; eval $setvar
10543 val="$undef"; set i_stdarg; eval $setvar
10544 val="$define"; set i_varargs; eval $setvar
10547 echo "We'll include <$i_varhdr> to get va_dcl definition." >&4;;
10551 : see if the Compiler supports C99 variadic macros
10552 case "$i_stdarg$i_stdlib" in
10554 echo "You have <stdarg.h> and <stdlib.h>, so checking for C99 variadic macros." >&4
10557 #include <stdarg.h>
10559 #define foo(buffer, format, ...) sprintf(buffer, format, __VA_ARGS__)
10563 foo(buf, "%d %g %.*s", 123, 456.0, (int)3, "789fail");
10569 if eval $compile && $run ./try 2>&1 >/dev/null; then
10570 case "`$run ./try`" in
10572 echo "You have C99 variadic macros." >&4
10573 d_c99_variadic_macros="$define"
10576 echo "You don't have functional C99 variadic macros." >&4
10577 d_c99_variadic_macros="$undef"
10581 echo "I couldn't compile and run the test program, so I assume that you don't have functional C99 variadic macros." >&4
10582 d_c99_variadic_macros="$undef"
10587 echo "You don't have <stdarg.h> and <stdlib.h>, so not checking for C99 variadic macros." >&4
10588 d_c99_variadic_macros="$undef"
10592 : see if signal is declared as pointer to function returning int or void
10594 xxx=`./findhdr signal.h`
10595 $test "$xxx" && $cppstdin $cppminus $cppflags < $xxx >$$.tmp 2>/dev/null
10596 if $contains 'int.*\*[ ]*signal' $$.tmp >/dev/null 2>&1 ; then
10597 echo "You have int (*signal())() instead of void." >&4
10599 elif $contains 'void.*\*[ ]*signal' $$.tmp >/dev/null 2>&1 ; then
10600 echo "You have void (*signal())()." >&4
10602 elif $contains 'extern[ ]*[(\*]*signal' $$.tmp >/dev/null 2>&1 ; then
10603 echo "You have int (*signal())() instead of void." >&4
10605 elif $contains 'void.*\*.*sig' $$.tmp >/dev/null 2>&1 ; then
10606 echo "You have void (*signal())()." >&4
10609 case "$d_voidsig" in
10611 echo "I can't determine whether signal handler returns void or int..." >&4
10613 rp="What type does your signal handler return?"
10616 v*) val="$define";;
10620 echo "As you already told me, signal handler returns void." >&4
10623 *) echo "As you already told me, signal handler returns int." >&4
10630 case "$d_voidsig" in
10631 "$define") signal_t="void";;
10632 *) signal_t="int";;
10636 : check for ability to cast large floats to 32-bit ints.
10638 echo 'Checking whether your C compiler can cast large floats to int32.' >&4
10639 if $test "$intsize" -ge 4; then
10646 #$i_stdlib I_STDLIB
10648 #include <stdlib.h>
10650 #include <sys/types.h>
10651 #include <signal.h>
10652 $signal_t blech(int s) { exit(3); }
10659 signal(SIGFPE, blech);
10661 /* Don't let compiler optimize the test away. Store the number
10662 in a writable string for gcc to pass to sscanf under HP/UX.
10664 sprintf(str, "2147483647");
10665 sscanf(str, "%lf", &f); /* f = (double) 0x7fffffff; */
10669 /* x86 processors will probably give 0x8000 0000, which is a
10670 sign change. We don't want that. We want to mimic SPARC
10671 behavior here, which is to preserve the sign and give
10674 if (i32 != ($xxx) f)
10680 if eval $compile_ok; then
10684 echo "(I can't seem to compile the test program--assuming it can't)"
10689 echo "Yup, it can."
10692 echo "Nope, it can't."
10699 : check for ability to cast negative floats to unsigned
10701 echo 'Checking whether your C compiler can cast negative float to unsigned.' >&4
10704 #$i_stdlib I_STDLIB
10706 #include <stdlib.h>
10708 #include <sys/types.h>
10709 #include <signal.h>
10710 $signal_t blech(int s) { exit(7); }
10711 $signal_t blech_in_list(int s) { exit(4); }
10712 unsigned long dummy_long(unsigned long p) { return p; }
10713 unsigned int dummy_int(unsigned int p) { return p; }
10714 unsigned short dummy_short(unsigned short p) { return p; }
10718 unsigned long along;
10720 unsigned short ashort;
10724 /* Frustrate gcc-2.7.2's optimizer which failed this test with
10725 a direct f = -123. assignment. gcc-2.8.0 reportedly
10726 optimized the whole file away
10728 /* Store the number in a writable string for gcc to pass to
10729 sscanf under HP/UX.
10731 sprintf(str, "-123");
10732 sscanf(str, "%lf", &f); /* f = -123.; */
10734 signal(SIGFPE, blech);
10735 along = (unsigned long)f;
10736 aint = (unsigned int)f;
10737 ashort = (unsigned short)f;
10738 if (along != (unsigned long)-123)
10740 if (aint != (unsigned int)-123)
10742 if (ashort != (unsigned short)-123)
10744 sprintf(str, "1073741824.");
10745 sscanf(str, "%lf", &f); /* f = (double)0x40000000; */
10748 along = (unsigned long)f;
10749 if (along != 0x80000000)
10753 along = (unsigned long)f;
10754 if (along != 0x7fffffff)
10758 along = (unsigned long)f;
10759 if (along != 0x80000001)
10763 signal(SIGFPE, blech_in_list);
10764 sprintf(str, "123.");
10765 sscanf(str, "%lf", &f); /* f = 123.; */
10766 along = dummy_long((unsigned long)f);
10767 aint = dummy_int((unsigned int)f);
10768 ashort = dummy_short((unsigned short)f);
10769 if (along != (unsigned long)123)
10771 if (aint != (unsigned int)123)
10773 if (ashort != (unsigned short)123)
10780 if eval $compile_ok; then
10784 echo "(I can't seem to compile the test program--assuming it can't)"
10787 case "$castflags" in
10789 echo "Yup, it can."
10792 echo "Nope, it can't."
10799 : see if vprintf exists
10801 if set vprintf val -f d_vprintf; eval $csym; $val; then
10802 echo 'vprintf() found.' >&4
10805 #include <varargs.h>
10806 #$i_stdlib I_STDLIB
10808 #include <stdlib.h>
10811 int main() { xxx("foo"); }
10820 exit((unsigned long)vsprintf(buf,"%s",args) > 10L);
10824 if eval $compile && $run ./try; then
10825 echo "Your vsprintf() returns (int)." >&4
10828 echo "Your vsprintf() returns (char*)." >&4
10832 echo 'vprintf() NOT found.' >&4
10843 : see if chown exists
10847 : see if chroot exists
10848 set chroot d_chroot
10851 : see if chsize exists
10852 set chsize d_chsize
10855 : see if class exists
10859 : see if clearenv exists
10860 set clearenv d_clearenv
10863 hasstruct='varname=$1; struct=$2; shift; shift;
10864 while $test $# -ge 2; do
10866 $define) echo "#include <$2>";;
10870 echo "int main () { struct $struct foo; }" >> try.c;
10872 if eval $compile; then
10883 : see whether socket exists
10885 $echo $n "Hmm... $c" >&4
10886 if set socket val -f d_socket; eval $csym; $val; then
10887 echo "Looks like you have Berkeley networking support." >&4
10889 if set setsockopt val -f; eval $csym; $val; then
10892 echo "...but it uses the old BSD 4.1c interface, rather than 4.2." >&4
10893 d_oldsock="$define"
10896 if $contains socklib libc.list >/dev/null 2>&1; then
10897 echo "Looks like you have Berkeley networking support." >&4
10899 : we will have to assume that it supports the 4.2 BSD interface
10902 echo "You don't have Berkeley networking in libc$_a..." >&4
10903 if test "X$d_socket" = "X$define"; then
10904 echo "...but you seem to believe that you have sockets." >&4
10906 for net in net socket
10908 if test -f /usr/lib/lib$net$_a; then
10909 ( ($nm $nm_opt /usr/lib/lib$net$_a | eval $nm_extract) || \
10910 $ar t /usr/lib/lib$net$_a) 2>/dev/null >> libc.list
10911 if $contains socket libc.list >/dev/null 2>&1; then
10916 echo "...but the Wollongong group seems to have hacked it in." >&4
10917 sockethdr="-I/usr/netinclude"
10920 echo "Found Berkeley sockets interface in lib$net." >&4
10921 if $contains setsockopt libc.list >/dev/null 2>&1; then
10924 echo "...using the old BSD 4.1c interface, rather than 4.2." >&4
10925 d_oldsock="$define"
10931 if test "X$d_socket" != "X$define"; then
10932 echo "or anywhere else I see." >&4
10940 : see if socketpair exists
10941 set socketpair d_sockpair
10946 echo "Checking the availability of certain socket constants..." >&4
10947 for ENUM in MSG_CTRUNC MSG_DONTROUTE MSG_OOB MSG_PEEK MSG_PROXY SCM_RIGHTS; do
10948 enum=`$echo $ENUM|./tr '[A-Z]' '[a-z]'`
10950 #include <sys/types.h>
10951 #include <sys/socket.h>
10957 set try; if eval $compile; then
10960 set d_${enum}; eval $setvar
10964 : see if this is a sys/uio.h system
10965 set sys/uio.h i_sysuio
10970 echo "Checking to see if your system supports struct cmsghdr..." >&4
10971 set d_cmsghdr_s cmsghdr $i_systypes sys/types.h $d_socket sys/socket.h $i_sysuio sys/uio.h
10973 case "$d_cmsghdr_s" in
10974 "$define") echo "Yes, it does." ;;
10975 *) echo "No, it doesn't." ;;
10979 : check for const keyword
10981 echo 'Checking to see if your C compiler knows about "const"...' >&4
10982 $cat >const.c <<'EOCP'
10983 typedef struct spug { int drokk; } spug;
10987 const spug y = { 0 };
10990 if $cc -c $ccflags const.c >/dev/null 2>&1 ; then
10992 echo "Yup, it does."
10995 echo "Nope, it doesn't."
11000 : see if copysignl exists
11001 set copysignl d_copysignl
11004 : see if crypt exists
11009 $define) cryptlib='' ;;
11010 *) if set crypt val -f d_crypt; eval $csym; $val; then
11011 echo 'crypt() found.' >&4
11015 cryptlib=`./loc Slibcrypt$_a "" $xlibpth`
11016 if $test -z "$cryptlib"; then
11017 cryptlib=`./loc Mlibcrypt$_a "" $xlibpth`
11021 if $test -z "$cryptlib"; then
11022 cryptlib=`./loc Llibcrypt$_a "" $xlibpth`
11026 if $test -z "$cryptlib"; then
11027 cryptlib=`./loc libcrypt$_a "" $libpth`
11031 if $test -z "$cryptlib"; then
11032 echo 'crypt() NOT found.' >&4
11043 : see if this is a crypt.h system
11044 set crypt.h i_crypt
11047 : see if crypt_r exists
11048 set crypt_r d_crypt_r
11050 case "$d_crypt_r" in
11052 hdrs="$i_systypes sys/types.h define stdio.h $i_crypt crypt.h"
11053 case "$d_crypt_r_proto:$usethreads" in
11054 ":define") d_crypt_r_proto=define
11055 set d_crypt_r_proto crypt_r $hdrs
11059 case "$d_crypt_r_proto" in
11061 case "$crypt_r_proto" in
11062 ''|0) try='char* crypt_r(const char*, const char*, struct crypt_data*);'
11063 ./protochk "extern $try" $hdrs && crypt_r_proto=B_CCS ;;
11065 case "$crypt_r_proto" in
11066 ''|0) try='char* crypt_r(const char*, const char*, CRYPTD*);'
11067 ./protochk "extern $try" $hdrs && crypt_r_proto=B_CCD ;;
11069 case "$crypt_r_proto" in
11070 ''|0) d_crypt_r=undef
11072 echo "Disabling crypt_r, cannot determine prototype." >&4 ;;
11073 * ) case "$crypt_r_proto" in
11074 REENTRANT_PROTO*) ;;
11075 *) crypt_r_proto="REENTRANT_PROTO_$crypt_r_proto" ;;
11077 echo "Prototype: $try" ;;
11080 *) case "$usethreads" in
11081 define) echo "crypt_r has no prototype, not using it." >&4 ;;
11092 : get csh whereabouts
11094 'csh') val="$undef" ;;
11095 *) val="$define" ;;
11099 : Respect a hint or command line value for full_csh.
11100 case "$full_csh" in
11101 '') full_csh=$csh ;;
11104 : see if ctermid exists
11105 set ctermid d_ctermid
11108 : see if ctermid_r exists
11109 set ctermid_r d_ctermid_r
11111 case "$d_ctermid_r" in
11113 hdrs="$i_systypes sys/types.h define stdio.h "
11114 case "$d_ctermid_r_proto:$usethreads" in
11115 ":define") d_ctermid_r_proto=define
11116 set d_ctermid_r_proto ctermid_r $hdrs
11120 case "$d_ctermid_r_proto" in
11122 case "$ctermid_r_proto" in
11123 ''|0) try='char* ctermid_r(char*);'
11124 ./protochk "extern $try" $hdrs && ctermid_r_proto=B_B ;;
11126 case "$ctermid_r_proto" in
11127 ''|0) d_ctermid_r=undef
11129 echo "Disabling ctermid_r, cannot determine prototype." >&4 ;;
11130 * ) case "$ctermid_r_proto" in
11131 REENTRANT_PROTO*) ;;
11132 *) ctermid_r_proto="REENTRANT_PROTO_$ctermid_r_proto" ;;
11134 echo "Prototype: $try" ;;
11137 *) case "$usethreads" in
11138 define) echo "ctermid_r has no prototype, not using it." >&4 ;;
11145 *) ctermid_r_proto=0
11149 : see if ctime_r exists
11150 set ctime_r d_ctime_r
11152 case "$d_ctime_r" in
11154 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
11155 case "$d_ctime_r_proto:$usethreads" in
11156 ":define") d_ctime_r_proto=define
11157 set d_ctime_r_proto ctime_r $hdrs
11161 case "$d_ctime_r_proto" in
11163 case "$ctime_r_proto" in
11164 ''|0) try='char* ctime_r(const time_t*, char*);'
11165 ./protochk "extern $try" $hdrs && ctime_r_proto=B_SB ;;
11167 case "$ctime_r_proto" in
11168 ''|0) try='char* ctime_r(const time_t*, char*, int);'
11169 ./protochk "extern $try" $hdrs && ctime_r_proto=B_SBI ;;
11171 case "$ctime_r_proto" in
11172 ''|0) try='int ctime_r(const time_t*, char*);'
11173 ./protochk "extern $try" $hdrs && ctime_r_proto=I_SB ;;
11175 case "$ctime_r_proto" in
11176 ''|0) try='int ctime_r(const time_t*, char*, int);'
11177 ./protochk "extern $try" $hdrs && ctime_r_proto=I_SBI ;;
11179 case "$ctime_r_proto" in
11180 ''|0) d_ctime_r=undef
11182 echo "Disabling ctime_r, cannot determine prototype." >&4 ;;
11183 * ) case "$ctime_r_proto" in
11184 REENTRANT_PROTO*) ;;
11185 *) ctime_r_proto="REENTRANT_PROTO_$ctime_r_proto" ;;
11187 echo "Prototype: $try" ;;
11190 *) case "$usethreads" in
11191 define) echo "ctime_r has no prototype, not using it." >&4 ;;
11202 : see if cuserid exists
11203 set cuserid d_cuserid
11206 : see if this is a limits.h system
11207 set limits.h i_limits
11210 : see if this is a float.h system
11211 set float.h i_float
11214 : See if number of significant digits in a double precision number is known
11216 $cat >dbl_dig.c <<EOM
11217 #$i_limits I_LIMITS
11220 #include <limits.h>
11226 printf("Contains DBL_DIG");
11229 $cppstdin $cppflags $cppminus < dbl_dig.c >dbl_dig.E 2>/dev/null
11230 if $contains 'DBL_DIG' dbl_dig.E >/dev/null 2>&1; then
11231 echo "DBL_DIG found." >&4
11234 echo "DBL_DIG NOT found." >&4
11241 : see if dbm.h is available
11242 : see if dbmclose exists
11243 set dbmclose d_dbmclose
11246 case "$d_dbmclose" in
11256 *) set rpcsvc/dbm.h i_rpcsvcdbm
11261 *) echo "We won't be including <dbm.h>"
11271 : see if prototype for dbminit is available
11273 set d_dbminitproto dbminit $i_dbm dbm.h
11276 : see if difftime exists
11277 set difftime d_difftime
11280 : see if this is a dirent system
11282 if xinc=`./findhdr dirent.h`; $test "$xinc"; then
11284 echo "<dirent.h> found." >&4
11287 if xinc=`./findhdr sys/dir.h`; $test "$xinc"; then
11288 echo "<sys/dir.h> found." >&4
11291 xinc=`./findhdr sys/ndir.h`
11293 echo "<dirent.h> NOT found." >&4
11298 : Look for type of directory structure.
11300 $cppstdin $cppflags $cppminus < "$xinc" > try.c
11302 case "$direntrytype" in
11304 case "$i_dirent" in
11305 $define) guess1='struct dirent' ;;
11306 *) guess1='struct direct' ;;
11309 *) guess1="$direntrytype"
11314 'struct dirent') guess2='struct direct' ;;
11315 *) guess2='struct dirent' ;;
11318 if $contains "$guess1" try.c >/dev/null 2>&1; then
11319 direntrytype="$guess1"
11320 echo "Your directory entries are $direntrytype." >&4
11321 elif $contains "$guess2" try.c >/dev/null 2>&1; then
11322 direntrytype="$guess2"
11323 echo "Your directory entries seem to be $direntrytype." >&4
11325 echo "I don't recognize your system's directory entries." >&4
11326 rp="What type is used for directory entries on this system?"
11329 direntrytype="$ans"
11333 : see if the directory entry stores field length
11335 $cppstdin $cppflags $cppminus < "$xinc" > try.c
11336 if $contains 'd_namlen' try.c >/dev/null 2>&1; then
11337 echo "Good, your directory entry keeps length information in d_namlen." >&4
11340 echo "Your directory entry does not know about the d_namlen field." >&4
11347 : Look for DIR.dd_fd
11348 case "$i_dirent" in
11350 echo "Checking to see if DIR has a dd_fd member variable" >&4
11352 #$i_stdlib I_STDLIB
11354 #include <stdlib.h>
11356 #include <dirent.h>
11366 if eval $compile; then
11367 echo "Yes, it does."
11370 echo "No, it does not."
11375 echo "You don't have a <dirent.h>, so not checking for dd_fd." >&4
11383 : see if this is an sysdir system
11384 set sys/dir.h i_sysdir
11387 : see if this is an sysndir system
11388 set sys/ndir.h i_sysndir
11393 $cat >dirfd.c <<EOM
11395 #$i_stdlib I_STDLIB
11397 #include <stdlib.h>
11399 #$i_dirent I_DIRENT /**/
11400 #$i_sysdir I_SYS_DIR /**/
11401 #$i_sysndir I_SYS_NDIR /**/
11402 #$i_systypes I_SYS_TYPES /**/
11403 #if defined(I_SYS_TYPES)
11404 #include <sys/types.h>
11406 #if defined(I_DIRENT)
11407 #include <dirent.h>
11408 #if defined(NeXT) && defined(I_SYS_DIR) /* NeXT needs dirent + sys/dir.h */
11409 #include <sys/dir.h>
11413 #include <sys/ndir.h>
11417 #include <ndir.h> /* may be wrong in the future */
11419 #include <sys/dir.h>
11425 DIR *dirp = opendir(".");
11426 if (dirfd(dirp) >= 0)
11434 if eval $compile; then
11438 $define) echo "dirfd() found." >&4 ;;
11439 *) echo "dirfd() NOT found." >&4 ;;
11445 : see if dlerror exists
11448 set dlerror d_dlerror
11452 : see if dlfcn is available
11453 set dlfcn.h i_dlfcn
11460 On a few systems, the dynamically loaded modules that perl generates and uses
11461 will need a different extension than shared libs. The default will probably
11467 *) dflt="$dlext" ;;
11469 rp='What is the extension of dynamically loaded modules'
11478 : Check if dlsym need a leading underscore
11484 echo "Checking whether your dlsym() needs a leading underscore ..." >&4
11485 $cat >dyna.c <<'EOM'
11492 #$i_stdlib I_STDLIB
11494 #include <stdlib.h>
11498 #include <dlfcn.h> /* the dynamic linker include file for SunOS/Solaris */
11500 #include <sys/types.h>
11505 extern int fred() ;
11514 int mode = RTLD_LAZY ;
11516 handle = dlopen("./dyna.$dlext", mode) ;
11517 if (handle == NULL) {
11522 symbol = dlsym(handle, "fred") ;
11523 if (symbol == NULL) {
11524 /* try putting a leading underscore */
11525 symbol = dlsym(handle, "_fred") ;
11526 if (symbol == NULL) {
11539 : Call the object file tmp-dyna.o in case dlext=o.
11540 if $cc $ccflags $cccdlflags -c dyna.c > /dev/null 2>&1 &&
11541 mv dyna${_o} tmp-dyna${_o} > /dev/null 2>&1 &&
11542 $ld -o dyna.$dlext $ldflags $lddlflags tmp-dyna${_o} > /dev/null 2>&1 &&
11543 $cc -o fred $ccflags $ldflags $cccdlflags $ccdlflags fred.c $libs > /dev/null 2>&1 && $to dyna.$dlext; then
11546 1) echo "Test program failed using dlopen." >&4
11547 echo "Perhaps you should not use dynamic loading." >&4;;
11548 2) echo "Test program failed using dlsym." >&4
11549 echo "Perhaps you should not use dynamic loading." >&4;;
11550 3) echo "dlsym needs a leading underscore" >&4
11552 4) echo "dlsym doesn't need a leading underscore." >&4;;
11555 echo "I can't compile and run the test program." >&4
11556 echo "I'm guessing that dlsym doesn't need a leading underscore." >&4
11561 $rm -f fred fred.* dyna.$dlext dyna.* tmp-dyna.*
11566 : see if drand48_r exists
11567 set drand48_r d_drand48_r
11569 case "$d_drand48_r" in
11571 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
11572 case "$d_drand48_r_proto:$usethreads" in
11573 ":define") d_drand48_r_proto=define
11574 set d_drand48_r_proto drand48_r $hdrs
11578 case "$d_drand48_r_proto" in
11580 case "$drand48_r_proto" in
11581 ''|0) try='int drand48_r(struct drand48_data*, double*);'
11582 ./protochk "extern $try" $hdrs && drand48_r_proto=I_ST ;;
11584 case "$drand48_r_proto" in
11585 ''|0) d_drand48_r=undef
11587 echo "Disabling drand48_r, cannot determine prototype." >&4 ;;
11588 * ) case "$drand48_r_proto" in
11589 REENTRANT_PROTO*) ;;
11590 *) drand48_r_proto="REENTRANT_PROTO_$drand48_r_proto" ;;
11592 echo "Prototype: $try" ;;
11595 *) case "$usethreads" in
11596 define) echo "drand48_r has no prototype, not using it." >&4 ;;
11603 *) drand48_r_proto=0
11607 : see if prototype for drand48 is available
11609 set d_drand48proto drand48 $i_stdlib stdlib.h $i_unistd unistd.h
11612 : see if dup2 exists
11616 : see if eaccess exists
11617 set eaccess d_eaccess
11620 : see if endgrent exists
11621 set endgrent d_endgrent
11624 : see if this is an grp system
11630 xxx=`./findhdr grp.h`
11631 $cppstdin $cppflags $cppminus < $xxx >$$.h
11633 if $contains 'gr_passwd' $$.h >/dev/null 2>&1; then
11645 set d_grpasswd; eval $setvar
11649 : see if endgrent_r exists
11650 set endgrent_r d_endgrent_r
11652 case "$d_endgrent_r" in
11654 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
11655 case "$d_endgrent_r_proto:$usethreads" in
11656 ":define") d_endgrent_r_proto=define
11657 set d_endgrent_r_proto endgrent_r $hdrs
11661 case "$d_endgrent_r_proto" in
11663 case "$endgrent_r_proto" in
11664 ''|0) try='int endgrent_r(FILE**);'
11665 ./protochk "extern $try" $hdrs && endgrent_r_proto=I_H ;;
11667 case "$endgrent_r_proto" in
11668 ''|0) try='void endgrent_r(FILE**);'
11669 ./protochk "extern $try" $hdrs && endgrent_r_proto=V_H ;;
11671 case "$endgrent_r_proto" in
11672 ''|0) d_endgrent_r=undef
11674 echo "Disabling endgrent_r, cannot determine prototype." >&4 ;;
11675 * ) case "$endgrent_r_proto" in
11676 REENTRANT_PROTO*) ;;
11677 *) endgrent_r_proto="REENTRANT_PROTO_$endgrent_r_proto" ;;
11679 echo "Prototype: $try" ;;
11682 *) case "$usethreads" in
11683 define) echo "endgrent_r has no prototype, not using it." >&4 ;;
11690 *) endgrent_r_proto=0
11694 : see if endhostent exists
11695 set endhostent d_endhent
11698 : see if this is a netdb.h system
11699 set netdb.h i_netdb
11702 : see if endhostent_r exists
11703 set endhostent_r d_endhostent_r
11705 case "$d_endhostent_r" in
11707 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
11708 case "$d_endhostent_r_proto:$usethreads" in
11709 ":define") d_endhostent_r_proto=define
11710 set d_endhostent_r_proto endhostent_r $hdrs
11714 case "$d_endhostent_r_proto" in
11716 case "$endhostent_r_proto" in
11717 ''|0) try='int endhostent_r(struct hostent_data*);'
11718 ./protochk "extern $try" $hdrs && endhostent_r_proto=I_D ;;
11720 case "$endhostent_r_proto" in
11721 ''|0) try='void endhostent_r(struct hostent_data*);'
11722 ./protochk "extern $try" $hdrs && endhostent_r_proto=V_D ;;
11724 case "$endhostent_r_proto" in
11725 ''|0) d_endhostent_r=undef
11726 endhostent_r_proto=0
11727 echo "Disabling endhostent_r, cannot determine prototype." >&4 ;;
11728 * ) case "$endhostent_r_proto" in
11729 REENTRANT_PROTO*) ;;
11730 *) endhostent_r_proto="REENTRANT_PROTO_$endhostent_r_proto" ;;
11732 echo "Prototype: $try" ;;
11735 *) case "$usethreads" in
11736 define) echo "endhostent_r has no prototype, not using it." >&4 ;;
11738 d_endhostent_r=undef
11739 endhostent_r_proto=0
11743 *) endhostent_r_proto=0
11747 : see if endnetent exists
11748 set endnetent d_endnent
11751 : see if endnetent_r exists
11752 set endnetent_r d_endnetent_r
11754 case "$d_endnetent_r" in
11756 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
11757 case "$d_endnetent_r_proto:$usethreads" in
11758 ":define") d_endnetent_r_proto=define
11759 set d_endnetent_r_proto endnetent_r $hdrs
11763 case "$d_endnetent_r_proto" in
11765 case "$endnetent_r_proto" in
11766 ''|0) try='int endnetent_r(struct netent_data*);'
11767 ./protochk "extern $try" $hdrs && endnetent_r_proto=I_D ;;
11769 case "$endnetent_r_proto" in
11770 ''|0) try='void endnetent_r(struct netent_data*);'
11771 ./protochk "extern $try" $hdrs && endnetent_r_proto=V_D ;;
11773 case "$endnetent_r_proto" in
11774 ''|0) d_endnetent_r=undef
11775 endnetent_r_proto=0
11776 echo "Disabling endnetent_r, cannot determine prototype." >&4 ;;
11777 * ) case "$endnetent_r_proto" in
11778 REENTRANT_PROTO*) ;;
11779 *) endnetent_r_proto="REENTRANT_PROTO_$endnetent_r_proto" ;;
11781 echo "Prototype: $try" ;;
11784 *) case "$usethreads" in
11785 define) echo "endnetent_r has no prototype, not using it." >&4 ;;
11787 d_endnetent_r=undef
11788 endnetent_r_proto=0
11792 *) endnetent_r_proto=0
11796 : see if endprotoent exists
11797 set endprotoent d_endpent
11800 : see if endprotoent_r exists
11801 set endprotoent_r d_endprotoent_r
11803 case "$d_endprotoent_r" in
11805 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
11806 case "$d_endprotoent_r_proto:$usethreads" in
11807 ":define") d_endprotoent_r_proto=define
11808 set d_endprotoent_r_proto endprotoent_r $hdrs
11812 case "$d_endprotoent_r_proto" in
11814 case "$endprotoent_r_proto" in
11815 ''|0) try='int endprotoent_r(struct protoent_data*);'
11816 ./protochk "extern $try" $hdrs && endprotoent_r_proto=I_D ;;
11818 case "$endprotoent_r_proto" in
11819 ''|0) try='void endprotoent_r(struct protoent_data*);'
11820 ./protochk "extern $try" $hdrs && endprotoent_r_proto=V_D ;;
11822 case "$endprotoent_r_proto" in
11823 ''|0) d_endprotoent_r=undef
11824 endprotoent_r_proto=0
11825 echo "Disabling endprotoent_r, cannot determine prototype." >&4 ;;
11826 * ) case "$endprotoent_r_proto" in
11827 REENTRANT_PROTO*) ;;
11828 *) endprotoent_r_proto="REENTRANT_PROTO_$endprotoent_r_proto" ;;
11830 echo "Prototype: $try" ;;
11833 *) case "$usethreads" in
11834 define) echo "endprotoent_r has no prototype, not using it." >&4 ;;
11836 d_endprotoent_r=undef
11837 endprotoent_r_proto=0
11841 *) endprotoent_r_proto=0
11845 : see if endpwent exists
11846 set endpwent d_endpwent
11849 : see if this is a pwd.h system
11855 xxx=`./findhdr pwd.h`
11856 $cppstdin $cppflags $cppminus < $xxx >$$.h
11858 if $contains 'pw_quota' $$.h >/dev/null 2>&1; then
11866 if $contains 'pw_age' $$.h >/dev/null 2>&1; then
11874 if $contains 'pw_change' $$.h >/dev/null 2>&1; then
11882 if $contains 'pw_class' $$.h >/dev/null 2>&1; then
11890 if $contains 'pw_expire' $$.h >/dev/null 2>&1; then
11898 if $contains 'pw_comment' $$.h >/dev/null 2>&1; then
11906 if $contains 'pw_gecos' $$.h >/dev/null 2>&1; then
11914 if $contains 'pw_passwd' $$.h >/dev/null 2>&1; then
11926 set d_pwquota; eval $setvar
11927 set d_pwage; eval $setvar
11928 set d_pwchange; eval $setvar
11929 set d_pwclass; eval $setvar
11930 set d_pwexpire; eval $setvar
11931 set d_pwcomment; eval $setvar
11932 set d_pwgecos; eval $setvar
11933 set d_pwpasswd; eval $setvar
11937 : see if endpwent_r exists
11938 set endpwent_r d_endpwent_r
11940 case "$d_endpwent_r" in
11942 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
11943 case "$d_endpwent_r_proto:$usethreads" in
11944 ":define") d_endpwent_r_proto=define
11945 set d_endpwent_r_proto endpwent_r $hdrs
11949 case "$d_endpwent_r_proto" in
11951 case "$endpwent_r_proto" in
11952 ''|0) try='int endpwent_r(FILE**);'
11953 ./protochk "extern $try" $hdrs && endpwent_r_proto=I_H ;;
11955 case "$endpwent_r_proto" in
11956 ''|0) try='void endpwent_r(FILE**);'
11957 ./protochk "extern $try" $hdrs && endpwent_r_proto=V_H ;;
11959 case "$endpwent_r_proto" in
11960 ''|0) d_endpwent_r=undef
11962 echo "Disabling endpwent_r, cannot determine prototype." >&4 ;;
11963 * ) case "$endpwent_r_proto" in
11964 REENTRANT_PROTO*) ;;
11965 *) endpwent_r_proto="REENTRANT_PROTO_$endpwent_r_proto" ;;
11967 echo "Prototype: $try" ;;
11970 *) case "$usethreads" in
11971 define) echo "endpwent_r has no prototype, not using it." >&4 ;;
11978 *) endpwent_r_proto=0
11982 : see if endservent exists
11983 set endservent d_endsent
11986 : see if endservent_r exists
11987 set endservent_r d_endservent_r
11989 case "$d_endservent_r" in
11991 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
11992 case "$d_endservent_r_proto:$usethreads" in
11993 ":define") d_endservent_r_proto=define
11994 set d_endservent_r_proto endservent_r $hdrs
11998 case "$d_endservent_r_proto" in
12000 case "$endservent_r_proto" in
12001 ''|0) try='int endservent_r(struct servent_data*);'
12002 ./protochk "extern $try" $hdrs && endservent_r_proto=I_D ;;
12004 case "$endservent_r_proto" in
12005 ''|0) try='void endservent_r(struct servent_data*);'
12006 ./protochk "extern $try" $hdrs && endservent_r_proto=V_D ;;
12008 case "$endservent_r_proto" in
12009 ''|0) d_endservent_r=undef
12010 endservent_r_proto=0
12011 echo "Disabling endservent_r, cannot determine prototype." >&4 ;;
12012 * ) case "$endservent_r_proto" in
12013 REENTRANT_PROTO*) ;;
12014 *) endservent_r_proto="REENTRANT_PROTO_$endservent_r_proto" ;;
12016 echo "Prototype: $try" ;;
12019 *) case "$usethreads" in
12020 define) echo "endservent_r has no prototype, not using it." >&4 ;;
12022 d_endservent_r=undef
12023 endservent_r_proto=0
12027 *) endservent_r_proto=0
12031 : Locate the flags for 'open()'
12034 #include <sys/types.h>
12039 #include <sys/file.h>
12041 #$i_stdlib I_STDLIB
12043 #include <stdlib.h>
12054 : check sys/file.h first to get FREAD on Sun
12055 if $test `./findhdr sys/file.h` && \
12056 set try -DI_SYS_FILE && eval $compile; then
12058 echo "<sys/file.h> defines the O_* constants..." >&4
12059 if $run ./try; then
12060 echo "and you have the 3 argument form of open()." >&4
12063 echo "but not the 3 argument form of open(). Oh, well." >&4
12066 elif $test `./findhdr fcntl.h` && \
12067 set try -DI_FCNTL && eval $compile; then
12069 echo "<fcntl.h> defines the O_* constants..." >&4
12070 if $run ./try; then
12071 echo "and you have the 3 argument form of open()." >&4
12074 echo "but not the 3 argument form of open(). Oh, well." >&4
12079 echo "I can't find the O_* constant definitions! You got problems." >&4
12085 : see which of string.h or strings.h is needed
12087 strings=`./findhdr string.h`
12088 if $test "$strings" && $test -r "$strings"; then
12089 echo "Using <string.h> instead of <strings.h>." >&4
12093 strings=`./findhdr strings.h`
12094 if $test "$strings" && $test -r "$strings"; then
12095 echo "Using <strings.h> instead of <string.h>." >&4
12097 echo "No string header found -- You'll surely have problems." >&4
12102 case "$i_string" in
12103 "$undef") strings=`./findhdr strings.h`;;
12104 *) strings=`./findhdr string.h`;;
12107 : see if this is a sys/file.h system
12112 : do we need to include sys/file.h ?
12116 if $h_sysfile; then
12118 echo "We'll be including <sys/file.h>." >&4
12121 echo "We won't be including <sys/file.h>." >&4
12131 : see if fcntl.h is there
12136 : see if we can include fcntl.h
12142 echo "We'll be including <fcntl.h>." >&4
12145 if $h_sysfile; then
12146 echo "We don't need to include <fcntl.h> if we include <sys/file.h>." >&4
12148 echo "We won't be including <fcntl.h>." >&4
12160 : check for non-blocking I/O stuff
12161 case "$h_sysfile" in
12162 true) echo "#include <sys/file.h>" > head.c;;
12165 true) echo "#include <fcntl.h>" > head.c;;
12166 *) echo "#include <sys/fcntl.h>" > head.c;;
12171 echo "Figuring out the flag used by open() for non-blocking I/O..." >&4
12172 case "$o_nonblock" in
12174 $cat head.c > try.c
12175 $cat >>try.c <<EOCP
12177 #$i_stdlib I_STDLIB
12179 #include <stdlib.h>
12187 printf("O_NONBLOCK\n");
12191 printf("O_NDELAY\n");
12195 printf("FNDELAY\n");
12202 if eval $compile_ok; then
12203 o_nonblock=`$run ./try`
12204 case "$o_nonblock" in
12205 '') echo "I can't figure it out, assuming O_NONBLOCK will do.";;
12206 *) echo "Seems like we can use $o_nonblock.";;
12209 echo "(I can't compile the test program; pray O_NONBLOCK is right!)"
12212 *) echo "Using $hint value $o_nonblock.";;
12217 echo "Let's see what value errno gets from read() on a $o_nonblock file..." >&4
12220 $cat head.c > try.c
12221 $cat >>try.c <<EOCP
12223 #include <sys/types.h>
12224 #include <signal.h>
12226 #$i_stdlib I_STDLIB
12228 #include <stdlib.h>
12234 #define MY_O_NONBLOCK $o_nonblock
12235 #ifndef errno /* XXX need better Configure test */
12238 #$i_unistd I_UNISTD
12240 #include <unistd.h>
12242 #$i_string I_STRING
12244 #include <string.h>
12246 #include <strings.h>
12248 $signal_t blech(int x) { exit(3); }
12250 $cat >> try.c <<'EOCP'
12258 pipe(pd); /* Down: child -> parent */
12259 pipe(pu); /* Up: parent -> child */
12262 close(pd[1]); /* Parent reads from pd[0] */
12263 close(pu[0]); /* Parent writes (blocking) to pu[1] */
12265 if (-1 == fcntl(pd[0], F_SETFL, MY_O_NONBLOCK))
12270 signal(SIGALRM, blech);
12272 if ((ret = read(pd[0], buf, 1)) > 0) /* Nothing to read! */
12274 sprintf(string, "%d\n", ret);
12275 write(2, string, strlen(string));
12278 if (errno == EAGAIN) {
12279 printf("EAGAIN\n");
12284 if (errno == EWOULDBLOCK)
12285 printf("EWOULDBLOCK\n");
12288 write(pu[1], buf, 1); /* Unblocks child, tell it to close our pipe */
12289 sleep(2); /* Give it time to close our pipe */
12291 ret = read(pd[0], buf, 1); /* Should read EOF */
12293 sprintf(string, "%d\n", ret);
12294 write(4, string, strlen(string));
12298 close(pd[0]); /* We write to pd[1] */
12299 close(pu[1]); /* We read from pu[0] */
12300 read(pu[0], buf, 1); /* Wait for parent to signal us we may continue */
12301 close(pd[1]); /* Pipe pd is now fully closed! */
12302 exit(0); /* Bye bye, thank you for playing! */
12306 if eval $compile_ok; then
12307 echo "$startsh" >mtry
12308 echo "$run ./try >try.out 2>try.ret 4>try.err || exit 4" >>mtry
12310 ./mtry >/dev/null 2>&1
12312 0) eagain=`$cat try.out`;;
12313 1) echo "Could not perform non-blocking setting!";;
12314 2) echo "I did a successful read() for something that was not there!";;
12315 3) echo "Hmm... non-blocking I/O does not seem to be working!";;
12316 4) echo "Could not find F_SETFL!";;
12317 *) echo "Something terribly wrong happened during testing.";;
12319 rd_nodata=`$cat try.ret`
12320 echo "A read() system call with no data present returns $rd_nodata."
12321 case "$rd_nodata" in
12324 echo "(That's peculiar, fixing that to be -1.)"
12330 echo "Forcing errno EAGAIN on read() with no data available."
12334 echo "Your read() sets errno to $eagain when no data is available."
12337 status=`$cat try.err`
12339 0) echo "And it correctly returns 0 to signal EOF.";;
12340 -1) echo "But it also returns -1 to signal EOF, so be careful!";;
12341 *) echo "However, your read() returns '$status' on EOF??";;
12344 if test "$status" = "$rd_nodata"; then
12345 echo "WARNING: you can't distinguish between EOF and no data!"
12349 echo "I can't compile the test program--assuming errno EAGAIN will do."
12356 echo "Using $hint value $eagain."
12357 echo "Your read() returns $rd_nodata when no data is present."
12358 case "$d_eofnblk" in
12359 "$define") echo "And you can see EOF because read() returns 0.";;
12360 "$undef") echo "But you can't see EOF status from read() returned value.";;
12362 echo "(Assuming you can't see EOF status from read anyway.)"
12368 $rm_try head.c mtry
12370 : see if _ptr and _cnt from stdio act std
12373 if $contains '_lbfsize' `./findhdr stdio.h` >/dev/null 2>&1 ; then
12374 echo "(Looks like you have stdio.h from BSD.)"
12375 case "$stdio_ptr" in
12376 '') stdio_ptr='((fp)->_p)'
12379 *) ptr_lval=$d_stdio_ptr_lval;;
12381 case "$stdio_cnt" in
12382 '') stdio_cnt='((fp)->_r)'
12385 *) cnt_lval=$d_stdio_cnt_lval;;
12387 case "$stdio_base" in
12388 '') stdio_base='((fp)->_ub._base ? (fp)->_ub._base : (fp)->_bf._base)';;
12390 case "$stdio_bufsiz" in
12391 '') stdio_bufsiz='((fp)->_ub._base ? (fp)->_ub._size : (fp)->_bf._size)';;
12393 elif $contains '_IO_fpos_t' `./findhdr stdio.h` `./findhdr libio.h` >/dev/null 2>&1 ; then
12394 echo "(Looks like you have stdio.h from Linux.)"
12395 case "$stdio_ptr" in
12396 '') stdio_ptr='((fp)->_IO_read_ptr)'
12399 *) ptr_lval=$d_stdio_ptr_lval;;
12401 case "$stdio_cnt" in
12402 '') stdio_cnt='((fp)->_IO_read_end - (fp)->_IO_read_ptr)'
12405 *) cnt_lval=$d_stdio_cnt_lval;;
12407 case "$stdio_base" in
12408 '') stdio_base='((fp)->_IO_read_base)';;
12410 case "$stdio_bufsiz" in
12411 '') stdio_bufsiz='((fp)->_IO_read_end - (fp)->_IO_read_base)';;
12414 case "$stdio_ptr" in
12415 '') stdio_ptr='((fp)->_ptr)'
12418 *) ptr_lval=$d_stdio_ptr_lval;;
12420 case "$stdio_cnt" in
12421 '') stdio_cnt='((fp)->_cnt)'
12424 *) cnt_lval=$d_stdio_cnt_lval;;
12426 case "$stdio_base" in
12427 '') stdio_base='((fp)->_base)';;
12429 case "$stdio_bufsiz" in
12430 '') stdio_bufsiz='((fp)->_cnt + (fp)->_ptr - (fp)->_base)';;
12434 : test whether _ptr and _cnt really work
12435 echo "Checking how std your stdio is..." >&4
12438 #$i_stdlib I_STDLIB
12440 #include <stdlib.h>
12442 #define FILE_ptr(fp) $stdio_ptr
12443 #define FILE_cnt(fp) $stdio_cnt
12445 FILE *fp = fopen("try.c", "r");
12448 18 <= FILE_cnt(fp) &&
12449 strncmp(FILE_ptr(fp), "include <stdio.h>\n", 18) == 0
12457 if eval $compile && $to try.c; then
12458 if $run ./try; then
12459 echo "Your stdio acts pretty std."
12462 echo "Your stdio isn't very std."
12465 echo "Your stdio doesn't appear very std."
12469 # glibc 2.2.90 and above apparently change stdio streams so Perl's
12470 # direct buffer manipulation no longer works. The Configure tests
12471 # should be changed to correctly detect this, but until then,
12472 # the following check should at least let perl compile and run.
12473 # (This quick fix should be updated before 5.8.1.)
12474 # To be defensive, reject all unknown versions, and all versions > 2.2.9.
12475 # A. Dougherty, June 3, 2002.
12476 case "$d_gnulibc" in
12478 case "$gnulibc_version" in
12482 *) echo "But I will not snoop inside glibc $gnulibc_version stdio buffers."
12491 : Can _ptr be used as an lvalue?
12492 case "$d_stdstdio$ptr_lval" in
12493 $define$define) val=$define ;;
12496 set d_stdio_ptr_lval
12499 : Can _cnt be used as an lvalue?
12500 case "$d_stdstdio$cnt_lval" in
12501 $define$define) val=$define ;;
12504 set d_stdio_cnt_lval
12508 : test whether setting _ptr sets _cnt as a side effect
12509 d_stdio_ptr_lval_sets_cnt="$undef"
12510 d_stdio_ptr_lval_nochange_cnt="$undef"
12511 case "$d_stdio_ptr_lval$d_stdstdio" in
12513 echo "Checking to see what happens if we set the stdio ptr..." >&4
12516 /* Can we scream? */
12517 /* Eat dust sed :-) */
12518 /* In the buffer space, no one can hear you scream. */
12519 #$i_stdlib I_STDLIB
12521 #include <stdlib.h>
12523 #define FILE_ptr(fp) $stdio_ptr
12524 #define FILE_cnt(fp) $stdio_cnt
12525 #include <sys/types.h>
12527 FILE *fp = fopen("try.c", "r");
12532 puts("Fail even to read");
12535 c = getc(fp); /* Read away the first # */
12537 puts("Fail even to read");
12541 18 <= FILE_cnt(fp) &&
12542 strncmp(FILE_ptr(fp), "include <stdio.h>\n", 18) == 0
12544 puts("Fail even to read");
12547 ptr = (char*) FILE_ptr(fp);
12548 cnt = (size_t)FILE_cnt(fp);
12550 FILE_ptr(fp) += 42;
12552 if ((char*)FILE_ptr(fp) != (ptr + 42)) {
12553 printf("Fail ptr check %p != %p", FILE_ptr(fp), (ptr + 42));
12556 if (FILE_cnt(fp) <= 20) {
12557 printf ("Fail (<20 chars to test)");
12560 if (strncmp(FILE_ptr(fp), "Eat dust sed :-) */\n", 20) != 0) {
12561 puts("Fail compare");
12564 if (cnt == FILE_cnt(fp)) {
12565 puts("Pass_unchanged");
12568 if (FILE_cnt(fp) == (cnt - 42)) {
12569 puts("Pass_changed");
12572 printf("Fail count was %d now %d\n", cnt, FILE_cnt(fp));
12578 if eval $compile && $to try.c; then
12579 case `$run ./try` in
12581 echo "Increasing ptr in your stdio decreases cnt by the same amount. Good." >&4
12582 d_stdio_ptr_lval_sets_cnt="$define" ;;
12584 echo "Increasing ptr in your stdio leaves cnt unchanged. Good." >&4
12585 d_stdio_ptr_lval_nochange_cnt="$define" ;;
12587 echo "Increasing ptr in your stdio didn't do exactly what I expected. We'll not be doing that then." >&4 ;;
12589 echo "It appears attempting to set ptr in your stdio is a bad plan." >&4 ;;
12592 echo "It seems we can't set ptr in your stdio. Nevermind." >&4
12598 : see if _base is also standard
12600 case "$d_stdstdio" in
12604 #$i_stdlib I_STDLIB
12606 #include <stdlib.h>
12608 #define FILE_base(fp) $stdio_base
12609 #define FILE_bufsiz(fp) $stdio_bufsiz
12611 FILE *fp = fopen("try.c", "r");
12614 19 <= FILE_bufsiz(fp) &&
12615 strncmp(FILE_base(fp), "#include <stdio.h>\n", 19) == 0
12622 if eval $compile && $to try.c; then
12623 if $run ./try; then
12624 echo "And its _base field acts std."
12627 echo "But its _base field isn't std."
12630 echo "However, it seems to be lacking the _base field."
12638 : see if fast_stdio exists
12640 case "$d_stdstdio:$d_stdio_ptr_lval" in
12642 case "$d_stdio_cnt_lval$d_stdio_ptr_lval_sets_cnt" in
12644 echo "You seem to have 'fast stdio' to directly manipulate the stdio buffers." >& 4
12655 : see if fchdir exists
12656 set fchdir d_fchdir
12659 : see if fchmod exists
12660 set fchmod d_fchmod
12663 : see if fchown exists
12664 set fchown d_fchown
12667 : see if this is an fcntl system
12672 : See if fcntl-based locking works.
12674 #$i_stdlib I_STDLIB
12676 #include <stdlib.h>
12678 #include <unistd.h>
12680 #include <signal.h>
12681 $signal_t blech(int x) { exit(3); }
12683 #if defined(F_SETLK) && defined(F_SETLKW)
12684 struct flock flock;
12686 fd = open("try.c", O_RDONLY);
12687 flock.l_type = F_RDLCK;
12688 flock.l_whence = SEEK_SET;
12689 flock.l_start = flock.l_len = 0;
12690 signal(SIGALRM, blech);
12692 retval = fcntl(fd, F_SETLK, &flock);
12694 (retval < 0 ? exit(2) : exit(0));
12700 echo "Checking if fcntl-based file locking works... "
12704 if eval $compile_ok; then
12705 if $run ./try; then
12706 echo "Yes, it seems to work."
12709 echo "Nope, it didn't work."
12714 *** I had to forcibly timeout from fcntl(..., F_SETLK, ...).
12715 *** This is (almost) impossible.
12716 *** If your NFS lock daemons are not feeling well, something like
12717 *** this may happen, please investigate. Cannot continue, aborting.
12725 echo "I'm unable to compile the test program, so I'll assume not."
12730 echo "Nope, since you don't even have fcntl()."
12733 set d_fcntl_can_lock
12737 : check for fd_set items
12740 Checking to see how well your C compiler handles fd_set and friends ...
12743 #$i_stdlib I_STDLIB
12745 #include <stdlib.h>
12747 #$i_systime I_SYS_TIME
12748 #$i_sysselct I_SYS_SELECT
12749 #$d_socket HAS_SOCKET
12750 #include <sys/types.h>
12752 #include <sys/socket.h> /* Might include <sys/bsdtypes.h> */
12755 #include <sys/time.h>
12757 #ifdef I_SYS_SELECT
12758 #include <sys/select.h>
12767 #if defined(FD_SET) && defined(FD_CLR) && defined(FD_ISSET) && defined(FD_ZERO)
12775 if eval $compile; then
12776 d_fds_bits="$define"
12778 echo "Well, your system knows about the normal fd_set typedef..." >&4
12779 if $run ./try; then
12780 echo "and you have the normal fd_set macros (just as I'd expect)." >&4
12781 d_fd_macros="$define"
12784 but not the normal fd_set macros! Gaaack! I'll have to cover for you.
12786 d_fd_macros="$undef"
12790 Hmm, your compiler has some difficulty with fd_set. Checking further...
12793 if eval $compile; then
12794 d_fds_bits="$undef"
12796 echo "Well, your system has some sort of fd_set available..." >&4
12797 if $run ./try; then
12798 echo "and you have the normal fd_set macros." >&4
12799 d_fd_macros="$define"
12802 but not the normal fd_set macros! Gross! More work for me...
12804 d_fd_macros="$undef"
12807 echo "Well, you got zip. That's OK, I can roll my own fd_set stuff." >&4
12809 d_fds_bits="$undef"
12810 d_fd_macros="$undef"
12815 : see if fgetpos exists
12816 set fgetpos d_fgetpos
12819 : see if finite exists
12820 set finite d_finite
12823 : see if finitel exists
12824 set finitel d_finitel
12827 : see if flock exists
12831 : see if prototype for flock is available
12833 set d_flockproto flock $i_sysfile sys/file.h
12836 : see if fork exists
12840 : see if fp_class exists
12841 set fp_class d_fp_class
12844 : see if pathconf exists
12845 set pathconf d_pathconf
12848 : see if fpathconf exists
12849 set fpathconf d_fpathconf
12852 : see if fpclass exists
12853 set fpclass d_fpclass
12856 : see if fpclassify exists
12857 set fpclassify d_fpclassify
12860 : see if fpclassl exists
12861 set fpclassl d_fpclassl
12865 : check for fpos64_t
12867 echo "Checking to see if you have fpos64_t..." >&4
12870 int main() { fpos64_t x = 7; }
12873 if eval $compile; then
12875 echo "You have fpos64_t."
12878 echo "You do not have fpos64_t."
12879 case "$fpossize" in
12880 8) echo "(Your fpos_t is 64 bits, so you could use that.)" ;;
12887 : see if frexpl exists
12888 set frexpl d_frexpl
12891 : see if this is a sys/param system
12892 set sys/param.h i_sysparam
12895 : see if this is a sys/mount.h system
12896 set sys/mount.h i_sysmount
12901 echo "Checking to see if your system supports struct fs_data..." >&4
12902 set d_fs_data_s fs_data $i_systypes sys/types.h $i_sysparam sys/param.h $i_sysmount sys/mount.h
12904 case "$d_fs_data_s" in
12905 "$define") echo "Yes, it does." ;;
12906 *) echo "No, it doesn't." ;;
12909 : see if fseeko exists
12910 set fseeko d_fseeko
12912 case "$longsize" in
12913 8) echo "(Your long is 64 bits, so you could use fseek.)" ;;
12916 : see if fsetpos exists
12917 set fsetpos d_fsetpos
12921 : see if fstatfs exists
12922 set fstatfs d_fstatfs
12926 : see if statvfs exists
12927 set statvfs d_statvfs
12930 : see if fstatvfs exists
12931 set fstatvfs d_fstatvfs
12935 : see if fsync exists
12939 : see if ftello exists
12940 set ftello d_ftello
12942 case "$longsize" in
12943 8) echo "(Your long is 64 bits, so you could use ftell.)" ;;
12947 : check for a working futimes
12949 echo "Checking if you have a working futimes()" >&4
12952 #include <sys/time.h>
12959 fd = open ("try.c", O_RDWR);
12960 if (-1 == fd) exit (1);
12961 rv = futimes (fd, NULL);
12962 exit (rv == -1 ? errno : 0);
12966 if eval $compile; then
12970 0) echo "Yes, you have" >&4
12971 d_futimes="$define"
12973 *) echo "No, you have futimes, but it isn't working ($rc) (probably harmless)" >&4
12977 echo "No, it does not (probably harmless)" >&4
12981 : see if getcwd exists
12982 set getcwd d_getcwd
12985 : see if getespwnam exists
12986 set getespwnam d_getespwnam
12990 : see if getfsstat exists
12991 set getfsstat d_getfsstat
12994 : see if getgrent exists
12995 set getgrent d_getgrent
12998 : see if getgrent_r exists
12999 set getgrent_r d_getgrent_r
13001 case "$d_getgrent_r" in
13003 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
13004 case "$d_getgrent_r_proto:$usethreads" in
13005 ":define") d_getgrent_r_proto=define
13006 set d_getgrent_r_proto getgrent_r $hdrs
13010 case "$d_getgrent_r_proto" in
13012 case "$getgrent_r_proto" in
13013 ''|0) try='int getgrent_r(struct group*, char*, size_t, struct group**);'
13014 ./protochk "extern $try" $hdrs && getgrent_r_proto=I_SBWR ;;
13016 case "$getgrent_r_proto" in
13017 ''|0) try='int getgrent_r(struct group*, char*, int, struct group**);'
13018 ./protochk "extern $try" $hdrs && getgrent_r_proto=I_SBIR ;;
13020 case "$getgrent_r_proto" in
13021 ''|0) try='struct group* getgrent_r(struct group*, char*, size_t);'
13022 ./protochk "extern $try" $hdrs && getgrent_r_proto=S_SBW ;;
13024 case "$getgrent_r_proto" in
13025 ''|0) try='struct group* getgrent_r(struct group*, char*, int);'
13026 ./protochk "extern $try" $hdrs && getgrent_r_proto=S_SBI ;;
13028 case "$getgrent_r_proto" in
13029 ''|0) try='int getgrent_r(struct group*, char*, int);'
13030 ./protochk "extern $try" $hdrs && getgrent_r_proto=I_SBI ;;
13032 case "$getgrent_r_proto" in
13033 ''|0) try='int getgrent_r(struct group*, char*, int, FILE**);'
13034 ./protochk "extern $try" $hdrs && getgrent_r_proto=I_SBIH ;;
13036 case "$getgrent_r_proto" in
13037 ''|0) d_getgrent_r=undef
13039 echo "Disabling getgrent_r, cannot determine prototype." >&4 ;;
13040 * ) case "$getgrent_r_proto" in
13041 REENTRANT_PROTO*) ;;
13042 *) getgrent_r_proto="REENTRANT_PROTO_$getgrent_r_proto" ;;
13044 echo "Prototype: $try" ;;
13047 *) case "$usethreads" in
13048 define) echo "getgrent_r has no prototype, not using it." >&4 ;;
13055 *) getgrent_r_proto=0
13059 : see if getgrgid_r exists
13060 set getgrgid_r d_getgrgid_r
13062 case "$d_getgrgid_r" in
13064 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
13065 case "$d_getgrgid_r_proto:$usethreads" in
13066 ":define") d_getgrgid_r_proto=define
13067 set d_getgrgid_r_proto getgrgid_r $hdrs
13071 case "$d_getgrgid_r_proto" in
13073 case "$getgrgid_r_proto" in
13074 ''|0) try='int getgrgid_r(gid_t, struct group*, char*, size_t, struct group**);'
13075 ./protochk "extern $try" $hdrs && getgrgid_r_proto=I_TSBWR ;;
13077 case "$getgrgid_r_proto" in
13078 ''|0) try='int getgrgid_r(gid_t, struct group*, char*, int, struct group**);'
13079 ./protochk "extern $try" $hdrs && getgrgid_r_proto=I_TSBIR ;;
13081 case "$getgrgid_r_proto" in
13082 ''|0) try='int getgrgid_r(gid_t, struct group*, char*, int);'
13083 ./protochk "extern $try" $hdrs && getgrgid_r_proto=I_TSBI ;;
13085 case "$getgrgid_r_proto" in
13086 ''|0) try='struct group* getgrgid_r(gid_t, struct group*, char*, int);'
13087 ./protochk "extern $try" $hdrs && getgrgid_r_proto=S_TSBI ;;
13089 case "$getgrgid_r_proto" in
13090 ''|0) d_getgrgid_r=undef
13092 echo "Disabling getgrgid_r, cannot determine prototype." >&4 ;;
13093 * ) case "$getgrgid_r_proto" in
13094 REENTRANT_PROTO*) ;;
13095 *) getgrgid_r_proto="REENTRANT_PROTO_$getgrgid_r_proto" ;;
13097 echo "Prototype: $try" ;;
13100 *) case "$usethreads" in
13101 define) echo "getgrgid_r has no prototype, not using it." >&4 ;;
13108 *) getgrgid_r_proto=0
13112 : see if getgrnam_r exists
13113 set getgrnam_r d_getgrnam_r
13115 case "$d_getgrnam_r" in
13117 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
13118 case "$d_getgrnam_r_proto:$usethreads" in
13119 ":define") d_getgrnam_r_proto=define
13120 set d_getgrnam_r_proto getgrnam_r $hdrs
13124 case "$d_getgrnam_r_proto" in
13126 case "$getgrnam_r_proto" in
13127 ''|0) try='int getgrnam_r(const char*, struct group*, char*, size_t, struct group**);'
13128 ./protochk "extern $try" $hdrs && getgrnam_r_proto=I_CSBWR ;;
13130 case "$getgrnam_r_proto" in
13131 ''|0) try='int getgrnam_r(const char*, struct group*, char*, int, struct group**);'
13132 ./protochk "extern $try" $hdrs && getgrnam_r_proto=I_CSBIR ;;
13134 case "$getgrnam_r_proto" in
13135 ''|0) try='struct group* getgrnam_r(const char*, char*, int);'
13136 ./protochk "extern $try" $hdrs && getgrnam_r_proto=S_CBI ;;
13138 case "$getgrnam_r_proto" in
13139 ''|0) try='int getgrnam_r(const char*, struct group*, char*, int);'
13140 ./protochk "extern $try" $hdrs && getgrnam_r_proto=I_CSBI ;;
13142 case "$getgrnam_r_proto" in
13143 ''|0) try='struct group* getgrnam_r(const char*, struct group*, char*, int);'
13144 ./protochk "extern $try" $hdrs && getgrnam_r_proto=S_CSBI ;;
13146 case "$getgrnam_r_proto" in
13147 ''|0) d_getgrnam_r=undef
13149 echo "Disabling getgrnam_r, cannot determine prototype." >&4 ;;
13150 * ) case "$getgrnam_r_proto" in
13151 REENTRANT_PROTO*) ;;
13152 *) getgrnam_r_proto="REENTRANT_PROTO_$getgrnam_r_proto" ;;
13154 echo "Prototype: $try" ;;
13157 *) case "$usethreads" in
13158 define) echo "getgrnam_r has no prototype, not using it." >&4 ;;
13165 *) getgrnam_r_proto=0
13169 : see if gethostbyaddr exists
13170 set gethostbyaddr d_gethbyaddr
13173 : see if gethostbyname exists
13174 set gethostbyname d_gethbyname
13177 : see if gethostent exists
13178 set gethostent d_gethent
13181 : see how we will look up host name
13184 if set gethostname val -f d_gethname; eval $csym; $val; then
13185 echo 'gethostname() found.' >&4
13186 d_gethname="$define"
13189 if set uname val -f d_uname; eval $csym; $val; then
13192 uname() was found, but you're running xenix, and older versions of xenix
13193 have a broken uname(). If you don't really know whether your xenix is old
13194 enough to have a broken system call, use the default answer.
13199 "$define") dflt=n;;
13201 rp='Is your uname() broken?'
13204 n*) d_uname="$define"; call=uname;;
13207 echo 'uname() found.' >&4
13214 case "$d_gethname" in
13215 '') d_gethname="$undef";;
13218 '') d_uname="$undef";;
13220 case "$d_uname$d_gethname" in
13225 Every now and then someone has a $call() that lies about the hostname
13226 but can't be fixed for political or economic reasons. If you wish, I can
13227 pretend $call() isn't there and maybe compute hostname at run-time
13228 thanks to the '$phostname' command.
13231 rp="Shall I ignore $call() from now on?"
13234 y*) d_uname="$undef" d_gethname="$undef"; $echo $n "Okay...$c";;
13237 case "$phostname" in
13238 '') aphostname='';;
13239 *) case "$aphostname" in
13241 *) set X $phostname
13245 file=`./loc $file $file $pth`
13246 aphostname=`echo $file $*`
13251 case "$d_uname$d_gethname" in
13254 case "$phostname" in
13256 echo "There will be no way for $package to get your hostname." >&4;;
13258 echo "I'll use 'popen("'"'$aphostname'", "r")'"' to get your hostname." >&4
13262 case "$d_phostname" in
13263 '') d_phostname="$undef";;
13266 : see if gethostbyaddr_r exists
13267 set gethostbyaddr_r d_gethostbyaddr_r
13269 case "$d_gethostbyaddr_r" in
13271 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13272 case "$d_gethostbyaddr_r_proto:$usethreads" in
13273 ":define") d_gethostbyaddr_r_proto=define
13274 set d_gethostbyaddr_r_proto gethostbyaddr_r $hdrs
13278 case "$d_gethostbyaddr_r_proto" in
13280 case "$gethostbyaddr_r_proto" in
13281 ''|0) try='int gethostbyaddr_r(const char*, size_t, int, struct hostent*, char*, size_t, struct hostent**, int*);'
13282 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=I_CWISBWRE ;;
13284 case "$gethostbyaddr_r_proto" in
13285 ''|0) try='struct hostent* gethostbyaddr_r(const char*, size_t, int, struct hostent*, char*, size_t, int, int*);'
13286 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=S_CWISBWIE ;;
13288 case "$gethostbyaddr_r_proto" in
13289 ''|0) try='struct hostent* gethostbyaddr_r(const char*, size_t, int, struct hostent*, char*, int, int*);'
13290 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=S_CWISBIE ;;
13292 case "$gethostbyaddr_r_proto" in
13293 ''|0) try='struct hostent* gethostbyaddr_r(const void*, size_t, int, struct hostent*, char*, int, int*);'
13294 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=S_TWISBIE ;;
13296 case "$gethostbyaddr_r_proto" in
13297 ''|0) try='struct hostent* gethostbyaddr_r(const char*, int, int, struct hostent*, char*, int, int*);'
13298 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=S_CIISBIE ;;
13300 case "$gethostbyaddr_r_proto" in
13301 ''|0) try='struct hostent* gethostbyaddr_r(const char*, struct hostent*, char*, int, int*);'
13302 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=S_CSBIE ;;
13304 case "$gethostbyaddr_r_proto" in
13305 ''|0) try='struct hostent* gethostbyaddr_r(const void*, struct hostent*, char*, int, int*);'
13306 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=S_TSBIE ;;
13308 case "$gethostbyaddr_r_proto" in
13309 ''|0) try='int gethostbyaddr_r(const char*, size_t, int, struct hostent*, struct hostent_data*);'
13310 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=I_CWISD ;;
13312 case "$gethostbyaddr_r_proto" in
13313 ''|0) try='int gethostbyaddr_r(const char*, int, int, struct hostent*, struct hostent_data*);'
13314 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=I_CIISD ;;
13316 case "$gethostbyaddr_r_proto" in
13317 ''|0) try='int gethostbyaddr_r(const char*, int, int);'
13318 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=I_CII ;;
13320 case "$gethostbyaddr_r_proto" in
13321 ''|0) try='int gethostbyaddr_r(const void*, socklen_t, int, struct hostent*, char*, size_t, struct hostent**, int*);'
13322 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=I_TsISBWRE ;;
13324 case "$gethostbyaddr_r_proto" in
13325 ''|0) d_gethostbyaddr_r=undef
13326 gethostbyaddr_r_proto=0
13327 echo "Disabling gethostbyaddr_r, cannot determine prototype." >&4 ;;
13328 * ) case "$gethostbyaddr_r_proto" in
13329 REENTRANT_PROTO*) ;;
13330 *) gethostbyaddr_r_proto="REENTRANT_PROTO_$gethostbyaddr_r_proto" ;;
13332 echo "Prototype: $try" ;;
13335 *) case "$usethreads" in
13336 define) echo "gethostbyaddr_r has no prototype, not using it." >&4 ;;
13338 d_gethostbyaddr_r=undef
13339 gethostbyaddr_r_proto=0
13343 *) gethostbyaddr_r_proto=0
13347 : see if gethostbyname_r exists
13348 set gethostbyname_r d_gethostbyname_r
13350 case "$d_gethostbyname_r" in
13352 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13353 case "$d_gethostbyname_r_proto:$usethreads" in
13354 ":define") d_gethostbyname_r_proto=define
13355 set d_gethostbyname_r_proto gethostbyname_r $hdrs
13359 case "$d_gethostbyname_r_proto" in
13361 case "$gethostbyname_r_proto" in
13362 ''|0) try='int gethostbyname_r(const char*, struct hostent*, char*, size_t, struct hostent**, int*);'
13363 ./protochk "extern $try" $hdrs && gethostbyname_r_proto=I_CSBWRE ;;
13365 case "$gethostbyname_r_proto" in
13366 ''|0) try='struct hostent* gethostbyname_r(const char*, struct hostent*, char*, int, int*);'
13367 ./protochk "extern $try" $hdrs && gethostbyname_r_proto=S_CSBIE ;;
13369 case "$gethostbyname_r_proto" in
13370 ''|0) try='int gethostbyname_r(const char*, struct hostent*, struct hostent_data*);'
13371 ./protochk "extern $try" $hdrs && gethostbyname_r_proto=I_CSD ;;
13373 case "$gethostbyname_r_proto" in
13374 ''|0) d_gethostbyname_r=undef
13375 gethostbyname_r_proto=0
13376 echo "Disabling gethostbyname_r, cannot determine prototype." >&4 ;;
13377 * ) case "$gethostbyname_r_proto" in
13378 REENTRANT_PROTO*) ;;
13379 *) gethostbyname_r_proto="REENTRANT_PROTO_$gethostbyname_r_proto" ;;
13381 echo "Prototype: $try" ;;
13384 *) case "$usethreads" in
13385 define) echo "gethostbyname_r has no prototype, not using it." >&4 ;;
13387 d_gethostbyname_r=undef
13388 gethostbyname_r_proto=0
13392 *) gethostbyname_r_proto=0
13396 : see if gethostent_r exists
13397 set gethostent_r d_gethostent_r
13399 case "$d_gethostent_r" in
13401 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13402 case "$d_gethostent_r_proto:$usethreads" in
13403 ":define") d_gethostent_r_proto=define
13404 set d_gethostent_r_proto gethostent_r $hdrs
13408 case "$d_gethostent_r_proto" in
13410 case "$gethostent_r_proto" in
13411 ''|0) try='int gethostent_r(struct hostent*, char*, size_t, struct hostent**, int*);'
13412 ./protochk "extern $try" $hdrs && gethostent_r_proto=I_SBWRE ;;
13414 case "$gethostent_r_proto" in
13415 ''|0) try='int gethostent_r(struct hostent*, char*, int, int*);'
13416 ./protochk "extern $try" $hdrs && gethostent_r_proto=I_SBIE ;;
13418 case "$gethostent_r_proto" in
13419 ''|0) try='struct hostent* gethostent_r(struct hostent*, char*, int, int*);'
13420 ./protochk "extern $try" $hdrs && gethostent_r_proto=S_SBIE ;;
13422 case "$gethostent_r_proto" in
13423 ''|0) try='struct hostent* gethostent_r(struct hostent*, char*, int);'
13424 ./protochk "extern $try" $hdrs && gethostent_r_proto=S_SBI ;;
13426 case "$gethostent_r_proto" in
13427 ''|0) try='int gethostent_r(struct hostent*, char*, int);'
13428 ./protochk "extern $try" $hdrs && gethostent_r_proto=I_SBI ;;
13430 case "$gethostent_r_proto" in
13431 ''|0) try='int gethostent_r(struct hostent*, struct hostent_data*);'
13432 ./protochk "extern $try" $hdrs && gethostent_r_proto=I_SD ;;
13434 case "$gethostent_r_proto" in
13435 ''|0) d_gethostent_r=undef
13436 gethostent_r_proto=0
13437 echo "Disabling gethostent_r, cannot determine prototype." >&4 ;;
13438 * ) case "$gethostent_r_proto" in
13439 REENTRANT_PROTO*) ;;
13440 *) gethostent_r_proto="REENTRANT_PROTO_$gethostent_r_proto" ;;
13442 echo "Prototype: $try" ;;
13445 *) case "$usethreads" in
13446 define) echo "gethostent_r has no prototype, not using it." >&4 ;;
13448 d_gethostent_r=undef
13449 gethostent_r_proto=0
13453 *) gethostent_r_proto=0
13457 : see if prototypes for various gethostxxx netdb.h functions are available
13459 set d_gethostprotos gethostent $i_netdb netdb.h
13462 : see if getitimer exists
13463 set getitimer d_getitimer
13466 : see if getlogin exists
13467 set getlogin d_getlogin
13470 : see if getlogin_r exists
13471 set getlogin_r d_getlogin_r
13473 case "$d_getlogin_r" in
13475 hdrs="$i_systypes sys/types.h define stdio.h $i_unistd unistd.h"
13476 case "$d_getlogin_r_proto:$usethreads" in
13477 ":define") d_getlogin_r_proto=define
13478 set d_getlogin_r_proto getlogin_r $hdrs
13482 case "$d_getlogin_r_proto" in
13484 case "$getlogin_r_proto" in
13485 ''|0) try='int getlogin_r(char*, size_t);'
13486 ./protochk "extern $try" $hdrs && getlogin_r_proto=I_BW ;;
13488 case "$getlogin_r_proto" in
13489 ''|0) try='int getlogin_r(char*, int);'
13490 ./protochk "extern $try" $hdrs && getlogin_r_proto=I_BI ;;
13492 case "$getlogin_r_proto" in
13493 ''|0) try='char* getlogin_r(char*, size_t);'
13494 ./protochk "extern $try" $hdrs && getlogin_r_proto=B_BW ;;
13496 case "$getlogin_r_proto" in
13497 ''|0) try='char* getlogin_r(char*, int);'
13498 ./protochk "extern $try" $hdrs && getlogin_r_proto=B_BI ;;
13500 case "$getlogin_r_proto" in
13501 ''|0) d_getlogin_r=undef
13503 echo "Disabling getlogin_r, cannot determine prototype." >&4 ;;
13504 * ) case "$getlogin_r_proto" in
13505 REENTRANT_PROTO*) ;;
13506 *) getlogin_r_proto="REENTRANT_PROTO_$getlogin_r_proto" ;;
13508 echo "Prototype: $try" ;;
13511 *) case "$usethreads" in
13512 define) echo "getlogin_r has no prototype, not using it." >&4 ;;
13519 *) getlogin_r_proto=0
13523 : see if getmnt exists
13524 set getmnt d_getmnt
13527 : see if getmntent exists
13528 set getmntent d_getmntent
13531 : see if getnetbyaddr exists
13532 set getnetbyaddr d_getnbyaddr
13535 : see if getnetbyname exists
13536 set getnetbyname d_getnbyname
13539 : see if getnetent exists
13540 set getnetent d_getnent
13543 : see if getnetbyaddr_r exists
13544 set getnetbyaddr_r d_getnetbyaddr_r
13546 case "$d_getnetbyaddr_r" in
13548 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13549 case "$d_getnetbyaddr_r_proto:$usethreads" in
13550 ":define") d_getnetbyaddr_r_proto=define
13551 set d_getnetbyaddr_r_proto getnetbyaddr_r $hdrs
13555 case "$d_getnetbyaddr_r_proto" in
13557 case "$getnetbyaddr_r_proto" in
13558 ''|0) try='int getnetbyaddr_r(unsigned long, int, struct netent*, char*, size_t, struct netent**, int*);'
13559 ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=I_UISBWRE ;;
13561 case "$getnetbyaddr_r_proto" in
13562 ''|0) try='int getnetbyaddr_r(long, int, struct netent*, char*, int);'
13563 ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=I_LISBI ;;
13565 case "$getnetbyaddr_r_proto" in
13566 ''|0) try='struct netent* getnetbyaddr_r(in_addr_t, int, struct netent*, char*, int);'
13567 ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=S_TISBI ;;
13569 case "$getnetbyaddr_r_proto" in
13570 ''|0) try='struct netent* getnetbyaddr_r(long, int, struct netent*, char*, int);'
13571 ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=S_LISBI ;;
13573 case "$getnetbyaddr_r_proto" in
13574 ''|0) try='int getnetbyaddr_r(in_addr_t, int, struct netent*, struct netent_data*);'
13575 ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=I_TISD ;;
13577 case "$getnetbyaddr_r_proto" in
13578 ''|0) try='int getnetbyaddr_r(long, int, struct netent*, struct netent_data*);'
13579 ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=I_LISD ;;
13581 case "$getnetbyaddr_r_proto" in
13582 ''|0) try='int getnetbyaddr_r(int, int, struct netent*, struct netent_data*);'
13583 ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=I_IISD ;;
13585 case "$getnetbyaddr_r_proto" in
13586 ''|0) try='int getnetbyaddr_r(uint32_t, int, struct netent*, char*, size_t, struct netent**, int*);'
13587 ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=I_uISBWRE ;;
13589 case "$getnetbyaddr_r_proto" in
13590 ''|0) d_getnetbyaddr_r=undef
13591 getnetbyaddr_r_proto=0
13592 echo "Disabling getnetbyaddr_r, cannot determine prototype." >&4 ;;
13593 * ) case "$getnetbyaddr_r_proto" in
13594 REENTRANT_PROTO*) ;;
13595 *) getnetbyaddr_r_proto="REENTRANT_PROTO_$getnetbyaddr_r_proto" ;;
13597 echo "Prototype: $try" ;;
13600 *) case "$usethreads" in
13601 define) echo "getnetbyaddr_r has no prototype, not using it." >&4 ;;
13603 d_getnetbyaddr_r=undef
13604 getnetbyaddr_r_proto=0
13608 *) getnetbyaddr_r_proto=0
13612 : see if getnetbyname_r exists
13613 set getnetbyname_r d_getnetbyname_r
13615 case "$d_getnetbyname_r" in
13617 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13618 case "$d_getnetbyname_r_proto:$usethreads" in
13619 ":define") d_getnetbyname_r_proto=define
13620 set d_getnetbyname_r_proto getnetbyname_r $hdrs
13624 case "$d_getnetbyname_r_proto" in
13626 case "$getnetbyname_r_proto" in
13627 ''|0) try='int getnetbyname_r(const char*, struct netent*, char*, size_t, struct netent**, int*);'
13628 ./protochk "extern $try" $hdrs && getnetbyname_r_proto=I_CSBWRE ;;
13630 case "$getnetbyname_r_proto" in
13631 ''|0) try='int getnetbyname_r(const char*, struct netent*, char*, int);'
13632 ./protochk "extern $try" $hdrs && getnetbyname_r_proto=I_CSBI ;;
13634 case "$getnetbyname_r_proto" in
13635 ''|0) try='struct netent* getnetbyname_r(const char*, struct netent*, char*, int);'
13636 ./protochk "extern $try" $hdrs && getnetbyname_r_proto=S_CSBI ;;
13638 case "$getnetbyname_r_proto" in
13639 ''|0) try='int getnetbyname_r(const char*, struct netent*, struct netent_data*);'
13640 ./protochk "extern $try" $hdrs && getnetbyname_r_proto=I_CSD ;;
13642 case "$getnetbyname_r_proto" in
13643 ''|0) d_getnetbyname_r=undef
13644 getnetbyname_r_proto=0
13645 echo "Disabling getnetbyname_r, cannot determine prototype." >&4 ;;
13646 * ) case "$getnetbyname_r_proto" in
13647 REENTRANT_PROTO*) ;;
13648 *) getnetbyname_r_proto="REENTRANT_PROTO_$getnetbyname_r_proto" ;;
13650 echo "Prototype: $try" ;;
13653 *) case "$usethreads" in
13654 define) echo "getnetbyname_r has no prototype, not using it." >&4 ;;
13656 d_getnetbyname_r=undef
13657 getnetbyname_r_proto=0
13661 *) getnetbyname_r_proto=0
13665 : see if getnetent_r exists
13666 set getnetent_r d_getnetent_r
13668 case "$d_getnetent_r" in
13670 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13671 case "$d_getnetent_r_proto:$usethreads" in
13672 ":define") d_getnetent_r_proto=define
13673 set d_getnetent_r_proto getnetent_r $hdrs
13677 case "$d_getnetent_r_proto" in
13679 case "$getnetent_r_proto" in
13680 ''|0) try='int getnetent_r(struct netent*, char*, size_t, struct netent**, int*);'
13681 ./protochk "extern $try" $hdrs && getnetent_r_proto=I_SBWRE ;;
13683 case "$getnetent_r_proto" in
13684 ''|0) try='int getnetent_r(struct netent*, char*, int, int*);'
13685 ./protochk "extern $try" $hdrs && getnetent_r_proto=I_SBIE ;;
13687 case "$getnetent_r_proto" in
13688 ''|0) try='struct netent* getnetent_r(struct netent*, char*, int, int*);'
13689 ./protochk "extern $try" $hdrs && getnetent_r_proto=S_SBIE ;;
13691 case "$getnetent_r_proto" in
13692 ''|0) try='struct netent* getnetent_r(struct netent*, char*, int);'
13693 ./protochk "extern $try" $hdrs && getnetent_r_proto=S_SBI ;;
13695 case "$getnetent_r_proto" in
13696 ''|0) try='int getnetent_r(struct netent*, char*, int);'
13697 ./protochk "extern $try" $hdrs && getnetent_r_proto=I_SBI ;;
13699 case "$getnetent_r_proto" in
13700 ''|0) try='int getnetent_r(struct netent*, struct netent_data*);'
13701 ./protochk "extern $try" $hdrs && getnetent_r_proto=I_SD ;;
13703 case "$getnetent_r_proto" in
13704 ''|0) d_getnetent_r=undef
13705 getnetent_r_proto=0
13706 echo "Disabling getnetent_r, cannot determine prototype." >&4 ;;
13707 * ) case "$getnetent_r_proto" in
13708 REENTRANT_PROTO*) ;;
13709 *) getnetent_r_proto="REENTRANT_PROTO_$getnetent_r_proto" ;;
13711 echo "Prototype: $try" ;;
13714 *) case "$usethreads" in
13715 define) echo "getnetent_r has no prototype, not using it." >&4 ;;
13717 d_getnetent_r=undef
13718 getnetent_r_proto=0
13722 *) getnetent_r_proto=0
13726 : see if prototypes for various getnetxxx netdb.h functions are available
13728 set d_getnetprotos getnetent $i_netdb netdb.h
13731 : see if getpagesize exists
13732 set getpagesize d_getpagsz
13736 : see if getprotobyname exists
13737 set getprotobyname d_getpbyname
13740 : see if getprotobynumber exists
13741 set getprotobynumber d_getpbynumber
13744 : see if getprotoent exists
13745 set getprotoent d_getpent
13748 : see if getpgid exists
13749 set getpgid d_getpgid
13752 : see if getpgrp2 exists
13753 set getpgrp2 d_getpgrp2
13756 : see if getppid exists
13757 set getppid d_getppid
13760 : see if getpriority exists
13761 set getpriority d_getprior
13764 : see if getprotobyname_r exists
13765 set getprotobyname_r d_getprotobyname_r
13767 case "$d_getprotobyname_r" in
13769 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13770 case "$d_getprotobyname_r_proto:$usethreads" in
13771 ":define") d_getprotobyname_r_proto=define
13772 set d_getprotobyname_r_proto getprotobyname_r $hdrs
13776 case "$d_getprotobyname_r_proto" in
13778 case "$getprotobyname_r_proto" in
13779 ''|0) try='int getprotobyname_r(const char*, struct protoent*, char*, size_t, struct protoent**);'
13780 ./protochk "extern $try" $hdrs && getprotobyname_r_proto=I_CSBWR ;;
13782 case "$getprotobyname_r_proto" in
13783 ''|0) try='struct protoent* getprotobyname_r(const char*, struct protoent*, char*, int);'
13784 ./protochk "extern $try" $hdrs && getprotobyname_r_proto=S_CSBI ;;
13786 case "$getprotobyname_r_proto" in
13787 ''|0) try='int getprotobyname_r(const char*, struct protoent*, struct protoent_data*);'
13788 ./protochk "extern $try" $hdrs && getprotobyname_r_proto=I_CSD ;;
13790 case "$getprotobyname_r_proto" in
13791 ''|0) d_getprotobyname_r=undef
13792 getprotobyname_r_proto=0
13793 echo "Disabling getprotobyname_r, cannot determine prototype." >&4 ;;
13794 * ) case "$getprotobyname_r_proto" in
13795 REENTRANT_PROTO*) ;;
13796 *) getprotobyname_r_proto="REENTRANT_PROTO_$getprotobyname_r_proto" ;;
13798 echo "Prototype: $try" ;;
13801 *) case "$usethreads" in
13802 define) echo "getprotobyname_r has no prototype, not using it." >&4 ;;
13804 d_getprotobyname_r=undef
13805 getprotobyname_r_proto=0
13809 *) getprotobyname_r_proto=0
13813 : see if getprotobynumber_r exists
13814 set getprotobynumber_r d_getprotobynumber_r
13816 case "$d_getprotobynumber_r" in
13818 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13819 case "$d_getprotobynumber_r_proto:$usethreads" in
13820 ":define") d_getprotobynumber_r_proto=define
13821 set d_getprotobynumber_r_proto getprotobynumber_r $hdrs
13825 case "$d_getprotobynumber_r_proto" in
13827 case "$getprotobynumber_r_proto" in
13828 ''|0) try='int getprotobynumber_r(int, struct protoent*, char*, size_t, struct protoent**);'
13829 ./protochk "extern $try" $hdrs && getprotobynumber_r_proto=I_ISBWR ;;
13831 case "$getprotobynumber_r_proto" in
13832 ''|0) try='struct protoent* getprotobynumber_r(int, struct protoent*, char*, int);'
13833 ./protochk "extern $try" $hdrs && getprotobynumber_r_proto=S_ISBI ;;
13835 case "$getprotobynumber_r_proto" in
13836 ''|0) try='int getprotobynumber_r(int, struct protoent*, struct protoent_data*);'
13837 ./protochk "extern $try" $hdrs && getprotobynumber_r_proto=I_ISD ;;
13839 case "$getprotobynumber_r_proto" in
13840 ''|0) d_getprotobynumber_r=undef
13841 getprotobynumber_r_proto=0
13842 echo "Disabling getprotobynumber_r, cannot determine prototype." >&4 ;;
13843 * ) case "$getprotobynumber_r_proto" in
13844 REENTRANT_PROTO*) ;;
13845 *) getprotobynumber_r_proto="REENTRANT_PROTO_$getprotobynumber_r_proto" ;;
13847 echo "Prototype: $try" ;;
13850 *) case "$usethreads" in
13851 define) echo "getprotobynumber_r has no prototype, not using it." >&4 ;;
13853 d_getprotobynumber_r=undef
13854 getprotobynumber_r_proto=0
13858 *) getprotobynumber_r_proto=0
13862 : see if getprotoent_r exists
13863 set getprotoent_r d_getprotoent_r
13865 case "$d_getprotoent_r" in
13867 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13868 case "$d_getprotoent_r_proto:$usethreads" in
13869 ":define") d_getprotoent_r_proto=define
13870 set d_getprotoent_r_proto getprotoent_r $hdrs
13874 case "$d_getprotoent_r_proto" in
13876 case "$getprotoent_r_proto" in
13877 ''|0) try='int getprotoent_r(struct protoent*, char*, size_t, struct protoent**);'
13878 ./protochk "extern $try" $hdrs && getprotoent_r_proto=I_SBWR ;;
13880 case "$getprotoent_r_proto" in
13881 ''|0) try='int getprotoent_r(struct protoent*, char*, int);'
13882 ./protochk "extern $try" $hdrs && getprotoent_r_proto=I_SBI ;;
13884 case "$getprotoent_r_proto" in
13885 ''|0) try='struct protoent* getprotoent_r(struct protoent*, char*, int);'
13886 ./protochk "extern $try" $hdrs && getprotoent_r_proto=S_SBI ;;
13888 case "$getprotoent_r_proto" in
13889 ''|0) try='int getprotoent_r(struct protoent*, struct protoent_data*);'
13890 ./protochk "extern $try" $hdrs && getprotoent_r_proto=I_SD ;;
13892 case "$getprotoent_r_proto" in
13893 ''|0) d_getprotoent_r=undef
13894 getprotoent_r_proto=0
13895 echo "Disabling getprotoent_r, cannot determine prototype." >&4 ;;
13896 * ) case "$getprotoent_r_proto" in
13897 REENTRANT_PROTO*) ;;
13898 *) getprotoent_r_proto="REENTRANT_PROTO_$getprotoent_r_proto" ;;
13900 echo "Prototype: $try" ;;
13903 *) case "$usethreads" in
13904 define) echo "getprotoent_r has no prototype, not using it." >&4 ;;
13906 d_getprotoent_r=undef
13907 getprotoent_r_proto=0
13911 *) getprotoent_r_proto=0
13915 : see if prototypes for various getprotoxxx netdb.h functions are available
13917 set d_getprotoprotos getprotoent $i_netdb netdb.h
13920 : see if getprpwnam exists
13921 set getprpwnam d_getprpwnam
13924 : see if getpwent exists
13925 set getpwent d_getpwent
13928 : see if getpwent_r exists
13929 set getpwent_r d_getpwent_r
13931 case "$d_getpwent_r" in
13933 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
13934 case "$d_getpwent_r_proto:$usethreads" in
13935 ":define") d_getpwent_r_proto=define
13936 set d_getpwent_r_proto getpwent_r $hdrs
13940 case "$d_getpwent_r_proto" in
13942 case "$getpwent_r_proto" in
13943 ''|0) try='int getpwent_r(struct passwd*, char*, size_t, struct passwd**);'
13944 ./protochk "extern $try" $hdrs && getpwent_r_proto=I_SBWR ;;
13946 case "$getpwent_r_proto" in
13947 ''|0) try='int getpwent_r(struct passwd*, char*, int, struct passwd**);'
13948 ./protochk "extern $try" $hdrs && getpwent_r_proto=I_SBIR ;;
13950 case "$getpwent_r_proto" in
13951 ''|0) try='struct passwd* getpwent_r(struct passwd*, char*, size_t);'
13952 ./protochk "extern $try" $hdrs && getpwent_r_proto=S_SBW ;;
13954 case "$getpwent_r_proto" in
13955 ''|0) try='struct passwd* getpwent_r(struct passwd*, char*, int);'
13956 ./protochk "extern $try" $hdrs && getpwent_r_proto=S_SBI ;;
13958 case "$getpwent_r_proto" in
13959 ''|0) try='int getpwent_r(struct passwd*, char*, int);'
13960 ./protochk "extern $try" $hdrs && getpwent_r_proto=I_SBI ;;
13962 case "$getpwent_r_proto" in
13963 ''|0) try='int getpwent_r(struct passwd*, char*, int, FILE**);'
13964 ./protochk "extern $try" $hdrs && getpwent_r_proto=I_SBIH ;;
13966 case "$getpwent_r_proto" in
13967 ''|0) d_getpwent_r=undef
13969 echo "Disabling getpwent_r, cannot determine prototype." >&4 ;;
13970 * ) case "$getpwent_r_proto" in
13971 REENTRANT_PROTO*) ;;
13972 *) getpwent_r_proto="REENTRANT_PROTO_$getpwent_r_proto" ;;
13974 echo "Prototype: $try" ;;
13977 *) case "$usethreads" in
13978 define) echo "getpwent_r has no prototype, not using it." >&4 ;;
13985 *) getpwent_r_proto=0
13989 : see if getpwnam_r exists
13990 set getpwnam_r d_getpwnam_r
13992 case "$d_getpwnam_r" in
13994 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
13995 case "$d_getpwnam_r_proto:$usethreads" in
13996 ":define") d_getpwnam_r_proto=define
13997 set d_getpwnam_r_proto getpwnam_r $hdrs
14001 case "$d_getpwnam_r_proto" in
14003 case "$getpwnam_r_proto" in
14004 ''|0) try='int getpwnam_r(const char*, struct passwd*, char*, size_t, struct passwd**);'
14005 ./protochk "extern $try" $hdrs && getpwnam_r_proto=I_CSBWR ;;
14007 case "$getpwnam_r_proto" in
14008 ''|0) try='int getpwnam_r(const char*, struct passwd*, char*, int, struct passwd**);'
14009 ./protochk "extern $try" $hdrs && getpwnam_r_proto=I_CSBIR ;;
14011 case "$getpwnam_r_proto" in
14012 ''|0) try='struct passwd* getpwnam_r(const char*, struct passwd*, char*, int);'
14013 ./protochk "extern $try" $hdrs && getpwnam_r_proto=S_CSBI ;;
14015 case "$getpwnam_r_proto" in
14016 ''|0) try='int getpwnam_r(const char*, struct passwd*, char*, int);'
14017 ./protochk "extern $try" $hdrs && getpwnam_r_proto=I_CSBI ;;
14019 case "$getpwnam_r_proto" in
14020 ''|0) d_getpwnam_r=undef
14022 echo "Disabling getpwnam_r, cannot determine prototype." >&4 ;;
14023 * ) case "$getpwnam_r_proto" in
14024 REENTRANT_PROTO*) ;;
14025 *) getpwnam_r_proto="REENTRANT_PROTO_$getpwnam_r_proto" ;;
14027 echo "Prototype: $try" ;;
14030 *) case "$usethreads" in
14031 define) echo "getpwnam_r has no prototype, not using it." >&4 ;;
14038 *) getpwnam_r_proto=0
14042 : see if getpwuid_r exists
14043 set getpwuid_r d_getpwuid_r
14045 case "$d_getpwuid_r" in
14047 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
14048 case "$d_getpwuid_r_proto:$usethreads" in
14049 ":define") d_getpwuid_r_proto=define
14050 set d_getpwuid_r_proto getpwuid_r $hdrs
14054 case "$d_getpwuid_r_proto" in
14056 case "$getpwuid_r_proto" in
14057 ''|0) try='int getpwuid_r(uid_t, struct passwd*, char*, size_t, struct passwd**);'
14058 ./protochk "extern $try" $hdrs && getpwuid_r_proto=I_TSBWR ;;
14060 case "$getpwuid_r_proto" in
14061 ''|0) try='int getpwuid_r(uid_t, struct passwd*, char*, int, struct passwd**);'
14062 ./protochk "extern $try" $hdrs && getpwuid_r_proto=I_TSBIR ;;
14064 case "$getpwuid_r_proto" in
14065 ''|0) try='int getpwuid_r(uid_t, struct passwd*, char*, int);'
14066 ./protochk "extern $try" $hdrs && getpwuid_r_proto=I_TSBI ;;
14068 case "$getpwuid_r_proto" in
14069 ''|0) try='struct passwd* getpwuid_r(uid_t, struct passwd*, char*, int);'
14070 ./protochk "extern $try" $hdrs && getpwuid_r_proto=S_TSBI ;;
14072 case "$getpwuid_r_proto" in
14073 ''|0) d_getpwuid_r=undef
14075 echo "Disabling getpwuid_r, cannot determine prototype." >&4 ;;
14076 * ) case "$getpwuid_r_proto" in
14077 REENTRANT_PROTO*) ;;
14078 *) getpwuid_r_proto="REENTRANT_PROTO_$getpwuid_r_proto" ;;
14080 echo "Prototype: $try" ;;
14083 *) case "$usethreads" in
14084 define) echo "getpwuid_r has no prototype, not using it." >&4 ;;
14091 *) getpwuid_r_proto=0
14096 : see if getservbyname exists
14097 set getservbyname d_getsbyname
14100 : see if getservbyport exists
14101 set getservbyport d_getsbyport
14104 : see if getservent exists
14105 set getservent d_getsent
14108 : see if getservbyname_r exists
14109 set getservbyname_r d_getservbyname_r
14111 case "$d_getservbyname_r" in
14113 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14114 case "$d_getservbyname_r_proto:$usethreads" in
14115 ":define") d_getservbyname_r_proto=define
14116 set d_getservbyname_r_proto getservbyname_r $hdrs
14120 case "$d_getservbyname_r_proto" in
14122 case "$getservbyname_r_proto" in
14123 ''|0) try='int getservbyname_r(const char*, const char*, struct servent*, char*, size_t, struct servent**);'
14124 ./protochk "extern $try" $hdrs && getservbyname_r_proto=I_CCSBWR ;;
14126 case "$getservbyname_r_proto" in
14127 ''|0) try='struct servent* getservbyname_r(const char*, const char*, struct servent*, char*, int);'
14128 ./protochk "extern $try" $hdrs && getservbyname_r_proto=S_CCSBI ;;
14130 case "$getservbyname_r_proto" in
14131 ''|0) try='int getservbyname_r(const char*, const char*, struct servent*, struct servent_data*);'
14132 ./protochk "extern $try" $hdrs && getservbyname_r_proto=I_CCSD ;;
14134 case "$getservbyname_r_proto" in
14135 ''|0) d_getservbyname_r=undef
14136 getservbyname_r_proto=0
14137 echo "Disabling getservbyname_r, cannot determine prototype." >&4 ;;
14138 * ) case "$getservbyname_r_proto" in
14139 REENTRANT_PROTO*) ;;
14140 *) getservbyname_r_proto="REENTRANT_PROTO_$getservbyname_r_proto" ;;
14142 echo "Prototype: $try" ;;
14145 *) case "$usethreads" in
14146 define) echo "getservbyname_r has no prototype, not using it." >&4 ;;
14148 d_getservbyname_r=undef
14149 getservbyname_r_proto=0
14153 *) getservbyname_r_proto=0
14157 : see if getservbyport_r exists
14158 set getservbyport_r d_getservbyport_r
14160 case "$d_getservbyport_r" in
14162 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14163 case "$d_getservbyport_r_proto:$usethreads" in
14164 ":define") d_getservbyport_r_proto=define
14165 set d_getservbyport_r_proto getservbyport_r $hdrs
14169 case "$d_getservbyport_r_proto" in
14171 case "$getservbyport_r_proto" in
14172 ''|0) try='int getservbyport_r(int, const char*, struct servent*, char*, size_t, struct servent**);'
14173 ./protochk "extern $try" $hdrs && getservbyport_r_proto=I_ICSBWR ;;
14175 case "$getservbyport_r_proto" in
14176 ''|0) try='struct servent* getservbyport_r(int, const char*, struct servent*, char*, int);'
14177 ./protochk "extern $try" $hdrs && getservbyport_r_proto=S_ICSBI ;;
14179 case "$getservbyport_r_proto" in
14180 ''|0) try='int getservbyport_r(int, const char*, struct servent*, struct servent_data*);'
14181 ./protochk "extern $try" $hdrs && getservbyport_r_proto=I_ICSD ;;
14183 case "$getservbyport_r_proto" in
14184 ''|0) d_getservbyport_r=undef
14185 getservbyport_r_proto=0
14186 echo "Disabling getservbyport_r, cannot determine prototype." >&4 ;;
14187 * ) case "$getservbyport_r_proto" in
14188 REENTRANT_PROTO*) ;;
14189 *) getservbyport_r_proto="REENTRANT_PROTO_$getservbyport_r_proto" ;;
14191 echo "Prototype: $try" ;;
14194 *) case "$usethreads" in
14195 define) echo "getservbyport_r has no prototype, not using it." >&4 ;;
14197 d_getservbyport_r=undef
14198 getservbyport_r_proto=0
14202 *) getservbyport_r_proto=0
14206 : see if getservent_r exists
14207 set getservent_r d_getservent_r
14209 case "$d_getservent_r" in
14211 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14212 case "$d_getservent_r_proto:$usethreads" in
14213 ":define") d_getservent_r_proto=define
14214 set d_getservent_r_proto getservent_r $hdrs
14218 case "$d_getservent_r_proto" in
14220 case "$getservent_r_proto" in
14221 ''|0) try='int getservent_r(struct servent*, char*, size_t, struct servent**);'
14222 ./protochk "extern $try" $hdrs && getservent_r_proto=I_SBWR ;;
14224 case "$getservent_r_proto" in
14225 ''|0) try='int getservent_r(struct servent*, char*, int);'
14226 ./protochk "extern $try" $hdrs && getservent_r_proto=I_SBI ;;
14228 case "$getservent_r_proto" in
14229 ''|0) try='struct servent* getservent_r(struct servent*, char*, int);'
14230 ./protochk "extern $try" $hdrs && getservent_r_proto=S_SBI ;;
14232 case "$getservent_r_proto" in
14233 ''|0) try='int getservent_r(struct servent*, struct servent_data*);'
14234 ./protochk "extern $try" $hdrs && getservent_r_proto=I_SD ;;
14236 case "$getservent_r_proto" in
14237 ''|0) d_getservent_r=undef
14238 getservent_r_proto=0
14239 echo "Disabling getservent_r, cannot determine prototype." >&4 ;;
14240 * ) case "$getservent_r_proto" in
14241 REENTRANT_PROTO*) ;;
14242 *) getservent_r_proto="REENTRANT_PROTO_$getservent_r_proto" ;;
14244 echo "Prototype: $try" ;;
14247 *) case "$usethreads" in
14248 define) echo "getservent_r has no prototype, not using it." >&4 ;;
14250 d_getservent_r=undef
14251 getservent_r_proto=0
14255 *) getservent_r_proto=0
14259 : see if prototypes for various getservxxx netdb.h functions are available
14261 set d_getservprotos getservent $i_netdb netdb.h
14264 : see if getspnam exists
14265 set getspnam d_getspnam
14268 : see if this is a shadow.h system
14269 set shadow.h i_shadow
14272 : see if getspnam_r exists
14273 set getspnam_r d_getspnam_r
14275 case "$d_getspnam_r" in
14277 hdrs="$i_systypes sys/types.h define stdio.h $i_shadow shadow.h"
14278 case "$d_getspnam_r_proto:$usethreads" in
14279 ":define") d_getspnam_r_proto=define
14280 set d_getspnam_r_proto getspnam_r $hdrs
14284 case "$d_getspnam_r_proto" in
14286 case "$getspnam_r_proto" in
14287 ''|0) try='int getspnam_r(const char*, struct spwd*, char*, size_t, struct spwd**);'
14288 ./protochk "extern $try" $hdrs && getspnam_r_proto=I_CSBWR ;;
14290 case "$getspnam_r_proto" in
14291 ''|0) try='struct spwd* getspnam_r(const char*, struct spwd*, char*, int);'
14292 ./protochk "extern $try" $hdrs && getspnam_r_proto=S_CSBI ;;
14294 case "$getspnam_r_proto" in
14295 ''|0) d_getspnam_r=undef
14297 echo "Disabling getspnam_r, cannot determine prototype." >&4 ;;
14298 * ) case "$getspnam_r_proto" in
14299 REENTRANT_PROTO*) ;;
14300 *) getspnam_r_proto="REENTRANT_PROTO_$getspnam_r_proto" ;;
14302 echo "Prototype: $try" ;;
14305 *) case "$usethreads" in
14306 define) echo "getspnam_r has no prototype, not using it." >&4 ;;
14313 *) getspnam_r_proto=0
14317 : see if gettimeofday or ftime exists
14318 set gettimeofday d_gettimeod
14320 case "$d_gettimeod" in
14326 val="$undef"; set d_ftime; eval $setvar
14329 case "$d_gettimeod$d_ftime" in
14332 echo 'No ftime() nor gettimeofday() -- timing may be less accurate.' >&4
14336 : see if gmtime_r exists
14337 set gmtime_r d_gmtime_r
14339 case "$d_gmtime_r" in
14341 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
14342 case "$d_gmtime_r_proto:$usethreads" in
14343 ":define") d_gmtime_r_proto=define
14344 set d_gmtime_r_proto gmtime_r $hdrs
14348 case "$d_gmtime_r_proto" in
14350 case "$gmtime_r_proto" in
14351 ''|0) try='struct tm* gmtime_r(const time_t*, struct tm*);'
14352 ./protochk "extern $try" $hdrs && gmtime_r_proto=S_TS ;;
14354 case "$gmtime_r_proto" in
14355 ''|0) try='int gmtime_r(const time_t*, struct tm*);'
14356 ./protochk "extern $try" $hdrs && gmtime_r_proto=I_TS ;;
14358 case "$gmtime_r_proto" in
14359 ''|0) d_gmtime_r=undef
14361 echo "Disabling gmtime_r, cannot determine prototype." >&4 ;;
14362 * ) case "$gmtime_r_proto" in
14363 REENTRANT_PROTO*) ;;
14364 *) gmtime_r_proto="REENTRANT_PROTO_$gmtime_r_proto" ;;
14366 echo "Prototype: $try" ;;
14369 *) case "$usethreads" in
14370 define) echo "gmtime_r has no prototype, not using it." >&4 ;;
14377 *) gmtime_r_proto=0
14381 : see if hasmntopt exists
14382 set hasmntopt d_hasmntopt
14385 : see if this is a netinet/in.h or sys/in.h system
14386 set netinet/in.h i_niin sys/in.h i_sysin
14389 : see if arpa/inet.h has to be included
14390 set arpa/inet.h i_arpainet
14393 : see if htonl --and friends-- exists
14398 : Maybe they are macros.
14401 $cat >htonl.c <<EOM
14403 #include <sys/types.h>
14404 #$i_niin I_NETINET_IN
14406 #$i_arpainet I_ARPA_INET
14407 #ifdef I_NETINET_IN
14408 #include <netinet/in.h>
14411 #include <sys/in.h>
14414 #include <arpa/inet.h>
14417 printf("Defined as a macro.");
14420 $cppstdin $cppflags $cppminus < htonl.c >htonl.E 2>/dev/null
14421 if $contains 'Defined as a macro' htonl.E >/dev/null 2>&1; then
14423 echo "But it seems to be defined as a macro." >&4
14431 : see if ilogbl exists
14432 set ilogbl d_ilogbl
14437 if set index val -f; eval $csym; $val; then
14438 if set strchr val -f d_strchr; eval $csym; $val; then
14439 if $contains strchr "$strings" >/dev/null 2>&1 ; then
14442 echo "strchr() found." >&4
14446 echo "index() found." >&4
14451 echo "index() found." >&4
14454 if set strchr val -f d_strchr; eval $csym; $val; then
14457 echo "strchr() found." >&4
14459 echo "No index() or strchr() found!" >&4
14464 set d_strchr; eval $setvar
14466 set d_index; eval $setvar
14468 : check whether inet_aton exists
14469 set inet_aton d_inetaton
14474 $cat >isascii.c <<EOCP
14477 #$i_stdlib I_STDLIB
14479 #include <stdlib.h>
14490 if eval $compile; then
14491 echo "isascii() found." >&4
14494 echo "isascii() NOT found." >&4
14501 : see if isfinite exists
14502 set isfinite d_isfinite
14505 : see if isinf exists
14509 : see if isnan exists
14513 : see if isnanl exists
14514 set isnanl d_isnanl
14517 : see if killpg exists
14518 set killpg d_killpg
14521 : see if lchown exists
14523 $cat > try.c <<'EOCP'
14524 /* System header to define __stub macros and hopefully few prototypes,
14525 which can conflict with char lchown(); below. */
14526 #include <assert.h>
14527 /* Override any gcc2 internal prototype to avoid an error. */
14528 /* We use char because int might match the return type of a gcc2
14529 builtin and then its argument prototype would still apply. */
14532 /* The GNU C library defines this for functions which it implements
14533 to always fail with ENOSYS. Some functions are actually named
14534 something starting with __ and the normal name is an alias. */
14535 #if defined (__stub_lchown) || defined (__stub___lchown)
14543 if eval $compile; then
14544 $echo "lchown() found." >&4
14547 $echo "lchown() NOT found." >&4
14553 : See if number of significant digits in a double precision number is known
14555 $cat >ldbl_dig.c <<EOM
14556 #$i_limits I_LIMITS
14559 #include <limits.h>
14565 printf("Contains LDBL_DIG");
14568 $cppstdin $cppflags $cppminus < ldbl_dig.c >ldbl_dig.E 2>/dev/null
14569 if $contains 'LDBL_DIG' ldbl_dig.E >/dev/null 2>&1; then
14570 echo "LDBL_DIG found." >&4
14573 echo "LDBL_DIG NOT found." >&4
14580 : see if this is a math.h system
14584 d_libm_lib_version="$undef"
14587 : check to see if math.h defines _LIB_VERSION
14589 echo "Checking to see if your libm supports _LIB_VERSION..." >&4
14591 #include <unistd.h>
14593 int main (int argc, char *argv[])
14595 printf ("%d\n", _LIB_VERSION);
14600 if eval $compile; then
14602 echo "Yes, it does ($foo)" >&4
14603 d_libm_lib_version="$define"
14605 echo "No, it does not (probably harmless)\n" >&4
14612 : see if link exists
14616 : see if localtime_r exists
14617 set localtime_r d_localtime_r
14619 case "$d_localtime_r" in
14621 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
14622 case "$d_localtime_r_proto:$usethreads" in
14623 ":define") d_localtime_r_proto=define
14624 set d_localtime_r_proto localtime_r $hdrs
14628 case "$d_localtime_r_proto" in
14630 case "$localtime_r_proto" in
14631 ''|0) try='struct tm* localtime_r(const time_t*, struct tm*);'
14632 ./protochk "extern $try" $hdrs && localtime_r_proto=S_TS ;;
14634 case "$localtime_r_proto" in
14635 ''|0) try='int localtime_r(const time_t*, struct tm*);'
14636 ./protochk "extern $try" $hdrs && localtime_r_proto=I_TS ;;
14638 case "$localtime_r_proto" in
14639 ''|0) d_localtime_r=undef
14640 localtime_r_proto=0
14641 echo "Disabling localtime_r, cannot determine prototype." >&4 ;;
14642 * ) case "$localtime_r_proto" in
14643 REENTRANT_PROTO*) ;;
14644 *) localtime_r_proto="REENTRANT_PROTO_$localtime_r_proto" ;;
14646 echo "Prototype: $try" ;;
14649 *) case "$usethreads" in
14650 define) echo "localtime_r has no prototype, not using it." >&4 ;;
14652 d_localtime_r=undef
14653 localtime_r_proto=0
14657 *) localtime_r_proto=0
14661 : see if localtime_r calls tzset
14662 case "$localtime_r_proto" in
14665 /* Does our libc's localtime_r call tzset ?
14666 * return 0 if so, 1 otherwise.
14668 #include <sys/types.h>
14669 #include <unistd.h>
14671 #include <string.h>
14672 #include <malloc.h>
14675 time_t t = time(0L);
14676 char w_tz[]="TZ" "=GMT+5",
14677 e_tz[]="TZ" "=GMT-5",
14678 *tz_e = (char*)malloc(16),
14679 *tz_w = (char*)malloc(16);
14680 struct tm tm_e, tm_w;
14681 memset(&tm_e,'\0',sizeof(struct tm));
14682 memset(&tm_w,'\0',sizeof(struct tm));
14687 localtime_r(&t, &tm_e);
14690 localtime_r(&t, &tm_w);
14692 if( memcmp(&tm_e, &tm_w, sizeof(struct tm)) == 0 )
14698 if eval $compile; then
14699 if $run ./try; then
14700 d_localtime_r_needs_tzset=undef;
14702 d_localtime_r_needs_tzset=define;
14705 d_localtime_r_needs_tzset=undef;
14709 d_localtime_r_needs_tzset=undef;
14714 : see if localeconv exists
14715 set localeconv d_locconv
14718 : see if lockf exists
14722 : see if prototype for lseek is available
14724 set d_lseekproto lseek $i_systypes sys/types.h $i_unistd unistd.h
14727 : see if lstat exists
14731 : see if madvise exists
14732 set madvise d_madvise
14735 : see if malloc_size exists
14736 set malloc_size d_malloc_size
14739 : see if malloc_size_good exists
14740 set malloc_good_size d_malloc_good_size
14743 : see if mblen exists
14747 : see if mbstowcs exists
14748 set mbstowcs d_mbstowcs
14751 : see if mbtowc exists
14752 set mbtowc d_mbtowc
14755 : see if memchr exists
14756 set memchr d_memchr
14759 : see if memcmp exists
14760 set memcmp d_memcmp
14763 : see if memcpy exists
14764 set memcpy d_memcpy
14767 : see if memmove exists
14768 set memmove d_memmove
14771 : see if memset exists
14772 set memset d_memset
14775 : see if mkdir exists
14779 : see if mkdtemp exists
14780 set mkdtemp d_mkdtemp
14783 : see if mkfifo exists
14784 set mkfifo d_mkfifo
14787 : see if mkstemp exists
14788 set mkstemp d_mkstemp
14791 : see if mkstemps exists
14792 set mkstemps d_mkstemps
14795 : see if mktime exists
14796 set mktime d_mktime
14799 : see if this is a sys/mman.h system
14800 set sys/mman.h i_sysmman
14803 : see if mmap exists
14806 : see what shmat returns
14807 : default to something harmless
14809 case "$i_sysmman$d_mmap" in
14811 $cat >mmap.c <<'END'
14812 #include <sys/mman.h>
14815 if $cc $ccflags -c mmap.c >/dev/null 2>&1; then
14820 echo "and it returns ($mmaptype)." >&4
14826 : see if sqrtl exists
14830 : see if scalbnl exists
14831 set scalbnl d_scalbnl
14834 : see if modfl exists
14838 : see if prototype for modfl is available
14840 set d_modflproto modfl $i_math math.h
14843 d_modfl_pow32_bug="$undef"
14845 case "$d_longdbl$d_modfl" in
14848 Checking to see whether your modfl() is okay for large values...
14854 if $test "X$d_modflproto" != "X$define"; then
14855 $cat >>try.c <<EOCP
14856 /* Sigh. many current glibcs provide the function, but do not prototype it. */
14857 long double modfl (long double, long double *);
14860 $cat >>try.c <<EOCP
14862 long double nv = 4294967303.15;
14868 printf(" %"$sPRIfldbl" %"$sPRIfldbl" %"$sPRIfldbl"\n", nv, v, w);
14872 case "$osname:$gccversion" in
14873 aix:) saveccflags="$ccflags"
14874 ccflags="$ccflags -qlongdouble" ;; # to avoid core dump
14877 if eval $compile; then
14880 *" 4294967303.150000 1.150000 4294967302.000000")
14881 echo >&4 "Your modfl() is broken for large values."
14882 d_modfl_pow32_bug="$define"
14884 glibc) echo >&4 "You should upgrade your glibc to at least 2.2.2 to get a fixed modfl()."
14888 *" 4294967303.150000 0.150000 4294967303.000000")
14889 echo >&4 "Your modfl() seems okay for large values."
14891 *) echo >&4 "I don't understand your modfl() at all."
14897 echo "I cannot figure out whether your modfl() is okay, assuming it isn't."
14900 case "$osname:$gccversion" in
14901 aix:) ccflags="$saveccflags" ;; # restore
14906 if $test "$uselongdouble" = "$define"; then
14908 if $test "$d_sqrtl" != "$define"; then
14909 message="$message sqrtl"
14911 if $test "$d_modfl" != "$define"; then
14912 if $test "$d_aintl:$d_copysignl" = "$define:$define"; then
14913 echo "You have both aintl and copysignl, so I can emulate modfl."
14915 message="$message modfl"
14918 if $test "$d_frexpl" != "$define"; then
14919 if $test "$d_ilogbl:$d_scalbnl" = "$define:$define"; then
14920 echo "You have both ilogbl and scalbnl, so I can emulate frexpl."
14922 message="$message frexpl"
14926 if $test "$message" != ""; then
14929 *** You requested the use of long doubles but you do not seem to have
14930 *** the following mathematical functions needed for long double support:
14932 *** Please rerun Configure without -Duselongdouble and/or -Dusemorebits.
14933 *** Cannot continue, aborting.
14941 : see if mprotect exists
14942 set mprotect d_mprotect
14945 : see if msgctl exists
14946 set msgctl d_msgctl
14949 : see if msgget exists
14950 set msgget d_msgget
14953 : see if msgsnd exists
14954 set msgsnd d_msgsnd
14957 : see if msgrcv exists
14958 set msgrcv d_msgrcv
14961 : see how much of the 'msg*(2)' library is present.
14964 case "$d_msgctl$d_msgget$d_msgsnd$d_msgrcv" in
14965 *"$undef"*) h_msg=false;;
14969 case "`ipcs 2>&1`" in
14970 "SVID messages"*"not configured"*)
14971 echo "Your $osname does not have the msg*(2) configured." >&4
14974 set msgctl d_msgctl
14976 set msgget d_msgget
14978 set msgsnd d_msgsnd
14980 set msgrcv d_msgrcv
14986 : we could also check for sys/ipc.h ...
14987 if $h_msg && $test `./findhdr sys/msg.h`; then
14988 echo "You have the full msg*(2) library." >&4
14991 echo "You don't have the full msg*(2) library." >&4
14999 echo "Checking to see if your system supports struct msghdr..." >&4
15000 set d_msghdr_s msghdr $i_systypes sys/types.h $d_socket sys/socket.h $i_sysuio sys/uio.h
15002 case "$d_msghdr_s" in
15003 "$define") echo "Yes, it does." ;;
15004 *) echo "No, it doesn't." ;;
15008 : see if msync exists
15012 : see if munmap exists
15013 set munmap d_munmap
15016 : see if nice exists
15020 : see if this is a langinfo.h system
15021 set langinfo.h i_langinfo
15024 : see if nl_langinfo exists
15025 set nl_langinfo d_nl_langinfo
15028 : check for length of character
15030 case "$charsize" in
15032 echo "Checking to see how big your characters are (hey, you never know)..." >&4
15035 #$i_stdlib I_STDLIB
15037 #include <stdlib.h>
15041 printf("%d\n", (int)sizeof(char));
15046 if eval $compile_ok; then
15050 echo "(I can't seem to compile the test program. Guessing...)"
15057 rp="What is the size of a character (in bytes)?"
15062 : check for volatile keyword
15064 echo 'Checking to see if your C compiler knows about "volatile"...' >&4
15065 $cat >try.c <<'EOCP'
15068 typedef struct _goo_struct goo_struct;
15069 goo_struct * volatile goo = ((goo_struct *)0);
15070 struct _goo_struct {
15075 typedef unsigned short foo_t;
15076 char *volatile foo;
15078 volatile foo_t blech;
15082 if $cc -c $ccflags try.c >/dev/null 2>&1 ; then
15084 echo "Yup, it does."
15087 echo "Nope, it doesn't."
15095 $echo "Choosing the C types to be used for Perl's internal types..." >&4
15097 case "$use64bitint:$d_quad:$quadtype" in
15100 uvtype="$uquadtype"
15105 uvtype="unsigned long"
15111 case "$uselongdouble:$d_longdbl" in
15113 nvtype="long double"
15114 nvsize=$longdblsize
15121 $echo "(IV will be "$ivtype", $ivsize bytes)"
15122 $echo "(UV will be "$uvtype", $uvsize bytes)"
15123 $echo "(NV will be "$nvtype", $nvsize bytes)"
15126 #$i_inttypes I_INTTYPES
15128 #include <inttypes.h>
15133 int8_t i = INT8_MAX;
15134 uint8_t u = UINT8_MAX;
15135 printf("int8_t\n");
15138 int16_t i = INT16_MAX;
15139 uint16_t i = UINT16_MAX;
15140 printf("int16_t\n");
15143 int32_t i = INT32_MAX;
15144 uint32_t u = UINT32_MAX;
15145 printf("int32_t\n");
15151 '') case "$charsize" in
15153 u8type="unsigned char"
15162 if eval $compile; then
15163 case "`$run ./try`" in
15164 int8_t) i8type=int8_t
15174 '') if $test $charsize -ge 1; then
15176 u8type="unsigned char"
15184 '') case "$shortsize" in
15186 u16type="unsigned short"
15194 '') set try -DINT16
15195 if eval $compile; then
15196 case "`$run ./try`" in
15208 '') if $test $shortsize -ge 2; then
15210 u16type="unsigned short"
15218 '') case "$longsize" in
15220 u32type="unsigned long"
15224 *) case "$intsize" in
15226 u32type="unsigned int"
15236 '') set try -DINT32
15237 if eval $compile; then
15238 case "`$run ./try`" in
15250 '') if $test $intsize -ge 4; then
15252 u32type="unsigned int"
15260 '') case "$d_quad:$quadtype" in
15262 i64type="$quadtype"
15263 u64type="$uquadtype"
15271 $echo "Checking how many bits of your UVs your NVs can preserve..." >&4
15272 : volatile so that the compiler has to store it out to memory.
15273 if test X"$d_volatile" = X"$define"; then
15278 #$i_stdlib I_STDLIB
15280 #include <stdlib.h>
15282 #include <sys/types.h>
15283 #include <signal.h>
15285 $volatile int bletched = 0;
15286 $signal_t blech(int s) { bletched = 1; }
15291 int n = 8 * $uvsize;
15294 signal(SIGFPE, blech);
15297 for (i = 0; i < n; i++) {
15298 u = u << 1 | ($uvtype)1;
15300 if (($uvtype)d != u)
15304 d = ($nvtype)(u - 1);
15305 if (($uvtype)d != (u - 1))
15312 printf("%d\n", ((i == n) ? -n : i));
15318 d_nv_preserves_uv="$undef"
15319 if eval $compile; then
15320 nv_preserves_uv_bits="`$run ./try`"
15322 case "$nv_preserves_uv_bits" in
15324 nv_preserves_uv_bits=`expr 0 - $nv_preserves_uv_bits`
15325 $echo "Your NVs can preserve all $nv_preserves_uv_bits bits of your UVs." 2>&1
15326 d_nv_preserves_uv="$define"
15328 [1-9]*) $echo "Your NVs can preserve only $nv_preserves_uv_bits bits of your UVs." 2>&1
15329 d_nv_preserves_uv="$undef" ;;
15330 *) $echo "Can't figure out how many bits your NVs preserve." 2>&1
15331 nv_preserves_uv_bits="0" ;;
15335 $echo "Checking whether NV 0.0 is all bits zero in memory..." >&4
15336 : volatile so that the compiler has to store it out to memory.
15337 if test X"$d_volatile" = X"$define"; then
15342 #$i_stdlib I_STDLIB
15344 #include <stdlib.h>
15346 #$i_string I_STRING
15348 # include <string.h>
15350 # include <strings.h>
15352 #include <sys/types.h>
15353 #include <signal.h>
15355 $volatile int bletched = 0;
15356 $signal_t blech(int s) { bletched = 1; }
15359 int checkit($nvtype d, char *where) {
15360 unsigned char *p = (char *)&d;
15361 unsigned char *end = p + sizeof(d);
15371 printf("No - %s: 0x", where);
15373 printf ("%02X", *p++);
15378 int main(int argc, char **argv) {
15381 fail += checkit(d, "0.0");
15383 /* The compiler shouldn't be assuming that bletched is 0 */
15386 fail += checkit(d, "bleched");
15389 signal(SIGFPE, blech);
15392 /* Paranoia - the compiler should have no way of knowing that ANSI says
15393 that argv[argc] will always be NULL. Actually, if it did assume this it
15394 would be buggy, as this is C and main() can be called from elsewhere in
15396 d = argv[argc] ? 1 : 0;
15399 printf("Odd argv[argc]=%p, d=%g\n", argv[argc], d);
15402 fail += checkit(d, "ternary");
15404 memset(&d, sizeof(d), argv[argc] ? 1 : 0);
15407 printf("No - memset doesn't give 0.0\n");
15408 /* This might just blow up: */
15409 printf("(gives %g)\n", d);
15415 printf("No - something bleched\n");
15420 printf("No - %d fail(s)\n", fail);
15429 d_nv_zero_is_allbits_zero="$undef"
15430 if eval $compile; then
15436 0.0 is represented as all bits zero in memory
15438 d_nv_zero_is_allbits_zero="$define"
15441 0.0 is not represented as all bits zero in memory
15443 d_nv_zero_is_allbits_zero="$undef"
15448 0.0 is not represented as all bits zero in memory
15450 d_nv_zero_is_allbits_zero="$undef"
15456 : check for off64_t
15458 echo "Checking to see if you have off64_t..." >&4
15460 #include <sys/types.h>
15461 #include <unistd.h>
15462 int main() { off64_t x = 7; }
15465 if eval $compile; then
15467 echo "You have off64_t."
15470 echo "You do not have off64_t."
15471 case "$lseeksize" in
15472 8) echo "(Your off_t is 64 bits, so you could use that.)" ;;
15479 : how to create joinable pthreads
15480 if test "X$usethreads" = "X$define" -a "X$i_pthread" = "X$define"; then
15482 echo "Checking what constant to use for creating joinable pthreads..." >&4
15483 $cat >try.c <<'EOCP'
15484 #include <pthread.h>
15486 int detachstate = JOINABLE;
15489 set try -DJOINABLE=PTHREAD_CREATE_JOINABLE
15490 if eval $compile; then
15491 echo "You seem to use PTHREAD_CREATE_JOINABLE." >&4
15492 val="$undef" # Yes, undef.
15493 set d_old_pthread_create_joinable
15496 set old_pthread_create_joinable
15499 set try -DJOINABLE=PTHREAD_CREATE_UNDETACHED
15500 if eval $compile; then
15501 echo "You seem to use PTHREAD_CREATE_UNDETACHED." >&4
15503 set d_old_pthread_create_joinable
15505 val=PTHREAD_CREATE_UNDETACHED
15506 set old_pthread_create_joinable
15509 set try -DJOINABLE=__UNDETACHED
15510 if eval $compile; then
15511 echo "You seem to use __UNDETACHED." >&4
15513 set d_old_pthread_create_joinable
15516 set old_pthread_create_joinable
15519 echo "Egads, nothing obvious found. Guessing that you use 0." >&4
15521 set d_old_pthread_create_joinable
15524 set old_pthread_create_joinable
15531 d_old_pthread_create_joinable="$undef"
15532 old_pthread_create_joinable=""
15535 : see if pause exists
15539 : see if pipe exists
15543 : see if poll exists
15547 : see if readlink exists
15548 set readlink d_readlink
15554 case "$d_readlink" in
15556 if $issymlink /proc/self/exe ; then
15557 $ls -l /proc/self/exe > reflect
15558 if $contains /`basename $ls` reflect >/dev/null 2>&1; then
15559 echo "You have Linux-like /proc/self/exe."
15560 procselfexe='"/proc/self/exe"'
15564 if $issymlink /proc/curproc/file ; then
15565 $ls -l /proc/curproc/file > reflect
15566 if $contains /`basename $ls` reflect >/dev/null 2>&1; then
15567 echo "You have BSD-like /proc/curproc/file."
15568 procselfexe='"/proc/curproc/file"'
15578 : backward compatibility for d_hvfork
15579 if test X$d_hvfork != X; then
15580 d_vfork="$d_hvfork"
15583 : see if there is a vfork
15588 d_pseudofork=$undef
15590 : Ok, but do we want to use it. vfork is reportedly unreliable in
15591 : perl on Solaris 2.x, and probably elsewhere.
15595 case "$usevfork" in
15601 Perl can only use a vfork() that doesn't suffer from strict
15602 restrictions on calling functions or modifying global data in
15603 the child. For example, glibc-2.1 contains such a vfork()
15604 that is unsuitable. If your system provides a proper fork()
15605 call, chances are that you do NOT want perl to use vfork().
15608 rp="Do you still want to use vfork()?"
15613 echo "Ok, we won't use vfork()."
15622 $define) usevfork='true';;
15623 *) usevfork='false';;
15626 : see whether the pthread_atfork exists
15628 #include <pthread.h>
15631 #ifdef PTHREAD_ATFORK
15632 pthread_atfork(NULL,NULL,NULL);
15637 : see if pthread_atfork exists
15638 set try -DPTHREAD_ATFORK
15639 if eval $compile; then
15644 case "$usethreads" in
15647 $define) echo 'pthread_atfork found.' >&4 ;;
15648 *) echo 'pthread_atfork NOT found.' >&4 ;;
15651 set d_pthread_atfork
15654 : see if pthread_attr_setscope exists
15655 set pthread_attr_setscope d_pthread_attr_setscope
15659 : see whether the various POSIXish _yields exist
15661 #include <pthread.h>
15667 #ifdef PTHREAD_YIELD
15670 #ifdef PTHREAD_YIELD_NULL
15671 pthread_yield(NULL);
15677 : see if sched_yield exists
15678 set try -DSCHED_YIELD
15679 if eval $compile; then
15681 sched_yield='sched_yield()'
15685 case "$usethreads" in
15688 $define) echo 'sched_yield() found.' >&4 ;;
15689 *) echo 'sched_yield() NOT found.' >&4 ;;
15695 : see if pthread_yield exists
15696 set try -DPTHREAD_YIELD
15697 if eval $compile; then
15699 case "$sched_yield" in
15700 '') sched_yield='pthread_yield()' ;;
15703 set try -DPTHREAD_YIELD_NULL
15704 if eval $compile; then
15706 case "$sched_yield" in
15707 '') sched_yield='pthread_yield(NULL)' ;;
15713 case "$usethreads" in
15716 $define) echo 'pthread_yield() found.' >&4 ;;
15717 *) echo 'pthread_yield() NOT found.' >&4 ;;
15721 set d_pthread_yield
15723 case "$sched_yield" in
15724 '') sched_yield=undef ;;
15728 : see if random_r exists
15729 set random_r d_random_r
15731 case "$d_random_r" in
15733 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
15734 case "$d_random_r_proto:$usethreads" in
15735 ":define") d_random_r_proto=define
15736 set d_random_r_proto random_r $hdrs
15740 case "$d_random_r_proto" in
15742 case "$random_r_proto" in
15743 ''|0) try='int random_r(int*, struct random_data*);'
15744 ./protochk "extern $try" $hdrs && random_r_proto=I_iS ;;
15746 case "$random_r_proto" in
15747 ''|0) try='int random_r(long*, struct random_data*);'
15748 ./protochk "extern $try" $hdrs && random_r_proto=I_lS ;;
15750 case "$random_r_proto" in
15751 ''|0) try='int random_r(struct random_data*, int32_t*);'
15752 ./protochk "extern $try" $hdrs && random_r_proto=I_St ;;
15754 case "$random_r_proto" in
15755 ''|0) d_random_r=undef
15757 echo "Disabling random_r, cannot determine prototype." >&4 ;;
15758 * ) case "$random_r_proto" in
15759 REENTRANT_PROTO*) ;;
15760 *) random_r_proto="REENTRANT_PROTO_$random_r_proto" ;;
15762 echo "Prototype: $try" ;;
15765 *) case "$usethreads" in
15766 define) echo "random_r has no prototype, not using it." >&4 ;;
15773 *) random_r_proto=0
15777 : see if readdir and friends exist
15778 set readdir d_readdir
15780 set seekdir d_seekdir
15782 set telldir d_telldir
15784 set rewinddir d_rewinddir
15787 : see if readdir64_r exists
15788 set readdir64_r d_readdir64_r
15790 case "$d_readdir64_r" in
15792 hdrs="$i_systypes sys/types.h define stdio.h $i_dirent dirent.h"
15793 case "$d_readdir64_r_proto:$usethreads" in
15794 ":define") d_readdir64_r_proto=define
15795 set d_readdir64_r_proto readdir64_r $hdrs
15799 case "$d_readdir64_r_proto" in
15801 case "$readdir64_r_proto" in
15802 ''|0) try='int readdir64_r(DIR*, struct dirent64*, struct dirent64**);'
15803 ./protochk "extern $try" $hdrs && readdir64_r_proto=I_TSR ;;
15805 case "$readdir64_r_proto" in
15806 ''|0) try='int readdir64_r(DIR*, struct dirent64*);'
15807 ./protochk "extern $try" $hdrs && readdir64_r_proto=I_TS ;;
15809 case "$readdir64_r_proto" in
15810 ''|0) d_readdir64_r=undef
15811 readdir64_r_proto=0
15812 echo "Disabling readdir64_r, cannot determine prototype." >&4 ;;
15813 * ) case "$readdir64_r_proto" in
15814 REENTRANT_PROTO*) ;;
15815 *) readdir64_r_proto="REENTRANT_PROTO_$readdir64_r_proto" ;;
15817 echo "Prototype: $try" ;;
15820 *) case "$usethreads" in
15821 define) echo "readdir64_r has no prototype, not using it." >&4 ;;
15823 d_readdir64_r=undef
15824 readdir64_r_proto=0
15828 *) readdir64_r_proto=0
15832 : see if readdir_r exists
15833 set readdir_r d_readdir_r
15835 case "$d_readdir_r" in
15837 hdrs="$i_systypes sys/types.h define stdio.h $i_dirent dirent.h"
15838 case "$d_readdir_r_proto:$usethreads" in
15839 ":define") d_readdir_r_proto=define
15840 set d_readdir_r_proto readdir_r $hdrs
15844 case "$d_readdir_r_proto" in
15846 case "$readdir_r_proto" in
15847 ''|0) try='int readdir_r(DIR*, struct dirent*, struct dirent**);'
15848 ./protochk "extern $try" $hdrs && readdir_r_proto=I_TSR ;;
15850 case "$readdir_r_proto" in
15851 ''|0) try='int readdir_r(DIR*, struct dirent*);'
15852 ./protochk "extern $try" $hdrs && readdir_r_proto=I_TS ;;
15854 case "$readdir_r_proto" in
15855 ''|0) d_readdir_r=undef
15857 echo "Disabling readdir_r, cannot determine prototype." >&4 ;;
15858 * ) case "$readdir_r_proto" in
15859 REENTRANT_PROTO*) ;;
15860 *) readdir_r_proto="REENTRANT_PROTO_$readdir_r_proto" ;;
15862 echo "Prototype: $try" ;;
15865 *) case "$usethreads" in
15866 define) echo "readdir_r has no prototype, not using it." >&4 ;;
15873 *) readdir_r_proto=0
15877 : see if readv exists
15881 : see if recvmsg exists
15882 set recvmsg d_recvmsg
15885 : see if rename exists
15886 set rename d_rename
15889 : see if rmdir exists
15893 : see if memory.h is available.
15898 : See if it conflicts with string.h
15904 $cppstdin $cppflags $cppminus < $strings > mem.h
15905 if $contains 'memcpy' mem.h >/dev/null 2>&1; then
15907 echo "We won't be including <memory.h>."
15917 : can bcopy handle overlapping blocks?
15920 case "$d_memmove" in
15921 "$define") echo "I'll use memmove() instead of bcopy() for overlapping copies." ;;
15922 *) case "$d_bcopy" in
15924 echo "Checking to see if bcopy() can do overlapping copies..." >&4
15926 #$i_memory I_MEMORY
15927 #$i_stdlib I_STDLIB
15928 #$i_string I_STRING
15929 #$i_unistd I_UNISTD
15931 $cat >>try.c <<'EOCP'
15934 # include <memory.h>
15937 # include <stdlib.h>
15940 # include <string.h>
15942 # include <strings.h>
15945 # include <unistd.h> /* Needed for NetBSD */
15949 char buf[128], abc[128];
15955 /* Copy "abcde..." string to char abc[] so that gcc doesn't
15956 try to store the string in read-only memory. */
15957 bcopy("abcdefghijklmnopqrstuvwxyz0123456789", abc, 36);
15959 for (align = 7; align >= 0; align--) {
15960 for (len = 36; len; len--) {
15962 bcopy(abc, b, len);
15963 for (off = 1; off <= len; off++) {
15964 bcopy(b, b+off, len);
15965 bcopy(b+off, b, len);
15966 if (bcmp(b, abc, len))
15975 if eval $compile_ok; then
15976 if $run ./try 2>/dev/null; then
15977 echo "Yes, it can."
15980 echo "It can't, sorry."
15983 echo "(I can't compile the test program, so we'll assume not...)"
15993 : can memcpy handle overlapping blocks?
15996 case "$d_memmove" in
15997 "$define") echo "I'll use memmove() instead of memcpy() for overlapping copies." ;;
15998 *) case "$d_memcpy" in
16000 echo "Checking to see if memcpy() can do overlapping copies..." >&4
16002 #$i_memory I_MEMORY
16003 #$i_stdlib I_STDLIB
16004 #$i_string I_STRING
16005 #$i_unistd I_UNISTD
16007 $cat >>try.c <<'EOCP'
16010 # include <memory.h>
16013 # include <stdlib.h>
16016 # include <string.h>
16018 # include <strings.h>
16021 # include <unistd.h> /* Needed for NetBSD */
16025 char buf[128], abc[128];
16031 /* Copy "abcde..." string to char abc[] so that gcc doesn't
16032 try to store the string in read-only memory. */
16033 memcpy(abc, "abcdefghijklmnopqrstuvwxyz0123456789", 36);
16035 for (align = 7; align >= 0; align--) {
16036 for (len = 36; len; len--) {
16038 memcpy(b, abc, len);
16039 for (off = 1; off <= len; off++) {
16040 memcpy(b+off, b, len);
16041 memcpy(b, b+off, len);
16042 if (memcmp(b, abc, len))
16051 if eval $compile_ok; then
16052 if $run ./try 2>/dev/null; then
16053 echo "Yes, it can."
16056 echo "It can't, sorry."
16059 echo "(I can't compile the test program, so we'll assume not...)"
16069 : can memcmp be trusted to compare relative magnitude?
16071 case "$d_memcmp" in
16074 echo "Checking if your memcmp() can compare relative magnitude..." >&4
16076 #$i_memory I_MEMORY
16077 #$i_stdlib I_STDLIB
16078 #$i_string I_STRING
16079 #$i_unistd I_UNISTD
16081 $cat >>try.c <<'EOCP'
16084 # include <memory.h>
16087 # include <stdlib.h>
16090 # include <string.h>
16092 # include <strings.h>
16095 # include <unistd.h> /* Needed for NetBSD */
16101 if ((a < b) && memcmp(&a, &b, 1) < 0)
16107 if eval $compile_ok; then
16108 if $run ./try 2>/dev/null; then
16109 echo "Yes, it can."
16112 echo "No, it can't (it uses signed chars)."
16115 echo "(I can't compile the test program, so we'll assume not...)"
16123 : see if prototype for sbrk is available
16125 set d_sbrkproto sbrk $i_unistd unistd.h
16128 : see if select exists
16129 set select d_select
16132 : see if semctl exists
16133 set semctl d_semctl
16136 : see if semget exists
16137 set semget d_semget
16140 : see if semop exists
16144 : see how much of the 'sem*(2)' library is present.
16147 case "$d_semctl$d_semget$d_semop" in
16148 *"$undef"*) h_sem=false;;
16152 case "`ipcs 2>&1`" in
16153 "SVID messages"*"not configured"*)
16154 echo "Your $osname does not have the sem*(2) configured." >&4
16157 set semctl d_semctl
16159 set semget d_semget
16167 : we could also check for sys/ipc.h ...
16168 if $h_sem && $test `./findhdr sys/sem.h`; then
16169 echo "You have the full sem*(2) library." >&4
16172 echo "You don't have the full sem*(2) library." >&4
16178 : see whether sys/sem.h defines union semun
16180 $cat > try.c <<'END'
16181 #include <sys/types.h>
16182 #include <sys/ipc.h>
16183 #include <sys/sem.h>
16184 int main () { union semun semun; semun.buf = 0; }
16187 if eval $compile; then
16188 echo "You have union semun in <sys/sem.h>." >&4
16191 echo "You do not have union semun in <sys/sem.h>." >&4
16198 : see how to do semctl IPC_STAT
16205 # define S_IRUSR S_IREAD
16206 # define S_IWUSR S_IWRITE
16207 # define S_IXUSR S_IEXEC
16209 # define S_IRUSR 0400
16210 # define S_IWUSR 0200
16211 # define S_IXUSR 0100
16213 # define S_IRGRP (S_IRUSR>>3)
16214 # define S_IWGRP (S_IWUSR>>3)
16215 # define S_IXGRP (S_IXUSR>>3)
16216 # define S_IROTH (S_IRUSR>>6)
16217 # define S_IWOTH (S_IWUSR>>6)
16218 # define S_IXOTH (S_IXUSR>>6)
16221 # define S_IRWXU (S_IRUSR|S_IWUSR|S_IXUSR)
16222 # define S_IRWXG (S_IRGRP|S_IWGRP|S_IXGRP)
16223 # define S_IRWXO (S_IROTH|S_IWOTH|S_IXOTH)
16226 : see whether semctl IPC_STAT can use union semun
16227 case "$d_semctl_semun" in
16231 #include <sys/types.h>
16232 #include <sys/ipc.h>
16233 #include <sys/sem.h>
16234 #include <sys/stat.h>
16241 #$d_union_semun HAS_UNION_SEMUN
16244 #ifndef HAS_UNION_SEMUN
16247 struct semid_ds *buf;
16248 unsigned short *array;
16254 #if defined(IPC_PRIVATE) && defined(S_IRWXU) && defined(S_IRWXG) && defined(S_IRWXO) && defined(IPC_CREAT)
16255 sem = semget(IPC_PRIVATE, 1, S_IRWXU|S_IRWXG|S_IRWXO|IPC_CREAT);
16257 struct semid_ds argbuf;
16260 st = semctl(sem, 0, IPC_STAT, arg);
16264 # endif /* IPC_STAT */
16265 printf("semctl IPC_STAT failed: errno = %d\n", errno);
16267 if (semctl(sem, 0, IPC_RMID, arg) != 0)
16268 # endif /* IPC_RMID */
16269 printf("semctl IPC_RMID failed: errno = %d\n", errno);
16271 #endif /* IPC_PRIVATE && ... */
16272 printf("semget failed: errno = %d\n", errno);
16277 if eval $compile; then
16280 semun) val="$define" ;;
16288 case "$d_semctl_semun" in
16290 echo "You can use union semun for semctl IPC_STAT." >&4
16293 *) echo "You cannot use union semun for semctl IPC_STAT." >&4
16298 : see whether semctl IPC_STAT can use struct semid_ds pointer
16299 case "$d_semctl_semid_ds" in
16302 $cat > try.c <<'END'
16303 #include <sys/types.h>
16304 #include <sys/ipc.h>
16305 #include <sys/sem.h>
16306 #include <sys/stat.h>
16314 struct semid_ds arg;
16317 #if defined(IPC_PRIVATE) && defined(S_IRWXU) && defined(S_IRWXG) && defined(S_IRWXO) && defined(IPC_CREAT)
16318 sem = semget(IPC_PRIVATE, 1, S_IRWXU|S_IRWXG|S_IRWXO|IPC_CREAT);
16321 st = semctl(sem, 0, IPC_STAT, &arg);
16323 printf("semid_ds\n");
16325 # endif /* IPC_STAT */
16326 printf("semctl IPC_STAT failed: errno = %d\n", errno);
16328 if (semctl(sem, 0, IPC_RMID, &arg) != 0)
16329 # endif /* IPC_RMID */
16330 printf("semctl IPC_RMID failed: errno = %d\n", errno);
16332 #endif /* IPC_PRIVATE && ... */
16333 printf("semget failed: errno = %d\n", errno);
16339 if eval $compile; then
16342 semid_ds) val="$define" ;;
16346 set d_semctl_semid_ds
16350 case "$d_semctl_semid_ds" in
16352 echo "You can $also use struct semid_ds* for semctl IPC_STAT." >&4
16354 *) echo "You cannot use struct semid_ds* for semctl IPC_STAT." >&4
16361 # We do not have the full sem*(2) library, so assume we can not
16367 set d_semctl_semid_ds
16372 : see if sendmsg exists
16373 set sendmsg d_sendmsg
16376 : see if setegid exists
16377 set setegid d_setegid
16380 : see if seteuid exists
16381 set seteuid d_seteuid
16384 : see if setgrent exists
16385 set setgrent d_setgrent
16388 : see if setgrent_r exists
16389 set setgrent_r d_setgrent_r
16391 case "$d_setgrent_r" in
16393 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
16394 case "$d_setgrent_r_proto:$usethreads" in
16395 ":define") d_setgrent_r_proto=define
16396 set d_setgrent_r_proto setgrent_r $hdrs
16400 case "$d_setgrent_r_proto" in
16402 case "$setgrent_r_proto" in
16403 ''|0) try='int setgrent_r(FILE**);'
16404 ./protochk "extern $try" $hdrs && setgrent_r_proto=I_H ;;
16406 case "$setgrent_r_proto" in
16407 ''|0) try='void setgrent_r(FILE**);'
16408 ./protochk "extern $try" $hdrs && setgrent_r_proto=V_H ;;
16410 case "$setgrent_r_proto" in
16411 ''|0) d_setgrent_r=undef
16413 echo "Disabling setgrent_r, cannot determine prototype." >&4 ;;
16414 * ) case "$setgrent_r_proto" in
16415 REENTRANT_PROTO*) ;;
16416 *) setgrent_r_proto="REENTRANT_PROTO_$setgrent_r_proto" ;;
16418 echo "Prototype: $try" ;;
16421 *) case "$usethreads" in
16422 define) echo "setgrent_r has no prototype, not using it." >&4 ;;
16429 *) setgrent_r_proto=0
16433 : see if sethostent exists
16434 set sethostent d_sethent
16437 : see if sethostent_r exists
16438 set sethostent_r d_sethostent_r
16440 case "$d_sethostent_r" in
16442 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
16443 case "$d_sethostent_r_proto:$usethreads" in
16444 ":define") d_sethostent_r_proto=define
16445 set d_sethostent_r_proto sethostent_r $hdrs
16449 case "$d_sethostent_r_proto" in
16451 case "$sethostent_r_proto" in
16452 ''|0) try='int sethostent_r(int, struct hostent_data*);'
16453 ./protochk "extern $try" $hdrs && sethostent_r_proto=I_ID ;;
16455 case "$sethostent_r_proto" in
16456 ''|0) try='void sethostent_r(int, struct hostent_data*);'
16457 ./protochk "extern $try" $hdrs && sethostent_r_proto=V_ID ;;
16459 case "$sethostent_r_proto" in
16460 ''|0) d_sethostent_r=undef
16461 sethostent_r_proto=0
16462 echo "Disabling sethostent_r, cannot determine prototype." >&4 ;;
16463 * ) case "$sethostent_r_proto" in
16464 REENTRANT_PROTO*) ;;
16465 *) sethostent_r_proto="REENTRANT_PROTO_$sethostent_r_proto" ;;
16467 echo "Prototype: $try" ;;
16470 *) case "$usethreads" in
16471 define) echo "sethostent_r has no prototype, not using it." >&4 ;;
16473 d_sethostent_r=undef
16474 sethostent_r_proto=0
16478 *) sethostent_r_proto=0
16482 : see if setitimer exists
16483 set setitimer d_setitimer
16486 : see if setlinebuf exists
16487 set setlinebuf d_setlinebuf
16490 : see if setlocale exists
16491 set setlocale d_setlocale
16494 : see if locale.h is available
16495 set locale.h i_locale
16498 : see if setlocale_r exists
16499 set setlocale_r d_setlocale_r
16501 case "$d_setlocale_r" in
16503 hdrs="$i_systypes sys/types.h define stdio.h $i_locale locale.h"
16504 case "$d_setlocale_r_proto:$usethreads" in
16505 ":define") d_setlocale_r_proto=define
16506 set d_setlocale_r_proto setlocale_r $hdrs
16510 case "$d_setlocale_r_proto" in
16512 case "$setlocale_r_proto" in
16513 ''|0) try='int setlocale_r(int, const char*, char*, int);'
16514 ./protochk "extern $try" $hdrs && setlocale_r_proto=I_ICBI ;;
16516 case "$setlocale_r_proto" in
16517 ''|0) d_setlocale_r=undef
16518 setlocale_r_proto=0
16519 echo "Disabling setlocale_r, cannot determine prototype." >&4 ;;
16520 * ) case "$setlocale_r_proto" in
16521 REENTRANT_PROTO*) ;;
16522 *) setlocale_r_proto="REENTRANT_PROTO_$setlocale_r_proto" ;;
16524 echo "Prototype: $try" ;;
16527 *) case "$usethreads" in
16528 define) echo "setlocale_r has no prototype, not using it." >&4 ;;
16530 d_setlocale_r=undef
16531 setlocale_r_proto=0
16535 *) setlocale_r_proto=0
16539 : see if setnetent exists
16540 set setnetent d_setnent
16543 : see if setnetent_r exists
16544 set setnetent_r d_setnetent_r
16546 case "$d_setnetent_r" in
16548 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
16549 case "$d_setnetent_r_proto:$usethreads" in
16550 ":define") d_setnetent_r_proto=define
16551 set d_setnetent_r_proto setnetent_r $hdrs
16555 case "$d_setnetent_r_proto" in
16557 case "$setnetent_r_proto" in
16558 ''|0) try='int setnetent_r(int, struct netent_data*);'
16559 ./protochk "extern $try" $hdrs && setnetent_r_proto=I_ID ;;
16561 case "$setnetent_r_proto" in
16562 ''|0) try='void setnetent_r(int, struct netent_data*);'
16563 ./protochk "extern $try" $hdrs && setnetent_r_proto=V_ID ;;
16565 case "$setnetent_r_proto" in
16566 ''|0) d_setnetent_r=undef
16567 setnetent_r_proto=0
16568 echo "Disabling setnetent_r, cannot determine prototype." >&4 ;;
16569 * ) case "$setnetent_r_proto" in
16570 REENTRANT_PROTO*) ;;
16571 *) setnetent_r_proto="REENTRANT_PROTO_$setnetent_r_proto" ;;
16573 echo "Prototype: $try" ;;
16576 *) case "$usethreads" in
16577 define) echo "setnetent_r has no prototype, not using it." >&4 ;;
16579 d_setnetent_r=undef
16580 setnetent_r_proto=0
16584 *) setnetent_r_proto=0
16588 : see if setprotoent exists
16589 set setprotoent d_setpent
16592 : see if setpgid exists
16593 set setpgid d_setpgid
16596 : see if setpgrp2 exists
16597 set setpgrp2 d_setpgrp2
16600 : see if setpriority exists
16601 set setpriority d_setprior
16604 : see if setproctitle exists
16605 set setproctitle d_setproctitle
16608 : see if setprotoent_r exists
16609 set setprotoent_r d_setprotoent_r
16611 case "$d_setprotoent_r" in
16613 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
16614 case "$d_setprotoent_r_proto:$usethreads" in
16615 ":define") d_setprotoent_r_proto=define
16616 set d_setprotoent_r_proto setprotoent_r $hdrs
16620 case "$d_setprotoent_r_proto" in
16622 case "$setprotoent_r_proto" in
16623 ''|0) try='int setprotoent_r(int, struct protoent_data*);'
16624 ./protochk "extern $try" $hdrs && setprotoent_r_proto=I_ID ;;
16626 case "$setprotoent_r_proto" in
16627 ''|0) try='void setprotoent_r(int, struct protoent_data*);'
16628 ./protochk "extern $try" $hdrs && setprotoent_r_proto=V_ID ;;
16630 case "$setprotoent_r_proto" in
16631 ''|0) d_setprotoent_r=undef
16632 setprotoent_r_proto=0
16633 echo "Disabling setprotoent_r, cannot determine prototype." >&4 ;;
16634 * ) case "$setprotoent_r_proto" in
16635 REENTRANT_PROTO*) ;;
16636 *) setprotoent_r_proto="REENTRANT_PROTO_$setprotoent_r_proto" ;;
16638 echo "Prototype: $try" ;;
16641 *) case "$usethreads" in
16642 define) echo "setprotoent_r has no prototype, not using it." >&4 ;;
16644 d_setprotoent_r=undef
16645 setprotoent_r_proto=0
16649 *) setprotoent_r_proto=0
16653 : see if setpwent exists
16654 set setpwent d_setpwent
16657 : see if setpwent_r exists
16658 set setpwent_r d_setpwent_r
16660 case "$d_setpwent_r" in
16662 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
16663 case "$d_setpwent_r_proto:$usethreads" in
16664 ":define") d_setpwent_r_proto=define
16665 set d_setpwent_r_proto setpwent_r $hdrs
16669 case "$d_setpwent_r_proto" in
16671 case "$setpwent_r_proto" in
16672 ''|0) try='int setpwent_r(FILE**);'
16673 ./protochk "extern $try" $hdrs && setpwent_r_proto=I_H ;;
16675 case "$setpwent_r_proto" in
16676 ''|0) try='void setpwent_r(FILE**);'
16677 ./protochk "extern $try" $hdrs && setpwent_r_proto=V_H ;;
16679 case "$setpwent_r_proto" in
16680 ''|0) d_setpwent_r=undef
16682 echo "Disabling setpwent_r, cannot determine prototype." >&4 ;;
16683 * ) case "$setpwent_r_proto" in
16684 REENTRANT_PROTO*) ;;
16685 *) setpwent_r_proto="REENTRANT_PROTO_$setpwent_r_proto" ;;
16687 echo "Prototype: $try" ;;
16690 *) case "$usethreads" in
16691 define) echo "setpwent_r has no prototype, not using it." >&4 ;;
16698 *) setpwent_r_proto=0
16702 : see if setregid exists
16703 set setregid d_setregid
16705 set setresgid d_setresgid
16708 : see if setreuid exists
16709 set setreuid d_setreuid
16711 set setresuid d_setresuid
16714 : see if setrgid exists
16715 set setrgid d_setrgid
16718 : see if setruid exists
16719 set setruid d_setruid
16722 : see if setservent exists
16723 set setservent d_setsent
16726 : see if setservent_r exists
16727 set setservent_r d_setservent_r
16729 case "$d_setservent_r" in
16731 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
16732 case "$d_setservent_r_proto:$usethreads" in
16733 ":define") d_setservent_r_proto=define
16734 set d_setservent_r_proto setservent_r $hdrs
16738 case "$d_setservent_r_proto" in
16740 case "$setservent_r_proto" in
16741 ''|0) try='int setservent_r(int, struct servent_data*);'
16742 ./protochk "extern $try" $hdrs && setservent_r_proto=I_ID ;;
16744 case "$setservent_r_proto" in
16745 ''|0) try='void setservent_r(int, struct servent_data*);'
16746 ./protochk "extern $try" $hdrs && setservent_r_proto=V_ID ;;
16748 case "$setservent_r_proto" in
16749 ''|0) d_setservent_r=undef
16750 setservent_r_proto=0
16751 echo "Disabling setservent_r, cannot determine prototype." >&4 ;;
16752 * ) case "$setservent_r_proto" in
16753 REENTRANT_PROTO*) ;;
16754 *) setservent_r_proto="REENTRANT_PROTO_$setservent_r_proto" ;;
16756 echo "Prototype: $try" ;;
16759 *) case "$usethreads" in
16760 define) echo "setservent_r has no prototype, not using it." >&4 ;;
16762 d_setservent_r=undef
16763 setservent_r_proto=0
16767 *) setservent_r_proto=0
16771 : see if setsid exists
16772 set setsid d_setsid
16775 : see if setvbuf exists
16776 set setvbuf d_setvbuf
16779 : see if sfio.h is available
16784 : see if sfio library is available
16795 : Ok, but do we want to use it.
16799 true|$define|[yY]*) dflt='y';;
16802 echo "$package can use the sfio library, but it is experimental."
16803 case "$useperlio" in
16805 echo "For sfio also the PerlIO abstraction layer is needed."
16806 echo "Earlier you said you wouldn't want that."
16809 rp="You seem to have sfio available, do you want to try using it?"
16812 y|Y) echo "Ok, turning on both sfio and PerlIO, then."
16813 useperlio="$define"
16816 *) echo "Ok, avoiding sfio this time. I'll use stdio instead."
16821 *) case "$usesfio" in
16822 true|$define|[yY]*)
16823 echo "Sorry, cannot find sfio on this machine." >&4
16824 echo "Ignoring your setting of usesfio=$usesfio." >&4
16833 $define) usesfio='true';;
16834 *) usesfio='false';;
16838 *) : Remove sfio from list of libraries to use
16841 echo "Removing unneeded -lsfio from library list" >&4
16842 set `echo X $libs | $sed -e 's/-lsfio / /' -e 's/-lsfio$//'`
16845 echo "libs = $libs" >&4
16852 : see if shmctl exists
16853 set shmctl d_shmctl
16856 : see if shmget exists
16857 set shmget d_shmget
16860 : see if shmat exists
16863 : see what shmat returns
16866 $cat >shmat.c <<'END'
16867 #include <sys/shm.h>
16870 if $cc $ccflags -c shmat.c >/dev/null 2>&1; then
16875 echo "and it returns ($shmattype)." >&4
16876 : see if a prototype for shmat is available
16877 xxx=`./findhdr sys/shm.h`
16878 $cppstdin $cppflags $cppminus < $xxx > shmat.c 2>/dev/null
16879 if $contains 'shmat.*(' shmat.c >/dev/null 2>&1; then
16890 set d_shmatprototype
16893 : see if shmdt exists
16897 : see how much of the 'shm*(2)' library is present.
16900 case "$d_shmctl$d_shmget$d_shmat$d_shmdt" in
16901 *"$undef"*) h_shm=false;;
16905 case "`ipcs 2>&1`" in
16906 "SVID shared memory"*"not configured"*)
16907 echo "Your $osname does not have the shm*(2) configured." >&4
16910 set shmctl d_shmctl
16912 set shmget d_shmget
16922 : we could also check for sys/ipc.h ...
16923 if $h_shm && $test `./findhdr sys/shm.h`; then
16924 echo "You have the full shm*(2) library." >&4
16927 echo "You don't have the full shm*(2) library." >&4
16934 : see if we have sigaction
16935 if set sigaction val -f d_sigaction; eval $csym; $val; then
16936 echo 'sigaction() found.' >&4
16939 #include <sys/types.h>
16940 #include <signal.h>
16941 #$i_stdlib I_STDLIB
16943 #include <stdlib.h>
16947 struct sigaction act, oact;
16949 oact.sa_handler = 0;
16950 /* so that act and oact are used */
16951 exit(act.sa_flags == 0 && oact.sa_handler == 0);
16955 if eval $compile_ok; then
16958 echo "But you don't seem to have a useable struct sigaction." >&4
16962 echo 'sigaction NOT found.' >&4
16965 set d_sigaction; eval $setvar
16968 : see if this is a sunmath.h system
16969 set sunmath.h i_sunmath
16972 : see if signbit exists
16973 $echo $n "Checking to see if you have signbit() available to work on $nvtype... $c" >&4
16976 #$i_sunmath I_SUNMATH
16980 #ifdef I_SUNMATH /* Solaris special math library */
16981 # include <sunmath.h>
16984 int main(int argc, char **argv)
16988 if ((signbit(x) == 0) && (signbit(y) != 0))
16996 if eval $compile; then
16997 if $run ./try; then
17001 $echo "Signbit seems to be available, but doesn't work as I expected."
17002 $echo "I won't use it." >&4
17013 : see if sigprocmask exists
17014 set sigprocmask d_sigprocmask
17017 : see if sigsetjmp exists
17019 case "$d_sigsetjmp" in
17022 #include <setjmp.h>
17023 #$i_stdlib I_STDLIB
17025 #include <stdlib.h>
17031 if (sigsetjmp(env,1))
17034 siglongjmp(env, 1);
17039 if eval $compile; then
17040 if $run ./try >/dev/null 2>&1; then
17041 echo "POSIX sigsetjmp found." >&4
17045 Uh-Oh! You have POSIX sigsetjmp and siglongjmp, but they do not work properly!!
17051 echo "sigsetjmp not found." >&4
17055 *) val="$d_sigsetjmp"
17056 case "$d_sigsetjmp" in
17057 $define) echo "POSIX sigsetjmp found." >&4;;
17058 $undef) echo "sigsetjmp not found." >&4;;
17066 : see if snprintf exists
17067 set snprintf d_snprintf
17070 : see if vsnprintf exists
17071 set vsnprintf d_vsnprintf
17074 case "$d_snprintf-$d_vsnprintf" in
17077 Checking whether your snprintf() and vsnprintf() work okay...
17079 $cat >try.c <<'EOCP'
17080 /* v?snprintf testing logic courtesy of Russ Allbery.
17081 * According to C99:
17082 * - if the buffer is too short it still must be \0-terminated
17083 * - if the buffer is too short the potentially required length
17084 * must be returned and not -1
17085 * - if the buffer is NULL the potentially required length
17086 * must be returned and not -1 or core dump
17089 #include <stdarg.h>
17093 int test (char *format, ...)
17098 va_start (args, format);
17099 count = vsnprintf (buf, sizeof buf, format, args);
17106 return ((test ("%s", "abcd") == 4 && buf[0] == 'a' && buf[1] == '\0'
17107 && snprintf (NULL, 0, "%s", "abcd") == 4) ? 0 : 1);
17111 if eval $compile; then
17114 0) echo "Your snprintf() and vsnprintf() seem to be working okay." ;;
17116 Your snprintf() and snprintf() don't seem to be working okay.
17118 d_snprintf="$undef"
17119 d_vsnprintf="$undef"
17123 echo "(I can't seem to compile the test program--assuming they don't)"
17124 d_snprintf="$undef"
17125 d_vsnprintf="$undef"
17131 : see if sockatmark exists
17132 set sockatmark d_sockatmark
17135 : see if prototype for sockatmark is available
17137 set d_sockatmarkproto sockatmark $d_socket sys/socket.h
17140 : see if socks5_init exists
17141 set socks5_init d_socks5_init
17144 : see if sprintf returns the length of the string in the buffer as per ANSI
17145 $echo "Checking whether sprintf returns the length of the string..." >&4
17148 #$i_stdlib I_STDLIB
17150 #include <stdlib.h>
17152 #$i_string I_STRING
17154 # include <string.h>
17156 # include <strings.h>
17165 int check (size_t expect, int test) {
17166 size_t got = strlen(buffer);
17170 printf("expected %ld, got %ld in test %d '%s'\n", (long) expect, (long) got,
17175 int main(int argc, char **argv) {
17178 check(sprintf(buffer, ""), ++test);
17179 check(sprintf(buffer, "%s %s", "perl", "rules"), ++test);
17180 check(sprintf(buffer, "I like %g", atan2(0,-1)), ++test);
17187 d_sprintf_returns_strlen="$undef"
17188 if eval $compile; then
17192 sprintf returns the length of the string (as ANSI says it should)
17194 d_sprintf_returns_strlen="$define"
17197 sprintf does not return the length of the string (how old is this system?)
17199 d_sprintf_returns_strlen="$undef"
17205 : see if srand48_r exists
17206 set srand48_r d_srand48_r
17208 case "$d_srand48_r" in
17210 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
17211 case "$d_srand48_r_proto:$usethreads" in
17212 ":define") d_srand48_r_proto=define
17213 set d_srand48_r_proto srand48_r $hdrs
17217 case "$d_srand48_r_proto" in
17219 case "$srand48_r_proto" in
17220 ''|0) try='int srand48_r(long, struct drand48_data*);'
17221 ./protochk "extern $try" $hdrs && srand48_r_proto=I_LS ;;
17223 case "$srand48_r_proto" in
17224 ''|0) d_srand48_r=undef
17226 echo "Disabling srand48_r, cannot determine prototype." >&4 ;;
17227 * ) case "$srand48_r_proto" in
17228 REENTRANT_PROTO*) ;;
17229 *) srand48_r_proto="REENTRANT_PROTO_$srand48_r_proto" ;;
17231 echo "Prototype: $try" ;;
17234 *) case "$usethreads" in
17235 define) echo "srand48_r has no prototype, not using it." >&4 ;;
17242 *) srand48_r_proto=0
17246 : see if srandom_r exists
17247 set srandom_r d_srandom_r
17249 case "$d_srandom_r" in
17251 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
17252 case "$d_srandom_r_proto:$usethreads" in
17253 ":define") d_srandom_r_proto=define
17254 set d_srandom_r_proto srandom_r $hdrs
17258 case "$d_srandom_r_proto" in
17260 case "$srandom_r_proto" in
17261 ''|0) try='int srandom_r(unsigned int, struct random_data*);'
17262 ./protochk "extern $try" $hdrs && srandom_r_proto=I_TS ;;
17264 case "$srandom_r_proto" in
17265 ''|0) d_srandom_r=undef
17267 echo "Disabling srandom_r, cannot determine prototype." >&4 ;;
17268 * ) case "$srandom_r_proto" in
17269 REENTRANT_PROTO*) ;;
17270 *) srandom_r_proto="REENTRANT_PROTO_$srandom_r_proto" ;;
17272 echo "Prototype: $try" ;;
17275 *) case "$usethreads" in
17276 define) echo "srandom_r has no prototype, not using it." >&4 ;;
17283 *) srandom_r_proto=0
17287 : see if prototype for setresgid is available
17289 set d_sresgproto setresgid $i_unistd unistd.h
17292 : see if prototype for setresuid is available
17294 set d_sresuproto setresuid $i_unistd unistd.h
17297 : see if sys/stat.h is available
17298 set sys/stat.h i_sysstat
17302 : see if stat knows about block sizes
17304 echo "Checking to see if your struct stat has st_blocks field..." >&4
17305 set d_statblks stat st_blocks $i_sysstat sys/stat.h
17309 : see if this is a sys/vfs.h system
17310 set sys/vfs.h i_sysvfs
17314 : see if this is a sys/statfs.h system
17315 set sys/statfs.h i_sysstatfs
17320 echo "Checking to see if your system supports struct statfs..." >&4
17321 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
17323 case "$d_statfs_s" in
17324 "$define") echo "Yes, it does." ;;
17325 *) echo "No, it doesn't." ;;
17330 : see if struct statfs knows about f_flags
17331 case "$d_statfs_s" in
17334 echo "Checking to see if your struct statfs has f_flags field..." >&4
17335 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
17339 set d_statfs_f_flags
17343 case "$d_statfs_f_flags" in
17344 "$define") echo "Yes, it does." ;;
17345 *) echo "No, it doesn't." ;;
17349 Checking how to access stdio streams by file descriptor number...
17351 case "$stdio_stream_array" in
17352 '') $cat >try.c <<EOCP
17355 if (&STDIO_STREAM_ARRAY[fileno(stdin)] == stdin)
17359 for s in _iob __iob __sF
17361 set try -DSTDIO_STREAM_ARRAY=$s
17362 if eval $compile; then
17363 case "`$run ./try`" in
17364 yes) stdio_stream_array=$s; break ;;
17370 case "$stdio_stream_array" in
17372 I can't figure out how to access stdio streams by file descriptor number.
17374 d_stdio_stream_array="$undef"
17377 You can access stdio streams by file descriptor number by the $stdio_stream_array array.
17379 d_stdio_stream_array="$define"
17383 : see if strcoll exists
17384 set strcoll d_strcoll
17387 : check for structure copying
17389 echo "Checking to see if your C compiler can copy structs..." >&4
17390 $cat >try.c <<'EOCP'
17400 if $cc -c try.c >/dev/null 2>&1 ; then
17402 echo "Yup, it can."
17405 echo "Nope, it can't."
17411 : see if strerror and/or sys_errlist[] exist
17413 if test "X$d_strerror" = X -o "X$d_syserrlst" = X; then
17414 if set strerror val -f d_strerror; eval $csym; $val; then
17415 echo 'strerror() found.' >&4
17416 d_strerror="$define"
17417 d_strerrm='strerror(e)'
17418 if set sys_errlist val -a d_syserrlst; eval $csym; $val; then
17419 echo "(You also have sys_errlist[], so we could roll our own strerror.)"
17420 d_syserrlst="$define"
17422 echo "(Since you don't have sys_errlist[], sterror() is welcome.)"
17423 d_syserrlst="$undef"
17425 elif xxx=`./findhdr string.h`; test "$xxx" || xxx=`./findhdr strings.h`; \
17426 $contains '#[ ]*define.*strerror' "$xxx" >/dev/null 2>&1; then
17427 echo 'strerror() found in string header.' >&4
17428 d_strerror="$define"
17429 d_strerrm='strerror(e)'
17430 if set sys_errlist val -a d_syserrlst; eval $csym; $val; then
17431 echo "(Most probably, strerror() uses sys_errlist[] for descriptions.)"
17432 d_syserrlst="$define"
17434 echo "(You don't appear to have any sys_errlist[], how can this be?)"
17435 d_syserrlst="$undef"
17437 elif set sys_errlist val -a d_syserrlst; eval $csym; $val; then
17438 echo "strerror() not found, but you have sys_errlist[] so we'll use that." >&4
17439 d_strerror="$undef"
17440 d_syserrlst="$define"
17441 d_strerrm='((e)<0||(e)>=sys_nerr?"unknown":sys_errlist[e])'
17443 echo 'strerror() and sys_errlist[] NOT found.' >&4
17444 d_strerror="$undef"
17445 d_syserrlst="$undef"
17446 d_strerrm='"unknown"'
17450 : see if strerror_r exists
17451 set strerror_r d_strerror_r
17453 case "$d_strerror_r" in
17455 hdrs="$i_systypes sys/types.h define stdio.h $i_string string.h"
17456 case "$d_strerror_r_proto:$usethreads" in
17457 ":define") d_strerror_r_proto=define
17458 set d_strerror_r_proto strerror_r $hdrs
17462 case "$d_strerror_r_proto" in
17464 case "$strerror_r_proto" in
17465 ''|0) try='int strerror_r(int, char*, size_t);'
17466 ./protochk "extern $try" $hdrs && strerror_r_proto=I_IBW ;;
17468 case "$strerror_r_proto" in
17469 ''|0) try='int strerror_r(int, char*, int);'
17470 ./protochk "extern $try" $hdrs && strerror_r_proto=I_IBI ;;
17472 case "$strerror_r_proto" in
17473 ''|0) try='char* strerror_r(int, char*, size_t);'
17474 ./protochk "extern $try" $hdrs && strerror_r_proto=B_IBW ;;
17476 case "$strerror_r_proto" in
17477 ''|0) d_strerror_r=undef
17479 echo "Disabling strerror_r, cannot determine prototype." >&4 ;;
17480 * ) case "$strerror_r_proto" in
17481 REENTRANT_PROTO*) ;;
17482 *) strerror_r_proto="REENTRANT_PROTO_$strerror_r_proto" ;;
17484 echo "Prototype: $try" ;;
17487 *) case "$usethreads" in
17488 define) echo "strerror_r has no prototype, not using it." >&4 ;;
17495 *) strerror_r_proto=0
17499 : see if strftime exists
17500 set strftime d_strftime
17503 : see if strlcat exists
17504 set strlcat d_strlcat
17507 : see if strlcpy exists
17508 set strlcpy d_strlcpy
17511 : see if strtod exists
17512 set strtod d_strtod
17515 : see if strtol exists
17516 set strtol d_strtol
17519 : see if strtold exists
17520 set strtold d_strtold
17523 : see if strtoll exists
17524 set strtoll d_strtoll
17527 case "$d_longlong-$d_strtoll" in
17530 Checking whether your strtoll() works okay...
17532 $cat >try.c <<'EOCP'
17535 #define strtoll __strtoll
17538 #define strtoll _strtoll
17541 extern long long int strtoll(char *s, char **, int);
17542 static int bad = 0;
17543 int check(char *s, long long ell, int een) {
17546 gll = strtoll(s, 0, 10);
17547 if (!((gll == ell) && (errno == een)))
17551 check(" 1", 1LL, 0);
17552 check(" 0", 0LL, 0);
17553 check("-1", -1LL, 0);
17554 check("-9223372036854775808", -9223372036854775808LL, 0);
17555 check("-9223372036854775808", -9223372036854775808LL, 0);
17556 check(" 9223372036854775807", 9223372036854775807LL, 0);
17557 check("-9223372036854775808", -9223372036854775808LL, 0);
17558 check(" 9223372036854775808", 9223372036854775807LL, ERANGE);
17559 check("-9223372036854775809", -9223372036854775808LL, ERANGE);
17565 if eval $compile; then
17568 ok) echo "Your strtoll() seems to be working okay." ;;
17570 Your strtoll() doesn't seem to be working okay.
17576 echo "(I can't seem to compile the test program--assuming it doesn't)"
17582 : see if strtoq exists
17583 set strtoq d_strtoq
17586 : see if strtoul exists
17587 set strtoul d_strtoul
17590 case "$d_strtoul" in
17593 Checking whether your strtoul() works okay...
17595 $cat >try.c <<'EOCP'
17598 extern unsigned long int strtoul(char *s, char **, int);
17599 static int bad = 0;
17600 void check(char *s, unsigned long eul, int een) {
17603 gul = strtoul(s, 0, 10);
17604 if (!((gul == eul) && (errno == een)))
17608 check(" 1", 1L, 0);
17609 check(" 0", 0L, 0);
17611 case "$longsize" in
17613 $cat >>try.c <<'EOCP'
17614 check("18446744073709551615", 18446744073709551615UL, 0);
17615 check("18446744073709551616", 18446744073709551615UL, ERANGE);
17616 #if 0 /* strtoul() for /^-/ strings is undefined. */
17617 check("-1", 18446744073709551615UL, 0);
17618 check("-18446744073709551614", 2, 0);
17619 check("-18446744073709551615", 1, 0);
17620 check("-18446744073709551616", 18446744073709551615UL, ERANGE);
17621 check("-18446744073709551617", 18446744073709551615UL, ERANGE);
17626 $cat >>try.c <<'EOCP'
17627 check("4294967295", 4294967295UL, 0);
17628 check("4294967296", 4294967295UL, ERANGE);
17629 #if 0 /* strtoul() for /^-/ strings is undefined. */
17630 check("-1", 4294967295UL, 0);
17631 check("-4294967294", 2, 0);
17632 check("-4294967295", 1, 0);
17633 check("-4294967296", 4294967295UL, ERANGE);
17634 check("-4294967297", 4294967295UL, ERANGE);
17639 : Should we write these tests to be more portable by sprintf-ing
17640 : ~0 and then manipulating that char string as input for strtol?
17643 $cat >>try.c <<'EOCP'
17650 if eval $compile; then
17651 case "`$run ./try`" in
17652 ok) echo "Your strtoul() seems to be working okay." ;;
17654 Your strtoul() doesn't seem to be working okay.
17660 echo "(I can't seem to compile the test program--assuming it doesn't)"
17666 : see if strtoull exists
17667 set strtoull d_strtoull
17670 case "$d_longlong-$d_strtoull" in
17673 Checking whether your strtoull() works okay...
17675 $cat >try.c <<'EOCP'
17678 #define strtoull __strtoull
17681 extern unsigned long long int strtoull(char *s, char **, int);
17682 static int bad = 0;
17683 int check(char *s, long long eull, int een) {
17686 gull = strtoull(s, 0, 10);
17687 if (!((gull == eull) && (errno == een)))
17691 check(" 1", 1LL, 0);
17692 check(" 0", 0LL, 0);
17693 check("18446744073709551615", 18446744073709551615ULL, 0);
17694 check("18446744073709551616", 18446744073709551615ULL, ERANGE);
17695 #if 0 /* strtoull() for /^-/ strings is undefined. */
17696 check("-1", 18446744073709551615ULL, 0);
17697 check("-18446744073709551614", 2LL, 0);
17698 check("-18446744073709551615", 1LL, 0);
17699 check("-18446744073709551616", 18446744073709551615ULL, ERANGE);
17700 check("-18446744073709551617", 18446744073709551615ULL, ERANGE);
17707 if eval $compile; then
17708 case "`$run ./try`" in
17709 ok) echo "Your strtoull() seems to be working okay." ;;
17711 Your strtoull() doesn't seem to be working okay.
17713 d_strtoull="$undef"
17717 echo "(I can't seem to compile the test program--assuming it doesn't)"
17718 d_strtoull="$undef"
17723 : see if strtouq exists
17724 set strtouq d_strtouq
17727 case "$d_strtouq" in
17730 Checking whether your strtouq() works okay...
17732 $cat >try.c <<'EOCP'
17735 extern unsigned long long int strtouq(char *s, char **, int);
17736 static int bad = 0;
17737 void check(char *s, unsigned long long eull, int een) {
17738 unsigned long long gull;
17740 gull = strtouq(s, 0, 10);
17741 if (!((gull == eull) && (errno == een)))
17745 check(" 1", 1LL, 0);
17746 check(" 0", 0LL, 0);
17747 check("18446744073709551615", 18446744073709551615ULL, 0);
17748 check("18446744073709551616", 18446744073709551615ULL, ERANGE);
17749 #if 0 /* strtouq() for /^-/ strings is undefined. */
17750 check("-1", 18446744073709551615ULL, 0);
17751 check("-18446744073709551614", 2LL, 0);
17752 check("-18446744073709551615", 1LL, 0);
17753 check("-18446744073709551616", 18446744073709551615ULL, ERANGE);
17754 check("-18446744073709551617", 18446744073709551615ULL, ERANGE);
17762 if eval $compile; then
17763 case "`$run ./try`" in
17764 ok) echo "Your strtouq() seems to be working okay." ;;
17766 Your strtouq() doesn't seem to be working okay.
17772 echo "(I can't seem to compile the test program--assuming it doesn't)"
17778 : see if strxfrm exists
17779 set strxfrm d_strxfrm
17782 : see if symlink exists
17783 set symlink d_symlink
17786 : see if syscall exists
17787 set syscall d_syscall
17790 : see if prototype for syscall is available
17792 set d_syscallproto syscall $i_unistd unistd.h
17795 : see if sysconf exists
17796 set sysconf d_sysconf
17799 : see if system exists
17800 set system d_system
17803 : see if tcgetpgrp exists
17804 set tcgetpgrp d_tcgetpgrp
17807 : see if tcsetpgrp exists
17808 set tcsetpgrp d_tcsetpgrp
17811 : see if prototype for telldir is available
17813 set d_telldirproto telldir $i_systypes sys/types.h $i_dirent dirent.h
17816 : see if time exists
17818 if test "X$d_time" = X -o X"$timetype" = X; then
17819 if set time val -f d_time; eval $csym; $val; then
17820 echo 'time() found.' >&4
17822 rp="What is the type returned by time() on this system?"
17823 set time_t timetype long stdio.h sys/types.h
17826 echo 'time() not found, hope that will do.' >&4
17834 : see if this is a sys/times.h system
17835 set sys/times.h i_systimes
17838 : see if times exists
17840 if set times val -f d_times; eval $csym; $val; then
17841 echo 'times() found.' >&4
17844 case "$i_systimes" in
17845 "$define") inc='sys/times.h';;
17847 rp="What is the type returned by times() on this system?"
17848 set clock_t clocktype long stdio.h sys/types.h $inc
17851 echo 'times() NOT found, hope that will do.' >&4
17856 : see if tmpnam_r exists
17857 set tmpnam_r d_tmpnam_r
17859 case "$d_tmpnam_r" in
17861 hdrs="$i_systypes sys/types.h define stdio.h "
17862 case "$d_tmpnam_r_proto:$usethreads" in
17863 ":define") d_tmpnam_r_proto=define
17864 set d_tmpnam_r_proto tmpnam_r $hdrs
17868 case "$d_tmpnam_r_proto" in
17870 case "$tmpnam_r_proto" in
17871 ''|0) try='char* tmpnam_r(char*);'
17872 ./protochk "extern $try" $hdrs && tmpnam_r_proto=B_B ;;
17874 case "$tmpnam_r_proto" in
17875 ''|0) d_tmpnam_r=undef
17877 echo "Disabling tmpnam_r, cannot determine prototype." >&4 ;;
17878 * ) case "$tmpnam_r_proto" in
17879 REENTRANT_PROTO*) ;;
17880 *) tmpnam_r_proto="REENTRANT_PROTO_$tmpnam_r_proto" ;;
17882 echo "Prototype: $try" ;;
17885 *) case "$usethreads" in
17886 define) echo "tmpnam_r has no prototype, not using it." >&4 ;;
17893 *) tmpnam_r_proto=0
17897 : see if truncate exists
17898 set truncate d_truncate
17901 : see if ttyname_r exists
17902 set ttyname_r d_ttyname_r
17904 case "$d_ttyname_r" in
17906 hdrs="$i_systypes sys/types.h define stdio.h $i_unistd unistd.h"
17907 case "$d_ttyname_r_proto:$usethreads" in
17908 ":define") d_ttyname_r_proto=define
17909 set d_ttyname_r_proto ttyname_r $hdrs
17913 case "$d_ttyname_r_proto" in
17915 case "$ttyname_r_proto" in
17916 ''|0) try='int ttyname_r(int, char*, size_t);'
17917 ./protochk "extern $try" $hdrs && ttyname_r_proto=I_IBW ;;
17919 case "$ttyname_r_proto" in
17920 ''|0) try='int ttyname_r(int, char*, int);'
17921 ./protochk "extern $try" $hdrs && ttyname_r_proto=I_IBI ;;
17923 case "$ttyname_r_proto" in
17924 ''|0) try='char* ttyname_r(int, char*, int);'
17925 ./protochk "extern $try" $hdrs && ttyname_r_proto=B_IBI ;;
17927 case "$ttyname_r_proto" in
17928 ''|0) d_ttyname_r=undef
17930 echo "Disabling ttyname_r, cannot determine prototype." >&4 ;;
17931 * ) case "$ttyname_r_proto" in
17932 REENTRANT_PROTO*) ;;
17933 *) ttyname_r_proto="REENTRANT_PROTO_$ttyname_r_proto" ;;
17935 echo "Prototype: $try" ;;
17938 *) case "$usethreads" in
17939 define) echo "ttyname_r has no prototype, not using it." >&4 ;;
17946 *) ttyname_r_proto=0
17950 : see if tzname[] exists
17952 if set tzname val -a d_tzname; eval $csym; $val; then
17954 echo 'tzname[] found.' >&4
17957 echo 'tzname[] NOT found.' >&4
17963 next|rhapsody|darwin) multiarch="$define" ;;
17965 case "$multiarch" in
17966 ''|[nN]*) multiarch="$undef" ;;
17969 : check for ordering of bytes in a UV
17971 case "$usecrosscompile$multiarch" in
17974 You seem to be either cross-compiling or doing a multiarchitecture build,
17975 skipping the byteorder check.
17981 case "$byteorder" in
17984 In the following, larger digits indicate more significance. A big-endian
17985 machine like a Pyramid or a Motorola 680?0 chip will come out to 4321. A
17986 little-endian machine like a Vax or an Intel 80?86 chip would be 1234. Other
17987 machines may have weird orders like 3412. A Cray will report 87654321,
17988 an Alpha will report 12345678. If the test program works the default is
17990 I'm now running the test program...
17994 #$i_stdlib I_STDLIB
17996 #include <stdlib.h>
17998 #include <sys/types.h>
17999 typedef $uvtype UV;
18009 u.l = (((UV)0x08070605) << 32) | (UV)0x04030201;
18011 u.l = (UV)0x04030201;
18012 for (i = 0; i < $uvsize; i++)
18013 printf("%c", u.c[i]+'0');
18020 if eval $compile && $run ./try > /dev/null; then
18023 [1-4][1-4][1-4][1-4]|12345678|87654321)
18024 echo "(The test program ran ok.)"
18025 echo "byteorder=$dflt"
18028 ????|????????) echo "(The test program ran ok.)" ;;
18029 *) echo "(The test program didn't run right for some reason.)" ;;
18034 (I can't seem to compile the test program. Guessing big-endian...)
18037 case "$xxx_prompt" in
18039 rp="What is the order of bytes in $uvtype?"
18054 Checking to see whether you can access character data unalignedly...
18056 case "$d_u32align" in
18057 '') $cat >try.c <<EOCP
18059 #$i_stdlib I_STDLIB
18061 #include <stdlib.h>
18063 #define U32 $u32type
18064 #define BYTEORDER 0x$byteorder
18066 #include <signal.h>
18068 $signal_t bletch(int s) { exit(4); }
18071 #if BYTEORDER == 0x1234 || BYTEORDER == 0x4321
18076 if (sizeof(U32) != 4) {
18077 printf("sizeof(U32) is not 4, but %d\n", sizeof(U32));
18084 signal(SIGBUS, bletch);
18096 for (i = 0; i < 4; i++) {
18097 up = (U32*)(buf + i);
18098 if (! ((*up == 1 << (8*i)) || /* big-endian */
18099 (*up == 1 << (8*(3-i))) /* little-endian */
18103 printf("read failed (%x)\n", *up);
18109 for (i = 0; i < 4; i++) {
18110 up = (U32*)(buf + i);
18112 if (*up != 0xBeef) {
18113 printf("write failed (%x)\n", *up);
18127 if eval $compile_ok; then
18128 echo "(Testing for character data alignment may crash the test. That's okay.)" >&4
18129 $run ./try 2>&1 >/dev/null
18132 You can access character data pretty unalignedly.
18134 d_u32align="$undef"
18137 It seems that you must access character data in an aligned manner.
18139 d_u32align="$define"
18143 rp='Can you access character data at unaligned addresses?'
18147 [yY]*) d_u32align="$undef" ;;
18148 *) d_u32align="$define" ;;
18155 : see if ualarm exists
18156 set ualarm d_ualarm
18159 : see if umask exists
18163 : see if unordered exists
18164 set unordered d_unordered
18167 : see if unsetenv exists
18168 set unsetenv d_unsetenv
18171 : see if usleep exists
18172 set usleep d_usleep
18175 : see if prototype for usleep is available
18177 set d_usleepproto usleep $i_unistd unistd.h
18180 : see if ustat exists
18184 : see if closedir exists
18185 set closedir d_closedir
18188 case "$d_closedir" in
18191 echo "Checking whether closedir() returns a status..." >&4
18193 #$i_dirent I_DIRENT /**/
18194 #$i_sysdir I_SYS_DIR /**/
18195 #$i_sysndir I_SYS_NDIR /**/
18196 #$i_systypes I_SYS_TYPES /**/
18198 #if defined(I_SYS_TYPES)
18199 #include <sys/types.h>
18201 #if defined(I_DIRENT)
18202 #include <dirent.h>
18203 #if defined(NeXT) && defined(I_SYS_DIR) /* NeXT needs dirent + sys/dir.h */
18204 #include <sys/dir.h>
18208 #include <sys/ndir.h>
18212 #include <ndir.h> /* may be wrong in the future */
18214 #include <sys/dir.h>
18219 int main() { return closedir(opendir(".")); }
18222 if eval $compile_ok; then
18223 if $run ./try > /dev/null 2>&1 ; then
18224 echo "Yes, it does."
18227 echo "No, it doesn't."
18231 echo "(I can't seem to compile the test program--assuming it doesn't)"
18239 set d_void_closedir
18243 : see if there is a wait4
18247 : see if waitpid exists
18248 set waitpid d_waitpid
18251 : see if wcstombs exists
18252 set wcstombs d_wcstombs
18255 : see if wctomb exists
18256 set wctomb d_wctomb
18259 : see if writev exists
18260 set writev d_writev
18263 : preserve RCS keywords in files with variable substitution, grrr
18268 Revision='$Revision'
18270 : check for alignment requirements
18272 case "$usecrosscompile$multiarch" in
18275 You seem to be either cross-compiling or doing a multiarchitecture build,
18276 skipping the memory alignment check.
18279 case "$alignbytes" in
18280 '') alignbytes=8 ;;
18284 case "$alignbytes" in
18285 '') echo "Checking alignment constraints..." >&4
18286 if $test "X$uselongdouble" = Xdefine -a "X$d_longdbl" = Xdefine; then
18287 $cat >try.c <<'EOCP'
18288 typedef long double NV;
18291 $cat >try.c <<'EOCP'
18295 $cat >>try.c <<'EOCP'
18303 printf("%d\n", (int)((char *)&try_algn.bar - (char *)&try_algn.foo));
18308 if eval $compile_ok; then
18312 echo "(I can't seem to compile the test program...)"
18315 *) dflt="$alignbytes"
18318 rp="Doubles must be aligned on a how-many-byte boundary?"
18326 : set the base revision
18329 : how do we concatenate cpp tokens here?
18331 echo "Checking to see how your cpp does stuff like concatenate tokens..." >&4
18332 $cat >cpp_stuff.c <<'EOCP'
18333 #define RCAT(a,b)a/**/b
18334 #define ACAT(a,b)a ## b
18338 $cppstdin $cppflags $cppminus <cpp_stuff.c >cpp_stuff.out 2>&1
18339 if $contains 'Circus' cpp_stuff.out >/dev/null 2>&1; then
18340 echo "Oh! Smells like ANSI's been here." >&4
18341 echo "We can catify or stringify, separately or together!"
18343 elif $contains 'Reiser' cpp_stuff.out >/dev/null 2>&1; then
18344 echo "Ah, yes! The good old days!" >&4
18345 echo "However, in the good old days we don't know how to stringify and"
18346 echo "catify at the same time."
18350 Hmm, I don't seem to be able to concatenate tokens with your cpp.
18351 You're going to have to edit the values of CAT[2-5] in config.h...
18353 cpp_stuff="/* Help! How do we handle cpp_stuff? */*/"
18357 : see if this is a db.h system
18363 : Check db version.
18365 echo "Checking Berkeley DB version ..." >&4
18371 #include <sys/types.h>
18373 #$i_stdlib I_STDLIB
18375 #include <stdlib.h>
18378 int main(int argc, char *argv[])
18380 #ifdef DB_VERSION_MAJOR /* DB version >= 2 */
18381 int Major, Minor, Patch ;
18382 unsigned long Version ;
18383 (void)db_version(&Major, &Minor, &Patch) ;
18385 printf("%d %d %d %d %d %d\n",
18386 DB_VERSION_MAJOR, DB_VERSION_MINOR, DB_VERSION_PATCH,
18387 Major, Minor, Patch);
18390 printf("You have Berkeley DB Version 2 or greater.\n");
18392 printf("db.h is from Berkeley DB Version %d.%d.%d\n",
18393 DB_VERSION_MAJOR, DB_VERSION_MINOR, DB_VERSION_PATCH);
18394 printf("libdb is from Berkeley DB Version %d.%d.%d\n",
18395 Major, Minor, Patch) ;
18397 /* check that db.h & libdb are compatible */
18398 if (DB_VERSION_MAJOR != Major || DB_VERSION_MINOR != Minor || DB_VERSION_PATCH != Patch) {
18399 printf("db.h and libdb are incompatible.\n") ;
18403 printf("db.h and libdb are compatible.\n") ;
18405 Version = DB_VERSION_MAJOR * 1000000 + DB_VERSION_MINOR * 1000
18406 + DB_VERSION_PATCH ;
18408 /* needs to be >= 2.3.4 */
18409 if (Version < 2003004) {
18410 /* if (DB_VERSION_MAJOR == 2 && DB_VERSION_MINOR == 0 && DB_VERSION_PATCH < 5) { */
18411 printf("Perl needs Berkeley DB 2.3.4 or greater.\n") ;
18417 #if defined(_DB_H_) && defined(BTREEMAGIC) && defined(HASHMAGIC)
18422 printf("You have Berkeley DB Version 1.\n");
18423 exit(0); /* DB version < 2: the coast is clear. */
18425 exit(1); /* <db.h> not Berkeley DB? */
18431 if eval $compile_ok && $run ./try; then
18432 echo 'Looks OK.' >&4
18434 db_version_major=$1
18435 db_version_minor=$2
18436 db_version_patch=$3
18438 echo "I can't use Berkeley DB with your <db.h>. I'll disable Berkeley DB." >&4
18442 : Remove db from list of libraries to use
18443 echo "Removing unusable -ldb from library list" >&4
18444 set `echo X $libs | $sed -e 's/-ldb / /' -e 's/-ldb$//'`
18447 echo "libs = $libs" >&4
18457 : Check the return type needed for hash
18459 echo "Checking return type needed for hash for Berkeley DB ..." >&4
18465 #include <sys/types.h>
18468 #ifndef DB_VERSION_MAJOR
18469 u_int32_t hash_cb (ptr, size)
18477 info.hash = hash_cb;
18481 if $cc $ccflags -c try.c >try.out 2>&1 ; then
18482 if $contains warning try.out >>/dev/null 2>&1 ; then
18485 db_hashtype='u_int32_t'
18488 : XXX Maybe we should just give up here.
18489 db_hashtype=u_int32_t
18491 echo "Help: I can't seem to compile the db test program." >&4
18492 echo "Something's wrong, but I'll assume you use $db_hashtype." >&4
18495 echo "Your version of Berkeley DB uses $db_hashtype for hash."
18497 *) db_hashtype=u_int32_t
18502 : Check the return type needed for prefix
18504 echo "Checking return type needed for prefix for Berkeley DB ..." >&4
18510 #include <sys/types.h>
18513 #ifndef DB_VERSION_MAJOR
18514 size_t prefix_cb (key1, key2)
18522 info.prefix = prefix_cb;
18526 if $cc $ccflags -c try.c >try.out 2>&1 ; then
18527 if $contains warning try.out >>/dev/null 2>&1 ; then
18528 db_prefixtype='int'
18530 db_prefixtype='size_t'
18533 db_prefixtype='size_t'
18534 : XXX Maybe we should just give up here.
18536 echo "Help: I can't seem to compile the db test program." >&4
18537 echo "Something's wrong, but I'll assume you use $db_prefixtype." >&4
18540 echo "Your version of Berkeley DB uses $db_prefixtype for prefix."
18542 *) db_prefixtype='size_t'
18546 : How can we generate normalized random numbers ?
18548 echo "Looking for a random number function..." >&4
18549 case "$randfunc" in
18551 if set drand48 val -f; eval $csym; $val; then
18553 echo "Good, found drand48()." >&4
18554 elif set random val -f; eval $csym; $val; then
18556 echo "OK, found random()." >&4
18559 echo "Yick, looks like I have to use rand()." >&4
18570 *-Dmy_rand=*|*-Dmy_srand=*)
18571 echo "Removing obsolete -Dmy_rand, -Dmy_srand, and -Drandbits from ccflags." >&4
18572 ccflags="`echo $ccflags | sed -e 's/-Dmy_rand=random/ /'`"
18573 ccflags="`echo $ccflags | sed -e 's/-Dmy_srand=srandom/ /'`"
18574 ccflags="`echo $ccflags | sed -e 's/-Drandbits=[0-9][0-9]*/ /'`"
18578 while $test "$cont"; do
18579 rp="Use which function to generate random numbers?"
18581 if $test "$ans" = "$dflt"; then
18587 if set $ans val -f; eval $csym; $val; then
18591 rp="I cannot find function $ans. Use that name anyway?"
18600 case "$randfunc" in
18602 drand01="drand48()"
18608 case "$randbits" in
18610 echo "Checking to see how many bits your $randfunc() function produces..." >&4
18612 #$i_unistd I_UNISTD
18613 #$i_stdlib I_STDLIB
18616 # include <unistd.h>
18619 # include <stdlib.h>
18624 register unsigned long tmp;
18625 register unsigned long max = 0L;
18627 for (i = 1000; i; i--) {
18628 tmp = (unsigned long) $randfunc();
18629 if (tmp > max) max = tmp;
18631 for (i = 0; max; i++)
18637 if eval $compile_ok; then
18641 echo "(I can't seem to compile the test program...)"
18648 rp="How many bits does your $randfunc() function produce?"
18652 drand01="($randfunc() / (double) ((unsigned long)1 << $randbits))"
18653 seedfunc="s$randfunc"
18654 randseedtype=unsigned
18658 rp="How many bits does your $randfunc() function produce?"
18661 seedfunc="s$randfunc"
18662 drand01="($randfunc() / (double) ((unsigned long)1 << $randbits))"
18663 if set $seedfunc val -f; eval $csym; $val; then
18664 echo "(Using $seedfunc() to seed random generator)"
18666 echo "(Warning: no $seedfunc() to seed random generator)"
18669 randseedtype=unsigned
18677 echo "Determining whether or not we are on an EBCDIC system..." >&4
18678 $cat >try.c <<'EOM'
18681 if ('M'==0xd4) return 0;
18688 if eval $compile_ok; then
18689 if $run ./try; then
18690 echo "You seem to speak EBCDIC." >&4
18693 echo "Nope, no EBCDIC, probably ASCII or some ISO Latin. Or UTF-8." >&4
18696 echo "I'm unable to compile the test program." >&4
18697 echo "I'll assume ASCII or some ISO Latin. Or UTF8." >&4
18705 Checking how to flush all pending stdio output...
18707 # I only know how to find the first 32 possibly open files on SunOS.
18708 # See also hints/sunos_4_1.sh and util.c --AD
18710 sunos) $echo '#define PERL_FFLUSH_ALL_FOPEN_MAX 32' > try.c ;;
18712 $cat >>try.c <<EOCP
18714 #$i_stdlib I_STDLIB
18716 #include <stdlib.h>
18718 #$i_unistd I_UNISTD
18720 # include <unistd.h>
18722 #$d_sysconf HAS_SYSCONF
18723 #$d_stdio_stream_array HAS_STDIO_STREAM_ARRAY
18724 #ifdef HAS_STDIO_STREAM_ARRAY
18725 # define STDIO_STREAM_ARRAY $stdio_stream_array
18730 p = fopen("try.out", "w");
18734 # ifdef TRY_FPRINTF
18738 #ifdef TRY_FFLUSH_NULL
18741 #ifdef TRY_FFLUSH_ALL
18743 long open_max = -1;
18744 # ifdef PERL_FFLUSH_ALL_FOPEN_MAX
18745 open_max = PERL_FFLUSH_ALL_FOPEN_MAX;
18747 # if defined(HAS_SYSCONF) && defined(_SC_OPEN_MAX)
18748 open_max = sysconf(_SC_OPEN_MAX);
18751 open_max = FOPEN_MAX;
18754 open_max = OPEN_MAX;
18763 # ifdef HAS_STDIO_STREAM_ARRAY
18764 if (open_max > 0) {
18766 for (i = 0; i < open_max; i++)
18767 if (STDIO_STREAM_ARRAY[i]._file >= 0 &&
18768 STDIO_STREAM_ARRAY[i]._file < open_max &&
18769 STDIO_STREAM_ARRAY[i]._flag)
18770 fflush(&STDIO_STREAM_ARRAY[i]);
18778 : first we have to find out how _not_ to flush
18780 if $test "X$fflushNULL" = X -o "X$fflushall" = X; then
18782 set try -DTRY_FPUTC
18783 if eval $compile; then
18784 $run ./try 2>/dev/null
18787 if $test ! -s try.out -a "X$code" = X42; then
18793 set try -DTRY_FPRINTF
18794 if eval $compile; then
18795 $run ./try 2>/dev/null
18798 if $test ! -s try.out -a "X$code" = X42; then
18799 output=-DTRY_FPRINTF
18805 : check for fflush NULL behaviour
18806 case "$fflushNULL" in
18807 '') set try -DTRY_FFLUSH_NULL $output
18808 if eval $compile; then
18809 $run ./try 2>/dev/null
18812 if $test -s try.out -a "X$code" = X42; then
18813 fflushNULL="`$cat try.out`"
18815 if $test "X$code" != X42; then
18817 (If this test failed, don't worry, we'll try another method shortly.)
18823 case "$fflushNULL" in
18825 Your fflush(NULL) works okay for output streams.
18826 Let's see if it clobbers input pipes...
18828 # As of mid-March 2000 all versions of Solaris appear to have a stdio
18829 # bug that improperly flushes the input end of pipes. So we avoid the
18830 # autoflush on fork/system/exec support for now. :-(
18831 $cat >tryp.c <<EOCP
18834 main(int argc, char **argv)
18840 while ((i = getc(stdin)) != -1
18841 && (*bp++ = i) != '\n'
18842 && bp < &buf[1024])
18845 fprintf(stdout, "%s", buf);
18853 fflushNULL="$define"
18855 if eval $compile; then
18857 $cat tryp.c | $run ./tryp 2>/dev/null > tryp.out
18858 if cmp tryp.c tryp.out >/dev/null 2>&1; then
18860 fflush(NULL) seems to behave okay with input streams.
18862 fflushNULL="$define"
18865 Ouch, fflush(NULL) clobbers input pipes! We will not use it.
18867 fflushNULL="$undef"
18870 $rm -f core tryp.c tryp.core core.tryp.*
18873 Your fflush(NULL) isn't working (contrary to ANSI C).
18875 fflushNULL="$undef"
18878 Cannot figure out whether your fflush(NULL) works or not.
18879 I'm assuming it doesn't (contrary to ANSI C).
18881 fflushNULL="$undef"
18885 $define|true|[yY]*)
18886 fflushNULL="$define"
18889 fflushNULL="$undef"
18892 : check explicit looping only if NULL did not work, and if the pipe
18893 : bug does not show up on an explicit flush too
18894 case "$fflushNULL" in
18896 $cat >tryp.c <<EOCP
18899 main(int argc, char **argv)
18905 while ((i = getc(stdin)) != -1
18906 && (*bp++ = i) != '\n'
18907 && bp < &buf[1024])
18910 fprintf(stdout, "%s", buf);
18919 if eval $compile; then
18921 $cat tryp.c | $run ./tryp 2>/dev/null > tryp.out
18922 if cmp tryp.c tryp.out >/dev/null 2>&1; then
18924 Good, at least fflush(stdin) seems to behave okay when stdin is a pipe.
18926 : now check for fflushall behaviour
18927 case "$fflushall" in
18928 '') set try -DTRY_FFLUSH_ALL $output
18929 if eval $compile; then
18931 (Now testing the other method--but note that this also may fail.)
18933 $run ./try 2>/dev/null
18936 if $test -s try.out -a "X$code" = X42; then
18937 fflushall="`$cat try.out`"
18941 case "$fflushall" in
18943 Whew. Flushing explicitly all the stdio streams works.
18945 fflushall="$define"
18948 Sigh. Flushing explicitly all the stdio streams doesn't work.
18953 Cannot figure out whether flushing stdio streams explicitly works or not.
18954 I'm assuming it doesn't.
18960 "$define"|true|[yY]*)
18961 fflushall="$define"
18969 All is futile. Even fflush(stdin) clobbers input pipes!
18976 $rm -f core tryp.c tryp.core core.tryp.*
18978 *) fflushall="$undef"
18982 case "$fflushNULL$fflushall" in
18985 OK, I give up. I cannot figure out how to flush pending stdio output.
18986 We won't be flushing handles at all before fork/exec/popen.
18992 : Store the full pathname to the ar program for use in the C program
18993 : Respect a hint or command line value for full_ar.
18998 : Store the full pathname to the sed program for use in the C program
19001 : see what type gids are declared as in the kernel
19003 echo "Looking for the type for group ids returned by getgid()."
19004 set gid_t gidtype xxx stdio.h sys/types.h
19008 xxx=`./findhdr sys/user.h`
19009 set `grep 'groups\[NGROUPS\];' "$xxx" 2>/dev/null` unsigned short
19011 unsigned) dflt="$1 $2" ;;
19015 *) dflt="$gidtype";;
19018 gid_t) echo "gid_t found." ;;
19019 *) rp="What is the type for group ids returned by getgid()?"
19027 *_t) zzz="$gidtype" ;;
19030 echo "Checking the size of $zzz..." >&4
19032 #include <sys/types.h>
19034 #$i_stdlib I_STDLIB
19036 #include <stdlib.h>
19039 printf("%d\n", (int)sizeof($gidtype));
19044 if eval $compile_ok; then
19048 echo "(I can't execute the test program--guessing $gidsize.)" >&4
19051 echo "Your $zzz is $gidsize bytes long."
19056 echo "(I can't compile the test program--guessing $gidsize.)" >&4
19062 *_t) zzz="$gidtype" ;;
19065 echo "Checking the sign of $zzz..." >&4
19067 #include <sys/types.h>
19078 if eval $compile; then
19082 echo "(I can't execute the test program--guessing unsigned.)" >&4
19086 1) echo "Your $zzz is unsigned." ;;
19087 -1) echo "Your $zzz is signed." ;;
19093 echo "(I can't compile the test program--guessing unsigned.)" >&4
19099 if $test X"$quadtype" != X; then
19101 echo "Checking how to print 64-bit integers..." >&4
19103 if $test X"$sPRId64" = X -a X"$quadtype" = Xint; then
19104 $cat >try.c <<'EOCP'
19105 #include <sys/types.h>
19108 int q = 12345678901;
19109 printf("%ld\n", q);
19113 if eval $compile; then
19117 sPRId64='"d"'; sPRIi64='"i"'; sPRIu64='"u"';
19118 sPRIo64='"o"'; sPRIx64='"x"'; sPRIXU64='"X"';
19119 echo "We will use %d."
19125 if $test X"$sPRId64" = X -a X"$quadtype" = Xlong; then
19126 $cat >try.c <<'EOCP'
19127 #include <sys/types.h>
19130 long q = 12345678901;
19131 printf("%ld\n", q);
19135 if eval $compile; then
19139 sPRId64='"ld"'; sPRIi64='"li"'; sPRIu64='"lu"';
19140 sPRIo64='"lo"'; sPRIx64='"lx"'; sPRIXU64='"lX"';
19141 echo "We will use %ld."
19147 if $test X"$sPRId64" = X -a X"$i_inttypes" = X"$define" -a X"$quadtype" = Xint64_t; then
19148 $cat >try.c <<'EOCP'
19149 #include <sys/types.h>
19150 #include <inttypes.h>
19153 int64_t q = 12345678901;
19154 printf("%" PRId64 "\n", q);
19158 if eval $compile; then
19162 sPRId64=PRId64; sPRIi64=PRIi64; sPRIu64=PRIu64;
19163 sPRIo64=PRIo64; sPRIx64=PRIx64; sPRIXU64=PRIXU64;
19164 echo "We will use the C9X style."
19170 if $test X"$sPRId64" = X -a X"$quadtype" != X; then
19172 #include <sys/types.h>
19175 $quadtype q = 12345678901;
19176 printf("%Ld\n", q);
19180 if eval $compile; then
19184 sPRId64='"Ld"'; sPRIi64='"Li"'; sPRIu64='"Lu"';
19185 sPRIo64='"Lo"'; sPRIx64='"Lx"'; sPRIXU64='"LX"';
19186 echo "We will use %Ld."
19192 if $test X"$sPRId64" = X -a X"$quadtype" = X"long long"; then
19193 $cat >try.c <<'EOCP'
19194 #include <sys/types.h>
19197 long long q = 12345678901LL; /* AIX cc requires the LL suffix. */
19198 printf("%lld\n", q);
19202 if eval $compile; then
19206 sPRId64='"lld"'; sPRIi64='"lli"'; sPRIu64='"llu"';
19207 sPRIo64='"llo"'; sPRIx64='"llx"'; sPRIXU64='"llX"';
19208 echo "We will use the %lld style."
19214 if $test X"$sPRId64" = X -a X"$quadtype" != X; then
19216 #include <sys/types.h>
19219 $quadtype q = 12345678901;
19220 printf("%qd\n", q);
19224 if eval $compile; then
19228 sPRId64='"qd"'; sPRIi64='"qi"'; sPRIu64='"qu"';
19229 sPRIo64='"qo"'; sPRIx64='"qx"'; sPRIXU64='"qX"';
19230 echo "We will use %qd."
19236 if $test X"$sPRId64" = X; then
19237 echo "Cannot figure out how to print 64-bit integers." >&4
19244 '') d_PRId64="$undef"; d_PRIi64="$undef"; d_PRIu64="$undef";
19245 d_PRIo64="$undef"; d_PRIx64="$undef"; d_PRIXU64="$undef";
19247 *) d_PRId64="$define"; d_PRIi64="$define"; d_PRIu64="$define";
19248 d_PRIo64="$define"; d_PRIx64="$define"; d_PRIXU64="$define";
19254 $echo "Checking the format strings to be used for Perl's internal types..." >&4
19256 if $test X"$ivsize" = X8; then
19257 ivdformat="$sPRId64"
19258 uvuformat="$sPRIu64"
19259 uvoformat="$sPRIo64"
19260 uvxformat="$sPRIx64"
19261 uvXUformat="$sPRIXU64"
19263 if $test X"$ivsize" = X"$longsize"; then
19270 if $test X"$ivsize" = X"$intsize"; then
19278 if $test X"$ivsize" = X"$shortsize"; then
19289 if $test X"$uselongdouble" = X"$define" -a X"$d_longdbl" = X"$define" -a X"$d_PRIgldbl" = X"$define"; then
19290 nveformat="$sPRIeldbl"
19291 nvfformat="$sPRIfldbl"
19292 nvgformat="$sPRIgldbl"
19293 nvEUformat="$sPRIEUldbl"
19294 nvFUformat="$sPRIFUldbl"
19295 nvGUformat="$sPRIGUldbl"
19305 case "$ivdformat" in
19306 '') echo "$0: Fatal: failed to find format strings, cannot continue." >&4
19313 $echo "Checking the format string to be used for gids..." >&4
19316 -1) if $test X"$gidsize" = X"$ivsize"; then
19317 gidformat="$ivdformat"
19319 if $test X"$gidsize" = X"$longsize"; then
19322 if $test X"$gidsize" = X"$intsize"; then
19325 if $test X"$gidsize" = X"$shortsize"; then
19332 *) if $test X"$gidsize" = X"$uvsize"; then
19333 gidformat="$uvuformat"
19335 if $test X"$gidsize" = X"$longsize"; then
19338 if $test X"$gidsize" = X"$intsize"; then
19341 if $test X"$gidsize" = X"$shortsize"; then
19350 : see if getgroups exists
19351 set getgroups d_getgrps
19354 : see if setgroups exists
19355 set setgroups d_setgrps
19359 : Find type of 2nd arg to 'getgroups()' and 'setgroups()'
19361 case "$d_getgrps$d_setgrps" in
19363 case "$groupstype" in
19364 '') dflt="$gidtype" ;;
19365 *) dflt="$groupstype" ;;
19368 What type of pointer is the second argument to getgroups() and setgroups()?
19369 Usually this is the same as group ids, $gidtype, but not always.
19372 rp='What type pointer is the second argument to getgroups() and setgroups()?'
19376 *) groupstype="$gidtype";;
19380 if $test $patchlevel -lt 9; then
19381 : MAD is not available in 5.8.x or earlier.
19385 $define|true|[yY]*) dflt='y' ;;
19390 Would you like to build with Misc Attribute Decoration? This is development
19391 work leading to a Perl 5 to Perl 6 convertor, which imposes a space and speed
19392 overhead on the interpreter.
19394 If this doesn't make any sense to you, just accept the default '$dflt'.
19396 rp='Build Perl with MAD?'
19401 madlyh='madly.h madly.act madly.tab'
19403 madlyobj="madly$_o" ;;
19413 echo "Checking if your $make program sets \$(MAKE)..." >&4
19414 case "$make_set_make" in
19416 $sed 's/^X //' > testmake.mak << 'EOF'
19418 X @echo 'maketemp="$(MAKE)"'
19420 case "`$make -f testmake.mak 2>/dev/null`" in
19421 *maketemp=*) make_set_make='#' ;;
19422 *) make_set_make="MAKE=$make" ;;
19424 $rm -f testmake.mak
19427 case "$make_set_make" in
19428 '#') echo "Yup, it does.";;
19429 *) echo "Nope, it doesn't.";;
19432 : see what type is used for mode_t
19433 rp="What is the type used for file modes for system calls (e.g. fchmod())?"
19434 set mode_t modetype int stdio.h sys/types.h
19437 : see if we need va_copy
19439 case "$i_stdarg" in
19442 #include <stdarg.h>
19444 #$i_stdlib I_STDLIB
19446 #include <stdlib.h>
19448 #include <signal.h>
19451 ivfprintf(FILE *f, const char *fmt, va_list *valp)
19453 return vfprintf(f, fmt, *valp);
19457 myvfprintf(FILE *f, const char *fmt, va_list val)
19459 return ivfprintf(f, fmt, &val);
19463 myprintf(char *fmt, ...)
19466 va_start(val, fmt);
19467 return myvfprintf(stdout, fmt, val);
19471 main(int ac, char **av)
19473 signal(SIGSEGV, exit);
19475 myprintf("%s%cs all right, then\n", "that", '\'');
19480 if eval $compile && $run ./try 2>&1 >/dev/null; then
19481 case "`$run ./try`" in
19482 "that's all right, then")
19488 yes) echo "It seems that you don't need va_copy()." >&4
19489 need_va_copy="$undef"
19491 *) echo "It seems that va_copy() or similar will be needed." >&4
19492 need_va_copy="$define"
19497 *) echo "You don't have <stdarg.h>, not checking for va_copy()." >&4
19501 : see what type is used for size_t
19502 rp="What is the type used for the length parameter for string functions?"
19503 set size_t sizetype 'unsigned int' stdio.h sys/types.h
19506 : check for type of arguments to gethostbyaddr.
19507 if test "X$netdb_host_type" = X -o "X$netdb_hlen_type" = X; then
19508 case "$d_gethbyaddr" in
19512 Checking to see what type of arguments are accepted by gethostbyaddr().
19514 hdrs="$define sys/types.h
19515 $d_socket sys/socket.h
19516 $i_niin netinet/in.h
19518 $i_unistd unistd.h"
19519 : The first arg can 'char *' or 'void *'
19520 : The second arg is some of integral type
19521 for xxx in in_addr_t 'const void *' 'const char *' 'void *' 'char *'; do
19522 for yyy in size_t long int; do
19523 case "$netdb_host_type" in
19524 '') try="extern struct hostent *gethostbyaddr($xxx, $yyy, int);"
19525 if ./protochk "$try" $hdrs; then
19526 echo "Your system accepts $xxx for the first arg."
19527 echo "...and $yyy for the second arg."
19528 netdb_host_type="$xxx"
19529 netdb_hlen_type="$yyy"
19535 : In case none of those worked, prompt the user.
19536 case "$netdb_host_type" in
19537 '') rp='What is the type for the 1st argument to gethostbyaddr?'
19540 netdb_host_type=$ans
19541 rp='What is the type for the 2nd argument to gethostbyaddr?'
19544 netdb_hlen_type=$ans
19548 *) : no gethostbyaddr, so pick harmless defaults
19549 netdb_host_type='char *'
19550 netdb_hlen_type="$sizetype"
19553 # Remove the "const" if needed. -- but then we'll have a
19555 # netdb_host_type=`echo "$netdb_host_type" | sed 's/^const //'`
19558 : check for type of argument to gethostbyname.
19559 if test "X$netdb_name_type" = X ; then
19560 case "$d_gethbyname" in
19564 Checking to see what type of argument is accepted by gethostbyname().
19566 hdrs="$define sys/types.h
19567 $d_socket sys/socket.h
19568 $i_niin netinet/in.h
19570 $i_unistd unistd.h"
19571 for xxx in "const char *" "char *"; do
19572 case "$netdb_name_type" in
19573 '') try="extern struct hostent *gethostbyname($xxx);"
19574 if ./protochk "$try" $hdrs; then
19575 echo "Your system accepts $xxx."
19576 netdb_name_type="$xxx"
19581 : In case none of those worked, prompt the user.
19582 case "$netdb_name_type" in
19583 '') rp='What is the type for the 1st argument to gethostbyname?'
19586 netdb_name_type=$ans
19590 *) : no gethostbyname, so pick harmless default
19591 netdb_name_type='char *'
19596 : check for type of 1st argument to getnetbyaddr.
19597 if test "X$netdb_net_type" = X ; then
19598 case "$d_getnbyaddr" in
19602 Checking to see what type of 1st argument is accepted by getnetbyaddr().
19604 hdrs="$define sys/types.h
19605 $d_socket sys/socket.h
19606 $i_niin netinet/in.h
19608 $i_unistd unistd.h"
19609 for xxx in in_addr_t "unsigned long" long "unsigned int" int; do
19610 case "$netdb_net_type" in
19611 '') try="extern struct netent *getnetbyaddr($xxx, int);"
19612 if ./protochk "$try" $hdrs; then
19613 echo "Your system accepts $xxx."
19614 netdb_net_type="$xxx"
19619 : In case none of those worked, prompt the user.
19620 case "$netdb_net_type" in
19621 '') rp='What is the type for the 1st argument to getnetbyaddr?'
19624 netdb_net_type=$ans
19628 *) : no getnetbyaddr, so pick harmless default
19629 netdb_net_type='long'
19633 : locate the preferred pager for this system
19640 [a-zA-Z]:/*) dflt=$pg;;
19644 [a-zA-Z]:/*) dflt=$more;;
19648 [a-zA-Z]:/*) dflt=$less;;
19651 '') dflt=/usr/ucb/more;;
19655 : Instruct ./getfile to trust the hinted or previous pager value,
19656 : even if it does not begin with a slash. For example, on os2,
19657 : pager might be cmd /c more. See comments in UU/getfile.
19662 rp='What pager is used on your system?'
19666 : see what type pids are declared as in the kernel
19667 rp="What is the type of process ids on this system?"
19668 set pid_t pidtype int stdio.h sys/types.h
19671 : see if ar generates random libraries by itself
19673 echo "Checking how to generate random libraries on your machine..." >&4
19674 echo 'int bar1() { return bar2(); }' > bar1.c
19675 echo 'int bar2() { return 2; }' > bar2.c
19677 #$i_stdlib I_STDLIB
19679 #include <stdlib.h>
19681 int main() { printf("%d\n", bar1()); exit(0); }
19683 $cc $ccflags -c bar1.c >/dev/null 2>&1
19684 $cc $ccflags -c bar2.c >/dev/null 2>&1
19685 $cc $ccflags -c foo.c >/dev/null 2>&1
19686 $ar rc bar$_a bar2$_o bar1$_o >/dev/null 2>&1
19687 if $cc -o foobar $ccflags $ldflags foo$_o bar$_a $libs > /dev/null 2>&1 &&
19688 $run ./foobar >/dev/null 2>&1; then
19689 echo "$ar appears to generate random libraries itself."
19691 if [ "X$ranlib" = "X" ]; then
19694 elif $ar s bar$_a >/dev/null 2>&1 &&
19695 $cc -o foobar $ccflags $ldflags foo$_o bar$_a $libs > /dev/null 2>&1 &&
19696 $run ./foobar >/dev/null 2>&1; then
19697 echo "a table of contents needs to be added with '$ar s'."
19700 elif $ar ts bar$_a >/dev/null 2>&1 &&
19701 $cc -o foobar $ccflags $ldflags foo$_o bar$_a $libs > /dev/null 2>&1 &&
19702 $run ./foobar >/dev/null 2>&1; then
19703 echo "a table of contents needs to be added with '$ar ts'."
19710 ranlib=`./loc ranlib X /usr/bin /bin /usr/local/bin`
19711 $test -f $ranlib || ranlib=''
19714 if $test -n "$ranlib"; then
19715 echo "your system has '$ranlib'; we'll use that."
19718 echo "your system doesn't seem to support random libraries"
19719 echo "so we'll use lorder and tsort to order the libraries."
19726 : check for type of arguments to select.
19727 case "$selecttype" in
19728 '') case "$d_select" in
19732 Checking to see what type of arguments are accepted by select().
19734 hdrs="$define sys/types.h
19735 $i_systime sys/time.h
19736 $i_sysselct sys/select.h
19737 $d_socket sys/socket.h"
19738 : The first arg can be int, unsigned, or size_t
19739 : The last arg may or may not be 'const'
19741 : void pointer has been seen but using that
19742 : breaks the selectminbits test
19743 for xxx in 'fd_set *' 'int *'; do
19744 for nfd in 'int' 'size_t' 'unsigned long' 'unsigned' ; do
19745 for tmo in 'struct timeval *' 'const struct timeval *'; do
19747 '') try="extern select _(($nfd, $xxx, $xxx, $xxx, $tmo));"
19748 if ./protochk "$try" $hdrs; then
19749 echo "Your system accepts $xxx."
19758 '') rp='What is the type for the 2nd, 3rd, and 4th arguments to select?'
19759 case "$d_fd_set" in
19760 $define) dflt="fd_set *" ;;
19769 *) : no select, so pick a harmless default
19776 : check for the select 'width'
19777 case "$selectminbits" in
19778 '') safebits=`expr $ptrsize \* 8`
19779 case "$d_select" in
19783 Checking to see on how many bits at a time your select() operates...
19786 #include <sys/types.h>
19788 #$i_systime I_SYS_TIME
19789 #$i_systimek I_SYS_TIME_KERNEL
19794 # ifdef I_SYS_TIME_KERNEL
19797 # include <sys/time.h>
19798 # ifdef I_SYS_TIME_KERNEL
19802 #$i_sysselct I_SYS_SELECT
19803 #ifdef I_SYS_SELECT
19804 #include <sys/select.h>
19806 #$d_socket HAS_SOCKET
19808 # include <sys/socket.h> /* Might include <sys/bsdtypes.h> */
19811 #$i_stdlib I_STDLIB
19813 #include <stdlib.h>
19816 #define S sizeof(*(b))
19818 #define NBYTES (S * 8 > MINBITS ? S : MINBITS/8)
19819 #define NBITS (NBYTES * 8)
19821 char *s = (char *)malloc(NBYTES);
19830 fp = fopen("try.c", "r");
19836 b = ($selecttype)s;
19837 for (i = 0; i < NBITS; i++)
19841 select(fd + 1, b, 0, 0, &t);
19842 for (i = NBITS - 1; i > fd && FD_ISSET(i, b); i--);
19844 printf("%d\n", i + 1);
19849 if eval $compile_ok; then
19850 selectminbits=`$run ./try`
19851 case "$selectminbits" in
19853 Cannot figure out on how many bits at a time your select() operates.
19854 I'll play safe and guess it is $safebits bits.
19856 selectminbits=$safebits
19857 bits="$safebits bits"
19860 *) bits="$selectminbits bits" ;;
19862 echo "Your select() operates on $bits at a time." >&4
19864 rp='What is the minimum number of bits your select() operates on?'
19865 case "$byteorder" in
19866 12345678) dflt=64 ;;
19872 selectminbits="$val"
19876 *) : no select, so pick a harmless default
19877 selectminbits=$safebits
19883 : Trace out the files included by signal.h, then look for SIGxxx names.
19884 : Remove SIGARRAYSIZE used by HPUX.
19885 : Remove SIGSTKSIZE used by Linux.
19886 : Remove SIGSTKSZ used by Posix.
19887 : Remove SIGTYP void lines used by OS2.
19888 : Some cpps, like os390, dont give the file name anywhere
19889 if [ "X$fieldn" = X ]; then
19890 : Just make some guesses. We check them later.
19891 xxx='/usr/include/signal.h /usr/include/sys/signal.h'
19893 xxx=`echo '#include <signal.h>' |
19894 $cppstdin $cppminus $cppflags 2>/dev/null |
19895 $grep '^[ ]*#.*include' |
19896 $awk "{print \\$$fieldn}" | $sed 's!"!!g' | $sed 's!\\\\\\\\!/!g' | $sort | $uniq`
19898 : Check this list of files to be sure we have parsed the cpp output ok.
19899 : This will also avoid potentially non-existent files, such
19902 for xx in $xxx /dev/null ; do
19903 $test -f "$xx" && xxxfiles="$xxxfiles $xx"
19905 : If we have found no files, at least try signal.h
19906 case "$xxxfiles" in
19907 '') xxxfiles=`./findhdr signal.h` ;;
19910 $1 ~ /^#define$/ && $2 ~ /^SIG[A-Z0-9]*$/ && $2 !~ /SIGARRAYSIZE/ && $2 !~ /SIGSTKSIZE/ && $2 !~ /SIGSTKSZ/ && $3 !~ /void/ {
19911 print substr($2, 4, 20)
19913 $1 == "#" && $2 ~ /^define$/ && $3 ~ /^SIG[A-Z0-9]*$/ && $3 !~ /SIGARRAYSIZE/ && $4 !~ /void/ {
19914 print substr($3, 4, 20)
19916 : Append some common names just in case the awk scan failed.
19917 xxx="$xxx ABRT ALRM BUS CANCEL CHLD CLD CONT DIL EMT FPE"
19918 xxx="$xxx FREEZE HUP ILL INT IO IOT KILL LOST LWP PHONE"
19919 xxx="$xxx PIPE POLL PROF PWR QUIT RTMAX RTMIN SEGV STKFLT STOP"
19920 xxx="$xxx SYS TERM THAW TRAP TSTP TTIN TTOU URG USR1 USR2"
19921 xxx="$xxx USR3 USR4 VTALRM WAITING WINCH WIND WINDOW XCPU XFSZ"
19923 : generate a few handy files for later
19924 $cat > signal.c <<EOCP
19925 #include <sys/types.h>
19926 #include <signal.h>
19927 #$i_stdlib I_STDLIB
19929 #include <stdlib.h>
19934 /* Strange style to avoid deeply-nested #if/#else/#endif */
19937 # define NSIG (_NSIG)
19943 # define NSIG (SIGMAX+1)
19949 # define NSIG (SIG_MAX+1)
19955 # define NSIG (_SIG_MAX+1)
19961 # define NSIG (MAXSIG+1)
19967 # define NSIG (MAX_SIG+1)
19972 # ifdef SIGARRAYSIZE
19973 # define NSIG SIGARRAYSIZE /* Assume ary[SIGARRAYSIZE] */
19979 # define NSIG (_sys_nsig) /* Solaris 2.5 */
19983 /* Default to some arbitrary number that's big enough to get most
19984 of the common signals.
19990 printf("NSIG %d\n", NSIG);
19996 echo $xxx | $tr ' ' $trnl | $sort | $uniq | $awk '
19998 printf "#ifdef SIG"; printf $1; printf "\n"
19999 printf "printf(\""; printf $1; printf " %%d\\n\",SIG";
20000 printf $1; printf ");\n"
20004 printf "#endif /* JUST_NSIG */\n";
20005 printf "exit(0);\n}\n";
20008 $cat >signal.awk <<'EOP'
20009 BEGIN { ndups = 0 }
20010 $1 ~ /^NSIG$/ { nsig = $2 }
20011 ($1 !~ /^NSIG$/) && (NF == 2) && ($2 ~ /^[0-9][0-9]*$/) {
20012 if ($2 > maxsig) { maxsig = $2 }
20013 if (sig_name[$2]) {
20014 dup_name[ndups] = $1
20015 dup_num[ndups] = $2
20027 printf("NSIG %d\n", nsig);
20028 for (n = 1; n < nsig; n++) {
20030 printf("%s %d\n", sig_name[n], sig_num[n])
20033 printf("NUM%d %d\n", n, n)
20036 for (n = 0; n < ndups; n++) {
20037 printf("%s %d\n", dup_name[n], dup_num[n])
20041 $cat >signal_cmd <<EOS
20043 if $test -s signal.lst; then
20044 echo "Using your existing signal.lst file"
20049 $cat >>signal_cmd <<'EOS'
20052 if eval $compile_ok; then
20053 $run ./signal$_exe | ($sort -n -k 2 2>/dev/null || $sort -n +1) | $uniq | $awk -f signal.awk >signal.lst
20055 echo "(I can't seem be able to compile the whole test program)" >&4
20056 echo "(I'll try it in little pieces.)" >&4
20057 set signal -DJUST_NSIG
20058 if eval $compile_ok; then
20059 $run ./signal$_exe > signal.nsg
20062 echo "I can't seem to figure out how many signals you have." >&4
20063 echo "Guessing 50." >&4
20064 echo 'NSIG 50' > signal.nsg
20066 : Now look at all the signal names, one at a time.
20067 for xx in `echo $xxx | $tr ' ' $trnl | $sort | $uniq`; do
20068 $cat > signal.c <<EOCP
20069 #include <sys/types.h>
20070 #include <signal.h>
20073 printf("$xx %d\n", SIG${xx});
20078 if eval $compile; then
20079 echo "SIG${xx} found."
20080 $run ./signal$_exe >> signal.ls1
20082 echo "SIG${xx} NOT found."
20085 if $test -s signal.ls1; then
20086 $cat signal.nsg signal.ls1 |
20087 $sort -n | $uniq | $awk -f signal.awk >signal.lst
20091 if $test -s signal.lst; then
20094 echo "(AAK! I can't compile the test programs -- Guessing)" >&4
20095 echo 'kill -l' >signal
20096 set X `csh -f <signal`
20100 0) set HUP INT QUIT ILL TRAP ABRT EMT FPE KILL BUS SEGV SYS PIPE ALRM TERM;;
20102 echo $@ | $tr ' ' $trnl | \
20103 $awk '{ printf "%s %d\n", $1, ++s; }
20104 END { printf "NSIG %d\n", ++s }' >signal.lst
20106 $rm -f signal.c signal$_exe signal$_o signal.nsg signal.ls1
20108 chmod a+x signal_cmd
20109 $eunicefix signal_cmd
20111 : generate list of signal names
20113 case "$sig_name_init" in
20115 *) case "$sig_num_init" in
20116 ''|*,*) doinit=yes ;;
20121 echo "Generating a list of signal names and numbers..." >&4
20123 sig_count=`$awk '/^NSIG/ { printf "%d", $2 }' signal.lst`
20124 sig_name=`$awk 'BEGIN { printf "ZERO " }
20125 !/^NSIG/ { printf "%s ", $1 }' signal.lst`
20126 sig_num=`$awk 'BEGIN { printf "0 " }
20127 !/^NSIG/ { printf "%d ", $2 }' signal.lst`
20128 sig_name_init=`$awk 'BEGIN { printf "\"ZERO\", " }
20129 !/^NSIG/ { printf "\"%s\", ", $1 }
20130 END { printf "0\n" }' signal.lst`
20131 sig_num_init=`$awk 'BEGIN { printf "0, " }
20132 !/^NSIG/ { printf "%d, ", $2}
20133 END { printf "0\n"}' signal.lst`
20136 echo "The following $sig_count signals are available:"
20138 echo $sig_name | $awk \
20139 'BEGIN { linelen = 0 }
20141 for (i = 1; i <= NF; i++) {
20142 name = "SIG" $i " "
20143 linelen = linelen + length(name)
20144 if (linelen > 70) {
20146 linelen = length(name)
20152 sig_size=`echo $sig_name | awk '{print NF}'`
20153 $rm -f signal signal.c signal.awk signal.lst signal_cmd
20156 case "$sizetype" in
20157 *_t) zzz="$sizetype" ;;
20158 *) zzz="filesize" ;;
20160 echo "Checking the size of $zzz..." >&4
20162 #include <sys/types.h>
20164 #$i_stdlib I_STDLIB
20166 #include <stdlib.h>
20169 printf("%d\n", (int)sizeof($sizetype));
20174 if eval $compile_ok; then
20178 echo "(I can't execute the test program--guessing $sizesize.)" >&4
20181 echo "Your $zzz size is $sizesize bytes."
20186 echo "(I can't compile the test program--guessing $sizesize.)" >&4
20190 : check for socklen_t
20192 echo "Checking to see if you have socklen_t..." >&4
20194 #include <sys/types.h>
20195 #$d_socket HAS_SOCKET
20197 #include <sys/socket.h>
20199 int main() { socklen_t x = 16; }
20202 if eval $compile; then
20204 echo "You have socklen_t."
20207 echo "You do not have socklen_t."
20208 case "$sizetype" in
20209 size_t) echo "(You do have size_t, that might work. Some people are happy with just an int.)" ;;
20216 : see if this is a socks.h system
20217 set socks.h i_socks
20220 : check for type of the size argument to socket calls
20221 case "$d_socket" in
20225 Checking to see what type is the last argument of accept().
20228 case "$d_socklen_t" in
20229 "$define") yyy="$yyy socklen_t"
20231 yyy="$yyy $sizetype int long unsigned"
20232 for xxx in $yyy; do
20233 case "$socksizetype" in
20234 '') try="extern int accept(int, struct sockaddr *, $xxx *);"
20235 case "$usesocks" in
20237 if ./protochk "$try" $i_systypes sys/types.h $d_socket sys/socket.h literal '#define INCLUDE_PROTOTYPES' $i_socks socks.h.; then
20238 echo "Your system accepts '$xxx *' for the last argument of accept()."
20239 socksizetype="$xxx"
20242 *) if ./protochk "$try" $i_systypes sys/types.h $d_socket sys/socket.h; then
20243 echo "Your system accepts '$xxx *' for the last argument of accept()."
20244 socksizetype="$xxx"
20251 : In case none of those worked, prompt the user.
20252 case "$socksizetype" in
20253 '') rp='What is the type for socket address structure sizes?'
20260 *) : no sockets, so pick relatively harmless default
20265 : see what type is used for signed size_t
20266 set ssize_t ssizetype int stdio.h sys/types.h
20271 #$i_stdlib I_STDLIB
20273 #include <stdlib.h>
20275 #include <sys/types.h>
20276 #define Size_t $sizetype
20277 #define SSize_t $dflt
20280 if (sizeof(Size_t) == sizeof(SSize_t))
20282 else if (sizeof(Size_t) == sizeof(int))
20291 if eval $compile_ok && $run ./try > /dev/null; then
20292 ssizetype=`$run ./try`
20293 echo "I'll be using $ssizetype for functions returning a byte count." >&4
20296 Help! I can't compile and run the ssize_t test program: please enlighten me!
20297 (This is probably a misconfiguration in your system or libraries, and
20298 you really ought to fix it. Still, I'll try anyway.)
20300 I need a type that is the same size as $sizetype, but is guaranteed to
20301 be signed. Common values are ssize_t, int and long.
20304 rp="What signed type is the same size as $sizetype?"
20310 : see what type of char stdio uses.
20312 echo '#include <stdio.h>' > stdio.c
20313 $cppstdin $cppminus < stdio.c > stdioh
20314 if $contains 'unsigned.*char.*_ptr;' stdioh >/dev/null 2>&1 ; then
20315 echo "Your stdio uses unsigned chars." >&4
20316 stdchar="unsigned char"
20318 echo "Your stdio uses signed chars." >&4
20321 $rm -f stdio.* stdioh
20323 : see what type uids are declared as in the kernel
20325 echo "Looking for the type for user ids returned by getuid()."
20326 set uid_t uidtype xxx stdio.h sys/types.h
20330 xxx=`./findhdr sys/user.h`
20331 set `grep '_ruid;' "$xxx" 2>/dev/null` unsigned short
20333 unsigned) dflt="$1 $2" ;;
20337 *) dflt="$uidtype";;
20340 uid_t) echo "uid_t found." ;;
20341 *) rp="What is the type for user ids returned by getuid()?"
20349 *_t) zzz="$uidtype" ;;
20352 echo "Checking the size of $zzz..." >&4
20354 #include <sys/types.h>
20356 #$i_stdlib I_STDLIB
20358 #include <stdlib.h>
20361 printf("%d\n", (int)sizeof($uidtype));
20366 if eval $compile_ok; then
20370 echo "(I can't execute the test program--guessing $uidsize.)" >&4
20373 echo "Your $zzz is $uidsize bytes long."
20378 echo "(I can't compile the test program--guessing $uidsize.)" >&4
20383 *_t) zzz="$uidtype" ;;
20386 echo "Checking the sign of $zzz..." >&4
20388 #include <sys/types.h>
20399 if eval $compile; then
20403 echo "(I can't execute the test program--guessing unsigned.)" >&4
20407 1) echo "Your $zzz is unsigned." ;;
20408 -1) echo "Your $zzz is signed." ;;
20414 echo "(I can't compile the test program--guessing unsigned.)" >&4
20420 $echo "Checking the format string to be used for uids..." >&4
20423 -1) if $test X"$uidsize" = X"$ivsize"; then
20424 uidformat="$ivdformat"
20426 if $test X"$uidsize" = X"$longsize"; then
20429 if $test X"$uidsize" = X"$intsize"; then
20432 if $test X"$uidsize" = X"$shortsize"; then
20439 *) if $test X"$uidsize" = X"$uvsize"; then
20440 uidformat="$uvuformat"
20442 if $test X"$uidsize" = X"$longsize"; then
20445 if $test X"$uidsize" = X"$intsize"; then
20448 if $test X"$uidsize" = X"$shortsize"; then
20458 case "$usesitecustomize" in
20459 $define|true|[Yy]*)
20460 usesitecustomize="$define"
20463 usesitecustomize="$undef"
20467 : determine compiler compiler
20476 if $test -f "$byacc$_exe"; then
20478 comp="byacc or $comp"
20480 if $test -f "$bison$_exe"; then
20481 comp="$comp or bison -y"
20483 rp="Which compiler compiler ($comp) shall I use?"
20492 echo "(Adding -y option to bison to get yacc-compatible behaviour.)"
20498 : see if this is a fp.h system
20502 : see if this is a fp_class.h system
20503 set fp_class.h i_fp_class
20506 : see if gdbm.h is available
20511 : see if gdbm_open exists
20512 set gdbm_open d_gdbm_open
20514 case "$d_gdbm_open" in
20517 echo "We won't be including <gdbm.h>"
20526 : see if this is a ieeefp.h system
20527 case "$i_ieeefp" in
20528 '' ) set ieeefp.h i_ieeefp
20533 : see if this is a libutil.h system
20534 set libutil.h i_libutil
20537 : see if mach cthreads are available
20538 if test "X$usethreads" = "X$define"; then
20539 set mach/cthreads.h i_machcthr
20542 i_machcthr="$undef"
20547 : see if this is a mntent.h system
20548 set mntent.h i_mntent
20551 : see if ndbm.h is available
20557 # Some Linux distributions such as RedHat 7.1 put the
20558 # ndbm.h header in /usr/include/gdbm/ndbm.h.
20559 if $test -f /usr/include/gdbm/ndbm.h; then
20560 echo '<gdbm/ndbm.h> found.'
20561 ccflags="$ccflags -I/usr/include/gdbm"
20562 cppflags="$cppflags -I/usr/include/gdbm"
20570 : see if dbm_open exists
20571 set dbm_open d_dbm_open
20573 case "$d_dbm_open" in
20576 echo "We won't be including <ndbm.h>"
20585 : see if net/errno.h is available
20587 set net/errno.h val
20590 : Unfortunately, it causes problems on some systems. Arrgh.
20593 cat > try.c <<'EOM'
20596 #include <net/errno.h>
20602 if $cc $ccflags -c try.c >/dev/null 2>&1; then
20603 echo "We'll be including <net/errno.h>." >&4
20605 echo "We won't be including <net/errno.h>." >&4
20614 : see if netinet/tcp.h is available
20615 set netinet/tcp.h i_netinettcp
20618 : see if this is a poll.h system
20622 : see if this is a prot.h system
20627 $echo "Guessing which symbols your C compiler and preprocessor define..." >&4
20628 $cat <<'EOSH' > Cppsym.know
20629 a29k ABI64 aegis AES_SOURCE AIX AIX32 AIX370
20630 AIX41 AIX42 AIX43 AIX_SOURCE aixpc ALL_SOURCE
20631 alliant alpha am29000 AM29000 AMD64 amd64 amiga AMIGAOS AMIX
20632 ansi ANSI_C_SOURCE apollo ardent ARM32 atarist att386 att3b
20633 BeOS BIG_ENDIAN BIT_MSF bsd BSD bsd43 bsd4_2 bsd4_3 BSD4_3 bsd4_4
20634 BSD_4_3 BSD_4_4 BSD_NET2 BSD_TIME BSD_TYPES BSDCOMPAT bsdi
20635 bull c cadmus clipper CMU COFF COMPILER_VERSION
20636 concurrent convex cpu cray CRAY CRAYMPP ctix CX_UX
20637 CYGWIN DECC DGUX DGUX_SOURCE DJGPP dmert DOLPHIN DPX2 DSO
20638 Dynix DynixPTX ELF encore EPI EXTENSIONS FAVOR_BSD
20639 FILE_OFFSET_BITS FreeBSD GCC_NEW_VARARGS gcos gcx gimpel
20641 GNU_SOURCE GNUC GNUC_MINOR GNU_LIBRARY GO32 gould GOULD_PN
20642 H3050R H3050RX hbullx20 hcx host_mips
20643 hp200 hp300 hp700 HP700 hp800 hp9000
20644 hp9000s200 hp9000s300 hp9000s400 hp9000s500
20645 hp9000s700 hp9000s800 hp9k8 hp_osf hppa hpux HPUX_SOURCE
20646 i186 i286 i386 i486 i586 i686 i8086 i80960 i860 I960
20647 IA64 iAPX286 ibm ibm032 ibmesa IBMR2 ibmrt ILP32 ILP64
20648 INLINE_INTRINSICS INTRINSICS INT64 interdata is68k ksr1
20649 LANGUAGE_C LARGE_FILE_API LARGEFILE64_SOURCE
20650 LARGEFILE_SOURCE LFS64_LARGEFILE LFS_LARGEFILE
20651 Linux LITTLE_ENDIAN LONG64 LONG_DOUBLE LONG_LONG
20652 LONGDOUBLE LONGLONG LP64 luna luna88k Lynx
20653 M68000 m68k m88100 m88k M88KBCS_TARGET M_COFF
20654 M_I186 M_I286 M_I386 M_I8086 M_I86 M_I86SM M_SYS3
20655 M_SYS5 M_SYSIII M_SYSV M_UNIX M_XENIX MACH machine MachTen
20656 MATH_HAS_NO_SIDE_EFFECTS
20657 mc300 mc500 mc68000 mc68010 mc68020 mc68030 mc68040
20658 mc68060 mc68k mc68k32 mc700 mc88000 mc88100 merlin
20659 mert MiNT mips MIPS_FPSET MIPS_ISA MIPS_SIM MIPS_SZINT
20660 MIPS_SZLONG MIPS_SZPTR MIPSEB MIPSEL MODERN_C motorola
20661 mpeix MSDOS MTXINU MULTIMAX mvs MVS n16 ncl_el ncl_mr
20662 NetBSD news1500 news1700 news1800 news1900 news3700
20663 news700 news800 news900 NeXT NLS nonstopux ns16000 ns32000
20664 ns32016 ns32332 ns32k nsc32000
20665 OCS88 OEMVS OpenBSD os OS2 OS390 osf OSF1 OSF_SOURCE
20666 pa_risc PA_RISC1_1 PA_RISC2_0 PARAGON parisc
20667 pc532 pdp11 PGC PIC plexus PORTAR posix
20668 POSIX1B_SOURCE POSIX2_SOURCE POSIX4_SOURCE
20669 POSIX_C_SOURCE POSIX_SOURCE POWER
20670 PROTOTYPES PWB pyr QNX R3000 REENTRANT RES Rhapsody RISC6000
20671 riscix riscos RT S390 SA110 scs SCO sequent sgi SGI_SOURCE SH3 sinix
20672 SIZE_INT SIZE_LONG SIZE_PTR SOCKET_SOURCE SOCKETS_SOURCE
20673 sony sony_news sonyrisc sparc sparclite spectrum
20674 stardent stdc STDC_EXT stratos sun sun3 sun386
20675 Sun386i svr3 svr4 SVR4_2 SVR4_SOURCE svr5
20676 SX system SYSTYPE_BSD SYSTYPE_BSD43 SYSTYPE_BSD44
20677 SYSTYPE_SVR4 SYSTYPE_SVR5 SYSTYPE_SYSV SYSV SYSV3 SYSV4 SYSV5
20678 sysV68 sysV88 Tek4132 Tek4300 titan
20679 TM3200 TM5400 TM5600
20680 tower tower32 tower32_200 tower32_600 tower32_700
20681 tower32_800 tower32_850 tss
20682 u370 u3b u3b2 u3b20 u3b200 u3b20d u3b5
20683 ultrix UMAXV UnicomPBB UnicomPBD UNICOS UNICOSMK
20684 unix UNIX95 UNIX99 unixpc unos
20685 USE_BSD USE_FILE_OFFSET64 USE_GNU USE_ISOC9X USE_LARGEFILE USE_LARGEFILE64
20686 USE_MISC USE_POSIX USE_POSIX199309 USE_POSIX199506 USE_POSIX2
20687 USE_REENTRANT USE_SVID USE_UNIX98 USE_XOPEN USE_XOPEN_EXTENDED
20689 Utek UTek UTS UWIN uxpm uxps vax venix VMESA vms x86_64 xenix Xenix286
20690 XOPEN_SOURCE XOPEN_SOURCE_EXTENDED XPG2 XPG2_EXTENDED
20691 XPG3 XPG3_EXTENDED XPG4 XPG4_EXTENDED
20694 # Maybe put other stuff here too.
20695 cat <<EOSH >>Cppsym.know
20698 ./tr '[a-z]' '[A-Z]' < Cppsym.know > Cppsym.a
20699 ./tr '[A-Z]' '[a-z]' < Cppsym.know > Cppsym.b
20700 $cat Cppsym.know > Cppsym.c
20701 $cat Cppsym.a Cppsym.b Cppsym.c | $tr ' ' $trnl | $sort | $uniq > Cppsym.know
20702 $rm -f Cppsym.a Cppsym.b Cppsym.c
20703 cat <<EOSH > Cppsym
20705 if $test \$# -gt 0; then
20706 echo \$* | $tr " " "$trnl" | ./Cppsym.try > Cppsym.got
20707 if $test -s Cppsym.got; then
20714 $tr " " "$trnl" | ./Cppsym.try
20720 cat <<EOSH > Cppsym.try
20722 cat <<'EOCP' > try.c
20725 #define STRINGIFY(a) "a"
20727 #if cpp_stuff == 42
20728 #define StGiFy(a) #a
20729 #define STRINGIFY(a) StGiFy(a)
20731 #if $cpp_stuff != 1 && $cpp_stuff != 42
20732 # include "Bletch: How does this C preprocessor stringify macros?"
20738 cat <<'EOSH' >> Cppsym.try
20740 printf "#ifdef %s\nprintf(\"%s=%%s\\n\", STRINGIFY(%s));\n#endif\n", $1, $1, $1
20741 printf "#ifdef _%s\nprintf(\"_%s=%%s\\n\", STRINGIFY(_%s));\n#endif\n", $1, $1, $1
20742 printf "#ifdef __%s\nprintf(\"__%s=%%s\\n\", STRINGIFY(__%s));\n#endif\n", $1, $1, $1
20743 printf "#ifdef __%s__\nprintf(\"__%s__=%%s\\n\", STRINGIFY(__%s__));\n#endif\n", $1, $1, $1
20745 echo 'return 0;}' >> try.c
20747 cat <<EOSH >> Cppsym.try
20749 case "$osname-$gccversion" in
20750 irix-) ccflags="\$ccflags -woff 1178" ;;
20751 os2-*) ccflags="\$ccflags -Zlinker /PM:VIO" ;;
20753 $cc -o try -Dcpp_stuff=$cpp_stuff $optimize \$ccflags $ldflags try.c $libs && $run ./try | $sed 's/ /\\\\ /g'
20755 chmod +x Cppsym.try
20756 $eunicefix Cppsym.try
20757 ./Cppsym < Cppsym.know > Cppsym.true
20758 : Add in any linux cpp "predefined macros":
20759 case "$osname::$gccversion" in
20762 rm -f $tHdrH'.h' $tHdrH
20764 if cpp -dM $tHdrH'.h' > $tHdrH'_cppsym.h' && [ -s $tHdrH'_cppsym.h' ]; then
20765 sed 's/#define[\ \ ]*//;s/[\ \ ].*$//' <$tHdrH'_cppsym.h' >$tHdrH'_cppsym.real'
20766 if [ -s $tHdrH'_cppsym.real' ]; then
20767 cat $tHdrH'_cppsym.real' Cppsym.know | sort | uniq | ./Cppsym | sort | uniq > Cppsym.true
20770 rm -f $tHdrH'.h' $tHdrH'_cppsym.h' $tHdrH'_cppsym.real'
20773 : now check the C compiler for additional symbols
20774 postprocess_cc_v=''
20776 aix) postprocess_cc_v="|$tr , ' '" ;;
20783 for i in \`$cc -v -c tmp.c 2>&1 $postprocess_cc_v\`
20786 -D*) echo "\$i" | $sed 's/^-D//';;
20787 -A*) $test "$gccversion" && echo "\$i" | $sed 's/^-A//' | $sed 's/\(.*\)(\(.*\))/\1=\2/';;
20792 postprocess_cc_v=''
20795 ./ccsym > ccsym1.raw
20796 if $test -s ccsym1.raw; then
20797 $sort ccsym1.raw | $uniq >ccsym.raw
20799 mv ccsym1.raw ccsym.raw
20802 $awk '/\=/ { print $0; next }
20803 { print $0"=1" }' ccsym.raw >ccsym.list
20804 $comm -13 Cppsym.true ccsym.list >ccsym.own
20805 $comm -12 Cppsym.true ccsym.list >ccsym.com
20806 $comm -23 Cppsym.true ccsym.list >ccsym.cpp
20808 if $test -z ccsym.raw; then
20809 echo "Your C compiler doesn't seem to define any symbols!" >&4
20811 echo "However, your C preprocessor defines the following symbols:"
20814 cppsymbols=`$cat Cppsym.true`
20815 cppsymbols=`echo $cppsymbols`
20816 cppccsymbols="$cppsymbols"
20818 if $test -s ccsym.com; then
20819 echo "Your C compiler and pre-processor define these symbols:"
20820 $sed -e 's/\(..*\)=.*/\1/' ccsym.com
20823 cppccsymbols=`$cat ccsym.com`
20824 cppccsymbols=`echo $cppccsymbols`
20825 $test "$silent" || sleep 1
20827 if $test -s ccsym.cpp; then
20828 $test "$also" && echo " "
20829 echo "Your C pre-processor ${also}defines the following symbols:"
20830 $sed -e 's/\(..*\)=.*/\1/' ccsym.cpp
20832 cppsymbols=`$cat ccsym.cpp`
20833 cppsymbols=`echo $cppsymbols`
20834 $test "$silent" || sleep 1
20836 if $test -s ccsym.own; then
20837 $test "$also" && echo " "
20838 echo "Your C compiler ${also}defines the following cpp symbols:"
20839 $sed -e 's/\(..*\)=1/\1/' ccsym.own
20840 $sed -e 's/\(..*\)=.*/\1/' ccsym.own | $uniq >>Cppsym.true
20841 ccsymbols=`$cat ccsym.own`
20842 ccsymbols=`echo $ccsymbols`
20843 $test "$silent" || sleep 1
20847 : see if this is a termio system
20851 if $test `./findhdr termios.h`; then
20852 set tcsetattr i_termios
20858 "$define") echo "You have POSIX termios.h... good!" >&4;;
20859 *) if ./Cppsym pyr; then
20860 case "`/bin/universe`" in
20861 ucb) if $test `./findhdr sgtty.h`; then
20863 echo "<sgtty.h> found." >&4
20865 echo "System is pyramid with BSD universe."
20866 echo "<sgtty.h> not found--you could have problems." >&4
20868 *) if $test `./findhdr termio.h`; then
20870 echo "<termio.h> found." >&4
20872 echo "System is pyramid with USG universe."
20873 echo "<termio.h> not found--you could have problems." >&4
20877 if $test `./findhdr termio.h`; then
20878 echo "<termio.h> found." >&4
20880 elif $test `./findhdr sgtty.h`; then
20881 echo "<sgtty.h> found." >&4
20884 echo "Neither <termio.h> nor <sgtty.h> found--you could have problems." >&4
20887 if $test `./findhdr sgtty.h`; then
20888 echo "<sgtty.h> found." >&4
20890 elif $test `./findhdr termio.h`; then
20891 echo "<termio.h> found." >&4
20894 echo "Neither <sgtty.h> nor <termio.h> found--you could have problems." >&4
20898 set i_termio; eval $setvar
20899 val=$val2; set i_sgtty; eval $setvar
20900 val=$val3; set i_termios; eval $setvar
20902 : see if stddef is available
20903 set stddef.h i_stddef
20906 : see if sys/access.h is available
20907 set sys/access.h i_sysaccess
20910 : see if ioctl defs are in sgtty, termio, sys/filio or sys/ioctl
20911 set sys/filio.h i_sysfilio
20914 if $test `./findhdr sys/ioctl.h`; then
20916 echo '<sys/ioctl.h> found.' >&4
20919 if $test $i_sysfilio = "$define"; then
20920 echo '<sys/ioctl.h> NOT found.' >&4
20922 $test $i_sgtty = "$define" && xxx="sgtty.h"
20923 $test $i_termio = "$define" && xxx="termio.h"
20924 $test $i_termios = "$define" && xxx="termios.h"
20925 echo "No <sys/ioctl.h> found, assuming ioctl args are defined in <$xxx>." >&4
20931 : see if socket ioctl defs are in sys/sockio.h
20933 xxx=`./findhdr sys/sockio.h`
20934 if $test "$xxx"; then
20935 if $contains SIOCATMARK $xxx >/dev/null 2>&1; then
20937 echo "You have socket ioctls defined in <sys/sockio.h>." >&4
20940 echo "No socket ioctls found in <sys/sockio.h>." >&4
20945 <sys/sockio.h> not found, assuming socket ioctls are in <sys/ioctl.h>.
20952 : see if this is a syslog.h system
20953 set syslog.h i_syslog
20957 : see if this is a sys/mode.h system
20958 set sys/mode.h i_sysmode
20961 : see if sys/resource.h has to be included
20962 set sys/resource.h i_sysresrc
20965 : see if sys/security.h is available
20966 set sys/security.h i_syssecrt
20969 : see if this is a sys/statvfs.h system
20970 set sys/statvfs.h i_sysstatvfs
20973 : see if this is a sys/un.h system
20974 set sys/un.h i_sysun
20978 : see if this is a sys/utsname.h system
20979 set sys/utsname.h i_sysutsname
20982 : see if this is a syswait system
20983 set sys/wait.h i_syswait
20986 : see if this is a ustat.h system
20987 set ustat.h i_ustat
20990 : see if this is an utime system
20991 set utime.h i_utime
20994 : see if this is a values.h system
20995 set values.h i_values
20998 : see if this is a vfork system
21001 set vfork.h i_vfork
21010 echo "Looking for extensions..." >&4
21011 : If we are using the old config.sh, known_extensions may contain
21012 : old or inaccurate or duplicate values.
21013 known_extensions=''
21014 nonxs_extensions=''
21015 : We do not use find because it might not be available.
21016 : We do not just use MANIFEST because the user may have dropped
21017 : some additional extensions into the source tree and expect them
21020 : Function to recursively find available extensions, ignoring DynaLoader
21021 : NOTE: recursion limit of 10 to prevent runaway in case of symlink madness
21025 DynaLoader|dynaload) ;;
21027 if $test -f $xxx/$xxx.xs -o -f $xxx/$xxx.c; then
21028 known_extensions="$known_extensions $1$xxx";
21029 elif $test -f $xxx/Makefile.PL; then
21030 nonxs_extensions="$nonxs_extensions $1$xxx";
21032 if $test -d $xxx -a $# -lt 10; then
21035 eval $find_extensions;
21047 eval $find_extensions
21048 # Special case: Add in threads/shared since it is not picked up by the
21049 # recursive find above (and adding in general recursive finding breaks
21050 # SDBM_File/sdbm). A.D. 10/25/2001.
21051 known_extensions="$known_extensions threads/shared"
21052 set X $known_extensions
21054 known_extensions="$*"
21055 # Ditto for IO/Compress/Base and IO/Compress/Zlib
21056 nonxs_extensions="$nonxs_extensions IO/Compress/Base IO/Compress/Zlib"
21057 set X $nonxs_extensions
21059 nonxs_extensions="$*"
21062 : Now see which are supported on this system.
21064 for xxx in $known_extensions ; do
21068 $define) avail_ext="$avail_ext $xxx" ;;
21071 GDBM_File|gdbm_fil)
21073 $define) avail_ext="$avail_ext $xxx" ;;
21076 I18N/Langinfo|i18n_lan)
21077 case "$i_langinfo$d_nl_langinfo" in
21078 $define$define) avail_ext="$avail_ext $xxx" ;;
21081 NDBM_File|ndbm_fil)
21084 case "$osname-$use64bitint" in
21087 *-lndbm*) avail_ext="$avail_ext $xxx" ;;
21090 *) avail_ext="$avail_ext $xxx" ;;
21095 ODBM_File|odbm_fil)
21096 case "${i_dbm}${i_rpcsvcdbm}" in
21098 case "$osname-$use64bitint" in
21101 *-ldbm*) avail_ext="$avail_ext $xxx" ;;
21104 *) avail_ext="$avail_ext $xxx" ;;
21110 case "$useposix" in
21111 true|define|y) avail_ext="$avail_ext $xxx" ;;
21115 case "$useopcode" in
21116 true|define|y) avail_ext="$avail_ext $xxx" ;;
21120 case "$d_socket" in
21123 beos) ;; # not unless BONE
21124 *) avail_ext="$avail_ext $xxx" ;;
21129 Sys/Syslog|sys/syslog)
21130 : XXX syslog requires socket
21131 case "$d_socket" in
21132 true|$define|y) avail_ext="$avail_ext $xxx" ;;
21136 case "$usethreads" in
21138 case "$useithreads" in
21139 $undef|false|[nN]*) avail_ext="$avail_ext $xxx" ;;
21145 cygwin) avail_ext="$avail_ext $xxx" ;;
21148 XS/APItest|xs/apitest)
21149 # This is just for testing. Skip it unless we have dynamic loading.
21152 $define) avail_ext="$avail_ext $xxx" ;;
21155 XS/Typemap|xs/typemap)
21156 # This is just for testing. Skip it unless we have dynamic loading.
21158 $define) avail_ext="$avail_ext $xxx" ;;
21161 threads|threads/shared)
21162 # threads and threads::shared are special cases.
21163 # To stop people from asking "Perl 5.8.0 was supposed
21164 # to have this new fancy threads implementation but my
21165 # perl doesn't have it" and from people trying to
21166 # (re)install the threads module using CPAN.pm and
21167 # CPAN.pm then offering to reinstall Perl 5.8.0,
21168 # the threads.pm and threads/shared.pm will always be
21169 # there, croaking informatively ("you need to rebuild
21170 # all of Perl with threads, sorry") when threads haven't
21171 # been compiled in.
21173 avail_ext="$avail_ext $xxx"
21176 : XXX Do we need a useipcsysv variable here
21177 case "${d_msg}${d_sem}${d_shm}" in
21178 *"${define}"*) avail_ext="$avail_ext $xxx" ;;
21181 *) avail_ext="$avail_ext $xxx"
21190 case "$onlyextensions" in
21192 *) keepextensions=''
21193 echo "You have requested that only certains extensions be included..." >&4
21194 for i in $onlyextensions; do
21195 case " $avail_ext " in
21197 echo "Keeping extension $i."
21198 keepextensions="$keepextensions $i"
21200 *) echo "Ignoring extension $i." ;;
21203 avail_ext="$keepextensions"
21207 case "$noextensions" in
21209 *) keepextensions=''
21210 echo "You have requested that certain extensions be ignored..." >&4
21211 for i in $avail_ext; do
21212 case " $noextensions " in
21213 *" $i "*) echo "Ignoring extension $i." ;;
21214 *) echo "Keeping extension $i.";
21215 keepextensions="$keepextensions $i"
21219 avail_ext="$keepextensions"
21223 : Now see which nonxs extensions are supported on this system.
21224 : For now assume all are.
21226 for xxx in $nonxs_extensions ; do
21228 *) nonxs_ext="$nonxs_ext $xxx"
21240 A number of extensions are supplied with $package. You may choose to
21241 compile these extensions for dynamic loading (the default), compile
21242 them into the $package executable (static loading), or not include
21243 them at all. Answer "none" to include no extensions.
21244 Note that DynaLoader is always built and need not be mentioned here.
21247 case "$dynamic_ext" in
21249 : Exclude those listed in static_ext
21251 for xxx in $avail_ext; do
21252 case " $static_ext " in
21254 *) dflt="$dflt $xxx" ;;
21261 *) dflt="$dynamic_ext"
21262 # Perhaps we are reusing an old out-of-date config.sh.
21265 if test X"$dynamic_ext" != X"$avail_ext"; then
21267 NOTICE: Your previous config.sh list may be incorrect.
21268 The extensions now available to you are
21270 but the default list from your previous config.sh is
21282 rp="What extensions do you wish to load dynamically?"
21285 none) dynamic_ext=' ' ;;
21286 *) dynamic_ext="$ans" ;;
21289 case "$static_ext" in
21291 : Exclude those already listed in dynamic linking
21293 for xxx in $avail_ext; do
21294 case " $dynamic_ext " in
21296 *) dflt="$dflt $xxx" ;;
21303 *) dflt="$static_ext"
21310 rp="What extensions do you wish to load statically?"
21313 none) static_ext=' ' ;;
21314 *) static_ext="$ans" ;;
21319 A number of extensions are supplied with $package. Answer "none"
21320 to include no extensions.
21321 Note that DynaLoader is always built and need not be mentioned here.
21324 case "$static_ext" in
21325 '') dflt="$avail_ext" ;;
21326 *) dflt="$static_ext"
21327 # Perhaps we are reusing an old out-of-date config.sh.
21330 if test X"$static_ext" != X"$avail_ext"; then
21332 NOTICE: Your previous config.sh list may be incorrect.
21333 The extensions now available to you are
21335 but the default list from your previous config.sh is
21344 : Exclude those that are not xs extensions
21348 rp="What extensions do you wish to include?"
21351 none) static_ext=' ' ;;
21352 *) static_ext="$ans" ;;
21357 # Encode is a special case. If we are building Encode as a static
21358 # extension, we need to explicitly list its subextensions as well.
21359 # For other nested extensions, this is handled automatically by
21360 # the appropriate Makefile.PL.
21361 case " $static_ext " in
21362 *" Encode "*) # Add the subextensions of Encode
21364 for xxx in `ls Encode/*/Makefile.PL|awk -F/ '{print $2}'`; do
21365 static_ext="$static_ext Encode/$xxx"
21371 set X $dynamic_ext $static_ext $nonxs_ext
21375 # Sanity check: We require an extension suitable for use with
21376 # AnyDBM_File, as well as Fcntl and IO. (Failure to have these
21377 # should show up as failures in the test suite, but it's helpful to
21378 # catch them now.) The 'extensions' list is normally sorted
21379 # alphabetically, so we need to accept either
21380 # DB_File ... Fcntl ... IO ....
21381 # or something like
21382 # Fcntl ... NDBM_File ... IO ....
21383 case " $extensions" in
21384 *"_File "*" Fcntl "*" IO "*) ;; # DB_File
21385 *" Fcntl "*"_File "*" IO "*) ;; # GDBM_File
21386 *" Fcntl "*" IO "*"_File "*) ;; # NDBM_File
21387 *) echo "WARNING: Extensions DB_File or *DBM_File, Fcntl, and IO not configured." >&4
21388 echo "WARNING: The Perl you are building will be quite crippled." >& 4
21392 : Remove libraries needed only for extensions
21393 : The appropriate ext/Foo/Makefile.PL will add them back in, if necessary.
21394 : The exception is SunOS 4.x, which needs them.
21395 case "${osname}X${osvers}" in
21399 *) case "$usedl" in
21400 $define|true|[yY]*)
21401 set X `echo " $libs " | sed -e 's@ -lndbm @ @' -e 's@ -lgdbm @ @' -e 's@ -ldbm @ @' -e 's@ -ldb @ @'`
21405 *) perllibs="$libs"
21411 : Remove build directory name from cppstdin so it can be used from
21412 : either the present location or the final installed location.
21414 : Get out of the UU directory to get correct path name.
21416 case "$cppstdin" in
21418 echo "Stripping down cppstdin path name"
21424 : end of configuration questions
21426 echo "End of configuration questions."
21429 : back to where it started
21430 if test -d ../UU; then
21434 : configuration may be patched via a 'config.arch' file
21435 if $test -f config.arch; then
21436 echo "I see a config.arch file, loading it."
21440 : configuration may be patched via a 'config.over' file
21441 if $test -f config.over; then
21444 rp='I see a config.over file. Do you wish to load it?'
21447 n*) echo "OK, I'll ignore it.";;
21449 echo "Configuration override changes have been loaded."
21454 : in case they want portability, strip down executable paths
21455 case "$d_portable" in
21458 echo "Stripping down executable paths..." >&4
21459 for file in $loclist $trylist; do
21461 eval $file=`basename $temp`
21466 : create config.sh file
21468 echo "Creating config.sh..." >&4
21469 $spitshell <<EOT >config.sh
21472 # This file was produced by running the Configure script. It holds all the
21473 # definitions figured out by Configure. Should you modify one of these values,
21474 # do not forget to propagate your changes by running "Configure -der". You may
21475 # instead choose to run each of the .SH files by yourself, or "Configure -S".
21478 # Package name : $package
21479 # Source directory : $src
21480 # Configuration time: $cf_time
21481 # Configured by : $cf_by
21482 # Target system : $myuname
21492 Revision='$Revision'
21500 alignbytes='$alignbytes'
21501 ansi2knr='$ansi2knr'
21502 aphostname='$aphostname'
21503 api_revision='$api_revision'
21504 api_subversion='$api_subversion'
21505 api_version='$api_version'
21506 api_versionstring='$api_versionstring'
21509 archlibexp='$archlibexp'
21510 archname64='$archname64'
21511 archname='$archname'
21512 archobjs='$archobjs'
21513 asctime_r_proto='$asctime_r_proto'
21521 byteorder='$byteorder'
21523 castflags='$castflags'
21526 cccdlflags='$cccdlflags'
21527 ccdlflags='$ccdlflags'
21529 ccflags_uselargefiles='$ccflags_uselargefiles'
21531 ccsymbols='$ccsymbols'
21532 ccversion='$ccversion'
21534 cf_email='$cf_email'
21536 charsize='$charsize'
21540 clocktype='$clocktype'
21542 compress='$compress'
21543 contains='$contains'
21547 cpp_stuff='$cpp_stuff'
21548 cppccsymbols='$cppccsymbols'
21549 cppflags='$cppflags'
21551 cppminus='$cppminus'
21553 cppstdin='$cppstdin'
21554 cppsymbols='$cppsymbols'
21555 crypt_r_proto='$crypt_r_proto'
21556 cryptlib='$cryptlib'
21558 ctermid_r_proto='$ctermid_r_proto'
21559 ctime_r_proto='$ctime_r_proto'
21560 d_Gconvert='$d_Gconvert'
21561 d_PRIEUldbl='$d_PRIEUldbl'
21562 d_PRIFUldbl='$d_PRIFUldbl'
21563 d_PRIGUldbl='$d_PRIGUldbl'
21564 d_PRIXU64='$d_PRIXU64'
21565 d_PRId64='$d_PRId64'
21566 d_PRIeldbl='$d_PRIeldbl'
21567 d_PRIfldbl='$d_PRIfldbl'
21568 d_PRIgldbl='$d_PRIgldbl'
21569 d_PRIi64='$d_PRIi64'
21570 d_PRIo64='$d_PRIo64'
21571 d_PRIu64='$d_PRIu64'
21572 d_PRIx64='$d_PRIx64'
21573 d_SCNfldbl='$d_SCNfldbl'
21574 d__fwalk='$d__fwalk'
21575 d_access='$d_access'
21576 d_accessx='$d_accessx'
21579 d_archlib='$d_archlib'
21580 d_asctime_r='$d_asctime_r'
21583 d_attribute_format='$d_attribute_format'
21584 d_attribute_malloc='$d_attribute_malloc'
21585 d_attribute_nonnull='$d_attribute_nonnull'
21586 d_attribute_noreturn='$d_attribute_noreturn'
21587 d_attribute_pure='$d_attribute_pure'
21588 d_attribute_unused='$d_attribute_unused'
21589 d_attribute_warn_unused_result='$d_attribute_warn_unused_result'
21593 d_bsdgetpgrp='$d_bsdgetpgrp'
21594 d_bsdsetpgrp='$d_bsdsetpgrp'
21595 d_builtin_choose_expr='$d_builtin_choose_expr'
21596 d_builtin_expect='$d_builtin_expect'
21598 d_c99_variadic_macros='$d_c99_variadic_macros'
21599 d_casti32='$d_casti32'
21600 d_castneg='$d_castneg'
21601 d_charvspr='$d_charvspr'
21603 d_chroot='$d_chroot'
21604 d_chsize='$d_chsize'
21606 d_clearenv='$d_clearenv'
21607 d_closedir='$d_closedir'
21608 d_cmsghdr_s='$d_cmsghdr_s'
21610 d_copysignl='$d_copysignl'
21611 d_cplusplus='$d_cplusplus'
21613 d_crypt_r='$d_crypt_r'
21615 d_ctermid='$d_ctermid'
21616 d_ctermid_r='$d_ctermid_r'
21617 d_ctime_r='$d_ctime_r'
21618 d_cuserid='$d_cuserid'
21619 d_dbl_dig='$d_dbl_dig'
21620 d_dbminitproto='$d_dbminitproto'
21621 d_difftime='$d_difftime'
21622 d_dir_dd_fd='$d_dir_dd_fd'
21624 d_dirnamlen='$d_dirnamlen'
21625 d_dlerror='$d_dlerror'
21626 d_dlopen='$d_dlopen'
21627 d_dlsymun='$d_dlsymun'
21628 d_dosuid='$d_dosuid'
21629 d_drand48_r='$d_drand48_r'
21630 d_drand48proto='$d_drand48proto'
21632 d_eaccess='$d_eaccess'
21633 d_endgrent='$d_endgrent'
21634 d_endgrent_r='$d_endgrent_r'
21635 d_endhent='$d_endhent'
21636 d_endhostent_r='$d_endhostent_r'
21637 d_endnent='$d_endnent'
21638 d_endnetent_r='$d_endnetent_r'
21639 d_endpent='$d_endpent'
21640 d_endprotoent_r='$d_endprotoent_r'
21641 d_endpwent='$d_endpwent'
21642 d_endpwent_r='$d_endpwent_r'
21643 d_endsent='$d_endsent'
21644 d_endservent_r='$d_endservent_r'
21645 d_eofnblk='$d_eofnblk'
21646 d_eunice='$d_eunice'
21647 d_faststdio='$d_faststdio'
21648 d_fchdir='$d_fchdir'
21649 d_fchmod='$d_fchmod'
21650 d_fchown='$d_fchown'
21652 d_fcntl_can_lock='$d_fcntl_can_lock'
21653 d_fd_macros='$d_fd_macros'
21654 d_fd_set='$d_fd_set'
21655 d_fds_bits='$d_fds_bits'
21656 d_fgetpos='$d_fgetpos'
21657 d_finite='$d_finite'
21658 d_finitel='$d_finitel'
21659 d_flexfnam='$d_flexfnam'
21661 d_flockproto='$d_flockproto'
21663 d_fp_class='$d_fp_class'
21664 d_fpathconf='$d_fpathconf'
21665 d_fpclass='$d_fpclass'
21666 d_fpclassify='$d_fpclassify'
21667 d_fpclassl='$d_fpclassl'
21668 d_fpos64_t='$d_fpos64_t'
21669 d_frexpl='$d_frexpl'
21670 d_fs_data_s='$d_fs_data_s'
21671 d_fseeko='$d_fseeko'
21672 d_fsetpos='$d_fsetpos'
21673 d_fstatfs='$d_fstatfs'
21674 d_fstatvfs='$d_fstatvfs'
21676 d_ftello='$d_ftello'
21678 d_futimes='$d_futimes'
21679 d_getcwd='$d_getcwd'
21680 d_getespwnam='$d_getespwnam'
21681 d_getfsstat='$d_getfsstat'
21682 d_getgrent='$d_getgrent'
21683 d_getgrent_r='$d_getgrent_r'
21684 d_getgrgid_r='$d_getgrgid_r'
21685 d_getgrnam_r='$d_getgrnam_r'
21686 d_getgrps='$d_getgrps'
21687 d_gethbyaddr='$d_gethbyaddr'
21688 d_gethbyname='$d_gethbyname'
21689 d_gethent='$d_gethent'
21690 d_gethname='$d_gethname'
21691 d_gethostbyaddr_r='$d_gethostbyaddr_r'
21692 d_gethostbyname_r='$d_gethostbyname_r'
21693 d_gethostent_r='$d_gethostent_r'
21694 d_gethostprotos='$d_gethostprotos'
21695 d_getitimer='$d_getitimer'
21696 d_getlogin='$d_getlogin'
21697 d_getlogin_r='$d_getlogin_r'
21698 d_getmnt='$d_getmnt'
21699 d_getmntent='$d_getmntent'
21700 d_getnbyaddr='$d_getnbyaddr'
21701 d_getnbyname='$d_getnbyname'
21702 d_getnent='$d_getnent'
21703 d_getnetbyaddr_r='$d_getnetbyaddr_r'
21704 d_getnetbyname_r='$d_getnetbyname_r'
21705 d_getnetent_r='$d_getnetent_r'
21706 d_getnetprotos='$d_getnetprotos'
21707 d_getpagsz='$d_getpagsz'
21708 d_getpbyname='$d_getpbyname'
21709 d_getpbynumber='$d_getpbynumber'
21710 d_getpent='$d_getpent'
21711 d_getpgid='$d_getpgid'
21712 d_getpgrp2='$d_getpgrp2'
21713 d_getpgrp='$d_getpgrp'
21714 d_getppid='$d_getppid'
21715 d_getprior='$d_getprior'
21716 d_getprotobyname_r='$d_getprotobyname_r'
21717 d_getprotobynumber_r='$d_getprotobynumber_r'
21718 d_getprotoent_r='$d_getprotoent_r'
21719 d_getprotoprotos='$d_getprotoprotos'
21720 d_getprpwnam='$d_getprpwnam'
21721 d_getpwent='$d_getpwent'
21722 d_getpwent_r='$d_getpwent_r'
21723 d_getpwnam_r='$d_getpwnam_r'
21724 d_getpwuid_r='$d_getpwuid_r'
21725 d_getsbyname='$d_getsbyname'
21726 d_getsbyport='$d_getsbyport'
21727 d_getsent='$d_getsent'
21728 d_getservbyname_r='$d_getservbyname_r'
21729 d_getservbyport_r='$d_getservbyport_r'
21730 d_getservent_r='$d_getservent_r'
21731 d_getservprotos='$d_getservprotos'
21732 d_getspnam='$d_getspnam'
21733 d_getspnam_r='$d_getspnam_r'
21734 d_gettimeod='$d_gettimeod'
21735 d_gmtime_r='$d_gmtime_r'
21736 d_gnulibc='$d_gnulibc'
21737 d_grpasswd='$d_grpasswd'
21738 d_hasmntopt='$d_hasmntopt'
21740 d_ilogbl='$d_ilogbl'
21741 d_inc_version_list='$d_inc_version_list'
21743 d_inetaton='$d_inetaton'
21744 d_int64_t='$d_int64_t'
21745 d_isascii='$d_isascii'
21746 d_isfinite='$d_isfinite'
21749 d_isnanl='$d_isnanl'
21750 d_killpg='$d_killpg'
21751 d_lchown='$d_lchown'
21752 d_ldbl_dig='$d_ldbl_dig'
21753 d_libm_lib_version='$d_libm_lib_version'
21755 d_localtime_r='$d_localtime_r'
21756 d_localtime_r_needs_tzset='$d_localtime_r_needs_tzset'
21757 d_locconv='$d_locconv'
21759 d_longdbl='$d_longdbl'
21760 d_longlong='$d_longlong'
21761 d_lseekproto='$d_lseekproto'
21763 d_madvise='$d_madvise'
21764 d_malloc_good_size='$d_malloc_good_size'
21765 d_malloc_size='$d_malloc_size'
21767 d_mbstowcs='$d_mbstowcs'
21768 d_mbtowc='$d_mbtowc'
21769 d_memchr='$d_memchr'
21770 d_memcmp='$d_memcmp'
21771 d_memcpy='$d_memcpy'
21772 d_memmove='$d_memmove'
21773 d_memset='$d_memset'
21775 d_mkdtemp='$d_mkdtemp'
21776 d_mkfifo='$d_mkfifo'
21777 d_mkstemp='$d_mkstemp'
21778 d_mkstemps='$d_mkstemps'
21779 d_mktime='$d_mktime'
21782 d_modfl_pow32_bug='$d_modfl_pow32_bug'
21783 d_modflproto='$d_modflproto'
21784 d_mprotect='$d_mprotect'
21786 d_msg_ctrunc='$d_msg_ctrunc'
21787 d_msg_dontroute='$d_msg_dontroute'
21788 d_msg_oob='$d_msg_oob'
21789 d_msg_peek='$d_msg_peek'
21790 d_msg_proxy='$d_msg_proxy'
21791 d_msgctl='$d_msgctl'
21792 d_msgget='$d_msgget'
21793 d_msghdr_s='$d_msghdr_s'
21794 d_msgrcv='$d_msgrcv'
21795 d_msgsnd='$d_msgsnd'
21797 d_munmap='$d_munmap'
21798 d_mymalloc='$d_mymalloc'
21800 d_nl_langinfo='$d_nl_langinfo'
21801 d_nv_preserves_uv='$d_nv_preserves_uv'
21802 d_nv_zero_is_allbits_zero='$d_nv_zero_is_allbits_zero'
21803 d_off64_t='$d_off64_t'
21804 d_old_pthread_create_joinable='$d_old_pthread_create_joinable'
21805 d_oldpthreads='$d_oldpthreads'
21806 d_oldsock='$d_oldsock'
21808 d_pathconf='$d_pathconf'
21810 d_perl_otherlibdirs='$d_perl_otherlibdirs'
21811 d_phostname='$d_phostname'
21814 d_portable='$d_portable'
21815 d_printf_format_null='$d_printf_format_null'
21816 d_procselfexe='$d_procselfexe'
21817 d_pseudofork='$d_pseudofork'
21818 d_pthread_atfork='$d_pthread_atfork'
21819 d_pthread_attr_setscope='$d_pthread_attr_setscope'
21820 d_pthread_yield='$d_pthread_yield'
21822 d_pwchange='$d_pwchange'
21823 d_pwclass='$d_pwclass'
21824 d_pwcomment='$d_pwcomment'
21825 d_pwexpire='$d_pwexpire'
21826 d_pwgecos='$d_pwgecos'
21827 d_pwpasswd='$d_pwpasswd'
21828 d_pwquota='$d_pwquota'
21831 d_random_r='$d_random_r'
21832 d_readdir64_r='$d_readdir64_r'
21833 d_readdir='$d_readdir'
21834 d_readdir_r='$d_readdir_r'
21835 d_readlink='$d_readlink'
21837 d_recvmsg='$d_recvmsg'
21838 d_rename='$d_rename'
21839 d_rewinddir='$d_rewinddir'
21841 d_safebcpy='$d_safebcpy'
21842 d_safemcpy='$d_safemcpy'
21843 d_sanemcmp='$d_sanemcmp'
21844 d_sbrkproto='$d_sbrkproto'
21845 d_scalbnl='$d_scalbnl'
21846 d_sched_yield='$d_sched_yield'
21847 d_scm_rights='$d_scm_rights'
21848 d_seekdir='$d_seekdir'
21849 d_select='$d_select'
21851 d_semctl='$d_semctl'
21852 d_semctl_semid_ds='$d_semctl_semid_ds'
21853 d_semctl_semun='$d_semctl_semun'
21854 d_semget='$d_semget'
21856 d_sendmsg='$d_sendmsg'
21857 d_setegid='$d_setegid'
21858 d_seteuid='$d_seteuid'
21859 d_setgrent='$d_setgrent'
21860 d_setgrent_r='$d_setgrent_r'
21861 d_setgrps='$d_setgrps'
21862 d_sethent='$d_sethent'
21863 d_sethostent_r='$d_sethostent_r'
21864 d_setitimer='$d_setitimer'
21865 d_setlinebuf='$d_setlinebuf'
21866 d_setlocale='$d_setlocale'
21867 d_setlocale_r='$d_setlocale_r'
21868 d_setnent='$d_setnent'
21869 d_setnetent_r='$d_setnetent_r'
21870 d_setpent='$d_setpent'
21871 d_setpgid='$d_setpgid'
21872 d_setpgrp2='$d_setpgrp2'
21873 d_setpgrp='$d_setpgrp'
21874 d_setprior='$d_setprior'
21875 d_setproctitle='$d_setproctitle'
21876 d_setprotoent_r='$d_setprotoent_r'
21877 d_setpwent='$d_setpwent'
21878 d_setpwent_r='$d_setpwent_r'
21879 d_setregid='$d_setregid'
21880 d_setresgid='$d_setresgid'
21881 d_setresuid='$d_setresuid'
21882 d_setreuid='$d_setreuid'
21883 d_setrgid='$d_setrgid'
21884 d_setruid='$d_setruid'
21885 d_setsent='$d_setsent'
21886 d_setservent_r='$d_setservent_r'
21887 d_setsid='$d_setsid'
21888 d_setvbuf='$d_setvbuf'
21892 d_shmatprototype='$d_shmatprototype'
21893 d_shmctl='$d_shmctl'
21895 d_shmget='$d_shmget'
21896 d_sigaction='$d_sigaction'
21897 d_signbit='$d_signbit'
21898 d_sigprocmask='$d_sigprocmask'
21899 d_sigsetjmp='$d_sigsetjmp'
21900 d_sitearch='$d_sitearch'
21901 d_snprintf='$d_snprintf'
21902 d_sockatmark='$d_sockatmark'
21903 d_sockatmarkproto='$d_sockatmarkproto'
21904 d_socket='$d_socket'
21905 d_socklen_t='$d_socklen_t'
21906 d_sockpair='$d_sockpair'
21907 d_socks5_init='$d_socks5_init'
21908 d_sprintf_returns_strlen='$d_sprintf_returns_strlen'
21910 d_srand48_r='$d_srand48_r'
21911 d_srandom_r='$d_srandom_r'
21912 d_sresgproto='$d_sresgproto'
21913 d_sresuproto='$d_sresuproto'
21914 d_statblks='$d_statblks'
21915 d_statfs_f_flags='$d_statfs_f_flags'
21916 d_statfs_s='$d_statfs_s'
21917 d_statvfs='$d_statvfs'
21918 d_stdio_cnt_lval='$d_stdio_cnt_lval'
21919 d_stdio_ptr_lval='$d_stdio_ptr_lval'
21920 d_stdio_ptr_lval_nochange_cnt='$d_stdio_ptr_lval_nochange_cnt'
21921 d_stdio_ptr_lval_sets_cnt='$d_stdio_ptr_lval_sets_cnt'
21922 d_stdio_stream_array='$d_stdio_stream_array'
21923 d_stdiobase='$d_stdiobase'
21924 d_stdstdio='$d_stdstdio'
21925 d_strchr='$d_strchr'
21926 d_strcoll='$d_strcoll'
21927 d_strctcpy='$d_strctcpy'
21928 d_strerrm='$d_strerrm'
21929 d_strerror='$d_strerror'
21930 d_strerror_r='$d_strerror_r'
21931 d_strftime='$d_strftime'
21932 d_strlcat='$d_strlcat'
21933 d_strlcpy='$d_strlcpy'
21934 d_strtod='$d_strtod'
21935 d_strtol='$d_strtol'
21936 d_strtold='$d_strtold'
21937 d_strtoll='$d_strtoll'
21938 d_strtoq='$d_strtoq'
21939 d_strtoul='$d_strtoul'
21940 d_strtoull='$d_strtoull'
21941 d_strtouq='$d_strtouq'
21942 d_strxfrm='$d_strxfrm'
21943 d_suidsafe='$d_suidsafe'
21944 d_symlink='$d_symlink'
21945 d_syscall='$d_syscall'
21946 d_syscallproto='$d_syscallproto'
21947 d_sysconf='$d_sysconf'
21948 d_sysernlst='$d_sysernlst'
21949 d_syserrlst='$d_syserrlst'
21950 d_system='$d_system'
21951 d_tcgetpgrp='$d_tcgetpgrp'
21952 d_tcsetpgrp='$d_tcsetpgrp'
21953 d_telldir='$d_telldir'
21954 d_telldirproto='$d_telldirproto'
21957 d_tm_tm_gmtoff='$d_tm_tm_gmtoff'
21958 d_tm_tm_zone='$d_tm_tm_zone'
21959 d_tmpnam_r='$d_tmpnam_r'
21960 d_truncate='$d_truncate'
21961 d_ttyname_r='$d_ttyname_r'
21962 d_tzname='$d_tzname'
21963 d_u32align='$d_u32align'
21964 d_ualarm='$d_ualarm'
21967 d_union_semun='$d_union_semun'
21968 d_unordered='$d_unordered'
21969 d_unsetenv='$d_unsetenv'
21970 d_usleep='$d_usleep'
21971 d_usleepproto='$d_usleepproto'
21973 d_vendorarch='$d_vendorarch'
21974 d_vendorbin='$d_vendorbin'
21975 d_vendorlib='$d_vendorlib'
21976 d_vendorscript='$d_vendorscript'
21978 d_void_closedir='$d_void_closedir'
21979 d_voidsig='$d_voidsig'
21980 d_voidtty='$d_voidtty'
21981 d_volatile='$d_volatile'
21982 d_vprintf='$d_vprintf'
21983 d_vsnprintf='$d_vsnprintf'
21985 d_waitpid='$d_waitpid'
21986 d_wcstombs='$d_wcstombs'
21987 d_wctomb='$d_wctomb'
21988 d_writev='$d_writev'
21991 db_hashtype='$db_hashtype'
21992 db_prefixtype='$db_prefixtype'
21993 db_version_major='$db_version_major'
21994 db_version_minor='$db_version_minor'
21995 db_version_patch='$db_version_patch'
21996 defvoidused='$defvoidused'
21997 direntrytype='$direntrytype'
22000 doublesize='$doublesize'
22002 drand48_r_proto='$drand48_r_proto'
22003 dynamic_ext='$dynamic_ext'
22009 endgrent_r_proto='$endgrent_r_proto'
22010 endhostent_r_proto='$endhostent_r_proto'
22011 endnetent_r_proto='$endnetent_r_proto'
22012 endprotoent_r_proto='$endprotoent_r_proto'
22013 endpwent_r_proto='$endpwent_r_proto'
22014 endservent_r_proto='$endservent_r_proto'
22015 eunicefix='$eunicefix'
22018 extensions='$extensions'
22020 fflushNULL='$fflushNULL'
22021 fflushall='$fflushall'
22023 firstmakefile='$firstmakefile'
22025 fpossize='$fpossize'
22026 fpostype='$fpostype'
22027 freetype='$freetype'
22030 full_csh='$full_csh'
22031 full_sed='$full_sed'
22032 gccansipedantic='$gccansipedantic'
22033 gccosandvers='$gccosandvers'
22034 gccversion='$gccversion'
22035 getgrent_r_proto='$getgrent_r_proto'
22036 getgrgid_r_proto='$getgrgid_r_proto'
22037 getgrnam_r_proto='$getgrnam_r_proto'
22038 gethostbyaddr_r_proto='$gethostbyaddr_r_proto'
22039 gethostbyname_r_proto='$gethostbyname_r_proto'
22040 gethostent_r_proto='$gethostent_r_proto'
22041 getlogin_r_proto='$getlogin_r_proto'
22042 getnetbyaddr_r_proto='$getnetbyaddr_r_proto'
22043 getnetbyname_r_proto='$getnetbyname_r_proto'
22044 getnetent_r_proto='$getnetent_r_proto'
22045 getprotobyname_r_proto='$getprotobyname_r_proto'
22046 getprotobynumber_r_proto='$getprotobynumber_r_proto'
22047 getprotoent_r_proto='$getprotoent_r_proto'
22048 getpwent_r_proto='$getpwent_r_proto'
22049 getpwnam_r_proto='$getpwnam_r_proto'
22050 getpwuid_r_proto='$getpwuid_r_proto'
22051 getservbyname_r_proto='$getservbyname_r_proto'
22052 getservbyport_r_proto='$getservbyport_r_proto'
22053 getservent_r_proto='$getservent_r_proto'
22054 getspnam_r_proto='$getspnam_r_proto'
22055 gidformat='$gidformat'
22061 gmtime_r_proto='$gmtime_r_proto'
22062 gnulibc_version='$gnulibc_version'
22064 groupcat='$groupcat'
22065 groupstype='$groupstype'
22068 h_sysfile='$h_sysfile'
22071 html1dir='$html1dir'
22072 html1direxp='$html1direxp'
22073 html3dir='$html3dir'
22074 html3direxp='$html3direxp'
22083 i_arpainet='$i_arpainet'
22084 i_bsdioctl='$i_bsdioctl'
22088 i_dirent='$i_dirent'
22094 i_fp_class='$i_fp_class'
22097 i_ieeefp='$i_ieeefp'
22098 i_inttypes='$i_inttypes'
22099 i_langinfo='$i_langinfo'
22100 i_libutil='$i_libutil'
22101 i_limits='$i_limits'
22102 i_locale='$i_locale'
22103 i_machcthr='$i_machcthr'
22104 i_malloc='$i_malloc'
22106 i_memory='$i_memory'
22107 i_mntent='$i_mntent'
22110 i_neterrno='$i_neterrno'
22111 i_netinettcp='$i_netinettcp'
22115 i_pthread='$i_pthread'
22117 i_rpcsvcdbm='$i_rpcsvcdbm'
22120 i_shadow='$i_shadow'
22122 i_stdarg='$i_stdarg'
22123 i_stddef='$i_stddef'
22124 i_stdlib='$i_stdlib'
22125 i_string='$i_string'
22126 i_sunmath='$i_sunmath'
22127 i_sysaccess='$i_sysaccess'
22128 i_sysdir='$i_sysdir'
22129 i_sysfile='$i_sysfile'
22130 i_sysfilio='$i_sysfilio'
22132 i_sysioctl='$i_sysioctl'
22133 i_syslog='$i_syslog'
22134 i_sysmman='$i_sysmman'
22135 i_sysmode='$i_sysmode'
22136 i_sysmount='$i_sysmount'
22137 i_sysndir='$i_sysndir'
22138 i_sysparam='$i_sysparam'
22139 i_sysresrc='$i_sysresrc'
22140 i_syssecrt='$i_syssecrt'
22141 i_sysselct='$i_sysselct'
22142 i_syssockio='$i_syssockio'
22143 i_sysstat='$i_sysstat'
22144 i_sysstatfs='$i_sysstatfs'
22145 i_sysstatvfs='$i_sysstatvfs'
22146 i_systime='$i_systime'
22147 i_systimek='$i_systimek'
22148 i_systimes='$i_systimes'
22149 i_systypes='$i_systypes'
22150 i_sysuio='$i_sysuio'
22152 i_sysutsname='$i_sysutsname'
22153 i_sysvfs='$i_sysvfs'
22154 i_syswait='$i_syswait'
22155 i_termio='$i_termio'
22156 i_termios='$i_termios'
22158 i_unistd='$i_unistd'
22161 i_values='$i_values'
22162 i_varargs='$i_varargs'
22163 i_varhdr='$i_varhdr'
22165 ignore_versioned_solibs='$ignore_versioned_solibs'
22166 inc_version_list='$inc_version_list'
22167 inc_version_list_init='$inc_version_list_init'
22170 initialinstalllocation='$initialinstalllocation'
22171 installarchlib='$installarchlib'
22172 installbin='$installbin'
22173 installhtml1dir='$installhtml1dir'
22174 installhtml3dir='$installhtml3dir'
22175 installman1dir='$installman1dir'
22176 installman3dir='$installman3dir'
22177 installprefix='$installprefix'
22178 installprefixexp='$installprefixexp'
22179 installprivlib='$installprivlib'
22180 installscript='$installscript'
22181 installsitearch='$installsitearch'
22182 installsitebin='$installsitebin'
22183 installsitehtml1dir='$installsitehtml1dir'
22184 installsitehtml3dir='$installsitehtml3dir'
22185 installsitelib='$installsitelib'
22186 installsiteman1dir='$installsiteman1dir'
22187 installsiteman3dir='$installsiteman3dir'
22188 installsitescript='$installsitescript'
22189 installstyle='$installstyle'
22190 installusrbinperl='$installusrbinperl'
22191 installvendorarch='$installvendorarch'
22192 installvendorbin='$installvendorbin'
22193 installvendorhtml1dir='$installvendorhtml1dir'
22194 installvendorhtml3dir='$installvendorhtml3dir'
22195 installvendorlib='$installvendorlib'
22196 installvendorman1dir='$installvendorman1dir'
22197 installvendorman3dir='$installvendorman3dir'
22198 installvendorscript='$installvendorscript'
22200 issymlink='$issymlink'
22201 ivdformat='$ivdformat'
22204 known_extensions='$known_extensions'
22207 lddlflags='$lddlflags'
22209 ldflags_uselargefiles='$ldflags_uselargefiles'
22210 ldlibpthname='$ldlibpthname'
22217 libsdirs='$libsdirs'
22218 libsfiles='$libsfiles'
22219 libsfound='$libsfound'
22220 libspath='$libspath'
22221 libswanted='$libswanted'
22222 libswanted_uselargefiles='$libswanted_uselargefiles'
22228 localtime_r_proto='$localtime_r_proto'
22229 locincpth='$locincpth'
22230 loclibpth='$loclibpth'
22231 longdblsize='$longdblsize'
22232 longlongsize='$longlongsize'
22233 longsize='$longsize'
22237 lseeksize='$lseeksize'
22238 lseektype='$lseektype'
22241 madlyobj='$madlyobj'
22242 madlysrc='$madlysrc'
22246 make_set_make='$make_set_make'
22247 mallocobj='$mallocobj'
22248 mallocsrc='$mallocsrc'
22249 malloctype='$malloctype'
22251 man1direxp='$man1direxp'
22254 man3direxp='$man3direxp'
22256 mips_type='$mips_type'
22257 mistrustnm='$mistrustnm'
22259 mmaptype='$mmaptype'
22260 modetype='$modetype'
22262 multiarch='$multiarch'
22264 myarchname='$myarchname'
22265 mydomain='$mydomain'
22266 myhostname='$myhostname'
22269 need_va_copy='$need_va_copy'
22270 netdb_hlen_type='$netdb_hlen_type'
22271 netdb_host_type='$netdb_host_type'
22272 netdb_name_type='$netdb_name_type'
22273 netdb_net_type='$netdb_net_type'
22276 nm_so_opt='$nm_so_opt'
22277 nonxs_ext='$nonxs_ext'
22279 nvEUformat='$nvEUformat'
22280 nvFUformat='$nvFUformat'
22281 nvGUformat='$nvGUformat'
22282 nv_preserves_uv_bits='$nv_preserves_uv_bits'
22283 nveformat='$nveformat'
22284 nvfformat='$nvfformat'
22285 nvgformat='$nvgformat'
22288 o_nonblock='$o_nonblock'
22290 old_pthread_create_joinable='$old_pthread_create_joinable'
22291 optimize='$optimize'
22292 orderlib='$orderlib'
22295 otherlibdirs='$otherlibdirs'
22299 patchlevel='$patchlevel'
22300 path_sep='$path_sep'
22303 perl_patchlevel='$perl_patchlevel'
22304 perladmin='$perladmin'
22305 perllibs='$perllibs'
22306 perlpath='$perlpath'
22308 phostname='$phostname'
22314 prefixexp='$prefixexp'
22316 privlibexp='$privlibexp'
22317 procselfexe='$procselfexe'
22318 prototype='$prototype'
22320 quadkind='$quadkind'
22321 quadtype='$quadtype'
22322 randbits='$randbits'
22323 randfunc='$randfunc'
22324 random_r_proto='$random_r_proto'
22325 randseedtype='$randseedtype'
22327 rd_nodata='$rd_nodata'
22328 readdir64_r_proto='$readdir64_r_proto'
22329 readdir_r_proto='$readdir_r_proto'
22330 revision='$revision'
22336 sPRIEUldbl='$sPRIEUldbl'
22337 sPRIFUldbl='$sPRIFUldbl'
22338 sPRIGUldbl='$sPRIGUldbl'
22339 sPRIXU64='$sPRIXU64'
22341 sPRIeldbl='$sPRIeldbl'
22342 sPRIfldbl='$sPRIfldbl'
22343 sPRIgldbl='$sPRIgldbl'
22348 sSCNfldbl='$sSCNfldbl'
22349 sched_yield='$sched_yield'
22350 scriptdir='$scriptdir'
22351 scriptdirexp='$scriptdirexp'
22353 seedfunc='$seedfunc'
22354 selectminbits='$selectminbits'
22355 selecttype='$selecttype'
22356 sendmail='$sendmail'
22357 setgrent_r_proto='$setgrent_r_proto'
22358 sethostent_r_proto='$sethostent_r_proto'
22359 setlocale_r_proto='$setlocale_r_proto'
22360 setnetent_r_proto='$setnetent_r_proto'
22361 setprotoent_r_proto='$setprotoent_r_proto'
22362 setpwent_r_proto='$setpwent_r_proto'
22363 setservent_r_proto='$setservent_r_proto'
22366 sharpbang='$sharpbang'
22367 shmattype='$shmattype'
22368 shortsize='$shortsize'
22371 sig_count='$sig_count'
22372 sig_name='$sig_name'
22373 sig_name_init='$sig_name_init'
22375 sig_num_init='$sig_num_init'
22376 sig_size='$sig_size'
22377 signal_t='$signal_t'
22378 sitearch='$sitearch'
22379 sitearchexp='$sitearchexp'
22381 sitebinexp='$sitebinexp'
22382 sitehtml1dir='$sitehtml1dir'
22383 sitehtml1direxp='$sitehtml1direxp'
22384 sitehtml3dir='$sitehtml3dir'
22385 sitehtml3direxp='$sitehtml3direxp'
22387 sitelib_stem='$sitelib_stem'
22388 sitelibexp='$sitelibexp'
22389 siteman1dir='$siteman1dir'
22390 siteman1direxp='$siteman1direxp'
22391 siteman3dir='$siteman3dir'
22392 siteman3direxp='$siteman3direxp'
22393 siteprefix='$siteprefix'
22394 siteprefixexp='$siteprefixexp'
22395 sitescript='$sitescript'
22396 sitescriptexp='$sitescriptexp'
22397 sizesize='$sizesize'
22398 sizetype='$sizetype'
22402 sockethdr='$sockethdr'
22403 socketlib='$socketlib'
22404 socksizetype='$socksizetype'
22406 spackage='$spackage'
22407 spitshell='$spitshell'
22408 srand48_r_proto='$srand48_r_proto'
22409 srandom_r_proto='$srandom_r_proto'
22411 ssizetype='$ssizetype'
22412 startperl='$startperl'
22414 static_ext='$static_ext'
22416 stdio_base='$stdio_base'
22417 stdio_bufsiz='$stdio_bufsiz'
22418 stdio_cnt='$stdio_cnt'
22419 stdio_filbuf='$stdio_filbuf'
22420 stdio_ptr='$stdio_ptr'
22421 stdio_stream_array='$stdio_stream_array'
22422 strerror_r_proto='$strerror_r_proto'
22425 subversion='$subversion'
22429 targetarch='$targetarch'
22433 timeincl='$timeincl'
22434 timetype='$timetype'
22435 tmpnam_r_proto='$tmpnam_r_proto'
22441 ttyname_r_proto='$ttyname_r_proto'
22450 uidformat='$uidformat'
22456 uquadtype='$uquadtype'
22457 use5005threads='$use5005threads'
22458 use64bitall='$use64bitall'
22459 use64bitint='$use64bitint'
22460 usecrosscompile='$usecrosscompile'
22462 usefaststdio='$usefaststdio'
22463 useithreads='$useithreads'
22464 uselargefiles='$uselargefiles'
22465 uselongdouble='$uselongdouble'
22466 usemallocwrap='$usemallocwrap'
22467 usemorebits='$usemorebits'
22468 usemultiplicity='$usemultiplicity'
22469 usemymalloc='$usemymalloc'
22471 useopcode='$useopcode'
22472 useperlio='$useperlio'
22473 useposix='$useposix'
22474 usereentrant='$usereentrant'
22475 userelocatableinc='$userelocatableinc'
22477 useshrplib='$useshrplib'
22478 usesitecustomize='$usesitecustomize'
22479 usesocks='$usesocks'
22480 usethreads='$usethreads'
22481 usevendorprefix='$usevendorprefix'
22482 usevfork='$usevfork'
22485 uvXUformat='$uvXUformat'
22486 uvoformat='$uvoformat'
22489 uvuformat='$uvuformat'
22490 uvxformat='$uvxformat'
22491 vendorarch='$vendorarch'
22492 vendorarchexp='$vendorarchexp'
22493 vendorbin='$vendorbin'
22494 vendorbinexp='$vendorbinexp'
22495 vendorhtml1dir='$vendorhtml1dir'
22496 vendorhtml1direxp='$vendorhtml1direxp'
22497 vendorhtml3dir='$vendorhtml3dir'
22498 vendorhtml3direxp='$vendorhtml3direxp'
22499 vendorlib='$vendorlib'
22500 vendorlib_stem='$vendorlib_stem'
22501 vendorlibexp='$vendorlibexp'
22502 vendorman1dir='$vendorman1dir'
22503 vendorman1direxp='$vendorman1direxp'
22504 vendorman3dir='$vendorman3dir'
22505 vendorman3direxp='$vendorman3direxp'
22506 vendorprefix='$vendorprefix'
22507 vendorprefixexp='$vendorprefixexp'
22508 vendorscript='$vendorscript'
22509 vendorscriptexp='$vendorscriptexp'
22511 version_patchlevel_string='$version_patchlevel_string'
22512 versiononly='$versiononly'
22514 voidflags='$voidflags'
22517 yaccflags='$yaccflags'
22522 : Add in command line options if available
22523 $test -f UU/cmdline.opt && $cat UU/cmdline.opt >> config.sh
22525 : add special variables
22526 $test -f $src/patchlevel.h && \
22527 awk '/^#define[ ]+PERL_/ {printf "%s=%s\n",$2,$3}' $src/patchlevel.h >>config.sh
22528 echo "PERL_PATCHLEVEL=$perl_patchlevel" >>config.sh
22529 echo "PERL_CONFIG_SH=true" >>config.sh
22531 : propagate old symbols
22532 if $test -f UU/config.sh; then
22533 <UU/config.sh $sort | $uniq >UU/oldconfig.sh
22534 sed -n 's/^\([a-zA-Z_0-9]*\)=.*/\1/p' config.sh config.sh UU/oldconfig.sh |\
22535 $sort | $uniq -u >UU/oldsyms
22536 set X `cat UU/oldsyms`
22542 Hmm...You had some extra variables I don't know about...I'll try to keep 'em...
22544 echo "# Variables propagated from previous config.sh file." >>config.sh
22545 for sym in `cat UU/oldsyms`; do
22546 echo " Propagating $hint variable "'$'"$sym..."
22547 eval 'tmp="$'"${sym}"'"'
22549 sed -e "s/'/'\"'\"'/g" -e "s/^/$sym='/" -e "s/$/'/" >>config.sh
22555 : Finish up by extracting the .SH files
22559 echo "Extraction done."
22569 If you'd like to make any changes to the config.sh file before I begin
22570 to configure things, do it as a shell escape now (e.g. !vi config.sh).
22573 rp="Press return or use a shell escape to edit config.sh:"
22578 *) : in case they cannot read
22579 sh 1>&4 -c "$ans";;
22584 : if this fails, just run all the .SH files by hand
22593 if $contains '^depend:' [Mm]akefile >/dev/null 2>&1; then
22600 Now you need to generate make dependencies by running "$make depend".
22601 You might prefer to run it in background: "$make depend > makedepend.out &"
22602 It can take a while, so you might not want to run it right now.
22607 rp="Run $make depend now?"
22611 $make depend && echo "Now you must run '$make'."
22614 echo "You must run '$make depend' then '$make'."
22617 elif test -f [Mm]akefile; then
22619 echo "Now you must run a $make."
22621 echo "Configure done."
22624 if $test -f Policy.sh; then
22627 If you compile $package on a different machine or from a different object
22628 directory, copy the Policy.sh file from this object directory to the
22629 new one before you run Configure -- this will help you with most of
22630 the policy defaults.
22634 if $test -f config.msg; then
22635 echo "Hmm. I also noted the following information while running:"
22637 $cat config.msg >&4
22640 $rm -f kit*isdone ark*isdone