3 # If these # comments don't work, trim them. Don't worry about any other
4 # shell scripts, Configure will trim # comments from them for you.
6 # (If you are trying to port this package to a machine without sh,
7 # I would suggest you have a look at the prototypical config_h.SH file
8 # and edit it to reflect your system. Some packages may include samples
9 # of config.h for certain machines, so you might look for one of those.)
11 # Yes, you may rip this off to use in other distribution packages. This
12 # script belongs to the public domain and cannot be copyrighted.
14 # (Note: this Configure script was generated automatically. Rather than
15 # working with this copy of Configure, you may wish to get metaconfig.
16 # The dist-3.0 package (which contains metaconfig) was posted in
17 # comp.sources.misc and is available on CPAN under authors/id/RAM so
18 # you may fetch it yourself from your nearest archive site.)
21 # Though this script was generated by metaconfig, it is OK to send
22 # patches against it. It's up to the Configure pumpkin to backport
23 # the patch to the metaunits if it is accepted.
24 # See Porting/pumpkin.pod for more information on metaconfig.
27 # $Id: Head.U,v 3.0.1.9 1997/02/28 15:02:09 ram Exp $
29 # Generated on Mon Apr 17 14:14:39 CEST 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 : compute my invocation name
72 me=`echo $0 | sed -e 's!.*/\(.*\)!\1!' 2>/dev/null`
77 : Proper separator for the PATH environment variable
79 : On OS/2 this directory should exist if this is not floppy only system :-]
80 if test -d c:/. || ( uname -a | grep -i 'os\(/\|\)2' ) 2>&1 >/dev/null ; then
81 if test -n "$OS2_SHELL"; then
83 PATH=`cmd /c "echo %PATH%" | tr '\\\\' / `
84 OS2_SHELL=`cmd /c "echo %OS2_SHELL%" | tr '\\\\' / | tr '[A-Z]' '[a-z]'`
86 elif test -n "$DJGPP"; then
87 case "X${MACHTYPE:-nonesuchmach}" in
95 paths='/bin /usr/bin /usr/local/bin /usr/ucb /usr/local /usr/lbin'
96 paths="$paths /opt/bin /opt/local/bin /opt/local /opt/lbin"
97 paths="$paths /usr/5bin /etc /usr/gnu/bin /usr/new /usr/new/bin /usr/nbin"
98 paths="$paths /opt/gnu/bin /opt/new /opt/new/bin /opt/nbin"
99 paths="$paths /sys5.3/bin /sys5.3/usr/bin /bsd4.3/bin /bsd4.3/usr/ucb"
100 paths="$paths /bsd4.3/usr/bin /usr/bsd /bsd43/bin /opt/ansic/bin /usr/ccs/bin"
101 paths="$paths /etc /usr/lib /usr/ucblib /lib /usr/ccs/lib"
102 paths="$paths /sbin /usr/sbin /usr/libexec"
103 paths="$paths /system/gnu_library/bin"
107 case "$p_$PATH$p_" in
109 *) test -d $p && PATH=$PATH$p_$p ;;
116 : shall we be using ksh?
122 if (PATH=.; alias -x) >/dev/null 2>&1; then
125 if test -f /hp-ux -a -f /bin/ksh; then
126 needksh='to avoid sh bug in "here document" expansion'
128 if test -d /usr/lpp -a -f /usr/bin/bsh -a -f /usr/bin/uname; then
129 if test X`/usr/bin/uname -v` = X4; then
130 avoidksh="to avoid AIX 4's /bin/sh"
134 if test -f /osf_boot -a -f /usr/sbin/setld; then
135 if test X`/usr/bin/uname -s` = XOSF1; then
136 avoidksh="to avoid Digital UNIX' ksh"
138 unset BIN_SH # if this is 'xpg4' sh will start up ksh
141 case "$inksh/$needksh" in
148 case "$inksh/$avoidksh" in
154 case "$inksh/$needksh-$avoidksh-" in
157 (I see you are using the Korn shell. Some ksh's blow up on $me,
158 mainly on older exotic systems. If yours does, try the Bourne shell instead.)
165 echo "(Feeding myself to $newsh $reason.)"
167 Configure|*/Configure) exec $newsh $0 "$@";;
168 *) exec $newsh Configure "$@";;
173 : if needed set CDPATH to a harmless value that is not chatty
174 : avoid bash 2.02 problems with empty CDPATH.
178 *bash*) CDPATH='.' ;;
183 : Configure runs within the UU subdirectory
184 test -d UU || mkdir UU
322 initialinstalllocation=''
350 d_attribute_format=''
351 d_attribute_malloc=''
352 d_attribute_nonnull=''
353 d_attribute_noreturn=''
355 d_attribute_unused=''
356 d_attribute_warn_unused_result=''
359 d_builtin_choose_expr=''
386 d_c99_variadic_macros=''
406 endhostent_r_proto=''
412 endprotoent_r_proto=''
418 endservent_r_proto=''
470 gethostbyaddr_r_proto=''
472 gethostbyname_r_proto=''
474 gethostent_r_proto=''
486 getnetbyaddr_r_proto=''
488 getnetbyname_r_proto=''
502 d_getprotobyname_r=''
503 getprotobyname_r_proto=''
504 d_getprotobynumber_r=''
505 getprotobynumber_r_proto=''
507 getprotoent_r_proto=''
519 getservbyname_r_proto=''
521 getservbyport_r_proto=''
523 getservent_r_proto=''
547 d_libm_lib_version=''
560 d_malloc_good_size=''
602 d_old_pthread_create_joinable=''
603 old_pthread_create_joinable=''
605 d_pthread_attr_setscope=''
644 sethostent_r_proto=''
661 setprotoent_r_proto=''
673 setservent_r_proto=''
706 d_sprintf_returns_strlen=''
721 d_stdio_ptr_lval_nochange_cnt=''
722 d_stdio_ptr_lval_sets_cnt=''
925 d_inc_version_list=''
927 inc_version_list_init=''
946 ignore_versioned_solibs=''
1010 d_perl_otherlibdirs=''
1018 api_versionstring=''
1024 version_patchlevel_string=''
1028 d_nv_preserves_uv=''
1029 d_nv_zero_is_allbits_zero=''
1040 nv_preserves_uv_bits=''
1112 installsitehtml1dir=''
1115 installsitehtml3dir=''
1122 installsiteman1dir=''
1125 installsiteman3dir=''
1130 installsitescript=''
1145 d_stdio_stream_array=''
1146 stdio_stream_array=''
1157 ccflags_uselargefiles=''
1158 ldflags_uselargefiles=''
1159 libswanted_uselargefiles=''
1179 installvendorarch=''
1186 installvendorhtml1dir=''
1188 vendorhtml1direxp=''
1189 installvendorhtml3dir=''
1191 vendorhtml3direxp=''
1197 installvendorman1dir=''
1200 installvendorman3dir=''
1207 installvendorscript=''
1219 smallmach='pdp11 i8086 z8000 i80286 iAPX286'
1222 : We must find out about Eunice early
1224 if test -f /etc/unixtovms; then
1225 eunicefix=/etc/unixtovms
1227 if test -f /etc/unixtovms.exe; then
1228 eunicefix=/etc/unixtovms.exe
1231 : Set executable suffix now -- needed before hints available
1232 if test -f "/libs/version.library"; then
1235 elif test -f "/system/gnu_library/bin/ar.pm"; then
1238 elif test -n "$DJGPP"; then
1241 elif test -d c:/. -o -n "$is_os2" ; then
1250 : set useposix=false in your hint file to disable the POSIX extension.
1252 : set useopcode=false in your hint file to disable the Opcode extension.
1254 : Trailing extension. Override this in a hint file, if needed.
1255 : Extra object files, if any, needed on this platform.
1258 : Possible local include directories to search.
1259 : Set locincpth to "" in a hint file to defeat local include searches.
1260 locincpth="/usr/local/include /opt/local/include /usr/gnu/include"
1261 locincpth="$locincpth /opt/gnu/include /usr/GNU/include /opt/GNU/include"
1263 : no include file wanted by default
1266 : Enable -DEBUGGING and -DDEBUGGING from the command line
1272 : change the next line if compiling for Xenix/286 on Xenix/386
1273 xlibpth='/usr/lib/386 /lib/386'
1274 : Possible local library directories to search.
1275 loclibpth="/usr/local/lib /opt/local/lib /usr/gnu/lib"
1276 loclibpth="$loclibpth /opt/gnu/lib /usr/GNU/lib /opt/GNU/lib"
1278 : general looking path for locating libraries
1279 glibpth="/lib /usr/lib $xlibpth"
1280 glibpth="$glibpth /usr/ccs/lib /usr/ucblib /usr/local/lib"
1281 test -f /usr/shlib/libc.so && glibpth="/usr/shlib $glibpth"
1282 test -f /shlib/libc.so && glibpth="/shlib $glibpth"
1284 : Private path used by Configure to find libraries. Its value
1285 : is prepended to libpth. This variable takes care of special
1286 : machines, like the mips. Usually, it should be empty.
1289 : default library list
1291 : some systems want to use only the non-versioned libso:s
1292 ignore_versioned_solibs=''
1297 ccflags_uselargefiles=''
1298 ldflags_uselargefiles=''
1299 libswanted_uselargefiles=''
1300 : set usemultiplicity on the Configure command line to enable multiplicity.
1301 : set usesocks on the Configure command line to enable socks.
1302 : set usethreads on the Configure command line to enable threads.
1303 usereentrant='undef'
1304 : full support for void wanted by default
1307 : List of libraries we want.
1308 : If anyone needs extra -lxxx, put those in a hint file.
1309 libswanted="sfio socket bind inet nsl nm ndbm gdbm dbm db malloc dl dld ld sun"
1310 libswanted="$libswanted m crypt sec util c cposix posix ucb bsd BSD"
1311 : We probably want to search /usr/shlib before most other libraries.
1312 : This is only used by the lib/ExtUtils/MakeMaker.pm routine extliblist.
1313 glibpth=`echo " $glibpth " | sed -e 's! /usr/shlib ! !'`
1314 glibpth="/usr/shlib $glibpth"
1315 : Do not use vfork unless overridden by a hint file.
1318 : Find the basic shell for Bourne shell scripts
1322 *bsd*|sys5*) xxx="/$SYSTYPE/bin/sh";;
1325 if test -f "$xxx"; then
1328 : Build up a list and do a single loop so we can 'break' out.
1329 pth=`echo $PATH | sed -e "s/$p_/ /g"`
1330 for xxx in sh bash ksh pdksh ash; do
1332 try="$try ${p}/${xxx}"
1336 if test -f "$xxx"; then
1339 elif test "X$_exe" != X -a -f "$xxx$_exe"; then
1342 elif test -f "$xxx.exe"; then
1353 $me: Fatal Error: I can't find a Bourne Shell anywhere.
1355 Usually it's in /bin/sh. How did you even get this far?
1356 Please contact me (Perl Maintainers) at perlbug@perl.org and
1357 we'll try to straighten this all out.
1363 : see if sh knows # comments
1364 if `$sh -c '#' >/dev/null 2>&1`; then
1368 test -f $xcat$_exe || xcat=/usr/bin/cat
1369 if test ! -f $xcat$_exe; then
1370 for p in `echo $PATH | sed -e "s/$p_/ /g"` $paths; do
1371 if test -f $p/cat$_exe; then
1376 if test ! -f $xcat$_exe; then
1377 echo "Can't find cat anywhere!"
1381 echo "#!$xcat" >sharp
1385 if test -s today; then
1388 echo "#! $xcat" > sharp
1392 if test -s today; then
1400 echo "Your $sh doesn't grok # comments--I will strip them later on."
1403 echo "exec grep -v '^[ ]*#'" >spitshell
1405 $eunicefix spitshell
1406 spitshell=`pwd`/spitshell
1408 echo "I presume that if # doesn't work, #! won't work either!"
1413 : figure out how to guarantee sh startup
1415 '') startsh=${sharpbang}${sh} ;;
1427 : echo "Yup, it does."
1429 echo "Hmm... '$startsh' does not guarantee sh startup..."
1430 echo "You may have to fix up the shell scripts to make sure $sh runs them."
1435 : Save command line options in file UU/cmdline.opt for later use in
1436 : generating config.sh.
1437 cat > cmdline.opt <<EOSH
1438 # Configure command line arguments.
1447 cat >>cmdline.opt <<EOSH
1448 config_arg$argn='$arg'
1450 # Extreme backslashitis: replace each ' by '"'"'
1451 cat <<EOC | sed -e "s/'/'"'"'"'"'"'"'/g" > cmdl.opt
1454 arg_exp=`cat cmdl.opt`
1455 args_exp="$args_exp$args_sep'$arg_exp'"
1456 argn=`expr $argn + 1`
1459 # args_exp is good for restarting self: eval "set X $args_exp"; shift; $0 "$@"
1460 # used by ./hints/os2.sh
1463 : produce awk script to parse command line options
1464 cat >options.awk <<'EOF'
1466 optstr = "A:dD:eEf:hKOrsSU:V"; # getopt-style specification
1468 len = length(optstr);
1469 for (i = 1; i <= len; i++) {
1470 c = substr(optstr, i, 1);
1471 if (i < len) a = substr(optstr, i + 1, 1); else a = "";
1482 if (substr(str, 1, 1) != "-") {
1483 printf("'%s'\n", str);
1487 for (i = 2; i <= len; i++) {
1488 c = substr(str, i, 1);
1490 printf("-%s\n", substr(str, i));
1496 printf("'%s'\n", substr(str, i + 1));
1509 : process the command line options
1510 set X `for arg in "$@"; do echo "X$arg"; done |
1511 sed -e s/X// | awk -f options.awk`
1516 : set up default values
1526 rm -f optdef.sh posthint.sh
1527 cat >optdef.sh <<EOS
1533 while test $# -gt 0; do
1535 -d) shift; fastread=yes;;
1536 -e) shift; alldone=cont;;
1540 if test -r "$1"; then
1543 echo "$me: cannot read config file $1." >&2
1548 -h) shift; error=true;;
1549 -r) shift; reuseval=true;;
1550 -s) shift; silent=true; realsilent=true;;
1551 -E) shift; alldone=exit;;
1552 -K) shift; knowitall=true;;
1553 -O) shift; override=true;;
1554 -S) shift; silent=true; extractsh=true;;
1559 echo "$me: use '-U symbol=', not '-D symbol='." >&2
1560 echo "$me: ignoring -D $1" >&2
1563 sed -e "s/'/'\"'\"'/g" -e "s/=\(.*\)/='\1'/" >> optdef.sh;;
1564 *) echo "$1='define'" >> optdef.sh;;
1571 *=) echo "$1" >> optdef.sh;;
1573 echo "$me: use '-D symbol=val', not '-U symbol=val'." >&2
1574 echo "$me: ignoring -U $1" >&2
1576 *) echo "$1='undef'" >> optdef.sh;;
1587 *=*) zzz=`echo "$yyy"|sed 's!=.*!!'`
1591 zzz=" "`echo "$yyy"|sed 's!^[^=]*=!!'`
1592 yyy=`echo "$yyy"|sed 's!=.*!!'` ;;
1598 *:*) xxx=`echo "$yyy"|sed 's!:.*!!'`
1599 yyy=`echo "$yyy"|sed 's!^[^:]*:!!'`
1600 zzz=`echo "$yyy"|sed 's!^[^=]*=!!'`
1601 yyy=`echo "$yyy"|sed 's!=.*!!'` ;;
1602 *) xxx=`echo "$yyy"|sed 's!:.*!!'`
1603 yyy=`echo "$yyy"|sed 's!^[^:]*:!!'` ;;
1609 echo "$yyy=\"\${$yyy}$zzz\"" >> posthint.sh ;;
1611 echo "$yyy=''" >> posthint.sh ;;
1616 echo "$yyy='$zzz'" >> posthint.sh ;;
1618 echo "eval \"$yyy=$zzz\"" >> posthint.sh ;;
1620 echo "$yyy=\"$zzz\${$yyy}\"" >> posthint.sh ;;
1625 echo "$yyy=$zzz" >> posthint.sh ;;
1626 *) echo "$me: unknown -A command '$xxx', ignoring -A $1" >&2 ;;
1630 -V) echo "$me generated by metaconfig 3.0 PL70." >&2
1633 -*) echo "$me: unknown option $1" >&2; shift; error=true;;
1641 Usage: $me [-dehrsEKOSV] [-f config.sh] [-D symbol] [-D symbol=value]
1642 [-U symbol] [-U symbol=] [-A command:symbol...]
1643 -d : use defaults for all answers.
1644 -e : go on without questioning past the production of config.sh.
1645 -f : specify an alternate default configuration file.
1646 -h : print this help message and exit (with an error status).
1647 -r : reuse C symbols value if possible (skips costly nm extraction).
1648 -s : silent mode, only echoes questions and essential information.
1649 -D : define symbol to have some value:
1650 -D symbol symbol gets the value 'define'
1651 -D symbol=value symbol gets the value 'value'
1652 -E : stop at the end of questions, after having produced config.sh.
1653 -K : do not use unless you know what you are doing.
1654 -O : let -D and -U override definitions from loaded configuration file.
1655 -S : perform variable substitutions on all .SH files (can mix with -f)
1656 -U : undefine symbol:
1657 -U symbol symbol gets the value 'undef'
1658 -U symbol= symbol gets completely empty
1659 -A : manipulate symbol after the platform specific hints have been applied:
1660 -A symbol=value append " "value to symbol
1661 -A append:symbol=value append value to symbol
1662 -A define:symbol=value define symbol to have value
1663 -A clear:symbol define symbol to be ''
1664 -A define:symbol define symbol to be 'define'
1665 -A eval:symbol=value define symbol to be eval of value
1666 -A prepend:symbol=value prepend value to symbol
1667 -A undef:symbol define symbol to be 'undef'
1668 -A undef:symbol= define symbol to be ''
1669 -V : print version number and exit (with a zero status).
1676 case "$fastread$alldone" in
1679 case "$extractsh" in
1682 if test ! -t 0; then
1683 echo "Say 'sh Configure', not 'sh <Configure'"
1693 true) exec 1>/dev/null;;
1696 : run the defines and the undefines, if any, but leave the file out there...
1699 : create the posthint manipulation script and leave the file out there...
1704 first=`echo $package | sed -e 's/^\(.\).*/\1/'`
1705 last=`echo $package | sed -e 's/^.\(.*\)/\1/'`
1706 case "`echo AbyZ | tr '[:lower:]' '[:upper:]' 2>/dev/null`" in
1707 ABYZ) spackage=`echo $first | tr '[:lower:]' '[:upper:]'`$last;;
1708 *) spackage=`echo $first | tr '[a-z]' '[A-Z]'`$last;;
1711 : Some greps do not return status, grrr.
1712 echo "grimblepritz" >grimble
1713 if grep blurfldyick grimble >/dev/null 2>&1 ; then
1715 elif grep grimblepritz grimble >/dev/null 2>&1 ; then
1721 : the following should work in any shell
1725 echo "AGH! Grep doesn't return a status. Attempting remedial action."
1726 cat >contains <<'EOSS'
1727 grep "$1" "$2" >.greptmp && cat .greptmp && test -s .greptmp
1732 : Find the path to the source tree
1735 */*) src=`echo $0 | sed -e 's%/[^/][^/]*$%%'`
1739 *) src=`cd ../$src && pwd` ;;
1752 if test -f $rsrc/Configure && \
1753 $contains "^package=$package$" $rsrc/Configure >/dev/null 2>&1
1755 : found it, so we are ok.
1758 for src in . .. ../.. ../../.. ../../../..; do
1759 if test -f ../$src/Configure && \
1760 $contains "^package=$package$" ../$src/Configure >/dev/null 2>&1
1771 Sorry, I can't seem to locate the source dir for $package. Please start
1772 Configure with an explicit path -- i.e. /some/path/Configure.
1780 echo "Sources for $package found in \"$src\"." >&4
1784 : script used to extract .SH files with variable substitutions
1785 cat >extract <<'EOS'
1787 echo "Doing variable substitutions on .SH files..."
1788 if test -f MANIFEST; then
1789 set x `awk '{print $1}' < MANIFEST | grep '\.SH$'`
1791 echo "(Looking for .SH files under the source directory.)"
1792 set x `(cd "$src"; find . -name "*.SH" -print)`
1796 0) set x `(cd "$src"; echo *.SH)`; shift;;
1798 if test ! -f "$src/$1"; then
1804 while test $name; do
1805 if test ! -d "$name"; then
1806 create="$name $create";
1807 name=`echo $name | sed -e "s|^[^/]*$||"`;
1808 name=`echo $name | sed -e "s|\(.*\)/.*|\1|"`;
1813 for file in $create; do
1822 dir=`expr X$file : 'X\(.*\)/'`
1823 file=`expr X$file : 'X.*/\(.*\)'`
1824 (cd "$dir" && . ./$file)
1834 dir=`expr X$file : 'X\(.*\)/'`
1835 file=`expr X$file : 'X.*/\(.*\)'`
1836 (set x $dir; shift; eval $mkdir_p)
1837 sh <"$src/$dir/$file"
1846 if test -f "$src/config_h.SH"; then
1847 if test ! -f config.h; then
1848 : oops, they left it out of MANIFEST, probably, so do it anyway.
1849 . "$src/config_h.SH"
1854 : extract files and exit if asked to do so
1855 case "$extractsh" in
1857 case "$realsilent" in
1861 case "$config_sh" in
1862 '') config_sh='config.sh';;
1865 echo "Fetching answers from $config_sh..."
1868 test "$override" && . ./optdef.sh
1872 echo "Extraction done."
1877 : Eunice requires " " instead of "", can you believe it
1880 echo "Beginning of configuration questions for $package."
1882 trap 'echo " "; test -d ../UU && rm -rf X $rmlist; exit 1' 1 2 3 15
1884 : first determine how to suppress newline on echo command
1886 echo "Checking echo to see how to suppress newlines..."
1887 (echo "hi there\c" ; echo " ") >.echotmp
1888 if $contains c .echotmp >/dev/null 2>&1 ; then
1899 echo $n "The star should be here-->$c"
1903 : Now test for existence of everything in MANIFEST
1905 if test -f "$rsrc/MANIFEST"; then
1906 echo "First let's make sure your kit is complete. Checking..." >&4
1907 awk '$1 !~ /PACK[A-Z]+/ {print $1}' "$rsrc/MANIFEST" | (split -l 50 2>/dev/null || split -50)
1910 for filelist in x??; do
1911 (cd "$rsrc"; ls `cat "$tmppwd/$filelist"` >/dev/null 2>>"$tmppwd/missing")
1913 if test -s missing; then
1917 THIS PACKAGE SEEMS TO BE INCOMPLETE.
1919 You have the option of continuing the configuration process, despite the
1920 distinct possibility that your kit is damaged, by typing 'y'es. If you
1921 do, don't blame me if something goes wrong. I advise you to type 'n'o
1922 and contact the author (perlbug@perl.org).
1925 echo $n "Continue? [n] $c" >&4
1929 echo "Continuing..." >&4
1933 echo "ABORTING..." >&4
1938 echo "Looks good..."
1941 echo "There is no MANIFEST file. I hope your kit is complete !"
1946 : Find the appropriate value for a newline for tr
1947 if test -n "$DJGPP"; then
1950 if test X"$trnl" = X; then
1951 case "`echo foo|tr '\n' x 2>/dev/null`" in
1955 if test X"$trnl" = X; then
1956 case "`echo foo|tr '\012' x 2>/dev/null`" in
1957 foox) trnl='\012' ;;
1960 if test X"$trnl" = X; then
1961 case "`echo foo|tr '\r\n' xy 2>/dev/null`" in
1962 fooxy) trnl='\n\r' ;;
1965 if test X"$trnl" = X; then
1968 $me: Fatal Error: cannot figure out how to translate newlines with 'tr'.
1974 : compute the number of columns on the terminal for proper question formatting
1979 : set up the echo used in my read
1980 myecho="case \"\$xxxm\" in
1981 '') echo $n \"\$rp $c\" >&4;;
1983 '') echo $n \"[\$xxxm] $c\";;
1985 if test \`echo \"\$rp [\$xxxm] \" | wc -c\` -ge $COLUMNS; then
1987 echo $n \"[\$xxxm] $c\" >&4
1989 echo $n \"\$rp [\$xxxm] $c\" >&4
1995 : now set up to do reads with possible shell escape and default assignment
2001 case "\$fastread" in
2002 yes) case "\$dflt" in
2005 case "\$silent-\$rp" in
2010 *) case "\$silent" in
2011 true) case "\$rp" in
2016 while expr "X\$ans" : "X!" >/dev/null; do
2020 aok=''; eval "ans=\\"\$answ\\"" && aok=y
2028 set x \`expr "X\$ans" : "X!\(.*\)\$"\`
2037 set x \`expr "X\$ans" : "X&\(.*\)\$"\`
2042 echo "(OK, I'll run with -d after this question.)" >&4
2045 echo "*** Sorry, \$1 not supported yet." >&4
2055 echo "*** Substitution done -- please confirm."
2057 ans=\`echo $n "\$ans$c" | tr '$trnl' ' '\`
2062 echo "*** Error -- try again."
2069 case "\$ans\$xxxm\$nostick" in
2081 : create .config dir to save info across Configure sessions
2082 test -d ../.config || mkdir ../.config
2083 cat >../.config/README <<EOF
2084 This directory created by Configure to save information that should
2085 persist across sessions for $package.
2087 You may safely delete it if you wish.
2090 xversion=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
2092 $define|true|[yY]*) ;;
2093 *) case "$xversion" in
2096 *** WHOA THERE!!! ***
2098 This is an UNSTABLE DEVELOPMENT release.
2099 The version of this $package distribution is $xversion, that is, odd,
2100 (as opposed to even) and that signifies a development release.
2101 If you want a maintenance release, you want an even-numbered version.
2103 Do ***NOT*** install this into production use.
2104 Data corruption and crashes are possible.
2106 It is most seriously suggested that you do not continue any further
2107 unless you want to help in developing and debugging Perl.
2109 If you *still* want to build perl, you can answer 'y' now,
2110 or pass -Dusedevel to Configure.
2113 rp='Do you really want to continue?'
2117 [yY]) echo >&4 "Okay, continuing."
2118 usedevel="$define" ;;
2119 *) echo >&4 "Okay, bye."
2129 case "$versiononly" in
2130 '') versiononly="$define" ;;
2132 case "$installusrbinperl" in
2133 '') installusrbinperl="$undef" ;;
2138 : general instructions
2141 user=`(logname) 2>/dev/null`
2143 '') user=`whoami 2>&1`;;
2145 if $contains "^$user\$" ../.config/instruct >/dev/null 2>&1; then
2148 rp='Would you like to see the instructions?'
2159 This installation shell script will examine your system and ask you questions
2160 to determine how the perl5 package should be installed. If you get
2161 stuck on a question, you may use a ! shell escape to start a subshell or
2162 execute a command. Many of the questions will have default answers in square
2163 brackets; typing carriage return will give you the default.
2165 On some of the questions which ask for file or directory names you are allowed
2166 to use the ~name construct to specify the login directory belonging to "name",
2167 even if you don't have a shell which knows about that. Questions where this is
2168 allowed will be marked "(~name ok)".
2172 dflt='Type carriage return to continue'
2176 The prompter used in this script allows you to use shell variables and
2177 backticks in your answers. You may use $1, $2, etc... to refer to the words
2178 in the default answer, as if the default line was a set of arguments given to a
2179 script shell. This means you may also use $* to repeat the whole default line,
2180 so you do not have to re-type everything to add something to the default.
2182 Everytime there is a substitution, you will have to confirm. If there is an
2183 error (e.g. an unmatched backtick), the default answer will remain unchanged
2184 and you will be prompted again.
2186 If you are in a hurry, you may run 'Configure -d'. This will bypass nearly all
2187 the questions and use the computed defaults (or the previous answers if there
2188 was already a config.sh file). Type 'Configure -h' for a list of options.
2189 You may also start interactively and then answer '& -d' at any prompt to turn
2190 on the non-interactive behaviour for the remainder of the execution.
2196 Much effort has been expended to ensure that this shell script will run on any
2197 Unix system. If despite that it blows up on yours, your best bet is to edit
2198 Configure and run it again. If you can't run Configure for some reason,
2199 you'll have to generate a config.sh file by hand. Whatever problems you
2200 have, let me (perlbug@perl.org) know how I blew it.
2202 This installation script affects things in two ways:
2204 1) it may do direct variable substitutions on some of the files included
2206 2) it builds a config.h file for inclusion in C programs. You may edit
2207 any of these files as the need arises after running this script.
2209 If you make a mistake on a question, there is no easy way to back up to it
2210 currently. The easiest thing to do is to edit config.sh and rerun all the SH
2211 files. Configure will offer to let you do this before it runs the SH files.
2214 dflt='Type carriage return to continue'
2216 case "$firsttime" in
2217 true) echo $user >>../.config/instruct;;
2221 : find out where common programs are
2223 echo "Locating common programs..." >&4
2236 if test -d \$dir/\$thing; then
2242 for thisthing in \$dir/\$thing; do
2243 : just loop through to pick last item
2245 if test -f \$thisthing; then
2248 elif test "X$_exe" != X -a -f \$thisthing$_exe; then
2251 elif test -f \$dir/\$thing.exe; then
2252 if test -n "$DJGPP"; then
2253 echo \$dir/\$thing.exe
2254 elif test "$eunicefix" != ":"; then
2255 : on Eunice apparently
2309 pth=`echo $PATH | sed -e "s/$p_/ /g"`
2310 pth="$pth /lib /usr/lib"
2311 for file in $loclist; do
2315 if test -f "$xxx"; then
2318 echo "WARNING: no $xxx -- ignoring your setting for $file." >&4
2319 xxx=`./loc $file $file $pth`
2322 '') xxx=`./loc $file $file $pth`;;
2323 *) xxx=`./loc $xxx $xxx $pth`;;
2325 eval $file=$xxx$_exe
2329 echo $file is in $xxx.
2332 echo $file is in $xxx.
2335 echo "I don't know where '$file' is, and my life depends on it." >&4
2336 echo "Go find a public domain implementation or fix your PATH setting!" >&4
2342 echo "Don't worry if any of the following aren't found..."
2344 for file in $trylist; do
2348 if test -f "$xxx"; then
2351 echo "WARNING: no $xxx -- ignoring your setting for $file." >&4
2352 xxx=`./loc $file $file $pth`
2355 '') xxx=`./loc $file $file $pth`;;
2356 *) xxx=`./loc $xxx $xxx $pth`;;
2358 eval $file=$xxx$_exe
2362 echo $file is in $xxx.
2365 echo $file is in $xxx.
2368 echo "I don't see $file out there, $say."
2375 echo "Substituting grep for egrep."
2382 echo "Substituting cp for ln."
2391 echo "I can't find make or gmake, and my life depends on it." >&4
2392 echo "Go find a public domain implementation or fix your PATH setting!" >&4
2400 *) # We can't have osname yet.
2401 if test -f "/system/gnu_library/bin/ar.pm"; then # Stratus VOS
2402 # Assume that gmake, if found, is definitely GNU make
2403 # and prefer it over the system make.
2404 echo "Substituting gmake for make."
2412 echo "Hopefully test is built into your sh."
2415 if `sh -c "PATH= test true" >/dev/null 2>&1`; then
2416 echo "Using the test built into your sh."
2424 echo "Hopefully echo is built into your sh."
2429 echo "Checking compatibility between $echo and builtin echo (if any)..." >&4
2430 $echo $n "hi there$c" >foo1
2431 echo $n "hi there$c" >foo2
2432 if cmp foo1 foo2 >/dev/null 2>&1; then
2433 echo "They are compatible. In fact, they may be identical."
2440 They are not compatible! You are probably running ksh on a non-USG system.
2441 I'll have to use $echo instead of the builtin, since Bourne shell doesn't
2442 have echo built in and we may have to run some Bourne shell scripts. That
2443 means I'll have to use '$n$c' to suppress newlines now. Life is ridiculous.
2446 $echo $n "The star should be here-->$c"
2456 cat <<'EOSC' >>trygcc
2461 int main(int argc, char *argv[]) {
2465 if $cc -o try $ccflags $ldflags try.c; then
2468 echo "Uh-oh, the C compiler '$cc' doesn't seem to be working." >&4
2474 case "`$cc -v -c try.c 2>&1`" in
2477 if $test X"$trygcc" = Xyes; then
2478 if gcc -o try -c try.c; then
2480 echo "You seem to have a working gcc, though." >&4
2481 rp="Would you like to use it?"
2483 if $test -f myread; then
2486 if $test -f UU/myread; then
2489 echo "Cannot find myread, sorry. Aborting." >&2
2494 [yY]*) cc=gcc; ccname=gcc; ccflags=''; despair=no;
2495 if $test -f usethreads.cbu; then
2498 *** However, any setting of the C compiler flags (e.g. for thread support)
2499 *** has been lost. It may be necessary to pass -Dcc=gcc to Configure
2500 *** (together with e.g. -Dusethreads).
2516 cat <<'EOSC' >>checkcc
2521 int main(int argc, char *argv[]) {
2525 if $cc -o try $ccflags $ldflags try.c; then
2528 if $test X"$despair" = Xyes; then
2529 echo "Uh-oh, the C compiler '$cc' doesn't seem to be working." >&4
2532 You need to find a working C compiler.
2533 Either (purchase and) install the C compiler supplied by your OS vendor,
2534 or for a free C compiler try http://gcc.gnu.org/
2535 I cannot continue any further, aborting.
2544 : determine whether symbolic links are supported
2547 if $ln -s blurfl sym > /dev/null 2>&1 ; then
2548 echo "Symbolic links are supported." >&4
2551 echo "Symbolic links are NOT supported." >&4
2556 : determine whether symbolic links are supported
2560 echo "Checking how to test for symbolic links..." >&4
2562 if $test "X$issymlink" = X; then
2564 '') sh -c "PATH= test -h sym" >/dev/null 2>&1 ;;
2565 *) $newsh -c "PATH= test -h sym" >/dev/null 2>&1 ;;
2567 if test $? = 0; then
2570 echo "Your builtin 'test -h' may be broken." >&4
2573 *) pth=`echo $PATH | sed -e "s/$p_/ /g"`
2576 if test -f "$p/$test"; then
2585 echo "Trying external '$test -h'." >&4
2586 issymlink="$test -h"
2587 if $test ! -h sym >/dev/null 2>&1; then
2588 echo "External '$test -h' is broken, too." >&4
2596 if $test "X$issymlink" = X; then
2597 if $test -L sym 2>/dev/null; then
2598 issymlink="$test -L"
2599 echo "The builtin '$test -L' worked." >&4
2602 if $test "X$issymlink" != X; then
2603 echo "You can test for symbolic links with '$issymlink'." >&4
2605 echo "I do not know how you can test for symbolic links." >&4
2609 *) echo "No symbolic links, so not testing for their testing..." >&4
2615 case "$mksymlinks" in
2618 ''|'.') echo "Cannot create symlinks in the original directory." >&4
2621 *) case "$lns:$issymlink" in
2622 *"ln"*" -s:"*"test -"?)
2623 echo "Creating the symbolic links..." >&4
2624 echo "(First creating the subdirectories...)" >&4
2626 awk '{print $1}' $src/MANIFEST | grep / | sed 's:/[^/]*$::' | sort -u | while true; do
2628 test -z "$directory" && break
2632 if test ! -d t/base; then
2633 echo "Failed to create the subdirectories. Aborting." >&4
2636 echo "(Then creating the symlinks...)" >&4
2637 awk '{print $1}' $src/MANIFEST | while true; do
2639 test -z "$filename" && break
2640 if test -f $filename; then
2641 if $issymlink $filename; then
2645 if test -f $filename; then
2646 echo "$filename already exists, not symlinking."
2648 ln -s $src/$filename $filename
2652 if test ! -f t/base/lex.t; then
2653 echo "Failed to create the symlinks (t/base/lex.t missing). Aborting." >&4
2658 *) echo "(I cannot figure out how to do symbolic links, ignoring mksymlinks)." >&4
2667 case "$usecrosscompile" in
2669 $echo "Cross-compiling..."
2672 *-*-gcc) # A cross-compiling gcc, probably.
2673 targetarch=`$echo $cc|$sed 's/-gcc$//'`
2675 # leave out ld, choosing it is more complex
2677 ranlib=$targetarch-ranlib
2678 $echo 'extern int foo;' > try.c
2679 set X `$cc -v -E try.c 2>&1 | $awk '/^#include </,/^End of search /'|$grep '/include'`
2681 if $test $# -gt 0; then
2683 incpth="`$echo $incpth|$sed 's/^ //'`"
2684 echo "Guessing incpth '$incpth'." >&4
2686 j="`$echo $i|$sed 's,/include$,/lib,'`"
2687 if $test -d $j; then
2691 libpth="`$echo $libpth|$sed 's/^ //'`"
2692 echo "Guessing libpth '$libpth'." >&4
2697 case "$targetarch" in
2698 '') echo "Targetarch not defined." >&4; croak=y ;;
2699 *) echo "Using targetarch $targetarch." >&4 ;;
2702 '') echo "Incpth not defined." >&4; croak=y ;;
2703 *) echo "Using incpth '$incpth'." >&4 ;;
2706 '') echo "Libpth not defined." >&4; croak=y ;;
2707 *) echo "Using libpth '$libpth'." >&4 ;;
2710 '') for i in $incpth; do
2711 if $test -f $i/errno.h -a -f $i/stdio.h -a -f $i/time.h; then
2713 echo "Guessing usrinc $usrinc." >&4
2718 '') echo "Usrinc not defined." >&4; croak=y ;;
2721 *) echo "Using usrinc $usrinc." >&4 ;;
2723 case "$targethost" in
2724 '') echo "Targethost not defined." >&4; croak=y ;;
2725 *) echo "Using targethost $targethost." >&4
2730 y) echo "Cannot continue, aborting." >&4; exit 1 ;;
2733 /*) run=$src/Cross/run
2734 targetmkdir=$src/Cross/mkdir
2736 from=$src/Cross/from
2738 *) pwd=`$test -f ../Configure & cd ..; pwd`
2740 targetmkdir=$pwd/Cross/mkdir
2742 from=$pwd/Cross/from
2745 case "$targetrun" in
2746 '') targetrun=ssh ;;
2751 case "$targetfrom" in
2752 '') targetfrom=scp ;;
2756 from=$from-$targetfrom
2757 case "$targetdir" in
2759 echo "Guessing targetdir $targetdir." >&4
2762 case "$targetuser" in
2764 echo "Guessing targetuser $targetuser." >&4
2767 case "$targetfrom" in
2771 case "$targetrun" in
2783 '') cwd=$targetdir ;;
2787 if $test ! -f \$exe.xok; then
2791 $targetrun -l $targetuser $targethost "cd \$cwd && ./\$exe \$@"
2794 *) echo "Unknown targetrun '$targetrun'" >&4
2798 case "$targetmkdir" in
2800 cat >$targetmkdir <<EOF
2802 $targetrun -l $targetuser $targethost "mkdir -p \$@"
2804 $chmod a+rx $targetmkdir
2806 *) echo "Unknown targetmkdir '$targetmkdir'" >&4
2818 $targetmkdir \`dirname \$f\`
2819 $targetto $q \$f $targetuser@$targethost:\$f || exit 1
2822 $targetmkdir $targetdir/\`dirname \$f\`
2823 $targetto $q \$f $targetuser@$targethost:$targetdir/\$f || exit 1
2836 $mkdir -p $targetdir/\`dirname \$f\`
2837 $cp \$f $targetdir/\$f || exit 1
2840 $targetmkdir $targetdir/\`dirname \$f\`
2841 $cp \$f $targetdir/\$f || exit 1
2848 *) echo "Unknown targetto '$targetto'" >&4
2852 case "$targetfrom" in
2859 $targetfrom $q $targetuser@$targethost:$targetdir/\$f . || exit 1
2864 cp) cat >$from <<EOF
2869 cp $targetdir/\$f . || exit 1
2874 *) echo "Unknown targetfrom '$targetfrom'" >&4
2878 if $test ! -f $run; then
2879 echo "Target 'run' script '$run' not found." >&4
2883 if $test ! -f $to; then
2884 echo "Target 'to' script '$to' not found." >&4
2888 if $test ! -f $from; then
2889 echo "Target 'from' script '$from' not found." >&4
2893 if $test ! -f $run -o ! -f $to -o ! -f $from; then
2897 Using '$run' for remote execution,
2898 and '$from' and '$to'
2899 for remote file transfer.
2905 usecrosscompile='undef'
2910 : see whether [:lower:] and [:upper:] are supported character classes
2912 case "`echo AbyZ | $tr '[:lower:]' '[:upper:]' 2>/dev/null`" in
2914 echo "Good, your tr supports [:lower:] and [:upper:] to convert case." >&4
2918 *) # There is a discontinuity in EBCDIC between 'R' and 'S'
2919 # (0xd9 and 0xe2), therefore that is a nice testing point.
2920 if test "X$up" = X -o "X$low" = X; then
2921 case "`echo RS | $tr '[R-S]' '[r-s]' 2>/dev/null`" in
2927 if test "X$up" = X -o "X$low" = X; then
2928 case "`echo RS | $tr R-S r-s 2>/dev/null`" in
2934 if test "X$up" = X -o "X$low" = X; then
2935 case "`echo RS | od -x 2>/dev/null`" in
2937 echo "Hey, this might be EBCDIC." >&4
2938 if test "X$up" = X -o "X$low" = X; then
2939 case "`echo RS | $tr '[A-IJ-RS-Z]' '[a-ij-rs-z]' 2>/dev/null`" in
2940 rs) up='[A-IJ-RS-Z]'
2945 if test "X$up" = X -o "X$low" = X; then
2946 case "`echo RS | $tr A-IJ-RS-Z a-ij-rs-z 2>/dev/null`" in
2956 case "`echo RS | $tr \"$up\" \"$low\" 2>/dev/null`" in
2958 echo "Using $up and $low to convert case." >&4
2961 echo "I don't know how to translate letters from upper to lower case." >&4
2962 echo "Your tr is not acting any way I know of." >&4
2966 : set up the translation script tr, must be called with ./tr of course
2970 '[A-Z][a-z]') exec $tr '$up' '$low';;
2971 '[a-z][A-Z]') exec $tr '$low' '$up';;
2978 : Try to determine whether config.sh was made on this system
2979 case "$config_sh" in
2981 myuname=`$uname -a 2>/dev/null`
2982 $test -z "$myuname" && myuname=`hostname 2>/dev/null`
2983 # tr '[A-Z]' '[a-z]' would not work in EBCDIC
2984 # because the A-Z/a-z are not consecutive.
2985 myuname=`echo $myuname | $sed -e 's/^[^=]*=//' -e 's/\///g' | \
2986 ./tr '[A-Z]' '[a-z]' | $tr $trnl ' '`
2987 newmyuname="$myuname"
2989 case "$knowitall" in
2991 if test -f ../config.sh; then
2992 if $contains myuname= ../config.sh >/dev/null 2>&1; then
2993 eval "`grep myuname= ../config.sh`"
2995 if test "X$myuname" = "X$newmyuname"; then
3003 : Get old answers from old config file if Configure was run on the
3004 : same system, otherwise use the hints.
3007 if test -f config.sh; then
3009 rp="I see a config.sh file. Shall I use it to set the defaults?"
3012 n*|N*) echo "OK, I'll ignore it."
3013 mv config.sh config.sh.old
3014 myuname="$newmyuname"
3016 *) echo "Fetching default answers from your old config.sh file..." >&4
3024 : Older versions did not always set $sh. Catch re-use of such
3034 if test ! -f config.sh; then
3037 First time through, eh? I have some defaults handy for some systems
3038 that need some extra help getting the Configure answers right:
3041 (cd $src/hints; ls -C *.sh) | $sed 's/\.sh/ /g' >&4
3043 : Half the following guesses are probably wrong... If you have better
3044 : tests or hints, please send them to perlbug@perl.org
3045 : The metaconfig authors would also appreciate a copy...
3046 $test -f /irix && osname=irix
3047 $test -f /xenix && osname=sco_xenix
3048 $test -f /dynix && osname=dynix
3049 $test -f /dnix && osname=dnix
3050 $test -f /lynx.os && osname=lynxos
3051 $test -f /unicos && osname=unicos && osvers=`$uname -r`
3052 $test -f /unicosmk && osname=unicosmk && osvers=`$uname -r`
3053 $test -f /unicosmk.ar && osname=unicosmk && osvers=`$uname -r`
3054 $test -f /bin/mips && /bin/mips && osname=mips
3055 $test -d /NextApps && set X `hostinfo | grep 'NeXT Mach.*:' | \
3056 $sed -e 's/://' -e 's/\./_/'` && osname=next && osvers=$4
3057 $test -d /usr/apollo/bin && osname=apollo
3058 $test -f /etc/saf/_sactab && osname=svr4
3059 $test -d /usr/include/minix && osname=minix
3060 $test -f /system/gnu_library/bin/ar.pm && osname=vos
3061 if $test -d /MachTen -o -d /MachTen_Folder; then
3063 if $test -x /sbin/version; then
3064 osvers=`/sbin/version | $awk '{print $2}' |
3065 $sed -e 's/[A-Za-z]$//'`
3066 elif $test -x /usr/etc/version; then
3067 osvers=`/usr/etc/version | $awk '{print $2}' |
3068 $sed -e 's/[A-Za-z]$//'`
3074 $test -f /sys/posix.dll &&
3075 $test -f /usr/bin/what &&
3076 set X `/usr/bin/what /sys/posix.dll` &&
3077 $test "$3" = UWIN &&
3081 if $test -f $uname; then
3089 umips) osname=umips ;;
3092 [23]100) osname=mips ;;
3093 next*) osname=next ;;
3095 tmp=`/bin/uname -X 2>/dev/null|awk '/3\.2v[45]/{ print $(NF) }'`
3096 if $test "$tmp" != "" -a "$3" = "3.2" -a -f '/etc/systemid'; then
3099 elif $test -f /etc/kconfig; then
3101 if test "$lns" = "$ln -s"; then
3103 elif $contains _SYSV3 /usr/include/stdio.h > /dev/null 2>&1 ; then
3105 elif $contains _POSIX_SOURCE /usr/include/stdio.h > /dev/null 2>&1 ; then
3112 if test -n "$DJGPP"; then
3121 tmp=`( (oslevel) 2>/dev/null || echo "not found") 2>&1`
3123 # oslevel can fail with:
3124 # oslevel: Unable to acquire lock.
3125 *not\ found) osvers="$4"."$3" ;;
3126 '<3240'|'<>3240') osvers=3.2.0 ;;
3127 '=3240'|'>3240'|'<3250'|'<>3250') osvers=3.2.4 ;;
3128 '=3250'|'>3250') osvers=3.2.5 ;;
3132 bsd386) osname=bsd386
3135 cygwin*) osname=cygwin
3138 *dc.osx) osname=dcosx
3144 domainos) osname=apollo
3150 dragonfly) osname=dragonfly
3153 dynixptx*) osname=dynixptx
3154 osvers=`echo "$4"|sed 's/^v//'`
3156 freebsd) osname=freebsd
3158 genix) osname=genix ;;
3162 osvers=`echo "$3" | $sed 's,.*\.\([0-9]*\.[0-9]*\),\1,'`
3178 netbsd*) osname=netbsd
3181 news-os) osvers="$3"
3183 4*) osname=newsos4 ;;
3187 next*) osname=next ;;
3188 nonstop-ux) osname=nonstopux ;;
3189 openbsd) osname=openbsd
3195 POSIX-BC | posix-bc ) osname=posix-bc
3198 powerux | power_ux | powermax_os | powermaxos | \
3199 powerunix | power_unix) osname=powerux
3205 solaris) osname=solaris
3207 5*) osvers=`echo $3 | $sed 's/^5/2/g'` ;;
3214 osvers=`echo $3 | $sed 's/^5/2/g'` ;;
3218 titanos) osname=titanos
3227 ultrix) osname=ultrix
3230 osf1|mls+) case "$5" in
3233 osvers=`sizer -v | awk -FUNIX '{print $2}' | awk '{print $1}' | tr '[A-Z]' '[a-z]' | sed 's/^[xvt]//'`
3236 *) osvers=`echo "$3" | sed 's/^[xvt]//'` ;;
3239 hp*) osname=hp_osf1 ;;
3240 mips) osname=mips_osf1 ;;
3243 # UnixWare 7.1.2 is known as Open UNIX 8
3244 openunix|unixware) osname=svr5
3252 $2) case "$osname" in
3256 : svr4.x or possibly later
3266 if test -f /stand/boot ; then
3267 eval `grep '^INITPROG=[a-z/0-9]*$' /stand/boot`
3268 if test -n "$INITPROG" -a -f "$INITPROG"; then
3269 isesix=`strings -a $INITPROG|grep 'ESIX SYSTEM V/386 Release 4.0'`
3270 if test -n "$isesix"; then
3278 *) if test -f /etc/systemid; then
3280 set `echo $3 | $sed 's/\./ /g'` $4
3281 if $test -f $src/hints/sco_$1_$2_$3.sh; then
3283 elif $test -f $src/hints/sco_$1_$2.sh; then
3285 elif $test -f $src/hints/sco_$1.sh; then
3290 '') : Still unknown. Probably a generic Sys V.
3299 *) case "$osname" in
3300 '') : Still unknown. Probably a generic BSD.
3308 if test -f /vmunix -a -f $src/hints/news_os.sh; then
3309 (what /vmunix | UU/tr '[A-Z]' '[a-z]') > UU/kernel.what 2>&1
3310 if $contains news-os UU/kernel.what >/dev/null 2>&1; then
3313 $rm -f UU/kernel.what
3314 elif test -d c:/. -o -n "$is_os2" ; then
3321 case "$targetarch" in
3324 osname=`echo $targetarch|sed 's,^[^-]*-,,'`
3329 : Now look for a hint file osname_osvers, unless one has been
3330 : specified already.
3333 file=`echo "${osname}_${osvers}" | $sed -e 's%\.%_%g' -e 's%_$%%'`
3334 : Also try without trailing minor version numbers.
3335 xfile=`echo $file | $sed -e 's%_[^_]*$%%'`
3336 xxfile=`echo $xfile | $sed -e 's%_[^_]*$%%'`
3337 xxxfile=`echo $xxfile | $sed -e 's%_[^_]*$%%'`
3338 xxxxfile=`echo $xxxfile | $sed -e 's%_[^_]*$%%'`
3341 *) case "$osvers" in
3344 *) if $test -f $src/hints/$file.sh ; then
3346 elif $test -f $src/hints/$xfile.sh ; then
3348 elif $test -f $src/hints/$xxfile.sh ; then
3350 elif $test -f $src/hints/$xxxfile.sh ; then
3352 elif $test -f $src/hints/$xxxxfile.sh ; then
3354 elif $test -f "$src/hints/${osname}.sh" ; then
3363 if $test -f Policy.sh ; then
3366 none) dflt="Policy" ;;
3367 *) dflt="Policy $dflt" ;;
3372 dflt=`echo $hintfile | $sed 's/\.sh$//'`
3376 if $test -f Policy.sh ; then
3379 There's also a Policy hint file available, which should make the
3380 site-specific (policy) questions easier to answer.
3387 You may give one or more space-separated answers, or "none" if appropriate.
3388 A well-behaved OS will have no hints, so answering "none" or just "Policy"
3389 is a good thing. DO NOT give a wrong version or a wrong OS.
3393 rp="Which of these apply, if any?"
3396 for file in $tans; do
3397 if $test X$file = XPolicy -a -f Policy.sh; then
3399 $cat Policy.sh >> UU/config.sh
3400 elif $test -f $src/hints/$file.sh; then
3401 . $src/hints/$file.sh
3402 $cat $src/hints/$file.sh >> UU/config.sh
3403 elif $test X"$tans" = X -o X"$tans" = Xnone ; then
3406 : Give one chance to correct a possible typo.
3407 echo "$file.sh does not exist"
3409 rp="hint to use instead?"
3411 for file in $ans; do
3412 if $test -f "$src/hints/$file.sh"; then
3413 . $src/hints/$file.sh
3414 $cat $src/hints/$file.sh >> UU/config.sh
3415 elif $test X$ans = X -o X$ans = Xnone ; then
3418 echo "$file.sh does not exist -- ignored."
3425 : Remember our hint file for later.
3426 if $test -f "$src/hints/$file.sh" ; then
3436 echo "Fetching default answers from $config_sh..." >&4
3440 cp $config_sh config.sh 2>/dev/null
3450 test "$override" && . ./optdef.sh
3452 : Restore computed paths
3453 for file in $loclist $trylist; do
3454 eval $file="\$_$file"
3459 Configure uses the operating system name and version to set some defaults.
3460 The default value is probably right if the name rings a bell. Otherwise,
3461 since spelling matters for me, either accept the default or answer "none"
3468 ''|' '|none) dflt=none ;;
3469 *) dflt=`echo $hintfile | $sed -e 's/\.sh$//' -e 's/_.*$//'` ;;
3472 *) dflt="$osname" ;;
3474 rp="Operating system name?"
3478 *) osname=`echo "$ans" | $sed -e 's/[ ][ ]*/_/g' | ./tr '[A-Z]' '[a-z]'`;;
3484 ''|' '|none) dflt=none ;;
3485 *) dflt=`echo $hintfile | $sed -e 's/\.sh$//' -e 's/^[^_]*//'`
3486 dflt=`echo $dflt | $sed -e 's/^_//' -e 's/_/./g'`
3488 ''|' ') dflt=none ;;
3493 *) dflt="$osvers" ;;
3495 rp="Operating system version?"
3505 : who configured the system
3506 cf_time=`LC_ALL=C; LANGUAGE=C; export LC_ALL; export LANGUAGE; $date 2>&1`
3509 cf_by=`(logname) 2>/dev/null`
3512 cf_by=`(whoami) 2>/dev/null`
3514 "") cf_by=unknown ;;
3519 : decide how portable to be. Allow command line overrides.
3520 case "$d_portable" in
3522 *) d_portable="$define" ;;
3525 : set up shell script to do ~ expansion
3531 echo \$1 | $sed "s|~|\${HOME-\$LOGDIR}|"
3534 if $test -f /bin/csh; then
3535 /bin/csh -f -c "glob \$1"
3540 name=\`$expr x\$1 : '..\([^/]*\)'\`
3541 dir=\`$sed -n -e "/^\${name}:/{s/^[^:]*:[^:]*:[^:]*:[^:]*:[^:]*:\([^:]*\).*"'\$'"/\1/" -e p -e q -e '}' </etc/passwd\`
3542 if $test ! -d "\$dir"; then
3544 echo "\$me: can't locate home directory for: \$name" >&2
3549 echo \$dir/\`$expr x\$1 : '..[^/]*/\(.*\)'\`
3565 : now set up to get a file name
3569 cat <<'EOSC' >>getfile
3585 : getfile will accept an answer from the comma-separated list
3586 : enclosed in parentheses even if it does not meet other criteria.
3587 expr "$fn" : '.*(\(.*\)).*' | $tr ',' $trnl >getfile.ok
3588 fn=`echo $fn | sed 's/(.*)//'`
3594 loc_file=`expr $fn : '.*:\(.*\)'`
3595 fn=`expr $fn : '\(.*\):.*'`
3603 */*) fullpath=true;;
3612 *e*) exp_file=true;;
3615 *p*) nopath_ok=true;;
3620 *d*) type='Directory';;
3621 *l*) type='Locate';;
3626 Locate) what='File';;
3631 case "$d_portable" in
3639 while test "$type"; do
3644 true) rp="$rp (~name ok)";;
3647 if test -f UU/getfile.ok && \
3648 $contains "^$ans\$" UU/getfile.ok >/dev/null 2>&1
3667 value=`UU/filexp $ans`
3670 if test "$ans" != "$value"; then
3671 echo "(That expands to $value on this system.)"
3685 /*) value="$ansexp" ;;
3686 [a-zA-Z]:/*) value="$ansexp" ;;
3691 echo "I shall only accept a full path name, as in /bin/ls." >&4
3692 echo "Use a ! shell escape if you wish to check pathnames." >&4
3695 echo "Please give a full path name, starting with slash." >&4
3698 echo "Note that using ~name is ok provided it expands well." >&4
3711 for fp in $gfpth; do
3712 if test "X$fp" = X.; then
3717 if test -f "$pf"; then
3719 elif test -r "$pf" || (test -h "$pf") >/dev/null 2>&1
3721 echo "($value is not a plain file, but that's ok.)"
3724 if test X"$type" = X; then
3731 for fp in $gfpth; do
3732 if test "X$fp" = X.; then
3737 direxp="$fp/$ansexp"
3739 if test -d "$direxp"; then
3747 if test -d "$ansexp"; then
3748 echo "(Looking for $loc_file in directory $value.)"
3749 value="$value/$loc_file"
3750 ansexp="$ansexp/$loc_file"
3752 if test -f "$ansexp"; then
3755 case "$nopath_ok" in
3756 true) case "$value" in
3758 *) echo "Assuming $value will be in people's path."
3774 if test "$fastread" = yes; then
3779 rp="$what $value doesn't exist. Use that name anyway?"
3798 test "X$gfpthkeep" != Xy && gfpth=""
3801 : determine root of directory hierarchy where package will be installed.
3804 dflt=`./loc . /usr/local /usr/local /local /opt /usr`
3807 dflt=`echo "$prefix" | sed 's/.$//'`
3815 By default, $package will be installed in $dflt/bin, manual pages
3816 under $dflt/man, etc..., i.e. with $dflt as prefix for all
3817 installation directories. Typically this is something like /usr/local.
3818 If you wish to have binaries under /usr/bin but other parts of the
3819 installation under /usr/local, that's ok: you will be prompted
3820 separately for each of the installation directories, the prefix being
3821 only used to set the defaults.
3825 rp='Installation prefix to use?'
3833 *) oldprefix="$prefix";;
3842 *) afsroot=$afsroot ;;
3848 $define|true) afs=true ;;
3849 $undef|false) afs=false ;;
3850 *) if test -d $afsroot; then
3858 echo "AFS may be running... I'll be extra cautious then..." >&4
3860 echo "AFS does not seem to be running..." >&4
3863 : determine installation prefix for where package is to be installed.
3867 Since you are running AFS, I need to distinguish the directory in which
3868 files will reside from the directory in which they are installed (and from
3869 which they are presumably copied to the former directory by occult means).
3872 case "$installprefix" in
3873 '') dflt=`echo $prefix | sed 's#^/afs/#/afs/.#'`;;
3874 *) dflt="$installprefix";;
3879 In some special cases, particularly when building $package for distribution,
3880 it is convenient to distinguish the directory in which files should be
3881 installed from the directory ($prefix) in which they will
3882 eventually reside. For most users, these two directories are the same.
3885 case "$installprefix" in
3887 *) dflt=$installprefix;;
3891 rp='What installation prefix should I use for installing files?'
3893 installprefix="$ans"
3894 installprefixexp="$ansexp"
3896 : Perform the prefixexp/installprefixexp correction if necessary
3897 cat <<EOS >installprefix
3900 cat <<'EOSC' >>installprefix
3901 : Change installation prefix, if necessary.
3902 if $test X"$prefix" != X"$installprefix"; then
3903 eval "install${prefixvar}=\`echo \$${prefixvar}exp | sed \"s#^\$prefixexp#\$installprefixexp#\"\`"
3905 eval "install${prefixvar}=\"\$${prefixvar}exp\""
3908 chmod +x installprefix
3909 $eunicefix installprefix
3911 : Set variables such as privlib and privlibexp from the output of ./getfile
3912 : performing the prefixexp/installprefixexp correction if necessary.
3913 cat <<EOS >setprefixvar
3916 cat <<'EOSC' >>setprefixvar
3917 eval "${prefixvar}=\"\$ans\""
3918 eval "${prefixvar}exp=\"\$ansexp\""
3921 chmod +x setprefixvar
3922 $eunicefix setprefixvar
3924 : set up the script used to warn in case of inconsistency
3931 echo "*** WHOA THERE!!! ***" >&4
3932 echo " The $hint value for \$$var on this machine was \"$was\"!" >&4
3933 rp=" Keep the $hint value?"
3936 y) td=$was; tu=$was;;
3940 : function used to set $1 to $val
3941 setvar='var=$1; eval "was=\$$1"; td=$define; tu=$undef;
3943 $define$undef) . ./whoa; eval "$var=\$td";;
3944 $undef$define) . ./whoa; eval "$var=\$tu";;
3945 *) eval "$var=$val";;
3949 $define|true|[yY]*) dflt='y';;
3954 Perl can be built to use the SOCKS proxy protocol library. To do so,
3955 Configure must be run with -Dusesocks. If you use SOCKS you also need
3956 to use the PerlIO abstraction layer, this will be implicitly selected.
3958 If this doesn't make any sense to you, just accept the default '$dflt'.
3960 rp='Build Perl for SOCKS?'
3963 y|Y) val="$define" ;;
3970 $define|true|[yY]*) useperlio="$define";;
3973 case "$useperlio" in
3974 $define|true|[yY]*|'') dflt='y';;
3979 Previous version of $package used the standard IO mechanisms as
3980 defined in <stdio.h>. Versions 5.003_02 and later of $package allow
3981 alternate IO mechanisms via the PerlIO abstraction layer, but the
3982 stdio mechanism is still available if needed. The abstraction layer
3983 can use AT&T's sfio (if you already have sfio installed) or regular stdio.
3984 Using PerlIO with sfio may cause problems with some extension modules.
3986 If this doesn't make any sense to you, just accept the default '$dflt'.
3988 rp='Use the PerlIO abstraction layer?'
3995 echo "Ok, doing things the stdio way."
4004 case "$useperlio" in
4005 $define|true|[yY]*) ;;
4008 You are using the SOCKS proxy protocol library which means that you
4009 should also use the PerlIO layer. You may be headed for trouble.
4018 case "$usethreads" in
4019 $define|true|[yY]*) dflt='y';;
4020 *) # Catch case where user specified ithreads or 5005threads but
4021 # forgot -Dusethreads (A.D. 4/2002)
4022 case "$useithreads$use5005threads" in
4024 case "$useperlio" in
4025 "$define") dflt='y' ;;
4035 Perl can be built to take advantage of threads on some systems.
4036 To do so, Configure can be run with -Dusethreads.
4038 Note that Perl built with threading support runs slightly slower
4039 and uses more memory than plain Perl. The current implementation
4040 is believed to be stable, but it is fairly new, and so should be
4041 treated with caution.
4043 If this doesn't make any sense to you, just accept the default '$dflt'.
4045 rp='Build a threading Perl?'
4048 y|Y) val="$define" ;;
4054 case "$usethreads" in
4058 Since release 5.6, Perl has had two different threading implementations,
4059 the newer interpreter-based version (ithreads) with one interpreter per
4060 thread, and the older 5.005 version (5005threads).
4061 The 5005threads version is effectively unmaintained and will probably be
4062 removed in Perl 5.10, so there should be no need to build a Perl using it
4063 unless needed for backwards compatibility with some existing 5.005threads
4067 : Default to ithreads unless overridden on command line or with
4070 case "$use5005threads" in
4071 $define|true|[yY]*) dflt='n';;
4073 case "$useithreads" in
4074 $undef|false|[nN]*) dflt='n';;
4076 rp='Use the newer interpreter-based ithreads?'
4079 y|Y) val="$define" ;;
4084 : Now set use5005threads to the opposite value.
4085 case "$useithreads" in
4086 $define) val="$undef" ;;
4093 useithreads="$undef"
4094 use5005threads="$undef"
4098 case "$useithreads$use5005threads" in
4102 You cannot have both the ithreads and the 5.005 threads enabled
4103 at the same time. Disabling the 5.005 threads since they are
4104 much less stable than the ithreads.
4107 use5005threads="$undef"
4111 if test X"$usethreads" = "X$define" -a "X$useperlio" = "Xundef"; then
4114 *** To build with ithreads you must also use the PerlIO layer.
4115 *** Cannot continue, aborting.
4121 case "$d_oldpthreads" in
4122 '') : Configure tests would be welcome here. For now, assume undef.
4124 *) val="$d_oldpthreads" ;;
4130 : Look for a hint-file generated 'call-back-unit'. If the
4131 : user has specified that a threading perl is to be built,
4132 : we may need to set or change some other defaults.
4133 if $test -f usethreads.cbu; then
4134 echo "Your platform has some specific hints regarding threaded builds, using them..."
4137 case "$usethreads" in
4138 "$define"|true|[yY]*)
4140 (Your platform does not have any specific hints for threaded builds.
4141 Assuming POSIX threads, then.)
4149 Perl can be built so that multiple Perl interpreters can coexist
4150 within the same Perl executable.
4153 case "$useithreads" in
4156 This multiple interpreter support is required for interpreter-based threads.
4160 *) case "$usemultiplicity" in
4161 $define|true|[yY]*) dflt='y';;
4165 echo "If this doesn't make any sense to you, just accept the default '$dflt'."
4166 rp='Build Perl for multiplicity?'
4169 y|Y) val="$define" ;;
4178 case "$usemorebits" in
4179 "$define"|true|[yY]*)
4180 use64bitint="$define"
4181 uselongdouble="$define"
4182 usemorebits="$define"
4184 *) usemorebits="$undef"
4188 : make some quick guesses about what we are up against
4190 $echo $n "Hmm... $c"
4200 $cat /usr/include/signal.h /usr/include/sys/signal.h >foo 2>/dev/null
4201 if test -f /osf_boot || $contains 'OSF/1' /usr/include/ctype.h >/dev/null 2>&1
4203 echo "Looks kind of like an OSF/1 system, but we'll see..."
4205 elif test `echo abc | $tr a-z A-Z` = Abc ; then
4206 xxx=`./loc addbib blurfl $pth`
4207 if $test -f $xxx; then
4208 echo "Looks kind of like a USG system with BSD features, but we'll see..."
4212 if $contains SIGTSTP foo >/dev/null 2>&1 ; then
4213 echo "Looks kind of like an extended USG system, but we'll see..."
4215 echo "Looks kind of like a USG system, but we'll see..."
4219 elif $contains SIGTSTP foo >/dev/null 2>&1 ; then
4220 echo "Looks kind of like a BSD system, but we'll see..."
4224 echo "Looks kind of like a Version 7 system, but we'll see..."
4227 case "$eunicefix" in
4230 There is, however, a strange, musty smell in the air that reminds me of
4231 something...hmm...yes...I've got it...there's a VMS nearby, or I'm a Blit.
4235 : it so happens the Eunice I know will not run shell scripts in Unix format
4239 echo "Congratulations. You aren't running Eunice."
4243 : Detect OS2. The p_ variable is set above in the Head.U unit.
4244 : Note that this also -- wrongly -- detects e.g. dos-djgpp, which also uses
4245 : semicolon as a patch separator
4250 I have the feeling something is not exactly right, however...don't tell me...
4251 lemme think...does HAL ring a bell?...no, of course, you're only running OS/2!
4252 (Or you may be running DOS with DJGPP.)
4257 if test -f /xenix; then
4258 echo "Actually, this looks more like a XENIX system..."
4263 echo "It's not Xenix..."
4268 if test -f /venix; then
4269 echo "Actually, this looks more like a VENIX system..."
4276 echo "Nor is it Venix..."
4279 chmod +x bsd usg v7 osf1 eunice xenix venix os2
4280 $eunicefix bsd usg v7 osf1 eunice xenix venix os2
4287 rp="Use which C compiler?"
4291 : See if they have not cc but they do have gcc
4293 : Look for a hint-file generated 'call-back-unit'. Now that the
4294 : user has specified the compiler, we may need to set or change some
4296 if $test -f cc.cbu; then
4302 echo "Checking for GNU cc in disguise and/or its version number..." >&4
4308 printf("%s\n", __VERSION__);
4310 printf("%s\n", "1");
4316 if $cc -o try $ccflags $ldflags try.c; then
4317 gccversion=`$run ./try`
4318 case "$gccversion" in
4319 '') echo "You are not using GNU cc." ;;
4320 *) echo "You are using GNU cc $gccversion."
4326 echo "*** WHOA THERE!!! ***" >&4
4327 echo " Your C compiler \"$cc\" doesn't seem to be working!" >&4
4328 case "$knowitall" in
4330 echo " You'd better start hunting for one and let me know about it." >&4
4336 case "$gccversion" in
4337 1*) cpp=`./loc gcc-cpp $cpp $pth` ;;
4339 case "$gccversion" in
4340 '') gccosandvers='' ;;
4341 *) gccshortvers=`echo "$gccversion"|sed 's/ .*//'`
4342 gccosandvers=`$cc -v 2>&1|grep '/specs$'|sed "s!.*/[^-/]*-[^-/]*-\([^-/]*\)/$gccshortvers/specs!\1!"`
4344 case "$gccosandvers" in
4345 $osname) gccosandvers='' ;; # linux gccs seem to have no linux osvers, grr
4346 $osname$osvers) ;; # looking good
4347 $osname*) cat <<EOM >&4
4349 *** WHOA THERE!!! ***
4351 Your gcc has not been compiled for the exact release of
4352 your operating system ($gccosandvers versus $osname$osvers).
4354 In general it is a good idea to keep gcc synchronized with
4355 the operating system because otherwise serious problems
4356 may ensue when trying to compile software, like Perl.
4358 I'm trying to be optimistic here, though, and will continue.
4359 If later during the configuration and build icky compilation
4360 problems appear (headerfile conflicts being the most common
4361 manifestation), I suggest reinstalling the gcc to match
4362 your operating system release.
4366 *) gccosandvers='' ;; # failed to parse, better be silent
4374 # gcc 3.* complain about adding -Idirectories that they already know about,
4375 # so we will take those off from locincpth.
4376 case "$gccversion" in
4378 echo "main(){}">try.c
4379 for incdir in $locincpth; do
4380 warn=`$cc $ccflags -I$incdir -c try.c 2>&1 | \
4381 grep '^c[cp]p*[01]: warning: changing search order '`
4382 if test "X$warn" != X; then
4383 locincpth=`echo " $locincpth " | sed "s! $incdir ! !"`
4389 : What should the include directory be ?
4391 $echo $n "Hmm... $c"
4395 if $test -f /bin/mips && /bin/mips; then
4396 echo "Looks like a MIPS system..."
4397 $cat >usr.c <<'EOCP'
4398 #ifdef SYSTYPE_BSD43
4402 if cc -E usr.c > usr.out && $contains / usr.out >/dev/null 2>&1; then
4403 dflt='/bsd43/usr/include'
4407 mips_type='System V'
4409 $rm -f usr.c usr.out
4410 echo "and you're compiling with the $mips_type compiler and libraries."
4414 echo "Doesn't look like a MIPS system."
4424 case "$xxx_prompt" in
4427 rp='Where are the include files you want to use?'
4435 : see how we invoke the C preprocessor
4437 echo "Now, how can we feed standard input to your C preprocessor..." >&4
4438 cat <<'EOT' >testcpp.c
4444 if test ! -f cppstdin; then
4445 if test "X$osname" = "Xaix" -a "X$gccversion" = X; then
4446 # AIX cc -E doesn't show the absolute headerfile
4447 # locations but we'll cheat by using the -M flag.
4448 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
4450 echo 'cat >.$$.c; '"$cc"' -E ${1+"$@"} .$$.c; rm .$$.c' >cppstdin
4453 echo "Keeping your $hint cppstdin wrapper."
4456 wrapper=`pwd`/cppstdin
4460 if $test "X$cppstdin" != "X" && \
4461 $cppstdin $cppminus <testcpp.c >testcpp.out 2>&1 && \
4462 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
4464 echo "You used to use $cppstdin $cppminus so we'll use that again."
4466 '') echo "But let's see if we can live without a wrapper..." ;;
4468 if $cpprun $cpplast <testcpp.c >testcpp.out 2>&1 && \
4469 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
4471 echo "(And we'll use $cpprun $cpplast to preprocess directly.)"
4474 echo "(However, $cpprun $cpplast does not work, let's see...)"
4482 echo "Good old $cppstdin $cppminus does not seem to be of any help..."
4489 elif echo 'Maybe "'"$cc"' -E" will work...'; \
4490 $cc -E <testcpp.c >testcpp.out 2>&1; \
4491 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4492 echo "Yup, it does."
4495 elif echo 'Nope...maybe "'"$cc"' -E -" will work...'; \
4496 $cc -E - <testcpp.c >testcpp.out 2>&1; \
4497 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4498 echo "Yup, it does."
4501 elif echo 'Nope...maybe "'"$cc"' -P" will work...'; \
4502 $cc -P <testcpp.c >testcpp.out 2>&1; \
4503 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4504 echo "Yipee, that works!"
4507 elif echo 'Nope...maybe "'"$cc"' -P -" will work...'; \
4508 $cc -P - <testcpp.c >testcpp.out 2>&1; \
4509 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4510 echo "At long last!"
4513 elif echo 'No such luck, maybe "'$cpp'" will work...'; \
4514 $cpp <testcpp.c >testcpp.out 2>&1; \
4515 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4519 elif echo 'Nixed again...maybe "'$cpp' -" will work...'; \
4520 $cpp - <testcpp.c >testcpp.out 2>&1; \
4521 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4522 echo "Hooray, it works! I was beginning to wonder."
4525 elif echo 'Uh-uh. Time to get fancy. Trying a wrapper...'; \
4526 $wrapper <testcpp.c >testcpp.out 2>&1; \
4527 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4533 rp="No dice. I can't find a C preprocessor. Name one:"
4537 $x_cpp <testcpp.c >testcpp.out 2>&1
4538 if $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4539 echo "OK, that will do." >&4
4541 echo "Sorry, I can't get that to work. Go find one and rerun Configure." >&4
4556 echo "Perhaps can we force $cc -E using a wrapper..."
4557 if $wrapper <testcpp.c >testcpp.out 2>&1; \
4558 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
4564 echo "Nope, we'll have to live without it..."
4578 "$wrapper"|'cppstdin') ;;
4579 *) $rm -f $wrapper;;
4581 $rm -f testcpp.c testcpp.out
4583 : Set private lib path
4586 plibpth="$incpath/usr/lib /usr/local/lib /usr/ccs/lib"
4591 '') dlist="$loclibpth $plibpth $glibpth";;
4592 *) dlist="$libpth";;
4595 : Now check and see which directories actually exist, avoiding duplicates
4599 if $test -d $xxx; then
4602 *) libpth="$libpth $xxx";;
4608 Some systems have incompatible or broken versions of libraries. Among
4609 the directories listed in the question below, please remove any you
4610 know not to be holding relevant libraries, and add any that are needed.
4611 Say "none" for none.
4622 rp="Directories to use for library searches?"
4629 : compute shared library extension
4632 if xxx=`./loc libc.sl X $libpth`; $test -f "$xxx"; then
4642 On some systems, shared libraries may be available. Answer 'none' if
4643 you want to suppress searching of shared libraries for the remainder
4644 of this configuration.
4647 rp='What is the file extension used for shared libraries?'
4651 : Define several unixisms.
4652 : Hints files or command line option can be used to override them.
4653 : The convoluted testing is in case hints files set either the old
4656 '') case "$exe_ext" in
4658 *) _exe="$exe_ext" ;;
4663 '') case "$lib_ext" in
4670 '') case "$obj_ext" in
4677 '') case "$path_sep" in
4688 : Which makefile gets called first. This is used by make depend.
4689 case "$firstmakefile" in
4690 '') firstmakefile='makefile';;
4694 *-DUSE_LONG_DOUBLE*|*-DUSE_MORE_BITS*) uselongdouble="$define" ;;
4697 case "$uselongdouble" in
4698 $define|true|[yY]*) dflt='y';;
4703 Perl can be built to take advantage of long doubles which
4704 (if available) may give more accuracy and range for floating point numbers.
4706 If this doesn't make any sense to you, just accept the default '$dflt'.
4708 rp='Try to use long doubles if available?'
4711 y|Y) val="$define" ;;
4717 case "$uselongdouble" in
4718 true|[yY]*) uselongdouble="$define" ;;
4721 : Look for a hint-file generated 'call-back-unit'. If the
4722 : user has specified that long doubles should be used,
4723 : we may need to set or change some other defaults.
4724 if $test -f uselongdouble.cbu; then
4725 echo "Your platform has some specific hints regarding long doubles, using them..."
4726 . ./uselongdouble.cbu
4728 case "$uselongdouble" in
4731 (Your platform does not have any specific hints for long doubles.)
4737 : Looking for optional libraries
4739 echo "Checking for optional libraries..." >&4
4744 case "$libswanted" in
4745 '') libswanted='c_s';;
4748 "$define") libswanted="$libswanted socks5 socks5_sh" ;;
4754 for thisdir in $libpth $xlibpth; do
4755 test -d $thisdir && libspath="$libspath $thisdir"
4757 for thislib in $libswanted; do
4758 for thisdir in $libspath; do
4760 if $test ! -f "$xxx" -a "X$ignore_versioned_solibs" = "X"; then
4761 xxx=`ls $thisdir/lib$thislib.$so.[0-9] 2>/dev/null|sed -n '$p'`
4762 $test -f "$xxx" && eval $libscheck
4763 $test -f "$xxx" && libstyle=shared
4765 if test ! -f "$xxx"; then
4766 xxx=$thisdir/lib$thislib.$so
4767 $test -f "$xxx" && eval $libscheck
4768 $test -f "$xxx" && libstyle=shared
4770 if test ! -f "$xxx"; then
4771 xxx=$thisdir/lib$thislib$_a
4772 $test -f "$xxx" && eval $libscheck
4773 $test -f "$xxx" && libstyle=static
4775 if test ! -f "$xxx"; then
4776 xxx=$thisdir/$thislib$_a
4777 $test -f "$xxx" && eval $libscheck
4778 $test -f "$xxx" && libstyle=static
4780 if test ! -f "$xxx"; then
4781 xxx=$thisdir/lib${thislib}_s$_a
4782 $test -f "$xxx" && eval $libscheck
4783 $test -f "$xxx" && libstyle=static
4784 $test -f "$xxx" && thislib=${thislib}_s
4786 if test ! -f "$xxx"; then
4787 xxx=$thisdir/Slib$thislib$_a
4788 $test -f "$xxx" && eval $libscheck
4789 $test -f "$xxx" && libstyle=static
4791 if $test -f "$xxx"; then
4793 shared) echo "Found -l$thislib (shared)." ;;
4794 static) echo "Found -l$thislib." ;;
4795 *) echo "Found -l$thislib ($libstyle)." ;;
4799 *) dflt="$dflt -l$thislib"
4800 libsfound="$libsfound $xxx"
4802 libsfiles="$libsfiles $yyy"
4803 yyy=`echo $xxx|$sed -e "s%/$yyy\\$%%"`
4804 case " $libsdirs " in
4806 *) libsdirs="$libsdirs $yyy" ;;
4813 if $test ! -f "$xxx"; then
4814 echo "No -l$thislib."
4825 ' '|'') dflt='none';;
4830 In order to compile $package on your machine, a number of libraries
4831 are usually needed. Include any other special libraries here as well.
4832 Say "none" for none. The default list is almost always right.
4836 rp="What libraries to use?"
4843 : determine optimization, if desired, or use for debug flag also
4845 ' '|$undef) dflt='none';;
4847 *) dflt="$optimize";;
4851 By default, $package compiles with the -O flag to use the optimizer.
4852 Alternately, you might want to use the symbolic debugger, which uses
4853 the -g flag (on traditional Unix systems). Either flag can be
4854 specified here. To use neither flag, specify the word "none".
4857 rp="What optimizer/debugger flag should be used?"
4861 'none') optimize=" ";;
4864 : Check what DEBUGGING is required from the command line
4865 : -DEBUGGING or -DDEBUGGING or
4866 : -DEBUGGING=both = -g + -DDEBUGGING
4867 : -DEBUGGING=-g or -Doptimize=-g = -g
4868 : -DEBUGGING=none or -UDEBUGGING =
4869 : -DEBUGGING=old or -DEBUGGING=default = ? $optimize
4872 *) DEBUGGING=$EBUGGING ;;
4875 case "$DEBUGGING" in
4879 *) optimize="$optimize -g" ;;
4883 *-g*) set `echo "X $optimize " | sed 's/ -g / /'`
4891 case "$DEBUGGING" in
4892 both|$define) dflt='-DDEBUGGING'
4895 : We will not override a previous value, but we might want to
4896 : augment a hint file
4898 default|recommended)
4899 case "$gccversion" in
4900 1*) dflt="$dflt -fpcc-struct-return" ;;
4902 case "$optimize:$DEBUGGING" in
4903 *-g*:old) dflt="$dflt -DDEBUGGING";;
4905 case "$gccversion" in
4906 2*) if test -d /etc/conf/kconfig.d &&
4907 $contains _POSIX_VERSION $usrinc/sys/unistd.h >/dev/null 2>&1
4909 # Interactive Systems (ISC) POSIX mode.
4914 case "$gccversion" in
4918 echo "Checking if your compiler accepts -fno-strict-aliasing" 2>&1
4919 echo 'int main(void) { return 0; }' > gcctest.c
4920 if $cc -O2 -fno-strict-aliasing -o gcctest gcctest.c; then
4921 echo "Yes, it does." 2>&1
4924 echo "Leaving current flags $ccflags alone." 2>&1
4926 *) dflt="$dflt -fno-strict-aliasing" ;;
4929 echo "Nope, it doesn't, but that's ok." 2>&1
4933 # For gcc, adding -pipe speeds up compilations for some, but apparently
4934 # some assemblers can't read from stdin. (It also slows down compilations
4935 # in other cases, but those are apparently rarer these days.) AD 5/2004.
4936 case "$gccversion" in
4938 echo "Checking if your compiler accepts -pipe" 2>&1
4939 echo 'int main(void) { return 0; }' > gcctest.c
4940 if $cc -pipe -o gcctest gcctest.c; then
4941 echo "Yes, it does." 2>&1
4944 echo "Leaving current flags $ccflags alone." 2>&1
4946 *) dflt="$dflt -pipe" ;;
4949 echo "Nope, it doesn't, but that's ok." 2>&1
4952 echo "Checking if your compiler accepts -Wdeclaration-after-statement" 2>&1
4953 echo 'int main(void) { return 0; }' > gcctest.c
4954 if $cc -Wdeclaration-after-statement -o gcctest gcctest.c; then
4955 echo "Yes, it does." 2>&1
4957 *-Wdeclaration-after-statement*)
4958 echo "Leaving current flags $ccflags alone." 2>&1
4960 *) dflt="$dflt -Wdeclaration-after-statement" ;;
4963 echo "Nope, it doesn't, but that's ok." 2>&1
4970 case "$mips_type" in
4971 *BSD*|'') inclwanted="$locincpth $usrinc";;
4972 *) inclwanted="$locincpth $inclwanted $usrinc/bsd";;
4974 for thisincl in $inclwanted; do
4975 if $test -d $thisincl; then
4976 if $test x$thisincl != x$usrinc; then
4978 *" -I$thisincl "*);;
4979 *) dflt="$dflt -I$thisincl ";;
4985 inctest='if $contains $2 $usrinc/$1 >/dev/null 2>&1; then
4987 elif $contains $2 $usrinc/sys/$1 >/dev/null 2>&1; then
4995 *) dflt="$dflt -D$2";;
4999 set signal.h LANGUAGE_C; eval $inctest
5003 ccflags="$ccflags -DSOCKS"
5008 default|recommended) dflt="$ccflags $dflt" ;;
5009 *) dflt="$ccflags";;
5018 Your C compiler may want other flags. For this question you should include
5019 -I/whatever and -DWHATEVER flags and any other flags used by the C compiler,
5020 but you should NOT include libraries or ld flags like -lwhatever. If you
5021 want $package to honor its debug switch, you should include -DDEBUGGING here.
5022 Your C compiler might also need additional flags, such as -D_POSIX_SOURCE.
5024 To use no flags, specify the word "none".
5030 rp="Any additional cc flags?"
5037 : the following weeds options from ccflags that are of no interest to cpp
5039 '') cppflags="$ccflags" ;;
5040 *) cppflags="$cppflags $ccflags" ;;
5042 case "$gccversion" in
5043 1*) cppflags="$cppflags -D__GNUC__"
5045 case "$mips_type" in
5047 *BSD*) cppflags="$cppflags -DSYSTYPE_BSD43";;
5053 echo "Let me guess what the preprocessor flags are..." >&4
5067 *) ftry="$previous $flag";;
5069 if $cppstdin -DLFRULB=bar $cppflags $ftry $cppminus <cpp.c \
5070 >cpp1.out 2>/dev/null && \
5071 $cpprun -DLFRULB=bar $cppflags $ftry $cpplast <cpp.c \
5072 >cpp2.out 2>/dev/null && \
5073 $contains 'foo.*xx.*bar' cpp1.out >/dev/null 2>&1 && \
5074 $contains 'foo.*xx.*bar' cpp2.out >/dev/null 2>&1
5076 cppflags="$cppflags $ftry"
5086 *-*) echo "They appear to be: $cppflags";;
5088 $rm -f cpp.c cpp?.out
5092 : flags used in final linking phase
5094 '') if ./venix; then
5100 *-posix*) dflt="$dflt -posix" ;;
5103 *) dflt="$ldflags";;
5106 : Try to guess additional flags to pick up local libraries.
5107 for thislibdir in $libpth; do
5108 case " $loclibpth " in
5111 *"-L$thislibdir "*) ;;
5112 *) dflt="$dflt -L$thislibdir" ;;
5124 Your C linker may need flags. For this question you should
5125 include -L/whatever and any other flags used by the C linker, but you
5126 should NOT include libraries like -lwhatever.
5128 Make sure you include the appropriate -L/path flags if your C linker
5129 does not normally search all of the directories you specified above,
5132 To use no flags, specify the word "none".
5136 rp="Any additional ld flags (NOT including libraries)?"
5142 rmlist="$rmlist pdp11"
5146 echo "Checking your choice of C compiler and flags for coherency..." >&4
5147 $cat > try.c <<'EOF'
5149 int main() { printf("Ok\n"); return(0); }
5151 set X $cc -o try $optimize $ccflags $ldflags try.c $libs
5153 $cat >try.msg <<'EOM'
5154 I've tried to compile and run the following simple program:
5157 $cat try.c >> try.msg
5159 $cat >> try.msg <<EOM
5166 and I got the following output:
5170 if $sh -c "$cc -o try $optimize $ccflags $ldflags try.c $libs" >>try.msg 2>&1; then
5171 if $sh -c "$run ./try" >>try.msg 2>&1; then
5175 *) echo 'The program compiled OK, but produced no output.' >> try.msg
5178 cat >> try.msg <<'EOQS'
5179 If $libs contains -lsfio, and sfio is mis-configured, then it
5180 sometimes (apparently) runs and exits with a 0 status, but with no
5181 output! It may have to do with sfio's use of _exit vs. exit.
5184 rp="You have a big problem. Shall I abort Configure"
5191 echo "The program compiled OK, but exited with status $?." >>try.msg
5192 rp="You have a problem. Shall I abort Configure"
5196 echo "I can't compile the test program." >>try.msg
5197 rp="You have a BIG problem. Shall I abort Configure"
5203 case "$knowitall" in
5205 echo "(The supplied flags or libraries might be incorrect.)"
5213 *) echo "Ok. Stopping Configure." >&4
5218 n) echo "OK, that should do.";;
5220 $rm -f try try.* core
5222 : define a shorthand compile call
5226 $cc -o ${mc_file} $optimize $ccflags $ldflags $* ${mc_file}.c $libs > /dev/null 2>&1;'
5227 : define a shorthand compile call for compilations that should be ok.
5231 $cc -o ${mc_file} $optimize $ccflags $ldflags $* ${mc_file}.c $libs;'
5233 : determine filename position in cpp output
5235 echo "Computing filename position in cpp output for #include directives..." >&4
5237 vos) testaccess=-e ;;
5240 echo '#include <stdio.h>' > foo.c
5243 $cppstdin $cppflags $cppminus <foo.c 2>/dev/null | \
5244 $grep '^[ ]*#.*stdio\.h' | \
5245 while read cline; do
5248 while $test \$# -gt 0; do
5249 if $test $testaccess \`echo \$1 | $tr -d '"'\`; then
5254 pos=\`expr \$pos + 1\`
5266 *) pos="${fieldn}th";;
5268 echo "Your cpp writes the filename in the $pos field of the line."
5271 vos) cppfilter="tr '\\\\>' '/' |" ;; # path component separator is >
5272 os2) cppfilter="sed -e 's|\\\\\\\\|/|g' |" ;; # path component separator is \
5275 : locate header file
5280 for usrincdir in $usrinc
5282 if test -f \$usrincdir/\$wanted; then
5283 echo "\$usrincdir/\$wanted"
5287 awkprg='{ print \$$fieldn }'
5288 echo "#include <\$wanted>" > foo\$\$.c
5289 $cppstdin $cppminus $cppflags < foo\$\$.c 2>/dev/null | \
5290 $cppfilter $grep "^[ ]*#.*\$wanted" | \
5291 while read cline; do
5292 name=\`echo \$cline | $awk "\$awkprg" | $tr -d '"'\`
5294 *[/\\\\]\$wanted) echo "\$name"; exit 1;;
5295 *[\\\\/]\$wanted) echo "\$name"; exit 1;;
5300 # status = 0: grep returned 0 lines, case statement not executed
5301 # status = 1: headerfile found
5302 # status = 2: while loop executed, no headerfile found
5306 if test \$status -eq 1; then
5313 : define an alternate in-header-list? function
5314 inhdr='echo " "; td=$define; tu=$undef; yyy=$@;
5315 cont=true; xxf="echo \"<\$1> found.\" >&4";
5316 case $# in 2) xxnf="echo \"<\$1> NOT found.\" >&4";;
5317 *) xxnf="echo \"<\$1> NOT found, ...\" >&4";;
5319 case $# in 4) instead=instead;; *) instead="at last";; esac;
5320 while $test "$cont"; do
5322 var=$2; eval "was=\$$2";
5323 if $test "$xxx" && $test -r "$xxx";
5325 eval "case \"\$$var\" in $undef) . ./whoa; esac"; eval "$var=\$td";
5328 eval "case \"\$$var\" in $define) . ./whoa; esac"; eval "$var=\$tu"; fi;
5329 set $yyy; shift; shift; yyy=$@;
5330 case $# in 0) cont="";;
5331 2) xxf="echo \"but I found <\$1> $instead.\" >&4";
5332 xxnf="echo \"and I did not find <\$1> either.\" >&4";;
5333 *) xxf="echo \"but I found <\$1\> instead.\" >&4";
5334 xxnf="echo \"there is no <\$1>, ...\" >&4";;
5338 do set $yyy; var=$2; eval "was=\$$2";
5339 eval "case \"\$$var\" in $define) . ./whoa; esac"; eval "$var=\$tu";
5340 set $yyy; shift; shift; yyy=$@;
5343 : see if stdlib is available
5344 set stdlib.h i_stdlib
5347 : check for lengths of integral types
5351 echo "Checking to see how big your integers are..." >&4
5360 printf("intsize=%d;\n", (int)sizeof(int));
5361 printf("longsize=%d;\n", (int)sizeof(long));
5362 printf("shortsize=%d;\n", (int)sizeof(short));
5367 if eval $compile_ok && $run ./try > /dev/null; then
5369 echo "Your integers are $intsize bytes long."
5370 echo "Your long integers are $longsize bytes long."
5371 echo "Your short integers are $shortsize bytes long."
5375 Help! I can't compile and run the intsize test program: please enlighten me!
5376 (This is probably a misconfiguration in your system or libraries, and
5377 you really ought to fix it. Still, I'll try anyway.)
5381 rp="What is the size of an integer (in bytes)?"
5385 rp="What is the size of a long integer (in bytes)?"
5389 rp="What is the size of a short integer (in bytes)?"
5397 : check for long long
5399 echo "Checking to see if you have long long..." >&4
5400 echo 'int main() { long long x = 7; return 0; }' > try.c
5402 if eval $compile; then
5404 echo "You have long long."
5407 echo "You do not have long long."
5413 : check for length of long long
5414 case "${d_longlong}${longlongsize}" in
5417 echo "Checking to see how big your long longs are..." >&4
5418 $cat >try.c <<'EOCP'
5422 printf("%d\n", (int)sizeof(long long));
5427 if eval $compile_ok; then
5428 longlongsize=`$run ./try`
5429 echo "Your long longs are $longlongsize bytes long."
5433 echo "(I can't seem to compile the test program. Guessing...)"
5434 rp="What is the size of a long long (in bytes)?"
5438 if $test "X$longsize" = "X$longlongsize"; then
5439 echo "(That isn't any different from an ordinary long.)"
5445 : see if inttypes.h is available
5446 : we want a real compile instead of Inhdr because some systems
5447 : have an inttypes.h which includes non-existent headers
5450 #include <inttypes.h>
5452 static int32_t foo32 = 0x12345678;
5456 if eval $compile; then
5457 echo "<inttypes.h> found." >&4
5460 echo "<inttypes.h> NOT found." >&4
5469 echo "Checking to see if you have int64_t..." >&4
5471 #include <sys/types.h>
5472 #$i_inttypes I_INTTYPES
5474 #include <inttypes.h>
5476 int main() { int64_t x = 7; }
5479 if eval $compile; then
5481 echo "You have int64_t."
5484 echo "You do not have int64_t."
5492 echo "Checking which 64-bit integer type we could use..." >&4
5498 val='"unsigned int"'
5503 *) case "$longsize" in
5507 val='"unsigned long"'
5512 *) case "$d_longlong:$longlongsize" in
5517 val='"unsigned long long"'
5522 *) case "$d_int64_t" in
5541 '') echo "Alas, no 64-bit integer types in sight." >&4
5544 *) echo "We could use '$quadtype' for 64-bit integers." >&4
5550 case "$uselonglong" in
5551 "$define"|true|[yY]*)
5554 *** Configure -Duselonglong is deprecated, using -Duse64bitint instead.
5556 use64bitint="$define"
5559 case "$use64bits" in
5560 "$define"|true|[yY]*)
5563 *** Configure -Duse64bits is deprecated, using -Duse64bitint instead.
5565 use64bitint="$define"
5568 case "$use64bitints" in
5569 "$define"|true|[yY]*)
5572 *** There is no Configure -Duse64bitints, using -Duse64bitint instead.
5574 use64bitint="$define"
5577 case "$use64bitsint" in
5578 "$define"|true|[yY]*)
5581 *** There is no Configure -Duse64bitsint, using -Duse64bitint instead.
5583 use64bitint="$define"
5586 case "$uselonglongs" in
5587 "$define"|true|[yY]*)
5590 *** There is no Configure -Duselonglongs, using -Duse64bitint instead.
5592 use64bitint="$define"
5595 case "$use64bitsall" in
5596 "$define"|true|[yY]*)
5599 *** There is no Configure -Duse64bitsall, using -Duse64bitall instead.
5601 use64bitall="$define"
5606 *-DUSE_LONG_LONG*|*-DUSE_64_BIT_INT*|*-DUSE_64_BIT_ALL*) use64bitint="$define";;
5608 case "$use64bitall" in
5609 "$define"|true|[yY]*) use64bitint="$define" ;;
5615 You have natively 64-bit long integers.
5619 *) case "$use64bitint" in
5620 "$define"|true|[yY]*) dflt='y';;
5629 Perl can be built to take advantage of 64-bit integer types
5630 on some systems. To do so, Configure can be run with -Duse64bitint.
5631 Choosing this option will most probably introduce binary incompatibilities.
5633 If this doesn't make any sense to you, just accept the default '$dflt'.
5634 (The default has been chosen based on your configuration.)
5636 rp='Try to use 64-bit integers, if available?'
5639 [yY]*) val="$define" ;;
5647 case "$use64bitall" in
5648 "$define"|true|[yY]*) dflt='y' ;;
5649 *) case "$longsize" in
5657 You may also choose to try maximal 64-bitness. It means using as much
5658 64-bitness as possible on the platform. This in turn means even more
5659 binary incompatibilities. On the other hand, your platform may not
5660 have any more 64-bitness available than what you already have chosen.
5662 If this doesn't make any sense to you, just accept the default '$dflt'.
5663 (The default has been chosen based on your configuration.)
5665 rp='Try to use maximal 64-bit support, if available?'
5668 [yY]*) val="$define" ;;
5673 case "$use64bitall" in
5675 case "$use64bitint" in
5679 Since you have chosen a maximally 64-bit build, I'm also turning on
5680 the use of 64-bit integers.
5682 use64bitint="$define" ;;
5687 : Look for a hint-file generated 'call-back-unit'. If the
5688 : user has specified that a 64-bit perl is to be built,
5689 : we may need to set or change some other defaults.
5690 if $test -f use64bitint.cbu; then
5691 echo "Your platform has some specific hints regarding 64-bit integers, using them..."
5694 case "$use64bitint" in
5695 "$define"|true|[yY]*)
5697 4) case "$archname64" in
5698 '') archname64=64int ;;
5705 : Look for a hint-file generated 'call-back-unit'. If the
5706 : user has specified that a maximally 64-bit perl is to be built,
5707 : we may need to set or change some other defaults.
5708 if $test -f use64bitall.cbu; then
5709 echo "Your platform has some specific hints regarding 64-bit builds, using them..."
5712 case "$use64bitall" in
5713 "$define"|true|[yY]*)
5715 4) case "$archname64" in
5716 ''|64int) archname64=64all ;;
5723 case "$d_quad:$use64bitint" in
5727 *** You have chosen to use 64-bit integers,
5728 *** but none can be found.
5729 *** Please rerun Configure without -Duse64bitint and/or -Dusemorebits.
5730 *** Cannot continue, aborting.
5737 : check for length of double
5739 case "$doublesize" in
5741 echo "Checking to see how big your double precision numbers are..." >&4
5750 printf("%d\n", (int)sizeof(double));
5755 if eval $compile_ok; then
5756 doublesize=`$run ./try`
5757 echo "Your double is $doublesize bytes long."
5760 echo "(I can't seem to compile the test program. Guessing...)"
5761 rp="What is the size of a double precision number (in bytes)?"
5769 : check for long doubles
5771 echo "Checking to see if you have long double..." >&4
5772 echo 'int main() { long double x = 7.0; }' > try.c
5774 if eval $compile; then
5776 echo "You have long double."
5779 echo "You do not have long double."
5785 : check for length of long double
5786 case "${d_longdbl}${longdblsize}" in
5789 echo "Checking to see how big your long doubles are..." >&4
5790 $cat >try.c <<'EOCP'
5794 printf("%d\n", sizeof(long double));
5799 if eval $compile; then
5800 longdblsize=`$run ./try`
5801 echo "Your long doubles are $longdblsize bytes long."
5805 echo "(I can't seem to compile the test program. Guessing...)" >&4
5806 rp="What is the size of a long double (in bytes)?"
5810 if $test "X$doublesize" = "X$longdblsize"; then
5811 echo "That isn't any different from an ordinary double."
5812 echo "I'll keep your setting anyway, but you may see some"
5813 echo "harmless compilation warnings."
5819 : determine the architecture name
5821 if xxx=`./loc arch blurfl $pth`; $test -f "$xxx"; then
5822 tarch=`arch`"-$osname"
5823 elif xxx=`./loc uname blurfl $pth`; $test -f "$xxx" ; then
5824 if uname -m > tmparch 2>&1 ; then
5825 tarch=`$sed -e 's/ *$//' -e 's/ /_/g' \
5826 -e 's/$/'"-$osname/" tmparch`
5834 case "$myarchname" in
5837 echo "(Your architecture name used to be $myarchname.)"
5841 case "$targetarch" in
5843 *) archname=`echo $targetarch|sed 's,^[^-]*-,,'` ;;
5848 *) dflt="$archname";;
5850 rp='What is your architecture name'
5853 case "$usethreads" in
5855 echo "Threads selected." >&4
5857 *-thread*) echo "...and architecture name already has -thread." >&4
5859 *) archname="$archname-thread"
5860 echo "...setting architecture name to $archname." >&4
5865 case "$usemultiplicity" in
5867 echo "Multiplicity selected." >&4
5869 *-multi*) echo "...and architecture name already has -multi." >&4
5871 *) archname="$archname-multi"
5872 echo "...setting architecture name to $archname." >&4
5877 case "$use64bitint$use64bitall" in
5879 case "$archname64" in
5881 echo "This architecture is naturally 64-bit, not changing architecture name." >&4
5884 case "$use64bitint" in
5885 "$define") echo "64 bit integers selected." >&4 ;;
5887 case "$use64bitall" in
5888 "$define") echo "Maximal 64 bitness selected." >&4 ;;
5891 *-$archname64*) echo "...and architecture name already has $archname64." >&4
5893 *) archname="$archname-$archname64"
5894 echo "...setting architecture name to $archname." >&4
5900 case "$uselongdouble" in
5902 echo "Long doubles selected." >&4
5903 case "$longdblsize" in
5905 echo "...but long doubles are equal to doubles, not changing architecture name." >&4
5909 *-ld*) echo "...and architecture name already has -ld." >&4
5911 *) archname="$archname-ld"
5912 echo "...setting architecture name to $archname." >&4
5919 case "$useperlio" in
5921 echo "Perlio selected." >&4
5924 echo "Perlio not selected, using stdio." >&4
5926 *-stdio*) echo "...and architecture name already has -stdio." >&4
5928 *) archname="$archname-stdio"
5929 echo "...setting architecture name to $archname." >&4
5934 if $test -f archname.cbu; then
5935 echo "Your platform has some specific hints for architecture name, using them..."
5939 : set the prefixit variable, to compute a suitable default value
5940 prefixit='case "$3" in
5942 case "$oldprefix" in
5943 "") eval "$1=\"\$$2\"";;
5950 ""|" ") eval "$1=\"\$$2\"";;
5956 eval "tp=\"$oldprefix-\$$2-\""; eval "tp=\"$tp\"";
5958 --|/*--|\~*--) eval "$1=\"$prefix/$3\"";;
5959 /*-$oldprefix/*|\~*-$oldprefix/*)
5960 eval "$1=\`echo \$$2 | sed \"s,^$oldprefix,$prefix,\"\`";;
5961 *) eval "$1=\"\$$2\"";;
5965 : get the patchlevel
5967 echo "Getting the current patchlevel..." >&4
5968 if $test -r $rsrc/patchlevel.h;then
5969 revision=`awk '/define[ ]+PERL_REVISION/ {print $3}' $rsrc/patchlevel.h`
5970 patchlevel=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
5971 subversion=`awk '/define[ ]+PERL_SUBVERSION/ {print $3}' $rsrc/patchlevel.h`
5972 api_revision=`awk '/define[ ]+PERL_API_REVISION/ {print $3}' $rsrc/patchlevel.h`
5973 api_version=`awk '/define[ ]+PERL_API_VERSION/ {print $3}' $rsrc/patchlevel.h`
5974 api_subversion=`awk '/define[ ]+PERL_API_SUBVERSION/ {print $3}' $rsrc/patchlevel.h`
5975 perl_patchlevel=`egrep 'define PERL_PATCHNUM [0-9][0-9]|,"MAINT[0-9][0-9]*"' $rsrc/patchlevel.h|sed 's/[^0-9]//g'`
5984 $echo "(You do not have patchlevel.h. Eek.)"
5986 if $test -r $rsrc/.patch ; then
5987 if $test "X$perl_patchlevel" = "X" || $test "`cat $rsrc/.patch`" -gt "$perl_patchlevel" ; then
5988 perl_patchlevel=`cat $rsrc/.patch`
5991 : Define a handy string here to avoid duplication in myconfig.SH and configpm.
5992 version_patchlevel_string="version $patchlevel subversion $subversion"
5993 case "$perl_patchlevel" in
5995 *) version_patchlevel_string="$version_patchlevel_string patch $perl_patchlevel" ;;
5998 $echo "(You have $package $version_patchlevel_string.)"
6002 : XXX Should be a Configure test for double-dots in filenames.
6003 version=`echo $revision $patchlevel $subversion | \
6004 $awk '{ printf "%d_%d_%d\n", $1, $2, $3 }'`
6005 api_versionstring=`echo $api_revision $api_version $api_subversion | \
6006 $awk '{ printf "%d_%d_%d\n", $1, $2, $3 }'`
6009 version=`echo $revision $patchlevel $subversion | \
6010 $awk '{ printf "%d.%d.%d\n", $1, $2, $3 }'`
6011 api_versionstring=`echo $api_revision $api_version $api_subversion | \
6012 $awk '{ printf "%d.%d.%d\n", $1, $2, $3 }'`
6015 : Special case the 5.005_xx maintenance series, which used 5.005
6016 : without any subversion label as a subdirectory in $sitelib
6017 if test "${api_revision}${api_version}${api_subversion}" = "550"; then
6018 api_versionstring='5.005'
6021 : determine installation style
6022 : For now, try to deduce it from prefix unless it is already set.
6023 : Reproduce behavior of 5.005 and earlier, maybe drop that in 5.7.
6024 case "$installstyle" in
6025 '') case "$prefix" in
6026 *perl*) dflt='lib';;
6027 *) dflt='lib/perl5' ;;
6030 *) dflt="$installstyle" ;;
6032 : Probably not worth prompting for this since we prompt for all
6033 : the directories individually, and the prompt would be too long and
6037 : determine where public executables go
6042 rp='Pathname where the public executables will reside?'
6044 if $test "X$ansexp" != "X$binexp"; then
6048 : XXX Bug? -- ignores Configure -Dinstallprefix setting.
6051 case "$userelocatableinc" in
6052 $define|true|[yY]*) dflt='y' ;;
6057 Would you like to build Perl so that the installation is relocatable, so that
6058 library paths in @INC are determined relative to the path of the perl binary?
6059 This is not advised for system Perl installs, or if you need to run setid
6060 scripts or scripts under taint mode.
6062 If this doesn't make any sense to you, just accept the default '$dflt'.
6064 rp='Use relocatable @INC?'
6067 y|Y) val="$define" ;;
6070 set userelocatableinc
6073 : Default prefix is now "up one level from where the binaries are"
6074 case "$userelocatableinc" in
6076 initialinstalllocation="$binexp"
6081 installprefixexp=".../.."
6085 : determine where private library files go
6086 : Usual default is /usr/local/lib/perl5/$version.
6087 : Also allow things like /opt/perl/lib/$version, since
6088 : /opt/perl/lib/perl5... would be redundant.
6089 : The default "style" setting is made in installstyle.U
6090 case "$installstyle" in
6091 *lib/perl5*) set dflt privlib lib/$package/$version ;;
6092 *) set dflt privlib lib/$version ;;
6097 There are some auxiliary files for $package that need to be put into a
6098 private library directory that is accessible by everyone.
6103 rp='Pathname where the private library files will reside?'
6108 : set the prefixup variable, to restore leading tilda escape
6109 prefixup='case "$prefixexp" in
6111 *) eval "$1=\`echo \$$1 | sed \"s,^$prefixexp,$prefix,\"\`";;
6114 : determine where public architecture dependent libraries go
6117 : privlib default is /usr/local/lib/$package/$version
6118 : archlib default is /usr/local/lib/$package/$version/$archname
6119 : privlib may have an optional trailing /share.
6120 tdflt=`echo $privlib | $sed 's,/share$,,'`
6121 tdflt=$tdflt/$archname
6130 $spackage contains architecture-dependent library files. If you are
6131 sharing libraries in a heterogeneous environment, you might store
6132 these files in a separate location. Otherwise, you can just include
6133 them with the rest of the public library files.
6138 rp='Where do you want to put the public architecture-dependent libraries?'
6142 if $test X"$archlib" = X"$privlib"; then
6148 : see if setuid scripts can be secure
6151 Some kernels have a bug that prevents setuid #! scripts from being
6152 secure. Some sites have disabled setuid #! scripts because of this.
6154 First let's decide if your kernel supports secure setuid #! scripts.
6155 (If setuid #! scripts would be secure but have been disabled anyway,
6156 don't say that they are secure if asked.)
6161 if $test -d /dev/fd; then
6162 echo "#!$ls" >reflect
6163 chmod +x,u+s reflect
6164 ./reflect >flect 2>&1
6165 if $contains "/dev/fd" flect >/dev/null; then
6166 echo "Congratulations, your kernel has secure setuid scripts!" >&4
6170 If you are not sure if they are secure, I can check but I'll need a
6171 username and password different from the one you are using right now.
6172 If you don't have such a username or don't want me to test, simply
6176 rp='Other username to test security of setuid scripts with?'
6181 case "$d_suidsafe" in
6182 '') echo "I'll assume setuid scripts are *not* secure." >&4
6185 echo "Well, the $hint value is *not* secure." >&4
6187 *) echo "Well, the $hint value *is* secure." >&4
6192 $rm -f reflect flect
6193 echo "#!$ls" >reflect
6194 chmod +x,u+s reflect
6197 echo '"su" will (probably) prompt you for '"$ans's password."
6198 su $ans -c './reflect >flect'
6199 if $contains "/dev/fd" flect >/dev/null; then
6200 echo "Okay, it looks like setuid scripts are secure." >&4
6203 echo "I don't think setuid scripts are secure." >&4
6208 rp='Does your kernel have *secure* setuid scripts?'
6211 [yY]*) val="$define";;
6216 echo "I don't think setuid scripts are secure (no /dev/fd directory)." >&4
6217 echo "(That's for file descriptors, not floppy disks.)"
6223 $rm -f reflect flect
6225 : now see if they want to do setuid emulation
6228 case "$d_suidsafe" in
6231 echo "No need to emulate SUID scripts since they are secure here." >&4
6235 Some systems have disabled setuid scripts, especially systems where
6236 setuid scripts cannot be secure. On systems where setuid scripts have
6237 been disabled, the setuid/setgid bits on scripts are currently
6238 useless. It is possible for $package to detect those bits and emulate
6239 setuid/setgid in a secure fashion. This emulation will only work if
6240 setuid scripts have been disabled in your kernel.
6244 "$define") dflt=y ;;
6247 rp="Do you want to do setuid/setgid emulation?"
6250 [yY]*) val="$define";;
6258 : Find perl5.005 or later.
6259 echo "Looking for a previously installed perl5.005 or later... "
6261 '') for tdir in `echo "$binexp$path_sep$PATH" | $sed "s/$path_sep/ /g"`; do
6262 : Check if this perl is recent and can load a simple module
6263 if $test -x $tdir/perl$exe_ext && $tdir/perl -Mless -e 'use 5.005;' >/dev/null 2>&1; then
6266 elif $test -x $tdir/perl5$exe_ext && $tdir/perl5 -Mless -e 'use 5.005;' >/dev/null 2>&1; then
6276 '') echo "None found. That's ok.";;
6277 *) echo "Using $perl5." ;;
6282 After $package is installed, you may wish to install various
6283 add-on modules and utilities. Typically, these add-ons will
6284 be installed under $prefix with the rest
6285 of this package. However, you may wish to install such add-ons
6286 elsewhere under a different prefix.
6288 If you do not wish to put everything under a single prefix, that's
6289 ok. You will be prompted for the individual locations; this siteprefix
6290 is only used to suggest the defaults.
6292 The default should be fine for most people.
6296 rp='Installation prefix to use for add-on modules and utilities?'
6297 : XXX Here might be another good place for an installstyle setting.
6298 case "$siteprefix" in
6300 *) dflt=$siteprefix ;;
6303 : XXX Prefixit unit does not yet support siteprefix and vendorprefix
6305 case "$siteprefix" in
6309 *) oldsiteprefix="$prefix";;
6314 siteprefixexp="$ansexp"
6316 : determine where site specific libraries go.
6317 : Usual default is /usr/local/lib/perl5/site_perl/$version
6318 : The default "style" setting is made in installstyle.U
6319 : XXX No longer works with Prefixit stuff.
6320 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
6322 '') case "$installstyle" in
6323 *lib/perl5*) dflt=$siteprefix/lib/$package/site_$prog/$version ;;
6324 *) dflt=$siteprefix/lib/site_$prog/$version ;;
6332 The installation process will create a directory for
6333 site-specific extensions and modules. Most users find it convenient
6334 to place all site-specific files in this directory rather than in the
6335 main distribution directory.
6339 rp='Pathname for the site-specific library files?'
6343 sitelib_stem=`echo "$sitelibexp" | sed "s,/$version$,,"`
6345 : Determine list of previous versions to include in @INC
6346 $cat > getverlist <<EOPL
6349 \$api_versionstring = "$api_versionstring";
6350 \$version = "$version";
6351 \$stem = "$sitelib_stem";
6352 \$archname = "$archname";
6354 $cat >> getverlist <<'EOPL'
6355 # Can't have leading @ because metaconfig interprets it as a command!
6356 ;@inc_version_list=();
6357 # XXX Redo to do opendir/readdir?
6360 ;@candidates = glob("5.*");
6366 # XXX ToDo: These comparisons must be reworked when two-digit
6367 # subversions come along, so that 5.7.10 compares as greater than
6368 # 5.7.3! By that time, hope that 5.6.x is sufficiently
6369 # widespread that we can use the built-in version vectors rather
6370 # than reinventing them here. For 5.6.0, however, we must
6371 # assume this script will likely be run by 5.005_0x. --AD 1/2000.
6372 foreach $d (@candidates) {
6373 if ($d lt $version) {
6374 if ($d ge $api_versionstring) {
6375 unshift(@inc_version_list, grep { -d } "$d/$archname", $d);
6377 elsif ($d ge "5.005") {
6378 unshift(@inc_version_list, grep { -d } $d);
6382 # Skip newer version. I.e. don't look in
6383 # 5.7.0 if we're installing 5.6.1.
6387 if (@inc_version_list) {
6388 print join(' ', @inc_version_list);
6391 # Blank space to preserve value for next Configure run.
6396 case "$inc_version_list" in
6397 '') if test -x "$perl5$exe_ext"; then
6398 dflt=`$perl5 getverlist`
6403 $undef) dflt='none' ;;
6404 *) eval dflt=\"$inc_version_list\" ;;
6407 ''|' ') dflt=none ;;
6414 In order to ease the process of upgrading, this version of perl
6415 can be configured to use modules built and installed with earlier
6416 versions of perl that were installed under $prefix. Specify here
6417 the list of earlier versions that this version of perl should check.
6418 If Configure detected no earlier versions of perl installed under
6419 $prefix, then the list will be empty. Answer 'none' to tell perl
6420 to not search earlier versions.
6422 The default should almost always be sensible, so if you're not sure,
6423 just accept the default.
6426 rp='List of earlier versions to include in @INC?'
6429 [Nn]one|''|' '|$undef) inc_version_list=' ' ;;
6430 *) inc_version_list="$ans" ;;
6432 case "$inc_version_list" in
6434 inc_version_list_init='0'
6435 d_inc_version_list="$undef"
6437 *) inc_version_list_init=`echo $inc_version_list |
6438 $sed -e 's/^/"/' -e 's/ /","/g' -e 's/$/",0/'`
6439 d_inc_version_list="$define"
6444 : see if this is a malloc.h system
6445 : we want a real compile instead of Inhdr because some systems have a
6446 : malloc.h that just gives a compile error saying to use stdlib.h instead
6451 int main () { return 0; }
6454 if eval $compile; then
6455 echo "<malloc.h> found." >&4
6458 echo "<malloc.h> NOT found." >&4
6465 : check for void type
6467 echo "Checking to see how well your C compiler groks the void type..." >&4
6468 case "$voidflags" in
6480 extern void moo(); /* function returning void */
6481 void (*goo)(); /* ptr to func returning void */
6483 void *hue; /* generic ptr */
6496 int main() { sub(); }
6498 if $cc $ccflags -c -DTRY=$defvoidused try.c >.out 2>&1 ; then
6499 voidflags=$defvoidused
6500 echo "Good. It appears to support void to the level $package wants.">&4
6501 if $contains warning .out >/dev/null 2>&1; then
6502 echo "However, you might get some warnings that look like this:"
6506 echo "Hmm, your compiler has some difficulty with void. Checking further..." >&4
6507 if $cc $ccflags -c -DTRY=1 try.c >/dev/null 2>&1; then
6508 echo "It supports 1..."
6509 if $cc $ccflags -c -DTRY=3 try.c >/dev/null 2>&1; then
6510 echo "It also supports 2..."
6511 if $cc $ccflags -c -DTRY=7 try.c >/dev/null 2>&1; then
6513 echo "And it supports 4 but not 8 definitely."
6515 echo "It doesn't support 4..."
6516 if $cc $ccflags -c -DTRY=11 try.c >/dev/null 2>&1; then
6518 echo "But it supports 8."
6521 echo "Neither does it support 8."
6525 echo "It does not support 2..."
6526 if $cc $ccflags -c -DTRY=13 try.c >/dev/null 2>&1; then
6528 echo "But it supports 4 and 8."
6530 if $cc $ccflags -c -DTRY=5 try.c >/dev/null 2>&1; then
6532 echo "And it supports 4 but has not heard about 8."
6534 echo "However it supports 8 but not 4."
6539 echo "There is no support at all for void."
6544 case "$voidflags" in
6547 Support flag bits are:
6548 1: basic void declarations.
6549 2: arrays of pointers to functions returning void.
6550 4: operations between pointers to and addresses of void functions.
6551 8: generic void pointers.
6554 rp="Your void support flags add up to what?"
6561 : check for length of pointer
6565 echo "Checking to see how big your pointers are..." >&4
6566 if test "$voidflags" -gt 7; then
6567 echo '#define VOID_PTR char *' > try.c
6569 echo '#define VOID_PTR void *' > try.c
6579 printf("%d\n", (int)sizeof(VOID_PTR));
6584 if eval $compile_ok; then
6585 ptrsize=`$run ./try`
6586 echo "Your pointers are $ptrsize bytes long."
6589 echo "(I can't seem to compile the test program. Guessing...)" >&4
6590 rp="What is the size of a pointer (in bytes)?"
6597 case "$use64bitall" in
6598 "$define"|true|[yY]*)
6602 *** You have chosen a maximally 64-bit build,
6603 *** but your pointers are only 4 bytes wide.
6604 *** Please rerun Configure without -Duse64bitall.
6609 *** Since you have quads, you could possibly try with -Duse64bitint.
6614 *** Cannot continue, aborting.
6625 : determine whether to use malloc wrapping
6627 case "$usemallocwrap" in
6628 [yY]*|true|$define) dflt='y' ;;
6629 [nN]*|false|$undef) dflt='n' ;;
6630 *) case "$usedevel" in
6631 [yY]*|true|$define) dflt='y' ;;
6636 rp="Do you wish to wrap malloc calls to protect against potential overflows?"
6638 usemallocwrap="$ans"
6641 usemallocwrap="$define" ;;
6643 usemallocwrap="$undef" ;;
6646 : determine which malloc to compile in
6648 case "$usemymalloc" in
6649 [yY]*|true|$define) dflt='y' ;;
6650 [nN]*|false|$undef) dflt='n' ;;
6651 *) case "$ptrsize" in
6657 rp="Do you wish to attempt to use the malloc that comes with $package?"
6663 mallocsrc='malloc.c'
6664 mallocobj="malloc$_o"
6665 d_mymalloc="$define"
6668 : Remove malloc from list of libraries to use
6669 echo "Removing unneeded -lmalloc from library list" >&4
6670 set `echo X $libs | $sed -e 's/-lmalloc / /' -e 's/-lmalloc$//'`
6673 echo "libs = $libs" >&4
6685 : compute the return types of malloc and free
6687 $cat >malloc.c <<END
6691 #include <sys/types.h>
6705 case "$malloctype" in
6707 if $cc $ccflags -c -DTRY_MALLOC malloc.c >/dev/null 2>&1; then
6714 echo "Your system wants malloc to return '$malloctype', it would seem." >&4
6718 if $cc $ccflags -c -DTRY_FREE malloc.c >/dev/null 2>&1; then
6725 echo "Your system uses $freetype free(), it would seem." >&4
6727 : determine where site specific architecture-dependent libraries go.
6728 : sitelib default is /usr/local/lib/perl5/site_perl/$version
6729 : sitearch default is /usr/local/lib/perl5/site_perl/$version/$archname
6730 : sitelib may have an optional trailing /share.
6732 '') dflt=`echo $sitelib | $sed 's,/share$,,'`
6733 dflt="$dflt/$archname"
6738 set sitearch sitearch none
6742 The installation process will also create a directory for
6743 architecture-dependent site-specific extensions and modules.
6747 rp='Pathname for the site-specific architecture-dependent library files?'
6751 if $test X"$sitearch" = X"$sitelib"; then
6754 d_sitearch="$define"
6759 The installation process will also create a directory for
6760 vendor-supplied add-ons. Vendors who supply perl with their system
6761 may find it convenient to place all vendor-supplied files in this
6762 directory rather than in the main distribution directory. This will
6763 ease upgrades between binary-compatible maintenance versions of perl.
6765 Of course you may also use these directories in whatever way you see
6766 fit. For example, you might use them to access modules shared over a
6767 company-wide network.
6769 The default answer should be fine for most people.
6770 This causes further questions about vendor add-ons to be skipped
6771 and no vendor-specific directories will be configured for perl.
6774 rp='Do you want to configure vendor-specific add-on directories?'
6775 case "$usevendorprefix" in
6776 define|true|[yY]*) dflt=y ;;
6777 *) : User may have set vendorprefix directly on Configure command line.
6778 case "$vendorprefix" in
6787 rp='Installation prefix to use for vendor-supplied add-ons?'
6788 case "$vendorprefix" in
6790 *) dflt=$vendorprefix ;;
6793 : XXX Prefixit unit does not yet support siteprefix and vendorprefix
6795 case "$vendorprefix" in
6799 *) oldvendorprefix="$prefix";;
6803 usevendorprefix="$define"
6805 vendorprefixexp="$ansexp"
6807 *) usevendorprefix="$undef"
6813 case "$vendorprefix" in
6814 '') d_vendorlib="$undef"
6818 *) d_vendorlib="$define"
6819 : determine where vendor-supplied modules go.
6820 : Usual default is /usr/local/lib/perl5/vendor_perl/$version
6821 case "$vendorlib" in
6823 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
6824 case "$installstyle" in
6825 *lib/perl5*) dflt=$vendorprefix/lib/$package/vendor_$prog/$version ;;
6826 *) dflt=$vendorprefix/lib/vendor_$prog/$version ;;
6829 *) dflt="$vendorlib"
6833 rp='Pathname for the vendor-supplied library files?'
6836 vendorlibexp="$ansexp"
6839 vendorlib_stem=`echo "$vendorlibexp" | sed "s,/$version$,,"`
6843 case "$vendorprefix" in
6844 '') d_vendorarch="$undef"
6848 *) d_vendorarch="$define"
6849 : determine where vendor-supplied architecture-dependent libraries go.
6850 : vendorlib default is /usr/local/lib/perl5/vendor_perl/$version
6851 : vendorarch default is /usr/local/lib/perl5/vendor_perl/$version/$archname
6852 : vendorlib may have an optional trailing /share.
6853 case "$vendorarch" in
6854 '') dflt=`echo $vendorlib | $sed 's,/share$,,'`
6855 dflt="$dflt/$archname"
6857 *) dflt="$vendorarch" ;;
6860 rp='Pathname for vendor-supplied architecture-dependent files?'
6863 vendorarchexp="$ansexp"
6866 prefixvar=vendorarch
6869 : Final catch-all directories to search
6872 Lastly, you can have perl look in other directories for extensions and
6873 modules in addition to those already specified.
6874 These directories will be searched after
6878 test X"$vendorlib" != "X" && echo ' ' $vendorlib
6879 test X"$vendorarch" != "X" && echo ' ' $vendorarch
6881 case "$otherlibdirs" in
6882 ''|' ') dflt='none' ;;
6883 *) dflt="$otherlibdirs" ;;
6886 Enter a colon-separated set of extra paths to include in perl's @INC
6887 search path, or enter 'none' for no extra paths.
6891 rp='Colon-separated list of additional directories for perl to search?'
6894 ' '|''|none) otherlibdirs=' ' ;;
6895 *) otherlibdirs="$ans" ;;
6897 case "$otherlibdirs" in
6901 set d_perl_otherlibdirs
6904 : Cruising for prototypes
6906 echo "Checking out function prototypes..." >&4
6907 $cat >prototype.c <<EOCP
6912 int main(int argc, char *argv[]) {
6915 if $cc $ccflags -c prototype.c >prototype.out 2>&1 ; then
6916 echo "Your C compiler appears to support function prototypes."
6919 echo "Your C compiler doesn't seem to understand function prototypes."
6926 case "$prototype" in
6928 *) ansi2knr='ansi2knr'
6933 This version of $package can only be compiled by a compiler that
6934 understands function prototypes. Unfortunately, your C compiler
6936 doesn't seem to understand them. Sorry about that.
6938 If GNU cc is available for your system, perhaps you could try that instead.
6940 Eventually, we hope to support building Perl with pre-ANSI compilers.
6941 If you would like to help in that effort, please contact <perlbug@perl.org>.
6943 Aborting Configure now.
6955 Perl can be built with extra modules or bundles of modules which
6956 will be fetched from the CPAN and installed alongside Perl.
6958 Notice that you will need access to the CPAN; either via the Internet,
6959 or a local copy, for example a CD-ROM or a local CPAN mirror. (You will
6960 be asked later to configure the CPAN.pm module which will in turn do
6961 the installation of the rest of the extra modules or bundles.)
6963 Notice also that if the modules require any external software such as
6964 libraries and headers (the libz library and the zlib.h header for the
6965 Compress::Zlib module, for example) you MUST have any such software
6966 already installed, this configuration process will NOT install such
6969 If this doesn't make any sense to you, just accept the default '$dflt'.
6971 rp='Install any extra modules (y or n)?'
6977 Please list any extra modules or bundles to be installed from CPAN,
6978 with spaces between the names. The names can be in any format the
6979 'install' command of CPAN.pm will understand. (Answer 'none',
6980 without the quotes, to install no extra modules or bundles.)
6990 $rm -f ../extras.lst
6992 *) echo "(Saving the list of extras for later...)"
6993 echo "$extras" > ../extras.lst
7001 : determine where html pages for programs go
7002 set html1dir html1dir none
7006 If you wish to install html files for programs in $spackage, indicate
7007 the appropriate directory here. To skip installing html files,
7011 ''|none|$undef|' ') dflt=none ;;
7012 *) dflt=$html1dir ;;
7015 rp="Directory for the main $spackage html pages?"
7019 : Use ' ' for none so value is preserved next time through Configure
7020 $test X"$html1dir" = "X" && html1dir=' '
7022 : determine where html pages for libraries and modules go
7023 set html3dir html3dir none
7027 If you wish to install html files for modules associated with $spackage,
7028 indicate the appropriate directory here. To skip installing html files,
7031 : There is no obvious default. If they have specified html1dir, then
7032 : try to key off that, possibly changing .../html1 into .../html3.
7034 '') html3dir=`echo "$html1dir" | $sed 's/1$/3$/'` ;;
7035 *) dflt=$html3dir ;;
7038 rp="Directory for the $spackage module html pages?"
7042 : Use ' ' for none so value is preserved next time through Configure
7043 $test X"$html3dir" = "X" && html3dir=' '
7045 : determine whether to install perl also as /usr/bin/perl
7048 if $test -d /usr/bin -a "X$installbin" != X/usr/bin; then
7050 Many scripts expect perl to be installed as /usr/bin/perl.
7052 If you want to, I can install the perl you are about to compile
7053 as /usr/bin/perl (in addition to $bin/perl).
7055 if test -f /usr/bin/perl; then
7058 However, please note that because you already have a /usr/bin/perl,
7059 overwriting that with a new Perl would very probably cause problems.
7060 Therefore I'm assuming you don't want to do that (unless you insist).
7063 case "$installusrbinperl" in
7064 "$define"|[yY]*) dflt='y';;
7070 Since you don't have a /usr/bin/perl I'm assuming creating one is okay.
7073 case "$installusrbinperl" in
7074 "$undef"|[nN]*) dflt='n';;
7078 rp="Do you want to install perl as /usr/bin/perl?"
7081 [yY]*) val="$define";;
7087 set installusrbinperl
7091 echo "Checking for GNU C Library..." >&4
7093 /* Find out version of GNU C library. __GLIBC__ and __GLIBC_MINOR__
7094 alone are insufficient to distinguish different versions, such as
7095 2.0.6 and 2.0.7. The function gnu_get_libc_version() appeared in
7096 libc version 2.1.0. A. Dougherty, June 3, 2002.
7102 # ifdef __GLIBC_MINOR__
7103 # if __GLIBC__ >= 2 && __GLIBC_MINOR__ >= 1
7104 # include <gnu/libc-version.h>
7105 printf("%s\n", gnu_get_libc_version());
7107 printf("%d.%d\n", __GLIBC__, __GLIBC_MINOR__);
7110 printf("%d\n", __GLIBC__);
7119 if eval $compile_ok && $run ./try > glibc.ver; then
7121 gnulibc_version=`$cat glibc.ver`
7122 echo "You are using the GNU C Library version $gnulibc_version"
7126 echo "You are not using the GNU C Library"
7128 $rm -f try try.* glibc.ver
7132 : see if nm is to be used to determine whether a symbol is defined or not
7136 case "$d_gnulibc" in
7139 echo "nm probably won't work on the GNU C Library." >&4
7145 if $test "$osname" = aix -a "X$PASE" != "Xdefine" -a ! -f /lib/syscalls.exp; then
7147 echo "Whoops! This is an AIX system without /lib/syscalls.exp!" >&4
7148 echo "'nm' won't be sufficient on this sytem." >&4
7154 '') dflt=`$egrep 'inlibc|csym' $rsrc/Configure | wc -l 2>/dev/null`
7155 if $test $dflt -gt 20; then
7165 true|$define) dflt=y;;
7172 I can use $nm to extract the symbols from your C libraries. This
7173 is a time consuming task which may generate huge output on the disk (up
7174 to 3 megabytes) but that should make the symbols extraction faster. The
7175 alternative is to skip the 'nm' extraction part and to compile a small
7176 test program instead to determine whether each symbol is present. If
7177 you have a fast C compiler and/or if your 'nm' output cannot be parsed,
7178 this may be the best solution.
7180 You probably shouldn't let me use 'nm' if you are using the GNU C Library.
7183 rp="Shall I use $nm to extract C symbols from the libraries?"
7186 [Nn]*) usenm=false;;
7195 : nm options which may be necessary
7197 '') if $test -f /mach_boot; then
7199 elif $test -d /usr/ccs/lib; then
7200 nm_opt='-p' # Solaris (and SunOS?)
7201 elif $test -f /dgux; then
7203 elif $test -f /lib64/rld; then
7204 nm_opt='-p' # 64-bit Irix
7210 : nm options which may be necessary for shared libraries but illegal
7211 : for archive libraries. Thank you, Linux.
7212 case "$nm_so_opt" in
7213 '') case "$myuname" in
7215 if $nm --help | $grep 'dynamic' > /dev/null 2>&1; then
7216 nm_so_opt='--dynamic'
7225 : get list of predefined functions in a handy place
7230 *-lc_s*) libc=`./loc libc_s$_a $libc $libpth`
7236 *) for thislib in $libs; do
7239 : Handle C library specially below.
7242 thislib=`echo $thislib | $sed -e 's/^-l//'`
7243 if try=`./loc lib$thislib.$so.'*' X $libpth`; $test -f "$try"; then
7245 elif try=`./loc lib$thislib.$so X $libpth`; $test -f "$try"; then
7247 elif try=`./loc lib$thislib$_a X $libpth`; $test -f "$try"; then
7249 elif try=`./loc $thislib$_a X $libpth`; $test -f "$try"; then
7251 elif try=`./loc lib$thislib X $libpth`; $test -f "$try"; then
7253 elif try=`./loc $thislib X $libpth`; $test -f "$try"; then
7255 elif try=`./loc Slib$thislib$_a X $xlibpth`; $test -f "$try"; then
7260 libnames="$libnames $try"
7262 *) libnames="$libnames $thislib" ;;
7271 for xxx in $libpth; do
7272 $test -r $1 || set $xxx/libc.$so
7273 : The messy sed command sorts on library version numbers.
7275 set `echo blurfl; echo $xxx/libc.$so.[0-9]* | \
7276 tr ' ' $trnl | egrep -v '\.[A-Za-z]*$' | $sed -e '
7278 s/[0-9][0-9]*/0000&/g
7279 s/0*\([0-9][0-9][0-9][0-9][0-9]\)/\1/g
7282 $sort | $sed -e 's/^.* //'`
7285 $test -r $1 || set /usr/ccs/lib/libc.$so
7286 $test -r $1 || set /lib/libsys_s$_a
7292 if $test -r "$1"; then
7293 echo "Your (shared) C library seems to be in $1."
7295 elif $test -r /lib/libc && $test -r /lib/clib; then
7296 echo "Your C library seems to be in both /lib/clib and /lib/libc."
7298 libc='/lib/clib /lib/libc'
7299 if $test -r /lib/syslib; then
7300 echo "(Your math library is in /lib/syslib.)"
7301 libc="$libc /lib/syslib"
7303 elif $test -r "$libc" || (test -h "$libc") >/dev/null 2>&1; then
7304 echo "Your C library seems to be in $libc, as you said before."
7305 elif $test -r $incpath/usr/lib/libc$_a; then
7306 libc=$incpath/usr/lib/libc$_a;
7307 echo "Your C library seems to be in $libc. That's fine."
7308 elif $test -r /lib/libc$_a; then
7310 echo "Your C library seems to be in $libc. You're normal."
7312 if tans=`./loc libc$_a blurfl/dyick $libpth`; $test -r "$tans"; then
7314 elif tans=`./loc libc blurfl/dyick $libpth`; $test -r "$tans"; then
7315 libnames="$libnames "`./loc clib blurfl/dyick $libpth`
7316 elif tans=`./loc clib blurfl/dyick $libpth`; $test -r "$tans"; then
7318 elif tans=`./loc Slibc$_a blurfl/dyick $xlibpth`; $test -r "$tans"; then
7320 elif tans=`./loc Mlibc$_a blurfl/dyick $xlibpth`; $test -r "$tans"; then
7323 tans=`./loc Llibc$_a blurfl/dyick $xlibpth`
7325 if $test -r "$tans"; then
7326 echo "Your C library seems to be in $tans, of all places."
7332 if $test $xxx = apollo -o -r "$libc" || (test -h "$libc") >/dev/null 2>&1; then
7336 If the guess above is wrong (which it might be if you're using a strange
7337 compiler, or your machine supports multiple models), you can override it here.
7342 echo $libpth | $tr ' ' $trnl | $sort | $uniq > libpath
7344 I can't seem to find your C library. I've looked in the following places:
7347 $sed 's/^/ /' libpath
7350 None of these seems to contain your C library. I need to get its name...
7355 rp='Where is your C library?'
7360 echo $libc $libnames | $tr ' ' $trnl | $sort | $uniq > libnames
7361 set X `cat libnames`
7364 case $# in 1) xxx=file; esac
7365 echo "Extracting names from the following $xxx for later perusal:" >&4
7367 $sed 's/^/ /' libnames >&4
7369 $echo $n "This may take a while...$c" >&4
7373 *$so*) $nm $nm_so_opt $nm_opt $file 2>/dev/null;;
7374 *) $nm $nm_opt $file 2>/dev/null;;
7379 $grep fprintf libc.tmp > libc.ptf
7380 xscan='eval "<libc.ptf $com >libc.list"; $echo $n ".$c" >&4'
7381 xrun='eval "<libc.tmp $com >libc.list"; echo "done." >&4'
7383 if com="$sed -n -e 's/__IO//' -e 's/^.* $xxx *//p'";\
7385 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7387 elif com="$sed -n -e 's/^__*//' -e 's/^\([a-zA-Z_0-9$]*\).*xtern.*/\1/p'";\
7389 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7391 elif com="$sed -n -e '/|UNDEF/d' -e '/FUNC..GL/s/^.*|__*//p'";\
7393 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7395 elif com="$sed -n -e 's/^.* D __*//p' -e 's/^.* D //p'";\
7397 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7399 elif com="$sed -n -e 's/^_//' -e 's/^\([a-zA-Z_0-9]*\).*xtern.*text.*/\1/p'";\
7401 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7403 elif com="$sed -n -e 's/^.*|FUNC |GLOB .*|//p'";\
7405 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7407 elif com="$grep '|' | $sed -n -e '/|COMMON/d' -e '/|DATA/d' \
7408 -e '/ file/d' -e 's/^\([^ ]*\).*/\1/p'";\
7410 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7412 elif com="$sed -n -e 's/^.*|FUNC |GLOB .*|//p' -e 's/^.*|FUNC |WEAK .*|//p'";\
7414 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7416 elif com="$sed -n -e 's/^__//' -e '/|Undef/d' -e '/|Proc/s/ .*//p'";\
7418 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7420 elif com="$sed -n -e 's/^.*|Proc .*|Text *| *//p'";\
7422 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7424 elif com="$sed -n -e '/Def. Text/s/.* \([^ ]*\)\$/\1/p'";\
7426 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7428 elif com="$sed -n -e 's/^[-0-9a-f ]*_\(.*\)=.*/\1/p'";\
7430 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7432 elif com="$sed -n -e 's/.*\.text n\ \ \ \.//p'";\
7434 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7436 elif com="sed -n -e 's/^__.*//' -e 's/[ ]*D[ ]*[0-9]*.*//p'";\
7438 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7441 $nm -p $* 2>/dev/null >libc.tmp
7442 $grep fprintf libc.tmp > libc.ptf
7443 if com="$sed -n -e 's/^.* [ADTSIW] *_[_.]*//p' -e 's/^.* [ADTSIW] //p'";\
7444 eval $xscan; $contains '^fprintf$' libc.list >/dev/null 2>&1
7450 echo "$nm didn't seem to work right. Trying $ar instead..." >&4
7452 if $ar t $libc > libc.tmp && $contains '^fprintf$' libc.tmp >/dev/null 2>&1; then
7453 for thisname in $libnames $libc; do
7454 $ar t $thisname >>libc.tmp
7456 $sed -e "s/\\$_o\$//" < libc.tmp > libc.list
7458 elif test "X$osname" = "Xos2" && $ar tv $libc > libc.tmp; then
7459 # Repeat libc to extract forwarders to DLL entries too
7460 for thisname in $libnames $libc; do
7461 $ar tv $thisname >>libc.tmp
7462 # Revision 50 of EMX has bug in $ar.
7463 # it will not extract forwarders to DLL entries
7464 # Use emximp which will extract exactly them.
7465 emximp -o tmp.imp $thisname \
7467 $sed -e 's/^\([_a-zA-Z0-9]*\) .*$/\1/p' \
7468 < tmp.imp >>libc.tmp
7471 $sed -e "s/\\$_o\$//" -e 's/^ \+//' < libc.tmp > libc.list
7474 echo "$ar didn't seem to work right." >&4
7475 echo "Maybe this is a Cray...trying bld instead..." >&4
7476 if bld t $libc | $sed -e 's/.*\///' -e "s/\\$_o:.*\$//" > libc.list
7478 for thisname in $libnames; do
7480 $sed -e 's/.*\///' -e "s/\\$_o:.*\$//" >>libc.list
7481 $ar t $thisname >>libc.tmp
7485 echo "That didn't work either. Giving up." >&4
7495 echo "Since you are compiling for PASE, extracting more symbols from libc.a ...">&4
7496 dump -Tv /lib/libc.a | awk '$7 == "/unix" {print $5 " " $8}' | grep "^SV" | awk '{print $2}' >> libc.list
7498 *) if $test -f /lib/syscalls.exp; then
7500 echo "Also extracting names from /lib/syscalls.exp for good ole AIX..." >&4
7501 $sed -n 's/^\([^ ]*\)[ ]*syscall[0-9]*[ ]*$/\1/p' /lib/syscalls.exp >>libc.list
7507 $rm -f libnames libpath
7509 : see if dld is available
7513 : is a C symbol defined?
7516 -v) tf=libc.tmp; tdc="";;
7517 -a) tf=libc.tmp; tdc="[]";;
7518 *) tlook="^$1\$"; tf=libc.list; tdc="()";;
7521 case "$reuseval-$4" in
7523 true-*) tx=no; eval "tval=\$$4"; case "$tval" in "") tx=yes;; esac;;
7528 if $test "$runnm" = true; then
7529 if $contains $tlook $tf >/dev/null 2>&1; then
7531 elif $test "$mistrustnm" = compile -o "$mistrustnm" = run; then
7532 echo "void *(*(p()))$tdc { extern void *$1$tdc; return &$1; } int main() { if(p()) return(0); else return(1); }"> try.c;
7533 $cc -o try $optimize $ccflags $ldflags try.c >/dev/null 2>&1 $libs && tval=true;
7534 $test "$mistrustnm" = run -a -x try && { $run ./try$_exe >/dev/null 2>&1 || tval=false; };
7535 $rm -f try$_exe try.c core core.* try.core;
7538 echo "void *(*(p()))$tdc { extern void *$1$tdc; return &$1; } int main() { if(p()) return(0); else return(1); }"> try.c;
7539 $cc -o try $optimize $ccflags $ldflags try.c $libs >/dev/null 2>&1 && tval=true;
7540 $rm -f try$_exe try.c;
7545 $define) tval=true;;
7552 : define an is-in-libc? function
7553 inlibc='echo " "; td=$define; tu=$undef;
7554 sym=$1; var=$2; eval "was=\$$2";
7556 case "$reuseval$was" in
7566 echo "$sym() found." >&4;
7567 case "$was" in $undef) . ./whoa; esac; eval "$var=\$td";;
7569 echo "$sym() NOT found." >&4;
7570 case "$was" in $define) . ./whoa; esac; eval "$var=\$tu";;
7574 $define) echo "$sym() found." >&4;;
7575 *) echo "$sym() NOT found." >&4;;
7579 : see if dlopen exists
7586 : determine which dynamic loading, if any, to compile in
7588 dldir="ext/DynaLoader"
7601 $define) dflt='y' ;;
7604 $define) dflt='y' ;;
7606 : Does a dl_xxx.xs file exist for this operating system
7607 $test -f $rsrc/$dldir/dl_${osname}.xs && dflt='y'
7610 rp="Do you wish to use dynamic loading?"
7617 if $test -f $rsrc/$dldir/dl_${osname}.xs ; then
7618 dflt="$dldir/dl_${osname}.xs"
7619 elif $test "$d_dlopen" = "$define" ; then
7620 dflt="$dldir/dl_dlopen.xs"
7621 elif $test "$i_dld" = "$define" ; then
7622 dflt="$dldir/dl_dld.xs"
7627 *) dflt="$dldir/$dlsrc"
7630 echo "The following dynamic loading files are available:"
7631 : Can not go over to $dldir because getfile has path hard-coded in.
7632 tdir=`pwd`; cd "$rsrc"; $ls -C $dldir/dl*.xs; cd "$tdir"
7633 rp="Source file to use for dynamic loading"
7639 dlsrc=`echo $ans | $sed -e 's%.*/\([^/]*\)$%\1%'`
7643 Some systems may require passing special flags to $cc -c to
7644 compile modules that will be used to create a shared library.
7645 To use no flags, say "none".
7648 case "$cccdlflags" in
7649 '') case "$gccversion" in
7650 '') case "$osname" in
7652 next) dflt='none' ;;
7653 irix*) dflt='-KPIC' ;;
7654 svr4*|esix*|solaris|nonstopux) dflt='-KPIC' ;;
7655 sunos) dflt='-pic' ;;
7659 *) case "$osname" in
7660 darwin) dflt='none' ;;
7661 svr4*|esix*|solaris|nonstopux) dflt='-fPIC' ;;
7666 *) dflt="$cccdlflags" ;;
7668 rp="Any special flags to pass to $cc -c to compile shared library modules?"
7671 none) cccdlflags=' ' ;;
7672 *) cccdlflags="$ans" ;;
7677 Some systems use ld to create libraries that can be dynamically loaded,
7678 while other systems (such as those using ELF) use $cc.
7682 '') $cat >try.c <<EOM
7683 /* Test for whether ELF binaries are produced */
7691 int i = open("a.out",O_RDONLY);
7694 if(read(i,b,4)==4 && b[0]==127 && b[1]=='E' && b[2]=='L' && b[3]=='F')
7695 exit(0); /* succeed (yes, it's ELF) */
7700 if $cc $ccflags $ldflags try.c >/dev/null 2>&1 && $run ./a.out; then
7702 You appear to have ELF support. I'll use $cc to build dynamic libraries.
7706 echo "I'll use ld to build dynamic libraries."
7715 rp="What command should be used to create dynamic libraries?"
7721 Some systems may require passing special flags to $ld to create a
7722 library that can be dynamically loaded. If your ld flags include
7723 -L/other/path options to locate libraries outside your loader's normal
7724 search path, you may need to specify those -L options here as well. To
7725 use no flags, say "none".
7728 case "$lddlflags" in
7729 '') case "$osname" in
7730 beos) dflt='-nostart' ;;
7732 case "$gccversion" in
7733 '') dflt="$dflt +vnocompatwarnings" ;;
7736 linux|irix*|gnu*) dflt='-shared' ;;
7737 next) dflt='none' ;;
7738 solaris) dflt='-G' ;;
7739 sunos) dflt='-assert nodefinitions' ;;
7740 svr4*|esix*|nonstopux) dflt="-G $ldflags" ;;
7744 *) dflt="$lddlflags" ;;
7747 : Try to guess additional flags to pick up local libraries.
7748 : Be careful not to append to a plain 'none'
7752 for thisflag in $ldflags; do
7757 *) dflt="$dflt $thisflag" ;;
7764 ''|' ') dflt='none' ;;
7767 rp="Any special flags to pass to $ld to create a dynamically loaded library?"
7770 none) lddlflags=' ' ;;
7771 *) lddlflags="$ans" ;;
7776 Some systems may require passing special flags to $cc to indicate that
7777 the resulting executable will use dynamic linking. To use no flags,
7781 case "$ccdlflags" in
7782 '') case "$osname" in
7783 linux|hpux|gnu*) dflt='-Wl,-E' ;;
7784 next|sunos) dflt='none' ;;
7788 *) dflt="$ccdlflags" ;;
7790 rp="Any special flags to pass to $cc to use dynamic linking?"
7793 none) ccdlflags=' ' ;;
7794 *) ccdlflags="$ans" ;;
7808 # No dynamic loading being used, so don't bother even to prompt.
7811 *) case "$useshrplib" in
7812 '') case "$osname" in
7813 svr4*|nonstopux|dgux|dynixptx|esix|powerux|beos|cygwin*)
7815 also='Building a shared libperl is required for dynamic loading to work on your system.'
7820 also='Building a shared libperl is needed for MAB support.'
7838 The perl executable is normally obtained by linking perlmain.c with
7839 libperl${_a}, any static extensions (usually just DynaLoader), and
7840 any other libraries needed on this system (such as -lm, etc.). Since
7841 your system supports dynamic loading, it is probably possible to build
7842 a shared libperl.$so. If you will have more than one executable linked
7843 to libperl.$so, this will significantly reduce the size of each
7844 executable, but it may have a noticeable effect on performance. The
7845 default is probably sensible for your system.
7849 rp="Build a shared libperl.$so (y/n)"
7853 useshrplib='true' ;;
7854 *) useshrplib='false' ;;
7859 case "$useshrplib" in
7863 # Figure out a good name for libperl.so. Since it gets stored in
7864 # a version-specific architecture-dependent library, the version
7865 # number isn't really that important, except for making cc/ld happy.
7867 # A name such as libperl.so.3.1
7868 majmin="libperl.$so.$patchlevel.$subversion"
7869 # A name such as libperl.so.301
7870 majonly=`echo $patchlevel $subversion |
7871 $awk '{printf "%d%02d", $1, $2}'`
7872 majonly=libperl.$so.$majonly
7873 # I'd prefer to keep the os-specific stuff here to a minimum, and
7874 # rely on figuring it out from the naming of libc.
7875 case "${osname}${osvers}" in
7878 # XXX How handle the --version stuff for MAB?
7880 linux*|gnu*) # ld won't link with a bare -lperl otherwise.
7883 cygwin*) # ld links against an importlib
7884 dflt=libperl$lib_ext
7886 *) # Try to guess based on whether libc has major.minor.
7888 *libc.$so.[0-9]*.[0-9]*) dflt=$majmin ;;
7889 *libc.$so.[0-9]*) dflt=$majonly ;;
7890 *) dflt=libperl.$so ;;
7900 I need to select a good name for the shared libperl. If your system uses
7901 library names with major and minor numbers, then you might want something
7902 like $majmin. Alternatively, if your system uses a single version
7903 number for shared libraries, then you might want to use $majonly.
7904 Or, your system might be quite happy with a simple libperl.$so.
7906 Since the shared libperl will get installed into a version-specific
7907 architecture-dependent directory, the version number of the shared perl
7908 library probably isn't important, so the default should be o.k.
7911 rp='What name do you want to give to the shared libperl?'
7914 echo "Ok, I'll use $libperl"
7917 libperl="libperl${_a}"
7921 # Detect old use of shrpdir via undocumented Configure -Dshrpdir
7925 WARNING: Use of the shrpdir variable for the installation location of
7926 the shared $libperl is not supported. It was never documented and
7927 will not work in this version. Let me (perlbug@perl.org)
7928 know of any problems this may cause.
7934 But your current setting of $shrpdir is
7935 the default anyway, so it's harmless.
7940 Further, your current attempted setting of $shrpdir
7941 conflicts with the value of $archlibexp/CORE
7942 that installperl will use.
7949 # How will the perl executable find the installed shared $libperl?
7950 # Add $xxx to ccdlflags.
7951 # If we can't figure out a command-line option, use $shrpenv to
7952 # set env LD_RUN_PATH. The main perl makefile uses this.
7953 shrpdir=$archlibexp/CORE
7956 if "$useshrplib"; then
7959 # We'll set it in Makefile.SH...
7964 freebsd|netbsd|openbsd|interix|dragonfly)
7965 xxx="-Wl,-R$shrpdir"
7967 bsdos|linux|irix*|dec_osf|gnu*)
7968 xxx="-Wl,-rpath,$shrpdir"
7971 # next doesn't like the default...
7974 # beos doesn't like the default, either.
7977 # hpux doesn't like the default, either.
7978 tmp_shrpenv="env LDOPTS=\"+s +b${shrpdir}\""
7981 tmp_shrpenv="env LD_RUN_PATH=$shrpdir"
7987 # Only add $xxx if it isn't already in ccdlflags.
7988 case " $ccdlflags " in
7990 *) ccdlflags="$ccdlflags $xxx"
7993 Adding $xxx to the flags
7994 passed to $ld so that the perl executable will find the
7995 installed shared $libperl.
8003 # Fix ccdlflags in AIX for building external extensions.
8004 # (For building Perl itself bare -bE:perl.exp is needed,
8005 # Makefile.SH takes care of this.)
8007 aix) ccdlflags="$ccdlflags -bE:$installarchlib/CORE/perl.exp" ;;
8009 # Respect a hint or command-line value.
8011 '') shrpenv="$tmp_shrpenv" ;;
8013 case "$ldlibpthname" in
8014 '') ldlibpthname=LD_LIBRARY_PATH ;;
8015 none) ldlibpthname='' ;;
8018 : determine where manual pages are on this system
8022 syspath='/usr/share/man/man1 /usr/man/man1'
8023 syspath="$syspath /usr/man/mann /usr/man/manl /usr/man/local/man1"
8024 syspath="$syspath /usr/man/u_man/man1"
8025 syspath="$syspath /usr/catman/u_man/man1 /usr/man/l_man/man1"
8026 syspath="$syspath /usr/local/man/u_man/man1 /usr/local/man/l_man/man1"
8027 syspath="$syspath /usr/man/man.L /local/man/man1 /usr/local/man/man1"
8028 sysman=`./loc . /usr/man/man1 $syspath`
8031 if $test -d "$sysman"; then
8032 echo "System manual is in $sysman." >&4
8034 echo "Could not find manual pages in source form." >&4
8037 : determine where manual pages go
8038 set man1dir man1dir none
8042 $spackage has manual pages available in source form.
8046 echo "However, you don't have nroff, so they're probably useless to you."
8048 '') man1dir="none";;
8051 echo "If you don't want the manual sources installed, answer 'none'."
8056 lookpath="$prefixexp/share/man/man1"
8057 lookpath="$lookpath $prefixexp/man/man1 $prefixexp/man/l_man/man1"
8058 lookpath="$lookpath $prefixexp/man/p_man/man1"
8059 lookpath="$lookpath $prefixexp/man/u_man/man1"
8060 lookpath="$lookpath $prefixexp/man/man.1"
8062 */?_man*) dflt=`./loc . $prefixexp/l_man/man1 $lookpath` ;;
8063 *) dflt=`./loc . $prefixexp/man/man1 $lookpath` ;;
8073 rp="Where do the main $spackage manual pages (source) go?"
8075 if $test "X$man1direxp" != "X$ansexp"; then
8086 : What suffix to use on installed man pages
8093 rp="What suffix should be used for the main $spackage man pages?"
8095 '') case "$man1dir" in
8109 *) dflt="$man1ext";;
8116 : see if we can have long filenames
8118 first=123456789abcdef
8120 if (echo hi >$first) 2>/dev/null; then
8121 if $test -f 123456789abcde; then
8122 echo 'You cannot have filenames longer than 14 characters. Sigh.' >&4
8125 echo 'You can have filenames longer than 14 characters.'>&4
8130 You can't have filenames longer than 14 chars.
8131 You can't even think about them!
8137 $rm -rf 123456789abcde*
8139 : determine where library module manual pages go
8140 set man3dir man3dir none
8144 $spackage has manual pages for many of the library modules.
8150 However, you don't have nroff, so they're probably useless to you.
8153 '') man3dir="none";;
8157 case "$d_flexfnam" in
8160 However, your system can't handle the long file names like File::Basename.3.
8163 '') man3dir="none";;
8167 echo "If you don't want the manual sources installed, answer 'none'."
8168 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
8170 '') dflt=`echo "$man1dir" | $sed -e 's/man1/man3/g' -e 's/man\.1/man\.3/g'`
8171 if $test -d "$privlib/man/man3"; then
8174 WARNING: Previous versions of perl installed man3 pages into
8175 $privlib/man/man3. This version will suggest a
8176 new default of $dflt.
8180 rp='Do you wish to preserve the old behavior?(y/n)'
8183 y*) dflt="$privlib/man/man3" ;;
8188 *) dflt="$man3dir" ;;
8195 rp="Where do the $package library man pages (source) go?"
8205 : What suffix to use on installed man pages
8211 rp="What suffix should be used for the $package library man pages?"
8213 '') case "$man3dir" in
8227 *) dflt="$man3ext";;
8234 : see if we have to deal with yellow pages, now NIS.
8235 if $test -d /usr/etc/yp || $test -d /etc/yp || $test -d /usr/lib/yp; then
8236 if $test -f /usr/etc/nibindd; then
8238 echo "I'm fairly confident you're on a NeXT."
8240 rp='Do you get the hosts file via NetInfo?'
8249 y*) hostcat='nidump hosts .';;
8250 *) case "$hostcat" in
8251 nidump*) hostcat='';;
8261 '') if $contains '^\+' /etc/passwd >/dev/null 2>&1; then
8269 rp='Are you getting the hosts file via yellow pages?'
8272 y*) hostcat='ypcat hosts';;
8273 *) hostcat='cat /etc/hosts';;
8279 '') test -f /etc/hosts && hostcat='cat /etc/hosts';;
8282 '') test -f /etc/group && groupcat='cat /etc/group';;
8285 '') test -f /etc/passwd && passcat='cat /etc/passwd';;
8288 : now get the host name
8290 echo "Figuring out host name..." >&4
8291 case "$myhostname" in
8293 echo 'Maybe "hostname" will work...'
8294 if tans=`sh -c hostname 2>&1` ; then
8302 if $test "$cont"; then
8304 echo 'Oh, dear. Maybe "/etc/systemid" is the key...'
8305 if tans=`cat /etc/systemid 2>&1` ; then
8307 phostname='cat /etc/systemid'
8308 echo "Whadyaknow. Xenix always was a bit strange..."
8311 elif $test -r /etc/systemid; then
8312 echo "(What is a non-Xenix system doing with /etc/systemid?)"
8315 if $test "$cont"; then
8316 echo 'No, maybe "uuname -l" will work...'
8317 if tans=`sh -c 'uuname -l' 2>&1` ; then
8319 phostname='uuname -l'
8321 echo 'Strange. Maybe "uname -n" will work...'
8322 if tans=`sh -c 'uname -n' 2>&1` ; then
8324 phostname='uname -n'
8326 echo 'Oh well, maybe I can mine it out of whoami.h...'
8327 if tans=`sh -c $contains' sysname $usrinc/whoami.h' 2>&1` ; then
8328 myhostname=`echo "$tans" | $sed 's/^.*"\(.*\)"/\1/'`
8329 phostname="sed -n -e '"'/sysname/s/^.*\"\\(.*\\)\"/\1/{'"' -e p -e q -e '}' <$usrinc/whoami.h"
8331 case "$myhostname" in
8332 '') echo "Does this machine have an identity crisis or something?"
8335 echo "Well, you said $myhostname before..."
8336 phostname='echo $myhostname';;
8342 case "$myhostname" in
8343 '') myhostname=noname ;;
8345 : you do not want to know about this
8350 if $test "$myhostname" ; then
8352 rp='Your host name appears to be "'$myhostname'".'" Right?"
8360 : bad guess or no guess
8361 while $test "X$myhostname" = X ; do
8363 rp="Please type the (one word) name of your host:"
8368 : translate upper to lower if necessary
8369 case "$myhostname" in
8371 echo "(Normalizing case in your host name)"
8372 myhostname=`echo $myhostname | ./tr '[A-Z]' '[a-z]'`
8376 case "$myhostname" in
8378 dflt=`expr "X$myhostname" : "X[^.]*\(\..*\)"`
8379 myhostname=`expr "X$myhostname" : "X\([^.]*\)\."`
8380 echo "(Trimming domain name from host name--host name is now $myhostname)"
8382 *) case "$mydomain" in
8385 test "X$hostcat" = "Xypcat hosts" &&
8386 ypmatch "$myhostname" hosts 2>/dev/null |\
8387 $sed -e 's/[ ]*#.*//; s/$/ /' > hosts && \
8390 test "X$hostcat" != "X" &&
8391 $hostcat | $sed -n -e "s/[ ]*#.*//; s/\$/ /
8392 /[ ]$myhostname[ . ]/p" > hosts
8395 if $test -f hosts; then
8396 $test x`$awk "/[0-9].*[ ]$myhostname$tmp_re/ { sum++ }
8397 END { print sum }" hosts` = x1 || tmp_re="[ ]"
8398 dflt=.`$awk "/[0-9].*[ ]$myhostname$tmp_re/ {for(i=2; i<=NF;i++) print \\\$i}" \
8399 hosts | $sort | $uniq | \
8400 $sed -n -e "s/$myhostname\.\([-a-zA-Z0-9_.]\)/\1/p"`
8401 case `$echo X$dflt` in
8402 X*\ *) echo "(Several hosts in the database matched hostname)"
8405 X.) echo "(You do not have fully-qualified names in the hosts database)"
8409 echo "(I cannot locate a hosts database anywhere)"
8414 tans=`./loc resolv.conf X /etc /usr/etc`
8415 if $test -f "$tans"; then
8416 echo "(Attempting domain name extraction from $tans)"
8417 dflt=.`$sed -n -e 's/ / /g' \
8418 -e 's/^search *\([^ ]*\).*/\1/p' $tans \
8419 | ./tr '[A-Z]' '[a-z]' 2>/dev/null`
8421 .) dflt=.`$sed -n -e 's/ / /g' \
8422 -e 's/^domain *\([^ ]*\).*/\1/p' $tans \
8423 | ./tr '[A-Z]' '[a-z]' 2>/dev/null`
8430 .) echo "(No help from resolv.conf either -- attempting clever guess)"
8431 dflt=.`sh -c domainname 2>/dev/null`
8434 .nis.*|.yp.*|.main.*) dflt=`echo $dflt | $sed -e 's/^\.[^.]*//'`;;
8438 case "$dflt$osname" in
8439 .os390) echo "(Attempting domain name extraction from //'SYS1.TCPPARMS(TCPDATA)')"
8440 dflt=.`awk '/^DOMAINORIGIN/ {print $2}' "//'SYS1.TCPPARMS(TCPDATA)'" 2>/dev/null`
8444 .) echo "(Lost all hope -- silly guess then)"
8450 *) dflt="$mydomain";;
8454 rp="What is your domain name?"
8464 : translate upper to lower if necessary
8467 echo "(Normalizing case in your domain name)"
8468 mydomain=`echo $mydomain | ./tr '[A-Z]' '[a-z]'`
8472 : a little sanity check here
8473 case "$phostname" in
8476 case `$phostname | ./tr '[A-Z]' '[a-z]'` in
8477 $myhostname$mydomain|$myhostname) ;;
8479 case "$phostname" in
8481 echo "(That doesn't agree with your whoami.h file, by the way.)"
8484 echo "(That doesn't agree with your $phostname command, by the way.)"
8494 I need to get your e-mail address in Internet format if possible, i.e.
8495 something like user@host.domain. Please answer accurately since I have
8496 no easy means to double check it. The default value provided below
8497 is most probably close to reality but may not be valid from outside
8498 your organization...
8502 while test "$cont"; do
8504 '') dflt="$cf_by@$myhostname$mydomain";;
8505 *) dflt="$cf_email";;
8507 rp='What is your e-mail address?'
8513 rp='Address does not look like an Internet one. Use it anyway?'
8529 If you or somebody else will be maintaining perl at your site, please
8530 fill in the correct e-mail address here so that they may be contacted
8531 if necessary. Currently, the "perlbug" program included with perl
8532 will send mail to this address in addition to perlbug@perl.org. You may
8533 enter "none" for no administrator.
8536 case "$perladmin" in
8537 '') dflt="$cf_email";;
8538 *) dflt="$perladmin";;
8540 rp='Perl administrator e-mail address'
8544 : determine whether to only install version-specific parts.
8547 Do you want to install only the version-specific parts of the perl
8548 distribution? Usually you do *not* want to do this.
8550 case "$versiononly" in
8551 "$define"|[Yy]*|true) dflt='y' ;;
8554 rp="Do you want to install only the version-specific parts of perl?"
8557 [yY]*) val="$define";;
8563 case "$versiononly" in
8564 "$define") inc_version_list=''
8565 inc_version_list_init=0
8569 : figure out how to guarantee perl startup
8570 case "$startperl" in
8572 case "$sharpbang" in
8576 I can use the #! construct to start perl on your system. This will
8577 make startup of perl scripts faster, but may cause problems if you
8578 want to share those scripts and perl is not in a standard place
8579 ($binexp/perl) on all your platforms. The alternative is to force
8580 a shell by starting the script with a single ':' character.
8583 case "$versiononly" in
8584 "$define") dflt="$binexp/perl$version";;
8585 *) dflt="$binexp/perl";;
8587 rp='What shall I put after the #! to start up perl ("none" to not use #!)?'
8590 none) startperl=": # use perl";;
8591 *) startperl="#!$ans"
8592 if $test 30 -lt `echo "$ans" | wc -c`; then
8595 WARNING: Some systems limit the #! command to 32 characters.
8596 If you experience difficulty running Perl scripts with #!, try
8597 installing Perl in a directory with a shorter pathname.
8603 *) startperl=": # use perl"
8608 echo "I'll use $startperl to start perl scripts."
8610 : figure best path for perl in scripts
8613 case "$versiononly" in
8614 "$define") perlpath="$binexp/perl$version";;
8615 *) perlpath="$binexp/perl";;
8617 case "$startperl" in
8622 I will use the "eval 'exec'" idiom to start Perl on your system.
8623 I can use the full path of your Perl binary for this purpose, but
8624 doing so may cause problems if you want to share those scripts and
8625 Perl is not always in a standard place ($binexp/perl).
8629 rp="What path shall I use in \"eval 'exec'\"?"
8636 case "$startperl" in
8638 *) echo "I'll use $perlpath in \"eval 'exec'\"" ;;
8641 : determine where public executable scripts go
8642 set scriptdir scriptdir
8644 case "$scriptdir" in
8647 : guess some guesses
8648 $test -d /usr/share/scripts && dflt=/usr/share/scripts
8649 $test -d /usr/share/bin && dflt=/usr/share/bin
8650 $test -d /usr/local/script && dflt=/usr/local/script
8651 $test -d /usr/local/scripts && dflt=/usr/local/scripts
8652 $test -d $prefixexp/script && dflt=$prefixexp/script
8656 *) dflt="$scriptdir"
8661 Some installations have a separate directory just for executable scripts so
8662 that they can mount it across multiple architectures but keep the scripts in
8663 one spot. You might, for example, have a subdirectory of /usr/share for this.
8664 Or you might just lump your scripts in with all your other executables.
8668 rp='Where do you keep publicly executable scripts?'
8670 if $test "X$ansexp" != "X$scriptdirexp"; then
8676 : A little fix up for an irregularly named variable.
8677 installscript="$installscriptdir"
8679 : determine where add-on public executables go
8681 '') dflt=$siteprefix/bin ;;
8685 rp='Pathname where the add-on public executables should be installed?'
8690 : determine where add-on html pages go
8691 : There is no standard location, so try to copy the previously-selected
8692 : directory structure for the core html pages.
8693 case "$sitehtml1dir" in
8694 '') dflt=`echo "$html1dir" | $sed "s#^$prefix#$siteprefix#"` ;;
8695 *) dflt=$sitehtml1dir ;;
8698 ''|' ') dflt=none ;;
8701 rp='Pathname where the site-specific html pages should be installed?'
8703 prefixvar=sitehtml1dir
8706 : determine where add-on library html pages go
8707 : There is no standard location, so try to copy the previously-selected
8708 : directory structure for the core html pages.
8709 case "$sitehtml3dir" in
8710 '') dflt=`echo "$html3dir" | $sed "s#^$prefix#$siteprefix#"` ;;
8711 *) dflt=$sitehtml3dir ;;
8714 ''|' ') dflt=none ;;
8717 rp='Pathname where the site-specific library html pages should be installed?'
8719 prefixvar=sitehtml3dir
8722 : determine where add-on manual pages go
8723 case "$siteman1dir" in
8724 '') dflt=`echo $man1dir | $sed "s#^$prefix#$siteprefix#"` ;;
8725 *) dflt=$siteman1dir ;;
8728 ''|' ') dflt=none ;;
8731 rp='Pathname where the site-specific manual pages should be installed?'
8733 prefixvar=siteman1dir
8736 : determine where add-on library man pages go
8737 case "$siteman3dir" in
8738 '') dflt=`echo $man3dir | $sed "s#^$prefix#$siteprefix#"` ;;
8739 *) dflt=$siteman3dir ;;
8742 ''|' ') dflt=none ;;
8745 rp='Pathname where the site-specific library manual pages should be installed?'
8747 prefixvar=siteman3dir
8750 : determine where add-on public executable scripts go
8751 case "$sitescript" in
8752 '') dflt=$siteprefix/script
8753 $test -d $dflt || dflt=$sitebin ;;
8754 *) dflt="$sitescript" ;;
8757 rp='Pathname where add-on public executable scripts should be installed?'
8759 prefixvar=sitescript
8762 case "$usefaststdio" in
8763 $define|true|[yY]*|'')
8764 xversion=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
8774 Perl can be built to use 'fast stdio', which means using the stdio
8775 library but also directly manipulating the stdio buffers to enable
8776 faster I/O. Using stdio is better for backward compatibility (especially
8777 for Perl extensions), but on the other hand since Perl 5.8 the 'perlio'
8778 interface has been preferred instead of stdio.
8780 If this doesn't make any sense to you, just accept the default '$dflt'.
8782 rp='Use the "fast stdio" if available?'
8785 y|Y) val="$define" ;;
8792 : define an is-a-typedef? function
8793 typedef='type=$1; var=$2; def=$3; shift; shift; shift; inclist=$@;
8795 "") inclist="sys/types.h";;
8797 eval "varval=\$$var";
8801 for inc in $inclist; do
8802 echo "#include <$inc>" >>temp.c;
8804 echo "#ifdef $type" >> temp.c;
8805 echo "printf(\"We have $type\");" >> temp.c;
8806 echo "#endif" >> temp.c;
8807 $cppstdin $cppflags $cppminus < temp.c >temp.E 2>/dev/null;
8808 if $contains $type temp.E >/dev/null 2>&1; then
8814 *) eval "$var=\$varval";;
8817 : define an is-a-typedef? function that prompts if the type is not available.
8818 typedef_ask='type=$1; var=$2; def=$3; shift; shift; shift; inclist=$@;
8820 "") inclist="sys/types.h";;
8822 eval "varval=\$$var";
8826 for inc in $inclist; do
8827 echo "#include <$inc>" >>temp.c;
8829 echo "#ifdef $type" >> temp.c;
8830 echo "printf(\"We have $type\");" >> temp.c;
8831 echo "#endif" >> temp.c;
8832 $cppstdin $cppflags $cppminus < temp.c >temp.E 2>/dev/null;
8834 echo "$rp" | $sed -e "s/What is/Looking for/" -e "s/?/./";
8835 if $contains $type temp.E >/dev/null 2>&1; then
8836 echo "$type found." >&4;
8839 echo "$type NOT found." >&4;
8845 *) eval "$var=\$varval";;
8848 : see what type lseek is declared as in the kernel
8849 rp="What is the type used for lseek's offset on this system?"
8850 set off_t lseektype long stdio.h sys/types.h
8854 echo "Checking to see how big your file offsets are..." >&4
8856 #include <sys/types.h>
8860 printf("%d\n", (int)sizeof($lseektype));
8865 if eval $compile_ok; then
8866 lseeksize=`$run ./try`
8867 echo "Your file offsets are $lseeksize bytes long."
8871 echo "(I can't seem to compile the test program. Guessing...)"
8872 rp="What is the size of your file offsets (in bytes)?"
8878 : see what type file positions are declared as in the library
8879 rp="What is the type for file position used by fsetpos()?"
8880 set fpos_t fpostype long stdio.h sys/types.h
8885 *_t) zzz="$fpostype" ;;
8888 echo "Checking the size of $zzz..." >&4
8890 #include <sys/types.h>
8897 printf("%d\n", (int)sizeof($fpostype));
8902 if eval $compile_ok; then
8906 echo "(I can't execute the test program--guessing $fpossize.)" >&4
8909 echo "Your $zzz is $fpossize bytes long."
8915 echo "(I can't compile the test program. Guessing...)" >&4
8916 rp="What is the size of your file positions (in bytes)?"
8921 # Backward compatibility (uselfs is deprecated).
8923 "$define"|true|[yY]*)
8926 *** Configure -Duselfs is deprecated, using -Duselargefiles instead.
8928 uselargefiles="$define"
8932 case "$lseeksize:$fpossize" in
8935 You can have files larger than 2 gigabytes.
8938 *) case "$uselargefiles" in
8939 "$undef"|false|[nN]*) dflt='n' ;;
8944 Perl can be built to understand large files (files larger than 2 gigabytes)
8945 on some systems. To do so, Configure can be run with -Duselargefiles.
8947 If this doesn't make any sense to you, just accept the default '$dflt'.
8949 rp='Try to understand large files, if available?'
8952 y|Y) val="$define" ;;
8959 : Look for a hint-file generated 'call-back-unit'. If the
8960 : user has specified that a large files perl is to be built,
8961 : we may need to set or change some other defaults.
8962 if $test -f uselargefiles.cbu; then
8963 echo "Your platform has some specific hints regarding large file builds, using them..."
8964 . ./uselargefiles.cbu
8966 case "$uselargefiles" in
8968 if $test -f uselargefiles.cbu; then
8970 echo "Rechecking to see how big your file offsets are..." >&4
8972 #include <sys/types.h>
8976 printf("%d\n", (int)sizeof($lseektype));
8981 if eval $compile_ok; then
8982 lseeksize=`$run ./try`
8983 $echo "Your file offsets are now $lseeksize bytes long."
8987 echo "(I can't seem to compile the test program. Guessing...)"
8988 rp="What is the size of your file offsets (in bytes)?"
8993 *_t) zzz="$fpostype" ;;
8996 $echo $n "Rechecking the size of $zzz...$c" >&4
8998 #include <sys/types.h>
9005 printf("%d\n", (int)sizeof($fpostype));
9010 if eval $compile_ok; then
9015 echo "(I can't execute the test program--guessing $fpossize.)" >&4
9018 echo " $fpossize bytes." >&4
9024 echo "(I can't compile the test program. Guessing...)" >&4
9025 rp="What is the size of your file positions (in bytes)?"
9034 case "$vendorprefix" in
9035 '') d_vendorbin="$undef"
9039 *) d_vendorbin="$define"
9040 : determine where vendor-supplied executables go.
9041 case "$vendorbin" in
9042 '') dflt=$vendorprefix/bin ;;
9043 *) dflt="$vendorbin" ;;
9046 rp='Pathname for the vendor-supplied executables directory?'
9049 vendorbinexp="$ansexp"
9055 case "$vendorprefix" in
9056 '') vendorhtml1dir=''
9057 vendorhtml1direxp=''
9059 *) : determine where vendor-supplied html pages go.
9060 : There is no standard location, so try to copy the previously-selected
9061 : directory structure for the core html pages.
9062 : XXX Better default suggestions would be welcome.
9063 case "$vendorhtml1dir" in
9064 '') dflt=`echo "$html1dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
9065 *) dflt=$vendorhtml1dir ;;
9068 ''|' ') dflt=none ;;
9071 rp='Pathname for the vendor-supplied html pages?'
9073 vendorhtml1dir="$ans"
9074 vendorhtml1direxp="$ansexp"
9077 : Use ' ' for none so value is preserved next time through Configure
9078 $test X"$vendorhtml1dir" = "X" && vendorhtml1dir=' '
9079 prefixvar=vendorhtml1dir
9082 case "$vendorprefix" in
9083 '') vendorhtml3dir=''
9084 vendorhtml3direxp=''
9086 *) : determine where vendor-supplied module html pages go.
9087 : There is no standard location, so try to copy the previously-selected
9088 : directory structure for the core html pages.
9089 : XXX Better default suggestions would be welcome.
9090 case "$vendorhtml3dir" in
9091 '') dflt=`echo "$html3dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
9092 *) dflt=$vendorhtml3dir ;;
9095 ''|' ') dflt=none ;;
9098 rp='Pathname for the vendor-supplied html pages?'
9100 vendorhtml3dir="$ans"
9101 vendorhtml3direxp="$ansexp"
9104 : Use ' ' for none so value is preserved next time through Configure
9105 $test X"$vendorhtml3dir" = "X" && vendorhtml3dir=' '
9106 prefixvar=vendorhtml3dir
9109 case "$vendorprefix" in
9110 '') vendorman1dir=''
9113 *) : determine where vendor-supplied manual pages go.
9114 case "$vendorman1dir" in
9115 '') dflt=`echo "$man1dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
9116 *) dflt=$vendorman1dir ;;
9119 ''|' ') dflt=none ;;
9122 rp='Pathname for the vendor-supplied manual section 1 pages?'
9124 vendorman1dir="$ans"
9125 vendorman1direxp="$ansexp"
9128 : Use ' ' for none so value is preserved next time through Configure
9129 $test X"$vendorman1dir" = "X" && vendorman1dir=' '
9130 prefixvar=vendorman1dir
9133 case "$vendorprefix" in
9134 '') vendorman3dir=''
9137 *) : determine where vendor-supplied module manual pages go.
9138 case "$vendorman3dir" in
9139 '') dflt=`echo "$man3dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
9140 *) dflt=$vendorman3dir ;;
9143 ''|' ') dflt=none ;;
9146 rp='Pathname for the vendor-supplied manual section 3 pages?'
9148 vendorman3dir="$ans"
9149 vendorman3direxp="$ansexp"
9152 : Use ' ' for none so value is preserved next time through Configure
9153 $test X"$vendorman3dir" = "X" && vendorman3dir=' '
9154 prefixvar=vendorman3dir
9157 case "$vendorprefix" in
9158 '') d_vendorscript="$undef"
9162 *) d_vendorscript="$define"
9163 : determine where vendor-supplied scripts go.
9164 case "$vendorscript" in
9165 '') dflt=$vendorprefix/script
9166 $test -d $dflt || dflt=$vendorbin ;;
9167 *) dflt="$vendorscript" ;;
9171 The installation process will create a directory for
9172 vendor-supplied scripts.
9176 rp='Pathname for the vendor-supplied scripts directory?'
9179 vendorscriptexp="$ansexp"
9182 prefixvar=vendorscript
9185 : see if qgcvt exists
9191 if $test X"$d_longdbl" = X"$define"; then
9193 echo "Checking how to print long doubles..." >&4
9195 if $test X"$sPRIfldbl" = X -a X"$doublesize" = X"$longdblsize"; then
9196 $cat >try.c <<'EOCP'
9197 #include <sys/types.h>
9201 printf("%.3f\n", d);
9205 if eval $compile; then
9209 sPRIfldbl='"f"'; sPRIgldbl='"g"'; sPRIeldbl='"e"';
9210 sPRIFUldbl='"F"'; sPRIGUldbl='"G"'; sPRIEUldbl='"E"';
9211 echo "We will use %f."
9217 if $test X"$sPRIfldbl" = X; then
9218 $cat >try.c <<'EOCP'
9219 #include <sys/types.h>
9222 long double d = 123.456;
9223 printf("%.3Lf\n", d);
9227 if eval $compile; then
9231 sPRIfldbl='"Lf"'; sPRIgldbl='"Lg"'; sPRIeldbl='"Le"';
9232 sPRIFUldbl='"LF"'; sPRIGUldbl='"LG"'; sPRIEUldbl='"LE"';
9233 echo "We will use %Lf."
9239 if $test X"$sPRIfldbl" = X; then
9240 $cat >try.c <<'EOCP'
9241 #include <sys/types.h>
9244 long double d = 123.456;
9245 printf("%.3llf\n", d);
9249 if eval $compile; then
9253 sPRIfldbl='"llf"'; sPRIgldbl='"llg"'; sPRIeldbl='"lle"';
9254 sPRIFUldbl='"llF"'; sPRIGUldbl='"llG"'; sPRIEUldbl='"llE"';
9255 echo "We will use %llf."
9261 if $test X"$sPRIfldbl" = X; then
9262 $cat >try.c <<'EOCP'
9263 #include <sys/types.h>
9266 long double d = 123.456;
9267 printf("%.3lf\n", d);
9271 if eval $compile; then
9275 sPRIfldbl='"lf"'; sPRIgldbl='"lg"'; sPRIeldbl='"le"';
9276 sPRIFUldbl='"lF"'; sPRIGUldbl='"lG"'; sPRIEUldbl='"lE"';
9277 echo "We will use %lf."
9283 if $test X"$sPRIfldbl" = X; then
9284 echo "Cannot figure out how to print long doubles." >&4
9286 sSCNfldbl=$sPRIfldbl # expect consistency
9293 case "$sPRIfldbl" in
9294 '') d_PRIfldbl="$undef"; d_PRIgldbl="$undef"; d_PRIeldbl="$undef";
9295 d_PRIFUldbl="$undef"; d_PRIGUldbl="$undef"; d_PRIEUldbl="$undef";
9296 d_SCNfldbl="$undef";
9298 *) d_PRIfldbl="$define"; d_PRIgldbl="$define"; d_PRIeldbl="$define";
9299 d_PRIFUldbl="$define"; d_PRIGUldbl="$define"; d_PRIEUldbl="$define";
9300 d_SCNfldbl="$define";
9304 : Check how to convert floats to strings.
9306 if test "X$d_Gconvert" = X; then
9309 echo "Checking for an efficient way to convert floats to strings."
9311 case "$uselongdouble" in
9312 "$define") echo "#define USE_LONG_DOUBLE" >>try.c ;;
9314 case "$d_longdbl" in
9315 "$define") echo "#define HAS_LONG_DOUBLE" >>try.c ;;
9317 case "$d_PRIgldbl" in
9318 "$define") echo "#define HAS_PRIgldbl" >>try.c ;;
9322 #define Gconvert(x,n,t,b) gconvert((x),(n),(t),(b))
9323 char *myname = "gconvert";
9326 #define Gconvert(x,n,t,b) gcvt((x),(n),(b))
9327 char *myname = "gcvt";
9330 #define Gconvert(x,n,t,b) qgcvt((x),(n),(b))
9331 char *myname = "qgcvt";
9332 #define DOUBLETYPE long double
9335 #if defined(USE_LONG_DOUBLE) && defined(HAS_LONG_DOUBLE)
9337 #define Gconvert(x,n,t,b) sprintf((b),"%.*"$sPRIgldbl,(n),(x))
9339 #define Gconvert(x,n,t,b) sprintf((b),"%.*g",(n),(double)(x))
9342 #define Gconvert(x,n,t,b) sprintf((b),"%.*g",(n),(x))
9344 char *myname = "sprintf";
9348 #if defined(USE_LONG_DOUBLE) && defined(HAS_LONG_DOUBLE)
9349 #define DOUBLETYPE long double
9351 #define DOUBLETYPE double
9357 #define I_STDLIB $i_stdlib
9363 checkit(expect, got)
9367 if (strcmp(expect, got)) {
9368 printf("%s oddity: Expected %s, got %s\n",
9369 myname, expect, got);
9379 /* This must be 1st test on (which?) platform */
9380 /* Alan Burlison <AlanBurlsin@unn.unisys.com> */
9381 Gconvert((DOUBLETYPE)0.1, 8, 0, buf);
9382 checkit("0.1", buf);
9384 Gconvert((DOUBLETYPE)0.01, 8, 0, buf);
9385 checkit("0.01", buf);
9387 Gconvert((DOUBLETYPE)0.001, 8, 0, buf);
9388 checkit("0.001", buf);
9390 Gconvert((DOUBLETYPE)0.0001, 8, 0, buf);
9391 checkit("0.0001", buf);
9393 Gconvert((DOUBLETYPE)0.00009, 8, 0, buf);
9394 if (strlen(buf) > 5)
9395 checkit("9e-005", buf); /* for Microsoft ?? */
9397 checkit("9e-05", buf);
9399 Gconvert((DOUBLETYPE)1.0, 8, 0, buf);
9402 Gconvert((DOUBLETYPE)1.1, 8, 0, buf);
9403 checkit("1.1", buf);
9405 Gconvert((DOUBLETYPE)1.01, 8, 0, buf);
9406 checkit("1.01", buf);
9408 Gconvert((DOUBLETYPE)1.001, 8, 0, buf);
9409 checkit("1.001", buf);
9411 Gconvert((DOUBLETYPE)1.0001, 8, 0, buf);
9412 checkit("1.0001", buf);
9414 Gconvert((DOUBLETYPE)1.00001, 8, 0, buf);
9415 checkit("1.00001", buf);
9417 Gconvert((DOUBLETYPE)1.000001, 8, 0, buf);
9418 checkit("1.000001", buf);
9420 Gconvert((DOUBLETYPE)0.0, 8, 0, buf);
9423 Gconvert((DOUBLETYPE)-1.0, 8, 0, buf);
9426 /* Some Linux gcvt's give 1.e+5 here. */
9427 Gconvert((DOUBLETYPE)100000.0, 8, 0, buf);
9428 checkit("100000", buf);
9430 /* Some Linux gcvt's give -1.e+5 here. */
9431 Gconvert((DOUBLETYPE)-100000.0, 8, 0, buf);
9432 checkit("-100000", buf);
9434 Gconvert((DOUBLETYPE)123.456, 8, 0, buf);
9435 checkit("123.456", buf);
9437 /* Testing of 1e+129 in bigintpm.t must not get extra '.' here. */
9438 Gconvert((DOUBLETYPE)1e34, 8, 0, buf);
9439 /* 34 should be enough to scare even long double
9440 * places into using the e notation. */
9441 if (strlen(buf) > 5)
9442 checkit("1e+034", buf); /* for Microsoft */
9444 checkit("1e+34", buf);
9446 /* For Perl, if you add additional tests here, also add them to
9447 * t/base/num.t for benefit of platforms not using Configure or
9448 * overriding d_Gconvert */
9453 : first add preferred functions to our list
9455 for xxx_convert in $gconvert_preference; do
9456 case $xxx_convert in
9457 gcvt|gconvert|sprintf) xxx_list="$xxx_list $xxx_convert" ;;
9458 *) echo "Discarding unrecognized gconvert_preference $xxx_convert" >&4 ;;
9461 : then add any others
9462 for xxx_convert in gconvert gcvt sprintf; do
9465 *) xxx_list="$xxx_list $xxx_convert" ;;
9469 case "$d_longdbl$uselongdouble" in
9471 : again, add prefered functions to our list first
9473 for xxx_convert in $gconvert_ld_preference; do
9474 case $xxx_convert in
9475 qgcvt|gcvt|gconvert|sprintf) xxx_ld_list="$xxx_ld_list $xxx_convert" ;;
9476 *) echo "Discarding unrecognized gconvert_ld_preference $xxx_convert" ;;
9479 : then add qgcvt, sprintf--then, in xxx_list order, gconvert and gcvt
9480 for xxx_convert in qgcvt sprintf $xxx_list; do
9481 case "$xxx_ld_list" in
9482 $xxx_convert*|*" $xxx_convert"*) ;;
9483 *) xxx_ld_list="$xxx_ld_list $xxx_convert" ;;
9486 : if sprintf cannot do long doubles, move it to the end
9487 if test "$d_PRIgldbl" != "$define"; then
9488 xxx_ld_list="`echo $xxx_ld_list|sed s/sprintf//` sprintf"
9490 : if no qgcvt, remove it
9491 if test "$d_qgcvt" != "$define"; then
9492 xxx_ld_list="`echo $xxx_ld_list|sed s/qgcvt//`"
9495 xxx_list="$xxx_ld_list"
9499 for xxx_convert in $xxx_list; do
9500 echo "Trying $xxx_convert..."
9502 set try -DTRY_$xxx_convert
9503 if eval $compile; then
9504 echo "$xxx_convert() found." >&4
9506 echo "I'll use $xxx_convert to convert floats into a string." >&4
9509 echo "...But $xxx_convert didn't work as I expected."
9513 echo "$xxx_convert NOT found." >&4
9517 if test X$xxx_convert = X; then
9518 echo "*** WHOA THERE!!! ***" >&4
9519 echo "None of ($xxx_list) seemed to work properly. I'll use sprintf." >&4
9523 case "$xxx_convert" in
9524 gconvert) d_Gconvert='gconvert((x),(n),(t),(b))' ;;
9525 gcvt) d_Gconvert='gcvt((x),(n),(b))' ;;
9526 qgcvt) d_Gconvert='qgcvt((x),(n),(b))' ;;
9527 *) case "$uselongdouble$d_longdbl$d_PRIgldbl" in
9528 "$define$define$define")
9529 d_Gconvert="sprintf((b),\"%.*\"$sPRIgldbl,(n),(x))" ;;
9530 "$define$define$undef")
9531 d_Gconvert='sprintf((b),"%.*g",(n),(double)(x))' ;;
9532 *) d_Gconvert='sprintf((b),"%.*g",(n),(x))' ;;
9539 : see if _fwalk exists
9543 : Initialize h_fcntl
9546 : Initialize h_sysfile
9549 : access call always available on UNIX
9553 : locate the flags for 'access()'
9557 $cat >access.c <<EOCP
9558 #include <sys/types.h>
9563 #include <sys/file.h>
9576 : check sys/file.h first, no particular reason here
9577 if $test `./findhdr sys/file.h` && \
9578 $cc -o access $cppflags -DI_SYS_FILE access.c >/dev/null 2>&1 ; then
9580 echo "<sys/file.h> defines the *_OK access constants." >&4
9581 elif $test `./findhdr fcntl.h` && \
9582 $cc -o access $cppflags -DI_FCNTL access.c >/dev/null 2>&1 ; then
9584 echo "<fcntl.h> defines the *_OK access constants." >&4
9585 elif $test `./findhdr unistd.h` && \
9586 $cc -o access $cppflags -DI_UNISTD access.c >/dev/null 2>&1 ; then
9587 echo "<unistd.h> defines the *_OK access constants." >&4
9589 echo "I can't find the four *_OK access constants--I'll use mine." >&4
9595 : see if accessx exists
9596 set accessx d_accessx
9599 : see if aintl exists
9603 : see if alarm exists
9607 : see if POSIX threads are available
9608 set pthread.h i_pthread
9611 : define a fucntion to check prototypes
9612 $cat > protochk <<EOSH
9615 optimize="$optimize"
9617 prototype="$prototype"
9620 usethreads=$usethreads
9621 i_pthread=$i_pthread
9622 pthread_h_first=$pthread_h_first
9625 $cat >> protochk <<'EOSH'
9630 while test $# -ge 2; do
9632 $define) echo "#include <$2>" >> try.c ;;
9633 literal) echo "$2" >> try.c ;;
9635 # Extra magic for the benefit of systems that need pthread.h
9636 # to be included early to correctly detect threadsafe functions.
9637 # Such functions must guarantee themselves, though, that the usethreads
9638 # and i_pthread have been defined, before calling protochk.
9639 if test "$usethreads" = "$define" -a "$i_pthread" = "$define" -a "$pthread_h_first" = "$define" -a "$pthread_h_done" = ""; then
9640 echo "#include <pthread.h>" >> try.c
9645 test "$prototype" = "$define" && echo '#define CAN_PROTOTYPE' >> try.c
9646 cat >> try.c <<'EOCP'
9647 #ifdef CAN_PROTOTYPE
9648 #define _(args) args
9653 echo "$foo" >> try.c
9654 echo 'int no_real_function_has_this_name _((void)) { return 0; }' >> try.c
9655 $cc $optimize $ccflags -c try.c > /dev/null 2>&1
9663 hasproto='varname=$1; func=$2; shift; shift;
9664 while $test $# -ge 2; do
9666 $define) echo "#include <$2>";;
9670 $cppstdin $cppflags $cppminus < try.c > tryout.c 2>/dev/null;
9671 if $contains "$func.*(" tryout.c >/dev/null 2>&1; then
9672 echo "$func() prototype found.";
9675 echo "$func() prototype NOT found.";
9680 $rm -f try.c tryout.c'
9682 : see if sys/types.h has to be included
9683 set sys/types.h i_systypes
9686 : see if sys/select.h has to be included
9687 set sys/select.h i_sysselct
9690 hasfield='varname=$1; struct=$2; field=$3; shift; shift; shift;
9691 while $test $# -ge 2; do
9693 $define) echo "#include <$2>";;
9697 echo "int main () { struct $struct foo; char* bar; bar = (char*)foo.$field; }" >> try.c;
9699 if eval $compile; then
9708 : see if we should include time.h, sys/time.h, or both
9710 if test "X$timeincl" = X; then
9711 echo "Testing to see if we should include <time.h>, <sys/time.h> or both." >&4
9712 $echo $n "I'm now running the test program...$c"
9714 #include <sys/types.h>
9719 #ifdef SYSTIMEKERNEL
9722 #include <sys/time.h>
9725 #include <sys/select.h>
9738 struct timezone tzp;
9740 if (foo.tm_sec == foo.tm_sec)
9743 if (bar.tv_sec == bar.tv_sec)
9750 for s_timezone in '-DS_TIMEZONE' ''; do
9752 for s_timeval in '-DS_TIMEVAL' ''; do
9753 for i_systimek in '' '-DSYSTIMEKERNEL'; do
9754 for i_time in '' '-DI_TIME'; do
9755 for i_systime in '-DI_SYSTIME' ''; do
9758 set try $i_time $i_systime $i_systimek $sysselect $s_timeval $s_timezone
9759 if eval $compile; then
9760 set X $i_time $i_systime $i_systimek $sysselect $s_timeval
9764 $echo $n "Succeeded with $flags$c"
9776 *SYSTIMEKERNEL*) i_systimek="$define"
9777 timeincl=`./findhdr sys/time.h`
9778 echo "We'll include <sys/time.h> with KERNEL defined." >&4;;
9779 *) i_systimek="$undef";;
9782 *I_TIME*) i_time="$define"
9783 timeincl=`./findhdr time.h`" $timeincl"
9784 echo "We'll include <time.h>." >&4;;
9785 *) i_time="$undef";;
9788 *I_SYSTIME*) i_systime="$define"
9789 timeincl=`./findhdr sys/time.h`" $timeincl"
9790 echo "We'll include <sys/time.h>." >&4;;
9791 *) i_systime="$undef";;
9795 : see if struct tm knows about tm_zone
9796 case "$i_systime$i_time" in
9799 echo "Checking to see if your struct tm has tm_zone field..." >&4
9800 set d_tm_tm_zone tm tm_zone $i_systime sys/time.h $i_time time.h
9808 case "$d_tm_tm_zone" in
9809 "$define") echo "Yes, it does." ;;
9810 *) echo "No, it doesn't." ;;
9812 : see if struct tm knows about tm_gmtoff
9813 case "$i_systime$i_time" in
9816 echo "Checking to see if your struct tm has tm_gmtoff field..." >&4
9817 set d_tm_tm_gmtoff tm tm_gmtoff $i_systime sys/time.h $i_time time.h
9825 case "$d_tm_tm_gmtoff" in
9826 "$define") echo "Yes, it does." ;;
9827 *) echo "No, it doesn't." ;;
9830 : see if asctime_r exists
9831 set asctime_r d_asctime_r
9833 case "$d_asctime_r" in
9835 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
9836 case "$d_asctime_r_proto:$usethreads" in
9837 ":define") d_asctime_r_proto=define
9838 set d_asctime_r_proto asctime_r $hdrs
9842 case "$d_asctime_r_proto" in
9844 case "$asctime_r_proto" in
9845 ''|0) try='char* asctime_r(const struct tm*, char*);'
9846 ./protochk "extern $try" $hdrs && asctime_r_proto=B_SB ;;
9848 case "$asctime_r_proto" in
9849 ''|0) try='char* asctime_r(const struct tm*, char*, int);'
9850 ./protochk "extern $try" $hdrs && asctime_r_proto=B_SBI ;;
9852 case "$asctime_r_proto" in
9853 ''|0) try='int asctime_r(const struct tm*, char*);'
9854 ./protochk "extern $try" $hdrs && asctime_r_proto=I_SB ;;
9856 case "$asctime_r_proto" in
9857 ''|0) try='int asctime_r(const struct tm*, char*, int);'
9858 ./protochk "extern $try" $hdrs && asctime_r_proto=I_SBI ;;
9860 case "$asctime_r_proto" in
9861 ''|0) d_asctime_r=undef
9863 echo "Disabling asctime_r, cannot determine prototype." >&4 ;;
9864 * ) case "$asctime_r_proto" in
9865 REENTRANT_PROTO*) ;;
9866 *) asctime_r_proto="REENTRANT_PROTO_$asctime_r_proto" ;;
9868 echo "Prototype: $try" ;;
9871 *) case "$usethreads" in
9872 define) echo "asctime_r has no prototype, not using it." >&4 ;;
9879 *) asctime_r_proto=0
9883 : see if atolf exists
9887 : see if atoll exists
9891 : Look for GCC-style attribute format
9892 case "$d_attribute_format" in
9895 echo "Checking whether your compiler can handle __attribute__((format)) ..." >&4
9896 $cat >attrib.c <<'EOCP'
9898 void my_special_printf(char* pat,...) __attribute__((__format__(__printf__,1,2)));
9900 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
9901 if $contains 'warning' attrib.out >/dev/null 2>&1; then
9902 echo "Your C compiler doesn't support __attribute__((format))."
9905 echo "Your C compiler supports __attribute__((format))."
9909 echo "Your C compiler doesn't seem to understand __attribute__ at all."
9913 *) val="$d_attribute_format" ;;
9915 set d_attribute_format
9919 : Look for GCC-style attribute malloc
9920 case "$d_attribute_malloc" in
9923 echo "Checking whether your compiler can handle __attribute__((malloc)) ..." >&4
9924 $cat >attrib.c <<'EOCP'
9926 char *go_get_some_memory( int how_many_bytes ) __attribute__((malloc));
9928 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
9929 if $contains 'warning' attrib.out >/dev/null 2>&1; then
9930 echo "Your C compiler doesn't support __attribute__((malloc))."
9933 echo "Your C compiler supports __attribute__((malloc))."
9937 echo "Your C compiler doesn't seem to understand __attribute__ at all."
9941 *) val="$d_attribute_malloc" ;;
9943 set d_attribute_malloc
9947 : Look for GCC-style attribute nonnull
9948 case "$d_attribute_nonnull" in
9951 echo "Checking whether your compiler can handle __attribute__((nonnull(1))) ..." >&4
9952 $cat >attrib.c <<'EOCP'
9954 void do_something (char *some_pointer,...) __attribute__((nonnull(1)));
9956 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
9957 if $contains 'warning' attrib.out >/dev/null 2>&1; then
9958 echo "Your C compiler doesn't support __attribute__((nonnull))."
9961 echo "Your C compiler supports __attribute__((nonnull))."
9965 echo "Your C compiler doesn't seem to understand __attribute__ at all."
9969 *) val="$d_attribute_nonnull" ;;
9971 set d_attribute_nonnull
9975 : Look for GCC-style attribute noreturn
9976 case "$d_attribute_noreturn" in
9979 echo "Checking whether your compiler can handle __attribute__((noreturn)) ..." >&4
9980 $cat >attrib.c <<'EOCP'
9982 void fall_over_dead( void ) __attribute__((noreturn));
9984 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
9985 if $contains 'warning' attrib.out >/dev/null 2>&1; then
9986 echo "Your C compiler doesn't support __attribute__((noreturn))."
9989 echo "Your C compiler supports __attribute__((noreturn))."
9993 echo "Your C compiler doesn't seem to understand __attribute__ at all."
9997 *) val="$d_attribute_noreturn" ;;
9999 set d_attribute_noreturn
10003 : Look for GCC-style attribute pure
10004 case "$d_attribute_pure" in
10007 echo "Checking whether your compiler can handle __attribute__((pure)) ..." >&4
10008 $cat >attrib.c <<'EOCP'
10010 int square( int n ) __attribute__((pure));
10012 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10013 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10014 echo "Your C compiler doesn't support __attribute__((pure))."
10017 echo "Your C compiler supports __attribute__((pure))."
10021 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10025 *) val="$d_attribute_pure" ;;
10027 set d_attribute_pure
10031 : Look for GCC-style attribute unused
10032 case "$d_attribute_unused" in
10035 echo "Checking whether your compiler can handle __attribute__((unused)) ..." >&4
10036 $cat >attrib.c <<'EOCP'
10038 int do_something( int dummy __attribute__((unused)), int n );
10040 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10041 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10042 echo "Your C compiler doesn't support __attribute__((unused))."
10045 echo "Your C compiler supports __attribute__((unused))."
10049 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10053 *) val="$d_attribute_unused" ;;
10055 set d_attribute_unused
10059 : Look for GCC-style attribute warn_unused_result
10060 case "$d_attribute_warn_unused_result" in
10063 echo "Checking whether your compiler can handle __attribute__((warn_unused_result)) ..." >&4
10064 $cat >attrib.c <<'EOCP'
10066 int I_will_not_be_ignored(void) __attribute__((warn_unused_result));
10068 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10069 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10070 echo "Your C compiler doesn't support __attribute__((warn_unused_result))."
10073 echo "Your C compiler supports __attribute__((warn_unused_result))."
10077 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10081 *) val="$d_attribute_warn_unused_result" ;;
10083 set d_attribute_warn_unused_result
10087 : see if bcmp exists
10091 : see if bcopy exists
10095 : see if this is a unistd.h system
10096 set unistd.h i_unistd
10099 : see if getpgrp exists
10100 set getpgrp d_getpgrp
10103 case "$d_getpgrp" in
10106 echo "Checking to see which flavor of getpgrp is in use..."
10108 #$i_unistd I_UNISTD
10109 #include <sys/types.h>
10111 # include <unistd.h>
10113 #$i_stdlib I_STDLIB
10115 #include <stdlib.h>
10119 if (getuid() == 0) {
10120 printf("(I see you are running Configure as super-user...)\n");
10123 #ifdef TRY_BSD_PGRP
10124 if (getpgrp(1) == 0)
10133 if $cc -o try -DTRY_BSD_PGRP $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
10134 echo "You have to use getpgrp(pid) instead of getpgrp()." >&4
10136 elif $cc -o try $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
10137 echo "You have to use getpgrp() instead of getpgrp(pid)." >&4
10140 echo "I can't seem to compile and run the test program."
10142 xxx="a USG one, i.e. you use getpgrp()."
10144 # SVR4 systems can appear rather BSD-ish.
10145 case "$i_unistd" in
10147 xxx="a BSD one, i.e. you use getpgrp(pid)."
10151 xxx="probably a USG one, i.e. you use getpgrp()."
10156 echo "Assuming your getpgrp is $xxx" >&4
10165 : see if setpgrp exists
10166 set setpgrp d_setpgrp
10169 case "$d_setpgrp" in
10172 echo "Checking to see which flavor of setpgrp is in use..."
10174 #$i_unistd I_UNISTD
10175 #include <sys/types.h>
10177 # include <unistd.h>
10179 #$i_stdlib I_STDLIB
10181 #include <stdlib.h>
10185 if (getuid() == 0) {
10186 printf("(I see you are running Configure as super-user...)\n");
10189 #ifdef TRY_BSD_PGRP
10190 if (-1 == setpgrp(1, 1))
10193 if (setpgrp() != -1)
10199 if $cc -o try -DTRY_BSD_PGRP $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
10200 echo 'You have to use setpgrp(pid,pgrp) instead of setpgrp().' >&4
10202 elif $cc -o try $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
10203 echo 'You have to use setpgrp() instead of setpgrp(pid,pgrp).' >&4
10206 echo "(I can't seem to compile and run the test program.)"
10208 xxx="a USG one, i.e. you use setpgrp()."
10210 # SVR4 systems can appear rather BSD-ish.
10211 case "$i_unistd" in
10213 xxx="a BSD one, i.e. you use setpgrp(pid,pgrp)."
10217 xxx="probably a USG one, i.e. you use setpgrp()."
10222 echo "Assuming your setpgrp is $xxx" >&4
10230 : Look for GCC-style __builtin_choose_expr
10231 case "$d_builtin_choose_expr" in
10234 echo "Checking whether your compiler can handle __builtin_choose_expr ..." >&4
10235 $cat >try.c <<'EOCP'
10236 #include <assert.h>
10237 #include <stdlib.h>
10240 #define SYRINX(x) __builtin_choose_expr( x, (1056*2), (103*50) )
10243 assert( SYRINX(1) == 2112 );
10244 assert( SYRINX(1) != 5150 );
10245 assert( SYRINX(0) == 5150 );
10246 assert( SYRINX(0) != 2112 );
10247 puts( "All good!" );
10253 if eval $compile; then
10254 echo "Your C compiler supports __builtin_choose_expr."
10257 echo "Your C compiler doesn't seem to understand __builtin_choose_expr."
10261 *) val="$d_builtin_choose_expr" ;;
10264 set d_builtin_choose_expr
10266 $rm -f try.* try core core.try.*
10268 : Look for GCC-style __builtin_expect
10269 case "$d_builtin_expect" in
10272 echo "Checking whether your compiler can handle __builtin_expect ..." >&4
10273 $cat >builtin.c <<'EOCP'
10276 if ( __builtin_expect(n, 0) ) n = 1;
10280 if eval $compile; then
10281 echo "Your C compiler supports __builtin_choose_expr."
10284 echo "Your C compiler doesn't seem to understand __builtin_choose_expr."
10288 *) val="$d_builtin_expect" ;;
10291 set d_builtin_expect
10293 $rm -f try.* try core core.try.*
10295 : see if bzero exists
10299 : see if signal is declared as pointer to function returning int or void
10301 xxx=`./findhdr signal.h`
10302 $test "$xxx" && $cppstdin $cppminus $cppflags < $xxx >$$.tmp 2>/dev/null
10303 if $contains 'int.*\*[ ]*signal' $$.tmp >/dev/null 2>&1 ; then
10304 echo "You have int (*signal())() instead of void." >&4
10306 elif $contains 'void.*\*[ ]*signal' $$.tmp >/dev/null 2>&1 ; then
10307 echo "You have void (*signal())()." >&4
10309 elif $contains 'extern[ ]*[(\*]*signal' $$.tmp >/dev/null 2>&1 ; then
10310 echo "You have int (*signal())() instead of void." >&4
10312 elif $contains 'void.*\*.*sig' $$.tmp >/dev/null 2>&1 ; then
10313 echo "You have void (*signal())()." >&4
10316 case "$d_voidsig" in
10318 echo "I can't determine whether signal handler returns void or int..." >&4
10320 rp="What type does your signal handler return?"
10323 v*) val="$define";;
10327 echo "As you already told me, signal handler returns void." >&4
10330 *) echo "As you already told me, signal handler returns int." >&4
10337 case "$d_voidsig" in
10338 "$define") signal_t="void";;
10339 *) signal_t="int";;
10343 : check for ability to cast large floats to 32-bit ints.
10345 echo 'Checking whether your C compiler can cast large floats to int32.' >&4
10346 if $test "$intsize" -ge 4; then
10353 #$i_stdlib I_STDLIB
10355 #include <stdlib.h>
10357 #include <sys/types.h>
10358 #include <signal.h>
10359 $signal_t blech(s) int s; { exit(3); }
10366 signal(SIGFPE, blech);
10368 /* Don't let compiler optimize the test away. Store the number
10369 in a writable string for gcc to pass to sscanf under HP/UX.
10371 sprintf(str, "2147483647");
10372 sscanf(str, "%lf", &f); /* f = (double) 0x7fffffff; */
10376 /* x86 processors will probably give 0x8000 0000, which is a
10377 sign change. We don't want that. We want to mimic SPARC
10378 behavior here, which is to preserve the sign and give
10381 if (i32 != ($xxx) f)
10387 if eval $compile_ok; then
10391 echo "(I can't seem to compile the test program--assuming it can't)"
10396 echo "Yup, it can."
10399 echo "Nope, it can't."
10406 : check for ability to cast negative floats to unsigned
10408 echo 'Checking whether your C compiler can cast negative float to unsigned.' >&4
10411 #$i_stdlib I_STDLIB
10413 #include <stdlib.h>
10415 #include <sys/types.h>
10416 #include <signal.h>
10417 $signal_t blech(s) int s; { exit(7); }
10418 $signal_t blech_in_list(s) int s; { exit(4); }
10419 unsigned long dummy_long(p) unsigned long p; { return p; }
10420 unsigned int dummy_int(p) unsigned int p; { return p; }
10421 unsigned short dummy_short(p) unsigned short p; { return p; }
10425 unsigned long along;
10427 unsigned short ashort;
10431 /* Frustrate gcc-2.7.2's optimizer which failed this test with
10432 a direct f = -123. assignment. gcc-2.8.0 reportedly
10433 optimized the whole file away
10435 /* Store the number in a writable string for gcc to pass to
10436 sscanf under HP/UX.
10438 sprintf(str, "-123");
10439 sscanf(str, "%lf", &f); /* f = -123.; */
10441 signal(SIGFPE, blech);
10442 along = (unsigned long)f;
10443 aint = (unsigned int)f;
10444 ashort = (unsigned short)f;
10445 if (along != (unsigned long)-123)
10447 if (aint != (unsigned int)-123)
10449 if (ashort != (unsigned short)-123)
10451 sprintf(str, "1073741824.");
10452 sscanf(str, "%lf", &f); /* f = (double)0x40000000; */
10455 along = (unsigned long)f;
10456 if (along != 0x80000000)
10460 along = (unsigned long)f;
10461 if (along != 0x7fffffff)
10465 along = (unsigned long)f;
10466 if (along != 0x80000001)
10470 signal(SIGFPE, blech_in_list);
10471 sprintf(str, "123.");
10472 sscanf(str, "%lf", &f); /* f = 123.; */
10473 along = dummy_long((unsigned long)f);
10474 aint = dummy_int((unsigned int)f);
10475 ashort = dummy_short((unsigned short)f);
10476 if (along != (unsigned long)123)
10478 if (aint != (unsigned int)123)
10480 if (ashort != (unsigned short)123)
10487 if eval $compile_ok; then
10491 echo "(I can't seem to compile the test program--assuming it can't)"
10494 case "$castflags" in
10496 echo "Yup, it can."
10499 echo "Nope, it can't."
10506 : see if vprintf exists
10508 if set vprintf val -f d_vprintf; eval $csym; $val; then
10509 echo 'vprintf() found.' >&4
10512 #include <varargs.h>
10513 #$i_stdlib I_STDLIB
10515 #include <stdlib.h>
10518 int main() { xxx("foo"); }
10527 exit((unsigned long)vsprintf(buf,"%s",args) > 10L);
10531 if eval $compile && $run ./try; then
10532 echo "Your vsprintf() returns (int)." >&4
10535 echo "Your vsprintf() returns (char*)." >&4
10539 echo 'vprintf() NOT found.' >&4
10550 : see if chown exists
10554 : see if chroot exists
10555 set chroot d_chroot
10558 : see if chsize exists
10559 set chsize d_chsize
10562 : see if class exists
10566 : see if clearenv exists
10567 set clearenv d_clearenv
10570 hasstruct='varname=$1; struct=$2; shift; shift;
10571 while $test $# -ge 2; do
10573 $define) echo "#include <$2>";;
10577 echo "int main () { struct $struct foo; }" >> try.c;
10579 if eval $compile; then
10586 $rm -f try.c try.o'
10590 : see whether socket exists
10592 $echo $n "Hmm... $c" >&4
10593 if set socket val -f d_socket; eval $csym; $val; then
10594 echo "Looks like you have Berkeley networking support." >&4
10596 if set setsockopt val -f; eval $csym; $val; then
10599 echo "...but it uses the old BSD 4.1c interface, rather than 4.2." >&4
10600 d_oldsock="$define"
10603 if $contains socklib libc.list >/dev/null 2>&1; then
10604 echo "Looks like you have Berkeley networking support." >&4
10606 : we will have to assume that it supports the 4.2 BSD interface
10609 echo "You don't have Berkeley networking in libc$_a..." >&4
10610 if test "X$d_socket" = "X$define"; then
10611 echo "...but you seem to believe that you have sockets." >&4
10613 for net in net socket
10615 if test -f /usr/lib/lib$net$_a; then
10616 ( ($nm $nm_opt /usr/lib/lib$net$_a | eval $nm_extract) || \
10617 $ar t /usr/lib/lib$net$_a) 2>/dev/null >> libc.list
10618 if $contains socket libc.list >/dev/null 2>&1; then
10623 echo "...but the Wollongong group seems to have hacked it in." >&4
10624 sockethdr="-I/usr/netinclude"
10627 echo "Found Berkeley sockets interface in lib$net." >&4
10628 if $contains setsockopt libc.list >/dev/null 2>&1; then
10631 echo "...using the old BSD 4.1c interface, rather than 4.2." >&4
10632 d_oldsock="$define"
10638 if test "X$d_socket" != "X$define"; then
10639 echo "or anywhere else I see." >&4
10647 : see if socketpair exists
10648 set socketpair d_sockpair
10653 echo "Checking the availability of certain socket constants..." >&4
10654 for ENUM in MSG_CTRUNC MSG_DONTROUTE MSG_OOB MSG_PEEK MSG_PROXY SCM_RIGHTS; do
10655 enum=`$echo $ENUM|./tr '[A-Z]' '[a-z]'`
10657 #include <sys/types.h>
10658 #include <sys/socket.h>
10664 set try; if eval $compile; then
10667 set d_${enum}; eval $setvar
10671 : see if this is a sys/uio.h system
10672 set sys/uio.h i_sysuio
10677 echo "Checking to see if your system supports struct cmsghdr..." >&4
10678 set d_cmsghdr_s cmsghdr $i_systypes sys/types.h $d_socket sys/socket.h $i_sysuio sys/uio.h
10680 case "$d_cmsghdr_s" in
10681 "$define") echo "Yes, it does." ;;
10682 *) echo "No, it doesn't." ;;
10686 : check for const keyword
10688 echo 'Checking to see if your C compiler knows about "const"...' >&4
10689 $cat >const.c <<'EOCP'
10690 typedef struct spug { int drokk; } spug;
10697 if $cc -c $ccflags const.c >/dev/null 2>&1 ; then
10699 echo "Yup, it does."
10702 echo "Nope, it doesn't."
10707 : see if copysignl exists
10708 set copysignl d_copysignl
10711 : see if crypt exists
10716 $define) cryptlib='' ;;
10717 *) if set crypt val -f d_crypt; eval $csym; $val; then
10718 echo 'crypt() found.' >&4
10722 cryptlib=`./loc Slibcrypt$_a "" $xlibpth`
10723 if $test -z "$cryptlib"; then
10724 cryptlib=`./loc Mlibcrypt$_a "" $xlibpth`
10728 if $test -z "$cryptlib"; then
10729 cryptlib=`./loc Llibcrypt$_a "" $xlibpth`
10733 if $test -z "$cryptlib"; then
10734 cryptlib=`./loc libcrypt$_a "" $libpth`
10738 if $test -z "$cryptlib"; then
10739 echo 'crypt() NOT found.' >&4
10750 : see if this is a crypt.h system
10751 set crypt.h i_crypt
10754 : see if crypt_r exists
10755 set crypt_r d_crypt_r
10757 case "$d_crypt_r" in
10759 hdrs="$i_systypes sys/types.h define stdio.h $i_crypt crypt.h"
10760 case "$d_crypt_r_proto:$usethreads" in
10761 ":define") d_crypt_r_proto=define
10762 set d_crypt_r_proto crypt_r $hdrs
10766 case "$d_crypt_r_proto" in
10768 case "$crypt_r_proto" in
10769 ''|0) try='char* crypt_r(const char*, const char*, struct crypt_data*);'
10770 ./protochk "extern $try" $hdrs && crypt_r_proto=B_CCS ;;
10772 case "$crypt_r_proto" in
10773 ''|0) try='char* crypt_r(const char*, const char*, CRYPTD*);'
10774 ./protochk "extern $try" $hdrs && crypt_r_proto=B_CCD ;;
10776 case "$crypt_r_proto" in
10777 ''|0) d_crypt_r=undef
10779 echo "Disabling crypt_r, cannot determine prototype." >&4 ;;
10780 * ) case "$crypt_r_proto" in
10781 REENTRANT_PROTO*) ;;
10782 *) crypt_r_proto="REENTRANT_PROTO_$crypt_r_proto" ;;
10784 echo "Prototype: $try" ;;
10787 *) case "$usethreads" in
10788 define) echo "crypt_r has no prototype, not using it." >&4 ;;
10799 : get csh whereabouts
10801 'csh') val="$undef" ;;
10802 *) val="$define" ;;
10806 : Respect a hint or command line value for full_csh.
10807 case "$full_csh" in
10808 '') full_csh=$csh ;;
10811 : see if ctermid_r exists
10812 set ctermid_r d_ctermid_r
10814 case "$d_ctermid_r" in
10816 hdrs="$i_systypes sys/types.h define stdio.h "
10817 case "$d_ctermid_r_proto:$usethreads" in
10818 ":define") d_ctermid_r_proto=define
10819 set d_ctermid_r_proto ctermid_r $hdrs
10823 case "$d_ctermid_r_proto" in
10825 case "$ctermid_r_proto" in
10826 ''|0) try='char* ctermid_r(char*);'
10827 ./protochk "extern $try" $hdrs && ctermid_r_proto=B_B ;;
10829 case "$ctermid_r_proto" in
10830 ''|0) d_ctermid_r=undef
10832 echo "Disabling ctermid_r, cannot determine prototype." >&4 ;;
10833 * ) case "$ctermid_r_proto" in
10834 REENTRANT_PROTO*) ;;
10835 *) ctermid_r_proto="REENTRANT_PROTO_$ctermid_r_proto" ;;
10837 echo "Prototype: $try" ;;
10840 *) case "$usethreads" in
10841 define) echo "ctermid_r has no prototype, not using it." >&4 ;;
10848 *) ctermid_r_proto=0
10852 : see if ctime_r exists
10853 set ctime_r d_ctime_r
10855 case "$d_ctime_r" in
10857 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
10858 case "$d_ctime_r_proto:$usethreads" in
10859 ":define") d_ctime_r_proto=define
10860 set d_ctime_r_proto ctime_r $hdrs
10864 case "$d_ctime_r_proto" in
10866 case "$ctime_r_proto" in
10867 ''|0) try='char* ctime_r(const time_t*, char*);'
10868 ./protochk "extern $try" $hdrs && ctime_r_proto=B_SB ;;
10870 case "$ctime_r_proto" in
10871 ''|0) try='char* ctime_r(const time_t*, char*, int);'
10872 ./protochk "extern $try" $hdrs && ctime_r_proto=B_SBI ;;
10874 case "$ctime_r_proto" in
10875 ''|0) try='int ctime_r(const time_t*, char*);'
10876 ./protochk "extern $try" $hdrs && ctime_r_proto=I_SB ;;
10878 case "$ctime_r_proto" in
10879 ''|0) try='int ctime_r(const time_t*, char*, int);'
10880 ./protochk "extern $try" $hdrs && ctime_r_proto=I_SBI ;;
10882 case "$ctime_r_proto" in
10883 ''|0) d_ctime_r=undef
10885 echo "Disabling ctime_r, cannot determine prototype." >&4 ;;
10886 * ) case "$ctime_r_proto" in
10887 REENTRANT_PROTO*) ;;
10888 *) ctime_r_proto="REENTRANT_PROTO_$ctime_r_proto" ;;
10890 echo "Prototype: $try" ;;
10893 *) case "$usethreads" in
10894 define) echo "ctime_r has no prototype, not using it." >&4 ;;
10905 : see if cuserid exists
10906 set cuserid d_cuserid
10909 : see if this is a limits.h system
10910 set limits.h i_limits
10913 : see if this is a float.h system
10914 set float.h i_float
10917 : See if number of significant digits in a double precision number is known
10919 $cat >dbl_dig.c <<EOM
10920 #$i_limits I_LIMITS
10923 #include <limits.h>
10929 printf("Contains DBL_DIG");
10932 $cppstdin $cppflags $cppminus < dbl_dig.c >dbl_dig.E 2>/dev/null
10933 if $contains 'DBL_DIG' dbl_dig.E >/dev/null 2>&1; then
10934 echo "DBL_DIG found." >&4
10937 echo "DBL_DIG NOT found." >&4
10944 : see if dbm.h is available
10945 : see if dbmclose exists
10946 set dbmclose d_dbmclose
10949 case "$d_dbmclose" in
10959 *) set rpcsvc/dbm.h i_rpcsvcdbm
10964 *) echo "We won't be including <dbm.h>"
10974 : see if prototype for dbminit is available
10976 set d_dbminitproto dbminit $i_dbm dbm.h
10979 : see if difftime exists
10980 set difftime d_difftime
10983 : see if this is a dirent system
10985 if xinc=`./findhdr dirent.h`; $test "$xinc"; then
10987 echo "<dirent.h> found." >&4
10990 if xinc=`./findhdr sys/dir.h`; $test "$xinc"; then
10991 echo "<sys/dir.h> found." >&4
10994 xinc=`./findhdr sys/ndir.h`
10996 echo "<dirent.h> NOT found." >&4
11001 : Look for type of directory structure.
11003 $cppstdin $cppflags $cppminus < "$xinc" > try.c
11005 case "$direntrytype" in
11007 case "$i_dirent" in
11008 $define) guess1='struct dirent' ;;
11009 *) guess1='struct direct' ;;
11012 *) guess1="$direntrytype"
11017 'struct dirent') guess2='struct direct' ;;
11018 *) guess2='struct dirent' ;;
11021 if $contains "$guess1" try.c >/dev/null 2>&1; then
11022 direntrytype="$guess1"
11023 echo "Your directory entries are $direntrytype." >&4
11024 elif $contains "$guess2" try.c >/dev/null 2>&1; then
11025 direntrytype="$guess2"
11026 echo "Your directory entries seem to be $direntrytype." >&4
11028 echo "I don't recognize your system's directory entries." >&4
11029 rp="What type is used for directory entries on this system?"
11032 direntrytype="$ans"
11037 : see if the directory entry stores field length
11039 $cppstdin $cppflags $cppminus < "$xinc" > try.c
11040 if $contains 'd_namlen' try.c >/dev/null 2>&1; then
11041 echo "Good, your directory entry keeps length information in d_namlen." >&4
11044 echo "Your directory entry does not know about the d_namlen field." >&4
11051 : see if this is an sysdir system
11052 set sys/dir.h i_sysdir
11055 : see if this is an sysndir system
11056 set sys/ndir.h i_sysndir
11061 $cat >dirfd.c <<EOM
11063 #$i_stdlib I_STDLIB
11065 #include <stdlib.h>
11067 #$i_dirent I_DIRENT /**/
11068 #$i_sysdir I_SYS_DIR /**/
11069 #$i_sysndir I_SYS_NDIR /**/
11070 #$i_systypes I_SYS_TYPES /**/
11071 #if defined(I_SYS_TYPES)
11072 #include <sys/types.h>
11074 #if defined(I_DIRENT)
11075 #include <dirent.h>
11076 #if defined(NeXT) && defined(I_SYS_DIR) /* NeXT needs dirent + sys/dir.h */
11077 #include <sys/dir.h>
11081 #include <sys/ndir.h>
11085 #include <ndir.h> /* may be wrong in the future */
11087 #include <sys/dir.h>
11093 DIR *dirp = opendir(".");
11094 if (dirfd(dirp) >= 0)
11102 if eval $compile; then
11106 $define) echo "dirfd() found." >&4 ;;
11107 *) echo "dirfd() NOT found." >&4 ;;
11113 : see if dlerror exists
11116 set dlerror d_dlerror
11120 : see if dlfcn is available
11121 set dlfcn.h i_dlfcn
11128 On a few systems, the dynamically loaded modules that perl generates and uses
11129 will need a different extension than shared libs. The default will probably
11135 *) dflt="$dlext" ;;
11137 rp='What is the extension of dynamically loaded modules'
11146 : Check if dlsym need a leading underscore
11152 echo "Checking whether your dlsym() needs a leading underscore ..." >&4
11153 $cat >dyna.c <<'EOM'
11160 #$i_stdlib I_STDLIB
11162 #include <stdlib.h>
11166 #include <dlfcn.h> /* the dynamic linker include file for SunOS/Solaris */
11168 #include <sys/types.h>
11173 extern int fred() ;
11182 int mode = RTLD_LAZY ;
11184 handle = dlopen("./dyna.$dlext", mode) ;
11185 if (handle == NULL) {
11190 symbol = dlsym(handle, "fred") ;
11191 if (symbol == NULL) {
11192 /* try putting a leading underscore */
11193 symbol = dlsym(handle, "_fred") ;
11194 if (symbol == NULL) {
11207 : Call the object file tmp-dyna.o in case dlext=o.
11208 if $cc $ccflags $cccdlflags -c dyna.c > /dev/null 2>&1 &&
11209 mv dyna${_o} tmp-dyna${_o} > /dev/null 2>&1 &&
11210 $ld -o dyna.$dlext $ldflags $lddlflags tmp-dyna${_o} > /dev/null 2>&1 &&
11211 $cc -o fred $ccflags $ldflags $cccdlflags $ccdlflags fred.c $libs > /dev/null 2>&1 && $to dyna.$dlext; then
11214 1) echo "Test program failed using dlopen." >&4
11215 echo "Perhaps you should not use dynamic loading." >&4;;
11216 2) echo "Test program failed using dlsym." >&4
11217 echo "Perhaps you should not use dynamic loading." >&4;;
11218 3) echo "dlsym needs a leading underscore" >&4
11220 4) echo "dlsym doesn't need a leading underscore." >&4;;
11223 echo "I can't compile and run the test program." >&4
11224 echo "I'm guessing that dlsym doesn't need a leading underscore." >&4
11229 $rm -f fred fred.* dyna.$dlext dyna.* tmp-dyna.*
11234 : see if drand48_r exists
11235 set drand48_r d_drand48_r
11237 case "$d_drand48_r" in
11239 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
11240 case "$d_drand48_r_proto:$usethreads" in
11241 ":define") d_drand48_r_proto=define
11242 set d_drand48_r_proto drand48_r $hdrs
11246 case "$d_drand48_r_proto" in
11248 case "$drand48_r_proto" in
11249 ''|0) try='int drand48_r(struct drand48_data*, double*);'
11250 ./protochk "extern $try" $hdrs && drand48_r_proto=I_ST ;;
11252 case "$drand48_r_proto" in
11253 ''|0) d_drand48_r=undef
11255 echo "Disabling drand48_r, cannot determine prototype." >&4 ;;
11256 * ) case "$drand48_r_proto" in
11257 REENTRANT_PROTO*) ;;
11258 *) drand48_r_proto="REENTRANT_PROTO_$drand48_r_proto" ;;
11260 echo "Prototype: $try" ;;
11263 *) case "$usethreads" in
11264 define) echo "drand48_r has no prototype, not using it." >&4 ;;
11271 *) drand48_r_proto=0
11275 : see if prototype for drand48 is available
11277 set d_drand48proto drand48 $i_stdlib stdlib.h $i_unistd unistd.h
11280 : see if dup2 exists
11284 : see if eaccess exists
11285 set eaccess d_eaccess
11288 : see if endgrent exists
11289 set endgrent d_endgrent
11292 : see if this is an grp system
11298 xxx=`./findhdr grp.h`
11299 $cppstdin $cppflags $cppminus < $xxx >$$.h
11301 if $contains 'gr_passwd' $$.h >/dev/null 2>&1; then
11313 set d_grpasswd; eval $setvar
11317 : see if endgrent_r exists
11318 set endgrent_r d_endgrent_r
11320 case "$d_endgrent_r" in
11322 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
11323 case "$d_endgrent_r_proto:$usethreads" in
11324 ":define") d_endgrent_r_proto=define
11325 set d_endgrent_r_proto endgrent_r $hdrs
11329 case "$d_endgrent_r_proto" in
11331 case "$endgrent_r_proto" in
11332 ''|0) try='int endgrent_r(FILE**);'
11333 ./protochk "extern $try" $hdrs && endgrent_r_proto=I_H ;;
11335 case "$endgrent_r_proto" in
11336 ''|0) try='void endgrent_r(FILE**);'
11337 ./protochk "extern $try" $hdrs && endgrent_r_proto=V_H ;;
11339 case "$endgrent_r_proto" in
11340 ''|0) d_endgrent_r=undef
11342 echo "Disabling endgrent_r, cannot determine prototype." >&4 ;;
11343 * ) case "$endgrent_r_proto" in
11344 REENTRANT_PROTO*) ;;
11345 *) endgrent_r_proto="REENTRANT_PROTO_$endgrent_r_proto" ;;
11347 echo "Prototype: $try" ;;
11350 *) case "$usethreads" in
11351 define) echo "endgrent_r has no prototype, not using it." >&4 ;;
11358 *) endgrent_r_proto=0
11362 : see if endhostent exists
11363 set endhostent d_endhent
11366 : see if this is a netdb.h system
11367 set netdb.h i_netdb
11370 : see if endhostent_r exists
11371 set endhostent_r d_endhostent_r
11373 case "$d_endhostent_r" in
11375 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
11376 case "$d_endhostent_r_proto:$usethreads" in
11377 ":define") d_endhostent_r_proto=define
11378 set d_endhostent_r_proto endhostent_r $hdrs
11382 case "$d_endhostent_r_proto" in
11384 case "$endhostent_r_proto" in
11385 ''|0) try='int endhostent_r(struct hostent_data*);'
11386 ./protochk "extern $try" $hdrs && endhostent_r_proto=I_D ;;
11388 case "$endhostent_r_proto" in
11389 ''|0) try='void endhostent_r(struct hostent_data*);'
11390 ./protochk "extern $try" $hdrs && endhostent_r_proto=V_D ;;
11392 case "$endhostent_r_proto" in
11393 ''|0) d_endhostent_r=undef
11394 endhostent_r_proto=0
11395 echo "Disabling endhostent_r, cannot determine prototype." >&4 ;;
11396 * ) case "$endhostent_r_proto" in
11397 REENTRANT_PROTO*) ;;
11398 *) endhostent_r_proto="REENTRANT_PROTO_$endhostent_r_proto" ;;
11400 echo "Prototype: $try" ;;
11403 *) case "$usethreads" in
11404 define) echo "endhostent_r has no prototype, not using it." >&4 ;;
11406 d_endhostent_r=undef
11407 endhostent_r_proto=0
11411 *) endhostent_r_proto=0
11415 : see if endnetent exists
11416 set endnetent d_endnent
11419 : see if endnetent_r exists
11420 set endnetent_r d_endnetent_r
11422 case "$d_endnetent_r" in
11424 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
11425 case "$d_endnetent_r_proto:$usethreads" in
11426 ":define") d_endnetent_r_proto=define
11427 set d_endnetent_r_proto endnetent_r $hdrs
11431 case "$d_endnetent_r_proto" in
11433 case "$endnetent_r_proto" in
11434 ''|0) try='int endnetent_r(struct netent_data*);'
11435 ./protochk "extern $try" $hdrs && endnetent_r_proto=I_D ;;
11437 case "$endnetent_r_proto" in
11438 ''|0) try='void endnetent_r(struct netent_data*);'
11439 ./protochk "extern $try" $hdrs && endnetent_r_proto=V_D ;;
11441 case "$endnetent_r_proto" in
11442 ''|0) d_endnetent_r=undef
11443 endnetent_r_proto=0
11444 echo "Disabling endnetent_r, cannot determine prototype." >&4 ;;
11445 * ) case "$endnetent_r_proto" in
11446 REENTRANT_PROTO*) ;;
11447 *) endnetent_r_proto="REENTRANT_PROTO_$endnetent_r_proto" ;;
11449 echo "Prototype: $try" ;;
11452 *) case "$usethreads" in
11453 define) echo "endnetent_r has no prototype, not using it." >&4 ;;
11455 d_endnetent_r=undef
11456 endnetent_r_proto=0
11460 *) endnetent_r_proto=0
11464 : see if endprotoent exists
11465 set endprotoent d_endpent
11468 : see if endprotoent_r exists
11469 set endprotoent_r d_endprotoent_r
11471 case "$d_endprotoent_r" in
11473 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
11474 case "$d_endprotoent_r_proto:$usethreads" in
11475 ":define") d_endprotoent_r_proto=define
11476 set d_endprotoent_r_proto endprotoent_r $hdrs
11480 case "$d_endprotoent_r_proto" in
11482 case "$endprotoent_r_proto" in
11483 ''|0) try='int endprotoent_r(struct protoent_data*);'
11484 ./protochk "extern $try" $hdrs && endprotoent_r_proto=I_D ;;
11486 case "$endprotoent_r_proto" in
11487 ''|0) try='void endprotoent_r(struct protoent_data*);'
11488 ./protochk "extern $try" $hdrs && endprotoent_r_proto=V_D ;;
11490 case "$endprotoent_r_proto" in
11491 ''|0) d_endprotoent_r=undef
11492 endprotoent_r_proto=0
11493 echo "Disabling endprotoent_r, cannot determine prototype." >&4 ;;
11494 * ) case "$endprotoent_r_proto" in
11495 REENTRANT_PROTO*) ;;
11496 *) endprotoent_r_proto="REENTRANT_PROTO_$endprotoent_r_proto" ;;
11498 echo "Prototype: $try" ;;
11501 *) case "$usethreads" in
11502 define) echo "endprotoent_r has no prototype, not using it." >&4 ;;
11504 d_endprotoent_r=undef
11505 endprotoent_r_proto=0
11509 *) endprotoent_r_proto=0
11513 : see if endpwent exists
11514 set endpwent d_endpwent
11517 : see if this is a pwd.h system
11523 xxx=`./findhdr pwd.h`
11524 $cppstdin $cppflags $cppminus < $xxx >$$.h
11526 if $contains 'pw_quota' $$.h >/dev/null 2>&1; then
11534 if $contains 'pw_age' $$.h >/dev/null 2>&1; then
11542 if $contains 'pw_change' $$.h >/dev/null 2>&1; then
11550 if $contains 'pw_class' $$.h >/dev/null 2>&1; then
11558 if $contains 'pw_expire' $$.h >/dev/null 2>&1; then
11566 if $contains 'pw_comment' $$.h >/dev/null 2>&1; then
11574 if $contains 'pw_gecos' $$.h >/dev/null 2>&1; then
11582 if $contains 'pw_passwd' $$.h >/dev/null 2>&1; then
11594 set d_pwquota; eval $setvar
11595 set d_pwage; eval $setvar
11596 set d_pwchange; eval $setvar
11597 set d_pwclass; eval $setvar
11598 set d_pwexpire; eval $setvar
11599 set d_pwcomment; eval $setvar
11600 set d_pwgecos; eval $setvar
11601 set d_pwpasswd; eval $setvar
11605 : see if endpwent_r exists
11606 set endpwent_r d_endpwent_r
11608 case "$d_endpwent_r" in
11610 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
11611 case "$d_endpwent_r_proto:$usethreads" in
11612 ":define") d_endpwent_r_proto=define
11613 set d_endpwent_r_proto endpwent_r $hdrs
11617 case "$d_endpwent_r_proto" in
11619 case "$endpwent_r_proto" in
11620 ''|0) try='int endpwent_r(FILE**);'
11621 ./protochk "extern $try" $hdrs && endpwent_r_proto=I_H ;;
11623 case "$endpwent_r_proto" in
11624 ''|0) try='void endpwent_r(FILE**);'
11625 ./protochk "extern $try" $hdrs && endpwent_r_proto=V_H ;;
11627 case "$endpwent_r_proto" in
11628 ''|0) d_endpwent_r=undef
11630 echo "Disabling endpwent_r, cannot determine prototype." >&4 ;;
11631 * ) case "$endpwent_r_proto" in
11632 REENTRANT_PROTO*) ;;
11633 *) endpwent_r_proto="REENTRANT_PROTO_$endpwent_r_proto" ;;
11635 echo "Prototype: $try" ;;
11638 *) case "$usethreads" in
11639 define) echo "endpwent_r has no prototype, not using it." >&4 ;;
11646 *) endpwent_r_proto=0
11650 : see if endservent exists
11651 set endservent d_endsent
11654 : see if endservent_r exists
11655 set endservent_r d_endservent_r
11657 case "$d_endservent_r" in
11659 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
11660 case "$d_endservent_r_proto:$usethreads" in
11661 ":define") d_endservent_r_proto=define
11662 set d_endservent_r_proto endservent_r $hdrs
11666 case "$d_endservent_r_proto" in
11668 case "$endservent_r_proto" in
11669 ''|0) try='int endservent_r(struct servent_data*);'
11670 ./protochk "extern $try" $hdrs && endservent_r_proto=I_D ;;
11672 case "$endservent_r_proto" in
11673 ''|0) try='void endservent_r(struct servent_data*);'
11674 ./protochk "extern $try" $hdrs && endservent_r_proto=V_D ;;
11676 case "$endservent_r_proto" in
11677 ''|0) d_endservent_r=undef
11678 endservent_r_proto=0
11679 echo "Disabling endservent_r, cannot determine prototype." >&4 ;;
11680 * ) case "$endservent_r_proto" in
11681 REENTRANT_PROTO*) ;;
11682 *) endservent_r_proto="REENTRANT_PROTO_$endservent_r_proto" ;;
11684 echo "Prototype: $try" ;;
11687 *) case "$usethreads" in
11688 define) echo "endservent_r has no prototype, not using it." >&4 ;;
11690 d_endservent_r=undef
11691 endservent_r_proto=0
11695 *) endservent_r_proto=0
11699 : Locate the flags for 'open()'
11702 #include <sys/types.h>
11707 #include <sys/file.h>
11709 #$i_stdlib I_STDLIB
11711 #include <stdlib.h>
11722 : check sys/file.h first to get FREAD on Sun
11723 if $test `./findhdr sys/file.h` && \
11724 set try -DI_SYS_FILE && eval $compile; then
11726 echo "<sys/file.h> defines the O_* constants..." >&4
11727 if $run ./try; then
11728 echo "and you have the 3 argument form of open()." >&4
11731 echo "but not the 3 argument form of open(). Oh, well." >&4
11734 elif $test `./findhdr fcntl.h` && \
11735 set try -DI_FCNTL && eval $compile; then
11737 echo "<fcntl.h> defines the O_* constants..." >&4
11738 if $run ./try; then
11739 echo "and you have the 3 argument form of open()." >&4
11742 echo "but not the 3 argument form of open(). Oh, well." >&4
11747 echo "I can't find the O_* constant definitions! You got problems." >&4
11753 : see which of string.h or strings.h is needed
11755 strings=`./findhdr string.h`
11756 if $test "$strings" && $test -r "$strings"; then
11757 echo "Using <string.h> instead of <strings.h>." >&4
11761 strings=`./findhdr strings.h`
11762 if $test "$strings" && $test -r "$strings"; then
11763 echo "Using <strings.h> instead of <string.h>." >&4
11765 echo "No string header found -- You'll surely have problems." >&4
11770 case "$i_string" in
11771 "$undef") strings=`./findhdr strings.h`;;
11772 *) strings=`./findhdr string.h`;;
11775 : see if this is a sys/file.h system
11780 : do we need to include sys/file.h ?
11784 if $h_sysfile; then
11786 echo "We'll be including <sys/file.h>." >&4
11789 echo "We won't be including <sys/file.h>." >&4
11799 : see if fcntl.h is there
11804 : see if we can include fcntl.h
11810 echo "We'll be including <fcntl.h>." >&4
11813 if $h_sysfile; then
11814 echo "We don't need to include <fcntl.h> if we include <sys/file.h>." >&4
11816 echo "We won't be including <fcntl.h>." >&4
11828 : check for non-blocking I/O stuff
11829 case "$h_sysfile" in
11830 true) echo "#include <sys/file.h>" > head.c;;
11833 true) echo "#include <fcntl.h>" > head.c;;
11834 *) echo "#include <sys/fcntl.h>" > head.c;;
11839 echo "Figuring out the flag used by open() for non-blocking I/O..." >&4
11840 case "$o_nonblock" in
11842 $cat head.c > try.c
11843 $cat >>try.c <<EOCP
11845 #$i_stdlib I_STDLIB
11847 #include <stdlib.h>
11855 printf("O_NONBLOCK\n");
11859 printf("O_NDELAY\n");
11863 printf("FNDELAY\n");
11870 if eval $compile_ok; then
11871 o_nonblock=`$run ./try`
11872 case "$o_nonblock" in
11873 '') echo "I can't figure it out, assuming O_NONBLOCK will do.";;
11874 *) echo "Seems like we can use $o_nonblock.";;
11877 echo "(I can't compile the test program; pray O_NONBLOCK is right!)"
11880 *) echo "Using $hint value $o_nonblock.";;
11882 $rm -f try try.* .out core
11885 echo "Let's see what value errno gets from read() on a $o_nonblock file..." >&4
11888 $cat head.c > try.c
11889 $cat >>try.c <<EOCP
11891 #include <sys/types.h>
11892 #include <signal.h>
11894 #$i_stdlib I_STDLIB
11896 #include <stdlib.h>
11902 #define MY_O_NONBLOCK $o_nonblock
11903 #ifndef errno /* XXX need better Configure test */
11906 #$i_unistd I_UNISTD
11908 #include <unistd.h>
11910 #$i_string I_STRING
11912 #include <string.h>
11914 #include <strings.h>
11916 $signal_t blech(x) int x; { exit(3); }
11918 $cat >> try.c <<'EOCP'
11926 pipe(pd); /* Down: child -> parent */
11927 pipe(pu); /* Up: parent -> child */
11930 close(pd[1]); /* Parent reads from pd[0] */
11931 close(pu[0]); /* Parent writes (blocking) to pu[1] */
11933 if (-1 == fcntl(pd[0], F_SETFL, MY_O_NONBLOCK))
11938 signal(SIGALRM, blech);
11940 if ((ret = read(pd[0], buf, 1)) > 0) /* Nothing to read! */
11942 sprintf(string, "%d\n", ret);
11943 write(2, string, strlen(string));
11946 if (errno == EAGAIN) {
11947 printf("EAGAIN\n");
11952 if (errno == EWOULDBLOCK)
11953 printf("EWOULDBLOCK\n");
11956 write(pu[1], buf, 1); /* Unblocks child, tell it to close our pipe */
11957 sleep(2); /* Give it time to close our pipe */
11959 ret = read(pd[0], buf, 1); /* Should read EOF */
11961 sprintf(string, "%d\n", ret);
11962 write(4, string, strlen(string));
11966 close(pd[0]); /* We write to pd[1] */
11967 close(pu[1]); /* We read from pu[0] */
11968 read(pu[0], buf, 1); /* Wait for parent to signal us we may continue */
11969 close(pd[1]); /* Pipe pd is now fully closed! */
11970 exit(0); /* Bye bye, thank you for playing! */
11974 if eval $compile_ok; then
11975 echo "$startsh" >mtry
11976 echo "$run ./try >try.out 2>try.ret 4>try.err || exit 4" >>mtry
11978 ./mtry >/dev/null 2>&1
11980 0) eagain=`$cat try.out`;;
11981 1) echo "Could not perform non-blocking setting!";;
11982 2) echo "I did a successful read() for something that was not there!";;
11983 3) echo "Hmm... non-blocking I/O does not seem to be working!";;
11984 4) echo "Could not find F_SETFL!";;
11985 *) echo "Something terribly wrong happened during testing.";;
11987 rd_nodata=`$cat try.ret`
11988 echo "A read() system call with no data present returns $rd_nodata."
11989 case "$rd_nodata" in
11992 echo "(That's peculiar, fixing that to be -1.)"
11998 echo "Forcing errno EAGAIN on read() with no data available."
12002 echo "Your read() sets errno to $eagain when no data is available."
12005 status=`$cat try.err`
12007 0) echo "And it correctly returns 0 to signal EOF.";;
12008 -1) echo "But it also returns -1 to signal EOF, so be careful!";;
12009 *) echo "However, your read() returns '$status' on EOF??";;
12012 if test "$status" = "$rd_nodata"; then
12013 echo "WARNING: you can't distinguish between EOF and no data!"
12017 echo "I can't compile the test program--assuming errno EAGAIN will do."
12024 echo "Using $hint value $eagain."
12025 echo "Your read() returns $rd_nodata when no data is present."
12026 case "$d_eofnblk" in
12027 "$define") echo "And you can see EOF because read() returns 0.";;
12028 "$undef") echo "But you can't see EOF status from read() returned value.";;
12030 echo "(Assuming you can't see EOF status from read anyway.)"
12036 $rm -f try try.* .out core head.c mtry
12038 : see if _ptr and _cnt from stdio act std
12041 if $contains '_lbfsize' `./findhdr stdio.h` >/dev/null 2>&1 ; then
12042 echo "(Looks like you have stdio.h from BSD.)"
12043 case "$stdio_ptr" in
12044 '') stdio_ptr='((fp)->_p)'
12047 *) ptr_lval=$d_stdio_ptr_lval;;
12049 case "$stdio_cnt" in
12050 '') stdio_cnt='((fp)->_r)'
12053 *) cnt_lval=$d_stdio_cnt_lval;;
12055 case "$stdio_base" in
12056 '') stdio_base='((fp)->_ub._base ? (fp)->_ub._base : (fp)->_bf._base)';;
12058 case "$stdio_bufsiz" in
12059 '') stdio_bufsiz='((fp)->_ub._base ? (fp)->_ub._size : (fp)->_bf._size)';;
12061 elif $contains '_IO_fpos_t' `./findhdr stdio.h` `./findhdr libio.h` >/dev/null 2>&1 ; then
12062 echo "(Looks like you have stdio.h from Linux.)"
12063 case "$stdio_ptr" in
12064 '') stdio_ptr='((fp)->_IO_read_ptr)'
12067 *) ptr_lval=$d_stdio_ptr_lval;;
12069 case "$stdio_cnt" in
12070 '') stdio_cnt='((fp)->_IO_read_end - (fp)->_IO_read_ptr)'
12073 *) cnt_lval=$d_stdio_cnt_lval;;
12075 case "$stdio_base" in
12076 '') stdio_base='((fp)->_IO_read_base)';;
12078 case "$stdio_bufsiz" in
12079 '') stdio_bufsiz='((fp)->_IO_read_end - (fp)->_IO_read_base)';;
12082 case "$stdio_ptr" in
12083 '') stdio_ptr='((fp)->_ptr)'
12086 *) ptr_lval=$d_stdio_ptr_lval;;
12088 case "$stdio_cnt" in
12089 '') stdio_cnt='((fp)->_cnt)'
12092 *) cnt_lval=$d_stdio_cnt_lval;;
12094 case "$stdio_base" in
12095 '') stdio_base='((fp)->_base)';;
12097 case "$stdio_bufsiz" in
12098 '') stdio_bufsiz='((fp)->_cnt + (fp)->_ptr - (fp)->_base)';;
12102 : test whether _ptr and _cnt really work
12103 echo "Checking how std your stdio is..." >&4
12106 #$i_stdlib I_STDLIB
12108 #include <stdlib.h>
12110 #define FILE_ptr(fp) $stdio_ptr
12111 #define FILE_cnt(fp) $stdio_cnt
12113 FILE *fp = fopen("try.c", "r");
12116 18 <= FILE_cnt(fp) &&
12117 strncmp(FILE_ptr(fp), "include <stdio.h>\n", 18) == 0
12125 if eval $compile && $to try.c; then
12126 if $run ./try; then
12127 echo "Your stdio acts pretty std."
12130 echo "Your stdio isn't very std."
12133 echo "Your stdio doesn't appear very std."
12137 # glibc 2.2.90 and above apparently change stdio streams so Perl's
12138 # direct buffer manipulation no longer works. The Configure tests
12139 # should be changed to correctly detect this, but until then,
12140 # the following check should at least let perl compile and run.
12141 # (This quick fix should be updated before 5.8.1.)
12142 # To be defensive, reject all unknown versions, and all versions > 2.2.9.
12143 # A. Dougherty, June 3, 2002.
12144 case "$d_gnulibc" in
12146 case "$gnulibc_version" in
12150 *) echo "But I will not snoop inside glibc $gnulibc_version stdio buffers."
12159 : Can _ptr be used as an lvalue?
12160 case "$d_stdstdio$ptr_lval" in
12161 $define$define) val=$define ;;
12164 set d_stdio_ptr_lval
12167 : Can _cnt be used as an lvalue?
12168 case "$d_stdstdio$cnt_lval" in
12169 $define$define) val=$define ;;
12172 set d_stdio_cnt_lval
12176 : test whether setting _ptr sets _cnt as a side effect
12177 d_stdio_ptr_lval_sets_cnt="$undef"
12178 d_stdio_ptr_lval_nochange_cnt="$undef"
12179 case "$d_stdio_ptr_lval$d_stdstdio" in
12181 echo "Checking to see what happens if we set the stdio ptr..." >&4
12184 /* Can we scream? */
12185 /* Eat dust sed :-) */
12186 /* In the buffer space, no one can hear you scream. */
12187 #$i_stdlib I_STDLIB
12189 #include <stdlib.h>
12191 #define FILE_ptr(fp) $stdio_ptr
12192 #define FILE_cnt(fp) $stdio_cnt
12193 #include <sys/types.h>
12195 FILE *fp = fopen("try.c", "r");
12200 puts("Fail even to read");
12203 c = getc(fp); /* Read away the first # */
12205 puts("Fail even to read");
12209 18 <= FILE_cnt(fp) &&
12210 strncmp(FILE_ptr(fp), "include <stdio.h>\n", 18) == 0
12212 puts("Fail even to read");
12215 ptr = (char*) FILE_ptr(fp);
12216 cnt = (size_t)FILE_cnt(fp);
12218 FILE_ptr(fp) += 42;
12220 if ((char*)FILE_ptr(fp) != (ptr + 42)) {
12221 printf("Fail ptr check %p != %p", FILE_ptr(fp), (ptr + 42));
12224 if (FILE_cnt(fp) <= 20) {
12225 printf ("Fail (<20 chars to test)");
12228 if (strncmp(FILE_ptr(fp), "Eat dust sed :-) */\n", 20) != 0) {
12229 puts("Fail compare");
12232 if (cnt == FILE_cnt(fp)) {
12233 puts("Pass_unchanged");
12236 if (FILE_cnt(fp) == (cnt - 42)) {
12237 puts("Pass_changed");
12240 printf("Fail count was %d now %d\n", cnt, FILE_cnt(fp));
12246 if eval $compile && $to try.c; then
12247 case `$run ./try` in
12249 echo "Increasing ptr in your stdio decreases cnt by the same amount. Good." >&4
12250 d_stdio_ptr_lval_sets_cnt="$define" ;;
12252 echo "Increasing ptr in your stdio leaves cnt unchanged. Good." >&4
12253 d_stdio_ptr_lval_nochange_cnt="$define" ;;
12255 echo "Increasing ptr in your stdio didn't do exactly what I expected. We'll not be doing that then." >&4 ;;
12257 echo "It appears attempting to set ptr in your stdio is a bad plan." >&4 ;;
12260 echo "It seems we can't set ptr in your stdio. Nevermind." >&4
12266 : see if _base is also standard
12268 case "$d_stdstdio" in
12272 #$i_stdlib I_STDLIB
12274 #include <stdlib.h>
12276 #define FILE_base(fp) $stdio_base
12277 #define FILE_bufsiz(fp) $stdio_bufsiz
12279 FILE *fp = fopen("try.c", "r");
12282 19 <= FILE_bufsiz(fp) &&
12283 strncmp(FILE_base(fp), "#include <stdio.h>\n", 19) == 0
12290 if eval $compile && $to try.c; then
12291 if $run ./try; then
12292 echo "And its _base field acts std."
12295 echo "But its _base field isn't std."
12298 echo "However, it seems to be lacking the _base field."
12306 : see if fast_stdio exists
12308 case "$d_stdstdio:$d_stdio_ptr_lval" in
12310 case "$d_stdio_cnt_lval$d_stdio_ptr_lval_sets_cnt" in
12312 echo "You seem to have 'fast stdio' to directly manipulate the stdio buffers." >& 4
12323 : see if fchdir exists
12324 set fchdir d_fchdir
12327 : see if fchmod exists
12328 set fchmod d_fchmod
12331 : see if fchown exists
12332 set fchown d_fchown
12335 : see if this is an fcntl system
12340 : See if fcntl-based locking works.
12342 #$i_stdlib I_STDLIB
12344 #include <stdlib.h>
12346 #include <unistd.h>
12348 #include <signal.h>
12349 $signal_t blech(x) int x; { exit(3); }
12351 #if defined(F_SETLK) && defined(F_SETLKW)
12352 struct flock flock;
12354 fd = open("try.c", O_RDONLY);
12355 flock.l_type = F_RDLCK;
12356 flock.l_whence = SEEK_SET;
12357 flock.l_start = flock.l_len = 0;
12358 signal(SIGALRM, blech);
12360 retval = fcntl(fd, F_SETLK, &flock);
12362 (retval < 0 ? exit(2) : exit(0));
12368 echo "Checking if fcntl-based file locking works... "
12372 if eval $compile_ok; then
12373 if $run ./try; then
12374 echo "Yes, it seems to work."
12377 echo "Nope, it didn't work."
12382 *** I had to forcibly timeout from fcntl(..., F_SETLK, ...).
12383 *** This is (almost) impossible.
12384 *** If your NFS lock daemons are not feeling well, something like
12385 *** this may happen, please investigate. Cannot continue, aborting.
12393 echo "I'm unable to compile the test program, so I'll assume not."
12398 echo "Nope, since you don't even have fcntl()."
12401 set d_fcntl_can_lock
12406 : check for fd_set items
12409 Checking to see how well your C compiler handles fd_set and friends ...
12412 #$i_stdlib I_STDLIB
12414 #include <stdlib.h>
12416 #$i_systime I_SYS_TIME
12417 #$i_sysselct I_SYS_SELECT
12418 #$d_socket HAS_SOCKET
12419 #include <sys/types.h>
12421 #include <sys/socket.h> /* Might include <sys/bsdtypes.h> */
12424 #include <sys/time.h>
12426 #ifdef I_SYS_SELECT
12427 #include <sys/select.h>
12436 #if defined(FD_SET) && defined(FD_CLR) && defined(FD_ISSET) && defined(FD_ZERO)
12444 if eval $compile; then
12445 d_fds_bits="$define"
12447 echo "Well, your system knows about the normal fd_set typedef..." >&4
12448 if $run ./try; then
12449 echo "and you have the normal fd_set macros (just as I'd expect)." >&4
12450 d_fd_macros="$define"
12453 but not the normal fd_set macros! Gaaack! I'll have to cover for you.
12455 d_fd_macros="$undef"
12459 Hmm, your compiler has some difficulty with fd_set. Checking further...
12462 if eval $compile; then
12463 d_fds_bits="$undef"
12465 echo "Well, your system has some sort of fd_set available..." >&4
12466 if $run ./try; then
12467 echo "and you have the normal fd_set macros." >&4
12468 d_fd_macros="$define"
12471 but not the normal fd_set macros! Gross! More work for me...
12473 d_fd_macros="$undef"
12476 echo "Well, you got zip. That's OK, I can roll my own fd_set stuff." >&4
12478 d_fds_bits="$undef"
12479 d_fd_macros="$undef"
12484 : see if fgetpos exists
12485 set fgetpos d_fgetpos
12488 : see if finite exists
12489 set finite d_finite
12492 : see if finitel exists
12493 set finitel d_finitel
12496 : see if flock exists
12500 : see if prototype for flock is available
12502 set d_flockproto flock $i_sysfile sys/file.h
12505 : see if fork exists
12509 : see if fp_class exists
12510 set fp_class d_fp_class
12513 : see if pathconf exists
12514 set pathconf d_pathconf
12517 : see if fpathconf exists
12518 set fpathconf d_fpathconf
12521 : see if fpclass exists
12522 set fpclass d_fpclass
12525 : see if fpclassify exists
12526 set fpclassify d_fpclassify
12529 : see if fpclassl exists
12530 set fpclassl d_fpclassl
12534 : check for fpos64_t
12536 echo "Checking to see if you have fpos64_t..." >&4
12539 int main() { fpos64_t x = 7; }
12542 if eval $compile; then
12544 echo "You have fpos64_t."
12547 echo "You do not have fpos64_t."
12548 case "$fpossize" in
12549 8) echo "(Your fpos_t is 64 bits, so you could use that.)" ;;
12556 : see if frexpl exists
12557 set frexpl d_frexpl
12560 : see if this is a sys/param system
12561 set sys/param.h i_sysparam
12564 : see if this is a sys/mount.h system
12565 set sys/mount.h i_sysmount
12570 echo "Checking to see if your system supports struct fs_data..." >&4
12571 set d_fs_data_s fs_data $i_systypes sys/types.h $i_sysparam sys/param.h $i_sysmount sys/mount.h
12573 case "$d_fs_data_s" in
12574 "$define") echo "Yes, it does." ;;
12575 *) echo "No, it doesn't." ;;
12578 : see if fseeko exists
12579 set fseeko d_fseeko
12581 case "$longsize" in
12582 8) echo "(Your long is 64 bits, so you could use fseek.)" ;;
12585 : see if fsetpos exists
12586 set fsetpos d_fsetpos
12590 : see if fstatfs exists
12591 set fstatfs d_fstatfs
12595 : see if statvfs exists
12596 set statvfs d_statvfs
12599 : see if fstatvfs exists
12600 set fstatvfs d_fstatvfs
12604 : see if fsync exists
12608 : see if ftello exists
12609 set ftello d_ftello
12611 case "$longsize" in
12612 8) echo "(Your long is 64 bits, so you could use ftell.)" ;;
12616 : check for a working futimes
12618 echo "Checking for a working futimes()" >&4
12621 #include <sys/time.h>
12628 fd = open ("try.c", O_RDWR);
12629 if (-1 == fd) exit (1);
12630 rv = futimes (fd, NULL);
12631 exit (rv == -1 ? errno : 0);
12635 if eval $compile; then
12639 0) echo "Yes, it does" >&4
12640 d_futimes="$define"
12642 *) echo "No, it has futimes, but it isn't working ($rc) (probably harmless)\n" >&4
12646 echo "No, it does not (probably harmless)\n" >&4
12648 $rm -f try.* try core core.try.*
12650 : see if getcwd exists
12651 set getcwd d_getcwd
12654 : see if getespwnam exists
12655 set getespwnam d_getespwnam
12659 : see if getfsstat exists
12660 set getfsstat d_getfsstat
12663 : see if getgrent exists
12664 set getgrent d_getgrent
12667 : see if getgrent_r exists
12668 set getgrent_r d_getgrent_r
12670 case "$d_getgrent_r" in
12672 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
12673 case "$d_getgrent_r_proto:$usethreads" in
12674 ":define") d_getgrent_r_proto=define
12675 set d_getgrent_r_proto getgrent_r $hdrs
12679 case "$d_getgrent_r_proto" in
12681 case "$getgrent_r_proto" in
12682 ''|0) try='int getgrent_r(struct group*, char*, size_t, struct group**);'
12683 ./protochk "extern $try" $hdrs && getgrent_r_proto=I_SBWR ;;
12685 case "$getgrent_r_proto" in
12686 ''|0) try='int getgrent_r(struct group*, char*, int, struct group**);'
12687 ./protochk "extern $try" $hdrs && getgrent_r_proto=I_SBIR ;;
12689 case "$getgrent_r_proto" in
12690 ''|0) try='struct group* getgrent_r(struct group*, char*, size_t);'
12691 ./protochk "extern $try" $hdrs && getgrent_r_proto=S_SBW ;;
12693 case "$getgrent_r_proto" in
12694 ''|0) try='struct group* getgrent_r(struct group*, char*, int);'
12695 ./protochk "extern $try" $hdrs && getgrent_r_proto=S_SBI ;;
12697 case "$getgrent_r_proto" in
12698 ''|0) try='int getgrent_r(struct group*, char*, int);'
12699 ./protochk "extern $try" $hdrs && getgrent_r_proto=I_SBI ;;
12701 case "$getgrent_r_proto" in
12702 ''|0) try='int getgrent_r(struct group*, char*, int, FILE**);'
12703 ./protochk "extern $try" $hdrs && getgrent_r_proto=I_SBIH ;;
12705 case "$getgrent_r_proto" in
12706 ''|0) d_getgrent_r=undef
12708 echo "Disabling getgrent_r, cannot determine prototype." >&4 ;;
12709 * ) case "$getgrent_r_proto" in
12710 REENTRANT_PROTO*) ;;
12711 *) getgrent_r_proto="REENTRANT_PROTO_$getgrent_r_proto" ;;
12713 echo "Prototype: $try" ;;
12716 *) case "$usethreads" in
12717 define) echo "getgrent_r has no prototype, not using it." >&4 ;;
12724 *) getgrent_r_proto=0
12728 : see if getgrgid_r exists
12729 set getgrgid_r d_getgrgid_r
12731 case "$d_getgrgid_r" in
12733 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
12734 case "$d_getgrgid_r_proto:$usethreads" in
12735 ":define") d_getgrgid_r_proto=define
12736 set d_getgrgid_r_proto getgrgid_r $hdrs
12740 case "$d_getgrgid_r_proto" in
12742 case "$getgrgid_r_proto" in
12743 ''|0) try='int getgrgid_r(gid_t, struct group*, char*, size_t, struct group**);'
12744 ./protochk "extern $try" $hdrs && getgrgid_r_proto=I_TSBWR ;;
12746 case "$getgrgid_r_proto" in
12747 ''|0) try='int getgrgid_r(gid_t, struct group*, char*, int, struct group**);'
12748 ./protochk "extern $try" $hdrs && getgrgid_r_proto=I_TSBIR ;;
12750 case "$getgrgid_r_proto" in
12751 ''|0) try='int getgrgid_r(gid_t, struct group*, char*, int);'
12752 ./protochk "extern $try" $hdrs && getgrgid_r_proto=I_TSBI ;;
12754 case "$getgrgid_r_proto" in
12755 ''|0) try='struct group* getgrgid_r(gid_t, struct group*, char*, int);'
12756 ./protochk "extern $try" $hdrs && getgrgid_r_proto=S_TSBI ;;
12758 case "$getgrgid_r_proto" in
12759 ''|0) d_getgrgid_r=undef
12761 echo "Disabling getgrgid_r, cannot determine prototype." >&4 ;;
12762 * ) case "$getgrgid_r_proto" in
12763 REENTRANT_PROTO*) ;;
12764 *) getgrgid_r_proto="REENTRANT_PROTO_$getgrgid_r_proto" ;;
12766 echo "Prototype: $try" ;;
12769 *) case "$usethreads" in
12770 define) echo "getgrgid_r has no prototype, not using it." >&4 ;;
12777 *) getgrgid_r_proto=0
12781 : see if getgrnam_r exists
12782 set getgrnam_r d_getgrnam_r
12784 case "$d_getgrnam_r" in
12786 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
12787 case "$d_getgrnam_r_proto:$usethreads" in
12788 ":define") d_getgrnam_r_proto=define
12789 set d_getgrnam_r_proto getgrnam_r $hdrs
12793 case "$d_getgrnam_r_proto" in
12795 case "$getgrnam_r_proto" in
12796 ''|0) try='int getgrnam_r(const char*, struct group*, char*, size_t, struct group**);'
12797 ./protochk "extern $try" $hdrs && getgrnam_r_proto=I_CSBWR ;;
12799 case "$getgrnam_r_proto" in
12800 ''|0) try='int getgrnam_r(const char*, struct group*, char*, int, struct group**);'
12801 ./protochk "extern $try" $hdrs && getgrnam_r_proto=I_CSBIR ;;
12803 case "$getgrnam_r_proto" in
12804 ''|0) try='struct group* getgrnam_r(const char*, char*, int);'
12805 ./protochk "extern $try" $hdrs && getgrnam_r_proto=S_CBI ;;
12807 case "$getgrnam_r_proto" in
12808 ''|0) try='int getgrnam_r(const char*, struct group*, char*, int);'
12809 ./protochk "extern $try" $hdrs && getgrnam_r_proto=I_CSBI ;;
12811 case "$getgrnam_r_proto" in
12812 ''|0) try='struct group* getgrnam_r(const char*, struct group*, char*, int);'
12813 ./protochk "extern $try" $hdrs && getgrnam_r_proto=S_CSBI ;;
12815 case "$getgrnam_r_proto" in
12816 ''|0) d_getgrnam_r=undef
12818 echo "Disabling getgrnam_r, cannot determine prototype." >&4 ;;
12819 * ) case "$getgrnam_r_proto" in
12820 REENTRANT_PROTO*) ;;
12821 *) getgrnam_r_proto="REENTRANT_PROTO_$getgrnam_r_proto" ;;
12823 echo "Prototype: $try" ;;
12826 *) case "$usethreads" in
12827 define) echo "getgrnam_r has no prototype, not using it." >&4 ;;
12834 *) getgrnam_r_proto=0
12838 : see if gethostbyaddr exists
12839 set gethostbyaddr d_gethbyaddr
12842 : see if gethostbyname exists
12843 set gethostbyname d_gethbyname
12846 : see if gethostent exists
12847 set gethostent d_gethent
12850 : see how we will look up host name
12853 if set gethostname val -f d_gethname; eval $csym; $val; then
12854 echo 'gethostname() found.' >&4
12855 d_gethname="$define"
12858 if set uname val -f d_uname; eval $csym; $val; then
12861 uname() was found, but you're running xenix, and older versions of xenix
12862 have a broken uname(). If you don't really know whether your xenix is old
12863 enough to have a broken system call, use the default answer.
12868 "$define") dflt=n;;
12870 rp='Is your uname() broken?'
12873 n*) d_uname="$define"; call=uname;;
12876 echo 'uname() found.' >&4
12883 case "$d_gethname" in
12884 '') d_gethname="$undef";;
12887 '') d_uname="$undef";;
12889 case "$d_uname$d_gethname" in
12894 Every now and then someone has a $call() that lies about the hostname
12895 but can't be fixed for political or economic reasons. If you wish, I can
12896 pretend $call() isn't there and maybe compute hostname at run-time
12897 thanks to the '$phostname' command.
12900 rp="Shall I ignore $call() from now on?"
12903 y*) d_uname="$undef" d_gethname="$undef"; $echo $n "Okay...$c";;
12906 case "$phostname" in
12907 '') aphostname='';;
12908 *) case "$aphostname" in
12910 *) set X $phostname
12914 file=`./loc $file $file $pth`
12915 aphostname=`echo $file $*`
12920 case "$d_uname$d_gethname" in
12923 case "$phostname" in
12925 echo "There will be no way for $package to get your hostname." >&4;;
12927 echo "I'll use 'popen("'"'$aphostname'", "r")'"' to get your hostname." >&4
12931 case "$d_phostname" in
12932 '') d_phostname="$undef";;
12935 : see if gethostbyaddr_r exists
12936 set gethostbyaddr_r d_gethostbyaddr_r
12938 case "$d_gethostbyaddr_r" in
12940 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
12941 case "$d_gethostbyaddr_r_proto:$usethreads" in
12942 ":define") d_gethostbyaddr_r_proto=define
12943 set d_gethostbyaddr_r_proto gethostbyaddr_r $hdrs
12947 case "$d_gethostbyaddr_r_proto" in
12949 case "$gethostbyaddr_r_proto" in
12950 ''|0) try='int gethostbyaddr_r(const char*, size_t, int, struct hostent*, char*, size_t, struct hostent**, int*);'
12951 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=I_CWISBWRE ;;
12953 case "$gethostbyaddr_r_proto" in
12954 ''|0) try='struct hostent* gethostbyaddr_r(const char*, size_t, int, struct hostent*, char*, size_t, int, int*);'
12955 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=S_CWISBWIE ;;
12957 case "$gethostbyaddr_r_proto" in
12958 ''|0) try='struct hostent* gethostbyaddr_r(const char*, size_t, int, struct hostent*, char*, int, int*);'
12959 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=S_CWISBIE ;;
12961 case "$gethostbyaddr_r_proto" in
12962 ''|0) try='struct hostent* gethostbyaddr_r(const void*, size_t, int, struct hostent*, char*, int, int*);'
12963 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=S_TWISBIE ;;
12965 case "$gethostbyaddr_r_proto" in
12966 ''|0) try='struct hostent* gethostbyaddr_r(const char*, int, int, struct hostent*, char*, int, int*);'
12967 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=S_CIISBIE ;;
12969 case "$gethostbyaddr_r_proto" in
12970 ''|0) try='struct hostent* gethostbyaddr_r(const char*, struct hostent*, char*, int, int*);'
12971 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=S_CSBIE ;;
12973 case "$gethostbyaddr_r_proto" in
12974 ''|0) try='struct hostent* gethostbyaddr_r(const void*, struct hostent*, char*, int, int*);'
12975 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=S_TSBIE ;;
12977 case "$gethostbyaddr_r_proto" in
12978 ''|0) try='int gethostbyaddr_r(const char*, size_t, int, struct hostent*, struct hostent_data*);'
12979 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=I_CWISD ;;
12981 case "$gethostbyaddr_r_proto" in
12982 ''|0) try='int gethostbyaddr_r(const char*, int, int, struct hostent*, struct hostent_data*);'
12983 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=I_CIISD ;;
12985 case "$gethostbyaddr_r_proto" in
12986 ''|0) try='int gethostbyaddr_r(const char*, int, int);'
12987 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=I_CII ;;
12989 case "$gethostbyaddr_r_proto" in
12990 ''|0) try='int gethostbyaddr_r(const void*, socklen_t, int, struct hostent*, char*, size_t, struct hostent**, int*);'
12991 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=I_TsISBWRE ;;
12993 case "$gethostbyaddr_r_proto" in
12994 ''|0) d_gethostbyaddr_r=undef
12995 gethostbyaddr_r_proto=0
12996 echo "Disabling gethostbyaddr_r, cannot determine prototype." >&4 ;;
12997 * ) case "$gethostbyaddr_r_proto" in
12998 REENTRANT_PROTO*) ;;
12999 *) gethostbyaddr_r_proto="REENTRANT_PROTO_$gethostbyaddr_r_proto" ;;
13001 echo "Prototype: $try" ;;
13004 *) case "$usethreads" in
13005 define) echo "gethostbyaddr_r has no prototype, not using it." >&4 ;;
13007 d_gethostbyaddr_r=undef
13008 gethostbyaddr_r_proto=0
13012 *) gethostbyaddr_r_proto=0
13016 : see if gethostbyname_r exists
13017 set gethostbyname_r d_gethostbyname_r
13019 case "$d_gethostbyname_r" in
13021 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13022 case "$d_gethostbyname_r_proto:$usethreads" in
13023 ":define") d_gethostbyname_r_proto=define
13024 set d_gethostbyname_r_proto gethostbyname_r $hdrs
13028 case "$d_gethostbyname_r_proto" in
13030 case "$gethostbyname_r_proto" in
13031 ''|0) try='int gethostbyname_r(const char*, struct hostent*, char*, size_t, struct hostent**, int*);'
13032 ./protochk "extern $try" $hdrs && gethostbyname_r_proto=I_CSBWRE ;;
13034 case "$gethostbyname_r_proto" in
13035 ''|0) try='struct hostent* gethostbyname_r(const char*, struct hostent*, char*, int, int*);'
13036 ./protochk "extern $try" $hdrs && gethostbyname_r_proto=S_CSBIE ;;
13038 case "$gethostbyname_r_proto" in
13039 ''|0) try='int gethostbyname_r(const char*, struct hostent*, struct hostent_data*);'
13040 ./protochk "extern $try" $hdrs && gethostbyname_r_proto=I_CSD ;;
13042 case "$gethostbyname_r_proto" in
13043 ''|0) d_gethostbyname_r=undef
13044 gethostbyname_r_proto=0
13045 echo "Disabling gethostbyname_r, cannot determine prototype." >&4 ;;
13046 * ) case "$gethostbyname_r_proto" in
13047 REENTRANT_PROTO*) ;;
13048 *) gethostbyname_r_proto="REENTRANT_PROTO_$gethostbyname_r_proto" ;;
13050 echo "Prototype: $try" ;;
13053 *) case "$usethreads" in
13054 define) echo "gethostbyname_r has no prototype, not using it." >&4 ;;
13056 d_gethostbyname_r=undef
13057 gethostbyname_r_proto=0
13061 *) gethostbyname_r_proto=0
13065 : see if gethostent_r exists
13066 set gethostent_r d_gethostent_r
13068 case "$d_gethostent_r" in
13070 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13071 case "$d_gethostent_r_proto:$usethreads" in
13072 ":define") d_gethostent_r_proto=define
13073 set d_gethostent_r_proto gethostent_r $hdrs
13077 case "$d_gethostent_r_proto" in
13079 case "$gethostent_r_proto" in
13080 ''|0) try='int gethostent_r(struct hostent*, char*, size_t, struct hostent**, int*);'
13081 ./protochk "extern $try" $hdrs && gethostent_r_proto=I_SBWRE ;;
13083 case "$gethostent_r_proto" in
13084 ''|0) try='int gethostent_r(struct hostent*, char*, int, int*);'
13085 ./protochk "extern $try" $hdrs && gethostent_r_proto=I_SBIE ;;
13087 case "$gethostent_r_proto" in
13088 ''|0) try='struct hostent* gethostent_r(struct hostent*, char*, int, int*);'
13089 ./protochk "extern $try" $hdrs && gethostent_r_proto=S_SBIE ;;
13091 case "$gethostent_r_proto" in
13092 ''|0) try='struct hostent* gethostent_r(struct hostent*, char*, int);'
13093 ./protochk "extern $try" $hdrs && gethostent_r_proto=S_SBI ;;
13095 case "$gethostent_r_proto" in
13096 ''|0) try='int gethostent_r(struct hostent*, char*, int);'
13097 ./protochk "extern $try" $hdrs && gethostent_r_proto=I_SBI ;;
13099 case "$gethostent_r_proto" in
13100 ''|0) try='int gethostent_r(struct hostent*, struct hostent_data*);'
13101 ./protochk "extern $try" $hdrs && gethostent_r_proto=I_SD ;;
13103 case "$gethostent_r_proto" in
13104 ''|0) d_gethostent_r=undef
13105 gethostent_r_proto=0
13106 echo "Disabling gethostent_r, cannot determine prototype." >&4 ;;
13107 * ) case "$gethostent_r_proto" in
13108 REENTRANT_PROTO*) ;;
13109 *) gethostent_r_proto="REENTRANT_PROTO_$gethostent_r_proto" ;;
13111 echo "Prototype: $try" ;;
13114 *) case "$usethreads" in
13115 define) echo "gethostent_r has no prototype, not using it." >&4 ;;
13117 d_gethostent_r=undef
13118 gethostent_r_proto=0
13122 *) gethostent_r_proto=0
13126 : see if prototypes for various gethostxxx netdb.h functions are available
13128 set d_gethostprotos gethostent $i_netdb netdb.h
13131 : see if getitimer exists
13132 set getitimer d_getitimer
13135 : see if getlogin exists
13136 set getlogin d_getlogin
13139 : see if getlogin_r exists
13140 set getlogin_r d_getlogin_r
13142 case "$d_getlogin_r" in
13144 hdrs="$i_systypes sys/types.h define stdio.h $i_unistd unistd.h"
13145 case "$d_getlogin_r_proto:$usethreads" in
13146 ":define") d_getlogin_r_proto=define
13147 set d_getlogin_r_proto getlogin_r $hdrs
13151 case "$d_getlogin_r_proto" in
13153 case "$getlogin_r_proto" in
13154 ''|0) try='int getlogin_r(char*, size_t);'
13155 ./protochk "extern $try" $hdrs && getlogin_r_proto=I_BW ;;
13157 case "$getlogin_r_proto" in
13158 ''|0) try='int getlogin_r(char*, int);'
13159 ./protochk "extern $try" $hdrs && getlogin_r_proto=I_BI ;;
13161 case "$getlogin_r_proto" in
13162 ''|0) try='char* getlogin_r(char*, size_t);'
13163 ./protochk "extern $try" $hdrs && getlogin_r_proto=B_BW ;;
13165 case "$getlogin_r_proto" in
13166 ''|0) try='char* getlogin_r(char*, int);'
13167 ./protochk "extern $try" $hdrs && getlogin_r_proto=B_BI ;;
13169 case "$getlogin_r_proto" in
13170 ''|0) d_getlogin_r=undef
13172 echo "Disabling getlogin_r, cannot determine prototype." >&4 ;;
13173 * ) case "$getlogin_r_proto" in
13174 REENTRANT_PROTO*) ;;
13175 *) getlogin_r_proto="REENTRANT_PROTO_$getlogin_r_proto" ;;
13177 echo "Prototype: $try" ;;
13180 *) case "$usethreads" in
13181 define) echo "getlogin_r has no prototype, not using it." >&4 ;;
13188 *) getlogin_r_proto=0
13192 : see if getmnt exists
13193 set getmnt d_getmnt
13196 : see if getmntent exists
13197 set getmntent d_getmntent
13200 : see if getnetbyaddr exists
13201 set getnetbyaddr d_getnbyaddr
13204 : see if getnetbyname exists
13205 set getnetbyname d_getnbyname
13208 : see if getnetent exists
13209 set getnetent d_getnent
13212 : see if getnetbyaddr_r exists
13213 set getnetbyaddr_r d_getnetbyaddr_r
13215 case "$d_getnetbyaddr_r" in
13217 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13218 case "$d_getnetbyaddr_r_proto:$usethreads" in
13219 ":define") d_getnetbyaddr_r_proto=define
13220 set d_getnetbyaddr_r_proto getnetbyaddr_r $hdrs
13224 case "$d_getnetbyaddr_r_proto" in
13226 case "$getnetbyaddr_r_proto" in
13227 ''|0) try='int getnetbyaddr_r(unsigned long, int, struct netent*, char*, size_t, struct netent**, int*);'
13228 ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=I_UISBWRE ;;
13230 case "$getnetbyaddr_r_proto" in
13231 ''|0) try='int getnetbyaddr_r(long, int, struct netent*, char*, int);'
13232 ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=I_LISBI ;;
13234 case "$getnetbyaddr_r_proto" in
13235 ''|0) try='struct netent* getnetbyaddr_r(in_addr_t, int, struct netent*, char*, int);'
13236 ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=S_TISBI ;;
13238 case "$getnetbyaddr_r_proto" in
13239 ''|0) try='struct netent* getnetbyaddr_r(long, int, struct netent*, char*, int);'
13240 ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=S_LISBI ;;
13242 case "$getnetbyaddr_r_proto" in
13243 ''|0) try='int getnetbyaddr_r(in_addr_t, int, struct netent*, struct netent_data*);'
13244 ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=I_TISD ;;
13246 case "$getnetbyaddr_r_proto" in
13247 ''|0) try='int getnetbyaddr_r(long, int, struct netent*, struct netent_data*);'
13248 ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=I_LISD ;;
13250 case "$getnetbyaddr_r_proto" in
13251 ''|0) try='int getnetbyaddr_r(int, int, struct netent*, struct netent_data*);'
13252 ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=I_IISD ;;
13254 case "$getnetbyaddr_r_proto" in
13255 ''|0) try='int getnetbyaddr_r(uint32_t, int, struct netent*, char*, size_t, struct netent**, int*);'
13256 ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=I_uISBWRE ;;
13258 case "$getnetbyaddr_r_proto" in
13259 ''|0) d_getnetbyaddr_r=undef
13260 getnetbyaddr_r_proto=0
13261 echo "Disabling getnetbyaddr_r, cannot determine prototype." >&4 ;;
13262 * ) case "$getnetbyaddr_r_proto" in
13263 REENTRANT_PROTO*) ;;
13264 *) getnetbyaddr_r_proto="REENTRANT_PROTO_$getnetbyaddr_r_proto" ;;
13266 echo "Prototype: $try" ;;
13269 *) case "$usethreads" in
13270 define) echo "getnetbyaddr_r has no prototype, not using it." >&4 ;;
13272 d_getnetbyaddr_r=undef
13273 getnetbyaddr_r_proto=0
13277 *) getnetbyaddr_r_proto=0
13281 : see if getnetbyname_r exists
13282 set getnetbyname_r d_getnetbyname_r
13284 case "$d_getnetbyname_r" in
13286 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13287 case "$d_getnetbyname_r_proto:$usethreads" in
13288 ":define") d_getnetbyname_r_proto=define
13289 set d_getnetbyname_r_proto getnetbyname_r $hdrs
13293 case "$d_getnetbyname_r_proto" in
13295 case "$getnetbyname_r_proto" in
13296 ''|0) try='int getnetbyname_r(const char*, struct netent*, char*, size_t, struct netent**, int*);'
13297 ./protochk "extern $try" $hdrs && getnetbyname_r_proto=I_CSBWRE ;;
13299 case "$getnetbyname_r_proto" in
13300 ''|0) try='int getnetbyname_r(const char*, struct netent*, char*, int);'
13301 ./protochk "extern $try" $hdrs && getnetbyname_r_proto=I_CSBI ;;
13303 case "$getnetbyname_r_proto" in
13304 ''|0) try='struct netent* getnetbyname_r(const char*, struct netent*, char*, int);'
13305 ./protochk "extern $try" $hdrs && getnetbyname_r_proto=S_CSBI ;;
13307 case "$getnetbyname_r_proto" in
13308 ''|0) try='int getnetbyname_r(const char*, struct netent*, struct netent_data*);'
13309 ./protochk "extern $try" $hdrs && getnetbyname_r_proto=I_CSD ;;
13311 case "$getnetbyname_r_proto" in
13312 ''|0) d_getnetbyname_r=undef
13313 getnetbyname_r_proto=0
13314 echo "Disabling getnetbyname_r, cannot determine prototype." >&4 ;;
13315 * ) case "$getnetbyname_r_proto" in
13316 REENTRANT_PROTO*) ;;
13317 *) getnetbyname_r_proto="REENTRANT_PROTO_$getnetbyname_r_proto" ;;
13319 echo "Prototype: $try" ;;
13322 *) case "$usethreads" in
13323 define) echo "getnetbyname_r has no prototype, not using it." >&4 ;;
13325 d_getnetbyname_r=undef
13326 getnetbyname_r_proto=0
13330 *) getnetbyname_r_proto=0
13334 : see if getnetent_r exists
13335 set getnetent_r d_getnetent_r
13337 case "$d_getnetent_r" in
13339 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13340 case "$d_getnetent_r_proto:$usethreads" in
13341 ":define") d_getnetent_r_proto=define
13342 set d_getnetent_r_proto getnetent_r $hdrs
13346 case "$d_getnetent_r_proto" in
13348 case "$getnetent_r_proto" in
13349 ''|0) try='int getnetent_r(struct netent*, char*, size_t, struct netent**, int*);'
13350 ./protochk "extern $try" $hdrs && getnetent_r_proto=I_SBWRE ;;
13352 case "$getnetent_r_proto" in
13353 ''|0) try='int getnetent_r(struct netent*, char*, int, int*);'
13354 ./protochk "extern $try" $hdrs && getnetent_r_proto=I_SBIE ;;
13356 case "$getnetent_r_proto" in
13357 ''|0) try='struct netent* getnetent_r(struct netent*, char*, int, int*);'
13358 ./protochk "extern $try" $hdrs && getnetent_r_proto=S_SBIE ;;
13360 case "$getnetent_r_proto" in
13361 ''|0) try='struct netent* getnetent_r(struct netent*, char*, int);'
13362 ./protochk "extern $try" $hdrs && getnetent_r_proto=S_SBI ;;
13364 case "$getnetent_r_proto" in
13365 ''|0) try='int getnetent_r(struct netent*, char*, int);'
13366 ./protochk "extern $try" $hdrs && getnetent_r_proto=I_SBI ;;
13368 case "$getnetent_r_proto" in
13369 ''|0) try='int getnetent_r(struct netent*, struct netent_data*);'
13370 ./protochk "extern $try" $hdrs && getnetent_r_proto=I_SD ;;
13372 case "$getnetent_r_proto" in
13373 ''|0) d_getnetent_r=undef
13374 getnetent_r_proto=0
13375 echo "Disabling getnetent_r, cannot determine prototype." >&4 ;;
13376 * ) case "$getnetent_r_proto" in
13377 REENTRANT_PROTO*) ;;
13378 *) getnetent_r_proto="REENTRANT_PROTO_$getnetent_r_proto" ;;
13380 echo "Prototype: $try" ;;
13383 *) case "$usethreads" in
13384 define) echo "getnetent_r has no prototype, not using it." >&4 ;;
13386 d_getnetent_r=undef
13387 getnetent_r_proto=0
13391 *) getnetent_r_proto=0
13395 : see if prototypes for various getnetxxx netdb.h functions are available
13397 set d_getnetprotos getnetent $i_netdb netdb.h
13400 : see if getpagesize exists
13401 set getpagesize d_getpagsz
13405 : see if getprotobyname exists
13406 set getprotobyname d_getpbyname
13409 : see if getprotobynumber exists
13410 set getprotobynumber d_getpbynumber
13413 : see if getprotoent exists
13414 set getprotoent d_getpent
13417 : see if getpgid exists
13418 set getpgid d_getpgid
13421 : see if getpgrp2 exists
13422 set getpgrp2 d_getpgrp2
13425 : see if getppid exists
13426 set getppid d_getppid
13429 : see if getpriority exists
13430 set getpriority d_getprior
13433 : see if getprotobyname_r exists
13434 set getprotobyname_r d_getprotobyname_r
13436 case "$d_getprotobyname_r" in
13438 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13439 case "$d_getprotobyname_r_proto:$usethreads" in
13440 ":define") d_getprotobyname_r_proto=define
13441 set d_getprotobyname_r_proto getprotobyname_r $hdrs
13445 case "$d_getprotobyname_r_proto" in
13447 case "$getprotobyname_r_proto" in
13448 ''|0) try='int getprotobyname_r(const char*, struct protoent*, char*, size_t, struct protoent**);'
13449 ./protochk "extern $try" $hdrs && getprotobyname_r_proto=I_CSBWR ;;
13451 case "$getprotobyname_r_proto" in
13452 ''|0) try='struct protoent* getprotobyname_r(const char*, struct protoent*, char*, int);'
13453 ./protochk "extern $try" $hdrs && getprotobyname_r_proto=S_CSBI ;;
13455 case "$getprotobyname_r_proto" in
13456 ''|0) try='int getprotobyname_r(const char*, struct protoent*, struct protoent_data*);'
13457 ./protochk "extern $try" $hdrs && getprotobyname_r_proto=I_CSD ;;
13459 case "$getprotobyname_r_proto" in
13460 ''|0) d_getprotobyname_r=undef
13461 getprotobyname_r_proto=0
13462 echo "Disabling getprotobyname_r, cannot determine prototype." >&4 ;;
13463 * ) case "$getprotobyname_r_proto" in
13464 REENTRANT_PROTO*) ;;
13465 *) getprotobyname_r_proto="REENTRANT_PROTO_$getprotobyname_r_proto" ;;
13467 echo "Prototype: $try" ;;
13470 *) case "$usethreads" in
13471 define) echo "getprotobyname_r has no prototype, not using it." >&4 ;;
13473 d_getprotobyname_r=undef
13474 getprotobyname_r_proto=0
13478 *) getprotobyname_r_proto=0
13482 : see if getprotobynumber_r exists
13483 set getprotobynumber_r d_getprotobynumber_r
13485 case "$d_getprotobynumber_r" in
13487 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13488 case "$d_getprotobynumber_r_proto:$usethreads" in
13489 ":define") d_getprotobynumber_r_proto=define
13490 set d_getprotobynumber_r_proto getprotobynumber_r $hdrs
13494 case "$d_getprotobynumber_r_proto" in
13496 case "$getprotobynumber_r_proto" in
13497 ''|0) try='int getprotobynumber_r(int, struct protoent*, char*, size_t, struct protoent**);'
13498 ./protochk "extern $try" $hdrs && getprotobynumber_r_proto=I_ISBWR ;;
13500 case "$getprotobynumber_r_proto" in
13501 ''|0) try='struct protoent* getprotobynumber_r(int, struct protoent*, char*, int);'
13502 ./protochk "extern $try" $hdrs && getprotobynumber_r_proto=S_ISBI ;;
13504 case "$getprotobynumber_r_proto" in
13505 ''|0) try='int getprotobynumber_r(int, struct protoent*, struct protoent_data*);'
13506 ./protochk "extern $try" $hdrs && getprotobynumber_r_proto=I_ISD ;;
13508 case "$getprotobynumber_r_proto" in
13509 ''|0) d_getprotobynumber_r=undef
13510 getprotobynumber_r_proto=0
13511 echo "Disabling getprotobynumber_r, cannot determine prototype." >&4 ;;
13512 * ) case "$getprotobynumber_r_proto" in
13513 REENTRANT_PROTO*) ;;
13514 *) getprotobynumber_r_proto="REENTRANT_PROTO_$getprotobynumber_r_proto" ;;
13516 echo "Prototype: $try" ;;
13519 *) case "$usethreads" in
13520 define) echo "getprotobynumber_r has no prototype, not using it." >&4 ;;
13522 d_getprotobynumber_r=undef
13523 getprotobynumber_r_proto=0
13527 *) getprotobynumber_r_proto=0
13531 : see if getprotoent_r exists
13532 set getprotoent_r d_getprotoent_r
13534 case "$d_getprotoent_r" in
13536 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13537 case "$d_getprotoent_r_proto:$usethreads" in
13538 ":define") d_getprotoent_r_proto=define
13539 set d_getprotoent_r_proto getprotoent_r $hdrs
13543 case "$d_getprotoent_r_proto" in
13545 case "$getprotoent_r_proto" in
13546 ''|0) try='int getprotoent_r(struct protoent*, char*, size_t, struct protoent**);'
13547 ./protochk "extern $try" $hdrs && getprotoent_r_proto=I_SBWR ;;
13549 case "$getprotoent_r_proto" in
13550 ''|0) try='int getprotoent_r(struct protoent*, char*, int);'
13551 ./protochk "extern $try" $hdrs && getprotoent_r_proto=I_SBI ;;
13553 case "$getprotoent_r_proto" in
13554 ''|0) try='struct protoent* getprotoent_r(struct protoent*, char*, int);'
13555 ./protochk "extern $try" $hdrs && getprotoent_r_proto=S_SBI ;;
13557 case "$getprotoent_r_proto" in
13558 ''|0) try='int getprotoent_r(struct protoent*, struct protoent_data*);'
13559 ./protochk "extern $try" $hdrs && getprotoent_r_proto=I_SD ;;
13561 case "$getprotoent_r_proto" in
13562 ''|0) d_getprotoent_r=undef
13563 getprotoent_r_proto=0
13564 echo "Disabling getprotoent_r, cannot determine prototype." >&4 ;;
13565 * ) case "$getprotoent_r_proto" in
13566 REENTRANT_PROTO*) ;;
13567 *) getprotoent_r_proto="REENTRANT_PROTO_$getprotoent_r_proto" ;;
13569 echo "Prototype: $try" ;;
13572 *) case "$usethreads" in
13573 define) echo "getprotoent_r has no prototype, not using it." >&4 ;;
13575 d_getprotoent_r=undef
13576 getprotoent_r_proto=0
13580 *) getprotoent_r_proto=0
13584 : see if prototypes for various getprotoxxx netdb.h functions are available
13586 set d_getprotoprotos getprotoent $i_netdb netdb.h
13589 : see if getprpwnam exists
13590 set getprpwnam d_getprpwnam
13593 : see if getpwent exists
13594 set getpwent d_getpwent
13597 : see if getpwent_r exists
13598 set getpwent_r d_getpwent_r
13600 case "$d_getpwent_r" in
13602 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
13603 case "$d_getpwent_r_proto:$usethreads" in
13604 ":define") d_getpwent_r_proto=define
13605 set d_getpwent_r_proto getpwent_r $hdrs
13609 case "$d_getpwent_r_proto" in
13611 case "$getpwent_r_proto" in
13612 ''|0) try='int getpwent_r(struct passwd*, char*, size_t, struct passwd**);'
13613 ./protochk "extern $try" $hdrs && getpwent_r_proto=I_SBWR ;;
13615 case "$getpwent_r_proto" in
13616 ''|0) try='int getpwent_r(struct passwd*, char*, int, struct passwd**);'
13617 ./protochk "extern $try" $hdrs && getpwent_r_proto=I_SBIR ;;
13619 case "$getpwent_r_proto" in
13620 ''|0) try='struct passwd* getpwent_r(struct passwd*, char*, size_t);'
13621 ./protochk "extern $try" $hdrs && getpwent_r_proto=S_SBW ;;
13623 case "$getpwent_r_proto" in
13624 ''|0) try='struct passwd* getpwent_r(struct passwd*, char*, int);'
13625 ./protochk "extern $try" $hdrs && getpwent_r_proto=S_SBI ;;
13627 case "$getpwent_r_proto" in
13628 ''|0) try='int getpwent_r(struct passwd*, char*, int);'
13629 ./protochk "extern $try" $hdrs && getpwent_r_proto=I_SBI ;;
13631 case "$getpwent_r_proto" in
13632 ''|0) try='int getpwent_r(struct passwd*, char*, int, FILE**);'
13633 ./protochk "extern $try" $hdrs && getpwent_r_proto=I_SBIH ;;
13635 case "$getpwent_r_proto" in
13636 ''|0) d_getpwent_r=undef
13638 echo "Disabling getpwent_r, cannot determine prototype." >&4 ;;
13639 * ) case "$getpwent_r_proto" in
13640 REENTRANT_PROTO*) ;;
13641 *) getpwent_r_proto="REENTRANT_PROTO_$getpwent_r_proto" ;;
13643 echo "Prototype: $try" ;;
13646 *) case "$usethreads" in
13647 define) echo "getpwent_r has no prototype, not using it." >&4 ;;
13654 *) getpwent_r_proto=0
13658 : see if getpwnam_r exists
13659 set getpwnam_r d_getpwnam_r
13661 case "$d_getpwnam_r" in
13663 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
13664 case "$d_getpwnam_r_proto:$usethreads" in
13665 ":define") d_getpwnam_r_proto=define
13666 set d_getpwnam_r_proto getpwnam_r $hdrs
13670 case "$d_getpwnam_r_proto" in
13672 case "$getpwnam_r_proto" in
13673 ''|0) try='int getpwnam_r(const char*, struct passwd*, char*, size_t, struct passwd**);'
13674 ./protochk "extern $try" $hdrs && getpwnam_r_proto=I_CSBWR ;;
13676 case "$getpwnam_r_proto" in
13677 ''|0) try='int getpwnam_r(const char*, struct passwd*, char*, int, struct passwd**);'
13678 ./protochk "extern $try" $hdrs && getpwnam_r_proto=I_CSBIR ;;
13680 case "$getpwnam_r_proto" in
13681 ''|0) try='struct passwd* getpwnam_r(const char*, struct passwd*, char*, int);'
13682 ./protochk "extern $try" $hdrs && getpwnam_r_proto=S_CSBI ;;
13684 case "$getpwnam_r_proto" in
13685 ''|0) try='int getpwnam_r(const char*, struct passwd*, char*, int);'
13686 ./protochk "extern $try" $hdrs && getpwnam_r_proto=I_CSBI ;;
13688 case "$getpwnam_r_proto" in
13689 ''|0) d_getpwnam_r=undef
13691 echo "Disabling getpwnam_r, cannot determine prototype." >&4 ;;
13692 * ) case "$getpwnam_r_proto" in
13693 REENTRANT_PROTO*) ;;
13694 *) getpwnam_r_proto="REENTRANT_PROTO_$getpwnam_r_proto" ;;
13696 echo "Prototype: $try" ;;
13699 *) case "$usethreads" in
13700 define) echo "getpwnam_r has no prototype, not using it." >&4 ;;
13707 *) getpwnam_r_proto=0
13711 : see if getpwuid_r exists
13712 set getpwuid_r d_getpwuid_r
13714 case "$d_getpwuid_r" in
13716 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
13717 case "$d_getpwuid_r_proto:$usethreads" in
13718 ":define") d_getpwuid_r_proto=define
13719 set d_getpwuid_r_proto getpwuid_r $hdrs
13723 case "$d_getpwuid_r_proto" in
13725 case "$getpwuid_r_proto" in
13726 ''|0) try='int getpwuid_r(uid_t, struct passwd*, char*, size_t, struct passwd**);'
13727 ./protochk "extern $try" $hdrs && getpwuid_r_proto=I_TSBWR ;;
13729 case "$getpwuid_r_proto" in
13730 ''|0) try='int getpwuid_r(uid_t, struct passwd*, char*, int, struct passwd**);'
13731 ./protochk "extern $try" $hdrs && getpwuid_r_proto=I_TSBIR ;;
13733 case "$getpwuid_r_proto" in
13734 ''|0) try='int getpwuid_r(uid_t, struct passwd*, char*, int);'
13735 ./protochk "extern $try" $hdrs && getpwuid_r_proto=I_TSBI ;;
13737 case "$getpwuid_r_proto" in
13738 ''|0) try='struct passwd* getpwuid_r(uid_t, struct passwd*, char*, int);'
13739 ./protochk "extern $try" $hdrs && getpwuid_r_proto=S_TSBI ;;
13741 case "$getpwuid_r_proto" in
13742 ''|0) d_getpwuid_r=undef
13744 echo "Disabling getpwuid_r, cannot determine prototype." >&4 ;;
13745 * ) case "$getpwuid_r_proto" in
13746 REENTRANT_PROTO*) ;;
13747 *) getpwuid_r_proto="REENTRANT_PROTO_$getpwuid_r_proto" ;;
13749 echo "Prototype: $try" ;;
13752 *) case "$usethreads" in
13753 define) echo "getpwuid_r has no prototype, not using it." >&4 ;;
13760 *) getpwuid_r_proto=0
13765 : see if getservbyname exists
13766 set getservbyname d_getsbyname
13769 : see if getservbyport exists
13770 set getservbyport d_getsbyport
13773 : see if getservent exists
13774 set getservent d_getsent
13777 : see if getservbyname_r exists
13778 set getservbyname_r d_getservbyname_r
13780 case "$d_getservbyname_r" in
13782 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13783 case "$d_getservbyname_r_proto:$usethreads" in
13784 ":define") d_getservbyname_r_proto=define
13785 set d_getservbyname_r_proto getservbyname_r $hdrs
13789 case "$d_getservbyname_r_proto" in
13791 case "$getservbyname_r_proto" in
13792 ''|0) try='int getservbyname_r(const char*, const char*, struct servent*, char*, size_t, struct servent**);'
13793 ./protochk "extern $try" $hdrs && getservbyname_r_proto=I_CCSBWR ;;
13795 case "$getservbyname_r_proto" in
13796 ''|0) try='struct servent* getservbyname_r(const char*, const char*, struct servent*, char*, int);'
13797 ./protochk "extern $try" $hdrs && getservbyname_r_proto=S_CCSBI ;;
13799 case "$getservbyname_r_proto" in
13800 ''|0) try='int getservbyname_r(const char*, const char*, struct servent*, struct servent_data*);'
13801 ./protochk "extern $try" $hdrs && getservbyname_r_proto=I_CCSD ;;
13803 case "$getservbyname_r_proto" in
13804 ''|0) d_getservbyname_r=undef
13805 getservbyname_r_proto=0
13806 echo "Disabling getservbyname_r, cannot determine prototype." >&4 ;;
13807 * ) case "$getservbyname_r_proto" in
13808 REENTRANT_PROTO*) ;;
13809 *) getservbyname_r_proto="REENTRANT_PROTO_$getservbyname_r_proto" ;;
13811 echo "Prototype: $try" ;;
13814 *) case "$usethreads" in
13815 define) echo "getservbyname_r has no prototype, not using it." >&4 ;;
13817 d_getservbyname_r=undef
13818 getservbyname_r_proto=0
13822 *) getservbyname_r_proto=0
13826 : see if getservbyport_r exists
13827 set getservbyport_r d_getservbyport_r
13829 case "$d_getservbyport_r" in
13831 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13832 case "$d_getservbyport_r_proto:$usethreads" in
13833 ":define") d_getservbyport_r_proto=define
13834 set d_getservbyport_r_proto getservbyport_r $hdrs
13838 case "$d_getservbyport_r_proto" in
13840 case "$getservbyport_r_proto" in
13841 ''|0) try='int getservbyport_r(int, const char*, struct servent*, char*, size_t, struct servent**);'
13842 ./protochk "extern $try" $hdrs && getservbyport_r_proto=I_ICSBWR ;;
13844 case "$getservbyport_r_proto" in
13845 ''|0) try='struct servent* getservbyport_r(int, const char*, struct servent*, char*, int);'
13846 ./protochk "extern $try" $hdrs && getservbyport_r_proto=S_ICSBI ;;
13848 case "$getservbyport_r_proto" in
13849 ''|0) try='int getservbyport_r(int, const char*, struct servent*, struct servent_data*);'
13850 ./protochk "extern $try" $hdrs && getservbyport_r_proto=I_ICSD ;;
13852 case "$getservbyport_r_proto" in
13853 ''|0) d_getservbyport_r=undef
13854 getservbyport_r_proto=0
13855 echo "Disabling getservbyport_r, cannot determine prototype." >&4 ;;
13856 * ) case "$getservbyport_r_proto" in
13857 REENTRANT_PROTO*) ;;
13858 *) getservbyport_r_proto="REENTRANT_PROTO_$getservbyport_r_proto" ;;
13860 echo "Prototype: $try" ;;
13863 *) case "$usethreads" in
13864 define) echo "getservbyport_r has no prototype, not using it." >&4 ;;
13866 d_getservbyport_r=undef
13867 getservbyport_r_proto=0
13871 *) getservbyport_r_proto=0
13875 : see if getservent_r exists
13876 set getservent_r d_getservent_r
13878 case "$d_getservent_r" in
13880 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13881 case "$d_getservent_r_proto:$usethreads" in
13882 ":define") d_getservent_r_proto=define
13883 set d_getservent_r_proto getservent_r $hdrs
13887 case "$d_getservent_r_proto" in
13889 case "$getservent_r_proto" in
13890 ''|0) try='int getservent_r(struct servent*, char*, size_t, struct servent**);'
13891 ./protochk "extern $try" $hdrs && getservent_r_proto=I_SBWR ;;
13893 case "$getservent_r_proto" in
13894 ''|0) try='int getservent_r(struct servent*, char*, int);'
13895 ./protochk "extern $try" $hdrs && getservent_r_proto=I_SBI ;;
13897 case "$getservent_r_proto" in
13898 ''|0) try='struct servent* getservent_r(struct servent*, char*, int);'
13899 ./protochk "extern $try" $hdrs && getservent_r_proto=S_SBI ;;
13901 case "$getservent_r_proto" in
13902 ''|0) try='int getservent_r(struct servent*, struct servent_data*);'
13903 ./protochk "extern $try" $hdrs && getservent_r_proto=I_SD ;;
13905 case "$getservent_r_proto" in
13906 ''|0) d_getservent_r=undef
13907 getservent_r_proto=0
13908 echo "Disabling getservent_r, cannot determine prototype." >&4 ;;
13909 * ) case "$getservent_r_proto" in
13910 REENTRANT_PROTO*) ;;
13911 *) getservent_r_proto="REENTRANT_PROTO_$getservent_r_proto" ;;
13913 echo "Prototype: $try" ;;
13916 *) case "$usethreads" in
13917 define) echo "getservent_r has no prototype, not using it." >&4 ;;
13919 d_getservent_r=undef
13920 getservent_r_proto=0
13924 *) getservent_r_proto=0
13928 : see if prototypes for various getservxxx netdb.h functions are available
13930 set d_getservprotos getservent $i_netdb netdb.h
13933 : see if getspnam exists
13934 set getspnam d_getspnam
13937 : see if this is a shadow.h system
13938 set shadow.h i_shadow
13941 : see if getspnam_r exists
13942 set getspnam_r d_getspnam_r
13944 case "$d_getspnam_r" in
13946 hdrs="$i_systypes sys/types.h define stdio.h $i_shadow shadow.h"
13947 case "$d_getspnam_r_proto:$usethreads" in
13948 ":define") d_getspnam_r_proto=define
13949 set d_getspnam_r_proto getspnam_r $hdrs
13953 case "$d_getspnam_r_proto" in
13955 case "$getspnam_r_proto" in
13956 ''|0) try='int getspnam_r(const char*, struct spwd*, char*, size_t, struct spwd**);'
13957 ./protochk "extern $try" $hdrs && getspnam_r_proto=I_CSBWR ;;
13959 case "$getspnam_r_proto" in
13960 ''|0) try='struct spwd* getspnam_r(const char*, struct spwd*, char*, int);'
13961 ./protochk "extern $try" $hdrs && getspnam_r_proto=S_CSBI ;;
13963 case "$getspnam_r_proto" in
13964 ''|0) d_getspnam_r=undef
13966 echo "Disabling getspnam_r, cannot determine prototype." >&4 ;;
13967 * ) case "$getspnam_r_proto" in
13968 REENTRANT_PROTO*) ;;
13969 *) getspnam_r_proto="REENTRANT_PROTO_$getspnam_r_proto" ;;
13971 echo "Prototype: $try" ;;
13974 *) case "$usethreads" in
13975 define) echo "getspnam_r has no prototype, not using it." >&4 ;;
13982 *) getspnam_r_proto=0
13986 : see if gettimeofday or ftime exists
13987 set gettimeofday d_gettimeod
13989 case "$d_gettimeod" in
13995 val="$undef"; set d_ftime; eval $setvar
13998 case "$d_gettimeod$d_ftime" in
14001 echo 'No ftime() nor gettimeofday() -- timing may be less accurate.' >&4
14005 : see if gmtime_r exists
14006 set gmtime_r d_gmtime_r
14008 case "$d_gmtime_r" in
14010 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
14011 case "$d_gmtime_r_proto:$usethreads" in
14012 ":define") d_gmtime_r_proto=define
14013 set d_gmtime_r_proto gmtime_r $hdrs
14017 case "$d_gmtime_r_proto" in
14019 case "$gmtime_r_proto" in
14020 ''|0) try='struct tm* gmtime_r(const time_t*, struct tm*);'
14021 ./protochk "extern $try" $hdrs && gmtime_r_proto=S_TS ;;
14023 case "$gmtime_r_proto" in
14024 ''|0) try='int gmtime_r(const time_t*, struct tm*);'
14025 ./protochk "extern $try" $hdrs && gmtime_r_proto=I_TS ;;
14027 case "$gmtime_r_proto" in
14028 ''|0) d_gmtime_r=undef
14030 echo "Disabling gmtime_r, cannot determine prototype." >&4 ;;
14031 * ) case "$gmtime_r_proto" in
14032 REENTRANT_PROTO*) ;;
14033 *) gmtime_r_proto="REENTRANT_PROTO_$gmtime_r_proto" ;;
14035 echo "Prototype: $try" ;;
14038 *) case "$usethreads" in
14039 define) echo "gmtime_r has no prototype, not using it." >&4 ;;
14046 *) gmtime_r_proto=0
14050 : see if hasmntopt exists
14051 set hasmntopt d_hasmntopt
14054 : see if this is a netinet/in.h or sys/in.h system
14055 set netinet/in.h i_niin sys/in.h i_sysin
14058 : see if arpa/inet.h has to be included
14059 set arpa/inet.h i_arpainet
14062 : see if htonl --and friends-- exists
14067 : Maybe they are macros.
14070 $cat >htonl.c <<EOM
14072 #include <sys/types.h>
14073 #$i_niin I_NETINET_IN
14075 #$i_arpainet I_ARPA_INET
14076 #ifdef I_NETINET_IN
14077 #include <netinet/in.h>
14080 #include <sys/in.h>
14083 #include <arpa/inet.h>
14086 printf("Defined as a macro.");
14089 $cppstdin $cppflags $cppminus < htonl.c >htonl.E 2>/dev/null
14090 if $contains 'Defined as a macro' htonl.E >/dev/null 2>&1; then
14092 echo "But it seems to be defined as a macro." >&4
14100 : see if ilogbl exists
14101 set ilogbl d_ilogbl
14106 if set index val -f; eval $csym; $val; then
14107 if set strchr val -f d_strchr; eval $csym; $val; then
14108 if $contains strchr "$strings" >/dev/null 2>&1 ; then
14111 echo "strchr() found." >&4
14115 echo "index() found." >&4
14120 echo "index() found." >&4
14123 if set strchr val -f d_strchr; eval $csym; $val; then
14126 echo "strchr() found." >&4
14128 echo "No index() or strchr() found!" >&4
14133 set d_strchr; eval $setvar
14135 set d_index; eval $setvar
14137 : check whether inet_aton exists
14138 set inet_aton d_inetaton
14143 $cat >isascii.c <<EOCP
14146 #$i_stdlib I_STDLIB
14148 #include <stdlib.h>
14159 if eval $compile; then
14160 echo "isascii() found." >&4
14163 echo "isascii() NOT found." >&4
14170 : see if isfinite exists
14171 set isfinite d_isfinite
14174 : see if isinf exists
14178 : see if isnan exists
14182 : see if isnanl exists
14183 set isnanl d_isnanl
14186 : see if killpg exists
14187 set killpg d_killpg
14190 : see if lchown exists
14192 $cat > try.c <<'EOCP'
14193 /* System header to define __stub macros and hopefully few prototypes,
14194 which can conflict with char lchown(); below. */
14195 #include <assert.h>
14196 /* Override any gcc2 internal prototype to avoid an error. */
14197 /* We use char because int might match the return type of a gcc2
14198 builtin and then its argument prototype would still apply. */
14201 /* The GNU C library defines this for functions which it implements
14202 to always fail with ENOSYS. Some functions are actually named
14203 something starting with __ and the normal name is an alias. */
14204 #if defined (__stub_lchown) || defined (__stub___lchown)
14212 if eval $compile; then
14213 $echo "lchown() found." >&4
14216 $echo "lchown() NOT found." >&4
14222 : See if number of significant digits in a double precision number is known
14224 $cat >ldbl_dig.c <<EOM
14225 #$i_limits I_LIMITS
14228 #include <limits.h>
14234 printf("Contains LDBL_DIG");
14237 $cppstdin $cppflags $cppminus < ldbl_dig.c >ldbl_dig.E 2>/dev/null
14238 if $contains 'LDBL_DIG' ldbl_dig.E >/dev/null 2>&1; then
14239 echo "LDBL_DIG found." >&4
14242 echo "LDBL_DIG NOT found." >&4
14249 : see if this is a math.h system
14253 d_libm_lib_version="$undef"
14256 : check to see if math.h defines _LIB_VERSION
14258 echo "Checking to see if your libm supports _LIB_VERSION..." >&4
14260 #include <unistd.h>
14262 int main (int argc, char *argv[])
14264 printf ("%d\n", _LIB_VERSION);
14269 if eval $compile; then
14271 echo "Yes, it does ($foo)" >&4
14272 d_libm_lib_version="$define"
14274 echo "No, it does not (probably harmless)\n" >&4
14276 $rm -f try.* try core core.try.*
14281 : see if link exists
14285 : see if localtime_r exists
14286 set localtime_r d_localtime_r
14288 case "$d_localtime_r" in
14290 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
14291 case "$d_localtime_r_proto:$usethreads" in
14292 ":define") d_localtime_r_proto=define
14293 set d_localtime_r_proto localtime_r $hdrs
14297 case "$d_localtime_r_proto" in
14299 case "$localtime_r_proto" in
14300 ''|0) try='struct tm* localtime_r(const time_t*, struct tm*);'
14301 ./protochk "extern $try" $hdrs && localtime_r_proto=S_TS ;;
14303 case "$localtime_r_proto" in
14304 ''|0) try='int localtime_r(const time_t*, struct tm*);'
14305 ./protochk "extern $try" $hdrs && localtime_r_proto=I_TS ;;
14307 case "$localtime_r_proto" in
14308 ''|0) d_localtime_r=undef
14309 localtime_r_proto=0
14310 echo "Disabling localtime_r, cannot determine prototype." >&4 ;;
14311 * ) case "$localtime_r_proto" in
14312 REENTRANT_PROTO*) ;;
14313 *) localtime_r_proto="REENTRANT_PROTO_$localtime_r_proto" ;;
14315 echo "Prototype: $try" ;;
14318 *) case "$usethreads" in
14319 define) echo "localtime_r has no prototype, not using it." >&4 ;;
14321 d_localtime_r=undef
14322 localtime_r_proto=0
14326 *) localtime_r_proto=0
14330 : see if localeconv exists
14331 set localeconv d_locconv
14334 : see if lockf exists
14338 : see if prototype for lseek is available
14340 set d_lseekproto lseek $i_systypes sys/types.h $i_unistd unistd.h
14343 : see if lstat exists
14347 : see if madvise exists
14348 set madvise d_madvise
14351 : see if malloc_size exists
14352 set malloc_size d_malloc_size
14355 : see if malloc_size_good exists
14356 set malloc_good_size d_malloc_good_size
14359 : see if mblen exists
14363 : see if mbstowcs exists
14364 set mbstowcs d_mbstowcs
14367 : see if mbtowc exists
14368 set mbtowc d_mbtowc
14371 : see if memchr exists
14372 set memchr d_memchr
14375 : see if memcmp exists
14376 set memcmp d_memcmp
14379 : see if memcpy exists
14380 set memcpy d_memcpy
14383 : see if memmove exists
14384 set memmove d_memmove
14387 : see if memset exists
14388 set memset d_memset
14391 : see if mkdir exists
14395 : see if mkdtemp exists
14396 set mkdtemp d_mkdtemp
14399 : see if mkfifo exists
14400 set mkfifo d_mkfifo
14403 : see if mkstemp exists
14404 set mkstemp d_mkstemp
14407 : see if mkstemps exists
14408 set mkstemps d_mkstemps
14411 : see if mktime exists
14412 set mktime d_mktime
14415 : see if this is a sys/mman.h system
14416 set sys/mman.h i_sysmman
14419 : see if mmap exists
14422 : see what shmat returns
14423 : default to something harmless
14425 case "$i_sysmman$d_mmap" in
14427 $cat >mmap.c <<'END'
14428 #include <sys/mman.h>
14431 if $cc $ccflags -c mmap.c >/dev/null 2>&1; then
14436 echo "and it returns ($mmaptype)." >&4
14442 : see if sqrtl exists
14446 : see if scalbnl exists
14447 set scalbnl d_scalbnl
14450 : see if modfl exists
14454 : see if prototype for modfl is available
14456 set d_modflproto modfl $i_math math.h
14459 d_modfl_pow32_bug="$undef"
14461 case "$d_longdbl$d_modfl" in
14464 Checking to see whether your modfl() is okay for large values...
14470 if $test "X$d_modflproto" != "X$define"; then
14471 $cat >>try.c <<EOCP
14472 /* Sigh. many current glibcs provide the function, but do not prototype it. */
14473 long double modfl (long double, long double *);
14476 $cat >>try.c <<EOCP
14478 long double nv = 4294967303.15;
14484 printf(" %"$sPRIfldbl" %"$sPRIfldbl" %"$sPRIfldbl"\n", nv, v, w);
14488 case "$osname:$gccversion" in
14489 aix:) saveccflags="$ccflags"
14490 ccflags="$ccflags -qlongdouble" ;; # to avoid core dump
14493 if eval $compile; then
14496 *" 4294967303.150000 1.150000 4294967302.000000")
14497 echo >&4 "Your modfl() is broken for large values."
14498 d_modfl_pow32_bug="$define"
14500 glibc) echo >&4 "You should upgrade your glibc to at least 2.2.2 to get a fixed modfl()."
14504 *" 4294967303.150000 0.150000 4294967303.000000")
14505 echo >&4 "Your modfl() seems okay for large values."
14507 *) echo >&4 "I don't understand your modfl() at all."
14511 $rm -f try.* try core core.try.*
14513 echo "I cannot figure out whether your modfl() is okay, assuming it isn't."
14516 case "$osname:$gccversion" in
14517 aix:) ccflags="$saveccflags" ;; # restore
14522 if $test "$uselongdouble" = "$define"; then
14524 if $test "$d_sqrtl" != "$define"; then
14525 message="$message sqrtl"
14527 if $test "$d_modfl" != "$define"; then
14528 if $test "$d_aintl:$d_copysignl" = "$define:$define"; then
14529 echo "You have both aintl and copysignl, so I can emulate modfl."
14531 message="$message modfl"
14534 if $test "$d_frexpl" != "$define"; then
14535 if $test "$d_ilogbl:$d_scalbnl" = "$define:$define"; then
14536 echo "You have both ilogbl and scalbnl, so I can emulate frexpl."
14538 message="$message frexpl"
14542 if $test "$message" != ""; then
14545 *** You requested the use of long doubles but you do not seem to have
14546 *** the following mathematical functions needed for long double support:
14548 *** Please rerun Configure without -Duselongdouble and/or -Dusemorebits.
14549 *** Cannot continue, aborting.
14557 : see if mprotect exists
14558 set mprotect d_mprotect
14561 : see if msgctl exists
14562 set msgctl d_msgctl
14565 : see if msgget exists
14566 set msgget d_msgget
14569 : see if msgsnd exists
14570 set msgsnd d_msgsnd
14573 : see if msgrcv exists
14574 set msgrcv d_msgrcv
14577 : see how much of the 'msg*(2)' library is present.
14580 case "$d_msgctl$d_msgget$d_msgsnd$d_msgrcv" in
14581 *"$undef"*) h_msg=false;;
14585 case "`ipcs 2>&1`" in
14586 "SVID messages"*"not configured"*)
14587 echo "Your $osname does not have the msg*(2) configured." >&4
14590 set msgctl d_msgctl
14592 set msgget d_msgget
14594 set msgsnd d_msgsnd
14596 set msgrcv d_msgrcv
14602 : we could also check for sys/ipc.h ...
14603 if $h_msg && $test `./findhdr sys/msg.h`; then
14604 echo "You have the full msg*(2) library." >&4
14607 echo "You don't have the full msg*(2) library." >&4
14615 echo "Checking to see if your system supports struct msghdr..." >&4
14616 set d_msghdr_s msghdr $i_systypes sys/types.h $d_socket sys/socket.h $i_sysuio sys/uio.h
14618 case "$d_msghdr_s" in
14619 "$define") echo "Yes, it does." ;;
14620 *) echo "No, it doesn't." ;;
14624 : see if msync exists
14628 : see if munmap exists
14629 set munmap d_munmap
14632 : see if nice exists
14636 : see if this is a langinfo.h system
14637 set langinfo.h i_langinfo
14640 : see if nl_langinfo exists
14641 set nl_langinfo d_nl_langinfo
14644 : check for length of character
14646 case "$charsize" in
14648 echo "Checking to see how big your characters are (hey, you never know)..." >&4
14651 #$i_stdlib I_STDLIB
14653 #include <stdlib.h>
14657 printf("%d\n", (int)sizeof(char));
14662 if eval $compile_ok; then
14666 echo "(I can't seem to compile the test program. Guessing...)"
14673 rp="What is the size of a character (in bytes)?"
14678 : check for volatile keyword
14680 echo 'Checking to see if your C compiler knows about "volatile"...' >&4
14681 $cat >try.c <<'EOCP'
14684 typedef struct _goo_struct goo_struct;
14685 goo_struct * volatile goo = ((goo_struct *)0);
14686 struct _goo_struct {
14691 typedef unsigned short foo_t;
14692 char *volatile foo;
14694 volatile foo_t blech;
14698 if $cc -c $ccflags try.c >/dev/null 2>&1 ; then
14700 echo "Yup, it does."
14703 echo "Nope, it doesn't."
14711 $echo "Choosing the C types to be used for Perl's internal types..." >&4
14713 case "$use64bitint:$d_quad:$quadtype" in
14716 uvtype="$uquadtype"
14721 uvtype="unsigned long"
14727 case "$uselongdouble:$d_longdbl" in
14729 nvtype="long double"
14730 nvsize=$longdblsize
14737 $echo "(IV will be "$ivtype", $ivsize bytes)"
14738 $echo "(UV will be "$uvtype", $uvsize bytes)"
14739 $echo "(NV will be "$nvtype", $nvsize bytes)"
14742 #$i_inttypes I_INTTYPES
14744 #include <inttypes.h>
14749 int8_t i = INT8_MAX;
14750 uint8_t u = UINT8_MAX;
14751 printf("int8_t\n");
14754 int16_t i = INT16_MAX;
14755 uint16_t i = UINT16_MAX;
14756 printf("int16_t\n");
14759 int32_t i = INT32_MAX;
14760 uint32_t u = UINT32_MAX;
14761 printf("int32_t\n");
14767 '') case "$charsize" in
14769 u8type="unsigned char"
14778 if eval $compile; then
14779 case "`$run ./try`" in
14780 int8_t) i8type=int8_t
14790 '') if $test $charsize -ge 1; then
14792 u8type="unsigned char"
14800 '') case "$shortsize" in
14802 u16type="unsigned short"
14810 '') set try -DINT16
14811 if eval $compile; then
14812 case "`$run ./try`" in
14824 '') if $test $shortsize -ge 2; then
14826 u16type="unsigned short"
14834 '') case "$longsize" in
14836 u32type="unsigned long"
14840 *) case "$intsize" in
14842 u32type="unsigned int"
14852 '') set try -DINT32
14853 if eval $compile; then
14854 case "`$run ./try`" in
14866 '') if $test $intsize -ge 4; then
14868 u32type="unsigned int"
14876 '') case "$d_quad:$quadtype" in
14878 i64type="$quadtype"
14879 u64type="$uquadtype"
14887 $echo "Checking how many bits of your UVs your NVs can preserve..." >&4
14888 : volatile so that the compiler has to store it out to memory.
14889 if test X"$d_volatile" = X"$define"; then
14894 #$i_stdlib I_STDLIB
14896 #include <stdlib.h>
14898 #include <sys/types.h>
14899 #include <signal.h>
14901 $volatile int bletched = 0;
14902 $signal_t blech(s) int s; { bletched = 1; }
14907 int n = 8 * $uvsize;
14910 signal(SIGFPE, blech);
14913 for (i = 0; i < n; i++) {
14914 u = u << 1 | ($uvtype)1;
14916 if (($uvtype)d != u)
14920 d = ($nvtype)(u - 1);
14921 if (($uvtype)d != (u - 1))
14929 printf("%d\n", ((i == n) ? -n : i));
14935 d_nv_preserves_uv="$undef"
14936 if eval $compile; then
14937 nv_preserves_uv_bits="`$run ./try`"
14939 case "$nv_preserves_uv_bits" in
14941 nv_preserves_uv_bits=`expr 0 - $nv_preserves_uv_bits`
14942 $echo "Your NVs can preserve all $nv_preserves_uv_bits bits of your UVs." 2>&1
14943 d_nv_preserves_uv="$define"
14945 [1-9]*) $echo "Your NVs can preserve only $nv_preserves_uv_bits bits of your UVs." 2>&1
14946 d_nv_preserves_uv="$undef" ;;
14947 *) $echo "Can't figure out how many bits your NVs preserve." 2>&1
14948 nv_preserves_uv_bits="$undef" ;;
14953 $echo "Checking whether NV 0.0 is all bits zero in memory..." >&4
14954 : volatile so that the compiler has to store it out to memory.
14955 if test X"$d_volatile" = X"$define"; then
14960 #$i_stdlib I_STDLIB
14962 #include <stdlib.h>
14964 #$i_string I_STRING
14966 # include <string.h>
14968 # include <strings.h>
14970 #include <sys/types.h>
14971 #include <signal.h>
14973 $volatile int bletched = 0;
14974 $signal_t blech(s) int s; { bletched = 1; }
14977 int checkit($nvtype d, char *where) {
14978 unsigned char *p = (char *)&d;
14979 unsigned char *end = p + sizeof(d);
14989 printf("No - %s: 0x", where);
14991 printf ("%02X", *p++);
14996 int main(int argc, char **argv) {
14999 fail += checkit(d, "0.0");
15001 /* The compiler shouldn't be assuming that bletched is 0 */
15004 fail += checkit(d, "bleched");
15007 signal(SIGFPE, blech);
15010 /* Paranoia - the compiler should have no way of knowing that ANSI says
15011 that argv[argc] will always be NULL. Actually, if it did assume this it
15012 would be buggy, as this is C and main() can be called from elsewhere in
15014 d = argv[argc] ? 1 : 0;
15017 printf("Odd argv[argc]=%p, d=%g\n", argv[argc], d);
15020 fail += checkit(d, "ternary");
15022 memset(&d, sizeof(d), argv[argc] ? 1 : 0);
15025 printf("No - memset doesn't give 0.0\n");
15026 /* This might just blow up: */
15027 printf("(gives %g)\n", d);
15033 printf("No - something bleched\n");
15038 printf("No - %d fail(s)\n", fail);
15047 d_nv_zero_is_allbits_zero="$undef"
15048 if eval $compile; then
15054 0.0 is represented as all bits zero in memory
15056 d_nv_zero_is_allbits_zero="$define"
15059 0.0 is not represented as all bits zero in memory
15061 d_nv_zero_is_allbits_zero="$undef"
15066 0.0 is not represented as all bits zero in memory
15068 d_nv_zero_is_allbits_zero="$undef"
15076 : check for off64_t
15078 echo "Checking to see if you have off64_t..." >&4
15080 #include <sys/types.h>
15081 #include <unistd.h>
15082 int main() { off64_t x = 7; }
15085 if eval $compile; then
15087 echo "You have off64_t."
15090 echo "You do not have off64_t."
15091 case "$lseeksize" in
15092 8) echo "(Your off_t is 64 bits, so you could use that.)" ;;
15099 : how to create joinable pthreads
15100 if test "X$usethreads" = "X$define" -a "X$i_pthread" = "X$define"; then
15102 echo "Checking what constant to use for creating joinable pthreads..." >&4
15103 $cat >try.c <<'EOCP'
15104 #include <pthread.h>
15106 int detachstate = JOINABLE;
15109 set try -DJOINABLE=PTHREAD_CREATE_JOINABLE
15110 if eval $compile; then
15111 echo "You seem to use PTHREAD_CREATE_JOINABLE." >&4
15112 val="$undef" # Yes, undef.
15113 set d_old_pthread_create_joinable
15116 set old_pthread_create_joinable
15119 set try -DJOINABLE=PTHREAD_CREATE_UNDETACHED
15120 if eval $compile; then
15121 echo "You seem to use PTHREAD_CREATE_UNDETACHED." >&4
15123 set d_old_pthread_create_joinable
15125 val=PTHREAD_CREATE_UNDETACHED
15126 set old_pthread_create_joinable
15129 set try -DJOINABLE=__UNDETACHED
15130 if eval $compile; then
15131 echo "You seem to use __UNDETACHED." >&4
15133 set d_old_pthread_create_joinable
15136 set old_pthread_create_joinable
15139 echo "Egads, nothing obvious found. Guessing that you use 0." >&4
15141 set d_old_pthread_create_joinable
15144 set old_pthread_create_joinable
15151 d_old_pthread_create_joinable="$undef"
15152 old_pthread_create_joinable=""
15155 : see if pause exists
15159 : see if pipe exists
15163 : see if poll exists
15167 : see if readlink exists
15168 set readlink d_readlink
15174 case "$d_readlink" in
15176 if $issymlink /proc/self/exe ; then
15177 $ls -l /proc/self/exe > reflect
15178 if $contains /`basename $ls` reflect >/dev/null 2>&1; then
15179 echo "You have Linux-like /proc/self/exe."
15180 procselfexe='"/proc/self/exe"'
15184 if $issymlink /proc/curproc/file ; then
15185 $ls -l /proc/curproc/file > reflect
15186 if $contains /`basename $ls` reflect >/dev/null 2>&1; then
15187 echo "You have BSD-like /proc/curproc/file."
15188 procselfexe='"/proc/curproc/file"'
15198 : see whether the pthread_atfork exists
15200 #include <pthread.h>
15203 #ifdef PTHREAD_ATFORK
15204 pthread_atfork(NULL,NULL,NULL);
15209 : see if pthread_atfork exists
15210 set try -DPTHREAD_ATFORK
15211 if eval $compile; then
15216 case "$usethreads" in
15219 $define) echo 'pthread_atfork found.' >&4 ;;
15220 *) echo 'pthread_atfork NOT found.' >&4 ;;
15223 set d_pthread_atfork
15226 : see if pthread_attr_setscope exists
15227 set pthread_attr_setscope d_pthread_attr_setscope
15231 : see whether the various POSIXish _yields exist
15233 #include <pthread.h>
15239 #ifdef PTHREAD_YIELD
15242 #ifdef PTHREAD_YIELD_NULL
15243 pthread_yield(NULL);
15249 : see if sched_yield exists
15250 set try -DSCHED_YIELD
15251 if eval $compile; then
15253 sched_yield='sched_yield()'
15257 case "$usethreads" in
15260 $define) echo 'sched_yield() found.' >&4 ;;
15261 *) echo 'sched_yield() NOT found.' >&4 ;;
15267 : see if pthread_yield exists
15268 set try -DPTHREAD_YIELD
15269 if eval $compile; then
15271 case "$sched_yield" in
15272 '') sched_yield='pthread_yield()' ;;
15275 set try -DPTHREAD_YIELD_NULL
15276 if eval $compile; then
15278 case "$sched_yield" in
15279 '') sched_yield='pthread_yield(NULL)' ;;
15285 case "$usethreads" in
15288 $define) echo 'pthread_yield() found.' >&4 ;;
15289 *) echo 'pthread_yield() NOT found.' >&4 ;;
15293 set d_pthread_yield
15296 case "$sched_yield" in
15297 '') sched_yield=undef ;;
15302 : see if random_r exists
15303 set random_r d_random_r
15305 case "$d_random_r" in
15307 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
15308 case "$d_random_r_proto:$usethreads" in
15309 ":define") d_random_r_proto=define
15310 set d_random_r_proto random_r $hdrs
15314 case "$d_random_r_proto" in
15316 case "$random_r_proto" in
15317 ''|0) try='int random_r(int*, struct random_data*);'
15318 ./protochk "extern $try" $hdrs && random_r_proto=I_iS ;;
15320 case "$random_r_proto" in
15321 ''|0) try='int random_r(long*, struct random_data*);'
15322 ./protochk "extern $try" $hdrs && random_r_proto=I_lS ;;
15324 case "$random_r_proto" in
15325 ''|0) try='int random_r(struct random_data*, int32_t*);'
15326 ./protochk "extern $try" $hdrs && random_r_proto=I_St ;;
15328 case "$random_r_proto" in
15329 ''|0) d_random_r=undef
15331 echo "Disabling random_r, cannot determine prototype." >&4 ;;
15332 * ) case "$random_r_proto" in
15333 REENTRANT_PROTO*) ;;
15334 *) random_r_proto="REENTRANT_PROTO_$random_r_proto" ;;
15336 echo "Prototype: $try" ;;
15339 *) case "$usethreads" in
15340 define) echo "random_r has no prototype, not using it." >&4 ;;
15347 *) random_r_proto=0
15351 : see if readdir and friends exist
15352 set readdir d_readdir
15354 set seekdir d_seekdir
15356 set telldir d_telldir
15358 set rewinddir d_rewinddir
15361 : see if readdir64_r exists
15362 set readdir64_r d_readdir64_r
15364 case "$d_readdir64_r" in
15366 hdrs="$i_systypes sys/types.h define stdio.h $i_dirent dirent.h"
15367 case "$d_readdir64_r_proto:$usethreads" in
15368 ":define") d_readdir64_r_proto=define
15369 set d_readdir64_r_proto readdir64_r $hdrs
15373 case "$d_readdir64_r_proto" in
15375 case "$readdir64_r_proto" in
15376 ''|0) try='int readdir64_r(DIR*, struct dirent64*, struct dirent64**);'
15377 ./protochk "extern $try" $hdrs && readdir64_r_proto=I_TSR ;;
15379 case "$readdir64_r_proto" in
15380 ''|0) try='int readdir64_r(DIR*, struct dirent64*);'
15381 ./protochk "extern $try" $hdrs && readdir64_r_proto=I_TS ;;
15383 case "$readdir64_r_proto" in
15384 ''|0) d_readdir64_r=undef
15385 readdir64_r_proto=0
15386 echo "Disabling readdir64_r, cannot determine prototype." >&4 ;;
15387 * ) case "$readdir64_r_proto" in
15388 REENTRANT_PROTO*) ;;
15389 *) readdir64_r_proto="REENTRANT_PROTO_$readdir64_r_proto" ;;
15391 echo "Prototype: $try" ;;
15394 *) case "$usethreads" in
15395 define) echo "readdir64_r has no prototype, not using it." >&4 ;;
15397 d_readdir64_r=undef
15398 readdir64_r_proto=0
15402 *) readdir64_r_proto=0
15406 : see if readdir_r exists
15407 set readdir_r d_readdir_r
15409 case "$d_readdir_r" in
15411 hdrs="$i_systypes sys/types.h define stdio.h $i_dirent dirent.h"
15412 case "$d_readdir_r_proto:$usethreads" in
15413 ":define") d_readdir_r_proto=define
15414 set d_readdir_r_proto readdir_r $hdrs
15418 case "$d_readdir_r_proto" in
15420 case "$readdir_r_proto" in
15421 ''|0) try='int readdir_r(DIR*, struct dirent*, struct dirent**);'
15422 ./protochk "extern $try" $hdrs && readdir_r_proto=I_TSR ;;
15424 case "$readdir_r_proto" in
15425 ''|0) try='int readdir_r(DIR*, struct dirent*);'
15426 ./protochk "extern $try" $hdrs && readdir_r_proto=I_TS ;;
15428 case "$readdir_r_proto" in
15429 ''|0) d_readdir_r=undef
15431 echo "Disabling readdir_r, cannot determine prototype." >&4 ;;
15432 * ) case "$readdir_r_proto" in
15433 REENTRANT_PROTO*) ;;
15434 *) readdir_r_proto="REENTRANT_PROTO_$readdir_r_proto" ;;
15436 echo "Prototype: $try" ;;
15439 *) case "$usethreads" in
15440 define) echo "readdir_r has no prototype, not using it." >&4 ;;
15447 *) readdir_r_proto=0
15451 : see if readv exists
15455 : see if recvmsg exists
15456 set recvmsg d_recvmsg
15459 : see if rename exists
15460 set rename d_rename
15463 : see if rmdir exists
15467 : see if memory.h is available.
15472 : See if it conflicts with string.h
15478 $cppstdin $cppflags $cppminus < $strings > mem.h
15479 if $contains 'memcpy' mem.h >/dev/null 2>&1; then
15481 echo "We won't be including <memory.h>."
15491 : can bcopy handle overlapping blocks?
15494 case "$d_memmove" in
15495 "$define") echo "I'll use memmove() instead of bcopy() for overlapping copies." ;;
15496 *) case "$d_bcopy" in
15498 echo "Checking to see if bcopy() can do overlapping copies..." >&4
15500 #$i_memory I_MEMORY
15501 #$i_stdlib I_STDLIB
15502 #$i_string I_STRING
15503 #$i_unistd I_UNISTD
15505 $cat >>try.c <<'EOCP'
15508 # include <memory.h>
15511 # include <stdlib.h>
15514 # include <string.h>
15516 # include <strings.h>
15519 # include <unistd.h> /* Needed for NetBSD */
15523 char buf[128], abc[128];
15529 /* Copy "abcde..." string to char abc[] so that gcc doesn't
15530 try to store the string in read-only memory. */
15531 bcopy("abcdefghijklmnopqrstuvwxyz0123456789", abc, 36);
15533 for (align = 7; align >= 0; align--) {
15534 for (len = 36; len; len--) {
15536 bcopy(abc, b, len);
15537 for (off = 1; off <= len; off++) {
15538 bcopy(b, b+off, len);
15539 bcopy(b+off, b, len);
15540 if (bcmp(b, abc, len))
15549 if eval $compile_ok; then
15550 if ./try 2>/dev/null; then
15551 echo "Yes, it can."
15554 echo "It can't, sorry."
15557 echo "(I can't compile the test program, so we'll assume not...)"
15561 $rm -f try.* try core
15567 : can memcpy handle overlapping blocks?
15570 case "$d_memmove" in
15571 "$define") echo "I'll use memmove() instead of memcpy() for overlapping copies." ;;
15572 *) case "$d_memcpy" in
15574 echo "Checking to see if memcpy() can do overlapping copies..." >&4
15576 #$i_memory I_MEMORY
15577 #$i_stdlib I_STDLIB
15578 #$i_string I_STRING
15579 #$i_unistd I_UNISTD
15581 $cat >>try.c <<'EOCP'
15584 # include <memory.h>
15587 # include <stdlib.h>
15590 # include <string.h>
15592 # include <strings.h>
15595 # include <unistd.h> /* Needed for NetBSD */
15599 char buf[128], abc[128];
15605 /* Copy "abcde..." string to char abc[] so that gcc doesn't
15606 try to store the string in read-only memory. */
15607 memcpy(abc, "abcdefghijklmnopqrstuvwxyz0123456789", 36);
15609 for (align = 7; align >= 0; align--) {
15610 for (len = 36; len; len--) {
15612 memcpy(b, abc, len);
15613 for (off = 1; off <= len; off++) {
15614 memcpy(b+off, b, len);
15615 memcpy(b, b+off, len);
15616 if (memcmp(b, abc, len))
15625 if eval $compile_ok; then
15626 if ./try 2>/dev/null; then
15627 echo "Yes, it can."
15630 echo "It can't, sorry."
15633 echo "(I can't compile the test program, so we'll assume not...)"
15637 $rm -f try.* try core
15643 : can memcmp be trusted to compare relative magnitude?
15645 case "$d_memcmp" in
15648 echo "Checking if your memcmp() can compare relative magnitude..." >&4
15650 #$i_memory I_MEMORY
15651 #$i_stdlib I_STDLIB
15652 #$i_string I_STRING
15653 #$i_unistd I_UNISTD
15655 $cat >>try.c <<'EOCP'
15658 # include <memory.h>
15661 # include <stdlib.h>
15664 # include <string.h>
15666 # include <strings.h>
15669 # include <unistd.h> /* Needed for NetBSD */
15675 if ((a < b) && memcmp(&a, &b, 1) < 0)
15681 if eval $compile_ok; then
15682 if $run ./try 2>/dev/null; then
15683 echo "Yes, it can."
15686 echo "No, it can't (it uses signed chars)."
15689 echo "(I can't compile the test program, so we'll assume not...)"
15693 $rm -f try.* try core
15697 : see if prototype for sbrk is available
15699 set d_sbrkproto sbrk $i_unistd unistd.h
15702 : see if select exists
15703 set select d_select
15706 : see if semctl exists
15707 set semctl d_semctl
15710 : see if semget exists
15711 set semget d_semget
15714 : see if semop exists
15718 : see how much of the 'sem*(2)' library is present.
15721 case "$d_semctl$d_semget$d_semop" in
15722 *"$undef"*) h_sem=false;;
15726 case "`ipcs 2>&1`" in
15727 "SVID messages"*"not configured"*)
15728 echo "Your $osname does not have the sem*(2) configured." >&4
15731 set semctl d_semctl
15733 set semget d_semget
15741 : we could also check for sys/ipc.h ...
15742 if $h_sem && $test `./findhdr sys/sem.h`; then
15743 echo "You have the full sem*(2) library." >&4
15746 echo "You don't have the full sem*(2) library." >&4
15752 : see whether sys/sem.h defines union semun
15754 $cat > try.c <<'END'
15755 #include <sys/types.h>
15756 #include <sys/ipc.h>
15757 #include <sys/sem.h>
15758 int main () { union semun semun; semun.buf = 0; }
15761 if eval $compile; then
15762 echo "You have union semun in <sys/sem.h>." >&4
15765 echo "You do not have union semun in <sys/sem.h>." >&4
15772 : see how to do semctl IPC_STAT
15779 # define S_IRUSR S_IREAD
15780 # define S_IWUSR S_IWRITE
15781 # define S_IXUSR S_IEXEC
15783 # define S_IRUSR 0400
15784 # define S_IWUSR 0200
15785 # define S_IXUSR 0100
15787 # define S_IRGRP (S_IRUSR>>3)
15788 # define S_IWGRP (S_IWUSR>>3)
15789 # define S_IXGRP (S_IXUSR>>3)
15790 # define S_IROTH (S_IRUSR>>6)
15791 # define S_IWOTH (S_IWUSR>>6)
15792 # define S_IXOTH (S_IXUSR>>6)
15795 # define S_IRWXU (S_IRUSR|S_IWUSR|S_IXUSR)
15796 # define S_IRWXG (S_IRGRP|S_IWGRP|S_IXGRP)
15797 # define S_IRWXO (S_IROTH|S_IWOTH|S_IXOTH)
15800 : see whether semctl IPC_STAT can use union semun
15801 case "$d_semctl_semun" in
15805 #include <sys/types.h>
15806 #include <sys/ipc.h>
15807 #include <sys/sem.h>
15808 #include <sys/stat.h>
15815 #$d_union_semun HAS_UNION_SEMUN
15818 #ifndef HAS_UNION_SEMUN
15821 struct semid_ds *buf;
15822 unsigned short *array;
15828 #if defined(IPC_PRIVATE) && defined(S_IRWXU) && defined(S_IRWXG) && defined(S_IRWXO) && defined(IPC_CREAT)
15829 sem = semget(IPC_PRIVATE, 1, S_IRWXU|S_IRWXG|S_IRWXO|IPC_CREAT);
15831 struct semid_ds argbuf;
15834 st = semctl(sem, 0, IPC_STAT, arg);
15838 # endif /* IPC_STAT */
15839 printf("semctl IPC_STAT failed: errno = %d\n", errno);
15841 if (semctl(sem, 0, IPC_RMID, arg) != 0)
15842 # endif /* IPC_RMID */
15843 printf("semctl IPC_RMID failed: errno = %d\n", errno);
15845 #endif /* IPC_PRIVATE && ... */
15846 printf("semget failed: errno = %d\n", errno);
15851 if eval $compile; then
15854 semun) val="$define" ;;
15862 case "$d_semctl_semun" in
15864 echo "You can use union semun for semctl IPC_STAT." >&4
15867 *) echo "You cannot use union semun for semctl IPC_STAT." >&4
15872 : see whether semctl IPC_STAT can use struct semid_ds pointer
15873 case "$d_semctl_semid_ds" in
15876 $cat > try.c <<'END'
15877 #include <sys/types.h>
15878 #include <sys/ipc.h>
15879 #include <sys/sem.h>
15880 #include <sys/stat.h>
15888 struct semid_ds arg;
15891 #if defined(IPC_PRIVATE) && defined(S_IRWXU) && defined(S_IRWXG) && defined(S_IRWXO) && defined(IPC_CREAT)
15892 sem = semget(IPC_PRIVATE, 1, S_IRWXU|S_IRWXG|S_IRWXO|IPC_CREAT);
15895 st = semctl(sem, 0, IPC_STAT, &arg);
15897 printf("semid_ds\n");
15899 # endif /* IPC_STAT */
15900 printf("semctl IPC_STAT failed: errno = %d\n", errno);
15902 if (semctl(sem, 0, IPC_RMID, &arg) != 0)
15903 # endif /* IPC_RMID */
15904 printf("semctl IPC_RMID failed: errno = %d\n", errno);
15906 #endif /* IPC_PRIVATE && ... */
15907 printf("semget failed: errno = %d\n", errno);
15913 if eval $compile; then
15916 semid_ds) val="$define" ;;
15920 set d_semctl_semid_ds
15924 case "$d_semctl_semid_ds" in
15926 echo "You can $also use struct semid_ds* for semctl IPC_STAT." >&4
15928 *) echo "You cannot use struct semid_ds* for semctl IPC_STAT." >&4
15935 # We do not have the full sem*(2) library, so assume we can not
15941 set d_semctl_semid_ds
15946 : see if sendmsg exists
15947 set sendmsg d_sendmsg
15950 : see if setegid exists
15951 set setegid d_setegid
15954 : see if seteuid exists
15955 set seteuid d_seteuid
15958 : see if setgrent exists
15959 set setgrent d_setgrent
15962 : see if setgrent_r exists
15963 set setgrent_r d_setgrent_r
15965 case "$d_setgrent_r" in
15967 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
15968 case "$d_setgrent_r_proto:$usethreads" in
15969 ":define") d_setgrent_r_proto=define
15970 set d_setgrent_r_proto setgrent_r $hdrs
15974 case "$d_setgrent_r_proto" in
15976 case "$setgrent_r_proto" in
15977 ''|0) try='int setgrent_r(FILE**);'
15978 ./protochk "extern $try" $hdrs && setgrent_r_proto=I_H ;;
15980 case "$setgrent_r_proto" in
15981 ''|0) try='void setgrent_r(FILE**);'
15982 ./protochk "extern $try" $hdrs && setgrent_r_proto=V_H ;;
15984 case "$setgrent_r_proto" in
15985 ''|0) d_setgrent_r=undef
15987 echo "Disabling setgrent_r, cannot determine prototype." >&4 ;;
15988 * ) case "$setgrent_r_proto" in
15989 REENTRANT_PROTO*) ;;
15990 *) setgrent_r_proto="REENTRANT_PROTO_$setgrent_r_proto" ;;
15992 echo "Prototype: $try" ;;
15995 *) case "$usethreads" in
15996 define) echo "setgrent_r has no prototype, not using it." >&4 ;;
16003 *) setgrent_r_proto=0
16007 : see if sethostent exists
16008 set sethostent d_sethent
16011 : see if sethostent_r exists
16012 set sethostent_r d_sethostent_r
16014 case "$d_sethostent_r" in
16016 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
16017 case "$d_sethostent_r_proto:$usethreads" in
16018 ":define") d_sethostent_r_proto=define
16019 set d_sethostent_r_proto sethostent_r $hdrs
16023 case "$d_sethostent_r_proto" in
16025 case "$sethostent_r_proto" in
16026 ''|0) try='int sethostent_r(int, struct hostent_data*);'
16027 ./protochk "extern $try" $hdrs && sethostent_r_proto=I_ID ;;
16029 case "$sethostent_r_proto" in
16030 ''|0) try='void sethostent_r(int, struct hostent_data*);'
16031 ./protochk "extern $try" $hdrs && sethostent_r_proto=V_ID ;;
16033 case "$sethostent_r_proto" in
16034 ''|0) d_sethostent_r=undef
16035 sethostent_r_proto=0
16036 echo "Disabling sethostent_r, cannot determine prototype." >&4 ;;
16037 * ) case "$sethostent_r_proto" in
16038 REENTRANT_PROTO*) ;;
16039 *) sethostent_r_proto="REENTRANT_PROTO_$sethostent_r_proto" ;;
16041 echo "Prototype: $try" ;;
16044 *) case "$usethreads" in
16045 define) echo "sethostent_r has no prototype, not using it." >&4 ;;
16047 d_sethostent_r=undef
16048 sethostent_r_proto=0
16052 *) sethostent_r_proto=0
16056 : see if setitimer exists
16057 set setitimer d_setitimer
16060 : see if setlinebuf exists
16061 set setlinebuf d_setlinebuf
16064 : see if setlocale exists
16065 set setlocale d_setlocale
16068 : see if locale.h is available
16069 set locale.h i_locale
16072 : see if setlocale_r exists
16073 set setlocale_r d_setlocale_r
16075 case "$d_setlocale_r" in
16077 hdrs="$i_systypes sys/types.h define stdio.h $i_locale locale.h"
16078 case "$d_setlocale_r_proto:$usethreads" in
16079 ":define") d_setlocale_r_proto=define
16080 set d_setlocale_r_proto setlocale_r $hdrs
16084 case "$d_setlocale_r_proto" in
16086 case "$setlocale_r_proto" in
16087 ''|0) try='int setlocale_r(int, const char*, char*, int);'
16088 ./protochk "extern $try" $hdrs && setlocale_r_proto=I_ICBI ;;
16090 case "$setlocale_r_proto" in
16091 ''|0) d_setlocale_r=undef
16092 setlocale_r_proto=0
16093 echo "Disabling setlocale_r, cannot determine prototype." >&4 ;;
16094 * ) case "$setlocale_r_proto" in
16095 REENTRANT_PROTO*) ;;
16096 *) setlocale_r_proto="REENTRANT_PROTO_$setlocale_r_proto" ;;
16098 echo "Prototype: $try" ;;
16101 *) case "$usethreads" in
16102 define) echo "setlocale_r has no prototype, not using it." >&4 ;;
16104 d_setlocale_r=undef
16105 setlocale_r_proto=0
16109 *) setlocale_r_proto=0
16113 : see if setnetent exists
16114 set setnetent d_setnent
16117 : see if setnetent_r exists
16118 set setnetent_r d_setnetent_r
16120 case "$d_setnetent_r" in
16122 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
16123 case "$d_setnetent_r_proto:$usethreads" in
16124 ":define") d_setnetent_r_proto=define
16125 set d_setnetent_r_proto setnetent_r $hdrs
16129 case "$d_setnetent_r_proto" in
16131 case "$setnetent_r_proto" in
16132 ''|0) try='int setnetent_r(int, struct netent_data*);'
16133 ./protochk "extern $try" $hdrs && setnetent_r_proto=I_ID ;;
16135 case "$setnetent_r_proto" in
16136 ''|0) try='void setnetent_r(int, struct netent_data*);'
16137 ./protochk "extern $try" $hdrs && setnetent_r_proto=V_ID ;;
16139 case "$setnetent_r_proto" in
16140 ''|0) d_setnetent_r=undef
16141 setnetent_r_proto=0
16142 echo "Disabling setnetent_r, cannot determine prototype." >&4 ;;
16143 * ) case "$setnetent_r_proto" in
16144 REENTRANT_PROTO*) ;;
16145 *) setnetent_r_proto="REENTRANT_PROTO_$setnetent_r_proto" ;;
16147 echo "Prototype: $try" ;;
16150 *) case "$usethreads" in
16151 define) echo "setnetent_r has no prototype, not using it." >&4 ;;
16153 d_setnetent_r=undef
16154 setnetent_r_proto=0
16158 *) setnetent_r_proto=0
16162 : see if setprotoent exists
16163 set setprotoent d_setpent
16166 : see if setpgid exists
16167 set setpgid d_setpgid
16170 : see if setpgrp2 exists
16171 set setpgrp2 d_setpgrp2
16174 : see if setpriority exists
16175 set setpriority d_setprior
16178 : see if setproctitle exists
16179 set setproctitle d_setproctitle
16182 : see if setprotoent_r exists
16183 set setprotoent_r d_setprotoent_r
16185 case "$d_setprotoent_r" in
16187 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
16188 case "$d_setprotoent_r_proto:$usethreads" in
16189 ":define") d_setprotoent_r_proto=define
16190 set d_setprotoent_r_proto setprotoent_r $hdrs
16194 case "$d_setprotoent_r_proto" in
16196 case "$setprotoent_r_proto" in
16197 ''|0) try='int setprotoent_r(int, struct protoent_data*);'
16198 ./protochk "extern $try" $hdrs && setprotoent_r_proto=I_ID ;;
16200 case "$setprotoent_r_proto" in
16201 ''|0) try='void setprotoent_r(int, struct protoent_data*);'
16202 ./protochk "extern $try" $hdrs && setprotoent_r_proto=V_ID ;;
16204 case "$setprotoent_r_proto" in
16205 ''|0) d_setprotoent_r=undef
16206 setprotoent_r_proto=0
16207 echo "Disabling setprotoent_r, cannot determine prototype." >&4 ;;
16208 * ) case "$setprotoent_r_proto" in
16209 REENTRANT_PROTO*) ;;
16210 *) setprotoent_r_proto="REENTRANT_PROTO_$setprotoent_r_proto" ;;
16212 echo "Prototype: $try" ;;
16215 *) case "$usethreads" in
16216 define) echo "setprotoent_r has no prototype, not using it." >&4 ;;
16218 d_setprotoent_r=undef
16219 setprotoent_r_proto=0
16223 *) setprotoent_r_proto=0
16227 : see if setpwent exists
16228 set setpwent d_setpwent
16231 : see if setpwent_r exists
16232 set setpwent_r d_setpwent_r
16234 case "$d_setpwent_r" in
16236 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
16237 case "$d_setpwent_r_proto:$usethreads" in
16238 ":define") d_setpwent_r_proto=define
16239 set d_setpwent_r_proto setpwent_r $hdrs
16243 case "$d_setpwent_r_proto" in
16245 case "$setpwent_r_proto" in
16246 ''|0) try='int setpwent_r(FILE**);'
16247 ./protochk "extern $try" $hdrs && setpwent_r_proto=I_H ;;
16249 case "$setpwent_r_proto" in
16250 ''|0) try='void setpwent_r(FILE**);'
16251 ./protochk "extern $try" $hdrs && setpwent_r_proto=V_H ;;
16253 case "$setpwent_r_proto" in
16254 ''|0) d_setpwent_r=undef
16256 echo "Disabling setpwent_r, cannot determine prototype." >&4 ;;
16257 * ) case "$setpwent_r_proto" in
16258 REENTRANT_PROTO*) ;;
16259 *) setpwent_r_proto="REENTRANT_PROTO_$setpwent_r_proto" ;;
16261 echo "Prototype: $try" ;;
16264 *) case "$usethreads" in
16265 define) echo "setpwent_r has no prototype, not using it." >&4 ;;
16272 *) setpwent_r_proto=0
16276 : see if setregid exists
16277 set setregid d_setregid
16279 set setresgid d_setresgid
16282 : see if setreuid exists
16283 set setreuid d_setreuid
16285 set setresuid d_setresuid
16288 : see if setrgid exists
16289 set setrgid d_setrgid
16292 : see if setruid exists
16293 set setruid d_setruid
16296 : see if setservent exists
16297 set setservent d_setsent
16300 : see if setservent_r exists
16301 set setservent_r d_setservent_r
16303 case "$d_setservent_r" in
16305 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
16306 case "$d_setservent_r_proto:$usethreads" in
16307 ":define") d_setservent_r_proto=define
16308 set d_setservent_r_proto setservent_r $hdrs
16312 case "$d_setservent_r_proto" in
16314 case "$setservent_r_proto" in
16315 ''|0) try='int setservent_r(int, struct servent_data*);'
16316 ./protochk "extern $try" $hdrs && setservent_r_proto=I_ID ;;
16318 case "$setservent_r_proto" in
16319 ''|0) try='void setservent_r(int, struct servent_data*);'
16320 ./protochk "extern $try" $hdrs && setservent_r_proto=V_ID ;;
16322 case "$setservent_r_proto" in
16323 ''|0) d_setservent_r=undef
16324 setservent_r_proto=0
16325 echo "Disabling setservent_r, cannot determine prototype." >&4 ;;
16326 * ) case "$setservent_r_proto" in
16327 REENTRANT_PROTO*) ;;
16328 *) setservent_r_proto="REENTRANT_PROTO_$setservent_r_proto" ;;
16330 echo "Prototype: $try" ;;
16333 *) case "$usethreads" in
16334 define) echo "setservent_r has no prototype, not using it." >&4 ;;
16336 d_setservent_r=undef
16337 setservent_r_proto=0
16341 *) setservent_r_proto=0
16345 : see if setsid exists
16346 set setsid d_setsid
16349 : see if setvbuf exists
16350 set setvbuf d_setvbuf
16353 : see if sfio.h is available
16358 : see if sfio library is available
16369 : Ok, but do we want to use it.
16373 true|$define|[yY]*) dflt='y';;
16376 echo "$package can use the sfio library, but it is experimental."
16377 case "$useperlio" in
16379 echo "For sfio also the PerlIO abstraction layer is needed."
16380 echo "Earlier you said you wouldn't want that."
16383 rp="You seem to have sfio available, do you want to try using it?"
16386 y|Y) echo "Ok, turning on both sfio and PerlIO, then."
16387 useperlio="$define"
16390 *) echo "Ok, avoiding sfio this time. I'll use stdio instead."
16395 *) case "$usesfio" in
16396 true|$define|[yY]*)
16397 echo "Sorry, cannot find sfio on this machine." >&4
16398 echo "Ignoring your setting of usesfio=$usesfio." >&4
16407 $define) usesfio='true';;
16408 *) usesfio='false';;
16412 *) : Remove sfio from list of libraries to use
16415 echo "Removing unneeded -lsfio from library list" >&4
16416 set `echo X $libs | $sed -e 's/-lsfio / /' -e 's/-lsfio$//'`
16419 echo "libs = $libs" >&4
16426 : see if shmctl exists
16427 set shmctl d_shmctl
16430 : see if shmget exists
16431 set shmget d_shmget
16434 : see if shmat exists
16437 : see what shmat returns
16440 $cat >shmat.c <<'END'
16441 #include <sys/shm.h>
16444 if $cc $ccflags -c shmat.c >/dev/null 2>&1; then
16449 echo "and it returns ($shmattype)." >&4
16450 : see if a prototype for shmat is available
16451 xxx=`./findhdr sys/shm.h`
16452 $cppstdin $cppflags $cppminus < $xxx > shmat.c 2>/dev/null
16453 if $contains 'shmat.*(' shmat.c >/dev/null 2>&1; then
16464 set d_shmatprototype
16467 : see if shmdt exists
16471 : see how much of the 'shm*(2)' library is present.
16474 case "$d_shmctl$d_shmget$d_shmat$d_shmdt" in
16475 *"$undef"*) h_shm=false;;
16479 case "`ipcs 2>&1`" in
16480 "SVID shared memory"*"not configured"*)
16481 echo "Your $osname does not have the shm*(2) configured." >&4
16484 set shmctl d_shmctl
16486 set shmget d_shmget
16496 : we could also check for sys/ipc.h ...
16497 if $h_shm && $test `./findhdr sys/shm.h`; then
16498 echo "You have the full shm*(2) library." >&4
16501 echo "You don't have the full shm*(2) library." >&4
16508 : see if we have sigaction
16509 if set sigaction val -f d_sigaction; eval $csym; $val; then
16510 echo 'sigaction() found.' >&4
16513 #include <sys/types.h>
16514 #include <signal.h>
16515 #$i_stdlib I_STDLIB
16517 #include <stdlib.h>
16521 struct sigaction act, oact;
16523 oact.sa_handler = 0;
16524 /* so that act and oact are used */
16525 exit(act.sa_flags == 0 && oact.sa_handler == 0);
16529 if eval $compile_ok; then
16532 echo "But you don't seem to have a useable struct sigaction." >&4
16536 echo 'sigaction NOT found.' >&4
16539 set d_sigaction; eval $setvar
16540 $rm -f try try$_o try.c
16542 : see if sigprocmask exists
16543 set sigprocmask d_sigprocmask
16546 : see if sigsetjmp exists
16548 case "$d_sigsetjmp" in
16551 #include <setjmp.h>
16552 #$i_stdlib I_STDLIB
16554 #include <stdlib.h>
16560 if (sigsetjmp(env,1))
16563 siglongjmp(env, 1);
16568 if eval $compile; then
16569 if $run ./try >/dev/null 2>&1; then
16570 echo "POSIX sigsetjmp found." >&4
16574 Uh-Oh! You have POSIX sigsetjmp and siglongjmp, but they do not work properly!!
16580 echo "sigsetjmp not found." >&4
16584 *) val="$d_sigsetjmp"
16585 case "$d_sigsetjmp" in
16586 $define) echo "POSIX sigsetjmp found." >&4;;
16587 $undef) echo "sigsetjmp not found." >&4;;
16595 : see if snprintf exists
16596 set snprintf d_snprintf
16599 : see if vsnprintf exists
16600 set vsnprintf d_vsnprintf
16603 case "$d_snprintf-$d_vsnprintf" in
16606 Checking whether your snprintf() and vsnprintf() work okay...
16608 $cat >try.c <<'EOCP'
16609 /* v?snprintf testing logic courtesy of Russ Allbery.
16610 * According to C99:
16611 * - if the buffer is too short it still must be \0-terminated
16612 * - if the buffer is too short the potentially required length
16613 * must be returned and not -1
16614 * - if the buffer is NULL the potentially required length
16615 * must be returned and not -1 or core dump
16618 #include <stdarg.h>
16622 int test (char *format, ...)
16627 va_start (args, format);
16628 count = vsnprintf (buf, sizeof buf, format, args);
16635 return ((test ("%s", "abcd") == 4 && buf[0] == 'a' && buf[1] == '\0'
16636 && snprintf (NULL, 0, "%s", "abcd") == 4) ? 0 : 1);
16640 if eval $compile; then
16643 0) echo "Your snprintf() and vsnprintf() seem to be working okay." ;;
16645 Your snprintf() and snprintf() don't seem to be working okay.
16647 d_snprintf="$undef"
16648 d_vsnprintf="$undef"
16652 echo "(I can't seem to compile the test program--assuming they don't)"
16653 d_snprintf="$undef"
16654 d_vsnprintf="$undef"
16656 $rm -f try.* try core core.try.*
16660 : see if sockatmark exists
16661 set sockatmark d_sockatmark
16664 : see if prototype for sockatmark is available
16666 set d_sockatmarkproto sockatmark $d_socket sys/socket.h
16669 : see if socks5_init exists
16670 set socks5_init d_socks5_init
16673 : see if sprintf returns the length of the string in the buffer as per ANSI
16674 $echo "Checking whether sprintf returns the length of the string..." >&4
16677 #$i_stdlib I_STDLIB
16679 #include <stdlib.h>
16681 #$i_string I_STRING
16683 # include <string.h>
16685 # include <strings.h>
16694 int check (size_t expect, int test) {
16695 size_t got = strlen(buffer);
16699 printf("expected %ld, got %ld in test %d '%s'\n", (long) expect, (long) got,
16704 int main(int argc, char **argv) {
16707 check(sprintf(buffer, ""), ++test);
16708 check(sprintf(buffer, "%s %s", "perl", "rules"), ++test);
16709 check(sprintf(buffer, "I like %g", atan2(0,-1)), ++test);
16716 d_sprintf_returns_strlen="$undef"
16717 if eval $compile; then
16721 sprintf returns the length of the string (as ANSI says it should)
16723 d_sprintf_returns_strlen="$define"
16726 sprintf does not return the length of the string (how old is this system?)
16728 d_sprintf_returns_strlen="$undef"
16735 : see if srand48_r exists
16736 set srand48_r d_srand48_r
16738 case "$d_srand48_r" in
16740 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
16741 case "$d_srand48_r_proto:$usethreads" in
16742 ":define") d_srand48_r_proto=define
16743 set d_srand48_r_proto srand48_r $hdrs
16747 case "$d_srand48_r_proto" in
16749 case "$srand48_r_proto" in
16750 ''|0) try='int srand48_r(long, struct drand48_data*);'
16751 ./protochk "extern $try" $hdrs && srand48_r_proto=I_LS ;;
16753 case "$srand48_r_proto" in
16754 ''|0) d_srand48_r=undef
16756 echo "Disabling srand48_r, cannot determine prototype." >&4 ;;
16757 * ) case "$srand48_r_proto" in
16758 REENTRANT_PROTO*) ;;
16759 *) srand48_r_proto="REENTRANT_PROTO_$srand48_r_proto" ;;
16761 echo "Prototype: $try" ;;
16764 *) case "$usethreads" in
16765 define) echo "srand48_r has no prototype, not using it." >&4 ;;
16772 *) srand48_r_proto=0
16776 : see if srandom_r exists
16777 set srandom_r d_srandom_r
16779 case "$d_srandom_r" in
16781 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
16782 case "$d_srandom_r_proto:$usethreads" in
16783 ":define") d_srandom_r_proto=define
16784 set d_srandom_r_proto srandom_r $hdrs
16788 case "$d_srandom_r_proto" in
16790 case "$srandom_r_proto" in
16791 ''|0) try='int srandom_r(unsigned int, struct random_data*);'
16792 ./protochk "extern $try" $hdrs && srandom_r_proto=I_TS ;;
16794 case "$srandom_r_proto" in
16795 ''|0) d_srandom_r=undef
16797 echo "Disabling srandom_r, cannot determine prototype." >&4 ;;
16798 * ) case "$srandom_r_proto" in
16799 REENTRANT_PROTO*) ;;
16800 *) srandom_r_proto="REENTRANT_PROTO_$srandom_r_proto" ;;
16802 echo "Prototype: $try" ;;
16805 *) case "$usethreads" in
16806 define) echo "srandom_r has no prototype, not using it." >&4 ;;
16813 *) srandom_r_proto=0
16817 : see if prototype for setresgid is available
16819 set d_sresgproto setresgid $i_unistd unistd.h
16822 : see if prototype for setresuid is available
16824 set d_sresuproto setresuid $i_unistd unistd.h
16827 : see if sys/stat.h is available
16828 set sys/stat.h i_sysstat
16832 : see if stat knows about block sizes
16834 echo "Checking to see if your struct stat has st_blocks field..." >&4
16835 set d_statblks stat st_blocks $i_sysstat sys/stat.h
16839 : see if this is a sys/vfs.h system
16840 set sys/vfs.h i_sysvfs
16844 : see if this is a sys/statfs.h system
16845 set sys/statfs.h i_sysstatfs
16850 echo "Checking to see if your system supports struct statfs..." >&4
16851 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
16853 case "$d_statfs_s" in
16854 "$define") echo "Yes, it does." ;;
16855 *) echo "No, it doesn't." ;;
16860 : see if struct statfs knows about f_flags
16861 case "$d_statfs_s" in
16864 echo "Checking to see if your struct statfs has f_flags field..." >&4
16865 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
16869 set d_statfs_f_flags
16873 case "$d_statfs_f_flags" in
16874 "$define") echo "Yes, it does." ;;
16875 *) echo "No, it doesn't." ;;
16879 Checking how to access stdio streams by file descriptor number...
16881 case "$stdio_stream_array" in
16882 '') $cat >try.c <<EOCP
16885 if (&STDIO_STREAM_ARRAY[fileno(stdin)] == stdin)
16889 for s in _iob __iob __sF
16891 set try -DSTDIO_STREAM_ARRAY=$s
16892 if eval $compile; then
16893 case "`$run ./try`" in
16894 yes) stdio_stream_array=$s; break ;;
16898 $rm -f try.* try$exe_ext
16900 case "$stdio_stream_array" in
16902 I can't figure out how to access stdio streams by file descriptor number.
16904 d_stdio_stream_array="$undef"
16907 You can access stdio streams by file descriptor number by the $stdio_stream_array array.
16909 d_stdio_stream_array="$define"
16913 : see if strcoll exists
16914 set strcoll d_strcoll
16917 : check for structure copying
16919 echo "Checking to see if your C compiler can copy structs..." >&4
16920 $cat >try.c <<'EOCP'
16930 if $cc -c try.c >/dev/null 2>&1 ; then
16932 echo "Yup, it can."
16935 echo "Nope, it can't."
16941 : see if strerror and/or sys_errlist[] exist
16943 if test "X$d_strerror" = X -o "X$d_syserrlst" = X; then
16944 if set strerror val -f d_strerror; eval $csym; $val; then
16945 echo 'strerror() found.' >&4
16946 d_strerror="$define"
16947 d_strerrm='strerror(e)'
16948 if set sys_errlist val -a d_syserrlst; eval $csym; $val; then
16949 echo "(You also have sys_errlist[], so we could roll our own strerror.)"
16950 d_syserrlst="$define"
16952 echo "(Since you don't have sys_errlist[], sterror() is welcome.)"
16953 d_syserrlst="$undef"
16955 elif xxx=`./findhdr string.h`; test "$xxx" || xxx=`./findhdr strings.h`; \
16956 $contains '#[ ]*define.*strerror' "$xxx" >/dev/null 2>&1; then
16957 echo 'strerror() found in string header.' >&4
16958 d_strerror="$define"
16959 d_strerrm='strerror(e)'
16960 if set sys_errlist val -a d_syserrlst; eval $csym; $val; then
16961 echo "(Most probably, strerror() uses sys_errlist[] for descriptions.)"
16962 d_syserrlst="$define"
16964 echo "(You don't appear to have any sys_errlist[], how can this be?)"
16965 d_syserrlst="$undef"
16967 elif set sys_errlist val -a d_syserrlst; eval $csym; $val; then
16968 echo "strerror() not found, but you have sys_errlist[] so we'll use that." >&4
16969 d_strerror="$undef"
16970 d_syserrlst="$define"
16971 d_strerrm='((e)<0||(e)>=sys_nerr?"unknown":sys_errlist[e])'
16973 echo 'strerror() and sys_errlist[] NOT found.' >&4
16974 d_strerror="$undef"
16975 d_syserrlst="$undef"
16976 d_strerrm='"unknown"'
16980 : see if strerror_r exists
16981 set strerror_r d_strerror_r
16983 case "$d_strerror_r" in
16985 hdrs="$i_systypes sys/types.h define stdio.h $i_string string.h"
16986 case "$d_strerror_r_proto:$usethreads" in
16987 ":define") d_strerror_r_proto=define
16988 set d_strerror_r_proto strerror_r $hdrs
16992 case "$d_strerror_r_proto" in
16994 case "$strerror_r_proto" in
16995 ''|0) try='int strerror_r(int, char*, size_t);'
16996 ./protochk "extern $try" $hdrs && strerror_r_proto=I_IBW ;;
16998 case "$strerror_r_proto" in
16999 ''|0) try='int strerror_r(int, char*, int);'
17000 ./protochk "extern $try" $hdrs && strerror_r_proto=I_IBI ;;
17002 case "$strerror_r_proto" in
17003 ''|0) try='char* strerror_r(int, char*, size_t);'
17004 ./protochk "extern $try" $hdrs && strerror_r_proto=B_IBW ;;
17006 case "$strerror_r_proto" in
17007 ''|0) d_strerror_r=undef
17009 echo "Disabling strerror_r, cannot determine prototype." >&4 ;;
17010 * ) case "$strerror_r_proto" in
17011 REENTRANT_PROTO*) ;;
17012 *) strerror_r_proto="REENTRANT_PROTO_$strerror_r_proto" ;;
17014 echo "Prototype: $try" ;;
17017 *) case "$usethreads" in
17018 define) echo "strerror_r has no prototype, not using it." >&4 ;;
17025 *) strerror_r_proto=0
17029 : see if strftime exists
17030 set strftime d_strftime
17033 : see if strlcat exists
17034 set strlcat d_strlcat
17037 : see if strlcpy exists
17038 set strlcpy d_strlcpy
17041 : see if strtod exists
17042 set strtod d_strtod
17045 : see if strtol exists
17046 set strtol d_strtol
17049 : see if strtold exists
17050 set strtold d_strtold
17053 : see if strtoll exists
17054 set strtoll d_strtoll
17057 case "$d_longlong-$d_strtoll" in
17060 Checking whether your strtoll() works okay...
17062 $cat >try.c <<'EOCP'
17065 #define strtoll __strtoll
17068 #define strtoll _strtoll
17071 extern long long int strtoll(char *s, char **, int);
17072 static int bad = 0;
17073 int check(char *s, long long ell, int een) {
17076 gll = strtoll(s, 0, 10);
17077 if (!((gll == ell) && (errno == een)))
17081 check(" 1", 1LL, 0);
17082 check(" 0", 0LL, 0);
17083 check("-1", -1LL, 0);
17084 check("-9223372036854775808", -9223372036854775808LL, 0);
17085 check("-9223372036854775808", -9223372036854775808LL, 0);
17086 check(" 9223372036854775807", 9223372036854775807LL, 0);
17087 check("-9223372036854775808", -9223372036854775808LL, 0);
17088 check(" 9223372036854775808", 9223372036854775807LL, ERANGE);
17089 check("-9223372036854775809", -9223372036854775808LL, ERANGE);
17095 if eval $compile; then
17098 ok) echo "Your strtoll() seems to be working okay." ;;
17100 Your strtoll() doesn't seem to be working okay.
17106 echo "(I can't seem to compile the test program--assuming it doesn't)"
17112 : see if strtoq exists
17113 set strtoq d_strtoq
17116 : see if strtoul exists
17117 set strtoul d_strtoul
17120 case "$d_strtoul" in
17123 Checking whether your strtoul() works okay...
17125 $cat >try.c <<'EOCP'
17128 extern unsigned long int strtoul(char *s, char **, int);
17129 static int bad = 0;
17130 void check(char *s, unsigned long eul, int een) {
17133 gul = strtoul(s, 0, 10);
17134 if (!((gul == eul) && (errno == een)))
17138 check(" 1", 1L, 0);
17139 check(" 0", 0L, 0);
17141 case "$longsize" in
17143 $cat >>try.c <<'EOCP'
17144 check("18446744073709551615", 18446744073709551615UL, 0);
17145 check("18446744073709551616", 18446744073709551615UL, ERANGE);
17146 #if 0 /* strtoul() for /^-/ strings is undefined. */
17147 check("-1", 18446744073709551615UL, 0);
17148 check("-18446744073709551614", 2, 0);
17149 check("-18446744073709551615", 1, 0);
17150 check("-18446744073709551616", 18446744073709551615UL, ERANGE);
17151 check("-18446744073709551617", 18446744073709551615UL, ERANGE);
17156 $cat >>try.c <<'EOCP'
17157 check("4294967295", 4294967295UL, 0);
17158 check("4294967296", 4294967295UL, ERANGE);
17159 #if 0 /* strtoul() for /^-/ strings is undefined. */
17160 check("-1", 4294967295UL, 0);
17161 check("-4294967294", 2, 0);
17162 check("-4294967295", 1, 0);
17163 check("-4294967296", 4294967295UL, ERANGE);
17164 check("-4294967297", 4294967295UL, ERANGE);
17169 : Should we write these tests to be more portable by sprintf-ing
17170 : ~0 and then manipulating that char string as input for strtol?
17173 $cat >>try.c <<'EOCP'
17180 if eval $compile; then
17181 case "`$run ./try`" in
17182 ok) echo "Your strtoul() seems to be working okay." ;;
17184 Your strtoul() doesn't seem to be working okay.
17193 : see if strtoull exists
17194 set strtoull d_strtoull
17197 case "$d_longlong-$d_strtoull" in
17200 Checking whether your strtoull() works okay...
17202 $cat >try.c <<'EOCP'
17205 #define strtoull __strtoull
17208 extern unsigned long long int strtoull(char *s, char **, int);
17209 static int bad = 0;
17210 int check(char *s, long long eull, int een) {
17213 gull = strtoull(s, 0, 10);
17214 if (!((gull == eull) && (errno == een)))
17218 check(" 1", 1LL, 0);
17219 check(" 0", 0LL, 0);
17220 check("18446744073709551615", 18446744073709551615ULL, 0);
17221 check("18446744073709551616", 18446744073709551615ULL, ERANGE);
17222 #if 0 /* strtoull() for /^-/ strings is undefined. */
17223 check("-1", 18446744073709551615ULL, 0);
17224 check("-18446744073709551614", 2LL, 0);
17225 check("-18446744073709551615", 1LL, 0);
17226 check("-18446744073709551616", 18446744073709551615ULL, ERANGE);
17227 check("-18446744073709551617", 18446744073709551615ULL, ERANGE);
17234 if eval $compile; then
17235 case "`$run ./try`" in
17236 ok) echo "Your strtoull() seems to be working okay." ;;
17238 Your strtoull() doesn't seem to be working okay.
17240 d_strtoull="$undef"
17247 : see if strtouq exists
17248 set strtouq d_strtouq
17251 case "$d_strtouq" in
17254 Checking whether your strtouq() works okay...
17256 $cat >try.c <<'EOCP'
17259 extern unsigned long long int strtouq(char *s, char **, int);
17260 static int bad = 0;
17261 void check(char *s, unsigned long long eull, int een) {
17262 unsigned long long gull;
17264 gull = strtouq(s, 0, 10);
17265 if (!((gull == eull) && (errno == een)))
17269 check(" 1", 1LL, 0);
17270 check(" 0", 0LL, 0);
17271 check("18446744073709551615", 18446744073709551615ULL, 0);
17272 check("18446744073709551616", 18446744073709551615ULL, ERANGE);
17273 #if 0 /* strtouq() for /^-/ strings is undefined. */
17274 check("-1", 18446744073709551615ULL, 0);
17275 check("-18446744073709551614", 2LL, 0);
17276 check("-18446744073709551615", 1LL, 0);
17277 check("-18446744073709551616", 18446744073709551615ULL, ERANGE);
17278 check("-18446744073709551617", 18446744073709551615ULL, ERANGE);
17286 if eval $compile; then
17287 case "`$run ./try`" in
17288 ok) echo "Your strtouq() seems to be working okay." ;;
17290 Your strtouq() doesn't seem to be working okay.
17299 : see if strxfrm exists
17300 set strxfrm d_strxfrm
17303 : see if symlink exists
17304 set symlink d_symlink
17307 : see if syscall exists
17308 set syscall d_syscall
17311 : see if prototype for syscall is available
17313 set d_syscallproto syscall $i_unistd unistd.h
17316 : see if sysconf exists
17317 set sysconf d_sysconf
17320 : see if system exists
17321 set system d_system
17324 : see if tcgetpgrp exists
17325 set tcgetpgrp d_tcgetpgrp
17328 : see if tcsetpgrp exists
17329 set tcsetpgrp d_tcsetpgrp
17332 : see if prototype for telldir is available
17334 set d_telldirproto telldir $i_systypes sys/types.h $i_dirent dirent.h
17337 : see if time exists
17339 if test "X$d_time" = X -o X"$timetype" = X; then
17340 if set time val -f d_time; eval $csym; $val; then
17341 echo 'time() found.' >&4
17343 rp="What is the type returned by time() on this system?"
17344 set time_t timetype long stdio.h sys/types.h
17347 echo 'time() not found, hope that will do.' >&4
17355 : see if this is a sys/times.h system
17356 set sys/times.h i_systimes
17359 : see if times exists
17361 if set times val -f d_times; eval $csym; $val; then
17362 echo 'times() found.' >&4
17365 case "$i_systimes" in
17366 "$define") inc='sys/times.h';;
17368 rp="What is the type returned by times() on this system?"
17369 set clock_t clocktype long stdio.h sys/types.h $inc
17372 echo 'times() NOT found, hope that will do.' >&4
17377 : see if tmpnam_r exists
17378 set tmpnam_r d_tmpnam_r
17380 case "$d_tmpnam_r" in
17382 hdrs="$i_systypes sys/types.h define stdio.h "
17383 case "$d_tmpnam_r_proto:$usethreads" in
17384 ":define") d_tmpnam_r_proto=define
17385 set d_tmpnam_r_proto tmpnam_r $hdrs
17389 case "$d_tmpnam_r_proto" in
17391 case "$tmpnam_r_proto" in
17392 ''|0) try='char* tmpnam_r(char*);'
17393 ./protochk "extern $try" $hdrs && tmpnam_r_proto=B_B ;;
17395 case "$tmpnam_r_proto" in
17396 ''|0) d_tmpnam_r=undef
17398 echo "Disabling tmpnam_r, cannot determine prototype." >&4 ;;
17399 * ) case "$tmpnam_r_proto" in
17400 REENTRANT_PROTO*) ;;
17401 *) tmpnam_r_proto="REENTRANT_PROTO_$tmpnam_r_proto" ;;
17403 echo "Prototype: $try" ;;
17406 *) case "$usethreads" in
17407 define) echo "tmpnam_r has no prototype, not using it." >&4 ;;
17414 *) tmpnam_r_proto=0
17418 : see if truncate exists
17419 set truncate d_truncate
17422 : see if ttyname_r exists
17423 set ttyname_r d_ttyname_r
17425 case "$d_ttyname_r" in
17427 hdrs="$i_systypes sys/types.h define stdio.h $i_unistd unistd.h"
17428 case "$d_ttyname_r_proto:$usethreads" in
17429 ":define") d_ttyname_r_proto=define
17430 set d_ttyname_r_proto ttyname_r $hdrs
17434 case "$d_ttyname_r_proto" in
17436 case "$ttyname_r_proto" in
17437 ''|0) try='int ttyname_r(int, char*, size_t);'
17438 ./protochk "extern $try" $hdrs && ttyname_r_proto=I_IBW ;;
17440 case "$ttyname_r_proto" in
17441 ''|0) try='int ttyname_r(int, char*, int);'
17442 ./protochk "extern $try" $hdrs && ttyname_r_proto=I_IBI ;;
17444 case "$ttyname_r_proto" in
17445 ''|0) try='char* ttyname_r(int, char*, int);'
17446 ./protochk "extern $try" $hdrs && ttyname_r_proto=B_IBI ;;
17448 case "$ttyname_r_proto" in
17449 ''|0) d_ttyname_r=undef
17451 echo "Disabling ttyname_r, cannot determine prototype." >&4 ;;
17452 * ) case "$ttyname_r_proto" in
17453 REENTRANT_PROTO*) ;;
17454 *) ttyname_r_proto="REENTRANT_PROTO_$ttyname_r_proto" ;;
17456 echo "Prototype: $try" ;;
17459 *) case "$usethreads" in
17460 define) echo "ttyname_r has no prototype, not using it." >&4 ;;
17467 *) ttyname_r_proto=0
17471 : see if tzname[] exists
17473 if set tzname val -a d_tzname; eval $csym; $val; then
17475 echo 'tzname[] found.' >&4
17478 echo 'tzname[] NOT found.' >&4
17484 next|rhapsody|darwin) multiarch="$define" ;;
17486 case "$multiarch" in
17487 ''|[nN]*) multiarch="$undef" ;;
17490 : check for ordering of bytes in a UV
17492 case "$usecrosscompile$multiarch" in
17495 You seem to be either cross-compiling or doing a multiarchitecture build,
17496 skipping the byteorder check.
17502 case "$byteorder" in
17505 In the following, larger digits indicate more significance. A big-endian
17506 machine like a Pyramid or a Motorola 680?0 chip will come out to 4321. A
17507 little-endian machine like a Vax or an Intel 80?86 chip would be 1234. Other
17508 machines may have weird orders like 3412. A Cray will report 87654321,
17509 an Alpha will report 12345678. If the test program works the default is
17511 I'm now running the test program...
17515 #$i_stdlib I_STDLIB
17517 #include <stdlib.h>
17519 #include <sys/types.h>
17520 typedef $uvtype UV;
17530 u.l = (((UV)0x08070605) << 32) | (UV)0x04030201;
17532 u.l = (UV)0x04030201;
17533 for (i = 0; i < $uvsize; i++)
17534 printf("%c", u.c[i]+'0');
17541 if eval $compile && ./try > /dev/null; then
17544 [1-4][1-4][1-4][1-4]|12345678|87654321)
17545 echo "(The test program ran ok.)"
17546 echo "byteorder=$dflt"
17549 ????|????????) echo "(The test program ran ok.)" ;;
17550 *) echo "(The test program didn't run right for some reason.)" ;;
17555 (I can't seem to compile the test program. Guessing big-endian...)
17558 case "$xxx_prompt" in
17560 rp="What is the order of bytes in $uvtype?"
17576 Checking to see whether you can access character data unalignedly...
17578 case "$d_u32align" in
17579 '') $cat >try.c <<EOCP
17581 #$i_stdlib I_STDLIB
17583 #include <stdlib.h>
17585 #define U32 $u32type
17586 #define BYTEORDER 0x$byteorder
17588 #include <signal.h>
17590 $signal_t bletch(s) int s; { exit(4); }
17593 #if BYTEORDER == 0x1234 || BYTEORDER == 0x4321
17598 if (sizeof(U32) != 4) {
17599 printf("sizeof(U32) is not 4, but %d\n", sizeof(U32));
17606 signal(SIGBUS, bletch);
17618 for (i = 0; i < 4; i++) {
17619 up = (U32*)(buf + i);
17620 if (! ((*up == 1 << (8*i)) || /* big-endian */
17621 (*up == 1 << (8*(3-i))) /* little-endian */
17625 printf("read failed (%x)\n", *up);
17631 for (i = 0; i < 4; i++) {
17632 up = (U32*)(buf + i);
17634 if (*up != 0xBeef) {
17635 printf("write failed (%x)\n", *up);
17649 if eval $compile_ok; then
17650 echo "(Testing for character data alignment may crash the test. That's okay.)" >&4
17651 $run ./try 2>&1 >/dev/null
17654 You can access character data pretty unalignedly.
17656 d_u32align="$undef"
17659 It seems that you must access character data in an aligned manner.
17661 d_u32align="$define"
17665 rp='Can you access character data at unaligned addresses?'
17669 [yY]*) d_u32align="$undef" ;;
17670 *) d_u32align="$define" ;;
17673 $rm -f core core.try.* try.core
17677 : see if ualarm exists
17678 set ualarm d_ualarm
17681 : see if umask exists
17685 : see if unordered exists
17686 set unordered d_unordered
17689 : see if unsetenv exists
17690 set unsetenv d_unsetenv
17693 : see if usleep exists
17694 set usleep d_usleep
17697 : see if prototype for usleep is available
17699 set d_usleepproto usleep $i_unistd unistd.h
17702 : see if ustat exists
17706 : backward compatibility for d_hvfork
17707 if test X$d_hvfork != X; then
17708 d_vfork="$d_hvfork"
17711 : see if there is a vfork
17716 : Ok, but do we want to use it. vfork is reportedly unreliable in
17717 : perl on Solaris 2.x, and probably elsewhere.
17721 case "$usevfork" in
17727 Perl can only use a vfork() that doesn't suffer from strict
17728 restrictions on calling functions or modifying global data in
17729 the child. For example, glibc-2.1 contains such a vfork()
17730 that is unsuitable. If your system provides a proper fork()
17731 call, chances are that you do NOT want perl to use vfork().
17734 rp="Do you still want to use vfork()?"
17739 echo "Ok, we won't use vfork()."
17748 $define) usevfork='true';;
17749 *) usevfork='false';;
17752 : see if closedir exists
17753 set closedir d_closedir
17756 case "$d_closedir" in
17759 echo "Checking whether closedir() returns a status..." >&4
17761 #$i_dirent I_DIRENT /**/
17762 #$i_sysdir I_SYS_DIR /**/
17763 #$i_sysndir I_SYS_NDIR /**/
17764 #$i_systypes I_SYS_TYPES /**/
17766 #if defined(I_SYS_TYPES)
17767 #include <sys/types.h>
17769 #if defined(I_DIRENT)
17770 #include <dirent.h>
17771 #if defined(NeXT) && defined(I_SYS_DIR) /* NeXT needs dirent + sys/dir.h */
17772 #include <sys/dir.h>
17776 #include <sys/ndir.h>
17780 #include <ndir.h> /* may be wrong in the future */
17782 #include <sys/dir.h>
17787 int main() { return closedir(opendir(".")); }
17790 if eval $compile_ok; then
17791 if $run ./try > /dev/null 2>&1 ; then
17792 echo "Yes, it does."
17795 echo "No, it doesn't."
17799 echo "(I can't seem to compile the test program--assuming it doesn't)"
17807 set d_void_closedir
17810 : see if there is a wait4
17814 : see if waitpid exists
17815 set waitpid d_waitpid
17818 : see if wcstombs exists
17819 set wcstombs d_wcstombs
17822 : see if wctomb exists
17823 set wctomb d_wctomb
17826 : see if writev exists
17827 set writev d_writev
17830 : preserve RCS keywords in files with variable substitution, grrr
17835 Revision='$Revision'
17837 : check for alignment requirements
17839 case "$usecrosscompile$multiarch" in
17842 You seem to be either cross-compiling or doing a multiarchitecture build,
17843 skipping the memory alignment check.
17846 case "$alignbytes" in
17847 '') alignbytes=8 ;;
17851 case "$alignbytes" in
17852 '') echo "Checking alignment constraints..." >&4
17853 if $test "X$uselongdouble" = Xdefine -a "X$d_longdbl" = Xdefine; then
17854 $cat >try.c <<'EOCP'
17855 typedef long double NV;
17858 $cat >try.c <<'EOCP'
17862 $cat >>try.c <<'EOCP'
17870 printf("%d\n", (int)((char *)&try_algn.bar - (char *)&try_algn.foo));
17875 if eval $compile_ok; then
17879 echo "(I can't seem to compile the test program...)"
17882 *) dflt="$alignbytes"
17885 rp="Doubles must be aligned on a how-many-byte boundary?"
17893 : set the base revision
17896 : how do we concatenate cpp tokens here?
17898 echo "Checking to see how your cpp does stuff like concatenate tokens..." >&4
17899 $cat >cpp_stuff.c <<'EOCP'
17900 #define RCAT(a,b)a/**/b
17901 #define ACAT(a,b)a ## b
17905 $cppstdin $cppflags $cppminus <cpp_stuff.c >cpp_stuff.out 2>&1
17906 if $contains 'Circus' cpp_stuff.out >/dev/null 2>&1; then
17907 echo "Oh! Smells like ANSI's been here." >&4
17908 echo "We can catify or stringify, separately or together!"
17910 elif $contains 'Reiser' cpp_stuff.out >/dev/null 2>&1; then
17911 echo "Ah, yes! The good old days!" >&4
17912 echo "However, in the good old days we don't know how to stringify and"
17913 echo "catify at the same time."
17917 Hmm, I don't seem to be able to concatenate tokens with your cpp.
17918 You're going to have to edit the values of CAT[2-5] in config.h...
17920 cpp_stuff="/* Help! How do we handle cpp_stuff? */*/"
17924 : see if this is a db.h system
17930 : Check db version.
17932 echo "Checking Berkeley DB version ..." >&4
17938 #include <sys/types.h>
17940 #$i_stdlib I_STDLIB
17942 #include <stdlib.h>
17945 int main(int argc, char *argv[])
17947 #ifdef DB_VERSION_MAJOR /* DB version >= 2 */
17948 int Major, Minor, Patch ;
17949 unsigned long Version ;
17950 (void)db_version(&Major, &Minor, &Patch) ;
17952 printf("%d %d %d %d %d %d\n",
17953 DB_VERSION_MAJOR, DB_VERSION_MINOR, DB_VERSION_PATCH,
17954 Major, Minor, Patch);
17957 printf("You have Berkeley DB Version 2 or greater.\n");
17959 printf("db.h is from Berkeley DB Version %d.%d.%d\n",
17960 DB_VERSION_MAJOR, DB_VERSION_MINOR, DB_VERSION_PATCH);
17961 printf("libdb is from Berkeley DB Version %d.%d.%d\n",
17962 Major, Minor, Patch) ;
17964 /* check that db.h & libdb are compatible */
17965 if (DB_VERSION_MAJOR != Major || DB_VERSION_MINOR != Minor || DB_VERSION_PATCH != Patch) {
17966 printf("db.h and libdb are incompatible.\n") ;
17970 printf("db.h and libdb are compatible.\n") ;
17972 Version = DB_VERSION_MAJOR * 1000000 + DB_VERSION_MINOR * 1000
17973 + DB_VERSION_PATCH ;
17975 /* needs to be >= 2.3.4 */
17976 if (Version < 2003004) {
17977 /* if (DB_VERSION_MAJOR == 2 && DB_VERSION_MINOR == 0 && DB_VERSION_PATCH < 5) { */
17978 printf("Perl needs Berkeley DB 2.3.4 or greater.\n") ;
17984 #if defined(_DB_H_) && defined(BTREEMAGIC) && defined(HASHMAGIC)
17989 printf("You have Berkeley DB Version 1.\n");
17990 exit(0); /* DB version < 2: the coast is clear. */
17992 exit(1); /* <db.h> not Berkeley DB? */
17998 if eval $compile_ok && $run ./try; then
17999 echo 'Looks OK.' >&4
18001 db_version_major=$1
18002 db_version_minor=$2
18003 db_version_patch=$3
18005 echo "I can't use Berkeley DB with your <db.h>. I'll disable Berkeley DB." >&4
18009 : Remove db from list of libraries to use
18010 echo "Removing unusable -ldb from library list" >&4
18011 set `echo X $libs | $sed -e 's/-ldb / /' -e 's/-ldb$//'`
18014 echo "libs = $libs" >&4
18024 : Check the return type needed for hash
18026 echo "Checking return type needed for hash for Berkeley DB ..." >&4
18032 #include <sys/types.h>
18035 #ifndef DB_VERSION_MAJOR
18036 u_int32_t hash_cb (ptr, size)
18044 info.hash = hash_cb;
18048 if $cc $ccflags -c try.c >try.out 2>&1 ; then
18049 if $contains warning try.out >>/dev/null 2>&1 ; then
18052 db_hashtype='u_int32_t'
18055 : XXX Maybe we should just give up here.
18056 db_hashtype=u_int32_t
18058 echo "Help: I can't seem to compile the db test program." >&4
18059 echo "Something's wrong, but I'll assume you use $db_hashtype." >&4
18062 echo "Your version of Berkeley DB uses $db_hashtype for hash."
18064 *) db_hashtype=u_int32_t
18069 : Check the return type needed for prefix
18071 echo "Checking return type needed for prefix for Berkeley DB ..." >&4
18077 #include <sys/types.h>
18080 #ifndef DB_VERSION_MAJOR
18081 size_t prefix_cb (key1, key2)
18089 info.prefix = prefix_cb;
18093 if $cc $ccflags -c try.c >try.out 2>&1 ; then
18094 if $contains warning try.out >>/dev/null 2>&1 ; then
18095 db_prefixtype='int'
18097 db_prefixtype='size_t'
18100 db_prefixtype='size_t'
18101 : XXX Maybe we should just give up here.
18103 echo "Help: I can't seem to compile the db test program." >&4
18104 echo "Something's wrong, but I'll assume you use $db_prefixtype." >&4
18107 echo "Your version of Berkeley DB uses $db_prefixtype for prefix."
18109 *) db_prefixtype='size_t'
18114 : How can we generate normalized random numbers ?
18116 echo "Looking for a random number function..." >&4
18117 case "$randfunc" in
18119 if set drand48 val -f; eval $csym; $val; then
18121 echo "Good, found drand48()." >&4
18122 elif set random val -f; eval $csym; $val; then
18124 echo "OK, found random()." >&4
18127 echo "Yick, looks like I have to use rand()." >&4
18138 *-Dmy_rand=*|*-Dmy_srand=*)
18139 echo "Removing obsolete -Dmy_rand, -Dmy_srand, and -Drandbits from ccflags." >&4
18140 ccflags="`echo $ccflags | sed -e 's/-Dmy_rand=random/ /'`"
18141 ccflags="`echo $ccflags | sed -e 's/-Dmy_srand=srandom/ /'`"
18142 ccflags="`echo $ccflags | sed -e 's/-Drandbits=[0-9][0-9]*/ /'`"
18146 while $test "$cont"; do
18147 rp="Use which function to generate random numbers?"
18149 if $test "$ans" = "$dflt"; then
18155 if set $ans val -f; eval $csym; $val; then
18159 rp="I cannot find function $ans. Use that name anyway?"
18168 case "$randfunc" in
18170 drand01="drand48()"
18176 case "$randbits" in
18178 echo "Checking to see how many bits your $randfunc() function produces..." >&4
18180 #$i_unistd I_UNISTD
18181 #$i_stdlib I_STDLIB
18184 # include <unistd.h>
18187 # include <stdlib.h>
18192 register unsigned long tmp;
18193 register unsigned long max = 0L;
18195 for (i = 1000; i; i--) {
18196 tmp = (unsigned long) $randfunc();
18197 if (tmp > max) max = tmp;
18199 for (i = 0; max; i++)
18205 if eval $compile_ok; then
18209 echo "(I can't seem to compile the test program...)"
18216 rp="How many bits does your $randfunc() function produce?"
18220 drand01="($randfunc() / (double) ((unsigned long)1 << $randbits))"
18221 seedfunc="s$randfunc"
18222 randseedtype=unsigned
18226 rp="How many bits does your $randfunc() function produce?"
18229 seedfunc="s$randfunc"
18230 drand01="($randfunc() / (double) ((unsigned long)1 << $randbits))"
18231 if set $seedfunc val -f; eval $csym; $val; then
18232 echo "(Using $seedfunc() to seed random generator)"
18234 echo "(Warning: no $seedfunc() to seed random generator)"
18237 randseedtype=unsigned
18245 echo "Determining whether or not we are on an EBCDIC system..." >&4
18246 $cat >try.c <<'EOM'
18249 if ('M'==0xd4) return 0;
18256 if eval $compile_ok; then
18257 if $run ./try; then
18258 echo "You seem to speak EBCDIC." >&4
18261 echo "Nope, no EBCDIC, probably ASCII or some ISO Latin. Or UTF-8." >&4
18264 echo "I'm unable to compile the test program." >&4
18265 echo "I'll assume ASCII or some ISO Latin. Or UTF8." >&4
18273 Checking how to flush all pending stdio output...
18275 # I only know how to find the first 32 possibly open files on SunOS.
18276 # See also hints/sunos_4_1.sh and util.c --AD
18278 sunos) $echo '#define PERL_FFLUSH_ALL_FOPEN_MAX 32' > try.c ;;
18280 $cat >>try.c <<EOCP
18282 #$i_stdlib I_STDLIB
18284 #include <stdlib.h>
18286 #$i_unistd I_UNISTD
18288 # include <unistd.h>
18290 #$d_sysconf HAS_SYSCONF
18291 #$d_stdio_stream_array HAS_STDIO_STREAM_ARRAY
18292 #ifdef HAS_STDIO_STREAM_ARRAY
18293 # define STDIO_STREAM_ARRAY $stdio_stream_array
18298 p = fopen("try.out", "w");
18302 # ifdef TRY_FPRINTF
18306 #ifdef TRY_FFLUSH_NULL
18309 #ifdef TRY_FFLUSH_ALL
18311 long open_max = -1;
18312 # ifdef PERL_FFLUSH_ALL_FOPEN_MAX
18313 open_max = PERL_FFLUSH_ALL_FOPEN_MAX;
18315 # if defined(HAS_SYSCONF) && defined(_SC_OPEN_MAX)
18316 open_max = sysconf(_SC_OPEN_MAX);
18319 open_max = FOPEN_MAX;
18322 open_max = OPEN_MAX;
18331 # ifdef HAS_STDIO_STREAM_ARRAY
18332 if (open_max > 0) {
18334 for (i = 0; i < open_max; i++)
18335 if (STDIO_STREAM_ARRAY[i]._file >= 0 &&
18336 STDIO_STREAM_ARRAY[i]._file < open_max &&
18337 STDIO_STREAM_ARRAY[i]._flag)
18338 fflush(&STDIO_STREAM_ARRAY[i]);
18346 : first we have to find out how _not_ to flush
18348 if $test "X$fflushNULL" = X -o "X$fflushall" = X; then
18350 set try -DTRY_FPUTC
18351 if eval $compile; then
18352 $run ./try 2>/dev/null
18355 if $test ! -s try.out -a "X$code" = X42; then
18361 set try -DTRY_FPRINTF
18362 if eval $compile; then
18363 $run ./try 2>/dev/null
18366 if $test ! -s try.out -a "X$code" = X42; then
18367 output=-DTRY_FPRINTF
18373 : check for fflush NULL behaviour
18374 case "$fflushNULL" in
18375 '') set try -DTRY_FFLUSH_NULL $output
18376 if eval $compile; then
18377 $run ./try 2>/dev/null
18380 if $test -s try.out -a "X$code" = X42; then
18381 fflushNULL="`$cat try.out`"
18383 if $test "X$code" != X42; then
18385 (If this test failed, don't worry, we'll try another method shortly.)
18390 $rm -f core try.core core.try.*
18391 case "$fflushNULL" in
18393 Your fflush(NULL) works okay for output streams.
18394 Let's see if it clobbers input pipes...
18396 # As of mid-March 2000 all versions of Solaris appear to have a stdio
18397 # bug that improperly flushes the input end of pipes. So we avoid the
18398 # autoflush on fork/system/exec support for now. :-(
18399 $cat >tryp.c <<EOCP
18402 main(int argc, char **argv)
18408 while ((i = getc(stdin)) != -1
18409 && (*bp++ = i) != '\n'
18410 && bp < &buf[1024])
18413 fprintf(stdout, "%s", buf);
18421 fflushNULL="$define"
18423 if eval $compile; then
18425 $cat tryp.c | $run ./tryp 2>/dev/null > tryp.out
18426 if cmp tryp.c tryp.out >/dev/null 2>&1; then
18428 fflush(NULL) seems to behave okay with input streams.
18430 fflushNULL="$define"
18433 Ouch, fflush(NULL) clobbers input pipes! We will not use it.
18435 fflushNULL="$undef"
18438 $rm -f core tryp.c tryp.core core.tryp.*
18441 Your fflush(NULL) isn't working (contrary to ANSI C).
18443 fflushNULL="$undef"
18446 Cannot figure out whether your fflush(NULL) works or not.
18447 I'm assuming it doesn't (contrary to ANSI C).
18449 fflushNULL="$undef"
18453 $define|true|[yY]*)
18454 fflushNULL="$define"
18457 fflushNULL="$undef"
18460 : check explicit looping only if NULL did not work, and if the pipe
18461 : bug does not show up on an explicit flush too
18462 case "$fflushNULL" in
18464 $cat >tryp.c <<EOCP
18467 main(int argc, char **argv)
18473 while ((i = getc(stdin)) != -1
18474 && (*bp++ = i) != '\n'
18475 && bp < &buf[1024])
18478 fprintf(stdout, "%s", buf);
18487 if eval $compile; then
18489 $cat tryp.c | $run ./tryp 2>/dev/null > tryp.out
18490 if cmp tryp.c tryp.out >/dev/null 2>&1; then
18492 Good, at least fflush(stdin) seems to behave okay when stdin is a pipe.
18494 : now check for fflushall behaviour
18495 case "$fflushall" in
18496 '') set try -DTRY_FFLUSH_ALL $output
18497 if eval $compile; then
18499 (Now testing the other method--but note that this also may fail.)
18501 $run ./try 2>/dev/null
18504 if $test -s try.out -a "X$code" = X42; then
18505 fflushall="`$cat try.out`"
18508 $rm -f core try.core core.try.*
18509 case "$fflushall" in
18511 Whew. Flushing explicitly all the stdio streams works.
18513 fflushall="$define"
18516 Sigh. Flushing explicitly all the stdio streams doesn't work.
18521 Cannot figure out whether flushing stdio streams explicitly works or not.
18522 I'm assuming it doesn't.
18528 "$define"|true|[yY]*)
18529 fflushall="$define"
18537 All is futile. Even fflush(stdin) clobbers input pipes!
18544 $rm -f core tryp.c tryp.core core.tryp.*
18546 *) fflushall="$undef"
18550 case "$fflushNULL$fflushall" in
18553 OK, I give up. I cannot figure out how to flush pending stdio output.
18554 We won't be flushing handles at all before fork/exec/popen.
18558 $rm -f try.* try$exe_ext
18560 : Store the full pathname to the ar program for use in the C program
18561 : Respect a hint or command line value for full_ar.
18566 : Store the full pathname to the sed program for use in the C program
18569 : see what type gids are declared as in the kernel
18571 echo "Looking for the type for group ids returned by getgid()."
18572 set gid_t gidtype xxx stdio.h sys/types.h
18576 xxx=`./findhdr sys/user.h`
18577 set `grep 'groups\[NGROUPS\];' "$xxx" 2>/dev/null` unsigned short
18579 unsigned) dflt="$1 $2" ;;
18583 *) dflt="$gidtype";;
18586 gid_t) echo "gid_t found." ;;
18587 *) rp="What is the type for group ids returned by getgid()?"
18595 *_t) zzz="$gidtype" ;;
18598 echo "Checking the size of $zzz..." >&4
18600 #include <sys/types.h>
18602 #$i_stdlib I_STDLIB
18604 #include <stdlib.h>
18607 printf("%d\n", (int)sizeof($gidtype));
18612 if eval $compile_ok; then
18616 echo "(I can't execute the test program--guessing $gidsize.)" >&4
18619 echo "Your $zzz is $gidsize bytes long."
18624 echo "(I can't compile the test program--guessing $gidsize.)" >&4
18630 *_t) zzz="$gidtype" ;;
18633 echo "Checking the sign of $zzz..." >&4
18635 #include <sys/types.h>
18646 if eval $compile; then
18650 echo "(I can't execute the test program--guessing unsigned.)" >&4
18654 1) echo "Your $zzz is unsigned." ;;
18655 -1) echo "Your $zzz is signed." ;;
18661 echo "(I can't compile the test program--guessing unsigned.)" >&4
18667 if $test X"$quadtype" != X; then
18669 echo "Checking how to print 64-bit integers..." >&4
18671 if $test X"$sPRId64" = X -a X"$quadtype" = Xint; then
18672 $cat >try.c <<'EOCP'
18673 #include <sys/types.h>
18676 int q = 12345678901;
18677 printf("%ld\n", q);
18681 if eval $compile; then
18685 sPRId64='"d"'; sPRIi64='"i"'; sPRIu64='"u"';
18686 sPRIo64='"o"'; sPRIx64='"x"'; sPRIXU64='"X"';
18687 echo "We will use %d."
18693 if $test X"$sPRId64" = X -a X"$quadtype" = Xlong; then
18694 $cat >try.c <<'EOCP'
18695 #include <sys/types.h>
18698 long q = 12345678901;
18699 printf("%ld\n", q);
18703 if eval $compile; then
18707 sPRId64='"ld"'; sPRIi64='"li"'; sPRIu64='"lu"';
18708 sPRIo64='"lo"'; sPRIx64='"lx"'; sPRIXU64='"lX"';
18709 echo "We will use %ld."
18715 if $test X"$sPRId64" = X -a X"$i_inttypes" = X"$define" -a X"$quadtype" = Xint64_t; then
18716 $cat >try.c <<'EOCP'
18717 #include <sys/types.h>
18718 #include <inttypes.h>
18721 int64_t q = 12345678901;
18722 printf("%" PRId64 "\n", q);
18726 if eval $compile; then
18730 sPRId64=PRId64; sPRIi64=PRIi64; sPRIu64=PRIu64;
18731 sPRIo64=PRIo64; sPRIx64=PRIx64; sPRIXU64=PRIXU64;
18732 echo "We will use the C9X style."
18738 if $test X"$sPRId64" = X -a X"$quadtype" != X; then
18740 #include <sys/types.h>
18743 $quadtype q = 12345678901;
18744 printf("%Ld\n", q);
18748 if eval $compile; then
18752 sPRId64='"Ld"'; sPRIi64='"Li"'; sPRIu64='"Lu"';
18753 sPRIo64='"Lo"'; sPRIx64='"Lx"'; sPRIXU64='"LX"';
18754 echo "We will use %Ld."
18760 if $test X"$sPRId64" = X -a X"$quadtype" = X"long long"; then
18761 $cat >try.c <<'EOCP'
18762 #include <sys/types.h>
18765 long long q = 12345678901LL; /* AIX cc requires the LL suffix. */
18766 printf("%lld\n", q);
18770 if eval $compile; then
18774 sPRId64='"lld"'; sPRIi64='"lli"'; sPRIu64='"llu"';
18775 sPRIo64='"llo"'; sPRIx64='"llx"'; sPRIXU64='"llX"';
18776 echo "We will use the %lld style."
18782 if $test X"$sPRId64" = X -a X"$quadtype" != X; then
18784 #include <sys/types.h>
18787 $quadtype q = 12345678901;
18788 printf("%qd\n", q);
18792 if eval $compile; then
18796 sPRId64='"qd"'; sPRIi64='"qi"'; sPRIu64='"qu"';
18797 sPRIo64='"qo"'; sPRIx64='"qx"'; sPRIXU64='"qX"';
18798 echo "We will use %qd."
18804 if $test X"$sPRId64" = X; then
18805 echo "Cannot figure out how to print 64-bit integers." >&4
18813 '') d_PRId64="$undef"; d_PRIi64="$undef"; d_PRIu64="$undef";
18814 d_PRIo64="$undef"; d_PRIx64="$undef"; d_PRIXU64="$undef";
18816 *) d_PRId64="$define"; d_PRIi64="$define"; d_PRIu64="$define";
18817 d_PRIo64="$define"; d_PRIx64="$define"; d_PRIXU64="$define";
18823 $echo "Checking the format strings to be used for Perl's internal types..." >&4
18825 if $test X"$ivsize" = X8; then
18826 ivdformat="$sPRId64"
18827 uvuformat="$sPRIu64"
18828 uvoformat="$sPRIo64"
18829 uvxformat="$sPRIx64"
18830 uvXUformat="$sPRIXU64"
18832 if $test X"$ivsize" = X"$longsize"; then
18839 if $test X"$ivsize" = X"$intsize"; then
18847 if $test X"$ivsize" = X"$shortsize"; then
18858 if $test X"$uselongdouble" = X"$define" -a X"$d_longdbl" = X"$define" -a X"$d_PRIgldbl" = X"$define"; then
18859 nveformat="$sPRIeldbl"
18860 nvfformat="$sPRIfldbl"
18861 nvgformat="$sPRIgldbl"
18862 nvEUformat="$sPRIEUldbl"
18863 nvFUformat="$sPRIFUldbl"
18864 nvGUformat="$sPRIGUldbl"
18874 case "$ivdformat" in
18875 '') echo "$0: Fatal: failed to find format strings, cannot continue." >&4
18882 $echo "Checking the format string to be used for gids..." >&4
18885 -1) if $test X"$gidsize" = X"$ivsize"; then
18886 gidformat="$ivdformat"
18888 if $test X"$gidsize" = X"$longsize"; then
18891 if $test X"$gidsize" = X"$intsize"; then
18894 if $test X"$gidsize" = X"$shortsize"; then
18901 *) if $test X"$gidsize" = X"$uvsize"; then
18902 gidformat="$uvuformat"
18904 if $test X"$gidsize" = X"$longsize"; then
18907 if $test X"$gidsize" = X"$intsize"; then
18910 if $test X"$gidsize" = X"$shortsize"; then
18919 : see if getgroups exists
18920 set getgroups d_getgrps
18923 : see if setgroups exists
18924 set setgroups d_setgrps
18928 : Find type of 2nd arg to 'getgroups()' and 'setgroups()'
18930 case "$d_getgrps$d_setgrps" in
18932 case "$groupstype" in
18933 '') dflt="$gidtype" ;;
18934 *) dflt="$groupstype" ;;
18937 What type of pointer is the second argument to getgroups() and setgroups()?
18938 Usually this is the same as group ids, $gidtype, but not always.
18941 rp='What type pointer is the second argument to getgroups() and setgroups()?'
18945 *) groupstype="$gidtype";;
18949 if $test $patchlevel -lt 9; then
18950 : MAD is not available in 5.8.x or earlier.
18954 $define|true|[yY]*) dflt='y' ;;
18959 Would you like to build with Misc Attribute Decoration? This is development
18960 work leading to a Perl 5 to Perl 6 convertor, which imposes a space and speed
18961 overhead on the interpreter.
18963 If this doesn't make any sense to you, just accept the default '$dflt'.
18965 rp='Build Perl with MAD?'
18970 madlyh='madly.h madly.act madly.tab'
18972 madlyobj="madly$_o" ;;
18982 echo "Checking if your $make program sets \$(MAKE)..." >&4
18983 case "$make_set_make" in
18985 $sed 's/^X //' > testmake.mak << 'EOF'
18987 X @echo 'maketemp="$(MAKE)"'
18989 case "`$make -f testmake.mak 2>/dev/null`" in
18990 *maketemp=*) make_set_make='#' ;;
18991 *) make_set_make="MAKE=$make" ;;
18993 $rm -f testmake.mak
18996 case "$make_set_make" in
18997 '#') echo "Yup, it does.";;
18998 *) echo "Nope, it doesn't.";;
19001 : see what type is used for mode_t
19002 rp="What is the type used for file modes for system calls (e.g. fchmod())?"
19003 set mode_t modetype int stdio.h sys/types.h
19006 : see if stdarg is available
19008 if $test `./findhdr stdarg.h`; then
19009 echo "<stdarg.h> found." >&4
19012 echo "<stdarg.h> NOT found." >&4
19016 : see if varags is available
19018 if $test `./findhdr varargs.h`; then
19019 echo "<varargs.h> found." >&4
19021 echo "<varargs.h> NOT found, but that's ok (I hope)." >&4
19024 : set up the varargs testing programs
19025 $cat > varargs.c <<EOP
19027 #include <stdarg.h>
19030 #include <varargs.h>
19034 int f(char *p, ...)
19048 p = va_arg(ap, char *);
19053 $cat > varargs <<EOP
19055 if $cc -c $ccflags -D\$1 varargs.c >/dev/null 2>&1; then
19064 : now check which varargs header should be included
19069 if `./varargs I_STDARG`; then
19071 elif `./varargs I_VARARGS`; then
19076 if `./varargs I_VARARGS`; then
19083 echo "I could not find the definition for va_dcl... You have problems..." >&4
19084 val="$undef"; set i_stdarg; eval $setvar
19085 val="$undef"; set i_varargs; eval $setvar
19090 case "$i_varhdr" in
19092 val="$define"; set i_stdarg; eval $setvar
19093 val="$undef"; set i_varargs; eval $setvar
19096 val="$undef"; set i_stdarg; eval $setvar
19097 val="$define"; set i_varargs; eval $setvar
19100 echo "We'll include <$i_varhdr> to get va_dcl definition." >&4;;
19104 : see if we need va_copy
19106 case "$i_stdarg" in
19109 #include <stdarg.h>
19111 #$i_stdlib I_STDLIB
19113 #include <stdlib.h>
19115 #include <signal.h>
19118 ivfprintf(FILE *f, const char *fmt, va_list *valp)
19120 return vfprintf(f, fmt, *valp);
19124 myvfprintf(FILE *f, const char *fmt, va_list val)
19126 return ivfprintf(f, fmt, &val);
19130 myprintf(char *fmt, ...)
19133 va_start(val, fmt);
19134 return myvfprintf(stdout, fmt, val);
19138 main(int ac, char **av)
19140 signal(SIGSEGV, exit);
19142 myprintf("%s%cs all right, then\n", "that", '\'');
19147 if eval $compile && $run ./try 2>&1 >/dev/null; then
19148 case "`$run ./try`" in
19149 "that's all right, then")
19155 yes) echo "It seems that you don't need va_copy()." >&4
19156 need_va_copy="$undef"
19158 *) echo "It seems that va_copy() or similar will be needed." >&4
19159 need_va_copy="$define"
19162 $rm -f try.* core core.* *.core *.core.*
19164 *) echo "You don't have <stdarg.h>, not checking for va_copy()." >&4
19168 : see if the Compiler supports C99 variadic macros
19169 case "$i_stdarg$i_stdlib" in
19171 echo "You have <stdarg.h> and <stdlib.h>, so checking for C99 variadic macros." >&4
19174 #include <stdarg.h>
19176 #define foo(buffer, format, ...) sprintf(buffer, format, __VA_ARGS__)
19180 foo(buf, "%d %g %.*s", 123, 456.0, (int)3, "789fail");
19186 if eval $compile && $run ./try 2>&1 >/dev/null; then
19187 case "`$run ./try`" in
19189 echo "You have C99 variadic macros." >&4
19190 d_c99_variadic_macros="$define"
19193 echo "You don't have functional C99 variadic macros." >&4
19194 d_c99_variadic_macros="$undef"
19198 echo "I couldn't compile and run the test program, so I assume that you don't have functional C99 variadic macros." >&4
19199 d_c99_variadic_macros="$undef"
19203 echo "You don't have <stdarg.h> and <stdlib.h>, so not checking for C99 variadic macros." >&4
19204 d_c99_variadic_macros="$undef"
19208 : see what type is used for size_t
19209 rp="What is the type used for the length parameter for string functions?"
19210 set size_t sizetype 'unsigned int' stdio.h sys/types.h
19213 : check for type of arguments to gethostbyaddr.
19214 if test "X$netdb_host_type" = X -o "X$netdb_hlen_type" = X; then
19215 case "$d_gethbyaddr" in
19219 Checking to see what type of arguments are accepted by gethostbyaddr().
19221 hdrs="$define sys/types.h
19222 $d_socket sys/socket.h
19223 $i_niin netinet/in.h
19225 $i_unistd unistd.h"
19226 : The first arg can 'char *' or 'void *'
19227 : The second arg is some of integral type
19228 for xxx in in_addr_t 'const void *' 'const char *' 'void *' 'char *'; do
19229 for yyy in size_t long int; do
19230 case "$netdb_host_type" in
19231 '') try="extern struct hostent *gethostbyaddr($xxx, $yyy, int);"
19232 if ./protochk "$try" $hdrs; then
19233 echo "Your system accepts $xxx for the first arg."
19234 echo "...and $yyy for the second arg."
19235 netdb_host_type="$xxx"
19236 netdb_hlen_type="$yyy"
19242 : In case none of those worked, prompt the user.
19243 case "$netdb_host_type" in
19244 '') rp='What is the type for the 1st argument to gethostbyaddr?'
19247 netdb_host_type=$ans
19248 rp='What is the type for the 2nd argument to gethostbyaddr?'
19251 netdb_hlen_type=$ans
19255 *) : no gethostbyaddr, so pick harmless defaults
19256 netdb_host_type='char *'
19257 netdb_hlen_type="$sizetype"
19260 # Remove the "const" if needed. -- but then we'll have a
19262 # netdb_host_type=`echo "$netdb_host_type" | sed 's/^const //'`
19265 : check for type of argument to gethostbyname.
19266 if test "X$netdb_name_type" = X ; then
19267 case "$d_gethbyname" in
19271 Checking to see what type of argument is accepted by gethostbyname().
19273 hdrs="$define sys/types.h
19274 $d_socket sys/socket.h
19275 $i_niin netinet/in.h
19277 $i_unistd unistd.h"
19278 for xxx in "const char *" "char *"; do
19279 case "$netdb_name_type" in
19280 '') try="extern struct hostent *gethostbyname($xxx);"
19281 if ./protochk "$try" $hdrs; then
19282 echo "Your system accepts $xxx."
19283 netdb_name_type="$xxx"
19288 : In case none of those worked, prompt the user.
19289 case "$netdb_name_type" in
19290 '') rp='What is the type for the 1st argument to gethostbyname?'
19293 netdb_name_type=$ans
19297 *) : no gethostbyname, so pick harmless default
19298 netdb_name_type='char *'
19303 : check for type of 1st argument to getnetbyaddr.
19304 if test "X$netdb_net_type" = X ; then
19305 case "$d_getnbyaddr" in
19309 Checking to see what type of 1st argument is accepted by getnetbyaddr().
19311 hdrs="$define sys/types.h
19312 $d_socket sys/socket.h
19313 $i_niin netinet/in.h
19315 $i_unistd unistd.h"
19316 for xxx in in_addr_t "unsigned long" long "unsigned int" int; do
19317 case "$netdb_net_type" in
19318 '') try="extern struct netent *getnetbyaddr($xxx, int);"
19319 if ./protochk "$try" $hdrs; then
19320 echo "Your system accepts $xxx."
19321 netdb_net_type="$xxx"
19326 : In case none of those worked, prompt the user.
19327 case "$netdb_net_type" in
19328 '') rp='What is the type for the 1st argument to getnetbyaddr?'
19331 netdb_net_type=$ans
19335 *) : no getnetbyaddr, so pick harmless default
19336 netdb_net_type='long'
19340 : locate the preferred pager for this system
19347 [a-zA-Z]:/*) dflt=$pg;;
19351 [a-zA-Z]:/*) dflt=$more;;
19355 [a-zA-Z]:/*) dflt=$less;;
19358 '') dflt=/usr/ucb/more;;
19362 : Instruct ./getfile to trust the hinted or previous pager value,
19363 : even if it does not begin with a slash. For example, on os2,
19364 : pager might be cmd /c more. See comments in UU/getfile.
19369 rp='What pager is used on your system?'
19373 : see what type pids are declared as in the kernel
19374 rp="What is the type of process ids on this system?"
19375 set pid_t pidtype int stdio.h sys/types.h
19378 : see if ar generates random libraries by itself
19380 echo "Checking how to generate random libraries on your machine..." >&4
19381 echo 'int bar1() { return bar2(); }' > bar1.c
19382 echo 'int bar2() { return 2; }' > bar2.c
19384 #$i_stdlib I_STDLIB
19386 #include <stdlib.h>
19388 int main() { printf("%d\n", bar1()); exit(0); }
19390 $cc $ccflags -c bar1.c >/dev/null 2>&1
19391 $cc $ccflags -c bar2.c >/dev/null 2>&1
19392 $cc $ccflags -c foo.c >/dev/null 2>&1
19393 $ar rc bar$_a bar2$_o bar1$_o >/dev/null 2>&1
19394 if $cc -o foobar $ccflags $ldflags foo$_o bar$_a $libs > /dev/null 2>&1 &&
19395 $run ./foobar >/dev/null 2>&1; then
19396 echo "$ar appears to generate random libraries itself."
19398 if [ "X$ranlib" = "X" ]; then
19401 elif $ar s bar$_a >/dev/null 2>&1 &&
19402 $cc -o foobar $ccflags $ldflags foo$_o bar$_a $libs > /dev/null 2>&1 &&
19403 $run ./foobar >/dev/null 2>&1; then
19404 echo "a table of contents needs to be added with '$ar s'."
19407 elif $ar ts bar$_a >/dev/null 2>&1 &&
19408 $cc -o foobar $ccflags $ldflags foo$_o bar$_a $libs > /dev/null 2>&1 &&
19409 $run ./foobar >/dev/null 2>&1; then
19410 echo "a table of contents needs to be added with '$ar ts'."
19417 ranlib=`./loc ranlib X /usr/bin /bin /usr/local/bin`
19418 $test -f $ranlib || ranlib=''
19421 if $test -n "$ranlib"; then
19422 echo "your system has '$ranlib'; we'll use that."
19425 echo "your system doesn't seem to support random libraries"
19426 echo "so we'll use lorder and tsort to order the libraries."
19433 : check for type of arguments to select.
19434 case "$selecttype" in
19435 '') case "$d_select" in
19439 Checking to see what type of arguments are accepted by select().
19441 hdrs="$define sys/types.h
19442 $i_systime sys/time.h
19443 $i_sysselct sys/select.h
19444 $d_socket sys/socket.h"
19445 : The first arg can be int, unsigned, or size_t
19446 : The last arg may or may not be 'const'
19448 : void pointer has been seen but using that
19449 : breaks the selectminbits test
19450 for xxx in 'fd_set *' 'int *'; do
19451 for nfd in 'int' 'size_t' 'unsigned long' 'unsigned' ; do
19452 for tmo in 'struct timeval *' 'const struct timeval *'; do
19454 '') try="extern select _(($nfd, $xxx, $xxx, $xxx, $tmo));"
19455 if ./protochk "$try" $hdrs; then
19456 echo "Your system accepts $xxx."
19465 '') rp='What is the type for the 2nd, 3rd, and 4th arguments to select?'
19466 case "$d_fd_set" in
19467 $define) dflt="fd_set *" ;;
19476 *) : no select, so pick a harmless default
19483 : check for the select 'width'
19484 case "$selectminbits" in
19485 '') safebits=`expr $ptrsize \* 8`
19486 case "$d_select" in
19490 Checking to see on how many bits at a time your select() operates...
19493 #include <sys/types.h>
19495 #$i_systime I_SYS_TIME
19496 #$i_systimek I_SYS_TIME_KERNEL
19501 # ifdef I_SYS_TIME_KERNEL
19504 # include <sys/time.h>
19505 # ifdef I_SYS_TIME_KERNEL
19509 #$i_sysselct I_SYS_SELECT
19510 #ifdef I_SYS_SELECT
19511 #include <sys/select.h>
19513 #$d_socket HAS_SOCKET
19515 # include <sys/socket.h> /* Might include <sys/bsdtypes.h> */
19518 #$i_stdlib I_STDLIB
19520 #include <stdlib.h>
19523 #define S sizeof(*(b))
19525 #define NBYTES (S * 8 > MINBITS ? S : MINBITS/8)
19526 #define NBITS (NBYTES * 8)
19528 char *s = malloc(NBYTES);
19537 fp = fopen("try.c", "r");
19543 b = ($selecttype)s;
19544 for (i = 0; i < NBITS; i++)
19548 select(fd + 1, b, 0, 0, &t);
19549 for (i = NBITS - 1; i > fd && FD_ISSET(i, b); i--);
19551 printf("%d\n", i + 1);
19556 if eval $compile_ok; then
19557 selectminbits=`$run ./try`
19558 case "$selectminbits" in
19560 Cannot figure out on how many bits at a time your select() operates.
19561 I'll play safe and guess it is $safebits bits.
19563 selectminbits=$safebits
19564 bits="$safebits bits"
19567 *) bits="$selectminbits bits" ;;
19569 echo "Your select() operates on $bits at a time." >&4
19571 rp='What is the minimum number of bits your select() operates on?'
19572 case "$byteorder" in
19573 12345678) dflt=64 ;;
19579 selectminbits="$val"
19583 *) : no select, so pick a harmless default
19584 selectminbits=$safebits
19590 : Trace out the files included by signal.h, then look for SIGxxx names.
19591 : Remove SIGARRAYSIZE used by HPUX.
19592 : Remove SIGSTKSIZE used by Linux.
19593 : Remove SIGSTKSZ used by Posix.
19594 : Remove SIGTYP void lines used by OS2.
19595 : Some cpps, like os390, dont give the file name anywhere
19596 if [ "X$fieldn" = X ]; then
19597 : Just make some guesses. We check them later.
19598 xxx='/usr/include/signal.h /usr/include/sys/signal.h'
19600 xxx=`echo '#include <signal.h>' |
19601 $cppstdin $cppminus $cppflags 2>/dev/null |
19602 $grep '^[ ]*#.*include' |
19603 $awk "{print \\$$fieldn}" | $sed 's!"!!g' | $sed 's!\\\\\\\\!/!g' | $sort | $uniq`
19605 : Check this list of files to be sure we have parsed the cpp output ok.
19606 : This will also avoid potentially non-existent files, such
19609 for xx in $xxx /dev/null ; do
19610 $test -f "$xx" && xxxfiles="$xxxfiles $xx"
19612 : If we have found no files, at least try signal.h
19613 case "$xxxfiles" in
19614 '') xxxfiles=`./findhdr signal.h` ;;
19617 $1 ~ /^#define$/ && $2 ~ /^SIG[A-Z0-9]*$/ && $2 !~ /SIGARRAYSIZE/ && $2 !~ /SIGSTKSIZE/ && $2 !~ /SIGSTKSZ/ && $3 !~ /void/ {
19618 print substr($2, 4, 20)
19620 $1 == "#" && $2 ~ /^define$/ && $3 ~ /^SIG[A-Z0-9]*$/ && $3 !~ /SIGARRAYSIZE/ && $4 !~ /void/ {
19621 print substr($3, 4, 20)
19623 : Append some common names just in case the awk scan failed.
19624 xxx="$xxx ABRT ALRM BUS CANCEL CHLD CLD CONT DIL EMT FPE"
19625 xxx="$xxx FREEZE HUP ILL INT IO IOT KILL LOST LWP PHONE"
19626 xxx="$xxx PIPE POLL PROF PWR QUIT RTMAX RTMIN SEGV STKFLT STOP"
19627 xxx="$xxx SYS TERM THAW TRAP TSTP TTIN TTOU URG USR1 USR2"
19628 xxx="$xxx USR3 USR4 VTALRM WAITING WINCH WIND WINDOW XCPU XFSZ"
19630 : generate a few handy files for later
19631 $cat > signal.c <<EOCP
19632 #include <sys/types.h>
19633 #include <signal.h>
19634 #$i_stdlib I_STDLIB
19636 #include <stdlib.h>
19641 /* Strange style to avoid deeply-nested #if/#else/#endif */
19644 # define NSIG (_NSIG)
19650 # define NSIG (SIGMAX+1)
19656 # define NSIG (SIG_MAX+1)
19662 # define NSIG (_SIG_MAX+1)
19668 # define NSIG (MAXSIG+1)
19674 # define NSIG (MAX_SIG+1)
19679 # ifdef SIGARRAYSIZE
19680 # define NSIG SIGARRAYSIZE /* Assume ary[SIGARRAYSIZE] */
19686 # define NSIG (_sys_nsig) /* Solaris 2.5 */
19690 /* Default to some arbitrary number that's big enough to get most
19691 of the common signals.
19697 printf("NSIG %d\n", NSIG);
19703 echo $xxx | $tr ' ' $trnl | $sort | $uniq | $awk '
19705 printf "#ifdef SIG"; printf $1; printf "\n"
19706 printf "printf(\""; printf $1; printf " %%d\\n\",SIG";
19707 printf $1; printf ");\n"
19711 printf "#endif /* JUST_NSIG */\n";
19712 printf "exit(0);\n}\n";
19715 $cat >signal.awk <<'EOP'
19716 BEGIN { ndups = 0 }
19717 $1 ~ /^NSIG$/ { nsig = $2 }
19718 ($1 !~ /^NSIG$/) && (NF == 2) && ($2 ~ /^[0-9][0-9]*$/) {
19719 if ($2 > maxsig) { maxsig = $2 }
19720 if (sig_name[$2]) {
19721 dup_name[ndups] = $1
19722 dup_num[ndups] = $2
19734 printf("NSIG %d\n", nsig);
19735 for (n = 1; n < nsig; n++) {
19737 printf("%s %d\n", sig_name[n], sig_num[n])
19740 printf("NUM%d %d\n", n, n)
19743 for (n = 0; n < ndups; n++) {
19744 printf("%s %d\n", dup_name[n], dup_num[n])
19748 $cat >signal_cmd <<EOS
19750 if $test -s signal.lst; then
19751 echo "Using your existing signal.lst file"
19756 $cat >>signal_cmd <<'EOS'
19759 if eval $compile_ok; then
19760 $run ./signal$_exe | ($sort -n -k 2 2>/dev/null || $sort -n +1) | $uniq | $awk -f signal.awk >signal.lst
19762 echo "(I can't seem be able to compile the whole test program)" >&4
19763 echo "(I'll try it in little pieces.)" >&4
19764 set signal -DJUST_NSIG
19765 if eval $compile_ok; then
19766 $run ./signal$_exe > signal.nsg
19769 echo "I can't seem to figure out how many signals you have." >&4
19770 echo "Guessing 50." >&4
19771 echo 'NSIG 50' > signal.nsg
19773 : Now look at all the signal names, one at a time.
19774 for xx in `echo $xxx | $tr ' ' $trnl | $sort | $uniq`; do
19775 $cat > signal.c <<EOCP
19776 #include <sys/types.h>
19777 #include <signal.h>
19780 printf("$xx %d\n", SIG${xx});
19785 if eval $compile; then
19786 echo "SIG${xx} found."
19787 $run ./signal$_exe >> signal.ls1
19789 echo "SIG${xx} NOT found."
19792 if $test -s signal.ls1; then
19793 $cat signal.nsg signal.ls1 |
19794 $sort -n | $uniq | $awk -f signal.awk >signal.lst
19798 if $test -s signal.lst; then
19801 echo "(AAK! I can't compile the test programs -- Guessing)" >&4
19802 echo 'kill -l' >signal
19803 set X `csh -f <signal`
19807 0) set HUP INT QUIT ILL TRAP ABRT EMT FPE KILL BUS SEGV SYS PIPE ALRM TERM;;
19809 echo $@ | $tr ' ' $trnl | \
19810 $awk '{ printf "%s %d\n", $1, ++s; }
19811 END { printf "NSIG %d\n", ++s }' >signal.lst
19813 $rm -f signal.c signal$_exe signal$_o signal.nsg signal.ls1
19815 chmod a+x signal_cmd
19816 $eunicefix signal_cmd
19818 : generate list of signal names
19820 case "$sig_name_init" in
19822 *) case "$sig_num_init" in
19823 ''|*,*) doinit=yes ;;
19828 echo "Generating a list of signal names and numbers..." >&4
19830 sig_count=`$awk '/^NSIG/ { printf "%d", $2 }' signal.lst`
19831 sig_name=`$awk 'BEGIN { printf "ZERO " }
19832 !/^NSIG/ { printf "%s ", $1 }' signal.lst`
19833 sig_num=`$awk 'BEGIN { printf "0 " }
19834 !/^NSIG/ { printf "%d ", $2 }' signal.lst`
19835 sig_name_init=`$awk 'BEGIN { printf "\"ZERO\", " }
19836 !/^NSIG/ { printf "\"%s\", ", $1 }
19837 END { printf "0\n" }' signal.lst`
19838 sig_num_init=`$awk 'BEGIN { printf "0, " }
19839 !/^NSIG/ { printf "%d, ", $2}
19840 END { printf "0\n"}' signal.lst`
19843 echo "The following $sig_count signals are available:"
19845 echo $sig_name | $awk \
19846 'BEGIN { linelen = 0 }
19848 for (i = 1; i <= NF; i++) {
19849 name = "SIG" $i " "
19850 linelen = linelen + length(name)
19851 if (linelen > 70) {
19853 linelen = length(name)
19859 sig_size=`echo $sig_name | awk '{print NF}'`
19860 $rm -f signal signal.c signal.awk signal.lst signal_cmd
19863 case "$sizetype" in
19864 *_t) zzz="$sizetype" ;;
19865 *) zzz="filesize" ;;
19867 echo "Checking the size of $zzz..." >&4
19869 #include <sys/types.h>
19871 #$i_stdlib I_STDLIB
19873 #include <stdlib.h>
19876 printf("%d\n", (int)sizeof($sizetype));
19881 if eval $compile_ok; then
19885 echo "(I can't execute the test program--guessing $sizesize.)" >&4
19888 echo "Your $zzz size is $sizesize bytes."
19893 echo "(I can't compile the test program--guessing $sizesize.)" >&4
19897 : check for socklen_t
19899 echo "Checking to see if you have socklen_t..." >&4
19901 #include <sys/types.h>
19902 #$d_socket HAS_SOCKET
19904 #include <sys/socket.h>
19906 int main() { socklen_t x = 16; }
19909 if eval $compile; then
19911 echo "You have socklen_t."
19914 echo "You do not have socklen_t."
19915 case "$sizetype" in
19916 size_t) echo "(You do have size_t, that might work. Some people are happy with just an int.)" ;;
19923 : see if this is a socks.h system
19924 set socks.h i_socks
19927 : check for type of the size argument to socket calls
19928 case "$d_socket" in
19932 Checking to see what type is the last argument of accept().
19935 case "$d_socklen_t" in
19936 "$define") yyy="$yyy socklen_t"
19938 yyy="$yyy $sizetype int long unsigned"
19939 for xxx in $yyy; do
19940 case "$socksizetype" in
19941 '') try="extern int accept(int, struct sockaddr *, $xxx *);"
19942 case "$usesocks" in
19944 if ./protochk "$try" $i_systypes sys/types.h $d_socket sys/socket.h literal '#define INCLUDE_PROTOTYPES' $i_socks socks.h.; then
19945 echo "Your system accepts '$xxx *' for the last argument of accept()."
19946 socksizetype="$xxx"
19949 *) if ./protochk "$try" $i_systypes sys/types.h $d_socket sys/socket.h; then
19950 echo "Your system accepts '$xxx *' for the last argument of accept()."
19951 socksizetype="$xxx"
19958 : In case none of those worked, prompt the user.
19959 case "$socksizetype" in
19960 '') rp='What is the type for socket address structure sizes?'
19967 *) : no sockets, so pick relatively harmless default
19972 : see what type is used for signed size_t
19973 set ssize_t ssizetype int stdio.h sys/types.h
19978 #$i_stdlib I_STDLIB
19980 #include <stdlib.h>
19982 #include <sys/types.h>
19983 #define Size_t $sizetype
19984 #define SSize_t $dflt
19987 if (sizeof(Size_t) == sizeof(SSize_t))
19989 else if (sizeof(Size_t) == sizeof(int))
19998 if eval $compile_ok && $run ./try > /dev/null; then
19999 ssizetype=`$run ./try`
20000 echo "I'll be using $ssizetype for functions returning a byte count." >&4
20003 Help! I can't compile and run the ssize_t test program: please enlighten me!
20004 (This is probably a misconfiguration in your system or libraries, and
20005 you really ought to fix it. Still, I'll try anyway.)
20007 I need a type that is the same size as $sizetype, but is guaranteed to
20008 be signed. Common values are ssize_t, int and long.
20011 rp="What signed type is the same size as $sizetype?"
20017 : see what type of char stdio uses.
20019 echo '#include <stdio.h>' > stdio.c
20020 $cppstdin $cppminus < stdio.c > stdioh
20021 if $contains 'unsigned.*char.*_ptr;' stdioh >/dev/null 2>&1 ; then
20022 echo "Your stdio uses unsigned chars." >&4
20023 stdchar="unsigned char"
20025 echo "Your stdio uses signed chars." >&4
20028 $rm -f stdio.* stdioh
20030 : see what type uids are declared as in the kernel
20032 echo "Looking for the type for user ids returned by getuid()."
20033 set uid_t uidtype xxx stdio.h sys/types.h
20037 xxx=`./findhdr sys/user.h`
20038 set `grep '_ruid;' "$xxx" 2>/dev/null` unsigned short
20040 unsigned) dflt="$1 $2" ;;
20044 *) dflt="$uidtype";;
20047 uid_t) echo "uid_t found." ;;
20048 *) rp="What is the type for user ids returned by getuid()?"
20056 *_t) zzz="$uidtype" ;;
20059 echo "Checking the size of $zzz..." >&4
20061 #include <sys/types.h>
20063 #$i_stdlib I_STDLIB
20065 #include <stdlib.h>
20068 printf("%d\n", (int)sizeof($uidtype));
20073 if eval $compile_ok; then
20077 echo "(I can't execute the test program--guessing $uidsize.)" >&4
20080 echo "Your $zzz is $uidsize bytes long."
20085 echo "(I can't compile the test program--guessing $uidsize.)" >&4
20090 *_t) zzz="$uidtype" ;;
20093 echo "Checking the sign of $zzz..." >&4
20095 #include <sys/types.h>
20106 if eval $compile; then
20110 echo "(I can't execute the test program--guessing unsigned.)" >&4
20114 1) echo "Your $zzz is unsigned." ;;
20115 -1) echo "Your $zzz is signed." ;;
20121 echo "(I can't compile the test program--guessing unsigned.)" >&4
20127 $echo "Checking the format string to be used for uids..." >&4
20130 -1) if $test X"$uidsize" = X"$ivsize"; then
20131 uidformat="$ivdformat"
20133 if $test X"$uidsize" = X"$longsize"; then
20136 if $test X"$uidsize" = X"$intsize"; then
20139 if $test X"$uidsize" = X"$shortsize"; then
20146 *) if $test X"$uidsize" = X"$uvsize"; then
20147 uidformat="$uvuformat"
20149 if $test X"$uidsize" = X"$longsize"; then
20152 if $test X"$uidsize" = X"$intsize"; then
20155 if $test X"$uidsize" = X"$shortsize"; then
20165 case "$usesitecustomize" in
20166 $define|true|[Yy]*)
20167 usesitecustomize="$define"
20170 usesitecustomize="$undef"
20174 : determine compiler compiler
20183 if $test -f "$byacc$_exe"; then
20185 comp="byacc or $comp"
20187 if $test -f "$bison$_exe"; then
20188 comp="$comp or bison -y"
20190 rp="Which compiler compiler ($comp) shall I use?"
20199 echo "(Adding -y option to bison to get yacc-compatible behaviour.)"
20205 : see if this is a fp.h system
20209 : see if this is a fp_class.h system
20210 set fp_class.h i_fp_class
20213 : see if this is a ieeefp.h system
20214 case "$i_ieeefp" in
20215 '' ) set ieeefp.h i_ieeefp
20220 : see if this is a libutil.h system
20221 set libutil.h i_libutil
20224 : see if mach cthreads are available
20225 if test "X$usethreads" = "X$define"; then
20226 set mach/cthreads.h i_machcthr
20229 i_machcthr="$undef"
20234 : see if this is a mntent.h system
20235 set mntent.h i_mntent
20238 : see if ndbm.h is available
20244 # Some Linux distributions such as RedHat 7.1 put the
20245 # ndbm.h header in /usr/include/gdbm/ndbm.h.
20246 if $test -f /usr/include/gdbm/ndbm.h; then
20247 echo '<gdbm/ndbm.h> found.'
20248 ccflags="$ccflags -I/usr/include/gdbm"
20249 cppflags="$cppflags -I/usr/include/gdbm"
20257 : see if dbm_open exists
20258 set dbm_open d_dbm_open
20260 case "$d_dbm_open" in
20263 echo "We won't be including <ndbm.h>"
20272 : see if net/errno.h is available
20274 set net/errno.h val
20277 : Unfortunately, it causes problems on some systems. Arrgh.
20280 cat > try.c <<'EOM'
20283 #include <net/errno.h>
20289 if $cc $ccflags -c try.c >/dev/null 2>&1; then
20290 echo "We'll be including <net/errno.h>." >&4
20292 echo "We won't be including <net/errno.h>." >&4
20301 : see if netinet/tcp.h is available
20302 set netinet/tcp.h i_netinettcp
20305 : see if this is a poll.h system
20309 : see if this is a prot.h system
20314 $echo "Guessing which symbols your C compiler and preprocessor define..." >&4
20315 $cat <<'EOSH' > Cppsym.know
20316 a29k ABI64 aegis AES_SOURCE AIX AIX32 AIX370
20317 AIX41 AIX42 AIX43 AIX_SOURCE aixpc ALL_SOURCE
20318 alliant alpha am29000 AM29000 AMD64 amd64 amiga AMIGAOS AMIX
20319 ansi ANSI_C_SOURCE apollo ardent ARM32 atarist att386 att3b
20320 BeOS BIG_ENDIAN BIT_MSF bsd BSD bsd43 bsd4_2 bsd4_3 BSD4_3 bsd4_4
20321 BSD_4_3 BSD_4_4 BSD_NET2 BSD_TIME BSD_TYPES BSDCOMPAT bsdi
20322 bull c cadmus clipper CMU COFF COMPILER_VERSION
20323 concurrent convex cpu cray CRAY CRAYMPP ctix CX_UX
20324 CYGWIN DECC DGUX DGUX_SOURCE DJGPP dmert DOLPHIN DPX2 DSO
20325 Dynix DynixPTX ELF encore EPI EXTENSIONS FAVOR_BSD
20326 FILE_OFFSET_BITS FreeBSD GCC_NEW_VARARGS gcos gcx gimpel
20328 GNU_SOURCE GNUC GNUC_MINOR GNU_LIBRARY GO32 gould GOULD_PN
20329 H3050R H3050RX hbullx20 hcx host_mips
20330 hp200 hp300 hp700 HP700 hp800 hp9000
20331 hp9000s200 hp9000s300 hp9000s400 hp9000s500
20332 hp9000s700 hp9000s800 hp9k8 hp_osf hppa hpux HPUX_SOURCE
20333 i186 i286 i386 i486 i586 i686 i8086 i80960 i860 I960
20334 IA64 iAPX286 ibm ibm032 ibmesa IBMR2 ibmrt ILP32 ILP64
20335 INLINE_INTRINSICS INTRINSICS INT64 interdata is68k ksr1
20336 LANGUAGE_C LARGE_FILE_API LARGEFILE64_SOURCE
20337 LARGEFILE_SOURCE LFS64_LARGEFILE LFS_LARGEFILE
20338 Linux LITTLE_ENDIAN LONG64 LONG_DOUBLE LONG_LONG
20339 LONGDOUBLE LONGLONG LP64 luna luna88k Lynx
20340 M68000 m68k m88100 m88k M88KBCS_TARGET M_COFF
20341 M_I186 M_I286 M_I386 M_I8086 M_I86 M_I86SM M_SYS3
20342 M_SYS5 M_SYSIII M_SYSV M_UNIX M_XENIX MACH machine MachTen
20343 MATH_HAS_NO_SIDE_EFFECTS
20344 mc300 mc500 mc68000 mc68010 mc68020 mc68030 mc68040
20345 mc68060 mc68k mc68k32 mc700 mc88000 mc88100 merlin
20346 mert MiNT mips MIPS_FPSET MIPS_ISA MIPS_SIM MIPS_SZINT
20347 MIPS_SZLONG MIPS_SZPTR MIPSEB MIPSEL MODERN_C motorola
20348 mpeix MSDOS MTXINU MULTIMAX mvs MVS n16 ncl_el ncl_mr
20349 NetBSD news1500 news1700 news1800 news1900 news3700
20350 news700 news800 news900 NeXT NLS nonstopux ns16000 ns32000
20351 ns32016 ns32332 ns32k nsc32000
20352 OCS88 OEMVS OpenBSD os OS2 OS390 osf OSF1 OSF_SOURCE
20353 pa_risc PA_RISC1_1 PA_RISC2_0 PARAGON parisc
20354 pc532 pdp11 PGC PIC plexus PORTAR posix
20355 POSIX1B_SOURCE POSIX2_SOURCE POSIX4_SOURCE
20356 POSIX_C_SOURCE POSIX_SOURCE POWER
20357 PROTOTYPES PWB pyr QNX R3000 REENTRANT RES Rhapsody RISC6000
20358 riscix riscos RT S390 SA110 scs SCO sequent sgi SGI_SOURCE SH3 sinix
20359 SIZE_INT SIZE_LONG SIZE_PTR SOCKET_SOURCE SOCKETS_SOURCE
20360 sony sony_news sonyrisc sparc sparclite spectrum
20361 stardent stdc STDC_EXT stratos sun sun3 sun386
20362 Sun386i svr3 svr4 SVR4_2 SVR4_SOURCE svr5
20363 SX system SYSTYPE_BSD SYSTYPE_BSD43 SYSTYPE_BSD44
20364 SYSTYPE_SVR4 SYSTYPE_SVR5 SYSTYPE_SYSV SYSV SYSV3 SYSV4 SYSV5
20365 sysV68 sysV88 Tek4132 Tek4300 titan
20366 TM3200 TM5400 TM5600
20367 tower tower32 tower32_200 tower32_600 tower32_700
20368 tower32_800 tower32_850 tss
20369 u370 u3b u3b2 u3b20 u3b200 u3b20d u3b5
20370 ultrix UMAXV UnicomPBB UnicomPBD UNICOS UNICOSMK
20371 unix UNIX95 UNIX99 unixpc unos
20372 USE_BSD USE_FILE_OFFSET64 USE_GNU USE_ISOC9X USE_LARGEFILE USE_LARGEFILE64
20373 USE_MISC USE_POSIX USE_POSIX199309 USE_POSIX199506 USE_POSIX2
20374 USE_REENTRANT USE_SVID USE_UNIX98 USE_XOPEN USE_XOPEN_EXTENDED
20376 Utek UTek UTS UWIN uxpm uxps vax venix VMESA vms x86_64 xenix Xenix286
20377 XOPEN_SOURCE XOPEN_SOURCE_EXTENDED XPG2 XPG2_EXTENDED
20378 XPG3 XPG3_EXTENDED XPG4 XPG4_EXTENDED
20381 # Maybe put other stuff here too.
20382 cat <<EOSH >>Cppsym.know
20385 ./tr '[a-z]' '[A-Z]' < Cppsym.know > Cppsym.a
20386 ./tr '[A-Z]' '[a-z]' < Cppsym.know > Cppsym.b
20387 $cat Cppsym.know > Cppsym.c
20388 $cat Cppsym.a Cppsym.b Cppsym.c | $tr ' ' $trnl | $sort | $uniq > Cppsym.know
20389 $rm -f Cppsym.a Cppsym.b Cppsym.c
20390 cat <<EOSH > Cppsym
20392 if $test \$# -gt 0; then
20393 echo \$* | $tr " " "$trnl" | ./Cppsym.try > Cppsym.got
20394 if $test -s Cppsym.got; then
20401 $tr " " "$trnl" | ./Cppsym.try
20407 cat <<EOSH > Cppsym.try
20409 cat <<'EOCP' > try.c
20412 #define STRINGIFY(a) "a"
20414 #if cpp_stuff == 42
20415 #define StGiFy(a) #a
20416 #define STRINGIFY(a) StGiFy(a)
20418 #if $cpp_stuff != 1 && $cpp_stuff != 42
20419 # include "Bletch: How does this C preprocessor stringify macros?"
20425 cat <<'EOSH' >> Cppsym.try
20427 printf "#ifdef %s\nprintf(\"%s=%%s\\n\", STRINGIFY(%s));\n#endif\n", $1, $1, $1
20428 printf "#ifdef _%s\nprintf(\"_%s=%%s\\n\", STRINGIFY(_%s));\n#endif\n", $1, $1, $1
20429 printf "#ifdef __%s\nprintf(\"__%s=%%s\\n\", STRINGIFY(__%s));\n#endif\n", $1, $1, $1
20430 printf "#ifdef __%s__\nprintf(\"__%s__=%%s\\n\", STRINGIFY(__%s__));\n#endif\n", $1, $1, $1
20432 echo 'return 0;}' >> try.c
20434 cat <<EOSH >> Cppsym.try
20436 case "$osname-$gccversion" in
20437 irix-) ccflags="\$ccflags -woff 1178" ;;
20438 os2-*) ccflags="\$ccflags -Zlinker /PM:VIO" ;;
20440 $cc -o try -Dcpp_stuff=$cpp_stuff $optimize \$ccflags $ldflags try.c $libs && $run ./try | $sed 's/ /\\\\ /g'
20442 chmod +x Cppsym.try
20443 $eunicefix Cppsym.try
20444 ./Cppsym < Cppsym.know > Cppsym.true
20445 : Add in any linux cpp "predefined macros":
20446 case "$osname::$gccversion" in
20449 rm -f $tHdrH'.h' $tHdrH
20451 if cpp -dM $tHdrH'.h' > $tHdrH'_cppsym.h' && [ -s $tHdrH'_cppsym.h' ]; then
20452 sed 's/#define[\ \ ]*//;s/[\ \ ].*$//' <$tHdrH'_cppsym.h' >$tHdrH'_cppsym.real'
20453 if [ -s $tHdrH'_cppsym.real' ]; then
20454 cat $tHdrH'_cppsym.real' Cppsym.know | sort | uniq | ./Cppsym | sort | uniq > Cppsym.true
20457 rm -f $tHdrH'.h' $tHdrH'_cppsym.h' $tHdrH'_cppsym.real'
20460 : now check the C compiler for additional symbols
20461 postprocess_cc_v=''
20463 aix) postprocess_cc_v="|$tr , ' '" ;;
20470 for i in \`$cc -v -c tmp.c 2>&1 $postprocess_cc_v\`
20473 -D*) echo "\$i" | $sed 's/^-D//';;
20474 -A*) $test "$gccversion" && echo "\$i" | $sed 's/^-A//' | $sed 's/\(.*\)(\(.*\))/\1=\2/';;
20479 postprocess_cc_v=''
20482 ./ccsym > ccsym1.raw
20483 if $test -s ccsym1.raw; then
20484 $sort ccsym1.raw | $uniq >ccsym.raw
20486 mv ccsym1.raw ccsym.raw
20489 $awk '/\=/ { print $0; next }
20490 { print $0"=1" }' ccsym.raw >ccsym.list
20491 $comm -13 Cppsym.true ccsym.list >ccsym.own
20492 $comm -12 Cppsym.true ccsym.list >ccsym.com
20493 $comm -23 Cppsym.true ccsym.list >ccsym.cpp
20495 if $test -z ccsym.raw; then
20496 echo "Your C compiler doesn't seem to define any symbols!" >&4
20498 echo "However, your C preprocessor defines the following symbols:"
20501 cppsymbols=`$cat Cppsym.true`
20502 cppsymbols=`echo $cppsymbols`
20503 cppccsymbols="$cppsymbols"
20505 if $test -s ccsym.com; then
20506 echo "Your C compiler and pre-processor define these symbols:"
20507 $sed -e 's/\(..*\)=.*/\1/' ccsym.com
20510 cppccsymbols=`$cat ccsym.com`
20511 cppccsymbols=`echo $cppccsymbols`
20512 $test "$silent" || sleep 1
20514 if $test -s ccsym.cpp; then
20515 $test "$also" && echo " "
20516 echo "Your C pre-processor ${also}defines the following symbols:"
20517 $sed -e 's/\(..*\)=.*/\1/' ccsym.cpp
20519 cppsymbols=`$cat ccsym.cpp`
20520 cppsymbols=`echo $cppsymbols`
20521 $test "$silent" || sleep 1
20523 if $test -s ccsym.own; then
20524 $test "$also" && echo " "
20525 echo "Your C compiler ${also}defines the following cpp symbols:"
20526 $sed -e 's/\(..*\)=1/\1/' ccsym.own
20527 $sed -e 's/\(..*\)=.*/\1/' ccsym.own | $uniq >>Cppsym.true
20528 ccsymbols=`$cat ccsym.own`
20529 ccsymbols=`echo $ccsymbols`
20530 $test "$silent" || sleep 1
20534 : see if this is a termio system
20538 if $test `./findhdr termios.h`; then
20539 set tcsetattr i_termios
20545 "$define") echo "You have POSIX termios.h... good!" >&4;;
20546 *) if ./Cppsym pyr; then
20547 case "`/bin/universe`" in
20548 ucb) if $test `./findhdr sgtty.h`; then
20550 echo "<sgtty.h> found." >&4
20552 echo "System is pyramid with BSD universe."
20553 echo "<sgtty.h> not found--you could have problems." >&4
20555 *) if $test `./findhdr termio.h`; then
20557 echo "<termio.h> found." >&4
20559 echo "System is pyramid with USG universe."
20560 echo "<termio.h> not found--you could have problems." >&4
20564 if $test `./findhdr termio.h`; then
20565 echo "<termio.h> found." >&4
20567 elif $test `./findhdr sgtty.h`; then
20568 echo "<sgtty.h> found." >&4
20571 echo "Neither <termio.h> nor <sgtty.h> found--you could have problems." >&4
20574 if $test `./findhdr sgtty.h`; then
20575 echo "<sgtty.h> found." >&4
20577 elif $test `./findhdr termio.h`; then
20578 echo "<termio.h> found." >&4
20581 echo "Neither <sgtty.h> nor <termio.h> found--you could have problems." >&4
20585 set i_termio; eval $setvar
20586 val=$val2; set i_sgtty; eval $setvar
20587 val=$val3; set i_termios; eval $setvar
20589 : see if stddef is available
20590 set stddef.h i_stddef
20593 : see if this is a sunmath.h system
20594 set sunmath.h i_sunmath
20597 : see if sys/access.h is available
20598 set sys/access.h i_sysaccess
20601 : see if ioctl defs are in sgtty, termio, sys/filio or sys/ioctl
20602 set sys/filio.h i_sysfilio
20605 if $test `./findhdr sys/ioctl.h`; then
20607 echo '<sys/ioctl.h> found.' >&4
20610 if $test $i_sysfilio = "$define"; then
20611 echo '<sys/ioctl.h> NOT found.' >&4
20613 $test $i_sgtty = "$define" && xxx="sgtty.h"
20614 $test $i_termio = "$define" && xxx="termio.h"
20615 $test $i_termios = "$define" && xxx="termios.h"
20616 echo "No <sys/ioctl.h> found, assuming ioctl args are defined in <$xxx>." >&4
20622 : see if socket ioctl defs are in sys/sockio.h
20624 xxx=`./findhdr sys/sockio.h`
20625 if $test "$xxx"; then
20626 if $contains SIOCATMARK $xxx >/dev/null 2>&1; then
20628 echo "You have socket ioctls defined in <sys/sockio.h>." >&4
20631 echo "No socket ioctls found in <sys/sockio.h>." >&4
20636 <sys/sockio.h> not found, assuming socket ioctls are in <sys/ioctl.h>.
20643 : see if this is a syslog.h system
20644 set syslog.h i_syslog
20648 : see if this is a sys/mode.h system
20649 set sys/mode.h i_sysmode
20652 : see if sys/resource.h has to be included
20653 set sys/resource.h i_sysresrc
20656 : see if sys/security.h is available
20657 set sys/security.h i_syssecrt
20660 : see if this is a sys/statvfs.h system
20661 set sys/statvfs.h i_sysstatvfs
20664 : see if this is a sys/un.h system
20665 set sys/un.h i_sysun
20669 : see if this is a sys/utsname.h system
20670 set sys/utsname.h i_sysutsname
20673 : see if this is a syswait system
20674 set sys/wait.h i_syswait
20677 : see if this is a ustat.h system
20678 set ustat.h i_ustat
20681 : see if this is an utime system
20682 set utime.h i_utime
20685 : see if this is a values.h system
20686 set values.h i_values
20689 : see if this is a vfork system
20692 set vfork.h i_vfork
20700 : see if gdbm.h is available
20705 : see if gdbm_open exists
20706 set gdbm_open d_gdbm_open
20708 case "$d_gdbm_open" in
20711 echo "We won't be including <gdbm.h>"
20721 echo "Looking for extensions..." >&4
20722 : If we are using the old config.sh, known_extensions may contain
20723 : old or inaccurate or duplicate values.
20724 known_extensions=''
20725 nonxs_extensions=''
20726 : We do not use find because it might not be available.
20727 : We do not just use MANIFEST because the user may have dropped
20728 : some additional extensions into the source tree and expect them
20731 : Function to recursively find available extensions, ignoring DynaLoader
20732 : NOTE: recursion limit of 10 to prevent runaway in case of symlink madness
20736 DynaLoader|dynaload) ;;
20738 if $test -f $xxx/$xxx.xs; then
20739 known_extensions="$known_extensions $1$xxx";
20740 elif $test -f $xxx/Makefile.PL; then
20741 nonxs_extensions="$nonxs_extensions $1$xxx";
20743 if $test -d $xxx -a $# -lt 10; then
20746 eval $find_extensions;
20758 eval $find_extensions
20759 # Special case: Add in threads/shared since it is not picked up by the
20760 # recursive find above (and adding in general recursive finding breaks
20761 # SDBM_File/sdbm). A.D. 10/25/2001.
20762 known_extensions="$known_extensions threads/shared"
20763 set X $nonxs_extensions
20765 nonxs_extensions="$*"
20766 set X $known_extensions
20768 known_extensions="$*"
20771 : Now see which are supported on this system.
20773 for xxx in $known_extensions ; do
20777 $define) avail_ext="$avail_ext $xxx" ;;
20780 GDBM_File|gdbm_fil)
20782 $define) avail_ext="$avail_ext $xxx" ;;
20785 I18N/Langinfo|i18n_lan)
20786 case "$i_langinfo$d_nl_langinfo" in
20787 $define$define) avail_ext="$avail_ext $xxx" ;;
20790 NDBM_File|ndbm_fil)
20793 case "$osname-$use64bitint" in
20796 *-lndbm*) avail_ext="$avail_ext $xxx" ;;
20799 *) avail_ext="$avail_ext $xxx" ;;
20804 ODBM_File|odbm_fil)
20805 case "${i_dbm}${i_rpcsvcdbm}" in
20807 case "$osname-$use64bitint" in
20810 *-ldbm*) avail_ext="$avail_ext $xxx" ;;
20813 *) avail_ext="$avail_ext $xxx" ;;
20819 case "$useposix" in
20820 true|define|y) avail_ext="$avail_ext $xxx" ;;
20824 case "$useopcode" in
20825 true|define|y) avail_ext="$avail_ext $xxx" ;;
20829 case "$d_socket" in
20832 beos) ;; # not unless BONE
20833 *) avail_ext="$avail_ext $xxx" ;;
20838 Sys/Syslog|sys/syslog)
20839 : XXX syslog requires socket
20840 case "$d_socket" in
20841 true|$define|y) avail_ext="$avail_ext $xxx" ;;
20845 case "$usethreads" in
20847 case "$useithreads" in
20848 $undef|false|[nN]*) avail_ext="$avail_ext $xxx" ;;
20852 XS/APItest|xs/apitest)
20853 # This is just for testing. Skip it unless we have dynamic loading.
20856 $define) avail_ext="$avail_ext $xxx" ;;
20859 XS/Typemap|xs/typemap)
20860 # This is just for testing. Skip it unless we have dynamic loading.
20862 $define) avail_ext="$avail_ext $xxx" ;;
20865 threads|threads/shared)
20866 # threads and threads::shared are special cases.
20867 # To stop people from asking "Perl 5.8.0 was supposed
20868 # to have this new fancy threads implementation but my
20869 # perl doesn't have it" and from people trying to
20870 # (re)install the threads module using CPAN.pm and
20871 # CPAN.pm then offering to reinstall Perl 5.8.0,
20872 # the threads.pm and threads/shared.pm will always be
20873 # there, croaking informatively ("you need to rebuild
20874 # all of Perl with threads, sorry") when threads haven't
20875 # been compiled in.
20877 avail_ext="$avail_ext $xxx"
20880 : XXX Do we need a useipcsysv variable here
20881 case "${d_msg}${d_sem}${d_shm}" in
20882 *"${define}"*) avail_ext="$avail_ext $xxx" ;;
20885 *) avail_ext="$avail_ext $xxx"
20894 case "$onlyextensions" in
20896 *) keepextensions=''
20897 echo "You have requested that only certains extensions be included..." >&4
20898 for i in $onlyextensions; do
20899 case " $avail_ext " in
20901 echo "Keeping extension $i."
20902 keepextensions="$keepextensions $i"
20904 *) echo "Ignoring extension $i." ;;
20907 avail_ext="$keepextensions"
20911 case "$noextensions" in
20913 *) keepextensions=''
20914 echo "You have requested that certain extensions be ignored..." >&4
20915 for i in $avail_ext; do
20916 case " $noextensions " in
20917 *" $i "*) echo "Ignoring extension $i." ;;
20918 *) echo "Keeping extension $i.";
20919 keepextensions="$keepextensions $i"
20923 avail_ext="$keepextensions"
20927 : Now see which nonxs extensions are supported on this system.
20928 : For now assume all are.
20930 for xxx in $nonxs_extensions ; do
20932 *) nonxs_ext="$nonxs_ext $xxx"
20944 A number of extensions are supplied with $package. You may choose to
20945 compile these extensions for dynamic loading (the default), compile
20946 them into the $package executable (static loading), or not include
20947 them at all. Answer "none" to include no extensions.
20948 Note that DynaLoader is always built and need not be mentioned here.
20951 case "$dynamic_ext" in
20953 : Exclude those listed in static_ext
20955 for xxx in $avail_ext; do
20956 case " $static_ext " in
20958 *) dflt="$dflt $xxx" ;;
20965 *) dflt="$dynamic_ext"
20966 # Perhaps we are reusing an old out-of-date config.sh.
20969 if test X"$dynamic_ext" != X"$avail_ext"; then
20971 NOTICE: Your previous config.sh list may be incorrect.
20972 The extensions now available to you are
20974 but the default list from your previous config.sh is
20986 rp="What extensions do you wish to load dynamically?"
20989 none) dynamic_ext=' ' ;;
20990 *) dynamic_ext="$ans" ;;
20993 case "$static_ext" in
20995 : Exclude those already listed in dynamic linking
20997 for xxx in $avail_ext; do
20998 case " $dynamic_ext " in
21000 *) dflt="$dflt $xxx" ;;
21007 *) dflt="$static_ext"
21014 rp="What extensions do you wish to load statically?"
21017 none) static_ext=' ' ;;
21018 *) static_ext="$ans" ;;
21023 A number of extensions are supplied with $package. Answer "none"
21024 to include no extensions.
21025 Note that DynaLoader is always built and need not be mentioned here.
21028 case "$static_ext" in
21029 '') dflt="$avail_ext" ;;
21030 *) dflt="$static_ext"
21031 # Perhaps we are reusing an old out-of-date config.sh.
21034 if test X"$static_ext" != X"$avail_ext"; then
21036 NOTICE: Your previous config.sh list may be incorrect.
21037 The extensions now available to you are
21039 but the default list from your previous config.sh is
21048 : Exclude those that are not xs extensions
21052 rp="What extensions do you wish to include?"
21055 none) static_ext=' ' ;;
21056 *) static_ext="$ans" ;;
21061 # Encode is a special case. If we are building Encode as a static
21062 # extension, we need to explicitly list its subextensions as well.
21063 # For other nested extensions, this is handled automatically by
21064 # the appropriate Makefile.PL.
21065 case " $static_ext " in
21066 *" Encode "*) # Add the subextensions of Encode
21068 for xxx in `ls Encode/*/Makefile.PL|awk -F/ '{print $2}'`; do
21069 static_ext="$static_ext Encode/$xxx"
21075 set X $dynamic_ext $static_ext $nonxs_ext
21079 # Sanity check: We require an extension suitable for use with
21080 # AnyDBM_File, as well as Fcntl and IO. (Failure to have these
21081 # should show up as failures in the test suite, but it's helpful to
21082 # catch them now.) The 'extensions' list is normally sorted
21083 # alphabetically, so we need to accept either
21084 # DB_File ... Fcntl ... IO ....
21085 # or something like
21086 # Fcntl ... NDBM_File ... IO ....
21087 case " $extensions" in
21088 *"_File "*" Fcntl "*" IO "*) ;; # DB_File
21089 *" Fcntl "*"_File "*" IO "*) ;; # GDBM_File
21090 *" Fcntl "*" IO "*"_File "*) ;; # NDBM_File
21091 *) echo "WARNING: Extensions DB_File or *DBM_File, Fcntl, and IO not configured." >&4
21092 echo "WARNING: The Perl you are building will be quite crippled." >& 4
21096 : Remove libraries needed only for extensions
21097 : The appropriate ext/Foo/Makefile.PL will add them back in, if necessary.
21098 : The exception is SunOS 4.x, which needs them.
21099 case "${osname}X${osvers}" in
21103 *) case "$usedl" in
21104 $define|true|[yY]*)
21105 set X `echo " $libs " | sed -e 's@ -lndbm @ @' -e 's@ -lgdbm @ @' -e 's@ -ldbm @ @' -e 's@ -ldb @ @'`
21109 *) perllibs="$libs"
21115 : Remove build directory name from cppstdin so it can be used from
21116 : either the present location or the final installed location.
21118 : Get out of the UU directory to get correct path name.
21120 case "$cppstdin" in
21122 echo "Stripping down cppstdin path name"
21128 : end of configuration questions
21130 echo "End of configuration questions."
21133 : back to where it started
21134 if test -d ../UU; then
21138 : configuration may be patched via a 'config.arch' file
21139 if $test -f config.arch; then
21140 echo "I see a config.arch file, loading it."
21144 : configuration may be patched via a 'config.over' file
21145 if $test -f config.over; then
21148 rp='I see a config.over file. Do you wish to load it?'
21151 n*) echo "OK, I'll ignore it.";;
21153 echo "Configuration override changes have been loaded."
21158 : in case they want portability, strip down executable paths
21159 case "$d_portable" in
21162 echo "Stripping down executable paths..." >&4
21163 for file in $loclist $trylist; do
21165 eval $file=`basename $temp`
21170 : create config.sh file
21172 echo "Creating config.sh..." >&4
21173 $spitshell <<EOT >config.sh
21176 # This file was produced by running the Configure script. It holds all the
21177 # definitions figured out by Configure. Should you modify one of these values,
21178 # do not forget to propagate your changes by running "Configure -der". You may
21179 # instead choose to run each of the .SH files by yourself, or "Configure -S".
21182 # Package name : $package
21183 # Source directory : $src
21184 # Configuration time: $cf_time
21185 # Configured by : $cf_by
21186 # Target system : $myuname
21196 Revision='$Revision'
21204 alignbytes='$alignbytes'
21205 ansi2knr='$ansi2knr'
21206 aphostname='$aphostname'
21207 api_revision='$api_revision'
21208 api_subversion='$api_subversion'
21209 api_version='$api_version'
21210 api_versionstring='$api_versionstring'
21213 archlibexp='$archlibexp'
21214 archname64='$archname64'
21215 archname='$archname'
21216 archobjs='$archobjs'
21217 asctime_r_proto='$asctime_r_proto'
21225 byteorder='$byteorder'
21227 castflags='$castflags'
21230 cccdlflags='$cccdlflags'
21231 ccdlflags='$ccdlflags'
21233 ccflags_uselargefiles='$ccflags_uselargefiles'
21235 ccsymbols='$ccsymbols'
21236 ccversion='$ccversion'
21238 cf_email='$cf_email'
21240 charsize='$charsize'
21244 clocktype='$clocktype'
21246 compress='$compress'
21247 contains='$contains'
21251 cpp_stuff='$cpp_stuff'
21252 cppccsymbols='$cppccsymbols'
21253 cppflags='$cppflags'
21255 cppminus='$cppminus'
21257 cppstdin='$cppstdin'
21258 cppsymbols='$cppsymbols'
21259 crypt_r_proto='$crypt_r_proto'
21260 cryptlib='$cryptlib'
21262 ctermid_r_proto='$ctermid_r_proto'
21263 ctime_r_proto='$ctime_r_proto'
21264 d_Gconvert='$d_Gconvert'
21265 d_PRIEUldbl='$d_PRIEUldbl'
21266 d_PRIFUldbl='$d_PRIFUldbl'
21267 d_PRIGUldbl='$d_PRIGUldbl'
21268 d_PRIXU64='$d_PRIXU64'
21269 d_PRId64='$d_PRId64'
21270 d_PRIeldbl='$d_PRIeldbl'
21271 d_PRIfldbl='$d_PRIfldbl'
21272 d_PRIgldbl='$d_PRIgldbl'
21273 d_PRIi64='$d_PRIi64'
21274 d_PRIo64='$d_PRIo64'
21275 d_PRIu64='$d_PRIu64'
21276 d_PRIx64='$d_PRIx64'
21277 d_SCNfldbl='$d_SCNfldbl'
21278 d__fwalk='$d__fwalk'
21279 d_access='$d_access'
21280 d_accessx='$d_accessx'
21283 d_archlib='$d_archlib'
21284 d_asctime_r='$d_asctime_r'
21287 d_attribute_format='$d_attribute_format'
21288 d_attribute_malloc='$d_attribute_malloc'
21289 d_attribute_nonnull='$d_attribute_nonnull'
21290 d_attribute_noreturn='$d_attribute_noreturn'
21291 d_attribute_pure='$d_attribute_pure'
21292 d_attribute_unused='$d_attribute_unused'
21293 d_attribute_warn_unused_result='$d_attribute_warn_unused_result'
21297 d_bsdgetpgrp='$d_bsdgetpgrp'
21298 d_bsdsetpgrp='$d_bsdsetpgrp'
21299 d_builtin_choose_expr='$d_builtin_choose_expr'
21300 d_builtin_expect='$d_builtin_expect'
21302 d_casti32='$d_casti32'
21303 d_castneg='$d_castneg'
21304 d_charvspr='$d_charvspr'
21306 d_chroot='$d_chroot'
21307 d_chsize='$d_chsize'
21309 d_clearenv='$d_clearenv'
21310 d_closedir='$d_closedir'
21311 d_cmsghdr_s='$d_cmsghdr_s'
21313 d_copysignl='$d_copysignl'
21315 d_crypt_r='$d_crypt_r'
21317 d_ctermid_r='$d_ctermid_r'
21318 d_ctime_r='$d_ctime_r'
21319 d_cuserid='$d_cuserid'
21320 d_c99_variadic_macros='$d_c99_variadic_macros'
21321 d_dbl_dig='$d_dbl_dig'
21322 d_dbminitproto='$d_dbminitproto'
21323 d_difftime='$d_difftime'
21325 d_dirnamlen='$d_dirnamlen'
21326 d_dlerror='$d_dlerror'
21327 d_dlopen='$d_dlopen'
21328 d_dlsymun='$d_dlsymun'
21329 d_dosuid='$d_dosuid'
21330 d_drand48_r='$d_drand48_r'
21331 d_drand48proto='$d_drand48proto'
21333 d_eaccess='$d_eaccess'
21334 d_endgrent='$d_endgrent'
21335 d_endgrent_r='$d_endgrent_r'
21336 d_endhent='$d_endhent'
21337 d_endhostent_r='$d_endhostent_r'
21338 d_endnent='$d_endnent'
21339 d_endnetent_r='$d_endnetent_r'
21340 d_endpent='$d_endpent'
21341 d_endprotoent_r='$d_endprotoent_r'
21342 d_endpwent='$d_endpwent'
21343 d_endpwent_r='$d_endpwent_r'
21344 d_endsent='$d_endsent'
21345 d_endservent_r='$d_endservent_r'
21346 d_eofnblk='$d_eofnblk'
21347 d_eunice='$d_eunice'
21348 d_faststdio='$d_faststdio'
21349 d_fchdir='$d_fchdir'
21350 d_fchmod='$d_fchmod'
21351 d_fchown='$d_fchown'
21353 d_fcntl_can_lock='$d_fcntl_can_lock'
21354 d_fd_macros='$d_fd_macros'
21355 d_fd_set='$d_fd_set'
21356 d_fds_bits='$d_fds_bits'
21357 d_fgetpos='$d_fgetpos'
21358 d_finite='$d_finite'
21359 d_finitel='$d_finitel'
21360 d_flexfnam='$d_flexfnam'
21362 d_flockproto='$d_flockproto'
21364 d_fp_class='$d_fp_class'
21365 d_fpathconf='$d_fpathconf'
21366 d_fpclass='$d_fpclass'
21367 d_fpclassify='$d_fpclassify'
21368 d_fpclassl='$d_fpclassl'
21369 d_fpos64_t='$d_fpos64_t'
21370 d_frexpl='$d_frexpl'
21371 d_fs_data_s='$d_fs_data_s'
21372 d_fseeko='$d_fseeko'
21373 d_fsetpos='$d_fsetpos'
21374 d_fstatfs='$d_fstatfs'
21375 d_fstatvfs='$d_fstatvfs'
21377 d_ftello='$d_ftello'
21379 d_futimes='$d_futimes'
21380 d_getcwd='$d_getcwd'
21381 d_getespwnam='$d_getespwnam'
21382 d_getfsstat='$d_getfsstat'
21383 d_getgrent='$d_getgrent'
21384 d_getgrent_r='$d_getgrent_r'
21385 d_getgrgid_r='$d_getgrgid_r'
21386 d_getgrnam_r='$d_getgrnam_r'
21387 d_getgrps='$d_getgrps'
21388 d_gethbyaddr='$d_gethbyaddr'
21389 d_gethbyname='$d_gethbyname'
21390 d_gethent='$d_gethent'
21391 d_gethname='$d_gethname'
21392 d_gethostbyaddr_r='$d_gethostbyaddr_r'
21393 d_gethostbyname_r='$d_gethostbyname_r'
21394 d_gethostent_r='$d_gethostent_r'
21395 d_gethostprotos='$d_gethostprotos'
21396 d_getitimer='$d_getitimer'
21397 d_getlogin='$d_getlogin'
21398 d_getlogin_r='$d_getlogin_r'
21399 d_getmnt='$d_getmnt'
21400 d_getmntent='$d_getmntent'
21401 d_getnbyaddr='$d_getnbyaddr'
21402 d_getnbyname='$d_getnbyname'
21403 d_getnent='$d_getnent'
21404 d_getnetbyaddr_r='$d_getnetbyaddr_r'
21405 d_getnetbyname_r='$d_getnetbyname_r'
21406 d_getnetent_r='$d_getnetent_r'
21407 d_getnetprotos='$d_getnetprotos'
21408 d_getpagsz='$d_getpagsz'
21409 d_getpbyname='$d_getpbyname'
21410 d_getpbynumber='$d_getpbynumber'
21411 d_getpent='$d_getpent'
21412 d_getpgid='$d_getpgid'
21413 d_getpgrp2='$d_getpgrp2'
21414 d_getpgrp='$d_getpgrp'
21415 d_getppid='$d_getppid'
21416 d_getprior='$d_getprior'
21417 d_getprotobyname_r='$d_getprotobyname_r'
21418 d_getprotobynumber_r='$d_getprotobynumber_r'
21419 d_getprotoent_r='$d_getprotoent_r'
21420 d_getprotoprotos='$d_getprotoprotos'
21421 d_getprpwnam='$d_getprpwnam'
21422 d_getpwent='$d_getpwent'
21423 d_getpwent_r='$d_getpwent_r'
21424 d_getpwnam_r='$d_getpwnam_r'
21425 d_getpwuid_r='$d_getpwuid_r'
21426 d_getsbyname='$d_getsbyname'
21427 d_getsbyport='$d_getsbyport'
21428 d_getsent='$d_getsent'
21429 d_getservbyname_r='$d_getservbyname_r'
21430 d_getservbyport_r='$d_getservbyport_r'
21431 d_getservent_r='$d_getservent_r'
21432 d_getservprotos='$d_getservprotos'
21433 d_getspnam='$d_getspnam'
21434 d_getspnam_r='$d_getspnam_r'
21435 d_gettimeod='$d_gettimeod'
21436 d_gmtime_r='$d_gmtime_r'
21437 d_gnulibc='$d_gnulibc'
21438 d_grpasswd='$d_grpasswd'
21439 d_hasmntopt='$d_hasmntopt'
21441 d_ilogbl='$d_ilogbl'
21442 d_inc_version_list='$d_inc_version_list'
21444 d_inetaton='$d_inetaton'
21445 d_int64_t='$d_int64_t'
21446 d_isascii='$d_isascii'
21447 d_isfinite='$d_isfinite'
21450 d_isnanl='$d_isnanl'
21451 d_killpg='$d_killpg'
21452 d_lchown='$d_lchown'
21453 d_ldbl_dig='$d_ldbl_dig'
21454 d_libm_lib_version='$d_libm_lib_version'
21456 d_localtime_r='$d_localtime_r'
21457 d_locconv='$d_locconv'
21459 d_longdbl='$d_longdbl'
21460 d_longlong='$d_longlong'
21461 d_lseekproto='$d_lseekproto'
21463 d_madvise='$d_madvise'
21464 d_malloc_good_size='$d_malloc_good_size'
21465 d_malloc_size='$d_malloc_size'
21467 d_mbstowcs='$d_mbstowcs'
21468 d_mbtowc='$d_mbtowc'
21469 d_memchr='$d_memchr'
21470 d_memcmp='$d_memcmp'
21471 d_memcpy='$d_memcpy'
21472 d_memmove='$d_memmove'
21473 d_memset='$d_memset'
21475 d_mkdtemp='$d_mkdtemp'
21476 d_mkfifo='$d_mkfifo'
21477 d_mkstemp='$d_mkstemp'
21478 d_mkstemps='$d_mkstemps'
21479 d_mktime='$d_mktime'
21482 d_modfl_pow32_bug='$d_modfl_pow32_bug'
21483 d_modflproto='$d_modflproto'
21484 d_mprotect='$d_mprotect'
21486 d_msg_ctrunc='$d_msg_ctrunc'
21487 d_msg_dontroute='$d_msg_dontroute'
21488 d_msg_oob='$d_msg_oob'
21489 d_msg_peek='$d_msg_peek'
21490 d_msg_proxy='$d_msg_proxy'
21491 d_msgctl='$d_msgctl'
21492 d_msgget='$d_msgget'
21493 d_msghdr_s='$d_msghdr_s'
21494 d_msgrcv='$d_msgrcv'
21495 d_msgsnd='$d_msgsnd'
21497 d_munmap='$d_munmap'
21498 d_mymalloc='$d_mymalloc'
21500 d_nl_langinfo='$d_nl_langinfo'
21501 d_nv_preserves_uv='$d_nv_preserves_uv'
21502 d_nv_zero_is_allbits_zero='$d_nv_zero_is_allbits_zero'
21503 d_off64_t='$d_off64_t'
21504 d_old_pthread_create_joinable='$d_old_pthread_create_joinable'
21505 d_oldpthreads='$d_oldpthreads'
21506 d_oldsock='$d_oldsock'
21508 d_pathconf='$d_pathconf'
21510 d_perl_otherlibdirs='$d_perl_otherlibdirs'
21511 d_phostname='$d_phostname'
21514 d_portable='$d_portable'
21515 d_procselfexe='$d_procselfexe'
21516 d_pthread_atfork='$d_pthread_atfork'
21517 d_pthread_attr_setscope='$d_pthread_attr_setscope'
21518 d_pthread_yield='$d_pthread_yield'
21520 d_pwchange='$d_pwchange'
21521 d_pwclass='$d_pwclass'
21522 d_pwcomment='$d_pwcomment'
21523 d_pwexpire='$d_pwexpire'
21524 d_pwgecos='$d_pwgecos'
21525 d_pwpasswd='$d_pwpasswd'
21526 d_pwquota='$d_pwquota'
21529 d_random_r='$d_random_r'
21530 d_readdir64_r='$d_readdir64_r'
21531 d_readdir='$d_readdir'
21532 d_readdir_r='$d_readdir_r'
21533 d_readlink='$d_readlink'
21535 d_recvmsg='$d_recvmsg'
21536 d_rename='$d_rename'
21537 d_rewinddir='$d_rewinddir'
21539 d_safebcpy='$d_safebcpy'
21540 d_safemcpy='$d_safemcpy'
21541 d_sanemcmp='$d_sanemcmp'
21542 d_sbrkproto='$d_sbrkproto'
21543 d_scalbnl='$d_scalbnl'
21544 d_sched_yield='$d_sched_yield'
21545 d_scm_rights='$d_scm_rights'
21546 d_seekdir='$d_seekdir'
21547 d_select='$d_select'
21549 d_semctl='$d_semctl'
21550 d_semctl_semid_ds='$d_semctl_semid_ds'
21551 d_semctl_semun='$d_semctl_semun'
21552 d_semget='$d_semget'
21554 d_sendmsg='$d_sendmsg'
21555 d_setegid='$d_setegid'
21556 d_seteuid='$d_seteuid'
21557 d_setgrent='$d_setgrent'
21558 d_setgrent_r='$d_setgrent_r'
21559 d_setgrps='$d_setgrps'
21560 d_sethent='$d_sethent'
21561 d_sethostent_r='$d_sethostent_r'
21562 d_setitimer='$d_setitimer'
21563 d_setlinebuf='$d_setlinebuf'
21564 d_setlocale='$d_setlocale'
21565 d_setlocale_r='$d_setlocale_r'
21566 d_setnent='$d_setnent'
21567 d_setnetent_r='$d_setnetent_r'
21568 d_setpent='$d_setpent'
21569 d_setpgid='$d_setpgid'
21570 d_setpgrp2='$d_setpgrp2'
21571 d_setpgrp='$d_setpgrp'
21572 d_setprior='$d_setprior'
21573 d_setproctitle='$d_setproctitle'
21574 d_setprotoent_r='$d_setprotoent_r'
21575 d_setpwent='$d_setpwent'
21576 d_setpwent_r='$d_setpwent_r'
21577 d_setregid='$d_setregid'
21578 d_setresgid='$d_setresgid'
21579 d_setresuid='$d_setresuid'
21580 d_setreuid='$d_setreuid'
21581 d_setrgid='$d_setrgid'
21582 d_setruid='$d_setruid'
21583 d_setsent='$d_setsent'
21584 d_setservent_r='$d_setservent_r'
21585 d_setsid='$d_setsid'
21586 d_setvbuf='$d_setvbuf'
21590 d_shmatprototype='$d_shmatprototype'
21591 d_shmctl='$d_shmctl'
21593 d_shmget='$d_shmget'
21594 d_sigaction='$d_sigaction'
21595 d_sigprocmask='$d_sigprocmask'
21596 d_sigsetjmp='$d_sigsetjmp'
21597 d_sitearch='$d_sitearch'
21598 d_snprintf='$d_snprintf'
21599 d_sockatmark='$d_sockatmark'
21600 d_sockatmarkproto='$d_sockatmarkproto'
21601 d_socket='$d_socket'
21602 d_socklen_t='$d_socklen_t'
21603 d_sockpair='$d_sockpair'
21604 d_socks5_init='$d_socks5_init'
21605 d_sprintf_returns_strlen='$d_sprintf_returns_strlen'
21607 d_srand48_r='$d_srand48_r'
21608 d_srandom_r='$d_srandom_r'
21609 d_sresgproto='$d_sresgproto'
21610 d_sresuproto='$d_sresuproto'
21611 d_statblks='$d_statblks'
21612 d_statfs_f_flags='$d_statfs_f_flags'
21613 d_statfs_s='$d_statfs_s'
21614 d_statvfs='$d_statvfs'
21615 d_stdio_cnt_lval='$d_stdio_cnt_lval'
21616 d_stdio_ptr_lval='$d_stdio_ptr_lval'
21617 d_stdio_ptr_lval_nochange_cnt='$d_stdio_ptr_lval_nochange_cnt'
21618 d_stdio_ptr_lval_sets_cnt='$d_stdio_ptr_lval_sets_cnt'
21619 d_stdio_stream_array='$d_stdio_stream_array'
21620 d_stdiobase='$d_stdiobase'
21621 d_stdstdio='$d_stdstdio'
21622 d_strchr='$d_strchr'
21623 d_strcoll='$d_strcoll'
21624 d_strctcpy='$d_strctcpy'
21625 d_strerrm='$d_strerrm'
21626 d_strerror='$d_strerror'
21627 d_strerror_r='$d_strerror_r'
21628 d_strftime='$d_strftime'
21629 d_strlcat='$d_strlcat'
21630 d_strlcpy='$d_strlcpy'
21631 d_strtod='$d_strtod'
21632 d_strtol='$d_strtol'
21633 d_strtold='$d_strtold'
21634 d_strtoll='$d_strtoll'
21635 d_strtoq='$d_strtoq'
21636 d_strtoul='$d_strtoul'
21637 d_strtoull='$d_strtoull'
21638 d_strtouq='$d_strtouq'
21639 d_strxfrm='$d_strxfrm'
21640 d_suidsafe='$d_suidsafe'
21641 d_symlink='$d_symlink'
21642 d_syscall='$d_syscall'
21643 d_syscallproto='$d_syscallproto'
21644 d_sysconf='$d_sysconf'
21645 d_sysernlst='$d_sysernlst'
21646 d_syserrlst='$d_syserrlst'
21647 d_system='$d_system'
21648 d_tcgetpgrp='$d_tcgetpgrp'
21649 d_tcsetpgrp='$d_tcsetpgrp'
21650 d_telldir='$d_telldir'
21651 d_telldirproto='$d_telldirproto'
21654 d_tm_tm_gmtoff='$d_tm_tm_gmtoff'
21655 d_tm_tm_zone='$d_tm_tm_zone'
21656 d_tmpnam_r='$d_tmpnam_r'
21657 d_truncate='$d_truncate'
21658 d_ttyname_r='$d_ttyname_r'
21659 d_tzname='$d_tzname'
21660 d_u32align='$d_u32align'
21661 d_ualarm='$d_ualarm'
21664 d_union_semun='$d_union_semun'
21665 d_unordered='$d_unordered'
21666 d_unsetenv='$d_unsetenv'
21667 d_usleep='$d_usleep'
21668 d_usleepproto='$d_usleepproto'
21670 d_vendorarch='$d_vendorarch'
21671 d_vendorbin='$d_vendorbin'
21672 d_vendorlib='$d_vendorlib'
21673 d_vendorscript='$d_vendorscript'
21675 d_void_closedir='$d_void_closedir'
21676 d_voidsig='$d_voidsig'
21677 d_voidtty='$d_voidtty'
21678 d_volatile='$d_volatile'
21679 d_vprintf='$d_vprintf'
21680 d_vsnprintf='$d_vsnprintf'
21682 d_waitpid='$d_waitpid'
21683 d_wcstombs='$d_wcstombs'
21684 d_wctomb='$d_wctomb'
21685 d_writev='$d_writev'
21688 db_hashtype='$db_hashtype'
21689 db_prefixtype='$db_prefixtype'
21690 db_version_major='$db_version_major'
21691 db_version_minor='$db_version_minor'
21692 db_version_patch='$db_version_patch'
21693 defvoidused='$defvoidused'
21694 direntrytype='$direntrytype'
21697 doublesize='$doublesize'
21699 drand48_r_proto='$drand48_r_proto'
21700 dynamic_ext='$dynamic_ext'
21706 endgrent_r_proto='$endgrent_r_proto'
21707 endhostent_r_proto='$endhostent_r_proto'
21708 endnetent_r_proto='$endnetent_r_proto'
21709 endprotoent_r_proto='$endprotoent_r_proto'
21710 endpwent_r_proto='$endpwent_r_proto'
21711 endservent_r_proto='$endservent_r_proto'
21712 eunicefix='$eunicefix'
21715 extensions='$extensions'
21717 fflushNULL='$fflushNULL'
21718 fflushall='$fflushall'
21720 firstmakefile='$firstmakefile'
21722 fpossize='$fpossize'
21723 fpostype='$fpostype'
21724 freetype='$freetype'
21727 full_csh='$full_csh'
21728 full_sed='$full_sed'
21729 gccansipedantic='$gccansipedantic'
21730 gccosandvers='$gccosandvers'
21731 gccversion='$gccversion'
21732 getgrent_r_proto='$getgrent_r_proto'
21733 getgrgid_r_proto='$getgrgid_r_proto'
21734 getgrnam_r_proto='$getgrnam_r_proto'
21735 gethostbyaddr_r_proto='$gethostbyaddr_r_proto'
21736 gethostbyname_r_proto='$gethostbyname_r_proto'
21737 gethostent_r_proto='$gethostent_r_proto'
21738 getlogin_r_proto='$getlogin_r_proto'
21739 getnetbyaddr_r_proto='$getnetbyaddr_r_proto'
21740 getnetbyname_r_proto='$getnetbyname_r_proto'
21741 getnetent_r_proto='$getnetent_r_proto'
21742 getprotobyname_r_proto='$getprotobyname_r_proto'
21743 getprotobynumber_r_proto='$getprotobynumber_r_proto'
21744 getprotoent_r_proto='$getprotoent_r_proto'
21745 getpwent_r_proto='$getpwent_r_proto'
21746 getpwnam_r_proto='$getpwnam_r_proto'
21747 getpwuid_r_proto='$getpwuid_r_proto'
21748 getservbyname_r_proto='$getservbyname_r_proto'
21749 getservbyport_r_proto='$getservbyport_r_proto'
21750 getservent_r_proto='$getservent_r_proto'
21751 getspnam_r_proto='$getspnam_r_proto'
21752 gidformat='$gidformat'
21758 gmtime_r_proto='$gmtime_r_proto'
21759 gnulibc_version='$gnulibc_version'
21761 groupcat='$groupcat'
21762 groupstype='$groupstype'
21765 h_sysfile='$h_sysfile'
21768 html1dir='$html1dir'
21769 html1direxp='$html1direxp'
21770 html3dir='$html3dir'
21771 html3direxp='$html3direxp'
21780 i_arpainet='$i_arpainet'
21781 i_bsdioctl='$i_bsdioctl'
21785 i_dirent='$i_dirent'
21791 i_fp_class='$i_fp_class'
21794 i_ieeefp='$i_ieeefp'
21795 i_inttypes='$i_inttypes'
21796 i_langinfo='$i_langinfo'
21797 i_libutil='$i_libutil'
21798 i_limits='$i_limits'
21799 i_locale='$i_locale'
21800 i_machcthr='$i_machcthr'
21801 i_malloc='$i_malloc'
21803 i_memory='$i_memory'
21804 i_mntent='$i_mntent'
21807 i_neterrno='$i_neterrno'
21808 i_netinettcp='$i_netinettcp'
21812 i_pthread='$i_pthread'
21814 i_rpcsvcdbm='$i_rpcsvcdbm'
21817 i_shadow='$i_shadow'
21819 i_stdarg='$i_stdarg'
21820 i_stddef='$i_stddef'
21821 i_stdlib='$i_stdlib'
21822 i_string='$i_string'
21823 i_sunmath='$i_sunmath'
21824 i_sysaccess='$i_sysaccess'
21825 i_sysdir='$i_sysdir'
21826 i_sysfile='$i_sysfile'
21827 i_sysfilio='$i_sysfilio'
21829 i_sysioctl='$i_sysioctl'
21830 i_syslog='$i_syslog'
21831 i_sysmman='$i_sysmman'
21832 i_sysmode='$i_sysmode'
21833 i_sysmount='$i_sysmount'
21834 i_sysndir='$i_sysndir'
21835 i_sysparam='$i_sysparam'
21836 i_sysresrc='$i_sysresrc'
21837 i_syssecrt='$i_syssecrt'
21838 i_sysselct='$i_sysselct'
21839 i_syssockio='$i_syssockio'
21840 i_sysstat='$i_sysstat'
21841 i_sysstatfs='$i_sysstatfs'
21842 i_sysstatvfs='$i_sysstatvfs'
21843 i_systime='$i_systime'
21844 i_systimek='$i_systimek'
21845 i_systimes='$i_systimes'
21846 i_systypes='$i_systypes'
21847 i_sysuio='$i_sysuio'
21849 i_sysutsname='$i_sysutsname'
21850 i_sysvfs='$i_sysvfs'
21851 i_syswait='$i_syswait'
21852 i_termio='$i_termio'
21853 i_termios='$i_termios'
21855 i_unistd='$i_unistd'
21858 i_values='$i_values'
21859 i_varargs='$i_varargs'
21860 i_varhdr='$i_varhdr'
21862 ignore_versioned_solibs='$ignore_versioned_solibs'
21863 inc_version_list='$inc_version_list'
21864 inc_version_list_init='$inc_version_list_init'
21867 initialinstalllocation='$initialinstalllocation'
21868 installarchlib='$installarchlib'
21869 installbin='$installbin'
21870 installhtml1dir='$installhtml1dir'
21871 installhtml3dir='$installhtml3dir'
21872 installman1dir='$installman1dir'
21873 installman3dir='$installman3dir'
21874 installprefix='$installprefix'
21875 installprefixexp='$installprefixexp'
21876 installprivlib='$installprivlib'
21877 installscript='$installscript'
21878 installsitearch='$installsitearch'
21879 installsitebin='$installsitebin'
21880 installsitehtml1dir='$installsitehtml1dir'
21881 installsitehtml3dir='$installsitehtml3dir'
21882 installsitelib='$installsitelib'
21883 installsiteman1dir='$installsiteman1dir'
21884 installsiteman3dir='$installsiteman3dir'
21885 installsitescript='$installsitescript'
21886 installstyle='$installstyle'
21887 installusrbinperl='$installusrbinperl'
21888 installvendorarch='$installvendorarch'
21889 installvendorbin='$installvendorbin'
21890 installvendorhtml1dir='$installvendorhtml1dir'
21891 installvendorhtml3dir='$installvendorhtml3dir'
21892 installvendorlib='$installvendorlib'
21893 installvendorman1dir='$installvendorman1dir'
21894 installvendorman3dir='$installvendorman3dir'
21895 installvendorscript='$installvendorscript'
21897 issymlink='$issymlink'
21898 ivdformat='$ivdformat'
21901 known_extensions='$known_extensions'
21904 lddlflags='$lddlflags'
21906 ldflags_uselargefiles='$ldflags_uselargefiles'
21907 ldlibpthname='$ldlibpthname'
21914 libsdirs='$libsdirs'
21915 libsfiles='$libsfiles'
21916 libsfound='$libsfound'
21917 libspath='$libspath'
21918 libswanted='$libswanted'
21919 libswanted_uselargefiles='$libswanted_uselargefiles'
21925 localtime_r_proto='$localtime_r_proto'
21926 locincpth='$locincpth'
21927 loclibpth='$loclibpth'
21928 longdblsize='$longdblsize'
21929 longlongsize='$longlongsize'
21930 longsize='$longsize'
21934 lseeksize='$lseeksize'
21935 lseektype='$lseektype'
21938 madlyobj='$madlyobj'
21939 madlysrc='$madlysrc'
21943 make_set_make='$make_set_make'
21944 mallocobj='$mallocobj'
21945 mallocsrc='$mallocsrc'
21946 malloctype='$malloctype'
21948 man1direxp='$man1direxp'
21951 man3direxp='$man3direxp'
21953 mips_type='$mips_type'
21954 mistrustnm='$mistrustnm'
21956 mmaptype='$mmaptype'
21957 modetype='$modetype'
21959 multiarch='$multiarch'
21961 myarchname='$myarchname'
21962 mydomain='$mydomain'
21963 myhostname='$myhostname'
21966 need_va_copy='$need_va_copy'
21967 netdb_hlen_type='$netdb_hlen_type'
21968 netdb_host_type='$netdb_host_type'
21969 netdb_name_type='$netdb_name_type'
21970 netdb_net_type='$netdb_net_type'
21973 nm_so_opt='$nm_so_opt'
21974 nonxs_ext='$nonxs_ext'
21976 nvEUformat='$nvEUformat'
21977 nvFUformat='$nvFUformat'
21978 nvGUformat='$nvGUformat'
21979 nv_preserves_uv_bits='$nv_preserves_uv_bits'
21980 nveformat='$nveformat'
21981 nvfformat='$nvfformat'
21982 nvgformat='$nvgformat'
21985 o_nonblock='$o_nonblock'
21987 old_pthread_create_joinable='$old_pthread_create_joinable'
21988 optimize='$optimize'
21989 orderlib='$orderlib'
21992 otherlibdirs='$otherlibdirs'
21996 patchlevel='$patchlevel'
21997 path_sep='$path_sep'
22000 perl_patchlevel='$perl_patchlevel'
22001 perladmin='$perladmin'
22002 perllibs='$perllibs'
22003 perlpath='$perlpath'
22005 phostname='$phostname'
22011 prefixexp='$prefixexp'
22013 privlibexp='$privlibexp'
22014 procselfexe='$procselfexe'
22015 prototype='$prototype'
22017 quadkind='$quadkind'
22018 quadtype='$quadtype'
22019 randbits='$randbits'
22020 randfunc='$randfunc'
22021 random_r_proto='$random_r_proto'
22022 randseedtype='$randseedtype'
22024 rd_nodata='$rd_nodata'
22025 readdir64_r_proto='$readdir64_r_proto'
22026 readdir_r_proto='$readdir_r_proto'
22027 revision='$revision'
22032 sPRIEUldbl='$sPRIEUldbl'
22033 sPRIFUldbl='$sPRIFUldbl'
22034 sPRIGUldbl='$sPRIGUldbl'
22035 sPRIXU64='$sPRIXU64'
22037 sPRIeldbl='$sPRIeldbl'
22038 sPRIfldbl='$sPRIfldbl'
22039 sPRIgldbl='$sPRIgldbl'
22044 sSCNfldbl='$sSCNfldbl'
22045 sched_yield='$sched_yield'
22046 scriptdir='$scriptdir'
22047 scriptdirexp='$scriptdirexp'
22049 seedfunc='$seedfunc'
22050 selectminbits='$selectminbits'
22051 selecttype='$selecttype'
22052 sendmail='$sendmail'
22053 setgrent_r_proto='$setgrent_r_proto'
22054 sethostent_r_proto='$sethostent_r_proto'
22055 setlocale_r_proto='$setlocale_r_proto'
22056 setnetent_r_proto='$setnetent_r_proto'
22057 setprotoent_r_proto='$setprotoent_r_proto'
22058 setpwent_r_proto='$setpwent_r_proto'
22059 setservent_r_proto='$setservent_r_proto'
22062 sharpbang='$sharpbang'
22063 shmattype='$shmattype'
22064 shortsize='$shortsize'
22067 sig_count='$sig_count'
22068 sig_name='$sig_name'
22069 sig_name_init='$sig_name_init'
22071 sig_num_init='$sig_num_init'
22072 sig_size='$sig_size'
22073 signal_t='$signal_t'
22074 sitearch='$sitearch'
22075 sitearchexp='$sitearchexp'
22077 sitebinexp='$sitebinexp'
22078 sitehtml1dir='$sitehtml1dir'
22079 sitehtml1direxp='$sitehtml1direxp'
22080 sitehtml3dir='$sitehtml3dir'
22081 sitehtml3direxp='$sitehtml3direxp'
22083 sitelib_stem='$sitelib_stem'
22084 sitelibexp='$sitelibexp'
22085 siteman1dir='$siteman1dir'
22086 siteman1direxp='$siteman1direxp'
22087 siteman3dir='$siteman3dir'
22088 siteman3direxp='$siteman3direxp'
22089 siteprefix='$siteprefix'
22090 siteprefixexp='$siteprefixexp'
22091 sitescript='$sitescript'
22092 sitescriptexp='$sitescriptexp'
22093 sizesize='$sizesize'
22094 sizetype='$sizetype'
22098 sockethdr='$sockethdr'
22099 socketlib='$socketlib'
22100 socksizetype='$socksizetype'
22102 spackage='$spackage'
22103 spitshell='$spitshell'
22104 srand48_r_proto='$srand48_r_proto'
22105 srandom_r_proto='$srandom_r_proto'
22107 ssizetype='$ssizetype'
22108 startperl='$startperl'
22110 static_ext='$static_ext'
22112 stdio_base='$stdio_base'
22113 stdio_bufsiz='$stdio_bufsiz'
22114 stdio_cnt='$stdio_cnt'
22115 stdio_filbuf='$stdio_filbuf'
22116 stdio_ptr='$stdio_ptr'
22117 stdio_stream_array='$stdio_stream_array'
22118 strerror_r_proto='$strerror_r_proto'
22121 subversion='$subversion'
22125 targetarch='$targetarch'
22129 timeincl='$timeincl'
22130 timetype='$timetype'
22131 tmpnam_r_proto='$tmpnam_r_proto'
22137 ttyname_r_proto='$ttyname_r_proto'
22146 uidformat='$uidformat'
22152 uquadtype='$uquadtype'
22153 use5005threads='$use5005threads'
22154 use64bitall='$use64bitall'
22155 use64bitint='$use64bitint'
22156 usecrosscompile='$usecrosscompile'
22158 usefaststdio='$usefaststdio'
22159 useithreads='$useithreads'
22160 uselargefiles='$uselargefiles'
22161 uselongdouble='$uselongdouble'
22162 usemallocwrap='$usemallocwrap'
22163 usemorebits='$usemorebits'
22164 usemultiplicity='$usemultiplicity'
22165 usemymalloc='$usemymalloc'
22167 useopcode='$useopcode'
22168 useperlio='$useperlio'
22169 useposix='$useposix'
22170 usereentrant='$usereentrant'
22171 userelocatableinc='$userelocatableinc'
22173 useshrplib='$useshrplib'
22174 usesitecustomize='$usesitecustomize'
22175 usesocks='$usesocks'
22176 usethreads='$usethreads'
22177 usevendorprefix='$usevendorprefix'
22178 usevfork='$usevfork'
22181 uvXUformat='$uvXUformat'
22182 uvoformat='$uvoformat'
22185 uvuformat='$uvuformat'
22186 uvxformat='$uvxformat'
22187 vendorarch='$vendorarch'
22188 vendorarchexp='$vendorarchexp'
22189 vendorbin='$vendorbin'
22190 vendorbinexp='$vendorbinexp'
22191 vendorhtml1dir='$vendorhtml1dir'
22192 vendorhtml1direxp='$vendorhtml1direxp'
22193 vendorhtml3dir='$vendorhtml3dir'
22194 vendorhtml3direxp='$vendorhtml3direxp'
22195 vendorlib='$vendorlib'
22196 vendorlib_stem='$vendorlib_stem'
22197 vendorlibexp='$vendorlibexp'
22198 vendorman1dir='$vendorman1dir'
22199 vendorman1direxp='$vendorman1direxp'
22200 vendorman3dir='$vendorman3dir'
22201 vendorman3direxp='$vendorman3direxp'
22202 vendorprefix='$vendorprefix'
22203 vendorprefixexp='$vendorprefixexp'
22204 vendorscript='$vendorscript'
22205 vendorscriptexp='$vendorscriptexp'
22207 version_patchlevel_string='$version_patchlevel_string'
22208 versiononly='$versiononly'
22210 voidflags='$voidflags'
22213 yaccflags='$yaccflags'
22218 : Add in command line options if available
22219 $test -f UU/cmdline.opt && $cat UU/cmdline.opt >> config.sh
22221 : add special variables
22222 $test -f $src/patchlevel.h && \
22223 awk '/^#define[ ]+PERL_/ {printf "%s=%s\n",$2,$3}' $src/patchlevel.h >>config.sh
22224 echo "PERL_PATCHLEVEL=$perl_patchlevel" >>config.sh
22225 echo "PERL_CONFIG_SH=true" >>config.sh
22227 : propagate old symbols
22228 if $test -f UU/config.sh; then
22229 <UU/config.sh $sort | $uniq >UU/oldconfig.sh
22230 sed -n 's/^\([a-zA-Z_0-9]*\)=.*/\1/p' config.sh config.sh UU/oldconfig.sh |\
22231 $sort | $uniq -u >UU/oldsyms
22232 set X `cat UU/oldsyms`
22238 Hmm...You had some extra variables I don't know about...I'll try to keep 'em...
22240 echo "# Variables propagated from previous config.sh file." >>config.sh
22241 for sym in `cat UU/oldsyms`; do
22242 echo " Propagating $hint variable "'$'"$sym..."
22243 eval 'tmp="$'"${sym}"'"'
22245 sed -e "s/'/'\"'\"'/g" -e "s/^/$sym='/" -e "s/$/'/" >>config.sh
22251 : Finish up by extracting the .SH files
22255 echo "Extraction done."
22265 If you'd like to make any changes to the config.sh file before I begin
22266 to configure things, do it as a shell escape now (e.g. !vi config.sh).
22269 rp="Press return or use a shell escape to edit config.sh:"
22274 *) : in case they cannot read
22275 sh 1>&4 -c "$ans";;
22280 : if this fails, just run all the .SH files by hand
22289 if $contains '^depend:' [Mm]akefile >/dev/null 2>&1; then
22296 Now you need to generate make dependencies by running "$make depend".
22297 You might prefer to run it in background: "$make depend > makedepend.out &"
22298 It can take a while, so you might not want to run it right now.
22303 rp="Run $make depend now?"
22307 $make depend && echo "Now you must run '$make'."
22310 echo "You must run '$make depend' then '$make'."
22313 elif test -f [Mm]akefile; then
22315 echo "Now you must run a $make."
22317 echo "Configure done."
22320 if $test -f Policy.sh; then
22323 If you compile $package on a different machine or from a different object
22324 directory, copy the Policy.sh file from this object directory to the
22325 new one before you run Configure -- this will help you with most of
22326 the policy defaults.
22330 if $test -f config.msg; then
22331 echo "Hmm. I also noted the following information while running:"
22333 $cat config.msg >&4
22336 $rm -f kit*isdone ark*isdone