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 Tue Jan 2 08:13:58 CET 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
334 initialinstalllocation=''
362 d_attribute_format=''
363 d_attribute_malloc=''
364 d_attribute_nonnull=''
365 d_attribute_noreturn=''
367 d_attribute_unused=''
368 d_attribute_warn_unused_result=''
369 d_printf_format_null=''
372 d_builtin_choose_expr=''
375 d_c99_variadic_macros=''
422 endhostent_r_proto=''
428 endprotoent_r_proto=''
434 endservent_r_proto=''
486 gethostbyaddr_r_proto=''
488 gethostbyname_r_proto=''
490 gethostent_r_proto=''
502 getnetbyaddr_r_proto=''
504 getnetbyname_r_proto=''
518 d_getprotobyname_r=''
519 getprotobyname_r_proto=''
520 d_getprotobynumber_r=''
521 getprotobynumber_r_proto=''
523 getprotoent_r_proto=''
535 getservbyname_r_proto=''
537 getservbyport_r_proto=''
539 getservent_r_proto=''
563 d_libm_lib_version=''
566 d_localtime_r_needs_tzset=''
577 d_malloc_good_size=''
619 d_old_pthread_create_joinable=''
620 old_pthread_create_joinable=''
622 d_pthread_attr_setscope=''
661 sethostent_r_proto=''
678 setprotoent_r_proto=''
690 setservent_r_proto=''
723 d_sprintf_returns_strlen=''
738 d_stdio_ptr_lval_nochange_cnt=''
739 d_stdio_ptr_lval_sets_cnt=''
943 d_inc_version_list=''
945 inc_version_list_init=''
964 ignore_versioned_solibs=''
1028 d_perl_otherlibdirs=''
1036 api_versionstring=''
1042 version_patchlevel_string=''
1046 d_nv_preserves_uv=''
1047 d_nv_zero_is_allbits_zero=''
1058 nv_preserves_uv_bits=''
1130 installsitehtml1dir=''
1133 installsitehtml3dir=''
1140 installsiteman1dir=''
1143 installsiteman3dir=''
1148 installsitescript=''
1163 d_stdio_stream_array=''
1164 stdio_stream_array=''
1175 ccflags_uselargefiles=''
1176 ldflags_uselargefiles=''
1177 libswanted_uselargefiles=''
1197 installvendorarch=''
1204 installvendorhtml1dir=''
1206 vendorhtml1direxp=''
1207 installvendorhtml3dir=''
1209 vendorhtml3direxp=''
1215 installvendorman1dir=''
1218 installvendorman3dir=''
1225 installvendorscript=''
1237 smallmach='pdp11 i8086 z8000 i80286 iAPX286'
1240 : We must find out about Eunice early
1242 if test -f /etc/unixtovms; then
1243 eunicefix=/etc/unixtovms
1245 if test -f /etc/unixtovms.exe; then
1246 eunicefix=/etc/unixtovms.exe
1249 : Set executable suffix now -- needed before hints available
1250 if test -f "/libs/version.library"; then
1253 elif test -f "/system/gnu_library/bin/ar.pm"; then
1256 elif test -n "$DJGPP"; then
1259 elif test -d c:/. -o -n "$is_os2" ; then
1268 : set useposix=false in your hint file to disable the POSIX extension.
1270 : set useopcode=false in your hint file to disable the Opcode extension.
1272 : Trailing extension. Override this in a hint file, if needed.
1273 : Extra object files, if any, needed on this platform.
1276 : Possible local include directories to search.
1277 : Set locincpth to "" in a hint file to defeat local include searches.
1278 locincpth="/usr/local/include /opt/local/include /usr/gnu/include"
1279 locincpth="$locincpth /opt/gnu/include /usr/GNU/include /opt/GNU/include"
1281 : no include file wanted by default
1284 : Enable -DEBUGGING and -DDEBUGGING from the command line
1290 : change the next line if compiling for Xenix/286 on Xenix/386
1291 xlibpth='/usr/lib/386 /lib/386'
1292 : Possible local library directories to search.
1293 loclibpth="/usr/local/lib /opt/local/lib /usr/gnu/lib"
1294 loclibpth="$loclibpth /opt/gnu/lib /usr/GNU/lib /opt/GNU/lib"
1296 : general looking path for locating libraries
1297 glibpth="/lib /usr/lib $xlibpth"
1298 glibpth="$glibpth /usr/ccs/lib /usr/ucblib /usr/local/lib"
1299 test -f /usr/shlib/libc.so && glibpth="/usr/shlib $glibpth"
1300 test -f /shlib/libc.so && glibpth="/shlib $glibpth"
1301 test -d /usr/lib64 && glibpth="$glibpth /lib64 /usr/lib64 /usr/local/lib64"
1303 : Private path used by Configure to find libraries. Its value
1304 : is prepended to libpth. This variable takes care of special
1305 : machines, like the mips. Usually, it should be empty.
1308 : default library list
1310 : some systems want to use only the non-versioned libso:s
1311 ignore_versioned_solibs=''
1316 ccflags_uselargefiles=''
1317 ldflags_uselargefiles=''
1318 libswanted_uselargefiles=''
1319 : set usemultiplicity on the Configure command line to enable multiplicity.
1320 : set usesocks on the Configure command line to enable socks.
1321 : set usethreads on the Configure command line to enable threads.
1322 usereentrant='undef'
1323 : full support for void wanted by default
1326 : List of libraries we want.
1327 : If anyone needs extra -lxxx, put those in a hint file.
1328 libswanted="sfio socket bind inet nsl nm ndbm gdbm dbm db malloc dl dld ld sun"
1329 libswanted="$libswanted m crypt sec util c cposix posix ucb bsd BSD"
1330 : We probably want to search /usr/shlib before most other libraries.
1331 : This is only used by the lib/ExtUtils/MakeMaker.pm routine extliblist.
1332 glibpth=`echo " $glibpth " | sed -e 's! /usr/shlib ! !'`
1333 glibpth="/usr/shlib $glibpth"
1334 : Do not use vfork unless overridden by a hint file.
1337 : Find the basic shell for Bourne shell scripts
1341 *bsd*|sys5*) xxx="/$SYSTYPE/bin/sh";;
1344 if test -f "$xxx"; then
1347 : Build up a list and do a single loop so we can 'break' out.
1348 pth=`echo $PATH | sed -e "s/$p_/ /g"`
1349 for xxx in sh bash ksh pdksh ash; do
1351 try="$try ${p}/${xxx}"
1355 if test -f "$xxx"; then
1358 elif test "X$_exe" != X -a -f "$xxx$_exe"; then
1361 elif test -f "$xxx.exe"; then
1372 $me: Fatal Error: I can't find a Bourne Shell anywhere.
1374 Usually it's in /bin/sh. How did you even get this far?
1375 Please contact me (Perl Maintainers) at perlbug@perl.org and
1376 we'll try to straighten this all out.
1382 : see if sh knows # comments
1383 if `$sh -c '#' >/dev/null 2>&1`; then
1387 test -f $xcat$_exe || xcat=/usr/bin/cat
1388 if test ! -f $xcat$_exe; then
1389 for p in `echo $PATH | sed -e "s/$p_/ /g"` $paths; do
1390 if test -f $p/cat$_exe; then
1395 if test ! -f $xcat$_exe; then
1396 echo "Can't find cat anywhere!"
1400 echo "#!$xcat" >sharp
1404 if test -s today; then
1407 echo "#! $xcat" > sharp
1411 if test -s today; then
1419 echo "Your $sh doesn't grok # comments--I will strip them later on."
1422 echo "exec grep -v '^[ ]*#'" >spitshell
1424 $eunicefix spitshell
1425 spitshell=`pwd`/spitshell
1427 echo "I presume that if # doesn't work, #! won't work either!"
1432 : figure out how to guarantee sh startup
1434 '') startsh=${sharpbang}${sh} ;;
1446 : echo "Yup, it does."
1448 echo "Hmm... '$startsh' does not guarantee sh startup..."
1449 echo "You may have to fix up the shell scripts to make sure $sh runs them."
1454 : Save command line options in file UU/cmdline.opt for later use in
1455 : generating config.sh.
1456 cat > cmdline.opt <<EOSH
1457 # Configure command line arguments.
1466 cat >>cmdline.opt <<EOSH
1467 config_arg$argn='$arg'
1469 # Extreme backslashitis: replace each ' by '"'"'
1470 cat <<EOC | sed -e "s/'/'"'"'"'"'"'"'/g" > cmdl.opt
1473 arg_exp=`cat cmdl.opt`
1474 args_exp="$args_exp$args_sep'$arg_exp'"
1475 argn=`expr $argn + 1`
1478 # args_exp is good for restarting self: eval "set X $args_exp"; shift; $0 "$@"
1479 # used by ./hints/os2.sh
1482 : produce awk script to parse command line options
1483 cat >options.awk <<'EOF'
1485 optstr = "A:dD:eEf:hKOrsSU:V"; # getopt-style specification
1487 len = length(optstr);
1488 for (i = 1; i <= len; i++) {
1489 c = substr(optstr, i, 1);
1490 if (i < len) a = substr(optstr, i + 1, 1); else a = "";
1501 if (substr(str, 1, 1) != "-") {
1502 printf("'%s'\n", str);
1506 for (i = 2; i <= len; i++) {
1507 c = substr(str, i, 1);
1509 printf("-%s\n", substr(str, i));
1515 printf("'%s'\n", substr(str, i + 1));
1528 : process the command line options
1529 set X `for arg in "$@"; do echo "X$arg"; done |
1530 sed -e s/X// | awk -f options.awk`
1535 : set up default values
1545 rm -f optdef.sh posthint.sh
1546 cat >optdef.sh <<EOS
1552 while test $# -gt 0; do
1554 -d) shift; fastread=yes;;
1555 -e) shift; alldone=cont;;
1559 if test -r "$1"; then
1562 echo "$me: cannot read config file $1." >&2
1567 -h) shift; error=true;;
1568 -r) shift; reuseval=true;;
1569 -s) shift; silent=true; realsilent=true;;
1570 -E) shift; alldone=exit;;
1571 -K) shift; knowitall=true;;
1572 -O) shift; override=true;;
1573 -S) shift; silent=true; extractsh=true;;
1578 echo "$me: use '-U symbol=', not '-D symbol='." >&2
1579 echo "$me: ignoring -D $1" >&2
1582 sed -e "s/'/'\"'\"'/g" -e "s/=\(.*\)/='\1'/" >> optdef.sh;;
1583 *) echo "$1='define'" >> optdef.sh;;
1590 *=) echo "$1" >> optdef.sh;;
1592 echo "$me: use '-D symbol=val', not '-U symbol=val'." >&2
1593 echo "$me: ignoring -U $1" >&2
1595 *) echo "$1='undef'" >> optdef.sh;;
1606 *=*) zzz=`echo "$yyy"|sed 's!=.*!!'`
1610 zzz=" "`echo "$yyy"|sed 's!^[^=]*=!!'`
1611 yyy=`echo "$yyy"|sed 's!=.*!!'` ;;
1617 *:*) xxx=`echo "$yyy"|sed 's!:.*!!'`
1618 yyy=`echo "$yyy"|sed 's!^[^:]*:!!'`
1619 zzz=`echo "$yyy"|sed 's!^[^=]*=!!'`
1620 yyy=`echo "$yyy"|sed 's!=.*!!'` ;;
1621 *) xxx=`echo "$yyy"|sed 's!:.*!!'`
1622 yyy=`echo "$yyy"|sed 's!^[^:]*:!!'` ;;
1628 echo "$yyy=\"\${$yyy}$zzz\"" >> posthint.sh ;;
1630 echo "$yyy=''" >> posthint.sh ;;
1635 echo "$yyy='$zzz'" >> posthint.sh ;;
1637 echo "eval \"$yyy=$zzz\"" >> posthint.sh ;;
1639 echo "$yyy=\"$zzz\${$yyy}\"" >> posthint.sh ;;
1644 echo "$yyy=$zzz" >> posthint.sh ;;
1645 *) echo "$me: unknown -A command '$xxx', ignoring -A $1" >&2 ;;
1649 -V) echo "$me generated by metaconfig 3.0 PL70." >&2
1652 -*) echo "$me: unknown option $1" >&2; shift; error=true;;
1660 Usage: $me [-dehrsEKOSV] [-f config.sh] [-D symbol] [-D symbol=value]
1661 [-U symbol] [-U symbol=] [-A command:symbol...]
1662 -d : use defaults for all answers.
1663 -e : go on without questioning past the production of config.sh.
1664 -f : specify an alternate default configuration file.
1665 -h : print this help message and exit (with an error status).
1666 -r : reuse C symbols value if possible (skips costly nm extraction).
1667 -s : silent mode, only echoes questions and essential information.
1668 -D : define symbol to have some value:
1669 -D symbol symbol gets the value 'define'
1670 -D symbol=value symbol gets the value 'value'
1671 -E : stop at the end of questions, after having produced config.sh.
1672 -K : do not use unless you know what you are doing.
1673 -O : let -D and -U override definitions from loaded configuration file.
1674 -S : perform variable substitutions on all .SH files (can mix with -f)
1675 -U : undefine symbol:
1676 -U symbol symbol gets the value 'undef'
1677 -U symbol= symbol gets completely empty
1678 -A : manipulate symbol after the platform specific hints have been applied:
1679 -A symbol=value append " "value to symbol
1680 -A append:symbol=value append value to symbol
1681 -A define:symbol=value define symbol to have value
1682 -A clear:symbol define symbol to be ''
1683 -A define:symbol define symbol to be 'define'
1684 -A eval:symbol=value define symbol to be eval of value
1685 -A prepend:symbol=value prepend value to symbol
1686 -A undef:symbol define symbol to be 'undef'
1687 -A undef:symbol= define symbol to be ''
1688 -V : print version number and exit (with a zero status).
1695 case "$fastread$alldone" in
1698 case "$extractsh" in
1701 if test ! -t 0; then
1702 echo "Say 'sh Configure', not 'sh <Configure'"
1712 true) exec 1>/dev/null;;
1715 : run the defines and the undefines, if any, but leave the file out there...
1718 : create the posthint manipulation script and leave the file out there...
1723 first=`echo $package | sed -e 's/^\(.\).*/\1/'`
1724 last=`echo $package | sed -e 's/^.\(.*\)/\1/'`
1725 case "`echo AbyZ | tr '[:lower:]' '[:upper:]' 2>/dev/null`" in
1726 ABYZ) spackage=`echo $first | tr '[:lower:]' '[:upper:]'`$last;;
1727 *) spackage=`echo $first | tr '[a-z]' '[A-Z]'`$last;;
1730 : Some greps do not return status, grrr.
1731 echo "grimblepritz" >grimble
1732 if grep blurfldyick grimble >/dev/null 2>&1 ; then
1734 elif grep grimblepritz grimble >/dev/null 2>&1 ; then
1740 : the following should work in any shell
1744 echo "AGH! Grep doesn't return a status. Attempting remedial action."
1745 cat >contains <<'EOSS'
1746 grep "$1" "$2" >.greptmp && cat .greptmp && test -s .greptmp
1751 : Find the path to the source tree
1754 */*) src=`echo $0 | sed -e 's%/[^/][^/]*$%%'`
1758 *) src=`cd ../$src && pwd` ;;
1771 if test -f $rsrc/Configure && \
1772 $contains "^package=$package$" $rsrc/Configure >/dev/null 2>&1
1774 : found it, so we are ok.
1777 for src in . .. ../.. ../../.. ../../../..; do
1778 if test -f ../$src/Configure && \
1779 $contains "^package=$package$" ../$src/Configure >/dev/null 2>&1
1790 Sorry, I can't seem to locate the source dir for $package. Please start
1791 Configure with an explicit path -- i.e. /some/path/Configure.
1799 echo "Sources for $package found in \"$src\"." >&4
1803 : script used to extract .SH files with variable substitutions
1804 cat >extract <<'EOS'
1806 echo "Doing variable substitutions on .SH files..."
1807 if test -f MANIFEST; then
1808 set x `awk '{print $1}' < MANIFEST | grep '\.SH$'`
1810 echo "(Looking for .SH files under the source directory.)"
1811 set x `(cd "$src"; find . -name "*.SH" -print)`
1815 0) set x `(cd "$src"; echo *.SH)`; shift;;
1817 if test ! -f "$src/$1"; then
1823 while test $name; do
1824 if test ! -d "$name"; then
1825 create="$name $create";
1826 name=`echo $name | sed -e "s|^[^/]*$||"`;
1827 name=`echo $name | sed -e "s|\(.*\)/.*|\1|"`;
1832 for file in $create; do
1841 dir=`expr X$file : 'X\(.*\)/'`
1842 file=`expr X$file : 'X.*/\(.*\)'`
1843 (cd "$dir" && . ./$file)
1853 dir=`expr X$file : 'X\(.*\)/'`
1854 file=`expr X$file : 'X.*/\(.*\)'`
1855 (set x $dir; shift; eval $mkdir_p)
1856 sh <"$src/$dir/$file"
1865 if test -f "$src/config_h.SH"; then
1866 if test ! -f config.h; then
1867 : oops, they left it out of MANIFEST, probably, so do it anyway.
1868 . "$src/config_h.SH"
1873 : extract files and exit if asked to do so
1874 case "$extractsh" in
1876 case "$realsilent" in
1880 case "$config_sh" in
1881 '') config_sh='config.sh';;
1884 echo "Fetching answers from $config_sh..."
1887 test "$override" && . ./optdef.sh
1891 echo "Extraction done."
1896 : Eunice requires " " instead of "", can you believe it
1899 echo "Beginning of configuration questions for $package."
1901 trap 'echo " "; test -d ../UU && rm -rf X $rmlist; exit 1' 1 2 3 15
1903 : first determine how to suppress newline on echo command
1905 echo "Checking echo to see how to suppress newlines..."
1906 (echo "hi there\c" ; echo " ") >.echotmp
1907 if $contains c .echotmp >/dev/null 2>&1 ; then
1918 echo $n "The star should be here-->$c"
1922 : Now test for existence of everything in MANIFEST
1924 if test -f "$rsrc/MANIFEST"; then
1925 echo "First let's make sure your kit is complete. Checking..." >&4
1926 awk '$1 !~ /PACK[A-Z]+/ {print $1}' "$rsrc/MANIFEST" | (split -l 50 2>/dev/null || split -50)
1929 for filelist in x??; do
1930 (cd "$rsrc"; ls `cat "$tmppwd/$filelist"` >/dev/null 2>>"$tmppwd/missing")
1932 if test -s missing; then
1936 THIS PACKAGE SEEMS TO BE INCOMPLETE.
1938 You have the option of continuing the configuration process, despite the
1939 distinct possibility that your kit is damaged, by typing 'y'es. If you
1940 do, don't blame me if something goes wrong. I advise you to type 'n'o
1941 and contact the author (perlbug@perl.org).
1944 echo $n "Continue? [n] $c" >&4
1948 echo "Continuing..." >&4
1952 echo "ABORTING..." >&4
1957 echo "Looks good..."
1960 echo "There is no MANIFEST file. I hope your kit is complete !"
1965 : Find the appropriate value for a newline for tr
1966 if test -n "$DJGPP"; then
1969 if test X"$trnl" = X; then
1970 case "`echo foo|tr '\n' x 2>/dev/null`" in
1974 if test X"$trnl" = X; then
1975 case "`echo foo|tr '\012' x 2>/dev/null`" in
1976 foox) trnl='\012' ;;
1979 if test X"$trnl" = X; then
1980 case "`echo foo|tr '\r\n' xy 2>/dev/null`" in
1981 fooxy) trnl='\n\r' ;;
1984 if test X"$trnl" = X; then
1987 $me: Fatal Error: cannot figure out how to translate newlines with 'tr'.
1993 : compute the number of columns on the terminal for proper question formatting
1998 : set up the echo used in my read
1999 myecho="case \"\$xxxm\" in
2000 '') echo $n \"\$rp $c\" >&4;;
2002 '') echo $n \"[\$xxxm] $c\";;
2004 if test \`echo \"\$rp [\$xxxm] \" | wc -c\` -ge $COLUMNS; then
2006 echo $n \"[\$xxxm] $c\" >&4
2008 echo $n \"\$rp [\$xxxm] $c\" >&4
2014 : now set up to do reads with possible shell escape and default assignment
2020 case "\$fastread" in
2021 yes) case "\$dflt" in
2024 case "\$silent-\$rp" in
2029 *) case "\$silent" in
2030 true) case "\$rp" in
2035 while expr "X\$ans" : "X!" >/dev/null; do
2039 aok=''; eval "ans=\\"\$answ\\"" && aok=y
2047 set x \`expr "X\$ans" : "X!\(.*\)\$"\`
2056 set x \`expr "X\$ans" : "X&\(.*\)\$"\`
2061 echo "(OK, I'll run with -d after this question.)" >&4
2064 echo "*** Sorry, \$1 not supported yet." >&4
2074 echo "*** Substitution done -- please confirm."
2076 ans=\`echo $n "\$ans$c" | tr '$trnl' ' '\`
2081 echo "*** Error -- try again."
2088 case "\$ans\$xxxm\$nostick" in
2100 : create .config dir to save info across Configure sessions
2101 test -d ../.config || mkdir ../.config
2102 cat >../.config/README <<EOF
2103 This directory created by Configure to save information that should
2104 persist across sessions for $package.
2106 You may safely delete it if you wish.
2109 xversion=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
2111 $define|true|[yY]*) ;;
2112 *) case "$xversion" in
2115 *** WHOA THERE!!! ***
2117 This is an UNSTABLE DEVELOPMENT release.
2118 The version of this $package distribution is $xversion, that is, odd,
2119 (as opposed to even) and that signifies a development release.
2120 If you want a maintenance release, you want an even-numbered version.
2122 Do ***NOT*** install this into production use.
2123 Data corruption and crashes are possible.
2125 It is most seriously suggested that you do not continue any further
2126 unless you want to help in developing and debugging Perl.
2128 If you *still* want to build perl, you can answer 'y' now,
2129 or pass -Dusedevel to Configure.
2132 rp='Do you really want to continue?'
2136 [yY]) echo >&4 "Okay, continuing."
2137 usedevel="$define" ;;
2138 *) echo >&4 "Okay, bye."
2148 case "$versiononly" in
2149 '') versiononly="$define" ;;
2151 case "$installusrbinperl" in
2152 '') installusrbinperl="$undef" ;;
2157 : general instructions
2160 user=`(logname) 2>/dev/null`
2162 '') user=`whoami 2>&1`;;
2164 if $contains "^$user\$" ../.config/instruct >/dev/null 2>&1; then
2167 rp='Would you like to see the instructions?'
2178 This installation shell script will examine your system and ask you questions
2179 to determine how the perl5 package should be installed. If you get
2180 stuck on a question, you may use a ! shell escape to start a subshell or
2181 execute a command. Many of the questions will have default answers in square
2182 brackets; typing carriage return will give you the default.
2184 On some of the questions which ask for file or directory names you are allowed
2185 to use the ~name construct to specify the login directory belonging to "name",
2186 even if you don't have a shell which knows about that. Questions where this is
2187 allowed will be marked "(~name ok)".
2191 dflt='Type carriage return to continue'
2195 The prompter used in this script allows you to use shell variables and
2196 backticks in your answers. You may use $1, $2, etc... to refer to the words
2197 in the default answer, as if the default line was a set of arguments given to a
2198 script shell. This means you may also use $* to repeat the whole default line,
2199 so you do not have to re-type everything to add something to the default.
2201 Everytime there is a substitution, you will have to confirm. If there is an
2202 error (e.g. an unmatched backtick), the default answer will remain unchanged
2203 and you will be prompted again.
2205 If you are in a hurry, you may run 'Configure -d'. This will bypass nearly all
2206 the questions and use the computed defaults (or the previous answers if there
2207 was already a config.sh file). Type 'Configure -h' for a list of options.
2208 You may also start interactively and then answer '& -d' at any prompt to turn
2209 on the non-interactive behaviour for the remainder of the execution.
2215 Much effort has been expended to ensure that this shell script will run on any
2216 Unix system. If despite that it blows up on yours, your best bet is to edit
2217 Configure and run it again. If you can't run Configure for some reason,
2218 you'll have to generate a config.sh file by hand. Whatever problems you
2219 have, let me (perlbug@perl.org) know how I blew it.
2221 This installation script affects things in two ways:
2223 1) it may do direct variable substitutions on some of the files included
2225 2) it builds a config.h file for inclusion in C programs. You may edit
2226 any of these files as the need arises after running this script.
2228 If you make a mistake on a question, there is no easy way to back up to it
2229 currently. The easiest thing to do is to edit config.sh and rerun all the SH
2230 files. Configure will offer to let you do this before it runs the SH files.
2233 dflt='Type carriage return to continue'
2235 case "$firsttime" in
2236 true) echo $user >>../.config/instruct;;
2240 : find out where common programs are
2242 echo "Locating common programs..." >&4
2255 if test -d \$dir/\$thing; then
2261 for thisthing in \$dir/\$thing; do
2262 : just loop through to pick last item
2264 if test -f \$thisthing; then
2267 elif test "X$_exe" != X -a -f \$thisthing$_exe; then
2270 elif test -f \$dir/\$thing.exe; then
2271 if test -n "$DJGPP"; then
2272 echo \$dir/\$thing.exe
2273 elif test "$eunicefix" != ":"; then
2274 : on Eunice apparently
2328 pth=`echo $PATH | sed -e "s/$p_/ /g"`
2329 pth="$pth /lib /usr/lib"
2330 for file in $loclist; do
2334 if test -f "$xxx"; then
2337 echo "WARNING: no $xxx -- ignoring your setting for $file." >&4
2338 xxx=`./loc $file $file $pth`
2341 '') xxx=`./loc $file $file $pth`;;
2342 *) xxx=`./loc $xxx $xxx $pth`;;
2344 eval $file=$xxx$_exe
2348 echo $file is in $xxx.
2351 echo $file is in $xxx.
2354 echo "I don't know where '$file' is, and my life depends on it." >&4
2355 echo "Go find a public domain implementation or fix your PATH setting!" >&4
2361 echo "Don't worry if any of the following aren't found..."
2363 for file in $trylist; do
2367 if test -f "$xxx"; then
2370 echo "WARNING: no $xxx -- ignoring your setting for $file." >&4
2371 xxx=`./loc $file $file $pth`
2374 '') xxx=`./loc $file $file $pth`;;
2375 *) xxx=`./loc $xxx $xxx $pth`;;
2377 eval $file=$xxx$_exe
2381 echo $file is in $xxx.
2384 echo $file is in $xxx.
2387 echo "I don't see $file out there, $say."
2394 echo "Substituting grep for egrep."
2401 echo "Substituting cp for ln."
2410 echo "I can't find make or gmake, and my life depends on it." >&4
2411 echo "Go find a public domain implementation or fix your PATH setting!" >&4
2419 *) # We can't have osname yet.
2420 if test -f "/system/gnu_library/bin/ar.pm"; then # Stratus VOS
2421 # Assume that gmake, if found, is definitely GNU make
2422 # and prefer it over the system make.
2423 echo "Substituting gmake for make."
2431 echo "Hopefully test is built into your sh."
2434 if `sh -c "PATH= test true" >/dev/null 2>&1`; then
2435 echo "Using the test built into your sh."
2443 echo "Hopefully echo is built into your sh."
2448 echo "Checking compatibility between $echo and builtin echo (if any)..." >&4
2449 $echo $n "hi there$c" >foo1
2450 echo $n "hi there$c" >foo2
2451 if cmp foo1 foo2 >/dev/null 2>&1; then
2452 echo "They are compatible. In fact, they may be identical."
2459 They are not compatible! You are probably running ksh on a non-USG system.
2460 I'll have to use $echo instead of the builtin, since Bourne shell doesn't
2461 have echo built in and we may have to run some Bourne shell scripts. That
2462 means I'll have to use '$n$c' to suppress newlines now. Life is ridiculous.
2465 $echo $n "The star should be here-->$c"
2475 cat <<'EOSC' >>trygcc
2480 int main(int argc, char *argv[]) {
2484 if $cc -o try $ccflags $ldflags try.c; then
2487 echo "Uh-oh, the C compiler '$cc' doesn't seem to be working." >&4
2493 case "`$cc -v -c try.c 2>&1`" in
2496 if $test X"$trygcc" = Xyes; then
2497 if gcc -o try -c try.c; then
2499 echo "You seem to have a working gcc, though." >&4
2500 rp="Would you like to use it?"
2502 if $test -f myread; then
2505 if $test -f UU/myread; then
2508 echo "Cannot find myread, sorry. Aborting." >&2
2513 [yY]*) cc=gcc; ccname=gcc; ccflags=''; despair=no;
2514 if $test -f usethreads.cbu; then
2517 *** However, any setting of the C compiler flags (e.g. for thread support)
2518 *** has been lost. It may be necessary to pass -Dcc=gcc to Configure
2519 *** (together with e.g. -Dusethreads).
2535 cat <<'EOSC' >>checkcc
2540 int main(int argc, char *argv[]) {
2544 if $cc -o try $ccflags $ldflags try.c; then
2547 if $test X"$despair" = Xyes; then
2548 echo "Uh-oh, the C compiler '$cc' doesn't seem to be working." >&4
2551 You need to find a working C compiler.
2552 Either (purchase and) install the C compiler supplied by your OS vendor,
2553 or for a free C compiler try http://gcc.gnu.org/
2554 I cannot continue any further, aborting.
2563 : determine whether symbolic links are supported
2566 if $ln -s blurfl sym > /dev/null 2>&1 ; then
2567 echo "Symbolic links are supported." >&4
2570 echo "Symbolic links are NOT supported." >&4
2575 : determine whether symbolic links are supported
2579 echo "Checking how to test for symbolic links..." >&4
2581 if $test "X$issymlink" = X; then
2583 '') sh -c "PATH= test -h sym" >/dev/null 2>&1 ;;
2584 *) $newsh -c "PATH= test -h sym" >/dev/null 2>&1 ;;
2586 if test $? = 0; then
2589 echo "Your builtin 'test -h' may be broken." >&4
2592 *) pth=`echo $PATH | sed -e "s/$p_/ /g"`
2595 if test -f "$p/$test"; then
2604 echo "Trying external '$test -h'." >&4
2605 issymlink="$test -h"
2606 if $test ! -h sym >/dev/null 2>&1; then
2607 echo "External '$test -h' is broken, too." >&4
2615 if $test "X$issymlink" = X; then
2616 if $test -L sym 2>/dev/null; then
2617 issymlink="$test -L"
2618 echo "The builtin '$test -L' worked." >&4
2621 if $test "X$issymlink" != X; then
2622 echo "You can test for symbolic links with '$issymlink'." >&4
2624 echo "I do not know how you can test for symbolic links." >&4
2628 *) echo "No symbolic links, so not testing for their testing..." >&4
2634 case "$mksymlinks" in
2637 ''|'.') echo "Cannot create symlinks in the original directory." >&4
2640 *) case "$lns:$issymlink" in
2641 *"ln"*" -s:"*"test -"?)
2642 echo "Creating the symbolic links..." >&4
2643 echo "(First creating the subdirectories...)" >&4
2645 awk '{print $1}' $src/MANIFEST | grep / | sed 's:/[^/]*$::' | sort -u | while true; do
2647 test -z "$directory" && break
2651 if test ! -d t/base; then
2652 echo "Failed to create the subdirectories. Aborting." >&4
2655 echo "(Then creating the symlinks...)" >&4
2656 awk '{print $1}' $src/MANIFEST | while true; do
2658 test -z "$filename" && break
2659 if test -f $filename; then
2660 if $issymlink $filename; then
2664 if test -f $filename; then
2665 echo "$filename already exists, not symlinking."
2667 ln -s $src/$filename $filename
2671 if test ! -f t/base/lex.t; then
2672 echo "Failed to create the symlinks (t/base/lex.t missing). Aborting." >&4
2677 *) echo "(I cannot figure out how to do symbolic links, ignoring mksymlinks)." >&4
2686 case "$usecrosscompile" in
2688 $echo "Cross-compiling..."
2691 *-*-gcc) # A cross-compiling gcc, probably.
2692 targetarch=`$echo $cc|$sed 's/-gcc$//'`
2694 # leave out ld, choosing it is more complex
2696 ranlib=$targetarch-ranlib
2697 $echo 'extern int foo;' > try.c
2698 set X `$cc -v -E try.c 2>&1 | $awk '/^#include </,/^End of search /'|$grep '/include'`
2700 if $test $# -gt 0; then
2702 incpth="`$echo $incpth|$sed 's/^ //'`"
2703 echo "Guessing incpth '$incpth'." >&4
2705 j="`$echo $i|$sed 's,/include$,/lib,'`"
2706 if $test -d $j; then
2710 libpth="`$echo $libpth|$sed 's/^ //'`"
2711 echo "Guessing libpth '$libpth'." >&4
2716 case "$targetarch" in
2717 '') echo "Targetarch not defined." >&4; croak=y ;;
2718 *) echo "Using targetarch $targetarch." >&4 ;;
2721 '') echo "Incpth not defined." >&4; croak=y ;;
2722 *) echo "Using incpth '$incpth'." >&4 ;;
2725 '') echo "Libpth not defined." >&4; croak=y ;;
2726 *) echo "Using libpth '$libpth'." >&4 ;;
2729 '') for i in $incpth; do
2730 if $test -f $i/errno.h -a -f $i/stdio.h -a -f $i/time.h; then
2732 echo "Guessing usrinc $usrinc." >&4
2737 '') echo "Usrinc not defined." >&4; croak=y ;;
2740 *) echo "Using usrinc $usrinc." >&4 ;;
2742 case "$targethost" in
2743 '') echo "Targethost not defined." >&4; croak=y ;;
2744 *) echo "Using targethost $targethost." >&4
2749 y) echo "Cannot continue, aborting." >&4; exit 1 ;;
2752 /*) run=$src/Cross/run
2753 targetmkdir=$src/Cross/mkdir
2755 from=$src/Cross/from
2757 *) pwd=`$test -f ../Configure & cd ..; pwd`
2759 targetmkdir=$pwd/Cross/mkdir
2761 from=$pwd/Cross/from
2764 case "$targetrun" in
2765 '') targetrun=ssh ;;
2770 case "$targetfrom" in
2771 '') targetfrom=scp ;;
2775 from=$from-$targetfrom
2776 case "$targetdir" in
2778 echo "Guessing targetdir $targetdir." >&4
2781 case "$targetuser" in
2783 echo "Guessing targetuser $targetuser." >&4
2786 case "$targetfrom" in
2790 case "$targetrun" in
2802 '') cwd=$targetdir ;;
2806 if $test ! -f \$exe.xok; then
2810 $targetrun -l $targetuser $targethost "cd \$cwd && ./\$exe \$@"
2813 *) echo "Unknown targetrun '$targetrun'" >&4
2817 case "$targetmkdir" in
2819 cat >$targetmkdir <<EOF
2821 $targetrun -l $targetuser $targethost "mkdir -p \$@"
2823 $chmod a+rx $targetmkdir
2825 *) echo "Unknown targetmkdir '$targetmkdir'" >&4
2837 $targetmkdir \`dirname \$f\`
2838 $targetto $q \$f $targetuser@$targethost:\$f || exit 1
2841 $targetmkdir $targetdir/\`dirname \$f\`
2842 $targetto $q \$f $targetuser@$targethost:$targetdir/\$f || exit 1
2855 $mkdir -p $targetdir/\`dirname \$f\`
2856 $cp \$f $targetdir/\$f || exit 1
2859 $targetmkdir $targetdir/\`dirname \$f\`
2860 $cp \$f $targetdir/\$f || exit 1
2867 *) echo "Unknown targetto '$targetto'" >&4
2871 case "$targetfrom" in
2878 $targetfrom $q $targetuser@$targethost:$targetdir/\$f . || exit 1
2883 cp) cat >$from <<EOF
2888 cp $targetdir/\$f . || exit 1
2893 *) echo "Unknown targetfrom '$targetfrom'" >&4
2897 if $test ! -f $run; then
2898 echo "Target 'run' script '$run' not found." >&4
2902 if $test ! -f $to; then
2903 echo "Target 'to' script '$to' not found." >&4
2907 if $test ! -f $from; then
2908 echo "Target 'from' script '$from' not found." >&4
2912 if $test ! -f $run -o ! -f $to -o ! -f $from; then
2916 Using '$run' for remote execution,
2917 and '$from' and '$to'
2918 for remote file transfer.
2924 usecrosscompile='undef'
2929 : see whether [:lower:] and [:upper:] are supported character classes
2931 case "`echo AbyZ | $tr '[:lower:]' '[:upper:]' 2>/dev/null`" in
2933 echo "Good, your tr supports [:lower:] and [:upper:] to convert case." >&4
2937 *) # There is a discontinuity in EBCDIC between 'R' and 'S'
2938 # (0xd9 and 0xe2), therefore that is a nice testing point.
2939 if test "X$up" = X -o "X$low" = X; then
2940 case "`echo RS | $tr '[R-S]' '[r-s]' 2>/dev/null`" in
2946 if test "X$up" = X -o "X$low" = X; then
2947 case "`echo RS | $tr R-S r-s 2>/dev/null`" in
2953 if test "X$up" = X -o "X$low" = X; then
2954 case "`echo RS | od -x 2>/dev/null`" in
2956 echo "Hey, this might be EBCDIC." >&4
2957 if test "X$up" = X -o "X$low" = X; then
2958 case "`echo RS | $tr '[A-IJ-RS-Z]' '[a-ij-rs-z]' 2>/dev/null`" in
2959 rs) up='[A-IJ-RS-Z]'
2964 if test "X$up" = X -o "X$low" = X; then
2965 case "`echo RS | $tr A-IJ-RS-Z a-ij-rs-z 2>/dev/null`" in
2975 case "`echo RS | $tr \"$up\" \"$low\" 2>/dev/null`" in
2977 echo "Using $up and $low to convert case." >&4
2980 echo "I don't know how to translate letters from upper to lower case." >&4
2981 echo "Your tr is not acting any way I know of." >&4
2985 : set up the translation script tr, must be called with ./tr of course
2989 '[A-Z][a-z]') exec $tr '$up' '$low';;
2990 '[a-z][A-Z]') exec $tr '$low' '$up';;
2997 : Try to determine whether config.sh was made on this system
2998 case "$config_sh" in
3000 myuname=`$uname -a 2>/dev/null`
3001 $test -z "$myuname" && myuname=`hostname 2>/dev/null`
3002 # tr '[A-Z]' '[a-z]' would not work in EBCDIC
3003 # because the A-Z/a-z are not consecutive.
3004 myuname=`echo $myuname | $sed -e 's/^[^=]*=//' -e 's/\///g' | \
3005 ./tr '[A-Z]' '[a-z]' | $tr $trnl ' '`
3006 newmyuname="$myuname"
3008 case "$knowitall" in
3010 if test -f ../config.sh; then
3011 if $contains myuname= ../config.sh >/dev/null 2>&1; then
3012 eval "`grep myuname= ../config.sh`"
3014 if test "X$myuname" = "X$newmyuname"; then
3022 : Get old answers from old config file if Configure was run on the
3023 : same system, otherwise use the hints.
3026 if test -f config.sh; then
3028 rp="I see a config.sh file. Shall I use it to set the defaults?"
3031 n*|N*) echo "OK, I'll ignore it."
3032 mv config.sh config.sh.old
3033 myuname="$newmyuname"
3035 *) echo "Fetching default answers from your old config.sh file..." >&4
3043 : Older versions did not always set $sh. Catch re-use of such
3053 if test ! -f config.sh; then
3056 First time through, eh? I have some defaults handy for some systems
3057 that need some extra help getting the Configure answers right:
3060 (cd $src/hints; ls -C *.sh) | $sed 's/\.sh/ /g' >&4
3062 : Half the following guesses are probably wrong... If you have better
3063 : tests or hints, please send them to perlbug@perl.org
3064 : The metaconfig authors would also appreciate a copy...
3065 $test -f /irix && osname=irix
3066 $test -f /xenix && osname=sco_xenix
3067 $test -f /dynix && osname=dynix
3068 $test -f /dnix && osname=dnix
3069 $test -f /lynx.os && osname=lynxos
3070 $test -f /unicos && osname=unicos && osvers=`$uname -r`
3071 $test -f /unicosmk && osname=unicosmk && osvers=`$uname -r`
3072 $test -f /unicosmk.ar && osname=unicosmk && osvers=`$uname -r`
3073 $test -f /bin/mips && /bin/mips && osname=mips
3074 $test -d /NextApps && set X `hostinfo | grep 'NeXT Mach.*:' | \
3075 $sed -e 's/://' -e 's/\./_/'` && osname=next && osvers=$4
3076 $test -d /usr/apollo/bin && osname=apollo
3077 $test -f /etc/saf/_sactab && osname=svr4
3078 $test -d /usr/include/minix && osname=minix
3079 $test -f /system/gnu_library/bin/ar.pm && osname=vos
3080 if $test -d /MachTen -o -d /MachTen_Folder; then
3082 if $test -x /sbin/version; then
3083 osvers=`/sbin/version | $awk '{print $2}' |
3084 $sed -e 's/[A-Za-z]$//'`
3085 elif $test -x /usr/etc/version; then
3086 osvers=`/usr/etc/version | $awk '{print $2}' |
3087 $sed -e 's/[A-Za-z]$//'`
3093 $test -f /sys/posix.dll &&
3094 $test -f /usr/bin/what &&
3095 set X `/usr/bin/what /sys/posix.dll` &&
3096 $test "$3" = UWIN &&
3100 if $test -f $uname; then
3108 umips) osname=umips ;;
3111 [23]100) osname=mips ;;
3112 next*) osname=next ;;
3114 tmp=`/bin/uname -X 2>/dev/null|awk '/3\.2v[45]/{ print $(NF) }'`
3115 if $test "$tmp" != "" -a "$3" = "3.2" -a -f '/etc/systemid'; then
3118 elif $test -f /etc/kconfig; then
3120 if test "$lns" = "$ln -s"; then
3122 elif $contains _SYSV3 /usr/include/stdio.h > /dev/null 2>&1 ; then
3124 elif $contains _POSIX_SOURCE /usr/include/stdio.h > /dev/null 2>&1 ; then
3131 if test -n "$DJGPP"; then
3140 tmp=`( (oslevel) 2>/dev/null || echo "not found") 2>&1`
3142 # oslevel can fail with:
3143 # oslevel: Unable to acquire lock.
3144 *not\ found) osvers="$4"."$3" ;;
3145 '<3240'|'<>3240') osvers=3.2.0 ;;
3146 '=3240'|'>3240'|'<3250'|'<>3250') osvers=3.2.4 ;;
3147 '=3250'|'>3250') osvers=3.2.5 ;;
3151 bsd386) osname=bsd386
3154 cygwin*) osname=cygwin
3157 *dc.osx) osname=dcosx
3163 domainos) osname=apollo
3169 dragonfly) osname=dragonfly
3172 dynixptx*) osname=dynixptx
3173 osvers=`echo "$4"|sed 's/^v//'`
3175 freebsd) osname=freebsd
3177 genix) osname=genix ;;
3181 osvers=`echo "$3" | $sed 's,.*\.\([0-9]*\.[0-9]*\),\1,'`
3197 netbsd*) osname=netbsd
3200 news-os) osvers="$3"
3202 4*) osname=newsos4 ;;
3206 next*) osname=next ;;
3207 nonstop-ux) osname=nonstopux ;;
3208 openbsd) osname=openbsd
3214 POSIX-BC | posix-bc ) osname=posix-bc
3217 powerux | power_ux | powermax_os | powermaxos | \
3218 powerunix | power_unix) osname=powerux
3224 solaris) osname=solaris
3226 5*) osvers=`echo $3 | $sed 's/^5/2/g'` ;;
3233 osvers=`echo $3 | $sed 's/^5/2/g'` ;;
3237 titanos) osname=titanos
3246 ultrix) osname=ultrix
3249 osf1|mls+) case "$5" in
3252 osvers=`sizer -v | awk -FUNIX '{print $2}' | awk '{print $1}' | tr '[A-Z]' '[a-z]' | sed 's/^[xvt]//'`
3255 *) osvers=`echo "$3" | sed 's/^[xvt]//'` ;;
3258 hp*) osname=hp_osf1 ;;
3259 mips) osname=mips_osf1 ;;
3262 # UnixWare 7.1.2 is known as Open UNIX 8
3263 openunix|unixware) osname=svr5
3271 $2) case "$osname" in
3275 : svr4.x or possibly later
3285 if test -f /stand/boot ; then
3286 eval `grep '^INITPROG=[a-z/0-9]*$' /stand/boot`
3287 if test -n "$INITPROG" -a -f "$INITPROG"; then
3288 isesix=`strings -a $INITPROG|grep 'ESIX SYSTEM V/386 Release 4.0'`
3289 if test -n "$isesix"; then
3297 *) if test -f /etc/systemid; then
3299 set `echo $3 | $sed 's/\./ /g'` $4
3300 if $test -f $src/hints/sco_$1_$2_$3.sh; then
3302 elif $test -f $src/hints/sco_$1_$2.sh; then
3304 elif $test -f $src/hints/sco_$1.sh; then
3309 '') : Still unknown. Probably a generic Sys V.
3318 *) case "$osname" in
3319 '') : Still unknown. Probably a generic BSD.
3327 if test -f /vmunix -a -f $src/hints/news_os.sh; then
3328 (what /vmunix | UU/tr '[A-Z]' '[a-z]') > UU/kernel.what 2>&1
3329 if $contains news-os UU/kernel.what >/dev/null 2>&1; then
3332 $rm -f UU/kernel.what
3333 elif test -d c:/. -o -n "$is_os2" ; then
3340 case "$targetarch" in
3343 osname=`echo $targetarch|sed 's,^[^-]*-,,'`
3348 : Now look for a hint file osname_osvers, unless one has been
3349 : specified already.
3352 file=`echo "${osname}_${osvers}" | $sed -e 's%\.%_%g' -e 's%_$%%'`
3353 : Also try without trailing minor version numbers.
3354 xfile=`echo $file | $sed -e 's%_[^_]*$%%'`
3355 xxfile=`echo $xfile | $sed -e 's%_[^_]*$%%'`
3356 xxxfile=`echo $xxfile | $sed -e 's%_[^_]*$%%'`
3357 xxxxfile=`echo $xxxfile | $sed -e 's%_[^_]*$%%'`
3360 *) case "$osvers" in
3363 *) if $test -f $src/hints/$file.sh ; then
3365 elif $test -f $src/hints/$xfile.sh ; then
3367 elif $test -f $src/hints/$xxfile.sh ; then
3369 elif $test -f $src/hints/$xxxfile.sh ; then
3371 elif $test -f $src/hints/$xxxxfile.sh ; then
3373 elif $test -f "$src/hints/${osname}.sh" ; then
3382 if $test -f Policy.sh ; then
3385 none) dflt="Policy" ;;
3386 *) dflt="Policy $dflt" ;;
3391 dflt=`echo $hintfile | $sed 's/\.sh$//'`
3395 if $test -f Policy.sh ; then
3398 There's also a Policy hint file available, which should make the
3399 site-specific (policy) questions easier to answer.
3406 You may give one or more space-separated answers, or "none" if appropriate.
3407 If you have a handcrafted Policy.sh file or a Policy.sh file generated by a
3408 previous run of Configure, you may specify it as well as or instead of
3409 OS-specific hints. If hints are provided for your OS, you should use them:
3410 although Perl can probably be built without hints on many platforms, using
3411 hints often improve performance and may enable features that Configure can't
3412 set up on its own. If there are no hints that match your OS, specify "none";
3413 DO NOT give a wrong version or a wrong OS.
3417 rp="Which of these apply, if any?"
3420 for file in $tans; do
3421 if $test X$file = XPolicy -a -f Policy.sh; then
3423 $cat Policy.sh >> UU/config.sh
3424 elif $test -f $src/hints/$file.sh; then
3425 . $src/hints/$file.sh
3426 $cat $src/hints/$file.sh >> UU/config.sh
3427 elif $test X"$tans" = X -o X"$tans" = Xnone ; then
3430 : Give one chance to correct a possible typo.
3431 echo "$file.sh does not exist"
3433 rp="hint to use instead?"
3435 for file in $ans; do
3436 if $test -f "$src/hints/$file.sh"; then
3437 . $src/hints/$file.sh
3438 $cat $src/hints/$file.sh >> UU/config.sh
3439 elif $test X$ans = X -o X$ans = Xnone ; then
3442 echo "$file.sh does not exist -- ignored."
3449 : Remember our hint file for later.
3450 if $test -f "$src/hints/$file.sh" ; then
3460 echo "Fetching default answers from $config_sh..." >&4
3464 cp $config_sh config.sh 2>/dev/null
3474 test "$override" && . ./optdef.sh
3476 : Restore computed paths
3477 for file in $loclist $trylist; do
3478 eval $file="\$_$file"
3483 Configure uses the operating system name and version to set some defaults.
3484 The default value is probably right if the name rings a bell. Otherwise,
3485 since spelling matters for me, either accept the default or answer "none"
3492 ''|' '|none) dflt=none ;;
3493 *) dflt=`echo $hintfile | $sed -e 's/\.sh$//' -e 's/_.*$//'` ;;
3496 *) dflt="$osname" ;;
3498 rp="Operating system name?"
3502 *) osname=`echo "$ans" | $sed -e 's/[ ][ ]*/_/g' | ./tr '[A-Z]' '[a-z]'`;;
3508 ''|' '|none) dflt=none ;;
3509 *) dflt=`echo $hintfile | $sed -e 's/\.sh$//' -e 's/^[^_]*//'`
3510 dflt=`echo $dflt | $sed -e 's/^_//' -e 's/_/./g'`
3512 ''|' ') dflt=none ;;
3517 *) dflt="$osvers" ;;
3519 rp="Operating system version?"
3529 : who configured the system
3530 cf_time=`LC_ALL=C; LANGUAGE=C; export LC_ALL; export LANGUAGE; $date 2>&1`
3533 cf_by=`(logname) 2>/dev/null`
3536 cf_by=`(whoami) 2>/dev/null`
3538 "") cf_by=unknown ;;
3543 : decide how portable to be. Allow command line overrides.
3544 case "$d_portable" in
3546 *) d_portable="$define" ;;
3549 : set up shell script to do ~ expansion
3555 echo \$1 | $sed "s|~|\${HOME-\$LOGDIR}|"
3558 if $test -f /bin/csh; then
3559 /bin/csh -f -c "glob \$1"
3564 name=\`$expr x\$1 : '..\([^/]*\)'\`
3565 dir=\`$sed -n -e "/^\${name}:/{s/^[^:]*:[^:]*:[^:]*:[^:]*:[^:]*:\([^:]*\).*"'\$'"/\1/" -e p -e q -e '}' </etc/passwd\`
3566 if $test ! -d "\$dir"; then
3568 echo "\$me: can't locate home directory for: \$name" >&2
3573 echo \$dir/\`$expr x\$1 : '..[^/]*/\(.*\)'\`
3589 : now set up to get a file name
3593 cat <<'EOSC' >>getfile
3609 : getfile will accept an answer from the comma-separated list
3610 : enclosed in parentheses even if it does not meet other criteria.
3611 expr "$fn" : '.*(\(.*\)).*' | $tr ',' $trnl >getfile.ok
3612 fn=`echo $fn | sed 's/(.*)//'`
3618 loc_file=`expr $fn : '.*:\(.*\)'`
3619 fn=`expr $fn : '\(.*\):.*'`
3627 */*) fullpath=true;;
3636 *e*) exp_file=true;;
3639 *p*) nopath_ok=true;;
3644 *d*) type='Directory';;
3645 *l*) type='Locate';;
3650 Locate) what='File';;
3655 case "$d_portable" in
3663 while test "$type"; do
3668 true) rp="$rp (~name ok)";;
3671 if test -f UU/getfile.ok && \
3672 $contains "^$ans\$" UU/getfile.ok >/dev/null 2>&1
3691 value=`UU/filexp $ans`
3694 if test "$ans" != "$value"; then
3695 echo "(That expands to $value on this system.)"
3709 /*) value="$ansexp" ;;
3710 [a-zA-Z]:/*) value="$ansexp" ;;
3715 echo "I shall only accept a full path name, as in /bin/ls." >&4
3716 echo "Use a ! shell escape if you wish to check pathnames." >&4
3719 echo "Please give a full path name, starting with slash." >&4
3722 echo "Note that using ~name is ok provided it expands well." >&4
3735 for fp in $gfpth; do
3736 if test "X$fp" = X.; then
3741 if test -f "$pf"; then
3743 elif test -r "$pf" || (test -h "$pf") >/dev/null 2>&1
3745 echo "($value is not a plain file, but that's ok.)"
3748 if test X"$type" = X; then
3755 for fp in $gfpth; do
3756 if test "X$fp" = X.; then
3761 direxp="$fp/$ansexp"
3763 if test -d "$direxp"; then
3771 if test -d "$ansexp"; then
3772 echo "(Looking for $loc_file in directory $value.)"
3773 value="$value/$loc_file"
3774 ansexp="$ansexp/$loc_file"
3776 if test -f "$ansexp"; then
3779 case "$nopath_ok" in
3780 true) case "$value" in
3782 *) echo "Assuming $value will be in people's path."
3798 if test "$fastread" = yes; then
3803 rp="$what $value doesn't exist. Use that name anyway?"
3822 test "X$gfpthkeep" != Xy && gfpth=""
3825 : determine root of directory hierarchy where package will be installed.
3828 dflt=`./loc . /usr/local /usr/local /local /opt /usr`
3831 dflt=`echo "$prefix" | sed 's/.$//'`
3839 By default, $package will be installed in $dflt/bin, manual pages
3840 under $dflt/man, etc..., i.e. with $dflt as prefix for all
3841 installation directories. Typically this is something like /usr/local.
3842 If you wish to have binaries under /usr/bin but other parts of the
3843 installation under /usr/local, that's ok: you will be prompted
3844 separately for each of the installation directories, the prefix being
3845 only used to set the defaults.
3849 rp='Installation prefix to use?'
3857 *) oldprefix="$prefix";;
3866 *) afsroot=$afsroot ;;
3872 $define|true) afs=true ;;
3873 $undef|false) afs=false ;;
3874 *) if test -d $afsroot; then
3882 echo "AFS may be running... I'll be extra cautious then..." >&4
3884 echo "AFS does not seem to be running..." >&4
3887 : determine installation prefix for where package is to be installed.
3891 Since you are running AFS, I need to distinguish the directory in which
3892 files will reside from the directory in which they are installed (and from
3893 which they are presumably copied to the former directory by occult means).
3896 case "$installprefix" in
3897 '') dflt=`echo $prefix | sed 's#^/afs/#/afs/.#'`;;
3898 *) dflt="$installprefix";;
3903 In some special cases, particularly when building $package for distribution,
3904 it is convenient to distinguish the directory in which files should be
3905 installed from the directory ($prefix) in which they will
3906 eventually reside. For most users, these two directories are the same.
3909 case "$installprefix" in
3911 *) dflt=$installprefix;;
3915 rp='What installation prefix should I use for installing files?'
3917 installprefix="$ans"
3918 installprefixexp="$ansexp"
3920 : Perform the prefixexp/installprefixexp correction if necessary
3921 cat <<EOS >installprefix
3924 cat <<'EOSC' >>installprefix
3925 : Change installation prefix, if necessary.
3926 if $test X"$prefix" != X"$installprefix"; then
3927 eval "install${prefixvar}=\`echo \$${prefixvar}exp | sed \"s#^\$prefixexp#\$installprefixexp#\"\`"
3929 eval "install${prefixvar}=\"\$${prefixvar}exp\""
3932 chmod +x installprefix
3933 $eunicefix installprefix
3935 : Set variables such as privlib and privlibexp from the output of ./getfile
3936 : performing the prefixexp/installprefixexp correction if necessary.
3937 cat <<EOS >setprefixvar
3940 cat <<'EOSC' >>setprefixvar
3941 eval "${prefixvar}=\"\$ans\""
3942 eval "${prefixvar}exp=\"\$ansexp\""
3945 chmod +x setprefixvar
3946 $eunicefix setprefixvar
3948 : set up the script used to warn in case of inconsistency
3957 '') echo "The $hint value for \$$var on this machine was \"$was\"!" >&4
3959 *) echo "Hmm. Based on the hints in hints/$hintfile.sh, " >&4
3960 echo "the $hint value for \$$var on this machine was \"$was\"!" >&4
3965 echo "*** WHOA THERE!!! ***" >&4
3966 echo " The $hint value for \$$var on this machine was \"$was\"!" >&4
3969 rp=" Keep the $hint value?"
3972 y) td=$was; tu=$was;;
3976 : function used to set $1 to $val
3977 setvar='var=$1; eval "was=\$$1"; td=$define; tu=$undef;
3979 $define$undef) . ./whoa; eval "$var=\$td";;
3980 $undef$define) . ./whoa; eval "$var=\$tu";;
3981 *) eval "$var=$val";;
3985 $define|true|[yY]*) dflt='y';;
3990 Perl can be built to use the SOCKS proxy protocol library. To do so,
3991 Configure must be run with -Dusesocks. If you use SOCKS you also need
3992 to use the PerlIO abstraction layer, this will be implicitly selected.
3994 If this doesn't make any sense to you, just accept the default '$dflt'.
3996 rp='Build Perl for SOCKS?'
3999 y|Y) val="$define" ;;
4006 $define|true|[yY]*) useperlio="$define";;
4009 case "$useperlio" in
4010 $define|true|[yY]*|'') dflt='y';;
4015 Previous version of $package used the standard IO mechanisms as
4016 defined in <stdio.h>. Versions 5.003_02 and later of $package allow
4017 alternate IO mechanisms via the PerlIO abstraction layer, but the
4018 stdio mechanism is still available if needed. The abstraction layer
4019 can use AT&T's sfio (if you already have sfio installed) or regular stdio.
4020 Using PerlIO with sfio may cause problems with some extension modules.
4022 If this doesn't make any sense to you, just accept the default '$dflt'.
4024 rp='Use the PerlIO abstraction layer?'
4031 echo "Ok, doing things the stdio way."
4040 case "$useperlio" in
4041 $define|true|[yY]*) ;;
4044 You are using the SOCKS proxy protocol library which means that you
4045 should also use the PerlIO layer. You may be headed for trouble.
4054 : get the patchlevel
4056 echo "Getting the current patchlevel..." >&4
4057 if $test -r $rsrc/patchlevel.h;then
4058 revision=`awk '/define[ ]+PERL_REVISION/ {print $3}' $rsrc/patchlevel.h`
4059 patchlevel=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
4060 subversion=`awk '/define[ ]+PERL_SUBVERSION/ {print $3}' $rsrc/patchlevel.h`
4061 api_revision=`awk '/define[ ]+PERL_API_REVISION/ {print $3}' $rsrc/patchlevel.h`
4062 api_version=`awk '/define[ ]+PERL_API_VERSION/ {print $3}' $rsrc/patchlevel.h`
4063 api_subversion=`awk '/define[ ]+PERL_API_SUBVERSION/ {print $3}' $rsrc/patchlevel.h`
4064 perl_patchlevel=`egrep 'define PERL_PATCHNUM [0-9][0-9]|,"MAINT[0-9][0-9]*"' $rsrc/patchlevel.h|sed 's/[^0-9]//g'`
4073 $echo "(You do not have patchlevel.h. Eek.)"
4075 if $test -r $rsrc/.patch ; then
4076 if $test "X$perl_patchlevel" = "X" || $test "`cat $rsrc/.patch`" -gt "$perl_patchlevel" ; then
4077 perl_patchlevel=`cat $rsrc/.patch`
4080 : Define a handy string here to avoid duplication in myconfig.SH and configpm.
4081 version_patchlevel_string="version $patchlevel subversion $subversion"
4082 case "$perl_patchlevel" in
4084 *) version_patchlevel_string="$version_patchlevel_string patch $perl_patchlevel" ;;
4087 $echo "(You have $package $version_patchlevel_string.)"
4091 : XXX Should be a Configure test for double-dots in filenames.
4092 version=`echo $revision $patchlevel $subversion | \
4093 $awk '{ printf "%d_%d_%d\n", $1, $2, $3 }'`
4094 api_versionstring=`echo $api_revision $api_version $api_subversion | \
4095 $awk '{ printf "%d_%d_%d\n", $1, $2, $3 }'`
4098 version=`echo $revision $patchlevel $subversion | \
4099 $awk '{ printf "%d.%d.%d\n", $1, $2, $3 }'`
4100 api_versionstring=`echo $api_revision $api_version $api_subversion | \
4101 $awk '{ printf "%d.%d.%d\n", $1, $2, $3 }'`
4104 : Special case the 5.005_xx maintenance series, which used 5.005
4105 : without any subversion label as a subdirectory in $sitelib
4106 if test "${api_revision}${api_version}${api_subversion}" = "550"; then
4107 api_versionstring='5.005'
4110 case "$usethreads" in
4111 $define|true|[yY]*) dflt='y';;
4112 *) # Catch case where user specified ithreads or 5005threads but
4113 # forgot -Dusethreads (A.D. 4/2002)
4114 case "$useithreads$use5005threads" in
4116 case "$useperlio" in
4117 "$define") dflt='y' ;;
4127 Perl can be built to take advantage of threads on some systems.
4128 To do so, Configure can be run with -Dusethreads.
4130 Note that Perl built with threading support runs slightly slower
4131 and uses more memory than plain Perl. The current implementation
4132 is believed to be stable, but it is fairly new, and so should be
4133 treated with caution.
4135 If this doesn't make any sense to you, just accept the default '$dflt'.
4137 rp='Build a threading Perl?'
4140 y|Y) val="$define" ;;
4146 if $test $patchlevel -lt 9; then
4147 case "$usethreads" in
4151 Since release 5.6, Perl has had two different threading implementations,
4152 the newer interpreter-based version (ithreads) with one interpreter per
4153 thread, and the older 5.005 version (5005threads).
4154 The 5005threads version is effectively unmaintained and will probably be
4155 removed in Perl 5.10, so there should be no need to build a Perl using it
4156 unless needed for backwards compatibility with some existing 5.005threads
4160 : Default to ithreads unless overridden on command line or with
4163 case "$use5005threads" in
4164 $define|true|[yY]*) dflt='n';;
4166 case "$useithreads" in
4167 $undef|false|[nN]*) dflt='n';;
4169 rp='Use the newer interpreter-based ithreads?'
4172 y|Y) val="$define" ;;
4177 : Now set use5005threads to the opposite value.
4178 case "$useithreads" in
4179 $define) val="$undef" ;;
4186 useithreads="$undef"
4187 use5005threads="$undef"
4191 case "$useithreads$use5005threads" in
4195 You cannot have both the ithreads and the 5.005 threads enabled
4196 at the same time. Disabling the 5.005 threads since they are
4197 much less stable than the ithreads.
4200 use5005threads="$undef"
4205 : perl-5.9.x and later
4207 use5005threads="$undef"
4208 case "$usethreads" in
4210 : Default to ithreads unless overridden on command line or with
4213 case "$useithreads" in
4214 $undef|false|[nN]*) dflt='n';;
4216 rp='Use the newer interpreter-based ithreads?'
4219 y|Y) val="$define" ;;
4226 useithreads="$undef"
4232 if test X"$usethreads" = "X$define" -a "X$useperlio" = "Xundef"; then
4235 *** To build with ithreads you must also use the PerlIO layer.
4236 *** Cannot continue, aborting.
4242 case "$d_oldpthreads" in
4243 '') : Configure tests would be welcome here. For now, assume undef.
4245 *) val="$d_oldpthreads" ;;
4251 : Look for a hint-file generated 'call-back-unit'. If the
4252 : user has specified that a threading perl is to be built,
4253 : we may need to set or change some other defaults.
4254 if $test -f usethreads.cbu; then
4255 echo "Your platform has some specific hints regarding threaded builds, using them..."
4258 case "$usethreads" in
4259 "$define"|true|[yY]*)
4261 (Your platform does not have any specific hints for threaded builds.
4262 Assuming POSIX threads, then.)
4270 Perl can be built so that multiple Perl interpreters can coexist
4271 within the same Perl executable.
4274 case "$useithreads" in
4277 This multiple interpreter support is required for interpreter-based threads.
4281 *) case "$usemultiplicity" in
4282 $define|true|[yY]*) dflt='y';;
4286 echo "If this doesn't make any sense to you, just accept the default '$dflt'."
4287 rp='Build Perl for multiplicity?'
4290 y|Y) val="$define" ;;
4299 case "$usemorebits" in
4300 "$define"|true|[yY]*)
4301 use64bitint="$define"
4302 uselongdouble="$define"
4303 usemorebits="$define"
4305 *) usemorebits="$undef"
4309 : make some quick guesses about what we are up against
4311 $echo $n "Hmm... $c"
4321 $cat /usr/include/signal.h /usr/include/sys/signal.h >foo 2>/dev/null
4322 if test -f /osf_boot || $contains 'OSF/1' /usr/include/ctype.h >/dev/null 2>&1
4324 echo "Looks kind of like an OSF/1 system, but we'll see..."
4326 elif test `echo abc | $tr a-z A-Z` = Abc ; then
4327 xxx=`./loc addbib blurfl $pth`
4328 if $test -f $xxx; then
4329 echo "Looks kind of like a USG system with BSD features, but we'll see..."
4333 if $contains SIGTSTP foo >/dev/null 2>&1 ; then
4334 echo "Looks kind of like an extended USG system, but we'll see..."
4336 echo "Looks kind of like a USG system, but we'll see..."
4340 elif $contains SIGTSTP foo >/dev/null 2>&1 ; then
4341 echo "Looks kind of like a BSD system, but we'll see..."
4345 echo "Looks kind of like a Version 7 system, but we'll see..."
4348 case "$eunicefix" in
4351 There is, however, a strange, musty smell in the air that reminds me of
4352 something...hmm...yes...I've got it...there's a VMS nearby, or I'm a Blit.
4356 : it so happens the Eunice I know will not run shell scripts in Unix format
4360 echo "Congratulations. You aren't running Eunice."
4364 : Detect OS2. The p_ variable is set above in the Head.U unit.
4365 : Note that this also -- wrongly -- detects e.g. dos-djgpp, which also uses
4366 : semicolon as a patch separator
4371 I have the feeling something is not exactly right, however...don't tell me...
4372 lemme think...does HAL ring a bell?...no, of course, you're only running OS/2!
4373 (Or you may be running DOS with DJGPP.)
4378 if test -f /xenix; then
4379 echo "Actually, this looks more like a XENIX system..."
4384 echo "It's not Xenix..."
4389 if test -f /venix; then
4390 echo "Actually, this looks more like a VENIX system..."
4397 echo "Nor is it Venix..."
4400 chmod +x bsd usg v7 osf1 eunice xenix venix os2
4401 $eunicefix bsd usg v7 osf1 eunice xenix venix os2
4408 rp="Use which C compiler?"
4412 : See if they have not cc but they do have gcc
4414 : Look for a hint-file generated 'call-back-unit'. Now that the
4415 : user has specified the compiler, we may need to set or change some
4417 if $test -f cc.cbu; then
4423 echo "Checking for GNU cc in disguise and/or its version number..." >&4
4427 #if defined(__GNUC__) && !defined(__INTEL_COMPILER)
4429 printf("%s\n", __VERSION__);
4431 printf("%s\n", "1");
4437 if $cc -o try $ccflags $ldflags try.c; then
4438 gccversion=`$run ./try`
4439 case "$gccversion" in
4440 '') echo "You are not using GNU cc." ;;
4441 *) echo "You are using GNU cc $gccversion."
4447 echo "*** WHOA THERE!!! ***" >&4
4448 echo " Your C compiler \"$cc\" doesn't seem to be working!" >&4
4449 case "$knowitall" in
4451 echo " You'd better start hunting for one and let me know about it." >&4
4457 case "$gccversion" in
4458 1*) cpp=`./loc gcc-cpp $cpp $pth` ;;
4460 case "$gccversion" in
4461 '') gccosandvers='' ;;
4462 *) gccshortvers=`echo "$gccversion"|sed 's/ .*//'`
4463 gccosandvers=`$cc -v 2>&1|grep '/specs$'|sed "s!.*/[^-/]*-[^-/]*-\([^-/]*\)/$gccshortvers/specs!\1!"`
4465 case "$gccosandvers" in
4466 $osname) gccosandvers='' ;; # linux gccs seem to have no linux osvers, grr
4467 $osname$osvers) ;; # looking good
4468 $osname*) cat <<EOM >&4
4470 *** WHOA THERE!!! ***
4472 Your gcc has not been compiled for the exact release of
4473 your operating system ($gccosandvers versus $osname$osvers).
4475 In general it is a good idea to keep gcc synchronized with
4476 the operating system because otherwise serious problems
4477 may ensue when trying to compile software, like Perl.
4479 I'm trying to be optimistic here, though, and will continue.
4480 If later during the configuration and build icky compilation
4481 problems appear (headerfile conflicts being the most common
4482 manifestation), I suggest reinstalling the gcc to match
4483 your operating system release.
4487 *) gccosandvers='' ;; # failed to parse, better be silent
4495 # gcc 3.* complain about adding -Idirectories that they already know about,
4496 # so we will take those off from locincpth.
4497 case "$gccversion" in
4499 echo "main(){}">try.c
4500 for incdir in $locincpth; do
4501 warn=`$cc $ccflags -I$incdir -c try.c 2>&1 | \
4502 grep '^c[cp]p*[01]: warning: changing search order '`
4503 if test "X$warn" != X; then
4504 locincpth=`echo " $locincpth " | sed "s! $incdir ! !"`
4510 : What should the include directory be ?
4512 $echo $n "Hmm... $c"
4516 if $test -f /bin/mips && /bin/mips; then
4517 echo "Looks like a MIPS system..."
4518 $cat >usr.c <<'EOCP'
4519 #ifdef SYSTYPE_BSD43
4523 if cc -E usr.c > usr.out && $contains / usr.out >/dev/null 2>&1; then
4524 dflt='/bsd43/usr/include'
4528 mips_type='System V'
4530 $rm -f usr.c usr.out
4531 echo "and you're compiling with the $mips_type compiler and libraries."
4535 echo "Doesn't look like a MIPS system."
4545 case "$xxx_prompt" in
4548 rp='Where are the include files you want to use?'
4556 : see how we invoke the C preprocessor
4558 echo "Now, how can we feed standard input to your C preprocessor..." >&4
4559 cat <<'EOT' >testcpp.c
4565 if test ! -f cppstdin; then
4566 if test "X$osname" = "Xaix" -a "X$gccversion" = X; then
4567 # AIX cc -E doesn't show the absolute headerfile
4568 # locations but we'll cheat by using the -M flag.
4569 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
4571 echo 'cat >.$$.c; '"$cc"' -E ${1+"$@"} .$$.c; rm .$$.c' >cppstdin
4574 echo "Keeping your $hint cppstdin wrapper."
4577 wrapper=`pwd`/cppstdin
4581 if $test "X$cppstdin" != "X" && \
4582 $cppstdin $cppminus <testcpp.c >testcpp.out 2>&1 && \
4583 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
4585 echo "You used to use $cppstdin $cppminus so we'll use that again."
4587 '') echo "But let's see if we can live without a wrapper..." ;;
4589 if $cpprun $cpplast <testcpp.c >testcpp.out 2>&1 && \
4590 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
4592 echo "(And we'll use $cpprun $cpplast to preprocess directly.)"
4595 echo "(However, $cpprun $cpplast does not work, let's see...)"
4603 echo "Good old $cppstdin $cppminus does not seem to be of any help..."
4610 elif echo 'Maybe "'"$cc"' -E" will work...'; \
4611 $cc -E <testcpp.c >testcpp.out 2>&1; \
4612 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4613 echo "Yup, it does."
4616 elif echo 'Nope...maybe "'"$cc"' -E -" will work...'; \
4617 $cc -E - <testcpp.c >testcpp.out 2>&1; \
4618 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4619 echo "Yup, it does."
4622 elif echo 'Nope...maybe "'"$cc"' -P" will work...'; \
4623 $cc -P <testcpp.c >testcpp.out 2>&1; \
4624 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4625 echo "Yipee, that works!"
4628 elif echo 'Nope...maybe "'"$cc"' -P -" will work...'; \
4629 $cc -P - <testcpp.c >testcpp.out 2>&1; \
4630 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4631 echo "At long last!"
4634 elif echo 'No such luck, maybe "'$cpp'" will work...'; \
4635 $cpp <testcpp.c >testcpp.out 2>&1; \
4636 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4640 elif echo 'Nixed again...maybe "'$cpp' -" will work...'; \
4641 $cpp - <testcpp.c >testcpp.out 2>&1; \
4642 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4643 echo "Hooray, it works! I was beginning to wonder."
4646 elif echo 'Uh-uh. Time to get fancy. Trying a wrapper...'; \
4647 $wrapper <testcpp.c >testcpp.out 2>&1; \
4648 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4654 rp="No dice. I can't find a C preprocessor. Name one:"
4658 $x_cpp <testcpp.c >testcpp.out 2>&1
4659 if $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4660 echo "OK, that will do." >&4
4662 echo "Sorry, I can't get that to work. Go find one and rerun Configure." >&4
4677 echo "Perhaps can we force $cc -E using a wrapper..."
4678 if $wrapper <testcpp.c >testcpp.out 2>&1; \
4679 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
4685 echo "Nope, we'll have to live without it..."
4699 "$wrapper"|'cppstdin') ;;
4700 *) $rm -f $wrapper;;
4702 $rm -f testcpp.c testcpp.out
4704 : Set private lib path
4707 plibpth="$incpath/usr/lib /usr/local/lib /usr/ccs/lib"
4712 '') dlist="$loclibpth $plibpth $glibpth";;
4713 *) dlist="$libpth";;
4716 : Now check and see which directories actually exist, avoiding duplicates
4720 if $test -d $xxx; then
4723 *) libpth="$libpth $xxx";;
4729 Some systems have incompatible or broken versions of libraries. Among
4730 the directories listed in the question below, please remove any you
4731 know not to be holding relevant libraries, and add any that are needed.
4732 Say "none" for none.
4743 rp="Directories to use for library searches?"
4750 : compute shared library extension
4753 if xxx=`./loc libc.sl X $libpth`; $test -f "$xxx"; then
4763 On some systems, shared libraries may be available. Answer 'none' if
4764 you want to suppress searching of shared libraries for the remainder
4765 of this configuration.
4768 rp='What is the file extension used for shared libraries?'
4772 : Define several unixisms.
4773 : Hints files or command line option can be used to override them.
4774 : The convoluted testing is in case hints files set either the old
4777 '') case "$exe_ext" in
4779 *) _exe="$exe_ext" ;;
4784 '') case "$lib_ext" in
4791 '') case "$obj_ext" in
4798 '') case "$path_sep" in
4809 : Which makefile gets called first. This is used by make depend.
4810 case "$firstmakefile" in
4811 '') firstmakefile='makefile';;
4815 *-DUSE_LONG_DOUBLE*|*-DUSE_MORE_BITS*) uselongdouble="$define" ;;
4818 case "$uselongdouble" in
4819 $define|true|[yY]*) dflt='y';;
4824 Perl can be built to take advantage of long doubles which
4825 (if available) may give more accuracy and range for floating point numbers.
4827 If this doesn't make any sense to you, just accept the default '$dflt'.
4829 rp='Try to use long doubles if available?'
4832 y|Y) val="$define" ;;
4838 case "$uselongdouble" in
4839 true|[yY]*) uselongdouble="$define" ;;
4842 : Look for a hint-file generated 'call-back-unit'. If the
4843 : user has specified that long doubles should be used,
4844 : we may need to set or change some other defaults.
4845 if $test -f uselongdouble.cbu; then
4846 echo "Your platform has some specific hints regarding long doubles, using them..."
4847 . ./uselongdouble.cbu
4849 case "$uselongdouble" in
4852 (Your platform does not have any specific hints for long doubles.)
4858 : Looking for optional libraries
4860 echo "Checking for optional libraries..." >&4
4865 case "$libswanted" in
4866 '') libswanted='c_s';;
4869 "$define") libswanted="$libswanted socks5 socks5_sh" ;;
4875 for thisdir in $libpth $xlibpth; do
4876 test -d $thisdir && libspath="$libspath $thisdir"
4878 for thislib in $libswanted; do
4879 for thisdir in $libspath; do
4881 if $test ! -f "$xxx" -a "X$ignore_versioned_solibs" = "X"; then
4882 xxx=`ls $thisdir/lib$thislib.$so.[0-9] 2>/dev/null|sed -n '$p'`
4883 $test -f "$xxx" && eval $libscheck
4884 $test -f "$xxx" && libstyle=shared
4886 if test ! -f "$xxx"; then
4887 xxx=$thisdir/lib$thislib.$so
4888 $test -f "$xxx" && eval $libscheck
4889 $test -f "$xxx" && libstyle=shared
4891 if test ! -f "$xxx"; then
4892 xxx=$thisdir/lib$thislib$_a
4893 $test -f "$xxx" && eval $libscheck
4894 $test -f "$xxx" && libstyle=static
4896 if test ! -f "$xxx"; then
4897 xxx=$thisdir/$thislib$_a
4898 $test -f "$xxx" && eval $libscheck
4899 $test -f "$xxx" && libstyle=static
4901 if test ! -f "$xxx"; then
4902 xxx=$thisdir/lib${thislib}_s$_a
4903 $test -f "$xxx" && eval $libscheck
4904 $test -f "$xxx" && libstyle=static
4905 $test -f "$xxx" && thislib=${thislib}_s
4907 if test ! -f "$xxx"; then
4908 xxx=$thisdir/Slib$thislib$_a
4909 $test -f "$xxx" && eval $libscheck
4910 $test -f "$xxx" && libstyle=static
4912 if $test -f "$xxx"; then
4914 shared) echo "Found -l$thislib (shared)." ;;
4915 static) echo "Found -l$thislib." ;;
4916 *) echo "Found -l$thislib ($libstyle)." ;;
4920 *) dflt="$dflt -l$thislib"
4921 libsfound="$libsfound $xxx"
4923 libsfiles="$libsfiles $yyy"
4924 yyy=`echo $xxx|$sed -e "s%/$yyy\\$%%"`
4925 case " $libsdirs " in
4927 *) libsdirs="$libsdirs $yyy" ;;
4934 if $test ! -f "$xxx"; then
4935 echo "No -l$thislib."
4946 ' '|'') dflt='none';;
4951 In order to compile $package on your machine, a number of libraries
4952 are usually needed. Include any other special libraries here as well.
4953 Say "none" for none. The default list is almost always right.
4957 rp="What libraries to use?"
4964 : determine optimization, if desired, or use for debug flag also
4966 ' '|$undef) dflt='none';;
4968 *) dflt="$optimize";;
4972 By default, $package compiles with the -O flag to use the optimizer.
4973 Alternately, you might want to use the symbolic debugger, which uses
4974 the -g flag (on traditional Unix systems). Either flag can be
4975 specified here. To use neither flag, specify the word "none".
4978 rp="What optimizer/debugger flag should be used?"
4982 'none') optimize=" ";;
4985 : Check what DEBUGGING is required from the command line
4986 : -DEBUGGING or -DDEBUGGING or
4987 : -DEBUGGING=both = -g + -DDEBUGGING
4988 : -DEBUGGING=-g or -Doptimize=-g = -g
4989 : -DEBUGGING=none or -UDEBUGGING =
4990 : -DEBUGGING=old or -DEBUGGING=default = ? $optimize
4993 *) DEBUGGING=$EBUGGING ;;
4996 case "$DEBUGGING" in
5000 *) optimize="$optimize -g" ;;
5004 *-g*) set `echo "X $optimize " | sed 's/ -g / /'`
5012 case "$DEBUGGING" in
5013 both|$define) dflt='-DDEBUGGING'
5016 : We will not override a previous value, but we might want to
5017 : augment a hint file
5019 default|recommended)
5020 case "$gccversion" in
5021 1*) dflt="$dflt -fpcc-struct-return" ;;
5023 case "$optimize:$DEBUGGING" in
5024 *-g*:old) dflt="$dflt -DDEBUGGING";;
5026 case "$gccversion" in
5027 2*) if test -d /etc/conf/kconfig.d &&
5028 $contains _POSIX_VERSION $usrinc/sys/unistd.h >/dev/null 2>&1
5030 # Interactive Systems (ISC) POSIX mode.
5035 case "$gccversion" in
5039 echo "Checking if your compiler accepts -fno-strict-aliasing" 2>&1
5040 echo 'int main(void) { return 0; }' > gcctest.c
5041 if $cc -O2 -fno-strict-aliasing -o gcctest gcctest.c; then
5042 echo "Yes, it does." 2>&1
5045 echo "Leaving current flags $ccflags alone." 2>&1
5047 *) dflt="$dflt -fno-strict-aliasing" ;;
5050 echo "Nope, it doesn't, but that's ok." 2>&1
5054 # For gcc, adding -pipe speeds up compilations for some, but apparently
5055 # some assemblers can't read from stdin. (It also slows down compilations
5056 # in other cases, but those are apparently rarer these days.) AD 5/2004.
5057 case "$gccversion" in
5059 echo "Checking if your compiler accepts -pipe" 2>&1
5060 echo 'int main(void) { return 0; }' > gcctest.c
5061 if $cc -pipe -o gcctest gcctest.c; then
5062 echo "Yes, it does." 2>&1
5065 echo "Leaving current flags $ccflags alone." 2>&1
5067 *) dflt="$dflt -pipe" ;;
5070 echo "Nope, it doesn't, but that's ok." 2>&1
5077 case "$mips_type" in
5078 *BSD*|'') inclwanted="$locincpth $usrinc";;
5079 *) inclwanted="$locincpth $inclwanted $usrinc/bsd";;
5081 for thisincl in $inclwanted; do
5082 if $test -d $thisincl; then
5083 if $test x$thisincl != x$usrinc; then
5085 *" -I$thisincl "*);;
5086 *) dflt="$dflt -I$thisincl ";;
5092 inctest='if $contains $2 $usrinc/$1 >/dev/null 2>&1; then
5094 elif $contains $2 $usrinc/sys/$1 >/dev/null 2>&1; then
5102 *) dflt="$dflt -D$2";;
5106 set signal.h LANGUAGE_C; eval $inctest
5110 ccflags="$ccflags -DSOCKS"
5115 default|recommended) dflt="$ccflags $dflt" ;;
5116 *) dflt="$ccflags";;
5125 Your C compiler may want other flags. For this question you should include
5126 -I/whatever and -DWHATEVER flags and any other flags used by the C compiler,
5127 but you should NOT include libraries or ld flags like -lwhatever. If you
5128 want $package to honor its debug switch, you should include -DDEBUGGING here.
5129 Your C compiler might also need additional flags, such as -D_POSIX_SOURCE.
5131 To use no flags, specify the word "none".
5137 rp="Any additional cc flags?"
5144 : the following weeds options from ccflags that are of no interest to cpp
5146 '') cppflags="$ccflags" ;;
5147 *) cppflags="$cppflags $ccflags" ;;
5149 case "$gccversion" in
5150 1*) cppflags="$cppflags -D__GNUC__"
5152 case "$mips_type" in
5154 *BSD*) cppflags="$cppflags -DSYSTYPE_BSD43";;
5160 echo "Let me guess what the preprocessor flags are..." >&4
5174 *) ftry="$previous $flag";;
5176 if $cppstdin -DLFRULB=bar $cppflags $ftry $cppminus <cpp.c \
5177 >cpp1.out 2>/dev/null && \
5178 $cpprun -DLFRULB=bar $cppflags $ftry $cpplast <cpp.c \
5179 >cpp2.out 2>/dev/null && \
5180 $contains 'foo.*xx.*bar' cpp1.out >/dev/null 2>&1 && \
5181 $contains 'foo.*xx.*bar' cpp2.out >/dev/null 2>&1
5183 cppflags="$cppflags $ftry"
5193 *-*) echo "They appear to be: $cppflags";;
5195 $rm -f cpp.c cpp?.out
5199 : flags used in final linking phase
5201 '') if ./venix; then
5207 *-posix*) dflt="$dflt -posix" ;;
5210 *) dflt="$ldflags";;
5213 : Try to guess additional flags to pick up local libraries.
5214 for thislibdir in $libpth; do
5215 case " $loclibpth " in
5218 *"-L$thislibdir "*) ;;
5219 *) dflt="$dflt -L$thislibdir" ;;
5231 Your C linker may need flags. For this question you should
5232 include -L/whatever and any other flags used by the C linker, but you
5233 should NOT include libraries like -lwhatever.
5235 Make sure you include the appropriate -L/path flags if your C linker
5236 does not normally search all of the directories you specified above,
5239 To use no flags, specify the word "none".
5243 rp="Any additional ld flags (NOT including libraries)?"
5249 rmlist="$rmlist pdp11"
5253 echo "Checking your choice of C compiler and flags for coherency..." >&4
5254 $cat > try.c <<'EOF'
5256 int main() { printf("Ok\n"); return(0); }
5258 set X $cc -o try $optimize $ccflags $ldflags try.c $libs
5260 $cat >try.msg <<'EOM'
5261 I've tried to compile and run the following simple program:
5264 $cat try.c >> try.msg
5266 $cat >> try.msg <<EOM
5273 and I got the following output:
5277 if $sh -c "$cc -o try $optimize $ccflags $ldflags try.c $libs" >>try.msg 2>&1; then
5278 if $sh -c "$run ./try" >>try.msg 2>&1; then
5282 *) echo 'The program compiled OK, but produced no output.' >> try.msg
5285 cat >> try.msg <<'EOQS'
5286 If $libs contains -lsfio, and sfio is mis-configured, then it
5287 sometimes (apparently) runs and exits with a 0 status, but with no
5288 output! It may have to do with sfio's use of _exit vs. exit.
5291 rp="You have a big problem. Shall I abort Configure"
5298 echo "The program compiled OK, but exited with status $?." >>try.msg
5299 rp="You have a problem. Shall I abort Configure"
5303 echo "I can't compile the test program." >>try.msg
5304 rp="You have a BIG problem. Shall I abort Configure"
5310 case "$knowitall" in
5312 echo "(The supplied flags or libraries might be incorrect.)"
5320 *) echo "Ok. Stopping Configure." >&4
5325 n) echo "OK, that should do.";;
5327 $rm -f try try.* core
5329 : define a shorthand compile call
5333 $cc -o ${mc_file} $optimize $ccflags $ldflags $* ${mc_file}.c $libs > /dev/null 2>&1;'
5334 : define a shorthand compile call for compilations that should be ok.
5338 $cc -o ${mc_file} $optimize $ccflags $ldflags $* ${mc_file}.c $libs;'
5340 : determine filename position in cpp output
5342 echo "Computing filename position in cpp output for #include directives..." >&4
5344 vos) testaccess=-e ;;
5347 echo '#include <stdio.h>' > foo.c
5350 $cppstdin $cppflags $cppminus <foo.c 2>/dev/null | \
5351 $grep '^[ ]*#.*stdio\.h' | \
5352 while read cline; do
5355 while $test \$# -gt 0; do
5356 if $test $testaccess \`echo \$1 | $tr -d '"'\`; then
5361 pos=\`expr \$pos + 1\`
5373 *) pos="${fieldn}th";;
5375 echo "Your cpp writes the filename in the $pos field of the line."
5378 vos) cppfilter="tr '\\\\>' '/' |" ;; # path component separator is >
5379 os2) cppfilter="sed -e 's|\\\\\\\\|/|g' |" ;; # path component separator is \
5382 : locate header file
5387 for usrincdir in $usrinc
5389 if test -f \$usrincdir/\$wanted; then
5390 echo "\$usrincdir/\$wanted"
5394 awkprg='{ print \$$fieldn }'
5395 echo "#include <\$wanted>" > foo\$\$.c
5396 $cppstdin $cppminus $cppflags < foo\$\$.c 2>/dev/null | \
5397 $cppfilter $grep "^[ ]*#.*\$wanted" | \
5398 while read cline; do
5399 name=\`echo \$cline | $awk "\$awkprg" | $tr -d '"'\`
5401 *[/\\\\]\$wanted) echo "\$name"; exit 1;;
5402 *[\\\\/]\$wanted) echo "\$name"; exit 1;;
5407 # status = 0: grep returned 0 lines, case statement not executed
5408 # status = 1: headerfile found
5409 # status = 2: while loop executed, no headerfile found
5413 if test \$status -eq 1; then
5420 : define an alternate in-header-list? function
5421 inhdr='echo " "; td=$define; tu=$undef; yyy=$@;
5422 cont=true; xxf="echo \"<\$1> found.\" >&4";
5423 case $# in 2) xxnf="echo \"<\$1> NOT found.\" >&4";;
5424 *) xxnf="echo \"<\$1> NOT found, ...\" >&4";;
5426 case $# in 4) instead=instead;; *) instead="at last";; esac;
5427 while $test "$cont"; do
5429 var=$2; eval "was=\$$2";
5430 if $test "$xxx" && $test -r "$xxx";
5432 eval "case \"\$$var\" in $undef) . ./whoa; esac"; eval "$var=\$td";
5435 eval "case \"\$$var\" in $define) . ./whoa; esac"; eval "$var=\$tu"; fi;
5436 set $yyy; shift; shift; yyy=$@;
5437 case $# in 0) cont="";;
5438 2) xxf="echo \"but I found <\$1> $instead.\" >&4";
5439 xxnf="echo \"and I did not find <\$1> either.\" >&4";;
5440 *) xxf="echo \"but I found <\$1\> instead.\" >&4";
5441 xxnf="echo \"there is no <\$1>, ...\" >&4";;
5445 do set $yyy; var=$2; eval "was=\$$2";
5446 eval "case \"\$$var\" in $define) . ./whoa; esac"; eval "$var=\$tu";
5447 set $yyy; shift; shift; yyy=$@;
5450 : see if stdlib is available
5451 set stdlib.h i_stdlib
5454 : check for lengths of integral types
5458 echo "Checking to see how big your integers are..." >&4
5467 printf("intsize=%d;\n", (int)sizeof(int));
5468 printf("longsize=%d;\n", (int)sizeof(long));
5469 printf("shortsize=%d;\n", (int)sizeof(short));
5474 if eval $compile_ok && $run ./try > /dev/null; then
5476 echo "Your integers are $intsize bytes long."
5477 echo "Your long integers are $longsize bytes long."
5478 echo "Your short integers are $shortsize bytes long."
5482 Help! I can't compile and run the intsize test program: please enlighten me!
5483 (This is probably a misconfiguration in your system or libraries, and
5484 you really ought to fix it. Still, I'll try anyway.)
5488 rp="What is the size of an integer (in bytes)?"
5492 rp="What is the size of a long integer (in bytes)?"
5496 rp="What is the size of a short integer (in bytes)?"
5504 : check for long long
5506 echo "Checking to see if you have long long..." >&4
5507 echo 'int main() { long long x = 7; return 0; }' > try.c
5509 if eval $compile; then
5511 echo "You have long long."
5514 echo "You do not have long long."
5520 : check for length of long long
5521 case "${d_longlong}${longlongsize}" in
5524 echo "Checking to see how big your long longs are..." >&4
5525 $cat >try.c <<'EOCP'
5529 printf("%d\n", (int)sizeof(long long));
5534 if eval $compile_ok; then
5535 longlongsize=`$run ./try`
5536 echo "Your long longs are $longlongsize bytes long."
5540 echo "(I can't seem to compile the test program. Guessing...)"
5541 rp="What is the size of a long long (in bytes)?"
5545 if $test "X$longsize" = "X$longlongsize"; then
5546 echo "(That isn't any different from an ordinary long.)"
5552 : see if inttypes.h is available
5553 : we want a real compile instead of Inhdr because some systems
5554 : have an inttypes.h which includes non-existent headers
5557 #include <inttypes.h>
5559 static int32_t foo32 = 0x12345678;
5563 if eval $compile; then
5564 echo "<inttypes.h> found." >&4
5567 echo "<inttypes.h> NOT found." >&4
5576 echo "Checking to see if you have int64_t..." >&4
5578 #include <sys/types.h>
5579 #$i_inttypes I_INTTYPES
5581 #include <inttypes.h>
5583 int main() { int64_t x = 7; }
5586 if eval $compile; then
5588 echo "You have int64_t."
5591 echo "You do not have int64_t."
5599 echo "Checking which 64-bit integer type we could use..." >&4
5605 val='"unsigned int"'
5610 *) case "$longsize" in
5614 val='"unsigned long"'
5619 *) case "$d_longlong:$longlongsize" in
5624 val='"unsigned long long"'
5629 *) case "$d_int64_t" in
5648 '') echo "Alas, no 64-bit integer types in sight." >&4
5651 *) echo "We could use '$quadtype' for 64-bit integers." >&4
5657 case "$uselonglong" in
5658 "$define"|true|[yY]*)
5661 *** Configure -Duselonglong is deprecated, using -Duse64bitint instead.
5663 use64bitint="$define"
5666 case "$use64bits" in
5667 "$define"|true|[yY]*)
5670 *** Configure -Duse64bits is deprecated, using -Duse64bitint instead.
5672 use64bitint="$define"
5675 case "$use64bitints" in
5676 "$define"|true|[yY]*)
5679 *** There is no Configure -Duse64bitints, using -Duse64bitint instead.
5681 use64bitint="$define"
5684 case "$use64bitsint" in
5685 "$define"|true|[yY]*)
5688 *** There is no Configure -Duse64bitsint, using -Duse64bitint instead.
5690 use64bitint="$define"
5693 case "$uselonglongs" in
5694 "$define"|true|[yY]*)
5697 *** There is no Configure -Duselonglongs, using -Duse64bitint instead.
5699 use64bitint="$define"
5702 case "$use64bitsall" in
5703 "$define"|true|[yY]*)
5706 *** There is no Configure -Duse64bitsall, using -Duse64bitall instead.
5708 use64bitall="$define"
5713 *-DUSE_LONG_LONG*|*-DUSE_64_BIT_INT*|*-DUSE_64_BIT_ALL*) use64bitint="$define";;
5715 case "$use64bitall" in
5716 "$define"|true|[yY]*) use64bitint="$define" ;;
5722 You have natively 64-bit long integers.
5726 *) case "$use64bitint" in
5727 "$define"|true|[yY]*) dflt='y';;
5736 Perl can be built to take advantage of 64-bit integer types
5737 on some systems. To do so, Configure can be run with -Duse64bitint.
5738 Choosing this option will most probably introduce binary incompatibilities.
5740 If this doesn't make any sense to you, just accept the default '$dflt'.
5741 (The default has been chosen based on your configuration.)
5743 rp='Try to use 64-bit integers, if available?'
5746 [yY]*) val="$define" ;;
5754 case "$use64bitall" in
5755 "$define"|true|[yY]*) dflt='y' ;;
5756 *) case "$longsize" in
5764 You may also choose to try maximal 64-bitness. It means using as much
5765 64-bitness as possible on the platform. This in turn means even more
5766 binary incompatibilities. On the other hand, your platform may not
5767 have any more 64-bitness available than what you already have chosen.
5769 If this doesn't make any sense to you, just accept the default '$dflt'.
5770 (The default has been chosen based on your configuration.)
5772 rp='Try to use maximal 64-bit support, if available?'
5775 [yY]*) val="$define" ;;
5780 case "$use64bitall" in
5782 case "$use64bitint" in
5786 Since you have chosen a maximally 64-bit build, I'm also turning on
5787 the use of 64-bit integers.
5789 use64bitint="$define" ;;
5794 : Look for a hint-file generated 'call-back-unit'. If the
5795 : user has specified that a 64-bit perl is to be built,
5796 : we may need to set or change some other defaults.
5797 if $test -f use64bitint.cbu; then
5798 echo "Your platform has some specific hints regarding 64-bit integers, using them..."
5801 case "$use64bitint" in
5802 "$define"|true|[yY]*)
5804 4) case "$archname64" in
5805 '') archname64=64int ;;
5812 : Look for a hint-file generated 'call-back-unit'. If the
5813 : user has specified that a maximally 64-bit perl is to be built,
5814 : we may need to set or change some other defaults.
5815 if $test -f use64bitall.cbu; then
5816 echo "Your platform has some specific hints regarding 64-bit builds, using them..."
5819 case "$use64bitall" in
5820 "$define"|true|[yY]*)
5822 4) case "$archname64" in
5823 ''|64int) archname64=64all ;;
5830 case "$d_quad:$use64bitint" in
5834 *** You have chosen to use 64-bit integers,
5835 *** but none can be found.
5836 *** Please rerun Configure without -Duse64bitint and/or -Dusemorebits.
5837 *** Cannot continue, aborting.
5844 : check for length of double
5846 case "$doublesize" in
5848 echo "Checking to see how big your double precision numbers are..." >&4
5857 printf("%d\n", (int)sizeof(double));
5862 if eval $compile_ok; then
5863 doublesize=`$run ./try`
5864 echo "Your double is $doublesize bytes long."
5867 echo "(I can't seem to compile the test program. Guessing...)"
5868 rp="What is the size of a double precision number (in bytes)?"
5876 : check for long doubles
5878 echo "Checking to see if you have long double..." >&4
5879 echo 'int main() { long double x = 7.0; }' > try.c
5881 if eval $compile; then
5883 echo "You have long double."
5886 echo "You do not have long double."
5892 : check for length of long double
5893 case "${d_longdbl}${longdblsize}" in
5896 echo "Checking to see how big your long doubles are..." >&4
5897 $cat >try.c <<'EOCP'
5901 printf("%d\n", sizeof(long double));
5906 if eval $compile; then
5907 longdblsize=`$run ./try`
5908 echo "Your long doubles are $longdblsize bytes long."
5912 echo "(I can't seem to compile the test program. Guessing...)" >&4
5913 rp="What is the size of a long double (in bytes)?"
5917 if $test "X$doublesize" = "X$longdblsize"; then
5918 echo "That isn't any different from an ordinary double."
5919 echo "I'll keep your setting anyway, but you may see some"
5920 echo "harmless compilation warnings."
5926 : determine the architecture name
5928 if xxx=`./loc arch blurfl $pth`; $test -f "$xxx"; then
5929 tarch=`arch`"-$osname"
5930 elif xxx=`./loc uname blurfl $pth`; $test -f "$xxx" ; then
5931 if uname -m > tmparch 2>&1 ; then
5932 tarch=`$sed -e 's/ *$//' -e 's/ /_/g' \
5933 -e 's/$/'"-$osname/" tmparch`
5941 case "$myarchname" in
5944 echo "(Your architecture name used to be $myarchname.)"
5948 case "$targetarch" in
5950 *) archname=`echo $targetarch|sed 's,^[^-]*-,,'` ;;
5955 *) dflt="$archname";;
5957 rp='What is your architecture name'
5960 case "$usethreads" in
5962 echo "Threads selected." >&4
5964 *-thread*) echo "...and architecture name already has -thread." >&4
5966 *) archname="$archname-thread"
5967 echo "...setting architecture name to $archname." >&4
5972 case "$usemultiplicity" in
5974 echo "Multiplicity selected." >&4
5976 *-multi*) echo "...and architecture name already has -multi." >&4
5978 *) archname="$archname-multi"
5979 echo "...setting architecture name to $archname." >&4
5984 case "$use64bitint$use64bitall" in
5986 case "$archname64" in
5988 echo "This architecture is naturally 64-bit, not changing architecture name." >&4
5991 case "$use64bitint" in
5992 "$define") echo "64 bit integers selected." >&4 ;;
5994 case "$use64bitall" in
5995 "$define") echo "Maximal 64 bitness selected." >&4 ;;
5998 *-$archname64*) echo "...and architecture name already has $archname64." >&4
6000 *) archname="$archname-$archname64"
6001 echo "...setting architecture name to $archname." >&4
6007 case "$uselongdouble" in
6009 echo "Long doubles selected." >&4
6010 case "$longdblsize" in
6012 echo "...but long doubles are equal to doubles, not changing architecture name." >&4
6016 *-ld*) echo "...and architecture name already has -ld." >&4
6018 *) archname="$archname-ld"
6019 echo "...setting architecture name to $archname." >&4
6026 case "$useperlio" in
6028 echo "Perlio selected." >&4
6031 echo "Perlio not selected, using stdio." >&4
6033 *-stdio*) echo "...and architecture name already has -stdio." >&4
6035 *) archname="$archname-stdio"
6036 echo "...setting architecture name to $archname." >&4
6041 if $test -f archname.cbu; then
6042 echo "Your platform has some specific hints for architecture name, using them..."
6046 : set the prefixit variable, to compute a suitable default value
6047 prefixit='case "$3" in
6049 case "$oldprefix" in
6050 "") eval "$1=\"\$$2\"";;
6057 ""|" ") eval "$1=\"\$$2\"";;
6063 eval "tp=\"$oldprefix-\$$2-\""; eval "tp=\"$tp\"";
6065 --|/*--|\~*--) eval "$1=\"$prefix/$3\"";;
6066 /*-$oldprefix/*|\~*-$oldprefix/*)
6067 eval "$1=\`echo \$$2 | sed \"s,^$oldprefix,$prefix,\"\`";;
6068 *) eval "$1=\"\$$2\"";;
6072 : determine installation style
6073 : For now, try to deduce it from prefix unless it is already set.
6074 : Reproduce behavior of 5.005 and earlier, maybe drop that in 5.7.
6075 case "$installstyle" in
6076 '') case "$prefix" in
6077 *perl*) dflt='lib';;
6078 *) dflt='lib/perl5' ;;
6081 *) dflt="$installstyle" ;;
6083 : Probably not worth prompting for this since we prompt for all
6084 : the directories individually, and the prompt would be too long and
6088 : determine where public executables go
6093 rp='Pathname where the public executables will reside?'
6095 if $test "X$ansexp" != "X$binexp"; then
6099 : XXX Bug? -- ignores Configure -Dinstallprefix setting.
6100 : XXX If this is fixed, also fix the "start perl" hunk below, which relies on
6101 : this via initialinstalllocation
6104 case "$userelocatableinc" in
6105 $define|true|[yY]*) dflt='y' ;;
6110 Would you like to build Perl so that the installation is relocatable, so that
6111 library paths in @INC are determined relative to the path of the perl binary?
6112 This is not advised for system Perl installs, or if you need to run setid
6113 scripts or scripts under taint mode.
6115 If this doesn't make any sense to you, just accept the default '$dflt'.
6117 rp='Use relocatable @INC?'
6120 y|Y) val="$define" ;;
6123 set userelocatableinc
6126 initialinstalllocation="$binexp"
6127 : Default prefix is now "up one level from where the binaries are"
6128 case "$userelocatableinc" in
6134 installprefixexp=".../.."
6138 : determine where private library files go
6139 : Usual default is /usr/local/lib/perl5/$version.
6140 : Also allow things like /opt/perl/lib/$version, since
6141 : /opt/perl/lib/perl5... would be redundant.
6142 : The default "style" setting is made in installstyle.U
6143 case "$installstyle" in
6144 *lib/perl5*) set dflt privlib lib/$package/$version ;;
6145 *) set dflt privlib lib/$version ;;
6150 There are some auxiliary files for $package that need to be put into a
6151 private library directory that is accessible by everyone.
6156 rp='Pathname where the private library files will reside?'
6161 : set the prefixup variable, to restore leading tilda escape
6162 prefixup='case "$prefixexp" in
6164 *) eval "$1=\`echo \$$1 | sed \"s,^$prefixexp,$prefix,\"\`";;
6167 : determine where public architecture dependent libraries go
6170 : privlib default is /usr/local/lib/$package/$version
6171 : archlib default is /usr/local/lib/$package/$version/$archname
6172 : privlib may have an optional trailing /share.
6173 tdflt=`echo $privlib | $sed 's,/share$,,'`
6174 tdflt=$tdflt/$archname
6183 $spackage contains architecture-dependent library files. If you are
6184 sharing libraries in a heterogeneous environment, you might store
6185 these files in a separate location. Otherwise, you can just include
6186 them with the rest of the public library files.
6191 rp='Where do you want to put the public architecture-dependent libraries?'
6195 if $test X"$archlib" = X"$privlib"; then
6201 : see if setuid scripts can be secure
6204 Some kernels have a bug that prevents setuid #! scripts from being
6205 secure. Some sites have disabled setuid #! scripts because of this.
6207 First let's decide if your kernel supports secure setuid #! scripts.
6208 (If setuid #! scripts would be secure but have been disabled anyway,
6209 don't say that they are secure if asked.)
6214 if $test -d /dev/fd; then
6215 echo "#!$ls" >reflect
6216 chmod +x,u+s reflect
6217 ./reflect >flect 2>&1
6218 if $contains "/dev/fd" flect >/dev/null; then
6219 echo "Congratulations, your kernel has secure setuid scripts!" >&4
6223 If you are not sure if they are secure, I can check but I'll need a
6224 username and password different from the one you are using right now.
6225 If you don't have such a username or don't want me to test, simply
6229 rp='Other username to test security of setuid scripts with?'
6234 case "$d_suidsafe" in
6235 '') echo "I'll assume setuid scripts are *not* secure." >&4
6238 echo "Well, the $hint value is *not* secure." >&4
6240 *) echo "Well, the $hint value *is* secure." >&4
6245 $rm -f reflect flect
6246 echo "#!$ls" >reflect
6247 chmod +x,u+s reflect
6250 echo '"su" will (probably) prompt you for '"$ans's password."
6251 su $ans -c './reflect >flect'
6252 if $contains "/dev/fd" flect >/dev/null; then
6253 echo "Okay, it looks like setuid scripts are secure." >&4
6256 echo "I don't think setuid scripts are secure." >&4
6261 rp='Does your kernel have *secure* setuid scripts?'
6264 [yY]*) val="$define";;
6269 echo "I don't think setuid scripts are secure (no /dev/fd directory)." >&4
6270 echo "(That's for file descriptors, not floppy disks.)"
6276 $rm -f reflect flect
6278 : now see if they want to do setuid emulation
6281 case "$d_suidsafe" in
6284 echo "No need to emulate SUID scripts since they are secure here." >&4
6288 Some systems have disabled setuid scripts, especially systems where
6289 setuid scripts cannot be secure. On systems where setuid scripts have
6290 been disabled, the setuid/setgid bits on scripts are currently
6291 useless. It is possible for $package to detect those bits and emulate
6292 setuid/setgid in a secure fashion. This emulation will only work if
6293 setuid scripts have been disabled in your kernel.
6297 "$define") dflt=y ;;
6300 rp="Do you want to do setuid/setgid emulation?"
6303 [yY]*) val="$define";;
6311 : Find perl5.005 or later.
6312 echo "Looking for a previously installed perl5.005 or later... "
6314 '') for tdir in `echo "$binexp$path_sep$PATH" | $sed "s/$path_sep/ /g"`; do
6315 : Check if this perl is recent and can load a simple module
6316 if $test -x $tdir/perl$exe_ext && $tdir/perl -Mless -e 'use 5.005;' >/dev/null 2>&1; then
6319 elif $test -x $tdir/perl5$exe_ext && $tdir/perl5 -Mless -e 'use 5.005;' >/dev/null 2>&1; then
6329 '') echo "None found. That's ok.";;
6330 *) echo "Using $perl5." ;;
6335 After $package is installed, you may wish to install various
6336 add-on modules and utilities. Typically, these add-ons will
6337 be installed under $prefix with the rest
6338 of this package. However, you may wish to install such add-ons
6339 elsewhere under a different prefix.
6341 If you do not wish to put everything under a single prefix, that's
6342 ok. You will be prompted for the individual locations; this siteprefix
6343 is only used to suggest the defaults.
6345 The default should be fine for most people.
6349 rp='Installation prefix to use for add-on modules and utilities?'
6350 : XXX Here might be another good place for an installstyle setting.
6351 case "$siteprefix" in
6353 *) dflt=$siteprefix ;;
6356 : XXX Prefixit unit does not yet support siteprefix and vendorprefix
6358 case "$siteprefix" in
6362 *) oldsiteprefix="$prefix";;
6367 siteprefixexp="$ansexp"
6369 : determine where site specific libraries go.
6370 : Usual default is /usr/local/lib/perl5/site_perl/$version
6371 : The default "style" setting is made in installstyle.U
6372 : XXX No longer works with Prefixit stuff.
6373 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
6375 '') case "$installstyle" in
6376 *lib/perl5*) dflt=$siteprefix/lib/$package/site_$prog/$version ;;
6377 *) dflt=$siteprefix/lib/site_$prog/$version ;;
6385 The installation process will create a directory for
6386 site-specific extensions and modules. Most users find it convenient
6387 to place all site-specific files in this directory rather than in the
6388 main distribution directory.
6392 rp='Pathname for the site-specific library files?'
6396 sitelib_stem=`echo "$sitelibexp" | sed "s,/$version$,,"`
6398 : Determine list of previous versions to include in @INC
6399 $cat > getverlist <<EOPL
6402 \$api_versionstring = "$api_versionstring";
6403 \$version = "$version";
6404 \$stem = "$sitelib_stem";
6405 \$archname = "$archname";
6407 $cat >> getverlist <<'EOPL'
6408 # The list found is store twice for each entry: the original name, and
6409 # the binary broken down version as pack "sss", so sorting is easy and
6410 # unambiguous. This will work for all versions that have a maximum of
6411 # three digit groups, separate by '.'s or '_'s. Names are extended with
6412 # ".0.0" to ensure at least three elements for the pack.
6413 # -- H.Merijn Brand (m)'06 23-10-2006
6415 # Can't have leading @ because metaconfig interprets it as a command!
6416 ;@inc_version_list=();
6417 # XXX Redo to do opendir/readdir?
6420 ;@candidates = map {
6421 [ $_, pack "sss", split m/[._]/, "$_.0.0" ] } glob("5.*");
6427 ($pversion, $aversion, $vsn5005) = map {
6428 pack "sss", split m/[._]/, "$_.0.0" } $version, $api_versionstring, "5.005";
6429 foreach $d (@candidates) {
6430 if ($d->[1] lt $pversion) {
6431 if ($d->[1] ge $aversion) {
6432 unshift(@inc_version_list, grep { -d } $d->[0]."/$archname", $d->[0]);
6434 elsif ($d->[1] ge $vsn5005) {
6435 unshift(@inc_version_list, grep { -d } $d->[0]);
6439 # Skip newer version. I.e. don't look in
6440 # 5.7.0 if we're installing 5.6.1.
6444 if (@inc_version_list) {
6445 print join(' ', @inc_version_list);
6448 # Blank space to preserve value for next Configure run.
6453 case "$inc_version_list" in
6454 '') if test -x "$perl5$exe_ext"; then
6455 dflt=`$perl5 getverlist`
6460 $undef) dflt='none' ;;
6461 *) eval dflt=\"$inc_version_list\" ;;
6464 ''|' ') dflt=none ;;
6471 In order to ease the process of upgrading, this version of perl
6472 can be configured to use modules built and installed with earlier
6473 versions of perl that were installed under $prefix. Specify here
6474 the list of earlier versions that this version of perl should check.
6475 If Configure detected no earlier versions of perl installed under
6476 $prefix, then the list will be empty. Answer 'none' to tell perl
6477 to not search earlier versions.
6479 The default should almost always be sensible, so if you're not sure,
6480 just accept the default.
6483 rp='List of earlier versions to include in @INC?'
6486 [Nn]one|''|' '|$undef) inc_version_list=' ' ;;
6487 *) inc_version_list="$ans" ;;
6489 case "$inc_version_list" in
6491 inc_version_list_init='0'
6492 d_inc_version_list="$undef"
6494 *) inc_version_list_init=`echo $inc_version_list |
6495 $sed -e 's/^/"/' -e 's/ /","/g' -e 's/$/",0/'`
6496 d_inc_version_list="$define"
6501 : see if this is a malloc.h system
6502 : we want a real compile instead of Inhdr because some systems have a
6503 : malloc.h that just gives a compile error saying to use stdlib.h instead
6508 int main () { return 0; }
6511 if eval $compile; then
6512 echo "<malloc.h> found." >&4
6515 echo "<malloc.h> NOT found." >&4
6522 : check for void type
6524 echo "Checking to see how well your C compiler groks the void type..." >&4
6525 case "$voidflags" in
6537 extern void moo(); /* function returning void */
6538 void (*goo)(); /* ptr to func returning void */
6540 void *hue; /* generic ptr */
6553 int main() { sub(); }
6555 if $cc $ccflags -c -DTRY=$defvoidused try.c >.out 2>&1 ; then
6556 voidflags=$defvoidused
6557 echo "Good. It appears to support void to the level $package wants.">&4
6558 if $contains warning .out >/dev/null 2>&1; then
6559 echo "However, you might get some warnings that look like this:"
6563 echo "Hmm, your compiler has some difficulty with void. Checking further..." >&4
6564 if $cc $ccflags -c -DTRY=1 try.c >/dev/null 2>&1; then
6565 echo "It supports 1..."
6566 if $cc $ccflags -c -DTRY=3 try.c >/dev/null 2>&1; then
6567 echo "It also supports 2..."
6568 if $cc $ccflags -c -DTRY=7 try.c >/dev/null 2>&1; then
6570 echo "And it supports 4 but not 8 definitely."
6572 echo "It doesn't support 4..."
6573 if $cc $ccflags -c -DTRY=11 try.c >/dev/null 2>&1; then
6575 echo "But it supports 8."
6578 echo "Neither does it support 8."
6582 echo "It does not support 2..."
6583 if $cc $ccflags -c -DTRY=13 try.c >/dev/null 2>&1; then
6585 echo "But it supports 4 and 8."
6587 if $cc $ccflags -c -DTRY=5 try.c >/dev/null 2>&1; then
6589 echo "And it supports 4 but has not heard about 8."
6591 echo "However it supports 8 but not 4."
6596 echo "There is no support at all for void."
6601 case "$voidflags" in
6604 Support flag bits are:
6605 1: basic void declarations.
6606 2: arrays of pointers to functions returning void.
6607 4: operations between pointers to and addresses of void functions.
6608 8: generic void pointers.
6611 rp="Your void support flags add up to what?"
6618 : check for length of pointer
6622 echo "Checking to see how big your pointers are..." >&4
6623 if test "$voidflags" -gt 7; then
6624 echo '#define VOID_PTR char *' > try.c
6626 echo '#define VOID_PTR void *' > try.c
6636 printf("%d\n", (int)sizeof(VOID_PTR));
6641 if eval $compile_ok; then
6642 ptrsize=`$run ./try`
6643 echo "Your pointers are $ptrsize bytes long."
6646 echo "(I can't seem to compile the test program. Guessing...)" >&4
6647 rp="What is the size of a pointer (in bytes)?"
6654 case "$use64bitall" in
6655 "$define"|true|[yY]*)
6659 *** You have chosen a maximally 64-bit build,
6660 *** but your pointers are only 4 bytes wide.
6661 *** Please rerun Configure without -Duse64bitall.
6666 *** Since you have quads, you could possibly try with -Duse64bitint.
6671 *** Cannot continue, aborting.
6682 : determine whether to use malloc wrapping
6684 case "$usemallocwrap" in
6685 [yY]*|true|$define) dflt='y' ;;
6686 [nN]*|false|$undef) dflt='n' ;;
6687 *) case "$usedevel" in
6688 [yY]*|true|$define) dflt='y' ;;
6693 rp="Do you wish to wrap malloc calls to protect against potential overflows?"
6695 usemallocwrap="$ans"
6698 usemallocwrap="$define" ;;
6700 usemallocwrap="$undef" ;;
6703 : determine which malloc to compile in
6705 case "$usemymalloc" in
6706 [yY]*|true|$define) dflt='y' ;;
6707 [nN]*|false|$undef) dflt='n' ;;
6708 *) case "$ptrsize" in
6714 rp="Do you wish to attempt to use the malloc that comes with $package?"
6720 mallocsrc='malloc.c'
6721 mallocobj="malloc$_o"
6722 d_mymalloc="$define"
6725 : Remove malloc from list of libraries to use
6726 echo "Removing unneeded -lmalloc from library list" >&4
6727 set `echo X $libs | $sed -e 's/-lmalloc / /' -e 's/-lmalloc$//'`
6730 echo "libs = $libs" >&4
6742 : compute the return types of malloc and free
6744 $cat >malloc.c <<END
6748 #include <sys/types.h>
6762 case "$malloctype" in
6764 if $cc $ccflags -c -DTRY_MALLOC malloc.c >/dev/null 2>&1; then
6771 echo "Your system wants malloc to return '$malloctype', it would seem." >&4
6775 if $cc $ccflags -c -DTRY_FREE malloc.c >/dev/null 2>&1; then
6782 echo "Your system uses $freetype free(), it would seem." >&4
6784 : determine where site specific architecture-dependent libraries go.
6785 : sitelib default is /usr/local/lib/perl5/site_perl/$version
6786 : sitearch default is /usr/local/lib/perl5/site_perl/$version/$archname
6787 : sitelib may have an optional trailing /share.
6789 '') dflt=`echo $sitelib | $sed 's,/share$,,'`
6790 dflt="$dflt/$archname"
6795 set sitearch sitearch none
6799 The installation process will also create a directory for
6800 architecture-dependent site-specific extensions and modules.
6804 rp='Pathname for the site-specific architecture-dependent library files?'
6808 if $test X"$sitearch" = X"$sitelib"; then
6811 d_sitearch="$define"
6816 The installation process will also create a directory for
6817 vendor-supplied add-ons. Vendors who supply perl with their system
6818 may find it convenient to place all vendor-supplied files in this
6819 directory rather than in the main distribution directory. This will
6820 ease upgrades between binary-compatible maintenance versions of perl.
6822 Of course you may also use these directories in whatever way you see
6823 fit. For example, you might use them to access modules shared over a
6824 company-wide network.
6826 The default answer should be fine for most people.
6827 This causes further questions about vendor add-ons to be skipped
6828 and no vendor-specific directories will be configured for perl.
6831 rp='Do you want to configure vendor-specific add-on directories?'
6832 case "$usevendorprefix" in
6833 define|true|[yY]*) dflt=y ;;
6834 *) : User may have set vendorprefix directly on Configure command line.
6835 case "$vendorprefix" in
6844 rp='Installation prefix to use for vendor-supplied add-ons?'
6845 case "$vendorprefix" in
6847 *) dflt=$vendorprefix ;;
6850 : XXX Prefixit unit does not yet support siteprefix and vendorprefix
6852 case "$vendorprefix" in
6856 *) oldvendorprefix="$prefix";;
6860 usevendorprefix="$define"
6862 vendorprefixexp="$ansexp"
6864 *) usevendorprefix="$undef"
6870 case "$vendorprefix" in
6871 '') d_vendorlib="$undef"
6875 *) d_vendorlib="$define"
6876 : determine where vendor-supplied modules go.
6877 : Usual default is /usr/local/lib/perl5/vendor_perl/$version
6878 case "$vendorlib" in
6880 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
6881 case "$installstyle" in
6882 *lib/perl5*) dflt=$vendorprefix/lib/$package/vendor_$prog/$version ;;
6883 *) dflt=$vendorprefix/lib/vendor_$prog/$version ;;
6886 *) dflt="$vendorlib"
6890 rp='Pathname for the vendor-supplied library files?'
6893 vendorlibexp="$ansexp"
6896 vendorlib_stem=`echo "$vendorlibexp" | sed "s,/$version$,,"`
6900 case "$vendorprefix" in
6901 '') d_vendorarch="$undef"
6905 *) d_vendorarch="$define"
6906 : determine where vendor-supplied architecture-dependent libraries go.
6907 : vendorlib default is /usr/local/lib/perl5/vendor_perl/$version
6908 : vendorarch default is /usr/local/lib/perl5/vendor_perl/$version/$archname
6909 : vendorlib may have an optional trailing /share.
6910 case "$vendorarch" in
6911 '') dflt=`echo $vendorlib | $sed 's,/share$,,'`
6912 dflt="$dflt/$archname"
6914 *) dflt="$vendorarch" ;;
6917 rp='Pathname for vendor-supplied architecture-dependent files?'
6920 vendorarchexp="$ansexp"
6923 prefixvar=vendorarch
6926 : Final catch-all directories to search
6929 Lastly, you can have perl look in other directories for extensions and
6930 modules in addition to those already specified.
6931 These directories will be searched after
6935 test X"$vendorlib" != "X" && echo ' ' $vendorlib
6936 test X"$vendorarch" != "X" && echo ' ' $vendorarch
6938 case "$otherlibdirs" in
6939 ''|' ') dflt='none' ;;
6940 *) dflt="$otherlibdirs" ;;
6943 Enter a colon-separated set of extra paths to include in perl's @INC
6944 search path, or enter 'none' for no extra paths.
6948 rp='Colon-separated list of additional directories for perl to search?'
6951 ' '|''|none) otherlibdirs=' ' ;;
6952 *) otherlibdirs="$ans" ;;
6954 case "$otherlibdirs" in
6958 set d_perl_otherlibdirs
6961 : Cruising for prototypes
6963 echo "Checking out function prototypes..." >&4
6964 $cat >prototype.c <<EOCP
6969 int main(int argc, char *argv[]) {
6972 if $cc $ccflags -c prototype.c >prototype.out 2>&1 ; then
6973 echo "Your C compiler appears to support function prototypes."
6976 echo "Your C compiler doesn't seem to understand function prototypes."
6983 case "$prototype" in
6985 *) ansi2knr='ansi2knr'
6990 This version of $package can only be compiled by a compiler that
6991 understands function prototypes. Unfortunately, your C compiler
6993 doesn't seem to understand them. Sorry about that.
6995 If GNU cc is available for your system, perhaps you could try that instead.
6997 Eventually, we hope to support building Perl with pre-ANSI compilers.
6998 If you would like to help in that effort, please contact <perlbug@perl.org>.
7000 Aborting Configure now.
7012 Perl can be built with extra modules or bundles of modules which
7013 will be fetched from the CPAN and installed alongside Perl.
7015 Notice that you will need access to the CPAN; either via the Internet,
7016 or a local copy, for example a CD-ROM or a local CPAN mirror. (You will
7017 be asked later to configure the CPAN.pm module which will in turn do
7018 the installation of the rest of the extra modules or bundles.)
7020 Notice also that if the modules require any external software such as
7021 libraries and headers (the libz library and the zlib.h header for the
7022 Compress::Zlib module, for example) you MUST have any such software
7023 already installed, this configuration process will NOT install such
7026 If this doesn't make any sense to you, just accept the default '$dflt'.
7028 rp='Install any extra modules (y or n)?'
7034 Please list any extra modules or bundles to be installed from CPAN,
7035 with spaces between the names. The names can be in any format the
7036 'install' command of CPAN.pm will understand. (Answer 'none',
7037 without the quotes, to install no extra modules or bundles.)
7047 $rm -f ../extras.lst
7049 *) echo "(Saving the list of extras for later...)"
7050 echo "$extras" > ../extras.lst
7058 : determine where html pages for programs go
7059 set html1dir html1dir none
7063 If you wish to install html files for programs in $spackage, indicate
7064 the appropriate directory here. To skip installing html files,
7068 ''|none|$undef|' ') dflt=none ;;
7069 *) dflt=$html1dir ;;
7072 rp="Directory for the main $spackage html pages?"
7076 : Use ' ' for none so value is preserved next time through Configure
7077 $test X"$html1dir" = "X" && html1dir=' '
7079 : determine where html pages for libraries and modules go
7080 set html3dir html3dir none
7084 If you wish to install html files for modules associated with $spackage,
7085 indicate the appropriate directory here. To skip installing html files,
7088 : There is no obvious default. If they have specified html1dir, then
7089 : try to key off that, possibly changing .../html1 into .../html3.
7091 '') html3dir=`echo "$html1dir" | $sed 's/1$/3$/'` ;;
7092 *) dflt=$html3dir ;;
7095 rp="Directory for the $spackage module html pages?"
7099 : Use ' ' for none so value is preserved next time through Configure
7100 $test X"$html3dir" = "X" && html3dir=' '
7102 : determine whether to install perl also as /usr/bin/perl
7105 if $test -d /usr/bin -a "X$installbin" != X/usr/bin; then
7107 Many scripts expect perl to be installed as /usr/bin/perl.
7109 If you want to, I can install the perl you are about to compile
7110 as /usr/bin/perl (in addition to $bin/perl).
7112 if test -f /usr/bin/perl; then
7115 However, please note that because you already have a /usr/bin/perl,
7116 overwriting that with a new Perl would very probably cause problems.
7117 Therefore I'm assuming you don't want to do that (unless you insist).
7120 case "$installusrbinperl" in
7121 "$define"|[yY]*) dflt='y';;
7127 Since you don't have a /usr/bin/perl I'm assuming creating one is okay.
7130 case "$installusrbinperl" in
7131 "$undef"|[nN]*) dflt='n';;
7135 rp="Do you want to install perl as /usr/bin/perl?"
7138 [yY]*) val="$define";;
7144 set installusrbinperl
7148 echo "Checking for GNU C Library..." >&4
7150 /* Find out version of GNU C library. __GLIBC__ and __GLIBC_MINOR__
7151 alone are insufficient to distinguish different versions, such as
7152 2.0.6 and 2.0.7. The function gnu_get_libc_version() appeared in
7153 libc version 2.1.0. A. Dougherty, June 3, 2002.
7159 # ifdef __GLIBC_MINOR__
7160 # if __GLIBC__ >= 2 && __GLIBC_MINOR__ >= 1 && !defined(__cplusplus)
7161 # include <gnu/libc-version.h>
7162 printf("%s\n", gnu_get_libc_version());
7164 printf("%d.%d\n", __GLIBC__, __GLIBC_MINOR__);
7167 printf("%d\n", __GLIBC__);
7176 if eval $compile_ok && $run ./try > glibc.ver; then
7178 gnulibc_version=`$cat glibc.ver`
7179 echo "You are using the GNU C Library version $gnulibc_version"
7183 echo "You are not using the GNU C Library"
7185 $rm -f try try.* glibc.ver
7189 : see if nm is to be used to determine whether a symbol is defined or not
7193 case "$d_gnulibc" in
7196 echo "nm probably won't work on the GNU C Library." >&4
7202 if $test "$osname" = aix -a "X$PASE" != "Xdefine" -a ! -f /lib/syscalls.exp; then
7204 echo "Whoops! This is an AIX system without /lib/syscalls.exp!" >&4
7205 echo "'nm' won't be sufficient on this sytem." >&4
7211 '') dflt=`$egrep 'inlibc|csym' $rsrc/Configure | wc -l 2>/dev/null`
7212 if $test $dflt -gt 20; then
7222 true|$define) dflt=y;;
7229 I can use $nm to extract the symbols from your C libraries. This
7230 is a time consuming task which may generate huge output on the disk (up
7231 to 3 megabytes) but that should make the symbols extraction faster. The
7232 alternative is to skip the 'nm' extraction part and to compile a small
7233 test program instead to determine whether each symbol is present. If
7234 you have a fast C compiler and/or if your 'nm' output cannot be parsed,
7235 this may be the best solution.
7237 You probably shouldn't let me use 'nm' if you are using the GNU C Library.
7240 rp="Shall I use $nm to extract C symbols from the libraries?"
7243 [Nn]*) usenm=false;;
7252 : nm options which may be necessary
7254 '') if $test -f /mach_boot; then
7256 elif $test -d /usr/ccs/lib; then
7257 nm_opt='-p' # Solaris (and SunOS?)
7258 elif $test -f /dgux; then
7260 elif $test -f /lib64/rld; then
7261 nm_opt='-p' # 64-bit Irix
7267 : nm options which may be necessary for shared libraries but illegal
7268 : for archive libraries. Thank you, Linux.
7269 case "$nm_so_opt" in
7270 '') case "$myuname" in
7272 if $nm --help | $grep 'dynamic' > /dev/null 2>&1; then
7273 nm_so_opt='--dynamic'
7282 : get list of predefined functions in a handy place
7287 *-lc_s*) libc=`./loc libc_s$_a $libc $libpth`
7293 *) for thislib in $libs; do
7296 : Handle C library specially below.
7299 thislib=`echo $thislib | $sed -e 's/^-l//'`
7300 if try=`./loc lib$thislib.$so.'*' X $libpth`; $test -f "$try"; then
7302 elif try=`./loc lib$thislib.$so X $libpth`; $test -f "$try"; then
7304 elif try=`./loc lib$thislib$_a X $libpth`; $test -f "$try"; then
7306 elif try=`./loc $thislib$_a X $libpth`; $test -f "$try"; then
7308 elif try=`./loc lib$thislib X $libpth`; $test -f "$try"; then
7310 elif try=`./loc $thislib X $libpth`; $test -f "$try"; then
7312 elif try=`./loc Slib$thislib$_a X $xlibpth`; $test -f "$try"; then
7317 libnames="$libnames $try"
7319 *) libnames="$libnames $thislib" ;;
7328 for xxx in $libpth; do
7329 $test -r $1 || set $xxx/libc.$so
7330 : The messy sed command sorts on library version numbers.
7332 set `echo blurfl; echo $xxx/libc.$so.[0-9]* | \
7333 tr ' ' $trnl | egrep -v '\.[A-Za-z]*$' | $sed -e '
7335 s/[0-9][0-9]*/0000&/g
7336 s/0*\([0-9][0-9][0-9][0-9][0-9]\)/\1/g
7339 $sort | $sed -e 's/^.* //'`
7342 $test -r $1 || set /usr/ccs/lib/libc.$so
7343 $test -r $1 || set /lib/libsys_s$_a
7349 if $test -r "$1"; then
7350 echo "Your (shared) C library seems to be in $1."
7352 elif $test -r /lib/libc && $test -r /lib/clib; then
7353 echo "Your C library seems to be in both /lib/clib and /lib/libc."
7355 libc='/lib/clib /lib/libc'
7356 if $test -r /lib/syslib; then
7357 echo "(Your math library is in /lib/syslib.)"
7358 libc="$libc /lib/syslib"
7360 elif $test -r "$libc" || (test -h "$libc") >/dev/null 2>&1; then
7361 echo "Your C library seems to be in $libc, as you said before."
7362 elif $test -r $incpath/usr/lib/libc$_a; then
7363 libc=$incpath/usr/lib/libc$_a;
7364 echo "Your C library seems to be in $libc. That's fine."
7365 elif $test -r /lib/libc$_a; then
7367 echo "Your C library seems to be in $libc. You're normal."
7369 if tans=`./loc libc$_a blurfl/dyick $libpth`; $test -r "$tans"; then
7371 elif tans=`./loc libc blurfl/dyick $libpth`; $test -r "$tans"; then
7372 libnames="$libnames "`./loc clib blurfl/dyick $libpth`
7373 elif tans=`./loc clib blurfl/dyick $libpth`; $test -r "$tans"; then
7375 elif tans=`./loc Slibc$_a blurfl/dyick $xlibpth`; $test -r "$tans"; then
7377 elif tans=`./loc Mlibc$_a blurfl/dyick $xlibpth`; $test -r "$tans"; then
7380 tans=`./loc Llibc$_a blurfl/dyick $xlibpth`
7382 if $test -r "$tans"; then
7383 echo "Your C library seems to be in $tans, of all places."
7389 if $test $xxx = apollo -o -r "$libc" || (test -h "$libc") >/dev/null 2>&1; then
7393 If the guess above is wrong (which it might be if you're using a strange
7394 compiler, or your machine supports multiple models), you can override it here.
7399 echo $libpth | $tr ' ' $trnl | $sort | $uniq > libpath
7401 I can't seem to find your C library. I've looked in the following places:
7404 $sed 's/^/ /' libpath
7407 None of these seems to contain your C library. I need to get its name...
7412 rp='Where is your C library?'
7417 echo $libc $libnames | $tr ' ' $trnl | $sort | $uniq > libnames
7418 set X `cat libnames`
7421 case $# in 1) xxx=file; esac
7422 echo "Extracting names from the following $xxx for later perusal:" >&4
7424 $sed 's/^/ /' libnames >&4
7426 $echo $n "This may take a while...$c" >&4
7430 *$so*) $nm $nm_so_opt $nm_opt $file 2>/dev/null;;
7431 *) $nm $nm_opt $file 2>/dev/null;;
7436 $grep fprintf libc.tmp > libc.ptf
7437 xscan='eval "<libc.ptf $com >libc.list"; $echo $n ".$c" >&4'
7438 xrun='eval "<libc.tmp $com >libc.list"; echo "done." >&4'
7440 if com="$sed -n -e 's/__IO//' -e 's/^.* $xxx *//p'";\
7442 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7444 elif com="$sed -n -e 's/^__*//' -e 's/^\([a-zA-Z_0-9$]*\).*xtern.*/\1/p'";\
7446 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7448 elif com="$sed -n -e '/|UNDEF/d' -e '/FUNC..GL/s/^.*|__*//p'";\
7450 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7452 elif com="$sed -n -e 's/^.* D __*//p' -e 's/^.* D //p'";\
7454 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7456 elif com="$sed -n -e 's/^_//' -e 's/^\([a-zA-Z_0-9]*\).*xtern.*text.*/\1/p'";\
7458 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7460 elif com="$sed -n -e 's/^.*|FUNC |GLOB .*|//p'";\
7462 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7464 elif com="$grep '|' | $sed -n -e '/|COMMON/d' -e '/|DATA/d' \
7465 -e '/ file/d' -e 's/^\([^ ]*\).*/\1/p'";\
7467 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7469 elif com="$sed -n -e 's/^.*|FUNC |GLOB .*|//p' -e 's/^.*|FUNC |WEAK .*|//p'";\
7471 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7473 elif com="$sed -n -e 's/^__//' -e '/|Undef/d' -e '/|Proc/s/ .*//p'";\
7475 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7477 elif com="$sed -n -e 's/^.*|Proc .*|Text *| *//p'";\
7479 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7481 elif com="$sed -n -e '/Def. Text/s/.* \([^ ]*\)\$/\1/p'";\
7483 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7485 elif com="$sed -n -e 's/^[-0-9a-f ]*_\(.*\)=.*/\1/p'";\
7487 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7489 elif com="$sed -n -e 's/.*\.text n\ \ \ \.//p'";\
7491 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7493 elif com="sed -n -e 's/^__.*//' -e 's/[ ]*D[ ]*[0-9]*.*//p'";\
7495 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7498 $nm -p $* 2>/dev/null >libc.tmp
7499 $grep fprintf libc.tmp > libc.ptf
7500 if com="$sed -n -e 's/^.* [ADTSIW] *_[_.]*//p' -e 's/^.* [ADTSIW] //p'";\
7501 eval $xscan; $contains '^fprintf$' libc.list >/dev/null 2>&1
7507 echo "$nm didn't seem to work right. Trying $ar instead..." >&4
7509 if $ar t $libc > libc.tmp && $contains '^fprintf$' libc.tmp >/dev/null 2>&1; then
7510 for thisname in $libnames $libc; do
7511 $ar t $thisname >>libc.tmp
7513 $sed -e "s/\\$_o\$//" < libc.tmp > libc.list
7515 elif test "X$osname" = "Xos2" && $ar tv $libc > libc.tmp; then
7516 # Repeat libc to extract forwarders to DLL entries too
7517 for thisname in $libnames $libc; do
7518 $ar tv $thisname >>libc.tmp
7519 # Revision 50 of EMX has bug in $ar.
7520 # it will not extract forwarders to DLL entries
7521 # Use emximp which will extract exactly them.
7522 emximp -o tmp.imp $thisname \
7524 $sed -e 's/^\([_a-zA-Z0-9]*\) .*$/\1/p' \
7525 < tmp.imp >>libc.tmp
7528 $sed -e "s/\\$_o\$//" -e 's/^ \+//' < libc.tmp > libc.list
7531 echo "$ar didn't seem to work right." >&4
7532 echo "Maybe this is a Cray...trying bld instead..." >&4
7533 if bld t $libc | $sed -e 's/.*\///' -e "s/\\$_o:.*\$//" > libc.list
7535 for thisname in $libnames; do
7537 $sed -e 's/.*\///' -e "s/\\$_o:.*\$//" >>libc.list
7538 $ar t $thisname >>libc.tmp
7542 echo "That didn't work either. Giving up." >&4
7552 echo "Since you are compiling for PASE, extracting more symbols from libc.a ...">&4
7553 dump -Tv /lib/libc.a | awk '$7 == "/unix" {print $5 " " $8}' | grep "^SV" | awk '{print $2}' >> libc.list
7555 *) if $test -f /lib/syscalls.exp; then
7557 echo "Also extracting names from /lib/syscalls.exp for good ole AIX..." >&4
7558 $sed -n 's/^\([^ ]*\)[ ]*syscall[0-9]*[ ]*$/\1/p' /lib/syscalls.exp >>libc.list
7564 $rm -f libnames libpath
7566 : see if dld is available
7570 : is a C symbol defined?
7573 -v) tf=libc.tmp; tdc="";;
7574 -a) tf=libc.tmp; tdc="[]";;
7575 *) tlook="^$1\$"; tf=libc.list; tdc="()";;
7578 case "$reuseval-$4" in
7580 true-*) tx=no; eval "tval=\$$4"; case "$tval" in "") tx=yes;; esac;;
7585 if $test "$runnm" = true; then
7586 if $contains $tlook $tf >/dev/null 2>&1; then
7588 elif $test "$mistrustnm" = compile -o "$mistrustnm" = run; then
7589 echo "void *(*(p()))$tdc { extern void *$1$tdc; return &$1; } int main() { if(p()) return(0); else return(1); }"> try.c;
7590 $cc -o try $optimize $ccflags $ldflags try.c >/dev/null 2>&1 $libs && tval=true;
7591 $test "$mistrustnm" = run -a -x try && { $run ./try$_exe >/dev/null 2>&1 || tval=false; };
7592 $rm -f try$_exe try.c core core.* try.core;
7595 echo "void *(*(p()))$tdc { extern void *$1$tdc; return &$1; } int main() { if(p()) return(0); else return(1); }"> try.c;
7596 $cc -o try $optimize $ccflags $ldflags try.c $libs >/dev/null 2>&1 && tval=true;
7597 $rm -f try$_exe try.c;
7602 $define) tval=true;;
7609 : define an is-in-libc? function
7610 inlibc='echo " "; td=$define; tu=$undef;
7611 sym=$1; var=$2; eval "was=\$$2";
7613 case "$reuseval$was" in
7623 echo "$sym() found." >&4;
7624 case "$was" in $undef) . ./whoa; esac; eval "$var=\$td";;
7626 echo "$sym() NOT found." >&4;
7627 case "$was" in $define) . ./whoa; esac; eval "$var=\$tu";;
7631 $define) echo "$sym() found." >&4;;
7632 *) echo "$sym() NOT found." >&4;;
7638 echo "Checking for C++..." >&4
7652 if eval $compile_ok && $run ./try >cplusplus$$; then
7653 val=`$cat cplusplus$$`
7654 echo "You are using a C++ compiler."
7657 echo "You are not using a C++ compiler."
7659 $rm -f try try.* cplusplus$$
7663 : see if dlopen exists
7665 xxx_ccflags="$ccflags"
7667 : with g++ one needs -shared to get is-in-libc to work for dlopen
7668 case "$gccversion" in
7670 *) case "$d_cplusplus" in
7671 "$define") ccflags="$ccflags -shared" ;;
7678 ccflags="$xxx_ccflags"
7680 : see if this is a unistd.h system
7681 set unistd.h i_unistd
7684 : determine which dynamic loading, if any, to compile in
7686 dldir="ext/DynaLoader"
7699 $define) dflt='y' ;;
7702 $define) dflt='y' ;;
7704 : Does a dl_xxx.xs file exist for this operating system
7705 $test -f $rsrc/$dldir/dl_${osname}.xs && dflt='y'
7708 rp="Do you wish to use dynamic loading?"
7715 if $test -f $rsrc/$dldir/dl_${osname}.xs ; then
7716 dflt="$dldir/dl_${osname}.xs"
7717 elif $test "$d_dlopen" = "$define" ; then
7718 dflt="$dldir/dl_dlopen.xs"
7719 elif $test "$i_dld" = "$define" ; then
7720 dflt="$dldir/dl_dld.xs"
7725 *) dflt="$dldir/$dlsrc"
7728 echo "The following dynamic loading files are available:"
7729 : Can not go over to $dldir because getfile has path hard-coded in.
7730 tdir=`pwd`; cd "$rsrc"; $ls -C $dldir/dl*.xs; cd "$tdir"
7731 rp="Source file to use for dynamic loading"
7737 dlsrc=`echo $ans | $sed -e 's%.*/\([^/]*\)$%\1%'`
7741 Some systems may require passing special flags to $cc -c to
7742 compile modules that will be used to create a shared library.
7743 To use no flags, say "none".
7746 case "$cccdlflags" in
7747 '') case "$gccversion" in
7748 '') case "$osname" in
7750 next) dflt='none' ;;
7751 irix*) dflt='-KPIC' ;;
7752 svr4*|esix*|solaris|nonstopux) dflt='-KPIC' ;;
7753 sunos) dflt='-pic' ;;
7757 *) case "$osname" in
7758 darwin) dflt='none' ;;
7759 svr4*|esix*|solaris|nonstopux) dflt='-fPIC' ;;
7764 *) dflt="$cccdlflags" ;;
7766 rp="Any special flags to pass to $cc -c to compile shared library modules?"
7769 none) cccdlflags=' ' ;;
7770 *) cccdlflags="$ans" ;;
7775 Some systems use ld to create libraries that can be dynamically loaded,
7776 while other systems (such as those using ELF) use $cc.
7780 '') $cat >try.c <<EOM
7781 /* Test for whether ELF binaries are produced */
7793 int i = open("a.out",O_RDONLY);
7796 if(read(i,b,4)==4 && b[0]==127 && b[1]=='E' && b[2]=='L' && b[3]=='F')
7797 exit(0); /* succeed (yes, it's ELF) */
7802 if $cc $ccflags $ldflags try.c >/dev/null 2>&1 && $run ./a.out; then
7804 You appear to have ELF support. I'll use $cc to build dynamic libraries.
7808 echo "I'll use ld to build dynamic libraries."
7817 rp="What command should be used to create dynamic libraries?"
7823 Some systems may require passing special flags to $ld to create a
7824 library that can be dynamically loaded. If your ld flags include
7825 -L/other/path options to locate libraries outside your loader's normal
7826 search path, you may need to specify those -L options here as well. To
7827 use no flags, say "none".
7830 case "$lddlflags" in
7831 '') case "$osname" in
7832 beos) dflt='-nostart' ;;
7834 case "$gccversion" in
7835 '') dflt="$dflt +vnocompatwarnings" ;;
7838 linux|irix*|gnu*) dflt='-shared' ;;
7839 next) dflt='none' ;;
7840 solaris) dflt='-G' ;;
7841 sunos) dflt='-assert nodefinitions' ;;
7842 svr4*|esix*|nonstopux) dflt="-G $ldflags" ;;
7846 *) dflt="$lddlflags" ;;
7849 : Try to guess additional flags to pick up local libraries.
7850 : Be careful not to append to a plain 'none'
7854 for thisflag in $ldflags; do
7859 *) dflt="$dflt $thisflag" ;;
7866 ''|' ') dflt='none' ;;
7869 rp="Any special flags to pass to $ld to create a dynamically loaded library?"
7872 none) lddlflags=' ' ;;
7873 *) lddlflags="$ans" ;;
7878 Some systems may require passing special flags to $cc to indicate that
7879 the resulting executable will use dynamic linking. To use no flags,
7883 case "$ccdlflags" in
7884 '') case "$osname" in
7885 linux|hpux|gnu*) dflt='-Wl,-E' ;;
7886 next|sunos) dflt='none' ;;
7890 *) dflt="$ccdlflags" ;;
7892 rp="Any special flags to pass to $cc to use dynamic linking?"
7895 none) ccdlflags=' ' ;;
7896 *) ccdlflags="$ans" ;;
7910 # No dynamic loading being used, so don't bother even to prompt.
7913 *) case "$useshrplib" in
7914 '') case "$osname" in
7915 svr4*|nonstopux|dgux|dynixptx|esix|powerux|beos|cygwin*)
7917 also='Building a shared libperl is required for dynamic loading to work on your system.'
7922 also='Building a shared libperl is needed for MAB support.'
7940 The perl executable is normally obtained by linking perlmain.c with
7941 libperl${_a}, any static extensions (usually just DynaLoader), and
7942 any other libraries needed on this system (such as -lm, etc.). Since
7943 your system supports dynamic loading, it is probably possible to build
7944 a shared libperl.$so. If you will have more than one executable linked
7945 to libperl.$so, this will significantly reduce the size of each
7946 executable, but it may have a noticeable effect on performance. The
7947 default is probably sensible for your system.
7951 rp="Build a shared libperl.$so (y/n)"
7955 useshrplib='true' ;;
7956 *) useshrplib='false' ;;
7961 case "$useshrplib" in
7965 # Figure out a good name for libperl.so. Since it gets stored in
7966 # a version-specific architecture-dependent library, the version
7967 # number isn't really that important, except for making cc/ld happy.
7969 # A name such as libperl.so.3.1
7970 majmin="libperl.$so.$patchlevel.$subversion"
7971 # A name such as libperl.so.301
7972 majonly=`echo $patchlevel $subversion |
7973 $awk '{printf "%d%02d", $1, $2}'`
7974 majonly=libperl.$so.$majonly
7975 # I'd prefer to keep the os-specific stuff here to a minimum, and
7976 # rely on figuring it out from the naming of libc.
7977 case "${osname}${osvers}" in
7980 # XXX How handle the --version stuff for MAB?
7982 linux*|gnu*) # ld won't link with a bare -lperl otherwise.
7985 cygwin*) # ld links against an importlib
7986 dflt=libperl$lib_ext
7988 *) # Try to guess based on whether libc has major.minor.
7990 *libc.$so.[0-9]*.[0-9]*) dflt=$majmin ;;
7991 *libc.$so.[0-9]*) dflt=$majonly ;;
7992 *) dflt=libperl.$so ;;
8002 I need to select a good name for the shared libperl. If your system uses
8003 library names with major and minor numbers, then you might want something
8004 like $majmin. Alternatively, if your system uses a single version
8005 number for shared libraries, then you might want to use $majonly.
8006 Or, your system might be quite happy with a simple libperl.$so.
8008 Since the shared libperl will get installed into a version-specific
8009 architecture-dependent directory, the version number of the shared perl
8010 library probably isn't important, so the default should be o.k.
8013 rp='What name do you want to give to the shared libperl?'
8016 echo "Ok, I'll use $libperl"
8019 libperl="libperl${_a}"
8023 # Detect old use of shrpdir via undocumented Configure -Dshrpdir
8027 WARNING: Use of the shrpdir variable for the installation location of
8028 the shared $libperl is not supported. It was never documented and
8029 will not work in this version. Let me (perlbug@perl.org)
8030 know of any problems this may cause.
8036 But your current setting of $shrpdir is
8037 the default anyway, so it's harmless.
8042 Further, your current attempted setting of $shrpdir
8043 conflicts with the value of $archlibexp/CORE
8044 that installperl will use.
8051 # How will the perl executable find the installed shared $libperl?
8052 # Add $xxx to ccdlflags.
8053 # If we can't figure out a command-line option, use $shrpenv to
8054 # set env LD_RUN_PATH. The main perl makefile uses this.
8055 shrpdir=$archlibexp/CORE
8058 if "$useshrplib"; then
8061 # We'll set it in Makefile.SH...
8066 freebsd|netbsd|openbsd|interix|dragonfly)
8067 xxx="-Wl,-R$shrpdir"
8069 bsdos|linux|irix*|dec_osf|gnu*)
8070 xxx="-Wl,-rpath,$shrpdir"
8073 # next doesn't like the default...
8076 # beos doesn't like the default, either.
8079 # hpux doesn't like the default, either.
8080 tmp_shrpenv="env LDOPTS=\"+s +b${shrpdir}\""
8083 tmp_shrpenv="env LD_RUN_PATH=$shrpdir"
8089 # Only add $xxx if it isn't already in ccdlflags.
8090 case " $ccdlflags " in
8092 *) ccdlflags="$ccdlflags $xxx"
8095 Adding $xxx to the flags
8096 passed to $ld so that the perl executable will find the
8097 installed shared $libperl.
8105 # Fix ccdlflags in AIX for building external extensions.
8106 # (For building Perl itself bare -bE:perl.exp is needed,
8107 # Makefile.SH takes care of this.)
8109 aix) ccdlflags="$ccdlflags -bE:$installarchlib/CORE/perl.exp" ;;
8111 # Respect a hint or command-line value.
8113 '') shrpenv="$tmp_shrpenv" ;;
8115 case "$ldlibpthname" in
8116 '') ldlibpthname=LD_LIBRARY_PATH ;;
8117 none) ldlibpthname='' ;;
8120 : determine where manual pages are on this system
8124 syspath='/usr/share/man/man1 /usr/man/man1'
8125 syspath="$syspath /usr/man/mann /usr/man/manl /usr/man/local/man1"
8126 syspath="$syspath /usr/man/u_man/man1"
8127 syspath="$syspath /usr/catman/u_man/man1 /usr/man/l_man/man1"
8128 syspath="$syspath /usr/local/man/u_man/man1 /usr/local/man/l_man/man1"
8129 syspath="$syspath /usr/man/man.L /local/man/man1 /usr/local/man/man1"
8130 sysman=`./loc . /usr/man/man1 $syspath`
8133 if $test -d "$sysman"; then
8134 echo "System manual is in $sysman." >&4
8136 echo "Could not find manual pages in source form." >&4
8139 : determine where manual pages go
8140 set man1dir man1dir none
8144 $spackage has manual pages available in source form.
8148 echo "However, you don't have nroff, so they're probably useless to you."
8150 '') man1dir="none";;
8153 echo "If you don't want the manual sources installed, answer 'none'."
8158 lookpath="$prefixexp/share/man/man1"
8159 lookpath="$lookpath $prefixexp/man/man1 $prefixexp/man/l_man/man1"
8160 lookpath="$lookpath $prefixexp/man/p_man/man1"
8161 lookpath="$lookpath $prefixexp/man/u_man/man1"
8162 lookpath="$lookpath $prefixexp/man/man.1"
8164 */?_man*) dflt=`./loc . $prefixexp/l_man/man1 $lookpath` ;;
8165 *) dflt=`./loc . $prefixexp/man/man1 $lookpath` ;;
8175 rp="Where do the main $spackage manual pages (source) go?"
8177 if $test "X$man1direxp" != "X$ansexp"; then
8188 : What suffix to use on installed man pages
8195 rp="What suffix should be used for the main $spackage man pages?"
8197 '') case "$man1dir" in
8211 *) dflt="$man1ext";;
8218 : see if we can have long filenames
8220 first=123456789abcdef
8222 if (echo hi >$first) 2>/dev/null; then
8223 if $test -f 123456789abcde; then
8224 echo 'You cannot have filenames longer than 14 characters. Sigh.' >&4
8227 echo 'You can have filenames longer than 14 characters.'>&4
8232 You can't have filenames longer than 14 chars.
8233 You can't even think about them!
8239 $rm -rf 123456789abcde*
8241 : determine where library module manual pages go
8242 set man3dir man3dir none
8246 $spackage has manual pages for many of the library modules.
8252 However, you don't have nroff, so they're probably useless to you.
8255 '') man3dir="none";;
8259 case "$d_flexfnam" in
8262 However, your system can't handle the long file names like File::Basename.3.
8265 '') man3dir="none";;
8269 echo "If you don't want the manual sources installed, answer 'none'."
8270 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
8272 '') dflt=`echo "$man1dir" | $sed -e 's/man1/man3/g' -e 's/man\.1/man\.3/g'`
8273 if $test -d "$privlib/man/man3"; then
8276 WARNING: Previous versions of perl installed man3 pages into
8277 $privlib/man/man3. This version will suggest a
8278 new default of $dflt.
8282 rp='Do you wish to preserve the old behavior?(y/n)'
8285 y*) dflt="$privlib/man/man3" ;;
8290 *) dflt="$man3dir" ;;
8297 rp="Where do the $package library man pages (source) go?"
8307 : What suffix to use on installed man pages
8313 rp="What suffix should be used for the $package library man pages?"
8315 '') case "$man3dir" in
8329 *) dflt="$man3ext";;
8336 : see if we have to deal with yellow pages, now NIS.
8337 if $test -d /usr/etc/yp || $test -d /etc/yp || $test -d /usr/lib/yp; then
8338 if $test -f /usr/etc/nibindd; then
8340 echo "I'm fairly confident you're on a NeXT."
8342 rp='Do you get the hosts file via NetInfo?'
8351 y*) hostcat='nidump hosts .';;
8352 *) case "$hostcat" in
8353 nidump*) hostcat='';;
8363 '') if $contains '^\+' /etc/passwd >/dev/null 2>&1; then
8371 rp='Are you getting the hosts file via yellow pages?'
8374 y*) hostcat='ypcat hosts';;
8375 *) hostcat='cat /etc/hosts';;
8381 '') test -f /etc/hosts && hostcat='cat /etc/hosts';;
8384 '') test -f /etc/group && groupcat='cat /etc/group';;
8387 '') test -f /etc/passwd && passcat='cat /etc/passwd';;
8390 : now get the host name
8392 echo "Figuring out host name..." >&4
8393 case "$myhostname" in
8395 echo 'Maybe "hostname" will work...'
8396 if tans=`sh -c hostname 2>&1` ; then
8404 if $test "$cont"; then
8406 echo 'Oh, dear. Maybe "/etc/systemid" is the key...'
8407 if tans=`cat /etc/systemid 2>&1` ; then
8409 phostname='cat /etc/systemid'
8410 echo "Whadyaknow. Xenix always was a bit strange..."
8413 elif $test -r /etc/systemid; then
8414 echo "(What is a non-Xenix system doing with /etc/systemid?)"
8417 if $test "$cont"; then
8418 echo 'No, maybe "uuname -l" will work...'
8419 if tans=`sh -c 'uuname -l' 2>&1` ; then
8421 phostname='uuname -l'
8423 echo 'Strange. Maybe "uname -n" will work...'
8424 if tans=`sh -c 'uname -n' 2>&1` ; then
8426 phostname='uname -n'
8428 echo 'Oh well, maybe I can mine it out of whoami.h...'
8429 if tans=`sh -c $contains' sysname $usrinc/whoami.h' 2>&1` ; then
8430 myhostname=`echo "$tans" | $sed 's/^.*"\(.*\)"/\1/'`
8431 phostname="sed -n -e '"'/sysname/s/^.*\"\\(.*\\)\"/\1/{'"' -e p -e q -e '}' <$usrinc/whoami.h"
8433 case "$myhostname" in
8434 '') echo "Does this machine have an identity crisis or something?"
8437 echo "Well, you said $myhostname before..."
8438 phostname='echo $myhostname';;
8444 case "$myhostname" in
8445 '') myhostname=noname ;;
8447 : you do not want to know about this
8452 if $test "$myhostname" ; then
8454 rp='Your host name appears to be "'$myhostname'".'" Right?"
8462 : bad guess or no guess
8463 while $test "X$myhostname" = X ; do
8465 rp="Please type the (one word) name of your host:"
8470 : translate upper to lower if necessary
8471 case "$myhostname" in
8473 echo "(Normalizing case in your host name)"
8474 myhostname=`echo $myhostname | ./tr '[A-Z]' '[a-z]'`
8478 case "$myhostname" in
8480 dflt=`expr "X$myhostname" : "X[^.]*\(\..*\)"`
8481 myhostname=`expr "X$myhostname" : "X\([^.]*\)\."`
8482 echo "(Trimming domain name from host name--host name is now $myhostname)"
8484 *) case "$mydomain" in
8487 test "X$hostcat" = "Xypcat hosts" &&
8488 ypmatch "$myhostname" hosts 2>/dev/null |\
8489 $sed -e 's/[ ]*#.*//; s/$/ /' > hosts && \
8492 test "X$hostcat" != "X" &&
8493 $hostcat | $sed -n -e "s/[ ]*#.*//; s/\$/ /
8494 /[ ]$myhostname[ . ]/p" > hosts
8497 if $test -f hosts; then
8498 $test x`$awk "/[0-9].*[ ]$myhostname$tmp_re/ { sum++ }
8499 END { print sum }" hosts` = x1 || tmp_re="[ ]"
8500 dflt=.`$awk "/[0-9].*[ ]$myhostname$tmp_re/ {for(i=2; i<=NF;i++) print \\\$i}" \
8501 hosts | $sort | $uniq | \
8502 $sed -n -e "s/$myhostname\.\([-a-zA-Z0-9_.]\)/\1/p"`
8503 case `$echo X$dflt` in
8504 X*\ *) echo "(Several hosts in the database matched hostname)"
8507 X.) echo "(You do not have fully-qualified names in the hosts database)"
8511 echo "(I cannot locate a hosts database anywhere)"
8516 tans=`./loc resolv.conf X /etc /usr/etc`
8517 if $test -f "$tans"; then
8518 echo "(Attempting domain name extraction from $tans)"
8519 dflt=.`$sed -n -e 's/ / /g' \
8520 -e 's/^search *\([^ ]*\).*/\1/p' $tans \
8521 | ./tr '[A-Z]' '[a-z]' 2>/dev/null`
8523 .) dflt=.`$sed -n -e 's/ / /g' \
8524 -e 's/^domain *\([^ ]*\).*/\1/p' $tans \
8525 | ./tr '[A-Z]' '[a-z]' 2>/dev/null`
8532 .) echo "(No help from resolv.conf either -- attempting clever guess)"
8533 dflt=.`sh -c domainname 2>/dev/null`
8536 .nis.*|.yp.*|.main.*) dflt=`echo $dflt | $sed -e 's/^\.[^.]*//'`;;
8540 case "$dflt$osname" in
8541 .os390) echo "(Attempting domain name extraction from //'SYS1.TCPPARMS(TCPDATA)')"
8542 dflt=.`awk '/^DOMAINORIGIN/ {print $2}' "//'SYS1.TCPPARMS(TCPDATA)'" 2>/dev/null`
8546 .) echo "(Lost all hope -- silly guess then)"
8552 *) dflt="$mydomain";;
8556 rp="What is your domain name?"
8566 : translate upper to lower if necessary
8569 echo "(Normalizing case in your domain name)"
8570 mydomain=`echo $mydomain | ./tr '[A-Z]' '[a-z]'`
8574 : a little sanity check here
8575 case "$phostname" in
8578 case `$phostname | ./tr '[A-Z]' '[a-z]'` in
8579 $myhostname$mydomain|$myhostname) ;;
8581 case "$phostname" in
8583 echo "(That doesn't agree with your whoami.h file, by the way.)"
8586 echo "(That doesn't agree with your $phostname command, by the way.)"
8596 I need to get your e-mail address in Internet format if possible, i.e.
8597 something like user@host.domain. Please answer accurately since I have
8598 no easy means to double check it. The default value provided below
8599 is most probably close to reality but may not be valid from outside
8600 your organization...
8604 while test "$cont"; do
8606 '') dflt="$cf_by@$myhostname$mydomain";;
8607 *) dflt="$cf_email";;
8609 rp='What is your e-mail address?'
8615 rp='Address does not look like an Internet one. Use it anyway?'
8631 If you or somebody else will be maintaining perl at your site, please
8632 fill in the correct e-mail address here so that they may be contacted
8633 if necessary. Currently, the "perlbug" program included with perl
8634 will send mail to this address in addition to perlbug@perl.org. You may
8635 enter "none" for no administrator.
8638 case "$perladmin" in
8639 '') dflt="$cf_email";;
8640 *) dflt="$perladmin";;
8642 rp='Perl administrator e-mail address'
8646 : determine whether to only install version-specific parts.
8649 Do you want to install only the version-specific parts of the perl
8650 distribution? Usually you do *not* want to do this.
8652 case "$versiononly" in
8653 "$define"|[Yy]*|true) dflt='y' ;;
8656 rp="Do you want to install only the version-specific parts of perl?"
8659 [yY]*) val="$define";;
8665 case "$versiononly" in
8666 "$define") inc_version_list=''
8667 inc_version_list_init=0
8671 : figure out how to guarantee perl startup
8672 : XXX Note that this currently takes advantage of the bug that binexp ignores
8673 : the Configure -Dinstallprefix setting, which in turn means that under
8674 : relocatable @INC, initialinstalllocation is what binexp started as.
8675 case "$startperl" in
8677 case "$sharpbang" in
8681 I can use the #! construct to start perl on your system. This will
8682 make startup of perl scripts faster, but may cause problems if you
8683 want to share those scripts and perl is not in a standard place
8684 ($initialinstalllocation/perl) on all your platforms. The alternative
8685 is to force a shell by starting the script with a single ':' character.
8688 case "$versiononly" in
8689 "$define") dflt="$initialinstalllocation/perl$version";;
8690 *) dflt="$initialinstalllocation/perl";;
8692 rp='What shall I put after the #! to start up perl ("none" to not use #!)?'
8695 none) startperl=": # use perl";;
8696 *) startperl="#!$ans"
8697 if $test 30 -lt `echo "$ans" | wc -c`; then
8700 WARNING: Some systems limit the #! command to 32 characters.
8701 If you experience difficulty running Perl scripts with #!, try
8702 installing Perl in a directory with a shorter pathname.
8708 *) startperl=": # use perl"
8713 echo "I'll use $startperl to start perl scripts."
8715 : figure best path for perl in scripts
8718 case "$versiononly" in
8719 "$define") perlpath="$initialinstalllocation/perl$version";;
8720 *) perlpath="$initialinstalllocation/perl";;
8722 case "$startperl" in
8727 I will use the "eval 'exec'" idiom to start Perl on your system.
8728 I can use the full path of your Perl binary for this purpose, but
8729 doing so may cause problems if you want to share those scripts and
8730 Perl is not always in a standard place ($initialinstalllocation/perl).
8733 dflt="$initialinstalllocation/perl"
8734 rp="What path shall I use in \"eval 'exec'\"?"
8741 case "$startperl" in
8743 *) echo "I'll use $perlpath in \"eval 'exec'\"" ;;
8746 : determine where public executable scripts go
8747 set scriptdir scriptdir
8749 case "$scriptdir" in
8752 : guess some guesses
8753 $test -d /usr/share/scripts && dflt=/usr/share/scripts
8754 $test -d /usr/share/bin && dflt=/usr/share/bin
8755 $test -d /usr/local/script && dflt=/usr/local/script
8756 $test -d /usr/local/scripts && dflt=/usr/local/scripts
8757 $test -d $prefixexp/script && dflt=$prefixexp/script
8761 *) dflt="$scriptdir"
8766 Some installations have a separate directory just for executable scripts so
8767 that they can mount it across multiple architectures but keep the scripts in
8768 one spot. You might, for example, have a subdirectory of /usr/share for this.
8769 Or you might just lump your scripts in with all your other executables.
8773 rp='Where do you keep publicly executable scripts?'
8775 if $test "X$ansexp" != "X$scriptdirexp"; then
8781 : A little fix up for an irregularly named variable.
8782 installscript="$installscriptdir"
8784 : determine where add-on public executables go
8786 '') dflt=$siteprefix/bin ;;
8790 rp='Pathname where the add-on public executables should be installed?'
8795 : determine where add-on html pages go
8796 : There is no standard location, so try to copy the previously-selected
8797 : directory structure for the core html pages.
8798 case "$sitehtml1dir" in
8799 '') dflt=`echo "$html1dir" | $sed "s#^$prefix#$siteprefix#"` ;;
8800 *) dflt=$sitehtml1dir ;;
8803 ''|' ') dflt=none ;;
8806 rp='Pathname where the site-specific html pages should be installed?'
8808 prefixvar=sitehtml1dir
8811 : determine where add-on library html pages go
8812 : There is no standard location, so try to copy the previously-selected
8813 : directory structure for the core html pages.
8814 case "$sitehtml3dir" in
8815 '') dflt=`echo "$html3dir" | $sed "s#^$prefix#$siteprefix#"` ;;
8816 *) dflt=$sitehtml3dir ;;
8819 ''|' ') dflt=none ;;
8822 rp='Pathname where the site-specific library html pages should be installed?'
8824 prefixvar=sitehtml3dir
8827 : determine where add-on manual pages go
8828 case "$siteman1dir" in
8829 '') dflt=`echo $man1dir | $sed "s#^$prefix#$siteprefix#"` ;;
8830 *) dflt=$siteman1dir ;;
8833 ''|' ') dflt=none ;;
8836 rp='Pathname where the site-specific manual pages should be installed?'
8838 prefixvar=siteman1dir
8841 : determine where add-on library man pages go
8842 case "$siteman3dir" in
8843 '') dflt=`echo $man3dir | $sed "s#^$prefix#$siteprefix#"` ;;
8844 *) dflt=$siteman3dir ;;
8847 ''|' ') dflt=none ;;
8850 rp='Pathname where the site-specific library manual pages should be installed?'
8852 prefixvar=siteman3dir
8855 : determine where add-on public executable scripts go
8856 case "$sitescript" in
8857 '') dflt=$siteprefix/script
8858 $test -d $dflt || dflt=$sitebin ;;
8859 *) dflt="$sitescript" ;;
8862 rp='Pathname where add-on public executable scripts should be installed?'
8864 prefixvar=sitescript
8867 case "$usefaststdio" in
8868 $define|true|[yY]*|'')
8869 xversion=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
8879 Perl can be built to use 'fast stdio', which means using the stdio
8880 library but also directly manipulating the stdio buffers to enable
8881 faster I/O. Using stdio is better for backward compatibility (especially
8882 for Perl extensions), but on the other hand since Perl 5.8 the 'perlio'
8883 interface has been preferred instead of stdio.
8885 If this doesn't make any sense to you, just accept the default '$dflt'.
8887 rp='Use the "fast stdio" if available?'
8890 y|Y) val="$define" ;;
8897 : define an is-a-typedef? function
8898 typedef='type=$1; var=$2; def=$3; shift; shift; shift; inclist=$@;
8900 "") inclist="sys/types.h";;
8902 eval "varval=\$$var";
8906 for inc in $inclist; do
8907 echo "#include <$inc>" >>temp.c;
8909 echo "#ifdef $type" >> temp.c;
8910 echo "printf(\"We have $type\");" >> temp.c;
8911 echo "#endif" >> temp.c;
8912 $cppstdin $cppflags $cppminus < temp.c >temp.E 2>/dev/null;
8913 if $contains $type temp.E >/dev/null 2>&1; then
8919 *) eval "$var=\$varval";;
8922 : define an is-a-typedef? function that prompts if the type is not available.
8923 typedef_ask='type=$1; var=$2; def=$3; shift; shift; shift; inclist=$@;
8925 "") inclist="sys/types.h";;
8927 eval "varval=\$$var";
8931 for inc in $inclist; do
8932 echo "#include <$inc>" >>temp.c;
8934 echo "#ifdef $type" >> temp.c;
8935 echo "printf(\"We have $type\");" >> temp.c;
8936 echo "#endif" >> temp.c;
8937 $cppstdin $cppflags $cppminus < temp.c >temp.E 2>/dev/null;
8939 echo "$rp" | $sed -e "s/What is/Looking for/" -e "s/?/./";
8940 if $contains $type temp.E >/dev/null 2>&1; then
8941 echo "$type found." >&4;
8944 echo "$type NOT found." >&4;
8950 *) eval "$var=\$varval";;
8953 : see what type lseek is declared as in the kernel
8954 rp="What is the type used for lseek's offset on this system?"
8955 set off_t lseektype long stdio.h sys/types.h
8959 echo "Checking to see how big your file offsets are..." >&4
8961 #include <sys/types.h>
8965 printf("%d\n", (int)sizeof($lseektype));
8970 if eval $compile_ok; then
8971 lseeksize=`$run ./try`
8972 echo "Your file offsets are $lseeksize bytes long."
8976 echo "(I can't seem to compile the test program. Guessing...)"
8977 rp="What is the size of your file offsets (in bytes)?"
8983 : see what type file positions are declared as in the library
8984 rp="What is the type for file position used by fsetpos()?"
8985 set fpos_t fpostype long stdio.h sys/types.h
8990 *_t) zzz="$fpostype" ;;
8993 echo "Checking the size of $zzz..." >&4
8995 #include <sys/types.h>
9002 printf("%d\n", (int)sizeof($fpostype));
9007 if eval $compile_ok; then
9011 echo "(I can't execute the test program--guessing $fpossize.)" >&4
9014 echo "Your $zzz is $fpossize bytes long."
9020 echo "(I can't compile the test program. Guessing...)" >&4
9021 rp="What is the size of your file positions (in bytes)?"
9026 # Backward compatibility (uselfs is deprecated).
9028 "$define"|true|[yY]*)
9031 *** Configure -Duselfs is deprecated, using -Duselargefiles instead.
9033 uselargefiles="$define"
9037 case "$lseeksize:$fpossize" in
9040 You can have files larger than 2 gigabytes.
9043 *) case "$uselargefiles" in
9044 "$undef"|false|[nN]*) dflt='n' ;;
9049 Perl can be built to understand large files (files larger than 2 gigabytes)
9050 on some systems. To do so, Configure can be run with -Duselargefiles.
9052 If this doesn't make any sense to you, just accept the default '$dflt'.
9054 rp='Try to understand large files, if available?'
9057 y|Y) val="$define" ;;
9064 : Look for a hint-file generated 'call-back-unit'. If the
9065 : user has specified that a large files perl is to be built,
9066 : we may need to set or change some other defaults.
9067 if $test -f uselargefiles.cbu; then
9068 echo "Your platform has some specific hints regarding large file builds, using them..."
9069 . ./uselargefiles.cbu
9071 case "$uselargefiles" in
9073 if $test -f uselargefiles.cbu; then
9075 echo "Rechecking to see how big your file offsets are..." >&4
9077 #include <sys/types.h>
9081 printf("%d\n", (int)sizeof($lseektype));
9086 if eval $compile_ok; then
9087 lseeksize=`$run ./try`
9088 $echo "Your file offsets are now $lseeksize bytes long."
9092 echo "(I can't seem to compile the test program. Guessing...)"
9093 rp="What is the size of your file offsets (in bytes)?"
9098 *_t) zzz="$fpostype" ;;
9101 $echo $n "Rechecking the size of $zzz...$c" >&4
9103 #include <sys/types.h>
9110 printf("%d\n", (int)sizeof($fpostype));
9115 if eval $compile_ok; then
9120 echo "(I can't execute the test program--guessing $fpossize.)" >&4
9123 echo " $fpossize bytes." >&4
9129 echo "(I can't compile the test program. Guessing...)" >&4
9130 rp="What is the size of your file positions (in bytes)?"
9139 case "$vendorprefix" in
9140 '') d_vendorbin="$undef"
9144 *) d_vendorbin="$define"
9145 : determine where vendor-supplied executables go.
9146 case "$vendorbin" in
9147 '') dflt=$vendorprefix/bin ;;
9148 *) dflt="$vendorbin" ;;
9151 rp='Pathname for the vendor-supplied executables directory?'
9154 vendorbinexp="$ansexp"
9160 case "$vendorprefix" in
9161 '') vendorhtml1dir=''
9162 vendorhtml1direxp=''
9164 *) : determine where vendor-supplied html pages go.
9165 : There is no standard location, so try to copy the previously-selected
9166 : directory structure for the core html pages.
9167 : XXX Better default suggestions would be welcome.
9168 case "$vendorhtml1dir" in
9169 '') dflt=`echo "$html1dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
9170 *) dflt=$vendorhtml1dir ;;
9173 ''|' ') dflt=none ;;
9176 rp='Pathname for the vendor-supplied html pages?'
9178 vendorhtml1dir="$ans"
9179 vendorhtml1direxp="$ansexp"
9182 : Use ' ' for none so value is preserved next time through Configure
9183 $test X"$vendorhtml1dir" = "X" && vendorhtml1dir=' '
9184 prefixvar=vendorhtml1dir
9187 case "$vendorprefix" in
9188 '') vendorhtml3dir=''
9189 vendorhtml3direxp=''
9191 *) : determine where vendor-supplied module html pages go.
9192 : There is no standard location, so try to copy the previously-selected
9193 : directory structure for the core html pages.
9194 : XXX Better default suggestions would be welcome.
9195 case "$vendorhtml3dir" in
9196 '') dflt=`echo "$html3dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
9197 *) dflt=$vendorhtml3dir ;;
9200 ''|' ') dflt=none ;;
9203 rp='Pathname for the vendor-supplied html pages?'
9205 vendorhtml3dir="$ans"
9206 vendorhtml3direxp="$ansexp"
9209 : Use ' ' for none so value is preserved next time through Configure
9210 $test X"$vendorhtml3dir" = "X" && vendorhtml3dir=' '
9211 prefixvar=vendorhtml3dir
9214 case "$vendorprefix" in
9215 '') vendorman1dir=''
9218 *) : determine where vendor-supplied manual pages go.
9219 case "$vendorman1dir" in
9220 '') dflt=`echo "$man1dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
9221 *) dflt=$vendorman1dir ;;
9224 ''|' ') dflt=none ;;
9227 rp='Pathname for the vendor-supplied manual section 1 pages?'
9229 vendorman1dir="$ans"
9230 vendorman1direxp="$ansexp"
9233 : Use ' ' for none so value is preserved next time through Configure
9234 $test X"$vendorman1dir" = "X" && vendorman1dir=' '
9235 prefixvar=vendorman1dir
9238 case "$vendorprefix" in
9239 '') vendorman3dir=''
9242 *) : determine where vendor-supplied module manual pages go.
9243 case "$vendorman3dir" in
9244 '') dflt=`echo "$man3dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
9245 *) dflt=$vendorman3dir ;;
9248 ''|' ') dflt=none ;;
9251 rp='Pathname for the vendor-supplied manual section 3 pages?'
9253 vendorman3dir="$ans"
9254 vendorman3direxp="$ansexp"
9257 : Use ' ' for none so value is preserved next time through Configure
9258 $test X"$vendorman3dir" = "X" && vendorman3dir=' '
9259 prefixvar=vendorman3dir
9262 case "$vendorprefix" in
9263 '') d_vendorscript="$undef"
9267 *) d_vendorscript="$define"
9268 : determine where vendor-supplied scripts go.
9269 case "$vendorscript" in
9270 '') dflt=$vendorprefix/script
9271 $test -d $dflt || dflt=$vendorbin ;;
9272 *) dflt="$vendorscript" ;;
9276 The installation process will create a directory for
9277 vendor-supplied scripts.
9281 rp='Pathname for the vendor-supplied scripts directory?'
9284 vendorscriptexp="$ansexp"
9287 prefixvar=vendorscript
9290 : see if qgcvt exists
9296 if $test X"$d_longdbl" = X"$define"; then
9298 echo "Checking how to print long doubles..." >&4
9300 if $test X"$sPRIfldbl" = X -a X"$doublesize" = X"$longdblsize"; then
9301 $cat >try.c <<'EOCP'
9302 #include <sys/types.h>
9306 printf("%.3f\n", d);
9310 if eval $compile; then
9314 sPRIfldbl='"f"'; sPRIgldbl='"g"'; sPRIeldbl='"e"';
9315 sPRIFUldbl='"F"'; sPRIGUldbl='"G"'; sPRIEUldbl='"E"';
9316 echo "We will use %f."
9322 if $test X"$sPRIfldbl" = X; then
9323 $cat >try.c <<'EOCP'
9324 #include <sys/types.h>
9327 long double d = 123.456;
9328 printf("%.3Lf\n", d);
9332 if eval $compile; then
9336 sPRIfldbl='"Lf"'; sPRIgldbl='"Lg"'; sPRIeldbl='"Le"';
9337 sPRIFUldbl='"LF"'; sPRIGUldbl='"LG"'; sPRIEUldbl='"LE"';
9338 echo "We will use %Lf."
9344 if $test X"$sPRIfldbl" = X; then
9345 $cat >try.c <<'EOCP'
9346 #include <sys/types.h>
9349 long double d = 123.456;
9350 printf("%.3llf\n", d);
9354 if eval $compile; then
9358 sPRIfldbl='"llf"'; sPRIgldbl='"llg"'; sPRIeldbl='"lle"';
9359 sPRIFUldbl='"llF"'; sPRIGUldbl='"llG"'; sPRIEUldbl='"llE"';
9360 echo "We will use %llf."
9366 if $test X"$sPRIfldbl" = X; then
9367 $cat >try.c <<'EOCP'
9368 #include <sys/types.h>
9371 long double d = 123.456;
9372 printf("%.3lf\n", d);
9376 if eval $compile; then
9380 sPRIfldbl='"lf"'; sPRIgldbl='"lg"'; sPRIeldbl='"le"';
9381 sPRIFUldbl='"lF"'; sPRIGUldbl='"lG"'; sPRIEUldbl='"lE"';
9382 echo "We will use %lf."
9388 if $test X"$sPRIfldbl" = X; then
9389 echo "Cannot figure out how to print long doubles." >&4
9391 sSCNfldbl=$sPRIfldbl # expect consistency
9398 case "$sPRIfldbl" in
9399 '') d_PRIfldbl="$undef"; d_PRIgldbl="$undef"; d_PRIeldbl="$undef";
9400 d_PRIFUldbl="$undef"; d_PRIGUldbl="$undef"; d_PRIEUldbl="$undef";
9401 d_SCNfldbl="$undef";
9403 *) d_PRIfldbl="$define"; d_PRIgldbl="$define"; d_PRIeldbl="$define";
9404 d_PRIFUldbl="$define"; d_PRIGUldbl="$define"; d_PRIEUldbl="$define";
9405 d_SCNfldbl="$define";
9409 : Check how to convert floats to strings.
9411 if test "X$d_Gconvert" = X; then
9414 echo "Checking for an efficient way to convert floats to strings."
9416 case "$uselongdouble" in
9417 "$define") echo "#define USE_LONG_DOUBLE" >>try.c ;;
9419 case "$d_longdbl" in
9420 "$define") echo "#define HAS_LONG_DOUBLE" >>try.c ;;
9422 case "$d_PRIgldbl" in
9423 "$define") echo "#define HAS_PRIgldbl" >>try.c ;;
9427 #define Gconvert(x,n,t,b) gconvert((x),(n),(t),(b))
9428 char *myname = "gconvert";
9431 #define Gconvert(x,n,t,b) gcvt((x),(n),(b))
9432 char *myname = "gcvt";
9435 #define Gconvert(x,n,t,b) qgcvt((x),(n),(b))
9436 char *myname = "qgcvt";
9437 #define DOUBLETYPE long double
9440 #if defined(USE_LONG_DOUBLE) && defined(HAS_LONG_DOUBLE)
9442 #define Gconvert(x,n,t,b) sprintf((b),"%.*"$sPRIgldbl,(n),(x))
9444 #define Gconvert(x,n,t,b) sprintf((b),"%.*g",(n),(double)(x))
9447 #define Gconvert(x,n,t,b) sprintf((b),"%.*g",(n),(x))
9449 char *myname = "sprintf";
9453 #if defined(USE_LONG_DOUBLE) && defined(HAS_LONG_DOUBLE)
9454 #define DOUBLETYPE long double
9456 #define DOUBLETYPE double
9462 #define I_STDLIB $i_stdlib
9468 checkit(expect, got)
9472 if (strcmp(expect, got)) {
9473 printf("%s oddity: Expected %s, got %s\n",
9474 myname, expect, got);
9484 /* This must be 1st test on (which?) platform */
9485 /* Alan Burlison <AlanBurlsin@unn.unisys.com> */
9486 Gconvert((DOUBLETYPE)0.1, 8, 0, buf);
9487 checkit("0.1", buf);
9489 Gconvert((DOUBLETYPE)0.01, 8, 0, buf);
9490 checkit("0.01", buf);
9492 Gconvert((DOUBLETYPE)0.001, 8, 0, buf);
9493 checkit("0.001", buf);
9495 Gconvert((DOUBLETYPE)0.0001, 8, 0, buf);
9496 checkit("0.0001", buf);
9498 Gconvert((DOUBLETYPE)0.00009, 8, 0, buf);
9499 if (strlen(buf) > 5)
9500 checkit("9e-005", buf); /* for Microsoft ?? */
9502 checkit("9e-05", buf);
9504 Gconvert((DOUBLETYPE)1.0, 8, 0, buf);
9507 Gconvert((DOUBLETYPE)1.1, 8, 0, buf);
9508 checkit("1.1", buf);
9510 Gconvert((DOUBLETYPE)1.01, 8, 0, buf);
9511 checkit("1.01", buf);
9513 Gconvert((DOUBLETYPE)1.001, 8, 0, buf);
9514 checkit("1.001", buf);
9516 Gconvert((DOUBLETYPE)1.0001, 8, 0, buf);
9517 checkit("1.0001", buf);
9519 Gconvert((DOUBLETYPE)1.00001, 8, 0, buf);
9520 checkit("1.00001", buf);
9522 Gconvert((DOUBLETYPE)1.000001, 8, 0, buf);
9523 checkit("1.000001", buf);
9525 Gconvert((DOUBLETYPE)0.0, 8, 0, buf);
9528 Gconvert((DOUBLETYPE)-1.0, 8, 0, buf);
9531 /* Some Linux gcvt's give 1.e+5 here. */
9532 Gconvert((DOUBLETYPE)100000.0, 8, 0, buf);
9533 checkit("100000", buf);
9535 /* Some Linux gcvt's give -1.e+5 here. */
9536 Gconvert((DOUBLETYPE)-100000.0, 8, 0, buf);
9537 checkit("-100000", buf);
9539 Gconvert((DOUBLETYPE)123.456, 8, 0, buf);
9540 checkit("123.456", buf);
9542 /* Testing of 1e+129 in bigintpm.t must not get extra '.' here. */
9543 Gconvert((DOUBLETYPE)1e34, 8, 0, buf);
9544 /* 34 should be enough to scare even long double
9545 * places into using the e notation. */
9546 if (strlen(buf) > 5)
9547 checkit("1e+034", buf); /* for Microsoft */
9549 checkit("1e+34", buf);
9551 /* For Perl, if you add additional tests here, also add them to
9552 * t/base/num.t for benefit of platforms not using Configure or
9553 * overriding d_Gconvert */
9558 : first add preferred functions to our list
9560 for xxx_convert in $gconvert_preference; do
9561 case $xxx_convert in
9562 gcvt|gconvert|sprintf) xxx_list="$xxx_list $xxx_convert" ;;
9563 *) echo "Discarding unrecognized gconvert_preference $xxx_convert" >&4 ;;
9566 : then add any others
9567 for xxx_convert in gconvert gcvt sprintf; do
9570 *) xxx_list="$xxx_list $xxx_convert" ;;
9574 case "$d_longdbl$uselongdouble" in
9576 : again, add prefered functions to our list first
9578 for xxx_convert in $gconvert_ld_preference; do
9579 case $xxx_convert in
9580 qgcvt|gcvt|gconvert|sprintf) xxx_ld_list="$xxx_ld_list $xxx_convert" ;;
9581 *) echo "Discarding unrecognized gconvert_ld_preference $xxx_convert" ;;
9584 : then add qgcvt, sprintf--then, in xxx_list order, gconvert and gcvt
9585 for xxx_convert in qgcvt sprintf $xxx_list; do
9586 case "$xxx_ld_list" in
9587 $xxx_convert*|*" $xxx_convert"*) ;;
9588 *) xxx_ld_list="$xxx_ld_list $xxx_convert" ;;
9591 : if sprintf cannot do long doubles, move it to the end
9592 if test "$d_PRIgldbl" != "$define"; then
9593 xxx_ld_list="`echo $xxx_ld_list|sed s/sprintf//` sprintf"
9595 : if no qgcvt, remove it
9596 if test "$d_qgcvt" != "$define"; then
9597 xxx_ld_list="`echo $xxx_ld_list|sed s/qgcvt//`"
9600 xxx_list="$xxx_ld_list"
9604 for xxx_convert in $xxx_list; do
9605 echo "Trying $xxx_convert..."
9607 set try -DTRY_$xxx_convert
9608 if eval $compile; then
9609 echo "$xxx_convert() found." >&4
9611 echo "I'll use $xxx_convert to convert floats into a string." >&4
9614 echo "...But $xxx_convert didn't work as I expected."
9618 echo "$xxx_convert NOT found." >&4
9622 if test X$xxx_convert = X; then
9623 echo "*** WHOA THERE!!! ***" >&4
9624 echo "None of ($xxx_list) seemed to work properly. I'll use sprintf." >&4
9628 case "$xxx_convert" in
9629 gconvert) d_Gconvert='gconvert((x),(n),(t),(b))' ;;
9630 gcvt) d_Gconvert='gcvt((x),(n),(b))' ;;
9631 qgcvt) d_Gconvert='qgcvt((x),(n),(b))' ;;
9632 *) case "$uselongdouble$d_longdbl$d_PRIgldbl" in
9633 "$define$define$define")
9634 d_Gconvert="sprintf((b),\"%.*\"$sPRIgldbl,(n),(x))" ;;
9635 "$define$define$undef")
9636 d_Gconvert='sprintf((b),"%.*g",(n),(double)(x))' ;;
9637 *) d_Gconvert='sprintf((b),"%.*g",(n),(x))' ;;
9644 : see if _fwalk exists
9648 : Initialize h_fcntl
9651 : Initialize h_sysfile
9654 : access call always available on UNIX
9658 : locate the flags for 'access()'
9662 $cat >access.c <<EOCP
9663 #include <sys/types.h>
9668 #include <sys/file.h>
9681 : check sys/file.h first, no particular reason here
9682 if $test `./findhdr sys/file.h` && \
9683 $cc -o access $cppflags -DI_SYS_FILE access.c >/dev/null 2>&1 ; then
9685 echo "<sys/file.h> defines the *_OK access constants." >&4
9686 elif $test `./findhdr fcntl.h` && \
9687 $cc -o access $cppflags -DI_FCNTL access.c >/dev/null 2>&1 ; then
9689 echo "<fcntl.h> defines the *_OK access constants." >&4
9690 elif $test `./findhdr unistd.h` && \
9691 $cc -o access $cppflags -DI_UNISTD access.c >/dev/null 2>&1 ; then
9692 echo "<unistd.h> defines the *_OK access constants." >&4
9694 echo "I can't find the four *_OK access constants--I'll use mine." >&4
9700 : see if accessx exists
9701 set accessx d_accessx
9704 : see if aintl exists
9708 : see if alarm exists
9712 : see if POSIX threads are available
9713 set pthread.h i_pthread
9716 : define a fucntion to check prototypes
9717 $cat > protochk <<EOSH
9720 optimize="$optimize"
9722 prototype="$prototype"
9725 usethreads=$usethreads
9726 i_pthread=$i_pthread
9727 pthread_h_first=$pthread_h_first
9730 $cat >> protochk <<'EOSH'
9735 while test $# -ge 2; do
9737 $define) echo "#include <$2>" >> try.c ;;
9738 literal) echo "$2" >> try.c ;;
9740 # Extra magic for the benefit of systems that need pthread.h
9741 # to be included early to correctly detect threadsafe functions.
9742 # Such functions must guarantee themselves, though, that the usethreads
9743 # and i_pthread have been defined, before calling protochk.
9744 if test "$usethreads" = "$define" -a "$i_pthread" = "$define" -a "$pthread_h_first" = "$define" -a "$pthread_h_done" = ""; then
9745 echo "#include <pthread.h>" >> try.c
9750 test "$prototype" = "$define" && echo '#define CAN_PROTOTYPE' >> try.c
9751 cat >> try.c <<'EOCP'
9752 #ifdef CAN_PROTOTYPE
9753 #define _(args) args
9758 echo "$foo" >> try.c
9759 echo 'int no_real_function_has_this_name _((void)) { return 0; }' >> try.c
9760 $cc $optimize $ccflags -c try.c > /dev/null 2>&1
9768 hasproto='varname=$1; func=$2; shift; shift;
9769 while $test $# -ge 2; do
9771 $define) echo "#include <$2>";;
9775 $cppstdin $cppflags $cppminus < try.c > tryout.c 2>/dev/null;
9776 if $contains "$func.*(" tryout.c >/dev/null 2>&1; then
9777 echo "$func() prototype found.";
9780 echo "$func() prototype NOT found.";
9785 $rm -f try.c tryout.c'
9787 : see if sys/types.h has to be included
9788 set sys/types.h i_systypes
9791 : see if sys/select.h has to be included
9792 set sys/select.h i_sysselct
9795 hasfield='varname=$1; struct=$2; field=$3; shift; shift; shift;
9796 while $test $# -ge 2; do
9798 $define) echo "#include <$2>";;
9802 echo "int main () { struct $struct foo; char* bar; bar = (char*)foo.$field; }" >> try.c;
9804 if eval $compile; then
9813 : see if we should include time.h, sys/time.h, or both
9815 if test "X$timeincl" = X; then
9816 echo "Testing to see if we should include <time.h>, <sys/time.h> or both." >&4
9817 $echo $n "I'm now running the test program...$c"
9819 #include <sys/types.h>
9824 #ifdef SYSTIMEKERNEL
9827 #include <sys/time.h>
9830 #include <sys/select.h>
9843 struct timezone tzp;
9845 if (foo.tm_sec == foo.tm_sec)
9848 if (bar.tv_sec == bar.tv_sec)
9855 for s_timezone in '-DS_TIMEZONE' ''; do
9857 for s_timeval in '-DS_TIMEVAL' ''; do
9858 for i_systimek in '' '-DSYSTIMEKERNEL'; do
9859 for i_time in '' '-DI_TIME'; do
9860 for i_systime in '-DI_SYSTIME' ''; do
9863 set try $i_time $i_systime $i_systimek $sysselect $s_timeval $s_timezone
9864 if eval $compile; then
9865 set X $i_time $i_systime $i_systimek $sysselect $s_timeval
9869 $echo $n "Succeeded with $flags$c"
9881 *SYSTIMEKERNEL*) i_systimek="$define"
9882 timeincl=`./findhdr sys/time.h`
9883 echo "We'll include <sys/time.h> with KERNEL defined." >&4;;
9884 *) i_systimek="$undef";;
9887 *I_TIME*) i_time="$define"
9888 timeincl=`./findhdr time.h`" $timeincl"
9889 echo "We'll include <time.h>." >&4;;
9890 *) i_time="$undef";;
9893 *I_SYSTIME*) i_systime="$define"
9894 timeincl=`./findhdr sys/time.h`" $timeincl"
9895 echo "We'll include <sys/time.h>." >&4;;
9896 *) i_systime="$undef";;
9900 : see if struct tm knows about tm_zone
9901 case "$i_systime$i_time" in
9904 echo "Checking to see if your struct tm has tm_zone field..." >&4
9905 set d_tm_tm_zone tm tm_zone $i_systime sys/time.h $i_time time.h
9913 case "$d_tm_tm_zone" in
9914 "$define") echo "Yes, it does." ;;
9915 *) echo "No, it doesn't." ;;
9917 : see if struct tm knows about tm_gmtoff
9918 case "$i_systime$i_time" in
9921 echo "Checking to see if your struct tm has tm_gmtoff field..." >&4
9922 set d_tm_tm_gmtoff tm tm_gmtoff $i_systime sys/time.h $i_time time.h
9930 case "$d_tm_tm_gmtoff" in
9931 "$define") echo "Yes, it does." ;;
9932 *) echo "No, it doesn't." ;;
9935 : see if asctime_r exists
9936 set asctime_r d_asctime_r
9938 case "$d_asctime_r" in
9940 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
9941 case "$d_asctime_r_proto:$usethreads" in
9942 ":define") d_asctime_r_proto=define
9943 set d_asctime_r_proto asctime_r $hdrs
9947 case "$d_asctime_r_proto" in
9949 case "$asctime_r_proto" in
9950 ''|0) try='char* asctime_r(const struct tm*, char*);'
9951 ./protochk "extern $try" $hdrs && asctime_r_proto=B_SB ;;
9953 case "$asctime_r_proto" in
9954 ''|0) try='char* asctime_r(const struct tm*, char*, int);'
9955 ./protochk "extern $try" $hdrs && asctime_r_proto=B_SBI ;;
9957 case "$asctime_r_proto" in
9958 ''|0) try='int asctime_r(const struct tm*, char*);'
9959 ./protochk "extern $try" $hdrs && asctime_r_proto=I_SB ;;
9961 case "$asctime_r_proto" in
9962 ''|0) try='int asctime_r(const struct tm*, char*, int);'
9963 ./protochk "extern $try" $hdrs && asctime_r_proto=I_SBI ;;
9965 case "$asctime_r_proto" in
9966 ''|0) d_asctime_r=undef
9968 echo "Disabling asctime_r, cannot determine prototype." >&4 ;;
9969 * ) case "$asctime_r_proto" in
9970 REENTRANT_PROTO*) ;;
9971 *) asctime_r_proto="REENTRANT_PROTO_$asctime_r_proto" ;;
9973 echo "Prototype: $try" ;;
9976 *) case "$usethreads" in
9977 define) echo "asctime_r has no prototype, not using it." >&4 ;;
9984 *) asctime_r_proto=0
9988 : see if atolf exists
9992 : see if atoll exists
9996 : Look for GCC-style attribute format
9997 case "$d_attribute_format" in
10000 echo "Checking whether your compiler can handle __attribute__((format)) ..." >&4
10001 $cat >attrib.c <<'EOCP'
10003 void my_special_printf(char* pat,...) __attribute__((__format__(__printf__,1,2)));
10005 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10006 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10007 echo "Your C compiler doesn't support __attribute__((format))."
10010 echo "Your C compiler supports __attribute__((format))."
10014 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10018 *) val="$d_attribute_format" ;;
10020 set d_attribute_format
10024 : Look for GCC-style attribute format with null format allowed
10025 case "$d_printf_format_null" in
10026 '') case "$d_attribute_format" in
10029 echo "Checking whether your compiler allows __printf__ format to be null ..." >&4
10030 $cat >attrib.c <<EOCP
10032 #$i_stdlib I_STDLIB
10034 #include <stdlib.h>
10036 int null_printf (char* pat,...) __attribute__((__format__(__printf__,1,2)));
10037 int null_printf (char* pat,...) { return (int)pat; }
10038 int main () { exit(null_printf(NULL)); }
10040 if $cc $ccflags -o attrib attrib.c >attrib.out 2>&1 ; then
10041 : run the executable in case it produces a run-time warning
10042 if $run ./attrib >>attrib.out 2>&1; then
10043 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10044 echo "Your C compiler doesn't allow __printf__ format to be null."
10047 echo "Your C compiler allows __printf__ format to be null."
10051 echo "Your C compiler executable failed with __printf__ format null."
10055 echo "Your C compiler fails with __printf__ format null."
10062 *) val="$d_printf_format_null" ;;
10064 set d_printf_format_null
10068 : Look for GCC-style attribute malloc
10069 case "$d_attribute_malloc" in
10072 echo "Checking whether your compiler can handle __attribute__((malloc)) ..." >&4
10073 $cat >attrib.c <<'EOCP'
10075 char *go_get_some_memory( int how_many_bytes ) __attribute__((malloc));
10077 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10078 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10079 echo "Your C compiler doesn't support __attribute__((malloc))."
10082 echo "Your C compiler supports __attribute__((malloc))."
10086 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10090 *) val="$d_attribute_malloc" ;;
10092 set d_attribute_malloc
10096 : Look for GCC-style attribute nonnull
10097 case "$d_attribute_nonnull" in
10100 echo "Checking whether your compiler can handle __attribute__((nonnull(1))) ..." >&4
10101 $cat >attrib.c <<'EOCP'
10103 void do_something (char *some_pointer,...) __attribute__((nonnull(1)));
10105 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10106 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10107 echo "Your C compiler doesn't support __attribute__((nonnull))."
10110 echo "Your C compiler supports __attribute__((nonnull))."
10114 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10118 *) val="$d_attribute_nonnull" ;;
10120 set d_attribute_nonnull
10124 : Look for GCC-style attribute noreturn
10125 case "$d_attribute_noreturn" in
10128 echo "Checking whether your compiler can handle __attribute__((noreturn)) ..." >&4
10129 $cat >attrib.c <<'EOCP'
10131 void fall_over_dead( void ) __attribute__((noreturn));
10133 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10134 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10135 echo "Your C compiler doesn't support __attribute__((noreturn))."
10138 echo "Your C compiler supports __attribute__((noreturn))."
10142 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10146 *) val="$d_attribute_noreturn" ;;
10148 set d_attribute_noreturn
10152 : Look for GCC-style attribute pure
10153 case "$d_attribute_pure" in
10156 echo "Checking whether your compiler can handle __attribute__((pure)) ..." >&4
10157 $cat >attrib.c <<'EOCP'
10159 int square( int n ) __attribute__((pure));
10161 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10162 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10163 echo "Your C compiler doesn't support __attribute__((pure))."
10166 echo "Your C compiler supports __attribute__((pure))."
10170 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10174 *) val="$d_attribute_pure" ;;
10176 set d_attribute_pure
10180 : Look for GCC-style attribute unused
10181 case "$d_attribute_unused" in
10184 echo "Checking whether your compiler can handle __attribute__((unused)) ..." >&4
10185 $cat >attrib.c <<'EOCP'
10187 int do_something( int dummy __attribute__((unused)), int n );
10189 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10190 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10191 echo "Your C compiler doesn't support __attribute__((unused))."
10194 echo "Your C compiler supports __attribute__((unused))."
10198 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10202 *) val="$d_attribute_unused" ;;
10204 set d_attribute_unused
10208 : Look for GCC-style attribute warn_unused_result
10209 case "$d_attribute_warn_unused_result" in
10212 echo "Checking whether your compiler can handle __attribute__((warn_unused_result)) ..." >&4
10213 $cat >attrib.c <<'EOCP'
10215 int I_will_not_be_ignored(void) __attribute__((warn_unused_result));
10217 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10218 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10219 echo "Your C compiler doesn't support __attribute__((warn_unused_result))."
10222 echo "Your C compiler supports __attribute__((warn_unused_result))."
10226 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10230 *) val="$d_attribute_warn_unused_result" ;;
10232 set d_attribute_warn_unused_result
10236 : see if bcmp exists
10240 : see if bcopy exists
10244 : see if getpgrp exists
10245 set getpgrp d_getpgrp
10248 case "$d_getpgrp" in
10251 echo "Checking to see which flavor of getpgrp is in use..."
10253 #$i_unistd I_UNISTD
10254 #include <sys/types.h>
10256 # include <unistd.h>
10258 #$i_stdlib I_STDLIB
10260 #include <stdlib.h>
10264 if (getuid() == 0) {
10265 printf("(I see you are running Configure as super-user...)\n");
10268 #ifdef TRY_BSD_PGRP
10269 if (getpgrp(1) == 0)
10278 if $cc -o try -DTRY_BSD_PGRP $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
10279 echo "You have to use getpgrp(pid) instead of getpgrp()." >&4
10281 elif $cc -o try $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
10282 echo "You have to use getpgrp() instead of getpgrp(pid)." >&4
10285 echo "I can't seem to compile and run the test program."
10287 xxx="a USG one, i.e. you use getpgrp()."
10289 # SVR4 systems can appear rather BSD-ish.
10290 case "$i_unistd" in
10292 xxx="a BSD one, i.e. you use getpgrp(pid)."
10296 xxx="probably a USG one, i.e. you use getpgrp()."
10301 echo "Assuming your getpgrp is $xxx" >&4
10310 : see if setpgrp exists
10311 set setpgrp d_setpgrp
10314 case "$d_setpgrp" in
10317 echo "Checking to see which flavor of setpgrp is in use..."
10319 #$i_unistd I_UNISTD
10320 #include <sys/types.h>
10322 # include <unistd.h>
10324 #$i_stdlib I_STDLIB
10326 #include <stdlib.h>
10330 if (getuid() == 0) {
10331 printf("(I see you are running Configure as super-user...)\n");
10334 #ifdef TRY_BSD_PGRP
10335 if (-1 == setpgrp(1, 1))
10338 if (setpgrp() != -1)
10344 if $cc -o try -DTRY_BSD_PGRP $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
10345 echo 'You have to use setpgrp(pid,pgrp) instead of setpgrp().' >&4
10347 elif $cc -o try $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
10348 echo 'You have to use setpgrp() instead of setpgrp(pid,pgrp).' >&4
10351 echo "(I can't seem to compile and run the test program.)"
10353 xxx="a USG one, i.e. you use setpgrp()."
10355 # SVR4 systems can appear rather BSD-ish.
10356 case "$i_unistd" in
10358 xxx="a BSD one, i.e. you use setpgrp(pid,pgrp)."
10362 xxx="probably a USG one, i.e. you use setpgrp()."
10367 echo "Assuming your setpgrp is $xxx" >&4
10375 : Look for GCC-style __builtin_choose_expr
10376 case "$d_builtin_choose_expr" in
10379 echo "Checking whether your compiler can handle __builtin_choose_expr ..." >&4
10380 $cat >try.c <<'EOCP'
10381 #include <assert.h>
10382 #include <stdlib.h>
10385 #define SYRINX(x) __builtin_choose_expr( x, (1056*2), (103*50) )
10388 assert( SYRINX(1) == 2112 );
10389 assert( SYRINX(1) != 5150 );
10390 assert( SYRINX(0) == 5150 );
10391 assert( SYRINX(0) != 2112 );
10392 puts( "All good!" );
10398 if eval $compile; then
10399 echo "Your C compiler supports __builtin_choose_expr."
10402 echo "Your C compiler doesn't seem to understand __builtin_choose_expr."
10406 *) val="$d_builtin_choose_expr" ;;
10409 set d_builtin_choose_expr
10411 $rm -f try.* try core core.try.*
10413 : Look for GCC-style __builtin_expect
10414 case "$d_builtin_expect" in
10417 echo "Checking whether your compiler can handle __builtin_expect ..." >&4
10418 $cat >builtin.c <<'EOCP'
10421 if ( __builtin_expect(n, 0) ) n = 1;
10425 if eval $compile; then
10426 echo "Your C compiler supports __builtin_choose_expr."
10429 echo "Your C compiler doesn't seem to understand __builtin_choose_expr."
10433 *) val="$d_builtin_expect" ;;
10436 set d_builtin_expect
10438 $rm -f try.* try core core.try.*
10440 : see if bzero exists
10444 : see if stdarg is available
10446 if $test `./findhdr stdarg.h`; then
10447 echo "<stdarg.h> found." >&4
10450 echo "<stdarg.h> NOT found." >&4
10454 : see if varags is available
10456 if $test `./findhdr varargs.h`; then
10457 echo "<varargs.h> found." >&4
10459 echo "<varargs.h> NOT found, but that's ok (I hope)." >&4
10462 : set up the varargs testing programs
10463 $cat > varargs.c <<EOP
10465 #include <stdarg.h>
10468 #include <varargs.h>
10472 int f(char *p, ...)
10486 p = va_arg(ap, char *);
10492 $cat > varargs <<EOP
10494 if $cc -c $ccflags -D\$1 varargs.c >/dev/null 2>&1; then
10503 : now check which varargs header should be included
10508 if `./varargs I_STDARG`; then
10510 elif `./varargs I_VARARGS`; then
10515 if `./varargs I_VARARGS`; then
10522 echo "I could not find the definition for va_dcl... You have problems..." >&4
10523 val="$undef"; set i_stdarg; eval $setvar
10524 val="$undef"; set i_varargs; eval $setvar
10529 case "$i_varhdr" in
10531 val="$define"; set i_stdarg; eval $setvar
10532 val="$undef"; set i_varargs; eval $setvar
10535 val="$undef"; set i_stdarg; eval $setvar
10536 val="$define"; set i_varargs; eval $setvar
10539 echo "We'll include <$i_varhdr> to get va_dcl definition." >&4;;
10543 : see if the Compiler supports C99 variadic macros
10544 case "$i_stdarg$i_stdlib" in
10546 echo "You have <stdarg.h> and <stdlib.h>, so checking for C99 variadic macros." >&4
10549 #include <stdarg.h>
10551 #define foo(buffer, format, ...) sprintf(buffer, format, __VA_ARGS__)
10555 foo(buf, "%d %g %.*s", 123, 456.0, (int)3, "789fail");
10561 if eval $compile && $run ./try 2>&1 >/dev/null; then
10562 case "`$run ./try`" in
10564 echo "You have C99 variadic macros." >&4
10565 d_c99_variadic_macros="$define"
10568 echo "You don't have functional C99 variadic macros." >&4
10569 d_c99_variadic_macros="$undef"
10573 echo "I couldn't compile and run the test program, so I assume that you don't have functional C99 variadic macros." >&4
10574 d_c99_variadic_macros="$undef"
10576 $rm -f try.* try core core.try.*
10579 echo "You don't have <stdarg.h> and <stdlib.h>, so not checking for C99 variadic macros." >&4
10580 d_c99_variadic_macros="$undef"
10584 : see if signal is declared as pointer to function returning int or void
10586 xxx=`./findhdr signal.h`
10587 $test "$xxx" && $cppstdin $cppminus $cppflags < $xxx >$$.tmp 2>/dev/null
10588 if $contains 'int.*\*[ ]*signal' $$.tmp >/dev/null 2>&1 ; then
10589 echo "You have int (*signal())() instead of void." >&4
10591 elif $contains 'void.*\*[ ]*signal' $$.tmp >/dev/null 2>&1 ; then
10592 echo "You have void (*signal())()." >&4
10594 elif $contains 'extern[ ]*[(\*]*signal' $$.tmp >/dev/null 2>&1 ; then
10595 echo "You have int (*signal())() instead of void." >&4
10597 elif $contains 'void.*\*.*sig' $$.tmp >/dev/null 2>&1 ; then
10598 echo "You have void (*signal())()." >&4
10601 case "$d_voidsig" in
10603 echo "I can't determine whether signal handler returns void or int..." >&4
10605 rp="What type does your signal handler return?"
10608 v*) val="$define";;
10612 echo "As you already told me, signal handler returns void." >&4
10615 *) echo "As you already told me, signal handler returns int." >&4
10622 case "$d_voidsig" in
10623 "$define") signal_t="void";;
10624 *) signal_t="int";;
10628 : check for ability to cast large floats to 32-bit ints.
10630 echo 'Checking whether your C compiler can cast large floats to int32.' >&4
10631 if $test "$intsize" -ge 4; then
10638 #$i_stdlib I_STDLIB
10640 #include <stdlib.h>
10642 #include <sys/types.h>
10643 #include <signal.h>
10644 $signal_t blech(int s) { exit(3); }
10651 signal(SIGFPE, blech);
10653 /* Don't let compiler optimize the test away. Store the number
10654 in a writable string for gcc to pass to sscanf under HP/UX.
10656 sprintf(str, "2147483647");
10657 sscanf(str, "%lf", &f); /* f = (double) 0x7fffffff; */
10661 /* x86 processors will probably give 0x8000 0000, which is a
10662 sign change. We don't want that. We want to mimic SPARC
10663 behavior here, which is to preserve the sign and give
10666 if (i32 != ($xxx) f)
10672 if eval $compile_ok; then
10676 echo "(I can't seem to compile the test program--assuming it can't)"
10681 echo "Yup, it can."
10684 echo "Nope, it can't."
10691 : check for ability to cast negative floats to unsigned
10693 echo 'Checking whether your C compiler can cast negative float to unsigned.' >&4
10696 #$i_stdlib I_STDLIB
10698 #include <stdlib.h>
10700 #include <sys/types.h>
10701 #include <signal.h>
10702 $signal_t blech(int s) { exit(7); }
10703 $signal_t blech_in_list(int s) { exit(4); }
10704 unsigned long dummy_long(unsigned long p) { return p; }
10705 unsigned int dummy_int(unsigned int p) { return p; }
10706 unsigned short dummy_short(unsigned short p) { return p; }
10710 unsigned long along;
10712 unsigned short ashort;
10716 /* Frustrate gcc-2.7.2's optimizer which failed this test with
10717 a direct f = -123. assignment. gcc-2.8.0 reportedly
10718 optimized the whole file away
10720 /* Store the number in a writable string for gcc to pass to
10721 sscanf under HP/UX.
10723 sprintf(str, "-123");
10724 sscanf(str, "%lf", &f); /* f = -123.; */
10726 signal(SIGFPE, blech);
10727 along = (unsigned long)f;
10728 aint = (unsigned int)f;
10729 ashort = (unsigned short)f;
10730 if (along != (unsigned long)-123)
10732 if (aint != (unsigned int)-123)
10734 if (ashort != (unsigned short)-123)
10736 sprintf(str, "1073741824.");
10737 sscanf(str, "%lf", &f); /* f = (double)0x40000000; */
10740 along = (unsigned long)f;
10741 if (along != 0x80000000)
10745 along = (unsigned long)f;
10746 if (along != 0x7fffffff)
10750 along = (unsigned long)f;
10751 if (along != 0x80000001)
10755 signal(SIGFPE, blech_in_list);
10756 sprintf(str, "123.");
10757 sscanf(str, "%lf", &f); /* f = 123.; */
10758 along = dummy_long((unsigned long)f);
10759 aint = dummy_int((unsigned int)f);
10760 ashort = dummy_short((unsigned short)f);
10761 if (along != (unsigned long)123)
10763 if (aint != (unsigned int)123)
10765 if (ashort != (unsigned short)123)
10772 if eval $compile_ok; then
10776 echo "(I can't seem to compile the test program--assuming it can't)"
10779 case "$castflags" in
10781 echo "Yup, it can."
10784 echo "Nope, it can't."
10791 : see if vprintf exists
10793 if set vprintf val -f d_vprintf; eval $csym; $val; then
10794 echo 'vprintf() found.' >&4
10797 #include <varargs.h>
10798 #$i_stdlib I_STDLIB
10800 #include <stdlib.h>
10803 int main() { xxx("foo"); }
10812 exit((unsigned long)vsprintf(buf,"%s",args) > 10L);
10816 if eval $compile && $run ./try; then
10817 echo "Your vsprintf() returns (int)." >&4
10820 echo "Your vsprintf() returns (char*)." >&4
10824 echo 'vprintf() NOT found.' >&4
10835 : see if chown exists
10839 : see if chroot exists
10840 set chroot d_chroot
10843 : see if chsize exists
10844 set chsize d_chsize
10847 : see if class exists
10851 : see if clearenv exists
10852 set clearenv d_clearenv
10855 hasstruct='varname=$1; struct=$2; shift; shift;
10856 while $test $# -ge 2; do
10858 $define) echo "#include <$2>";;
10862 echo "int main () { struct $struct foo; }" >> try.c;
10864 if eval $compile; then
10871 $rm -f try.c try.o'
10875 : see whether socket exists
10877 $echo $n "Hmm... $c" >&4
10878 if set socket val -f d_socket; eval $csym; $val; then
10879 echo "Looks like you have Berkeley networking support." >&4
10881 if set setsockopt val -f; eval $csym; $val; then
10884 echo "...but it uses the old BSD 4.1c interface, rather than 4.2." >&4
10885 d_oldsock="$define"
10888 if $contains socklib libc.list >/dev/null 2>&1; then
10889 echo "Looks like you have Berkeley networking support." >&4
10891 : we will have to assume that it supports the 4.2 BSD interface
10894 echo "You don't have Berkeley networking in libc$_a..." >&4
10895 if test "X$d_socket" = "X$define"; then
10896 echo "...but you seem to believe that you have sockets." >&4
10898 for net in net socket
10900 if test -f /usr/lib/lib$net$_a; then
10901 ( ($nm $nm_opt /usr/lib/lib$net$_a | eval $nm_extract) || \
10902 $ar t /usr/lib/lib$net$_a) 2>/dev/null >> libc.list
10903 if $contains socket libc.list >/dev/null 2>&1; then
10908 echo "...but the Wollongong group seems to have hacked it in." >&4
10909 sockethdr="-I/usr/netinclude"
10912 echo "Found Berkeley sockets interface in lib$net." >&4
10913 if $contains setsockopt libc.list >/dev/null 2>&1; then
10916 echo "...using the old BSD 4.1c interface, rather than 4.2." >&4
10917 d_oldsock="$define"
10923 if test "X$d_socket" != "X$define"; then
10924 echo "or anywhere else I see." >&4
10932 : see if socketpair exists
10933 set socketpair d_sockpair
10938 echo "Checking the availability of certain socket constants..." >&4
10939 for ENUM in MSG_CTRUNC MSG_DONTROUTE MSG_OOB MSG_PEEK MSG_PROXY SCM_RIGHTS; do
10940 enum=`$echo $ENUM|./tr '[A-Z]' '[a-z]'`
10942 #include <sys/types.h>
10943 #include <sys/socket.h>
10949 set try; if eval $compile; then
10952 set d_${enum}; eval $setvar
10956 : see if this is a sys/uio.h system
10957 set sys/uio.h i_sysuio
10962 echo "Checking to see if your system supports struct cmsghdr..." >&4
10963 set d_cmsghdr_s cmsghdr $i_systypes sys/types.h $d_socket sys/socket.h $i_sysuio sys/uio.h
10965 case "$d_cmsghdr_s" in
10966 "$define") echo "Yes, it does." ;;
10967 *) echo "No, it doesn't." ;;
10971 : check for const keyword
10973 echo 'Checking to see if your C compiler knows about "const"...' >&4
10974 $cat >const.c <<'EOCP'
10975 typedef struct spug { int drokk; } spug;
10979 const spug y = { 0 };
10982 if $cc -c $ccflags const.c >/dev/null 2>&1 ; then
10984 echo "Yup, it does."
10987 echo "Nope, it doesn't."
10992 : see if copysignl exists
10993 set copysignl d_copysignl
10996 : see if crypt exists
11001 $define) cryptlib='' ;;
11002 *) if set crypt val -f d_crypt; eval $csym; $val; then
11003 echo 'crypt() found.' >&4
11007 cryptlib=`./loc Slibcrypt$_a "" $xlibpth`
11008 if $test -z "$cryptlib"; then
11009 cryptlib=`./loc Mlibcrypt$_a "" $xlibpth`
11013 if $test -z "$cryptlib"; then
11014 cryptlib=`./loc Llibcrypt$_a "" $xlibpth`
11018 if $test -z "$cryptlib"; then
11019 cryptlib=`./loc libcrypt$_a "" $libpth`
11023 if $test -z "$cryptlib"; then
11024 echo 'crypt() NOT found.' >&4
11035 : see if this is a crypt.h system
11036 set crypt.h i_crypt
11039 : see if crypt_r exists
11040 set crypt_r d_crypt_r
11042 case "$d_crypt_r" in
11044 hdrs="$i_systypes sys/types.h define stdio.h $i_crypt crypt.h"
11045 case "$d_crypt_r_proto:$usethreads" in
11046 ":define") d_crypt_r_proto=define
11047 set d_crypt_r_proto crypt_r $hdrs
11051 case "$d_crypt_r_proto" in
11053 case "$crypt_r_proto" in
11054 ''|0) try='char* crypt_r(const char*, const char*, struct crypt_data*);'
11055 ./protochk "extern $try" $hdrs && crypt_r_proto=B_CCS ;;
11057 case "$crypt_r_proto" in
11058 ''|0) try='char* crypt_r(const char*, const char*, CRYPTD*);'
11059 ./protochk "extern $try" $hdrs && crypt_r_proto=B_CCD ;;
11061 case "$crypt_r_proto" in
11062 ''|0) d_crypt_r=undef
11064 echo "Disabling crypt_r, cannot determine prototype." >&4 ;;
11065 * ) case "$crypt_r_proto" in
11066 REENTRANT_PROTO*) ;;
11067 *) crypt_r_proto="REENTRANT_PROTO_$crypt_r_proto" ;;
11069 echo "Prototype: $try" ;;
11072 *) case "$usethreads" in
11073 define) echo "crypt_r has no prototype, not using it." >&4 ;;
11084 : get csh whereabouts
11086 'csh') val="$undef" ;;
11087 *) val="$define" ;;
11091 : Respect a hint or command line value for full_csh.
11092 case "$full_csh" in
11093 '') full_csh=$csh ;;
11096 : see if ctermid exists
11097 set ctermid d_ctermid
11100 : see if ctermid_r exists
11101 set ctermid_r d_ctermid_r
11103 case "$d_ctermid_r" in
11105 hdrs="$i_systypes sys/types.h define stdio.h "
11106 case "$d_ctermid_r_proto:$usethreads" in
11107 ":define") d_ctermid_r_proto=define
11108 set d_ctermid_r_proto ctermid_r $hdrs
11112 case "$d_ctermid_r_proto" in
11114 case "$ctermid_r_proto" in
11115 ''|0) try='char* ctermid_r(char*);'
11116 ./protochk "extern $try" $hdrs && ctermid_r_proto=B_B ;;
11118 case "$ctermid_r_proto" in
11119 ''|0) d_ctermid_r=undef
11121 echo "Disabling ctermid_r, cannot determine prototype." >&4 ;;
11122 * ) case "$ctermid_r_proto" in
11123 REENTRANT_PROTO*) ;;
11124 *) ctermid_r_proto="REENTRANT_PROTO_$ctermid_r_proto" ;;
11126 echo "Prototype: $try" ;;
11129 *) case "$usethreads" in
11130 define) echo "ctermid_r has no prototype, not using it." >&4 ;;
11137 *) ctermid_r_proto=0
11141 : see if ctime_r exists
11142 set ctime_r d_ctime_r
11144 case "$d_ctime_r" in
11146 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
11147 case "$d_ctime_r_proto:$usethreads" in
11148 ":define") d_ctime_r_proto=define
11149 set d_ctime_r_proto ctime_r $hdrs
11153 case "$d_ctime_r_proto" in
11155 case "$ctime_r_proto" in
11156 ''|0) try='char* ctime_r(const time_t*, char*);'
11157 ./protochk "extern $try" $hdrs && ctime_r_proto=B_SB ;;
11159 case "$ctime_r_proto" in
11160 ''|0) try='char* ctime_r(const time_t*, char*, int);'
11161 ./protochk "extern $try" $hdrs && ctime_r_proto=B_SBI ;;
11163 case "$ctime_r_proto" in
11164 ''|0) try='int ctime_r(const time_t*, char*);'
11165 ./protochk "extern $try" $hdrs && ctime_r_proto=I_SB ;;
11167 case "$ctime_r_proto" in
11168 ''|0) try='int ctime_r(const time_t*, char*, int);'
11169 ./protochk "extern $try" $hdrs && ctime_r_proto=I_SBI ;;
11171 case "$ctime_r_proto" in
11172 ''|0) d_ctime_r=undef
11174 echo "Disabling ctime_r, cannot determine prototype." >&4 ;;
11175 * ) case "$ctime_r_proto" in
11176 REENTRANT_PROTO*) ;;
11177 *) ctime_r_proto="REENTRANT_PROTO_$ctime_r_proto" ;;
11179 echo "Prototype: $try" ;;
11182 *) case "$usethreads" in
11183 define) echo "ctime_r has no prototype, not using it." >&4 ;;
11194 : see if cuserid exists
11195 set cuserid d_cuserid
11198 : see if this is a limits.h system
11199 set limits.h i_limits
11202 : see if this is a float.h system
11203 set float.h i_float
11206 : See if number of significant digits in a double precision number is known
11208 $cat >dbl_dig.c <<EOM
11209 #$i_limits I_LIMITS
11212 #include <limits.h>
11218 printf("Contains DBL_DIG");
11221 $cppstdin $cppflags $cppminus < dbl_dig.c >dbl_dig.E 2>/dev/null
11222 if $contains 'DBL_DIG' dbl_dig.E >/dev/null 2>&1; then
11223 echo "DBL_DIG found." >&4
11226 echo "DBL_DIG NOT found." >&4
11233 : see if dbm.h is available
11234 : see if dbmclose exists
11235 set dbmclose d_dbmclose
11238 case "$d_dbmclose" in
11248 *) set rpcsvc/dbm.h i_rpcsvcdbm
11253 *) echo "We won't be including <dbm.h>"
11263 : see if prototype for dbminit is available
11265 set d_dbminitproto dbminit $i_dbm dbm.h
11268 : see if difftime exists
11269 set difftime d_difftime
11272 : see if this is a dirent system
11274 if xinc=`./findhdr dirent.h`; $test "$xinc"; then
11276 echo "<dirent.h> found." >&4
11279 if xinc=`./findhdr sys/dir.h`; $test "$xinc"; then
11280 echo "<sys/dir.h> found." >&4
11283 xinc=`./findhdr sys/ndir.h`
11285 echo "<dirent.h> NOT found." >&4
11290 : Look for type of directory structure.
11292 $cppstdin $cppflags $cppminus < "$xinc" > try.c
11294 case "$direntrytype" in
11296 case "$i_dirent" in
11297 $define) guess1='struct dirent' ;;
11298 *) guess1='struct direct' ;;
11301 *) guess1="$direntrytype"
11306 'struct dirent') guess2='struct direct' ;;
11307 *) guess2='struct dirent' ;;
11310 if $contains "$guess1" try.c >/dev/null 2>&1; then
11311 direntrytype="$guess1"
11312 echo "Your directory entries are $direntrytype." >&4
11313 elif $contains "$guess2" try.c >/dev/null 2>&1; then
11314 direntrytype="$guess2"
11315 echo "Your directory entries seem to be $direntrytype." >&4
11317 echo "I don't recognize your system's directory entries." >&4
11318 rp="What type is used for directory entries on this system?"
11321 direntrytype="$ans"
11326 : see if the directory entry stores field length
11328 $cppstdin $cppflags $cppminus < "$xinc" > try.c
11329 if $contains 'd_namlen' try.c >/dev/null 2>&1; then
11330 echo "Good, your directory entry keeps length information in d_namlen." >&4
11333 echo "Your directory entry does not know about the d_namlen field." >&4
11340 : Look for DIR.dd_fd
11341 case "$i_dirent" in
11343 echo "Checking to see if DIR has a dd_fd member variable" >&4
11345 #$i_stdlib I_STDLIB
11347 #include <stdlib.h>
11349 #include <dirent.h>
11359 if eval $compile; then
11360 echo "Yes, it does."
11363 echo "No, it does not."
11368 echo "You don't have a <dirent.h>, so not checking for dd_fd." >&4
11376 : see if this is an sysdir system
11377 set sys/dir.h i_sysdir
11380 : see if this is an sysndir system
11381 set sys/ndir.h i_sysndir
11386 $cat >dirfd.c <<EOM
11388 #$i_stdlib I_STDLIB
11390 #include <stdlib.h>
11392 #$i_dirent I_DIRENT /**/
11393 #$i_sysdir I_SYS_DIR /**/
11394 #$i_sysndir I_SYS_NDIR /**/
11395 #$i_systypes I_SYS_TYPES /**/
11396 #if defined(I_SYS_TYPES)
11397 #include <sys/types.h>
11399 #if defined(I_DIRENT)
11400 #include <dirent.h>
11401 #if defined(NeXT) && defined(I_SYS_DIR) /* NeXT needs dirent + sys/dir.h */
11402 #include <sys/dir.h>
11406 #include <sys/ndir.h>
11410 #include <ndir.h> /* may be wrong in the future */
11412 #include <sys/dir.h>
11418 DIR *dirp = opendir(".");
11419 if (dirfd(dirp) >= 0)
11427 if eval $compile; then
11431 $define) echo "dirfd() found." >&4 ;;
11432 *) echo "dirfd() NOT found." >&4 ;;
11438 : see if dlerror exists
11441 set dlerror d_dlerror
11445 : see if dlfcn is available
11446 set dlfcn.h i_dlfcn
11453 On a few systems, the dynamically loaded modules that perl generates and uses
11454 will need a different extension than shared libs. The default will probably
11460 *) dflt="$dlext" ;;
11462 rp='What is the extension of dynamically loaded modules'
11471 : Check if dlsym need a leading underscore
11477 echo "Checking whether your dlsym() needs a leading underscore ..." >&4
11478 $cat >dyna.c <<'EOM'
11485 #$i_stdlib I_STDLIB
11487 #include <stdlib.h>
11491 #include <dlfcn.h> /* the dynamic linker include file for SunOS/Solaris */
11493 #include <sys/types.h>
11498 extern int fred() ;
11507 int mode = RTLD_LAZY ;
11509 handle = dlopen("./dyna.$dlext", mode) ;
11510 if (handle == NULL) {
11515 symbol = dlsym(handle, "fred") ;
11516 if (symbol == NULL) {
11517 /* try putting a leading underscore */
11518 symbol = dlsym(handle, "_fred") ;
11519 if (symbol == NULL) {
11532 : Call the object file tmp-dyna.o in case dlext=o.
11533 if $cc $ccflags $cccdlflags -c dyna.c > /dev/null 2>&1 &&
11534 mv dyna${_o} tmp-dyna${_o} > /dev/null 2>&1 &&
11535 $ld -o dyna.$dlext $ldflags $lddlflags tmp-dyna${_o} > /dev/null 2>&1 &&
11536 $cc -o fred $ccflags $ldflags $cccdlflags $ccdlflags fred.c $libs > /dev/null 2>&1 && $to dyna.$dlext; then
11539 1) echo "Test program failed using dlopen." >&4
11540 echo "Perhaps you should not use dynamic loading." >&4;;
11541 2) echo "Test program failed using dlsym." >&4
11542 echo "Perhaps you should not use dynamic loading." >&4;;
11543 3) echo "dlsym needs a leading underscore" >&4
11545 4) echo "dlsym doesn't need a leading underscore." >&4;;
11548 echo "I can't compile and run the test program." >&4
11549 echo "I'm guessing that dlsym doesn't need a leading underscore." >&4
11554 $rm -f fred fred.* dyna.$dlext dyna.* tmp-dyna.*
11559 : see if drand48_r exists
11560 set drand48_r d_drand48_r
11562 case "$d_drand48_r" in
11564 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
11565 case "$d_drand48_r_proto:$usethreads" in
11566 ":define") d_drand48_r_proto=define
11567 set d_drand48_r_proto drand48_r $hdrs
11571 case "$d_drand48_r_proto" in
11573 case "$drand48_r_proto" in
11574 ''|0) try='int drand48_r(struct drand48_data*, double*);'
11575 ./protochk "extern $try" $hdrs && drand48_r_proto=I_ST ;;
11577 case "$drand48_r_proto" in
11578 ''|0) d_drand48_r=undef
11580 echo "Disabling drand48_r, cannot determine prototype." >&4 ;;
11581 * ) case "$drand48_r_proto" in
11582 REENTRANT_PROTO*) ;;
11583 *) drand48_r_proto="REENTRANT_PROTO_$drand48_r_proto" ;;
11585 echo "Prototype: $try" ;;
11588 *) case "$usethreads" in
11589 define) echo "drand48_r has no prototype, not using it." >&4 ;;
11596 *) drand48_r_proto=0
11600 : see if prototype for drand48 is available
11602 set d_drand48proto drand48 $i_stdlib stdlib.h $i_unistd unistd.h
11605 : see if dup2 exists
11609 : see if eaccess exists
11610 set eaccess d_eaccess
11613 : see if endgrent exists
11614 set endgrent d_endgrent
11617 : see if this is an grp system
11623 xxx=`./findhdr grp.h`
11624 $cppstdin $cppflags $cppminus < $xxx >$$.h
11626 if $contains 'gr_passwd' $$.h >/dev/null 2>&1; then
11638 set d_grpasswd; eval $setvar
11642 : see if endgrent_r exists
11643 set endgrent_r d_endgrent_r
11645 case "$d_endgrent_r" in
11647 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
11648 case "$d_endgrent_r_proto:$usethreads" in
11649 ":define") d_endgrent_r_proto=define
11650 set d_endgrent_r_proto endgrent_r $hdrs
11654 case "$d_endgrent_r_proto" in
11656 case "$endgrent_r_proto" in
11657 ''|0) try='int endgrent_r(FILE**);'
11658 ./protochk "extern $try" $hdrs && endgrent_r_proto=I_H ;;
11660 case "$endgrent_r_proto" in
11661 ''|0) try='void endgrent_r(FILE**);'
11662 ./protochk "extern $try" $hdrs && endgrent_r_proto=V_H ;;
11664 case "$endgrent_r_proto" in
11665 ''|0) d_endgrent_r=undef
11667 echo "Disabling endgrent_r, cannot determine prototype." >&4 ;;
11668 * ) case "$endgrent_r_proto" in
11669 REENTRANT_PROTO*) ;;
11670 *) endgrent_r_proto="REENTRANT_PROTO_$endgrent_r_proto" ;;
11672 echo "Prototype: $try" ;;
11675 *) case "$usethreads" in
11676 define) echo "endgrent_r has no prototype, not using it." >&4 ;;
11683 *) endgrent_r_proto=0
11687 : see if endhostent exists
11688 set endhostent d_endhent
11691 : see if this is a netdb.h system
11692 set netdb.h i_netdb
11695 : see if endhostent_r exists
11696 set endhostent_r d_endhostent_r
11698 case "$d_endhostent_r" in
11700 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
11701 case "$d_endhostent_r_proto:$usethreads" in
11702 ":define") d_endhostent_r_proto=define
11703 set d_endhostent_r_proto endhostent_r $hdrs
11707 case "$d_endhostent_r_proto" in
11709 case "$endhostent_r_proto" in
11710 ''|0) try='int endhostent_r(struct hostent_data*);'
11711 ./protochk "extern $try" $hdrs && endhostent_r_proto=I_D ;;
11713 case "$endhostent_r_proto" in
11714 ''|0) try='void endhostent_r(struct hostent_data*);'
11715 ./protochk "extern $try" $hdrs && endhostent_r_proto=V_D ;;
11717 case "$endhostent_r_proto" in
11718 ''|0) d_endhostent_r=undef
11719 endhostent_r_proto=0
11720 echo "Disabling endhostent_r, cannot determine prototype." >&4 ;;
11721 * ) case "$endhostent_r_proto" in
11722 REENTRANT_PROTO*) ;;
11723 *) endhostent_r_proto="REENTRANT_PROTO_$endhostent_r_proto" ;;
11725 echo "Prototype: $try" ;;
11728 *) case "$usethreads" in
11729 define) echo "endhostent_r has no prototype, not using it." >&4 ;;
11731 d_endhostent_r=undef
11732 endhostent_r_proto=0
11736 *) endhostent_r_proto=0
11740 : see if endnetent exists
11741 set endnetent d_endnent
11744 : see if endnetent_r exists
11745 set endnetent_r d_endnetent_r
11747 case "$d_endnetent_r" in
11749 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
11750 case "$d_endnetent_r_proto:$usethreads" in
11751 ":define") d_endnetent_r_proto=define
11752 set d_endnetent_r_proto endnetent_r $hdrs
11756 case "$d_endnetent_r_proto" in
11758 case "$endnetent_r_proto" in
11759 ''|0) try='int endnetent_r(struct netent_data*);'
11760 ./protochk "extern $try" $hdrs && endnetent_r_proto=I_D ;;
11762 case "$endnetent_r_proto" in
11763 ''|0) try='void endnetent_r(struct netent_data*);'
11764 ./protochk "extern $try" $hdrs && endnetent_r_proto=V_D ;;
11766 case "$endnetent_r_proto" in
11767 ''|0) d_endnetent_r=undef
11768 endnetent_r_proto=0
11769 echo "Disabling endnetent_r, cannot determine prototype." >&4 ;;
11770 * ) case "$endnetent_r_proto" in
11771 REENTRANT_PROTO*) ;;
11772 *) endnetent_r_proto="REENTRANT_PROTO_$endnetent_r_proto" ;;
11774 echo "Prototype: $try" ;;
11777 *) case "$usethreads" in
11778 define) echo "endnetent_r has no prototype, not using it." >&4 ;;
11780 d_endnetent_r=undef
11781 endnetent_r_proto=0
11785 *) endnetent_r_proto=0
11789 : see if endprotoent exists
11790 set endprotoent d_endpent
11793 : see if endprotoent_r exists
11794 set endprotoent_r d_endprotoent_r
11796 case "$d_endprotoent_r" in
11798 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
11799 case "$d_endprotoent_r_proto:$usethreads" in
11800 ":define") d_endprotoent_r_proto=define
11801 set d_endprotoent_r_proto endprotoent_r $hdrs
11805 case "$d_endprotoent_r_proto" in
11807 case "$endprotoent_r_proto" in
11808 ''|0) try='int endprotoent_r(struct protoent_data*);'
11809 ./protochk "extern $try" $hdrs && endprotoent_r_proto=I_D ;;
11811 case "$endprotoent_r_proto" in
11812 ''|0) try='void endprotoent_r(struct protoent_data*);'
11813 ./protochk "extern $try" $hdrs && endprotoent_r_proto=V_D ;;
11815 case "$endprotoent_r_proto" in
11816 ''|0) d_endprotoent_r=undef
11817 endprotoent_r_proto=0
11818 echo "Disabling endprotoent_r, cannot determine prototype." >&4 ;;
11819 * ) case "$endprotoent_r_proto" in
11820 REENTRANT_PROTO*) ;;
11821 *) endprotoent_r_proto="REENTRANT_PROTO_$endprotoent_r_proto" ;;
11823 echo "Prototype: $try" ;;
11826 *) case "$usethreads" in
11827 define) echo "endprotoent_r has no prototype, not using it." >&4 ;;
11829 d_endprotoent_r=undef
11830 endprotoent_r_proto=0
11834 *) endprotoent_r_proto=0
11838 : see if endpwent exists
11839 set endpwent d_endpwent
11842 : see if this is a pwd.h system
11848 xxx=`./findhdr pwd.h`
11849 $cppstdin $cppflags $cppminus < $xxx >$$.h
11851 if $contains 'pw_quota' $$.h >/dev/null 2>&1; then
11859 if $contains 'pw_age' $$.h >/dev/null 2>&1; then
11867 if $contains 'pw_change' $$.h >/dev/null 2>&1; then
11875 if $contains 'pw_class' $$.h >/dev/null 2>&1; then
11883 if $contains 'pw_expire' $$.h >/dev/null 2>&1; then
11891 if $contains 'pw_comment' $$.h >/dev/null 2>&1; then
11899 if $contains 'pw_gecos' $$.h >/dev/null 2>&1; then
11907 if $contains 'pw_passwd' $$.h >/dev/null 2>&1; then
11919 set d_pwquota; eval $setvar
11920 set d_pwage; eval $setvar
11921 set d_pwchange; eval $setvar
11922 set d_pwclass; eval $setvar
11923 set d_pwexpire; eval $setvar
11924 set d_pwcomment; eval $setvar
11925 set d_pwgecos; eval $setvar
11926 set d_pwpasswd; eval $setvar
11930 : see if endpwent_r exists
11931 set endpwent_r d_endpwent_r
11933 case "$d_endpwent_r" in
11935 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
11936 case "$d_endpwent_r_proto:$usethreads" in
11937 ":define") d_endpwent_r_proto=define
11938 set d_endpwent_r_proto endpwent_r $hdrs
11942 case "$d_endpwent_r_proto" in
11944 case "$endpwent_r_proto" in
11945 ''|0) try='int endpwent_r(FILE**);'
11946 ./protochk "extern $try" $hdrs && endpwent_r_proto=I_H ;;
11948 case "$endpwent_r_proto" in
11949 ''|0) try='void endpwent_r(FILE**);'
11950 ./protochk "extern $try" $hdrs && endpwent_r_proto=V_H ;;
11952 case "$endpwent_r_proto" in
11953 ''|0) d_endpwent_r=undef
11955 echo "Disabling endpwent_r, cannot determine prototype." >&4 ;;
11956 * ) case "$endpwent_r_proto" in
11957 REENTRANT_PROTO*) ;;
11958 *) endpwent_r_proto="REENTRANT_PROTO_$endpwent_r_proto" ;;
11960 echo "Prototype: $try" ;;
11963 *) case "$usethreads" in
11964 define) echo "endpwent_r has no prototype, not using it." >&4 ;;
11971 *) endpwent_r_proto=0
11975 : see if endservent exists
11976 set endservent d_endsent
11979 : see if endservent_r exists
11980 set endservent_r d_endservent_r
11982 case "$d_endservent_r" in
11984 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
11985 case "$d_endservent_r_proto:$usethreads" in
11986 ":define") d_endservent_r_proto=define
11987 set d_endservent_r_proto endservent_r $hdrs
11991 case "$d_endservent_r_proto" in
11993 case "$endservent_r_proto" in
11994 ''|0) try='int endservent_r(struct servent_data*);'
11995 ./protochk "extern $try" $hdrs && endservent_r_proto=I_D ;;
11997 case "$endservent_r_proto" in
11998 ''|0) try='void endservent_r(struct servent_data*);'
11999 ./protochk "extern $try" $hdrs && endservent_r_proto=V_D ;;
12001 case "$endservent_r_proto" in
12002 ''|0) d_endservent_r=undef
12003 endservent_r_proto=0
12004 echo "Disabling endservent_r, cannot determine prototype." >&4 ;;
12005 * ) case "$endservent_r_proto" in
12006 REENTRANT_PROTO*) ;;
12007 *) endservent_r_proto="REENTRANT_PROTO_$endservent_r_proto" ;;
12009 echo "Prototype: $try" ;;
12012 *) case "$usethreads" in
12013 define) echo "endservent_r has no prototype, not using it." >&4 ;;
12015 d_endservent_r=undef
12016 endservent_r_proto=0
12020 *) endservent_r_proto=0
12024 : Locate the flags for 'open()'
12027 #include <sys/types.h>
12032 #include <sys/file.h>
12034 #$i_stdlib I_STDLIB
12036 #include <stdlib.h>
12047 : check sys/file.h first to get FREAD on Sun
12048 if $test `./findhdr sys/file.h` && \
12049 set try -DI_SYS_FILE && eval $compile; then
12051 echo "<sys/file.h> defines the O_* constants..." >&4
12052 if $run ./try; then
12053 echo "and you have the 3 argument form of open()." >&4
12056 echo "but not the 3 argument form of open(). Oh, well." >&4
12059 elif $test `./findhdr fcntl.h` && \
12060 set try -DI_FCNTL && eval $compile; then
12062 echo "<fcntl.h> defines the O_* constants..." >&4
12063 if $run ./try; then
12064 echo "and you have the 3 argument form of open()." >&4
12067 echo "but not the 3 argument form of open(). Oh, well." >&4
12072 echo "I can't find the O_* constant definitions! You got problems." >&4
12078 : see which of string.h or strings.h is needed
12080 strings=`./findhdr string.h`
12081 if $test "$strings" && $test -r "$strings"; then
12082 echo "Using <string.h> instead of <strings.h>." >&4
12086 strings=`./findhdr strings.h`
12087 if $test "$strings" && $test -r "$strings"; then
12088 echo "Using <strings.h> instead of <string.h>." >&4
12090 echo "No string header found -- You'll surely have problems." >&4
12095 case "$i_string" in
12096 "$undef") strings=`./findhdr strings.h`;;
12097 *) strings=`./findhdr string.h`;;
12100 : see if this is a sys/file.h system
12105 : do we need to include sys/file.h ?
12109 if $h_sysfile; then
12111 echo "We'll be including <sys/file.h>." >&4
12114 echo "We won't be including <sys/file.h>." >&4
12124 : see if fcntl.h is there
12129 : see if we can include fcntl.h
12135 echo "We'll be including <fcntl.h>." >&4
12138 if $h_sysfile; then
12139 echo "We don't need to include <fcntl.h> if we include <sys/file.h>." >&4
12141 echo "We won't be including <fcntl.h>." >&4
12153 : check for non-blocking I/O stuff
12154 case "$h_sysfile" in
12155 true) echo "#include <sys/file.h>" > head.c;;
12158 true) echo "#include <fcntl.h>" > head.c;;
12159 *) echo "#include <sys/fcntl.h>" > head.c;;
12164 echo "Figuring out the flag used by open() for non-blocking I/O..." >&4
12165 case "$o_nonblock" in
12167 $cat head.c > try.c
12168 $cat >>try.c <<EOCP
12170 #$i_stdlib I_STDLIB
12172 #include <stdlib.h>
12180 printf("O_NONBLOCK\n");
12184 printf("O_NDELAY\n");
12188 printf("FNDELAY\n");
12195 if eval $compile_ok; then
12196 o_nonblock=`$run ./try`
12197 case "$o_nonblock" in
12198 '') echo "I can't figure it out, assuming O_NONBLOCK will do.";;
12199 *) echo "Seems like we can use $o_nonblock.";;
12202 echo "(I can't compile the test program; pray O_NONBLOCK is right!)"
12205 *) echo "Using $hint value $o_nonblock.";;
12207 $rm -f try try.* .out core
12210 echo "Let's see what value errno gets from read() on a $o_nonblock file..." >&4
12213 $cat head.c > try.c
12214 $cat >>try.c <<EOCP
12216 #include <sys/types.h>
12217 #include <signal.h>
12219 #$i_stdlib I_STDLIB
12221 #include <stdlib.h>
12227 #define MY_O_NONBLOCK $o_nonblock
12228 #ifndef errno /* XXX need better Configure test */
12231 #$i_unistd I_UNISTD
12233 #include <unistd.h>
12235 #$i_string I_STRING
12237 #include <string.h>
12239 #include <strings.h>
12241 $signal_t blech(int x) { exit(3); }
12243 $cat >> try.c <<'EOCP'
12251 pipe(pd); /* Down: child -> parent */
12252 pipe(pu); /* Up: parent -> child */
12255 close(pd[1]); /* Parent reads from pd[0] */
12256 close(pu[0]); /* Parent writes (blocking) to pu[1] */
12258 if (-1 == fcntl(pd[0], F_SETFL, MY_O_NONBLOCK))
12263 signal(SIGALRM, blech);
12265 if ((ret = read(pd[0], buf, 1)) > 0) /* Nothing to read! */
12267 sprintf(string, "%d\n", ret);
12268 write(2, string, strlen(string));
12271 if (errno == EAGAIN) {
12272 printf("EAGAIN\n");
12277 if (errno == EWOULDBLOCK)
12278 printf("EWOULDBLOCK\n");
12281 write(pu[1], buf, 1); /* Unblocks child, tell it to close our pipe */
12282 sleep(2); /* Give it time to close our pipe */
12284 ret = read(pd[0], buf, 1); /* Should read EOF */
12286 sprintf(string, "%d\n", ret);
12287 write(4, string, strlen(string));
12291 close(pd[0]); /* We write to pd[1] */
12292 close(pu[1]); /* We read from pu[0] */
12293 read(pu[0], buf, 1); /* Wait for parent to signal us we may continue */
12294 close(pd[1]); /* Pipe pd is now fully closed! */
12295 exit(0); /* Bye bye, thank you for playing! */
12299 if eval $compile_ok; then
12300 echo "$startsh" >mtry
12301 echo "$run ./try >try.out 2>try.ret 4>try.err || exit 4" >>mtry
12303 ./mtry >/dev/null 2>&1
12305 0) eagain=`$cat try.out`;;
12306 1) echo "Could not perform non-blocking setting!";;
12307 2) echo "I did a successful read() for something that was not there!";;
12308 3) echo "Hmm... non-blocking I/O does not seem to be working!";;
12309 4) echo "Could not find F_SETFL!";;
12310 *) echo "Something terribly wrong happened during testing.";;
12312 rd_nodata=`$cat try.ret`
12313 echo "A read() system call with no data present returns $rd_nodata."
12314 case "$rd_nodata" in
12317 echo "(That's peculiar, fixing that to be -1.)"
12323 echo "Forcing errno EAGAIN on read() with no data available."
12327 echo "Your read() sets errno to $eagain when no data is available."
12330 status=`$cat try.err`
12332 0) echo "And it correctly returns 0 to signal EOF.";;
12333 -1) echo "But it also returns -1 to signal EOF, so be careful!";;
12334 *) echo "However, your read() returns '$status' on EOF??";;
12337 if test "$status" = "$rd_nodata"; then
12338 echo "WARNING: you can't distinguish between EOF and no data!"
12342 echo "I can't compile the test program--assuming errno EAGAIN will do."
12349 echo "Using $hint value $eagain."
12350 echo "Your read() returns $rd_nodata when no data is present."
12351 case "$d_eofnblk" in
12352 "$define") echo "And you can see EOF because read() returns 0.";;
12353 "$undef") echo "But you can't see EOF status from read() returned value.";;
12355 echo "(Assuming you can't see EOF status from read anyway.)"
12361 $rm -f try try.* .out core head.c mtry
12363 : see if _ptr and _cnt from stdio act std
12366 if $contains '_lbfsize' `./findhdr stdio.h` >/dev/null 2>&1 ; then
12367 echo "(Looks like you have stdio.h from BSD.)"
12368 case "$stdio_ptr" in
12369 '') stdio_ptr='((fp)->_p)'
12372 *) ptr_lval=$d_stdio_ptr_lval;;
12374 case "$stdio_cnt" in
12375 '') stdio_cnt='((fp)->_r)'
12378 *) cnt_lval=$d_stdio_cnt_lval;;
12380 case "$stdio_base" in
12381 '') stdio_base='((fp)->_ub._base ? (fp)->_ub._base : (fp)->_bf._base)';;
12383 case "$stdio_bufsiz" in
12384 '') stdio_bufsiz='((fp)->_ub._base ? (fp)->_ub._size : (fp)->_bf._size)';;
12386 elif $contains '_IO_fpos_t' `./findhdr stdio.h` `./findhdr libio.h` >/dev/null 2>&1 ; then
12387 echo "(Looks like you have stdio.h from Linux.)"
12388 case "$stdio_ptr" in
12389 '') stdio_ptr='((fp)->_IO_read_ptr)'
12392 *) ptr_lval=$d_stdio_ptr_lval;;
12394 case "$stdio_cnt" in
12395 '') stdio_cnt='((fp)->_IO_read_end - (fp)->_IO_read_ptr)'
12398 *) cnt_lval=$d_stdio_cnt_lval;;
12400 case "$stdio_base" in
12401 '') stdio_base='((fp)->_IO_read_base)';;
12403 case "$stdio_bufsiz" in
12404 '') stdio_bufsiz='((fp)->_IO_read_end - (fp)->_IO_read_base)';;
12407 case "$stdio_ptr" in
12408 '') stdio_ptr='((fp)->_ptr)'
12411 *) ptr_lval=$d_stdio_ptr_lval;;
12413 case "$stdio_cnt" in
12414 '') stdio_cnt='((fp)->_cnt)'
12417 *) cnt_lval=$d_stdio_cnt_lval;;
12419 case "$stdio_base" in
12420 '') stdio_base='((fp)->_base)';;
12422 case "$stdio_bufsiz" in
12423 '') stdio_bufsiz='((fp)->_cnt + (fp)->_ptr - (fp)->_base)';;
12427 : test whether _ptr and _cnt really work
12428 echo "Checking how std your stdio is..." >&4
12431 #$i_stdlib I_STDLIB
12433 #include <stdlib.h>
12435 #define FILE_ptr(fp) $stdio_ptr
12436 #define FILE_cnt(fp) $stdio_cnt
12438 FILE *fp = fopen("try.c", "r");
12441 18 <= FILE_cnt(fp) &&
12442 strncmp(FILE_ptr(fp), "include <stdio.h>\n", 18) == 0
12450 if eval $compile && $to try.c; then
12451 if $run ./try; then
12452 echo "Your stdio acts pretty std."
12455 echo "Your stdio isn't very std."
12458 echo "Your stdio doesn't appear very std."
12462 # glibc 2.2.90 and above apparently change stdio streams so Perl's
12463 # direct buffer manipulation no longer works. The Configure tests
12464 # should be changed to correctly detect this, but until then,
12465 # the following check should at least let perl compile and run.
12466 # (This quick fix should be updated before 5.8.1.)
12467 # To be defensive, reject all unknown versions, and all versions > 2.2.9.
12468 # A. Dougherty, June 3, 2002.
12469 case "$d_gnulibc" in
12471 case "$gnulibc_version" in
12475 *) echo "But I will not snoop inside glibc $gnulibc_version stdio buffers."
12484 : Can _ptr be used as an lvalue?
12485 case "$d_stdstdio$ptr_lval" in
12486 $define$define) val=$define ;;
12489 set d_stdio_ptr_lval
12492 : Can _cnt be used as an lvalue?
12493 case "$d_stdstdio$cnt_lval" in
12494 $define$define) val=$define ;;
12497 set d_stdio_cnt_lval
12501 : test whether setting _ptr sets _cnt as a side effect
12502 d_stdio_ptr_lval_sets_cnt="$undef"
12503 d_stdio_ptr_lval_nochange_cnt="$undef"
12504 case "$d_stdio_ptr_lval$d_stdstdio" in
12506 echo "Checking to see what happens if we set the stdio ptr..." >&4
12509 /* Can we scream? */
12510 /* Eat dust sed :-) */
12511 /* In the buffer space, no one can hear you scream. */
12512 #$i_stdlib I_STDLIB
12514 #include <stdlib.h>
12516 #define FILE_ptr(fp) $stdio_ptr
12517 #define FILE_cnt(fp) $stdio_cnt
12518 #include <sys/types.h>
12520 FILE *fp = fopen("try.c", "r");
12525 puts("Fail even to read");
12528 c = getc(fp); /* Read away the first # */
12530 puts("Fail even to read");
12534 18 <= FILE_cnt(fp) &&
12535 strncmp(FILE_ptr(fp), "include <stdio.h>\n", 18) == 0
12537 puts("Fail even to read");
12540 ptr = (char*) FILE_ptr(fp);
12541 cnt = (size_t)FILE_cnt(fp);
12543 FILE_ptr(fp) += 42;
12545 if ((char*)FILE_ptr(fp) != (ptr + 42)) {
12546 printf("Fail ptr check %p != %p", FILE_ptr(fp), (ptr + 42));
12549 if (FILE_cnt(fp) <= 20) {
12550 printf ("Fail (<20 chars to test)");
12553 if (strncmp(FILE_ptr(fp), "Eat dust sed :-) */\n", 20) != 0) {
12554 puts("Fail compare");
12557 if (cnt == FILE_cnt(fp)) {
12558 puts("Pass_unchanged");
12561 if (FILE_cnt(fp) == (cnt - 42)) {
12562 puts("Pass_changed");
12565 printf("Fail count was %d now %d\n", cnt, FILE_cnt(fp));
12571 if eval $compile && $to try.c; then
12572 case `$run ./try` in
12574 echo "Increasing ptr in your stdio decreases cnt by the same amount. Good." >&4
12575 d_stdio_ptr_lval_sets_cnt="$define" ;;
12577 echo "Increasing ptr in your stdio leaves cnt unchanged. Good." >&4
12578 d_stdio_ptr_lval_nochange_cnt="$define" ;;
12580 echo "Increasing ptr in your stdio didn't do exactly what I expected. We'll not be doing that then." >&4 ;;
12582 echo "It appears attempting to set ptr in your stdio is a bad plan." >&4 ;;
12585 echo "It seems we can't set ptr in your stdio. Nevermind." >&4
12591 : see if _base is also standard
12593 case "$d_stdstdio" in
12597 #$i_stdlib I_STDLIB
12599 #include <stdlib.h>
12601 #define FILE_base(fp) $stdio_base
12602 #define FILE_bufsiz(fp) $stdio_bufsiz
12604 FILE *fp = fopen("try.c", "r");
12607 19 <= FILE_bufsiz(fp) &&
12608 strncmp(FILE_base(fp), "#include <stdio.h>\n", 19) == 0
12615 if eval $compile && $to try.c; then
12616 if $run ./try; then
12617 echo "And its _base field acts std."
12620 echo "But its _base field isn't std."
12623 echo "However, it seems to be lacking the _base field."
12631 : see if fast_stdio exists
12633 case "$d_stdstdio:$d_stdio_ptr_lval" in
12635 case "$d_stdio_cnt_lval$d_stdio_ptr_lval_sets_cnt" in
12637 echo "You seem to have 'fast stdio' to directly manipulate the stdio buffers." >& 4
12648 : see if fchdir exists
12649 set fchdir d_fchdir
12652 : see if fchmod exists
12653 set fchmod d_fchmod
12656 : see if fchown exists
12657 set fchown d_fchown
12660 : see if this is an fcntl system
12665 : See if fcntl-based locking works.
12667 #$i_stdlib I_STDLIB
12669 #include <stdlib.h>
12671 #include <unistd.h>
12673 #include <signal.h>
12674 $signal_t blech(int x) { exit(3); }
12676 #if defined(F_SETLK) && defined(F_SETLKW)
12677 struct flock flock;
12679 fd = open("try.c", O_RDONLY);
12680 flock.l_type = F_RDLCK;
12681 flock.l_whence = SEEK_SET;
12682 flock.l_start = flock.l_len = 0;
12683 signal(SIGALRM, blech);
12685 retval = fcntl(fd, F_SETLK, &flock);
12687 (retval < 0 ? exit(2) : exit(0));
12693 echo "Checking if fcntl-based file locking works... "
12697 if eval $compile_ok; then
12698 if $run ./try; then
12699 echo "Yes, it seems to work."
12702 echo "Nope, it didn't work."
12707 *** I had to forcibly timeout from fcntl(..., F_SETLK, ...).
12708 *** This is (almost) impossible.
12709 *** If your NFS lock daemons are not feeling well, something like
12710 *** this may happen, please investigate. Cannot continue, aborting.
12718 echo "I'm unable to compile the test program, so I'll assume not."
12723 echo "Nope, since you don't even have fcntl()."
12726 set d_fcntl_can_lock
12731 : check for fd_set items
12734 Checking to see how well your C compiler handles fd_set and friends ...
12737 #$i_stdlib I_STDLIB
12739 #include <stdlib.h>
12741 #$i_systime I_SYS_TIME
12742 #$i_sysselct I_SYS_SELECT
12743 #$d_socket HAS_SOCKET
12744 #include <sys/types.h>
12746 #include <sys/socket.h> /* Might include <sys/bsdtypes.h> */
12749 #include <sys/time.h>
12751 #ifdef I_SYS_SELECT
12752 #include <sys/select.h>
12761 #if defined(FD_SET) && defined(FD_CLR) && defined(FD_ISSET) && defined(FD_ZERO)
12769 if eval $compile; then
12770 d_fds_bits="$define"
12772 echo "Well, your system knows about the normal fd_set typedef..." >&4
12773 if $run ./try; then
12774 echo "and you have the normal fd_set macros (just as I'd expect)." >&4
12775 d_fd_macros="$define"
12778 but not the normal fd_set macros! Gaaack! I'll have to cover for you.
12780 d_fd_macros="$undef"
12784 Hmm, your compiler has some difficulty with fd_set. Checking further...
12787 if eval $compile; then
12788 d_fds_bits="$undef"
12790 echo "Well, your system has some sort of fd_set available..." >&4
12791 if $run ./try; then
12792 echo "and you have the normal fd_set macros." >&4
12793 d_fd_macros="$define"
12796 but not the normal fd_set macros! Gross! More work for me...
12798 d_fd_macros="$undef"
12801 echo "Well, you got zip. That's OK, I can roll my own fd_set stuff." >&4
12803 d_fds_bits="$undef"
12804 d_fd_macros="$undef"
12809 : see if fgetpos exists
12810 set fgetpos d_fgetpos
12813 : see if finite exists
12814 set finite d_finite
12817 : see if finitel exists
12818 set finitel d_finitel
12821 : see if flock exists
12825 : see if prototype for flock is available
12827 set d_flockproto flock $i_sysfile sys/file.h
12830 : see if fork exists
12834 : see if fp_class exists
12835 set fp_class d_fp_class
12838 : see if pathconf exists
12839 set pathconf d_pathconf
12842 : see if fpathconf exists
12843 set fpathconf d_fpathconf
12846 : see if fpclass exists
12847 set fpclass d_fpclass
12850 : see if fpclassify exists
12851 set fpclassify d_fpclassify
12854 : see if fpclassl exists
12855 set fpclassl d_fpclassl
12859 : check for fpos64_t
12861 echo "Checking to see if you have fpos64_t..." >&4
12864 int main() { fpos64_t x = 7; }
12867 if eval $compile; then
12869 echo "You have fpos64_t."
12872 echo "You do not have fpos64_t."
12873 case "$fpossize" in
12874 8) echo "(Your fpos_t is 64 bits, so you could use that.)" ;;
12881 : see if frexpl exists
12882 set frexpl d_frexpl
12885 : see if this is a sys/param system
12886 set sys/param.h i_sysparam
12889 : see if this is a sys/mount.h system
12890 set sys/mount.h i_sysmount
12895 echo "Checking to see if your system supports struct fs_data..." >&4
12896 set d_fs_data_s fs_data $i_systypes sys/types.h $i_sysparam sys/param.h $i_sysmount sys/mount.h
12898 case "$d_fs_data_s" in
12899 "$define") echo "Yes, it does." ;;
12900 *) echo "No, it doesn't." ;;
12903 : see if fseeko exists
12904 set fseeko d_fseeko
12906 case "$longsize" in
12907 8) echo "(Your long is 64 bits, so you could use fseek.)" ;;
12910 : see if fsetpos exists
12911 set fsetpos d_fsetpos
12915 : see if fstatfs exists
12916 set fstatfs d_fstatfs
12920 : see if statvfs exists
12921 set statvfs d_statvfs
12924 : see if fstatvfs exists
12925 set fstatvfs d_fstatvfs
12929 : see if fsync exists
12933 : see if ftello exists
12934 set ftello d_ftello
12936 case "$longsize" in
12937 8) echo "(Your long is 64 bits, so you could use ftell.)" ;;
12941 : check for a working futimes
12943 echo "Checking for a working futimes()" >&4
12946 #include <sys/time.h>
12953 fd = open ("try.c", O_RDWR);
12954 if (-1 == fd) exit (1);
12955 rv = futimes (fd, NULL);
12956 exit (rv == -1 ? errno : 0);
12960 if eval $compile; then
12964 0) echo "Yes, it does" >&4
12965 d_futimes="$define"
12967 *) echo "No, it has futimes, but it isn't working ($rc) (probably harmless)\n" >&4
12971 echo "No, it does not (probably harmless)\n" >&4
12973 $rm -f try.* try core core.try.*
12975 : see if getcwd exists
12976 set getcwd d_getcwd
12979 : see if getespwnam exists
12980 set getespwnam d_getespwnam
12984 : see if getfsstat exists
12985 set getfsstat d_getfsstat
12988 : see if getgrent exists
12989 set getgrent d_getgrent
12992 : see if getgrent_r exists
12993 set getgrent_r d_getgrent_r
12995 case "$d_getgrent_r" in
12997 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
12998 case "$d_getgrent_r_proto:$usethreads" in
12999 ":define") d_getgrent_r_proto=define
13000 set d_getgrent_r_proto getgrent_r $hdrs
13004 case "$d_getgrent_r_proto" in
13006 case "$getgrent_r_proto" in
13007 ''|0) try='int getgrent_r(struct group*, char*, size_t, struct group**);'
13008 ./protochk "extern $try" $hdrs && getgrent_r_proto=I_SBWR ;;
13010 case "$getgrent_r_proto" in
13011 ''|0) try='int getgrent_r(struct group*, char*, int, struct group**);'
13012 ./protochk "extern $try" $hdrs && getgrent_r_proto=I_SBIR ;;
13014 case "$getgrent_r_proto" in
13015 ''|0) try='struct group* getgrent_r(struct group*, char*, size_t);'
13016 ./protochk "extern $try" $hdrs && getgrent_r_proto=S_SBW ;;
13018 case "$getgrent_r_proto" in
13019 ''|0) try='struct group* getgrent_r(struct group*, char*, int);'
13020 ./protochk "extern $try" $hdrs && getgrent_r_proto=S_SBI ;;
13022 case "$getgrent_r_proto" in
13023 ''|0) try='int getgrent_r(struct group*, char*, int);'
13024 ./protochk "extern $try" $hdrs && getgrent_r_proto=I_SBI ;;
13026 case "$getgrent_r_proto" in
13027 ''|0) try='int getgrent_r(struct group*, char*, int, FILE**);'
13028 ./protochk "extern $try" $hdrs && getgrent_r_proto=I_SBIH ;;
13030 case "$getgrent_r_proto" in
13031 ''|0) d_getgrent_r=undef
13033 echo "Disabling getgrent_r, cannot determine prototype." >&4 ;;
13034 * ) case "$getgrent_r_proto" in
13035 REENTRANT_PROTO*) ;;
13036 *) getgrent_r_proto="REENTRANT_PROTO_$getgrent_r_proto" ;;
13038 echo "Prototype: $try" ;;
13041 *) case "$usethreads" in
13042 define) echo "getgrent_r has no prototype, not using it." >&4 ;;
13049 *) getgrent_r_proto=0
13053 : see if getgrgid_r exists
13054 set getgrgid_r d_getgrgid_r
13056 case "$d_getgrgid_r" in
13058 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
13059 case "$d_getgrgid_r_proto:$usethreads" in
13060 ":define") d_getgrgid_r_proto=define
13061 set d_getgrgid_r_proto getgrgid_r $hdrs
13065 case "$d_getgrgid_r_proto" in
13067 case "$getgrgid_r_proto" in
13068 ''|0) try='int getgrgid_r(gid_t, struct group*, char*, size_t, struct group**);'
13069 ./protochk "extern $try" $hdrs && getgrgid_r_proto=I_TSBWR ;;
13071 case "$getgrgid_r_proto" in
13072 ''|0) try='int getgrgid_r(gid_t, struct group*, char*, int, struct group**);'
13073 ./protochk "extern $try" $hdrs && getgrgid_r_proto=I_TSBIR ;;
13075 case "$getgrgid_r_proto" in
13076 ''|0) try='int getgrgid_r(gid_t, struct group*, char*, int);'
13077 ./protochk "extern $try" $hdrs && getgrgid_r_proto=I_TSBI ;;
13079 case "$getgrgid_r_proto" in
13080 ''|0) try='struct group* getgrgid_r(gid_t, struct group*, char*, int);'
13081 ./protochk "extern $try" $hdrs && getgrgid_r_proto=S_TSBI ;;
13083 case "$getgrgid_r_proto" in
13084 ''|0) d_getgrgid_r=undef
13086 echo "Disabling getgrgid_r, cannot determine prototype." >&4 ;;
13087 * ) case "$getgrgid_r_proto" in
13088 REENTRANT_PROTO*) ;;
13089 *) getgrgid_r_proto="REENTRANT_PROTO_$getgrgid_r_proto" ;;
13091 echo "Prototype: $try" ;;
13094 *) case "$usethreads" in
13095 define) echo "getgrgid_r has no prototype, not using it." >&4 ;;
13102 *) getgrgid_r_proto=0
13106 : see if getgrnam_r exists
13107 set getgrnam_r d_getgrnam_r
13109 case "$d_getgrnam_r" in
13111 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
13112 case "$d_getgrnam_r_proto:$usethreads" in
13113 ":define") d_getgrnam_r_proto=define
13114 set d_getgrnam_r_proto getgrnam_r $hdrs
13118 case "$d_getgrnam_r_proto" in
13120 case "$getgrnam_r_proto" in
13121 ''|0) try='int getgrnam_r(const char*, struct group*, char*, size_t, struct group**);'
13122 ./protochk "extern $try" $hdrs && getgrnam_r_proto=I_CSBWR ;;
13124 case "$getgrnam_r_proto" in
13125 ''|0) try='int getgrnam_r(const char*, struct group*, char*, int, struct group**);'
13126 ./protochk "extern $try" $hdrs && getgrnam_r_proto=I_CSBIR ;;
13128 case "$getgrnam_r_proto" in
13129 ''|0) try='struct group* getgrnam_r(const char*, char*, int);'
13130 ./protochk "extern $try" $hdrs && getgrnam_r_proto=S_CBI ;;
13132 case "$getgrnam_r_proto" in
13133 ''|0) try='int getgrnam_r(const char*, struct group*, char*, int);'
13134 ./protochk "extern $try" $hdrs && getgrnam_r_proto=I_CSBI ;;
13136 case "$getgrnam_r_proto" in
13137 ''|0) try='struct group* getgrnam_r(const char*, struct group*, char*, int);'
13138 ./protochk "extern $try" $hdrs && getgrnam_r_proto=S_CSBI ;;
13140 case "$getgrnam_r_proto" in
13141 ''|0) d_getgrnam_r=undef
13143 echo "Disabling getgrnam_r, cannot determine prototype." >&4 ;;
13144 * ) case "$getgrnam_r_proto" in
13145 REENTRANT_PROTO*) ;;
13146 *) getgrnam_r_proto="REENTRANT_PROTO_$getgrnam_r_proto" ;;
13148 echo "Prototype: $try" ;;
13151 *) case "$usethreads" in
13152 define) echo "getgrnam_r has no prototype, not using it." >&4 ;;
13159 *) getgrnam_r_proto=0
13163 : see if gethostbyaddr exists
13164 set gethostbyaddr d_gethbyaddr
13167 : see if gethostbyname exists
13168 set gethostbyname d_gethbyname
13171 : see if gethostent exists
13172 set gethostent d_gethent
13175 : see how we will look up host name
13178 if set gethostname val -f d_gethname; eval $csym; $val; then
13179 echo 'gethostname() found.' >&4
13180 d_gethname="$define"
13183 if set uname val -f d_uname; eval $csym; $val; then
13186 uname() was found, but you're running xenix, and older versions of xenix
13187 have a broken uname(). If you don't really know whether your xenix is old
13188 enough to have a broken system call, use the default answer.
13193 "$define") dflt=n;;
13195 rp='Is your uname() broken?'
13198 n*) d_uname="$define"; call=uname;;
13201 echo 'uname() found.' >&4
13208 case "$d_gethname" in
13209 '') d_gethname="$undef";;
13212 '') d_uname="$undef";;
13214 case "$d_uname$d_gethname" in
13219 Every now and then someone has a $call() that lies about the hostname
13220 but can't be fixed for political or economic reasons. If you wish, I can
13221 pretend $call() isn't there and maybe compute hostname at run-time
13222 thanks to the '$phostname' command.
13225 rp="Shall I ignore $call() from now on?"
13228 y*) d_uname="$undef" d_gethname="$undef"; $echo $n "Okay...$c";;
13231 case "$phostname" in
13232 '') aphostname='';;
13233 *) case "$aphostname" in
13235 *) set X $phostname
13239 file=`./loc $file $file $pth`
13240 aphostname=`echo $file $*`
13245 case "$d_uname$d_gethname" in
13248 case "$phostname" in
13250 echo "There will be no way for $package to get your hostname." >&4;;
13252 echo "I'll use 'popen("'"'$aphostname'", "r")'"' to get your hostname." >&4
13256 case "$d_phostname" in
13257 '') d_phostname="$undef";;
13260 : see if gethostbyaddr_r exists
13261 set gethostbyaddr_r d_gethostbyaddr_r
13263 case "$d_gethostbyaddr_r" in
13265 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13266 case "$d_gethostbyaddr_r_proto:$usethreads" in
13267 ":define") d_gethostbyaddr_r_proto=define
13268 set d_gethostbyaddr_r_proto gethostbyaddr_r $hdrs
13272 case "$d_gethostbyaddr_r_proto" in
13274 case "$gethostbyaddr_r_proto" in
13275 ''|0) try='int gethostbyaddr_r(const char*, size_t, int, struct hostent*, char*, size_t, struct hostent**, int*);'
13276 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=I_CWISBWRE ;;
13278 case "$gethostbyaddr_r_proto" in
13279 ''|0) try='struct hostent* gethostbyaddr_r(const char*, size_t, int, struct hostent*, char*, size_t, int, int*);'
13280 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=S_CWISBWIE ;;
13282 case "$gethostbyaddr_r_proto" in
13283 ''|0) try='struct hostent* gethostbyaddr_r(const char*, size_t, int, struct hostent*, char*, int, int*);'
13284 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=S_CWISBIE ;;
13286 case "$gethostbyaddr_r_proto" in
13287 ''|0) try='struct hostent* gethostbyaddr_r(const void*, size_t, int, struct hostent*, char*, int, int*);'
13288 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=S_TWISBIE ;;
13290 case "$gethostbyaddr_r_proto" in
13291 ''|0) try='struct hostent* gethostbyaddr_r(const char*, int, int, struct hostent*, char*, int, int*);'
13292 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=S_CIISBIE ;;
13294 case "$gethostbyaddr_r_proto" in
13295 ''|0) try='struct hostent* gethostbyaddr_r(const char*, struct hostent*, char*, int, int*);'
13296 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=S_CSBIE ;;
13298 case "$gethostbyaddr_r_proto" in
13299 ''|0) try='struct hostent* gethostbyaddr_r(const void*, struct hostent*, char*, int, int*);'
13300 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=S_TSBIE ;;
13302 case "$gethostbyaddr_r_proto" in
13303 ''|0) try='int gethostbyaddr_r(const char*, size_t, int, struct hostent*, struct hostent_data*);'
13304 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=I_CWISD ;;
13306 case "$gethostbyaddr_r_proto" in
13307 ''|0) try='int gethostbyaddr_r(const char*, int, int, struct hostent*, struct hostent_data*);'
13308 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=I_CIISD ;;
13310 case "$gethostbyaddr_r_proto" in
13311 ''|0) try='int gethostbyaddr_r(const char*, int, int);'
13312 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=I_CII ;;
13314 case "$gethostbyaddr_r_proto" in
13315 ''|0) try='int gethostbyaddr_r(const void*, socklen_t, int, struct hostent*, char*, size_t, struct hostent**, int*);'
13316 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=I_TsISBWRE ;;
13318 case "$gethostbyaddr_r_proto" in
13319 ''|0) d_gethostbyaddr_r=undef
13320 gethostbyaddr_r_proto=0
13321 echo "Disabling gethostbyaddr_r, cannot determine prototype." >&4 ;;
13322 * ) case "$gethostbyaddr_r_proto" in
13323 REENTRANT_PROTO*) ;;
13324 *) gethostbyaddr_r_proto="REENTRANT_PROTO_$gethostbyaddr_r_proto" ;;
13326 echo "Prototype: $try" ;;
13329 *) case "$usethreads" in
13330 define) echo "gethostbyaddr_r has no prototype, not using it." >&4 ;;
13332 d_gethostbyaddr_r=undef
13333 gethostbyaddr_r_proto=0
13337 *) gethostbyaddr_r_proto=0
13341 : see if gethostbyname_r exists
13342 set gethostbyname_r d_gethostbyname_r
13344 case "$d_gethostbyname_r" in
13346 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13347 case "$d_gethostbyname_r_proto:$usethreads" in
13348 ":define") d_gethostbyname_r_proto=define
13349 set d_gethostbyname_r_proto gethostbyname_r $hdrs
13353 case "$d_gethostbyname_r_proto" in
13355 case "$gethostbyname_r_proto" in
13356 ''|0) try='int gethostbyname_r(const char*, struct hostent*, char*, size_t, struct hostent**, int*);'
13357 ./protochk "extern $try" $hdrs && gethostbyname_r_proto=I_CSBWRE ;;
13359 case "$gethostbyname_r_proto" in
13360 ''|0) try='struct hostent* gethostbyname_r(const char*, struct hostent*, char*, int, int*);'
13361 ./protochk "extern $try" $hdrs && gethostbyname_r_proto=S_CSBIE ;;
13363 case "$gethostbyname_r_proto" in
13364 ''|0) try='int gethostbyname_r(const char*, struct hostent*, struct hostent_data*);'
13365 ./protochk "extern $try" $hdrs && gethostbyname_r_proto=I_CSD ;;
13367 case "$gethostbyname_r_proto" in
13368 ''|0) d_gethostbyname_r=undef
13369 gethostbyname_r_proto=0
13370 echo "Disabling gethostbyname_r, cannot determine prototype." >&4 ;;
13371 * ) case "$gethostbyname_r_proto" in
13372 REENTRANT_PROTO*) ;;
13373 *) gethostbyname_r_proto="REENTRANT_PROTO_$gethostbyname_r_proto" ;;
13375 echo "Prototype: $try" ;;
13378 *) case "$usethreads" in
13379 define) echo "gethostbyname_r has no prototype, not using it." >&4 ;;
13381 d_gethostbyname_r=undef
13382 gethostbyname_r_proto=0
13386 *) gethostbyname_r_proto=0
13390 : see if gethostent_r exists
13391 set gethostent_r d_gethostent_r
13393 case "$d_gethostent_r" in
13395 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13396 case "$d_gethostent_r_proto:$usethreads" in
13397 ":define") d_gethostent_r_proto=define
13398 set d_gethostent_r_proto gethostent_r $hdrs
13402 case "$d_gethostent_r_proto" in
13404 case "$gethostent_r_proto" in
13405 ''|0) try='int gethostent_r(struct hostent*, char*, size_t, struct hostent**, int*);'
13406 ./protochk "extern $try" $hdrs && gethostent_r_proto=I_SBWRE ;;
13408 case "$gethostent_r_proto" in
13409 ''|0) try='int gethostent_r(struct hostent*, char*, int, int*);'
13410 ./protochk "extern $try" $hdrs && gethostent_r_proto=I_SBIE ;;
13412 case "$gethostent_r_proto" in
13413 ''|0) try='struct hostent* gethostent_r(struct hostent*, char*, int, int*);'
13414 ./protochk "extern $try" $hdrs && gethostent_r_proto=S_SBIE ;;
13416 case "$gethostent_r_proto" in
13417 ''|0) try='struct hostent* gethostent_r(struct hostent*, char*, int);'
13418 ./protochk "extern $try" $hdrs && gethostent_r_proto=S_SBI ;;
13420 case "$gethostent_r_proto" in
13421 ''|0) try='int gethostent_r(struct hostent*, char*, int);'
13422 ./protochk "extern $try" $hdrs && gethostent_r_proto=I_SBI ;;
13424 case "$gethostent_r_proto" in
13425 ''|0) try='int gethostent_r(struct hostent*, struct hostent_data*);'
13426 ./protochk "extern $try" $hdrs && gethostent_r_proto=I_SD ;;
13428 case "$gethostent_r_proto" in
13429 ''|0) d_gethostent_r=undef
13430 gethostent_r_proto=0
13431 echo "Disabling gethostent_r, cannot determine prototype." >&4 ;;
13432 * ) case "$gethostent_r_proto" in
13433 REENTRANT_PROTO*) ;;
13434 *) gethostent_r_proto="REENTRANT_PROTO_$gethostent_r_proto" ;;
13436 echo "Prototype: $try" ;;
13439 *) case "$usethreads" in
13440 define) echo "gethostent_r has no prototype, not using it." >&4 ;;
13442 d_gethostent_r=undef
13443 gethostent_r_proto=0
13447 *) gethostent_r_proto=0
13451 : see if prototypes for various gethostxxx netdb.h functions are available
13453 set d_gethostprotos gethostent $i_netdb netdb.h
13456 : see if getitimer exists
13457 set getitimer d_getitimer
13460 : see if getlogin exists
13461 set getlogin d_getlogin
13464 : see if getlogin_r exists
13465 set getlogin_r d_getlogin_r
13467 case "$d_getlogin_r" in
13469 hdrs="$i_systypes sys/types.h define stdio.h $i_unistd unistd.h"
13470 case "$d_getlogin_r_proto:$usethreads" in
13471 ":define") d_getlogin_r_proto=define
13472 set d_getlogin_r_proto getlogin_r $hdrs
13476 case "$d_getlogin_r_proto" in
13478 case "$getlogin_r_proto" in
13479 ''|0) try='int getlogin_r(char*, size_t);'
13480 ./protochk "extern $try" $hdrs && getlogin_r_proto=I_BW ;;
13482 case "$getlogin_r_proto" in
13483 ''|0) try='int getlogin_r(char*, int);'
13484 ./protochk "extern $try" $hdrs && getlogin_r_proto=I_BI ;;
13486 case "$getlogin_r_proto" in
13487 ''|0) try='char* getlogin_r(char*, size_t);'
13488 ./protochk "extern $try" $hdrs && getlogin_r_proto=B_BW ;;
13490 case "$getlogin_r_proto" in
13491 ''|0) try='char* getlogin_r(char*, int);'
13492 ./protochk "extern $try" $hdrs && getlogin_r_proto=B_BI ;;
13494 case "$getlogin_r_proto" in
13495 ''|0) d_getlogin_r=undef
13497 echo "Disabling getlogin_r, cannot determine prototype." >&4 ;;
13498 * ) case "$getlogin_r_proto" in
13499 REENTRANT_PROTO*) ;;
13500 *) getlogin_r_proto="REENTRANT_PROTO_$getlogin_r_proto" ;;
13502 echo "Prototype: $try" ;;
13505 *) case "$usethreads" in
13506 define) echo "getlogin_r has no prototype, not using it." >&4 ;;
13513 *) getlogin_r_proto=0
13517 : see if getmnt exists
13518 set getmnt d_getmnt
13521 : see if getmntent exists
13522 set getmntent d_getmntent
13525 : see if getnetbyaddr exists
13526 set getnetbyaddr d_getnbyaddr
13529 : see if getnetbyname exists
13530 set getnetbyname d_getnbyname
13533 : see if getnetent exists
13534 set getnetent d_getnent
13537 : see if getnetbyaddr_r exists
13538 set getnetbyaddr_r d_getnetbyaddr_r
13540 case "$d_getnetbyaddr_r" in
13542 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13543 case "$d_getnetbyaddr_r_proto:$usethreads" in
13544 ":define") d_getnetbyaddr_r_proto=define
13545 set d_getnetbyaddr_r_proto getnetbyaddr_r $hdrs
13549 case "$d_getnetbyaddr_r_proto" in
13551 case "$getnetbyaddr_r_proto" in
13552 ''|0) try='int getnetbyaddr_r(unsigned long, int, struct netent*, char*, size_t, struct netent**, int*);'
13553 ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=I_UISBWRE ;;
13555 case "$getnetbyaddr_r_proto" in
13556 ''|0) try='int getnetbyaddr_r(long, int, struct netent*, char*, int);'
13557 ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=I_LISBI ;;
13559 case "$getnetbyaddr_r_proto" in
13560 ''|0) try='struct netent* getnetbyaddr_r(in_addr_t, int, struct netent*, char*, int);'
13561 ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=S_TISBI ;;
13563 case "$getnetbyaddr_r_proto" in
13564 ''|0) try='struct netent* getnetbyaddr_r(long, int, struct netent*, char*, int);'
13565 ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=S_LISBI ;;
13567 case "$getnetbyaddr_r_proto" in
13568 ''|0) try='int getnetbyaddr_r(in_addr_t, int, struct netent*, struct netent_data*);'
13569 ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=I_TISD ;;
13571 case "$getnetbyaddr_r_proto" in
13572 ''|0) try='int getnetbyaddr_r(long, int, struct netent*, struct netent_data*);'
13573 ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=I_LISD ;;
13575 case "$getnetbyaddr_r_proto" in
13576 ''|0) try='int getnetbyaddr_r(int, int, struct netent*, struct netent_data*);'
13577 ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=I_IISD ;;
13579 case "$getnetbyaddr_r_proto" in
13580 ''|0) try='int getnetbyaddr_r(uint32_t, int, struct netent*, char*, size_t, struct netent**, int*);'
13581 ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=I_uISBWRE ;;
13583 case "$getnetbyaddr_r_proto" in
13584 ''|0) d_getnetbyaddr_r=undef
13585 getnetbyaddr_r_proto=0
13586 echo "Disabling getnetbyaddr_r, cannot determine prototype." >&4 ;;
13587 * ) case "$getnetbyaddr_r_proto" in
13588 REENTRANT_PROTO*) ;;
13589 *) getnetbyaddr_r_proto="REENTRANT_PROTO_$getnetbyaddr_r_proto" ;;
13591 echo "Prototype: $try" ;;
13594 *) case "$usethreads" in
13595 define) echo "getnetbyaddr_r has no prototype, not using it." >&4 ;;
13597 d_getnetbyaddr_r=undef
13598 getnetbyaddr_r_proto=0
13602 *) getnetbyaddr_r_proto=0
13606 : see if getnetbyname_r exists
13607 set getnetbyname_r d_getnetbyname_r
13609 case "$d_getnetbyname_r" in
13611 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13612 case "$d_getnetbyname_r_proto:$usethreads" in
13613 ":define") d_getnetbyname_r_proto=define
13614 set d_getnetbyname_r_proto getnetbyname_r $hdrs
13618 case "$d_getnetbyname_r_proto" in
13620 case "$getnetbyname_r_proto" in
13621 ''|0) try='int getnetbyname_r(const char*, struct netent*, char*, size_t, struct netent**, int*);'
13622 ./protochk "extern $try" $hdrs && getnetbyname_r_proto=I_CSBWRE ;;
13624 case "$getnetbyname_r_proto" in
13625 ''|0) try='int getnetbyname_r(const char*, struct netent*, char*, int);'
13626 ./protochk "extern $try" $hdrs && getnetbyname_r_proto=I_CSBI ;;
13628 case "$getnetbyname_r_proto" in
13629 ''|0) try='struct netent* getnetbyname_r(const char*, struct netent*, char*, int);'
13630 ./protochk "extern $try" $hdrs && getnetbyname_r_proto=S_CSBI ;;
13632 case "$getnetbyname_r_proto" in
13633 ''|0) try='int getnetbyname_r(const char*, struct netent*, struct netent_data*);'
13634 ./protochk "extern $try" $hdrs && getnetbyname_r_proto=I_CSD ;;
13636 case "$getnetbyname_r_proto" in
13637 ''|0) d_getnetbyname_r=undef
13638 getnetbyname_r_proto=0
13639 echo "Disabling getnetbyname_r, cannot determine prototype." >&4 ;;
13640 * ) case "$getnetbyname_r_proto" in
13641 REENTRANT_PROTO*) ;;
13642 *) getnetbyname_r_proto="REENTRANT_PROTO_$getnetbyname_r_proto" ;;
13644 echo "Prototype: $try" ;;
13647 *) case "$usethreads" in
13648 define) echo "getnetbyname_r has no prototype, not using it." >&4 ;;
13650 d_getnetbyname_r=undef
13651 getnetbyname_r_proto=0
13655 *) getnetbyname_r_proto=0
13659 : see if getnetent_r exists
13660 set getnetent_r d_getnetent_r
13662 case "$d_getnetent_r" in
13664 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13665 case "$d_getnetent_r_proto:$usethreads" in
13666 ":define") d_getnetent_r_proto=define
13667 set d_getnetent_r_proto getnetent_r $hdrs
13671 case "$d_getnetent_r_proto" in
13673 case "$getnetent_r_proto" in
13674 ''|0) try='int getnetent_r(struct netent*, char*, size_t, struct netent**, int*);'
13675 ./protochk "extern $try" $hdrs && getnetent_r_proto=I_SBWRE ;;
13677 case "$getnetent_r_proto" in
13678 ''|0) try='int getnetent_r(struct netent*, char*, int, int*);'
13679 ./protochk "extern $try" $hdrs && getnetent_r_proto=I_SBIE ;;
13681 case "$getnetent_r_proto" in
13682 ''|0) try='struct netent* getnetent_r(struct netent*, char*, int, int*);'
13683 ./protochk "extern $try" $hdrs && getnetent_r_proto=S_SBIE ;;
13685 case "$getnetent_r_proto" in
13686 ''|0) try='struct netent* getnetent_r(struct netent*, char*, int);'
13687 ./protochk "extern $try" $hdrs && getnetent_r_proto=S_SBI ;;
13689 case "$getnetent_r_proto" in
13690 ''|0) try='int getnetent_r(struct netent*, char*, int);'
13691 ./protochk "extern $try" $hdrs && getnetent_r_proto=I_SBI ;;
13693 case "$getnetent_r_proto" in
13694 ''|0) try='int getnetent_r(struct netent*, struct netent_data*);'
13695 ./protochk "extern $try" $hdrs && getnetent_r_proto=I_SD ;;
13697 case "$getnetent_r_proto" in
13698 ''|0) d_getnetent_r=undef
13699 getnetent_r_proto=0
13700 echo "Disabling getnetent_r, cannot determine prototype." >&4 ;;
13701 * ) case "$getnetent_r_proto" in
13702 REENTRANT_PROTO*) ;;
13703 *) getnetent_r_proto="REENTRANT_PROTO_$getnetent_r_proto" ;;
13705 echo "Prototype: $try" ;;
13708 *) case "$usethreads" in
13709 define) echo "getnetent_r has no prototype, not using it." >&4 ;;
13711 d_getnetent_r=undef
13712 getnetent_r_proto=0
13716 *) getnetent_r_proto=0
13720 : see if prototypes for various getnetxxx netdb.h functions are available
13722 set d_getnetprotos getnetent $i_netdb netdb.h
13725 : see if getpagesize exists
13726 set getpagesize d_getpagsz
13730 : see if getprotobyname exists
13731 set getprotobyname d_getpbyname
13734 : see if getprotobynumber exists
13735 set getprotobynumber d_getpbynumber
13738 : see if getprotoent exists
13739 set getprotoent d_getpent
13742 : see if getpgid exists
13743 set getpgid d_getpgid
13746 : see if getpgrp2 exists
13747 set getpgrp2 d_getpgrp2
13750 : see if getppid exists
13751 set getppid d_getppid
13754 : see if getpriority exists
13755 set getpriority d_getprior
13758 : see if getprotobyname_r exists
13759 set getprotobyname_r d_getprotobyname_r
13761 case "$d_getprotobyname_r" in
13763 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13764 case "$d_getprotobyname_r_proto:$usethreads" in
13765 ":define") d_getprotobyname_r_proto=define
13766 set d_getprotobyname_r_proto getprotobyname_r $hdrs
13770 case "$d_getprotobyname_r_proto" in
13772 case "$getprotobyname_r_proto" in
13773 ''|0) try='int getprotobyname_r(const char*, struct protoent*, char*, size_t, struct protoent**);'
13774 ./protochk "extern $try" $hdrs && getprotobyname_r_proto=I_CSBWR ;;
13776 case "$getprotobyname_r_proto" in
13777 ''|0) try='struct protoent* getprotobyname_r(const char*, struct protoent*, char*, int);'
13778 ./protochk "extern $try" $hdrs && getprotobyname_r_proto=S_CSBI ;;
13780 case "$getprotobyname_r_proto" in
13781 ''|0) try='int getprotobyname_r(const char*, struct protoent*, struct protoent_data*);'
13782 ./protochk "extern $try" $hdrs && getprotobyname_r_proto=I_CSD ;;
13784 case "$getprotobyname_r_proto" in
13785 ''|0) d_getprotobyname_r=undef
13786 getprotobyname_r_proto=0
13787 echo "Disabling getprotobyname_r, cannot determine prototype." >&4 ;;
13788 * ) case "$getprotobyname_r_proto" in
13789 REENTRANT_PROTO*) ;;
13790 *) getprotobyname_r_proto="REENTRANT_PROTO_$getprotobyname_r_proto" ;;
13792 echo "Prototype: $try" ;;
13795 *) case "$usethreads" in
13796 define) echo "getprotobyname_r has no prototype, not using it." >&4 ;;
13798 d_getprotobyname_r=undef
13799 getprotobyname_r_proto=0
13803 *) getprotobyname_r_proto=0
13807 : see if getprotobynumber_r exists
13808 set getprotobynumber_r d_getprotobynumber_r
13810 case "$d_getprotobynumber_r" in
13812 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13813 case "$d_getprotobynumber_r_proto:$usethreads" in
13814 ":define") d_getprotobynumber_r_proto=define
13815 set d_getprotobynumber_r_proto getprotobynumber_r $hdrs
13819 case "$d_getprotobynumber_r_proto" in
13821 case "$getprotobynumber_r_proto" in
13822 ''|0) try='int getprotobynumber_r(int, struct protoent*, char*, size_t, struct protoent**);'
13823 ./protochk "extern $try" $hdrs && getprotobynumber_r_proto=I_ISBWR ;;
13825 case "$getprotobynumber_r_proto" in
13826 ''|0) try='struct protoent* getprotobynumber_r(int, struct protoent*, char*, int);'
13827 ./protochk "extern $try" $hdrs && getprotobynumber_r_proto=S_ISBI ;;
13829 case "$getprotobynumber_r_proto" in
13830 ''|0) try='int getprotobynumber_r(int, struct protoent*, struct protoent_data*);'
13831 ./protochk "extern $try" $hdrs && getprotobynumber_r_proto=I_ISD ;;
13833 case "$getprotobynumber_r_proto" in
13834 ''|0) d_getprotobynumber_r=undef
13835 getprotobynumber_r_proto=0
13836 echo "Disabling getprotobynumber_r, cannot determine prototype." >&4 ;;
13837 * ) case "$getprotobynumber_r_proto" in
13838 REENTRANT_PROTO*) ;;
13839 *) getprotobynumber_r_proto="REENTRANT_PROTO_$getprotobynumber_r_proto" ;;
13841 echo "Prototype: $try" ;;
13844 *) case "$usethreads" in
13845 define) echo "getprotobynumber_r has no prototype, not using it." >&4 ;;
13847 d_getprotobynumber_r=undef
13848 getprotobynumber_r_proto=0
13852 *) getprotobynumber_r_proto=0
13856 : see if getprotoent_r exists
13857 set getprotoent_r d_getprotoent_r
13859 case "$d_getprotoent_r" in
13861 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13862 case "$d_getprotoent_r_proto:$usethreads" in
13863 ":define") d_getprotoent_r_proto=define
13864 set d_getprotoent_r_proto getprotoent_r $hdrs
13868 case "$d_getprotoent_r_proto" in
13870 case "$getprotoent_r_proto" in
13871 ''|0) try='int getprotoent_r(struct protoent*, char*, size_t, struct protoent**);'
13872 ./protochk "extern $try" $hdrs && getprotoent_r_proto=I_SBWR ;;
13874 case "$getprotoent_r_proto" in
13875 ''|0) try='int getprotoent_r(struct protoent*, char*, int);'
13876 ./protochk "extern $try" $hdrs && getprotoent_r_proto=I_SBI ;;
13878 case "$getprotoent_r_proto" in
13879 ''|0) try='struct protoent* getprotoent_r(struct protoent*, char*, int);'
13880 ./protochk "extern $try" $hdrs && getprotoent_r_proto=S_SBI ;;
13882 case "$getprotoent_r_proto" in
13883 ''|0) try='int getprotoent_r(struct protoent*, struct protoent_data*);'
13884 ./protochk "extern $try" $hdrs && getprotoent_r_proto=I_SD ;;
13886 case "$getprotoent_r_proto" in
13887 ''|0) d_getprotoent_r=undef
13888 getprotoent_r_proto=0
13889 echo "Disabling getprotoent_r, cannot determine prototype." >&4 ;;
13890 * ) case "$getprotoent_r_proto" in
13891 REENTRANT_PROTO*) ;;
13892 *) getprotoent_r_proto="REENTRANT_PROTO_$getprotoent_r_proto" ;;
13894 echo "Prototype: $try" ;;
13897 *) case "$usethreads" in
13898 define) echo "getprotoent_r has no prototype, not using it." >&4 ;;
13900 d_getprotoent_r=undef
13901 getprotoent_r_proto=0
13905 *) getprotoent_r_proto=0
13909 : see if prototypes for various getprotoxxx netdb.h functions are available
13911 set d_getprotoprotos getprotoent $i_netdb netdb.h
13914 : see if getprpwnam exists
13915 set getprpwnam d_getprpwnam
13918 : see if getpwent exists
13919 set getpwent d_getpwent
13922 : see if getpwent_r exists
13923 set getpwent_r d_getpwent_r
13925 case "$d_getpwent_r" in
13927 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
13928 case "$d_getpwent_r_proto:$usethreads" in
13929 ":define") d_getpwent_r_proto=define
13930 set d_getpwent_r_proto getpwent_r $hdrs
13934 case "$d_getpwent_r_proto" in
13936 case "$getpwent_r_proto" in
13937 ''|0) try='int getpwent_r(struct passwd*, char*, size_t, struct passwd**);'
13938 ./protochk "extern $try" $hdrs && getpwent_r_proto=I_SBWR ;;
13940 case "$getpwent_r_proto" in
13941 ''|0) try='int getpwent_r(struct passwd*, char*, int, struct passwd**);'
13942 ./protochk "extern $try" $hdrs && getpwent_r_proto=I_SBIR ;;
13944 case "$getpwent_r_proto" in
13945 ''|0) try='struct passwd* getpwent_r(struct passwd*, char*, size_t);'
13946 ./protochk "extern $try" $hdrs && getpwent_r_proto=S_SBW ;;
13948 case "$getpwent_r_proto" in
13949 ''|0) try='struct passwd* getpwent_r(struct passwd*, char*, int);'
13950 ./protochk "extern $try" $hdrs && getpwent_r_proto=S_SBI ;;
13952 case "$getpwent_r_proto" in
13953 ''|0) try='int getpwent_r(struct passwd*, char*, int);'
13954 ./protochk "extern $try" $hdrs && getpwent_r_proto=I_SBI ;;
13956 case "$getpwent_r_proto" in
13957 ''|0) try='int getpwent_r(struct passwd*, char*, int, FILE**);'
13958 ./protochk "extern $try" $hdrs && getpwent_r_proto=I_SBIH ;;
13960 case "$getpwent_r_proto" in
13961 ''|0) d_getpwent_r=undef
13963 echo "Disabling getpwent_r, cannot determine prototype." >&4 ;;
13964 * ) case "$getpwent_r_proto" in
13965 REENTRANT_PROTO*) ;;
13966 *) getpwent_r_proto="REENTRANT_PROTO_$getpwent_r_proto" ;;
13968 echo "Prototype: $try" ;;
13971 *) case "$usethreads" in
13972 define) echo "getpwent_r has no prototype, not using it." >&4 ;;
13979 *) getpwent_r_proto=0
13983 : see if getpwnam_r exists
13984 set getpwnam_r d_getpwnam_r
13986 case "$d_getpwnam_r" in
13988 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
13989 case "$d_getpwnam_r_proto:$usethreads" in
13990 ":define") d_getpwnam_r_proto=define
13991 set d_getpwnam_r_proto getpwnam_r $hdrs
13995 case "$d_getpwnam_r_proto" in
13997 case "$getpwnam_r_proto" in
13998 ''|0) try='int getpwnam_r(const char*, struct passwd*, char*, size_t, struct passwd**);'
13999 ./protochk "extern $try" $hdrs && getpwnam_r_proto=I_CSBWR ;;
14001 case "$getpwnam_r_proto" in
14002 ''|0) try='int getpwnam_r(const char*, struct passwd*, char*, int, struct passwd**);'
14003 ./protochk "extern $try" $hdrs && getpwnam_r_proto=I_CSBIR ;;
14005 case "$getpwnam_r_proto" in
14006 ''|0) try='struct passwd* getpwnam_r(const char*, struct passwd*, char*, int);'
14007 ./protochk "extern $try" $hdrs && getpwnam_r_proto=S_CSBI ;;
14009 case "$getpwnam_r_proto" in
14010 ''|0) try='int getpwnam_r(const char*, struct passwd*, char*, int);'
14011 ./protochk "extern $try" $hdrs && getpwnam_r_proto=I_CSBI ;;
14013 case "$getpwnam_r_proto" in
14014 ''|0) d_getpwnam_r=undef
14016 echo "Disabling getpwnam_r, cannot determine prototype." >&4 ;;
14017 * ) case "$getpwnam_r_proto" in
14018 REENTRANT_PROTO*) ;;
14019 *) getpwnam_r_proto="REENTRANT_PROTO_$getpwnam_r_proto" ;;
14021 echo "Prototype: $try" ;;
14024 *) case "$usethreads" in
14025 define) echo "getpwnam_r has no prototype, not using it." >&4 ;;
14032 *) getpwnam_r_proto=0
14036 : see if getpwuid_r exists
14037 set getpwuid_r d_getpwuid_r
14039 case "$d_getpwuid_r" in
14041 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
14042 case "$d_getpwuid_r_proto:$usethreads" in
14043 ":define") d_getpwuid_r_proto=define
14044 set d_getpwuid_r_proto getpwuid_r $hdrs
14048 case "$d_getpwuid_r_proto" in
14050 case "$getpwuid_r_proto" in
14051 ''|0) try='int getpwuid_r(uid_t, struct passwd*, char*, size_t, struct passwd**);'
14052 ./protochk "extern $try" $hdrs && getpwuid_r_proto=I_TSBWR ;;
14054 case "$getpwuid_r_proto" in
14055 ''|0) try='int getpwuid_r(uid_t, struct passwd*, char*, int, struct passwd**);'
14056 ./protochk "extern $try" $hdrs && getpwuid_r_proto=I_TSBIR ;;
14058 case "$getpwuid_r_proto" in
14059 ''|0) try='int getpwuid_r(uid_t, struct passwd*, char*, int);'
14060 ./protochk "extern $try" $hdrs && getpwuid_r_proto=I_TSBI ;;
14062 case "$getpwuid_r_proto" in
14063 ''|0) try='struct passwd* getpwuid_r(uid_t, struct passwd*, char*, int);'
14064 ./protochk "extern $try" $hdrs && getpwuid_r_proto=S_TSBI ;;
14066 case "$getpwuid_r_proto" in
14067 ''|0) d_getpwuid_r=undef
14069 echo "Disabling getpwuid_r, cannot determine prototype." >&4 ;;
14070 * ) case "$getpwuid_r_proto" in
14071 REENTRANT_PROTO*) ;;
14072 *) getpwuid_r_proto="REENTRANT_PROTO_$getpwuid_r_proto" ;;
14074 echo "Prototype: $try" ;;
14077 *) case "$usethreads" in
14078 define) echo "getpwuid_r has no prototype, not using it." >&4 ;;
14085 *) getpwuid_r_proto=0
14090 : see if getservbyname exists
14091 set getservbyname d_getsbyname
14094 : see if getservbyport exists
14095 set getservbyport d_getsbyport
14098 : see if getservent exists
14099 set getservent d_getsent
14102 : see if getservbyname_r exists
14103 set getservbyname_r d_getservbyname_r
14105 case "$d_getservbyname_r" in
14107 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14108 case "$d_getservbyname_r_proto:$usethreads" in
14109 ":define") d_getservbyname_r_proto=define
14110 set d_getservbyname_r_proto getservbyname_r $hdrs
14114 case "$d_getservbyname_r_proto" in
14116 case "$getservbyname_r_proto" in
14117 ''|0) try='int getservbyname_r(const char*, const char*, struct servent*, char*, size_t, struct servent**);'
14118 ./protochk "extern $try" $hdrs && getservbyname_r_proto=I_CCSBWR ;;
14120 case "$getservbyname_r_proto" in
14121 ''|0) try='struct servent* getservbyname_r(const char*, const char*, struct servent*, char*, int);'
14122 ./protochk "extern $try" $hdrs && getservbyname_r_proto=S_CCSBI ;;
14124 case "$getservbyname_r_proto" in
14125 ''|0) try='int getservbyname_r(const char*, const char*, struct servent*, struct servent_data*);'
14126 ./protochk "extern $try" $hdrs && getservbyname_r_proto=I_CCSD ;;
14128 case "$getservbyname_r_proto" in
14129 ''|0) d_getservbyname_r=undef
14130 getservbyname_r_proto=0
14131 echo "Disabling getservbyname_r, cannot determine prototype." >&4 ;;
14132 * ) case "$getservbyname_r_proto" in
14133 REENTRANT_PROTO*) ;;
14134 *) getservbyname_r_proto="REENTRANT_PROTO_$getservbyname_r_proto" ;;
14136 echo "Prototype: $try" ;;
14139 *) case "$usethreads" in
14140 define) echo "getservbyname_r has no prototype, not using it." >&4 ;;
14142 d_getservbyname_r=undef
14143 getservbyname_r_proto=0
14147 *) getservbyname_r_proto=0
14151 : see if getservbyport_r exists
14152 set getservbyport_r d_getservbyport_r
14154 case "$d_getservbyport_r" in
14156 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14157 case "$d_getservbyport_r_proto:$usethreads" in
14158 ":define") d_getservbyport_r_proto=define
14159 set d_getservbyport_r_proto getservbyport_r $hdrs
14163 case "$d_getservbyport_r_proto" in
14165 case "$getservbyport_r_proto" in
14166 ''|0) try='int getservbyport_r(int, const char*, struct servent*, char*, size_t, struct servent**);'
14167 ./protochk "extern $try" $hdrs && getservbyport_r_proto=I_ICSBWR ;;
14169 case "$getservbyport_r_proto" in
14170 ''|0) try='struct servent* getservbyport_r(int, const char*, struct servent*, char*, int);'
14171 ./protochk "extern $try" $hdrs && getservbyport_r_proto=S_ICSBI ;;
14173 case "$getservbyport_r_proto" in
14174 ''|0) try='int getservbyport_r(int, const char*, struct servent*, struct servent_data*);'
14175 ./protochk "extern $try" $hdrs && getservbyport_r_proto=I_ICSD ;;
14177 case "$getservbyport_r_proto" in
14178 ''|0) d_getservbyport_r=undef
14179 getservbyport_r_proto=0
14180 echo "Disabling getservbyport_r, cannot determine prototype." >&4 ;;
14181 * ) case "$getservbyport_r_proto" in
14182 REENTRANT_PROTO*) ;;
14183 *) getservbyport_r_proto="REENTRANT_PROTO_$getservbyport_r_proto" ;;
14185 echo "Prototype: $try" ;;
14188 *) case "$usethreads" in
14189 define) echo "getservbyport_r has no prototype, not using it." >&4 ;;
14191 d_getservbyport_r=undef
14192 getservbyport_r_proto=0
14196 *) getservbyport_r_proto=0
14200 : see if getservent_r exists
14201 set getservent_r d_getservent_r
14203 case "$d_getservent_r" in
14205 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14206 case "$d_getservent_r_proto:$usethreads" in
14207 ":define") d_getservent_r_proto=define
14208 set d_getservent_r_proto getservent_r $hdrs
14212 case "$d_getservent_r_proto" in
14214 case "$getservent_r_proto" in
14215 ''|0) try='int getservent_r(struct servent*, char*, size_t, struct servent**);'
14216 ./protochk "extern $try" $hdrs && getservent_r_proto=I_SBWR ;;
14218 case "$getservent_r_proto" in
14219 ''|0) try='int getservent_r(struct servent*, char*, int);'
14220 ./protochk "extern $try" $hdrs && getservent_r_proto=I_SBI ;;
14222 case "$getservent_r_proto" in
14223 ''|0) try='struct servent* getservent_r(struct servent*, char*, int);'
14224 ./protochk "extern $try" $hdrs && getservent_r_proto=S_SBI ;;
14226 case "$getservent_r_proto" in
14227 ''|0) try='int getservent_r(struct servent*, struct servent_data*);'
14228 ./protochk "extern $try" $hdrs && getservent_r_proto=I_SD ;;
14230 case "$getservent_r_proto" in
14231 ''|0) d_getservent_r=undef
14232 getservent_r_proto=0
14233 echo "Disabling getservent_r, cannot determine prototype." >&4 ;;
14234 * ) case "$getservent_r_proto" in
14235 REENTRANT_PROTO*) ;;
14236 *) getservent_r_proto="REENTRANT_PROTO_$getservent_r_proto" ;;
14238 echo "Prototype: $try" ;;
14241 *) case "$usethreads" in
14242 define) echo "getservent_r has no prototype, not using it." >&4 ;;
14244 d_getservent_r=undef
14245 getservent_r_proto=0
14249 *) getservent_r_proto=0
14253 : see if prototypes for various getservxxx netdb.h functions are available
14255 set d_getservprotos getservent $i_netdb netdb.h
14258 : see if getspnam exists
14259 set getspnam d_getspnam
14262 : see if this is a shadow.h system
14263 set shadow.h i_shadow
14266 : see if getspnam_r exists
14267 set getspnam_r d_getspnam_r
14269 case "$d_getspnam_r" in
14271 hdrs="$i_systypes sys/types.h define stdio.h $i_shadow shadow.h"
14272 case "$d_getspnam_r_proto:$usethreads" in
14273 ":define") d_getspnam_r_proto=define
14274 set d_getspnam_r_proto getspnam_r $hdrs
14278 case "$d_getspnam_r_proto" in
14280 case "$getspnam_r_proto" in
14281 ''|0) try='int getspnam_r(const char*, struct spwd*, char*, size_t, struct spwd**);'
14282 ./protochk "extern $try" $hdrs && getspnam_r_proto=I_CSBWR ;;
14284 case "$getspnam_r_proto" in
14285 ''|0) try='struct spwd* getspnam_r(const char*, struct spwd*, char*, int);'
14286 ./protochk "extern $try" $hdrs && getspnam_r_proto=S_CSBI ;;
14288 case "$getspnam_r_proto" in
14289 ''|0) d_getspnam_r=undef
14291 echo "Disabling getspnam_r, cannot determine prototype." >&4 ;;
14292 * ) case "$getspnam_r_proto" in
14293 REENTRANT_PROTO*) ;;
14294 *) getspnam_r_proto="REENTRANT_PROTO_$getspnam_r_proto" ;;
14296 echo "Prototype: $try" ;;
14299 *) case "$usethreads" in
14300 define) echo "getspnam_r has no prototype, not using it." >&4 ;;
14307 *) getspnam_r_proto=0
14311 : see if gettimeofday or ftime exists
14312 set gettimeofday d_gettimeod
14314 case "$d_gettimeod" in
14320 val="$undef"; set d_ftime; eval $setvar
14323 case "$d_gettimeod$d_ftime" in
14326 echo 'No ftime() nor gettimeofday() -- timing may be less accurate.' >&4
14330 : see if gmtime_r exists
14331 set gmtime_r d_gmtime_r
14333 case "$d_gmtime_r" in
14335 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
14336 case "$d_gmtime_r_proto:$usethreads" in
14337 ":define") d_gmtime_r_proto=define
14338 set d_gmtime_r_proto gmtime_r $hdrs
14342 case "$d_gmtime_r_proto" in
14344 case "$gmtime_r_proto" in
14345 ''|0) try='struct tm* gmtime_r(const time_t*, struct tm*);'
14346 ./protochk "extern $try" $hdrs && gmtime_r_proto=S_TS ;;
14348 case "$gmtime_r_proto" in
14349 ''|0) try='int gmtime_r(const time_t*, struct tm*);'
14350 ./protochk "extern $try" $hdrs && gmtime_r_proto=I_TS ;;
14352 case "$gmtime_r_proto" in
14353 ''|0) d_gmtime_r=undef
14355 echo "Disabling gmtime_r, cannot determine prototype." >&4 ;;
14356 * ) case "$gmtime_r_proto" in
14357 REENTRANT_PROTO*) ;;
14358 *) gmtime_r_proto="REENTRANT_PROTO_$gmtime_r_proto" ;;
14360 echo "Prototype: $try" ;;
14363 *) case "$usethreads" in
14364 define) echo "gmtime_r has no prototype, not using it." >&4 ;;
14371 *) gmtime_r_proto=0
14375 : see if hasmntopt exists
14376 set hasmntopt d_hasmntopt
14379 : see if this is a netinet/in.h or sys/in.h system
14380 set netinet/in.h i_niin sys/in.h i_sysin
14383 : see if arpa/inet.h has to be included
14384 set arpa/inet.h i_arpainet
14387 : see if htonl --and friends-- exists
14392 : Maybe they are macros.
14395 $cat >htonl.c <<EOM
14397 #include <sys/types.h>
14398 #$i_niin I_NETINET_IN
14400 #$i_arpainet I_ARPA_INET
14401 #ifdef I_NETINET_IN
14402 #include <netinet/in.h>
14405 #include <sys/in.h>
14408 #include <arpa/inet.h>
14411 printf("Defined as a macro.");
14414 $cppstdin $cppflags $cppminus < htonl.c >htonl.E 2>/dev/null
14415 if $contains 'Defined as a macro' htonl.E >/dev/null 2>&1; then
14417 echo "But it seems to be defined as a macro." >&4
14425 : see if ilogbl exists
14426 set ilogbl d_ilogbl
14431 if set index val -f; eval $csym; $val; then
14432 if set strchr val -f d_strchr; eval $csym; $val; then
14433 if $contains strchr "$strings" >/dev/null 2>&1 ; then
14436 echo "strchr() found." >&4
14440 echo "index() found." >&4
14445 echo "index() found." >&4
14448 if set strchr val -f d_strchr; eval $csym; $val; then
14451 echo "strchr() found." >&4
14453 echo "No index() or strchr() found!" >&4
14458 set d_strchr; eval $setvar
14460 set d_index; eval $setvar
14462 : check whether inet_aton exists
14463 set inet_aton d_inetaton
14468 $cat >isascii.c <<EOCP
14471 #$i_stdlib I_STDLIB
14473 #include <stdlib.h>
14484 if eval $compile; then
14485 echo "isascii() found." >&4
14488 echo "isascii() NOT found." >&4
14495 : see if isfinite exists
14496 set isfinite d_isfinite
14499 : see if isinf exists
14503 : see if isnan exists
14507 : see if isnanl exists
14508 set isnanl d_isnanl
14511 : see if killpg exists
14512 set killpg d_killpg
14515 : see if lchown exists
14517 $cat > try.c <<'EOCP'
14518 /* System header to define __stub macros and hopefully few prototypes,
14519 which can conflict with char lchown(); below. */
14520 #include <assert.h>
14521 /* Override any gcc2 internal prototype to avoid an error. */
14522 /* We use char because int might match the return type of a gcc2
14523 builtin and then its argument prototype would still apply. */
14526 /* The GNU C library defines this for functions which it implements
14527 to always fail with ENOSYS. Some functions are actually named
14528 something starting with __ and the normal name is an alias. */
14529 #if defined (__stub_lchown) || defined (__stub___lchown)
14537 if eval $compile; then
14538 $echo "lchown() found." >&4
14541 $echo "lchown() NOT found." >&4
14547 : See if number of significant digits in a double precision number is known
14549 $cat >ldbl_dig.c <<EOM
14550 #$i_limits I_LIMITS
14553 #include <limits.h>
14559 printf("Contains LDBL_DIG");
14562 $cppstdin $cppflags $cppminus < ldbl_dig.c >ldbl_dig.E 2>/dev/null
14563 if $contains 'LDBL_DIG' ldbl_dig.E >/dev/null 2>&1; then
14564 echo "LDBL_DIG found." >&4
14567 echo "LDBL_DIG NOT found." >&4
14574 : see if this is a math.h system
14578 d_libm_lib_version="$undef"
14581 : check to see if math.h defines _LIB_VERSION
14583 echo "Checking to see if your libm supports _LIB_VERSION..." >&4
14585 #include <unistd.h>
14587 int main (int argc, char *argv[])
14589 printf ("%d\n", _LIB_VERSION);
14594 if eval $compile; then
14596 echo "Yes, it does ($foo)" >&4
14597 d_libm_lib_version="$define"
14599 echo "No, it does not (probably harmless)\n" >&4
14601 $rm -f try.* try core core.try.*
14606 : see if link exists
14610 : see if localtime_r exists
14611 set localtime_r d_localtime_r
14613 case "$d_localtime_r" in
14615 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
14616 case "$d_localtime_r_proto:$usethreads" in
14617 ":define") d_localtime_r_proto=define
14618 set d_localtime_r_proto localtime_r $hdrs
14622 case "$d_localtime_r_proto" in
14624 case "$localtime_r_proto" in
14625 ''|0) try='struct tm* localtime_r(const time_t*, struct tm*);'
14626 ./protochk "extern $try" $hdrs && localtime_r_proto=S_TS ;;
14628 case "$localtime_r_proto" in
14629 ''|0) try='int localtime_r(const time_t*, struct tm*);'
14630 ./protochk "extern $try" $hdrs && localtime_r_proto=I_TS ;;
14632 case "$localtime_r_proto" in
14633 ''|0) d_localtime_r=undef
14634 localtime_r_proto=0
14635 echo "Disabling localtime_r, cannot determine prototype." >&4 ;;
14636 * ) case "$localtime_r_proto" in
14637 REENTRANT_PROTO*) ;;
14638 *) localtime_r_proto="REENTRANT_PROTO_$localtime_r_proto" ;;
14640 echo "Prototype: $try" ;;
14643 *) case "$usethreads" in
14644 define) echo "localtime_r has no prototype, not using it." >&4 ;;
14646 d_localtime_r=undef
14647 localtime_r_proto=0
14651 *) localtime_r_proto=0
14655 : see if localtime_r calls tzset
14656 case "$localtime_r_proto" in
14659 /* Does our libc's localtime_r call tzset ?
14660 * return 0 if so, 1 otherwise.
14662 #include <sys/types.h>
14663 #include <unistd.h>
14665 #include <string.h>
14666 #include <malloc.h>
14669 time_t t = time(0L);
14670 char w_tz[]="TZ" "=GMT+5",
14671 e_tz[]="TZ" "=GMT-5",
14672 *tz_e = (char*)malloc(16),
14673 *tz_w = (char*)malloc(16);
14674 struct tm tm_e, tm_w;
14675 memset(&tm_e,'\0',sizeof(struct tm));
14676 memset(&tm_w,'\0',sizeof(struct tm));
14681 localtime_r(&t, &tm_e);
14684 localtime_r(&t, &tm_w);
14686 if( memcmp(&tm_e, &tm_w, sizeof(struct tm)) == 0 )
14692 if eval $compile; then
14694 d_localtime_r_needs_tzset=undef;
14696 d_localtime_r_needs_tzset=define;
14699 d_localtime_r_needs_tzset=undef;
14703 d_localtime_r_needs_tzset=undef;
14706 $rm -f try try.* core
14708 : see if localeconv exists
14709 set localeconv d_locconv
14712 : see if lockf exists
14716 : see if prototype for lseek is available
14718 set d_lseekproto lseek $i_systypes sys/types.h $i_unistd unistd.h
14721 : see if lstat exists
14725 : see if madvise exists
14726 set madvise d_madvise
14729 : see if malloc_size exists
14730 set malloc_size d_malloc_size
14733 : see if malloc_size_good exists
14734 set malloc_good_size d_malloc_good_size
14737 : see if mblen exists
14741 : see if mbstowcs exists
14742 set mbstowcs d_mbstowcs
14745 : see if mbtowc exists
14746 set mbtowc d_mbtowc
14749 : see if memchr exists
14750 set memchr d_memchr
14753 : see if memcmp exists
14754 set memcmp d_memcmp
14757 : see if memcpy exists
14758 set memcpy d_memcpy
14761 : see if memmove exists
14762 set memmove d_memmove
14765 : see if memset exists
14766 set memset d_memset
14769 : see if mkdir exists
14773 : see if mkdtemp exists
14774 set mkdtemp d_mkdtemp
14777 : see if mkfifo exists
14778 set mkfifo d_mkfifo
14781 : see if mkstemp exists
14782 set mkstemp d_mkstemp
14785 : see if mkstemps exists
14786 set mkstemps d_mkstemps
14789 : see if mktime exists
14790 set mktime d_mktime
14793 : see if this is a sys/mman.h system
14794 set sys/mman.h i_sysmman
14797 : see if mmap exists
14800 : see what shmat returns
14801 : default to something harmless
14803 case "$i_sysmman$d_mmap" in
14805 $cat >mmap.c <<'END'
14806 #include <sys/mman.h>
14809 if $cc $ccflags -c mmap.c >/dev/null 2>&1; then
14814 echo "and it returns ($mmaptype)." >&4
14820 : see if sqrtl exists
14824 : see if scalbnl exists
14825 set scalbnl d_scalbnl
14828 : see if modfl exists
14832 : see if prototype for modfl is available
14834 set d_modflproto modfl $i_math math.h
14837 d_modfl_pow32_bug="$undef"
14839 case "$d_longdbl$d_modfl" in
14842 Checking to see whether your modfl() is okay for large values...
14848 if $test "X$d_modflproto" != "X$define"; then
14849 $cat >>try.c <<EOCP
14850 /* Sigh. many current glibcs provide the function, but do not prototype it. */
14851 long double modfl (long double, long double *);
14854 $cat >>try.c <<EOCP
14856 long double nv = 4294967303.15;
14862 printf(" %"$sPRIfldbl" %"$sPRIfldbl" %"$sPRIfldbl"\n", nv, v, w);
14866 case "$osname:$gccversion" in
14867 aix:) saveccflags="$ccflags"
14868 ccflags="$ccflags -qlongdouble" ;; # to avoid core dump
14871 if eval $compile; then
14874 *" 4294967303.150000 1.150000 4294967302.000000")
14875 echo >&4 "Your modfl() is broken for large values."
14876 d_modfl_pow32_bug="$define"
14878 glibc) echo >&4 "You should upgrade your glibc to at least 2.2.2 to get a fixed modfl()."
14882 *" 4294967303.150000 0.150000 4294967303.000000")
14883 echo >&4 "Your modfl() seems okay for large values."
14885 *) echo >&4 "I don't understand your modfl() at all."
14889 $rm -f try.* try core core.try.*
14891 echo "I cannot figure out whether your modfl() is okay, assuming it isn't."
14894 case "$osname:$gccversion" in
14895 aix:) ccflags="$saveccflags" ;; # restore
14900 if $test "$uselongdouble" = "$define"; then
14902 if $test "$d_sqrtl" != "$define"; then
14903 message="$message sqrtl"
14905 if $test "$d_modfl" != "$define"; then
14906 if $test "$d_aintl:$d_copysignl" = "$define:$define"; then
14907 echo "You have both aintl and copysignl, so I can emulate modfl."
14909 message="$message modfl"
14912 if $test "$d_frexpl" != "$define"; then
14913 if $test "$d_ilogbl:$d_scalbnl" = "$define:$define"; then
14914 echo "You have both ilogbl and scalbnl, so I can emulate frexpl."
14916 message="$message frexpl"
14920 if $test "$message" != ""; then
14923 *** You requested the use of long doubles but you do not seem to have
14924 *** the following mathematical functions needed for long double support:
14926 *** Please rerun Configure without -Duselongdouble and/or -Dusemorebits.
14927 *** Cannot continue, aborting.
14935 : see if mprotect exists
14936 set mprotect d_mprotect
14939 : see if msgctl exists
14940 set msgctl d_msgctl
14943 : see if msgget exists
14944 set msgget d_msgget
14947 : see if msgsnd exists
14948 set msgsnd d_msgsnd
14951 : see if msgrcv exists
14952 set msgrcv d_msgrcv
14955 : see how much of the 'msg*(2)' library is present.
14958 case "$d_msgctl$d_msgget$d_msgsnd$d_msgrcv" in
14959 *"$undef"*) h_msg=false;;
14963 case "`ipcs 2>&1`" in
14964 "SVID messages"*"not configured"*)
14965 echo "Your $osname does not have the msg*(2) configured." >&4
14968 set msgctl d_msgctl
14970 set msgget d_msgget
14972 set msgsnd d_msgsnd
14974 set msgrcv d_msgrcv
14980 : we could also check for sys/ipc.h ...
14981 if $h_msg && $test `./findhdr sys/msg.h`; then
14982 echo "You have the full msg*(2) library." >&4
14985 echo "You don't have the full msg*(2) library." >&4
14993 echo "Checking to see if your system supports struct msghdr..." >&4
14994 set d_msghdr_s msghdr $i_systypes sys/types.h $d_socket sys/socket.h $i_sysuio sys/uio.h
14996 case "$d_msghdr_s" in
14997 "$define") echo "Yes, it does." ;;
14998 *) echo "No, it doesn't." ;;
15002 : see if msync exists
15006 : see if munmap exists
15007 set munmap d_munmap
15010 : see if nice exists
15014 : see if this is a langinfo.h system
15015 set langinfo.h i_langinfo
15018 : see if nl_langinfo exists
15019 set nl_langinfo d_nl_langinfo
15022 : check for length of character
15024 case "$charsize" in
15026 echo "Checking to see how big your characters are (hey, you never know)..." >&4
15029 #$i_stdlib I_STDLIB
15031 #include <stdlib.h>
15035 printf("%d\n", (int)sizeof(char));
15040 if eval $compile_ok; then
15044 echo "(I can't seem to compile the test program. Guessing...)"
15051 rp="What is the size of a character (in bytes)?"
15056 : check for volatile keyword
15058 echo 'Checking to see if your C compiler knows about "volatile"...' >&4
15059 $cat >try.c <<'EOCP'
15062 typedef struct _goo_struct goo_struct;
15063 goo_struct * volatile goo = ((goo_struct *)0);
15064 struct _goo_struct {
15069 typedef unsigned short foo_t;
15070 char *volatile foo;
15072 volatile foo_t blech;
15076 if $cc -c $ccflags try.c >/dev/null 2>&1 ; then
15078 echo "Yup, it does."
15081 echo "Nope, it doesn't."
15089 $echo "Choosing the C types to be used for Perl's internal types..." >&4
15091 case "$use64bitint:$d_quad:$quadtype" in
15094 uvtype="$uquadtype"
15099 uvtype="unsigned long"
15105 case "$uselongdouble:$d_longdbl" in
15107 nvtype="long double"
15108 nvsize=$longdblsize
15115 $echo "(IV will be "$ivtype", $ivsize bytes)"
15116 $echo "(UV will be "$uvtype", $uvsize bytes)"
15117 $echo "(NV will be "$nvtype", $nvsize bytes)"
15120 #$i_inttypes I_INTTYPES
15122 #include <inttypes.h>
15127 int8_t i = INT8_MAX;
15128 uint8_t u = UINT8_MAX;
15129 printf("int8_t\n");
15132 int16_t i = INT16_MAX;
15133 uint16_t i = UINT16_MAX;
15134 printf("int16_t\n");
15137 int32_t i = INT32_MAX;
15138 uint32_t u = UINT32_MAX;
15139 printf("int32_t\n");
15145 '') case "$charsize" in
15147 u8type="unsigned char"
15156 if eval $compile; then
15157 case "`$run ./try`" in
15158 int8_t) i8type=int8_t
15168 '') if $test $charsize -ge 1; then
15170 u8type="unsigned char"
15178 '') case "$shortsize" in
15180 u16type="unsigned short"
15188 '') set try -DINT16
15189 if eval $compile; then
15190 case "`$run ./try`" in
15202 '') if $test $shortsize -ge 2; then
15204 u16type="unsigned short"
15212 '') case "$longsize" in
15214 u32type="unsigned long"
15218 *) case "$intsize" in
15220 u32type="unsigned int"
15230 '') set try -DINT32
15231 if eval $compile; then
15232 case "`$run ./try`" in
15244 '') if $test $intsize -ge 4; then
15246 u32type="unsigned int"
15254 '') case "$d_quad:$quadtype" in
15256 i64type="$quadtype"
15257 u64type="$uquadtype"
15265 $echo "Checking how many bits of your UVs your NVs can preserve..." >&4
15266 : volatile so that the compiler has to store it out to memory.
15267 if test X"$d_volatile" = X"$define"; then
15272 #$i_stdlib I_STDLIB
15274 #include <stdlib.h>
15276 #include <sys/types.h>
15277 #include <signal.h>
15279 $volatile int bletched = 0;
15280 $signal_t blech(int s) { bletched = 1; }
15285 int n = 8 * $uvsize;
15288 signal(SIGFPE, blech);
15291 for (i = 0; i < n; i++) {
15292 u = u << 1 | ($uvtype)1;
15294 if (($uvtype)d != u)
15298 d = ($nvtype)(u - 1);
15299 if (($uvtype)d != (u - 1))
15306 printf("%d\n", ((i == n) ? -n : i));
15312 d_nv_preserves_uv="$undef"
15313 if eval $compile; then
15314 nv_preserves_uv_bits="`$run ./try`"
15316 case "$nv_preserves_uv_bits" in
15318 nv_preserves_uv_bits=`expr 0 - $nv_preserves_uv_bits`
15319 $echo "Your NVs can preserve all $nv_preserves_uv_bits bits of your UVs." 2>&1
15320 d_nv_preserves_uv="$define"
15322 [1-9]*) $echo "Your NVs can preserve only $nv_preserves_uv_bits bits of your UVs." 2>&1
15323 d_nv_preserves_uv="$undef" ;;
15324 *) $echo "Can't figure out how many bits your NVs preserve." 2>&1
15325 nv_preserves_uv_bits="$undef" ;;
15330 $echo "Checking whether NV 0.0 is all bits zero in memory..." >&4
15331 : volatile so that the compiler has to store it out to memory.
15332 if test X"$d_volatile" = X"$define"; then
15337 #$i_stdlib I_STDLIB
15339 #include <stdlib.h>
15341 #$i_string I_STRING
15343 # include <string.h>
15345 # include <strings.h>
15347 #include <sys/types.h>
15348 #include <signal.h>
15350 $volatile int bletched = 0;
15351 $signal_t blech(int s) { bletched = 1; }
15354 int checkit($nvtype d, char *where) {
15355 unsigned char *p = (char *)&d;
15356 unsigned char *end = p + sizeof(d);
15366 printf("No - %s: 0x", where);
15368 printf ("%02X", *p++);
15373 int main(int argc, char **argv) {
15376 fail += checkit(d, "0.0");
15378 /* The compiler shouldn't be assuming that bletched is 0 */
15381 fail += checkit(d, "bleched");
15384 signal(SIGFPE, blech);
15387 /* Paranoia - the compiler should have no way of knowing that ANSI says
15388 that argv[argc] will always be NULL. Actually, if it did assume this it
15389 would be buggy, as this is C and main() can be called from elsewhere in
15391 d = argv[argc] ? 1 : 0;
15394 printf("Odd argv[argc]=%p, d=%g\n", argv[argc], d);
15397 fail += checkit(d, "ternary");
15399 memset(&d, sizeof(d), argv[argc] ? 1 : 0);
15402 printf("No - memset doesn't give 0.0\n");
15403 /* This might just blow up: */
15404 printf("(gives %g)\n", d);
15410 printf("No - something bleched\n");
15415 printf("No - %d fail(s)\n", fail);
15424 d_nv_zero_is_allbits_zero="$undef"
15425 if eval $compile; then
15431 0.0 is represented as all bits zero in memory
15433 d_nv_zero_is_allbits_zero="$define"
15436 0.0 is not represented as all bits zero in memory
15438 d_nv_zero_is_allbits_zero="$undef"
15443 0.0 is not represented as all bits zero in memory
15445 d_nv_zero_is_allbits_zero="$undef"
15453 : check for off64_t
15455 echo "Checking to see if you have off64_t..." >&4
15457 #include <sys/types.h>
15458 #include <unistd.h>
15459 int main() { off64_t x = 7; }
15462 if eval $compile; then
15464 echo "You have off64_t."
15467 echo "You do not have off64_t."
15468 case "$lseeksize" in
15469 8) echo "(Your off_t is 64 bits, so you could use that.)" ;;
15476 : how to create joinable pthreads
15477 if test "X$usethreads" = "X$define" -a "X$i_pthread" = "X$define"; then
15479 echo "Checking what constant to use for creating joinable pthreads..." >&4
15480 $cat >try.c <<'EOCP'
15481 #include <pthread.h>
15483 int detachstate = JOINABLE;
15486 set try -DJOINABLE=PTHREAD_CREATE_JOINABLE
15487 if eval $compile; then
15488 echo "You seem to use PTHREAD_CREATE_JOINABLE." >&4
15489 val="$undef" # Yes, undef.
15490 set d_old_pthread_create_joinable
15493 set old_pthread_create_joinable
15496 set try -DJOINABLE=PTHREAD_CREATE_UNDETACHED
15497 if eval $compile; then
15498 echo "You seem to use PTHREAD_CREATE_UNDETACHED." >&4
15500 set d_old_pthread_create_joinable
15502 val=PTHREAD_CREATE_UNDETACHED
15503 set old_pthread_create_joinable
15506 set try -DJOINABLE=__UNDETACHED
15507 if eval $compile; then
15508 echo "You seem to use __UNDETACHED." >&4
15510 set d_old_pthread_create_joinable
15513 set old_pthread_create_joinable
15516 echo "Egads, nothing obvious found. Guessing that you use 0." >&4
15518 set d_old_pthread_create_joinable
15521 set old_pthread_create_joinable
15528 d_old_pthread_create_joinable="$undef"
15529 old_pthread_create_joinable=""
15532 : see if pause exists
15536 : see if pipe exists
15540 : see if poll exists
15544 : see if readlink exists
15545 set readlink d_readlink
15551 case "$d_readlink" in
15553 if $issymlink /proc/self/exe ; then
15554 $ls -l /proc/self/exe > reflect
15555 if $contains /`basename $ls` reflect >/dev/null 2>&1; then
15556 echo "You have Linux-like /proc/self/exe."
15557 procselfexe='"/proc/self/exe"'
15561 if $issymlink /proc/curproc/file ; then
15562 $ls -l /proc/curproc/file > reflect
15563 if $contains /`basename $ls` reflect >/dev/null 2>&1; then
15564 echo "You have BSD-like /proc/curproc/file."
15565 procselfexe='"/proc/curproc/file"'
15575 : backward compatibility for d_hvfork
15576 if test X$d_hvfork != X; then
15577 d_vfork="$d_hvfork"
15580 : see if there is a vfork
15585 d_pseudofork=$undef
15587 : Ok, but do we want to use it. vfork is reportedly unreliable in
15588 : perl on Solaris 2.x, and probably elsewhere.
15592 case "$usevfork" in
15598 Perl can only use a vfork() that doesn't suffer from strict
15599 restrictions on calling functions or modifying global data in
15600 the child. For example, glibc-2.1 contains such a vfork()
15601 that is unsuitable. If your system provides a proper fork()
15602 call, chances are that you do NOT want perl to use vfork().
15605 rp="Do you still want to use vfork()?"
15610 echo "Ok, we won't use vfork()."
15619 $define) usevfork='true';;
15620 *) usevfork='false';;
15623 : see whether the pthread_atfork exists
15625 #include <pthread.h>
15628 #ifdef PTHREAD_ATFORK
15629 pthread_atfork(NULL,NULL,NULL);
15634 : see if pthread_atfork exists
15635 set try -DPTHREAD_ATFORK
15636 if eval $compile; then
15641 case "$usethreads" in
15644 $define) echo 'pthread_atfork found.' >&4 ;;
15645 *) echo 'pthread_atfork NOT found.' >&4 ;;
15648 set d_pthread_atfork
15651 : see if pthread_attr_setscope exists
15652 set pthread_attr_setscope d_pthread_attr_setscope
15656 : see whether the various POSIXish _yields exist
15658 #include <pthread.h>
15664 #ifdef PTHREAD_YIELD
15667 #ifdef PTHREAD_YIELD_NULL
15668 pthread_yield(NULL);
15674 : see if sched_yield exists
15675 set try -DSCHED_YIELD
15676 if eval $compile; then
15678 sched_yield='sched_yield()'
15682 case "$usethreads" in
15685 $define) echo 'sched_yield() found.' >&4 ;;
15686 *) echo 'sched_yield() NOT found.' >&4 ;;
15692 : see if pthread_yield exists
15693 set try -DPTHREAD_YIELD
15694 if eval $compile; then
15696 case "$sched_yield" in
15697 '') sched_yield='pthread_yield()' ;;
15700 set try -DPTHREAD_YIELD_NULL
15701 if eval $compile; then
15703 case "$sched_yield" in
15704 '') sched_yield='pthread_yield(NULL)' ;;
15710 case "$usethreads" in
15713 $define) echo 'pthread_yield() found.' >&4 ;;
15714 *) echo 'pthread_yield() NOT found.' >&4 ;;
15718 set d_pthread_yield
15721 case "$sched_yield" in
15722 '') sched_yield=undef ;;
15727 : see if random_r exists
15728 set random_r d_random_r
15730 case "$d_random_r" in
15732 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
15733 case "$d_random_r_proto:$usethreads" in
15734 ":define") d_random_r_proto=define
15735 set d_random_r_proto random_r $hdrs
15739 case "$d_random_r_proto" in
15741 case "$random_r_proto" in
15742 ''|0) try='int random_r(int*, struct random_data*);'
15743 ./protochk "extern $try" $hdrs && random_r_proto=I_iS ;;
15745 case "$random_r_proto" in
15746 ''|0) try='int random_r(long*, struct random_data*);'
15747 ./protochk "extern $try" $hdrs && random_r_proto=I_lS ;;
15749 case "$random_r_proto" in
15750 ''|0) try='int random_r(struct random_data*, int32_t*);'
15751 ./protochk "extern $try" $hdrs && random_r_proto=I_St ;;
15753 case "$random_r_proto" in
15754 ''|0) d_random_r=undef
15756 echo "Disabling random_r, cannot determine prototype." >&4 ;;
15757 * ) case "$random_r_proto" in
15758 REENTRANT_PROTO*) ;;
15759 *) random_r_proto="REENTRANT_PROTO_$random_r_proto" ;;
15761 echo "Prototype: $try" ;;
15764 *) case "$usethreads" in
15765 define) echo "random_r has no prototype, not using it." >&4 ;;
15772 *) random_r_proto=0
15776 : see if readdir and friends exist
15777 set readdir d_readdir
15779 set seekdir d_seekdir
15781 set telldir d_telldir
15783 set rewinddir d_rewinddir
15786 : see if readdir64_r exists
15787 set readdir64_r d_readdir64_r
15789 case "$d_readdir64_r" in
15791 hdrs="$i_systypes sys/types.h define stdio.h $i_dirent dirent.h"
15792 case "$d_readdir64_r_proto:$usethreads" in
15793 ":define") d_readdir64_r_proto=define
15794 set d_readdir64_r_proto readdir64_r $hdrs
15798 case "$d_readdir64_r_proto" in
15800 case "$readdir64_r_proto" in
15801 ''|0) try='int readdir64_r(DIR*, struct dirent64*, struct dirent64**);'
15802 ./protochk "extern $try" $hdrs && readdir64_r_proto=I_TSR ;;
15804 case "$readdir64_r_proto" in
15805 ''|0) try='int readdir64_r(DIR*, struct dirent64*);'
15806 ./protochk "extern $try" $hdrs && readdir64_r_proto=I_TS ;;
15808 case "$readdir64_r_proto" in
15809 ''|0) d_readdir64_r=undef
15810 readdir64_r_proto=0
15811 echo "Disabling readdir64_r, cannot determine prototype." >&4 ;;
15812 * ) case "$readdir64_r_proto" in
15813 REENTRANT_PROTO*) ;;
15814 *) readdir64_r_proto="REENTRANT_PROTO_$readdir64_r_proto" ;;
15816 echo "Prototype: $try" ;;
15819 *) case "$usethreads" in
15820 define) echo "readdir64_r has no prototype, not using it." >&4 ;;
15822 d_readdir64_r=undef
15823 readdir64_r_proto=0
15827 *) readdir64_r_proto=0
15831 : see if readdir_r exists
15832 set readdir_r d_readdir_r
15834 case "$d_readdir_r" in
15836 hdrs="$i_systypes sys/types.h define stdio.h $i_dirent dirent.h"
15837 case "$d_readdir_r_proto:$usethreads" in
15838 ":define") d_readdir_r_proto=define
15839 set d_readdir_r_proto readdir_r $hdrs
15843 case "$d_readdir_r_proto" in
15845 case "$readdir_r_proto" in
15846 ''|0) try='int readdir_r(DIR*, struct dirent*, struct dirent**);'
15847 ./protochk "extern $try" $hdrs && readdir_r_proto=I_TSR ;;
15849 case "$readdir_r_proto" in
15850 ''|0) try='int readdir_r(DIR*, struct dirent*);'
15851 ./protochk "extern $try" $hdrs && readdir_r_proto=I_TS ;;
15853 case "$readdir_r_proto" in
15854 ''|0) d_readdir_r=undef
15856 echo "Disabling readdir_r, cannot determine prototype." >&4 ;;
15857 * ) case "$readdir_r_proto" in
15858 REENTRANT_PROTO*) ;;
15859 *) readdir_r_proto="REENTRANT_PROTO_$readdir_r_proto" ;;
15861 echo "Prototype: $try" ;;
15864 *) case "$usethreads" in
15865 define) echo "readdir_r has no prototype, not using it." >&4 ;;
15872 *) readdir_r_proto=0
15876 : see if readv exists
15880 : see if recvmsg exists
15881 set recvmsg d_recvmsg
15884 : see if rename exists
15885 set rename d_rename
15888 : see if rmdir exists
15892 : see if memory.h is available.
15897 : See if it conflicts with string.h
15903 $cppstdin $cppflags $cppminus < $strings > mem.h
15904 if $contains 'memcpy' mem.h >/dev/null 2>&1; then
15906 echo "We won't be including <memory.h>."
15916 : can bcopy handle overlapping blocks?
15919 case "$d_memmove" in
15920 "$define") echo "I'll use memmove() instead of bcopy() for overlapping copies." ;;
15921 *) case "$d_bcopy" in
15923 echo "Checking to see if bcopy() can do overlapping copies..." >&4
15925 #$i_memory I_MEMORY
15926 #$i_stdlib I_STDLIB
15927 #$i_string I_STRING
15928 #$i_unistd I_UNISTD
15930 $cat >>try.c <<'EOCP'
15933 # include <memory.h>
15936 # include <stdlib.h>
15939 # include <string.h>
15941 # include <strings.h>
15944 # include <unistd.h> /* Needed for NetBSD */
15948 char buf[128], abc[128];
15954 /* Copy "abcde..." string to char abc[] so that gcc doesn't
15955 try to store the string in read-only memory. */
15956 bcopy("abcdefghijklmnopqrstuvwxyz0123456789", abc, 36);
15958 for (align = 7; align >= 0; align--) {
15959 for (len = 36; len; len--) {
15961 bcopy(abc, b, len);
15962 for (off = 1; off <= len; off++) {
15963 bcopy(b, b+off, len);
15964 bcopy(b+off, b, len);
15965 if (bcmp(b, abc, len))
15974 if eval $compile_ok; then
15975 if ./try 2>/dev/null; then
15976 echo "Yes, it can."
15979 echo "It can't, sorry."
15982 echo "(I can't compile the test program, so we'll assume not...)"
15986 $rm -f try.* try core
15992 : can memcpy handle overlapping blocks?
15995 case "$d_memmove" in
15996 "$define") echo "I'll use memmove() instead of memcpy() for overlapping copies." ;;
15997 *) case "$d_memcpy" in
15999 echo "Checking to see if memcpy() can do overlapping copies..." >&4
16001 #$i_memory I_MEMORY
16002 #$i_stdlib I_STDLIB
16003 #$i_string I_STRING
16004 #$i_unistd I_UNISTD
16006 $cat >>try.c <<'EOCP'
16009 # include <memory.h>
16012 # include <stdlib.h>
16015 # include <string.h>
16017 # include <strings.h>
16020 # include <unistd.h> /* Needed for NetBSD */
16024 char buf[128], abc[128];
16030 /* Copy "abcde..." string to char abc[] so that gcc doesn't
16031 try to store the string in read-only memory. */
16032 memcpy(abc, "abcdefghijklmnopqrstuvwxyz0123456789", 36);
16034 for (align = 7; align >= 0; align--) {
16035 for (len = 36; len; len--) {
16037 memcpy(b, abc, len);
16038 for (off = 1; off <= len; off++) {
16039 memcpy(b+off, b, len);
16040 memcpy(b, b+off, len);
16041 if (memcmp(b, abc, len))
16050 if eval $compile_ok; then
16051 if ./try 2>/dev/null; then
16052 echo "Yes, it can."
16055 echo "It can't, sorry."
16058 echo "(I can't compile the test program, so we'll assume not...)"
16062 $rm -f try.* try core
16068 : can memcmp be trusted to compare relative magnitude?
16070 case "$d_memcmp" in
16073 echo "Checking if your memcmp() can compare relative magnitude..." >&4
16075 #$i_memory I_MEMORY
16076 #$i_stdlib I_STDLIB
16077 #$i_string I_STRING
16078 #$i_unistd I_UNISTD
16080 $cat >>try.c <<'EOCP'
16083 # include <memory.h>
16086 # include <stdlib.h>
16089 # include <string.h>
16091 # include <strings.h>
16094 # include <unistd.h> /* Needed for NetBSD */
16100 if ((a < b) && memcmp(&a, &b, 1) < 0)
16106 if eval $compile_ok; then
16107 if $run ./try 2>/dev/null; then
16108 echo "Yes, it can."
16111 echo "No, it can't (it uses signed chars)."
16114 echo "(I can't compile the test program, so we'll assume not...)"
16118 $rm -f try.* try core
16122 : see if prototype for sbrk is available
16124 set d_sbrkproto sbrk $i_unistd unistd.h
16127 : see if select exists
16128 set select d_select
16131 : see if semctl exists
16132 set semctl d_semctl
16135 : see if semget exists
16136 set semget d_semget
16139 : see if semop exists
16143 : see how much of the 'sem*(2)' library is present.
16146 case "$d_semctl$d_semget$d_semop" in
16147 *"$undef"*) h_sem=false;;
16151 case "`ipcs 2>&1`" in
16152 "SVID messages"*"not configured"*)
16153 echo "Your $osname does not have the sem*(2) configured." >&4
16156 set semctl d_semctl
16158 set semget d_semget
16166 : we could also check for sys/ipc.h ...
16167 if $h_sem && $test `./findhdr sys/sem.h`; then
16168 echo "You have the full sem*(2) library." >&4
16171 echo "You don't have the full sem*(2) library." >&4
16177 : see whether sys/sem.h defines union semun
16179 $cat > try.c <<'END'
16180 #include <sys/types.h>
16181 #include <sys/ipc.h>
16182 #include <sys/sem.h>
16183 int main () { union semun semun; semun.buf = 0; }
16186 if eval $compile; then
16187 echo "You have union semun in <sys/sem.h>." >&4
16190 echo "You do not have union semun in <sys/sem.h>." >&4
16197 : see how to do semctl IPC_STAT
16204 # define S_IRUSR S_IREAD
16205 # define S_IWUSR S_IWRITE
16206 # define S_IXUSR S_IEXEC
16208 # define S_IRUSR 0400
16209 # define S_IWUSR 0200
16210 # define S_IXUSR 0100
16212 # define S_IRGRP (S_IRUSR>>3)
16213 # define S_IWGRP (S_IWUSR>>3)
16214 # define S_IXGRP (S_IXUSR>>3)
16215 # define S_IROTH (S_IRUSR>>6)
16216 # define S_IWOTH (S_IWUSR>>6)
16217 # define S_IXOTH (S_IXUSR>>6)
16220 # define S_IRWXU (S_IRUSR|S_IWUSR|S_IXUSR)
16221 # define S_IRWXG (S_IRGRP|S_IWGRP|S_IXGRP)
16222 # define S_IRWXO (S_IROTH|S_IWOTH|S_IXOTH)
16225 : see whether semctl IPC_STAT can use union semun
16226 case "$d_semctl_semun" in
16230 #include <sys/types.h>
16231 #include <sys/ipc.h>
16232 #include <sys/sem.h>
16233 #include <sys/stat.h>
16240 #$d_union_semun HAS_UNION_SEMUN
16243 #ifndef HAS_UNION_SEMUN
16246 struct semid_ds *buf;
16247 unsigned short *array;
16253 #if defined(IPC_PRIVATE) && defined(S_IRWXU) && defined(S_IRWXG) && defined(S_IRWXO) && defined(IPC_CREAT)
16254 sem = semget(IPC_PRIVATE, 1, S_IRWXU|S_IRWXG|S_IRWXO|IPC_CREAT);
16256 struct semid_ds argbuf;
16259 st = semctl(sem, 0, IPC_STAT, arg);
16263 # endif /* IPC_STAT */
16264 printf("semctl IPC_STAT failed: errno = %d\n", errno);
16266 if (semctl(sem, 0, IPC_RMID, arg) != 0)
16267 # endif /* IPC_RMID */
16268 printf("semctl IPC_RMID failed: errno = %d\n", errno);
16270 #endif /* IPC_PRIVATE && ... */
16271 printf("semget failed: errno = %d\n", errno);
16276 if eval $compile; then
16279 semun) val="$define" ;;
16287 case "$d_semctl_semun" in
16289 echo "You can use union semun for semctl IPC_STAT." >&4
16292 *) echo "You cannot use union semun for semctl IPC_STAT." >&4
16297 : see whether semctl IPC_STAT can use struct semid_ds pointer
16298 case "$d_semctl_semid_ds" in
16301 $cat > try.c <<'END'
16302 #include <sys/types.h>
16303 #include <sys/ipc.h>
16304 #include <sys/sem.h>
16305 #include <sys/stat.h>
16313 struct semid_ds arg;
16316 #if defined(IPC_PRIVATE) && defined(S_IRWXU) && defined(S_IRWXG) && defined(S_IRWXO) && defined(IPC_CREAT)
16317 sem = semget(IPC_PRIVATE, 1, S_IRWXU|S_IRWXG|S_IRWXO|IPC_CREAT);
16320 st = semctl(sem, 0, IPC_STAT, &arg);
16322 printf("semid_ds\n");
16324 # endif /* IPC_STAT */
16325 printf("semctl IPC_STAT failed: errno = %d\n", errno);
16327 if (semctl(sem, 0, IPC_RMID, &arg) != 0)
16328 # endif /* IPC_RMID */
16329 printf("semctl IPC_RMID failed: errno = %d\n", errno);
16331 #endif /* IPC_PRIVATE && ... */
16332 printf("semget failed: errno = %d\n", errno);
16338 if eval $compile; then
16341 semid_ds) val="$define" ;;
16345 set d_semctl_semid_ds
16349 case "$d_semctl_semid_ds" in
16351 echo "You can $also use struct semid_ds* for semctl IPC_STAT." >&4
16353 *) echo "You cannot use struct semid_ds* for semctl IPC_STAT." >&4
16360 # We do not have the full sem*(2) library, so assume we can not
16366 set d_semctl_semid_ds
16371 : see if sendmsg exists
16372 set sendmsg d_sendmsg
16375 : see if setegid exists
16376 set setegid d_setegid
16379 : see if seteuid exists
16380 set seteuid d_seteuid
16383 : see if setgrent exists
16384 set setgrent d_setgrent
16387 : see if setgrent_r exists
16388 set setgrent_r d_setgrent_r
16390 case "$d_setgrent_r" in
16392 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
16393 case "$d_setgrent_r_proto:$usethreads" in
16394 ":define") d_setgrent_r_proto=define
16395 set d_setgrent_r_proto setgrent_r $hdrs
16399 case "$d_setgrent_r_proto" in
16401 case "$setgrent_r_proto" in
16402 ''|0) try='int setgrent_r(FILE**);'
16403 ./protochk "extern $try" $hdrs && setgrent_r_proto=I_H ;;
16405 case "$setgrent_r_proto" in
16406 ''|0) try='void setgrent_r(FILE**);'
16407 ./protochk "extern $try" $hdrs && setgrent_r_proto=V_H ;;
16409 case "$setgrent_r_proto" in
16410 ''|0) d_setgrent_r=undef
16412 echo "Disabling setgrent_r, cannot determine prototype." >&4 ;;
16413 * ) case "$setgrent_r_proto" in
16414 REENTRANT_PROTO*) ;;
16415 *) setgrent_r_proto="REENTRANT_PROTO_$setgrent_r_proto" ;;
16417 echo "Prototype: $try" ;;
16420 *) case "$usethreads" in
16421 define) echo "setgrent_r has no prototype, not using it." >&4 ;;
16428 *) setgrent_r_proto=0
16432 : see if sethostent exists
16433 set sethostent d_sethent
16436 : see if sethostent_r exists
16437 set sethostent_r d_sethostent_r
16439 case "$d_sethostent_r" in
16441 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
16442 case "$d_sethostent_r_proto:$usethreads" in
16443 ":define") d_sethostent_r_proto=define
16444 set d_sethostent_r_proto sethostent_r $hdrs
16448 case "$d_sethostent_r_proto" in
16450 case "$sethostent_r_proto" in
16451 ''|0) try='int sethostent_r(int, struct hostent_data*);'
16452 ./protochk "extern $try" $hdrs && sethostent_r_proto=I_ID ;;
16454 case "$sethostent_r_proto" in
16455 ''|0) try='void sethostent_r(int, struct hostent_data*);'
16456 ./protochk "extern $try" $hdrs && sethostent_r_proto=V_ID ;;
16458 case "$sethostent_r_proto" in
16459 ''|0) d_sethostent_r=undef
16460 sethostent_r_proto=0
16461 echo "Disabling sethostent_r, cannot determine prototype." >&4 ;;
16462 * ) case "$sethostent_r_proto" in
16463 REENTRANT_PROTO*) ;;
16464 *) sethostent_r_proto="REENTRANT_PROTO_$sethostent_r_proto" ;;
16466 echo "Prototype: $try" ;;
16469 *) case "$usethreads" in
16470 define) echo "sethostent_r has no prototype, not using it." >&4 ;;
16472 d_sethostent_r=undef
16473 sethostent_r_proto=0
16477 *) sethostent_r_proto=0
16481 : see if setitimer exists
16482 set setitimer d_setitimer
16485 : see if setlinebuf exists
16486 set setlinebuf d_setlinebuf
16489 : see if setlocale exists
16490 set setlocale d_setlocale
16493 : see if locale.h is available
16494 set locale.h i_locale
16497 : see if setlocale_r exists
16498 set setlocale_r d_setlocale_r
16500 case "$d_setlocale_r" in
16502 hdrs="$i_systypes sys/types.h define stdio.h $i_locale locale.h"
16503 case "$d_setlocale_r_proto:$usethreads" in
16504 ":define") d_setlocale_r_proto=define
16505 set d_setlocale_r_proto setlocale_r $hdrs
16509 case "$d_setlocale_r_proto" in
16511 case "$setlocale_r_proto" in
16512 ''|0) try='int setlocale_r(int, const char*, char*, int);'
16513 ./protochk "extern $try" $hdrs && setlocale_r_proto=I_ICBI ;;
16515 case "$setlocale_r_proto" in
16516 ''|0) d_setlocale_r=undef
16517 setlocale_r_proto=0
16518 echo "Disabling setlocale_r, cannot determine prototype." >&4 ;;
16519 * ) case "$setlocale_r_proto" in
16520 REENTRANT_PROTO*) ;;
16521 *) setlocale_r_proto="REENTRANT_PROTO_$setlocale_r_proto" ;;
16523 echo "Prototype: $try" ;;
16526 *) case "$usethreads" in
16527 define) echo "setlocale_r has no prototype, not using it." >&4 ;;
16529 d_setlocale_r=undef
16530 setlocale_r_proto=0
16534 *) setlocale_r_proto=0
16538 : see if setnetent exists
16539 set setnetent d_setnent
16542 : see if setnetent_r exists
16543 set setnetent_r d_setnetent_r
16545 case "$d_setnetent_r" in
16547 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
16548 case "$d_setnetent_r_proto:$usethreads" in
16549 ":define") d_setnetent_r_proto=define
16550 set d_setnetent_r_proto setnetent_r $hdrs
16554 case "$d_setnetent_r_proto" in
16556 case "$setnetent_r_proto" in
16557 ''|0) try='int setnetent_r(int, struct netent_data*);'
16558 ./protochk "extern $try" $hdrs && setnetent_r_proto=I_ID ;;
16560 case "$setnetent_r_proto" in
16561 ''|0) try='void setnetent_r(int, struct netent_data*);'
16562 ./protochk "extern $try" $hdrs && setnetent_r_proto=V_ID ;;
16564 case "$setnetent_r_proto" in
16565 ''|0) d_setnetent_r=undef
16566 setnetent_r_proto=0
16567 echo "Disabling setnetent_r, cannot determine prototype." >&4 ;;
16568 * ) case "$setnetent_r_proto" in
16569 REENTRANT_PROTO*) ;;
16570 *) setnetent_r_proto="REENTRANT_PROTO_$setnetent_r_proto" ;;
16572 echo "Prototype: $try" ;;
16575 *) case "$usethreads" in
16576 define) echo "setnetent_r has no prototype, not using it." >&4 ;;
16578 d_setnetent_r=undef
16579 setnetent_r_proto=0
16583 *) setnetent_r_proto=0
16587 : see if setprotoent exists
16588 set setprotoent d_setpent
16591 : see if setpgid exists
16592 set setpgid d_setpgid
16595 : see if setpgrp2 exists
16596 set setpgrp2 d_setpgrp2
16599 : see if setpriority exists
16600 set setpriority d_setprior
16603 : see if setproctitle exists
16604 set setproctitle d_setproctitle
16607 : see if setprotoent_r exists
16608 set setprotoent_r d_setprotoent_r
16610 case "$d_setprotoent_r" in
16612 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
16613 case "$d_setprotoent_r_proto:$usethreads" in
16614 ":define") d_setprotoent_r_proto=define
16615 set d_setprotoent_r_proto setprotoent_r $hdrs
16619 case "$d_setprotoent_r_proto" in
16621 case "$setprotoent_r_proto" in
16622 ''|0) try='int setprotoent_r(int, struct protoent_data*);'
16623 ./protochk "extern $try" $hdrs && setprotoent_r_proto=I_ID ;;
16625 case "$setprotoent_r_proto" in
16626 ''|0) try='void setprotoent_r(int, struct protoent_data*);'
16627 ./protochk "extern $try" $hdrs && setprotoent_r_proto=V_ID ;;
16629 case "$setprotoent_r_proto" in
16630 ''|0) d_setprotoent_r=undef
16631 setprotoent_r_proto=0
16632 echo "Disabling setprotoent_r, cannot determine prototype." >&4 ;;
16633 * ) case "$setprotoent_r_proto" in
16634 REENTRANT_PROTO*) ;;
16635 *) setprotoent_r_proto="REENTRANT_PROTO_$setprotoent_r_proto" ;;
16637 echo "Prototype: $try" ;;
16640 *) case "$usethreads" in
16641 define) echo "setprotoent_r has no prototype, not using it." >&4 ;;
16643 d_setprotoent_r=undef
16644 setprotoent_r_proto=0
16648 *) setprotoent_r_proto=0
16652 : see if setpwent exists
16653 set setpwent d_setpwent
16656 : see if setpwent_r exists
16657 set setpwent_r d_setpwent_r
16659 case "$d_setpwent_r" in
16661 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
16662 case "$d_setpwent_r_proto:$usethreads" in
16663 ":define") d_setpwent_r_proto=define
16664 set d_setpwent_r_proto setpwent_r $hdrs
16668 case "$d_setpwent_r_proto" in
16670 case "$setpwent_r_proto" in
16671 ''|0) try='int setpwent_r(FILE**);'
16672 ./protochk "extern $try" $hdrs && setpwent_r_proto=I_H ;;
16674 case "$setpwent_r_proto" in
16675 ''|0) try='void setpwent_r(FILE**);'
16676 ./protochk "extern $try" $hdrs && setpwent_r_proto=V_H ;;
16678 case "$setpwent_r_proto" in
16679 ''|0) d_setpwent_r=undef
16681 echo "Disabling setpwent_r, cannot determine prototype." >&4 ;;
16682 * ) case "$setpwent_r_proto" in
16683 REENTRANT_PROTO*) ;;
16684 *) setpwent_r_proto="REENTRANT_PROTO_$setpwent_r_proto" ;;
16686 echo "Prototype: $try" ;;
16689 *) case "$usethreads" in
16690 define) echo "setpwent_r has no prototype, not using it." >&4 ;;
16697 *) setpwent_r_proto=0
16701 : see if setregid exists
16702 set setregid d_setregid
16704 set setresgid d_setresgid
16707 : see if setreuid exists
16708 set setreuid d_setreuid
16710 set setresuid d_setresuid
16713 : see if setrgid exists
16714 set setrgid d_setrgid
16717 : see if setruid exists
16718 set setruid d_setruid
16721 : see if setservent exists
16722 set setservent d_setsent
16725 : see if setservent_r exists
16726 set setservent_r d_setservent_r
16728 case "$d_setservent_r" in
16730 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
16731 case "$d_setservent_r_proto:$usethreads" in
16732 ":define") d_setservent_r_proto=define
16733 set d_setservent_r_proto setservent_r $hdrs
16737 case "$d_setservent_r_proto" in
16739 case "$setservent_r_proto" in
16740 ''|0) try='int setservent_r(int, struct servent_data*);'
16741 ./protochk "extern $try" $hdrs && setservent_r_proto=I_ID ;;
16743 case "$setservent_r_proto" in
16744 ''|0) try='void setservent_r(int, struct servent_data*);'
16745 ./protochk "extern $try" $hdrs && setservent_r_proto=V_ID ;;
16747 case "$setservent_r_proto" in
16748 ''|0) d_setservent_r=undef
16749 setservent_r_proto=0
16750 echo "Disabling setservent_r, cannot determine prototype." >&4 ;;
16751 * ) case "$setservent_r_proto" in
16752 REENTRANT_PROTO*) ;;
16753 *) setservent_r_proto="REENTRANT_PROTO_$setservent_r_proto" ;;
16755 echo "Prototype: $try" ;;
16758 *) case "$usethreads" in
16759 define) echo "setservent_r has no prototype, not using it." >&4 ;;
16761 d_setservent_r=undef
16762 setservent_r_proto=0
16766 *) setservent_r_proto=0
16770 : see if setsid exists
16771 set setsid d_setsid
16774 : see if setvbuf exists
16775 set setvbuf d_setvbuf
16778 : see if sfio.h is available
16783 : see if sfio library is available
16794 : Ok, but do we want to use it.
16798 true|$define|[yY]*) dflt='y';;
16801 echo "$package can use the sfio library, but it is experimental."
16802 case "$useperlio" in
16804 echo "For sfio also the PerlIO abstraction layer is needed."
16805 echo "Earlier you said you wouldn't want that."
16808 rp="You seem to have sfio available, do you want to try using it?"
16811 y|Y) echo "Ok, turning on both sfio and PerlIO, then."
16812 useperlio="$define"
16815 *) echo "Ok, avoiding sfio this time. I'll use stdio instead."
16820 *) case "$usesfio" in
16821 true|$define|[yY]*)
16822 echo "Sorry, cannot find sfio on this machine." >&4
16823 echo "Ignoring your setting of usesfio=$usesfio." >&4
16832 $define) usesfio='true';;
16833 *) usesfio='false';;
16837 *) : Remove sfio from list of libraries to use
16840 echo "Removing unneeded -lsfio from library list" >&4
16841 set `echo X $libs | $sed -e 's/-lsfio / /' -e 's/-lsfio$//'`
16844 echo "libs = $libs" >&4
16851 : see if shmctl exists
16852 set shmctl d_shmctl
16855 : see if shmget exists
16856 set shmget d_shmget
16859 : see if shmat exists
16862 : see what shmat returns
16865 $cat >shmat.c <<'END'
16866 #include <sys/shm.h>
16869 if $cc $ccflags -c shmat.c >/dev/null 2>&1; then
16874 echo "and it returns ($shmattype)." >&4
16875 : see if a prototype for shmat is available
16876 xxx=`./findhdr sys/shm.h`
16877 $cppstdin $cppflags $cppminus < $xxx > shmat.c 2>/dev/null
16878 if $contains 'shmat.*(' shmat.c >/dev/null 2>&1; then
16889 set d_shmatprototype
16892 : see if shmdt exists
16896 : see how much of the 'shm*(2)' library is present.
16899 case "$d_shmctl$d_shmget$d_shmat$d_shmdt" in
16900 *"$undef"*) h_shm=false;;
16904 case "`ipcs 2>&1`" in
16905 "SVID shared memory"*"not configured"*)
16906 echo "Your $osname does not have the shm*(2) configured." >&4
16909 set shmctl d_shmctl
16911 set shmget d_shmget
16921 : we could also check for sys/ipc.h ...
16922 if $h_shm && $test `./findhdr sys/shm.h`; then
16923 echo "You have the full shm*(2) library." >&4
16926 echo "You don't have the full shm*(2) library." >&4
16933 : see if we have sigaction
16934 if set sigaction val -f d_sigaction; eval $csym; $val; then
16935 echo 'sigaction() found.' >&4
16938 #include <sys/types.h>
16939 #include <signal.h>
16940 #$i_stdlib I_STDLIB
16942 #include <stdlib.h>
16946 struct sigaction act, oact;
16948 oact.sa_handler = 0;
16949 /* so that act and oact are used */
16950 exit(act.sa_flags == 0 && oact.sa_handler == 0);
16954 if eval $compile_ok; then
16957 echo "But you don't seem to have a useable struct sigaction." >&4
16961 echo 'sigaction NOT found.' >&4
16964 set d_sigaction; eval $setvar
16965 $rm -f try try$_o try.c
16967 : see if sigprocmask exists
16968 set sigprocmask d_sigprocmask
16971 : see if sigsetjmp exists
16973 case "$d_sigsetjmp" in
16976 #include <setjmp.h>
16977 #$i_stdlib I_STDLIB
16979 #include <stdlib.h>
16985 if (sigsetjmp(env,1))
16988 siglongjmp(env, 1);
16993 if eval $compile; then
16994 if $run ./try >/dev/null 2>&1; then
16995 echo "POSIX sigsetjmp found." >&4
16999 Uh-Oh! You have POSIX sigsetjmp and siglongjmp, but they do not work properly!!
17005 echo "sigsetjmp not found." >&4
17009 *) val="$d_sigsetjmp"
17010 case "$d_sigsetjmp" in
17011 $define) echo "POSIX sigsetjmp found." >&4;;
17012 $undef) echo "sigsetjmp not found." >&4;;
17020 : see if snprintf exists
17021 set snprintf d_snprintf
17024 : see if vsnprintf exists
17025 set vsnprintf d_vsnprintf
17028 case "$d_snprintf-$d_vsnprintf" in
17031 Checking whether your snprintf() and vsnprintf() work okay...
17033 $cat >try.c <<'EOCP'
17034 /* v?snprintf testing logic courtesy of Russ Allbery.
17035 * According to C99:
17036 * - if the buffer is too short it still must be \0-terminated
17037 * - if the buffer is too short the potentially required length
17038 * must be returned and not -1
17039 * - if the buffer is NULL the potentially required length
17040 * must be returned and not -1 or core dump
17043 #include <stdarg.h>
17047 int test (char *format, ...)
17052 va_start (args, format);
17053 count = vsnprintf (buf, sizeof buf, format, args);
17060 return ((test ("%s", "abcd") == 4 && buf[0] == 'a' && buf[1] == '\0'
17061 && snprintf (NULL, 0, "%s", "abcd") == 4) ? 0 : 1);
17065 if eval $compile; then
17068 0) echo "Your snprintf() and vsnprintf() seem to be working okay." ;;
17070 Your snprintf() and snprintf() don't seem to be working okay.
17072 d_snprintf="$undef"
17073 d_vsnprintf="$undef"
17077 echo "(I can't seem to compile the test program--assuming they don't)"
17078 d_snprintf="$undef"
17079 d_vsnprintf="$undef"
17081 $rm -f try.* try core core.try.*
17085 : see if sockatmark exists
17086 set sockatmark d_sockatmark
17089 : see if prototype for sockatmark is available
17091 set d_sockatmarkproto sockatmark $d_socket sys/socket.h
17094 : see if socks5_init exists
17095 set socks5_init d_socks5_init
17098 : see if sprintf returns the length of the string in the buffer as per ANSI
17099 $echo "Checking whether sprintf returns the length of the string..." >&4
17102 #$i_stdlib I_STDLIB
17104 #include <stdlib.h>
17106 #$i_string I_STRING
17108 # include <string.h>
17110 # include <strings.h>
17119 int check (size_t expect, int test) {
17120 size_t got = strlen(buffer);
17124 printf("expected %ld, got %ld in test %d '%s'\n", (long) expect, (long) got,
17129 int main(int argc, char **argv) {
17132 check(sprintf(buffer, ""), ++test);
17133 check(sprintf(buffer, "%s %s", "perl", "rules"), ++test);
17134 check(sprintf(buffer, "I like %g", atan2(0,-1)), ++test);
17141 d_sprintf_returns_strlen="$undef"
17142 if eval $compile; then
17146 sprintf returns the length of the string (as ANSI says it should)
17148 d_sprintf_returns_strlen="$define"
17151 sprintf does not return the length of the string (how old is this system?)
17153 d_sprintf_returns_strlen="$undef"
17160 : see if srand48_r exists
17161 set srand48_r d_srand48_r
17163 case "$d_srand48_r" in
17165 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
17166 case "$d_srand48_r_proto:$usethreads" in
17167 ":define") d_srand48_r_proto=define
17168 set d_srand48_r_proto srand48_r $hdrs
17172 case "$d_srand48_r_proto" in
17174 case "$srand48_r_proto" in
17175 ''|0) try='int srand48_r(long, struct drand48_data*);'
17176 ./protochk "extern $try" $hdrs && srand48_r_proto=I_LS ;;
17178 case "$srand48_r_proto" in
17179 ''|0) d_srand48_r=undef
17181 echo "Disabling srand48_r, cannot determine prototype." >&4 ;;
17182 * ) case "$srand48_r_proto" in
17183 REENTRANT_PROTO*) ;;
17184 *) srand48_r_proto="REENTRANT_PROTO_$srand48_r_proto" ;;
17186 echo "Prototype: $try" ;;
17189 *) case "$usethreads" in
17190 define) echo "srand48_r has no prototype, not using it." >&4 ;;
17197 *) srand48_r_proto=0
17201 : see if srandom_r exists
17202 set srandom_r d_srandom_r
17204 case "$d_srandom_r" in
17206 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
17207 case "$d_srandom_r_proto:$usethreads" in
17208 ":define") d_srandom_r_proto=define
17209 set d_srandom_r_proto srandom_r $hdrs
17213 case "$d_srandom_r_proto" in
17215 case "$srandom_r_proto" in
17216 ''|0) try='int srandom_r(unsigned int, struct random_data*);'
17217 ./protochk "extern $try" $hdrs && srandom_r_proto=I_TS ;;
17219 case "$srandom_r_proto" in
17220 ''|0) d_srandom_r=undef
17222 echo "Disabling srandom_r, cannot determine prototype." >&4 ;;
17223 * ) case "$srandom_r_proto" in
17224 REENTRANT_PROTO*) ;;
17225 *) srandom_r_proto="REENTRANT_PROTO_$srandom_r_proto" ;;
17227 echo "Prototype: $try" ;;
17230 *) case "$usethreads" in
17231 define) echo "srandom_r has no prototype, not using it." >&4 ;;
17238 *) srandom_r_proto=0
17242 : see if prototype for setresgid is available
17244 set d_sresgproto setresgid $i_unistd unistd.h
17247 : see if prototype for setresuid is available
17249 set d_sresuproto setresuid $i_unistd unistd.h
17252 : see if sys/stat.h is available
17253 set sys/stat.h i_sysstat
17257 : see if stat knows about block sizes
17259 echo "Checking to see if your struct stat has st_blocks field..." >&4
17260 set d_statblks stat st_blocks $i_sysstat sys/stat.h
17264 : see if this is a sys/vfs.h system
17265 set sys/vfs.h i_sysvfs
17269 : see if this is a sys/statfs.h system
17270 set sys/statfs.h i_sysstatfs
17275 echo "Checking to see if your system supports struct statfs..." >&4
17276 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
17278 case "$d_statfs_s" in
17279 "$define") echo "Yes, it does." ;;
17280 *) echo "No, it doesn't." ;;
17285 : see if struct statfs knows about f_flags
17286 case "$d_statfs_s" in
17289 echo "Checking to see if your struct statfs has f_flags field..." >&4
17290 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
17294 set d_statfs_f_flags
17298 case "$d_statfs_f_flags" in
17299 "$define") echo "Yes, it does." ;;
17300 *) echo "No, it doesn't." ;;
17304 Checking how to access stdio streams by file descriptor number...
17306 case "$stdio_stream_array" in
17307 '') $cat >try.c <<EOCP
17310 if (&STDIO_STREAM_ARRAY[fileno(stdin)] == stdin)
17314 for s in _iob __iob __sF
17316 set try -DSTDIO_STREAM_ARRAY=$s
17317 if eval $compile; then
17318 case "`$run ./try`" in
17319 yes) stdio_stream_array=$s; break ;;
17323 $rm -f try.* try$exe_ext
17325 case "$stdio_stream_array" in
17327 I can't figure out how to access stdio streams by file descriptor number.
17329 d_stdio_stream_array="$undef"
17332 You can access stdio streams by file descriptor number by the $stdio_stream_array array.
17334 d_stdio_stream_array="$define"
17338 : see if strcoll exists
17339 set strcoll d_strcoll
17342 : check for structure copying
17344 echo "Checking to see if your C compiler can copy structs..." >&4
17345 $cat >try.c <<'EOCP'
17355 if $cc -c try.c >/dev/null 2>&1 ; then
17357 echo "Yup, it can."
17360 echo "Nope, it can't."
17366 : see if strerror and/or sys_errlist[] exist
17368 if test "X$d_strerror" = X -o "X$d_syserrlst" = X; then
17369 if set strerror val -f d_strerror; eval $csym; $val; then
17370 echo 'strerror() found.' >&4
17371 d_strerror="$define"
17372 d_strerrm='strerror(e)'
17373 if set sys_errlist val -a d_syserrlst; eval $csym; $val; then
17374 echo "(You also have sys_errlist[], so we could roll our own strerror.)"
17375 d_syserrlst="$define"
17377 echo "(Since you don't have sys_errlist[], sterror() is welcome.)"
17378 d_syserrlst="$undef"
17380 elif xxx=`./findhdr string.h`; test "$xxx" || xxx=`./findhdr strings.h`; \
17381 $contains '#[ ]*define.*strerror' "$xxx" >/dev/null 2>&1; then
17382 echo 'strerror() found in string header.' >&4
17383 d_strerror="$define"
17384 d_strerrm='strerror(e)'
17385 if set sys_errlist val -a d_syserrlst; eval $csym; $val; then
17386 echo "(Most probably, strerror() uses sys_errlist[] for descriptions.)"
17387 d_syserrlst="$define"
17389 echo "(You don't appear to have any sys_errlist[], how can this be?)"
17390 d_syserrlst="$undef"
17392 elif set sys_errlist val -a d_syserrlst; eval $csym; $val; then
17393 echo "strerror() not found, but you have sys_errlist[] so we'll use that." >&4
17394 d_strerror="$undef"
17395 d_syserrlst="$define"
17396 d_strerrm='((e)<0||(e)>=sys_nerr?"unknown":sys_errlist[e])'
17398 echo 'strerror() and sys_errlist[] NOT found.' >&4
17399 d_strerror="$undef"
17400 d_syserrlst="$undef"
17401 d_strerrm='"unknown"'
17405 : see if strerror_r exists
17406 set strerror_r d_strerror_r
17408 case "$d_strerror_r" in
17410 hdrs="$i_systypes sys/types.h define stdio.h $i_string string.h"
17411 case "$d_strerror_r_proto:$usethreads" in
17412 ":define") d_strerror_r_proto=define
17413 set d_strerror_r_proto strerror_r $hdrs
17417 case "$d_strerror_r_proto" in
17419 case "$strerror_r_proto" in
17420 ''|0) try='int strerror_r(int, char*, size_t);'
17421 ./protochk "extern $try" $hdrs && strerror_r_proto=I_IBW ;;
17423 case "$strerror_r_proto" in
17424 ''|0) try='int strerror_r(int, char*, int);'
17425 ./protochk "extern $try" $hdrs && strerror_r_proto=I_IBI ;;
17427 case "$strerror_r_proto" in
17428 ''|0) try='char* strerror_r(int, char*, size_t);'
17429 ./protochk "extern $try" $hdrs && strerror_r_proto=B_IBW ;;
17431 case "$strerror_r_proto" in
17432 ''|0) d_strerror_r=undef
17434 echo "Disabling strerror_r, cannot determine prototype." >&4 ;;
17435 * ) case "$strerror_r_proto" in
17436 REENTRANT_PROTO*) ;;
17437 *) strerror_r_proto="REENTRANT_PROTO_$strerror_r_proto" ;;
17439 echo "Prototype: $try" ;;
17442 *) case "$usethreads" in
17443 define) echo "strerror_r has no prototype, not using it." >&4 ;;
17450 *) strerror_r_proto=0
17454 : see if strftime exists
17455 set strftime d_strftime
17458 : see if strlcat exists
17459 set strlcat d_strlcat
17462 : see if strlcpy exists
17463 set strlcpy d_strlcpy
17466 : see if strtod exists
17467 set strtod d_strtod
17470 : see if strtol exists
17471 set strtol d_strtol
17474 : see if strtold exists
17475 set strtold d_strtold
17478 : see if strtoll exists
17479 set strtoll d_strtoll
17482 case "$d_longlong-$d_strtoll" in
17485 Checking whether your strtoll() works okay...
17487 $cat >try.c <<'EOCP'
17490 #define strtoll __strtoll
17493 #define strtoll _strtoll
17496 extern long long int strtoll(char *s, char **, int);
17497 static int bad = 0;
17498 int check(char *s, long long ell, int een) {
17501 gll = strtoll(s, 0, 10);
17502 if (!((gll == ell) && (errno == een)))
17506 check(" 1", 1LL, 0);
17507 check(" 0", 0LL, 0);
17508 check("-1", -1LL, 0);
17509 check("-9223372036854775808", -9223372036854775808LL, 0);
17510 check("-9223372036854775808", -9223372036854775808LL, 0);
17511 check(" 9223372036854775807", 9223372036854775807LL, 0);
17512 check("-9223372036854775808", -9223372036854775808LL, 0);
17513 check(" 9223372036854775808", 9223372036854775807LL, ERANGE);
17514 check("-9223372036854775809", -9223372036854775808LL, ERANGE);
17520 if eval $compile; then
17523 ok) echo "Your strtoll() seems to be working okay." ;;
17525 Your strtoll() doesn't seem to be working okay.
17531 echo "(I can't seem to compile the test program--assuming it doesn't)"
17537 : see if strtoq exists
17538 set strtoq d_strtoq
17541 : see if strtoul exists
17542 set strtoul d_strtoul
17545 case "$d_strtoul" in
17548 Checking whether your strtoul() works okay...
17550 $cat >try.c <<'EOCP'
17553 extern unsigned long int strtoul(char *s, char **, int);
17554 static int bad = 0;
17555 void check(char *s, unsigned long eul, int een) {
17558 gul = strtoul(s, 0, 10);
17559 if (!((gul == eul) && (errno == een)))
17563 check(" 1", 1L, 0);
17564 check(" 0", 0L, 0);
17566 case "$longsize" in
17568 $cat >>try.c <<'EOCP'
17569 check("18446744073709551615", 18446744073709551615UL, 0);
17570 check("18446744073709551616", 18446744073709551615UL, ERANGE);
17571 #if 0 /* strtoul() for /^-/ strings is undefined. */
17572 check("-1", 18446744073709551615UL, 0);
17573 check("-18446744073709551614", 2, 0);
17574 check("-18446744073709551615", 1, 0);
17575 check("-18446744073709551616", 18446744073709551615UL, ERANGE);
17576 check("-18446744073709551617", 18446744073709551615UL, ERANGE);
17581 $cat >>try.c <<'EOCP'
17582 check("4294967295", 4294967295UL, 0);
17583 check("4294967296", 4294967295UL, ERANGE);
17584 #if 0 /* strtoul() for /^-/ strings is undefined. */
17585 check("-1", 4294967295UL, 0);
17586 check("-4294967294", 2, 0);
17587 check("-4294967295", 1, 0);
17588 check("-4294967296", 4294967295UL, ERANGE);
17589 check("-4294967297", 4294967295UL, ERANGE);
17594 : Should we write these tests to be more portable by sprintf-ing
17595 : ~0 and then manipulating that char string as input for strtol?
17598 $cat >>try.c <<'EOCP'
17605 if eval $compile; then
17606 case "`$run ./try`" in
17607 ok) echo "Your strtoul() seems to be working okay." ;;
17609 Your strtoul() doesn't seem to be working okay.
17618 : see if strtoull exists
17619 set strtoull d_strtoull
17622 case "$d_longlong-$d_strtoull" in
17625 Checking whether your strtoull() works okay...
17627 $cat >try.c <<'EOCP'
17630 #define strtoull __strtoull
17633 extern unsigned long long int strtoull(char *s, char **, int);
17634 static int bad = 0;
17635 int check(char *s, long long eull, int een) {
17638 gull = strtoull(s, 0, 10);
17639 if (!((gull == eull) && (errno == een)))
17643 check(" 1", 1LL, 0);
17644 check(" 0", 0LL, 0);
17645 check("18446744073709551615", 18446744073709551615ULL, 0);
17646 check("18446744073709551616", 18446744073709551615ULL, ERANGE);
17647 #if 0 /* strtoull() for /^-/ strings is undefined. */
17648 check("-1", 18446744073709551615ULL, 0);
17649 check("-18446744073709551614", 2LL, 0);
17650 check("-18446744073709551615", 1LL, 0);
17651 check("-18446744073709551616", 18446744073709551615ULL, ERANGE);
17652 check("-18446744073709551617", 18446744073709551615ULL, ERANGE);
17659 if eval $compile; then
17660 case "`$run ./try`" in
17661 ok) echo "Your strtoull() seems to be working okay." ;;
17663 Your strtoull() doesn't seem to be working okay.
17665 d_strtoull="$undef"
17672 : see if strtouq exists
17673 set strtouq d_strtouq
17676 case "$d_strtouq" in
17679 Checking whether your strtouq() works okay...
17681 $cat >try.c <<'EOCP'
17684 extern unsigned long long int strtouq(char *s, char **, int);
17685 static int bad = 0;
17686 void check(char *s, unsigned long long eull, int een) {
17687 unsigned long long gull;
17689 gull = strtouq(s, 0, 10);
17690 if (!((gull == eull) && (errno == een)))
17694 check(" 1", 1LL, 0);
17695 check(" 0", 0LL, 0);
17696 check("18446744073709551615", 18446744073709551615ULL, 0);
17697 check("18446744073709551616", 18446744073709551615ULL, ERANGE);
17698 #if 0 /* strtouq() for /^-/ strings is undefined. */
17699 check("-1", 18446744073709551615ULL, 0);
17700 check("-18446744073709551614", 2LL, 0);
17701 check("-18446744073709551615", 1LL, 0);
17702 check("-18446744073709551616", 18446744073709551615ULL, ERANGE);
17703 check("-18446744073709551617", 18446744073709551615ULL, ERANGE);
17711 if eval $compile; then
17712 case "`$run ./try`" in
17713 ok) echo "Your strtouq() seems to be working okay." ;;
17715 Your strtouq() doesn't seem to be working okay.
17724 : see if strxfrm exists
17725 set strxfrm d_strxfrm
17728 : see if symlink exists
17729 set symlink d_symlink
17732 : see if syscall exists
17733 set syscall d_syscall
17736 : see if prototype for syscall is available
17738 set d_syscallproto syscall $i_unistd unistd.h
17741 : see if sysconf exists
17742 set sysconf d_sysconf
17745 : see if system exists
17746 set system d_system
17749 : see if tcgetpgrp exists
17750 set tcgetpgrp d_tcgetpgrp
17753 : see if tcsetpgrp exists
17754 set tcsetpgrp d_tcsetpgrp
17757 : see if prototype for telldir is available
17759 set d_telldirproto telldir $i_systypes sys/types.h $i_dirent dirent.h
17762 : see if time exists
17764 if test "X$d_time" = X -o X"$timetype" = X; then
17765 if set time val -f d_time; eval $csym; $val; then
17766 echo 'time() found.' >&4
17768 rp="What is the type returned by time() on this system?"
17769 set time_t timetype long stdio.h sys/types.h
17772 echo 'time() not found, hope that will do.' >&4
17780 : see if this is a sys/times.h system
17781 set sys/times.h i_systimes
17784 : see if times exists
17786 if set times val -f d_times; eval $csym; $val; then
17787 echo 'times() found.' >&4
17790 case "$i_systimes" in
17791 "$define") inc='sys/times.h';;
17793 rp="What is the type returned by times() on this system?"
17794 set clock_t clocktype long stdio.h sys/types.h $inc
17797 echo 'times() NOT found, hope that will do.' >&4
17802 : see if tmpnam_r exists
17803 set tmpnam_r d_tmpnam_r
17805 case "$d_tmpnam_r" in
17807 hdrs="$i_systypes sys/types.h define stdio.h "
17808 case "$d_tmpnam_r_proto:$usethreads" in
17809 ":define") d_tmpnam_r_proto=define
17810 set d_tmpnam_r_proto tmpnam_r $hdrs
17814 case "$d_tmpnam_r_proto" in
17816 case "$tmpnam_r_proto" in
17817 ''|0) try='char* tmpnam_r(char*);'
17818 ./protochk "extern $try" $hdrs && tmpnam_r_proto=B_B ;;
17820 case "$tmpnam_r_proto" in
17821 ''|0) d_tmpnam_r=undef
17823 echo "Disabling tmpnam_r, cannot determine prototype." >&4 ;;
17824 * ) case "$tmpnam_r_proto" in
17825 REENTRANT_PROTO*) ;;
17826 *) tmpnam_r_proto="REENTRANT_PROTO_$tmpnam_r_proto" ;;
17828 echo "Prototype: $try" ;;
17831 *) case "$usethreads" in
17832 define) echo "tmpnam_r has no prototype, not using it." >&4 ;;
17839 *) tmpnam_r_proto=0
17843 : see if truncate exists
17844 set truncate d_truncate
17847 : see if ttyname_r exists
17848 set ttyname_r d_ttyname_r
17850 case "$d_ttyname_r" in
17852 hdrs="$i_systypes sys/types.h define stdio.h $i_unistd unistd.h"
17853 case "$d_ttyname_r_proto:$usethreads" in
17854 ":define") d_ttyname_r_proto=define
17855 set d_ttyname_r_proto ttyname_r $hdrs
17859 case "$d_ttyname_r_proto" in
17861 case "$ttyname_r_proto" in
17862 ''|0) try='int ttyname_r(int, char*, size_t);'
17863 ./protochk "extern $try" $hdrs && ttyname_r_proto=I_IBW ;;
17865 case "$ttyname_r_proto" in
17866 ''|0) try='int ttyname_r(int, char*, int);'
17867 ./protochk "extern $try" $hdrs && ttyname_r_proto=I_IBI ;;
17869 case "$ttyname_r_proto" in
17870 ''|0) try='char* ttyname_r(int, char*, int);'
17871 ./protochk "extern $try" $hdrs && ttyname_r_proto=B_IBI ;;
17873 case "$ttyname_r_proto" in
17874 ''|0) d_ttyname_r=undef
17876 echo "Disabling ttyname_r, cannot determine prototype." >&4 ;;
17877 * ) case "$ttyname_r_proto" in
17878 REENTRANT_PROTO*) ;;
17879 *) ttyname_r_proto="REENTRANT_PROTO_$ttyname_r_proto" ;;
17881 echo "Prototype: $try" ;;
17884 *) case "$usethreads" in
17885 define) echo "ttyname_r has no prototype, not using it." >&4 ;;
17892 *) ttyname_r_proto=0
17896 : see if tzname[] exists
17898 if set tzname val -a d_tzname; eval $csym; $val; then
17900 echo 'tzname[] found.' >&4
17903 echo 'tzname[] NOT found.' >&4
17909 next|rhapsody|darwin) multiarch="$define" ;;
17911 case "$multiarch" in
17912 ''|[nN]*) multiarch="$undef" ;;
17915 : check for ordering of bytes in a UV
17917 case "$usecrosscompile$multiarch" in
17920 You seem to be either cross-compiling or doing a multiarchitecture build,
17921 skipping the byteorder check.
17927 case "$byteorder" in
17930 In the following, larger digits indicate more significance. A big-endian
17931 machine like a Pyramid or a Motorola 680?0 chip will come out to 4321. A
17932 little-endian machine like a Vax or an Intel 80?86 chip would be 1234. Other
17933 machines may have weird orders like 3412. A Cray will report 87654321,
17934 an Alpha will report 12345678. If the test program works the default is
17936 I'm now running the test program...
17940 #$i_stdlib I_STDLIB
17942 #include <stdlib.h>
17944 #include <sys/types.h>
17945 typedef $uvtype UV;
17955 u.l = (((UV)0x08070605) << 32) | (UV)0x04030201;
17957 u.l = (UV)0x04030201;
17958 for (i = 0; i < $uvsize; i++)
17959 printf("%c", u.c[i]+'0');
17966 if eval $compile && ./try > /dev/null; then
17969 [1-4][1-4][1-4][1-4]|12345678|87654321)
17970 echo "(The test program ran ok.)"
17971 echo "byteorder=$dflt"
17974 ????|????????) echo "(The test program ran ok.)" ;;
17975 *) echo "(The test program didn't run right for some reason.)" ;;
17980 (I can't seem to compile the test program. Guessing big-endian...)
17983 case "$xxx_prompt" in
17985 rp="What is the order of bytes in $uvtype?"
18001 Checking to see whether you can access character data unalignedly...
18003 case "$d_u32align" in
18004 '') $cat >try.c <<EOCP
18006 #$i_stdlib I_STDLIB
18008 #include <stdlib.h>
18010 #define U32 $u32type
18011 #define BYTEORDER 0x$byteorder
18013 #include <signal.h>
18015 $signal_t bletch(int s) { exit(4); }
18018 #if BYTEORDER == 0x1234 || BYTEORDER == 0x4321
18023 if (sizeof(U32) != 4) {
18024 printf("sizeof(U32) is not 4, but %d\n", sizeof(U32));
18031 signal(SIGBUS, bletch);
18043 for (i = 0; i < 4; i++) {
18044 up = (U32*)(buf + i);
18045 if (! ((*up == 1 << (8*i)) || /* big-endian */
18046 (*up == 1 << (8*(3-i))) /* little-endian */
18050 printf("read failed (%x)\n", *up);
18056 for (i = 0; i < 4; i++) {
18057 up = (U32*)(buf + i);
18059 if (*up != 0xBeef) {
18060 printf("write failed (%x)\n", *up);
18074 if eval $compile_ok; then
18075 echo "(Testing for character data alignment may crash the test. That's okay.)" >&4
18076 $run ./try 2>&1 >/dev/null
18079 You can access character data pretty unalignedly.
18081 d_u32align="$undef"
18084 It seems that you must access character data in an aligned manner.
18086 d_u32align="$define"
18090 rp='Can you access character data at unaligned addresses?'
18094 [yY]*) d_u32align="$undef" ;;
18095 *) d_u32align="$define" ;;
18098 $rm -f core core.try.* try.core
18102 : see if ualarm exists
18103 set ualarm d_ualarm
18106 : see if umask exists
18110 : see if unordered exists
18111 set unordered d_unordered
18114 : see if unsetenv exists
18115 set unsetenv d_unsetenv
18118 : see if usleep exists
18119 set usleep d_usleep
18122 : see if prototype for usleep is available
18124 set d_usleepproto usleep $i_unistd unistd.h
18127 : see if ustat exists
18131 : see if closedir exists
18132 set closedir d_closedir
18135 case "$d_closedir" in
18138 echo "Checking whether closedir() returns a status..." >&4
18140 #$i_dirent I_DIRENT /**/
18141 #$i_sysdir I_SYS_DIR /**/
18142 #$i_sysndir I_SYS_NDIR /**/
18143 #$i_systypes I_SYS_TYPES /**/
18145 #if defined(I_SYS_TYPES)
18146 #include <sys/types.h>
18148 #if defined(I_DIRENT)
18149 #include <dirent.h>
18150 #if defined(NeXT) && defined(I_SYS_DIR) /* NeXT needs dirent + sys/dir.h */
18151 #include <sys/dir.h>
18155 #include <sys/ndir.h>
18159 #include <ndir.h> /* may be wrong in the future */
18161 #include <sys/dir.h>
18166 int main() { return closedir(opendir(".")); }
18169 if eval $compile_ok; then
18170 if $run ./try > /dev/null 2>&1 ; then
18171 echo "Yes, it does."
18174 echo "No, it doesn't."
18178 echo "(I can't seem to compile the test program--assuming it doesn't)"
18186 set d_void_closedir
18189 : see if there is a wait4
18193 : see if waitpid exists
18194 set waitpid d_waitpid
18197 : see if wcstombs exists
18198 set wcstombs d_wcstombs
18201 : see if wctomb exists
18202 set wctomb d_wctomb
18205 : see if writev exists
18206 set writev d_writev
18209 : preserve RCS keywords in files with variable substitution, grrr
18214 Revision='$Revision'
18216 : check for alignment requirements
18218 case "$usecrosscompile$multiarch" in
18221 You seem to be either cross-compiling or doing a multiarchitecture build,
18222 skipping the memory alignment check.
18225 case "$alignbytes" in
18226 '') alignbytes=8 ;;
18230 case "$alignbytes" in
18231 '') echo "Checking alignment constraints..." >&4
18232 if $test "X$uselongdouble" = Xdefine -a "X$d_longdbl" = Xdefine; then
18233 $cat >try.c <<'EOCP'
18234 typedef long double NV;
18237 $cat >try.c <<'EOCP'
18241 $cat >>try.c <<'EOCP'
18249 printf("%d\n", (int)((char *)&try_algn.bar - (char *)&try_algn.foo));
18254 if eval $compile_ok; then
18258 echo "(I can't seem to compile the test program...)"
18261 *) dflt="$alignbytes"
18264 rp="Doubles must be aligned on a how-many-byte boundary?"
18272 : set the base revision
18275 : how do we concatenate cpp tokens here?
18277 echo "Checking to see how your cpp does stuff like concatenate tokens..." >&4
18278 $cat >cpp_stuff.c <<'EOCP'
18279 #define RCAT(a,b)a/**/b
18280 #define ACAT(a,b)a ## b
18284 $cppstdin $cppflags $cppminus <cpp_stuff.c >cpp_stuff.out 2>&1
18285 if $contains 'Circus' cpp_stuff.out >/dev/null 2>&1; then
18286 echo "Oh! Smells like ANSI's been here." >&4
18287 echo "We can catify or stringify, separately or together!"
18289 elif $contains 'Reiser' cpp_stuff.out >/dev/null 2>&1; then
18290 echo "Ah, yes! The good old days!" >&4
18291 echo "However, in the good old days we don't know how to stringify and"
18292 echo "catify at the same time."
18296 Hmm, I don't seem to be able to concatenate tokens with your cpp.
18297 You're going to have to edit the values of CAT[2-5] in config.h...
18299 cpp_stuff="/* Help! How do we handle cpp_stuff? */*/"
18303 : see if this is a db.h system
18309 : Check db version.
18311 echo "Checking Berkeley DB version ..." >&4
18317 #include <sys/types.h>
18319 #$i_stdlib I_STDLIB
18321 #include <stdlib.h>
18324 int main(int argc, char *argv[])
18326 #ifdef DB_VERSION_MAJOR /* DB version >= 2 */
18327 int Major, Minor, Patch ;
18328 unsigned long Version ;
18329 (void)db_version(&Major, &Minor, &Patch) ;
18331 printf("%d %d %d %d %d %d\n",
18332 DB_VERSION_MAJOR, DB_VERSION_MINOR, DB_VERSION_PATCH,
18333 Major, Minor, Patch);
18336 printf("You have Berkeley DB Version 2 or greater.\n");
18338 printf("db.h is from Berkeley DB Version %d.%d.%d\n",
18339 DB_VERSION_MAJOR, DB_VERSION_MINOR, DB_VERSION_PATCH);
18340 printf("libdb is from Berkeley DB Version %d.%d.%d\n",
18341 Major, Minor, Patch) ;
18343 /* check that db.h & libdb are compatible */
18344 if (DB_VERSION_MAJOR != Major || DB_VERSION_MINOR != Minor || DB_VERSION_PATCH != Patch) {
18345 printf("db.h and libdb are incompatible.\n") ;
18349 printf("db.h and libdb are compatible.\n") ;
18351 Version = DB_VERSION_MAJOR * 1000000 + DB_VERSION_MINOR * 1000
18352 + DB_VERSION_PATCH ;
18354 /* needs to be >= 2.3.4 */
18355 if (Version < 2003004) {
18356 /* if (DB_VERSION_MAJOR == 2 && DB_VERSION_MINOR == 0 && DB_VERSION_PATCH < 5) { */
18357 printf("Perl needs Berkeley DB 2.3.4 or greater.\n") ;
18363 #if defined(_DB_H_) && defined(BTREEMAGIC) && defined(HASHMAGIC)
18368 printf("You have Berkeley DB Version 1.\n");
18369 exit(0); /* DB version < 2: the coast is clear. */
18371 exit(1); /* <db.h> not Berkeley DB? */
18377 if eval $compile_ok && $run ./try; then
18378 echo 'Looks OK.' >&4
18380 db_version_major=$1
18381 db_version_minor=$2
18382 db_version_patch=$3
18384 echo "I can't use Berkeley DB with your <db.h>. I'll disable Berkeley DB." >&4
18388 : Remove db from list of libraries to use
18389 echo "Removing unusable -ldb from library list" >&4
18390 set `echo X $libs | $sed -e 's/-ldb / /' -e 's/-ldb$//'`
18393 echo "libs = $libs" >&4
18403 : Check the return type needed for hash
18405 echo "Checking return type needed for hash for Berkeley DB ..." >&4
18411 #include <sys/types.h>
18414 #ifndef DB_VERSION_MAJOR
18415 u_int32_t hash_cb (ptr, size)
18423 info.hash = hash_cb;
18427 if $cc $ccflags -c try.c >try.out 2>&1 ; then
18428 if $contains warning try.out >>/dev/null 2>&1 ; then
18431 db_hashtype='u_int32_t'
18434 : XXX Maybe we should just give up here.
18435 db_hashtype=u_int32_t
18437 echo "Help: I can't seem to compile the db test program." >&4
18438 echo "Something's wrong, but I'll assume you use $db_hashtype." >&4
18441 echo "Your version of Berkeley DB uses $db_hashtype for hash."
18443 *) db_hashtype=u_int32_t
18448 : Check the return type needed for prefix
18450 echo "Checking return type needed for prefix for Berkeley DB ..." >&4
18456 #include <sys/types.h>
18459 #ifndef DB_VERSION_MAJOR
18460 size_t prefix_cb (key1, key2)
18468 info.prefix = prefix_cb;
18472 if $cc $ccflags -c try.c >try.out 2>&1 ; then
18473 if $contains warning try.out >>/dev/null 2>&1 ; then
18474 db_prefixtype='int'
18476 db_prefixtype='size_t'
18479 db_prefixtype='size_t'
18480 : XXX Maybe we should just give up here.
18482 echo "Help: I can't seem to compile the db test program." >&4
18483 echo "Something's wrong, but I'll assume you use $db_prefixtype." >&4
18486 echo "Your version of Berkeley DB uses $db_prefixtype for prefix."
18488 *) db_prefixtype='size_t'
18493 : How can we generate normalized random numbers ?
18495 echo "Looking for a random number function..." >&4
18496 case "$randfunc" in
18498 if set drand48 val -f; eval $csym; $val; then
18500 echo "Good, found drand48()." >&4
18501 elif set random val -f; eval $csym; $val; then
18503 echo "OK, found random()." >&4
18506 echo "Yick, looks like I have to use rand()." >&4
18517 *-Dmy_rand=*|*-Dmy_srand=*)
18518 echo "Removing obsolete -Dmy_rand, -Dmy_srand, and -Drandbits from ccflags." >&4
18519 ccflags="`echo $ccflags | sed -e 's/-Dmy_rand=random/ /'`"
18520 ccflags="`echo $ccflags | sed -e 's/-Dmy_srand=srandom/ /'`"
18521 ccflags="`echo $ccflags | sed -e 's/-Drandbits=[0-9][0-9]*/ /'`"
18525 while $test "$cont"; do
18526 rp="Use which function to generate random numbers?"
18528 if $test "$ans" = "$dflt"; then
18534 if set $ans val -f; eval $csym; $val; then
18538 rp="I cannot find function $ans. Use that name anyway?"
18547 case "$randfunc" in
18549 drand01="drand48()"
18555 case "$randbits" in
18557 echo "Checking to see how many bits your $randfunc() function produces..." >&4
18559 #$i_unistd I_UNISTD
18560 #$i_stdlib I_STDLIB
18563 # include <unistd.h>
18566 # include <stdlib.h>
18571 register unsigned long tmp;
18572 register unsigned long max = 0L;
18574 for (i = 1000; i; i--) {
18575 tmp = (unsigned long) $randfunc();
18576 if (tmp > max) max = tmp;
18578 for (i = 0; max; i++)
18584 if eval $compile_ok; then
18588 echo "(I can't seem to compile the test program...)"
18595 rp="How many bits does your $randfunc() function produce?"
18599 drand01="($randfunc() / (double) ((unsigned long)1 << $randbits))"
18600 seedfunc="s$randfunc"
18601 randseedtype=unsigned
18605 rp="How many bits does your $randfunc() function produce?"
18608 seedfunc="s$randfunc"
18609 drand01="($randfunc() / (double) ((unsigned long)1 << $randbits))"
18610 if set $seedfunc val -f; eval $csym; $val; then
18611 echo "(Using $seedfunc() to seed random generator)"
18613 echo "(Warning: no $seedfunc() to seed random generator)"
18616 randseedtype=unsigned
18624 echo "Determining whether or not we are on an EBCDIC system..." >&4
18625 $cat >try.c <<'EOM'
18628 if ('M'==0xd4) return 0;
18635 if eval $compile_ok; then
18636 if $run ./try; then
18637 echo "You seem to speak EBCDIC." >&4
18640 echo "Nope, no EBCDIC, probably ASCII or some ISO Latin. Or UTF-8." >&4
18643 echo "I'm unable to compile the test program." >&4
18644 echo "I'll assume ASCII or some ISO Latin. Or UTF8." >&4
18652 Checking how to flush all pending stdio output...
18654 # I only know how to find the first 32 possibly open files on SunOS.
18655 # See also hints/sunos_4_1.sh and util.c --AD
18657 sunos) $echo '#define PERL_FFLUSH_ALL_FOPEN_MAX 32' > try.c ;;
18659 $cat >>try.c <<EOCP
18661 #$i_stdlib I_STDLIB
18663 #include <stdlib.h>
18665 #$i_unistd I_UNISTD
18667 # include <unistd.h>
18669 #$d_sysconf HAS_SYSCONF
18670 #$d_stdio_stream_array HAS_STDIO_STREAM_ARRAY
18671 #ifdef HAS_STDIO_STREAM_ARRAY
18672 # define STDIO_STREAM_ARRAY $stdio_stream_array
18677 p = fopen("try.out", "w");
18681 # ifdef TRY_FPRINTF
18685 #ifdef TRY_FFLUSH_NULL
18688 #ifdef TRY_FFLUSH_ALL
18690 long open_max = -1;
18691 # ifdef PERL_FFLUSH_ALL_FOPEN_MAX
18692 open_max = PERL_FFLUSH_ALL_FOPEN_MAX;
18694 # if defined(HAS_SYSCONF) && defined(_SC_OPEN_MAX)
18695 open_max = sysconf(_SC_OPEN_MAX);
18698 open_max = FOPEN_MAX;
18701 open_max = OPEN_MAX;
18710 # ifdef HAS_STDIO_STREAM_ARRAY
18711 if (open_max > 0) {
18713 for (i = 0; i < open_max; i++)
18714 if (STDIO_STREAM_ARRAY[i]._file >= 0 &&
18715 STDIO_STREAM_ARRAY[i]._file < open_max &&
18716 STDIO_STREAM_ARRAY[i]._flag)
18717 fflush(&STDIO_STREAM_ARRAY[i]);
18725 : first we have to find out how _not_ to flush
18727 if $test "X$fflushNULL" = X -o "X$fflushall" = X; then
18729 set try -DTRY_FPUTC
18730 if eval $compile; then
18731 $run ./try 2>/dev/null
18734 if $test ! -s try.out -a "X$code" = X42; then
18740 set try -DTRY_FPRINTF
18741 if eval $compile; then
18742 $run ./try 2>/dev/null
18745 if $test ! -s try.out -a "X$code" = X42; then
18746 output=-DTRY_FPRINTF
18752 : check for fflush NULL behaviour
18753 case "$fflushNULL" in
18754 '') set try -DTRY_FFLUSH_NULL $output
18755 if eval $compile; then
18756 $run ./try 2>/dev/null
18759 if $test -s try.out -a "X$code" = X42; then
18760 fflushNULL="`$cat try.out`"
18762 if $test "X$code" != X42; then
18764 (If this test failed, don't worry, we'll try another method shortly.)
18769 $rm -f core try.core core.try.*
18770 case "$fflushNULL" in
18772 Your fflush(NULL) works okay for output streams.
18773 Let's see if it clobbers input pipes...
18775 # As of mid-March 2000 all versions of Solaris appear to have a stdio
18776 # bug that improperly flushes the input end of pipes. So we avoid the
18777 # autoflush on fork/system/exec support for now. :-(
18778 $cat >tryp.c <<EOCP
18781 main(int argc, char **argv)
18787 while ((i = getc(stdin)) != -1
18788 && (*bp++ = i) != '\n'
18789 && bp < &buf[1024])
18792 fprintf(stdout, "%s", buf);
18800 fflushNULL="$define"
18802 if eval $compile; then
18804 $cat tryp.c | $run ./tryp 2>/dev/null > tryp.out
18805 if cmp tryp.c tryp.out >/dev/null 2>&1; then
18807 fflush(NULL) seems to behave okay with input streams.
18809 fflushNULL="$define"
18812 Ouch, fflush(NULL) clobbers input pipes! We will not use it.
18814 fflushNULL="$undef"
18817 $rm -f core tryp.c tryp.core core.tryp.*
18820 Your fflush(NULL) isn't working (contrary to ANSI C).
18822 fflushNULL="$undef"
18825 Cannot figure out whether your fflush(NULL) works or not.
18826 I'm assuming it doesn't (contrary to ANSI C).
18828 fflushNULL="$undef"
18832 $define|true|[yY]*)
18833 fflushNULL="$define"
18836 fflushNULL="$undef"
18839 : check explicit looping only if NULL did not work, and if the pipe
18840 : bug does not show up on an explicit flush too
18841 case "$fflushNULL" in
18843 $cat >tryp.c <<EOCP
18846 main(int argc, char **argv)
18852 while ((i = getc(stdin)) != -1
18853 && (*bp++ = i) != '\n'
18854 && bp < &buf[1024])
18857 fprintf(stdout, "%s", buf);
18866 if eval $compile; then
18868 $cat tryp.c | $run ./tryp 2>/dev/null > tryp.out
18869 if cmp tryp.c tryp.out >/dev/null 2>&1; then
18871 Good, at least fflush(stdin) seems to behave okay when stdin is a pipe.
18873 : now check for fflushall behaviour
18874 case "$fflushall" in
18875 '') set try -DTRY_FFLUSH_ALL $output
18876 if eval $compile; then
18878 (Now testing the other method--but note that this also may fail.)
18880 $run ./try 2>/dev/null
18883 if $test -s try.out -a "X$code" = X42; then
18884 fflushall="`$cat try.out`"
18887 $rm -f core try.core core.try.*
18888 case "$fflushall" in
18890 Whew. Flushing explicitly all the stdio streams works.
18892 fflushall="$define"
18895 Sigh. Flushing explicitly all the stdio streams doesn't work.
18900 Cannot figure out whether flushing stdio streams explicitly works or not.
18901 I'm assuming it doesn't.
18907 "$define"|true|[yY]*)
18908 fflushall="$define"
18916 All is futile. Even fflush(stdin) clobbers input pipes!
18923 $rm -f core tryp.c tryp.core core.tryp.*
18925 *) fflushall="$undef"
18929 case "$fflushNULL$fflushall" in
18932 OK, I give up. I cannot figure out how to flush pending stdio output.
18933 We won't be flushing handles at all before fork/exec/popen.
18937 $rm -f try.* try$exe_ext
18939 : Store the full pathname to the ar program for use in the C program
18940 : Respect a hint or command line value for full_ar.
18945 : Store the full pathname to the sed program for use in the C program
18948 : see what type gids are declared as in the kernel
18950 echo "Looking for the type for group ids returned by getgid()."
18951 set gid_t gidtype xxx stdio.h sys/types.h
18955 xxx=`./findhdr sys/user.h`
18956 set `grep 'groups\[NGROUPS\];' "$xxx" 2>/dev/null` unsigned short
18958 unsigned) dflt="$1 $2" ;;
18962 *) dflt="$gidtype";;
18965 gid_t) echo "gid_t found." ;;
18966 *) rp="What is the type for group ids returned by getgid()?"
18974 *_t) zzz="$gidtype" ;;
18977 echo "Checking the size of $zzz..." >&4
18979 #include <sys/types.h>
18981 #$i_stdlib I_STDLIB
18983 #include <stdlib.h>
18986 printf("%d\n", (int)sizeof($gidtype));
18991 if eval $compile_ok; then
18995 echo "(I can't execute the test program--guessing $gidsize.)" >&4
18998 echo "Your $zzz is $gidsize bytes long."
19003 echo "(I can't compile the test program--guessing $gidsize.)" >&4
19009 *_t) zzz="$gidtype" ;;
19012 echo "Checking the sign of $zzz..." >&4
19014 #include <sys/types.h>
19025 if eval $compile; then
19029 echo "(I can't execute the test program--guessing unsigned.)" >&4
19033 1) echo "Your $zzz is unsigned." ;;
19034 -1) echo "Your $zzz is signed." ;;
19040 echo "(I can't compile the test program--guessing unsigned.)" >&4
19046 if $test X"$quadtype" != X; then
19048 echo "Checking how to print 64-bit integers..." >&4
19050 if $test X"$sPRId64" = X -a X"$quadtype" = Xint; then
19051 $cat >try.c <<'EOCP'
19052 #include <sys/types.h>
19055 int q = 12345678901;
19056 printf("%ld\n", q);
19060 if eval $compile; then
19064 sPRId64='"d"'; sPRIi64='"i"'; sPRIu64='"u"';
19065 sPRIo64='"o"'; sPRIx64='"x"'; sPRIXU64='"X"';
19066 echo "We will use %d."
19072 if $test X"$sPRId64" = X -a X"$quadtype" = Xlong; then
19073 $cat >try.c <<'EOCP'
19074 #include <sys/types.h>
19077 long q = 12345678901;
19078 printf("%ld\n", q);
19082 if eval $compile; then
19086 sPRId64='"ld"'; sPRIi64='"li"'; sPRIu64='"lu"';
19087 sPRIo64='"lo"'; sPRIx64='"lx"'; sPRIXU64='"lX"';
19088 echo "We will use %ld."
19094 if $test X"$sPRId64" = X -a X"$i_inttypes" = X"$define" -a X"$quadtype" = Xint64_t; then
19095 $cat >try.c <<'EOCP'
19096 #include <sys/types.h>
19097 #include <inttypes.h>
19100 int64_t q = 12345678901;
19101 printf("%" PRId64 "\n", q);
19105 if eval $compile; then
19109 sPRId64=PRId64; sPRIi64=PRIi64; sPRIu64=PRIu64;
19110 sPRIo64=PRIo64; sPRIx64=PRIx64; sPRIXU64=PRIXU64;
19111 echo "We will use the C9X style."
19117 if $test X"$sPRId64" = X -a X"$quadtype" != X; then
19119 #include <sys/types.h>
19122 $quadtype q = 12345678901;
19123 printf("%Ld\n", q);
19127 if eval $compile; then
19131 sPRId64='"Ld"'; sPRIi64='"Li"'; sPRIu64='"Lu"';
19132 sPRIo64='"Lo"'; sPRIx64='"Lx"'; sPRIXU64='"LX"';
19133 echo "We will use %Ld."
19139 if $test X"$sPRId64" = X -a X"$quadtype" = X"long long"; then
19140 $cat >try.c <<'EOCP'
19141 #include <sys/types.h>
19144 long long q = 12345678901LL; /* AIX cc requires the LL suffix. */
19145 printf("%lld\n", q);
19149 if eval $compile; then
19153 sPRId64='"lld"'; sPRIi64='"lli"'; sPRIu64='"llu"';
19154 sPRIo64='"llo"'; sPRIx64='"llx"'; sPRIXU64='"llX"';
19155 echo "We will use the %lld style."
19161 if $test X"$sPRId64" = X -a X"$quadtype" != X; then
19163 #include <sys/types.h>
19166 $quadtype q = 12345678901;
19167 printf("%qd\n", q);
19171 if eval $compile; then
19175 sPRId64='"qd"'; sPRIi64='"qi"'; sPRIu64='"qu"';
19176 sPRIo64='"qo"'; sPRIx64='"qx"'; sPRIXU64='"qX"';
19177 echo "We will use %qd."
19183 if $test X"$sPRId64" = X; then
19184 echo "Cannot figure out how to print 64-bit integers." >&4
19192 '') d_PRId64="$undef"; d_PRIi64="$undef"; d_PRIu64="$undef";
19193 d_PRIo64="$undef"; d_PRIx64="$undef"; d_PRIXU64="$undef";
19195 *) d_PRId64="$define"; d_PRIi64="$define"; d_PRIu64="$define";
19196 d_PRIo64="$define"; d_PRIx64="$define"; d_PRIXU64="$define";
19202 $echo "Checking the format strings to be used for Perl's internal types..." >&4
19204 if $test X"$ivsize" = X8; then
19205 ivdformat="$sPRId64"
19206 uvuformat="$sPRIu64"
19207 uvoformat="$sPRIo64"
19208 uvxformat="$sPRIx64"
19209 uvXUformat="$sPRIXU64"
19211 if $test X"$ivsize" = X"$longsize"; then
19218 if $test X"$ivsize" = X"$intsize"; then
19226 if $test X"$ivsize" = X"$shortsize"; then
19237 if $test X"$uselongdouble" = X"$define" -a X"$d_longdbl" = X"$define" -a X"$d_PRIgldbl" = X"$define"; then
19238 nveformat="$sPRIeldbl"
19239 nvfformat="$sPRIfldbl"
19240 nvgformat="$sPRIgldbl"
19241 nvEUformat="$sPRIEUldbl"
19242 nvFUformat="$sPRIFUldbl"
19243 nvGUformat="$sPRIGUldbl"
19253 case "$ivdformat" in
19254 '') echo "$0: Fatal: failed to find format strings, cannot continue." >&4
19261 $echo "Checking the format string to be used for gids..." >&4
19264 -1) if $test X"$gidsize" = X"$ivsize"; then
19265 gidformat="$ivdformat"
19267 if $test X"$gidsize" = X"$longsize"; then
19270 if $test X"$gidsize" = X"$intsize"; then
19273 if $test X"$gidsize" = X"$shortsize"; then
19280 *) if $test X"$gidsize" = X"$uvsize"; then
19281 gidformat="$uvuformat"
19283 if $test X"$gidsize" = X"$longsize"; then
19286 if $test X"$gidsize" = X"$intsize"; then
19289 if $test X"$gidsize" = X"$shortsize"; then
19298 : see if getgroups exists
19299 set getgroups d_getgrps
19302 : see if setgroups exists
19303 set setgroups d_setgrps
19307 : Find type of 2nd arg to 'getgroups()' and 'setgroups()'
19309 case "$d_getgrps$d_setgrps" in
19311 case "$groupstype" in
19312 '') dflt="$gidtype" ;;
19313 *) dflt="$groupstype" ;;
19316 What type of pointer is the second argument to getgroups() and setgroups()?
19317 Usually this is the same as group ids, $gidtype, but not always.
19320 rp='What type pointer is the second argument to getgroups() and setgroups()?'
19324 *) groupstype="$gidtype";;
19328 if $test $patchlevel -lt 9; then
19329 : MAD is not available in 5.8.x or earlier.
19333 $define|true|[yY]*) dflt='y' ;;
19338 Would you like to build with Misc Attribute Decoration? This is development
19339 work leading to a Perl 5 to Perl 6 convertor, which imposes a space and speed
19340 overhead on the interpreter.
19342 If this doesn't make any sense to you, just accept the default '$dflt'.
19344 rp='Build Perl with MAD?'
19349 madlyh='madly.h madly.act madly.tab'
19351 madlyobj="madly$_o" ;;
19361 echo "Checking if your $make program sets \$(MAKE)..." >&4
19362 case "$make_set_make" in
19364 $sed 's/^X //' > testmake.mak << 'EOF'
19366 X @echo 'maketemp="$(MAKE)"'
19368 case "`$make -f testmake.mak 2>/dev/null`" in
19369 *maketemp=*) make_set_make='#' ;;
19370 *) make_set_make="MAKE=$make" ;;
19372 $rm -f testmake.mak
19375 case "$make_set_make" in
19376 '#') echo "Yup, it does.";;
19377 *) echo "Nope, it doesn't.";;
19380 : see what type is used for mode_t
19381 rp="What is the type used for file modes for system calls (e.g. fchmod())?"
19382 set mode_t modetype int stdio.h sys/types.h
19385 : see if we need va_copy
19387 case "$i_stdarg" in
19390 #include <stdarg.h>
19392 #$i_stdlib I_STDLIB
19394 #include <stdlib.h>
19396 #include <signal.h>
19399 ivfprintf(FILE *f, const char *fmt, va_list *valp)
19401 return vfprintf(f, fmt, *valp);
19405 myvfprintf(FILE *f, const char *fmt, va_list val)
19407 return ivfprintf(f, fmt, &val);
19411 myprintf(char *fmt, ...)
19414 va_start(val, fmt);
19415 return myvfprintf(stdout, fmt, val);
19419 main(int ac, char **av)
19421 signal(SIGSEGV, exit);
19423 myprintf("%s%cs all right, then\n", "that", '\'');
19428 if eval $compile && $run ./try 2>&1 >/dev/null; then
19429 case "`$run ./try`" in
19430 "that's all right, then")
19436 yes) echo "It seems that you don't need va_copy()." >&4
19437 need_va_copy="$undef"
19439 *) echo "It seems that va_copy() or similar will be needed." >&4
19440 need_va_copy="$define"
19443 $rm -f try.* core core.* *.core *.core.*
19445 *) echo "You don't have <stdarg.h>, not checking for va_copy()." >&4
19449 : see what type is used for size_t
19450 rp="What is the type used for the length parameter for string functions?"
19451 set size_t sizetype 'unsigned int' stdio.h sys/types.h
19454 : check for type of arguments to gethostbyaddr.
19455 if test "X$netdb_host_type" = X -o "X$netdb_hlen_type" = X; then
19456 case "$d_gethbyaddr" in
19460 Checking to see what type of arguments are accepted by gethostbyaddr().
19462 hdrs="$define sys/types.h
19463 $d_socket sys/socket.h
19464 $i_niin netinet/in.h
19466 $i_unistd unistd.h"
19467 : The first arg can 'char *' or 'void *'
19468 : The second arg is some of integral type
19469 for xxx in in_addr_t 'const void *' 'const char *' 'void *' 'char *'; do
19470 for yyy in size_t long int; do
19471 case "$netdb_host_type" in
19472 '') try="extern struct hostent *gethostbyaddr($xxx, $yyy, int);"
19473 if ./protochk "$try" $hdrs; then
19474 echo "Your system accepts $xxx for the first arg."
19475 echo "...and $yyy for the second arg."
19476 netdb_host_type="$xxx"
19477 netdb_hlen_type="$yyy"
19483 : In case none of those worked, prompt the user.
19484 case "$netdb_host_type" in
19485 '') rp='What is the type for the 1st argument to gethostbyaddr?'
19488 netdb_host_type=$ans
19489 rp='What is the type for the 2nd argument to gethostbyaddr?'
19492 netdb_hlen_type=$ans
19496 *) : no gethostbyaddr, so pick harmless defaults
19497 netdb_host_type='char *'
19498 netdb_hlen_type="$sizetype"
19501 # Remove the "const" if needed. -- but then we'll have a
19503 # netdb_host_type=`echo "$netdb_host_type" | sed 's/^const //'`
19506 : check for type of argument to gethostbyname.
19507 if test "X$netdb_name_type" = X ; then
19508 case "$d_gethbyname" in
19512 Checking to see what type of argument is accepted by gethostbyname().
19514 hdrs="$define sys/types.h
19515 $d_socket sys/socket.h
19516 $i_niin netinet/in.h
19518 $i_unistd unistd.h"
19519 for xxx in "const char *" "char *"; do
19520 case "$netdb_name_type" in
19521 '') try="extern struct hostent *gethostbyname($xxx);"
19522 if ./protochk "$try" $hdrs; then
19523 echo "Your system accepts $xxx."
19524 netdb_name_type="$xxx"
19529 : In case none of those worked, prompt the user.
19530 case "$netdb_name_type" in
19531 '') rp='What is the type for the 1st argument to gethostbyname?'
19534 netdb_name_type=$ans
19538 *) : no gethostbyname, so pick harmless default
19539 netdb_name_type='char *'
19544 : check for type of 1st argument to getnetbyaddr.
19545 if test "X$netdb_net_type" = X ; then
19546 case "$d_getnbyaddr" in
19550 Checking to see what type of 1st argument is accepted by getnetbyaddr().
19552 hdrs="$define sys/types.h
19553 $d_socket sys/socket.h
19554 $i_niin netinet/in.h
19556 $i_unistd unistd.h"
19557 for xxx in in_addr_t "unsigned long" long "unsigned int" int; do
19558 case "$netdb_net_type" in
19559 '') try="extern struct netent *getnetbyaddr($xxx, int);"
19560 if ./protochk "$try" $hdrs; then
19561 echo "Your system accepts $xxx."
19562 netdb_net_type="$xxx"
19567 : In case none of those worked, prompt the user.
19568 case "$netdb_net_type" in
19569 '') rp='What is the type for the 1st argument to getnetbyaddr?'
19572 netdb_net_type=$ans
19576 *) : no getnetbyaddr, so pick harmless default
19577 netdb_net_type='long'
19581 : locate the preferred pager for this system
19588 [a-zA-Z]:/*) dflt=$pg;;
19592 [a-zA-Z]:/*) dflt=$more;;
19596 [a-zA-Z]:/*) dflt=$less;;
19599 '') dflt=/usr/ucb/more;;
19603 : Instruct ./getfile to trust the hinted or previous pager value,
19604 : even if it does not begin with a slash. For example, on os2,
19605 : pager might be cmd /c more. See comments in UU/getfile.
19610 rp='What pager is used on your system?'
19614 : see what type pids are declared as in the kernel
19615 rp="What is the type of process ids on this system?"
19616 set pid_t pidtype int stdio.h sys/types.h
19619 : see if ar generates random libraries by itself
19621 echo "Checking how to generate random libraries on your machine..." >&4
19622 echo 'int bar1() { return bar2(); }' > bar1.c
19623 echo 'int bar2() { return 2; }' > bar2.c
19625 #$i_stdlib I_STDLIB
19627 #include <stdlib.h>
19629 int main() { printf("%d\n", bar1()); exit(0); }
19631 $cc $ccflags -c bar1.c >/dev/null 2>&1
19632 $cc $ccflags -c bar2.c >/dev/null 2>&1
19633 $cc $ccflags -c foo.c >/dev/null 2>&1
19634 $ar rc bar$_a bar2$_o bar1$_o >/dev/null 2>&1
19635 if $cc -o foobar $ccflags $ldflags foo$_o bar$_a $libs > /dev/null 2>&1 &&
19636 $run ./foobar >/dev/null 2>&1; then
19637 echo "$ar appears to generate random libraries itself."
19639 if [ "X$ranlib" = "X" ]; then
19642 elif $ar s bar$_a >/dev/null 2>&1 &&
19643 $cc -o foobar $ccflags $ldflags foo$_o bar$_a $libs > /dev/null 2>&1 &&
19644 $run ./foobar >/dev/null 2>&1; then
19645 echo "a table of contents needs to be added with '$ar s'."
19648 elif $ar ts bar$_a >/dev/null 2>&1 &&
19649 $cc -o foobar $ccflags $ldflags foo$_o bar$_a $libs > /dev/null 2>&1 &&
19650 $run ./foobar >/dev/null 2>&1; then
19651 echo "a table of contents needs to be added with '$ar ts'."
19658 ranlib=`./loc ranlib X /usr/bin /bin /usr/local/bin`
19659 $test -f $ranlib || ranlib=''
19662 if $test -n "$ranlib"; then
19663 echo "your system has '$ranlib'; we'll use that."
19666 echo "your system doesn't seem to support random libraries"
19667 echo "so we'll use lorder and tsort to order the libraries."
19674 : check for type of arguments to select.
19675 case "$selecttype" in
19676 '') case "$d_select" in
19680 Checking to see what type of arguments are accepted by select().
19682 hdrs="$define sys/types.h
19683 $i_systime sys/time.h
19684 $i_sysselct sys/select.h
19685 $d_socket sys/socket.h"
19686 : The first arg can be int, unsigned, or size_t
19687 : The last arg may or may not be 'const'
19689 : void pointer has been seen but using that
19690 : breaks the selectminbits test
19691 for xxx in 'fd_set *' 'int *'; do
19692 for nfd in 'int' 'size_t' 'unsigned long' 'unsigned' ; do
19693 for tmo in 'struct timeval *' 'const struct timeval *'; do
19695 '') try="extern select _(($nfd, $xxx, $xxx, $xxx, $tmo));"
19696 if ./protochk "$try" $hdrs; then
19697 echo "Your system accepts $xxx."
19706 '') rp='What is the type for the 2nd, 3rd, and 4th arguments to select?'
19707 case "$d_fd_set" in
19708 $define) dflt="fd_set *" ;;
19717 *) : no select, so pick a harmless default
19724 : check for the select 'width'
19725 case "$selectminbits" in
19726 '') safebits=`expr $ptrsize \* 8`
19727 case "$d_select" in
19731 Checking to see on how many bits at a time your select() operates...
19734 #include <sys/types.h>
19736 #$i_systime I_SYS_TIME
19737 #$i_systimek I_SYS_TIME_KERNEL
19742 # ifdef I_SYS_TIME_KERNEL
19745 # include <sys/time.h>
19746 # ifdef I_SYS_TIME_KERNEL
19750 #$i_sysselct I_SYS_SELECT
19751 #ifdef I_SYS_SELECT
19752 #include <sys/select.h>
19754 #$d_socket HAS_SOCKET
19756 # include <sys/socket.h> /* Might include <sys/bsdtypes.h> */
19759 #$i_stdlib I_STDLIB
19761 #include <stdlib.h>
19764 #define S sizeof(*(b))
19766 #define NBYTES (S * 8 > MINBITS ? S : MINBITS/8)
19767 #define NBITS (NBYTES * 8)
19769 char *s = (char *)malloc(NBYTES);
19778 fp = fopen("try.c", "r");
19784 b = ($selecttype)s;
19785 for (i = 0; i < NBITS; i++)
19789 select(fd + 1, b, 0, 0, &t);
19790 for (i = NBITS - 1; i > fd && FD_ISSET(i, b); i--);
19792 printf("%d\n", i + 1);
19797 if eval $compile_ok; then
19798 selectminbits=`$run ./try`
19799 case "$selectminbits" in
19801 Cannot figure out on how many bits at a time your select() operates.
19802 I'll play safe and guess it is $safebits bits.
19804 selectminbits=$safebits
19805 bits="$safebits bits"
19808 *) bits="$selectminbits bits" ;;
19810 echo "Your select() operates on $bits at a time." >&4
19812 rp='What is the minimum number of bits your select() operates on?'
19813 case "$byteorder" in
19814 12345678) dflt=64 ;;
19820 selectminbits="$val"
19824 *) : no select, so pick a harmless default
19825 selectminbits=$safebits
19831 : Trace out the files included by signal.h, then look for SIGxxx names.
19832 : Remove SIGARRAYSIZE used by HPUX.
19833 : Remove SIGSTKSIZE used by Linux.
19834 : Remove SIGSTKSZ used by Posix.
19835 : Remove SIGTYP void lines used by OS2.
19836 : Some cpps, like os390, dont give the file name anywhere
19837 if [ "X$fieldn" = X ]; then
19838 : Just make some guesses. We check them later.
19839 xxx='/usr/include/signal.h /usr/include/sys/signal.h'
19841 xxx=`echo '#include <signal.h>' |
19842 $cppstdin $cppminus $cppflags 2>/dev/null |
19843 $grep '^[ ]*#.*include' |
19844 $awk "{print \\$$fieldn}" | $sed 's!"!!g' | $sed 's!\\\\\\\\!/!g' | $sort | $uniq`
19846 : Check this list of files to be sure we have parsed the cpp output ok.
19847 : This will also avoid potentially non-existent files, such
19850 for xx in $xxx /dev/null ; do
19851 $test -f "$xx" && xxxfiles="$xxxfiles $xx"
19853 : If we have found no files, at least try signal.h
19854 case "$xxxfiles" in
19855 '') xxxfiles=`./findhdr signal.h` ;;
19858 $1 ~ /^#define$/ && $2 ~ /^SIG[A-Z0-9]*$/ && $2 !~ /SIGARRAYSIZE/ && $2 !~ /SIGSTKSIZE/ && $2 !~ /SIGSTKSZ/ && $3 !~ /void/ {
19859 print substr($2, 4, 20)
19861 $1 == "#" && $2 ~ /^define$/ && $3 ~ /^SIG[A-Z0-9]*$/ && $3 !~ /SIGARRAYSIZE/ && $4 !~ /void/ {
19862 print substr($3, 4, 20)
19864 : Append some common names just in case the awk scan failed.
19865 xxx="$xxx ABRT ALRM BUS CANCEL CHLD CLD CONT DIL EMT FPE"
19866 xxx="$xxx FREEZE HUP ILL INT IO IOT KILL LOST LWP PHONE"
19867 xxx="$xxx PIPE POLL PROF PWR QUIT RTMAX RTMIN SEGV STKFLT STOP"
19868 xxx="$xxx SYS TERM THAW TRAP TSTP TTIN TTOU URG USR1 USR2"
19869 xxx="$xxx USR3 USR4 VTALRM WAITING WINCH WIND WINDOW XCPU XFSZ"
19871 : generate a few handy files for later
19872 $cat > signal.c <<EOCP
19873 #include <sys/types.h>
19874 #include <signal.h>
19875 #$i_stdlib I_STDLIB
19877 #include <stdlib.h>
19882 /* Strange style to avoid deeply-nested #if/#else/#endif */
19885 # define NSIG (_NSIG)
19891 # define NSIG (SIGMAX+1)
19897 # define NSIG (SIG_MAX+1)
19903 # define NSIG (_SIG_MAX+1)
19909 # define NSIG (MAXSIG+1)
19915 # define NSIG (MAX_SIG+1)
19920 # ifdef SIGARRAYSIZE
19921 # define NSIG SIGARRAYSIZE /* Assume ary[SIGARRAYSIZE] */
19927 # define NSIG (_sys_nsig) /* Solaris 2.5 */
19931 /* Default to some arbitrary number that's big enough to get most
19932 of the common signals.
19938 printf("NSIG %d\n", NSIG);
19944 echo $xxx | $tr ' ' $trnl | $sort | $uniq | $awk '
19946 printf "#ifdef SIG"; printf $1; printf "\n"
19947 printf "printf(\""; printf $1; printf " %%d\\n\",SIG";
19948 printf $1; printf ");\n"
19952 printf "#endif /* JUST_NSIG */\n";
19953 printf "exit(0);\n}\n";
19956 $cat >signal.awk <<'EOP'
19957 BEGIN { ndups = 0 }
19958 $1 ~ /^NSIG$/ { nsig = $2 }
19959 ($1 !~ /^NSIG$/) && (NF == 2) && ($2 ~ /^[0-9][0-9]*$/) {
19960 if ($2 > maxsig) { maxsig = $2 }
19961 if (sig_name[$2]) {
19962 dup_name[ndups] = $1
19963 dup_num[ndups] = $2
19975 printf("NSIG %d\n", nsig);
19976 for (n = 1; n < nsig; n++) {
19978 printf("%s %d\n", sig_name[n], sig_num[n])
19981 printf("NUM%d %d\n", n, n)
19984 for (n = 0; n < ndups; n++) {
19985 printf("%s %d\n", dup_name[n], dup_num[n])
19989 $cat >signal_cmd <<EOS
19991 if $test -s signal.lst; then
19992 echo "Using your existing signal.lst file"
19997 $cat >>signal_cmd <<'EOS'
20000 if eval $compile_ok; then
20001 $run ./signal$_exe | ($sort -n -k 2 2>/dev/null || $sort -n +1) | $uniq | $awk -f signal.awk >signal.lst
20003 echo "(I can't seem be able to compile the whole test program)" >&4
20004 echo "(I'll try it in little pieces.)" >&4
20005 set signal -DJUST_NSIG
20006 if eval $compile_ok; then
20007 $run ./signal$_exe > signal.nsg
20010 echo "I can't seem to figure out how many signals you have." >&4
20011 echo "Guessing 50." >&4
20012 echo 'NSIG 50' > signal.nsg
20014 : Now look at all the signal names, one at a time.
20015 for xx in `echo $xxx | $tr ' ' $trnl | $sort | $uniq`; do
20016 $cat > signal.c <<EOCP
20017 #include <sys/types.h>
20018 #include <signal.h>
20021 printf("$xx %d\n", SIG${xx});
20026 if eval $compile; then
20027 echo "SIG${xx} found."
20028 $run ./signal$_exe >> signal.ls1
20030 echo "SIG${xx} NOT found."
20033 if $test -s signal.ls1; then
20034 $cat signal.nsg signal.ls1 |
20035 $sort -n | $uniq | $awk -f signal.awk >signal.lst
20039 if $test -s signal.lst; then
20042 echo "(AAK! I can't compile the test programs -- Guessing)" >&4
20043 echo 'kill -l' >signal
20044 set X `csh -f <signal`
20048 0) set HUP INT QUIT ILL TRAP ABRT EMT FPE KILL BUS SEGV SYS PIPE ALRM TERM;;
20050 echo $@ | $tr ' ' $trnl | \
20051 $awk '{ printf "%s %d\n", $1, ++s; }
20052 END { printf "NSIG %d\n", ++s }' >signal.lst
20054 $rm -f signal.c signal$_exe signal$_o signal.nsg signal.ls1
20056 chmod a+x signal_cmd
20057 $eunicefix signal_cmd
20059 : generate list of signal names
20061 case "$sig_name_init" in
20063 *) case "$sig_num_init" in
20064 ''|*,*) doinit=yes ;;
20069 echo "Generating a list of signal names and numbers..." >&4
20071 sig_count=`$awk '/^NSIG/ { printf "%d", $2 }' signal.lst`
20072 sig_name=`$awk 'BEGIN { printf "ZERO " }
20073 !/^NSIG/ { printf "%s ", $1 }' signal.lst`
20074 sig_num=`$awk 'BEGIN { printf "0 " }
20075 !/^NSIG/ { printf "%d ", $2 }' signal.lst`
20076 sig_name_init=`$awk 'BEGIN { printf "\"ZERO\", " }
20077 !/^NSIG/ { printf "\"%s\", ", $1 }
20078 END { printf "0\n" }' signal.lst`
20079 sig_num_init=`$awk 'BEGIN { printf "0, " }
20080 !/^NSIG/ { printf "%d, ", $2}
20081 END { printf "0\n"}' signal.lst`
20084 echo "The following $sig_count signals are available:"
20086 echo $sig_name | $awk \
20087 'BEGIN { linelen = 0 }
20089 for (i = 1; i <= NF; i++) {
20090 name = "SIG" $i " "
20091 linelen = linelen + length(name)
20092 if (linelen > 70) {
20094 linelen = length(name)
20100 sig_size=`echo $sig_name | awk '{print NF}'`
20101 $rm -f signal signal.c signal.awk signal.lst signal_cmd
20104 case "$sizetype" in
20105 *_t) zzz="$sizetype" ;;
20106 *) zzz="filesize" ;;
20108 echo "Checking the size of $zzz..." >&4
20110 #include <sys/types.h>
20112 #$i_stdlib I_STDLIB
20114 #include <stdlib.h>
20117 printf("%d\n", (int)sizeof($sizetype));
20122 if eval $compile_ok; then
20126 echo "(I can't execute the test program--guessing $sizesize.)" >&4
20129 echo "Your $zzz size is $sizesize bytes."
20134 echo "(I can't compile the test program--guessing $sizesize.)" >&4
20138 : check for socklen_t
20140 echo "Checking to see if you have socklen_t..." >&4
20142 #include <sys/types.h>
20143 #$d_socket HAS_SOCKET
20145 #include <sys/socket.h>
20147 int main() { socklen_t x = 16; }
20150 if eval $compile; then
20152 echo "You have socklen_t."
20155 echo "You do not have socklen_t."
20156 case "$sizetype" in
20157 size_t) echo "(You do have size_t, that might work. Some people are happy with just an int.)" ;;
20164 : see if this is a socks.h system
20165 set socks.h i_socks
20168 : check for type of the size argument to socket calls
20169 case "$d_socket" in
20173 Checking to see what type is the last argument of accept().
20176 case "$d_socklen_t" in
20177 "$define") yyy="$yyy socklen_t"
20179 yyy="$yyy $sizetype int long unsigned"
20180 for xxx in $yyy; do
20181 case "$socksizetype" in
20182 '') try="extern int accept(int, struct sockaddr *, $xxx *);"
20183 case "$usesocks" in
20185 if ./protochk "$try" $i_systypes sys/types.h $d_socket sys/socket.h literal '#define INCLUDE_PROTOTYPES' $i_socks socks.h.; then
20186 echo "Your system accepts '$xxx *' for the last argument of accept()."
20187 socksizetype="$xxx"
20190 *) if ./protochk "$try" $i_systypes sys/types.h $d_socket sys/socket.h; then
20191 echo "Your system accepts '$xxx *' for the last argument of accept()."
20192 socksizetype="$xxx"
20199 : In case none of those worked, prompt the user.
20200 case "$socksizetype" in
20201 '') rp='What is the type for socket address structure sizes?'
20208 *) : no sockets, so pick relatively harmless default
20213 : see what type is used for signed size_t
20214 set ssize_t ssizetype int stdio.h sys/types.h
20219 #$i_stdlib I_STDLIB
20221 #include <stdlib.h>
20223 #include <sys/types.h>
20224 #define Size_t $sizetype
20225 #define SSize_t $dflt
20228 if (sizeof(Size_t) == sizeof(SSize_t))
20230 else if (sizeof(Size_t) == sizeof(int))
20239 if eval $compile_ok && $run ./try > /dev/null; then
20240 ssizetype=`$run ./try`
20241 echo "I'll be using $ssizetype for functions returning a byte count." >&4
20244 Help! I can't compile and run the ssize_t test program: please enlighten me!
20245 (This is probably a misconfiguration in your system or libraries, and
20246 you really ought to fix it. Still, I'll try anyway.)
20248 I need a type that is the same size as $sizetype, but is guaranteed to
20249 be signed. Common values are ssize_t, int and long.
20252 rp="What signed type is the same size as $sizetype?"
20258 : see what type of char stdio uses.
20260 echo '#include <stdio.h>' > stdio.c
20261 $cppstdin $cppminus < stdio.c > stdioh
20262 if $contains 'unsigned.*char.*_ptr;' stdioh >/dev/null 2>&1 ; then
20263 echo "Your stdio uses unsigned chars." >&4
20264 stdchar="unsigned char"
20266 echo "Your stdio uses signed chars." >&4
20269 $rm -f stdio.* stdioh
20271 : see what type uids are declared as in the kernel
20273 echo "Looking for the type for user ids returned by getuid()."
20274 set uid_t uidtype xxx stdio.h sys/types.h
20278 xxx=`./findhdr sys/user.h`
20279 set `grep '_ruid;' "$xxx" 2>/dev/null` unsigned short
20281 unsigned) dflt="$1 $2" ;;
20285 *) dflt="$uidtype";;
20288 uid_t) echo "uid_t found." ;;
20289 *) rp="What is the type for user ids returned by getuid()?"
20297 *_t) zzz="$uidtype" ;;
20300 echo "Checking the size of $zzz..." >&4
20302 #include <sys/types.h>
20304 #$i_stdlib I_STDLIB
20306 #include <stdlib.h>
20309 printf("%d\n", (int)sizeof($uidtype));
20314 if eval $compile_ok; then
20318 echo "(I can't execute the test program--guessing $uidsize.)" >&4
20321 echo "Your $zzz is $uidsize bytes long."
20326 echo "(I can't compile the test program--guessing $uidsize.)" >&4
20331 *_t) zzz="$uidtype" ;;
20334 echo "Checking the sign of $zzz..." >&4
20336 #include <sys/types.h>
20347 if eval $compile; then
20351 echo "(I can't execute the test program--guessing unsigned.)" >&4
20355 1) echo "Your $zzz is unsigned." ;;
20356 -1) echo "Your $zzz is signed." ;;
20362 echo "(I can't compile the test program--guessing unsigned.)" >&4
20368 $echo "Checking the format string to be used for uids..." >&4
20371 -1) if $test X"$uidsize" = X"$ivsize"; then
20372 uidformat="$ivdformat"
20374 if $test X"$uidsize" = X"$longsize"; then
20377 if $test X"$uidsize" = X"$intsize"; then
20380 if $test X"$uidsize" = X"$shortsize"; then
20387 *) if $test X"$uidsize" = X"$uvsize"; then
20388 uidformat="$uvuformat"
20390 if $test X"$uidsize" = X"$longsize"; then
20393 if $test X"$uidsize" = X"$intsize"; then
20396 if $test X"$uidsize" = X"$shortsize"; then
20406 case "$usesitecustomize" in
20407 $define|true|[Yy]*)
20408 usesitecustomize="$define"
20411 usesitecustomize="$undef"
20415 : determine compiler compiler
20424 if $test -f "$byacc$_exe"; then
20426 comp="byacc or $comp"
20428 if $test -f "$bison$_exe"; then
20429 comp="$comp or bison -y"
20431 rp="Which compiler compiler ($comp) shall I use?"
20440 echo "(Adding -y option to bison to get yacc-compatible behaviour.)"
20446 : see if this is a fp.h system
20450 : see if this is a fp_class.h system
20451 set fp_class.h i_fp_class
20454 : see if gdbm.h is available
20459 : see if gdbm_open exists
20460 set gdbm_open d_gdbm_open
20462 case "$d_gdbm_open" in
20465 echo "We won't be including <gdbm.h>"
20474 : see if this is a ieeefp.h system
20475 case "$i_ieeefp" in
20476 '' ) set ieeefp.h i_ieeefp
20481 : see if this is a libutil.h system
20482 set libutil.h i_libutil
20485 : see if mach cthreads are available
20486 if test "X$usethreads" = "X$define"; then
20487 set mach/cthreads.h i_machcthr
20490 i_machcthr="$undef"
20495 : see if this is a mntent.h system
20496 set mntent.h i_mntent
20499 : see if ndbm.h is available
20505 # Some Linux distributions such as RedHat 7.1 put the
20506 # ndbm.h header in /usr/include/gdbm/ndbm.h.
20507 if $test -f /usr/include/gdbm/ndbm.h; then
20508 echo '<gdbm/ndbm.h> found.'
20509 ccflags="$ccflags -I/usr/include/gdbm"
20510 cppflags="$cppflags -I/usr/include/gdbm"
20518 : see if dbm_open exists
20519 set dbm_open d_dbm_open
20521 case "$d_dbm_open" in
20524 echo "We won't be including <ndbm.h>"
20533 : see if net/errno.h is available
20535 set net/errno.h val
20538 : Unfortunately, it causes problems on some systems. Arrgh.
20541 cat > try.c <<'EOM'
20544 #include <net/errno.h>
20550 if $cc $ccflags -c try.c >/dev/null 2>&1; then
20551 echo "We'll be including <net/errno.h>." >&4
20553 echo "We won't be including <net/errno.h>." >&4
20562 : see if netinet/tcp.h is available
20563 set netinet/tcp.h i_netinettcp
20566 : see if this is a poll.h system
20570 : see if this is a prot.h system
20575 $echo "Guessing which symbols your C compiler and preprocessor define..." >&4
20576 $cat <<'EOSH' > Cppsym.know
20577 a29k ABI64 aegis AES_SOURCE AIX AIX32 AIX370
20578 AIX41 AIX42 AIX43 AIX_SOURCE aixpc ALL_SOURCE
20579 alliant alpha am29000 AM29000 AMD64 amd64 amiga AMIGAOS AMIX
20580 ansi ANSI_C_SOURCE apollo ardent ARM32 atarist att386 att3b
20581 BeOS BIG_ENDIAN BIT_MSF bsd BSD bsd43 bsd4_2 bsd4_3 BSD4_3 bsd4_4
20582 BSD_4_3 BSD_4_4 BSD_NET2 BSD_TIME BSD_TYPES BSDCOMPAT bsdi
20583 bull c cadmus clipper CMU COFF COMPILER_VERSION
20584 concurrent convex cpu cray CRAY CRAYMPP ctix CX_UX
20585 CYGWIN DECC DGUX DGUX_SOURCE DJGPP dmert DOLPHIN DPX2 DSO
20586 Dynix DynixPTX ELF encore EPI EXTENSIONS FAVOR_BSD
20587 FILE_OFFSET_BITS FreeBSD GCC_NEW_VARARGS gcos gcx gimpel
20589 GNU_SOURCE GNUC GNUC_MINOR GNU_LIBRARY GO32 gould GOULD_PN
20590 H3050R H3050RX hbullx20 hcx host_mips
20591 hp200 hp300 hp700 HP700 hp800 hp9000
20592 hp9000s200 hp9000s300 hp9000s400 hp9000s500
20593 hp9000s700 hp9000s800 hp9k8 hp_osf hppa hpux HPUX_SOURCE
20594 i186 i286 i386 i486 i586 i686 i8086 i80960 i860 I960
20595 IA64 iAPX286 ibm ibm032 ibmesa IBMR2 ibmrt ILP32 ILP64
20596 INLINE_INTRINSICS INTRINSICS INT64 interdata is68k ksr1
20597 LANGUAGE_C LARGE_FILE_API LARGEFILE64_SOURCE
20598 LARGEFILE_SOURCE LFS64_LARGEFILE LFS_LARGEFILE
20599 Linux LITTLE_ENDIAN LONG64 LONG_DOUBLE LONG_LONG
20600 LONGDOUBLE LONGLONG LP64 luna luna88k Lynx
20601 M68000 m68k m88100 m88k M88KBCS_TARGET M_COFF
20602 M_I186 M_I286 M_I386 M_I8086 M_I86 M_I86SM M_SYS3
20603 M_SYS5 M_SYSIII M_SYSV M_UNIX M_XENIX MACH machine MachTen
20604 MATH_HAS_NO_SIDE_EFFECTS
20605 mc300 mc500 mc68000 mc68010 mc68020 mc68030 mc68040
20606 mc68060 mc68k mc68k32 mc700 mc88000 mc88100 merlin
20607 mert MiNT mips MIPS_FPSET MIPS_ISA MIPS_SIM MIPS_SZINT
20608 MIPS_SZLONG MIPS_SZPTR MIPSEB MIPSEL MODERN_C motorola
20609 mpeix MSDOS MTXINU MULTIMAX mvs MVS n16 ncl_el ncl_mr
20610 NetBSD news1500 news1700 news1800 news1900 news3700
20611 news700 news800 news900 NeXT NLS nonstopux ns16000 ns32000
20612 ns32016 ns32332 ns32k nsc32000
20613 OCS88 OEMVS OpenBSD os OS2 OS390 osf OSF1 OSF_SOURCE
20614 pa_risc PA_RISC1_1 PA_RISC2_0 PARAGON parisc
20615 pc532 pdp11 PGC PIC plexus PORTAR posix
20616 POSIX1B_SOURCE POSIX2_SOURCE POSIX4_SOURCE
20617 POSIX_C_SOURCE POSIX_SOURCE POWER
20618 PROTOTYPES PWB pyr QNX R3000 REENTRANT RES Rhapsody RISC6000
20619 riscix riscos RT S390 SA110 scs SCO sequent sgi SGI_SOURCE SH3 sinix
20620 SIZE_INT SIZE_LONG SIZE_PTR SOCKET_SOURCE SOCKETS_SOURCE
20621 sony sony_news sonyrisc sparc sparclite spectrum
20622 stardent stdc STDC_EXT stratos sun sun3 sun386
20623 Sun386i svr3 svr4 SVR4_2 SVR4_SOURCE svr5
20624 SX system SYSTYPE_BSD SYSTYPE_BSD43 SYSTYPE_BSD44
20625 SYSTYPE_SVR4 SYSTYPE_SVR5 SYSTYPE_SYSV SYSV SYSV3 SYSV4 SYSV5
20626 sysV68 sysV88 Tek4132 Tek4300 titan
20627 TM3200 TM5400 TM5600
20628 tower tower32 tower32_200 tower32_600 tower32_700
20629 tower32_800 tower32_850 tss
20630 u370 u3b u3b2 u3b20 u3b200 u3b20d u3b5
20631 ultrix UMAXV UnicomPBB UnicomPBD UNICOS UNICOSMK
20632 unix UNIX95 UNIX99 unixpc unos
20633 USE_BSD USE_FILE_OFFSET64 USE_GNU USE_ISOC9X USE_LARGEFILE USE_LARGEFILE64
20634 USE_MISC USE_POSIX USE_POSIX199309 USE_POSIX199506 USE_POSIX2
20635 USE_REENTRANT USE_SVID USE_UNIX98 USE_XOPEN USE_XOPEN_EXTENDED
20637 Utek UTek UTS UWIN uxpm uxps vax venix VMESA vms x86_64 xenix Xenix286
20638 XOPEN_SOURCE XOPEN_SOURCE_EXTENDED XPG2 XPG2_EXTENDED
20639 XPG3 XPG3_EXTENDED XPG4 XPG4_EXTENDED
20642 # Maybe put other stuff here too.
20643 cat <<EOSH >>Cppsym.know
20646 ./tr '[a-z]' '[A-Z]' < Cppsym.know > Cppsym.a
20647 ./tr '[A-Z]' '[a-z]' < Cppsym.know > Cppsym.b
20648 $cat Cppsym.know > Cppsym.c
20649 $cat Cppsym.a Cppsym.b Cppsym.c | $tr ' ' $trnl | $sort | $uniq > Cppsym.know
20650 $rm -f Cppsym.a Cppsym.b Cppsym.c
20651 cat <<EOSH > Cppsym
20653 if $test \$# -gt 0; then
20654 echo \$* | $tr " " "$trnl" | ./Cppsym.try > Cppsym.got
20655 if $test -s Cppsym.got; then
20662 $tr " " "$trnl" | ./Cppsym.try
20668 cat <<EOSH > Cppsym.try
20670 cat <<'EOCP' > try.c
20673 #define STRINGIFY(a) "a"
20675 #if cpp_stuff == 42
20676 #define StGiFy(a) #a
20677 #define STRINGIFY(a) StGiFy(a)
20679 #if $cpp_stuff != 1 && $cpp_stuff != 42
20680 # include "Bletch: How does this C preprocessor stringify macros?"
20686 cat <<'EOSH' >> Cppsym.try
20688 printf "#ifdef %s\nprintf(\"%s=%%s\\n\", STRINGIFY(%s));\n#endif\n", $1, $1, $1
20689 printf "#ifdef _%s\nprintf(\"_%s=%%s\\n\", STRINGIFY(_%s));\n#endif\n", $1, $1, $1
20690 printf "#ifdef __%s\nprintf(\"__%s=%%s\\n\", STRINGIFY(__%s));\n#endif\n", $1, $1, $1
20691 printf "#ifdef __%s__\nprintf(\"__%s__=%%s\\n\", STRINGIFY(__%s__));\n#endif\n", $1, $1, $1
20693 echo 'return 0;}' >> try.c
20695 cat <<EOSH >> Cppsym.try
20697 case "$osname-$gccversion" in
20698 irix-) ccflags="\$ccflags -woff 1178" ;;
20699 os2-*) ccflags="\$ccflags -Zlinker /PM:VIO" ;;
20701 $cc -o try -Dcpp_stuff=$cpp_stuff $optimize \$ccflags $ldflags try.c $libs && $run ./try | $sed 's/ /\\\\ /g'
20703 chmod +x Cppsym.try
20704 $eunicefix Cppsym.try
20705 ./Cppsym < Cppsym.know > Cppsym.true
20706 : Add in any linux cpp "predefined macros":
20707 case "$osname::$gccversion" in
20710 rm -f $tHdrH'.h' $tHdrH
20712 if cpp -dM $tHdrH'.h' > $tHdrH'_cppsym.h' && [ -s $tHdrH'_cppsym.h' ]; then
20713 sed 's/#define[\ \ ]*//;s/[\ \ ].*$//' <$tHdrH'_cppsym.h' >$tHdrH'_cppsym.real'
20714 if [ -s $tHdrH'_cppsym.real' ]; then
20715 cat $tHdrH'_cppsym.real' Cppsym.know | sort | uniq | ./Cppsym | sort | uniq > Cppsym.true
20718 rm -f $tHdrH'.h' $tHdrH'_cppsym.h' $tHdrH'_cppsym.real'
20721 : now check the C compiler for additional symbols
20722 postprocess_cc_v=''
20724 aix) postprocess_cc_v="|$tr , ' '" ;;
20731 for i in \`$cc -v -c tmp.c 2>&1 $postprocess_cc_v\`
20734 -D*) echo "\$i" | $sed 's/^-D//';;
20735 -A*) $test "$gccversion" && echo "\$i" | $sed 's/^-A//' | $sed 's/\(.*\)(\(.*\))/\1=\2/';;
20740 postprocess_cc_v=''
20743 ./ccsym > ccsym1.raw
20744 if $test -s ccsym1.raw; then
20745 $sort ccsym1.raw | $uniq >ccsym.raw
20747 mv ccsym1.raw ccsym.raw
20750 $awk '/\=/ { print $0; next }
20751 { print $0"=1" }' ccsym.raw >ccsym.list
20752 $comm -13 Cppsym.true ccsym.list >ccsym.own
20753 $comm -12 Cppsym.true ccsym.list >ccsym.com
20754 $comm -23 Cppsym.true ccsym.list >ccsym.cpp
20756 if $test -z ccsym.raw; then
20757 echo "Your C compiler doesn't seem to define any symbols!" >&4
20759 echo "However, your C preprocessor defines the following symbols:"
20762 cppsymbols=`$cat Cppsym.true`
20763 cppsymbols=`echo $cppsymbols`
20764 cppccsymbols="$cppsymbols"
20766 if $test -s ccsym.com; then
20767 echo "Your C compiler and pre-processor define these symbols:"
20768 $sed -e 's/\(..*\)=.*/\1/' ccsym.com
20771 cppccsymbols=`$cat ccsym.com`
20772 cppccsymbols=`echo $cppccsymbols`
20773 $test "$silent" || sleep 1
20775 if $test -s ccsym.cpp; then
20776 $test "$also" && echo " "
20777 echo "Your C pre-processor ${also}defines the following symbols:"
20778 $sed -e 's/\(..*\)=.*/\1/' ccsym.cpp
20780 cppsymbols=`$cat ccsym.cpp`
20781 cppsymbols=`echo $cppsymbols`
20782 $test "$silent" || sleep 1
20784 if $test -s ccsym.own; then
20785 $test "$also" && echo " "
20786 echo "Your C compiler ${also}defines the following cpp symbols:"
20787 $sed -e 's/\(..*\)=1/\1/' ccsym.own
20788 $sed -e 's/\(..*\)=.*/\1/' ccsym.own | $uniq >>Cppsym.true
20789 ccsymbols=`$cat ccsym.own`
20790 ccsymbols=`echo $ccsymbols`
20791 $test "$silent" || sleep 1
20795 : see if this is a termio system
20799 if $test `./findhdr termios.h`; then
20800 set tcsetattr i_termios
20806 "$define") echo "You have POSIX termios.h... good!" >&4;;
20807 *) if ./Cppsym pyr; then
20808 case "`/bin/universe`" in
20809 ucb) if $test `./findhdr sgtty.h`; then
20811 echo "<sgtty.h> found." >&4
20813 echo "System is pyramid with BSD universe."
20814 echo "<sgtty.h> not found--you could have problems." >&4
20816 *) if $test `./findhdr termio.h`; then
20818 echo "<termio.h> found." >&4
20820 echo "System is pyramid with USG universe."
20821 echo "<termio.h> not found--you could have problems." >&4
20825 if $test `./findhdr termio.h`; then
20826 echo "<termio.h> found." >&4
20828 elif $test `./findhdr sgtty.h`; then
20829 echo "<sgtty.h> found." >&4
20832 echo "Neither <termio.h> nor <sgtty.h> found--you could have problems." >&4
20835 if $test `./findhdr sgtty.h`; then
20836 echo "<sgtty.h> found." >&4
20838 elif $test `./findhdr termio.h`; then
20839 echo "<termio.h> found." >&4
20842 echo "Neither <sgtty.h> nor <termio.h> found--you could have problems." >&4
20846 set i_termio; eval $setvar
20847 val=$val2; set i_sgtty; eval $setvar
20848 val=$val3; set i_termios; eval $setvar
20850 : see if stddef is available
20851 set stddef.h i_stddef
20854 : see if this is a sunmath.h system
20855 set sunmath.h i_sunmath
20858 : see if sys/access.h is available
20859 set sys/access.h i_sysaccess
20862 : see if ioctl defs are in sgtty, termio, sys/filio or sys/ioctl
20863 set sys/filio.h i_sysfilio
20866 if $test `./findhdr sys/ioctl.h`; then
20868 echo '<sys/ioctl.h> found.' >&4
20871 if $test $i_sysfilio = "$define"; then
20872 echo '<sys/ioctl.h> NOT found.' >&4
20874 $test $i_sgtty = "$define" && xxx="sgtty.h"
20875 $test $i_termio = "$define" && xxx="termio.h"
20876 $test $i_termios = "$define" && xxx="termios.h"
20877 echo "No <sys/ioctl.h> found, assuming ioctl args are defined in <$xxx>." >&4
20883 : see if socket ioctl defs are in sys/sockio.h
20885 xxx=`./findhdr sys/sockio.h`
20886 if $test "$xxx"; then
20887 if $contains SIOCATMARK $xxx >/dev/null 2>&1; then
20889 echo "You have socket ioctls defined in <sys/sockio.h>." >&4
20892 echo "No socket ioctls found in <sys/sockio.h>." >&4
20897 <sys/sockio.h> not found, assuming socket ioctls are in <sys/ioctl.h>.
20904 : see if this is a syslog.h system
20905 set syslog.h i_syslog
20909 : see if this is a sys/mode.h system
20910 set sys/mode.h i_sysmode
20913 : see if sys/resource.h has to be included
20914 set sys/resource.h i_sysresrc
20917 : see if sys/security.h is available
20918 set sys/security.h i_syssecrt
20921 : see if this is a sys/statvfs.h system
20922 set sys/statvfs.h i_sysstatvfs
20925 : see if this is a sys/un.h system
20926 set sys/un.h i_sysun
20930 : see if this is a sys/utsname.h system
20931 set sys/utsname.h i_sysutsname
20934 : see if this is a syswait system
20935 set sys/wait.h i_syswait
20938 : see if this is a ustat.h system
20939 set ustat.h i_ustat
20942 : see if this is an utime system
20943 set utime.h i_utime
20946 : see if this is a values.h system
20947 set values.h i_values
20950 : see if this is a vfork system
20953 set vfork.h i_vfork
20962 echo "Looking for extensions..." >&4
20963 : If we are using the old config.sh, known_extensions may contain
20964 : old or inaccurate or duplicate values.
20965 known_extensions=''
20966 nonxs_extensions=''
20967 : We do not use find because it might not be available.
20968 : We do not just use MANIFEST because the user may have dropped
20969 : some additional extensions into the source tree and expect them
20972 : Function to recursively find available extensions, ignoring DynaLoader
20973 : NOTE: recursion limit of 10 to prevent runaway in case of symlink madness
20977 DynaLoader|dynaload) ;;
20979 if $test -f $xxx/$xxx.xs; then
20980 known_extensions="$known_extensions $1$xxx";
20981 elif $test -f $xxx/Makefile.PL; then
20982 nonxs_extensions="$nonxs_extensions $1$xxx";
20984 if $test -d $xxx -a $# -lt 10; then
20987 eval $find_extensions;
20999 eval $find_extensions
21000 # Special case: Add in threads/shared since it is not picked up by the
21001 # recursive find above (and adding in general recursive finding breaks
21002 # SDBM_File/sdbm). A.D. 10/25/2001.
21003 known_extensions="$known_extensions threads/shared"
21004 set X $known_extensions
21006 known_extensions="$*"
21007 # Ditto for IO/Compress/Base and IO/Compress/Zlib
21008 nonxs_extensions="$nonxs_extensions IO/Compress/Base IO/Compress/Zlib"
21009 set X $nonxs_extensions
21011 nonxs_extensions="$*"
21014 : Now see which are supported on this system.
21016 for xxx in $known_extensions ; do
21020 $define) avail_ext="$avail_ext $xxx" ;;
21023 GDBM_File|gdbm_fil)
21025 $define) avail_ext="$avail_ext $xxx" ;;
21028 I18N/Langinfo|i18n_lan)
21029 case "$i_langinfo$d_nl_langinfo" in
21030 $define$define) avail_ext="$avail_ext $xxx" ;;
21033 NDBM_File|ndbm_fil)
21036 case "$osname-$use64bitint" in
21039 *-lndbm*) avail_ext="$avail_ext $xxx" ;;
21042 *) avail_ext="$avail_ext $xxx" ;;
21047 ODBM_File|odbm_fil)
21048 case "${i_dbm}${i_rpcsvcdbm}" in
21050 case "$osname-$use64bitint" in
21053 *-ldbm*) avail_ext="$avail_ext $xxx" ;;
21056 *) avail_ext="$avail_ext $xxx" ;;
21062 case "$useposix" in
21063 true|define|y) avail_ext="$avail_ext $xxx" ;;
21067 case "$useopcode" in
21068 true|define|y) avail_ext="$avail_ext $xxx" ;;
21072 case "$d_socket" in
21075 beos) ;; # not unless BONE
21076 *) avail_ext="$avail_ext $xxx" ;;
21081 Sys/Syslog|sys/syslog)
21082 : XXX syslog requires socket
21083 case "$d_socket" in
21084 true|$define|y) avail_ext="$avail_ext $xxx" ;;
21088 case "$usethreads" in
21090 case "$useithreads" in
21091 $undef|false|[nN]*) avail_ext="$avail_ext $xxx" ;;
21097 cygwin) avail_ext="$avail_ext $xxx" ;;
21100 XS/APItest|xs/apitest)
21101 # This is just for testing. Skip it unless we have dynamic loading.
21104 $define) avail_ext="$avail_ext $xxx" ;;
21107 XS/Typemap|xs/typemap)
21108 # This is just for testing. Skip it unless we have dynamic loading.
21110 $define) avail_ext="$avail_ext $xxx" ;;
21113 threads|threads/shared)
21114 # threads and threads::shared are special cases.
21115 # To stop people from asking "Perl 5.8.0 was supposed
21116 # to have this new fancy threads implementation but my
21117 # perl doesn't have it" and from people trying to
21118 # (re)install the threads module using CPAN.pm and
21119 # CPAN.pm then offering to reinstall Perl 5.8.0,
21120 # the threads.pm and threads/shared.pm will always be
21121 # there, croaking informatively ("you need to rebuild
21122 # all of Perl with threads, sorry") when threads haven't
21123 # been compiled in.
21125 avail_ext="$avail_ext $xxx"
21128 : XXX Do we need a useipcsysv variable here
21129 case "${d_msg}${d_sem}${d_shm}" in
21130 *"${define}"*) avail_ext="$avail_ext $xxx" ;;
21133 *) avail_ext="$avail_ext $xxx"
21142 case "$onlyextensions" in
21144 *) keepextensions=''
21145 echo "You have requested that only certains extensions be included..." >&4
21146 for i in $onlyextensions; do
21147 case " $avail_ext " in
21149 echo "Keeping extension $i."
21150 keepextensions="$keepextensions $i"
21152 *) echo "Ignoring extension $i." ;;
21155 avail_ext="$keepextensions"
21159 case "$noextensions" in
21161 *) keepextensions=''
21162 echo "You have requested that certain extensions be ignored..." >&4
21163 for i in $avail_ext; do
21164 case " $noextensions " in
21165 *" $i "*) echo "Ignoring extension $i." ;;
21166 *) echo "Keeping extension $i.";
21167 keepextensions="$keepextensions $i"
21171 avail_ext="$keepextensions"
21175 : Now see which nonxs extensions are supported on this system.
21176 : For now assume all are.
21178 for xxx in $nonxs_extensions ; do
21180 *) nonxs_ext="$nonxs_ext $xxx"
21192 A number of extensions are supplied with $package. You may choose to
21193 compile these extensions for dynamic loading (the default), compile
21194 them into the $package executable (static loading), or not include
21195 them at all. Answer "none" to include no extensions.
21196 Note that DynaLoader is always built and need not be mentioned here.
21199 case "$dynamic_ext" in
21201 : Exclude those listed in static_ext
21203 for xxx in $avail_ext; do
21204 case " $static_ext " in
21206 *) dflt="$dflt $xxx" ;;
21213 *) dflt="$dynamic_ext"
21214 # Perhaps we are reusing an old out-of-date config.sh.
21217 if test X"$dynamic_ext" != X"$avail_ext"; then
21219 NOTICE: Your previous config.sh list may be incorrect.
21220 The extensions now available to you are
21222 but the default list from your previous config.sh is
21234 rp="What extensions do you wish to load dynamically?"
21237 none) dynamic_ext=' ' ;;
21238 *) dynamic_ext="$ans" ;;
21241 case "$static_ext" in
21243 : Exclude those already listed in dynamic linking
21245 for xxx in $avail_ext; do
21246 case " $dynamic_ext " in
21248 *) dflt="$dflt $xxx" ;;
21255 *) dflt="$static_ext"
21262 rp="What extensions do you wish to load statically?"
21265 none) static_ext=' ' ;;
21266 *) static_ext="$ans" ;;
21271 A number of extensions are supplied with $package. Answer "none"
21272 to include no extensions.
21273 Note that DynaLoader is always built and need not be mentioned here.
21276 case "$static_ext" in
21277 '') dflt="$avail_ext" ;;
21278 *) dflt="$static_ext"
21279 # Perhaps we are reusing an old out-of-date config.sh.
21282 if test X"$static_ext" != X"$avail_ext"; then
21284 NOTICE: Your previous config.sh list may be incorrect.
21285 The extensions now available to you are
21287 but the default list from your previous config.sh is
21296 : Exclude those that are not xs extensions
21300 rp="What extensions do you wish to include?"
21303 none) static_ext=' ' ;;
21304 *) static_ext="$ans" ;;
21309 # Encode is a special case. If we are building Encode as a static
21310 # extension, we need to explicitly list its subextensions as well.
21311 # For other nested extensions, this is handled automatically by
21312 # the appropriate Makefile.PL.
21313 case " $static_ext " in
21314 *" Encode "*) # Add the subextensions of Encode
21316 for xxx in `ls Encode/*/Makefile.PL|awk -F/ '{print $2}'`; do
21317 static_ext="$static_ext Encode/$xxx"
21323 set X $dynamic_ext $static_ext $nonxs_ext
21327 # Sanity check: We require an extension suitable for use with
21328 # AnyDBM_File, as well as Fcntl and IO. (Failure to have these
21329 # should show up as failures in the test suite, but it's helpful to
21330 # catch them now.) The 'extensions' list is normally sorted
21331 # alphabetically, so we need to accept either
21332 # DB_File ... Fcntl ... IO ....
21333 # or something like
21334 # Fcntl ... NDBM_File ... IO ....
21335 case " $extensions" in
21336 *"_File "*" Fcntl "*" IO "*) ;; # DB_File
21337 *" Fcntl "*"_File "*" IO "*) ;; # GDBM_File
21338 *" Fcntl "*" IO "*"_File "*) ;; # NDBM_File
21339 *) echo "WARNING: Extensions DB_File or *DBM_File, Fcntl, and IO not configured." >&4
21340 echo "WARNING: The Perl you are building will be quite crippled." >& 4
21344 : Remove libraries needed only for extensions
21345 : The appropriate ext/Foo/Makefile.PL will add them back in, if necessary.
21346 : The exception is SunOS 4.x, which needs them.
21347 case "${osname}X${osvers}" in
21351 *) case "$usedl" in
21352 $define|true|[yY]*)
21353 set X `echo " $libs " | sed -e 's@ -lndbm @ @' -e 's@ -lgdbm @ @' -e 's@ -ldbm @ @' -e 's@ -ldb @ @'`
21357 *) perllibs="$libs"
21363 : Remove build directory name from cppstdin so it can be used from
21364 : either the present location or the final installed location.
21366 : Get out of the UU directory to get correct path name.
21368 case "$cppstdin" in
21370 echo "Stripping down cppstdin path name"
21376 : end of configuration questions
21378 echo "End of configuration questions."
21381 : back to where it started
21382 if test -d ../UU; then
21386 : configuration may be patched via a 'config.arch' file
21387 if $test -f config.arch; then
21388 echo "I see a config.arch file, loading it."
21392 : configuration may be patched via a 'config.over' file
21393 if $test -f config.over; then
21396 rp='I see a config.over file. Do you wish to load it?'
21399 n*) echo "OK, I'll ignore it.";;
21401 echo "Configuration override changes have been loaded."
21406 : in case they want portability, strip down executable paths
21407 case "$d_portable" in
21410 echo "Stripping down executable paths..." >&4
21411 for file in $loclist $trylist; do
21413 eval $file=`basename $temp`
21418 : create config.sh file
21420 echo "Creating config.sh..." >&4
21421 $spitshell <<EOT >config.sh
21424 # This file was produced by running the Configure script. It holds all the
21425 # definitions figured out by Configure. Should you modify one of these values,
21426 # do not forget to propagate your changes by running "Configure -der". You may
21427 # instead choose to run each of the .SH files by yourself, or "Configure -S".
21430 # Package name : $package
21431 # Source directory : $src
21432 # Configuration time: $cf_time
21433 # Configured by : $cf_by
21434 # Target system : $myuname
21444 Revision='$Revision'
21452 alignbytes='$alignbytes'
21453 ansi2knr='$ansi2knr'
21454 aphostname='$aphostname'
21455 api_revision='$api_revision'
21456 api_subversion='$api_subversion'
21457 api_version='$api_version'
21458 api_versionstring='$api_versionstring'
21461 archlibexp='$archlibexp'
21462 archname64='$archname64'
21463 archname='$archname'
21464 archobjs='$archobjs'
21465 asctime_r_proto='$asctime_r_proto'
21473 byteorder='$byteorder'
21475 castflags='$castflags'
21478 cccdlflags='$cccdlflags'
21479 ccdlflags='$ccdlflags'
21481 ccflags_uselargefiles='$ccflags_uselargefiles'
21483 ccsymbols='$ccsymbols'
21484 ccversion='$ccversion'
21486 cf_email='$cf_email'
21488 charsize='$charsize'
21492 clocktype='$clocktype'
21494 compress='$compress'
21495 contains='$contains'
21499 cpp_stuff='$cpp_stuff'
21500 cppccsymbols='$cppccsymbols'
21501 cppflags='$cppflags'
21503 cppminus='$cppminus'
21505 cppstdin='$cppstdin'
21506 cppsymbols='$cppsymbols'
21507 crypt_r_proto='$crypt_r_proto'
21508 cryptlib='$cryptlib'
21510 ctermid_r_proto='$ctermid_r_proto'
21511 ctime_r_proto='$ctime_r_proto'
21512 d_Gconvert='$d_Gconvert'
21513 d_PRIEUldbl='$d_PRIEUldbl'
21514 d_PRIFUldbl='$d_PRIFUldbl'
21515 d_PRIGUldbl='$d_PRIGUldbl'
21516 d_PRIXU64='$d_PRIXU64'
21517 d_PRId64='$d_PRId64'
21518 d_PRIeldbl='$d_PRIeldbl'
21519 d_PRIfldbl='$d_PRIfldbl'
21520 d_PRIgldbl='$d_PRIgldbl'
21521 d_PRIi64='$d_PRIi64'
21522 d_PRIo64='$d_PRIo64'
21523 d_PRIu64='$d_PRIu64'
21524 d_PRIx64='$d_PRIx64'
21525 d_SCNfldbl='$d_SCNfldbl'
21526 d__fwalk='$d__fwalk'
21527 d_access='$d_access'
21528 d_accessx='$d_accessx'
21531 d_archlib='$d_archlib'
21532 d_asctime_r='$d_asctime_r'
21535 d_attribute_format='$d_attribute_format'
21536 d_attribute_malloc='$d_attribute_malloc'
21537 d_attribute_nonnull='$d_attribute_nonnull'
21538 d_attribute_noreturn='$d_attribute_noreturn'
21539 d_attribute_pure='$d_attribute_pure'
21540 d_attribute_unused='$d_attribute_unused'
21541 d_attribute_warn_unused_result='$d_attribute_warn_unused_result'
21545 d_bsdgetpgrp='$d_bsdgetpgrp'
21546 d_bsdsetpgrp='$d_bsdsetpgrp'
21547 d_builtin_choose_expr='$d_builtin_choose_expr'
21548 d_builtin_expect='$d_builtin_expect'
21550 d_c99_variadic_macros='$d_c99_variadic_macros'
21551 d_casti32='$d_casti32'
21552 d_castneg='$d_castneg'
21553 d_charvspr='$d_charvspr'
21555 d_chroot='$d_chroot'
21556 d_chsize='$d_chsize'
21558 d_clearenv='$d_clearenv'
21559 d_closedir='$d_closedir'
21560 d_cmsghdr_s='$d_cmsghdr_s'
21562 d_copysignl='$d_copysignl'
21563 d_cplusplus='$d_cplusplus'
21565 d_crypt_r='$d_crypt_r'
21567 d_ctermid='$d_ctermid'
21568 d_ctermid_r='$d_ctermid_r'
21569 d_ctime_r='$d_ctime_r'
21570 d_cuserid='$d_cuserid'
21571 d_dbl_dig='$d_dbl_dig'
21572 d_dbminitproto='$d_dbminitproto'
21573 d_difftime='$d_difftime'
21574 d_dir_dd_fd='$d_dir_dd_fd'
21576 d_dirnamlen='$d_dirnamlen'
21577 d_dlerror='$d_dlerror'
21578 d_dlopen='$d_dlopen'
21579 d_dlsymun='$d_dlsymun'
21580 d_dosuid='$d_dosuid'
21581 d_drand48_r='$d_drand48_r'
21582 d_drand48proto='$d_drand48proto'
21584 d_eaccess='$d_eaccess'
21585 d_endgrent='$d_endgrent'
21586 d_endgrent_r='$d_endgrent_r'
21587 d_endhent='$d_endhent'
21588 d_endhostent_r='$d_endhostent_r'
21589 d_endnent='$d_endnent'
21590 d_endnetent_r='$d_endnetent_r'
21591 d_endpent='$d_endpent'
21592 d_endprotoent_r='$d_endprotoent_r'
21593 d_endpwent='$d_endpwent'
21594 d_endpwent_r='$d_endpwent_r'
21595 d_endsent='$d_endsent'
21596 d_endservent_r='$d_endservent_r'
21597 d_eofnblk='$d_eofnblk'
21598 d_eunice='$d_eunice'
21599 d_faststdio='$d_faststdio'
21600 d_fchdir='$d_fchdir'
21601 d_fchmod='$d_fchmod'
21602 d_fchown='$d_fchown'
21604 d_fcntl_can_lock='$d_fcntl_can_lock'
21605 d_fd_macros='$d_fd_macros'
21606 d_fd_set='$d_fd_set'
21607 d_fds_bits='$d_fds_bits'
21608 d_fgetpos='$d_fgetpos'
21609 d_finite='$d_finite'
21610 d_finitel='$d_finitel'
21611 d_flexfnam='$d_flexfnam'
21613 d_flockproto='$d_flockproto'
21615 d_fp_class='$d_fp_class'
21616 d_fpathconf='$d_fpathconf'
21617 d_fpclass='$d_fpclass'
21618 d_fpclassify='$d_fpclassify'
21619 d_fpclassl='$d_fpclassl'
21620 d_fpos64_t='$d_fpos64_t'
21621 d_frexpl='$d_frexpl'
21622 d_fs_data_s='$d_fs_data_s'
21623 d_fseeko='$d_fseeko'
21624 d_fsetpos='$d_fsetpos'
21625 d_fstatfs='$d_fstatfs'
21626 d_fstatvfs='$d_fstatvfs'
21628 d_ftello='$d_ftello'
21630 d_futimes='$d_futimes'
21631 d_getcwd='$d_getcwd'
21632 d_getespwnam='$d_getespwnam'
21633 d_getfsstat='$d_getfsstat'
21634 d_getgrent='$d_getgrent'
21635 d_getgrent_r='$d_getgrent_r'
21636 d_getgrgid_r='$d_getgrgid_r'
21637 d_getgrnam_r='$d_getgrnam_r'
21638 d_getgrps='$d_getgrps'
21639 d_gethbyaddr='$d_gethbyaddr'
21640 d_gethbyname='$d_gethbyname'
21641 d_gethent='$d_gethent'
21642 d_gethname='$d_gethname'
21643 d_gethostbyaddr_r='$d_gethostbyaddr_r'
21644 d_gethostbyname_r='$d_gethostbyname_r'
21645 d_gethostent_r='$d_gethostent_r'
21646 d_gethostprotos='$d_gethostprotos'
21647 d_getitimer='$d_getitimer'
21648 d_getlogin='$d_getlogin'
21649 d_getlogin_r='$d_getlogin_r'
21650 d_getmnt='$d_getmnt'
21651 d_getmntent='$d_getmntent'
21652 d_getnbyaddr='$d_getnbyaddr'
21653 d_getnbyname='$d_getnbyname'
21654 d_getnent='$d_getnent'
21655 d_getnetbyaddr_r='$d_getnetbyaddr_r'
21656 d_getnetbyname_r='$d_getnetbyname_r'
21657 d_getnetent_r='$d_getnetent_r'
21658 d_getnetprotos='$d_getnetprotos'
21659 d_getpagsz='$d_getpagsz'
21660 d_getpbyname='$d_getpbyname'
21661 d_getpbynumber='$d_getpbynumber'
21662 d_getpent='$d_getpent'
21663 d_getpgid='$d_getpgid'
21664 d_getpgrp2='$d_getpgrp2'
21665 d_getpgrp='$d_getpgrp'
21666 d_getppid='$d_getppid'
21667 d_getprior='$d_getprior'
21668 d_getprotobyname_r='$d_getprotobyname_r'
21669 d_getprotobynumber_r='$d_getprotobynumber_r'
21670 d_getprotoent_r='$d_getprotoent_r'
21671 d_getprotoprotos='$d_getprotoprotos'
21672 d_getprpwnam='$d_getprpwnam'
21673 d_getpwent='$d_getpwent'
21674 d_getpwent_r='$d_getpwent_r'
21675 d_getpwnam_r='$d_getpwnam_r'
21676 d_getpwuid_r='$d_getpwuid_r'
21677 d_getsbyname='$d_getsbyname'
21678 d_getsbyport='$d_getsbyport'
21679 d_getsent='$d_getsent'
21680 d_getservbyname_r='$d_getservbyname_r'
21681 d_getservbyport_r='$d_getservbyport_r'
21682 d_getservent_r='$d_getservent_r'
21683 d_getservprotos='$d_getservprotos'
21684 d_getspnam='$d_getspnam'
21685 d_getspnam_r='$d_getspnam_r'
21686 d_gettimeod='$d_gettimeod'
21687 d_gmtime_r='$d_gmtime_r'
21688 d_gnulibc='$d_gnulibc'
21689 d_grpasswd='$d_grpasswd'
21690 d_hasmntopt='$d_hasmntopt'
21692 d_ilogbl='$d_ilogbl'
21693 d_inc_version_list='$d_inc_version_list'
21695 d_inetaton='$d_inetaton'
21696 d_int64_t='$d_int64_t'
21697 d_isascii='$d_isascii'
21698 d_isfinite='$d_isfinite'
21701 d_isnanl='$d_isnanl'
21702 d_killpg='$d_killpg'
21703 d_lchown='$d_lchown'
21704 d_ldbl_dig='$d_ldbl_dig'
21705 d_libm_lib_version='$d_libm_lib_version'
21707 d_localtime_r='$d_localtime_r'
21708 d_localtime_r_needs_tzset='$d_localtime_r_needs_tzset'
21709 d_locconv='$d_locconv'
21711 d_longdbl='$d_longdbl'
21712 d_longlong='$d_longlong'
21713 d_lseekproto='$d_lseekproto'
21715 d_madvise='$d_madvise'
21716 d_malloc_good_size='$d_malloc_good_size'
21717 d_malloc_size='$d_malloc_size'
21719 d_mbstowcs='$d_mbstowcs'
21720 d_mbtowc='$d_mbtowc'
21721 d_memchr='$d_memchr'
21722 d_memcmp='$d_memcmp'
21723 d_memcpy='$d_memcpy'
21724 d_memmove='$d_memmove'
21725 d_memset='$d_memset'
21727 d_mkdtemp='$d_mkdtemp'
21728 d_mkfifo='$d_mkfifo'
21729 d_mkstemp='$d_mkstemp'
21730 d_mkstemps='$d_mkstemps'
21731 d_mktime='$d_mktime'
21734 d_modfl_pow32_bug='$d_modfl_pow32_bug'
21735 d_modflproto='$d_modflproto'
21736 d_mprotect='$d_mprotect'
21738 d_msg_ctrunc='$d_msg_ctrunc'
21739 d_msg_dontroute='$d_msg_dontroute'
21740 d_msg_oob='$d_msg_oob'
21741 d_msg_peek='$d_msg_peek'
21742 d_msg_proxy='$d_msg_proxy'
21743 d_msgctl='$d_msgctl'
21744 d_msgget='$d_msgget'
21745 d_msghdr_s='$d_msghdr_s'
21746 d_msgrcv='$d_msgrcv'
21747 d_msgsnd='$d_msgsnd'
21749 d_munmap='$d_munmap'
21750 d_mymalloc='$d_mymalloc'
21752 d_nl_langinfo='$d_nl_langinfo'
21753 d_nv_preserves_uv='$d_nv_preserves_uv'
21754 d_nv_zero_is_allbits_zero='$d_nv_zero_is_allbits_zero'
21755 d_off64_t='$d_off64_t'
21756 d_old_pthread_create_joinable='$d_old_pthread_create_joinable'
21757 d_oldpthreads='$d_oldpthreads'
21758 d_oldsock='$d_oldsock'
21760 d_pathconf='$d_pathconf'
21762 d_perl_otherlibdirs='$d_perl_otherlibdirs'
21763 d_phostname='$d_phostname'
21766 d_portable='$d_portable'
21767 d_printf_format_null='$d_printf_format_null'
21768 d_procselfexe='$d_procselfexe'
21769 d_pseudofork='$d_pseudofork'
21770 d_pthread_atfork='$d_pthread_atfork'
21771 d_pthread_attr_setscope='$d_pthread_attr_setscope'
21772 d_pthread_yield='$d_pthread_yield'
21774 d_pwchange='$d_pwchange'
21775 d_pwclass='$d_pwclass'
21776 d_pwcomment='$d_pwcomment'
21777 d_pwexpire='$d_pwexpire'
21778 d_pwgecos='$d_pwgecos'
21779 d_pwpasswd='$d_pwpasswd'
21780 d_pwquota='$d_pwquota'
21783 d_random_r='$d_random_r'
21784 d_readdir64_r='$d_readdir64_r'
21785 d_readdir='$d_readdir'
21786 d_readdir_r='$d_readdir_r'
21787 d_readlink='$d_readlink'
21789 d_recvmsg='$d_recvmsg'
21790 d_rename='$d_rename'
21791 d_rewinddir='$d_rewinddir'
21793 d_safebcpy='$d_safebcpy'
21794 d_safemcpy='$d_safemcpy'
21795 d_sanemcmp='$d_sanemcmp'
21796 d_sbrkproto='$d_sbrkproto'
21797 d_scalbnl='$d_scalbnl'
21798 d_sched_yield='$d_sched_yield'
21799 d_scm_rights='$d_scm_rights'
21800 d_seekdir='$d_seekdir'
21801 d_select='$d_select'
21803 d_semctl='$d_semctl'
21804 d_semctl_semid_ds='$d_semctl_semid_ds'
21805 d_semctl_semun='$d_semctl_semun'
21806 d_semget='$d_semget'
21808 d_sendmsg='$d_sendmsg'
21809 d_setegid='$d_setegid'
21810 d_seteuid='$d_seteuid'
21811 d_setgrent='$d_setgrent'
21812 d_setgrent_r='$d_setgrent_r'
21813 d_setgrps='$d_setgrps'
21814 d_sethent='$d_sethent'
21815 d_sethostent_r='$d_sethostent_r'
21816 d_setitimer='$d_setitimer'
21817 d_setlinebuf='$d_setlinebuf'
21818 d_setlocale='$d_setlocale'
21819 d_setlocale_r='$d_setlocale_r'
21820 d_setnent='$d_setnent'
21821 d_setnetent_r='$d_setnetent_r'
21822 d_setpent='$d_setpent'
21823 d_setpgid='$d_setpgid'
21824 d_setpgrp2='$d_setpgrp2'
21825 d_setpgrp='$d_setpgrp'
21826 d_setprior='$d_setprior'
21827 d_setproctitle='$d_setproctitle'
21828 d_setprotoent_r='$d_setprotoent_r'
21829 d_setpwent='$d_setpwent'
21830 d_setpwent_r='$d_setpwent_r'
21831 d_setregid='$d_setregid'
21832 d_setresgid='$d_setresgid'
21833 d_setresuid='$d_setresuid'
21834 d_setreuid='$d_setreuid'
21835 d_setrgid='$d_setrgid'
21836 d_setruid='$d_setruid'
21837 d_setsent='$d_setsent'
21838 d_setservent_r='$d_setservent_r'
21839 d_setsid='$d_setsid'
21840 d_setvbuf='$d_setvbuf'
21844 d_shmatprototype='$d_shmatprototype'
21845 d_shmctl='$d_shmctl'
21847 d_shmget='$d_shmget'
21848 d_sigaction='$d_sigaction'
21849 d_sigprocmask='$d_sigprocmask'
21850 d_sigsetjmp='$d_sigsetjmp'
21851 d_sitearch='$d_sitearch'
21852 d_snprintf='$d_snprintf'
21853 d_sockatmark='$d_sockatmark'
21854 d_sockatmarkproto='$d_sockatmarkproto'
21855 d_socket='$d_socket'
21856 d_socklen_t='$d_socklen_t'
21857 d_sockpair='$d_sockpair'
21858 d_socks5_init='$d_socks5_init'
21859 d_sprintf_returns_strlen='$d_sprintf_returns_strlen'
21861 d_srand48_r='$d_srand48_r'
21862 d_srandom_r='$d_srandom_r'
21863 d_sresgproto='$d_sresgproto'
21864 d_sresuproto='$d_sresuproto'
21865 d_statblks='$d_statblks'
21866 d_statfs_f_flags='$d_statfs_f_flags'
21867 d_statfs_s='$d_statfs_s'
21868 d_statvfs='$d_statvfs'
21869 d_stdio_cnt_lval='$d_stdio_cnt_lval'
21870 d_stdio_ptr_lval='$d_stdio_ptr_lval'
21871 d_stdio_ptr_lval_nochange_cnt='$d_stdio_ptr_lval_nochange_cnt'
21872 d_stdio_ptr_lval_sets_cnt='$d_stdio_ptr_lval_sets_cnt'
21873 d_stdio_stream_array='$d_stdio_stream_array'
21874 d_stdiobase='$d_stdiobase'
21875 d_stdstdio='$d_stdstdio'
21876 d_strchr='$d_strchr'
21877 d_strcoll='$d_strcoll'
21878 d_strctcpy='$d_strctcpy'
21879 d_strerrm='$d_strerrm'
21880 d_strerror='$d_strerror'
21881 d_strerror_r='$d_strerror_r'
21882 d_strftime='$d_strftime'
21883 d_strlcat='$d_strlcat'
21884 d_strlcpy='$d_strlcpy'
21885 d_strtod='$d_strtod'
21886 d_strtol='$d_strtol'
21887 d_strtold='$d_strtold'
21888 d_strtoll='$d_strtoll'
21889 d_strtoq='$d_strtoq'
21890 d_strtoul='$d_strtoul'
21891 d_strtoull='$d_strtoull'
21892 d_strtouq='$d_strtouq'
21893 d_strxfrm='$d_strxfrm'
21894 d_suidsafe='$d_suidsafe'
21895 d_symlink='$d_symlink'
21896 d_syscall='$d_syscall'
21897 d_syscallproto='$d_syscallproto'
21898 d_sysconf='$d_sysconf'
21899 d_sysernlst='$d_sysernlst'
21900 d_syserrlst='$d_syserrlst'
21901 d_system='$d_system'
21902 d_tcgetpgrp='$d_tcgetpgrp'
21903 d_tcsetpgrp='$d_tcsetpgrp'
21904 d_telldir='$d_telldir'
21905 d_telldirproto='$d_telldirproto'
21908 d_tm_tm_gmtoff='$d_tm_tm_gmtoff'
21909 d_tm_tm_zone='$d_tm_tm_zone'
21910 d_tmpnam_r='$d_tmpnam_r'
21911 d_truncate='$d_truncate'
21912 d_ttyname_r='$d_ttyname_r'
21913 d_tzname='$d_tzname'
21914 d_u32align='$d_u32align'
21915 d_ualarm='$d_ualarm'
21918 d_union_semun='$d_union_semun'
21919 d_unordered='$d_unordered'
21920 d_unsetenv='$d_unsetenv'
21921 d_usleep='$d_usleep'
21922 d_usleepproto='$d_usleepproto'
21924 d_vendorarch='$d_vendorarch'
21925 d_vendorbin='$d_vendorbin'
21926 d_vendorlib='$d_vendorlib'
21927 d_vendorscript='$d_vendorscript'
21929 d_void_closedir='$d_void_closedir'
21930 d_voidsig='$d_voidsig'
21931 d_voidtty='$d_voidtty'
21932 d_volatile='$d_volatile'
21933 d_vprintf='$d_vprintf'
21934 d_vsnprintf='$d_vsnprintf'
21936 d_waitpid='$d_waitpid'
21937 d_wcstombs='$d_wcstombs'
21938 d_wctomb='$d_wctomb'
21939 d_writev='$d_writev'
21942 db_hashtype='$db_hashtype'
21943 db_prefixtype='$db_prefixtype'
21944 db_version_major='$db_version_major'
21945 db_version_minor='$db_version_minor'
21946 db_version_patch='$db_version_patch'
21947 defvoidused='$defvoidused'
21948 direntrytype='$direntrytype'
21951 doublesize='$doublesize'
21953 drand48_r_proto='$drand48_r_proto'
21954 dynamic_ext='$dynamic_ext'
21960 endgrent_r_proto='$endgrent_r_proto'
21961 endhostent_r_proto='$endhostent_r_proto'
21962 endnetent_r_proto='$endnetent_r_proto'
21963 endprotoent_r_proto='$endprotoent_r_proto'
21964 endpwent_r_proto='$endpwent_r_proto'
21965 endservent_r_proto='$endservent_r_proto'
21966 eunicefix='$eunicefix'
21969 extensions='$extensions'
21971 fflushNULL='$fflushNULL'
21972 fflushall='$fflushall'
21974 firstmakefile='$firstmakefile'
21976 fpossize='$fpossize'
21977 fpostype='$fpostype'
21978 freetype='$freetype'
21981 full_csh='$full_csh'
21982 full_sed='$full_sed'
21983 gccansipedantic='$gccansipedantic'
21984 gccosandvers='$gccosandvers'
21985 gccversion='$gccversion'
21986 getgrent_r_proto='$getgrent_r_proto'
21987 getgrgid_r_proto='$getgrgid_r_proto'
21988 getgrnam_r_proto='$getgrnam_r_proto'
21989 gethostbyaddr_r_proto='$gethostbyaddr_r_proto'
21990 gethostbyname_r_proto='$gethostbyname_r_proto'
21991 gethostent_r_proto='$gethostent_r_proto'
21992 getlogin_r_proto='$getlogin_r_proto'
21993 getnetbyaddr_r_proto='$getnetbyaddr_r_proto'
21994 getnetbyname_r_proto='$getnetbyname_r_proto'
21995 getnetent_r_proto='$getnetent_r_proto'
21996 getprotobyname_r_proto='$getprotobyname_r_proto'
21997 getprotobynumber_r_proto='$getprotobynumber_r_proto'
21998 getprotoent_r_proto='$getprotoent_r_proto'
21999 getpwent_r_proto='$getpwent_r_proto'
22000 getpwnam_r_proto='$getpwnam_r_proto'
22001 getpwuid_r_proto='$getpwuid_r_proto'
22002 getservbyname_r_proto='$getservbyname_r_proto'
22003 getservbyport_r_proto='$getservbyport_r_proto'
22004 getservent_r_proto='$getservent_r_proto'
22005 getspnam_r_proto='$getspnam_r_proto'
22006 gidformat='$gidformat'
22012 gmtime_r_proto='$gmtime_r_proto'
22013 gnulibc_version='$gnulibc_version'
22015 groupcat='$groupcat'
22016 groupstype='$groupstype'
22019 h_sysfile='$h_sysfile'
22022 html1dir='$html1dir'
22023 html1direxp='$html1direxp'
22024 html3dir='$html3dir'
22025 html3direxp='$html3direxp'
22034 i_arpainet='$i_arpainet'
22035 i_bsdioctl='$i_bsdioctl'
22039 i_dirent='$i_dirent'
22045 i_fp_class='$i_fp_class'
22048 i_ieeefp='$i_ieeefp'
22049 i_inttypes='$i_inttypes'
22050 i_langinfo='$i_langinfo'
22051 i_libutil='$i_libutil'
22052 i_limits='$i_limits'
22053 i_locale='$i_locale'
22054 i_machcthr='$i_machcthr'
22055 i_malloc='$i_malloc'
22057 i_memory='$i_memory'
22058 i_mntent='$i_mntent'
22061 i_neterrno='$i_neterrno'
22062 i_netinettcp='$i_netinettcp'
22066 i_pthread='$i_pthread'
22068 i_rpcsvcdbm='$i_rpcsvcdbm'
22071 i_shadow='$i_shadow'
22073 i_stdarg='$i_stdarg'
22074 i_stddef='$i_stddef'
22075 i_stdlib='$i_stdlib'
22076 i_string='$i_string'
22077 i_sunmath='$i_sunmath'
22078 i_sysaccess='$i_sysaccess'
22079 i_sysdir='$i_sysdir'
22080 i_sysfile='$i_sysfile'
22081 i_sysfilio='$i_sysfilio'
22083 i_sysioctl='$i_sysioctl'
22084 i_syslog='$i_syslog'
22085 i_sysmman='$i_sysmman'
22086 i_sysmode='$i_sysmode'
22087 i_sysmount='$i_sysmount'
22088 i_sysndir='$i_sysndir'
22089 i_sysparam='$i_sysparam'
22090 i_sysresrc='$i_sysresrc'
22091 i_syssecrt='$i_syssecrt'
22092 i_sysselct='$i_sysselct'
22093 i_syssockio='$i_syssockio'
22094 i_sysstat='$i_sysstat'
22095 i_sysstatfs='$i_sysstatfs'
22096 i_sysstatvfs='$i_sysstatvfs'
22097 i_systime='$i_systime'
22098 i_systimek='$i_systimek'
22099 i_systimes='$i_systimes'
22100 i_systypes='$i_systypes'
22101 i_sysuio='$i_sysuio'
22103 i_sysutsname='$i_sysutsname'
22104 i_sysvfs='$i_sysvfs'
22105 i_syswait='$i_syswait'
22106 i_termio='$i_termio'
22107 i_termios='$i_termios'
22109 i_unistd='$i_unistd'
22112 i_values='$i_values'
22113 i_varargs='$i_varargs'
22114 i_varhdr='$i_varhdr'
22116 ignore_versioned_solibs='$ignore_versioned_solibs'
22117 inc_version_list='$inc_version_list'
22118 inc_version_list_init='$inc_version_list_init'
22121 initialinstalllocation='$initialinstalllocation'
22122 installarchlib='$installarchlib'
22123 installbin='$installbin'
22124 installhtml1dir='$installhtml1dir'
22125 installhtml3dir='$installhtml3dir'
22126 installman1dir='$installman1dir'
22127 installman3dir='$installman3dir'
22128 installprefix='$installprefix'
22129 installprefixexp='$installprefixexp'
22130 installprivlib='$installprivlib'
22131 installscript='$installscript'
22132 installsitearch='$installsitearch'
22133 installsitebin='$installsitebin'
22134 installsitehtml1dir='$installsitehtml1dir'
22135 installsitehtml3dir='$installsitehtml3dir'
22136 installsitelib='$installsitelib'
22137 installsiteman1dir='$installsiteman1dir'
22138 installsiteman3dir='$installsiteman3dir'
22139 installsitescript='$installsitescript'
22140 installstyle='$installstyle'
22141 installusrbinperl='$installusrbinperl'
22142 installvendorarch='$installvendorarch'
22143 installvendorbin='$installvendorbin'
22144 installvendorhtml1dir='$installvendorhtml1dir'
22145 installvendorhtml3dir='$installvendorhtml3dir'
22146 installvendorlib='$installvendorlib'
22147 installvendorman1dir='$installvendorman1dir'
22148 installvendorman3dir='$installvendorman3dir'
22149 installvendorscript='$installvendorscript'
22151 issymlink='$issymlink'
22152 ivdformat='$ivdformat'
22155 known_extensions='$known_extensions'
22158 lddlflags='$lddlflags'
22160 ldflags_uselargefiles='$ldflags_uselargefiles'
22161 ldlibpthname='$ldlibpthname'
22168 libsdirs='$libsdirs'
22169 libsfiles='$libsfiles'
22170 libsfound='$libsfound'
22171 libspath='$libspath'
22172 libswanted='$libswanted'
22173 libswanted_uselargefiles='$libswanted_uselargefiles'
22179 localtime_r_proto='$localtime_r_proto'
22180 locincpth='$locincpth'
22181 loclibpth='$loclibpth'
22182 longdblsize='$longdblsize'
22183 longlongsize='$longlongsize'
22184 longsize='$longsize'
22188 lseeksize='$lseeksize'
22189 lseektype='$lseektype'
22192 madlyobj='$madlyobj'
22193 madlysrc='$madlysrc'
22197 make_set_make='$make_set_make'
22198 mallocobj='$mallocobj'
22199 mallocsrc='$mallocsrc'
22200 malloctype='$malloctype'
22202 man1direxp='$man1direxp'
22205 man3direxp='$man3direxp'
22207 mips_type='$mips_type'
22208 mistrustnm='$mistrustnm'
22210 mmaptype='$mmaptype'
22211 modetype='$modetype'
22213 multiarch='$multiarch'
22215 myarchname='$myarchname'
22216 mydomain='$mydomain'
22217 myhostname='$myhostname'
22220 need_va_copy='$need_va_copy'
22221 netdb_hlen_type='$netdb_hlen_type'
22222 netdb_host_type='$netdb_host_type'
22223 netdb_name_type='$netdb_name_type'
22224 netdb_net_type='$netdb_net_type'
22227 nm_so_opt='$nm_so_opt'
22228 nonxs_ext='$nonxs_ext'
22230 nvEUformat='$nvEUformat'
22231 nvFUformat='$nvFUformat'
22232 nvGUformat='$nvGUformat'
22233 nv_preserves_uv_bits='$nv_preserves_uv_bits'
22234 nveformat='$nveformat'
22235 nvfformat='$nvfformat'
22236 nvgformat='$nvgformat'
22239 o_nonblock='$o_nonblock'
22241 old_pthread_create_joinable='$old_pthread_create_joinable'
22242 optimize='$optimize'
22243 orderlib='$orderlib'
22246 otherlibdirs='$otherlibdirs'
22250 patchlevel='$patchlevel'
22251 path_sep='$path_sep'
22254 perl_patchlevel='$perl_patchlevel'
22255 perladmin='$perladmin'
22256 perllibs='$perllibs'
22257 perlpath='$perlpath'
22259 phostname='$phostname'
22265 prefixexp='$prefixexp'
22267 privlibexp='$privlibexp'
22268 procselfexe='$procselfexe'
22269 prototype='$prototype'
22271 quadkind='$quadkind'
22272 quadtype='$quadtype'
22273 randbits='$randbits'
22274 randfunc='$randfunc'
22275 random_r_proto='$random_r_proto'
22276 randseedtype='$randseedtype'
22278 rd_nodata='$rd_nodata'
22279 readdir64_r_proto='$readdir64_r_proto'
22280 readdir_r_proto='$readdir_r_proto'
22281 revision='$revision'
22286 sPRIEUldbl='$sPRIEUldbl'
22287 sPRIFUldbl='$sPRIFUldbl'
22288 sPRIGUldbl='$sPRIGUldbl'
22289 sPRIXU64='$sPRIXU64'
22291 sPRIeldbl='$sPRIeldbl'
22292 sPRIfldbl='$sPRIfldbl'
22293 sPRIgldbl='$sPRIgldbl'
22298 sSCNfldbl='$sSCNfldbl'
22299 sched_yield='$sched_yield'
22300 scriptdir='$scriptdir'
22301 scriptdirexp='$scriptdirexp'
22303 seedfunc='$seedfunc'
22304 selectminbits='$selectminbits'
22305 selecttype='$selecttype'
22306 sendmail='$sendmail'
22307 setgrent_r_proto='$setgrent_r_proto'
22308 sethostent_r_proto='$sethostent_r_proto'
22309 setlocale_r_proto='$setlocale_r_proto'
22310 setnetent_r_proto='$setnetent_r_proto'
22311 setprotoent_r_proto='$setprotoent_r_proto'
22312 setpwent_r_proto='$setpwent_r_proto'
22313 setservent_r_proto='$setservent_r_proto'
22316 sharpbang='$sharpbang'
22317 shmattype='$shmattype'
22318 shortsize='$shortsize'
22321 sig_count='$sig_count'
22322 sig_name='$sig_name'
22323 sig_name_init='$sig_name_init'
22325 sig_num_init='$sig_num_init'
22326 sig_size='$sig_size'
22327 signal_t='$signal_t'
22328 sitearch='$sitearch'
22329 sitearchexp='$sitearchexp'
22331 sitebinexp='$sitebinexp'
22332 sitehtml1dir='$sitehtml1dir'
22333 sitehtml1direxp='$sitehtml1direxp'
22334 sitehtml3dir='$sitehtml3dir'
22335 sitehtml3direxp='$sitehtml3direxp'
22337 sitelib_stem='$sitelib_stem'
22338 sitelibexp='$sitelibexp'
22339 siteman1dir='$siteman1dir'
22340 siteman1direxp='$siteman1direxp'
22341 siteman3dir='$siteman3dir'
22342 siteman3direxp='$siteman3direxp'
22343 siteprefix='$siteprefix'
22344 siteprefixexp='$siteprefixexp'
22345 sitescript='$sitescript'
22346 sitescriptexp='$sitescriptexp'
22347 sizesize='$sizesize'
22348 sizetype='$sizetype'
22352 sockethdr='$sockethdr'
22353 socketlib='$socketlib'
22354 socksizetype='$socksizetype'
22356 spackage='$spackage'
22357 spitshell='$spitshell'
22358 srand48_r_proto='$srand48_r_proto'
22359 srandom_r_proto='$srandom_r_proto'
22361 ssizetype='$ssizetype'
22362 startperl='$startperl'
22364 static_ext='$static_ext'
22366 stdio_base='$stdio_base'
22367 stdio_bufsiz='$stdio_bufsiz'
22368 stdio_cnt='$stdio_cnt'
22369 stdio_filbuf='$stdio_filbuf'
22370 stdio_ptr='$stdio_ptr'
22371 stdio_stream_array='$stdio_stream_array'
22372 strerror_r_proto='$strerror_r_proto'
22375 subversion='$subversion'
22379 targetarch='$targetarch'
22383 timeincl='$timeincl'
22384 timetype='$timetype'
22385 tmpnam_r_proto='$tmpnam_r_proto'
22391 ttyname_r_proto='$ttyname_r_proto'
22400 uidformat='$uidformat'
22406 uquadtype='$uquadtype'
22407 use5005threads='$use5005threads'
22408 use64bitall='$use64bitall'
22409 use64bitint='$use64bitint'
22410 usecrosscompile='$usecrosscompile'
22412 usefaststdio='$usefaststdio'
22413 useithreads='$useithreads'
22414 uselargefiles='$uselargefiles'
22415 uselongdouble='$uselongdouble'
22416 usemallocwrap='$usemallocwrap'
22417 usemorebits='$usemorebits'
22418 usemultiplicity='$usemultiplicity'
22419 usemymalloc='$usemymalloc'
22421 useopcode='$useopcode'
22422 useperlio='$useperlio'
22423 useposix='$useposix'
22424 usereentrant='$usereentrant'
22425 userelocatableinc='$userelocatableinc'
22427 useshrplib='$useshrplib'
22428 usesitecustomize='$usesitecustomize'
22429 usesocks='$usesocks'
22430 usethreads='$usethreads'
22431 usevendorprefix='$usevendorprefix'
22432 usevfork='$usevfork'
22435 uvXUformat='$uvXUformat'
22436 uvoformat='$uvoformat'
22439 uvuformat='$uvuformat'
22440 uvxformat='$uvxformat'
22441 vendorarch='$vendorarch'
22442 vendorarchexp='$vendorarchexp'
22443 vendorbin='$vendorbin'
22444 vendorbinexp='$vendorbinexp'
22445 vendorhtml1dir='$vendorhtml1dir'
22446 vendorhtml1direxp='$vendorhtml1direxp'
22447 vendorhtml3dir='$vendorhtml3dir'
22448 vendorhtml3direxp='$vendorhtml3direxp'
22449 vendorlib='$vendorlib'
22450 vendorlib_stem='$vendorlib_stem'
22451 vendorlibexp='$vendorlibexp'
22452 vendorman1dir='$vendorman1dir'
22453 vendorman1direxp='$vendorman1direxp'
22454 vendorman3dir='$vendorman3dir'
22455 vendorman3direxp='$vendorman3direxp'
22456 vendorprefix='$vendorprefix'
22457 vendorprefixexp='$vendorprefixexp'
22458 vendorscript='$vendorscript'
22459 vendorscriptexp='$vendorscriptexp'
22461 version_patchlevel_string='$version_patchlevel_string'
22462 versiononly='$versiononly'
22464 voidflags='$voidflags'
22467 yaccflags='$yaccflags'
22472 : Add in command line options if available
22473 $test -f UU/cmdline.opt && $cat UU/cmdline.opt >> config.sh
22475 : add special variables
22476 $test -f $src/patchlevel.h && \
22477 awk '/^#define[ ]+PERL_/ {printf "%s=%s\n",$2,$3}' $src/patchlevel.h >>config.sh
22478 echo "PERL_PATCHLEVEL=$perl_patchlevel" >>config.sh
22479 echo "PERL_CONFIG_SH=true" >>config.sh
22481 : propagate old symbols
22482 if $test -f UU/config.sh; then
22483 <UU/config.sh $sort | $uniq >UU/oldconfig.sh
22484 sed -n 's/^\([a-zA-Z_0-9]*\)=.*/\1/p' config.sh config.sh UU/oldconfig.sh |\
22485 $sort | $uniq -u >UU/oldsyms
22486 set X `cat UU/oldsyms`
22492 Hmm...You had some extra variables I don't know about...I'll try to keep 'em...
22494 echo "# Variables propagated from previous config.sh file." >>config.sh
22495 for sym in `cat UU/oldsyms`; do
22496 echo " Propagating $hint variable "'$'"$sym..."
22497 eval 'tmp="$'"${sym}"'"'
22499 sed -e "s/'/'\"'\"'/g" -e "s/^/$sym='/" -e "s/$/'/" >>config.sh
22505 : Finish up by extracting the .SH files
22509 echo "Extraction done."
22519 If you'd like to make any changes to the config.sh file before I begin
22520 to configure things, do it as a shell escape now (e.g. !vi config.sh).
22523 rp="Press return or use a shell escape to edit config.sh:"
22528 *) : in case they cannot read
22529 sh 1>&4 -c "$ans";;
22534 : if this fails, just run all the .SH files by hand
22543 if $contains '^depend:' [Mm]akefile >/dev/null 2>&1; then
22550 Now you need to generate make dependencies by running "$make depend".
22551 You might prefer to run it in background: "$make depend > makedepend.out &"
22552 It can take a while, so you might not want to run it right now.
22557 rp="Run $make depend now?"
22561 $make depend && echo "Now you must run '$make'."
22564 echo "You must run '$make depend' then '$make'."
22567 elif test -f [Mm]akefile; then
22569 echo "Now you must run a $make."
22571 echo "Configure done."
22574 if $test -f Policy.sh; then
22577 If you compile $package on a different machine or from a different object
22578 directory, copy the Policy.sh file from this object directory to the
22579 new one before you run Configure -- this will help you with most of
22580 the policy defaults.
22584 if $test -f config.msg; then
22585 echo "Hmm. I also noted the following information while running:"
22587 $cat config.msg >&4
22590 $rm -f kit*isdone ark*isdone