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 Wed Nov 15 22:26:01 CET 2006 [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=''
942 d_inc_version_list=''
944 inc_version_list_init=''
963 ignore_versioned_solibs=''
1027 d_perl_otherlibdirs=''
1035 api_versionstring=''
1041 version_patchlevel_string=''
1045 d_nv_preserves_uv=''
1046 d_nv_zero_is_allbits_zero=''
1057 nv_preserves_uv_bits=''
1129 installsitehtml1dir=''
1132 installsitehtml3dir=''
1139 installsiteman1dir=''
1142 installsiteman3dir=''
1147 installsitescript=''
1162 d_stdio_stream_array=''
1163 stdio_stream_array=''
1174 ccflags_uselargefiles=''
1175 ldflags_uselargefiles=''
1176 libswanted_uselargefiles=''
1196 installvendorarch=''
1203 installvendorhtml1dir=''
1205 vendorhtml1direxp=''
1206 installvendorhtml3dir=''
1208 vendorhtml3direxp=''
1214 installvendorman1dir=''
1217 installvendorman3dir=''
1224 installvendorscript=''
1236 smallmach='pdp11 i8086 z8000 i80286 iAPX286'
1239 : We must find out about Eunice early
1241 if test -f /etc/unixtovms; then
1242 eunicefix=/etc/unixtovms
1244 if test -f /etc/unixtovms.exe; then
1245 eunicefix=/etc/unixtovms.exe
1248 : Set executable suffix now -- needed before hints available
1249 if test -f "/libs/version.library"; then
1252 elif test -f "/system/gnu_library/bin/ar.pm"; then
1255 elif test -n "$DJGPP"; then
1258 elif test -d c:/. -o -n "$is_os2" ; then
1267 : set useposix=false in your hint file to disable the POSIX extension.
1269 : set useopcode=false in your hint file to disable the Opcode extension.
1271 : Trailing extension. Override this in a hint file, if needed.
1272 : Extra object files, if any, needed on this platform.
1275 : Possible local include directories to search.
1276 : Set locincpth to "" in a hint file to defeat local include searches.
1277 locincpth="/usr/local/include /opt/local/include /usr/gnu/include"
1278 locincpth="$locincpth /opt/gnu/include /usr/GNU/include /opt/GNU/include"
1280 : no include file wanted by default
1283 : Enable -DEBUGGING and -DDEBUGGING from the command line
1289 : change the next line if compiling for Xenix/286 on Xenix/386
1290 xlibpth='/usr/lib/386 /lib/386'
1291 : Possible local library directories to search.
1292 loclibpth="/usr/local/lib /opt/local/lib /usr/gnu/lib"
1293 loclibpth="$loclibpth /opt/gnu/lib /usr/GNU/lib /opt/GNU/lib"
1295 : general looking path for locating libraries
1296 glibpth="/lib /usr/lib $xlibpth"
1297 glibpth="$glibpth /usr/ccs/lib /usr/ucblib /usr/local/lib"
1298 test -f /usr/shlib/libc.so && glibpth="/usr/shlib $glibpth"
1299 test -f /shlib/libc.so && glibpth="/shlib $glibpth"
1301 : Private path used by Configure to find libraries. Its value
1302 : is prepended to libpth. This variable takes care of special
1303 : machines, like the mips. Usually, it should be empty.
1306 : default library list
1308 : some systems want to use only the non-versioned libso:s
1309 ignore_versioned_solibs=''
1314 ccflags_uselargefiles=''
1315 ldflags_uselargefiles=''
1316 libswanted_uselargefiles=''
1317 : set usemultiplicity on the Configure command line to enable multiplicity.
1318 : set usesocks on the Configure command line to enable socks.
1319 : set usethreads on the Configure command line to enable threads.
1320 usereentrant='undef'
1321 : full support for void wanted by default
1324 : List of libraries we want.
1325 : If anyone needs extra -lxxx, put those in a hint file.
1326 libswanted="sfio socket bind inet nsl nm ndbm gdbm dbm db malloc dl dld ld sun"
1327 libswanted="$libswanted m crypt sec util c cposix posix ucb bsd BSD"
1328 : We probably want to search /usr/shlib before most other libraries.
1329 : This is only used by the lib/ExtUtils/MakeMaker.pm routine extliblist.
1330 glibpth=`echo " $glibpth " | sed -e 's! /usr/shlib ! !'`
1331 glibpth="/usr/shlib $glibpth"
1332 : Do not use vfork unless overridden by a hint file.
1335 : Find the basic shell for Bourne shell scripts
1339 *bsd*|sys5*) xxx="/$SYSTYPE/bin/sh";;
1342 if test -f "$xxx"; then
1345 : Build up a list and do a single loop so we can 'break' out.
1346 pth=`echo $PATH | sed -e "s/$p_/ /g"`
1347 for xxx in sh bash ksh pdksh ash; do
1349 try="$try ${p}/${xxx}"
1353 if test -f "$xxx"; then
1356 elif test "X$_exe" != X -a -f "$xxx$_exe"; then
1359 elif test -f "$xxx.exe"; then
1370 $me: Fatal Error: I can't find a Bourne Shell anywhere.
1372 Usually it's in /bin/sh. How did you even get this far?
1373 Please contact me (Perl Maintainers) at perlbug@perl.org and
1374 we'll try to straighten this all out.
1380 : see if sh knows # comments
1381 if `$sh -c '#' >/dev/null 2>&1`; then
1385 test -f $xcat$_exe || xcat=/usr/bin/cat
1386 if test ! -f $xcat$_exe; then
1387 for p in `echo $PATH | sed -e "s/$p_/ /g"` $paths; do
1388 if test -f $p/cat$_exe; then
1393 if test ! -f $xcat$_exe; then
1394 echo "Can't find cat anywhere!"
1398 echo "#!$xcat" >sharp
1402 if test -s today; then
1405 echo "#! $xcat" > sharp
1409 if test -s today; then
1417 echo "Your $sh doesn't grok # comments--I will strip them later on."
1420 echo "exec grep -v '^[ ]*#'" >spitshell
1422 $eunicefix spitshell
1423 spitshell=`pwd`/spitshell
1425 echo "I presume that if # doesn't work, #! won't work either!"
1430 : figure out how to guarantee sh startup
1432 '') startsh=${sharpbang}${sh} ;;
1444 : echo "Yup, it does."
1446 echo "Hmm... '$startsh' does not guarantee sh startup..."
1447 echo "You may have to fix up the shell scripts to make sure $sh runs them."
1452 : Save command line options in file UU/cmdline.opt for later use in
1453 : generating config.sh.
1454 cat > cmdline.opt <<EOSH
1455 # Configure command line arguments.
1464 cat >>cmdline.opt <<EOSH
1465 config_arg$argn='$arg'
1467 # Extreme backslashitis: replace each ' by '"'"'
1468 cat <<EOC | sed -e "s/'/'"'"'"'"'"'"'/g" > cmdl.opt
1471 arg_exp=`cat cmdl.opt`
1472 args_exp="$args_exp$args_sep'$arg_exp'"
1473 argn=`expr $argn + 1`
1476 # args_exp is good for restarting self: eval "set X $args_exp"; shift; $0 "$@"
1477 # used by ./hints/os2.sh
1480 : produce awk script to parse command line options
1481 cat >options.awk <<'EOF'
1483 optstr = "A:dD:eEf:hKOrsSU:V"; # getopt-style specification
1485 len = length(optstr);
1486 for (i = 1; i <= len; i++) {
1487 c = substr(optstr, i, 1);
1488 if (i < len) a = substr(optstr, i + 1, 1); else a = "";
1499 if (substr(str, 1, 1) != "-") {
1500 printf("'%s'\n", str);
1504 for (i = 2; i <= len; i++) {
1505 c = substr(str, i, 1);
1507 printf("-%s\n", substr(str, i));
1513 printf("'%s'\n", substr(str, i + 1));
1526 : process the command line options
1527 set X `for arg in "$@"; do echo "X$arg"; done |
1528 sed -e s/X// | awk -f options.awk`
1533 : set up default values
1543 rm -f optdef.sh posthint.sh
1544 cat >optdef.sh <<EOS
1550 while test $# -gt 0; do
1552 -d) shift; fastread=yes;;
1553 -e) shift; alldone=cont;;
1557 if test -r "$1"; then
1560 echo "$me: cannot read config file $1." >&2
1565 -h) shift; error=true;;
1566 -r) shift; reuseval=true;;
1567 -s) shift; silent=true; realsilent=true;;
1568 -E) shift; alldone=exit;;
1569 -K) shift; knowitall=true;;
1570 -O) shift; override=true;;
1571 -S) shift; silent=true; extractsh=true;;
1576 echo "$me: use '-U symbol=', not '-D symbol='." >&2
1577 echo "$me: ignoring -D $1" >&2
1580 sed -e "s/'/'\"'\"'/g" -e "s/=\(.*\)/='\1'/" >> optdef.sh;;
1581 *) echo "$1='define'" >> optdef.sh;;
1588 *=) echo "$1" >> optdef.sh;;
1590 echo "$me: use '-D symbol=val', not '-U symbol=val'." >&2
1591 echo "$me: ignoring -U $1" >&2
1593 *) echo "$1='undef'" >> optdef.sh;;
1604 *=*) zzz=`echo "$yyy"|sed 's!=.*!!'`
1608 zzz=" "`echo "$yyy"|sed 's!^[^=]*=!!'`
1609 yyy=`echo "$yyy"|sed 's!=.*!!'` ;;
1615 *:*) xxx=`echo "$yyy"|sed 's!:.*!!'`
1616 yyy=`echo "$yyy"|sed 's!^[^:]*:!!'`
1617 zzz=`echo "$yyy"|sed 's!^[^=]*=!!'`
1618 yyy=`echo "$yyy"|sed 's!=.*!!'` ;;
1619 *) xxx=`echo "$yyy"|sed 's!:.*!!'`
1620 yyy=`echo "$yyy"|sed 's!^[^:]*:!!'` ;;
1626 echo "$yyy=\"\${$yyy}$zzz\"" >> posthint.sh ;;
1628 echo "$yyy=''" >> posthint.sh ;;
1633 echo "$yyy='$zzz'" >> posthint.sh ;;
1635 echo "eval \"$yyy=$zzz\"" >> posthint.sh ;;
1637 echo "$yyy=\"$zzz\${$yyy}\"" >> posthint.sh ;;
1642 echo "$yyy=$zzz" >> posthint.sh ;;
1643 *) echo "$me: unknown -A command '$xxx', ignoring -A $1" >&2 ;;
1647 -V) echo "$me generated by metaconfig 3.0 PL70." >&2
1650 -*) echo "$me: unknown option $1" >&2; shift; error=true;;
1658 Usage: $me [-dehrsEKOSV] [-f config.sh] [-D symbol] [-D symbol=value]
1659 [-U symbol] [-U symbol=] [-A command:symbol...]
1660 -d : use defaults for all answers.
1661 -e : go on without questioning past the production of config.sh.
1662 -f : specify an alternate default configuration file.
1663 -h : print this help message and exit (with an error status).
1664 -r : reuse C symbols value if possible (skips costly nm extraction).
1665 -s : silent mode, only echoes questions and essential information.
1666 -D : define symbol to have some value:
1667 -D symbol symbol gets the value 'define'
1668 -D symbol=value symbol gets the value 'value'
1669 -E : stop at the end of questions, after having produced config.sh.
1670 -K : do not use unless you know what you are doing.
1671 -O : let -D and -U override definitions from loaded configuration file.
1672 -S : perform variable substitutions on all .SH files (can mix with -f)
1673 -U : undefine symbol:
1674 -U symbol symbol gets the value 'undef'
1675 -U symbol= symbol gets completely empty
1676 -A : manipulate symbol after the platform specific hints have been applied:
1677 -A symbol=value append " "value to symbol
1678 -A append:symbol=value append value to symbol
1679 -A define:symbol=value define symbol to have value
1680 -A clear:symbol define symbol to be ''
1681 -A define:symbol define symbol to be 'define'
1682 -A eval:symbol=value define symbol to be eval of value
1683 -A prepend:symbol=value prepend value to symbol
1684 -A undef:symbol define symbol to be 'undef'
1685 -A undef:symbol= define symbol to be ''
1686 -V : print version number and exit (with a zero status).
1693 case "$fastread$alldone" in
1696 case "$extractsh" in
1699 if test ! -t 0; then
1700 echo "Say 'sh Configure', not 'sh <Configure'"
1710 true) exec 1>/dev/null;;
1713 : run the defines and the undefines, if any, but leave the file out there...
1716 : create the posthint manipulation script and leave the file out there...
1721 first=`echo $package | sed -e 's/^\(.\).*/\1/'`
1722 last=`echo $package | sed -e 's/^.\(.*\)/\1/'`
1723 case "`echo AbyZ | tr '[:lower:]' '[:upper:]' 2>/dev/null`" in
1724 ABYZ) spackage=`echo $first | tr '[:lower:]' '[:upper:]'`$last;;
1725 *) spackage=`echo $first | tr '[a-z]' '[A-Z]'`$last;;
1728 : Some greps do not return status, grrr.
1729 echo "grimblepritz" >grimble
1730 if grep blurfldyick grimble >/dev/null 2>&1 ; then
1732 elif grep grimblepritz grimble >/dev/null 2>&1 ; then
1738 : the following should work in any shell
1742 echo "AGH! Grep doesn't return a status. Attempting remedial action."
1743 cat >contains <<'EOSS'
1744 grep "$1" "$2" >.greptmp && cat .greptmp && test -s .greptmp
1749 : Find the path to the source tree
1752 */*) src=`echo $0 | sed -e 's%/[^/][^/]*$%%'`
1756 *) src=`cd ../$src && pwd` ;;
1769 if test -f $rsrc/Configure && \
1770 $contains "^package=$package$" $rsrc/Configure >/dev/null 2>&1
1772 : found it, so we are ok.
1775 for src in . .. ../.. ../../.. ../../../..; do
1776 if test -f ../$src/Configure && \
1777 $contains "^package=$package$" ../$src/Configure >/dev/null 2>&1
1788 Sorry, I can't seem to locate the source dir for $package. Please start
1789 Configure with an explicit path -- i.e. /some/path/Configure.
1797 echo "Sources for $package found in \"$src\"." >&4
1801 : script used to extract .SH files with variable substitutions
1802 cat >extract <<'EOS'
1804 echo "Doing variable substitutions on .SH files..."
1805 if test -f MANIFEST; then
1806 set x `awk '{print $1}' < MANIFEST | grep '\.SH$'`
1808 echo "(Looking for .SH files under the source directory.)"
1809 set x `(cd "$src"; find . -name "*.SH" -print)`
1813 0) set x `(cd "$src"; echo *.SH)`; shift;;
1815 if test ! -f "$src/$1"; then
1821 while test $name; do
1822 if test ! -d "$name"; then
1823 create="$name $create";
1824 name=`echo $name | sed -e "s|^[^/]*$||"`;
1825 name=`echo $name | sed -e "s|\(.*\)/.*|\1|"`;
1830 for file in $create; do
1839 dir=`expr X$file : 'X\(.*\)/'`
1840 file=`expr X$file : 'X.*/\(.*\)'`
1841 (cd "$dir" && . ./$file)
1851 dir=`expr X$file : 'X\(.*\)/'`
1852 file=`expr X$file : 'X.*/\(.*\)'`
1853 (set x $dir; shift; eval $mkdir_p)
1854 sh <"$src/$dir/$file"
1863 if test -f "$src/config_h.SH"; then
1864 if test ! -f config.h; then
1865 : oops, they left it out of MANIFEST, probably, so do it anyway.
1866 . "$src/config_h.SH"
1871 : extract files and exit if asked to do so
1872 case "$extractsh" in
1874 case "$realsilent" in
1878 case "$config_sh" in
1879 '') config_sh='config.sh';;
1882 echo "Fetching answers from $config_sh..."
1885 test "$override" && . ./optdef.sh
1889 echo "Extraction done."
1894 : Eunice requires " " instead of "", can you believe it
1897 echo "Beginning of configuration questions for $package."
1899 trap 'echo " "; test -d ../UU && rm -rf X $rmlist; exit 1' 1 2 3 15
1901 : first determine how to suppress newline on echo command
1903 echo "Checking echo to see how to suppress newlines..."
1904 (echo "hi there\c" ; echo " ") >.echotmp
1905 if $contains c .echotmp >/dev/null 2>&1 ; then
1916 echo $n "The star should be here-->$c"
1920 : Now test for existence of everything in MANIFEST
1922 if test -f "$rsrc/MANIFEST"; then
1923 echo "First let's make sure your kit is complete. Checking..." >&4
1924 awk '$1 !~ /PACK[A-Z]+/ {print $1}' "$rsrc/MANIFEST" | (split -l 50 2>/dev/null || split -50)
1927 for filelist in x??; do
1928 (cd "$rsrc"; ls `cat "$tmppwd/$filelist"` >/dev/null 2>>"$tmppwd/missing")
1930 if test -s missing; then
1934 THIS PACKAGE SEEMS TO BE INCOMPLETE.
1936 You have the option of continuing the configuration process, despite the
1937 distinct possibility that your kit is damaged, by typing 'y'es. If you
1938 do, don't blame me if something goes wrong. I advise you to type 'n'o
1939 and contact the author (perlbug@perl.org).
1942 echo $n "Continue? [n] $c" >&4
1946 echo "Continuing..." >&4
1950 echo "ABORTING..." >&4
1955 echo "Looks good..."
1958 echo "There is no MANIFEST file. I hope your kit is complete !"
1963 : Find the appropriate value for a newline for tr
1964 if test -n "$DJGPP"; then
1967 if test X"$trnl" = X; then
1968 case "`echo foo|tr '\n' x 2>/dev/null`" in
1972 if test X"$trnl" = X; then
1973 case "`echo foo|tr '\012' x 2>/dev/null`" in
1974 foox) trnl='\012' ;;
1977 if test X"$trnl" = X; then
1978 case "`echo foo|tr '\r\n' xy 2>/dev/null`" in
1979 fooxy) trnl='\n\r' ;;
1982 if test X"$trnl" = X; then
1985 $me: Fatal Error: cannot figure out how to translate newlines with 'tr'.
1991 : compute the number of columns on the terminal for proper question formatting
1996 : set up the echo used in my read
1997 myecho="case \"\$xxxm\" in
1998 '') echo $n \"\$rp $c\" >&4;;
2000 '') echo $n \"[\$xxxm] $c\";;
2002 if test \`echo \"\$rp [\$xxxm] \" | wc -c\` -ge $COLUMNS; then
2004 echo $n \"[\$xxxm] $c\" >&4
2006 echo $n \"\$rp [\$xxxm] $c\" >&4
2012 : now set up to do reads with possible shell escape and default assignment
2018 case "\$fastread" in
2019 yes) case "\$dflt" in
2022 case "\$silent-\$rp" in
2027 *) case "\$silent" in
2028 true) case "\$rp" in
2033 while expr "X\$ans" : "X!" >/dev/null; do
2037 aok=''; eval "ans=\\"\$answ\\"" && aok=y
2045 set x \`expr "X\$ans" : "X!\(.*\)\$"\`
2054 set x \`expr "X\$ans" : "X&\(.*\)\$"\`
2059 echo "(OK, I'll run with -d after this question.)" >&4
2062 echo "*** Sorry, \$1 not supported yet." >&4
2072 echo "*** Substitution done -- please confirm."
2074 ans=\`echo $n "\$ans$c" | tr '$trnl' ' '\`
2079 echo "*** Error -- try again."
2086 case "\$ans\$xxxm\$nostick" in
2098 : create .config dir to save info across Configure sessions
2099 test -d ../.config || mkdir ../.config
2100 cat >../.config/README <<EOF
2101 This directory created by Configure to save information that should
2102 persist across sessions for $package.
2104 You may safely delete it if you wish.
2107 xversion=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
2109 $define|true|[yY]*) ;;
2110 *) case "$xversion" in
2113 *** WHOA THERE!!! ***
2115 This is an UNSTABLE DEVELOPMENT release.
2116 The version of this $package distribution is $xversion, that is, odd,
2117 (as opposed to even) and that signifies a development release.
2118 If you want a maintenance release, you want an even-numbered version.
2120 Do ***NOT*** install this into production use.
2121 Data corruption and crashes are possible.
2123 It is most seriously suggested that you do not continue any further
2124 unless you want to help in developing and debugging Perl.
2126 If you *still* want to build perl, you can answer 'y' now,
2127 or pass -Dusedevel to Configure.
2130 rp='Do you really want to continue?'
2134 [yY]) echo >&4 "Okay, continuing."
2135 usedevel="$define" ;;
2136 *) echo >&4 "Okay, bye."
2146 case "$versiononly" in
2147 '') versiononly="$define" ;;
2149 case "$installusrbinperl" in
2150 '') installusrbinperl="$undef" ;;
2155 : general instructions
2158 user=`(logname) 2>/dev/null`
2160 '') user=`whoami 2>&1`;;
2162 if $contains "^$user\$" ../.config/instruct >/dev/null 2>&1; then
2165 rp='Would you like to see the instructions?'
2176 This installation shell script will examine your system and ask you questions
2177 to determine how the perl5 package should be installed. If you get
2178 stuck on a question, you may use a ! shell escape to start a subshell or
2179 execute a command. Many of the questions will have default answers in square
2180 brackets; typing carriage return will give you the default.
2182 On some of the questions which ask for file or directory names you are allowed
2183 to use the ~name construct to specify the login directory belonging to "name",
2184 even if you don't have a shell which knows about that. Questions where this is
2185 allowed will be marked "(~name ok)".
2189 dflt='Type carriage return to continue'
2193 The prompter used in this script allows you to use shell variables and
2194 backticks in your answers. You may use $1, $2, etc... to refer to the words
2195 in the default answer, as if the default line was a set of arguments given to a
2196 script shell. This means you may also use $* to repeat the whole default line,
2197 so you do not have to re-type everything to add something to the default.
2199 Everytime there is a substitution, you will have to confirm. If there is an
2200 error (e.g. an unmatched backtick), the default answer will remain unchanged
2201 and you will be prompted again.
2203 If you are in a hurry, you may run 'Configure -d'. This will bypass nearly all
2204 the questions and use the computed defaults (or the previous answers if there
2205 was already a config.sh file). Type 'Configure -h' for a list of options.
2206 You may also start interactively and then answer '& -d' at any prompt to turn
2207 on the non-interactive behaviour for the remainder of the execution.
2213 Much effort has been expended to ensure that this shell script will run on any
2214 Unix system. If despite that it blows up on yours, your best bet is to edit
2215 Configure and run it again. If you can't run Configure for some reason,
2216 you'll have to generate a config.sh file by hand. Whatever problems you
2217 have, let me (perlbug@perl.org) know how I blew it.
2219 This installation script affects things in two ways:
2221 1) it may do direct variable substitutions on some of the files included
2223 2) it builds a config.h file for inclusion in C programs. You may edit
2224 any of these files as the need arises after running this script.
2226 If you make a mistake on a question, there is no easy way to back up to it
2227 currently. The easiest thing to do is to edit config.sh and rerun all the SH
2228 files. Configure will offer to let you do this before it runs the SH files.
2231 dflt='Type carriage return to continue'
2233 case "$firsttime" in
2234 true) echo $user >>../.config/instruct;;
2238 : find out where common programs are
2240 echo "Locating common programs..." >&4
2253 if test -d \$dir/\$thing; then
2259 for thisthing in \$dir/\$thing; do
2260 : just loop through to pick last item
2262 if test -f \$thisthing; then
2265 elif test "X$_exe" != X -a -f \$thisthing$_exe; then
2268 elif test -f \$dir/\$thing.exe; then
2269 if test -n "$DJGPP"; then
2270 echo \$dir/\$thing.exe
2271 elif test "$eunicefix" != ":"; then
2272 : on Eunice apparently
2326 pth=`echo $PATH | sed -e "s/$p_/ /g"`
2327 pth="$pth /lib /usr/lib"
2328 for file in $loclist; do
2332 if test -f "$xxx"; then
2335 echo "WARNING: no $xxx -- ignoring your setting for $file." >&4
2336 xxx=`./loc $file $file $pth`
2339 '') xxx=`./loc $file $file $pth`;;
2340 *) xxx=`./loc $xxx $xxx $pth`;;
2342 eval $file=$xxx$_exe
2346 echo $file is in $xxx.
2349 echo $file is in $xxx.
2352 echo "I don't know where '$file' is, and my life depends on it." >&4
2353 echo "Go find a public domain implementation or fix your PATH setting!" >&4
2359 echo "Don't worry if any of the following aren't found..."
2361 for file in $trylist; do
2365 if test -f "$xxx"; then
2368 echo "WARNING: no $xxx -- ignoring your setting for $file." >&4
2369 xxx=`./loc $file $file $pth`
2372 '') xxx=`./loc $file $file $pth`;;
2373 *) xxx=`./loc $xxx $xxx $pth`;;
2375 eval $file=$xxx$_exe
2379 echo $file is in $xxx.
2382 echo $file is in $xxx.
2385 echo "I don't see $file out there, $say."
2392 echo "Substituting grep for egrep."
2399 echo "Substituting cp for ln."
2408 echo "I can't find make or gmake, and my life depends on it." >&4
2409 echo "Go find a public domain implementation or fix your PATH setting!" >&4
2417 *) # We can't have osname yet.
2418 if test -f "/system/gnu_library/bin/ar.pm"; then # Stratus VOS
2419 # Assume that gmake, if found, is definitely GNU make
2420 # and prefer it over the system make.
2421 echo "Substituting gmake for make."
2429 echo "Hopefully test is built into your sh."
2432 if `sh -c "PATH= test true" >/dev/null 2>&1`; then
2433 echo "Using the test built into your sh."
2441 echo "Hopefully echo is built into your sh."
2446 echo "Checking compatibility between $echo and builtin echo (if any)..." >&4
2447 $echo $n "hi there$c" >foo1
2448 echo $n "hi there$c" >foo2
2449 if cmp foo1 foo2 >/dev/null 2>&1; then
2450 echo "They are compatible. In fact, they may be identical."
2457 They are not compatible! You are probably running ksh on a non-USG system.
2458 I'll have to use $echo instead of the builtin, since Bourne shell doesn't
2459 have echo built in and we may have to run some Bourne shell scripts. That
2460 means I'll have to use '$n$c' to suppress newlines now. Life is ridiculous.
2463 $echo $n "The star should be here-->$c"
2473 cat <<'EOSC' >>trygcc
2478 int main(int argc, char *argv[]) {
2482 if $cc -o try $ccflags $ldflags try.c; then
2485 echo "Uh-oh, the C compiler '$cc' doesn't seem to be working." >&4
2491 case "`$cc -v -c try.c 2>&1`" in
2494 if $test X"$trygcc" = Xyes; then
2495 if gcc -o try -c try.c; then
2497 echo "You seem to have a working gcc, though." >&4
2498 rp="Would you like to use it?"
2500 if $test -f myread; then
2503 if $test -f UU/myread; then
2506 echo "Cannot find myread, sorry. Aborting." >&2
2511 [yY]*) cc=gcc; ccname=gcc; ccflags=''; despair=no;
2512 if $test -f usethreads.cbu; then
2515 *** However, any setting of the C compiler flags (e.g. for thread support)
2516 *** has been lost. It may be necessary to pass -Dcc=gcc to Configure
2517 *** (together with e.g. -Dusethreads).
2533 cat <<'EOSC' >>checkcc
2538 int main(int argc, char *argv[]) {
2542 if $cc -o try $ccflags $ldflags try.c; then
2545 if $test X"$despair" = Xyes; then
2546 echo "Uh-oh, the C compiler '$cc' doesn't seem to be working." >&4
2549 You need to find a working C compiler.
2550 Either (purchase and) install the C compiler supplied by your OS vendor,
2551 or for a free C compiler try http://gcc.gnu.org/
2552 I cannot continue any further, aborting.
2561 : determine whether symbolic links are supported
2564 if $ln -s blurfl sym > /dev/null 2>&1 ; then
2565 echo "Symbolic links are supported." >&4
2568 echo "Symbolic links are NOT supported." >&4
2573 : determine whether symbolic links are supported
2577 echo "Checking how to test for symbolic links..." >&4
2579 if $test "X$issymlink" = X; then
2581 '') sh -c "PATH= test -h sym" >/dev/null 2>&1 ;;
2582 *) $newsh -c "PATH= test -h sym" >/dev/null 2>&1 ;;
2584 if test $? = 0; then
2587 echo "Your builtin 'test -h' may be broken." >&4
2590 *) pth=`echo $PATH | sed -e "s/$p_/ /g"`
2593 if test -f "$p/$test"; then
2602 echo "Trying external '$test -h'." >&4
2603 issymlink="$test -h"
2604 if $test ! -h sym >/dev/null 2>&1; then
2605 echo "External '$test -h' is broken, too." >&4
2613 if $test "X$issymlink" = X; then
2614 if $test -L sym 2>/dev/null; then
2615 issymlink="$test -L"
2616 echo "The builtin '$test -L' worked." >&4
2619 if $test "X$issymlink" != X; then
2620 echo "You can test for symbolic links with '$issymlink'." >&4
2622 echo "I do not know how you can test for symbolic links." >&4
2626 *) echo "No symbolic links, so not testing for their testing..." >&4
2632 case "$mksymlinks" in
2635 ''|'.') echo "Cannot create symlinks in the original directory." >&4
2638 *) case "$lns:$issymlink" in
2639 *"ln"*" -s:"*"test -"?)
2640 echo "Creating the symbolic links..." >&4
2641 echo "(First creating the subdirectories...)" >&4
2643 awk '{print $1}' $src/MANIFEST | grep / | sed 's:/[^/]*$::' | sort -u | while true; do
2645 test -z "$directory" && break
2649 if test ! -d t/base; then
2650 echo "Failed to create the subdirectories. Aborting." >&4
2653 echo "(Then creating the symlinks...)" >&4
2654 awk '{print $1}' $src/MANIFEST | while true; do
2656 test -z "$filename" && break
2657 if test -f $filename; then
2658 if $issymlink $filename; then
2662 if test -f $filename; then
2663 echo "$filename already exists, not symlinking."
2665 ln -s $src/$filename $filename
2669 if test ! -f t/base/lex.t; then
2670 echo "Failed to create the symlinks (t/base/lex.t missing). Aborting." >&4
2675 *) echo "(I cannot figure out how to do symbolic links, ignoring mksymlinks)." >&4
2684 case "$usecrosscompile" in
2686 $echo "Cross-compiling..."
2689 *-*-gcc) # A cross-compiling gcc, probably.
2690 targetarch=`$echo $cc|$sed 's/-gcc$//'`
2692 # leave out ld, choosing it is more complex
2694 ranlib=$targetarch-ranlib
2695 $echo 'extern int foo;' > try.c
2696 set X `$cc -v -E try.c 2>&1 | $awk '/^#include </,/^End of search /'|$grep '/include'`
2698 if $test $# -gt 0; then
2700 incpth="`$echo $incpth|$sed 's/^ //'`"
2701 echo "Guessing incpth '$incpth'." >&4
2703 j="`$echo $i|$sed 's,/include$,/lib,'`"
2704 if $test -d $j; then
2708 libpth="`$echo $libpth|$sed 's/^ //'`"
2709 echo "Guessing libpth '$libpth'." >&4
2714 case "$targetarch" in
2715 '') echo "Targetarch not defined." >&4; croak=y ;;
2716 *) echo "Using targetarch $targetarch." >&4 ;;
2719 '') echo "Incpth not defined." >&4; croak=y ;;
2720 *) echo "Using incpth '$incpth'." >&4 ;;
2723 '') echo "Libpth not defined." >&4; croak=y ;;
2724 *) echo "Using libpth '$libpth'." >&4 ;;
2727 '') for i in $incpth; do
2728 if $test -f $i/errno.h -a -f $i/stdio.h -a -f $i/time.h; then
2730 echo "Guessing usrinc $usrinc." >&4
2735 '') echo "Usrinc not defined." >&4; croak=y ;;
2738 *) echo "Using usrinc $usrinc." >&4 ;;
2740 case "$targethost" in
2741 '') echo "Targethost not defined." >&4; croak=y ;;
2742 *) echo "Using targethost $targethost." >&4
2747 y) echo "Cannot continue, aborting." >&4; exit 1 ;;
2750 /*) run=$src/Cross/run
2751 targetmkdir=$src/Cross/mkdir
2753 from=$src/Cross/from
2755 *) pwd=`$test -f ../Configure & cd ..; pwd`
2757 targetmkdir=$pwd/Cross/mkdir
2759 from=$pwd/Cross/from
2762 case "$targetrun" in
2763 '') targetrun=ssh ;;
2768 case "$targetfrom" in
2769 '') targetfrom=scp ;;
2773 from=$from-$targetfrom
2774 case "$targetdir" in
2776 echo "Guessing targetdir $targetdir." >&4
2779 case "$targetuser" in
2781 echo "Guessing targetuser $targetuser." >&4
2784 case "$targetfrom" in
2788 case "$targetrun" in
2800 '') cwd=$targetdir ;;
2804 if $test ! -f \$exe.xok; then
2808 $targetrun -l $targetuser $targethost "cd \$cwd && ./\$exe \$@"
2811 *) echo "Unknown targetrun '$targetrun'" >&4
2815 case "$targetmkdir" in
2817 cat >$targetmkdir <<EOF
2819 $targetrun -l $targetuser $targethost "mkdir -p \$@"
2821 $chmod a+rx $targetmkdir
2823 *) echo "Unknown targetmkdir '$targetmkdir'" >&4
2835 $targetmkdir \`dirname \$f\`
2836 $targetto $q \$f $targetuser@$targethost:\$f || exit 1
2839 $targetmkdir $targetdir/\`dirname \$f\`
2840 $targetto $q \$f $targetuser@$targethost:$targetdir/\$f || exit 1
2853 $mkdir -p $targetdir/\`dirname \$f\`
2854 $cp \$f $targetdir/\$f || exit 1
2857 $targetmkdir $targetdir/\`dirname \$f\`
2858 $cp \$f $targetdir/\$f || exit 1
2865 *) echo "Unknown targetto '$targetto'" >&4
2869 case "$targetfrom" in
2876 $targetfrom $q $targetuser@$targethost:$targetdir/\$f . || exit 1
2881 cp) cat >$from <<EOF
2886 cp $targetdir/\$f . || exit 1
2891 *) echo "Unknown targetfrom '$targetfrom'" >&4
2895 if $test ! -f $run; then
2896 echo "Target 'run' script '$run' not found." >&4
2900 if $test ! -f $to; then
2901 echo "Target 'to' script '$to' not found." >&4
2905 if $test ! -f $from; then
2906 echo "Target 'from' script '$from' not found." >&4
2910 if $test ! -f $run -o ! -f $to -o ! -f $from; then
2914 Using '$run' for remote execution,
2915 and '$from' and '$to'
2916 for remote file transfer.
2922 usecrosscompile='undef'
2927 : see whether [:lower:] and [:upper:] are supported character classes
2929 case "`echo AbyZ | $tr '[:lower:]' '[:upper:]' 2>/dev/null`" in
2931 echo "Good, your tr supports [:lower:] and [:upper:] to convert case." >&4
2935 *) # There is a discontinuity in EBCDIC between 'R' and 'S'
2936 # (0xd9 and 0xe2), therefore that is a nice testing point.
2937 if test "X$up" = X -o "X$low" = X; then
2938 case "`echo RS | $tr '[R-S]' '[r-s]' 2>/dev/null`" in
2944 if test "X$up" = X -o "X$low" = X; then
2945 case "`echo RS | $tr R-S r-s 2>/dev/null`" in
2951 if test "X$up" = X -o "X$low" = X; then
2952 case "`echo RS | od -x 2>/dev/null`" in
2954 echo "Hey, this might be EBCDIC." >&4
2955 if test "X$up" = X -o "X$low" = X; then
2956 case "`echo RS | $tr '[A-IJ-RS-Z]' '[a-ij-rs-z]' 2>/dev/null`" in
2957 rs) up='[A-IJ-RS-Z]'
2962 if test "X$up" = X -o "X$low" = X; then
2963 case "`echo RS | $tr A-IJ-RS-Z a-ij-rs-z 2>/dev/null`" in
2973 case "`echo RS | $tr \"$up\" \"$low\" 2>/dev/null`" in
2975 echo "Using $up and $low to convert case." >&4
2978 echo "I don't know how to translate letters from upper to lower case." >&4
2979 echo "Your tr is not acting any way I know of." >&4
2983 : set up the translation script tr, must be called with ./tr of course
2987 '[A-Z][a-z]') exec $tr '$up' '$low';;
2988 '[a-z][A-Z]') exec $tr '$low' '$up';;
2995 : Try to determine whether config.sh was made on this system
2996 case "$config_sh" in
2998 myuname=`$uname -a 2>/dev/null`
2999 $test -z "$myuname" && myuname=`hostname 2>/dev/null`
3000 # tr '[A-Z]' '[a-z]' would not work in EBCDIC
3001 # because the A-Z/a-z are not consecutive.
3002 myuname=`echo $myuname | $sed -e 's/^[^=]*=//' -e 's/\///g' | \
3003 ./tr '[A-Z]' '[a-z]' | $tr $trnl ' '`
3004 newmyuname="$myuname"
3006 case "$knowitall" in
3008 if test -f ../config.sh; then
3009 if $contains myuname= ../config.sh >/dev/null 2>&1; then
3010 eval "`grep myuname= ../config.sh`"
3012 if test "X$myuname" = "X$newmyuname"; then
3020 : Get old answers from old config file if Configure was run on the
3021 : same system, otherwise use the hints.
3024 if test -f config.sh; then
3026 rp="I see a config.sh file. Shall I use it to set the defaults?"
3029 n*|N*) echo "OK, I'll ignore it."
3030 mv config.sh config.sh.old
3031 myuname="$newmyuname"
3033 *) echo "Fetching default answers from your old config.sh file..." >&4
3041 : Older versions did not always set $sh. Catch re-use of such
3051 if test ! -f config.sh; then
3054 First time through, eh? I have some defaults handy for some systems
3055 that need some extra help getting the Configure answers right:
3058 (cd $src/hints; ls -C *.sh) | $sed 's/\.sh/ /g' >&4
3060 : Half the following guesses are probably wrong... If you have better
3061 : tests or hints, please send them to perlbug@perl.org
3062 : The metaconfig authors would also appreciate a copy...
3063 $test -f /irix && osname=irix
3064 $test -f /xenix && osname=sco_xenix
3065 $test -f /dynix && osname=dynix
3066 $test -f /dnix && osname=dnix
3067 $test -f /lynx.os && osname=lynxos
3068 $test -f /unicos && osname=unicos && osvers=`$uname -r`
3069 $test -f /unicosmk && osname=unicosmk && osvers=`$uname -r`
3070 $test -f /unicosmk.ar && osname=unicosmk && osvers=`$uname -r`
3071 $test -f /bin/mips && /bin/mips && osname=mips
3072 $test -d /NextApps && set X `hostinfo | grep 'NeXT Mach.*:' | \
3073 $sed -e 's/://' -e 's/\./_/'` && osname=next && osvers=$4
3074 $test -d /usr/apollo/bin && osname=apollo
3075 $test -f /etc/saf/_sactab && osname=svr4
3076 $test -d /usr/include/minix && osname=minix
3077 $test -f /system/gnu_library/bin/ar.pm && osname=vos
3078 if $test -d /MachTen -o -d /MachTen_Folder; then
3080 if $test -x /sbin/version; then
3081 osvers=`/sbin/version | $awk '{print $2}' |
3082 $sed -e 's/[A-Za-z]$//'`
3083 elif $test -x /usr/etc/version; then
3084 osvers=`/usr/etc/version | $awk '{print $2}' |
3085 $sed -e 's/[A-Za-z]$//'`
3091 $test -f /sys/posix.dll &&
3092 $test -f /usr/bin/what &&
3093 set X `/usr/bin/what /sys/posix.dll` &&
3094 $test "$3" = UWIN &&
3098 if $test -f $uname; then
3106 umips) osname=umips ;;
3109 [23]100) osname=mips ;;
3110 next*) osname=next ;;
3112 tmp=`/bin/uname -X 2>/dev/null|awk '/3\.2v[45]/{ print $(NF) }'`
3113 if $test "$tmp" != "" -a "$3" = "3.2" -a -f '/etc/systemid'; then
3116 elif $test -f /etc/kconfig; then
3118 if test "$lns" = "$ln -s"; then
3120 elif $contains _SYSV3 /usr/include/stdio.h > /dev/null 2>&1 ; then
3122 elif $contains _POSIX_SOURCE /usr/include/stdio.h > /dev/null 2>&1 ; then
3129 if test -n "$DJGPP"; then
3138 tmp=`( (oslevel) 2>/dev/null || echo "not found") 2>&1`
3140 # oslevel can fail with:
3141 # oslevel: Unable to acquire lock.
3142 *not\ found) osvers="$4"."$3" ;;
3143 '<3240'|'<>3240') osvers=3.2.0 ;;
3144 '=3240'|'>3240'|'<3250'|'<>3250') osvers=3.2.4 ;;
3145 '=3250'|'>3250') osvers=3.2.5 ;;
3149 bsd386) osname=bsd386
3152 cygwin*) osname=cygwin
3155 *dc.osx) osname=dcosx
3161 domainos) osname=apollo
3167 dragonfly) osname=dragonfly
3170 dynixptx*) osname=dynixptx
3171 osvers=`echo "$4"|sed 's/^v//'`
3173 freebsd) osname=freebsd
3175 genix) osname=genix ;;
3179 osvers=`echo "$3" | $sed 's,.*\.\([0-9]*\.[0-9]*\),\1,'`
3195 netbsd*) osname=netbsd
3198 news-os) osvers="$3"
3200 4*) osname=newsos4 ;;
3204 next*) osname=next ;;
3205 nonstop-ux) osname=nonstopux ;;
3206 openbsd) osname=openbsd
3212 POSIX-BC | posix-bc ) osname=posix-bc
3215 powerux | power_ux | powermax_os | powermaxos | \
3216 powerunix | power_unix) osname=powerux
3222 solaris) osname=solaris
3224 5*) osvers=`echo $3 | $sed 's/^5/2/g'` ;;
3231 osvers=`echo $3 | $sed 's/^5/2/g'` ;;
3235 titanos) osname=titanos
3244 ultrix) osname=ultrix
3247 osf1|mls+) case "$5" in
3250 osvers=`sizer -v | awk -FUNIX '{print $2}' | awk '{print $1}' | tr '[A-Z]' '[a-z]' | sed 's/^[xvt]//'`
3253 *) osvers=`echo "$3" | sed 's/^[xvt]//'` ;;
3256 hp*) osname=hp_osf1 ;;
3257 mips) osname=mips_osf1 ;;
3260 # UnixWare 7.1.2 is known as Open UNIX 8
3261 openunix|unixware) osname=svr5
3269 $2) case "$osname" in
3273 : svr4.x or possibly later
3283 if test -f /stand/boot ; then
3284 eval `grep '^INITPROG=[a-z/0-9]*$' /stand/boot`
3285 if test -n "$INITPROG" -a -f "$INITPROG"; then
3286 isesix=`strings -a $INITPROG|grep 'ESIX SYSTEM V/386 Release 4.0'`
3287 if test -n "$isesix"; then
3295 *) if test -f /etc/systemid; then
3297 set `echo $3 | $sed 's/\./ /g'` $4
3298 if $test -f $src/hints/sco_$1_$2_$3.sh; then
3300 elif $test -f $src/hints/sco_$1_$2.sh; then
3302 elif $test -f $src/hints/sco_$1.sh; then
3307 '') : Still unknown. Probably a generic Sys V.
3316 *) case "$osname" in
3317 '') : Still unknown. Probably a generic BSD.
3325 if test -f /vmunix -a -f $src/hints/news_os.sh; then
3326 (what /vmunix | UU/tr '[A-Z]' '[a-z]') > UU/kernel.what 2>&1
3327 if $contains news-os UU/kernel.what >/dev/null 2>&1; then
3330 $rm -f UU/kernel.what
3331 elif test -d c:/. -o -n "$is_os2" ; then
3338 case "$targetarch" in
3341 osname=`echo $targetarch|sed 's,^[^-]*-,,'`
3346 : Now look for a hint file osname_osvers, unless one has been
3347 : specified already.
3350 file=`echo "${osname}_${osvers}" | $sed -e 's%\.%_%g' -e 's%_$%%'`
3351 : Also try without trailing minor version numbers.
3352 xfile=`echo $file | $sed -e 's%_[^_]*$%%'`
3353 xxfile=`echo $xfile | $sed -e 's%_[^_]*$%%'`
3354 xxxfile=`echo $xxfile | $sed -e 's%_[^_]*$%%'`
3355 xxxxfile=`echo $xxxfile | $sed -e 's%_[^_]*$%%'`
3358 *) case "$osvers" in
3361 *) if $test -f $src/hints/$file.sh ; then
3363 elif $test -f $src/hints/$xfile.sh ; then
3365 elif $test -f $src/hints/$xxfile.sh ; then
3367 elif $test -f $src/hints/$xxxfile.sh ; then
3369 elif $test -f $src/hints/$xxxxfile.sh ; then
3371 elif $test -f "$src/hints/${osname}.sh" ; then
3380 if $test -f Policy.sh ; then
3383 none) dflt="Policy" ;;
3384 *) dflt="Policy $dflt" ;;
3389 dflt=`echo $hintfile | $sed 's/\.sh$//'`
3393 if $test -f Policy.sh ; then
3396 There's also a Policy hint file available, which should make the
3397 site-specific (policy) questions easier to answer.
3404 You may give one or more space-separated answers, or "none" if appropriate.
3405 If you have a handcrafted Policy.sh file or a Policy.sh file generated by a
3406 previous run of Configure, you may specify it as well as or instead of
3407 OS-specific hints. If hints are provided for your OS, you should use them:
3408 although Perl can probably be built without hints on many platforms, using
3409 hints often improve performance and may enable features that Configure can't
3410 set up on its own. If there are no hints that match your OS, specify "none";
3411 DO NOT give a wrong version or a wrong OS.
3415 rp="Which of these apply, if any?"
3418 for file in $tans; do
3419 if $test X$file = XPolicy -a -f Policy.sh; then
3421 $cat Policy.sh >> UU/config.sh
3422 elif $test -f $src/hints/$file.sh; then
3423 . $src/hints/$file.sh
3424 $cat $src/hints/$file.sh >> UU/config.sh
3425 elif $test X"$tans" = X -o X"$tans" = Xnone ; then
3428 : Give one chance to correct a possible typo.
3429 echo "$file.sh does not exist"
3431 rp="hint to use instead?"
3433 for file in $ans; do
3434 if $test -f "$src/hints/$file.sh"; then
3435 . $src/hints/$file.sh
3436 $cat $src/hints/$file.sh >> UU/config.sh
3437 elif $test X$ans = X -o X$ans = Xnone ; then
3440 echo "$file.sh does not exist -- ignored."
3447 : Remember our hint file for later.
3448 if $test -f "$src/hints/$file.sh" ; then
3458 echo "Fetching default answers from $config_sh..." >&4
3462 cp $config_sh config.sh 2>/dev/null
3472 test "$override" && . ./optdef.sh
3474 : Restore computed paths
3475 for file in $loclist $trylist; do
3476 eval $file="\$_$file"
3481 Configure uses the operating system name and version to set some defaults.
3482 The default value is probably right if the name rings a bell. Otherwise,
3483 since spelling matters for me, either accept the default or answer "none"
3490 ''|' '|none) dflt=none ;;
3491 *) dflt=`echo $hintfile | $sed -e 's/\.sh$//' -e 's/_.*$//'` ;;
3494 *) dflt="$osname" ;;
3496 rp="Operating system name?"
3500 *) osname=`echo "$ans" | $sed -e 's/[ ][ ]*/_/g' | ./tr '[A-Z]' '[a-z]'`;;
3506 ''|' '|none) dflt=none ;;
3507 *) dflt=`echo $hintfile | $sed -e 's/\.sh$//' -e 's/^[^_]*//'`
3508 dflt=`echo $dflt | $sed -e 's/^_//' -e 's/_/./g'`
3510 ''|' ') dflt=none ;;
3515 *) dflt="$osvers" ;;
3517 rp="Operating system version?"
3527 : who configured the system
3528 cf_time=`LC_ALL=C; LANGUAGE=C; export LC_ALL; export LANGUAGE; $date 2>&1`
3531 cf_by=`(logname) 2>/dev/null`
3534 cf_by=`(whoami) 2>/dev/null`
3536 "") cf_by=unknown ;;
3541 : decide how portable to be. Allow command line overrides.
3542 case "$d_portable" in
3544 *) d_portable="$define" ;;
3547 : set up shell script to do ~ expansion
3553 echo \$1 | $sed "s|~|\${HOME-\$LOGDIR}|"
3556 if $test -f /bin/csh; then
3557 /bin/csh -f -c "glob \$1"
3562 name=\`$expr x\$1 : '..\([^/]*\)'\`
3563 dir=\`$sed -n -e "/^\${name}:/{s/^[^:]*:[^:]*:[^:]*:[^:]*:[^:]*:\([^:]*\).*"'\$'"/\1/" -e p -e q -e '}' </etc/passwd\`
3564 if $test ! -d "\$dir"; then
3566 echo "\$me: can't locate home directory for: \$name" >&2
3571 echo \$dir/\`$expr x\$1 : '..[^/]*/\(.*\)'\`
3587 : now set up to get a file name
3591 cat <<'EOSC' >>getfile
3607 : getfile will accept an answer from the comma-separated list
3608 : enclosed in parentheses even if it does not meet other criteria.
3609 expr "$fn" : '.*(\(.*\)).*' | $tr ',' $trnl >getfile.ok
3610 fn=`echo $fn | sed 's/(.*)//'`
3616 loc_file=`expr $fn : '.*:\(.*\)'`
3617 fn=`expr $fn : '\(.*\):.*'`
3625 */*) fullpath=true;;
3634 *e*) exp_file=true;;
3637 *p*) nopath_ok=true;;
3642 *d*) type='Directory';;
3643 *l*) type='Locate';;
3648 Locate) what='File';;
3653 case "$d_portable" in
3661 while test "$type"; do
3666 true) rp="$rp (~name ok)";;
3669 if test -f UU/getfile.ok && \
3670 $contains "^$ans\$" UU/getfile.ok >/dev/null 2>&1
3689 value=`UU/filexp $ans`
3692 if test "$ans" != "$value"; then
3693 echo "(That expands to $value on this system.)"
3707 /*) value="$ansexp" ;;
3708 [a-zA-Z]:/*) value="$ansexp" ;;
3713 echo "I shall only accept a full path name, as in /bin/ls." >&4
3714 echo "Use a ! shell escape if you wish to check pathnames." >&4
3717 echo "Please give a full path name, starting with slash." >&4
3720 echo "Note that using ~name is ok provided it expands well." >&4
3733 for fp in $gfpth; do
3734 if test "X$fp" = X.; then
3739 if test -f "$pf"; then
3741 elif test -r "$pf" || (test -h "$pf") >/dev/null 2>&1
3743 echo "($value is not a plain file, but that's ok.)"
3746 if test X"$type" = X; then
3753 for fp in $gfpth; do
3754 if test "X$fp" = X.; then
3759 direxp="$fp/$ansexp"
3761 if test -d "$direxp"; then
3769 if test -d "$ansexp"; then
3770 echo "(Looking for $loc_file in directory $value.)"
3771 value="$value/$loc_file"
3772 ansexp="$ansexp/$loc_file"
3774 if test -f "$ansexp"; then
3777 case "$nopath_ok" in
3778 true) case "$value" in
3780 *) echo "Assuming $value will be in people's path."
3796 if test "$fastread" = yes; then
3801 rp="$what $value doesn't exist. Use that name anyway?"
3820 test "X$gfpthkeep" != Xy && gfpth=""
3823 : determine root of directory hierarchy where package will be installed.
3826 dflt=`./loc . /usr/local /usr/local /local /opt /usr`
3829 dflt=`echo "$prefix" | sed 's/.$//'`
3837 By default, $package will be installed in $dflt/bin, manual pages
3838 under $dflt/man, etc..., i.e. with $dflt as prefix for all
3839 installation directories. Typically this is something like /usr/local.
3840 If you wish to have binaries under /usr/bin but other parts of the
3841 installation under /usr/local, that's ok: you will be prompted
3842 separately for each of the installation directories, the prefix being
3843 only used to set the defaults.
3847 rp='Installation prefix to use?'
3855 *) oldprefix="$prefix";;
3864 *) afsroot=$afsroot ;;
3870 $define|true) afs=true ;;
3871 $undef|false) afs=false ;;
3872 *) if test -d $afsroot; then
3880 echo "AFS may be running... I'll be extra cautious then..." >&4
3882 echo "AFS does not seem to be running..." >&4
3885 : determine installation prefix for where package is to be installed.
3889 Since you are running AFS, I need to distinguish the directory in which
3890 files will reside from the directory in which they are installed (and from
3891 which they are presumably copied to the former directory by occult means).
3894 case "$installprefix" in
3895 '') dflt=`echo $prefix | sed 's#^/afs/#/afs/.#'`;;
3896 *) dflt="$installprefix";;
3901 In some special cases, particularly when building $package for distribution,
3902 it is convenient to distinguish the directory in which files should be
3903 installed from the directory ($prefix) in which they will
3904 eventually reside. For most users, these two directories are the same.
3907 case "$installprefix" in
3909 *) dflt=$installprefix;;
3913 rp='What installation prefix should I use for installing files?'
3915 installprefix="$ans"
3916 installprefixexp="$ansexp"
3918 : Perform the prefixexp/installprefixexp correction if necessary
3919 cat <<EOS >installprefix
3922 cat <<'EOSC' >>installprefix
3923 : Change installation prefix, if necessary.
3924 if $test X"$prefix" != X"$installprefix"; then
3925 eval "install${prefixvar}=\`echo \$${prefixvar}exp | sed \"s#^\$prefixexp#\$installprefixexp#\"\`"
3927 eval "install${prefixvar}=\"\$${prefixvar}exp\""
3930 chmod +x installprefix
3931 $eunicefix installprefix
3933 : Set variables such as privlib and privlibexp from the output of ./getfile
3934 : performing the prefixexp/installprefixexp correction if necessary.
3935 cat <<EOS >setprefixvar
3938 cat <<'EOSC' >>setprefixvar
3939 eval "${prefixvar}=\"\$ans\""
3940 eval "${prefixvar}exp=\"\$ansexp\""
3943 chmod +x setprefixvar
3944 $eunicefix setprefixvar
3946 : set up the script used to warn in case of inconsistency
3955 '') echo "The $hint value for \$$var on this machine was \"$was\"!" >&4
3957 *) echo "Hmm. Based on the hints in hints/$hintfile.sh, " >&4
3958 echo "the $hint value for \$$var on this machine was \"$was\"!" >&4
3963 echo "*** WHOA THERE!!! ***" >&4
3964 echo " The $hint value for \$$var on this machine was \"$was\"!" >&4
3967 rp=" Keep the $hint value?"
3970 y) td=$was; tu=$was;;
3974 : function used to set $1 to $val
3975 setvar='var=$1; eval "was=\$$1"; td=$define; tu=$undef;
3977 $define$undef) . ./whoa; eval "$var=\$td";;
3978 $undef$define) . ./whoa; eval "$var=\$tu";;
3979 *) eval "$var=$val";;
3983 $define|true|[yY]*) dflt='y';;
3988 Perl can be built to use the SOCKS proxy protocol library. To do so,
3989 Configure must be run with -Dusesocks. If you use SOCKS you also need
3990 to use the PerlIO abstraction layer, this will be implicitly selected.
3992 If this doesn't make any sense to you, just accept the default '$dflt'.
3994 rp='Build Perl for SOCKS?'
3997 y|Y) val="$define" ;;
4004 $define|true|[yY]*) useperlio="$define";;
4007 case "$useperlio" in
4008 $define|true|[yY]*|'') dflt='y';;
4013 Previous version of $package used the standard IO mechanisms as
4014 defined in <stdio.h>. Versions 5.003_02 and later of $package allow
4015 alternate IO mechanisms via the PerlIO abstraction layer, but the
4016 stdio mechanism is still available if needed. The abstraction layer
4017 can use AT&T's sfio (if you already have sfio installed) or regular stdio.
4018 Using PerlIO with sfio may cause problems with some extension modules.
4020 If this doesn't make any sense to you, just accept the default '$dflt'.
4022 rp='Use the PerlIO abstraction layer?'
4029 echo "Ok, doing things the stdio way."
4038 case "$useperlio" in
4039 $define|true|[yY]*) ;;
4042 You are using the SOCKS proxy protocol library which means that you
4043 should also use the PerlIO layer. You may be headed for trouble.
4052 case "$usethreads" in
4053 $define|true|[yY]*) dflt='y';;
4054 *) # Catch case where user specified ithreads or 5005threads but
4055 # forgot -Dusethreads (A.D. 4/2002)
4056 case "$useithreads$use5005threads" in
4058 case "$useperlio" in
4059 "$define") dflt='y' ;;
4069 Perl can be built to take advantage of threads on some systems.
4070 To do so, Configure can be run with -Dusethreads.
4072 Note that Perl built with threading support runs slightly slower
4073 and uses more memory than plain Perl. The current implementation
4074 is believed to be stable, but it is fairly new, and so should be
4075 treated with caution.
4077 If this doesn't make any sense to you, just accept the default '$dflt'.
4079 rp='Build a threading Perl?'
4082 y|Y) val="$define" ;;
4088 case "$usethreads" in
4092 Since release 5.6, Perl has had two different threading implementations,
4093 the newer interpreter-based version (ithreads) with one interpreter per
4094 thread, and the older 5.005 version (5005threads).
4095 The 5005threads version is effectively unmaintained and will probably be
4096 removed in Perl 5.10, so there should be no need to build a Perl using it
4097 unless needed for backwards compatibility with some existing 5.005threads
4101 : Default to ithreads unless overridden on command line or with
4104 case "$use5005threads" in
4105 $define|true|[yY]*) dflt='n';;
4107 case "$useithreads" in
4108 $undef|false|[nN]*) dflt='n';;
4110 rp='Use the newer interpreter-based ithreads?'
4113 y|Y) val="$define" ;;
4118 : Now set use5005threads to the opposite value.
4119 case "$useithreads" in
4120 $define) val="$undef" ;;
4127 useithreads="$undef"
4128 use5005threads="$undef"
4132 case "$useithreads$use5005threads" in
4136 You cannot have both the ithreads and the 5.005 threads enabled
4137 at the same time. Disabling the 5.005 threads since they are
4138 much less stable than the ithreads.
4141 use5005threads="$undef"
4145 if test X"$usethreads" = "X$define" -a "X$useperlio" = "Xundef"; then
4148 *** To build with ithreads you must also use the PerlIO layer.
4149 *** Cannot continue, aborting.
4155 case "$d_oldpthreads" in
4156 '') : Configure tests would be welcome here. For now, assume undef.
4158 *) val="$d_oldpthreads" ;;
4164 : Look for a hint-file generated 'call-back-unit'. If the
4165 : user has specified that a threading perl is to be built,
4166 : we may need to set or change some other defaults.
4167 if $test -f usethreads.cbu; then
4168 echo "Your platform has some specific hints regarding threaded builds, using them..."
4171 case "$usethreads" in
4172 "$define"|true|[yY]*)
4174 (Your platform does not have any specific hints for threaded builds.
4175 Assuming POSIX threads, then.)
4183 Perl can be built so that multiple Perl interpreters can coexist
4184 within the same Perl executable.
4187 case "$useithreads" in
4190 This multiple interpreter support is required for interpreter-based threads.
4194 *) case "$usemultiplicity" in
4195 $define|true|[yY]*) dflt='y';;
4199 echo "If this doesn't make any sense to you, just accept the default '$dflt'."
4200 rp='Build Perl for multiplicity?'
4203 y|Y) val="$define" ;;
4212 case "$usemorebits" in
4213 "$define"|true|[yY]*)
4214 use64bitint="$define"
4215 uselongdouble="$define"
4216 usemorebits="$define"
4218 *) usemorebits="$undef"
4222 : make some quick guesses about what we are up against
4224 $echo $n "Hmm... $c"
4234 $cat /usr/include/signal.h /usr/include/sys/signal.h >foo 2>/dev/null
4235 if test -f /osf_boot || $contains 'OSF/1' /usr/include/ctype.h >/dev/null 2>&1
4237 echo "Looks kind of like an OSF/1 system, but we'll see..."
4239 elif test `echo abc | $tr a-z A-Z` = Abc ; then
4240 xxx=`./loc addbib blurfl $pth`
4241 if $test -f $xxx; then
4242 echo "Looks kind of like a USG system with BSD features, but we'll see..."
4246 if $contains SIGTSTP foo >/dev/null 2>&1 ; then
4247 echo "Looks kind of like an extended USG system, but we'll see..."
4249 echo "Looks kind of like a USG system, but we'll see..."
4253 elif $contains SIGTSTP foo >/dev/null 2>&1 ; then
4254 echo "Looks kind of like a BSD system, but we'll see..."
4258 echo "Looks kind of like a Version 7 system, but we'll see..."
4261 case "$eunicefix" in
4264 There is, however, a strange, musty smell in the air that reminds me of
4265 something...hmm...yes...I've got it...there's a VMS nearby, or I'm a Blit.
4269 : it so happens the Eunice I know will not run shell scripts in Unix format
4273 echo "Congratulations. You aren't running Eunice."
4277 : Detect OS2. The p_ variable is set above in the Head.U unit.
4278 : Note that this also -- wrongly -- detects e.g. dos-djgpp, which also uses
4279 : semicolon as a patch separator
4284 I have the feeling something is not exactly right, however...don't tell me...
4285 lemme think...does HAL ring a bell?...no, of course, you're only running OS/2!
4286 (Or you may be running DOS with DJGPP.)
4291 if test -f /xenix; then
4292 echo "Actually, this looks more like a XENIX system..."
4297 echo "It's not Xenix..."
4302 if test -f /venix; then
4303 echo "Actually, this looks more like a VENIX system..."
4310 echo "Nor is it Venix..."
4313 chmod +x bsd usg v7 osf1 eunice xenix venix os2
4314 $eunicefix bsd usg v7 osf1 eunice xenix venix os2
4321 rp="Use which C compiler?"
4325 : See if they have not cc but they do have gcc
4327 : Look for a hint-file generated 'call-back-unit'. Now that the
4328 : user has specified the compiler, we may need to set or change some
4330 if $test -f cc.cbu; then
4336 echo "Checking for GNU cc in disguise and/or its version number..." >&4
4340 #if defined(__GNUC__) && !defined(__INTEL_COMPILER)
4342 printf("%s\n", __VERSION__);
4344 printf("%s\n", "1");
4350 if $cc -o try $ccflags $ldflags try.c; then
4351 gccversion=`$run ./try`
4352 case "$gccversion" in
4353 '') echo "You are not using GNU cc." ;;
4354 *) echo "You are using GNU cc $gccversion."
4360 echo "*** WHOA THERE!!! ***" >&4
4361 echo " Your C compiler \"$cc\" doesn't seem to be working!" >&4
4362 case "$knowitall" in
4364 echo " You'd better start hunting for one and let me know about it." >&4
4370 case "$gccversion" in
4371 1*) cpp=`./loc gcc-cpp $cpp $pth` ;;
4373 case "$gccversion" in
4374 '') gccosandvers='' ;;
4375 *) gccshortvers=`echo "$gccversion"|sed 's/ .*//'`
4376 gccosandvers=`$cc -v 2>&1|grep '/specs$'|sed "s!.*/[^-/]*-[^-/]*-\([^-/]*\)/$gccshortvers/specs!\1!"`
4378 case "$gccosandvers" in
4379 $osname) gccosandvers='' ;; # linux gccs seem to have no linux osvers, grr
4380 $osname$osvers) ;; # looking good
4381 $osname*) cat <<EOM >&4
4383 *** WHOA THERE!!! ***
4385 Your gcc has not been compiled for the exact release of
4386 your operating system ($gccosandvers versus $osname$osvers).
4388 In general it is a good idea to keep gcc synchronized with
4389 the operating system because otherwise serious problems
4390 may ensue when trying to compile software, like Perl.
4392 I'm trying to be optimistic here, though, and will continue.
4393 If later during the configuration and build icky compilation
4394 problems appear (headerfile conflicts being the most common
4395 manifestation), I suggest reinstalling the gcc to match
4396 your operating system release.
4400 *) gccosandvers='' ;; # failed to parse, better be silent
4408 # gcc 3.* complain about adding -Idirectories that they already know about,
4409 # so we will take those off from locincpth.
4410 case "$gccversion" in
4412 echo "main(){}">try.c
4413 for incdir in $locincpth; do
4414 warn=`$cc $ccflags -I$incdir -c try.c 2>&1 | \
4415 grep '^c[cp]p*[01]: warning: changing search order '`
4416 if test "X$warn" != X; then
4417 locincpth=`echo " $locincpth " | sed "s! $incdir ! !"`
4423 : What should the include directory be ?
4425 $echo $n "Hmm... $c"
4429 if $test -f /bin/mips && /bin/mips; then
4430 echo "Looks like a MIPS system..."
4431 $cat >usr.c <<'EOCP'
4432 #ifdef SYSTYPE_BSD43
4436 if cc -E usr.c > usr.out && $contains / usr.out >/dev/null 2>&1; then
4437 dflt='/bsd43/usr/include'
4441 mips_type='System V'
4443 $rm -f usr.c usr.out
4444 echo "and you're compiling with the $mips_type compiler and libraries."
4448 echo "Doesn't look like a MIPS system."
4458 case "$xxx_prompt" in
4461 rp='Where are the include files you want to use?'
4469 : see how we invoke the C preprocessor
4471 echo "Now, how can we feed standard input to your C preprocessor..." >&4
4472 cat <<'EOT' >testcpp.c
4478 if test ! -f cppstdin; then
4479 if test "X$osname" = "Xaix" -a "X$gccversion" = X; then
4480 # AIX cc -E doesn't show the absolute headerfile
4481 # locations but we'll cheat by using the -M flag.
4482 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
4484 echo 'cat >.$$.c; '"$cc"' -E ${1+"$@"} .$$.c; rm .$$.c' >cppstdin
4487 echo "Keeping your $hint cppstdin wrapper."
4490 wrapper=`pwd`/cppstdin
4494 if $test "X$cppstdin" != "X" && \
4495 $cppstdin $cppminus <testcpp.c >testcpp.out 2>&1 && \
4496 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
4498 echo "You used to use $cppstdin $cppminus so we'll use that again."
4500 '') echo "But let's see if we can live without a wrapper..." ;;
4502 if $cpprun $cpplast <testcpp.c >testcpp.out 2>&1 && \
4503 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
4505 echo "(And we'll use $cpprun $cpplast to preprocess directly.)"
4508 echo "(However, $cpprun $cpplast does not work, let's see...)"
4516 echo "Good old $cppstdin $cppminus does not seem to be of any help..."
4523 elif echo 'Maybe "'"$cc"' -E" will work...'; \
4524 $cc -E <testcpp.c >testcpp.out 2>&1; \
4525 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4526 echo "Yup, it does."
4529 elif echo 'Nope...maybe "'"$cc"' -E -" will work...'; \
4530 $cc -E - <testcpp.c >testcpp.out 2>&1; \
4531 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4532 echo "Yup, it does."
4535 elif echo 'Nope...maybe "'"$cc"' -P" will work...'; \
4536 $cc -P <testcpp.c >testcpp.out 2>&1; \
4537 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4538 echo "Yipee, that works!"
4541 elif echo 'Nope...maybe "'"$cc"' -P -" will work...'; \
4542 $cc -P - <testcpp.c >testcpp.out 2>&1; \
4543 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4544 echo "At long last!"
4547 elif echo 'No such luck, maybe "'$cpp'" will work...'; \
4548 $cpp <testcpp.c >testcpp.out 2>&1; \
4549 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4553 elif echo 'Nixed again...maybe "'$cpp' -" will work...'; \
4554 $cpp - <testcpp.c >testcpp.out 2>&1; \
4555 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4556 echo "Hooray, it works! I was beginning to wonder."
4559 elif echo 'Uh-uh. Time to get fancy. Trying a wrapper...'; \
4560 $wrapper <testcpp.c >testcpp.out 2>&1; \
4561 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4567 rp="No dice. I can't find a C preprocessor. Name one:"
4571 $x_cpp <testcpp.c >testcpp.out 2>&1
4572 if $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4573 echo "OK, that will do." >&4
4575 echo "Sorry, I can't get that to work. Go find one and rerun Configure." >&4
4590 echo "Perhaps can we force $cc -E using a wrapper..."
4591 if $wrapper <testcpp.c >testcpp.out 2>&1; \
4592 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
4598 echo "Nope, we'll have to live without it..."
4612 "$wrapper"|'cppstdin') ;;
4613 *) $rm -f $wrapper;;
4615 $rm -f testcpp.c testcpp.out
4617 : Set private lib path
4620 plibpth="$incpath/usr/lib /usr/local/lib /usr/ccs/lib"
4625 '') dlist="$loclibpth $plibpth $glibpth";;
4626 *) dlist="$libpth";;
4629 : Now check and see which directories actually exist, avoiding duplicates
4633 if $test -d $xxx; then
4636 *) libpth="$libpth $xxx";;
4642 Some systems have incompatible or broken versions of libraries. Among
4643 the directories listed in the question below, please remove any you
4644 know not to be holding relevant libraries, and add any that are needed.
4645 Say "none" for none.
4656 rp="Directories to use for library searches?"
4663 : compute shared library extension
4666 if xxx=`./loc libc.sl X $libpth`; $test -f "$xxx"; then
4676 On some systems, shared libraries may be available. Answer 'none' if
4677 you want to suppress searching of shared libraries for the remainder
4678 of this configuration.
4681 rp='What is the file extension used for shared libraries?'
4685 : Define several unixisms.
4686 : Hints files or command line option can be used to override them.
4687 : The convoluted testing is in case hints files set either the old
4690 '') case "$exe_ext" in
4692 *) _exe="$exe_ext" ;;
4697 '') case "$lib_ext" in
4704 '') case "$obj_ext" in
4711 '') case "$path_sep" in
4722 : Which makefile gets called first. This is used by make depend.
4723 case "$firstmakefile" in
4724 '') firstmakefile='makefile';;
4728 *-DUSE_LONG_DOUBLE*|*-DUSE_MORE_BITS*) uselongdouble="$define" ;;
4731 case "$uselongdouble" in
4732 $define|true|[yY]*) dflt='y';;
4737 Perl can be built to take advantage of long doubles which
4738 (if available) may give more accuracy and range for floating point numbers.
4740 If this doesn't make any sense to you, just accept the default '$dflt'.
4742 rp='Try to use long doubles if available?'
4745 y|Y) val="$define" ;;
4751 case "$uselongdouble" in
4752 true|[yY]*) uselongdouble="$define" ;;
4755 : Look for a hint-file generated 'call-back-unit'. If the
4756 : user has specified that long doubles should be used,
4757 : we may need to set or change some other defaults.
4758 if $test -f uselongdouble.cbu; then
4759 echo "Your platform has some specific hints regarding long doubles, using them..."
4760 . ./uselongdouble.cbu
4762 case "$uselongdouble" in
4765 (Your platform does not have any specific hints for long doubles.)
4771 : Looking for optional libraries
4773 echo "Checking for optional libraries..." >&4
4778 case "$libswanted" in
4779 '') libswanted='c_s';;
4782 "$define") libswanted="$libswanted socks5 socks5_sh" ;;
4788 for thisdir in $libpth $xlibpth; do
4789 test -d $thisdir && libspath="$libspath $thisdir"
4791 for thislib in $libswanted; do
4792 for thisdir in $libspath; do
4794 if $test ! -f "$xxx" -a "X$ignore_versioned_solibs" = "X"; then
4795 xxx=`ls $thisdir/lib$thislib.$so.[0-9] 2>/dev/null|sed -n '$p'`
4796 $test -f "$xxx" && eval $libscheck
4797 $test -f "$xxx" && libstyle=shared
4799 if test ! -f "$xxx"; then
4800 xxx=$thisdir/lib$thislib.$so
4801 $test -f "$xxx" && eval $libscheck
4802 $test -f "$xxx" && libstyle=shared
4804 if test ! -f "$xxx"; then
4805 xxx=$thisdir/lib$thislib$_a
4806 $test -f "$xxx" && eval $libscheck
4807 $test -f "$xxx" && libstyle=static
4809 if test ! -f "$xxx"; then
4810 xxx=$thisdir/$thislib$_a
4811 $test -f "$xxx" && eval $libscheck
4812 $test -f "$xxx" && libstyle=static
4814 if test ! -f "$xxx"; then
4815 xxx=$thisdir/lib${thislib}_s$_a
4816 $test -f "$xxx" && eval $libscheck
4817 $test -f "$xxx" && libstyle=static
4818 $test -f "$xxx" && thislib=${thislib}_s
4820 if test ! -f "$xxx"; then
4821 xxx=$thisdir/Slib$thislib$_a
4822 $test -f "$xxx" && eval $libscheck
4823 $test -f "$xxx" && libstyle=static
4825 if $test -f "$xxx"; then
4827 shared) echo "Found -l$thislib (shared)." ;;
4828 static) echo "Found -l$thislib." ;;
4829 *) echo "Found -l$thislib ($libstyle)." ;;
4833 *) dflt="$dflt -l$thislib"
4834 libsfound="$libsfound $xxx"
4836 libsfiles="$libsfiles $yyy"
4837 yyy=`echo $xxx|$sed -e "s%/$yyy\\$%%"`
4838 case " $libsdirs " in
4840 *) libsdirs="$libsdirs $yyy" ;;
4847 if $test ! -f "$xxx"; then
4848 echo "No -l$thislib."
4859 ' '|'') dflt='none';;
4864 In order to compile $package on your machine, a number of libraries
4865 are usually needed. Include any other special libraries here as well.
4866 Say "none" for none. The default list is almost always right.
4870 rp="What libraries to use?"
4877 : determine optimization, if desired, or use for debug flag also
4879 ' '|$undef) dflt='none';;
4881 *) dflt="$optimize";;
4885 By default, $package compiles with the -O flag to use the optimizer.
4886 Alternately, you might want to use the symbolic debugger, which uses
4887 the -g flag (on traditional Unix systems). Either flag can be
4888 specified here. To use neither flag, specify the word "none".
4891 rp="What optimizer/debugger flag should be used?"
4895 'none') optimize=" ";;
4898 : Check what DEBUGGING is required from the command line
4899 : -DEBUGGING or -DDEBUGGING or
4900 : -DEBUGGING=both = -g + -DDEBUGGING
4901 : -DEBUGGING=-g or -Doptimize=-g = -g
4902 : -DEBUGGING=none or -UDEBUGGING =
4903 : -DEBUGGING=old or -DEBUGGING=default = ? $optimize
4906 *) DEBUGGING=$EBUGGING ;;
4909 case "$DEBUGGING" in
4913 *) optimize="$optimize -g" ;;
4917 *-g*) set `echo "X $optimize " | sed 's/ -g / /'`
4925 case "$DEBUGGING" in
4926 both|$define) dflt='-DDEBUGGING'
4929 : We will not override a previous value, but we might want to
4930 : augment a hint file
4932 default|recommended)
4933 case "$gccversion" in
4934 1*) dflt="$dflt -fpcc-struct-return" ;;
4936 case "$optimize:$DEBUGGING" in
4937 *-g*:old) dflt="$dflt -DDEBUGGING";;
4939 case "$gccversion" in
4940 2*) if test -d /etc/conf/kconfig.d &&
4941 $contains _POSIX_VERSION $usrinc/sys/unistd.h >/dev/null 2>&1
4943 # Interactive Systems (ISC) POSIX mode.
4948 case "$gccversion" in
4952 echo "Checking if your compiler accepts -fno-strict-aliasing" 2>&1
4953 echo 'int main(void) { return 0; }' > gcctest.c
4954 if $cc -O2 -fno-strict-aliasing -o gcctest gcctest.c; then
4955 echo "Yes, it does." 2>&1
4958 echo "Leaving current flags $ccflags alone." 2>&1
4960 *) dflt="$dflt -fno-strict-aliasing" ;;
4963 echo "Nope, it doesn't, but that's ok." 2>&1
4967 # For gcc, adding -pipe speeds up compilations for some, but apparently
4968 # some assemblers can't read from stdin. (It also slows down compilations
4969 # in other cases, but those are apparently rarer these days.) AD 5/2004.
4970 case "$gccversion" in
4972 echo "Checking if your compiler accepts -pipe" 2>&1
4973 echo 'int main(void) { return 0; }' > gcctest.c
4974 if $cc -pipe -o gcctest gcctest.c; then
4975 echo "Yes, it does." 2>&1
4978 echo "Leaving current flags $ccflags alone." 2>&1
4980 *) dflt="$dflt -pipe" ;;
4983 echo "Nope, it doesn't, but that's ok." 2>&1
4990 case "$mips_type" in
4991 *BSD*|'') inclwanted="$locincpth $usrinc";;
4992 *) inclwanted="$locincpth $inclwanted $usrinc/bsd";;
4994 for thisincl in $inclwanted; do
4995 if $test -d $thisincl; then
4996 if $test x$thisincl != x$usrinc; then
4998 *" -I$thisincl "*);;
4999 *) dflt="$dflt -I$thisincl ";;
5005 inctest='if $contains $2 $usrinc/$1 >/dev/null 2>&1; then
5007 elif $contains $2 $usrinc/sys/$1 >/dev/null 2>&1; then
5015 *) dflt="$dflt -D$2";;
5019 set signal.h LANGUAGE_C; eval $inctest
5023 ccflags="$ccflags -DSOCKS"
5028 default|recommended) dflt="$ccflags $dflt" ;;
5029 *) dflt="$ccflags";;
5038 Your C compiler may want other flags. For this question you should include
5039 -I/whatever and -DWHATEVER flags and any other flags used by the C compiler,
5040 but you should NOT include libraries or ld flags like -lwhatever. If you
5041 want $package to honor its debug switch, you should include -DDEBUGGING here.
5042 Your C compiler might also need additional flags, such as -D_POSIX_SOURCE.
5044 To use no flags, specify the word "none".
5050 rp="Any additional cc flags?"
5057 : the following weeds options from ccflags that are of no interest to cpp
5059 '') cppflags="$ccflags" ;;
5060 *) cppflags="$cppflags $ccflags" ;;
5062 case "$gccversion" in
5063 1*) cppflags="$cppflags -D__GNUC__"
5065 case "$mips_type" in
5067 *BSD*) cppflags="$cppflags -DSYSTYPE_BSD43";;
5073 echo "Let me guess what the preprocessor flags are..." >&4
5087 *) ftry="$previous $flag";;
5089 if $cppstdin -DLFRULB=bar $cppflags $ftry $cppminus <cpp.c \
5090 >cpp1.out 2>/dev/null && \
5091 $cpprun -DLFRULB=bar $cppflags $ftry $cpplast <cpp.c \
5092 >cpp2.out 2>/dev/null && \
5093 $contains 'foo.*xx.*bar' cpp1.out >/dev/null 2>&1 && \
5094 $contains 'foo.*xx.*bar' cpp2.out >/dev/null 2>&1
5096 cppflags="$cppflags $ftry"
5106 *-*) echo "They appear to be: $cppflags";;
5108 $rm -f cpp.c cpp?.out
5112 : flags used in final linking phase
5114 '') if ./venix; then
5120 *-posix*) dflt="$dflt -posix" ;;
5123 *) dflt="$ldflags";;
5126 : Try to guess additional flags to pick up local libraries.
5127 for thislibdir in $libpth; do
5128 case " $loclibpth " in
5131 *"-L$thislibdir "*) ;;
5132 *) dflt="$dflt -L$thislibdir" ;;
5144 Your C linker may need flags. For this question you should
5145 include -L/whatever and any other flags used by the C linker, but you
5146 should NOT include libraries like -lwhatever.
5148 Make sure you include the appropriate -L/path flags if your C linker
5149 does not normally search all of the directories you specified above,
5152 To use no flags, specify the word "none".
5156 rp="Any additional ld flags (NOT including libraries)?"
5162 rmlist="$rmlist pdp11"
5166 echo "Checking your choice of C compiler and flags for coherency..." >&4
5167 $cat > try.c <<'EOF'
5169 int main() { printf("Ok\n"); return(0); }
5171 set X $cc -o try $optimize $ccflags $ldflags try.c $libs
5173 $cat >try.msg <<'EOM'
5174 I've tried to compile and run the following simple program:
5177 $cat try.c >> try.msg
5179 $cat >> try.msg <<EOM
5186 and I got the following output:
5190 if $sh -c "$cc -o try $optimize $ccflags $ldflags try.c $libs" >>try.msg 2>&1; then
5191 if $sh -c "$run ./try" >>try.msg 2>&1; then
5195 *) echo 'The program compiled OK, but produced no output.' >> try.msg
5198 cat >> try.msg <<'EOQS'
5199 If $libs contains -lsfio, and sfio is mis-configured, then it
5200 sometimes (apparently) runs and exits with a 0 status, but with no
5201 output! It may have to do with sfio's use of _exit vs. exit.
5204 rp="You have a big problem. Shall I abort Configure"
5211 echo "The program compiled OK, but exited with status $?." >>try.msg
5212 rp="You have a problem. Shall I abort Configure"
5216 echo "I can't compile the test program." >>try.msg
5217 rp="You have a BIG problem. Shall I abort Configure"
5223 case "$knowitall" in
5225 echo "(The supplied flags or libraries might be incorrect.)"
5233 *) echo "Ok. Stopping Configure." >&4
5238 n) echo "OK, that should do.";;
5240 $rm -f try try.* core
5242 : define a shorthand compile call
5246 $cc -o ${mc_file} $optimize $ccflags $ldflags $* ${mc_file}.c $libs > /dev/null 2>&1;'
5247 : define a shorthand compile call for compilations that should be ok.
5251 $cc -o ${mc_file} $optimize $ccflags $ldflags $* ${mc_file}.c $libs;'
5253 : determine filename position in cpp output
5255 echo "Computing filename position in cpp output for #include directives..." >&4
5257 vos) testaccess=-e ;;
5260 echo '#include <stdio.h>' > foo.c
5263 $cppstdin $cppflags $cppminus <foo.c 2>/dev/null | \
5264 $grep '^[ ]*#.*stdio\.h' | \
5265 while read cline; do
5268 while $test \$# -gt 0; do
5269 if $test $testaccess \`echo \$1 | $tr -d '"'\`; then
5274 pos=\`expr \$pos + 1\`
5286 *) pos="${fieldn}th";;
5288 echo "Your cpp writes the filename in the $pos field of the line."
5291 vos) cppfilter="tr '\\\\>' '/' |" ;; # path component separator is >
5292 os2) cppfilter="sed -e 's|\\\\\\\\|/|g' |" ;; # path component separator is \
5295 : locate header file
5300 for usrincdir in $usrinc
5302 if test -f \$usrincdir/\$wanted; then
5303 echo "\$usrincdir/\$wanted"
5307 awkprg='{ print \$$fieldn }'
5308 echo "#include <\$wanted>" > foo\$\$.c
5309 $cppstdin $cppminus $cppflags < foo\$\$.c 2>/dev/null | \
5310 $cppfilter $grep "^[ ]*#.*\$wanted" | \
5311 while read cline; do
5312 name=\`echo \$cline | $awk "\$awkprg" | $tr -d '"'\`
5314 *[/\\\\]\$wanted) echo "\$name"; exit 1;;
5315 *[\\\\/]\$wanted) echo "\$name"; exit 1;;
5320 # status = 0: grep returned 0 lines, case statement not executed
5321 # status = 1: headerfile found
5322 # status = 2: while loop executed, no headerfile found
5326 if test \$status -eq 1; then
5333 : define an alternate in-header-list? function
5334 inhdr='echo " "; td=$define; tu=$undef; yyy=$@;
5335 cont=true; xxf="echo \"<\$1> found.\" >&4";
5336 case $# in 2) xxnf="echo \"<\$1> NOT found.\" >&4";;
5337 *) xxnf="echo \"<\$1> NOT found, ...\" >&4";;
5339 case $# in 4) instead=instead;; *) instead="at last";; esac;
5340 while $test "$cont"; do
5342 var=$2; eval "was=\$$2";
5343 if $test "$xxx" && $test -r "$xxx";
5345 eval "case \"\$$var\" in $undef) . ./whoa; esac"; eval "$var=\$td";
5348 eval "case \"\$$var\" in $define) . ./whoa; esac"; eval "$var=\$tu"; fi;
5349 set $yyy; shift; shift; yyy=$@;
5350 case $# in 0) cont="";;
5351 2) xxf="echo \"but I found <\$1> $instead.\" >&4";
5352 xxnf="echo \"and I did not find <\$1> either.\" >&4";;
5353 *) xxf="echo \"but I found <\$1\> instead.\" >&4";
5354 xxnf="echo \"there is no <\$1>, ...\" >&4";;
5358 do set $yyy; var=$2; eval "was=\$$2";
5359 eval "case \"\$$var\" in $define) . ./whoa; esac"; eval "$var=\$tu";
5360 set $yyy; shift; shift; yyy=$@;
5363 : see if stdlib is available
5364 set stdlib.h i_stdlib
5367 : check for lengths of integral types
5371 echo "Checking to see how big your integers are..." >&4
5380 printf("intsize=%d;\n", (int)sizeof(int));
5381 printf("longsize=%d;\n", (int)sizeof(long));
5382 printf("shortsize=%d;\n", (int)sizeof(short));
5387 if eval $compile_ok && $run ./try > /dev/null; then
5389 echo "Your integers are $intsize bytes long."
5390 echo "Your long integers are $longsize bytes long."
5391 echo "Your short integers are $shortsize bytes long."
5395 Help! I can't compile and run the intsize test program: please enlighten me!
5396 (This is probably a misconfiguration in your system or libraries, and
5397 you really ought to fix it. Still, I'll try anyway.)
5401 rp="What is the size of an integer (in bytes)?"
5405 rp="What is the size of a long integer (in bytes)?"
5409 rp="What is the size of a short integer (in bytes)?"
5417 : check for long long
5419 echo "Checking to see if you have long long..." >&4
5420 echo 'int main() { long long x = 7; return 0; }' > try.c
5422 if eval $compile; then
5424 echo "You have long long."
5427 echo "You do not have long long."
5433 : check for length of long long
5434 case "${d_longlong}${longlongsize}" in
5437 echo "Checking to see how big your long longs are..." >&4
5438 $cat >try.c <<'EOCP'
5442 printf("%d\n", (int)sizeof(long long));
5447 if eval $compile_ok; then
5448 longlongsize=`$run ./try`
5449 echo "Your long longs are $longlongsize bytes long."
5453 echo "(I can't seem to compile the test program. Guessing...)"
5454 rp="What is the size of a long long (in bytes)?"
5458 if $test "X$longsize" = "X$longlongsize"; then
5459 echo "(That isn't any different from an ordinary long.)"
5465 : see if inttypes.h is available
5466 : we want a real compile instead of Inhdr because some systems
5467 : have an inttypes.h which includes non-existent headers
5470 #include <inttypes.h>
5472 static int32_t foo32 = 0x12345678;
5476 if eval $compile; then
5477 echo "<inttypes.h> found." >&4
5480 echo "<inttypes.h> NOT found." >&4
5489 echo "Checking to see if you have int64_t..." >&4
5491 #include <sys/types.h>
5492 #$i_inttypes I_INTTYPES
5494 #include <inttypes.h>
5496 int main() { int64_t x = 7; }
5499 if eval $compile; then
5501 echo "You have int64_t."
5504 echo "You do not have int64_t."
5512 echo "Checking which 64-bit integer type we could use..." >&4
5518 val='"unsigned int"'
5523 *) case "$longsize" in
5527 val='"unsigned long"'
5532 *) case "$d_longlong:$longlongsize" in
5537 val='"unsigned long long"'
5542 *) case "$d_int64_t" in
5561 '') echo "Alas, no 64-bit integer types in sight." >&4
5564 *) echo "We could use '$quadtype' for 64-bit integers." >&4
5570 case "$uselonglong" in
5571 "$define"|true|[yY]*)
5574 *** Configure -Duselonglong is deprecated, using -Duse64bitint instead.
5576 use64bitint="$define"
5579 case "$use64bits" in
5580 "$define"|true|[yY]*)
5583 *** Configure -Duse64bits is deprecated, using -Duse64bitint instead.
5585 use64bitint="$define"
5588 case "$use64bitints" in
5589 "$define"|true|[yY]*)
5592 *** There is no Configure -Duse64bitints, using -Duse64bitint instead.
5594 use64bitint="$define"
5597 case "$use64bitsint" in
5598 "$define"|true|[yY]*)
5601 *** There is no Configure -Duse64bitsint, using -Duse64bitint instead.
5603 use64bitint="$define"
5606 case "$uselonglongs" in
5607 "$define"|true|[yY]*)
5610 *** There is no Configure -Duselonglongs, using -Duse64bitint instead.
5612 use64bitint="$define"
5615 case "$use64bitsall" in
5616 "$define"|true|[yY]*)
5619 *** There is no Configure -Duse64bitsall, using -Duse64bitall instead.
5621 use64bitall="$define"
5626 *-DUSE_LONG_LONG*|*-DUSE_64_BIT_INT*|*-DUSE_64_BIT_ALL*) use64bitint="$define";;
5628 case "$use64bitall" in
5629 "$define"|true|[yY]*) use64bitint="$define" ;;
5635 You have natively 64-bit long integers.
5639 *) case "$use64bitint" in
5640 "$define"|true|[yY]*) dflt='y';;
5649 Perl can be built to take advantage of 64-bit integer types
5650 on some systems. To do so, Configure can be run with -Duse64bitint.
5651 Choosing this option will most probably introduce binary incompatibilities.
5653 If this doesn't make any sense to you, just accept the default '$dflt'.
5654 (The default has been chosen based on your configuration.)
5656 rp='Try to use 64-bit integers, if available?'
5659 [yY]*) val="$define" ;;
5667 case "$use64bitall" in
5668 "$define"|true|[yY]*) dflt='y' ;;
5669 *) case "$longsize" in
5677 You may also choose to try maximal 64-bitness. It means using as much
5678 64-bitness as possible on the platform. This in turn means even more
5679 binary incompatibilities. On the other hand, your platform may not
5680 have any more 64-bitness available than what you already have chosen.
5682 If this doesn't make any sense to you, just accept the default '$dflt'.
5683 (The default has been chosen based on your configuration.)
5685 rp='Try to use maximal 64-bit support, if available?'
5688 [yY]*) val="$define" ;;
5693 case "$use64bitall" in
5695 case "$use64bitint" in
5699 Since you have chosen a maximally 64-bit build, I'm also turning on
5700 the use of 64-bit integers.
5702 use64bitint="$define" ;;
5707 : Look for a hint-file generated 'call-back-unit'. If the
5708 : user has specified that a 64-bit perl is to be built,
5709 : we may need to set or change some other defaults.
5710 if $test -f use64bitint.cbu; then
5711 echo "Your platform has some specific hints regarding 64-bit integers, using them..."
5714 case "$use64bitint" in
5715 "$define"|true|[yY]*)
5717 4) case "$archname64" in
5718 '') archname64=64int ;;
5725 : Look for a hint-file generated 'call-back-unit'. If the
5726 : user has specified that a maximally 64-bit perl is to be built,
5727 : we may need to set or change some other defaults.
5728 if $test -f use64bitall.cbu; then
5729 echo "Your platform has some specific hints regarding 64-bit builds, using them..."
5732 case "$use64bitall" in
5733 "$define"|true|[yY]*)
5735 4) case "$archname64" in
5736 ''|64int) archname64=64all ;;
5743 case "$d_quad:$use64bitint" in
5747 *** You have chosen to use 64-bit integers,
5748 *** but none can be found.
5749 *** Please rerun Configure without -Duse64bitint and/or -Dusemorebits.
5750 *** Cannot continue, aborting.
5757 : check for length of double
5759 case "$doublesize" in
5761 echo "Checking to see how big your double precision numbers are..." >&4
5770 printf("%d\n", (int)sizeof(double));
5775 if eval $compile_ok; then
5776 doublesize=`$run ./try`
5777 echo "Your double is $doublesize bytes long."
5780 echo "(I can't seem to compile the test program. Guessing...)"
5781 rp="What is the size of a double precision number (in bytes)?"
5789 : check for long doubles
5791 echo "Checking to see if you have long double..." >&4
5792 echo 'int main() { long double x = 7.0; }' > try.c
5794 if eval $compile; then
5796 echo "You have long double."
5799 echo "You do not have long double."
5805 : check for length of long double
5806 case "${d_longdbl}${longdblsize}" in
5809 echo "Checking to see how big your long doubles are..." >&4
5810 $cat >try.c <<'EOCP'
5814 printf("%d\n", sizeof(long double));
5819 if eval $compile; then
5820 longdblsize=`$run ./try`
5821 echo "Your long doubles are $longdblsize bytes long."
5825 echo "(I can't seem to compile the test program. Guessing...)" >&4
5826 rp="What is the size of a long double (in bytes)?"
5830 if $test "X$doublesize" = "X$longdblsize"; then
5831 echo "That isn't any different from an ordinary double."
5832 echo "I'll keep your setting anyway, but you may see some"
5833 echo "harmless compilation warnings."
5839 : determine the architecture name
5841 if xxx=`./loc arch blurfl $pth`; $test -f "$xxx"; then
5842 tarch=`arch`"-$osname"
5843 elif xxx=`./loc uname blurfl $pth`; $test -f "$xxx" ; then
5844 if uname -m > tmparch 2>&1 ; then
5845 tarch=`$sed -e 's/ *$//' -e 's/ /_/g' \
5846 -e 's/$/'"-$osname/" tmparch`
5854 case "$myarchname" in
5857 echo "(Your architecture name used to be $myarchname.)"
5861 case "$targetarch" in
5863 *) archname=`echo $targetarch|sed 's,^[^-]*-,,'` ;;
5868 *) dflt="$archname";;
5870 rp='What is your architecture name'
5873 case "$usethreads" in
5875 echo "Threads selected." >&4
5877 *-thread*) echo "...and architecture name already has -thread." >&4
5879 *) archname="$archname-thread"
5880 echo "...setting architecture name to $archname." >&4
5885 case "$usemultiplicity" in
5887 echo "Multiplicity selected." >&4
5889 *-multi*) echo "...and architecture name already has -multi." >&4
5891 *) archname="$archname-multi"
5892 echo "...setting architecture name to $archname." >&4
5897 case "$use64bitint$use64bitall" in
5899 case "$archname64" in
5901 echo "This architecture is naturally 64-bit, not changing architecture name." >&4
5904 case "$use64bitint" in
5905 "$define") echo "64 bit integers selected." >&4 ;;
5907 case "$use64bitall" in
5908 "$define") echo "Maximal 64 bitness selected." >&4 ;;
5911 *-$archname64*) echo "...and architecture name already has $archname64." >&4
5913 *) archname="$archname-$archname64"
5914 echo "...setting architecture name to $archname." >&4
5920 case "$uselongdouble" in
5922 echo "Long doubles selected." >&4
5923 case "$longdblsize" in
5925 echo "...but long doubles are equal to doubles, not changing architecture name." >&4
5929 *-ld*) echo "...and architecture name already has -ld." >&4
5931 *) archname="$archname-ld"
5932 echo "...setting architecture name to $archname." >&4
5939 case "$useperlio" in
5941 echo "Perlio selected." >&4
5944 echo "Perlio not selected, using stdio." >&4
5946 *-stdio*) echo "...and architecture name already has -stdio." >&4
5948 *) archname="$archname-stdio"
5949 echo "...setting architecture name to $archname." >&4
5954 if $test -f archname.cbu; then
5955 echo "Your platform has some specific hints for architecture name, using them..."
5959 : set the prefixit variable, to compute a suitable default value
5960 prefixit='case "$3" in
5962 case "$oldprefix" in
5963 "") eval "$1=\"\$$2\"";;
5970 ""|" ") eval "$1=\"\$$2\"";;
5976 eval "tp=\"$oldprefix-\$$2-\""; eval "tp=\"$tp\"";
5978 --|/*--|\~*--) eval "$1=\"$prefix/$3\"";;
5979 /*-$oldprefix/*|\~*-$oldprefix/*)
5980 eval "$1=\`echo \$$2 | sed \"s,^$oldprefix,$prefix,\"\`";;
5981 *) eval "$1=\"\$$2\"";;
5985 : get the patchlevel
5987 echo "Getting the current patchlevel..." >&4
5988 if $test -r $rsrc/patchlevel.h;then
5989 revision=`awk '/define[ ]+PERL_REVISION/ {print $3}' $rsrc/patchlevel.h`
5990 patchlevel=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
5991 subversion=`awk '/define[ ]+PERL_SUBVERSION/ {print $3}' $rsrc/patchlevel.h`
5992 api_revision=`awk '/define[ ]+PERL_API_REVISION/ {print $3}' $rsrc/patchlevel.h`
5993 api_version=`awk '/define[ ]+PERL_API_VERSION/ {print $3}' $rsrc/patchlevel.h`
5994 api_subversion=`awk '/define[ ]+PERL_API_SUBVERSION/ {print $3}' $rsrc/patchlevel.h`
5995 perl_patchlevel=`egrep 'define PERL_PATCHNUM [0-9][0-9]|,"MAINT[0-9][0-9]*"' $rsrc/patchlevel.h|sed 's/[^0-9]//g'`
6004 $echo "(You do not have patchlevel.h. Eek.)"
6006 if $test -r $rsrc/.patch ; then
6007 if $test "X$perl_patchlevel" = "X" || $test "`cat $rsrc/.patch`" -gt "$perl_patchlevel" ; then
6008 perl_patchlevel=`cat $rsrc/.patch`
6011 : Define a handy string here to avoid duplication in myconfig.SH and configpm.
6012 version_patchlevel_string="version $patchlevel subversion $subversion"
6013 case "$perl_patchlevel" in
6015 *) version_patchlevel_string="$version_patchlevel_string patch $perl_patchlevel" ;;
6018 $echo "(You have $package $version_patchlevel_string.)"
6022 : XXX Should be a Configure test for double-dots in filenames.
6023 version=`echo $revision $patchlevel $subversion | \
6024 $awk '{ printf "%d_%d_%d\n", $1, $2, $3 }'`
6025 api_versionstring=`echo $api_revision $api_version $api_subversion | \
6026 $awk '{ printf "%d_%d_%d\n", $1, $2, $3 }'`
6029 version=`echo $revision $patchlevel $subversion | \
6030 $awk '{ printf "%d.%d.%d\n", $1, $2, $3 }'`
6031 api_versionstring=`echo $api_revision $api_version $api_subversion | \
6032 $awk '{ printf "%d.%d.%d\n", $1, $2, $3 }'`
6035 : Special case the 5.005_xx maintenance series, which used 5.005
6036 : without any subversion label as a subdirectory in $sitelib
6037 if test "${api_revision}${api_version}${api_subversion}" = "550"; then
6038 api_versionstring='5.005'
6041 : determine installation style
6042 : For now, try to deduce it from prefix unless it is already set.
6043 : Reproduce behavior of 5.005 and earlier, maybe drop that in 5.7.
6044 case "$installstyle" in
6045 '') case "$prefix" in
6046 *perl*) dflt='lib';;
6047 *) dflt='lib/perl5' ;;
6050 *) dflt="$installstyle" ;;
6052 : Probably not worth prompting for this since we prompt for all
6053 : the directories individually, and the prompt would be too long and
6057 : determine where public executables go
6062 rp='Pathname where the public executables will reside?'
6064 if $test "X$ansexp" != "X$binexp"; then
6068 : XXX Bug? -- ignores Configure -Dinstallprefix setting.
6069 : XXX If this is fixed, also fix the "start perl" hunk below, which relies on
6070 : this via initialinstalllocation
6073 case "$userelocatableinc" in
6074 $define|true|[yY]*) dflt='y' ;;
6079 Would you like to build Perl so that the installation is relocatable, so that
6080 library paths in @INC are determined relative to the path of the perl binary?
6081 This is not advised for system Perl installs, or if you need to run setid
6082 scripts or scripts under taint mode.
6084 If this doesn't make any sense to you, just accept the default '$dflt'.
6086 rp='Use relocatable @INC?'
6089 y|Y) val="$define" ;;
6092 set userelocatableinc
6095 initialinstalllocation="$binexp"
6096 : Default prefix is now "up one level from where the binaries are"
6097 case "$userelocatableinc" in
6103 installprefixexp=".../.."
6107 : determine where private library files go
6108 : Usual default is /usr/local/lib/perl5/$version.
6109 : Also allow things like /opt/perl/lib/$version, since
6110 : /opt/perl/lib/perl5... would be redundant.
6111 : The default "style" setting is made in installstyle.U
6112 case "$installstyle" in
6113 *lib/perl5*) set dflt privlib lib/$package/$version ;;
6114 *) set dflt privlib lib/$version ;;
6119 There are some auxiliary files for $package that need to be put into a
6120 private library directory that is accessible by everyone.
6125 rp='Pathname where the private library files will reside?'
6130 : set the prefixup variable, to restore leading tilda escape
6131 prefixup='case "$prefixexp" in
6133 *) eval "$1=\`echo \$$1 | sed \"s,^$prefixexp,$prefix,\"\`";;
6136 : determine where public architecture dependent libraries go
6139 : privlib default is /usr/local/lib/$package/$version
6140 : archlib default is /usr/local/lib/$package/$version/$archname
6141 : privlib may have an optional trailing /share.
6142 tdflt=`echo $privlib | $sed 's,/share$,,'`
6143 tdflt=$tdflt/$archname
6152 $spackage contains architecture-dependent library files. If you are
6153 sharing libraries in a heterogeneous environment, you might store
6154 these files in a separate location. Otherwise, you can just include
6155 them with the rest of the public library files.
6160 rp='Where do you want to put the public architecture-dependent libraries?'
6164 if $test X"$archlib" = X"$privlib"; then
6170 : see if setuid scripts can be secure
6173 Some kernels have a bug that prevents setuid #! scripts from being
6174 secure. Some sites have disabled setuid #! scripts because of this.
6176 First let's decide if your kernel supports secure setuid #! scripts.
6177 (If setuid #! scripts would be secure but have been disabled anyway,
6178 don't say that they are secure if asked.)
6183 if $test -d /dev/fd; then
6184 echo "#!$ls" >reflect
6185 chmod +x,u+s reflect
6186 ./reflect >flect 2>&1
6187 if $contains "/dev/fd" flect >/dev/null; then
6188 echo "Congratulations, your kernel has secure setuid scripts!" >&4
6192 If you are not sure if they are secure, I can check but I'll need a
6193 username and password different from the one you are using right now.
6194 If you don't have such a username or don't want me to test, simply
6198 rp='Other username to test security of setuid scripts with?'
6203 case "$d_suidsafe" in
6204 '') echo "I'll assume setuid scripts are *not* secure." >&4
6207 echo "Well, the $hint value is *not* secure." >&4
6209 *) echo "Well, the $hint value *is* secure." >&4
6214 $rm -f reflect flect
6215 echo "#!$ls" >reflect
6216 chmod +x,u+s reflect
6219 echo '"su" will (probably) prompt you for '"$ans's password."
6220 su $ans -c './reflect >flect'
6221 if $contains "/dev/fd" flect >/dev/null; then
6222 echo "Okay, it looks like setuid scripts are secure." >&4
6225 echo "I don't think setuid scripts are secure." >&4
6230 rp='Does your kernel have *secure* setuid scripts?'
6233 [yY]*) val="$define";;
6238 echo "I don't think setuid scripts are secure (no /dev/fd directory)." >&4
6239 echo "(That's for file descriptors, not floppy disks.)"
6245 $rm -f reflect flect
6247 : now see if they want to do setuid emulation
6250 case "$d_suidsafe" in
6253 echo "No need to emulate SUID scripts since they are secure here." >&4
6257 Some systems have disabled setuid scripts, especially systems where
6258 setuid scripts cannot be secure. On systems where setuid scripts have
6259 been disabled, the setuid/setgid bits on scripts are currently
6260 useless. It is possible for $package to detect those bits and emulate
6261 setuid/setgid in a secure fashion. This emulation will only work if
6262 setuid scripts have been disabled in your kernel.
6266 "$define") dflt=y ;;
6269 rp="Do you want to do setuid/setgid emulation?"
6272 [yY]*) val="$define";;
6280 : Find perl5.005 or later.
6281 echo "Looking for a previously installed perl5.005 or later... "
6283 '') for tdir in `echo "$binexp$path_sep$PATH" | $sed "s/$path_sep/ /g"`; do
6284 : Check if this perl is recent and can load a simple module
6285 if $test -x $tdir/perl$exe_ext && $tdir/perl -Mless -e 'use 5.005;' >/dev/null 2>&1; then
6288 elif $test -x $tdir/perl5$exe_ext && $tdir/perl5 -Mless -e 'use 5.005;' >/dev/null 2>&1; then
6298 '') echo "None found. That's ok.";;
6299 *) echo "Using $perl5." ;;
6304 After $package is installed, you may wish to install various
6305 add-on modules and utilities. Typically, these add-ons will
6306 be installed under $prefix with the rest
6307 of this package. However, you may wish to install such add-ons
6308 elsewhere under a different prefix.
6310 If you do not wish to put everything under a single prefix, that's
6311 ok. You will be prompted for the individual locations; this siteprefix
6312 is only used to suggest the defaults.
6314 The default should be fine for most people.
6318 rp='Installation prefix to use for add-on modules and utilities?'
6319 : XXX Here might be another good place for an installstyle setting.
6320 case "$siteprefix" in
6322 *) dflt=$siteprefix ;;
6325 : XXX Prefixit unit does not yet support siteprefix and vendorprefix
6327 case "$siteprefix" in
6331 *) oldsiteprefix="$prefix";;
6336 siteprefixexp="$ansexp"
6338 : determine where site specific libraries go.
6339 : Usual default is /usr/local/lib/perl5/site_perl/$version
6340 : The default "style" setting is made in installstyle.U
6341 : XXX No longer works with Prefixit stuff.
6342 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
6344 '') case "$installstyle" in
6345 *lib/perl5*) dflt=$siteprefix/lib/$package/site_$prog/$version ;;
6346 *) dflt=$siteprefix/lib/site_$prog/$version ;;
6354 The installation process will create a directory for
6355 site-specific extensions and modules. Most users find it convenient
6356 to place all site-specific files in this directory rather than in the
6357 main distribution directory.
6361 rp='Pathname for the site-specific library files?'
6365 sitelib_stem=`echo "$sitelibexp" | sed "s,/$version$,,"`
6367 : Determine list of previous versions to include in @INC
6368 $cat > getverlist <<EOPL
6371 \$api_versionstring = "$api_versionstring";
6372 \$version = "$version";
6373 \$stem = "$sitelib_stem";
6374 \$archname = "$archname";
6376 $cat >> getverlist <<'EOPL'
6377 # The list found is store twice for each entry: the original name, and
6378 # the binary broken down version as pack "sss", so sorting is easy and
6379 # unambiguous. This will work for all versions that have a maximum of
6380 # three digit groups, separate by '.'s or '_'s. Names are extended with
6381 # ".0.0" to ensure at least three elements for the pack.
6382 # -- H.Merijn Brand (m)'06 23-10-2006
6384 # Can't have leading @ because metaconfig interprets it as a command!
6385 ;@inc_version_list=();
6386 # XXX Redo to do opendir/readdir?
6389 ;@candidates = map {
6390 [ $_, pack "sss", split m/[._]/, "$_.0.0" ] } glob("5.*");
6396 ($pversion, $aversion, $vsn5005) = map {
6397 pack "sss", split m/[._]/, "$_.0.0" } $version, $api_versionstring, "5.005";
6398 foreach $d (@candidates) {
6399 if ($d->[1] lt $pversion) {
6400 if ($d->[1] ge $aversion) {
6401 unshift(@inc_version_list, grep { -d } $d->[0]."/$archname", $d->[0]);
6403 elsif ($d->[1] ge $vsn5005) {
6404 unshift(@inc_version_list, grep { -d } $d->[0]);
6408 # Skip newer version. I.e. don't look in
6409 # 5.7.0 if we're installing 5.6.1.
6413 if (@inc_version_list) {
6414 print join(' ', @inc_version_list);
6417 # Blank space to preserve value for next Configure run.
6422 case "$inc_version_list" in
6423 '') if test -x "$perl5$exe_ext"; then
6424 dflt=`$perl5 getverlist`
6429 $undef) dflt='none' ;;
6430 *) eval dflt=\"$inc_version_list\" ;;
6433 ''|' ') dflt=none ;;
6440 In order to ease the process of upgrading, this version of perl
6441 can be configured to use modules built and installed with earlier
6442 versions of perl that were installed under $prefix. Specify here
6443 the list of earlier versions that this version of perl should check.
6444 If Configure detected no earlier versions of perl installed under
6445 $prefix, then the list will be empty. Answer 'none' to tell perl
6446 to not search earlier versions.
6448 The default should almost always be sensible, so if you're not sure,
6449 just accept the default.
6452 rp='List of earlier versions to include in @INC?'
6455 [Nn]one|''|' '|$undef) inc_version_list=' ' ;;
6456 *) inc_version_list="$ans" ;;
6458 case "$inc_version_list" in
6460 inc_version_list_init='0'
6461 d_inc_version_list="$undef"
6463 *) inc_version_list_init=`echo $inc_version_list |
6464 $sed -e 's/^/"/' -e 's/ /","/g' -e 's/$/",0/'`
6465 d_inc_version_list="$define"
6470 : see if this is a malloc.h system
6471 : we want a real compile instead of Inhdr because some systems have a
6472 : malloc.h that just gives a compile error saying to use stdlib.h instead
6477 int main () { return 0; }
6480 if eval $compile; then
6481 echo "<malloc.h> found." >&4
6484 echo "<malloc.h> NOT found." >&4
6491 : check for void type
6493 echo "Checking to see how well your C compiler groks the void type..." >&4
6494 case "$voidflags" in
6506 extern void moo(); /* function returning void */
6507 void (*goo)(); /* ptr to func returning void */
6509 void *hue; /* generic ptr */
6522 int main() { sub(); }
6524 if $cc $ccflags -c -DTRY=$defvoidused try.c >.out 2>&1 ; then
6525 voidflags=$defvoidused
6526 echo "Good. It appears to support void to the level $package wants.">&4
6527 if $contains warning .out >/dev/null 2>&1; then
6528 echo "However, you might get some warnings that look like this:"
6532 echo "Hmm, your compiler has some difficulty with void. Checking further..." >&4
6533 if $cc $ccflags -c -DTRY=1 try.c >/dev/null 2>&1; then
6534 echo "It supports 1..."
6535 if $cc $ccflags -c -DTRY=3 try.c >/dev/null 2>&1; then
6536 echo "It also supports 2..."
6537 if $cc $ccflags -c -DTRY=7 try.c >/dev/null 2>&1; then
6539 echo "And it supports 4 but not 8 definitely."
6541 echo "It doesn't support 4..."
6542 if $cc $ccflags -c -DTRY=11 try.c >/dev/null 2>&1; then
6544 echo "But it supports 8."
6547 echo "Neither does it support 8."
6551 echo "It does not support 2..."
6552 if $cc $ccflags -c -DTRY=13 try.c >/dev/null 2>&1; then
6554 echo "But it supports 4 and 8."
6556 if $cc $ccflags -c -DTRY=5 try.c >/dev/null 2>&1; then
6558 echo "And it supports 4 but has not heard about 8."
6560 echo "However it supports 8 but not 4."
6565 echo "There is no support at all for void."
6570 case "$voidflags" in
6573 Support flag bits are:
6574 1: basic void declarations.
6575 2: arrays of pointers to functions returning void.
6576 4: operations between pointers to and addresses of void functions.
6577 8: generic void pointers.
6580 rp="Your void support flags add up to what?"
6587 : check for length of pointer
6591 echo "Checking to see how big your pointers are..." >&4
6592 if test "$voidflags" -gt 7; then
6593 echo '#define VOID_PTR char *' > try.c
6595 echo '#define VOID_PTR void *' > try.c
6605 printf("%d\n", (int)sizeof(VOID_PTR));
6610 if eval $compile_ok; then
6611 ptrsize=`$run ./try`
6612 echo "Your pointers are $ptrsize bytes long."
6615 echo "(I can't seem to compile the test program. Guessing...)" >&4
6616 rp="What is the size of a pointer (in bytes)?"
6623 case "$use64bitall" in
6624 "$define"|true|[yY]*)
6628 *** You have chosen a maximally 64-bit build,
6629 *** but your pointers are only 4 bytes wide.
6630 *** Please rerun Configure without -Duse64bitall.
6635 *** Since you have quads, you could possibly try with -Duse64bitint.
6640 *** Cannot continue, aborting.
6651 : determine whether to use malloc wrapping
6653 case "$usemallocwrap" in
6654 [yY]*|true|$define) dflt='y' ;;
6655 [nN]*|false|$undef) dflt='n' ;;
6656 *) case "$usedevel" in
6657 [yY]*|true|$define) dflt='y' ;;
6662 rp="Do you wish to wrap malloc calls to protect against potential overflows?"
6664 usemallocwrap="$ans"
6667 usemallocwrap="$define" ;;
6669 usemallocwrap="$undef" ;;
6672 : determine which malloc to compile in
6674 case "$usemymalloc" in
6675 [yY]*|true|$define) dflt='y' ;;
6676 [nN]*|false|$undef) dflt='n' ;;
6677 *) case "$ptrsize" in
6683 rp="Do you wish to attempt to use the malloc that comes with $package?"
6689 mallocsrc='malloc.c'
6690 mallocobj="malloc$_o"
6691 d_mymalloc="$define"
6694 : Remove malloc from list of libraries to use
6695 echo "Removing unneeded -lmalloc from library list" >&4
6696 set `echo X $libs | $sed -e 's/-lmalloc / /' -e 's/-lmalloc$//'`
6699 echo "libs = $libs" >&4
6711 : compute the return types of malloc and free
6713 $cat >malloc.c <<END
6717 #include <sys/types.h>
6731 case "$malloctype" in
6733 if $cc $ccflags -c -DTRY_MALLOC malloc.c >/dev/null 2>&1; then
6740 echo "Your system wants malloc to return '$malloctype', it would seem." >&4
6744 if $cc $ccflags -c -DTRY_FREE malloc.c >/dev/null 2>&1; then
6751 echo "Your system uses $freetype free(), it would seem." >&4
6753 : determine where site specific architecture-dependent libraries go.
6754 : sitelib default is /usr/local/lib/perl5/site_perl/$version
6755 : sitearch default is /usr/local/lib/perl5/site_perl/$version/$archname
6756 : sitelib may have an optional trailing /share.
6758 '') dflt=`echo $sitelib | $sed 's,/share$,,'`
6759 dflt="$dflt/$archname"
6764 set sitearch sitearch none
6768 The installation process will also create a directory for
6769 architecture-dependent site-specific extensions and modules.
6773 rp='Pathname for the site-specific architecture-dependent library files?'
6777 if $test X"$sitearch" = X"$sitelib"; then
6780 d_sitearch="$define"
6785 The installation process will also create a directory for
6786 vendor-supplied add-ons. Vendors who supply perl with their system
6787 may find it convenient to place all vendor-supplied files in this
6788 directory rather than in the main distribution directory. This will
6789 ease upgrades between binary-compatible maintenance versions of perl.
6791 Of course you may also use these directories in whatever way you see
6792 fit. For example, you might use them to access modules shared over a
6793 company-wide network.
6795 The default answer should be fine for most people.
6796 This causes further questions about vendor add-ons to be skipped
6797 and no vendor-specific directories will be configured for perl.
6800 rp='Do you want to configure vendor-specific add-on directories?'
6801 case "$usevendorprefix" in
6802 define|true|[yY]*) dflt=y ;;
6803 *) : User may have set vendorprefix directly on Configure command line.
6804 case "$vendorprefix" in
6813 rp='Installation prefix to use for vendor-supplied add-ons?'
6814 case "$vendorprefix" in
6816 *) dflt=$vendorprefix ;;
6819 : XXX Prefixit unit does not yet support siteprefix and vendorprefix
6821 case "$vendorprefix" in
6825 *) oldvendorprefix="$prefix";;
6829 usevendorprefix="$define"
6831 vendorprefixexp="$ansexp"
6833 *) usevendorprefix="$undef"
6839 case "$vendorprefix" in
6840 '') d_vendorlib="$undef"
6844 *) d_vendorlib="$define"
6845 : determine where vendor-supplied modules go.
6846 : Usual default is /usr/local/lib/perl5/vendor_perl/$version
6847 case "$vendorlib" in
6849 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
6850 case "$installstyle" in
6851 *lib/perl5*) dflt=$vendorprefix/lib/$package/vendor_$prog/$version ;;
6852 *) dflt=$vendorprefix/lib/vendor_$prog/$version ;;
6855 *) dflt="$vendorlib"
6859 rp='Pathname for the vendor-supplied library files?'
6862 vendorlibexp="$ansexp"
6865 vendorlib_stem=`echo "$vendorlibexp" | sed "s,/$version$,,"`
6869 case "$vendorprefix" in
6870 '') d_vendorarch="$undef"
6874 *) d_vendorarch="$define"
6875 : determine where vendor-supplied architecture-dependent libraries go.
6876 : vendorlib default is /usr/local/lib/perl5/vendor_perl/$version
6877 : vendorarch default is /usr/local/lib/perl5/vendor_perl/$version/$archname
6878 : vendorlib may have an optional trailing /share.
6879 case "$vendorarch" in
6880 '') dflt=`echo $vendorlib | $sed 's,/share$,,'`
6881 dflt="$dflt/$archname"
6883 *) dflt="$vendorarch" ;;
6886 rp='Pathname for vendor-supplied architecture-dependent files?'
6889 vendorarchexp="$ansexp"
6892 prefixvar=vendorarch
6895 : Final catch-all directories to search
6898 Lastly, you can have perl look in other directories for extensions and
6899 modules in addition to those already specified.
6900 These directories will be searched after
6904 test X"$vendorlib" != "X" && echo ' ' $vendorlib
6905 test X"$vendorarch" != "X" && echo ' ' $vendorarch
6907 case "$otherlibdirs" in
6908 ''|' ') dflt='none' ;;
6909 *) dflt="$otherlibdirs" ;;
6912 Enter a colon-separated set of extra paths to include in perl's @INC
6913 search path, or enter 'none' for no extra paths.
6917 rp='Colon-separated list of additional directories for perl to search?'
6920 ' '|''|none) otherlibdirs=' ' ;;
6921 *) otherlibdirs="$ans" ;;
6923 case "$otherlibdirs" in
6927 set d_perl_otherlibdirs
6930 : Cruising for prototypes
6932 echo "Checking out function prototypes..." >&4
6933 $cat >prototype.c <<EOCP
6938 int main(int argc, char *argv[]) {
6941 if $cc $ccflags -c prototype.c >prototype.out 2>&1 ; then
6942 echo "Your C compiler appears to support function prototypes."
6945 echo "Your C compiler doesn't seem to understand function prototypes."
6952 case "$prototype" in
6954 *) ansi2knr='ansi2knr'
6959 This version of $package can only be compiled by a compiler that
6960 understands function prototypes. Unfortunately, your C compiler
6962 doesn't seem to understand them. Sorry about that.
6964 If GNU cc is available for your system, perhaps you could try that instead.
6966 Eventually, we hope to support building Perl with pre-ANSI compilers.
6967 If you would like to help in that effort, please contact <perlbug@perl.org>.
6969 Aborting Configure now.
6981 Perl can be built with extra modules or bundles of modules which
6982 will be fetched from the CPAN and installed alongside Perl.
6984 Notice that you will need access to the CPAN; either via the Internet,
6985 or a local copy, for example a CD-ROM or a local CPAN mirror. (You will
6986 be asked later to configure the CPAN.pm module which will in turn do
6987 the installation of the rest of the extra modules or bundles.)
6989 Notice also that if the modules require any external software such as
6990 libraries and headers (the libz library and the zlib.h header for the
6991 Compress::Zlib module, for example) you MUST have any such software
6992 already installed, this configuration process will NOT install such
6995 If this doesn't make any sense to you, just accept the default '$dflt'.
6997 rp='Install any extra modules (y or n)?'
7003 Please list any extra modules or bundles to be installed from CPAN,
7004 with spaces between the names. The names can be in any format the
7005 'install' command of CPAN.pm will understand. (Answer 'none',
7006 without the quotes, to install no extra modules or bundles.)
7016 $rm -f ../extras.lst
7018 *) echo "(Saving the list of extras for later...)"
7019 echo "$extras" > ../extras.lst
7027 : determine where html pages for programs go
7028 set html1dir html1dir none
7032 If you wish to install html files for programs in $spackage, indicate
7033 the appropriate directory here. To skip installing html files,
7037 ''|none|$undef|' ') dflt=none ;;
7038 *) dflt=$html1dir ;;
7041 rp="Directory for the main $spackage html pages?"
7045 : Use ' ' for none so value is preserved next time through Configure
7046 $test X"$html1dir" = "X" && html1dir=' '
7048 : determine where html pages for libraries and modules go
7049 set html3dir html3dir none
7053 If you wish to install html files for modules associated with $spackage,
7054 indicate the appropriate directory here. To skip installing html files,
7057 : There is no obvious default. If they have specified html1dir, then
7058 : try to key off that, possibly changing .../html1 into .../html3.
7060 '') html3dir=`echo "$html1dir" | $sed 's/1$/3$/'` ;;
7061 *) dflt=$html3dir ;;
7064 rp="Directory for the $spackage module html pages?"
7068 : Use ' ' for none so value is preserved next time through Configure
7069 $test X"$html3dir" = "X" && html3dir=' '
7071 : determine whether to install perl also as /usr/bin/perl
7074 if $test -d /usr/bin -a "X$installbin" != X/usr/bin; then
7076 Many scripts expect perl to be installed as /usr/bin/perl.
7078 If you want to, I can install the perl you are about to compile
7079 as /usr/bin/perl (in addition to $bin/perl).
7081 if test -f /usr/bin/perl; then
7084 However, please note that because you already have a /usr/bin/perl,
7085 overwriting that with a new Perl would very probably cause problems.
7086 Therefore I'm assuming you don't want to do that (unless you insist).
7089 case "$installusrbinperl" in
7090 "$define"|[yY]*) dflt='y';;
7096 Since you don't have a /usr/bin/perl I'm assuming creating one is okay.
7099 case "$installusrbinperl" in
7100 "$undef"|[nN]*) dflt='n';;
7104 rp="Do you want to install perl as /usr/bin/perl?"
7107 [yY]*) val="$define";;
7113 set installusrbinperl
7117 echo "Checking for GNU C Library..." >&4
7119 /* Find out version of GNU C library. __GLIBC__ and __GLIBC_MINOR__
7120 alone are insufficient to distinguish different versions, such as
7121 2.0.6 and 2.0.7. The function gnu_get_libc_version() appeared in
7122 libc version 2.1.0. A. Dougherty, June 3, 2002.
7128 # ifdef __GLIBC_MINOR__
7129 # if __GLIBC__ >= 2 && __GLIBC_MINOR__ >= 1 && !defined(__cplusplus)
7130 # include <gnu/libc-version.h>
7131 printf("%s\n", gnu_get_libc_version());
7133 printf("%d.%d\n", __GLIBC__, __GLIBC_MINOR__);
7136 printf("%d\n", __GLIBC__);
7145 if eval $compile_ok && $run ./try > glibc.ver; then
7147 gnulibc_version=`$cat glibc.ver`
7148 echo "You are using the GNU C Library version $gnulibc_version"
7152 echo "You are not using the GNU C Library"
7154 $rm -f try try.* glibc.ver
7158 : see if nm is to be used to determine whether a symbol is defined or not
7162 case "$d_gnulibc" in
7165 echo "nm probably won't work on the GNU C Library." >&4
7171 if $test "$osname" = aix -a "X$PASE" != "Xdefine" -a ! -f /lib/syscalls.exp; then
7173 echo "Whoops! This is an AIX system without /lib/syscalls.exp!" >&4
7174 echo "'nm' won't be sufficient on this sytem." >&4
7180 '') dflt=`$egrep 'inlibc|csym' $rsrc/Configure | wc -l 2>/dev/null`
7181 if $test $dflt -gt 20; then
7191 true|$define) dflt=y;;
7198 I can use $nm to extract the symbols from your C libraries. This
7199 is a time consuming task which may generate huge output on the disk (up
7200 to 3 megabytes) but that should make the symbols extraction faster. The
7201 alternative is to skip the 'nm' extraction part and to compile a small
7202 test program instead to determine whether each symbol is present. If
7203 you have a fast C compiler and/or if your 'nm' output cannot be parsed,
7204 this may be the best solution.
7206 You probably shouldn't let me use 'nm' if you are using the GNU C Library.
7209 rp="Shall I use $nm to extract C symbols from the libraries?"
7212 [Nn]*) usenm=false;;
7221 : nm options which may be necessary
7223 '') if $test -f /mach_boot; then
7225 elif $test -d /usr/ccs/lib; then
7226 nm_opt='-p' # Solaris (and SunOS?)
7227 elif $test -f /dgux; then
7229 elif $test -f /lib64/rld; then
7230 nm_opt='-p' # 64-bit Irix
7236 : nm options which may be necessary for shared libraries but illegal
7237 : for archive libraries. Thank you, Linux.
7238 case "$nm_so_opt" in
7239 '') case "$myuname" in
7241 if $nm --help | $grep 'dynamic' > /dev/null 2>&1; then
7242 nm_so_opt='--dynamic'
7251 : get list of predefined functions in a handy place
7256 *-lc_s*) libc=`./loc libc_s$_a $libc $libpth`
7262 *) for thislib in $libs; do
7265 : Handle C library specially below.
7268 thislib=`echo $thislib | $sed -e 's/^-l//'`
7269 if try=`./loc lib$thislib.$so.'*' X $libpth`; $test -f "$try"; then
7271 elif try=`./loc lib$thislib.$so X $libpth`; $test -f "$try"; then
7273 elif try=`./loc lib$thislib$_a X $libpth`; $test -f "$try"; then
7275 elif try=`./loc $thislib$_a X $libpth`; $test -f "$try"; then
7277 elif try=`./loc lib$thislib X $libpth`; $test -f "$try"; then
7279 elif try=`./loc $thislib X $libpth`; $test -f "$try"; then
7281 elif try=`./loc Slib$thislib$_a X $xlibpth`; $test -f "$try"; then
7286 libnames="$libnames $try"
7288 *) libnames="$libnames $thislib" ;;
7297 for xxx in $libpth; do
7298 $test -r $1 || set $xxx/libc.$so
7299 : The messy sed command sorts on library version numbers.
7301 set `echo blurfl; echo $xxx/libc.$so.[0-9]* | \
7302 tr ' ' $trnl | egrep -v '\.[A-Za-z]*$' | $sed -e '
7304 s/[0-9][0-9]*/0000&/g
7305 s/0*\([0-9][0-9][0-9][0-9][0-9]\)/\1/g
7308 $sort | $sed -e 's/^.* //'`
7311 $test -r $1 || set /usr/ccs/lib/libc.$so
7312 $test -r $1 || set /lib/libsys_s$_a
7318 if $test -r "$1"; then
7319 echo "Your (shared) C library seems to be in $1."
7321 elif $test -r /lib/libc && $test -r /lib/clib; then
7322 echo "Your C library seems to be in both /lib/clib and /lib/libc."
7324 libc='/lib/clib /lib/libc'
7325 if $test -r /lib/syslib; then
7326 echo "(Your math library is in /lib/syslib.)"
7327 libc="$libc /lib/syslib"
7329 elif $test -r "$libc" || (test -h "$libc") >/dev/null 2>&1; then
7330 echo "Your C library seems to be in $libc, as you said before."
7331 elif $test -r $incpath/usr/lib/libc$_a; then
7332 libc=$incpath/usr/lib/libc$_a;
7333 echo "Your C library seems to be in $libc. That's fine."
7334 elif $test -r /lib/libc$_a; then
7336 echo "Your C library seems to be in $libc. You're normal."
7338 if tans=`./loc libc$_a blurfl/dyick $libpth`; $test -r "$tans"; then
7340 elif tans=`./loc libc blurfl/dyick $libpth`; $test -r "$tans"; then
7341 libnames="$libnames "`./loc clib blurfl/dyick $libpth`
7342 elif tans=`./loc clib blurfl/dyick $libpth`; $test -r "$tans"; then
7344 elif tans=`./loc Slibc$_a blurfl/dyick $xlibpth`; $test -r "$tans"; then
7346 elif tans=`./loc Mlibc$_a blurfl/dyick $xlibpth`; $test -r "$tans"; then
7349 tans=`./loc Llibc$_a blurfl/dyick $xlibpth`
7351 if $test -r "$tans"; then
7352 echo "Your C library seems to be in $tans, of all places."
7358 if $test $xxx = apollo -o -r "$libc" || (test -h "$libc") >/dev/null 2>&1; then
7362 If the guess above is wrong (which it might be if you're using a strange
7363 compiler, or your machine supports multiple models), you can override it here.
7368 echo $libpth | $tr ' ' $trnl | $sort | $uniq > libpath
7370 I can't seem to find your C library. I've looked in the following places:
7373 $sed 's/^/ /' libpath
7376 None of these seems to contain your C library. I need to get its name...
7381 rp='Where is your C library?'
7386 echo $libc $libnames | $tr ' ' $trnl | $sort | $uniq > libnames
7387 set X `cat libnames`
7390 case $# in 1) xxx=file; esac
7391 echo "Extracting names from the following $xxx for later perusal:" >&4
7393 $sed 's/^/ /' libnames >&4
7395 $echo $n "This may take a while...$c" >&4
7399 *$so*) $nm $nm_so_opt $nm_opt $file 2>/dev/null;;
7400 *) $nm $nm_opt $file 2>/dev/null;;
7405 $grep fprintf libc.tmp > libc.ptf
7406 xscan='eval "<libc.ptf $com >libc.list"; $echo $n ".$c" >&4'
7407 xrun='eval "<libc.tmp $com >libc.list"; echo "done." >&4'
7409 if com="$sed -n -e 's/__IO//' -e 's/^.* $xxx *//p'";\
7411 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7413 elif com="$sed -n -e 's/^__*//' -e 's/^\([a-zA-Z_0-9$]*\).*xtern.*/\1/p'";\
7415 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7417 elif com="$sed -n -e '/|UNDEF/d' -e '/FUNC..GL/s/^.*|__*//p'";\
7419 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7421 elif com="$sed -n -e 's/^.* D __*//p' -e 's/^.* D //p'";\
7423 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7425 elif com="$sed -n -e 's/^_//' -e 's/^\([a-zA-Z_0-9]*\).*xtern.*text.*/\1/p'";\
7427 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7429 elif com="$sed -n -e 's/^.*|FUNC |GLOB .*|//p'";\
7431 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7433 elif com="$grep '|' | $sed -n -e '/|COMMON/d' -e '/|DATA/d' \
7434 -e '/ file/d' -e 's/^\([^ ]*\).*/\1/p'";\
7436 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7438 elif com="$sed -n -e 's/^.*|FUNC |GLOB .*|//p' -e 's/^.*|FUNC |WEAK .*|//p'";\
7440 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7442 elif com="$sed -n -e 's/^__//' -e '/|Undef/d' -e '/|Proc/s/ .*//p'";\
7444 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7446 elif com="$sed -n -e 's/^.*|Proc .*|Text *| *//p'";\
7448 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7450 elif com="$sed -n -e '/Def. Text/s/.* \([^ ]*\)\$/\1/p'";\
7452 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7454 elif com="$sed -n -e 's/^[-0-9a-f ]*_\(.*\)=.*/\1/p'";\
7456 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7458 elif com="$sed -n -e 's/.*\.text n\ \ \ \.//p'";\
7460 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7462 elif com="sed -n -e 's/^__.*//' -e 's/[ ]*D[ ]*[0-9]*.*//p'";\
7464 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7467 $nm -p $* 2>/dev/null >libc.tmp
7468 $grep fprintf libc.tmp > libc.ptf
7469 if com="$sed -n -e 's/^.* [ADTSIW] *_[_.]*//p' -e 's/^.* [ADTSIW] //p'";\
7470 eval $xscan; $contains '^fprintf$' libc.list >/dev/null 2>&1
7476 echo "$nm didn't seem to work right. Trying $ar instead..." >&4
7478 if $ar t $libc > libc.tmp && $contains '^fprintf$' libc.tmp >/dev/null 2>&1; then
7479 for thisname in $libnames $libc; do
7480 $ar t $thisname >>libc.tmp
7482 $sed -e "s/\\$_o\$//" < libc.tmp > libc.list
7484 elif test "X$osname" = "Xos2" && $ar tv $libc > libc.tmp; then
7485 # Repeat libc to extract forwarders to DLL entries too
7486 for thisname in $libnames $libc; do
7487 $ar tv $thisname >>libc.tmp
7488 # Revision 50 of EMX has bug in $ar.
7489 # it will not extract forwarders to DLL entries
7490 # Use emximp which will extract exactly them.
7491 emximp -o tmp.imp $thisname \
7493 $sed -e 's/^\([_a-zA-Z0-9]*\) .*$/\1/p' \
7494 < tmp.imp >>libc.tmp
7497 $sed -e "s/\\$_o\$//" -e 's/^ \+//' < libc.tmp > libc.list
7500 echo "$ar didn't seem to work right." >&4
7501 echo "Maybe this is a Cray...trying bld instead..." >&4
7502 if bld t $libc | $sed -e 's/.*\///' -e "s/\\$_o:.*\$//" > libc.list
7504 for thisname in $libnames; do
7506 $sed -e 's/.*\///' -e "s/\\$_o:.*\$//" >>libc.list
7507 $ar t $thisname >>libc.tmp
7511 echo "That didn't work either. Giving up." >&4
7521 echo "Since you are compiling for PASE, extracting more symbols from libc.a ...">&4
7522 dump -Tv /lib/libc.a | awk '$7 == "/unix" {print $5 " " $8}' | grep "^SV" | awk '{print $2}' >> libc.list
7524 *) if $test -f /lib/syscalls.exp; then
7526 echo "Also extracting names from /lib/syscalls.exp for good ole AIX..." >&4
7527 $sed -n 's/^\([^ ]*\)[ ]*syscall[0-9]*[ ]*$/\1/p' /lib/syscalls.exp >>libc.list
7533 $rm -f libnames libpath
7535 : see if dld is available
7539 : is a C symbol defined?
7542 -v) tf=libc.tmp; tdc="";;
7543 -a) tf=libc.tmp; tdc="[]";;
7544 *) tlook="^$1\$"; tf=libc.list; tdc="()";;
7547 case "$reuseval-$4" in
7549 true-*) tx=no; eval "tval=\$$4"; case "$tval" in "") tx=yes;; esac;;
7554 if $test "$runnm" = true; then
7555 if $contains $tlook $tf >/dev/null 2>&1; then
7557 elif $test "$mistrustnm" = compile -o "$mistrustnm" = run; then
7558 echo "void *(*(p()))$tdc { extern void *$1$tdc; return &$1; } int main() { if(p()) return(0); else return(1); }"> try.c;
7559 $cc -o try $optimize $ccflags $ldflags try.c >/dev/null 2>&1 $libs && tval=true;
7560 $test "$mistrustnm" = run -a -x try && { $run ./try$_exe >/dev/null 2>&1 || tval=false; };
7561 $rm -f try$_exe try.c core core.* try.core;
7564 echo "void *(*(p()))$tdc { extern void *$1$tdc; return &$1; } int main() { if(p()) return(0); else return(1); }"> try.c;
7565 $cc -o try $optimize $ccflags $ldflags try.c $libs >/dev/null 2>&1 && tval=true;
7566 $rm -f try$_exe try.c;
7571 $define) tval=true;;
7578 : define an is-in-libc? function
7579 inlibc='echo " "; td=$define; tu=$undef;
7580 sym=$1; var=$2; eval "was=\$$2";
7582 case "$reuseval$was" in
7592 echo "$sym() found." >&4;
7593 case "$was" in $undef) . ./whoa; esac; eval "$var=\$td";;
7595 echo "$sym() NOT found." >&4;
7596 case "$was" in $define) . ./whoa; esac; eval "$var=\$tu";;
7600 $define) echo "$sym() found." >&4;;
7601 *) echo "$sym() NOT found." >&4;;
7607 echo "Checking for C++..." >&4
7621 if eval $compile_ok && $run ./try >cplusplus$$; then
7622 val=`$cat cplusplus$$`
7623 echo "You are using a C++ compiler."
7626 echo "You are not using a C++ compiler."
7628 $rm -f try try.* cplusplus$$
7632 : see if dlopen exists
7634 xxx_ccflags="$ccflags"
7636 : with g++ one needs -shared to get is-in-libc to work for dlopen
7637 case "$gccversion" in
7639 *) case "$d_cplusplus" in
7640 "$define") ccflags="$ccflags -shared" ;;
7647 ccflags="$xxx_ccflags"
7649 : see if this is a unistd.h system
7650 set unistd.h i_unistd
7653 : determine which dynamic loading, if any, to compile in
7655 dldir="ext/DynaLoader"
7668 $define) dflt='y' ;;
7671 $define) dflt='y' ;;
7673 : Does a dl_xxx.xs file exist for this operating system
7674 $test -f $rsrc/$dldir/dl_${osname}.xs && dflt='y'
7677 rp="Do you wish to use dynamic loading?"
7684 if $test -f $rsrc/$dldir/dl_${osname}.xs ; then
7685 dflt="$dldir/dl_${osname}.xs"
7686 elif $test "$d_dlopen" = "$define" ; then
7687 dflt="$dldir/dl_dlopen.xs"
7688 elif $test "$i_dld" = "$define" ; then
7689 dflt="$dldir/dl_dld.xs"
7694 *) dflt="$dldir/$dlsrc"
7697 echo "The following dynamic loading files are available:"
7698 : Can not go over to $dldir because getfile has path hard-coded in.
7699 tdir=`pwd`; cd "$rsrc"; $ls -C $dldir/dl*.xs; cd "$tdir"
7700 rp="Source file to use for dynamic loading"
7706 dlsrc=`echo $ans | $sed -e 's%.*/\([^/]*\)$%\1%'`
7710 Some systems may require passing special flags to $cc -c to
7711 compile modules that will be used to create a shared library.
7712 To use no flags, say "none".
7715 case "$cccdlflags" in
7716 '') case "$gccversion" in
7717 '') case "$osname" in
7719 next) dflt='none' ;;
7720 irix*) dflt='-KPIC' ;;
7721 svr4*|esix*|solaris|nonstopux) dflt='-KPIC' ;;
7722 sunos) dflt='-pic' ;;
7726 *) case "$osname" in
7727 darwin) dflt='none' ;;
7728 svr4*|esix*|solaris|nonstopux) dflt='-fPIC' ;;
7733 *) dflt="$cccdlflags" ;;
7735 rp="Any special flags to pass to $cc -c to compile shared library modules?"
7738 none) cccdlflags=' ' ;;
7739 *) cccdlflags="$ans" ;;
7744 Some systems use ld to create libraries that can be dynamically loaded,
7745 while other systems (such as those using ELF) use $cc.
7749 '') $cat >try.c <<EOM
7750 /* Test for whether ELF binaries are produced */
7762 int i = open("a.out",O_RDONLY);
7765 if(read(i,b,4)==4 && b[0]==127 && b[1]=='E' && b[2]=='L' && b[3]=='F')
7766 exit(0); /* succeed (yes, it's ELF) */
7771 if $cc $ccflags $ldflags try.c >/dev/null 2>&1 && $run ./a.out; then
7773 You appear to have ELF support. I'll use $cc to build dynamic libraries.
7777 echo "I'll use ld to build dynamic libraries."
7786 rp="What command should be used to create dynamic libraries?"
7792 Some systems may require passing special flags to $ld to create a
7793 library that can be dynamically loaded. If your ld flags include
7794 -L/other/path options to locate libraries outside your loader's normal
7795 search path, you may need to specify those -L options here as well. To
7796 use no flags, say "none".
7799 case "$lddlflags" in
7800 '') case "$osname" in
7801 beos) dflt='-nostart' ;;
7803 case "$gccversion" in
7804 '') dflt="$dflt +vnocompatwarnings" ;;
7807 linux|irix*|gnu*) dflt='-shared' ;;
7808 next) dflt='none' ;;
7809 solaris) dflt='-G' ;;
7810 sunos) dflt='-assert nodefinitions' ;;
7811 svr4*|esix*|nonstopux) dflt="-G $ldflags" ;;
7815 *) dflt="$lddlflags" ;;
7818 : Try to guess additional flags to pick up local libraries.
7819 : Be careful not to append to a plain 'none'
7823 for thisflag in $ldflags; do
7828 *) dflt="$dflt $thisflag" ;;
7835 ''|' ') dflt='none' ;;
7838 rp="Any special flags to pass to $ld to create a dynamically loaded library?"
7841 none) lddlflags=' ' ;;
7842 *) lddlflags="$ans" ;;
7847 Some systems may require passing special flags to $cc to indicate that
7848 the resulting executable will use dynamic linking. To use no flags,
7852 case "$ccdlflags" in
7853 '') case "$osname" in
7854 linux|hpux|gnu*) dflt='-Wl,-E' ;;
7855 next|sunos) dflt='none' ;;
7859 *) dflt="$ccdlflags" ;;
7861 rp="Any special flags to pass to $cc to use dynamic linking?"
7864 none) ccdlflags=' ' ;;
7865 *) ccdlflags="$ans" ;;
7879 # No dynamic loading being used, so don't bother even to prompt.
7882 *) case "$useshrplib" in
7883 '') case "$osname" in
7884 svr4*|nonstopux|dgux|dynixptx|esix|powerux|beos|cygwin*)
7886 also='Building a shared libperl is required for dynamic loading to work on your system.'
7891 also='Building a shared libperl is needed for MAB support.'
7909 The perl executable is normally obtained by linking perlmain.c with
7910 libperl${_a}, any static extensions (usually just DynaLoader), and
7911 any other libraries needed on this system (such as -lm, etc.). Since
7912 your system supports dynamic loading, it is probably possible to build
7913 a shared libperl.$so. If you will have more than one executable linked
7914 to libperl.$so, this will significantly reduce the size of each
7915 executable, but it may have a noticeable effect on performance. The
7916 default is probably sensible for your system.
7920 rp="Build a shared libperl.$so (y/n)"
7924 useshrplib='true' ;;
7925 *) useshrplib='false' ;;
7930 case "$useshrplib" in
7934 # Figure out a good name for libperl.so. Since it gets stored in
7935 # a version-specific architecture-dependent library, the version
7936 # number isn't really that important, except for making cc/ld happy.
7938 # A name such as libperl.so.3.1
7939 majmin="libperl.$so.$patchlevel.$subversion"
7940 # A name such as libperl.so.301
7941 majonly=`echo $patchlevel $subversion |
7942 $awk '{printf "%d%02d", $1, $2}'`
7943 majonly=libperl.$so.$majonly
7944 # I'd prefer to keep the os-specific stuff here to a minimum, and
7945 # rely on figuring it out from the naming of libc.
7946 case "${osname}${osvers}" in
7949 # XXX How handle the --version stuff for MAB?
7951 linux*|gnu*) # ld won't link with a bare -lperl otherwise.
7954 cygwin*) # ld links against an importlib
7955 dflt=libperl$lib_ext
7957 *) # Try to guess based on whether libc has major.minor.
7959 *libc.$so.[0-9]*.[0-9]*) dflt=$majmin ;;
7960 *libc.$so.[0-9]*) dflt=$majonly ;;
7961 *) dflt=libperl.$so ;;
7971 I need to select a good name for the shared libperl. If your system uses
7972 library names with major and minor numbers, then you might want something
7973 like $majmin. Alternatively, if your system uses a single version
7974 number for shared libraries, then you might want to use $majonly.
7975 Or, your system might be quite happy with a simple libperl.$so.
7977 Since the shared libperl will get installed into a version-specific
7978 architecture-dependent directory, the version number of the shared perl
7979 library probably isn't important, so the default should be o.k.
7982 rp='What name do you want to give to the shared libperl?'
7985 echo "Ok, I'll use $libperl"
7988 libperl="libperl${_a}"
7992 # Detect old use of shrpdir via undocumented Configure -Dshrpdir
7996 WARNING: Use of the shrpdir variable for the installation location of
7997 the shared $libperl is not supported. It was never documented and
7998 will not work in this version. Let me (perlbug@perl.org)
7999 know of any problems this may cause.
8005 But your current setting of $shrpdir is
8006 the default anyway, so it's harmless.
8011 Further, your current attempted setting of $shrpdir
8012 conflicts with the value of $archlibexp/CORE
8013 that installperl will use.
8020 # How will the perl executable find the installed shared $libperl?
8021 # Add $xxx to ccdlflags.
8022 # If we can't figure out a command-line option, use $shrpenv to
8023 # set env LD_RUN_PATH. The main perl makefile uses this.
8024 shrpdir=$archlibexp/CORE
8027 if "$useshrplib"; then
8030 # We'll set it in Makefile.SH...
8035 freebsd|netbsd|openbsd|interix|dragonfly)
8036 xxx="-Wl,-R$shrpdir"
8038 bsdos|linux|irix*|dec_osf|gnu*)
8039 xxx="-Wl,-rpath,$shrpdir"
8042 # next doesn't like the default...
8045 # beos doesn't like the default, either.
8048 # hpux doesn't like the default, either.
8049 tmp_shrpenv="env LDOPTS=\"+s +b${shrpdir}\""
8052 tmp_shrpenv="env LD_RUN_PATH=$shrpdir"
8058 # Only add $xxx if it isn't already in ccdlflags.
8059 case " $ccdlflags " in
8061 *) ccdlflags="$ccdlflags $xxx"
8064 Adding $xxx to the flags
8065 passed to $ld so that the perl executable will find the
8066 installed shared $libperl.
8074 # Fix ccdlflags in AIX for building external extensions.
8075 # (For building Perl itself bare -bE:perl.exp is needed,
8076 # Makefile.SH takes care of this.)
8078 aix) ccdlflags="$ccdlflags -bE:$installarchlib/CORE/perl.exp" ;;
8080 # Respect a hint or command-line value.
8082 '') shrpenv="$tmp_shrpenv" ;;
8084 case "$ldlibpthname" in
8085 '') ldlibpthname=LD_LIBRARY_PATH ;;
8086 none) ldlibpthname='' ;;
8089 : determine where manual pages are on this system
8093 syspath='/usr/share/man/man1 /usr/man/man1'
8094 syspath="$syspath /usr/man/mann /usr/man/manl /usr/man/local/man1"
8095 syspath="$syspath /usr/man/u_man/man1"
8096 syspath="$syspath /usr/catman/u_man/man1 /usr/man/l_man/man1"
8097 syspath="$syspath /usr/local/man/u_man/man1 /usr/local/man/l_man/man1"
8098 syspath="$syspath /usr/man/man.L /local/man/man1 /usr/local/man/man1"
8099 sysman=`./loc . /usr/man/man1 $syspath`
8102 if $test -d "$sysman"; then
8103 echo "System manual is in $sysman." >&4
8105 echo "Could not find manual pages in source form." >&4
8108 : determine where manual pages go
8109 set man1dir man1dir none
8113 $spackage has manual pages available in source form.
8117 echo "However, you don't have nroff, so they're probably useless to you."
8119 '') man1dir="none";;
8122 echo "If you don't want the manual sources installed, answer 'none'."
8127 lookpath="$prefixexp/share/man/man1"
8128 lookpath="$lookpath $prefixexp/man/man1 $prefixexp/man/l_man/man1"
8129 lookpath="$lookpath $prefixexp/man/p_man/man1"
8130 lookpath="$lookpath $prefixexp/man/u_man/man1"
8131 lookpath="$lookpath $prefixexp/man/man.1"
8133 */?_man*) dflt=`./loc . $prefixexp/l_man/man1 $lookpath` ;;
8134 *) dflt=`./loc . $prefixexp/man/man1 $lookpath` ;;
8144 rp="Where do the main $spackage manual pages (source) go?"
8146 if $test "X$man1direxp" != "X$ansexp"; then
8157 : What suffix to use on installed man pages
8164 rp="What suffix should be used for the main $spackage man pages?"
8166 '') case "$man1dir" in
8180 *) dflt="$man1ext";;
8187 : see if we can have long filenames
8189 first=123456789abcdef
8191 if (echo hi >$first) 2>/dev/null; then
8192 if $test -f 123456789abcde; then
8193 echo 'You cannot have filenames longer than 14 characters. Sigh.' >&4
8196 echo 'You can have filenames longer than 14 characters.'>&4
8201 You can't have filenames longer than 14 chars.
8202 You can't even think about them!
8208 $rm -rf 123456789abcde*
8210 : determine where library module manual pages go
8211 set man3dir man3dir none
8215 $spackage has manual pages for many of the library modules.
8221 However, you don't have nroff, so they're probably useless to you.
8224 '') man3dir="none";;
8228 case "$d_flexfnam" in
8231 However, your system can't handle the long file names like File::Basename.3.
8234 '') man3dir="none";;
8238 echo "If you don't want the manual sources installed, answer 'none'."
8239 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
8241 '') dflt=`echo "$man1dir" | $sed -e 's/man1/man3/g' -e 's/man\.1/man\.3/g'`
8242 if $test -d "$privlib/man/man3"; then
8245 WARNING: Previous versions of perl installed man3 pages into
8246 $privlib/man/man3. This version will suggest a
8247 new default of $dflt.
8251 rp='Do you wish to preserve the old behavior?(y/n)'
8254 y*) dflt="$privlib/man/man3" ;;
8259 *) dflt="$man3dir" ;;
8266 rp="Where do the $package library man pages (source) go?"
8276 : What suffix to use on installed man pages
8282 rp="What suffix should be used for the $package library man pages?"
8284 '') case "$man3dir" in
8298 *) dflt="$man3ext";;
8305 : see if we have to deal with yellow pages, now NIS.
8306 if $test -d /usr/etc/yp || $test -d /etc/yp || $test -d /usr/lib/yp; then
8307 if $test -f /usr/etc/nibindd; then
8309 echo "I'm fairly confident you're on a NeXT."
8311 rp='Do you get the hosts file via NetInfo?'
8320 y*) hostcat='nidump hosts .';;
8321 *) case "$hostcat" in
8322 nidump*) hostcat='';;
8332 '') if $contains '^\+' /etc/passwd >/dev/null 2>&1; then
8340 rp='Are you getting the hosts file via yellow pages?'
8343 y*) hostcat='ypcat hosts';;
8344 *) hostcat='cat /etc/hosts';;
8350 '') test -f /etc/hosts && hostcat='cat /etc/hosts';;
8353 '') test -f /etc/group && groupcat='cat /etc/group';;
8356 '') test -f /etc/passwd && passcat='cat /etc/passwd';;
8359 : now get the host name
8361 echo "Figuring out host name..." >&4
8362 case "$myhostname" in
8364 echo 'Maybe "hostname" will work...'
8365 if tans=`sh -c hostname 2>&1` ; then
8373 if $test "$cont"; then
8375 echo 'Oh, dear. Maybe "/etc/systemid" is the key...'
8376 if tans=`cat /etc/systemid 2>&1` ; then
8378 phostname='cat /etc/systemid'
8379 echo "Whadyaknow. Xenix always was a bit strange..."
8382 elif $test -r /etc/systemid; then
8383 echo "(What is a non-Xenix system doing with /etc/systemid?)"
8386 if $test "$cont"; then
8387 echo 'No, maybe "uuname -l" will work...'
8388 if tans=`sh -c 'uuname -l' 2>&1` ; then
8390 phostname='uuname -l'
8392 echo 'Strange. Maybe "uname -n" will work...'
8393 if tans=`sh -c 'uname -n' 2>&1` ; then
8395 phostname='uname -n'
8397 echo 'Oh well, maybe I can mine it out of whoami.h...'
8398 if tans=`sh -c $contains' sysname $usrinc/whoami.h' 2>&1` ; then
8399 myhostname=`echo "$tans" | $sed 's/^.*"\(.*\)"/\1/'`
8400 phostname="sed -n -e '"'/sysname/s/^.*\"\\(.*\\)\"/\1/{'"' -e p -e q -e '}' <$usrinc/whoami.h"
8402 case "$myhostname" in
8403 '') echo "Does this machine have an identity crisis or something?"
8406 echo "Well, you said $myhostname before..."
8407 phostname='echo $myhostname';;
8413 case "$myhostname" in
8414 '') myhostname=noname ;;
8416 : you do not want to know about this
8421 if $test "$myhostname" ; then
8423 rp='Your host name appears to be "'$myhostname'".'" Right?"
8431 : bad guess or no guess
8432 while $test "X$myhostname" = X ; do
8434 rp="Please type the (one word) name of your host:"
8439 : translate upper to lower if necessary
8440 case "$myhostname" in
8442 echo "(Normalizing case in your host name)"
8443 myhostname=`echo $myhostname | ./tr '[A-Z]' '[a-z]'`
8447 case "$myhostname" in
8449 dflt=`expr "X$myhostname" : "X[^.]*\(\..*\)"`
8450 myhostname=`expr "X$myhostname" : "X\([^.]*\)\."`
8451 echo "(Trimming domain name from host name--host name is now $myhostname)"
8453 *) case "$mydomain" in
8456 test "X$hostcat" = "Xypcat hosts" &&
8457 ypmatch "$myhostname" hosts 2>/dev/null |\
8458 $sed -e 's/[ ]*#.*//; s/$/ /' > hosts && \
8461 test "X$hostcat" != "X" &&
8462 $hostcat | $sed -n -e "s/[ ]*#.*//; s/\$/ /
8463 /[ ]$myhostname[ . ]/p" > hosts
8466 if $test -f hosts; then
8467 $test x`$awk "/[0-9].*[ ]$myhostname$tmp_re/ { sum++ }
8468 END { print sum }" hosts` = x1 || tmp_re="[ ]"
8469 dflt=.`$awk "/[0-9].*[ ]$myhostname$tmp_re/ {for(i=2; i<=NF;i++) print \\\$i}" \
8470 hosts | $sort | $uniq | \
8471 $sed -n -e "s/$myhostname\.\([-a-zA-Z0-9_.]\)/\1/p"`
8472 case `$echo X$dflt` in
8473 X*\ *) echo "(Several hosts in the database matched hostname)"
8476 X.) echo "(You do not have fully-qualified names in the hosts database)"
8480 echo "(I cannot locate a hosts database anywhere)"
8485 tans=`./loc resolv.conf X /etc /usr/etc`
8486 if $test -f "$tans"; then
8487 echo "(Attempting domain name extraction from $tans)"
8488 dflt=.`$sed -n -e 's/ / /g' \
8489 -e 's/^search *\([^ ]*\).*/\1/p' $tans \
8490 | ./tr '[A-Z]' '[a-z]' 2>/dev/null`
8492 .) dflt=.`$sed -n -e 's/ / /g' \
8493 -e 's/^domain *\([^ ]*\).*/\1/p' $tans \
8494 | ./tr '[A-Z]' '[a-z]' 2>/dev/null`
8501 .) echo "(No help from resolv.conf either -- attempting clever guess)"
8502 dflt=.`sh -c domainname 2>/dev/null`
8505 .nis.*|.yp.*|.main.*) dflt=`echo $dflt | $sed -e 's/^\.[^.]*//'`;;
8509 case "$dflt$osname" in
8510 .os390) echo "(Attempting domain name extraction from //'SYS1.TCPPARMS(TCPDATA)')"
8511 dflt=.`awk '/^DOMAINORIGIN/ {print $2}' "//'SYS1.TCPPARMS(TCPDATA)'" 2>/dev/null`
8515 .) echo "(Lost all hope -- silly guess then)"
8521 *) dflt="$mydomain";;
8525 rp="What is your domain name?"
8535 : translate upper to lower if necessary
8538 echo "(Normalizing case in your domain name)"
8539 mydomain=`echo $mydomain | ./tr '[A-Z]' '[a-z]'`
8543 : a little sanity check here
8544 case "$phostname" in
8547 case `$phostname | ./tr '[A-Z]' '[a-z]'` in
8548 $myhostname$mydomain|$myhostname) ;;
8550 case "$phostname" in
8552 echo "(That doesn't agree with your whoami.h file, by the way.)"
8555 echo "(That doesn't agree with your $phostname command, by the way.)"
8565 I need to get your e-mail address in Internet format if possible, i.e.
8566 something like user@host.domain. Please answer accurately since I have
8567 no easy means to double check it. The default value provided below
8568 is most probably close to reality but may not be valid from outside
8569 your organization...
8573 while test "$cont"; do
8575 '') dflt="$cf_by@$myhostname$mydomain";;
8576 *) dflt="$cf_email";;
8578 rp='What is your e-mail address?'
8584 rp='Address does not look like an Internet one. Use it anyway?'
8600 If you or somebody else will be maintaining perl at your site, please
8601 fill in the correct e-mail address here so that they may be contacted
8602 if necessary. Currently, the "perlbug" program included with perl
8603 will send mail to this address in addition to perlbug@perl.org. You may
8604 enter "none" for no administrator.
8607 case "$perladmin" in
8608 '') dflt="$cf_email";;
8609 *) dflt="$perladmin";;
8611 rp='Perl administrator e-mail address'
8615 : determine whether to only install version-specific parts.
8618 Do you want to install only the version-specific parts of the perl
8619 distribution? Usually you do *not* want to do this.
8621 case "$versiononly" in
8622 "$define"|[Yy]*|true) dflt='y' ;;
8625 rp="Do you want to install only the version-specific parts of perl?"
8628 [yY]*) val="$define";;
8634 case "$versiononly" in
8635 "$define") inc_version_list=''
8636 inc_version_list_init=0
8640 : figure out how to guarantee perl startup
8641 : XXX Note that this currently takes advantage of the bug that binexp ignores
8642 : the Configure -Dinstallprefix setting, which in turn means that under
8643 : relocatable @INC, initialinstalllocation is what binexp started as.
8644 case "$startperl" in
8646 case "$sharpbang" in
8650 I can use the #! construct to start perl on your system. This will
8651 make startup of perl scripts faster, but may cause problems if you
8652 want to share those scripts and perl is not in a standard place
8653 ($initialinstalllocation/perl) on all your platforms. The alternative
8654 is to force a shell by starting the script with a single ':' character.
8657 case "$versiononly" in
8658 "$define") dflt="$initialinstalllocation/perl$version";;
8659 *) dflt="$initialinstalllocation/perl";;
8661 rp='What shall I put after the #! to start up perl ("none" to not use #!)?'
8664 none) startperl=": # use perl";;
8665 *) startperl="#!$ans"
8666 if $test 30 -lt `echo "$ans" | wc -c`; then
8669 WARNING: Some systems limit the #! command to 32 characters.
8670 If you experience difficulty running Perl scripts with #!, try
8671 installing Perl in a directory with a shorter pathname.
8677 *) startperl=": # use perl"
8682 echo "I'll use $startperl to start perl scripts."
8684 : figure best path for perl in scripts
8687 case "$versiononly" in
8688 "$define") perlpath="$initialinstalllocation/perl$version";;
8689 *) perlpath="$initialinstalllocation/perl";;
8691 case "$startperl" in
8696 I will use the "eval 'exec'" idiom to start Perl on your system.
8697 I can use the full path of your Perl binary for this purpose, but
8698 doing so may cause problems if you want to share those scripts and
8699 Perl is not always in a standard place ($initialinstalllocation/perl).
8702 dflt="$initialinstalllocation/perl"
8703 rp="What path shall I use in \"eval 'exec'\"?"
8710 case "$startperl" in
8712 *) echo "I'll use $perlpath in \"eval 'exec'\"" ;;
8715 : determine where public executable scripts go
8716 set scriptdir scriptdir
8718 case "$scriptdir" in
8721 : guess some guesses
8722 $test -d /usr/share/scripts && dflt=/usr/share/scripts
8723 $test -d /usr/share/bin && dflt=/usr/share/bin
8724 $test -d /usr/local/script && dflt=/usr/local/script
8725 $test -d /usr/local/scripts && dflt=/usr/local/scripts
8726 $test -d $prefixexp/script && dflt=$prefixexp/script
8730 *) dflt="$scriptdir"
8735 Some installations have a separate directory just for executable scripts so
8736 that they can mount it across multiple architectures but keep the scripts in
8737 one spot. You might, for example, have a subdirectory of /usr/share for this.
8738 Or you might just lump your scripts in with all your other executables.
8742 rp='Where do you keep publicly executable scripts?'
8744 if $test "X$ansexp" != "X$scriptdirexp"; then
8750 : A little fix up for an irregularly named variable.
8751 installscript="$installscriptdir"
8753 : determine where add-on public executables go
8755 '') dflt=$siteprefix/bin ;;
8759 rp='Pathname where the add-on public executables should be installed?'
8764 : determine where add-on html pages go
8765 : There is no standard location, so try to copy the previously-selected
8766 : directory structure for the core html pages.
8767 case "$sitehtml1dir" in
8768 '') dflt=`echo "$html1dir" | $sed "s#^$prefix#$siteprefix#"` ;;
8769 *) dflt=$sitehtml1dir ;;
8772 ''|' ') dflt=none ;;
8775 rp='Pathname where the site-specific html pages should be installed?'
8777 prefixvar=sitehtml1dir
8780 : determine where add-on library html pages go
8781 : There is no standard location, so try to copy the previously-selected
8782 : directory structure for the core html pages.
8783 case "$sitehtml3dir" in
8784 '') dflt=`echo "$html3dir" | $sed "s#^$prefix#$siteprefix#"` ;;
8785 *) dflt=$sitehtml3dir ;;
8788 ''|' ') dflt=none ;;
8791 rp='Pathname where the site-specific library html pages should be installed?'
8793 prefixvar=sitehtml3dir
8796 : determine where add-on manual pages go
8797 case "$siteman1dir" in
8798 '') dflt=`echo $man1dir | $sed "s#^$prefix#$siteprefix#"` ;;
8799 *) dflt=$siteman1dir ;;
8802 ''|' ') dflt=none ;;
8805 rp='Pathname where the site-specific manual pages should be installed?'
8807 prefixvar=siteman1dir
8810 : determine where add-on library man pages go
8811 case "$siteman3dir" in
8812 '') dflt=`echo $man3dir | $sed "s#^$prefix#$siteprefix#"` ;;
8813 *) dflt=$siteman3dir ;;
8816 ''|' ') dflt=none ;;
8819 rp='Pathname where the site-specific library manual pages should be installed?'
8821 prefixvar=siteman3dir
8824 : determine where add-on public executable scripts go
8825 case "$sitescript" in
8826 '') dflt=$siteprefix/script
8827 $test -d $dflt || dflt=$sitebin ;;
8828 *) dflt="$sitescript" ;;
8831 rp='Pathname where add-on public executable scripts should be installed?'
8833 prefixvar=sitescript
8836 case "$usefaststdio" in
8837 $define|true|[yY]*|'')
8838 xversion=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
8848 Perl can be built to use 'fast stdio', which means using the stdio
8849 library but also directly manipulating the stdio buffers to enable
8850 faster I/O. Using stdio is better for backward compatibility (especially
8851 for Perl extensions), but on the other hand since Perl 5.8 the 'perlio'
8852 interface has been preferred instead of stdio.
8854 If this doesn't make any sense to you, just accept the default '$dflt'.
8856 rp='Use the "fast stdio" if available?'
8859 y|Y) val="$define" ;;
8866 : define an is-a-typedef? function
8867 typedef='type=$1; var=$2; def=$3; shift; shift; shift; inclist=$@;
8869 "") inclist="sys/types.h";;
8871 eval "varval=\$$var";
8875 for inc in $inclist; do
8876 echo "#include <$inc>" >>temp.c;
8878 echo "#ifdef $type" >> temp.c;
8879 echo "printf(\"We have $type\");" >> temp.c;
8880 echo "#endif" >> temp.c;
8881 $cppstdin $cppflags $cppminus < temp.c >temp.E 2>/dev/null;
8882 if $contains $type temp.E >/dev/null 2>&1; then
8888 *) eval "$var=\$varval";;
8891 : define an is-a-typedef? function that prompts if the type is not available.
8892 typedef_ask='type=$1; var=$2; def=$3; shift; shift; shift; inclist=$@;
8894 "") inclist="sys/types.h";;
8896 eval "varval=\$$var";
8900 for inc in $inclist; do
8901 echo "#include <$inc>" >>temp.c;
8903 echo "#ifdef $type" >> temp.c;
8904 echo "printf(\"We have $type\");" >> temp.c;
8905 echo "#endif" >> temp.c;
8906 $cppstdin $cppflags $cppminus < temp.c >temp.E 2>/dev/null;
8908 echo "$rp" | $sed -e "s/What is/Looking for/" -e "s/?/./";
8909 if $contains $type temp.E >/dev/null 2>&1; then
8910 echo "$type found." >&4;
8913 echo "$type NOT found." >&4;
8919 *) eval "$var=\$varval";;
8922 : see what type lseek is declared as in the kernel
8923 rp="What is the type used for lseek's offset on this system?"
8924 set off_t lseektype long stdio.h sys/types.h
8928 echo "Checking to see how big your file offsets are..." >&4
8930 #include <sys/types.h>
8934 printf("%d\n", (int)sizeof($lseektype));
8939 if eval $compile_ok; then
8940 lseeksize=`$run ./try`
8941 echo "Your file offsets are $lseeksize bytes long."
8945 echo "(I can't seem to compile the test program. Guessing...)"
8946 rp="What is the size of your file offsets (in bytes)?"
8952 : see what type file positions are declared as in the library
8953 rp="What is the type for file position used by fsetpos()?"
8954 set fpos_t fpostype long stdio.h sys/types.h
8959 *_t) zzz="$fpostype" ;;
8962 echo "Checking the size of $zzz..." >&4
8964 #include <sys/types.h>
8971 printf("%d\n", (int)sizeof($fpostype));
8976 if eval $compile_ok; then
8980 echo "(I can't execute the test program--guessing $fpossize.)" >&4
8983 echo "Your $zzz is $fpossize bytes long."
8989 echo "(I can't compile the test program. Guessing...)" >&4
8990 rp="What is the size of your file positions (in bytes)?"
8995 # Backward compatibility (uselfs is deprecated).
8997 "$define"|true|[yY]*)
9000 *** Configure -Duselfs is deprecated, using -Duselargefiles instead.
9002 uselargefiles="$define"
9006 case "$lseeksize:$fpossize" in
9009 You can have files larger than 2 gigabytes.
9012 *) case "$uselargefiles" in
9013 "$undef"|false|[nN]*) dflt='n' ;;
9018 Perl can be built to understand large files (files larger than 2 gigabytes)
9019 on some systems. To do so, Configure can be run with -Duselargefiles.
9021 If this doesn't make any sense to you, just accept the default '$dflt'.
9023 rp='Try to understand large files, if available?'
9026 y|Y) val="$define" ;;
9033 : Look for a hint-file generated 'call-back-unit'. If the
9034 : user has specified that a large files perl is to be built,
9035 : we may need to set or change some other defaults.
9036 if $test -f uselargefiles.cbu; then
9037 echo "Your platform has some specific hints regarding large file builds, using them..."
9038 . ./uselargefiles.cbu
9040 case "$uselargefiles" in
9042 if $test -f uselargefiles.cbu; then
9044 echo "Rechecking to see how big your file offsets are..." >&4
9046 #include <sys/types.h>
9050 printf("%d\n", (int)sizeof($lseektype));
9055 if eval $compile_ok; then
9056 lseeksize=`$run ./try`
9057 $echo "Your file offsets are now $lseeksize bytes long."
9061 echo "(I can't seem to compile the test program. Guessing...)"
9062 rp="What is the size of your file offsets (in bytes)?"
9067 *_t) zzz="$fpostype" ;;
9070 $echo $n "Rechecking the size of $zzz...$c" >&4
9072 #include <sys/types.h>
9079 printf("%d\n", (int)sizeof($fpostype));
9084 if eval $compile_ok; then
9089 echo "(I can't execute the test program--guessing $fpossize.)" >&4
9092 echo " $fpossize bytes." >&4
9098 echo "(I can't compile the test program. Guessing...)" >&4
9099 rp="What is the size of your file positions (in bytes)?"
9108 case "$vendorprefix" in
9109 '') d_vendorbin="$undef"
9113 *) d_vendorbin="$define"
9114 : determine where vendor-supplied executables go.
9115 case "$vendorbin" in
9116 '') dflt=$vendorprefix/bin ;;
9117 *) dflt="$vendorbin" ;;
9120 rp='Pathname for the vendor-supplied executables directory?'
9123 vendorbinexp="$ansexp"
9129 case "$vendorprefix" in
9130 '') vendorhtml1dir=''
9131 vendorhtml1direxp=''
9133 *) : determine where vendor-supplied html pages go.
9134 : There is no standard location, so try to copy the previously-selected
9135 : directory structure for the core html pages.
9136 : XXX Better default suggestions would be welcome.
9137 case "$vendorhtml1dir" in
9138 '') dflt=`echo "$html1dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
9139 *) dflt=$vendorhtml1dir ;;
9142 ''|' ') dflt=none ;;
9145 rp='Pathname for the vendor-supplied html pages?'
9147 vendorhtml1dir="$ans"
9148 vendorhtml1direxp="$ansexp"
9151 : Use ' ' for none so value is preserved next time through Configure
9152 $test X"$vendorhtml1dir" = "X" && vendorhtml1dir=' '
9153 prefixvar=vendorhtml1dir
9156 case "$vendorprefix" in
9157 '') vendorhtml3dir=''
9158 vendorhtml3direxp=''
9160 *) : determine where vendor-supplied module html pages go.
9161 : There is no standard location, so try to copy the previously-selected
9162 : directory structure for the core html pages.
9163 : XXX Better default suggestions would be welcome.
9164 case "$vendorhtml3dir" in
9165 '') dflt=`echo "$html3dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
9166 *) dflt=$vendorhtml3dir ;;
9169 ''|' ') dflt=none ;;
9172 rp='Pathname for the vendor-supplied html pages?'
9174 vendorhtml3dir="$ans"
9175 vendorhtml3direxp="$ansexp"
9178 : Use ' ' for none so value is preserved next time through Configure
9179 $test X"$vendorhtml3dir" = "X" && vendorhtml3dir=' '
9180 prefixvar=vendorhtml3dir
9183 case "$vendorprefix" in
9184 '') vendorman1dir=''
9187 *) : determine where vendor-supplied manual pages go.
9188 case "$vendorman1dir" in
9189 '') dflt=`echo "$man1dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
9190 *) dflt=$vendorman1dir ;;
9193 ''|' ') dflt=none ;;
9196 rp='Pathname for the vendor-supplied manual section 1 pages?'
9198 vendorman1dir="$ans"
9199 vendorman1direxp="$ansexp"
9202 : Use ' ' for none so value is preserved next time through Configure
9203 $test X"$vendorman1dir" = "X" && vendorman1dir=' '
9204 prefixvar=vendorman1dir
9207 case "$vendorprefix" in
9208 '') vendorman3dir=''
9211 *) : determine where vendor-supplied module manual pages go.
9212 case "$vendorman3dir" in
9213 '') dflt=`echo "$man3dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
9214 *) dflt=$vendorman3dir ;;
9217 ''|' ') dflt=none ;;
9220 rp='Pathname for the vendor-supplied manual section 3 pages?'
9222 vendorman3dir="$ans"
9223 vendorman3direxp="$ansexp"
9226 : Use ' ' for none so value is preserved next time through Configure
9227 $test X"$vendorman3dir" = "X" && vendorman3dir=' '
9228 prefixvar=vendorman3dir
9231 case "$vendorprefix" in
9232 '') d_vendorscript="$undef"
9236 *) d_vendorscript="$define"
9237 : determine where vendor-supplied scripts go.
9238 case "$vendorscript" in
9239 '') dflt=$vendorprefix/script
9240 $test -d $dflt || dflt=$vendorbin ;;
9241 *) dflt="$vendorscript" ;;
9245 The installation process will create a directory for
9246 vendor-supplied scripts.
9250 rp='Pathname for the vendor-supplied scripts directory?'
9253 vendorscriptexp="$ansexp"
9256 prefixvar=vendorscript
9259 : see if qgcvt exists
9265 if $test X"$d_longdbl" = X"$define"; then
9267 echo "Checking how to print long doubles..." >&4
9269 if $test X"$sPRIfldbl" = X -a X"$doublesize" = X"$longdblsize"; then
9270 $cat >try.c <<'EOCP'
9271 #include <sys/types.h>
9275 printf("%.3f\n", d);
9279 if eval $compile; then
9283 sPRIfldbl='"f"'; sPRIgldbl='"g"'; sPRIeldbl='"e"';
9284 sPRIFUldbl='"F"'; sPRIGUldbl='"G"'; sPRIEUldbl='"E"';
9285 echo "We will use %f."
9291 if $test X"$sPRIfldbl" = X; then
9292 $cat >try.c <<'EOCP'
9293 #include <sys/types.h>
9296 long double d = 123.456;
9297 printf("%.3Lf\n", d);
9301 if eval $compile; then
9305 sPRIfldbl='"Lf"'; sPRIgldbl='"Lg"'; sPRIeldbl='"Le"';
9306 sPRIFUldbl='"LF"'; sPRIGUldbl='"LG"'; sPRIEUldbl='"LE"';
9307 echo "We will use %Lf."
9313 if $test X"$sPRIfldbl" = X; then
9314 $cat >try.c <<'EOCP'
9315 #include <sys/types.h>
9318 long double d = 123.456;
9319 printf("%.3llf\n", d);
9323 if eval $compile; then
9327 sPRIfldbl='"llf"'; sPRIgldbl='"llg"'; sPRIeldbl='"lle"';
9328 sPRIFUldbl='"llF"'; sPRIGUldbl='"llG"'; sPRIEUldbl='"llE"';
9329 echo "We will use %llf."
9335 if $test X"$sPRIfldbl" = X; then
9336 $cat >try.c <<'EOCP'
9337 #include <sys/types.h>
9340 long double d = 123.456;
9341 printf("%.3lf\n", d);
9345 if eval $compile; then
9349 sPRIfldbl='"lf"'; sPRIgldbl='"lg"'; sPRIeldbl='"le"';
9350 sPRIFUldbl='"lF"'; sPRIGUldbl='"lG"'; sPRIEUldbl='"lE"';
9351 echo "We will use %lf."
9357 if $test X"$sPRIfldbl" = X; then
9358 echo "Cannot figure out how to print long doubles." >&4
9360 sSCNfldbl=$sPRIfldbl # expect consistency
9367 case "$sPRIfldbl" in
9368 '') d_PRIfldbl="$undef"; d_PRIgldbl="$undef"; d_PRIeldbl="$undef";
9369 d_PRIFUldbl="$undef"; d_PRIGUldbl="$undef"; d_PRIEUldbl="$undef";
9370 d_SCNfldbl="$undef";
9372 *) d_PRIfldbl="$define"; d_PRIgldbl="$define"; d_PRIeldbl="$define";
9373 d_PRIFUldbl="$define"; d_PRIGUldbl="$define"; d_PRIEUldbl="$define";
9374 d_SCNfldbl="$define";
9378 : Check how to convert floats to strings.
9380 if test "X$d_Gconvert" = X; then
9383 echo "Checking for an efficient way to convert floats to strings."
9385 case "$uselongdouble" in
9386 "$define") echo "#define USE_LONG_DOUBLE" >>try.c ;;
9388 case "$d_longdbl" in
9389 "$define") echo "#define HAS_LONG_DOUBLE" >>try.c ;;
9391 case "$d_PRIgldbl" in
9392 "$define") echo "#define HAS_PRIgldbl" >>try.c ;;
9396 #define Gconvert(x,n,t,b) gconvert((x),(n),(t),(b))
9397 char *myname = "gconvert";
9400 #define Gconvert(x,n,t,b) gcvt((x),(n),(b))
9401 char *myname = "gcvt";
9404 #define Gconvert(x,n,t,b) qgcvt((x),(n),(b))
9405 char *myname = "qgcvt";
9406 #define DOUBLETYPE long double
9409 #if defined(USE_LONG_DOUBLE) && defined(HAS_LONG_DOUBLE)
9411 #define Gconvert(x,n,t,b) sprintf((b),"%.*"$sPRIgldbl,(n),(x))
9413 #define Gconvert(x,n,t,b) sprintf((b),"%.*g",(n),(double)(x))
9416 #define Gconvert(x,n,t,b) sprintf((b),"%.*g",(n),(x))
9418 char *myname = "sprintf";
9422 #if defined(USE_LONG_DOUBLE) && defined(HAS_LONG_DOUBLE)
9423 #define DOUBLETYPE long double
9425 #define DOUBLETYPE double
9431 #define I_STDLIB $i_stdlib
9437 checkit(expect, got)
9441 if (strcmp(expect, got)) {
9442 printf("%s oddity: Expected %s, got %s\n",
9443 myname, expect, got);
9453 /* This must be 1st test on (which?) platform */
9454 /* Alan Burlison <AlanBurlsin@unn.unisys.com> */
9455 Gconvert((DOUBLETYPE)0.1, 8, 0, buf);
9456 checkit("0.1", buf);
9458 Gconvert((DOUBLETYPE)0.01, 8, 0, buf);
9459 checkit("0.01", buf);
9461 Gconvert((DOUBLETYPE)0.001, 8, 0, buf);
9462 checkit("0.001", buf);
9464 Gconvert((DOUBLETYPE)0.0001, 8, 0, buf);
9465 checkit("0.0001", buf);
9467 Gconvert((DOUBLETYPE)0.00009, 8, 0, buf);
9468 if (strlen(buf) > 5)
9469 checkit("9e-005", buf); /* for Microsoft ?? */
9471 checkit("9e-05", buf);
9473 Gconvert((DOUBLETYPE)1.0, 8, 0, buf);
9476 Gconvert((DOUBLETYPE)1.1, 8, 0, buf);
9477 checkit("1.1", buf);
9479 Gconvert((DOUBLETYPE)1.01, 8, 0, buf);
9480 checkit("1.01", buf);
9482 Gconvert((DOUBLETYPE)1.001, 8, 0, buf);
9483 checkit("1.001", buf);
9485 Gconvert((DOUBLETYPE)1.0001, 8, 0, buf);
9486 checkit("1.0001", buf);
9488 Gconvert((DOUBLETYPE)1.00001, 8, 0, buf);
9489 checkit("1.00001", buf);
9491 Gconvert((DOUBLETYPE)1.000001, 8, 0, buf);
9492 checkit("1.000001", buf);
9494 Gconvert((DOUBLETYPE)0.0, 8, 0, buf);
9497 Gconvert((DOUBLETYPE)-1.0, 8, 0, buf);
9500 /* Some Linux gcvt's give 1.e+5 here. */
9501 Gconvert((DOUBLETYPE)100000.0, 8, 0, buf);
9502 checkit("100000", buf);
9504 /* Some Linux gcvt's give -1.e+5 here. */
9505 Gconvert((DOUBLETYPE)-100000.0, 8, 0, buf);
9506 checkit("-100000", buf);
9508 Gconvert((DOUBLETYPE)123.456, 8, 0, buf);
9509 checkit("123.456", buf);
9511 /* Testing of 1e+129 in bigintpm.t must not get extra '.' here. */
9512 Gconvert((DOUBLETYPE)1e34, 8, 0, buf);
9513 /* 34 should be enough to scare even long double
9514 * places into using the e notation. */
9515 if (strlen(buf) > 5)
9516 checkit("1e+034", buf); /* for Microsoft */
9518 checkit("1e+34", buf);
9520 /* For Perl, if you add additional tests here, also add them to
9521 * t/base/num.t for benefit of platforms not using Configure or
9522 * overriding d_Gconvert */
9527 : first add preferred functions to our list
9529 for xxx_convert in $gconvert_preference; do
9530 case $xxx_convert in
9531 gcvt|gconvert|sprintf) xxx_list="$xxx_list $xxx_convert" ;;
9532 *) echo "Discarding unrecognized gconvert_preference $xxx_convert" >&4 ;;
9535 : then add any others
9536 for xxx_convert in gconvert gcvt sprintf; do
9539 *) xxx_list="$xxx_list $xxx_convert" ;;
9543 case "$d_longdbl$uselongdouble" in
9545 : again, add prefered functions to our list first
9547 for xxx_convert in $gconvert_ld_preference; do
9548 case $xxx_convert in
9549 qgcvt|gcvt|gconvert|sprintf) xxx_ld_list="$xxx_ld_list $xxx_convert" ;;
9550 *) echo "Discarding unrecognized gconvert_ld_preference $xxx_convert" ;;
9553 : then add qgcvt, sprintf--then, in xxx_list order, gconvert and gcvt
9554 for xxx_convert in qgcvt sprintf $xxx_list; do
9555 case "$xxx_ld_list" in
9556 $xxx_convert*|*" $xxx_convert"*) ;;
9557 *) xxx_ld_list="$xxx_ld_list $xxx_convert" ;;
9560 : if sprintf cannot do long doubles, move it to the end
9561 if test "$d_PRIgldbl" != "$define"; then
9562 xxx_ld_list="`echo $xxx_ld_list|sed s/sprintf//` sprintf"
9564 : if no qgcvt, remove it
9565 if test "$d_qgcvt" != "$define"; then
9566 xxx_ld_list="`echo $xxx_ld_list|sed s/qgcvt//`"
9569 xxx_list="$xxx_ld_list"
9573 for xxx_convert in $xxx_list; do
9574 echo "Trying $xxx_convert..."
9576 set try -DTRY_$xxx_convert
9577 if eval $compile; then
9578 echo "$xxx_convert() found." >&4
9580 echo "I'll use $xxx_convert to convert floats into a string." >&4
9583 echo "...But $xxx_convert didn't work as I expected."
9587 echo "$xxx_convert NOT found." >&4
9591 if test X$xxx_convert = X; then
9592 echo "*** WHOA THERE!!! ***" >&4
9593 echo "None of ($xxx_list) seemed to work properly. I'll use sprintf." >&4
9597 case "$xxx_convert" in
9598 gconvert) d_Gconvert='gconvert((x),(n),(t),(b))' ;;
9599 gcvt) d_Gconvert='gcvt((x),(n),(b))' ;;
9600 qgcvt) d_Gconvert='qgcvt((x),(n),(b))' ;;
9601 *) case "$uselongdouble$d_longdbl$d_PRIgldbl" in
9602 "$define$define$define")
9603 d_Gconvert="sprintf((b),\"%.*\"$sPRIgldbl,(n),(x))" ;;
9604 "$define$define$undef")
9605 d_Gconvert='sprintf((b),"%.*g",(n),(double)(x))' ;;
9606 *) d_Gconvert='sprintf((b),"%.*g",(n),(x))' ;;
9613 : see if _fwalk exists
9617 : Initialize h_fcntl
9620 : Initialize h_sysfile
9623 : access call always available on UNIX
9627 : locate the flags for 'access()'
9631 $cat >access.c <<EOCP
9632 #include <sys/types.h>
9637 #include <sys/file.h>
9650 : check sys/file.h first, no particular reason here
9651 if $test `./findhdr sys/file.h` && \
9652 $cc -o access $cppflags -DI_SYS_FILE access.c >/dev/null 2>&1 ; then
9654 echo "<sys/file.h> defines the *_OK access constants." >&4
9655 elif $test `./findhdr fcntl.h` && \
9656 $cc -o access $cppflags -DI_FCNTL access.c >/dev/null 2>&1 ; then
9658 echo "<fcntl.h> defines the *_OK access constants." >&4
9659 elif $test `./findhdr unistd.h` && \
9660 $cc -o access $cppflags -DI_UNISTD access.c >/dev/null 2>&1 ; then
9661 echo "<unistd.h> defines the *_OK access constants." >&4
9663 echo "I can't find the four *_OK access constants--I'll use mine." >&4
9669 : see if accessx exists
9670 set accessx d_accessx
9673 : see if aintl exists
9677 : see if alarm exists
9681 : see if POSIX threads are available
9682 set pthread.h i_pthread
9685 : define a fucntion to check prototypes
9686 $cat > protochk <<EOSH
9689 optimize="$optimize"
9691 prototype="$prototype"
9694 usethreads=$usethreads
9695 i_pthread=$i_pthread
9696 pthread_h_first=$pthread_h_first
9699 $cat >> protochk <<'EOSH'
9704 while test $# -ge 2; do
9706 $define) echo "#include <$2>" >> try.c ;;
9707 literal) echo "$2" >> try.c ;;
9709 # Extra magic for the benefit of systems that need pthread.h
9710 # to be included early to correctly detect threadsafe functions.
9711 # Such functions must guarantee themselves, though, that the usethreads
9712 # and i_pthread have been defined, before calling protochk.
9713 if test "$usethreads" = "$define" -a "$i_pthread" = "$define" -a "$pthread_h_first" = "$define" -a "$pthread_h_done" = ""; then
9714 echo "#include <pthread.h>" >> try.c
9719 test "$prototype" = "$define" && echo '#define CAN_PROTOTYPE' >> try.c
9720 cat >> try.c <<'EOCP'
9721 #ifdef CAN_PROTOTYPE
9722 #define _(args) args
9727 echo "$foo" >> try.c
9728 echo 'int no_real_function_has_this_name _((void)) { return 0; }' >> try.c
9729 $cc $optimize $ccflags -c try.c > /dev/null 2>&1
9737 hasproto='varname=$1; func=$2; shift; shift;
9738 while $test $# -ge 2; do
9740 $define) echo "#include <$2>";;
9744 $cppstdin $cppflags $cppminus < try.c > tryout.c 2>/dev/null;
9745 if $contains "$func.*(" tryout.c >/dev/null 2>&1; then
9746 echo "$func() prototype found.";
9749 echo "$func() prototype NOT found.";
9754 $rm -f try.c tryout.c'
9756 : see if sys/types.h has to be included
9757 set sys/types.h i_systypes
9760 : see if sys/select.h has to be included
9761 set sys/select.h i_sysselct
9764 hasfield='varname=$1; struct=$2; field=$3; shift; shift; shift;
9765 while $test $# -ge 2; do
9767 $define) echo "#include <$2>";;
9771 echo "int main () { struct $struct foo; char* bar; bar = (char*)foo.$field; }" >> try.c;
9773 if eval $compile; then
9782 : see if we should include time.h, sys/time.h, or both
9784 if test "X$timeincl" = X; then
9785 echo "Testing to see if we should include <time.h>, <sys/time.h> or both." >&4
9786 $echo $n "I'm now running the test program...$c"
9788 #include <sys/types.h>
9793 #ifdef SYSTIMEKERNEL
9796 #include <sys/time.h>
9799 #include <sys/select.h>
9812 struct timezone tzp;
9814 if (foo.tm_sec == foo.tm_sec)
9817 if (bar.tv_sec == bar.tv_sec)
9824 for s_timezone in '-DS_TIMEZONE' ''; do
9826 for s_timeval in '-DS_TIMEVAL' ''; do
9827 for i_systimek in '' '-DSYSTIMEKERNEL'; do
9828 for i_time in '' '-DI_TIME'; do
9829 for i_systime in '-DI_SYSTIME' ''; do
9832 set try $i_time $i_systime $i_systimek $sysselect $s_timeval $s_timezone
9833 if eval $compile; then
9834 set X $i_time $i_systime $i_systimek $sysselect $s_timeval
9838 $echo $n "Succeeded with $flags$c"
9850 *SYSTIMEKERNEL*) i_systimek="$define"
9851 timeincl=`./findhdr sys/time.h`
9852 echo "We'll include <sys/time.h> with KERNEL defined." >&4;;
9853 *) i_systimek="$undef";;
9856 *I_TIME*) i_time="$define"
9857 timeincl=`./findhdr time.h`" $timeincl"
9858 echo "We'll include <time.h>." >&4;;
9859 *) i_time="$undef";;
9862 *I_SYSTIME*) i_systime="$define"
9863 timeincl=`./findhdr sys/time.h`" $timeincl"
9864 echo "We'll include <sys/time.h>." >&4;;
9865 *) i_systime="$undef";;
9869 : see if struct tm knows about tm_zone
9870 case "$i_systime$i_time" in
9873 echo "Checking to see if your struct tm has tm_zone field..." >&4
9874 set d_tm_tm_zone tm tm_zone $i_systime sys/time.h $i_time time.h
9882 case "$d_tm_tm_zone" in
9883 "$define") echo "Yes, it does." ;;
9884 *) echo "No, it doesn't." ;;
9886 : see if struct tm knows about tm_gmtoff
9887 case "$i_systime$i_time" in
9890 echo "Checking to see if your struct tm has tm_gmtoff field..." >&4
9891 set d_tm_tm_gmtoff tm tm_gmtoff $i_systime sys/time.h $i_time time.h
9899 case "$d_tm_tm_gmtoff" in
9900 "$define") echo "Yes, it does." ;;
9901 *) echo "No, it doesn't." ;;
9904 : see if asctime_r exists
9905 set asctime_r d_asctime_r
9907 case "$d_asctime_r" in
9909 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
9910 case "$d_asctime_r_proto:$usethreads" in
9911 ":define") d_asctime_r_proto=define
9912 set d_asctime_r_proto asctime_r $hdrs
9916 case "$d_asctime_r_proto" in
9918 case "$asctime_r_proto" in
9919 ''|0) try='char* asctime_r(const struct tm*, char*);'
9920 ./protochk "extern $try" $hdrs && asctime_r_proto=B_SB ;;
9922 case "$asctime_r_proto" in
9923 ''|0) try='char* asctime_r(const struct tm*, char*, int);'
9924 ./protochk "extern $try" $hdrs && asctime_r_proto=B_SBI ;;
9926 case "$asctime_r_proto" in
9927 ''|0) try='int asctime_r(const struct tm*, char*);'
9928 ./protochk "extern $try" $hdrs && asctime_r_proto=I_SB ;;
9930 case "$asctime_r_proto" in
9931 ''|0) try='int asctime_r(const struct tm*, char*, int);'
9932 ./protochk "extern $try" $hdrs && asctime_r_proto=I_SBI ;;
9934 case "$asctime_r_proto" in
9935 ''|0) d_asctime_r=undef
9937 echo "Disabling asctime_r, cannot determine prototype." >&4 ;;
9938 * ) case "$asctime_r_proto" in
9939 REENTRANT_PROTO*) ;;
9940 *) asctime_r_proto="REENTRANT_PROTO_$asctime_r_proto" ;;
9942 echo "Prototype: $try" ;;
9945 *) case "$usethreads" in
9946 define) echo "asctime_r has no prototype, not using it." >&4 ;;
9953 *) asctime_r_proto=0
9957 : see if atolf exists
9961 : see if atoll exists
9965 : Look for GCC-style attribute format
9966 case "$d_attribute_format" in
9969 echo "Checking whether your compiler can handle __attribute__((format)) ..." >&4
9970 $cat >attrib.c <<'EOCP'
9972 void my_special_printf(char* pat,...) __attribute__((__format__(__printf__,1,2)));
9974 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
9975 if $contains 'warning' attrib.out >/dev/null 2>&1; then
9976 echo "Your C compiler doesn't support __attribute__((format))."
9979 echo "Your C compiler supports __attribute__((format))."
9983 echo "Your C compiler doesn't seem to understand __attribute__ at all."
9987 *) val="$d_attribute_format" ;;
9989 set d_attribute_format
9993 : Look for GCC-style attribute format with null format allowed
9994 case "$d_printf_format_null" in
9995 '') case "$d_attribute_format" in
9998 echo "Checking whether your compiler allows __printf__ format to be null ..." >&4
9999 $cat >attrib.c <<EOCP
10001 #$i_stdlib I_STDLIB
10003 #include <stdlib.h>
10005 int null_printf (char* pat,...) __attribute__((__format__(__printf__,1,2)));
10006 int null_printf (char* pat,...) { return (int)pat; }
10007 int main () { exit(null_printf(NULL)); }
10009 if $cc $ccflags -o attrib attrib.c >attrib.out 2>&1 ; then
10010 : run the executable in case it produces a run-time warning
10011 if $run ./attrib >>attrib.out 2>&1; then
10012 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10013 echo "Your C compiler doesn't allow __printf__ format to be null."
10016 echo "Your C compiler allows __printf__ format to be null."
10020 echo "Your C compiler executable failed with __printf__ format null."
10024 echo "Your C compiler fails with __printf__ format null."
10031 *) val="$d_printf_format_null" ;;
10033 set d_printf_format_null
10037 : Look for GCC-style attribute malloc
10038 case "$d_attribute_malloc" in
10041 echo "Checking whether your compiler can handle __attribute__((malloc)) ..." >&4
10042 $cat >attrib.c <<'EOCP'
10044 char *go_get_some_memory( int how_many_bytes ) __attribute__((malloc));
10046 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10047 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10048 echo "Your C compiler doesn't support __attribute__((malloc))."
10051 echo "Your C compiler supports __attribute__((malloc))."
10055 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10059 *) val="$d_attribute_malloc" ;;
10061 set d_attribute_malloc
10065 : Look for GCC-style attribute nonnull
10066 case "$d_attribute_nonnull" in
10069 echo "Checking whether your compiler can handle __attribute__((nonnull(1))) ..." >&4
10070 $cat >attrib.c <<'EOCP'
10072 void do_something (char *some_pointer,...) __attribute__((nonnull(1)));
10074 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10075 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10076 echo "Your C compiler doesn't support __attribute__((nonnull))."
10079 echo "Your C compiler supports __attribute__((nonnull))."
10083 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10087 *) val="$d_attribute_nonnull" ;;
10089 set d_attribute_nonnull
10093 : Look for GCC-style attribute noreturn
10094 case "$d_attribute_noreturn" in
10097 echo "Checking whether your compiler can handle __attribute__((noreturn)) ..." >&4
10098 $cat >attrib.c <<'EOCP'
10100 void fall_over_dead( void ) __attribute__((noreturn));
10102 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10103 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10104 echo "Your C compiler doesn't support __attribute__((noreturn))."
10107 echo "Your C compiler supports __attribute__((noreturn))."
10111 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10115 *) val="$d_attribute_noreturn" ;;
10117 set d_attribute_noreturn
10121 : Look for GCC-style attribute pure
10122 case "$d_attribute_pure" in
10125 echo "Checking whether your compiler can handle __attribute__((pure)) ..." >&4
10126 $cat >attrib.c <<'EOCP'
10128 int square( int n ) __attribute__((pure));
10130 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10131 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10132 echo "Your C compiler doesn't support __attribute__((pure))."
10135 echo "Your C compiler supports __attribute__((pure))."
10139 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10143 *) val="$d_attribute_pure" ;;
10145 set d_attribute_pure
10149 : Look for GCC-style attribute unused
10150 case "$d_attribute_unused" in
10153 echo "Checking whether your compiler can handle __attribute__((unused)) ..." >&4
10154 $cat >attrib.c <<'EOCP'
10156 int do_something( int dummy __attribute__((unused)), int n );
10158 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10159 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10160 echo "Your C compiler doesn't support __attribute__((unused))."
10163 echo "Your C compiler supports __attribute__((unused))."
10167 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10171 *) val="$d_attribute_unused" ;;
10173 set d_attribute_unused
10177 : Look for GCC-style attribute warn_unused_result
10178 case "$d_attribute_warn_unused_result" in
10181 echo "Checking whether your compiler can handle __attribute__((warn_unused_result)) ..." >&4
10182 $cat >attrib.c <<'EOCP'
10184 int I_will_not_be_ignored(void) __attribute__((warn_unused_result));
10186 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10187 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10188 echo "Your C compiler doesn't support __attribute__((warn_unused_result))."
10191 echo "Your C compiler supports __attribute__((warn_unused_result))."
10195 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10199 *) val="$d_attribute_warn_unused_result" ;;
10201 set d_attribute_warn_unused_result
10205 : see if bcmp exists
10209 : see if bcopy exists
10213 : see if getpgrp exists
10214 set getpgrp d_getpgrp
10217 case "$d_getpgrp" in
10220 echo "Checking to see which flavor of getpgrp is in use..."
10222 #$i_unistd I_UNISTD
10223 #include <sys/types.h>
10225 # include <unistd.h>
10227 #$i_stdlib I_STDLIB
10229 #include <stdlib.h>
10233 if (getuid() == 0) {
10234 printf("(I see you are running Configure as super-user...)\n");
10237 #ifdef TRY_BSD_PGRP
10238 if (getpgrp(1) == 0)
10247 if $cc -o try -DTRY_BSD_PGRP $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
10248 echo "You have to use getpgrp(pid) instead of getpgrp()." >&4
10250 elif $cc -o try $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
10251 echo "You have to use getpgrp() instead of getpgrp(pid)." >&4
10254 echo "I can't seem to compile and run the test program."
10256 xxx="a USG one, i.e. you use getpgrp()."
10258 # SVR4 systems can appear rather BSD-ish.
10259 case "$i_unistd" in
10261 xxx="a BSD one, i.e. you use getpgrp(pid)."
10265 xxx="probably a USG one, i.e. you use getpgrp()."
10270 echo "Assuming your getpgrp is $xxx" >&4
10279 : see if setpgrp exists
10280 set setpgrp d_setpgrp
10283 case "$d_setpgrp" in
10286 echo "Checking to see which flavor of setpgrp is in use..."
10288 #$i_unistd I_UNISTD
10289 #include <sys/types.h>
10291 # include <unistd.h>
10293 #$i_stdlib I_STDLIB
10295 #include <stdlib.h>
10299 if (getuid() == 0) {
10300 printf("(I see you are running Configure as super-user...)\n");
10303 #ifdef TRY_BSD_PGRP
10304 if (-1 == setpgrp(1, 1))
10307 if (setpgrp() != -1)
10313 if $cc -o try -DTRY_BSD_PGRP $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
10314 echo 'You have to use setpgrp(pid,pgrp) instead of setpgrp().' >&4
10316 elif $cc -o try $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
10317 echo 'You have to use setpgrp() instead of setpgrp(pid,pgrp).' >&4
10320 echo "(I can't seem to compile and run the test program.)"
10322 xxx="a USG one, i.e. you use setpgrp()."
10324 # SVR4 systems can appear rather BSD-ish.
10325 case "$i_unistd" in
10327 xxx="a BSD one, i.e. you use setpgrp(pid,pgrp)."
10331 xxx="probably a USG one, i.e. you use setpgrp()."
10336 echo "Assuming your setpgrp is $xxx" >&4
10344 : Look for GCC-style __builtin_choose_expr
10345 case "$d_builtin_choose_expr" in
10348 echo "Checking whether your compiler can handle __builtin_choose_expr ..." >&4
10349 $cat >try.c <<'EOCP'
10350 #include <assert.h>
10351 #include <stdlib.h>
10354 #define SYRINX(x) __builtin_choose_expr( x, (1056*2), (103*50) )
10357 assert( SYRINX(1) == 2112 );
10358 assert( SYRINX(1) != 5150 );
10359 assert( SYRINX(0) == 5150 );
10360 assert( SYRINX(0) != 2112 );
10361 puts( "All good!" );
10367 if eval $compile; then
10368 echo "Your C compiler supports __builtin_choose_expr."
10371 echo "Your C compiler doesn't seem to understand __builtin_choose_expr."
10375 *) val="$d_builtin_choose_expr" ;;
10378 set d_builtin_choose_expr
10380 $rm -f try.* try core core.try.*
10382 : Look for GCC-style __builtin_expect
10383 case "$d_builtin_expect" in
10386 echo "Checking whether your compiler can handle __builtin_expect ..." >&4
10387 $cat >builtin.c <<'EOCP'
10390 if ( __builtin_expect(n, 0) ) n = 1;
10394 if eval $compile; then
10395 echo "Your C compiler supports __builtin_choose_expr."
10398 echo "Your C compiler doesn't seem to understand __builtin_choose_expr."
10402 *) val="$d_builtin_expect" ;;
10405 set d_builtin_expect
10407 $rm -f try.* try core core.try.*
10409 : see if bzero exists
10413 : see if stdarg is available
10415 if $test `./findhdr stdarg.h`; then
10416 echo "<stdarg.h> found." >&4
10419 echo "<stdarg.h> NOT found." >&4
10423 : see if varags is available
10425 if $test `./findhdr varargs.h`; then
10426 echo "<varargs.h> found." >&4
10428 echo "<varargs.h> NOT found, but that's ok (I hope)." >&4
10431 : set up the varargs testing programs
10432 $cat > varargs.c <<EOP
10434 #include <stdarg.h>
10437 #include <varargs.h>
10441 int f(char *p, ...)
10455 p = va_arg(ap, char *);
10461 $cat > varargs <<EOP
10463 if $cc -c $ccflags -D\$1 varargs.c >/dev/null 2>&1; then
10472 : now check which varargs header should be included
10477 if `./varargs I_STDARG`; then
10479 elif `./varargs I_VARARGS`; then
10484 if `./varargs I_VARARGS`; then
10491 echo "I could not find the definition for va_dcl... You have problems..." >&4
10492 val="$undef"; set i_stdarg; eval $setvar
10493 val="$undef"; set i_varargs; eval $setvar
10498 case "$i_varhdr" in
10500 val="$define"; set i_stdarg; eval $setvar
10501 val="$undef"; set i_varargs; eval $setvar
10504 val="$undef"; set i_stdarg; eval $setvar
10505 val="$define"; set i_varargs; eval $setvar
10508 echo "We'll include <$i_varhdr> to get va_dcl definition." >&4;;
10512 : see if the Compiler supports C99 variadic macros
10513 case "$i_stdarg$i_stdlib" in
10515 echo "You have <stdarg.h> and <stdlib.h>, so checking for C99 variadic macros." >&4
10518 #include <stdarg.h>
10520 #define foo(buffer, format, ...) sprintf(buffer, format, __VA_ARGS__)
10524 foo(buf, "%d %g %.*s", 123, 456.0, (int)3, "789fail");
10530 if eval $compile && $run ./try 2>&1 >/dev/null; then
10531 case "`$run ./try`" in
10533 echo "You have C99 variadic macros." >&4
10534 d_c99_variadic_macros="$define"
10537 echo "You don't have functional C99 variadic macros." >&4
10538 d_c99_variadic_macros="$undef"
10542 echo "I couldn't compile and run the test program, so I assume that you don't have functional C99 variadic macros." >&4
10543 d_c99_variadic_macros="$undef"
10545 $rm -f try.* try core core.try.*
10548 echo "You don't have <stdarg.h> and <stdlib.h>, so not checking for C99 variadic macros." >&4
10549 d_c99_variadic_macros="$undef"
10553 : see if signal is declared as pointer to function returning int or void
10555 xxx=`./findhdr signal.h`
10556 $test "$xxx" && $cppstdin $cppminus $cppflags < $xxx >$$.tmp 2>/dev/null
10557 if $contains 'int.*\*[ ]*signal' $$.tmp >/dev/null 2>&1 ; then
10558 echo "You have int (*signal())() instead of void." >&4
10560 elif $contains 'void.*\*[ ]*signal' $$.tmp >/dev/null 2>&1 ; then
10561 echo "You have void (*signal())()." >&4
10563 elif $contains 'extern[ ]*[(\*]*signal' $$.tmp >/dev/null 2>&1 ; then
10564 echo "You have int (*signal())() instead of void." >&4
10566 elif $contains 'void.*\*.*sig' $$.tmp >/dev/null 2>&1 ; then
10567 echo "You have void (*signal())()." >&4
10570 case "$d_voidsig" in
10572 echo "I can't determine whether signal handler returns void or int..." >&4
10574 rp="What type does your signal handler return?"
10577 v*) val="$define";;
10581 echo "As you already told me, signal handler returns void." >&4
10584 *) echo "As you already told me, signal handler returns int." >&4
10591 case "$d_voidsig" in
10592 "$define") signal_t="void";;
10593 *) signal_t="int";;
10597 : check for ability to cast large floats to 32-bit ints.
10599 echo 'Checking whether your C compiler can cast large floats to int32.' >&4
10600 if $test "$intsize" -ge 4; then
10607 #$i_stdlib I_STDLIB
10609 #include <stdlib.h>
10611 #include <sys/types.h>
10612 #include <signal.h>
10613 $signal_t blech(int s) { exit(3); }
10620 signal(SIGFPE, blech);
10622 /* Don't let compiler optimize the test away. Store the number
10623 in a writable string for gcc to pass to sscanf under HP/UX.
10625 sprintf(str, "2147483647");
10626 sscanf(str, "%lf", &f); /* f = (double) 0x7fffffff; */
10630 /* x86 processors will probably give 0x8000 0000, which is a
10631 sign change. We don't want that. We want to mimic SPARC
10632 behavior here, which is to preserve the sign and give
10635 if (i32 != ($xxx) f)
10641 if eval $compile_ok; then
10645 echo "(I can't seem to compile the test program--assuming it can't)"
10650 echo "Yup, it can."
10653 echo "Nope, it can't."
10660 : check for ability to cast negative floats to unsigned
10662 echo 'Checking whether your C compiler can cast negative float to unsigned.' >&4
10665 #$i_stdlib I_STDLIB
10667 #include <stdlib.h>
10669 #include <sys/types.h>
10670 #include <signal.h>
10671 $signal_t blech(int s) { exit(7); }
10672 $signal_t blech_in_list(int s) { exit(4); }
10673 unsigned long dummy_long(unsigned long p) { return p; }
10674 unsigned int dummy_int(unsigned int p) { return p; }
10675 unsigned short dummy_short(unsigned short p) { return p; }
10679 unsigned long along;
10681 unsigned short ashort;
10685 /* Frustrate gcc-2.7.2's optimizer which failed this test with
10686 a direct f = -123. assignment. gcc-2.8.0 reportedly
10687 optimized the whole file away
10689 /* Store the number in a writable string for gcc to pass to
10690 sscanf under HP/UX.
10692 sprintf(str, "-123");
10693 sscanf(str, "%lf", &f); /* f = -123.; */
10695 signal(SIGFPE, blech);
10696 along = (unsigned long)f;
10697 aint = (unsigned int)f;
10698 ashort = (unsigned short)f;
10699 if (along != (unsigned long)-123)
10701 if (aint != (unsigned int)-123)
10703 if (ashort != (unsigned short)-123)
10705 sprintf(str, "1073741824.");
10706 sscanf(str, "%lf", &f); /* f = (double)0x40000000; */
10709 along = (unsigned long)f;
10710 if (along != 0x80000000)
10714 along = (unsigned long)f;
10715 if (along != 0x7fffffff)
10719 along = (unsigned long)f;
10720 if (along != 0x80000001)
10724 signal(SIGFPE, blech_in_list);
10725 sprintf(str, "123.");
10726 sscanf(str, "%lf", &f); /* f = 123.; */
10727 along = dummy_long((unsigned long)f);
10728 aint = dummy_int((unsigned int)f);
10729 ashort = dummy_short((unsigned short)f);
10730 if (along != (unsigned long)123)
10732 if (aint != (unsigned int)123)
10734 if (ashort != (unsigned short)123)
10741 if eval $compile_ok; then
10745 echo "(I can't seem to compile the test program--assuming it can't)"
10748 case "$castflags" in
10750 echo "Yup, it can."
10753 echo "Nope, it can't."
10760 : see if vprintf exists
10762 if set vprintf val -f d_vprintf; eval $csym; $val; then
10763 echo 'vprintf() found.' >&4
10766 #include <varargs.h>
10767 #$i_stdlib I_STDLIB
10769 #include <stdlib.h>
10772 int main() { xxx("foo"); }
10781 exit((unsigned long)vsprintf(buf,"%s",args) > 10L);
10785 if eval $compile && $run ./try; then
10786 echo "Your vsprintf() returns (int)." >&4
10789 echo "Your vsprintf() returns (char*)." >&4
10793 echo 'vprintf() NOT found.' >&4
10804 : see if chown exists
10808 : see if chroot exists
10809 set chroot d_chroot
10812 : see if chsize exists
10813 set chsize d_chsize
10816 : see if class exists
10820 : see if clearenv exists
10821 set clearenv d_clearenv
10824 hasstruct='varname=$1; struct=$2; shift; shift;
10825 while $test $# -ge 2; do
10827 $define) echo "#include <$2>";;
10831 echo "int main () { struct $struct foo; }" >> try.c;
10833 if eval $compile; then
10840 $rm -f try.c try.o'
10844 : see whether socket exists
10846 $echo $n "Hmm... $c" >&4
10847 if set socket val -f d_socket; eval $csym; $val; then
10848 echo "Looks like you have Berkeley networking support." >&4
10850 if set setsockopt val -f; eval $csym; $val; then
10853 echo "...but it uses the old BSD 4.1c interface, rather than 4.2." >&4
10854 d_oldsock="$define"
10857 if $contains socklib libc.list >/dev/null 2>&1; then
10858 echo "Looks like you have Berkeley networking support." >&4
10860 : we will have to assume that it supports the 4.2 BSD interface
10863 echo "You don't have Berkeley networking in libc$_a..." >&4
10864 if test "X$d_socket" = "X$define"; then
10865 echo "...but you seem to believe that you have sockets." >&4
10867 for net in net socket
10869 if test -f /usr/lib/lib$net$_a; then
10870 ( ($nm $nm_opt /usr/lib/lib$net$_a | eval $nm_extract) || \
10871 $ar t /usr/lib/lib$net$_a) 2>/dev/null >> libc.list
10872 if $contains socket libc.list >/dev/null 2>&1; then
10877 echo "...but the Wollongong group seems to have hacked it in." >&4
10878 sockethdr="-I/usr/netinclude"
10881 echo "Found Berkeley sockets interface in lib$net." >&4
10882 if $contains setsockopt libc.list >/dev/null 2>&1; then
10885 echo "...using the old BSD 4.1c interface, rather than 4.2." >&4
10886 d_oldsock="$define"
10892 if test "X$d_socket" != "X$define"; then
10893 echo "or anywhere else I see." >&4
10901 : see if socketpair exists
10902 set socketpair d_sockpair
10907 echo "Checking the availability of certain socket constants..." >&4
10908 for ENUM in MSG_CTRUNC MSG_DONTROUTE MSG_OOB MSG_PEEK MSG_PROXY SCM_RIGHTS; do
10909 enum=`$echo $ENUM|./tr '[A-Z]' '[a-z]'`
10911 #include <sys/types.h>
10912 #include <sys/socket.h>
10918 set try; if eval $compile; then
10921 set d_${enum}; eval $setvar
10925 : see if this is a sys/uio.h system
10926 set sys/uio.h i_sysuio
10931 echo "Checking to see if your system supports struct cmsghdr..." >&4
10932 set d_cmsghdr_s cmsghdr $i_systypes sys/types.h $d_socket sys/socket.h $i_sysuio sys/uio.h
10934 case "$d_cmsghdr_s" in
10935 "$define") echo "Yes, it does." ;;
10936 *) echo "No, it doesn't." ;;
10940 : check for const keyword
10942 echo 'Checking to see if your C compiler knows about "const"...' >&4
10943 $cat >const.c <<'EOCP'
10944 typedef struct spug { int drokk; } spug;
10948 const spug y = { 0 };
10951 if $cc -c $ccflags const.c >/dev/null 2>&1 ; then
10953 echo "Yup, it does."
10956 echo "Nope, it doesn't."
10961 : see if copysignl exists
10962 set copysignl d_copysignl
10965 : see if crypt exists
10970 $define) cryptlib='' ;;
10971 *) if set crypt val -f d_crypt; eval $csym; $val; then
10972 echo 'crypt() found.' >&4
10976 cryptlib=`./loc Slibcrypt$_a "" $xlibpth`
10977 if $test -z "$cryptlib"; then
10978 cryptlib=`./loc Mlibcrypt$_a "" $xlibpth`
10982 if $test -z "$cryptlib"; then
10983 cryptlib=`./loc Llibcrypt$_a "" $xlibpth`
10987 if $test -z "$cryptlib"; then
10988 cryptlib=`./loc libcrypt$_a "" $libpth`
10992 if $test -z "$cryptlib"; then
10993 echo 'crypt() NOT found.' >&4
11004 : see if this is a crypt.h system
11005 set crypt.h i_crypt
11008 : see if crypt_r exists
11009 set crypt_r d_crypt_r
11011 case "$d_crypt_r" in
11013 hdrs="$i_systypes sys/types.h define stdio.h $i_crypt crypt.h"
11014 case "$d_crypt_r_proto:$usethreads" in
11015 ":define") d_crypt_r_proto=define
11016 set d_crypt_r_proto crypt_r $hdrs
11020 case "$d_crypt_r_proto" in
11022 case "$crypt_r_proto" in
11023 ''|0) try='char* crypt_r(const char*, const char*, struct crypt_data*);'
11024 ./protochk "extern $try" $hdrs && crypt_r_proto=B_CCS ;;
11026 case "$crypt_r_proto" in
11027 ''|0) try='char* crypt_r(const char*, const char*, CRYPTD*);'
11028 ./protochk "extern $try" $hdrs && crypt_r_proto=B_CCD ;;
11030 case "$crypt_r_proto" in
11031 ''|0) d_crypt_r=undef
11033 echo "Disabling crypt_r, cannot determine prototype." >&4 ;;
11034 * ) case "$crypt_r_proto" in
11035 REENTRANT_PROTO*) ;;
11036 *) crypt_r_proto="REENTRANT_PROTO_$crypt_r_proto" ;;
11038 echo "Prototype: $try" ;;
11041 *) case "$usethreads" in
11042 define) echo "crypt_r has no prototype, not using it." >&4 ;;
11053 : get csh whereabouts
11055 'csh') val="$undef" ;;
11056 *) val="$define" ;;
11060 : Respect a hint or command line value for full_csh.
11061 case "$full_csh" in
11062 '') full_csh=$csh ;;
11065 : see if ctermid exists
11066 set ctermid d_ctermid
11069 : see if ctermid_r exists
11070 set ctermid_r d_ctermid_r
11072 case "$d_ctermid_r" in
11074 hdrs="$i_systypes sys/types.h define stdio.h "
11075 case "$d_ctermid_r_proto:$usethreads" in
11076 ":define") d_ctermid_r_proto=define
11077 set d_ctermid_r_proto ctermid_r $hdrs
11081 case "$d_ctermid_r_proto" in
11083 case "$ctermid_r_proto" in
11084 ''|0) try='char* ctermid_r(char*);'
11085 ./protochk "extern $try" $hdrs && ctermid_r_proto=B_B ;;
11087 case "$ctermid_r_proto" in
11088 ''|0) d_ctermid_r=undef
11090 echo "Disabling ctermid_r, cannot determine prototype." >&4 ;;
11091 * ) case "$ctermid_r_proto" in
11092 REENTRANT_PROTO*) ;;
11093 *) ctermid_r_proto="REENTRANT_PROTO_$ctermid_r_proto" ;;
11095 echo "Prototype: $try" ;;
11098 *) case "$usethreads" in
11099 define) echo "ctermid_r has no prototype, not using it." >&4 ;;
11106 *) ctermid_r_proto=0
11110 : see if ctime_r exists
11111 set ctime_r d_ctime_r
11113 case "$d_ctime_r" in
11115 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
11116 case "$d_ctime_r_proto:$usethreads" in
11117 ":define") d_ctime_r_proto=define
11118 set d_ctime_r_proto ctime_r $hdrs
11122 case "$d_ctime_r_proto" in
11124 case "$ctime_r_proto" in
11125 ''|0) try='char* ctime_r(const time_t*, char*);'
11126 ./protochk "extern $try" $hdrs && ctime_r_proto=B_SB ;;
11128 case "$ctime_r_proto" in
11129 ''|0) try='char* ctime_r(const time_t*, char*, int);'
11130 ./protochk "extern $try" $hdrs && ctime_r_proto=B_SBI ;;
11132 case "$ctime_r_proto" in
11133 ''|0) try='int ctime_r(const time_t*, char*);'
11134 ./protochk "extern $try" $hdrs && ctime_r_proto=I_SB ;;
11136 case "$ctime_r_proto" in
11137 ''|0) try='int ctime_r(const time_t*, char*, int);'
11138 ./protochk "extern $try" $hdrs && ctime_r_proto=I_SBI ;;
11140 case "$ctime_r_proto" in
11141 ''|0) d_ctime_r=undef
11143 echo "Disabling ctime_r, cannot determine prototype." >&4 ;;
11144 * ) case "$ctime_r_proto" in
11145 REENTRANT_PROTO*) ;;
11146 *) ctime_r_proto="REENTRANT_PROTO_$ctime_r_proto" ;;
11148 echo "Prototype: $try" ;;
11151 *) case "$usethreads" in
11152 define) echo "ctime_r has no prototype, not using it." >&4 ;;
11163 : see if cuserid exists
11164 set cuserid d_cuserid
11167 : see if this is a limits.h system
11168 set limits.h i_limits
11171 : see if this is a float.h system
11172 set float.h i_float
11175 : See if number of significant digits in a double precision number is known
11177 $cat >dbl_dig.c <<EOM
11178 #$i_limits I_LIMITS
11181 #include <limits.h>
11187 printf("Contains DBL_DIG");
11190 $cppstdin $cppflags $cppminus < dbl_dig.c >dbl_dig.E 2>/dev/null
11191 if $contains 'DBL_DIG' dbl_dig.E >/dev/null 2>&1; then
11192 echo "DBL_DIG found." >&4
11195 echo "DBL_DIG NOT found." >&4
11202 : see if dbm.h is available
11203 : see if dbmclose exists
11204 set dbmclose d_dbmclose
11207 case "$d_dbmclose" in
11217 *) set rpcsvc/dbm.h i_rpcsvcdbm
11222 *) echo "We won't be including <dbm.h>"
11232 : see if prototype for dbminit is available
11234 set d_dbminitproto dbminit $i_dbm dbm.h
11237 : see if difftime exists
11238 set difftime d_difftime
11241 : see if this is a dirent system
11243 if xinc=`./findhdr dirent.h`; $test "$xinc"; then
11245 echo "<dirent.h> found." >&4
11248 if xinc=`./findhdr sys/dir.h`; $test "$xinc"; then
11249 echo "<sys/dir.h> found." >&4
11252 xinc=`./findhdr sys/ndir.h`
11254 echo "<dirent.h> NOT found." >&4
11259 : Look for type of directory structure.
11261 $cppstdin $cppflags $cppminus < "$xinc" > try.c
11263 case "$direntrytype" in
11265 case "$i_dirent" in
11266 $define) guess1='struct dirent' ;;
11267 *) guess1='struct direct' ;;
11270 *) guess1="$direntrytype"
11275 'struct dirent') guess2='struct direct' ;;
11276 *) guess2='struct dirent' ;;
11279 if $contains "$guess1" try.c >/dev/null 2>&1; then
11280 direntrytype="$guess1"
11281 echo "Your directory entries are $direntrytype." >&4
11282 elif $contains "$guess2" try.c >/dev/null 2>&1; then
11283 direntrytype="$guess2"
11284 echo "Your directory entries seem to be $direntrytype." >&4
11286 echo "I don't recognize your system's directory entries." >&4
11287 rp="What type is used for directory entries on this system?"
11290 direntrytype="$ans"
11295 : see if the directory entry stores field length
11297 $cppstdin $cppflags $cppminus < "$xinc" > try.c
11298 if $contains 'd_namlen' try.c >/dev/null 2>&1; then
11299 echo "Good, your directory entry keeps length information in d_namlen." >&4
11302 echo "Your directory entry does not know about the d_namlen field." >&4
11309 : Look for DIR.dd_fd
11310 case "$i_dirent" in
11312 echo "Checking to see if DIR has a dd_fd member variable" >&4
11314 #$i_stdlib I_STDLIB
11316 #include <stdlib.h>
11318 #include <dirent.h>
11328 if eval $compile; then
11329 echo "Yes, it does."
11332 echo "No, it does not."
11337 echo "You don't have a <dirent.h>, so not checking for dd_fd." >&4
11345 : see if this is an sysdir system
11346 set sys/dir.h i_sysdir
11349 : see if this is an sysndir system
11350 set sys/ndir.h i_sysndir
11355 $cat >dirfd.c <<EOM
11357 #$i_stdlib I_STDLIB
11359 #include <stdlib.h>
11361 #$i_dirent I_DIRENT /**/
11362 #$i_sysdir I_SYS_DIR /**/
11363 #$i_sysndir I_SYS_NDIR /**/
11364 #$i_systypes I_SYS_TYPES /**/
11365 #if defined(I_SYS_TYPES)
11366 #include <sys/types.h>
11368 #if defined(I_DIRENT)
11369 #include <dirent.h>
11370 #if defined(NeXT) && defined(I_SYS_DIR) /* NeXT needs dirent + sys/dir.h */
11371 #include <sys/dir.h>
11375 #include <sys/ndir.h>
11379 #include <ndir.h> /* may be wrong in the future */
11381 #include <sys/dir.h>
11387 DIR *dirp = opendir(".");
11388 if (dirfd(dirp) >= 0)
11396 if eval $compile; then
11400 $define) echo "dirfd() found." >&4 ;;
11401 *) echo "dirfd() NOT found." >&4 ;;
11407 : see if dlerror exists
11410 set dlerror d_dlerror
11414 : see if dlfcn is available
11415 set dlfcn.h i_dlfcn
11422 On a few systems, the dynamically loaded modules that perl generates and uses
11423 will need a different extension than shared libs. The default will probably
11429 *) dflt="$dlext" ;;
11431 rp='What is the extension of dynamically loaded modules'
11440 : Check if dlsym need a leading underscore
11446 echo "Checking whether your dlsym() needs a leading underscore ..." >&4
11447 $cat >dyna.c <<'EOM'
11454 #$i_stdlib I_STDLIB
11456 #include <stdlib.h>
11460 #include <dlfcn.h> /* the dynamic linker include file for SunOS/Solaris */
11462 #include <sys/types.h>
11467 extern int fred() ;
11476 int mode = RTLD_LAZY ;
11478 handle = dlopen("./dyna.$dlext", mode) ;
11479 if (handle == NULL) {
11484 symbol = dlsym(handle, "fred") ;
11485 if (symbol == NULL) {
11486 /* try putting a leading underscore */
11487 symbol = dlsym(handle, "_fred") ;
11488 if (symbol == NULL) {
11501 : Call the object file tmp-dyna.o in case dlext=o.
11502 if $cc $ccflags $cccdlflags -c dyna.c > /dev/null 2>&1 &&
11503 mv dyna${_o} tmp-dyna${_o} > /dev/null 2>&1 &&
11504 $ld -o dyna.$dlext $ldflags $lddlflags tmp-dyna${_o} > /dev/null 2>&1 &&
11505 $cc -o fred $ccflags $ldflags $cccdlflags $ccdlflags fred.c $libs > /dev/null 2>&1 && $to dyna.$dlext; then
11508 1) echo "Test program failed using dlopen." >&4
11509 echo "Perhaps you should not use dynamic loading." >&4;;
11510 2) echo "Test program failed using dlsym." >&4
11511 echo "Perhaps you should not use dynamic loading." >&4;;
11512 3) echo "dlsym needs a leading underscore" >&4
11514 4) echo "dlsym doesn't need a leading underscore." >&4;;
11517 echo "I can't compile and run the test program." >&4
11518 echo "I'm guessing that dlsym doesn't need a leading underscore." >&4
11523 $rm -f fred fred.* dyna.$dlext dyna.* tmp-dyna.*
11528 : see if drand48_r exists
11529 set drand48_r d_drand48_r
11531 case "$d_drand48_r" in
11533 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
11534 case "$d_drand48_r_proto:$usethreads" in
11535 ":define") d_drand48_r_proto=define
11536 set d_drand48_r_proto drand48_r $hdrs
11540 case "$d_drand48_r_proto" in
11542 case "$drand48_r_proto" in
11543 ''|0) try='int drand48_r(struct drand48_data*, double*);'
11544 ./protochk "extern $try" $hdrs && drand48_r_proto=I_ST ;;
11546 case "$drand48_r_proto" in
11547 ''|0) d_drand48_r=undef
11549 echo "Disabling drand48_r, cannot determine prototype." >&4 ;;
11550 * ) case "$drand48_r_proto" in
11551 REENTRANT_PROTO*) ;;
11552 *) drand48_r_proto="REENTRANT_PROTO_$drand48_r_proto" ;;
11554 echo "Prototype: $try" ;;
11557 *) case "$usethreads" in
11558 define) echo "drand48_r has no prototype, not using it." >&4 ;;
11565 *) drand48_r_proto=0
11569 : see if prototype for drand48 is available
11571 set d_drand48proto drand48 $i_stdlib stdlib.h $i_unistd unistd.h
11574 : see if dup2 exists
11578 : see if eaccess exists
11579 set eaccess d_eaccess
11582 : see if endgrent exists
11583 set endgrent d_endgrent
11586 : see if this is an grp system
11592 xxx=`./findhdr grp.h`
11593 $cppstdin $cppflags $cppminus < $xxx >$$.h
11595 if $contains 'gr_passwd' $$.h >/dev/null 2>&1; then
11607 set d_grpasswd; eval $setvar
11611 : see if endgrent_r exists
11612 set endgrent_r d_endgrent_r
11614 case "$d_endgrent_r" in
11616 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
11617 case "$d_endgrent_r_proto:$usethreads" in
11618 ":define") d_endgrent_r_proto=define
11619 set d_endgrent_r_proto endgrent_r $hdrs
11623 case "$d_endgrent_r_proto" in
11625 case "$endgrent_r_proto" in
11626 ''|0) try='int endgrent_r(FILE**);'
11627 ./protochk "extern $try" $hdrs && endgrent_r_proto=I_H ;;
11629 case "$endgrent_r_proto" in
11630 ''|0) try='void endgrent_r(FILE**);'
11631 ./protochk "extern $try" $hdrs && endgrent_r_proto=V_H ;;
11633 case "$endgrent_r_proto" in
11634 ''|0) d_endgrent_r=undef
11636 echo "Disabling endgrent_r, cannot determine prototype." >&4 ;;
11637 * ) case "$endgrent_r_proto" in
11638 REENTRANT_PROTO*) ;;
11639 *) endgrent_r_proto="REENTRANT_PROTO_$endgrent_r_proto" ;;
11641 echo "Prototype: $try" ;;
11644 *) case "$usethreads" in
11645 define) echo "endgrent_r has no prototype, not using it." >&4 ;;
11652 *) endgrent_r_proto=0
11656 : see if endhostent exists
11657 set endhostent d_endhent
11660 : see if this is a netdb.h system
11661 set netdb.h i_netdb
11664 : see if endhostent_r exists
11665 set endhostent_r d_endhostent_r
11667 case "$d_endhostent_r" in
11669 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
11670 case "$d_endhostent_r_proto:$usethreads" in
11671 ":define") d_endhostent_r_proto=define
11672 set d_endhostent_r_proto endhostent_r $hdrs
11676 case "$d_endhostent_r_proto" in
11678 case "$endhostent_r_proto" in
11679 ''|0) try='int endhostent_r(struct hostent_data*);'
11680 ./protochk "extern $try" $hdrs && endhostent_r_proto=I_D ;;
11682 case "$endhostent_r_proto" in
11683 ''|0) try='void endhostent_r(struct hostent_data*);'
11684 ./protochk "extern $try" $hdrs && endhostent_r_proto=V_D ;;
11686 case "$endhostent_r_proto" in
11687 ''|0) d_endhostent_r=undef
11688 endhostent_r_proto=0
11689 echo "Disabling endhostent_r, cannot determine prototype." >&4 ;;
11690 * ) case "$endhostent_r_proto" in
11691 REENTRANT_PROTO*) ;;
11692 *) endhostent_r_proto="REENTRANT_PROTO_$endhostent_r_proto" ;;
11694 echo "Prototype: $try" ;;
11697 *) case "$usethreads" in
11698 define) echo "endhostent_r has no prototype, not using it." >&4 ;;
11700 d_endhostent_r=undef
11701 endhostent_r_proto=0
11705 *) endhostent_r_proto=0
11709 : see if endnetent exists
11710 set endnetent d_endnent
11713 : see if endnetent_r exists
11714 set endnetent_r d_endnetent_r
11716 case "$d_endnetent_r" in
11718 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
11719 case "$d_endnetent_r_proto:$usethreads" in
11720 ":define") d_endnetent_r_proto=define
11721 set d_endnetent_r_proto endnetent_r $hdrs
11725 case "$d_endnetent_r_proto" in
11727 case "$endnetent_r_proto" in
11728 ''|0) try='int endnetent_r(struct netent_data*);'
11729 ./protochk "extern $try" $hdrs && endnetent_r_proto=I_D ;;
11731 case "$endnetent_r_proto" in
11732 ''|0) try='void endnetent_r(struct netent_data*);'
11733 ./protochk "extern $try" $hdrs && endnetent_r_proto=V_D ;;
11735 case "$endnetent_r_proto" in
11736 ''|0) d_endnetent_r=undef
11737 endnetent_r_proto=0
11738 echo "Disabling endnetent_r, cannot determine prototype." >&4 ;;
11739 * ) case "$endnetent_r_proto" in
11740 REENTRANT_PROTO*) ;;
11741 *) endnetent_r_proto="REENTRANT_PROTO_$endnetent_r_proto" ;;
11743 echo "Prototype: $try" ;;
11746 *) case "$usethreads" in
11747 define) echo "endnetent_r has no prototype, not using it." >&4 ;;
11749 d_endnetent_r=undef
11750 endnetent_r_proto=0
11754 *) endnetent_r_proto=0
11758 : see if endprotoent exists
11759 set endprotoent d_endpent
11762 : see if endprotoent_r exists
11763 set endprotoent_r d_endprotoent_r
11765 case "$d_endprotoent_r" in
11767 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
11768 case "$d_endprotoent_r_proto:$usethreads" in
11769 ":define") d_endprotoent_r_proto=define
11770 set d_endprotoent_r_proto endprotoent_r $hdrs
11774 case "$d_endprotoent_r_proto" in
11776 case "$endprotoent_r_proto" in
11777 ''|0) try='int endprotoent_r(struct protoent_data*);'
11778 ./protochk "extern $try" $hdrs && endprotoent_r_proto=I_D ;;
11780 case "$endprotoent_r_proto" in
11781 ''|0) try='void endprotoent_r(struct protoent_data*);'
11782 ./protochk "extern $try" $hdrs && endprotoent_r_proto=V_D ;;
11784 case "$endprotoent_r_proto" in
11785 ''|0) d_endprotoent_r=undef
11786 endprotoent_r_proto=0
11787 echo "Disabling endprotoent_r, cannot determine prototype." >&4 ;;
11788 * ) case "$endprotoent_r_proto" in
11789 REENTRANT_PROTO*) ;;
11790 *) endprotoent_r_proto="REENTRANT_PROTO_$endprotoent_r_proto" ;;
11792 echo "Prototype: $try" ;;
11795 *) case "$usethreads" in
11796 define) echo "endprotoent_r has no prototype, not using it." >&4 ;;
11798 d_endprotoent_r=undef
11799 endprotoent_r_proto=0
11803 *) endprotoent_r_proto=0
11807 : see if endpwent exists
11808 set endpwent d_endpwent
11811 : see if this is a pwd.h system
11817 xxx=`./findhdr pwd.h`
11818 $cppstdin $cppflags $cppminus < $xxx >$$.h
11820 if $contains 'pw_quota' $$.h >/dev/null 2>&1; then
11828 if $contains 'pw_age' $$.h >/dev/null 2>&1; then
11836 if $contains 'pw_change' $$.h >/dev/null 2>&1; then
11844 if $contains 'pw_class' $$.h >/dev/null 2>&1; then
11852 if $contains 'pw_expire' $$.h >/dev/null 2>&1; then
11860 if $contains 'pw_comment' $$.h >/dev/null 2>&1; then
11868 if $contains 'pw_gecos' $$.h >/dev/null 2>&1; then
11876 if $contains 'pw_passwd' $$.h >/dev/null 2>&1; then
11888 set d_pwquota; eval $setvar
11889 set d_pwage; eval $setvar
11890 set d_pwchange; eval $setvar
11891 set d_pwclass; eval $setvar
11892 set d_pwexpire; eval $setvar
11893 set d_pwcomment; eval $setvar
11894 set d_pwgecos; eval $setvar
11895 set d_pwpasswd; eval $setvar
11899 : see if endpwent_r exists
11900 set endpwent_r d_endpwent_r
11902 case "$d_endpwent_r" in
11904 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
11905 case "$d_endpwent_r_proto:$usethreads" in
11906 ":define") d_endpwent_r_proto=define
11907 set d_endpwent_r_proto endpwent_r $hdrs
11911 case "$d_endpwent_r_proto" in
11913 case "$endpwent_r_proto" in
11914 ''|0) try='int endpwent_r(FILE**);'
11915 ./protochk "extern $try" $hdrs && endpwent_r_proto=I_H ;;
11917 case "$endpwent_r_proto" in
11918 ''|0) try='void endpwent_r(FILE**);'
11919 ./protochk "extern $try" $hdrs && endpwent_r_proto=V_H ;;
11921 case "$endpwent_r_proto" in
11922 ''|0) d_endpwent_r=undef
11924 echo "Disabling endpwent_r, cannot determine prototype." >&4 ;;
11925 * ) case "$endpwent_r_proto" in
11926 REENTRANT_PROTO*) ;;
11927 *) endpwent_r_proto="REENTRANT_PROTO_$endpwent_r_proto" ;;
11929 echo "Prototype: $try" ;;
11932 *) case "$usethreads" in
11933 define) echo "endpwent_r has no prototype, not using it." >&4 ;;
11940 *) endpwent_r_proto=0
11944 : see if endservent exists
11945 set endservent d_endsent
11948 : see if endservent_r exists
11949 set endservent_r d_endservent_r
11951 case "$d_endservent_r" in
11953 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
11954 case "$d_endservent_r_proto:$usethreads" in
11955 ":define") d_endservent_r_proto=define
11956 set d_endservent_r_proto endservent_r $hdrs
11960 case "$d_endservent_r_proto" in
11962 case "$endservent_r_proto" in
11963 ''|0) try='int endservent_r(struct servent_data*);'
11964 ./protochk "extern $try" $hdrs && endservent_r_proto=I_D ;;
11966 case "$endservent_r_proto" in
11967 ''|0) try='void endservent_r(struct servent_data*);'
11968 ./protochk "extern $try" $hdrs && endservent_r_proto=V_D ;;
11970 case "$endservent_r_proto" in
11971 ''|0) d_endservent_r=undef
11972 endservent_r_proto=0
11973 echo "Disabling endservent_r, cannot determine prototype." >&4 ;;
11974 * ) case "$endservent_r_proto" in
11975 REENTRANT_PROTO*) ;;
11976 *) endservent_r_proto="REENTRANT_PROTO_$endservent_r_proto" ;;
11978 echo "Prototype: $try" ;;
11981 *) case "$usethreads" in
11982 define) echo "endservent_r has no prototype, not using it." >&4 ;;
11984 d_endservent_r=undef
11985 endservent_r_proto=0
11989 *) endservent_r_proto=0
11993 : Locate the flags for 'open()'
11996 #include <sys/types.h>
12001 #include <sys/file.h>
12003 #$i_stdlib I_STDLIB
12005 #include <stdlib.h>
12016 : check sys/file.h first to get FREAD on Sun
12017 if $test `./findhdr sys/file.h` && \
12018 set try -DI_SYS_FILE && eval $compile; then
12020 echo "<sys/file.h> defines the O_* constants..." >&4
12021 if $run ./try; then
12022 echo "and you have the 3 argument form of open()." >&4
12025 echo "but not the 3 argument form of open(). Oh, well." >&4
12028 elif $test `./findhdr fcntl.h` && \
12029 set try -DI_FCNTL && eval $compile; then
12031 echo "<fcntl.h> defines the O_* constants..." >&4
12032 if $run ./try; then
12033 echo "and you have the 3 argument form of open()." >&4
12036 echo "but not the 3 argument form of open(). Oh, well." >&4
12041 echo "I can't find the O_* constant definitions! You got problems." >&4
12047 : see which of string.h or strings.h is needed
12049 strings=`./findhdr string.h`
12050 if $test "$strings" && $test -r "$strings"; then
12051 echo "Using <string.h> instead of <strings.h>." >&4
12055 strings=`./findhdr strings.h`
12056 if $test "$strings" && $test -r "$strings"; then
12057 echo "Using <strings.h> instead of <string.h>." >&4
12059 echo "No string header found -- You'll surely have problems." >&4
12064 case "$i_string" in
12065 "$undef") strings=`./findhdr strings.h`;;
12066 *) strings=`./findhdr string.h`;;
12069 : see if this is a sys/file.h system
12074 : do we need to include sys/file.h ?
12078 if $h_sysfile; then
12080 echo "We'll be including <sys/file.h>." >&4
12083 echo "We won't be including <sys/file.h>." >&4
12093 : see if fcntl.h is there
12098 : see if we can include fcntl.h
12104 echo "We'll be including <fcntl.h>." >&4
12107 if $h_sysfile; then
12108 echo "We don't need to include <fcntl.h> if we include <sys/file.h>." >&4
12110 echo "We won't be including <fcntl.h>." >&4
12122 : check for non-blocking I/O stuff
12123 case "$h_sysfile" in
12124 true) echo "#include <sys/file.h>" > head.c;;
12127 true) echo "#include <fcntl.h>" > head.c;;
12128 *) echo "#include <sys/fcntl.h>" > head.c;;
12133 echo "Figuring out the flag used by open() for non-blocking I/O..." >&4
12134 case "$o_nonblock" in
12136 $cat head.c > try.c
12137 $cat >>try.c <<EOCP
12139 #$i_stdlib I_STDLIB
12141 #include <stdlib.h>
12149 printf("O_NONBLOCK\n");
12153 printf("O_NDELAY\n");
12157 printf("FNDELAY\n");
12164 if eval $compile_ok; then
12165 o_nonblock=`$run ./try`
12166 case "$o_nonblock" in
12167 '') echo "I can't figure it out, assuming O_NONBLOCK will do.";;
12168 *) echo "Seems like we can use $o_nonblock.";;
12171 echo "(I can't compile the test program; pray O_NONBLOCK is right!)"
12174 *) echo "Using $hint value $o_nonblock.";;
12176 $rm -f try try.* .out core
12179 echo "Let's see what value errno gets from read() on a $o_nonblock file..." >&4
12182 $cat head.c > try.c
12183 $cat >>try.c <<EOCP
12185 #include <sys/types.h>
12186 #include <signal.h>
12188 #$i_stdlib I_STDLIB
12190 #include <stdlib.h>
12196 #define MY_O_NONBLOCK $o_nonblock
12197 #ifndef errno /* XXX need better Configure test */
12200 #$i_unistd I_UNISTD
12202 #include <unistd.h>
12204 #$i_string I_STRING
12206 #include <string.h>
12208 #include <strings.h>
12210 $signal_t blech(int x) { exit(3); }
12212 $cat >> try.c <<'EOCP'
12220 pipe(pd); /* Down: child -> parent */
12221 pipe(pu); /* Up: parent -> child */
12224 close(pd[1]); /* Parent reads from pd[0] */
12225 close(pu[0]); /* Parent writes (blocking) to pu[1] */
12227 if (-1 == fcntl(pd[0], F_SETFL, MY_O_NONBLOCK))
12232 signal(SIGALRM, blech);
12234 if ((ret = read(pd[0], buf, 1)) > 0) /* Nothing to read! */
12236 sprintf(string, "%d\n", ret);
12237 write(2, string, strlen(string));
12240 if (errno == EAGAIN) {
12241 printf("EAGAIN\n");
12246 if (errno == EWOULDBLOCK)
12247 printf("EWOULDBLOCK\n");
12250 write(pu[1], buf, 1); /* Unblocks child, tell it to close our pipe */
12251 sleep(2); /* Give it time to close our pipe */
12253 ret = read(pd[0], buf, 1); /* Should read EOF */
12255 sprintf(string, "%d\n", ret);
12256 write(4, string, strlen(string));
12260 close(pd[0]); /* We write to pd[1] */
12261 close(pu[1]); /* We read from pu[0] */
12262 read(pu[0], buf, 1); /* Wait for parent to signal us we may continue */
12263 close(pd[1]); /* Pipe pd is now fully closed! */
12264 exit(0); /* Bye bye, thank you for playing! */
12268 if eval $compile_ok; then
12269 echo "$startsh" >mtry
12270 echo "$run ./try >try.out 2>try.ret 4>try.err || exit 4" >>mtry
12272 ./mtry >/dev/null 2>&1
12274 0) eagain=`$cat try.out`;;
12275 1) echo "Could not perform non-blocking setting!";;
12276 2) echo "I did a successful read() for something that was not there!";;
12277 3) echo "Hmm... non-blocking I/O does not seem to be working!";;
12278 4) echo "Could not find F_SETFL!";;
12279 *) echo "Something terribly wrong happened during testing.";;
12281 rd_nodata=`$cat try.ret`
12282 echo "A read() system call with no data present returns $rd_nodata."
12283 case "$rd_nodata" in
12286 echo "(That's peculiar, fixing that to be -1.)"
12292 echo "Forcing errno EAGAIN on read() with no data available."
12296 echo "Your read() sets errno to $eagain when no data is available."
12299 status=`$cat try.err`
12301 0) echo "And it correctly returns 0 to signal EOF.";;
12302 -1) echo "But it also returns -1 to signal EOF, so be careful!";;
12303 *) echo "However, your read() returns '$status' on EOF??";;
12306 if test "$status" = "$rd_nodata"; then
12307 echo "WARNING: you can't distinguish between EOF and no data!"
12311 echo "I can't compile the test program--assuming errno EAGAIN will do."
12318 echo "Using $hint value $eagain."
12319 echo "Your read() returns $rd_nodata when no data is present."
12320 case "$d_eofnblk" in
12321 "$define") echo "And you can see EOF because read() returns 0.";;
12322 "$undef") echo "But you can't see EOF status from read() returned value.";;
12324 echo "(Assuming you can't see EOF status from read anyway.)"
12330 $rm -f try try.* .out core head.c mtry
12332 : see if _ptr and _cnt from stdio act std
12335 if $contains '_lbfsize' `./findhdr stdio.h` >/dev/null 2>&1 ; then
12336 echo "(Looks like you have stdio.h from BSD.)"
12337 case "$stdio_ptr" in
12338 '') stdio_ptr='((fp)->_p)'
12341 *) ptr_lval=$d_stdio_ptr_lval;;
12343 case "$stdio_cnt" in
12344 '') stdio_cnt='((fp)->_r)'
12347 *) cnt_lval=$d_stdio_cnt_lval;;
12349 case "$stdio_base" in
12350 '') stdio_base='((fp)->_ub._base ? (fp)->_ub._base : (fp)->_bf._base)';;
12352 case "$stdio_bufsiz" in
12353 '') stdio_bufsiz='((fp)->_ub._base ? (fp)->_ub._size : (fp)->_bf._size)';;
12355 elif $contains '_IO_fpos_t' `./findhdr stdio.h` `./findhdr libio.h` >/dev/null 2>&1 ; then
12356 echo "(Looks like you have stdio.h from Linux.)"
12357 case "$stdio_ptr" in
12358 '') stdio_ptr='((fp)->_IO_read_ptr)'
12361 *) ptr_lval=$d_stdio_ptr_lval;;
12363 case "$stdio_cnt" in
12364 '') stdio_cnt='((fp)->_IO_read_end - (fp)->_IO_read_ptr)'
12367 *) cnt_lval=$d_stdio_cnt_lval;;
12369 case "$stdio_base" in
12370 '') stdio_base='((fp)->_IO_read_base)';;
12372 case "$stdio_bufsiz" in
12373 '') stdio_bufsiz='((fp)->_IO_read_end - (fp)->_IO_read_base)';;
12376 case "$stdio_ptr" in
12377 '') stdio_ptr='((fp)->_ptr)'
12380 *) ptr_lval=$d_stdio_ptr_lval;;
12382 case "$stdio_cnt" in
12383 '') stdio_cnt='((fp)->_cnt)'
12386 *) cnt_lval=$d_stdio_cnt_lval;;
12388 case "$stdio_base" in
12389 '') stdio_base='((fp)->_base)';;
12391 case "$stdio_bufsiz" in
12392 '') stdio_bufsiz='((fp)->_cnt + (fp)->_ptr - (fp)->_base)';;
12396 : test whether _ptr and _cnt really work
12397 echo "Checking how std your stdio is..." >&4
12400 #$i_stdlib I_STDLIB
12402 #include <stdlib.h>
12404 #define FILE_ptr(fp) $stdio_ptr
12405 #define FILE_cnt(fp) $stdio_cnt
12407 FILE *fp = fopen("try.c", "r");
12410 18 <= FILE_cnt(fp) &&
12411 strncmp(FILE_ptr(fp), "include <stdio.h>\n", 18) == 0
12419 if eval $compile && $to try.c; then
12420 if $run ./try; then
12421 echo "Your stdio acts pretty std."
12424 echo "Your stdio isn't very std."
12427 echo "Your stdio doesn't appear very std."
12431 # glibc 2.2.90 and above apparently change stdio streams so Perl's
12432 # direct buffer manipulation no longer works. The Configure tests
12433 # should be changed to correctly detect this, but until then,
12434 # the following check should at least let perl compile and run.
12435 # (This quick fix should be updated before 5.8.1.)
12436 # To be defensive, reject all unknown versions, and all versions > 2.2.9.
12437 # A. Dougherty, June 3, 2002.
12438 case "$d_gnulibc" in
12440 case "$gnulibc_version" in
12444 *) echo "But I will not snoop inside glibc $gnulibc_version stdio buffers."
12453 : Can _ptr be used as an lvalue?
12454 case "$d_stdstdio$ptr_lval" in
12455 $define$define) val=$define ;;
12458 set d_stdio_ptr_lval
12461 : Can _cnt be used as an lvalue?
12462 case "$d_stdstdio$cnt_lval" in
12463 $define$define) val=$define ;;
12466 set d_stdio_cnt_lval
12470 : test whether setting _ptr sets _cnt as a side effect
12471 d_stdio_ptr_lval_sets_cnt="$undef"
12472 d_stdio_ptr_lval_nochange_cnt="$undef"
12473 case "$d_stdio_ptr_lval$d_stdstdio" in
12475 echo "Checking to see what happens if we set the stdio ptr..." >&4
12478 /* Can we scream? */
12479 /* Eat dust sed :-) */
12480 /* In the buffer space, no one can hear you scream. */
12481 #$i_stdlib I_STDLIB
12483 #include <stdlib.h>
12485 #define FILE_ptr(fp) $stdio_ptr
12486 #define FILE_cnt(fp) $stdio_cnt
12487 #include <sys/types.h>
12489 FILE *fp = fopen("try.c", "r");
12494 puts("Fail even to read");
12497 c = getc(fp); /* Read away the first # */
12499 puts("Fail even to read");
12503 18 <= FILE_cnt(fp) &&
12504 strncmp(FILE_ptr(fp), "include <stdio.h>\n", 18) == 0
12506 puts("Fail even to read");
12509 ptr = (char*) FILE_ptr(fp);
12510 cnt = (size_t)FILE_cnt(fp);
12512 FILE_ptr(fp) += 42;
12514 if ((char*)FILE_ptr(fp) != (ptr + 42)) {
12515 printf("Fail ptr check %p != %p", FILE_ptr(fp), (ptr + 42));
12518 if (FILE_cnt(fp) <= 20) {
12519 printf ("Fail (<20 chars to test)");
12522 if (strncmp(FILE_ptr(fp), "Eat dust sed :-) */\n", 20) != 0) {
12523 puts("Fail compare");
12526 if (cnt == FILE_cnt(fp)) {
12527 puts("Pass_unchanged");
12530 if (FILE_cnt(fp) == (cnt - 42)) {
12531 puts("Pass_changed");
12534 printf("Fail count was %d now %d\n", cnt, FILE_cnt(fp));
12540 if eval $compile && $to try.c; then
12541 case `$run ./try` in
12543 echo "Increasing ptr in your stdio decreases cnt by the same amount. Good." >&4
12544 d_stdio_ptr_lval_sets_cnt="$define" ;;
12546 echo "Increasing ptr in your stdio leaves cnt unchanged. Good." >&4
12547 d_stdio_ptr_lval_nochange_cnt="$define" ;;
12549 echo "Increasing ptr in your stdio didn't do exactly what I expected. We'll not be doing that then." >&4 ;;
12551 echo "It appears attempting to set ptr in your stdio is a bad plan." >&4 ;;
12554 echo "It seems we can't set ptr in your stdio. Nevermind." >&4
12560 : see if _base is also standard
12562 case "$d_stdstdio" in
12566 #$i_stdlib I_STDLIB
12568 #include <stdlib.h>
12570 #define FILE_base(fp) $stdio_base
12571 #define FILE_bufsiz(fp) $stdio_bufsiz
12573 FILE *fp = fopen("try.c", "r");
12576 19 <= FILE_bufsiz(fp) &&
12577 strncmp(FILE_base(fp), "#include <stdio.h>\n", 19) == 0
12584 if eval $compile && $to try.c; then
12585 if $run ./try; then
12586 echo "And its _base field acts std."
12589 echo "But its _base field isn't std."
12592 echo "However, it seems to be lacking the _base field."
12600 : see if fast_stdio exists
12602 case "$d_stdstdio:$d_stdio_ptr_lval" in
12604 case "$d_stdio_cnt_lval$d_stdio_ptr_lval_sets_cnt" in
12606 echo "You seem to have 'fast stdio' to directly manipulate the stdio buffers." >& 4
12617 : see if fchdir exists
12618 set fchdir d_fchdir
12621 : see if fchmod exists
12622 set fchmod d_fchmod
12625 : see if fchown exists
12626 set fchown d_fchown
12629 : see if this is an fcntl system
12634 : See if fcntl-based locking works.
12636 #$i_stdlib I_STDLIB
12638 #include <stdlib.h>
12640 #include <unistd.h>
12642 #include <signal.h>
12643 $signal_t blech(int x) { exit(3); }
12645 #if defined(F_SETLK) && defined(F_SETLKW)
12646 struct flock flock;
12648 fd = open("try.c", O_RDONLY);
12649 flock.l_type = F_RDLCK;
12650 flock.l_whence = SEEK_SET;
12651 flock.l_start = flock.l_len = 0;
12652 signal(SIGALRM, blech);
12654 retval = fcntl(fd, F_SETLK, &flock);
12656 (retval < 0 ? exit(2) : exit(0));
12662 echo "Checking if fcntl-based file locking works... "
12666 if eval $compile_ok; then
12667 if $run ./try; then
12668 echo "Yes, it seems to work."
12671 echo "Nope, it didn't work."
12676 *** I had to forcibly timeout from fcntl(..., F_SETLK, ...).
12677 *** This is (almost) impossible.
12678 *** If your NFS lock daemons are not feeling well, something like
12679 *** this may happen, please investigate. Cannot continue, aborting.
12687 echo "I'm unable to compile the test program, so I'll assume not."
12692 echo "Nope, since you don't even have fcntl()."
12695 set d_fcntl_can_lock
12700 : check for fd_set items
12703 Checking to see how well your C compiler handles fd_set and friends ...
12706 #$i_stdlib I_STDLIB
12708 #include <stdlib.h>
12710 #$i_systime I_SYS_TIME
12711 #$i_sysselct I_SYS_SELECT
12712 #$d_socket HAS_SOCKET
12713 #include <sys/types.h>
12715 #include <sys/socket.h> /* Might include <sys/bsdtypes.h> */
12718 #include <sys/time.h>
12720 #ifdef I_SYS_SELECT
12721 #include <sys/select.h>
12730 #if defined(FD_SET) && defined(FD_CLR) && defined(FD_ISSET) && defined(FD_ZERO)
12738 if eval $compile; then
12739 d_fds_bits="$define"
12741 echo "Well, your system knows about the normal fd_set typedef..." >&4
12742 if $run ./try; then
12743 echo "and you have the normal fd_set macros (just as I'd expect)." >&4
12744 d_fd_macros="$define"
12747 but not the normal fd_set macros! Gaaack! I'll have to cover for you.
12749 d_fd_macros="$undef"
12753 Hmm, your compiler has some difficulty with fd_set. Checking further...
12756 if eval $compile; then
12757 d_fds_bits="$undef"
12759 echo "Well, your system has some sort of fd_set available..." >&4
12760 if $run ./try; then
12761 echo "and you have the normal fd_set macros." >&4
12762 d_fd_macros="$define"
12765 but not the normal fd_set macros! Gross! More work for me...
12767 d_fd_macros="$undef"
12770 echo "Well, you got zip. That's OK, I can roll my own fd_set stuff." >&4
12772 d_fds_bits="$undef"
12773 d_fd_macros="$undef"
12778 : see if fgetpos exists
12779 set fgetpos d_fgetpos
12782 : see if finite exists
12783 set finite d_finite
12786 : see if finitel exists
12787 set finitel d_finitel
12790 : see if flock exists
12794 : see if prototype for flock is available
12796 set d_flockproto flock $i_sysfile sys/file.h
12799 : see if fork exists
12803 : see if fp_class exists
12804 set fp_class d_fp_class
12807 : see if pathconf exists
12808 set pathconf d_pathconf
12811 : see if fpathconf exists
12812 set fpathconf d_fpathconf
12815 : see if fpclass exists
12816 set fpclass d_fpclass
12819 : see if fpclassify exists
12820 set fpclassify d_fpclassify
12823 : see if fpclassl exists
12824 set fpclassl d_fpclassl
12828 : check for fpos64_t
12830 echo "Checking to see if you have fpos64_t..." >&4
12833 int main() { fpos64_t x = 7; }
12836 if eval $compile; then
12838 echo "You have fpos64_t."
12841 echo "You do not have fpos64_t."
12842 case "$fpossize" in
12843 8) echo "(Your fpos_t is 64 bits, so you could use that.)" ;;
12850 : see if frexpl exists
12851 set frexpl d_frexpl
12854 : see if this is a sys/param system
12855 set sys/param.h i_sysparam
12858 : see if this is a sys/mount.h system
12859 set sys/mount.h i_sysmount
12864 echo "Checking to see if your system supports struct fs_data..." >&4
12865 set d_fs_data_s fs_data $i_systypes sys/types.h $i_sysparam sys/param.h $i_sysmount sys/mount.h
12867 case "$d_fs_data_s" in
12868 "$define") echo "Yes, it does." ;;
12869 *) echo "No, it doesn't." ;;
12872 : see if fseeko exists
12873 set fseeko d_fseeko
12875 case "$longsize" in
12876 8) echo "(Your long is 64 bits, so you could use fseek.)" ;;
12879 : see if fsetpos exists
12880 set fsetpos d_fsetpos
12884 : see if fstatfs exists
12885 set fstatfs d_fstatfs
12889 : see if statvfs exists
12890 set statvfs d_statvfs
12893 : see if fstatvfs exists
12894 set fstatvfs d_fstatvfs
12898 : see if fsync exists
12902 : see if ftello exists
12903 set ftello d_ftello
12905 case "$longsize" in
12906 8) echo "(Your long is 64 bits, so you could use ftell.)" ;;
12910 : check for a working futimes
12912 echo "Checking for a working futimes()" >&4
12915 #include <sys/time.h>
12922 fd = open ("try.c", O_RDWR);
12923 if (-1 == fd) exit (1);
12924 rv = futimes (fd, NULL);
12925 exit (rv == -1 ? errno : 0);
12929 if eval $compile; then
12933 0) echo "Yes, it does" >&4
12934 d_futimes="$define"
12936 *) echo "No, it has futimes, but it isn't working ($rc) (probably harmless)\n" >&4
12940 echo "No, it does not (probably harmless)\n" >&4
12942 $rm -f try.* try core core.try.*
12944 : see if getcwd exists
12945 set getcwd d_getcwd
12948 : see if getespwnam exists
12949 set getespwnam d_getespwnam
12953 : see if getfsstat exists
12954 set getfsstat d_getfsstat
12957 : see if getgrent exists
12958 set getgrent d_getgrent
12961 : see if getgrent_r exists
12962 set getgrent_r d_getgrent_r
12964 case "$d_getgrent_r" in
12966 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
12967 case "$d_getgrent_r_proto:$usethreads" in
12968 ":define") d_getgrent_r_proto=define
12969 set d_getgrent_r_proto getgrent_r $hdrs
12973 case "$d_getgrent_r_proto" in
12975 case "$getgrent_r_proto" in
12976 ''|0) try='int getgrent_r(struct group*, char*, size_t, struct group**);'
12977 ./protochk "extern $try" $hdrs && getgrent_r_proto=I_SBWR ;;
12979 case "$getgrent_r_proto" in
12980 ''|0) try='int getgrent_r(struct group*, char*, int, struct group**);'
12981 ./protochk "extern $try" $hdrs && getgrent_r_proto=I_SBIR ;;
12983 case "$getgrent_r_proto" in
12984 ''|0) try='struct group* getgrent_r(struct group*, char*, size_t);'
12985 ./protochk "extern $try" $hdrs && getgrent_r_proto=S_SBW ;;
12987 case "$getgrent_r_proto" in
12988 ''|0) try='struct group* getgrent_r(struct group*, char*, int);'
12989 ./protochk "extern $try" $hdrs && getgrent_r_proto=S_SBI ;;
12991 case "$getgrent_r_proto" in
12992 ''|0) try='int getgrent_r(struct group*, char*, int);'
12993 ./protochk "extern $try" $hdrs && getgrent_r_proto=I_SBI ;;
12995 case "$getgrent_r_proto" in
12996 ''|0) try='int getgrent_r(struct group*, char*, int, FILE**);'
12997 ./protochk "extern $try" $hdrs && getgrent_r_proto=I_SBIH ;;
12999 case "$getgrent_r_proto" in
13000 ''|0) d_getgrent_r=undef
13002 echo "Disabling getgrent_r, cannot determine prototype." >&4 ;;
13003 * ) case "$getgrent_r_proto" in
13004 REENTRANT_PROTO*) ;;
13005 *) getgrent_r_proto="REENTRANT_PROTO_$getgrent_r_proto" ;;
13007 echo "Prototype: $try" ;;
13010 *) case "$usethreads" in
13011 define) echo "getgrent_r has no prototype, not using it." >&4 ;;
13018 *) getgrent_r_proto=0
13022 : see if getgrgid_r exists
13023 set getgrgid_r d_getgrgid_r
13025 case "$d_getgrgid_r" in
13027 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
13028 case "$d_getgrgid_r_proto:$usethreads" in
13029 ":define") d_getgrgid_r_proto=define
13030 set d_getgrgid_r_proto getgrgid_r $hdrs
13034 case "$d_getgrgid_r_proto" in
13036 case "$getgrgid_r_proto" in
13037 ''|0) try='int getgrgid_r(gid_t, struct group*, char*, size_t, struct group**);'
13038 ./protochk "extern $try" $hdrs && getgrgid_r_proto=I_TSBWR ;;
13040 case "$getgrgid_r_proto" in
13041 ''|0) try='int getgrgid_r(gid_t, struct group*, char*, int, struct group**);'
13042 ./protochk "extern $try" $hdrs && getgrgid_r_proto=I_TSBIR ;;
13044 case "$getgrgid_r_proto" in
13045 ''|0) try='int getgrgid_r(gid_t, struct group*, char*, int);'
13046 ./protochk "extern $try" $hdrs && getgrgid_r_proto=I_TSBI ;;
13048 case "$getgrgid_r_proto" in
13049 ''|0) try='struct group* getgrgid_r(gid_t, struct group*, char*, int);'
13050 ./protochk "extern $try" $hdrs && getgrgid_r_proto=S_TSBI ;;
13052 case "$getgrgid_r_proto" in
13053 ''|0) d_getgrgid_r=undef
13055 echo "Disabling getgrgid_r, cannot determine prototype." >&4 ;;
13056 * ) case "$getgrgid_r_proto" in
13057 REENTRANT_PROTO*) ;;
13058 *) getgrgid_r_proto="REENTRANT_PROTO_$getgrgid_r_proto" ;;
13060 echo "Prototype: $try" ;;
13063 *) case "$usethreads" in
13064 define) echo "getgrgid_r has no prototype, not using it." >&4 ;;
13071 *) getgrgid_r_proto=0
13075 : see if getgrnam_r exists
13076 set getgrnam_r d_getgrnam_r
13078 case "$d_getgrnam_r" in
13080 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
13081 case "$d_getgrnam_r_proto:$usethreads" in
13082 ":define") d_getgrnam_r_proto=define
13083 set d_getgrnam_r_proto getgrnam_r $hdrs
13087 case "$d_getgrnam_r_proto" in
13089 case "$getgrnam_r_proto" in
13090 ''|0) try='int getgrnam_r(const char*, struct group*, char*, size_t, struct group**);'
13091 ./protochk "extern $try" $hdrs && getgrnam_r_proto=I_CSBWR ;;
13093 case "$getgrnam_r_proto" in
13094 ''|0) try='int getgrnam_r(const char*, struct group*, char*, int, struct group**);'
13095 ./protochk "extern $try" $hdrs && getgrnam_r_proto=I_CSBIR ;;
13097 case "$getgrnam_r_proto" in
13098 ''|0) try='struct group* getgrnam_r(const char*, char*, int);'
13099 ./protochk "extern $try" $hdrs && getgrnam_r_proto=S_CBI ;;
13101 case "$getgrnam_r_proto" in
13102 ''|0) try='int getgrnam_r(const char*, struct group*, char*, int);'
13103 ./protochk "extern $try" $hdrs && getgrnam_r_proto=I_CSBI ;;
13105 case "$getgrnam_r_proto" in
13106 ''|0) try='struct group* getgrnam_r(const char*, struct group*, char*, int);'
13107 ./protochk "extern $try" $hdrs && getgrnam_r_proto=S_CSBI ;;
13109 case "$getgrnam_r_proto" in
13110 ''|0) d_getgrnam_r=undef
13112 echo "Disabling getgrnam_r, cannot determine prototype." >&4 ;;
13113 * ) case "$getgrnam_r_proto" in
13114 REENTRANT_PROTO*) ;;
13115 *) getgrnam_r_proto="REENTRANT_PROTO_$getgrnam_r_proto" ;;
13117 echo "Prototype: $try" ;;
13120 *) case "$usethreads" in
13121 define) echo "getgrnam_r has no prototype, not using it." >&4 ;;
13128 *) getgrnam_r_proto=0
13132 : see if gethostbyaddr exists
13133 set gethostbyaddr d_gethbyaddr
13136 : see if gethostbyname exists
13137 set gethostbyname d_gethbyname
13140 : see if gethostent exists
13141 set gethostent d_gethent
13144 : see how we will look up host name
13147 if set gethostname val -f d_gethname; eval $csym; $val; then
13148 echo 'gethostname() found.' >&4
13149 d_gethname="$define"
13152 if set uname val -f d_uname; eval $csym; $val; then
13155 uname() was found, but you're running xenix, and older versions of xenix
13156 have a broken uname(). If you don't really know whether your xenix is old
13157 enough to have a broken system call, use the default answer.
13162 "$define") dflt=n;;
13164 rp='Is your uname() broken?'
13167 n*) d_uname="$define"; call=uname;;
13170 echo 'uname() found.' >&4
13177 case "$d_gethname" in
13178 '') d_gethname="$undef";;
13181 '') d_uname="$undef";;
13183 case "$d_uname$d_gethname" in
13188 Every now and then someone has a $call() that lies about the hostname
13189 but can't be fixed for political or economic reasons. If you wish, I can
13190 pretend $call() isn't there and maybe compute hostname at run-time
13191 thanks to the '$phostname' command.
13194 rp="Shall I ignore $call() from now on?"
13197 y*) d_uname="$undef" d_gethname="$undef"; $echo $n "Okay...$c";;
13200 case "$phostname" in
13201 '') aphostname='';;
13202 *) case "$aphostname" in
13204 *) set X $phostname
13208 file=`./loc $file $file $pth`
13209 aphostname=`echo $file $*`
13214 case "$d_uname$d_gethname" in
13217 case "$phostname" in
13219 echo "There will be no way for $package to get your hostname." >&4;;
13221 echo "I'll use 'popen("'"'$aphostname'", "r")'"' to get your hostname." >&4
13225 case "$d_phostname" in
13226 '') d_phostname="$undef";;
13229 : see if gethostbyaddr_r exists
13230 set gethostbyaddr_r d_gethostbyaddr_r
13232 case "$d_gethostbyaddr_r" in
13234 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13235 case "$d_gethostbyaddr_r_proto:$usethreads" in
13236 ":define") d_gethostbyaddr_r_proto=define
13237 set d_gethostbyaddr_r_proto gethostbyaddr_r $hdrs
13241 case "$d_gethostbyaddr_r_proto" in
13243 case "$gethostbyaddr_r_proto" in
13244 ''|0) try='int gethostbyaddr_r(const char*, size_t, int, struct hostent*, char*, size_t, struct hostent**, int*);'
13245 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=I_CWISBWRE ;;
13247 case "$gethostbyaddr_r_proto" in
13248 ''|0) try='struct hostent* gethostbyaddr_r(const char*, size_t, int, struct hostent*, char*, size_t, int, int*);'
13249 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=S_CWISBWIE ;;
13251 case "$gethostbyaddr_r_proto" in
13252 ''|0) try='struct hostent* gethostbyaddr_r(const char*, size_t, int, struct hostent*, char*, int, int*);'
13253 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=S_CWISBIE ;;
13255 case "$gethostbyaddr_r_proto" in
13256 ''|0) try='struct hostent* gethostbyaddr_r(const void*, size_t, int, struct hostent*, char*, int, int*);'
13257 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=S_TWISBIE ;;
13259 case "$gethostbyaddr_r_proto" in
13260 ''|0) try='struct hostent* gethostbyaddr_r(const char*, int, int, struct hostent*, char*, int, int*);'
13261 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=S_CIISBIE ;;
13263 case "$gethostbyaddr_r_proto" in
13264 ''|0) try='struct hostent* gethostbyaddr_r(const char*, struct hostent*, char*, int, int*);'
13265 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=S_CSBIE ;;
13267 case "$gethostbyaddr_r_proto" in
13268 ''|0) try='struct hostent* gethostbyaddr_r(const void*, struct hostent*, char*, int, int*);'
13269 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=S_TSBIE ;;
13271 case "$gethostbyaddr_r_proto" in
13272 ''|0) try='int gethostbyaddr_r(const char*, size_t, int, struct hostent*, struct hostent_data*);'
13273 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=I_CWISD ;;
13275 case "$gethostbyaddr_r_proto" in
13276 ''|0) try='int gethostbyaddr_r(const char*, int, int, struct hostent*, struct hostent_data*);'
13277 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=I_CIISD ;;
13279 case "$gethostbyaddr_r_proto" in
13280 ''|0) try='int gethostbyaddr_r(const char*, int, int);'
13281 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=I_CII ;;
13283 case "$gethostbyaddr_r_proto" in
13284 ''|0) try='int gethostbyaddr_r(const void*, socklen_t, int, struct hostent*, char*, size_t, struct hostent**, int*);'
13285 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=I_TsISBWRE ;;
13287 case "$gethostbyaddr_r_proto" in
13288 ''|0) d_gethostbyaddr_r=undef
13289 gethostbyaddr_r_proto=0
13290 echo "Disabling gethostbyaddr_r, cannot determine prototype." >&4 ;;
13291 * ) case "$gethostbyaddr_r_proto" in
13292 REENTRANT_PROTO*) ;;
13293 *) gethostbyaddr_r_proto="REENTRANT_PROTO_$gethostbyaddr_r_proto" ;;
13295 echo "Prototype: $try" ;;
13298 *) case "$usethreads" in
13299 define) echo "gethostbyaddr_r has no prototype, not using it." >&4 ;;
13301 d_gethostbyaddr_r=undef
13302 gethostbyaddr_r_proto=0
13306 *) gethostbyaddr_r_proto=0
13310 : see if gethostbyname_r exists
13311 set gethostbyname_r d_gethostbyname_r
13313 case "$d_gethostbyname_r" in
13315 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13316 case "$d_gethostbyname_r_proto:$usethreads" in
13317 ":define") d_gethostbyname_r_proto=define
13318 set d_gethostbyname_r_proto gethostbyname_r $hdrs
13322 case "$d_gethostbyname_r_proto" in
13324 case "$gethostbyname_r_proto" in
13325 ''|0) try='int gethostbyname_r(const char*, struct hostent*, char*, size_t, struct hostent**, int*);'
13326 ./protochk "extern $try" $hdrs && gethostbyname_r_proto=I_CSBWRE ;;
13328 case "$gethostbyname_r_proto" in
13329 ''|0) try='struct hostent* gethostbyname_r(const char*, struct hostent*, char*, int, int*);'
13330 ./protochk "extern $try" $hdrs && gethostbyname_r_proto=S_CSBIE ;;
13332 case "$gethostbyname_r_proto" in
13333 ''|0) try='int gethostbyname_r(const char*, struct hostent*, struct hostent_data*);'
13334 ./protochk "extern $try" $hdrs && gethostbyname_r_proto=I_CSD ;;
13336 case "$gethostbyname_r_proto" in
13337 ''|0) d_gethostbyname_r=undef
13338 gethostbyname_r_proto=0
13339 echo "Disabling gethostbyname_r, cannot determine prototype." >&4 ;;
13340 * ) case "$gethostbyname_r_proto" in
13341 REENTRANT_PROTO*) ;;
13342 *) gethostbyname_r_proto="REENTRANT_PROTO_$gethostbyname_r_proto" ;;
13344 echo "Prototype: $try" ;;
13347 *) case "$usethreads" in
13348 define) echo "gethostbyname_r has no prototype, not using it." >&4 ;;
13350 d_gethostbyname_r=undef
13351 gethostbyname_r_proto=0
13355 *) gethostbyname_r_proto=0
13359 : see if gethostent_r exists
13360 set gethostent_r d_gethostent_r
13362 case "$d_gethostent_r" in
13364 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13365 case "$d_gethostent_r_proto:$usethreads" in
13366 ":define") d_gethostent_r_proto=define
13367 set d_gethostent_r_proto gethostent_r $hdrs
13371 case "$d_gethostent_r_proto" in
13373 case "$gethostent_r_proto" in
13374 ''|0) try='int gethostent_r(struct hostent*, char*, size_t, struct hostent**, int*);'
13375 ./protochk "extern $try" $hdrs && gethostent_r_proto=I_SBWRE ;;
13377 case "$gethostent_r_proto" in
13378 ''|0) try='int gethostent_r(struct hostent*, char*, int, int*);'
13379 ./protochk "extern $try" $hdrs && gethostent_r_proto=I_SBIE ;;
13381 case "$gethostent_r_proto" in
13382 ''|0) try='struct hostent* gethostent_r(struct hostent*, char*, int, int*);'
13383 ./protochk "extern $try" $hdrs && gethostent_r_proto=S_SBIE ;;
13385 case "$gethostent_r_proto" in
13386 ''|0) try='struct hostent* gethostent_r(struct hostent*, char*, int);'
13387 ./protochk "extern $try" $hdrs && gethostent_r_proto=S_SBI ;;
13389 case "$gethostent_r_proto" in
13390 ''|0) try='int gethostent_r(struct hostent*, char*, int);'
13391 ./protochk "extern $try" $hdrs && gethostent_r_proto=I_SBI ;;
13393 case "$gethostent_r_proto" in
13394 ''|0) try='int gethostent_r(struct hostent*, struct hostent_data*);'
13395 ./protochk "extern $try" $hdrs && gethostent_r_proto=I_SD ;;
13397 case "$gethostent_r_proto" in
13398 ''|0) d_gethostent_r=undef
13399 gethostent_r_proto=0
13400 echo "Disabling gethostent_r, cannot determine prototype." >&4 ;;
13401 * ) case "$gethostent_r_proto" in
13402 REENTRANT_PROTO*) ;;
13403 *) gethostent_r_proto="REENTRANT_PROTO_$gethostent_r_proto" ;;
13405 echo "Prototype: $try" ;;
13408 *) case "$usethreads" in
13409 define) echo "gethostent_r has no prototype, not using it." >&4 ;;
13411 d_gethostent_r=undef
13412 gethostent_r_proto=0
13416 *) gethostent_r_proto=0
13420 : see if prototypes for various gethostxxx netdb.h functions are available
13422 set d_gethostprotos gethostent $i_netdb netdb.h
13425 : see if getitimer exists
13426 set getitimer d_getitimer
13429 : see if getlogin exists
13430 set getlogin d_getlogin
13433 : see if getlogin_r exists
13434 set getlogin_r d_getlogin_r
13436 case "$d_getlogin_r" in
13438 hdrs="$i_systypes sys/types.h define stdio.h $i_unistd unistd.h"
13439 case "$d_getlogin_r_proto:$usethreads" in
13440 ":define") d_getlogin_r_proto=define
13441 set d_getlogin_r_proto getlogin_r $hdrs
13445 case "$d_getlogin_r_proto" in
13447 case "$getlogin_r_proto" in
13448 ''|0) try='int getlogin_r(char*, size_t);'
13449 ./protochk "extern $try" $hdrs && getlogin_r_proto=I_BW ;;
13451 case "$getlogin_r_proto" in
13452 ''|0) try='int getlogin_r(char*, int);'
13453 ./protochk "extern $try" $hdrs && getlogin_r_proto=I_BI ;;
13455 case "$getlogin_r_proto" in
13456 ''|0) try='char* getlogin_r(char*, size_t);'
13457 ./protochk "extern $try" $hdrs && getlogin_r_proto=B_BW ;;
13459 case "$getlogin_r_proto" in
13460 ''|0) try='char* getlogin_r(char*, int);'
13461 ./protochk "extern $try" $hdrs && getlogin_r_proto=B_BI ;;
13463 case "$getlogin_r_proto" in
13464 ''|0) d_getlogin_r=undef
13466 echo "Disabling getlogin_r, cannot determine prototype." >&4 ;;
13467 * ) case "$getlogin_r_proto" in
13468 REENTRANT_PROTO*) ;;
13469 *) getlogin_r_proto="REENTRANT_PROTO_$getlogin_r_proto" ;;
13471 echo "Prototype: $try" ;;
13474 *) case "$usethreads" in
13475 define) echo "getlogin_r has no prototype, not using it." >&4 ;;
13482 *) getlogin_r_proto=0
13486 : see if getmnt exists
13487 set getmnt d_getmnt
13490 : see if getmntent exists
13491 set getmntent d_getmntent
13494 : see if getnetbyaddr exists
13495 set getnetbyaddr d_getnbyaddr
13498 : see if getnetbyname exists
13499 set getnetbyname d_getnbyname
13502 : see if getnetent exists
13503 set getnetent d_getnent
13506 : see if getnetbyaddr_r exists
13507 set getnetbyaddr_r d_getnetbyaddr_r
13509 case "$d_getnetbyaddr_r" in
13511 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13512 case "$d_getnetbyaddr_r_proto:$usethreads" in
13513 ":define") d_getnetbyaddr_r_proto=define
13514 set d_getnetbyaddr_r_proto getnetbyaddr_r $hdrs
13518 case "$d_getnetbyaddr_r_proto" in
13520 case "$getnetbyaddr_r_proto" in
13521 ''|0) try='int getnetbyaddr_r(unsigned long, int, struct netent*, char*, size_t, struct netent**, int*);'
13522 ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=I_UISBWRE ;;
13524 case "$getnetbyaddr_r_proto" in
13525 ''|0) try='int getnetbyaddr_r(long, int, struct netent*, char*, int);'
13526 ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=I_LISBI ;;
13528 case "$getnetbyaddr_r_proto" in
13529 ''|0) try='struct netent* getnetbyaddr_r(in_addr_t, int, struct netent*, char*, int);'
13530 ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=S_TISBI ;;
13532 case "$getnetbyaddr_r_proto" in
13533 ''|0) try='struct netent* getnetbyaddr_r(long, int, struct netent*, char*, int);'
13534 ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=S_LISBI ;;
13536 case "$getnetbyaddr_r_proto" in
13537 ''|0) try='int getnetbyaddr_r(in_addr_t, int, struct netent*, struct netent_data*);'
13538 ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=I_TISD ;;
13540 case "$getnetbyaddr_r_proto" in
13541 ''|0) try='int getnetbyaddr_r(long, int, struct netent*, struct netent_data*);'
13542 ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=I_LISD ;;
13544 case "$getnetbyaddr_r_proto" in
13545 ''|0) try='int getnetbyaddr_r(int, int, struct netent*, struct netent_data*);'
13546 ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=I_IISD ;;
13548 case "$getnetbyaddr_r_proto" in
13549 ''|0) try='int getnetbyaddr_r(uint32_t, int, struct netent*, char*, size_t, struct netent**, int*);'
13550 ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=I_uISBWRE ;;
13552 case "$getnetbyaddr_r_proto" in
13553 ''|0) d_getnetbyaddr_r=undef
13554 getnetbyaddr_r_proto=0
13555 echo "Disabling getnetbyaddr_r, cannot determine prototype." >&4 ;;
13556 * ) case "$getnetbyaddr_r_proto" in
13557 REENTRANT_PROTO*) ;;
13558 *) getnetbyaddr_r_proto="REENTRANT_PROTO_$getnetbyaddr_r_proto" ;;
13560 echo "Prototype: $try" ;;
13563 *) case "$usethreads" in
13564 define) echo "getnetbyaddr_r has no prototype, not using it." >&4 ;;
13566 d_getnetbyaddr_r=undef
13567 getnetbyaddr_r_proto=0
13571 *) getnetbyaddr_r_proto=0
13575 : see if getnetbyname_r exists
13576 set getnetbyname_r d_getnetbyname_r
13578 case "$d_getnetbyname_r" in
13580 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13581 case "$d_getnetbyname_r_proto:$usethreads" in
13582 ":define") d_getnetbyname_r_proto=define
13583 set d_getnetbyname_r_proto getnetbyname_r $hdrs
13587 case "$d_getnetbyname_r_proto" in
13589 case "$getnetbyname_r_proto" in
13590 ''|0) try='int getnetbyname_r(const char*, struct netent*, char*, size_t, struct netent**, int*);'
13591 ./protochk "extern $try" $hdrs && getnetbyname_r_proto=I_CSBWRE ;;
13593 case "$getnetbyname_r_proto" in
13594 ''|0) try='int getnetbyname_r(const char*, struct netent*, char*, int);'
13595 ./protochk "extern $try" $hdrs && getnetbyname_r_proto=I_CSBI ;;
13597 case "$getnetbyname_r_proto" in
13598 ''|0) try='struct netent* getnetbyname_r(const char*, struct netent*, char*, int);'
13599 ./protochk "extern $try" $hdrs && getnetbyname_r_proto=S_CSBI ;;
13601 case "$getnetbyname_r_proto" in
13602 ''|0) try='int getnetbyname_r(const char*, struct netent*, struct netent_data*);'
13603 ./protochk "extern $try" $hdrs && getnetbyname_r_proto=I_CSD ;;
13605 case "$getnetbyname_r_proto" in
13606 ''|0) d_getnetbyname_r=undef
13607 getnetbyname_r_proto=0
13608 echo "Disabling getnetbyname_r, cannot determine prototype." >&4 ;;
13609 * ) case "$getnetbyname_r_proto" in
13610 REENTRANT_PROTO*) ;;
13611 *) getnetbyname_r_proto="REENTRANT_PROTO_$getnetbyname_r_proto" ;;
13613 echo "Prototype: $try" ;;
13616 *) case "$usethreads" in
13617 define) echo "getnetbyname_r has no prototype, not using it." >&4 ;;
13619 d_getnetbyname_r=undef
13620 getnetbyname_r_proto=0
13624 *) getnetbyname_r_proto=0
13628 : see if getnetent_r exists
13629 set getnetent_r d_getnetent_r
13631 case "$d_getnetent_r" in
13633 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13634 case "$d_getnetent_r_proto:$usethreads" in
13635 ":define") d_getnetent_r_proto=define
13636 set d_getnetent_r_proto getnetent_r $hdrs
13640 case "$d_getnetent_r_proto" in
13642 case "$getnetent_r_proto" in
13643 ''|0) try='int getnetent_r(struct netent*, char*, size_t, struct netent**, int*);'
13644 ./protochk "extern $try" $hdrs && getnetent_r_proto=I_SBWRE ;;
13646 case "$getnetent_r_proto" in
13647 ''|0) try='int getnetent_r(struct netent*, char*, int, int*);'
13648 ./protochk "extern $try" $hdrs && getnetent_r_proto=I_SBIE ;;
13650 case "$getnetent_r_proto" in
13651 ''|0) try='struct netent* getnetent_r(struct netent*, char*, int, int*);'
13652 ./protochk "extern $try" $hdrs && getnetent_r_proto=S_SBIE ;;
13654 case "$getnetent_r_proto" in
13655 ''|0) try='struct netent* getnetent_r(struct netent*, char*, int);'
13656 ./protochk "extern $try" $hdrs && getnetent_r_proto=S_SBI ;;
13658 case "$getnetent_r_proto" in
13659 ''|0) try='int getnetent_r(struct netent*, char*, int);'
13660 ./protochk "extern $try" $hdrs && getnetent_r_proto=I_SBI ;;
13662 case "$getnetent_r_proto" in
13663 ''|0) try='int getnetent_r(struct netent*, struct netent_data*);'
13664 ./protochk "extern $try" $hdrs && getnetent_r_proto=I_SD ;;
13666 case "$getnetent_r_proto" in
13667 ''|0) d_getnetent_r=undef
13668 getnetent_r_proto=0
13669 echo "Disabling getnetent_r, cannot determine prototype." >&4 ;;
13670 * ) case "$getnetent_r_proto" in
13671 REENTRANT_PROTO*) ;;
13672 *) getnetent_r_proto="REENTRANT_PROTO_$getnetent_r_proto" ;;
13674 echo "Prototype: $try" ;;
13677 *) case "$usethreads" in
13678 define) echo "getnetent_r has no prototype, not using it." >&4 ;;
13680 d_getnetent_r=undef
13681 getnetent_r_proto=0
13685 *) getnetent_r_proto=0
13689 : see if prototypes for various getnetxxx netdb.h functions are available
13691 set d_getnetprotos getnetent $i_netdb netdb.h
13694 : see if getpagesize exists
13695 set getpagesize d_getpagsz
13699 : see if getprotobyname exists
13700 set getprotobyname d_getpbyname
13703 : see if getprotobynumber exists
13704 set getprotobynumber d_getpbynumber
13707 : see if getprotoent exists
13708 set getprotoent d_getpent
13711 : see if getpgid exists
13712 set getpgid d_getpgid
13715 : see if getpgrp2 exists
13716 set getpgrp2 d_getpgrp2
13719 : see if getppid exists
13720 set getppid d_getppid
13723 : see if getpriority exists
13724 set getpriority d_getprior
13727 : see if getprotobyname_r exists
13728 set getprotobyname_r d_getprotobyname_r
13730 case "$d_getprotobyname_r" in
13732 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13733 case "$d_getprotobyname_r_proto:$usethreads" in
13734 ":define") d_getprotobyname_r_proto=define
13735 set d_getprotobyname_r_proto getprotobyname_r $hdrs
13739 case "$d_getprotobyname_r_proto" in
13741 case "$getprotobyname_r_proto" in
13742 ''|0) try='int getprotobyname_r(const char*, struct protoent*, char*, size_t, struct protoent**);'
13743 ./protochk "extern $try" $hdrs && getprotobyname_r_proto=I_CSBWR ;;
13745 case "$getprotobyname_r_proto" in
13746 ''|0) try='struct protoent* getprotobyname_r(const char*, struct protoent*, char*, int);'
13747 ./protochk "extern $try" $hdrs && getprotobyname_r_proto=S_CSBI ;;
13749 case "$getprotobyname_r_proto" in
13750 ''|0) try='int getprotobyname_r(const char*, struct protoent*, struct protoent_data*);'
13751 ./protochk "extern $try" $hdrs && getprotobyname_r_proto=I_CSD ;;
13753 case "$getprotobyname_r_proto" in
13754 ''|0) d_getprotobyname_r=undef
13755 getprotobyname_r_proto=0
13756 echo "Disabling getprotobyname_r, cannot determine prototype." >&4 ;;
13757 * ) case "$getprotobyname_r_proto" in
13758 REENTRANT_PROTO*) ;;
13759 *) getprotobyname_r_proto="REENTRANT_PROTO_$getprotobyname_r_proto" ;;
13761 echo "Prototype: $try" ;;
13764 *) case "$usethreads" in
13765 define) echo "getprotobyname_r has no prototype, not using it." >&4 ;;
13767 d_getprotobyname_r=undef
13768 getprotobyname_r_proto=0
13772 *) getprotobyname_r_proto=0
13776 : see if getprotobynumber_r exists
13777 set getprotobynumber_r d_getprotobynumber_r
13779 case "$d_getprotobynumber_r" in
13781 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13782 case "$d_getprotobynumber_r_proto:$usethreads" in
13783 ":define") d_getprotobynumber_r_proto=define
13784 set d_getprotobynumber_r_proto getprotobynumber_r $hdrs
13788 case "$d_getprotobynumber_r_proto" in
13790 case "$getprotobynumber_r_proto" in
13791 ''|0) try='int getprotobynumber_r(int, struct protoent*, char*, size_t, struct protoent**);'
13792 ./protochk "extern $try" $hdrs && getprotobynumber_r_proto=I_ISBWR ;;
13794 case "$getprotobynumber_r_proto" in
13795 ''|0) try='struct protoent* getprotobynumber_r(int, struct protoent*, char*, int);'
13796 ./protochk "extern $try" $hdrs && getprotobynumber_r_proto=S_ISBI ;;
13798 case "$getprotobynumber_r_proto" in
13799 ''|0) try='int getprotobynumber_r(int, struct protoent*, struct protoent_data*);'
13800 ./protochk "extern $try" $hdrs && getprotobynumber_r_proto=I_ISD ;;
13802 case "$getprotobynumber_r_proto" in
13803 ''|0) d_getprotobynumber_r=undef
13804 getprotobynumber_r_proto=0
13805 echo "Disabling getprotobynumber_r, cannot determine prototype." >&4 ;;
13806 * ) case "$getprotobynumber_r_proto" in
13807 REENTRANT_PROTO*) ;;
13808 *) getprotobynumber_r_proto="REENTRANT_PROTO_$getprotobynumber_r_proto" ;;
13810 echo "Prototype: $try" ;;
13813 *) case "$usethreads" in
13814 define) echo "getprotobynumber_r has no prototype, not using it." >&4 ;;
13816 d_getprotobynumber_r=undef
13817 getprotobynumber_r_proto=0
13821 *) getprotobynumber_r_proto=0
13825 : see if getprotoent_r exists
13826 set getprotoent_r d_getprotoent_r
13828 case "$d_getprotoent_r" in
13830 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13831 case "$d_getprotoent_r_proto:$usethreads" in
13832 ":define") d_getprotoent_r_proto=define
13833 set d_getprotoent_r_proto getprotoent_r $hdrs
13837 case "$d_getprotoent_r_proto" in
13839 case "$getprotoent_r_proto" in
13840 ''|0) try='int getprotoent_r(struct protoent*, char*, size_t, struct protoent**);'
13841 ./protochk "extern $try" $hdrs && getprotoent_r_proto=I_SBWR ;;
13843 case "$getprotoent_r_proto" in
13844 ''|0) try='int getprotoent_r(struct protoent*, char*, int);'
13845 ./protochk "extern $try" $hdrs && getprotoent_r_proto=I_SBI ;;
13847 case "$getprotoent_r_proto" in
13848 ''|0) try='struct protoent* getprotoent_r(struct protoent*, char*, int);'
13849 ./protochk "extern $try" $hdrs && getprotoent_r_proto=S_SBI ;;
13851 case "$getprotoent_r_proto" in
13852 ''|0) try='int getprotoent_r(struct protoent*, struct protoent_data*);'
13853 ./protochk "extern $try" $hdrs && getprotoent_r_proto=I_SD ;;
13855 case "$getprotoent_r_proto" in
13856 ''|0) d_getprotoent_r=undef
13857 getprotoent_r_proto=0
13858 echo "Disabling getprotoent_r, cannot determine prototype." >&4 ;;
13859 * ) case "$getprotoent_r_proto" in
13860 REENTRANT_PROTO*) ;;
13861 *) getprotoent_r_proto="REENTRANT_PROTO_$getprotoent_r_proto" ;;
13863 echo "Prototype: $try" ;;
13866 *) case "$usethreads" in
13867 define) echo "getprotoent_r has no prototype, not using it." >&4 ;;
13869 d_getprotoent_r=undef
13870 getprotoent_r_proto=0
13874 *) getprotoent_r_proto=0
13878 : see if prototypes for various getprotoxxx netdb.h functions are available
13880 set d_getprotoprotos getprotoent $i_netdb netdb.h
13883 : see if getprpwnam exists
13884 set getprpwnam d_getprpwnam
13887 : see if getpwent exists
13888 set getpwent d_getpwent
13891 : see if getpwent_r exists
13892 set getpwent_r d_getpwent_r
13894 case "$d_getpwent_r" in
13896 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
13897 case "$d_getpwent_r_proto:$usethreads" in
13898 ":define") d_getpwent_r_proto=define
13899 set d_getpwent_r_proto getpwent_r $hdrs
13903 case "$d_getpwent_r_proto" in
13905 case "$getpwent_r_proto" in
13906 ''|0) try='int getpwent_r(struct passwd*, char*, size_t, struct passwd**);'
13907 ./protochk "extern $try" $hdrs && getpwent_r_proto=I_SBWR ;;
13909 case "$getpwent_r_proto" in
13910 ''|0) try='int getpwent_r(struct passwd*, char*, int, struct passwd**);'
13911 ./protochk "extern $try" $hdrs && getpwent_r_proto=I_SBIR ;;
13913 case "$getpwent_r_proto" in
13914 ''|0) try='struct passwd* getpwent_r(struct passwd*, char*, size_t);'
13915 ./protochk "extern $try" $hdrs && getpwent_r_proto=S_SBW ;;
13917 case "$getpwent_r_proto" in
13918 ''|0) try='struct passwd* getpwent_r(struct passwd*, char*, int);'
13919 ./protochk "extern $try" $hdrs && getpwent_r_proto=S_SBI ;;
13921 case "$getpwent_r_proto" in
13922 ''|0) try='int getpwent_r(struct passwd*, char*, int);'
13923 ./protochk "extern $try" $hdrs && getpwent_r_proto=I_SBI ;;
13925 case "$getpwent_r_proto" in
13926 ''|0) try='int getpwent_r(struct passwd*, char*, int, FILE**);'
13927 ./protochk "extern $try" $hdrs && getpwent_r_proto=I_SBIH ;;
13929 case "$getpwent_r_proto" in
13930 ''|0) d_getpwent_r=undef
13932 echo "Disabling getpwent_r, cannot determine prototype." >&4 ;;
13933 * ) case "$getpwent_r_proto" in
13934 REENTRANT_PROTO*) ;;
13935 *) getpwent_r_proto="REENTRANT_PROTO_$getpwent_r_proto" ;;
13937 echo "Prototype: $try" ;;
13940 *) case "$usethreads" in
13941 define) echo "getpwent_r has no prototype, not using it." >&4 ;;
13948 *) getpwent_r_proto=0
13952 : see if getpwnam_r exists
13953 set getpwnam_r d_getpwnam_r
13955 case "$d_getpwnam_r" in
13957 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
13958 case "$d_getpwnam_r_proto:$usethreads" in
13959 ":define") d_getpwnam_r_proto=define
13960 set d_getpwnam_r_proto getpwnam_r $hdrs
13964 case "$d_getpwnam_r_proto" in
13966 case "$getpwnam_r_proto" in
13967 ''|0) try='int getpwnam_r(const char*, struct passwd*, char*, size_t, struct passwd**);'
13968 ./protochk "extern $try" $hdrs && getpwnam_r_proto=I_CSBWR ;;
13970 case "$getpwnam_r_proto" in
13971 ''|0) try='int getpwnam_r(const char*, struct passwd*, char*, int, struct passwd**);'
13972 ./protochk "extern $try" $hdrs && getpwnam_r_proto=I_CSBIR ;;
13974 case "$getpwnam_r_proto" in
13975 ''|0) try='struct passwd* getpwnam_r(const char*, struct passwd*, char*, int);'
13976 ./protochk "extern $try" $hdrs && getpwnam_r_proto=S_CSBI ;;
13978 case "$getpwnam_r_proto" in
13979 ''|0) try='int getpwnam_r(const char*, struct passwd*, char*, int);'
13980 ./protochk "extern $try" $hdrs && getpwnam_r_proto=I_CSBI ;;
13982 case "$getpwnam_r_proto" in
13983 ''|0) d_getpwnam_r=undef
13985 echo "Disabling getpwnam_r, cannot determine prototype." >&4 ;;
13986 * ) case "$getpwnam_r_proto" in
13987 REENTRANT_PROTO*) ;;
13988 *) getpwnam_r_proto="REENTRANT_PROTO_$getpwnam_r_proto" ;;
13990 echo "Prototype: $try" ;;
13993 *) case "$usethreads" in
13994 define) echo "getpwnam_r has no prototype, not using it." >&4 ;;
14001 *) getpwnam_r_proto=0
14005 : see if getpwuid_r exists
14006 set getpwuid_r d_getpwuid_r
14008 case "$d_getpwuid_r" in
14010 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
14011 case "$d_getpwuid_r_proto:$usethreads" in
14012 ":define") d_getpwuid_r_proto=define
14013 set d_getpwuid_r_proto getpwuid_r $hdrs
14017 case "$d_getpwuid_r_proto" in
14019 case "$getpwuid_r_proto" in
14020 ''|0) try='int getpwuid_r(uid_t, struct passwd*, char*, size_t, struct passwd**);'
14021 ./protochk "extern $try" $hdrs && getpwuid_r_proto=I_TSBWR ;;
14023 case "$getpwuid_r_proto" in
14024 ''|0) try='int getpwuid_r(uid_t, struct passwd*, char*, int, struct passwd**);'
14025 ./protochk "extern $try" $hdrs && getpwuid_r_proto=I_TSBIR ;;
14027 case "$getpwuid_r_proto" in
14028 ''|0) try='int getpwuid_r(uid_t, struct passwd*, char*, int);'
14029 ./protochk "extern $try" $hdrs && getpwuid_r_proto=I_TSBI ;;
14031 case "$getpwuid_r_proto" in
14032 ''|0) try='struct passwd* getpwuid_r(uid_t, struct passwd*, char*, int);'
14033 ./protochk "extern $try" $hdrs && getpwuid_r_proto=S_TSBI ;;
14035 case "$getpwuid_r_proto" in
14036 ''|0) d_getpwuid_r=undef
14038 echo "Disabling getpwuid_r, cannot determine prototype." >&4 ;;
14039 * ) case "$getpwuid_r_proto" in
14040 REENTRANT_PROTO*) ;;
14041 *) getpwuid_r_proto="REENTRANT_PROTO_$getpwuid_r_proto" ;;
14043 echo "Prototype: $try" ;;
14046 *) case "$usethreads" in
14047 define) echo "getpwuid_r has no prototype, not using it." >&4 ;;
14054 *) getpwuid_r_proto=0
14059 : see if getservbyname exists
14060 set getservbyname d_getsbyname
14063 : see if getservbyport exists
14064 set getservbyport d_getsbyport
14067 : see if getservent exists
14068 set getservent d_getsent
14071 : see if getservbyname_r exists
14072 set getservbyname_r d_getservbyname_r
14074 case "$d_getservbyname_r" in
14076 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14077 case "$d_getservbyname_r_proto:$usethreads" in
14078 ":define") d_getservbyname_r_proto=define
14079 set d_getservbyname_r_proto getservbyname_r $hdrs
14083 case "$d_getservbyname_r_proto" in
14085 case "$getservbyname_r_proto" in
14086 ''|0) try='int getservbyname_r(const char*, const char*, struct servent*, char*, size_t, struct servent**);'
14087 ./protochk "extern $try" $hdrs && getservbyname_r_proto=I_CCSBWR ;;
14089 case "$getservbyname_r_proto" in
14090 ''|0) try='struct servent* getservbyname_r(const char*, const char*, struct servent*, char*, int);'
14091 ./protochk "extern $try" $hdrs && getservbyname_r_proto=S_CCSBI ;;
14093 case "$getservbyname_r_proto" in
14094 ''|0) try='int getservbyname_r(const char*, const char*, struct servent*, struct servent_data*);'
14095 ./protochk "extern $try" $hdrs && getservbyname_r_proto=I_CCSD ;;
14097 case "$getservbyname_r_proto" in
14098 ''|0) d_getservbyname_r=undef
14099 getservbyname_r_proto=0
14100 echo "Disabling getservbyname_r, cannot determine prototype." >&4 ;;
14101 * ) case "$getservbyname_r_proto" in
14102 REENTRANT_PROTO*) ;;
14103 *) getservbyname_r_proto="REENTRANT_PROTO_$getservbyname_r_proto" ;;
14105 echo "Prototype: $try" ;;
14108 *) case "$usethreads" in
14109 define) echo "getservbyname_r has no prototype, not using it." >&4 ;;
14111 d_getservbyname_r=undef
14112 getservbyname_r_proto=0
14116 *) getservbyname_r_proto=0
14120 : see if getservbyport_r exists
14121 set getservbyport_r d_getservbyport_r
14123 case "$d_getservbyport_r" in
14125 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14126 case "$d_getservbyport_r_proto:$usethreads" in
14127 ":define") d_getservbyport_r_proto=define
14128 set d_getservbyport_r_proto getservbyport_r $hdrs
14132 case "$d_getservbyport_r_proto" in
14134 case "$getservbyport_r_proto" in
14135 ''|0) try='int getservbyport_r(int, const char*, struct servent*, char*, size_t, struct servent**);'
14136 ./protochk "extern $try" $hdrs && getservbyport_r_proto=I_ICSBWR ;;
14138 case "$getservbyport_r_proto" in
14139 ''|0) try='struct servent* getservbyport_r(int, const char*, struct servent*, char*, int);'
14140 ./protochk "extern $try" $hdrs && getservbyport_r_proto=S_ICSBI ;;
14142 case "$getservbyport_r_proto" in
14143 ''|0) try='int getservbyport_r(int, const char*, struct servent*, struct servent_data*);'
14144 ./protochk "extern $try" $hdrs && getservbyport_r_proto=I_ICSD ;;
14146 case "$getservbyport_r_proto" in
14147 ''|0) d_getservbyport_r=undef
14148 getservbyport_r_proto=0
14149 echo "Disabling getservbyport_r, cannot determine prototype." >&4 ;;
14150 * ) case "$getservbyport_r_proto" in
14151 REENTRANT_PROTO*) ;;
14152 *) getservbyport_r_proto="REENTRANT_PROTO_$getservbyport_r_proto" ;;
14154 echo "Prototype: $try" ;;
14157 *) case "$usethreads" in
14158 define) echo "getservbyport_r has no prototype, not using it." >&4 ;;
14160 d_getservbyport_r=undef
14161 getservbyport_r_proto=0
14165 *) getservbyport_r_proto=0
14169 : see if getservent_r exists
14170 set getservent_r d_getservent_r
14172 case "$d_getservent_r" in
14174 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14175 case "$d_getservent_r_proto:$usethreads" in
14176 ":define") d_getservent_r_proto=define
14177 set d_getservent_r_proto getservent_r $hdrs
14181 case "$d_getservent_r_proto" in
14183 case "$getservent_r_proto" in
14184 ''|0) try='int getservent_r(struct servent*, char*, size_t, struct servent**);'
14185 ./protochk "extern $try" $hdrs && getservent_r_proto=I_SBWR ;;
14187 case "$getservent_r_proto" in
14188 ''|0) try='int getservent_r(struct servent*, char*, int);'
14189 ./protochk "extern $try" $hdrs && getservent_r_proto=I_SBI ;;
14191 case "$getservent_r_proto" in
14192 ''|0) try='struct servent* getservent_r(struct servent*, char*, int);'
14193 ./protochk "extern $try" $hdrs && getservent_r_proto=S_SBI ;;
14195 case "$getservent_r_proto" in
14196 ''|0) try='int getservent_r(struct servent*, struct servent_data*);'
14197 ./protochk "extern $try" $hdrs && getservent_r_proto=I_SD ;;
14199 case "$getservent_r_proto" in
14200 ''|0) d_getservent_r=undef
14201 getservent_r_proto=0
14202 echo "Disabling getservent_r, cannot determine prototype." >&4 ;;
14203 * ) case "$getservent_r_proto" in
14204 REENTRANT_PROTO*) ;;
14205 *) getservent_r_proto="REENTRANT_PROTO_$getservent_r_proto" ;;
14207 echo "Prototype: $try" ;;
14210 *) case "$usethreads" in
14211 define) echo "getservent_r has no prototype, not using it." >&4 ;;
14213 d_getservent_r=undef
14214 getservent_r_proto=0
14218 *) getservent_r_proto=0
14222 : see if prototypes for various getservxxx netdb.h functions are available
14224 set d_getservprotos getservent $i_netdb netdb.h
14227 : see if getspnam exists
14228 set getspnam d_getspnam
14231 : see if this is a shadow.h system
14232 set shadow.h i_shadow
14235 : see if getspnam_r exists
14236 set getspnam_r d_getspnam_r
14238 case "$d_getspnam_r" in
14240 hdrs="$i_systypes sys/types.h define stdio.h $i_shadow shadow.h"
14241 case "$d_getspnam_r_proto:$usethreads" in
14242 ":define") d_getspnam_r_proto=define
14243 set d_getspnam_r_proto getspnam_r $hdrs
14247 case "$d_getspnam_r_proto" in
14249 case "$getspnam_r_proto" in
14250 ''|0) try='int getspnam_r(const char*, struct spwd*, char*, size_t, struct spwd**);'
14251 ./protochk "extern $try" $hdrs && getspnam_r_proto=I_CSBWR ;;
14253 case "$getspnam_r_proto" in
14254 ''|0) try='struct spwd* getspnam_r(const char*, struct spwd*, char*, int);'
14255 ./protochk "extern $try" $hdrs && getspnam_r_proto=S_CSBI ;;
14257 case "$getspnam_r_proto" in
14258 ''|0) d_getspnam_r=undef
14260 echo "Disabling getspnam_r, cannot determine prototype." >&4 ;;
14261 * ) case "$getspnam_r_proto" in
14262 REENTRANT_PROTO*) ;;
14263 *) getspnam_r_proto="REENTRANT_PROTO_$getspnam_r_proto" ;;
14265 echo "Prototype: $try" ;;
14268 *) case "$usethreads" in
14269 define) echo "getspnam_r has no prototype, not using it." >&4 ;;
14276 *) getspnam_r_proto=0
14280 : see if gettimeofday or ftime exists
14281 set gettimeofday d_gettimeod
14283 case "$d_gettimeod" in
14289 val="$undef"; set d_ftime; eval $setvar
14292 case "$d_gettimeod$d_ftime" in
14295 echo 'No ftime() nor gettimeofday() -- timing may be less accurate.' >&4
14299 : see if gmtime_r exists
14300 set gmtime_r d_gmtime_r
14302 case "$d_gmtime_r" in
14304 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
14305 case "$d_gmtime_r_proto:$usethreads" in
14306 ":define") d_gmtime_r_proto=define
14307 set d_gmtime_r_proto gmtime_r $hdrs
14311 case "$d_gmtime_r_proto" in
14313 case "$gmtime_r_proto" in
14314 ''|0) try='struct tm* gmtime_r(const time_t*, struct tm*);'
14315 ./protochk "extern $try" $hdrs && gmtime_r_proto=S_TS ;;
14317 case "$gmtime_r_proto" in
14318 ''|0) try='int gmtime_r(const time_t*, struct tm*);'
14319 ./protochk "extern $try" $hdrs && gmtime_r_proto=I_TS ;;
14321 case "$gmtime_r_proto" in
14322 ''|0) d_gmtime_r=undef
14324 echo "Disabling gmtime_r, cannot determine prototype." >&4 ;;
14325 * ) case "$gmtime_r_proto" in
14326 REENTRANT_PROTO*) ;;
14327 *) gmtime_r_proto="REENTRANT_PROTO_$gmtime_r_proto" ;;
14329 echo "Prototype: $try" ;;
14332 *) case "$usethreads" in
14333 define) echo "gmtime_r has no prototype, not using it." >&4 ;;
14340 *) gmtime_r_proto=0
14344 : see if hasmntopt exists
14345 set hasmntopt d_hasmntopt
14348 : see if this is a netinet/in.h or sys/in.h system
14349 set netinet/in.h i_niin sys/in.h i_sysin
14352 : see if arpa/inet.h has to be included
14353 set arpa/inet.h i_arpainet
14356 : see if htonl --and friends-- exists
14361 : Maybe they are macros.
14364 $cat >htonl.c <<EOM
14366 #include <sys/types.h>
14367 #$i_niin I_NETINET_IN
14369 #$i_arpainet I_ARPA_INET
14370 #ifdef I_NETINET_IN
14371 #include <netinet/in.h>
14374 #include <sys/in.h>
14377 #include <arpa/inet.h>
14380 printf("Defined as a macro.");
14383 $cppstdin $cppflags $cppminus < htonl.c >htonl.E 2>/dev/null
14384 if $contains 'Defined as a macro' htonl.E >/dev/null 2>&1; then
14386 echo "But it seems to be defined as a macro." >&4
14394 : see if ilogbl exists
14395 set ilogbl d_ilogbl
14400 if set index val -f; eval $csym; $val; then
14401 if set strchr val -f d_strchr; eval $csym; $val; then
14402 if $contains strchr "$strings" >/dev/null 2>&1 ; then
14405 echo "strchr() found." >&4
14409 echo "index() found." >&4
14414 echo "index() found." >&4
14417 if set strchr val -f d_strchr; eval $csym; $val; then
14420 echo "strchr() found." >&4
14422 echo "No index() or strchr() found!" >&4
14427 set d_strchr; eval $setvar
14429 set d_index; eval $setvar
14431 : check whether inet_aton exists
14432 set inet_aton d_inetaton
14437 $cat >isascii.c <<EOCP
14440 #$i_stdlib I_STDLIB
14442 #include <stdlib.h>
14453 if eval $compile; then
14454 echo "isascii() found." >&4
14457 echo "isascii() NOT found." >&4
14464 : see if isfinite exists
14465 set isfinite d_isfinite
14468 : see if isinf exists
14472 : see if isnan exists
14476 : see if isnanl exists
14477 set isnanl d_isnanl
14480 : see if killpg exists
14481 set killpg d_killpg
14484 : see if lchown exists
14486 $cat > try.c <<'EOCP'
14487 /* System header to define __stub macros and hopefully few prototypes,
14488 which can conflict with char lchown(); below. */
14489 #include <assert.h>
14490 /* Override any gcc2 internal prototype to avoid an error. */
14491 /* We use char because int might match the return type of a gcc2
14492 builtin and then its argument prototype would still apply. */
14495 /* The GNU C library defines this for functions which it implements
14496 to always fail with ENOSYS. Some functions are actually named
14497 something starting with __ and the normal name is an alias. */
14498 #if defined (__stub_lchown) || defined (__stub___lchown)
14506 if eval $compile; then
14507 $echo "lchown() found." >&4
14510 $echo "lchown() NOT found." >&4
14516 : See if number of significant digits in a double precision number is known
14518 $cat >ldbl_dig.c <<EOM
14519 #$i_limits I_LIMITS
14522 #include <limits.h>
14528 printf("Contains LDBL_DIG");
14531 $cppstdin $cppflags $cppminus < ldbl_dig.c >ldbl_dig.E 2>/dev/null
14532 if $contains 'LDBL_DIG' ldbl_dig.E >/dev/null 2>&1; then
14533 echo "LDBL_DIG found." >&4
14536 echo "LDBL_DIG NOT found." >&4
14543 : see if this is a math.h system
14547 d_libm_lib_version="$undef"
14550 : check to see if math.h defines _LIB_VERSION
14552 echo "Checking to see if your libm supports _LIB_VERSION..." >&4
14554 #include <unistd.h>
14556 int main (int argc, char *argv[])
14558 printf ("%d\n", _LIB_VERSION);
14563 if eval $compile; then
14565 echo "Yes, it does ($foo)" >&4
14566 d_libm_lib_version="$define"
14568 echo "No, it does not (probably harmless)\n" >&4
14570 $rm -f try.* try core core.try.*
14575 : see if link exists
14579 : see if localtime_r exists
14580 set localtime_r d_localtime_r
14582 case "$d_localtime_r" in
14584 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
14585 case "$d_localtime_r_proto:$usethreads" in
14586 ":define") d_localtime_r_proto=define
14587 set d_localtime_r_proto localtime_r $hdrs
14591 case "$d_localtime_r_proto" in
14593 case "$localtime_r_proto" in
14594 ''|0) try='struct tm* localtime_r(const time_t*, struct tm*);'
14595 ./protochk "extern $try" $hdrs && localtime_r_proto=S_TS ;;
14597 case "$localtime_r_proto" in
14598 ''|0) try='int localtime_r(const time_t*, struct tm*);'
14599 ./protochk "extern $try" $hdrs && localtime_r_proto=I_TS ;;
14601 case "$localtime_r_proto" in
14602 ''|0) d_localtime_r=undef
14603 localtime_r_proto=0
14604 echo "Disabling localtime_r, cannot determine prototype." >&4 ;;
14605 * ) case "$localtime_r_proto" in
14606 REENTRANT_PROTO*) ;;
14607 *) localtime_r_proto="REENTRANT_PROTO_$localtime_r_proto" ;;
14609 echo "Prototype: $try" ;;
14612 *) case "$usethreads" in
14613 define) echo "localtime_r has no prototype, not using it." >&4 ;;
14615 d_localtime_r=undef
14616 localtime_r_proto=0
14620 *) localtime_r_proto=0
14624 : see if localtime_r calls tzset
14625 case "$localtime_r_proto" in
14628 /* Does our libc's localtime_r call tzset ?
14629 * return 0 if so, 1 otherwise.
14631 #include <sys/types.h>
14632 #include <unistd.h>
14634 #include <string.h>
14635 #include <malloc.h>
14638 time_t t = time(0L);
14639 char w_tz[]="TZ" "=GMT+5",
14640 e_tz[]="TZ" "=GMT-5",
14641 *tz_e = (char*)malloc(16),
14642 *tz_w = (char*)malloc(16);
14643 struct tm tm_e, tm_w;
14644 memset(&tm_e,'\0',sizeof(struct tm));
14645 memset(&tm_w,'\0',sizeof(struct tm));
14650 localtime_r(&t, &tm_e);
14653 localtime_r(&t, &tm_w);
14655 if( memcmp(&tm_e, &tm_w, sizeof(struct tm)) == 0 )
14661 if eval $compile; then
14663 d_localtime_r_needs_tzset=undef;
14665 d_localtime_r_needs_tzset=define;
14668 d_localtime_r_needs_tzset=undef;
14672 d_localtime_r_needs_tzset=undef;
14675 $rm -f try try.* core
14677 : see if localeconv exists
14678 set localeconv d_locconv
14681 : see if lockf exists
14685 : see if prototype for lseek is available
14687 set d_lseekproto lseek $i_systypes sys/types.h $i_unistd unistd.h
14690 : see if lstat exists
14694 : see if madvise exists
14695 set madvise d_madvise
14698 : see if malloc_size exists
14699 set malloc_size d_malloc_size
14702 : see if malloc_size_good exists
14703 set malloc_good_size d_malloc_good_size
14706 : see if mblen exists
14710 : see if mbstowcs exists
14711 set mbstowcs d_mbstowcs
14714 : see if mbtowc exists
14715 set mbtowc d_mbtowc
14718 : see if memchr exists
14719 set memchr d_memchr
14722 : see if memcmp exists
14723 set memcmp d_memcmp
14726 : see if memcpy exists
14727 set memcpy d_memcpy
14730 : see if memmove exists
14731 set memmove d_memmove
14734 : see if memset exists
14735 set memset d_memset
14738 : see if mkdir exists
14742 : see if mkdtemp exists
14743 set mkdtemp d_mkdtemp
14746 : see if mkfifo exists
14747 set mkfifo d_mkfifo
14750 : see if mkstemp exists
14751 set mkstemp d_mkstemp
14754 : see if mkstemps exists
14755 set mkstemps d_mkstemps
14758 : see if mktime exists
14759 set mktime d_mktime
14762 : see if this is a sys/mman.h system
14763 set sys/mman.h i_sysmman
14766 : see if mmap exists
14769 : see what shmat returns
14770 : default to something harmless
14772 case "$i_sysmman$d_mmap" in
14774 $cat >mmap.c <<'END'
14775 #include <sys/mman.h>
14778 if $cc $ccflags -c mmap.c >/dev/null 2>&1; then
14783 echo "and it returns ($mmaptype)." >&4
14789 : see if sqrtl exists
14793 : see if scalbnl exists
14794 set scalbnl d_scalbnl
14797 : see if modfl exists
14801 : see if prototype for modfl is available
14803 set d_modflproto modfl $i_math math.h
14806 d_modfl_pow32_bug="$undef"
14808 case "$d_longdbl$d_modfl" in
14811 Checking to see whether your modfl() is okay for large values...
14817 if $test "X$d_modflproto" != "X$define"; then
14818 $cat >>try.c <<EOCP
14819 /* Sigh. many current glibcs provide the function, but do not prototype it. */
14820 long double modfl (long double, long double *);
14823 $cat >>try.c <<EOCP
14825 long double nv = 4294967303.15;
14831 printf(" %"$sPRIfldbl" %"$sPRIfldbl" %"$sPRIfldbl"\n", nv, v, w);
14835 case "$osname:$gccversion" in
14836 aix:) saveccflags="$ccflags"
14837 ccflags="$ccflags -qlongdouble" ;; # to avoid core dump
14840 if eval $compile; then
14843 *" 4294967303.150000 1.150000 4294967302.000000")
14844 echo >&4 "Your modfl() is broken for large values."
14845 d_modfl_pow32_bug="$define"
14847 glibc) echo >&4 "You should upgrade your glibc to at least 2.2.2 to get a fixed modfl()."
14851 *" 4294967303.150000 0.150000 4294967303.000000")
14852 echo >&4 "Your modfl() seems okay for large values."
14854 *) echo >&4 "I don't understand your modfl() at all."
14858 $rm -f try.* try core core.try.*
14860 echo "I cannot figure out whether your modfl() is okay, assuming it isn't."
14863 case "$osname:$gccversion" in
14864 aix:) ccflags="$saveccflags" ;; # restore
14869 if $test "$uselongdouble" = "$define"; then
14871 if $test "$d_sqrtl" != "$define"; then
14872 message="$message sqrtl"
14874 if $test "$d_modfl" != "$define"; then
14875 if $test "$d_aintl:$d_copysignl" = "$define:$define"; then
14876 echo "You have both aintl and copysignl, so I can emulate modfl."
14878 message="$message modfl"
14881 if $test "$d_frexpl" != "$define"; then
14882 if $test "$d_ilogbl:$d_scalbnl" = "$define:$define"; then
14883 echo "You have both ilogbl and scalbnl, so I can emulate frexpl."
14885 message="$message frexpl"
14889 if $test "$message" != ""; then
14892 *** You requested the use of long doubles but you do not seem to have
14893 *** the following mathematical functions needed for long double support:
14895 *** Please rerun Configure without -Duselongdouble and/or -Dusemorebits.
14896 *** Cannot continue, aborting.
14904 : see if mprotect exists
14905 set mprotect d_mprotect
14908 : see if msgctl exists
14909 set msgctl d_msgctl
14912 : see if msgget exists
14913 set msgget d_msgget
14916 : see if msgsnd exists
14917 set msgsnd d_msgsnd
14920 : see if msgrcv exists
14921 set msgrcv d_msgrcv
14924 : see how much of the 'msg*(2)' library is present.
14927 case "$d_msgctl$d_msgget$d_msgsnd$d_msgrcv" in
14928 *"$undef"*) h_msg=false;;
14932 case "`ipcs 2>&1`" in
14933 "SVID messages"*"not configured"*)
14934 echo "Your $osname does not have the msg*(2) configured." >&4
14937 set msgctl d_msgctl
14939 set msgget d_msgget
14941 set msgsnd d_msgsnd
14943 set msgrcv d_msgrcv
14949 : we could also check for sys/ipc.h ...
14950 if $h_msg && $test `./findhdr sys/msg.h`; then
14951 echo "You have the full msg*(2) library." >&4
14954 echo "You don't have the full msg*(2) library." >&4
14962 echo "Checking to see if your system supports struct msghdr..." >&4
14963 set d_msghdr_s msghdr $i_systypes sys/types.h $d_socket sys/socket.h $i_sysuio sys/uio.h
14965 case "$d_msghdr_s" in
14966 "$define") echo "Yes, it does." ;;
14967 *) echo "No, it doesn't." ;;
14971 : see if msync exists
14975 : see if munmap exists
14976 set munmap d_munmap
14979 : see if nice exists
14983 : see if this is a langinfo.h system
14984 set langinfo.h i_langinfo
14987 : see if nl_langinfo exists
14988 set nl_langinfo d_nl_langinfo
14991 : check for length of character
14993 case "$charsize" in
14995 echo "Checking to see how big your characters are (hey, you never know)..." >&4
14998 #$i_stdlib I_STDLIB
15000 #include <stdlib.h>
15004 printf("%d\n", (int)sizeof(char));
15009 if eval $compile_ok; then
15013 echo "(I can't seem to compile the test program. Guessing...)"
15020 rp="What is the size of a character (in bytes)?"
15025 : check for volatile keyword
15027 echo 'Checking to see if your C compiler knows about "volatile"...' >&4
15028 $cat >try.c <<'EOCP'
15031 typedef struct _goo_struct goo_struct;
15032 goo_struct * volatile goo = ((goo_struct *)0);
15033 struct _goo_struct {
15038 typedef unsigned short foo_t;
15039 char *volatile foo;
15041 volatile foo_t blech;
15045 if $cc -c $ccflags try.c >/dev/null 2>&1 ; then
15047 echo "Yup, it does."
15050 echo "Nope, it doesn't."
15058 $echo "Choosing the C types to be used for Perl's internal types..." >&4
15060 case "$use64bitint:$d_quad:$quadtype" in
15063 uvtype="$uquadtype"
15068 uvtype="unsigned long"
15074 case "$uselongdouble:$d_longdbl" in
15076 nvtype="long double"
15077 nvsize=$longdblsize
15084 $echo "(IV will be "$ivtype", $ivsize bytes)"
15085 $echo "(UV will be "$uvtype", $uvsize bytes)"
15086 $echo "(NV will be "$nvtype", $nvsize bytes)"
15089 #$i_inttypes I_INTTYPES
15091 #include <inttypes.h>
15096 int8_t i = INT8_MAX;
15097 uint8_t u = UINT8_MAX;
15098 printf("int8_t\n");
15101 int16_t i = INT16_MAX;
15102 uint16_t i = UINT16_MAX;
15103 printf("int16_t\n");
15106 int32_t i = INT32_MAX;
15107 uint32_t u = UINT32_MAX;
15108 printf("int32_t\n");
15114 '') case "$charsize" in
15116 u8type="unsigned char"
15125 if eval $compile; then
15126 case "`$run ./try`" in
15127 int8_t) i8type=int8_t
15137 '') if $test $charsize -ge 1; then
15139 u8type="unsigned char"
15147 '') case "$shortsize" in
15149 u16type="unsigned short"
15157 '') set try -DINT16
15158 if eval $compile; then
15159 case "`$run ./try`" in
15171 '') if $test $shortsize -ge 2; then
15173 u16type="unsigned short"
15181 '') case "$longsize" in
15183 u32type="unsigned long"
15187 *) case "$intsize" in
15189 u32type="unsigned int"
15199 '') set try -DINT32
15200 if eval $compile; then
15201 case "`$run ./try`" in
15213 '') if $test $intsize -ge 4; then
15215 u32type="unsigned int"
15223 '') case "$d_quad:$quadtype" in
15225 i64type="$quadtype"
15226 u64type="$uquadtype"
15234 $echo "Checking how many bits of your UVs your NVs can preserve..." >&4
15235 : volatile so that the compiler has to store it out to memory.
15236 if test X"$d_volatile" = X"$define"; then
15241 #$i_stdlib I_STDLIB
15243 #include <stdlib.h>
15245 #include <sys/types.h>
15246 #include <signal.h>
15248 $volatile int bletched = 0;
15249 $signal_t blech(int s) { bletched = 1; }
15254 int n = 8 * $uvsize;
15257 signal(SIGFPE, blech);
15260 for (i = 0; i < n; i++) {
15261 u = u << 1 | ($uvtype)1;
15263 if (($uvtype)d != u)
15267 d = ($nvtype)(u - 1);
15268 if (($uvtype)d != (u - 1))
15276 printf("%d\n", ((i == n) ? -n : i));
15282 d_nv_preserves_uv="$undef"
15283 if eval $compile; then
15284 nv_preserves_uv_bits="`$run ./try`"
15286 case "$nv_preserves_uv_bits" in
15288 nv_preserves_uv_bits=`expr 0 - $nv_preserves_uv_bits`
15289 $echo "Your NVs can preserve all $nv_preserves_uv_bits bits of your UVs." 2>&1
15290 d_nv_preserves_uv="$define"
15292 [1-9]*) $echo "Your NVs can preserve only $nv_preserves_uv_bits bits of your UVs." 2>&1
15293 d_nv_preserves_uv="$undef" ;;
15294 *) $echo "Can't figure out how many bits your NVs preserve." 2>&1
15295 nv_preserves_uv_bits="$undef" ;;
15300 $echo "Checking whether NV 0.0 is all bits zero in memory..." >&4
15301 : volatile so that the compiler has to store it out to memory.
15302 if test X"$d_volatile" = X"$define"; then
15307 #$i_stdlib I_STDLIB
15309 #include <stdlib.h>
15311 #$i_string I_STRING
15313 # include <string.h>
15315 # include <strings.h>
15317 #include <sys/types.h>
15318 #include <signal.h>
15320 $volatile int bletched = 0;
15321 $signal_t blech(int s) { bletched = 1; }
15324 int checkit($nvtype d, char *where) {
15325 unsigned char *p = (char *)&d;
15326 unsigned char *end = p + sizeof(d);
15336 printf("No - %s: 0x", where);
15338 printf ("%02X", *p++);
15343 int main(int argc, char **argv) {
15346 fail += checkit(d, "0.0");
15348 /* The compiler shouldn't be assuming that bletched is 0 */
15351 fail += checkit(d, "bleched");
15354 signal(SIGFPE, blech);
15357 /* Paranoia - the compiler should have no way of knowing that ANSI says
15358 that argv[argc] will always be NULL. Actually, if it did assume this it
15359 would be buggy, as this is C and main() can be called from elsewhere in
15361 d = argv[argc] ? 1 : 0;
15364 printf("Odd argv[argc]=%p, d=%g\n", argv[argc], d);
15367 fail += checkit(d, "ternary");
15369 memset(&d, sizeof(d), argv[argc] ? 1 : 0);
15372 printf("No - memset doesn't give 0.0\n");
15373 /* This might just blow up: */
15374 printf("(gives %g)\n", d);
15380 printf("No - something bleched\n");
15385 printf("No - %d fail(s)\n", fail);
15394 d_nv_zero_is_allbits_zero="$undef"
15395 if eval $compile; then
15401 0.0 is represented as all bits zero in memory
15403 d_nv_zero_is_allbits_zero="$define"
15406 0.0 is not represented as all bits zero in memory
15408 d_nv_zero_is_allbits_zero="$undef"
15413 0.0 is not represented as all bits zero in memory
15415 d_nv_zero_is_allbits_zero="$undef"
15423 : check for off64_t
15425 echo "Checking to see if you have off64_t..." >&4
15427 #include <sys/types.h>
15428 #include <unistd.h>
15429 int main() { off64_t x = 7; }
15432 if eval $compile; then
15434 echo "You have off64_t."
15437 echo "You do not have off64_t."
15438 case "$lseeksize" in
15439 8) echo "(Your off_t is 64 bits, so you could use that.)" ;;
15446 : how to create joinable pthreads
15447 if test "X$usethreads" = "X$define" -a "X$i_pthread" = "X$define"; then
15449 echo "Checking what constant to use for creating joinable pthreads..." >&4
15450 $cat >try.c <<'EOCP'
15451 #include <pthread.h>
15453 int detachstate = JOINABLE;
15456 set try -DJOINABLE=PTHREAD_CREATE_JOINABLE
15457 if eval $compile; then
15458 echo "You seem to use PTHREAD_CREATE_JOINABLE." >&4
15459 val="$undef" # Yes, undef.
15460 set d_old_pthread_create_joinable
15463 set old_pthread_create_joinable
15466 set try -DJOINABLE=PTHREAD_CREATE_UNDETACHED
15467 if eval $compile; then
15468 echo "You seem to use PTHREAD_CREATE_UNDETACHED." >&4
15470 set d_old_pthread_create_joinable
15472 val=PTHREAD_CREATE_UNDETACHED
15473 set old_pthread_create_joinable
15476 set try -DJOINABLE=__UNDETACHED
15477 if eval $compile; then
15478 echo "You seem to use __UNDETACHED." >&4
15480 set d_old_pthread_create_joinable
15483 set old_pthread_create_joinable
15486 echo "Egads, nothing obvious found. Guessing that you use 0." >&4
15488 set d_old_pthread_create_joinable
15491 set old_pthread_create_joinable
15498 d_old_pthread_create_joinable="$undef"
15499 old_pthread_create_joinable=""
15502 : see if pause exists
15506 : see if pipe exists
15510 : see if poll exists
15514 : see if readlink exists
15515 set readlink d_readlink
15521 case "$d_readlink" in
15523 if $issymlink /proc/self/exe ; then
15524 $ls -l /proc/self/exe > reflect
15525 if $contains /`basename $ls` reflect >/dev/null 2>&1; then
15526 echo "You have Linux-like /proc/self/exe."
15527 procselfexe='"/proc/self/exe"'
15531 if $issymlink /proc/curproc/file ; then
15532 $ls -l /proc/curproc/file > reflect
15533 if $contains /`basename $ls` reflect >/dev/null 2>&1; then
15534 echo "You have BSD-like /proc/curproc/file."
15535 procselfexe='"/proc/curproc/file"'
15545 : see whether the pthread_atfork exists
15547 #include <pthread.h>
15550 #ifdef PTHREAD_ATFORK
15551 pthread_atfork(NULL,NULL,NULL);
15556 : see if pthread_atfork exists
15557 set try -DPTHREAD_ATFORK
15558 if eval $compile; then
15563 case "$usethreads" in
15566 $define) echo 'pthread_atfork found.' >&4 ;;
15567 *) echo 'pthread_atfork NOT found.' >&4 ;;
15570 set d_pthread_atfork
15573 : see if pthread_attr_setscope exists
15574 set pthread_attr_setscope d_pthread_attr_setscope
15578 : see whether the various POSIXish _yields exist
15580 #include <pthread.h>
15586 #ifdef PTHREAD_YIELD
15589 #ifdef PTHREAD_YIELD_NULL
15590 pthread_yield(NULL);
15596 : see if sched_yield exists
15597 set try -DSCHED_YIELD
15598 if eval $compile; then
15600 sched_yield='sched_yield()'
15604 case "$usethreads" in
15607 $define) echo 'sched_yield() found.' >&4 ;;
15608 *) echo 'sched_yield() NOT found.' >&4 ;;
15614 : see if pthread_yield exists
15615 set try -DPTHREAD_YIELD
15616 if eval $compile; then
15618 case "$sched_yield" in
15619 '') sched_yield='pthread_yield()' ;;
15622 set try -DPTHREAD_YIELD_NULL
15623 if eval $compile; then
15625 case "$sched_yield" in
15626 '') sched_yield='pthread_yield(NULL)' ;;
15632 case "$usethreads" in
15635 $define) echo 'pthread_yield() found.' >&4 ;;
15636 *) echo 'pthread_yield() NOT found.' >&4 ;;
15640 set d_pthread_yield
15643 case "$sched_yield" in
15644 '') sched_yield=undef ;;
15649 : see if random_r exists
15650 set random_r d_random_r
15652 case "$d_random_r" in
15654 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
15655 case "$d_random_r_proto:$usethreads" in
15656 ":define") d_random_r_proto=define
15657 set d_random_r_proto random_r $hdrs
15661 case "$d_random_r_proto" in
15663 case "$random_r_proto" in
15664 ''|0) try='int random_r(int*, struct random_data*);'
15665 ./protochk "extern $try" $hdrs && random_r_proto=I_iS ;;
15667 case "$random_r_proto" in
15668 ''|0) try='int random_r(long*, struct random_data*);'
15669 ./protochk "extern $try" $hdrs && random_r_proto=I_lS ;;
15671 case "$random_r_proto" in
15672 ''|0) try='int random_r(struct random_data*, int32_t*);'
15673 ./protochk "extern $try" $hdrs && random_r_proto=I_St ;;
15675 case "$random_r_proto" in
15676 ''|0) d_random_r=undef
15678 echo "Disabling random_r, cannot determine prototype." >&4 ;;
15679 * ) case "$random_r_proto" in
15680 REENTRANT_PROTO*) ;;
15681 *) random_r_proto="REENTRANT_PROTO_$random_r_proto" ;;
15683 echo "Prototype: $try" ;;
15686 *) case "$usethreads" in
15687 define) echo "random_r has no prototype, not using it." >&4 ;;
15694 *) random_r_proto=0
15698 : see if readdir and friends exist
15699 set readdir d_readdir
15701 set seekdir d_seekdir
15703 set telldir d_telldir
15705 set rewinddir d_rewinddir
15708 : see if readdir64_r exists
15709 set readdir64_r d_readdir64_r
15711 case "$d_readdir64_r" in
15713 hdrs="$i_systypes sys/types.h define stdio.h $i_dirent dirent.h"
15714 case "$d_readdir64_r_proto:$usethreads" in
15715 ":define") d_readdir64_r_proto=define
15716 set d_readdir64_r_proto readdir64_r $hdrs
15720 case "$d_readdir64_r_proto" in
15722 case "$readdir64_r_proto" in
15723 ''|0) try='int readdir64_r(DIR*, struct dirent64*, struct dirent64**);'
15724 ./protochk "extern $try" $hdrs && readdir64_r_proto=I_TSR ;;
15726 case "$readdir64_r_proto" in
15727 ''|0) try='int readdir64_r(DIR*, struct dirent64*);'
15728 ./protochk "extern $try" $hdrs && readdir64_r_proto=I_TS ;;
15730 case "$readdir64_r_proto" in
15731 ''|0) d_readdir64_r=undef
15732 readdir64_r_proto=0
15733 echo "Disabling readdir64_r, cannot determine prototype." >&4 ;;
15734 * ) case "$readdir64_r_proto" in
15735 REENTRANT_PROTO*) ;;
15736 *) readdir64_r_proto="REENTRANT_PROTO_$readdir64_r_proto" ;;
15738 echo "Prototype: $try" ;;
15741 *) case "$usethreads" in
15742 define) echo "readdir64_r has no prototype, not using it." >&4 ;;
15744 d_readdir64_r=undef
15745 readdir64_r_proto=0
15749 *) readdir64_r_proto=0
15753 : see if readdir_r exists
15754 set readdir_r d_readdir_r
15756 case "$d_readdir_r" in
15758 hdrs="$i_systypes sys/types.h define stdio.h $i_dirent dirent.h"
15759 case "$d_readdir_r_proto:$usethreads" in
15760 ":define") d_readdir_r_proto=define
15761 set d_readdir_r_proto readdir_r $hdrs
15765 case "$d_readdir_r_proto" in
15767 case "$readdir_r_proto" in
15768 ''|0) try='int readdir_r(DIR*, struct dirent*, struct dirent**);'
15769 ./protochk "extern $try" $hdrs && readdir_r_proto=I_TSR ;;
15771 case "$readdir_r_proto" in
15772 ''|0) try='int readdir_r(DIR*, struct dirent*);'
15773 ./protochk "extern $try" $hdrs && readdir_r_proto=I_TS ;;
15775 case "$readdir_r_proto" in
15776 ''|0) d_readdir_r=undef
15778 echo "Disabling readdir_r, cannot determine prototype." >&4 ;;
15779 * ) case "$readdir_r_proto" in
15780 REENTRANT_PROTO*) ;;
15781 *) readdir_r_proto="REENTRANT_PROTO_$readdir_r_proto" ;;
15783 echo "Prototype: $try" ;;
15786 *) case "$usethreads" in
15787 define) echo "readdir_r has no prototype, not using it." >&4 ;;
15794 *) readdir_r_proto=0
15798 : see if readv exists
15802 : see if recvmsg exists
15803 set recvmsg d_recvmsg
15806 : see if rename exists
15807 set rename d_rename
15810 : see if rmdir exists
15814 : see if memory.h is available.
15819 : See if it conflicts with string.h
15825 $cppstdin $cppflags $cppminus < $strings > mem.h
15826 if $contains 'memcpy' mem.h >/dev/null 2>&1; then
15828 echo "We won't be including <memory.h>."
15838 : can bcopy handle overlapping blocks?
15841 case "$d_memmove" in
15842 "$define") echo "I'll use memmove() instead of bcopy() for overlapping copies." ;;
15843 *) case "$d_bcopy" in
15845 echo "Checking to see if bcopy() can do overlapping copies..." >&4
15847 #$i_memory I_MEMORY
15848 #$i_stdlib I_STDLIB
15849 #$i_string I_STRING
15850 #$i_unistd I_UNISTD
15852 $cat >>try.c <<'EOCP'
15855 # include <memory.h>
15858 # include <stdlib.h>
15861 # include <string.h>
15863 # include <strings.h>
15866 # include <unistd.h> /* Needed for NetBSD */
15870 char buf[128], abc[128];
15876 /* Copy "abcde..." string to char abc[] so that gcc doesn't
15877 try to store the string in read-only memory. */
15878 bcopy("abcdefghijklmnopqrstuvwxyz0123456789", abc, 36);
15880 for (align = 7; align >= 0; align--) {
15881 for (len = 36; len; len--) {
15883 bcopy(abc, b, len);
15884 for (off = 1; off <= len; off++) {
15885 bcopy(b, b+off, len);
15886 bcopy(b+off, b, len);
15887 if (bcmp(b, abc, len))
15896 if eval $compile_ok; then
15897 if ./try 2>/dev/null; then
15898 echo "Yes, it can."
15901 echo "It can't, sorry."
15904 echo "(I can't compile the test program, so we'll assume not...)"
15908 $rm -f try.* try core
15914 : can memcpy handle overlapping blocks?
15917 case "$d_memmove" in
15918 "$define") echo "I'll use memmove() instead of memcpy() for overlapping copies." ;;
15919 *) case "$d_memcpy" in
15921 echo "Checking to see if memcpy() can do overlapping copies..." >&4
15923 #$i_memory I_MEMORY
15924 #$i_stdlib I_STDLIB
15925 #$i_string I_STRING
15926 #$i_unistd I_UNISTD
15928 $cat >>try.c <<'EOCP'
15931 # include <memory.h>
15934 # include <stdlib.h>
15937 # include <string.h>
15939 # include <strings.h>
15942 # include <unistd.h> /* Needed for NetBSD */
15946 char buf[128], abc[128];
15952 /* Copy "abcde..." string to char abc[] so that gcc doesn't
15953 try to store the string in read-only memory. */
15954 memcpy(abc, "abcdefghijklmnopqrstuvwxyz0123456789", 36);
15956 for (align = 7; align >= 0; align--) {
15957 for (len = 36; len; len--) {
15959 memcpy(b, abc, len);
15960 for (off = 1; off <= len; off++) {
15961 memcpy(b+off, b, len);
15962 memcpy(b, b+off, len);
15963 if (memcmp(b, abc, len))
15972 if eval $compile_ok; then
15973 if ./try 2>/dev/null; then
15974 echo "Yes, it can."
15977 echo "It can't, sorry."
15980 echo "(I can't compile the test program, so we'll assume not...)"
15984 $rm -f try.* try core
15990 : can memcmp be trusted to compare relative magnitude?
15992 case "$d_memcmp" in
15995 echo "Checking if your memcmp() can compare relative magnitude..." >&4
15997 #$i_memory I_MEMORY
15998 #$i_stdlib I_STDLIB
15999 #$i_string I_STRING
16000 #$i_unistd I_UNISTD
16002 $cat >>try.c <<'EOCP'
16005 # include <memory.h>
16008 # include <stdlib.h>
16011 # include <string.h>
16013 # include <strings.h>
16016 # include <unistd.h> /* Needed for NetBSD */
16022 if ((a < b) && memcmp(&a, &b, 1) < 0)
16028 if eval $compile_ok; then
16029 if $run ./try 2>/dev/null; then
16030 echo "Yes, it can."
16033 echo "No, it can't (it uses signed chars)."
16036 echo "(I can't compile the test program, so we'll assume not...)"
16040 $rm -f try.* try core
16044 : see if prototype for sbrk is available
16046 set d_sbrkproto sbrk $i_unistd unistd.h
16049 : see if select exists
16050 set select d_select
16053 : see if semctl exists
16054 set semctl d_semctl
16057 : see if semget exists
16058 set semget d_semget
16061 : see if semop exists
16065 : see how much of the 'sem*(2)' library is present.
16068 case "$d_semctl$d_semget$d_semop" in
16069 *"$undef"*) h_sem=false;;
16073 case "`ipcs 2>&1`" in
16074 "SVID messages"*"not configured"*)
16075 echo "Your $osname does not have the sem*(2) configured." >&4
16078 set semctl d_semctl
16080 set semget d_semget
16088 : we could also check for sys/ipc.h ...
16089 if $h_sem && $test `./findhdr sys/sem.h`; then
16090 echo "You have the full sem*(2) library." >&4
16093 echo "You don't have the full sem*(2) library." >&4
16099 : see whether sys/sem.h defines union semun
16101 $cat > try.c <<'END'
16102 #include <sys/types.h>
16103 #include <sys/ipc.h>
16104 #include <sys/sem.h>
16105 int main () { union semun semun; semun.buf = 0; }
16108 if eval $compile; then
16109 echo "You have union semun in <sys/sem.h>." >&4
16112 echo "You do not have union semun in <sys/sem.h>." >&4
16119 : see how to do semctl IPC_STAT
16126 # define S_IRUSR S_IREAD
16127 # define S_IWUSR S_IWRITE
16128 # define S_IXUSR S_IEXEC
16130 # define S_IRUSR 0400
16131 # define S_IWUSR 0200
16132 # define S_IXUSR 0100
16134 # define S_IRGRP (S_IRUSR>>3)
16135 # define S_IWGRP (S_IWUSR>>3)
16136 # define S_IXGRP (S_IXUSR>>3)
16137 # define S_IROTH (S_IRUSR>>6)
16138 # define S_IWOTH (S_IWUSR>>6)
16139 # define S_IXOTH (S_IXUSR>>6)
16142 # define S_IRWXU (S_IRUSR|S_IWUSR|S_IXUSR)
16143 # define S_IRWXG (S_IRGRP|S_IWGRP|S_IXGRP)
16144 # define S_IRWXO (S_IROTH|S_IWOTH|S_IXOTH)
16147 : see whether semctl IPC_STAT can use union semun
16148 case "$d_semctl_semun" in
16152 #include <sys/types.h>
16153 #include <sys/ipc.h>
16154 #include <sys/sem.h>
16155 #include <sys/stat.h>
16162 #$d_union_semun HAS_UNION_SEMUN
16165 #ifndef HAS_UNION_SEMUN
16168 struct semid_ds *buf;
16169 unsigned short *array;
16175 #if defined(IPC_PRIVATE) && defined(S_IRWXU) && defined(S_IRWXG) && defined(S_IRWXO) && defined(IPC_CREAT)
16176 sem = semget(IPC_PRIVATE, 1, S_IRWXU|S_IRWXG|S_IRWXO|IPC_CREAT);
16178 struct semid_ds argbuf;
16181 st = semctl(sem, 0, IPC_STAT, arg);
16185 # endif /* IPC_STAT */
16186 printf("semctl IPC_STAT failed: errno = %d\n", errno);
16188 if (semctl(sem, 0, IPC_RMID, arg) != 0)
16189 # endif /* IPC_RMID */
16190 printf("semctl IPC_RMID failed: errno = %d\n", errno);
16192 #endif /* IPC_PRIVATE && ... */
16193 printf("semget failed: errno = %d\n", errno);
16198 if eval $compile; then
16201 semun) val="$define" ;;
16209 case "$d_semctl_semun" in
16211 echo "You can use union semun for semctl IPC_STAT." >&4
16214 *) echo "You cannot use union semun for semctl IPC_STAT." >&4
16219 : see whether semctl IPC_STAT can use struct semid_ds pointer
16220 case "$d_semctl_semid_ds" in
16223 $cat > try.c <<'END'
16224 #include <sys/types.h>
16225 #include <sys/ipc.h>
16226 #include <sys/sem.h>
16227 #include <sys/stat.h>
16235 struct semid_ds arg;
16238 #if defined(IPC_PRIVATE) && defined(S_IRWXU) && defined(S_IRWXG) && defined(S_IRWXO) && defined(IPC_CREAT)
16239 sem = semget(IPC_PRIVATE, 1, S_IRWXU|S_IRWXG|S_IRWXO|IPC_CREAT);
16242 st = semctl(sem, 0, IPC_STAT, &arg);
16244 printf("semid_ds\n");
16246 # endif /* IPC_STAT */
16247 printf("semctl IPC_STAT failed: errno = %d\n", errno);
16249 if (semctl(sem, 0, IPC_RMID, &arg) != 0)
16250 # endif /* IPC_RMID */
16251 printf("semctl IPC_RMID failed: errno = %d\n", errno);
16253 #endif /* IPC_PRIVATE && ... */
16254 printf("semget failed: errno = %d\n", errno);
16260 if eval $compile; then
16263 semid_ds) val="$define" ;;
16267 set d_semctl_semid_ds
16271 case "$d_semctl_semid_ds" in
16273 echo "You can $also use struct semid_ds* for semctl IPC_STAT." >&4
16275 *) echo "You cannot use struct semid_ds* for semctl IPC_STAT." >&4
16282 # We do not have the full sem*(2) library, so assume we can not
16288 set d_semctl_semid_ds
16293 : see if sendmsg exists
16294 set sendmsg d_sendmsg
16297 : see if setegid exists
16298 set setegid d_setegid
16301 : see if seteuid exists
16302 set seteuid d_seteuid
16305 : see if setgrent exists
16306 set setgrent d_setgrent
16309 : see if setgrent_r exists
16310 set setgrent_r d_setgrent_r
16312 case "$d_setgrent_r" in
16314 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
16315 case "$d_setgrent_r_proto:$usethreads" in
16316 ":define") d_setgrent_r_proto=define
16317 set d_setgrent_r_proto setgrent_r $hdrs
16321 case "$d_setgrent_r_proto" in
16323 case "$setgrent_r_proto" in
16324 ''|0) try='int setgrent_r(FILE**);'
16325 ./protochk "extern $try" $hdrs && setgrent_r_proto=I_H ;;
16327 case "$setgrent_r_proto" in
16328 ''|0) try='void setgrent_r(FILE**);'
16329 ./protochk "extern $try" $hdrs && setgrent_r_proto=V_H ;;
16331 case "$setgrent_r_proto" in
16332 ''|0) d_setgrent_r=undef
16334 echo "Disabling setgrent_r, cannot determine prototype." >&4 ;;
16335 * ) case "$setgrent_r_proto" in
16336 REENTRANT_PROTO*) ;;
16337 *) setgrent_r_proto="REENTRANT_PROTO_$setgrent_r_proto" ;;
16339 echo "Prototype: $try" ;;
16342 *) case "$usethreads" in
16343 define) echo "setgrent_r has no prototype, not using it." >&4 ;;
16350 *) setgrent_r_proto=0
16354 : see if sethostent exists
16355 set sethostent d_sethent
16358 : see if sethostent_r exists
16359 set sethostent_r d_sethostent_r
16361 case "$d_sethostent_r" in
16363 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
16364 case "$d_sethostent_r_proto:$usethreads" in
16365 ":define") d_sethostent_r_proto=define
16366 set d_sethostent_r_proto sethostent_r $hdrs
16370 case "$d_sethostent_r_proto" in
16372 case "$sethostent_r_proto" in
16373 ''|0) try='int sethostent_r(int, struct hostent_data*);'
16374 ./protochk "extern $try" $hdrs && sethostent_r_proto=I_ID ;;
16376 case "$sethostent_r_proto" in
16377 ''|0) try='void sethostent_r(int, struct hostent_data*);'
16378 ./protochk "extern $try" $hdrs && sethostent_r_proto=V_ID ;;
16380 case "$sethostent_r_proto" in
16381 ''|0) d_sethostent_r=undef
16382 sethostent_r_proto=0
16383 echo "Disabling sethostent_r, cannot determine prototype." >&4 ;;
16384 * ) case "$sethostent_r_proto" in
16385 REENTRANT_PROTO*) ;;
16386 *) sethostent_r_proto="REENTRANT_PROTO_$sethostent_r_proto" ;;
16388 echo "Prototype: $try" ;;
16391 *) case "$usethreads" in
16392 define) echo "sethostent_r has no prototype, not using it." >&4 ;;
16394 d_sethostent_r=undef
16395 sethostent_r_proto=0
16399 *) sethostent_r_proto=0
16403 : see if setitimer exists
16404 set setitimer d_setitimer
16407 : see if setlinebuf exists
16408 set setlinebuf d_setlinebuf
16411 : see if setlocale exists
16412 set setlocale d_setlocale
16415 : see if locale.h is available
16416 set locale.h i_locale
16419 : see if setlocale_r exists
16420 set setlocale_r d_setlocale_r
16422 case "$d_setlocale_r" in
16424 hdrs="$i_systypes sys/types.h define stdio.h $i_locale locale.h"
16425 case "$d_setlocale_r_proto:$usethreads" in
16426 ":define") d_setlocale_r_proto=define
16427 set d_setlocale_r_proto setlocale_r $hdrs
16431 case "$d_setlocale_r_proto" in
16433 case "$setlocale_r_proto" in
16434 ''|0) try='int setlocale_r(int, const char*, char*, int);'
16435 ./protochk "extern $try" $hdrs && setlocale_r_proto=I_ICBI ;;
16437 case "$setlocale_r_proto" in
16438 ''|0) d_setlocale_r=undef
16439 setlocale_r_proto=0
16440 echo "Disabling setlocale_r, cannot determine prototype." >&4 ;;
16441 * ) case "$setlocale_r_proto" in
16442 REENTRANT_PROTO*) ;;
16443 *) setlocale_r_proto="REENTRANT_PROTO_$setlocale_r_proto" ;;
16445 echo "Prototype: $try" ;;
16448 *) case "$usethreads" in
16449 define) echo "setlocale_r has no prototype, not using it." >&4 ;;
16451 d_setlocale_r=undef
16452 setlocale_r_proto=0
16456 *) setlocale_r_proto=0
16460 : see if setnetent exists
16461 set setnetent d_setnent
16464 : see if setnetent_r exists
16465 set setnetent_r d_setnetent_r
16467 case "$d_setnetent_r" in
16469 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
16470 case "$d_setnetent_r_proto:$usethreads" in
16471 ":define") d_setnetent_r_proto=define
16472 set d_setnetent_r_proto setnetent_r $hdrs
16476 case "$d_setnetent_r_proto" in
16478 case "$setnetent_r_proto" in
16479 ''|0) try='int setnetent_r(int, struct netent_data*);'
16480 ./protochk "extern $try" $hdrs && setnetent_r_proto=I_ID ;;
16482 case "$setnetent_r_proto" in
16483 ''|0) try='void setnetent_r(int, struct netent_data*);'
16484 ./protochk "extern $try" $hdrs && setnetent_r_proto=V_ID ;;
16486 case "$setnetent_r_proto" in
16487 ''|0) d_setnetent_r=undef
16488 setnetent_r_proto=0
16489 echo "Disabling setnetent_r, cannot determine prototype." >&4 ;;
16490 * ) case "$setnetent_r_proto" in
16491 REENTRANT_PROTO*) ;;
16492 *) setnetent_r_proto="REENTRANT_PROTO_$setnetent_r_proto" ;;
16494 echo "Prototype: $try" ;;
16497 *) case "$usethreads" in
16498 define) echo "setnetent_r has no prototype, not using it." >&4 ;;
16500 d_setnetent_r=undef
16501 setnetent_r_proto=0
16505 *) setnetent_r_proto=0
16509 : see if setprotoent exists
16510 set setprotoent d_setpent
16513 : see if setpgid exists
16514 set setpgid d_setpgid
16517 : see if setpgrp2 exists
16518 set setpgrp2 d_setpgrp2
16521 : see if setpriority exists
16522 set setpriority d_setprior
16525 : see if setproctitle exists
16526 set setproctitle d_setproctitle
16529 : see if setprotoent_r exists
16530 set setprotoent_r d_setprotoent_r
16532 case "$d_setprotoent_r" in
16534 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
16535 case "$d_setprotoent_r_proto:$usethreads" in
16536 ":define") d_setprotoent_r_proto=define
16537 set d_setprotoent_r_proto setprotoent_r $hdrs
16541 case "$d_setprotoent_r_proto" in
16543 case "$setprotoent_r_proto" in
16544 ''|0) try='int setprotoent_r(int, struct protoent_data*);'
16545 ./protochk "extern $try" $hdrs && setprotoent_r_proto=I_ID ;;
16547 case "$setprotoent_r_proto" in
16548 ''|0) try='void setprotoent_r(int, struct protoent_data*);'
16549 ./protochk "extern $try" $hdrs && setprotoent_r_proto=V_ID ;;
16551 case "$setprotoent_r_proto" in
16552 ''|0) d_setprotoent_r=undef
16553 setprotoent_r_proto=0
16554 echo "Disabling setprotoent_r, cannot determine prototype." >&4 ;;
16555 * ) case "$setprotoent_r_proto" in
16556 REENTRANT_PROTO*) ;;
16557 *) setprotoent_r_proto="REENTRANT_PROTO_$setprotoent_r_proto" ;;
16559 echo "Prototype: $try" ;;
16562 *) case "$usethreads" in
16563 define) echo "setprotoent_r has no prototype, not using it." >&4 ;;
16565 d_setprotoent_r=undef
16566 setprotoent_r_proto=0
16570 *) setprotoent_r_proto=0
16574 : see if setpwent exists
16575 set setpwent d_setpwent
16578 : see if setpwent_r exists
16579 set setpwent_r d_setpwent_r
16581 case "$d_setpwent_r" in
16583 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
16584 case "$d_setpwent_r_proto:$usethreads" in
16585 ":define") d_setpwent_r_proto=define
16586 set d_setpwent_r_proto setpwent_r $hdrs
16590 case "$d_setpwent_r_proto" in
16592 case "$setpwent_r_proto" in
16593 ''|0) try='int setpwent_r(FILE**);'
16594 ./protochk "extern $try" $hdrs && setpwent_r_proto=I_H ;;
16596 case "$setpwent_r_proto" in
16597 ''|0) try='void setpwent_r(FILE**);'
16598 ./protochk "extern $try" $hdrs && setpwent_r_proto=V_H ;;
16600 case "$setpwent_r_proto" in
16601 ''|0) d_setpwent_r=undef
16603 echo "Disabling setpwent_r, cannot determine prototype." >&4 ;;
16604 * ) case "$setpwent_r_proto" in
16605 REENTRANT_PROTO*) ;;
16606 *) setpwent_r_proto="REENTRANT_PROTO_$setpwent_r_proto" ;;
16608 echo "Prototype: $try" ;;
16611 *) case "$usethreads" in
16612 define) echo "setpwent_r has no prototype, not using it." >&4 ;;
16619 *) setpwent_r_proto=0
16623 : see if setregid exists
16624 set setregid d_setregid
16626 set setresgid d_setresgid
16629 : see if setreuid exists
16630 set setreuid d_setreuid
16632 set setresuid d_setresuid
16635 : see if setrgid exists
16636 set setrgid d_setrgid
16639 : see if setruid exists
16640 set setruid d_setruid
16643 : see if setservent exists
16644 set setservent d_setsent
16647 : see if setservent_r exists
16648 set setservent_r d_setservent_r
16650 case "$d_setservent_r" in
16652 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
16653 case "$d_setservent_r_proto:$usethreads" in
16654 ":define") d_setservent_r_proto=define
16655 set d_setservent_r_proto setservent_r $hdrs
16659 case "$d_setservent_r_proto" in
16661 case "$setservent_r_proto" in
16662 ''|0) try='int setservent_r(int, struct servent_data*);'
16663 ./protochk "extern $try" $hdrs && setservent_r_proto=I_ID ;;
16665 case "$setservent_r_proto" in
16666 ''|0) try='void setservent_r(int, struct servent_data*);'
16667 ./protochk "extern $try" $hdrs && setservent_r_proto=V_ID ;;
16669 case "$setservent_r_proto" in
16670 ''|0) d_setservent_r=undef
16671 setservent_r_proto=0
16672 echo "Disabling setservent_r, cannot determine prototype." >&4 ;;
16673 * ) case "$setservent_r_proto" in
16674 REENTRANT_PROTO*) ;;
16675 *) setservent_r_proto="REENTRANT_PROTO_$setservent_r_proto" ;;
16677 echo "Prototype: $try" ;;
16680 *) case "$usethreads" in
16681 define) echo "setservent_r has no prototype, not using it." >&4 ;;
16683 d_setservent_r=undef
16684 setservent_r_proto=0
16688 *) setservent_r_proto=0
16692 : see if setsid exists
16693 set setsid d_setsid
16696 : see if setvbuf exists
16697 set setvbuf d_setvbuf
16700 : see if sfio.h is available
16705 : see if sfio library is available
16716 : Ok, but do we want to use it.
16720 true|$define|[yY]*) dflt='y';;
16723 echo "$package can use the sfio library, but it is experimental."
16724 case "$useperlio" in
16726 echo "For sfio also the PerlIO abstraction layer is needed."
16727 echo "Earlier you said you wouldn't want that."
16730 rp="You seem to have sfio available, do you want to try using it?"
16733 y|Y) echo "Ok, turning on both sfio and PerlIO, then."
16734 useperlio="$define"
16737 *) echo "Ok, avoiding sfio this time. I'll use stdio instead."
16742 *) case "$usesfio" in
16743 true|$define|[yY]*)
16744 echo "Sorry, cannot find sfio on this machine." >&4
16745 echo "Ignoring your setting of usesfio=$usesfio." >&4
16754 $define) usesfio='true';;
16755 *) usesfio='false';;
16759 *) : Remove sfio from list of libraries to use
16762 echo "Removing unneeded -lsfio from library list" >&4
16763 set `echo X $libs | $sed -e 's/-lsfio / /' -e 's/-lsfio$//'`
16766 echo "libs = $libs" >&4
16773 : see if shmctl exists
16774 set shmctl d_shmctl
16777 : see if shmget exists
16778 set shmget d_shmget
16781 : see if shmat exists
16784 : see what shmat returns
16787 $cat >shmat.c <<'END'
16788 #include <sys/shm.h>
16791 if $cc $ccflags -c shmat.c >/dev/null 2>&1; then
16796 echo "and it returns ($shmattype)." >&4
16797 : see if a prototype for shmat is available
16798 xxx=`./findhdr sys/shm.h`
16799 $cppstdin $cppflags $cppminus < $xxx > shmat.c 2>/dev/null
16800 if $contains 'shmat.*(' shmat.c >/dev/null 2>&1; then
16811 set d_shmatprototype
16814 : see if shmdt exists
16818 : see how much of the 'shm*(2)' library is present.
16821 case "$d_shmctl$d_shmget$d_shmat$d_shmdt" in
16822 *"$undef"*) h_shm=false;;
16826 case "`ipcs 2>&1`" in
16827 "SVID shared memory"*"not configured"*)
16828 echo "Your $osname does not have the shm*(2) configured." >&4
16831 set shmctl d_shmctl
16833 set shmget d_shmget
16843 : we could also check for sys/ipc.h ...
16844 if $h_shm && $test `./findhdr sys/shm.h`; then
16845 echo "You have the full shm*(2) library." >&4
16848 echo "You don't have the full shm*(2) library." >&4
16855 : see if we have sigaction
16856 if set sigaction val -f d_sigaction; eval $csym; $val; then
16857 echo 'sigaction() found.' >&4
16860 #include <sys/types.h>
16861 #include <signal.h>
16862 #$i_stdlib I_STDLIB
16864 #include <stdlib.h>
16868 struct sigaction act, oact;
16870 oact.sa_handler = 0;
16871 /* so that act and oact are used */
16872 exit(act.sa_flags == 0 && oact.sa_handler == 0);
16876 if eval $compile_ok; then
16879 echo "But you don't seem to have a useable struct sigaction." >&4
16883 echo 'sigaction NOT found.' >&4
16886 set d_sigaction; eval $setvar
16887 $rm -f try try$_o try.c
16889 : see if sigprocmask exists
16890 set sigprocmask d_sigprocmask
16893 : see if sigsetjmp exists
16895 case "$d_sigsetjmp" in
16898 #include <setjmp.h>
16899 #$i_stdlib I_STDLIB
16901 #include <stdlib.h>
16907 if (sigsetjmp(env,1))
16910 siglongjmp(env, 1);
16915 if eval $compile; then
16916 if $run ./try >/dev/null 2>&1; then
16917 echo "POSIX sigsetjmp found." >&4
16921 Uh-Oh! You have POSIX sigsetjmp and siglongjmp, but they do not work properly!!
16927 echo "sigsetjmp not found." >&4
16931 *) val="$d_sigsetjmp"
16932 case "$d_sigsetjmp" in
16933 $define) echo "POSIX sigsetjmp found." >&4;;
16934 $undef) echo "sigsetjmp not found." >&4;;
16942 : see if snprintf exists
16943 set snprintf d_snprintf
16946 : see if vsnprintf exists
16947 set vsnprintf d_vsnprintf
16950 case "$d_snprintf-$d_vsnprintf" in
16953 Checking whether your snprintf() and vsnprintf() work okay...
16955 $cat >try.c <<'EOCP'
16956 /* v?snprintf testing logic courtesy of Russ Allbery.
16957 * According to C99:
16958 * - if the buffer is too short it still must be \0-terminated
16959 * - if the buffer is too short the potentially required length
16960 * must be returned and not -1
16961 * - if the buffer is NULL the potentially required length
16962 * must be returned and not -1 or core dump
16965 #include <stdarg.h>
16969 int test (char *format, ...)
16974 va_start (args, format);
16975 count = vsnprintf (buf, sizeof buf, format, args);
16982 return ((test ("%s", "abcd") == 4 && buf[0] == 'a' && buf[1] == '\0'
16983 && snprintf (NULL, 0, "%s", "abcd") == 4) ? 0 : 1);
16987 if eval $compile; then
16990 0) echo "Your snprintf() and vsnprintf() seem to be working okay." ;;
16992 Your snprintf() and snprintf() don't seem to be working okay.
16994 d_snprintf="$undef"
16995 d_vsnprintf="$undef"
16999 echo "(I can't seem to compile the test program--assuming they don't)"
17000 d_snprintf="$undef"
17001 d_vsnprintf="$undef"
17003 $rm -f try.* try core core.try.*
17007 : see if sockatmark exists
17008 set sockatmark d_sockatmark
17011 : see if prototype for sockatmark is available
17013 set d_sockatmarkproto sockatmark $d_socket sys/socket.h
17016 : see if socks5_init exists
17017 set socks5_init d_socks5_init
17020 : see if sprintf returns the length of the string in the buffer as per ANSI
17021 $echo "Checking whether sprintf returns the length of the string..." >&4
17024 #$i_stdlib I_STDLIB
17026 #include <stdlib.h>
17028 #$i_string I_STRING
17030 # include <string.h>
17032 # include <strings.h>
17041 int check (size_t expect, int test) {
17042 size_t got = strlen(buffer);
17046 printf("expected %ld, got %ld in test %d '%s'\n", (long) expect, (long) got,
17051 int main(int argc, char **argv) {
17054 check(sprintf(buffer, ""), ++test);
17055 check(sprintf(buffer, "%s %s", "perl", "rules"), ++test);
17056 check(sprintf(buffer, "I like %g", atan2(0,-1)), ++test);
17063 d_sprintf_returns_strlen="$undef"
17064 if eval $compile; then
17068 sprintf returns the length of the string (as ANSI says it should)
17070 d_sprintf_returns_strlen="$define"
17073 sprintf does not return the length of the string (how old is this system?)
17075 d_sprintf_returns_strlen="$undef"
17082 : see if srand48_r exists
17083 set srand48_r d_srand48_r
17085 case "$d_srand48_r" in
17087 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
17088 case "$d_srand48_r_proto:$usethreads" in
17089 ":define") d_srand48_r_proto=define
17090 set d_srand48_r_proto srand48_r $hdrs
17094 case "$d_srand48_r_proto" in
17096 case "$srand48_r_proto" in
17097 ''|0) try='int srand48_r(long, struct drand48_data*);'
17098 ./protochk "extern $try" $hdrs && srand48_r_proto=I_LS ;;
17100 case "$srand48_r_proto" in
17101 ''|0) d_srand48_r=undef
17103 echo "Disabling srand48_r, cannot determine prototype." >&4 ;;
17104 * ) case "$srand48_r_proto" in
17105 REENTRANT_PROTO*) ;;
17106 *) srand48_r_proto="REENTRANT_PROTO_$srand48_r_proto" ;;
17108 echo "Prototype: $try" ;;
17111 *) case "$usethreads" in
17112 define) echo "srand48_r has no prototype, not using it." >&4 ;;
17119 *) srand48_r_proto=0
17123 : see if srandom_r exists
17124 set srandom_r d_srandom_r
17126 case "$d_srandom_r" in
17128 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
17129 case "$d_srandom_r_proto:$usethreads" in
17130 ":define") d_srandom_r_proto=define
17131 set d_srandom_r_proto srandom_r $hdrs
17135 case "$d_srandom_r_proto" in
17137 case "$srandom_r_proto" in
17138 ''|0) try='int srandom_r(unsigned int, struct random_data*);'
17139 ./protochk "extern $try" $hdrs && srandom_r_proto=I_TS ;;
17141 case "$srandom_r_proto" in
17142 ''|0) d_srandom_r=undef
17144 echo "Disabling srandom_r, cannot determine prototype." >&4 ;;
17145 * ) case "$srandom_r_proto" in
17146 REENTRANT_PROTO*) ;;
17147 *) srandom_r_proto="REENTRANT_PROTO_$srandom_r_proto" ;;
17149 echo "Prototype: $try" ;;
17152 *) case "$usethreads" in
17153 define) echo "srandom_r has no prototype, not using it." >&4 ;;
17160 *) srandom_r_proto=0
17164 : see if prototype for setresgid is available
17166 set d_sresgproto setresgid $i_unistd unistd.h
17169 : see if prototype for setresuid is available
17171 set d_sresuproto setresuid $i_unistd unistd.h
17174 : see if sys/stat.h is available
17175 set sys/stat.h i_sysstat
17179 : see if stat knows about block sizes
17181 echo "Checking to see if your struct stat has st_blocks field..." >&4
17182 set d_statblks stat st_blocks $i_sysstat sys/stat.h
17186 : see if this is a sys/vfs.h system
17187 set sys/vfs.h i_sysvfs
17191 : see if this is a sys/statfs.h system
17192 set sys/statfs.h i_sysstatfs
17197 echo "Checking to see if your system supports struct statfs..." >&4
17198 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
17200 case "$d_statfs_s" in
17201 "$define") echo "Yes, it does." ;;
17202 *) echo "No, it doesn't." ;;
17207 : see if struct statfs knows about f_flags
17208 case "$d_statfs_s" in
17211 echo "Checking to see if your struct statfs has f_flags field..." >&4
17212 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
17216 set d_statfs_f_flags
17220 case "$d_statfs_f_flags" in
17221 "$define") echo "Yes, it does." ;;
17222 *) echo "No, it doesn't." ;;
17226 Checking how to access stdio streams by file descriptor number...
17228 case "$stdio_stream_array" in
17229 '') $cat >try.c <<EOCP
17232 if (&STDIO_STREAM_ARRAY[fileno(stdin)] == stdin)
17236 for s in _iob __iob __sF
17238 set try -DSTDIO_STREAM_ARRAY=$s
17239 if eval $compile; then
17240 case "`$run ./try`" in
17241 yes) stdio_stream_array=$s; break ;;
17245 $rm -f try.* try$exe_ext
17247 case "$stdio_stream_array" in
17249 I can't figure out how to access stdio streams by file descriptor number.
17251 d_stdio_stream_array="$undef"
17254 You can access stdio streams by file descriptor number by the $stdio_stream_array array.
17256 d_stdio_stream_array="$define"
17260 : see if strcoll exists
17261 set strcoll d_strcoll
17264 : check for structure copying
17266 echo "Checking to see if your C compiler can copy structs..." >&4
17267 $cat >try.c <<'EOCP'
17277 if $cc -c try.c >/dev/null 2>&1 ; then
17279 echo "Yup, it can."
17282 echo "Nope, it can't."
17288 : see if strerror and/or sys_errlist[] exist
17290 if test "X$d_strerror" = X -o "X$d_syserrlst" = X; then
17291 if set strerror val -f d_strerror; eval $csym; $val; then
17292 echo 'strerror() found.' >&4
17293 d_strerror="$define"
17294 d_strerrm='strerror(e)'
17295 if set sys_errlist val -a d_syserrlst; eval $csym; $val; then
17296 echo "(You also have sys_errlist[], so we could roll our own strerror.)"
17297 d_syserrlst="$define"
17299 echo "(Since you don't have sys_errlist[], sterror() is welcome.)"
17300 d_syserrlst="$undef"
17302 elif xxx=`./findhdr string.h`; test "$xxx" || xxx=`./findhdr strings.h`; \
17303 $contains '#[ ]*define.*strerror' "$xxx" >/dev/null 2>&1; then
17304 echo 'strerror() found in string header.' >&4
17305 d_strerror="$define"
17306 d_strerrm='strerror(e)'
17307 if set sys_errlist val -a d_syserrlst; eval $csym; $val; then
17308 echo "(Most probably, strerror() uses sys_errlist[] for descriptions.)"
17309 d_syserrlst="$define"
17311 echo "(You don't appear to have any sys_errlist[], how can this be?)"
17312 d_syserrlst="$undef"
17314 elif set sys_errlist val -a d_syserrlst; eval $csym; $val; then
17315 echo "strerror() not found, but you have sys_errlist[] so we'll use that." >&4
17316 d_strerror="$undef"
17317 d_syserrlst="$define"
17318 d_strerrm='((e)<0||(e)>=sys_nerr?"unknown":sys_errlist[e])'
17320 echo 'strerror() and sys_errlist[] NOT found.' >&4
17321 d_strerror="$undef"
17322 d_syserrlst="$undef"
17323 d_strerrm='"unknown"'
17327 : see if strerror_r exists
17328 set strerror_r d_strerror_r
17330 case "$d_strerror_r" in
17332 hdrs="$i_systypes sys/types.h define stdio.h $i_string string.h"
17333 case "$d_strerror_r_proto:$usethreads" in
17334 ":define") d_strerror_r_proto=define
17335 set d_strerror_r_proto strerror_r $hdrs
17339 case "$d_strerror_r_proto" in
17341 case "$strerror_r_proto" in
17342 ''|0) try='int strerror_r(int, char*, size_t);'
17343 ./protochk "extern $try" $hdrs && strerror_r_proto=I_IBW ;;
17345 case "$strerror_r_proto" in
17346 ''|0) try='int strerror_r(int, char*, int);'
17347 ./protochk "extern $try" $hdrs && strerror_r_proto=I_IBI ;;
17349 case "$strerror_r_proto" in
17350 ''|0) try='char* strerror_r(int, char*, size_t);'
17351 ./protochk "extern $try" $hdrs && strerror_r_proto=B_IBW ;;
17353 case "$strerror_r_proto" in
17354 ''|0) d_strerror_r=undef
17356 echo "Disabling strerror_r, cannot determine prototype." >&4 ;;
17357 * ) case "$strerror_r_proto" in
17358 REENTRANT_PROTO*) ;;
17359 *) strerror_r_proto="REENTRANT_PROTO_$strerror_r_proto" ;;
17361 echo "Prototype: $try" ;;
17364 *) case "$usethreads" in
17365 define) echo "strerror_r has no prototype, not using it." >&4 ;;
17372 *) strerror_r_proto=0
17376 : see if strftime exists
17377 set strftime d_strftime
17380 : see if strlcat exists
17381 set strlcat d_strlcat
17384 : see if strlcpy exists
17385 set strlcpy d_strlcpy
17388 : see if strtod exists
17389 set strtod d_strtod
17392 : see if strtol exists
17393 set strtol d_strtol
17396 : see if strtold exists
17397 set strtold d_strtold
17400 : see if strtoll exists
17401 set strtoll d_strtoll
17404 case "$d_longlong-$d_strtoll" in
17407 Checking whether your strtoll() works okay...
17409 $cat >try.c <<'EOCP'
17412 #define strtoll __strtoll
17415 #define strtoll _strtoll
17418 extern long long int strtoll(char *s, char **, int);
17419 static int bad = 0;
17420 int check(char *s, long long ell, int een) {
17423 gll = strtoll(s, 0, 10);
17424 if (!((gll == ell) && (errno == een)))
17428 check(" 1", 1LL, 0);
17429 check(" 0", 0LL, 0);
17430 check("-1", -1LL, 0);
17431 check("-9223372036854775808", -9223372036854775808LL, 0);
17432 check("-9223372036854775808", -9223372036854775808LL, 0);
17433 check(" 9223372036854775807", 9223372036854775807LL, 0);
17434 check("-9223372036854775808", -9223372036854775808LL, 0);
17435 check(" 9223372036854775808", 9223372036854775807LL, ERANGE);
17436 check("-9223372036854775809", -9223372036854775808LL, ERANGE);
17442 if eval $compile; then
17445 ok) echo "Your strtoll() seems to be working okay." ;;
17447 Your strtoll() doesn't seem to be working okay.
17453 echo "(I can't seem to compile the test program--assuming it doesn't)"
17459 : see if strtoq exists
17460 set strtoq d_strtoq
17463 : see if strtoul exists
17464 set strtoul d_strtoul
17467 case "$d_strtoul" in
17470 Checking whether your strtoul() works okay...
17472 $cat >try.c <<'EOCP'
17475 extern unsigned long int strtoul(char *s, char **, int);
17476 static int bad = 0;
17477 void check(char *s, unsigned long eul, int een) {
17480 gul = strtoul(s, 0, 10);
17481 if (!((gul == eul) && (errno == een)))
17485 check(" 1", 1L, 0);
17486 check(" 0", 0L, 0);
17488 case "$longsize" in
17490 $cat >>try.c <<'EOCP'
17491 check("18446744073709551615", 18446744073709551615UL, 0);
17492 check("18446744073709551616", 18446744073709551615UL, ERANGE);
17493 #if 0 /* strtoul() for /^-/ strings is undefined. */
17494 check("-1", 18446744073709551615UL, 0);
17495 check("-18446744073709551614", 2, 0);
17496 check("-18446744073709551615", 1, 0);
17497 check("-18446744073709551616", 18446744073709551615UL, ERANGE);
17498 check("-18446744073709551617", 18446744073709551615UL, ERANGE);
17503 $cat >>try.c <<'EOCP'
17504 check("4294967295", 4294967295UL, 0);
17505 check("4294967296", 4294967295UL, ERANGE);
17506 #if 0 /* strtoul() for /^-/ strings is undefined. */
17507 check("-1", 4294967295UL, 0);
17508 check("-4294967294", 2, 0);
17509 check("-4294967295", 1, 0);
17510 check("-4294967296", 4294967295UL, ERANGE);
17511 check("-4294967297", 4294967295UL, ERANGE);
17516 : Should we write these tests to be more portable by sprintf-ing
17517 : ~0 and then manipulating that char string as input for strtol?
17520 $cat >>try.c <<'EOCP'
17527 if eval $compile; then
17528 case "`$run ./try`" in
17529 ok) echo "Your strtoul() seems to be working okay." ;;
17531 Your strtoul() doesn't seem to be working okay.
17540 : see if strtoull exists
17541 set strtoull d_strtoull
17544 case "$d_longlong-$d_strtoull" in
17547 Checking whether your strtoull() works okay...
17549 $cat >try.c <<'EOCP'
17552 #define strtoull __strtoull
17555 extern unsigned long long int strtoull(char *s, char **, int);
17556 static int bad = 0;
17557 int check(char *s, long long eull, int een) {
17560 gull = strtoull(s, 0, 10);
17561 if (!((gull == eull) && (errno == een)))
17565 check(" 1", 1LL, 0);
17566 check(" 0", 0LL, 0);
17567 check("18446744073709551615", 18446744073709551615ULL, 0);
17568 check("18446744073709551616", 18446744073709551615ULL, ERANGE);
17569 #if 0 /* strtoull() for /^-/ strings is undefined. */
17570 check("-1", 18446744073709551615ULL, 0);
17571 check("-18446744073709551614", 2LL, 0);
17572 check("-18446744073709551615", 1LL, 0);
17573 check("-18446744073709551616", 18446744073709551615ULL, ERANGE);
17574 check("-18446744073709551617", 18446744073709551615ULL, ERANGE);
17581 if eval $compile; then
17582 case "`$run ./try`" in
17583 ok) echo "Your strtoull() seems to be working okay." ;;
17585 Your strtoull() doesn't seem to be working okay.
17587 d_strtoull="$undef"
17594 : see if strtouq exists
17595 set strtouq d_strtouq
17598 case "$d_strtouq" in
17601 Checking whether your strtouq() works okay...
17603 $cat >try.c <<'EOCP'
17606 extern unsigned long long int strtouq(char *s, char **, int);
17607 static int bad = 0;
17608 void check(char *s, unsigned long long eull, int een) {
17609 unsigned long long gull;
17611 gull = strtouq(s, 0, 10);
17612 if (!((gull == eull) && (errno == een)))
17616 check(" 1", 1LL, 0);
17617 check(" 0", 0LL, 0);
17618 check("18446744073709551615", 18446744073709551615ULL, 0);
17619 check("18446744073709551616", 18446744073709551615ULL, ERANGE);
17620 #if 0 /* strtouq() for /^-/ strings is undefined. */
17621 check("-1", 18446744073709551615ULL, 0);
17622 check("-18446744073709551614", 2LL, 0);
17623 check("-18446744073709551615", 1LL, 0);
17624 check("-18446744073709551616", 18446744073709551615ULL, ERANGE);
17625 check("-18446744073709551617", 18446744073709551615ULL, ERANGE);
17633 if eval $compile; then
17634 case "`$run ./try`" in
17635 ok) echo "Your strtouq() seems to be working okay." ;;
17637 Your strtouq() doesn't seem to be working okay.
17646 : see if strxfrm exists
17647 set strxfrm d_strxfrm
17650 : see if symlink exists
17651 set symlink d_symlink
17654 : see if syscall exists
17655 set syscall d_syscall
17658 : see if prototype for syscall is available
17660 set d_syscallproto syscall $i_unistd unistd.h
17663 : see if sysconf exists
17664 set sysconf d_sysconf
17667 : see if system exists
17668 set system d_system
17671 : see if tcgetpgrp exists
17672 set tcgetpgrp d_tcgetpgrp
17675 : see if tcsetpgrp exists
17676 set tcsetpgrp d_tcsetpgrp
17679 : see if prototype for telldir is available
17681 set d_telldirproto telldir $i_systypes sys/types.h $i_dirent dirent.h
17684 : see if time exists
17686 if test "X$d_time" = X -o X"$timetype" = X; then
17687 if set time val -f d_time; eval $csym; $val; then
17688 echo 'time() found.' >&4
17690 rp="What is the type returned by time() on this system?"
17691 set time_t timetype long stdio.h sys/types.h
17694 echo 'time() not found, hope that will do.' >&4
17702 : see if this is a sys/times.h system
17703 set sys/times.h i_systimes
17706 : see if times exists
17708 if set times val -f d_times; eval $csym; $val; then
17709 echo 'times() found.' >&4
17712 case "$i_systimes" in
17713 "$define") inc='sys/times.h';;
17715 rp="What is the type returned by times() on this system?"
17716 set clock_t clocktype long stdio.h sys/types.h $inc
17719 echo 'times() NOT found, hope that will do.' >&4
17724 : see if tmpnam_r exists
17725 set tmpnam_r d_tmpnam_r
17727 case "$d_tmpnam_r" in
17729 hdrs="$i_systypes sys/types.h define stdio.h "
17730 case "$d_tmpnam_r_proto:$usethreads" in
17731 ":define") d_tmpnam_r_proto=define
17732 set d_tmpnam_r_proto tmpnam_r $hdrs
17736 case "$d_tmpnam_r_proto" in
17738 case "$tmpnam_r_proto" in
17739 ''|0) try='char* tmpnam_r(char*);'
17740 ./protochk "extern $try" $hdrs && tmpnam_r_proto=B_B ;;
17742 case "$tmpnam_r_proto" in
17743 ''|0) d_tmpnam_r=undef
17745 echo "Disabling tmpnam_r, cannot determine prototype." >&4 ;;
17746 * ) case "$tmpnam_r_proto" in
17747 REENTRANT_PROTO*) ;;
17748 *) tmpnam_r_proto="REENTRANT_PROTO_$tmpnam_r_proto" ;;
17750 echo "Prototype: $try" ;;
17753 *) case "$usethreads" in
17754 define) echo "tmpnam_r has no prototype, not using it." >&4 ;;
17761 *) tmpnam_r_proto=0
17765 : see if truncate exists
17766 set truncate d_truncate
17769 : see if ttyname_r exists
17770 set ttyname_r d_ttyname_r
17772 case "$d_ttyname_r" in
17774 hdrs="$i_systypes sys/types.h define stdio.h $i_unistd unistd.h"
17775 case "$d_ttyname_r_proto:$usethreads" in
17776 ":define") d_ttyname_r_proto=define
17777 set d_ttyname_r_proto ttyname_r $hdrs
17781 case "$d_ttyname_r_proto" in
17783 case "$ttyname_r_proto" in
17784 ''|0) try='int ttyname_r(int, char*, size_t);'
17785 ./protochk "extern $try" $hdrs && ttyname_r_proto=I_IBW ;;
17787 case "$ttyname_r_proto" in
17788 ''|0) try='int ttyname_r(int, char*, int);'
17789 ./protochk "extern $try" $hdrs && ttyname_r_proto=I_IBI ;;
17791 case "$ttyname_r_proto" in
17792 ''|0) try='char* ttyname_r(int, char*, int);'
17793 ./protochk "extern $try" $hdrs && ttyname_r_proto=B_IBI ;;
17795 case "$ttyname_r_proto" in
17796 ''|0) d_ttyname_r=undef
17798 echo "Disabling ttyname_r, cannot determine prototype." >&4 ;;
17799 * ) case "$ttyname_r_proto" in
17800 REENTRANT_PROTO*) ;;
17801 *) ttyname_r_proto="REENTRANT_PROTO_$ttyname_r_proto" ;;
17803 echo "Prototype: $try" ;;
17806 *) case "$usethreads" in
17807 define) echo "ttyname_r has no prototype, not using it." >&4 ;;
17814 *) ttyname_r_proto=0
17818 : see if tzname[] exists
17820 if set tzname val -a d_tzname; eval $csym; $val; then
17822 echo 'tzname[] found.' >&4
17825 echo 'tzname[] NOT found.' >&4
17831 next|rhapsody|darwin) multiarch="$define" ;;
17833 case "$multiarch" in
17834 ''|[nN]*) multiarch="$undef" ;;
17837 : check for ordering of bytes in a UV
17839 case "$usecrosscompile$multiarch" in
17842 You seem to be either cross-compiling or doing a multiarchitecture build,
17843 skipping the byteorder check.
17849 case "$byteorder" in
17852 In the following, larger digits indicate more significance. A big-endian
17853 machine like a Pyramid or a Motorola 680?0 chip will come out to 4321. A
17854 little-endian machine like a Vax or an Intel 80?86 chip would be 1234. Other
17855 machines may have weird orders like 3412. A Cray will report 87654321,
17856 an Alpha will report 12345678. If the test program works the default is
17858 I'm now running the test program...
17862 #$i_stdlib I_STDLIB
17864 #include <stdlib.h>
17866 #include <sys/types.h>
17867 typedef $uvtype UV;
17877 u.l = (((UV)0x08070605) << 32) | (UV)0x04030201;
17879 u.l = (UV)0x04030201;
17880 for (i = 0; i < $uvsize; i++)
17881 printf("%c", u.c[i]+'0');
17888 if eval $compile && ./try > /dev/null; then
17891 [1-4][1-4][1-4][1-4]|12345678|87654321)
17892 echo "(The test program ran ok.)"
17893 echo "byteorder=$dflt"
17896 ????|????????) echo "(The test program ran ok.)" ;;
17897 *) echo "(The test program didn't run right for some reason.)" ;;
17902 (I can't seem to compile the test program. Guessing big-endian...)
17905 case "$xxx_prompt" in
17907 rp="What is the order of bytes in $uvtype?"
17923 Checking to see whether you can access character data unalignedly...
17925 case "$d_u32align" in
17926 '') $cat >try.c <<EOCP
17928 #$i_stdlib I_STDLIB
17930 #include <stdlib.h>
17932 #define U32 $u32type
17933 #define BYTEORDER 0x$byteorder
17935 #include <signal.h>
17937 $signal_t bletch(int s) { exit(4); }
17940 #if BYTEORDER == 0x1234 || BYTEORDER == 0x4321
17945 if (sizeof(U32) != 4) {
17946 printf("sizeof(U32) is not 4, but %d\n", sizeof(U32));
17953 signal(SIGBUS, bletch);
17965 for (i = 0; i < 4; i++) {
17966 up = (U32*)(buf + i);
17967 if (! ((*up == 1 << (8*i)) || /* big-endian */
17968 (*up == 1 << (8*(3-i))) /* little-endian */
17972 printf("read failed (%x)\n", *up);
17978 for (i = 0; i < 4; i++) {
17979 up = (U32*)(buf + i);
17981 if (*up != 0xBeef) {
17982 printf("write failed (%x)\n", *up);
17996 if eval $compile_ok; then
17997 echo "(Testing for character data alignment may crash the test. That's okay.)" >&4
17998 $run ./try 2>&1 >/dev/null
18001 You can access character data pretty unalignedly.
18003 d_u32align="$undef"
18006 It seems that you must access character data in an aligned manner.
18008 d_u32align="$define"
18012 rp='Can you access character data at unaligned addresses?'
18016 [yY]*) d_u32align="$undef" ;;
18017 *) d_u32align="$define" ;;
18020 $rm -f core core.try.* try.core
18024 : see if ualarm exists
18025 set ualarm d_ualarm
18028 : see if umask exists
18032 : see if unordered exists
18033 set unordered d_unordered
18036 : see if unsetenv exists
18037 set unsetenv d_unsetenv
18040 : see if usleep exists
18041 set usleep d_usleep
18044 : see if prototype for usleep is available
18046 set d_usleepproto usleep $i_unistd unistd.h
18049 : see if ustat exists
18053 : backward compatibility for d_hvfork
18054 if test X$d_hvfork != X; then
18055 d_vfork="$d_hvfork"
18058 : see if there is a vfork
18063 : Ok, but do we want to use it. vfork is reportedly unreliable in
18064 : perl on Solaris 2.x, and probably elsewhere.
18068 case "$usevfork" in
18074 Perl can only use a vfork() that doesn't suffer from strict
18075 restrictions on calling functions or modifying global data in
18076 the child. For example, glibc-2.1 contains such a vfork()
18077 that is unsuitable. If your system provides a proper fork()
18078 call, chances are that you do NOT want perl to use vfork().
18081 rp="Do you still want to use vfork()?"
18086 echo "Ok, we won't use vfork()."
18095 $define) usevfork='true';;
18096 *) usevfork='false';;
18099 : see if closedir exists
18100 set closedir d_closedir
18103 case "$d_closedir" in
18106 echo "Checking whether closedir() returns a status..." >&4
18108 #$i_dirent I_DIRENT /**/
18109 #$i_sysdir I_SYS_DIR /**/
18110 #$i_sysndir I_SYS_NDIR /**/
18111 #$i_systypes I_SYS_TYPES /**/
18113 #if defined(I_SYS_TYPES)
18114 #include <sys/types.h>
18116 #if defined(I_DIRENT)
18117 #include <dirent.h>
18118 #if defined(NeXT) && defined(I_SYS_DIR) /* NeXT needs dirent + sys/dir.h */
18119 #include <sys/dir.h>
18123 #include <sys/ndir.h>
18127 #include <ndir.h> /* may be wrong in the future */
18129 #include <sys/dir.h>
18134 int main() { return closedir(opendir(".")); }
18137 if eval $compile_ok; then
18138 if $run ./try > /dev/null 2>&1 ; then
18139 echo "Yes, it does."
18142 echo "No, it doesn't."
18146 echo "(I can't seem to compile the test program--assuming it doesn't)"
18154 set d_void_closedir
18157 : see if there is a wait4
18161 : see if waitpid exists
18162 set waitpid d_waitpid
18165 : see if wcstombs exists
18166 set wcstombs d_wcstombs
18169 : see if wctomb exists
18170 set wctomb d_wctomb
18173 : see if writev exists
18174 set writev d_writev
18177 : preserve RCS keywords in files with variable substitution, grrr
18182 Revision='$Revision'
18184 : check for alignment requirements
18186 case "$usecrosscompile$multiarch" in
18189 You seem to be either cross-compiling or doing a multiarchitecture build,
18190 skipping the memory alignment check.
18193 case "$alignbytes" in
18194 '') alignbytes=8 ;;
18198 case "$alignbytes" in
18199 '') echo "Checking alignment constraints..." >&4
18200 if $test "X$uselongdouble" = Xdefine -a "X$d_longdbl" = Xdefine; then
18201 $cat >try.c <<'EOCP'
18202 typedef long double NV;
18205 $cat >try.c <<'EOCP'
18209 $cat >>try.c <<'EOCP'
18217 printf("%d\n", (int)((char *)&try_algn.bar - (char *)&try_algn.foo));
18222 if eval $compile_ok; then
18226 echo "(I can't seem to compile the test program...)"
18229 *) dflt="$alignbytes"
18232 rp="Doubles must be aligned on a how-many-byte boundary?"
18240 : set the base revision
18243 : how do we concatenate cpp tokens here?
18245 echo "Checking to see how your cpp does stuff like concatenate tokens..." >&4
18246 $cat >cpp_stuff.c <<'EOCP'
18247 #define RCAT(a,b)a/**/b
18248 #define ACAT(a,b)a ## b
18252 $cppstdin $cppflags $cppminus <cpp_stuff.c >cpp_stuff.out 2>&1
18253 if $contains 'Circus' cpp_stuff.out >/dev/null 2>&1; then
18254 echo "Oh! Smells like ANSI's been here." >&4
18255 echo "We can catify or stringify, separately or together!"
18257 elif $contains 'Reiser' cpp_stuff.out >/dev/null 2>&1; then
18258 echo "Ah, yes! The good old days!" >&4
18259 echo "However, in the good old days we don't know how to stringify and"
18260 echo "catify at the same time."
18264 Hmm, I don't seem to be able to concatenate tokens with your cpp.
18265 You're going to have to edit the values of CAT[2-5] in config.h...
18267 cpp_stuff="/* Help! How do we handle cpp_stuff? */*/"
18271 : see if this is a db.h system
18277 : Check db version.
18279 echo "Checking Berkeley DB version ..." >&4
18285 #include <sys/types.h>
18287 #$i_stdlib I_STDLIB
18289 #include <stdlib.h>
18292 int main(int argc, char *argv[])
18294 #ifdef DB_VERSION_MAJOR /* DB version >= 2 */
18295 int Major, Minor, Patch ;
18296 unsigned long Version ;
18297 (void)db_version(&Major, &Minor, &Patch) ;
18299 printf("%d %d %d %d %d %d\n",
18300 DB_VERSION_MAJOR, DB_VERSION_MINOR, DB_VERSION_PATCH,
18301 Major, Minor, Patch);
18304 printf("You have Berkeley DB Version 2 or greater.\n");
18306 printf("db.h is from Berkeley DB Version %d.%d.%d\n",
18307 DB_VERSION_MAJOR, DB_VERSION_MINOR, DB_VERSION_PATCH);
18308 printf("libdb is from Berkeley DB Version %d.%d.%d\n",
18309 Major, Minor, Patch) ;
18311 /* check that db.h & libdb are compatible */
18312 if (DB_VERSION_MAJOR != Major || DB_VERSION_MINOR != Minor || DB_VERSION_PATCH != Patch) {
18313 printf("db.h and libdb are incompatible.\n") ;
18317 printf("db.h and libdb are compatible.\n") ;
18319 Version = DB_VERSION_MAJOR * 1000000 + DB_VERSION_MINOR * 1000
18320 + DB_VERSION_PATCH ;
18322 /* needs to be >= 2.3.4 */
18323 if (Version < 2003004) {
18324 /* if (DB_VERSION_MAJOR == 2 && DB_VERSION_MINOR == 0 && DB_VERSION_PATCH < 5) { */
18325 printf("Perl needs Berkeley DB 2.3.4 or greater.\n") ;
18331 #if defined(_DB_H_) && defined(BTREEMAGIC) && defined(HASHMAGIC)
18336 printf("You have Berkeley DB Version 1.\n");
18337 exit(0); /* DB version < 2: the coast is clear. */
18339 exit(1); /* <db.h> not Berkeley DB? */
18345 if eval $compile_ok && $run ./try; then
18346 echo 'Looks OK.' >&4
18348 db_version_major=$1
18349 db_version_minor=$2
18350 db_version_patch=$3
18352 echo "I can't use Berkeley DB with your <db.h>. I'll disable Berkeley DB." >&4
18356 : Remove db from list of libraries to use
18357 echo "Removing unusable -ldb from library list" >&4
18358 set `echo X $libs | $sed -e 's/-ldb / /' -e 's/-ldb$//'`
18361 echo "libs = $libs" >&4
18371 : Check the return type needed for hash
18373 echo "Checking return type needed for hash for Berkeley DB ..." >&4
18379 #include <sys/types.h>
18382 #ifndef DB_VERSION_MAJOR
18383 u_int32_t hash_cb (ptr, size)
18391 info.hash = hash_cb;
18395 if $cc $ccflags -c try.c >try.out 2>&1 ; then
18396 if $contains warning try.out >>/dev/null 2>&1 ; then
18399 db_hashtype='u_int32_t'
18402 : XXX Maybe we should just give up here.
18403 db_hashtype=u_int32_t
18405 echo "Help: I can't seem to compile the db test program." >&4
18406 echo "Something's wrong, but I'll assume you use $db_hashtype." >&4
18409 echo "Your version of Berkeley DB uses $db_hashtype for hash."
18411 *) db_hashtype=u_int32_t
18416 : Check the return type needed for prefix
18418 echo "Checking return type needed for prefix for Berkeley DB ..." >&4
18424 #include <sys/types.h>
18427 #ifndef DB_VERSION_MAJOR
18428 size_t prefix_cb (key1, key2)
18436 info.prefix = prefix_cb;
18440 if $cc $ccflags -c try.c >try.out 2>&1 ; then
18441 if $contains warning try.out >>/dev/null 2>&1 ; then
18442 db_prefixtype='int'
18444 db_prefixtype='size_t'
18447 db_prefixtype='size_t'
18448 : XXX Maybe we should just give up here.
18450 echo "Help: I can't seem to compile the db test program." >&4
18451 echo "Something's wrong, but I'll assume you use $db_prefixtype." >&4
18454 echo "Your version of Berkeley DB uses $db_prefixtype for prefix."
18456 *) db_prefixtype='size_t'
18461 : How can we generate normalized random numbers ?
18463 echo "Looking for a random number function..." >&4
18464 case "$randfunc" in
18466 if set drand48 val -f; eval $csym; $val; then
18468 echo "Good, found drand48()." >&4
18469 elif set random val -f; eval $csym; $val; then
18471 echo "OK, found random()." >&4
18474 echo "Yick, looks like I have to use rand()." >&4
18485 *-Dmy_rand=*|*-Dmy_srand=*)
18486 echo "Removing obsolete -Dmy_rand, -Dmy_srand, and -Drandbits from ccflags." >&4
18487 ccflags="`echo $ccflags | sed -e 's/-Dmy_rand=random/ /'`"
18488 ccflags="`echo $ccflags | sed -e 's/-Dmy_srand=srandom/ /'`"
18489 ccflags="`echo $ccflags | sed -e 's/-Drandbits=[0-9][0-9]*/ /'`"
18493 while $test "$cont"; do
18494 rp="Use which function to generate random numbers?"
18496 if $test "$ans" = "$dflt"; then
18502 if set $ans val -f; eval $csym; $val; then
18506 rp="I cannot find function $ans. Use that name anyway?"
18515 case "$randfunc" in
18517 drand01="drand48()"
18523 case "$randbits" in
18525 echo "Checking to see how many bits your $randfunc() function produces..." >&4
18527 #$i_unistd I_UNISTD
18528 #$i_stdlib I_STDLIB
18531 # include <unistd.h>
18534 # include <stdlib.h>
18539 register unsigned long tmp;
18540 register unsigned long max = 0L;
18542 for (i = 1000; i; i--) {
18543 tmp = (unsigned long) $randfunc();
18544 if (tmp > max) max = tmp;
18546 for (i = 0; max; i++)
18552 if eval $compile_ok; then
18556 echo "(I can't seem to compile the test program...)"
18563 rp="How many bits does your $randfunc() function produce?"
18567 drand01="($randfunc() / (double) ((unsigned long)1 << $randbits))"
18568 seedfunc="s$randfunc"
18569 randseedtype=unsigned
18573 rp="How many bits does your $randfunc() function produce?"
18576 seedfunc="s$randfunc"
18577 drand01="($randfunc() / (double) ((unsigned long)1 << $randbits))"
18578 if set $seedfunc val -f; eval $csym; $val; then
18579 echo "(Using $seedfunc() to seed random generator)"
18581 echo "(Warning: no $seedfunc() to seed random generator)"
18584 randseedtype=unsigned
18592 echo "Determining whether or not we are on an EBCDIC system..." >&4
18593 $cat >try.c <<'EOM'
18596 if ('M'==0xd4) return 0;
18603 if eval $compile_ok; then
18604 if $run ./try; then
18605 echo "You seem to speak EBCDIC." >&4
18608 echo "Nope, no EBCDIC, probably ASCII or some ISO Latin. Or UTF-8." >&4
18611 echo "I'm unable to compile the test program." >&4
18612 echo "I'll assume ASCII or some ISO Latin. Or UTF8." >&4
18620 Checking how to flush all pending stdio output...
18622 # I only know how to find the first 32 possibly open files on SunOS.
18623 # See also hints/sunos_4_1.sh and util.c --AD
18625 sunos) $echo '#define PERL_FFLUSH_ALL_FOPEN_MAX 32' > try.c ;;
18627 $cat >>try.c <<EOCP
18629 #$i_stdlib I_STDLIB
18631 #include <stdlib.h>
18633 #$i_unistd I_UNISTD
18635 # include <unistd.h>
18637 #$d_sysconf HAS_SYSCONF
18638 #$d_stdio_stream_array HAS_STDIO_STREAM_ARRAY
18639 #ifdef HAS_STDIO_STREAM_ARRAY
18640 # define STDIO_STREAM_ARRAY $stdio_stream_array
18645 p = fopen("try.out", "w");
18649 # ifdef TRY_FPRINTF
18653 #ifdef TRY_FFLUSH_NULL
18656 #ifdef TRY_FFLUSH_ALL
18658 long open_max = -1;
18659 # ifdef PERL_FFLUSH_ALL_FOPEN_MAX
18660 open_max = PERL_FFLUSH_ALL_FOPEN_MAX;
18662 # if defined(HAS_SYSCONF) && defined(_SC_OPEN_MAX)
18663 open_max = sysconf(_SC_OPEN_MAX);
18666 open_max = FOPEN_MAX;
18669 open_max = OPEN_MAX;
18678 # ifdef HAS_STDIO_STREAM_ARRAY
18679 if (open_max > 0) {
18681 for (i = 0; i < open_max; i++)
18682 if (STDIO_STREAM_ARRAY[i]._file >= 0 &&
18683 STDIO_STREAM_ARRAY[i]._file < open_max &&
18684 STDIO_STREAM_ARRAY[i]._flag)
18685 fflush(&STDIO_STREAM_ARRAY[i]);
18693 : first we have to find out how _not_ to flush
18695 if $test "X$fflushNULL" = X -o "X$fflushall" = X; then
18697 set try -DTRY_FPUTC
18698 if eval $compile; then
18699 $run ./try 2>/dev/null
18702 if $test ! -s try.out -a "X$code" = X42; then
18708 set try -DTRY_FPRINTF
18709 if eval $compile; then
18710 $run ./try 2>/dev/null
18713 if $test ! -s try.out -a "X$code" = X42; then
18714 output=-DTRY_FPRINTF
18720 : check for fflush NULL behaviour
18721 case "$fflushNULL" in
18722 '') set try -DTRY_FFLUSH_NULL $output
18723 if eval $compile; then
18724 $run ./try 2>/dev/null
18727 if $test -s try.out -a "X$code" = X42; then
18728 fflushNULL="`$cat try.out`"
18730 if $test "X$code" != X42; then
18732 (If this test failed, don't worry, we'll try another method shortly.)
18737 $rm -f core try.core core.try.*
18738 case "$fflushNULL" in
18740 Your fflush(NULL) works okay for output streams.
18741 Let's see if it clobbers input pipes...
18743 # As of mid-March 2000 all versions of Solaris appear to have a stdio
18744 # bug that improperly flushes the input end of pipes. So we avoid the
18745 # autoflush on fork/system/exec support for now. :-(
18746 $cat >tryp.c <<EOCP
18749 main(int argc, char **argv)
18755 while ((i = getc(stdin)) != -1
18756 && (*bp++ = i) != '\n'
18757 && bp < &buf[1024])
18760 fprintf(stdout, "%s", buf);
18768 fflushNULL="$define"
18770 if eval $compile; then
18772 $cat tryp.c | $run ./tryp 2>/dev/null > tryp.out
18773 if cmp tryp.c tryp.out >/dev/null 2>&1; then
18775 fflush(NULL) seems to behave okay with input streams.
18777 fflushNULL="$define"
18780 Ouch, fflush(NULL) clobbers input pipes! We will not use it.
18782 fflushNULL="$undef"
18785 $rm -f core tryp.c tryp.core core.tryp.*
18788 Your fflush(NULL) isn't working (contrary to ANSI C).
18790 fflushNULL="$undef"
18793 Cannot figure out whether your fflush(NULL) works or not.
18794 I'm assuming it doesn't (contrary to ANSI C).
18796 fflushNULL="$undef"
18800 $define|true|[yY]*)
18801 fflushNULL="$define"
18804 fflushNULL="$undef"
18807 : check explicit looping only if NULL did not work, and if the pipe
18808 : bug does not show up on an explicit flush too
18809 case "$fflushNULL" in
18811 $cat >tryp.c <<EOCP
18814 main(int argc, char **argv)
18820 while ((i = getc(stdin)) != -1
18821 && (*bp++ = i) != '\n'
18822 && bp < &buf[1024])
18825 fprintf(stdout, "%s", buf);
18834 if eval $compile; then
18836 $cat tryp.c | $run ./tryp 2>/dev/null > tryp.out
18837 if cmp tryp.c tryp.out >/dev/null 2>&1; then
18839 Good, at least fflush(stdin) seems to behave okay when stdin is a pipe.
18841 : now check for fflushall behaviour
18842 case "$fflushall" in
18843 '') set try -DTRY_FFLUSH_ALL $output
18844 if eval $compile; then
18846 (Now testing the other method--but note that this also may fail.)
18848 $run ./try 2>/dev/null
18851 if $test -s try.out -a "X$code" = X42; then
18852 fflushall="`$cat try.out`"
18855 $rm -f core try.core core.try.*
18856 case "$fflushall" in
18858 Whew. Flushing explicitly all the stdio streams works.
18860 fflushall="$define"
18863 Sigh. Flushing explicitly all the stdio streams doesn't work.
18868 Cannot figure out whether flushing stdio streams explicitly works or not.
18869 I'm assuming it doesn't.
18875 "$define"|true|[yY]*)
18876 fflushall="$define"
18884 All is futile. Even fflush(stdin) clobbers input pipes!
18891 $rm -f core tryp.c tryp.core core.tryp.*
18893 *) fflushall="$undef"
18897 case "$fflushNULL$fflushall" in
18900 OK, I give up. I cannot figure out how to flush pending stdio output.
18901 We won't be flushing handles at all before fork/exec/popen.
18905 $rm -f try.* try$exe_ext
18907 : Store the full pathname to the ar program for use in the C program
18908 : Respect a hint or command line value for full_ar.
18913 : Store the full pathname to the sed program for use in the C program
18916 : see what type gids are declared as in the kernel
18918 echo "Looking for the type for group ids returned by getgid()."
18919 set gid_t gidtype xxx stdio.h sys/types.h
18923 xxx=`./findhdr sys/user.h`
18924 set `grep 'groups\[NGROUPS\];' "$xxx" 2>/dev/null` unsigned short
18926 unsigned) dflt="$1 $2" ;;
18930 *) dflt="$gidtype";;
18933 gid_t) echo "gid_t found." ;;
18934 *) rp="What is the type for group ids returned by getgid()?"
18942 *_t) zzz="$gidtype" ;;
18945 echo "Checking the size of $zzz..." >&4
18947 #include <sys/types.h>
18949 #$i_stdlib I_STDLIB
18951 #include <stdlib.h>
18954 printf("%d\n", (int)sizeof($gidtype));
18959 if eval $compile_ok; then
18963 echo "(I can't execute the test program--guessing $gidsize.)" >&4
18966 echo "Your $zzz is $gidsize bytes long."
18971 echo "(I can't compile the test program--guessing $gidsize.)" >&4
18977 *_t) zzz="$gidtype" ;;
18980 echo "Checking the sign of $zzz..." >&4
18982 #include <sys/types.h>
18993 if eval $compile; then
18997 echo "(I can't execute the test program--guessing unsigned.)" >&4
19001 1) echo "Your $zzz is unsigned." ;;
19002 -1) echo "Your $zzz is signed." ;;
19008 echo "(I can't compile the test program--guessing unsigned.)" >&4
19014 if $test X"$quadtype" != X; then
19016 echo "Checking how to print 64-bit integers..." >&4
19018 if $test X"$sPRId64" = X -a X"$quadtype" = Xint; then
19019 $cat >try.c <<'EOCP'
19020 #include <sys/types.h>
19023 int q = 12345678901;
19024 printf("%ld\n", q);
19028 if eval $compile; then
19032 sPRId64='"d"'; sPRIi64='"i"'; sPRIu64='"u"';
19033 sPRIo64='"o"'; sPRIx64='"x"'; sPRIXU64='"X"';
19034 echo "We will use %d."
19040 if $test X"$sPRId64" = X -a X"$quadtype" = Xlong; then
19041 $cat >try.c <<'EOCP'
19042 #include <sys/types.h>
19045 long q = 12345678901;
19046 printf("%ld\n", q);
19050 if eval $compile; then
19054 sPRId64='"ld"'; sPRIi64='"li"'; sPRIu64='"lu"';
19055 sPRIo64='"lo"'; sPRIx64='"lx"'; sPRIXU64='"lX"';
19056 echo "We will use %ld."
19062 if $test X"$sPRId64" = X -a X"$i_inttypes" = X"$define" -a X"$quadtype" = Xint64_t; then
19063 $cat >try.c <<'EOCP'
19064 #include <sys/types.h>
19065 #include <inttypes.h>
19068 int64_t q = 12345678901;
19069 printf("%" PRId64 "\n", q);
19073 if eval $compile; then
19077 sPRId64=PRId64; sPRIi64=PRIi64; sPRIu64=PRIu64;
19078 sPRIo64=PRIo64; sPRIx64=PRIx64; sPRIXU64=PRIXU64;
19079 echo "We will use the C9X style."
19085 if $test X"$sPRId64" = X -a X"$quadtype" != X; then
19087 #include <sys/types.h>
19090 $quadtype q = 12345678901;
19091 printf("%Ld\n", q);
19095 if eval $compile; then
19099 sPRId64='"Ld"'; sPRIi64='"Li"'; sPRIu64='"Lu"';
19100 sPRIo64='"Lo"'; sPRIx64='"Lx"'; sPRIXU64='"LX"';
19101 echo "We will use %Ld."
19107 if $test X"$sPRId64" = X -a X"$quadtype" = X"long long"; then
19108 $cat >try.c <<'EOCP'
19109 #include <sys/types.h>
19112 long long q = 12345678901LL; /* AIX cc requires the LL suffix. */
19113 printf("%lld\n", q);
19117 if eval $compile; then
19121 sPRId64='"lld"'; sPRIi64='"lli"'; sPRIu64='"llu"';
19122 sPRIo64='"llo"'; sPRIx64='"llx"'; sPRIXU64='"llX"';
19123 echo "We will use the %lld style."
19129 if $test X"$sPRId64" = X -a X"$quadtype" != X; then
19131 #include <sys/types.h>
19134 $quadtype q = 12345678901;
19135 printf("%qd\n", q);
19139 if eval $compile; then
19143 sPRId64='"qd"'; sPRIi64='"qi"'; sPRIu64='"qu"';
19144 sPRIo64='"qo"'; sPRIx64='"qx"'; sPRIXU64='"qX"';
19145 echo "We will use %qd."
19151 if $test X"$sPRId64" = X; then
19152 echo "Cannot figure out how to print 64-bit integers." >&4
19160 '') d_PRId64="$undef"; d_PRIi64="$undef"; d_PRIu64="$undef";
19161 d_PRIo64="$undef"; d_PRIx64="$undef"; d_PRIXU64="$undef";
19163 *) d_PRId64="$define"; d_PRIi64="$define"; d_PRIu64="$define";
19164 d_PRIo64="$define"; d_PRIx64="$define"; d_PRIXU64="$define";
19170 $echo "Checking the format strings to be used for Perl's internal types..." >&4
19172 if $test X"$ivsize" = X8; then
19173 ivdformat="$sPRId64"
19174 uvuformat="$sPRIu64"
19175 uvoformat="$sPRIo64"
19176 uvxformat="$sPRIx64"
19177 uvXUformat="$sPRIXU64"
19179 if $test X"$ivsize" = X"$longsize"; then
19186 if $test X"$ivsize" = X"$intsize"; then
19194 if $test X"$ivsize" = X"$shortsize"; then
19205 if $test X"$uselongdouble" = X"$define" -a X"$d_longdbl" = X"$define" -a X"$d_PRIgldbl" = X"$define"; then
19206 nveformat="$sPRIeldbl"
19207 nvfformat="$sPRIfldbl"
19208 nvgformat="$sPRIgldbl"
19209 nvEUformat="$sPRIEUldbl"
19210 nvFUformat="$sPRIFUldbl"
19211 nvGUformat="$sPRIGUldbl"
19221 case "$ivdformat" in
19222 '') echo "$0: Fatal: failed to find format strings, cannot continue." >&4
19229 $echo "Checking the format string to be used for gids..." >&4
19232 -1) if $test X"$gidsize" = X"$ivsize"; then
19233 gidformat="$ivdformat"
19235 if $test X"$gidsize" = X"$longsize"; then
19238 if $test X"$gidsize" = X"$intsize"; then
19241 if $test X"$gidsize" = X"$shortsize"; then
19248 *) if $test X"$gidsize" = X"$uvsize"; then
19249 gidformat="$uvuformat"
19251 if $test X"$gidsize" = X"$longsize"; then
19254 if $test X"$gidsize" = X"$intsize"; then
19257 if $test X"$gidsize" = X"$shortsize"; then
19266 : see if getgroups exists
19267 set getgroups d_getgrps
19270 : see if setgroups exists
19271 set setgroups d_setgrps
19275 : Find type of 2nd arg to 'getgroups()' and 'setgroups()'
19277 case "$d_getgrps$d_setgrps" in
19279 case "$groupstype" in
19280 '') dflt="$gidtype" ;;
19281 *) dflt="$groupstype" ;;
19284 What type of pointer is the second argument to getgroups() and setgroups()?
19285 Usually this is the same as group ids, $gidtype, but not always.
19288 rp='What type pointer is the second argument to getgroups() and setgroups()?'
19292 *) groupstype="$gidtype";;
19296 if $test $patchlevel -lt 9; then
19297 : MAD is not available in 5.8.x or earlier.
19301 $define|true|[yY]*) dflt='y' ;;
19306 Would you like to build with Misc Attribute Decoration? This is development
19307 work leading to a Perl 5 to Perl 6 convertor, which imposes a space and speed
19308 overhead on the interpreter.
19310 If this doesn't make any sense to you, just accept the default '$dflt'.
19312 rp='Build Perl with MAD?'
19317 madlyh='madly.h madly.act madly.tab'
19319 madlyobj="madly$_o" ;;
19329 echo "Checking if your $make program sets \$(MAKE)..." >&4
19330 case "$make_set_make" in
19332 $sed 's/^X //' > testmake.mak << 'EOF'
19334 X @echo 'maketemp="$(MAKE)"'
19336 case "`$make -f testmake.mak 2>/dev/null`" in
19337 *maketemp=*) make_set_make='#' ;;
19338 *) make_set_make="MAKE=$make" ;;
19340 $rm -f testmake.mak
19343 case "$make_set_make" in
19344 '#') echo "Yup, it does.";;
19345 *) echo "Nope, it doesn't.";;
19348 : see what type is used for mode_t
19349 rp="What is the type used for file modes for system calls (e.g. fchmod())?"
19350 set mode_t modetype int stdio.h sys/types.h
19353 : see if we need va_copy
19355 case "$i_stdarg" in
19358 #include <stdarg.h>
19360 #$i_stdlib I_STDLIB
19362 #include <stdlib.h>
19364 #include <signal.h>
19367 ivfprintf(FILE *f, const char *fmt, va_list *valp)
19369 return vfprintf(f, fmt, *valp);
19373 myvfprintf(FILE *f, const char *fmt, va_list val)
19375 return ivfprintf(f, fmt, &val);
19379 myprintf(char *fmt, ...)
19382 va_start(val, fmt);
19383 return myvfprintf(stdout, fmt, val);
19387 main(int ac, char **av)
19389 signal(SIGSEGV, exit);
19391 myprintf("%s%cs all right, then\n", "that", '\'');
19396 if eval $compile && $run ./try 2>&1 >/dev/null; then
19397 case "`$run ./try`" in
19398 "that's all right, then")
19404 yes) echo "It seems that you don't need va_copy()." >&4
19405 need_va_copy="$undef"
19407 *) echo "It seems that va_copy() or similar will be needed." >&4
19408 need_va_copy="$define"
19411 $rm -f try.* core core.* *.core *.core.*
19413 *) echo "You don't have <stdarg.h>, not checking for va_copy()." >&4
19417 : see what type is used for size_t
19418 rp="What is the type used for the length parameter for string functions?"
19419 set size_t sizetype 'unsigned int' stdio.h sys/types.h
19422 : check for type of arguments to gethostbyaddr.
19423 if test "X$netdb_host_type" = X -o "X$netdb_hlen_type" = X; then
19424 case "$d_gethbyaddr" in
19428 Checking to see what type of arguments are accepted by gethostbyaddr().
19430 hdrs="$define sys/types.h
19431 $d_socket sys/socket.h
19432 $i_niin netinet/in.h
19434 $i_unistd unistd.h"
19435 : The first arg can 'char *' or 'void *'
19436 : The second arg is some of integral type
19437 for xxx in in_addr_t 'const void *' 'const char *' 'void *' 'char *'; do
19438 for yyy in size_t long int; do
19439 case "$netdb_host_type" in
19440 '') try="extern struct hostent *gethostbyaddr($xxx, $yyy, int);"
19441 if ./protochk "$try" $hdrs; then
19442 echo "Your system accepts $xxx for the first arg."
19443 echo "...and $yyy for the second arg."
19444 netdb_host_type="$xxx"
19445 netdb_hlen_type="$yyy"
19451 : In case none of those worked, prompt the user.
19452 case "$netdb_host_type" in
19453 '') rp='What is the type for the 1st argument to gethostbyaddr?'
19456 netdb_host_type=$ans
19457 rp='What is the type for the 2nd argument to gethostbyaddr?'
19460 netdb_hlen_type=$ans
19464 *) : no gethostbyaddr, so pick harmless defaults
19465 netdb_host_type='char *'
19466 netdb_hlen_type="$sizetype"
19469 # Remove the "const" if needed. -- but then we'll have a
19471 # netdb_host_type=`echo "$netdb_host_type" | sed 's/^const //'`
19474 : check for type of argument to gethostbyname.
19475 if test "X$netdb_name_type" = X ; then
19476 case "$d_gethbyname" in
19480 Checking to see what type of argument is accepted by gethostbyname().
19482 hdrs="$define sys/types.h
19483 $d_socket sys/socket.h
19484 $i_niin netinet/in.h
19486 $i_unistd unistd.h"
19487 for xxx in "const char *" "char *"; do
19488 case "$netdb_name_type" in
19489 '') try="extern struct hostent *gethostbyname($xxx);"
19490 if ./protochk "$try" $hdrs; then
19491 echo "Your system accepts $xxx."
19492 netdb_name_type="$xxx"
19497 : In case none of those worked, prompt the user.
19498 case "$netdb_name_type" in
19499 '') rp='What is the type for the 1st argument to gethostbyname?'
19502 netdb_name_type=$ans
19506 *) : no gethostbyname, so pick harmless default
19507 netdb_name_type='char *'
19512 : check for type of 1st argument to getnetbyaddr.
19513 if test "X$netdb_net_type" = X ; then
19514 case "$d_getnbyaddr" in
19518 Checking to see what type of 1st argument is accepted by getnetbyaddr().
19520 hdrs="$define sys/types.h
19521 $d_socket sys/socket.h
19522 $i_niin netinet/in.h
19524 $i_unistd unistd.h"
19525 for xxx in in_addr_t "unsigned long" long "unsigned int" int; do
19526 case "$netdb_net_type" in
19527 '') try="extern struct netent *getnetbyaddr($xxx, int);"
19528 if ./protochk "$try" $hdrs; then
19529 echo "Your system accepts $xxx."
19530 netdb_net_type="$xxx"
19535 : In case none of those worked, prompt the user.
19536 case "$netdb_net_type" in
19537 '') rp='What is the type for the 1st argument to getnetbyaddr?'
19540 netdb_net_type=$ans
19544 *) : no getnetbyaddr, so pick harmless default
19545 netdb_net_type='long'
19549 : locate the preferred pager for this system
19556 [a-zA-Z]:/*) dflt=$pg;;
19560 [a-zA-Z]:/*) dflt=$more;;
19564 [a-zA-Z]:/*) dflt=$less;;
19567 '') dflt=/usr/ucb/more;;
19571 : Instruct ./getfile to trust the hinted or previous pager value,
19572 : even if it does not begin with a slash. For example, on os2,
19573 : pager might be cmd /c more. See comments in UU/getfile.
19578 rp='What pager is used on your system?'
19582 : see what type pids are declared as in the kernel
19583 rp="What is the type of process ids on this system?"
19584 set pid_t pidtype int stdio.h sys/types.h
19587 : see if ar generates random libraries by itself
19589 echo "Checking how to generate random libraries on your machine..." >&4
19590 echo 'int bar1() { return bar2(); }' > bar1.c
19591 echo 'int bar2() { return 2; }' > bar2.c
19593 #$i_stdlib I_STDLIB
19595 #include <stdlib.h>
19597 int main() { printf("%d\n", bar1()); exit(0); }
19599 $cc $ccflags -c bar1.c >/dev/null 2>&1
19600 $cc $ccflags -c bar2.c >/dev/null 2>&1
19601 $cc $ccflags -c foo.c >/dev/null 2>&1
19602 $ar rc bar$_a bar2$_o bar1$_o >/dev/null 2>&1
19603 if $cc -o foobar $ccflags $ldflags foo$_o bar$_a $libs > /dev/null 2>&1 &&
19604 $run ./foobar >/dev/null 2>&1; then
19605 echo "$ar appears to generate random libraries itself."
19607 if [ "X$ranlib" = "X" ]; then
19610 elif $ar s bar$_a >/dev/null 2>&1 &&
19611 $cc -o foobar $ccflags $ldflags foo$_o bar$_a $libs > /dev/null 2>&1 &&
19612 $run ./foobar >/dev/null 2>&1; then
19613 echo "a table of contents needs to be added with '$ar s'."
19616 elif $ar ts bar$_a >/dev/null 2>&1 &&
19617 $cc -o foobar $ccflags $ldflags foo$_o bar$_a $libs > /dev/null 2>&1 &&
19618 $run ./foobar >/dev/null 2>&1; then
19619 echo "a table of contents needs to be added with '$ar ts'."
19626 ranlib=`./loc ranlib X /usr/bin /bin /usr/local/bin`
19627 $test -f $ranlib || ranlib=''
19630 if $test -n "$ranlib"; then
19631 echo "your system has '$ranlib'; we'll use that."
19634 echo "your system doesn't seem to support random libraries"
19635 echo "so we'll use lorder and tsort to order the libraries."
19642 : check for type of arguments to select.
19643 case "$selecttype" in
19644 '') case "$d_select" in
19648 Checking to see what type of arguments are accepted by select().
19650 hdrs="$define sys/types.h
19651 $i_systime sys/time.h
19652 $i_sysselct sys/select.h
19653 $d_socket sys/socket.h"
19654 : The first arg can be int, unsigned, or size_t
19655 : The last arg may or may not be 'const'
19657 : void pointer has been seen but using that
19658 : breaks the selectminbits test
19659 for xxx in 'fd_set *' 'int *'; do
19660 for nfd in 'int' 'size_t' 'unsigned long' 'unsigned' ; do
19661 for tmo in 'struct timeval *' 'const struct timeval *'; do
19663 '') try="extern select _(($nfd, $xxx, $xxx, $xxx, $tmo));"
19664 if ./protochk "$try" $hdrs; then
19665 echo "Your system accepts $xxx."
19674 '') rp='What is the type for the 2nd, 3rd, and 4th arguments to select?'
19675 case "$d_fd_set" in
19676 $define) dflt="fd_set *" ;;
19685 *) : no select, so pick a harmless default
19692 : check for the select 'width'
19693 case "$selectminbits" in
19694 '') safebits=`expr $ptrsize \* 8`
19695 case "$d_select" in
19699 Checking to see on how many bits at a time your select() operates...
19702 #include <sys/types.h>
19704 #$i_systime I_SYS_TIME
19705 #$i_systimek I_SYS_TIME_KERNEL
19710 # ifdef I_SYS_TIME_KERNEL
19713 # include <sys/time.h>
19714 # ifdef I_SYS_TIME_KERNEL
19718 #$i_sysselct I_SYS_SELECT
19719 #ifdef I_SYS_SELECT
19720 #include <sys/select.h>
19722 #$d_socket HAS_SOCKET
19724 # include <sys/socket.h> /* Might include <sys/bsdtypes.h> */
19727 #$i_stdlib I_STDLIB
19729 #include <stdlib.h>
19732 #define S sizeof(*(b))
19734 #define NBYTES (S * 8 > MINBITS ? S : MINBITS/8)
19735 #define NBITS (NBYTES * 8)
19737 char *s = (char *)malloc(NBYTES);
19746 fp = fopen("try.c", "r");
19752 b = ($selecttype)s;
19753 for (i = 0; i < NBITS; i++)
19757 select(fd + 1, b, 0, 0, &t);
19758 for (i = NBITS - 1; i > fd && FD_ISSET(i, b); i--);
19760 printf("%d\n", i + 1);
19765 if eval $compile_ok; then
19766 selectminbits=`$run ./try`
19767 case "$selectminbits" in
19769 Cannot figure out on how many bits at a time your select() operates.
19770 I'll play safe and guess it is $safebits bits.
19772 selectminbits=$safebits
19773 bits="$safebits bits"
19776 *) bits="$selectminbits bits" ;;
19778 echo "Your select() operates on $bits at a time." >&4
19780 rp='What is the minimum number of bits your select() operates on?'
19781 case "$byteorder" in
19782 12345678) dflt=64 ;;
19788 selectminbits="$val"
19792 *) : no select, so pick a harmless default
19793 selectminbits=$safebits
19799 : Trace out the files included by signal.h, then look for SIGxxx names.
19800 : Remove SIGARRAYSIZE used by HPUX.
19801 : Remove SIGSTKSIZE used by Linux.
19802 : Remove SIGSTKSZ used by Posix.
19803 : Remove SIGTYP void lines used by OS2.
19804 : Some cpps, like os390, dont give the file name anywhere
19805 if [ "X$fieldn" = X ]; then
19806 : Just make some guesses. We check them later.
19807 xxx='/usr/include/signal.h /usr/include/sys/signal.h'
19809 xxx=`echo '#include <signal.h>' |
19810 $cppstdin $cppminus $cppflags 2>/dev/null |
19811 $grep '^[ ]*#.*include' |
19812 $awk "{print \\$$fieldn}" | $sed 's!"!!g' | $sed 's!\\\\\\\\!/!g' | $sort | $uniq`
19814 : Check this list of files to be sure we have parsed the cpp output ok.
19815 : This will also avoid potentially non-existent files, such
19818 for xx in $xxx /dev/null ; do
19819 $test -f "$xx" && xxxfiles="$xxxfiles $xx"
19821 : If we have found no files, at least try signal.h
19822 case "$xxxfiles" in
19823 '') xxxfiles=`./findhdr signal.h` ;;
19826 $1 ~ /^#define$/ && $2 ~ /^SIG[A-Z0-9]*$/ && $2 !~ /SIGARRAYSIZE/ && $2 !~ /SIGSTKSIZE/ && $2 !~ /SIGSTKSZ/ && $3 !~ /void/ {
19827 print substr($2, 4, 20)
19829 $1 == "#" && $2 ~ /^define$/ && $3 ~ /^SIG[A-Z0-9]*$/ && $3 !~ /SIGARRAYSIZE/ && $4 !~ /void/ {
19830 print substr($3, 4, 20)
19832 : Append some common names just in case the awk scan failed.
19833 xxx="$xxx ABRT ALRM BUS CANCEL CHLD CLD CONT DIL EMT FPE"
19834 xxx="$xxx FREEZE HUP ILL INT IO IOT KILL LOST LWP PHONE"
19835 xxx="$xxx PIPE POLL PROF PWR QUIT RTMAX RTMIN SEGV STKFLT STOP"
19836 xxx="$xxx SYS TERM THAW TRAP TSTP TTIN TTOU URG USR1 USR2"
19837 xxx="$xxx USR3 USR4 VTALRM WAITING WINCH WIND WINDOW XCPU XFSZ"
19839 : generate a few handy files for later
19840 $cat > signal.c <<EOCP
19841 #include <sys/types.h>
19842 #include <signal.h>
19843 #$i_stdlib I_STDLIB
19845 #include <stdlib.h>
19850 /* Strange style to avoid deeply-nested #if/#else/#endif */
19853 # define NSIG (_NSIG)
19859 # define NSIG (SIGMAX+1)
19865 # define NSIG (SIG_MAX+1)
19871 # define NSIG (_SIG_MAX+1)
19877 # define NSIG (MAXSIG+1)
19883 # define NSIG (MAX_SIG+1)
19888 # ifdef SIGARRAYSIZE
19889 # define NSIG SIGARRAYSIZE /* Assume ary[SIGARRAYSIZE] */
19895 # define NSIG (_sys_nsig) /* Solaris 2.5 */
19899 /* Default to some arbitrary number that's big enough to get most
19900 of the common signals.
19906 printf("NSIG %d\n", NSIG);
19912 echo $xxx | $tr ' ' $trnl | $sort | $uniq | $awk '
19914 printf "#ifdef SIG"; printf $1; printf "\n"
19915 printf "printf(\""; printf $1; printf " %%d\\n\",SIG";
19916 printf $1; printf ");\n"
19920 printf "#endif /* JUST_NSIG */\n";
19921 printf "exit(0);\n}\n";
19924 $cat >signal.awk <<'EOP'
19925 BEGIN { ndups = 0 }
19926 $1 ~ /^NSIG$/ { nsig = $2 }
19927 ($1 !~ /^NSIG$/) && (NF == 2) && ($2 ~ /^[0-9][0-9]*$/) {
19928 if ($2 > maxsig) { maxsig = $2 }
19929 if (sig_name[$2]) {
19930 dup_name[ndups] = $1
19931 dup_num[ndups] = $2
19943 printf("NSIG %d\n", nsig);
19944 for (n = 1; n < nsig; n++) {
19946 printf("%s %d\n", sig_name[n], sig_num[n])
19949 printf("NUM%d %d\n", n, n)
19952 for (n = 0; n < ndups; n++) {
19953 printf("%s %d\n", dup_name[n], dup_num[n])
19957 $cat >signal_cmd <<EOS
19959 if $test -s signal.lst; then
19960 echo "Using your existing signal.lst file"
19965 $cat >>signal_cmd <<'EOS'
19968 if eval $compile_ok; then
19969 $run ./signal$_exe | ($sort -n -k 2 2>/dev/null || $sort -n +1) | $uniq | $awk -f signal.awk >signal.lst
19971 echo "(I can't seem be able to compile the whole test program)" >&4
19972 echo "(I'll try it in little pieces.)" >&4
19973 set signal -DJUST_NSIG
19974 if eval $compile_ok; then
19975 $run ./signal$_exe > signal.nsg
19978 echo "I can't seem to figure out how many signals you have." >&4
19979 echo "Guessing 50." >&4
19980 echo 'NSIG 50' > signal.nsg
19982 : Now look at all the signal names, one at a time.
19983 for xx in `echo $xxx | $tr ' ' $trnl | $sort | $uniq`; do
19984 $cat > signal.c <<EOCP
19985 #include <sys/types.h>
19986 #include <signal.h>
19989 printf("$xx %d\n", SIG${xx});
19994 if eval $compile; then
19995 echo "SIG${xx} found."
19996 $run ./signal$_exe >> signal.ls1
19998 echo "SIG${xx} NOT found."
20001 if $test -s signal.ls1; then
20002 $cat signal.nsg signal.ls1 |
20003 $sort -n | $uniq | $awk -f signal.awk >signal.lst
20007 if $test -s signal.lst; then
20010 echo "(AAK! I can't compile the test programs -- Guessing)" >&4
20011 echo 'kill -l' >signal
20012 set X `csh -f <signal`
20016 0) set HUP INT QUIT ILL TRAP ABRT EMT FPE KILL BUS SEGV SYS PIPE ALRM TERM;;
20018 echo $@ | $tr ' ' $trnl | \
20019 $awk '{ printf "%s %d\n", $1, ++s; }
20020 END { printf "NSIG %d\n", ++s }' >signal.lst
20022 $rm -f signal.c signal$_exe signal$_o signal.nsg signal.ls1
20024 chmod a+x signal_cmd
20025 $eunicefix signal_cmd
20027 : generate list of signal names
20029 case "$sig_name_init" in
20031 *) case "$sig_num_init" in
20032 ''|*,*) doinit=yes ;;
20037 echo "Generating a list of signal names and numbers..." >&4
20039 sig_count=`$awk '/^NSIG/ { printf "%d", $2 }' signal.lst`
20040 sig_name=`$awk 'BEGIN { printf "ZERO " }
20041 !/^NSIG/ { printf "%s ", $1 }' signal.lst`
20042 sig_num=`$awk 'BEGIN { printf "0 " }
20043 !/^NSIG/ { printf "%d ", $2 }' signal.lst`
20044 sig_name_init=`$awk 'BEGIN { printf "\"ZERO\", " }
20045 !/^NSIG/ { printf "\"%s\", ", $1 }
20046 END { printf "0\n" }' signal.lst`
20047 sig_num_init=`$awk 'BEGIN { printf "0, " }
20048 !/^NSIG/ { printf "%d, ", $2}
20049 END { printf "0\n"}' signal.lst`
20052 echo "The following $sig_count signals are available:"
20054 echo $sig_name | $awk \
20055 'BEGIN { linelen = 0 }
20057 for (i = 1; i <= NF; i++) {
20058 name = "SIG" $i " "
20059 linelen = linelen + length(name)
20060 if (linelen > 70) {
20062 linelen = length(name)
20068 sig_size=`echo $sig_name | awk '{print NF}'`
20069 $rm -f signal signal.c signal.awk signal.lst signal_cmd
20072 case "$sizetype" in
20073 *_t) zzz="$sizetype" ;;
20074 *) zzz="filesize" ;;
20076 echo "Checking the size of $zzz..." >&4
20078 #include <sys/types.h>
20080 #$i_stdlib I_STDLIB
20082 #include <stdlib.h>
20085 printf("%d\n", (int)sizeof($sizetype));
20090 if eval $compile_ok; then
20094 echo "(I can't execute the test program--guessing $sizesize.)" >&4
20097 echo "Your $zzz size is $sizesize bytes."
20102 echo "(I can't compile the test program--guessing $sizesize.)" >&4
20106 : check for socklen_t
20108 echo "Checking to see if you have socklen_t..." >&4
20110 #include <sys/types.h>
20111 #$d_socket HAS_SOCKET
20113 #include <sys/socket.h>
20115 int main() { socklen_t x = 16; }
20118 if eval $compile; then
20120 echo "You have socklen_t."
20123 echo "You do not have socklen_t."
20124 case "$sizetype" in
20125 size_t) echo "(You do have size_t, that might work. Some people are happy with just an int.)" ;;
20132 : see if this is a socks.h system
20133 set socks.h i_socks
20136 : check for type of the size argument to socket calls
20137 case "$d_socket" in
20141 Checking to see what type is the last argument of accept().
20144 case "$d_socklen_t" in
20145 "$define") yyy="$yyy socklen_t"
20147 yyy="$yyy $sizetype int long unsigned"
20148 for xxx in $yyy; do
20149 case "$socksizetype" in
20150 '') try="extern int accept(int, struct sockaddr *, $xxx *);"
20151 case "$usesocks" in
20153 if ./protochk "$try" $i_systypes sys/types.h $d_socket sys/socket.h literal '#define INCLUDE_PROTOTYPES' $i_socks socks.h.; then
20154 echo "Your system accepts '$xxx *' for the last argument of accept()."
20155 socksizetype="$xxx"
20158 *) if ./protochk "$try" $i_systypes sys/types.h $d_socket sys/socket.h; then
20159 echo "Your system accepts '$xxx *' for the last argument of accept()."
20160 socksizetype="$xxx"
20167 : In case none of those worked, prompt the user.
20168 case "$socksizetype" in
20169 '') rp='What is the type for socket address structure sizes?'
20176 *) : no sockets, so pick relatively harmless default
20181 : see what type is used for signed size_t
20182 set ssize_t ssizetype int stdio.h sys/types.h
20187 #$i_stdlib I_STDLIB
20189 #include <stdlib.h>
20191 #include <sys/types.h>
20192 #define Size_t $sizetype
20193 #define SSize_t $dflt
20196 if (sizeof(Size_t) == sizeof(SSize_t))
20198 else if (sizeof(Size_t) == sizeof(int))
20207 if eval $compile_ok && $run ./try > /dev/null; then
20208 ssizetype=`$run ./try`
20209 echo "I'll be using $ssizetype for functions returning a byte count." >&4
20212 Help! I can't compile and run the ssize_t test program: please enlighten me!
20213 (This is probably a misconfiguration in your system or libraries, and
20214 you really ought to fix it. Still, I'll try anyway.)
20216 I need a type that is the same size as $sizetype, but is guaranteed to
20217 be signed. Common values are ssize_t, int and long.
20220 rp="What signed type is the same size as $sizetype?"
20226 : see what type of char stdio uses.
20228 echo '#include <stdio.h>' > stdio.c
20229 $cppstdin $cppminus < stdio.c > stdioh
20230 if $contains 'unsigned.*char.*_ptr;' stdioh >/dev/null 2>&1 ; then
20231 echo "Your stdio uses unsigned chars." >&4
20232 stdchar="unsigned char"
20234 echo "Your stdio uses signed chars." >&4
20237 $rm -f stdio.* stdioh
20239 : see what type uids are declared as in the kernel
20241 echo "Looking for the type for user ids returned by getuid()."
20242 set uid_t uidtype xxx stdio.h sys/types.h
20246 xxx=`./findhdr sys/user.h`
20247 set `grep '_ruid;' "$xxx" 2>/dev/null` unsigned short
20249 unsigned) dflt="$1 $2" ;;
20253 *) dflt="$uidtype";;
20256 uid_t) echo "uid_t found." ;;
20257 *) rp="What is the type for user ids returned by getuid()?"
20265 *_t) zzz="$uidtype" ;;
20268 echo "Checking the size of $zzz..." >&4
20270 #include <sys/types.h>
20272 #$i_stdlib I_STDLIB
20274 #include <stdlib.h>
20277 printf("%d\n", (int)sizeof($uidtype));
20282 if eval $compile_ok; then
20286 echo "(I can't execute the test program--guessing $uidsize.)" >&4
20289 echo "Your $zzz is $uidsize bytes long."
20294 echo "(I can't compile the test program--guessing $uidsize.)" >&4
20299 *_t) zzz="$uidtype" ;;
20302 echo "Checking the sign of $zzz..." >&4
20304 #include <sys/types.h>
20315 if eval $compile; then
20319 echo "(I can't execute the test program--guessing unsigned.)" >&4
20323 1) echo "Your $zzz is unsigned." ;;
20324 -1) echo "Your $zzz is signed." ;;
20330 echo "(I can't compile the test program--guessing unsigned.)" >&4
20336 $echo "Checking the format string to be used for uids..." >&4
20339 -1) if $test X"$uidsize" = X"$ivsize"; then
20340 uidformat="$ivdformat"
20342 if $test X"$uidsize" = X"$longsize"; then
20345 if $test X"$uidsize" = X"$intsize"; then
20348 if $test X"$uidsize" = X"$shortsize"; then
20355 *) if $test X"$uidsize" = X"$uvsize"; then
20356 uidformat="$uvuformat"
20358 if $test X"$uidsize" = X"$longsize"; then
20361 if $test X"$uidsize" = X"$intsize"; then
20364 if $test X"$uidsize" = X"$shortsize"; then
20374 case "$usesitecustomize" in
20375 $define|true|[Yy]*)
20376 usesitecustomize="$define"
20379 usesitecustomize="$undef"
20383 : determine compiler compiler
20392 if $test -f "$byacc$_exe"; then
20394 comp="byacc or $comp"
20396 if $test -f "$bison$_exe"; then
20397 comp="$comp or bison -y"
20399 rp="Which compiler compiler ($comp) shall I use?"
20408 echo "(Adding -y option to bison to get yacc-compatible behaviour.)"
20414 : see if this is a fp.h system
20418 : see if this is a fp_class.h system
20419 set fp_class.h i_fp_class
20422 : see if gdbm.h is available
20427 : see if gdbm_open exists
20428 set gdbm_open d_gdbm_open
20430 case "$d_gdbm_open" in
20433 echo "We won't be including <gdbm.h>"
20442 : see if this is a ieeefp.h system
20443 case "$i_ieeefp" in
20444 '' ) set ieeefp.h i_ieeefp
20449 : see if this is a libutil.h system
20450 set libutil.h i_libutil
20453 : see if mach cthreads are available
20454 if test "X$usethreads" = "X$define"; then
20455 set mach/cthreads.h i_machcthr
20458 i_machcthr="$undef"
20463 : see if this is a mntent.h system
20464 set mntent.h i_mntent
20467 : see if ndbm.h is available
20473 # Some Linux distributions such as RedHat 7.1 put the
20474 # ndbm.h header in /usr/include/gdbm/ndbm.h.
20475 if $test -f /usr/include/gdbm/ndbm.h; then
20476 echo '<gdbm/ndbm.h> found.'
20477 ccflags="$ccflags -I/usr/include/gdbm"
20478 cppflags="$cppflags -I/usr/include/gdbm"
20486 : see if dbm_open exists
20487 set dbm_open d_dbm_open
20489 case "$d_dbm_open" in
20492 echo "We won't be including <ndbm.h>"
20501 : see if net/errno.h is available
20503 set net/errno.h val
20506 : Unfortunately, it causes problems on some systems. Arrgh.
20509 cat > try.c <<'EOM'
20512 #include <net/errno.h>
20518 if $cc $ccflags -c try.c >/dev/null 2>&1; then
20519 echo "We'll be including <net/errno.h>." >&4
20521 echo "We won't be including <net/errno.h>." >&4
20530 : see if netinet/tcp.h is available
20531 set netinet/tcp.h i_netinettcp
20534 : see if this is a poll.h system
20538 : see if this is a prot.h system
20543 $echo "Guessing which symbols your C compiler and preprocessor define..." >&4
20544 $cat <<'EOSH' > Cppsym.know
20545 a29k ABI64 aegis AES_SOURCE AIX AIX32 AIX370
20546 AIX41 AIX42 AIX43 AIX_SOURCE aixpc ALL_SOURCE
20547 alliant alpha am29000 AM29000 AMD64 amd64 amiga AMIGAOS AMIX
20548 ansi ANSI_C_SOURCE apollo ardent ARM32 atarist att386 att3b
20549 BeOS BIG_ENDIAN BIT_MSF bsd BSD bsd43 bsd4_2 bsd4_3 BSD4_3 bsd4_4
20550 BSD_4_3 BSD_4_4 BSD_NET2 BSD_TIME BSD_TYPES BSDCOMPAT bsdi
20551 bull c cadmus clipper CMU COFF COMPILER_VERSION
20552 concurrent convex cpu cray CRAY CRAYMPP ctix CX_UX
20553 CYGWIN DECC DGUX DGUX_SOURCE DJGPP dmert DOLPHIN DPX2 DSO
20554 Dynix DynixPTX ELF encore EPI EXTENSIONS FAVOR_BSD
20555 FILE_OFFSET_BITS FreeBSD GCC_NEW_VARARGS gcos gcx gimpel
20557 GNU_SOURCE GNUC GNUC_MINOR GNU_LIBRARY GO32 gould GOULD_PN
20558 H3050R H3050RX hbullx20 hcx host_mips
20559 hp200 hp300 hp700 HP700 hp800 hp9000
20560 hp9000s200 hp9000s300 hp9000s400 hp9000s500
20561 hp9000s700 hp9000s800 hp9k8 hp_osf hppa hpux HPUX_SOURCE
20562 i186 i286 i386 i486 i586 i686 i8086 i80960 i860 I960
20563 IA64 iAPX286 ibm ibm032 ibmesa IBMR2 ibmrt ILP32 ILP64
20564 INLINE_INTRINSICS INTRINSICS INT64 interdata is68k ksr1
20565 LANGUAGE_C LARGE_FILE_API LARGEFILE64_SOURCE
20566 LARGEFILE_SOURCE LFS64_LARGEFILE LFS_LARGEFILE
20567 Linux LITTLE_ENDIAN LONG64 LONG_DOUBLE LONG_LONG
20568 LONGDOUBLE LONGLONG LP64 luna luna88k Lynx
20569 M68000 m68k m88100 m88k M88KBCS_TARGET M_COFF
20570 M_I186 M_I286 M_I386 M_I8086 M_I86 M_I86SM M_SYS3
20571 M_SYS5 M_SYSIII M_SYSV M_UNIX M_XENIX MACH machine MachTen
20572 MATH_HAS_NO_SIDE_EFFECTS
20573 mc300 mc500 mc68000 mc68010 mc68020 mc68030 mc68040
20574 mc68060 mc68k mc68k32 mc700 mc88000 mc88100 merlin
20575 mert MiNT mips MIPS_FPSET MIPS_ISA MIPS_SIM MIPS_SZINT
20576 MIPS_SZLONG MIPS_SZPTR MIPSEB MIPSEL MODERN_C motorola
20577 mpeix MSDOS MTXINU MULTIMAX mvs MVS n16 ncl_el ncl_mr
20578 NetBSD news1500 news1700 news1800 news1900 news3700
20579 news700 news800 news900 NeXT NLS nonstopux ns16000 ns32000
20580 ns32016 ns32332 ns32k nsc32000
20581 OCS88 OEMVS OpenBSD os OS2 OS390 osf OSF1 OSF_SOURCE
20582 pa_risc PA_RISC1_1 PA_RISC2_0 PARAGON parisc
20583 pc532 pdp11 PGC PIC plexus PORTAR posix
20584 POSIX1B_SOURCE POSIX2_SOURCE POSIX4_SOURCE
20585 POSIX_C_SOURCE POSIX_SOURCE POWER
20586 PROTOTYPES PWB pyr QNX R3000 REENTRANT RES Rhapsody RISC6000
20587 riscix riscos RT S390 SA110 scs SCO sequent sgi SGI_SOURCE SH3 sinix
20588 SIZE_INT SIZE_LONG SIZE_PTR SOCKET_SOURCE SOCKETS_SOURCE
20589 sony sony_news sonyrisc sparc sparclite spectrum
20590 stardent stdc STDC_EXT stratos sun sun3 sun386
20591 Sun386i svr3 svr4 SVR4_2 SVR4_SOURCE svr5
20592 SX system SYSTYPE_BSD SYSTYPE_BSD43 SYSTYPE_BSD44
20593 SYSTYPE_SVR4 SYSTYPE_SVR5 SYSTYPE_SYSV SYSV SYSV3 SYSV4 SYSV5
20594 sysV68 sysV88 Tek4132 Tek4300 titan
20595 TM3200 TM5400 TM5600
20596 tower tower32 tower32_200 tower32_600 tower32_700
20597 tower32_800 tower32_850 tss
20598 u370 u3b u3b2 u3b20 u3b200 u3b20d u3b5
20599 ultrix UMAXV UnicomPBB UnicomPBD UNICOS UNICOSMK
20600 unix UNIX95 UNIX99 unixpc unos
20601 USE_BSD USE_FILE_OFFSET64 USE_GNU USE_ISOC9X USE_LARGEFILE USE_LARGEFILE64
20602 USE_MISC USE_POSIX USE_POSIX199309 USE_POSIX199506 USE_POSIX2
20603 USE_REENTRANT USE_SVID USE_UNIX98 USE_XOPEN USE_XOPEN_EXTENDED
20605 Utek UTek UTS UWIN uxpm uxps vax venix VMESA vms x86_64 xenix Xenix286
20606 XOPEN_SOURCE XOPEN_SOURCE_EXTENDED XPG2 XPG2_EXTENDED
20607 XPG3 XPG3_EXTENDED XPG4 XPG4_EXTENDED
20610 # Maybe put other stuff here too.
20611 cat <<EOSH >>Cppsym.know
20614 ./tr '[a-z]' '[A-Z]' < Cppsym.know > Cppsym.a
20615 ./tr '[A-Z]' '[a-z]' < Cppsym.know > Cppsym.b
20616 $cat Cppsym.know > Cppsym.c
20617 $cat Cppsym.a Cppsym.b Cppsym.c | $tr ' ' $trnl | $sort | $uniq > Cppsym.know
20618 $rm -f Cppsym.a Cppsym.b Cppsym.c
20619 cat <<EOSH > Cppsym
20621 if $test \$# -gt 0; then
20622 echo \$* | $tr " " "$trnl" | ./Cppsym.try > Cppsym.got
20623 if $test -s Cppsym.got; then
20630 $tr " " "$trnl" | ./Cppsym.try
20636 cat <<EOSH > Cppsym.try
20638 cat <<'EOCP' > try.c
20641 #define STRINGIFY(a) "a"
20643 #if cpp_stuff == 42
20644 #define StGiFy(a) #a
20645 #define STRINGIFY(a) StGiFy(a)
20647 #if $cpp_stuff != 1 && $cpp_stuff != 42
20648 # include "Bletch: How does this C preprocessor stringify macros?"
20654 cat <<'EOSH' >> Cppsym.try
20656 printf "#ifdef %s\nprintf(\"%s=%%s\\n\", STRINGIFY(%s));\n#endif\n", $1, $1, $1
20657 printf "#ifdef _%s\nprintf(\"_%s=%%s\\n\", STRINGIFY(_%s));\n#endif\n", $1, $1, $1
20658 printf "#ifdef __%s\nprintf(\"__%s=%%s\\n\", STRINGIFY(__%s));\n#endif\n", $1, $1, $1
20659 printf "#ifdef __%s__\nprintf(\"__%s__=%%s\\n\", STRINGIFY(__%s__));\n#endif\n", $1, $1, $1
20661 echo 'return 0;}' >> try.c
20663 cat <<EOSH >> Cppsym.try
20665 case "$osname-$gccversion" in
20666 irix-) ccflags="\$ccflags -woff 1178" ;;
20667 os2-*) ccflags="\$ccflags -Zlinker /PM:VIO" ;;
20669 $cc -o try -Dcpp_stuff=$cpp_stuff $optimize \$ccflags $ldflags try.c $libs && $run ./try | $sed 's/ /\\\\ /g'
20671 chmod +x Cppsym.try
20672 $eunicefix Cppsym.try
20673 ./Cppsym < Cppsym.know > Cppsym.true
20674 : Add in any linux cpp "predefined macros":
20675 case "$osname::$gccversion" in
20678 rm -f $tHdrH'.h' $tHdrH
20680 if cpp -dM $tHdrH'.h' > $tHdrH'_cppsym.h' && [ -s $tHdrH'_cppsym.h' ]; then
20681 sed 's/#define[\ \ ]*//;s/[\ \ ].*$//' <$tHdrH'_cppsym.h' >$tHdrH'_cppsym.real'
20682 if [ -s $tHdrH'_cppsym.real' ]; then
20683 cat $tHdrH'_cppsym.real' Cppsym.know | sort | uniq | ./Cppsym | sort | uniq > Cppsym.true
20686 rm -f $tHdrH'.h' $tHdrH'_cppsym.h' $tHdrH'_cppsym.real'
20689 : now check the C compiler for additional symbols
20690 postprocess_cc_v=''
20692 aix) postprocess_cc_v="|$tr , ' '" ;;
20699 for i in \`$cc -v -c tmp.c 2>&1 $postprocess_cc_v\`
20702 -D*) echo "\$i" | $sed 's/^-D//';;
20703 -A*) $test "$gccversion" && echo "\$i" | $sed 's/^-A//' | $sed 's/\(.*\)(\(.*\))/\1=\2/';;
20708 postprocess_cc_v=''
20711 ./ccsym > ccsym1.raw
20712 if $test -s ccsym1.raw; then
20713 $sort ccsym1.raw | $uniq >ccsym.raw
20715 mv ccsym1.raw ccsym.raw
20718 $awk '/\=/ { print $0; next }
20719 { print $0"=1" }' ccsym.raw >ccsym.list
20720 $comm -13 Cppsym.true ccsym.list >ccsym.own
20721 $comm -12 Cppsym.true ccsym.list >ccsym.com
20722 $comm -23 Cppsym.true ccsym.list >ccsym.cpp
20724 if $test -z ccsym.raw; then
20725 echo "Your C compiler doesn't seem to define any symbols!" >&4
20727 echo "However, your C preprocessor defines the following symbols:"
20730 cppsymbols=`$cat Cppsym.true`
20731 cppsymbols=`echo $cppsymbols`
20732 cppccsymbols="$cppsymbols"
20734 if $test -s ccsym.com; then
20735 echo "Your C compiler and pre-processor define these symbols:"
20736 $sed -e 's/\(..*\)=.*/\1/' ccsym.com
20739 cppccsymbols=`$cat ccsym.com`
20740 cppccsymbols=`echo $cppccsymbols`
20741 $test "$silent" || sleep 1
20743 if $test -s ccsym.cpp; then
20744 $test "$also" && echo " "
20745 echo "Your C pre-processor ${also}defines the following symbols:"
20746 $sed -e 's/\(..*\)=.*/\1/' ccsym.cpp
20748 cppsymbols=`$cat ccsym.cpp`
20749 cppsymbols=`echo $cppsymbols`
20750 $test "$silent" || sleep 1
20752 if $test -s ccsym.own; then
20753 $test "$also" && echo " "
20754 echo "Your C compiler ${also}defines the following cpp symbols:"
20755 $sed -e 's/\(..*\)=1/\1/' ccsym.own
20756 $sed -e 's/\(..*\)=.*/\1/' ccsym.own | $uniq >>Cppsym.true
20757 ccsymbols=`$cat ccsym.own`
20758 ccsymbols=`echo $ccsymbols`
20759 $test "$silent" || sleep 1
20763 : see if this is a termio system
20767 if $test `./findhdr termios.h`; then
20768 set tcsetattr i_termios
20774 "$define") echo "You have POSIX termios.h... good!" >&4;;
20775 *) if ./Cppsym pyr; then
20776 case "`/bin/universe`" in
20777 ucb) if $test `./findhdr sgtty.h`; then
20779 echo "<sgtty.h> found." >&4
20781 echo "System is pyramid with BSD universe."
20782 echo "<sgtty.h> not found--you could have problems." >&4
20784 *) if $test `./findhdr termio.h`; then
20786 echo "<termio.h> found." >&4
20788 echo "System is pyramid with USG universe."
20789 echo "<termio.h> not found--you could have problems." >&4
20793 if $test `./findhdr termio.h`; then
20794 echo "<termio.h> found." >&4
20796 elif $test `./findhdr sgtty.h`; then
20797 echo "<sgtty.h> found." >&4
20800 echo "Neither <termio.h> nor <sgtty.h> found--you could have problems." >&4
20803 if $test `./findhdr sgtty.h`; then
20804 echo "<sgtty.h> found." >&4
20806 elif $test `./findhdr termio.h`; then
20807 echo "<termio.h> found." >&4
20810 echo "Neither <sgtty.h> nor <termio.h> found--you could have problems." >&4
20814 set i_termio; eval $setvar
20815 val=$val2; set i_sgtty; eval $setvar
20816 val=$val3; set i_termios; eval $setvar
20818 : see if stddef is available
20819 set stddef.h i_stddef
20822 : see if this is a sunmath.h system
20823 set sunmath.h i_sunmath
20826 : see if sys/access.h is available
20827 set sys/access.h i_sysaccess
20830 : see if ioctl defs are in sgtty, termio, sys/filio or sys/ioctl
20831 set sys/filio.h i_sysfilio
20834 if $test `./findhdr sys/ioctl.h`; then
20836 echo '<sys/ioctl.h> found.' >&4
20839 if $test $i_sysfilio = "$define"; then
20840 echo '<sys/ioctl.h> NOT found.' >&4
20842 $test $i_sgtty = "$define" && xxx="sgtty.h"
20843 $test $i_termio = "$define" && xxx="termio.h"
20844 $test $i_termios = "$define" && xxx="termios.h"
20845 echo "No <sys/ioctl.h> found, assuming ioctl args are defined in <$xxx>." >&4
20851 : see if socket ioctl defs are in sys/sockio.h
20853 xxx=`./findhdr sys/sockio.h`
20854 if $test "$xxx"; then
20855 if $contains SIOCATMARK $xxx >/dev/null 2>&1; then
20857 echo "You have socket ioctls defined in <sys/sockio.h>." >&4
20860 echo "No socket ioctls found in <sys/sockio.h>." >&4
20865 <sys/sockio.h> not found, assuming socket ioctls are in <sys/ioctl.h>.
20872 : see if this is a syslog.h system
20873 set syslog.h i_syslog
20877 : see if this is a sys/mode.h system
20878 set sys/mode.h i_sysmode
20881 : see if sys/resource.h has to be included
20882 set sys/resource.h i_sysresrc
20885 : see if sys/security.h is available
20886 set sys/security.h i_syssecrt
20889 : see if this is a sys/statvfs.h system
20890 set sys/statvfs.h i_sysstatvfs
20893 : see if this is a sys/un.h system
20894 set sys/un.h i_sysun
20898 : see if this is a sys/utsname.h system
20899 set sys/utsname.h i_sysutsname
20902 : see if this is a syswait system
20903 set sys/wait.h i_syswait
20906 : see if this is a ustat.h system
20907 set ustat.h i_ustat
20910 : see if this is an utime system
20911 set utime.h i_utime
20914 : see if this is a values.h system
20915 set values.h i_values
20918 : see if this is a vfork system
20921 set vfork.h i_vfork
20930 echo "Looking for extensions..." >&4
20931 : If we are using the old config.sh, known_extensions may contain
20932 : old or inaccurate or duplicate values.
20933 known_extensions=''
20934 nonxs_extensions=''
20935 : We do not use find because it might not be available.
20936 : We do not just use MANIFEST because the user may have dropped
20937 : some additional extensions into the source tree and expect them
20940 : Function to recursively find available extensions, ignoring DynaLoader
20941 : NOTE: recursion limit of 10 to prevent runaway in case of symlink madness
20945 DynaLoader|dynaload) ;;
20947 if $test -f $xxx/$xxx.xs; then
20948 known_extensions="$known_extensions $1$xxx";
20949 elif $test -f $xxx/Makefile.PL; then
20950 nonxs_extensions="$nonxs_extensions $1$xxx";
20952 if $test -d $xxx -a $# -lt 10; then
20955 eval $find_extensions;
20967 eval $find_extensions
20968 # Special case: Add in threads/shared since it is not picked up by the
20969 # recursive find above (and adding in general recursive finding breaks
20970 # SDBM_File/sdbm). A.D. 10/25/2001.
20971 known_extensions="$known_extensions threads/shared"
20972 set X $nonxs_extensions
20974 nonxs_extensions="$*"
20975 set X $known_extensions
20977 known_extensions="$*"
20980 : Now see which are supported on this system.
20982 for xxx in $known_extensions ; do
20986 $define) avail_ext="$avail_ext $xxx" ;;
20989 GDBM_File|gdbm_fil)
20991 $define) avail_ext="$avail_ext $xxx" ;;
20994 I18N/Langinfo|i18n_lan)
20995 case "$i_langinfo$d_nl_langinfo" in
20996 $define$define) avail_ext="$avail_ext $xxx" ;;
20999 NDBM_File|ndbm_fil)
21002 case "$osname-$use64bitint" in
21005 *-lndbm*) avail_ext="$avail_ext $xxx" ;;
21008 *) avail_ext="$avail_ext $xxx" ;;
21013 ODBM_File|odbm_fil)
21014 case "${i_dbm}${i_rpcsvcdbm}" in
21016 case "$osname-$use64bitint" in
21019 *-ldbm*) avail_ext="$avail_ext $xxx" ;;
21022 *) avail_ext="$avail_ext $xxx" ;;
21028 case "$useposix" in
21029 true|define|y) avail_ext="$avail_ext $xxx" ;;
21033 case "$useopcode" in
21034 true|define|y) avail_ext="$avail_ext $xxx" ;;
21038 case "$d_socket" in
21041 beos) ;; # not unless BONE
21042 *) avail_ext="$avail_ext $xxx" ;;
21047 Sys/Syslog|sys/syslog)
21048 : XXX syslog requires socket
21049 case "$d_socket" in
21050 true|$define|y) avail_ext="$avail_ext $xxx" ;;
21054 case "$usethreads" in
21056 case "$useithreads" in
21057 $undef|false|[nN]*) avail_ext="$avail_ext $xxx" ;;
21061 XS/APItest|xs/apitest)
21062 # This is just for testing. Skip it unless we have dynamic loading.
21065 $define) avail_ext="$avail_ext $xxx" ;;
21068 XS/Typemap|xs/typemap)
21069 # This is just for testing. Skip it unless we have dynamic loading.
21071 $define) avail_ext="$avail_ext $xxx" ;;
21074 threads|threads/shared)
21075 # threads and threads::shared are special cases.
21076 # To stop people from asking "Perl 5.8.0 was supposed
21077 # to have this new fancy threads implementation but my
21078 # perl doesn't have it" and from people trying to
21079 # (re)install the threads module using CPAN.pm and
21080 # CPAN.pm then offering to reinstall Perl 5.8.0,
21081 # the threads.pm and threads/shared.pm will always be
21082 # there, croaking informatively ("you need to rebuild
21083 # all of Perl with threads, sorry") when threads haven't
21084 # been compiled in.
21086 avail_ext="$avail_ext $xxx"
21089 : XXX Do we need a useipcsysv variable here
21090 case "${d_msg}${d_sem}${d_shm}" in
21091 *"${define}"*) avail_ext="$avail_ext $xxx" ;;
21094 *) avail_ext="$avail_ext $xxx"
21103 case "$onlyextensions" in
21105 *) keepextensions=''
21106 echo "You have requested that only certains extensions be included..." >&4
21107 for i in $onlyextensions; do
21108 case " $avail_ext " in
21110 echo "Keeping extension $i."
21111 keepextensions="$keepextensions $i"
21113 *) echo "Ignoring extension $i." ;;
21116 avail_ext="$keepextensions"
21120 case "$noextensions" in
21122 *) keepextensions=''
21123 echo "You have requested that certain extensions be ignored..." >&4
21124 for i in $avail_ext; do
21125 case " $noextensions " in
21126 *" $i "*) echo "Ignoring extension $i." ;;
21127 *) echo "Keeping extension $i.";
21128 keepextensions="$keepextensions $i"
21132 avail_ext="$keepextensions"
21136 : Now see which nonxs extensions are supported on this system.
21137 : For now assume all are.
21139 for xxx in $nonxs_extensions ; do
21141 *) nonxs_ext="$nonxs_ext $xxx"
21153 A number of extensions are supplied with $package. You may choose to
21154 compile these extensions for dynamic loading (the default), compile
21155 them into the $package executable (static loading), or not include
21156 them at all. Answer "none" to include no extensions.
21157 Note that DynaLoader is always built and need not be mentioned here.
21160 case "$dynamic_ext" in
21162 : Exclude those listed in static_ext
21164 for xxx in $avail_ext; do
21165 case " $static_ext " in
21167 *) dflt="$dflt $xxx" ;;
21174 *) dflt="$dynamic_ext"
21175 # Perhaps we are reusing an old out-of-date config.sh.
21178 if test X"$dynamic_ext" != X"$avail_ext"; then
21180 NOTICE: Your previous config.sh list may be incorrect.
21181 The extensions now available to you are
21183 but the default list from your previous config.sh is
21195 rp="What extensions do you wish to load dynamically?"
21198 none) dynamic_ext=' ' ;;
21199 *) dynamic_ext="$ans" ;;
21202 case "$static_ext" in
21204 : Exclude those already listed in dynamic linking
21206 for xxx in $avail_ext; do
21207 case " $dynamic_ext " in
21209 *) dflt="$dflt $xxx" ;;
21216 *) dflt="$static_ext"
21223 rp="What extensions do you wish to load statically?"
21226 none) static_ext=' ' ;;
21227 *) static_ext="$ans" ;;
21232 A number of extensions are supplied with $package. Answer "none"
21233 to include no extensions.
21234 Note that DynaLoader is always built and need not be mentioned here.
21237 case "$static_ext" in
21238 '') dflt="$avail_ext" ;;
21239 *) dflt="$static_ext"
21240 # Perhaps we are reusing an old out-of-date config.sh.
21243 if test X"$static_ext" != X"$avail_ext"; then
21245 NOTICE: Your previous config.sh list may be incorrect.
21246 The extensions now available to you are
21248 but the default list from your previous config.sh is
21257 : Exclude those that are not xs extensions
21261 rp="What extensions do you wish to include?"
21264 none) static_ext=' ' ;;
21265 *) static_ext="$ans" ;;
21270 # Encode is a special case. If we are building Encode as a static
21271 # extension, we need to explicitly list its subextensions as well.
21272 # For other nested extensions, this is handled automatically by
21273 # the appropriate Makefile.PL.
21274 case " $static_ext " in
21275 *" Encode "*) # Add the subextensions of Encode
21277 for xxx in `ls Encode/*/Makefile.PL|awk -F/ '{print $2}'`; do
21278 static_ext="$static_ext Encode/$xxx"
21284 set X $dynamic_ext $static_ext $nonxs_ext
21288 # Sanity check: We require an extension suitable for use with
21289 # AnyDBM_File, as well as Fcntl and IO. (Failure to have these
21290 # should show up as failures in the test suite, but it's helpful to
21291 # catch them now.) The 'extensions' list is normally sorted
21292 # alphabetically, so we need to accept either
21293 # DB_File ... Fcntl ... IO ....
21294 # or something like
21295 # Fcntl ... NDBM_File ... IO ....
21296 case " $extensions" in
21297 *"_File "*" Fcntl "*" IO "*) ;; # DB_File
21298 *" Fcntl "*"_File "*" IO "*) ;; # GDBM_File
21299 *" Fcntl "*" IO "*"_File "*) ;; # NDBM_File
21300 *) echo "WARNING: Extensions DB_File or *DBM_File, Fcntl, and IO not configured." >&4
21301 echo "WARNING: The Perl you are building will be quite crippled." >& 4
21305 : Remove libraries needed only for extensions
21306 : The appropriate ext/Foo/Makefile.PL will add them back in, if necessary.
21307 : The exception is SunOS 4.x, which needs them.
21308 case "${osname}X${osvers}" in
21312 *) case "$usedl" in
21313 $define|true|[yY]*)
21314 set X `echo " $libs " | sed -e 's@ -lndbm @ @' -e 's@ -lgdbm @ @' -e 's@ -ldbm @ @' -e 's@ -ldb @ @'`
21318 *) perllibs="$libs"
21324 : Remove build directory name from cppstdin so it can be used from
21325 : either the present location or the final installed location.
21327 : Get out of the UU directory to get correct path name.
21329 case "$cppstdin" in
21331 echo "Stripping down cppstdin path name"
21337 : end of configuration questions
21339 echo "End of configuration questions."
21342 : back to where it started
21343 if test -d ../UU; then
21347 : configuration may be patched via a 'config.arch' file
21348 if $test -f config.arch; then
21349 echo "I see a config.arch file, loading it."
21353 : configuration may be patched via a 'config.over' file
21354 if $test -f config.over; then
21357 rp='I see a config.over file. Do you wish to load it?'
21360 n*) echo "OK, I'll ignore it.";;
21362 echo "Configuration override changes have been loaded."
21367 : in case they want portability, strip down executable paths
21368 case "$d_portable" in
21371 echo "Stripping down executable paths..." >&4
21372 for file in $loclist $trylist; do
21374 eval $file=`basename $temp`
21379 : create config.sh file
21381 echo "Creating config.sh..." >&4
21382 $spitshell <<EOT >config.sh
21385 # This file was produced by running the Configure script. It holds all the
21386 # definitions figured out by Configure. Should you modify one of these values,
21387 # do not forget to propagate your changes by running "Configure -der". You may
21388 # instead choose to run each of the .SH files by yourself, or "Configure -S".
21391 # Package name : $package
21392 # Source directory : $src
21393 # Configuration time: $cf_time
21394 # Configured by : $cf_by
21395 # Target system : $myuname
21405 Revision='$Revision'
21413 alignbytes='$alignbytes'
21414 ansi2knr='$ansi2knr'
21415 aphostname='$aphostname'
21416 api_revision='$api_revision'
21417 api_subversion='$api_subversion'
21418 api_version='$api_version'
21419 api_versionstring='$api_versionstring'
21422 archlibexp='$archlibexp'
21423 archname64='$archname64'
21424 archname='$archname'
21425 archobjs='$archobjs'
21426 asctime_r_proto='$asctime_r_proto'
21434 byteorder='$byteorder'
21436 castflags='$castflags'
21439 cccdlflags='$cccdlflags'
21440 ccdlflags='$ccdlflags'
21442 ccflags_uselargefiles='$ccflags_uselargefiles'
21444 ccsymbols='$ccsymbols'
21445 ccversion='$ccversion'
21447 cf_email='$cf_email'
21449 charsize='$charsize'
21453 clocktype='$clocktype'
21455 compress='$compress'
21456 contains='$contains'
21460 cpp_stuff='$cpp_stuff'
21461 cppccsymbols='$cppccsymbols'
21462 cppflags='$cppflags'
21464 cppminus='$cppminus'
21466 cppstdin='$cppstdin'
21467 cppsymbols='$cppsymbols'
21468 crypt_r_proto='$crypt_r_proto'
21469 cryptlib='$cryptlib'
21471 ctermid_r_proto='$ctermid_r_proto'
21472 ctime_r_proto='$ctime_r_proto'
21473 d_Gconvert='$d_Gconvert'
21474 d_PRIEUldbl='$d_PRIEUldbl'
21475 d_PRIFUldbl='$d_PRIFUldbl'
21476 d_PRIGUldbl='$d_PRIGUldbl'
21477 d_PRIXU64='$d_PRIXU64'
21478 d_PRId64='$d_PRId64'
21479 d_PRIeldbl='$d_PRIeldbl'
21480 d_PRIfldbl='$d_PRIfldbl'
21481 d_PRIgldbl='$d_PRIgldbl'
21482 d_PRIi64='$d_PRIi64'
21483 d_PRIo64='$d_PRIo64'
21484 d_PRIu64='$d_PRIu64'
21485 d_PRIx64='$d_PRIx64'
21486 d_SCNfldbl='$d_SCNfldbl'
21487 d__fwalk='$d__fwalk'
21488 d_access='$d_access'
21489 d_accessx='$d_accessx'
21492 d_archlib='$d_archlib'
21493 d_asctime_r='$d_asctime_r'
21496 d_attribute_format='$d_attribute_format'
21497 d_attribute_malloc='$d_attribute_malloc'
21498 d_attribute_nonnull='$d_attribute_nonnull'
21499 d_attribute_noreturn='$d_attribute_noreturn'
21500 d_attribute_pure='$d_attribute_pure'
21501 d_attribute_unused='$d_attribute_unused'
21502 d_attribute_warn_unused_result='$d_attribute_warn_unused_result'
21506 d_bsdgetpgrp='$d_bsdgetpgrp'
21507 d_bsdsetpgrp='$d_bsdsetpgrp'
21508 d_builtin_choose_expr='$d_builtin_choose_expr'
21509 d_builtin_expect='$d_builtin_expect'
21511 d_c99_variadic_macros='$d_c99_variadic_macros'
21512 d_casti32='$d_casti32'
21513 d_castneg='$d_castneg'
21514 d_charvspr='$d_charvspr'
21516 d_chroot='$d_chroot'
21517 d_chsize='$d_chsize'
21519 d_clearenv='$d_clearenv'
21520 d_closedir='$d_closedir'
21521 d_cmsghdr_s='$d_cmsghdr_s'
21523 d_copysignl='$d_copysignl'
21524 d_cplusplus='$d_cplusplus'
21526 d_crypt_r='$d_crypt_r'
21528 d_ctermid='$d_ctermid'
21529 d_ctermid_r='$d_ctermid_r'
21530 d_ctime_r='$d_ctime_r'
21531 d_cuserid='$d_cuserid'
21532 d_dbl_dig='$d_dbl_dig'
21533 d_dbminitproto='$d_dbminitproto'
21534 d_difftime='$d_difftime'
21535 d_dir_dd_fd='$d_dir_dd_fd'
21537 d_dirnamlen='$d_dirnamlen'
21538 d_dlerror='$d_dlerror'
21539 d_dlopen='$d_dlopen'
21540 d_dlsymun='$d_dlsymun'
21541 d_dosuid='$d_dosuid'
21542 d_drand48_r='$d_drand48_r'
21543 d_drand48proto='$d_drand48proto'
21545 d_eaccess='$d_eaccess'
21546 d_endgrent='$d_endgrent'
21547 d_endgrent_r='$d_endgrent_r'
21548 d_endhent='$d_endhent'
21549 d_endhostent_r='$d_endhostent_r'
21550 d_endnent='$d_endnent'
21551 d_endnetent_r='$d_endnetent_r'
21552 d_endpent='$d_endpent'
21553 d_endprotoent_r='$d_endprotoent_r'
21554 d_endpwent='$d_endpwent'
21555 d_endpwent_r='$d_endpwent_r'
21556 d_endsent='$d_endsent'
21557 d_endservent_r='$d_endservent_r'
21558 d_eofnblk='$d_eofnblk'
21559 d_eunice='$d_eunice'
21560 d_faststdio='$d_faststdio'
21561 d_fchdir='$d_fchdir'
21562 d_fchmod='$d_fchmod'
21563 d_fchown='$d_fchown'
21565 d_fcntl_can_lock='$d_fcntl_can_lock'
21566 d_fd_macros='$d_fd_macros'
21567 d_fd_set='$d_fd_set'
21568 d_fds_bits='$d_fds_bits'
21569 d_fgetpos='$d_fgetpos'
21570 d_finite='$d_finite'
21571 d_finitel='$d_finitel'
21572 d_flexfnam='$d_flexfnam'
21574 d_flockproto='$d_flockproto'
21576 d_fp_class='$d_fp_class'
21577 d_fpathconf='$d_fpathconf'
21578 d_fpclass='$d_fpclass'
21579 d_fpclassify='$d_fpclassify'
21580 d_fpclassl='$d_fpclassl'
21581 d_fpos64_t='$d_fpos64_t'
21582 d_frexpl='$d_frexpl'
21583 d_fs_data_s='$d_fs_data_s'
21584 d_fseeko='$d_fseeko'
21585 d_fsetpos='$d_fsetpos'
21586 d_fstatfs='$d_fstatfs'
21587 d_fstatvfs='$d_fstatvfs'
21589 d_ftello='$d_ftello'
21591 d_futimes='$d_futimes'
21592 d_getcwd='$d_getcwd'
21593 d_getespwnam='$d_getespwnam'
21594 d_getfsstat='$d_getfsstat'
21595 d_getgrent='$d_getgrent'
21596 d_getgrent_r='$d_getgrent_r'
21597 d_getgrgid_r='$d_getgrgid_r'
21598 d_getgrnam_r='$d_getgrnam_r'
21599 d_getgrps='$d_getgrps'
21600 d_gethbyaddr='$d_gethbyaddr'
21601 d_gethbyname='$d_gethbyname'
21602 d_gethent='$d_gethent'
21603 d_gethname='$d_gethname'
21604 d_gethostbyaddr_r='$d_gethostbyaddr_r'
21605 d_gethostbyname_r='$d_gethostbyname_r'
21606 d_gethostent_r='$d_gethostent_r'
21607 d_gethostprotos='$d_gethostprotos'
21608 d_getitimer='$d_getitimer'
21609 d_getlogin='$d_getlogin'
21610 d_getlogin_r='$d_getlogin_r'
21611 d_getmnt='$d_getmnt'
21612 d_getmntent='$d_getmntent'
21613 d_getnbyaddr='$d_getnbyaddr'
21614 d_getnbyname='$d_getnbyname'
21615 d_getnent='$d_getnent'
21616 d_getnetbyaddr_r='$d_getnetbyaddr_r'
21617 d_getnetbyname_r='$d_getnetbyname_r'
21618 d_getnetent_r='$d_getnetent_r'
21619 d_getnetprotos='$d_getnetprotos'
21620 d_getpagsz='$d_getpagsz'
21621 d_getpbyname='$d_getpbyname'
21622 d_getpbynumber='$d_getpbynumber'
21623 d_getpent='$d_getpent'
21624 d_getpgid='$d_getpgid'
21625 d_getpgrp2='$d_getpgrp2'
21626 d_getpgrp='$d_getpgrp'
21627 d_getppid='$d_getppid'
21628 d_getprior='$d_getprior'
21629 d_getprotobyname_r='$d_getprotobyname_r'
21630 d_getprotobynumber_r='$d_getprotobynumber_r'
21631 d_getprotoent_r='$d_getprotoent_r'
21632 d_getprotoprotos='$d_getprotoprotos'
21633 d_getprpwnam='$d_getprpwnam'
21634 d_getpwent='$d_getpwent'
21635 d_getpwent_r='$d_getpwent_r'
21636 d_getpwnam_r='$d_getpwnam_r'
21637 d_getpwuid_r='$d_getpwuid_r'
21638 d_getsbyname='$d_getsbyname'
21639 d_getsbyport='$d_getsbyport'
21640 d_getsent='$d_getsent'
21641 d_getservbyname_r='$d_getservbyname_r'
21642 d_getservbyport_r='$d_getservbyport_r'
21643 d_getservent_r='$d_getservent_r'
21644 d_getservprotos='$d_getservprotos'
21645 d_getspnam='$d_getspnam'
21646 d_getspnam_r='$d_getspnam_r'
21647 d_gettimeod='$d_gettimeod'
21648 d_gmtime_r='$d_gmtime_r'
21649 d_gnulibc='$d_gnulibc'
21650 d_grpasswd='$d_grpasswd'
21651 d_hasmntopt='$d_hasmntopt'
21653 d_ilogbl='$d_ilogbl'
21654 d_inc_version_list='$d_inc_version_list'
21656 d_inetaton='$d_inetaton'
21657 d_int64_t='$d_int64_t'
21658 d_isascii='$d_isascii'
21659 d_isfinite='$d_isfinite'
21662 d_isnanl='$d_isnanl'
21663 d_killpg='$d_killpg'
21664 d_lchown='$d_lchown'
21665 d_ldbl_dig='$d_ldbl_dig'
21666 d_libm_lib_version='$d_libm_lib_version'
21668 d_localtime_r='$d_localtime_r'
21669 d_localtime_r_needs_tzset='$d_localtime_r_needs_tzset'
21670 d_locconv='$d_locconv'
21672 d_longdbl='$d_longdbl'
21673 d_longlong='$d_longlong'
21674 d_lseekproto='$d_lseekproto'
21676 d_madvise='$d_madvise'
21677 d_malloc_good_size='$d_malloc_good_size'
21678 d_malloc_size='$d_malloc_size'
21680 d_mbstowcs='$d_mbstowcs'
21681 d_mbtowc='$d_mbtowc'
21682 d_memchr='$d_memchr'
21683 d_memcmp='$d_memcmp'
21684 d_memcpy='$d_memcpy'
21685 d_memmove='$d_memmove'
21686 d_memset='$d_memset'
21688 d_mkdtemp='$d_mkdtemp'
21689 d_mkfifo='$d_mkfifo'
21690 d_mkstemp='$d_mkstemp'
21691 d_mkstemps='$d_mkstemps'
21692 d_mktime='$d_mktime'
21695 d_modfl_pow32_bug='$d_modfl_pow32_bug'
21696 d_modflproto='$d_modflproto'
21697 d_mprotect='$d_mprotect'
21699 d_msg_ctrunc='$d_msg_ctrunc'
21700 d_msg_dontroute='$d_msg_dontroute'
21701 d_msg_oob='$d_msg_oob'
21702 d_msg_peek='$d_msg_peek'
21703 d_msg_proxy='$d_msg_proxy'
21704 d_msgctl='$d_msgctl'
21705 d_msgget='$d_msgget'
21706 d_msghdr_s='$d_msghdr_s'
21707 d_msgrcv='$d_msgrcv'
21708 d_msgsnd='$d_msgsnd'
21710 d_munmap='$d_munmap'
21711 d_mymalloc='$d_mymalloc'
21713 d_nl_langinfo='$d_nl_langinfo'
21714 d_nv_preserves_uv='$d_nv_preserves_uv'
21715 d_nv_zero_is_allbits_zero='$d_nv_zero_is_allbits_zero'
21716 d_off64_t='$d_off64_t'
21717 d_old_pthread_create_joinable='$d_old_pthread_create_joinable'
21718 d_oldpthreads='$d_oldpthreads'
21719 d_oldsock='$d_oldsock'
21721 d_pathconf='$d_pathconf'
21723 d_perl_otherlibdirs='$d_perl_otherlibdirs'
21724 d_phostname='$d_phostname'
21727 d_portable='$d_portable'
21728 d_printf_format_null='$d_printf_format_null'
21729 d_procselfexe='$d_procselfexe'
21730 d_pthread_atfork='$d_pthread_atfork'
21731 d_pthread_attr_setscope='$d_pthread_attr_setscope'
21732 d_pthread_yield='$d_pthread_yield'
21734 d_pwchange='$d_pwchange'
21735 d_pwclass='$d_pwclass'
21736 d_pwcomment='$d_pwcomment'
21737 d_pwexpire='$d_pwexpire'
21738 d_pwgecos='$d_pwgecos'
21739 d_pwpasswd='$d_pwpasswd'
21740 d_pwquota='$d_pwquota'
21743 d_random_r='$d_random_r'
21744 d_readdir64_r='$d_readdir64_r'
21745 d_readdir='$d_readdir'
21746 d_readdir_r='$d_readdir_r'
21747 d_readlink='$d_readlink'
21749 d_recvmsg='$d_recvmsg'
21750 d_rename='$d_rename'
21751 d_rewinddir='$d_rewinddir'
21753 d_safebcpy='$d_safebcpy'
21754 d_safemcpy='$d_safemcpy'
21755 d_sanemcmp='$d_sanemcmp'
21756 d_sbrkproto='$d_sbrkproto'
21757 d_scalbnl='$d_scalbnl'
21758 d_sched_yield='$d_sched_yield'
21759 d_scm_rights='$d_scm_rights'
21760 d_seekdir='$d_seekdir'
21761 d_select='$d_select'
21763 d_semctl='$d_semctl'
21764 d_semctl_semid_ds='$d_semctl_semid_ds'
21765 d_semctl_semun='$d_semctl_semun'
21766 d_semget='$d_semget'
21768 d_sendmsg='$d_sendmsg'
21769 d_setegid='$d_setegid'
21770 d_seteuid='$d_seteuid'
21771 d_setgrent='$d_setgrent'
21772 d_setgrent_r='$d_setgrent_r'
21773 d_setgrps='$d_setgrps'
21774 d_sethent='$d_sethent'
21775 d_sethostent_r='$d_sethostent_r'
21776 d_setitimer='$d_setitimer'
21777 d_setlinebuf='$d_setlinebuf'
21778 d_setlocale='$d_setlocale'
21779 d_setlocale_r='$d_setlocale_r'
21780 d_setnent='$d_setnent'
21781 d_setnetent_r='$d_setnetent_r'
21782 d_setpent='$d_setpent'
21783 d_setpgid='$d_setpgid'
21784 d_setpgrp2='$d_setpgrp2'
21785 d_setpgrp='$d_setpgrp'
21786 d_setprior='$d_setprior'
21787 d_setproctitle='$d_setproctitle'
21788 d_setprotoent_r='$d_setprotoent_r'
21789 d_setpwent='$d_setpwent'
21790 d_setpwent_r='$d_setpwent_r'
21791 d_setregid='$d_setregid'
21792 d_setresgid='$d_setresgid'
21793 d_setresuid='$d_setresuid'
21794 d_setreuid='$d_setreuid'
21795 d_setrgid='$d_setrgid'
21796 d_setruid='$d_setruid'
21797 d_setsent='$d_setsent'
21798 d_setservent_r='$d_setservent_r'
21799 d_setsid='$d_setsid'
21800 d_setvbuf='$d_setvbuf'
21804 d_shmatprototype='$d_shmatprototype'
21805 d_shmctl='$d_shmctl'
21807 d_shmget='$d_shmget'
21808 d_sigaction='$d_sigaction'
21809 d_sigprocmask='$d_sigprocmask'
21810 d_sigsetjmp='$d_sigsetjmp'
21811 d_sitearch='$d_sitearch'
21812 d_snprintf='$d_snprintf'
21813 d_sockatmark='$d_sockatmark'
21814 d_sockatmarkproto='$d_sockatmarkproto'
21815 d_socket='$d_socket'
21816 d_socklen_t='$d_socklen_t'
21817 d_sockpair='$d_sockpair'
21818 d_socks5_init='$d_socks5_init'
21819 d_sprintf_returns_strlen='$d_sprintf_returns_strlen'
21821 d_srand48_r='$d_srand48_r'
21822 d_srandom_r='$d_srandom_r'
21823 d_sresgproto='$d_sresgproto'
21824 d_sresuproto='$d_sresuproto'
21825 d_statblks='$d_statblks'
21826 d_statfs_f_flags='$d_statfs_f_flags'
21827 d_statfs_s='$d_statfs_s'
21828 d_statvfs='$d_statvfs'
21829 d_stdio_cnt_lval='$d_stdio_cnt_lval'
21830 d_stdio_ptr_lval='$d_stdio_ptr_lval'
21831 d_stdio_ptr_lval_nochange_cnt='$d_stdio_ptr_lval_nochange_cnt'
21832 d_stdio_ptr_lval_sets_cnt='$d_stdio_ptr_lval_sets_cnt'
21833 d_stdio_stream_array='$d_stdio_stream_array'
21834 d_stdiobase='$d_stdiobase'
21835 d_stdstdio='$d_stdstdio'
21836 d_strchr='$d_strchr'
21837 d_strcoll='$d_strcoll'
21838 d_strctcpy='$d_strctcpy'
21839 d_strerrm='$d_strerrm'
21840 d_strerror='$d_strerror'
21841 d_strerror_r='$d_strerror_r'
21842 d_strftime='$d_strftime'
21843 d_strlcat='$d_strlcat'
21844 d_strlcpy='$d_strlcpy'
21845 d_strtod='$d_strtod'
21846 d_strtol='$d_strtol'
21847 d_strtold='$d_strtold'
21848 d_strtoll='$d_strtoll'
21849 d_strtoq='$d_strtoq'
21850 d_strtoul='$d_strtoul'
21851 d_strtoull='$d_strtoull'
21852 d_strtouq='$d_strtouq'
21853 d_strxfrm='$d_strxfrm'
21854 d_suidsafe='$d_suidsafe'
21855 d_symlink='$d_symlink'
21856 d_syscall='$d_syscall'
21857 d_syscallproto='$d_syscallproto'
21858 d_sysconf='$d_sysconf'
21859 d_sysernlst='$d_sysernlst'
21860 d_syserrlst='$d_syserrlst'
21861 d_system='$d_system'
21862 d_tcgetpgrp='$d_tcgetpgrp'
21863 d_tcsetpgrp='$d_tcsetpgrp'
21864 d_telldir='$d_telldir'
21865 d_telldirproto='$d_telldirproto'
21868 d_tm_tm_gmtoff='$d_tm_tm_gmtoff'
21869 d_tm_tm_zone='$d_tm_tm_zone'
21870 d_tmpnam_r='$d_tmpnam_r'
21871 d_truncate='$d_truncate'
21872 d_ttyname_r='$d_ttyname_r'
21873 d_tzname='$d_tzname'
21874 d_u32align='$d_u32align'
21875 d_ualarm='$d_ualarm'
21878 d_union_semun='$d_union_semun'
21879 d_unordered='$d_unordered'
21880 d_unsetenv='$d_unsetenv'
21881 d_usleep='$d_usleep'
21882 d_usleepproto='$d_usleepproto'
21884 d_vendorarch='$d_vendorarch'
21885 d_vendorbin='$d_vendorbin'
21886 d_vendorlib='$d_vendorlib'
21887 d_vendorscript='$d_vendorscript'
21889 d_void_closedir='$d_void_closedir'
21890 d_voidsig='$d_voidsig'
21891 d_voidtty='$d_voidtty'
21892 d_volatile='$d_volatile'
21893 d_vprintf='$d_vprintf'
21894 d_vsnprintf='$d_vsnprintf'
21896 d_waitpid='$d_waitpid'
21897 d_wcstombs='$d_wcstombs'
21898 d_wctomb='$d_wctomb'
21899 d_writev='$d_writev'
21902 db_hashtype='$db_hashtype'
21903 db_prefixtype='$db_prefixtype'
21904 db_version_major='$db_version_major'
21905 db_version_minor='$db_version_minor'
21906 db_version_patch='$db_version_patch'
21907 defvoidused='$defvoidused'
21908 direntrytype='$direntrytype'
21911 doublesize='$doublesize'
21913 drand48_r_proto='$drand48_r_proto'
21914 dynamic_ext='$dynamic_ext'
21920 endgrent_r_proto='$endgrent_r_proto'
21921 endhostent_r_proto='$endhostent_r_proto'
21922 endnetent_r_proto='$endnetent_r_proto'
21923 endprotoent_r_proto='$endprotoent_r_proto'
21924 endpwent_r_proto='$endpwent_r_proto'
21925 endservent_r_proto='$endservent_r_proto'
21926 eunicefix='$eunicefix'
21929 extensions='$extensions'
21931 fflushNULL='$fflushNULL'
21932 fflushall='$fflushall'
21934 firstmakefile='$firstmakefile'
21936 fpossize='$fpossize'
21937 fpostype='$fpostype'
21938 freetype='$freetype'
21941 full_csh='$full_csh'
21942 full_sed='$full_sed'
21943 gccansipedantic='$gccansipedantic'
21944 gccosandvers='$gccosandvers'
21945 gccversion='$gccversion'
21946 getgrent_r_proto='$getgrent_r_proto'
21947 getgrgid_r_proto='$getgrgid_r_proto'
21948 getgrnam_r_proto='$getgrnam_r_proto'
21949 gethostbyaddr_r_proto='$gethostbyaddr_r_proto'
21950 gethostbyname_r_proto='$gethostbyname_r_proto'
21951 gethostent_r_proto='$gethostent_r_proto'
21952 getlogin_r_proto='$getlogin_r_proto'
21953 getnetbyaddr_r_proto='$getnetbyaddr_r_proto'
21954 getnetbyname_r_proto='$getnetbyname_r_proto'
21955 getnetent_r_proto='$getnetent_r_proto'
21956 getprotobyname_r_proto='$getprotobyname_r_proto'
21957 getprotobynumber_r_proto='$getprotobynumber_r_proto'
21958 getprotoent_r_proto='$getprotoent_r_proto'
21959 getpwent_r_proto='$getpwent_r_proto'
21960 getpwnam_r_proto='$getpwnam_r_proto'
21961 getpwuid_r_proto='$getpwuid_r_proto'
21962 getservbyname_r_proto='$getservbyname_r_proto'
21963 getservbyport_r_proto='$getservbyport_r_proto'
21964 getservent_r_proto='$getservent_r_proto'
21965 getspnam_r_proto='$getspnam_r_proto'
21966 gidformat='$gidformat'
21972 gmtime_r_proto='$gmtime_r_proto'
21973 gnulibc_version='$gnulibc_version'
21975 groupcat='$groupcat'
21976 groupstype='$groupstype'
21979 h_sysfile='$h_sysfile'
21982 html1dir='$html1dir'
21983 html1direxp='$html1direxp'
21984 html3dir='$html3dir'
21985 html3direxp='$html3direxp'
21994 i_arpainet='$i_arpainet'
21995 i_bsdioctl='$i_bsdioctl'
21999 i_dirent='$i_dirent'
22005 i_fp_class='$i_fp_class'
22008 i_ieeefp='$i_ieeefp'
22009 i_inttypes='$i_inttypes'
22010 i_langinfo='$i_langinfo'
22011 i_libutil='$i_libutil'
22012 i_limits='$i_limits'
22013 i_locale='$i_locale'
22014 i_machcthr='$i_machcthr'
22015 i_malloc='$i_malloc'
22017 i_memory='$i_memory'
22018 i_mntent='$i_mntent'
22021 i_neterrno='$i_neterrno'
22022 i_netinettcp='$i_netinettcp'
22026 i_pthread='$i_pthread'
22028 i_rpcsvcdbm='$i_rpcsvcdbm'
22031 i_shadow='$i_shadow'
22033 i_stdarg='$i_stdarg'
22034 i_stddef='$i_stddef'
22035 i_stdlib='$i_stdlib'
22036 i_string='$i_string'
22037 i_sunmath='$i_sunmath'
22038 i_sysaccess='$i_sysaccess'
22039 i_sysdir='$i_sysdir'
22040 i_sysfile='$i_sysfile'
22041 i_sysfilio='$i_sysfilio'
22043 i_sysioctl='$i_sysioctl'
22044 i_syslog='$i_syslog'
22045 i_sysmman='$i_sysmman'
22046 i_sysmode='$i_sysmode'
22047 i_sysmount='$i_sysmount'
22048 i_sysndir='$i_sysndir'
22049 i_sysparam='$i_sysparam'
22050 i_sysresrc='$i_sysresrc'
22051 i_syssecrt='$i_syssecrt'
22052 i_sysselct='$i_sysselct'
22053 i_syssockio='$i_syssockio'
22054 i_sysstat='$i_sysstat'
22055 i_sysstatfs='$i_sysstatfs'
22056 i_sysstatvfs='$i_sysstatvfs'
22057 i_systime='$i_systime'
22058 i_systimek='$i_systimek'
22059 i_systimes='$i_systimes'
22060 i_systypes='$i_systypes'
22061 i_sysuio='$i_sysuio'
22063 i_sysutsname='$i_sysutsname'
22064 i_sysvfs='$i_sysvfs'
22065 i_syswait='$i_syswait'
22066 i_termio='$i_termio'
22067 i_termios='$i_termios'
22069 i_unistd='$i_unistd'
22072 i_values='$i_values'
22073 i_varargs='$i_varargs'
22074 i_varhdr='$i_varhdr'
22076 ignore_versioned_solibs='$ignore_versioned_solibs'
22077 inc_version_list='$inc_version_list'
22078 inc_version_list_init='$inc_version_list_init'
22081 initialinstalllocation='$initialinstalllocation'
22082 installarchlib='$installarchlib'
22083 installbin='$installbin'
22084 installhtml1dir='$installhtml1dir'
22085 installhtml3dir='$installhtml3dir'
22086 installman1dir='$installman1dir'
22087 installman3dir='$installman3dir'
22088 installprefix='$installprefix'
22089 installprefixexp='$installprefixexp'
22090 installprivlib='$installprivlib'
22091 installscript='$installscript'
22092 installsitearch='$installsitearch'
22093 installsitebin='$installsitebin'
22094 installsitehtml1dir='$installsitehtml1dir'
22095 installsitehtml3dir='$installsitehtml3dir'
22096 installsitelib='$installsitelib'
22097 installsiteman1dir='$installsiteman1dir'
22098 installsiteman3dir='$installsiteman3dir'
22099 installsitescript='$installsitescript'
22100 installstyle='$installstyle'
22101 installusrbinperl='$installusrbinperl'
22102 installvendorarch='$installvendorarch'
22103 installvendorbin='$installvendorbin'
22104 installvendorhtml1dir='$installvendorhtml1dir'
22105 installvendorhtml3dir='$installvendorhtml3dir'
22106 installvendorlib='$installvendorlib'
22107 installvendorman1dir='$installvendorman1dir'
22108 installvendorman3dir='$installvendorman3dir'
22109 installvendorscript='$installvendorscript'
22111 issymlink='$issymlink'
22112 ivdformat='$ivdformat'
22115 known_extensions='$known_extensions'
22118 lddlflags='$lddlflags'
22120 ldflags_uselargefiles='$ldflags_uselargefiles'
22121 ldlibpthname='$ldlibpthname'
22128 libsdirs='$libsdirs'
22129 libsfiles='$libsfiles'
22130 libsfound='$libsfound'
22131 libspath='$libspath'
22132 libswanted='$libswanted'
22133 libswanted_uselargefiles='$libswanted_uselargefiles'
22139 localtime_r_proto='$localtime_r_proto'
22140 locincpth='$locincpth'
22141 loclibpth='$loclibpth'
22142 longdblsize='$longdblsize'
22143 longlongsize='$longlongsize'
22144 longsize='$longsize'
22148 lseeksize='$lseeksize'
22149 lseektype='$lseektype'
22152 madlyobj='$madlyobj'
22153 madlysrc='$madlysrc'
22157 make_set_make='$make_set_make'
22158 mallocobj='$mallocobj'
22159 mallocsrc='$mallocsrc'
22160 malloctype='$malloctype'
22162 man1direxp='$man1direxp'
22165 man3direxp='$man3direxp'
22167 mips_type='$mips_type'
22168 mistrustnm='$mistrustnm'
22170 mmaptype='$mmaptype'
22171 modetype='$modetype'
22173 multiarch='$multiarch'
22175 myarchname='$myarchname'
22176 mydomain='$mydomain'
22177 myhostname='$myhostname'
22180 need_va_copy='$need_va_copy'
22181 netdb_hlen_type='$netdb_hlen_type'
22182 netdb_host_type='$netdb_host_type'
22183 netdb_name_type='$netdb_name_type'
22184 netdb_net_type='$netdb_net_type'
22187 nm_so_opt='$nm_so_opt'
22188 nonxs_ext='$nonxs_ext'
22190 nvEUformat='$nvEUformat'
22191 nvFUformat='$nvFUformat'
22192 nvGUformat='$nvGUformat'
22193 nv_preserves_uv_bits='$nv_preserves_uv_bits'
22194 nveformat='$nveformat'
22195 nvfformat='$nvfformat'
22196 nvgformat='$nvgformat'
22199 o_nonblock='$o_nonblock'
22201 old_pthread_create_joinable='$old_pthread_create_joinable'
22202 optimize='$optimize'
22203 orderlib='$orderlib'
22206 otherlibdirs='$otherlibdirs'
22210 patchlevel='$patchlevel'
22211 path_sep='$path_sep'
22214 perl_patchlevel='$perl_patchlevel'
22215 perladmin='$perladmin'
22216 perllibs='$perllibs'
22217 perlpath='$perlpath'
22219 phostname='$phostname'
22225 prefixexp='$prefixexp'
22227 privlibexp='$privlibexp'
22228 procselfexe='$procselfexe'
22229 prototype='$prototype'
22231 quadkind='$quadkind'
22232 quadtype='$quadtype'
22233 randbits='$randbits'
22234 randfunc='$randfunc'
22235 random_r_proto='$random_r_proto'
22236 randseedtype='$randseedtype'
22238 rd_nodata='$rd_nodata'
22239 readdir64_r_proto='$readdir64_r_proto'
22240 readdir_r_proto='$readdir_r_proto'
22241 revision='$revision'
22246 sPRIEUldbl='$sPRIEUldbl'
22247 sPRIFUldbl='$sPRIFUldbl'
22248 sPRIGUldbl='$sPRIGUldbl'
22249 sPRIXU64='$sPRIXU64'
22251 sPRIeldbl='$sPRIeldbl'
22252 sPRIfldbl='$sPRIfldbl'
22253 sPRIgldbl='$sPRIgldbl'
22258 sSCNfldbl='$sSCNfldbl'
22259 sched_yield='$sched_yield'
22260 scriptdir='$scriptdir'
22261 scriptdirexp='$scriptdirexp'
22263 seedfunc='$seedfunc'
22264 selectminbits='$selectminbits'
22265 selecttype='$selecttype'
22266 sendmail='$sendmail'
22267 setgrent_r_proto='$setgrent_r_proto'
22268 sethostent_r_proto='$sethostent_r_proto'
22269 setlocale_r_proto='$setlocale_r_proto'
22270 setnetent_r_proto='$setnetent_r_proto'
22271 setprotoent_r_proto='$setprotoent_r_proto'
22272 setpwent_r_proto='$setpwent_r_proto'
22273 setservent_r_proto='$setservent_r_proto'
22276 sharpbang='$sharpbang'
22277 shmattype='$shmattype'
22278 shortsize='$shortsize'
22281 sig_count='$sig_count'
22282 sig_name='$sig_name'
22283 sig_name_init='$sig_name_init'
22285 sig_num_init='$sig_num_init'
22286 sig_size='$sig_size'
22287 signal_t='$signal_t'
22288 sitearch='$sitearch'
22289 sitearchexp='$sitearchexp'
22291 sitebinexp='$sitebinexp'
22292 sitehtml1dir='$sitehtml1dir'
22293 sitehtml1direxp='$sitehtml1direxp'
22294 sitehtml3dir='$sitehtml3dir'
22295 sitehtml3direxp='$sitehtml3direxp'
22297 sitelib_stem='$sitelib_stem'
22298 sitelibexp='$sitelibexp'
22299 siteman1dir='$siteman1dir'
22300 siteman1direxp='$siteman1direxp'
22301 siteman3dir='$siteman3dir'
22302 siteman3direxp='$siteman3direxp'
22303 siteprefix='$siteprefix'
22304 siteprefixexp='$siteprefixexp'
22305 sitescript='$sitescript'
22306 sitescriptexp='$sitescriptexp'
22307 sizesize='$sizesize'
22308 sizetype='$sizetype'
22312 sockethdr='$sockethdr'
22313 socketlib='$socketlib'
22314 socksizetype='$socksizetype'
22316 spackage='$spackage'
22317 spitshell='$spitshell'
22318 srand48_r_proto='$srand48_r_proto'
22319 srandom_r_proto='$srandom_r_proto'
22321 ssizetype='$ssizetype'
22322 startperl='$startperl'
22324 static_ext='$static_ext'
22326 stdio_base='$stdio_base'
22327 stdio_bufsiz='$stdio_bufsiz'
22328 stdio_cnt='$stdio_cnt'
22329 stdio_filbuf='$stdio_filbuf'
22330 stdio_ptr='$stdio_ptr'
22331 stdio_stream_array='$stdio_stream_array'
22332 strerror_r_proto='$strerror_r_proto'
22335 subversion='$subversion'
22339 targetarch='$targetarch'
22343 timeincl='$timeincl'
22344 timetype='$timetype'
22345 tmpnam_r_proto='$tmpnam_r_proto'
22351 ttyname_r_proto='$ttyname_r_proto'
22360 uidformat='$uidformat'
22366 uquadtype='$uquadtype'
22367 use5005threads='$use5005threads'
22368 use64bitall='$use64bitall'
22369 use64bitint='$use64bitint'
22370 usecrosscompile='$usecrosscompile'
22372 usefaststdio='$usefaststdio'
22373 useithreads='$useithreads'
22374 uselargefiles='$uselargefiles'
22375 uselongdouble='$uselongdouble'
22376 usemallocwrap='$usemallocwrap'
22377 usemorebits='$usemorebits'
22378 usemultiplicity='$usemultiplicity'
22379 usemymalloc='$usemymalloc'
22381 useopcode='$useopcode'
22382 useperlio='$useperlio'
22383 useposix='$useposix'
22384 usereentrant='$usereentrant'
22385 userelocatableinc='$userelocatableinc'
22387 useshrplib='$useshrplib'
22388 usesitecustomize='$usesitecustomize'
22389 usesocks='$usesocks'
22390 usethreads='$usethreads'
22391 usevendorprefix='$usevendorprefix'
22392 usevfork='$usevfork'
22395 uvXUformat='$uvXUformat'
22396 uvoformat='$uvoformat'
22399 uvuformat='$uvuformat'
22400 uvxformat='$uvxformat'
22401 vendorarch='$vendorarch'
22402 vendorarchexp='$vendorarchexp'
22403 vendorbin='$vendorbin'
22404 vendorbinexp='$vendorbinexp'
22405 vendorhtml1dir='$vendorhtml1dir'
22406 vendorhtml1direxp='$vendorhtml1direxp'
22407 vendorhtml3dir='$vendorhtml3dir'
22408 vendorhtml3direxp='$vendorhtml3direxp'
22409 vendorlib='$vendorlib'
22410 vendorlib_stem='$vendorlib_stem'
22411 vendorlibexp='$vendorlibexp'
22412 vendorman1dir='$vendorman1dir'
22413 vendorman1direxp='$vendorman1direxp'
22414 vendorman3dir='$vendorman3dir'
22415 vendorman3direxp='$vendorman3direxp'
22416 vendorprefix='$vendorprefix'
22417 vendorprefixexp='$vendorprefixexp'
22418 vendorscript='$vendorscript'
22419 vendorscriptexp='$vendorscriptexp'
22421 version_patchlevel_string='$version_patchlevel_string'
22422 versiononly='$versiononly'
22424 voidflags='$voidflags'
22427 yaccflags='$yaccflags'
22432 : Add in command line options if available
22433 $test -f UU/cmdline.opt && $cat UU/cmdline.opt >> config.sh
22435 : add special variables
22436 $test -f $src/patchlevel.h && \
22437 awk '/^#define[ ]+PERL_/ {printf "%s=%s\n",$2,$3}' $src/patchlevel.h >>config.sh
22438 echo "PERL_PATCHLEVEL=$perl_patchlevel" >>config.sh
22439 echo "PERL_CONFIG_SH=true" >>config.sh
22441 : propagate old symbols
22442 if $test -f UU/config.sh; then
22443 <UU/config.sh $sort | $uniq >UU/oldconfig.sh
22444 sed -n 's/^\([a-zA-Z_0-9]*\)=.*/\1/p' config.sh config.sh UU/oldconfig.sh |\
22445 $sort | $uniq -u >UU/oldsyms
22446 set X `cat UU/oldsyms`
22452 Hmm...You had some extra variables I don't know about...I'll try to keep 'em...
22454 echo "# Variables propagated from previous config.sh file." >>config.sh
22455 for sym in `cat UU/oldsyms`; do
22456 echo " Propagating $hint variable "'$'"$sym..."
22457 eval 'tmp="$'"${sym}"'"'
22459 sed -e "s/'/'\"'\"'/g" -e "s/^/$sym='/" -e "s/$/'/" >>config.sh
22465 : Finish up by extracting the .SH files
22469 echo "Extraction done."
22479 If you'd like to make any changes to the config.sh file before I begin
22480 to configure things, do it as a shell escape now (e.g. !vi config.sh).
22483 rp="Press return or use a shell escape to edit config.sh:"
22488 *) : in case they cannot read
22489 sh 1>&4 -c "$ans";;
22494 : if this fails, just run all the .SH files by hand
22503 if $contains '^depend:' [Mm]akefile >/dev/null 2>&1; then
22510 Now you need to generate make dependencies by running "$make depend".
22511 You might prefer to run it in background: "$make depend > makedepend.out &"
22512 It can take a while, so you might not want to run it right now.
22517 rp="Run $make depend now?"
22521 $make depend && echo "Now you must run '$make'."
22524 echo "You must run '$make depend' then '$make'."
22527 elif test -f [Mm]akefile; then
22529 echo "Now you must run a $make."
22531 echo "Configure done."
22534 if $test -f Policy.sh; then
22537 If you compile $package on a different machine or from a different object
22538 directory, copy the Policy.sh file from this object directory to the
22539 new one before you run Configure -- this will help you with most of
22540 the policy defaults.
22544 if $test -f config.msg; then
22545 echo "Hmm. I also noted the following information while running:"
22547 $cat config.msg >&4
22550 $rm -f kit*isdone ark*isdone