3 # If these # comments don't work, trim them. Don't worry about any other
4 # shell scripts, Configure will trim # comments from them for you.
6 # (If you are trying to port this package to a machine without sh,
7 # I would suggest you have a look at the prototypical config_h.SH file
8 # and edit it to reflect your system. Some packages may include samples
9 # of config.h for certain machines, so you might look for one of those.)
11 # Yes, you may rip this off to use in other distribution packages. This
12 # script belongs to the public domain and cannot be copyrighted.
14 # (Note: this Configure script was generated automatically. Rather than
15 # working with this copy of Configure, you may wish to get metaconfig.
16 # The dist-3.0 package (which contains metaconfig) was posted in
17 # comp.sources.misc and is available on CPAN under authors/id/RAM so
18 # you may fetch it yourself from your nearest archive site.)
21 # Though this script was generated by metaconfig, it is OK to send
22 # patches against it. It's up to the Configure pumpkin to backport
23 # the patch to the metaunits if it is accepted.
24 # See Porting/pumpkin.pod for more information on metaconfig.
27 # $Id: Head.U,v 3.0.1.9 1997/02/28 15:02:09 ram Exp $
29 # Generated on Wed Aug 2 13:20:07 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=''
362 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 If you have a handcrafted Policy.sh file or a Policy.sh file generated by a
3389 previous run of Configure, you may specify it as well as or instead of
3390 OS-specific hints. If hints are provided for your OS, you should use them:
3391 although Perl can probably be built without hints on many platforms, using
3392 hints often improve performance and may enable features that Configure can't
3393 set up on its own. If there are no hints that match your OS, specify "none";
3394 DO NOT give a wrong version or a wrong OS.
3398 rp="Which of these apply, if any?"
3401 for file in $tans; do
3402 if $test X$file = XPolicy -a -f Policy.sh; then
3404 $cat Policy.sh >> UU/config.sh
3405 elif $test -f $src/hints/$file.sh; then
3406 . $src/hints/$file.sh
3407 $cat $src/hints/$file.sh >> UU/config.sh
3408 elif $test X"$tans" = X -o X"$tans" = Xnone ; then
3411 : Give one chance to correct a possible typo.
3412 echo "$file.sh does not exist"
3414 rp="hint to use instead?"
3416 for file in $ans; do
3417 if $test -f "$src/hints/$file.sh"; then
3418 . $src/hints/$file.sh
3419 $cat $src/hints/$file.sh >> UU/config.sh
3420 elif $test X$ans = X -o X$ans = Xnone ; then
3423 echo "$file.sh does not exist -- ignored."
3430 : Remember our hint file for later.
3431 if $test -f "$src/hints/$file.sh" ; then
3441 echo "Fetching default answers from $config_sh..." >&4
3445 cp $config_sh config.sh 2>/dev/null
3455 test "$override" && . ./optdef.sh
3457 : Restore computed paths
3458 for file in $loclist $trylist; do
3459 eval $file="\$_$file"
3464 Configure uses the operating system name and version to set some defaults.
3465 The default value is probably right if the name rings a bell. Otherwise,
3466 since spelling matters for me, either accept the default or answer "none"
3473 ''|' '|none) dflt=none ;;
3474 *) dflt=`echo $hintfile | $sed -e 's/\.sh$//' -e 's/_.*$//'` ;;
3477 *) dflt="$osname" ;;
3479 rp="Operating system name?"
3483 *) osname=`echo "$ans" | $sed -e 's/[ ][ ]*/_/g' | ./tr '[A-Z]' '[a-z]'`;;
3489 ''|' '|none) dflt=none ;;
3490 *) dflt=`echo $hintfile | $sed -e 's/\.sh$//' -e 's/^[^_]*//'`
3491 dflt=`echo $dflt | $sed -e 's/^_//' -e 's/_/./g'`
3493 ''|' ') dflt=none ;;
3498 *) dflt="$osvers" ;;
3500 rp="Operating system version?"
3510 : who configured the system
3511 cf_time=`LC_ALL=C; LANGUAGE=C; export LC_ALL; export LANGUAGE; $date 2>&1`
3514 cf_by=`(logname) 2>/dev/null`
3517 cf_by=`(whoami) 2>/dev/null`
3519 "") cf_by=unknown ;;
3524 : decide how portable to be. Allow command line overrides.
3525 case "$d_portable" in
3527 *) d_portable="$define" ;;
3530 : set up shell script to do ~ expansion
3536 echo \$1 | $sed "s|~|\${HOME-\$LOGDIR}|"
3539 if $test -f /bin/csh; then
3540 /bin/csh -f -c "glob \$1"
3545 name=\`$expr x\$1 : '..\([^/]*\)'\`
3546 dir=\`$sed -n -e "/^\${name}:/{s/^[^:]*:[^:]*:[^:]*:[^:]*:[^:]*:\([^:]*\).*"'\$'"/\1/" -e p -e q -e '}' </etc/passwd\`
3547 if $test ! -d "\$dir"; then
3549 echo "\$me: can't locate home directory for: \$name" >&2
3554 echo \$dir/\`$expr x\$1 : '..[^/]*/\(.*\)'\`
3570 : now set up to get a file name
3574 cat <<'EOSC' >>getfile
3590 : getfile will accept an answer from the comma-separated list
3591 : enclosed in parentheses even if it does not meet other criteria.
3592 expr "$fn" : '.*(\(.*\)).*' | $tr ',' $trnl >getfile.ok
3593 fn=`echo $fn | sed 's/(.*)//'`
3599 loc_file=`expr $fn : '.*:\(.*\)'`
3600 fn=`expr $fn : '\(.*\):.*'`
3608 */*) fullpath=true;;
3617 *e*) exp_file=true;;
3620 *p*) nopath_ok=true;;
3625 *d*) type='Directory';;
3626 *l*) type='Locate';;
3631 Locate) what='File';;
3636 case "$d_portable" in
3644 while test "$type"; do
3649 true) rp="$rp (~name ok)";;
3652 if test -f UU/getfile.ok && \
3653 $contains "^$ans\$" UU/getfile.ok >/dev/null 2>&1
3672 value=`UU/filexp $ans`
3675 if test "$ans" != "$value"; then
3676 echo "(That expands to $value on this system.)"
3690 /*) value="$ansexp" ;;
3691 [a-zA-Z]:/*) value="$ansexp" ;;
3696 echo "I shall only accept a full path name, as in /bin/ls." >&4
3697 echo "Use a ! shell escape if you wish to check pathnames." >&4
3700 echo "Please give a full path name, starting with slash." >&4
3703 echo "Note that using ~name is ok provided it expands well." >&4
3716 for fp in $gfpth; do
3717 if test "X$fp" = X.; then
3722 if test -f "$pf"; then
3724 elif test -r "$pf" || (test -h "$pf") >/dev/null 2>&1
3726 echo "($value is not a plain file, but that's ok.)"
3729 if test X"$type" = X; then
3736 for fp in $gfpth; do
3737 if test "X$fp" = X.; then
3742 direxp="$fp/$ansexp"
3744 if test -d "$direxp"; then
3752 if test -d "$ansexp"; then
3753 echo "(Looking for $loc_file in directory $value.)"
3754 value="$value/$loc_file"
3755 ansexp="$ansexp/$loc_file"
3757 if test -f "$ansexp"; then
3760 case "$nopath_ok" in
3761 true) case "$value" in
3763 *) echo "Assuming $value will be in people's path."
3779 if test "$fastread" = yes; then
3784 rp="$what $value doesn't exist. Use that name anyway?"
3803 test "X$gfpthkeep" != Xy && gfpth=""
3806 : determine root of directory hierarchy where package will be installed.
3809 dflt=`./loc . /usr/local /usr/local /local /opt /usr`
3812 dflt=`echo "$prefix" | sed 's/.$//'`
3820 By default, $package will be installed in $dflt/bin, manual pages
3821 under $dflt/man, etc..., i.e. with $dflt as prefix for all
3822 installation directories. Typically this is something like /usr/local.
3823 If you wish to have binaries under /usr/bin but other parts of the
3824 installation under /usr/local, that's ok: you will be prompted
3825 separately for each of the installation directories, the prefix being
3826 only used to set the defaults.
3830 rp='Installation prefix to use?'
3838 *) oldprefix="$prefix";;
3847 *) afsroot=$afsroot ;;
3853 $define|true) afs=true ;;
3854 $undef|false) afs=false ;;
3855 *) if test -d $afsroot; then
3863 echo "AFS may be running... I'll be extra cautious then..." >&4
3865 echo "AFS does not seem to be running..." >&4
3868 : determine installation prefix for where package is to be installed.
3872 Since you are running AFS, I need to distinguish the directory in which
3873 files will reside from the directory in which they are installed (and from
3874 which they are presumably copied to the former directory by occult means).
3877 case "$installprefix" in
3878 '') dflt=`echo $prefix | sed 's#^/afs/#/afs/.#'`;;
3879 *) dflt="$installprefix";;
3884 In some special cases, particularly when building $package for distribution,
3885 it is convenient to distinguish the directory in which files should be
3886 installed from the directory ($prefix) in which they will
3887 eventually reside. For most users, these two directories are the same.
3890 case "$installprefix" in
3892 *) dflt=$installprefix;;
3896 rp='What installation prefix should I use for installing files?'
3898 installprefix="$ans"
3899 installprefixexp="$ansexp"
3901 : Perform the prefixexp/installprefixexp correction if necessary
3902 cat <<EOS >installprefix
3905 cat <<'EOSC' >>installprefix
3906 : Change installation prefix, if necessary.
3907 if $test X"$prefix" != X"$installprefix"; then
3908 eval "install${prefixvar}=\`echo \$${prefixvar}exp | sed \"s#^\$prefixexp#\$installprefixexp#\"\`"
3910 eval "install${prefixvar}=\"\$${prefixvar}exp\""
3913 chmod +x installprefix
3914 $eunicefix installprefix
3916 : Set variables such as privlib and privlibexp from the output of ./getfile
3917 : performing the prefixexp/installprefixexp correction if necessary.
3918 cat <<EOS >setprefixvar
3921 cat <<'EOSC' >>setprefixvar
3922 eval "${prefixvar}=\"\$ans\""
3923 eval "${prefixvar}exp=\"\$ansexp\""
3926 chmod +x setprefixvar
3927 $eunicefix setprefixvar
3929 : set up the script used to warn in case of inconsistency
3936 echo "*** WHOA THERE!!! ***" >&4
3937 echo " The $hint value for \$$var on this machine was \"$was\"!" >&4
3938 rp=" Keep the $hint value?"
3941 y) td=$was; tu=$was;;
3945 : function used to set $1 to $val
3946 setvar='var=$1; eval "was=\$$1"; td=$define; tu=$undef;
3948 $define$undef) . ./whoa; eval "$var=\$td";;
3949 $undef$define) . ./whoa; eval "$var=\$tu";;
3950 *) eval "$var=$val";;
3954 $define|true|[yY]*) dflt='y';;
3959 Perl can be built to use the SOCKS proxy protocol library. To do so,
3960 Configure must be run with -Dusesocks. If you use SOCKS you also need
3961 to use the PerlIO abstraction layer, this will be implicitly selected.
3963 If this doesn't make any sense to you, just accept the default '$dflt'.
3965 rp='Build Perl for SOCKS?'
3968 y|Y) val="$define" ;;
3975 $define|true|[yY]*) useperlio="$define";;
3978 case "$useperlio" in
3979 $define|true|[yY]*|'') dflt='y';;
3984 Previous version of $package used the standard IO mechanisms as
3985 defined in <stdio.h>. Versions 5.003_02 and later of $package allow
3986 alternate IO mechanisms via the PerlIO abstraction layer, but the
3987 stdio mechanism is still available if needed. The abstraction layer
3988 can use AT&T's sfio (if you already have sfio installed) or regular stdio.
3989 Using PerlIO with sfio may cause problems with some extension modules.
3991 If this doesn't make any sense to you, just accept the default '$dflt'.
3993 rp='Use the PerlIO abstraction layer?'
4000 echo "Ok, doing things the stdio way."
4009 case "$useperlio" in
4010 $define|true|[yY]*) ;;
4013 You are using the SOCKS proxy protocol library which means that you
4014 should also use the PerlIO layer. You may be headed for trouble.
4023 case "$usethreads" in
4024 $define|true|[yY]*) dflt='y';;
4025 *) # Catch case where user specified ithreads or 5005threads but
4026 # forgot -Dusethreads (A.D. 4/2002)
4027 case "$useithreads$use5005threads" in
4029 case "$useperlio" in
4030 "$define") dflt='y' ;;
4040 Perl can be built to take advantage of threads on some systems.
4041 To do so, Configure can be run with -Dusethreads.
4043 Note that Perl built with threading support runs slightly slower
4044 and uses more memory than plain Perl. The current implementation
4045 is believed to be stable, but it is fairly new, and so should be
4046 treated with caution.
4048 If this doesn't make any sense to you, just accept the default '$dflt'.
4050 rp='Build a threading Perl?'
4053 y|Y) val="$define" ;;
4059 case "$usethreads" in
4063 Since release 5.6, Perl has had two different threading implementations,
4064 the newer interpreter-based version (ithreads) with one interpreter per
4065 thread, and the older 5.005 version (5005threads).
4066 The 5005threads version is effectively unmaintained and will probably be
4067 removed in Perl 5.10, so there should be no need to build a Perl using it
4068 unless needed for backwards compatibility with some existing 5.005threads
4072 : Default to ithreads unless overridden on command line or with
4075 case "$use5005threads" in
4076 $define|true|[yY]*) dflt='n';;
4078 case "$useithreads" in
4079 $undef|false|[nN]*) dflt='n';;
4081 rp='Use the newer interpreter-based ithreads?'
4084 y|Y) val="$define" ;;
4089 : Now set use5005threads to the opposite value.
4090 case "$useithreads" in
4091 $define) val="$undef" ;;
4098 useithreads="$undef"
4099 use5005threads="$undef"
4103 case "$useithreads$use5005threads" in
4107 You cannot have both the ithreads and the 5.005 threads enabled
4108 at the same time. Disabling the 5.005 threads since they are
4109 much less stable than the ithreads.
4112 use5005threads="$undef"
4116 if test X"$usethreads" = "X$define" -a "X$useperlio" = "Xundef"; then
4119 *** To build with ithreads you must also use the PerlIO layer.
4120 *** Cannot continue, aborting.
4126 case "$d_oldpthreads" in
4127 '') : Configure tests would be welcome here. For now, assume undef.
4129 *) val="$d_oldpthreads" ;;
4135 : Look for a hint-file generated 'call-back-unit'. If the
4136 : user has specified that a threading perl is to be built,
4137 : we may need to set or change some other defaults.
4138 if $test -f usethreads.cbu; then
4139 echo "Your platform has some specific hints regarding threaded builds, using them..."
4142 case "$usethreads" in
4143 "$define"|true|[yY]*)
4145 (Your platform does not have any specific hints for threaded builds.
4146 Assuming POSIX threads, then.)
4154 Perl can be built so that multiple Perl interpreters can coexist
4155 within the same Perl executable.
4158 case "$useithreads" in
4161 This multiple interpreter support is required for interpreter-based threads.
4165 *) case "$usemultiplicity" in
4166 $define|true|[yY]*) dflt='y';;
4170 echo "If this doesn't make any sense to you, just accept the default '$dflt'."
4171 rp='Build Perl for multiplicity?'
4174 y|Y) val="$define" ;;
4183 case "$usemorebits" in
4184 "$define"|true|[yY]*)
4185 use64bitint="$define"
4186 uselongdouble="$define"
4187 usemorebits="$define"
4189 *) usemorebits="$undef"
4193 : make some quick guesses about what we are up against
4195 $echo $n "Hmm... $c"
4205 $cat /usr/include/signal.h /usr/include/sys/signal.h >foo 2>/dev/null
4206 if test -f /osf_boot || $contains 'OSF/1' /usr/include/ctype.h >/dev/null 2>&1
4208 echo "Looks kind of like an OSF/1 system, but we'll see..."
4210 elif test `echo abc | $tr a-z A-Z` = Abc ; then
4211 xxx=`./loc addbib blurfl $pth`
4212 if $test -f $xxx; then
4213 echo "Looks kind of like a USG system with BSD features, but we'll see..."
4217 if $contains SIGTSTP foo >/dev/null 2>&1 ; then
4218 echo "Looks kind of like an extended USG system, but we'll see..."
4220 echo "Looks kind of like a USG system, but we'll see..."
4224 elif $contains SIGTSTP foo >/dev/null 2>&1 ; then
4225 echo "Looks kind of like a BSD system, but we'll see..."
4229 echo "Looks kind of like a Version 7 system, but we'll see..."
4232 case "$eunicefix" in
4235 There is, however, a strange, musty smell in the air that reminds me of
4236 something...hmm...yes...I've got it...there's a VMS nearby, or I'm a Blit.
4240 : it so happens the Eunice I know will not run shell scripts in Unix format
4244 echo "Congratulations. You aren't running Eunice."
4248 : Detect OS2. The p_ variable is set above in the Head.U unit.
4249 : Note that this also -- wrongly -- detects e.g. dos-djgpp, which also uses
4250 : semicolon as a patch separator
4255 I have the feeling something is not exactly right, however...don't tell me...
4256 lemme think...does HAL ring a bell?...no, of course, you're only running OS/2!
4257 (Or you may be running DOS with DJGPP.)
4262 if test -f /xenix; then
4263 echo "Actually, this looks more like a XENIX system..."
4268 echo "It's not Xenix..."
4273 if test -f /venix; then
4274 echo "Actually, this looks more like a VENIX system..."
4281 echo "Nor is it Venix..."
4284 chmod +x bsd usg v7 osf1 eunice xenix venix os2
4285 $eunicefix bsd usg v7 osf1 eunice xenix venix os2
4292 rp="Use which C compiler?"
4296 : See if they have not cc but they do have gcc
4298 : Look for a hint-file generated 'call-back-unit'. Now that the
4299 : user has specified the compiler, we may need to set or change some
4301 if $test -f cc.cbu; then
4307 echo "Checking for GNU cc in disguise and/or its version number..." >&4
4311 #if defined(__GNUC__) && !defined(__INTEL_COMPILER)
4313 printf("%s\n", __VERSION__);
4315 printf("%s\n", "1");
4321 if $cc -o try $ccflags $ldflags try.c; then
4322 gccversion=`$run ./try`
4323 case "$gccversion" in
4324 '') echo "You are not using GNU cc." ;;
4325 *) echo "You are using GNU cc $gccversion."
4331 echo "*** WHOA THERE!!! ***" >&4
4332 echo " Your C compiler \"$cc\" doesn't seem to be working!" >&4
4333 case "$knowitall" in
4335 echo " You'd better start hunting for one and let me know about it." >&4
4341 case "$gccversion" in
4342 1*) cpp=`./loc gcc-cpp $cpp $pth` ;;
4344 case "$gccversion" in
4345 '') gccosandvers='' ;;
4346 *) gccshortvers=`echo "$gccversion"|sed 's/ .*//'`
4347 gccosandvers=`$cc -v 2>&1|grep '/specs$'|sed "s!.*/[^-/]*-[^-/]*-\([^-/]*\)/$gccshortvers/specs!\1!"`
4349 case "$gccosandvers" in
4350 $osname) gccosandvers='' ;; # linux gccs seem to have no linux osvers, grr
4351 $osname$osvers) ;; # looking good
4352 $osname*) cat <<EOM >&4
4354 *** WHOA THERE!!! ***
4356 Your gcc has not been compiled for the exact release of
4357 your operating system ($gccosandvers versus $osname$osvers).
4359 In general it is a good idea to keep gcc synchronized with
4360 the operating system because otherwise serious problems
4361 may ensue when trying to compile software, like Perl.
4363 I'm trying to be optimistic here, though, and will continue.
4364 If later during the configuration and build icky compilation
4365 problems appear (headerfile conflicts being the most common
4366 manifestation), I suggest reinstalling the gcc to match
4367 your operating system release.
4371 *) gccosandvers='' ;; # failed to parse, better be silent
4379 # gcc 3.* complain about adding -Idirectories that they already know about,
4380 # so we will take those off from locincpth.
4381 case "$gccversion" in
4383 echo "main(){}">try.c
4384 for incdir in $locincpth; do
4385 warn=`$cc $ccflags -I$incdir -c try.c 2>&1 | \
4386 grep '^c[cp]p*[01]: warning: changing search order '`
4387 if test "X$warn" != X; then
4388 locincpth=`echo " $locincpth " | sed "s! $incdir ! !"`
4394 : What should the include directory be ?
4396 $echo $n "Hmm... $c"
4400 if $test -f /bin/mips && /bin/mips; then
4401 echo "Looks like a MIPS system..."
4402 $cat >usr.c <<'EOCP'
4403 #ifdef SYSTYPE_BSD43
4407 if cc -E usr.c > usr.out && $contains / usr.out >/dev/null 2>&1; then
4408 dflt='/bsd43/usr/include'
4412 mips_type='System V'
4414 $rm -f usr.c usr.out
4415 echo "and you're compiling with the $mips_type compiler and libraries."
4419 echo "Doesn't look like a MIPS system."
4429 case "$xxx_prompt" in
4432 rp='Where are the include files you want to use?'
4440 : see how we invoke the C preprocessor
4442 echo "Now, how can we feed standard input to your C preprocessor..." >&4
4443 cat <<'EOT' >testcpp.c
4449 if test ! -f cppstdin; then
4450 if test "X$osname" = "Xaix" -a "X$gccversion" = X; then
4451 # AIX cc -E doesn't show the absolute headerfile
4452 # locations but we'll cheat by using the -M flag.
4453 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
4455 echo 'cat >.$$.c; '"$cc"' -E ${1+"$@"} .$$.c; rm .$$.c' >cppstdin
4458 echo "Keeping your $hint cppstdin wrapper."
4461 wrapper=`pwd`/cppstdin
4465 if $test "X$cppstdin" != "X" && \
4466 $cppstdin $cppminus <testcpp.c >testcpp.out 2>&1 && \
4467 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
4469 echo "You used to use $cppstdin $cppminus so we'll use that again."
4471 '') echo "But let's see if we can live without a wrapper..." ;;
4473 if $cpprun $cpplast <testcpp.c >testcpp.out 2>&1 && \
4474 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
4476 echo "(And we'll use $cpprun $cpplast to preprocess directly.)"
4479 echo "(However, $cpprun $cpplast does not work, let's see...)"
4487 echo "Good old $cppstdin $cppminus does not seem to be of any help..."
4494 elif echo 'Maybe "'"$cc"' -E" will work...'; \
4495 $cc -E <testcpp.c >testcpp.out 2>&1; \
4496 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4497 echo "Yup, it does."
4500 elif echo 'Nope...maybe "'"$cc"' -E -" will work...'; \
4501 $cc -E - <testcpp.c >testcpp.out 2>&1; \
4502 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4503 echo "Yup, it does."
4506 elif echo 'Nope...maybe "'"$cc"' -P" will work...'; \
4507 $cc -P <testcpp.c >testcpp.out 2>&1; \
4508 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4509 echo "Yipee, that works!"
4512 elif echo 'Nope...maybe "'"$cc"' -P -" will work...'; \
4513 $cc -P - <testcpp.c >testcpp.out 2>&1; \
4514 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4515 echo "At long last!"
4518 elif echo 'No such luck, maybe "'$cpp'" will work...'; \
4519 $cpp <testcpp.c >testcpp.out 2>&1; \
4520 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4524 elif echo 'Nixed again...maybe "'$cpp' -" will work...'; \
4525 $cpp - <testcpp.c >testcpp.out 2>&1; \
4526 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4527 echo "Hooray, it works! I was beginning to wonder."
4530 elif echo 'Uh-uh. Time to get fancy. Trying a wrapper...'; \
4531 $wrapper <testcpp.c >testcpp.out 2>&1; \
4532 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4538 rp="No dice. I can't find a C preprocessor. Name one:"
4542 $x_cpp <testcpp.c >testcpp.out 2>&1
4543 if $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4544 echo "OK, that will do." >&4
4546 echo "Sorry, I can't get that to work. Go find one and rerun Configure." >&4
4561 echo "Perhaps can we force $cc -E using a wrapper..."
4562 if $wrapper <testcpp.c >testcpp.out 2>&1; \
4563 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
4569 echo "Nope, we'll have to live without it..."
4583 "$wrapper"|'cppstdin') ;;
4584 *) $rm -f $wrapper;;
4586 $rm -f testcpp.c testcpp.out
4588 : Set private lib path
4591 plibpth="$incpath/usr/lib /usr/local/lib /usr/ccs/lib"
4596 '') dlist="$loclibpth $plibpth $glibpth";;
4597 *) dlist="$libpth";;
4600 : Now check and see which directories actually exist, avoiding duplicates
4604 if $test -d $xxx; then
4607 *) libpth="$libpth $xxx";;
4613 Some systems have incompatible or broken versions of libraries. Among
4614 the directories listed in the question below, please remove any you
4615 know not to be holding relevant libraries, and add any that are needed.
4616 Say "none" for none.
4627 rp="Directories to use for library searches?"
4634 : compute shared library extension
4637 if xxx=`./loc libc.sl X $libpth`; $test -f "$xxx"; then
4647 On some systems, shared libraries may be available. Answer 'none' if
4648 you want to suppress searching of shared libraries for the remainder
4649 of this configuration.
4652 rp='What is the file extension used for shared libraries?'
4656 : Define several unixisms.
4657 : Hints files or command line option can be used to override them.
4658 : The convoluted testing is in case hints files set either the old
4661 '') case "$exe_ext" in
4663 *) _exe="$exe_ext" ;;
4668 '') case "$lib_ext" in
4675 '') case "$obj_ext" in
4682 '') case "$path_sep" in
4693 : Which makefile gets called first. This is used by make depend.
4694 case "$firstmakefile" in
4695 '') firstmakefile='makefile';;
4699 *-DUSE_LONG_DOUBLE*|*-DUSE_MORE_BITS*) uselongdouble="$define" ;;
4702 case "$uselongdouble" in
4703 $define|true|[yY]*) dflt='y';;
4708 Perl can be built to take advantage of long doubles which
4709 (if available) may give more accuracy and range for floating point numbers.
4711 If this doesn't make any sense to you, just accept the default '$dflt'.
4713 rp='Try to use long doubles if available?'
4716 y|Y) val="$define" ;;
4722 case "$uselongdouble" in
4723 true|[yY]*) uselongdouble="$define" ;;
4726 : Look for a hint-file generated 'call-back-unit'. If the
4727 : user has specified that long doubles should be used,
4728 : we may need to set or change some other defaults.
4729 if $test -f uselongdouble.cbu; then
4730 echo "Your platform has some specific hints regarding long doubles, using them..."
4731 . ./uselongdouble.cbu
4733 case "$uselongdouble" in
4736 (Your platform does not have any specific hints for long doubles.)
4742 : Looking for optional libraries
4744 echo "Checking for optional libraries..." >&4
4749 case "$libswanted" in
4750 '') libswanted='c_s';;
4753 "$define") libswanted="$libswanted socks5 socks5_sh" ;;
4759 for thisdir in $libpth $xlibpth; do
4760 test -d $thisdir && libspath="$libspath $thisdir"
4762 for thislib in $libswanted; do
4763 for thisdir in $libspath; do
4765 if $test ! -f "$xxx" -a "X$ignore_versioned_solibs" = "X"; then
4766 xxx=`ls $thisdir/lib$thislib.$so.[0-9] 2>/dev/null|sed -n '$p'`
4767 $test -f "$xxx" && eval $libscheck
4768 $test -f "$xxx" && libstyle=shared
4770 if test ! -f "$xxx"; then
4771 xxx=$thisdir/lib$thislib.$so
4772 $test -f "$xxx" && eval $libscheck
4773 $test -f "$xxx" && libstyle=shared
4775 if test ! -f "$xxx"; then
4776 xxx=$thisdir/lib$thislib$_a
4777 $test -f "$xxx" && eval $libscheck
4778 $test -f "$xxx" && libstyle=static
4780 if test ! -f "$xxx"; then
4781 xxx=$thisdir/$thislib$_a
4782 $test -f "$xxx" && eval $libscheck
4783 $test -f "$xxx" && libstyle=static
4785 if test ! -f "$xxx"; then
4786 xxx=$thisdir/lib${thislib}_s$_a
4787 $test -f "$xxx" && eval $libscheck
4788 $test -f "$xxx" && libstyle=static
4789 $test -f "$xxx" && thislib=${thislib}_s
4791 if test ! -f "$xxx"; then
4792 xxx=$thisdir/Slib$thislib$_a
4793 $test -f "$xxx" && eval $libscheck
4794 $test -f "$xxx" && libstyle=static
4796 if $test -f "$xxx"; then
4798 shared) echo "Found -l$thislib (shared)." ;;
4799 static) echo "Found -l$thislib." ;;
4800 *) echo "Found -l$thislib ($libstyle)." ;;
4804 *) dflt="$dflt -l$thislib"
4805 libsfound="$libsfound $xxx"
4807 libsfiles="$libsfiles $yyy"
4808 yyy=`echo $xxx|$sed -e "s%/$yyy\\$%%"`
4809 case " $libsdirs " in
4811 *) libsdirs="$libsdirs $yyy" ;;
4818 if $test ! -f "$xxx"; then
4819 echo "No -l$thislib."
4830 ' '|'') dflt='none';;
4835 In order to compile $package on your machine, a number of libraries
4836 are usually needed. Include any other special libraries here as well.
4837 Say "none" for none. The default list is almost always right.
4841 rp="What libraries to use?"
4848 : determine optimization, if desired, or use for debug flag also
4850 ' '|$undef) dflt='none';;
4852 *) dflt="$optimize";;
4856 By default, $package compiles with the -O flag to use the optimizer.
4857 Alternately, you might want to use the symbolic debugger, which uses
4858 the -g flag (on traditional Unix systems). Either flag can be
4859 specified here. To use neither flag, specify the word "none".
4862 rp="What optimizer/debugger flag should be used?"
4866 'none') optimize=" ";;
4869 : Check what DEBUGGING is required from the command line
4870 : -DEBUGGING or -DDEBUGGING or
4871 : -DEBUGGING=both = -g + -DDEBUGGING
4872 : -DEBUGGING=-g or -Doptimize=-g = -g
4873 : -DEBUGGING=none or -UDEBUGGING =
4874 : -DEBUGGING=old or -DEBUGGING=default = ? $optimize
4877 *) DEBUGGING=$EBUGGING ;;
4880 case "$DEBUGGING" in
4884 *) optimize="$optimize -g" ;;
4888 *-g*) set `echo "X $optimize " | sed 's/ -g / /'`
4896 case "$DEBUGGING" in
4897 both|$define) dflt='-DDEBUGGING'
4900 : We will not override a previous value, but we might want to
4901 : augment a hint file
4903 default|recommended)
4904 case "$gccversion" in
4905 1*) dflt="$dflt -fpcc-struct-return" ;;
4907 case "$optimize:$DEBUGGING" in
4908 *-g*:old) dflt="$dflt -DDEBUGGING";;
4910 case "$gccversion" in
4911 2*) if test -d /etc/conf/kconfig.d &&
4912 $contains _POSIX_VERSION $usrinc/sys/unistd.h >/dev/null 2>&1
4914 # Interactive Systems (ISC) POSIX mode.
4919 case "$gccversion" in
4923 echo "Checking if your compiler accepts -fno-strict-aliasing" 2>&1
4924 echo 'int main(void) { return 0; }' > gcctest.c
4925 if $cc -O2 -fno-strict-aliasing -o gcctest gcctest.c; then
4926 echo "Yes, it does." 2>&1
4929 echo "Leaving current flags $ccflags alone." 2>&1
4931 *) dflt="$dflt -fno-strict-aliasing" ;;
4934 echo "Nope, it doesn't, but that's ok." 2>&1
4938 # For gcc, adding -pipe speeds up compilations for some, but apparently
4939 # some assemblers can't read from stdin. (It also slows down compilations
4940 # in other cases, but those are apparently rarer these days.) AD 5/2004.
4941 case "$gccversion" in
4943 echo "Checking if your compiler accepts -pipe" 2>&1
4944 echo 'int main(void) { return 0; }' > gcctest.c
4945 if $cc -pipe -o gcctest gcctest.c; then
4946 echo "Yes, it does." 2>&1
4949 echo "Leaving current flags $ccflags alone." 2>&1
4951 *) dflt="$dflt -pipe" ;;
4954 echo "Nope, it doesn't, but that's ok." 2>&1
4957 echo "Checking if your compiler accepts -Wdeclaration-after-statement" 2>&1
4958 echo 'int main(void) { return 0; }' > gcctest.c
4959 if $cc -Wdeclaration-after-statement -o gcctest gcctest.c; then
4960 echo "Yes, it does." 2>&1
4962 *-Wdeclaration-after-statement*)
4963 echo "Leaving current flags $ccflags alone." 2>&1
4965 *) dflt="$dflt -Wdeclaration-after-statement" ;;
4968 echo "Nope, it doesn't, but that's ok." 2>&1
4975 case "$mips_type" in
4976 *BSD*|'') inclwanted="$locincpth $usrinc";;
4977 *) inclwanted="$locincpth $inclwanted $usrinc/bsd";;
4979 for thisincl in $inclwanted; do
4980 if $test -d $thisincl; then
4981 if $test x$thisincl != x$usrinc; then
4983 *" -I$thisincl "*);;
4984 *) dflt="$dflt -I$thisincl ";;
4990 inctest='if $contains $2 $usrinc/$1 >/dev/null 2>&1; then
4992 elif $contains $2 $usrinc/sys/$1 >/dev/null 2>&1; then
5000 *) dflt="$dflt -D$2";;
5004 set signal.h LANGUAGE_C; eval $inctest
5008 ccflags="$ccflags -DSOCKS"
5013 default|recommended) dflt="$ccflags $dflt" ;;
5014 *) dflt="$ccflags";;
5023 Your C compiler may want other flags. For this question you should include
5024 -I/whatever and -DWHATEVER flags and any other flags used by the C compiler,
5025 but you should NOT include libraries or ld flags like -lwhatever. If you
5026 want $package to honor its debug switch, you should include -DDEBUGGING here.
5027 Your C compiler might also need additional flags, such as -D_POSIX_SOURCE.
5029 To use no flags, specify the word "none".
5035 rp="Any additional cc flags?"
5042 : the following weeds options from ccflags that are of no interest to cpp
5044 '') cppflags="$ccflags" ;;
5045 *) cppflags="$cppflags $ccflags" ;;
5047 case "$gccversion" in
5048 1*) cppflags="$cppflags -D__GNUC__"
5050 case "$mips_type" in
5052 *BSD*) cppflags="$cppflags -DSYSTYPE_BSD43";;
5058 echo "Let me guess what the preprocessor flags are..." >&4
5072 *) ftry="$previous $flag";;
5074 if $cppstdin -DLFRULB=bar $cppflags $ftry $cppminus <cpp.c \
5075 >cpp1.out 2>/dev/null && \
5076 $cpprun -DLFRULB=bar $cppflags $ftry $cpplast <cpp.c \
5077 >cpp2.out 2>/dev/null && \
5078 $contains 'foo.*xx.*bar' cpp1.out >/dev/null 2>&1 && \
5079 $contains 'foo.*xx.*bar' cpp2.out >/dev/null 2>&1
5081 cppflags="$cppflags $ftry"
5091 *-*) echo "They appear to be: $cppflags";;
5093 $rm -f cpp.c cpp?.out
5097 : flags used in final linking phase
5099 '') if ./venix; then
5105 *-posix*) dflt="$dflt -posix" ;;
5108 *) dflt="$ldflags";;
5111 : Try to guess additional flags to pick up local libraries.
5112 for thislibdir in $libpth; do
5113 case " $loclibpth " in
5116 *"-L$thislibdir "*) ;;
5117 *) dflt="$dflt -L$thislibdir" ;;
5129 Your C linker may need flags. For this question you should
5130 include -L/whatever and any other flags used by the C linker, but you
5131 should NOT include libraries like -lwhatever.
5133 Make sure you include the appropriate -L/path flags if your C linker
5134 does not normally search all of the directories you specified above,
5137 To use no flags, specify the word "none".
5141 rp="Any additional ld flags (NOT including libraries)?"
5147 rmlist="$rmlist pdp11"
5151 echo "Checking your choice of C compiler and flags for coherency..." >&4
5152 $cat > try.c <<'EOF'
5154 int main() { printf("Ok\n"); return(0); }
5156 set X $cc -o try $optimize $ccflags $ldflags try.c $libs
5158 $cat >try.msg <<'EOM'
5159 I've tried to compile and run the following simple program:
5162 $cat try.c >> try.msg
5164 $cat >> try.msg <<EOM
5171 and I got the following output:
5175 if $sh -c "$cc -o try $optimize $ccflags $ldflags try.c $libs" >>try.msg 2>&1; then
5176 if $sh -c "$run ./try" >>try.msg 2>&1; then
5180 *) echo 'The program compiled OK, but produced no output.' >> try.msg
5183 cat >> try.msg <<'EOQS'
5184 If $libs contains -lsfio, and sfio is mis-configured, then it
5185 sometimes (apparently) runs and exits with a 0 status, but with no
5186 output! It may have to do with sfio's use of _exit vs. exit.
5189 rp="You have a big problem. Shall I abort Configure"
5196 echo "The program compiled OK, but exited with status $?." >>try.msg
5197 rp="You have a problem. Shall I abort Configure"
5201 echo "I can't compile the test program." >>try.msg
5202 rp="You have a BIG problem. Shall I abort Configure"
5208 case "$knowitall" in
5210 echo "(The supplied flags or libraries might be incorrect.)"
5218 *) echo "Ok. Stopping Configure." >&4
5223 n) echo "OK, that should do.";;
5225 $rm -f try try.* core
5227 : define a shorthand compile call
5231 $cc -o ${mc_file} $optimize $ccflags $ldflags $* ${mc_file}.c $libs > /dev/null 2>&1;'
5232 : define a shorthand compile call for compilations that should be ok.
5236 $cc -o ${mc_file} $optimize $ccflags $ldflags $* ${mc_file}.c $libs;'
5238 : determine filename position in cpp output
5240 echo "Computing filename position in cpp output for #include directives..." >&4
5242 vos) testaccess=-e ;;
5245 echo '#include <stdio.h>' > foo.c
5248 $cppstdin $cppflags $cppminus <foo.c 2>/dev/null | \
5249 $grep '^[ ]*#.*stdio\.h' | \
5250 while read cline; do
5253 while $test \$# -gt 0; do
5254 if $test $testaccess \`echo \$1 | $tr -d '"'\`; then
5259 pos=\`expr \$pos + 1\`
5271 *) pos="${fieldn}th";;
5273 echo "Your cpp writes the filename in the $pos field of the line."
5276 vos) cppfilter="tr '\\\\>' '/' |" ;; # path component separator is >
5277 os2) cppfilter="sed -e 's|\\\\\\\\|/|g' |" ;; # path component separator is \
5280 : locate header file
5285 for usrincdir in $usrinc
5287 if test -f \$usrincdir/\$wanted; then
5288 echo "\$usrincdir/\$wanted"
5292 awkprg='{ print \$$fieldn }'
5293 echo "#include <\$wanted>" > foo\$\$.c
5294 $cppstdin $cppminus $cppflags < foo\$\$.c 2>/dev/null | \
5295 $cppfilter $grep "^[ ]*#.*\$wanted" | \
5296 while read cline; do
5297 name=\`echo \$cline | $awk "\$awkprg" | $tr -d '"'\`
5299 *[/\\\\]\$wanted) echo "\$name"; exit 1;;
5300 *[\\\\/]\$wanted) echo "\$name"; exit 1;;
5305 # status = 0: grep returned 0 lines, case statement not executed
5306 # status = 1: headerfile found
5307 # status = 2: while loop executed, no headerfile found
5311 if test \$status -eq 1; then
5318 : define an alternate in-header-list? function
5319 inhdr='echo " "; td=$define; tu=$undef; yyy=$@;
5320 cont=true; xxf="echo \"<\$1> found.\" >&4";
5321 case $# in 2) xxnf="echo \"<\$1> NOT found.\" >&4";;
5322 *) xxnf="echo \"<\$1> NOT found, ...\" >&4";;
5324 case $# in 4) instead=instead;; *) instead="at last";; esac;
5325 while $test "$cont"; do
5327 var=$2; eval "was=\$$2";
5328 if $test "$xxx" && $test -r "$xxx";
5330 eval "case \"\$$var\" in $undef) . ./whoa; esac"; eval "$var=\$td";
5333 eval "case \"\$$var\" in $define) . ./whoa; esac"; eval "$var=\$tu"; fi;
5334 set $yyy; shift; shift; yyy=$@;
5335 case $# in 0) cont="";;
5336 2) xxf="echo \"but I found <\$1> $instead.\" >&4";
5337 xxnf="echo \"and I did not find <\$1> either.\" >&4";;
5338 *) xxf="echo \"but I found <\$1\> instead.\" >&4";
5339 xxnf="echo \"there is no <\$1>, ...\" >&4";;
5343 do set $yyy; var=$2; eval "was=\$$2";
5344 eval "case \"\$$var\" in $define) . ./whoa; esac"; eval "$var=\$tu";
5345 set $yyy; shift; shift; yyy=$@;
5348 : see if stdlib is available
5349 set stdlib.h i_stdlib
5352 : check for lengths of integral types
5356 echo "Checking to see how big your integers are..." >&4
5365 printf("intsize=%d;\n", (int)sizeof(int));
5366 printf("longsize=%d;\n", (int)sizeof(long));
5367 printf("shortsize=%d;\n", (int)sizeof(short));
5372 if eval $compile_ok && $run ./try > /dev/null; then
5374 echo "Your integers are $intsize bytes long."
5375 echo "Your long integers are $longsize bytes long."
5376 echo "Your short integers are $shortsize bytes long."
5380 Help! I can't compile and run the intsize test program: please enlighten me!
5381 (This is probably a misconfiguration in your system or libraries, and
5382 you really ought to fix it. Still, I'll try anyway.)
5386 rp="What is the size of an integer (in bytes)?"
5390 rp="What is the size of a long integer (in bytes)?"
5394 rp="What is the size of a short integer (in bytes)?"
5402 : check for long long
5404 echo "Checking to see if you have long long..." >&4
5405 echo 'int main() { long long x = 7; return 0; }' > try.c
5407 if eval $compile; then
5409 echo "You have long long."
5412 echo "You do not have long long."
5418 : check for length of long long
5419 case "${d_longlong}${longlongsize}" in
5422 echo "Checking to see how big your long longs are..." >&4
5423 $cat >try.c <<'EOCP'
5427 printf("%d\n", (int)sizeof(long long));
5432 if eval $compile_ok; then
5433 longlongsize=`$run ./try`
5434 echo "Your long longs are $longlongsize bytes long."
5438 echo "(I can't seem to compile the test program. Guessing...)"
5439 rp="What is the size of a long long (in bytes)?"
5443 if $test "X$longsize" = "X$longlongsize"; then
5444 echo "(That isn't any different from an ordinary long.)"
5450 : see if inttypes.h is available
5451 : we want a real compile instead of Inhdr because some systems
5452 : have an inttypes.h which includes non-existent headers
5455 #include <inttypes.h>
5457 static int32_t foo32 = 0x12345678;
5461 if eval $compile; then
5462 echo "<inttypes.h> found." >&4
5465 echo "<inttypes.h> NOT found." >&4
5474 echo "Checking to see if you have int64_t..." >&4
5476 #include <sys/types.h>
5477 #$i_inttypes I_INTTYPES
5479 #include <inttypes.h>
5481 int main() { int64_t x = 7; }
5484 if eval $compile; then
5486 echo "You have int64_t."
5489 echo "You do not have int64_t."
5497 echo "Checking which 64-bit integer type we could use..." >&4
5503 val='"unsigned int"'
5508 *) case "$longsize" in
5512 val='"unsigned long"'
5517 *) case "$d_longlong:$longlongsize" in
5522 val='"unsigned long long"'
5527 *) case "$d_int64_t" in
5546 '') echo "Alas, no 64-bit integer types in sight." >&4
5549 *) echo "We could use '$quadtype' for 64-bit integers." >&4
5555 case "$uselonglong" in
5556 "$define"|true|[yY]*)
5559 *** Configure -Duselonglong is deprecated, using -Duse64bitint instead.
5561 use64bitint="$define"
5564 case "$use64bits" in
5565 "$define"|true|[yY]*)
5568 *** Configure -Duse64bits is deprecated, using -Duse64bitint instead.
5570 use64bitint="$define"
5573 case "$use64bitints" in
5574 "$define"|true|[yY]*)
5577 *** There is no Configure -Duse64bitints, using -Duse64bitint instead.
5579 use64bitint="$define"
5582 case "$use64bitsint" in
5583 "$define"|true|[yY]*)
5586 *** There is no Configure -Duse64bitsint, using -Duse64bitint instead.
5588 use64bitint="$define"
5591 case "$uselonglongs" in
5592 "$define"|true|[yY]*)
5595 *** There is no Configure -Duselonglongs, using -Duse64bitint instead.
5597 use64bitint="$define"
5600 case "$use64bitsall" in
5601 "$define"|true|[yY]*)
5604 *** There is no Configure -Duse64bitsall, using -Duse64bitall instead.
5606 use64bitall="$define"
5611 *-DUSE_LONG_LONG*|*-DUSE_64_BIT_INT*|*-DUSE_64_BIT_ALL*) use64bitint="$define";;
5613 case "$use64bitall" in
5614 "$define"|true|[yY]*) use64bitint="$define" ;;
5620 You have natively 64-bit long integers.
5624 *) case "$use64bitint" in
5625 "$define"|true|[yY]*) dflt='y';;
5634 Perl can be built to take advantage of 64-bit integer types
5635 on some systems. To do so, Configure can be run with -Duse64bitint.
5636 Choosing this option will most probably introduce binary incompatibilities.
5638 If this doesn't make any sense to you, just accept the default '$dflt'.
5639 (The default has been chosen based on your configuration.)
5641 rp='Try to use 64-bit integers, if available?'
5644 [yY]*) val="$define" ;;
5652 case "$use64bitall" in
5653 "$define"|true|[yY]*) dflt='y' ;;
5654 *) case "$longsize" in
5662 You may also choose to try maximal 64-bitness. It means using as much
5663 64-bitness as possible on the platform. This in turn means even more
5664 binary incompatibilities. On the other hand, your platform may not
5665 have any more 64-bitness available than what you already have chosen.
5667 If this doesn't make any sense to you, just accept the default '$dflt'.
5668 (The default has been chosen based on your configuration.)
5670 rp='Try to use maximal 64-bit support, if available?'
5673 [yY]*) val="$define" ;;
5678 case "$use64bitall" in
5680 case "$use64bitint" in
5684 Since you have chosen a maximally 64-bit build, I'm also turning on
5685 the use of 64-bit integers.
5687 use64bitint="$define" ;;
5692 : Look for a hint-file generated 'call-back-unit'. If the
5693 : user has specified that a 64-bit perl is to be built,
5694 : we may need to set or change some other defaults.
5695 if $test -f use64bitint.cbu; then
5696 echo "Your platform has some specific hints regarding 64-bit integers, using them..."
5699 case "$use64bitint" in
5700 "$define"|true|[yY]*)
5702 4) case "$archname64" in
5703 '') archname64=64int ;;
5710 : Look for a hint-file generated 'call-back-unit'. If the
5711 : user has specified that a maximally 64-bit perl is to be built,
5712 : we may need to set or change some other defaults.
5713 if $test -f use64bitall.cbu; then
5714 echo "Your platform has some specific hints regarding 64-bit builds, using them..."
5717 case "$use64bitall" in
5718 "$define"|true|[yY]*)
5720 4) case "$archname64" in
5721 ''|64int) archname64=64all ;;
5728 case "$d_quad:$use64bitint" in
5732 *** You have chosen to use 64-bit integers,
5733 *** but none can be found.
5734 *** Please rerun Configure without -Duse64bitint and/or -Dusemorebits.
5735 *** Cannot continue, aborting.
5742 : check for length of double
5744 case "$doublesize" in
5746 echo "Checking to see how big your double precision numbers are..." >&4
5755 printf("%d\n", (int)sizeof(double));
5760 if eval $compile_ok; then
5761 doublesize=`$run ./try`
5762 echo "Your double is $doublesize bytes long."
5765 echo "(I can't seem to compile the test program. Guessing...)"
5766 rp="What is the size of a double precision number (in bytes)?"
5774 : check for long doubles
5776 echo "Checking to see if you have long double..." >&4
5777 echo 'int main() { long double x = 7.0; }' > try.c
5779 if eval $compile; then
5781 echo "You have long double."
5784 echo "You do not have long double."
5790 : check for length of long double
5791 case "${d_longdbl}${longdblsize}" in
5794 echo "Checking to see how big your long doubles are..." >&4
5795 $cat >try.c <<'EOCP'
5799 printf("%d\n", sizeof(long double));
5804 if eval $compile; then
5805 longdblsize=`$run ./try`
5806 echo "Your long doubles are $longdblsize bytes long."
5810 echo "(I can't seem to compile the test program. Guessing...)" >&4
5811 rp="What is the size of a long double (in bytes)?"
5815 if $test "X$doublesize" = "X$longdblsize"; then
5816 echo "That isn't any different from an ordinary double."
5817 echo "I'll keep your setting anyway, but you may see some"
5818 echo "harmless compilation warnings."
5824 : determine the architecture name
5826 if xxx=`./loc arch blurfl $pth`; $test -f "$xxx"; then
5827 tarch=`arch`"-$osname"
5828 elif xxx=`./loc uname blurfl $pth`; $test -f "$xxx" ; then
5829 if uname -m > tmparch 2>&1 ; then
5830 tarch=`$sed -e 's/ *$//' -e 's/ /_/g' \
5831 -e 's/$/'"-$osname/" tmparch`
5839 case "$myarchname" in
5842 echo "(Your architecture name used to be $myarchname.)"
5846 case "$targetarch" in
5848 *) archname=`echo $targetarch|sed 's,^[^-]*-,,'` ;;
5853 *) dflt="$archname";;
5855 rp='What is your architecture name'
5858 case "$usethreads" in
5860 echo "Threads selected." >&4
5862 *-thread*) echo "...and architecture name already has -thread." >&4
5864 *) archname="$archname-thread"
5865 echo "...setting architecture name to $archname." >&4
5870 case "$usemultiplicity" in
5872 echo "Multiplicity selected." >&4
5874 *-multi*) echo "...and architecture name already has -multi." >&4
5876 *) archname="$archname-multi"
5877 echo "...setting architecture name to $archname." >&4
5882 case "$use64bitint$use64bitall" in
5884 case "$archname64" in
5886 echo "This architecture is naturally 64-bit, not changing architecture name." >&4
5889 case "$use64bitint" in
5890 "$define") echo "64 bit integers selected." >&4 ;;
5892 case "$use64bitall" in
5893 "$define") echo "Maximal 64 bitness selected." >&4 ;;
5896 *-$archname64*) echo "...and architecture name already has $archname64." >&4
5898 *) archname="$archname-$archname64"
5899 echo "...setting architecture name to $archname." >&4
5905 case "$uselongdouble" in
5907 echo "Long doubles selected." >&4
5908 case "$longdblsize" in
5910 echo "...but long doubles are equal to doubles, not changing architecture name." >&4
5914 *-ld*) echo "...and architecture name already has -ld." >&4
5916 *) archname="$archname-ld"
5917 echo "...setting architecture name to $archname." >&4
5924 case "$useperlio" in
5926 echo "Perlio selected." >&4
5929 echo "Perlio not selected, using stdio." >&4
5931 *-stdio*) echo "...and architecture name already has -stdio." >&4
5933 *) archname="$archname-stdio"
5934 echo "...setting architecture name to $archname." >&4
5939 if $test -f archname.cbu; then
5940 echo "Your platform has some specific hints for architecture name, using them..."
5944 : set the prefixit variable, to compute a suitable default value
5945 prefixit='case "$3" in
5947 case "$oldprefix" in
5948 "") eval "$1=\"\$$2\"";;
5955 ""|" ") eval "$1=\"\$$2\"";;
5961 eval "tp=\"$oldprefix-\$$2-\""; eval "tp=\"$tp\"";
5963 --|/*--|\~*--) eval "$1=\"$prefix/$3\"";;
5964 /*-$oldprefix/*|\~*-$oldprefix/*)
5965 eval "$1=\`echo \$$2 | sed \"s,^$oldprefix,$prefix,\"\`";;
5966 *) eval "$1=\"\$$2\"";;
5970 : get the patchlevel
5972 echo "Getting the current patchlevel..." >&4
5973 if $test -r $rsrc/patchlevel.h;then
5974 revision=`awk '/define[ ]+PERL_REVISION/ {print $3}' $rsrc/patchlevel.h`
5975 patchlevel=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
5976 subversion=`awk '/define[ ]+PERL_SUBVERSION/ {print $3}' $rsrc/patchlevel.h`
5977 api_revision=`awk '/define[ ]+PERL_API_REVISION/ {print $3}' $rsrc/patchlevel.h`
5978 api_version=`awk '/define[ ]+PERL_API_VERSION/ {print $3}' $rsrc/patchlevel.h`
5979 api_subversion=`awk '/define[ ]+PERL_API_SUBVERSION/ {print $3}' $rsrc/patchlevel.h`
5980 perl_patchlevel=`egrep 'define PERL_PATCHNUM [0-9][0-9]|,"MAINT[0-9][0-9]*"' $rsrc/patchlevel.h|sed 's/[^0-9]//g'`
5989 $echo "(You do not have patchlevel.h. Eek.)"
5991 if $test -r $rsrc/.patch ; then
5992 if $test "X$perl_patchlevel" = "X" || $test "`cat $rsrc/.patch`" -gt "$perl_patchlevel" ; then
5993 perl_patchlevel=`cat $rsrc/.patch`
5996 : Define a handy string here to avoid duplication in myconfig.SH and configpm.
5997 version_patchlevel_string="version $patchlevel subversion $subversion"
5998 case "$perl_patchlevel" in
6000 *) version_patchlevel_string="$version_patchlevel_string patch $perl_patchlevel" ;;
6003 $echo "(You have $package $version_patchlevel_string.)"
6007 : XXX Should be a Configure test for double-dots in filenames.
6008 version=`echo $revision $patchlevel $subversion | \
6009 $awk '{ printf "%d_%d_%d\n", $1, $2, $3 }'`
6010 api_versionstring=`echo $api_revision $api_version $api_subversion | \
6011 $awk '{ printf "%d_%d_%d\n", $1, $2, $3 }'`
6014 version=`echo $revision $patchlevel $subversion | \
6015 $awk '{ printf "%d.%d.%d\n", $1, $2, $3 }'`
6016 api_versionstring=`echo $api_revision $api_version $api_subversion | \
6017 $awk '{ printf "%d.%d.%d\n", $1, $2, $3 }'`
6020 : Special case the 5.005_xx maintenance series, which used 5.005
6021 : without any subversion label as a subdirectory in $sitelib
6022 if test "${api_revision}${api_version}${api_subversion}" = "550"; then
6023 api_versionstring='5.005'
6026 : determine installation style
6027 : For now, try to deduce it from prefix unless it is already set.
6028 : Reproduce behavior of 5.005 and earlier, maybe drop that in 5.7.
6029 case "$installstyle" in
6030 '') case "$prefix" in
6031 *perl*) dflt='lib';;
6032 *) dflt='lib/perl5' ;;
6035 *) dflt="$installstyle" ;;
6037 : Probably not worth prompting for this since we prompt for all
6038 : the directories individually, and the prompt would be too long and
6042 : determine where public executables go
6047 rp='Pathname where the public executables will reside?'
6049 if $test "X$ansexp" != "X$binexp"; then
6053 : XXX Bug? -- ignores Configure -Dinstallprefix setting.
6054 : XXX If this is fixed, also fix the "start perl" hunk below, which relies on
6055 : this via initialinstalllocation
6058 case "$userelocatableinc" in
6059 $define|true|[yY]*) dflt='y' ;;
6064 Would you like to build Perl so that the installation is relocatable, so that
6065 library paths in @INC are determined relative to the path of the perl binary?
6066 This is not advised for system Perl installs, or if you need to run setid
6067 scripts or scripts under taint mode.
6069 If this doesn't make any sense to you, just accept the default '$dflt'.
6071 rp='Use relocatable @INC?'
6074 y|Y) val="$define" ;;
6077 set userelocatableinc
6080 initialinstalllocation="$binexp"
6081 : Default prefix is now "up one level from where the binaries are"
6082 case "$userelocatableinc" in
6088 installprefixexp=".../.."
6092 : determine where private library files go
6093 : Usual default is /usr/local/lib/perl5/$version.
6094 : Also allow things like /opt/perl/lib/$version, since
6095 : /opt/perl/lib/perl5... would be redundant.
6096 : The default "style" setting is made in installstyle.U
6097 case "$installstyle" in
6098 *lib/perl5*) set dflt privlib lib/$package/$version ;;
6099 *) set dflt privlib lib/$version ;;
6104 There are some auxiliary files for $package that need to be put into a
6105 private library directory that is accessible by everyone.
6110 rp='Pathname where the private library files will reside?'
6115 : set the prefixup variable, to restore leading tilda escape
6116 prefixup='case "$prefixexp" in
6118 *) eval "$1=\`echo \$$1 | sed \"s,^$prefixexp,$prefix,\"\`";;
6121 : determine where public architecture dependent libraries go
6124 : privlib default is /usr/local/lib/$package/$version
6125 : archlib default is /usr/local/lib/$package/$version/$archname
6126 : privlib may have an optional trailing /share.
6127 tdflt=`echo $privlib | $sed 's,/share$,,'`
6128 tdflt=$tdflt/$archname
6137 $spackage contains architecture-dependent library files. If you are
6138 sharing libraries in a heterogeneous environment, you might store
6139 these files in a separate location. Otherwise, you can just include
6140 them with the rest of the public library files.
6145 rp='Where do you want to put the public architecture-dependent libraries?'
6149 if $test X"$archlib" = X"$privlib"; then
6155 : see if setuid scripts can be secure
6158 Some kernels have a bug that prevents setuid #! scripts from being
6159 secure. Some sites have disabled setuid #! scripts because of this.
6161 First let's decide if your kernel supports secure setuid #! scripts.
6162 (If setuid #! scripts would be secure but have been disabled anyway,
6163 don't say that they are secure if asked.)
6168 if $test -d /dev/fd; then
6169 echo "#!$ls" >reflect
6170 chmod +x,u+s reflect
6171 ./reflect >flect 2>&1
6172 if $contains "/dev/fd" flect >/dev/null; then
6173 echo "Congratulations, your kernel has secure setuid scripts!" >&4
6177 If you are not sure if they are secure, I can check but I'll need a
6178 username and password different from the one you are using right now.
6179 If you don't have such a username or don't want me to test, simply
6183 rp='Other username to test security of setuid scripts with?'
6188 case "$d_suidsafe" in
6189 '') echo "I'll assume setuid scripts are *not* secure." >&4
6192 echo "Well, the $hint value is *not* secure." >&4
6194 *) echo "Well, the $hint value *is* secure." >&4
6199 $rm -f reflect flect
6200 echo "#!$ls" >reflect
6201 chmod +x,u+s reflect
6204 echo '"su" will (probably) prompt you for '"$ans's password."
6205 su $ans -c './reflect >flect'
6206 if $contains "/dev/fd" flect >/dev/null; then
6207 echo "Okay, it looks like setuid scripts are secure." >&4
6210 echo "I don't think setuid scripts are secure." >&4
6215 rp='Does your kernel have *secure* setuid scripts?'
6218 [yY]*) val="$define";;
6223 echo "I don't think setuid scripts are secure (no /dev/fd directory)." >&4
6224 echo "(That's for file descriptors, not floppy disks.)"
6230 $rm -f reflect flect
6232 : now see if they want to do setuid emulation
6235 case "$d_suidsafe" in
6238 echo "No need to emulate SUID scripts since they are secure here." >&4
6242 Some systems have disabled setuid scripts, especially systems where
6243 setuid scripts cannot be secure. On systems where setuid scripts have
6244 been disabled, the setuid/setgid bits on scripts are currently
6245 useless. It is possible for $package to detect those bits and emulate
6246 setuid/setgid in a secure fashion. This emulation will only work if
6247 setuid scripts have been disabled in your kernel.
6251 "$define") dflt=y ;;
6254 rp="Do you want to do setuid/setgid emulation?"
6257 [yY]*) val="$define";;
6265 : Find perl5.005 or later.
6266 echo "Looking for a previously installed perl5.005 or later... "
6268 '') for tdir in `echo "$binexp$path_sep$PATH" | $sed "s/$path_sep/ /g"`; do
6269 : Check if this perl is recent and can load a simple module
6270 if $test -x $tdir/perl$exe_ext && $tdir/perl -Mless -e 'use 5.005;' >/dev/null 2>&1; then
6273 elif $test -x $tdir/perl5$exe_ext && $tdir/perl5 -Mless -e 'use 5.005;' >/dev/null 2>&1; then
6283 '') echo "None found. That's ok.";;
6284 *) echo "Using $perl5." ;;
6289 After $package is installed, you may wish to install various
6290 add-on modules and utilities. Typically, these add-ons will
6291 be installed under $prefix with the rest
6292 of this package. However, you may wish to install such add-ons
6293 elsewhere under a different prefix.
6295 If you do not wish to put everything under a single prefix, that's
6296 ok. You will be prompted for the individual locations; this siteprefix
6297 is only used to suggest the defaults.
6299 The default should be fine for most people.
6303 rp='Installation prefix to use for add-on modules and utilities?'
6304 : XXX Here might be another good place for an installstyle setting.
6305 case "$siteprefix" in
6307 *) dflt=$siteprefix ;;
6310 : XXX Prefixit unit does not yet support siteprefix and vendorprefix
6312 case "$siteprefix" in
6316 *) oldsiteprefix="$prefix";;
6321 siteprefixexp="$ansexp"
6323 : determine where site specific libraries go.
6324 : Usual default is /usr/local/lib/perl5/site_perl/$version
6325 : The default "style" setting is made in installstyle.U
6326 : XXX No longer works with Prefixit stuff.
6327 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
6329 '') case "$installstyle" in
6330 *lib/perl5*) dflt=$siteprefix/lib/$package/site_$prog/$version ;;
6331 *) dflt=$siteprefix/lib/site_$prog/$version ;;
6339 The installation process will create a directory for
6340 site-specific extensions and modules. Most users find it convenient
6341 to place all site-specific files in this directory rather than in the
6342 main distribution directory.
6346 rp='Pathname for the site-specific library files?'
6350 sitelib_stem=`echo "$sitelibexp" | sed "s,/$version$,,"`
6352 : Determine list of previous versions to include in @INC
6353 $cat > getverlist <<EOPL
6356 \$api_versionstring = "$api_versionstring";
6357 \$version = "$version";
6358 \$stem = "$sitelib_stem";
6359 \$archname = "$archname";
6361 $cat >> getverlist <<'EOPL'
6362 # Can't have leading @ because metaconfig interprets it as a command!
6363 ;@inc_version_list=();
6364 # XXX Redo to do opendir/readdir?
6367 ;@candidates = glob("5.*");
6373 # XXX ToDo: These comparisons must be reworked when two-digit
6374 # subversions come along, so that 5.7.10 compares as greater than
6375 # 5.7.3! By that time, hope that 5.6.x is sufficiently
6376 # widespread that we can use the built-in version vectors rather
6377 # than reinventing them here. For 5.6.0, however, we must
6378 # assume this script will likely be run by 5.005_0x. --AD 1/2000.
6379 foreach $d (@candidates) {
6380 if ($d lt $version) {
6381 if ($d ge $api_versionstring) {
6382 unshift(@inc_version_list, grep { -d } "$d/$archname", $d);
6384 elsif ($d ge "5.005") {
6385 unshift(@inc_version_list, grep { -d } $d);
6389 # Skip newer version. I.e. don't look in
6390 # 5.7.0 if we're installing 5.6.1.
6394 if (@inc_version_list) {
6395 print join(' ', @inc_version_list);
6398 # Blank space to preserve value for next Configure run.
6403 case "$inc_version_list" in
6404 '') if test -x "$perl5$exe_ext"; then
6405 dflt=`$perl5 getverlist`
6410 $undef) dflt='none' ;;
6411 *) eval dflt=\"$inc_version_list\" ;;
6414 ''|' ') dflt=none ;;
6421 In order to ease the process of upgrading, this version of perl
6422 can be configured to use modules built and installed with earlier
6423 versions of perl that were installed under $prefix. Specify here
6424 the list of earlier versions that this version of perl should check.
6425 If Configure detected no earlier versions of perl installed under
6426 $prefix, then the list will be empty. Answer 'none' to tell perl
6427 to not search earlier versions.
6429 The default should almost always be sensible, so if you're not sure,
6430 just accept the default.
6433 rp='List of earlier versions to include in @INC?'
6436 [Nn]one|''|' '|$undef) inc_version_list=' ' ;;
6437 *) inc_version_list="$ans" ;;
6439 case "$inc_version_list" in
6441 inc_version_list_init='0'
6442 d_inc_version_list="$undef"
6444 *) inc_version_list_init=`echo $inc_version_list |
6445 $sed -e 's/^/"/' -e 's/ /","/g' -e 's/$/",0/'`
6446 d_inc_version_list="$define"
6451 : see if this is a malloc.h system
6452 : we want a real compile instead of Inhdr because some systems have a
6453 : malloc.h that just gives a compile error saying to use stdlib.h instead
6458 int main () { return 0; }
6461 if eval $compile; then
6462 echo "<malloc.h> found." >&4
6465 echo "<malloc.h> NOT found." >&4
6472 : check for void type
6474 echo "Checking to see how well your C compiler groks the void type..." >&4
6475 case "$voidflags" in
6487 extern void moo(); /* function returning void */
6488 void (*goo)(); /* ptr to func returning void */
6490 void *hue; /* generic ptr */
6503 int main() { sub(); }
6505 if $cc $ccflags -c -DTRY=$defvoidused try.c >.out 2>&1 ; then
6506 voidflags=$defvoidused
6507 echo "Good. It appears to support void to the level $package wants.">&4
6508 if $contains warning .out >/dev/null 2>&1; then
6509 echo "However, you might get some warnings that look like this:"
6513 echo "Hmm, your compiler has some difficulty with void. Checking further..." >&4
6514 if $cc $ccflags -c -DTRY=1 try.c >/dev/null 2>&1; then
6515 echo "It supports 1..."
6516 if $cc $ccflags -c -DTRY=3 try.c >/dev/null 2>&1; then
6517 echo "It also supports 2..."
6518 if $cc $ccflags -c -DTRY=7 try.c >/dev/null 2>&1; then
6520 echo "And it supports 4 but not 8 definitely."
6522 echo "It doesn't support 4..."
6523 if $cc $ccflags -c -DTRY=11 try.c >/dev/null 2>&1; then
6525 echo "But it supports 8."
6528 echo "Neither does it support 8."
6532 echo "It does not support 2..."
6533 if $cc $ccflags -c -DTRY=13 try.c >/dev/null 2>&1; then
6535 echo "But it supports 4 and 8."
6537 if $cc $ccflags -c -DTRY=5 try.c >/dev/null 2>&1; then
6539 echo "And it supports 4 but has not heard about 8."
6541 echo "However it supports 8 but not 4."
6546 echo "There is no support at all for void."
6551 case "$voidflags" in
6554 Support flag bits are:
6555 1: basic void declarations.
6556 2: arrays of pointers to functions returning void.
6557 4: operations between pointers to and addresses of void functions.
6558 8: generic void pointers.
6561 rp="Your void support flags add up to what?"
6568 : check for length of pointer
6572 echo "Checking to see how big your pointers are..." >&4
6573 if test "$voidflags" -gt 7; then
6574 echo '#define VOID_PTR char *' > try.c
6576 echo '#define VOID_PTR void *' > try.c
6586 printf("%d\n", (int)sizeof(VOID_PTR));
6591 if eval $compile_ok; then
6592 ptrsize=`$run ./try`
6593 echo "Your pointers are $ptrsize bytes long."
6596 echo "(I can't seem to compile the test program. Guessing...)" >&4
6597 rp="What is the size of a pointer (in bytes)?"
6604 case "$use64bitall" in
6605 "$define"|true|[yY]*)
6609 *** You have chosen a maximally 64-bit build,
6610 *** but your pointers are only 4 bytes wide.
6611 *** Please rerun Configure without -Duse64bitall.
6616 *** Since you have quads, you could possibly try with -Duse64bitint.
6621 *** Cannot continue, aborting.
6632 : determine whether to use malloc wrapping
6634 case "$usemallocwrap" in
6635 [yY]*|true|$define) dflt='y' ;;
6636 [nN]*|false|$undef) dflt='n' ;;
6637 *) case "$usedevel" in
6638 [yY]*|true|$define) dflt='y' ;;
6643 rp="Do you wish to wrap malloc calls to protect against potential overflows?"
6645 usemallocwrap="$ans"
6648 usemallocwrap="$define" ;;
6650 usemallocwrap="$undef" ;;
6653 : determine which malloc to compile in
6655 case "$usemymalloc" in
6656 [yY]*|true|$define) dflt='y' ;;
6657 [nN]*|false|$undef) dflt='n' ;;
6658 *) case "$ptrsize" in
6664 rp="Do you wish to attempt to use the malloc that comes with $package?"
6670 mallocsrc='malloc.c'
6671 mallocobj="malloc$_o"
6672 d_mymalloc="$define"
6675 : Remove malloc from list of libraries to use
6676 echo "Removing unneeded -lmalloc from library list" >&4
6677 set `echo X $libs | $sed -e 's/-lmalloc / /' -e 's/-lmalloc$//'`
6680 echo "libs = $libs" >&4
6692 : compute the return types of malloc and free
6694 $cat >malloc.c <<END
6698 #include <sys/types.h>
6712 case "$malloctype" in
6714 if $cc $ccflags -c -DTRY_MALLOC malloc.c >/dev/null 2>&1; then
6721 echo "Your system wants malloc to return '$malloctype', it would seem." >&4
6725 if $cc $ccflags -c -DTRY_FREE malloc.c >/dev/null 2>&1; then
6732 echo "Your system uses $freetype free(), it would seem." >&4
6734 : determine where site specific architecture-dependent libraries go.
6735 : sitelib default is /usr/local/lib/perl5/site_perl/$version
6736 : sitearch default is /usr/local/lib/perl5/site_perl/$version/$archname
6737 : sitelib may have an optional trailing /share.
6739 '') dflt=`echo $sitelib | $sed 's,/share$,,'`
6740 dflt="$dflt/$archname"
6745 set sitearch sitearch none
6749 The installation process will also create a directory for
6750 architecture-dependent site-specific extensions and modules.
6754 rp='Pathname for the site-specific architecture-dependent library files?'
6758 if $test X"$sitearch" = X"$sitelib"; then
6761 d_sitearch="$define"
6766 The installation process will also create a directory for
6767 vendor-supplied add-ons. Vendors who supply perl with their system
6768 may find it convenient to place all vendor-supplied files in this
6769 directory rather than in the main distribution directory. This will
6770 ease upgrades between binary-compatible maintenance versions of perl.
6772 Of course you may also use these directories in whatever way you see
6773 fit. For example, you might use them to access modules shared over a
6774 company-wide network.
6776 The default answer should be fine for most people.
6777 This causes further questions about vendor add-ons to be skipped
6778 and no vendor-specific directories will be configured for perl.
6781 rp='Do you want to configure vendor-specific add-on directories?'
6782 case "$usevendorprefix" in
6783 define|true|[yY]*) dflt=y ;;
6784 *) : User may have set vendorprefix directly on Configure command line.
6785 case "$vendorprefix" in
6794 rp='Installation prefix to use for vendor-supplied add-ons?'
6795 case "$vendorprefix" in
6797 *) dflt=$vendorprefix ;;
6800 : XXX Prefixit unit does not yet support siteprefix and vendorprefix
6802 case "$vendorprefix" in
6806 *) oldvendorprefix="$prefix";;
6810 usevendorprefix="$define"
6812 vendorprefixexp="$ansexp"
6814 *) usevendorprefix="$undef"
6820 case "$vendorprefix" in
6821 '') d_vendorlib="$undef"
6825 *) d_vendorlib="$define"
6826 : determine where vendor-supplied modules go.
6827 : Usual default is /usr/local/lib/perl5/vendor_perl/$version
6828 case "$vendorlib" in
6830 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
6831 case "$installstyle" in
6832 *lib/perl5*) dflt=$vendorprefix/lib/$package/vendor_$prog/$version ;;
6833 *) dflt=$vendorprefix/lib/vendor_$prog/$version ;;
6836 *) dflt="$vendorlib"
6840 rp='Pathname for the vendor-supplied library files?'
6843 vendorlibexp="$ansexp"
6846 vendorlib_stem=`echo "$vendorlibexp" | sed "s,/$version$,,"`
6850 case "$vendorprefix" in
6851 '') d_vendorarch="$undef"
6855 *) d_vendorarch="$define"
6856 : determine where vendor-supplied architecture-dependent libraries go.
6857 : vendorlib default is /usr/local/lib/perl5/vendor_perl/$version
6858 : vendorarch default is /usr/local/lib/perl5/vendor_perl/$version/$archname
6859 : vendorlib may have an optional trailing /share.
6860 case "$vendorarch" in
6861 '') dflt=`echo $vendorlib | $sed 's,/share$,,'`
6862 dflt="$dflt/$archname"
6864 *) dflt="$vendorarch" ;;
6867 rp='Pathname for vendor-supplied architecture-dependent files?'
6870 vendorarchexp="$ansexp"
6873 prefixvar=vendorarch
6876 : Final catch-all directories to search
6879 Lastly, you can have perl look in other directories for extensions and
6880 modules in addition to those already specified.
6881 These directories will be searched after
6885 test X"$vendorlib" != "X" && echo ' ' $vendorlib
6886 test X"$vendorarch" != "X" && echo ' ' $vendorarch
6888 case "$otherlibdirs" in
6889 ''|' ') dflt='none' ;;
6890 *) dflt="$otherlibdirs" ;;
6893 Enter a colon-separated set of extra paths to include in perl's @INC
6894 search path, or enter 'none' for no extra paths.
6898 rp='Colon-separated list of additional directories for perl to search?'
6901 ' '|''|none) otherlibdirs=' ' ;;
6902 *) otherlibdirs="$ans" ;;
6904 case "$otherlibdirs" in
6908 set d_perl_otherlibdirs
6911 : Cruising for prototypes
6913 echo "Checking out function prototypes..." >&4
6914 $cat >prototype.c <<EOCP
6919 int main(int argc, char *argv[]) {
6922 if $cc $ccflags -c prototype.c >prototype.out 2>&1 ; then
6923 echo "Your C compiler appears to support function prototypes."
6926 echo "Your C compiler doesn't seem to understand function prototypes."
6933 case "$prototype" in
6935 *) ansi2knr='ansi2knr'
6940 This version of $package can only be compiled by a compiler that
6941 understands function prototypes. Unfortunately, your C compiler
6943 doesn't seem to understand them. Sorry about that.
6945 If GNU cc is available for your system, perhaps you could try that instead.
6947 Eventually, we hope to support building Perl with pre-ANSI compilers.
6948 If you would like to help in that effort, please contact <perlbug@perl.org>.
6950 Aborting Configure now.
6962 Perl can be built with extra modules or bundles of modules which
6963 will be fetched from the CPAN and installed alongside Perl.
6965 Notice that you will need access to the CPAN; either via the Internet,
6966 or a local copy, for example a CD-ROM or a local CPAN mirror. (You will
6967 be asked later to configure the CPAN.pm module which will in turn do
6968 the installation of the rest of the extra modules or bundles.)
6970 Notice also that if the modules require any external software such as
6971 libraries and headers (the libz library and the zlib.h header for the
6972 Compress::Zlib module, for example) you MUST have any such software
6973 already installed, this configuration process will NOT install such
6976 If this doesn't make any sense to you, just accept the default '$dflt'.
6978 rp='Install any extra modules (y or n)?'
6984 Please list any extra modules or bundles to be installed from CPAN,
6985 with spaces between the names. The names can be in any format the
6986 'install' command of CPAN.pm will understand. (Answer 'none',
6987 without the quotes, to install no extra modules or bundles.)
6997 $rm -f ../extras.lst
6999 *) echo "(Saving the list of extras for later...)"
7000 echo "$extras" > ../extras.lst
7008 : determine where html pages for programs go
7009 set html1dir html1dir none
7013 If you wish to install html files for programs in $spackage, indicate
7014 the appropriate directory here. To skip installing html files,
7018 ''|none|$undef|' ') dflt=none ;;
7019 *) dflt=$html1dir ;;
7022 rp="Directory for the main $spackage html pages?"
7026 : Use ' ' for none so value is preserved next time through Configure
7027 $test X"$html1dir" = "X" && html1dir=' '
7029 : determine where html pages for libraries and modules go
7030 set html3dir html3dir none
7034 If you wish to install html files for modules associated with $spackage,
7035 indicate the appropriate directory here. To skip installing html files,
7038 : There is no obvious default. If they have specified html1dir, then
7039 : try to key off that, possibly changing .../html1 into .../html3.
7041 '') html3dir=`echo "$html1dir" | $sed 's/1$/3$/'` ;;
7042 *) dflt=$html3dir ;;
7045 rp="Directory for the $spackage module html pages?"
7049 : Use ' ' for none so value is preserved next time through Configure
7050 $test X"$html3dir" = "X" && html3dir=' '
7052 : determine whether to install perl also as /usr/bin/perl
7055 if $test -d /usr/bin -a "X$installbin" != X/usr/bin; then
7057 Many scripts expect perl to be installed as /usr/bin/perl.
7059 If you want to, I can install the perl you are about to compile
7060 as /usr/bin/perl (in addition to $bin/perl).
7062 if test -f /usr/bin/perl; then
7065 However, please note that because you already have a /usr/bin/perl,
7066 overwriting that with a new Perl would very probably cause problems.
7067 Therefore I'm assuming you don't want to do that (unless you insist).
7070 case "$installusrbinperl" in
7071 "$define"|[yY]*) dflt='y';;
7077 Since you don't have a /usr/bin/perl I'm assuming creating one is okay.
7080 case "$installusrbinperl" in
7081 "$undef"|[nN]*) dflt='n';;
7085 rp="Do you want to install perl as /usr/bin/perl?"
7088 [yY]*) val="$define";;
7094 set installusrbinperl
7098 echo "Checking for GNU C Library..." >&4
7100 /* Find out version of GNU C library. __GLIBC__ and __GLIBC_MINOR__
7101 alone are insufficient to distinguish different versions, such as
7102 2.0.6 and 2.0.7. The function gnu_get_libc_version() appeared in
7103 libc version 2.1.0. A. Dougherty, June 3, 2002.
7109 # ifdef __GLIBC_MINOR__
7110 # if __GLIBC__ >= 2 && __GLIBC_MINOR__ >= 1 && !defined(__cplusplus)
7111 # include <gnu/libc-version.h>
7112 printf("%s\n", gnu_get_libc_version());
7114 printf("%d.%d\n", __GLIBC__, __GLIBC_MINOR__);
7117 printf("%d\n", __GLIBC__);
7126 if eval $compile_ok && $run ./try > glibc.ver; then
7128 gnulibc_version=`$cat glibc.ver`
7129 echo "You are using the GNU C Library version $gnulibc_version"
7133 echo "You are not using the GNU C Library"
7135 $rm -f try try.* glibc.ver
7139 : see if nm is to be used to determine whether a symbol is defined or not
7143 case "$d_gnulibc" in
7146 echo "nm probably won't work on the GNU C Library." >&4
7152 if $test "$osname" = aix -a "X$PASE" != "Xdefine" -a ! -f /lib/syscalls.exp; then
7154 echo "Whoops! This is an AIX system without /lib/syscalls.exp!" >&4
7155 echo "'nm' won't be sufficient on this sytem." >&4
7161 '') dflt=`$egrep 'inlibc|csym' $rsrc/Configure | wc -l 2>/dev/null`
7162 if $test $dflt -gt 20; then
7172 true|$define) dflt=y;;
7179 I can use $nm to extract the symbols from your C libraries. This
7180 is a time consuming task which may generate huge output on the disk (up
7181 to 3 megabytes) but that should make the symbols extraction faster. The
7182 alternative is to skip the 'nm' extraction part and to compile a small
7183 test program instead to determine whether each symbol is present. If
7184 you have a fast C compiler and/or if your 'nm' output cannot be parsed,
7185 this may be the best solution.
7187 You probably shouldn't let me use 'nm' if you are using the GNU C Library.
7190 rp="Shall I use $nm to extract C symbols from the libraries?"
7193 [Nn]*) usenm=false;;
7202 : nm options which may be necessary
7204 '') if $test -f /mach_boot; then
7206 elif $test -d /usr/ccs/lib; then
7207 nm_opt='-p' # Solaris (and SunOS?)
7208 elif $test -f /dgux; then
7210 elif $test -f /lib64/rld; then
7211 nm_opt='-p' # 64-bit Irix
7217 : nm options which may be necessary for shared libraries but illegal
7218 : for archive libraries. Thank you, Linux.
7219 case "$nm_so_opt" in
7220 '') case "$myuname" in
7222 if $nm --help | $grep 'dynamic' > /dev/null 2>&1; then
7223 nm_so_opt='--dynamic'
7232 : get list of predefined functions in a handy place
7237 *-lc_s*) libc=`./loc libc_s$_a $libc $libpth`
7243 *) for thislib in $libs; do
7246 : Handle C library specially below.
7249 thislib=`echo $thislib | $sed -e 's/^-l//'`
7250 if try=`./loc lib$thislib.$so.'*' X $libpth`; $test -f "$try"; then
7252 elif try=`./loc lib$thislib.$so X $libpth`; $test -f "$try"; then
7254 elif try=`./loc lib$thislib$_a X $libpth`; $test -f "$try"; then
7256 elif try=`./loc $thislib$_a X $libpth`; $test -f "$try"; then
7258 elif try=`./loc lib$thislib X $libpth`; $test -f "$try"; then
7260 elif try=`./loc $thislib X $libpth`; $test -f "$try"; then
7262 elif try=`./loc Slib$thislib$_a X $xlibpth`; $test -f "$try"; then
7267 libnames="$libnames $try"
7269 *) libnames="$libnames $thislib" ;;
7278 for xxx in $libpth; do
7279 $test -r $1 || set $xxx/libc.$so
7280 : The messy sed command sorts on library version numbers.
7282 set `echo blurfl; echo $xxx/libc.$so.[0-9]* | \
7283 tr ' ' $trnl | egrep -v '\.[A-Za-z]*$' | $sed -e '
7285 s/[0-9][0-9]*/0000&/g
7286 s/0*\([0-9][0-9][0-9][0-9][0-9]\)/\1/g
7289 $sort | $sed -e 's/^.* //'`
7292 $test -r $1 || set /usr/ccs/lib/libc.$so
7293 $test -r $1 || set /lib/libsys_s$_a
7299 if $test -r "$1"; then
7300 echo "Your (shared) C library seems to be in $1."
7302 elif $test -r /lib/libc && $test -r /lib/clib; then
7303 echo "Your C library seems to be in both /lib/clib and /lib/libc."
7305 libc='/lib/clib /lib/libc'
7306 if $test -r /lib/syslib; then
7307 echo "(Your math library is in /lib/syslib.)"
7308 libc="$libc /lib/syslib"
7310 elif $test -r "$libc" || (test -h "$libc") >/dev/null 2>&1; then
7311 echo "Your C library seems to be in $libc, as you said before."
7312 elif $test -r $incpath/usr/lib/libc$_a; then
7313 libc=$incpath/usr/lib/libc$_a;
7314 echo "Your C library seems to be in $libc. That's fine."
7315 elif $test -r /lib/libc$_a; then
7317 echo "Your C library seems to be in $libc. You're normal."
7319 if tans=`./loc libc$_a blurfl/dyick $libpth`; $test -r "$tans"; then
7321 elif tans=`./loc libc blurfl/dyick $libpth`; $test -r "$tans"; then
7322 libnames="$libnames "`./loc clib blurfl/dyick $libpth`
7323 elif tans=`./loc clib blurfl/dyick $libpth`; $test -r "$tans"; then
7325 elif tans=`./loc Slibc$_a blurfl/dyick $xlibpth`; $test -r "$tans"; then
7327 elif tans=`./loc Mlibc$_a blurfl/dyick $xlibpth`; $test -r "$tans"; then
7330 tans=`./loc Llibc$_a blurfl/dyick $xlibpth`
7332 if $test -r "$tans"; then
7333 echo "Your C library seems to be in $tans, of all places."
7339 if $test $xxx = apollo -o -r "$libc" || (test -h "$libc") >/dev/null 2>&1; then
7343 If the guess above is wrong (which it might be if you're using a strange
7344 compiler, or your machine supports multiple models), you can override it here.
7349 echo $libpth | $tr ' ' $trnl | $sort | $uniq > libpath
7351 I can't seem to find your C library. I've looked in the following places:
7354 $sed 's/^/ /' libpath
7357 None of these seems to contain your C library. I need to get its name...
7362 rp='Where is your C library?'
7367 echo $libc $libnames | $tr ' ' $trnl | $sort | $uniq > libnames
7368 set X `cat libnames`
7371 case $# in 1) xxx=file; esac
7372 echo "Extracting names from the following $xxx for later perusal:" >&4
7374 $sed 's/^/ /' libnames >&4
7376 $echo $n "This may take a while...$c" >&4
7380 *$so*) $nm $nm_so_opt $nm_opt $file 2>/dev/null;;
7381 *) $nm $nm_opt $file 2>/dev/null;;
7386 $grep fprintf libc.tmp > libc.ptf
7387 xscan='eval "<libc.ptf $com >libc.list"; $echo $n ".$c" >&4'
7388 xrun='eval "<libc.tmp $com >libc.list"; echo "done." >&4'
7390 if com="$sed -n -e 's/__IO//' -e 's/^.* $xxx *//p'";\
7392 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7394 elif com="$sed -n -e 's/^__*//' -e 's/^\([a-zA-Z_0-9$]*\).*xtern.*/\1/p'";\
7396 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7398 elif com="$sed -n -e '/|UNDEF/d' -e '/FUNC..GL/s/^.*|__*//p'";\
7400 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7402 elif com="$sed -n -e 's/^.* D __*//p' -e 's/^.* D //p'";\
7404 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7406 elif com="$sed -n -e 's/^_//' -e 's/^\([a-zA-Z_0-9]*\).*xtern.*text.*/\1/p'";\
7408 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7410 elif com="$sed -n -e 's/^.*|FUNC |GLOB .*|//p'";\
7412 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7414 elif com="$grep '|' | $sed -n -e '/|COMMON/d' -e '/|DATA/d' \
7415 -e '/ file/d' -e 's/^\([^ ]*\).*/\1/p'";\
7417 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7419 elif com="$sed -n -e 's/^.*|FUNC |GLOB .*|//p' -e 's/^.*|FUNC |WEAK .*|//p'";\
7421 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7423 elif com="$sed -n -e 's/^__//' -e '/|Undef/d' -e '/|Proc/s/ .*//p'";\
7425 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7427 elif com="$sed -n -e 's/^.*|Proc .*|Text *| *//p'";\
7429 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7431 elif com="$sed -n -e '/Def. Text/s/.* \([^ ]*\)\$/\1/p'";\
7433 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7435 elif com="$sed -n -e 's/^[-0-9a-f ]*_\(.*\)=.*/\1/p'";\
7437 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7439 elif com="$sed -n -e 's/.*\.text n\ \ \ \.//p'";\
7441 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7443 elif com="sed -n -e 's/^__.*//' -e 's/[ ]*D[ ]*[0-9]*.*//p'";\
7445 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7448 $nm -p $* 2>/dev/null >libc.tmp
7449 $grep fprintf libc.tmp > libc.ptf
7450 if com="$sed -n -e 's/^.* [ADTSIW] *_[_.]*//p' -e 's/^.* [ADTSIW] //p'";\
7451 eval $xscan; $contains '^fprintf$' libc.list >/dev/null 2>&1
7457 echo "$nm didn't seem to work right. Trying $ar instead..." >&4
7459 if $ar t $libc > libc.tmp && $contains '^fprintf$' libc.tmp >/dev/null 2>&1; then
7460 for thisname in $libnames $libc; do
7461 $ar t $thisname >>libc.tmp
7463 $sed -e "s/\\$_o\$//" < libc.tmp > libc.list
7465 elif test "X$osname" = "Xos2" && $ar tv $libc > libc.tmp; then
7466 # Repeat libc to extract forwarders to DLL entries too
7467 for thisname in $libnames $libc; do
7468 $ar tv $thisname >>libc.tmp
7469 # Revision 50 of EMX has bug in $ar.
7470 # it will not extract forwarders to DLL entries
7471 # Use emximp which will extract exactly them.
7472 emximp -o tmp.imp $thisname \
7474 $sed -e 's/^\([_a-zA-Z0-9]*\) .*$/\1/p' \
7475 < tmp.imp >>libc.tmp
7478 $sed -e "s/\\$_o\$//" -e 's/^ \+//' < libc.tmp > libc.list
7481 echo "$ar didn't seem to work right." >&4
7482 echo "Maybe this is a Cray...trying bld instead..." >&4
7483 if bld t $libc | $sed -e 's/.*\///' -e "s/\\$_o:.*\$//" > libc.list
7485 for thisname in $libnames; do
7487 $sed -e 's/.*\///' -e "s/\\$_o:.*\$//" >>libc.list
7488 $ar t $thisname >>libc.tmp
7492 echo "That didn't work either. Giving up." >&4
7502 echo "Since you are compiling for PASE, extracting more symbols from libc.a ...">&4
7503 dump -Tv /lib/libc.a | awk '$7 == "/unix" {print $5 " " $8}' | grep "^SV" | awk '{print $2}' >> libc.list
7505 *) if $test -f /lib/syscalls.exp; then
7507 echo "Also extracting names from /lib/syscalls.exp for good ole AIX..." >&4
7508 $sed -n 's/^\([^ ]*\)[ ]*syscall[0-9]*[ ]*$/\1/p' /lib/syscalls.exp >>libc.list
7514 $rm -f libnames libpath
7516 : see if dld is available
7520 : is a C symbol defined?
7523 -v) tf=libc.tmp; tdc="";;
7524 -a) tf=libc.tmp; tdc="[]";;
7525 *) tlook="^$1\$"; tf=libc.list; tdc="()";;
7528 case "$reuseval-$4" in
7530 true-*) tx=no; eval "tval=\$$4"; case "$tval" in "") tx=yes;; esac;;
7535 if $test "$runnm" = true; then
7536 if $contains $tlook $tf >/dev/null 2>&1; then
7538 elif $test "$mistrustnm" = compile -o "$mistrustnm" = run; then
7539 echo "void *(*(p()))$tdc { extern void *$1$tdc; return &$1; } int main() { if(p()) return(0); else return(1); }"> try.c;
7540 $cc -o try $optimize $ccflags $ldflags try.c >/dev/null 2>&1 $libs && tval=true;
7541 $test "$mistrustnm" = run -a -x try && { $run ./try$_exe >/dev/null 2>&1 || tval=false; };
7542 $rm -f try$_exe try.c core core.* try.core;
7545 echo "void *(*(p()))$tdc { extern void *$1$tdc; return &$1; } int main() { if(p()) return(0); else return(1); }"> try.c;
7546 $cc -o try $optimize $ccflags $ldflags try.c $libs >/dev/null 2>&1 && tval=true;
7547 $rm -f try$_exe try.c;
7552 $define) tval=true;;
7559 : define an is-in-libc? function
7560 inlibc='echo " "; td=$define; tu=$undef;
7561 sym=$1; var=$2; eval "was=\$$2";
7563 case "$reuseval$was" in
7573 echo "$sym() found." >&4;
7574 case "$was" in $undef) . ./whoa; esac; eval "$var=\$td";;
7576 echo "$sym() NOT found." >&4;
7577 case "$was" in $define) . ./whoa; esac; eval "$var=\$tu";;
7581 $define) echo "$sym() found." >&4;;
7582 *) echo "$sym() NOT found." >&4;;
7586 : see if dlopen exists
7593 : see if this is a unistd.h system
7594 set unistd.h i_unistd
7597 : determine which dynamic loading, if any, to compile in
7599 dldir="ext/DynaLoader"
7612 $define) dflt='y' ;;
7615 $define) dflt='y' ;;
7617 : Does a dl_xxx.xs file exist for this operating system
7618 $test -f $rsrc/$dldir/dl_${osname}.xs && dflt='y'
7621 rp="Do you wish to use dynamic loading?"
7628 if $test -f $rsrc/$dldir/dl_${osname}.xs ; then
7629 dflt="$dldir/dl_${osname}.xs"
7630 elif $test "$d_dlopen" = "$define" ; then
7631 dflt="$dldir/dl_dlopen.xs"
7632 elif $test "$i_dld" = "$define" ; then
7633 dflt="$dldir/dl_dld.xs"
7638 *) dflt="$dldir/$dlsrc"
7641 echo "The following dynamic loading files are available:"
7642 : Can not go over to $dldir because getfile has path hard-coded in.
7643 tdir=`pwd`; cd "$rsrc"; $ls -C $dldir/dl*.xs; cd "$tdir"
7644 rp="Source file to use for dynamic loading"
7650 dlsrc=`echo $ans | $sed -e 's%.*/\([^/]*\)$%\1%'`
7654 Some systems may require passing special flags to $cc -c to
7655 compile modules that will be used to create a shared library.
7656 To use no flags, say "none".
7659 case "$cccdlflags" in
7660 '') case "$gccversion" in
7661 '') case "$osname" in
7663 next) dflt='none' ;;
7664 irix*) dflt='-KPIC' ;;
7665 svr4*|esix*|solaris|nonstopux) dflt='-KPIC' ;;
7666 sunos) dflt='-pic' ;;
7670 *) case "$osname" in
7671 darwin) dflt='none' ;;
7672 svr4*|esix*|solaris|nonstopux) dflt='-fPIC' ;;
7677 *) dflt="$cccdlflags" ;;
7679 rp="Any special flags to pass to $cc -c to compile shared library modules?"
7682 none) cccdlflags=' ' ;;
7683 *) cccdlflags="$ans" ;;
7688 Some systems use ld to create libraries that can be dynamically loaded,
7689 while other systems (such as those using ELF) use $cc.
7693 '') $cat >try.c <<EOM
7694 /* Test for whether ELF binaries are produced */
7706 int i = open("a.out",O_RDONLY);
7709 if(read(i,b,4)==4 && b[0]==127 && b[1]=='E' && b[2]=='L' && b[3]=='F')
7710 exit(0); /* succeed (yes, it's ELF) */
7715 if $cc $ccflags $ldflags try.c >/dev/null 2>&1 && $run ./a.out; then
7717 You appear to have ELF support. I'll use $cc to build dynamic libraries.
7721 echo "I'll use ld to build dynamic libraries."
7730 rp="What command should be used to create dynamic libraries?"
7736 Some systems may require passing special flags to $ld to create a
7737 library that can be dynamically loaded. If your ld flags include
7738 -L/other/path options to locate libraries outside your loader's normal
7739 search path, you may need to specify those -L options here as well. To
7740 use no flags, say "none".
7743 case "$lddlflags" in
7744 '') case "$osname" in
7745 beos) dflt='-nostart' ;;
7747 case "$gccversion" in
7748 '') dflt="$dflt +vnocompatwarnings" ;;
7751 linux|irix*|gnu*) dflt='-shared' ;;
7752 next) dflt='none' ;;
7753 solaris) dflt='-G' ;;
7754 sunos) dflt='-assert nodefinitions' ;;
7755 svr4*|esix*|nonstopux) dflt="-G $ldflags" ;;
7759 *) dflt="$lddlflags" ;;
7762 : Try to guess additional flags to pick up local libraries.
7763 : Be careful not to append to a plain 'none'
7767 for thisflag in $ldflags; do
7772 *) dflt="$dflt $thisflag" ;;
7779 ''|' ') dflt='none' ;;
7782 rp="Any special flags to pass to $ld to create a dynamically loaded library?"
7785 none) lddlflags=' ' ;;
7786 *) lddlflags="$ans" ;;
7791 Some systems may require passing special flags to $cc to indicate that
7792 the resulting executable will use dynamic linking. To use no flags,
7796 case "$ccdlflags" in
7797 '') case "$osname" in
7798 linux|hpux|gnu*) dflt='-Wl,-E' ;;
7799 next|sunos) dflt='none' ;;
7803 *) dflt="$ccdlflags" ;;
7805 rp="Any special flags to pass to $cc to use dynamic linking?"
7808 none) ccdlflags=' ' ;;
7809 *) ccdlflags="$ans" ;;
7823 # No dynamic loading being used, so don't bother even to prompt.
7826 *) case "$useshrplib" in
7827 '') case "$osname" in
7828 svr4*|nonstopux|dgux|dynixptx|esix|powerux|beos|cygwin*)
7830 also='Building a shared libperl is required for dynamic loading to work on your system.'
7835 also='Building a shared libperl is needed for MAB support.'
7853 The perl executable is normally obtained by linking perlmain.c with
7854 libperl${_a}, any static extensions (usually just DynaLoader), and
7855 any other libraries needed on this system (such as -lm, etc.). Since
7856 your system supports dynamic loading, it is probably possible to build
7857 a shared libperl.$so. If you will have more than one executable linked
7858 to libperl.$so, this will significantly reduce the size of each
7859 executable, but it may have a noticeable effect on performance. The
7860 default is probably sensible for your system.
7864 rp="Build a shared libperl.$so (y/n)"
7868 useshrplib='true' ;;
7869 *) useshrplib='false' ;;
7874 case "$useshrplib" in
7878 # Figure out a good name for libperl.so. Since it gets stored in
7879 # a version-specific architecture-dependent library, the version
7880 # number isn't really that important, except for making cc/ld happy.
7882 # A name such as libperl.so.3.1
7883 majmin="libperl.$so.$patchlevel.$subversion"
7884 # A name such as libperl.so.301
7885 majonly=`echo $patchlevel $subversion |
7886 $awk '{printf "%d%02d", $1, $2}'`
7887 majonly=libperl.$so.$majonly
7888 # I'd prefer to keep the os-specific stuff here to a minimum, and
7889 # rely on figuring it out from the naming of libc.
7890 case "${osname}${osvers}" in
7893 # XXX How handle the --version stuff for MAB?
7895 linux*|gnu*) # ld won't link with a bare -lperl otherwise.
7898 cygwin*) # ld links against an importlib
7899 dflt=libperl$lib_ext
7901 *) # Try to guess based on whether libc has major.minor.
7903 *libc.$so.[0-9]*.[0-9]*) dflt=$majmin ;;
7904 *libc.$so.[0-9]*) dflt=$majonly ;;
7905 *) dflt=libperl.$so ;;
7915 I need to select a good name for the shared libperl. If your system uses
7916 library names with major and minor numbers, then you might want something
7917 like $majmin. Alternatively, if your system uses a single version
7918 number for shared libraries, then you might want to use $majonly.
7919 Or, your system might be quite happy with a simple libperl.$so.
7921 Since the shared libperl will get installed into a version-specific
7922 architecture-dependent directory, the version number of the shared perl
7923 library probably isn't important, so the default should be o.k.
7926 rp='What name do you want to give to the shared libperl?'
7929 echo "Ok, I'll use $libperl"
7932 libperl="libperl${_a}"
7936 # Detect old use of shrpdir via undocumented Configure -Dshrpdir
7940 WARNING: Use of the shrpdir variable for the installation location of
7941 the shared $libperl is not supported. It was never documented and
7942 will not work in this version. Let me (perlbug@perl.org)
7943 know of any problems this may cause.
7949 But your current setting of $shrpdir is
7950 the default anyway, so it's harmless.
7955 Further, your current attempted setting of $shrpdir
7956 conflicts with the value of $archlibexp/CORE
7957 that installperl will use.
7964 # How will the perl executable find the installed shared $libperl?
7965 # Add $xxx to ccdlflags.
7966 # If we can't figure out a command-line option, use $shrpenv to
7967 # set env LD_RUN_PATH. The main perl makefile uses this.
7968 shrpdir=$archlibexp/CORE
7971 if "$useshrplib"; then
7974 # We'll set it in Makefile.SH...
7979 freebsd|netbsd|openbsd|interix|dragonfly)
7980 xxx="-Wl,-R$shrpdir"
7982 bsdos|linux|irix*|dec_osf|gnu*)
7983 xxx="-Wl,-rpath,$shrpdir"
7986 # next doesn't like the default...
7989 # beos doesn't like the default, either.
7992 # hpux doesn't like the default, either.
7993 tmp_shrpenv="env LDOPTS=\"+s +b${shrpdir}\""
7996 tmp_shrpenv="env LD_RUN_PATH=$shrpdir"
8002 # Only add $xxx if it isn't already in ccdlflags.
8003 case " $ccdlflags " in
8005 *) ccdlflags="$ccdlflags $xxx"
8008 Adding $xxx to the flags
8009 passed to $ld so that the perl executable will find the
8010 installed shared $libperl.
8018 # Fix ccdlflags in AIX for building external extensions.
8019 # (For building Perl itself bare -bE:perl.exp is needed,
8020 # Makefile.SH takes care of this.)
8022 aix) ccdlflags="$ccdlflags -bE:$installarchlib/CORE/perl.exp" ;;
8024 # Respect a hint or command-line value.
8026 '') shrpenv="$tmp_shrpenv" ;;
8028 case "$ldlibpthname" in
8029 '') ldlibpthname=LD_LIBRARY_PATH ;;
8030 none) ldlibpthname='' ;;
8033 : determine where manual pages are on this system
8037 syspath='/usr/share/man/man1 /usr/man/man1'
8038 syspath="$syspath /usr/man/mann /usr/man/manl /usr/man/local/man1"
8039 syspath="$syspath /usr/man/u_man/man1"
8040 syspath="$syspath /usr/catman/u_man/man1 /usr/man/l_man/man1"
8041 syspath="$syspath /usr/local/man/u_man/man1 /usr/local/man/l_man/man1"
8042 syspath="$syspath /usr/man/man.L /local/man/man1 /usr/local/man/man1"
8043 sysman=`./loc . /usr/man/man1 $syspath`
8046 if $test -d "$sysman"; then
8047 echo "System manual is in $sysman." >&4
8049 echo "Could not find manual pages in source form." >&4
8052 : determine where manual pages go
8053 set man1dir man1dir none
8057 $spackage has manual pages available in source form.
8061 echo "However, you don't have nroff, so they're probably useless to you."
8063 '') man1dir="none";;
8066 echo "If you don't want the manual sources installed, answer 'none'."
8071 lookpath="$prefixexp/share/man/man1"
8072 lookpath="$lookpath $prefixexp/man/man1 $prefixexp/man/l_man/man1"
8073 lookpath="$lookpath $prefixexp/man/p_man/man1"
8074 lookpath="$lookpath $prefixexp/man/u_man/man1"
8075 lookpath="$lookpath $prefixexp/man/man.1"
8077 */?_man*) dflt=`./loc . $prefixexp/l_man/man1 $lookpath` ;;
8078 *) dflt=`./loc . $prefixexp/man/man1 $lookpath` ;;
8088 rp="Where do the main $spackage manual pages (source) go?"
8090 if $test "X$man1direxp" != "X$ansexp"; then
8101 : What suffix to use on installed man pages
8108 rp="What suffix should be used for the main $spackage man pages?"
8110 '') case "$man1dir" in
8124 *) dflt="$man1ext";;
8131 : see if we can have long filenames
8133 first=123456789abcdef
8135 if (echo hi >$first) 2>/dev/null; then
8136 if $test -f 123456789abcde; then
8137 echo 'You cannot have filenames longer than 14 characters. Sigh.' >&4
8140 echo 'You can have filenames longer than 14 characters.'>&4
8145 You can't have filenames longer than 14 chars.
8146 You can't even think about them!
8152 $rm -rf 123456789abcde*
8154 : determine where library module manual pages go
8155 set man3dir man3dir none
8159 $spackage has manual pages for many of the library modules.
8165 However, you don't have nroff, so they're probably useless to you.
8168 '') man3dir="none";;
8172 case "$d_flexfnam" in
8175 However, your system can't handle the long file names like File::Basename.3.
8178 '') man3dir="none";;
8182 echo "If you don't want the manual sources installed, answer 'none'."
8183 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
8185 '') dflt=`echo "$man1dir" | $sed -e 's/man1/man3/g' -e 's/man\.1/man\.3/g'`
8186 if $test -d "$privlib/man/man3"; then
8189 WARNING: Previous versions of perl installed man3 pages into
8190 $privlib/man/man3. This version will suggest a
8191 new default of $dflt.
8195 rp='Do you wish to preserve the old behavior?(y/n)'
8198 y*) dflt="$privlib/man/man3" ;;
8203 *) dflt="$man3dir" ;;
8210 rp="Where do the $package library man pages (source) go?"
8220 : What suffix to use on installed man pages
8226 rp="What suffix should be used for the $package library man pages?"
8228 '') case "$man3dir" in
8242 *) dflt="$man3ext";;
8249 : see if we have to deal with yellow pages, now NIS.
8250 if $test -d /usr/etc/yp || $test -d /etc/yp || $test -d /usr/lib/yp; then
8251 if $test -f /usr/etc/nibindd; then
8253 echo "I'm fairly confident you're on a NeXT."
8255 rp='Do you get the hosts file via NetInfo?'
8264 y*) hostcat='nidump hosts .';;
8265 *) case "$hostcat" in
8266 nidump*) hostcat='';;
8276 '') if $contains '^\+' /etc/passwd >/dev/null 2>&1; then
8284 rp='Are you getting the hosts file via yellow pages?'
8287 y*) hostcat='ypcat hosts';;
8288 *) hostcat='cat /etc/hosts';;
8294 '') test -f /etc/hosts && hostcat='cat /etc/hosts';;
8297 '') test -f /etc/group && groupcat='cat /etc/group';;
8300 '') test -f /etc/passwd && passcat='cat /etc/passwd';;
8303 : now get the host name
8305 echo "Figuring out host name..." >&4
8306 case "$myhostname" in
8308 echo 'Maybe "hostname" will work...'
8309 if tans=`sh -c hostname 2>&1` ; then
8317 if $test "$cont"; then
8319 echo 'Oh, dear. Maybe "/etc/systemid" is the key...'
8320 if tans=`cat /etc/systemid 2>&1` ; then
8322 phostname='cat /etc/systemid'
8323 echo "Whadyaknow. Xenix always was a bit strange..."
8326 elif $test -r /etc/systemid; then
8327 echo "(What is a non-Xenix system doing with /etc/systemid?)"
8330 if $test "$cont"; then
8331 echo 'No, maybe "uuname -l" will work...'
8332 if tans=`sh -c 'uuname -l' 2>&1` ; then
8334 phostname='uuname -l'
8336 echo 'Strange. Maybe "uname -n" will work...'
8337 if tans=`sh -c 'uname -n' 2>&1` ; then
8339 phostname='uname -n'
8341 echo 'Oh well, maybe I can mine it out of whoami.h...'
8342 if tans=`sh -c $contains' sysname $usrinc/whoami.h' 2>&1` ; then
8343 myhostname=`echo "$tans" | $sed 's/^.*"\(.*\)"/\1/'`
8344 phostname="sed -n -e '"'/sysname/s/^.*\"\\(.*\\)\"/\1/{'"' -e p -e q -e '}' <$usrinc/whoami.h"
8346 case "$myhostname" in
8347 '') echo "Does this machine have an identity crisis or something?"
8350 echo "Well, you said $myhostname before..."
8351 phostname='echo $myhostname';;
8357 case "$myhostname" in
8358 '') myhostname=noname ;;
8360 : you do not want to know about this
8365 if $test "$myhostname" ; then
8367 rp='Your host name appears to be "'$myhostname'".'" Right?"
8375 : bad guess or no guess
8376 while $test "X$myhostname" = X ; do
8378 rp="Please type the (one word) name of your host:"
8383 : translate upper to lower if necessary
8384 case "$myhostname" in
8386 echo "(Normalizing case in your host name)"
8387 myhostname=`echo $myhostname | ./tr '[A-Z]' '[a-z]'`
8391 case "$myhostname" in
8393 dflt=`expr "X$myhostname" : "X[^.]*\(\..*\)"`
8394 myhostname=`expr "X$myhostname" : "X\([^.]*\)\."`
8395 echo "(Trimming domain name from host name--host name is now $myhostname)"
8397 *) case "$mydomain" in
8400 test "X$hostcat" = "Xypcat hosts" &&
8401 ypmatch "$myhostname" hosts 2>/dev/null |\
8402 $sed -e 's/[ ]*#.*//; s/$/ /' > hosts && \
8405 test "X$hostcat" != "X" &&
8406 $hostcat | $sed -n -e "s/[ ]*#.*//; s/\$/ /
8407 /[ ]$myhostname[ . ]/p" > hosts
8410 if $test -f hosts; then
8411 $test x`$awk "/[0-9].*[ ]$myhostname$tmp_re/ { sum++ }
8412 END { print sum }" hosts` = x1 || tmp_re="[ ]"
8413 dflt=.`$awk "/[0-9].*[ ]$myhostname$tmp_re/ {for(i=2; i<=NF;i++) print \\\$i}" \
8414 hosts | $sort | $uniq | \
8415 $sed -n -e "s/$myhostname\.\([-a-zA-Z0-9_.]\)/\1/p"`
8416 case `$echo X$dflt` in
8417 X*\ *) echo "(Several hosts in the database matched hostname)"
8420 X.) echo "(You do not have fully-qualified names in the hosts database)"
8424 echo "(I cannot locate a hosts database anywhere)"
8429 tans=`./loc resolv.conf X /etc /usr/etc`
8430 if $test -f "$tans"; then
8431 echo "(Attempting domain name extraction from $tans)"
8432 dflt=.`$sed -n -e 's/ / /g' \
8433 -e 's/^search *\([^ ]*\).*/\1/p' $tans \
8434 | ./tr '[A-Z]' '[a-z]' 2>/dev/null`
8436 .) dflt=.`$sed -n -e 's/ / /g' \
8437 -e 's/^domain *\([^ ]*\).*/\1/p' $tans \
8438 | ./tr '[A-Z]' '[a-z]' 2>/dev/null`
8445 .) echo "(No help from resolv.conf either -- attempting clever guess)"
8446 dflt=.`sh -c domainname 2>/dev/null`
8449 .nis.*|.yp.*|.main.*) dflt=`echo $dflt | $sed -e 's/^\.[^.]*//'`;;
8453 case "$dflt$osname" in
8454 .os390) echo "(Attempting domain name extraction from //'SYS1.TCPPARMS(TCPDATA)')"
8455 dflt=.`awk '/^DOMAINORIGIN/ {print $2}' "//'SYS1.TCPPARMS(TCPDATA)'" 2>/dev/null`
8459 .) echo "(Lost all hope -- silly guess then)"
8465 *) dflt="$mydomain";;
8469 rp="What is your domain name?"
8479 : translate upper to lower if necessary
8482 echo "(Normalizing case in your domain name)"
8483 mydomain=`echo $mydomain | ./tr '[A-Z]' '[a-z]'`
8487 : a little sanity check here
8488 case "$phostname" in
8491 case `$phostname | ./tr '[A-Z]' '[a-z]'` in
8492 $myhostname$mydomain|$myhostname) ;;
8494 case "$phostname" in
8496 echo "(That doesn't agree with your whoami.h file, by the way.)"
8499 echo "(That doesn't agree with your $phostname command, by the way.)"
8509 I need to get your e-mail address in Internet format if possible, i.e.
8510 something like user@host.domain. Please answer accurately since I have
8511 no easy means to double check it. The default value provided below
8512 is most probably close to reality but may not be valid from outside
8513 your organization...
8517 while test "$cont"; do
8519 '') dflt="$cf_by@$myhostname$mydomain";;
8520 *) dflt="$cf_email";;
8522 rp='What is your e-mail address?'
8528 rp='Address does not look like an Internet one. Use it anyway?'
8544 If you or somebody else will be maintaining perl at your site, please
8545 fill in the correct e-mail address here so that they may be contacted
8546 if necessary. Currently, the "perlbug" program included with perl
8547 will send mail to this address in addition to perlbug@perl.org. You may
8548 enter "none" for no administrator.
8551 case "$perladmin" in
8552 '') dflt="$cf_email";;
8553 *) dflt="$perladmin";;
8555 rp='Perl administrator e-mail address'
8559 : determine whether to only install version-specific parts.
8562 Do you want to install only the version-specific parts of the perl
8563 distribution? Usually you do *not* want to do this.
8565 case "$versiononly" in
8566 "$define"|[Yy]*|true) dflt='y' ;;
8569 rp="Do you want to install only the version-specific parts of perl?"
8572 [yY]*) val="$define";;
8578 case "$versiononly" in
8579 "$define") inc_version_list=''
8580 inc_version_list_init=0
8584 : figure out how to guarantee perl startup
8585 : XXX Note that this currently takes advantage of the bug that binexp ignores
8586 : the Configure -Dinstallprefix setting, which in turn means that under
8587 : relocatable @INC, initialinstalllocation is what binexp started as.
8588 case "$startperl" in
8590 case "$sharpbang" in
8594 I can use the #! construct to start perl on your system. This will
8595 make startup of perl scripts faster, but may cause problems if you
8596 want to share those scripts and perl is not in a standard place
8597 ($initialinstalllocation/perl) on all your platforms. The alternative
8598 is to force a shell by starting the script with a single ':' character.
8601 case "$versiononly" in
8602 "$define") dflt="$initialinstalllocation/perl$version";;
8603 *) dflt="$initialinstalllocation/perl";;
8605 rp='What shall I put after the #! to start up perl ("none" to not use #!)?'
8608 none) startperl=": # use perl";;
8609 *) startperl="#!$ans"
8610 if $test 30 -lt `echo "$ans" | wc -c`; then
8613 WARNING: Some systems limit the #! command to 32 characters.
8614 If you experience difficulty running Perl scripts with #!, try
8615 installing Perl in a directory with a shorter pathname.
8621 *) startperl=": # use perl"
8626 echo "I'll use $startperl to start perl scripts."
8628 : figure best path for perl in scripts
8631 case "$versiononly" in
8632 "$define") perlpath="$initialinstalllocation/perl$version";;
8633 *) perlpath="$initialinstalllocation/perl";;
8635 case "$startperl" in
8640 I will use the "eval 'exec'" idiom to start Perl on your system.
8641 I can use the full path of your Perl binary for this purpose, but
8642 doing so may cause problems if you want to share those scripts and
8643 Perl is not always in a standard place ($initialinstalllocation/perl).
8646 dflt="$initialinstalllocation/perl"
8647 rp="What path shall I use in \"eval 'exec'\"?"
8654 case "$startperl" in
8656 *) echo "I'll use $perlpath in \"eval 'exec'\"" ;;
8659 : determine where public executable scripts go
8660 set scriptdir scriptdir
8662 case "$scriptdir" in
8665 : guess some guesses
8666 $test -d /usr/share/scripts && dflt=/usr/share/scripts
8667 $test -d /usr/share/bin && dflt=/usr/share/bin
8668 $test -d /usr/local/script && dflt=/usr/local/script
8669 $test -d /usr/local/scripts && dflt=/usr/local/scripts
8670 $test -d $prefixexp/script && dflt=$prefixexp/script
8674 *) dflt="$scriptdir"
8679 Some installations have a separate directory just for executable scripts so
8680 that they can mount it across multiple architectures but keep the scripts in
8681 one spot. You might, for example, have a subdirectory of /usr/share for this.
8682 Or you might just lump your scripts in with all your other executables.
8686 rp='Where do you keep publicly executable scripts?'
8688 if $test "X$ansexp" != "X$scriptdirexp"; then
8694 : A little fix up for an irregularly named variable.
8695 installscript="$installscriptdir"
8697 : determine where add-on public executables go
8699 '') dflt=$siteprefix/bin ;;
8703 rp='Pathname where the add-on public executables should be installed?'
8708 : determine where add-on html pages go
8709 : There is no standard location, so try to copy the previously-selected
8710 : directory structure for the core html pages.
8711 case "$sitehtml1dir" in
8712 '') dflt=`echo "$html1dir" | $sed "s#^$prefix#$siteprefix#"` ;;
8713 *) dflt=$sitehtml1dir ;;
8716 ''|' ') dflt=none ;;
8719 rp='Pathname where the site-specific html pages should be installed?'
8721 prefixvar=sitehtml1dir
8724 : determine where add-on library html pages go
8725 : There is no standard location, so try to copy the previously-selected
8726 : directory structure for the core html pages.
8727 case "$sitehtml3dir" in
8728 '') dflt=`echo "$html3dir" | $sed "s#^$prefix#$siteprefix#"` ;;
8729 *) dflt=$sitehtml3dir ;;
8732 ''|' ') dflt=none ;;
8735 rp='Pathname where the site-specific library html pages should be installed?'
8737 prefixvar=sitehtml3dir
8740 : determine where add-on manual pages go
8741 case "$siteman1dir" in
8742 '') dflt=`echo $man1dir | $sed "s#^$prefix#$siteprefix#"` ;;
8743 *) dflt=$siteman1dir ;;
8746 ''|' ') dflt=none ;;
8749 rp='Pathname where the site-specific manual pages should be installed?'
8751 prefixvar=siteman1dir
8754 : determine where add-on library man pages go
8755 case "$siteman3dir" in
8756 '') dflt=`echo $man3dir | $sed "s#^$prefix#$siteprefix#"` ;;
8757 *) dflt=$siteman3dir ;;
8760 ''|' ') dflt=none ;;
8763 rp='Pathname where the site-specific library manual pages should be installed?'
8765 prefixvar=siteman3dir
8768 : determine where add-on public executable scripts go
8769 case "$sitescript" in
8770 '') dflt=$siteprefix/script
8771 $test -d $dflt || dflt=$sitebin ;;
8772 *) dflt="$sitescript" ;;
8775 rp='Pathname where add-on public executable scripts should be installed?'
8777 prefixvar=sitescript
8780 case "$usefaststdio" in
8781 $define|true|[yY]*|'')
8782 xversion=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
8792 Perl can be built to use 'fast stdio', which means using the stdio
8793 library but also directly manipulating the stdio buffers to enable
8794 faster I/O. Using stdio is better for backward compatibility (especially
8795 for Perl extensions), but on the other hand since Perl 5.8 the 'perlio'
8796 interface has been preferred instead of stdio.
8798 If this doesn't make any sense to you, just accept the default '$dflt'.
8800 rp='Use the "fast stdio" if available?'
8803 y|Y) val="$define" ;;
8810 : define an is-a-typedef? function
8811 typedef='type=$1; var=$2; def=$3; shift; shift; shift; inclist=$@;
8813 "") inclist="sys/types.h";;
8815 eval "varval=\$$var";
8819 for inc in $inclist; do
8820 echo "#include <$inc>" >>temp.c;
8822 echo "#ifdef $type" >> temp.c;
8823 echo "printf(\"We have $type\");" >> temp.c;
8824 echo "#endif" >> temp.c;
8825 $cppstdin $cppflags $cppminus < temp.c >temp.E 2>/dev/null;
8826 if $contains $type temp.E >/dev/null 2>&1; then
8832 *) eval "$var=\$varval";;
8835 : define an is-a-typedef? function that prompts if the type is not available.
8836 typedef_ask='type=$1; var=$2; def=$3; shift; shift; shift; inclist=$@;
8838 "") inclist="sys/types.h";;
8840 eval "varval=\$$var";
8844 for inc in $inclist; do
8845 echo "#include <$inc>" >>temp.c;
8847 echo "#ifdef $type" >> temp.c;
8848 echo "printf(\"We have $type\");" >> temp.c;
8849 echo "#endif" >> temp.c;
8850 $cppstdin $cppflags $cppminus < temp.c >temp.E 2>/dev/null;
8852 echo "$rp" | $sed -e "s/What is/Looking for/" -e "s/?/./";
8853 if $contains $type temp.E >/dev/null 2>&1; then
8854 echo "$type found." >&4;
8857 echo "$type NOT found." >&4;
8863 *) eval "$var=\$varval";;
8866 : see what type lseek is declared as in the kernel
8867 rp="What is the type used for lseek's offset on this system?"
8868 set off_t lseektype long stdio.h sys/types.h
8872 echo "Checking to see how big your file offsets are..." >&4
8874 #include <sys/types.h>
8878 printf("%d\n", (int)sizeof($lseektype));
8883 if eval $compile_ok; then
8884 lseeksize=`$run ./try`
8885 echo "Your file offsets are $lseeksize bytes long."
8889 echo "(I can't seem to compile the test program. Guessing...)"
8890 rp="What is the size of your file offsets (in bytes)?"
8896 : see what type file positions are declared as in the library
8897 rp="What is the type for file position used by fsetpos()?"
8898 set fpos_t fpostype long stdio.h sys/types.h
8903 *_t) zzz="$fpostype" ;;
8906 echo "Checking the size of $zzz..." >&4
8908 #include <sys/types.h>
8915 printf("%d\n", (int)sizeof($fpostype));
8920 if eval $compile_ok; then
8924 echo "(I can't execute the test program--guessing $fpossize.)" >&4
8927 echo "Your $zzz is $fpossize bytes long."
8933 echo "(I can't compile the test program. Guessing...)" >&4
8934 rp="What is the size of your file positions (in bytes)?"
8939 # Backward compatibility (uselfs is deprecated).
8941 "$define"|true|[yY]*)
8944 *** Configure -Duselfs is deprecated, using -Duselargefiles instead.
8946 uselargefiles="$define"
8950 case "$lseeksize:$fpossize" in
8953 You can have files larger than 2 gigabytes.
8956 *) case "$uselargefiles" in
8957 "$undef"|false|[nN]*) dflt='n' ;;
8962 Perl can be built to understand large files (files larger than 2 gigabytes)
8963 on some systems. To do so, Configure can be run with -Duselargefiles.
8965 If this doesn't make any sense to you, just accept the default '$dflt'.
8967 rp='Try to understand large files, if available?'
8970 y|Y) val="$define" ;;
8977 : Look for a hint-file generated 'call-back-unit'. If the
8978 : user has specified that a large files perl is to be built,
8979 : we may need to set or change some other defaults.
8980 if $test -f uselargefiles.cbu; then
8981 echo "Your platform has some specific hints regarding large file builds, using them..."
8982 . ./uselargefiles.cbu
8984 case "$uselargefiles" in
8986 if $test -f uselargefiles.cbu; then
8988 echo "Rechecking to see how big your file offsets are..." >&4
8990 #include <sys/types.h>
8994 printf("%d\n", (int)sizeof($lseektype));
8999 if eval $compile_ok; then
9000 lseeksize=`$run ./try`
9001 $echo "Your file offsets are now $lseeksize bytes long."
9005 echo "(I can't seem to compile the test program. Guessing...)"
9006 rp="What is the size of your file offsets (in bytes)?"
9011 *_t) zzz="$fpostype" ;;
9014 $echo $n "Rechecking the size of $zzz...$c" >&4
9016 #include <sys/types.h>
9023 printf("%d\n", (int)sizeof($fpostype));
9028 if eval $compile_ok; then
9033 echo "(I can't execute the test program--guessing $fpossize.)" >&4
9036 echo " $fpossize bytes." >&4
9042 echo "(I can't compile the test program. Guessing...)" >&4
9043 rp="What is the size of your file positions (in bytes)?"
9052 case "$vendorprefix" in
9053 '') d_vendorbin="$undef"
9057 *) d_vendorbin="$define"
9058 : determine where vendor-supplied executables go.
9059 case "$vendorbin" in
9060 '') dflt=$vendorprefix/bin ;;
9061 *) dflt="$vendorbin" ;;
9064 rp='Pathname for the vendor-supplied executables directory?'
9067 vendorbinexp="$ansexp"
9073 case "$vendorprefix" in
9074 '') vendorhtml1dir=''
9075 vendorhtml1direxp=''
9077 *) : determine where vendor-supplied html pages go.
9078 : There is no standard location, so try to copy the previously-selected
9079 : directory structure for the core html pages.
9080 : XXX Better default suggestions would be welcome.
9081 case "$vendorhtml1dir" in
9082 '') dflt=`echo "$html1dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
9083 *) dflt=$vendorhtml1dir ;;
9086 ''|' ') dflt=none ;;
9089 rp='Pathname for the vendor-supplied html pages?'
9091 vendorhtml1dir="$ans"
9092 vendorhtml1direxp="$ansexp"
9095 : Use ' ' for none so value is preserved next time through Configure
9096 $test X"$vendorhtml1dir" = "X" && vendorhtml1dir=' '
9097 prefixvar=vendorhtml1dir
9100 case "$vendorprefix" in
9101 '') vendorhtml3dir=''
9102 vendorhtml3direxp=''
9104 *) : determine where vendor-supplied module html pages go.
9105 : There is no standard location, so try to copy the previously-selected
9106 : directory structure for the core html pages.
9107 : XXX Better default suggestions would be welcome.
9108 case "$vendorhtml3dir" in
9109 '') dflt=`echo "$html3dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
9110 *) dflt=$vendorhtml3dir ;;
9113 ''|' ') dflt=none ;;
9116 rp='Pathname for the vendor-supplied html pages?'
9118 vendorhtml3dir="$ans"
9119 vendorhtml3direxp="$ansexp"
9122 : Use ' ' for none so value is preserved next time through Configure
9123 $test X"$vendorhtml3dir" = "X" && vendorhtml3dir=' '
9124 prefixvar=vendorhtml3dir
9127 case "$vendorprefix" in
9128 '') vendorman1dir=''
9131 *) : determine where vendor-supplied manual pages go.
9132 case "$vendorman1dir" in
9133 '') dflt=`echo "$man1dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
9134 *) dflt=$vendorman1dir ;;
9137 ''|' ') dflt=none ;;
9140 rp='Pathname for the vendor-supplied manual section 1 pages?'
9142 vendorman1dir="$ans"
9143 vendorman1direxp="$ansexp"
9146 : Use ' ' for none so value is preserved next time through Configure
9147 $test X"$vendorman1dir" = "X" && vendorman1dir=' '
9148 prefixvar=vendorman1dir
9151 case "$vendorprefix" in
9152 '') vendorman3dir=''
9155 *) : determine where vendor-supplied module manual pages go.
9156 case "$vendorman3dir" in
9157 '') dflt=`echo "$man3dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
9158 *) dflt=$vendorman3dir ;;
9161 ''|' ') dflt=none ;;
9164 rp='Pathname for the vendor-supplied manual section 3 pages?'
9166 vendorman3dir="$ans"
9167 vendorman3direxp="$ansexp"
9170 : Use ' ' for none so value is preserved next time through Configure
9171 $test X"$vendorman3dir" = "X" && vendorman3dir=' '
9172 prefixvar=vendorman3dir
9175 case "$vendorprefix" in
9176 '') d_vendorscript="$undef"
9180 *) d_vendorscript="$define"
9181 : determine where vendor-supplied scripts go.
9182 case "$vendorscript" in
9183 '') dflt=$vendorprefix/script
9184 $test -d $dflt || dflt=$vendorbin ;;
9185 *) dflt="$vendorscript" ;;
9189 The installation process will create a directory for
9190 vendor-supplied scripts.
9194 rp='Pathname for the vendor-supplied scripts directory?'
9197 vendorscriptexp="$ansexp"
9200 prefixvar=vendorscript
9203 : see if qgcvt exists
9209 if $test X"$d_longdbl" = X"$define"; then
9211 echo "Checking how to print long doubles..." >&4
9213 if $test X"$sPRIfldbl" = X -a X"$doublesize" = X"$longdblsize"; then
9214 $cat >try.c <<'EOCP'
9215 #include <sys/types.h>
9219 printf("%.3f\n", d);
9223 if eval $compile; then
9227 sPRIfldbl='"f"'; sPRIgldbl='"g"'; sPRIeldbl='"e"';
9228 sPRIFUldbl='"F"'; sPRIGUldbl='"G"'; sPRIEUldbl='"E"';
9229 echo "We will use %f."
9235 if $test X"$sPRIfldbl" = X; then
9236 $cat >try.c <<'EOCP'
9237 #include <sys/types.h>
9240 long double d = 123.456;
9241 printf("%.3Lf\n", d);
9245 if eval $compile; then
9249 sPRIfldbl='"Lf"'; sPRIgldbl='"Lg"'; sPRIeldbl='"Le"';
9250 sPRIFUldbl='"LF"'; sPRIGUldbl='"LG"'; sPRIEUldbl='"LE"';
9251 echo "We will use %Lf."
9257 if $test X"$sPRIfldbl" = X; then
9258 $cat >try.c <<'EOCP'
9259 #include <sys/types.h>
9262 long double d = 123.456;
9263 printf("%.3llf\n", d);
9267 if eval $compile; then
9271 sPRIfldbl='"llf"'; sPRIgldbl='"llg"'; sPRIeldbl='"lle"';
9272 sPRIFUldbl='"llF"'; sPRIGUldbl='"llG"'; sPRIEUldbl='"llE"';
9273 echo "We will use %llf."
9279 if $test X"$sPRIfldbl" = X; then
9280 $cat >try.c <<'EOCP'
9281 #include <sys/types.h>
9284 long double d = 123.456;
9285 printf("%.3lf\n", d);
9289 if eval $compile; then
9293 sPRIfldbl='"lf"'; sPRIgldbl='"lg"'; sPRIeldbl='"le"';
9294 sPRIFUldbl='"lF"'; sPRIGUldbl='"lG"'; sPRIEUldbl='"lE"';
9295 echo "We will use %lf."
9301 if $test X"$sPRIfldbl" = X; then
9302 echo "Cannot figure out how to print long doubles." >&4
9304 sSCNfldbl=$sPRIfldbl # expect consistency
9311 case "$sPRIfldbl" in
9312 '') d_PRIfldbl="$undef"; d_PRIgldbl="$undef"; d_PRIeldbl="$undef";
9313 d_PRIFUldbl="$undef"; d_PRIGUldbl="$undef"; d_PRIEUldbl="$undef";
9314 d_SCNfldbl="$undef";
9316 *) d_PRIfldbl="$define"; d_PRIgldbl="$define"; d_PRIeldbl="$define";
9317 d_PRIFUldbl="$define"; d_PRIGUldbl="$define"; d_PRIEUldbl="$define";
9318 d_SCNfldbl="$define";
9322 : Check how to convert floats to strings.
9324 if test "X$d_Gconvert" = X; then
9327 echo "Checking for an efficient way to convert floats to strings."
9329 case "$uselongdouble" in
9330 "$define") echo "#define USE_LONG_DOUBLE" >>try.c ;;
9332 case "$d_longdbl" in
9333 "$define") echo "#define HAS_LONG_DOUBLE" >>try.c ;;
9335 case "$d_PRIgldbl" in
9336 "$define") echo "#define HAS_PRIgldbl" >>try.c ;;
9340 #define Gconvert(x,n,t,b) gconvert((x),(n),(t),(b))
9341 char *myname = "gconvert";
9344 #define Gconvert(x,n,t,b) gcvt((x),(n),(b))
9345 char *myname = "gcvt";
9348 #define Gconvert(x,n,t,b) qgcvt((x),(n),(b))
9349 char *myname = "qgcvt";
9350 #define DOUBLETYPE long double
9353 #if defined(USE_LONG_DOUBLE) && defined(HAS_LONG_DOUBLE)
9355 #define Gconvert(x,n,t,b) sprintf((b),"%.*"$sPRIgldbl,(n),(x))
9357 #define Gconvert(x,n,t,b) sprintf((b),"%.*g",(n),(double)(x))
9360 #define Gconvert(x,n,t,b) sprintf((b),"%.*g",(n),(x))
9362 char *myname = "sprintf";
9366 #if defined(USE_LONG_DOUBLE) && defined(HAS_LONG_DOUBLE)
9367 #define DOUBLETYPE long double
9369 #define DOUBLETYPE double
9375 #define I_STDLIB $i_stdlib
9381 checkit(expect, got)
9385 if (strcmp(expect, got)) {
9386 printf("%s oddity: Expected %s, got %s\n",
9387 myname, expect, got);
9397 /* This must be 1st test on (which?) platform */
9398 /* Alan Burlison <AlanBurlsin@unn.unisys.com> */
9399 Gconvert((DOUBLETYPE)0.1, 8, 0, buf);
9400 checkit("0.1", buf);
9402 Gconvert((DOUBLETYPE)0.01, 8, 0, buf);
9403 checkit("0.01", buf);
9405 Gconvert((DOUBLETYPE)0.001, 8, 0, buf);
9406 checkit("0.001", buf);
9408 Gconvert((DOUBLETYPE)0.0001, 8, 0, buf);
9409 checkit("0.0001", buf);
9411 Gconvert((DOUBLETYPE)0.00009, 8, 0, buf);
9412 if (strlen(buf) > 5)
9413 checkit("9e-005", buf); /* for Microsoft ?? */
9415 checkit("9e-05", buf);
9417 Gconvert((DOUBLETYPE)1.0, 8, 0, buf);
9420 Gconvert((DOUBLETYPE)1.1, 8, 0, buf);
9421 checkit("1.1", buf);
9423 Gconvert((DOUBLETYPE)1.01, 8, 0, buf);
9424 checkit("1.01", buf);
9426 Gconvert((DOUBLETYPE)1.001, 8, 0, buf);
9427 checkit("1.001", buf);
9429 Gconvert((DOUBLETYPE)1.0001, 8, 0, buf);
9430 checkit("1.0001", buf);
9432 Gconvert((DOUBLETYPE)1.00001, 8, 0, buf);
9433 checkit("1.00001", buf);
9435 Gconvert((DOUBLETYPE)1.000001, 8, 0, buf);
9436 checkit("1.000001", buf);
9438 Gconvert((DOUBLETYPE)0.0, 8, 0, buf);
9441 Gconvert((DOUBLETYPE)-1.0, 8, 0, buf);
9444 /* Some Linux gcvt's give 1.e+5 here. */
9445 Gconvert((DOUBLETYPE)100000.0, 8, 0, buf);
9446 checkit("100000", buf);
9448 /* Some Linux gcvt's give -1.e+5 here. */
9449 Gconvert((DOUBLETYPE)-100000.0, 8, 0, buf);
9450 checkit("-100000", buf);
9452 Gconvert((DOUBLETYPE)123.456, 8, 0, buf);
9453 checkit("123.456", buf);
9455 /* Testing of 1e+129 in bigintpm.t must not get extra '.' here. */
9456 Gconvert((DOUBLETYPE)1e34, 8, 0, buf);
9457 /* 34 should be enough to scare even long double
9458 * places into using the e notation. */
9459 if (strlen(buf) > 5)
9460 checkit("1e+034", buf); /* for Microsoft */
9462 checkit("1e+34", buf);
9464 /* For Perl, if you add additional tests here, also add them to
9465 * t/base/num.t for benefit of platforms not using Configure or
9466 * overriding d_Gconvert */
9471 : first add preferred functions to our list
9473 for xxx_convert in $gconvert_preference; do
9474 case $xxx_convert in
9475 gcvt|gconvert|sprintf) xxx_list="$xxx_list $xxx_convert" ;;
9476 *) echo "Discarding unrecognized gconvert_preference $xxx_convert" >&4 ;;
9479 : then add any others
9480 for xxx_convert in gconvert gcvt sprintf; do
9483 *) xxx_list="$xxx_list $xxx_convert" ;;
9487 case "$d_longdbl$uselongdouble" in
9489 : again, add prefered functions to our list first
9491 for xxx_convert in $gconvert_ld_preference; do
9492 case $xxx_convert in
9493 qgcvt|gcvt|gconvert|sprintf) xxx_ld_list="$xxx_ld_list $xxx_convert" ;;
9494 *) echo "Discarding unrecognized gconvert_ld_preference $xxx_convert" ;;
9497 : then add qgcvt, sprintf--then, in xxx_list order, gconvert and gcvt
9498 for xxx_convert in qgcvt sprintf $xxx_list; do
9499 case "$xxx_ld_list" in
9500 $xxx_convert*|*" $xxx_convert"*) ;;
9501 *) xxx_ld_list="$xxx_ld_list $xxx_convert" ;;
9504 : if sprintf cannot do long doubles, move it to the end
9505 if test "$d_PRIgldbl" != "$define"; then
9506 xxx_ld_list="`echo $xxx_ld_list|sed s/sprintf//` sprintf"
9508 : if no qgcvt, remove it
9509 if test "$d_qgcvt" != "$define"; then
9510 xxx_ld_list="`echo $xxx_ld_list|sed s/qgcvt//`"
9513 xxx_list="$xxx_ld_list"
9517 for xxx_convert in $xxx_list; do
9518 echo "Trying $xxx_convert..."
9520 set try -DTRY_$xxx_convert
9521 if eval $compile; then
9522 echo "$xxx_convert() found." >&4
9524 echo "I'll use $xxx_convert to convert floats into a string." >&4
9527 echo "...But $xxx_convert didn't work as I expected."
9531 echo "$xxx_convert NOT found." >&4
9535 if test X$xxx_convert = X; then
9536 echo "*** WHOA THERE!!! ***" >&4
9537 echo "None of ($xxx_list) seemed to work properly. I'll use sprintf." >&4
9541 case "$xxx_convert" in
9542 gconvert) d_Gconvert='gconvert((x),(n),(t),(b))' ;;
9543 gcvt) d_Gconvert='gcvt((x),(n),(b))' ;;
9544 qgcvt) d_Gconvert='qgcvt((x),(n),(b))' ;;
9545 *) case "$uselongdouble$d_longdbl$d_PRIgldbl" in
9546 "$define$define$define")
9547 d_Gconvert="sprintf((b),\"%.*\"$sPRIgldbl,(n),(x))" ;;
9548 "$define$define$undef")
9549 d_Gconvert='sprintf((b),"%.*g",(n),(double)(x))' ;;
9550 *) d_Gconvert='sprintf((b),"%.*g",(n),(x))' ;;
9557 : see if _fwalk exists
9561 : Initialize h_fcntl
9564 : Initialize h_sysfile
9567 : access call always available on UNIX
9571 : locate the flags for 'access()'
9575 $cat >access.c <<EOCP
9576 #include <sys/types.h>
9581 #include <sys/file.h>
9594 : check sys/file.h first, no particular reason here
9595 if $test `./findhdr sys/file.h` && \
9596 $cc -o access $cppflags -DI_SYS_FILE access.c >/dev/null 2>&1 ; then
9598 echo "<sys/file.h> defines the *_OK access constants." >&4
9599 elif $test `./findhdr fcntl.h` && \
9600 $cc -o access $cppflags -DI_FCNTL access.c >/dev/null 2>&1 ; then
9602 echo "<fcntl.h> defines the *_OK access constants." >&4
9603 elif $test `./findhdr unistd.h` && \
9604 $cc -o access $cppflags -DI_UNISTD access.c >/dev/null 2>&1 ; then
9605 echo "<unistd.h> defines the *_OK access constants." >&4
9607 echo "I can't find the four *_OK access constants--I'll use mine." >&4
9613 : see if accessx exists
9614 set accessx d_accessx
9617 : see if aintl exists
9621 : see if alarm exists
9625 : see if POSIX threads are available
9626 set pthread.h i_pthread
9629 : define a fucntion to check prototypes
9630 $cat > protochk <<EOSH
9633 optimize="$optimize"
9635 prototype="$prototype"
9638 usethreads=$usethreads
9639 i_pthread=$i_pthread
9640 pthread_h_first=$pthread_h_first
9643 $cat >> protochk <<'EOSH'
9648 while test $# -ge 2; do
9650 $define) echo "#include <$2>" >> try.c ;;
9651 literal) echo "$2" >> try.c ;;
9653 # Extra magic for the benefit of systems that need pthread.h
9654 # to be included early to correctly detect threadsafe functions.
9655 # Such functions must guarantee themselves, though, that the usethreads
9656 # and i_pthread have been defined, before calling protochk.
9657 if test "$usethreads" = "$define" -a "$i_pthread" = "$define" -a "$pthread_h_first" = "$define" -a "$pthread_h_done" = ""; then
9658 echo "#include <pthread.h>" >> try.c
9663 test "$prototype" = "$define" && echo '#define CAN_PROTOTYPE' >> try.c
9664 cat >> try.c <<'EOCP'
9665 #ifdef CAN_PROTOTYPE
9666 #define _(args) args
9671 echo "$foo" >> try.c
9672 echo 'int no_real_function_has_this_name _((void)) { return 0; }' >> try.c
9673 $cc $optimize $ccflags -c try.c > /dev/null 2>&1
9681 hasproto='varname=$1; func=$2; shift; shift;
9682 while $test $# -ge 2; do
9684 $define) echo "#include <$2>";;
9688 $cppstdin $cppflags $cppminus < try.c > tryout.c 2>/dev/null;
9689 if $contains "$func.*(" tryout.c >/dev/null 2>&1; then
9690 echo "$func() prototype found.";
9693 echo "$func() prototype NOT found.";
9698 $rm -f try.c tryout.c'
9700 : see if sys/types.h has to be included
9701 set sys/types.h i_systypes
9704 : see if sys/select.h has to be included
9705 set sys/select.h i_sysselct
9708 hasfield='varname=$1; struct=$2; field=$3; shift; shift; shift;
9709 while $test $# -ge 2; do
9711 $define) echo "#include <$2>";;
9715 echo "int main () { struct $struct foo; char* bar; bar = (char*)foo.$field; }" >> try.c;
9717 if eval $compile; then
9726 : see if we should include time.h, sys/time.h, or both
9728 if test "X$timeincl" = X; then
9729 echo "Testing to see if we should include <time.h>, <sys/time.h> or both." >&4
9730 $echo $n "I'm now running the test program...$c"
9732 #include <sys/types.h>
9737 #ifdef SYSTIMEKERNEL
9740 #include <sys/time.h>
9743 #include <sys/select.h>
9756 struct timezone tzp;
9758 if (foo.tm_sec == foo.tm_sec)
9761 if (bar.tv_sec == bar.tv_sec)
9768 for s_timezone in '-DS_TIMEZONE' ''; do
9770 for s_timeval in '-DS_TIMEVAL' ''; do
9771 for i_systimek in '' '-DSYSTIMEKERNEL'; do
9772 for i_time in '' '-DI_TIME'; do
9773 for i_systime in '-DI_SYSTIME' ''; do
9776 set try $i_time $i_systime $i_systimek $sysselect $s_timeval $s_timezone
9777 if eval $compile; then
9778 set X $i_time $i_systime $i_systimek $sysselect $s_timeval
9782 $echo $n "Succeeded with $flags$c"
9794 *SYSTIMEKERNEL*) i_systimek="$define"
9795 timeincl=`./findhdr sys/time.h`
9796 echo "We'll include <sys/time.h> with KERNEL defined." >&4;;
9797 *) i_systimek="$undef";;
9800 *I_TIME*) i_time="$define"
9801 timeincl=`./findhdr time.h`" $timeincl"
9802 echo "We'll include <time.h>." >&4;;
9803 *) i_time="$undef";;
9806 *I_SYSTIME*) i_systime="$define"
9807 timeincl=`./findhdr sys/time.h`" $timeincl"
9808 echo "We'll include <sys/time.h>." >&4;;
9809 *) i_systime="$undef";;
9813 : see if struct tm knows about tm_zone
9814 case "$i_systime$i_time" in
9817 echo "Checking to see if your struct tm has tm_zone field..." >&4
9818 set d_tm_tm_zone tm tm_zone $i_systime sys/time.h $i_time time.h
9826 case "$d_tm_tm_zone" in
9827 "$define") echo "Yes, it does." ;;
9828 *) echo "No, it doesn't." ;;
9830 : see if struct tm knows about tm_gmtoff
9831 case "$i_systime$i_time" in
9834 echo "Checking to see if your struct tm has tm_gmtoff field..." >&4
9835 set d_tm_tm_gmtoff tm tm_gmtoff $i_systime sys/time.h $i_time time.h
9843 case "$d_tm_tm_gmtoff" in
9844 "$define") echo "Yes, it does." ;;
9845 *) echo "No, it doesn't." ;;
9848 : see if asctime_r exists
9849 set asctime_r d_asctime_r
9851 case "$d_asctime_r" in
9853 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
9854 case "$d_asctime_r_proto:$usethreads" in
9855 ":define") d_asctime_r_proto=define
9856 set d_asctime_r_proto asctime_r $hdrs
9860 case "$d_asctime_r_proto" in
9862 case "$asctime_r_proto" in
9863 ''|0) try='char* asctime_r(const struct tm*, char*);'
9864 ./protochk "extern $try" $hdrs && asctime_r_proto=B_SB ;;
9866 case "$asctime_r_proto" in
9867 ''|0) try='char* asctime_r(const struct tm*, char*, int);'
9868 ./protochk "extern $try" $hdrs && asctime_r_proto=B_SBI ;;
9870 case "$asctime_r_proto" in
9871 ''|0) try='int asctime_r(const struct tm*, char*);'
9872 ./protochk "extern $try" $hdrs && asctime_r_proto=I_SB ;;
9874 case "$asctime_r_proto" in
9875 ''|0) try='int asctime_r(const struct tm*, char*, int);'
9876 ./protochk "extern $try" $hdrs && asctime_r_proto=I_SBI ;;
9878 case "$asctime_r_proto" in
9879 ''|0) d_asctime_r=undef
9881 echo "Disabling asctime_r, cannot determine prototype." >&4 ;;
9882 * ) case "$asctime_r_proto" in
9883 REENTRANT_PROTO*) ;;
9884 *) asctime_r_proto="REENTRANT_PROTO_$asctime_r_proto" ;;
9886 echo "Prototype: $try" ;;
9889 *) case "$usethreads" in
9890 define) echo "asctime_r has no prototype, not using it." >&4 ;;
9897 *) asctime_r_proto=0
9901 : see if atolf exists
9905 : see if atoll exists
9909 : Look for GCC-style attribute format
9910 case "$d_attribute_format" in
9913 echo "Checking whether your compiler can handle __attribute__((format)) ..." >&4
9914 $cat >attrib.c <<'EOCP'
9916 void my_special_printf(char* pat,...) __attribute__((__format__(__printf__,1,2)));
9918 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
9919 if $contains 'warning' attrib.out >/dev/null 2>&1; then
9920 echo "Your C compiler doesn't support __attribute__((format))."
9923 echo "Your C compiler supports __attribute__((format))."
9927 echo "Your C compiler doesn't seem to understand __attribute__ at all."
9931 *) val="$d_attribute_format" ;;
9933 set d_attribute_format
9937 : Look for GCC-style attribute malloc
9938 case "$d_attribute_malloc" in
9941 echo "Checking whether your compiler can handle __attribute__((malloc)) ..." >&4
9942 $cat >attrib.c <<'EOCP'
9944 char *go_get_some_memory( int how_many_bytes ) __attribute__((malloc));
9946 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
9947 if $contains 'warning' attrib.out >/dev/null 2>&1; then
9948 echo "Your C compiler doesn't support __attribute__((malloc))."
9951 echo "Your C compiler supports __attribute__((malloc))."
9955 echo "Your C compiler doesn't seem to understand __attribute__ at all."
9959 *) val="$d_attribute_malloc" ;;
9961 set d_attribute_malloc
9965 : Look for GCC-style attribute nonnull
9966 case "$d_attribute_nonnull" in
9969 echo "Checking whether your compiler can handle __attribute__((nonnull(1))) ..." >&4
9970 $cat >attrib.c <<'EOCP'
9972 void do_something (char *some_pointer,...) __attribute__((nonnull(1)));
9974 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
9975 if $contains 'warning' attrib.out >/dev/null 2>&1; then
9976 echo "Your C compiler doesn't support __attribute__((nonnull))."
9979 echo "Your C compiler supports __attribute__((nonnull))."
9983 echo "Your C compiler doesn't seem to understand __attribute__ at all."
9987 *) val="$d_attribute_nonnull" ;;
9989 set d_attribute_nonnull
9993 : Look for GCC-style attribute noreturn
9994 case "$d_attribute_noreturn" in
9997 echo "Checking whether your compiler can handle __attribute__((noreturn)) ..." >&4
9998 $cat >attrib.c <<'EOCP'
10000 void fall_over_dead( void ) __attribute__((noreturn));
10002 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10003 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10004 echo "Your C compiler doesn't support __attribute__((noreturn))."
10007 echo "Your C compiler supports __attribute__((noreturn))."
10011 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10015 *) val="$d_attribute_noreturn" ;;
10017 set d_attribute_noreturn
10021 : Look for GCC-style attribute pure
10022 case "$d_attribute_pure" in
10025 echo "Checking whether your compiler can handle __attribute__((pure)) ..." >&4
10026 $cat >attrib.c <<'EOCP'
10028 int square( int n ) __attribute__((pure));
10030 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10031 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10032 echo "Your C compiler doesn't support __attribute__((pure))."
10035 echo "Your C compiler supports __attribute__((pure))."
10039 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10043 *) val="$d_attribute_pure" ;;
10045 set d_attribute_pure
10049 : Look for GCC-style attribute unused
10050 case "$d_attribute_unused" in
10053 echo "Checking whether your compiler can handle __attribute__((unused)) ..." >&4
10054 $cat >attrib.c <<'EOCP'
10056 int do_something( int dummy __attribute__((unused)), int n );
10058 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10059 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10060 echo "Your C compiler doesn't support __attribute__((unused))."
10063 echo "Your C compiler supports __attribute__((unused))."
10067 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10071 *) val="$d_attribute_unused" ;;
10073 set d_attribute_unused
10077 : Look for GCC-style attribute warn_unused_result
10078 case "$d_attribute_warn_unused_result" in
10081 echo "Checking whether your compiler can handle __attribute__((warn_unused_result)) ..." >&4
10082 $cat >attrib.c <<'EOCP'
10084 int I_will_not_be_ignored(void) __attribute__((warn_unused_result));
10086 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10087 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10088 echo "Your C compiler doesn't support __attribute__((warn_unused_result))."
10091 echo "Your C compiler supports __attribute__((warn_unused_result))."
10095 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10099 *) val="$d_attribute_warn_unused_result" ;;
10101 set d_attribute_warn_unused_result
10105 : see if bcmp exists
10109 : see if bcopy exists
10113 : see if getpgrp exists
10114 set getpgrp d_getpgrp
10117 case "$d_getpgrp" in
10120 echo "Checking to see which flavor of getpgrp is in use..."
10122 #$i_unistd I_UNISTD
10123 #include <sys/types.h>
10125 # include <unistd.h>
10127 #$i_stdlib I_STDLIB
10129 #include <stdlib.h>
10133 if (getuid() == 0) {
10134 printf("(I see you are running Configure as super-user...)\n");
10137 #ifdef TRY_BSD_PGRP
10138 if (getpgrp(1) == 0)
10147 if $cc -o try -DTRY_BSD_PGRP $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
10148 echo "You have to use getpgrp(pid) instead of getpgrp()." >&4
10150 elif $cc -o try $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
10151 echo "You have to use getpgrp() instead of getpgrp(pid)." >&4
10154 echo "I can't seem to compile and run the test program."
10156 xxx="a USG one, i.e. you use getpgrp()."
10158 # SVR4 systems can appear rather BSD-ish.
10159 case "$i_unistd" in
10161 xxx="a BSD one, i.e. you use getpgrp(pid)."
10165 xxx="probably a USG one, i.e. you use getpgrp()."
10170 echo "Assuming your getpgrp is $xxx" >&4
10179 : see if setpgrp exists
10180 set setpgrp d_setpgrp
10183 case "$d_setpgrp" in
10186 echo "Checking to see which flavor of setpgrp is in use..."
10188 #$i_unistd I_UNISTD
10189 #include <sys/types.h>
10191 # include <unistd.h>
10193 #$i_stdlib I_STDLIB
10195 #include <stdlib.h>
10199 if (getuid() == 0) {
10200 printf("(I see you are running Configure as super-user...)\n");
10203 #ifdef TRY_BSD_PGRP
10204 if (-1 == setpgrp(1, 1))
10207 if (setpgrp() != -1)
10213 if $cc -o try -DTRY_BSD_PGRP $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
10214 echo 'You have to use setpgrp(pid,pgrp) instead of setpgrp().' >&4
10216 elif $cc -o try $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
10217 echo 'You have to use setpgrp() instead of setpgrp(pid,pgrp).' >&4
10220 echo "(I can't seem to compile and run the test program.)"
10222 xxx="a USG one, i.e. you use setpgrp()."
10224 # SVR4 systems can appear rather BSD-ish.
10225 case "$i_unistd" in
10227 xxx="a BSD one, i.e. you use setpgrp(pid,pgrp)."
10231 xxx="probably a USG one, i.e. you use setpgrp()."
10236 echo "Assuming your setpgrp is $xxx" >&4
10244 : Look for GCC-style __builtin_choose_expr
10245 case "$d_builtin_choose_expr" in
10248 echo "Checking whether your compiler can handle __builtin_choose_expr ..." >&4
10249 $cat >try.c <<'EOCP'
10250 #include <assert.h>
10251 #include <stdlib.h>
10254 #define SYRINX(x) __builtin_choose_expr( x, (1056*2), (103*50) )
10257 assert( SYRINX(1) == 2112 );
10258 assert( SYRINX(1) != 5150 );
10259 assert( SYRINX(0) == 5150 );
10260 assert( SYRINX(0) != 2112 );
10261 puts( "All good!" );
10267 if eval $compile; then
10268 echo "Your C compiler supports __builtin_choose_expr."
10271 echo "Your C compiler doesn't seem to understand __builtin_choose_expr."
10275 *) val="$d_builtin_choose_expr" ;;
10278 set d_builtin_choose_expr
10280 $rm -f try.* try core core.try.*
10282 : Look for GCC-style __builtin_expect
10283 case "$d_builtin_expect" in
10286 echo "Checking whether your compiler can handle __builtin_expect ..." >&4
10287 $cat >builtin.c <<'EOCP'
10290 if ( __builtin_expect(n, 0) ) n = 1;
10294 if eval $compile; then
10295 echo "Your C compiler supports __builtin_choose_expr."
10298 echo "Your C compiler doesn't seem to understand __builtin_choose_expr."
10302 *) val="$d_builtin_expect" ;;
10305 set d_builtin_expect
10307 $rm -f try.* try core core.try.*
10309 : see if bzero exists
10313 : see if stdarg is available
10315 if $test `./findhdr stdarg.h`; then
10316 echo "<stdarg.h> found." >&4
10319 echo "<stdarg.h> NOT found." >&4
10323 : see if varags is available
10325 if $test `./findhdr varargs.h`; then
10326 echo "<varargs.h> found." >&4
10328 echo "<varargs.h> NOT found, but that's ok (I hope)." >&4
10331 : set up the varargs testing programs
10332 $cat > varargs.c <<EOP
10334 #include <stdarg.h>
10337 #include <varargs.h>
10341 int f(char *p, ...)
10355 p = va_arg(ap, char *);
10361 $cat > varargs <<EOP
10363 if $cc -c $ccflags -D\$1 varargs.c >/dev/null 2>&1; then
10372 : now check which varargs header should be included
10377 if `./varargs I_STDARG`; then
10379 elif `./varargs I_VARARGS`; then
10384 if `./varargs I_VARARGS`; then
10391 echo "I could not find the definition for va_dcl... You have problems..." >&4
10392 val="$undef"; set i_stdarg; eval $setvar
10393 val="$undef"; set i_varargs; eval $setvar
10398 case "$i_varhdr" in
10400 val="$define"; set i_stdarg; eval $setvar
10401 val="$undef"; set i_varargs; eval $setvar
10404 val="$undef"; set i_stdarg; eval $setvar
10405 val="$define"; set i_varargs; eval $setvar
10408 echo "We'll include <$i_varhdr> to get va_dcl definition." >&4;;
10412 : see if the Compiler supports C99 variadic macros
10413 case "$i_stdarg$i_stdlib" in
10415 echo "You have <stdarg.h> and <stdlib.h>, so checking for C99 variadic macros." >&4
10418 #include <stdarg.h>
10420 #define foo(buffer, format, ...) sprintf(buffer, format, __VA_ARGS__)
10424 foo(buf, "%d %g %.*s", 123, 456.0, (int)3, "789fail");
10430 if eval $compile && $run ./try 2>&1 >/dev/null; then
10431 case "`$run ./try`" in
10433 echo "You have C99 variadic macros." >&4
10434 d_c99_variadic_macros="$define"
10437 echo "You don't have functional C99 variadic macros." >&4
10438 d_c99_variadic_macros="$undef"
10442 echo "I couldn't compile and run the test program, so I assume that you don't have functional C99 variadic macros." >&4
10443 d_c99_variadic_macros="$undef"
10445 $rm -f try.* try core core.try.*
10448 echo "You don't have <stdarg.h> and <stdlib.h>, so not checking for C99 variadic macros." >&4
10449 d_c99_variadic_macros="$undef"
10453 : see if signal is declared as pointer to function returning int or void
10455 xxx=`./findhdr signal.h`
10456 $test "$xxx" && $cppstdin $cppminus $cppflags < $xxx >$$.tmp 2>/dev/null
10457 if $contains 'int.*\*[ ]*signal' $$.tmp >/dev/null 2>&1 ; then
10458 echo "You have int (*signal())() instead of void." >&4
10460 elif $contains 'void.*\*[ ]*signal' $$.tmp >/dev/null 2>&1 ; then
10461 echo "You have void (*signal())()." >&4
10463 elif $contains 'extern[ ]*[(\*]*signal' $$.tmp >/dev/null 2>&1 ; then
10464 echo "You have int (*signal())() instead of void." >&4
10466 elif $contains 'void.*\*.*sig' $$.tmp >/dev/null 2>&1 ; then
10467 echo "You have void (*signal())()." >&4
10470 case "$d_voidsig" in
10472 echo "I can't determine whether signal handler returns void or int..." >&4
10474 rp="What type does your signal handler return?"
10477 v*) val="$define";;
10481 echo "As you already told me, signal handler returns void." >&4
10484 *) echo "As you already told me, signal handler returns int." >&4
10491 case "$d_voidsig" in
10492 "$define") signal_t="void";;
10493 *) signal_t="int";;
10497 : check for ability to cast large floats to 32-bit ints.
10499 echo 'Checking whether your C compiler can cast large floats to int32.' >&4
10500 if $test "$intsize" -ge 4; then
10507 #$i_stdlib I_STDLIB
10509 #include <stdlib.h>
10511 #include <sys/types.h>
10512 #include <signal.h>
10513 $signal_t blech(int s) { exit(3); }
10520 signal(SIGFPE, blech);
10522 /* Don't let compiler optimize the test away. Store the number
10523 in a writable string for gcc to pass to sscanf under HP/UX.
10525 sprintf(str, "2147483647");
10526 sscanf(str, "%lf", &f); /* f = (double) 0x7fffffff; */
10530 /* x86 processors will probably give 0x8000 0000, which is a
10531 sign change. We don't want that. We want to mimic SPARC
10532 behavior here, which is to preserve the sign and give
10535 if (i32 != ($xxx) f)
10541 if eval $compile_ok; then
10545 echo "(I can't seem to compile the test program--assuming it can't)"
10550 echo "Yup, it can."
10553 echo "Nope, it can't."
10560 : check for ability to cast negative floats to unsigned
10562 echo 'Checking whether your C compiler can cast negative float to unsigned.' >&4
10565 #$i_stdlib I_STDLIB
10567 #include <stdlib.h>
10569 #include <sys/types.h>
10570 #include <signal.h>
10571 $signal_t blech(int s) { exit(7); }
10572 $signal_t blech_in_list(int s) { exit(4); }
10573 unsigned long dummy_long(unsigned long p) { return p; }
10574 unsigned int dummy_int(unsigned int p) { return p; }
10575 unsigned short dummy_short(unsigned short p) { return p; }
10579 unsigned long along;
10581 unsigned short ashort;
10585 /* Frustrate gcc-2.7.2's optimizer which failed this test with
10586 a direct f = -123. assignment. gcc-2.8.0 reportedly
10587 optimized the whole file away
10589 /* Store the number in a writable string for gcc to pass to
10590 sscanf under HP/UX.
10592 sprintf(str, "-123");
10593 sscanf(str, "%lf", &f); /* f = -123.; */
10595 signal(SIGFPE, blech);
10596 along = (unsigned long)f;
10597 aint = (unsigned int)f;
10598 ashort = (unsigned short)f;
10599 if (along != (unsigned long)-123)
10601 if (aint != (unsigned int)-123)
10603 if (ashort != (unsigned short)-123)
10605 sprintf(str, "1073741824.");
10606 sscanf(str, "%lf", &f); /* f = (double)0x40000000; */
10609 along = (unsigned long)f;
10610 if (along != 0x80000000)
10614 along = (unsigned long)f;
10615 if (along != 0x7fffffff)
10619 along = (unsigned long)f;
10620 if (along != 0x80000001)
10624 signal(SIGFPE, blech_in_list);
10625 sprintf(str, "123.");
10626 sscanf(str, "%lf", &f); /* f = 123.; */
10627 along = dummy_long((unsigned long)f);
10628 aint = dummy_int((unsigned int)f);
10629 ashort = dummy_short((unsigned short)f);
10630 if (along != (unsigned long)123)
10632 if (aint != (unsigned int)123)
10634 if (ashort != (unsigned short)123)
10641 if eval $compile_ok; then
10645 echo "(I can't seem to compile the test program--assuming it can't)"
10648 case "$castflags" in
10650 echo "Yup, it can."
10653 echo "Nope, it can't."
10660 : see if vprintf exists
10662 if set vprintf val -f d_vprintf; eval $csym; $val; then
10663 echo 'vprintf() found.' >&4
10666 #include <varargs.h>
10667 #$i_stdlib I_STDLIB
10669 #include <stdlib.h>
10672 int main() { xxx("foo"); }
10681 exit((unsigned long)vsprintf(buf,"%s",args) > 10L);
10685 if eval $compile && $run ./try; then
10686 echo "Your vsprintf() returns (int)." >&4
10689 echo "Your vsprintf() returns (char*)." >&4
10693 echo 'vprintf() NOT found.' >&4
10704 : see if chown exists
10708 : see if chroot exists
10709 set chroot d_chroot
10712 : see if chsize exists
10713 set chsize d_chsize
10716 : see if class exists
10720 : see if clearenv exists
10721 set clearenv d_clearenv
10724 hasstruct='varname=$1; struct=$2; shift; shift;
10725 while $test $# -ge 2; do
10727 $define) echo "#include <$2>";;
10731 echo "int main () { struct $struct foo; }" >> try.c;
10733 if eval $compile; then
10740 $rm -f try.c try.o'
10744 : see whether socket exists
10746 $echo $n "Hmm... $c" >&4
10747 if set socket val -f d_socket; eval $csym; $val; then
10748 echo "Looks like you have Berkeley networking support." >&4
10750 if set setsockopt val -f; eval $csym; $val; then
10753 echo "...but it uses the old BSD 4.1c interface, rather than 4.2." >&4
10754 d_oldsock="$define"
10757 if $contains socklib libc.list >/dev/null 2>&1; then
10758 echo "Looks like you have Berkeley networking support." >&4
10760 : we will have to assume that it supports the 4.2 BSD interface
10763 echo "You don't have Berkeley networking in libc$_a..." >&4
10764 if test "X$d_socket" = "X$define"; then
10765 echo "...but you seem to believe that you have sockets." >&4
10767 for net in net socket
10769 if test -f /usr/lib/lib$net$_a; then
10770 ( ($nm $nm_opt /usr/lib/lib$net$_a | eval $nm_extract) || \
10771 $ar t /usr/lib/lib$net$_a) 2>/dev/null >> libc.list
10772 if $contains socket libc.list >/dev/null 2>&1; then
10777 echo "...but the Wollongong group seems to have hacked it in." >&4
10778 sockethdr="-I/usr/netinclude"
10781 echo "Found Berkeley sockets interface in lib$net." >&4
10782 if $contains setsockopt libc.list >/dev/null 2>&1; then
10785 echo "...using the old BSD 4.1c interface, rather than 4.2." >&4
10786 d_oldsock="$define"
10792 if test "X$d_socket" != "X$define"; then
10793 echo "or anywhere else I see." >&4
10801 : see if socketpair exists
10802 set socketpair d_sockpair
10807 echo "Checking the availability of certain socket constants..." >&4
10808 for ENUM in MSG_CTRUNC MSG_DONTROUTE MSG_OOB MSG_PEEK MSG_PROXY SCM_RIGHTS; do
10809 enum=`$echo $ENUM|./tr '[A-Z]' '[a-z]'`
10811 #include <sys/types.h>
10812 #include <sys/socket.h>
10818 set try; if eval $compile; then
10821 set d_${enum}; eval $setvar
10825 : see if this is a sys/uio.h system
10826 set sys/uio.h i_sysuio
10831 echo "Checking to see if your system supports struct cmsghdr..." >&4
10832 set d_cmsghdr_s cmsghdr $i_systypes sys/types.h $d_socket sys/socket.h $i_sysuio sys/uio.h
10834 case "$d_cmsghdr_s" in
10835 "$define") echo "Yes, it does." ;;
10836 *) echo "No, it doesn't." ;;
10840 : check for const keyword
10842 echo 'Checking to see if your C compiler knows about "const"...' >&4
10843 $cat >const.c <<'EOCP'
10844 typedef struct spug { int drokk; } spug;
10851 if $cc -c $ccflags const.c >/dev/null 2>&1 ; then
10853 echo "Yup, it does."
10856 echo "Nope, it doesn't."
10861 : see if copysignl exists
10862 set copysignl d_copysignl
10865 : see if crypt exists
10870 $define) cryptlib='' ;;
10871 *) if set crypt val -f d_crypt; eval $csym; $val; then
10872 echo 'crypt() found.' >&4
10876 cryptlib=`./loc Slibcrypt$_a "" $xlibpth`
10877 if $test -z "$cryptlib"; then
10878 cryptlib=`./loc Mlibcrypt$_a "" $xlibpth`
10882 if $test -z "$cryptlib"; then
10883 cryptlib=`./loc Llibcrypt$_a "" $xlibpth`
10887 if $test -z "$cryptlib"; then
10888 cryptlib=`./loc libcrypt$_a "" $libpth`
10892 if $test -z "$cryptlib"; then
10893 echo 'crypt() NOT found.' >&4
10904 : see if this is a crypt.h system
10905 set crypt.h i_crypt
10908 : see if crypt_r exists
10909 set crypt_r d_crypt_r
10911 case "$d_crypt_r" in
10913 hdrs="$i_systypes sys/types.h define stdio.h $i_crypt crypt.h"
10914 case "$d_crypt_r_proto:$usethreads" in
10915 ":define") d_crypt_r_proto=define
10916 set d_crypt_r_proto crypt_r $hdrs
10920 case "$d_crypt_r_proto" in
10922 case "$crypt_r_proto" in
10923 ''|0) try='char* crypt_r(const char*, const char*, struct crypt_data*);'
10924 ./protochk "extern $try" $hdrs && crypt_r_proto=B_CCS ;;
10926 case "$crypt_r_proto" in
10927 ''|0) try='char* crypt_r(const char*, const char*, CRYPTD*);'
10928 ./protochk "extern $try" $hdrs && crypt_r_proto=B_CCD ;;
10930 case "$crypt_r_proto" in
10931 ''|0) d_crypt_r=undef
10933 echo "Disabling crypt_r, cannot determine prototype." >&4 ;;
10934 * ) case "$crypt_r_proto" in
10935 REENTRANT_PROTO*) ;;
10936 *) crypt_r_proto="REENTRANT_PROTO_$crypt_r_proto" ;;
10938 echo "Prototype: $try" ;;
10941 *) case "$usethreads" in
10942 define) echo "crypt_r has no prototype, not using it." >&4 ;;
10953 : get csh whereabouts
10955 'csh') val="$undef" ;;
10956 *) val="$define" ;;
10960 : Respect a hint or command line value for full_csh.
10961 case "$full_csh" in
10962 '') full_csh=$csh ;;
10965 : see if ctermid_r exists
10966 set ctermid_r d_ctermid_r
10968 case "$d_ctermid_r" in
10970 hdrs="$i_systypes sys/types.h define stdio.h "
10971 case "$d_ctermid_r_proto:$usethreads" in
10972 ":define") d_ctermid_r_proto=define
10973 set d_ctermid_r_proto ctermid_r $hdrs
10977 case "$d_ctermid_r_proto" in
10979 case "$ctermid_r_proto" in
10980 ''|0) try='char* ctermid_r(char*);'
10981 ./protochk "extern $try" $hdrs && ctermid_r_proto=B_B ;;
10983 case "$ctermid_r_proto" in
10984 ''|0) d_ctermid_r=undef
10986 echo "Disabling ctermid_r, cannot determine prototype." >&4 ;;
10987 * ) case "$ctermid_r_proto" in
10988 REENTRANT_PROTO*) ;;
10989 *) ctermid_r_proto="REENTRANT_PROTO_$ctermid_r_proto" ;;
10991 echo "Prototype: $try" ;;
10994 *) case "$usethreads" in
10995 define) echo "ctermid_r has no prototype, not using it." >&4 ;;
11002 *) ctermid_r_proto=0
11006 : see if ctime_r exists
11007 set ctime_r d_ctime_r
11009 case "$d_ctime_r" in
11011 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
11012 case "$d_ctime_r_proto:$usethreads" in
11013 ":define") d_ctime_r_proto=define
11014 set d_ctime_r_proto ctime_r $hdrs
11018 case "$d_ctime_r_proto" in
11020 case "$ctime_r_proto" in
11021 ''|0) try='char* ctime_r(const time_t*, char*);'
11022 ./protochk "extern $try" $hdrs && ctime_r_proto=B_SB ;;
11024 case "$ctime_r_proto" in
11025 ''|0) try='char* ctime_r(const time_t*, char*, int);'
11026 ./protochk "extern $try" $hdrs && ctime_r_proto=B_SBI ;;
11028 case "$ctime_r_proto" in
11029 ''|0) try='int ctime_r(const time_t*, char*);'
11030 ./protochk "extern $try" $hdrs && ctime_r_proto=I_SB ;;
11032 case "$ctime_r_proto" in
11033 ''|0) try='int ctime_r(const time_t*, char*, int);'
11034 ./protochk "extern $try" $hdrs && ctime_r_proto=I_SBI ;;
11036 case "$ctime_r_proto" in
11037 ''|0) d_ctime_r=undef
11039 echo "Disabling ctime_r, cannot determine prototype." >&4 ;;
11040 * ) case "$ctime_r_proto" in
11041 REENTRANT_PROTO*) ;;
11042 *) ctime_r_proto="REENTRANT_PROTO_$ctime_r_proto" ;;
11044 echo "Prototype: $try" ;;
11047 *) case "$usethreads" in
11048 define) echo "ctime_r has no prototype, not using it." >&4 ;;
11059 : see if cuserid exists
11060 set cuserid d_cuserid
11063 : see if this is a limits.h system
11064 set limits.h i_limits
11067 : see if this is a float.h system
11068 set float.h i_float
11071 : See if number of significant digits in a double precision number is known
11073 $cat >dbl_dig.c <<EOM
11074 #$i_limits I_LIMITS
11077 #include <limits.h>
11083 printf("Contains DBL_DIG");
11086 $cppstdin $cppflags $cppminus < dbl_dig.c >dbl_dig.E 2>/dev/null
11087 if $contains 'DBL_DIG' dbl_dig.E >/dev/null 2>&1; then
11088 echo "DBL_DIG found." >&4
11091 echo "DBL_DIG NOT found." >&4
11098 : see if dbm.h is available
11099 : see if dbmclose exists
11100 set dbmclose d_dbmclose
11103 case "$d_dbmclose" in
11113 *) set rpcsvc/dbm.h i_rpcsvcdbm
11118 *) echo "We won't be including <dbm.h>"
11128 : see if prototype for dbminit is available
11130 set d_dbminitproto dbminit $i_dbm dbm.h
11133 : see if difftime exists
11134 set difftime d_difftime
11137 : see if this is a dirent system
11139 if xinc=`./findhdr dirent.h`; $test "$xinc"; then
11141 echo "<dirent.h> found." >&4
11144 if xinc=`./findhdr sys/dir.h`; $test "$xinc"; then
11145 echo "<sys/dir.h> found." >&4
11148 xinc=`./findhdr sys/ndir.h`
11150 echo "<dirent.h> NOT found." >&4
11155 : Look for type of directory structure.
11157 $cppstdin $cppflags $cppminus < "$xinc" > try.c
11159 case "$direntrytype" in
11161 case "$i_dirent" in
11162 $define) guess1='struct dirent' ;;
11163 *) guess1='struct direct' ;;
11166 *) guess1="$direntrytype"
11171 'struct dirent') guess2='struct direct' ;;
11172 *) guess2='struct dirent' ;;
11175 if $contains "$guess1" try.c >/dev/null 2>&1; then
11176 direntrytype="$guess1"
11177 echo "Your directory entries are $direntrytype." >&4
11178 elif $contains "$guess2" try.c >/dev/null 2>&1; then
11179 direntrytype="$guess2"
11180 echo "Your directory entries seem to be $direntrytype." >&4
11182 echo "I don't recognize your system's directory entries." >&4
11183 rp="What type is used for directory entries on this system?"
11186 direntrytype="$ans"
11191 : see if the directory entry stores field length
11193 $cppstdin $cppflags $cppminus < "$xinc" > try.c
11194 if $contains 'd_namlen' try.c >/dev/null 2>&1; then
11195 echo "Good, your directory entry keeps length information in d_namlen." >&4
11198 echo "Your directory entry does not know about the d_namlen field." >&4
11205 : see if this is an sysdir system
11206 set sys/dir.h i_sysdir
11209 : see if this is an sysndir system
11210 set sys/ndir.h i_sysndir
11215 $cat >dirfd.c <<EOM
11217 #$i_stdlib I_STDLIB
11219 #include <stdlib.h>
11221 #$i_dirent I_DIRENT /**/
11222 #$i_sysdir I_SYS_DIR /**/
11223 #$i_sysndir I_SYS_NDIR /**/
11224 #$i_systypes I_SYS_TYPES /**/
11225 #if defined(I_SYS_TYPES)
11226 #include <sys/types.h>
11228 #if defined(I_DIRENT)
11229 #include <dirent.h>
11230 #if defined(NeXT) && defined(I_SYS_DIR) /* NeXT needs dirent + sys/dir.h */
11231 #include <sys/dir.h>
11235 #include <sys/ndir.h>
11239 #include <ndir.h> /* may be wrong in the future */
11241 #include <sys/dir.h>
11247 DIR *dirp = opendir(".");
11248 if (dirfd(dirp) >= 0)
11256 if eval $compile; then
11260 $define) echo "dirfd() found." >&4 ;;
11261 *) echo "dirfd() NOT found." >&4 ;;
11267 : see if dlerror exists
11270 set dlerror d_dlerror
11274 : see if dlfcn is available
11275 set dlfcn.h i_dlfcn
11282 On a few systems, the dynamically loaded modules that perl generates and uses
11283 will need a different extension than shared libs. The default will probably
11289 *) dflt="$dlext" ;;
11291 rp='What is the extension of dynamically loaded modules'
11300 : Check if dlsym need a leading underscore
11306 echo "Checking whether your dlsym() needs a leading underscore ..." >&4
11307 $cat >dyna.c <<'EOM'
11314 #$i_stdlib I_STDLIB
11316 #include <stdlib.h>
11320 #include <dlfcn.h> /* the dynamic linker include file for SunOS/Solaris */
11322 #include <sys/types.h>
11327 extern int fred() ;
11336 int mode = RTLD_LAZY ;
11338 handle = dlopen("./dyna.$dlext", mode) ;
11339 if (handle == NULL) {
11344 symbol = dlsym(handle, "fred") ;
11345 if (symbol == NULL) {
11346 /* try putting a leading underscore */
11347 symbol = dlsym(handle, "_fred") ;
11348 if (symbol == NULL) {
11361 : Call the object file tmp-dyna.o in case dlext=o.
11362 if $cc $ccflags $cccdlflags -c dyna.c > /dev/null 2>&1 &&
11363 mv dyna${_o} tmp-dyna${_o} > /dev/null 2>&1 &&
11364 $ld -o dyna.$dlext $ldflags $lddlflags tmp-dyna${_o} > /dev/null 2>&1 &&
11365 $cc -o fred $ccflags $ldflags $cccdlflags $ccdlflags fred.c $libs > /dev/null 2>&1 && $to dyna.$dlext; then
11368 1) echo "Test program failed using dlopen." >&4
11369 echo "Perhaps you should not use dynamic loading." >&4;;
11370 2) echo "Test program failed using dlsym." >&4
11371 echo "Perhaps you should not use dynamic loading." >&4;;
11372 3) echo "dlsym needs a leading underscore" >&4
11374 4) echo "dlsym doesn't need a leading underscore." >&4;;
11377 echo "I can't compile and run the test program." >&4
11378 echo "I'm guessing that dlsym doesn't need a leading underscore." >&4
11383 $rm -f fred fred.* dyna.$dlext dyna.* tmp-dyna.*
11388 : see if drand48_r exists
11389 set drand48_r d_drand48_r
11391 case "$d_drand48_r" in
11393 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
11394 case "$d_drand48_r_proto:$usethreads" in
11395 ":define") d_drand48_r_proto=define
11396 set d_drand48_r_proto drand48_r $hdrs
11400 case "$d_drand48_r_proto" in
11402 case "$drand48_r_proto" in
11403 ''|0) try='int drand48_r(struct drand48_data*, double*);'
11404 ./protochk "extern $try" $hdrs && drand48_r_proto=I_ST ;;
11406 case "$drand48_r_proto" in
11407 ''|0) d_drand48_r=undef
11409 echo "Disabling drand48_r, cannot determine prototype." >&4 ;;
11410 * ) case "$drand48_r_proto" in
11411 REENTRANT_PROTO*) ;;
11412 *) drand48_r_proto="REENTRANT_PROTO_$drand48_r_proto" ;;
11414 echo "Prototype: $try" ;;
11417 *) case "$usethreads" in
11418 define) echo "drand48_r has no prototype, not using it." >&4 ;;
11425 *) drand48_r_proto=0
11429 : see if prototype for drand48 is available
11431 set d_drand48proto drand48 $i_stdlib stdlib.h $i_unistd unistd.h
11434 : see if dup2 exists
11438 : see if eaccess exists
11439 set eaccess d_eaccess
11442 : see if endgrent exists
11443 set endgrent d_endgrent
11446 : see if this is an grp system
11452 xxx=`./findhdr grp.h`
11453 $cppstdin $cppflags $cppminus < $xxx >$$.h
11455 if $contains 'gr_passwd' $$.h >/dev/null 2>&1; then
11467 set d_grpasswd; eval $setvar
11471 : see if endgrent_r exists
11472 set endgrent_r d_endgrent_r
11474 case "$d_endgrent_r" in
11476 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
11477 case "$d_endgrent_r_proto:$usethreads" in
11478 ":define") d_endgrent_r_proto=define
11479 set d_endgrent_r_proto endgrent_r $hdrs
11483 case "$d_endgrent_r_proto" in
11485 case "$endgrent_r_proto" in
11486 ''|0) try='int endgrent_r(FILE**);'
11487 ./protochk "extern $try" $hdrs && endgrent_r_proto=I_H ;;
11489 case "$endgrent_r_proto" in
11490 ''|0) try='void endgrent_r(FILE**);'
11491 ./protochk "extern $try" $hdrs && endgrent_r_proto=V_H ;;
11493 case "$endgrent_r_proto" in
11494 ''|0) d_endgrent_r=undef
11496 echo "Disabling endgrent_r, cannot determine prototype." >&4 ;;
11497 * ) case "$endgrent_r_proto" in
11498 REENTRANT_PROTO*) ;;
11499 *) endgrent_r_proto="REENTRANT_PROTO_$endgrent_r_proto" ;;
11501 echo "Prototype: $try" ;;
11504 *) case "$usethreads" in
11505 define) echo "endgrent_r has no prototype, not using it." >&4 ;;
11512 *) endgrent_r_proto=0
11516 : see if endhostent exists
11517 set endhostent d_endhent
11520 : see if this is a netdb.h system
11521 set netdb.h i_netdb
11524 : see if endhostent_r exists
11525 set endhostent_r d_endhostent_r
11527 case "$d_endhostent_r" in
11529 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
11530 case "$d_endhostent_r_proto:$usethreads" in
11531 ":define") d_endhostent_r_proto=define
11532 set d_endhostent_r_proto endhostent_r $hdrs
11536 case "$d_endhostent_r_proto" in
11538 case "$endhostent_r_proto" in
11539 ''|0) try='int endhostent_r(struct hostent_data*);'
11540 ./protochk "extern $try" $hdrs && endhostent_r_proto=I_D ;;
11542 case "$endhostent_r_proto" in
11543 ''|0) try='void endhostent_r(struct hostent_data*);'
11544 ./protochk "extern $try" $hdrs && endhostent_r_proto=V_D ;;
11546 case "$endhostent_r_proto" in
11547 ''|0) d_endhostent_r=undef
11548 endhostent_r_proto=0
11549 echo "Disabling endhostent_r, cannot determine prototype." >&4 ;;
11550 * ) case "$endhostent_r_proto" in
11551 REENTRANT_PROTO*) ;;
11552 *) endhostent_r_proto="REENTRANT_PROTO_$endhostent_r_proto" ;;
11554 echo "Prototype: $try" ;;
11557 *) case "$usethreads" in
11558 define) echo "endhostent_r has no prototype, not using it." >&4 ;;
11560 d_endhostent_r=undef
11561 endhostent_r_proto=0
11565 *) endhostent_r_proto=0
11569 : see if endnetent exists
11570 set endnetent d_endnent
11573 : see if endnetent_r exists
11574 set endnetent_r d_endnetent_r
11576 case "$d_endnetent_r" in
11578 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
11579 case "$d_endnetent_r_proto:$usethreads" in
11580 ":define") d_endnetent_r_proto=define
11581 set d_endnetent_r_proto endnetent_r $hdrs
11585 case "$d_endnetent_r_proto" in
11587 case "$endnetent_r_proto" in
11588 ''|0) try='int endnetent_r(struct netent_data*);'
11589 ./protochk "extern $try" $hdrs && endnetent_r_proto=I_D ;;
11591 case "$endnetent_r_proto" in
11592 ''|0) try='void endnetent_r(struct netent_data*);'
11593 ./protochk "extern $try" $hdrs && endnetent_r_proto=V_D ;;
11595 case "$endnetent_r_proto" in
11596 ''|0) d_endnetent_r=undef
11597 endnetent_r_proto=0
11598 echo "Disabling endnetent_r, cannot determine prototype." >&4 ;;
11599 * ) case "$endnetent_r_proto" in
11600 REENTRANT_PROTO*) ;;
11601 *) endnetent_r_proto="REENTRANT_PROTO_$endnetent_r_proto" ;;
11603 echo "Prototype: $try" ;;
11606 *) case "$usethreads" in
11607 define) echo "endnetent_r has no prototype, not using it." >&4 ;;
11609 d_endnetent_r=undef
11610 endnetent_r_proto=0
11614 *) endnetent_r_proto=0
11618 : see if endprotoent exists
11619 set endprotoent d_endpent
11622 : see if endprotoent_r exists
11623 set endprotoent_r d_endprotoent_r
11625 case "$d_endprotoent_r" in
11627 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
11628 case "$d_endprotoent_r_proto:$usethreads" in
11629 ":define") d_endprotoent_r_proto=define
11630 set d_endprotoent_r_proto endprotoent_r $hdrs
11634 case "$d_endprotoent_r_proto" in
11636 case "$endprotoent_r_proto" in
11637 ''|0) try='int endprotoent_r(struct protoent_data*);'
11638 ./protochk "extern $try" $hdrs && endprotoent_r_proto=I_D ;;
11640 case "$endprotoent_r_proto" in
11641 ''|0) try='void endprotoent_r(struct protoent_data*);'
11642 ./protochk "extern $try" $hdrs && endprotoent_r_proto=V_D ;;
11644 case "$endprotoent_r_proto" in
11645 ''|0) d_endprotoent_r=undef
11646 endprotoent_r_proto=0
11647 echo "Disabling endprotoent_r, cannot determine prototype." >&4 ;;
11648 * ) case "$endprotoent_r_proto" in
11649 REENTRANT_PROTO*) ;;
11650 *) endprotoent_r_proto="REENTRANT_PROTO_$endprotoent_r_proto" ;;
11652 echo "Prototype: $try" ;;
11655 *) case "$usethreads" in
11656 define) echo "endprotoent_r has no prototype, not using it." >&4 ;;
11658 d_endprotoent_r=undef
11659 endprotoent_r_proto=0
11663 *) endprotoent_r_proto=0
11667 : see if endpwent exists
11668 set endpwent d_endpwent
11671 : see if this is a pwd.h system
11677 xxx=`./findhdr pwd.h`
11678 $cppstdin $cppflags $cppminus < $xxx >$$.h
11680 if $contains 'pw_quota' $$.h >/dev/null 2>&1; then
11688 if $contains 'pw_age' $$.h >/dev/null 2>&1; then
11696 if $contains 'pw_change' $$.h >/dev/null 2>&1; then
11704 if $contains 'pw_class' $$.h >/dev/null 2>&1; then
11712 if $contains 'pw_expire' $$.h >/dev/null 2>&1; then
11720 if $contains 'pw_comment' $$.h >/dev/null 2>&1; then
11728 if $contains 'pw_gecos' $$.h >/dev/null 2>&1; then
11736 if $contains 'pw_passwd' $$.h >/dev/null 2>&1; then
11748 set d_pwquota; eval $setvar
11749 set d_pwage; eval $setvar
11750 set d_pwchange; eval $setvar
11751 set d_pwclass; eval $setvar
11752 set d_pwexpire; eval $setvar
11753 set d_pwcomment; eval $setvar
11754 set d_pwgecos; eval $setvar
11755 set d_pwpasswd; eval $setvar
11759 : see if endpwent_r exists
11760 set endpwent_r d_endpwent_r
11762 case "$d_endpwent_r" in
11764 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
11765 case "$d_endpwent_r_proto:$usethreads" in
11766 ":define") d_endpwent_r_proto=define
11767 set d_endpwent_r_proto endpwent_r $hdrs
11771 case "$d_endpwent_r_proto" in
11773 case "$endpwent_r_proto" in
11774 ''|0) try='int endpwent_r(FILE**);'
11775 ./protochk "extern $try" $hdrs && endpwent_r_proto=I_H ;;
11777 case "$endpwent_r_proto" in
11778 ''|0) try='void endpwent_r(FILE**);'
11779 ./protochk "extern $try" $hdrs && endpwent_r_proto=V_H ;;
11781 case "$endpwent_r_proto" in
11782 ''|0) d_endpwent_r=undef
11784 echo "Disabling endpwent_r, cannot determine prototype." >&4 ;;
11785 * ) case "$endpwent_r_proto" in
11786 REENTRANT_PROTO*) ;;
11787 *) endpwent_r_proto="REENTRANT_PROTO_$endpwent_r_proto" ;;
11789 echo "Prototype: $try" ;;
11792 *) case "$usethreads" in
11793 define) echo "endpwent_r has no prototype, not using it." >&4 ;;
11800 *) endpwent_r_proto=0
11804 : see if endservent exists
11805 set endservent d_endsent
11808 : see if endservent_r exists
11809 set endservent_r d_endservent_r
11811 case "$d_endservent_r" in
11813 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
11814 case "$d_endservent_r_proto:$usethreads" in
11815 ":define") d_endservent_r_proto=define
11816 set d_endservent_r_proto endservent_r $hdrs
11820 case "$d_endservent_r_proto" in
11822 case "$endservent_r_proto" in
11823 ''|0) try='int endservent_r(struct servent_data*);'
11824 ./protochk "extern $try" $hdrs && endservent_r_proto=I_D ;;
11826 case "$endservent_r_proto" in
11827 ''|0) try='void endservent_r(struct servent_data*);'
11828 ./protochk "extern $try" $hdrs && endservent_r_proto=V_D ;;
11830 case "$endservent_r_proto" in
11831 ''|0) d_endservent_r=undef
11832 endservent_r_proto=0
11833 echo "Disabling endservent_r, cannot determine prototype." >&4 ;;
11834 * ) case "$endservent_r_proto" in
11835 REENTRANT_PROTO*) ;;
11836 *) endservent_r_proto="REENTRANT_PROTO_$endservent_r_proto" ;;
11838 echo "Prototype: $try" ;;
11841 *) case "$usethreads" in
11842 define) echo "endservent_r has no prototype, not using it." >&4 ;;
11844 d_endservent_r=undef
11845 endservent_r_proto=0
11849 *) endservent_r_proto=0
11853 : Locate the flags for 'open()'
11856 #include <sys/types.h>
11861 #include <sys/file.h>
11863 #$i_stdlib I_STDLIB
11865 #include <stdlib.h>
11876 : check sys/file.h first to get FREAD on Sun
11877 if $test `./findhdr sys/file.h` && \
11878 set try -DI_SYS_FILE && eval $compile; then
11880 echo "<sys/file.h> defines the O_* constants..." >&4
11881 if $run ./try; then
11882 echo "and you have the 3 argument form of open()." >&4
11885 echo "but not the 3 argument form of open(). Oh, well." >&4
11888 elif $test `./findhdr fcntl.h` && \
11889 set try -DI_FCNTL && eval $compile; then
11891 echo "<fcntl.h> defines the O_* constants..." >&4
11892 if $run ./try; then
11893 echo "and you have the 3 argument form of open()." >&4
11896 echo "but not the 3 argument form of open(). Oh, well." >&4
11901 echo "I can't find the O_* constant definitions! You got problems." >&4
11907 : see which of string.h or strings.h is needed
11909 strings=`./findhdr string.h`
11910 if $test "$strings" && $test -r "$strings"; then
11911 echo "Using <string.h> instead of <strings.h>." >&4
11915 strings=`./findhdr strings.h`
11916 if $test "$strings" && $test -r "$strings"; then
11917 echo "Using <strings.h> instead of <string.h>." >&4
11919 echo "No string header found -- You'll surely have problems." >&4
11924 case "$i_string" in
11925 "$undef") strings=`./findhdr strings.h`;;
11926 *) strings=`./findhdr string.h`;;
11929 : see if this is a sys/file.h system
11934 : do we need to include sys/file.h ?
11938 if $h_sysfile; then
11940 echo "We'll be including <sys/file.h>." >&4
11943 echo "We won't be including <sys/file.h>." >&4
11953 : see if fcntl.h is there
11958 : see if we can include fcntl.h
11964 echo "We'll be including <fcntl.h>." >&4
11967 if $h_sysfile; then
11968 echo "We don't need to include <fcntl.h> if we include <sys/file.h>." >&4
11970 echo "We won't be including <fcntl.h>." >&4
11982 : check for non-blocking I/O stuff
11983 case "$h_sysfile" in
11984 true) echo "#include <sys/file.h>" > head.c;;
11987 true) echo "#include <fcntl.h>" > head.c;;
11988 *) echo "#include <sys/fcntl.h>" > head.c;;
11993 echo "Figuring out the flag used by open() for non-blocking I/O..." >&4
11994 case "$o_nonblock" in
11996 $cat head.c > try.c
11997 $cat >>try.c <<EOCP
11999 #$i_stdlib I_STDLIB
12001 #include <stdlib.h>
12009 printf("O_NONBLOCK\n");
12013 printf("O_NDELAY\n");
12017 printf("FNDELAY\n");
12024 if eval $compile_ok; then
12025 o_nonblock=`$run ./try`
12026 case "$o_nonblock" in
12027 '') echo "I can't figure it out, assuming O_NONBLOCK will do.";;
12028 *) echo "Seems like we can use $o_nonblock.";;
12031 echo "(I can't compile the test program; pray O_NONBLOCK is right!)"
12034 *) echo "Using $hint value $o_nonblock.";;
12036 $rm -f try try.* .out core
12039 echo "Let's see what value errno gets from read() on a $o_nonblock file..." >&4
12042 $cat head.c > try.c
12043 $cat >>try.c <<EOCP
12045 #include <sys/types.h>
12046 #include <signal.h>
12048 #$i_stdlib I_STDLIB
12050 #include <stdlib.h>
12056 #define MY_O_NONBLOCK $o_nonblock
12057 #ifndef errno /* XXX need better Configure test */
12060 #$i_unistd I_UNISTD
12062 #include <unistd.h>
12064 #$i_string I_STRING
12066 #include <string.h>
12068 #include <strings.h>
12070 $signal_t blech(int x) { exit(3); }
12072 $cat >> try.c <<'EOCP'
12080 pipe(pd); /* Down: child -> parent */
12081 pipe(pu); /* Up: parent -> child */
12084 close(pd[1]); /* Parent reads from pd[0] */
12085 close(pu[0]); /* Parent writes (blocking) to pu[1] */
12087 if (-1 == fcntl(pd[0], F_SETFL, MY_O_NONBLOCK))
12092 signal(SIGALRM, blech);
12094 if ((ret = read(pd[0], buf, 1)) > 0) /* Nothing to read! */
12096 sprintf(string, "%d\n", ret);
12097 write(2, string, strlen(string));
12100 if (errno == EAGAIN) {
12101 printf("EAGAIN\n");
12106 if (errno == EWOULDBLOCK)
12107 printf("EWOULDBLOCK\n");
12110 write(pu[1], buf, 1); /* Unblocks child, tell it to close our pipe */
12111 sleep(2); /* Give it time to close our pipe */
12113 ret = read(pd[0], buf, 1); /* Should read EOF */
12115 sprintf(string, "%d\n", ret);
12116 write(4, string, strlen(string));
12120 close(pd[0]); /* We write to pd[1] */
12121 close(pu[1]); /* We read from pu[0] */
12122 read(pu[0], buf, 1); /* Wait for parent to signal us we may continue */
12123 close(pd[1]); /* Pipe pd is now fully closed! */
12124 exit(0); /* Bye bye, thank you for playing! */
12128 if eval $compile_ok; then
12129 echo "$startsh" >mtry
12130 echo "$run ./try >try.out 2>try.ret 4>try.err || exit 4" >>mtry
12132 ./mtry >/dev/null 2>&1
12134 0) eagain=`$cat try.out`;;
12135 1) echo "Could not perform non-blocking setting!";;
12136 2) echo "I did a successful read() for something that was not there!";;
12137 3) echo "Hmm... non-blocking I/O does not seem to be working!";;
12138 4) echo "Could not find F_SETFL!";;
12139 *) echo "Something terribly wrong happened during testing.";;
12141 rd_nodata=`$cat try.ret`
12142 echo "A read() system call with no data present returns $rd_nodata."
12143 case "$rd_nodata" in
12146 echo "(That's peculiar, fixing that to be -1.)"
12152 echo "Forcing errno EAGAIN on read() with no data available."
12156 echo "Your read() sets errno to $eagain when no data is available."
12159 status=`$cat try.err`
12161 0) echo "And it correctly returns 0 to signal EOF.";;
12162 -1) echo "But it also returns -1 to signal EOF, so be careful!";;
12163 *) echo "However, your read() returns '$status' on EOF??";;
12166 if test "$status" = "$rd_nodata"; then
12167 echo "WARNING: you can't distinguish between EOF and no data!"
12171 echo "I can't compile the test program--assuming errno EAGAIN will do."
12178 echo "Using $hint value $eagain."
12179 echo "Your read() returns $rd_nodata when no data is present."
12180 case "$d_eofnblk" in
12181 "$define") echo "And you can see EOF because read() returns 0.";;
12182 "$undef") echo "But you can't see EOF status from read() returned value.";;
12184 echo "(Assuming you can't see EOF status from read anyway.)"
12190 $rm -f try try.* .out core head.c mtry
12192 : see if _ptr and _cnt from stdio act std
12195 if $contains '_lbfsize' `./findhdr stdio.h` >/dev/null 2>&1 ; then
12196 echo "(Looks like you have stdio.h from BSD.)"
12197 case "$stdio_ptr" in
12198 '') stdio_ptr='((fp)->_p)'
12201 *) ptr_lval=$d_stdio_ptr_lval;;
12203 case "$stdio_cnt" in
12204 '') stdio_cnt='((fp)->_r)'
12207 *) cnt_lval=$d_stdio_cnt_lval;;
12209 case "$stdio_base" in
12210 '') stdio_base='((fp)->_ub._base ? (fp)->_ub._base : (fp)->_bf._base)';;
12212 case "$stdio_bufsiz" in
12213 '') stdio_bufsiz='((fp)->_ub._base ? (fp)->_ub._size : (fp)->_bf._size)';;
12215 elif $contains '_IO_fpos_t' `./findhdr stdio.h` `./findhdr libio.h` >/dev/null 2>&1 ; then
12216 echo "(Looks like you have stdio.h from Linux.)"
12217 case "$stdio_ptr" in
12218 '') stdio_ptr='((fp)->_IO_read_ptr)'
12221 *) ptr_lval=$d_stdio_ptr_lval;;
12223 case "$stdio_cnt" in
12224 '') stdio_cnt='((fp)->_IO_read_end - (fp)->_IO_read_ptr)'
12227 *) cnt_lval=$d_stdio_cnt_lval;;
12229 case "$stdio_base" in
12230 '') stdio_base='((fp)->_IO_read_base)';;
12232 case "$stdio_bufsiz" in
12233 '') stdio_bufsiz='((fp)->_IO_read_end - (fp)->_IO_read_base)';;
12236 case "$stdio_ptr" in
12237 '') stdio_ptr='((fp)->_ptr)'
12240 *) ptr_lval=$d_stdio_ptr_lval;;
12242 case "$stdio_cnt" in
12243 '') stdio_cnt='((fp)->_cnt)'
12246 *) cnt_lval=$d_stdio_cnt_lval;;
12248 case "$stdio_base" in
12249 '') stdio_base='((fp)->_base)';;
12251 case "$stdio_bufsiz" in
12252 '') stdio_bufsiz='((fp)->_cnt + (fp)->_ptr - (fp)->_base)';;
12256 : test whether _ptr and _cnt really work
12257 echo "Checking how std your stdio is..." >&4
12260 #$i_stdlib I_STDLIB
12262 #include <stdlib.h>
12264 #define FILE_ptr(fp) $stdio_ptr
12265 #define FILE_cnt(fp) $stdio_cnt
12267 FILE *fp = fopen("try.c", "r");
12270 18 <= FILE_cnt(fp) &&
12271 strncmp(FILE_ptr(fp), "include <stdio.h>\n", 18) == 0
12279 if eval $compile && $to try.c; then
12280 if $run ./try; then
12281 echo "Your stdio acts pretty std."
12284 echo "Your stdio isn't very std."
12287 echo "Your stdio doesn't appear very std."
12291 # glibc 2.2.90 and above apparently change stdio streams so Perl's
12292 # direct buffer manipulation no longer works. The Configure tests
12293 # should be changed to correctly detect this, but until then,
12294 # the following check should at least let perl compile and run.
12295 # (This quick fix should be updated before 5.8.1.)
12296 # To be defensive, reject all unknown versions, and all versions > 2.2.9.
12297 # A. Dougherty, June 3, 2002.
12298 case "$d_gnulibc" in
12300 case "$gnulibc_version" in
12304 *) echo "But I will not snoop inside glibc $gnulibc_version stdio buffers."
12313 : Can _ptr be used as an lvalue?
12314 case "$d_stdstdio$ptr_lval" in
12315 $define$define) val=$define ;;
12318 set d_stdio_ptr_lval
12321 : Can _cnt be used as an lvalue?
12322 case "$d_stdstdio$cnt_lval" in
12323 $define$define) val=$define ;;
12326 set d_stdio_cnt_lval
12330 : test whether setting _ptr sets _cnt as a side effect
12331 d_stdio_ptr_lval_sets_cnt="$undef"
12332 d_stdio_ptr_lval_nochange_cnt="$undef"
12333 case "$d_stdio_ptr_lval$d_stdstdio" in
12335 echo "Checking to see what happens if we set the stdio ptr..." >&4
12338 /* Can we scream? */
12339 /* Eat dust sed :-) */
12340 /* In the buffer space, no one can hear you scream. */
12341 #$i_stdlib I_STDLIB
12343 #include <stdlib.h>
12345 #define FILE_ptr(fp) $stdio_ptr
12346 #define FILE_cnt(fp) $stdio_cnt
12347 #include <sys/types.h>
12349 FILE *fp = fopen("try.c", "r");
12354 puts("Fail even to read");
12357 c = getc(fp); /* Read away the first # */
12359 puts("Fail even to read");
12363 18 <= FILE_cnt(fp) &&
12364 strncmp(FILE_ptr(fp), "include <stdio.h>\n", 18) == 0
12366 puts("Fail even to read");
12369 ptr = (char*) FILE_ptr(fp);
12370 cnt = (size_t)FILE_cnt(fp);
12372 FILE_ptr(fp) += 42;
12374 if ((char*)FILE_ptr(fp) != (ptr + 42)) {
12375 printf("Fail ptr check %p != %p", FILE_ptr(fp), (ptr + 42));
12378 if (FILE_cnt(fp) <= 20) {
12379 printf ("Fail (<20 chars to test)");
12382 if (strncmp(FILE_ptr(fp), "Eat dust sed :-) */\n", 20) != 0) {
12383 puts("Fail compare");
12386 if (cnt == FILE_cnt(fp)) {
12387 puts("Pass_unchanged");
12390 if (FILE_cnt(fp) == (cnt - 42)) {
12391 puts("Pass_changed");
12394 printf("Fail count was %d now %d\n", cnt, FILE_cnt(fp));
12400 if eval $compile && $to try.c; then
12401 case `$run ./try` in
12403 echo "Increasing ptr in your stdio decreases cnt by the same amount. Good." >&4
12404 d_stdio_ptr_lval_sets_cnt="$define" ;;
12406 echo "Increasing ptr in your stdio leaves cnt unchanged. Good." >&4
12407 d_stdio_ptr_lval_nochange_cnt="$define" ;;
12409 echo "Increasing ptr in your stdio didn't do exactly what I expected. We'll not be doing that then." >&4 ;;
12411 echo "It appears attempting to set ptr in your stdio is a bad plan." >&4 ;;
12414 echo "It seems we can't set ptr in your stdio. Nevermind." >&4
12420 : see if _base is also standard
12422 case "$d_stdstdio" in
12426 #$i_stdlib I_STDLIB
12428 #include <stdlib.h>
12430 #define FILE_base(fp) $stdio_base
12431 #define FILE_bufsiz(fp) $stdio_bufsiz
12433 FILE *fp = fopen("try.c", "r");
12436 19 <= FILE_bufsiz(fp) &&
12437 strncmp(FILE_base(fp), "#include <stdio.h>\n", 19) == 0
12444 if eval $compile && $to try.c; then
12445 if $run ./try; then
12446 echo "And its _base field acts std."
12449 echo "But its _base field isn't std."
12452 echo "However, it seems to be lacking the _base field."
12460 : see if fast_stdio exists
12462 case "$d_stdstdio:$d_stdio_ptr_lval" in
12464 case "$d_stdio_cnt_lval$d_stdio_ptr_lval_sets_cnt" in
12466 echo "You seem to have 'fast stdio' to directly manipulate the stdio buffers." >& 4
12477 : see if fchdir exists
12478 set fchdir d_fchdir
12481 : see if fchmod exists
12482 set fchmod d_fchmod
12485 : see if fchown exists
12486 set fchown d_fchown
12489 : see if this is an fcntl system
12494 : See if fcntl-based locking works.
12496 #$i_stdlib I_STDLIB
12498 #include <stdlib.h>
12500 #include <unistd.h>
12502 #include <signal.h>
12503 $signal_t blech(int x) { exit(3); }
12505 #if defined(F_SETLK) && defined(F_SETLKW)
12506 struct flock flock;
12508 fd = open("try.c", O_RDONLY);
12509 flock.l_type = F_RDLCK;
12510 flock.l_whence = SEEK_SET;
12511 flock.l_start = flock.l_len = 0;
12512 signal(SIGALRM, blech);
12514 retval = fcntl(fd, F_SETLK, &flock);
12516 (retval < 0 ? exit(2) : exit(0));
12522 echo "Checking if fcntl-based file locking works... "
12526 if eval $compile_ok; then
12527 if $run ./try; then
12528 echo "Yes, it seems to work."
12531 echo "Nope, it didn't work."
12536 *** I had to forcibly timeout from fcntl(..., F_SETLK, ...).
12537 *** This is (almost) impossible.
12538 *** If your NFS lock daemons are not feeling well, something like
12539 *** this may happen, please investigate. Cannot continue, aborting.
12547 echo "I'm unable to compile the test program, so I'll assume not."
12552 echo "Nope, since you don't even have fcntl()."
12555 set d_fcntl_can_lock
12560 : check for fd_set items
12563 Checking to see how well your C compiler handles fd_set and friends ...
12566 #$i_stdlib I_STDLIB
12568 #include <stdlib.h>
12570 #$i_systime I_SYS_TIME
12571 #$i_sysselct I_SYS_SELECT
12572 #$d_socket HAS_SOCKET
12573 #include <sys/types.h>
12575 #include <sys/socket.h> /* Might include <sys/bsdtypes.h> */
12578 #include <sys/time.h>
12580 #ifdef I_SYS_SELECT
12581 #include <sys/select.h>
12590 #if defined(FD_SET) && defined(FD_CLR) && defined(FD_ISSET) && defined(FD_ZERO)
12598 if eval $compile; then
12599 d_fds_bits="$define"
12601 echo "Well, your system knows about the normal fd_set typedef..." >&4
12602 if $run ./try; then
12603 echo "and you have the normal fd_set macros (just as I'd expect)." >&4
12604 d_fd_macros="$define"
12607 but not the normal fd_set macros! Gaaack! I'll have to cover for you.
12609 d_fd_macros="$undef"
12613 Hmm, your compiler has some difficulty with fd_set. Checking further...
12616 if eval $compile; then
12617 d_fds_bits="$undef"
12619 echo "Well, your system has some sort of fd_set available..." >&4
12620 if $run ./try; then
12621 echo "and you have the normal fd_set macros." >&4
12622 d_fd_macros="$define"
12625 but not the normal fd_set macros! Gross! More work for me...
12627 d_fd_macros="$undef"
12630 echo "Well, you got zip. That's OK, I can roll my own fd_set stuff." >&4
12632 d_fds_bits="$undef"
12633 d_fd_macros="$undef"
12638 : see if fgetpos exists
12639 set fgetpos d_fgetpos
12642 : see if finite exists
12643 set finite d_finite
12646 : see if finitel exists
12647 set finitel d_finitel
12650 : see if flock exists
12654 : see if prototype for flock is available
12656 set d_flockproto flock $i_sysfile sys/file.h
12659 : see if fork exists
12663 : see if fp_class exists
12664 set fp_class d_fp_class
12667 : see if pathconf exists
12668 set pathconf d_pathconf
12671 : see if fpathconf exists
12672 set fpathconf d_fpathconf
12675 : see if fpclass exists
12676 set fpclass d_fpclass
12679 : see if fpclassify exists
12680 set fpclassify d_fpclassify
12683 : see if fpclassl exists
12684 set fpclassl d_fpclassl
12688 : check for fpos64_t
12690 echo "Checking to see if you have fpos64_t..." >&4
12693 int main() { fpos64_t x = 7; }
12696 if eval $compile; then
12698 echo "You have fpos64_t."
12701 echo "You do not have fpos64_t."
12702 case "$fpossize" in
12703 8) echo "(Your fpos_t is 64 bits, so you could use that.)" ;;
12710 : see if frexpl exists
12711 set frexpl d_frexpl
12714 : see if this is a sys/param system
12715 set sys/param.h i_sysparam
12718 : see if this is a sys/mount.h system
12719 set sys/mount.h i_sysmount
12724 echo "Checking to see if your system supports struct fs_data..." >&4
12725 set d_fs_data_s fs_data $i_systypes sys/types.h $i_sysparam sys/param.h $i_sysmount sys/mount.h
12727 case "$d_fs_data_s" in
12728 "$define") echo "Yes, it does." ;;
12729 *) echo "No, it doesn't." ;;
12732 : see if fseeko exists
12733 set fseeko d_fseeko
12735 case "$longsize" in
12736 8) echo "(Your long is 64 bits, so you could use fseek.)" ;;
12739 : see if fsetpos exists
12740 set fsetpos d_fsetpos
12744 : see if fstatfs exists
12745 set fstatfs d_fstatfs
12749 : see if statvfs exists
12750 set statvfs d_statvfs
12753 : see if fstatvfs exists
12754 set fstatvfs d_fstatvfs
12758 : see if fsync exists
12762 : see if ftello exists
12763 set ftello d_ftello
12765 case "$longsize" in
12766 8) echo "(Your long is 64 bits, so you could use ftell.)" ;;
12770 : check for a working futimes
12772 echo "Checking for a working futimes()" >&4
12775 #include <sys/time.h>
12782 fd = open ("try.c", O_RDWR);
12783 if (-1 == fd) exit (1);
12784 rv = futimes (fd, NULL);
12785 exit (rv == -1 ? errno : 0);
12789 if eval $compile; then
12793 0) echo "Yes, it does" >&4
12794 d_futimes="$define"
12796 *) echo "No, it has futimes, but it isn't working ($rc) (probably harmless)\n" >&4
12800 echo "No, it does not (probably harmless)\n" >&4
12802 $rm -f try.* try core core.try.*
12804 : see if getcwd exists
12805 set getcwd d_getcwd
12808 : see if getespwnam exists
12809 set getespwnam d_getespwnam
12813 : see if getfsstat exists
12814 set getfsstat d_getfsstat
12817 : see if getgrent exists
12818 set getgrent d_getgrent
12821 : see if getgrent_r exists
12822 set getgrent_r d_getgrent_r
12824 case "$d_getgrent_r" in
12826 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
12827 case "$d_getgrent_r_proto:$usethreads" in
12828 ":define") d_getgrent_r_proto=define
12829 set d_getgrent_r_proto getgrent_r $hdrs
12833 case "$d_getgrent_r_proto" in
12835 case "$getgrent_r_proto" in
12836 ''|0) try='int getgrent_r(struct group*, char*, size_t, struct group**);'
12837 ./protochk "extern $try" $hdrs && getgrent_r_proto=I_SBWR ;;
12839 case "$getgrent_r_proto" in
12840 ''|0) try='int getgrent_r(struct group*, char*, int, struct group**);'
12841 ./protochk "extern $try" $hdrs && getgrent_r_proto=I_SBIR ;;
12843 case "$getgrent_r_proto" in
12844 ''|0) try='struct group* getgrent_r(struct group*, char*, size_t);'
12845 ./protochk "extern $try" $hdrs && getgrent_r_proto=S_SBW ;;
12847 case "$getgrent_r_proto" in
12848 ''|0) try='struct group* getgrent_r(struct group*, char*, int);'
12849 ./protochk "extern $try" $hdrs && getgrent_r_proto=S_SBI ;;
12851 case "$getgrent_r_proto" in
12852 ''|0) try='int getgrent_r(struct group*, char*, int);'
12853 ./protochk "extern $try" $hdrs && getgrent_r_proto=I_SBI ;;
12855 case "$getgrent_r_proto" in
12856 ''|0) try='int getgrent_r(struct group*, char*, int, FILE**);'
12857 ./protochk "extern $try" $hdrs && getgrent_r_proto=I_SBIH ;;
12859 case "$getgrent_r_proto" in
12860 ''|0) d_getgrent_r=undef
12862 echo "Disabling getgrent_r, cannot determine prototype." >&4 ;;
12863 * ) case "$getgrent_r_proto" in
12864 REENTRANT_PROTO*) ;;
12865 *) getgrent_r_proto="REENTRANT_PROTO_$getgrent_r_proto" ;;
12867 echo "Prototype: $try" ;;
12870 *) case "$usethreads" in
12871 define) echo "getgrent_r has no prototype, not using it." >&4 ;;
12878 *) getgrent_r_proto=0
12882 : see if getgrgid_r exists
12883 set getgrgid_r d_getgrgid_r
12885 case "$d_getgrgid_r" in
12887 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
12888 case "$d_getgrgid_r_proto:$usethreads" in
12889 ":define") d_getgrgid_r_proto=define
12890 set d_getgrgid_r_proto getgrgid_r $hdrs
12894 case "$d_getgrgid_r_proto" in
12896 case "$getgrgid_r_proto" in
12897 ''|0) try='int getgrgid_r(gid_t, struct group*, char*, size_t, struct group**);'
12898 ./protochk "extern $try" $hdrs && getgrgid_r_proto=I_TSBWR ;;
12900 case "$getgrgid_r_proto" in
12901 ''|0) try='int getgrgid_r(gid_t, struct group*, char*, int, struct group**);'
12902 ./protochk "extern $try" $hdrs && getgrgid_r_proto=I_TSBIR ;;
12904 case "$getgrgid_r_proto" in
12905 ''|0) try='int getgrgid_r(gid_t, struct group*, char*, int);'
12906 ./protochk "extern $try" $hdrs && getgrgid_r_proto=I_TSBI ;;
12908 case "$getgrgid_r_proto" in
12909 ''|0) try='struct group* getgrgid_r(gid_t, struct group*, char*, int);'
12910 ./protochk "extern $try" $hdrs && getgrgid_r_proto=S_TSBI ;;
12912 case "$getgrgid_r_proto" in
12913 ''|0) d_getgrgid_r=undef
12915 echo "Disabling getgrgid_r, cannot determine prototype." >&4 ;;
12916 * ) case "$getgrgid_r_proto" in
12917 REENTRANT_PROTO*) ;;
12918 *) getgrgid_r_proto="REENTRANT_PROTO_$getgrgid_r_proto" ;;
12920 echo "Prototype: $try" ;;
12923 *) case "$usethreads" in
12924 define) echo "getgrgid_r has no prototype, not using it." >&4 ;;
12931 *) getgrgid_r_proto=0
12935 : see if getgrnam_r exists
12936 set getgrnam_r d_getgrnam_r
12938 case "$d_getgrnam_r" in
12940 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
12941 case "$d_getgrnam_r_proto:$usethreads" in
12942 ":define") d_getgrnam_r_proto=define
12943 set d_getgrnam_r_proto getgrnam_r $hdrs
12947 case "$d_getgrnam_r_proto" in
12949 case "$getgrnam_r_proto" in
12950 ''|0) try='int getgrnam_r(const char*, struct group*, char*, size_t, struct group**);'
12951 ./protochk "extern $try" $hdrs && getgrnam_r_proto=I_CSBWR ;;
12953 case "$getgrnam_r_proto" in
12954 ''|0) try='int getgrnam_r(const char*, struct group*, char*, int, struct group**);'
12955 ./protochk "extern $try" $hdrs && getgrnam_r_proto=I_CSBIR ;;
12957 case "$getgrnam_r_proto" in
12958 ''|0) try='struct group* getgrnam_r(const char*, char*, int);'
12959 ./protochk "extern $try" $hdrs && getgrnam_r_proto=S_CBI ;;
12961 case "$getgrnam_r_proto" in
12962 ''|0) try='int getgrnam_r(const char*, struct group*, char*, int);'
12963 ./protochk "extern $try" $hdrs && getgrnam_r_proto=I_CSBI ;;
12965 case "$getgrnam_r_proto" in
12966 ''|0) try='struct group* getgrnam_r(const char*, struct group*, char*, int);'
12967 ./protochk "extern $try" $hdrs && getgrnam_r_proto=S_CSBI ;;
12969 case "$getgrnam_r_proto" in
12970 ''|0) d_getgrnam_r=undef
12972 echo "Disabling getgrnam_r, cannot determine prototype." >&4 ;;
12973 * ) case "$getgrnam_r_proto" in
12974 REENTRANT_PROTO*) ;;
12975 *) getgrnam_r_proto="REENTRANT_PROTO_$getgrnam_r_proto" ;;
12977 echo "Prototype: $try" ;;
12980 *) case "$usethreads" in
12981 define) echo "getgrnam_r has no prototype, not using it." >&4 ;;
12988 *) getgrnam_r_proto=0
12992 : see if gethostbyaddr exists
12993 set gethostbyaddr d_gethbyaddr
12996 : see if gethostbyname exists
12997 set gethostbyname d_gethbyname
13000 : see if gethostent exists
13001 set gethostent d_gethent
13004 : see how we will look up host name
13007 if set gethostname val -f d_gethname; eval $csym; $val; then
13008 echo 'gethostname() found.' >&4
13009 d_gethname="$define"
13012 if set uname val -f d_uname; eval $csym; $val; then
13015 uname() was found, but you're running xenix, and older versions of xenix
13016 have a broken uname(). If you don't really know whether your xenix is old
13017 enough to have a broken system call, use the default answer.
13022 "$define") dflt=n;;
13024 rp='Is your uname() broken?'
13027 n*) d_uname="$define"; call=uname;;
13030 echo 'uname() found.' >&4
13037 case "$d_gethname" in
13038 '') d_gethname="$undef";;
13041 '') d_uname="$undef";;
13043 case "$d_uname$d_gethname" in
13048 Every now and then someone has a $call() that lies about the hostname
13049 but can't be fixed for political or economic reasons. If you wish, I can
13050 pretend $call() isn't there and maybe compute hostname at run-time
13051 thanks to the '$phostname' command.
13054 rp="Shall I ignore $call() from now on?"
13057 y*) d_uname="$undef" d_gethname="$undef"; $echo $n "Okay...$c";;
13060 case "$phostname" in
13061 '') aphostname='';;
13062 *) case "$aphostname" in
13064 *) set X $phostname
13068 file=`./loc $file $file $pth`
13069 aphostname=`echo $file $*`
13074 case "$d_uname$d_gethname" in
13077 case "$phostname" in
13079 echo "There will be no way for $package to get your hostname." >&4;;
13081 echo "I'll use 'popen("'"'$aphostname'", "r")'"' to get your hostname." >&4
13085 case "$d_phostname" in
13086 '') d_phostname="$undef";;
13089 : see if gethostbyaddr_r exists
13090 set gethostbyaddr_r d_gethostbyaddr_r
13092 case "$d_gethostbyaddr_r" in
13094 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13095 case "$d_gethostbyaddr_r_proto:$usethreads" in
13096 ":define") d_gethostbyaddr_r_proto=define
13097 set d_gethostbyaddr_r_proto gethostbyaddr_r $hdrs
13101 case "$d_gethostbyaddr_r_proto" in
13103 case "$gethostbyaddr_r_proto" in
13104 ''|0) try='int gethostbyaddr_r(const char*, size_t, int, struct hostent*, char*, size_t, struct hostent**, int*);'
13105 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=I_CWISBWRE ;;
13107 case "$gethostbyaddr_r_proto" in
13108 ''|0) try='struct hostent* gethostbyaddr_r(const char*, size_t, int, struct hostent*, char*, size_t, int, int*);'
13109 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=S_CWISBWIE ;;
13111 case "$gethostbyaddr_r_proto" in
13112 ''|0) try='struct hostent* gethostbyaddr_r(const char*, size_t, int, struct hostent*, char*, int, int*);'
13113 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=S_CWISBIE ;;
13115 case "$gethostbyaddr_r_proto" in
13116 ''|0) try='struct hostent* gethostbyaddr_r(const void*, size_t, int, struct hostent*, char*, int, int*);'
13117 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=S_TWISBIE ;;
13119 case "$gethostbyaddr_r_proto" in
13120 ''|0) try='struct hostent* gethostbyaddr_r(const char*, int, int, struct hostent*, char*, int, int*);'
13121 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=S_CIISBIE ;;
13123 case "$gethostbyaddr_r_proto" in
13124 ''|0) try='struct hostent* gethostbyaddr_r(const char*, struct hostent*, char*, int, int*);'
13125 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=S_CSBIE ;;
13127 case "$gethostbyaddr_r_proto" in
13128 ''|0) try='struct hostent* gethostbyaddr_r(const void*, struct hostent*, char*, int, int*);'
13129 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=S_TSBIE ;;
13131 case "$gethostbyaddr_r_proto" in
13132 ''|0) try='int gethostbyaddr_r(const char*, size_t, int, struct hostent*, struct hostent_data*);'
13133 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=I_CWISD ;;
13135 case "$gethostbyaddr_r_proto" in
13136 ''|0) try='int gethostbyaddr_r(const char*, int, int, struct hostent*, struct hostent_data*);'
13137 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=I_CIISD ;;
13139 case "$gethostbyaddr_r_proto" in
13140 ''|0) try='int gethostbyaddr_r(const char*, int, int);'
13141 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=I_CII ;;
13143 case "$gethostbyaddr_r_proto" in
13144 ''|0) try='int gethostbyaddr_r(const void*, socklen_t, int, struct hostent*, char*, size_t, struct hostent**, int*);'
13145 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=I_TsISBWRE ;;
13147 case "$gethostbyaddr_r_proto" in
13148 ''|0) d_gethostbyaddr_r=undef
13149 gethostbyaddr_r_proto=0
13150 echo "Disabling gethostbyaddr_r, cannot determine prototype." >&4 ;;
13151 * ) case "$gethostbyaddr_r_proto" in
13152 REENTRANT_PROTO*) ;;
13153 *) gethostbyaddr_r_proto="REENTRANT_PROTO_$gethostbyaddr_r_proto" ;;
13155 echo "Prototype: $try" ;;
13158 *) case "$usethreads" in
13159 define) echo "gethostbyaddr_r has no prototype, not using it." >&4 ;;
13161 d_gethostbyaddr_r=undef
13162 gethostbyaddr_r_proto=0
13166 *) gethostbyaddr_r_proto=0
13170 : see if gethostbyname_r exists
13171 set gethostbyname_r d_gethostbyname_r
13173 case "$d_gethostbyname_r" in
13175 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13176 case "$d_gethostbyname_r_proto:$usethreads" in
13177 ":define") d_gethostbyname_r_proto=define
13178 set d_gethostbyname_r_proto gethostbyname_r $hdrs
13182 case "$d_gethostbyname_r_proto" in
13184 case "$gethostbyname_r_proto" in
13185 ''|0) try='int gethostbyname_r(const char*, struct hostent*, char*, size_t, struct hostent**, int*);'
13186 ./protochk "extern $try" $hdrs && gethostbyname_r_proto=I_CSBWRE ;;
13188 case "$gethostbyname_r_proto" in
13189 ''|0) try='struct hostent* gethostbyname_r(const char*, struct hostent*, char*, int, int*);'
13190 ./protochk "extern $try" $hdrs && gethostbyname_r_proto=S_CSBIE ;;
13192 case "$gethostbyname_r_proto" in
13193 ''|0) try='int gethostbyname_r(const char*, struct hostent*, struct hostent_data*);'
13194 ./protochk "extern $try" $hdrs && gethostbyname_r_proto=I_CSD ;;
13196 case "$gethostbyname_r_proto" in
13197 ''|0) d_gethostbyname_r=undef
13198 gethostbyname_r_proto=0
13199 echo "Disabling gethostbyname_r, cannot determine prototype." >&4 ;;
13200 * ) case "$gethostbyname_r_proto" in
13201 REENTRANT_PROTO*) ;;
13202 *) gethostbyname_r_proto="REENTRANT_PROTO_$gethostbyname_r_proto" ;;
13204 echo "Prototype: $try" ;;
13207 *) case "$usethreads" in
13208 define) echo "gethostbyname_r has no prototype, not using it." >&4 ;;
13210 d_gethostbyname_r=undef
13211 gethostbyname_r_proto=0
13215 *) gethostbyname_r_proto=0
13219 : see if gethostent_r exists
13220 set gethostent_r d_gethostent_r
13222 case "$d_gethostent_r" in
13224 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13225 case "$d_gethostent_r_proto:$usethreads" in
13226 ":define") d_gethostent_r_proto=define
13227 set d_gethostent_r_proto gethostent_r $hdrs
13231 case "$d_gethostent_r_proto" in
13233 case "$gethostent_r_proto" in
13234 ''|0) try='int gethostent_r(struct hostent*, char*, size_t, struct hostent**, int*);'
13235 ./protochk "extern $try" $hdrs && gethostent_r_proto=I_SBWRE ;;
13237 case "$gethostent_r_proto" in
13238 ''|0) try='int gethostent_r(struct hostent*, char*, int, int*);'
13239 ./protochk "extern $try" $hdrs && gethostent_r_proto=I_SBIE ;;
13241 case "$gethostent_r_proto" in
13242 ''|0) try='struct hostent* gethostent_r(struct hostent*, char*, int, int*);'
13243 ./protochk "extern $try" $hdrs && gethostent_r_proto=S_SBIE ;;
13245 case "$gethostent_r_proto" in
13246 ''|0) try='struct hostent* gethostent_r(struct hostent*, char*, int);'
13247 ./protochk "extern $try" $hdrs && gethostent_r_proto=S_SBI ;;
13249 case "$gethostent_r_proto" in
13250 ''|0) try='int gethostent_r(struct hostent*, char*, int);'
13251 ./protochk "extern $try" $hdrs && gethostent_r_proto=I_SBI ;;
13253 case "$gethostent_r_proto" in
13254 ''|0) try='int gethostent_r(struct hostent*, struct hostent_data*);'
13255 ./protochk "extern $try" $hdrs && gethostent_r_proto=I_SD ;;
13257 case "$gethostent_r_proto" in
13258 ''|0) d_gethostent_r=undef
13259 gethostent_r_proto=0
13260 echo "Disabling gethostent_r, cannot determine prototype." >&4 ;;
13261 * ) case "$gethostent_r_proto" in
13262 REENTRANT_PROTO*) ;;
13263 *) gethostent_r_proto="REENTRANT_PROTO_$gethostent_r_proto" ;;
13265 echo "Prototype: $try" ;;
13268 *) case "$usethreads" in
13269 define) echo "gethostent_r has no prototype, not using it." >&4 ;;
13271 d_gethostent_r=undef
13272 gethostent_r_proto=0
13276 *) gethostent_r_proto=0
13280 : see if prototypes for various gethostxxx netdb.h functions are available
13282 set d_gethostprotos gethostent $i_netdb netdb.h
13285 : see if getitimer exists
13286 set getitimer d_getitimer
13289 : see if getlogin exists
13290 set getlogin d_getlogin
13293 : see if getlogin_r exists
13294 set getlogin_r d_getlogin_r
13296 case "$d_getlogin_r" in
13298 hdrs="$i_systypes sys/types.h define stdio.h $i_unistd unistd.h"
13299 case "$d_getlogin_r_proto:$usethreads" in
13300 ":define") d_getlogin_r_proto=define
13301 set d_getlogin_r_proto getlogin_r $hdrs
13305 case "$d_getlogin_r_proto" in
13307 case "$getlogin_r_proto" in
13308 ''|0) try='int getlogin_r(char*, size_t);'
13309 ./protochk "extern $try" $hdrs && getlogin_r_proto=I_BW ;;
13311 case "$getlogin_r_proto" in
13312 ''|0) try='int getlogin_r(char*, int);'
13313 ./protochk "extern $try" $hdrs && getlogin_r_proto=I_BI ;;
13315 case "$getlogin_r_proto" in
13316 ''|0) try='char* getlogin_r(char*, size_t);'
13317 ./protochk "extern $try" $hdrs && getlogin_r_proto=B_BW ;;
13319 case "$getlogin_r_proto" in
13320 ''|0) try='char* getlogin_r(char*, int);'
13321 ./protochk "extern $try" $hdrs && getlogin_r_proto=B_BI ;;
13323 case "$getlogin_r_proto" in
13324 ''|0) d_getlogin_r=undef
13326 echo "Disabling getlogin_r, cannot determine prototype." >&4 ;;
13327 * ) case "$getlogin_r_proto" in
13328 REENTRANT_PROTO*) ;;
13329 *) getlogin_r_proto="REENTRANT_PROTO_$getlogin_r_proto" ;;
13331 echo "Prototype: $try" ;;
13334 *) case "$usethreads" in
13335 define) echo "getlogin_r has no prototype, not using it." >&4 ;;
13342 *) getlogin_r_proto=0
13346 : see if getmnt exists
13347 set getmnt d_getmnt
13350 : see if getmntent exists
13351 set getmntent d_getmntent
13354 : see if getnetbyaddr exists
13355 set getnetbyaddr d_getnbyaddr
13358 : see if getnetbyname exists
13359 set getnetbyname d_getnbyname
13362 : see if getnetent exists
13363 set getnetent d_getnent
13366 : see if getnetbyaddr_r exists
13367 set getnetbyaddr_r d_getnetbyaddr_r
13369 case "$d_getnetbyaddr_r" in
13371 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13372 case "$d_getnetbyaddr_r_proto:$usethreads" in
13373 ":define") d_getnetbyaddr_r_proto=define
13374 set d_getnetbyaddr_r_proto getnetbyaddr_r $hdrs
13378 case "$d_getnetbyaddr_r_proto" in
13380 case "$getnetbyaddr_r_proto" in
13381 ''|0) try='int getnetbyaddr_r(unsigned long, int, struct netent*, char*, size_t, struct netent**, int*);'
13382 ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=I_UISBWRE ;;
13384 case "$getnetbyaddr_r_proto" in
13385 ''|0) try='int getnetbyaddr_r(long, int, struct netent*, char*, int);'
13386 ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=I_LISBI ;;
13388 case "$getnetbyaddr_r_proto" in
13389 ''|0) try='struct netent* getnetbyaddr_r(in_addr_t, int, struct netent*, char*, int);'
13390 ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=S_TISBI ;;
13392 case "$getnetbyaddr_r_proto" in
13393 ''|0) try='struct netent* getnetbyaddr_r(long, int, struct netent*, char*, int);'
13394 ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=S_LISBI ;;
13396 case "$getnetbyaddr_r_proto" in
13397 ''|0) try='int getnetbyaddr_r(in_addr_t, int, struct netent*, struct netent_data*);'
13398 ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=I_TISD ;;
13400 case "$getnetbyaddr_r_proto" in
13401 ''|0) try='int getnetbyaddr_r(long, int, struct netent*, struct netent_data*);'
13402 ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=I_LISD ;;
13404 case "$getnetbyaddr_r_proto" in
13405 ''|0) try='int getnetbyaddr_r(int, int, struct netent*, struct netent_data*);'
13406 ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=I_IISD ;;
13408 case "$getnetbyaddr_r_proto" in
13409 ''|0) try='int getnetbyaddr_r(uint32_t, int, struct netent*, char*, size_t, struct netent**, int*);'
13410 ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=I_uISBWRE ;;
13412 case "$getnetbyaddr_r_proto" in
13413 ''|0) d_getnetbyaddr_r=undef
13414 getnetbyaddr_r_proto=0
13415 echo "Disabling getnetbyaddr_r, cannot determine prototype." >&4 ;;
13416 * ) case "$getnetbyaddr_r_proto" in
13417 REENTRANT_PROTO*) ;;
13418 *) getnetbyaddr_r_proto="REENTRANT_PROTO_$getnetbyaddr_r_proto" ;;
13420 echo "Prototype: $try" ;;
13423 *) case "$usethreads" in
13424 define) echo "getnetbyaddr_r has no prototype, not using it." >&4 ;;
13426 d_getnetbyaddr_r=undef
13427 getnetbyaddr_r_proto=0
13431 *) getnetbyaddr_r_proto=0
13435 : see if getnetbyname_r exists
13436 set getnetbyname_r d_getnetbyname_r
13438 case "$d_getnetbyname_r" in
13440 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13441 case "$d_getnetbyname_r_proto:$usethreads" in
13442 ":define") d_getnetbyname_r_proto=define
13443 set d_getnetbyname_r_proto getnetbyname_r $hdrs
13447 case "$d_getnetbyname_r_proto" in
13449 case "$getnetbyname_r_proto" in
13450 ''|0) try='int getnetbyname_r(const char*, struct netent*, char*, size_t, struct netent**, int*);'
13451 ./protochk "extern $try" $hdrs && getnetbyname_r_proto=I_CSBWRE ;;
13453 case "$getnetbyname_r_proto" in
13454 ''|0) try='int getnetbyname_r(const char*, struct netent*, char*, int);'
13455 ./protochk "extern $try" $hdrs && getnetbyname_r_proto=I_CSBI ;;
13457 case "$getnetbyname_r_proto" in
13458 ''|0) try='struct netent* getnetbyname_r(const char*, struct netent*, char*, int);'
13459 ./protochk "extern $try" $hdrs && getnetbyname_r_proto=S_CSBI ;;
13461 case "$getnetbyname_r_proto" in
13462 ''|0) try='int getnetbyname_r(const char*, struct netent*, struct netent_data*);'
13463 ./protochk "extern $try" $hdrs && getnetbyname_r_proto=I_CSD ;;
13465 case "$getnetbyname_r_proto" in
13466 ''|0) d_getnetbyname_r=undef
13467 getnetbyname_r_proto=0
13468 echo "Disabling getnetbyname_r, cannot determine prototype." >&4 ;;
13469 * ) case "$getnetbyname_r_proto" in
13470 REENTRANT_PROTO*) ;;
13471 *) getnetbyname_r_proto="REENTRANT_PROTO_$getnetbyname_r_proto" ;;
13473 echo "Prototype: $try" ;;
13476 *) case "$usethreads" in
13477 define) echo "getnetbyname_r has no prototype, not using it." >&4 ;;
13479 d_getnetbyname_r=undef
13480 getnetbyname_r_proto=0
13484 *) getnetbyname_r_proto=0
13488 : see if getnetent_r exists
13489 set getnetent_r d_getnetent_r
13491 case "$d_getnetent_r" in
13493 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13494 case "$d_getnetent_r_proto:$usethreads" in
13495 ":define") d_getnetent_r_proto=define
13496 set d_getnetent_r_proto getnetent_r $hdrs
13500 case "$d_getnetent_r_proto" in
13502 case "$getnetent_r_proto" in
13503 ''|0) try='int getnetent_r(struct netent*, char*, size_t, struct netent**, int*);'
13504 ./protochk "extern $try" $hdrs && getnetent_r_proto=I_SBWRE ;;
13506 case "$getnetent_r_proto" in
13507 ''|0) try='int getnetent_r(struct netent*, char*, int, int*);'
13508 ./protochk "extern $try" $hdrs && getnetent_r_proto=I_SBIE ;;
13510 case "$getnetent_r_proto" in
13511 ''|0) try='struct netent* getnetent_r(struct netent*, char*, int, int*);'
13512 ./protochk "extern $try" $hdrs && getnetent_r_proto=S_SBIE ;;
13514 case "$getnetent_r_proto" in
13515 ''|0) try='struct netent* getnetent_r(struct netent*, char*, int);'
13516 ./protochk "extern $try" $hdrs && getnetent_r_proto=S_SBI ;;
13518 case "$getnetent_r_proto" in
13519 ''|0) try='int getnetent_r(struct netent*, char*, int);'
13520 ./protochk "extern $try" $hdrs && getnetent_r_proto=I_SBI ;;
13522 case "$getnetent_r_proto" in
13523 ''|0) try='int getnetent_r(struct netent*, struct netent_data*);'
13524 ./protochk "extern $try" $hdrs && getnetent_r_proto=I_SD ;;
13526 case "$getnetent_r_proto" in
13527 ''|0) d_getnetent_r=undef
13528 getnetent_r_proto=0
13529 echo "Disabling getnetent_r, cannot determine prototype." >&4 ;;
13530 * ) case "$getnetent_r_proto" in
13531 REENTRANT_PROTO*) ;;
13532 *) getnetent_r_proto="REENTRANT_PROTO_$getnetent_r_proto" ;;
13534 echo "Prototype: $try" ;;
13537 *) case "$usethreads" in
13538 define) echo "getnetent_r has no prototype, not using it." >&4 ;;
13540 d_getnetent_r=undef
13541 getnetent_r_proto=0
13545 *) getnetent_r_proto=0
13549 : see if prototypes for various getnetxxx netdb.h functions are available
13551 set d_getnetprotos getnetent $i_netdb netdb.h
13554 : see if getpagesize exists
13555 set getpagesize d_getpagsz
13559 : see if getprotobyname exists
13560 set getprotobyname d_getpbyname
13563 : see if getprotobynumber exists
13564 set getprotobynumber d_getpbynumber
13567 : see if getprotoent exists
13568 set getprotoent d_getpent
13571 : see if getpgid exists
13572 set getpgid d_getpgid
13575 : see if getpgrp2 exists
13576 set getpgrp2 d_getpgrp2
13579 : see if getppid exists
13580 set getppid d_getppid
13583 : see if getpriority exists
13584 set getpriority d_getprior
13587 : see if getprotobyname_r exists
13588 set getprotobyname_r d_getprotobyname_r
13590 case "$d_getprotobyname_r" in
13592 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13593 case "$d_getprotobyname_r_proto:$usethreads" in
13594 ":define") d_getprotobyname_r_proto=define
13595 set d_getprotobyname_r_proto getprotobyname_r $hdrs
13599 case "$d_getprotobyname_r_proto" in
13601 case "$getprotobyname_r_proto" in
13602 ''|0) try='int getprotobyname_r(const char*, struct protoent*, char*, size_t, struct protoent**);'
13603 ./protochk "extern $try" $hdrs && getprotobyname_r_proto=I_CSBWR ;;
13605 case "$getprotobyname_r_proto" in
13606 ''|0) try='struct protoent* getprotobyname_r(const char*, struct protoent*, char*, int);'
13607 ./protochk "extern $try" $hdrs && getprotobyname_r_proto=S_CSBI ;;
13609 case "$getprotobyname_r_proto" in
13610 ''|0) try='int getprotobyname_r(const char*, struct protoent*, struct protoent_data*);'
13611 ./protochk "extern $try" $hdrs && getprotobyname_r_proto=I_CSD ;;
13613 case "$getprotobyname_r_proto" in
13614 ''|0) d_getprotobyname_r=undef
13615 getprotobyname_r_proto=0
13616 echo "Disabling getprotobyname_r, cannot determine prototype." >&4 ;;
13617 * ) case "$getprotobyname_r_proto" in
13618 REENTRANT_PROTO*) ;;
13619 *) getprotobyname_r_proto="REENTRANT_PROTO_$getprotobyname_r_proto" ;;
13621 echo "Prototype: $try" ;;
13624 *) case "$usethreads" in
13625 define) echo "getprotobyname_r has no prototype, not using it." >&4 ;;
13627 d_getprotobyname_r=undef
13628 getprotobyname_r_proto=0
13632 *) getprotobyname_r_proto=0
13636 : see if getprotobynumber_r exists
13637 set getprotobynumber_r d_getprotobynumber_r
13639 case "$d_getprotobynumber_r" in
13641 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13642 case "$d_getprotobynumber_r_proto:$usethreads" in
13643 ":define") d_getprotobynumber_r_proto=define
13644 set d_getprotobynumber_r_proto getprotobynumber_r $hdrs
13648 case "$d_getprotobynumber_r_proto" in
13650 case "$getprotobynumber_r_proto" in
13651 ''|0) try='int getprotobynumber_r(int, struct protoent*, char*, size_t, struct protoent**);'
13652 ./protochk "extern $try" $hdrs && getprotobynumber_r_proto=I_ISBWR ;;
13654 case "$getprotobynumber_r_proto" in
13655 ''|0) try='struct protoent* getprotobynumber_r(int, struct protoent*, char*, int);'
13656 ./protochk "extern $try" $hdrs && getprotobynumber_r_proto=S_ISBI ;;
13658 case "$getprotobynumber_r_proto" in
13659 ''|0) try='int getprotobynumber_r(int, struct protoent*, struct protoent_data*);'
13660 ./protochk "extern $try" $hdrs && getprotobynumber_r_proto=I_ISD ;;
13662 case "$getprotobynumber_r_proto" in
13663 ''|0) d_getprotobynumber_r=undef
13664 getprotobynumber_r_proto=0
13665 echo "Disabling getprotobynumber_r, cannot determine prototype." >&4 ;;
13666 * ) case "$getprotobynumber_r_proto" in
13667 REENTRANT_PROTO*) ;;
13668 *) getprotobynumber_r_proto="REENTRANT_PROTO_$getprotobynumber_r_proto" ;;
13670 echo "Prototype: $try" ;;
13673 *) case "$usethreads" in
13674 define) echo "getprotobynumber_r has no prototype, not using it." >&4 ;;
13676 d_getprotobynumber_r=undef
13677 getprotobynumber_r_proto=0
13681 *) getprotobynumber_r_proto=0
13685 : see if getprotoent_r exists
13686 set getprotoent_r d_getprotoent_r
13688 case "$d_getprotoent_r" in
13690 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13691 case "$d_getprotoent_r_proto:$usethreads" in
13692 ":define") d_getprotoent_r_proto=define
13693 set d_getprotoent_r_proto getprotoent_r $hdrs
13697 case "$d_getprotoent_r_proto" in
13699 case "$getprotoent_r_proto" in
13700 ''|0) try='int getprotoent_r(struct protoent*, char*, size_t, struct protoent**);'
13701 ./protochk "extern $try" $hdrs && getprotoent_r_proto=I_SBWR ;;
13703 case "$getprotoent_r_proto" in
13704 ''|0) try='int getprotoent_r(struct protoent*, char*, int);'
13705 ./protochk "extern $try" $hdrs && getprotoent_r_proto=I_SBI ;;
13707 case "$getprotoent_r_proto" in
13708 ''|0) try='struct protoent* getprotoent_r(struct protoent*, char*, int);'
13709 ./protochk "extern $try" $hdrs && getprotoent_r_proto=S_SBI ;;
13711 case "$getprotoent_r_proto" in
13712 ''|0) try='int getprotoent_r(struct protoent*, struct protoent_data*);'
13713 ./protochk "extern $try" $hdrs && getprotoent_r_proto=I_SD ;;
13715 case "$getprotoent_r_proto" in
13716 ''|0) d_getprotoent_r=undef
13717 getprotoent_r_proto=0
13718 echo "Disabling getprotoent_r, cannot determine prototype." >&4 ;;
13719 * ) case "$getprotoent_r_proto" in
13720 REENTRANT_PROTO*) ;;
13721 *) getprotoent_r_proto="REENTRANT_PROTO_$getprotoent_r_proto" ;;
13723 echo "Prototype: $try" ;;
13726 *) case "$usethreads" in
13727 define) echo "getprotoent_r has no prototype, not using it." >&4 ;;
13729 d_getprotoent_r=undef
13730 getprotoent_r_proto=0
13734 *) getprotoent_r_proto=0
13738 : see if prototypes for various getprotoxxx netdb.h functions are available
13740 set d_getprotoprotos getprotoent $i_netdb netdb.h
13743 : see if getprpwnam exists
13744 set getprpwnam d_getprpwnam
13747 : see if getpwent exists
13748 set getpwent d_getpwent
13751 : see if getpwent_r exists
13752 set getpwent_r d_getpwent_r
13754 case "$d_getpwent_r" in
13756 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
13757 case "$d_getpwent_r_proto:$usethreads" in
13758 ":define") d_getpwent_r_proto=define
13759 set d_getpwent_r_proto getpwent_r $hdrs
13763 case "$d_getpwent_r_proto" in
13765 case "$getpwent_r_proto" in
13766 ''|0) try='int getpwent_r(struct passwd*, char*, size_t, struct passwd**);'
13767 ./protochk "extern $try" $hdrs && getpwent_r_proto=I_SBWR ;;
13769 case "$getpwent_r_proto" in
13770 ''|0) try='int getpwent_r(struct passwd*, char*, int, struct passwd**);'
13771 ./protochk "extern $try" $hdrs && getpwent_r_proto=I_SBIR ;;
13773 case "$getpwent_r_proto" in
13774 ''|0) try='struct passwd* getpwent_r(struct passwd*, char*, size_t);'
13775 ./protochk "extern $try" $hdrs && getpwent_r_proto=S_SBW ;;
13777 case "$getpwent_r_proto" in
13778 ''|0) try='struct passwd* getpwent_r(struct passwd*, char*, int);'
13779 ./protochk "extern $try" $hdrs && getpwent_r_proto=S_SBI ;;
13781 case "$getpwent_r_proto" in
13782 ''|0) try='int getpwent_r(struct passwd*, char*, int);'
13783 ./protochk "extern $try" $hdrs && getpwent_r_proto=I_SBI ;;
13785 case "$getpwent_r_proto" in
13786 ''|0) try='int getpwent_r(struct passwd*, char*, int, FILE**);'
13787 ./protochk "extern $try" $hdrs && getpwent_r_proto=I_SBIH ;;
13789 case "$getpwent_r_proto" in
13790 ''|0) d_getpwent_r=undef
13792 echo "Disabling getpwent_r, cannot determine prototype." >&4 ;;
13793 * ) case "$getpwent_r_proto" in
13794 REENTRANT_PROTO*) ;;
13795 *) getpwent_r_proto="REENTRANT_PROTO_$getpwent_r_proto" ;;
13797 echo "Prototype: $try" ;;
13800 *) case "$usethreads" in
13801 define) echo "getpwent_r has no prototype, not using it." >&4 ;;
13808 *) getpwent_r_proto=0
13812 : see if getpwnam_r exists
13813 set getpwnam_r d_getpwnam_r
13815 case "$d_getpwnam_r" in
13817 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
13818 case "$d_getpwnam_r_proto:$usethreads" in
13819 ":define") d_getpwnam_r_proto=define
13820 set d_getpwnam_r_proto getpwnam_r $hdrs
13824 case "$d_getpwnam_r_proto" in
13826 case "$getpwnam_r_proto" in
13827 ''|0) try='int getpwnam_r(const char*, struct passwd*, char*, size_t, struct passwd**);'
13828 ./protochk "extern $try" $hdrs && getpwnam_r_proto=I_CSBWR ;;
13830 case "$getpwnam_r_proto" in
13831 ''|0) try='int getpwnam_r(const char*, struct passwd*, char*, int, struct passwd**);'
13832 ./protochk "extern $try" $hdrs && getpwnam_r_proto=I_CSBIR ;;
13834 case "$getpwnam_r_proto" in
13835 ''|0) try='struct passwd* getpwnam_r(const char*, struct passwd*, char*, int);'
13836 ./protochk "extern $try" $hdrs && getpwnam_r_proto=S_CSBI ;;
13838 case "$getpwnam_r_proto" in
13839 ''|0) try='int getpwnam_r(const char*, struct passwd*, char*, int);'
13840 ./protochk "extern $try" $hdrs && getpwnam_r_proto=I_CSBI ;;
13842 case "$getpwnam_r_proto" in
13843 ''|0) d_getpwnam_r=undef
13845 echo "Disabling getpwnam_r, cannot determine prototype." >&4 ;;
13846 * ) case "$getpwnam_r_proto" in
13847 REENTRANT_PROTO*) ;;
13848 *) getpwnam_r_proto="REENTRANT_PROTO_$getpwnam_r_proto" ;;
13850 echo "Prototype: $try" ;;
13853 *) case "$usethreads" in
13854 define) echo "getpwnam_r has no prototype, not using it." >&4 ;;
13861 *) getpwnam_r_proto=0
13865 : see if getpwuid_r exists
13866 set getpwuid_r d_getpwuid_r
13868 case "$d_getpwuid_r" in
13870 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
13871 case "$d_getpwuid_r_proto:$usethreads" in
13872 ":define") d_getpwuid_r_proto=define
13873 set d_getpwuid_r_proto getpwuid_r $hdrs
13877 case "$d_getpwuid_r_proto" in
13879 case "$getpwuid_r_proto" in
13880 ''|0) try='int getpwuid_r(uid_t, struct passwd*, char*, size_t, struct passwd**);'
13881 ./protochk "extern $try" $hdrs && getpwuid_r_proto=I_TSBWR ;;
13883 case "$getpwuid_r_proto" in
13884 ''|0) try='int getpwuid_r(uid_t, struct passwd*, char*, int, struct passwd**);'
13885 ./protochk "extern $try" $hdrs && getpwuid_r_proto=I_TSBIR ;;
13887 case "$getpwuid_r_proto" in
13888 ''|0) try='int getpwuid_r(uid_t, struct passwd*, char*, int);'
13889 ./protochk "extern $try" $hdrs && getpwuid_r_proto=I_TSBI ;;
13891 case "$getpwuid_r_proto" in
13892 ''|0) try='struct passwd* getpwuid_r(uid_t, struct passwd*, char*, int);'
13893 ./protochk "extern $try" $hdrs && getpwuid_r_proto=S_TSBI ;;
13895 case "$getpwuid_r_proto" in
13896 ''|0) d_getpwuid_r=undef
13898 echo "Disabling getpwuid_r, cannot determine prototype." >&4 ;;
13899 * ) case "$getpwuid_r_proto" in
13900 REENTRANT_PROTO*) ;;
13901 *) getpwuid_r_proto="REENTRANT_PROTO_$getpwuid_r_proto" ;;
13903 echo "Prototype: $try" ;;
13906 *) case "$usethreads" in
13907 define) echo "getpwuid_r has no prototype, not using it." >&4 ;;
13914 *) getpwuid_r_proto=0
13919 : see if getservbyname exists
13920 set getservbyname d_getsbyname
13923 : see if getservbyport exists
13924 set getservbyport d_getsbyport
13927 : see if getservent exists
13928 set getservent d_getsent
13931 : see if getservbyname_r exists
13932 set getservbyname_r d_getservbyname_r
13934 case "$d_getservbyname_r" in
13936 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13937 case "$d_getservbyname_r_proto:$usethreads" in
13938 ":define") d_getservbyname_r_proto=define
13939 set d_getservbyname_r_proto getservbyname_r $hdrs
13943 case "$d_getservbyname_r_proto" in
13945 case "$getservbyname_r_proto" in
13946 ''|0) try='int getservbyname_r(const char*, const char*, struct servent*, char*, size_t, struct servent**);'
13947 ./protochk "extern $try" $hdrs && getservbyname_r_proto=I_CCSBWR ;;
13949 case "$getservbyname_r_proto" in
13950 ''|0) try='struct servent* getservbyname_r(const char*, const char*, struct servent*, char*, int);'
13951 ./protochk "extern $try" $hdrs && getservbyname_r_proto=S_CCSBI ;;
13953 case "$getservbyname_r_proto" in
13954 ''|0) try='int getservbyname_r(const char*, const char*, struct servent*, struct servent_data*);'
13955 ./protochk "extern $try" $hdrs && getservbyname_r_proto=I_CCSD ;;
13957 case "$getservbyname_r_proto" in
13958 ''|0) d_getservbyname_r=undef
13959 getservbyname_r_proto=0
13960 echo "Disabling getservbyname_r, cannot determine prototype." >&4 ;;
13961 * ) case "$getservbyname_r_proto" in
13962 REENTRANT_PROTO*) ;;
13963 *) getservbyname_r_proto="REENTRANT_PROTO_$getservbyname_r_proto" ;;
13965 echo "Prototype: $try" ;;
13968 *) case "$usethreads" in
13969 define) echo "getservbyname_r has no prototype, not using it." >&4 ;;
13971 d_getservbyname_r=undef
13972 getservbyname_r_proto=0
13976 *) getservbyname_r_proto=0
13980 : see if getservbyport_r exists
13981 set getservbyport_r d_getservbyport_r
13983 case "$d_getservbyport_r" in
13985 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13986 case "$d_getservbyport_r_proto:$usethreads" in
13987 ":define") d_getservbyport_r_proto=define
13988 set d_getservbyport_r_proto getservbyport_r $hdrs
13992 case "$d_getservbyport_r_proto" in
13994 case "$getservbyport_r_proto" in
13995 ''|0) try='int getservbyport_r(int, const char*, struct servent*, char*, size_t, struct servent**);'
13996 ./protochk "extern $try" $hdrs && getservbyport_r_proto=I_ICSBWR ;;
13998 case "$getservbyport_r_proto" in
13999 ''|0) try='struct servent* getservbyport_r(int, const char*, struct servent*, char*, int);'
14000 ./protochk "extern $try" $hdrs && getservbyport_r_proto=S_ICSBI ;;
14002 case "$getservbyport_r_proto" in
14003 ''|0) try='int getservbyport_r(int, const char*, struct servent*, struct servent_data*);'
14004 ./protochk "extern $try" $hdrs && getservbyport_r_proto=I_ICSD ;;
14006 case "$getservbyport_r_proto" in
14007 ''|0) d_getservbyport_r=undef
14008 getservbyport_r_proto=0
14009 echo "Disabling getservbyport_r, cannot determine prototype." >&4 ;;
14010 * ) case "$getservbyport_r_proto" in
14011 REENTRANT_PROTO*) ;;
14012 *) getservbyport_r_proto="REENTRANT_PROTO_$getservbyport_r_proto" ;;
14014 echo "Prototype: $try" ;;
14017 *) case "$usethreads" in
14018 define) echo "getservbyport_r has no prototype, not using it." >&4 ;;
14020 d_getservbyport_r=undef
14021 getservbyport_r_proto=0
14025 *) getservbyport_r_proto=0
14029 : see if getservent_r exists
14030 set getservent_r d_getservent_r
14032 case "$d_getservent_r" in
14034 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14035 case "$d_getservent_r_proto:$usethreads" in
14036 ":define") d_getservent_r_proto=define
14037 set d_getservent_r_proto getservent_r $hdrs
14041 case "$d_getservent_r_proto" in
14043 case "$getservent_r_proto" in
14044 ''|0) try='int getservent_r(struct servent*, char*, size_t, struct servent**);'
14045 ./protochk "extern $try" $hdrs && getservent_r_proto=I_SBWR ;;
14047 case "$getservent_r_proto" in
14048 ''|0) try='int getservent_r(struct servent*, char*, int);'
14049 ./protochk "extern $try" $hdrs && getservent_r_proto=I_SBI ;;
14051 case "$getservent_r_proto" in
14052 ''|0) try='struct servent* getservent_r(struct servent*, char*, int);'
14053 ./protochk "extern $try" $hdrs && getservent_r_proto=S_SBI ;;
14055 case "$getservent_r_proto" in
14056 ''|0) try='int getservent_r(struct servent*, struct servent_data*);'
14057 ./protochk "extern $try" $hdrs && getservent_r_proto=I_SD ;;
14059 case "$getservent_r_proto" in
14060 ''|0) d_getservent_r=undef
14061 getservent_r_proto=0
14062 echo "Disabling getservent_r, cannot determine prototype." >&4 ;;
14063 * ) case "$getservent_r_proto" in
14064 REENTRANT_PROTO*) ;;
14065 *) getservent_r_proto="REENTRANT_PROTO_$getservent_r_proto" ;;
14067 echo "Prototype: $try" ;;
14070 *) case "$usethreads" in
14071 define) echo "getservent_r has no prototype, not using it." >&4 ;;
14073 d_getservent_r=undef
14074 getservent_r_proto=0
14078 *) getservent_r_proto=0
14082 : see if prototypes for various getservxxx netdb.h functions are available
14084 set d_getservprotos getservent $i_netdb netdb.h
14087 : see if getspnam exists
14088 set getspnam d_getspnam
14091 : see if this is a shadow.h system
14092 set shadow.h i_shadow
14095 : see if getspnam_r exists
14096 set getspnam_r d_getspnam_r
14098 case "$d_getspnam_r" in
14100 hdrs="$i_systypes sys/types.h define stdio.h $i_shadow shadow.h"
14101 case "$d_getspnam_r_proto:$usethreads" in
14102 ":define") d_getspnam_r_proto=define
14103 set d_getspnam_r_proto getspnam_r $hdrs
14107 case "$d_getspnam_r_proto" in
14109 case "$getspnam_r_proto" in
14110 ''|0) try='int getspnam_r(const char*, struct spwd*, char*, size_t, struct spwd**);'
14111 ./protochk "extern $try" $hdrs && getspnam_r_proto=I_CSBWR ;;
14113 case "$getspnam_r_proto" in
14114 ''|0) try='struct spwd* getspnam_r(const char*, struct spwd*, char*, int);'
14115 ./protochk "extern $try" $hdrs && getspnam_r_proto=S_CSBI ;;
14117 case "$getspnam_r_proto" in
14118 ''|0) d_getspnam_r=undef
14120 echo "Disabling getspnam_r, cannot determine prototype." >&4 ;;
14121 * ) case "$getspnam_r_proto" in
14122 REENTRANT_PROTO*) ;;
14123 *) getspnam_r_proto="REENTRANT_PROTO_$getspnam_r_proto" ;;
14125 echo "Prototype: $try" ;;
14128 *) case "$usethreads" in
14129 define) echo "getspnam_r has no prototype, not using it." >&4 ;;
14136 *) getspnam_r_proto=0
14140 : see if gettimeofday or ftime exists
14141 set gettimeofday d_gettimeod
14143 case "$d_gettimeod" in
14149 val="$undef"; set d_ftime; eval $setvar
14152 case "$d_gettimeod$d_ftime" in
14155 echo 'No ftime() nor gettimeofday() -- timing may be less accurate.' >&4
14159 : see if gmtime_r exists
14160 set gmtime_r d_gmtime_r
14162 case "$d_gmtime_r" in
14164 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
14165 case "$d_gmtime_r_proto:$usethreads" in
14166 ":define") d_gmtime_r_proto=define
14167 set d_gmtime_r_proto gmtime_r $hdrs
14171 case "$d_gmtime_r_proto" in
14173 case "$gmtime_r_proto" in
14174 ''|0) try='struct tm* gmtime_r(const time_t*, struct tm*);'
14175 ./protochk "extern $try" $hdrs && gmtime_r_proto=S_TS ;;
14177 case "$gmtime_r_proto" in
14178 ''|0) try='int gmtime_r(const time_t*, struct tm*);'
14179 ./protochk "extern $try" $hdrs && gmtime_r_proto=I_TS ;;
14181 case "$gmtime_r_proto" in
14182 ''|0) d_gmtime_r=undef
14184 echo "Disabling gmtime_r, cannot determine prototype." >&4 ;;
14185 * ) case "$gmtime_r_proto" in
14186 REENTRANT_PROTO*) ;;
14187 *) gmtime_r_proto="REENTRANT_PROTO_$gmtime_r_proto" ;;
14189 echo "Prototype: $try" ;;
14192 *) case "$usethreads" in
14193 define) echo "gmtime_r has no prototype, not using it." >&4 ;;
14200 *) gmtime_r_proto=0
14204 : see if hasmntopt exists
14205 set hasmntopt d_hasmntopt
14208 : see if this is a netinet/in.h or sys/in.h system
14209 set netinet/in.h i_niin sys/in.h i_sysin
14212 : see if arpa/inet.h has to be included
14213 set arpa/inet.h i_arpainet
14216 : see if htonl --and friends-- exists
14221 : Maybe they are macros.
14224 $cat >htonl.c <<EOM
14226 #include <sys/types.h>
14227 #$i_niin I_NETINET_IN
14229 #$i_arpainet I_ARPA_INET
14230 #ifdef I_NETINET_IN
14231 #include <netinet/in.h>
14234 #include <sys/in.h>
14237 #include <arpa/inet.h>
14240 printf("Defined as a macro.");
14243 $cppstdin $cppflags $cppminus < htonl.c >htonl.E 2>/dev/null
14244 if $contains 'Defined as a macro' htonl.E >/dev/null 2>&1; then
14246 echo "But it seems to be defined as a macro." >&4
14254 : see if ilogbl exists
14255 set ilogbl d_ilogbl
14260 if set index val -f; eval $csym; $val; then
14261 if set strchr val -f d_strchr; eval $csym; $val; then
14262 if $contains strchr "$strings" >/dev/null 2>&1 ; then
14265 echo "strchr() found." >&4
14269 echo "index() found." >&4
14274 echo "index() found." >&4
14277 if set strchr val -f d_strchr; eval $csym; $val; then
14280 echo "strchr() found." >&4
14282 echo "No index() or strchr() found!" >&4
14287 set d_strchr; eval $setvar
14289 set d_index; eval $setvar
14291 : check whether inet_aton exists
14292 set inet_aton d_inetaton
14297 $cat >isascii.c <<EOCP
14300 #$i_stdlib I_STDLIB
14302 #include <stdlib.h>
14313 if eval $compile; then
14314 echo "isascii() found." >&4
14317 echo "isascii() NOT found." >&4
14324 : see if isfinite exists
14325 set isfinite d_isfinite
14328 : see if isinf exists
14332 : see if isnan exists
14336 : see if isnanl exists
14337 set isnanl d_isnanl
14340 : see if killpg exists
14341 set killpg d_killpg
14344 : see if lchown exists
14346 $cat > try.c <<'EOCP'
14347 /* System header to define __stub macros and hopefully few prototypes,
14348 which can conflict with char lchown(); below. */
14349 #include <assert.h>
14350 /* Override any gcc2 internal prototype to avoid an error. */
14351 /* We use char because int might match the return type of a gcc2
14352 builtin and then its argument prototype would still apply. */
14355 /* The GNU C library defines this for functions which it implements
14356 to always fail with ENOSYS. Some functions are actually named
14357 something starting with __ and the normal name is an alias. */
14358 #if defined (__stub_lchown) || defined (__stub___lchown)
14366 if eval $compile; then
14367 $echo "lchown() found." >&4
14370 $echo "lchown() NOT found." >&4
14376 : See if number of significant digits in a double precision number is known
14378 $cat >ldbl_dig.c <<EOM
14379 #$i_limits I_LIMITS
14382 #include <limits.h>
14388 printf("Contains LDBL_DIG");
14391 $cppstdin $cppflags $cppminus < ldbl_dig.c >ldbl_dig.E 2>/dev/null
14392 if $contains 'LDBL_DIG' ldbl_dig.E >/dev/null 2>&1; then
14393 echo "LDBL_DIG found." >&4
14396 echo "LDBL_DIG NOT found." >&4
14403 : see if this is a math.h system
14407 d_libm_lib_version="$undef"
14410 : check to see if math.h defines _LIB_VERSION
14412 echo "Checking to see if your libm supports _LIB_VERSION..." >&4
14414 #include <unistd.h>
14416 int main (int argc, char *argv[])
14418 printf ("%d\n", _LIB_VERSION);
14423 if eval $compile; then
14425 echo "Yes, it does ($foo)" >&4
14426 d_libm_lib_version="$define"
14428 echo "No, it does not (probably harmless)\n" >&4
14430 $rm -f try.* try core core.try.*
14435 : see if link exists
14439 : see if localtime_r exists
14440 set localtime_r d_localtime_r
14442 case "$d_localtime_r" in
14444 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
14445 case "$d_localtime_r_proto:$usethreads" in
14446 ":define") d_localtime_r_proto=define
14447 set d_localtime_r_proto localtime_r $hdrs
14451 case "$d_localtime_r_proto" in
14453 case "$localtime_r_proto" in
14454 ''|0) try='struct tm* localtime_r(const time_t*, struct tm*);'
14455 ./protochk "extern $try" $hdrs && localtime_r_proto=S_TS ;;
14457 case "$localtime_r_proto" in
14458 ''|0) try='int localtime_r(const time_t*, struct tm*);'
14459 ./protochk "extern $try" $hdrs && localtime_r_proto=I_TS ;;
14461 case "$localtime_r_proto" in
14462 ''|0) d_localtime_r=undef
14463 localtime_r_proto=0
14464 echo "Disabling localtime_r, cannot determine prototype." >&4 ;;
14465 * ) case "$localtime_r_proto" in
14466 REENTRANT_PROTO*) ;;
14467 *) localtime_r_proto="REENTRANT_PROTO_$localtime_r_proto" ;;
14469 echo "Prototype: $try" ;;
14472 *) case "$usethreads" in
14473 define) echo "localtime_r has no prototype, not using it." >&4 ;;
14475 d_localtime_r=undef
14476 localtime_r_proto=0
14480 *) localtime_r_proto=0
14484 : see if localeconv exists
14485 set localeconv d_locconv
14488 : see if lockf exists
14492 : see if prototype for lseek is available
14494 set d_lseekproto lseek $i_systypes sys/types.h $i_unistd unistd.h
14497 : see if lstat exists
14501 : see if madvise exists
14502 set madvise d_madvise
14505 : see if malloc_size exists
14506 set malloc_size d_malloc_size
14509 : see if malloc_size_good exists
14510 set malloc_good_size d_malloc_good_size
14513 : see if mblen exists
14517 : see if mbstowcs exists
14518 set mbstowcs d_mbstowcs
14521 : see if mbtowc exists
14522 set mbtowc d_mbtowc
14525 : see if memchr exists
14526 set memchr d_memchr
14529 : see if memcmp exists
14530 set memcmp d_memcmp
14533 : see if memcpy exists
14534 set memcpy d_memcpy
14537 : see if memmove exists
14538 set memmove d_memmove
14541 : see if memset exists
14542 set memset d_memset
14545 : see if mkdir exists
14549 : see if mkdtemp exists
14550 set mkdtemp d_mkdtemp
14553 : see if mkfifo exists
14554 set mkfifo d_mkfifo
14557 : see if mkstemp exists
14558 set mkstemp d_mkstemp
14561 : see if mkstemps exists
14562 set mkstemps d_mkstemps
14565 : see if mktime exists
14566 set mktime d_mktime
14569 : see if this is a sys/mman.h system
14570 set sys/mman.h i_sysmman
14573 : see if mmap exists
14576 : see what shmat returns
14577 : default to something harmless
14579 case "$i_sysmman$d_mmap" in
14581 $cat >mmap.c <<'END'
14582 #include <sys/mman.h>
14585 if $cc $ccflags -c mmap.c >/dev/null 2>&1; then
14590 echo "and it returns ($mmaptype)." >&4
14596 : see if sqrtl exists
14600 : see if scalbnl exists
14601 set scalbnl d_scalbnl
14604 : see if modfl exists
14608 : see if prototype for modfl is available
14610 set d_modflproto modfl $i_math math.h
14613 d_modfl_pow32_bug="$undef"
14615 case "$d_longdbl$d_modfl" in
14618 Checking to see whether your modfl() is okay for large values...
14624 if $test "X$d_modflproto" != "X$define"; then
14625 $cat >>try.c <<EOCP
14626 /* Sigh. many current glibcs provide the function, but do not prototype it. */
14627 long double modfl (long double, long double *);
14630 $cat >>try.c <<EOCP
14632 long double nv = 4294967303.15;
14638 printf(" %"$sPRIfldbl" %"$sPRIfldbl" %"$sPRIfldbl"\n", nv, v, w);
14642 case "$osname:$gccversion" in
14643 aix:) saveccflags="$ccflags"
14644 ccflags="$ccflags -qlongdouble" ;; # to avoid core dump
14647 if eval $compile; then
14650 *" 4294967303.150000 1.150000 4294967302.000000")
14651 echo >&4 "Your modfl() is broken for large values."
14652 d_modfl_pow32_bug="$define"
14654 glibc) echo >&4 "You should upgrade your glibc to at least 2.2.2 to get a fixed modfl()."
14658 *" 4294967303.150000 0.150000 4294967303.000000")
14659 echo >&4 "Your modfl() seems okay for large values."
14661 *) echo >&4 "I don't understand your modfl() at all."
14665 $rm -f try.* try core core.try.*
14667 echo "I cannot figure out whether your modfl() is okay, assuming it isn't."
14670 case "$osname:$gccversion" in
14671 aix:) ccflags="$saveccflags" ;; # restore
14676 if $test "$uselongdouble" = "$define"; then
14678 if $test "$d_sqrtl" != "$define"; then
14679 message="$message sqrtl"
14681 if $test "$d_modfl" != "$define"; then
14682 if $test "$d_aintl:$d_copysignl" = "$define:$define"; then
14683 echo "You have both aintl and copysignl, so I can emulate modfl."
14685 message="$message modfl"
14688 if $test "$d_frexpl" != "$define"; then
14689 if $test "$d_ilogbl:$d_scalbnl" = "$define:$define"; then
14690 echo "You have both ilogbl and scalbnl, so I can emulate frexpl."
14692 message="$message frexpl"
14696 if $test "$message" != ""; then
14699 *** You requested the use of long doubles but you do not seem to have
14700 *** the following mathematical functions needed for long double support:
14702 *** Please rerun Configure without -Duselongdouble and/or -Dusemorebits.
14703 *** Cannot continue, aborting.
14711 : see if mprotect exists
14712 set mprotect d_mprotect
14715 : see if msgctl exists
14716 set msgctl d_msgctl
14719 : see if msgget exists
14720 set msgget d_msgget
14723 : see if msgsnd exists
14724 set msgsnd d_msgsnd
14727 : see if msgrcv exists
14728 set msgrcv d_msgrcv
14731 : see how much of the 'msg*(2)' library is present.
14734 case "$d_msgctl$d_msgget$d_msgsnd$d_msgrcv" in
14735 *"$undef"*) h_msg=false;;
14739 case "`ipcs 2>&1`" in
14740 "SVID messages"*"not configured"*)
14741 echo "Your $osname does not have the msg*(2) configured." >&4
14744 set msgctl d_msgctl
14746 set msgget d_msgget
14748 set msgsnd d_msgsnd
14750 set msgrcv d_msgrcv
14756 : we could also check for sys/ipc.h ...
14757 if $h_msg && $test `./findhdr sys/msg.h`; then
14758 echo "You have the full msg*(2) library." >&4
14761 echo "You don't have the full msg*(2) library." >&4
14769 echo "Checking to see if your system supports struct msghdr..." >&4
14770 set d_msghdr_s msghdr $i_systypes sys/types.h $d_socket sys/socket.h $i_sysuio sys/uio.h
14772 case "$d_msghdr_s" in
14773 "$define") echo "Yes, it does." ;;
14774 *) echo "No, it doesn't." ;;
14778 : see if msync exists
14782 : see if munmap exists
14783 set munmap d_munmap
14786 : see if nice exists
14790 : see if this is a langinfo.h system
14791 set langinfo.h i_langinfo
14794 : see if nl_langinfo exists
14795 set nl_langinfo d_nl_langinfo
14798 : check for length of character
14800 case "$charsize" in
14802 echo "Checking to see how big your characters are (hey, you never know)..." >&4
14805 #$i_stdlib I_STDLIB
14807 #include <stdlib.h>
14811 printf("%d\n", (int)sizeof(char));
14816 if eval $compile_ok; then
14820 echo "(I can't seem to compile the test program. Guessing...)"
14827 rp="What is the size of a character (in bytes)?"
14832 : check for volatile keyword
14834 echo 'Checking to see if your C compiler knows about "volatile"...' >&4
14835 $cat >try.c <<'EOCP'
14838 typedef struct _goo_struct goo_struct;
14839 goo_struct * volatile goo = ((goo_struct *)0);
14840 struct _goo_struct {
14845 typedef unsigned short foo_t;
14846 char *volatile foo;
14848 volatile foo_t blech;
14852 if $cc -c $ccflags try.c >/dev/null 2>&1 ; then
14854 echo "Yup, it does."
14857 echo "Nope, it doesn't."
14865 $echo "Choosing the C types to be used for Perl's internal types..." >&4
14867 case "$use64bitint:$d_quad:$quadtype" in
14870 uvtype="$uquadtype"
14875 uvtype="unsigned long"
14881 case "$uselongdouble:$d_longdbl" in
14883 nvtype="long double"
14884 nvsize=$longdblsize
14891 $echo "(IV will be "$ivtype", $ivsize bytes)"
14892 $echo "(UV will be "$uvtype", $uvsize bytes)"
14893 $echo "(NV will be "$nvtype", $nvsize bytes)"
14896 #$i_inttypes I_INTTYPES
14898 #include <inttypes.h>
14903 int8_t i = INT8_MAX;
14904 uint8_t u = UINT8_MAX;
14905 printf("int8_t\n");
14908 int16_t i = INT16_MAX;
14909 uint16_t i = UINT16_MAX;
14910 printf("int16_t\n");
14913 int32_t i = INT32_MAX;
14914 uint32_t u = UINT32_MAX;
14915 printf("int32_t\n");
14921 '') case "$charsize" in
14923 u8type="unsigned char"
14932 if eval $compile; then
14933 case "`$run ./try`" in
14934 int8_t) i8type=int8_t
14944 '') if $test $charsize -ge 1; then
14946 u8type="unsigned char"
14954 '') case "$shortsize" in
14956 u16type="unsigned short"
14964 '') set try -DINT16
14965 if eval $compile; then
14966 case "`$run ./try`" in
14978 '') if $test $shortsize -ge 2; then
14980 u16type="unsigned short"
14988 '') case "$longsize" in
14990 u32type="unsigned long"
14994 *) case "$intsize" in
14996 u32type="unsigned int"
15006 '') set try -DINT32
15007 if eval $compile; then
15008 case "`$run ./try`" in
15020 '') if $test $intsize -ge 4; then
15022 u32type="unsigned int"
15030 '') case "$d_quad:$quadtype" in
15032 i64type="$quadtype"
15033 u64type="$uquadtype"
15041 $echo "Checking how many bits of your UVs your NVs can preserve..." >&4
15042 : volatile so that the compiler has to store it out to memory.
15043 if test X"$d_volatile" = X"$define"; then
15048 #$i_stdlib I_STDLIB
15050 #include <stdlib.h>
15052 #include <sys/types.h>
15053 #include <signal.h>
15055 $volatile int bletched = 0;
15056 $signal_t blech(int s) { bletched = 1; }
15061 int n = 8 * $uvsize;
15064 signal(SIGFPE, blech);
15067 for (i = 0; i < n; i++) {
15068 u = u << 1 | ($uvtype)1;
15070 if (($uvtype)d != u)
15074 d = ($nvtype)(u - 1);
15075 if (($uvtype)d != (u - 1))
15083 printf("%d\n", ((i == n) ? -n : i));
15089 d_nv_preserves_uv="$undef"
15090 if eval $compile; then
15091 nv_preserves_uv_bits="`$run ./try`"
15093 case "$nv_preserves_uv_bits" in
15095 nv_preserves_uv_bits=`expr 0 - $nv_preserves_uv_bits`
15096 $echo "Your NVs can preserve all $nv_preserves_uv_bits bits of your UVs." 2>&1
15097 d_nv_preserves_uv="$define"
15099 [1-9]*) $echo "Your NVs can preserve only $nv_preserves_uv_bits bits of your UVs." 2>&1
15100 d_nv_preserves_uv="$undef" ;;
15101 *) $echo "Can't figure out how many bits your NVs preserve." 2>&1
15102 nv_preserves_uv_bits="$undef" ;;
15107 $echo "Checking whether NV 0.0 is all bits zero in memory..." >&4
15108 : volatile so that the compiler has to store it out to memory.
15109 if test X"$d_volatile" = X"$define"; then
15114 #$i_stdlib I_STDLIB
15116 #include <stdlib.h>
15118 #$i_string I_STRING
15120 # include <string.h>
15122 # include <strings.h>
15124 #include <sys/types.h>
15125 #include <signal.h>
15127 $volatile int bletched = 0;
15128 $signal_t blech(int s) { bletched = 1; }
15131 int checkit($nvtype d, char *where) {
15132 unsigned char *p = (char *)&d;
15133 unsigned char *end = p + sizeof(d);
15143 printf("No - %s: 0x", where);
15145 printf ("%02X", *p++);
15150 int main(int argc, char **argv) {
15153 fail += checkit(d, "0.0");
15155 /* The compiler shouldn't be assuming that bletched is 0 */
15158 fail += checkit(d, "bleched");
15161 signal(SIGFPE, blech);
15164 /* Paranoia - the compiler should have no way of knowing that ANSI says
15165 that argv[argc] will always be NULL. Actually, if it did assume this it
15166 would be buggy, as this is C and main() can be called from elsewhere in
15168 d = argv[argc] ? 1 : 0;
15171 printf("Odd argv[argc]=%p, d=%g\n", argv[argc], d);
15174 fail += checkit(d, "ternary");
15176 memset(&d, sizeof(d), argv[argc] ? 1 : 0);
15179 printf("No - memset doesn't give 0.0\n");
15180 /* This might just blow up: */
15181 printf("(gives %g)\n", d);
15187 printf("No - something bleched\n");
15192 printf("No - %d fail(s)\n", fail);
15201 d_nv_zero_is_allbits_zero="$undef"
15202 if eval $compile; then
15208 0.0 is represented as all bits zero in memory
15210 d_nv_zero_is_allbits_zero="$define"
15213 0.0 is not represented as all bits zero in memory
15215 d_nv_zero_is_allbits_zero="$undef"
15220 0.0 is not represented as all bits zero in memory
15222 d_nv_zero_is_allbits_zero="$undef"
15230 : check for off64_t
15232 echo "Checking to see if you have off64_t..." >&4
15234 #include <sys/types.h>
15235 #include <unistd.h>
15236 int main() { off64_t x = 7; }
15239 if eval $compile; then
15241 echo "You have off64_t."
15244 echo "You do not have off64_t."
15245 case "$lseeksize" in
15246 8) echo "(Your off_t is 64 bits, so you could use that.)" ;;
15253 : how to create joinable pthreads
15254 if test "X$usethreads" = "X$define" -a "X$i_pthread" = "X$define"; then
15256 echo "Checking what constant to use for creating joinable pthreads..." >&4
15257 $cat >try.c <<'EOCP'
15258 #include <pthread.h>
15260 int detachstate = JOINABLE;
15263 set try -DJOINABLE=PTHREAD_CREATE_JOINABLE
15264 if eval $compile; then
15265 echo "You seem to use PTHREAD_CREATE_JOINABLE." >&4
15266 val="$undef" # Yes, undef.
15267 set d_old_pthread_create_joinable
15270 set old_pthread_create_joinable
15273 set try -DJOINABLE=PTHREAD_CREATE_UNDETACHED
15274 if eval $compile; then
15275 echo "You seem to use PTHREAD_CREATE_UNDETACHED." >&4
15277 set d_old_pthread_create_joinable
15279 val=PTHREAD_CREATE_UNDETACHED
15280 set old_pthread_create_joinable
15283 set try -DJOINABLE=__UNDETACHED
15284 if eval $compile; then
15285 echo "You seem to use __UNDETACHED." >&4
15287 set d_old_pthread_create_joinable
15290 set old_pthread_create_joinable
15293 echo "Egads, nothing obvious found. Guessing that you use 0." >&4
15295 set d_old_pthread_create_joinable
15298 set old_pthread_create_joinable
15305 d_old_pthread_create_joinable="$undef"
15306 old_pthread_create_joinable=""
15309 : see if pause exists
15313 : see if pipe exists
15317 : see if poll exists
15321 : see if readlink exists
15322 set readlink d_readlink
15328 case "$d_readlink" in
15330 if $issymlink /proc/self/exe ; then
15331 $ls -l /proc/self/exe > reflect
15332 if $contains /`basename $ls` reflect >/dev/null 2>&1; then
15333 echo "You have Linux-like /proc/self/exe."
15334 procselfexe='"/proc/self/exe"'
15338 if $issymlink /proc/curproc/file ; then
15339 $ls -l /proc/curproc/file > reflect
15340 if $contains /`basename $ls` reflect >/dev/null 2>&1; then
15341 echo "You have BSD-like /proc/curproc/file."
15342 procselfexe='"/proc/curproc/file"'
15352 : see whether the pthread_atfork exists
15354 #include <pthread.h>
15357 #ifdef PTHREAD_ATFORK
15358 pthread_atfork(NULL,NULL,NULL);
15363 : see if pthread_atfork exists
15364 set try -DPTHREAD_ATFORK
15365 if eval $compile; then
15370 case "$usethreads" in
15373 $define) echo 'pthread_atfork found.' >&4 ;;
15374 *) echo 'pthread_atfork NOT found.' >&4 ;;
15377 set d_pthread_atfork
15380 : see if pthread_attr_setscope exists
15381 set pthread_attr_setscope d_pthread_attr_setscope
15385 : see whether the various POSIXish _yields exist
15387 #include <pthread.h>
15393 #ifdef PTHREAD_YIELD
15396 #ifdef PTHREAD_YIELD_NULL
15397 pthread_yield(NULL);
15403 : see if sched_yield exists
15404 set try -DSCHED_YIELD
15405 if eval $compile; then
15407 sched_yield='sched_yield()'
15411 case "$usethreads" in
15414 $define) echo 'sched_yield() found.' >&4 ;;
15415 *) echo 'sched_yield() NOT found.' >&4 ;;
15421 : see if pthread_yield exists
15422 set try -DPTHREAD_YIELD
15423 if eval $compile; then
15425 case "$sched_yield" in
15426 '') sched_yield='pthread_yield()' ;;
15429 set try -DPTHREAD_YIELD_NULL
15430 if eval $compile; then
15432 case "$sched_yield" in
15433 '') sched_yield='pthread_yield(NULL)' ;;
15439 case "$usethreads" in
15442 $define) echo 'pthread_yield() found.' >&4 ;;
15443 *) echo 'pthread_yield() NOT found.' >&4 ;;
15447 set d_pthread_yield
15450 case "$sched_yield" in
15451 '') sched_yield=undef ;;
15456 : see if random_r exists
15457 set random_r d_random_r
15459 case "$d_random_r" in
15461 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
15462 case "$d_random_r_proto:$usethreads" in
15463 ":define") d_random_r_proto=define
15464 set d_random_r_proto random_r $hdrs
15468 case "$d_random_r_proto" in
15470 case "$random_r_proto" in
15471 ''|0) try='int random_r(int*, struct random_data*);'
15472 ./protochk "extern $try" $hdrs && random_r_proto=I_iS ;;
15474 case "$random_r_proto" in
15475 ''|0) try='int random_r(long*, struct random_data*);'
15476 ./protochk "extern $try" $hdrs && random_r_proto=I_lS ;;
15478 case "$random_r_proto" in
15479 ''|0) try='int random_r(struct random_data*, int32_t*);'
15480 ./protochk "extern $try" $hdrs && random_r_proto=I_St ;;
15482 case "$random_r_proto" in
15483 ''|0) d_random_r=undef
15485 echo "Disabling random_r, cannot determine prototype." >&4 ;;
15486 * ) case "$random_r_proto" in
15487 REENTRANT_PROTO*) ;;
15488 *) random_r_proto="REENTRANT_PROTO_$random_r_proto" ;;
15490 echo "Prototype: $try" ;;
15493 *) case "$usethreads" in
15494 define) echo "random_r has no prototype, not using it." >&4 ;;
15501 *) random_r_proto=0
15505 : see if readdir and friends exist
15506 set readdir d_readdir
15508 set seekdir d_seekdir
15510 set telldir d_telldir
15512 set rewinddir d_rewinddir
15515 : see if readdir64_r exists
15516 set readdir64_r d_readdir64_r
15518 case "$d_readdir64_r" in
15520 hdrs="$i_systypes sys/types.h define stdio.h $i_dirent dirent.h"
15521 case "$d_readdir64_r_proto:$usethreads" in
15522 ":define") d_readdir64_r_proto=define
15523 set d_readdir64_r_proto readdir64_r $hdrs
15527 case "$d_readdir64_r_proto" in
15529 case "$readdir64_r_proto" in
15530 ''|0) try='int readdir64_r(DIR*, struct dirent64*, struct dirent64**);'
15531 ./protochk "extern $try" $hdrs && readdir64_r_proto=I_TSR ;;
15533 case "$readdir64_r_proto" in
15534 ''|0) try='int readdir64_r(DIR*, struct dirent64*);'
15535 ./protochk "extern $try" $hdrs && readdir64_r_proto=I_TS ;;
15537 case "$readdir64_r_proto" in
15538 ''|0) d_readdir64_r=undef
15539 readdir64_r_proto=0
15540 echo "Disabling readdir64_r, cannot determine prototype." >&4 ;;
15541 * ) case "$readdir64_r_proto" in
15542 REENTRANT_PROTO*) ;;
15543 *) readdir64_r_proto="REENTRANT_PROTO_$readdir64_r_proto" ;;
15545 echo "Prototype: $try" ;;
15548 *) case "$usethreads" in
15549 define) echo "readdir64_r has no prototype, not using it." >&4 ;;
15551 d_readdir64_r=undef
15552 readdir64_r_proto=0
15556 *) readdir64_r_proto=0
15560 : see if readdir_r exists
15561 set readdir_r d_readdir_r
15563 case "$d_readdir_r" in
15565 hdrs="$i_systypes sys/types.h define stdio.h $i_dirent dirent.h"
15566 case "$d_readdir_r_proto:$usethreads" in
15567 ":define") d_readdir_r_proto=define
15568 set d_readdir_r_proto readdir_r $hdrs
15572 case "$d_readdir_r_proto" in
15574 case "$readdir_r_proto" in
15575 ''|0) try='int readdir_r(DIR*, struct dirent*, struct dirent**);'
15576 ./protochk "extern $try" $hdrs && readdir_r_proto=I_TSR ;;
15578 case "$readdir_r_proto" in
15579 ''|0) try='int readdir_r(DIR*, struct dirent*);'
15580 ./protochk "extern $try" $hdrs && readdir_r_proto=I_TS ;;
15582 case "$readdir_r_proto" in
15583 ''|0) d_readdir_r=undef
15585 echo "Disabling readdir_r, cannot determine prototype." >&4 ;;
15586 * ) case "$readdir_r_proto" in
15587 REENTRANT_PROTO*) ;;
15588 *) readdir_r_proto="REENTRANT_PROTO_$readdir_r_proto" ;;
15590 echo "Prototype: $try" ;;
15593 *) case "$usethreads" in
15594 define) echo "readdir_r has no prototype, not using it." >&4 ;;
15601 *) readdir_r_proto=0
15605 : see if readv exists
15609 : see if recvmsg exists
15610 set recvmsg d_recvmsg
15613 : see if rename exists
15614 set rename d_rename
15617 : see if rmdir exists
15621 : see if memory.h is available.
15626 : See if it conflicts with string.h
15632 $cppstdin $cppflags $cppminus < $strings > mem.h
15633 if $contains 'memcpy' mem.h >/dev/null 2>&1; then
15635 echo "We won't be including <memory.h>."
15645 : can bcopy handle overlapping blocks?
15648 case "$d_memmove" in
15649 "$define") echo "I'll use memmove() instead of bcopy() for overlapping copies." ;;
15650 *) case "$d_bcopy" in
15652 echo "Checking to see if bcopy() can do overlapping copies..." >&4
15654 #$i_memory I_MEMORY
15655 #$i_stdlib I_STDLIB
15656 #$i_string I_STRING
15657 #$i_unistd I_UNISTD
15659 $cat >>try.c <<'EOCP'
15662 # include <memory.h>
15665 # include <stdlib.h>
15668 # include <string.h>
15670 # include <strings.h>
15673 # include <unistd.h> /* Needed for NetBSD */
15677 char buf[128], abc[128];
15683 /* Copy "abcde..." string to char abc[] so that gcc doesn't
15684 try to store the string in read-only memory. */
15685 bcopy("abcdefghijklmnopqrstuvwxyz0123456789", abc, 36);
15687 for (align = 7; align >= 0; align--) {
15688 for (len = 36; len; len--) {
15690 bcopy(abc, b, len);
15691 for (off = 1; off <= len; off++) {
15692 bcopy(b, b+off, len);
15693 bcopy(b+off, b, len);
15694 if (bcmp(b, abc, len))
15703 if eval $compile_ok; then
15704 if ./try 2>/dev/null; then
15705 echo "Yes, it can."
15708 echo "It can't, sorry."
15711 echo "(I can't compile the test program, so we'll assume not...)"
15715 $rm -f try.* try core
15721 : can memcpy handle overlapping blocks?
15724 case "$d_memmove" in
15725 "$define") echo "I'll use memmove() instead of memcpy() for overlapping copies." ;;
15726 *) case "$d_memcpy" in
15728 echo "Checking to see if memcpy() can do overlapping copies..." >&4
15730 #$i_memory I_MEMORY
15731 #$i_stdlib I_STDLIB
15732 #$i_string I_STRING
15733 #$i_unistd I_UNISTD
15735 $cat >>try.c <<'EOCP'
15738 # include <memory.h>
15741 # include <stdlib.h>
15744 # include <string.h>
15746 # include <strings.h>
15749 # include <unistd.h> /* Needed for NetBSD */
15753 char buf[128], abc[128];
15759 /* Copy "abcde..." string to char abc[] so that gcc doesn't
15760 try to store the string in read-only memory. */
15761 memcpy(abc, "abcdefghijklmnopqrstuvwxyz0123456789", 36);
15763 for (align = 7; align >= 0; align--) {
15764 for (len = 36; len; len--) {
15766 memcpy(b, abc, len);
15767 for (off = 1; off <= len; off++) {
15768 memcpy(b+off, b, len);
15769 memcpy(b, b+off, len);
15770 if (memcmp(b, abc, len))
15779 if eval $compile_ok; then
15780 if ./try 2>/dev/null; then
15781 echo "Yes, it can."
15784 echo "It can't, sorry."
15787 echo "(I can't compile the test program, so we'll assume not...)"
15791 $rm -f try.* try core
15797 : can memcmp be trusted to compare relative magnitude?
15799 case "$d_memcmp" in
15802 echo "Checking if your memcmp() can compare relative magnitude..." >&4
15804 #$i_memory I_MEMORY
15805 #$i_stdlib I_STDLIB
15806 #$i_string I_STRING
15807 #$i_unistd I_UNISTD
15809 $cat >>try.c <<'EOCP'
15812 # include <memory.h>
15815 # include <stdlib.h>
15818 # include <string.h>
15820 # include <strings.h>
15823 # include <unistd.h> /* Needed for NetBSD */
15829 if ((a < b) && memcmp(&a, &b, 1) < 0)
15835 if eval $compile_ok; then
15836 if $run ./try 2>/dev/null; then
15837 echo "Yes, it can."
15840 echo "No, it can't (it uses signed chars)."
15843 echo "(I can't compile the test program, so we'll assume not...)"
15847 $rm -f try.* try core
15851 : see if prototype for sbrk is available
15853 set d_sbrkproto sbrk $i_unistd unistd.h
15856 : see if select exists
15857 set select d_select
15860 : see if semctl exists
15861 set semctl d_semctl
15864 : see if semget exists
15865 set semget d_semget
15868 : see if semop exists
15872 : see how much of the 'sem*(2)' library is present.
15875 case "$d_semctl$d_semget$d_semop" in
15876 *"$undef"*) h_sem=false;;
15880 case "`ipcs 2>&1`" in
15881 "SVID messages"*"not configured"*)
15882 echo "Your $osname does not have the sem*(2) configured." >&4
15885 set semctl d_semctl
15887 set semget d_semget
15895 : we could also check for sys/ipc.h ...
15896 if $h_sem && $test `./findhdr sys/sem.h`; then
15897 echo "You have the full sem*(2) library." >&4
15900 echo "You don't have the full sem*(2) library." >&4
15906 : see whether sys/sem.h defines union semun
15908 $cat > try.c <<'END'
15909 #include <sys/types.h>
15910 #include <sys/ipc.h>
15911 #include <sys/sem.h>
15912 int main () { union semun semun; semun.buf = 0; }
15915 if eval $compile; then
15916 echo "You have union semun in <sys/sem.h>." >&4
15919 echo "You do not have union semun in <sys/sem.h>." >&4
15926 : see how to do semctl IPC_STAT
15933 # define S_IRUSR S_IREAD
15934 # define S_IWUSR S_IWRITE
15935 # define S_IXUSR S_IEXEC
15937 # define S_IRUSR 0400
15938 # define S_IWUSR 0200
15939 # define S_IXUSR 0100
15941 # define S_IRGRP (S_IRUSR>>3)
15942 # define S_IWGRP (S_IWUSR>>3)
15943 # define S_IXGRP (S_IXUSR>>3)
15944 # define S_IROTH (S_IRUSR>>6)
15945 # define S_IWOTH (S_IWUSR>>6)
15946 # define S_IXOTH (S_IXUSR>>6)
15949 # define S_IRWXU (S_IRUSR|S_IWUSR|S_IXUSR)
15950 # define S_IRWXG (S_IRGRP|S_IWGRP|S_IXGRP)
15951 # define S_IRWXO (S_IROTH|S_IWOTH|S_IXOTH)
15954 : see whether semctl IPC_STAT can use union semun
15955 case "$d_semctl_semun" in
15959 #include <sys/types.h>
15960 #include <sys/ipc.h>
15961 #include <sys/sem.h>
15962 #include <sys/stat.h>
15969 #$d_union_semun HAS_UNION_SEMUN
15972 #ifndef HAS_UNION_SEMUN
15975 struct semid_ds *buf;
15976 unsigned short *array;
15982 #if defined(IPC_PRIVATE) && defined(S_IRWXU) && defined(S_IRWXG) && defined(S_IRWXO) && defined(IPC_CREAT)
15983 sem = semget(IPC_PRIVATE, 1, S_IRWXU|S_IRWXG|S_IRWXO|IPC_CREAT);
15985 struct semid_ds argbuf;
15988 st = semctl(sem, 0, IPC_STAT, arg);
15992 # endif /* IPC_STAT */
15993 printf("semctl IPC_STAT failed: errno = %d\n", errno);
15995 if (semctl(sem, 0, IPC_RMID, arg) != 0)
15996 # endif /* IPC_RMID */
15997 printf("semctl IPC_RMID failed: errno = %d\n", errno);
15999 #endif /* IPC_PRIVATE && ... */
16000 printf("semget failed: errno = %d\n", errno);
16005 if eval $compile; then
16008 semun) val="$define" ;;
16016 case "$d_semctl_semun" in
16018 echo "You can use union semun for semctl IPC_STAT." >&4
16021 *) echo "You cannot use union semun for semctl IPC_STAT." >&4
16026 : see whether semctl IPC_STAT can use struct semid_ds pointer
16027 case "$d_semctl_semid_ds" in
16030 $cat > try.c <<'END'
16031 #include <sys/types.h>
16032 #include <sys/ipc.h>
16033 #include <sys/sem.h>
16034 #include <sys/stat.h>
16042 struct semid_ds arg;
16045 #if defined(IPC_PRIVATE) && defined(S_IRWXU) && defined(S_IRWXG) && defined(S_IRWXO) && defined(IPC_CREAT)
16046 sem = semget(IPC_PRIVATE, 1, S_IRWXU|S_IRWXG|S_IRWXO|IPC_CREAT);
16049 st = semctl(sem, 0, IPC_STAT, &arg);
16051 printf("semid_ds\n");
16053 # endif /* IPC_STAT */
16054 printf("semctl IPC_STAT failed: errno = %d\n", errno);
16056 if (semctl(sem, 0, IPC_RMID, &arg) != 0)
16057 # endif /* IPC_RMID */
16058 printf("semctl IPC_RMID failed: errno = %d\n", errno);
16060 #endif /* IPC_PRIVATE && ... */
16061 printf("semget failed: errno = %d\n", errno);
16067 if eval $compile; then
16070 semid_ds) val="$define" ;;
16074 set d_semctl_semid_ds
16078 case "$d_semctl_semid_ds" in
16080 echo "You can $also use struct semid_ds* for semctl IPC_STAT." >&4
16082 *) echo "You cannot use struct semid_ds* for semctl IPC_STAT." >&4
16089 # We do not have the full sem*(2) library, so assume we can not
16095 set d_semctl_semid_ds
16100 : see if sendmsg exists
16101 set sendmsg d_sendmsg
16104 : see if setegid exists
16105 set setegid d_setegid
16108 : see if seteuid exists
16109 set seteuid d_seteuid
16112 : see if setgrent exists
16113 set setgrent d_setgrent
16116 : see if setgrent_r exists
16117 set setgrent_r d_setgrent_r
16119 case "$d_setgrent_r" in
16121 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
16122 case "$d_setgrent_r_proto:$usethreads" in
16123 ":define") d_setgrent_r_proto=define
16124 set d_setgrent_r_proto setgrent_r $hdrs
16128 case "$d_setgrent_r_proto" in
16130 case "$setgrent_r_proto" in
16131 ''|0) try='int setgrent_r(FILE**);'
16132 ./protochk "extern $try" $hdrs && setgrent_r_proto=I_H ;;
16134 case "$setgrent_r_proto" in
16135 ''|0) try='void setgrent_r(FILE**);'
16136 ./protochk "extern $try" $hdrs && setgrent_r_proto=V_H ;;
16138 case "$setgrent_r_proto" in
16139 ''|0) d_setgrent_r=undef
16141 echo "Disabling setgrent_r, cannot determine prototype." >&4 ;;
16142 * ) case "$setgrent_r_proto" in
16143 REENTRANT_PROTO*) ;;
16144 *) setgrent_r_proto="REENTRANT_PROTO_$setgrent_r_proto" ;;
16146 echo "Prototype: $try" ;;
16149 *) case "$usethreads" in
16150 define) echo "setgrent_r has no prototype, not using it." >&4 ;;
16157 *) setgrent_r_proto=0
16161 : see if sethostent exists
16162 set sethostent d_sethent
16165 : see if sethostent_r exists
16166 set sethostent_r d_sethostent_r
16168 case "$d_sethostent_r" in
16170 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
16171 case "$d_sethostent_r_proto:$usethreads" in
16172 ":define") d_sethostent_r_proto=define
16173 set d_sethostent_r_proto sethostent_r $hdrs
16177 case "$d_sethostent_r_proto" in
16179 case "$sethostent_r_proto" in
16180 ''|0) try='int sethostent_r(int, struct hostent_data*);'
16181 ./protochk "extern $try" $hdrs && sethostent_r_proto=I_ID ;;
16183 case "$sethostent_r_proto" in
16184 ''|0) try='void sethostent_r(int, struct hostent_data*);'
16185 ./protochk "extern $try" $hdrs && sethostent_r_proto=V_ID ;;
16187 case "$sethostent_r_proto" in
16188 ''|0) d_sethostent_r=undef
16189 sethostent_r_proto=0
16190 echo "Disabling sethostent_r, cannot determine prototype." >&4 ;;
16191 * ) case "$sethostent_r_proto" in
16192 REENTRANT_PROTO*) ;;
16193 *) sethostent_r_proto="REENTRANT_PROTO_$sethostent_r_proto" ;;
16195 echo "Prototype: $try" ;;
16198 *) case "$usethreads" in
16199 define) echo "sethostent_r has no prototype, not using it." >&4 ;;
16201 d_sethostent_r=undef
16202 sethostent_r_proto=0
16206 *) sethostent_r_proto=0
16210 : see if setitimer exists
16211 set setitimer d_setitimer
16214 : see if setlinebuf exists
16215 set setlinebuf d_setlinebuf
16218 : see if setlocale exists
16219 set setlocale d_setlocale
16222 : see if locale.h is available
16223 set locale.h i_locale
16226 : see if setlocale_r exists
16227 set setlocale_r d_setlocale_r
16229 case "$d_setlocale_r" in
16231 hdrs="$i_systypes sys/types.h define stdio.h $i_locale locale.h"
16232 case "$d_setlocale_r_proto:$usethreads" in
16233 ":define") d_setlocale_r_proto=define
16234 set d_setlocale_r_proto setlocale_r $hdrs
16238 case "$d_setlocale_r_proto" in
16240 case "$setlocale_r_proto" in
16241 ''|0) try='int setlocale_r(int, const char*, char*, int);'
16242 ./protochk "extern $try" $hdrs && setlocale_r_proto=I_ICBI ;;
16244 case "$setlocale_r_proto" in
16245 ''|0) d_setlocale_r=undef
16246 setlocale_r_proto=0
16247 echo "Disabling setlocale_r, cannot determine prototype." >&4 ;;
16248 * ) case "$setlocale_r_proto" in
16249 REENTRANT_PROTO*) ;;
16250 *) setlocale_r_proto="REENTRANT_PROTO_$setlocale_r_proto" ;;
16252 echo "Prototype: $try" ;;
16255 *) case "$usethreads" in
16256 define) echo "setlocale_r has no prototype, not using it." >&4 ;;
16258 d_setlocale_r=undef
16259 setlocale_r_proto=0
16263 *) setlocale_r_proto=0
16267 : see if setnetent exists
16268 set setnetent d_setnent
16271 : see if setnetent_r exists
16272 set setnetent_r d_setnetent_r
16274 case "$d_setnetent_r" in
16276 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
16277 case "$d_setnetent_r_proto:$usethreads" in
16278 ":define") d_setnetent_r_proto=define
16279 set d_setnetent_r_proto setnetent_r $hdrs
16283 case "$d_setnetent_r_proto" in
16285 case "$setnetent_r_proto" in
16286 ''|0) try='int setnetent_r(int, struct netent_data*);'
16287 ./protochk "extern $try" $hdrs && setnetent_r_proto=I_ID ;;
16289 case "$setnetent_r_proto" in
16290 ''|0) try='void setnetent_r(int, struct netent_data*);'
16291 ./protochk "extern $try" $hdrs && setnetent_r_proto=V_ID ;;
16293 case "$setnetent_r_proto" in
16294 ''|0) d_setnetent_r=undef
16295 setnetent_r_proto=0
16296 echo "Disabling setnetent_r, cannot determine prototype." >&4 ;;
16297 * ) case "$setnetent_r_proto" in
16298 REENTRANT_PROTO*) ;;
16299 *) setnetent_r_proto="REENTRANT_PROTO_$setnetent_r_proto" ;;
16301 echo "Prototype: $try" ;;
16304 *) case "$usethreads" in
16305 define) echo "setnetent_r has no prototype, not using it." >&4 ;;
16307 d_setnetent_r=undef
16308 setnetent_r_proto=0
16312 *) setnetent_r_proto=0
16316 : see if setprotoent exists
16317 set setprotoent d_setpent
16320 : see if setpgid exists
16321 set setpgid d_setpgid
16324 : see if setpgrp2 exists
16325 set setpgrp2 d_setpgrp2
16328 : see if setpriority exists
16329 set setpriority d_setprior
16332 : see if setproctitle exists
16333 set setproctitle d_setproctitle
16336 : see if setprotoent_r exists
16337 set setprotoent_r d_setprotoent_r
16339 case "$d_setprotoent_r" in
16341 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
16342 case "$d_setprotoent_r_proto:$usethreads" in
16343 ":define") d_setprotoent_r_proto=define
16344 set d_setprotoent_r_proto setprotoent_r $hdrs
16348 case "$d_setprotoent_r_proto" in
16350 case "$setprotoent_r_proto" in
16351 ''|0) try='int setprotoent_r(int, struct protoent_data*);'
16352 ./protochk "extern $try" $hdrs && setprotoent_r_proto=I_ID ;;
16354 case "$setprotoent_r_proto" in
16355 ''|0) try='void setprotoent_r(int, struct protoent_data*);'
16356 ./protochk "extern $try" $hdrs && setprotoent_r_proto=V_ID ;;
16358 case "$setprotoent_r_proto" in
16359 ''|0) d_setprotoent_r=undef
16360 setprotoent_r_proto=0
16361 echo "Disabling setprotoent_r, cannot determine prototype." >&4 ;;
16362 * ) case "$setprotoent_r_proto" in
16363 REENTRANT_PROTO*) ;;
16364 *) setprotoent_r_proto="REENTRANT_PROTO_$setprotoent_r_proto" ;;
16366 echo "Prototype: $try" ;;
16369 *) case "$usethreads" in
16370 define) echo "setprotoent_r has no prototype, not using it." >&4 ;;
16372 d_setprotoent_r=undef
16373 setprotoent_r_proto=0
16377 *) setprotoent_r_proto=0
16381 : see if setpwent exists
16382 set setpwent d_setpwent
16385 : see if setpwent_r exists
16386 set setpwent_r d_setpwent_r
16388 case "$d_setpwent_r" in
16390 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
16391 case "$d_setpwent_r_proto:$usethreads" in
16392 ":define") d_setpwent_r_proto=define
16393 set d_setpwent_r_proto setpwent_r $hdrs
16397 case "$d_setpwent_r_proto" in
16399 case "$setpwent_r_proto" in
16400 ''|0) try='int setpwent_r(FILE**);'
16401 ./protochk "extern $try" $hdrs && setpwent_r_proto=I_H ;;
16403 case "$setpwent_r_proto" in
16404 ''|0) try='void setpwent_r(FILE**);'
16405 ./protochk "extern $try" $hdrs && setpwent_r_proto=V_H ;;
16407 case "$setpwent_r_proto" in
16408 ''|0) d_setpwent_r=undef
16410 echo "Disabling setpwent_r, cannot determine prototype." >&4 ;;
16411 * ) case "$setpwent_r_proto" in
16412 REENTRANT_PROTO*) ;;
16413 *) setpwent_r_proto="REENTRANT_PROTO_$setpwent_r_proto" ;;
16415 echo "Prototype: $try" ;;
16418 *) case "$usethreads" in
16419 define) echo "setpwent_r has no prototype, not using it." >&4 ;;
16426 *) setpwent_r_proto=0
16430 : see if setregid exists
16431 set setregid d_setregid
16433 set setresgid d_setresgid
16436 : see if setreuid exists
16437 set setreuid d_setreuid
16439 set setresuid d_setresuid
16442 : see if setrgid exists
16443 set setrgid d_setrgid
16446 : see if setruid exists
16447 set setruid d_setruid
16450 : see if setservent exists
16451 set setservent d_setsent
16454 : see if setservent_r exists
16455 set setservent_r d_setservent_r
16457 case "$d_setservent_r" in
16459 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
16460 case "$d_setservent_r_proto:$usethreads" in
16461 ":define") d_setservent_r_proto=define
16462 set d_setservent_r_proto setservent_r $hdrs
16466 case "$d_setservent_r_proto" in
16468 case "$setservent_r_proto" in
16469 ''|0) try='int setservent_r(int, struct servent_data*);'
16470 ./protochk "extern $try" $hdrs && setservent_r_proto=I_ID ;;
16472 case "$setservent_r_proto" in
16473 ''|0) try='void setservent_r(int, struct servent_data*);'
16474 ./protochk "extern $try" $hdrs && setservent_r_proto=V_ID ;;
16476 case "$setservent_r_proto" in
16477 ''|0) d_setservent_r=undef
16478 setservent_r_proto=0
16479 echo "Disabling setservent_r, cannot determine prototype." >&4 ;;
16480 * ) case "$setservent_r_proto" in
16481 REENTRANT_PROTO*) ;;
16482 *) setservent_r_proto="REENTRANT_PROTO_$setservent_r_proto" ;;
16484 echo "Prototype: $try" ;;
16487 *) case "$usethreads" in
16488 define) echo "setservent_r has no prototype, not using it." >&4 ;;
16490 d_setservent_r=undef
16491 setservent_r_proto=0
16495 *) setservent_r_proto=0
16499 : see if setsid exists
16500 set setsid d_setsid
16503 : see if setvbuf exists
16504 set setvbuf d_setvbuf
16507 : see if sfio.h is available
16512 : see if sfio library is available
16523 : Ok, but do we want to use it.
16527 true|$define|[yY]*) dflt='y';;
16530 echo "$package can use the sfio library, but it is experimental."
16531 case "$useperlio" in
16533 echo "For sfio also the PerlIO abstraction layer is needed."
16534 echo "Earlier you said you wouldn't want that."
16537 rp="You seem to have sfio available, do you want to try using it?"
16540 y|Y) echo "Ok, turning on both sfio and PerlIO, then."
16541 useperlio="$define"
16544 *) echo "Ok, avoiding sfio this time. I'll use stdio instead."
16549 *) case "$usesfio" in
16550 true|$define|[yY]*)
16551 echo "Sorry, cannot find sfio on this machine." >&4
16552 echo "Ignoring your setting of usesfio=$usesfio." >&4
16561 $define) usesfio='true';;
16562 *) usesfio='false';;
16566 *) : Remove sfio from list of libraries to use
16569 echo "Removing unneeded -lsfio from library list" >&4
16570 set `echo X $libs | $sed -e 's/-lsfio / /' -e 's/-lsfio$//'`
16573 echo "libs = $libs" >&4
16580 : see if shmctl exists
16581 set shmctl d_shmctl
16584 : see if shmget exists
16585 set shmget d_shmget
16588 : see if shmat exists
16591 : see what shmat returns
16594 $cat >shmat.c <<'END'
16595 #include <sys/shm.h>
16598 if $cc $ccflags -c shmat.c >/dev/null 2>&1; then
16603 echo "and it returns ($shmattype)." >&4
16604 : see if a prototype for shmat is available
16605 xxx=`./findhdr sys/shm.h`
16606 $cppstdin $cppflags $cppminus < $xxx > shmat.c 2>/dev/null
16607 if $contains 'shmat.*(' shmat.c >/dev/null 2>&1; then
16618 set d_shmatprototype
16621 : see if shmdt exists
16625 : see how much of the 'shm*(2)' library is present.
16628 case "$d_shmctl$d_shmget$d_shmat$d_shmdt" in
16629 *"$undef"*) h_shm=false;;
16633 case "`ipcs 2>&1`" in
16634 "SVID shared memory"*"not configured"*)
16635 echo "Your $osname does not have the shm*(2) configured." >&4
16638 set shmctl d_shmctl
16640 set shmget d_shmget
16650 : we could also check for sys/ipc.h ...
16651 if $h_shm && $test `./findhdr sys/shm.h`; then
16652 echo "You have the full shm*(2) library." >&4
16655 echo "You don't have the full shm*(2) library." >&4
16662 : see if we have sigaction
16663 if set sigaction val -f d_sigaction; eval $csym; $val; then
16664 echo 'sigaction() found.' >&4
16667 #include <sys/types.h>
16668 #include <signal.h>
16669 #$i_stdlib I_STDLIB
16671 #include <stdlib.h>
16675 struct sigaction act, oact;
16677 oact.sa_handler = 0;
16678 /* so that act and oact are used */
16679 exit(act.sa_flags == 0 && oact.sa_handler == 0);
16683 if eval $compile_ok; then
16686 echo "But you don't seem to have a useable struct sigaction." >&4
16690 echo 'sigaction NOT found.' >&4
16693 set d_sigaction; eval $setvar
16694 $rm -f try try$_o try.c
16696 : see if sigprocmask exists
16697 set sigprocmask d_sigprocmask
16700 : see if sigsetjmp exists
16702 case "$d_sigsetjmp" in
16705 #include <setjmp.h>
16706 #$i_stdlib I_STDLIB
16708 #include <stdlib.h>
16714 if (sigsetjmp(env,1))
16717 siglongjmp(env, 1);
16722 if eval $compile; then
16723 if $run ./try >/dev/null 2>&1; then
16724 echo "POSIX sigsetjmp found." >&4
16728 Uh-Oh! You have POSIX sigsetjmp and siglongjmp, but they do not work properly!!
16734 echo "sigsetjmp not found." >&4
16738 *) val="$d_sigsetjmp"
16739 case "$d_sigsetjmp" in
16740 $define) echo "POSIX sigsetjmp found." >&4;;
16741 $undef) echo "sigsetjmp not found." >&4;;
16749 : see if snprintf exists
16750 set snprintf d_snprintf
16753 : see if vsnprintf exists
16754 set vsnprintf d_vsnprintf
16757 case "$d_snprintf-$d_vsnprintf" in
16760 Checking whether your snprintf() and vsnprintf() work okay...
16762 $cat >try.c <<'EOCP'
16763 /* v?snprintf testing logic courtesy of Russ Allbery.
16764 * According to C99:
16765 * - if the buffer is too short it still must be \0-terminated
16766 * - if the buffer is too short the potentially required length
16767 * must be returned and not -1
16768 * - if the buffer is NULL the potentially required length
16769 * must be returned and not -1 or core dump
16772 #include <stdarg.h>
16776 int test (char *format, ...)
16781 va_start (args, format);
16782 count = vsnprintf (buf, sizeof buf, format, args);
16789 return ((test ("%s", "abcd") == 4 && buf[0] == 'a' && buf[1] == '\0'
16790 && snprintf (NULL, 0, "%s", "abcd") == 4) ? 0 : 1);
16794 if eval $compile; then
16797 0) echo "Your snprintf() and vsnprintf() seem to be working okay." ;;
16799 Your snprintf() and snprintf() don't seem to be working okay.
16801 d_snprintf="$undef"
16802 d_vsnprintf="$undef"
16806 echo "(I can't seem to compile the test program--assuming they don't)"
16807 d_snprintf="$undef"
16808 d_vsnprintf="$undef"
16810 $rm -f try.* try core core.try.*
16814 : see if sockatmark exists
16815 set sockatmark d_sockatmark
16818 : see if prototype for sockatmark is available
16820 set d_sockatmarkproto sockatmark $d_socket sys/socket.h
16823 : see if socks5_init exists
16824 set socks5_init d_socks5_init
16827 : see if sprintf returns the length of the string in the buffer as per ANSI
16828 $echo "Checking whether sprintf returns the length of the string..." >&4
16831 #$i_stdlib I_STDLIB
16833 #include <stdlib.h>
16835 #$i_string I_STRING
16837 # include <string.h>
16839 # include <strings.h>
16848 int check (size_t expect, int test) {
16849 size_t got = strlen(buffer);
16853 printf("expected %ld, got %ld in test %d '%s'\n", (long) expect, (long) got,
16858 int main(int argc, char **argv) {
16861 check(sprintf(buffer, ""), ++test);
16862 check(sprintf(buffer, "%s %s", "perl", "rules"), ++test);
16863 check(sprintf(buffer, "I like %g", atan2(0,-1)), ++test);
16870 d_sprintf_returns_strlen="$undef"
16871 if eval $compile; then
16875 sprintf returns the length of the string (as ANSI says it should)
16877 d_sprintf_returns_strlen="$define"
16880 sprintf does not return the length of the string (how old is this system?)
16882 d_sprintf_returns_strlen="$undef"
16889 : see if srand48_r exists
16890 set srand48_r d_srand48_r
16892 case "$d_srand48_r" in
16894 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
16895 case "$d_srand48_r_proto:$usethreads" in
16896 ":define") d_srand48_r_proto=define
16897 set d_srand48_r_proto srand48_r $hdrs
16901 case "$d_srand48_r_proto" in
16903 case "$srand48_r_proto" in
16904 ''|0) try='int srand48_r(long, struct drand48_data*);'
16905 ./protochk "extern $try" $hdrs && srand48_r_proto=I_LS ;;
16907 case "$srand48_r_proto" in
16908 ''|0) d_srand48_r=undef
16910 echo "Disabling srand48_r, cannot determine prototype." >&4 ;;
16911 * ) case "$srand48_r_proto" in
16912 REENTRANT_PROTO*) ;;
16913 *) srand48_r_proto="REENTRANT_PROTO_$srand48_r_proto" ;;
16915 echo "Prototype: $try" ;;
16918 *) case "$usethreads" in
16919 define) echo "srand48_r has no prototype, not using it." >&4 ;;
16926 *) srand48_r_proto=0
16930 : see if srandom_r exists
16931 set srandom_r d_srandom_r
16933 case "$d_srandom_r" in
16935 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
16936 case "$d_srandom_r_proto:$usethreads" in
16937 ":define") d_srandom_r_proto=define
16938 set d_srandom_r_proto srandom_r $hdrs
16942 case "$d_srandom_r_proto" in
16944 case "$srandom_r_proto" in
16945 ''|0) try='int srandom_r(unsigned int, struct random_data*);'
16946 ./protochk "extern $try" $hdrs && srandom_r_proto=I_TS ;;
16948 case "$srandom_r_proto" in
16949 ''|0) d_srandom_r=undef
16951 echo "Disabling srandom_r, cannot determine prototype." >&4 ;;
16952 * ) case "$srandom_r_proto" in
16953 REENTRANT_PROTO*) ;;
16954 *) srandom_r_proto="REENTRANT_PROTO_$srandom_r_proto" ;;
16956 echo "Prototype: $try" ;;
16959 *) case "$usethreads" in
16960 define) echo "srandom_r has no prototype, not using it." >&4 ;;
16967 *) srandom_r_proto=0
16971 : see if prototype for setresgid is available
16973 set d_sresgproto setresgid $i_unistd unistd.h
16976 : see if prototype for setresuid is available
16978 set d_sresuproto setresuid $i_unistd unistd.h
16981 : see if sys/stat.h is available
16982 set sys/stat.h i_sysstat
16986 : see if stat knows about block sizes
16988 echo "Checking to see if your struct stat has st_blocks field..." >&4
16989 set d_statblks stat st_blocks $i_sysstat sys/stat.h
16993 : see if this is a sys/vfs.h system
16994 set sys/vfs.h i_sysvfs
16998 : see if this is a sys/statfs.h system
16999 set sys/statfs.h i_sysstatfs
17004 echo "Checking to see if your system supports struct statfs..." >&4
17005 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
17007 case "$d_statfs_s" in
17008 "$define") echo "Yes, it does." ;;
17009 *) echo "No, it doesn't." ;;
17014 : see if struct statfs knows about f_flags
17015 case "$d_statfs_s" in
17018 echo "Checking to see if your struct statfs has f_flags field..." >&4
17019 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
17023 set d_statfs_f_flags
17027 case "$d_statfs_f_flags" in
17028 "$define") echo "Yes, it does." ;;
17029 *) echo "No, it doesn't." ;;
17033 Checking how to access stdio streams by file descriptor number...
17035 case "$stdio_stream_array" in
17036 '') $cat >try.c <<EOCP
17039 if (&STDIO_STREAM_ARRAY[fileno(stdin)] == stdin)
17043 for s in _iob __iob __sF
17045 set try -DSTDIO_STREAM_ARRAY=$s
17046 if eval $compile; then
17047 case "`$run ./try`" in
17048 yes) stdio_stream_array=$s; break ;;
17052 $rm -f try.* try$exe_ext
17054 case "$stdio_stream_array" in
17056 I can't figure out how to access stdio streams by file descriptor number.
17058 d_stdio_stream_array="$undef"
17061 You can access stdio streams by file descriptor number by the $stdio_stream_array array.
17063 d_stdio_stream_array="$define"
17067 : see if strcoll exists
17068 set strcoll d_strcoll
17071 : check for structure copying
17073 echo "Checking to see if your C compiler can copy structs..." >&4
17074 $cat >try.c <<'EOCP'
17084 if $cc -c try.c >/dev/null 2>&1 ; then
17086 echo "Yup, it can."
17089 echo "Nope, it can't."
17095 : see if strerror and/or sys_errlist[] exist
17097 if test "X$d_strerror" = X -o "X$d_syserrlst" = X; then
17098 if set strerror val -f d_strerror; eval $csym; $val; then
17099 echo 'strerror() found.' >&4
17100 d_strerror="$define"
17101 d_strerrm='strerror(e)'
17102 if set sys_errlist val -a d_syserrlst; eval $csym; $val; then
17103 echo "(You also have sys_errlist[], so we could roll our own strerror.)"
17104 d_syserrlst="$define"
17106 echo "(Since you don't have sys_errlist[], sterror() is welcome.)"
17107 d_syserrlst="$undef"
17109 elif xxx=`./findhdr string.h`; test "$xxx" || xxx=`./findhdr strings.h`; \
17110 $contains '#[ ]*define.*strerror' "$xxx" >/dev/null 2>&1; then
17111 echo 'strerror() found in string header.' >&4
17112 d_strerror="$define"
17113 d_strerrm='strerror(e)'
17114 if set sys_errlist val -a d_syserrlst; eval $csym; $val; then
17115 echo "(Most probably, strerror() uses sys_errlist[] for descriptions.)"
17116 d_syserrlst="$define"
17118 echo "(You don't appear to have any sys_errlist[], how can this be?)"
17119 d_syserrlst="$undef"
17121 elif set sys_errlist val -a d_syserrlst; eval $csym; $val; then
17122 echo "strerror() not found, but you have sys_errlist[] so we'll use that." >&4
17123 d_strerror="$undef"
17124 d_syserrlst="$define"
17125 d_strerrm='((e)<0||(e)>=sys_nerr?"unknown":sys_errlist[e])'
17127 echo 'strerror() and sys_errlist[] NOT found.' >&4
17128 d_strerror="$undef"
17129 d_syserrlst="$undef"
17130 d_strerrm='"unknown"'
17134 : see if strerror_r exists
17135 set strerror_r d_strerror_r
17137 case "$d_strerror_r" in
17139 hdrs="$i_systypes sys/types.h define stdio.h $i_string string.h"
17140 case "$d_strerror_r_proto:$usethreads" in
17141 ":define") d_strerror_r_proto=define
17142 set d_strerror_r_proto strerror_r $hdrs
17146 case "$d_strerror_r_proto" in
17148 case "$strerror_r_proto" in
17149 ''|0) try='int strerror_r(int, char*, size_t);'
17150 ./protochk "extern $try" $hdrs && strerror_r_proto=I_IBW ;;
17152 case "$strerror_r_proto" in
17153 ''|0) try='int strerror_r(int, char*, int);'
17154 ./protochk "extern $try" $hdrs && strerror_r_proto=I_IBI ;;
17156 case "$strerror_r_proto" in
17157 ''|0) try='char* strerror_r(int, char*, size_t);'
17158 ./protochk "extern $try" $hdrs && strerror_r_proto=B_IBW ;;
17160 case "$strerror_r_proto" in
17161 ''|0) d_strerror_r=undef
17163 echo "Disabling strerror_r, cannot determine prototype." >&4 ;;
17164 * ) case "$strerror_r_proto" in
17165 REENTRANT_PROTO*) ;;
17166 *) strerror_r_proto="REENTRANT_PROTO_$strerror_r_proto" ;;
17168 echo "Prototype: $try" ;;
17171 *) case "$usethreads" in
17172 define) echo "strerror_r has no prototype, not using it." >&4 ;;
17179 *) strerror_r_proto=0
17183 : see if strftime exists
17184 set strftime d_strftime
17187 : see if strlcat exists
17188 set strlcat d_strlcat
17191 : see if strlcpy exists
17192 set strlcpy d_strlcpy
17195 : see if strtod exists
17196 set strtod d_strtod
17199 : see if strtol exists
17200 set strtol d_strtol
17203 : see if strtold exists
17204 set strtold d_strtold
17207 : see if strtoll exists
17208 set strtoll d_strtoll
17211 case "$d_longlong-$d_strtoll" in
17214 Checking whether your strtoll() works okay...
17216 $cat >try.c <<'EOCP'
17219 #define strtoll __strtoll
17222 #define strtoll _strtoll
17225 extern long long int strtoll(char *s, char **, int);
17226 static int bad = 0;
17227 int check(char *s, long long ell, int een) {
17230 gll = strtoll(s, 0, 10);
17231 if (!((gll == ell) && (errno == een)))
17235 check(" 1", 1LL, 0);
17236 check(" 0", 0LL, 0);
17237 check("-1", -1LL, 0);
17238 check("-9223372036854775808", -9223372036854775808LL, 0);
17239 check("-9223372036854775808", -9223372036854775808LL, 0);
17240 check(" 9223372036854775807", 9223372036854775807LL, 0);
17241 check("-9223372036854775808", -9223372036854775808LL, 0);
17242 check(" 9223372036854775808", 9223372036854775807LL, ERANGE);
17243 check("-9223372036854775809", -9223372036854775808LL, ERANGE);
17249 if eval $compile; then
17252 ok) echo "Your strtoll() seems to be working okay." ;;
17254 Your strtoll() doesn't seem to be working okay.
17260 echo "(I can't seem to compile the test program--assuming it doesn't)"
17266 : see if strtoq exists
17267 set strtoq d_strtoq
17270 : see if strtoul exists
17271 set strtoul d_strtoul
17274 case "$d_strtoul" in
17277 Checking whether your strtoul() works okay...
17279 $cat >try.c <<'EOCP'
17282 extern unsigned long int strtoul(char *s, char **, int);
17283 static int bad = 0;
17284 void check(char *s, unsigned long eul, int een) {
17287 gul = strtoul(s, 0, 10);
17288 if (!((gul == eul) && (errno == een)))
17292 check(" 1", 1L, 0);
17293 check(" 0", 0L, 0);
17295 case "$longsize" in
17297 $cat >>try.c <<'EOCP'
17298 check("18446744073709551615", 18446744073709551615UL, 0);
17299 check("18446744073709551616", 18446744073709551615UL, ERANGE);
17300 #if 0 /* strtoul() for /^-/ strings is undefined. */
17301 check("-1", 18446744073709551615UL, 0);
17302 check("-18446744073709551614", 2, 0);
17303 check("-18446744073709551615", 1, 0);
17304 check("-18446744073709551616", 18446744073709551615UL, ERANGE);
17305 check("-18446744073709551617", 18446744073709551615UL, ERANGE);
17310 $cat >>try.c <<'EOCP'
17311 check("4294967295", 4294967295UL, 0);
17312 check("4294967296", 4294967295UL, ERANGE);
17313 #if 0 /* strtoul() for /^-/ strings is undefined. */
17314 check("-1", 4294967295UL, 0);
17315 check("-4294967294", 2, 0);
17316 check("-4294967295", 1, 0);
17317 check("-4294967296", 4294967295UL, ERANGE);
17318 check("-4294967297", 4294967295UL, ERANGE);
17323 : Should we write these tests to be more portable by sprintf-ing
17324 : ~0 and then manipulating that char string as input for strtol?
17327 $cat >>try.c <<'EOCP'
17334 if eval $compile; then
17335 case "`$run ./try`" in
17336 ok) echo "Your strtoul() seems to be working okay." ;;
17338 Your strtoul() doesn't seem to be working okay.
17347 : see if strtoull exists
17348 set strtoull d_strtoull
17351 case "$d_longlong-$d_strtoull" in
17354 Checking whether your strtoull() works okay...
17356 $cat >try.c <<'EOCP'
17359 #define strtoull __strtoull
17362 extern unsigned long long int strtoull(char *s, char **, int);
17363 static int bad = 0;
17364 int check(char *s, long long eull, int een) {
17367 gull = strtoull(s, 0, 10);
17368 if (!((gull == eull) && (errno == een)))
17372 check(" 1", 1LL, 0);
17373 check(" 0", 0LL, 0);
17374 check("18446744073709551615", 18446744073709551615ULL, 0);
17375 check("18446744073709551616", 18446744073709551615ULL, ERANGE);
17376 #if 0 /* strtoull() for /^-/ strings is undefined. */
17377 check("-1", 18446744073709551615ULL, 0);
17378 check("-18446744073709551614", 2LL, 0);
17379 check("-18446744073709551615", 1LL, 0);
17380 check("-18446744073709551616", 18446744073709551615ULL, ERANGE);
17381 check("-18446744073709551617", 18446744073709551615ULL, ERANGE);
17388 if eval $compile; then
17389 case "`$run ./try`" in
17390 ok) echo "Your strtoull() seems to be working okay." ;;
17392 Your strtoull() doesn't seem to be working okay.
17394 d_strtoull="$undef"
17401 : see if strtouq exists
17402 set strtouq d_strtouq
17405 case "$d_strtouq" in
17408 Checking whether your strtouq() works okay...
17410 $cat >try.c <<'EOCP'
17413 extern unsigned long long int strtouq(char *s, char **, int);
17414 static int bad = 0;
17415 void check(char *s, unsigned long long eull, int een) {
17416 unsigned long long gull;
17418 gull = strtouq(s, 0, 10);
17419 if (!((gull == eull) && (errno == een)))
17423 check(" 1", 1LL, 0);
17424 check(" 0", 0LL, 0);
17425 check("18446744073709551615", 18446744073709551615ULL, 0);
17426 check("18446744073709551616", 18446744073709551615ULL, ERANGE);
17427 #if 0 /* strtouq() for /^-/ strings is undefined. */
17428 check("-1", 18446744073709551615ULL, 0);
17429 check("-18446744073709551614", 2LL, 0);
17430 check("-18446744073709551615", 1LL, 0);
17431 check("-18446744073709551616", 18446744073709551615ULL, ERANGE);
17432 check("-18446744073709551617", 18446744073709551615ULL, ERANGE);
17440 if eval $compile; then
17441 case "`$run ./try`" in
17442 ok) echo "Your strtouq() seems to be working okay." ;;
17444 Your strtouq() doesn't seem to be working okay.
17453 : see if strxfrm exists
17454 set strxfrm d_strxfrm
17457 : see if symlink exists
17458 set symlink d_symlink
17461 : see if syscall exists
17462 set syscall d_syscall
17465 : see if prototype for syscall is available
17467 set d_syscallproto syscall $i_unistd unistd.h
17470 : see if sysconf exists
17471 set sysconf d_sysconf
17474 : see if system exists
17475 set system d_system
17478 : see if tcgetpgrp exists
17479 set tcgetpgrp d_tcgetpgrp
17482 : see if tcsetpgrp exists
17483 set tcsetpgrp d_tcsetpgrp
17486 : see if prototype for telldir is available
17488 set d_telldirproto telldir $i_systypes sys/types.h $i_dirent dirent.h
17491 : see if time exists
17493 if test "X$d_time" = X -o X"$timetype" = X; then
17494 if set time val -f d_time; eval $csym; $val; then
17495 echo 'time() found.' >&4
17497 rp="What is the type returned by time() on this system?"
17498 set time_t timetype long stdio.h sys/types.h
17501 echo 'time() not found, hope that will do.' >&4
17509 : see if this is a sys/times.h system
17510 set sys/times.h i_systimes
17513 : see if times exists
17515 if set times val -f d_times; eval $csym; $val; then
17516 echo 'times() found.' >&4
17519 case "$i_systimes" in
17520 "$define") inc='sys/times.h';;
17522 rp="What is the type returned by times() on this system?"
17523 set clock_t clocktype long stdio.h sys/types.h $inc
17526 echo 'times() NOT found, hope that will do.' >&4
17531 : see if tmpnam_r exists
17532 set tmpnam_r d_tmpnam_r
17534 case "$d_tmpnam_r" in
17536 hdrs="$i_systypes sys/types.h define stdio.h "
17537 case "$d_tmpnam_r_proto:$usethreads" in
17538 ":define") d_tmpnam_r_proto=define
17539 set d_tmpnam_r_proto tmpnam_r $hdrs
17543 case "$d_tmpnam_r_proto" in
17545 case "$tmpnam_r_proto" in
17546 ''|0) try='char* tmpnam_r(char*);'
17547 ./protochk "extern $try" $hdrs && tmpnam_r_proto=B_B ;;
17549 case "$tmpnam_r_proto" in
17550 ''|0) d_tmpnam_r=undef
17552 echo "Disabling tmpnam_r, cannot determine prototype." >&4 ;;
17553 * ) case "$tmpnam_r_proto" in
17554 REENTRANT_PROTO*) ;;
17555 *) tmpnam_r_proto="REENTRANT_PROTO_$tmpnam_r_proto" ;;
17557 echo "Prototype: $try" ;;
17560 *) case "$usethreads" in
17561 define) echo "tmpnam_r has no prototype, not using it." >&4 ;;
17568 *) tmpnam_r_proto=0
17572 : see if truncate exists
17573 set truncate d_truncate
17576 : see if ttyname_r exists
17577 set ttyname_r d_ttyname_r
17579 case "$d_ttyname_r" in
17581 hdrs="$i_systypes sys/types.h define stdio.h $i_unistd unistd.h"
17582 case "$d_ttyname_r_proto:$usethreads" in
17583 ":define") d_ttyname_r_proto=define
17584 set d_ttyname_r_proto ttyname_r $hdrs
17588 case "$d_ttyname_r_proto" in
17590 case "$ttyname_r_proto" in
17591 ''|0) try='int ttyname_r(int, char*, size_t);'
17592 ./protochk "extern $try" $hdrs && ttyname_r_proto=I_IBW ;;
17594 case "$ttyname_r_proto" in
17595 ''|0) try='int ttyname_r(int, char*, int);'
17596 ./protochk "extern $try" $hdrs && ttyname_r_proto=I_IBI ;;
17598 case "$ttyname_r_proto" in
17599 ''|0) try='char* ttyname_r(int, char*, int);'
17600 ./protochk "extern $try" $hdrs && ttyname_r_proto=B_IBI ;;
17602 case "$ttyname_r_proto" in
17603 ''|0) d_ttyname_r=undef
17605 echo "Disabling ttyname_r, cannot determine prototype." >&4 ;;
17606 * ) case "$ttyname_r_proto" in
17607 REENTRANT_PROTO*) ;;
17608 *) ttyname_r_proto="REENTRANT_PROTO_$ttyname_r_proto" ;;
17610 echo "Prototype: $try" ;;
17613 *) case "$usethreads" in
17614 define) echo "ttyname_r has no prototype, not using it." >&4 ;;
17621 *) ttyname_r_proto=0
17625 : see if tzname[] exists
17627 if set tzname val -a d_tzname; eval $csym; $val; then
17629 echo 'tzname[] found.' >&4
17632 echo 'tzname[] NOT found.' >&4
17638 next|rhapsody|darwin) multiarch="$define" ;;
17640 case "$multiarch" in
17641 ''|[nN]*) multiarch="$undef" ;;
17644 : check for ordering of bytes in a UV
17646 case "$usecrosscompile$multiarch" in
17649 You seem to be either cross-compiling or doing a multiarchitecture build,
17650 skipping the byteorder check.
17656 case "$byteorder" in
17659 In the following, larger digits indicate more significance. A big-endian
17660 machine like a Pyramid or a Motorola 680?0 chip will come out to 4321. A
17661 little-endian machine like a Vax or an Intel 80?86 chip would be 1234. Other
17662 machines may have weird orders like 3412. A Cray will report 87654321,
17663 an Alpha will report 12345678. If the test program works the default is
17665 I'm now running the test program...
17669 #$i_stdlib I_STDLIB
17671 #include <stdlib.h>
17673 #include <sys/types.h>
17674 typedef $uvtype UV;
17684 u.l = (((UV)0x08070605) << 32) | (UV)0x04030201;
17686 u.l = (UV)0x04030201;
17687 for (i = 0; i < $uvsize; i++)
17688 printf("%c", u.c[i]+'0');
17695 if eval $compile && ./try > /dev/null; then
17698 [1-4][1-4][1-4][1-4]|12345678|87654321)
17699 echo "(The test program ran ok.)"
17700 echo "byteorder=$dflt"
17703 ????|????????) echo "(The test program ran ok.)" ;;
17704 *) echo "(The test program didn't run right for some reason.)" ;;
17709 (I can't seem to compile the test program. Guessing big-endian...)
17712 case "$xxx_prompt" in
17714 rp="What is the order of bytes in $uvtype?"
17730 Checking to see whether you can access character data unalignedly...
17732 case "$d_u32align" in
17733 '') $cat >try.c <<EOCP
17735 #$i_stdlib I_STDLIB
17737 #include <stdlib.h>
17739 #define U32 $u32type
17740 #define BYTEORDER 0x$byteorder
17742 #include <signal.h>
17744 $signal_t bletch(int s) { exit(4); }
17747 #if BYTEORDER == 0x1234 || BYTEORDER == 0x4321
17752 if (sizeof(U32) != 4) {
17753 printf("sizeof(U32) is not 4, but %d\n", sizeof(U32));
17760 signal(SIGBUS, bletch);
17772 for (i = 0; i < 4; i++) {
17773 up = (U32*)(buf + i);
17774 if (! ((*up == 1 << (8*i)) || /* big-endian */
17775 (*up == 1 << (8*(3-i))) /* little-endian */
17779 printf("read failed (%x)\n", *up);
17785 for (i = 0; i < 4; i++) {
17786 up = (U32*)(buf + i);
17788 if (*up != 0xBeef) {
17789 printf("write failed (%x)\n", *up);
17803 if eval $compile_ok; then
17804 echo "(Testing for character data alignment may crash the test. That's okay.)" >&4
17805 $run ./try 2>&1 >/dev/null
17808 You can access character data pretty unalignedly.
17810 d_u32align="$undef"
17813 It seems that you must access character data in an aligned manner.
17815 d_u32align="$define"
17819 rp='Can you access character data at unaligned addresses?'
17823 [yY]*) d_u32align="$undef" ;;
17824 *) d_u32align="$define" ;;
17827 $rm -f core core.try.* try.core
17831 : see if ualarm exists
17832 set ualarm d_ualarm
17835 : see if umask exists
17839 : see if unordered exists
17840 set unordered d_unordered
17843 : see if unsetenv exists
17844 set unsetenv d_unsetenv
17847 : see if usleep exists
17848 set usleep d_usleep
17851 : see if prototype for usleep is available
17853 set d_usleepproto usleep $i_unistd unistd.h
17856 : see if ustat exists
17860 : backward compatibility for d_hvfork
17861 if test X$d_hvfork != X; then
17862 d_vfork="$d_hvfork"
17865 : see if there is a vfork
17870 : Ok, but do we want to use it. vfork is reportedly unreliable in
17871 : perl on Solaris 2.x, and probably elsewhere.
17875 case "$usevfork" in
17881 Perl can only use a vfork() that doesn't suffer from strict
17882 restrictions on calling functions or modifying global data in
17883 the child. For example, glibc-2.1 contains such a vfork()
17884 that is unsuitable. If your system provides a proper fork()
17885 call, chances are that you do NOT want perl to use vfork().
17888 rp="Do you still want to use vfork()?"
17893 echo "Ok, we won't use vfork()."
17902 $define) usevfork='true';;
17903 *) usevfork='false';;
17906 : see if closedir exists
17907 set closedir d_closedir
17910 case "$d_closedir" in
17913 echo "Checking whether closedir() returns a status..." >&4
17915 #$i_dirent I_DIRENT /**/
17916 #$i_sysdir I_SYS_DIR /**/
17917 #$i_sysndir I_SYS_NDIR /**/
17918 #$i_systypes I_SYS_TYPES /**/
17920 #if defined(I_SYS_TYPES)
17921 #include <sys/types.h>
17923 #if defined(I_DIRENT)
17924 #include <dirent.h>
17925 #if defined(NeXT) && defined(I_SYS_DIR) /* NeXT needs dirent + sys/dir.h */
17926 #include <sys/dir.h>
17930 #include <sys/ndir.h>
17934 #include <ndir.h> /* may be wrong in the future */
17936 #include <sys/dir.h>
17941 int main() { return closedir(opendir(".")); }
17944 if eval $compile_ok; then
17945 if $run ./try > /dev/null 2>&1 ; then
17946 echo "Yes, it does."
17949 echo "No, it doesn't."
17953 echo "(I can't seem to compile the test program--assuming it doesn't)"
17961 set d_void_closedir
17964 : see if there is a wait4
17968 : see if waitpid exists
17969 set waitpid d_waitpid
17972 : see if wcstombs exists
17973 set wcstombs d_wcstombs
17976 : see if wctomb exists
17977 set wctomb d_wctomb
17980 : see if writev exists
17981 set writev d_writev
17984 : preserve RCS keywords in files with variable substitution, grrr
17989 Revision='$Revision'
17991 : check for alignment requirements
17993 case "$usecrosscompile$multiarch" in
17996 You seem to be either cross-compiling or doing a multiarchitecture build,
17997 skipping the memory alignment check.
18000 case "$alignbytes" in
18001 '') alignbytes=8 ;;
18005 case "$alignbytes" in
18006 '') echo "Checking alignment constraints..." >&4
18007 if $test "X$uselongdouble" = Xdefine -a "X$d_longdbl" = Xdefine; then
18008 $cat >try.c <<'EOCP'
18009 typedef long double NV;
18012 $cat >try.c <<'EOCP'
18016 $cat >>try.c <<'EOCP'
18024 printf("%d\n", (int)((char *)&try_algn.bar - (char *)&try_algn.foo));
18029 if eval $compile_ok; then
18033 echo "(I can't seem to compile the test program...)"
18036 *) dflt="$alignbytes"
18039 rp="Doubles must be aligned on a how-many-byte boundary?"
18047 : set the base revision
18050 : how do we concatenate cpp tokens here?
18052 echo "Checking to see how your cpp does stuff like concatenate tokens..." >&4
18053 $cat >cpp_stuff.c <<'EOCP'
18054 #define RCAT(a,b)a/**/b
18055 #define ACAT(a,b)a ## b
18059 $cppstdin $cppflags $cppminus <cpp_stuff.c >cpp_stuff.out 2>&1
18060 if $contains 'Circus' cpp_stuff.out >/dev/null 2>&1; then
18061 echo "Oh! Smells like ANSI's been here." >&4
18062 echo "We can catify or stringify, separately or together!"
18064 elif $contains 'Reiser' cpp_stuff.out >/dev/null 2>&1; then
18065 echo "Ah, yes! The good old days!" >&4
18066 echo "However, in the good old days we don't know how to stringify and"
18067 echo "catify at the same time."
18071 Hmm, I don't seem to be able to concatenate tokens with your cpp.
18072 You're going to have to edit the values of CAT[2-5] in config.h...
18074 cpp_stuff="/* Help! How do we handle cpp_stuff? */*/"
18078 : see if this is a db.h system
18084 : Check db version.
18086 echo "Checking Berkeley DB version ..." >&4
18092 #include <sys/types.h>
18094 #$i_stdlib I_STDLIB
18096 #include <stdlib.h>
18099 int main(int argc, char *argv[])
18101 #ifdef DB_VERSION_MAJOR /* DB version >= 2 */
18102 int Major, Minor, Patch ;
18103 unsigned long Version ;
18104 (void)db_version(&Major, &Minor, &Patch) ;
18106 printf("%d %d %d %d %d %d\n",
18107 DB_VERSION_MAJOR, DB_VERSION_MINOR, DB_VERSION_PATCH,
18108 Major, Minor, Patch);
18111 printf("You have Berkeley DB Version 2 or greater.\n");
18113 printf("db.h is from Berkeley DB Version %d.%d.%d\n",
18114 DB_VERSION_MAJOR, DB_VERSION_MINOR, DB_VERSION_PATCH);
18115 printf("libdb is from Berkeley DB Version %d.%d.%d\n",
18116 Major, Minor, Patch) ;
18118 /* check that db.h & libdb are compatible */
18119 if (DB_VERSION_MAJOR != Major || DB_VERSION_MINOR != Minor || DB_VERSION_PATCH != Patch) {
18120 printf("db.h and libdb are incompatible.\n") ;
18124 printf("db.h and libdb are compatible.\n") ;
18126 Version = DB_VERSION_MAJOR * 1000000 + DB_VERSION_MINOR * 1000
18127 + DB_VERSION_PATCH ;
18129 /* needs to be >= 2.3.4 */
18130 if (Version < 2003004) {
18131 /* if (DB_VERSION_MAJOR == 2 && DB_VERSION_MINOR == 0 && DB_VERSION_PATCH < 5) { */
18132 printf("Perl needs Berkeley DB 2.3.4 or greater.\n") ;
18138 #if defined(_DB_H_) && defined(BTREEMAGIC) && defined(HASHMAGIC)
18143 printf("You have Berkeley DB Version 1.\n");
18144 exit(0); /* DB version < 2: the coast is clear. */
18146 exit(1); /* <db.h> not Berkeley DB? */
18152 if eval $compile_ok && $run ./try; then
18153 echo 'Looks OK.' >&4
18155 db_version_major=$1
18156 db_version_minor=$2
18157 db_version_patch=$3
18159 echo "I can't use Berkeley DB with your <db.h>. I'll disable Berkeley DB." >&4
18163 : Remove db from list of libraries to use
18164 echo "Removing unusable -ldb from library list" >&4
18165 set `echo X $libs | $sed -e 's/-ldb / /' -e 's/-ldb$//'`
18168 echo "libs = $libs" >&4
18178 : Check the return type needed for hash
18180 echo "Checking return type needed for hash for Berkeley DB ..." >&4
18186 #include <sys/types.h>
18189 #ifndef DB_VERSION_MAJOR
18190 u_int32_t hash_cb (ptr, size)
18198 info.hash = hash_cb;
18202 if $cc $ccflags -c try.c >try.out 2>&1 ; then
18203 if $contains warning try.out >>/dev/null 2>&1 ; then
18206 db_hashtype='u_int32_t'
18209 : XXX Maybe we should just give up here.
18210 db_hashtype=u_int32_t
18212 echo "Help: I can't seem to compile the db test program." >&4
18213 echo "Something's wrong, but I'll assume you use $db_hashtype." >&4
18216 echo "Your version of Berkeley DB uses $db_hashtype for hash."
18218 *) db_hashtype=u_int32_t
18223 : Check the return type needed for prefix
18225 echo "Checking return type needed for prefix for Berkeley DB ..." >&4
18231 #include <sys/types.h>
18234 #ifndef DB_VERSION_MAJOR
18235 size_t prefix_cb (key1, key2)
18243 info.prefix = prefix_cb;
18247 if $cc $ccflags -c try.c >try.out 2>&1 ; then
18248 if $contains warning try.out >>/dev/null 2>&1 ; then
18249 db_prefixtype='int'
18251 db_prefixtype='size_t'
18254 db_prefixtype='size_t'
18255 : XXX Maybe we should just give up here.
18257 echo "Help: I can't seem to compile the db test program." >&4
18258 echo "Something's wrong, but I'll assume you use $db_prefixtype." >&4
18261 echo "Your version of Berkeley DB uses $db_prefixtype for prefix."
18263 *) db_prefixtype='size_t'
18268 : How can we generate normalized random numbers ?
18270 echo "Looking for a random number function..." >&4
18271 case "$randfunc" in
18273 if set drand48 val -f; eval $csym; $val; then
18275 echo "Good, found drand48()." >&4
18276 elif set random val -f; eval $csym; $val; then
18278 echo "OK, found random()." >&4
18281 echo "Yick, looks like I have to use rand()." >&4
18292 *-Dmy_rand=*|*-Dmy_srand=*)
18293 echo "Removing obsolete -Dmy_rand, -Dmy_srand, and -Drandbits from ccflags." >&4
18294 ccflags="`echo $ccflags | sed -e 's/-Dmy_rand=random/ /'`"
18295 ccflags="`echo $ccflags | sed -e 's/-Dmy_srand=srandom/ /'`"
18296 ccflags="`echo $ccflags | sed -e 's/-Drandbits=[0-9][0-9]*/ /'`"
18300 while $test "$cont"; do
18301 rp="Use which function to generate random numbers?"
18303 if $test "$ans" = "$dflt"; then
18309 if set $ans val -f; eval $csym; $val; then
18313 rp="I cannot find function $ans. Use that name anyway?"
18322 case "$randfunc" in
18324 drand01="drand48()"
18330 case "$randbits" in
18332 echo "Checking to see how many bits your $randfunc() function produces..." >&4
18334 #$i_unistd I_UNISTD
18335 #$i_stdlib I_STDLIB
18338 # include <unistd.h>
18341 # include <stdlib.h>
18346 register unsigned long tmp;
18347 register unsigned long max = 0L;
18349 for (i = 1000; i; i--) {
18350 tmp = (unsigned long) $randfunc();
18351 if (tmp > max) max = tmp;
18353 for (i = 0; max; i++)
18359 if eval $compile_ok; then
18363 echo "(I can't seem to compile the test program...)"
18370 rp="How many bits does your $randfunc() function produce?"
18374 drand01="($randfunc() / (double) ((unsigned long)1 << $randbits))"
18375 seedfunc="s$randfunc"
18376 randseedtype=unsigned
18380 rp="How many bits does your $randfunc() function produce?"
18383 seedfunc="s$randfunc"
18384 drand01="($randfunc() / (double) ((unsigned long)1 << $randbits))"
18385 if set $seedfunc val -f; eval $csym; $val; then
18386 echo "(Using $seedfunc() to seed random generator)"
18388 echo "(Warning: no $seedfunc() to seed random generator)"
18391 randseedtype=unsigned
18399 echo "Determining whether or not we are on an EBCDIC system..." >&4
18400 $cat >try.c <<'EOM'
18403 if ('M'==0xd4) return 0;
18410 if eval $compile_ok; then
18411 if $run ./try; then
18412 echo "You seem to speak EBCDIC." >&4
18415 echo "Nope, no EBCDIC, probably ASCII or some ISO Latin. Or UTF-8." >&4
18418 echo "I'm unable to compile the test program." >&4
18419 echo "I'll assume ASCII or some ISO Latin. Or UTF8." >&4
18427 Checking how to flush all pending stdio output...
18429 # I only know how to find the first 32 possibly open files on SunOS.
18430 # See also hints/sunos_4_1.sh and util.c --AD
18432 sunos) $echo '#define PERL_FFLUSH_ALL_FOPEN_MAX 32' > try.c ;;
18434 $cat >>try.c <<EOCP
18436 #$i_stdlib I_STDLIB
18438 #include <stdlib.h>
18440 #$i_unistd I_UNISTD
18442 # include <unistd.h>
18444 #$d_sysconf HAS_SYSCONF
18445 #$d_stdio_stream_array HAS_STDIO_STREAM_ARRAY
18446 #ifdef HAS_STDIO_STREAM_ARRAY
18447 # define STDIO_STREAM_ARRAY $stdio_stream_array
18452 p = fopen("try.out", "w");
18456 # ifdef TRY_FPRINTF
18460 #ifdef TRY_FFLUSH_NULL
18463 #ifdef TRY_FFLUSH_ALL
18465 long open_max = -1;
18466 # ifdef PERL_FFLUSH_ALL_FOPEN_MAX
18467 open_max = PERL_FFLUSH_ALL_FOPEN_MAX;
18469 # if defined(HAS_SYSCONF) && defined(_SC_OPEN_MAX)
18470 open_max = sysconf(_SC_OPEN_MAX);
18473 open_max = FOPEN_MAX;
18476 open_max = OPEN_MAX;
18485 # ifdef HAS_STDIO_STREAM_ARRAY
18486 if (open_max > 0) {
18488 for (i = 0; i < open_max; i++)
18489 if (STDIO_STREAM_ARRAY[i]._file >= 0 &&
18490 STDIO_STREAM_ARRAY[i]._file < open_max &&
18491 STDIO_STREAM_ARRAY[i]._flag)
18492 fflush(&STDIO_STREAM_ARRAY[i]);
18500 : first we have to find out how _not_ to flush
18502 if $test "X$fflushNULL" = X -o "X$fflushall" = X; then
18504 set try -DTRY_FPUTC
18505 if eval $compile; then
18506 $run ./try 2>/dev/null
18509 if $test ! -s try.out -a "X$code" = X42; then
18515 set try -DTRY_FPRINTF
18516 if eval $compile; then
18517 $run ./try 2>/dev/null
18520 if $test ! -s try.out -a "X$code" = X42; then
18521 output=-DTRY_FPRINTF
18527 : check for fflush NULL behaviour
18528 case "$fflushNULL" in
18529 '') set try -DTRY_FFLUSH_NULL $output
18530 if eval $compile; then
18531 $run ./try 2>/dev/null
18534 if $test -s try.out -a "X$code" = X42; then
18535 fflushNULL="`$cat try.out`"
18537 if $test "X$code" != X42; then
18539 (If this test failed, don't worry, we'll try another method shortly.)
18544 $rm -f core try.core core.try.*
18545 case "$fflushNULL" in
18547 Your fflush(NULL) works okay for output streams.
18548 Let's see if it clobbers input pipes...
18550 # As of mid-March 2000 all versions of Solaris appear to have a stdio
18551 # bug that improperly flushes the input end of pipes. So we avoid the
18552 # autoflush on fork/system/exec support for now. :-(
18553 $cat >tryp.c <<EOCP
18556 main(int argc, char **argv)
18562 while ((i = getc(stdin)) != -1
18563 && (*bp++ = i) != '\n'
18564 && bp < &buf[1024])
18567 fprintf(stdout, "%s", buf);
18575 fflushNULL="$define"
18577 if eval $compile; then
18579 $cat tryp.c | $run ./tryp 2>/dev/null > tryp.out
18580 if cmp tryp.c tryp.out >/dev/null 2>&1; then
18582 fflush(NULL) seems to behave okay with input streams.
18584 fflushNULL="$define"
18587 Ouch, fflush(NULL) clobbers input pipes! We will not use it.
18589 fflushNULL="$undef"
18592 $rm -f core tryp.c tryp.core core.tryp.*
18595 Your fflush(NULL) isn't working (contrary to ANSI C).
18597 fflushNULL="$undef"
18600 Cannot figure out whether your fflush(NULL) works or not.
18601 I'm assuming it doesn't (contrary to ANSI C).
18603 fflushNULL="$undef"
18607 $define|true|[yY]*)
18608 fflushNULL="$define"
18611 fflushNULL="$undef"
18614 : check explicit looping only if NULL did not work, and if the pipe
18615 : bug does not show up on an explicit flush too
18616 case "$fflushNULL" in
18618 $cat >tryp.c <<EOCP
18621 main(int argc, char **argv)
18627 while ((i = getc(stdin)) != -1
18628 && (*bp++ = i) != '\n'
18629 && bp < &buf[1024])
18632 fprintf(stdout, "%s", buf);
18641 if eval $compile; then
18643 $cat tryp.c | $run ./tryp 2>/dev/null > tryp.out
18644 if cmp tryp.c tryp.out >/dev/null 2>&1; then
18646 Good, at least fflush(stdin) seems to behave okay when stdin is a pipe.
18648 : now check for fflushall behaviour
18649 case "$fflushall" in
18650 '') set try -DTRY_FFLUSH_ALL $output
18651 if eval $compile; then
18653 (Now testing the other method--but note that this also may fail.)
18655 $run ./try 2>/dev/null
18658 if $test -s try.out -a "X$code" = X42; then
18659 fflushall="`$cat try.out`"
18662 $rm -f core try.core core.try.*
18663 case "$fflushall" in
18665 Whew. Flushing explicitly all the stdio streams works.
18667 fflushall="$define"
18670 Sigh. Flushing explicitly all the stdio streams doesn't work.
18675 Cannot figure out whether flushing stdio streams explicitly works or not.
18676 I'm assuming it doesn't.
18682 "$define"|true|[yY]*)
18683 fflushall="$define"
18691 All is futile. Even fflush(stdin) clobbers input pipes!
18698 $rm -f core tryp.c tryp.core core.tryp.*
18700 *) fflushall="$undef"
18704 case "$fflushNULL$fflushall" in
18707 OK, I give up. I cannot figure out how to flush pending stdio output.
18708 We won't be flushing handles at all before fork/exec/popen.
18712 $rm -f try.* try$exe_ext
18714 : Store the full pathname to the ar program for use in the C program
18715 : Respect a hint or command line value for full_ar.
18720 : Store the full pathname to the sed program for use in the C program
18723 : see what type gids are declared as in the kernel
18725 echo "Looking for the type for group ids returned by getgid()."
18726 set gid_t gidtype xxx stdio.h sys/types.h
18730 xxx=`./findhdr sys/user.h`
18731 set `grep 'groups\[NGROUPS\];' "$xxx" 2>/dev/null` unsigned short
18733 unsigned) dflt="$1 $2" ;;
18737 *) dflt="$gidtype";;
18740 gid_t) echo "gid_t found." ;;
18741 *) rp="What is the type for group ids returned by getgid()?"
18749 *_t) zzz="$gidtype" ;;
18752 echo "Checking the size of $zzz..." >&4
18754 #include <sys/types.h>
18756 #$i_stdlib I_STDLIB
18758 #include <stdlib.h>
18761 printf("%d\n", (int)sizeof($gidtype));
18766 if eval $compile_ok; then
18770 echo "(I can't execute the test program--guessing $gidsize.)" >&4
18773 echo "Your $zzz is $gidsize bytes long."
18778 echo "(I can't compile the test program--guessing $gidsize.)" >&4
18784 *_t) zzz="$gidtype" ;;
18787 echo "Checking the sign of $zzz..." >&4
18789 #include <sys/types.h>
18800 if eval $compile; then
18804 echo "(I can't execute the test program--guessing unsigned.)" >&4
18808 1) echo "Your $zzz is unsigned." ;;
18809 -1) echo "Your $zzz is signed." ;;
18815 echo "(I can't compile the test program--guessing unsigned.)" >&4
18821 if $test X"$quadtype" != X; then
18823 echo "Checking how to print 64-bit integers..." >&4
18825 if $test X"$sPRId64" = X -a X"$quadtype" = Xint; then
18826 $cat >try.c <<'EOCP'
18827 #include <sys/types.h>
18830 int q = 12345678901;
18831 printf("%ld\n", q);
18835 if eval $compile; then
18839 sPRId64='"d"'; sPRIi64='"i"'; sPRIu64='"u"';
18840 sPRIo64='"o"'; sPRIx64='"x"'; sPRIXU64='"X"';
18841 echo "We will use %d."
18847 if $test X"$sPRId64" = X -a X"$quadtype" = Xlong; then
18848 $cat >try.c <<'EOCP'
18849 #include <sys/types.h>
18852 long q = 12345678901;
18853 printf("%ld\n", q);
18857 if eval $compile; then
18861 sPRId64='"ld"'; sPRIi64='"li"'; sPRIu64='"lu"';
18862 sPRIo64='"lo"'; sPRIx64='"lx"'; sPRIXU64='"lX"';
18863 echo "We will use %ld."
18869 if $test X"$sPRId64" = X -a X"$i_inttypes" = X"$define" -a X"$quadtype" = Xint64_t; then
18870 $cat >try.c <<'EOCP'
18871 #include <sys/types.h>
18872 #include <inttypes.h>
18875 int64_t q = 12345678901;
18876 printf("%" PRId64 "\n", q);
18880 if eval $compile; then
18884 sPRId64=PRId64; sPRIi64=PRIi64; sPRIu64=PRIu64;
18885 sPRIo64=PRIo64; sPRIx64=PRIx64; sPRIXU64=PRIXU64;
18886 echo "We will use the C9X style."
18892 if $test X"$sPRId64" = X -a X"$quadtype" != X; then
18894 #include <sys/types.h>
18897 $quadtype q = 12345678901;
18898 printf("%Ld\n", q);
18902 if eval $compile; then
18906 sPRId64='"Ld"'; sPRIi64='"Li"'; sPRIu64='"Lu"';
18907 sPRIo64='"Lo"'; sPRIx64='"Lx"'; sPRIXU64='"LX"';
18908 echo "We will use %Ld."
18914 if $test X"$sPRId64" = X -a X"$quadtype" = X"long long"; then
18915 $cat >try.c <<'EOCP'
18916 #include <sys/types.h>
18919 long long q = 12345678901LL; /* AIX cc requires the LL suffix. */
18920 printf("%lld\n", q);
18924 if eval $compile; then
18928 sPRId64='"lld"'; sPRIi64='"lli"'; sPRIu64='"llu"';
18929 sPRIo64='"llo"'; sPRIx64='"llx"'; sPRIXU64='"llX"';
18930 echo "We will use the %lld style."
18936 if $test X"$sPRId64" = X -a X"$quadtype" != X; then
18938 #include <sys/types.h>
18941 $quadtype q = 12345678901;
18942 printf("%qd\n", q);
18946 if eval $compile; then
18950 sPRId64='"qd"'; sPRIi64='"qi"'; sPRIu64='"qu"';
18951 sPRIo64='"qo"'; sPRIx64='"qx"'; sPRIXU64='"qX"';
18952 echo "We will use %qd."
18958 if $test X"$sPRId64" = X; then
18959 echo "Cannot figure out how to print 64-bit integers." >&4
18967 '') d_PRId64="$undef"; d_PRIi64="$undef"; d_PRIu64="$undef";
18968 d_PRIo64="$undef"; d_PRIx64="$undef"; d_PRIXU64="$undef";
18970 *) d_PRId64="$define"; d_PRIi64="$define"; d_PRIu64="$define";
18971 d_PRIo64="$define"; d_PRIx64="$define"; d_PRIXU64="$define";
18977 $echo "Checking the format strings to be used for Perl's internal types..." >&4
18979 if $test X"$ivsize" = X8; then
18980 ivdformat="$sPRId64"
18981 uvuformat="$sPRIu64"
18982 uvoformat="$sPRIo64"
18983 uvxformat="$sPRIx64"
18984 uvXUformat="$sPRIXU64"
18986 if $test X"$ivsize" = X"$longsize"; then
18993 if $test X"$ivsize" = X"$intsize"; then
19001 if $test X"$ivsize" = X"$shortsize"; then
19012 if $test X"$uselongdouble" = X"$define" -a X"$d_longdbl" = X"$define" -a X"$d_PRIgldbl" = X"$define"; then
19013 nveformat="$sPRIeldbl"
19014 nvfformat="$sPRIfldbl"
19015 nvgformat="$sPRIgldbl"
19016 nvEUformat="$sPRIEUldbl"
19017 nvFUformat="$sPRIFUldbl"
19018 nvGUformat="$sPRIGUldbl"
19028 case "$ivdformat" in
19029 '') echo "$0: Fatal: failed to find format strings, cannot continue." >&4
19036 $echo "Checking the format string to be used for gids..." >&4
19039 -1) if $test X"$gidsize" = X"$ivsize"; then
19040 gidformat="$ivdformat"
19042 if $test X"$gidsize" = X"$longsize"; then
19045 if $test X"$gidsize" = X"$intsize"; then
19048 if $test X"$gidsize" = X"$shortsize"; then
19055 *) if $test X"$gidsize" = X"$uvsize"; then
19056 gidformat="$uvuformat"
19058 if $test X"$gidsize" = X"$longsize"; then
19061 if $test X"$gidsize" = X"$intsize"; then
19064 if $test X"$gidsize" = X"$shortsize"; then
19073 : see if getgroups exists
19074 set getgroups d_getgrps
19077 : see if setgroups exists
19078 set setgroups d_setgrps
19082 : Find type of 2nd arg to 'getgroups()' and 'setgroups()'
19084 case "$d_getgrps$d_setgrps" in
19086 case "$groupstype" in
19087 '') dflt="$gidtype" ;;
19088 *) dflt="$groupstype" ;;
19091 What type of pointer is the second argument to getgroups() and setgroups()?
19092 Usually this is the same as group ids, $gidtype, but not always.
19095 rp='What type pointer is the second argument to getgroups() and setgroups()?'
19099 *) groupstype="$gidtype";;
19103 if $test $patchlevel -lt 9; then
19104 : MAD is not available in 5.8.x or earlier.
19108 $define|true|[yY]*) dflt='y' ;;
19113 Would you like to build with Misc Attribute Decoration? This is development
19114 work leading to a Perl 5 to Perl 6 convertor, which imposes a space and speed
19115 overhead on the interpreter.
19117 If this doesn't make any sense to you, just accept the default '$dflt'.
19119 rp='Build Perl with MAD?'
19124 madlyh='madly.h madly.act madly.tab'
19126 madlyobj="madly$_o" ;;
19136 echo "Checking if your $make program sets \$(MAKE)..." >&4
19137 case "$make_set_make" in
19139 $sed 's/^X //' > testmake.mak << 'EOF'
19141 X @echo 'maketemp="$(MAKE)"'
19143 case "`$make -f testmake.mak 2>/dev/null`" in
19144 *maketemp=*) make_set_make='#' ;;
19145 *) make_set_make="MAKE=$make" ;;
19147 $rm -f testmake.mak
19150 case "$make_set_make" in
19151 '#') echo "Yup, it does.";;
19152 *) echo "Nope, it doesn't.";;
19155 : see what type is used for mode_t
19156 rp="What is the type used for file modes for system calls (e.g. fchmod())?"
19157 set mode_t modetype int stdio.h sys/types.h
19160 : see if we need va_copy
19162 case "$i_stdarg" in
19165 #include <stdarg.h>
19167 #$i_stdlib I_STDLIB
19169 #include <stdlib.h>
19171 #include <signal.h>
19174 ivfprintf(FILE *f, const char *fmt, va_list *valp)
19176 return vfprintf(f, fmt, *valp);
19180 myvfprintf(FILE *f, const char *fmt, va_list val)
19182 return ivfprintf(f, fmt, &val);
19186 myprintf(char *fmt, ...)
19189 va_start(val, fmt);
19190 return myvfprintf(stdout, fmt, val);
19194 main(int ac, char **av)
19196 signal(SIGSEGV, exit);
19198 myprintf("%s%cs all right, then\n", "that", '\'');
19203 if eval $compile && $run ./try 2>&1 >/dev/null; then
19204 case "`$run ./try`" in
19205 "that's all right, then")
19211 yes) echo "It seems that you don't need va_copy()." >&4
19212 need_va_copy="$undef"
19214 *) echo "It seems that va_copy() or similar will be needed." >&4
19215 need_va_copy="$define"
19218 $rm -f try.* core core.* *.core *.core.*
19220 *) echo "You don't have <stdarg.h>, not checking for va_copy()." >&4
19224 : see what type is used for size_t
19225 rp="What is the type used for the length parameter for string functions?"
19226 set size_t sizetype 'unsigned int' stdio.h sys/types.h
19229 : check for type of arguments to gethostbyaddr.
19230 if test "X$netdb_host_type" = X -o "X$netdb_hlen_type" = X; then
19231 case "$d_gethbyaddr" in
19235 Checking to see what type of arguments are accepted by gethostbyaddr().
19237 hdrs="$define sys/types.h
19238 $d_socket sys/socket.h
19239 $i_niin netinet/in.h
19241 $i_unistd unistd.h"
19242 : The first arg can 'char *' or 'void *'
19243 : The second arg is some of integral type
19244 for xxx in in_addr_t 'const void *' 'const char *' 'void *' 'char *'; do
19245 for yyy in size_t long int; do
19246 case "$netdb_host_type" in
19247 '') try="extern struct hostent *gethostbyaddr($xxx, $yyy, int);"
19248 if ./protochk "$try" $hdrs; then
19249 echo "Your system accepts $xxx for the first arg."
19250 echo "...and $yyy for the second arg."
19251 netdb_host_type="$xxx"
19252 netdb_hlen_type="$yyy"
19258 : In case none of those worked, prompt the user.
19259 case "$netdb_host_type" in
19260 '') rp='What is the type for the 1st argument to gethostbyaddr?'
19263 netdb_host_type=$ans
19264 rp='What is the type for the 2nd argument to gethostbyaddr?'
19267 netdb_hlen_type=$ans
19271 *) : no gethostbyaddr, so pick harmless defaults
19272 netdb_host_type='char *'
19273 netdb_hlen_type="$sizetype"
19276 # Remove the "const" if needed. -- but then we'll have a
19278 # netdb_host_type=`echo "$netdb_host_type" | sed 's/^const //'`
19281 : check for type of argument to gethostbyname.
19282 if test "X$netdb_name_type" = X ; then
19283 case "$d_gethbyname" in
19287 Checking to see what type of argument is accepted by gethostbyname().
19289 hdrs="$define sys/types.h
19290 $d_socket sys/socket.h
19291 $i_niin netinet/in.h
19293 $i_unistd unistd.h"
19294 for xxx in "const char *" "char *"; do
19295 case "$netdb_name_type" in
19296 '') try="extern struct hostent *gethostbyname($xxx);"
19297 if ./protochk "$try" $hdrs; then
19298 echo "Your system accepts $xxx."
19299 netdb_name_type="$xxx"
19304 : In case none of those worked, prompt the user.
19305 case "$netdb_name_type" in
19306 '') rp='What is the type for the 1st argument to gethostbyname?'
19309 netdb_name_type=$ans
19313 *) : no gethostbyname, so pick harmless default
19314 netdb_name_type='char *'
19319 : check for type of 1st argument to getnetbyaddr.
19320 if test "X$netdb_net_type" = X ; then
19321 case "$d_getnbyaddr" in
19325 Checking to see what type of 1st argument is accepted by getnetbyaddr().
19327 hdrs="$define sys/types.h
19328 $d_socket sys/socket.h
19329 $i_niin netinet/in.h
19331 $i_unistd unistd.h"
19332 for xxx in in_addr_t "unsigned long" long "unsigned int" int; do
19333 case "$netdb_net_type" in
19334 '') try="extern struct netent *getnetbyaddr($xxx, int);"
19335 if ./protochk "$try" $hdrs; then
19336 echo "Your system accepts $xxx."
19337 netdb_net_type="$xxx"
19342 : In case none of those worked, prompt the user.
19343 case "$netdb_net_type" in
19344 '') rp='What is the type for the 1st argument to getnetbyaddr?'
19347 netdb_net_type=$ans
19351 *) : no getnetbyaddr, so pick harmless default
19352 netdb_net_type='long'
19356 : locate the preferred pager for this system
19363 [a-zA-Z]:/*) dflt=$pg;;
19367 [a-zA-Z]:/*) dflt=$more;;
19371 [a-zA-Z]:/*) dflt=$less;;
19374 '') dflt=/usr/ucb/more;;
19378 : Instruct ./getfile to trust the hinted or previous pager value,
19379 : even if it does not begin with a slash. For example, on os2,
19380 : pager might be cmd /c more. See comments in UU/getfile.
19385 rp='What pager is used on your system?'
19389 : see what type pids are declared as in the kernel
19390 rp="What is the type of process ids on this system?"
19391 set pid_t pidtype int stdio.h sys/types.h
19394 : see if ar generates random libraries by itself
19396 echo "Checking how to generate random libraries on your machine..." >&4
19397 echo 'int bar1() { return bar2(); }' > bar1.c
19398 echo 'int bar2() { return 2; }' > bar2.c
19400 #$i_stdlib I_STDLIB
19402 #include <stdlib.h>
19404 int main() { printf("%d\n", bar1()); exit(0); }
19406 $cc $ccflags -c bar1.c >/dev/null 2>&1
19407 $cc $ccflags -c bar2.c >/dev/null 2>&1
19408 $cc $ccflags -c foo.c >/dev/null 2>&1
19409 $ar rc bar$_a bar2$_o bar1$_o >/dev/null 2>&1
19410 if $cc -o foobar $ccflags $ldflags foo$_o bar$_a $libs > /dev/null 2>&1 &&
19411 $run ./foobar >/dev/null 2>&1; then
19412 echo "$ar appears to generate random libraries itself."
19414 if [ "X$ranlib" = "X" ]; then
19417 elif $ar s bar$_a >/dev/null 2>&1 &&
19418 $cc -o foobar $ccflags $ldflags foo$_o bar$_a $libs > /dev/null 2>&1 &&
19419 $run ./foobar >/dev/null 2>&1; then
19420 echo "a table of contents needs to be added with '$ar s'."
19423 elif $ar ts bar$_a >/dev/null 2>&1 &&
19424 $cc -o foobar $ccflags $ldflags foo$_o bar$_a $libs > /dev/null 2>&1 &&
19425 $run ./foobar >/dev/null 2>&1; then
19426 echo "a table of contents needs to be added with '$ar ts'."
19433 ranlib=`./loc ranlib X /usr/bin /bin /usr/local/bin`
19434 $test -f $ranlib || ranlib=''
19437 if $test -n "$ranlib"; then
19438 echo "your system has '$ranlib'; we'll use that."
19441 echo "your system doesn't seem to support random libraries"
19442 echo "so we'll use lorder and tsort to order the libraries."
19449 : check for type of arguments to select.
19450 case "$selecttype" in
19451 '') case "$d_select" in
19455 Checking to see what type of arguments are accepted by select().
19457 hdrs="$define sys/types.h
19458 $i_systime sys/time.h
19459 $i_sysselct sys/select.h
19460 $d_socket sys/socket.h"
19461 : The first arg can be int, unsigned, or size_t
19462 : The last arg may or may not be 'const'
19464 : void pointer has been seen but using that
19465 : breaks the selectminbits test
19466 for xxx in 'fd_set *' 'int *'; do
19467 for nfd in 'int' 'size_t' 'unsigned long' 'unsigned' ; do
19468 for tmo in 'struct timeval *' 'const struct timeval *'; do
19470 '') try="extern select _(($nfd, $xxx, $xxx, $xxx, $tmo));"
19471 if ./protochk "$try" $hdrs; then
19472 echo "Your system accepts $xxx."
19481 '') rp='What is the type for the 2nd, 3rd, and 4th arguments to select?'
19482 case "$d_fd_set" in
19483 $define) dflt="fd_set *" ;;
19492 *) : no select, so pick a harmless default
19499 : check for the select 'width'
19500 case "$selectminbits" in
19501 '') safebits=`expr $ptrsize \* 8`
19502 case "$d_select" in
19506 Checking to see on how many bits at a time your select() operates...
19509 #include <sys/types.h>
19511 #$i_systime I_SYS_TIME
19512 #$i_systimek I_SYS_TIME_KERNEL
19517 # ifdef I_SYS_TIME_KERNEL
19520 # include <sys/time.h>
19521 # ifdef I_SYS_TIME_KERNEL
19525 #$i_sysselct I_SYS_SELECT
19526 #ifdef I_SYS_SELECT
19527 #include <sys/select.h>
19529 #$d_socket HAS_SOCKET
19531 # include <sys/socket.h> /* Might include <sys/bsdtypes.h> */
19534 #$i_stdlib I_STDLIB
19536 #include <stdlib.h>
19539 #define S sizeof(*(b))
19541 #define NBYTES (S * 8 > MINBITS ? S : MINBITS/8)
19542 #define NBITS (NBYTES * 8)
19544 char *s = (char *)malloc(NBYTES);
19553 fp = fopen("try.c", "r");
19559 b = ($selecttype)s;
19560 for (i = 0; i < NBITS; i++)
19564 select(fd + 1, b, 0, 0, &t);
19565 for (i = NBITS - 1; i > fd && FD_ISSET(i, b); i--);
19567 printf("%d\n", i + 1);
19572 if eval $compile_ok; then
19573 selectminbits=`$run ./try`
19574 case "$selectminbits" in
19576 Cannot figure out on how many bits at a time your select() operates.
19577 I'll play safe and guess it is $safebits bits.
19579 selectminbits=$safebits
19580 bits="$safebits bits"
19583 *) bits="$selectminbits bits" ;;
19585 echo "Your select() operates on $bits at a time." >&4
19587 rp='What is the minimum number of bits your select() operates on?'
19588 case "$byteorder" in
19589 12345678) dflt=64 ;;
19595 selectminbits="$val"
19599 *) : no select, so pick a harmless default
19600 selectminbits=$safebits
19606 : Trace out the files included by signal.h, then look for SIGxxx names.
19607 : Remove SIGARRAYSIZE used by HPUX.
19608 : Remove SIGSTKSIZE used by Linux.
19609 : Remove SIGSTKSZ used by Posix.
19610 : Remove SIGTYP void lines used by OS2.
19611 : Some cpps, like os390, dont give the file name anywhere
19612 if [ "X$fieldn" = X ]; then
19613 : Just make some guesses. We check them later.
19614 xxx='/usr/include/signal.h /usr/include/sys/signal.h'
19616 xxx=`echo '#include <signal.h>' |
19617 $cppstdin $cppminus $cppflags 2>/dev/null |
19618 $grep '^[ ]*#.*include' |
19619 $awk "{print \\$$fieldn}" | $sed 's!"!!g' | $sed 's!\\\\\\\\!/!g' | $sort | $uniq`
19621 : Check this list of files to be sure we have parsed the cpp output ok.
19622 : This will also avoid potentially non-existent files, such
19625 for xx in $xxx /dev/null ; do
19626 $test -f "$xx" && xxxfiles="$xxxfiles $xx"
19628 : If we have found no files, at least try signal.h
19629 case "$xxxfiles" in
19630 '') xxxfiles=`./findhdr signal.h` ;;
19633 $1 ~ /^#define$/ && $2 ~ /^SIG[A-Z0-9]*$/ && $2 !~ /SIGARRAYSIZE/ && $2 !~ /SIGSTKSIZE/ && $2 !~ /SIGSTKSZ/ && $3 !~ /void/ {
19634 print substr($2, 4, 20)
19636 $1 == "#" && $2 ~ /^define$/ && $3 ~ /^SIG[A-Z0-9]*$/ && $3 !~ /SIGARRAYSIZE/ && $4 !~ /void/ {
19637 print substr($3, 4, 20)
19639 : Append some common names just in case the awk scan failed.
19640 xxx="$xxx ABRT ALRM BUS CANCEL CHLD CLD CONT DIL EMT FPE"
19641 xxx="$xxx FREEZE HUP ILL INT IO IOT KILL LOST LWP PHONE"
19642 xxx="$xxx PIPE POLL PROF PWR QUIT RTMAX RTMIN SEGV STKFLT STOP"
19643 xxx="$xxx SYS TERM THAW TRAP TSTP TTIN TTOU URG USR1 USR2"
19644 xxx="$xxx USR3 USR4 VTALRM WAITING WINCH WIND WINDOW XCPU XFSZ"
19646 : generate a few handy files for later
19647 $cat > signal.c <<EOCP
19648 #include <sys/types.h>
19649 #include <signal.h>
19650 #$i_stdlib I_STDLIB
19652 #include <stdlib.h>
19657 /* Strange style to avoid deeply-nested #if/#else/#endif */
19660 # define NSIG (_NSIG)
19666 # define NSIG (SIGMAX+1)
19672 # define NSIG (SIG_MAX+1)
19678 # define NSIG (_SIG_MAX+1)
19684 # define NSIG (MAXSIG+1)
19690 # define NSIG (MAX_SIG+1)
19695 # ifdef SIGARRAYSIZE
19696 # define NSIG SIGARRAYSIZE /* Assume ary[SIGARRAYSIZE] */
19702 # define NSIG (_sys_nsig) /* Solaris 2.5 */
19706 /* Default to some arbitrary number that's big enough to get most
19707 of the common signals.
19713 printf("NSIG %d\n", NSIG);
19719 echo $xxx | $tr ' ' $trnl | $sort | $uniq | $awk '
19721 printf "#ifdef SIG"; printf $1; printf "\n"
19722 printf "printf(\""; printf $1; printf " %%d\\n\",SIG";
19723 printf $1; printf ");\n"
19727 printf "#endif /* JUST_NSIG */\n";
19728 printf "exit(0);\n}\n";
19731 $cat >signal.awk <<'EOP'
19732 BEGIN { ndups = 0 }
19733 $1 ~ /^NSIG$/ { nsig = $2 }
19734 ($1 !~ /^NSIG$/) && (NF == 2) && ($2 ~ /^[0-9][0-9]*$/) {
19735 if ($2 > maxsig) { maxsig = $2 }
19736 if (sig_name[$2]) {
19737 dup_name[ndups] = $1
19738 dup_num[ndups] = $2
19750 printf("NSIG %d\n", nsig);
19751 for (n = 1; n < nsig; n++) {
19753 printf("%s %d\n", sig_name[n], sig_num[n])
19756 printf("NUM%d %d\n", n, n)
19759 for (n = 0; n < ndups; n++) {
19760 printf("%s %d\n", dup_name[n], dup_num[n])
19764 $cat >signal_cmd <<EOS
19766 if $test -s signal.lst; then
19767 echo "Using your existing signal.lst file"
19772 $cat >>signal_cmd <<'EOS'
19775 if eval $compile_ok; then
19776 $run ./signal$_exe | ($sort -n -k 2 2>/dev/null || $sort -n +1) | $uniq | $awk -f signal.awk >signal.lst
19778 echo "(I can't seem be able to compile the whole test program)" >&4
19779 echo "(I'll try it in little pieces.)" >&4
19780 set signal -DJUST_NSIG
19781 if eval $compile_ok; then
19782 $run ./signal$_exe > signal.nsg
19785 echo "I can't seem to figure out how many signals you have." >&4
19786 echo "Guessing 50." >&4
19787 echo 'NSIG 50' > signal.nsg
19789 : Now look at all the signal names, one at a time.
19790 for xx in `echo $xxx | $tr ' ' $trnl | $sort | $uniq`; do
19791 $cat > signal.c <<EOCP
19792 #include <sys/types.h>
19793 #include <signal.h>
19796 printf("$xx %d\n", SIG${xx});
19801 if eval $compile; then
19802 echo "SIG${xx} found."
19803 $run ./signal$_exe >> signal.ls1
19805 echo "SIG${xx} NOT found."
19808 if $test -s signal.ls1; then
19809 $cat signal.nsg signal.ls1 |
19810 $sort -n | $uniq | $awk -f signal.awk >signal.lst
19814 if $test -s signal.lst; then
19817 echo "(AAK! I can't compile the test programs -- Guessing)" >&4
19818 echo 'kill -l' >signal
19819 set X `csh -f <signal`
19823 0) set HUP INT QUIT ILL TRAP ABRT EMT FPE KILL BUS SEGV SYS PIPE ALRM TERM;;
19825 echo $@ | $tr ' ' $trnl | \
19826 $awk '{ printf "%s %d\n", $1, ++s; }
19827 END { printf "NSIG %d\n", ++s }' >signal.lst
19829 $rm -f signal.c signal$_exe signal$_o signal.nsg signal.ls1
19831 chmod a+x signal_cmd
19832 $eunicefix signal_cmd
19834 : generate list of signal names
19836 case "$sig_name_init" in
19838 *) case "$sig_num_init" in
19839 ''|*,*) doinit=yes ;;
19844 echo "Generating a list of signal names and numbers..." >&4
19846 sig_count=`$awk '/^NSIG/ { printf "%d", $2 }' signal.lst`
19847 sig_name=`$awk 'BEGIN { printf "ZERO " }
19848 !/^NSIG/ { printf "%s ", $1 }' signal.lst`
19849 sig_num=`$awk 'BEGIN { printf "0 " }
19850 !/^NSIG/ { printf "%d ", $2 }' signal.lst`
19851 sig_name_init=`$awk 'BEGIN { printf "\"ZERO\", " }
19852 !/^NSIG/ { printf "\"%s\", ", $1 }
19853 END { printf "0\n" }' signal.lst`
19854 sig_num_init=`$awk 'BEGIN { printf "0, " }
19855 !/^NSIG/ { printf "%d, ", $2}
19856 END { printf "0\n"}' signal.lst`
19859 echo "The following $sig_count signals are available:"
19861 echo $sig_name | $awk \
19862 'BEGIN { linelen = 0 }
19864 for (i = 1; i <= NF; i++) {
19865 name = "SIG" $i " "
19866 linelen = linelen + length(name)
19867 if (linelen > 70) {
19869 linelen = length(name)
19875 sig_size=`echo $sig_name | awk '{print NF}'`
19876 $rm -f signal signal.c signal.awk signal.lst signal_cmd
19879 case "$sizetype" in
19880 *_t) zzz="$sizetype" ;;
19881 *) zzz="filesize" ;;
19883 echo "Checking the size of $zzz..." >&4
19885 #include <sys/types.h>
19887 #$i_stdlib I_STDLIB
19889 #include <stdlib.h>
19892 printf("%d\n", (int)sizeof($sizetype));
19897 if eval $compile_ok; then
19901 echo "(I can't execute the test program--guessing $sizesize.)" >&4
19904 echo "Your $zzz size is $sizesize bytes."
19909 echo "(I can't compile the test program--guessing $sizesize.)" >&4
19913 : check for socklen_t
19915 echo "Checking to see if you have socklen_t..." >&4
19917 #include <sys/types.h>
19918 #$d_socket HAS_SOCKET
19920 #include <sys/socket.h>
19922 int main() { socklen_t x = 16; }
19925 if eval $compile; then
19927 echo "You have socklen_t."
19930 echo "You do not have socklen_t."
19931 case "$sizetype" in
19932 size_t) echo "(You do have size_t, that might work. Some people are happy with just an int.)" ;;
19939 : see if this is a socks.h system
19940 set socks.h i_socks
19943 : check for type of the size argument to socket calls
19944 case "$d_socket" in
19948 Checking to see what type is the last argument of accept().
19951 case "$d_socklen_t" in
19952 "$define") yyy="$yyy socklen_t"
19954 yyy="$yyy $sizetype int long unsigned"
19955 for xxx in $yyy; do
19956 case "$socksizetype" in
19957 '') try="extern int accept(int, struct sockaddr *, $xxx *);"
19958 case "$usesocks" in
19960 if ./protochk "$try" $i_systypes sys/types.h $d_socket sys/socket.h literal '#define INCLUDE_PROTOTYPES' $i_socks socks.h.; then
19961 echo "Your system accepts '$xxx *' for the last argument of accept()."
19962 socksizetype="$xxx"
19965 *) if ./protochk "$try" $i_systypes sys/types.h $d_socket sys/socket.h; then
19966 echo "Your system accepts '$xxx *' for the last argument of accept()."
19967 socksizetype="$xxx"
19974 : In case none of those worked, prompt the user.
19975 case "$socksizetype" in
19976 '') rp='What is the type for socket address structure sizes?'
19983 *) : no sockets, so pick relatively harmless default
19988 : see what type is used for signed size_t
19989 set ssize_t ssizetype int stdio.h sys/types.h
19994 #$i_stdlib I_STDLIB
19996 #include <stdlib.h>
19998 #include <sys/types.h>
19999 #define Size_t $sizetype
20000 #define SSize_t $dflt
20003 if (sizeof(Size_t) == sizeof(SSize_t))
20005 else if (sizeof(Size_t) == sizeof(int))
20014 if eval $compile_ok && $run ./try > /dev/null; then
20015 ssizetype=`$run ./try`
20016 echo "I'll be using $ssizetype for functions returning a byte count." >&4
20019 Help! I can't compile and run the ssize_t test program: please enlighten me!
20020 (This is probably a misconfiguration in your system or libraries, and
20021 you really ought to fix it. Still, I'll try anyway.)
20023 I need a type that is the same size as $sizetype, but is guaranteed to
20024 be signed. Common values are ssize_t, int and long.
20027 rp="What signed type is the same size as $sizetype?"
20033 : see what type of char stdio uses.
20035 echo '#include <stdio.h>' > stdio.c
20036 $cppstdin $cppminus < stdio.c > stdioh
20037 if $contains 'unsigned.*char.*_ptr;' stdioh >/dev/null 2>&1 ; then
20038 echo "Your stdio uses unsigned chars." >&4
20039 stdchar="unsigned char"
20041 echo "Your stdio uses signed chars." >&4
20044 $rm -f stdio.* stdioh
20046 : see what type uids are declared as in the kernel
20048 echo "Looking for the type for user ids returned by getuid()."
20049 set uid_t uidtype xxx stdio.h sys/types.h
20053 xxx=`./findhdr sys/user.h`
20054 set `grep '_ruid;' "$xxx" 2>/dev/null` unsigned short
20056 unsigned) dflt="$1 $2" ;;
20060 *) dflt="$uidtype";;
20063 uid_t) echo "uid_t found." ;;
20064 *) rp="What is the type for user ids returned by getuid()?"
20072 *_t) zzz="$uidtype" ;;
20075 echo "Checking the size of $zzz..." >&4
20077 #include <sys/types.h>
20079 #$i_stdlib I_STDLIB
20081 #include <stdlib.h>
20084 printf("%d\n", (int)sizeof($uidtype));
20089 if eval $compile_ok; then
20093 echo "(I can't execute the test program--guessing $uidsize.)" >&4
20096 echo "Your $zzz is $uidsize bytes long."
20101 echo "(I can't compile the test program--guessing $uidsize.)" >&4
20106 *_t) zzz="$uidtype" ;;
20109 echo "Checking the sign of $zzz..." >&4
20111 #include <sys/types.h>
20122 if eval $compile; then
20126 echo "(I can't execute the test program--guessing unsigned.)" >&4
20130 1) echo "Your $zzz is unsigned." ;;
20131 -1) echo "Your $zzz is signed." ;;
20137 echo "(I can't compile the test program--guessing unsigned.)" >&4
20143 $echo "Checking the format string to be used for uids..." >&4
20146 -1) if $test X"$uidsize" = X"$ivsize"; then
20147 uidformat="$ivdformat"
20149 if $test X"$uidsize" = X"$longsize"; then
20152 if $test X"$uidsize" = X"$intsize"; then
20155 if $test X"$uidsize" = X"$shortsize"; then
20162 *) if $test X"$uidsize" = X"$uvsize"; then
20163 uidformat="$uvuformat"
20165 if $test X"$uidsize" = X"$longsize"; then
20168 if $test X"$uidsize" = X"$intsize"; then
20171 if $test X"$uidsize" = X"$shortsize"; then
20181 case "$usesitecustomize" in
20182 $define|true|[Yy]*)
20183 usesitecustomize="$define"
20186 usesitecustomize="$undef"
20190 : determine compiler compiler
20199 if $test -f "$byacc$_exe"; then
20201 comp="byacc or $comp"
20203 if $test -f "$bison$_exe"; then
20204 comp="$comp or bison -y"
20206 rp="Which compiler compiler ($comp) shall I use?"
20215 echo "(Adding -y option to bison to get yacc-compatible behaviour.)"
20221 : see if this is a fp.h system
20225 : see if this is a fp_class.h system
20226 set fp_class.h i_fp_class
20229 : see if this is a ieeefp.h system
20230 case "$i_ieeefp" in
20231 '' ) set ieeefp.h i_ieeefp
20236 : see if this is a libutil.h system
20237 set libutil.h i_libutil
20240 : see if mach cthreads are available
20241 if test "X$usethreads" = "X$define"; then
20242 set mach/cthreads.h i_machcthr
20245 i_machcthr="$undef"
20250 : see if this is a mntent.h system
20251 set mntent.h i_mntent
20254 : see if ndbm.h is available
20260 # Some Linux distributions such as RedHat 7.1 put the
20261 # ndbm.h header in /usr/include/gdbm/ndbm.h.
20262 if $test -f /usr/include/gdbm/ndbm.h; then
20263 echo '<gdbm/ndbm.h> found.'
20264 ccflags="$ccflags -I/usr/include/gdbm"
20265 cppflags="$cppflags -I/usr/include/gdbm"
20273 : see if dbm_open exists
20274 set dbm_open d_dbm_open
20276 case "$d_dbm_open" in
20279 echo "We won't be including <ndbm.h>"
20288 : see if net/errno.h is available
20290 set net/errno.h val
20293 : Unfortunately, it causes problems on some systems. Arrgh.
20296 cat > try.c <<'EOM'
20299 #include <net/errno.h>
20305 if $cc $ccflags -c try.c >/dev/null 2>&1; then
20306 echo "We'll be including <net/errno.h>." >&4
20308 echo "We won't be including <net/errno.h>." >&4
20317 : see if netinet/tcp.h is available
20318 set netinet/tcp.h i_netinettcp
20321 : see if this is a poll.h system
20325 : see if this is a prot.h system
20330 $echo "Guessing which symbols your C compiler and preprocessor define..." >&4
20331 $cat <<'EOSH' > Cppsym.know
20332 a29k ABI64 aegis AES_SOURCE AIX AIX32 AIX370
20333 AIX41 AIX42 AIX43 AIX_SOURCE aixpc ALL_SOURCE
20334 alliant alpha am29000 AM29000 AMD64 amd64 amiga AMIGAOS AMIX
20335 ansi ANSI_C_SOURCE apollo ardent ARM32 atarist att386 att3b
20336 BeOS BIG_ENDIAN BIT_MSF bsd BSD bsd43 bsd4_2 bsd4_3 BSD4_3 bsd4_4
20337 BSD_4_3 BSD_4_4 BSD_NET2 BSD_TIME BSD_TYPES BSDCOMPAT bsdi
20338 bull c cadmus clipper CMU COFF COMPILER_VERSION
20339 concurrent convex cpu cray CRAY CRAYMPP ctix CX_UX
20340 CYGWIN DECC DGUX DGUX_SOURCE DJGPP dmert DOLPHIN DPX2 DSO
20341 Dynix DynixPTX ELF encore EPI EXTENSIONS FAVOR_BSD
20342 FILE_OFFSET_BITS FreeBSD GCC_NEW_VARARGS gcos gcx gimpel
20344 GNU_SOURCE GNUC GNUC_MINOR GNU_LIBRARY GO32 gould GOULD_PN
20345 H3050R H3050RX hbullx20 hcx host_mips
20346 hp200 hp300 hp700 HP700 hp800 hp9000
20347 hp9000s200 hp9000s300 hp9000s400 hp9000s500
20348 hp9000s700 hp9000s800 hp9k8 hp_osf hppa hpux HPUX_SOURCE
20349 i186 i286 i386 i486 i586 i686 i8086 i80960 i860 I960
20350 IA64 iAPX286 ibm ibm032 ibmesa IBMR2 ibmrt ILP32 ILP64
20351 INLINE_INTRINSICS INTRINSICS INT64 interdata is68k ksr1
20352 LANGUAGE_C LARGE_FILE_API LARGEFILE64_SOURCE
20353 LARGEFILE_SOURCE LFS64_LARGEFILE LFS_LARGEFILE
20354 Linux LITTLE_ENDIAN LONG64 LONG_DOUBLE LONG_LONG
20355 LONGDOUBLE LONGLONG LP64 luna luna88k Lynx
20356 M68000 m68k m88100 m88k M88KBCS_TARGET M_COFF
20357 M_I186 M_I286 M_I386 M_I8086 M_I86 M_I86SM M_SYS3
20358 M_SYS5 M_SYSIII M_SYSV M_UNIX M_XENIX MACH machine MachTen
20359 MATH_HAS_NO_SIDE_EFFECTS
20360 mc300 mc500 mc68000 mc68010 mc68020 mc68030 mc68040
20361 mc68060 mc68k mc68k32 mc700 mc88000 mc88100 merlin
20362 mert MiNT mips MIPS_FPSET MIPS_ISA MIPS_SIM MIPS_SZINT
20363 MIPS_SZLONG MIPS_SZPTR MIPSEB MIPSEL MODERN_C motorola
20364 mpeix MSDOS MTXINU MULTIMAX mvs MVS n16 ncl_el ncl_mr
20365 NetBSD news1500 news1700 news1800 news1900 news3700
20366 news700 news800 news900 NeXT NLS nonstopux ns16000 ns32000
20367 ns32016 ns32332 ns32k nsc32000
20368 OCS88 OEMVS OpenBSD os OS2 OS390 osf OSF1 OSF_SOURCE
20369 pa_risc PA_RISC1_1 PA_RISC2_0 PARAGON parisc
20370 pc532 pdp11 PGC PIC plexus PORTAR posix
20371 POSIX1B_SOURCE POSIX2_SOURCE POSIX4_SOURCE
20372 POSIX_C_SOURCE POSIX_SOURCE POWER
20373 PROTOTYPES PWB pyr QNX R3000 REENTRANT RES Rhapsody RISC6000
20374 riscix riscos RT S390 SA110 scs SCO sequent sgi SGI_SOURCE SH3 sinix
20375 SIZE_INT SIZE_LONG SIZE_PTR SOCKET_SOURCE SOCKETS_SOURCE
20376 sony sony_news sonyrisc sparc sparclite spectrum
20377 stardent stdc STDC_EXT stratos sun sun3 sun386
20378 Sun386i svr3 svr4 SVR4_2 SVR4_SOURCE svr5
20379 SX system SYSTYPE_BSD SYSTYPE_BSD43 SYSTYPE_BSD44
20380 SYSTYPE_SVR4 SYSTYPE_SVR5 SYSTYPE_SYSV SYSV SYSV3 SYSV4 SYSV5
20381 sysV68 sysV88 Tek4132 Tek4300 titan
20382 TM3200 TM5400 TM5600
20383 tower tower32 tower32_200 tower32_600 tower32_700
20384 tower32_800 tower32_850 tss
20385 u370 u3b u3b2 u3b20 u3b200 u3b20d u3b5
20386 ultrix UMAXV UnicomPBB UnicomPBD UNICOS UNICOSMK
20387 unix UNIX95 UNIX99 unixpc unos
20388 USE_BSD USE_FILE_OFFSET64 USE_GNU USE_ISOC9X USE_LARGEFILE USE_LARGEFILE64
20389 USE_MISC USE_POSIX USE_POSIX199309 USE_POSIX199506 USE_POSIX2
20390 USE_REENTRANT USE_SVID USE_UNIX98 USE_XOPEN USE_XOPEN_EXTENDED
20392 Utek UTek UTS UWIN uxpm uxps vax venix VMESA vms x86_64 xenix Xenix286
20393 XOPEN_SOURCE XOPEN_SOURCE_EXTENDED XPG2 XPG2_EXTENDED
20394 XPG3 XPG3_EXTENDED XPG4 XPG4_EXTENDED
20397 # Maybe put other stuff here too.
20398 cat <<EOSH >>Cppsym.know
20401 ./tr '[a-z]' '[A-Z]' < Cppsym.know > Cppsym.a
20402 ./tr '[A-Z]' '[a-z]' < Cppsym.know > Cppsym.b
20403 $cat Cppsym.know > Cppsym.c
20404 $cat Cppsym.a Cppsym.b Cppsym.c | $tr ' ' $trnl | $sort | $uniq > Cppsym.know
20405 $rm -f Cppsym.a Cppsym.b Cppsym.c
20406 cat <<EOSH > Cppsym
20408 if $test \$# -gt 0; then
20409 echo \$* | $tr " " "$trnl" | ./Cppsym.try > Cppsym.got
20410 if $test -s Cppsym.got; then
20417 $tr " " "$trnl" | ./Cppsym.try
20423 cat <<EOSH > Cppsym.try
20425 cat <<'EOCP' > try.c
20428 #define STRINGIFY(a) "a"
20430 #if cpp_stuff == 42
20431 #define StGiFy(a) #a
20432 #define STRINGIFY(a) StGiFy(a)
20434 #if $cpp_stuff != 1 && $cpp_stuff != 42
20435 # include "Bletch: How does this C preprocessor stringify macros?"
20441 cat <<'EOSH' >> Cppsym.try
20443 printf "#ifdef %s\nprintf(\"%s=%%s\\n\", STRINGIFY(%s));\n#endif\n", $1, $1, $1
20444 printf "#ifdef _%s\nprintf(\"_%s=%%s\\n\", STRINGIFY(_%s));\n#endif\n", $1, $1, $1
20445 printf "#ifdef __%s\nprintf(\"__%s=%%s\\n\", STRINGIFY(__%s));\n#endif\n", $1, $1, $1
20446 printf "#ifdef __%s__\nprintf(\"__%s__=%%s\\n\", STRINGIFY(__%s__));\n#endif\n", $1, $1, $1
20448 echo 'return 0;}' >> try.c
20450 cat <<EOSH >> Cppsym.try
20452 case "$osname-$gccversion" in
20453 irix-) ccflags="\$ccflags -woff 1178" ;;
20454 os2-*) ccflags="\$ccflags -Zlinker /PM:VIO" ;;
20456 $cc -o try -Dcpp_stuff=$cpp_stuff $optimize \$ccflags $ldflags try.c $libs && $run ./try | $sed 's/ /\\\\ /g'
20458 chmod +x Cppsym.try
20459 $eunicefix Cppsym.try
20460 ./Cppsym < Cppsym.know > Cppsym.true
20461 : Add in any linux cpp "predefined macros":
20462 case "$osname::$gccversion" in
20465 rm -f $tHdrH'.h' $tHdrH
20467 if cpp -dM $tHdrH'.h' > $tHdrH'_cppsym.h' && [ -s $tHdrH'_cppsym.h' ]; then
20468 sed 's/#define[\ \ ]*//;s/[\ \ ].*$//' <$tHdrH'_cppsym.h' >$tHdrH'_cppsym.real'
20469 if [ -s $tHdrH'_cppsym.real' ]; then
20470 cat $tHdrH'_cppsym.real' Cppsym.know | sort | uniq | ./Cppsym | sort | uniq > Cppsym.true
20473 rm -f $tHdrH'.h' $tHdrH'_cppsym.h' $tHdrH'_cppsym.real'
20476 : now check the C compiler for additional symbols
20477 postprocess_cc_v=''
20479 aix) postprocess_cc_v="|$tr , ' '" ;;
20486 for i in \`$cc -v -c tmp.c 2>&1 $postprocess_cc_v\`
20489 -D*) echo "\$i" | $sed 's/^-D//';;
20490 -A*) $test "$gccversion" && echo "\$i" | $sed 's/^-A//' | $sed 's/\(.*\)(\(.*\))/\1=\2/';;
20495 postprocess_cc_v=''
20498 ./ccsym > ccsym1.raw
20499 if $test -s ccsym1.raw; then
20500 $sort ccsym1.raw | $uniq >ccsym.raw
20502 mv ccsym1.raw ccsym.raw
20505 $awk '/\=/ { print $0; next }
20506 { print $0"=1" }' ccsym.raw >ccsym.list
20507 $comm -13 Cppsym.true ccsym.list >ccsym.own
20508 $comm -12 Cppsym.true ccsym.list >ccsym.com
20509 $comm -23 Cppsym.true ccsym.list >ccsym.cpp
20511 if $test -z ccsym.raw; then
20512 echo "Your C compiler doesn't seem to define any symbols!" >&4
20514 echo "However, your C preprocessor defines the following symbols:"
20517 cppsymbols=`$cat Cppsym.true`
20518 cppsymbols=`echo $cppsymbols`
20519 cppccsymbols="$cppsymbols"
20521 if $test -s ccsym.com; then
20522 echo "Your C compiler and pre-processor define these symbols:"
20523 $sed -e 's/\(..*\)=.*/\1/' ccsym.com
20526 cppccsymbols=`$cat ccsym.com`
20527 cppccsymbols=`echo $cppccsymbols`
20528 $test "$silent" || sleep 1
20530 if $test -s ccsym.cpp; then
20531 $test "$also" && echo " "
20532 echo "Your C pre-processor ${also}defines the following symbols:"
20533 $sed -e 's/\(..*\)=.*/\1/' ccsym.cpp
20535 cppsymbols=`$cat ccsym.cpp`
20536 cppsymbols=`echo $cppsymbols`
20537 $test "$silent" || sleep 1
20539 if $test -s ccsym.own; then
20540 $test "$also" && echo " "
20541 echo "Your C compiler ${also}defines the following cpp symbols:"
20542 $sed -e 's/\(..*\)=1/\1/' ccsym.own
20543 $sed -e 's/\(..*\)=.*/\1/' ccsym.own | $uniq >>Cppsym.true
20544 ccsymbols=`$cat ccsym.own`
20545 ccsymbols=`echo $ccsymbols`
20546 $test "$silent" || sleep 1
20550 : see if this is a termio system
20554 if $test `./findhdr termios.h`; then
20555 set tcsetattr i_termios
20561 "$define") echo "You have POSIX termios.h... good!" >&4;;
20562 *) if ./Cppsym pyr; then
20563 case "`/bin/universe`" in
20564 ucb) if $test `./findhdr sgtty.h`; then
20566 echo "<sgtty.h> found." >&4
20568 echo "System is pyramid with BSD universe."
20569 echo "<sgtty.h> not found--you could have problems." >&4
20571 *) if $test `./findhdr termio.h`; then
20573 echo "<termio.h> found." >&4
20575 echo "System is pyramid with USG universe."
20576 echo "<termio.h> not found--you could have problems." >&4
20580 if $test `./findhdr termio.h`; then
20581 echo "<termio.h> found." >&4
20583 elif $test `./findhdr sgtty.h`; then
20584 echo "<sgtty.h> found." >&4
20587 echo "Neither <termio.h> nor <sgtty.h> found--you could have problems." >&4
20590 if $test `./findhdr sgtty.h`; then
20591 echo "<sgtty.h> found." >&4
20593 elif $test `./findhdr termio.h`; then
20594 echo "<termio.h> found." >&4
20597 echo "Neither <sgtty.h> nor <termio.h> found--you could have problems." >&4
20601 set i_termio; eval $setvar
20602 val=$val2; set i_sgtty; eval $setvar
20603 val=$val3; set i_termios; eval $setvar
20605 : see if stddef is available
20606 set stddef.h i_stddef
20609 : see if this is a sunmath.h system
20610 set sunmath.h i_sunmath
20613 : see if sys/access.h is available
20614 set sys/access.h i_sysaccess
20617 : see if ioctl defs are in sgtty, termio, sys/filio or sys/ioctl
20618 set sys/filio.h i_sysfilio
20621 if $test `./findhdr sys/ioctl.h`; then
20623 echo '<sys/ioctl.h> found.' >&4
20626 if $test $i_sysfilio = "$define"; then
20627 echo '<sys/ioctl.h> NOT found.' >&4
20629 $test $i_sgtty = "$define" && xxx="sgtty.h"
20630 $test $i_termio = "$define" && xxx="termio.h"
20631 $test $i_termios = "$define" && xxx="termios.h"
20632 echo "No <sys/ioctl.h> found, assuming ioctl args are defined in <$xxx>." >&4
20638 : see if socket ioctl defs are in sys/sockio.h
20640 xxx=`./findhdr sys/sockio.h`
20641 if $test "$xxx"; then
20642 if $contains SIOCATMARK $xxx >/dev/null 2>&1; then
20644 echo "You have socket ioctls defined in <sys/sockio.h>." >&4
20647 echo "No socket ioctls found in <sys/sockio.h>." >&4
20652 <sys/sockio.h> not found, assuming socket ioctls are in <sys/ioctl.h>.
20659 : see if this is a syslog.h system
20660 set syslog.h i_syslog
20664 : see if this is a sys/mode.h system
20665 set sys/mode.h i_sysmode
20668 : see if sys/resource.h has to be included
20669 set sys/resource.h i_sysresrc
20672 : see if sys/security.h is available
20673 set sys/security.h i_syssecrt
20676 : see if this is a sys/statvfs.h system
20677 set sys/statvfs.h i_sysstatvfs
20680 : see if this is a sys/un.h system
20681 set sys/un.h i_sysun
20685 : see if this is a sys/utsname.h system
20686 set sys/utsname.h i_sysutsname
20689 : see if this is a syswait system
20690 set sys/wait.h i_syswait
20693 : see if this is a ustat.h system
20694 set ustat.h i_ustat
20697 : see if this is an utime system
20698 set utime.h i_utime
20701 : see if this is a values.h system
20702 set values.h i_values
20705 : see if this is a vfork system
20708 set vfork.h i_vfork
20716 : see if gdbm.h is available
20721 : see if gdbm_open exists
20722 set gdbm_open d_gdbm_open
20724 case "$d_gdbm_open" in
20727 echo "We won't be including <gdbm.h>"
20737 echo "Looking for extensions..." >&4
20738 : If we are using the old config.sh, known_extensions may contain
20739 : old or inaccurate or duplicate values.
20740 known_extensions=''
20741 nonxs_extensions=''
20742 : We do not use find because it might not be available.
20743 : We do not just use MANIFEST because the user may have dropped
20744 : some additional extensions into the source tree and expect them
20747 : Function to recursively find available extensions, ignoring DynaLoader
20748 : NOTE: recursion limit of 10 to prevent runaway in case of symlink madness
20752 DynaLoader|dynaload) ;;
20754 if $test -f $xxx/$xxx.xs; then
20755 known_extensions="$known_extensions $1$xxx";
20756 elif $test -f $xxx/Makefile.PL; then
20757 nonxs_extensions="$nonxs_extensions $1$xxx";
20759 if $test -d $xxx -a $# -lt 10; then
20762 eval $find_extensions;
20774 eval $find_extensions
20775 # Special case: Add in threads/shared since it is not picked up by the
20776 # recursive find above (and adding in general recursive finding breaks
20777 # SDBM_File/sdbm). A.D. 10/25/2001.
20778 known_extensions="$known_extensions threads/shared"
20779 set X $nonxs_extensions
20781 nonxs_extensions="$*"
20782 set X $known_extensions
20784 known_extensions="$*"
20787 : Now see which are supported on this system.
20789 for xxx in $known_extensions ; do
20793 $define) avail_ext="$avail_ext $xxx" ;;
20796 GDBM_File|gdbm_fil)
20798 $define) avail_ext="$avail_ext $xxx" ;;
20801 I18N/Langinfo|i18n_lan)
20802 case "$i_langinfo$d_nl_langinfo" in
20803 $define$define) avail_ext="$avail_ext $xxx" ;;
20806 NDBM_File|ndbm_fil)
20809 case "$osname-$use64bitint" in
20812 *-lndbm*) avail_ext="$avail_ext $xxx" ;;
20815 *) avail_ext="$avail_ext $xxx" ;;
20820 ODBM_File|odbm_fil)
20821 case "${i_dbm}${i_rpcsvcdbm}" in
20823 case "$osname-$use64bitint" in
20826 *-ldbm*) avail_ext="$avail_ext $xxx" ;;
20829 *) avail_ext="$avail_ext $xxx" ;;
20835 case "$useposix" in
20836 true|define|y) avail_ext="$avail_ext $xxx" ;;
20840 case "$useopcode" in
20841 true|define|y) avail_ext="$avail_ext $xxx" ;;
20845 case "$d_socket" in
20848 beos) ;; # not unless BONE
20849 *) avail_ext="$avail_ext $xxx" ;;
20854 Sys/Syslog|sys/syslog)
20855 : XXX syslog requires socket
20856 case "$d_socket" in
20857 true|$define|y) avail_ext="$avail_ext $xxx" ;;
20861 case "$usethreads" in
20863 case "$useithreads" in
20864 $undef|false|[nN]*) avail_ext="$avail_ext $xxx" ;;
20868 XS/APItest|xs/apitest)
20869 # This is just for testing. Skip it unless we have dynamic loading.
20872 $define) avail_ext="$avail_ext $xxx" ;;
20875 XS/Typemap|xs/typemap)
20876 # This is just for testing. Skip it unless we have dynamic loading.
20878 $define) avail_ext="$avail_ext $xxx" ;;
20881 threads|threads/shared)
20882 # threads and threads::shared are special cases.
20883 # To stop people from asking "Perl 5.8.0 was supposed
20884 # to have this new fancy threads implementation but my
20885 # perl doesn't have it" and from people trying to
20886 # (re)install the threads module using CPAN.pm and
20887 # CPAN.pm then offering to reinstall Perl 5.8.0,
20888 # the threads.pm and threads/shared.pm will always be
20889 # there, croaking informatively ("you need to rebuild
20890 # all of Perl with threads, sorry") when threads haven't
20891 # been compiled in.
20893 avail_ext="$avail_ext $xxx"
20896 : XXX Do we need a useipcsysv variable here
20897 case "${d_msg}${d_sem}${d_shm}" in
20898 *"${define}"*) avail_ext="$avail_ext $xxx" ;;
20901 *) avail_ext="$avail_ext $xxx"
20910 case "$onlyextensions" in
20912 *) keepextensions=''
20913 echo "You have requested that only certains extensions be included..." >&4
20914 for i in $onlyextensions; do
20915 case " $avail_ext " in
20917 echo "Keeping extension $i."
20918 keepextensions="$keepextensions $i"
20920 *) echo "Ignoring extension $i." ;;
20923 avail_ext="$keepextensions"
20927 case "$noextensions" in
20929 *) keepextensions=''
20930 echo "You have requested that certain extensions be ignored..." >&4
20931 for i in $avail_ext; do
20932 case " $noextensions " in
20933 *" $i "*) echo "Ignoring extension $i." ;;
20934 *) echo "Keeping extension $i.";
20935 keepextensions="$keepextensions $i"
20939 avail_ext="$keepextensions"
20943 : Now see which nonxs extensions are supported on this system.
20944 : For now assume all are.
20946 for xxx in $nonxs_extensions ; do
20948 *) nonxs_ext="$nonxs_ext $xxx"
20960 A number of extensions are supplied with $package. You may choose to
20961 compile these extensions for dynamic loading (the default), compile
20962 them into the $package executable (static loading), or not include
20963 them at all. Answer "none" to include no extensions.
20964 Note that DynaLoader is always built and need not be mentioned here.
20967 case "$dynamic_ext" in
20969 : Exclude those listed in static_ext
20971 for xxx in $avail_ext; do
20972 case " $static_ext " in
20974 *) dflt="$dflt $xxx" ;;
20981 *) dflt="$dynamic_ext"
20982 # Perhaps we are reusing an old out-of-date config.sh.
20985 if test X"$dynamic_ext" != X"$avail_ext"; then
20987 NOTICE: Your previous config.sh list may be incorrect.
20988 The extensions now available to you are
20990 but the default list from your previous config.sh is
21002 rp="What extensions do you wish to load dynamically?"
21005 none) dynamic_ext=' ' ;;
21006 *) dynamic_ext="$ans" ;;
21009 case "$static_ext" in
21011 : Exclude those already listed in dynamic linking
21013 for xxx in $avail_ext; do
21014 case " $dynamic_ext " in
21016 *) dflt="$dflt $xxx" ;;
21023 *) dflt="$static_ext"
21030 rp="What extensions do you wish to load statically?"
21033 none) static_ext=' ' ;;
21034 *) static_ext="$ans" ;;
21039 A number of extensions are supplied with $package. Answer "none"
21040 to include no extensions.
21041 Note that DynaLoader is always built and need not be mentioned here.
21044 case "$static_ext" in
21045 '') dflt="$avail_ext" ;;
21046 *) dflt="$static_ext"
21047 # Perhaps we are reusing an old out-of-date config.sh.
21050 if test X"$static_ext" != X"$avail_ext"; then
21052 NOTICE: Your previous config.sh list may be incorrect.
21053 The extensions now available to you are
21055 but the default list from your previous config.sh is
21064 : Exclude those that are not xs extensions
21068 rp="What extensions do you wish to include?"
21071 none) static_ext=' ' ;;
21072 *) static_ext="$ans" ;;
21077 # Encode is a special case. If we are building Encode as a static
21078 # extension, we need to explicitly list its subextensions as well.
21079 # For other nested extensions, this is handled automatically by
21080 # the appropriate Makefile.PL.
21081 case " $static_ext " in
21082 *" Encode "*) # Add the subextensions of Encode
21084 for xxx in `ls Encode/*/Makefile.PL|awk -F/ '{print $2}'`; do
21085 static_ext="$static_ext Encode/$xxx"
21091 set X $dynamic_ext $static_ext $nonxs_ext
21095 # Sanity check: We require an extension suitable for use with
21096 # AnyDBM_File, as well as Fcntl and IO. (Failure to have these
21097 # should show up as failures in the test suite, but it's helpful to
21098 # catch them now.) The 'extensions' list is normally sorted
21099 # alphabetically, so we need to accept either
21100 # DB_File ... Fcntl ... IO ....
21101 # or something like
21102 # Fcntl ... NDBM_File ... IO ....
21103 case " $extensions" in
21104 *"_File "*" Fcntl "*" IO "*) ;; # DB_File
21105 *" Fcntl "*"_File "*" IO "*) ;; # GDBM_File
21106 *" Fcntl "*" IO "*"_File "*) ;; # NDBM_File
21107 *) echo "WARNING: Extensions DB_File or *DBM_File, Fcntl, and IO not configured." >&4
21108 echo "WARNING: The Perl you are building will be quite crippled." >& 4
21112 : Remove libraries needed only for extensions
21113 : The appropriate ext/Foo/Makefile.PL will add them back in, if necessary.
21114 : The exception is SunOS 4.x, which needs them.
21115 case "${osname}X${osvers}" in
21119 *) case "$usedl" in
21120 $define|true|[yY]*)
21121 set X `echo " $libs " | sed -e 's@ -lndbm @ @' -e 's@ -lgdbm @ @' -e 's@ -ldbm @ @' -e 's@ -ldb @ @'`
21125 *) perllibs="$libs"
21131 : Remove build directory name from cppstdin so it can be used from
21132 : either the present location or the final installed location.
21134 : Get out of the UU directory to get correct path name.
21136 case "$cppstdin" in
21138 echo "Stripping down cppstdin path name"
21144 : end of configuration questions
21146 echo "End of configuration questions."
21149 : back to where it started
21150 if test -d ../UU; then
21154 : configuration may be patched via a 'config.arch' file
21155 if $test -f config.arch; then
21156 echo "I see a config.arch file, loading it."
21160 : configuration may be patched via a 'config.over' file
21161 if $test -f config.over; then
21164 rp='I see a config.over file. Do you wish to load it?'
21167 n*) echo "OK, I'll ignore it.";;
21169 echo "Configuration override changes have been loaded."
21174 : in case they want portability, strip down executable paths
21175 case "$d_portable" in
21178 echo "Stripping down executable paths..." >&4
21179 for file in $loclist $trylist; do
21181 eval $file=`basename $temp`
21186 : create config.sh file
21188 echo "Creating config.sh..." >&4
21189 $spitshell <<EOT >config.sh
21192 # This file was produced by running the Configure script. It holds all the
21193 # definitions figured out by Configure. Should you modify one of these values,
21194 # do not forget to propagate your changes by running "Configure -der". You may
21195 # instead choose to run each of the .SH files by yourself, or "Configure -S".
21198 # Package name : $package
21199 # Source directory : $src
21200 # Configuration time: $cf_time
21201 # Configured by : $cf_by
21202 # Target system : $myuname
21212 Revision='$Revision'
21220 alignbytes='$alignbytes'
21221 ansi2knr='$ansi2knr'
21222 aphostname='$aphostname'
21223 api_revision='$api_revision'
21224 api_subversion='$api_subversion'
21225 api_version='$api_version'
21226 api_versionstring='$api_versionstring'
21229 archlibexp='$archlibexp'
21230 archname64='$archname64'
21231 archname='$archname'
21232 archobjs='$archobjs'
21233 asctime_r_proto='$asctime_r_proto'
21241 byteorder='$byteorder'
21243 castflags='$castflags'
21246 cccdlflags='$cccdlflags'
21247 ccdlflags='$ccdlflags'
21249 ccflags_uselargefiles='$ccflags_uselargefiles'
21251 ccsymbols='$ccsymbols'
21252 ccversion='$ccversion'
21254 cf_email='$cf_email'
21256 charsize='$charsize'
21260 clocktype='$clocktype'
21262 compress='$compress'
21263 contains='$contains'
21267 cpp_stuff='$cpp_stuff'
21268 cppccsymbols='$cppccsymbols'
21269 cppflags='$cppflags'
21271 cppminus='$cppminus'
21273 cppstdin='$cppstdin'
21274 cppsymbols='$cppsymbols'
21275 crypt_r_proto='$crypt_r_proto'
21276 cryptlib='$cryptlib'
21278 ctermid_r_proto='$ctermid_r_proto'
21279 ctime_r_proto='$ctime_r_proto'
21280 d_Gconvert='$d_Gconvert'
21281 d_PRIEUldbl='$d_PRIEUldbl'
21282 d_PRIFUldbl='$d_PRIFUldbl'
21283 d_PRIGUldbl='$d_PRIGUldbl'
21284 d_PRIXU64='$d_PRIXU64'
21285 d_PRId64='$d_PRId64'
21286 d_PRIeldbl='$d_PRIeldbl'
21287 d_PRIfldbl='$d_PRIfldbl'
21288 d_PRIgldbl='$d_PRIgldbl'
21289 d_PRIi64='$d_PRIi64'
21290 d_PRIo64='$d_PRIo64'
21291 d_PRIu64='$d_PRIu64'
21292 d_PRIx64='$d_PRIx64'
21293 d_SCNfldbl='$d_SCNfldbl'
21294 d__fwalk='$d__fwalk'
21295 d_access='$d_access'
21296 d_accessx='$d_accessx'
21299 d_archlib='$d_archlib'
21300 d_asctime_r='$d_asctime_r'
21303 d_attribute_format='$d_attribute_format'
21304 d_attribute_malloc='$d_attribute_malloc'
21305 d_attribute_nonnull='$d_attribute_nonnull'
21306 d_attribute_noreturn='$d_attribute_noreturn'
21307 d_attribute_pure='$d_attribute_pure'
21308 d_attribute_unused='$d_attribute_unused'
21309 d_attribute_warn_unused_result='$d_attribute_warn_unused_result'
21313 d_bsdgetpgrp='$d_bsdgetpgrp'
21314 d_bsdsetpgrp='$d_bsdsetpgrp'
21315 d_builtin_choose_expr='$d_builtin_choose_expr'
21316 d_builtin_expect='$d_builtin_expect'
21318 d_c99_variadic_macros='$d_c99_variadic_macros'
21319 d_casti32='$d_casti32'
21320 d_castneg='$d_castneg'
21321 d_charvspr='$d_charvspr'
21323 d_chroot='$d_chroot'
21324 d_chsize='$d_chsize'
21326 d_clearenv='$d_clearenv'
21327 d_closedir='$d_closedir'
21328 d_cmsghdr_s='$d_cmsghdr_s'
21330 d_copysignl='$d_copysignl'
21332 d_crypt_r='$d_crypt_r'
21334 d_ctermid_r='$d_ctermid_r'
21335 d_ctime_r='$d_ctime_r'
21336 d_cuserid='$d_cuserid'
21337 d_dbl_dig='$d_dbl_dig'
21338 d_dbminitproto='$d_dbminitproto'
21339 d_difftime='$d_difftime'
21341 d_dirnamlen='$d_dirnamlen'
21342 d_dlerror='$d_dlerror'
21343 d_dlopen='$d_dlopen'
21344 d_dlsymun='$d_dlsymun'
21345 d_dosuid='$d_dosuid'
21346 d_drand48_r='$d_drand48_r'
21347 d_drand48proto='$d_drand48proto'
21349 d_eaccess='$d_eaccess'
21350 d_endgrent='$d_endgrent'
21351 d_endgrent_r='$d_endgrent_r'
21352 d_endhent='$d_endhent'
21353 d_endhostent_r='$d_endhostent_r'
21354 d_endnent='$d_endnent'
21355 d_endnetent_r='$d_endnetent_r'
21356 d_endpent='$d_endpent'
21357 d_endprotoent_r='$d_endprotoent_r'
21358 d_endpwent='$d_endpwent'
21359 d_endpwent_r='$d_endpwent_r'
21360 d_endsent='$d_endsent'
21361 d_endservent_r='$d_endservent_r'
21362 d_eofnblk='$d_eofnblk'
21363 d_eunice='$d_eunice'
21364 d_faststdio='$d_faststdio'
21365 d_fchdir='$d_fchdir'
21366 d_fchmod='$d_fchmod'
21367 d_fchown='$d_fchown'
21369 d_fcntl_can_lock='$d_fcntl_can_lock'
21370 d_fd_macros='$d_fd_macros'
21371 d_fd_set='$d_fd_set'
21372 d_fds_bits='$d_fds_bits'
21373 d_fgetpos='$d_fgetpos'
21374 d_finite='$d_finite'
21375 d_finitel='$d_finitel'
21376 d_flexfnam='$d_flexfnam'
21378 d_flockproto='$d_flockproto'
21380 d_fp_class='$d_fp_class'
21381 d_fpathconf='$d_fpathconf'
21382 d_fpclass='$d_fpclass'
21383 d_fpclassify='$d_fpclassify'
21384 d_fpclassl='$d_fpclassl'
21385 d_fpos64_t='$d_fpos64_t'
21386 d_frexpl='$d_frexpl'
21387 d_fs_data_s='$d_fs_data_s'
21388 d_fseeko='$d_fseeko'
21389 d_fsetpos='$d_fsetpos'
21390 d_fstatfs='$d_fstatfs'
21391 d_fstatvfs='$d_fstatvfs'
21393 d_ftello='$d_ftello'
21395 d_futimes='$d_futimes'
21396 d_getcwd='$d_getcwd'
21397 d_getespwnam='$d_getespwnam'
21398 d_getfsstat='$d_getfsstat'
21399 d_getgrent='$d_getgrent'
21400 d_getgrent_r='$d_getgrent_r'
21401 d_getgrgid_r='$d_getgrgid_r'
21402 d_getgrnam_r='$d_getgrnam_r'
21403 d_getgrps='$d_getgrps'
21404 d_gethbyaddr='$d_gethbyaddr'
21405 d_gethbyname='$d_gethbyname'
21406 d_gethent='$d_gethent'
21407 d_gethname='$d_gethname'
21408 d_gethostbyaddr_r='$d_gethostbyaddr_r'
21409 d_gethostbyname_r='$d_gethostbyname_r'
21410 d_gethostent_r='$d_gethostent_r'
21411 d_gethostprotos='$d_gethostprotos'
21412 d_getitimer='$d_getitimer'
21413 d_getlogin='$d_getlogin'
21414 d_getlogin_r='$d_getlogin_r'
21415 d_getmnt='$d_getmnt'
21416 d_getmntent='$d_getmntent'
21417 d_getnbyaddr='$d_getnbyaddr'
21418 d_getnbyname='$d_getnbyname'
21419 d_getnent='$d_getnent'
21420 d_getnetbyaddr_r='$d_getnetbyaddr_r'
21421 d_getnetbyname_r='$d_getnetbyname_r'
21422 d_getnetent_r='$d_getnetent_r'
21423 d_getnetprotos='$d_getnetprotos'
21424 d_getpagsz='$d_getpagsz'
21425 d_getpbyname='$d_getpbyname'
21426 d_getpbynumber='$d_getpbynumber'
21427 d_getpent='$d_getpent'
21428 d_getpgid='$d_getpgid'
21429 d_getpgrp2='$d_getpgrp2'
21430 d_getpgrp='$d_getpgrp'
21431 d_getppid='$d_getppid'
21432 d_getprior='$d_getprior'
21433 d_getprotobyname_r='$d_getprotobyname_r'
21434 d_getprotobynumber_r='$d_getprotobynumber_r'
21435 d_getprotoent_r='$d_getprotoent_r'
21436 d_getprotoprotos='$d_getprotoprotos'
21437 d_getprpwnam='$d_getprpwnam'
21438 d_getpwent='$d_getpwent'
21439 d_getpwent_r='$d_getpwent_r'
21440 d_getpwnam_r='$d_getpwnam_r'
21441 d_getpwuid_r='$d_getpwuid_r'
21442 d_getsbyname='$d_getsbyname'
21443 d_getsbyport='$d_getsbyport'
21444 d_getsent='$d_getsent'
21445 d_getservbyname_r='$d_getservbyname_r'
21446 d_getservbyport_r='$d_getservbyport_r'
21447 d_getservent_r='$d_getservent_r'
21448 d_getservprotos='$d_getservprotos'
21449 d_getspnam='$d_getspnam'
21450 d_getspnam_r='$d_getspnam_r'
21451 d_gettimeod='$d_gettimeod'
21452 d_gmtime_r='$d_gmtime_r'
21453 d_gnulibc='$d_gnulibc'
21454 d_grpasswd='$d_grpasswd'
21455 d_hasmntopt='$d_hasmntopt'
21457 d_ilogbl='$d_ilogbl'
21458 d_inc_version_list='$d_inc_version_list'
21460 d_inetaton='$d_inetaton'
21461 d_int64_t='$d_int64_t'
21462 d_isascii='$d_isascii'
21463 d_isfinite='$d_isfinite'
21466 d_isnanl='$d_isnanl'
21467 d_killpg='$d_killpg'
21468 d_lchown='$d_lchown'
21469 d_ldbl_dig='$d_ldbl_dig'
21470 d_libm_lib_version='$d_libm_lib_version'
21472 d_localtime_r='$d_localtime_r'
21473 d_locconv='$d_locconv'
21475 d_longdbl='$d_longdbl'
21476 d_longlong='$d_longlong'
21477 d_lseekproto='$d_lseekproto'
21479 d_madvise='$d_madvise'
21480 d_malloc_good_size='$d_malloc_good_size'
21481 d_malloc_size='$d_malloc_size'
21483 d_mbstowcs='$d_mbstowcs'
21484 d_mbtowc='$d_mbtowc'
21485 d_memchr='$d_memchr'
21486 d_memcmp='$d_memcmp'
21487 d_memcpy='$d_memcpy'
21488 d_memmove='$d_memmove'
21489 d_memset='$d_memset'
21491 d_mkdtemp='$d_mkdtemp'
21492 d_mkfifo='$d_mkfifo'
21493 d_mkstemp='$d_mkstemp'
21494 d_mkstemps='$d_mkstemps'
21495 d_mktime='$d_mktime'
21498 d_modfl_pow32_bug='$d_modfl_pow32_bug'
21499 d_modflproto='$d_modflproto'
21500 d_mprotect='$d_mprotect'
21502 d_msg_ctrunc='$d_msg_ctrunc'
21503 d_msg_dontroute='$d_msg_dontroute'
21504 d_msg_oob='$d_msg_oob'
21505 d_msg_peek='$d_msg_peek'
21506 d_msg_proxy='$d_msg_proxy'
21507 d_msgctl='$d_msgctl'
21508 d_msgget='$d_msgget'
21509 d_msghdr_s='$d_msghdr_s'
21510 d_msgrcv='$d_msgrcv'
21511 d_msgsnd='$d_msgsnd'
21513 d_munmap='$d_munmap'
21514 d_mymalloc='$d_mymalloc'
21516 d_nl_langinfo='$d_nl_langinfo'
21517 d_nv_preserves_uv='$d_nv_preserves_uv'
21518 d_nv_zero_is_allbits_zero='$d_nv_zero_is_allbits_zero'
21519 d_off64_t='$d_off64_t'
21520 d_old_pthread_create_joinable='$d_old_pthread_create_joinable'
21521 d_oldpthreads='$d_oldpthreads'
21522 d_oldsock='$d_oldsock'
21524 d_pathconf='$d_pathconf'
21526 d_perl_otherlibdirs='$d_perl_otherlibdirs'
21527 d_phostname='$d_phostname'
21530 d_portable='$d_portable'
21531 d_procselfexe='$d_procselfexe'
21532 d_pthread_atfork='$d_pthread_atfork'
21533 d_pthread_attr_setscope='$d_pthread_attr_setscope'
21534 d_pthread_yield='$d_pthread_yield'
21536 d_pwchange='$d_pwchange'
21537 d_pwclass='$d_pwclass'
21538 d_pwcomment='$d_pwcomment'
21539 d_pwexpire='$d_pwexpire'
21540 d_pwgecos='$d_pwgecos'
21541 d_pwpasswd='$d_pwpasswd'
21542 d_pwquota='$d_pwquota'
21545 d_random_r='$d_random_r'
21546 d_readdir64_r='$d_readdir64_r'
21547 d_readdir='$d_readdir'
21548 d_readdir_r='$d_readdir_r'
21549 d_readlink='$d_readlink'
21551 d_recvmsg='$d_recvmsg'
21552 d_rename='$d_rename'
21553 d_rewinddir='$d_rewinddir'
21555 d_safebcpy='$d_safebcpy'
21556 d_safemcpy='$d_safemcpy'
21557 d_sanemcmp='$d_sanemcmp'
21558 d_sbrkproto='$d_sbrkproto'
21559 d_scalbnl='$d_scalbnl'
21560 d_sched_yield='$d_sched_yield'
21561 d_scm_rights='$d_scm_rights'
21562 d_seekdir='$d_seekdir'
21563 d_select='$d_select'
21565 d_semctl='$d_semctl'
21566 d_semctl_semid_ds='$d_semctl_semid_ds'
21567 d_semctl_semun='$d_semctl_semun'
21568 d_semget='$d_semget'
21570 d_sendmsg='$d_sendmsg'
21571 d_setegid='$d_setegid'
21572 d_seteuid='$d_seteuid'
21573 d_setgrent='$d_setgrent'
21574 d_setgrent_r='$d_setgrent_r'
21575 d_setgrps='$d_setgrps'
21576 d_sethent='$d_sethent'
21577 d_sethostent_r='$d_sethostent_r'
21578 d_setitimer='$d_setitimer'
21579 d_setlinebuf='$d_setlinebuf'
21580 d_setlocale='$d_setlocale'
21581 d_setlocale_r='$d_setlocale_r'
21582 d_setnent='$d_setnent'
21583 d_setnetent_r='$d_setnetent_r'
21584 d_setpent='$d_setpent'
21585 d_setpgid='$d_setpgid'
21586 d_setpgrp2='$d_setpgrp2'
21587 d_setpgrp='$d_setpgrp'
21588 d_setprior='$d_setprior'
21589 d_setproctitle='$d_setproctitle'
21590 d_setprotoent_r='$d_setprotoent_r'
21591 d_setpwent='$d_setpwent'
21592 d_setpwent_r='$d_setpwent_r'
21593 d_setregid='$d_setregid'
21594 d_setresgid='$d_setresgid'
21595 d_setresuid='$d_setresuid'
21596 d_setreuid='$d_setreuid'
21597 d_setrgid='$d_setrgid'
21598 d_setruid='$d_setruid'
21599 d_setsent='$d_setsent'
21600 d_setservent_r='$d_setservent_r'
21601 d_setsid='$d_setsid'
21602 d_setvbuf='$d_setvbuf'
21606 d_shmatprototype='$d_shmatprototype'
21607 d_shmctl='$d_shmctl'
21609 d_shmget='$d_shmget'
21610 d_sigaction='$d_sigaction'
21611 d_sigprocmask='$d_sigprocmask'
21612 d_sigsetjmp='$d_sigsetjmp'
21613 d_sitearch='$d_sitearch'
21614 d_snprintf='$d_snprintf'
21615 d_sockatmark='$d_sockatmark'
21616 d_sockatmarkproto='$d_sockatmarkproto'
21617 d_socket='$d_socket'
21618 d_socklen_t='$d_socklen_t'
21619 d_sockpair='$d_sockpair'
21620 d_socks5_init='$d_socks5_init'
21621 d_sprintf_returns_strlen='$d_sprintf_returns_strlen'
21623 d_srand48_r='$d_srand48_r'
21624 d_srandom_r='$d_srandom_r'
21625 d_sresgproto='$d_sresgproto'
21626 d_sresuproto='$d_sresuproto'
21627 d_statblks='$d_statblks'
21628 d_statfs_f_flags='$d_statfs_f_flags'
21629 d_statfs_s='$d_statfs_s'
21630 d_statvfs='$d_statvfs'
21631 d_stdio_cnt_lval='$d_stdio_cnt_lval'
21632 d_stdio_ptr_lval='$d_stdio_ptr_lval'
21633 d_stdio_ptr_lval_nochange_cnt='$d_stdio_ptr_lval_nochange_cnt'
21634 d_stdio_ptr_lval_sets_cnt='$d_stdio_ptr_lval_sets_cnt'
21635 d_stdio_stream_array='$d_stdio_stream_array'
21636 d_stdiobase='$d_stdiobase'
21637 d_stdstdio='$d_stdstdio'
21638 d_strchr='$d_strchr'
21639 d_strcoll='$d_strcoll'
21640 d_strctcpy='$d_strctcpy'
21641 d_strerrm='$d_strerrm'
21642 d_strerror='$d_strerror'
21643 d_strerror_r='$d_strerror_r'
21644 d_strftime='$d_strftime'
21645 d_strlcat='$d_strlcat'
21646 d_strlcpy='$d_strlcpy'
21647 d_strtod='$d_strtod'
21648 d_strtol='$d_strtol'
21649 d_strtold='$d_strtold'
21650 d_strtoll='$d_strtoll'
21651 d_strtoq='$d_strtoq'
21652 d_strtoul='$d_strtoul'
21653 d_strtoull='$d_strtoull'
21654 d_strtouq='$d_strtouq'
21655 d_strxfrm='$d_strxfrm'
21656 d_suidsafe='$d_suidsafe'
21657 d_symlink='$d_symlink'
21658 d_syscall='$d_syscall'
21659 d_syscallproto='$d_syscallproto'
21660 d_sysconf='$d_sysconf'
21661 d_sysernlst='$d_sysernlst'
21662 d_syserrlst='$d_syserrlst'
21663 d_system='$d_system'
21664 d_tcgetpgrp='$d_tcgetpgrp'
21665 d_tcsetpgrp='$d_tcsetpgrp'
21666 d_telldir='$d_telldir'
21667 d_telldirproto='$d_telldirproto'
21670 d_tm_tm_gmtoff='$d_tm_tm_gmtoff'
21671 d_tm_tm_zone='$d_tm_tm_zone'
21672 d_tmpnam_r='$d_tmpnam_r'
21673 d_truncate='$d_truncate'
21674 d_ttyname_r='$d_ttyname_r'
21675 d_tzname='$d_tzname'
21676 d_u32align='$d_u32align'
21677 d_ualarm='$d_ualarm'
21680 d_union_semun='$d_union_semun'
21681 d_unordered='$d_unordered'
21682 d_unsetenv='$d_unsetenv'
21683 d_usleep='$d_usleep'
21684 d_usleepproto='$d_usleepproto'
21686 d_vendorarch='$d_vendorarch'
21687 d_vendorbin='$d_vendorbin'
21688 d_vendorlib='$d_vendorlib'
21689 d_vendorscript='$d_vendorscript'
21691 d_void_closedir='$d_void_closedir'
21692 d_voidsig='$d_voidsig'
21693 d_voidtty='$d_voidtty'
21694 d_volatile='$d_volatile'
21695 d_vprintf='$d_vprintf'
21696 d_vsnprintf='$d_vsnprintf'
21698 d_waitpid='$d_waitpid'
21699 d_wcstombs='$d_wcstombs'
21700 d_wctomb='$d_wctomb'
21701 d_writev='$d_writev'
21704 db_hashtype='$db_hashtype'
21705 db_prefixtype='$db_prefixtype'
21706 db_version_major='$db_version_major'
21707 db_version_minor='$db_version_minor'
21708 db_version_patch='$db_version_patch'
21709 defvoidused='$defvoidused'
21710 direntrytype='$direntrytype'
21713 doublesize='$doublesize'
21715 drand48_r_proto='$drand48_r_proto'
21716 dynamic_ext='$dynamic_ext'
21722 endgrent_r_proto='$endgrent_r_proto'
21723 endhostent_r_proto='$endhostent_r_proto'
21724 endnetent_r_proto='$endnetent_r_proto'
21725 endprotoent_r_proto='$endprotoent_r_proto'
21726 endpwent_r_proto='$endpwent_r_proto'
21727 endservent_r_proto='$endservent_r_proto'
21728 eunicefix='$eunicefix'
21731 extensions='$extensions'
21733 fflushNULL='$fflushNULL'
21734 fflushall='$fflushall'
21736 firstmakefile='$firstmakefile'
21738 fpossize='$fpossize'
21739 fpostype='$fpostype'
21740 freetype='$freetype'
21743 full_csh='$full_csh'
21744 full_sed='$full_sed'
21745 gccansipedantic='$gccansipedantic'
21746 gccosandvers='$gccosandvers'
21747 gccversion='$gccversion'
21748 getgrent_r_proto='$getgrent_r_proto'
21749 getgrgid_r_proto='$getgrgid_r_proto'
21750 getgrnam_r_proto='$getgrnam_r_proto'
21751 gethostbyaddr_r_proto='$gethostbyaddr_r_proto'
21752 gethostbyname_r_proto='$gethostbyname_r_proto'
21753 gethostent_r_proto='$gethostent_r_proto'
21754 getlogin_r_proto='$getlogin_r_proto'
21755 getnetbyaddr_r_proto='$getnetbyaddr_r_proto'
21756 getnetbyname_r_proto='$getnetbyname_r_proto'
21757 getnetent_r_proto='$getnetent_r_proto'
21758 getprotobyname_r_proto='$getprotobyname_r_proto'
21759 getprotobynumber_r_proto='$getprotobynumber_r_proto'
21760 getprotoent_r_proto='$getprotoent_r_proto'
21761 getpwent_r_proto='$getpwent_r_proto'
21762 getpwnam_r_proto='$getpwnam_r_proto'
21763 getpwuid_r_proto='$getpwuid_r_proto'
21764 getservbyname_r_proto='$getservbyname_r_proto'
21765 getservbyport_r_proto='$getservbyport_r_proto'
21766 getservent_r_proto='$getservent_r_proto'
21767 getspnam_r_proto='$getspnam_r_proto'
21768 gidformat='$gidformat'
21774 gmtime_r_proto='$gmtime_r_proto'
21775 gnulibc_version='$gnulibc_version'
21777 groupcat='$groupcat'
21778 groupstype='$groupstype'
21781 h_sysfile='$h_sysfile'
21784 html1dir='$html1dir'
21785 html1direxp='$html1direxp'
21786 html3dir='$html3dir'
21787 html3direxp='$html3direxp'
21796 i_arpainet='$i_arpainet'
21797 i_bsdioctl='$i_bsdioctl'
21801 i_dirent='$i_dirent'
21807 i_fp_class='$i_fp_class'
21810 i_ieeefp='$i_ieeefp'
21811 i_inttypes='$i_inttypes'
21812 i_langinfo='$i_langinfo'
21813 i_libutil='$i_libutil'
21814 i_limits='$i_limits'
21815 i_locale='$i_locale'
21816 i_machcthr='$i_machcthr'
21817 i_malloc='$i_malloc'
21819 i_memory='$i_memory'
21820 i_mntent='$i_mntent'
21823 i_neterrno='$i_neterrno'
21824 i_netinettcp='$i_netinettcp'
21828 i_pthread='$i_pthread'
21830 i_rpcsvcdbm='$i_rpcsvcdbm'
21833 i_shadow='$i_shadow'
21835 i_stdarg='$i_stdarg'
21836 i_stddef='$i_stddef'
21837 i_stdlib='$i_stdlib'
21838 i_string='$i_string'
21839 i_sunmath='$i_sunmath'
21840 i_sysaccess='$i_sysaccess'
21841 i_sysdir='$i_sysdir'
21842 i_sysfile='$i_sysfile'
21843 i_sysfilio='$i_sysfilio'
21845 i_sysioctl='$i_sysioctl'
21846 i_syslog='$i_syslog'
21847 i_sysmman='$i_sysmman'
21848 i_sysmode='$i_sysmode'
21849 i_sysmount='$i_sysmount'
21850 i_sysndir='$i_sysndir'
21851 i_sysparam='$i_sysparam'
21852 i_sysresrc='$i_sysresrc'
21853 i_syssecrt='$i_syssecrt'
21854 i_sysselct='$i_sysselct'
21855 i_syssockio='$i_syssockio'
21856 i_sysstat='$i_sysstat'
21857 i_sysstatfs='$i_sysstatfs'
21858 i_sysstatvfs='$i_sysstatvfs'
21859 i_systime='$i_systime'
21860 i_systimek='$i_systimek'
21861 i_systimes='$i_systimes'
21862 i_systypes='$i_systypes'
21863 i_sysuio='$i_sysuio'
21865 i_sysutsname='$i_sysutsname'
21866 i_sysvfs='$i_sysvfs'
21867 i_syswait='$i_syswait'
21868 i_termio='$i_termio'
21869 i_termios='$i_termios'
21871 i_unistd='$i_unistd'
21874 i_values='$i_values'
21875 i_varargs='$i_varargs'
21876 i_varhdr='$i_varhdr'
21878 ignore_versioned_solibs='$ignore_versioned_solibs'
21879 inc_version_list='$inc_version_list'
21880 inc_version_list_init='$inc_version_list_init'
21883 initialinstalllocation='$initialinstalllocation'
21884 installarchlib='$installarchlib'
21885 installbin='$installbin'
21886 installhtml1dir='$installhtml1dir'
21887 installhtml3dir='$installhtml3dir'
21888 installman1dir='$installman1dir'
21889 installman3dir='$installman3dir'
21890 installprefix='$installprefix'
21891 installprefixexp='$installprefixexp'
21892 installprivlib='$installprivlib'
21893 installscript='$installscript'
21894 installsitearch='$installsitearch'
21895 installsitebin='$installsitebin'
21896 installsitehtml1dir='$installsitehtml1dir'
21897 installsitehtml3dir='$installsitehtml3dir'
21898 installsitelib='$installsitelib'
21899 installsiteman1dir='$installsiteman1dir'
21900 installsiteman3dir='$installsiteman3dir'
21901 installsitescript='$installsitescript'
21902 installstyle='$installstyle'
21903 installusrbinperl='$installusrbinperl'
21904 installvendorarch='$installvendorarch'
21905 installvendorbin='$installvendorbin'
21906 installvendorhtml1dir='$installvendorhtml1dir'
21907 installvendorhtml3dir='$installvendorhtml3dir'
21908 installvendorlib='$installvendorlib'
21909 installvendorman1dir='$installvendorman1dir'
21910 installvendorman3dir='$installvendorman3dir'
21911 installvendorscript='$installvendorscript'
21913 issymlink='$issymlink'
21914 ivdformat='$ivdformat'
21917 known_extensions='$known_extensions'
21920 lddlflags='$lddlflags'
21922 ldflags_uselargefiles='$ldflags_uselargefiles'
21923 ldlibpthname='$ldlibpthname'
21930 libsdirs='$libsdirs'
21931 libsfiles='$libsfiles'
21932 libsfound='$libsfound'
21933 libspath='$libspath'
21934 libswanted='$libswanted'
21935 libswanted_uselargefiles='$libswanted_uselargefiles'
21941 localtime_r_proto='$localtime_r_proto'
21942 locincpth='$locincpth'
21943 loclibpth='$loclibpth'
21944 longdblsize='$longdblsize'
21945 longlongsize='$longlongsize'
21946 longsize='$longsize'
21950 lseeksize='$lseeksize'
21951 lseektype='$lseektype'
21954 madlyobj='$madlyobj'
21955 madlysrc='$madlysrc'
21959 make_set_make='$make_set_make'
21960 mallocobj='$mallocobj'
21961 mallocsrc='$mallocsrc'
21962 malloctype='$malloctype'
21964 man1direxp='$man1direxp'
21967 man3direxp='$man3direxp'
21969 mips_type='$mips_type'
21970 mistrustnm='$mistrustnm'
21972 mmaptype='$mmaptype'
21973 modetype='$modetype'
21975 multiarch='$multiarch'
21977 myarchname='$myarchname'
21978 mydomain='$mydomain'
21979 myhostname='$myhostname'
21982 need_va_copy='$need_va_copy'
21983 netdb_hlen_type='$netdb_hlen_type'
21984 netdb_host_type='$netdb_host_type'
21985 netdb_name_type='$netdb_name_type'
21986 netdb_net_type='$netdb_net_type'
21989 nm_so_opt='$nm_so_opt'
21990 nonxs_ext='$nonxs_ext'
21992 nvEUformat='$nvEUformat'
21993 nvFUformat='$nvFUformat'
21994 nvGUformat='$nvGUformat'
21995 nv_preserves_uv_bits='$nv_preserves_uv_bits'
21996 nveformat='$nveformat'
21997 nvfformat='$nvfformat'
21998 nvgformat='$nvgformat'
22001 o_nonblock='$o_nonblock'
22003 old_pthread_create_joinable='$old_pthread_create_joinable'
22004 optimize='$optimize'
22005 orderlib='$orderlib'
22008 otherlibdirs='$otherlibdirs'
22012 patchlevel='$patchlevel'
22013 path_sep='$path_sep'
22016 perl_patchlevel='$perl_patchlevel'
22017 perladmin='$perladmin'
22018 perllibs='$perllibs'
22019 perlpath='$perlpath'
22021 phostname='$phostname'
22027 prefixexp='$prefixexp'
22029 privlibexp='$privlibexp'
22030 procselfexe='$procselfexe'
22031 prototype='$prototype'
22033 quadkind='$quadkind'
22034 quadtype='$quadtype'
22035 randbits='$randbits'
22036 randfunc='$randfunc'
22037 random_r_proto='$random_r_proto'
22038 randseedtype='$randseedtype'
22040 rd_nodata='$rd_nodata'
22041 readdir64_r_proto='$readdir64_r_proto'
22042 readdir_r_proto='$readdir_r_proto'
22043 revision='$revision'
22048 sPRIEUldbl='$sPRIEUldbl'
22049 sPRIFUldbl='$sPRIFUldbl'
22050 sPRIGUldbl='$sPRIGUldbl'
22051 sPRIXU64='$sPRIXU64'
22053 sPRIeldbl='$sPRIeldbl'
22054 sPRIfldbl='$sPRIfldbl'
22055 sPRIgldbl='$sPRIgldbl'
22060 sSCNfldbl='$sSCNfldbl'
22061 sched_yield='$sched_yield'
22062 scriptdir='$scriptdir'
22063 scriptdirexp='$scriptdirexp'
22065 seedfunc='$seedfunc'
22066 selectminbits='$selectminbits'
22067 selecttype='$selecttype'
22068 sendmail='$sendmail'
22069 setgrent_r_proto='$setgrent_r_proto'
22070 sethostent_r_proto='$sethostent_r_proto'
22071 setlocale_r_proto='$setlocale_r_proto'
22072 setnetent_r_proto='$setnetent_r_proto'
22073 setprotoent_r_proto='$setprotoent_r_proto'
22074 setpwent_r_proto='$setpwent_r_proto'
22075 setservent_r_proto='$setservent_r_proto'
22078 sharpbang='$sharpbang'
22079 shmattype='$shmattype'
22080 shortsize='$shortsize'
22083 sig_count='$sig_count'
22084 sig_name='$sig_name'
22085 sig_name_init='$sig_name_init'
22087 sig_num_init='$sig_num_init'
22088 sig_size='$sig_size'
22089 signal_t='$signal_t'
22090 sitearch='$sitearch'
22091 sitearchexp='$sitearchexp'
22093 sitebinexp='$sitebinexp'
22094 sitehtml1dir='$sitehtml1dir'
22095 sitehtml1direxp='$sitehtml1direxp'
22096 sitehtml3dir='$sitehtml3dir'
22097 sitehtml3direxp='$sitehtml3direxp'
22099 sitelib_stem='$sitelib_stem'
22100 sitelibexp='$sitelibexp'
22101 siteman1dir='$siteman1dir'
22102 siteman1direxp='$siteman1direxp'
22103 siteman3dir='$siteman3dir'
22104 siteman3direxp='$siteman3direxp'
22105 siteprefix='$siteprefix'
22106 siteprefixexp='$siteprefixexp'
22107 sitescript='$sitescript'
22108 sitescriptexp='$sitescriptexp'
22109 sizesize='$sizesize'
22110 sizetype='$sizetype'
22114 sockethdr='$sockethdr'
22115 socketlib='$socketlib'
22116 socksizetype='$socksizetype'
22118 spackage='$spackage'
22119 spitshell='$spitshell'
22120 srand48_r_proto='$srand48_r_proto'
22121 srandom_r_proto='$srandom_r_proto'
22123 ssizetype='$ssizetype'
22124 startperl='$startperl'
22126 static_ext='$static_ext'
22128 stdio_base='$stdio_base'
22129 stdio_bufsiz='$stdio_bufsiz'
22130 stdio_cnt='$stdio_cnt'
22131 stdio_filbuf='$stdio_filbuf'
22132 stdio_ptr='$stdio_ptr'
22133 stdio_stream_array='$stdio_stream_array'
22134 strerror_r_proto='$strerror_r_proto'
22137 subversion='$subversion'
22141 targetarch='$targetarch'
22145 timeincl='$timeincl'
22146 timetype='$timetype'
22147 tmpnam_r_proto='$tmpnam_r_proto'
22153 ttyname_r_proto='$ttyname_r_proto'
22162 uidformat='$uidformat'
22168 uquadtype='$uquadtype'
22169 use5005threads='$use5005threads'
22170 use64bitall='$use64bitall'
22171 use64bitint='$use64bitint'
22172 usecrosscompile='$usecrosscompile'
22174 usefaststdio='$usefaststdio'
22175 useithreads='$useithreads'
22176 uselargefiles='$uselargefiles'
22177 uselongdouble='$uselongdouble'
22178 usemallocwrap='$usemallocwrap'
22179 usemorebits='$usemorebits'
22180 usemultiplicity='$usemultiplicity'
22181 usemymalloc='$usemymalloc'
22183 useopcode='$useopcode'
22184 useperlio='$useperlio'
22185 useposix='$useposix'
22186 usereentrant='$usereentrant'
22187 userelocatableinc='$userelocatableinc'
22189 useshrplib='$useshrplib'
22190 usesitecustomize='$usesitecustomize'
22191 usesocks='$usesocks'
22192 usethreads='$usethreads'
22193 usevendorprefix='$usevendorprefix'
22194 usevfork='$usevfork'
22197 uvXUformat='$uvXUformat'
22198 uvoformat='$uvoformat'
22201 uvuformat='$uvuformat'
22202 uvxformat='$uvxformat'
22203 vendorarch='$vendorarch'
22204 vendorarchexp='$vendorarchexp'
22205 vendorbin='$vendorbin'
22206 vendorbinexp='$vendorbinexp'
22207 vendorhtml1dir='$vendorhtml1dir'
22208 vendorhtml1direxp='$vendorhtml1direxp'
22209 vendorhtml3dir='$vendorhtml3dir'
22210 vendorhtml3direxp='$vendorhtml3direxp'
22211 vendorlib='$vendorlib'
22212 vendorlib_stem='$vendorlib_stem'
22213 vendorlibexp='$vendorlibexp'
22214 vendorman1dir='$vendorman1dir'
22215 vendorman1direxp='$vendorman1direxp'
22216 vendorman3dir='$vendorman3dir'
22217 vendorman3direxp='$vendorman3direxp'
22218 vendorprefix='$vendorprefix'
22219 vendorprefixexp='$vendorprefixexp'
22220 vendorscript='$vendorscript'
22221 vendorscriptexp='$vendorscriptexp'
22223 version_patchlevel_string='$version_patchlevel_string'
22224 versiononly='$versiononly'
22226 voidflags='$voidflags'
22229 yaccflags='$yaccflags'
22234 : Add in command line options if available
22235 $test -f UU/cmdline.opt && $cat UU/cmdline.opt >> config.sh
22237 : add special variables
22238 $test -f $src/patchlevel.h && \
22239 awk '/^#define[ ]+PERL_/ {printf "%s=%s\n",$2,$3}' $src/patchlevel.h >>config.sh
22240 echo "PERL_PATCHLEVEL=$perl_patchlevel" >>config.sh
22241 echo "PERL_CONFIG_SH=true" >>config.sh
22243 : propagate old symbols
22244 if $test -f UU/config.sh; then
22245 <UU/config.sh $sort | $uniq >UU/oldconfig.sh
22246 sed -n 's/^\([a-zA-Z_0-9]*\)=.*/\1/p' config.sh config.sh UU/oldconfig.sh |\
22247 $sort | $uniq -u >UU/oldsyms
22248 set X `cat UU/oldsyms`
22254 Hmm...You had some extra variables I don't know about...I'll try to keep 'em...
22256 echo "# Variables propagated from previous config.sh file." >>config.sh
22257 for sym in `cat UU/oldsyms`; do
22258 echo " Propagating $hint variable "'$'"$sym..."
22259 eval 'tmp="$'"${sym}"'"'
22261 sed -e "s/'/'\"'\"'/g" -e "s/^/$sym='/" -e "s/$/'/" >>config.sh
22267 : Finish up by extracting the .SH files
22271 echo "Extraction done."
22281 If you'd like to make any changes to the config.sh file before I begin
22282 to configure things, do it as a shell escape now (e.g. !vi config.sh).
22285 rp="Press return or use a shell escape to edit config.sh:"
22290 *) : in case they cannot read
22291 sh 1>&4 -c "$ans";;
22296 : if this fails, just run all the .SH files by hand
22305 if $contains '^depend:' [Mm]akefile >/dev/null 2>&1; then
22312 Now you need to generate make dependencies by running "$make depend".
22313 You might prefer to run it in background: "$make depend > makedepend.out &"
22314 It can take a while, so you might not want to run it right now.
22319 rp="Run $make depend now?"
22323 $make depend && echo "Now you must run '$make'."
22326 echo "You must run '$make depend' then '$make'."
22329 elif test -f [Mm]akefile; then
22331 echo "Now you must run a $make."
22333 echo "Configure done."
22336 if $test -f Policy.sh; then
22339 If you compile $package on a different machine or from a different object
22340 directory, copy the Policy.sh file from this object directory to the
22341 new one before you run Configure -- this will help you with most of
22342 the policy defaults.
22346 if $test -f config.msg; then
22347 echo "Hmm. I also noted the following information while running:"
22349 $cat config.msg >&4
22352 $rm -f kit*isdone ark*isdone