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.
6049 : XXX If this is fixed, also fix the "start perl" hunk below, which relies on
6050 : this via initialinstalllocation
6053 case "$userelocatableinc" in
6054 $define|true|[yY]*) dflt='y' ;;
6059 Would you like to build Perl so that the installation is relocatable, so that
6060 library paths in @INC are determined relative to the path of the perl binary?
6061 This is not advised for system Perl installs, or if you need to run setid
6062 scripts or scripts under taint mode.
6064 If this doesn't make any sense to you, just accept the default '$dflt'.
6066 rp='Use relocatable @INC?'
6069 y|Y) val="$define" ;;
6072 set userelocatableinc
6075 initialinstalllocation="$binexp"
6076 : Default prefix is now "up one level from where the binaries are"
6077 case "$userelocatableinc" in
6083 installprefixexp=".../.."
6087 : determine where private library files go
6088 : Usual default is /usr/local/lib/perl5/$version.
6089 : Also allow things like /opt/perl/lib/$version, since
6090 : /opt/perl/lib/perl5... would be redundant.
6091 : The default "style" setting is made in installstyle.U
6092 case "$installstyle" in
6093 *lib/perl5*) set dflt privlib lib/$package/$version ;;
6094 *) set dflt privlib lib/$version ;;
6099 There are some auxiliary files for $package that need to be put into a
6100 private library directory that is accessible by everyone.
6105 rp='Pathname where the private library files will reside?'
6110 : set the prefixup variable, to restore leading tilda escape
6111 prefixup='case "$prefixexp" in
6113 *) eval "$1=\`echo \$$1 | sed \"s,^$prefixexp,$prefix,\"\`";;
6116 : determine where public architecture dependent libraries go
6119 : privlib default is /usr/local/lib/$package/$version
6120 : archlib default is /usr/local/lib/$package/$version/$archname
6121 : privlib may have an optional trailing /share.
6122 tdflt=`echo $privlib | $sed 's,/share$,,'`
6123 tdflt=$tdflt/$archname
6132 $spackage contains architecture-dependent library files. If you are
6133 sharing libraries in a heterogeneous environment, you might store
6134 these files in a separate location. Otherwise, you can just include
6135 them with the rest of the public library files.
6140 rp='Where do you want to put the public architecture-dependent libraries?'
6144 if $test X"$archlib" = X"$privlib"; then
6150 : see if setuid scripts can be secure
6153 Some kernels have a bug that prevents setuid #! scripts from being
6154 secure. Some sites have disabled setuid #! scripts because of this.
6156 First let's decide if your kernel supports secure setuid #! scripts.
6157 (If setuid #! scripts would be secure but have been disabled anyway,
6158 don't say that they are secure if asked.)
6163 if $test -d /dev/fd; then
6164 echo "#!$ls" >reflect
6165 chmod +x,u+s reflect
6166 ./reflect >flect 2>&1
6167 if $contains "/dev/fd" flect >/dev/null; then
6168 echo "Congratulations, your kernel has secure setuid scripts!" >&4
6172 If you are not sure if they are secure, I can check but I'll need a
6173 username and password different from the one you are using right now.
6174 If you don't have such a username or don't want me to test, simply
6178 rp='Other username to test security of setuid scripts with?'
6183 case "$d_suidsafe" in
6184 '') echo "I'll assume setuid scripts are *not* secure." >&4
6187 echo "Well, the $hint value is *not* secure." >&4
6189 *) echo "Well, the $hint value *is* secure." >&4
6194 $rm -f reflect flect
6195 echo "#!$ls" >reflect
6196 chmod +x,u+s reflect
6199 echo '"su" will (probably) prompt you for '"$ans's password."
6200 su $ans -c './reflect >flect'
6201 if $contains "/dev/fd" flect >/dev/null; then
6202 echo "Okay, it looks like setuid scripts are secure." >&4
6205 echo "I don't think setuid scripts are secure." >&4
6210 rp='Does your kernel have *secure* setuid scripts?'
6213 [yY]*) val="$define";;
6218 echo "I don't think setuid scripts are secure (no /dev/fd directory)." >&4
6219 echo "(That's for file descriptors, not floppy disks.)"
6225 $rm -f reflect flect
6227 : now see if they want to do setuid emulation
6230 case "$d_suidsafe" in
6233 echo "No need to emulate SUID scripts since they are secure here." >&4
6237 Some systems have disabled setuid scripts, especially systems where
6238 setuid scripts cannot be secure. On systems where setuid scripts have
6239 been disabled, the setuid/setgid bits on scripts are currently
6240 useless. It is possible for $package to detect those bits and emulate
6241 setuid/setgid in a secure fashion. This emulation will only work if
6242 setuid scripts have been disabled in your kernel.
6246 "$define") dflt=y ;;
6249 rp="Do you want to do setuid/setgid emulation?"
6252 [yY]*) val="$define";;
6260 : Find perl5.005 or later.
6261 echo "Looking for a previously installed perl5.005 or later... "
6263 '') for tdir in `echo "$binexp$path_sep$PATH" | $sed "s/$path_sep/ /g"`; do
6264 : Check if this perl is recent and can load a simple module
6265 if $test -x $tdir/perl$exe_ext && $tdir/perl -Mless -e 'use 5.005;' >/dev/null 2>&1; then
6268 elif $test -x $tdir/perl5$exe_ext && $tdir/perl5 -Mless -e 'use 5.005;' >/dev/null 2>&1; then
6278 '') echo "None found. That's ok.";;
6279 *) echo "Using $perl5." ;;
6284 After $package is installed, you may wish to install various
6285 add-on modules and utilities. Typically, these add-ons will
6286 be installed under $prefix with the rest
6287 of this package. However, you may wish to install such add-ons
6288 elsewhere under a different prefix.
6290 If you do not wish to put everything under a single prefix, that's
6291 ok. You will be prompted for the individual locations; this siteprefix
6292 is only used to suggest the defaults.
6294 The default should be fine for most people.
6298 rp='Installation prefix to use for add-on modules and utilities?'
6299 : XXX Here might be another good place for an installstyle setting.
6300 case "$siteprefix" in
6302 *) dflt=$siteprefix ;;
6305 : XXX Prefixit unit does not yet support siteprefix and vendorprefix
6307 case "$siteprefix" in
6311 *) oldsiteprefix="$prefix";;
6316 siteprefixexp="$ansexp"
6318 : determine where site specific libraries go.
6319 : Usual default is /usr/local/lib/perl5/site_perl/$version
6320 : The default "style" setting is made in installstyle.U
6321 : XXX No longer works with Prefixit stuff.
6322 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
6324 '') case "$installstyle" in
6325 *lib/perl5*) dflt=$siteprefix/lib/$package/site_$prog/$version ;;
6326 *) dflt=$siteprefix/lib/site_$prog/$version ;;
6334 The installation process will create a directory for
6335 site-specific extensions and modules. Most users find it convenient
6336 to place all site-specific files in this directory rather than in the
6337 main distribution directory.
6341 rp='Pathname for the site-specific library files?'
6345 sitelib_stem=`echo "$sitelibexp" | sed "s,/$version$,,"`
6347 : Determine list of previous versions to include in @INC
6348 $cat > getverlist <<EOPL
6351 \$api_versionstring = "$api_versionstring";
6352 \$version = "$version";
6353 \$stem = "$sitelib_stem";
6354 \$archname = "$archname";
6356 $cat >> getverlist <<'EOPL'
6357 # Can't have leading @ because metaconfig interprets it as a command!
6358 ;@inc_version_list=();
6359 # XXX Redo to do opendir/readdir?
6362 ;@candidates = glob("5.*");
6368 # XXX ToDo: These comparisons must be reworked when two-digit
6369 # subversions come along, so that 5.7.10 compares as greater than
6370 # 5.7.3! By that time, hope that 5.6.x is sufficiently
6371 # widespread that we can use the built-in version vectors rather
6372 # than reinventing them here. For 5.6.0, however, we must
6373 # assume this script will likely be run by 5.005_0x. --AD 1/2000.
6374 foreach $d (@candidates) {
6375 if ($d lt $version) {
6376 if ($d ge $api_versionstring) {
6377 unshift(@inc_version_list, grep { -d } "$d/$archname", $d);
6379 elsif ($d ge "5.005") {
6380 unshift(@inc_version_list, grep { -d } $d);
6384 # Skip newer version. I.e. don't look in
6385 # 5.7.0 if we're installing 5.6.1.
6389 if (@inc_version_list) {
6390 print join(' ', @inc_version_list);
6393 # Blank space to preserve value for next Configure run.
6398 case "$inc_version_list" in
6399 '') if test -x "$perl5$exe_ext"; then
6400 dflt=`$perl5 getverlist`
6405 $undef) dflt='none' ;;
6406 *) eval dflt=\"$inc_version_list\" ;;
6409 ''|' ') dflt=none ;;
6416 In order to ease the process of upgrading, this version of perl
6417 can be configured to use modules built and installed with earlier
6418 versions of perl that were installed under $prefix. Specify here
6419 the list of earlier versions that this version of perl should check.
6420 If Configure detected no earlier versions of perl installed under
6421 $prefix, then the list will be empty. Answer 'none' to tell perl
6422 to not search earlier versions.
6424 The default should almost always be sensible, so if you're not sure,
6425 just accept the default.
6428 rp='List of earlier versions to include in @INC?'
6431 [Nn]one|''|' '|$undef) inc_version_list=' ' ;;
6432 *) inc_version_list="$ans" ;;
6434 case "$inc_version_list" in
6436 inc_version_list_init='0'
6437 d_inc_version_list="$undef"
6439 *) inc_version_list_init=`echo $inc_version_list |
6440 $sed -e 's/^/"/' -e 's/ /","/g' -e 's/$/",0/'`
6441 d_inc_version_list="$define"
6446 : see if this is a malloc.h system
6447 : we want a real compile instead of Inhdr because some systems have a
6448 : malloc.h that just gives a compile error saying to use stdlib.h instead
6453 int main () { return 0; }
6456 if eval $compile; then
6457 echo "<malloc.h> found." >&4
6460 echo "<malloc.h> NOT found." >&4
6467 : check for void type
6469 echo "Checking to see how well your C compiler groks the void type..." >&4
6470 case "$voidflags" in
6482 extern void moo(); /* function returning void */
6483 void (*goo)(); /* ptr to func returning void */
6485 void *hue; /* generic ptr */
6498 int main() { sub(); }
6500 if $cc $ccflags -c -DTRY=$defvoidused try.c >.out 2>&1 ; then
6501 voidflags=$defvoidused
6502 echo "Good. It appears to support void to the level $package wants.">&4
6503 if $contains warning .out >/dev/null 2>&1; then
6504 echo "However, you might get some warnings that look like this:"
6508 echo "Hmm, your compiler has some difficulty with void. Checking further..." >&4
6509 if $cc $ccflags -c -DTRY=1 try.c >/dev/null 2>&1; then
6510 echo "It supports 1..."
6511 if $cc $ccflags -c -DTRY=3 try.c >/dev/null 2>&1; then
6512 echo "It also supports 2..."
6513 if $cc $ccflags -c -DTRY=7 try.c >/dev/null 2>&1; then
6515 echo "And it supports 4 but not 8 definitely."
6517 echo "It doesn't support 4..."
6518 if $cc $ccflags -c -DTRY=11 try.c >/dev/null 2>&1; then
6520 echo "But it supports 8."
6523 echo "Neither does it support 8."
6527 echo "It does not support 2..."
6528 if $cc $ccflags -c -DTRY=13 try.c >/dev/null 2>&1; then
6530 echo "But it supports 4 and 8."
6532 if $cc $ccflags -c -DTRY=5 try.c >/dev/null 2>&1; then
6534 echo "And it supports 4 but has not heard about 8."
6536 echo "However it supports 8 but not 4."
6541 echo "There is no support at all for void."
6546 case "$voidflags" in
6549 Support flag bits are:
6550 1: basic void declarations.
6551 2: arrays of pointers to functions returning void.
6552 4: operations between pointers to and addresses of void functions.
6553 8: generic void pointers.
6556 rp="Your void support flags add up to what?"
6563 : check for length of pointer
6567 echo "Checking to see how big your pointers are..." >&4
6568 if test "$voidflags" -gt 7; then
6569 echo '#define VOID_PTR char *' > try.c
6571 echo '#define VOID_PTR void *' > try.c
6581 printf("%d\n", (int)sizeof(VOID_PTR));
6586 if eval $compile_ok; then
6587 ptrsize=`$run ./try`
6588 echo "Your pointers are $ptrsize bytes long."
6591 echo "(I can't seem to compile the test program. Guessing...)" >&4
6592 rp="What is the size of a pointer (in bytes)?"
6599 case "$use64bitall" in
6600 "$define"|true|[yY]*)
6604 *** You have chosen a maximally 64-bit build,
6605 *** but your pointers are only 4 bytes wide.
6606 *** Please rerun Configure without -Duse64bitall.
6611 *** Since you have quads, you could possibly try with -Duse64bitint.
6616 *** Cannot continue, aborting.
6627 : determine whether to use malloc wrapping
6629 case "$usemallocwrap" in
6630 [yY]*|true|$define) dflt='y' ;;
6631 [nN]*|false|$undef) dflt='n' ;;
6632 *) case "$usedevel" in
6633 [yY]*|true|$define) dflt='y' ;;
6638 rp="Do you wish to wrap malloc calls to protect against potential overflows?"
6640 usemallocwrap="$ans"
6643 usemallocwrap="$define" ;;
6645 usemallocwrap="$undef" ;;
6648 : determine which malloc to compile in
6650 case "$usemymalloc" in
6651 [yY]*|true|$define) dflt='y' ;;
6652 [nN]*|false|$undef) dflt='n' ;;
6653 *) case "$ptrsize" in
6659 rp="Do you wish to attempt to use the malloc that comes with $package?"
6665 mallocsrc='malloc.c'
6666 mallocobj="malloc$_o"
6667 d_mymalloc="$define"
6670 : Remove malloc from list of libraries to use
6671 echo "Removing unneeded -lmalloc from library list" >&4
6672 set `echo X $libs | $sed -e 's/-lmalloc / /' -e 's/-lmalloc$//'`
6675 echo "libs = $libs" >&4
6687 : compute the return types of malloc and free
6689 $cat >malloc.c <<END
6693 #include <sys/types.h>
6707 case "$malloctype" in
6709 if $cc $ccflags -c -DTRY_MALLOC malloc.c >/dev/null 2>&1; then
6716 echo "Your system wants malloc to return '$malloctype', it would seem." >&4
6720 if $cc $ccflags -c -DTRY_FREE malloc.c >/dev/null 2>&1; then
6727 echo "Your system uses $freetype free(), it would seem." >&4
6729 : determine where site specific architecture-dependent libraries go.
6730 : sitelib default is /usr/local/lib/perl5/site_perl/$version
6731 : sitearch default is /usr/local/lib/perl5/site_perl/$version/$archname
6732 : sitelib may have an optional trailing /share.
6734 '') dflt=`echo $sitelib | $sed 's,/share$,,'`
6735 dflt="$dflt/$archname"
6740 set sitearch sitearch none
6744 The installation process will also create a directory for
6745 architecture-dependent site-specific extensions and modules.
6749 rp='Pathname for the site-specific architecture-dependent library files?'
6753 if $test X"$sitearch" = X"$sitelib"; then
6756 d_sitearch="$define"
6761 The installation process will also create a directory for
6762 vendor-supplied add-ons. Vendors who supply perl with their system
6763 may find it convenient to place all vendor-supplied files in this
6764 directory rather than in the main distribution directory. This will
6765 ease upgrades between binary-compatible maintenance versions of perl.
6767 Of course you may also use these directories in whatever way you see
6768 fit. For example, you might use them to access modules shared over a
6769 company-wide network.
6771 The default answer should be fine for most people.
6772 This causes further questions about vendor add-ons to be skipped
6773 and no vendor-specific directories will be configured for perl.
6776 rp='Do you want to configure vendor-specific add-on directories?'
6777 case "$usevendorprefix" in
6778 define|true|[yY]*) dflt=y ;;
6779 *) : User may have set vendorprefix directly on Configure command line.
6780 case "$vendorprefix" in
6789 rp='Installation prefix to use for vendor-supplied add-ons?'
6790 case "$vendorprefix" in
6792 *) dflt=$vendorprefix ;;
6795 : XXX Prefixit unit does not yet support siteprefix and vendorprefix
6797 case "$vendorprefix" in
6801 *) oldvendorprefix="$prefix";;
6805 usevendorprefix="$define"
6807 vendorprefixexp="$ansexp"
6809 *) usevendorprefix="$undef"
6815 case "$vendorprefix" in
6816 '') d_vendorlib="$undef"
6820 *) d_vendorlib="$define"
6821 : determine where vendor-supplied modules go.
6822 : Usual default is /usr/local/lib/perl5/vendor_perl/$version
6823 case "$vendorlib" in
6825 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
6826 case "$installstyle" in
6827 *lib/perl5*) dflt=$vendorprefix/lib/$package/vendor_$prog/$version ;;
6828 *) dflt=$vendorprefix/lib/vendor_$prog/$version ;;
6831 *) dflt="$vendorlib"
6835 rp='Pathname for the vendor-supplied library files?'
6838 vendorlibexp="$ansexp"
6841 vendorlib_stem=`echo "$vendorlibexp" | sed "s,/$version$,,"`
6845 case "$vendorprefix" in
6846 '') d_vendorarch="$undef"
6850 *) d_vendorarch="$define"
6851 : determine where vendor-supplied architecture-dependent libraries go.
6852 : vendorlib default is /usr/local/lib/perl5/vendor_perl/$version
6853 : vendorarch default is /usr/local/lib/perl5/vendor_perl/$version/$archname
6854 : vendorlib may have an optional trailing /share.
6855 case "$vendorarch" in
6856 '') dflt=`echo $vendorlib | $sed 's,/share$,,'`
6857 dflt="$dflt/$archname"
6859 *) dflt="$vendorarch" ;;
6862 rp='Pathname for vendor-supplied architecture-dependent files?'
6865 vendorarchexp="$ansexp"
6868 prefixvar=vendorarch
6871 : Final catch-all directories to search
6874 Lastly, you can have perl look in other directories for extensions and
6875 modules in addition to those already specified.
6876 These directories will be searched after
6880 test X"$vendorlib" != "X" && echo ' ' $vendorlib
6881 test X"$vendorarch" != "X" && echo ' ' $vendorarch
6883 case "$otherlibdirs" in
6884 ''|' ') dflt='none' ;;
6885 *) dflt="$otherlibdirs" ;;
6888 Enter a colon-separated set of extra paths to include in perl's @INC
6889 search path, or enter 'none' for no extra paths.
6893 rp='Colon-separated list of additional directories for perl to search?'
6896 ' '|''|none) otherlibdirs=' ' ;;
6897 *) otherlibdirs="$ans" ;;
6899 case "$otherlibdirs" in
6903 set d_perl_otherlibdirs
6906 : Cruising for prototypes
6908 echo "Checking out function prototypes..." >&4
6909 $cat >prototype.c <<EOCP
6914 int main(int argc, char *argv[]) {
6917 if $cc $ccflags -c prototype.c >prototype.out 2>&1 ; then
6918 echo "Your C compiler appears to support function prototypes."
6921 echo "Your C compiler doesn't seem to understand function prototypes."
6928 case "$prototype" in
6930 *) ansi2knr='ansi2knr'
6935 This version of $package can only be compiled by a compiler that
6936 understands function prototypes. Unfortunately, your C compiler
6938 doesn't seem to understand them. Sorry about that.
6940 If GNU cc is available for your system, perhaps you could try that instead.
6942 Eventually, we hope to support building Perl with pre-ANSI compilers.
6943 If you would like to help in that effort, please contact <perlbug@perl.org>.
6945 Aborting Configure now.
6957 Perl can be built with extra modules or bundles of modules which
6958 will be fetched from the CPAN and installed alongside Perl.
6960 Notice that you will need access to the CPAN; either via the Internet,
6961 or a local copy, for example a CD-ROM or a local CPAN mirror. (You will
6962 be asked later to configure the CPAN.pm module which will in turn do
6963 the installation of the rest of the extra modules or bundles.)
6965 Notice also that if the modules require any external software such as
6966 libraries and headers (the libz library and the zlib.h header for the
6967 Compress::Zlib module, for example) you MUST have any such software
6968 already installed, this configuration process will NOT install such
6971 If this doesn't make any sense to you, just accept the default '$dflt'.
6973 rp='Install any extra modules (y or n)?'
6979 Please list any extra modules or bundles to be installed from CPAN,
6980 with spaces between the names. The names can be in any format the
6981 'install' command of CPAN.pm will understand. (Answer 'none',
6982 without the quotes, to install no extra modules or bundles.)
6992 $rm -f ../extras.lst
6994 *) echo "(Saving the list of extras for later...)"
6995 echo "$extras" > ../extras.lst
7003 : determine where html pages for programs go
7004 set html1dir html1dir none
7008 If you wish to install html files for programs in $spackage, indicate
7009 the appropriate directory here. To skip installing html files,
7013 ''|none|$undef|' ') dflt=none ;;
7014 *) dflt=$html1dir ;;
7017 rp="Directory for the main $spackage html pages?"
7021 : Use ' ' for none so value is preserved next time through Configure
7022 $test X"$html1dir" = "X" && html1dir=' '
7024 : determine where html pages for libraries and modules go
7025 set html3dir html3dir none
7029 If you wish to install html files for modules associated with $spackage,
7030 indicate the appropriate directory here. To skip installing html files,
7033 : There is no obvious default. If they have specified html1dir, then
7034 : try to key off that, possibly changing .../html1 into .../html3.
7036 '') html3dir=`echo "$html1dir" | $sed 's/1$/3$/'` ;;
7037 *) dflt=$html3dir ;;
7040 rp="Directory for the $spackage module html pages?"
7044 : Use ' ' for none so value is preserved next time through Configure
7045 $test X"$html3dir" = "X" && html3dir=' '
7047 : determine whether to install perl also as /usr/bin/perl
7050 if $test -d /usr/bin -a "X$installbin" != X/usr/bin; then
7052 Many scripts expect perl to be installed as /usr/bin/perl.
7054 If you want to, I can install the perl you are about to compile
7055 as /usr/bin/perl (in addition to $bin/perl).
7057 if test -f /usr/bin/perl; then
7060 However, please note that because you already have a /usr/bin/perl,
7061 overwriting that with a new Perl would very probably cause problems.
7062 Therefore I'm assuming you don't want to do that (unless you insist).
7065 case "$installusrbinperl" in
7066 "$define"|[yY]*) dflt='y';;
7072 Since you don't have a /usr/bin/perl I'm assuming creating one is okay.
7075 case "$installusrbinperl" in
7076 "$undef"|[nN]*) dflt='n';;
7080 rp="Do you want to install perl as /usr/bin/perl?"
7083 [yY]*) val="$define";;
7089 set installusrbinperl
7093 echo "Checking for GNU C Library..." >&4
7095 /* Find out version of GNU C library. __GLIBC__ and __GLIBC_MINOR__
7096 alone are insufficient to distinguish different versions, such as
7097 2.0.6 and 2.0.7. The function gnu_get_libc_version() appeared in
7098 libc version 2.1.0. A. Dougherty, June 3, 2002.
7104 # ifdef __GLIBC_MINOR__
7105 # if __GLIBC__ >= 2 && __GLIBC_MINOR__ >= 1
7106 # include <gnu/libc-version.h>
7107 printf("%s\n", gnu_get_libc_version());
7109 printf("%d.%d\n", __GLIBC__, __GLIBC_MINOR__);
7112 printf("%d\n", __GLIBC__);
7121 if eval $compile_ok && $run ./try > glibc.ver; then
7123 gnulibc_version=`$cat glibc.ver`
7124 echo "You are using the GNU C Library version $gnulibc_version"
7128 echo "You are not using the GNU C Library"
7130 $rm -f try try.* glibc.ver
7134 : see if nm is to be used to determine whether a symbol is defined or not
7138 case "$d_gnulibc" in
7141 echo "nm probably won't work on the GNU C Library." >&4
7147 if $test "$osname" = aix -a "X$PASE" != "Xdefine" -a ! -f /lib/syscalls.exp; then
7149 echo "Whoops! This is an AIX system without /lib/syscalls.exp!" >&4
7150 echo "'nm' won't be sufficient on this sytem." >&4
7156 '') dflt=`$egrep 'inlibc|csym' $rsrc/Configure | wc -l 2>/dev/null`
7157 if $test $dflt -gt 20; then
7167 true|$define) dflt=y;;
7174 I can use $nm to extract the symbols from your C libraries. This
7175 is a time consuming task which may generate huge output on the disk (up
7176 to 3 megabytes) but that should make the symbols extraction faster. The
7177 alternative is to skip the 'nm' extraction part and to compile a small
7178 test program instead to determine whether each symbol is present. If
7179 you have a fast C compiler and/or if your 'nm' output cannot be parsed,
7180 this may be the best solution.
7182 You probably shouldn't let me use 'nm' if you are using the GNU C Library.
7185 rp="Shall I use $nm to extract C symbols from the libraries?"
7188 [Nn]*) usenm=false;;
7197 : nm options which may be necessary
7199 '') if $test -f /mach_boot; then
7201 elif $test -d /usr/ccs/lib; then
7202 nm_opt='-p' # Solaris (and SunOS?)
7203 elif $test -f /dgux; then
7205 elif $test -f /lib64/rld; then
7206 nm_opt='-p' # 64-bit Irix
7212 : nm options which may be necessary for shared libraries but illegal
7213 : for archive libraries. Thank you, Linux.
7214 case "$nm_so_opt" in
7215 '') case "$myuname" in
7217 if $nm --help | $grep 'dynamic' > /dev/null 2>&1; then
7218 nm_so_opt='--dynamic'
7227 : get list of predefined functions in a handy place
7232 *-lc_s*) libc=`./loc libc_s$_a $libc $libpth`
7238 *) for thislib in $libs; do
7241 : Handle C library specially below.
7244 thislib=`echo $thislib | $sed -e 's/^-l//'`
7245 if try=`./loc lib$thislib.$so.'*' X $libpth`; $test -f "$try"; then
7247 elif try=`./loc lib$thislib.$so X $libpth`; $test -f "$try"; then
7249 elif try=`./loc lib$thislib$_a X $libpth`; $test -f "$try"; then
7251 elif try=`./loc $thislib$_a X $libpth`; $test -f "$try"; then
7253 elif try=`./loc lib$thislib X $libpth`; $test -f "$try"; then
7255 elif try=`./loc $thislib X $libpth`; $test -f "$try"; then
7257 elif try=`./loc Slib$thislib$_a X $xlibpth`; $test -f "$try"; then
7262 libnames="$libnames $try"
7264 *) libnames="$libnames $thislib" ;;
7273 for xxx in $libpth; do
7274 $test -r $1 || set $xxx/libc.$so
7275 : The messy sed command sorts on library version numbers.
7277 set `echo blurfl; echo $xxx/libc.$so.[0-9]* | \
7278 tr ' ' $trnl | egrep -v '\.[A-Za-z]*$' | $sed -e '
7280 s/[0-9][0-9]*/0000&/g
7281 s/0*\([0-9][0-9][0-9][0-9][0-9]\)/\1/g
7284 $sort | $sed -e 's/^.* //'`
7287 $test -r $1 || set /usr/ccs/lib/libc.$so
7288 $test -r $1 || set /lib/libsys_s$_a
7294 if $test -r "$1"; then
7295 echo "Your (shared) C library seems to be in $1."
7297 elif $test -r /lib/libc && $test -r /lib/clib; then
7298 echo "Your C library seems to be in both /lib/clib and /lib/libc."
7300 libc='/lib/clib /lib/libc'
7301 if $test -r /lib/syslib; then
7302 echo "(Your math library is in /lib/syslib.)"
7303 libc="$libc /lib/syslib"
7305 elif $test -r "$libc" || (test -h "$libc") >/dev/null 2>&1; then
7306 echo "Your C library seems to be in $libc, as you said before."
7307 elif $test -r $incpath/usr/lib/libc$_a; then
7308 libc=$incpath/usr/lib/libc$_a;
7309 echo "Your C library seems to be in $libc. That's fine."
7310 elif $test -r /lib/libc$_a; then
7312 echo "Your C library seems to be in $libc. You're normal."
7314 if tans=`./loc libc$_a blurfl/dyick $libpth`; $test -r "$tans"; then
7316 elif tans=`./loc libc blurfl/dyick $libpth`; $test -r "$tans"; then
7317 libnames="$libnames "`./loc clib blurfl/dyick $libpth`
7318 elif tans=`./loc clib blurfl/dyick $libpth`; $test -r "$tans"; then
7320 elif tans=`./loc Slibc$_a blurfl/dyick $xlibpth`; $test -r "$tans"; then
7322 elif tans=`./loc Mlibc$_a blurfl/dyick $xlibpth`; $test -r "$tans"; then
7325 tans=`./loc Llibc$_a blurfl/dyick $xlibpth`
7327 if $test -r "$tans"; then
7328 echo "Your C library seems to be in $tans, of all places."
7334 if $test $xxx = apollo -o -r "$libc" || (test -h "$libc") >/dev/null 2>&1; then
7338 If the guess above is wrong (which it might be if you're using a strange
7339 compiler, or your machine supports multiple models), you can override it here.
7344 echo $libpth | $tr ' ' $trnl | $sort | $uniq > libpath
7346 I can't seem to find your C library. I've looked in the following places:
7349 $sed 's/^/ /' libpath
7352 None of these seems to contain your C library. I need to get its name...
7357 rp='Where is your C library?'
7362 echo $libc $libnames | $tr ' ' $trnl | $sort | $uniq > libnames
7363 set X `cat libnames`
7366 case $# in 1) xxx=file; esac
7367 echo "Extracting names from the following $xxx for later perusal:" >&4
7369 $sed 's/^/ /' libnames >&4
7371 $echo $n "This may take a while...$c" >&4
7375 *$so*) $nm $nm_so_opt $nm_opt $file 2>/dev/null;;
7376 *) $nm $nm_opt $file 2>/dev/null;;
7381 $grep fprintf libc.tmp > libc.ptf
7382 xscan='eval "<libc.ptf $com >libc.list"; $echo $n ".$c" >&4'
7383 xrun='eval "<libc.tmp $com >libc.list"; echo "done." >&4'
7385 if com="$sed -n -e 's/__IO//' -e 's/^.* $xxx *//p'";\
7387 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7389 elif com="$sed -n -e 's/^__*//' -e 's/^\([a-zA-Z_0-9$]*\).*xtern.*/\1/p'";\
7391 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7393 elif com="$sed -n -e '/|UNDEF/d' -e '/FUNC..GL/s/^.*|__*//p'";\
7395 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7397 elif com="$sed -n -e 's/^.* D __*//p' -e 's/^.* D //p'";\
7399 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7401 elif com="$sed -n -e 's/^_//' -e 's/^\([a-zA-Z_0-9]*\).*xtern.*text.*/\1/p'";\
7403 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7405 elif com="$sed -n -e 's/^.*|FUNC |GLOB .*|//p'";\
7407 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7409 elif com="$grep '|' | $sed -n -e '/|COMMON/d' -e '/|DATA/d' \
7410 -e '/ file/d' -e 's/^\([^ ]*\).*/\1/p'";\
7412 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7414 elif com="$sed -n -e 's/^.*|FUNC |GLOB .*|//p' -e 's/^.*|FUNC |WEAK .*|//p'";\
7416 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7418 elif com="$sed -n -e 's/^__//' -e '/|Undef/d' -e '/|Proc/s/ .*//p'";\
7420 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7422 elif com="$sed -n -e 's/^.*|Proc .*|Text *| *//p'";\
7424 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7426 elif com="$sed -n -e '/Def. Text/s/.* \([^ ]*\)\$/\1/p'";\
7428 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7430 elif com="$sed -n -e 's/^[-0-9a-f ]*_\(.*\)=.*/\1/p'";\
7432 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7434 elif com="$sed -n -e 's/.*\.text n\ \ \ \.//p'";\
7436 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7438 elif com="sed -n -e 's/^__.*//' -e 's/[ ]*D[ ]*[0-9]*.*//p'";\
7440 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7443 $nm -p $* 2>/dev/null >libc.tmp
7444 $grep fprintf libc.tmp > libc.ptf
7445 if com="$sed -n -e 's/^.* [ADTSIW] *_[_.]*//p' -e 's/^.* [ADTSIW] //p'";\
7446 eval $xscan; $contains '^fprintf$' libc.list >/dev/null 2>&1
7452 echo "$nm didn't seem to work right. Trying $ar instead..." >&4
7454 if $ar t $libc > libc.tmp && $contains '^fprintf$' libc.tmp >/dev/null 2>&1; then
7455 for thisname in $libnames $libc; do
7456 $ar t $thisname >>libc.tmp
7458 $sed -e "s/\\$_o\$//" < libc.tmp > libc.list
7460 elif test "X$osname" = "Xos2" && $ar tv $libc > libc.tmp; then
7461 # Repeat libc to extract forwarders to DLL entries too
7462 for thisname in $libnames $libc; do
7463 $ar tv $thisname >>libc.tmp
7464 # Revision 50 of EMX has bug in $ar.
7465 # it will not extract forwarders to DLL entries
7466 # Use emximp which will extract exactly them.
7467 emximp -o tmp.imp $thisname \
7469 $sed -e 's/^\([_a-zA-Z0-9]*\) .*$/\1/p' \
7470 < tmp.imp >>libc.tmp
7473 $sed -e "s/\\$_o\$//" -e 's/^ \+//' < libc.tmp > libc.list
7476 echo "$ar didn't seem to work right." >&4
7477 echo "Maybe this is a Cray...trying bld instead..." >&4
7478 if bld t $libc | $sed -e 's/.*\///' -e "s/\\$_o:.*\$//" > libc.list
7480 for thisname in $libnames; do
7482 $sed -e 's/.*\///' -e "s/\\$_o:.*\$//" >>libc.list
7483 $ar t $thisname >>libc.tmp
7487 echo "That didn't work either. Giving up." >&4
7497 echo "Since you are compiling for PASE, extracting more symbols from libc.a ...">&4
7498 dump -Tv /lib/libc.a | awk '$7 == "/unix" {print $5 " " $8}' | grep "^SV" | awk '{print $2}' >> libc.list
7500 *) if $test -f /lib/syscalls.exp; then
7502 echo "Also extracting names from /lib/syscalls.exp for good ole AIX..." >&4
7503 $sed -n 's/^\([^ ]*\)[ ]*syscall[0-9]*[ ]*$/\1/p' /lib/syscalls.exp >>libc.list
7509 $rm -f libnames libpath
7511 : see if dld is available
7515 : is a C symbol defined?
7518 -v) tf=libc.tmp; tdc="";;
7519 -a) tf=libc.tmp; tdc="[]";;
7520 *) tlook="^$1\$"; tf=libc.list; tdc="()";;
7523 case "$reuseval-$4" in
7525 true-*) tx=no; eval "tval=\$$4"; case "$tval" in "") tx=yes;; esac;;
7530 if $test "$runnm" = true; then
7531 if $contains $tlook $tf >/dev/null 2>&1; then
7533 elif $test "$mistrustnm" = compile -o "$mistrustnm" = run; then
7534 echo "void *(*(p()))$tdc { extern void *$1$tdc; return &$1; } int main() { if(p()) return(0); else return(1); }"> try.c;
7535 $cc -o try $optimize $ccflags $ldflags try.c >/dev/null 2>&1 $libs && tval=true;
7536 $test "$mistrustnm" = run -a -x try && { $run ./try$_exe >/dev/null 2>&1 || tval=false; };
7537 $rm -f try$_exe try.c core core.* try.core;
7540 echo "void *(*(p()))$tdc { extern void *$1$tdc; return &$1; } int main() { if(p()) return(0); else return(1); }"> try.c;
7541 $cc -o try $optimize $ccflags $ldflags try.c $libs >/dev/null 2>&1 && tval=true;
7542 $rm -f try$_exe try.c;
7547 $define) tval=true;;
7554 : define an is-in-libc? function
7555 inlibc='echo " "; td=$define; tu=$undef;
7556 sym=$1; var=$2; eval "was=\$$2";
7558 case "$reuseval$was" in
7568 echo "$sym() found." >&4;
7569 case "$was" in $undef) . ./whoa; esac; eval "$var=\$td";;
7571 echo "$sym() NOT found." >&4;
7572 case "$was" in $define) . ./whoa; esac; eval "$var=\$tu";;
7576 $define) echo "$sym() found." >&4;;
7577 *) echo "$sym() NOT found." >&4;;
7581 : see if dlopen exists
7588 : determine which dynamic loading, if any, to compile in
7590 dldir="ext/DynaLoader"
7603 $define) dflt='y' ;;
7606 $define) dflt='y' ;;
7608 : Does a dl_xxx.xs file exist for this operating system
7609 $test -f $rsrc/$dldir/dl_${osname}.xs && dflt='y'
7612 rp="Do you wish to use dynamic loading?"
7619 if $test -f $rsrc/$dldir/dl_${osname}.xs ; then
7620 dflt="$dldir/dl_${osname}.xs"
7621 elif $test "$d_dlopen" = "$define" ; then
7622 dflt="$dldir/dl_dlopen.xs"
7623 elif $test "$i_dld" = "$define" ; then
7624 dflt="$dldir/dl_dld.xs"
7629 *) dflt="$dldir/$dlsrc"
7632 echo "The following dynamic loading files are available:"
7633 : Can not go over to $dldir because getfile has path hard-coded in.
7634 tdir=`pwd`; cd "$rsrc"; $ls -C $dldir/dl*.xs; cd "$tdir"
7635 rp="Source file to use for dynamic loading"
7641 dlsrc=`echo $ans | $sed -e 's%.*/\([^/]*\)$%\1%'`
7645 Some systems may require passing special flags to $cc -c to
7646 compile modules that will be used to create a shared library.
7647 To use no flags, say "none".
7650 case "$cccdlflags" in
7651 '') case "$gccversion" in
7652 '') case "$osname" in
7654 next) dflt='none' ;;
7655 irix*) dflt='-KPIC' ;;
7656 svr4*|esix*|solaris|nonstopux) dflt='-KPIC' ;;
7657 sunos) dflt='-pic' ;;
7661 *) case "$osname" in
7662 darwin) dflt='none' ;;
7663 svr4*|esix*|solaris|nonstopux) dflt='-fPIC' ;;
7668 *) dflt="$cccdlflags" ;;
7670 rp="Any special flags to pass to $cc -c to compile shared library modules?"
7673 none) cccdlflags=' ' ;;
7674 *) cccdlflags="$ans" ;;
7679 Some systems use ld to create libraries that can be dynamically loaded,
7680 while other systems (such as those using ELF) use $cc.
7684 '') $cat >try.c <<EOM
7685 /* Test for whether ELF binaries are produced */
7693 int i = open("a.out",O_RDONLY);
7696 if(read(i,b,4)==4 && b[0]==127 && b[1]=='E' && b[2]=='L' && b[3]=='F')
7697 exit(0); /* succeed (yes, it's ELF) */
7702 if $cc $ccflags $ldflags try.c >/dev/null 2>&1 && $run ./a.out; then
7704 You appear to have ELF support. I'll use $cc to build dynamic libraries.
7708 echo "I'll use ld to build dynamic libraries."
7717 rp="What command should be used to create dynamic libraries?"
7723 Some systems may require passing special flags to $ld to create a
7724 library that can be dynamically loaded. If your ld flags include
7725 -L/other/path options to locate libraries outside your loader's normal
7726 search path, you may need to specify those -L options here as well. To
7727 use no flags, say "none".
7730 case "$lddlflags" in
7731 '') case "$osname" in
7732 beos) dflt='-nostart' ;;
7734 case "$gccversion" in
7735 '') dflt="$dflt +vnocompatwarnings" ;;
7738 linux|irix*|gnu*) dflt='-shared' ;;
7739 next) dflt='none' ;;
7740 solaris) dflt='-G' ;;
7741 sunos) dflt='-assert nodefinitions' ;;
7742 svr4*|esix*|nonstopux) dflt="-G $ldflags" ;;
7746 *) dflt="$lddlflags" ;;
7749 : Try to guess additional flags to pick up local libraries.
7750 : Be careful not to append to a plain 'none'
7754 for thisflag in $ldflags; do
7759 *) dflt="$dflt $thisflag" ;;
7766 ''|' ') dflt='none' ;;
7769 rp="Any special flags to pass to $ld to create a dynamically loaded library?"
7772 none) lddlflags=' ' ;;
7773 *) lddlflags="$ans" ;;
7778 Some systems may require passing special flags to $cc to indicate that
7779 the resulting executable will use dynamic linking. To use no flags,
7783 case "$ccdlflags" in
7784 '') case "$osname" in
7785 linux|hpux|gnu*) dflt='-Wl,-E' ;;
7786 next|sunos) dflt='none' ;;
7790 *) dflt="$ccdlflags" ;;
7792 rp="Any special flags to pass to $cc to use dynamic linking?"
7795 none) ccdlflags=' ' ;;
7796 *) ccdlflags="$ans" ;;
7810 # No dynamic loading being used, so don't bother even to prompt.
7813 *) case "$useshrplib" in
7814 '') case "$osname" in
7815 svr4*|nonstopux|dgux|dynixptx|esix|powerux|beos|cygwin*)
7817 also='Building a shared libperl is required for dynamic loading to work on your system.'
7822 also='Building a shared libperl is needed for MAB support.'
7840 The perl executable is normally obtained by linking perlmain.c with
7841 libperl${_a}, any static extensions (usually just DynaLoader), and
7842 any other libraries needed on this system (such as -lm, etc.). Since
7843 your system supports dynamic loading, it is probably possible to build
7844 a shared libperl.$so. If you will have more than one executable linked
7845 to libperl.$so, this will significantly reduce the size of each
7846 executable, but it may have a noticeable effect on performance. The
7847 default is probably sensible for your system.
7851 rp="Build a shared libperl.$so (y/n)"
7855 useshrplib='true' ;;
7856 *) useshrplib='false' ;;
7861 case "$useshrplib" in
7865 # Figure out a good name for libperl.so. Since it gets stored in
7866 # a version-specific architecture-dependent library, the version
7867 # number isn't really that important, except for making cc/ld happy.
7869 # A name such as libperl.so.3.1
7870 majmin="libperl.$so.$patchlevel.$subversion"
7871 # A name such as libperl.so.301
7872 majonly=`echo $patchlevel $subversion |
7873 $awk '{printf "%d%02d", $1, $2}'`
7874 majonly=libperl.$so.$majonly
7875 # I'd prefer to keep the os-specific stuff here to a minimum, and
7876 # rely on figuring it out from the naming of libc.
7877 case "${osname}${osvers}" in
7880 # XXX How handle the --version stuff for MAB?
7882 linux*|gnu*) # ld won't link with a bare -lperl otherwise.
7885 cygwin*) # ld links against an importlib
7886 dflt=libperl$lib_ext
7888 *) # Try to guess based on whether libc has major.minor.
7890 *libc.$so.[0-9]*.[0-9]*) dflt=$majmin ;;
7891 *libc.$so.[0-9]*) dflt=$majonly ;;
7892 *) dflt=libperl.$so ;;
7902 I need to select a good name for the shared libperl. If your system uses
7903 library names with major and minor numbers, then you might want something
7904 like $majmin. Alternatively, if your system uses a single version
7905 number for shared libraries, then you might want to use $majonly.
7906 Or, your system might be quite happy with a simple libperl.$so.
7908 Since the shared libperl will get installed into a version-specific
7909 architecture-dependent directory, the version number of the shared perl
7910 library probably isn't important, so the default should be o.k.
7913 rp='What name do you want to give to the shared libperl?'
7916 echo "Ok, I'll use $libperl"
7919 libperl="libperl${_a}"
7923 # Detect old use of shrpdir via undocumented Configure -Dshrpdir
7927 WARNING: Use of the shrpdir variable for the installation location of
7928 the shared $libperl is not supported. It was never documented and
7929 will not work in this version. Let me (perlbug@perl.org)
7930 know of any problems this may cause.
7936 But your current setting of $shrpdir is
7937 the default anyway, so it's harmless.
7942 Further, your current attempted setting of $shrpdir
7943 conflicts with the value of $archlibexp/CORE
7944 that installperl will use.
7951 # How will the perl executable find the installed shared $libperl?
7952 # Add $xxx to ccdlflags.
7953 # If we can't figure out a command-line option, use $shrpenv to
7954 # set env LD_RUN_PATH. The main perl makefile uses this.
7955 shrpdir=$archlibexp/CORE
7958 if "$useshrplib"; then
7961 # We'll set it in Makefile.SH...
7966 freebsd|netbsd|openbsd|interix|dragonfly)
7967 xxx="-Wl,-R$shrpdir"
7969 bsdos|linux|irix*|dec_osf|gnu*)
7970 xxx="-Wl,-rpath,$shrpdir"
7973 # next doesn't like the default...
7976 # beos doesn't like the default, either.
7979 # hpux doesn't like the default, either.
7980 tmp_shrpenv="env LDOPTS=\"+s +b${shrpdir}\""
7983 tmp_shrpenv="env LD_RUN_PATH=$shrpdir"
7989 # Only add $xxx if it isn't already in ccdlflags.
7990 case " $ccdlflags " in
7992 *) ccdlflags="$ccdlflags $xxx"
7995 Adding $xxx to the flags
7996 passed to $ld so that the perl executable will find the
7997 installed shared $libperl.
8005 # Fix ccdlflags in AIX for building external extensions.
8006 # (For building Perl itself bare -bE:perl.exp is needed,
8007 # Makefile.SH takes care of this.)
8009 aix) ccdlflags="$ccdlflags -bE:$installarchlib/CORE/perl.exp" ;;
8011 # Respect a hint or command-line value.
8013 '') shrpenv="$tmp_shrpenv" ;;
8015 case "$ldlibpthname" in
8016 '') ldlibpthname=LD_LIBRARY_PATH ;;
8017 none) ldlibpthname='' ;;
8020 : determine where manual pages are on this system
8024 syspath='/usr/share/man/man1 /usr/man/man1'
8025 syspath="$syspath /usr/man/mann /usr/man/manl /usr/man/local/man1"
8026 syspath="$syspath /usr/man/u_man/man1"
8027 syspath="$syspath /usr/catman/u_man/man1 /usr/man/l_man/man1"
8028 syspath="$syspath /usr/local/man/u_man/man1 /usr/local/man/l_man/man1"
8029 syspath="$syspath /usr/man/man.L /local/man/man1 /usr/local/man/man1"
8030 sysman=`./loc . /usr/man/man1 $syspath`
8033 if $test -d "$sysman"; then
8034 echo "System manual is in $sysman." >&4
8036 echo "Could not find manual pages in source form." >&4
8039 : determine where manual pages go
8040 set man1dir man1dir none
8044 $spackage has manual pages available in source form.
8048 echo "However, you don't have nroff, so they're probably useless to you."
8050 '') man1dir="none";;
8053 echo "If you don't want the manual sources installed, answer 'none'."
8058 lookpath="$prefixexp/share/man/man1"
8059 lookpath="$lookpath $prefixexp/man/man1 $prefixexp/man/l_man/man1"
8060 lookpath="$lookpath $prefixexp/man/p_man/man1"
8061 lookpath="$lookpath $prefixexp/man/u_man/man1"
8062 lookpath="$lookpath $prefixexp/man/man.1"
8064 */?_man*) dflt=`./loc . $prefixexp/l_man/man1 $lookpath` ;;
8065 *) dflt=`./loc . $prefixexp/man/man1 $lookpath` ;;
8075 rp="Where do the main $spackage manual pages (source) go?"
8077 if $test "X$man1direxp" != "X$ansexp"; then
8088 : What suffix to use on installed man pages
8095 rp="What suffix should be used for the main $spackage man pages?"
8097 '') case "$man1dir" in
8111 *) dflt="$man1ext";;
8118 : see if we can have long filenames
8120 first=123456789abcdef
8122 if (echo hi >$first) 2>/dev/null; then
8123 if $test -f 123456789abcde; then
8124 echo 'You cannot have filenames longer than 14 characters. Sigh.' >&4
8127 echo 'You can have filenames longer than 14 characters.'>&4
8132 You can't have filenames longer than 14 chars.
8133 You can't even think about them!
8139 $rm -rf 123456789abcde*
8141 : determine where library module manual pages go
8142 set man3dir man3dir none
8146 $spackage has manual pages for many of the library modules.
8152 However, you don't have nroff, so they're probably useless to you.
8155 '') man3dir="none";;
8159 case "$d_flexfnam" in
8162 However, your system can't handle the long file names like File::Basename.3.
8165 '') man3dir="none";;
8169 echo "If you don't want the manual sources installed, answer 'none'."
8170 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
8172 '') dflt=`echo "$man1dir" | $sed -e 's/man1/man3/g' -e 's/man\.1/man\.3/g'`
8173 if $test -d "$privlib/man/man3"; then
8176 WARNING: Previous versions of perl installed man3 pages into
8177 $privlib/man/man3. This version will suggest a
8178 new default of $dflt.
8182 rp='Do you wish to preserve the old behavior?(y/n)'
8185 y*) dflt="$privlib/man/man3" ;;
8190 *) dflt="$man3dir" ;;
8197 rp="Where do the $package library man pages (source) go?"
8207 : What suffix to use on installed man pages
8213 rp="What suffix should be used for the $package library man pages?"
8215 '') case "$man3dir" in
8229 *) dflt="$man3ext";;
8236 : see if we have to deal with yellow pages, now NIS.
8237 if $test -d /usr/etc/yp || $test -d /etc/yp || $test -d /usr/lib/yp; then
8238 if $test -f /usr/etc/nibindd; then
8240 echo "I'm fairly confident you're on a NeXT."
8242 rp='Do you get the hosts file via NetInfo?'
8251 y*) hostcat='nidump hosts .';;
8252 *) case "$hostcat" in
8253 nidump*) hostcat='';;
8263 '') if $contains '^\+' /etc/passwd >/dev/null 2>&1; then
8271 rp='Are you getting the hosts file via yellow pages?'
8274 y*) hostcat='ypcat hosts';;
8275 *) hostcat='cat /etc/hosts';;
8281 '') test -f /etc/hosts && hostcat='cat /etc/hosts';;
8284 '') test -f /etc/group && groupcat='cat /etc/group';;
8287 '') test -f /etc/passwd && passcat='cat /etc/passwd';;
8290 : now get the host name
8292 echo "Figuring out host name..." >&4
8293 case "$myhostname" in
8295 echo 'Maybe "hostname" will work...'
8296 if tans=`sh -c hostname 2>&1` ; then
8304 if $test "$cont"; then
8306 echo 'Oh, dear. Maybe "/etc/systemid" is the key...'
8307 if tans=`cat /etc/systemid 2>&1` ; then
8309 phostname='cat /etc/systemid'
8310 echo "Whadyaknow. Xenix always was a bit strange..."
8313 elif $test -r /etc/systemid; then
8314 echo "(What is a non-Xenix system doing with /etc/systemid?)"
8317 if $test "$cont"; then
8318 echo 'No, maybe "uuname -l" will work...'
8319 if tans=`sh -c 'uuname -l' 2>&1` ; then
8321 phostname='uuname -l'
8323 echo 'Strange. Maybe "uname -n" will work...'
8324 if tans=`sh -c 'uname -n' 2>&1` ; then
8326 phostname='uname -n'
8328 echo 'Oh well, maybe I can mine it out of whoami.h...'
8329 if tans=`sh -c $contains' sysname $usrinc/whoami.h' 2>&1` ; then
8330 myhostname=`echo "$tans" | $sed 's/^.*"\(.*\)"/\1/'`
8331 phostname="sed -n -e '"'/sysname/s/^.*\"\\(.*\\)\"/\1/{'"' -e p -e q -e '}' <$usrinc/whoami.h"
8333 case "$myhostname" in
8334 '') echo "Does this machine have an identity crisis or something?"
8337 echo "Well, you said $myhostname before..."
8338 phostname='echo $myhostname';;
8344 case "$myhostname" in
8345 '') myhostname=noname ;;
8347 : you do not want to know about this
8352 if $test "$myhostname" ; then
8354 rp='Your host name appears to be "'$myhostname'".'" Right?"
8362 : bad guess or no guess
8363 while $test "X$myhostname" = X ; do
8365 rp="Please type the (one word) name of your host:"
8370 : translate upper to lower if necessary
8371 case "$myhostname" in
8373 echo "(Normalizing case in your host name)"
8374 myhostname=`echo $myhostname | ./tr '[A-Z]' '[a-z]'`
8378 case "$myhostname" in
8380 dflt=`expr "X$myhostname" : "X[^.]*\(\..*\)"`
8381 myhostname=`expr "X$myhostname" : "X\([^.]*\)\."`
8382 echo "(Trimming domain name from host name--host name is now $myhostname)"
8384 *) case "$mydomain" in
8387 test "X$hostcat" = "Xypcat hosts" &&
8388 ypmatch "$myhostname" hosts 2>/dev/null |\
8389 $sed -e 's/[ ]*#.*//; s/$/ /' > hosts && \
8392 test "X$hostcat" != "X" &&
8393 $hostcat | $sed -n -e "s/[ ]*#.*//; s/\$/ /
8394 /[ ]$myhostname[ . ]/p" > hosts
8397 if $test -f hosts; then
8398 $test x`$awk "/[0-9].*[ ]$myhostname$tmp_re/ { sum++ }
8399 END { print sum }" hosts` = x1 || tmp_re="[ ]"
8400 dflt=.`$awk "/[0-9].*[ ]$myhostname$tmp_re/ {for(i=2; i<=NF;i++) print \\\$i}" \
8401 hosts | $sort | $uniq | \
8402 $sed -n -e "s/$myhostname\.\([-a-zA-Z0-9_.]\)/\1/p"`
8403 case `$echo X$dflt` in
8404 X*\ *) echo "(Several hosts in the database matched hostname)"
8407 X.) echo "(You do not have fully-qualified names in the hosts database)"
8411 echo "(I cannot locate a hosts database anywhere)"
8416 tans=`./loc resolv.conf X /etc /usr/etc`
8417 if $test -f "$tans"; then
8418 echo "(Attempting domain name extraction from $tans)"
8419 dflt=.`$sed -n -e 's/ / /g' \
8420 -e 's/^search *\([^ ]*\).*/\1/p' $tans \
8421 | ./tr '[A-Z]' '[a-z]' 2>/dev/null`
8423 .) dflt=.`$sed -n -e 's/ / /g' \
8424 -e 's/^domain *\([^ ]*\).*/\1/p' $tans \
8425 | ./tr '[A-Z]' '[a-z]' 2>/dev/null`
8432 .) echo "(No help from resolv.conf either -- attempting clever guess)"
8433 dflt=.`sh -c domainname 2>/dev/null`
8436 .nis.*|.yp.*|.main.*) dflt=`echo $dflt | $sed -e 's/^\.[^.]*//'`;;
8440 case "$dflt$osname" in
8441 .os390) echo "(Attempting domain name extraction from //'SYS1.TCPPARMS(TCPDATA)')"
8442 dflt=.`awk '/^DOMAINORIGIN/ {print $2}' "//'SYS1.TCPPARMS(TCPDATA)'" 2>/dev/null`
8446 .) echo "(Lost all hope -- silly guess then)"
8452 *) dflt="$mydomain";;
8456 rp="What is your domain name?"
8466 : translate upper to lower if necessary
8469 echo "(Normalizing case in your domain name)"
8470 mydomain=`echo $mydomain | ./tr '[A-Z]' '[a-z]'`
8474 : a little sanity check here
8475 case "$phostname" in
8478 case `$phostname | ./tr '[A-Z]' '[a-z]'` in
8479 $myhostname$mydomain|$myhostname) ;;
8481 case "$phostname" in
8483 echo "(That doesn't agree with your whoami.h file, by the way.)"
8486 echo "(That doesn't agree with your $phostname command, by the way.)"
8496 I need to get your e-mail address in Internet format if possible, i.e.
8497 something like user@host.domain. Please answer accurately since I have
8498 no easy means to double check it. The default value provided below
8499 is most probably close to reality but may not be valid from outside
8500 your organization...
8504 while test "$cont"; do
8506 '') dflt="$cf_by@$myhostname$mydomain";;
8507 *) dflt="$cf_email";;
8509 rp='What is your e-mail address?'
8515 rp='Address does not look like an Internet one. Use it anyway?'
8531 If you or somebody else will be maintaining perl at your site, please
8532 fill in the correct e-mail address here so that they may be contacted
8533 if necessary. Currently, the "perlbug" program included with perl
8534 will send mail to this address in addition to perlbug@perl.org. You may
8535 enter "none" for no administrator.
8538 case "$perladmin" in
8539 '') dflt="$cf_email";;
8540 *) dflt="$perladmin";;
8542 rp='Perl administrator e-mail address'
8546 : determine whether to only install version-specific parts.
8549 Do you want to install only the version-specific parts of the perl
8550 distribution? Usually you do *not* want to do this.
8552 case "$versiononly" in
8553 "$define"|[Yy]*|true) dflt='y' ;;
8556 rp="Do you want to install only the version-specific parts of perl?"
8559 [yY]*) val="$define";;
8565 case "$versiononly" in
8566 "$define") inc_version_list=''
8567 inc_version_list_init=0
8571 : figure out how to guarantee perl startup
8572 : XXX Note that this currently takes advantage of the bug that binexp ignores
8573 : the Configure -Dinstallprefix setting, which in turn means that under
8574 : relocatable @INC, initialinstalllocation is what binexp started as.
8575 case "$startperl" in
8577 case "$sharpbang" in
8581 I can use the #! construct to start perl on your system. This will
8582 make startup of perl scripts faster, but may cause problems if you
8583 want to share those scripts and perl is not in a standard place
8584 ($initialinstalllocation/perl) on all your platforms. The alternative is to force
8585 a shell by starting the script with a single ':' character.
8588 case "$versiononly" in
8589 "$define") dflt="$initialinstalllocation/perl$version";;
8590 *) dflt="$initialinstalllocation/perl";;
8592 rp='What shall I put after the #! to start up perl ("none" to not use #!)?'
8595 none) startperl=": # use perl";;
8596 *) startperl="#!$ans"
8597 if $test 30 -lt `echo "$ans" | wc -c`; then
8600 WARNING: Some systems limit the #! command to 32 characters.
8601 If you experience difficulty running Perl scripts with #!, try
8602 installing Perl in a directory with a shorter pathname.
8608 *) startperl=": # use perl"
8613 echo "I'll use $startperl to start perl scripts."
8615 : figure best path for perl in scripts
8618 case "$versiononly" in
8619 "$define") perlpath="$initialinstalllocation/perl$version";;
8620 *) perlpath="$initialinstalllocation/perl";;
8622 case "$startperl" in
8627 I will use the "eval 'exec'" idiom to start Perl on your system.
8628 I can use the full path of your Perl binary for this purpose, but
8629 doing so may cause problems if you want to share those scripts and
8630 Perl is not always in a standard place ($initialinstalllocation/perl).
8633 dflt="$initialinstalllocation/perl"
8634 rp="What path shall I use in \"eval 'exec'\"?"
8641 case "$startperl" in
8643 *) echo "I'll use $perlpath in \"eval 'exec'\"" ;;
8646 : determine where public executable scripts go
8647 set scriptdir scriptdir
8649 case "$scriptdir" in
8652 : guess some guesses
8653 $test -d /usr/share/scripts && dflt=/usr/share/scripts
8654 $test -d /usr/share/bin && dflt=/usr/share/bin
8655 $test -d /usr/local/script && dflt=/usr/local/script
8656 $test -d /usr/local/scripts && dflt=/usr/local/scripts
8657 $test -d $prefixexp/script && dflt=$prefixexp/script
8661 *) dflt="$scriptdir"
8666 Some installations have a separate directory just for executable scripts so
8667 that they can mount it across multiple architectures but keep the scripts in
8668 one spot. You might, for example, have a subdirectory of /usr/share for this.
8669 Or you might just lump your scripts in with all your other executables.
8673 rp='Where do you keep publicly executable scripts?'
8675 if $test "X$ansexp" != "X$scriptdirexp"; then
8681 : A little fix up for an irregularly named variable.
8682 installscript="$installscriptdir"
8684 : determine where add-on public executables go
8686 '') dflt=$siteprefix/bin ;;
8690 rp='Pathname where the add-on public executables should be installed?'
8695 : determine where add-on html pages go
8696 : There is no standard location, so try to copy the previously-selected
8697 : directory structure for the core html pages.
8698 case "$sitehtml1dir" in
8699 '') dflt=`echo "$html1dir" | $sed "s#^$prefix#$siteprefix#"` ;;
8700 *) dflt=$sitehtml1dir ;;
8703 ''|' ') dflt=none ;;
8706 rp='Pathname where the site-specific html pages should be installed?'
8708 prefixvar=sitehtml1dir
8711 : determine where add-on library html pages go
8712 : There is no standard location, so try to copy the previously-selected
8713 : directory structure for the core html pages.
8714 case "$sitehtml3dir" in
8715 '') dflt=`echo "$html3dir" | $sed "s#^$prefix#$siteprefix#"` ;;
8716 *) dflt=$sitehtml3dir ;;
8719 ''|' ') dflt=none ;;
8722 rp='Pathname where the site-specific library html pages should be installed?'
8724 prefixvar=sitehtml3dir
8727 : determine where add-on manual pages go
8728 case "$siteman1dir" in
8729 '') dflt=`echo $man1dir | $sed "s#^$prefix#$siteprefix#"` ;;
8730 *) dflt=$siteman1dir ;;
8733 ''|' ') dflt=none ;;
8736 rp='Pathname where the site-specific manual pages should be installed?'
8738 prefixvar=siteman1dir
8741 : determine where add-on library man pages go
8742 case "$siteman3dir" in
8743 '') dflt=`echo $man3dir | $sed "s#^$prefix#$siteprefix#"` ;;
8744 *) dflt=$siteman3dir ;;
8747 ''|' ') dflt=none ;;
8750 rp='Pathname where the site-specific library manual pages should be installed?'
8752 prefixvar=siteman3dir
8755 : determine where add-on public executable scripts go
8756 case "$sitescript" in
8757 '') dflt=$siteprefix/script
8758 $test -d $dflt || dflt=$sitebin ;;
8759 *) dflt="$sitescript" ;;
8762 rp='Pathname where add-on public executable scripts should be installed?'
8764 prefixvar=sitescript
8767 case "$usefaststdio" in
8768 $define|true|[yY]*|'')
8769 xversion=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
8779 Perl can be built to use 'fast stdio', which means using the stdio
8780 library but also directly manipulating the stdio buffers to enable
8781 faster I/O. Using stdio is better for backward compatibility (especially
8782 for Perl extensions), but on the other hand since Perl 5.8 the 'perlio'
8783 interface has been preferred instead of stdio.
8785 If this doesn't make any sense to you, just accept the default '$dflt'.
8787 rp='Use the "fast stdio" if available?'
8790 y|Y) val="$define" ;;
8797 : define an is-a-typedef? function
8798 typedef='type=$1; var=$2; def=$3; shift; shift; shift; inclist=$@;
8800 "") inclist="sys/types.h";;
8802 eval "varval=\$$var";
8806 for inc in $inclist; do
8807 echo "#include <$inc>" >>temp.c;
8809 echo "#ifdef $type" >> temp.c;
8810 echo "printf(\"We have $type\");" >> temp.c;
8811 echo "#endif" >> temp.c;
8812 $cppstdin $cppflags $cppminus < temp.c >temp.E 2>/dev/null;
8813 if $contains $type temp.E >/dev/null 2>&1; then
8819 *) eval "$var=\$varval";;
8822 : define an is-a-typedef? function that prompts if the type is not available.
8823 typedef_ask='type=$1; var=$2; def=$3; shift; shift; shift; inclist=$@;
8825 "") inclist="sys/types.h";;
8827 eval "varval=\$$var";
8831 for inc in $inclist; do
8832 echo "#include <$inc>" >>temp.c;
8834 echo "#ifdef $type" >> temp.c;
8835 echo "printf(\"We have $type\");" >> temp.c;
8836 echo "#endif" >> temp.c;
8837 $cppstdin $cppflags $cppminus < temp.c >temp.E 2>/dev/null;
8839 echo "$rp" | $sed -e "s/What is/Looking for/" -e "s/?/./";
8840 if $contains $type temp.E >/dev/null 2>&1; then
8841 echo "$type found." >&4;
8844 echo "$type NOT found." >&4;
8850 *) eval "$var=\$varval";;
8853 : see what type lseek is declared as in the kernel
8854 rp="What is the type used for lseek's offset on this system?"
8855 set off_t lseektype long stdio.h sys/types.h
8859 echo "Checking to see how big your file offsets are..." >&4
8861 #include <sys/types.h>
8865 printf("%d\n", (int)sizeof($lseektype));
8870 if eval $compile_ok; then
8871 lseeksize=`$run ./try`
8872 echo "Your file offsets are $lseeksize bytes long."
8876 echo "(I can't seem to compile the test program. Guessing...)"
8877 rp="What is the size of your file offsets (in bytes)?"
8883 : see what type file positions are declared as in the library
8884 rp="What is the type for file position used by fsetpos()?"
8885 set fpos_t fpostype long stdio.h sys/types.h
8890 *_t) zzz="$fpostype" ;;
8893 echo "Checking the size of $zzz..." >&4
8895 #include <sys/types.h>
8902 printf("%d\n", (int)sizeof($fpostype));
8907 if eval $compile_ok; then
8911 echo "(I can't execute the test program--guessing $fpossize.)" >&4
8914 echo "Your $zzz is $fpossize bytes long."
8920 echo "(I can't compile the test program. Guessing...)" >&4
8921 rp="What is the size of your file positions (in bytes)?"
8926 # Backward compatibility (uselfs is deprecated).
8928 "$define"|true|[yY]*)
8931 *** Configure -Duselfs is deprecated, using -Duselargefiles instead.
8933 uselargefiles="$define"
8937 case "$lseeksize:$fpossize" in
8940 You can have files larger than 2 gigabytes.
8943 *) case "$uselargefiles" in
8944 "$undef"|false|[nN]*) dflt='n' ;;
8949 Perl can be built to understand large files (files larger than 2 gigabytes)
8950 on some systems. To do so, Configure can be run with -Duselargefiles.
8952 If this doesn't make any sense to you, just accept the default '$dflt'.
8954 rp='Try to understand large files, if available?'
8957 y|Y) val="$define" ;;
8964 : Look for a hint-file generated 'call-back-unit'. If the
8965 : user has specified that a large files perl is to be built,
8966 : we may need to set or change some other defaults.
8967 if $test -f uselargefiles.cbu; then
8968 echo "Your platform has some specific hints regarding large file builds, using them..."
8969 . ./uselargefiles.cbu
8971 case "$uselargefiles" in
8973 if $test -f uselargefiles.cbu; then
8975 echo "Rechecking to see how big your file offsets are..." >&4
8977 #include <sys/types.h>
8981 printf("%d\n", (int)sizeof($lseektype));
8986 if eval $compile_ok; then
8987 lseeksize=`$run ./try`
8988 $echo "Your file offsets are now $lseeksize bytes long."
8992 echo "(I can't seem to compile the test program. Guessing...)"
8993 rp="What is the size of your file offsets (in bytes)?"
8998 *_t) zzz="$fpostype" ;;
9001 $echo $n "Rechecking the size of $zzz...$c" >&4
9003 #include <sys/types.h>
9010 printf("%d\n", (int)sizeof($fpostype));
9015 if eval $compile_ok; then
9020 echo "(I can't execute the test program--guessing $fpossize.)" >&4
9023 echo " $fpossize bytes." >&4
9029 echo "(I can't compile the test program. Guessing...)" >&4
9030 rp="What is the size of your file positions (in bytes)?"
9039 case "$vendorprefix" in
9040 '') d_vendorbin="$undef"
9044 *) d_vendorbin="$define"
9045 : determine where vendor-supplied executables go.
9046 case "$vendorbin" in
9047 '') dflt=$vendorprefix/bin ;;
9048 *) dflt="$vendorbin" ;;
9051 rp='Pathname for the vendor-supplied executables directory?'
9054 vendorbinexp="$ansexp"
9060 case "$vendorprefix" in
9061 '') vendorhtml1dir=''
9062 vendorhtml1direxp=''
9064 *) : determine where vendor-supplied html pages go.
9065 : There is no standard location, so try to copy the previously-selected
9066 : directory structure for the core html pages.
9067 : XXX Better default suggestions would be welcome.
9068 case "$vendorhtml1dir" in
9069 '') dflt=`echo "$html1dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
9070 *) dflt=$vendorhtml1dir ;;
9073 ''|' ') dflt=none ;;
9076 rp='Pathname for the vendor-supplied html pages?'
9078 vendorhtml1dir="$ans"
9079 vendorhtml1direxp="$ansexp"
9082 : Use ' ' for none so value is preserved next time through Configure
9083 $test X"$vendorhtml1dir" = "X" && vendorhtml1dir=' '
9084 prefixvar=vendorhtml1dir
9087 case "$vendorprefix" in
9088 '') vendorhtml3dir=''
9089 vendorhtml3direxp=''
9091 *) : determine where vendor-supplied module html pages go.
9092 : There is no standard location, so try to copy the previously-selected
9093 : directory structure for the core html pages.
9094 : XXX Better default suggestions would be welcome.
9095 case "$vendorhtml3dir" in
9096 '') dflt=`echo "$html3dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
9097 *) dflt=$vendorhtml3dir ;;
9100 ''|' ') dflt=none ;;
9103 rp='Pathname for the vendor-supplied html pages?'
9105 vendorhtml3dir="$ans"
9106 vendorhtml3direxp="$ansexp"
9109 : Use ' ' for none so value is preserved next time through Configure
9110 $test X"$vendorhtml3dir" = "X" && vendorhtml3dir=' '
9111 prefixvar=vendorhtml3dir
9114 case "$vendorprefix" in
9115 '') vendorman1dir=''
9118 *) : determine where vendor-supplied manual pages go.
9119 case "$vendorman1dir" in
9120 '') dflt=`echo "$man1dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
9121 *) dflt=$vendorman1dir ;;
9124 ''|' ') dflt=none ;;
9127 rp='Pathname for the vendor-supplied manual section 1 pages?'
9129 vendorman1dir="$ans"
9130 vendorman1direxp="$ansexp"
9133 : Use ' ' for none so value is preserved next time through Configure
9134 $test X"$vendorman1dir" = "X" && vendorman1dir=' '
9135 prefixvar=vendorman1dir
9138 case "$vendorprefix" in
9139 '') vendorman3dir=''
9142 *) : determine where vendor-supplied module manual pages go.
9143 case "$vendorman3dir" in
9144 '') dflt=`echo "$man3dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
9145 *) dflt=$vendorman3dir ;;
9148 ''|' ') dflt=none ;;
9151 rp='Pathname for the vendor-supplied manual section 3 pages?'
9153 vendorman3dir="$ans"
9154 vendorman3direxp="$ansexp"
9157 : Use ' ' for none so value is preserved next time through Configure
9158 $test X"$vendorman3dir" = "X" && vendorman3dir=' '
9159 prefixvar=vendorman3dir
9162 case "$vendorprefix" in
9163 '') d_vendorscript="$undef"
9167 *) d_vendorscript="$define"
9168 : determine where vendor-supplied scripts go.
9169 case "$vendorscript" in
9170 '') dflt=$vendorprefix/script
9171 $test -d $dflt || dflt=$vendorbin ;;
9172 *) dflt="$vendorscript" ;;
9176 The installation process will create a directory for
9177 vendor-supplied scripts.
9181 rp='Pathname for the vendor-supplied scripts directory?'
9184 vendorscriptexp="$ansexp"
9187 prefixvar=vendorscript
9190 : see if qgcvt exists
9196 if $test X"$d_longdbl" = X"$define"; then
9198 echo "Checking how to print long doubles..." >&4
9200 if $test X"$sPRIfldbl" = X -a X"$doublesize" = X"$longdblsize"; then
9201 $cat >try.c <<'EOCP'
9202 #include <sys/types.h>
9206 printf("%.3f\n", d);
9210 if eval $compile; then
9214 sPRIfldbl='"f"'; sPRIgldbl='"g"'; sPRIeldbl='"e"';
9215 sPRIFUldbl='"F"'; sPRIGUldbl='"G"'; sPRIEUldbl='"E"';
9216 echo "We will use %f."
9222 if $test X"$sPRIfldbl" = X; then
9223 $cat >try.c <<'EOCP'
9224 #include <sys/types.h>
9227 long double d = 123.456;
9228 printf("%.3Lf\n", d);
9232 if eval $compile; then
9236 sPRIfldbl='"Lf"'; sPRIgldbl='"Lg"'; sPRIeldbl='"Le"';
9237 sPRIFUldbl='"LF"'; sPRIGUldbl='"LG"'; sPRIEUldbl='"LE"';
9238 echo "We will use %Lf."
9244 if $test X"$sPRIfldbl" = X; then
9245 $cat >try.c <<'EOCP'
9246 #include <sys/types.h>
9249 long double d = 123.456;
9250 printf("%.3llf\n", d);
9254 if eval $compile; then
9258 sPRIfldbl='"llf"'; sPRIgldbl='"llg"'; sPRIeldbl='"lle"';
9259 sPRIFUldbl='"llF"'; sPRIGUldbl='"llG"'; sPRIEUldbl='"llE"';
9260 echo "We will use %llf."
9266 if $test X"$sPRIfldbl" = X; then
9267 $cat >try.c <<'EOCP'
9268 #include <sys/types.h>
9271 long double d = 123.456;
9272 printf("%.3lf\n", d);
9276 if eval $compile; then
9280 sPRIfldbl='"lf"'; sPRIgldbl='"lg"'; sPRIeldbl='"le"';
9281 sPRIFUldbl='"lF"'; sPRIGUldbl='"lG"'; sPRIEUldbl='"lE"';
9282 echo "We will use %lf."
9288 if $test X"$sPRIfldbl" = X; then
9289 echo "Cannot figure out how to print long doubles." >&4
9291 sSCNfldbl=$sPRIfldbl # expect consistency
9298 case "$sPRIfldbl" in
9299 '') d_PRIfldbl="$undef"; d_PRIgldbl="$undef"; d_PRIeldbl="$undef";
9300 d_PRIFUldbl="$undef"; d_PRIGUldbl="$undef"; d_PRIEUldbl="$undef";
9301 d_SCNfldbl="$undef";
9303 *) d_PRIfldbl="$define"; d_PRIgldbl="$define"; d_PRIeldbl="$define";
9304 d_PRIFUldbl="$define"; d_PRIGUldbl="$define"; d_PRIEUldbl="$define";
9305 d_SCNfldbl="$define";
9309 : Check how to convert floats to strings.
9311 if test "X$d_Gconvert" = X; then
9314 echo "Checking for an efficient way to convert floats to strings."
9316 case "$uselongdouble" in
9317 "$define") echo "#define USE_LONG_DOUBLE" >>try.c ;;
9319 case "$d_longdbl" in
9320 "$define") echo "#define HAS_LONG_DOUBLE" >>try.c ;;
9322 case "$d_PRIgldbl" in
9323 "$define") echo "#define HAS_PRIgldbl" >>try.c ;;
9327 #define Gconvert(x,n,t,b) gconvert((x),(n),(t),(b))
9328 char *myname = "gconvert";
9331 #define Gconvert(x,n,t,b) gcvt((x),(n),(b))
9332 char *myname = "gcvt";
9335 #define Gconvert(x,n,t,b) qgcvt((x),(n),(b))
9336 char *myname = "qgcvt";
9337 #define DOUBLETYPE long double
9340 #if defined(USE_LONG_DOUBLE) && defined(HAS_LONG_DOUBLE)
9342 #define Gconvert(x,n,t,b) sprintf((b),"%.*"$sPRIgldbl,(n),(x))
9344 #define Gconvert(x,n,t,b) sprintf((b),"%.*g",(n),(double)(x))
9347 #define Gconvert(x,n,t,b) sprintf((b),"%.*g",(n),(x))
9349 char *myname = "sprintf";
9353 #if defined(USE_LONG_DOUBLE) && defined(HAS_LONG_DOUBLE)
9354 #define DOUBLETYPE long double
9356 #define DOUBLETYPE double
9362 #define I_STDLIB $i_stdlib
9368 checkit(expect, got)
9372 if (strcmp(expect, got)) {
9373 printf("%s oddity: Expected %s, got %s\n",
9374 myname, expect, got);
9384 /* This must be 1st test on (which?) platform */
9385 /* Alan Burlison <AlanBurlsin@unn.unisys.com> */
9386 Gconvert((DOUBLETYPE)0.1, 8, 0, buf);
9387 checkit("0.1", buf);
9389 Gconvert((DOUBLETYPE)0.01, 8, 0, buf);
9390 checkit("0.01", buf);
9392 Gconvert((DOUBLETYPE)0.001, 8, 0, buf);
9393 checkit("0.001", buf);
9395 Gconvert((DOUBLETYPE)0.0001, 8, 0, buf);
9396 checkit("0.0001", buf);
9398 Gconvert((DOUBLETYPE)0.00009, 8, 0, buf);
9399 if (strlen(buf) > 5)
9400 checkit("9e-005", buf); /* for Microsoft ?? */
9402 checkit("9e-05", buf);
9404 Gconvert((DOUBLETYPE)1.0, 8, 0, buf);
9407 Gconvert((DOUBLETYPE)1.1, 8, 0, buf);
9408 checkit("1.1", buf);
9410 Gconvert((DOUBLETYPE)1.01, 8, 0, buf);
9411 checkit("1.01", buf);
9413 Gconvert((DOUBLETYPE)1.001, 8, 0, buf);
9414 checkit("1.001", buf);
9416 Gconvert((DOUBLETYPE)1.0001, 8, 0, buf);
9417 checkit("1.0001", buf);
9419 Gconvert((DOUBLETYPE)1.00001, 8, 0, buf);
9420 checkit("1.00001", buf);
9422 Gconvert((DOUBLETYPE)1.000001, 8, 0, buf);
9423 checkit("1.000001", buf);
9425 Gconvert((DOUBLETYPE)0.0, 8, 0, buf);
9428 Gconvert((DOUBLETYPE)-1.0, 8, 0, buf);
9431 /* Some Linux gcvt's give 1.e+5 here. */
9432 Gconvert((DOUBLETYPE)100000.0, 8, 0, buf);
9433 checkit("100000", buf);
9435 /* Some Linux gcvt's give -1.e+5 here. */
9436 Gconvert((DOUBLETYPE)-100000.0, 8, 0, buf);
9437 checkit("-100000", buf);
9439 Gconvert((DOUBLETYPE)123.456, 8, 0, buf);
9440 checkit("123.456", buf);
9442 /* Testing of 1e+129 in bigintpm.t must not get extra '.' here. */
9443 Gconvert((DOUBLETYPE)1e34, 8, 0, buf);
9444 /* 34 should be enough to scare even long double
9445 * places into using the e notation. */
9446 if (strlen(buf) > 5)
9447 checkit("1e+034", buf); /* for Microsoft */
9449 checkit("1e+34", buf);
9451 /* For Perl, if you add additional tests here, also add them to
9452 * t/base/num.t for benefit of platforms not using Configure or
9453 * overriding d_Gconvert */
9458 : first add preferred functions to our list
9460 for xxx_convert in $gconvert_preference; do
9461 case $xxx_convert in
9462 gcvt|gconvert|sprintf) xxx_list="$xxx_list $xxx_convert" ;;
9463 *) echo "Discarding unrecognized gconvert_preference $xxx_convert" >&4 ;;
9466 : then add any others
9467 for xxx_convert in gconvert gcvt sprintf; do
9470 *) xxx_list="$xxx_list $xxx_convert" ;;
9474 case "$d_longdbl$uselongdouble" in
9476 : again, add prefered functions to our list first
9478 for xxx_convert in $gconvert_ld_preference; do
9479 case $xxx_convert in
9480 qgcvt|gcvt|gconvert|sprintf) xxx_ld_list="$xxx_ld_list $xxx_convert" ;;
9481 *) echo "Discarding unrecognized gconvert_ld_preference $xxx_convert" ;;
9484 : then add qgcvt, sprintf--then, in xxx_list order, gconvert and gcvt
9485 for xxx_convert in qgcvt sprintf $xxx_list; do
9486 case "$xxx_ld_list" in
9487 $xxx_convert*|*" $xxx_convert"*) ;;
9488 *) xxx_ld_list="$xxx_ld_list $xxx_convert" ;;
9491 : if sprintf cannot do long doubles, move it to the end
9492 if test "$d_PRIgldbl" != "$define"; then
9493 xxx_ld_list="`echo $xxx_ld_list|sed s/sprintf//` sprintf"
9495 : if no qgcvt, remove it
9496 if test "$d_qgcvt" != "$define"; then
9497 xxx_ld_list="`echo $xxx_ld_list|sed s/qgcvt//`"
9500 xxx_list="$xxx_ld_list"
9504 for xxx_convert in $xxx_list; do
9505 echo "Trying $xxx_convert..."
9507 set try -DTRY_$xxx_convert
9508 if eval $compile; then
9509 echo "$xxx_convert() found." >&4
9511 echo "I'll use $xxx_convert to convert floats into a string." >&4
9514 echo "...But $xxx_convert didn't work as I expected."
9518 echo "$xxx_convert NOT found." >&4
9522 if test X$xxx_convert = X; then
9523 echo "*** WHOA THERE!!! ***" >&4
9524 echo "None of ($xxx_list) seemed to work properly. I'll use sprintf." >&4
9528 case "$xxx_convert" in
9529 gconvert) d_Gconvert='gconvert((x),(n),(t),(b))' ;;
9530 gcvt) d_Gconvert='gcvt((x),(n),(b))' ;;
9531 qgcvt) d_Gconvert='qgcvt((x),(n),(b))' ;;
9532 *) case "$uselongdouble$d_longdbl$d_PRIgldbl" in
9533 "$define$define$define")
9534 d_Gconvert="sprintf((b),\"%.*\"$sPRIgldbl,(n),(x))" ;;
9535 "$define$define$undef")
9536 d_Gconvert='sprintf((b),"%.*g",(n),(double)(x))' ;;
9537 *) d_Gconvert='sprintf((b),"%.*g",(n),(x))' ;;
9544 : see if _fwalk exists
9548 : Initialize h_fcntl
9551 : Initialize h_sysfile
9554 : access call always available on UNIX
9558 : locate the flags for 'access()'
9562 $cat >access.c <<EOCP
9563 #include <sys/types.h>
9568 #include <sys/file.h>
9581 : check sys/file.h first, no particular reason here
9582 if $test `./findhdr sys/file.h` && \
9583 $cc -o access $cppflags -DI_SYS_FILE access.c >/dev/null 2>&1 ; then
9585 echo "<sys/file.h> defines the *_OK access constants." >&4
9586 elif $test `./findhdr fcntl.h` && \
9587 $cc -o access $cppflags -DI_FCNTL access.c >/dev/null 2>&1 ; then
9589 echo "<fcntl.h> defines the *_OK access constants." >&4
9590 elif $test `./findhdr unistd.h` && \
9591 $cc -o access $cppflags -DI_UNISTD access.c >/dev/null 2>&1 ; then
9592 echo "<unistd.h> defines the *_OK access constants." >&4
9594 echo "I can't find the four *_OK access constants--I'll use mine." >&4
9600 : see if accessx exists
9601 set accessx d_accessx
9604 : see if aintl exists
9608 : see if alarm exists
9612 : see if POSIX threads are available
9613 set pthread.h i_pthread
9616 : define a fucntion to check prototypes
9617 $cat > protochk <<EOSH
9620 optimize="$optimize"
9622 prototype="$prototype"
9625 usethreads=$usethreads
9626 i_pthread=$i_pthread
9627 pthread_h_first=$pthread_h_first
9630 $cat >> protochk <<'EOSH'
9635 while test $# -ge 2; do
9637 $define) echo "#include <$2>" >> try.c ;;
9638 literal) echo "$2" >> try.c ;;
9640 # Extra magic for the benefit of systems that need pthread.h
9641 # to be included early to correctly detect threadsafe functions.
9642 # Such functions must guarantee themselves, though, that the usethreads
9643 # and i_pthread have been defined, before calling protochk.
9644 if test "$usethreads" = "$define" -a "$i_pthread" = "$define" -a "$pthread_h_first" = "$define" -a "$pthread_h_done" = ""; then
9645 echo "#include <pthread.h>" >> try.c
9650 test "$prototype" = "$define" && echo '#define CAN_PROTOTYPE' >> try.c
9651 cat >> try.c <<'EOCP'
9652 #ifdef CAN_PROTOTYPE
9653 #define _(args) args
9658 echo "$foo" >> try.c
9659 echo 'int no_real_function_has_this_name _((void)) { return 0; }' >> try.c
9660 $cc $optimize $ccflags -c try.c > /dev/null 2>&1
9668 hasproto='varname=$1; func=$2; shift; shift;
9669 while $test $# -ge 2; do
9671 $define) echo "#include <$2>";;
9675 $cppstdin $cppflags $cppminus < try.c > tryout.c 2>/dev/null;
9676 if $contains "$func.*(" tryout.c >/dev/null 2>&1; then
9677 echo "$func() prototype found.";
9680 echo "$func() prototype NOT found.";
9685 $rm -f try.c tryout.c'
9687 : see if sys/types.h has to be included
9688 set sys/types.h i_systypes
9691 : see if sys/select.h has to be included
9692 set sys/select.h i_sysselct
9695 hasfield='varname=$1; struct=$2; field=$3; shift; shift; shift;
9696 while $test $# -ge 2; do
9698 $define) echo "#include <$2>";;
9702 echo "int main () { struct $struct foo; char* bar; bar = (char*)foo.$field; }" >> try.c;
9704 if eval $compile; then
9713 : see if we should include time.h, sys/time.h, or both
9715 if test "X$timeincl" = X; then
9716 echo "Testing to see if we should include <time.h>, <sys/time.h> or both." >&4
9717 $echo $n "I'm now running the test program...$c"
9719 #include <sys/types.h>
9724 #ifdef SYSTIMEKERNEL
9727 #include <sys/time.h>
9730 #include <sys/select.h>
9743 struct timezone tzp;
9745 if (foo.tm_sec == foo.tm_sec)
9748 if (bar.tv_sec == bar.tv_sec)
9755 for s_timezone in '-DS_TIMEZONE' ''; do
9757 for s_timeval in '-DS_TIMEVAL' ''; do
9758 for i_systimek in '' '-DSYSTIMEKERNEL'; do
9759 for i_time in '' '-DI_TIME'; do
9760 for i_systime in '-DI_SYSTIME' ''; do
9763 set try $i_time $i_systime $i_systimek $sysselect $s_timeval $s_timezone
9764 if eval $compile; then
9765 set X $i_time $i_systime $i_systimek $sysselect $s_timeval
9769 $echo $n "Succeeded with $flags$c"
9781 *SYSTIMEKERNEL*) i_systimek="$define"
9782 timeincl=`./findhdr sys/time.h`
9783 echo "We'll include <sys/time.h> with KERNEL defined." >&4;;
9784 *) i_systimek="$undef";;
9787 *I_TIME*) i_time="$define"
9788 timeincl=`./findhdr time.h`" $timeincl"
9789 echo "We'll include <time.h>." >&4;;
9790 *) i_time="$undef";;
9793 *I_SYSTIME*) i_systime="$define"
9794 timeincl=`./findhdr sys/time.h`" $timeincl"
9795 echo "We'll include <sys/time.h>." >&4;;
9796 *) i_systime="$undef";;
9800 : see if struct tm knows about tm_zone
9801 case "$i_systime$i_time" in
9804 echo "Checking to see if your struct tm has tm_zone field..." >&4
9805 set d_tm_tm_zone tm tm_zone $i_systime sys/time.h $i_time time.h
9813 case "$d_tm_tm_zone" in
9814 "$define") echo "Yes, it does." ;;
9815 *) echo "No, it doesn't." ;;
9817 : see if struct tm knows about tm_gmtoff
9818 case "$i_systime$i_time" in
9821 echo "Checking to see if your struct tm has tm_gmtoff field..." >&4
9822 set d_tm_tm_gmtoff tm tm_gmtoff $i_systime sys/time.h $i_time time.h
9830 case "$d_tm_tm_gmtoff" in
9831 "$define") echo "Yes, it does." ;;
9832 *) echo "No, it doesn't." ;;
9835 : see if asctime_r exists
9836 set asctime_r d_asctime_r
9838 case "$d_asctime_r" in
9840 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
9841 case "$d_asctime_r_proto:$usethreads" in
9842 ":define") d_asctime_r_proto=define
9843 set d_asctime_r_proto asctime_r $hdrs
9847 case "$d_asctime_r_proto" in
9849 case "$asctime_r_proto" in
9850 ''|0) try='char* asctime_r(const struct tm*, char*);'
9851 ./protochk "extern $try" $hdrs && asctime_r_proto=B_SB ;;
9853 case "$asctime_r_proto" in
9854 ''|0) try='char* asctime_r(const struct tm*, char*, int);'
9855 ./protochk "extern $try" $hdrs && asctime_r_proto=B_SBI ;;
9857 case "$asctime_r_proto" in
9858 ''|0) try='int asctime_r(const struct tm*, char*);'
9859 ./protochk "extern $try" $hdrs && asctime_r_proto=I_SB ;;
9861 case "$asctime_r_proto" in
9862 ''|0) try='int asctime_r(const struct tm*, char*, int);'
9863 ./protochk "extern $try" $hdrs && asctime_r_proto=I_SBI ;;
9865 case "$asctime_r_proto" in
9866 ''|0) d_asctime_r=undef
9868 echo "Disabling asctime_r, cannot determine prototype." >&4 ;;
9869 * ) case "$asctime_r_proto" in
9870 REENTRANT_PROTO*) ;;
9871 *) asctime_r_proto="REENTRANT_PROTO_$asctime_r_proto" ;;
9873 echo "Prototype: $try" ;;
9876 *) case "$usethreads" in
9877 define) echo "asctime_r has no prototype, not using it." >&4 ;;
9884 *) asctime_r_proto=0
9888 : see if atolf exists
9892 : see if atoll exists
9896 : Look for GCC-style attribute format
9897 case "$d_attribute_format" in
9900 echo "Checking whether your compiler can handle __attribute__((format)) ..." >&4
9901 $cat >attrib.c <<'EOCP'
9903 void my_special_printf(char* pat,...) __attribute__((__format__(__printf__,1,2)));
9905 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
9906 if $contains 'warning' attrib.out >/dev/null 2>&1; then
9907 echo "Your C compiler doesn't support __attribute__((format))."
9910 echo "Your C compiler supports __attribute__((format))."
9914 echo "Your C compiler doesn't seem to understand __attribute__ at all."
9918 *) val="$d_attribute_format" ;;
9920 set d_attribute_format
9924 : Look for GCC-style attribute malloc
9925 case "$d_attribute_malloc" in
9928 echo "Checking whether your compiler can handle __attribute__((malloc)) ..." >&4
9929 $cat >attrib.c <<'EOCP'
9931 char *go_get_some_memory( int how_many_bytes ) __attribute__((malloc));
9933 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
9934 if $contains 'warning' attrib.out >/dev/null 2>&1; then
9935 echo "Your C compiler doesn't support __attribute__((malloc))."
9938 echo "Your C compiler supports __attribute__((malloc))."
9942 echo "Your C compiler doesn't seem to understand __attribute__ at all."
9946 *) val="$d_attribute_malloc" ;;
9948 set d_attribute_malloc
9952 : Look for GCC-style attribute nonnull
9953 case "$d_attribute_nonnull" in
9956 echo "Checking whether your compiler can handle __attribute__((nonnull(1))) ..." >&4
9957 $cat >attrib.c <<'EOCP'
9959 void do_something (char *some_pointer,...) __attribute__((nonnull(1)));
9961 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
9962 if $contains 'warning' attrib.out >/dev/null 2>&1; then
9963 echo "Your C compiler doesn't support __attribute__((nonnull))."
9966 echo "Your C compiler supports __attribute__((nonnull))."
9970 echo "Your C compiler doesn't seem to understand __attribute__ at all."
9974 *) val="$d_attribute_nonnull" ;;
9976 set d_attribute_nonnull
9980 : Look for GCC-style attribute noreturn
9981 case "$d_attribute_noreturn" in
9984 echo "Checking whether your compiler can handle __attribute__((noreturn)) ..." >&4
9985 $cat >attrib.c <<'EOCP'
9987 void fall_over_dead( void ) __attribute__((noreturn));
9989 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
9990 if $contains 'warning' attrib.out >/dev/null 2>&1; then
9991 echo "Your C compiler doesn't support __attribute__((noreturn))."
9994 echo "Your C compiler supports __attribute__((noreturn))."
9998 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10002 *) val="$d_attribute_noreturn" ;;
10004 set d_attribute_noreturn
10008 : Look for GCC-style attribute pure
10009 case "$d_attribute_pure" in
10012 echo "Checking whether your compiler can handle __attribute__((pure)) ..." >&4
10013 $cat >attrib.c <<'EOCP'
10015 int square( int n ) __attribute__((pure));
10017 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10018 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10019 echo "Your C compiler doesn't support __attribute__((pure))."
10022 echo "Your C compiler supports __attribute__((pure))."
10026 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10030 *) val="$d_attribute_pure" ;;
10032 set d_attribute_pure
10036 : Look for GCC-style attribute unused
10037 case "$d_attribute_unused" in
10040 echo "Checking whether your compiler can handle __attribute__((unused)) ..." >&4
10041 $cat >attrib.c <<'EOCP'
10043 int do_something( int dummy __attribute__((unused)), int n );
10045 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10046 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10047 echo "Your C compiler doesn't support __attribute__((unused))."
10050 echo "Your C compiler supports __attribute__((unused))."
10054 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10058 *) val="$d_attribute_unused" ;;
10060 set d_attribute_unused
10064 : Look for GCC-style attribute warn_unused_result
10065 case "$d_attribute_warn_unused_result" in
10068 echo "Checking whether your compiler can handle __attribute__((warn_unused_result)) ..." >&4
10069 $cat >attrib.c <<'EOCP'
10071 int I_will_not_be_ignored(void) __attribute__((warn_unused_result));
10073 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10074 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10075 echo "Your C compiler doesn't support __attribute__((warn_unused_result))."
10078 echo "Your C compiler supports __attribute__((warn_unused_result))."
10082 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10086 *) val="$d_attribute_warn_unused_result" ;;
10088 set d_attribute_warn_unused_result
10092 : see if bcmp exists
10096 : see if bcopy exists
10100 : see if this is a unistd.h system
10101 set unistd.h i_unistd
10104 : see if getpgrp exists
10105 set getpgrp d_getpgrp
10108 case "$d_getpgrp" in
10111 echo "Checking to see which flavor of getpgrp is in use..."
10113 #$i_unistd I_UNISTD
10114 #include <sys/types.h>
10116 # include <unistd.h>
10118 #$i_stdlib I_STDLIB
10120 #include <stdlib.h>
10124 if (getuid() == 0) {
10125 printf("(I see you are running Configure as super-user...)\n");
10128 #ifdef TRY_BSD_PGRP
10129 if (getpgrp(1) == 0)
10138 if $cc -o try -DTRY_BSD_PGRP $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
10139 echo "You have to use getpgrp(pid) instead of getpgrp()." >&4
10141 elif $cc -o try $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
10142 echo "You have to use getpgrp() instead of getpgrp(pid)." >&4
10145 echo "I can't seem to compile and run the test program."
10147 xxx="a USG one, i.e. you use getpgrp()."
10149 # SVR4 systems can appear rather BSD-ish.
10150 case "$i_unistd" in
10152 xxx="a BSD one, i.e. you use getpgrp(pid)."
10156 xxx="probably a USG one, i.e. you use getpgrp()."
10161 echo "Assuming your getpgrp is $xxx" >&4
10170 : see if setpgrp exists
10171 set setpgrp d_setpgrp
10174 case "$d_setpgrp" in
10177 echo "Checking to see which flavor of setpgrp is in use..."
10179 #$i_unistd I_UNISTD
10180 #include <sys/types.h>
10182 # include <unistd.h>
10184 #$i_stdlib I_STDLIB
10186 #include <stdlib.h>
10190 if (getuid() == 0) {
10191 printf("(I see you are running Configure as super-user...)\n");
10194 #ifdef TRY_BSD_PGRP
10195 if (-1 == setpgrp(1, 1))
10198 if (setpgrp() != -1)
10204 if $cc -o try -DTRY_BSD_PGRP $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
10205 echo 'You have to use setpgrp(pid,pgrp) instead of setpgrp().' >&4
10207 elif $cc -o try $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
10208 echo 'You have to use setpgrp() instead of setpgrp(pid,pgrp).' >&4
10211 echo "(I can't seem to compile and run the test program.)"
10213 xxx="a USG one, i.e. you use setpgrp()."
10215 # SVR4 systems can appear rather BSD-ish.
10216 case "$i_unistd" in
10218 xxx="a BSD one, i.e. you use setpgrp(pid,pgrp)."
10222 xxx="probably a USG one, i.e. you use setpgrp()."
10227 echo "Assuming your setpgrp is $xxx" >&4
10235 : Look for GCC-style __builtin_choose_expr
10236 case "$d_builtin_choose_expr" in
10239 echo "Checking whether your compiler can handle __builtin_choose_expr ..." >&4
10240 $cat >try.c <<'EOCP'
10241 #include <assert.h>
10242 #include <stdlib.h>
10245 #define SYRINX(x) __builtin_choose_expr( x, (1056*2), (103*50) )
10248 assert( SYRINX(1) == 2112 );
10249 assert( SYRINX(1) != 5150 );
10250 assert( SYRINX(0) == 5150 );
10251 assert( SYRINX(0) != 2112 );
10252 puts( "All good!" );
10258 if eval $compile; then
10259 echo "Your C compiler supports __builtin_choose_expr."
10262 echo "Your C compiler doesn't seem to understand __builtin_choose_expr."
10266 *) val="$d_builtin_choose_expr" ;;
10269 set d_builtin_choose_expr
10271 $rm -f try.* try core core.try.*
10273 : Look for GCC-style __builtin_expect
10274 case "$d_builtin_expect" in
10277 echo "Checking whether your compiler can handle __builtin_expect ..." >&4
10278 $cat >builtin.c <<'EOCP'
10281 if ( __builtin_expect(n, 0) ) n = 1;
10285 if eval $compile; then
10286 echo "Your C compiler supports __builtin_choose_expr."
10289 echo "Your C compiler doesn't seem to understand __builtin_choose_expr."
10293 *) val="$d_builtin_expect" ;;
10296 set d_builtin_expect
10298 $rm -f try.* try core core.try.*
10300 : see if bzero exists
10304 : see if signal is declared as pointer to function returning int or void
10306 xxx=`./findhdr signal.h`
10307 $test "$xxx" && $cppstdin $cppminus $cppflags < $xxx >$$.tmp 2>/dev/null
10308 if $contains 'int.*\*[ ]*signal' $$.tmp >/dev/null 2>&1 ; then
10309 echo "You have int (*signal())() instead of void." >&4
10311 elif $contains 'void.*\*[ ]*signal' $$.tmp >/dev/null 2>&1 ; then
10312 echo "You have void (*signal())()." >&4
10314 elif $contains 'extern[ ]*[(\*]*signal' $$.tmp >/dev/null 2>&1 ; then
10315 echo "You have int (*signal())() instead of void." >&4
10317 elif $contains 'void.*\*.*sig' $$.tmp >/dev/null 2>&1 ; then
10318 echo "You have void (*signal())()." >&4
10321 case "$d_voidsig" in
10323 echo "I can't determine whether signal handler returns void or int..." >&4
10325 rp="What type does your signal handler return?"
10328 v*) val="$define";;
10332 echo "As you already told me, signal handler returns void." >&4
10335 *) echo "As you already told me, signal handler returns int." >&4
10342 case "$d_voidsig" in
10343 "$define") signal_t="void";;
10344 *) signal_t="int";;
10348 : check for ability to cast large floats to 32-bit ints.
10350 echo 'Checking whether your C compiler can cast large floats to int32.' >&4
10351 if $test "$intsize" -ge 4; then
10358 #$i_stdlib I_STDLIB
10360 #include <stdlib.h>
10362 #include <sys/types.h>
10363 #include <signal.h>
10364 $signal_t blech(s) int s; { exit(3); }
10371 signal(SIGFPE, blech);
10373 /* Don't let compiler optimize the test away. Store the number
10374 in a writable string for gcc to pass to sscanf under HP/UX.
10376 sprintf(str, "2147483647");
10377 sscanf(str, "%lf", &f); /* f = (double) 0x7fffffff; */
10381 /* x86 processors will probably give 0x8000 0000, which is a
10382 sign change. We don't want that. We want to mimic SPARC
10383 behavior here, which is to preserve the sign and give
10386 if (i32 != ($xxx) f)
10392 if eval $compile_ok; then
10396 echo "(I can't seem to compile the test program--assuming it can't)"
10401 echo "Yup, it can."
10404 echo "Nope, it can't."
10411 : check for ability to cast negative floats to unsigned
10413 echo 'Checking whether your C compiler can cast negative float to unsigned.' >&4
10416 #$i_stdlib I_STDLIB
10418 #include <stdlib.h>
10420 #include <sys/types.h>
10421 #include <signal.h>
10422 $signal_t blech(s) int s; { exit(7); }
10423 $signal_t blech_in_list(s) int s; { exit(4); }
10424 unsigned long dummy_long(p) unsigned long p; { return p; }
10425 unsigned int dummy_int(p) unsigned int p; { return p; }
10426 unsigned short dummy_short(p) unsigned short p; { return p; }
10430 unsigned long along;
10432 unsigned short ashort;
10436 /* Frustrate gcc-2.7.2's optimizer which failed this test with
10437 a direct f = -123. assignment. gcc-2.8.0 reportedly
10438 optimized the whole file away
10440 /* Store the number in a writable string for gcc to pass to
10441 sscanf under HP/UX.
10443 sprintf(str, "-123");
10444 sscanf(str, "%lf", &f); /* f = -123.; */
10446 signal(SIGFPE, blech);
10447 along = (unsigned long)f;
10448 aint = (unsigned int)f;
10449 ashort = (unsigned short)f;
10450 if (along != (unsigned long)-123)
10452 if (aint != (unsigned int)-123)
10454 if (ashort != (unsigned short)-123)
10456 sprintf(str, "1073741824.");
10457 sscanf(str, "%lf", &f); /* f = (double)0x40000000; */
10460 along = (unsigned long)f;
10461 if (along != 0x80000000)
10465 along = (unsigned long)f;
10466 if (along != 0x7fffffff)
10470 along = (unsigned long)f;
10471 if (along != 0x80000001)
10475 signal(SIGFPE, blech_in_list);
10476 sprintf(str, "123.");
10477 sscanf(str, "%lf", &f); /* f = 123.; */
10478 along = dummy_long((unsigned long)f);
10479 aint = dummy_int((unsigned int)f);
10480 ashort = dummy_short((unsigned short)f);
10481 if (along != (unsigned long)123)
10483 if (aint != (unsigned int)123)
10485 if (ashort != (unsigned short)123)
10492 if eval $compile_ok; then
10496 echo "(I can't seem to compile the test program--assuming it can't)"
10499 case "$castflags" in
10501 echo "Yup, it can."
10504 echo "Nope, it can't."
10511 : see if vprintf exists
10513 if set vprintf val -f d_vprintf; eval $csym; $val; then
10514 echo 'vprintf() found.' >&4
10517 #include <varargs.h>
10518 #$i_stdlib I_STDLIB
10520 #include <stdlib.h>
10523 int main() { xxx("foo"); }
10532 exit((unsigned long)vsprintf(buf,"%s",args) > 10L);
10536 if eval $compile && $run ./try; then
10537 echo "Your vsprintf() returns (int)." >&4
10540 echo "Your vsprintf() returns (char*)." >&4
10544 echo 'vprintf() NOT found.' >&4
10555 : see if chown exists
10559 : see if chroot exists
10560 set chroot d_chroot
10563 : see if chsize exists
10564 set chsize d_chsize
10567 : see if class exists
10571 : see if clearenv exists
10572 set clearenv d_clearenv
10575 hasstruct='varname=$1; struct=$2; shift; shift;
10576 while $test $# -ge 2; do
10578 $define) echo "#include <$2>";;
10582 echo "int main () { struct $struct foo; }" >> try.c;
10584 if eval $compile; then
10591 $rm -f try.c try.o'
10595 : see whether socket exists
10597 $echo $n "Hmm... $c" >&4
10598 if set socket val -f d_socket; eval $csym; $val; then
10599 echo "Looks like you have Berkeley networking support." >&4
10601 if set setsockopt val -f; eval $csym; $val; then
10604 echo "...but it uses the old BSD 4.1c interface, rather than 4.2." >&4
10605 d_oldsock="$define"
10608 if $contains socklib libc.list >/dev/null 2>&1; then
10609 echo "Looks like you have Berkeley networking support." >&4
10611 : we will have to assume that it supports the 4.2 BSD interface
10614 echo "You don't have Berkeley networking in libc$_a..." >&4
10615 if test "X$d_socket" = "X$define"; then
10616 echo "...but you seem to believe that you have sockets." >&4
10618 for net in net socket
10620 if test -f /usr/lib/lib$net$_a; then
10621 ( ($nm $nm_opt /usr/lib/lib$net$_a | eval $nm_extract) || \
10622 $ar t /usr/lib/lib$net$_a) 2>/dev/null >> libc.list
10623 if $contains socket libc.list >/dev/null 2>&1; then
10628 echo "...but the Wollongong group seems to have hacked it in." >&4
10629 sockethdr="-I/usr/netinclude"
10632 echo "Found Berkeley sockets interface in lib$net." >&4
10633 if $contains setsockopt libc.list >/dev/null 2>&1; then
10636 echo "...using the old BSD 4.1c interface, rather than 4.2." >&4
10637 d_oldsock="$define"
10643 if test "X$d_socket" != "X$define"; then
10644 echo "or anywhere else I see." >&4
10652 : see if socketpair exists
10653 set socketpair d_sockpair
10658 echo "Checking the availability of certain socket constants..." >&4
10659 for ENUM in MSG_CTRUNC MSG_DONTROUTE MSG_OOB MSG_PEEK MSG_PROXY SCM_RIGHTS; do
10660 enum=`$echo $ENUM|./tr '[A-Z]' '[a-z]'`
10662 #include <sys/types.h>
10663 #include <sys/socket.h>
10669 set try; if eval $compile; then
10672 set d_${enum}; eval $setvar
10676 : see if this is a sys/uio.h system
10677 set sys/uio.h i_sysuio
10682 echo "Checking to see if your system supports struct cmsghdr..." >&4
10683 set d_cmsghdr_s cmsghdr $i_systypes sys/types.h $d_socket sys/socket.h $i_sysuio sys/uio.h
10685 case "$d_cmsghdr_s" in
10686 "$define") echo "Yes, it does." ;;
10687 *) echo "No, it doesn't." ;;
10691 : check for const keyword
10693 echo 'Checking to see if your C compiler knows about "const"...' >&4
10694 $cat >const.c <<'EOCP'
10695 typedef struct spug { int drokk; } spug;
10702 if $cc -c $ccflags const.c >/dev/null 2>&1 ; then
10704 echo "Yup, it does."
10707 echo "Nope, it doesn't."
10712 : see if copysignl exists
10713 set copysignl d_copysignl
10716 : see if crypt exists
10721 $define) cryptlib='' ;;
10722 *) if set crypt val -f d_crypt; eval $csym; $val; then
10723 echo 'crypt() found.' >&4
10727 cryptlib=`./loc Slibcrypt$_a "" $xlibpth`
10728 if $test -z "$cryptlib"; then
10729 cryptlib=`./loc Mlibcrypt$_a "" $xlibpth`
10733 if $test -z "$cryptlib"; then
10734 cryptlib=`./loc Llibcrypt$_a "" $xlibpth`
10738 if $test -z "$cryptlib"; then
10739 cryptlib=`./loc libcrypt$_a "" $libpth`
10743 if $test -z "$cryptlib"; then
10744 echo 'crypt() NOT found.' >&4
10755 : see if this is a crypt.h system
10756 set crypt.h i_crypt
10759 : see if crypt_r exists
10760 set crypt_r d_crypt_r
10762 case "$d_crypt_r" in
10764 hdrs="$i_systypes sys/types.h define stdio.h $i_crypt crypt.h"
10765 case "$d_crypt_r_proto:$usethreads" in
10766 ":define") d_crypt_r_proto=define
10767 set d_crypt_r_proto crypt_r $hdrs
10771 case "$d_crypt_r_proto" in
10773 case "$crypt_r_proto" in
10774 ''|0) try='char* crypt_r(const char*, const char*, struct crypt_data*);'
10775 ./protochk "extern $try" $hdrs && crypt_r_proto=B_CCS ;;
10777 case "$crypt_r_proto" in
10778 ''|0) try='char* crypt_r(const char*, const char*, CRYPTD*);'
10779 ./protochk "extern $try" $hdrs && crypt_r_proto=B_CCD ;;
10781 case "$crypt_r_proto" in
10782 ''|0) d_crypt_r=undef
10784 echo "Disabling crypt_r, cannot determine prototype." >&4 ;;
10785 * ) case "$crypt_r_proto" in
10786 REENTRANT_PROTO*) ;;
10787 *) crypt_r_proto="REENTRANT_PROTO_$crypt_r_proto" ;;
10789 echo "Prototype: $try" ;;
10792 *) case "$usethreads" in
10793 define) echo "crypt_r has no prototype, not using it." >&4 ;;
10804 : get csh whereabouts
10806 'csh') val="$undef" ;;
10807 *) val="$define" ;;
10811 : Respect a hint or command line value for full_csh.
10812 case "$full_csh" in
10813 '') full_csh=$csh ;;
10816 : see if ctermid_r exists
10817 set ctermid_r d_ctermid_r
10819 case "$d_ctermid_r" in
10821 hdrs="$i_systypes sys/types.h define stdio.h "
10822 case "$d_ctermid_r_proto:$usethreads" in
10823 ":define") d_ctermid_r_proto=define
10824 set d_ctermid_r_proto ctermid_r $hdrs
10828 case "$d_ctermid_r_proto" in
10830 case "$ctermid_r_proto" in
10831 ''|0) try='char* ctermid_r(char*);'
10832 ./protochk "extern $try" $hdrs && ctermid_r_proto=B_B ;;
10834 case "$ctermid_r_proto" in
10835 ''|0) d_ctermid_r=undef
10837 echo "Disabling ctermid_r, cannot determine prototype." >&4 ;;
10838 * ) case "$ctermid_r_proto" in
10839 REENTRANT_PROTO*) ;;
10840 *) ctermid_r_proto="REENTRANT_PROTO_$ctermid_r_proto" ;;
10842 echo "Prototype: $try" ;;
10845 *) case "$usethreads" in
10846 define) echo "ctermid_r has no prototype, not using it." >&4 ;;
10853 *) ctermid_r_proto=0
10857 : see if ctime_r exists
10858 set ctime_r d_ctime_r
10860 case "$d_ctime_r" in
10862 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
10863 case "$d_ctime_r_proto:$usethreads" in
10864 ":define") d_ctime_r_proto=define
10865 set d_ctime_r_proto ctime_r $hdrs
10869 case "$d_ctime_r_proto" in
10871 case "$ctime_r_proto" in
10872 ''|0) try='char* ctime_r(const time_t*, char*);'
10873 ./protochk "extern $try" $hdrs && ctime_r_proto=B_SB ;;
10875 case "$ctime_r_proto" in
10876 ''|0) try='char* ctime_r(const time_t*, char*, int);'
10877 ./protochk "extern $try" $hdrs && ctime_r_proto=B_SBI ;;
10879 case "$ctime_r_proto" in
10880 ''|0) try='int ctime_r(const time_t*, char*);'
10881 ./protochk "extern $try" $hdrs && ctime_r_proto=I_SB ;;
10883 case "$ctime_r_proto" in
10884 ''|0) try='int ctime_r(const time_t*, char*, int);'
10885 ./protochk "extern $try" $hdrs && ctime_r_proto=I_SBI ;;
10887 case "$ctime_r_proto" in
10888 ''|0) d_ctime_r=undef
10890 echo "Disabling ctime_r, cannot determine prototype." >&4 ;;
10891 * ) case "$ctime_r_proto" in
10892 REENTRANT_PROTO*) ;;
10893 *) ctime_r_proto="REENTRANT_PROTO_$ctime_r_proto" ;;
10895 echo "Prototype: $try" ;;
10898 *) case "$usethreads" in
10899 define) echo "ctime_r has no prototype, not using it." >&4 ;;
10910 : see if cuserid exists
10911 set cuserid d_cuserid
10914 : see if this is a limits.h system
10915 set limits.h i_limits
10918 : see if this is a float.h system
10919 set float.h i_float
10922 : See if number of significant digits in a double precision number is known
10924 $cat >dbl_dig.c <<EOM
10925 #$i_limits I_LIMITS
10928 #include <limits.h>
10934 printf("Contains DBL_DIG");
10937 $cppstdin $cppflags $cppminus < dbl_dig.c >dbl_dig.E 2>/dev/null
10938 if $contains 'DBL_DIG' dbl_dig.E >/dev/null 2>&1; then
10939 echo "DBL_DIG found." >&4
10942 echo "DBL_DIG NOT found." >&4
10949 : see if dbm.h is available
10950 : see if dbmclose exists
10951 set dbmclose d_dbmclose
10954 case "$d_dbmclose" in
10964 *) set rpcsvc/dbm.h i_rpcsvcdbm
10969 *) echo "We won't be including <dbm.h>"
10979 : see if prototype for dbminit is available
10981 set d_dbminitproto dbminit $i_dbm dbm.h
10984 : see if difftime exists
10985 set difftime d_difftime
10988 : see if this is a dirent system
10990 if xinc=`./findhdr dirent.h`; $test "$xinc"; then
10992 echo "<dirent.h> found." >&4
10995 if xinc=`./findhdr sys/dir.h`; $test "$xinc"; then
10996 echo "<sys/dir.h> found." >&4
10999 xinc=`./findhdr sys/ndir.h`
11001 echo "<dirent.h> NOT found." >&4
11006 : Look for type of directory structure.
11008 $cppstdin $cppflags $cppminus < "$xinc" > try.c
11010 case "$direntrytype" in
11012 case "$i_dirent" in
11013 $define) guess1='struct dirent' ;;
11014 *) guess1='struct direct' ;;
11017 *) guess1="$direntrytype"
11022 'struct dirent') guess2='struct direct' ;;
11023 *) guess2='struct dirent' ;;
11026 if $contains "$guess1" try.c >/dev/null 2>&1; then
11027 direntrytype="$guess1"
11028 echo "Your directory entries are $direntrytype." >&4
11029 elif $contains "$guess2" try.c >/dev/null 2>&1; then
11030 direntrytype="$guess2"
11031 echo "Your directory entries seem to be $direntrytype." >&4
11033 echo "I don't recognize your system's directory entries." >&4
11034 rp="What type is used for directory entries on this system?"
11037 direntrytype="$ans"
11042 : see if the directory entry stores field length
11044 $cppstdin $cppflags $cppminus < "$xinc" > try.c
11045 if $contains 'd_namlen' try.c >/dev/null 2>&1; then
11046 echo "Good, your directory entry keeps length information in d_namlen." >&4
11049 echo "Your directory entry does not know about the d_namlen field." >&4
11056 : see if this is an sysdir system
11057 set sys/dir.h i_sysdir
11060 : see if this is an sysndir system
11061 set sys/ndir.h i_sysndir
11066 $cat >dirfd.c <<EOM
11068 #$i_stdlib I_STDLIB
11070 #include <stdlib.h>
11072 #$i_dirent I_DIRENT /**/
11073 #$i_sysdir I_SYS_DIR /**/
11074 #$i_sysndir I_SYS_NDIR /**/
11075 #$i_systypes I_SYS_TYPES /**/
11076 #if defined(I_SYS_TYPES)
11077 #include <sys/types.h>
11079 #if defined(I_DIRENT)
11080 #include <dirent.h>
11081 #if defined(NeXT) && defined(I_SYS_DIR) /* NeXT needs dirent + sys/dir.h */
11082 #include <sys/dir.h>
11086 #include <sys/ndir.h>
11090 #include <ndir.h> /* may be wrong in the future */
11092 #include <sys/dir.h>
11098 DIR *dirp = opendir(".");
11099 if (dirfd(dirp) >= 0)
11107 if eval $compile; then
11111 $define) echo "dirfd() found." >&4 ;;
11112 *) echo "dirfd() NOT found." >&4 ;;
11118 : see if dlerror exists
11121 set dlerror d_dlerror
11125 : see if dlfcn is available
11126 set dlfcn.h i_dlfcn
11133 On a few systems, the dynamically loaded modules that perl generates and uses
11134 will need a different extension than shared libs. The default will probably
11140 *) dflt="$dlext" ;;
11142 rp='What is the extension of dynamically loaded modules'
11151 : Check if dlsym need a leading underscore
11157 echo "Checking whether your dlsym() needs a leading underscore ..." >&4
11158 $cat >dyna.c <<'EOM'
11165 #$i_stdlib I_STDLIB
11167 #include <stdlib.h>
11171 #include <dlfcn.h> /* the dynamic linker include file for SunOS/Solaris */
11173 #include <sys/types.h>
11178 extern int fred() ;
11187 int mode = RTLD_LAZY ;
11189 handle = dlopen("./dyna.$dlext", mode) ;
11190 if (handle == NULL) {
11195 symbol = dlsym(handle, "fred") ;
11196 if (symbol == NULL) {
11197 /* try putting a leading underscore */
11198 symbol = dlsym(handle, "_fred") ;
11199 if (symbol == NULL) {
11212 : Call the object file tmp-dyna.o in case dlext=o.
11213 if $cc $ccflags $cccdlflags -c dyna.c > /dev/null 2>&1 &&
11214 mv dyna${_o} tmp-dyna${_o} > /dev/null 2>&1 &&
11215 $ld -o dyna.$dlext $ldflags $lddlflags tmp-dyna${_o} > /dev/null 2>&1 &&
11216 $cc -o fred $ccflags $ldflags $cccdlflags $ccdlflags fred.c $libs > /dev/null 2>&1 && $to dyna.$dlext; then
11219 1) echo "Test program failed using dlopen." >&4
11220 echo "Perhaps you should not use dynamic loading." >&4;;
11221 2) echo "Test program failed using dlsym." >&4
11222 echo "Perhaps you should not use dynamic loading." >&4;;
11223 3) echo "dlsym needs a leading underscore" >&4
11225 4) echo "dlsym doesn't need a leading underscore." >&4;;
11228 echo "I can't compile and run the test program." >&4
11229 echo "I'm guessing that dlsym doesn't need a leading underscore." >&4
11234 $rm -f fred fred.* dyna.$dlext dyna.* tmp-dyna.*
11239 : see if drand48_r exists
11240 set drand48_r d_drand48_r
11242 case "$d_drand48_r" in
11244 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
11245 case "$d_drand48_r_proto:$usethreads" in
11246 ":define") d_drand48_r_proto=define
11247 set d_drand48_r_proto drand48_r $hdrs
11251 case "$d_drand48_r_proto" in
11253 case "$drand48_r_proto" in
11254 ''|0) try='int drand48_r(struct drand48_data*, double*);'
11255 ./protochk "extern $try" $hdrs && drand48_r_proto=I_ST ;;
11257 case "$drand48_r_proto" in
11258 ''|0) d_drand48_r=undef
11260 echo "Disabling drand48_r, cannot determine prototype." >&4 ;;
11261 * ) case "$drand48_r_proto" in
11262 REENTRANT_PROTO*) ;;
11263 *) drand48_r_proto="REENTRANT_PROTO_$drand48_r_proto" ;;
11265 echo "Prototype: $try" ;;
11268 *) case "$usethreads" in
11269 define) echo "drand48_r has no prototype, not using it." >&4 ;;
11276 *) drand48_r_proto=0
11280 : see if prototype for drand48 is available
11282 set d_drand48proto drand48 $i_stdlib stdlib.h $i_unistd unistd.h
11285 : see if dup2 exists
11289 : see if eaccess exists
11290 set eaccess d_eaccess
11293 : see if endgrent exists
11294 set endgrent d_endgrent
11297 : see if this is an grp system
11303 xxx=`./findhdr grp.h`
11304 $cppstdin $cppflags $cppminus < $xxx >$$.h
11306 if $contains 'gr_passwd' $$.h >/dev/null 2>&1; then
11318 set d_grpasswd; eval $setvar
11322 : see if endgrent_r exists
11323 set endgrent_r d_endgrent_r
11325 case "$d_endgrent_r" in
11327 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
11328 case "$d_endgrent_r_proto:$usethreads" in
11329 ":define") d_endgrent_r_proto=define
11330 set d_endgrent_r_proto endgrent_r $hdrs
11334 case "$d_endgrent_r_proto" in
11336 case "$endgrent_r_proto" in
11337 ''|0) try='int endgrent_r(FILE**);'
11338 ./protochk "extern $try" $hdrs && endgrent_r_proto=I_H ;;
11340 case "$endgrent_r_proto" in
11341 ''|0) try='void endgrent_r(FILE**);'
11342 ./protochk "extern $try" $hdrs && endgrent_r_proto=V_H ;;
11344 case "$endgrent_r_proto" in
11345 ''|0) d_endgrent_r=undef
11347 echo "Disabling endgrent_r, cannot determine prototype." >&4 ;;
11348 * ) case "$endgrent_r_proto" in
11349 REENTRANT_PROTO*) ;;
11350 *) endgrent_r_proto="REENTRANT_PROTO_$endgrent_r_proto" ;;
11352 echo "Prototype: $try" ;;
11355 *) case "$usethreads" in
11356 define) echo "endgrent_r has no prototype, not using it." >&4 ;;
11363 *) endgrent_r_proto=0
11367 : see if endhostent exists
11368 set endhostent d_endhent
11371 : see if this is a netdb.h system
11372 set netdb.h i_netdb
11375 : see if endhostent_r exists
11376 set endhostent_r d_endhostent_r
11378 case "$d_endhostent_r" in
11380 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
11381 case "$d_endhostent_r_proto:$usethreads" in
11382 ":define") d_endhostent_r_proto=define
11383 set d_endhostent_r_proto endhostent_r $hdrs
11387 case "$d_endhostent_r_proto" in
11389 case "$endhostent_r_proto" in
11390 ''|0) try='int endhostent_r(struct hostent_data*);'
11391 ./protochk "extern $try" $hdrs && endhostent_r_proto=I_D ;;
11393 case "$endhostent_r_proto" in
11394 ''|0) try='void endhostent_r(struct hostent_data*);'
11395 ./protochk "extern $try" $hdrs && endhostent_r_proto=V_D ;;
11397 case "$endhostent_r_proto" in
11398 ''|0) d_endhostent_r=undef
11399 endhostent_r_proto=0
11400 echo "Disabling endhostent_r, cannot determine prototype." >&4 ;;
11401 * ) case "$endhostent_r_proto" in
11402 REENTRANT_PROTO*) ;;
11403 *) endhostent_r_proto="REENTRANT_PROTO_$endhostent_r_proto" ;;
11405 echo "Prototype: $try" ;;
11408 *) case "$usethreads" in
11409 define) echo "endhostent_r has no prototype, not using it." >&4 ;;
11411 d_endhostent_r=undef
11412 endhostent_r_proto=0
11416 *) endhostent_r_proto=0
11420 : see if endnetent exists
11421 set endnetent d_endnent
11424 : see if endnetent_r exists
11425 set endnetent_r d_endnetent_r
11427 case "$d_endnetent_r" in
11429 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
11430 case "$d_endnetent_r_proto:$usethreads" in
11431 ":define") d_endnetent_r_proto=define
11432 set d_endnetent_r_proto endnetent_r $hdrs
11436 case "$d_endnetent_r_proto" in
11438 case "$endnetent_r_proto" in
11439 ''|0) try='int endnetent_r(struct netent_data*);'
11440 ./protochk "extern $try" $hdrs && endnetent_r_proto=I_D ;;
11442 case "$endnetent_r_proto" in
11443 ''|0) try='void endnetent_r(struct netent_data*);'
11444 ./protochk "extern $try" $hdrs && endnetent_r_proto=V_D ;;
11446 case "$endnetent_r_proto" in
11447 ''|0) d_endnetent_r=undef
11448 endnetent_r_proto=0
11449 echo "Disabling endnetent_r, cannot determine prototype." >&4 ;;
11450 * ) case "$endnetent_r_proto" in
11451 REENTRANT_PROTO*) ;;
11452 *) endnetent_r_proto="REENTRANT_PROTO_$endnetent_r_proto" ;;
11454 echo "Prototype: $try" ;;
11457 *) case "$usethreads" in
11458 define) echo "endnetent_r has no prototype, not using it." >&4 ;;
11460 d_endnetent_r=undef
11461 endnetent_r_proto=0
11465 *) endnetent_r_proto=0
11469 : see if endprotoent exists
11470 set endprotoent d_endpent
11473 : see if endprotoent_r exists
11474 set endprotoent_r d_endprotoent_r
11476 case "$d_endprotoent_r" in
11478 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
11479 case "$d_endprotoent_r_proto:$usethreads" in
11480 ":define") d_endprotoent_r_proto=define
11481 set d_endprotoent_r_proto endprotoent_r $hdrs
11485 case "$d_endprotoent_r_proto" in
11487 case "$endprotoent_r_proto" in
11488 ''|0) try='int endprotoent_r(struct protoent_data*);'
11489 ./protochk "extern $try" $hdrs && endprotoent_r_proto=I_D ;;
11491 case "$endprotoent_r_proto" in
11492 ''|0) try='void endprotoent_r(struct protoent_data*);'
11493 ./protochk "extern $try" $hdrs && endprotoent_r_proto=V_D ;;
11495 case "$endprotoent_r_proto" in
11496 ''|0) d_endprotoent_r=undef
11497 endprotoent_r_proto=0
11498 echo "Disabling endprotoent_r, cannot determine prototype." >&4 ;;
11499 * ) case "$endprotoent_r_proto" in
11500 REENTRANT_PROTO*) ;;
11501 *) endprotoent_r_proto="REENTRANT_PROTO_$endprotoent_r_proto" ;;
11503 echo "Prototype: $try" ;;
11506 *) case "$usethreads" in
11507 define) echo "endprotoent_r has no prototype, not using it." >&4 ;;
11509 d_endprotoent_r=undef
11510 endprotoent_r_proto=0
11514 *) endprotoent_r_proto=0
11518 : see if endpwent exists
11519 set endpwent d_endpwent
11522 : see if this is a pwd.h system
11528 xxx=`./findhdr pwd.h`
11529 $cppstdin $cppflags $cppminus < $xxx >$$.h
11531 if $contains 'pw_quota' $$.h >/dev/null 2>&1; then
11539 if $contains 'pw_age' $$.h >/dev/null 2>&1; then
11547 if $contains 'pw_change' $$.h >/dev/null 2>&1; then
11555 if $contains 'pw_class' $$.h >/dev/null 2>&1; then
11563 if $contains 'pw_expire' $$.h >/dev/null 2>&1; then
11571 if $contains 'pw_comment' $$.h >/dev/null 2>&1; then
11579 if $contains 'pw_gecos' $$.h >/dev/null 2>&1; then
11587 if $contains 'pw_passwd' $$.h >/dev/null 2>&1; then
11599 set d_pwquota; eval $setvar
11600 set d_pwage; eval $setvar
11601 set d_pwchange; eval $setvar
11602 set d_pwclass; eval $setvar
11603 set d_pwexpire; eval $setvar
11604 set d_pwcomment; eval $setvar
11605 set d_pwgecos; eval $setvar
11606 set d_pwpasswd; eval $setvar
11610 : see if endpwent_r exists
11611 set endpwent_r d_endpwent_r
11613 case "$d_endpwent_r" in
11615 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
11616 case "$d_endpwent_r_proto:$usethreads" in
11617 ":define") d_endpwent_r_proto=define
11618 set d_endpwent_r_proto endpwent_r $hdrs
11622 case "$d_endpwent_r_proto" in
11624 case "$endpwent_r_proto" in
11625 ''|0) try='int endpwent_r(FILE**);'
11626 ./protochk "extern $try" $hdrs && endpwent_r_proto=I_H ;;
11628 case "$endpwent_r_proto" in
11629 ''|0) try='void endpwent_r(FILE**);'
11630 ./protochk "extern $try" $hdrs && endpwent_r_proto=V_H ;;
11632 case "$endpwent_r_proto" in
11633 ''|0) d_endpwent_r=undef
11635 echo "Disabling endpwent_r, cannot determine prototype." >&4 ;;
11636 * ) case "$endpwent_r_proto" in
11637 REENTRANT_PROTO*) ;;
11638 *) endpwent_r_proto="REENTRANT_PROTO_$endpwent_r_proto" ;;
11640 echo "Prototype: $try" ;;
11643 *) case "$usethreads" in
11644 define) echo "endpwent_r has no prototype, not using it." >&4 ;;
11651 *) endpwent_r_proto=0
11655 : see if endservent exists
11656 set endservent d_endsent
11659 : see if endservent_r exists
11660 set endservent_r d_endservent_r
11662 case "$d_endservent_r" in
11664 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
11665 case "$d_endservent_r_proto:$usethreads" in
11666 ":define") d_endservent_r_proto=define
11667 set d_endservent_r_proto endservent_r $hdrs
11671 case "$d_endservent_r_proto" in
11673 case "$endservent_r_proto" in
11674 ''|0) try='int endservent_r(struct servent_data*);'
11675 ./protochk "extern $try" $hdrs && endservent_r_proto=I_D ;;
11677 case "$endservent_r_proto" in
11678 ''|0) try='void endservent_r(struct servent_data*);'
11679 ./protochk "extern $try" $hdrs && endservent_r_proto=V_D ;;
11681 case "$endservent_r_proto" in
11682 ''|0) d_endservent_r=undef
11683 endservent_r_proto=0
11684 echo "Disabling endservent_r, cannot determine prototype." >&4 ;;
11685 * ) case "$endservent_r_proto" in
11686 REENTRANT_PROTO*) ;;
11687 *) endservent_r_proto="REENTRANT_PROTO_$endservent_r_proto" ;;
11689 echo "Prototype: $try" ;;
11692 *) case "$usethreads" in
11693 define) echo "endservent_r has no prototype, not using it." >&4 ;;
11695 d_endservent_r=undef
11696 endservent_r_proto=0
11700 *) endservent_r_proto=0
11704 : Locate the flags for 'open()'
11707 #include <sys/types.h>
11712 #include <sys/file.h>
11714 #$i_stdlib I_STDLIB
11716 #include <stdlib.h>
11727 : check sys/file.h first to get FREAD on Sun
11728 if $test `./findhdr sys/file.h` && \
11729 set try -DI_SYS_FILE && eval $compile; then
11731 echo "<sys/file.h> defines the O_* constants..." >&4
11732 if $run ./try; then
11733 echo "and you have the 3 argument form of open()." >&4
11736 echo "but not the 3 argument form of open(). Oh, well." >&4
11739 elif $test `./findhdr fcntl.h` && \
11740 set try -DI_FCNTL && eval $compile; then
11742 echo "<fcntl.h> defines the O_* constants..." >&4
11743 if $run ./try; then
11744 echo "and you have the 3 argument form of open()." >&4
11747 echo "but not the 3 argument form of open(). Oh, well." >&4
11752 echo "I can't find the O_* constant definitions! You got problems." >&4
11758 : see which of string.h or strings.h is needed
11760 strings=`./findhdr string.h`
11761 if $test "$strings" && $test -r "$strings"; then
11762 echo "Using <string.h> instead of <strings.h>." >&4
11766 strings=`./findhdr strings.h`
11767 if $test "$strings" && $test -r "$strings"; then
11768 echo "Using <strings.h> instead of <string.h>." >&4
11770 echo "No string header found -- You'll surely have problems." >&4
11775 case "$i_string" in
11776 "$undef") strings=`./findhdr strings.h`;;
11777 *) strings=`./findhdr string.h`;;
11780 : see if this is a sys/file.h system
11785 : do we need to include sys/file.h ?
11789 if $h_sysfile; then
11791 echo "We'll be including <sys/file.h>." >&4
11794 echo "We won't be including <sys/file.h>." >&4
11804 : see if fcntl.h is there
11809 : see if we can include fcntl.h
11815 echo "We'll be including <fcntl.h>." >&4
11818 if $h_sysfile; then
11819 echo "We don't need to include <fcntl.h> if we include <sys/file.h>." >&4
11821 echo "We won't be including <fcntl.h>." >&4
11833 : check for non-blocking I/O stuff
11834 case "$h_sysfile" in
11835 true) echo "#include <sys/file.h>" > head.c;;
11838 true) echo "#include <fcntl.h>" > head.c;;
11839 *) echo "#include <sys/fcntl.h>" > head.c;;
11844 echo "Figuring out the flag used by open() for non-blocking I/O..." >&4
11845 case "$o_nonblock" in
11847 $cat head.c > try.c
11848 $cat >>try.c <<EOCP
11850 #$i_stdlib I_STDLIB
11852 #include <stdlib.h>
11860 printf("O_NONBLOCK\n");
11864 printf("O_NDELAY\n");
11868 printf("FNDELAY\n");
11875 if eval $compile_ok; then
11876 o_nonblock=`$run ./try`
11877 case "$o_nonblock" in
11878 '') echo "I can't figure it out, assuming O_NONBLOCK will do.";;
11879 *) echo "Seems like we can use $o_nonblock.";;
11882 echo "(I can't compile the test program; pray O_NONBLOCK is right!)"
11885 *) echo "Using $hint value $o_nonblock.";;
11887 $rm -f try try.* .out core
11890 echo "Let's see what value errno gets from read() on a $o_nonblock file..." >&4
11893 $cat head.c > try.c
11894 $cat >>try.c <<EOCP
11896 #include <sys/types.h>
11897 #include <signal.h>
11899 #$i_stdlib I_STDLIB
11901 #include <stdlib.h>
11907 #define MY_O_NONBLOCK $o_nonblock
11908 #ifndef errno /* XXX need better Configure test */
11911 #$i_unistd I_UNISTD
11913 #include <unistd.h>
11915 #$i_string I_STRING
11917 #include <string.h>
11919 #include <strings.h>
11921 $signal_t blech(x) int x; { exit(3); }
11923 $cat >> try.c <<'EOCP'
11931 pipe(pd); /* Down: child -> parent */
11932 pipe(pu); /* Up: parent -> child */
11935 close(pd[1]); /* Parent reads from pd[0] */
11936 close(pu[0]); /* Parent writes (blocking) to pu[1] */
11938 if (-1 == fcntl(pd[0], F_SETFL, MY_O_NONBLOCK))
11943 signal(SIGALRM, blech);
11945 if ((ret = read(pd[0], buf, 1)) > 0) /* Nothing to read! */
11947 sprintf(string, "%d\n", ret);
11948 write(2, string, strlen(string));
11951 if (errno == EAGAIN) {
11952 printf("EAGAIN\n");
11957 if (errno == EWOULDBLOCK)
11958 printf("EWOULDBLOCK\n");
11961 write(pu[1], buf, 1); /* Unblocks child, tell it to close our pipe */
11962 sleep(2); /* Give it time to close our pipe */
11964 ret = read(pd[0], buf, 1); /* Should read EOF */
11966 sprintf(string, "%d\n", ret);
11967 write(4, string, strlen(string));
11971 close(pd[0]); /* We write to pd[1] */
11972 close(pu[1]); /* We read from pu[0] */
11973 read(pu[0], buf, 1); /* Wait for parent to signal us we may continue */
11974 close(pd[1]); /* Pipe pd is now fully closed! */
11975 exit(0); /* Bye bye, thank you for playing! */
11979 if eval $compile_ok; then
11980 echo "$startsh" >mtry
11981 echo "$run ./try >try.out 2>try.ret 4>try.err || exit 4" >>mtry
11983 ./mtry >/dev/null 2>&1
11985 0) eagain=`$cat try.out`;;
11986 1) echo "Could not perform non-blocking setting!";;
11987 2) echo "I did a successful read() for something that was not there!";;
11988 3) echo "Hmm... non-blocking I/O does not seem to be working!";;
11989 4) echo "Could not find F_SETFL!";;
11990 *) echo "Something terribly wrong happened during testing.";;
11992 rd_nodata=`$cat try.ret`
11993 echo "A read() system call with no data present returns $rd_nodata."
11994 case "$rd_nodata" in
11997 echo "(That's peculiar, fixing that to be -1.)"
12003 echo "Forcing errno EAGAIN on read() with no data available."
12007 echo "Your read() sets errno to $eagain when no data is available."
12010 status=`$cat try.err`
12012 0) echo "And it correctly returns 0 to signal EOF.";;
12013 -1) echo "But it also returns -1 to signal EOF, so be careful!";;
12014 *) echo "However, your read() returns '$status' on EOF??";;
12017 if test "$status" = "$rd_nodata"; then
12018 echo "WARNING: you can't distinguish between EOF and no data!"
12022 echo "I can't compile the test program--assuming errno EAGAIN will do."
12029 echo "Using $hint value $eagain."
12030 echo "Your read() returns $rd_nodata when no data is present."
12031 case "$d_eofnblk" in
12032 "$define") echo "And you can see EOF because read() returns 0.";;
12033 "$undef") echo "But you can't see EOF status from read() returned value.";;
12035 echo "(Assuming you can't see EOF status from read anyway.)"
12041 $rm -f try try.* .out core head.c mtry
12043 : see if _ptr and _cnt from stdio act std
12046 if $contains '_lbfsize' `./findhdr stdio.h` >/dev/null 2>&1 ; then
12047 echo "(Looks like you have stdio.h from BSD.)"
12048 case "$stdio_ptr" in
12049 '') stdio_ptr='((fp)->_p)'
12052 *) ptr_lval=$d_stdio_ptr_lval;;
12054 case "$stdio_cnt" in
12055 '') stdio_cnt='((fp)->_r)'
12058 *) cnt_lval=$d_stdio_cnt_lval;;
12060 case "$stdio_base" in
12061 '') stdio_base='((fp)->_ub._base ? (fp)->_ub._base : (fp)->_bf._base)';;
12063 case "$stdio_bufsiz" in
12064 '') stdio_bufsiz='((fp)->_ub._base ? (fp)->_ub._size : (fp)->_bf._size)';;
12066 elif $contains '_IO_fpos_t' `./findhdr stdio.h` `./findhdr libio.h` >/dev/null 2>&1 ; then
12067 echo "(Looks like you have stdio.h from Linux.)"
12068 case "$stdio_ptr" in
12069 '') stdio_ptr='((fp)->_IO_read_ptr)'
12072 *) ptr_lval=$d_stdio_ptr_lval;;
12074 case "$stdio_cnt" in
12075 '') stdio_cnt='((fp)->_IO_read_end - (fp)->_IO_read_ptr)'
12078 *) cnt_lval=$d_stdio_cnt_lval;;
12080 case "$stdio_base" in
12081 '') stdio_base='((fp)->_IO_read_base)';;
12083 case "$stdio_bufsiz" in
12084 '') stdio_bufsiz='((fp)->_IO_read_end - (fp)->_IO_read_base)';;
12087 case "$stdio_ptr" in
12088 '') stdio_ptr='((fp)->_ptr)'
12091 *) ptr_lval=$d_stdio_ptr_lval;;
12093 case "$stdio_cnt" in
12094 '') stdio_cnt='((fp)->_cnt)'
12097 *) cnt_lval=$d_stdio_cnt_lval;;
12099 case "$stdio_base" in
12100 '') stdio_base='((fp)->_base)';;
12102 case "$stdio_bufsiz" in
12103 '') stdio_bufsiz='((fp)->_cnt + (fp)->_ptr - (fp)->_base)';;
12107 : test whether _ptr and _cnt really work
12108 echo "Checking how std your stdio is..." >&4
12111 #$i_stdlib I_STDLIB
12113 #include <stdlib.h>
12115 #define FILE_ptr(fp) $stdio_ptr
12116 #define FILE_cnt(fp) $stdio_cnt
12118 FILE *fp = fopen("try.c", "r");
12121 18 <= FILE_cnt(fp) &&
12122 strncmp(FILE_ptr(fp), "include <stdio.h>\n", 18) == 0
12130 if eval $compile && $to try.c; then
12131 if $run ./try; then
12132 echo "Your stdio acts pretty std."
12135 echo "Your stdio isn't very std."
12138 echo "Your stdio doesn't appear very std."
12142 # glibc 2.2.90 and above apparently change stdio streams so Perl's
12143 # direct buffer manipulation no longer works. The Configure tests
12144 # should be changed to correctly detect this, but until then,
12145 # the following check should at least let perl compile and run.
12146 # (This quick fix should be updated before 5.8.1.)
12147 # To be defensive, reject all unknown versions, and all versions > 2.2.9.
12148 # A. Dougherty, June 3, 2002.
12149 case "$d_gnulibc" in
12151 case "$gnulibc_version" in
12155 *) echo "But I will not snoop inside glibc $gnulibc_version stdio buffers."
12164 : Can _ptr be used as an lvalue?
12165 case "$d_stdstdio$ptr_lval" in
12166 $define$define) val=$define ;;
12169 set d_stdio_ptr_lval
12172 : Can _cnt be used as an lvalue?
12173 case "$d_stdstdio$cnt_lval" in
12174 $define$define) val=$define ;;
12177 set d_stdio_cnt_lval
12181 : test whether setting _ptr sets _cnt as a side effect
12182 d_stdio_ptr_lval_sets_cnt="$undef"
12183 d_stdio_ptr_lval_nochange_cnt="$undef"
12184 case "$d_stdio_ptr_lval$d_stdstdio" in
12186 echo "Checking to see what happens if we set the stdio ptr..." >&4
12189 /* Can we scream? */
12190 /* Eat dust sed :-) */
12191 /* In the buffer space, no one can hear you scream. */
12192 #$i_stdlib I_STDLIB
12194 #include <stdlib.h>
12196 #define FILE_ptr(fp) $stdio_ptr
12197 #define FILE_cnt(fp) $stdio_cnt
12198 #include <sys/types.h>
12200 FILE *fp = fopen("try.c", "r");
12205 puts("Fail even to read");
12208 c = getc(fp); /* Read away the first # */
12210 puts("Fail even to read");
12214 18 <= FILE_cnt(fp) &&
12215 strncmp(FILE_ptr(fp), "include <stdio.h>\n", 18) == 0
12217 puts("Fail even to read");
12220 ptr = (char*) FILE_ptr(fp);
12221 cnt = (size_t)FILE_cnt(fp);
12223 FILE_ptr(fp) += 42;
12225 if ((char*)FILE_ptr(fp) != (ptr + 42)) {
12226 printf("Fail ptr check %p != %p", FILE_ptr(fp), (ptr + 42));
12229 if (FILE_cnt(fp) <= 20) {
12230 printf ("Fail (<20 chars to test)");
12233 if (strncmp(FILE_ptr(fp), "Eat dust sed :-) */\n", 20) != 0) {
12234 puts("Fail compare");
12237 if (cnt == FILE_cnt(fp)) {
12238 puts("Pass_unchanged");
12241 if (FILE_cnt(fp) == (cnt - 42)) {
12242 puts("Pass_changed");
12245 printf("Fail count was %d now %d\n", cnt, FILE_cnt(fp));
12251 if eval $compile && $to try.c; then
12252 case `$run ./try` in
12254 echo "Increasing ptr in your stdio decreases cnt by the same amount. Good." >&4
12255 d_stdio_ptr_lval_sets_cnt="$define" ;;
12257 echo "Increasing ptr in your stdio leaves cnt unchanged. Good." >&4
12258 d_stdio_ptr_lval_nochange_cnt="$define" ;;
12260 echo "Increasing ptr in your stdio didn't do exactly what I expected. We'll not be doing that then." >&4 ;;
12262 echo "It appears attempting to set ptr in your stdio is a bad plan." >&4 ;;
12265 echo "It seems we can't set ptr in your stdio. Nevermind." >&4
12271 : see if _base is also standard
12273 case "$d_stdstdio" in
12277 #$i_stdlib I_STDLIB
12279 #include <stdlib.h>
12281 #define FILE_base(fp) $stdio_base
12282 #define FILE_bufsiz(fp) $stdio_bufsiz
12284 FILE *fp = fopen("try.c", "r");
12287 19 <= FILE_bufsiz(fp) &&
12288 strncmp(FILE_base(fp), "#include <stdio.h>\n", 19) == 0
12295 if eval $compile && $to try.c; then
12296 if $run ./try; then
12297 echo "And its _base field acts std."
12300 echo "But its _base field isn't std."
12303 echo "However, it seems to be lacking the _base field."
12311 : see if fast_stdio exists
12313 case "$d_stdstdio:$d_stdio_ptr_lval" in
12315 case "$d_stdio_cnt_lval$d_stdio_ptr_lval_sets_cnt" in
12317 echo "You seem to have 'fast stdio' to directly manipulate the stdio buffers." >& 4
12328 : see if fchdir exists
12329 set fchdir d_fchdir
12332 : see if fchmod exists
12333 set fchmod d_fchmod
12336 : see if fchown exists
12337 set fchown d_fchown
12340 : see if this is an fcntl system
12345 : See if fcntl-based locking works.
12347 #$i_stdlib I_STDLIB
12349 #include <stdlib.h>
12351 #include <unistd.h>
12353 #include <signal.h>
12354 $signal_t blech(x) int x; { exit(3); }
12356 #if defined(F_SETLK) && defined(F_SETLKW)
12357 struct flock flock;
12359 fd = open("try.c", O_RDONLY);
12360 flock.l_type = F_RDLCK;
12361 flock.l_whence = SEEK_SET;
12362 flock.l_start = flock.l_len = 0;
12363 signal(SIGALRM, blech);
12365 retval = fcntl(fd, F_SETLK, &flock);
12367 (retval < 0 ? exit(2) : exit(0));
12373 echo "Checking if fcntl-based file locking works... "
12377 if eval $compile_ok; then
12378 if $run ./try; then
12379 echo "Yes, it seems to work."
12382 echo "Nope, it didn't work."
12387 *** I had to forcibly timeout from fcntl(..., F_SETLK, ...).
12388 *** This is (almost) impossible.
12389 *** If your NFS lock daemons are not feeling well, something like
12390 *** this may happen, please investigate. Cannot continue, aborting.
12398 echo "I'm unable to compile the test program, so I'll assume not."
12403 echo "Nope, since you don't even have fcntl()."
12406 set d_fcntl_can_lock
12411 : check for fd_set items
12414 Checking to see how well your C compiler handles fd_set and friends ...
12417 #$i_stdlib I_STDLIB
12419 #include <stdlib.h>
12421 #$i_systime I_SYS_TIME
12422 #$i_sysselct I_SYS_SELECT
12423 #$d_socket HAS_SOCKET
12424 #include <sys/types.h>
12426 #include <sys/socket.h> /* Might include <sys/bsdtypes.h> */
12429 #include <sys/time.h>
12431 #ifdef I_SYS_SELECT
12432 #include <sys/select.h>
12441 #if defined(FD_SET) && defined(FD_CLR) && defined(FD_ISSET) && defined(FD_ZERO)
12449 if eval $compile; then
12450 d_fds_bits="$define"
12452 echo "Well, your system knows about the normal fd_set typedef..." >&4
12453 if $run ./try; then
12454 echo "and you have the normal fd_set macros (just as I'd expect)." >&4
12455 d_fd_macros="$define"
12458 but not the normal fd_set macros! Gaaack! I'll have to cover for you.
12460 d_fd_macros="$undef"
12464 Hmm, your compiler has some difficulty with fd_set. Checking further...
12467 if eval $compile; then
12468 d_fds_bits="$undef"
12470 echo "Well, your system has some sort of fd_set available..." >&4
12471 if $run ./try; then
12472 echo "and you have the normal fd_set macros." >&4
12473 d_fd_macros="$define"
12476 but not the normal fd_set macros! Gross! More work for me...
12478 d_fd_macros="$undef"
12481 echo "Well, you got zip. That's OK, I can roll my own fd_set stuff." >&4
12483 d_fds_bits="$undef"
12484 d_fd_macros="$undef"
12489 : see if fgetpos exists
12490 set fgetpos d_fgetpos
12493 : see if finite exists
12494 set finite d_finite
12497 : see if finitel exists
12498 set finitel d_finitel
12501 : see if flock exists
12505 : see if prototype for flock is available
12507 set d_flockproto flock $i_sysfile sys/file.h
12510 : see if fork exists
12514 : see if fp_class exists
12515 set fp_class d_fp_class
12518 : see if pathconf exists
12519 set pathconf d_pathconf
12522 : see if fpathconf exists
12523 set fpathconf d_fpathconf
12526 : see if fpclass exists
12527 set fpclass d_fpclass
12530 : see if fpclassify exists
12531 set fpclassify d_fpclassify
12534 : see if fpclassl exists
12535 set fpclassl d_fpclassl
12539 : check for fpos64_t
12541 echo "Checking to see if you have fpos64_t..." >&4
12544 int main() { fpos64_t x = 7; }
12547 if eval $compile; then
12549 echo "You have fpos64_t."
12552 echo "You do not have fpos64_t."
12553 case "$fpossize" in
12554 8) echo "(Your fpos_t is 64 bits, so you could use that.)" ;;
12561 : see if frexpl exists
12562 set frexpl d_frexpl
12565 : see if this is a sys/param system
12566 set sys/param.h i_sysparam
12569 : see if this is a sys/mount.h system
12570 set sys/mount.h i_sysmount
12575 echo "Checking to see if your system supports struct fs_data..." >&4
12576 set d_fs_data_s fs_data $i_systypes sys/types.h $i_sysparam sys/param.h $i_sysmount sys/mount.h
12578 case "$d_fs_data_s" in
12579 "$define") echo "Yes, it does." ;;
12580 *) echo "No, it doesn't." ;;
12583 : see if fseeko exists
12584 set fseeko d_fseeko
12586 case "$longsize" in
12587 8) echo "(Your long is 64 bits, so you could use fseek.)" ;;
12590 : see if fsetpos exists
12591 set fsetpos d_fsetpos
12595 : see if fstatfs exists
12596 set fstatfs d_fstatfs
12600 : see if statvfs exists
12601 set statvfs d_statvfs
12604 : see if fstatvfs exists
12605 set fstatvfs d_fstatvfs
12609 : see if fsync exists
12613 : see if ftello exists
12614 set ftello d_ftello
12616 case "$longsize" in
12617 8) echo "(Your long is 64 bits, so you could use ftell.)" ;;
12621 : check for a working futimes
12623 echo "Checking for a working futimes()" >&4
12626 #include <sys/time.h>
12633 fd = open ("try.c", O_RDWR);
12634 if (-1 == fd) exit (1);
12635 rv = futimes (fd, NULL);
12636 exit (rv == -1 ? errno : 0);
12640 if eval $compile; then
12644 0) echo "Yes, it does" >&4
12645 d_futimes="$define"
12647 *) echo "No, it has futimes, but it isn't working ($rc) (probably harmless)\n" >&4
12651 echo "No, it does not (probably harmless)\n" >&4
12653 $rm -f try.* try core core.try.*
12655 : see if getcwd exists
12656 set getcwd d_getcwd
12659 : see if getespwnam exists
12660 set getespwnam d_getespwnam
12664 : see if getfsstat exists
12665 set getfsstat d_getfsstat
12668 : see if getgrent exists
12669 set getgrent d_getgrent
12672 : see if getgrent_r exists
12673 set getgrent_r d_getgrent_r
12675 case "$d_getgrent_r" in
12677 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
12678 case "$d_getgrent_r_proto:$usethreads" in
12679 ":define") d_getgrent_r_proto=define
12680 set d_getgrent_r_proto getgrent_r $hdrs
12684 case "$d_getgrent_r_proto" in
12686 case "$getgrent_r_proto" in
12687 ''|0) try='int getgrent_r(struct group*, char*, size_t, struct group**);'
12688 ./protochk "extern $try" $hdrs && getgrent_r_proto=I_SBWR ;;
12690 case "$getgrent_r_proto" in
12691 ''|0) try='int getgrent_r(struct group*, char*, int, struct group**);'
12692 ./protochk "extern $try" $hdrs && getgrent_r_proto=I_SBIR ;;
12694 case "$getgrent_r_proto" in
12695 ''|0) try='struct group* getgrent_r(struct group*, char*, size_t);'
12696 ./protochk "extern $try" $hdrs && getgrent_r_proto=S_SBW ;;
12698 case "$getgrent_r_proto" in
12699 ''|0) try='struct group* getgrent_r(struct group*, char*, int);'
12700 ./protochk "extern $try" $hdrs && getgrent_r_proto=S_SBI ;;
12702 case "$getgrent_r_proto" in
12703 ''|0) try='int getgrent_r(struct group*, char*, int);'
12704 ./protochk "extern $try" $hdrs && getgrent_r_proto=I_SBI ;;
12706 case "$getgrent_r_proto" in
12707 ''|0) try='int getgrent_r(struct group*, char*, int, FILE**);'
12708 ./protochk "extern $try" $hdrs && getgrent_r_proto=I_SBIH ;;
12710 case "$getgrent_r_proto" in
12711 ''|0) d_getgrent_r=undef
12713 echo "Disabling getgrent_r, cannot determine prototype." >&4 ;;
12714 * ) case "$getgrent_r_proto" in
12715 REENTRANT_PROTO*) ;;
12716 *) getgrent_r_proto="REENTRANT_PROTO_$getgrent_r_proto" ;;
12718 echo "Prototype: $try" ;;
12721 *) case "$usethreads" in
12722 define) echo "getgrent_r has no prototype, not using it." >&4 ;;
12729 *) getgrent_r_proto=0
12733 : see if getgrgid_r exists
12734 set getgrgid_r d_getgrgid_r
12736 case "$d_getgrgid_r" in
12738 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
12739 case "$d_getgrgid_r_proto:$usethreads" in
12740 ":define") d_getgrgid_r_proto=define
12741 set d_getgrgid_r_proto getgrgid_r $hdrs
12745 case "$d_getgrgid_r_proto" in
12747 case "$getgrgid_r_proto" in
12748 ''|0) try='int getgrgid_r(gid_t, struct group*, char*, size_t, struct group**);'
12749 ./protochk "extern $try" $hdrs && getgrgid_r_proto=I_TSBWR ;;
12751 case "$getgrgid_r_proto" in
12752 ''|0) try='int getgrgid_r(gid_t, struct group*, char*, int, struct group**);'
12753 ./protochk "extern $try" $hdrs && getgrgid_r_proto=I_TSBIR ;;
12755 case "$getgrgid_r_proto" in
12756 ''|0) try='int getgrgid_r(gid_t, struct group*, char*, int);'
12757 ./protochk "extern $try" $hdrs && getgrgid_r_proto=I_TSBI ;;
12759 case "$getgrgid_r_proto" in
12760 ''|0) try='struct group* getgrgid_r(gid_t, struct group*, char*, int);'
12761 ./protochk "extern $try" $hdrs && getgrgid_r_proto=S_TSBI ;;
12763 case "$getgrgid_r_proto" in
12764 ''|0) d_getgrgid_r=undef
12766 echo "Disabling getgrgid_r, cannot determine prototype." >&4 ;;
12767 * ) case "$getgrgid_r_proto" in
12768 REENTRANT_PROTO*) ;;
12769 *) getgrgid_r_proto="REENTRANT_PROTO_$getgrgid_r_proto" ;;
12771 echo "Prototype: $try" ;;
12774 *) case "$usethreads" in
12775 define) echo "getgrgid_r has no prototype, not using it." >&4 ;;
12782 *) getgrgid_r_proto=0
12786 : see if getgrnam_r exists
12787 set getgrnam_r d_getgrnam_r
12789 case "$d_getgrnam_r" in
12791 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
12792 case "$d_getgrnam_r_proto:$usethreads" in
12793 ":define") d_getgrnam_r_proto=define
12794 set d_getgrnam_r_proto getgrnam_r $hdrs
12798 case "$d_getgrnam_r_proto" in
12800 case "$getgrnam_r_proto" in
12801 ''|0) try='int getgrnam_r(const char*, struct group*, char*, size_t, struct group**);'
12802 ./protochk "extern $try" $hdrs && getgrnam_r_proto=I_CSBWR ;;
12804 case "$getgrnam_r_proto" in
12805 ''|0) try='int getgrnam_r(const char*, struct group*, char*, int, struct group**);'
12806 ./protochk "extern $try" $hdrs && getgrnam_r_proto=I_CSBIR ;;
12808 case "$getgrnam_r_proto" in
12809 ''|0) try='struct group* getgrnam_r(const char*, char*, int);'
12810 ./protochk "extern $try" $hdrs && getgrnam_r_proto=S_CBI ;;
12812 case "$getgrnam_r_proto" in
12813 ''|0) try='int getgrnam_r(const char*, struct group*, char*, int);'
12814 ./protochk "extern $try" $hdrs && getgrnam_r_proto=I_CSBI ;;
12816 case "$getgrnam_r_proto" in
12817 ''|0) try='struct group* getgrnam_r(const char*, struct group*, char*, int);'
12818 ./protochk "extern $try" $hdrs && getgrnam_r_proto=S_CSBI ;;
12820 case "$getgrnam_r_proto" in
12821 ''|0) d_getgrnam_r=undef
12823 echo "Disabling getgrnam_r, cannot determine prototype." >&4 ;;
12824 * ) case "$getgrnam_r_proto" in
12825 REENTRANT_PROTO*) ;;
12826 *) getgrnam_r_proto="REENTRANT_PROTO_$getgrnam_r_proto" ;;
12828 echo "Prototype: $try" ;;
12831 *) case "$usethreads" in
12832 define) echo "getgrnam_r has no prototype, not using it." >&4 ;;
12839 *) getgrnam_r_proto=0
12843 : see if gethostbyaddr exists
12844 set gethostbyaddr d_gethbyaddr
12847 : see if gethostbyname exists
12848 set gethostbyname d_gethbyname
12851 : see if gethostent exists
12852 set gethostent d_gethent
12855 : see how we will look up host name
12858 if set gethostname val -f d_gethname; eval $csym; $val; then
12859 echo 'gethostname() found.' >&4
12860 d_gethname="$define"
12863 if set uname val -f d_uname; eval $csym; $val; then
12866 uname() was found, but you're running xenix, and older versions of xenix
12867 have a broken uname(). If you don't really know whether your xenix is old
12868 enough to have a broken system call, use the default answer.
12873 "$define") dflt=n;;
12875 rp='Is your uname() broken?'
12878 n*) d_uname="$define"; call=uname;;
12881 echo 'uname() found.' >&4
12888 case "$d_gethname" in
12889 '') d_gethname="$undef";;
12892 '') d_uname="$undef";;
12894 case "$d_uname$d_gethname" in
12899 Every now and then someone has a $call() that lies about the hostname
12900 but can't be fixed for political or economic reasons. If you wish, I can
12901 pretend $call() isn't there and maybe compute hostname at run-time
12902 thanks to the '$phostname' command.
12905 rp="Shall I ignore $call() from now on?"
12908 y*) d_uname="$undef" d_gethname="$undef"; $echo $n "Okay...$c";;
12911 case "$phostname" in
12912 '') aphostname='';;
12913 *) case "$aphostname" in
12915 *) set X $phostname
12919 file=`./loc $file $file $pth`
12920 aphostname=`echo $file $*`
12925 case "$d_uname$d_gethname" in
12928 case "$phostname" in
12930 echo "There will be no way for $package to get your hostname." >&4;;
12932 echo "I'll use 'popen("'"'$aphostname'", "r")'"' to get your hostname." >&4
12936 case "$d_phostname" in
12937 '') d_phostname="$undef";;
12940 : see if gethostbyaddr_r exists
12941 set gethostbyaddr_r d_gethostbyaddr_r
12943 case "$d_gethostbyaddr_r" in
12945 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
12946 case "$d_gethostbyaddr_r_proto:$usethreads" in
12947 ":define") d_gethostbyaddr_r_proto=define
12948 set d_gethostbyaddr_r_proto gethostbyaddr_r $hdrs
12952 case "$d_gethostbyaddr_r_proto" in
12954 case "$gethostbyaddr_r_proto" in
12955 ''|0) try='int gethostbyaddr_r(const char*, size_t, int, struct hostent*, char*, size_t, struct hostent**, int*);'
12956 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=I_CWISBWRE ;;
12958 case "$gethostbyaddr_r_proto" in
12959 ''|0) try='struct hostent* gethostbyaddr_r(const char*, size_t, int, struct hostent*, char*, size_t, int, int*);'
12960 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=S_CWISBWIE ;;
12962 case "$gethostbyaddr_r_proto" in
12963 ''|0) try='struct hostent* gethostbyaddr_r(const char*, size_t, int, struct hostent*, char*, int, int*);'
12964 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=S_CWISBIE ;;
12966 case "$gethostbyaddr_r_proto" in
12967 ''|0) try='struct hostent* gethostbyaddr_r(const void*, size_t, int, struct hostent*, char*, int, int*);'
12968 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=S_TWISBIE ;;
12970 case "$gethostbyaddr_r_proto" in
12971 ''|0) try='struct hostent* gethostbyaddr_r(const char*, int, int, struct hostent*, char*, int, int*);'
12972 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=S_CIISBIE ;;
12974 case "$gethostbyaddr_r_proto" in
12975 ''|0) try='struct hostent* gethostbyaddr_r(const char*, struct hostent*, char*, int, int*);'
12976 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=S_CSBIE ;;
12978 case "$gethostbyaddr_r_proto" in
12979 ''|0) try='struct hostent* gethostbyaddr_r(const void*, struct hostent*, char*, int, int*);'
12980 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=S_TSBIE ;;
12982 case "$gethostbyaddr_r_proto" in
12983 ''|0) try='int gethostbyaddr_r(const char*, size_t, int, struct hostent*, struct hostent_data*);'
12984 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=I_CWISD ;;
12986 case "$gethostbyaddr_r_proto" in
12987 ''|0) try='int gethostbyaddr_r(const char*, int, int, struct hostent*, struct hostent_data*);'
12988 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=I_CIISD ;;
12990 case "$gethostbyaddr_r_proto" in
12991 ''|0) try='int gethostbyaddr_r(const char*, int, int);'
12992 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=I_CII ;;
12994 case "$gethostbyaddr_r_proto" in
12995 ''|0) try='int gethostbyaddr_r(const void*, socklen_t, int, struct hostent*, char*, size_t, struct hostent**, int*);'
12996 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=I_TsISBWRE ;;
12998 case "$gethostbyaddr_r_proto" in
12999 ''|0) d_gethostbyaddr_r=undef
13000 gethostbyaddr_r_proto=0
13001 echo "Disabling gethostbyaddr_r, cannot determine prototype." >&4 ;;
13002 * ) case "$gethostbyaddr_r_proto" in
13003 REENTRANT_PROTO*) ;;
13004 *) gethostbyaddr_r_proto="REENTRANT_PROTO_$gethostbyaddr_r_proto" ;;
13006 echo "Prototype: $try" ;;
13009 *) case "$usethreads" in
13010 define) echo "gethostbyaddr_r has no prototype, not using it." >&4 ;;
13012 d_gethostbyaddr_r=undef
13013 gethostbyaddr_r_proto=0
13017 *) gethostbyaddr_r_proto=0
13021 : see if gethostbyname_r exists
13022 set gethostbyname_r d_gethostbyname_r
13024 case "$d_gethostbyname_r" in
13026 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13027 case "$d_gethostbyname_r_proto:$usethreads" in
13028 ":define") d_gethostbyname_r_proto=define
13029 set d_gethostbyname_r_proto gethostbyname_r $hdrs
13033 case "$d_gethostbyname_r_proto" in
13035 case "$gethostbyname_r_proto" in
13036 ''|0) try='int gethostbyname_r(const char*, struct hostent*, char*, size_t, struct hostent**, int*);'
13037 ./protochk "extern $try" $hdrs && gethostbyname_r_proto=I_CSBWRE ;;
13039 case "$gethostbyname_r_proto" in
13040 ''|0) try='struct hostent* gethostbyname_r(const char*, struct hostent*, char*, int, int*);'
13041 ./protochk "extern $try" $hdrs && gethostbyname_r_proto=S_CSBIE ;;
13043 case "$gethostbyname_r_proto" in
13044 ''|0) try='int gethostbyname_r(const char*, struct hostent*, struct hostent_data*);'
13045 ./protochk "extern $try" $hdrs && gethostbyname_r_proto=I_CSD ;;
13047 case "$gethostbyname_r_proto" in
13048 ''|0) d_gethostbyname_r=undef
13049 gethostbyname_r_proto=0
13050 echo "Disabling gethostbyname_r, cannot determine prototype." >&4 ;;
13051 * ) case "$gethostbyname_r_proto" in
13052 REENTRANT_PROTO*) ;;
13053 *) gethostbyname_r_proto="REENTRANT_PROTO_$gethostbyname_r_proto" ;;
13055 echo "Prototype: $try" ;;
13058 *) case "$usethreads" in
13059 define) echo "gethostbyname_r has no prototype, not using it." >&4 ;;
13061 d_gethostbyname_r=undef
13062 gethostbyname_r_proto=0
13066 *) gethostbyname_r_proto=0
13070 : see if gethostent_r exists
13071 set gethostent_r d_gethostent_r
13073 case "$d_gethostent_r" in
13075 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13076 case "$d_gethostent_r_proto:$usethreads" in
13077 ":define") d_gethostent_r_proto=define
13078 set d_gethostent_r_proto gethostent_r $hdrs
13082 case "$d_gethostent_r_proto" in
13084 case "$gethostent_r_proto" in
13085 ''|0) try='int gethostent_r(struct hostent*, char*, size_t, struct hostent**, int*);'
13086 ./protochk "extern $try" $hdrs && gethostent_r_proto=I_SBWRE ;;
13088 case "$gethostent_r_proto" in
13089 ''|0) try='int gethostent_r(struct hostent*, char*, int, int*);'
13090 ./protochk "extern $try" $hdrs && gethostent_r_proto=I_SBIE ;;
13092 case "$gethostent_r_proto" in
13093 ''|0) try='struct hostent* gethostent_r(struct hostent*, char*, int, int*);'
13094 ./protochk "extern $try" $hdrs && gethostent_r_proto=S_SBIE ;;
13096 case "$gethostent_r_proto" in
13097 ''|0) try='struct hostent* gethostent_r(struct hostent*, char*, int);'
13098 ./protochk "extern $try" $hdrs && gethostent_r_proto=S_SBI ;;
13100 case "$gethostent_r_proto" in
13101 ''|0) try='int gethostent_r(struct hostent*, char*, int);'
13102 ./protochk "extern $try" $hdrs && gethostent_r_proto=I_SBI ;;
13104 case "$gethostent_r_proto" in
13105 ''|0) try='int gethostent_r(struct hostent*, struct hostent_data*);'
13106 ./protochk "extern $try" $hdrs && gethostent_r_proto=I_SD ;;
13108 case "$gethostent_r_proto" in
13109 ''|0) d_gethostent_r=undef
13110 gethostent_r_proto=0
13111 echo "Disabling gethostent_r, cannot determine prototype." >&4 ;;
13112 * ) case "$gethostent_r_proto" in
13113 REENTRANT_PROTO*) ;;
13114 *) gethostent_r_proto="REENTRANT_PROTO_$gethostent_r_proto" ;;
13116 echo "Prototype: $try" ;;
13119 *) case "$usethreads" in
13120 define) echo "gethostent_r has no prototype, not using it." >&4 ;;
13122 d_gethostent_r=undef
13123 gethostent_r_proto=0
13127 *) gethostent_r_proto=0
13131 : see if prototypes for various gethostxxx netdb.h functions are available
13133 set d_gethostprotos gethostent $i_netdb netdb.h
13136 : see if getitimer exists
13137 set getitimer d_getitimer
13140 : see if getlogin exists
13141 set getlogin d_getlogin
13144 : see if getlogin_r exists
13145 set getlogin_r d_getlogin_r
13147 case "$d_getlogin_r" in
13149 hdrs="$i_systypes sys/types.h define stdio.h $i_unistd unistd.h"
13150 case "$d_getlogin_r_proto:$usethreads" in
13151 ":define") d_getlogin_r_proto=define
13152 set d_getlogin_r_proto getlogin_r $hdrs
13156 case "$d_getlogin_r_proto" in
13158 case "$getlogin_r_proto" in
13159 ''|0) try='int getlogin_r(char*, size_t);'
13160 ./protochk "extern $try" $hdrs && getlogin_r_proto=I_BW ;;
13162 case "$getlogin_r_proto" in
13163 ''|0) try='int getlogin_r(char*, int);'
13164 ./protochk "extern $try" $hdrs && getlogin_r_proto=I_BI ;;
13166 case "$getlogin_r_proto" in
13167 ''|0) try='char* getlogin_r(char*, size_t);'
13168 ./protochk "extern $try" $hdrs && getlogin_r_proto=B_BW ;;
13170 case "$getlogin_r_proto" in
13171 ''|0) try='char* getlogin_r(char*, int);'
13172 ./protochk "extern $try" $hdrs && getlogin_r_proto=B_BI ;;
13174 case "$getlogin_r_proto" in
13175 ''|0) d_getlogin_r=undef
13177 echo "Disabling getlogin_r, cannot determine prototype." >&4 ;;
13178 * ) case "$getlogin_r_proto" in
13179 REENTRANT_PROTO*) ;;
13180 *) getlogin_r_proto="REENTRANT_PROTO_$getlogin_r_proto" ;;
13182 echo "Prototype: $try" ;;
13185 *) case "$usethreads" in
13186 define) echo "getlogin_r has no prototype, not using it." >&4 ;;
13193 *) getlogin_r_proto=0
13197 : see if getmnt exists
13198 set getmnt d_getmnt
13201 : see if getmntent exists
13202 set getmntent d_getmntent
13205 : see if getnetbyaddr exists
13206 set getnetbyaddr d_getnbyaddr
13209 : see if getnetbyname exists
13210 set getnetbyname d_getnbyname
13213 : see if getnetent exists
13214 set getnetent d_getnent
13217 : see if getnetbyaddr_r exists
13218 set getnetbyaddr_r d_getnetbyaddr_r
13220 case "$d_getnetbyaddr_r" in
13222 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13223 case "$d_getnetbyaddr_r_proto:$usethreads" in
13224 ":define") d_getnetbyaddr_r_proto=define
13225 set d_getnetbyaddr_r_proto getnetbyaddr_r $hdrs
13229 case "$d_getnetbyaddr_r_proto" in
13231 case "$getnetbyaddr_r_proto" in
13232 ''|0) try='int getnetbyaddr_r(unsigned long, int, struct netent*, char*, size_t, struct netent**, int*);'
13233 ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=I_UISBWRE ;;
13235 case "$getnetbyaddr_r_proto" in
13236 ''|0) try='int getnetbyaddr_r(long, int, struct netent*, char*, int);'
13237 ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=I_LISBI ;;
13239 case "$getnetbyaddr_r_proto" in
13240 ''|0) try='struct netent* getnetbyaddr_r(in_addr_t, int, struct netent*, char*, int);'
13241 ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=S_TISBI ;;
13243 case "$getnetbyaddr_r_proto" in
13244 ''|0) try='struct netent* getnetbyaddr_r(long, int, struct netent*, char*, int);'
13245 ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=S_LISBI ;;
13247 case "$getnetbyaddr_r_proto" in
13248 ''|0) try='int getnetbyaddr_r(in_addr_t, int, struct netent*, struct netent_data*);'
13249 ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=I_TISD ;;
13251 case "$getnetbyaddr_r_proto" in
13252 ''|0) try='int getnetbyaddr_r(long, int, struct netent*, struct netent_data*);'
13253 ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=I_LISD ;;
13255 case "$getnetbyaddr_r_proto" in
13256 ''|0) try='int getnetbyaddr_r(int, int, struct netent*, struct netent_data*);'
13257 ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=I_IISD ;;
13259 case "$getnetbyaddr_r_proto" in
13260 ''|0) try='int getnetbyaddr_r(uint32_t, int, struct netent*, char*, size_t, struct netent**, int*);'
13261 ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=I_uISBWRE ;;
13263 case "$getnetbyaddr_r_proto" in
13264 ''|0) d_getnetbyaddr_r=undef
13265 getnetbyaddr_r_proto=0
13266 echo "Disabling getnetbyaddr_r, cannot determine prototype." >&4 ;;
13267 * ) case "$getnetbyaddr_r_proto" in
13268 REENTRANT_PROTO*) ;;
13269 *) getnetbyaddr_r_proto="REENTRANT_PROTO_$getnetbyaddr_r_proto" ;;
13271 echo "Prototype: $try" ;;
13274 *) case "$usethreads" in
13275 define) echo "getnetbyaddr_r has no prototype, not using it." >&4 ;;
13277 d_getnetbyaddr_r=undef
13278 getnetbyaddr_r_proto=0
13282 *) getnetbyaddr_r_proto=0
13286 : see if getnetbyname_r exists
13287 set getnetbyname_r d_getnetbyname_r
13289 case "$d_getnetbyname_r" in
13291 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13292 case "$d_getnetbyname_r_proto:$usethreads" in
13293 ":define") d_getnetbyname_r_proto=define
13294 set d_getnetbyname_r_proto getnetbyname_r $hdrs
13298 case "$d_getnetbyname_r_proto" in
13300 case "$getnetbyname_r_proto" in
13301 ''|0) try='int getnetbyname_r(const char*, struct netent*, char*, size_t, struct netent**, int*);'
13302 ./protochk "extern $try" $hdrs && getnetbyname_r_proto=I_CSBWRE ;;
13304 case "$getnetbyname_r_proto" in
13305 ''|0) try='int getnetbyname_r(const char*, struct netent*, char*, int);'
13306 ./protochk "extern $try" $hdrs && getnetbyname_r_proto=I_CSBI ;;
13308 case "$getnetbyname_r_proto" in
13309 ''|0) try='struct netent* getnetbyname_r(const char*, struct netent*, char*, int);'
13310 ./protochk "extern $try" $hdrs && getnetbyname_r_proto=S_CSBI ;;
13312 case "$getnetbyname_r_proto" in
13313 ''|0) try='int getnetbyname_r(const char*, struct netent*, struct netent_data*);'
13314 ./protochk "extern $try" $hdrs && getnetbyname_r_proto=I_CSD ;;
13316 case "$getnetbyname_r_proto" in
13317 ''|0) d_getnetbyname_r=undef
13318 getnetbyname_r_proto=0
13319 echo "Disabling getnetbyname_r, cannot determine prototype." >&4 ;;
13320 * ) case "$getnetbyname_r_proto" in
13321 REENTRANT_PROTO*) ;;
13322 *) getnetbyname_r_proto="REENTRANT_PROTO_$getnetbyname_r_proto" ;;
13324 echo "Prototype: $try" ;;
13327 *) case "$usethreads" in
13328 define) echo "getnetbyname_r has no prototype, not using it." >&4 ;;
13330 d_getnetbyname_r=undef
13331 getnetbyname_r_proto=0
13335 *) getnetbyname_r_proto=0
13339 : see if getnetent_r exists
13340 set getnetent_r d_getnetent_r
13342 case "$d_getnetent_r" in
13344 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13345 case "$d_getnetent_r_proto:$usethreads" in
13346 ":define") d_getnetent_r_proto=define
13347 set d_getnetent_r_proto getnetent_r $hdrs
13351 case "$d_getnetent_r_proto" in
13353 case "$getnetent_r_proto" in
13354 ''|0) try='int getnetent_r(struct netent*, char*, size_t, struct netent**, int*);'
13355 ./protochk "extern $try" $hdrs && getnetent_r_proto=I_SBWRE ;;
13357 case "$getnetent_r_proto" in
13358 ''|0) try='int getnetent_r(struct netent*, char*, int, int*);'
13359 ./protochk "extern $try" $hdrs && getnetent_r_proto=I_SBIE ;;
13361 case "$getnetent_r_proto" in
13362 ''|0) try='struct netent* getnetent_r(struct netent*, char*, int, int*);'
13363 ./protochk "extern $try" $hdrs && getnetent_r_proto=S_SBIE ;;
13365 case "$getnetent_r_proto" in
13366 ''|0) try='struct netent* getnetent_r(struct netent*, char*, int);'
13367 ./protochk "extern $try" $hdrs && getnetent_r_proto=S_SBI ;;
13369 case "$getnetent_r_proto" in
13370 ''|0) try='int getnetent_r(struct netent*, char*, int);'
13371 ./protochk "extern $try" $hdrs && getnetent_r_proto=I_SBI ;;
13373 case "$getnetent_r_proto" in
13374 ''|0) try='int getnetent_r(struct netent*, struct netent_data*);'
13375 ./protochk "extern $try" $hdrs && getnetent_r_proto=I_SD ;;
13377 case "$getnetent_r_proto" in
13378 ''|0) d_getnetent_r=undef
13379 getnetent_r_proto=0
13380 echo "Disabling getnetent_r, cannot determine prototype." >&4 ;;
13381 * ) case "$getnetent_r_proto" in
13382 REENTRANT_PROTO*) ;;
13383 *) getnetent_r_proto="REENTRANT_PROTO_$getnetent_r_proto" ;;
13385 echo "Prototype: $try" ;;
13388 *) case "$usethreads" in
13389 define) echo "getnetent_r has no prototype, not using it." >&4 ;;
13391 d_getnetent_r=undef
13392 getnetent_r_proto=0
13396 *) getnetent_r_proto=0
13400 : see if prototypes for various getnetxxx netdb.h functions are available
13402 set d_getnetprotos getnetent $i_netdb netdb.h
13405 : see if getpagesize exists
13406 set getpagesize d_getpagsz
13410 : see if getprotobyname exists
13411 set getprotobyname d_getpbyname
13414 : see if getprotobynumber exists
13415 set getprotobynumber d_getpbynumber
13418 : see if getprotoent exists
13419 set getprotoent d_getpent
13422 : see if getpgid exists
13423 set getpgid d_getpgid
13426 : see if getpgrp2 exists
13427 set getpgrp2 d_getpgrp2
13430 : see if getppid exists
13431 set getppid d_getppid
13434 : see if getpriority exists
13435 set getpriority d_getprior
13438 : see if getprotobyname_r exists
13439 set getprotobyname_r d_getprotobyname_r
13441 case "$d_getprotobyname_r" in
13443 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13444 case "$d_getprotobyname_r_proto:$usethreads" in
13445 ":define") d_getprotobyname_r_proto=define
13446 set d_getprotobyname_r_proto getprotobyname_r $hdrs
13450 case "$d_getprotobyname_r_proto" in
13452 case "$getprotobyname_r_proto" in
13453 ''|0) try='int getprotobyname_r(const char*, struct protoent*, char*, size_t, struct protoent**);'
13454 ./protochk "extern $try" $hdrs && getprotobyname_r_proto=I_CSBWR ;;
13456 case "$getprotobyname_r_proto" in
13457 ''|0) try='struct protoent* getprotobyname_r(const char*, struct protoent*, char*, int);'
13458 ./protochk "extern $try" $hdrs && getprotobyname_r_proto=S_CSBI ;;
13460 case "$getprotobyname_r_proto" in
13461 ''|0) try='int getprotobyname_r(const char*, struct protoent*, struct protoent_data*);'
13462 ./protochk "extern $try" $hdrs && getprotobyname_r_proto=I_CSD ;;
13464 case "$getprotobyname_r_proto" in
13465 ''|0) d_getprotobyname_r=undef
13466 getprotobyname_r_proto=0
13467 echo "Disabling getprotobyname_r, cannot determine prototype." >&4 ;;
13468 * ) case "$getprotobyname_r_proto" in
13469 REENTRANT_PROTO*) ;;
13470 *) getprotobyname_r_proto="REENTRANT_PROTO_$getprotobyname_r_proto" ;;
13472 echo "Prototype: $try" ;;
13475 *) case "$usethreads" in
13476 define) echo "getprotobyname_r has no prototype, not using it." >&4 ;;
13478 d_getprotobyname_r=undef
13479 getprotobyname_r_proto=0
13483 *) getprotobyname_r_proto=0
13487 : see if getprotobynumber_r exists
13488 set getprotobynumber_r d_getprotobynumber_r
13490 case "$d_getprotobynumber_r" in
13492 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13493 case "$d_getprotobynumber_r_proto:$usethreads" in
13494 ":define") d_getprotobynumber_r_proto=define
13495 set d_getprotobynumber_r_proto getprotobynumber_r $hdrs
13499 case "$d_getprotobynumber_r_proto" in
13501 case "$getprotobynumber_r_proto" in
13502 ''|0) try='int getprotobynumber_r(int, struct protoent*, char*, size_t, struct protoent**);'
13503 ./protochk "extern $try" $hdrs && getprotobynumber_r_proto=I_ISBWR ;;
13505 case "$getprotobynumber_r_proto" in
13506 ''|0) try='struct protoent* getprotobynumber_r(int, struct protoent*, char*, int);'
13507 ./protochk "extern $try" $hdrs && getprotobynumber_r_proto=S_ISBI ;;
13509 case "$getprotobynumber_r_proto" in
13510 ''|0) try='int getprotobynumber_r(int, struct protoent*, struct protoent_data*);'
13511 ./protochk "extern $try" $hdrs && getprotobynumber_r_proto=I_ISD ;;
13513 case "$getprotobynumber_r_proto" in
13514 ''|0) d_getprotobynumber_r=undef
13515 getprotobynumber_r_proto=0
13516 echo "Disabling getprotobynumber_r, cannot determine prototype." >&4 ;;
13517 * ) case "$getprotobynumber_r_proto" in
13518 REENTRANT_PROTO*) ;;
13519 *) getprotobynumber_r_proto="REENTRANT_PROTO_$getprotobynumber_r_proto" ;;
13521 echo "Prototype: $try" ;;
13524 *) case "$usethreads" in
13525 define) echo "getprotobynumber_r has no prototype, not using it." >&4 ;;
13527 d_getprotobynumber_r=undef
13528 getprotobynumber_r_proto=0
13532 *) getprotobynumber_r_proto=0
13536 : see if getprotoent_r exists
13537 set getprotoent_r d_getprotoent_r
13539 case "$d_getprotoent_r" in
13541 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13542 case "$d_getprotoent_r_proto:$usethreads" in
13543 ":define") d_getprotoent_r_proto=define
13544 set d_getprotoent_r_proto getprotoent_r $hdrs
13548 case "$d_getprotoent_r_proto" in
13550 case "$getprotoent_r_proto" in
13551 ''|0) try='int getprotoent_r(struct protoent*, char*, size_t, struct protoent**);'
13552 ./protochk "extern $try" $hdrs && getprotoent_r_proto=I_SBWR ;;
13554 case "$getprotoent_r_proto" in
13555 ''|0) try='int getprotoent_r(struct protoent*, char*, int);'
13556 ./protochk "extern $try" $hdrs && getprotoent_r_proto=I_SBI ;;
13558 case "$getprotoent_r_proto" in
13559 ''|0) try='struct protoent* getprotoent_r(struct protoent*, char*, int);'
13560 ./protochk "extern $try" $hdrs && getprotoent_r_proto=S_SBI ;;
13562 case "$getprotoent_r_proto" in
13563 ''|0) try='int getprotoent_r(struct protoent*, struct protoent_data*);'
13564 ./protochk "extern $try" $hdrs && getprotoent_r_proto=I_SD ;;
13566 case "$getprotoent_r_proto" in
13567 ''|0) d_getprotoent_r=undef
13568 getprotoent_r_proto=0
13569 echo "Disabling getprotoent_r, cannot determine prototype." >&4 ;;
13570 * ) case "$getprotoent_r_proto" in
13571 REENTRANT_PROTO*) ;;
13572 *) getprotoent_r_proto="REENTRANT_PROTO_$getprotoent_r_proto" ;;
13574 echo "Prototype: $try" ;;
13577 *) case "$usethreads" in
13578 define) echo "getprotoent_r has no prototype, not using it." >&4 ;;
13580 d_getprotoent_r=undef
13581 getprotoent_r_proto=0
13585 *) getprotoent_r_proto=0
13589 : see if prototypes for various getprotoxxx netdb.h functions are available
13591 set d_getprotoprotos getprotoent $i_netdb netdb.h
13594 : see if getprpwnam exists
13595 set getprpwnam d_getprpwnam
13598 : see if getpwent exists
13599 set getpwent d_getpwent
13602 : see if getpwent_r exists
13603 set getpwent_r d_getpwent_r
13605 case "$d_getpwent_r" in
13607 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
13608 case "$d_getpwent_r_proto:$usethreads" in
13609 ":define") d_getpwent_r_proto=define
13610 set d_getpwent_r_proto getpwent_r $hdrs
13614 case "$d_getpwent_r_proto" in
13616 case "$getpwent_r_proto" in
13617 ''|0) try='int getpwent_r(struct passwd*, char*, size_t, struct passwd**);'
13618 ./protochk "extern $try" $hdrs && getpwent_r_proto=I_SBWR ;;
13620 case "$getpwent_r_proto" in
13621 ''|0) try='int getpwent_r(struct passwd*, char*, int, struct passwd**);'
13622 ./protochk "extern $try" $hdrs && getpwent_r_proto=I_SBIR ;;
13624 case "$getpwent_r_proto" in
13625 ''|0) try='struct passwd* getpwent_r(struct passwd*, char*, size_t);'
13626 ./protochk "extern $try" $hdrs && getpwent_r_proto=S_SBW ;;
13628 case "$getpwent_r_proto" in
13629 ''|0) try='struct passwd* getpwent_r(struct passwd*, char*, int);'
13630 ./protochk "extern $try" $hdrs && getpwent_r_proto=S_SBI ;;
13632 case "$getpwent_r_proto" in
13633 ''|0) try='int getpwent_r(struct passwd*, char*, int);'
13634 ./protochk "extern $try" $hdrs && getpwent_r_proto=I_SBI ;;
13636 case "$getpwent_r_proto" in
13637 ''|0) try='int getpwent_r(struct passwd*, char*, int, FILE**);'
13638 ./protochk "extern $try" $hdrs && getpwent_r_proto=I_SBIH ;;
13640 case "$getpwent_r_proto" in
13641 ''|0) d_getpwent_r=undef
13643 echo "Disabling getpwent_r, cannot determine prototype." >&4 ;;
13644 * ) case "$getpwent_r_proto" in
13645 REENTRANT_PROTO*) ;;
13646 *) getpwent_r_proto="REENTRANT_PROTO_$getpwent_r_proto" ;;
13648 echo "Prototype: $try" ;;
13651 *) case "$usethreads" in
13652 define) echo "getpwent_r has no prototype, not using it." >&4 ;;
13659 *) getpwent_r_proto=0
13663 : see if getpwnam_r exists
13664 set getpwnam_r d_getpwnam_r
13666 case "$d_getpwnam_r" in
13668 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
13669 case "$d_getpwnam_r_proto:$usethreads" in
13670 ":define") d_getpwnam_r_proto=define
13671 set d_getpwnam_r_proto getpwnam_r $hdrs
13675 case "$d_getpwnam_r_proto" in
13677 case "$getpwnam_r_proto" in
13678 ''|0) try='int getpwnam_r(const char*, struct passwd*, char*, size_t, struct passwd**);'
13679 ./protochk "extern $try" $hdrs && getpwnam_r_proto=I_CSBWR ;;
13681 case "$getpwnam_r_proto" in
13682 ''|0) try='int getpwnam_r(const char*, struct passwd*, char*, int, struct passwd**);'
13683 ./protochk "extern $try" $hdrs && getpwnam_r_proto=I_CSBIR ;;
13685 case "$getpwnam_r_proto" in
13686 ''|0) try='struct passwd* getpwnam_r(const char*, struct passwd*, char*, int);'
13687 ./protochk "extern $try" $hdrs && getpwnam_r_proto=S_CSBI ;;
13689 case "$getpwnam_r_proto" in
13690 ''|0) try='int getpwnam_r(const char*, struct passwd*, char*, int);'
13691 ./protochk "extern $try" $hdrs && getpwnam_r_proto=I_CSBI ;;
13693 case "$getpwnam_r_proto" in
13694 ''|0) d_getpwnam_r=undef
13696 echo "Disabling getpwnam_r, cannot determine prototype." >&4 ;;
13697 * ) case "$getpwnam_r_proto" in
13698 REENTRANT_PROTO*) ;;
13699 *) getpwnam_r_proto="REENTRANT_PROTO_$getpwnam_r_proto" ;;
13701 echo "Prototype: $try" ;;
13704 *) case "$usethreads" in
13705 define) echo "getpwnam_r has no prototype, not using it." >&4 ;;
13712 *) getpwnam_r_proto=0
13716 : see if getpwuid_r exists
13717 set getpwuid_r d_getpwuid_r
13719 case "$d_getpwuid_r" in
13721 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
13722 case "$d_getpwuid_r_proto:$usethreads" in
13723 ":define") d_getpwuid_r_proto=define
13724 set d_getpwuid_r_proto getpwuid_r $hdrs
13728 case "$d_getpwuid_r_proto" in
13730 case "$getpwuid_r_proto" in
13731 ''|0) try='int getpwuid_r(uid_t, struct passwd*, char*, size_t, struct passwd**);'
13732 ./protochk "extern $try" $hdrs && getpwuid_r_proto=I_TSBWR ;;
13734 case "$getpwuid_r_proto" in
13735 ''|0) try='int getpwuid_r(uid_t, struct passwd*, char*, int, struct passwd**);'
13736 ./protochk "extern $try" $hdrs && getpwuid_r_proto=I_TSBIR ;;
13738 case "$getpwuid_r_proto" in
13739 ''|0) try='int getpwuid_r(uid_t, struct passwd*, char*, int);'
13740 ./protochk "extern $try" $hdrs && getpwuid_r_proto=I_TSBI ;;
13742 case "$getpwuid_r_proto" in
13743 ''|0) try='struct passwd* getpwuid_r(uid_t, struct passwd*, char*, int);'
13744 ./protochk "extern $try" $hdrs && getpwuid_r_proto=S_TSBI ;;
13746 case "$getpwuid_r_proto" in
13747 ''|0) d_getpwuid_r=undef
13749 echo "Disabling getpwuid_r, cannot determine prototype." >&4 ;;
13750 * ) case "$getpwuid_r_proto" in
13751 REENTRANT_PROTO*) ;;
13752 *) getpwuid_r_proto="REENTRANT_PROTO_$getpwuid_r_proto" ;;
13754 echo "Prototype: $try" ;;
13757 *) case "$usethreads" in
13758 define) echo "getpwuid_r has no prototype, not using it." >&4 ;;
13765 *) getpwuid_r_proto=0
13770 : see if getservbyname exists
13771 set getservbyname d_getsbyname
13774 : see if getservbyport exists
13775 set getservbyport d_getsbyport
13778 : see if getservent exists
13779 set getservent d_getsent
13782 : see if getservbyname_r exists
13783 set getservbyname_r d_getservbyname_r
13785 case "$d_getservbyname_r" in
13787 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13788 case "$d_getservbyname_r_proto:$usethreads" in
13789 ":define") d_getservbyname_r_proto=define
13790 set d_getservbyname_r_proto getservbyname_r $hdrs
13794 case "$d_getservbyname_r_proto" in
13796 case "$getservbyname_r_proto" in
13797 ''|0) try='int getservbyname_r(const char*, const char*, struct servent*, char*, size_t, struct servent**);'
13798 ./protochk "extern $try" $hdrs && getservbyname_r_proto=I_CCSBWR ;;
13800 case "$getservbyname_r_proto" in
13801 ''|0) try='struct servent* getservbyname_r(const char*, const char*, struct servent*, char*, int);'
13802 ./protochk "extern $try" $hdrs && getservbyname_r_proto=S_CCSBI ;;
13804 case "$getservbyname_r_proto" in
13805 ''|0) try='int getservbyname_r(const char*, const char*, struct servent*, struct servent_data*);'
13806 ./protochk "extern $try" $hdrs && getservbyname_r_proto=I_CCSD ;;
13808 case "$getservbyname_r_proto" in
13809 ''|0) d_getservbyname_r=undef
13810 getservbyname_r_proto=0
13811 echo "Disabling getservbyname_r, cannot determine prototype." >&4 ;;
13812 * ) case "$getservbyname_r_proto" in
13813 REENTRANT_PROTO*) ;;
13814 *) getservbyname_r_proto="REENTRANT_PROTO_$getservbyname_r_proto" ;;
13816 echo "Prototype: $try" ;;
13819 *) case "$usethreads" in
13820 define) echo "getservbyname_r has no prototype, not using it." >&4 ;;
13822 d_getservbyname_r=undef
13823 getservbyname_r_proto=0
13827 *) getservbyname_r_proto=0
13831 : see if getservbyport_r exists
13832 set getservbyport_r d_getservbyport_r
13834 case "$d_getservbyport_r" in
13836 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13837 case "$d_getservbyport_r_proto:$usethreads" in
13838 ":define") d_getservbyport_r_proto=define
13839 set d_getservbyport_r_proto getservbyport_r $hdrs
13843 case "$d_getservbyport_r_proto" in
13845 case "$getservbyport_r_proto" in
13846 ''|0) try='int getservbyport_r(int, const char*, struct servent*, char*, size_t, struct servent**);'
13847 ./protochk "extern $try" $hdrs && getservbyport_r_proto=I_ICSBWR ;;
13849 case "$getservbyport_r_proto" in
13850 ''|0) try='struct servent* getservbyport_r(int, const char*, struct servent*, char*, int);'
13851 ./protochk "extern $try" $hdrs && getservbyport_r_proto=S_ICSBI ;;
13853 case "$getservbyport_r_proto" in
13854 ''|0) try='int getservbyport_r(int, const char*, struct servent*, struct servent_data*);'
13855 ./protochk "extern $try" $hdrs && getservbyport_r_proto=I_ICSD ;;
13857 case "$getservbyport_r_proto" in
13858 ''|0) d_getservbyport_r=undef
13859 getservbyport_r_proto=0
13860 echo "Disabling getservbyport_r, cannot determine prototype." >&4 ;;
13861 * ) case "$getservbyport_r_proto" in
13862 REENTRANT_PROTO*) ;;
13863 *) getservbyport_r_proto="REENTRANT_PROTO_$getservbyport_r_proto" ;;
13865 echo "Prototype: $try" ;;
13868 *) case "$usethreads" in
13869 define) echo "getservbyport_r has no prototype, not using it." >&4 ;;
13871 d_getservbyport_r=undef
13872 getservbyport_r_proto=0
13876 *) getservbyport_r_proto=0
13880 : see if getservent_r exists
13881 set getservent_r d_getservent_r
13883 case "$d_getservent_r" in
13885 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13886 case "$d_getservent_r_proto:$usethreads" in
13887 ":define") d_getservent_r_proto=define
13888 set d_getservent_r_proto getservent_r $hdrs
13892 case "$d_getservent_r_proto" in
13894 case "$getservent_r_proto" in
13895 ''|0) try='int getservent_r(struct servent*, char*, size_t, struct servent**);'
13896 ./protochk "extern $try" $hdrs && getservent_r_proto=I_SBWR ;;
13898 case "$getservent_r_proto" in
13899 ''|0) try='int getservent_r(struct servent*, char*, int);'
13900 ./protochk "extern $try" $hdrs && getservent_r_proto=I_SBI ;;
13902 case "$getservent_r_proto" in
13903 ''|0) try='struct servent* getservent_r(struct servent*, char*, int);'
13904 ./protochk "extern $try" $hdrs && getservent_r_proto=S_SBI ;;
13906 case "$getservent_r_proto" in
13907 ''|0) try='int getservent_r(struct servent*, struct servent_data*);'
13908 ./protochk "extern $try" $hdrs && getservent_r_proto=I_SD ;;
13910 case "$getservent_r_proto" in
13911 ''|0) d_getservent_r=undef
13912 getservent_r_proto=0
13913 echo "Disabling getservent_r, cannot determine prototype." >&4 ;;
13914 * ) case "$getservent_r_proto" in
13915 REENTRANT_PROTO*) ;;
13916 *) getservent_r_proto="REENTRANT_PROTO_$getservent_r_proto" ;;
13918 echo "Prototype: $try" ;;
13921 *) case "$usethreads" in
13922 define) echo "getservent_r has no prototype, not using it." >&4 ;;
13924 d_getservent_r=undef
13925 getservent_r_proto=0
13929 *) getservent_r_proto=0
13933 : see if prototypes for various getservxxx netdb.h functions are available
13935 set d_getservprotos getservent $i_netdb netdb.h
13938 : see if getspnam exists
13939 set getspnam d_getspnam
13942 : see if this is a shadow.h system
13943 set shadow.h i_shadow
13946 : see if getspnam_r exists
13947 set getspnam_r d_getspnam_r
13949 case "$d_getspnam_r" in
13951 hdrs="$i_systypes sys/types.h define stdio.h $i_shadow shadow.h"
13952 case "$d_getspnam_r_proto:$usethreads" in
13953 ":define") d_getspnam_r_proto=define
13954 set d_getspnam_r_proto getspnam_r $hdrs
13958 case "$d_getspnam_r_proto" in
13960 case "$getspnam_r_proto" in
13961 ''|0) try='int getspnam_r(const char*, struct spwd*, char*, size_t, struct spwd**);'
13962 ./protochk "extern $try" $hdrs && getspnam_r_proto=I_CSBWR ;;
13964 case "$getspnam_r_proto" in
13965 ''|0) try='struct spwd* getspnam_r(const char*, struct spwd*, char*, int);'
13966 ./protochk "extern $try" $hdrs && getspnam_r_proto=S_CSBI ;;
13968 case "$getspnam_r_proto" in
13969 ''|0) d_getspnam_r=undef
13971 echo "Disabling getspnam_r, cannot determine prototype." >&4 ;;
13972 * ) case "$getspnam_r_proto" in
13973 REENTRANT_PROTO*) ;;
13974 *) getspnam_r_proto="REENTRANT_PROTO_$getspnam_r_proto" ;;
13976 echo "Prototype: $try" ;;
13979 *) case "$usethreads" in
13980 define) echo "getspnam_r has no prototype, not using it." >&4 ;;
13987 *) getspnam_r_proto=0
13991 : see if gettimeofday or ftime exists
13992 set gettimeofday d_gettimeod
13994 case "$d_gettimeod" in
14000 val="$undef"; set d_ftime; eval $setvar
14003 case "$d_gettimeod$d_ftime" in
14006 echo 'No ftime() nor gettimeofday() -- timing may be less accurate.' >&4
14010 : see if gmtime_r exists
14011 set gmtime_r d_gmtime_r
14013 case "$d_gmtime_r" in
14015 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
14016 case "$d_gmtime_r_proto:$usethreads" in
14017 ":define") d_gmtime_r_proto=define
14018 set d_gmtime_r_proto gmtime_r $hdrs
14022 case "$d_gmtime_r_proto" in
14024 case "$gmtime_r_proto" in
14025 ''|0) try='struct tm* gmtime_r(const time_t*, struct tm*);'
14026 ./protochk "extern $try" $hdrs && gmtime_r_proto=S_TS ;;
14028 case "$gmtime_r_proto" in
14029 ''|0) try='int gmtime_r(const time_t*, struct tm*);'
14030 ./protochk "extern $try" $hdrs && gmtime_r_proto=I_TS ;;
14032 case "$gmtime_r_proto" in
14033 ''|0) d_gmtime_r=undef
14035 echo "Disabling gmtime_r, cannot determine prototype." >&4 ;;
14036 * ) case "$gmtime_r_proto" in
14037 REENTRANT_PROTO*) ;;
14038 *) gmtime_r_proto="REENTRANT_PROTO_$gmtime_r_proto" ;;
14040 echo "Prototype: $try" ;;
14043 *) case "$usethreads" in
14044 define) echo "gmtime_r has no prototype, not using it." >&4 ;;
14051 *) gmtime_r_proto=0
14055 : see if hasmntopt exists
14056 set hasmntopt d_hasmntopt
14059 : see if this is a netinet/in.h or sys/in.h system
14060 set netinet/in.h i_niin sys/in.h i_sysin
14063 : see if arpa/inet.h has to be included
14064 set arpa/inet.h i_arpainet
14067 : see if htonl --and friends-- exists
14072 : Maybe they are macros.
14075 $cat >htonl.c <<EOM
14077 #include <sys/types.h>
14078 #$i_niin I_NETINET_IN
14080 #$i_arpainet I_ARPA_INET
14081 #ifdef I_NETINET_IN
14082 #include <netinet/in.h>
14085 #include <sys/in.h>
14088 #include <arpa/inet.h>
14091 printf("Defined as a macro.");
14094 $cppstdin $cppflags $cppminus < htonl.c >htonl.E 2>/dev/null
14095 if $contains 'Defined as a macro' htonl.E >/dev/null 2>&1; then
14097 echo "But it seems to be defined as a macro." >&4
14105 : see if ilogbl exists
14106 set ilogbl d_ilogbl
14111 if set index val -f; eval $csym; $val; then
14112 if set strchr val -f d_strchr; eval $csym; $val; then
14113 if $contains strchr "$strings" >/dev/null 2>&1 ; then
14116 echo "strchr() found." >&4
14120 echo "index() found." >&4
14125 echo "index() found." >&4
14128 if set strchr val -f d_strchr; eval $csym; $val; then
14131 echo "strchr() found." >&4
14133 echo "No index() or strchr() found!" >&4
14138 set d_strchr; eval $setvar
14140 set d_index; eval $setvar
14142 : check whether inet_aton exists
14143 set inet_aton d_inetaton
14148 $cat >isascii.c <<EOCP
14151 #$i_stdlib I_STDLIB
14153 #include <stdlib.h>
14164 if eval $compile; then
14165 echo "isascii() found." >&4
14168 echo "isascii() NOT found." >&4
14175 : see if isfinite exists
14176 set isfinite d_isfinite
14179 : see if isinf exists
14183 : see if isnan exists
14187 : see if isnanl exists
14188 set isnanl d_isnanl
14191 : see if killpg exists
14192 set killpg d_killpg
14195 : see if lchown exists
14197 $cat > try.c <<'EOCP'
14198 /* System header to define __stub macros and hopefully few prototypes,
14199 which can conflict with char lchown(); below. */
14200 #include <assert.h>
14201 /* Override any gcc2 internal prototype to avoid an error. */
14202 /* We use char because int might match the return type of a gcc2
14203 builtin and then its argument prototype would still apply. */
14206 /* The GNU C library defines this for functions which it implements
14207 to always fail with ENOSYS. Some functions are actually named
14208 something starting with __ and the normal name is an alias. */
14209 #if defined (__stub_lchown) || defined (__stub___lchown)
14217 if eval $compile; then
14218 $echo "lchown() found." >&4
14221 $echo "lchown() NOT found." >&4
14227 : See if number of significant digits in a double precision number is known
14229 $cat >ldbl_dig.c <<EOM
14230 #$i_limits I_LIMITS
14233 #include <limits.h>
14239 printf("Contains LDBL_DIG");
14242 $cppstdin $cppflags $cppminus < ldbl_dig.c >ldbl_dig.E 2>/dev/null
14243 if $contains 'LDBL_DIG' ldbl_dig.E >/dev/null 2>&1; then
14244 echo "LDBL_DIG found." >&4
14247 echo "LDBL_DIG NOT found." >&4
14254 : see if this is a math.h system
14258 d_libm_lib_version="$undef"
14261 : check to see if math.h defines _LIB_VERSION
14263 echo "Checking to see if your libm supports _LIB_VERSION..." >&4
14265 #include <unistd.h>
14267 int main (int argc, char *argv[])
14269 printf ("%d\n", _LIB_VERSION);
14274 if eval $compile; then
14276 echo "Yes, it does ($foo)" >&4
14277 d_libm_lib_version="$define"
14279 echo "No, it does not (probably harmless)\n" >&4
14281 $rm -f try.* try core core.try.*
14286 : see if link exists
14290 : see if localtime_r exists
14291 set localtime_r d_localtime_r
14293 case "$d_localtime_r" in
14295 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
14296 case "$d_localtime_r_proto:$usethreads" in
14297 ":define") d_localtime_r_proto=define
14298 set d_localtime_r_proto localtime_r $hdrs
14302 case "$d_localtime_r_proto" in
14304 case "$localtime_r_proto" in
14305 ''|0) try='struct tm* localtime_r(const time_t*, struct tm*);'
14306 ./protochk "extern $try" $hdrs && localtime_r_proto=S_TS ;;
14308 case "$localtime_r_proto" in
14309 ''|0) try='int localtime_r(const time_t*, struct tm*);'
14310 ./protochk "extern $try" $hdrs && localtime_r_proto=I_TS ;;
14312 case "$localtime_r_proto" in
14313 ''|0) d_localtime_r=undef
14314 localtime_r_proto=0
14315 echo "Disabling localtime_r, cannot determine prototype." >&4 ;;
14316 * ) case "$localtime_r_proto" in
14317 REENTRANT_PROTO*) ;;
14318 *) localtime_r_proto="REENTRANT_PROTO_$localtime_r_proto" ;;
14320 echo "Prototype: $try" ;;
14323 *) case "$usethreads" in
14324 define) echo "localtime_r has no prototype, not using it." >&4 ;;
14326 d_localtime_r=undef
14327 localtime_r_proto=0
14331 *) localtime_r_proto=0
14335 : see if localeconv exists
14336 set localeconv d_locconv
14339 : see if lockf exists
14343 : see if prototype for lseek is available
14345 set d_lseekproto lseek $i_systypes sys/types.h $i_unistd unistd.h
14348 : see if lstat exists
14352 : see if madvise exists
14353 set madvise d_madvise
14356 : see if malloc_size exists
14357 set malloc_size d_malloc_size
14360 : see if malloc_size_good exists
14361 set malloc_good_size d_malloc_good_size
14364 : see if mblen exists
14368 : see if mbstowcs exists
14369 set mbstowcs d_mbstowcs
14372 : see if mbtowc exists
14373 set mbtowc d_mbtowc
14376 : see if memchr exists
14377 set memchr d_memchr
14380 : see if memcmp exists
14381 set memcmp d_memcmp
14384 : see if memcpy exists
14385 set memcpy d_memcpy
14388 : see if memmove exists
14389 set memmove d_memmove
14392 : see if memset exists
14393 set memset d_memset
14396 : see if mkdir exists
14400 : see if mkdtemp exists
14401 set mkdtemp d_mkdtemp
14404 : see if mkfifo exists
14405 set mkfifo d_mkfifo
14408 : see if mkstemp exists
14409 set mkstemp d_mkstemp
14412 : see if mkstemps exists
14413 set mkstemps d_mkstemps
14416 : see if mktime exists
14417 set mktime d_mktime
14420 : see if this is a sys/mman.h system
14421 set sys/mman.h i_sysmman
14424 : see if mmap exists
14427 : see what shmat returns
14428 : default to something harmless
14430 case "$i_sysmman$d_mmap" in
14432 $cat >mmap.c <<'END'
14433 #include <sys/mman.h>
14436 if $cc $ccflags -c mmap.c >/dev/null 2>&1; then
14441 echo "and it returns ($mmaptype)." >&4
14447 : see if sqrtl exists
14451 : see if scalbnl exists
14452 set scalbnl d_scalbnl
14455 : see if modfl exists
14459 : see if prototype for modfl is available
14461 set d_modflproto modfl $i_math math.h
14464 d_modfl_pow32_bug="$undef"
14466 case "$d_longdbl$d_modfl" in
14469 Checking to see whether your modfl() is okay for large values...
14475 if $test "X$d_modflproto" != "X$define"; then
14476 $cat >>try.c <<EOCP
14477 /* Sigh. many current glibcs provide the function, but do not prototype it. */
14478 long double modfl (long double, long double *);
14481 $cat >>try.c <<EOCP
14483 long double nv = 4294967303.15;
14489 printf(" %"$sPRIfldbl" %"$sPRIfldbl" %"$sPRIfldbl"\n", nv, v, w);
14493 case "$osname:$gccversion" in
14494 aix:) saveccflags="$ccflags"
14495 ccflags="$ccflags -qlongdouble" ;; # to avoid core dump
14498 if eval $compile; then
14501 *" 4294967303.150000 1.150000 4294967302.000000")
14502 echo >&4 "Your modfl() is broken for large values."
14503 d_modfl_pow32_bug="$define"
14505 glibc) echo >&4 "You should upgrade your glibc to at least 2.2.2 to get a fixed modfl()."
14509 *" 4294967303.150000 0.150000 4294967303.000000")
14510 echo >&4 "Your modfl() seems okay for large values."
14512 *) echo >&4 "I don't understand your modfl() at all."
14516 $rm -f try.* try core core.try.*
14518 echo "I cannot figure out whether your modfl() is okay, assuming it isn't."
14521 case "$osname:$gccversion" in
14522 aix:) ccflags="$saveccflags" ;; # restore
14527 if $test "$uselongdouble" = "$define"; then
14529 if $test "$d_sqrtl" != "$define"; then
14530 message="$message sqrtl"
14532 if $test "$d_modfl" != "$define"; then
14533 if $test "$d_aintl:$d_copysignl" = "$define:$define"; then
14534 echo "You have both aintl and copysignl, so I can emulate modfl."
14536 message="$message modfl"
14539 if $test "$d_frexpl" != "$define"; then
14540 if $test "$d_ilogbl:$d_scalbnl" = "$define:$define"; then
14541 echo "You have both ilogbl and scalbnl, so I can emulate frexpl."
14543 message="$message frexpl"
14547 if $test "$message" != ""; then
14550 *** You requested the use of long doubles but you do not seem to have
14551 *** the following mathematical functions needed for long double support:
14553 *** Please rerun Configure without -Duselongdouble and/or -Dusemorebits.
14554 *** Cannot continue, aborting.
14562 : see if mprotect exists
14563 set mprotect d_mprotect
14566 : see if msgctl exists
14567 set msgctl d_msgctl
14570 : see if msgget exists
14571 set msgget d_msgget
14574 : see if msgsnd exists
14575 set msgsnd d_msgsnd
14578 : see if msgrcv exists
14579 set msgrcv d_msgrcv
14582 : see how much of the 'msg*(2)' library is present.
14585 case "$d_msgctl$d_msgget$d_msgsnd$d_msgrcv" in
14586 *"$undef"*) h_msg=false;;
14590 case "`ipcs 2>&1`" in
14591 "SVID messages"*"not configured"*)
14592 echo "Your $osname does not have the msg*(2) configured." >&4
14595 set msgctl d_msgctl
14597 set msgget d_msgget
14599 set msgsnd d_msgsnd
14601 set msgrcv d_msgrcv
14607 : we could also check for sys/ipc.h ...
14608 if $h_msg && $test `./findhdr sys/msg.h`; then
14609 echo "You have the full msg*(2) library." >&4
14612 echo "You don't have the full msg*(2) library." >&4
14620 echo "Checking to see if your system supports struct msghdr..." >&4
14621 set d_msghdr_s msghdr $i_systypes sys/types.h $d_socket sys/socket.h $i_sysuio sys/uio.h
14623 case "$d_msghdr_s" in
14624 "$define") echo "Yes, it does." ;;
14625 *) echo "No, it doesn't." ;;
14629 : see if msync exists
14633 : see if munmap exists
14634 set munmap d_munmap
14637 : see if nice exists
14641 : see if this is a langinfo.h system
14642 set langinfo.h i_langinfo
14645 : see if nl_langinfo exists
14646 set nl_langinfo d_nl_langinfo
14649 : check for length of character
14651 case "$charsize" in
14653 echo "Checking to see how big your characters are (hey, you never know)..." >&4
14656 #$i_stdlib I_STDLIB
14658 #include <stdlib.h>
14662 printf("%d\n", (int)sizeof(char));
14667 if eval $compile_ok; then
14671 echo "(I can't seem to compile the test program. Guessing...)"
14678 rp="What is the size of a character (in bytes)?"
14683 : check for volatile keyword
14685 echo 'Checking to see if your C compiler knows about "volatile"...' >&4
14686 $cat >try.c <<'EOCP'
14689 typedef struct _goo_struct goo_struct;
14690 goo_struct * volatile goo = ((goo_struct *)0);
14691 struct _goo_struct {
14696 typedef unsigned short foo_t;
14697 char *volatile foo;
14699 volatile foo_t blech;
14703 if $cc -c $ccflags try.c >/dev/null 2>&1 ; then
14705 echo "Yup, it does."
14708 echo "Nope, it doesn't."
14716 $echo "Choosing the C types to be used for Perl's internal types..." >&4
14718 case "$use64bitint:$d_quad:$quadtype" in
14721 uvtype="$uquadtype"
14726 uvtype="unsigned long"
14732 case "$uselongdouble:$d_longdbl" in
14734 nvtype="long double"
14735 nvsize=$longdblsize
14742 $echo "(IV will be "$ivtype", $ivsize bytes)"
14743 $echo "(UV will be "$uvtype", $uvsize bytes)"
14744 $echo "(NV will be "$nvtype", $nvsize bytes)"
14747 #$i_inttypes I_INTTYPES
14749 #include <inttypes.h>
14754 int8_t i = INT8_MAX;
14755 uint8_t u = UINT8_MAX;
14756 printf("int8_t\n");
14759 int16_t i = INT16_MAX;
14760 uint16_t i = UINT16_MAX;
14761 printf("int16_t\n");
14764 int32_t i = INT32_MAX;
14765 uint32_t u = UINT32_MAX;
14766 printf("int32_t\n");
14772 '') case "$charsize" in
14774 u8type="unsigned char"
14783 if eval $compile; then
14784 case "`$run ./try`" in
14785 int8_t) i8type=int8_t
14795 '') if $test $charsize -ge 1; then
14797 u8type="unsigned char"
14805 '') case "$shortsize" in
14807 u16type="unsigned short"
14815 '') set try -DINT16
14816 if eval $compile; then
14817 case "`$run ./try`" in
14829 '') if $test $shortsize -ge 2; then
14831 u16type="unsigned short"
14839 '') case "$longsize" in
14841 u32type="unsigned long"
14845 *) case "$intsize" in
14847 u32type="unsigned int"
14857 '') set try -DINT32
14858 if eval $compile; then
14859 case "`$run ./try`" in
14871 '') if $test $intsize -ge 4; then
14873 u32type="unsigned int"
14881 '') case "$d_quad:$quadtype" in
14883 i64type="$quadtype"
14884 u64type="$uquadtype"
14892 $echo "Checking how many bits of your UVs your NVs can preserve..." >&4
14893 : volatile so that the compiler has to store it out to memory.
14894 if test X"$d_volatile" = X"$define"; then
14899 #$i_stdlib I_STDLIB
14901 #include <stdlib.h>
14903 #include <sys/types.h>
14904 #include <signal.h>
14906 $volatile int bletched = 0;
14907 $signal_t blech(s) int s; { bletched = 1; }
14912 int n = 8 * $uvsize;
14915 signal(SIGFPE, blech);
14918 for (i = 0; i < n; i++) {
14919 u = u << 1 | ($uvtype)1;
14921 if (($uvtype)d != u)
14925 d = ($nvtype)(u - 1);
14926 if (($uvtype)d != (u - 1))
14934 printf("%d\n", ((i == n) ? -n : i));
14940 d_nv_preserves_uv="$undef"
14941 if eval $compile; then
14942 nv_preserves_uv_bits="`$run ./try`"
14944 case "$nv_preserves_uv_bits" in
14946 nv_preserves_uv_bits=`expr 0 - $nv_preserves_uv_bits`
14947 $echo "Your NVs can preserve all $nv_preserves_uv_bits bits of your UVs." 2>&1
14948 d_nv_preserves_uv="$define"
14950 [1-9]*) $echo "Your NVs can preserve only $nv_preserves_uv_bits bits of your UVs." 2>&1
14951 d_nv_preserves_uv="$undef" ;;
14952 *) $echo "Can't figure out how many bits your NVs preserve." 2>&1
14953 nv_preserves_uv_bits="$undef" ;;
14958 $echo "Checking whether NV 0.0 is all bits zero in memory..." >&4
14959 : volatile so that the compiler has to store it out to memory.
14960 if test X"$d_volatile" = X"$define"; then
14965 #$i_stdlib I_STDLIB
14967 #include <stdlib.h>
14969 #$i_string I_STRING
14971 # include <string.h>
14973 # include <strings.h>
14975 #include <sys/types.h>
14976 #include <signal.h>
14978 $volatile int bletched = 0;
14979 $signal_t blech(s) int s; { bletched = 1; }
14982 int checkit($nvtype d, char *where) {
14983 unsigned char *p = (char *)&d;
14984 unsigned char *end = p + sizeof(d);
14994 printf("No - %s: 0x", where);
14996 printf ("%02X", *p++);
15001 int main(int argc, char **argv) {
15004 fail += checkit(d, "0.0");
15006 /* The compiler shouldn't be assuming that bletched is 0 */
15009 fail += checkit(d, "bleched");
15012 signal(SIGFPE, blech);
15015 /* Paranoia - the compiler should have no way of knowing that ANSI says
15016 that argv[argc] will always be NULL. Actually, if it did assume this it
15017 would be buggy, as this is C and main() can be called from elsewhere in
15019 d = argv[argc] ? 1 : 0;
15022 printf("Odd argv[argc]=%p, d=%g\n", argv[argc], d);
15025 fail += checkit(d, "ternary");
15027 memset(&d, sizeof(d), argv[argc] ? 1 : 0);
15030 printf("No - memset doesn't give 0.0\n");
15031 /* This might just blow up: */
15032 printf("(gives %g)\n", d);
15038 printf("No - something bleched\n");
15043 printf("No - %d fail(s)\n", fail);
15052 d_nv_zero_is_allbits_zero="$undef"
15053 if eval $compile; then
15059 0.0 is represented as all bits zero in memory
15061 d_nv_zero_is_allbits_zero="$define"
15064 0.0 is not represented as all bits zero in memory
15066 d_nv_zero_is_allbits_zero="$undef"
15071 0.0 is not represented as all bits zero in memory
15073 d_nv_zero_is_allbits_zero="$undef"
15081 : check for off64_t
15083 echo "Checking to see if you have off64_t..." >&4
15085 #include <sys/types.h>
15086 #include <unistd.h>
15087 int main() { off64_t x = 7; }
15090 if eval $compile; then
15092 echo "You have off64_t."
15095 echo "You do not have off64_t."
15096 case "$lseeksize" in
15097 8) echo "(Your off_t is 64 bits, so you could use that.)" ;;
15104 : how to create joinable pthreads
15105 if test "X$usethreads" = "X$define" -a "X$i_pthread" = "X$define"; then
15107 echo "Checking what constant to use for creating joinable pthreads..." >&4
15108 $cat >try.c <<'EOCP'
15109 #include <pthread.h>
15111 int detachstate = JOINABLE;
15114 set try -DJOINABLE=PTHREAD_CREATE_JOINABLE
15115 if eval $compile; then
15116 echo "You seem to use PTHREAD_CREATE_JOINABLE." >&4
15117 val="$undef" # Yes, undef.
15118 set d_old_pthread_create_joinable
15121 set old_pthread_create_joinable
15124 set try -DJOINABLE=PTHREAD_CREATE_UNDETACHED
15125 if eval $compile; then
15126 echo "You seem to use PTHREAD_CREATE_UNDETACHED." >&4
15128 set d_old_pthread_create_joinable
15130 val=PTHREAD_CREATE_UNDETACHED
15131 set old_pthread_create_joinable
15134 set try -DJOINABLE=__UNDETACHED
15135 if eval $compile; then
15136 echo "You seem to use __UNDETACHED." >&4
15138 set d_old_pthread_create_joinable
15141 set old_pthread_create_joinable
15144 echo "Egads, nothing obvious found. Guessing that you use 0." >&4
15146 set d_old_pthread_create_joinable
15149 set old_pthread_create_joinable
15156 d_old_pthread_create_joinable="$undef"
15157 old_pthread_create_joinable=""
15160 : see if pause exists
15164 : see if pipe exists
15168 : see if poll exists
15172 : see if readlink exists
15173 set readlink d_readlink
15179 case "$d_readlink" in
15181 if $issymlink /proc/self/exe ; then
15182 $ls -l /proc/self/exe > reflect
15183 if $contains /`basename $ls` reflect >/dev/null 2>&1; then
15184 echo "You have Linux-like /proc/self/exe."
15185 procselfexe='"/proc/self/exe"'
15189 if $issymlink /proc/curproc/file ; then
15190 $ls -l /proc/curproc/file > reflect
15191 if $contains /`basename $ls` reflect >/dev/null 2>&1; then
15192 echo "You have BSD-like /proc/curproc/file."
15193 procselfexe='"/proc/curproc/file"'
15203 : see whether the pthread_atfork exists
15205 #include <pthread.h>
15208 #ifdef PTHREAD_ATFORK
15209 pthread_atfork(NULL,NULL,NULL);
15214 : see if pthread_atfork exists
15215 set try -DPTHREAD_ATFORK
15216 if eval $compile; then
15221 case "$usethreads" in
15224 $define) echo 'pthread_atfork found.' >&4 ;;
15225 *) echo 'pthread_atfork NOT found.' >&4 ;;
15228 set d_pthread_atfork
15231 : see if pthread_attr_setscope exists
15232 set pthread_attr_setscope d_pthread_attr_setscope
15236 : see whether the various POSIXish _yields exist
15238 #include <pthread.h>
15244 #ifdef PTHREAD_YIELD
15247 #ifdef PTHREAD_YIELD_NULL
15248 pthread_yield(NULL);
15254 : see if sched_yield exists
15255 set try -DSCHED_YIELD
15256 if eval $compile; then
15258 sched_yield='sched_yield()'
15262 case "$usethreads" in
15265 $define) echo 'sched_yield() found.' >&4 ;;
15266 *) echo 'sched_yield() NOT found.' >&4 ;;
15272 : see if pthread_yield exists
15273 set try -DPTHREAD_YIELD
15274 if eval $compile; then
15276 case "$sched_yield" in
15277 '') sched_yield='pthread_yield()' ;;
15280 set try -DPTHREAD_YIELD_NULL
15281 if eval $compile; then
15283 case "$sched_yield" in
15284 '') sched_yield='pthread_yield(NULL)' ;;
15290 case "$usethreads" in
15293 $define) echo 'pthread_yield() found.' >&4 ;;
15294 *) echo 'pthread_yield() NOT found.' >&4 ;;
15298 set d_pthread_yield
15301 case "$sched_yield" in
15302 '') sched_yield=undef ;;
15307 : see if random_r exists
15308 set random_r d_random_r
15310 case "$d_random_r" in
15312 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
15313 case "$d_random_r_proto:$usethreads" in
15314 ":define") d_random_r_proto=define
15315 set d_random_r_proto random_r $hdrs
15319 case "$d_random_r_proto" in
15321 case "$random_r_proto" in
15322 ''|0) try='int random_r(int*, struct random_data*);'
15323 ./protochk "extern $try" $hdrs && random_r_proto=I_iS ;;
15325 case "$random_r_proto" in
15326 ''|0) try='int random_r(long*, struct random_data*);'
15327 ./protochk "extern $try" $hdrs && random_r_proto=I_lS ;;
15329 case "$random_r_proto" in
15330 ''|0) try='int random_r(struct random_data*, int32_t*);'
15331 ./protochk "extern $try" $hdrs && random_r_proto=I_St ;;
15333 case "$random_r_proto" in
15334 ''|0) d_random_r=undef
15336 echo "Disabling random_r, cannot determine prototype." >&4 ;;
15337 * ) case "$random_r_proto" in
15338 REENTRANT_PROTO*) ;;
15339 *) random_r_proto="REENTRANT_PROTO_$random_r_proto" ;;
15341 echo "Prototype: $try" ;;
15344 *) case "$usethreads" in
15345 define) echo "random_r has no prototype, not using it." >&4 ;;
15352 *) random_r_proto=0
15356 : see if readdir and friends exist
15357 set readdir d_readdir
15359 set seekdir d_seekdir
15361 set telldir d_telldir
15363 set rewinddir d_rewinddir
15366 : see if readdir64_r exists
15367 set readdir64_r d_readdir64_r
15369 case "$d_readdir64_r" in
15371 hdrs="$i_systypes sys/types.h define stdio.h $i_dirent dirent.h"
15372 case "$d_readdir64_r_proto:$usethreads" in
15373 ":define") d_readdir64_r_proto=define
15374 set d_readdir64_r_proto readdir64_r $hdrs
15378 case "$d_readdir64_r_proto" in
15380 case "$readdir64_r_proto" in
15381 ''|0) try='int readdir64_r(DIR*, struct dirent64*, struct dirent64**);'
15382 ./protochk "extern $try" $hdrs && readdir64_r_proto=I_TSR ;;
15384 case "$readdir64_r_proto" in
15385 ''|0) try='int readdir64_r(DIR*, struct dirent64*);'
15386 ./protochk "extern $try" $hdrs && readdir64_r_proto=I_TS ;;
15388 case "$readdir64_r_proto" in
15389 ''|0) d_readdir64_r=undef
15390 readdir64_r_proto=0
15391 echo "Disabling readdir64_r, cannot determine prototype." >&4 ;;
15392 * ) case "$readdir64_r_proto" in
15393 REENTRANT_PROTO*) ;;
15394 *) readdir64_r_proto="REENTRANT_PROTO_$readdir64_r_proto" ;;
15396 echo "Prototype: $try" ;;
15399 *) case "$usethreads" in
15400 define) echo "readdir64_r has no prototype, not using it." >&4 ;;
15402 d_readdir64_r=undef
15403 readdir64_r_proto=0
15407 *) readdir64_r_proto=0
15411 : see if readdir_r exists
15412 set readdir_r d_readdir_r
15414 case "$d_readdir_r" in
15416 hdrs="$i_systypes sys/types.h define stdio.h $i_dirent dirent.h"
15417 case "$d_readdir_r_proto:$usethreads" in
15418 ":define") d_readdir_r_proto=define
15419 set d_readdir_r_proto readdir_r $hdrs
15423 case "$d_readdir_r_proto" in
15425 case "$readdir_r_proto" in
15426 ''|0) try='int readdir_r(DIR*, struct dirent*, struct dirent**);'
15427 ./protochk "extern $try" $hdrs && readdir_r_proto=I_TSR ;;
15429 case "$readdir_r_proto" in
15430 ''|0) try='int readdir_r(DIR*, struct dirent*);'
15431 ./protochk "extern $try" $hdrs && readdir_r_proto=I_TS ;;
15433 case "$readdir_r_proto" in
15434 ''|0) d_readdir_r=undef
15436 echo "Disabling readdir_r, cannot determine prototype." >&4 ;;
15437 * ) case "$readdir_r_proto" in
15438 REENTRANT_PROTO*) ;;
15439 *) readdir_r_proto="REENTRANT_PROTO_$readdir_r_proto" ;;
15441 echo "Prototype: $try" ;;
15444 *) case "$usethreads" in
15445 define) echo "readdir_r has no prototype, not using it." >&4 ;;
15452 *) readdir_r_proto=0
15456 : see if readv exists
15460 : see if recvmsg exists
15461 set recvmsg d_recvmsg
15464 : see if rename exists
15465 set rename d_rename
15468 : see if rmdir exists
15472 : see if memory.h is available.
15477 : See if it conflicts with string.h
15483 $cppstdin $cppflags $cppminus < $strings > mem.h
15484 if $contains 'memcpy' mem.h >/dev/null 2>&1; then
15486 echo "We won't be including <memory.h>."
15496 : can bcopy handle overlapping blocks?
15499 case "$d_memmove" in
15500 "$define") echo "I'll use memmove() instead of bcopy() for overlapping copies." ;;
15501 *) case "$d_bcopy" in
15503 echo "Checking to see if bcopy() can do overlapping copies..." >&4
15505 #$i_memory I_MEMORY
15506 #$i_stdlib I_STDLIB
15507 #$i_string I_STRING
15508 #$i_unistd I_UNISTD
15510 $cat >>try.c <<'EOCP'
15513 # include <memory.h>
15516 # include <stdlib.h>
15519 # include <string.h>
15521 # include <strings.h>
15524 # include <unistd.h> /* Needed for NetBSD */
15528 char buf[128], abc[128];
15534 /* Copy "abcde..." string to char abc[] so that gcc doesn't
15535 try to store the string in read-only memory. */
15536 bcopy("abcdefghijklmnopqrstuvwxyz0123456789", abc, 36);
15538 for (align = 7; align >= 0; align--) {
15539 for (len = 36; len; len--) {
15541 bcopy(abc, b, len);
15542 for (off = 1; off <= len; off++) {
15543 bcopy(b, b+off, len);
15544 bcopy(b+off, b, len);
15545 if (bcmp(b, abc, len))
15554 if eval $compile_ok; then
15555 if ./try 2>/dev/null; then
15556 echo "Yes, it can."
15559 echo "It can't, sorry."
15562 echo "(I can't compile the test program, so we'll assume not...)"
15566 $rm -f try.* try core
15572 : can memcpy handle overlapping blocks?
15575 case "$d_memmove" in
15576 "$define") echo "I'll use memmove() instead of memcpy() for overlapping copies." ;;
15577 *) case "$d_memcpy" in
15579 echo "Checking to see if memcpy() can do overlapping copies..." >&4
15581 #$i_memory I_MEMORY
15582 #$i_stdlib I_STDLIB
15583 #$i_string I_STRING
15584 #$i_unistd I_UNISTD
15586 $cat >>try.c <<'EOCP'
15589 # include <memory.h>
15592 # include <stdlib.h>
15595 # include <string.h>
15597 # include <strings.h>
15600 # include <unistd.h> /* Needed for NetBSD */
15604 char buf[128], abc[128];
15610 /* Copy "abcde..." string to char abc[] so that gcc doesn't
15611 try to store the string in read-only memory. */
15612 memcpy(abc, "abcdefghijklmnopqrstuvwxyz0123456789", 36);
15614 for (align = 7; align >= 0; align--) {
15615 for (len = 36; len; len--) {
15617 memcpy(b, abc, len);
15618 for (off = 1; off <= len; off++) {
15619 memcpy(b+off, b, len);
15620 memcpy(b, b+off, len);
15621 if (memcmp(b, abc, len))
15630 if eval $compile_ok; then
15631 if ./try 2>/dev/null; then
15632 echo "Yes, it can."
15635 echo "It can't, sorry."
15638 echo "(I can't compile the test program, so we'll assume not...)"
15642 $rm -f try.* try core
15648 : can memcmp be trusted to compare relative magnitude?
15650 case "$d_memcmp" in
15653 echo "Checking if your memcmp() can compare relative magnitude..." >&4
15655 #$i_memory I_MEMORY
15656 #$i_stdlib I_STDLIB
15657 #$i_string I_STRING
15658 #$i_unistd I_UNISTD
15660 $cat >>try.c <<'EOCP'
15663 # include <memory.h>
15666 # include <stdlib.h>
15669 # include <string.h>
15671 # include <strings.h>
15674 # include <unistd.h> /* Needed for NetBSD */
15680 if ((a < b) && memcmp(&a, &b, 1) < 0)
15686 if eval $compile_ok; then
15687 if $run ./try 2>/dev/null; then
15688 echo "Yes, it can."
15691 echo "No, it can't (it uses signed chars)."
15694 echo "(I can't compile the test program, so we'll assume not...)"
15698 $rm -f try.* try core
15702 : see if prototype for sbrk is available
15704 set d_sbrkproto sbrk $i_unistd unistd.h
15707 : see if select exists
15708 set select d_select
15711 : see if semctl exists
15712 set semctl d_semctl
15715 : see if semget exists
15716 set semget d_semget
15719 : see if semop exists
15723 : see how much of the 'sem*(2)' library is present.
15726 case "$d_semctl$d_semget$d_semop" in
15727 *"$undef"*) h_sem=false;;
15731 case "`ipcs 2>&1`" in
15732 "SVID messages"*"not configured"*)
15733 echo "Your $osname does not have the sem*(2) configured." >&4
15736 set semctl d_semctl
15738 set semget d_semget
15746 : we could also check for sys/ipc.h ...
15747 if $h_sem && $test `./findhdr sys/sem.h`; then
15748 echo "You have the full sem*(2) library." >&4
15751 echo "You don't have the full sem*(2) library." >&4
15757 : see whether sys/sem.h defines union semun
15759 $cat > try.c <<'END'
15760 #include <sys/types.h>
15761 #include <sys/ipc.h>
15762 #include <sys/sem.h>
15763 int main () { union semun semun; semun.buf = 0; }
15766 if eval $compile; then
15767 echo "You have union semun in <sys/sem.h>." >&4
15770 echo "You do not have union semun in <sys/sem.h>." >&4
15777 : see how to do semctl IPC_STAT
15784 # define S_IRUSR S_IREAD
15785 # define S_IWUSR S_IWRITE
15786 # define S_IXUSR S_IEXEC
15788 # define S_IRUSR 0400
15789 # define S_IWUSR 0200
15790 # define S_IXUSR 0100
15792 # define S_IRGRP (S_IRUSR>>3)
15793 # define S_IWGRP (S_IWUSR>>3)
15794 # define S_IXGRP (S_IXUSR>>3)
15795 # define S_IROTH (S_IRUSR>>6)
15796 # define S_IWOTH (S_IWUSR>>6)
15797 # define S_IXOTH (S_IXUSR>>6)
15800 # define S_IRWXU (S_IRUSR|S_IWUSR|S_IXUSR)
15801 # define S_IRWXG (S_IRGRP|S_IWGRP|S_IXGRP)
15802 # define S_IRWXO (S_IROTH|S_IWOTH|S_IXOTH)
15805 : see whether semctl IPC_STAT can use union semun
15806 case "$d_semctl_semun" in
15810 #include <sys/types.h>
15811 #include <sys/ipc.h>
15812 #include <sys/sem.h>
15813 #include <sys/stat.h>
15820 #$d_union_semun HAS_UNION_SEMUN
15823 #ifndef HAS_UNION_SEMUN
15826 struct semid_ds *buf;
15827 unsigned short *array;
15833 #if defined(IPC_PRIVATE) && defined(S_IRWXU) && defined(S_IRWXG) && defined(S_IRWXO) && defined(IPC_CREAT)
15834 sem = semget(IPC_PRIVATE, 1, S_IRWXU|S_IRWXG|S_IRWXO|IPC_CREAT);
15836 struct semid_ds argbuf;
15839 st = semctl(sem, 0, IPC_STAT, arg);
15843 # endif /* IPC_STAT */
15844 printf("semctl IPC_STAT failed: errno = %d\n", errno);
15846 if (semctl(sem, 0, IPC_RMID, arg) != 0)
15847 # endif /* IPC_RMID */
15848 printf("semctl IPC_RMID failed: errno = %d\n", errno);
15850 #endif /* IPC_PRIVATE && ... */
15851 printf("semget failed: errno = %d\n", errno);
15856 if eval $compile; then
15859 semun) val="$define" ;;
15867 case "$d_semctl_semun" in
15869 echo "You can use union semun for semctl IPC_STAT." >&4
15872 *) echo "You cannot use union semun for semctl IPC_STAT." >&4
15877 : see whether semctl IPC_STAT can use struct semid_ds pointer
15878 case "$d_semctl_semid_ds" in
15881 $cat > try.c <<'END'
15882 #include <sys/types.h>
15883 #include <sys/ipc.h>
15884 #include <sys/sem.h>
15885 #include <sys/stat.h>
15893 struct semid_ds arg;
15896 #if defined(IPC_PRIVATE) && defined(S_IRWXU) && defined(S_IRWXG) && defined(S_IRWXO) && defined(IPC_CREAT)
15897 sem = semget(IPC_PRIVATE, 1, S_IRWXU|S_IRWXG|S_IRWXO|IPC_CREAT);
15900 st = semctl(sem, 0, IPC_STAT, &arg);
15902 printf("semid_ds\n");
15904 # endif /* IPC_STAT */
15905 printf("semctl IPC_STAT failed: errno = %d\n", errno);
15907 if (semctl(sem, 0, IPC_RMID, &arg) != 0)
15908 # endif /* IPC_RMID */
15909 printf("semctl IPC_RMID failed: errno = %d\n", errno);
15911 #endif /* IPC_PRIVATE && ... */
15912 printf("semget failed: errno = %d\n", errno);
15918 if eval $compile; then
15921 semid_ds) val="$define" ;;
15925 set d_semctl_semid_ds
15929 case "$d_semctl_semid_ds" in
15931 echo "You can $also use struct semid_ds* for semctl IPC_STAT." >&4
15933 *) echo "You cannot use struct semid_ds* for semctl IPC_STAT." >&4
15940 # We do not have the full sem*(2) library, so assume we can not
15946 set d_semctl_semid_ds
15951 : see if sendmsg exists
15952 set sendmsg d_sendmsg
15955 : see if setegid exists
15956 set setegid d_setegid
15959 : see if seteuid exists
15960 set seteuid d_seteuid
15963 : see if setgrent exists
15964 set setgrent d_setgrent
15967 : see if setgrent_r exists
15968 set setgrent_r d_setgrent_r
15970 case "$d_setgrent_r" in
15972 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
15973 case "$d_setgrent_r_proto:$usethreads" in
15974 ":define") d_setgrent_r_proto=define
15975 set d_setgrent_r_proto setgrent_r $hdrs
15979 case "$d_setgrent_r_proto" in
15981 case "$setgrent_r_proto" in
15982 ''|0) try='int setgrent_r(FILE**);'
15983 ./protochk "extern $try" $hdrs && setgrent_r_proto=I_H ;;
15985 case "$setgrent_r_proto" in
15986 ''|0) try='void setgrent_r(FILE**);'
15987 ./protochk "extern $try" $hdrs && setgrent_r_proto=V_H ;;
15989 case "$setgrent_r_proto" in
15990 ''|0) d_setgrent_r=undef
15992 echo "Disabling setgrent_r, cannot determine prototype." >&4 ;;
15993 * ) case "$setgrent_r_proto" in
15994 REENTRANT_PROTO*) ;;
15995 *) setgrent_r_proto="REENTRANT_PROTO_$setgrent_r_proto" ;;
15997 echo "Prototype: $try" ;;
16000 *) case "$usethreads" in
16001 define) echo "setgrent_r has no prototype, not using it." >&4 ;;
16008 *) setgrent_r_proto=0
16012 : see if sethostent exists
16013 set sethostent d_sethent
16016 : see if sethostent_r exists
16017 set sethostent_r d_sethostent_r
16019 case "$d_sethostent_r" in
16021 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
16022 case "$d_sethostent_r_proto:$usethreads" in
16023 ":define") d_sethostent_r_proto=define
16024 set d_sethostent_r_proto sethostent_r $hdrs
16028 case "$d_sethostent_r_proto" in
16030 case "$sethostent_r_proto" in
16031 ''|0) try='int sethostent_r(int, struct hostent_data*);'
16032 ./protochk "extern $try" $hdrs && sethostent_r_proto=I_ID ;;
16034 case "$sethostent_r_proto" in
16035 ''|0) try='void sethostent_r(int, struct hostent_data*);'
16036 ./protochk "extern $try" $hdrs && sethostent_r_proto=V_ID ;;
16038 case "$sethostent_r_proto" in
16039 ''|0) d_sethostent_r=undef
16040 sethostent_r_proto=0
16041 echo "Disabling sethostent_r, cannot determine prototype." >&4 ;;
16042 * ) case "$sethostent_r_proto" in
16043 REENTRANT_PROTO*) ;;
16044 *) sethostent_r_proto="REENTRANT_PROTO_$sethostent_r_proto" ;;
16046 echo "Prototype: $try" ;;
16049 *) case "$usethreads" in
16050 define) echo "sethostent_r has no prototype, not using it." >&4 ;;
16052 d_sethostent_r=undef
16053 sethostent_r_proto=0
16057 *) sethostent_r_proto=0
16061 : see if setitimer exists
16062 set setitimer d_setitimer
16065 : see if setlinebuf exists
16066 set setlinebuf d_setlinebuf
16069 : see if setlocale exists
16070 set setlocale d_setlocale
16073 : see if locale.h is available
16074 set locale.h i_locale
16077 : see if setlocale_r exists
16078 set setlocale_r d_setlocale_r
16080 case "$d_setlocale_r" in
16082 hdrs="$i_systypes sys/types.h define stdio.h $i_locale locale.h"
16083 case "$d_setlocale_r_proto:$usethreads" in
16084 ":define") d_setlocale_r_proto=define
16085 set d_setlocale_r_proto setlocale_r $hdrs
16089 case "$d_setlocale_r_proto" in
16091 case "$setlocale_r_proto" in
16092 ''|0) try='int setlocale_r(int, const char*, char*, int);'
16093 ./protochk "extern $try" $hdrs && setlocale_r_proto=I_ICBI ;;
16095 case "$setlocale_r_proto" in
16096 ''|0) d_setlocale_r=undef
16097 setlocale_r_proto=0
16098 echo "Disabling setlocale_r, cannot determine prototype." >&4 ;;
16099 * ) case "$setlocale_r_proto" in
16100 REENTRANT_PROTO*) ;;
16101 *) setlocale_r_proto="REENTRANT_PROTO_$setlocale_r_proto" ;;
16103 echo "Prototype: $try" ;;
16106 *) case "$usethreads" in
16107 define) echo "setlocale_r has no prototype, not using it." >&4 ;;
16109 d_setlocale_r=undef
16110 setlocale_r_proto=0
16114 *) setlocale_r_proto=0
16118 : see if setnetent exists
16119 set setnetent d_setnent
16122 : see if setnetent_r exists
16123 set setnetent_r d_setnetent_r
16125 case "$d_setnetent_r" in
16127 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
16128 case "$d_setnetent_r_proto:$usethreads" in
16129 ":define") d_setnetent_r_proto=define
16130 set d_setnetent_r_proto setnetent_r $hdrs
16134 case "$d_setnetent_r_proto" in
16136 case "$setnetent_r_proto" in
16137 ''|0) try='int setnetent_r(int, struct netent_data*);'
16138 ./protochk "extern $try" $hdrs && setnetent_r_proto=I_ID ;;
16140 case "$setnetent_r_proto" in
16141 ''|0) try='void setnetent_r(int, struct netent_data*);'
16142 ./protochk "extern $try" $hdrs && setnetent_r_proto=V_ID ;;
16144 case "$setnetent_r_proto" in
16145 ''|0) d_setnetent_r=undef
16146 setnetent_r_proto=0
16147 echo "Disabling setnetent_r, cannot determine prototype." >&4 ;;
16148 * ) case "$setnetent_r_proto" in
16149 REENTRANT_PROTO*) ;;
16150 *) setnetent_r_proto="REENTRANT_PROTO_$setnetent_r_proto" ;;
16152 echo "Prototype: $try" ;;
16155 *) case "$usethreads" in
16156 define) echo "setnetent_r has no prototype, not using it." >&4 ;;
16158 d_setnetent_r=undef
16159 setnetent_r_proto=0
16163 *) setnetent_r_proto=0
16167 : see if setprotoent exists
16168 set setprotoent d_setpent
16171 : see if setpgid exists
16172 set setpgid d_setpgid
16175 : see if setpgrp2 exists
16176 set setpgrp2 d_setpgrp2
16179 : see if setpriority exists
16180 set setpriority d_setprior
16183 : see if setproctitle exists
16184 set setproctitle d_setproctitle
16187 : see if setprotoent_r exists
16188 set setprotoent_r d_setprotoent_r
16190 case "$d_setprotoent_r" in
16192 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
16193 case "$d_setprotoent_r_proto:$usethreads" in
16194 ":define") d_setprotoent_r_proto=define
16195 set d_setprotoent_r_proto setprotoent_r $hdrs
16199 case "$d_setprotoent_r_proto" in
16201 case "$setprotoent_r_proto" in
16202 ''|0) try='int setprotoent_r(int, struct protoent_data*);'
16203 ./protochk "extern $try" $hdrs && setprotoent_r_proto=I_ID ;;
16205 case "$setprotoent_r_proto" in
16206 ''|0) try='void setprotoent_r(int, struct protoent_data*);'
16207 ./protochk "extern $try" $hdrs && setprotoent_r_proto=V_ID ;;
16209 case "$setprotoent_r_proto" in
16210 ''|0) d_setprotoent_r=undef
16211 setprotoent_r_proto=0
16212 echo "Disabling setprotoent_r, cannot determine prototype." >&4 ;;
16213 * ) case "$setprotoent_r_proto" in
16214 REENTRANT_PROTO*) ;;
16215 *) setprotoent_r_proto="REENTRANT_PROTO_$setprotoent_r_proto" ;;
16217 echo "Prototype: $try" ;;
16220 *) case "$usethreads" in
16221 define) echo "setprotoent_r has no prototype, not using it." >&4 ;;
16223 d_setprotoent_r=undef
16224 setprotoent_r_proto=0
16228 *) setprotoent_r_proto=0
16232 : see if setpwent exists
16233 set setpwent d_setpwent
16236 : see if setpwent_r exists
16237 set setpwent_r d_setpwent_r
16239 case "$d_setpwent_r" in
16241 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
16242 case "$d_setpwent_r_proto:$usethreads" in
16243 ":define") d_setpwent_r_proto=define
16244 set d_setpwent_r_proto setpwent_r $hdrs
16248 case "$d_setpwent_r_proto" in
16250 case "$setpwent_r_proto" in
16251 ''|0) try='int setpwent_r(FILE**);'
16252 ./protochk "extern $try" $hdrs && setpwent_r_proto=I_H ;;
16254 case "$setpwent_r_proto" in
16255 ''|0) try='void setpwent_r(FILE**);'
16256 ./protochk "extern $try" $hdrs && setpwent_r_proto=V_H ;;
16258 case "$setpwent_r_proto" in
16259 ''|0) d_setpwent_r=undef
16261 echo "Disabling setpwent_r, cannot determine prototype." >&4 ;;
16262 * ) case "$setpwent_r_proto" in
16263 REENTRANT_PROTO*) ;;
16264 *) setpwent_r_proto="REENTRANT_PROTO_$setpwent_r_proto" ;;
16266 echo "Prototype: $try" ;;
16269 *) case "$usethreads" in
16270 define) echo "setpwent_r has no prototype, not using it." >&4 ;;
16277 *) setpwent_r_proto=0
16281 : see if setregid exists
16282 set setregid d_setregid
16284 set setresgid d_setresgid
16287 : see if setreuid exists
16288 set setreuid d_setreuid
16290 set setresuid d_setresuid
16293 : see if setrgid exists
16294 set setrgid d_setrgid
16297 : see if setruid exists
16298 set setruid d_setruid
16301 : see if setservent exists
16302 set setservent d_setsent
16305 : see if setservent_r exists
16306 set setservent_r d_setservent_r
16308 case "$d_setservent_r" in
16310 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
16311 case "$d_setservent_r_proto:$usethreads" in
16312 ":define") d_setservent_r_proto=define
16313 set d_setservent_r_proto setservent_r $hdrs
16317 case "$d_setservent_r_proto" in
16319 case "$setservent_r_proto" in
16320 ''|0) try='int setservent_r(int, struct servent_data*);'
16321 ./protochk "extern $try" $hdrs && setservent_r_proto=I_ID ;;
16323 case "$setservent_r_proto" in
16324 ''|0) try='void setservent_r(int, struct servent_data*);'
16325 ./protochk "extern $try" $hdrs && setservent_r_proto=V_ID ;;
16327 case "$setservent_r_proto" in
16328 ''|0) d_setservent_r=undef
16329 setservent_r_proto=0
16330 echo "Disabling setservent_r, cannot determine prototype." >&4 ;;
16331 * ) case "$setservent_r_proto" in
16332 REENTRANT_PROTO*) ;;
16333 *) setservent_r_proto="REENTRANT_PROTO_$setservent_r_proto" ;;
16335 echo "Prototype: $try" ;;
16338 *) case "$usethreads" in
16339 define) echo "setservent_r has no prototype, not using it." >&4 ;;
16341 d_setservent_r=undef
16342 setservent_r_proto=0
16346 *) setservent_r_proto=0
16350 : see if setsid exists
16351 set setsid d_setsid
16354 : see if setvbuf exists
16355 set setvbuf d_setvbuf
16358 : see if sfio.h is available
16363 : see if sfio library is available
16374 : Ok, but do we want to use it.
16378 true|$define|[yY]*) dflt='y';;
16381 echo "$package can use the sfio library, but it is experimental."
16382 case "$useperlio" in
16384 echo "For sfio also the PerlIO abstraction layer is needed."
16385 echo "Earlier you said you wouldn't want that."
16388 rp="You seem to have sfio available, do you want to try using it?"
16391 y|Y) echo "Ok, turning on both sfio and PerlIO, then."
16392 useperlio="$define"
16395 *) echo "Ok, avoiding sfio this time. I'll use stdio instead."
16400 *) case "$usesfio" in
16401 true|$define|[yY]*)
16402 echo "Sorry, cannot find sfio on this machine." >&4
16403 echo "Ignoring your setting of usesfio=$usesfio." >&4
16412 $define) usesfio='true';;
16413 *) usesfio='false';;
16417 *) : Remove sfio from list of libraries to use
16420 echo "Removing unneeded -lsfio from library list" >&4
16421 set `echo X $libs | $sed -e 's/-lsfio / /' -e 's/-lsfio$//'`
16424 echo "libs = $libs" >&4
16431 : see if shmctl exists
16432 set shmctl d_shmctl
16435 : see if shmget exists
16436 set shmget d_shmget
16439 : see if shmat exists
16442 : see what shmat returns
16445 $cat >shmat.c <<'END'
16446 #include <sys/shm.h>
16449 if $cc $ccflags -c shmat.c >/dev/null 2>&1; then
16454 echo "and it returns ($shmattype)." >&4
16455 : see if a prototype for shmat is available
16456 xxx=`./findhdr sys/shm.h`
16457 $cppstdin $cppflags $cppminus < $xxx > shmat.c 2>/dev/null
16458 if $contains 'shmat.*(' shmat.c >/dev/null 2>&1; then
16469 set d_shmatprototype
16472 : see if shmdt exists
16476 : see how much of the 'shm*(2)' library is present.
16479 case "$d_shmctl$d_shmget$d_shmat$d_shmdt" in
16480 *"$undef"*) h_shm=false;;
16484 case "`ipcs 2>&1`" in
16485 "SVID shared memory"*"not configured"*)
16486 echo "Your $osname does not have the shm*(2) configured." >&4
16489 set shmctl d_shmctl
16491 set shmget d_shmget
16501 : we could also check for sys/ipc.h ...
16502 if $h_shm && $test `./findhdr sys/shm.h`; then
16503 echo "You have the full shm*(2) library." >&4
16506 echo "You don't have the full shm*(2) library." >&4
16513 : see if we have sigaction
16514 if set sigaction val -f d_sigaction; eval $csym; $val; then
16515 echo 'sigaction() found.' >&4
16518 #include <sys/types.h>
16519 #include <signal.h>
16520 #$i_stdlib I_STDLIB
16522 #include <stdlib.h>
16526 struct sigaction act, oact;
16528 oact.sa_handler = 0;
16529 /* so that act and oact are used */
16530 exit(act.sa_flags == 0 && oact.sa_handler == 0);
16534 if eval $compile_ok; then
16537 echo "But you don't seem to have a useable struct sigaction." >&4
16541 echo 'sigaction NOT found.' >&4
16544 set d_sigaction; eval $setvar
16545 $rm -f try try$_o try.c
16547 : see if sigprocmask exists
16548 set sigprocmask d_sigprocmask
16551 : see if sigsetjmp exists
16553 case "$d_sigsetjmp" in
16556 #include <setjmp.h>
16557 #$i_stdlib I_STDLIB
16559 #include <stdlib.h>
16565 if (sigsetjmp(env,1))
16568 siglongjmp(env, 1);
16573 if eval $compile; then
16574 if $run ./try >/dev/null 2>&1; then
16575 echo "POSIX sigsetjmp found." >&4
16579 Uh-Oh! You have POSIX sigsetjmp and siglongjmp, but they do not work properly!!
16585 echo "sigsetjmp not found." >&4
16589 *) val="$d_sigsetjmp"
16590 case "$d_sigsetjmp" in
16591 $define) echo "POSIX sigsetjmp found." >&4;;
16592 $undef) echo "sigsetjmp not found." >&4;;
16600 : see if snprintf exists
16601 set snprintf d_snprintf
16604 : see if vsnprintf exists
16605 set vsnprintf d_vsnprintf
16608 case "$d_snprintf-$d_vsnprintf" in
16611 Checking whether your snprintf() and vsnprintf() work okay...
16613 $cat >try.c <<'EOCP'
16614 /* v?snprintf testing logic courtesy of Russ Allbery.
16615 * According to C99:
16616 * - if the buffer is too short it still must be \0-terminated
16617 * - if the buffer is too short the potentially required length
16618 * must be returned and not -1
16619 * - if the buffer is NULL the potentially required length
16620 * must be returned and not -1 or core dump
16623 #include <stdarg.h>
16627 int test (char *format, ...)
16632 va_start (args, format);
16633 count = vsnprintf (buf, sizeof buf, format, args);
16640 return ((test ("%s", "abcd") == 4 && buf[0] == 'a' && buf[1] == '\0'
16641 && snprintf (NULL, 0, "%s", "abcd") == 4) ? 0 : 1);
16645 if eval $compile; then
16648 0) echo "Your snprintf() and vsnprintf() seem to be working okay." ;;
16650 Your snprintf() and snprintf() don't seem to be working okay.
16652 d_snprintf="$undef"
16653 d_vsnprintf="$undef"
16657 echo "(I can't seem to compile the test program--assuming they don't)"
16658 d_snprintf="$undef"
16659 d_vsnprintf="$undef"
16661 $rm -f try.* try core core.try.*
16665 : see if sockatmark exists
16666 set sockatmark d_sockatmark
16669 : see if prototype for sockatmark is available
16671 set d_sockatmarkproto sockatmark $d_socket sys/socket.h
16674 : see if socks5_init exists
16675 set socks5_init d_socks5_init
16678 : see if sprintf returns the length of the string in the buffer as per ANSI
16679 $echo "Checking whether sprintf returns the length of the string..." >&4
16682 #$i_stdlib I_STDLIB
16684 #include <stdlib.h>
16686 #$i_string I_STRING
16688 # include <string.h>
16690 # include <strings.h>
16699 int check (size_t expect, int test) {
16700 size_t got = strlen(buffer);
16704 printf("expected %ld, got %ld in test %d '%s'\n", (long) expect, (long) got,
16709 int main(int argc, char **argv) {
16712 check(sprintf(buffer, ""), ++test);
16713 check(sprintf(buffer, "%s %s", "perl", "rules"), ++test);
16714 check(sprintf(buffer, "I like %g", atan2(0,-1)), ++test);
16721 d_sprintf_returns_strlen="$undef"
16722 if eval $compile; then
16726 sprintf returns the length of the string (as ANSI says it should)
16728 d_sprintf_returns_strlen="$define"
16731 sprintf does not return the length of the string (how old is this system?)
16733 d_sprintf_returns_strlen="$undef"
16740 : see if srand48_r exists
16741 set srand48_r d_srand48_r
16743 case "$d_srand48_r" in
16745 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
16746 case "$d_srand48_r_proto:$usethreads" in
16747 ":define") d_srand48_r_proto=define
16748 set d_srand48_r_proto srand48_r $hdrs
16752 case "$d_srand48_r_proto" in
16754 case "$srand48_r_proto" in
16755 ''|0) try='int srand48_r(long, struct drand48_data*);'
16756 ./protochk "extern $try" $hdrs && srand48_r_proto=I_LS ;;
16758 case "$srand48_r_proto" in
16759 ''|0) d_srand48_r=undef
16761 echo "Disabling srand48_r, cannot determine prototype." >&4 ;;
16762 * ) case "$srand48_r_proto" in
16763 REENTRANT_PROTO*) ;;
16764 *) srand48_r_proto="REENTRANT_PROTO_$srand48_r_proto" ;;
16766 echo "Prototype: $try" ;;
16769 *) case "$usethreads" in
16770 define) echo "srand48_r has no prototype, not using it." >&4 ;;
16777 *) srand48_r_proto=0
16781 : see if srandom_r exists
16782 set srandom_r d_srandom_r
16784 case "$d_srandom_r" in
16786 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
16787 case "$d_srandom_r_proto:$usethreads" in
16788 ":define") d_srandom_r_proto=define
16789 set d_srandom_r_proto srandom_r $hdrs
16793 case "$d_srandom_r_proto" in
16795 case "$srandom_r_proto" in
16796 ''|0) try='int srandom_r(unsigned int, struct random_data*);'
16797 ./protochk "extern $try" $hdrs && srandom_r_proto=I_TS ;;
16799 case "$srandom_r_proto" in
16800 ''|0) d_srandom_r=undef
16802 echo "Disabling srandom_r, cannot determine prototype." >&4 ;;
16803 * ) case "$srandom_r_proto" in
16804 REENTRANT_PROTO*) ;;
16805 *) srandom_r_proto="REENTRANT_PROTO_$srandom_r_proto" ;;
16807 echo "Prototype: $try" ;;
16810 *) case "$usethreads" in
16811 define) echo "srandom_r has no prototype, not using it." >&4 ;;
16818 *) srandom_r_proto=0
16822 : see if prototype for setresgid is available
16824 set d_sresgproto setresgid $i_unistd unistd.h
16827 : see if prototype for setresuid is available
16829 set d_sresuproto setresuid $i_unistd unistd.h
16832 : see if sys/stat.h is available
16833 set sys/stat.h i_sysstat
16837 : see if stat knows about block sizes
16839 echo "Checking to see if your struct stat has st_blocks field..." >&4
16840 set d_statblks stat st_blocks $i_sysstat sys/stat.h
16844 : see if this is a sys/vfs.h system
16845 set sys/vfs.h i_sysvfs
16849 : see if this is a sys/statfs.h system
16850 set sys/statfs.h i_sysstatfs
16855 echo "Checking to see if your system supports struct statfs..." >&4
16856 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
16858 case "$d_statfs_s" in
16859 "$define") echo "Yes, it does." ;;
16860 *) echo "No, it doesn't." ;;
16865 : see if struct statfs knows about f_flags
16866 case "$d_statfs_s" in
16869 echo "Checking to see if your struct statfs has f_flags field..." >&4
16870 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
16874 set d_statfs_f_flags
16878 case "$d_statfs_f_flags" in
16879 "$define") echo "Yes, it does." ;;
16880 *) echo "No, it doesn't." ;;
16884 Checking how to access stdio streams by file descriptor number...
16886 case "$stdio_stream_array" in
16887 '') $cat >try.c <<EOCP
16890 if (&STDIO_STREAM_ARRAY[fileno(stdin)] == stdin)
16894 for s in _iob __iob __sF
16896 set try -DSTDIO_STREAM_ARRAY=$s
16897 if eval $compile; then
16898 case "`$run ./try`" in
16899 yes) stdio_stream_array=$s; break ;;
16903 $rm -f try.* try$exe_ext
16905 case "$stdio_stream_array" in
16907 I can't figure out how to access stdio streams by file descriptor number.
16909 d_stdio_stream_array="$undef"
16912 You can access stdio streams by file descriptor number by the $stdio_stream_array array.
16914 d_stdio_stream_array="$define"
16918 : see if strcoll exists
16919 set strcoll d_strcoll
16922 : check for structure copying
16924 echo "Checking to see if your C compiler can copy structs..." >&4
16925 $cat >try.c <<'EOCP'
16935 if $cc -c try.c >/dev/null 2>&1 ; then
16937 echo "Yup, it can."
16940 echo "Nope, it can't."
16946 : see if strerror and/or sys_errlist[] exist
16948 if test "X$d_strerror" = X -o "X$d_syserrlst" = X; then
16949 if set strerror val -f d_strerror; eval $csym; $val; then
16950 echo 'strerror() found.' >&4
16951 d_strerror="$define"
16952 d_strerrm='strerror(e)'
16953 if set sys_errlist val -a d_syserrlst; eval $csym; $val; then
16954 echo "(You also have sys_errlist[], so we could roll our own strerror.)"
16955 d_syserrlst="$define"
16957 echo "(Since you don't have sys_errlist[], sterror() is welcome.)"
16958 d_syserrlst="$undef"
16960 elif xxx=`./findhdr string.h`; test "$xxx" || xxx=`./findhdr strings.h`; \
16961 $contains '#[ ]*define.*strerror' "$xxx" >/dev/null 2>&1; then
16962 echo 'strerror() found in string header.' >&4
16963 d_strerror="$define"
16964 d_strerrm='strerror(e)'
16965 if set sys_errlist val -a d_syserrlst; eval $csym; $val; then
16966 echo "(Most probably, strerror() uses sys_errlist[] for descriptions.)"
16967 d_syserrlst="$define"
16969 echo "(You don't appear to have any sys_errlist[], how can this be?)"
16970 d_syserrlst="$undef"
16972 elif set sys_errlist val -a d_syserrlst; eval $csym; $val; then
16973 echo "strerror() not found, but you have sys_errlist[] so we'll use that." >&4
16974 d_strerror="$undef"
16975 d_syserrlst="$define"
16976 d_strerrm='((e)<0||(e)>=sys_nerr?"unknown":sys_errlist[e])'
16978 echo 'strerror() and sys_errlist[] NOT found.' >&4
16979 d_strerror="$undef"
16980 d_syserrlst="$undef"
16981 d_strerrm='"unknown"'
16985 : see if strerror_r exists
16986 set strerror_r d_strerror_r
16988 case "$d_strerror_r" in
16990 hdrs="$i_systypes sys/types.h define stdio.h $i_string string.h"
16991 case "$d_strerror_r_proto:$usethreads" in
16992 ":define") d_strerror_r_proto=define
16993 set d_strerror_r_proto strerror_r $hdrs
16997 case "$d_strerror_r_proto" in
16999 case "$strerror_r_proto" in
17000 ''|0) try='int strerror_r(int, char*, size_t);'
17001 ./protochk "extern $try" $hdrs && strerror_r_proto=I_IBW ;;
17003 case "$strerror_r_proto" in
17004 ''|0) try='int strerror_r(int, char*, int);'
17005 ./protochk "extern $try" $hdrs && strerror_r_proto=I_IBI ;;
17007 case "$strerror_r_proto" in
17008 ''|0) try='char* strerror_r(int, char*, size_t);'
17009 ./protochk "extern $try" $hdrs && strerror_r_proto=B_IBW ;;
17011 case "$strerror_r_proto" in
17012 ''|0) d_strerror_r=undef
17014 echo "Disabling strerror_r, cannot determine prototype." >&4 ;;
17015 * ) case "$strerror_r_proto" in
17016 REENTRANT_PROTO*) ;;
17017 *) strerror_r_proto="REENTRANT_PROTO_$strerror_r_proto" ;;
17019 echo "Prototype: $try" ;;
17022 *) case "$usethreads" in
17023 define) echo "strerror_r has no prototype, not using it." >&4 ;;
17030 *) strerror_r_proto=0
17034 : see if strftime exists
17035 set strftime d_strftime
17038 : see if strlcat exists
17039 set strlcat d_strlcat
17042 : see if strlcpy exists
17043 set strlcpy d_strlcpy
17046 : see if strtod exists
17047 set strtod d_strtod
17050 : see if strtol exists
17051 set strtol d_strtol
17054 : see if strtold exists
17055 set strtold d_strtold
17058 : see if strtoll exists
17059 set strtoll d_strtoll
17062 case "$d_longlong-$d_strtoll" in
17065 Checking whether your strtoll() works okay...
17067 $cat >try.c <<'EOCP'
17070 #define strtoll __strtoll
17073 #define strtoll _strtoll
17076 extern long long int strtoll(char *s, char **, int);
17077 static int bad = 0;
17078 int check(char *s, long long ell, int een) {
17081 gll = strtoll(s, 0, 10);
17082 if (!((gll == ell) && (errno == een)))
17086 check(" 1", 1LL, 0);
17087 check(" 0", 0LL, 0);
17088 check("-1", -1LL, 0);
17089 check("-9223372036854775808", -9223372036854775808LL, 0);
17090 check("-9223372036854775808", -9223372036854775808LL, 0);
17091 check(" 9223372036854775807", 9223372036854775807LL, 0);
17092 check("-9223372036854775808", -9223372036854775808LL, 0);
17093 check(" 9223372036854775808", 9223372036854775807LL, ERANGE);
17094 check("-9223372036854775809", -9223372036854775808LL, ERANGE);
17100 if eval $compile; then
17103 ok) echo "Your strtoll() seems to be working okay." ;;
17105 Your strtoll() doesn't seem to be working okay.
17111 echo "(I can't seem to compile the test program--assuming it doesn't)"
17117 : see if strtoq exists
17118 set strtoq d_strtoq
17121 : see if strtoul exists
17122 set strtoul d_strtoul
17125 case "$d_strtoul" in
17128 Checking whether your strtoul() works okay...
17130 $cat >try.c <<'EOCP'
17133 extern unsigned long int strtoul(char *s, char **, int);
17134 static int bad = 0;
17135 void check(char *s, unsigned long eul, int een) {
17138 gul = strtoul(s, 0, 10);
17139 if (!((gul == eul) && (errno == een)))
17143 check(" 1", 1L, 0);
17144 check(" 0", 0L, 0);
17146 case "$longsize" in
17148 $cat >>try.c <<'EOCP'
17149 check("18446744073709551615", 18446744073709551615UL, 0);
17150 check("18446744073709551616", 18446744073709551615UL, ERANGE);
17151 #if 0 /* strtoul() for /^-/ strings is undefined. */
17152 check("-1", 18446744073709551615UL, 0);
17153 check("-18446744073709551614", 2, 0);
17154 check("-18446744073709551615", 1, 0);
17155 check("-18446744073709551616", 18446744073709551615UL, ERANGE);
17156 check("-18446744073709551617", 18446744073709551615UL, ERANGE);
17161 $cat >>try.c <<'EOCP'
17162 check("4294967295", 4294967295UL, 0);
17163 check("4294967296", 4294967295UL, ERANGE);
17164 #if 0 /* strtoul() for /^-/ strings is undefined. */
17165 check("-1", 4294967295UL, 0);
17166 check("-4294967294", 2, 0);
17167 check("-4294967295", 1, 0);
17168 check("-4294967296", 4294967295UL, ERANGE);
17169 check("-4294967297", 4294967295UL, ERANGE);
17174 : Should we write these tests to be more portable by sprintf-ing
17175 : ~0 and then manipulating that char string as input for strtol?
17178 $cat >>try.c <<'EOCP'
17185 if eval $compile; then
17186 case "`$run ./try`" in
17187 ok) echo "Your strtoul() seems to be working okay." ;;
17189 Your strtoul() doesn't seem to be working okay.
17198 : see if strtoull exists
17199 set strtoull d_strtoull
17202 case "$d_longlong-$d_strtoull" in
17205 Checking whether your strtoull() works okay...
17207 $cat >try.c <<'EOCP'
17210 #define strtoull __strtoull
17213 extern unsigned long long int strtoull(char *s, char **, int);
17214 static int bad = 0;
17215 int check(char *s, long long eull, int een) {
17218 gull = strtoull(s, 0, 10);
17219 if (!((gull == eull) && (errno == een)))
17223 check(" 1", 1LL, 0);
17224 check(" 0", 0LL, 0);
17225 check("18446744073709551615", 18446744073709551615ULL, 0);
17226 check("18446744073709551616", 18446744073709551615ULL, ERANGE);
17227 #if 0 /* strtoull() for /^-/ strings is undefined. */
17228 check("-1", 18446744073709551615ULL, 0);
17229 check("-18446744073709551614", 2LL, 0);
17230 check("-18446744073709551615", 1LL, 0);
17231 check("-18446744073709551616", 18446744073709551615ULL, ERANGE);
17232 check("-18446744073709551617", 18446744073709551615ULL, ERANGE);
17239 if eval $compile; then
17240 case "`$run ./try`" in
17241 ok) echo "Your strtoull() seems to be working okay." ;;
17243 Your strtoull() doesn't seem to be working okay.
17245 d_strtoull="$undef"
17252 : see if strtouq exists
17253 set strtouq d_strtouq
17256 case "$d_strtouq" in
17259 Checking whether your strtouq() works okay...
17261 $cat >try.c <<'EOCP'
17264 extern unsigned long long int strtouq(char *s, char **, int);
17265 static int bad = 0;
17266 void check(char *s, unsigned long long eull, int een) {
17267 unsigned long long gull;
17269 gull = strtouq(s, 0, 10);
17270 if (!((gull == eull) && (errno == een)))
17274 check(" 1", 1LL, 0);
17275 check(" 0", 0LL, 0);
17276 check("18446744073709551615", 18446744073709551615ULL, 0);
17277 check("18446744073709551616", 18446744073709551615ULL, ERANGE);
17278 #if 0 /* strtouq() for /^-/ strings is undefined. */
17279 check("-1", 18446744073709551615ULL, 0);
17280 check("-18446744073709551614", 2LL, 0);
17281 check("-18446744073709551615", 1LL, 0);
17282 check("-18446744073709551616", 18446744073709551615ULL, ERANGE);
17283 check("-18446744073709551617", 18446744073709551615ULL, ERANGE);
17291 if eval $compile; then
17292 case "`$run ./try`" in
17293 ok) echo "Your strtouq() seems to be working okay." ;;
17295 Your strtouq() doesn't seem to be working okay.
17304 : see if strxfrm exists
17305 set strxfrm d_strxfrm
17308 : see if symlink exists
17309 set symlink d_symlink
17312 : see if syscall exists
17313 set syscall d_syscall
17316 : see if prototype for syscall is available
17318 set d_syscallproto syscall $i_unistd unistd.h
17321 : see if sysconf exists
17322 set sysconf d_sysconf
17325 : see if system exists
17326 set system d_system
17329 : see if tcgetpgrp exists
17330 set tcgetpgrp d_tcgetpgrp
17333 : see if tcsetpgrp exists
17334 set tcsetpgrp d_tcsetpgrp
17337 : see if prototype for telldir is available
17339 set d_telldirproto telldir $i_systypes sys/types.h $i_dirent dirent.h
17342 : see if time exists
17344 if test "X$d_time" = X -o X"$timetype" = X; then
17345 if set time val -f d_time; eval $csym; $val; then
17346 echo 'time() found.' >&4
17348 rp="What is the type returned by time() on this system?"
17349 set time_t timetype long stdio.h sys/types.h
17352 echo 'time() not found, hope that will do.' >&4
17360 : see if this is a sys/times.h system
17361 set sys/times.h i_systimes
17364 : see if times exists
17366 if set times val -f d_times; eval $csym; $val; then
17367 echo 'times() found.' >&4
17370 case "$i_systimes" in
17371 "$define") inc='sys/times.h';;
17373 rp="What is the type returned by times() on this system?"
17374 set clock_t clocktype long stdio.h sys/types.h $inc
17377 echo 'times() NOT found, hope that will do.' >&4
17382 : see if tmpnam_r exists
17383 set tmpnam_r d_tmpnam_r
17385 case "$d_tmpnam_r" in
17387 hdrs="$i_systypes sys/types.h define stdio.h "
17388 case "$d_tmpnam_r_proto:$usethreads" in
17389 ":define") d_tmpnam_r_proto=define
17390 set d_tmpnam_r_proto tmpnam_r $hdrs
17394 case "$d_tmpnam_r_proto" in
17396 case "$tmpnam_r_proto" in
17397 ''|0) try='char* tmpnam_r(char*);'
17398 ./protochk "extern $try" $hdrs && tmpnam_r_proto=B_B ;;
17400 case "$tmpnam_r_proto" in
17401 ''|0) d_tmpnam_r=undef
17403 echo "Disabling tmpnam_r, cannot determine prototype." >&4 ;;
17404 * ) case "$tmpnam_r_proto" in
17405 REENTRANT_PROTO*) ;;
17406 *) tmpnam_r_proto="REENTRANT_PROTO_$tmpnam_r_proto" ;;
17408 echo "Prototype: $try" ;;
17411 *) case "$usethreads" in
17412 define) echo "tmpnam_r has no prototype, not using it." >&4 ;;
17419 *) tmpnam_r_proto=0
17423 : see if truncate exists
17424 set truncate d_truncate
17427 : see if ttyname_r exists
17428 set ttyname_r d_ttyname_r
17430 case "$d_ttyname_r" in
17432 hdrs="$i_systypes sys/types.h define stdio.h $i_unistd unistd.h"
17433 case "$d_ttyname_r_proto:$usethreads" in
17434 ":define") d_ttyname_r_proto=define
17435 set d_ttyname_r_proto ttyname_r $hdrs
17439 case "$d_ttyname_r_proto" in
17441 case "$ttyname_r_proto" in
17442 ''|0) try='int ttyname_r(int, char*, size_t);'
17443 ./protochk "extern $try" $hdrs && ttyname_r_proto=I_IBW ;;
17445 case "$ttyname_r_proto" in
17446 ''|0) try='int ttyname_r(int, char*, int);'
17447 ./protochk "extern $try" $hdrs && ttyname_r_proto=I_IBI ;;
17449 case "$ttyname_r_proto" in
17450 ''|0) try='char* ttyname_r(int, char*, int);'
17451 ./protochk "extern $try" $hdrs && ttyname_r_proto=B_IBI ;;
17453 case "$ttyname_r_proto" in
17454 ''|0) d_ttyname_r=undef
17456 echo "Disabling ttyname_r, cannot determine prototype." >&4 ;;
17457 * ) case "$ttyname_r_proto" in
17458 REENTRANT_PROTO*) ;;
17459 *) ttyname_r_proto="REENTRANT_PROTO_$ttyname_r_proto" ;;
17461 echo "Prototype: $try" ;;
17464 *) case "$usethreads" in
17465 define) echo "ttyname_r has no prototype, not using it." >&4 ;;
17472 *) ttyname_r_proto=0
17476 : see if tzname[] exists
17478 if set tzname val -a d_tzname; eval $csym; $val; then
17480 echo 'tzname[] found.' >&4
17483 echo 'tzname[] NOT found.' >&4
17489 next|rhapsody|darwin) multiarch="$define" ;;
17491 case "$multiarch" in
17492 ''|[nN]*) multiarch="$undef" ;;
17495 : check for ordering of bytes in a UV
17497 case "$usecrosscompile$multiarch" in
17500 You seem to be either cross-compiling or doing a multiarchitecture build,
17501 skipping the byteorder check.
17507 case "$byteorder" in
17510 In the following, larger digits indicate more significance. A big-endian
17511 machine like a Pyramid or a Motorola 680?0 chip will come out to 4321. A
17512 little-endian machine like a Vax or an Intel 80?86 chip would be 1234. Other
17513 machines may have weird orders like 3412. A Cray will report 87654321,
17514 an Alpha will report 12345678. If the test program works the default is
17516 I'm now running the test program...
17520 #$i_stdlib I_STDLIB
17522 #include <stdlib.h>
17524 #include <sys/types.h>
17525 typedef $uvtype UV;
17535 u.l = (((UV)0x08070605) << 32) | (UV)0x04030201;
17537 u.l = (UV)0x04030201;
17538 for (i = 0; i < $uvsize; i++)
17539 printf("%c", u.c[i]+'0');
17546 if eval $compile && ./try > /dev/null; then
17549 [1-4][1-4][1-4][1-4]|12345678|87654321)
17550 echo "(The test program ran ok.)"
17551 echo "byteorder=$dflt"
17554 ????|????????) echo "(The test program ran ok.)" ;;
17555 *) echo "(The test program didn't run right for some reason.)" ;;
17560 (I can't seem to compile the test program. Guessing big-endian...)
17563 case "$xxx_prompt" in
17565 rp="What is the order of bytes in $uvtype?"
17581 Checking to see whether you can access character data unalignedly...
17583 case "$d_u32align" in
17584 '') $cat >try.c <<EOCP
17586 #$i_stdlib I_STDLIB
17588 #include <stdlib.h>
17590 #define U32 $u32type
17591 #define BYTEORDER 0x$byteorder
17593 #include <signal.h>
17595 $signal_t bletch(s) int s; { exit(4); }
17598 #if BYTEORDER == 0x1234 || BYTEORDER == 0x4321
17603 if (sizeof(U32) != 4) {
17604 printf("sizeof(U32) is not 4, but %d\n", sizeof(U32));
17611 signal(SIGBUS, bletch);
17623 for (i = 0; i < 4; i++) {
17624 up = (U32*)(buf + i);
17625 if (! ((*up == 1 << (8*i)) || /* big-endian */
17626 (*up == 1 << (8*(3-i))) /* little-endian */
17630 printf("read failed (%x)\n", *up);
17636 for (i = 0; i < 4; i++) {
17637 up = (U32*)(buf + i);
17639 if (*up != 0xBeef) {
17640 printf("write failed (%x)\n", *up);
17654 if eval $compile_ok; then
17655 echo "(Testing for character data alignment may crash the test. That's okay.)" >&4
17656 $run ./try 2>&1 >/dev/null
17659 You can access character data pretty unalignedly.
17661 d_u32align="$undef"
17664 It seems that you must access character data in an aligned manner.
17666 d_u32align="$define"
17670 rp='Can you access character data at unaligned addresses?'
17674 [yY]*) d_u32align="$undef" ;;
17675 *) d_u32align="$define" ;;
17678 $rm -f core core.try.* try.core
17682 : see if ualarm exists
17683 set ualarm d_ualarm
17686 : see if umask exists
17690 : see if unordered exists
17691 set unordered d_unordered
17694 : see if unsetenv exists
17695 set unsetenv d_unsetenv
17698 : see if usleep exists
17699 set usleep d_usleep
17702 : see if prototype for usleep is available
17704 set d_usleepproto usleep $i_unistd unistd.h
17707 : see if ustat exists
17711 : backward compatibility for d_hvfork
17712 if test X$d_hvfork != X; then
17713 d_vfork="$d_hvfork"
17716 : see if there is a vfork
17721 : Ok, but do we want to use it. vfork is reportedly unreliable in
17722 : perl on Solaris 2.x, and probably elsewhere.
17726 case "$usevfork" in
17732 Perl can only use a vfork() that doesn't suffer from strict
17733 restrictions on calling functions or modifying global data in
17734 the child. For example, glibc-2.1 contains such a vfork()
17735 that is unsuitable. If your system provides a proper fork()
17736 call, chances are that you do NOT want perl to use vfork().
17739 rp="Do you still want to use vfork()?"
17744 echo "Ok, we won't use vfork()."
17753 $define) usevfork='true';;
17754 *) usevfork='false';;
17757 : see if closedir exists
17758 set closedir d_closedir
17761 case "$d_closedir" in
17764 echo "Checking whether closedir() returns a status..." >&4
17766 #$i_dirent I_DIRENT /**/
17767 #$i_sysdir I_SYS_DIR /**/
17768 #$i_sysndir I_SYS_NDIR /**/
17769 #$i_systypes I_SYS_TYPES /**/
17771 #if defined(I_SYS_TYPES)
17772 #include <sys/types.h>
17774 #if defined(I_DIRENT)
17775 #include <dirent.h>
17776 #if defined(NeXT) && defined(I_SYS_DIR) /* NeXT needs dirent + sys/dir.h */
17777 #include <sys/dir.h>
17781 #include <sys/ndir.h>
17785 #include <ndir.h> /* may be wrong in the future */
17787 #include <sys/dir.h>
17792 int main() { return closedir(opendir(".")); }
17795 if eval $compile_ok; then
17796 if $run ./try > /dev/null 2>&1 ; then
17797 echo "Yes, it does."
17800 echo "No, it doesn't."
17804 echo "(I can't seem to compile the test program--assuming it doesn't)"
17812 set d_void_closedir
17815 : see if there is a wait4
17819 : see if waitpid exists
17820 set waitpid d_waitpid
17823 : see if wcstombs exists
17824 set wcstombs d_wcstombs
17827 : see if wctomb exists
17828 set wctomb d_wctomb
17831 : see if writev exists
17832 set writev d_writev
17835 : preserve RCS keywords in files with variable substitution, grrr
17840 Revision='$Revision'
17842 : check for alignment requirements
17844 case "$usecrosscompile$multiarch" in
17847 You seem to be either cross-compiling or doing a multiarchitecture build,
17848 skipping the memory alignment check.
17851 case "$alignbytes" in
17852 '') alignbytes=8 ;;
17856 case "$alignbytes" in
17857 '') echo "Checking alignment constraints..." >&4
17858 if $test "X$uselongdouble" = Xdefine -a "X$d_longdbl" = Xdefine; then
17859 $cat >try.c <<'EOCP'
17860 typedef long double NV;
17863 $cat >try.c <<'EOCP'
17867 $cat >>try.c <<'EOCP'
17875 printf("%d\n", (int)((char *)&try_algn.bar - (char *)&try_algn.foo));
17880 if eval $compile_ok; then
17884 echo "(I can't seem to compile the test program...)"
17887 *) dflt="$alignbytes"
17890 rp="Doubles must be aligned on a how-many-byte boundary?"
17898 : set the base revision
17901 : how do we concatenate cpp tokens here?
17903 echo "Checking to see how your cpp does stuff like concatenate tokens..." >&4
17904 $cat >cpp_stuff.c <<'EOCP'
17905 #define RCAT(a,b)a/**/b
17906 #define ACAT(a,b)a ## b
17910 $cppstdin $cppflags $cppminus <cpp_stuff.c >cpp_stuff.out 2>&1
17911 if $contains 'Circus' cpp_stuff.out >/dev/null 2>&1; then
17912 echo "Oh! Smells like ANSI's been here." >&4
17913 echo "We can catify or stringify, separately or together!"
17915 elif $contains 'Reiser' cpp_stuff.out >/dev/null 2>&1; then
17916 echo "Ah, yes! The good old days!" >&4
17917 echo "However, in the good old days we don't know how to stringify and"
17918 echo "catify at the same time."
17922 Hmm, I don't seem to be able to concatenate tokens with your cpp.
17923 You're going to have to edit the values of CAT[2-5] in config.h...
17925 cpp_stuff="/* Help! How do we handle cpp_stuff? */*/"
17929 : see if this is a db.h system
17935 : Check db version.
17937 echo "Checking Berkeley DB version ..." >&4
17943 #include <sys/types.h>
17945 #$i_stdlib I_STDLIB
17947 #include <stdlib.h>
17950 int main(int argc, char *argv[])
17952 #ifdef DB_VERSION_MAJOR /* DB version >= 2 */
17953 int Major, Minor, Patch ;
17954 unsigned long Version ;
17955 (void)db_version(&Major, &Minor, &Patch) ;
17957 printf("%d %d %d %d %d %d\n",
17958 DB_VERSION_MAJOR, DB_VERSION_MINOR, DB_VERSION_PATCH,
17959 Major, Minor, Patch);
17962 printf("You have Berkeley DB Version 2 or greater.\n");
17964 printf("db.h is from Berkeley DB Version %d.%d.%d\n",
17965 DB_VERSION_MAJOR, DB_VERSION_MINOR, DB_VERSION_PATCH);
17966 printf("libdb is from Berkeley DB Version %d.%d.%d\n",
17967 Major, Minor, Patch) ;
17969 /* check that db.h & libdb are compatible */
17970 if (DB_VERSION_MAJOR != Major || DB_VERSION_MINOR != Minor || DB_VERSION_PATCH != Patch) {
17971 printf("db.h and libdb are incompatible.\n") ;
17975 printf("db.h and libdb are compatible.\n") ;
17977 Version = DB_VERSION_MAJOR * 1000000 + DB_VERSION_MINOR * 1000
17978 + DB_VERSION_PATCH ;
17980 /* needs to be >= 2.3.4 */
17981 if (Version < 2003004) {
17982 /* if (DB_VERSION_MAJOR == 2 && DB_VERSION_MINOR == 0 && DB_VERSION_PATCH < 5) { */
17983 printf("Perl needs Berkeley DB 2.3.4 or greater.\n") ;
17989 #if defined(_DB_H_) && defined(BTREEMAGIC) && defined(HASHMAGIC)
17994 printf("You have Berkeley DB Version 1.\n");
17995 exit(0); /* DB version < 2: the coast is clear. */
17997 exit(1); /* <db.h> not Berkeley DB? */
18003 if eval $compile_ok && $run ./try; then
18004 echo 'Looks OK.' >&4
18006 db_version_major=$1
18007 db_version_minor=$2
18008 db_version_patch=$3
18010 echo "I can't use Berkeley DB with your <db.h>. I'll disable Berkeley DB." >&4
18014 : Remove db from list of libraries to use
18015 echo "Removing unusable -ldb from library list" >&4
18016 set `echo X $libs | $sed -e 's/-ldb / /' -e 's/-ldb$//'`
18019 echo "libs = $libs" >&4
18029 : Check the return type needed for hash
18031 echo "Checking return type needed for hash for Berkeley DB ..." >&4
18037 #include <sys/types.h>
18040 #ifndef DB_VERSION_MAJOR
18041 u_int32_t hash_cb (ptr, size)
18049 info.hash = hash_cb;
18053 if $cc $ccflags -c try.c >try.out 2>&1 ; then
18054 if $contains warning try.out >>/dev/null 2>&1 ; then
18057 db_hashtype='u_int32_t'
18060 : XXX Maybe we should just give up here.
18061 db_hashtype=u_int32_t
18063 echo "Help: I can't seem to compile the db test program." >&4
18064 echo "Something's wrong, but I'll assume you use $db_hashtype." >&4
18067 echo "Your version of Berkeley DB uses $db_hashtype for hash."
18069 *) db_hashtype=u_int32_t
18074 : Check the return type needed for prefix
18076 echo "Checking return type needed for prefix for Berkeley DB ..." >&4
18082 #include <sys/types.h>
18085 #ifndef DB_VERSION_MAJOR
18086 size_t prefix_cb (key1, key2)
18094 info.prefix = prefix_cb;
18098 if $cc $ccflags -c try.c >try.out 2>&1 ; then
18099 if $contains warning try.out >>/dev/null 2>&1 ; then
18100 db_prefixtype='int'
18102 db_prefixtype='size_t'
18105 db_prefixtype='size_t'
18106 : XXX Maybe we should just give up here.
18108 echo "Help: I can't seem to compile the db test program." >&4
18109 echo "Something's wrong, but I'll assume you use $db_prefixtype." >&4
18112 echo "Your version of Berkeley DB uses $db_prefixtype for prefix."
18114 *) db_prefixtype='size_t'
18119 : How can we generate normalized random numbers ?
18121 echo "Looking for a random number function..." >&4
18122 case "$randfunc" in
18124 if set drand48 val -f; eval $csym; $val; then
18126 echo "Good, found drand48()." >&4
18127 elif set random val -f; eval $csym; $val; then
18129 echo "OK, found random()." >&4
18132 echo "Yick, looks like I have to use rand()." >&4
18143 *-Dmy_rand=*|*-Dmy_srand=*)
18144 echo "Removing obsolete -Dmy_rand, -Dmy_srand, and -Drandbits from ccflags." >&4
18145 ccflags="`echo $ccflags | sed -e 's/-Dmy_rand=random/ /'`"
18146 ccflags="`echo $ccflags | sed -e 's/-Dmy_srand=srandom/ /'`"
18147 ccflags="`echo $ccflags | sed -e 's/-Drandbits=[0-9][0-9]*/ /'`"
18151 while $test "$cont"; do
18152 rp="Use which function to generate random numbers?"
18154 if $test "$ans" = "$dflt"; then
18160 if set $ans val -f; eval $csym; $val; then
18164 rp="I cannot find function $ans. Use that name anyway?"
18173 case "$randfunc" in
18175 drand01="drand48()"
18181 case "$randbits" in
18183 echo "Checking to see how many bits your $randfunc() function produces..." >&4
18185 #$i_unistd I_UNISTD
18186 #$i_stdlib I_STDLIB
18189 # include <unistd.h>
18192 # include <stdlib.h>
18197 register unsigned long tmp;
18198 register unsigned long max = 0L;
18200 for (i = 1000; i; i--) {
18201 tmp = (unsigned long) $randfunc();
18202 if (tmp > max) max = tmp;
18204 for (i = 0; max; i++)
18210 if eval $compile_ok; then
18214 echo "(I can't seem to compile the test program...)"
18221 rp="How many bits does your $randfunc() function produce?"
18225 drand01="($randfunc() / (double) ((unsigned long)1 << $randbits))"
18226 seedfunc="s$randfunc"
18227 randseedtype=unsigned
18231 rp="How many bits does your $randfunc() function produce?"
18234 seedfunc="s$randfunc"
18235 drand01="($randfunc() / (double) ((unsigned long)1 << $randbits))"
18236 if set $seedfunc val -f; eval $csym; $val; then
18237 echo "(Using $seedfunc() to seed random generator)"
18239 echo "(Warning: no $seedfunc() to seed random generator)"
18242 randseedtype=unsigned
18250 echo "Determining whether or not we are on an EBCDIC system..." >&4
18251 $cat >try.c <<'EOM'
18254 if ('M'==0xd4) return 0;
18261 if eval $compile_ok; then
18262 if $run ./try; then
18263 echo "You seem to speak EBCDIC." >&4
18266 echo "Nope, no EBCDIC, probably ASCII or some ISO Latin. Or UTF-8." >&4
18269 echo "I'm unable to compile the test program." >&4
18270 echo "I'll assume ASCII or some ISO Latin. Or UTF8." >&4
18278 Checking how to flush all pending stdio output...
18280 # I only know how to find the first 32 possibly open files on SunOS.
18281 # See also hints/sunos_4_1.sh and util.c --AD
18283 sunos) $echo '#define PERL_FFLUSH_ALL_FOPEN_MAX 32' > try.c ;;
18285 $cat >>try.c <<EOCP
18287 #$i_stdlib I_STDLIB
18289 #include <stdlib.h>
18291 #$i_unistd I_UNISTD
18293 # include <unistd.h>
18295 #$d_sysconf HAS_SYSCONF
18296 #$d_stdio_stream_array HAS_STDIO_STREAM_ARRAY
18297 #ifdef HAS_STDIO_STREAM_ARRAY
18298 # define STDIO_STREAM_ARRAY $stdio_stream_array
18303 p = fopen("try.out", "w");
18307 # ifdef TRY_FPRINTF
18311 #ifdef TRY_FFLUSH_NULL
18314 #ifdef TRY_FFLUSH_ALL
18316 long open_max = -1;
18317 # ifdef PERL_FFLUSH_ALL_FOPEN_MAX
18318 open_max = PERL_FFLUSH_ALL_FOPEN_MAX;
18320 # if defined(HAS_SYSCONF) && defined(_SC_OPEN_MAX)
18321 open_max = sysconf(_SC_OPEN_MAX);
18324 open_max = FOPEN_MAX;
18327 open_max = OPEN_MAX;
18336 # ifdef HAS_STDIO_STREAM_ARRAY
18337 if (open_max > 0) {
18339 for (i = 0; i < open_max; i++)
18340 if (STDIO_STREAM_ARRAY[i]._file >= 0 &&
18341 STDIO_STREAM_ARRAY[i]._file < open_max &&
18342 STDIO_STREAM_ARRAY[i]._flag)
18343 fflush(&STDIO_STREAM_ARRAY[i]);
18351 : first we have to find out how _not_ to flush
18353 if $test "X$fflushNULL" = X -o "X$fflushall" = X; then
18355 set try -DTRY_FPUTC
18356 if eval $compile; then
18357 $run ./try 2>/dev/null
18360 if $test ! -s try.out -a "X$code" = X42; then
18366 set try -DTRY_FPRINTF
18367 if eval $compile; then
18368 $run ./try 2>/dev/null
18371 if $test ! -s try.out -a "X$code" = X42; then
18372 output=-DTRY_FPRINTF
18378 : check for fflush NULL behaviour
18379 case "$fflushNULL" in
18380 '') set try -DTRY_FFLUSH_NULL $output
18381 if eval $compile; then
18382 $run ./try 2>/dev/null
18385 if $test -s try.out -a "X$code" = X42; then
18386 fflushNULL="`$cat try.out`"
18388 if $test "X$code" != X42; then
18390 (If this test failed, don't worry, we'll try another method shortly.)
18395 $rm -f core try.core core.try.*
18396 case "$fflushNULL" in
18398 Your fflush(NULL) works okay for output streams.
18399 Let's see if it clobbers input pipes...
18401 # As of mid-March 2000 all versions of Solaris appear to have a stdio
18402 # bug that improperly flushes the input end of pipes. So we avoid the
18403 # autoflush on fork/system/exec support for now. :-(
18404 $cat >tryp.c <<EOCP
18407 main(int argc, char **argv)
18413 while ((i = getc(stdin)) != -1
18414 && (*bp++ = i) != '\n'
18415 && bp < &buf[1024])
18418 fprintf(stdout, "%s", buf);
18426 fflushNULL="$define"
18428 if eval $compile; then
18430 $cat tryp.c | $run ./tryp 2>/dev/null > tryp.out
18431 if cmp tryp.c tryp.out >/dev/null 2>&1; then
18433 fflush(NULL) seems to behave okay with input streams.
18435 fflushNULL="$define"
18438 Ouch, fflush(NULL) clobbers input pipes! We will not use it.
18440 fflushNULL="$undef"
18443 $rm -f core tryp.c tryp.core core.tryp.*
18446 Your fflush(NULL) isn't working (contrary to ANSI C).
18448 fflushNULL="$undef"
18451 Cannot figure out whether your fflush(NULL) works or not.
18452 I'm assuming it doesn't (contrary to ANSI C).
18454 fflushNULL="$undef"
18458 $define|true|[yY]*)
18459 fflushNULL="$define"
18462 fflushNULL="$undef"
18465 : check explicit looping only if NULL did not work, and if the pipe
18466 : bug does not show up on an explicit flush too
18467 case "$fflushNULL" in
18469 $cat >tryp.c <<EOCP
18472 main(int argc, char **argv)
18478 while ((i = getc(stdin)) != -1
18479 && (*bp++ = i) != '\n'
18480 && bp < &buf[1024])
18483 fprintf(stdout, "%s", buf);
18492 if eval $compile; then
18494 $cat tryp.c | $run ./tryp 2>/dev/null > tryp.out
18495 if cmp tryp.c tryp.out >/dev/null 2>&1; then
18497 Good, at least fflush(stdin) seems to behave okay when stdin is a pipe.
18499 : now check for fflushall behaviour
18500 case "$fflushall" in
18501 '') set try -DTRY_FFLUSH_ALL $output
18502 if eval $compile; then
18504 (Now testing the other method--but note that this also may fail.)
18506 $run ./try 2>/dev/null
18509 if $test -s try.out -a "X$code" = X42; then
18510 fflushall="`$cat try.out`"
18513 $rm -f core try.core core.try.*
18514 case "$fflushall" in
18516 Whew. Flushing explicitly all the stdio streams works.
18518 fflushall="$define"
18521 Sigh. Flushing explicitly all the stdio streams doesn't work.
18526 Cannot figure out whether flushing stdio streams explicitly works or not.
18527 I'm assuming it doesn't.
18533 "$define"|true|[yY]*)
18534 fflushall="$define"
18542 All is futile. Even fflush(stdin) clobbers input pipes!
18549 $rm -f core tryp.c tryp.core core.tryp.*
18551 *) fflushall="$undef"
18555 case "$fflushNULL$fflushall" in
18558 OK, I give up. I cannot figure out how to flush pending stdio output.
18559 We won't be flushing handles at all before fork/exec/popen.
18563 $rm -f try.* try$exe_ext
18565 : Store the full pathname to the ar program for use in the C program
18566 : Respect a hint or command line value for full_ar.
18571 : Store the full pathname to the sed program for use in the C program
18574 : see what type gids are declared as in the kernel
18576 echo "Looking for the type for group ids returned by getgid()."
18577 set gid_t gidtype xxx stdio.h sys/types.h
18581 xxx=`./findhdr sys/user.h`
18582 set `grep 'groups\[NGROUPS\];' "$xxx" 2>/dev/null` unsigned short
18584 unsigned) dflt="$1 $2" ;;
18588 *) dflt="$gidtype";;
18591 gid_t) echo "gid_t found." ;;
18592 *) rp="What is the type for group ids returned by getgid()?"
18600 *_t) zzz="$gidtype" ;;
18603 echo "Checking the size of $zzz..." >&4
18605 #include <sys/types.h>
18607 #$i_stdlib I_STDLIB
18609 #include <stdlib.h>
18612 printf("%d\n", (int)sizeof($gidtype));
18617 if eval $compile_ok; then
18621 echo "(I can't execute the test program--guessing $gidsize.)" >&4
18624 echo "Your $zzz is $gidsize bytes long."
18629 echo "(I can't compile the test program--guessing $gidsize.)" >&4
18635 *_t) zzz="$gidtype" ;;
18638 echo "Checking the sign of $zzz..." >&4
18640 #include <sys/types.h>
18651 if eval $compile; then
18655 echo "(I can't execute the test program--guessing unsigned.)" >&4
18659 1) echo "Your $zzz is unsigned." ;;
18660 -1) echo "Your $zzz is signed." ;;
18666 echo "(I can't compile the test program--guessing unsigned.)" >&4
18672 if $test X"$quadtype" != X; then
18674 echo "Checking how to print 64-bit integers..." >&4
18676 if $test X"$sPRId64" = X -a X"$quadtype" = Xint; then
18677 $cat >try.c <<'EOCP'
18678 #include <sys/types.h>
18681 int q = 12345678901;
18682 printf("%ld\n", q);
18686 if eval $compile; then
18690 sPRId64='"d"'; sPRIi64='"i"'; sPRIu64='"u"';
18691 sPRIo64='"o"'; sPRIx64='"x"'; sPRIXU64='"X"';
18692 echo "We will use %d."
18698 if $test X"$sPRId64" = X -a X"$quadtype" = Xlong; then
18699 $cat >try.c <<'EOCP'
18700 #include <sys/types.h>
18703 long q = 12345678901;
18704 printf("%ld\n", q);
18708 if eval $compile; then
18712 sPRId64='"ld"'; sPRIi64='"li"'; sPRIu64='"lu"';
18713 sPRIo64='"lo"'; sPRIx64='"lx"'; sPRIXU64='"lX"';
18714 echo "We will use %ld."
18720 if $test X"$sPRId64" = X -a X"$i_inttypes" = X"$define" -a X"$quadtype" = Xint64_t; then
18721 $cat >try.c <<'EOCP'
18722 #include <sys/types.h>
18723 #include <inttypes.h>
18726 int64_t q = 12345678901;
18727 printf("%" PRId64 "\n", q);
18731 if eval $compile; then
18735 sPRId64=PRId64; sPRIi64=PRIi64; sPRIu64=PRIu64;
18736 sPRIo64=PRIo64; sPRIx64=PRIx64; sPRIXU64=PRIXU64;
18737 echo "We will use the C9X style."
18743 if $test X"$sPRId64" = X -a X"$quadtype" != X; then
18745 #include <sys/types.h>
18748 $quadtype q = 12345678901;
18749 printf("%Ld\n", q);
18753 if eval $compile; then
18757 sPRId64='"Ld"'; sPRIi64='"Li"'; sPRIu64='"Lu"';
18758 sPRIo64='"Lo"'; sPRIx64='"Lx"'; sPRIXU64='"LX"';
18759 echo "We will use %Ld."
18765 if $test X"$sPRId64" = X -a X"$quadtype" = X"long long"; then
18766 $cat >try.c <<'EOCP'
18767 #include <sys/types.h>
18770 long long q = 12345678901LL; /* AIX cc requires the LL suffix. */
18771 printf("%lld\n", q);
18775 if eval $compile; then
18779 sPRId64='"lld"'; sPRIi64='"lli"'; sPRIu64='"llu"';
18780 sPRIo64='"llo"'; sPRIx64='"llx"'; sPRIXU64='"llX"';
18781 echo "We will use the %lld style."
18787 if $test X"$sPRId64" = X -a X"$quadtype" != X; then
18789 #include <sys/types.h>
18792 $quadtype q = 12345678901;
18793 printf("%qd\n", q);
18797 if eval $compile; then
18801 sPRId64='"qd"'; sPRIi64='"qi"'; sPRIu64='"qu"';
18802 sPRIo64='"qo"'; sPRIx64='"qx"'; sPRIXU64='"qX"';
18803 echo "We will use %qd."
18809 if $test X"$sPRId64" = X; then
18810 echo "Cannot figure out how to print 64-bit integers." >&4
18818 '') d_PRId64="$undef"; d_PRIi64="$undef"; d_PRIu64="$undef";
18819 d_PRIo64="$undef"; d_PRIx64="$undef"; d_PRIXU64="$undef";
18821 *) d_PRId64="$define"; d_PRIi64="$define"; d_PRIu64="$define";
18822 d_PRIo64="$define"; d_PRIx64="$define"; d_PRIXU64="$define";
18828 $echo "Checking the format strings to be used for Perl's internal types..." >&4
18830 if $test X"$ivsize" = X8; then
18831 ivdformat="$sPRId64"
18832 uvuformat="$sPRIu64"
18833 uvoformat="$sPRIo64"
18834 uvxformat="$sPRIx64"
18835 uvXUformat="$sPRIXU64"
18837 if $test X"$ivsize" = X"$longsize"; then
18844 if $test X"$ivsize" = X"$intsize"; then
18852 if $test X"$ivsize" = X"$shortsize"; then
18863 if $test X"$uselongdouble" = X"$define" -a X"$d_longdbl" = X"$define" -a X"$d_PRIgldbl" = X"$define"; then
18864 nveformat="$sPRIeldbl"
18865 nvfformat="$sPRIfldbl"
18866 nvgformat="$sPRIgldbl"
18867 nvEUformat="$sPRIEUldbl"
18868 nvFUformat="$sPRIFUldbl"
18869 nvGUformat="$sPRIGUldbl"
18879 case "$ivdformat" in
18880 '') echo "$0: Fatal: failed to find format strings, cannot continue." >&4
18887 $echo "Checking the format string to be used for gids..." >&4
18890 -1) if $test X"$gidsize" = X"$ivsize"; then
18891 gidformat="$ivdformat"
18893 if $test X"$gidsize" = X"$longsize"; then
18896 if $test X"$gidsize" = X"$intsize"; then
18899 if $test X"$gidsize" = X"$shortsize"; then
18906 *) if $test X"$gidsize" = X"$uvsize"; then
18907 gidformat="$uvuformat"
18909 if $test X"$gidsize" = X"$longsize"; then
18912 if $test X"$gidsize" = X"$intsize"; then
18915 if $test X"$gidsize" = X"$shortsize"; then
18924 : see if getgroups exists
18925 set getgroups d_getgrps
18928 : see if setgroups exists
18929 set setgroups d_setgrps
18933 : Find type of 2nd arg to 'getgroups()' and 'setgroups()'
18935 case "$d_getgrps$d_setgrps" in
18937 case "$groupstype" in
18938 '') dflt="$gidtype" ;;
18939 *) dflt="$groupstype" ;;
18942 What type of pointer is the second argument to getgroups() and setgroups()?
18943 Usually this is the same as group ids, $gidtype, but not always.
18946 rp='What type pointer is the second argument to getgroups() and setgroups()?'
18950 *) groupstype="$gidtype";;
18954 if $test $patchlevel -lt 9; then
18955 : MAD is not available in 5.8.x or earlier.
18959 $define|true|[yY]*) dflt='y' ;;
18964 Would you like to build with Misc Attribute Decoration? This is development
18965 work leading to a Perl 5 to Perl 6 convertor, which imposes a space and speed
18966 overhead on the interpreter.
18968 If this doesn't make any sense to you, just accept the default '$dflt'.
18970 rp='Build Perl with MAD?'
18975 madlyh='madly.h madly.act madly.tab'
18977 madlyobj="madly$_o" ;;
18987 echo "Checking if your $make program sets \$(MAKE)..." >&4
18988 case "$make_set_make" in
18990 $sed 's/^X //' > testmake.mak << 'EOF'
18992 X @echo 'maketemp="$(MAKE)"'
18994 case "`$make -f testmake.mak 2>/dev/null`" in
18995 *maketemp=*) make_set_make='#' ;;
18996 *) make_set_make="MAKE=$make" ;;
18998 $rm -f testmake.mak
19001 case "$make_set_make" in
19002 '#') echo "Yup, it does.";;
19003 *) echo "Nope, it doesn't.";;
19006 : see what type is used for mode_t
19007 rp="What is the type used for file modes for system calls (e.g. fchmod())?"
19008 set mode_t modetype int stdio.h sys/types.h
19011 : see if stdarg is available
19013 if $test `./findhdr stdarg.h`; then
19014 echo "<stdarg.h> found." >&4
19017 echo "<stdarg.h> NOT found." >&4
19021 : see if varags is available
19023 if $test `./findhdr varargs.h`; then
19024 echo "<varargs.h> found." >&4
19026 echo "<varargs.h> NOT found, but that's ok (I hope)." >&4
19029 : set up the varargs testing programs
19030 $cat > varargs.c <<EOP
19032 #include <stdarg.h>
19035 #include <varargs.h>
19039 int f(char *p, ...)
19053 p = va_arg(ap, char *);
19058 $cat > varargs <<EOP
19060 if $cc -c $ccflags -D\$1 varargs.c >/dev/null 2>&1; then
19069 : now check which varargs header should be included
19074 if `./varargs I_STDARG`; then
19076 elif `./varargs I_VARARGS`; then
19081 if `./varargs I_VARARGS`; then
19088 echo "I could not find the definition for va_dcl... You have problems..." >&4
19089 val="$undef"; set i_stdarg; eval $setvar
19090 val="$undef"; set i_varargs; eval $setvar
19095 case "$i_varhdr" in
19097 val="$define"; set i_stdarg; eval $setvar
19098 val="$undef"; set i_varargs; eval $setvar
19101 val="$undef"; set i_stdarg; eval $setvar
19102 val="$define"; set i_varargs; eval $setvar
19105 echo "We'll include <$i_varhdr> to get va_dcl definition." >&4;;
19109 : see if we need va_copy
19111 case "$i_stdarg" in
19114 #include <stdarg.h>
19116 #$i_stdlib I_STDLIB
19118 #include <stdlib.h>
19120 #include <signal.h>
19123 ivfprintf(FILE *f, const char *fmt, va_list *valp)
19125 return vfprintf(f, fmt, *valp);
19129 myvfprintf(FILE *f, const char *fmt, va_list val)
19131 return ivfprintf(f, fmt, &val);
19135 myprintf(char *fmt, ...)
19138 va_start(val, fmt);
19139 return myvfprintf(stdout, fmt, val);
19143 main(int ac, char **av)
19145 signal(SIGSEGV, exit);
19147 myprintf("%s%cs all right, then\n", "that", '\'');
19152 if eval $compile && $run ./try 2>&1 >/dev/null; then
19153 case "`$run ./try`" in
19154 "that's all right, then")
19160 yes) echo "It seems that you don't need va_copy()." >&4
19161 need_va_copy="$undef"
19163 *) echo "It seems that va_copy() or similar will be needed." >&4
19164 need_va_copy="$define"
19167 $rm -f try.* core core.* *.core *.core.*
19169 *) echo "You don't have <stdarg.h>, not checking for va_copy()." >&4
19173 : see if the Compiler supports C99 variadic macros
19174 case "$i_stdarg$i_stdlib" in
19176 echo "You have <stdarg.h> and <stdlib.h>, so checking for C99 variadic macros." >&4
19179 #include <stdarg.h>
19181 #define foo(buffer, format, ...) sprintf(buffer, format, __VA_ARGS__)
19185 foo(buf, "%d %g %.*s", 123, 456.0, (int)3, "789fail");
19191 if eval $compile && $run ./try 2>&1 >/dev/null; then
19192 case "`$run ./try`" in
19194 echo "You have C99 variadic macros." >&4
19195 d_c99_variadic_macros="$define"
19198 echo "You don't have functional C99 variadic macros." >&4
19199 d_c99_variadic_macros="$undef"
19203 echo "I couldn't compile and run the test program, so I assume that you don't have functional C99 variadic macros." >&4
19204 d_c99_variadic_macros="$undef"
19208 echo "You don't have <stdarg.h> and <stdlib.h>, so not checking for C99 variadic macros." >&4
19209 d_c99_variadic_macros="$undef"
19213 : see what type is used for size_t
19214 rp="What is the type used for the length parameter for string functions?"
19215 set size_t sizetype 'unsigned int' stdio.h sys/types.h
19218 : check for type of arguments to gethostbyaddr.
19219 if test "X$netdb_host_type" = X -o "X$netdb_hlen_type" = X; then
19220 case "$d_gethbyaddr" in
19224 Checking to see what type of arguments are accepted by gethostbyaddr().
19226 hdrs="$define sys/types.h
19227 $d_socket sys/socket.h
19228 $i_niin netinet/in.h
19230 $i_unistd unistd.h"
19231 : The first arg can 'char *' or 'void *'
19232 : The second arg is some of integral type
19233 for xxx in in_addr_t 'const void *' 'const char *' 'void *' 'char *'; do
19234 for yyy in size_t long int; do
19235 case "$netdb_host_type" in
19236 '') try="extern struct hostent *gethostbyaddr($xxx, $yyy, int);"
19237 if ./protochk "$try" $hdrs; then
19238 echo "Your system accepts $xxx for the first arg."
19239 echo "...and $yyy for the second arg."
19240 netdb_host_type="$xxx"
19241 netdb_hlen_type="$yyy"
19247 : In case none of those worked, prompt the user.
19248 case "$netdb_host_type" in
19249 '') rp='What is the type for the 1st argument to gethostbyaddr?'
19252 netdb_host_type=$ans
19253 rp='What is the type for the 2nd argument to gethostbyaddr?'
19256 netdb_hlen_type=$ans
19260 *) : no gethostbyaddr, so pick harmless defaults
19261 netdb_host_type='char *'
19262 netdb_hlen_type="$sizetype"
19265 # Remove the "const" if needed. -- but then we'll have a
19267 # netdb_host_type=`echo "$netdb_host_type" | sed 's/^const //'`
19270 : check for type of argument to gethostbyname.
19271 if test "X$netdb_name_type" = X ; then
19272 case "$d_gethbyname" in
19276 Checking to see what type of argument is accepted by gethostbyname().
19278 hdrs="$define sys/types.h
19279 $d_socket sys/socket.h
19280 $i_niin netinet/in.h
19282 $i_unistd unistd.h"
19283 for xxx in "const char *" "char *"; do
19284 case "$netdb_name_type" in
19285 '') try="extern struct hostent *gethostbyname($xxx);"
19286 if ./protochk "$try" $hdrs; then
19287 echo "Your system accepts $xxx."
19288 netdb_name_type="$xxx"
19293 : In case none of those worked, prompt the user.
19294 case "$netdb_name_type" in
19295 '') rp='What is the type for the 1st argument to gethostbyname?'
19298 netdb_name_type=$ans
19302 *) : no gethostbyname, so pick harmless default
19303 netdb_name_type='char *'
19308 : check for type of 1st argument to getnetbyaddr.
19309 if test "X$netdb_net_type" = X ; then
19310 case "$d_getnbyaddr" in
19314 Checking to see what type of 1st argument is accepted by getnetbyaddr().
19316 hdrs="$define sys/types.h
19317 $d_socket sys/socket.h
19318 $i_niin netinet/in.h
19320 $i_unistd unistd.h"
19321 for xxx in in_addr_t "unsigned long" long "unsigned int" int; do
19322 case "$netdb_net_type" in
19323 '') try="extern struct netent *getnetbyaddr($xxx, int);"
19324 if ./protochk "$try" $hdrs; then
19325 echo "Your system accepts $xxx."
19326 netdb_net_type="$xxx"
19331 : In case none of those worked, prompt the user.
19332 case "$netdb_net_type" in
19333 '') rp='What is the type for the 1st argument to getnetbyaddr?'
19336 netdb_net_type=$ans
19340 *) : no getnetbyaddr, so pick harmless default
19341 netdb_net_type='long'
19345 : locate the preferred pager for this system
19352 [a-zA-Z]:/*) dflt=$pg;;
19356 [a-zA-Z]:/*) dflt=$more;;
19360 [a-zA-Z]:/*) dflt=$less;;
19363 '') dflt=/usr/ucb/more;;
19367 : Instruct ./getfile to trust the hinted or previous pager value,
19368 : even if it does not begin with a slash. For example, on os2,
19369 : pager might be cmd /c more. See comments in UU/getfile.
19374 rp='What pager is used on your system?'
19378 : see what type pids are declared as in the kernel
19379 rp="What is the type of process ids on this system?"
19380 set pid_t pidtype int stdio.h sys/types.h
19383 : see if ar generates random libraries by itself
19385 echo "Checking how to generate random libraries on your machine..." >&4
19386 echo 'int bar1() { return bar2(); }' > bar1.c
19387 echo 'int bar2() { return 2; }' > bar2.c
19389 #$i_stdlib I_STDLIB
19391 #include <stdlib.h>
19393 int main() { printf("%d\n", bar1()); exit(0); }
19395 $cc $ccflags -c bar1.c >/dev/null 2>&1
19396 $cc $ccflags -c bar2.c >/dev/null 2>&1
19397 $cc $ccflags -c foo.c >/dev/null 2>&1
19398 $ar rc bar$_a bar2$_o bar1$_o >/dev/null 2>&1
19399 if $cc -o foobar $ccflags $ldflags foo$_o bar$_a $libs > /dev/null 2>&1 &&
19400 $run ./foobar >/dev/null 2>&1; then
19401 echo "$ar appears to generate random libraries itself."
19403 if [ "X$ranlib" = "X" ]; then
19406 elif $ar s bar$_a >/dev/null 2>&1 &&
19407 $cc -o foobar $ccflags $ldflags foo$_o bar$_a $libs > /dev/null 2>&1 &&
19408 $run ./foobar >/dev/null 2>&1; then
19409 echo "a table of contents needs to be added with '$ar s'."
19412 elif $ar ts bar$_a >/dev/null 2>&1 &&
19413 $cc -o foobar $ccflags $ldflags foo$_o bar$_a $libs > /dev/null 2>&1 &&
19414 $run ./foobar >/dev/null 2>&1; then
19415 echo "a table of contents needs to be added with '$ar ts'."
19422 ranlib=`./loc ranlib X /usr/bin /bin /usr/local/bin`
19423 $test -f $ranlib || ranlib=''
19426 if $test -n "$ranlib"; then
19427 echo "your system has '$ranlib'; we'll use that."
19430 echo "your system doesn't seem to support random libraries"
19431 echo "so we'll use lorder and tsort to order the libraries."
19438 : check for type of arguments to select.
19439 case "$selecttype" in
19440 '') case "$d_select" in
19444 Checking to see what type of arguments are accepted by select().
19446 hdrs="$define sys/types.h
19447 $i_systime sys/time.h
19448 $i_sysselct sys/select.h
19449 $d_socket sys/socket.h"
19450 : The first arg can be int, unsigned, or size_t
19451 : The last arg may or may not be 'const'
19453 : void pointer has been seen but using that
19454 : breaks the selectminbits test
19455 for xxx in 'fd_set *' 'int *'; do
19456 for nfd in 'int' 'size_t' 'unsigned long' 'unsigned' ; do
19457 for tmo in 'struct timeval *' 'const struct timeval *'; do
19459 '') try="extern select _(($nfd, $xxx, $xxx, $xxx, $tmo));"
19460 if ./protochk "$try" $hdrs; then
19461 echo "Your system accepts $xxx."
19470 '') rp='What is the type for the 2nd, 3rd, and 4th arguments to select?'
19471 case "$d_fd_set" in
19472 $define) dflt="fd_set *" ;;
19481 *) : no select, so pick a harmless default
19488 : check for the select 'width'
19489 case "$selectminbits" in
19490 '') safebits=`expr $ptrsize \* 8`
19491 case "$d_select" in
19495 Checking to see on how many bits at a time your select() operates...
19498 #include <sys/types.h>
19500 #$i_systime I_SYS_TIME
19501 #$i_systimek I_SYS_TIME_KERNEL
19506 # ifdef I_SYS_TIME_KERNEL
19509 # include <sys/time.h>
19510 # ifdef I_SYS_TIME_KERNEL
19514 #$i_sysselct I_SYS_SELECT
19515 #ifdef I_SYS_SELECT
19516 #include <sys/select.h>
19518 #$d_socket HAS_SOCKET
19520 # include <sys/socket.h> /* Might include <sys/bsdtypes.h> */
19523 #$i_stdlib I_STDLIB
19525 #include <stdlib.h>
19528 #define S sizeof(*(b))
19530 #define NBYTES (S * 8 > MINBITS ? S : MINBITS/8)
19531 #define NBITS (NBYTES * 8)
19533 char *s = malloc(NBYTES);
19542 fp = fopen("try.c", "r");
19548 b = ($selecttype)s;
19549 for (i = 0; i < NBITS; i++)
19553 select(fd + 1, b, 0, 0, &t);
19554 for (i = NBITS - 1; i > fd && FD_ISSET(i, b); i--);
19556 printf("%d\n", i + 1);
19561 if eval $compile_ok; then
19562 selectminbits=`$run ./try`
19563 case "$selectminbits" in
19565 Cannot figure out on how many bits at a time your select() operates.
19566 I'll play safe and guess it is $safebits bits.
19568 selectminbits=$safebits
19569 bits="$safebits bits"
19572 *) bits="$selectminbits bits" ;;
19574 echo "Your select() operates on $bits at a time." >&4
19576 rp='What is the minimum number of bits your select() operates on?'
19577 case "$byteorder" in
19578 12345678) dflt=64 ;;
19584 selectminbits="$val"
19588 *) : no select, so pick a harmless default
19589 selectminbits=$safebits
19595 : Trace out the files included by signal.h, then look for SIGxxx names.
19596 : Remove SIGARRAYSIZE used by HPUX.
19597 : Remove SIGSTKSIZE used by Linux.
19598 : Remove SIGSTKSZ used by Posix.
19599 : Remove SIGTYP void lines used by OS2.
19600 : Some cpps, like os390, dont give the file name anywhere
19601 if [ "X$fieldn" = X ]; then
19602 : Just make some guesses. We check them later.
19603 xxx='/usr/include/signal.h /usr/include/sys/signal.h'
19605 xxx=`echo '#include <signal.h>' |
19606 $cppstdin $cppminus $cppflags 2>/dev/null |
19607 $grep '^[ ]*#.*include' |
19608 $awk "{print \\$$fieldn}" | $sed 's!"!!g' | $sed 's!\\\\\\\\!/!g' | $sort | $uniq`
19610 : Check this list of files to be sure we have parsed the cpp output ok.
19611 : This will also avoid potentially non-existent files, such
19614 for xx in $xxx /dev/null ; do
19615 $test -f "$xx" && xxxfiles="$xxxfiles $xx"
19617 : If we have found no files, at least try signal.h
19618 case "$xxxfiles" in
19619 '') xxxfiles=`./findhdr signal.h` ;;
19622 $1 ~ /^#define$/ && $2 ~ /^SIG[A-Z0-9]*$/ && $2 !~ /SIGARRAYSIZE/ && $2 !~ /SIGSTKSIZE/ && $2 !~ /SIGSTKSZ/ && $3 !~ /void/ {
19623 print substr($2, 4, 20)
19625 $1 == "#" && $2 ~ /^define$/ && $3 ~ /^SIG[A-Z0-9]*$/ && $3 !~ /SIGARRAYSIZE/ && $4 !~ /void/ {
19626 print substr($3, 4, 20)
19628 : Append some common names just in case the awk scan failed.
19629 xxx="$xxx ABRT ALRM BUS CANCEL CHLD CLD CONT DIL EMT FPE"
19630 xxx="$xxx FREEZE HUP ILL INT IO IOT KILL LOST LWP PHONE"
19631 xxx="$xxx PIPE POLL PROF PWR QUIT RTMAX RTMIN SEGV STKFLT STOP"
19632 xxx="$xxx SYS TERM THAW TRAP TSTP TTIN TTOU URG USR1 USR2"
19633 xxx="$xxx USR3 USR4 VTALRM WAITING WINCH WIND WINDOW XCPU XFSZ"
19635 : generate a few handy files for later
19636 $cat > signal.c <<EOCP
19637 #include <sys/types.h>
19638 #include <signal.h>
19639 #$i_stdlib I_STDLIB
19641 #include <stdlib.h>
19646 /* Strange style to avoid deeply-nested #if/#else/#endif */
19649 # define NSIG (_NSIG)
19655 # define NSIG (SIGMAX+1)
19661 # define NSIG (SIG_MAX+1)
19667 # define NSIG (_SIG_MAX+1)
19673 # define NSIG (MAXSIG+1)
19679 # define NSIG (MAX_SIG+1)
19684 # ifdef SIGARRAYSIZE
19685 # define NSIG SIGARRAYSIZE /* Assume ary[SIGARRAYSIZE] */
19691 # define NSIG (_sys_nsig) /* Solaris 2.5 */
19695 /* Default to some arbitrary number that's big enough to get most
19696 of the common signals.
19702 printf("NSIG %d\n", NSIG);
19708 echo $xxx | $tr ' ' $trnl | $sort | $uniq | $awk '
19710 printf "#ifdef SIG"; printf $1; printf "\n"
19711 printf "printf(\""; printf $1; printf " %%d\\n\",SIG";
19712 printf $1; printf ");\n"
19716 printf "#endif /* JUST_NSIG */\n";
19717 printf "exit(0);\n}\n";
19720 $cat >signal.awk <<'EOP'
19721 BEGIN { ndups = 0 }
19722 $1 ~ /^NSIG$/ { nsig = $2 }
19723 ($1 !~ /^NSIG$/) && (NF == 2) && ($2 ~ /^[0-9][0-9]*$/) {
19724 if ($2 > maxsig) { maxsig = $2 }
19725 if (sig_name[$2]) {
19726 dup_name[ndups] = $1
19727 dup_num[ndups] = $2
19739 printf("NSIG %d\n", nsig);
19740 for (n = 1; n < nsig; n++) {
19742 printf("%s %d\n", sig_name[n], sig_num[n])
19745 printf("NUM%d %d\n", n, n)
19748 for (n = 0; n < ndups; n++) {
19749 printf("%s %d\n", dup_name[n], dup_num[n])
19753 $cat >signal_cmd <<EOS
19755 if $test -s signal.lst; then
19756 echo "Using your existing signal.lst file"
19761 $cat >>signal_cmd <<'EOS'
19764 if eval $compile_ok; then
19765 $run ./signal$_exe | ($sort -n -k 2 2>/dev/null || $sort -n +1) | $uniq | $awk -f signal.awk >signal.lst
19767 echo "(I can't seem be able to compile the whole test program)" >&4
19768 echo "(I'll try it in little pieces.)" >&4
19769 set signal -DJUST_NSIG
19770 if eval $compile_ok; then
19771 $run ./signal$_exe > signal.nsg
19774 echo "I can't seem to figure out how many signals you have." >&4
19775 echo "Guessing 50." >&4
19776 echo 'NSIG 50' > signal.nsg
19778 : Now look at all the signal names, one at a time.
19779 for xx in `echo $xxx | $tr ' ' $trnl | $sort | $uniq`; do
19780 $cat > signal.c <<EOCP
19781 #include <sys/types.h>
19782 #include <signal.h>
19785 printf("$xx %d\n", SIG${xx});
19790 if eval $compile; then
19791 echo "SIG${xx} found."
19792 $run ./signal$_exe >> signal.ls1
19794 echo "SIG${xx} NOT found."
19797 if $test -s signal.ls1; then
19798 $cat signal.nsg signal.ls1 |
19799 $sort -n | $uniq | $awk -f signal.awk >signal.lst
19803 if $test -s signal.lst; then
19806 echo "(AAK! I can't compile the test programs -- Guessing)" >&4
19807 echo 'kill -l' >signal
19808 set X `csh -f <signal`
19812 0) set HUP INT QUIT ILL TRAP ABRT EMT FPE KILL BUS SEGV SYS PIPE ALRM TERM;;
19814 echo $@ | $tr ' ' $trnl | \
19815 $awk '{ printf "%s %d\n", $1, ++s; }
19816 END { printf "NSIG %d\n", ++s }' >signal.lst
19818 $rm -f signal.c signal$_exe signal$_o signal.nsg signal.ls1
19820 chmod a+x signal_cmd
19821 $eunicefix signal_cmd
19823 : generate list of signal names
19825 case "$sig_name_init" in
19827 *) case "$sig_num_init" in
19828 ''|*,*) doinit=yes ;;
19833 echo "Generating a list of signal names and numbers..." >&4
19835 sig_count=`$awk '/^NSIG/ { printf "%d", $2 }' signal.lst`
19836 sig_name=`$awk 'BEGIN { printf "ZERO " }
19837 !/^NSIG/ { printf "%s ", $1 }' signal.lst`
19838 sig_num=`$awk 'BEGIN { printf "0 " }
19839 !/^NSIG/ { printf "%d ", $2 }' signal.lst`
19840 sig_name_init=`$awk 'BEGIN { printf "\"ZERO\", " }
19841 !/^NSIG/ { printf "\"%s\", ", $1 }
19842 END { printf "0\n" }' signal.lst`
19843 sig_num_init=`$awk 'BEGIN { printf "0, " }
19844 !/^NSIG/ { printf "%d, ", $2}
19845 END { printf "0\n"}' signal.lst`
19848 echo "The following $sig_count signals are available:"
19850 echo $sig_name | $awk \
19851 'BEGIN { linelen = 0 }
19853 for (i = 1; i <= NF; i++) {
19854 name = "SIG" $i " "
19855 linelen = linelen + length(name)
19856 if (linelen > 70) {
19858 linelen = length(name)
19864 sig_size=`echo $sig_name | awk '{print NF}'`
19865 $rm -f signal signal.c signal.awk signal.lst signal_cmd
19868 case "$sizetype" in
19869 *_t) zzz="$sizetype" ;;
19870 *) zzz="filesize" ;;
19872 echo "Checking the size of $zzz..." >&4
19874 #include <sys/types.h>
19876 #$i_stdlib I_STDLIB
19878 #include <stdlib.h>
19881 printf("%d\n", (int)sizeof($sizetype));
19886 if eval $compile_ok; then
19890 echo "(I can't execute the test program--guessing $sizesize.)" >&4
19893 echo "Your $zzz size is $sizesize bytes."
19898 echo "(I can't compile the test program--guessing $sizesize.)" >&4
19902 : check for socklen_t
19904 echo "Checking to see if you have socklen_t..." >&4
19906 #include <sys/types.h>
19907 #$d_socket HAS_SOCKET
19909 #include <sys/socket.h>
19911 int main() { socklen_t x = 16; }
19914 if eval $compile; then
19916 echo "You have socklen_t."
19919 echo "You do not have socklen_t."
19920 case "$sizetype" in
19921 size_t) echo "(You do have size_t, that might work. Some people are happy with just an int.)" ;;
19928 : see if this is a socks.h system
19929 set socks.h i_socks
19932 : check for type of the size argument to socket calls
19933 case "$d_socket" in
19937 Checking to see what type is the last argument of accept().
19940 case "$d_socklen_t" in
19941 "$define") yyy="$yyy socklen_t"
19943 yyy="$yyy $sizetype int long unsigned"
19944 for xxx in $yyy; do
19945 case "$socksizetype" in
19946 '') try="extern int accept(int, struct sockaddr *, $xxx *);"
19947 case "$usesocks" in
19949 if ./protochk "$try" $i_systypes sys/types.h $d_socket sys/socket.h literal '#define INCLUDE_PROTOTYPES' $i_socks socks.h.; then
19950 echo "Your system accepts '$xxx *' for the last argument of accept()."
19951 socksizetype="$xxx"
19954 *) if ./protochk "$try" $i_systypes sys/types.h $d_socket sys/socket.h; then
19955 echo "Your system accepts '$xxx *' for the last argument of accept()."
19956 socksizetype="$xxx"
19963 : In case none of those worked, prompt the user.
19964 case "$socksizetype" in
19965 '') rp='What is the type for socket address structure sizes?'
19972 *) : no sockets, so pick relatively harmless default
19977 : see what type is used for signed size_t
19978 set ssize_t ssizetype int stdio.h sys/types.h
19983 #$i_stdlib I_STDLIB
19985 #include <stdlib.h>
19987 #include <sys/types.h>
19988 #define Size_t $sizetype
19989 #define SSize_t $dflt
19992 if (sizeof(Size_t) == sizeof(SSize_t))
19994 else if (sizeof(Size_t) == sizeof(int))
20003 if eval $compile_ok && $run ./try > /dev/null; then
20004 ssizetype=`$run ./try`
20005 echo "I'll be using $ssizetype for functions returning a byte count." >&4
20008 Help! I can't compile and run the ssize_t test program: please enlighten me!
20009 (This is probably a misconfiguration in your system or libraries, and
20010 you really ought to fix it. Still, I'll try anyway.)
20012 I need a type that is the same size as $sizetype, but is guaranteed to
20013 be signed. Common values are ssize_t, int and long.
20016 rp="What signed type is the same size as $sizetype?"
20022 : see what type of char stdio uses.
20024 echo '#include <stdio.h>' > stdio.c
20025 $cppstdin $cppminus < stdio.c > stdioh
20026 if $contains 'unsigned.*char.*_ptr;' stdioh >/dev/null 2>&1 ; then
20027 echo "Your stdio uses unsigned chars." >&4
20028 stdchar="unsigned char"
20030 echo "Your stdio uses signed chars." >&4
20033 $rm -f stdio.* stdioh
20035 : see what type uids are declared as in the kernel
20037 echo "Looking for the type for user ids returned by getuid()."
20038 set uid_t uidtype xxx stdio.h sys/types.h
20042 xxx=`./findhdr sys/user.h`
20043 set `grep '_ruid;' "$xxx" 2>/dev/null` unsigned short
20045 unsigned) dflt="$1 $2" ;;
20049 *) dflt="$uidtype";;
20052 uid_t) echo "uid_t found." ;;
20053 *) rp="What is the type for user ids returned by getuid()?"
20061 *_t) zzz="$uidtype" ;;
20064 echo "Checking the size of $zzz..." >&4
20066 #include <sys/types.h>
20068 #$i_stdlib I_STDLIB
20070 #include <stdlib.h>
20073 printf("%d\n", (int)sizeof($uidtype));
20078 if eval $compile_ok; then
20082 echo "(I can't execute the test program--guessing $uidsize.)" >&4
20085 echo "Your $zzz is $uidsize bytes long."
20090 echo "(I can't compile the test program--guessing $uidsize.)" >&4
20095 *_t) zzz="$uidtype" ;;
20098 echo "Checking the sign of $zzz..." >&4
20100 #include <sys/types.h>
20111 if eval $compile; then
20115 echo "(I can't execute the test program--guessing unsigned.)" >&4
20119 1) echo "Your $zzz is unsigned." ;;
20120 -1) echo "Your $zzz is signed." ;;
20126 echo "(I can't compile the test program--guessing unsigned.)" >&4
20132 $echo "Checking the format string to be used for uids..." >&4
20135 -1) if $test X"$uidsize" = X"$ivsize"; then
20136 uidformat="$ivdformat"
20138 if $test X"$uidsize" = X"$longsize"; then
20141 if $test X"$uidsize" = X"$intsize"; then
20144 if $test X"$uidsize" = X"$shortsize"; then
20151 *) if $test X"$uidsize" = X"$uvsize"; then
20152 uidformat="$uvuformat"
20154 if $test X"$uidsize" = X"$longsize"; then
20157 if $test X"$uidsize" = X"$intsize"; then
20160 if $test X"$uidsize" = X"$shortsize"; then
20170 case "$usesitecustomize" in
20171 $define|true|[Yy]*)
20172 usesitecustomize="$define"
20175 usesitecustomize="$undef"
20179 : determine compiler compiler
20188 if $test -f "$byacc$_exe"; then
20190 comp="byacc or $comp"
20192 if $test -f "$bison$_exe"; then
20193 comp="$comp or bison -y"
20195 rp="Which compiler compiler ($comp) shall I use?"
20204 echo "(Adding -y option to bison to get yacc-compatible behaviour.)"
20210 : see if this is a fp.h system
20214 : see if this is a fp_class.h system
20215 set fp_class.h i_fp_class
20218 : see if this is a ieeefp.h system
20219 case "$i_ieeefp" in
20220 '' ) set ieeefp.h i_ieeefp
20225 : see if this is a libutil.h system
20226 set libutil.h i_libutil
20229 : see if mach cthreads are available
20230 if test "X$usethreads" = "X$define"; then
20231 set mach/cthreads.h i_machcthr
20234 i_machcthr="$undef"
20239 : see if this is a mntent.h system
20240 set mntent.h i_mntent
20243 : see if ndbm.h is available
20249 # Some Linux distributions such as RedHat 7.1 put the
20250 # ndbm.h header in /usr/include/gdbm/ndbm.h.
20251 if $test -f /usr/include/gdbm/ndbm.h; then
20252 echo '<gdbm/ndbm.h> found.'
20253 ccflags="$ccflags -I/usr/include/gdbm"
20254 cppflags="$cppflags -I/usr/include/gdbm"
20262 : see if dbm_open exists
20263 set dbm_open d_dbm_open
20265 case "$d_dbm_open" in
20268 echo "We won't be including <ndbm.h>"
20277 : see if net/errno.h is available
20279 set net/errno.h val
20282 : Unfortunately, it causes problems on some systems. Arrgh.
20285 cat > try.c <<'EOM'
20288 #include <net/errno.h>
20294 if $cc $ccflags -c try.c >/dev/null 2>&1; then
20295 echo "We'll be including <net/errno.h>." >&4
20297 echo "We won't be including <net/errno.h>." >&4
20306 : see if netinet/tcp.h is available
20307 set netinet/tcp.h i_netinettcp
20310 : see if this is a poll.h system
20314 : see if this is a prot.h system
20319 $echo "Guessing which symbols your C compiler and preprocessor define..." >&4
20320 $cat <<'EOSH' > Cppsym.know
20321 a29k ABI64 aegis AES_SOURCE AIX AIX32 AIX370
20322 AIX41 AIX42 AIX43 AIX_SOURCE aixpc ALL_SOURCE
20323 alliant alpha am29000 AM29000 AMD64 amd64 amiga AMIGAOS AMIX
20324 ansi ANSI_C_SOURCE apollo ardent ARM32 atarist att386 att3b
20325 BeOS BIG_ENDIAN BIT_MSF bsd BSD bsd43 bsd4_2 bsd4_3 BSD4_3 bsd4_4
20326 BSD_4_3 BSD_4_4 BSD_NET2 BSD_TIME BSD_TYPES BSDCOMPAT bsdi
20327 bull c cadmus clipper CMU COFF COMPILER_VERSION
20328 concurrent convex cpu cray CRAY CRAYMPP ctix CX_UX
20329 CYGWIN DECC DGUX DGUX_SOURCE DJGPP dmert DOLPHIN DPX2 DSO
20330 Dynix DynixPTX ELF encore EPI EXTENSIONS FAVOR_BSD
20331 FILE_OFFSET_BITS FreeBSD GCC_NEW_VARARGS gcos gcx gimpel
20333 GNU_SOURCE GNUC GNUC_MINOR GNU_LIBRARY GO32 gould GOULD_PN
20334 H3050R H3050RX hbullx20 hcx host_mips
20335 hp200 hp300 hp700 HP700 hp800 hp9000
20336 hp9000s200 hp9000s300 hp9000s400 hp9000s500
20337 hp9000s700 hp9000s800 hp9k8 hp_osf hppa hpux HPUX_SOURCE
20338 i186 i286 i386 i486 i586 i686 i8086 i80960 i860 I960
20339 IA64 iAPX286 ibm ibm032 ibmesa IBMR2 ibmrt ILP32 ILP64
20340 INLINE_INTRINSICS INTRINSICS INT64 interdata is68k ksr1
20341 LANGUAGE_C LARGE_FILE_API LARGEFILE64_SOURCE
20342 LARGEFILE_SOURCE LFS64_LARGEFILE LFS_LARGEFILE
20343 Linux LITTLE_ENDIAN LONG64 LONG_DOUBLE LONG_LONG
20344 LONGDOUBLE LONGLONG LP64 luna luna88k Lynx
20345 M68000 m68k m88100 m88k M88KBCS_TARGET M_COFF
20346 M_I186 M_I286 M_I386 M_I8086 M_I86 M_I86SM M_SYS3
20347 M_SYS5 M_SYSIII M_SYSV M_UNIX M_XENIX MACH machine MachTen
20348 MATH_HAS_NO_SIDE_EFFECTS
20349 mc300 mc500 mc68000 mc68010 mc68020 mc68030 mc68040
20350 mc68060 mc68k mc68k32 mc700 mc88000 mc88100 merlin
20351 mert MiNT mips MIPS_FPSET MIPS_ISA MIPS_SIM MIPS_SZINT
20352 MIPS_SZLONG MIPS_SZPTR MIPSEB MIPSEL MODERN_C motorola
20353 mpeix MSDOS MTXINU MULTIMAX mvs MVS n16 ncl_el ncl_mr
20354 NetBSD news1500 news1700 news1800 news1900 news3700
20355 news700 news800 news900 NeXT NLS nonstopux ns16000 ns32000
20356 ns32016 ns32332 ns32k nsc32000
20357 OCS88 OEMVS OpenBSD os OS2 OS390 osf OSF1 OSF_SOURCE
20358 pa_risc PA_RISC1_1 PA_RISC2_0 PARAGON parisc
20359 pc532 pdp11 PGC PIC plexus PORTAR posix
20360 POSIX1B_SOURCE POSIX2_SOURCE POSIX4_SOURCE
20361 POSIX_C_SOURCE POSIX_SOURCE POWER
20362 PROTOTYPES PWB pyr QNX R3000 REENTRANT RES Rhapsody RISC6000
20363 riscix riscos RT S390 SA110 scs SCO sequent sgi SGI_SOURCE SH3 sinix
20364 SIZE_INT SIZE_LONG SIZE_PTR SOCKET_SOURCE SOCKETS_SOURCE
20365 sony sony_news sonyrisc sparc sparclite spectrum
20366 stardent stdc STDC_EXT stratos sun sun3 sun386
20367 Sun386i svr3 svr4 SVR4_2 SVR4_SOURCE svr5
20368 SX system SYSTYPE_BSD SYSTYPE_BSD43 SYSTYPE_BSD44
20369 SYSTYPE_SVR4 SYSTYPE_SVR5 SYSTYPE_SYSV SYSV SYSV3 SYSV4 SYSV5
20370 sysV68 sysV88 Tek4132 Tek4300 titan
20371 TM3200 TM5400 TM5600
20372 tower tower32 tower32_200 tower32_600 tower32_700
20373 tower32_800 tower32_850 tss
20374 u370 u3b u3b2 u3b20 u3b200 u3b20d u3b5
20375 ultrix UMAXV UnicomPBB UnicomPBD UNICOS UNICOSMK
20376 unix UNIX95 UNIX99 unixpc unos
20377 USE_BSD USE_FILE_OFFSET64 USE_GNU USE_ISOC9X USE_LARGEFILE USE_LARGEFILE64
20378 USE_MISC USE_POSIX USE_POSIX199309 USE_POSIX199506 USE_POSIX2
20379 USE_REENTRANT USE_SVID USE_UNIX98 USE_XOPEN USE_XOPEN_EXTENDED
20381 Utek UTek UTS UWIN uxpm uxps vax venix VMESA vms x86_64 xenix Xenix286
20382 XOPEN_SOURCE XOPEN_SOURCE_EXTENDED XPG2 XPG2_EXTENDED
20383 XPG3 XPG3_EXTENDED XPG4 XPG4_EXTENDED
20386 # Maybe put other stuff here too.
20387 cat <<EOSH >>Cppsym.know
20390 ./tr '[a-z]' '[A-Z]' < Cppsym.know > Cppsym.a
20391 ./tr '[A-Z]' '[a-z]' < Cppsym.know > Cppsym.b
20392 $cat Cppsym.know > Cppsym.c
20393 $cat Cppsym.a Cppsym.b Cppsym.c | $tr ' ' $trnl | $sort | $uniq > Cppsym.know
20394 $rm -f Cppsym.a Cppsym.b Cppsym.c
20395 cat <<EOSH > Cppsym
20397 if $test \$# -gt 0; then
20398 echo \$* | $tr " " "$trnl" | ./Cppsym.try > Cppsym.got
20399 if $test -s Cppsym.got; then
20406 $tr " " "$trnl" | ./Cppsym.try
20412 cat <<EOSH > Cppsym.try
20414 cat <<'EOCP' > try.c
20417 #define STRINGIFY(a) "a"
20419 #if cpp_stuff == 42
20420 #define StGiFy(a) #a
20421 #define STRINGIFY(a) StGiFy(a)
20423 #if $cpp_stuff != 1 && $cpp_stuff != 42
20424 # include "Bletch: How does this C preprocessor stringify macros?"
20430 cat <<'EOSH' >> Cppsym.try
20432 printf "#ifdef %s\nprintf(\"%s=%%s\\n\", STRINGIFY(%s));\n#endif\n", $1, $1, $1
20433 printf "#ifdef _%s\nprintf(\"_%s=%%s\\n\", STRINGIFY(_%s));\n#endif\n", $1, $1, $1
20434 printf "#ifdef __%s\nprintf(\"__%s=%%s\\n\", STRINGIFY(__%s));\n#endif\n", $1, $1, $1
20435 printf "#ifdef __%s__\nprintf(\"__%s__=%%s\\n\", STRINGIFY(__%s__));\n#endif\n", $1, $1, $1
20437 echo 'return 0;}' >> try.c
20439 cat <<EOSH >> Cppsym.try
20441 case "$osname-$gccversion" in
20442 irix-) ccflags="\$ccflags -woff 1178" ;;
20443 os2-*) ccflags="\$ccflags -Zlinker /PM:VIO" ;;
20445 $cc -o try -Dcpp_stuff=$cpp_stuff $optimize \$ccflags $ldflags try.c $libs && $run ./try | $sed 's/ /\\\\ /g'
20447 chmod +x Cppsym.try
20448 $eunicefix Cppsym.try
20449 ./Cppsym < Cppsym.know > Cppsym.true
20450 : Add in any linux cpp "predefined macros":
20451 case "$osname::$gccversion" in
20454 rm -f $tHdrH'.h' $tHdrH
20456 if cpp -dM $tHdrH'.h' > $tHdrH'_cppsym.h' && [ -s $tHdrH'_cppsym.h' ]; then
20457 sed 's/#define[\ \ ]*//;s/[\ \ ].*$//' <$tHdrH'_cppsym.h' >$tHdrH'_cppsym.real'
20458 if [ -s $tHdrH'_cppsym.real' ]; then
20459 cat $tHdrH'_cppsym.real' Cppsym.know | sort | uniq | ./Cppsym | sort | uniq > Cppsym.true
20462 rm -f $tHdrH'.h' $tHdrH'_cppsym.h' $tHdrH'_cppsym.real'
20465 : now check the C compiler for additional symbols
20466 postprocess_cc_v=''
20468 aix) postprocess_cc_v="|$tr , ' '" ;;
20475 for i in \`$cc -v -c tmp.c 2>&1 $postprocess_cc_v\`
20478 -D*) echo "\$i" | $sed 's/^-D//';;
20479 -A*) $test "$gccversion" && echo "\$i" | $sed 's/^-A//' | $sed 's/\(.*\)(\(.*\))/\1=\2/';;
20484 postprocess_cc_v=''
20487 ./ccsym > ccsym1.raw
20488 if $test -s ccsym1.raw; then
20489 $sort ccsym1.raw | $uniq >ccsym.raw
20491 mv ccsym1.raw ccsym.raw
20494 $awk '/\=/ { print $0; next }
20495 { print $0"=1" }' ccsym.raw >ccsym.list
20496 $comm -13 Cppsym.true ccsym.list >ccsym.own
20497 $comm -12 Cppsym.true ccsym.list >ccsym.com
20498 $comm -23 Cppsym.true ccsym.list >ccsym.cpp
20500 if $test -z ccsym.raw; then
20501 echo "Your C compiler doesn't seem to define any symbols!" >&4
20503 echo "However, your C preprocessor defines the following symbols:"
20506 cppsymbols=`$cat Cppsym.true`
20507 cppsymbols=`echo $cppsymbols`
20508 cppccsymbols="$cppsymbols"
20510 if $test -s ccsym.com; then
20511 echo "Your C compiler and pre-processor define these symbols:"
20512 $sed -e 's/\(..*\)=.*/\1/' ccsym.com
20515 cppccsymbols=`$cat ccsym.com`
20516 cppccsymbols=`echo $cppccsymbols`
20517 $test "$silent" || sleep 1
20519 if $test -s ccsym.cpp; then
20520 $test "$also" && echo " "
20521 echo "Your C pre-processor ${also}defines the following symbols:"
20522 $sed -e 's/\(..*\)=.*/\1/' ccsym.cpp
20524 cppsymbols=`$cat ccsym.cpp`
20525 cppsymbols=`echo $cppsymbols`
20526 $test "$silent" || sleep 1
20528 if $test -s ccsym.own; then
20529 $test "$also" && echo " "
20530 echo "Your C compiler ${also}defines the following cpp symbols:"
20531 $sed -e 's/\(..*\)=1/\1/' ccsym.own
20532 $sed -e 's/\(..*\)=.*/\1/' ccsym.own | $uniq >>Cppsym.true
20533 ccsymbols=`$cat ccsym.own`
20534 ccsymbols=`echo $ccsymbols`
20535 $test "$silent" || sleep 1
20539 : see if this is a termio system
20543 if $test `./findhdr termios.h`; then
20544 set tcsetattr i_termios
20550 "$define") echo "You have POSIX termios.h... good!" >&4;;
20551 *) if ./Cppsym pyr; then
20552 case "`/bin/universe`" in
20553 ucb) if $test `./findhdr sgtty.h`; then
20555 echo "<sgtty.h> found." >&4
20557 echo "System is pyramid with BSD universe."
20558 echo "<sgtty.h> not found--you could have problems." >&4
20560 *) if $test `./findhdr termio.h`; then
20562 echo "<termio.h> found." >&4
20564 echo "System is pyramid with USG universe."
20565 echo "<termio.h> not found--you could have problems." >&4
20569 if $test `./findhdr termio.h`; then
20570 echo "<termio.h> found." >&4
20572 elif $test `./findhdr sgtty.h`; then
20573 echo "<sgtty.h> found." >&4
20576 echo "Neither <termio.h> nor <sgtty.h> found--you could have problems." >&4
20579 if $test `./findhdr sgtty.h`; then
20580 echo "<sgtty.h> found." >&4
20582 elif $test `./findhdr termio.h`; then
20583 echo "<termio.h> found." >&4
20586 echo "Neither <sgtty.h> nor <termio.h> found--you could have problems." >&4
20590 set i_termio; eval $setvar
20591 val=$val2; set i_sgtty; eval $setvar
20592 val=$val3; set i_termios; eval $setvar
20594 : see if stddef is available
20595 set stddef.h i_stddef
20598 : see if this is a sunmath.h system
20599 set sunmath.h i_sunmath
20602 : see if sys/access.h is available
20603 set sys/access.h i_sysaccess
20606 : see if ioctl defs are in sgtty, termio, sys/filio or sys/ioctl
20607 set sys/filio.h i_sysfilio
20610 if $test `./findhdr sys/ioctl.h`; then
20612 echo '<sys/ioctl.h> found.' >&4
20615 if $test $i_sysfilio = "$define"; then
20616 echo '<sys/ioctl.h> NOT found.' >&4
20618 $test $i_sgtty = "$define" && xxx="sgtty.h"
20619 $test $i_termio = "$define" && xxx="termio.h"
20620 $test $i_termios = "$define" && xxx="termios.h"
20621 echo "No <sys/ioctl.h> found, assuming ioctl args are defined in <$xxx>." >&4
20627 : see if socket ioctl defs are in sys/sockio.h
20629 xxx=`./findhdr sys/sockio.h`
20630 if $test "$xxx"; then
20631 if $contains SIOCATMARK $xxx >/dev/null 2>&1; then
20633 echo "You have socket ioctls defined in <sys/sockio.h>." >&4
20636 echo "No socket ioctls found in <sys/sockio.h>." >&4
20641 <sys/sockio.h> not found, assuming socket ioctls are in <sys/ioctl.h>.
20648 : see if this is a syslog.h system
20649 set syslog.h i_syslog
20653 : see if this is a sys/mode.h system
20654 set sys/mode.h i_sysmode
20657 : see if sys/resource.h has to be included
20658 set sys/resource.h i_sysresrc
20661 : see if sys/security.h is available
20662 set sys/security.h i_syssecrt
20665 : see if this is a sys/statvfs.h system
20666 set sys/statvfs.h i_sysstatvfs
20669 : see if this is a sys/un.h system
20670 set sys/un.h i_sysun
20674 : see if this is a sys/utsname.h system
20675 set sys/utsname.h i_sysutsname
20678 : see if this is a syswait system
20679 set sys/wait.h i_syswait
20682 : see if this is a ustat.h system
20683 set ustat.h i_ustat
20686 : see if this is an utime system
20687 set utime.h i_utime
20690 : see if this is a values.h system
20691 set values.h i_values
20694 : see if this is a vfork system
20697 set vfork.h i_vfork
20705 : see if gdbm.h is available
20710 : see if gdbm_open exists
20711 set gdbm_open d_gdbm_open
20713 case "$d_gdbm_open" in
20716 echo "We won't be including <gdbm.h>"
20726 echo "Looking for extensions..." >&4
20727 : If we are using the old config.sh, known_extensions may contain
20728 : old or inaccurate or duplicate values.
20729 known_extensions=''
20730 nonxs_extensions=''
20731 : We do not use find because it might not be available.
20732 : We do not just use MANIFEST because the user may have dropped
20733 : some additional extensions into the source tree and expect them
20736 : Function to recursively find available extensions, ignoring DynaLoader
20737 : NOTE: recursion limit of 10 to prevent runaway in case of symlink madness
20741 DynaLoader|dynaload) ;;
20743 if $test -f $xxx/$xxx.xs; then
20744 known_extensions="$known_extensions $1$xxx";
20745 elif $test -f $xxx/Makefile.PL; then
20746 nonxs_extensions="$nonxs_extensions $1$xxx";
20748 if $test -d $xxx -a $# -lt 10; then
20751 eval $find_extensions;
20763 eval $find_extensions
20764 # Special case: Add in threads/shared since it is not picked up by the
20765 # recursive find above (and adding in general recursive finding breaks
20766 # SDBM_File/sdbm). A.D. 10/25/2001.
20767 known_extensions="$known_extensions threads/shared"
20768 set X $nonxs_extensions
20770 nonxs_extensions="$*"
20771 set X $known_extensions
20773 known_extensions="$*"
20776 : Now see which are supported on this system.
20778 for xxx in $known_extensions ; do
20782 $define) avail_ext="$avail_ext $xxx" ;;
20785 GDBM_File|gdbm_fil)
20787 $define) avail_ext="$avail_ext $xxx" ;;
20790 I18N/Langinfo|i18n_lan)
20791 case "$i_langinfo$d_nl_langinfo" in
20792 $define$define) avail_ext="$avail_ext $xxx" ;;
20795 NDBM_File|ndbm_fil)
20798 case "$osname-$use64bitint" in
20801 *-lndbm*) avail_ext="$avail_ext $xxx" ;;
20804 *) avail_ext="$avail_ext $xxx" ;;
20809 ODBM_File|odbm_fil)
20810 case "${i_dbm}${i_rpcsvcdbm}" in
20812 case "$osname-$use64bitint" in
20815 *-ldbm*) avail_ext="$avail_ext $xxx" ;;
20818 *) avail_ext="$avail_ext $xxx" ;;
20824 case "$useposix" in
20825 true|define|y) avail_ext="$avail_ext $xxx" ;;
20829 case "$useopcode" in
20830 true|define|y) avail_ext="$avail_ext $xxx" ;;
20834 case "$d_socket" in
20837 beos) ;; # not unless BONE
20838 *) avail_ext="$avail_ext $xxx" ;;
20843 Sys/Syslog|sys/syslog)
20844 : XXX syslog requires socket
20845 case "$d_socket" in
20846 true|$define|y) avail_ext="$avail_ext $xxx" ;;
20850 case "$usethreads" in
20852 case "$useithreads" in
20853 $undef|false|[nN]*) avail_ext="$avail_ext $xxx" ;;
20857 XS/APItest|xs/apitest)
20858 # This is just for testing. Skip it unless we have dynamic loading.
20861 $define) avail_ext="$avail_ext $xxx" ;;
20864 XS/Typemap|xs/typemap)
20865 # This is just for testing. Skip it unless we have dynamic loading.
20867 $define) avail_ext="$avail_ext $xxx" ;;
20870 threads|threads/shared)
20871 # threads and threads::shared are special cases.
20872 # To stop people from asking "Perl 5.8.0 was supposed
20873 # to have this new fancy threads implementation but my
20874 # perl doesn't have it" and from people trying to
20875 # (re)install the threads module using CPAN.pm and
20876 # CPAN.pm then offering to reinstall Perl 5.8.0,
20877 # the threads.pm and threads/shared.pm will always be
20878 # there, croaking informatively ("you need to rebuild
20879 # all of Perl with threads, sorry") when threads haven't
20880 # been compiled in.
20882 avail_ext="$avail_ext $xxx"
20885 : XXX Do we need a useipcsysv variable here
20886 case "${d_msg}${d_sem}${d_shm}" in
20887 *"${define}"*) avail_ext="$avail_ext $xxx" ;;
20890 *) avail_ext="$avail_ext $xxx"
20899 case "$onlyextensions" in
20901 *) keepextensions=''
20902 echo "You have requested that only certains extensions be included..." >&4
20903 for i in $onlyextensions; do
20904 case " $avail_ext " in
20906 echo "Keeping extension $i."
20907 keepextensions="$keepextensions $i"
20909 *) echo "Ignoring extension $i." ;;
20912 avail_ext="$keepextensions"
20916 case "$noextensions" in
20918 *) keepextensions=''
20919 echo "You have requested that certain extensions be ignored..." >&4
20920 for i in $avail_ext; do
20921 case " $noextensions " in
20922 *" $i "*) echo "Ignoring extension $i." ;;
20923 *) echo "Keeping extension $i.";
20924 keepextensions="$keepextensions $i"
20928 avail_ext="$keepextensions"
20932 : Now see which nonxs extensions are supported on this system.
20933 : For now assume all are.
20935 for xxx in $nonxs_extensions ; do
20937 *) nonxs_ext="$nonxs_ext $xxx"
20949 A number of extensions are supplied with $package. You may choose to
20950 compile these extensions for dynamic loading (the default), compile
20951 them into the $package executable (static loading), or not include
20952 them at all. Answer "none" to include no extensions.
20953 Note that DynaLoader is always built and need not be mentioned here.
20956 case "$dynamic_ext" in
20958 : Exclude those listed in static_ext
20960 for xxx in $avail_ext; do
20961 case " $static_ext " in
20963 *) dflt="$dflt $xxx" ;;
20970 *) dflt="$dynamic_ext"
20971 # Perhaps we are reusing an old out-of-date config.sh.
20974 if test X"$dynamic_ext" != X"$avail_ext"; then
20976 NOTICE: Your previous config.sh list may be incorrect.
20977 The extensions now available to you are
20979 but the default list from your previous config.sh is
20991 rp="What extensions do you wish to load dynamically?"
20994 none) dynamic_ext=' ' ;;
20995 *) dynamic_ext="$ans" ;;
20998 case "$static_ext" in
21000 : Exclude those already listed in dynamic linking
21002 for xxx in $avail_ext; do
21003 case " $dynamic_ext " in
21005 *) dflt="$dflt $xxx" ;;
21012 *) dflt="$static_ext"
21019 rp="What extensions do you wish to load statically?"
21022 none) static_ext=' ' ;;
21023 *) static_ext="$ans" ;;
21028 A number of extensions are supplied with $package. Answer "none"
21029 to include no extensions.
21030 Note that DynaLoader is always built and need not be mentioned here.
21033 case "$static_ext" in
21034 '') dflt="$avail_ext" ;;
21035 *) dflt="$static_ext"
21036 # Perhaps we are reusing an old out-of-date config.sh.
21039 if test X"$static_ext" != X"$avail_ext"; then
21041 NOTICE: Your previous config.sh list may be incorrect.
21042 The extensions now available to you are
21044 but the default list from your previous config.sh is
21053 : Exclude those that are not xs extensions
21057 rp="What extensions do you wish to include?"
21060 none) static_ext=' ' ;;
21061 *) static_ext="$ans" ;;
21066 # Encode is a special case. If we are building Encode as a static
21067 # extension, we need to explicitly list its subextensions as well.
21068 # For other nested extensions, this is handled automatically by
21069 # the appropriate Makefile.PL.
21070 case " $static_ext " in
21071 *" Encode "*) # Add the subextensions of Encode
21073 for xxx in `ls Encode/*/Makefile.PL|awk -F/ '{print $2}'`; do
21074 static_ext="$static_ext Encode/$xxx"
21080 set X $dynamic_ext $static_ext $nonxs_ext
21084 # Sanity check: We require an extension suitable for use with
21085 # AnyDBM_File, as well as Fcntl and IO. (Failure to have these
21086 # should show up as failures in the test suite, but it's helpful to
21087 # catch them now.) The 'extensions' list is normally sorted
21088 # alphabetically, so we need to accept either
21089 # DB_File ... Fcntl ... IO ....
21090 # or something like
21091 # Fcntl ... NDBM_File ... IO ....
21092 case " $extensions" in
21093 *"_File "*" Fcntl "*" IO "*) ;; # DB_File
21094 *" Fcntl "*"_File "*" IO "*) ;; # GDBM_File
21095 *" Fcntl "*" IO "*"_File "*) ;; # NDBM_File
21096 *) echo "WARNING: Extensions DB_File or *DBM_File, Fcntl, and IO not configured." >&4
21097 echo "WARNING: The Perl you are building will be quite crippled." >& 4
21101 : Remove libraries needed only for extensions
21102 : The appropriate ext/Foo/Makefile.PL will add them back in, if necessary.
21103 : The exception is SunOS 4.x, which needs them.
21104 case "${osname}X${osvers}" in
21108 *) case "$usedl" in
21109 $define|true|[yY]*)
21110 set X `echo " $libs " | sed -e 's@ -lndbm @ @' -e 's@ -lgdbm @ @' -e 's@ -ldbm @ @' -e 's@ -ldb @ @'`
21114 *) perllibs="$libs"
21120 : Remove build directory name from cppstdin so it can be used from
21121 : either the present location or the final installed location.
21123 : Get out of the UU directory to get correct path name.
21125 case "$cppstdin" in
21127 echo "Stripping down cppstdin path name"
21133 : end of configuration questions
21135 echo "End of configuration questions."
21138 : back to where it started
21139 if test -d ../UU; then
21143 : configuration may be patched via a 'config.arch' file
21144 if $test -f config.arch; then
21145 echo "I see a config.arch file, loading it."
21149 : configuration may be patched via a 'config.over' file
21150 if $test -f config.over; then
21153 rp='I see a config.over file. Do you wish to load it?'
21156 n*) echo "OK, I'll ignore it.";;
21158 echo "Configuration override changes have been loaded."
21163 : in case they want portability, strip down executable paths
21164 case "$d_portable" in
21167 echo "Stripping down executable paths..." >&4
21168 for file in $loclist $trylist; do
21170 eval $file=`basename $temp`
21175 : create config.sh file
21177 echo "Creating config.sh..." >&4
21178 $spitshell <<EOT >config.sh
21181 # This file was produced by running the Configure script. It holds all the
21182 # definitions figured out by Configure. Should you modify one of these values,
21183 # do not forget to propagate your changes by running "Configure -der". You may
21184 # instead choose to run each of the .SH files by yourself, or "Configure -S".
21187 # Package name : $package
21188 # Source directory : $src
21189 # Configuration time: $cf_time
21190 # Configured by : $cf_by
21191 # Target system : $myuname
21201 Revision='$Revision'
21209 alignbytes='$alignbytes'
21210 ansi2knr='$ansi2knr'
21211 aphostname='$aphostname'
21212 api_revision='$api_revision'
21213 api_subversion='$api_subversion'
21214 api_version='$api_version'
21215 api_versionstring='$api_versionstring'
21218 archlibexp='$archlibexp'
21219 archname64='$archname64'
21220 archname='$archname'
21221 archobjs='$archobjs'
21222 asctime_r_proto='$asctime_r_proto'
21230 byteorder='$byteorder'
21232 castflags='$castflags'
21235 cccdlflags='$cccdlflags'
21236 ccdlflags='$ccdlflags'
21238 ccflags_uselargefiles='$ccflags_uselargefiles'
21240 ccsymbols='$ccsymbols'
21241 ccversion='$ccversion'
21243 cf_email='$cf_email'
21245 charsize='$charsize'
21249 clocktype='$clocktype'
21251 compress='$compress'
21252 contains='$contains'
21256 cpp_stuff='$cpp_stuff'
21257 cppccsymbols='$cppccsymbols'
21258 cppflags='$cppflags'
21260 cppminus='$cppminus'
21262 cppstdin='$cppstdin'
21263 cppsymbols='$cppsymbols'
21264 crypt_r_proto='$crypt_r_proto'
21265 cryptlib='$cryptlib'
21267 ctermid_r_proto='$ctermid_r_proto'
21268 ctime_r_proto='$ctime_r_proto'
21269 d_Gconvert='$d_Gconvert'
21270 d_PRIEUldbl='$d_PRIEUldbl'
21271 d_PRIFUldbl='$d_PRIFUldbl'
21272 d_PRIGUldbl='$d_PRIGUldbl'
21273 d_PRIXU64='$d_PRIXU64'
21274 d_PRId64='$d_PRId64'
21275 d_PRIeldbl='$d_PRIeldbl'
21276 d_PRIfldbl='$d_PRIfldbl'
21277 d_PRIgldbl='$d_PRIgldbl'
21278 d_PRIi64='$d_PRIi64'
21279 d_PRIo64='$d_PRIo64'
21280 d_PRIu64='$d_PRIu64'
21281 d_PRIx64='$d_PRIx64'
21282 d_SCNfldbl='$d_SCNfldbl'
21283 d__fwalk='$d__fwalk'
21284 d_access='$d_access'
21285 d_accessx='$d_accessx'
21288 d_archlib='$d_archlib'
21289 d_asctime_r='$d_asctime_r'
21292 d_attribute_format='$d_attribute_format'
21293 d_attribute_malloc='$d_attribute_malloc'
21294 d_attribute_nonnull='$d_attribute_nonnull'
21295 d_attribute_noreturn='$d_attribute_noreturn'
21296 d_attribute_pure='$d_attribute_pure'
21297 d_attribute_unused='$d_attribute_unused'
21298 d_attribute_warn_unused_result='$d_attribute_warn_unused_result'
21302 d_bsdgetpgrp='$d_bsdgetpgrp'
21303 d_bsdsetpgrp='$d_bsdsetpgrp'
21304 d_builtin_choose_expr='$d_builtin_choose_expr'
21305 d_builtin_expect='$d_builtin_expect'
21307 d_casti32='$d_casti32'
21308 d_castneg='$d_castneg'
21309 d_charvspr='$d_charvspr'
21311 d_chroot='$d_chroot'
21312 d_chsize='$d_chsize'
21314 d_clearenv='$d_clearenv'
21315 d_closedir='$d_closedir'
21316 d_cmsghdr_s='$d_cmsghdr_s'
21318 d_copysignl='$d_copysignl'
21320 d_crypt_r='$d_crypt_r'
21322 d_ctermid_r='$d_ctermid_r'
21323 d_ctime_r='$d_ctime_r'
21324 d_cuserid='$d_cuserid'
21325 d_c99_variadic_macros='$d_c99_variadic_macros'
21326 d_dbl_dig='$d_dbl_dig'
21327 d_dbminitproto='$d_dbminitproto'
21328 d_difftime='$d_difftime'
21330 d_dirnamlen='$d_dirnamlen'
21331 d_dlerror='$d_dlerror'
21332 d_dlopen='$d_dlopen'
21333 d_dlsymun='$d_dlsymun'
21334 d_dosuid='$d_dosuid'
21335 d_drand48_r='$d_drand48_r'
21336 d_drand48proto='$d_drand48proto'
21338 d_eaccess='$d_eaccess'
21339 d_endgrent='$d_endgrent'
21340 d_endgrent_r='$d_endgrent_r'
21341 d_endhent='$d_endhent'
21342 d_endhostent_r='$d_endhostent_r'
21343 d_endnent='$d_endnent'
21344 d_endnetent_r='$d_endnetent_r'
21345 d_endpent='$d_endpent'
21346 d_endprotoent_r='$d_endprotoent_r'
21347 d_endpwent='$d_endpwent'
21348 d_endpwent_r='$d_endpwent_r'
21349 d_endsent='$d_endsent'
21350 d_endservent_r='$d_endservent_r'
21351 d_eofnblk='$d_eofnblk'
21352 d_eunice='$d_eunice'
21353 d_faststdio='$d_faststdio'
21354 d_fchdir='$d_fchdir'
21355 d_fchmod='$d_fchmod'
21356 d_fchown='$d_fchown'
21358 d_fcntl_can_lock='$d_fcntl_can_lock'
21359 d_fd_macros='$d_fd_macros'
21360 d_fd_set='$d_fd_set'
21361 d_fds_bits='$d_fds_bits'
21362 d_fgetpos='$d_fgetpos'
21363 d_finite='$d_finite'
21364 d_finitel='$d_finitel'
21365 d_flexfnam='$d_flexfnam'
21367 d_flockproto='$d_flockproto'
21369 d_fp_class='$d_fp_class'
21370 d_fpathconf='$d_fpathconf'
21371 d_fpclass='$d_fpclass'
21372 d_fpclassify='$d_fpclassify'
21373 d_fpclassl='$d_fpclassl'
21374 d_fpos64_t='$d_fpos64_t'
21375 d_frexpl='$d_frexpl'
21376 d_fs_data_s='$d_fs_data_s'
21377 d_fseeko='$d_fseeko'
21378 d_fsetpos='$d_fsetpos'
21379 d_fstatfs='$d_fstatfs'
21380 d_fstatvfs='$d_fstatvfs'
21382 d_ftello='$d_ftello'
21384 d_futimes='$d_futimes'
21385 d_getcwd='$d_getcwd'
21386 d_getespwnam='$d_getespwnam'
21387 d_getfsstat='$d_getfsstat'
21388 d_getgrent='$d_getgrent'
21389 d_getgrent_r='$d_getgrent_r'
21390 d_getgrgid_r='$d_getgrgid_r'
21391 d_getgrnam_r='$d_getgrnam_r'
21392 d_getgrps='$d_getgrps'
21393 d_gethbyaddr='$d_gethbyaddr'
21394 d_gethbyname='$d_gethbyname'
21395 d_gethent='$d_gethent'
21396 d_gethname='$d_gethname'
21397 d_gethostbyaddr_r='$d_gethostbyaddr_r'
21398 d_gethostbyname_r='$d_gethostbyname_r'
21399 d_gethostent_r='$d_gethostent_r'
21400 d_gethostprotos='$d_gethostprotos'
21401 d_getitimer='$d_getitimer'
21402 d_getlogin='$d_getlogin'
21403 d_getlogin_r='$d_getlogin_r'
21404 d_getmnt='$d_getmnt'
21405 d_getmntent='$d_getmntent'
21406 d_getnbyaddr='$d_getnbyaddr'
21407 d_getnbyname='$d_getnbyname'
21408 d_getnent='$d_getnent'
21409 d_getnetbyaddr_r='$d_getnetbyaddr_r'
21410 d_getnetbyname_r='$d_getnetbyname_r'
21411 d_getnetent_r='$d_getnetent_r'
21412 d_getnetprotos='$d_getnetprotos'
21413 d_getpagsz='$d_getpagsz'
21414 d_getpbyname='$d_getpbyname'
21415 d_getpbynumber='$d_getpbynumber'
21416 d_getpent='$d_getpent'
21417 d_getpgid='$d_getpgid'
21418 d_getpgrp2='$d_getpgrp2'
21419 d_getpgrp='$d_getpgrp'
21420 d_getppid='$d_getppid'
21421 d_getprior='$d_getprior'
21422 d_getprotobyname_r='$d_getprotobyname_r'
21423 d_getprotobynumber_r='$d_getprotobynumber_r'
21424 d_getprotoent_r='$d_getprotoent_r'
21425 d_getprotoprotos='$d_getprotoprotos'
21426 d_getprpwnam='$d_getprpwnam'
21427 d_getpwent='$d_getpwent'
21428 d_getpwent_r='$d_getpwent_r'
21429 d_getpwnam_r='$d_getpwnam_r'
21430 d_getpwuid_r='$d_getpwuid_r'
21431 d_getsbyname='$d_getsbyname'
21432 d_getsbyport='$d_getsbyport'
21433 d_getsent='$d_getsent'
21434 d_getservbyname_r='$d_getservbyname_r'
21435 d_getservbyport_r='$d_getservbyport_r'
21436 d_getservent_r='$d_getservent_r'
21437 d_getservprotos='$d_getservprotos'
21438 d_getspnam='$d_getspnam'
21439 d_getspnam_r='$d_getspnam_r'
21440 d_gettimeod='$d_gettimeod'
21441 d_gmtime_r='$d_gmtime_r'
21442 d_gnulibc='$d_gnulibc'
21443 d_grpasswd='$d_grpasswd'
21444 d_hasmntopt='$d_hasmntopt'
21446 d_ilogbl='$d_ilogbl'
21447 d_inc_version_list='$d_inc_version_list'
21449 d_inetaton='$d_inetaton'
21450 d_int64_t='$d_int64_t'
21451 d_isascii='$d_isascii'
21452 d_isfinite='$d_isfinite'
21455 d_isnanl='$d_isnanl'
21456 d_killpg='$d_killpg'
21457 d_lchown='$d_lchown'
21458 d_ldbl_dig='$d_ldbl_dig'
21459 d_libm_lib_version='$d_libm_lib_version'
21461 d_localtime_r='$d_localtime_r'
21462 d_locconv='$d_locconv'
21464 d_longdbl='$d_longdbl'
21465 d_longlong='$d_longlong'
21466 d_lseekproto='$d_lseekproto'
21468 d_madvise='$d_madvise'
21469 d_malloc_good_size='$d_malloc_good_size'
21470 d_malloc_size='$d_malloc_size'
21472 d_mbstowcs='$d_mbstowcs'
21473 d_mbtowc='$d_mbtowc'
21474 d_memchr='$d_memchr'
21475 d_memcmp='$d_memcmp'
21476 d_memcpy='$d_memcpy'
21477 d_memmove='$d_memmove'
21478 d_memset='$d_memset'
21480 d_mkdtemp='$d_mkdtemp'
21481 d_mkfifo='$d_mkfifo'
21482 d_mkstemp='$d_mkstemp'
21483 d_mkstemps='$d_mkstemps'
21484 d_mktime='$d_mktime'
21487 d_modfl_pow32_bug='$d_modfl_pow32_bug'
21488 d_modflproto='$d_modflproto'
21489 d_mprotect='$d_mprotect'
21491 d_msg_ctrunc='$d_msg_ctrunc'
21492 d_msg_dontroute='$d_msg_dontroute'
21493 d_msg_oob='$d_msg_oob'
21494 d_msg_peek='$d_msg_peek'
21495 d_msg_proxy='$d_msg_proxy'
21496 d_msgctl='$d_msgctl'
21497 d_msgget='$d_msgget'
21498 d_msghdr_s='$d_msghdr_s'
21499 d_msgrcv='$d_msgrcv'
21500 d_msgsnd='$d_msgsnd'
21502 d_munmap='$d_munmap'
21503 d_mymalloc='$d_mymalloc'
21505 d_nl_langinfo='$d_nl_langinfo'
21506 d_nv_preserves_uv='$d_nv_preserves_uv'
21507 d_nv_zero_is_allbits_zero='$d_nv_zero_is_allbits_zero'
21508 d_off64_t='$d_off64_t'
21509 d_old_pthread_create_joinable='$d_old_pthread_create_joinable'
21510 d_oldpthreads='$d_oldpthreads'
21511 d_oldsock='$d_oldsock'
21513 d_pathconf='$d_pathconf'
21515 d_perl_otherlibdirs='$d_perl_otherlibdirs'
21516 d_phostname='$d_phostname'
21519 d_portable='$d_portable'
21520 d_procselfexe='$d_procselfexe'
21521 d_pthread_atfork='$d_pthread_atfork'
21522 d_pthread_attr_setscope='$d_pthread_attr_setscope'
21523 d_pthread_yield='$d_pthread_yield'
21525 d_pwchange='$d_pwchange'
21526 d_pwclass='$d_pwclass'
21527 d_pwcomment='$d_pwcomment'
21528 d_pwexpire='$d_pwexpire'
21529 d_pwgecos='$d_pwgecos'
21530 d_pwpasswd='$d_pwpasswd'
21531 d_pwquota='$d_pwquota'
21534 d_random_r='$d_random_r'
21535 d_readdir64_r='$d_readdir64_r'
21536 d_readdir='$d_readdir'
21537 d_readdir_r='$d_readdir_r'
21538 d_readlink='$d_readlink'
21540 d_recvmsg='$d_recvmsg'
21541 d_rename='$d_rename'
21542 d_rewinddir='$d_rewinddir'
21544 d_safebcpy='$d_safebcpy'
21545 d_safemcpy='$d_safemcpy'
21546 d_sanemcmp='$d_sanemcmp'
21547 d_sbrkproto='$d_sbrkproto'
21548 d_scalbnl='$d_scalbnl'
21549 d_sched_yield='$d_sched_yield'
21550 d_scm_rights='$d_scm_rights'
21551 d_seekdir='$d_seekdir'
21552 d_select='$d_select'
21554 d_semctl='$d_semctl'
21555 d_semctl_semid_ds='$d_semctl_semid_ds'
21556 d_semctl_semun='$d_semctl_semun'
21557 d_semget='$d_semget'
21559 d_sendmsg='$d_sendmsg'
21560 d_setegid='$d_setegid'
21561 d_seteuid='$d_seteuid'
21562 d_setgrent='$d_setgrent'
21563 d_setgrent_r='$d_setgrent_r'
21564 d_setgrps='$d_setgrps'
21565 d_sethent='$d_sethent'
21566 d_sethostent_r='$d_sethostent_r'
21567 d_setitimer='$d_setitimer'
21568 d_setlinebuf='$d_setlinebuf'
21569 d_setlocale='$d_setlocale'
21570 d_setlocale_r='$d_setlocale_r'
21571 d_setnent='$d_setnent'
21572 d_setnetent_r='$d_setnetent_r'
21573 d_setpent='$d_setpent'
21574 d_setpgid='$d_setpgid'
21575 d_setpgrp2='$d_setpgrp2'
21576 d_setpgrp='$d_setpgrp'
21577 d_setprior='$d_setprior'
21578 d_setproctitle='$d_setproctitle'
21579 d_setprotoent_r='$d_setprotoent_r'
21580 d_setpwent='$d_setpwent'
21581 d_setpwent_r='$d_setpwent_r'
21582 d_setregid='$d_setregid'
21583 d_setresgid='$d_setresgid'
21584 d_setresuid='$d_setresuid'
21585 d_setreuid='$d_setreuid'
21586 d_setrgid='$d_setrgid'
21587 d_setruid='$d_setruid'
21588 d_setsent='$d_setsent'
21589 d_setservent_r='$d_setservent_r'
21590 d_setsid='$d_setsid'
21591 d_setvbuf='$d_setvbuf'
21595 d_shmatprototype='$d_shmatprototype'
21596 d_shmctl='$d_shmctl'
21598 d_shmget='$d_shmget'
21599 d_sigaction='$d_sigaction'
21600 d_sigprocmask='$d_sigprocmask'
21601 d_sigsetjmp='$d_sigsetjmp'
21602 d_sitearch='$d_sitearch'
21603 d_snprintf='$d_snprintf'
21604 d_sockatmark='$d_sockatmark'
21605 d_sockatmarkproto='$d_sockatmarkproto'
21606 d_socket='$d_socket'
21607 d_socklen_t='$d_socklen_t'
21608 d_sockpair='$d_sockpair'
21609 d_socks5_init='$d_socks5_init'
21610 d_sprintf_returns_strlen='$d_sprintf_returns_strlen'
21612 d_srand48_r='$d_srand48_r'
21613 d_srandom_r='$d_srandom_r'
21614 d_sresgproto='$d_sresgproto'
21615 d_sresuproto='$d_sresuproto'
21616 d_statblks='$d_statblks'
21617 d_statfs_f_flags='$d_statfs_f_flags'
21618 d_statfs_s='$d_statfs_s'
21619 d_statvfs='$d_statvfs'
21620 d_stdio_cnt_lval='$d_stdio_cnt_lval'
21621 d_stdio_ptr_lval='$d_stdio_ptr_lval'
21622 d_stdio_ptr_lval_nochange_cnt='$d_stdio_ptr_lval_nochange_cnt'
21623 d_stdio_ptr_lval_sets_cnt='$d_stdio_ptr_lval_sets_cnt'
21624 d_stdio_stream_array='$d_stdio_stream_array'
21625 d_stdiobase='$d_stdiobase'
21626 d_stdstdio='$d_stdstdio'
21627 d_strchr='$d_strchr'
21628 d_strcoll='$d_strcoll'
21629 d_strctcpy='$d_strctcpy'
21630 d_strerrm='$d_strerrm'
21631 d_strerror='$d_strerror'
21632 d_strerror_r='$d_strerror_r'
21633 d_strftime='$d_strftime'
21634 d_strlcat='$d_strlcat'
21635 d_strlcpy='$d_strlcpy'
21636 d_strtod='$d_strtod'
21637 d_strtol='$d_strtol'
21638 d_strtold='$d_strtold'
21639 d_strtoll='$d_strtoll'
21640 d_strtoq='$d_strtoq'
21641 d_strtoul='$d_strtoul'
21642 d_strtoull='$d_strtoull'
21643 d_strtouq='$d_strtouq'
21644 d_strxfrm='$d_strxfrm'
21645 d_suidsafe='$d_suidsafe'
21646 d_symlink='$d_symlink'
21647 d_syscall='$d_syscall'
21648 d_syscallproto='$d_syscallproto'
21649 d_sysconf='$d_sysconf'
21650 d_sysernlst='$d_sysernlst'
21651 d_syserrlst='$d_syserrlst'
21652 d_system='$d_system'
21653 d_tcgetpgrp='$d_tcgetpgrp'
21654 d_tcsetpgrp='$d_tcsetpgrp'
21655 d_telldir='$d_telldir'
21656 d_telldirproto='$d_telldirproto'
21659 d_tm_tm_gmtoff='$d_tm_tm_gmtoff'
21660 d_tm_tm_zone='$d_tm_tm_zone'
21661 d_tmpnam_r='$d_tmpnam_r'
21662 d_truncate='$d_truncate'
21663 d_ttyname_r='$d_ttyname_r'
21664 d_tzname='$d_tzname'
21665 d_u32align='$d_u32align'
21666 d_ualarm='$d_ualarm'
21669 d_union_semun='$d_union_semun'
21670 d_unordered='$d_unordered'
21671 d_unsetenv='$d_unsetenv'
21672 d_usleep='$d_usleep'
21673 d_usleepproto='$d_usleepproto'
21675 d_vendorarch='$d_vendorarch'
21676 d_vendorbin='$d_vendorbin'
21677 d_vendorlib='$d_vendorlib'
21678 d_vendorscript='$d_vendorscript'
21680 d_void_closedir='$d_void_closedir'
21681 d_voidsig='$d_voidsig'
21682 d_voidtty='$d_voidtty'
21683 d_volatile='$d_volatile'
21684 d_vprintf='$d_vprintf'
21685 d_vsnprintf='$d_vsnprintf'
21687 d_waitpid='$d_waitpid'
21688 d_wcstombs='$d_wcstombs'
21689 d_wctomb='$d_wctomb'
21690 d_writev='$d_writev'
21693 db_hashtype='$db_hashtype'
21694 db_prefixtype='$db_prefixtype'
21695 db_version_major='$db_version_major'
21696 db_version_minor='$db_version_minor'
21697 db_version_patch='$db_version_patch'
21698 defvoidused='$defvoidused'
21699 direntrytype='$direntrytype'
21702 doublesize='$doublesize'
21704 drand48_r_proto='$drand48_r_proto'
21705 dynamic_ext='$dynamic_ext'
21711 endgrent_r_proto='$endgrent_r_proto'
21712 endhostent_r_proto='$endhostent_r_proto'
21713 endnetent_r_proto='$endnetent_r_proto'
21714 endprotoent_r_proto='$endprotoent_r_proto'
21715 endpwent_r_proto='$endpwent_r_proto'
21716 endservent_r_proto='$endservent_r_proto'
21717 eunicefix='$eunicefix'
21720 extensions='$extensions'
21722 fflushNULL='$fflushNULL'
21723 fflushall='$fflushall'
21725 firstmakefile='$firstmakefile'
21727 fpossize='$fpossize'
21728 fpostype='$fpostype'
21729 freetype='$freetype'
21732 full_csh='$full_csh'
21733 full_sed='$full_sed'
21734 gccansipedantic='$gccansipedantic'
21735 gccosandvers='$gccosandvers'
21736 gccversion='$gccversion'
21737 getgrent_r_proto='$getgrent_r_proto'
21738 getgrgid_r_proto='$getgrgid_r_proto'
21739 getgrnam_r_proto='$getgrnam_r_proto'
21740 gethostbyaddr_r_proto='$gethostbyaddr_r_proto'
21741 gethostbyname_r_proto='$gethostbyname_r_proto'
21742 gethostent_r_proto='$gethostent_r_proto'
21743 getlogin_r_proto='$getlogin_r_proto'
21744 getnetbyaddr_r_proto='$getnetbyaddr_r_proto'
21745 getnetbyname_r_proto='$getnetbyname_r_proto'
21746 getnetent_r_proto='$getnetent_r_proto'
21747 getprotobyname_r_proto='$getprotobyname_r_proto'
21748 getprotobynumber_r_proto='$getprotobynumber_r_proto'
21749 getprotoent_r_proto='$getprotoent_r_proto'
21750 getpwent_r_proto='$getpwent_r_proto'
21751 getpwnam_r_proto='$getpwnam_r_proto'
21752 getpwuid_r_proto='$getpwuid_r_proto'
21753 getservbyname_r_proto='$getservbyname_r_proto'
21754 getservbyport_r_proto='$getservbyport_r_proto'
21755 getservent_r_proto='$getservent_r_proto'
21756 getspnam_r_proto='$getspnam_r_proto'
21757 gidformat='$gidformat'
21763 gmtime_r_proto='$gmtime_r_proto'
21764 gnulibc_version='$gnulibc_version'
21766 groupcat='$groupcat'
21767 groupstype='$groupstype'
21770 h_sysfile='$h_sysfile'
21773 html1dir='$html1dir'
21774 html1direxp='$html1direxp'
21775 html3dir='$html3dir'
21776 html3direxp='$html3direxp'
21785 i_arpainet='$i_arpainet'
21786 i_bsdioctl='$i_bsdioctl'
21790 i_dirent='$i_dirent'
21796 i_fp_class='$i_fp_class'
21799 i_ieeefp='$i_ieeefp'
21800 i_inttypes='$i_inttypes'
21801 i_langinfo='$i_langinfo'
21802 i_libutil='$i_libutil'
21803 i_limits='$i_limits'
21804 i_locale='$i_locale'
21805 i_machcthr='$i_machcthr'
21806 i_malloc='$i_malloc'
21808 i_memory='$i_memory'
21809 i_mntent='$i_mntent'
21812 i_neterrno='$i_neterrno'
21813 i_netinettcp='$i_netinettcp'
21817 i_pthread='$i_pthread'
21819 i_rpcsvcdbm='$i_rpcsvcdbm'
21822 i_shadow='$i_shadow'
21824 i_stdarg='$i_stdarg'
21825 i_stddef='$i_stddef'
21826 i_stdlib='$i_stdlib'
21827 i_string='$i_string'
21828 i_sunmath='$i_sunmath'
21829 i_sysaccess='$i_sysaccess'
21830 i_sysdir='$i_sysdir'
21831 i_sysfile='$i_sysfile'
21832 i_sysfilio='$i_sysfilio'
21834 i_sysioctl='$i_sysioctl'
21835 i_syslog='$i_syslog'
21836 i_sysmman='$i_sysmman'
21837 i_sysmode='$i_sysmode'
21838 i_sysmount='$i_sysmount'
21839 i_sysndir='$i_sysndir'
21840 i_sysparam='$i_sysparam'
21841 i_sysresrc='$i_sysresrc'
21842 i_syssecrt='$i_syssecrt'
21843 i_sysselct='$i_sysselct'
21844 i_syssockio='$i_syssockio'
21845 i_sysstat='$i_sysstat'
21846 i_sysstatfs='$i_sysstatfs'
21847 i_sysstatvfs='$i_sysstatvfs'
21848 i_systime='$i_systime'
21849 i_systimek='$i_systimek'
21850 i_systimes='$i_systimes'
21851 i_systypes='$i_systypes'
21852 i_sysuio='$i_sysuio'
21854 i_sysutsname='$i_sysutsname'
21855 i_sysvfs='$i_sysvfs'
21856 i_syswait='$i_syswait'
21857 i_termio='$i_termio'
21858 i_termios='$i_termios'
21860 i_unistd='$i_unistd'
21863 i_values='$i_values'
21864 i_varargs='$i_varargs'
21865 i_varhdr='$i_varhdr'
21867 ignore_versioned_solibs='$ignore_versioned_solibs'
21868 inc_version_list='$inc_version_list'
21869 inc_version_list_init='$inc_version_list_init'
21872 initialinstalllocation='$initialinstalllocation'
21873 installarchlib='$installarchlib'
21874 installbin='$installbin'
21875 installhtml1dir='$installhtml1dir'
21876 installhtml3dir='$installhtml3dir'
21877 installman1dir='$installman1dir'
21878 installman3dir='$installman3dir'
21879 installprefix='$installprefix'
21880 installprefixexp='$installprefixexp'
21881 installprivlib='$installprivlib'
21882 installscript='$installscript'
21883 installsitearch='$installsitearch'
21884 installsitebin='$installsitebin'
21885 installsitehtml1dir='$installsitehtml1dir'
21886 installsitehtml3dir='$installsitehtml3dir'
21887 installsitelib='$installsitelib'
21888 installsiteman1dir='$installsiteman1dir'
21889 installsiteman3dir='$installsiteman3dir'
21890 installsitescript='$installsitescript'
21891 installstyle='$installstyle'
21892 installusrbinperl='$installusrbinperl'
21893 installvendorarch='$installvendorarch'
21894 installvendorbin='$installvendorbin'
21895 installvendorhtml1dir='$installvendorhtml1dir'
21896 installvendorhtml3dir='$installvendorhtml3dir'
21897 installvendorlib='$installvendorlib'
21898 installvendorman1dir='$installvendorman1dir'
21899 installvendorman3dir='$installvendorman3dir'
21900 installvendorscript='$installvendorscript'
21902 issymlink='$issymlink'
21903 ivdformat='$ivdformat'
21906 known_extensions='$known_extensions'
21909 lddlflags='$lddlflags'
21911 ldflags_uselargefiles='$ldflags_uselargefiles'
21912 ldlibpthname='$ldlibpthname'
21919 libsdirs='$libsdirs'
21920 libsfiles='$libsfiles'
21921 libsfound='$libsfound'
21922 libspath='$libspath'
21923 libswanted='$libswanted'
21924 libswanted_uselargefiles='$libswanted_uselargefiles'
21930 localtime_r_proto='$localtime_r_proto'
21931 locincpth='$locincpth'
21932 loclibpth='$loclibpth'
21933 longdblsize='$longdblsize'
21934 longlongsize='$longlongsize'
21935 longsize='$longsize'
21939 lseeksize='$lseeksize'
21940 lseektype='$lseektype'
21943 madlyobj='$madlyobj'
21944 madlysrc='$madlysrc'
21948 make_set_make='$make_set_make'
21949 mallocobj='$mallocobj'
21950 mallocsrc='$mallocsrc'
21951 malloctype='$malloctype'
21953 man1direxp='$man1direxp'
21956 man3direxp='$man3direxp'
21958 mips_type='$mips_type'
21959 mistrustnm='$mistrustnm'
21961 mmaptype='$mmaptype'
21962 modetype='$modetype'
21964 multiarch='$multiarch'
21966 myarchname='$myarchname'
21967 mydomain='$mydomain'
21968 myhostname='$myhostname'
21971 need_va_copy='$need_va_copy'
21972 netdb_hlen_type='$netdb_hlen_type'
21973 netdb_host_type='$netdb_host_type'
21974 netdb_name_type='$netdb_name_type'
21975 netdb_net_type='$netdb_net_type'
21978 nm_so_opt='$nm_so_opt'
21979 nonxs_ext='$nonxs_ext'
21981 nvEUformat='$nvEUformat'
21982 nvFUformat='$nvFUformat'
21983 nvGUformat='$nvGUformat'
21984 nv_preserves_uv_bits='$nv_preserves_uv_bits'
21985 nveformat='$nveformat'
21986 nvfformat='$nvfformat'
21987 nvgformat='$nvgformat'
21990 o_nonblock='$o_nonblock'
21992 old_pthread_create_joinable='$old_pthread_create_joinable'
21993 optimize='$optimize'
21994 orderlib='$orderlib'
21997 otherlibdirs='$otherlibdirs'
22001 patchlevel='$patchlevel'
22002 path_sep='$path_sep'
22005 perl_patchlevel='$perl_patchlevel'
22006 perladmin='$perladmin'
22007 perllibs='$perllibs'
22008 perlpath='$perlpath'
22010 phostname='$phostname'
22016 prefixexp='$prefixexp'
22018 privlibexp='$privlibexp'
22019 procselfexe='$procselfexe'
22020 prototype='$prototype'
22022 quadkind='$quadkind'
22023 quadtype='$quadtype'
22024 randbits='$randbits'
22025 randfunc='$randfunc'
22026 random_r_proto='$random_r_proto'
22027 randseedtype='$randseedtype'
22029 rd_nodata='$rd_nodata'
22030 readdir64_r_proto='$readdir64_r_proto'
22031 readdir_r_proto='$readdir_r_proto'
22032 revision='$revision'
22037 sPRIEUldbl='$sPRIEUldbl'
22038 sPRIFUldbl='$sPRIFUldbl'
22039 sPRIGUldbl='$sPRIGUldbl'
22040 sPRIXU64='$sPRIXU64'
22042 sPRIeldbl='$sPRIeldbl'
22043 sPRIfldbl='$sPRIfldbl'
22044 sPRIgldbl='$sPRIgldbl'
22049 sSCNfldbl='$sSCNfldbl'
22050 sched_yield='$sched_yield'
22051 scriptdir='$scriptdir'
22052 scriptdirexp='$scriptdirexp'
22054 seedfunc='$seedfunc'
22055 selectminbits='$selectminbits'
22056 selecttype='$selecttype'
22057 sendmail='$sendmail'
22058 setgrent_r_proto='$setgrent_r_proto'
22059 sethostent_r_proto='$sethostent_r_proto'
22060 setlocale_r_proto='$setlocale_r_proto'
22061 setnetent_r_proto='$setnetent_r_proto'
22062 setprotoent_r_proto='$setprotoent_r_proto'
22063 setpwent_r_proto='$setpwent_r_proto'
22064 setservent_r_proto='$setservent_r_proto'
22067 sharpbang='$sharpbang'
22068 shmattype='$shmattype'
22069 shortsize='$shortsize'
22072 sig_count='$sig_count'
22073 sig_name='$sig_name'
22074 sig_name_init='$sig_name_init'
22076 sig_num_init='$sig_num_init'
22077 sig_size='$sig_size'
22078 signal_t='$signal_t'
22079 sitearch='$sitearch'
22080 sitearchexp='$sitearchexp'
22082 sitebinexp='$sitebinexp'
22083 sitehtml1dir='$sitehtml1dir'
22084 sitehtml1direxp='$sitehtml1direxp'
22085 sitehtml3dir='$sitehtml3dir'
22086 sitehtml3direxp='$sitehtml3direxp'
22088 sitelib_stem='$sitelib_stem'
22089 sitelibexp='$sitelibexp'
22090 siteman1dir='$siteman1dir'
22091 siteman1direxp='$siteman1direxp'
22092 siteman3dir='$siteman3dir'
22093 siteman3direxp='$siteman3direxp'
22094 siteprefix='$siteprefix'
22095 siteprefixexp='$siteprefixexp'
22096 sitescript='$sitescript'
22097 sitescriptexp='$sitescriptexp'
22098 sizesize='$sizesize'
22099 sizetype='$sizetype'
22103 sockethdr='$sockethdr'
22104 socketlib='$socketlib'
22105 socksizetype='$socksizetype'
22107 spackage='$spackage'
22108 spitshell='$spitshell'
22109 srand48_r_proto='$srand48_r_proto'
22110 srandom_r_proto='$srandom_r_proto'
22112 ssizetype='$ssizetype'
22113 startperl='$startperl'
22115 static_ext='$static_ext'
22117 stdio_base='$stdio_base'
22118 stdio_bufsiz='$stdio_bufsiz'
22119 stdio_cnt='$stdio_cnt'
22120 stdio_filbuf='$stdio_filbuf'
22121 stdio_ptr='$stdio_ptr'
22122 stdio_stream_array='$stdio_stream_array'
22123 strerror_r_proto='$strerror_r_proto'
22126 subversion='$subversion'
22130 targetarch='$targetarch'
22134 timeincl='$timeincl'
22135 timetype='$timetype'
22136 tmpnam_r_proto='$tmpnam_r_proto'
22142 ttyname_r_proto='$ttyname_r_proto'
22151 uidformat='$uidformat'
22157 uquadtype='$uquadtype'
22158 use5005threads='$use5005threads'
22159 use64bitall='$use64bitall'
22160 use64bitint='$use64bitint'
22161 usecrosscompile='$usecrosscompile'
22163 usefaststdio='$usefaststdio'
22164 useithreads='$useithreads'
22165 uselargefiles='$uselargefiles'
22166 uselongdouble='$uselongdouble'
22167 usemallocwrap='$usemallocwrap'
22168 usemorebits='$usemorebits'
22169 usemultiplicity='$usemultiplicity'
22170 usemymalloc='$usemymalloc'
22172 useopcode='$useopcode'
22173 useperlio='$useperlio'
22174 useposix='$useposix'
22175 usereentrant='$usereentrant'
22176 userelocatableinc='$userelocatableinc'
22178 useshrplib='$useshrplib'
22179 usesitecustomize='$usesitecustomize'
22180 usesocks='$usesocks'
22181 usethreads='$usethreads'
22182 usevendorprefix='$usevendorprefix'
22183 usevfork='$usevfork'
22186 uvXUformat='$uvXUformat'
22187 uvoformat='$uvoformat'
22190 uvuformat='$uvuformat'
22191 uvxformat='$uvxformat'
22192 vendorarch='$vendorarch'
22193 vendorarchexp='$vendorarchexp'
22194 vendorbin='$vendorbin'
22195 vendorbinexp='$vendorbinexp'
22196 vendorhtml1dir='$vendorhtml1dir'
22197 vendorhtml1direxp='$vendorhtml1direxp'
22198 vendorhtml3dir='$vendorhtml3dir'
22199 vendorhtml3direxp='$vendorhtml3direxp'
22200 vendorlib='$vendorlib'
22201 vendorlib_stem='$vendorlib_stem'
22202 vendorlibexp='$vendorlibexp'
22203 vendorman1dir='$vendorman1dir'
22204 vendorman1direxp='$vendorman1direxp'
22205 vendorman3dir='$vendorman3dir'
22206 vendorman3direxp='$vendorman3direxp'
22207 vendorprefix='$vendorprefix'
22208 vendorprefixexp='$vendorprefixexp'
22209 vendorscript='$vendorscript'
22210 vendorscriptexp='$vendorscriptexp'
22212 version_patchlevel_string='$version_patchlevel_string'
22213 versiononly='$versiononly'
22215 voidflags='$voidflags'
22218 yaccflags='$yaccflags'
22223 : Add in command line options if available
22224 $test -f UU/cmdline.opt && $cat UU/cmdline.opt >> config.sh
22226 : add special variables
22227 $test -f $src/patchlevel.h && \
22228 awk '/^#define[ ]+PERL_/ {printf "%s=%s\n",$2,$3}' $src/patchlevel.h >>config.sh
22229 echo "PERL_PATCHLEVEL=$perl_patchlevel" >>config.sh
22230 echo "PERL_CONFIG_SH=true" >>config.sh
22232 : propagate old symbols
22233 if $test -f UU/config.sh; then
22234 <UU/config.sh $sort | $uniq >UU/oldconfig.sh
22235 sed -n 's/^\([a-zA-Z_0-9]*\)=.*/\1/p' config.sh config.sh UU/oldconfig.sh |\
22236 $sort | $uniq -u >UU/oldsyms
22237 set X `cat UU/oldsyms`
22243 Hmm...You had some extra variables I don't know about...I'll try to keep 'em...
22245 echo "# Variables propagated from previous config.sh file." >>config.sh
22246 for sym in `cat UU/oldsyms`; do
22247 echo " Propagating $hint variable "'$'"$sym..."
22248 eval 'tmp="$'"${sym}"'"'
22250 sed -e "s/'/'\"'\"'/g" -e "s/^/$sym='/" -e "s/$/'/" >>config.sh
22256 : Finish up by extracting the .SH files
22260 echo "Extraction done."
22270 If you'd like to make any changes to the config.sh file before I begin
22271 to configure things, do it as a shell escape now (e.g. !vi config.sh).
22274 rp="Press return or use a shell escape to edit config.sh:"
22279 *) : in case they cannot read
22280 sh 1>&4 -c "$ans";;
22285 : if this fails, just run all the .SH files by hand
22294 if $contains '^depend:' [Mm]akefile >/dev/null 2>&1; then
22301 Now you need to generate make dependencies by running "$make depend".
22302 You might prefer to run it in background: "$make depend > makedepend.out &"
22303 It can take a while, so you might not want to run it right now.
22308 rp="Run $make depend now?"
22312 $make depend && echo "Now you must run '$make'."
22315 echo "You must run '$make depend' then '$make'."
22318 elif test -f [Mm]akefile; then
22320 echo "Now you must run a $make."
22322 echo "Configure done."
22325 if $test -f Policy.sh; then
22328 If you compile $package on a different machine or from a different object
22329 directory, copy the Policy.sh file from this object directory to the
22330 new one before you run Configure -- this will help you with most of
22331 the policy defaults.
22335 if $test -f config.msg; then
22336 echo "Hmm. I also noted the following information while running:"
22338 $cat config.msg >&4
22341 $rm -f kit*isdone ark*isdone