3 # If these # comments don't work, trim them. Don't worry about any other
4 # shell scripts, Configure will trim # comments from them for you.
6 # (If you are trying to port this package to a machine without sh,
7 # I would suggest you have a look at the prototypical config_h.SH file
8 # and edit it to reflect your system. Some packages may include samples
9 # of config.h for certain machines, so you might look for one of those.)
11 # Yes, you may rip this off to use in other distribution packages. This
12 # script belongs to the public domain and cannot be copyrighted.
14 # (Note: this Configure script was generated automatically. Rather than
15 # working with this copy of Configure, you may wish to get metaconfig.
16 # The dist-3.0 package (which contains metaconfig) was posted in
17 # comp.sources.misc and is available on CPAN under authors/id/RAM so
18 # you may fetch it yourself from your nearest archive site.)
21 # Though this script was generated by metaconfig, it is OK to send
22 # patches against it. It's up to the Configure pumpkin to backport
23 # the patch to the metaunits if it is accepted.
24 # See Porting/pumpkin.pod for more information on metaconfig.
27 # $Id: Head.U,v 3.0.1.9 1997/02/28 15:02:09 ram Exp $
29 # Generated on Mon Apr 17 14:14:39 CEST 2006 [metaconfig 3.0 PL70]
30 # (with additional metaconfig patches by perlbug@perl.org)
35 SCO csh still thinks true is false. Write to SCO today and tell them that next
36 year Configure ought to "rm /bin/csh" unless they fix their blasted shell. :-)
38 (Actually, Configure ought to just patch csh in place. Hmm. Hmmmmm. All
39 we'd have to do is go in and swap the && and || tokens, wherever they are.)
41 [End of diatribe. We now return you to your regularly scheduled programming...]
45 OOPS! You naughty creature! You didn't run Configure with sh!
46 I will attempt to remedy the situation by running sh for you...
50 true || exec sh $0 $argv:q
52 (exit $?0) || cat c2$$
53 (exit $?0) || exec sh $0 $argv:q
56 if test -f /dev/cputype -a -f /dev/drivers -a -f /dev/osversion; then
59 *** I'm sorry but this system looks like Plan 9 and Plan 9 doesn't do
60 *** Configure that well. (Plan 9 is close to UNIX but not close enough.)
61 *** Please read the README.plan9 for further instructions.
62 *** Cannot continue, aborting.
68 : compute my invocation name
72 me=`echo $0 | sed -e 's!.*/\(.*\)!\1!' 2>/dev/null`
77 : Proper separator for the PATH environment variable
79 : On OS/2 this directory should exist if this is not floppy only system :-]
80 if test -d c:/. || ( uname -a | grep -i 'os\(/\|\)2' ) 2>&1 >/dev/null ; then
81 if test -n "$OS2_SHELL"; then
83 PATH=`cmd /c "echo %PATH%" | tr '\\\\' / `
84 OS2_SHELL=`cmd /c "echo %OS2_SHELL%" | tr '\\\\' / | tr '[A-Z]' '[a-z]'`
86 elif test -n "$DJGPP"; then
87 case "X${MACHTYPE:-nonesuchmach}" in
95 paths='/bin /usr/bin /usr/local/bin /usr/ucb /usr/local /usr/lbin'
96 paths="$paths /opt/bin /opt/local/bin /opt/local /opt/lbin"
97 paths="$paths /usr/5bin /etc /usr/gnu/bin /usr/new /usr/new/bin /usr/nbin"
98 paths="$paths /opt/gnu/bin /opt/new /opt/new/bin /opt/nbin"
99 paths="$paths /sys5.3/bin /sys5.3/usr/bin /bsd4.3/bin /bsd4.3/usr/ucb"
100 paths="$paths /bsd4.3/usr/bin /usr/bsd /bsd43/bin /opt/ansic/bin /usr/ccs/bin"
101 paths="$paths /etc /usr/lib /usr/ucblib /lib /usr/ccs/lib"
102 paths="$paths /sbin /usr/sbin /usr/libexec"
103 paths="$paths /system/gnu_library/bin"
107 case "$p_$PATH$p_" in
109 *) test -d $p && PATH=$PATH$p_$p ;;
116 : shall we be using ksh?
122 if (PATH=.; alias -x) >/dev/null 2>&1; then
125 if test -f /hp-ux -a -f /bin/ksh; then
126 needksh='to avoid sh bug in "here document" expansion'
128 if test -d /usr/lpp -a -f /usr/bin/bsh -a -f /usr/bin/uname; then
129 if test X`/usr/bin/uname -v` = X4; then
130 avoidksh="to avoid AIX 4's /bin/sh"
134 if test -f /osf_boot -a -f /usr/sbin/setld; then
135 if test X`/usr/bin/uname -s` = XOSF1; then
136 avoidksh="to avoid Digital UNIX' ksh"
138 unset BIN_SH # if this is 'xpg4' sh will start up ksh
141 case "$inksh/$needksh" in
148 case "$inksh/$avoidksh" in
154 case "$inksh/$needksh-$avoidksh-" in
157 (I see you are using the Korn shell. Some ksh's blow up on $me,
158 mainly on older exotic systems. If yours does, try the Bourne shell instead.)
165 echo "(Feeding myself to $newsh $reason.)"
167 Configure|*/Configure) exec $newsh $0 "$@";;
168 *) exec $newsh Configure "$@";;
173 : if needed set CDPATH to a harmless value that is not chatty
174 : avoid bash 2.02 problems with empty CDPATH.
178 *bash*) CDPATH='.' ;;
183 : Configure runs within the UU subdirectory
184 test -d UU || mkdir UU
322 initialinstalllocation=''
350 d_attribute_format=''
351 d_attribute_malloc=''
352 d_attribute_nonnull=''
353 d_attribute_noreturn=''
355 d_attribute_unused=''
356 d_attribute_warn_unused_result=''
359 d_builtin_choose_expr=''
405 endhostent_r_proto=''
411 endprotoent_r_proto=''
417 endservent_r_proto=''
469 gethostbyaddr_r_proto=''
471 gethostbyname_r_proto=''
473 gethostent_r_proto=''
485 getnetbyaddr_r_proto=''
487 getnetbyname_r_proto=''
501 d_getprotobyname_r=''
502 getprotobyname_r_proto=''
503 d_getprotobynumber_r=''
504 getprotobynumber_r_proto=''
506 getprotoent_r_proto=''
518 getservbyname_r_proto=''
520 getservbyport_r_proto=''
522 getservent_r_proto=''
546 d_libm_lib_version=''
559 d_malloc_good_size=''
601 d_old_pthread_create_joinable=''
602 old_pthread_create_joinable=''
604 d_pthread_attr_setscope=''
643 sethostent_r_proto=''
660 setprotoent_r_proto=''
672 setservent_r_proto=''
705 d_sprintf_returns_strlen=''
720 d_stdio_ptr_lval_nochange_cnt=''
721 d_stdio_ptr_lval_sets_cnt=''
924 d_inc_version_list=''
926 inc_version_list_init=''
945 ignore_versioned_solibs=''
1009 d_perl_otherlibdirs=''
1017 api_versionstring=''
1023 version_patchlevel_string=''
1027 d_nv_preserves_uv=''
1028 d_nv_zero_is_allbits_zero=''
1039 nv_preserves_uv_bits=''
1111 installsitehtml1dir=''
1114 installsitehtml3dir=''
1121 installsiteman1dir=''
1124 installsiteman3dir=''
1129 installsitescript=''
1144 d_stdio_stream_array=''
1145 stdio_stream_array=''
1156 ccflags_uselargefiles=''
1157 ldflags_uselargefiles=''
1158 libswanted_uselargefiles=''
1178 installvendorarch=''
1185 installvendorhtml1dir=''
1187 vendorhtml1direxp=''
1188 installvendorhtml3dir=''
1190 vendorhtml3direxp=''
1196 installvendorman1dir=''
1199 installvendorman3dir=''
1206 installvendorscript=''
1218 smallmach='pdp11 i8086 z8000 i80286 iAPX286'
1221 : We must find out about Eunice early
1223 if test -f /etc/unixtovms; then
1224 eunicefix=/etc/unixtovms
1226 if test -f /etc/unixtovms.exe; then
1227 eunicefix=/etc/unixtovms.exe
1230 : Set executable suffix now -- needed before hints available
1231 if test -f "/libs/version.library"; then
1234 elif test -f "/system/gnu_library/bin/ar.pm"; then
1237 elif test -n "$DJGPP"; then
1240 elif test -d c:/. -o -n "$is_os2" ; then
1249 : set useposix=false in your hint file to disable the POSIX extension.
1251 : set useopcode=false in your hint file to disable the Opcode extension.
1253 : Trailing extension. Override this in a hint file, if needed.
1254 : Extra object files, if any, needed on this platform.
1257 : Possible local include directories to search.
1258 : Set locincpth to "" in a hint file to defeat local include searches.
1259 locincpth="/usr/local/include /opt/local/include /usr/gnu/include"
1260 locincpth="$locincpth /opt/gnu/include /usr/GNU/include /opt/GNU/include"
1262 : no include file wanted by default
1265 : Enable -DEBUGGING and -DDEBUGGING from the command line
1271 : change the next line if compiling for Xenix/286 on Xenix/386
1272 xlibpth='/usr/lib/386 /lib/386'
1273 : Possible local library directories to search.
1274 loclibpth="/usr/local/lib /opt/local/lib /usr/gnu/lib"
1275 loclibpth="$loclibpth /opt/gnu/lib /usr/GNU/lib /opt/GNU/lib"
1277 : general looking path for locating libraries
1278 glibpth="/lib /usr/lib $xlibpth"
1279 glibpth="$glibpth /usr/ccs/lib /usr/ucblib /usr/local/lib"
1280 test -f /usr/shlib/libc.so && glibpth="/usr/shlib $glibpth"
1281 test -f /shlib/libc.so && glibpth="/shlib $glibpth"
1283 : Private path used by Configure to find libraries. Its value
1284 : is prepended to libpth. This variable takes care of special
1285 : machines, like the mips. Usually, it should be empty.
1288 : default library list
1290 : some systems want to use only the non-versioned libso:s
1291 ignore_versioned_solibs=''
1296 ccflags_uselargefiles=''
1297 ldflags_uselargefiles=''
1298 libswanted_uselargefiles=''
1299 : set usemultiplicity on the Configure command line to enable multiplicity.
1300 : set usesocks on the Configure command line to enable socks.
1301 : set usethreads on the Configure command line to enable threads.
1302 usereentrant='undef'
1303 : full support for void wanted by default
1306 : List of libraries we want.
1307 : If anyone needs extra -lxxx, put those in a hint file.
1308 libswanted="sfio socket bind inet nsl nm ndbm gdbm dbm db malloc dl dld ld sun"
1309 libswanted="$libswanted m crypt sec util c cposix posix ucb bsd BSD"
1310 : We probably want to search /usr/shlib before most other libraries.
1311 : This is only used by the lib/ExtUtils/MakeMaker.pm routine extliblist.
1312 glibpth=`echo " $glibpth " | sed -e 's! /usr/shlib ! !'`
1313 glibpth="/usr/shlib $glibpth"
1314 : Do not use vfork unless overridden by a hint file.
1317 : Find the basic shell for Bourne shell scripts
1321 *bsd*|sys5*) xxx="/$SYSTYPE/bin/sh";;
1324 if test -f "$xxx"; then
1327 : Build up a list and do a single loop so we can 'break' out.
1328 pth=`echo $PATH | sed -e "s/$p_/ /g"`
1329 for xxx in sh bash ksh pdksh ash; do
1331 try="$try ${p}/${xxx}"
1335 if test -f "$xxx"; then
1338 elif test "X$_exe" != X -a -f "$xxx$_exe"; then
1341 elif test -f "$xxx.exe"; then
1352 $me: Fatal Error: I can't find a Bourne Shell anywhere.
1354 Usually it's in /bin/sh. How did you even get this far?
1355 Please contact me (Perl Maintainers) at perlbug@perl.org and
1356 we'll try to straighten this all out.
1362 : see if sh knows # comments
1363 if `$sh -c '#' >/dev/null 2>&1`; then
1367 test -f $xcat$_exe || xcat=/usr/bin/cat
1368 if test ! -f $xcat$_exe; then
1369 for p in `echo $PATH | sed -e "s/$p_/ /g"` $paths; do
1370 if test -f $p/cat$_exe; then
1375 if test ! -f $xcat$_exe; then
1376 echo "Can't find cat anywhere!"
1380 echo "#!$xcat" >sharp
1384 if test -s today; then
1387 echo "#! $xcat" > sharp
1391 if test -s today; then
1399 echo "Your $sh doesn't grok # comments--I will strip them later on."
1402 echo "exec grep -v '^[ ]*#'" >spitshell
1404 $eunicefix spitshell
1405 spitshell=`pwd`/spitshell
1407 echo "I presume that if # doesn't work, #! won't work either!"
1412 : figure out how to guarantee sh startup
1414 '') startsh=${sharpbang}${sh} ;;
1426 : echo "Yup, it does."
1428 echo "Hmm... '$startsh' does not guarantee sh startup..."
1429 echo "You may have to fix up the shell scripts to make sure $sh runs them."
1434 : Save command line options in file UU/cmdline.opt for later use in
1435 : generating config.sh.
1436 cat > cmdline.opt <<EOSH
1437 # Configure command line arguments.
1446 cat >>cmdline.opt <<EOSH
1447 config_arg$argn='$arg'
1449 # Extreme backslashitis: replace each ' by '"'"'
1450 cat <<EOC | sed -e "s/'/'"'"'"'"'"'"'/g" > cmdl.opt
1453 arg_exp=`cat cmdl.opt`
1454 args_exp="$args_exp$args_sep'$arg_exp'"
1455 argn=`expr $argn + 1`
1458 # args_exp is good for restarting self: eval "set X $args_exp"; shift; $0 "$@"
1459 # used by ./hints/os2.sh
1462 : produce awk script to parse command line options
1463 cat >options.awk <<'EOF'
1465 optstr = "A:dD:eEf:hKOrsSU:V"; # getopt-style specification
1467 len = length(optstr);
1468 for (i = 1; i <= len; i++) {
1469 c = substr(optstr, i, 1);
1470 if (i < len) a = substr(optstr, i + 1, 1); else a = "";
1481 if (substr(str, 1, 1) != "-") {
1482 printf("'%s'\n", str);
1486 for (i = 2; i <= len; i++) {
1487 c = substr(str, i, 1);
1489 printf("-%s\n", substr(str, i));
1495 printf("'%s'\n", substr(str, i + 1));
1508 : process the command line options
1509 set X `for arg in "$@"; do echo "X$arg"; done |
1510 sed -e s/X// | awk -f options.awk`
1515 : set up default values
1525 rm -f optdef.sh posthint.sh
1526 cat >optdef.sh <<EOS
1532 while test $# -gt 0; do
1534 -d) shift; fastread=yes;;
1535 -e) shift; alldone=cont;;
1539 if test -r "$1"; then
1542 echo "$me: cannot read config file $1." >&2
1547 -h) shift; error=true;;
1548 -r) shift; reuseval=true;;
1549 -s) shift; silent=true; realsilent=true;;
1550 -E) shift; alldone=exit;;
1551 -K) shift; knowitall=true;;
1552 -O) shift; override=true;;
1553 -S) shift; silent=true; extractsh=true;;
1558 echo "$me: use '-U symbol=', not '-D symbol='." >&2
1559 echo "$me: ignoring -D $1" >&2
1562 sed -e "s/'/'\"'\"'/g" -e "s/=\(.*\)/='\1'/" >> optdef.sh;;
1563 *) echo "$1='define'" >> optdef.sh;;
1570 *=) echo "$1" >> optdef.sh;;
1572 echo "$me: use '-D symbol=val', not '-U symbol=val'." >&2
1573 echo "$me: ignoring -U $1" >&2
1575 *) echo "$1='undef'" >> optdef.sh;;
1586 *=*) zzz=`echo "$yyy"|sed 's!=.*!!'`
1590 zzz=" "`echo "$yyy"|sed 's!^[^=]*=!!'`
1591 yyy=`echo "$yyy"|sed 's!=.*!!'` ;;
1597 *:*) xxx=`echo "$yyy"|sed 's!:.*!!'`
1598 yyy=`echo "$yyy"|sed 's!^[^:]*:!!'`
1599 zzz=`echo "$yyy"|sed 's!^[^=]*=!!'`
1600 yyy=`echo "$yyy"|sed 's!=.*!!'` ;;
1601 *) xxx=`echo "$yyy"|sed 's!:.*!!'`
1602 yyy=`echo "$yyy"|sed 's!^[^:]*:!!'` ;;
1608 echo "$yyy=\"\${$yyy}$zzz\"" >> posthint.sh ;;
1610 echo "$yyy=''" >> posthint.sh ;;
1615 echo "$yyy='$zzz'" >> posthint.sh ;;
1617 echo "eval \"$yyy=$zzz\"" >> posthint.sh ;;
1619 echo "$yyy=\"$zzz\${$yyy}\"" >> posthint.sh ;;
1624 echo "$yyy=$zzz" >> posthint.sh ;;
1625 *) echo "$me: unknown -A command '$xxx', ignoring -A $1" >&2 ;;
1629 -V) echo "$me generated by metaconfig 3.0 PL70." >&2
1632 -*) echo "$me: unknown option $1" >&2; shift; error=true;;
1640 Usage: $me [-dehrsEKOSV] [-f config.sh] [-D symbol] [-D symbol=value]
1641 [-U symbol] [-U symbol=] [-A command:symbol...]
1642 -d : use defaults for all answers.
1643 -e : go on without questioning past the production of config.sh.
1644 -f : specify an alternate default configuration file.
1645 -h : print this help message and exit (with an error status).
1646 -r : reuse C symbols value if possible (skips costly nm extraction).
1647 -s : silent mode, only echoes questions and essential information.
1648 -D : define symbol to have some value:
1649 -D symbol symbol gets the value 'define'
1650 -D symbol=value symbol gets the value 'value'
1651 -E : stop at the end of questions, after having produced config.sh.
1652 -K : do not use unless you know what you are doing.
1653 -O : let -D and -U override definitions from loaded configuration file.
1654 -S : perform variable substitutions on all .SH files (can mix with -f)
1655 -U : undefine symbol:
1656 -U symbol symbol gets the value 'undef'
1657 -U symbol= symbol gets completely empty
1658 -A : manipulate symbol after the platform specific hints have been applied:
1659 -A symbol=value append " "value to symbol
1660 -A append:symbol=value append value to symbol
1661 -A define:symbol=value define symbol to have value
1662 -A clear:symbol define symbol to be ''
1663 -A define:symbol define symbol to be 'define'
1664 -A eval:symbol=value define symbol to be eval of value
1665 -A prepend:symbol=value prepend value to symbol
1666 -A undef:symbol define symbol to be 'undef'
1667 -A undef:symbol= define symbol to be ''
1668 -V : print version number and exit (with a zero status).
1675 case "$fastread$alldone" in
1678 case "$extractsh" in
1681 if test ! -t 0; then
1682 echo "Say 'sh Configure', not 'sh <Configure'"
1692 true) exec 1>/dev/null;;
1695 : run the defines and the undefines, if any, but leave the file out there...
1698 : create the posthint manipulation script and leave the file out there...
1703 first=`echo $package | sed -e 's/^\(.\).*/\1/'`
1704 last=`echo $package | sed -e 's/^.\(.*\)/\1/'`
1705 case "`echo AbyZ | tr '[:lower:]' '[:upper:]' 2>/dev/null`" in
1706 ABYZ) spackage=`echo $first | tr '[:lower:]' '[:upper:]'`$last;;
1707 *) spackage=`echo $first | tr '[a-z]' '[A-Z]'`$last;;
1710 : Some greps do not return status, grrr.
1711 echo "grimblepritz" >grimble
1712 if grep blurfldyick grimble >/dev/null 2>&1 ; then
1714 elif grep grimblepritz grimble >/dev/null 2>&1 ; then
1720 : the following should work in any shell
1724 echo "AGH! Grep doesn't return a status. Attempting remedial action."
1725 cat >contains <<'EOSS'
1726 grep "$1" "$2" >.greptmp && cat .greptmp && test -s .greptmp
1731 : Find the path to the source tree
1734 */*) src=`echo $0 | sed -e 's%/[^/][^/]*$%%'`
1738 *) src=`cd ../$src && pwd` ;;
1751 if test -f $rsrc/Configure && \
1752 $contains "^package=$package$" $rsrc/Configure >/dev/null 2>&1
1754 : found it, so we are ok.
1757 for src in . .. ../.. ../../.. ../../../..; do
1758 if test -f ../$src/Configure && \
1759 $contains "^package=$package$" ../$src/Configure >/dev/null 2>&1
1770 Sorry, I can't seem to locate the source dir for $package. Please start
1771 Configure with an explicit path -- i.e. /some/path/Configure.
1779 echo "Sources for $package found in \"$src\"." >&4
1783 : script used to extract .SH files with variable substitutions
1784 cat >extract <<'EOS'
1786 echo "Doing variable substitutions on .SH files..."
1787 if test -f MANIFEST; then
1788 set x `awk '{print $1}' < MANIFEST | grep '\.SH$'`
1790 echo "(Looking for .SH files under the source directory.)"
1791 set x `(cd "$src"; find . -name "*.SH" -print)`
1795 0) set x `(cd "$src"; echo *.SH)`; shift;;
1797 if test ! -f "$src/$1"; then
1803 while test $name; do
1804 if test ! -d "$name"; then
1805 create="$name $create";
1806 name=`echo $name | sed -e "s|^[^/]*$||"`;
1807 name=`echo $name | sed -e "s|\(.*\)/.*|\1|"`;
1812 for file in $create; do
1821 dir=`expr X$file : 'X\(.*\)/'`
1822 file=`expr X$file : 'X.*/\(.*\)'`
1823 (cd "$dir" && . ./$file)
1833 dir=`expr X$file : 'X\(.*\)/'`
1834 file=`expr X$file : 'X.*/\(.*\)'`
1835 (set x $dir; shift; eval $mkdir_p)
1836 sh <"$src/$dir/$file"
1845 if test -f "$src/config_h.SH"; then
1846 if test ! -f config.h; then
1847 : oops, they left it out of MANIFEST, probably, so do it anyway.
1848 . "$src/config_h.SH"
1853 : extract files and exit if asked to do so
1854 case "$extractsh" in
1856 case "$realsilent" in
1860 case "$config_sh" in
1861 '') config_sh='config.sh';;
1864 echo "Fetching answers from $config_sh..."
1867 test "$override" && . ./optdef.sh
1871 echo "Extraction done."
1876 : Eunice requires " " instead of "", can you believe it
1879 echo "Beginning of configuration questions for $package."
1881 trap 'echo " "; test -d ../UU && rm -rf X $rmlist; exit 1' 1 2 3 15
1883 : first determine how to suppress newline on echo command
1885 echo "Checking echo to see how to suppress newlines..."
1886 (echo "hi there\c" ; echo " ") >.echotmp
1887 if $contains c .echotmp >/dev/null 2>&1 ; then
1898 echo $n "The star should be here-->$c"
1902 : Now test for existence of everything in MANIFEST
1904 if test -f "$rsrc/MANIFEST"; then
1905 echo "First let's make sure your kit is complete. Checking..." >&4
1906 awk '$1 !~ /PACK[A-Z]+/ {print $1}' "$rsrc/MANIFEST" | (split -l 50 2>/dev/null || split -50)
1909 for filelist in x??; do
1910 (cd "$rsrc"; ls `cat "$tmppwd/$filelist"` >/dev/null 2>>"$tmppwd/missing")
1912 if test -s missing; then
1916 THIS PACKAGE SEEMS TO BE INCOMPLETE.
1918 You have the option of continuing the configuration process, despite the
1919 distinct possibility that your kit is damaged, by typing 'y'es. If you
1920 do, don't blame me if something goes wrong. I advise you to type 'n'o
1921 and contact the author (perlbug@perl.org).
1924 echo $n "Continue? [n] $c" >&4
1928 echo "Continuing..." >&4
1932 echo "ABORTING..." >&4
1937 echo "Looks good..."
1940 echo "There is no MANIFEST file. I hope your kit is complete !"
1945 : Find the appropriate value for a newline for tr
1946 if test -n "$DJGPP"; then
1949 if test X"$trnl" = X; then
1950 case "`echo foo|tr '\n' x 2>/dev/null`" in
1954 if test X"$trnl" = X; then
1955 case "`echo foo|tr '\012' x 2>/dev/null`" in
1956 foox) trnl='\012' ;;
1959 if test X"$trnl" = X; then
1960 case "`echo foo|tr '\r\n' xy 2>/dev/null`" in
1961 fooxy) trnl='\n\r' ;;
1964 if test X"$trnl" = X; then
1967 $me: Fatal Error: cannot figure out how to translate newlines with 'tr'.
1973 : compute the number of columns on the terminal for proper question formatting
1978 : set up the echo used in my read
1979 myecho="case \"\$xxxm\" in
1980 '') echo $n \"\$rp $c\" >&4;;
1982 '') echo $n \"[\$xxxm] $c\";;
1984 if test \`echo \"\$rp [\$xxxm] \" | wc -c\` -ge $COLUMNS; then
1986 echo $n \"[\$xxxm] $c\" >&4
1988 echo $n \"\$rp [\$xxxm] $c\" >&4
1994 : now set up to do reads with possible shell escape and default assignment
2000 case "\$fastread" in
2001 yes) case "\$dflt" in
2004 case "\$silent-\$rp" in
2009 *) case "\$silent" in
2010 true) case "\$rp" in
2015 while expr "X\$ans" : "X!" >/dev/null; do
2019 aok=''; eval "ans=\\"\$answ\\"" && aok=y
2027 set x \`expr "X\$ans" : "X!\(.*\)\$"\`
2036 set x \`expr "X\$ans" : "X&\(.*\)\$"\`
2041 echo "(OK, I'll run with -d after this question.)" >&4
2044 echo "*** Sorry, \$1 not supported yet." >&4
2054 echo "*** Substitution done -- please confirm."
2056 ans=\`echo $n "\$ans$c" | tr '$trnl' ' '\`
2061 echo "*** Error -- try again."
2068 case "\$ans\$xxxm\$nostick" in
2080 : create .config dir to save info across Configure sessions
2081 test -d ../.config || mkdir ../.config
2082 cat >../.config/README <<EOF
2083 This directory created by Configure to save information that should
2084 persist across sessions for $package.
2086 You may safely delete it if you wish.
2089 xversion=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
2091 $define|true|[yY]*) ;;
2092 *) case "$xversion" in
2095 *** WHOA THERE!!! ***
2097 This is an UNSTABLE DEVELOPMENT release.
2098 The version of this $package distribution is $xversion, that is, odd,
2099 (as opposed to even) and that signifies a development release.
2100 If you want a maintenance release, you want an even-numbered version.
2102 Do ***NOT*** install this into production use.
2103 Data corruption and crashes are possible.
2105 It is most seriously suggested that you do not continue any further
2106 unless you want to help in developing and debugging Perl.
2108 If you *still* want to build perl, you can answer 'y' now,
2109 or pass -Dusedevel to Configure.
2112 rp='Do you really want to continue?'
2116 [yY]) echo >&4 "Okay, continuing."
2117 usedevel="$define" ;;
2118 *) echo >&4 "Okay, bye."
2128 case "$versiononly" in
2129 '') versiononly="$define" ;;
2131 case "$installusrbinperl" in
2132 '') installusrbinperl="$undef" ;;
2137 : general instructions
2140 user=`(logname) 2>/dev/null`
2142 '') user=`whoami 2>&1`;;
2144 if $contains "^$user\$" ../.config/instruct >/dev/null 2>&1; then
2147 rp='Would you like to see the instructions?'
2158 This installation shell script will examine your system and ask you questions
2159 to determine how the perl5 package should be installed. If you get
2160 stuck on a question, you may use a ! shell escape to start a subshell or
2161 execute a command. Many of the questions will have default answers in square
2162 brackets; typing carriage return will give you the default.
2164 On some of the questions which ask for file or directory names you are allowed
2165 to use the ~name construct to specify the login directory belonging to "name",
2166 even if you don't have a shell which knows about that. Questions where this is
2167 allowed will be marked "(~name ok)".
2171 dflt='Type carriage return to continue'
2175 The prompter used in this script allows you to use shell variables and
2176 backticks in your answers. You may use $1, $2, etc... to refer to the words
2177 in the default answer, as if the default line was a set of arguments given to a
2178 script shell. This means you may also use $* to repeat the whole default line,
2179 so you do not have to re-type everything to add something to the default.
2181 Everytime there is a substitution, you will have to confirm. If there is an
2182 error (e.g. an unmatched backtick), the default answer will remain unchanged
2183 and you will be prompted again.
2185 If you are in a hurry, you may run 'Configure -d'. This will bypass nearly all
2186 the questions and use the computed defaults (or the previous answers if there
2187 was already a config.sh file). Type 'Configure -h' for a list of options.
2188 You may also start interactively and then answer '& -d' at any prompt to turn
2189 on the non-interactive behaviour for the remainder of the execution.
2195 Much effort has been expended to ensure that this shell script will run on any
2196 Unix system. If despite that it blows up on yours, your best bet is to edit
2197 Configure and run it again. If you can't run Configure for some reason,
2198 you'll have to generate a config.sh file by hand. Whatever problems you
2199 have, let me (perlbug@perl.org) know how I blew it.
2201 This installation script affects things in two ways:
2203 1) it may do direct variable substitutions on some of the files included
2205 2) it builds a config.h file for inclusion in C programs. You may edit
2206 any of these files as the need arises after running this script.
2208 If you make a mistake on a question, there is no easy way to back up to it
2209 currently. The easiest thing to do is to edit config.sh and rerun all the SH
2210 files. Configure will offer to let you do this before it runs the SH files.
2213 dflt='Type carriage return to continue'
2215 case "$firsttime" in
2216 true) echo $user >>../.config/instruct;;
2220 : find out where common programs are
2222 echo "Locating common programs..." >&4
2235 if test -d \$dir/\$thing; then
2241 for thisthing in \$dir/\$thing; do
2242 : just loop through to pick last item
2244 if test -f \$thisthing; then
2247 elif test "X$_exe" != X -a -f \$thisthing$_exe; then
2250 elif test -f \$dir/\$thing.exe; then
2251 if test -n "$DJGPP"; then
2252 echo \$dir/\$thing.exe
2253 elif test "$eunicefix" != ":"; then
2254 : on Eunice apparently
2308 pth=`echo $PATH | sed -e "s/$p_/ /g"`
2309 pth="$pth /lib /usr/lib"
2310 for file in $loclist; do
2314 if test -f "$xxx"; then
2317 echo "WARNING: no $xxx -- ignoring your setting for $file." >&4
2318 xxx=`./loc $file $file $pth`
2321 '') xxx=`./loc $file $file $pth`;;
2322 *) xxx=`./loc $xxx $xxx $pth`;;
2324 eval $file=$xxx$_exe
2328 echo $file is in $xxx.
2331 echo $file is in $xxx.
2334 echo "I don't know where '$file' is, and my life depends on it." >&4
2335 echo "Go find a public domain implementation or fix your PATH setting!" >&4
2341 echo "Don't worry if any of the following aren't found..."
2343 for file in $trylist; do
2347 if test -f "$xxx"; then
2350 echo "WARNING: no $xxx -- ignoring your setting for $file." >&4
2351 xxx=`./loc $file $file $pth`
2354 '') xxx=`./loc $file $file $pth`;;
2355 *) xxx=`./loc $xxx $xxx $pth`;;
2357 eval $file=$xxx$_exe
2361 echo $file is in $xxx.
2364 echo $file is in $xxx.
2367 echo "I don't see $file out there, $say."
2374 echo "Substituting grep for egrep."
2381 echo "Substituting cp for ln."
2390 echo "I can't find make or gmake, and my life depends on it." >&4
2391 echo "Go find a public domain implementation or fix your PATH setting!" >&4
2399 *) # We can't have osname yet.
2400 if test -f "/system/gnu_library/bin/ar.pm"; then # Stratus VOS
2401 # Assume that gmake, if found, is definitely GNU make
2402 # and prefer it over the system make.
2403 echo "Substituting gmake for make."
2411 echo "Hopefully test is built into your sh."
2414 if `sh -c "PATH= test true" >/dev/null 2>&1`; then
2415 echo "Using the test built into your sh."
2423 echo "Hopefully echo is built into your sh."
2428 echo "Checking compatibility between $echo and builtin echo (if any)..." >&4
2429 $echo $n "hi there$c" >foo1
2430 echo $n "hi there$c" >foo2
2431 if cmp foo1 foo2 >/dev/null 2>&1; then
2432 echo "They are compatible. In fact, they may be identical."
2439 They are not compatible! You are probably running ksh on a non-USG system.
2440 I'll have to use $echo instead of the builtin, since Bourne shell doesn't
2441 have echo built in and we may have to run some Bourne shell scripts. That
2442 means I'll have to use '$n$c' to suppress newlines now. Life is ridiculous.
2445 $echo $n "The star should be here-->$c"
2455 cat <<'EOSC' >>trygcc
2460 int main(int argc, char *argv[]) {
2464 if $cc -o try $ccflags $ldflags try.c; then
2467 echo "Uh-oh, the C compiler '$cc' doesn't seem to be working." >&4
2473 case "`$cc -v -c try.c 2>&1`" in
2476 if $test X"$trygcc" = Xyes; then
2477 if gcc -o try -c try.c; then
2479 echo "You seem to have a working gcc, though." >&4
2480 rp="Would you like to use it?"
2482 if $test -f myread; then
2485 if $test -f UU/myread; then
2488 echo "Cannot find myread, sorry. Aborting." >&2
2493 [yY]*) cc=gcc; ccname=gcc; ccflags=''; despair=no;
2494 if $test -f usethreads.cbu; then
2497 *** However, any setting of the C compiler flags (e.g. for thread support)
2498 *** has been lost. It may be necessary to pass -Dcc=gcc to Configure
2499 *** (together with e.g. -Dusethreads).
2515 cat <<'EOSC' >>checkcc
2520 int main(int argc, char *argv[]) {
2524 if $cc -o try $ccflags $ldflags try.c; then
2527 if $test X"$despair" = Xyes; then
2528 echo "Uh-oh, the C compiler '$cc' doesn't seem to be working." >&4
2531 You need to find a working C compiler.
2532 Either (purchase and) install the C compiler supplied by your OS vendor,
2533 or for a free C compiler try http://gcc.gnu.org/
2534 I cannot continue any further, aborting.
2543 : determine whether symbolic links are supported
2546 if $ln -s blurfl sym > /dev/null 2>&1 ; then
2547 echo "Symbolic links are supported." >&4
2550 echo "Symbolic links are NOT supported." >&4
2555 : determine whether symbolic links are supported
2559 echo "Checking how to test for symbolic links..." >&4
2561 if $test "X$issymlink" = X; then
2563 '') sh -c "PATH= test -h sym" >/dev/null 2>&1 ;;
2564 *) $newsh -c "PATH= test -h sym" >/dev/null 2>&1 ;;
2566 if test $? = 0; then
2569 echo "Your builtin 'test -h' may be broken." >&4
2572 *) pth=`echo $PATH | sed -e "s/$p_/ /g"`
2575 if test -f "$p/$test"; then
2584 echo "Trying external '$test -h'." >&4
2585 issymlink="$test -h"
2586 if $test ! -h sym >/dev/null 2>&1; then
2587 echo "External '$test -h' is broken, too." >&4
2595 if $test "X$issymlink" = X; then
2596 if $test -L sym 2>/dev/null; then
2597 issymlink="$test -L"
2598 echo "The builtin '$test -L' worked." >&4
2601 if $test "X$issymlink" != X; then
2602 echo "You can test for symbolic links with '$issymlink'." >&4
2604 echo "I do not know how you can test for symbolic links." >&4
2608 *) echo "No symbolic links, so not testing for their testing..." >&4
2614 case "$mksymlinks" in
2617 ''|'.') echo "Cannot create symlinks in the original directory." >&4
2620 *) case "$lns:$issymlink" in
2621 *"ln"*" -s:"*"test -"?)
2622 echo "Creating the symbolic links..." >&4
2623 echo "(First creating the subdirectories...)" >&4
2625 awk '{print $1}' $src/MANIFEST | grep / | sed 's:/[^/]*$::' | sort -u | while true; do
2627 test -z "$directory" && break
2631 if test ! -d t/base; then
2632 echo "Failed to create the subdirectories. Aborting." >&4
2635 echo "(Then creating the symlinks...)" >&4
2636 awk '{print $1}' $src/MANIFEST | while true; do
2638 test -z "$filename" && break
2639 if test -f $filename; then
2640 if $issymlink $filename; then
2644 if test -f $filename; then
2645 echo "$filename already exists, not symlinking."
2647 ln -s $src/$filename $filename
2651 if test ! -f t/base/lex.t; then
2652 echo "Failed to create the symlinks (t/base/lex.t missing). Aborting." >&4
2657 *) echo "(I cannot figure out how to do symbolic links, ignoring mksymlinks)." >&4
2666 case "$usecrosscompile" in
2668 $echo "Cross-compiling..."
2671 *-*-gcc) # A cross-compiling gcc, probably.
2672 targetarch=`$echo $cc|$sed 's/-gcc$//'`
2674 # leave out ld, choosing it is more complex
2676 ranlib=$targetarch-ranlib
2677 $echo 'extern int foo;' > try.c
2678 set X `$cc -v -E try.c 2>&1 | $awk '/^#include </,/^End of search /'|$grep '/include'`
2680 if $test $# -gt 0; then
2682 incpth="`$echo $incpth|$sed 's/^ //'`"
2683 echo "Guessing incpth '$incpth'." >&4
2685 j="`$echo $i|$sed 's,/include$,/lib,'`"
2686 if $test -d $j; then
2690 libpth="`$echo $libpth|$sed 's/^ //'`"
2691 echo "Guessing libpth '$libpth'." >&4
2696 case "$targetarch" in
2697 '') echo "Targetarch not defined." >&4; croak=y ;;
2698 *) echo "Using targetarch $targetarch." >&4 ;;
2701 '') echo "Incpth not defined." >&4; croak=y ;;
2702 *) echo "Using incpth '$incpth'." >&4 ;;
2705 '') echo "Libpth not defined." >&4; croak=y ;;
2706 *) echo "Using libpth '$libpth'." >&4 ;;
2709 '') for i in $incpth; do
2710 if $test -f $i/errno.h -a -f $i/stdio.h -a -f $i/time.h; then
2712 echo "Guessing usrinc $usrinc." >&4
2717 '') echo "Usrinc not defined." >&4; croak=y ;;
2720 *) echo "Using usrinc $usrinc." >&4 ;;
2722 case "$targethost" in
2723 '') echo "Targethost not defined." >&4; croak=y ;;
2724 *) echo "Using targethost $targethost." >&4
2729 y) echo "Cannot continue, aborting." >&4; exit 1 ;;
2732 /*) run=$src/Cross/run
2733 targetmkdir=$src/Cross/mkdir
2735 from=$src/Cross/from
2737 *) pwd=`$test -f ../Configure & cd ..; pwd`
2739 targetmkdir=$pwd/Cross/mkdir
2741 from=$pwd/Cross/from
2744 case "$targetrun" in
2745 '') targetrun=ssh ;;
2750 case "$targetfrom" in
2751 '') targetfrom=scp ;;
2755 from=$from-$targetfrom
2756 case "$targetdir" in
2758 echo "Guessing targetdir $targetdir." >&4
2761 case "$targetuser" in
2763 echo "Guessing targetuser $targetuser." >&4
2766 case "$targetfrom" in
2770 case "$targetrun" in
2782 '') cwd=$targetdir ;;
2786 if $test ! -f \$exe.xok; then
2790 $targetrun -l $targetuser $targethost "cd \$cwd && ./\$exe \$@"
2793 *) echo "Unknown targetrun '$targetrun'" >&4
2797 case "$targetmkdir" in
2799 cat >$targetmkdir <<EOF
2801 $targetrun -l $targetuser $targethost "mkdir -p \$@"
2803 $chmod a+rx $targetmkdir
2805 *) echo "Unknown targetmkdir '$targetmkdir'" >&4
2817 $targetmkdir \`dirname \$f\`
2818 $targetto $q \$f $targetuser@$targethost:\$f || exit 1
2821 $targetmkdir $targetdir/\`dirname \$f\`
2822 $targetto $q \$f $targetuser@$targethost:$targetdir/\$f || exit 1
2835 $mkdir -p $targetdir/\`dirname \$f\`
2836 $cp \$f $targetdir/\$f || exit 1
2839 $targetmkdir $targetdir/\`dirname \$f\`
2840 $cp \$f $targetdir/\$f || exit 1
2847 *) echo "Unknown targetto '$targetto'" >&4
2851 case "$targetfrom" in
2858 $targetfrom $q $targetuser@$targethost:$targetdir/\$f . || exit 1
2863 cp) cat >$from <<EOF
2868 cp $targetdir/\$f . || exit 1
2873 *) echo "Unknown targetfrom '$targetfrom'" >&4
2877 if $test ! -f $run; then
2878 echo "Target 'run' script '$run' not found." >&4
2882 if $test ! -f $to; then
2883 echo "Target 'to' script '$to' not found." >&4
2887 if $test ! -f $from; then
2888 echo "Target 'from' script '$from' not found." >&4
2892 if $test ! -f $run -o ! -f $to -o ! -f $from; then
2896 Using '$run' for remote execution,
2897 and '$from' and '$to'
2898 for remote file transfer.
2904 usecrosscompile='undef'
2909 : see whether [:lower:] and [:upper:] are supported character classes
2911 case "`echo AbyZ | $tr '[:lower:]' '[:upper:]' 2>/dev/null`" in
2913 echo "Good, your tr supports [:lower:] and [:upper:] to convert case." >&4
2917 *) # There is a discontinuity in EBCDIC between 'R' and 'S'
2918 # (0xd9 and 0xe2), therefore that is a nice testing point.
2919 if test "X$up" = X -o "X$low" = X; then
2920 case "`echo RS | $tr '[R-S]' '[r-s]' 2>/dev/null`" in
2926 if test "X$up" = X -o "X$low" = X; then
2927 case "`echo RS | $tr R-S r-s 2>/dev/null`" in
2933 if test "X$up" = X -o "X$low" = X; then
2934 case "`echo RS | od -x 2>/dev/null`" in
2936 echo "Hey, this might be EBCDIC." >&4
2937 if test "X$up" = X -o "X$low" = X; then
2938 case "`echo RS | $tr '[A-IJ-RS-Z]' '[a-ij-rs-z]' 2>/dev/null`" in
2939 rs) up='[A-IJ-RS-Z]'
2944 if test "X$up" = X -o "X$low" = X; then
2945 case "`echo RS | $tr A-IJ-RS-Z a-ij-rs-z 2>/dev/null`" in
2955 case "`echo RS | $tr \"$up\" \"$low\" 2>/dev/null`" in
2957 echo "Using $up and $low to convert case." >&4
2960 echo "I don't know how to translate letters from upper to lower case." >&4
2961 echo "Your tr is not acting any way I know of." >&4
2965 : set up the translation script tr, must be called with ./tr of course
2969 '[A-Z][a-z]') exec $tr '$up' '$low';;
2970 '[a-z][A-Z]') exec $tr '$low' '$up';;
2977 : Try to determine whether config.sh was made on this system
2978 case "$config_sh" in
2980 myuname=`$uname -a 2>/dev/null`
2981 $test -z "$myuname" && myuname=`hostname 2>/dev/null`
2982 # tr '[A-Z]' '[a-z]' would not work in EBCDIC
2983 # because the A-Z/a-z are not consecutive.
2984 myuname=`echo $myuname | $sed -e 's/^[^=]*=//' -e 's/\///g' | \
2985 ./tr '[A-Z]' '[a-z]' | $tr $trnl ' '`
2986 newmyuname="$myuname"
2988 case "$knowitall" in
2990 if test -f ../config.sh; then
2991 if $contains myuname= ../config.sh >/dev/null 2>&1; then
2992 eval "`grep myuname= ../config.sh`"
2994 if test "X$myuname" = "X$newmyuname"; then
3002 : Get old answers from old config file if Configure was run on the
3003 : same system, otherwise use the hints.
3006 if test -f config.sh; then
3008 rp="I see a config.sh file. Shall I use it to set the defaults?"
3011 n*|N*) echo "OK, I'll ignore it."
3012 mv config.sh config.sh.old
3013 myuname="$newmyuname"
3015 *) echo "Fetching default answers from your old config.sh file..." >&4
3023 : Older versions did not always set $sh. Catch re-use of such
3033 if test ! -f config.sh; then
3036 First time through, eh? I have some defaults handy for some systems
3037 that need some extra help getting the Configure answers right:
3040 (cd $src/hints; ls -C *.sh) | $sed 's/\.sh/ /g' >&4
3042 : Half the following guesses are probably wrong... If you have better
3043 : tests or hints, please send them to perlbug@perl.org
3044 : The metaconfig authors would also appreciate a copy...
3045 $test -f /irix && osname=irix
3046 $test -f /xenix && osname=sco_xenix
3047 $test -f /dynix && osname=dynix
3048 $test -f /dnix && osname=dnix
3049 $test -f /lynx.os && osname=lynxos
3050 $test -f /unicos && osname=unicos && osvers=`$uname -r`
3051 $test -f /unicosmk && osname=unicosmk && osvers=`$uname -r`
3052 $test -f /unicosmk.ar && osname=unicosmk && osvers=`$uname -r`
3053 $test -f /bin/mips && /bin/mips && osname=mips
3054 $test -d /NextApps && set X `hostinfo | grep 'NeXT Mach.*:' | \
3055 $sed -e 's/://' -e 's/\./_/'` && osname=next && osvers=$4
3056 $test -d /usr/apollo/bin && osname=apollo
3057 $test -f /etc/saf/_sactab && osname=svr4
3058 $test -d /usr/include/minix && osname=minix
3059 $test -f /system/gnu_library/bin/ar.pm && osname=vos
3060 if $test -d /MachTen -o -d /MachTen_Folder; then
3062 if $test -x /sbin/version; then
3063 osvers=`/sbin/version | $awk '{print $2}' |
3064 $sed -e 's/[A-Za-z]$//'`
3065 elif $test -x /usr/etc/version; then
3066 osvers=`/usr/etc/version | $awk '{print $2}' |
3067 $sed -e 's/[A-Za-z]$//'`
3073 $test -f /sys/posix.dll &&
3074 $test -f /usr/bin/what &&
3075 set X `/usr/bin/what /sys/posix.dll` &&
3076 $test "$3" = UWIN &&
3080 if $test -f $uname; then
3088 umips) osname=umips ;;
3091 [23]100) osname=mips ;;
3092 next*) osname=next ;;
3094 tmp=`/bin/uname -X 2>/dev/null|awk '/3\.2v[45]/{ print $(NF) }'`
3095 if $test "$tmp" != "" -a "$3" = "3.2" -a -f '/etc/systemid'; then
3098 elif $test -f /etc/kconfig; then
3100 if test "$lns" = "$ln -s"; then
3102 elif $contains _SYSV3 /usr/include/stdio.h > /dev/null 2>&1 ; then
3104 elif $contains _POSIX_SOURCE /usr/include/stdio.h > /dev/null 2>&1 ; then
3111 if test -n "$DJGPP"; then
3120 tmp=`( (oslevel) 2>/dev/null || echo "not found") 2>&1`
3122 # oslevel can fail with:
3123 # oslevel: Unable to acquire lock.
3124 *not\ found) osvers="$4"."$3" ;;
3125 '<3240'|'<>3240') osvers=3.2.0 ;;
3126 '=3240'|'>3240'|'<3250'|'<>3250') osvers=3.2.4 ;;
3127 '=3250'|'>3250') osvers=3.2.5 ;;
3131 bsd386) osname=bsd386
3134 cygwin*) osname=cygwin
3137 *dc.osx) osname=dcosx
3143 domainos) osname=apollo
3149 dragonfly) osname=dragonfly
3152 dynixptx*) osname=dynixptx
3153 osvers=`echo "$4"|sed 's/^v//'`
3155 freebsd) osname=freebsd
3157 genix) osname=genix ;;
3161 osvers=`echo "$3" | $sed 's,.*\.\([0-9]*\.[0-9]*\),\1,'`
3177 netbsd*) osname=netbsd
3180 news-os) osvers="$3"
3182 4*) osname=newsos4 ;;
3186 next*) osname=next ;;
3187 nonstop-ux) osname=nonstopux ;;
3188 openbsd) osname=openbsd
3194 POSIX-BC | posix-bc ) osname=posix-bc
3197 powerux | power_ux | powermax_os | powermaxos | \
3198 powerunix | power_unix) osname=powerux
3204 solaris) osname=solaris
3206 5*) osvers=`echo $3 | $sed 's/^5/2/g'` ;;
3213 osvers=`echo $3 | $sed 's/^5/2/g'` ;;
3217 titanos) osname=titanos
3226 ultrix) osname=ultrix
3229 osf1|mls+) case "$5" in
3232 osvers=`sizer -v | awk -FUNIX '{print $2}' | awk '{print $1}' | tr '[A-Z]' '[a-z]' | sed 's/^[xvt]//'`
3235 *) osvers=`echo "$3" | sed 's/^[xvt]//'` ;;
3238 hp*) osname=hp_osf1 ;;
3239 mips) osname=mips_osf1 ;;
3242 # UnixWare 7.1.2 is known as Open UNIX 8
3243 openunix|unixware) osname=svr5
3251 $2) case "$osname" in
3255 : svr4.x or possibly later
3265 if test -f /stand/boot ; then
3266 eval `grep '^INITPROG=[a-z/0-9]*$' /stand/boot`
3267 if test -n "$INITPROG" -a -f "$INITPROG"; then
3268 isesix=`strings -a $INITPROG|grep 'ESIX SYSTEM V/386 Release 4.0'`
3269 if test -n "$isesix"; then
3277 *) if test -f /etc/systemid; then
3279 set `echo $3 | $sed 's/\./ /g'` $4
3280 if $test -f $src/hints/sco_$1_$2_$3.sh; then
3282 elif $test -f $src/hints/sco_$1_$2.sh; then
3284 elif $test -f $src/hints/sco_$1.sh; then
3289 '') : Still unknown. Probably a generic Sys V.
3298 *) case "$osname" in
3299 '') : Still unknown. Probably a generic BSD.
3307 if test -f /vmunix -a -f $src/hints/news_os.sh; then
3308 (what /vmunix | UU/tr '[A-Z]' '[a-z]') > UU/kernel.what 2>&1
3309 if $contains news-os UU/kernel.what >/dev/null 2>&1; then
3312 $rm -f UU/kernel.what
3313 elif test -d c:/. -o -n "$is_os2" ; then
3320 case "$targetarch" in
3323 osname=`echo $targetarch|sed 's,^[^-]*-,,'`
3328 : Now look for a hint file osname_osvers, unless one has been
3329 : specified already.
3332 file=`echo "${osname}_${osvers}" | $sed -e 's%\.%_%g' -e 's%_$%%'`
3333 : Also try without trailing minor version numbers.
3334 xfile=`echo $file | $sed -e 's%_[^_]*$%%'`
3335 xxfile=`echo $xfile | $sed -e 's%_[^_]*$%%'`
3336 xxxfile=`echo $xxfile | $sed -e 's%_[^_]*$%%'`
3337 xxxxfile=`echo $xxxfile | $sed -e 's%_[^_]*$%%'`
3340 *) case "$osvers" in
3343 *) if $test -f $src/hints/$file.sh ; then
3345 elif $test -f $src/hints/$xfile.sh ; then
3347 elif $test -f $src/hints/$xxfile.sh ; then
3349 elif $test -f $src/hints/$xxxfile.sh ; then
3351 elif $test -f $src/hints/$xxxxfile.sh ; then
3353 elif $test -f "$src/hints/${osname}.sh" ; then
3362 if $test -f Policy.sh ; then
3365 none) dflt="Policy" ;;
3366 *) dflt="Policy $dflt" ;;
3371 dflt=`echo $hintfile | $sed 's/\.sh$//'`
3375 if $test -f Policy.sh ; then
3378 There's also a Policy hint file available, which should make the
3379 site-specific (policy) questions easier to answer.
3386 You may give one or more space-separated answers, or "none" if appropriate.
3387 A well-behaved OS will have no hints, so answering "none" or just "Policy"
3388 is a good thing. DO NOT give a wrong version or a wrong OS.
3392 rp="Which of these apply, if any?"
3395 for file in $tans; do
3396 if $test X$file = XPolicy -a -f Policy.sh; then
3398 $cat Policy.sh >> UU/config.sh
3399 elif $test -f $src/hints/$file.sh; then
3400 . $src/hints/$file.sh
3401 $cat $src/hints/$file.sh >> UU/config.sh
3402 elif $test X"$tans" = X -o X"$tans" = Xnone ; then
3405 : Give one chance to correct a possible typo.
3406 echo "$file.sh does not exist"
3408 rp="hint to use instead?"
3410 for file in $ans; do
3411 if $test -f "$src/hints/$file.sh"; then
3412 . $src/hints/$file.sh
3413 $cat $src/hints/$file.sh >> UU/config.sh
3414 elif $test X$ans = X -o X$ans = Xnone ; then
3417 echo "$file.sh does not exist -- ignored."
3424 : Remember our hint file for later.
3425 if $test -f "$src/hints/$file.sh" ; then
3435 echo "Fetching default answers from $config_sh..." >&4
3439 cp $config_sh config.sh 2>/dev/null
3449 test "$override" && . ./optdef.sh
3451 : Restore computed paths
3452 for file in $loclist $trylist; do
3453 eval $file="\$_$file"
3458 Configure uses the operating system name and version to set some defaults.
3459 The default value is probably right if the name rings a bell. Otherwise,
3460 since spelling matters for me, either accept the default or answer "none"
3467 ''|' '|none) dflt=none ;;
3468 *) dflt=`echo $hintfile | $sed -e 's/\.sh$//' -e 's/_.*$//'` ;;
3471 *) dflt="$osname" ;;
3473 rp="Operating system name?"
3477 *) osname=`echo "$ans" | $sed -e 's/[ ][ ]*/_/g' | ./tr '[A-Z]' '[a-z]'`;;
3483 ''|' '|none) dflt=none ;;
3484 *) dflt=`echo $hintfile | $sed -e 's/\.sh$//' -e 's/^[^_]*//'`
3485 dflt=`echo $dflt | $sed -e 's/^_//' -e 's/_/./g'`
3487 ''|' ') dflt=none ;;
3492 *) dflt="$osvers" ;;
3494 rp="Operating system version?"
3504 : who configured the system
3505 cf_time=`LC_ALL=C; LANGUAGE=C; export LC_ALL; export LANGUAGE; $date 2>&1`
3508 cf_by=`(logname) 2>/dev/null`
3511 cf_by=`(whoami) 2>/dev/null`
3513 "") cf_by=unknown ;;
3518 : decide how portable to be. Allow command line overrides.
3519 case "$d_portable" in
3521 *) d_portable="$define" ;;
3524 : set up shell script to do ~ expansion
3530 echo \$1 | $sed "s|~|\${HOME-\$LOGDIR}|"
3533 if $test -f /bin/csh; then
3534 /bin/csh -f -c "glob \$1"
3539 name=\`$expr x\$1 : '..\([^/]*\)'\`
3540 dir=\`$sed -n -e "/^\${name}:/{s/^[^:]*:[^:]*:[^:]*:[^:]*:[^:]*:\([^:]*\).*"'\$'"/\1/" -e p -e q -e '}' </etc/passwd\`
3541 if $test ! -d "\$dir"; then
3543 echo "\$me: can't locate home directory for: \$name" >&2
3548 echo \$dir/\`$expr x\$1 : '..[^/]*/\(.*\)'\`
3564 : now set up to get a file name
3568 cat <<'EOSC' >>getfile
3584 : getfile will accept an answer from the comma-separated list
3585 : enclosed in parentheses even if it does not meet other criteria.
3586 expr "$fn" : '.*(\(.*\)).*' | $tr ',' $trnl >getfile.ok
3587 fn=`echo $fn | sed 's/(.*)//'`
3593 loc_file=`expr $fn : '.*:\(.*\)'`
3594 fn=`expr $fn : '\(.*\):.*'`
3602 */*) fullpath=true;;
3611 *e*) exp_file=true;;
3614 *p*) nopath_ok=true;;
3619 *d*) type='Directory';;
3620 *l*) type='Locate';;
3625 Locate) what='File';;
3630 case "$d_portable" in
3638 while test "$type"; do
3643 true) rp="$rp (~name ok)";;
3646 if test -f UU/getfile.ok && \
3647 $contains "^$ans\$" UU/getfile.ok >/dev/null 2>&1
3666 value=`UU/filexp $ans`
3669 if test "$ans" != "$value"; then
3670 echo "(That expands to $value on this system.)"
3684 /*) value="$ansexp" ;;
3685 [a-zA-Z]:/*) value="$ansexp" ;;
3690 echo "I shall only accept a full path name, as in /bin/ls." >&4
3691 echo "Use a ! shell escape if you wish to check pathnames." >&4
3694 echo "Please give a full path name, starting with slash." >&4
3697 echo "Note that using ~name is ok provided it expands well." >&4
3710 for fp in $gfpth; do
3711 if test "X$fp" = X.; then
3716 if test -f "$pf"; then
3718 elif test -r "$pf" || (test -h "$pf") >/dev/null 2>&1
3720 echo "($value is not a plain file, but that's ok.)"
3723 if test X"$type" = X; then
3730 for fp in $gfpth; do
3731 if test "X$fp" = X.; then
3736 direxp="$fp/$ansexp"
3738 if test -d "$direxp"; then
3746 if test -d "$ansexp"; then
3747 echo "(Looking for $loc_file in directory $value.)"
3748 value="$value/$loc_file"
3749 ansexp="$ansexp/$loc_file"
3751 if test -f "$ansexp"; then
3754 case "$nopath_ok" in
3755 true) case "$value" in
3757 *) echo "Assuming $value will be in people's path."
3773 if test "$fastread" = yes; then
3778 rp="$what $value doesn't exist. Use that name anyway?"
3797 test "X$gfpthkeep" != Xy && gfpth=""
3800 : determine root of directory hierarchy where package will be installed.
3803 dflt=`./loc . /usr/local /usr/local /local /opt /usr`
3806 dflt=`echo "$prefix" | sed 's/.$//'`
3814 By default, $package will be installed in $dflt/bin, manual pages
3815 under $dflt/man, etc..., i.e. with $dflt as prefix for all
3816 installation directories. Typically this is something like /usr/local.
3817 If you wish to have binaries under /usr/bin but other parts of the
3818 installation under /usr/local, that's ok: you will be prompted
3819 separately for each of the installation directories, the prefix being
3820 only used to set the defaults.
3824 rp='Installation prefix to use?'
3832 *) oldprefix="$prefix";;
3841 *) afsroot=$afsroot ;;
3847 $define|true) afs=true ;;
3848 $undef|false) afs=false ;;
3849 *) if test -d $afsroot; then
3857 echo "AFS may be running... I'll be extra cautious then..." >&4
3859 echo "AFS does not seem to be running..." >&4
3862 : determine installation prefix for where package is to be installed.
3866 Since you are running AFS, I need to distinguish the directory in which
3867 files will reside from the directory in which they are installed (and from
3868 which they are presumably copied to the former directory by occult means).
3871 case "$installprefix" in
3872 '') dflt=`echo $prefix | sed 's#^/afs/#/afs/.#'`;;
3873 *) dflt="$installprefix";;
3878 In some special cases, particularly when building $package for distribution,
3879 it is convenient to distinguish the directory in which files should be
3880 installed from the directory ($prefix) in which they will
3881 eventually reside. For most users, these two directories are the same.
3884 case "$installprefix" in
3886 *) dflt=$installprefix;;
3890 rp='What installation prefix should I use for installing files?'
3892 installprefix="$ans"
3893 installprefixexp="$ansexp"
3895 : Perform the prefixexp/installprefixexp correction if necessary
3896 cat <<EOS >installprefix
3899 cat <<'EOSC' >>installprefix
3900 : Change installation prefix, if necessary.
3901 if $test X"$prefix" != X"$installprefix"; then
3902 eval "install${prefixvar}=\`echo \$${prefixvar}exp | sed \"s#^\$prefixexp#\$installprefixexp#\"\`"
3904 eval "install${prefixvar}=\"\$${prefixvar}exp\""
3907 chmod +x installprefix
3908 $eunicefix installprefix
3910 : Set variables such as privlib and privlibexp from the output of ./getfile
3911 : performing the prefixexp/installprefixexp correction if necessary.
3912 cat <<EOS >setprefixvar
3915 cat <<'EOSC' >>setprefixvar
3916 eval "${prefixvar}=\"\$ans\""
3917 eval "${prefixvar}exp=\"\$ansexp\""
3920 chmod +x setprefixvar
3921 $eunicefix setprefixvar
3923 : set up the script used to warn in case of inconsistency
3930 echo "*** WHOA THERE!!! ***" >&4
3931 echo " The $hint value for \$$var on this machine was \"$was\"!" >&4
3932 rp=" Keep the $hint value?"
3935 y) td=$was; tu=$was;;
3939 : function used to set $1 to $val
3940 setvar='var=$1; eval "was=\$$1"; td=$define; tu=$undef;
3942 $define$undef) . ./whoa; eval "$var=\$td";;
3943 $undef$define) . ./whoa; eval "$var=\$tu";;
3944 *) eval "$var=$val";;
3948 $define|true|[yY]*) dflt='y';;
3953 Perl can be built to use the SOCKS proxy protocol library. To do so,
3954 Configure must be run with -Dusesocks. If you use SOCKS you also need
3955 to use the PerlIO abstraction layer, this will be implicitly selected.
3957 If this doesn't make any sense to you, just accept the default '$dflt'.
3959 rp='Build Perl for SOCKS?'
3962 y|Y) val="$define" ;;
3969 $define|true|[yY]*) useperlio="$define";;
3972 case "$useperlio" in
3973 $define|true|[yY]*|'') dflt='y';;
3978 Previous version of $package used the standard IO mechanisms as
3979 defined in <stdio.h>. Versions 5.003_02 and later of $package allow
3980 alternate IO mechanisms via the PerlIO abstraction layer, but the
3981 stdio mechanism is still available if needed. The abstraction layer
3982 can use AT&T's sfio (if you already have sfio installed) or regular stdio.
3983 Using PerlIO with sfio may cause problems with some extension modules.
3985 If this doesn't make any sense to you, just accept the default '$dflt'.
3987 rp='Use the PerlIO abstraction layer?'
3994 echo "Ok, doing things the stdio way."
4003 case "$useperlio" in
4004 $define|true|[yY]*) ;;
4007 You are using the SOCKS proxy protocol library which means that you
4008 should also use the PerlIO layer. You may be headed for trouble.
4017 case "$usethreads" in
4018 $define|true|[yY]*) dflt='y';;
4019 *) # Catch case where user specified ithreads or 5005threads but
4020 # forgot -Dusethreads (A.D. 4/2002)
4021 case "$useithreads$use5005threads" in
4023 case "$useperlio" in
4024 "$define") dflt='y' ;;
4034 Perl can be built to take advantage of threads on some systems.
4035 To do so, Configure can be run with -Dusethreads.
4037 Note that Perl built with threading support runs slightly slower
4038 and uses more memory than plain Perl. The current implementation
4039 is believed to be stable, but it is fairly new, and so should be
4040 treated with caution.
4042 If this doesn't make any sense to you, just accept the default '$dflt'.
4044 rp='Build a threading Perl?'
4047 y|Y) val="$define" ;;
4053 case "$usethreads" in
4057 Since release 5.6, Perl has had two different threading implementations,
4058 the newer interpreter-based version (ithreads) with one interpreter per
4059 thread, and the older 5.005 version (5005threads).
4060 The 5005threads version is effectively unmaintained and will probably be
4061 removed in Perl 5.10, so there should be no need to build a Perl using it
4062 unless needed for backwards compatibility with some existing 5.005threads
4066 : Default to ithreads unless overridden on command line or with
4069 case "$use5005threads" in
4070 $define|true|[yY]*) dflt='n';;
4072 case "$useithreads" in
4073 $undef|false|[nN]*) dflt='n';;
4075 rp='Use the newer interpreter-based ithreads?'
4078 y|Y) val="$define" ;;
4083 : Now set use5005threads to the opposite value.
4084 case "$useithreads" in
4085 $define) val="$undef" ;;
4092 useithreads="$undef"
4093 use5005threads="$undef"
4097 case "$useithreads$use5005threads" in
4101 You cannot have both the ithreads and the 5.005 threads enabled
4102 at the same time. Disabling the 5.005 threads since they are
4103 much less stable than the ithreads.
4106 use5005threads="$undef"
4110 if test X"$usethreads" = "X$define" -a "X$useperlio" = "Xundef"; then
4113 *** To build with ithreads you must also use the PerlIO layer.
4114 *** Cannot continue, aborting.
4120 case "$d_oldpthreads" in
4121 '') : Configure tests would be welcome here. For now, assume undef.
4123 *) val="$d_oldpthreads" ;;
4129 : Look for a hint-file generated 'call-back-unit'. If the
4130 : user has specified that a threading perl is to be built,
4131 : we may need to set or change some other defaults.
4132 if $test -f usethreads.cbu; then
4133 echo "Your platform has some specific hints regarding threaded builds, using them..."
4136 case "$usethreads" in
4137 "$define"|true|[yY]*)
4139 (Your platform does not have any specific hints for threaded builds.
4140 Assuming POSIX threads, then.)
4148 Perl can be built so that multiple Perl interpreters can coexist
4149 within the same Perl executable.
4152 case "$useithreads" in
4155 This multiple interpreter support is required for interpreter-based threads.
4159 *) case "$usemultiplicity" in
4160 $define|true|[yY]*) dflt='y';;
4164 echo "If this doesn't make any sense to you, just accept the default '$dflt'."
4165 rp='Build Perl for multiplicity?'
4168 y|Y) val="$define" ;;
4177 case "$usemorebits" in
4178 "$define"|true|[yY]*)
4179 use64bitint="$define"
4180 uselongdouble="$define"
4181 usemorebits="$define"
4183 *) usemorebits="$undef"
4187 : make some quick guesses about what we are up against
4189 $echo $n "Hmm... $c"
4199 $cat /usr/include/signal.h /usr/include/sys/signal.h >foo 2>/dev/null
4200 if test -f /osf_boot || $contains 'OSF/1' /usr/include/ctype.h >/dev/null 2>&1
4202 echo "Looks kind of like an OSF/1 system, but we'll see..."
4204 elif test `echo abc | $tr a-z A-Z` = Abc ; then
4205 xxx=`./loc addbib blurfl $pth`
4206 if $test -f $xxx; then
4207 echo "Looks kind of like a USG system with BSD features, but we'll see..."
4211 if $contains SIGTSTP foo >/dev/null 2>&1 ; then
4212 echo "Looks kind of like an extended USG system, but we'll see..."
4214 echo "Looks kind of like a USG system, but we'll see..."
4218 elif $contains SIGTSTP foo >/dev/null 2>&1 ; then
4219 echo "Looks kind of like a BSD system, but we'll see..."
4223 echo "Looks kind of like a Version 7 system, but we'll see..."
4226 case "$eunicefix" in
4229 There is, however, a strange, musty smell in the air that reminds me of
4230 something...hmm...yes...I've got it...there's a VMS nearby, or I'm a Blit.
4234 : it so happens the Eunice I know will not run shell scripts in Unix format
4238 echo "Congratulations. You aren't running Eunice."
4242 : Detect OS2. The p_ variable is set above in the Head.U unit.
4243 : Note that this also -- wrongly -- detects e.g. dos-djgpp, which also uses
4244 : semicolon as a patch separator
4249 I have the feeling something is not exactly right, however...don't tell me...
4250 lemme think...does HAL ring a bell?...no, of course, you're only running OS/2!
4251 (Or you may be running DOS with DJGPP.)
4256 if test -f /xenix; then
4257 echo "Actually, this looks more like a XENIX system..."
4262 echo "It's not Xenix..."
4267 if test -f /venix; then
4268 echo "Actually, this looks more like a VENIX system..."
4275 echo "Nor is it Venix..."
4278 chmod +x bsd usg v7 osf1 eunice xenix venix os2
4279 $eunicefix bsd usg v7 osf1 eunice xenix venix os2
4286 rp="Use which C compiler?"
4290 : See if they have not cc but they do have gcc
4292 : Look for a hint-file generated 'call-back-unit'. Now that the
4293 : user has specified the compiler, we may need to set or change some
4295 if $test -f cc.cbu; then
4301 echo "Checking for GNU cc in disguise and/or its version number..." >&4
4307 printf("%s\n", __VERSION__);
4309 printf("%s\n", "1");
4315 if $cc -o try $ccflags $ldflags try.c; then
4316 gccversion=`$run ./try`
4317 case "$gccversion" in
4318 '') echo "You are not using GNU cc." ;;
4319 *) echo "You are using GNU cc $gccversion."
4325 echo "*** WHOA THERE!!! ***" >&4
4326 echo " Your C compiler \"$cc\" doesn't seem to be working!" >&4
4327 case "$knowitall" in
4329 echo " You'd better start hunting for one and let me know about it." >&4
4335 case "$gccversion" in
4336 1*) cpp=`./loc gcc-cpp $cpp $pth` ;;
4338 case "$gccversion" in
4339 '') gccosandvers='' ;;
4340 *) gccshortvers=`echo "$gccversion"|sed 's/ .*//'`
4341 gccosandvers=`$cc -v 2>&1|grep '/specs$'|sed "s!.*/[^-/]*-[^-/]*-\([^-/]*\)/$gccshortvers/specs!\1!"`
4343 case "$gccosandvers" in
4344 $osname) gccosandvers='' ;; # linux gccs seem to have no linux osvers, grr
4345 $osname$osvers) ;; # looking good
4346 $osname*) cat <<EOM >&4
4348 *** WHOA THERE!!! ***
4350 Your gcc has not been compiled for the exact release of
4351 your operating system ($gccosandvers versus $osname$osvers).
4353 In general it is a good idea to keep gcc synchronized with
4354 the operating system because otherwise serious problems
4355 may ensue when trying to compile software, like Perl.
4357 I'm trying to be optimistic here, though, and will continue.
4358 If later during the configuration and build icky compilation
4359 problems appear (headerfile conflicts being the most common
4360 manifestation), I suggest reinstalling the gcc to match
4361 your operating system release.
4365 *) gccosandvers='' ;; # failed to parse, better be silent
4373 # gcc 3.* complain about adding -Idirectories that they already know about,
4374 # so we will take those off from locincpth.
4375 case "$gccversion" in
4377 echo "main(){}">try.c
4378 for incdir in $locincpth; do
4379 warn=`$cc $ccflags -I$incdir -c try.c 2>&1 | \
4380 grep '^c[cp]p*[01]: warning: changing search order '`
4381 if test "X$warn" != X; then
4382 locincpth=`echo " $locincpth " | sed "s! $incdir ! !"`
4388 : What should the include directory be ?
4390 $echo $n "Hmm... $c"
4394 if $test -f /bin/mips && /bin/mips; then
4395 echo "Looks like a MIPS system..."
4396 $cat >usr.c <<'EOCP'
4397 #ifdef SYSTYPE_BSD43
4401 if cc -E usr.c > usr.out && $contains / usr.out >/dev/null 2>&1; then
4402 dflt='/bsd43/usr/include'
4406 mips_type='System V'
4408 $rm -f usr.c usr.out
4409 echo "and you're compiling with the $mips_type compiler and libraries."
4413 echo "Doesn't look like a MIPS system."
4423 case "$xxx_prompt" in
4426 rp='Where are the include files you want to use?'
4434 : see how we invoke the C preprocessor
4436 echo "Now, how can we feed standard input to your C preprocessor..." >&4
4437 cat <<'EOT' >testcpp.c
4443 if test ! -f cppstdin; then
4444 if test "X$osname" = "Xaix" -a "X$gccversion" = X; then
4445 # AIX cc -E doesn't show the absolute headerfile
4446 # locations but we'll cheat by using the -M flag.
4447 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
4449 echo 'cat >.$$.c; '"$cc"' -E ${1+"$@"} .$$.c; rm .$$.c' >cppstdin
4452 echo "Keeping your $hint cppstdin wrapper."
4455 wrapper=`pwd`/cppstdin
4459 if $test "X$cppstdin" != "X" && \
4460 $cppstdin $cppminus <testcpp.c >testcpp.out 2>&1 && \
4461 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
4463 echo "You used to use $cppstdin $cppminus so we'll use that again."
4465 '') echo "But let's see if we can live without a wrapper..." ;;
4467 if $cpprun $cpplast <testcpp.c >testcpp.out 2>&1 && \
4468 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
4470 echo "(And we'll use $cpprun $cpplast to preprocess directly.)"
4473 echo "(However, $cpprun $cpplast does not work, let's see...)"
4481 echo "Good old $cppstdin $cppminus does not seem to be of any help..."
4488 elif echo 'Maybe "'"$cc"' -E" will work...'; \
4489 $cc -E <testcpp.c >testcpp.out 2>&1; \
4490 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4491 echo "Yup, it does."
4494 elif echo 'Nope...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"' -P" will work...'; \
4501 $cc -P <testcpp.c >testcpp.out 2>&1; \
4502 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4503 echo "Yipee, that works!"
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 "At long last!"
4512 elif echo 'No such luck, maybe "'$cpp'" will work...'; \
4513 $cpp <testcpp.c >testcpp.out 2>&1; \
4514 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4518 elif echo 'Nixed again...maybe "'$cpp' -" will work...'; \
4519 $cpp - <testcpp.c >testcpp.out 2>&1; \
4520 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4521 echo "Hooray, it works! I was beginning to wonder."
4524 elif echo 'Uh-uh. Time to get fancy. Trying a wrapper...'; \
4525 $wrapper <testcpp.c >testcpp.out 2>&1; \
4526 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4532 rp="No dice. I can't find a C preprocessor. Name one:"
4536 $x_cpp <testcpp.c >testcpp.out 2>&1
4537 if $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4538 echo "OK, that will do." >&4
4540 echo "Sorry, I can't get that to work. Go find one and rerun Configure." >&4
4555 echo "Perhaps can we force $cc -E using a wrapper..."
4556 if $wrapper <testcpp.c >testcpp.out 2>&1; \
4557 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
4563 echo "Nope, we'll have to live without it..."
4577 "$wrapper"|'cppstdin') ;;
4578 *) $rm -f $wrapper;;
4580 $rm -f testcpp.c testcpp.out
4582 : Set private lib path
4585 plibpth="$incpath/usr/lib /usr/local/lib /usr/ccs/lib"
4590 '') dlist="$loclibpth $plibpth $glibpth";;
4591 *) dlist="$libpth";;
4594 : Now check and see which directories actually exist, avoiding duplicates
4598 if $test -d $xxx; then
4601 *) libpth="$libpth $xxx";;
4607 Some systems have incompatible or broken versions of libraries. Among
4608 the directories listed in the question below, please remove any you
4609 know not to be holding relevant libraries, and add any that are needed.
4610 Say "none" for none.
4621 rp="Directories to use for library searches?"
4628 : compute shared library extension
4631 if xxx=`./loc libc.sl X $libpth`; $test -f "$xxx"; then
4641 On some systems, shared libraries may be available. Answer 'none' if
4642 you want to suppress searching of shared libraries for the remainder
4643 of this configuration.
4646 rp='What is the file extension used for shared libraries?'
4650 : Define several unixisms.
4651 : Hints files or command line option can be used to override them.
4652 : The convoluted testing is in case hints files set either the old
4655 '') case "$exe_ext" in
4657 *) _exe="$exe_ext" ;;
4662 '') case "$lib_ext" in
4669 '') case "$obj_ext" in
4676 '') case "$path_sep" in
4687 : Which makefile gets called first. This is used by make depend.
4688 case "$firstmakefile" in
4689 '') firstmakefile='makefile';;
4693 *-DUSE_LONG_DOUBLE*|*-DUSE_MORE_BITS*) uselongdouble="$define" ;;
4696 case "$uselongdouble" in
4697 $define|true|[yY]*) dflt='y';;
4702 Perl can be built to take advantage of long doubles which
4703 (if available) may give more accuracy and range for floating point numbers.
4705 If this doesn't make any sense to you, just accept the default '$dflt'.
4707 rp='Try to use long doubles if available?'
4710 y|Y) val="$define" ;;
4716 case "$uselongdouble" in
4717 true|[yY]*) uselongdouble="$define" ;;
4720 : Look for a hint-file generated 'call-back-unit'. If the
4721 : user has specified that long doubles should be used,
4722 : we may need to set or change some other defaults.
4723 if $test -f uselongdouble.cbu; then
4724 echo "Your platform has some specific hints regarding long doubles, using them..."
4725 . ./uselongdouble.cbu
4727 case "$uselongdouble" in
4730 (Your platform does not have any specific hints for long doubles.)
4736 : Looking for optional libraries
4738 echo "Checking for optional libraries..." >&4
4743 case "$libswanted" in
4744 '') libswanted='c_s';;
4747 "$define") libswanted="$libswanted socks5 socks5_sh" ;;
4753 for thisdir in $libpth $xlibpth; do
4754 test -d $thisdir && libspath="$libspath $thisdir"
4756 for thislib in $libswanted; do
4757 for thisdir in $libspath; do
4759 if $test ! -f "$xxx" -a "X$ignore_versioned_solibs" = "X"; then
4760 xxx=`ls $thisdir/lib$thislib.$so.[0-9] 2>/dev/null|sed -n '$p'`
4761 $test -f "$xxx" && eval $libscheck
4762 $test -f "$xxx" && libstyle=shared
4764 if test ! -f "$xxx"; then
4765 xxx=$thisdir/lib$thislib.$so
4766 $test -f "$xxx" && eval $libscheck
4767 $test -f "$xxx" && libstyle=shared
4769 if test ! -f "$xxx"; then
4770 xxx=$thisdir/lib$thislib$_a
4771 $test -f "$xxx" && eval $libscheck
4772 $test -f "$xxx" && libstyle=static
4774 if test ! -f "$xxx"; then
4775 xxx=$thisdir/$thislib$_a
4776 $test -f "$xxx" && eval $libscheck
4777 $test -f "$xxx" && libstyle=static
4779 if test ! -f "$xxx"; then
4780 xxx=$thisdir/lib${thislib}_s$_a
4781 $test -f "$xxx" && eval $libscheck
4782 $test -f "$xxx" && libstyle=static
4783 $test -f "$xxx" && thislib=${thislib}_s
4785 if test ! -f "$xxx"; then
4786 xxx=$thisdir/Slib$thislib$_a
4787 $test -f "$xxx" && eval $libscheck
4788 $test -f "$xxx" && libstyle=static
4790 if $test -f "$xxx"; then
4792 shared) echo "Found -l$thislib (shared)." ;;
4793 static) echo "Found -l$thislib." ;;
4794 *) echo "Found -l$thislib ($libstyle)." ;;
4798 *) dflt="$dflt -l$thislib"
4799 libsfound="$libsfound $xxx"
4801 libsfiles="$libsfiles $yyy"
4802 yyy=`echo $xxx|$sed -e "s%/$yyy\\$%%"`
4803 case " $libsdirs " in
4805 *) libsdirs="$libsdirs $yyy" ;;
4812 if $test ! -f "$xxx"; then
4813 echo "No -l$thislib."
4824 ' '|'') dflt='none';;
4829 In order to compile $package on your machine, a number of libraries
4830 are usually needed. Include any other special libraries here as well.
4831 Say "none" for none. The default list is almost always right.
4835 rp="What libraries to use?"
4842 : determine optimization, if desired, or use for debug flag also
4844 ' '|$undef) dflt='none';;
4846 *) dflt="$optimize";;
4850 By default, $package compiles with the -O flag to use the optimizer.
4851 Alternately, you might want to use the symbolic debugger, which uses
4852 the -g flag (on traditional Unix systems). Either flag can be
4853 specified here. To use neither flag, specify the word "none".
4856 rp="What optimizer/debugger flag should be used?"
4860 'none') optimize=" ";;
4863 : Check what DEBUGGING is required from the command line
4864 : -DEBUGGING or -DDEBUGGING or
4865 : -DEBUGGING=both = -g + -DDEBUGGING
4866 : -DEBUGGING=-g or -Doptimize=-g = -g
4867 : -DEBUGGING=none or -UDEBUGGING =
4868 : -DEBUGGING=old or -DEBUGGING=default = ? $optimize
4871 *) DEBUGGING=$EBUGGING ;;
4874 case "$DEBUGGING" in
4878 *) optimize="$optimize -g" ;;
4882 *-g*) set `echo "X $optimize " | sed 's/ -g / /'`
4890 case "$DEBUGGING" in
4891 both|$define) dflt='-DDEBUGGING'
4894 : We will not override a previous value, but we might want to
4895 : augment a hint file
4897 default|recommended)
4898 case "$gccversion" in
4899 1*) dflt="$dflt -fpcc-struct-return" ;;
4901 case "$optimize:$DEBUGGING" in
4902 *-g*:old) dflt="$dflt -DDEBUGGING";;
4904 case "$gccversion" in
4905 2*) if test -d /etc/conf/kconfig.d &&
4906 $contains _POSIX_VERSION $usrinc/sys/unistd.h >/dev/null 2>&1
4908 # Interactive Systems (ISC) POSIX mode.
4913 case "$gccversion" in
4917 echo "Checking if your compiler accepts -fno-strict-aliasing" 2>&1
4918 echo 'int main(void) { return 0; }' > gcctest.c
4919 if $cc -O2 -fno-strict-aliasing -o gcctest gcctest.c; then
4920 echo "Yes, it does." 2>&1
4923 echo "Leaving current flags $ccflags alone." 2>&1
4925 *) dflt="$dflt -fno-strict-aliasing" ;;
4928 echo "Nope, it doesn't, but that's ok." 2>&1
4932 # For gcc, adding -pipe speeds up compilations for some, but apparently
4933 # some assemblers can't read from stdin. (It also slows down compilations
4934 # in other cases, but those are apparently rarer these days.) AD 5/2004.
4935 case "$gccversion" in
4937 echo "Checking if your compiler accepts -pipe" 2>&1
4938 echo 'int main(void) { return 0; }' > gcctest.c
4939 if $cc -pipe -o gcctest gcctest.c; then
4940 echo "Yes, it does." 2>&1
4943 echo "Leaving current flags $ccflags alone." 2>&1
4945 *) dflt="$dflt -pipe" ;;
4948 echo "Nope, it doesn't, but that's ok." 2>&1
4951 echo "Checking if your compiler accepts -Wdeclaration-after-statement" 2>&1
4952 echo 'int main(void) { return 0; }' > gcctest.c
4953 if $cc -Wdeclaration-after-statement -o gcctest gcctest.c; then
4954 echo "Yes, it does." 2>&1
4956 *-Wdeclaration-after-statement*)
4957 echo "Leaving current flags $ccflags alone." 2>&1
4959 *) dflt="$dflt -Wdeclaration-after-statement" ;;
4962 echo "Nope, it doesn't, but that's ok." 2>&1
4969 case "$mips_type" in
4970 *BSD*|'') inclwanted="$locincpth $usrinc";;
4971 *) inclwanted="$locincpth $inclwanted $usrinc/bsd";;
4973 for thisincl in $inclwanted; do
4974 if $test -d $thisincl; then
4975 if $test x$thisincl != x$usrinc; then
4977 *" -I$thisincl "*);;
4978 *) dflt="$dflt -I$thisincl ";;
4984 inctest='if $contains $2 $usrinc/$1 >/dev/null 2>&1; then
4986 elif $contains $2 $usrinc/sys/$1 >/dev/null 2>&1; then
4994 *) dflt="$dflt -D$2";;
4998 set signal.h LANGUAGE_C; eval $inctest
5002 ccflags="$ccflags -DSOCKS"
5007 default|recommended) dflt="$ccflags $dflt" ;;
5008 *) dflt="$ccflags";;
5017 Your C compiler may want other flags. For this question you should include
5018 -I/whatever and -DWHATEVER flags and any other flags used by the C compiler,
5019 but you should NOT include libraries or ld flags like -lwhatever. If you
5020 want $package to honor its debug switch, you should include -DDEBUGGING here.
5021 Your C compiler might also need additional flags, such as -D_POSIX_SOURCE.
5023 To use no flags, specify the word "none".
5029 rp="Any additional cc flags?"
5036 : the following weeds options from ccflags that are of no interest to cpp
5038 '') cppflags="$ccflags" ;;
5039 *) cppflags="$cppflags $ccflags" ;;
5041 case "$gccversion" in
5042 1*) cppflags="$cppflags -D__GNUC__"
5044 case "$mips_type" in
5046 *BSD*) cppflags="$cppflags -DSYSTYPE_BSD43";;
5052 echo "Let me guess what the preprocessor flags are..." >&4
5066 *) ftry="$previous $flag";;
5068 if $cppstdin -DLFRULB=bar $cppflags $ftry $cppminus <cpp.c \
5069 >cpp1.out 2>/dev/null && \
5070 $cpprun -DLFRULB=bar $cppflags $ftry $cpplast <cpp.c \
5071 >cpp2.out 2>/dev/null && \
5072 $contains 'foo.*xx.*bar' cpp1.out >/dev/null 2>&1 && \
5073 $contains 'foo.*xx.*bar' cpp2.out >/dev/null 2>&1
5075 cppflags="$cppflags $ftry"
5085 *-*) echo "They appear to be: $cppflags";;
5087 $rm -f cpp.c cpp?.out
5091 : flags used in final linking phase
5093 '') if ./venix; then
5099 *-posix*) dflt="$dflt -posix" ;;
5102 *) dflt="$ldflags";;
5105 : Try to guess additional flags to pick up local libraries.
5106 for thislibdir in $libpth; do
5107 case " $loclibpth " in
5110 *"-L$thislibdir "*) ;;
5111 *) dflt="$dflt -L$thislibdir" ;;
5123 Your C linker may need flags. For this question you should
5124 include -L/whatever and any other flags used by the C linker, but you
5125 should NOT include libraries like -lwhatever.
5127 Make sure you include the appropriate -L/path flags if your C linker
5128 does not normally search all of the directories you specified above,
5131 To use no flags, specify the word "none".
5135 rp="Any additional ld flags (NOT including libraries)?"
5141 rmlist="$rmlist pdp11"
5145 echo "Checking your choice of C compiler and flags for coherency..." >&4
5146 $cat > try.c <<'EOF'
5148 int main() { printf("Ok\n"); return(0); }
5150 set X $cc -o try $optimize $ccflags $ldflags try.c $libs
5152 $cat >try.msg <<'EOM'
5153 I've tried to compile and run the following simple program:
5156 $cat try.c >> try.msg
5158 $cat >> try.msg <<EOM
5165 and I got the following output:
5169 if $sh -c "$cc -o try $optimize $ccflags $ldflags try.c $libs" >>try.msg 2>&1; then
5170 if $sh -c "$run ./try" >>try.msg 2>&1; then
5174 *) echo 'The program compiled OK, but produced no output.' >> try.msg
5177 cat >> try.msg <<'EOQS'
5178 If $libs contains -lsfio, and sfio is mis-configured, then it
5179 sometimes (apparently) runs and exits with a 0 status, but with no
5180 output! It may have to do with sfio's use of _exit vs. exit.
5183 rp="You have a big problem. Shall I abort Configure"
5190 echo "The program compiled OK, but exited with status $?." >>try.msg
5191 rp="You have a problem. Shall I abort Configure"
5195 echo "I can't compile the test program." >>try.msg
5196 rp="You have a BIG problem. Shall I abort Configure"
5202 case "$knowitall" in
5204 echo "(The supplied flags or libraries might be incorrect.)"
5212 *) echo "Ok. Stopping Configure." >&4
5217 n) echo "OK, that should do.";;
5219 $rm -f try try.* core
5221 : define a shorthand compile call
5225 $cc -o ${mc_file} $optimize $ccflags $ldflags $* ${mc_file}.c $libs > /dev/null 2>&1;'
5226 : define a shorthand compile call for compilations that should be ok.
5230 $cc -o ${mc_file} $optimize $ccflags $ldflags $* ${mc_file}.c $libs;'
5232 : determine filename position in cpp output
5234 echo "Computing filename position in cpp output for #include directives..." >&4
5236 vos) testaccess=-e ;;
5239 echo '#include <stdio.h>' > foo.c
5242 $cppstdin $cppflags $cppminus <foo.c 2>/dev/null | \
5243 $grep '^[ ]*#.*stdio\.h' | \
5244 while read cline; do
5247 while $test \$# -gt 0; do
5248 if $test $testaccess \`echo \$1 | $tr -d '"'\`; then
5253 pos=\`expr \$pos + 1\`
5265 *) pos="${fieldn}th";;
5267 echo "Your cpp writes the filename in the $pos field of the line."
5270 vos) cppfilter="tr '\\\\>' '/' |" ;; # path component separator is >
5271 os2) cppfilter="sed -e 's|\\\\\\\\|/|g' |" ;; # path component separator is \
5274 : locate header file
5279 for usrincdir in $usrinc
5281 if test -f \$usrincdir/\$wanted; then
5282 echo "\$usrincdir/\$wanted"
5286 awkprg='{ print \$$fieldn }'
5287 echo "#include <\$wanted>" > foo\$\$.c
5288 $cppstdin $cppminus $cppflags < foo\$\$.c 2>/dev/null | \
5289 $cppfilter $grep "^[ ]*#.*\$wanted" | \
5290 while read cline; do
5291 name=\`echo \$cline | $awk "\$awkprg" | $tr -d '"'\`
5293 *[/\\\\]\$wanted) echo "\$name"; exit 1;;
5294 *[\\\\/]\$wanted) echo "\$name"; exit 1;;
5299 # status = 0: grep returned 0 lines, case statement not executed
5300 # status = 1: headerfile found
5301 # status = 2: while loop executed, no headerfile found
5305 if test \$status -eq 1; then
5312 : define an alternate in-header-list? function
5313 inhdr='echo " "; td=$define; tu=$undef; yyy=$@;
5314 cont=true; xxf="echo \"<\$1> found.\" >&4";
5315 case $# in 2) xxnf="echo \"<\$1> NOT found.\" >&4";;
5316 *) xxnf="echo \"<\$1> NOT found, ...\" >&4";;
5318 case $# in 4) instead=instead;; *) instead="at last";; esac;
5319 while $test "$cont"; do
5321 var=$2; eval "was=\$$2";
5322 if $test "$xxx" && $test -r "$xxx";
5324 eval "case \"\$$var\" in $undef) . ./whoa; esac"; eval "$var=\$td";
5327 eval "case \"\$$var\" in $define) . ./whoa; esac"; eval "$var=\$tu"; fi;
5328 set $yyy; shift; shift; yyy=$@;
5329 case $# in 0) cont="";;
5330 2) xxf="echo \"but I found <\$1> $instead.\" >&4";
5331 xxnf="echo \"and I did not find <\$1> either.\" >&4";;
5332 *) xxf="echo \"but I found <\$1\> instead.\" >&4";
5333 xxnf="echo \"there is no <\$1>, ...\" >&4";;
5337 do set $yyy; var=$2; eval "was=\$$2";
5338 eval "case \"\$$var\" in $define) . ./whoa; esac"; eval "$var=\$tu";
5339 set $yyy; shift; shift; yyy=$@;
5342 : see if stdlib is available
5343 set stdlib.h i_stdlib
5346 : check for lengths of integral types
5350 echo "Checking to see how big your integers are..." >&4
5359 printf("intsize=%d;\n", (int)sizeof(int));
5360 printf("longsize=%d;\n", (int)sizeof(long));
5361 printf("shortsize=%d;\n", (int)sizeof(short));
5366 if eval $compile_ok && $run ./try > /dev/null; then
5368 echo "Your integers are $intsize bytes long."
5369 echo "Your long integers are $longsize bytes long."
5370 echo "Your short integers are $shortsize bytes long."
5374 Help! I can't compile and run the intsize test program: please enlighten me!
5375 (This is probably a misconfiguration in your system or libraries, and
5376 you really ought to fix it. Still, I'll try anyway.)
5380 rp="What is the size of an integer (in bytes)?"
5384 rp="What is the size of a long integer (in bytes)?"
5388 rp="What is the size of a short integer (in bytes)?"
5396 : check for long long
5398 echo "Checking to see if you have long long..." >&4
5399 echo 'int main() { long long x = 7; return 0; }' > try.c
5401 if eval $compile; then
5403 echo "You have long long."
5406 echo "You do not have long long."
5412 : check for length of long long
5413 case "${d_longlong}${longlongsize}" in
5416 echo "Checking to see how big your long longs are..." >&4
5417 $cat >try.c <<'EOCP'
5421 printf("%d\n", (int)sizeof(long long));
5426 if eval $compile_ok; then
5427 longlongsize=`$run ./try`
5428 echo "Your long longs are $longlongsize bytes long."
5432 echo "(I can't seem to compile the test program. Guessing...)"
5433 rp="What is the size of a long long (in bytes)?"
5437 if $test "X$longsize" = "X$longlongsize"; then
5438 echo "(That isn't any different from an ordinary long.)"
5444 : see if inttypes.h is available
5445 : we want a real compile instead of Inhdr because some systems
5446 : have an inttypes.h which includes non-existent headers
5449 #include <inttypes.h>
5451 static int32_t foo32 = 0x12345678;
5455 if eval $compile; then
5456 echo "<inttypes.h> found." >&4
5459 echo "<inttypes.h> NOT found." >&4
5468 echo "Checking to see if you have int64_t..." >&4
5470 #include <sys/types.h>
5471 #$i_inttypes I_INTTYPES
5473 #include <inttypes.h>
5475 int main() { int64_t x = 7; }
5478 if eval $compile; then
5480 echo "You have int64_t."
5483 echo "You do not have int64_t."
5491 echo "Checking which 64-bit integer type we could use..." >&4
5497 val='"unsigned int"'
5502 *) case "$longsize" in
5506 val='"unsigned long"'
5511 *) case "$d_longlong:$longlongsize" in
5516 val='"unsigned long long"'
5521 *) case "$d_int64_t" in
5540 '') echo "Alas, no 64-bit integer types in sight." >&4
5543 *) echo "We could use '$quadtype' for 64-bit integers." >&4
5549 case "$uselonglong" in
5550 "$define"|true|[yY]*)
5553 *** Configure -Duselonglong is deprecated, using -Duse64bitint instead.
5555 use64bitint="$define"
5558 case "$use64bits" in
5559 "$define"|true|[yY]*)
5562 *** Configure -Duse64bits is deprecated, using -Duse64bitint instead.
5564 use64bitint="$define"
5567 case "$use64bitints" in
5568 "$define"|true|[yY]*)
5571 *** There is no Configure -Duse64bitints, using -Duse64bitint instead.
5573 use64bitint="$define"
5576 case "$use64bitsint" in
5577 "$define"|true|[yY]*)
5580 *** There is no Configure -Duse64bitsint, using -Duse64bitint instead.
5582 use64bitint="$define"
5585 case "$uselonglongs" in
5586 "$define"|true|[yY]*)
5589 *** There is no Configure -Duselonglongs, using -Duse64bitint instead.
5591 use64bitint="$define"
5594 case "$use64bitsall" in
5595 "$define"|true|[yY]*)
5598 *** There is no Configure -Duse64bitsall, using -Duse64bitall instead.
5600 use64bitall="$define"
5605 *-DUSE_LONG_LONG*|*-DUSE_64_BIT_INT*|*-DUSE_64_BIT_ALL*) use64bitint="$define";;
5607 case "$use64bitall" in
5608 "$define"|true|[yY]*) use64bitint="$define" ;;
5614 You have natively 64-bit long integers.
5618 *) case "$use64bitint" in
5619 "$define"|true|[yY]*) dflt='y';;
5628 Perl can be built to take advantage of 64-bit integer types
5629 on some systems. To do so, Configure can be run with -Duse64bitint.
5630 Choosing this option will most probably introduce binary incompatibilities.
5632 If this doesn't make any sense to you, just accept the default '$dflt'.
5633 (The default has been chosen based on your configuration.)
5635 rp='Try to use 64-bit integers, if available?'
5638 [yY]*) val="$define" ;;
5646 case "$use64bitall" in
5647 "$define"|true|[yY]*) dflt='y' ;;
5648 *) case "$longsize" in
5656 You may also choose to try maximal 64-bitness. It means using as much
5657 64-bitness as possible on the platform. This in turn means even more
5658 binary incompatibilities. On the other hand, your platform may not
5659 have any more 64-bitness available than what you already have chosen.
5661 If this doesn't make any sense to you, just accept the default '$dflt'.
5662 (The default has been chosen based on your configuration.)
5664 rp='Try to use maximal 64-bit support, if available?'
5667 [yY]*) val="$define" ;;
5672 case "$use64bitall" in
5674 case "$use64bitint" in
5678 Since you have chosen a maximally 64-bit build, I'm also turning on
5679 the use of 64-bit integers.
5681 use64bitint="$define" ;;
5686 : Look for a hint-file generated 'call-back-unit'. If the
5687 : user has specified that a 64-bit perl is to be built,
5688 : we may need to set or change some other defaults.
5689 if $test -f use64bitint.cbu; then
5690 echo "Your platform has some specific hints regarding 64-bit integers, using them..."
5693 case "$use64bitint" in
5694 "$define"|true|[yY]*)
5696 4) case "$archname64" in
5697 '') archname64=64int ;;
5704 : Look for a hint-file generated 'call-back-unit'. If the
5705 : user has specified that a maximally 64-bit perl is to be built,
5706 : we may need to set or change some other defaults.
5707 if $test -f use64bitall.cbu; then
5708 echo "Your platform has some specific hints regarding 64-bit builds, using them..."
5711 case "$use64bitall" in
5712 "$define"|true|[yY]*)
5714 4) case "$archname64" in
5715 ''|64int) archname64=64all ;;
5722 case "$d_quad:$use64bitint" in
5726 *** You have chosen to use 64-bit integers,
5727 *** but none can be found.
5728 *** Please rerun Configure without -Duse64bitint and/or -Dusemorebits.
5729 *** Cannot continue, aborting.
5736 : check for length of double
5738 case "$doublesize" in
5740 echo "Checking to see how big your double precision numbers are..." >&4
5749 printf("%d\n", (int)sizeof(double));
5754 if eval $compile_ok; then
5755 doublesize=`$run ./try`
5756 echo "Your double is $doublesize bytes long."
5759 echo "(I can't seem to compile the test program. Guessing...)"
5760 rp="What is the size of a double precision number (in bytes)?"
5768 : check for long doubles
5770 echo "Checking to see if you have long double..." >&4
5771 echo 'int main() { long double x = 7.0; }' > try.c
5773 if eval $compile; then
5775 echo "You have long double."
5778 echo "You do not have long double."
5784 : check for length of long double
5785 case "${d_longdbl}${longdblsize}" in
5788 echo "Checking to see how big your long doubles are..." >&4
5789 $cat >try.c <<'EOCP'
5793 printf("%d\n", sizeof(long double));
5798 if eval $compile; then
5799 longdblsize=`$run ./try`
5800 echo "Your long doubles are $longdblsize bytes long."
5804 echo "(I can't seem to compile the test program. Guessing...)" >&4
5805 rp="What is the size of a long double (in bytes)?"
5809 if $test "X$doublesize" = "X$longdblsize"; then
5810 echo "That isn't any different from an ordinary double."
5811 echo "I'll keep your setting anyway, but you may see some"
5812 echo "harmless compilation warnings."
5818 : determine the architecture name
5820 if xxx=`./loc arch blurfl $pth`; $test -f "$xxx"; then
5821 tarch=`arch`"-$osname"
5822 elif xxx=`./loc uname blurfl $pth`; $test -f "$xxx" ; then
5823 if uname -m > tmparch 2>&1 ; then
5824 tarch=`$sed -e 's/ *$//' -e 's/ /_/g' \
5825 -e 's/$/'"-$osname/" tmparch`
5833 case "$myarchname" in
5836 echo "(Your architecture name used to be $myarchname.)"
5840 case "$targetarch" in
5842 *) archname=`echo $targetarch|sed 's,^[^-]*-,,'` ;;
5847 *) dflt="$archname";;
5849 rp='What is your architecture name'
5852 case "$usethreads" in
5854 echo "Threads selected." >&4
5856 *-thread*) echo "...and architecture name already has -thread." >&4
5858 *) archname="$archname-thread"
5859 echo "...setting architecture name to $archname." >&4
5864 case "$usemultiplicity" in
5866 echo "Multiplicity selected." >&4
5868 *-multi*) echo "...and architecture name already has -multi." >&4
5870 *) archname="$archname-multi"
5871 echo "...setting architecture name to $archname." >&4
5876 case "$use64bitint$use64bitall" in
5878 case "$archname64" in
5880 echo "This architecture is naturally 64-bit, not changing architecture name." >&4
5883 case "$use64bitint" in
5884 "$define") echo "64 bit integers selected." >&4 ;;
5886 case "$use64bitall" in
5887 "$define") echo "Maximal 64 bitness selected." >&4 ;;
5890 *-$archname64*) echo "...and architecture name already has $archname64." >&4
5892 *) archname="$archname-$archname64"
5893 echo "...setting architecture name to $archname." >&4
5899 case "$uselongdouble" in
5901 echo "Long doubles selected." >&4
5902 case "$longdblsize" in
5904 echo "...but long doubles are equal to doubles, not changing architecture name." >&4
5908 *-ld*) echo "...and architecture name already has -ld." >&4
5910 *) archname="$archname-ld"
5911 echo "...setting architecture name to $archname." >&4
5918 case "$useperlio" in
5920 echo "Perlio selected." >&4
5923 echo "Perlio not selected, using stdio." >&4
5925 *-stdio*) echo "...and architecture name already has -stdio." >&4
5927 *) archname="$archname-stdio"
5928 echo "...setting architecture name to $archname." >&4
5933 if $test -f archname.cbu; then
5934 echo "Your platform has some specific hints for architecture name, using them..."
5938 : set the prefixit variable, to compute a suitable default value
5939 prefixit='case "$3" in
5941 case "$oldprefix" in
5942 "") eval "$1=\"\$$2\"";;
5949 ""|" ") eval "$1=\"\$$2\"";;
5955 eval "tp=\"$oldprefix-\$$2-\""; eval "tp=\"$tp\"";
5957 --|/*--|\~*--) eval "$1=\"$prefix/$3\"";;
5958 /*-$oldprefix/*|\~*-$oldprefix/*)
5959 eval "$1=\`echo \$$2 | sed \"s,^$oldprefix,$prefix,\"\`";;
5960 *) eval "$1=\"\$$2\"";;
5964 : get the patchlevel
5966 echo "Getting the current patchlevel..." >&4
5967 if $test -r $rsrc/patchlevel.h;then
5968 revision=`awk '/define[ ]+PERL_REVISION/ {print $3}' $rsrc/patchlevel.h`
5969 patchlevel=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
5970 subversion=`awk '/define[ ]+PERL_SUBVERSION/ {print $3}' $rsrc/patchlevel.h`
5971 api_revision=`awk '/define[ ]+PERL_API_REVISION/ {print $3}' $rsrc/patchlevel.h`
5972 api_version=`awk '/define[ ]+PERL_API_VERSION/ {print $3}' $rsrc/patchlevel.h`
5973 api_subversion=`awk '/define[ ]+PERL_API_SUBVERSION/ {print $3}' $rsrc/patchlevel.h`
5974 perl_patchlevel=`egrep 'define PERL_PATCHNUM [0-9][0-9]|,"MAINT[0-9][0-9]*"' $rsrc/patchlevel.h|sed 's/[^0-9]//g'`
5983 $echo "(You do not have patchlevel.h. Eek.)"
5985 if $test -r $rsrc/.patch ; then
5986 if $test "X$perl_patchlevel" = "X" || $test "`cat $rsrc/.patch`" -gt "$perl_patchlevel" ; then
5987 perl_patchlevel=`cat $rsrc/.patch`
5990 : Define a handy string here to avoid duplication in myconfig.SH and configpm.
5991 version_patchlevel_string="version $patchlevel subversion $subversion"
5992 case "$perl_patchlevel" in
5994 *) version_patchlevel_string="$version_patchlevel_string patch $perl_patchlevel" ;;
5997 $echo "(You have $package $version_patchlevel_string.)"
6001 : XXX Should be a Configure test for double-dots in filenames.
6002 version=`echo $revision $patchlevel $subversion | \
6003 $awk '{ printf "%d_%d_%d\n", $1, $2, $3 }'`
6004 api_versionstring=`echo $api_revision $api_version $api_subversion | \
6005 $awk '{ printf "%d_%d_%d\n", $1, $2, $3 }'`
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 : Special case the 5.005_xx maintenance series, which used 5.005
6015 : without any subversion label as a subdirectory in $sitelib
6016 if test "${api_revision}${api_version}${api_subversion}" = "550"; then
6017 api_versionstring='5.005'
6020 : determine installation style
6021 : For now, try to deduce it from prefix unless it is already set.
6022 : Reproduce behavior of 5.005 and earlier, maybe drop that in 5.7.
6023 case "$installstyle" in
6024 '') case "$prefix" in
6025 *perl*) dflt='lib';;
6026 *) dflt='lib/perl5' ;;
6029 *) dflt="$installstyle" ;;
6031 : Probably not worth prompting for this since we prompt for all
6032 : the directories individually, and the prompt would be too long and
6036 : determine where public executables go
6041 rp='Pathname where the public executables will reside?'
6043 if $test "X$ansexp" != "X$binexp"; then
6047 : XXX Bug? -- ignores Configure -Dinstallprefix setting.
6050 case "$userelocatableinc" in
6051 $define|true|[yY]*) dflt='y' ;;
6056 Would you like to build Perl so that the installation is relocatable, so that
6057 library paths in @INC are determined relative to the path of the perl binary?
6058 This is not advised for system Perl installs, or if you need to run setid
6059 scripts or scripts under taint mode.
6061 If this doesn't make any sense to you, just accept the default '$dflt'.
6063 rp='Use relocatable @INC?'
6066 y|Y) val="$define" ;;
6069 set userelocatableinc
6072 : Default prefix is now "up one level from where the binaries are"
6073 case "$userelocatableinc" in
6075 initialinstalllocation="$binexp"
6080 installprefixexp=".../.."
6084 : determine where private library files go
6085 : Usual default is /usr/local/lib/perl5/$version.
6086 : Also allow things like /opt/perl/lib/$version, since
6087 : /opt/perl/lib/perl5... would be redundant.
6088 : The default "style" setting is made in installstyle.U
6089 case "$installstyle" in
6090 *lib/perl5*) set dflt privlib lib/$package/$version ;;
6091 *) set dflt privlib lib/$version ;;
6096 There are some auxiliary files for $package that need to be put into a
6097 private library directory that is accessible by everyone.
6102 rp='Pathname where the private library files will reside?'
6107 : set the prefixup variable, to restore leading tilda escape
6108 prefixup='case "$prefixexp" in
6110 *) eval "$1=\`echo \$$1 | sed \"s,^$prefixexp,$prefix,\"\`";;
6113 : determine where public architecture dependent libraries go
6116 : privlib default is /usr/local/lib/$package/$version
6117 : archlib default is /usr/local/lib/$package/$version/$archname
6118 : privlib may have an optional trailing /share.
6119 tdflt=`echo $privlib | $sed 's,/share$,,'`
6120 tdflt=$tdflt/$archname
6129 $spackage contains architecture-dependent library files. If you are
6130 sharing libraries in a heterogeneous environment, you might store
6131 these files in a separate location. Otherwise, you can just include
6132 them with the rest of the public library files.
6137 rp='Where do you want to put the public architecture-dependent libraries?'
6141 if $test X"$archlib" = X"$privlib"; then
6147 : see if setuid scripts can be secure
6150 Some kernels have a bug that prevents setuid #! scripts from being
6151 secure. Some sites have disabled setuid #! scripts because of this.
6153 First let's decide if your kernel supports secure setuid #! scripts.
6154 (If setuid #! scripts would be secure but have been disabled anyway,
6155 don't say that they are secure if asked.)
6160 if $test -d /dev/fd; then
6161 echo "#!$ls" >reflect
6162 chmod +x,u+s reflect
6163 ./reflect >flect 2>&1
6164 if $contains "/dev/fd" flect >/dev/null; then
6165 echo "Congratulations, your kernel has secure setuid scripts!" >&4
6169 If you are not sure if they are secure, I can check but I'll need a
6170 username and password different from the one you are using right now.
6171 If you don't have such a username or don't want me to test, simply
6175 rp='Other username to test security of setuid scripts with?'
6180 case "$d_suidsafe" in
6181 '') echo "I'll assume setuid scripts are *not* secure." >&4
6184 echo "Well, the $hint value is *not* secure." >&4
6186 *) echo "Well, the $hint value *is* secure." >&4
6191 $rm -f reflect flect
6192 echo "#!$ls" >reflect
6193 chmod +x,u+s reflect
6196 echo '"su" will (probably) prompt you for '"$ans's password."
6197 su $ans -c './reflect >flect'
6198 if $contains "/dev/fd" flect >/dev/null; then
6199 echo "Okay, it looks like setuid scripts are secure." >&4
6202 echo "I don't think setuid scripts are secure." >&4
6207 rp='Does your kernel have *secure* setuid scripts?'
6210 [yY]*) val="$define";;
6215 echo "I don't think setuid scripts are secure (no /dev/fd directory)." >&4
6216 echo "(That's for file descriptors, not floppy disks.)"
6222 $rm -f reflect flect
6224 : now see if they want to do setuid emulation
6227 case "$d_suidsafe" in
6230 echo "No need to emulate SUID scripts since they are secure here." >&4
6234 Some systems have disabled setuid scripts, especially systems where
6235 setuid scripts cannot be secure. On systems where setuid scripts have
6236 been disabled, the setuid/setgid bits on scripts are currently
6237 useless. It is possible for $package to detect those bits and emulate
6238 setuid/setgid in a secure fashion. This emulation will only work if
6239 setuid scripts have been disabled in your kernel.
6243 "$define") dflt=y ;;
6246 rp="Do you want to do setuid/setgid emulation?"
6249 [yY]*) val="$define";;
6257 : Find perl5.005 or later.
6258 echo "Looking for a previously installed perl5.005 or later... "
6260 '') for tdir in `echo "$binexp$path_sep$PATH" | $sed "s/$path_sep/ /g"`; do
6261 : Check if this perl is recent and can load a simple module
6262 if $test -x $tdir/perl$exe_ext && $tdir/perl -Mless -e 'use 5.005;' >/dev/null 2>&1; then
6265 elif $test -x $tdir/perl5$exe_ext && $tdir/perl5 -Mless -e 'use 5.005;' >/dev/null 2>&1; then
6275 '') echo "None found. That's ok.";;
6276 *) echo "Using $perl5." ;;
6281 After $package is installed, you may wish to install various
6282 add-on modules and utilities. Typically, these add-ons will
6283 be installed under $prefix with the rest
6284 of this package. However, you may wish to install such add-ons
6285 elsewhere under a different prefix.
6287 If you do not wish to put everything under a single prefix, that's
6288 ok. You will be prompted for the individual locations; this siteprefix
6289 is only used to suggest the defaults.
6291 The default should be fine for most people.
6295 rp='Installation prefix to use for add-on modules and utilities?'
6296 : XXX Here might be another good place for an installstyle setting.
6297 case "$siteprefix" in
6299 *) dflt=$siteprefix ;;
6302 : XXX Prefixit unit does not yet support siteprefix and vendorprefix
6304 case "$siteprefix" in
6308 *) oldsiteprefix="$prefix";;
6313 siteprefixexp="$ansexp"
6315 : determine where site specific libraries go.
6316 : Usual default is /usr/local/lib/perl5/site_perl/$version
6317 : The default "style" setting is made in installstyle.U
6318 : XXX No longer works with Prefixit stuff.
6319 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
6321 '') case "$installstyle" in
6322 *lib/perl5*) dflt=$siteprefix/lib/$package/site_$prog/$version ;;
6323 *) dflt=$siteprefix/lib/site_$prog/$version ;;
6331 The installation process will create a directory for
6332 site-specific extensions and modules. Most users find it convenient
6333 to place all site-specific files in this directory rather than in the
6334 main distribution directory.
6338 rp='Pathname for the site-specific library files?'
6342 sitelib_stem=`echo "$sitelibexp" | sed "s,/$version$,,"`
6344 : Determine list of previous versions to include in @INC
6345 $cat > getverlist <<EOPL
6348 \$api_versionstring = "$api_versionstring";
6349 \$version = "$version";
6350 \$stem = "$sitelib_stem";
6351 \$archname = "$archname";
6353 $cat >> getverlist <<'EOPL'
6354 # Can't have leading @ because metaconfig interprets it as a command!
6355 ;@inc_version_list=();
6356 # XXX Redo to do opendir/readdir?
6359 ;@candidates = glob("5.*");
6365 # XXX ToDo: These comparisons must be reworked when two-digit
6366 # subversions come along, so that 5.7.10 compares as greater than
6367 # 5.7.3! By that time, hope that 5.6.x is sufficiently
6368 # widespread that we can use the built-in version vectors rather
6369 # than reinventing them here. For 5.6.0, however, we must
6370 # assume this script will likely be run by 5.005_0x. --AD 1/2000.
6371 foreach $d (@candidates) {
6372 if ($d lt $version) {
6373 if ($d ge $api_versionstring) {
6374 unshift(@inc_version_list, grep { -d } "$d/$archname", $d);
6376 elsif ($d ge "5.005") {
6377 unshift(@inc_version_list, grep { -d } $d);
6381 # Skip newer version. I.e. don't look in
6382 # 5.7.0 if we're installing 5.6.1.
6386 if (@inc_version_list) {
6387 print join(' ', @inc_version_list);
6390 # Blank space to preserve value for next Configure run.
6395 case "$inc_version_list" in
6396 '') if test -x "$perl5$exe_ext"; then
6397 dflt=`$perl5 getverlist`
6402 $undef) dflt='none' ;;
6403 *) eval dflt=\"$inc_version_list\" ;;
6406 ''|' ') dflt=none ;;
6413 In order to ease the process of upgrading, this version of perl
6414 can be configured to use modules built and installed with earlier
6415 versions of perl that were installed under $prefix. Specify here
6416 the list of earlier versions that this version of perl should check.
6417 If Configure detected no earlier versions of perl installed under
6418 $prefix, then the list will be empty. Answer 'none' to tell perl
6419 to not search earlier versions.
6421 The default should almost always be sensible, so if you're not sure,
6422 just accept the default.
6425 rp='List of earlier versions to include in @INC?'
6428 [Nn]one|''|' '|$undef) inc_version_list=' ' ;;
6429 *) inc_version_list="$ans" ;;
6431 case "$inc_version_list" in
6433 inc_version_list_init='0'
6434 d_inc_version_list="$undef"
6436 *) inc_version_list_init=`echo $inc_version_list |
6437 $sed -e 's/^/"/' -e 's/ /","/g' -e 's/$/",0/'`
6438 d_inc_version_list="$define"
6443 : see if this is a malloc.h system
6444 : we want a real compile instead of Inhdr because some systems have a
6445 : malloc.h that just gives a compile error saying to use stdlib.h instead
6450 int main () { return 0; }
6453 if eval $compile; then
6454 echo "<malloc.h> found." >&4
6457 echo "<malloc.h> NOT found." >&4
6464 : check for void type
6466 echo "Checking to see how well your C compiler groks the void type..." >&4
6467 case "$voidflags" in
6479 extern void moo(); /* function returning void */
6480 void (*goo)(); /* ptr to func returning void */
6482 void *hue; /* generic ptr */
6495 int main() { sub(); }
6497 if $cc $ccflags -c -DTRY=$defvoidused try.c >.out 2>&1 ; then
6498 voidflags=$defvoidused
6499 echo "Good. It appears to support void to the level $package wants.">&4
6500 if $contains warning .out >/dev/null 2>&1; then
6501 echo "However, you might get some warnings that look like this:"
6505 echo "Hmm, your compiler has some difficulty with void. Checking further..." >&4
6506 if $cc $ccflags -c -DTRY=1 try.c >/dev/null 2>&1; then
6507 echo "It supports 1..."
6508 if $cc $ccflags -c -DTRY=3 try.c >/dev/null 2>&1; then
6509 echo "It also supports 2..."
6510 if $cc $ccflags -c -DTRY=7 try.c >/dev/null 2>&1; then
6512 echo "And it supports 4 but not 8 definitely."
6514 echo "It doesn't support 4..."
6515 if $cc $ccflags -c -DTRY=11 try.c >/dev/null 2>&1; then
6517 echo "But it supports 8."
6520 echo "Neither does it support 8."
6524 echo "It does not support 2..."
6525 if $cc $ccflags -c -DTRY=13 try.c >/dev/null 2>&1; then
6527 echo "But it supports 4 and 8."
6529 if $cc $ccflags -c -DTRY=5 try.c >/dev/null 2>&1; then
6531 echo "And it supports 4 but has not heard about 8."
6533 echo "However it supports 8 but not 4."
6538 echo "There is no support at all for void."
6543 case "$voidflags" in
6546 Support flag bits are:
6547 1: basic void declarations.
6548 2: arrays of pointers to functions returning void.
6549 4: operations between pointers to and addresses of void functions.
6550 8: generic void pointers.
6553 rp="Your void support flags add up to what?"
6560 : check for length of pointer
6564 echo "Checking to see how big your pointers are..." >&4
6565 if test "$voidflags" -gt 7; then
6566 echo '#define VOID_PTR char *' > try.c
6568 echo '#define VOID_PTR void *' > try.c
6578 printf("%d\n", (int)sizeof(VOID_PTR));
6583 if eval $compile_ok; then
6584 ptrsize=`$run ./try`
6585 echo "Your pointers are $ptrsize bytes long."
6588 echo "(I can't seem to compile the test program. Guessing...)" >&4
6589 rp="What is the size of a pointer (in bytes)?"
6596 case "$use64bitall" in
6597 "$define"|true|[yY]*)
6601 *** You have chosen a maximally 64-bit build,
6602 *** but your pointers are only 4 bytes wide.
6603 *** Please rerun Configure without -Duse64bitall.
6608 *** Since you have quads, you could possibly try with -Duse64bitint.
6613 *** Cannot continue, aborting.
6624 : determine whether to use malloc wrapping
6626 case "$usemallocwrap" in
6627 [yY]*|true|$define) dflt='y' ;;
6628 [nN]*|false|$undef) dflt='n' ;;
6629 *) case "$usedevel" in
6630 [yY]*|true|$define) dflt='y' ;;
6635 rp="Do you wish to wrap malloc calls to protect against potential overflows?"
6637 usemallocwrap="$ans"
6640 usemallocwrap="$define" ;;
6642 usemallocwrap="$undef" ;;
6645 : determine which malloc to compile in
6647 case "$usemymalloc" in
6648 [yY]*|true|$define) dflt='y' ;;
6649 [nN]*|false|$undef) dflt='n' ;;
6650 *) case "$ptrsize" in
6656 rp="Do you wish to attempt to use the malloc that comes with $package?"
6662 mallocsrc='malloc.c'
6663 mallocobj="malloc$_o"
6664 d_mymalloc="$define"
6667 : Remove malloc from list of libraries to use
6668 echo "Removing unneeded -lmalloc from library list" >&4
6669 set `echo X $libs | $sed -e 's/-lmalloc / /' -e 's/-lmalloc$//'`
6672 echo "libs = $libs" >&4
6684 : compute the return types of malloc and free
6686 $cat >malloc.c <<END
6690 #include <sys/types.h>
6704 case "$malloctype" in
6706 if $cc $ccflags -c -DTRY_MALLOC malloc.c >/dev/null 2>&1; then
6713 echo "Your system wants malloc to return '$malloctype', it would seem." >&4
6717 if $cc $ccflags -c -DTRY_FREE malloc.c >/dev/null 2>&1; then
6724 echo "Your system uses $freetype free(), it would seem." >&4
6726 : determine where site specific architecture-dependent libraries go.
6727 : sitelib default is /usr/local/lib/perl5/site_perl/$version
6728 : sitearch default is /usr/local/lib/perl5/site_perl/$version/$archname
6729 : sitelib may have an optional trailing /share.
6731 '') dflt=`echo $sitelib | $sed 's,/share$,,'`
6732 dflt="$dflt/$archname"
6737 set sitearch sitearch none
6741 The installation process will also create a directory for
6742 architecture-dependent site-specific extensions and modules.
6746 rp='Pathname for the site-specific architecture-dependent library files?'
6750 if $test X"$sitearch" = X"$sitelib"; then
6753 d_sitearch="$define"
6758 The installation process will also create a directory for
6759 vendor-supplied add-ons. Vendors who supply perl with their system
6760 may find it convenient to place all vendor-supplied files in this
6761 directory rather than in the main distribution directory. This will
6762 ease upgrades between binary-compatible maintenance versions of perl.
6764 Of course you may also use these directories in whatever way you see
6765 fit. For example, you might use them to access modules shared over a
6766 company-wide network.
6768 The default answer should be fine for most people.
6769 This causes further questions about vendor add-ons to be skipped
6770 and no vendor-specific directories will be configured for perl.
6773 rp='Do you want to configure vendor-specific add-on directories?'
6774 case "$usevendorprefix" in
6775 define|true|[yY]*) dflt=y ;;
6776 *) : User may have set vendorprefix directly on Configure command line.
6777 case "$vendorprefix" in
6786 rp='Installation prefix to use for vendor-supplied add-ons?'
6787 case "$vendorprefix" in
6789 *) dflt=$vendorprefix ;;
6792 : XXX Prefixit unit does not yet support siteprefix and vendorprefix
6794 case "$vendorprefix" in
6798 *) oldvendorprefix="$prefix";;
6802 usevendorprefix="$define"
6804 vendorprefixexp="$ansexp"
6806 *) usevendorprefix="$undef"
6812 case "$vendorprefix" in
6813 '') d_vendorlib="$undef"
6817 *) d_vendorlib="$define"
6818 : determine where vendor-supplied modules go.
6819 : Usual default is /usr/local/lib/perl5/vendor_perl/$version
6820 case "$vendorlib" in
6822 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
6823 case "$installstyle" in
6824 *lib/perl5*) dflt=$vendorprefix/lib/$package/vendor_$prog/$version ;;
6825 *) dflt=$vendorprefix/lib/vendor_$prog/$version ;;
6828 *) dflt="$vendorlib"
6832 rp='Pathname for the vendor-supplied library files?'
6835 vendorlibexp="$ansexp"
6838 vendorlib_stem=`echo "$vendorlibexp" | sed "s,/$version$,,"`
6842 case "$vendorprefix" in
6843 '') d_vendorarch="$undef"
6847 *) d_vendorarch="$define"
6848 : determine where vendor-supplied architecture-dependent libraries go.
6849 : vendorlib default is /usr/local/lib/perl5/vendor_perl/$version
6850 : vendorarch default is /usr/local/lib/perl5/vendor_perl/$version/$archname
6851 : vendorlib may have an optional trailing /share.
6852 case "$vendorarch" in
6853 '') dflt=`echo $vendorlib | $sed 's,/share$,,'`
6854 dflt="$dflt/$archname"
6856 *) dflt="$vendorarch" ;;
6859 rp='Pathname for vendor-supplied architecture-dependent files?'
6862 vendorarchexp="$ansexp"
6865 prefixvar=vendorarch
6868 : Final catch-all directories to search
6871 Lastly, you can have perl look in other directories for extensions and
6872 modules in addition to those already specified.
6873 These directories will be searched after
6877 test X"$vendorlib" != "X" && echo ' ' $vendorlib
6878 test X"$vendorarch" != "X" && echo ' ' $vendorarch
6880 case "$otherlibdirs" in
6881 ''|' ') dflt='none' ;;
6882 *) dflt="$otherlibdirs" ;;
6885 Enter a colon-separated set of extra paths to include in perl's @INC
6886 search path, or enter 'none' for no extra paths.
6890 rp='Colon-separated list of additional directories for perl to search?'
6893 ' '|''|none) otherlibdirs=' ' ;;
6894 *) otherlibdirs="$ans" ;;
6896 case "$otherlibdirs" in
6900 set d_perl_otherlibdirs
6903 : Cruising for prototypes
6905 echo "Checking out function prototypes..." >&4
6906 $cat >prototype.c <<EOCP
6911 int main(int argc, char *argv[]) {
6914 if $cc $ccflags -c prototype.c >prototype.out 2>&1 ; then
6915 echo "Your C compiler appears to support function prototypes."
6918 echo "Your C compiler doesn't seem to understand function prototypes."
6925 case "$prototype" in
6927 *) ansi2knr='ansi2knr'
6932 This version of $package can only be compiled by a compiler that
6933 understands function prototypes. Unfortunately, your C compiler
6935 doesn't seem to understand them. Sorry about that.
6937 If GNU cc is available for your system, perhaps you could try that instead.
6939 Eventually, we hope to support building Perl with pre-ANSI compilers.
6940 If you would like to help in that effort, please contact <perlbug@perl.org>.
6942 Aborting Configure now.
6954 Perl can be built with extra modules or bundles of modules which
6955 will be fetched from the CPAN and installed alongside Perl.
6957 Notice that you will need access to the CPAN; either via the Internet,
6958 or a local copy, for example a CD-ROM or a local CPAN mirror. (You will
6959 be asked later to configure the CPAN.pm module which will in turn do
6960 the installation of the rest of the extra modules or bundles.)
6962 Notice also that if the modules require any external software such as
6963 libraries and headers (the libz library and the zlib.h header for the
6964 Compress::Zlib module, for example) you MUST have any such software
6965 already installed, this configuration process will NOT install such
6968 If this doesn't make any sense to you, just accept the default '$dflt'.
6970 rp='Install any extra modules (y or n)?'
6976 Please list any extra modules or bundles to be installed from CPAN,
6977 with spaces between the names. The names can be in any format the
6978 'install' command of CPAN.pm will understand. (Answer 'none',
6979 without the quotes, to install no extra modules or bundles.)
6989 $rm -f ../extras.lst
6991 *) echo "(Saving the list of extras for later...)"
6992 echo "$extras" > ../extras.lst
7000 : determine where html pages for programs go
7001 set html1dir html1dir none
7005 If you wish to install html files for programs in $spackage, indicate
7006 the appropriate directory here. To skip installing html files,
7010 ''|none|$undef|' ') dflt=none ;;
7011 *) dflt=$html1dir ;;
7014 rp="Directory for the main $spackage html pages?"
7018 : Use ' ' for none so value is preserved next time through Configure
7019 $test X"$html1dir" = "X" && html1dir=' '
7021 : determine where html pages for libraries and modules go
7022 set html3dir html3dir none
7026 If you wish to install html files for modules associated with $spackage,
7027 indicate the appropriate directory here. To skip installing html files,
7030 : There is no obvious default. If they have specified html1dir, then
7031 : try to key off that, possibly changing .../html1 into .../html3.
7033 '') html3dir=`echo "$html1dir" | $sed 's/1$/3$/'` ;;
7034 *) dflt=$html3dir ;;
7037 rp="Directory for the $spackage module html pages?"
7041 : Use ' ' for none so value is preserved next time through Configure
7042 $test X"$html3dir" = "X" && html3dir=' '
7044 : determine whether to install perl also as /usr/bin/perl
7047 if $test -d /usr/bin -a "X$installbin" != X/usr/bin; then
7049 Many scripts expect perl to be installed as /usr/bin/perl.
7051 If you want to, I can install the perl you are about to compile
7052 as /usr/bin/perl (in addition to $bin/perl).
7054 if test -f /usr/bin/perl; then
7057 However, please note that because you already have a /usr/bin/perl,
7058 overwriting that with a new Perl would very probably cause problems.
7059 Therefore I'm assuming you don't want to do that (unless you insist).
7062 case "$installusrbinperl" in
7063 "$define"|[yY]*) dflt='y';;
7069 Since you don't have a /usr/bin/perl I'm assuming creating one is okay.
7072 case "$installusrbinperl" in
7073 "$undef"|[nN]*) dflt='n';;
7077 rp="Do you want to install perl as /usr/bin/perl?"
7080 [yY]*) val="$define";;
7086 set installusrbinperl
7090 echo "Checking for GNU C Library..." >&4
7092 /* Find out version of GNU C library. __GLIBC__ and __GLIBC_MINOR__
7093 alone are insufficient to distinguish different versions, such as
7094 2.0.6 and 2.0.7. The function gnu_get_libc_version() appeared in
7095 libc version 2.1.0. A. Dougherty, June 3, 2002.
7101 # ifdef __GLIBC_MINOR__
7102 # if __GLIBC__ >= 2 && __GLIBC_MINOR__ >= 1
7103 # include <gnu/libc-version.h>
7104 printf("%s\n", gnu_get_libc_version());
7106 printf("%d.%d\n", __GLIBC__, __GLIBC_MINOR__);
7109 printf("%d\n", __GLIBC__);
7118 if eval $compile_ok && $run ./try > glibc.ver; then
7120 gnulibc_version=`$cat glibc.ver`
7121 echo "You are using the GNU C Library version $gnulibc_version"
7125 echo "You are not using the GNU C Library"
7127 $rm -f try try.* glibc.ver
7131 : see if nm is to be used to determine whether a symbol is defined or not
7135 case "$d_gnulibc" in
7138 echo "nm probably won't work on the GNU C Library." >&4
7144 if $test "$osname" = aix -a "X$PASE" != "Xdefine" -a ! -f /lib/syscalls.exp; then
7146 echo "Whoops! This is an AIX system without /lib/syscalls.exp!" >&4
7147 echo "'nm' won't be sufficient on this sytem." >&4
7153 '') dflt=`$egrep 'inlibc|csym' $rsrc/Configure | wc -l 2>/dev/null`
7154 if $test $dflt -gt 20; then
7164 true|$define) dflt=y;;
7171 I can use $nm to extract the symbols from your C libraries. This
7172 is a time consuming task which may generate huge output on the disk (up
7173 to 3 megabytes) but that should make the symbols extraction faster. The
7174 alternative is to skip the 'nm' extraction part and to compile a small
7175 test program instead to determine whether each symbol is present. If
7176 you have a fast C compiler and/or if your 'nm' output cannot be parsed,
7177 this may be the best solution.
7179 You probably shouldn't let me use 'nm' if you are using the GNU C Library.
7182 rp="Shall I use $nm to extract C symbols from the libraries?"
7185 [Nn]*) usenm=false;;
7194 : nm options which may be necessary
7196 '') if $test -f /mach_boot; then
7198 elif $test -d /usr/ccs/lib; then
7199 nm_opt='-p' # Solaris (and SunOS?)
7200 elif $test -f /dgux; then
7202 elif $test -f /lib64/rld; then
7203 nm_opt='-p' # 64-bit Irix
7209 : nm options which may be necessary for shared libraries but illegal
7210 : for archive libraries. Thank you, Linux.
7211 case "$nm_so_opt" in
7212 '') case "$myuname" in
7214 if $nm --help | $grep 'dynamic' > /dev/null 2>&1; then
7215 nm_so_opt='--dynamic'
7224 : get list of predefined functions in a handy place
7229 *-lc_s*) libc=`./loc libc_s$_a $libc $libpth`
7235 *) for thislib in $libs; do
7238 : Handle C library specially below.
7241 thislib=`echo $thislib | $sed -e 's/^-l//'`
7242 if try=`./loc lib$thislib.$so.'*' X $libpth`; $test -f "$try"; then
7244 elif try=`./loc lib$thislib.$so X $libpth`; $test -f "$try"; then
7246 elif try=`./loc lib$thislib$_a X $libpth`; $test -f "$try"; then
7248 elif try=`./loc $thislib$_a X $libpth`; $test -f "$try"; then
7250 elif try=`./loc lib$thislib X $libpth`; $test -f "$try"; then
7252 elif try=`./loc $thislib X $libpth`; $test -f "$try"; then
7254 elif try=`./loc Slib$thislib$_a X $xlibpth`; $test -f "$try"; then
7259 libnames="$libnames $try"
7261 *) libnames="$libnames $thislib" ;;
7270 for xxx in $libpth; do
7271 $test -r $1 || set $xxx/libc.$so
7272 : The messy sed command sorts on library version numbers.
7274 set `echo blurfl; echo $xxx/libc.$so.[0-9]* | \
7275 tr ' ' $trnl | egrep -v '\.[A-Za-z]*$' | $sed -e '
7277 s/[0-9][0-9]*/0000&/g
7278 s/0*\([0-9][0-9][0-9][0-9][0-9]\)/\1/g
7281 $sort | $sed -e 's/^.* //'`
7284 $test -r $1 || set /usr/ccs/lib/libc.$so
7285 $test -r $1 || set /lib/libsys_s$_a
7291 if $test -r "$1"; then
7292 echo "Your (shared) C library seems to be in $1."
7294 elif $test -r /lib/libc && $test -r /lib/clib; then
7295 echo "Your C library seems to be in both /lib/clib and /lib/libc."
7297 libc='/lib/clib /lib/libc'
7298 if $test -r /lib/syslib; then
7299 echo "(Your math library is in /lib/syslib.)"
7300 libc="$libc /lib/syslib"
7302 elif $test -r "$libc" || (test -h "$libc") >/dev/null 2>&1; then
7303 echo "Your C library seems to be in $libc, as you said before."
7304 elif $test -r $incpath/usr/lib/libc$_a; then
7305 libc=$incpath/usr/lib/libc$_a;
7306 echo "Your C library seems to be in $libc. That's fine."
7307 elif $test -r /lib/libc$_a; then
7309 echo "Your C library seems to be in $libc. You're normal."
7311 if tans=`./loc libc$_a blurfl/dyick $libpth`; $test -r "$tans"; then
7313 elif tans=`./loc libc blurfl/dyick $libpth`; $test -r "$tans"; then
7314 libnames="$libnames "`./loc clib blurfl/dyick $libpth`
7315 elif tans=`./loc clib blurfl/dyick $libpth`; $test -r "$tans"; then
7317 elif tans=`./loc Slibc$_a blurfl/dyick $xlibpth`; $test -r "$tans"; then
7319 elif tans=`./loc Mlibc$_a blurfl/dyick $xlibpth`; $test -r "$tans"; then
7322 tans=`./loc Llibc$_a blurfl/dyick $xlibpth`
7324 if $test -r "$tans"; then
7325 echo "Your C library seems to be in $tans, of all places."
7331 if $test $xxx = apollo -o -r "$libc" || (test -h "$libc") >/dev/null 2>&1; then
7335 If the guess above is wrong (which it might be if you're using a strange
7336 compiler, or your machine supports multiple models), you can override it here.
7341 echo $libpth | $tr ' ' $trnl | $sort | $uniq > libpath
7343 I can't seem to find your C library. I've looked in the following places:
7346 $sed 's/^/ /' libpath
7349 None of these seems to contain your C library. I need to get its name...
7354 rp='Where is your C library?'
7359 echo $libc $libnames | $tr ' ' $trnl | $sort | $uniq > libnames
7360 set X `cat libnames`
7363 case $# in 1) xxx=file; esac
7364 echo "Extracting names from the following $xxx for later perusal:" >&4
7366 $sed 's/^/ /' libnames >&4
7368 $echo $n "This may take a while...$c" >&4
7372 *$so*) $nm $nm_so_opt $nm_opt $file 2>/dev/null;;
7373 *) $nm $nm_opt $file 2>/dev/null;;
7378 $grep fprintf libc.tmp > libc.ptf
7379 xscan='eval "<libc.ptf $com >libc.list"; $echo $n ".$c" >&4'
7380 xrun='eval "<libc.tmp $com >libc.list"; echo "done." >&4'
7382 if com="$sed -n -e 's/__IO//' -e 's/^.* $xxx *//p'";\
7384 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7386 elif com="$sed -n -e 's/^__*//' -e 's/^\([a-zA-Z_0-9$]*\).*xtern.*/\1/p'";\
7388 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7390 elif com="$sed -n -e '/|UNDEF/d' -e '/FUNC..GL/s/^.*|__*//p'";\
7392 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7394 elif com="$sed -n -e 's/^.* D __*//p' -e 's/^.* D //p'";\
7396 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7398 elif com="$sed -n -e 's/^_//' -e 's/^\([a-zA-Z_0-9]*\).*xtern.*text.*/\1/p'";\
7400 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7402 elif com="$sed -n -e 's/^.*|FUNC |GLOB .*|//p'";\
7404 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7406 elif com="$grep '|' | $sed -n -e '/|COMMON/d' -e '/|DATA/d' \
7407 -e '/ file/d' -e 's/^\([^ ]*\).*/\1/p'";\
7409 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7411 elif com="$sed -n -e 's/^.*|FUNC |GLOB .*|//p' -e 's/^.*|FUNC |WEAK .*|//p'";\
7413 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7415 elif com="$sed -n -e 's/^__//' -e '/|Undef/d' -e '/|Proc/s/ .*//p'";\
7417 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7419 elif com="$sed -n -e 's/^.*|Proc .*|Text *| *//p'";\
7421 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7423 elif com="$sed -n -e '/Def. Text/s/.* \([^ ]*\)\$/\1/p'";\
7425 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7427 elif com="$sed -n -e 's/^[-0-9a-f ]*_\(.*\)=.*/\1/p'";\
7429 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7431 elif com="$sed -n -e 's/.*\.text n\ \ \ \.//p'";\
7433 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7435 elif com="sed -n -e 's/^__.*//' -e 's/[ ]*D[ ]*[0-9]*.*//p'";\
7437 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7440 $nm -p $* 2>/dev/null >libc.tmp
7441 $grep fprintf libc.tmp > libc.ptf
7442 if com="$sed -n -e 's/^.* [ADTSIW] *_[_.]*//p' -e 's/^.* [ADTSIW] //p'";\
7443 eval $xscan; $contains '^fprintf$' libc.list >/dev/null 2>&1
7449 echo "$nm didn't seem to work right. Trying $ar instead..." >&4
7451 if $ar t $libc > libc.tmp && $contains '^fprintf$' libc.tmp >/dev/null 2>&1; then
7452 for thisname in $libnames $libc; do
7453 $ar t $thisname >>libc.tmp
7455 $sed -e "s/\\$_o\$//" < libc.tmp > libc.list
7457 elif test "X$osname" = "Xos2" && $ar tv $libc > libc.tmp; then
7458 # Repeat libc to extract forwarders to DLL entries too
7459 for thisname in $libnames $libc; do
7460 $ar tv $thisname >>libc.tmp
7461 # Revision 50 of EMX has bug in $ar.
7462 # it will not extract forwarders to DLL entries
7463 # Use emximp which will extract exactly them.
7464 emximp -o tmp.imp $thisname \
7466 $sed -e 's/^\([_a-zA-Z0-9]*\) .*$/\1/p' \
7467 < tmp.imp >>libc.tmp
7470 $sed -e "s/\\$_o\$//" -e 's/^ \+//' < libc.tmp > libc.list
7473 echo "$ar didn't seem to work right." >&4
7474 echo "Maybe this is a Cray...trying bld instead..." >&4
7475 if bld t $libc | $sed -e 's/.*\///' -e "s/\\$_o:.*\$//" > libc.list
7477 for thisname in $libnames; do
7479 $sed -e 's/.*\///' -e "s/\\$_o:.*\$//" >>libc.list
7480 $ar t $thisname >>libc.tmp
7484 echo "That didn't work either. Giving up." >&4
7494 echo "Since you are compiling for PASE, extracting more symbols from libc.a ...">&4
7495 dump -Tv /lib/libc.a | awk '$7 == "/unix" {print $5 " " $8}' | grep "^SV" | awk '{print $2}' >> libc.list
7497 *) if $test -f /lib/syscalls.exp; then
7499 echo "Also extracting names from /lib/syscalls.exp for good ole AIX..." >&4
7500 $sed -n 's/^\([^ ]*\)[ ]*syscall[0-9]*[ ]*$/\1/p' /lib/syscalls.exp >>libc.list
7506 $rm -f libnames libpath
7508 : see if dld is available
7512 : is a C symbol defined?
7515 -v) tf=libc.tmp; tdc="";;
7516 -a) tf=libc.tmp; tdc="[]";;
7517 *) tlook="^$1\$"; tf=libc.list; tdc="()";;
7520 case "$reuseval-$4" in
7522 true-*) tx=no; eval "tval=\$$4"; case "$tval" in "") tx=yes;; esac;;
7527 if $test "$runnm" = true; then
7528 if $contains $tlook $tf >/dev/null 2>&1; then
7530 elif $test "$mistrustnm" = compile -o "$mistrustnm" = run; then
7531 echo "void *(*(p()))$tdc { extern void *$1$tdc; return &$1; } int main() { if(p()) return(0); else return(1); }"> try.c;
7532 $cc -o try $optimize $ccflags $ldflags try.c >/dev/null 2>&1 $libs && tval=true;
7533 $test "$mistrustnm" = run -a -x try && { $run ./try$_exe >/dev/null 2>&1 || tval=false; };
7534 $rm -f try$_exe try.c core core.* try.core;
7537 echo "void *(*(p()))$tdc { extern void *$1$tdc; return &$1; } int main() { if(p()) return(0); else return(1); }"> try.c;
7538 $cc -o try $optimize $ccflags $ldflags try.c $libs >/dev/null 2>&1 && tval=true;
7539 $rm -f try$_exe try.c;
7544 $define) tval=true;;
7551 : define an is-in-libc? function
7552 inlibc='echo " "; td=$define; tu=$undef;
7553 sym=$1; var=$2; eval "was=\$$2";
7555 case "$reuseval$was" in
7565 echo "$sym() found." >&4;
7566 case "$was" in $undef) . ./whoa; esac; eval "$var=\$td";;
7568 echo "$sym() NOT found." >&4;
7569 case "$was" in $define) . ./whoa; esac; eval "$var=\$tu";;
7573 $define) echo "$sym() found." >&4;;
7574 *) echo "$sym() NOT found." >&4;;
7578 : see if dlopen exists
7585 : determine which dynamic loading, if any, to compile in
7587 dldir="ext/DynaLoader"
7600 $define) dflt='y' ;;
7603 $define) dflt='y' ;;
7605 : Does a dl_xxx.xs file exist for this operating system
7606 $test -f $rsrc/$dldir/dl_${osname}.xs && dflt='y'
7609 rp="Do you wish to use dynamic loading?"
7616 if $test -f $rsrc/$dldir/dl_${osname}.xs ; then
7617 dflt="$dldir/dl_${osname}.xs"
7618 elif $test "$d_dlopen" = "$define" ; then
7619 dflt="$dldir/dl_dlopen.xs"
7620 elif $test "$i_dld" = "$define" ; then
7621 dflt="$dldir/dl_dld.xs"
7626 *) dflt="$dldir/$dlsrc"
7629 echo "The following dynamic loading files are available:"
7630 : Can not go over to $dldir because getfile has path hard-coded in.
7631 tdir=`pwd`; cd "$rsrc"; $ls -C $dldir/dl*.xs; cd "$tdir"
7632 rp="Source file to use for dynamic loading"
7638 dlsrc=`echo $ans | $sed -e 's%.*/\([^/]*\)$%\1%'`
7642 Some systems may require passing special flags to $cc -c to
7643 compile modules that will be used to create a shared library.
7644 To use no flags, say "none".
7647 case "$cccdlflags" in
7648 '') case "$gccversion" in
7649 '') case "$osname" in
7651 next) dflt='none' ;;
7652 irix*) dflt='-KPIC' ;;
7653 svr4*|esix*|solaris|nonstopux) dflt='-KPIC' ;;
7654 sunos) dflt='-pic' ;;
7658 *) case "$osname" in
7659 darwin) dflt='none' ;;
7660 svr4*|esix*|solaris|nonstopux) dflt='-fPIC' ;;
7665 *) dflt="$cccdlflags" ;;
7667 rp="Any special flags to pass to $cc -c to compile shared library modules?"
7670 none) cccdlflags=' ' ;;
7671 *) cccdlflags="$ans" ;;
7676 Some systems use ld to create libraries that can be dynamically loaded,
7677 while other systems (such as those using ELF) use $cc.
7681 '') $cat >try.c <<EOM
7682 /* Test for whether ELF binaries are produced */
7690 int i = open("a.out",O_RDONLY);
7693 if(read(i,b,4)==4 && b[0]==127 && b[1]=='E' && b[2]=='L' && b[3]=='F')
7694 exit(0); /* succeed (yes, it's ELF) */
7699 if $cc $ccflags $ldflags try.c >/dev/null 2>&1 && $run ./a.out; then
7701 You appear to have ELF support. I'll use $cc to build dynamic libraries.
7705 echo "I'll use ld to build dynamic libraries."
7714 rp="What command should be used to create dynamic libraries?"
7720 Some systems may require passing special flags to $ld to create a
7721 library that can be dynamically loaded. If your ld flags include
7722 -L/other/path options to locate libraries outside your loader's normal
7723 search path, you may need to specify those -L options here as well. To
7724 use no flags, say "none".
7727 case "$lddlflags" in
7728 '') case "$osname" in
7729 beos) dflt='-nostart' ;;
7731 case "$gccversion" in
7732 '') dflt="$dflt +vnocompatwarnings" ;;
7735 linux|irix*|gnu*) dflt='-shared' ;;
7736 next) dflt='none' ;;
7737 solaris) dflt='-G' ;;
7738 sunos) dflt='-assert nodefinitions' ;;
7739 svr4*|esix*|nonstopux) dflt="-G $ldflags" ;;
7743 *) dflt="$lddlflags" ;;
7746 : Try to guess additional flags to pick up local libraries.
7747 : Be careful not to append to a plain 'none'
7751 for thisflag in $ldflags; do
7756 *) dflt="$dflt $thisflag" ;;
7763 ''|' ') dflt='none' ;;
7766 rp="Any special flags to pass to $ld to create a dynamically loaded library?"
7769 none) lddlflags=' ' ;;
7770 *) lddlflags="$ans" ;;
7775 Some systems may require passing special flags to $cc to indicate that
7776 the resulting executable will use dynamic linking. To use no flags,
7780 case "$ccdlflags" in
7781 '') case "$osname" in
7782 linux|hpux|gnu*) dflt='-Wl,-E' ;;
7783 next|sunos) dflt='none' ;;
7787 *) dflt="$ccdlflags" ;;
7789 rp="Any special flags to pass to $cc to use dynamic linking?"
7792 none) ccdlflags=' ' ;;
7793 *) ccdlflags="$ans" ;;
7807 # No dynamic loading being used, so don't bother even to prompt.
7810 *) case "$useshrplib" in
7811 '') case "$osname" in
7812 svr4*|nonstopux|dgux|dynixptx|esix|powerux|beos|cygwin*)
7814 also='Building a shared libperl is required for dynamic loading to work on your system.'
7819 also='Building a shared libperl is needed for MAB support.'
7837 The perl executable is normally obtained by linking perlmain.c with
7838 libperl${_a}, any static extensions (usually just DynaLoader), and
7839 any other libraries needed on this system (such as -lm, etc.). Since
7840 your system supports dynamic loading, it is probably possible to build
7841 a shared libperl.$so. If you will have more than one executable linked
7842 to libperl.$so, this will significantly reduce the size of each
7843 executable, but it may have a noticeable effect on performance. The
7844 default is probably sensible for your system.
7848 rp="Build a shared libperl.$so (y/n)"
7852 useshrplib='true' ;;
7853 *) useshrplib='false' ;;
7858 case "$useshrplib" in
7862 # Figure out a good name for libperl.so. Since it gets stored in
7863 # a version-specific architecture-dependent library, the version
7864 # number isn't really that important, except for making cc/ld happy.
7866 # A name such as libperl.so.3.1
7867 majmin="libperl.$so.$patchlevel.$subversion"
7868 # A name such as libperl.so.301
7869 majonly=`echo $patchlevel $subversion |
7870 $awk '{printf "%d%02d", $1, $2}'`
7871 majonly=libperl.$so.$majonly
7872 # I'd prefer to keep the os-specific stuff here to a minimum, and
7873 # rely on figuring it out from the naming of libc.
7874 case "${osname}${osvers}" in
7877 # XXX How handle the --version stuff for MAB?
7879 linux*|gnu*) # ld won't link with a bare -lperl otherwise.
7882 cygwin*) # ld links against an importlib
7883 dflt=libperl$lib_ext
7885 *) # Try to guess based on whether libc has major.minor.
7887 *libc.$so.[0-9]*.[0-9]*) dflt=$majmin ;;
7888 *libc.$so.[0-9]*) dflt=$majonly ;;
7889 *) dflt=libperl.$so ;;
7899 I need to select a good name for the shared libperl. If your system uses
7900 library names with major and minor numbers, then you might want something
7901 like $majmin. Alternatively, if your system uses a single version
7902 number for shared libraries, then you might want to use $majonly.
7903 Or, your system might be quite happy with a simple libperl.$so.
7905 Since the shared libperl will get installed into a version-specific
7906 architecture-dependent directory, the version number of the shared perl
7907 library probably isn't important, so the default should be o.k.
7910 rp='What name do you want to give to the shared libperl?'
7913 echo "Ok, I'll use $libperl"
7916 libperl="libperl${_a}"
7920 # Detect old use of shrpdir via undocumented Configure -Dshrpdir
7924 WARNING: Use of the shrpdir variable for the installation location of
7925 the shared $libperl is not supported. It was never documented and
7926 will not work in this version. Let me (perlbug@perl.org)
7927 know of any problems this may cause.
7933 But your current setting of $shrpdir is
7934 the default anyway, so it's harmless.
7939 Further, your current attempted setting of $shrpdir
7940 conflicts with the value of $archlibexp/CORE
7941 that installperl will use.
7948 # How will the perl executable find the installed shared $libperl?
7949 # Add $xxx to ccdlflags.
7950 # If we can't figure out a command-line option, use $shrpenv to
7951 # set env LD_RUN_PATH. The main perl makefile uses this.
7952 shrpdir=$archlibexp/CORE
7955 if "$useshrplib"; then
7958 # We'll set it in Makefile.SH...
7963 freebsd|netbsd|openbsd|interix|dragonfly)
7964 xxx="-Wl,-R$shrpdir"
7966 bsdos|linux|irix*|dec_osf|gnu*)
7967 xxx="-Wl,-rpath,$shrpdir"
7970 # next doesn't like the default...
7973 # beos doesn't like the default, either.
7976 # hpux doesn't like the default, either.
7977 tmp_shrpenv="env LDOPTS=\"+s +b${shrpdir}\""
7980 tmp_shrpenv="env LD_RUN_PATH=$shrpdir"
7986 # Only add $xxx if it isn't already in ccdlflags.
7987 case " $ccdlflags " in
7989 *) ccdlflags="$ccdlflags $xxx"
7992 Adding $xxx to the flags
7993 passed to $ld so that the perl executable will find the
7994 installed shared $libperl.
8002 # Fix ccdlflags in AIX for building external extensions.
8003 # (For building Perl itself bare -bE:perl.exp is needed,
8004 # Makefile.SH takes care of this.)
8006 aix) ccdlflags="$ccdlflags -bE:$installarchlib/CORE/perl.exp" ;;
8008 # Respect a hint or command-line value.
8010 '') shrpenv="$tmp_shrpenv" ;;
8012 case "$ldlibpthname" in
8013 '') ldlibpthname=LD_LIBRARY_PATH ;;
8014 none) ldlibpthname='' ;;
8017 : determine where manual pages are on this system
8021 syspath='/usr/share/man/man1 /usr/man/man1'
8022 syspath="$syspath /usr/man/mann /usr/man/manl /usr/man/local/man1"
8023 syspath="$syspath /usr/man/u_man/man1"
8024 syspath="$syspath /usr/catman/u_man/man1 /usr/man/l_man/man1"
8025 syspath="$syspath /usr/local/man/u_man/man1 /usr/local/man/l_man/man1"
8026 syspath="$syspath /usr/man/man.L /local/man/man1 /usr/local/man/man1"
8027 sysman=`./loc . /usr/man/man1 $syspath`
8030 if $test -d "$sysman"; then
8031 echo "System manual is in $sysman." >&4
8033 echo "Could not find manual pages in source form." >&4
8036 : determine where manual pages go
8037 set man1dir man1dir none
8041 $spackage has manual pages available in source form.
8045 echo "However, you don't have nroff, so they're probably useless to you."
8047 '') man1dir="none";;
8050 echo "If you don't want the manual sources installed, answer 'none'."
8055 lookpath="$prefixexp/share/man/man1"
8056 lookpath="$lookpath $prefixexp/man/man1 $prefixexp/man/l_man/man1"
8057 lookpath="$lookpath $prefixexp/man/p_man/man1"
8058 lookpath="$lookpath $prefixexp/man/u_man/man1"
8059 lookpath="$lookpath $prefixexp/man/man.1"
8061 */?_man*) dflt=`./loc . $prefixexp/l_man/man1 $lookpath` ;;
8062 *) dflt=`./loc . $prefixexp/man/man1 $lookpath` ;;
8072 rp="Where do the main $spackage manual pages (source) go?"
8074 if $test "X$man1direxp" != "X$ansexp"; then
8085 : What suffix to use on installed man pages
8092 rp="What suffix should be used for the main $spackage man pages?"
8094 '') case "$man1dir" in
8108 *) dflt="$man1ext";;
8115 : see if we can have long filenames
8117 first=123456789abcdef
8119 if (echo hi >$first) 2>/dev/null; then
8120 if $test -f 123456789abcde; then
8121 echo 'You cannot have filenames longer than 14 characters. Sigh.' >&4
8124 echo 'You can have filenames longer than 14 characters.'>&4
8129 You can't have filenames longer than 14 chars.
8130 You can't even think about them!
8136 $rm -rf 123456789abcde*
8138 : determine where library module manual pages go
8139 set man3dir man3dir none
8143 $spackage has manual pages for many of the library modules.
8149 However, you don't have nroff, so they're probably useless to you.
8152 '') man3dir="none";;
8156 case "$d_flexfnam" in
8159 However, your system can't handle the long file names like File::Basename.3.
8162 '') man3dir="none";;
8166 echo "If you don't want the manual sources installed, answer 'none'."
8167 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
8169 '') dflt=`echo "$man1dir" | $sed -e 's/man1/man3/g' -e 's/man\.1/man\.3/g'`
8170 if $test -d "$privlib/man/man3"; then
8173 WARNING: Previous versions of perl installed man3 pages into
8174 $privlib/man/man3. This version will suggest a
8175 new default of $dflt.
8179 rp='Do you wish to preserve the old behavior?(y/n)'
8182 y*) dflt="$privlib/man/man3" ;;
8187 *) dflt="$man3dir" ;;
8194 rp="Where do the $package library man pages (source) go?"
8204 : What suffix to use on installed man pages
8210 rp="What suffix should be used for the $package library man pages?"
8212 '') case "$man3dir" in
8226 *) dflt="$man3ext";;
8233 : see if we have to deal with yellow pages, now NIS.
8234 if $test -d /usr/etc/yp || $test -d /etc/yp || $test -d /usr/lib/yp; then
8235 if $test -f /usr/etc/nibindd; then
8237 echo "I'm fairly confident you're on a NeXT."
8239 rp='Do you get the hosts file via NetInfo?'
8248 y*) hostcat='nidump hosts .';;
8249 *) case "$hostcat" in
8250 nidump*) hostcat='';;
8260 '') if $contains '^\+' /etc/passwd >/dev/null 2>&1; then
8268 rp='Are you getting the hosts file via yellow pages?'
8271 y*) hostcat='ypcat hosts';;
8272 *) hostcat='cat /etc/hosts';;
8278 '') test -f /etc/hosts && hostcat='cat /etc/hosts';;
8281 '') test -f /etc/group && groupcat='cat /etc/group';;
8284 '') test -f /etc/passwd && passcat='cat /etc/passwd';;
8287 : now get the host name
8289 echo "Figuring out host name..." >&4
8290 case "$myhostname" in
8292 echo 'Maybe "hostname" will work...'
8293 if tans=`sh -c hostname 2>&1` ; then
8301 if $test "$cont"; then
8303 echo 'Oh, dear. Maybe "/etc/systemid" is the key...'
8304 if tans=`cat /etc/systemid 2>&1` ; then
8306 phostname='cat /etc/systemid'
8307 echo "Whadyaknow. Xenix always was a bit strange..."
8310 elif $test -r /etc/systemid; then
8311 echo "(What is a non-Xenix system doing with /etc/systemid?)"
8314 if $test "$cont"; then
8315 echo 'No, maybe "uuname -l" will work...'
8316 if tans=`sh -c 'uuname -l' 2>&1` ; then
8318 phostname='uuname -l'
8320 echo 'Strange. Maybe "uname -n" will work...'
8321 if tans=`sh -c 'uname -n' 2>&1` ; then
8323 phostname='uname -n'
8325 echo 'Oh well, maybe I can mine it out of whoami.h...'
8326 if tans=`sh -c $contains' sysname $usrinc/whoami.h' 2>&1` ; then
8327 myhostname=`echo "$tans" | $sed 's/^.*"\(.*\)"/\1/'`
8328 phostname="sed -n -e '"'/sysname/s/^.*\"\\(.*\\)\"/\1/{'"' -e p -e q -e '}' <$usrinc/whoami.h"
8330 case "$myhostname" in
8331 '') echo "Does this machine have an identity crisis or something?"
8334 echo "Well, you said $myhostname before..."
8335 phostname='echo $myhostname';;
8341 case "$myhostname" in
8342 '') myhostname=noname ;;
8344 : you do not want to know about this
8349 if $test "$myhostname" ; then
8351 rp='Your host name appears to be "'$myhostname'".'" Right?"
8359 : bad guess or no guess
8360 while $test "X$myhostname" = X ; do
8362 rp="Please type the (one word) name of your host:"
8367 : translate upper to lower if necessary
8368 case "$myhostname" in
8370 echo "(Normalizing case in your host name)"
8371 myhostname=`echo $myhostname | ./tr '[A-Z]' '[a-z]'`
8375 case "$myhostname" in
8377 dflt=`expr "X$myhostname" : "X[^.]*\(\..*\)"`
8378 myhostname=`expr "X$myhostname" : "X\([^.]*\)\."`
8379 echo "(Trimming domain name from host name--host name is now $myhostname)"
8381 *) case "$mydomain" in
8384 test "X$hostcat" = "Xypcat hosts" &&
8385 ypmatch "$myhostname" hosts 2>/dev/null |\
8386 $sed -e 's/[ ]*#.*//; s/$/ /' > hosts && \
8389 test "X$hostcat" != "X" &&
8390 $hostcat | $sed -n -e "s/[ ]*#.*//; s/\$/ /
8391 /[ ]$myhostname[ . ]/p" > hosts
8394 if $test -f hosts; then
8395 $test x`$awk "/[0-9].*[ ]$myhostname$tmp_re/ { sum++ }
8396 END { print sum }" hosts` = x1 || tmp_re="[ ]"
8397 dflt=.`$awk "/[0-9].*[ ]$myhostname$tmp_re/ {for(i=2; i<=NF;i++) print \\\$i}" \
8398 hosts | $sort | $uniq | \
8399 $sed -n -e "s/$myhostname\.\([-a-zA-Z0-9_.]\)/\1/p"`
8400 case `$echo X$dflt` in
8401 X*\ *) echo "(Several hosts in the database matched hostname)"
8404 X.) echo "(You do not have fully-qualified names in the hosts database)"
8408 echo "(I cannot locate a hosts database anywhere)"
8413 tans=`./loc resolv.conf X /etc /usr/etc`
8414 if $test -f "$tans"; then
8415 echo "(Attempting domain name extraction from $tans)"
8416 dflt=.`$sed -n -e 's/ / /g' \
8417 -e 's/^search *\([^ ]*\).*/\1/p' $tans \
8418 | ./tr '[A-Z]' '[a-z]' 2>/dev/null`
8420 .) dflt=.`$sed -n -e 's/ / /g' \
8421 -e 's/^domain *\([^ ]*\).*/\1/p' $tans \
8422 | ./tr '[A-Z]' '[a-z]' 2>/dev/null`
8429 .) echo "(No help from resolv.conf either -- attempting clever guess)"
8430 dflt=.`sh -c domainname 2>/dev/null`
8433 .nis.*|.yp.*|.main.*) dflt=`echo $dflt | $sed -e 's/^\.[^.]*//'`;;
8437 case "$dflt$osname" in
8438 .os390) echo "(Attempting domain name extraction from //'SYS1.TCPPARMS(TCPDATA)')"
8439 dflt=.`awk '/^DOMAINORIGIN/ {print $2}' "//'SYS1.TCPPARMS(TCPDATA)'" 2>/dev/null`
8443 .) echo "(Lost all hope -- silly guess then)"
8449 *) dflt="$mydomain";;
8453 rp="What is your domain name?"
8463 : translate upper to lower if necessary
8466 echo "(Normalizing case in your domain name)"
8467 mydomain=`echo $mydomain | ./tr '[A-Z]' '[a-z]'`
8471 : a little sanity check here
8472 case "$phostname" in
8475 case `$phostname | ./tr '[A-Z]' '[a-z]'` in
8476 $myhostname$mydomain|$myhostname) ;;
8478 case "$phostname" in
8480 echo "(That doesn't agree with your whoami.h file, by the way.)"
8483 echo "(That doesn't agree with your $phostname command, by the way.)"
8493 I need to get your e-mail address in Internet format if possible, i.e.
8494 something like user@host.domain. Please answer accurately since I have
8495 no easy means to double check it. The default value provided below
8496 is most probably close to reality but may not be valid from outside
8497 your organization...
8501 while test "$cont"; do
8503 '') dflt="$cf_by@$myhostname$mydomain";;
8504 *) dflt="$cf_email";;
8506 rp='What is your e-mail address?'
8512 rp='Address does not look like an Internet one. Use it anyway?'
8528 If you or somebody else will be maintaining perl at your site, please
8529 fill in the correct e-mail address here so that they may be contacted
8530 if necessary. Currently, the "perlbug" program included with perl
8531 will send mail to this address in addition to perlbug@perl.org. You may
8532 enter "none" for no administrator.
8535 case "$perladmin" in
8536 '') dflt="$cf_email";;
8537 *) dflt="$perladmin";;
8539 rp='Perl administrator e-mail address'
8543 : determine whether to only install version-specific parts.
8546 Do you want to install only the version-specific parts of the perl
8547 distribution? Usually you do *not* want to do this.
8549 case "$versiononly" in
8550 "$define"|[Yy]*|true) dflt='y' ;;
8553 rp="Do you want to install only the version-specific parts of perl?"
8556 [yY]*) val="$define";;
8562 case "$versiononly" in
8563 "$define") inc_version_list=''
8564 inc_version_list_init=0
8568 : figure out how to guarantee perl startup
8569 case "$startperl" in
8571 case "$sharpbang" in
8575 I can use the #! construct to start perl on your system. This will
8576 make startup of perl scripts faster, but may cause problems if you
8577 want to share those scripts and perl is not in a standard place
8578 ($binexp/perl) on all your platforms. The alternative is to force
8579 a shell by starting the script with a single ':' character.
8582 case "$versiononly" in
8583 "$define") dflt="$binexp/perl$version";;
8584 *) dflt="$binexp/perl";;
8586 rp='What shall I put after the #! to start up perl ("none" to not use #!)?'
8589 none) startperl=": # use perl";;
8590 *) startperl="#!$ans"
8591 if $test 30 -lt `echo "$ans" | wc -c`; then
8594 WARNING: Some systems limit the #! command to 32 characters.
8595 If you experience difficulty running Perl scripts with #!, try
8596 installing Perl in a directory with a shorter pathname.
8602 *) startperl=": # use perl"
8607 echo "I'll use $startperl to start perl scripts."
8609 : figure best path for perl in scripts
8612 case "$versiononly" in
8613 "$define") perlpath="$binexp/perl$version";;
8614 *) perlpath="$binexp/perl";;
8616 case "$startperl" in
8621 I will use the "eval 'exec'" idiom to start Perl on your system.
8622 I can use the full path of your Perl binary for this purpose, but
8623 doing so may cause problems if you want to share those scripts and
8624 Perl is not always in a standard place ($binexp/perl).
8628 rp="What path shall I use in \"eval 'exec'\"?"
8635 case "$startperl" in
8637 *) echo "I'll use $perlpath in \"eval 'exec'\"" ;;
8640 : determine where public executable scripts go
8641 set scriptdir scriptdir
8643 case "$scriptdir" in
8646 : guess some guesses
8647 $test -d /usr/share/scripts && dflt=/usr/share/scripts
8648 $test -d /usr/share/bin && dflt=/usr/share/bin
8649 $test -d /usr/local/script && dflt=/usr/local/script
8650 $test -d /usr/local/scripts && dflt=/usr/local/scripts
8651 $test -d $prefixexp/script && dflt=$prefixexp/script
8655 *) dflt="$scriptdir"
8660 Some installations have a separate directory just for executable scripts so
8661 that they can mount it across multiple architectures but keep the scripts in
8662 one spot. You might, for example, have a subdirectory of /usr/share for this.
8663 Or you might just lump your scripts in with all your other executables.
8667 rp='Where do you keep publicly executable scripts?'
8669 if $test "X$ansexp" != "X$scriptdirexp"; then
8675 : A little fix up for an irregularly named variable.
8676 installscript="$installscriptdir"
8678 : determine where add-on public executables go
8680 '') dflt=$siteprefix/bin ;;
8684 rp='Pathname where the add-on public executables should be installed?'
8689 : determine where add-on html pages go
8690 : There is no standard location, so try to copy the previously-selected
8691 : directory structure for the core html pages.
8692 case "$sitehtml1dir" in
8693 '') dflt=`echo "$html1dir" | $sed "s#^$prefix#$siteprefix#"` ;;
8694 *) dflt=$sitehtml1dir ;;
8697 ''|' ') dflt=none ;;
8700 rp='Pathname where the site-specific html pages should be installed?'
8702 prefixvar=sitehtml1dir
8705 : determine where add-on library html pages go
8706 : There is no standard location, so try to copy the previously-selected
8707 : directory structure for the core html pages.
8708 case "$sitehtml3dir" in
8709 '') dflt=`echo "$html3dir" | $sed "s#^$prefix#$siteprefix#"` ;;
8710 *) dflt=$sitehtml3dir ;;
8713 ''|' ') dflt=none ;;
8716 rp='Pathname where the site-specific library html pages should be installed?'
8718 prefixvar=sitehtml3dir
8721 : determine where add-on manual pages go
8722 case "$siteman1dir" in
8723 '') dflt=`echo $man1dir | $sed "s#^$prefix#$siteprefix#"` ;;
8724 *) dflt=$siteman1dir ;;
8727 ''|' ') dflt=none ;;
8730 rp='Pathname where the site-specific manual pages should be installed?'
8732 prefixvar=siteman1dir
8735 : determine where add-on library man pages go
8736 case "$siteman3dir" in
8737 '') dflt=`echo $man3dir | $sed "s#^$prefix#$siteprefix#"` ;;
8738 *) dflt=$siteman3dir ;;
8741 ''|' ') dflt=none ;;
8744 rp='Pathname where the site-specific library manual pages should be installed?'
8746 prefixvar=siteman3dir
8749 : determine where add-on public executable scripts go
8750 case "$sitescript" in
8751 '') dflt=$siteprefix/script
8752 $test -d $dflt || dflt=$sitebin ;;
8753 *) dflt="$sitescript" ;;
8756 rp='Pathname where add-on public executable scripts should be installed?'
8758 prefixvar=sitescript
8761 case "$usefaststdio" in
8762 $define|true|[yY]*|'')
8763 xversion=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
8773 Perl can be built to use 'fast stdio', which means using the stdio
8774 library but also directly manipulating the stdio buffers to enable
8775 faster I/O. Using stdio is better for backward compatibility (especially
8776 for Perl extensions), but on the other hand since Perl 5.8 the 'perlio'
8777 interface has been preferred instead of stdio.
8779 If this doesn't make any sense to you, just accept the default '$dflt'.
8781 rp='Use the "fast stdio" if available?'
8784 y|Y) val="$define" ;;
8791 : define an is-a-typedef? function
8792 typedef='type=$1; var=$2; def=$3; shift; shift; shift; inclist=$@;
8794 "") inclist="sys/types.h";;
8796 eval "varval=\$$var";
8800 for inc in $inclist; do
8801 echo "#include <$inc>" >>temp.c;
8803 echo "#ifdef $type" >> temp.c;
8804 echo "printf(\"We have $type\");" >> temp.c;
8805 echo "#endif" >> temp.c;
8806 $cppstdin $cppflags $cppminus < temp.c >temp.E 2>/dev/null;
8807 if $contains $type temp.E >/dev/null 2>&1; then
8813 *) eval "$var=\$varval";;
8816 : define an is-a-typedef? function that prompts if the type is not available.
8817 typedef_ask='type=$1; var=$2; def=$3; shift; shift; shift; inclist=$@;
8819 "") inclist="sys/types.h";;
8821 eval "varval=\$$var";
8825 for inc in $inclist; do
8826 echo "#include <$inc>" >>temp.c;
8828 echo "#ifdef $type" >> temp.c;
8829 echo "printf(\"We have $type\");" >> temp.c;
8830 echo "#endif" >> temp.c;
8831 $cppstdin $cppflags $cppminus < temp.c >temp.E 2>/dev/null;
8833 echo "$rp" | $sed -e "s/What is/Looking for/" -e "s/?/./";
8834 if $contains $type temp.E >/dev/null 2>&1; then
8835 echo "$type found." >&4;
8838 echo "$type NOT found." >&4;
8844 *) eval "$var=\$varval";;
8847 : see what type lseek is declared as in the kernel
8848 rp="What is the type used for lseek's offset on this system?"
8849 set off_t lseektype long stdio.h sys/types.h
8853 echo "Checking to see how big your file offsets are..." >&4
8855 #include <sys/types.h>
8859 printf("%d\n", (int)sizeof($lseektype));
8864 if eval $compile_ok; then
8865 lseeksize=`$run ./try`
8866 echo "Your file offsets are $lseeksize bytes long."
8870 echo "(I can't seem to compile the test program. Guessing...)"
8871 rp="What is the size of your file offsets (in bytes)?"
8877 : see what type file positions are declared as in the library
8878 rp="What is the type for file position used by fsetpos()?"
8879 set fpos_t fpostype long stdio.h sys/types.h
8884 *_t) zzz="$fpostype" ;;
8887 echo "Checking the size of $zzz..." >&4
8889 #include <sys/types.h>
8896 printf("%d\n", (int)sizeof($fpostype));
8901 if eval $compile_ok; then
8905 echo "(I can't execute the test program--guessing $fpossize.)" >&4
8908 echo "Your $zzz is $fpossize bytes long."
8914 echo "(I can't compile the test program. Guessing...)" >&4
8915 rp="What is the size of your file positions (in bytes)?"
8920 # Backward compatibility (uselfs is deprecated).
8922 "$define"|true|[yY]*)
8925 *** Configure -Duselfs is deprecated, using -Duselargefiles instead.
8927 uselargefiles="$define"
8931 case "$lseeksize:$fpossize" in
8934 You can have files larger than 2 gigabytes.
8937 *) case "$uselargefiles" in
8938 "$undef"|false|[nN]*) dflt='n' ;;
8943 Perl can be built to understand large files (files larger than 2 gigabytes)
8944 on some systems. To do so, Configure can be run with -Duselargefiles.
8946 If this doesn't make any sense to you, just accept the default '$dflt'.
8948 rp='Try to understand large files, if available?'
8951 y|Y) val="$define" ;;
8958 : Look for a hint-file generated 'call-back-unit'. If the
8959 : user has specified that a large files perl is to be built,
8960 : we may need to set or change some other defaults.
8961 if $test -f uselargefiles.cbu; then
8962 echo "Your platform has some specific hints regarding large file builds, using them..."
8963 . ./uselargefiles.cbu
8965 case "$uselargefiles" in
8967 if $test -f uselargefiles.cbu; then
8969 echo "Rechecking to see how big your file offsets are..." >&4
8971 #include <sys/types.h>
8975 printf("%d\n", (int)sizeof($lseektype));
8980 if eval $compile_ok; then
8981 lseeksize=`$run ./try`
8982 $echo "Your file offsets are now $lseeksize bytes long."
8986 echo "(I can't seem to compile the test program. Guessing...)"
8987 rp="What is the size of your file offsets (in bytes)?"
8992 *_t) zzz="$fpostype" ;;
8995 $echo $n "Rechecking the size of $zzz...$c" >&4
8997 #include <sys/types.h>
9004 printf("%d\n", (int)sizeof($fpostype));
9009 if eval $compile_ok; then
9014 echo "(I can't execute the test program--guessing $fpossize.)" >&4
9017 echo " $fpossize bytes." >&4
9023 echo "(I can't compile the test program. Guessing...)" >&4
9024 rp="What is the size of your file positions (in bytes)?"
9033 case "$vendorprefix" in
9034 '') d_vendorbin="$undef"
9038 *) d_vendorbin="$define"
9039 : determine where vendor-supplied executables go.
9040 case "$vendorbin" in
9041 '') dflt=$vendorprefix/bin ;;
9042 *) dflt="$vendorbin" ;;
9045 rp='Pathname for the vendor-supplied executables directory?'
9048 vendorbinexp="$ansexp"
9054 case "$vendorprefix" in
9055 '') vendorhtml1dir=''
9056 vendorhtml1direxp=''
9058 *) : determine where vendor-supplied html pages go.
9059 : There is no standard location, so try to copy the previously-selected
9060 : directory structure for the core html pages.
9061 : XXX Better default suggestions would be welcome.
9062 case "$vendorhtml1dir" in
9063 '') dflt=`echo "$html1dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
9064 *) dflt=$vendorhtml1dir ;;
9067 ''|' ') dflt=none ;;
9070 rp='Pathname for the vendor-supplied html pages?'
9072 vendorhtml1dir="$ans"
9073 vendorhtml1direxp="$ansexp"
9076 : Use ' ' for none so value is preserved next time through Configure
9077 $test X"$vendorhtml1dir" = "X" && vendorhtml1dir=' '
9078 prefixvar=vendorhtml1dir
9081 case "$vendorprefix" in
9082 '') vendorhtml3dir=''
9083 vendorhtml3direxp=''
9085 *) : determine where vendor-supplied module html pages go.
9086 : There is no standard location, so try to copy the previously-selected
9087 : directory structure for the core html pages.
9088 : XXX Better default suggestions would be welcome.
9089 case "$vendorhtml3dir" in
9090 '') dflt=`echo "$html3dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
9091 *) dflt=$vendorhtml3dir ;;
9094 ''|' ') dflt=none ;;
9097 rp='Pathname for the vendor-supplied html pages?'
9099 vendorhtml3dir="$ans"
9100 vendorhtml3direxp="$ansexp"
9103 : Use ' ' for none so value is preserved next time through Configure
9104 $test X"$vendorhtml3dir" = "X" && vendorhtml3dir=' '
9105 prefixvar=vendorhtml3dir
9108 case "$vendorprefix" in
9109 '') vendorman1dir=''
9112 *) : determine where vendor-supplied manual pages go.
9113 case "$vendorman1dir" in
9114 '') dflt=`echo "$man1dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
9115 *) dflt=$vendorman1dir ;;
9118 ''|' ') dflt=none ;;
9121 rp='Pathname for the vendor-supplied manual section 1 pages?'
9123 vendorman1dir="$ans"
9124 vendorman1direxp="$ansexp"
9127 : Use ' ' for none so value is preserved next time through Configure
9128 $test X"$vendorman1dir" = "X" && vendorman1dir=' '
9129 prefixvar=vendorman1dir
9132 case "$vendorprefix" in
9133 '') vendorman3dir=''
9136 *) : determine where vendor-supplied module manual pages go.
9137 case "$vendorman3dir" in
9138 '') dflt=`echo "$man3dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
9139 *) dflt=$vendorman3dir ;;
9142 ''|' ') dflt=none ;;
9145 rp='Pathname for the vendor-supplied manual section 3 pages?'
9147 vendorman3dir="$ans"
9148 vendorman3direxp="$ansexp"
9151 : Use ' ' for none so value is preserved next time through Configure
9152 $test X"$vendorman3dir" = "X" && vendorman3dir=' '
9153 prefixvar=vendorman3dir
9156 case "$vendorprefix" in
9157 '') d_vendorscript="$undef"
9161 *) d_vendorscript="$define"
9162 : determine where vendor-supplied scripts go.
9163 case "$vendorscript" in
9164 '') dflt=$vendorprefix/script
9165 $test -d $dflt || dflt=$vendorbin ;;
9166 *) dflt="$vendorscript" ;;
9170 The installation process will create a directory for
9171 vendor-supplied scripts.
9175 rp='Pathname for the vendor-supplied scripts directory?'
9178 vendorscriptexp="$ansexp"
9181 prefixvar=vendorscript
9184 : see if qgcvt exists
9190 if $test X"$d_longdbl" = X"$define"; then
9192 echo "Checking how to print long doubles..." >&4
9194 if $test X"$sPRIfldbl" = X -a X"$doublesize" = X"$longdblsize"; then
9195 $cat >try.c <<'EOCP'
9196 #include <sys/types.h>
9200 printf("%.3f\n", d);
9204 if eval $compile; then
9208 sPRIfldbl='"f"'; sPRIgldbl='"g"'; sPRIeldbl='"e"';
9209 sPRIFUldbl='"F"'; sPRIGUldbl='"G"'; sPRIEUldbl='"E"';
9210 echo "We will use %f."
9216 if $test X"$sPRIfldbl" = X; then
9217 $cat >try.c <<'EOCP'
9218 #include <sys/types.h>
9221 long double d = 123.456;
9222 printf("%.3Lf\n", d);
9226 if eval $compile; then
9230 sPRIfldbl='"Lf"'; sPRIgldbl='"Lg"'; sPRIeldbl='"Le"';
9231 sPRIFUldbl='"LF"'; sPRIGUldbl='"LG"'; sPRIEUldbl='"LE"';
9232 echo "We will use %Lf."
9238 if $test X"$sPRIfldbl" = X; then
9239 $cat >try.c <<'EOCP'
9240 #include <sys/types.h>
9243 long double d = 123.456;
9244 printf("%.3llf\n", d);
9248 if eval $compile; then
9252 sPRIfldbl='"llf"'; sPRIgldbl='"llg"'; sPRIeldbl='"lle"';
9253 sPRIFUldbl='"llF"'; sPRIGUldbl='"llG"'; sPRIEUldbl='"llE"';
9254 echo "We will use %llf."
9260 if $test X"$sPRIfldbl" = X; then
9261 $cat >try.c <<'EOCP'
9262 #include <sys/types.h>
9265 long double d = 123.456;
9266 printf("%.3lf\n", d);
9270 if eval $compile; then
9274 sPRIfldbl='"lf"'; sPRIgldbl='"lg"'; sPRIeldbl='"le"';
9275 sPRIFUldbl='"lF"'; sPRIGUldbl='"lG"'; sPRIEUldbl='"lE"';
9276 echo "We will use %lf."
9282 if $test X"$sPRIfldbl" = X; then
9283 echo "Cannot figure out how to print long doubles." >&4
9285 sSCNfldbl=$sPRIfldbl # expect consistency
9292 case "$sPRIfldbl" in
9293 '') d_PRIfldbl="$undef"; d_PRIgldbl="$undef"; d_PRIeldbl="$undef";
9294 d_PRIFUldbl="$undef"; d_PRIGUldbl="$undef"; d_PRIEUldbl="$undef";
9295 d_SCNfldbl="$undef";
9297 *) d_PRIfldbl="$define"; d_PRIgldbl="$define"; d_PRIeldbl="$define";
9298 d_PRIFUldbl="$define"; d_PRIGUldbl="$define"; d_PRIEUldbl="$define";
9299 d_SCNfldbl="$define";
9303 : Check how to convert floats to strings.
9305 if test "X$d_Gconvert" = X; then
9308 echo "Checking for an efficient way to convert floats to strings."
9310 case "$uselongdouble" in
9311 "$define") echo "#define USE_LONG_DOUBLE" >>try.c ;;
9313 case "$d_longdbl" in
9314 "$define") echo "#define HAS_LONG_DOUBLE" >>try.c ;;
9316 case "$d_PRIgldbl" in
9317 "$define") echo "#define HAS_PRIgldbl" >>try.c ;;
9321 #define Gconvert(x,n,t,b) gconvert((x),(n),(t),(b))
9322 char *myname = "gconvert";
9325 #define Gconvert(x,n,t,b) gcvt((x),(n),(b))
9326 char *myname = "gcvt";
9329 #define Gconvert(x,n,t,b) qgcvt((x),(n),(b))
9330 char *myname = "qgcvt";
9331 #define DOUBLETYPE long double
9334 #if defined(USE_LONG_DOUBLE) && defined(HAS_LONG_DOUBLE)
9336 #define Gconvert(x,n,t,b) sprintf((b),"%.*"$sPRIgldbl,(n),(x))
9338 #define Gconvert(x,n,t,b) sprintf((b),"%.*g",(n),(double)(x))
9341 #define Gconvert(x,n,t,b) sprintf((b),"%.*g",(n),(x))
9343 char *myname = "sprintf";
9347 #if defined(USE_LONG_DOUBLE) && defined(HAS_LONG_DOUBLE)
9348 #define DOUBLETYPE long double
9350 #define DOUBLETYPE double
9356 #define I_STDLIB $i_stdlib
9362 checkit(expect, got)
9366 if (strcmp(expect, got)) {
9367 printf("%s oddity: Expected %s, got %s\n",
9368 myname, expect, got);
9378 /* This must be 1st test on (which?) platform */
9379 /* Alan Burlison <AlanBurlsin@unn.unisys.com> */
9380 Gconvert((DOUBLETYPE)0.1, 8, 0, buf);
9381 checkit("0.1", buf);
9383 Gconvert((DOUBLETYPE)0.01, 8, 0, buf);
9384 checkit("0.01", buf);
9386 Gconvert((DOUBLETYPE)0.001, 8, 0, buf);
9387 checkit("0.001", buf);
9389 Gconvert((DOUBLETYPE)0.0001, 8, 0, buf);
9390 checkit("0.0001", buf);
9392 Gconvert((DOUBLETYPE)0.00009, 8, 0, buf);
9393 if (strlen(buf) > 5)
9394 checkit("9e-005", buf); /* for Microsoft ?? */
9396 checkit("9e-05", buf);
9398 Gconvert((DOUBLETYPE)1.0, 8, 0, buf);
9401 Gconvert((DOUBLETYPE)1.1, 8, 0, buf);
9402 checkit("1.1", buf);
9404 Gconvert((DOUBLETYPE)1.01, 8, 0, buf);
9405 checkit("1.01", buf);
9407 Gconvert((DOUBLETYPE)1.001, 8, 0, buf);
9408 checkit("1.001", buf);
9410 Gconvert((DOUBLETYPE)1.0001, 8, 0, buf);
9411 checkit("1.0001", buf);
9413 Gconvert((DOUBLETYPE)1.00001, 8, 0, buf);
9414 checkit("1.00001", buf);
9416 Gconvert((DOUBLETYPE)1.000001, 8, 0, buf);
9417 checkit("1.000001", buf);
9419 Gconvert((DOUBLETYPE)0.0, 8, 0, buf);
9422 Gconvert((DOUBLETYPE)-1.0, 8, 0, buf);
9425 /* Some Linux gcvt's give 1.e+5 here. */
9426 Gconvert((DOUBLETYPE)100000.0, 8, 0, buf);
9427 checkit("100000", buf);
9429 /* Some Linux gcvt's give -1.e+5 here. */
9430 Gconvert((DOUBLETYPE)-100000.0, 8, 0, buf);
9431 checkit("-100000", buf);
9433 Gconvert((DOUBLETYPE)123.456, 8, 0, buf);
9434 checkit("123.456", buf);
9436 /* Testing of 1e+129 in bigintpm.t must not get extra '.' here. */
9437 Gconvert((DOUBLETYPE)1e34, 8, 0, buf);
9438 /* 34 should be enough to scare even long double
9439 * places into using the e notation. */
9440 if (strlen(buf) > 5)
9441 checkit("1e+034", buf); /* for Microsoft */
9443 checkit("1e+34", buf);
9445 /* For Perl, if you add additional tests here, also add them to
9446 * t/base/num.t for benefit of platforms not using Configure or
9447 * overriding d_Gconvert */
9452 : first add preferred functions to our list
9454 for xxx_convert in $gconvert_preference; do
9455 case $xxx_convert in
9456 gcvt|gconvert|sprintf) xxx_list="$xxx_list $xxx_convert" ;;
9457 *) echo "Discarding unrecognized gconvert_preference $xxx_convert" >&4 ;;
9460 : then add any others
9461 for xxx_convert in gconvert gcvt sprintf; do
9464 *) xxx_list="$xxx_list $xxx_convert" ;;
9468 case "$d_longdbl$uselongdouble" in
9470 : again, add prefered functions to our list first
9472 for xxx_convert in $gconvert_ld_preference; do
9473 case $xxx_convert in
9474 qgcvt|gcvt|gconvert|sprintf) xxx_ld_list="$xxx_ld_list $xxx_convert" ;;
9475 *) echo "Discarding unrecognized gconvert_ld_preference $xxx_convert" ;;
9478 : then add qgcvt, sprintf--then, in xxx_list order, gconvert and gcvt
9479 for xxx_convert in qgcvt sprintf $xxx_list; do
9480 case "$xxx_ld_list" in
9481 $xxx_convert*|*" $xxx_convert"*) ;;
9482 *) xxx_ld_list="$xxx_ld_list $xxx_convert" ;;
9485 : if sprintf cannot do long doubles, move it to the end
9486 if test "$d_PRIgldbl" != "$define"; then
9487 xxx_ld_list="`echo $xxx_ld_list|sed s/sprintf//` sprintf"
9489 : if no qgcvt, remove it
9490 if test "$d_qgcvt" != "$define"; then
9491 xxx_ld_list="`echo $xxx_ld_list|sed s/qgcvt//`"
9494 xxx_list="$xxx_ld_list"
9498 for xxx_convert in $xxx_list; do
9499 echo "Trying $xxx_convert..."
9501 set try -DTRY_$xxx_convert
9502 if eval $compile; then
9503 echo "$xxx_convert() found." >&4
9505 echo "I'll use $xxx_convert to convert floats into a string." >&4
9508 echo "...But $xxx_convert didn't work as I expected."
9512 echo "$xxx_convert NOT found." >&4
9516 if test X$xxx_convert = X; then
9517 echo "*** WHOA THERE!!! ***" >&4
9518 echo "None of ($xxx_list) seemed to work properly. I'll use sprintf." >&4
9522 case "$xxx_convert" in
9523 gconvert) d_Gconvert='gconvert((x),(n),(t),(b))' ;;
9524 gcvt) d_Gconvert='gcvt((x),(n),(b))' ;;
9525 qgcvt) d_Gconvert='qgcvt((x),(n),(b))' ;;
9526 *) case "$uselongdouble$d_longdbl$d_PRIgldbl" in
9527 "$define$define$define")
9528 d_Gconvert="sprintf((b),\"%.*\"$sPRIgldbl,(n),(x))" ;;
9529 "$define$define$undef")
9530 d_Gconvert='sprintf((b),"%.*g",(n),(double)(x))' ;;
9531 *) d_Gconvert='sprintf((b),"%.*g",(n),(x))' ;;
9538 : see if _fwalk exists
9542 : Initialize h_fcntl
9545 : Initialize h_sysfile
9548 : access call always available on UNIX
9552 : locate the flags for 'access()'
9556 $cat >access.c <<EOCP
9557 #include <sys/types.h>
9562 #include <sys/file.h>
9575 : check sys/file.h first, no particular reason here
9576 if $test `./findhdr sys/file.h` && \
9577 $cc -o access $cppflags -DI_SYS_FILE access.c >/dev/null 2>&1 ; then
9579 echo "<sys/file.h> defines the *_OK access constants." >&4
9580 elif $test `./findhdr fcntl.h` && \
9581 $cc -o access $cppflags -DI_FCNTL access.c >/dev/null 2>&1 ; then
9583 echo "<fcntl.h> defines the *_OK access constants." >&4
9584 elif $test `./findhdr unistd.h` && \
9585 $cc -o access $cppflags -DI_UNISTD access.c >/dev/null 2>&1 ; then
9586 echo "<unistd.h> defines the *_OK access constants." >&4
9588 echo "I can't find the four *_OK access constants--I'll use mine." >&4
9594 : see if accessx exists
9595 set accessx d_accessx
9598 : see if aintl exists
9602 : see if alarm exists
9606 : see if POSIX threads are available
9607 set pthread.h i_pthread
9610 : define a fucntion to check prototypes
9611 $cat > protochk <<EOSH
9614 optimize="$optimize"
9616 prototype="$prototype"
9619 usethreads=$usethreads
9620 i_pthread=$i_pthread
9621 pthread_h_first=$pthread_h_first
9624 $cat >> protochk <<'EOSH'
9629 while test $# -ge 2; do
9631 $define) echo "#include <$2>" >> try.c ;;
9632 literal) echo "$2" >> try.c ;;
9634 # Extra magic for the benefit of systems that need pthread.h
9635 # to be included early to correctly detect threadsafe functions.
9636 # Such functions must guarantee themselves, though, that the usethreads
9637 # and i_pthread have been defined, before calling protochk.
9638 if test "$usethreads" = "$define" -a "$i_pthread" = "$define" -a "$pthread_h_first" = "$define" -a "$pthread_h_done" = ""; then
9639 echo "#include <pthread.h>" >> try.c
9644 test "$prototype" = "$define" && echo '#define CAN_PROTOTYPE' >> try.c
9645 cat >> try.c <<'EOCP'
9646 #ifdef CAN_PROTOTYPE
9647 #define _(args) args
9652 echo "$foo" >> try.c
9653 echo 'int no_real_function_has_this_name _((void)) { return 0; }' >> try.c
9654 $cc $optimize $ccflags -c try.c > /dev/null 2>&1
9662 hasproto='varname=$1; func=$2; shift; shift;
9663 while $test $# -ge 2; do
9665 $define) echo "#include <$2>";;
9669 $cppstdin $cppflags $cppminus < try.c > tryout.c 2>/dev/null;
9670 if $contains "$func.*(" tryout.c >/dev/null 2>&1; then
9671 echo "$func() prototype found.";
9674 echo "$func() prototype NOT found.";
9679 $rm -f try.c tryout.c'
9681 : see if sys/types.h has to be included
9682 set sys/types.h i_systypes
9685 : see if sys/select.h has to be included
9686 set sys/select.h i_sysselct
9689 hasfield='varname=$1; struct=$2; field=$3; shift; shift; shift;
9690 while $test $# -ge 2; do
9692 $define) echo "#include <$2>";;
9696 echo "int main () { struct $struct foo; char* bar; bar = (char*)foo.$field; }" >> try.c;
9698 if eval $compile; then
9707 : see if we should include time.h, sys/time.h, or both
9709 if test "X$timeincl" = X; then
9710 echo "Testing to see if we should include <time.h>, <sys/time.h> or both." >&4
9711 $echo $n "I'm now running the test program...$c"
9713 #include <sys/types.h>
9718 #ifdef SYSTIMEKERNEL
9721 #include <sys/time.h>
9724 #include <sys/select.h>
9737 struct timezone tzp;
9739 if (foo.tm_sec == foo.tm_sec)
9742 if (bar.tv_sec == bar.tv_sec)
9749 for s_timezone in '-DS_TIMEZONE' ''; do
9751 for s_timeval in '-DS_TIMEVAL' ''; do
9752 for i_systimek in '' '-DSYSTIMEKERNEL'; do
9753 for i_time in '' '-DI_TIME'; do
9754 for i_systime in '-DI_SYSTIME' ''; do
9757 set try $i_time $i_systime $i_systimek $sysselect $s_timeval $s_timezone
9758 if eval $compile; then
9759 set X $i_time $i_systime $i_systimek $sysselect $s_timeval
9763 $echo $n "Succeeded with $flags$c"
9775 *SYSTIMEKERNEL*) i_systimek="$define"
9776 timeincl=`./findhdr sys/time.h`
9777 echo "We'll include <sys/time.h> with KERNEL defined." >&4;;
9778 *) i_systimek="$undef";;
9781 *I_TIME*) i_time="$define"
9782 timeincl=`./findhdr time.h`" $timeincl"
9783 echo "We'll include <time.h>." >&4;;
9784 *) i_time="$undef";;
9787 *I_SYSTIME*) i_systime="$define"
9788 timeincl=`./findhdr sys/time.h`" $timeincl"
9789 echo "We'll include <sys/time.h>." >&4;;
9790 *) i_systime="$undef";;
9794 : see if struct tm knows about tm_zone
9795 case "$i_systime$i_time" in
9798 echo "Checking to see if your struct tm has tm_zone field..." >&4
9799 set d_tm_tm_zone tm tm_zone $i_systime sys/time.h $i_time time.h
9807 case "$d_tm_tm_zone" in
9808 "$define") echo "Yes, it does." ;;
9809 *) echo "No, it doesn't." ;;
9811 : see if struct tm knows about tm_gmtoff
9812 case "$i_systime$i_time" in
9815 echo "Checking to see if your struct tm has tm_gmtoff field..." >&4
9816 set d_tm_tm_gmtoff tm tm_gmtoff $i_systime sys/time.h $i_time time.h
9824 case "$d_tm_tm_gmtoff" in
9825 "$define") echo "Yes, it does." ;;
9826 *) echo "No, it doesn't." ;;
9829 : see if asctime_r exists
9830 set asctime_r d_asctime_r
9832 case "$d_asctime_r" in
9834 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
9835 case "$d_asctime_r_proto:$usethreads" in
9836 ":define") d_asctime_r_proto=define
9837 set d_asctime_r_proto asctime_r $hdrs
9841 case "$d_asctime_r_proto" in
9843 case "$asctime_r_proto" in
9844 ''|0) try='char* asctime_r(const struct tm*, char*);'
9845 ./protochk "extern $try" $hdrs && asctime_r_proto=B_SB ;;
9847 case "$asctime_r_proto" in
9848 ''|0) try='char* asctime_r(const struct tm*, char*, int);'
9849 ./protochk "extern $try" $hdrs && asctime_r_proto=B_SBI ;;
9851 case "$asctime_r_proto" in
9852 ''|0) try='int asctime_r(const struct tm*, char*);'
9853 ./protochk "extern $try" $hdrs && asctime_r_proto=I_SB ;;
9855 case "$asctime_r_proto" in
9856 ''|0) try='int asctime_r(const struct tm*, char*, int);'
9857 ./protochk "extern $try" $hdrs && asctime_r_proto=I_SBI ;;
9859 case "$asctime_r_proto" in
9860 ''|0) d_asctime_r=undef
9862 echo "Disabling asctime_r, cannot determine prototype." >&4 ;;
9863 * ) case "$asctime_r_proto" in
9864 REENTRANT_PROTO*) ;;
9865 *) asctime_r_proto="REENTRANT_PROTO_$asctime_r_proto" ;;
9867 echo "Prototype: $try" ;;
9870 *) case "$usethreads" in
9871 define) echo "asctime_r has no prototype, not using it." >&4 ;;
9878 *) asctime_r_proto=0
9882 : see if atolf exists
9886 : see if atoll exists
9890 : Look for GCC-style attribute format
9891 case "$d_attribute_format" in
9894 echo "Checking whether your compiler can handle __attribute__((format)) ..." >&4
9895 $cat >attrib.c <<'EOCP'
9897 void my_special_printf(char* pat,...) __attribute__((__format__(__printf__,1,2)));
9899 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
9900 if $contains 'warning' attrib.out >/dev/null 2>&1; then
9901 echo "Your C compiler doesn't support __attribute__((format))."
9904 echo "Your C compiler supports __attribute__((format))."
9908 echo "Your C compiler doesn't seem to understand __attribute__ at all."
9912 *) val="$d_attribute_format" ;;
9914 set d_attribute_format
9918 : Look for GCC-style attribute malloc
9919 case "$d_attribute_malloc" in
9922 echo "Checking whether your compiler can handle __attribute__((malloc)) ..." >&4
9923 $cat >attrib.c <<'EOCP'
9925 char *go_get_some_memory( int how_many_bytes ) __attribute__((malloc));
9927 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
9928 if $contains 'warning' attrib.out >/dev/null 2>&1; then
9929 echo "Your C compiler doesn't support __attribute__((malloc))."
9932 echo "Your C compiler supports __attribute__((malloc))."
9936 echo "Your C compiler doesn't seem to understand __attribute__ at all."
9940 *) val="$d_attribute_malloc" ;;
9942 set d_attribute_malloc
9946 : Look for GCC-style attribute nonnull
9947 case "$d_attribute_nonnull" in
9950 echo "Checking whether your compiler can handle __attribute__((nonnull(1))) ..." >&4
9951 $cat >attrib.c <<'EOCP'
9953 void do_something (char *some_pointer,...) __attribute__((nonnull(1)));
9955 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
9956 if $contains 'warning' attrib.out >/dev/null 2>&1; then
9957 echo "Your C compiler doesn't support __attribute__((nonnull))."
9960 echo "Your C compiler supports __attribute__((nonnull))."
9964 echo "Your C compiler doesn't seem to understand __attribute__ at all."
9968 *) val="$d_attribute_nonnull" ;;
9970 set d_attribute_nonnull
9974 : Look for GCC-style attribute noreturn
9975 case "$d_attribute_noreturn" in
9978 echo "Checking whether your compiler can handle __attribute__((noreturn)) ..." >&4
9979 $cat >attrib.c <<'EOCP'
9981 void fall_over_dead( void ) __attribute__((noreturn));
9983 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
9984 if $contains 'warning' attrib.out >/dev/null 2>&1; then
9985 echo "Your C compiler doesn't support __attribute__((noreturn))."
9988 echo "Your C compiler supports __attribute__((noreturn))."
9992 echo "Your C compiler doesn't seem to understand __attribute__ at all."
9996 *) val="$d_attribute_noreturn" ;;
9998 set d_attribute_noreturn
10002 : Look for GCC-style attribute pure
10003 case "$d_attribute_pure" in
10006 echo "Checking whether your compiler can handle __attribute__((pure)) ..." >&4
10007 $cat >attrib.c <<'EOCP'
10009 int square( int n ) __attribute__((pure));
10011 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10012 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10013 echo "Your C compiler doesn't support __attribute__((pure))."
10016 echo "Your C compiler supports __attribute__((pure))."
10020 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10024 *) val="$d_attribute_pure" ;;
10026 set d_attribute_pure
10030 : Look for GCC-style attribute unused
10031 case "$d_attribute_unused" in
10034 echo "Checking whether your compiler can handle __attribute__((unused)) ..." >&4
10035 $cat >attrib.c <<'EOCP'
10037 int do_something( int dummy __attribute__((unused)), int n );
10039 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10040 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10041 echo "Your C compiler doesn't support __attribute__((unused))."
10044 echo "Your C compiler supports __attribute__((unused))."
10048 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10052 *) val="$d_attribute_unused" ;;
10054 set d_attribute_unused
10058 : Look for GCC-style attribute warn_unused_result
10059 case "$d_attribute_warn_unused_result" in
10062 echo "Checking whether your compiler can handle __attribute__((warn_unused_result)) ..." >&4
10063 $cat >attrib.c <<'EOCP'
10065 int I_will_not_be_ignored(void) __attribute__((warn_unused_result));
10067 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10068 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10069 echo "Your C compiler doesn't support __attribute__((warn_unused_result))."
10072 echo "Your C compiler supports __attribute__((warn_unused_result))."
10076 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10080 *) val="$d_attribute_warn_unused_result" ;;
10082 set d_attribute_warn_unused_result
10086 : see if bcmp exists
10090 : see if bcopy exists
10094 : see if this is a unistd.h system
10095 set unistd.h i_unistd
10098 : see if getpgrp exists
10099 set getpgrp d_getpgrp
10102 case "$d_getpgrp" in
10105 echo "Checking to see which flavor of getpgrp is in use..."
10107 #$i_unistd I_UNISTD
10108 #include <sys/types.h>
10110 # include <unistd.h>
10112 #$i_stdlib I_STDLIB
10114 #include <stdlib.h>
10118 if (getuid() == 0) {
10119 printf("(I see you are running Configure as super-user...)\n");
10122 #ifdef TRY_BSD_PGRP
10123 if (getpgrp(1) == 0)
10132 if $cc -o try -DTRY_BSD_PGRP $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
10133 echo "You have to use getpgrp(pid) instead of getpgrp()." >&4
10135 elif $cc -o try $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
10136 echo "You have to use getpgrp() instead of getpgrp(pid)." >&4
10139 echo "I can't seem to compile and run the test program."
10141 xxx="a USG one, i.e. you use getpgrp()."
10143 # SVR4 systems can appear rather BSD-ish.
10144 case "$i_unistd" in
10146 xxx="a BSD one, i.e. you use getpgrp(pid)."
10150 xxx="probably a USG one, i.e. you use getpgrp()."
10155 echo "Assuming your getpgrp is $xxx" >&4
10164 : see if setpgrp exists
10165 set setpgrp d_setpgrp
10168 case "$d_setpgrp" in
10171 echo "Checking to see which flavor of setpgrp is in use..."
10173 #$i_unistd I_UNISTD
10174 #include <sys/types.h>
10176 # include <unistd.h>
10178 #$i_stdlib I_STDLIB
10180 #include <stdlib.h>
10184 if (getuid() == 0) {
10185 printf("(I see you are running Configure as super-user...)\n");
10188 #ifdef TRY_BSD_PGRP
10189 if (-1 == setpgrp(1, 1))
10192 if (setpgrp() != -1)
10198 if $cc -o try -DTRY_BSD_PGRP $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
10199 echo 'You have to use setpgrp(pid,pgrp) instead of setpgrp().' >&4
10201 elif $cc -o try $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
10202 echo 'You have to use setpgrp() instead of setpgrp(pid,pgrp).' >&4
10205 echo "(I can't seem to compile and run the test program.)"
10207 xxx="a USG one, i.e. you use setpgrp()."
10209 # SVR4 systems can appear rather BSD-ish.
10210 case "$i_unistd" in
10212 xxx="a BSD one, i.e. you use setpgrp(pid,pgrp)."
10216 xxx="probably a USG one, i.e. you use setpgrp()."
10221 echo "Assuming your setpgrp is $xxx" >&4
10229 : Look for GCC-style __builtin_choose_expr
10230 case "$d_builtin_choose_expr" in
10233 echo "Checking whether your compiler can handle __builtin_choose_expr ..." >&4
10234 $cat >try.c <<'EOCP'
10235 #include <assert.h>
10236 #include <stdlib.h>
10239 #define SYRINX(x) __builtin_choose_expr( x, (1056*2), (103*50) )
10242 assert( SYRINX(1) == 2112 );
10243 assert( SYRINX(1) != 5150 );
10244 assert( SYRINX(0) == 5150 );
10245 assert( SYRINX(0) != 2112 );
10246 puts( "All good!" );
10252 if eval $compile; then
10253 echo "Your C compiler supports __builtin_choose_expr."
10256 echo "Your C compiler doesn't seem to understand __builtin_choose_expr."
10260 *) val="$d_builtin_choose_expr" ;;
10263 set d_builtin_choose_expr
10265 $rm -f try.* try core core.try.*
10267 : Look for GCC-style __builtin_expect
10268 case "$d_builtin_expect" in
10271 echo "Checking whether your compiler can handle __builtin_expect ..." >&4
10272 $cat >builtin.c <<'EOCP'
10275 if ( __builtin_expect(n, 0) ) n = 1;
10279 if eval $compile; then
10280 echo "Your C compiler supports __builtin_choose_expr."
10283 echo "Your C compiler doesn't seem to understand __builtin_choose_expr."
10287 *) val="$d_builtin_expect" ;;
10290 set d_builtin_expect
10292 $rm -f try.* try core core.try.*
10294 : see if bzero exists
10298 : see if signal is declared as pointer to function returning int or void
10300 xxx=`./findhdr signal.h`
10301 $test "$xxx" && $cppstdin $cppminus $cppflags < $xxx >$$.tmp 2>/dev/null
10302 if $contains 'int.*\*[ ]*signal' $$.tmp >/dev/null 2>&1 ; then
10303 echo "You have int (*signal())() instead of void." >&4
10305 elif $contains 'void.*\*[ ]*signal' $$.tmp >/dev/null 2>&1 ; then
10306 echo "You have void (*signal())()." >&4
10308 elif $contains 'extern[ ]*[(\*]*signal' $$.tmp >/dev/null 2>&1 ; then
10309 echo "You have int (*signal())() instead of void." >&4
10311 elif $contains 'void.*\*.*sig' $$.tmp >/dev/null 2>&1 ; then
10312 echo "You have void (*signal())()." >&4
10315 case "$d_voidsig" in
10317 echo "I can't determine whether signal handler returns void or int..." >&4
10319 rp="What type does your signal handler return?"
10322 v*) val="$define";;
10326 echo "As you already told me, signal handler returns void." >&4
10329 *) echo "As you already told me, signal handler returns int." >&4
10336 case "$d_voidsig" in
10337 "$define") signal_t="void";;
10338 *) signal_t="int";;
10342 : check for ability to cast large floats to 32-bit ints.
10344 echo 'Checking whether your C compiler can cast large floats to int32.' >&4
10345 if $test "$intsize" -ge 4; then
10352 #$i_stdlib I_STDLIB
10354 #include <stdlib.h>
10356 #include <sys/types.h>
10357 #include <signal.h>
10358 $signal_t blech(s) int s; { exit(3); }
10365 signal(SIGFPE, blech);
10367 /* Don't let compiler optimize the test away. Store the number
10368 in a writable string for gcc to pass to sscanf under HP/UX.
10370 sprintf(str, "2147483647");
10371 sscanf(str, "%lf", &f); /* f = (double) 0x7fffffff; */
10375 /* x86 processors will probably give 0x8000 0000, which is a
10376 sign change. We don't want that. We want to mimic SPARC
10377 behavior here, which is to preserve the sign and give
10380 if (i32 != ($xxx) f)
10386 if eval $compile_ok; then
10390 echo "(I can't seem to compile the test program--assuming it can't)"
10395 echo "Yup, it can."
10398 echo "Nope, it can't."
10405 : check for ability to cast negative floats to unsigned
10407 echo 'Checking whether your C compiler can cast negative float to unsigned.' >&4
10410 #$i_stdlib I_STDLIB
10412 #include <stdlib.h>
10414 #include <sys/types.h>
10415 #include <signal.h>
10416 $signal_t blech(s) int s; { exit(7); }
10417 $signal_t blech_in_list(s) int s; { exit(4); }
10418 unsigned long dummy_long(p) unsigned long p; { return p; }
10419 unsigned int dummy_int(p) unsigned int p; { return p; }
10420 unsigned short dummy_short(p) unsigned short p; { return p; }
10424 unsigned long along;
10426 unsigned short ashort;
10430 /* Frustrate gcc-2.7.2's optimizer which failed this test with
10431 a direct f = -123. assignment. gcc-2.8.0 reportedly
10432 optimized the whole file away
10434 /* Store the number in a writable string for gcc to pass to
10435 sscanf under HP/UX.
10437 sprintf(str, "-123");
10438 sscanf(str, "%lf", &f); /* f = -123.; */
10440 signal(SIGFPE, blech);
10441 along = (unsigned long)f;
10442 aint = (unsigned int)f;
10443 ashort = (unsigned short)f;
10444 if (along != (unsigned long)-123)
10446 if (aint != (unsigned int)-123)
10448 if (ashort != (unsigned short)-123)
10450 sprintf(str, "1073741824.");
10451 sscanf(str, "%lf", &f); /* f = (double)0x40000000; */
10454 along = (unsigned long)f;
10455 if (along != 0x80000000)
10459 along = (unsigned long)f;
10460 if (along != 0x7fffffff)
10464 along = (unsigned long)f;
10465 if (along != 0x80000001)
10469 signal(SIGFPE, blech_in_list);
10470 sprintf(str, "123.");
10471 sscanf(str, "%lf", &f); /* f = 123.; */
10472 along = dummy_long((unsigned long)f);
10473 aint = dummy_int((unsigned int)f);
10474 ashort = dummy_short((unsigned short)f);
10475 if (along != (unsigned long)123)
10477 if (aint != (unsigned int)123)
10479 if (ashort != (unsigned short)123)
10486 if eval $compile_ok; then
10490 echo "(I can't seem to compile the test program--assuming it can't)"
10493 case "$castflags" in
10495 echo "Yup, it can."
10498 echo "Nope, it can't."
10505 : see if vprintf exists
10507 if set vprintf val -f d_vprintf; eval $csym; $val; then
10508 echo 'vprintf() found.' >&4
10511 #include <varargs.h>
10512 #$i_stdlib I_STDLIB
10514 #include <stdlib.h>
10517 int main() { xxx("foo"); }
10526 exit((unsigned long)vsprintf(buf,"%s",args) > 10L);
10530 if eval $compile && $run ./try; then
10531 echo "Your vsprintf() returns (int)." >&4
10534 echo "Your vsprintf() returns (char*)." >&4
10538 echo 'vprintf() NOT found.' >&4
10549 : see if chown exists
10553 : see if chroot exists
10554 set chroot d_chroot
10557 : see if chsize exists
10558 set chsize d_chsize
10561 : see if class exists
10565 : see if clearenv exists
10566 set clearenv d_clearenv
10569 hasstruct='varname=$1; struct=$2; shift; shift;
10570 while $test $# -ge 2; do
10572 $define) echo "#include <$2>";;
10576 echo "int main () { struct $struct foo; }" >> try.c;
10578 if eval $compile; then
10585 $rm -f try.c try.o'
10589 : see whether socket exists
10591 $echo $n "Hmm... $c" >&4
10592 if set socket val -f d_socket; eval $csym; $val; then
10593 echo "Looks like you have Berkeley networking support." >&4
10595 if set setsockopt val -f; eval $csym; $val; then
10598 echo "...but it uses the old BSD 4.1c interface, rather than 4.2." >&4
10599 d_oldsock="$define"
10602 if $contains socklib libc.list >/dev/null 2>&1; then
10603 echo "Looks like you have Berkeley networking support." >&4
10605 : we will have to assume that it supports the 4.2 BSD interface
10608 echo "You don't have Berkeley networking in libc$_a..." >&4
10609 if test "X$d_socket" = "X$define"; then
10610 echo "...but you seem to believe that you have sockets." >&4
10612 for net in net socket
10614 if test -f /usr/lib/lib$net$_a; then
10615 ( ($nm $nm_opt /usr/lib/lib$net$_a | eval $nm_extract) || \
10616 $ar t /usr/lib/lib$net$_a) 2>/dev/null >> libc.list
10617 if $contains socket libc.list >/dev/null 2>&1; then
10622 echo "...but the Wollongong group seems to have hacked it in." >&4
10623 sockethdr="-I/usr/netinclude"
10626 echo "Found Berkeley sockets interface in lib$net." >&4
10627 if $contains setsockopt libc.list >/dev/null 2>&1; then
10630 echo "...using the old BSD 4.1c interface, rather than 4.2." >&4
10631 d_oldsock="$define"
10637 if test "X$d_socket" != "X$define"; then
10638 echo "or anywhere else I see." >&4
10646 : see if socketpair exists
10647 set socketpair d_sockpair
10652 echo "Checking the availability of certain socket constants..." >&4
10653 for ENUM in MSG_CTRUNC MSG_DONTROUTE MSG_OOB MSG_PEEK MSG_PROXY SCM_RIGHTS; do
10654 enum=`$echo $ENUM|./tr '[A-Z]' '[a-z]'`
10656 #include <sys/types.h>
10657 #include <sys/socket.h>
10663 set try; if eval $compile; then
10666 set d_${enum}; eval $setvar
10670 : see if this is a sys/uio.h system
10671 set sys/uio.h i_sysuio
10676 echo "Checking to see if your system supports struct cmsghdr..." >&4
10677 set d_cmsghdr_s cmsghdr $i_systypes sys/types.h $d_socket sys/socket.h $i_sysuio sys/uio.h
10679 case "$d_cmsghdr_s" in
10680 "$define") echo "Yes, it does." ;;
10681 *) echo "No, it doesn't." ;;
10685 : check for const keyword
10687 echo 'Checking to see if your C compiler knows about "const"...' >&4
10688 $cat >const.c <<'EOCP'
10689 typedef struct spug { int drokk; } spug;
10696 if $cc -c $ccflags const.c >/dev/null 2>&1 ; then
10698 echo "Yup, it does."
10701 echo "Nope, it doesn't."
10706 : see if copysignl exists
10707 set copysignl d_copysignl
10710 : see if crypt exists
10715 $define) cryptlib='' ;;
10716 *) if set crypt val -f d_crypt; eval $csym; $val; then
10717 echo 'crypt() found.' >&4
10721 cryptlib=`./loc Slibcrypt$_a "" $xlibpth`
10722 if $test -z "$cryptlib"; then
10723 cryptlib=`./loc Mlibcrypt$_a "" $xlibpth`
10727 if $test -z "$cryptlib"; then
10728 cryptlib=`./loc Llibcrypt$_a "" $xlibpth`
10732 if $test -z "$cryptlib"; then
10733 cryptlib=`./loc libcrypt$_a "" $libpth`
10737 if $test -z "$cryptlib"; then
10738 echo 'crypt() NOT found.' >&4
10749 : see if this is a crypt.h system
10750 set crypt.h i_crypt
10753 : see if crypt_r exists
10754 set crypt_r d_crypt_r
10756 case "$d_crypt_r" in
10758 hdrs="$i_systypes sys/types.h define stdio.h $i_crypt crypt.h"
10759 case "$d_crypt_r_proto:$usethreads" in
10760 ":define") d_crypt_r_proto=define
10761 set d_crypt_r_proto crypt_r $hdrs
10765 case "$d_crypt_r_proto" in
10767 case "$crypt_r_proto" in
10768 ''|0) try='char* crypt_r(const char*, const char*, struct crypt_data*);'
10769 ./protochk "extern $try" $hdrs && crypt_r_proto=B_CCS ;;
10771 case "$crypt_r_proto" in
10772 ''|0) try='char* crypt_r(const char*, const char*, CRYPTD*);'
10773 ./protochk "extern $try" $hdrs && crypt_r_proto=B_CCD ;;
10775 case "$crypt_r_proto" in
10776 ''|0) d_crypt_r=undef
10778 echo "Disabling crypt_r, cannot determine prototype." >&4 ;;
10779 * ) case "$crypt_r_proto" in
10780 REENTRANT_PROTO*) ;;
10781 *) crypt_r_proto="REENTRANT_PROTO_$crypt_r_proto" ;;
10783 echo "Prototype: $try" ;;
10786 *) case "$usethreads" in
10787 define) echo "crypt_r has no prototype, not using it." >&4 ;;
10798 : get csh whereabouts
10800 'csh') val="$undef" ;;
10801 *) val="$define" ;;
10805 : Respect a hint or command line value for full_csh.
10806 case "$full_csh" in
10807 '') full_csh=$csh ;;
10810 : see if ctermid_r exists
10811 set ctermid_r d_ctermid_r
10813 case "$d_ctermid_r" in
10815 hdrs="$i_systypes sys/types.h define stdio.h "
10816 case "$d_ctermid_r_proto:$usethreads" in
10817 ":define") d_ctermid_r_proto=define
10818 set d_ctermid_r_proto ctermid_r $hdrs
10822 case "$d_ctermid_r_proto" in
10824 case "$ctermid_r_proto" in
10825 ''|0) try='char* ctermid_r(char*);'
10826 ./protochk "extern $try" $hdrs && ctermid_r_proto=B_B ;;
10828 case "$ctermid_r_proto" in
10829 ''|0) d_ctermid_r=undef
10831 echo "Disabling ctermid_r, cannot determine prototype." >&4 ;;
10832 * ) case "$ctermid_r_proto" in
10833 REENTRANT_PROTO*) ;;
10834 *) ctermid_r_proto="REENTRANT_PROTO_$ctermid_r_proto" ;;
10836 echo "Prototype: $try" ;;
10839 *) case "$usethreads" in
10840 define) echo "ctermid_r has no prototype, not using it." >&4 ;;
10847 *) ctermid_r_proto=0
10851 : see if ctime_r exists
10852 set ctime_r d_ctime_r
10854 case "$d_ctime_r" in
10856 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
10857 case "$d_ctime_r_proto:$usethreads" in
10858 ":define") d_ctime_r_proto=define
10859 set d_ctime_r_proto ctime_r $hdrs
10863 case "$d_ctime_r_proto" in
10865 case "$ctime_r_proto" in
10866 ''|0) try='char* ctime_r(const time_t*, char*);'
10867 ./protochk "extern $try" $hdrs && ctime_r_proto=B_SB ;;
10869 case "$ctime_r_proto" in
10870 ''|0) try='char* ctime_r(const time_t*, char*, int);'
10871 ./protochk "extern $try" $hdrs && ctime_r_proto=B_SBI ;;
10873 case "$ctime_r_proto" in
10874 ''|0) try='int ctime_r(const time_t*, char*);'
10875 ./protochk "extern $try" $hdrs && ctime_r_proto=I_SB ;;
10877 case "$ctime_r_proto" in
10878 ''|0) try='int ctime_r(const time_t*, char*, int);'
10879 ./protochk "extern $try" $hdrs && ctime_r_proto=I_SBI ;;
10881 case "$ctime_r_proto" in
10882 ''|0) d_ctime_r=undef
10884 echo "Disabling ctime_r, cannot determine prototype." >&4 ;;
10885 * ) case "$ctime_r_proto" in
10886 REENTRANT_PROTO*) ;;
10887 *) ctime_r_proto="REENTRANT_PROTO_$ctime_r_proto" ;;
10889 echo "Prototype: $try" ;;
10892 *) case "$usethreads" in
10893 define) echo "ctime_r has no prototype, not using it." >&4 ;;
10904 : see if cuserid exists
10905 set cuserid d_cuserid
10908 : see if this is a limits.h system
10909 set limits.h i_limits
10912 : see if this is a float.h system
10913 set float.h i_float
10916 : See if number of significant digits in a double precision number is known
10918 $cat >dbl_dig.c <<EOM
10919 #$i_limits I_LIMITS
10922 #include <limits.h>
10928 printf("Contains DBL_DIG");
10931 $cppstdin $cppflags $cppminus < dbl_dig.c >dbl_dig.E 2>/dev/null
10932 if $contains 'DBL_DIG' dbl_dig.E >/dev/null 2>&1; then
10933 echo "DBL_DIG found." >&4
10936 echo "DBL_DIG NOT found." >&4
10943 : see if dbm.h is available
10944 : see if dbmclose exists
10945 set dbmclose d_dbmclose
10948 case "$d_dbmclose" in
10958 *) set rpcsvc/dbm.h i_rpcsvcdbm
10963 *) echo "We won't be including <dbm.h>"
10973 : see if prototype for dbminit is available
10975 set d_dbminitproto dbminit $i_dbm dbm.h
10978 : see if difftime exists
10979 set difftime d_difftime
10982 : see if this is a dirent system
10984 if xinc=`./findhdr dirent.h`; $test "$xinc"; then
10986 echo "<dirent.h> found." >&4
10989 if xinc=`./findhdr sys/dir.h`; $test "$xinc"; then
10990 echo "<sys/dir.h> found." >&4
10993 xinc=`./findhdr sys/ndir.h`
10995 echo "<dirent.h> NOT found." >&4
11000 : Look for type of directory structure.
11002 $cppstdin $cppflags $cppminus < "$xinc" > try.c
11004 case "$direntrytype" in
11006 case "$i_dirent" in
11007 $define) guess1='struct dirent' ;;
11008 *) guess1='struct direct' ;;
11011 *) guess1="$direntrytype"
11016 'struct dirent') guess2='struct direct' ;;
11017 *) guess2='struct dirent' ;;
11020 if $contains "$guess1" try.c >/dev/null 2>&1; then
11021 direntrytype="$guess1"
11022 echo "Your directory entries are $direntrytype." >&4
11023 elif $contains "$guess2" try.c >/dev/null 2>&1; then
11024 direntrytype="$guess2"
11025 echo "Your directory entries seem to be $direntrytype." >&4
11027 echo "I don't recognize your system's directory entries." >&4
11028 rp="What type is used for directory entries on this system?"
11031 direntrytype="$ans"
11036 : see if the directory entry stores field length
11038 $cppstdin $cppflags $cppminus < "$xinc" > try.c
11039 if $contains 'd_namlen' try.c >/dev/null 2>&1; then
11040 echo "Good, your directory entry keeps length information in d_namlen." >&4
11043 echo "Your directory entry does not know about the d_namlen field." >&4
11050 : see if this is an sysdir system
11051 set sys/dir.h i_sysdir
11054 : see if this is an sysndir system
11055 set sys/ndir.h i_sysndir
11060 $cat >dirfd.c <<EOM
11062 #$i_stdlib I_STDLIB
11064 #include <stdlib.h>
11066 #$i_dirent I_DIRENT /**/
11067 #$i_sysdir I_SYS_DIR /**/
11068 #$i_sysndir I_SYS_NDIR /**/
11069 #$i_systypes I_SYS_TYPES /**/
11070 #if defined(I_SYS_TYPES)
11071 #include <sys/types.h>
11073 #if defined(I_DIRENT)
11074 #include <dirent.h>
11075 #if defined(NeXT) && defined(I_SYS_DIR) /* NeXT needs dirent + sys/dir.h */
11076 #include <sys/dir.h>
11080 #include <sys/ndir.h>
11084 #include <ndir.h> /* may be wrong in the future */
11086 #include <sys/dir.h>
11092 DIR *dirp = opendir(".");
11093 if (dirfd(dirp) >= 0)
11101 if eval $compile; then
11105 $define) echo "dirfd() found." >&4 ;;
11106 *) echo "dirfd() NOT found." >&4 ;;
11112 : see if dlerror exists
11115 set dlerror d_dlerror
11119 : see if dlfcn is available
11120 set dlfcn.h i_dlfcn
11127 On a few systems, the dynamically loaded modules that perl generates and uses
11128 will need a different extension than shared libs. The default will probably
11134 *) dflt="$dlext" ;;
11136 rp='What is the extension of dynamically loaded modules'
11145 : Check if dlsym need a leading underscore
11151 echo "Checking whether your dlsym() needs a leading underscore ..." >&4
11152 $cat >dyna.c <<'EOM'
11159 #$i_stdlib I_STDLIB
11161 #include <stdlib.h>
11165 #include <dlfcn.h> /* the dynamic linker include file for SunOS/Solaris */
11167 #include <sys/types.h>
11172 extern int fred() ;
11181 int mode = RTLD_LAZY ;
11183 handle = dlopen("./dyna.$dlext", mode) ;
11184 if (handle == NULL) {
11189 symbol = dlsym(handle, "fred") ;
11190 if (symbol == NULL) {
11191 /* try putting a leading underscore */
11192 symbol = dlsym(handle, "_fred") ;
11193 if (symbol == NULL) {
11206 : Call the object file tmp-dyna.o in case dlext=o.
11207 if $cc $ccflags $cccdlflags -c dyna.c > /dev/null 2>&1 &&
11208 mv dyna${_o} tmp-dyna${_o} > /dev/null 2>&1 &&
11209 $ld -o dyna.$dlext $ldflags $lddlflags tmp-dyna${_o} > /dev/null 2>&1 &&
11210 $cc -o fred $ccflags $ldflags $cccdlflags $ccdlflags fred.c $libs > /dev/null 2>&1 && $to dyna.$dlext; then
11213 1) echo "Test program failed using dlopen." >&4
11214 echo "Perhaps you should not use dynamic loading." >&4;;
11215 2) echo "Test program failed using dlsym." >&4
11216 echo "Perhaps you should not use dynamic loading." >&4;;
11217 3) echo "dlsym needs a leading underscore" >&4
11219 4) echo "dlsym doesn't need a leading underscore." >&4;;
11222 echo "I can't compile and run the test program." >&4
11223 echo "I'm guessing that dlsym doesn't need a leading underscore." >&4
11228 $rm -f fred fred.* dyna.$dlext dyna.* tmp-dyna.*
11233 : see if drand48_r exists
11234 set drand48_r d_drand48_r
11236 case "$d_drand48_r" in
11238 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
11239 case "$d_drand48_r_proto:$usethreads" in
11240 ":define") d_drand48_r_proto=define
11241 set d_drand48_r_proto drand48_r $hdrs
11245 case "$d_drand48_r_proto" in
11247 case "$drand48_r_proto" in
11248 ''|0) try='int drand48_r(struct drand48_data*, double*);'
11249 ./protochk "extern $try" $hdrs && drand48_r_proto=I_ST ;;
11251 case "$drand48_r_proto" in
11252 ''|0) d_drand48_r=undef
11254 echo "Disabling drand48_r, cannot determine prototype." >&4 ;;
11255 * ) case "$drand48_r_proto" in
11256 REENTRANT_PROTO*) ;;
11257 *) drand48_r_proto="REENTRANT_PROTO_$drand48_r_proto" ;;
11259 echo "Prototype: $try" ;;
11262 *) case "$usethreads" in
11263 define) echo "drand48_r has no prototype, not using it." >&4 ;;
11270 *) drand48_r_proto=0
11274 : see if prototype for drand48 is available
11276 set d_drand48proto drand48 $i_stdlib stdlib.h $i_unistd unistd.h
11279 : see if dup2 exists
11283 : see if eaccess exists
11284 set eaccess d_eaccess
11287 : see if endgrent exists
11288 set endgrent d_endgrent
11291 : see if this is an grp system
11297 xxx=`./findhdr grp.h`
11298 $cppstdin $cppflags $cppminus < $xxx >$$.h
11300 if $contains 'gr_passwd' $$.h >/dev/null 2>&1; then
11312 set d_grpasswd; eval $setvar
11316 : see if endgrent_r exists
11317 set endgrent_r d_endgrent_r
11319 case "$d_endgrent_r" in
11321 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
11322 case "$d_endgrent_r_proto:$usethreads" in
11323 ":define") d_endgrent_r_proto=define
11324 set d_endgrent_r_proto endgrent_r $hdrs
11328 case "$d_endgrent_r_proto" in
11330 case "$endgrent_r_proto" in
11331 ''|0) try='int endgrent_r(FILE**);'
11332 ./protochk "extern $try" $hdrs && endgrent_r_proto=I_H ;;
11334 case "$endgrent_r_proto" in
11335 ''|0) try='void endgrent_r(FILE**);'
11336 ./protochk "extern $try" $hdrs && endgrent_r_proto=V_H ;;
11338 case "$endgrent_r_proto" in
11339 ''|0) d_endgrent_r=undef
11341 echo "Disabling endgrent_r, cannot determine prototype." >&4 ;;
11342 * ) case "$endgrent_r_proto" in
11343 REENTRANT_PROTO*) ;;
11344 *) endgrent_r_proto="REENTRANT_PROTO_$endgrent_r_proto" ;;
11346 echo "Prototype: $try" ;;
11349 *) case "$usethreads" in
11350 define) echo "endgrent_r has no prototype, not using it." >&4 ;;
11357 *) endgrent_r_proto=0
11361 : see if endhostent exists
11362 set endhostent d_endhent
11365 : see if this is a netdb.h system
11366 set netdb.h i_netdb
11369 : see if endhostent_r exists
11370 set endhostent_r d_endhostent_r
11372 case "$d_endhostent_r" in
11374 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
11375 case "$d_endhostent_r_proto:$usethreads" in
11376 ":define") d_endhostent_r_proto=define
11377 set d_endhostent_r_proto endhostent_r $hdrs
11381 case "$d_endhostent_r_proto" in
11383 case "$endhostent_r_proto" in
11384 ''|0) try='int endhostent_r(struct hostent_data*);'
11385 ./protochk "extern $try" $hdrs && endhostent_r_proto=I_D ;;
11387 case "$endhostent_r_proto" in
11388 ''|0) try='void endhostent_r(struct hostent_data*);'
11389 ./protochk "extern $try" $hdrs && endhostent_r_proto=V_D ;;
11391 case "$endhostent_r_proto" in
11392 ''|0) d_endhostent_r=undef
11393 endhostent_r_proto=0
11394 echo "Disabling endhostent_r, cannot determine prototype." >&4 ;;
11395 * ) case "$endhostent_r_proto" in
11396 REENTRANT_PROTO*) ;;
11397 *) endhostent_r_proto="REENTRANT_PROTO_$endhostent_r_proto" ;;
11399 echo "Prototype: $try" ;;
11402 *) case "$usethreads" in
11403 define) echo "endhostent_r has no prototype, not using it." >&4 ;;
11405 d_endhostent_r=undef
11406 endhostent_r_proto=0
11410 *) endhostent_r_proto=0
11414 : see if endnetent exists
11415 set endnetent d_endnent
11418 : see if endnetent_r exists
11419 set endnetent_r d_endnetent_r
11421 case "$d_endnetent_r" in
11423 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
11424 case "$d_endnetent_r_proto:$usethreads" in
11425 ":define") d_endnetent_r_proto=define
11426 set d_endnetent_r_proto endnetent_r $hdrs
11430 case "$d_endnetent_r_proto" in
11432 case "$endnetent_r_proto" in
11433 ''|0) try='int endnetent_r(struct netent_data*);'
11434 ./protochk "extern $try" $hdrs && endnetent_r_proto=I_D ;;
11436 case "$endnetent_r_proto" in
11437 ''|0) try='void endnetent_r(struct netent_data*);'
11438 ./protochk "extern $try" $hdrs && endnetent_r_proto=V_D ;;
11440 case "$endnetent_r_proto" in
11441 ''|0) d_endnetent_r=undef
11442 endnetent_r_proto=0
11443 echo "Disabling endnetent_r, cannot determine prototype." >&4 ;;
11444 * ) case "$endnetent_r_proto" in
11445 REENTRANT_PROTO*) ;;
11446 *) endnetent_r_proto="REENTRANT_PROTO_$endnetent_r_proto" ;;
11448 echo "Prototype: $try" ;;
11451 *) case "$usethreads" in
11452 define) echo "endnetent_r has no prototype, not using it." >&4 ;;
11454 d_endnetent_r=undef
11455 endnetent_r_proto=0
11459 *) endnetent_r_proto=0
11463 : see if endprotoent exists
11464 set endprotoent d_endpent
11467 : see if endprotoent_r exists
11468 set endprotoent_r d_endprotoent_r
11470 case "$d_endprotoent_r" in
11472 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
11473 case "$d_endprotoent_r_proto:$usethreads" in
11474 ":define") d_endprotoent_r_proto=define
11475 set d_endprotoent_r_proto endprotoent_r $hdrs
11479 case "$d_endprotoent_r_proto" in
11481 case "$endprotoent_r_proto" in
11482 ''|0) try='int endprotoent_r(struct protoent_data*);'
11483 ./protochk "extern $try" $hdrs && endprotoent_r_proto=I_D ;;
11485 case "$endprotoent_r_proto" in
11486 ''|0) try='void endprotoent_r(struct protoent_data*);'
11487 ./protochk "extern $try" $hdrs && endprotoent_r_proto=V_D ;;
11489 case "$endprotoent_r_proto" in
11490 ''|0) d_endprotoent_r=undef
11491 endprotoent_r_proto=0
11492 echo "Disabling endprotoent_r, cannot determine prototype." >&4 ;;
11493 * ) case "$endprotoent_r_proto" in
11494 REENTRANT_PROTO*) ;;
11495 *) endprotoent_r_proto="REENTRANT_PROTO_$endprotoent_r_proto" ;;
11497 echo "Prototype: $try" ;;
11500 *) case "$usethreads" in
11501 define) echo "endprotoent_r has no prototype, not using it." >&4 ;;
11503 d_endprotoent_r=undef
11504 endprotoent_r_proto=0
11508 *) endprotoent_r_proto=0
11512 : see if endpwent exists
11513 set endpwent d_endpwent
11516 : see if this is a pwd.h system
11522 xxx=`./findhdr pwd.h`
11523 $cppstdin $cppflags $cppminus < $xxx >$$.h
11525 if $contains 'pw_quota' $$.h >/dev/null 2>&1; then
11533 if $contains 'pw_age' $$.h >/dev/null 2>&1; then
11541 if $contains 'pw_change' $$.h >/dev/null 2>&1; then
11549 if $contains 'pw_class' $$.h >/dev/null 2>&1; then
11557 if $contains 'pw_expire' $$.h >/dev/null 2>&1; then
11565 if $contains 'pw_comment' $$.h >/dev/null 2>&1; then
11573 if $contains 'pw_gecos' $$.h >/dev/null 2>&1; then
11581 if $contains 'pw_passwd' $$.h >/dev/null 2>&1; then
11593 set d_pwquota; eval $setvar
11594 set d_pwage; eval $setvar
11595 set d_pwchange; eval $setvar
11596 set d_pwclass; eval $setvar
11597 set d_pwexpire; eval $setvar
11598 set d_pwcomment; eval $setvar
11599 set d_pwgecos; eval $setvar
11600 set d_pwpasswd; eval $setvar
11604 : see if endpwent_r exists
11605 set endpwent_r d_endpwent_r
11607 case "$d_endpwent_r" in
11609 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
11610 case "$d_endpwent_r_proto:$usethreads" in
11611 ":define") d_endpwent_r_proto=define
11612 set d_endpwent_r_proto endpwent_r $hdrs
11616 case "$d_endpwent_r_proto" in
11618 case "$endpwent_r_proto" in
11619 ''|0) try='int endpwent_r(FILE**);'
11620 ./protochk "extern $try" $hdrs && endpwent_r_proto=I_H ;;
11622 case "$endpwent_r_proto" in
11623 ''|0) try='void endpwent_r(FILE**);'
11624 ./protochk "extern $try" $hdrs && endpwent_r_proto=V_H ;;
11626 case "$endpwent_r_proto" in
11627 ''|0) d_endpwent_r=undef
11629 echo "Disabling endpwent_r, cannot determine prototype." >&4 ;;
11630 * ) case "$endpwent_r_proto" in
11631 REENTRANT_PROTO*) ;;
11632 *) endpwent_r_proto="REENTRANT_PROTO_$endpwent_r_proto" ;;
11634 echo "Prototype: $try" ;;
11637 *) case "$usethreads" in
11638 define) echo "endpwent_r has no prototype, not using it." >&4 ;;
11645 *) endpwent_r_proto=0
11649 : see if endservent exists
11650 set endservent d_endsent
11653 : see if endservent_r exists
11654 set endservent_r d_endservent_r
11656 case "$d_endservent_r" in
11658 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
11659 case "$d_endservent_r_proto:$usethreads" in
11660 ":define") d_endservent_r_proto=define
11661 set d_endservent_r_proto endservent_r $hdrs
11665 case "$d_endservent_r_proto" in
11667 case "$endservent_r_proto" in
11668 ''|0) try='int endservent_r(struct servent_data*);'
11669 ./protochk "extern $try" $hdrs && endservent_r_proto=I_D ;;
11671 case "$endservent_r_proto" in
11672 ''|0) try='void endservent_r(struct servent_data*);'
11673 ./protochk "extern $try" $hdrs && endservent_r_proto=V_D ;;
11675 case "$endservent_r_proto" in
11676 ''|0) d_endservent_r=undef
11677 endservent_r_proto=0
11678 echo "Disabling endservent_r, cannot determine prototype." >&4 ;;
11679 * ) case "$endservent_r_proto" in
11680 REENTRANT_PROTO*) ;;
11681 *) endservent_r_proto="REENTRANT_PROTO_$endservent_r_proto" ;;
11683 echo "Prototype: $try" ;;
11686 *) case "$usethreads" in
11687 define) echo "endservent_r has no prototype, not using it." >&4 ;;
11689 d_endservent_r=undef
11690 endservent_r_proto=0
11694 *) endservent_r_proto=0
11698 : Locate the flags for 'open()'
11701 #include <sys/types.h>
11706 #include <sys/file.h>
11708 #$i_stdlib I_STDLIB
11710 #include <stdlib.h>
11721 : check sys/file.h first to get FREAD on Sun
11722 if $test `./findhdr sys/file.h` && \
11723 set try -DI_SYS_FILE && eval $compile; then
11725 echo "<sys/file.h> defines the O_* constants..." >&4
11726 if $run ./try; then
11727 echo "and you have the 3 argument form of open()." >&4
11730 echo "but not the 3 argument form of open(). Oh, well." >&4
11733 elif $test `./findhdr fcntl.h` && \
11734 set try -DI_FCNTL && eval $compile; then
11736 echo "<fcntl.h> defines the O_* constants..." >&4
11737 if $run ./try; then
11738 echo "and you have the 3 argument form of open()." >&4
11741 echo "but not the 3 argument form of open(). Oh, well." >&4
11746 echo "I can't find the O_* constant definitions! You got problems." >&4
11752 : see which of string.h or strings.h is needed
11754 strings=`./findhdr string.h`
11755 if $test "$strings" && $test -r "$strings"; then
11756 echo "Using <string.h> instead of <strings.h>." >&4
11760 strings=`./findhdr strings.h`
11761 if $test "$strings" && $test -r "$strings"; then
11762 echo "Using <strings.h> instead of <string.h>." >&4
11764 echo "No string header found -- You'll surely have problems." >&4
11769 case "$i_string" in
11770 "$undef") strings=`./findhdr strings.h`;;
11771 *) strings=`./findhdr string.h`;;
11774 : see if this is a sys/file.h system
11779 : do we need to include sys/file.h ?
11783 if $h_sysfile; then
11785 echo "We'll be including <sys/file.h>." >&4
11788 echo "We won't be including <sys/file.h>." >&4
11798 : see if fcntl.h is there
11803 : see if we can include fcntl.h
11809 echo "We'll be including <fcntl.h>." >&4
11812 if $h_sysfile; then
11813 echo "We don't need to include <fcntl.h> if we include <sys/file.h>." >&4
11815 echo "We won't be including <fcntl.h>." >&4
11827 : check for non-blocking I/O stuff
11828 case "$h_sysfile" in
11829 true) echo "#include <sys/file.h>" > head.c;;
11832 true) echo "#include <fcntl.h>" > head.c;;
11833 *) echo "#include <sys/fcntl.h>" > head.c;;
11838 echo "Figuring out the flag used by open() for non-blocking I/O..." >&4
11839 case "$o_nonblock" in
11841 $cat head.c > try.c
11842 $cat >>try.c <<EOCP
11844 #$i_stdlib I_STDLIB
11846 #include <stdlib.h>
11854 printf("O_NONBLOCK\n");
11858 printf("O_NDELAY\n");
11862 printf("FNDELAY\n");
11869 if eval $compile_ok; then
11870 o_nonblock=`$run ./try`
11871 case "$o_nonblock" in
11872 '') echo "I can't figure it out, assuming O_NONBLOCK will do.";;
11873 *) echo "Seems like we can use $o_nonblock.";;
11876 echo "(I can't compile the test program; pray O_NONBLOCK is right!)"
11879 *) echo "Using $hint value $o_nonblock.";;
11881 $rm -f try try.* .out core
11884 echo "Let's see what value errno gets from read() on a $o_nonblock file..." >&4
11887 $cat head.c > try.c
11888 $cat >>try.c <<EOCP
11890 #include <sys/types.h>
11891 #include <signal.h>
11893 #$i_stdlib I_STDLIB
11895 #include <stdlib.h>
11901 #define MY_O_NONBLOCK $o_nonblock
11902 #ifndef errno /* XXX need better Configure test */
11905 #$i_unistd I_UNISTD
11907 #include <unistd.h>
11909 #$i_string I_STRING
11911 #include <string.h>
11913 #include <strings.h>
11915 $signal_t blech(x) int x; { exit(3); }
11917 $cat >> try.c <<'EOCP'
11925 pipe(pd); /* Down: child -> parent */
11926 pipe(pu); /* Up: parent -> child */
11929 close(pd[1]); /* Parent reads from pd[0] */
11930 close(pu[0]); /* Parent writes (blocking) to pu[1] */
11932 if (-1 == fcntl(pd[0], F_SETFL, MY_O_NONBLOCK))
11937 signal(SIGALRM, blech);
11939 if ((ret = read(pd[0], buf, 1)) > 0) /* Nothing to read! */
11941 sprintf(string, "%d\n", ret);
11942 write(2, string, strlen(string));
11945 if (errno == EAGAIN) {
11946 printf("EAGAIN\n");
11951 if (errno == EWOULDBLOCK)
11952 printf("EWOULDBLOCK\n");
11955 write(pu[1], buf, 1); /* Unblocks child, tell it to close our pipe */
11956 sleep(2); /* Give it time to close our pipe */
11958 ret = read(pd[0], buf, 1); /* Should read EOF */
11960 sprintf(string, "%d\n", ret);
11961 write(4, string, strlen(string));
11965 close(pd[0]); /* We write to pd[1] */
11966 close(pu[1]); /* We read from pu[0] */
11967 read(pu[0], buf, 1); /* Wait for parent to signal us we may continue */
11968 close(pd[1]); /* Pipe pd is now fully closed! */
11969 exit(0); /* Bye bye, thank you for playing! */
11973 if eval $compile_ok; then
11974 echo "$startsh" >mtry
11975 echo "$run ./try >try.out 2>try.ret 4>try.err || exit 4" >>mtry
11977 ./mtry >/dev/null 2>&1
11979 0) eagain=`$cat try.out`;;
11980 1) echo "Could not perform non-blocking setting!";;
11981 2) echo "I did a successful read() for something that was not there!";;
11982 3) echo "Hmm... non-blocking I/O does not seem to be working!";;
11983 4) echo "Could not find F_SETFL!";;
11984 *) echo "Something terribly wrong happened during testing.";;
11986 rd_nodata=`$cat try.ret`
11987 echo "A read() system call with no data present returns $rd_nodata."
11988 case "$rd_nodata" in
11991 echo "(That's peculiar, fixing that to be -1.)"
11997 echo "Forcing errno EAGAIN on read() with no data available."
12001 echo "Your read() sets errno to $eagain when no data is available."
12004 status=`$cat try.err`
12006 0) echo "And it correctly returns 0 to signal EOF.";;
12007 -1) echo "But it also returns -1 to signal EOF, so be careful!";;
12008 *) echo "However, your read() returns '$status' on EOF??";;
12011 if test "$status" = "$rd_nodata"; then
12012 echo "WARNING: you can't distinguish between EOF and no data!"
12016 echo "I can't compile the test program--assuming errno EAGAIN will do."
12023 echo "Using $hint value $eagain."
12024 echo "Your read() returns $rd_nodata when no data is present."
12025 case "$d_eofnblk" in
12026 "$define") echo "And you can see EOF because read() returns 0.";;
12027 "$undef") echo "But you can't see EOF status from read() returned value.";;
12029 echo "(Assuming you can't see EOF status from read anyway.)"
12035 $rm -f try try.* .out core head.c mtry
12037 : see if _ptr and _cnt from stdio act std
12040 if $contains '_lbfsize' `./findhdr stdio.h` >/dev/null 2>&1 ; then
12041 echo "(Looks like you have stdio.h from BSD.)"
12042 case "$stdio_ptr" in
12043 '') stdio_ptr='((fp)->_p)'
12046 *) ptr_lval=$d_stdio_ptr_lval;;
12048 case "$stdio_cnt" in
12049 '') stdio_cnt='((fp)->_r)'
12052 *) cnt_lval=$d_stdio_cnt_lval;;
12054 case "$stdio_base" in
12055 '') stdio_base='((fp)->_ub._base ? (fp)->_ub._base : (fp)->_bf._base)';;
12057 case "$stdio_bufsiz" in
12058 '') stdio_bufsiz='((fp)->_ub._base ? (fp)->_ub._size : (fp)->_bf._size)';;
12060 elif $contains '_IO_fpos_t' `./findhdr stdio.h` `./findhdr libio.h` >/dev/null 2>&1 ; then
12061 echo "(Looks like you have stdio.h from Linux.)"
12062 case "$stdio_ptr" in
12063 '') stdio_ptr='((fp)->_IO_read_ptr)'
12066 *) ptr_lval=$d_stdio_ptr_lval;;
12068 case "$stdio_cnt" in
12069 '') stdio_cnt='((fp)->_IO_read_end - (fp)->_IO_read_ptr)'
12072 *) cnt_lval=$d_stdio_cnt_lval;;
12074 case "$stdio_base" in
12075 '') stdio_base='((fp)->_IO_read_base)';;
12077 case "$stdio_bufsiz" in
12078 '') stdio_bufsiz='((fp)->_IO_read_end - (fp)->_IO_read_base)';;
12081 case "$stdio_ptr" in
12082 '') stdio_ptr='((fp)->_ptr)'
12085 *) ptr_lval=$d_stdio_ptr_lval;;
12087 case "$stdio_cnt" in
12088 '') stdio_cnt='((fp)->_cnt)'
12091 *) cnt_lval=$d_stdio_cnt_lval;;
12093 case "$stdio_base" in
12094 '') stdio_base='((fp)->_base)';;
12096 case "$stdio_bufsiz" in
12097 '') stdio_bufsiz='((fp)->_cnt + (fp)->_ptr - (fp)->_base)';;
12101 : test whether _ptr and _cnt really work
12102 echo "Checking how std your stdio is..." >&4
12105 #$i_stdlib I_STDLIB
12107 #include <stdlib.h>
12109 #define FILE_ptr(fp) $stdio_ptr
12110 #define FILE_cnt(fp) $stdio_cnt
12112 FILE *fp = fopen("try.c", "r");
12115 18 <= FILE_cnt(fp) &&
12116 strncmp(FILE_ptr(fp), "include <stdio.h>\n", 18) == 0
12124 if eval $compile && $to try.c; then
12125 if $run ./try; then
12126 echo "Your stdio acts pretty std."
12129 echo "Your stdio isn't very std."
12132 echo "Your stdio doesn't appear very std."
12136 # glibc 2.2.90 and above apparently change stdio streams so Perl's
12137 # direct buffer manipulation no longer works. The Configure tests
12138 # should be changed to correctly detect this, but until then,
12139 # the following check should at least let perl compile and run.
12140 # (This quick fix should be updated before 5.8.1.)
12141 # To be defensive, reject all unknown versions, and all versions > 2.2.9.
12142 # A. Dougherty, June 3, 2002.
12143 case "$d_gnulibc" in
12145 case "$gnulibc_version" in
12149 *) echo "But I will not snoop inside glibc $gnulibc_version stdio buffers."
12158 : Can _ptr be used as an lvalue?
12159 case "$d_stdstdio$ptr_lval" in
12160 $define$define) val=$define ;;
12163 set d_stdio_ptr_lval
12166 : Can _cnt be used as an lvalue?
12167 case "$d_stdstdio$cnt_lval" in
12168 $define$define) val=$define ;;
12171 set d_stdio_cnt_lval
12175 : test whether setting _ptr sets _cnt as a side effect
12176 d_stdio_ptr_lval_sets_cnt="$undef"
12177 d_stdio_ptr_lval_nochange_cnt="$undef"
12178 case "$d_stdio_ptr_lval$d_stdstdio" in
12180 echo "Checking to see what happens if we set the stdio ptr..." >&4
12183 /* Can we scream? */
12184 /* Eat dust sed :-) */
12185 /* In the buffer space, no one can hear you scream. */
12186 #$i_stdlib I_STDLIB
12188 #include <stdlib.h>
12190 #define FILE_ptr(fp) $stdio_ptr
12191 #define FILE_cnt(fp) $stdio_cnt
12192 #include <sys/types.h>
12194 FILE *fp = fopen("try.c", "r");
12199 puts("Fail even to read");
12202 c = getc(fp); /* Read away the first # */
12204 puts("Fail even to read");
12208 18 <= FILE_cnt(fp) &&
12209 strncmp(FILE_ptr(fp), "include <stdio.h>\n", 18) == 0
12211 puts("Fail even to read");
12214 ptr = (char*) FILE_ptr(fp);
12215 cnt = (size_t)FILE_cnt(fp);
12217 FILE_ptr(fp) += 42;
12219 if ((char*)FILE_ptr(fp) != (ptr + 42)) {
12220 printf("Fail ptr check %p != %p", FILE_ptr(fp), (ptr + 42));
12223 if (FILE_cnt(fp) <= 20) {
12224 printf ("Fail (<20 chars to test)");
12227 if (strncmp(FILE_ptr(fp), "Eat dust sed :-) */\n", 20) != 0) {
12228 puts("Fail compare");
12231 if (cnt == FILE_cnt(fp)) {
12232 puts("Pass_unchanged");
12235 if (FILE_cnt(fp) == (cnt - 42)) {
12236 puts("Pass_changed");
12239 printf("Fail count was %d now %d\n", cnt, FILE_cnt(fp));
12245 if eval $compile && $to try.c; then
12246 case `$run ./try` in
12248 echo "Increasing ptr in your stdio decreases cnt by the same amount. Good." >&4
12249 d_stdio_ptr_lval_sets_cnt="$define" ;;
12251 echo "Increasing ptr in your stdio leaves cnt unchanged. Good." >&4
12252 d_stdio_ptr_lval_nochange_cnt="$define" ;;
12254 echo "Increasing ptr in your stdio didn't do exactly what I expected. We'll not be doing that then." >&4 ;;
12256 echo "It appears attempting to set ptr in your stdio is a bad plan." >&4 ;;
12259 echo "It seems we can't set ptr in your stdio. Nevermind." >&4
12265 : see if _base is also standard
12267 case "$d_stdstdio" in
12271 #$i_stdlib I_STDLIB
12273 #include <stdlib.h>
12275 #define FILE_base(fp) $stdio_base
12276 #define FILE_bufsiz(fp) $stdio_bufsiz
12278 FILE *fp = fopen("try.c", "r");
12281 19 <= FILE_bufsiz(fp) &&
12282 strncmp(FILE_base(fp), "#include <stdio.h>\n", 19) == 0
12289 if eval $compile && $to try.c; then
12290 if $run ./try; then
12291 echo "And its _base field acts std."
12294 echo "But its _base field isn't std."
12297 echo "However, it seems to be lacking the _base field."
12305 : see if fast_stdio exists
12307 case "$d_stdstdio:$d_stdio_ptr_lval" in
12309 case "$d_stdio_cnt_lval$d_stdio_ptr_lval_sets_cnt" in
12311 echo "You seem to have 'fast stdio' to directly manipulate the stdio buffers." >& 4
12322 : see if fchdir exists
12323 set fchdir d_fchdir
12326 : see if fchmod exists
12327 set fchmod d_fchmod
12330 : see if fchown exists
12331 set fchown d_fchown
12334 : see if this is an fcntl system
12339 : See if fcntl-based locking works.
12341 #$i_stdlib I_STDLIB
12343 #include <stdlib.h>
12345 #include <unistd.h>
12347 #include <signal.h>
12348 $signal_t blech(x) int x; { exit(3); }
12350 #if defined(F_SETLK) && defined(F_SETLKW)
12351 struct flock flock;
12353 fd = open("try.c", O_RDONLY);
12354 flock.l_type = F_RDLCK;
12355 flock.l_whence = SEEK_SET;
12356 flock.l_start = flock.l_len = 0;
12357 signal(SIGALRM, blech);
12359 retval = fcntl(fd, F_SETLK, &flock);
12361 (retval < 0 ? exit(2) : exit(0));
12367 echo "Checking if fcntl-based file locking works... "
12371 if eval $compile_ok; then
12372 if $run ./try; then
12373 echo "Yes, it seems to work."
12376 echo "Nope, it didn't work."
12381 *** I had to forcibly timeout from fcntl(..., F_SETLK, ...).
12382 *** This is (almost) impossible.
12383 *** If your NFS lock daemons are not feeling well, something like
12384 *** this may happen, please investigate. Cannot continue, aborting.
12392 echo "I'm unable to compile the test program, so I'll assume not."
12397 echo "Nope, since you don't even have fcntl()."
12400 set d_fcntl_can_lock
12405 : check for fd_set items
12408 Checking to see how well your C compiler handles fd_set and friends ...
12411 #$i_stdlib I_STDLIB
12413 #include <stdlib.h>
12415 #$i_systime I_SYS_TIME
12416 #$i_sysselct I_SYS_SELECT
12417 #$d_socket HAS_SOCKET
12418 #include <sys/types.h>
12420 #include <sys/socket.h> /* Might include <sys/bsdtypes.h> */
12423 #include <sys/time.h>
12425 #ifdef I_SYS_SELECT
12426 #include <sys/select.h>
12435 #if defined(FD_SET) && defined(FD_CLR) && defined(FD_ISSET) && defined(FD_ZERO)
12443 if eval $compile; then
12444 d_fds_bits="$define"
12446 echo "Well, your system knows about the normal fd_set typedef..." >&4
12447 if $run ./try; then
12448 echo "and you have the normal fd_set macros (just as I'd expect)." >&4
12449 d_fd_macros="$define"
12452 but not the normal fd_set macros! Gaaack! I'll have to cover for you.
12454 d_fd_macros="$undef"
12458 Hmm, your compiler has some difficulty with fd_set. Checking further...
12461 if eval $compile; then
12462 d_fds_bits="$undef"
12464 echo "Well, your system has some sort of fd_set available..." >&4
12465 if $run ./try; then
12466 echo "and you have the normal fd_set macros." >&4
12467 d_fd_macros="$define"
12470 but not the normal fd_set macros! Gross! More work for me...
12472 d_fd_macros="$undef"
12475 echo "Well, you got zip. That's OK, I can roll my own fd_set stuff." >&4
12477 d_fds_bits="$undef"
12478 d_fd_macros="$undef"
12483 : see if fgetpos exists
12484 set fgetpos d_fgetpos
12487 : see if finite exists
12488 set finite d_finite
12491 : see if finitel exists
12492 set finitel d_finitel
12495 : see if flock exists
12499 : see if prototype for flock is available
12501 set d_flockproto flock $i_sysfile sys/file.h
12504 : see if fork exists
12508 : see if fp_class exists
12509 set fp_class d_fp_class
12512 : see if pathconf exists
12513 set pathconf d_pathconf
12516 : see if fpathconf exists
12517 set fpathconf d_fpathconf
12520 : see if fpclass exists
12521 set fpclass d_fpclass
12524 : see if fpclassify exists
12525 set fpclassify d_fpclassify
12528 : see if fpclassl exists
12529 set fpclassl d_fpclassl
12533 : check for fpos64_t
12535 echo "Checking to see if you have fpos64_t..." >&4
12538 int main() { fpos64_t x = 7; }
12541 if eval $compile; then
12543 echo "You have fpos64_t."
12546 echo "You do not have fpos64_t."
12547 case "$fpossize" in
12548 8) echo "(Your fpos_t is 64 bits, so you could use that.)" ;;
12555 : see if frexpl exists
12556 set frexpl d_frexpl
12559 : see if this is a sys/param system
12560 set sys/param.h i_sysparam
12563 : see if this is a sys/mount.h system
12564 set sys/mount.h i_sysmount
12569 echo "Checking to see if your system supports struct fs_data..." >&4
12570 set d_fs_data_s fs_data $i_systypes sys/types.h $i_sysparam sys/param.h $i_sysmount sys/mount.h
12572 case "$d_fs_data_s" in
12573 "$define") echo "Yes, it does." ;;
12574 *) echo "No, it doesn't." ;;
12577 : see if fseeko exists
12578 set fseeko d_fseeko
12580 case "$longsize" in
12581 8) echo "(Your long is 64 bits, so you could use fseek.)" ;;
12584 : see if fsetpos exists
12585 set fsetpos d_fsetpos
12589 : see if fstatfs exists
12590 set fstatfs d_fstatfs
12594 : see if statvfs exists
12595 set statvfs d_statvfs
12598 : see if fstatvfs exists
12599 set fstatvfs d_fstatvfs
12603 : see if fsync exists
12607 : see if ftello exists
12608 set ftello d_ftello
12610 case "$longsize" in
12611 8) echo "(Your long is 64 bits, so you could use ftell.)" ;;
12615 : check for a working futimes
12617 echo "Checking for a working futimes()" >&4
12620 #include <sys/time.h>
12627 fd = open ("try.c", O_RDWR);
12628 if (-1 == fd) exit (1);
12629 rv = futimes (fd, NULL);
12630 exit (rv == -1 ? errno : 0);
12634 if eval $compile; then
12638 0) echo "Yes, it does" >&4
12639 d_futimes="$define"
12641 *) echo "No, it has futimes, but it isn't working ($rc) (probably harmless)\n" >&4
12645 echo "No, it does not (probably harmless)\n" >&4
12647 $rm -f try.* try core core.try.*
12649 : see if getcwd exists
12650 set getcwd d_getcwd
12653 : see if getespwnam exists
12654 set getespwnam d_getespwnam
12658 : see if getfsstat exists
12659 set getfsstat d_getfsstat
12662 : see if getgrent exists
12663 set getgrent d_getgrent
12666 : see if getgrent_r exists
12667 set getgrent_r d_getgrent_r
12669 case "$d_getgrent_r" in
12671 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
12672 case "$d_getgrent_r_proto:$usethreads" in
12673 ":define") d_getgrent_r_proto=define
12674 set d_getgrent_r_proto getgrent_r $hdrs
12678 case "$d_getgrent_r_proto" in
12680 case "$getgrent_r_proto" in
12681 ''|0) try='int getgrent_r(struct group*, char*, size_t, struct group**);'
12682 ./protochk "extern $try" $hdrs && getgrent_r_proto=I_SBWR ;;
12684 case "$getgrent_r_proto" in
12685 ''|0) try='int getgrent_r(struct group*, char*, int, struct group**);'
12686 ./protochk "extern $try" $hdrs && getgrent_r_proto=I_SBIR ;;
12688 case "$getgrent_r_proto" in
12689 ''|0) try='struct group* getgrent_r(struct group*, char*, size_t);'
12690 ./protochk "extern $try" $hdrs && getgrent_r_proto=S_SBW ;;
12692 case "$getgrent_r_proto" in
12693 ''|0) try='struct group* getgrent_r(struct group*, char*, int);'
12694 ./protochk "extern $try" $hdrs && getgrent_r_proto=S_SBI ;;
12696 case "$getgrent_r_proto" in
12697 ''|0) try='int getgrent_r(struct group*, char*, int);'
12698 ./protochk "extern $try" $hdrs && getgrent_r_proto=I_SBI ;;
12700 case "$getgrent_r_proto" in
12701 ''|0) try='int getgrent_r(struct group*, char*, int, FILE**);'
12702 ./protochk "extern $try" $hdrs && getgrent_r_proto=I_SBIH ;;
12704 case "$getgrent_r_proto" in
12705 ''|0) d_getgrent_r=undef
12707 echo "Disabling getgrent_r, cannot determine prototype." >&4 ;;
12708 * ) case "$getgrent_r_proto" in
12709 REENTRANT_PROTO*) ;;
12710 *) getgrent_r_proto="REENTRANT_PROTO_$getgrent_r_proto" ;;
12712 echo "Prototype: $try" ;;
12715 *) case "$usethreads" in
12716 define) echo "getgrent_r has no prototype, not using it." >&4 ;;
12723 *) getgrent_r_proto=0
12727 : see if getgrgid_r exists
12728 set getgrgid_r d_getgrgid_r
12730 case "$d_getgrgid_r" in
12732 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
12733 case "$d_getgrgid_r_proto:$usethreads" in
12734 ":define") d_getgrgid_r_proto=define
12735 set d_getgrgid_r_proto getgrgid_r $hdrs
12739 case "$d_getgrgid_r_proto" in
12741 case "$getgrgid_r_proto" in
12742 ''|0) try='int getgrgid_r(gid_t, struct group*, char*, size_t, struct group**);'
12743 ./protochk "extern $try" $hdrs && getgrgid_r_proto=I_TSBWR ;;
12745 case "$getgrgid_r_proto" in
12746 ''|0) try='int getgrgid_r(gid_t, struct group*, char*, int, struct group**);'
12747 ./protochk "extern $try" $hdrs && getgrgid_r_proto=I_TSBIR ;;
12749 case "$getgrgid_r_proto" in
12750 ''|0) try='int getgrgid_r(gid_t, struct group*, char*, int);'
12751 ./protochk "extern $try" $hdrs && getgrgid_r_proto=I_TSBI ;;
12753 case "$getgrgid_r_proto" in
12754 ''|0) try='struct group* getgrgid_r(gid_t, struct group*, char*, int);'
12755 ./protochk "extern $try" $hdrs && getgrgid_r_proto=S_TSBI ;;
12757 case "$getgrgid_r_proto" in
12758 ''|0) d_getgrgid_r=undef
12760 echo "Disabling getgrgid_r, cannot determine prototype." >&4 ;;
12761 * ) case "$getgrgid_r_proto" in
12762 REENTRANT_PROTO*) ;;
12763 *) getgrgid_r_proto="REENTRANT_PROTO_$getgrgid_r_proto" ;;
12765 echo "Prototype: $try" ;;
12768 *) case "$usethreads" in
12769 define) echo "getgrgid_r has no prototype, not using it." >&4 ;;
12776 *) getgrgid_r_proto=0
12780 : see if getgrnam_r exists
12781 set getgrnam_r d_getgrnam_r
12783 case "$d_getgrnam_r" in
12785 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
12786 case "$d_getgrnam_r_proto:$usethreads" in
12787 ":define") d_getgrnam_r_proto=define
12788 set d_getgrnam_r_proto getgrnam_r $hdrs
12792 case "$d_getgrnam_r_proto" in
12794 case "$getgrnam_r_proto" in
12795 ''|0) try='int getgrnam_r(const char*, struct group*, char*, size_t, struct group**);'
12796 ./protochk "extern $try" $hdrs && getgrnam_r_proto=I_CSBWR ;;
12798 case "$getgrnam_r_proto" in
12799 ''|0) try='int getgrnam_r(const char*, struct group*, char*, int, struct group**);'
12800 ./protochk "extern $try" $hdrs && getgrnam_r_proto=I_CSBIR ;;
12802 case "$getgrnam_r_proto" in
12803 ''|0) try='struct group* getgrnam_r(const char*, char*, int);'
12804 ./protochk "extern $try" $hdrs && getgrnam_r_proto=S_CBI ;;
12806 case "$getgrnam_r_proto" in
12807 ''|0) try='int getgrnam_r(const char*, struct group*, char*, int);'
12808 ./protochk "extern $try" $hdrs && getgrnam_r_proto=I_CSBI ;;
12810 case "$getgrnam_r_proto" in
12811 ''|0) try='struct group* getgrnam_r(const char*, struct group*, char*, int);'
12812 ./protochk "extern $try" $hdrs && getgrnam_r_proto=S_CSBI ;;
12814 case "$getgrnam_r_proto" in
12815 ''|0) d_getgrnam_r=undef
12817 echo "Disabling getgrnam_r, cannot determine prototype." >&4 ;;
12818 * ) case "$getgrnam_r_proto" in
12819 REENTRANT_PROTO*) ;;
12820 *) getgrnam_r_proto="REENTRANT_PROTO_$getgrnam_r_proto" ;;
12822 echo "Prototype: $try" ;;
12825 *) case "$usethreads" in
12826 define) echo "getgrnam_r has no prototype, not using it." >&4 ;;
12833 *) getgrnam_r_proto=0
12837 : see if gethostbyaddr exists
12838 set gethostbyaddr d_gethbyaddr
12841 : see if gethostbyname exists
12842 set gethostbyname d_gethbyname
12845 : see if gethostent exists
12846 set gethostent d_gethent
12849 : see how we will look up host name
12852 if set gethostname val -f d_gethname; eval $csym; $val; then
12853 echo 'gethostname() found.' >&4
12854 d_gethname="$define"
12857 if set uname val -f d_uname; eval $csym; $val; then
12860 uname() was found, but you're running xenix, and older versions of xenix
12861 have a broken uname(). If you don't really know whether your xenix is old
12862 enough to have a broken system call, use the default answer.
12867 "$define") dflt=n;;
12869 rp='Is your uname() broken?'
12872 n*) d_uname="$define"; call=uname;;
12875 echo 'uname() found.' >&4
12882 case "$d_gethname" in
12883 '') d_gethname="$undef";;
12886 '') d_uname="$undef";;
12888 case "$d_uname$d_gethname" in
12893 Every now and then someone has a $call() that lies about the hostname
12894 but can't be fixed for political or economic reasons. If you wish, I can
12895 pretend $call() isn't there and maybe compute hostname at run-time
12896 thanks to the '$phostname' command.
12899 rp="Shall I ignore $call() from now on?"
12902 y*) d_uname="$undef" d_gethname="$undef"; $echo $n "Okay...$c";;
12905 case "$phostname" in
12906 '') aphostname='';;
12907 *) case "$aphostname" in
12909 *) set X $phostname
12913 file=`./loc $file $file $pth`
12914 aphostname=`echo $file $*`
12919 case "$d_uname$d_gethname" in
12922 case "$phostname" in
12924 echo "There will be no way for $package to get your hostname." >&4;;
12926 echo "I'll use 'popen("'"'$aphostname'", "r")'"' to get your hostname." >&4
12930 case "$d_phostname" in
12931 '') d_phostname="$undef";;
12934 : see if gethostbyaddr_r exists
12935 set gethostbyaddr_r d_gethostbyaddr_r
12937 case "$d_gethostbyaddr_r" in
12939 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
12940 case "$d_gethostbyaddr_r_proto:$usethreads" in
12941 ":define") d_gethostbyaddr_r_proto=define
12942 set d_gethostbyaddr_r_proto gethostbyaddr_r $hdrs
12946 case "$d_gethostbyaddr_r_proto" in
12948 case "$gethostbyaddr_r_proto" in
12949 ''|0) try='int gethostbyaddr_r(const char*, size_t, int, struct hostent*, char*, size_t, struct hostent**, int*);'
12950 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=I_CWISBWRE ;;
12952 case "$gethostbyaddr_r_proto" in
12953 ''|0) try='struct hostent* gethostbyaddr_r(const char*, size_t, int, struct hostent*, char*, size_t, int, int*);'
12954 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=S_CWISBWIE ;;
12956 case "$gethostbyaddr_r_proto" in
12957 ''|0) try='struct hostent* gethostbyaddr_r(const char*, size_t, int, struct hostent*, char*, int, int*);'
12958 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=S_CWISBIE ;;
12960 case "$gethostbyaddr_r_proto" in
12961 ''|0) try='struct hostent* gethostbyaddr_r(const void*, size_t, int, struct hostent*, char*, int, int*);'
12962 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=S_TWISBIE ;;
12964 case "$gethostbyaddr_r_proto" in
12965 ''|0) try='struct hostent* gethostbyaddr_r(const char*, int, int, struct hostent*, char*, int, int*);'
12966 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=S_CIISBIE ;;
12968 case "$gethostbyaddr_r_proto" in
12969 ''|0) try='struct hostent* gethostbyaddr_r(const char*, struct hostent*, char*, int, int*);'
12970 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=S_CSBIE ;;
12972 case "$gethostbyaddr_r_proto" in
12973 ''|0) try='struct hostent* gethostbyaddr_r(const void*, struct hostent*, char*, int, int*);'
12974 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=S_TSBIE ;;
12976 case "$gethostbyaddr_r_proto" in
12977 ''|0) try='int gethostbyaddr_r(const char*, size_t, int, struct hostent*, struct hostent_data*);'
12978 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=I_CWISD ;;
12980 case "$gethostbyaddr_r_proto" in
12981 ''|0) try='int gethostbyaddr_r(const char*, int, int, struct hostent*, struct hostent_data*);'
12982 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=I_CIISD ;;
12984 case "$gethostbyaddr_r_proto" in
12985 ''|0) try='int gethostbyaddr_r(const char*, int, int);'
12986 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=I_CII ;;
12988 case "$gethostbyaddr_r_proto" in
12989 ''|0) try='int gethostbyaddr_r(const void*, socklen_t, int, struct hostent*, char*, size_t, struct hostent**, int*);'
12990 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=I_TsISBWRE ;;
12992 case "$gethostbyaddr_r_proto" in
12993 ''|0) d_gethostbyaddr_r=undef
12994 gethostbyaddr_r_proto=0
12995 echo "Disabling gethostbyaddr_r, cannot determine prototype." >&4 ;;
12996 * ) case "$gethostbyaddr_r_proto" in
12997 REENTRANT_PROTO*) ;;
12998 *) gethostbyaddr_r_proto="REENTRANT_PROTO_$gethostbyaddr_r_proto" ;;
13000 echo "Prototype: $try" ;;
13003 *) case "$usethreads" in
13004 define) echo "gethostbyaddr_r has no prototype, not using it." >&4 ;;
13006 d_gethostbyaddr_r=undef
13007 gethostbyaddr_r_proto=0
13011 *) gethostbyaddr_r_proto=0
13015 : see if gethostbyname_r exists
13016 set gethostbyname_r d_gethostbyname_r
13018 case "$d_gethostbyname_r" in
13020 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13021 case "$d_gethostbyname_r_proto:$usethreads" in
13022 ":define") d_gethostbyname_r_proto=define
13023 set d_gethostbyname_r_proto gethostbyname_r $hdrs
13027 case "$d_gethostbyname_r_proto" in
13029 case "$gethostbyname_r_proto" in
13030 ''|0) try='int gethostbyname_r(const char*, struct hostent*, char*, size_t, struct hostent**, int*);'
13031 ./protochk "extern $try" $hdrs && gethostbyname_r_proto=I_CSBWRE ;;
13033 case "$gethostbyname_r_proto" in
13034 ''|0) try='struct hostent* gethostbyname_r(const char*, struct hostent*, char*, int, int*);'
13035 ./protochk "extern $try" $hdrs && gethostbyname_r_proto=S_CSBIE ;;
13037 case "$gethostbyname_r_proto" in
13038 ''|0) try='int gethostbyname_r(const char*, struct hostent*, struct hostent_data*);'
13039 ./protochk "extern $try" $hdrs && gethostbyname_r_proto=I_CSD ;;
13041 case "$gethostbyname_r_proto" in
13042 ''|0) d_gethostbyname_r=undef
13043 gethostbyname_r_proto=0
13044 echo "Disabling gethostbyname_r, cannot determine prototype." >&4 ;;
13045 * ) case "$gethostbyname_r_proto" in
13046 REENTRANT_PROTO*) ;;
13047 *) gethostbyname_r_proto="REENTRANT_PROTO_$gethostbyname_r_proto" ;;
13049 echo "Prototype: $try" ;;
13052 *) case "$usethreads" in
13053 define) echo "gethostbyname_r has no prototype, not using it." >&4 ;;
13055 d_gethostbyname_r=undef
13056 gethostbyname_r_proto=0
13060 *) gethostbyname_r_proto=0
13064 : see if gethostent_r exists
13065 set gethostent_r d_gethostent_r
13067 case "$d_gethostent_r" in
13069 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13070 case "$d_gethostent_r_proto:$usethreads" in
13071 ":define") d_gethostent_r_proto=define
13072 set d_gethostent_r_proto gethostent_r $hdrs
13076 case "$d_gethostent_r_proto" in
13078 case "$gethostent_r_proto" in
13079 ''|0) try='int gethostent_r(struct hostent*, char*, size_t, struct hostent**, int*);'
13080 ./protochk "extern $try" $hdrs && gethostent_r_proto=I_SBWRE ;;
13082 case "$gethostent_r_proto" in
13083 ''|0) try='int gethostent_r(struct hostent*, char*, int, int*);'
13084 ./protochk "extern $try" $hdrs && gethostent_r_proto=I_SBIE ;;
13086 case "$gethostent_r_proto" in
13087 ''|0) try='struct hostent* gethostent_r(struct hostent*, char*, int, int*);'
13088 ./protochk "extern $try" $hdrs && gethostent_r_proto=S_SBIE ;;
13090 case "$gethostent_r_proto" in
13091 ''|0) try='struct hostent* gethostent_r(struct hostent*, char*, int);'
13092 ./protochk "extern $try" $hdrs && gethostent_r_proto=S_SBI ;;
13094 case "$gethostent_r_proto" in
13095 ''|0) try='int gethostent_r(struct hostent*, char*, int);'
13096 ./protochk "extern $try" $hdrs && gethostent_r_proto=I_SBI ;;
13098 case "$gethostent_r_proto" in
13099 ''|0) try='int gethostent_r(struct hostent*, struct hostent_data*);'
13100 ./protochk "extern $try" $hdrs && gethostent_r_proto=I_SD ;;
13102 case "$gethostent_r_proto" in
13103 ''|0) d_gethostent_r=undef
13104 gethostent_r_proto=0
13105 echo "Disabling gethostent_r, cannot determine prototype." >&4 ;;
13106 * ) case "$gethostent_r_proto" in
13107 REENTRANT_PROTO*) ;;
13108 *) gethostent_r_proto="REENTRANT_PROTO_$gethostent_r_proto" ;;
13110 echo "Prototype: $try" ;;
13113 *) case "$usethreads" in
13114 define) echo "gethostent_r has no prototype, not using it." >&4 ;;
13116 d_gethostent_r=undef
13117 gethostent_r_proto=0
13121 *) gethostent_r_proto=0
13125 : see if prototypes for various gethostxxx netdb.h functions are available
13127 set d_gethostprotos gethostent $i_netdb netdb.h
13130 : see if getitimer exists
13131 set getitimer d_getitimer
13134 : see if getlogin exists
13135 set getlogin d_getlogin
13138 : see if getlogin_r exists
13139 set getlogin_r d_getlogin_r
13141 case "$d_getlogin_r" in
13143 hdrs="$i_systypes sys/types.h define stdio.h $i_unistd unistd.h"
13144 case "$d_getlogin_r_proto:$usethreads" in
13145 ":define") d_getlogin_r_proto=define
13146 set d_getlogin_r_proto getlogin_r $hdrs
13150 case "$d_getlogin_r_proto" in
13152 case "$getlogin_r_proto" in
13153 ''|0) try='int getlogin_r(char*, size_t);'
13154 ./protochk "extern $try" $hdrs && getlogin_r_proto=I_BW ;;
13156 case "$getlogin_r_proto" in
13157 ''|0) try='int getlogin_r(char*, int);'
13158 ./protochk "extern $try" $hdrs && getlogin_r_proto=I_BI ;;
13160 case "$getlogin_r_proto" in
13161 ''|0) try='char* getlogin_r(char*, size_t);'
13162 ./protochk "extern $try" $hdrs && getlogin_r_proto=B_BW ;;
13164 case "$getlogin_r_proto" in
13165 ''|0) try='char* getlogin_r(char*, int);'
13166 ./protochk "extern $try" $hdrs && getlogin_r_proto=B_BI ;;
13168 case "$getlogin_r_proto" in
13169 ''|0) d_getlogin_r=undef
13171 echo "Disabling getlogin_r, cannot determine prototype." >&4 ;;
13172 * ) case "$getlogin_r_proto" in
13173 REENTRANT_PROTO*) ;;
13174 *) getlogin_r_proto="REENTRANT_PROTO_$getlogin_r_proto" ;;
13176 echo "Prototype: $try" ;;
13179 *) case "$usethreads" in
13180 define) echo "getlogin_r has no prototype, not using it." >&4 ;;
13187 *) getlogin_r_proto=0
13191 : see if getmnt exists
13192 set getmnt d_getmnt
13195 : see if getmntent exists
13196 set getmntent d_getmntent
13199 : see if getnetbyaddr exists
13200 set getnetbyaddr d_getnbyaddr
13203 : see if getnetbyname exists
13204 set getnetbyname d_getnbyname
13207 : see if getnetent exists
13208 set getnetent d_getnent
13211 : see if getnetbyaddr_r exists
13212 set getnetbyaddr_r d_getnetbyaddr_r
13214 case "$d_getnetbyaddr_r" in
13216 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13217 case "$d_getnetbyaddr_r_proto:$usethreads" in
13218 ":define") d_getnetbyaddr_r_proto=define
13219 set d_getnetbyaddr_r_proto getnetbyaddr_r $hdrs
13223 case "$d_getnetbyaddr_r_proto" in
13225 case "$getnetbyaddr_r_proto" in
13226 ''|0) try='int getnetbyaddr_r(unsigned long, int, struct netent*, char*, size_t, struct netent**, int*);'
13227 ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=I_UISBWRE ;;
13229 case "$getnetbyaddr_r_proto" in
13230 ''|0) try='int getnetbyaddr_r(long, int, struct netent*, char*, int);'
13231 ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=I_LISBI ;;
13233 case "$getnetbyaddr_r_proto" in
13234 ''|0) try='struct netent* getnetbyaddr_r(in_addr_t, int, struct netent*, char*, int);'
13235 ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=S_TISBI ;;
13237 case "$getnetbyaddr_r_proto" in
13238 ''|0) try='struct netent* getnetbyaddr_r(long, int, struct netent*, char*, int);'
13239 ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=S_LISBI ;;
13241 case "$getnetbyaddr_r_proto" in
13242 ''|0) try='int getnetbyaddr_r(in_addr_t, int, struct netent*, struct netent_data*);'
13243 ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=I_TISD ;;
13245 case "$getnetbyaddr_r_proto" in
13246 ''|0) try='int getnetbyaddr_r(long, int, struct netent*, struct netent_data*);'
13247 ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=I_LISD ;;
13249 case "$getnetbyaddr_r_proto" in
13250 ''|0) try='int getnetbyaddr_r(int, int, struct netent*, struct netent_data*);'
13251 ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=I_IISD ;;
13253 case "$getnetbyaddr_r_proto" in
13254 ''|0) try='int getnetbyaddr_r(uint32_t, int, struct netent*, char*, size_t, struct netent**, int*);'
13255 ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=I_uISBWRE ;;
13257 case "$getnetbyaddr_r_proto" in
13258 ''|0) d_getnetbyaddr_r=undef
13259 getnetbyaddr_r_proto=0
13260 echo "Disabling getnetbyaddr_r, cannot determine prototype." >&4 ;;
13261 * ) case "$getnetbyaddr_r_proto" in
13262 REENTRANT_PROTO*) ;;
13263 *) getnetbyaddr_r_proto="REENTRANT_PROTO_$getnetbyaddr_r_proto" ;;
13265 echo "Prototype: $try" ;;
13268 *) case "$usethreads" in
13269 define) echo "getnetbyaddr_r has no prototype, not using it." >&4 ;;
13271 d_getnetbyaddr_r=undef
13272 getnetbyaddr_r_proto=0
13276 *) getnetbyaddr_r_proto=0
13280 : see if getnetbyname_r exists
13281 set getnetbyname_r d_getnetbyname_r
13283 case "$d_getnetbyname_r" in
13285 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13286 case "$d_getnetbyname_r_proto:$usethreads" in
13287 ":define") d_getnetbyname_r_proto=define
13288 set d_getnetbyname_r_proto getnetbyname_r $hdrs
13292 case "$d_getnetbyname_r_proto" in
13294 case "$getnetbyname_r_proto" in
13295 ''|0) try='int getnetbyname_r(const char*, struct netent*, char*, size_t, struct netent**, int*);'
13296 ./protochk "extern $try" $hdrs && getnetbyname_r_proto=I_CSBWRE ;;
13298 case "$getnetbyname_r_proto" in
13299 ''|0) try='int getnetbyname_r(const char*, struct netent*, char*, int);'
13300 ./protochk "extern $try" $hdrs && getnetbyname_r_proto=I_CSBI ;;
13302 case "$getnetbyname_r_proto" in
13303 ''|0) try='struct netent* getnetbyname_r(const char*, struct netent*, char*, int);'
13304 ./protochk "extern $try" $hdrs && getnetbyname_r_proto=S_CSBI ;;
13306 case "$getnetbyname_r_proto" in
13307 ''|0) try='int getnetbyname_r(const char*, struct netent*, struct netent_data*);'
13308 ./protochk "extern $try" $hdrs && getnetbyname_r_proto=I_CSD ;;
13310 case "$getnetbyname_r_proto" in
13311 ''|0) d_getnetbyname_r=undef
13312 getnetbyname_r_proto=0
13313 echo "Disabling getnetbyname_r, cannot determine prototype." >&4 ;;
13314 * ) case "$getnetbyname_r_proto" in
13315 REENTRANT_PROTO*) ;;
13316 *) getnetbyname_r_proto="REENTRANT_PROTO_$getnetbyname_r_proto" ;;
13318 echo "Prototype: $try" ;;
13321 *) case "$usethreads" in
13322 define) echo "getnetbyname_r has no prototype, not using it." >&4 ;;
13324 d_getnetbyname_r=undef
13325 getnetbyname_r_proto=0
13329 *) getnetbyname_r_proto=0
13333 : see if getnetent_r exists
13334 set getnetent_r d_getnetent_r
13336 case "$d_getnetent_r" in
13338 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13339 case "$d_getnetent_r_proto:$usethreads" in
13340 ":define") d_getnetent_r_proto=define
13341 set d_getnetent_r_proto getnetent_r $hdrs
13345 case "$d_getnetent_r_proto" in
13347 case "$getnetent_r_proto" in
13348 ''|0) try='int getnetent_r(struct netent*, char*, size_t, struct netent**, int*);'
13349 ./protochk "extern $try" $hdrs && getnetent_r_proto=I_SBWRE ;;
13351 case "$getnetent_r_proto" in
13352 ''|0) try='int getnetent_r(struct netent*, char*, int, int*);'
13353 ./protochk "extern $try" $hdrs && getnetent_r_proto=I_SBIE ;;
13355 case "$getnetent_r_proto" in
13356 ''|0) try='struct netent* getnetent_r(struct netent*, char*, int, int*);'
13357 ./protochk "extern $try" $hdrs && getnetent_r_proto=S_SBIE ;;
13359 case "$getnetent_r_proto" in
13360 ''|0) try='struct netent* getnetent_r(struct netent*, char*, int);'
13361 ./protochk "extern $try" $hdrs && getnetent_r_proto=S_SBI ;;
13363 case "$getnetent_r_proto" in
13364 ''|0) try='int getnetent_r(struct netent*, char*, int);'
13365 ./protochk "extern $try" $hdrs && getnetent_r_proto=I_SBI ;;
13367 case "$getnetent_r_proto" in
13368 ''|0) try='int getnetent_r(struct netent*, struct netent_data*);'
13369 ./protochk "extern $try" $hdrs && getnetent_r_proto=I_SD ;;
13371 case "$getnetent_r_proto" in
13372 ''|0) d_getnetent_r=undef
13373 getnetent_r_proto=0
13374 echo "Disabling getnetent_r, cannot determine prototype." >&4 ;;
13375 * ) case "$getnetent_r_proto" in
13376 REENTRANT_PROTO*) ;;
13377 *) getnetent_r_proto="REENTRANT_PROTO_$getnetent_r_proto" ;;
13379 echo "Prototype: $try" ;;
13382 *) case "$usethreads" in
13383 define) echo "getnetent_r has no prototype, not using it." >&4 ;;
13385 d_getnetent_r=undef
13386 getnetent_r_proto=0
13390 *) getnetent_r_proto=0
13394 : see if prototypes for various getnetxxx netdb.h functions are available
13396 set d_getnetprotos getnetent $i_netdb netdb.h
13399 : see if getpagesize exists
13400 set getpagesize d_getpagsz
13404 : see if getprotobyname exists
13405 set getprotobyname d_getpbyname
13408 : see if getprotobynumber exists
13409 set getprotobynumber d_getpbynumber
13412 : see if getprotoent exists
13413 set getprotoent d_getpent
13416 : see if getpgid exists
13417 set getpgid d_getpgid
13420 : see if getpgrp2 exists
13421 set getpgrp2 d_getpgrp2
13424 : see if getppid exists
13425 set getppid d_getppid
13428 : see if getpriority exists
13429 set getpriority d_getprior
13432 : see if getprotobyname_r exists
13433 set getprotobyname_r d_getprotobyname_r
13435 case "$d_getprotobyname_r" in
13437 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13438 case "$d_getprotobyname_r_proto:$usethreads" in
13439 ":define") d_getprotobyname_r_proto=define
13440 set d_getprotobyname_r_proto getprotobyname_r $hdrs
13444 case "$d_getprotobyname_r_proto" in
13446 case "$getprotobyname_r_proto" in
13447 ''|0) try='int getprotobyname_r(const char*, struct protoent*, char*, size_t, struct protoent**);'
13448 ./protochk "extern $try" $hdrs && getprotobyname_r_proto=I_CSBWR ;;
13450 case "$getprotobyname_r_proto" in
13451 ''|0) try='struct protoent* getprotobyname_r(const char*, struct protoent*, char*, int);'
13452 ./protochk "extern $try" $hdrs && getprotobyname_r_proto=S_CSBI ;;
13454 case "$getprotobyname_r_proto" in
13455 ''|0) try='int getprotobyname_r(const char*, struct protoent*, struct protoent_data*);'
13456 ./protochk "extern $try" $hdrs && getprotobyname_r_proto=I_CSD ;;
13458 case "$getprotobyname_r_proto" in
13459 ''|0) d_getprotobyname_r=undef
13460 getprotobyname_r_proto=0
13461 echo "Disabling getprotobyname_r, cannot determine prototype." >&4 ;;
13462 * ) case "$getprotobyname_r_proto" in
13463 REENTRANT_PROTO*) ;;
13464 *) getprotobyname_r_proto="REENTRANT_PROTO_$getprotobyname_r_proto" ;;
13466 echo "Prototype: $try" ;;
13469 *) case "$usethreads" in
13470 define) echo "getprotobyname_r has no prototype, not using it." >&4 ;;
13472 d_getprotobyname_r=undef
13473 getprotobyname_r_proto=0
13477 *) getprotobyname_r_proto=0
13481 : see if getprotobynumber_r exists
13482 set getprotobynumber_r d_getprotobynumber_r
13484 case "$d_getprotobynumber_r" in
13486 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13487 case "$d_getprotobynumber_r_proto:$usethreads" in
13488 ":define") d_getprotobynumber_r_proto=define
13489 set d_getprotobynumber_r_proto getprotobynumber_r $hdrs
13493 case "$d_getprotobynumber_r_proto" in
13495 case "$getprotobynumber_r_proto" in
13496 ''|0) try='int getprotobynumber_r(int, struct protoent*, char*, size_t, struct protoent**);'
13497 ./protochk "extern $try" $hdrs && getprotobynumber_r_proto=I_ISBWR ;;
13499 case "$getprotobynumber_r_proto" in
13500 ''|0) try='struct protoent* getprotobynumber_r(int, struct protoent*, char*, int);'
13501 ./protochk "extern $try" $hdrs && getprotobynumber_r_proto=S_ISBI ;;
13503 case "$getprotobynumber_r_proto" in
13504 ''|0) try='int getprotobynumber_r(int, struct protoent*, struct protoent_data*);'
13505 ./protochk "extern $try" $hdrs && getprotobynumber_r_proto=I_ISD ;;
13507 case "$getprotobynumber_r_proto" in
13508 ''|0) d_getprotobynumber_r=undef
13509 getprotobynumber_r_proto=0
13510 echo "Disabling getprotobynumber_r, cannot determine prototype." >&4 ;;
13511 * ) case "$getprotobynumber_r_proto" in
13512 REENTRANT_PROTO*) ;;
13513 *) getprotobynumber_r_proto="REENTRANT_PROTO_$getprotobynumber_r_proto" ;;
13515 echo "Prototype: $try" ;;
13518 *) case "$usethreads" in
13519 define) echo "getprotobynumber_r has no prototype, not using it." >&4 ;;
13521 d_getprotobynumber_r=undef
13522 getprotobynumber_r_proto=0
13526 *) getprotobynumber_r_proto=0
13530 : see if getprotoent_r exists
13531 set getprotoent_r d_getprotoent_r
13533 case "$d_getprotoent_r" in
13535 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13536 case "$d_getprotoent_r_proto:$usethreads" in
13537 ":define") d_getprotoent_r_proto=define
13538 set d_getprotoent_r_proto getprotoent_r $hdrs
13542 case "$d_getprotoent_r_proto" in
13544 case "$getprotoent_r_proto" in
13545 ''|0) try='int getprotoent_r(struct protoent*, char*, size_t, struct protoent**);'
13546 ./protochk "extern $try" $hdrs && getprotoent_r_proto=I_SBWR ;;
13548 case "$getprotoent_r_proto" in
13549 ''|0) try='int getprotoent_r(struct protoent*, char*, int);'
13550 ./protochk "extern $try" $hdrs && getprotoent_r_proto=I_SBI ;;
13552 case "$getprotoent_r_proto" in
13553 ''|0) try='struct protoent* getprotoent_r(struct protoent*, char*, int);'
13554 ./protochk "extern $try" $hdrs && getprotoent_r_proto=S_SBI ;;
13556 case "$getprotoent_r_proto" in
13557 ''|0) try='int getprotoent_r(struct protoent*, struct protoent_data*);'
13558 ./protochk "extern $try" $hdrs && getprotoent_r_proto=I_SD ;;
13560 case "$getprotoent_r_proto" in
13561 ''|0) d_getprotoent_r=undef
13562 getprotoent_r_proto=0
13563 echo "Disabling getprotoent_r, cannot determine prototype." >&4 ;;
13564 * ) case "$getprotoent_r_proto" in
13565 REENTRANT_PROTO*) ;;
13566 *) getprotoent_r_proto="REENTRANT_PROTO_$getprotoent_r_proto" ;;
13568 echo "Prototype: $try" ;;
13571 *) case "$usethreads" in
13572 define) echo "getprotoent_r has no prototype, not using it." >&4 ;;
13574 d_getprotoent_r=undef
13575 getprotoent_r_proto=0
13579 *) getprotoent_r_proto=0
13583 : see if prototypes for various getprotoxxx netdb.h functions are available
13585 set d_getprotoprotos getprotoent $i_netdb netdb.h
13588 : see if getprpwnam exists
13589 set getprpwnam d_getprpwnam
13592 : see if getpwent exists
13593 set getpwent d_getpwent
13596 : see if getpwent_r exists
13597 set getpwent_r d_getpwent_r
13599 case "$d_getpwent_r" in
13601 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
13602 case "$d_getpwent_r_proto:$usethreads" in
13603 ":define") d_getpwent_r_proto=define
13604 set d_getpwent_r_proto getpwent_r $hdrs
13608 case "$d_getpwent_r_proto" in
13610 case "$getpwent_r_proto" in
13611 ''|0) try='int getpwent_r(struct passwd*, char*, size_t, struct passwd**);'
13612 ./protochk "extern $try" $hdrs && getpwent_r_proto=I_SBWR ;;
13614 case "$getpwent_r_proto" in
13615 ''|0) try='int getpwent_r(struct passwd*, char*, int, struct passwd**);'
13616 ./protochk "extern $try" $hdrs && getpwent_r_proto=I_SBIR ;;
13618 case "$getpwent_r_proto" in
13619 ''|0) try='struct passwd* getpwent_r(struct passwd*, char*, size_t);'
13620 ./protochk "extern $try" $hdrs && getpwent_r_proto=S_SBW ;;
13622 case "$getpwent_r_proto" in
13623 ''|0) try='struct passwd* getpwent_r(struct passwd*, char*, int);'
13624 ./protochk "extern $try" $hdrs && getpwent_r_proto=S_SBI ;;
13626 case "$getpwent_r_proto" in
13627 ''|0) try='int getpwent_r(struct passwd*, char*, int);'
13628 ./protochk "extern $try" $hdrs && getpwent_r_proto=I_SBI ;;
13630 case "$getpwent_r_proto" in
13631 ''|0) try='int getpwent_r(struct passwd*, char*, int, FILE**);'
13632 ./protochk "extern $try" $hdrs && getpwent_r_proto=I_SBIH ;;
13634 case "$getpwent_r_proto" in
13635 ''|0) d_getpwent_r=undef
13637 echo "Disabling getpwent_r, cannot determine prototype." >&4 ;;
13638 * ) case "$getpwent_r_proto" in
13639 REENTRANT_PROTO*) ;;
13640 *) getpwent_r_proto="REENTRANT_PROTO_$getpwent_r_proto" ;;
13642 echo "Prototype: $try" ;;
13645 *) case "$usethreads" in
13646 define) echo "getpwent_r has no prototype, not using it." >&4 ;;
13653 *) getpwent_r_proto=0
13657 : see if getpwnam_r exists
13658 set getpwnam_r d_getpwnam_r
13660 case "$d_getpwnam_r" in
13662 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
13663 case "$d_getpwnam_r_proto:$usethreads" in
13664 ":define") d_getpwnam_r_proto=define
13665 set d_getpwnam_r_proto getpwnam_r $hdrs
13669 case "$d_getpwnam_r_proto" in
13671 case "$getpwnam_r_proto" in
13672 ''|0) try='int getpwnam_r(const char*, struct passwd*, char*, size_t, struct passwd**);'
13673 ./protochk "extern $try" $hdrs && getpwnam_r_proto=I_CSBWR ;;
13675 case "$getpwnam_r_proto" in
13676 ''|0) try='int getpwnam_r(const char*, struct passwd*, char*, int, struct passwd**);'
13677 ./protochk "extern $try" $hdrs && getpwnam_r_proto=I_CSBIR ;;
13679 case "$getpwnam_r_proto" in
13680 ''|0) try='struct passwd* getpwnam_r(const char*, struct passwd*, char*, int);'
13681 ./protochk "extern $try" $hdrs && getpwnam_r_proto=S_CSBI ;;
13683 case "$getpwnam_r_proto" in
13684 ''|0) try='int getpwnam_r(const char*, struct passwd*, char*, int);'
13685 ./protochk "extern $try" $hdrs && getpwnam_r_proto=I_CSBI ;;
13687 case "$getpwnam_r_proto" in
13688 ''|0) d_getpwnam_r=undef
13690 echo "Disabling getpwnam_r, cannot determine prototype." >&4 ;;
13691 * ) case "$getpwnam_r_proto" in
13692 REENTRANT_PROTO*) ;;
13693 *) getpwnam_r_proto="REENTRANT_PROTO_$getpwnam_r_proto" ;;
13695 echo "Prototype: $try" ;;
13698 *) case "$usethreads" in
13699 define) echo "getpwnam_r has no prototype, not using it." >&4 ;;
13706 *) getpwnam_r_proto=0
13710 : see if getpwuid_r exists
13711 set getpwuid_r d_getpwuid_r
13713 case "$d_getpwuid_r" in
13715 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
13716 case "$d_getpwuid_r_proto:$usethreads" in
13717 ":define") d_getpwuid_r_proto=define
13718 set d_getpwuid_r_proto getpwuid_r $hdrs
13722 case "$d_getpwuid_r_proto" in
13724 case "$getpwuid_r_proto" in
13725 ''|0) try='int getpwuid_r(uid_t, struct passwd*, char*, size_t, struct passwd**);'
13726 ./protochk "extern $try" $hdrs && getpwuid_r_proto=I_TSBWR ;;
13728 case "$getpwuid_r_proto" in
13729 ''|0) try='int getpwuid_r(uid_t, struct passwd*, char*, int, struct passwd**);'
13730 ./protochk "extern $try" $hdrs && getpwuid_r_proto=I_TSBIR ;;
13732 case "$getpwuid_r_proto" in
13733 ''|0) try='int getpwuid_r(uid_t, struct passwd*, char*, int);'
13734 ./protochk "extern $try" $hdrs && getpwuid_r_proto=I_TSBI ;;
13736 case "$getpwuid_r_proto" in
13737 ''|0) try='struct passwd* getpwuid_r(uid_t, struct passwd*, char*, int);'
13738 ./protochk "extern $try" $hdrs && getpwuid_r_proto=S_TSBI ;;
13740 case "$getpwuid_r_proto" in
13741 ''|0) d_getpwuid_r=undef
13743 echo "Disabling getpwuid_r, cannot determine prototype." >&4 ;;
13744 * ) case "$getpwuid_r_proto" in
13745 REENTRANT_PROTO*) ;;
13746 *) getpwuid_r_proto="REENTRANT_PROTO_$getpwuid_r_proto" ;;
13748 echo "Prototype: $try" ;;
13751 *) case "$usethreads" in
13752 define) echo "getpwuid_r has no prototype, not using it." >&4 ;;
13759 *) getpwuid_r_proto=0
13764 : see if getservbyname exists
13765 set getservbyname d_getsbyname
13768 : see if getservbyport exists
13769 set getservbyport d_getsbyport
13772 : see if getservent exists
13773 set getservent d_getsent
13776 : see if getservbyname_r exists
13777 set getservbyname_r d_getservbyname_r
13779 case "$d_getservbyname_r" in
13781 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13782 case "$d_getservbyname_r_proto:$usethreads" in
13783 ":define") d_getservbyname_r_proto=define
13784 set d_getservbyname_r_proto getservbyname_r $hdrs
13788 case "$d_getservbyname_r_proto" in
13790 case "$getservbyname_r_proto" in
13791 ''|0) try='int getservbyname_r(const char*, const char*, struct servent*, char*, size_t, struct servent**);'
13792 ./protochk "extern $try" $hdrs && getservbyname_r_proto=I_CCSBWR ;;
13794 case "$getservbyname_r_proto" in
13795 ''|0) try='struct servent* getservbyname_r(const char*, const char*, struct servent*, char*, int);'
13796 ./protochk "extern $try" $hdrs && getservbyname_r_proto=S_CCSBI ;;
13798 case "$getservbyname_r_proto" in
13799 ''|0) try='int getservbyname_r(const char*, const char*, struct servent*, struct servent_data*);'
13800 ./protochk "extern $try" $hdrs && getservbyname_r_proto=I_CCSD ;;
13802 case "$getservbyname_r_proto" in
13803 ''|0) d_getservbyname_r=undef
13804 getservbyname_r_proto=0
13805 echo "Disabling getservbyname_r, cannot determine prototype." >&4 ;;
13806 * ) case "$getservbyname_r_proto" in
13807 REENTRANT_PROTO*) ;;
13808 *) getservbyname_r_proto="REENTRANT_PROTO_$getservbyname_r_proto" ;;
13810 echo "Prototype: $try" ;;
13813 *) case "$usethreads" in
13814 define) echo "getservbyname_r has no prototype, not using it." >&4 ;;
13816 d_getservbyname_r=undef
13817 getservbyname_r_proto=0
13821 *) getservbyname_r_proto=0
13825 : see if getservbyport_r exists
13826 set getservbyport_r d_getservbyport_r
13828 case "$d_getservbyport_r" in
13830 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13831 case "$d_getservbyport_r_proto:$usethreads" in
13832 ":define") d_getservbyport_r_proto=define
13833 set d_getservbyport_r_proto getservbyport_r $hdrs
13837 case "$d_getservbyport_r_proto" in
13839 case "$getservbyport_r_proto" in
13840 ''|0) try='int getservbyport_r(int, const char*, struct servent*, char*, size_t, struct servent**);'
13841 ./protochk "extern $try" $hdrs && getservbyport_r_proto=I_ICSBWR ;;
13843 case "$getservbyport_r_proto" in
13844 ''|0) try='struct servent* getservbyport_r(int, const char*, struct servent*, char*, int);'
13845 ./protochk "extern $try" $hdrs && getservbyport_r_proto=S_ICSBI ;;
13847 case "$getservbyport_r_proto" in
13848 ''|0) try='int getservbyport_r(int, const char*, struct servent*, struct servent_data*);'
13849 ./protochk "extern $try" $hdrs && getservbyport_r_proto=I_ICSD ;;
13851 case "$getservbyport_r_proto" in
13852 ''|0) d_getservbyport_r=undef
13853 getservbyport_r_proto=0
13854 echo "Disabling getservbyport_r, cannot determine prototype." >&4 ;;
13855 * ) case "$getservbyport_r_proto" in
13856 REENTRANT_PROTO*) ;;
13857 *) getservbyport_r_proto="REENTRANT_PROTO_$getservbyport_r_proto" ;;
13859 echo "Prototype: $try" ;;
13862 *) case "$usethreads" in
13863 define) echo "getservbyport_r has no prototype, not using it." >&4 ;;
13865 d_getservbyport_r=undef
13866 getservbyport_r_proto=0
13870 *) getservbyport_r_proto=0
13874 : see if getservent_r exists
13875 set getservent_r d_getservent_r
13877 case "$d_getservent_r" in
13879 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13880 case "$d_getservent_r_proto:$usethreads" in
13881 ":define") d_getservent_r_proto=define
13882 set d_getservent_r_proto getservent_r $hdrs
13886 case "$d_getservent_r_proto" in
13888 case "$getservent_r_proto" in
13889 ''|0) try='int getservent_r(struct servent*, char*, size_t, struct servent**);'
13890 ./protochk "extern $try" $hdrs && getservent_r_proto=I_SBWR ;;
13892 case "$getservent_r_proto" in
13893 ''|0) try='int getservent_r(struct servent*, char*, int);'
13894 ./protochk "extern $try" $hdrs && getservent_r_proto=I_SBI ;;
13896 case "$getservent_r_proto" in
13897 ''|0) try='struct servent* getservent_r(struct servent*, char*, int);'
13898 ./protochk "extern $try" $hdrs && getservent_r_proto=S_SBI ;;
13900 case "$getservent_r_proto" in
13901 ''|0) try='int getservent_r(struct servent*, struct servent_data*);'
13902 ./protochk "extern $try" $hdrs && getservent_r_proto=I_SD ;;
13904 case "$getservent_r_proto" in
13905 ''|0) d_getservent_r=undef
13906 getservent_r_proto=0
13907 echo "Disabling getservent_r, cannot determine prototype." >&4 ;;
13908 * ) case "$getservent_r_proto" in
13909 REENTRANT_PROTO*) ;;
13910 *) getservent_r_proto="REENTRANT_PROTO_$getservent_r_proto" ;;
13912 echo "Prototype: $try" ;;
13915 *) case "$usethreads" in
13916 define) echo "getservent_r has no prototype, not using it." >&4 ;;
13918 d_getservent_r=undef
13919 getservent_r_proto=0
13923 *) getservent_r_proto=0
13927 : see if prototypes for various getservxxx netdb.h functions are available
13929 set d_getservprotos getservent $i_netdb netdb.h
13932 : see if getspnam exists
13933 set getspnam d_getspnam
13936 : see if this is a shadow.h system
13937 set shadow.h i_shadow
13940 : see if getspnam_r exists
13941 set getspnam_r d_getspnam_r
13943 case "$d_getspnam_r" in
13945 hdrs="$i_systypes sys/types.h define stdio.h $i_shadow shadow.h"
13946 case "$d_getspnam_r_proto:$usethreads" in
13947 ":define") d_getspnam_r_proto=define
13948 set d_getspnam_r_proto getspnam_r $hdrs
13952 case "$d_getspnam_r_proto" in
13954 case "$getspnam_r_proto" in
13955 ''|0) try='int getspnam_r(const char*, struct spwd*, char*, size_t, struct spwd**);'
13956 ./protochk "extern $try" $hdrs && getspnam_r_proto=I_CSBWR ;;
13958 case "$getspnam_r_proto" in
13959 ''|0) try='struct spwd* getspnam_r(const char*, struct spwd*, char*, int);'
13960 ./protochk "extern $try" $hdrs && getspnam_r_proto=S_CSBI ;;
13962 case "$getspnam_r_proto" in
13963 ''|0) d_getspnam_r=undef
13965 echo "Disabling getspnam_r, cannot determine prototype." >&4 ;;
13966 * ) case "$getspnam_r_proto" in
13967 REENTRANT_PROTO*) ;;
13968 *) getspnam_r_proto="REENTRANT_PROTO_$getspnam_r_proto" ;;
13970 echo "Prototype: $try" ;;
13973 *) case "$usethreads" in
13974 define) echo "getspnam_r has no prototype, not using it." >&4 ;;
13981 *) getspnam_r_proto=0
13985 : see if gettimeofday or ftime exists
13986 set gettimeofday d_gettimeod
13988 case "$d_gettimeod" in
13994 val="$undef"; set d_ftime; eval $setvar
13997 case "$d_gettimeod$d_ftime" in
14000 echo 'No ftime() nor gettimeofday() -- timing may be less accurate.' >&4
14004 : see if gmtime_r exists
14005 set gmtime_r d_gmtime_r
14007 case "$d_gmtime_r" in
14009 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
14010 case "$d_gmtime_r_proto:$usethreads" in
14011 ":define") d_gmtime_r_proto=define
14012 set d_gmtime_r_proto gmtime_r $hdrs
14016 case "$d_gmtime_r_proto" in
14018 case "$gmtime_r_proto" in
14019 ''|0) try='struct tm* gmtime_r(const time_t*, struct tm*);'
14020 ./protochk "extern $try" $hdrs && gmtime_r_proto=S_TS ;;
14022 case "$gmtime_r_proto" in
14023 ''|0) try='int gmtime_r(const time_t*, struct tm*);'
14024 ./protochk "extern $try" $hdrs && gmtime_r_proto=I_TS ;;
14026 case "$gmtime_r_proto" in
14027 ''|0) d_gmtime_r=undef
14029 echo "Disabling gmtime_r, cannot determine prototype." >&4 ;;
14030 * ) case "$gmtime_r_proto" in
14031 REENTRANT_PROTO*) ;;
14032 *) gmtime_r_proto="REENTRANT_PROTO_$gmtime_r_proto" ;;
14034 echo "Prototype: $try" ;;
14037 *) case "$usethreads" in
14038 define) echo "gmtime_r has no prototype, not using it." >&4 ;;
14045 *) gmtime_r_proto=0
14049 : see if hasmntopt exists
14050 set hasmntopt d_hasmntopt
14053 : see if this is a netinet/in.h or sys/in.h system
14054 set netinet/in.h i_niin sys/in.h i_sysin
14057 : see if arpa/inet.h has to be included
14058 set arpa/inet.h i_arpainet
14061 : see if htonl --and friends-- exists
14066 : Maybe they are macros.
14069 $cat >htonl.c <<EOM
14071 #include <sys/types.h>
14072 #$i_niin I_NETINET_IN
14074 #$i_arpainet I_ARPA_INET
14075 #ifdef I_NETINET_IN
14076 #include <netinet/in.h>
14079 #include <sys/in.h>
14082 #include <arpa/inet.h>
14085 printf("Defined as a macro.");
14088 $cppstdin $cppflags $cppminus < htonl.c >htonl.E 2>/dev/null
14089 if $contains 'Defined as a macro' htonl.E >/dev/null 2>&1; then
14091 echo "But it seems to be defined as a macro." >&4
14099 : see if ilogbl exists
14100 set ilogbl d_ilogbl
14105 if set index val -f; eval $csym; $val; then
14106 if set strchr val -f d_strchr; eval $csym; $val; then
14107 if $contains strchr "$strings" >/dev/null 2>&1 ; then
14110 echo "strchr() found." >&4
14114 echo "index() found." >&4
14119 echo "index() found." >&4
14122 if set strchr val -f d_strchr; eval $csym; $val; then
14125 echo "strchr() found." >&4
14127 echo "No index() or strchr() found!" >&4
14132 set d_strchr; eval $setvar
14134 set d_index; eval $setvar
14136 : check whether inet_aton exists
14137 set inet_aton d_inetaton
14142 $cat >isascii.c <<EOCP
14145 #$i_stdlib I_STDLIB
14147 #include <stdlib.h>
14158 if eval $compile; then
14159 echo "isascii() found." >&4
14162 echo "isascii() NOT found." >&4
14169 : see if isfinite exists
14170 set isfinite d_isfinite
14173 : see if isinf exists
14177 : see if isnan exists
14181 : see if isnanl exists
14182 set isnanl d_isnanl
14185 : see if killpg exists
14186 set killpg d_killpg
14189 : see if lchown exists
14191 $cat > try.c <<'EOCP'
14192 /* System header to define __stub macros and hopefully few prototypes,
14193 which can conflict with char lchown(); below. */
14194 #include <assert.h>
14195 /* Override any gcc2 internal prototype to avoid an error. */
14196 /* We use char because int might match the return type of a gcc2
14197 builtin and then its argument prototype would still apply. */
14200 /* The GNU C library defines this for functions which it implements
14201 to always fail with ENOSYS. Some functions are actually named
14202 something starting with __ and the normal name is an alias. */
14203 #if defined (__stub_lchown) || defined (__stub___lchown)
14211 if eval $compile; then
14212 $echo "lchown() found." >&4
14215 $echo "lchown() NOT found." >&4
14221 : See if number of significant digits in a double precision number is known
14223 $cat >ldbl_dig.c <<EOM
14224 #$i_limits I_LIMITS
14227 #include <limits.h>
14233 printf("Contains LDBL_DIG");
14236 $cppstdin $cppflags $cppminus < ldbl_dig.c >ldbl_dig.E 2>/dev/null
14237 if $contains 'LDBL_DIG' ldbl_dig.E >/dev/null 2>&1; then
14238 echo "LDBL_DIG found." >&4
14241 echo "LDBL_DIG NOT found." >&4
14248 : see if this is a math.h system
14252 d_libm_lib_version="$undef"
14255 : check to see if math.h defines _LIB_VERSION
14257 echo "Checking to see if your libm supports _LIB_VERSION..." >&4
14259 #include <unistd.h>
14261 int main (int argc, char *argv[])
14263 printf ("%d\n", _LIB_VERSION);
14268 if eval $compile; then
14270 echo "Yes, it does ($foo)" >&4
14271 d_libm_lib_version="$define"
14273 echo "No, it does not (probably harmless)\n" >&4
14275 $rm -f try.* try core core.try.*
14280 : see if link exists
14284 : see if localtime_r exists
14285 set localtime_r d_localtime_r
14287 case "$d_localtime_r" in
14289 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
14290 case "$d_localtime_r_proto:$usethreads" in
14291 ":define") d_localtime_r_proto=define
14292 set d_localtime_r_proto localtime_r $hdrs
14296 case "$d_localtime_r_proto" in
14298 case "$localtime_r_proto" in
14299 ''|0) try='struct tm* localtime_r(const time_t*, struct tm*);'
14300 ./protochk "extern $try" $hdrs && localtime_r_proto=S_TS ;;
14302 case "$localtime_r_proto" in
14303 ''|0) try='int localtime_r(const time_t*, struct tm*);'
14304 ./protochk "extern $try" $hdrs && localtime_r_proto=I_TS ;;
14306 case "$localtime_r_proto" in
14307 ''|0) d_localtime_r=undef
14308 localtime_r_proto=0
14309 echo "Disabling localtime_r, cannot determine prototype." >&4 ;;
14310 * ) case "$localtime_r_proto" in
14311 REENTRANT_PROTO*) ;;
14312 *) localtime_r_proto="REENTRANT_PROTO_$localtime_r_proto" ;;
14314 echo "Prototype: $try" ;;
14317 *) case "$usethreads" in
14318 define) echo "localtime_r has no prototype, not using it." >&4 ;;
14320 d_localtime_r=undef
14321 localtime_r_proto=0
14325 *) localtime_r_proto=0
14329 : see if localeconv exists
14330 set localeconv d_locconv
14333 : see if lockf exists
14337 : see if prototype for lseek is available
14339 set d_lseekproto lseek $i_systypes sys/types.h $i_unistd unistd.h
14342 : see if lstat exists
14346 : see if madvise exists
14347 set madvise d_madvise
14350 : see if malloc_size exists
14351 set malloc_size d_malloc_size
14354 : see if malloc_size_good exists
14355 set malloc_good_size d_malloc_good_size
14358 : see if mblen exists
14362 : see if mbstowcs exists
14363 set mbstowcs d_mbstowcs
14366 : see if mbtowc exists
14367 set mbtowc d_mbtowc
14370 : see if memchr exists
14371 set memchr d_memchr
14374 : see if memcmp exists
14375 set memcmp d_memcmp
14378 : see if memcpy exists
14379 set memcpy d_memcpy
14382 : see if memmove exists
14383 set memmove d_memmove
14386 : see if memset exists
14387 set memset d_memset
14390 : see if mkdir exists
14394 : see if mkdtemp exists
14395 set mkdtemp d_mkdtemp
14398 : see if mkfifo exists
14399 set mkfifo d_mkfifo
14402 : see if mkstemp exists
14403 set mkstemp d_mkstemp
14406 : see if mkstemps exists
14407 set mkstemps d_mkstemps
14410 : see if mktime exists
14411 set mktime d_mktime
14414 : see if this is a sys/mman.h system
14415 set sys/mman.h i_sysmman
14418 : see if mmap exists
14421 : see what shmat returns
14422 : default to something harmless
14424 case "$i_sysmman$d_mmap" in
14426 $cat >mmap.c <<'END'
14427 #include <sys/mman.h>
14430 if $cc $ccflags -c mmap.c >/dev/null 2>&1; then
14435 echo "and it returns ($mmaptype)." >&4
14441 : see if sqrtl exists
14445 : see if scalbnl exists
14446 set scalbnl d_scalbnl
14449 : see if modfl exists
14453 : see if prototype for modfl is available
14455 set d_modflproto modfl $i_math math.h
14458 d_modfl_pow32_bug="$undef"
14460 case "$d_longdbl$d_modfl" in
14463 Checking to see whether your modfl() is okay for large values...
14469 if $test "X$d_modflproto" != "X$define"; then
14470 $cat >>try.c <<EOCP
14471 /* Sigh. many current glibcs provide the function, but do not prototype it. */
14472 long double modfl (long double, long double *);
14475 $cat >>try.c <<EOCP
14477 long double nv = 4294967303.15;
14483 printf(" %"$sPRIfldbl" %"$sPRIfldbl" %"$sPRIfldbl"\n", nv, v, w);
14487 case "$osname:$gccversion" in
14488 aix:) saveccflags="$ccflags"
14489 ccflags="$ccflags -qlongdouble" ;; # to avoid core dump
14492 if eval $compile; then
14495 *" 4294967303.150000 1.150000 4294967302.000000")
14496 echo >&4 "Your modfl() is broken for large values."
14497 d_modfl_pow32_bug="$define"
14499 glibc) echo >&4 "You should upgrade your glibc to at least 2.2.2 to get a fixed modfl()."
14503 *" 4294967303.150000 0.150000 4294967303.000000")
14504 echo >&4 "Your modfl() seems okay for large values."
14506 *) echo >&4 "I don't understand your modfl() at all."
14510 $rm -f try.* try core core.try.*
14512 echo "I cannot figure out whether your modfl() is okay, assuming it isn't."
14515 case "$osname:$gccversion" in
14516 aix:) ccflags="$saveccflags" ;; # restore
14521 if $test "$uselongdouble" = "$define"; then
14523 if $test "$d_sqrtl" != "$define"; then
14524 message="$message sqrtl"
14526 if $test "$d_modfl" != "$define"; then
14527 if $test "$d_aintl:$d_copysignl" = "$define:$define"; then
14528 echo "You have both aintl and copysignl, so I can emulate modfl."
14530 message="$message modfl"
14533 if $test "$d_frexpl" != "$define"; then
14534 if $test "$d_ilogbl:$d_scalbnl" = "$define:$define"; then
14535 echo "You have both ilogbl and scalbnl, so I can emulate frexpl."
14537 message="$message frexpl"
14541 if $test "$message" != ""; then
14544 *** You requested the use of long doubles but you do not seem to have
14545 *** the following mathematical functions needed for long double support:
14547 *** Please rerun Configure without -Duselongdouble and/or -Dusemorebits.
14548 *** Cannot continue, aborting.
14556 : see if mprotect exists
14557 set mprotect d_mprotect
14560 : see if msgctl exists
14561 set msgctl d_msgctl
14564 : see if msgget exists
14565 set msgget d_msgget
14568 : see if msgsnd exists
14569 set msgsnd d_msgsnd
14572 : see if msgrcv exists
14573 set msgrcv d_msgrcv
14576 : see how much of the 'msg*(2)' library is present.
14579 case "$d_msgctl$d_msgget$d_msgsnd$d_msgrcv" in
14580 *"$undef"*) h_msg=false;;
14584 case "`ipcs 2>&1`" in
14585 "SVID messages"*"not configured"*)
14586 echo "Your $osname does not have the msg*(2) configured." >&4
14589 set msgctl d_msgctl
14591 set msgget d_msgget
14593 set msgsnd d_msgsnd
14595 set msgrcv d_msgrcv
14601 : we could also check for sys/ipc.h ...
14602 if $h_msg && $test `./findhdr sys/msg.h`; then
14603 echo "You have the full msg*(2) library." >&4
14606 echo "You don't have the full msg*(2) library." >&4
14614 echo "Checking to see if your system supports struct msghdr..." >&4
14615 set d_msghdr_s msghdr $i_systypes sys/types.h $d_socket sys/socket.h $i_sysuio sys/uio.h
14617 case "$d_msghdr_s" in
14618 "$define") echo "Yes, it does." ;;
14619 *) echo "No, it doesn't." ;;
14623 : see if msync exists
14627 : see if munmap exists
14628 set munmap d_munmap
14631 : see if nice exists
14635 : see if this is a langinfo.h system
14636 set langinfo.h i_langinfo
14639 : see if nl_langinfo exists
14640 set nl_langinfo d_nl_langinfo
14643 : check for length of character
14645 case "$charsize" in
14647 echo "Checking to see how big your characters are (hey, you never know)..." >&4
14650 #$i_stdlib I_STDLIB
14652 #include <stdlib.h>
14656 printf("%d\n", (int)sizeof(char));
14661 if eval $compile_ok; then
14665 echo "(I can't seem to compile the test program. Guessing...)"
14672 rp="What is the size of a character (in bytes)?"
14677 : check for volatile keyword
14679 echo 'Checking to see if your C compiler knows about "volatile"...' >&4
14680 $cat >try.c <<'EOCP'
14683 typedef struct _goo_struct goo_struct;
14684 goo_struct * volatile goo = ((goo_struct *)0);
14685 struct _goo_struct {
14690 typedef unsigned short foo_t;
14691 char *volatile foo;
14693 volatile foo_t blech;
14697 if $cc -c $ccflags try.c >/dev/null 2>&1 ; then
14699 echo "Yup, it does."
14702 echo "Nope, it doesn't."
14710 $echo "Choosing the C types to be used for Perl's internal types..." >&4
14712 case "$use64bitint:$d_quad:$quadtype" in
14715 uvtype="$uquadtype"
14720 uvtype="unsigned long"
14726 case "$uselongdouble:$d_longdbl" in
14728 nvtype="long double"
14729 nvsize=$longdblsize
14736 $echo "(IV will be "$ivtype", $ivsize bytes)"
14737 $echo "(UV will be "$uvtype", $uvsize bytes)"
14738 $echo "(NV will be "$nvtype", $nvsize bytes)"
14741 #$i_inttypes I_INTTYPES
14743 #include <inttypes.h>
14748 int8_t i = INT8_MAX;
14749 uint8_t u = UINT8_MAX;
14750 printf("int8_t\n");
14753 int16_t i = INT16_MAX;
14754 uint16_t i = UINT16_MAX;
14755 printf("int16_t\n");
14758 int32_t i = INT32_MAX;
14759 uint32_t u = UINT32_MAX;
14760 printf("int32_t\n");
14766 '') case "$charsize" in
14768 u8type="unsigned char"
14777 if eval $compile; then
14778 case "`$run ./try`" in
14779 int8_t) i8type=int8_t
14789 '') if $test $charsize -ge 1; then
14791 u8type="unsigned char"
14799 '') case "$shortsize" in
14801 u16type="unsigned short"
14809 '') set try -DINT16
14810 if eval $compile; then
14811 case "`$run ./try`" in
14823 '') if $test $shortsize -ge 2; then
14825 u16type="unsigned short"
14833 '') case "$longsize" in
14835 u32type="unsigned long"
14839 *) case "$intsize" in
14841 u32type="unsigned int"
14851 '') set try -DINT32
14852 if eval $compile; then
14853 case "`$run ./try`" in
14865 '') if $test $intsize -ge 4; then
14867 u32type="unsigned int"
14875 '') case "$d_quad:$quadtype" in
14877 i64type="$quadtype"
14878 u64type="$uquadtype"
14886 $echo "Checking how many bits of your UVs your NVs can preserve..." >&4
14887 : volatile so that the compiler has to store it out to memory.
14888 if test X"$d_volatile" = X"$define"; then
14893 #$i_stdlib I_STDLIB
14895 #include <stdlib.h>
14897 #include <sys/types.h>
14898 #include <signal.h>
14900 $volatile int bletched = 0;
14901 $signal_t blech(s) int s; { bletched = 1; }
14906 int n = 8 * $uvsize;
14909 signal(SIGFPE, blech);
14912 for (i = 0; i < n; i++) {
14913 u = u << 1 | ($uvtype)1;
14915 if (($uvtype)d != u)
14919 d = ($nvtype)(u - 1);
14920 if (($uvtype)d != (u - 1))
14928 printf("%d\n", ((i == n) ? -n : i));
14934 d_nv_preserves_uv="$undef"
14935 if eval $compile; then
14936 nv_preserves_uv_bits="`$run ./try`"
14938 case "$nv_preserves_uv_bits" in
14940 nv_preserves_uv_bits=`expr 0 - $nv_preserves_uv_bits`
14941 $echo "Your NVs can preserve all $nv_preserves_uv_bits bits of your UVs." 2>&1
14942 d_nv_preserves_uv="$define"
14944 [1-9]*) $echo "Your NVs can preserve only $nv_preserves_uv_bits bits of your UVs." 2>&1
14945 d_nv_preserves_uv="$undef" ;;
14946 *) $echo "Can't figure out how many bits your NVs preserve." 2>&1
14947 nv_preserves_uv_bits="$undef" ;;
14952 $echo "Checking whether NV 0.0 is all bits zero in memory..." >&4
14953 : volatile so that the compiler has to store it out to memory.
14954 if test X"$d_volatile" = X"$define"; then
14959 #$i_stdlib I_STDLIB
14961 #include <stdlib.h>
14963 #$i_string I_STRING
14965 # include <string.h>
14967 # include <strings.h>
14969 #include <sys/types.h>
14970 #include <signal.h>
14972 $volatile int bletched = 0;
14973 $signal_t blech(s) int s; { bletched = 1; }
14976 int checkit($nvtype d, char *where) {
14977 unsigned char *p = (char *)&d;
14978 unsigned char *end = p + sizeof(d);
14988 printf("No - %s: 0x", where);
14990 printf ("%02X", *p++);
14995 int main(int argc, char **argv) {
14998 fail += checkit(d, "0.0");
15000 /* The compiler shouldn't be assuming that bletched is 0 */
15003 fail += checkit(d, "bleched");
15006 signal(SIGFPE, blech);
15009 /* Paranoia - the compiler should have no way of knowing that ANSI says
15010 that argv[argc] will always be NULL. Actually, if it did assume this it
15011 would be buggy, as this is C and main() can be called from elsewhere in
15013 d = argv[argc] ? 1 : 0;
15016 printf("Odd argv[argc]=%p, d=%g\n", argv[argc], d);
15019 fail += checkit(d, "ternary");
15021 memset(&d, sizeof(d), argv[argc] ? 1 : 0);
15024 printf("No - memset doesn't give 0.0\n");
15025 /* This might just blow up: */
15026 printf("(gives %g)\n", d);
15032 printf("No - something bleched\n");
15037 printf("No - %d fail(s)\n", fail);
15046 d_nv_zero_is_allbits_zero="$undef"
15047 if eval $compile; then
15053 0.0 is represented as all bits zero in memory
15055 d_nv_zero_is_allbits_zero="$define"
15058 0.0 is not represented as all bits zero in memory
15060 d_nv_zero_is_allbits_zero="$undef"
15065 0.0 is not represented as all bits zero in memory
15067 d_nv_zero_is_allbits_zero="$undef"
15075 : check for off64_t
15077 echo "Checking to see if you have off64_t..." >&4
15079 #include <sys/types.h>
15080 #include <unistd.h>
15081 int main() { off64_t x = 7; }
15084 if eval $compile; then
15086 echo "You have off64_t."
15089 echo "You do not have off64_t."
15090 case "$lseeksize" in
15091 8) echo "(Your off_t is 64 bits, so you could use that.)" ;;
15098 : how to create joinable pthreads
15099 if test "X$usethreads" = "X$define" -a "X$i_pthread" = "X$define"; then
15101 echo "Checking what constant to use for creating joinable pthreads..." >&4
15102 $cat >try.c <<'EOCP'
15103 #include <pthread.h>
15105 int detachstate = JOINABLE;
15108 set try -DJOINABLE=PTHREAD_CREATE_JOINABLE
15109 if eval $compile; then
15110 echo "You seem to use PTHREAD_CREATE_JOINABLE." >&4
15111 val="$undef" # Yes, undef.
15112 set d_old_pthread_create_joinable
15115 set old_pthread_create_joinable
15118 set try -DJOINABLE=PTHREAD_CREATE_UNDETACHED
15119 if eval $compile; then
15120 echo "You seem to use PTHREAD_CREATE_UNDETACHED." >&4
15122 set d_old_pthread_create_joinable
15124 val=PTHREAD_CREATE_UNDETACHED
15125 set old_pthread_create_joinable
15128 set try -DJOINABLE=__UNDETACHED
15129 if eval $compile; then
15130 echo "You seem to use __UNDETACHED." >&4
15132 set d_old_pthread_create_joinable
15135 set old_pthread_create_joinable
15138 echo "Egads, nothing obvious found. Guessing that you use 0." >&4
15140 set d_old_pthread_create_joinable
15143 set old_pthread_create_joinable
15150 d_old_pthread_create_joinable="$undef"
15151 old_pthread_create_joinable=""
15154 : see if pause exists
15158 : see if pipe exists
15162 : see if poll exists
15166 : see if readlink exists
15167 set readlink d_readlink
15173 case "$d_readlink" in
15175 if $issymlink /proc/self/exe ; then
15176 $ls -l /proc/self/exe > reflect
15177 if $contains /`basename $ls` reflect >/dev/null 2>&1; then
15178 echo "You have Linux-like /proc/self/exe."
15179 procselfexe='"/proc/self/exe"'
15183 if $issymlink /proc/curproc/file ; then
15184 $ls -l /proc/curproc/file > reflect
15185 if $contains /`basename $ls` reflect >/dev/null 2>&1; then
15186 echo "You have BSD-like /proc/curproc/file."
15187 procselfexe='"/proc/curproc/file"'
15197 : see whether the pthread_atfork exists
15199 #include <pthread.h>
15202 #ifdef PTHREAD_ATFORK
15203 pthread_atfork(NULL,NULL,NULL);
15208 : see if pthread_atfork exists
15209 set try -DPTHREAD_ATFORK
15210 if eval $compile; then
15215 case "$usethreads" in
15218 $define) echo 'pthread_atfork found.' >&4 ;;
15219 *) echo 'pthread_atfork NOT found.' >&4 ;;
15222 set d_pthread_atfork
15225 : see if pthread_attr_setscope exists
15226 set pthread_attr_setscope d_pthread_attr_setscope
15230 : see whether the various POSIXish _yields exist
15232 #include <pthread.h>
15238 #ifdef PTHREAD_YIELD
15241 #ifdef PTHREAD_YIELD_NULL
15242 pthread_yield(NULL);
15248 : see if sched_yield exists
15249 set try -DSCHED_YIELD
15250 if eval $compile; then
15252 sched_yield='sched_yield()'
15256 case "$usethreads" in
15259 $define) echo 'sched_yield() found.' >&4 ;;
15260 *) echo 'sched_yield() NOT found.' >&4 ;;
15266 : see if pthread_yield exists
15267 set try -DPTHREAD_YIELD
15268 if eval $compile; then
15270 case "$sched_yield" in
15271 '') sched_yield='pthread_yield()' ;;
15274 set try -DPTHREAD_YIELD_NULL
15275 if eval $compile; then
15277 case "$sched_yield" in
15278 '') sched_yield='pthread_yield(NULL)' ;;
15284 case "$usethreads" in
15287 $define) echo 'pthread_yield() found.' >&4 ;;
15288 *) echo 'pthread_yield() NOT found.' >&4 ;;
15292 set d_pthread_yield
15295 case "$sched_yield" in
15296 '') sched_yield=undef ;;
15301 : see if random_r exists
15302 set random_r d_random_r
15304 case "$d_random_r" in
15306 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
15307 case "$d_random_r_proto:$usethreads" in
15308 ":define") d_random_r_proto=define
15309 set d_random_r_proto random_r $hdrs
15313 case "$d_random_r_proto" in
15315 case "$random_r_proto" in
15316 ''|0) try='int random_r(int*, struct random_data*);'
15317 ./protochk "extern $try" $hdrs && random_r_proto=I_iS ;;
15319 case "$random_r_proto" in
15320 ''|0) try='int random_r(long*, struct random_data*);'
15321 ./protochk "extern $try" $hdrs && random_r_proto=I_lS ;;
15323 case "$random_r_proto" in
15324 ''|0) try='int random_r(struct random_data*, int32_t*);'
15325 ./protochk "extern $try" $hdrs && random_r_proto=I_St ;;
15327 case "$random_r_proto" in
15328 ''|0) d_random_r=undef
15330 echo "Disabling random_r, cannot determine prototype." >&4 ;;
15331 * ) case "$random_r_proto" in
15332 REENTRANT_PROTO*) ;;
15333 *) random_r_proto="REENTRANT_PROTO_$random_r_proto" ;;
15335 echo "Prototype: $try" ;;
15338 *) case "$usethreads" in
15339 define) echo "random_r has no prototype, not using it." >&4 ;;
15346 *) random_r_proto=0
15350 : see if readdir and friends exist
15351 set readdir d_readdir
15353 set seekdir d_seekdir
15355 set telldir d_telldir
15357 set rewinddir d_rewinddir
15360 : see if readdir64_r exists
15361 set readdir64_r d_readdir64_r
15363 case "$d_readdir64_r" in
15365 hdrs="$i_systypes sys/types.h define stdio.h $i_dirent dirent.h"
15366 case "$d_readdir64_r_proto:$usethreads" in
15367 ":define") d_readdir64_r_proto=define
15368 set d_readdir64_r_proto readdir64_r $hdrs
15372 case "$d_readdir64_r_proto" in
15374 case "$readdir64_r_proto" in
15375 ''|0) try='int readdir64_r(DIR*, struct dirent64*, struct dirent64**);'
15376 ./protochk "extern $try" $hdrs && readdir64_r_proto=I_TSR ;;
15378 case "$readdir64_r_proto" in
15379 ''|0) try='int readdir64_r(DIR*, struct dirent64*);'
15380 ./protochk "extern $try" $hdrs && readdir64_r_proto=I_TS ;;
15382 case "$readdir64_r_proto" in
15383 ''|0) d_readdir64_r=undef
15384 readdir64_r_proto=0
15385 echo "Disabling readdir64_r, cannot determine prototype." >&4 ;;
15386 * ) case "$readdir64_r_proto" in
15387 REENTRANT_PROTO*) ;;
15388 *) readdir64_r_proto="REENTRANT_PROTO_$readdir64_r_proto" ;;
15390 echo "Prototype: $try" ;;
15393 *) case "$usethreads" in
15394 define) echo "readdir64_r has no prototype, not using it." >&4 ;;
15396 d_readdir64_r=undef
15397 readdir64_r_proto=0
15401 *) readdir64_r_proto=0
15405 : see if readdir_r exists
15406 set readdir_r d_readdir_r
15408 case "$d_readdir_r" in
15410 hdrs="$i_systypes sys/types.h define stdio.h $i_dirent dirent.h"
15411 case "$d_readdir_r_proto:$usethreads" in
15412 ":define") d_readdir_r_proto=define
15413 set d_readdir_r_proto readdir_r $hdrs
15417 case "$d_readdir_r_proto" in
15419 case "$readdir_r_proto" in
15420 ''|0) try='int readdir_r(DIR*, struct dirent*, struct dirent**);'
15421 ./protochk "extern $try" $hdrs && readdir_r_proto=I_TSR ;;
15423 case "$readdir_r_proto" in
15424 ''|0) try='int readdir_r(DIR*, struct dirent*);'
15425 ./protochk "extern $try" $hdrs && readdir_r_proto=I_TS ;;
15427 case "$readdir_r_proto" in
15428 ''|0) d_readdir_r=undef
15430 echo "Disabling readdir_r, cannot determine prototype." >&4 ;;
15431 * ) case "$readdir_r_proto" in
15432 REENTRANT_PROTO*) ;;
15433 *) readdir_r_proto="REENTRANT_PROTO_$readdir_r_proto" ;;
15435 echo "Prototype: $try" ;;
15438 *) case "$usethreads" in
15439 define) echo "readdir_r has no prototype, not using it." >&4 ;;
15446 *) readdir_r_proto=0
15450 : see if readv exists
15454 : see if recvmsg exists
15455 set recvmsg d_recvmsg
15458 : see if rename exists
15459 set rename d_rename
15462 : see if rmdir exists
15466 : see if memory.h is available.
15471 : See if it conflicts with string.h
15477 $cppstdin $cppflags $cppminus < $strings > mem.h
15478 if $contains 'memcpy' mem.h >/dev/null 2>&1; then
15480 echo "We won't be including <memory.h>."
15490 : can bcopy handle overlapping blocks?
15493 case "$d_memmove" in
15494 "$define") echo "I'll use memmove() instead of bcopy() for overlapping copies." ;;
15495 *) case "$d_bcopy" in
15497 echo "Checking to see if bcopy() can do overlapping copies..." >&4
15499 #$i_memory I_MEMORY
15500 #$i_stdlib I_STDLIB
15501 #$i_string I_STRING
15502 #$i_unistd I_UNISTD
15504 $cat >>try.c <<'EOCP'
15507 # include <memory.h>
15510 # include <stdlib.h>
15513 # include <string.h>
15515 # include <strings.h>
15518 # include <unistd.h> /* Needed for NetBSD */
15522 char buf[128], abc[128];
15528 /* Copy "abcde..." string to char abc[] so that gcc doesn't
15529 try to store the string in read-only memory. */
15530 bcopy("abcdefghijklmnopqrstuvwxyz0123456789", abc, 36);
15532 for (align = 7; align >= 0; align--) {
15533 for (len = 36; len; len--) {
15535 bcopy(abc, b, len);
15536 for (off = 1; off <= len; off++) {
15537 bcopy(b, b+off, len);
15538 bcopy(b+off, b, len);
15539 if (bcmp(b, abc, len))
15548 if eval $compile_ok; then
15549 if ./try 2>/dev/null; then
15550 echo "Yes, it can."
15553 echo "It can't, sorry."
15556 echo "(I can't compile the test program, so we'll assume not...)"
15560 $rm -f try.* try core
15566 : can memcpy handle overlapping blocks?
15569 case "$d_memmove" in
15570 "$define") echo "I'll use memmove() instead of memcpy() for overlapping copies." ;;
15571 *) case "$d_memcpy" in
15573 echo "Checking to see if memcpy() can do overlapping copies..." >&4
15575 #$i_memory I_MEMORY
15576 #$i_stdlib I_STDLIB
15577 #$i_string I_STRING
15578 #$i_unistd I_UNISTD
15580 $cat >>try.c <<'EOCP'
15583 # include <memory.h>
15586 # include <stdlib.h>
15589 # include <string.h>
15591 # include <strings.h>
15594 # include <unistd.h> /* Needed for NetBSD */
15598 char buf[128], abc[128];
15604 /* Copy "abcde..." string to char abc[] so that gcc doesn't
15605 try to store the string in read-only memory. */
15606 memcpy(abc, "abcdefghijklmnopqrstuvwxyz0123456789", 36);
15608 for (align = 7; align >= 0; align--) {
15609 for (len = 36; len; len--) {
15611 memcpy(b, abc, len);
15612 for (off = 1; off <= len; off++) {
15613 memcpy(b+off, b, len);
15614 memcpy(b, b+off, len);
15615 if (memcmp(b, abc, len))
15624 if eval $compile_ok; then
15625 if ./try 2>/dev/null; then
15626 echo "Yes, it can."
15629 echo "It can't, sorry."
15632 echo "(I can't compile the test program, so we'll assume not...)"
15636 $rm -f try.* try core
15642 : can memcmp be trusted to compare relative magnitude?
15644 case "$d_memcmp" in
15647 echo "Checking if your memcmp() can compare relative magnitude..." >&4
15649 #$i_memory I_MEMORY
15650 #$i_stdlib I_STDLIB
15651 #$i_string I_STRING
15652 #$i_unistd I_UNISTD
15654 $cat >>try.c <<'EOCP'
15657 # include <memory.h>
15660 # include <stdlib.h>
15663 # include <string.h>
15665 # include <strings.h>
15668 # include <unistd.h> /* Needed for NetBSD */
15674 if ((a < b) && memcmp(&a, &b, 1) < 0)
15680 if eval $compile_ok; then
15681 if $run ./try 2>/dev/null; then
15682 echo "Yes, it can."
15685 echo "No, it can't (it uses signed chars)."
15688 echo "(I can't compile the test program, so we'll assume not...)"
15692 $rm -f try.* try core
15696 : see if prototype for sbrk is available
15698 set d_sbrkproto sbrk $i_unistd unistd.h
15701 : see if select exists
15702 set select d_select
15705 : see if semctl exists
15706 set semctl d_semctl
15709 : see if semget exists
15710 set semget d_semget
15713 : see if semop exists
15717 : see how much of the 'sem*(2)' library is present.
15720 case "$d_semctl$d_semget$d_semop" in
15721 *"$undef"*) h_sem=false;;
15725 case "`ipcs 2>&1`" in
15726 "SVID messages"*"not configured"*)
15727 echo "Your $osname does not have the sem*(2) configured." >&4
15730 set semctl d_semctl
15732 set semget d_semget
15740 : we could also check for sys/ipc.h ...
15741 if $h_sem && $test `./findhdr sys/sem.h`; then
15742 echo "You have the full sem*(2) library." >&4
15745 echo "You don't have the full sem*(2) library." >&4
15751 : see whether sys/sem.h defines union semun
15753 $cat > try.c <<'END'
15754 #include <sys/types.h>
15755 #include <sys/ipc.h>
15756 #include <sys/sem.h>
15757 int main () { union semun semun; semun.buf = 0; }
15760 if eval $compile; then
15761 echo "You have union semun in <sys/sem.h>." >&4
15764 echo "You do not have union semun in <sys/sem.h>." >&4
15771 : see how to do semctl IPC_STAT
15778 # define S_IRUSR S_IREAD
15779 # define S_IWUSR S_IWRITE
15780 # define S_IXUSR S_IEXEC
15782 # define S_IRUSR 0400
15783 # define S_IWUSR 0200
15784 # define S_IXUSR 0100
15786 # define S_IRGRP (S_IRUSR>>3)
15787 # define S_IWGRP (S_IWUSR>>3)
15788 # define S_IXGRP (S_IXUSR>>3)
15789 # define S_IROTH (S_IRUSR>>6)
15790 # define S_IWOTH (S_IWUSR>>6)
15791 # define S_IXOTH (S_IXUSR>>6)
15794 # define S_IRWXU (S_IRUSR|S_IWUSR|S_IXUSR)
15795 # define S_IRWXG (S_IRGRP|S_IWGRP|S_IXGRP)
15796 # define S_IRWXO (S_IROTH|S_IWOTH|S_IXOTH)
15799 : see whether semctl IPC_STAT can use union semun
15800 case "$d_semctl_semun" in
15804 #include <sys/types.h>
15805 #include <sys/ipc.h>
15806 #include <sys/sem.h>
15807 #include <sys/stat.h>
15814 #$d_union_semun HAS_UNION_SEMUN
15817 #ifndef HAS_UNION_SEMUN
15820 struct semid_ds *buf;
15821 unsigned short *array;
15827 #if defined(IPC_PRIVATE) && defined(S_IRWXU) && defined(S_IRWXG) && defined(S_IRWXO) && defined(IPC_CREAT)
15828 sem = semget(IPC_PRIVATE, 1, S_IRWXU|S_IRWXG|S_IRWXO|IPC_CREAT);
15830 struct semid_ds argbuf;
15833 st = semctl(sem, 0, IPC_STAT, arg);
15837 # endif /* IPC_STAT */
15838 printf("semctl IPC_STAT failed: errno = %d\n", errno);
15840 if (semctl(sem, 0, IPC_RMID, arg) != 0)
15841 # endif /* IPC_RMID */
15842 printf("semctl IPC_RMID failed: errno = %d\n", errno);
15844 #endif /* IPC_PRIVATE && ... */
15845 printf("semget failed: errno = %d\n", errno);
15850 if eval $compile; then
15853 semun) val="$define" ;;
15861 case "$d_semctl_semun" in
15863 echo "You can use union semun for semctl IPC_STAT." >&4
15866 *) echo "You cannot use union semun for semctl IPC_STAT." >&4
15871 : see whether semctl IPC_STAT can use struct semid_ds pointer
15872 case "$d_semctl_semid_ds" in
15875 $cat > try.c <<'END'
15876 #include <sys/types.h>
15877 #include <sys/ipc.h>
15878 #include <sys/sem.h>
15879 #include <sys/stat.h>
15887 struct semid_ds arg;
15890 #if defined(IPC_PRIVATE) && defined(S_IRWXU) && defined(S_IRWXG) && defined(S_IRWXO) && defined(IPC_CREAT)
15891 sem = semget(IPC_PRIVATE, 1, S_IRWXU|S_IRWXG|S_IRWXO|IPC_CREAT);
15894 st = semctl(sem, 0, IPC_STAT, &arg);
15896 printf("semid_ds\n");
15898 # endif /* IPC_STAT */
15899 printf("semctl IPC_STAT failed: errno = %d\n", errno);
15901 if (semctl(sem, 0, IPC_RMID, &arg) != 0)
15902 # endif /* IPC_RMID */
15903 printf("semctl IPC_RMID failed: errno = %d\n", errno);
15905 #endif /* IPC_PRIVATE && ... */
15906 printf("semget failed: errno = %d\n", errno);
15912 if eval $compile; then
15915 semid_ds) val="$define" ;;
15919 set d_semctl_semid_ds
15923 case "$d_semctl_semid_ds" in
15925 echo "You can $also use struct semid_ds* for semctl IPC_STAT." >&4
15927 *) echo "You cannot use struct semid_ds* for semctl IPC_STAT." >&4
15934 # We do not have the full sem*(2) library, so assume we can not
15940 set d_semctl_semid_ds
15945 : see if sendmsg exists
15946 set sendmsg d_sendmsg
15949 : see if setegid exists
15950 set setegid d_setegid
15953 : see if seteuid exists
15954 set seteuid d_seteuid
15957 : see if setgrent exists
15958 set setgrent d_setgrent
15961 : see if setgrent_r exists
15962 set setgrent_r d_setgrent_r
15964 case "$d_setgrent_r" in
15966 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
15967 case "$d_setgrent_r_proto:$usethreads" in
15968 ":define") d_setgrent_r_proto=define
15969 set d_setgrent_r_proto setgrent_r $hdrs
15973 case "$d_setgrent_r_proto" in
15975 case "$setgrent_r_proto" in
15976 ''|0) try='int setgrent_r(FILE**);'
15977 ./protochk "extern $try" $hdrs && setgrent_r_proto=I_H ;;
15979 case "$setgrent_r_proto" in
15980 ''|0) try='void setgrent_r(FILE**);'
15981 ./protochk "extern $try" $hdrs && setgrent_r_proto=V_H ;;
15983 case "$setgrent_r_proto" in
15984 ''|0) d_setgrent_r=undef
15986 echo "Disabling setgrent_r, cannot determine prototype." >&4 ;;
15987 * ) case "$setgrent_r_proto" in
15988 REENTRANT_PROTO*) ;;
15989 *) setgrent_r_proto="REENTRANT_PROTO_$setgrent_r_proto" ;;
15991 echo "Prototype: $try" ;;
15994 *) case "$usethreads" in
15995 define) echo "setgrent_r has no prototype, not using it." >&4 ;;
16002 *) setgrent_r_proto=0
16006 : see if sethostent exists
16007 set sethostent d_sethent
16010 : see if sethostent_r exists
16011 set sethostent_r d_sethostent_r
16013 case "$d_sethostent_r" in
16015 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
16016 case "$d_sethostent_r_proto:$usethreads" in
16017 ":define") d_sethostent_r_proto=define
16018 set d_sethostent_r_proto sethostent_r $hdrs
16022 case "$d_sethostent_r_proto" in
16024 case "$sethostent_r_proto" in
16025 ''|0) try='int sethostent_r(int, struct hostent_data*);'
16026 ./protochk "extern $try" $hdrs && sethostent_r_proto=I_ID ;;
16028 case "$sethostent_r_proto" in
16029 ''|0) try='void sethostent_r(int, struct hostent_data*);'
16030 ./protochk "extern $try" $hdrs && sethostent_r_proto=V_ID ;;
16032 case "$sethostent_r_proto" in
16033 ''|0) d_sethostent_r=undef
16034 sethostent_r_proto=0
16035 echo "Disabling sethostent_r, cannot determine prototype." >&4 ;;
16036 * ) case "$sethostent_r_proto" in
16037 REENTRANT_PROTO*) ;;
16038 *) sethostent_r_proto="REENTRANT_PROTO_$sethostent_r_proto" ;;
16040 echo "Prototype: $try" ;;
16043 *) case "$usethreads" in
16044 define) echo "sethostent_r has no prototype, not using it." >&4 ;;
16046 d_sethostent_r=undef
16047 sethostent_r_proto=0
16051 *) sethostent_r_proto=0
16055 : see if setitimer exists
16056 set setitimer d_setitimer
16059 : see if setlinebuf exists
16060 set setlinebuf d_setlinebuf
16063 : see if setlocale exists
16064 set setlocale d_setlocale
16067 : see if locale.h is available
16068 set locale.h i_locale
16071 : see if setlocale_r exists
16072 set setlocale_r d_setlocale_r
16074 case "$d_setlocale_r" in
16076 hdrs="$i_systypes sys/types.h define stdio.h $i_locale locale.h"
16077 case "$d_setlocale_r_proto:$usethreads" in
16078 ":define") d_setlocale_r_proto=define
16079 set d_setlocale_r_proto setlocale_r $hdrs
16083 case "$d_setlocale_r_proto" in
16085 case "$setlocale_r_proto" in
16086 ''|0) try='int setlocale_r(int, const char*, char*, int);'
16087 ./protochk "extern $try" $hdrs && setlocale_r_proto=I_ICBI ;;
16089 case "$setlocale_r_proto" in
16090 ''|0) d_setlocale_r=undef
16091 setlocale_r_proto=0
16092 echo "Disabling setlocale_r, cannot determine prototype." >&4 ;;
16093 * ) case "$setlocale_r_proto" in
16094 REENTRANT_PROTO*) ;;
16095 *) setlocale_r_proto="REENTRANT_PROTO_$setlocale_r_proto" ;;
16097 echo "Prototype: $try" ;;
16100 *) case "$usethreads" in
16101 define) echo "setlocale_r has no prototype, not using it." >&4 ;;
16103 d_setlocale_r=undef
16104 setlocale_r_proto=0
16108 *) setlocale_r_proto=0
16112 : see if setnetent exists
16113 set setnetent d_setnent
16116 : see if setnetent_r exists
16117 set setnetent_r d_setnetent_r
16119 case "$d_setnetent_r" in
16121 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
16122 case "$d_setnetent_r_proto:$usethreads" in
16123 ":define") d_setnetent_r_proto=define
16124 set d_setnetent_r_proto setnetent_r $hdrs
16128 case "$d_setnetent_r_proto" in
16130 case "$setnetent_r_proto" in
16131 ''|0) try='int setnetent_r(int, struct netent_data*);'
16132 ./protochk "extern $try" $hdrs && setnetent_r_proto=I_ID ;;
16134 case "$setnetent_r_proto" in
16135 ''|0) try='void setnetent_r(int, struct netent_data*);'
16136 ./protochk "extern $try" $hdrs && setnetent_r_proto=V_ID ;;
16138 case "$setnetent_r_proto" in
16139 ''|0) d_setnetent_r=undef
16140 setnetent_r_proto=0
16141 echo "Disabling setnetent_r, cannot determine prototype." >&4 ;;
16142 * ) case "$setnetent_r_proto" in
16143 REENTRANT_PROTO*) ;;
16144 *) setnetent_r_proto="REENTRANT_PROTO_$setnetent_r_proto" ;;
16146 echo "Prototype: $try" ;;
16149 *) case "$usethreads" in
16150 define) echo "setnetent_r has no prototype, not using it." >&4 ;;
16152 d_setnetent_r=undef
16153 setnetent_r_proto=0
16157 *) setnetent_r_proto=0
16161 : see if setprotoent exists
16162 set setprotoent d_setpent
16165 : see if setpgid exists
16166 set setpgid d_setpgid
16169 : see if setpgrp2 exists
16170 set setpgrp2 d_setpgrp2
16173 : see if setpriority exists
16174 set setpriority d_setprior
16177 : see if setproctitle exists
16178 set setproctitle d_setproctitle
16181 : see if setprotoent_r exists
16182 set setprotoent_r d_setprotoent_r
16184 case "$d_setprotoent_r" in
16186 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
16187 case "$d_setprotoent_r_proto:$usethreads" in
16188 ":define") d_setprotoent_r_proto=define
16189 set d_setprotoent_r_proto setprotoent_r $hdrs
16193 case "$d_setprotoent_r_proto" in
16195 case "$setprotoent_r_proto" in
16196 ''|0) try='int setprotoent_r(int, struct protoent_data*);'
16197 ./protochk "extern $try" $hdrs && setprotoent_r_proto=I_ID ;;
16199 case "$setprotoent_r_proto" in
16200 ''|0) try='void setprotoent_r(int, struct protoent_data*);'
16201 ./protochk "extern $try" $hdrs && setprotoent_r_proto=V_ID ;;
16203 case "$setprotoent_r_proto" in
16204 ''|0) d_setprotoent_r=undef
16205 setprotoent_r_proto=0
16206 echo "Disabling setprotoent_r, cannot determine prototype." >&4 ;;
16207 * ) case "$setprotoent_r_proto" in
16208 REENTRANT_PROTO*) ;;
16209 *) setprotoent_r_proto="REENTRANT_PROTO_$setprotoent_r_proto" ;;
16211 echo "Prototype: $try" ;;
16214 *) case "$usethreads" in
16215 define) echo "setprotoent_r has no prototype, not using it." >&4 ;;
16217 d_setprotoent_r=undef
16218 setprotoent_r_proto=0
16222 *) setprotoent_r_proto=0
16226 : see if setpwent exists
16227 set setpwent d_setpwent
16230 : see if setpwent_r exists
16231 set setpwent_r d_setpwent_r
16233 case "$d_setpwent_r" in
16235 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
16236 case "$d_setpwent_r_proto:$usethreads" in
16237 ":define") d_setpwent_r_proto=define
16238 set d_setpwent_r_proto setpwent_r $hdrs
16242 case "$d_setpwent_r_proto" in
16244 case "$setpwent_r_proto" in
16245 ''|0) try='int setpwent_r(FILE**);'
16246 ./protochk "extern $try" $hdrs && setpwent_r_proto=I_H ;;
16248 case "$setpwent_r_proto" in
16249 ''|0) try='void setpwent_r(FILE**);'
16250 ./protochk "extern $try" $hdrs && setpwent_r_proto=V_H ;;
16252 case "$setpwent_r_proto" in
16253 ''|0) d_setpwent_r=undef
16255 echo "Disabling setpwent_r, cannot determine prototype." >&4 ;;
16256 * ) case "$setpwent_r_proto" in
16257 REENTRANT_PROTO*) ;;
16258 *) setpwent_r_proto="REENTRANT_PROTO_$setpwent_r_proto" ;;
16260 echo "Prototype: $try" ;;
16263 *) case "$usethreads" in
16264 define) echo "setpwent_r has no prototype, not using it." >&4 ;;
16271 *) setpwent_r_proto=0
16275 : see if setregid exists
16276 set setregid d_setregid
16278 set setresgid d_setresgid
16281 : see if setreuid exists
16282 set setreuid d_setreuid
16284 set setresuid d_setresuid
16287 : see if setrgid exists
16288 set setrgid d_setrgid
16291 : see if setruid exists
16292 set setruid d_setruid
16295 : see if setservent exists
16296 set setservent d_setsent
16299 : see if setservent_r exists
16300 set setservent_r d_setservent_r
16302 case "$d_setservent_r" in
16304 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
16305 case "$d_setservent_r_proto:$usethreads" in
16306 ":define") d_setservent_r_proto=define
16307 set d_setservent_r_proto setservent_r $hdrs
16311 case "$d_setservent_r_proto" in
16313 case "$setservent_r_proto" in
16314 ''|0) try='int setservent_r(int, struct servent_data*);'
16315 ./protochk "extern $try" $hdrs && setservent_r_proto=I_ID ;;
16317 case "$setservent_r_proto" in
16318 ''|0) try='void setservent_r(int, struct servent_data*);'
16319 ./protochk "extern $try" $hdrs && setservent_r_proto=V_ID ;;
16321 case "$setservent_r_proto" in
16322 ''|0) d_setservent_r=undef
16323 setservent_r_proto=0
16324 echo "Disabling setservent_r, cannot determine prototype." >&4 ;;
16325 * ) case "$setservent_r_proto" in
16326 REENTRANT_PROTO*) ;;
16327 *) setservent_r_proto="REENTRANT_PROTO_$setservent_r_proto" ;;
16329 echo "Prototype: $try" ;;
16332 *) case "$usethreads" in
16333 define) echo "setservent_r has no prototype, not using it." >&4 ;;
16335 d_setservent_r=undef
16336 setservent_r_proto=0
16340 *) setservent_r_proto=0
16344 : see if setsid exists
16345 set setsid d_setsid
16348 : see if setvbuf exists
16349 set setvbuf d_setvbuf
16352 : see if sfio.h is available
16357 : see if sfio library is available
16368 : Ok, but do we want to use it.
16372 true|$define|[yY]*) dflt='y';;
16375 echo "$package can use the sfio library, but it is experimental."
16376 case "$useperlio" in
16378 echo "For sfio also the PerlIO abstraction layer is needed."
16379 echo "Earlier you said you wouldn't want that."
16382 rp="You seem to have sfio available, do you want to try using it?"
16385 y|Y) echo "Ok, turning on both sfio and PerlIO, then."
16386 useperlio="$define"
16389 *) echo "Ok, avoiding sfio this time. I'll use stdio instead."
16394 *) case "$usesfio" in
16395 true|$define|[yY]*)
16396 echo "Sorry, cannot find sfio on this machine." >&4
16397 echo "Ignoring your setting of usesfio=$usesfio." >&4
16406 $define) usesfio='true';;
16407 *) usesfio='false';;
16411 *) : Remove sfio from list of libraries to use
16414 echo "Removing unneeded -lsfio from library list" >&4
16415 set `echo X $libs | $sed -e 's/-lsfio / /' -e 's/-lsfio$//'`
16418 echo "libs = $libs" >&4
16425 : see if shmctl exists
16426 set shmctl d_shmctl
16429 : see if shmget exists
16430 set shmget d_shmget
16433 : see if shmat exists
16436 : see what shmat returns
16439 $cat >shmat.c <<'END'
16440 #include <sys/shm.h>
16443 if $cc $ccflags -c shmat.c >/dev/null 2>&1; then
16448 echo "and it returns ($shmattype)." >&4
16449 : see if a prototype for shmat is available
16450 xxx=`./findhdr sys/shm.h`
16451 $cppstdin $cppflags $cppminus < $xxx > shmat.c 2>/dev/null
16452 if $contains 'shmat.*(' shmat.c >/dev/null 2>&1; then
16463 set d_shmatprototype
16466 : see if shmdt exists
16470 : see how much of the 'shm*(2)' library is present.
16473 case "$d_shmctl$d_shmget$d_shmat$d_shmdt" in
16474 *"$undef"*) h_shm=false;;
16478 case "`ipcs 2>&1`" in
16479 "SVID shared memory"*"not configured"*)
16480 echo "Your $osname does not have the shm*(2) configured." >&4
16483 set shmctl d_shmctl
16485 set shmget d_shmget
16495 : we could also check for sys/ipc.h ...
16496 if $h_shm && $test `./findhdr sys/shm.h`; then
16497 echo "You have the full shm*(2) library." >&4
16500 echo "You don't have the full shm*(2) library." >&4
16507 : see if we have sigaction
16508 if set sigaction val -f d_sigaction; eval $csym; $val; then
16509 echo 'sigaction() found.' >&4
16512 #include <sys/types.h>
16513 #include <signal.h>
16514 #$i_stdlib I_STDLIB
16516 #include <stdlib.h>
16520 struct sigaction act, oact;
16522 oact.sa_handler = 0;
16523 /* so that act and oact are used */
16524 exit(act.sa_flags == 0 && oact.sa_handler == 0);
16528 if eval $compile_ok; then
16531 echo "But you don't seem to have a useable struct sigaction." >&4
16535 echo 'sigaction NOT found.' >&4
16538 set d_sigaction; eval $setvar
16539 $rm -f try try$_o try.c
16541 : see if sigprocmask exists
16542 set sigprocmask d_sigprocmask
16545 : see if sigsetjmp exists
16547 case "$d_sigsetjmp" in
16550 #include <setjmp.h>
16551 #$i_stdlib I_STDLIB
16553 #include <stdlib.h>
16559 if (sigsetjmp(env,1))
16562 siglongjmp(env, 1);
16567 if eval $compile; then
16568 if $run ./try >/dev/null 2>&1; then
16569 echo "POSIX sigsetjmp found." >&4
16573 Uh-Oh! You have POSIX sigsetjmp and siglongjmp, but they do not work properly!!
16579 echo "sigsetjmp not found." >&4
16583 *) val="$d_sigsetjmp"
16584 case "$d_sigsetjmp" in
16585 $define) echo "POSIX sigsetjmp found." >&4;;
16586 $undef) echo "sigsetjmp not found." >&4;;
16594 : see if snprintf exists
16595 set snprintf d_snprintf
16598 : see if vsnprintf exists
16599 set vsnprintf d_vsnprintf
16602 case "$d_snprintf-$d_vsnprintf" in
16605 Checking whether your snprintf() and vsnprintf() work okay...
16607 $cat >try.c <<'EOCP'
16608 /* v?snprintf testing logic courtesy of Russ Allbery.
16609 * According to C99:
16610 * - if the buffer is too short it still must be \0-terminated
16611 * - if the buffer is too short the potentially required length
16612 * must be returned and not -1
16613 * - if the buffer is NULL the potentially required length
16614 * must be returned and not -1 or core dump
16617 #include <stdarg.h>
16621 int test (char *format, ...)
16626 va_start (args, format);
16627 count = vsnprintf (buf, sizeof buf, format, args);
16634 return ((test ("%s", "abcd") == 4 && buf[0] == 'a' && buf[1] == '\0'
16635 && snprintf (NULL, 0, "%s", "abcd") == 4) ? 0 : 1);
16639 if eval $compile; then
16642 0) echo "Your snprintf() and vsnprintf() seem to be working okay." ;;
16644 Your snprintf() and snprintf() don't seem to be working okay.
16646 d_snprintf="$undef"
16647 d_vsnprintf="$undef"
16651 echo "(I can't seem to compile the test program--assuming they don't)"
16652 d_snprintf="$undef"
16653 d_vsnprintf="$undef"
16655 $rm -f try.* try core core.try.*
16659 : see if sockatmark exists
16660 set sockatmark d_sockatmark
16663 : see if prototype for sockatmark is available
16665 set d_sockatmarkproto sockatmark $d_socket sys/socket.h
16668 : see if socks5_init exists
16669 set socks5_init d_socks5_init
16672 : see if sprintf returns the length of the string in the buffer as per ANSI
16673 $echo "Checking whether sprintf returns the length of the string..." >&4
16676 #$i_stdlib I_STDLIB
16678 #include <stdlib.h>
16680 #$i_string I_STRING
16682 # include <string.h>
16684 # include <strings.h>
16693 int check (size_t expect, int test) {
16694 size_t got = strlen(buffer);
16698 printf("expected %ld, got %ld in test %d '%s'\n", (long) expect, (long) got,
16703 int main(int argc, char **argv) {
16706 check(sprintf(buffer, ""), ++test);
16707 check(sprintf(buffer, "%s %s", "perl", "rules"), ++test);
16708 check(sprintf(buffer, "I like %g", atan2(0,-1)), ++test);
16715 d_sprintf_returns_strlen="$undef"
16716 if eval $compile; then
16720 sprintf returns the length of the string (as ANSI says it should)
16722 d_sprintf_returns_strlen="$define"
16725 sprintf does not return the length of the string (how old is this system?)
16727 d_sprintf_returns_strlen="$undef"
16734 : see if srand48_r exists
16735 set srand48_r d_srand48_r
16737 case "$d_srand48_r" in
16739 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
16740 case "$d_srand48_r_proto:$usethreads" in
16741 ":define") d_srand48_r_proto=define
16742 set d_srand48_r_proto srand48_r $hdrs
16746 case "$d_srand48_r_proto" in
16748 case "$srand48_r_proto" in
16749 ''|0) try='int srand48_r(long, struct drand48_data*);'
16750 ./protochk "extern $try" $hdrs && srand48_r_proto=I_LS ;;
16752 case "$srand48_r_proto" in
16753 ''|0) d_srand48_r=undef
16755 echo "Disabling srand48_r, cannot determine prototype." >&4 ;;
16756 * ) case "$srand48_r_proto" in
16757 REENTRANT_PROTO*) ;;
16758 *) srand48_r_proto="REENTRANT_PROTO_$srand48_r_proto" ;;
16760 echo "Prototype: $try" ;;
16763 *) case "$usethreads" in
16764 define) echo "srand48_r has no prototype, not using it." >&4 ;;
16771 *) srand48_r_proto=0
16775 : see if srandom_r exists
16776 set srandom_r d_srandom_r
16778 case "$d_srandom_r" in
16780 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
16781 case "$d_srandom_r_proto:$usethreads" in
16782 ":define") d_srandom_r_proto=define
16783 set d_srandom_r_proto srandom_r $hdrs
16787 case "$d_srandom_r_proto" in
16789 case "$srandom_r_proto" in
16790 ''|0) try='int srandom_r(unsigned int, struct random_data*);'
16791 ./protochk "extern $try" $hdrs && srandom_r_proto=I_TS ;;
16793 case "$srandom_r_proto" in
16794 ''|0) d_srandom_r=undef
16796 echo "Disabling srandom_r, cannot determine prototype." >&4 ;;
16797 * ) case "$srandom_r_proto" in
16798 REENTRANT_PROTO*) ;;
16799 *) srandom_r_proto="REENTRANT_PROTO_$srandom_r_proto" ;;
16801 echo "Prototype: $try" ;;
16804 *) case "$usethreads" in
16805 define) echo "srandom_r has no prototype, not using it." >&4 ;;
16812 *) srandom_r_proto=0
16816 : see if prototype for setresgid is available
16818 set d_sresgproto setresgid $i_unistd unistd.h
16821 : see if prototype for setresuid is available
16823 set d_sresuproto setresuid $i_unistd unistd.h
16826 : see if sys/stat.h is available
16827 set sys/stat.h i_sysstat
16831 : see if stat knows about block sizes
16833 echo "Checking to see if your struct stat has st_blocks field..." >&4
16834 set d_statblks stat st_blocks $i_sysstat sys/stat.h
16838 : see if this is a sys/vfs.h system
16839 set sys/vfs.h i_sysvfs
16843 : see if this is a sys/statfs.h system
16844 set sys/statfs.h i_sysstatfs
16849 echo "Checking to see if your system supports struct statfs..." >&4
16850 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
16852 case "$d_statfs_s" in
16853 "$define") echo "Yes, it does." ;;
16854 *) echo "No, it doesn't." ;;
16859 : see if struct statfs knows about f_flags
16860 case "$d_statfs_s" in
16863 echo "Checking to see if your struct statfs has f_flags field..." >&4
16864 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
16868 set d_statfs_f_flags
16872 case "$d_statfs_f_flags" in
16873 "$define") echo "Yes, it does." ;;
16874 *) echo "No, it doesn't." ;;
16878 Checking how to access stdio streams by file descriptor number...
16880 case "$stdio_stream_array" in
16881 '') $cat >try.c <<EOCP
16884 if (&STDIO_STREAM_ARRAY[fileno(stdin)] == stdin)
16888 for s in _iob __iob __sF
16890 set try -DSTDIO_STREAM_ARRAY=$s
16891 if eval $compile; then
16892 case "`$run ./try`" in
16893 yes) stdio_stream_array=$s; break ;;
16897 $rm -f try.* try$exe_ext
16899 case "$stdio_stream_array" in
16901 I can't figure out how to access stdio streams by file descriptor number.
16903 d_stdio_stream_array="$undef"
16906 You can access stdio streams by file descriptor number by the $stdio_stream_array array.
16908 d_stdio_stream_array="$define"
16912 : see if strcoll exists
16913 set strcoll d_strcoll
16916 : check for structure copying
16918 echo "Checking to see if your C compiler can copy structs..." >&4
16919 $cat >try.c <<'EOCP'
16929 if $cc -c try.c >/dev/null 2>&1 ; then
16931 echo "Yup, it can."
16934 echo "Nope, it can't."
16940 : see if strerror and/or sys_errlist[] exist
16942 if test "X$d_strerror" = X -o "X$d_syserrlst" = X; then
16943 if set strerror val -f d_strerror; eval $csym; $val; then
16944 echo 'strerror() found.' >&4
16945 d_strerror="$define"
16946 d_strerrm='strerror(e)'
16947 if set sys_errlist val -a d_syserrlst; eval $csym; $val; then
16948 echo "(You also have sys_errlist[], so we could roll our own strerror.)"
16949 d_syserrlst="$define"
16951 echo "(Since you don't have sys_errlist[], sterror() is welcome.)"
16952 d_syserrlst="$undef"
16954 elif xxx=`./findhdr string.h`; test "$xxx" || xxx=`./findhdr strings.h`; \
16955 $contains '#[ ]*define.*strerror' "$xxx" >/dev/null 2>&1; then
16956 echo 'strerror() found in string header.' >&4
16957 d_strerror="$define"
16958 d_strerrm='strerror(e)'
16959 if set sys_errlist val -a d_syserrlst; eval $csym; $val; then
16960 echo "(Most probably, strerror() uses sys_errlist[] for descriptions.)"
16961 d_syserrlst="$define"
16963 echo "(You don't appear to have any sys_errlist[], how can this be?)"
16964 d_syserrlst="$undef"
16966 elif set sys_errlist val -a d_syserrlst; eval $csym; $val; then
16967 echo "strerror() not found, but you have sys_errlist[] so we'll use that." >&4
16968 d_strerror="$undef"
16969 d_syserrlst="$define"
16970 d_strerrm='((e)<0||(e)>=sys_nerr?"unknown":sys_errlist[e])'
16972 echo 'strerror() and sys_errlist[] NOT found.' >&4
16973 d_strerror="$undef"
16974 d_syserrlst="$undef"
16975 d_strerrm='"unknown"'
16979 : see if strerror_r exists
16980 set strerror_r d_strerror_r
16982 case "$d_strerror_r" in
16984 hdrs="$i_systypes sys/types.h define stdio.h $i_string string.h"
16985 case "$d_strerror_r_proto:$usethreads" in
16986 ":define") d_strerror_r_proto=define
16987 set d_strerror_r_proto strerror_r $hdrs
16991 case "$d_strerror_r_proto" in
16993 case "$strerror_r_proto" in
16994 ''|0) try='int strerror_r(int, char*, size_t);'
16995 ./protochk "extern $try" $hdrs && strerror_r_proto=I_IBW ;;
16997 case "$strerror_r_proto" in
16998 ''|0) try='int strerror_r(int, char*, int);'
16999 ./protochk "extern $try" $hdrs && strerror_r_proto=I_IBI ;;
17001 case "$strerror_r_proto" in
17002 ''|0) try='char* strerror_r(int, char*, size_t);'
17003 ./protochk "extern $try" $hdrs && strerror_r_proto=B_IBW ;;
17005 case "$strerror_r_proto" in
17006 ''|0) d_strerror_r=undef
17008 echo "Disabling strerror_r, cannot determine prototype." >&4 ;;
17009 * ) case "$strerror_r_proto" in
17010 REENTRANT_PROTO*) ;;
17011 *) strerror_r_proto="REENTRANT_PROTO_$strerror_r_proto" ;;
17013 echo "Prototype: $try" ;;
17016 *) case "$usethreads" in
17017 define) echo "strerror_r has no prototype, not using it." >&4 ;;
17024 *) strerror_r_proto=0
17028 : see if strftime exists
17029 set strftime d_strftime
17032 : see if strlcat exists
17033 set strlcat d_strlcat
17036 : see if strlcpy exists
17037 set strlcpy d_strlcpy
17040 : see if strtod exists
17041 set strtod d_strtod
17044 : see if strtol exists
17045 set strtol d_strtol
17048 : see if strtold exists
17049 set strtold d_strtold
17052 : see if strtoll exists
17053 set strtoll d_strtoll
17056 case "$d_longlong-$d_strtoll" in
17059 Checking whether your strtoll() works okay...
17061 $cat >try.c <<'EOCP'
17064 #define strtoll __strtoll
17067 #define strtoll _strtoll
17070 extern long long int strtoll(char *s, char **, int);
17071 static int bad = 0;
17072 int check(char *s, long long ell, int een) {
17075 gll = strtoll(s, 0, 10);
17076 if (!((gll == ell) && (errno == een)))
17080 check(" 1", 1LL, 0);
17081 check(" 0", 0LL, 0);
17082 check("-1", -1LL, 0);
17083 check("-9223372036854775808", -9223372036854775808LL, 0);
17084 check("-9223372036854775808", -9223372036854775808LL, 0);
17085 check(" 9223372036854775807", 9223372036854775807LL, 0);
17086 check("-9223372036854775808", -9223372036854775808LL, 0);
17087 check(" 9223372036854775808", 9223372036854775807LL, ERANGE);
17088 check("-9223372036854775809", -9223372036854775808LL, ERANGE);
17094 if eval $compile; then
17097 ok) echo "Your strtoll() seems to be working okay." ;;
17099 Your strtoll() doesn't seem to be working okay.
17105 echo "(I can't seem to compile the test program--assuming it doesn't)"
17111 : see if strtoq exists
17112 set strtoq d_strtoq
17115 : see if strtoul exists
17116 set strtoul d_strtoul
17119 case "$d_strtoul" in
17122 Checking whether your strtoul() works okay...
17124 $cat >try.c <<'EOCP'
17127 extern unsigned long int strtoul(char *s, char **, int);
17128 static int bad = 0;
17129 void check(char *s, unsigned long eul, int een) {
17132 gul = strtoul(s, 0, 10);
17133 if (!((gul == eul) && (errno == een)))
17137 check(" 1", 1L, 0);
17138 check(" 0", 0L, 0);
17140 case "$longsize" in
17142 $cat >>try.c <<'EOCP'
17143 check("18446744073709551615", 18446744073709551615UL, 0);
17144 check("18446744073709551616", 18446744073709551615UL, ERANGE);
17145 #if 0 /* strtoul() for /^-/ strings is undefined. */
17146 check("-1", 18446744073709551615UL, 0);
17147 check("-18446744073709551614", 2, 0);
17148 check("-18446744073709551615", 1, 0);
17149 check("-18446744073709551616", 18446744073709551615UL, ERANGE);
17150 check("-18446744073709551617", 18446744073709551615UL, ERANGE);
17155 $cat >>try.c <<'EOCP'
17156 check("4294967295", 4294967295UL, 0);
17157 check("4294967296", 4294967295UL, ERANGE);
17158 #if 0 /* strtoul() for /^-/ strings is undefined. */
17159 check("-1", 4294967295UL, 0);
17160 check("-4294967294", 2, 0);
17161 check("-4294967295", 1, 0);
17162 check("-4294967296", 4294967295UL, ERANGE);
17163 check("-4294967297", 4294967295UL, ERANGE);
17168 : Should we write these tests to be more portable by sprintf-ing
17169 : ~0 and then manipulating that char string as input for strtol?
17172 $cat >>try.c <<'EOCP'
17179 if eval $compile; then
17180 case "`$run ./try`" in
17181 ok) echo "Your strtoul() seems to be working okay." ;;
17183 Your strtoul() doesn't seem to be working okay.
17192 : see if strtoull exists
17193 set strtoull d_strtoull
17196 case "$d_longlong-$d_strtoull" in
17199 Checking whether your strtoull() works okay...
17201 $cat >try.c <<'EOCP'
17204 #define strtoull __strtoull
17207 extern unsigned long long int strtoull(char *s, char **, int);
17208 static int bad = 0;
17209 int check(char *s, long long eull, int een) {
17212 gull = strtoull(s, 0, 10);
17213 if (!((gull == eull) && (errno == een)))
17217 check(" 1", 1LL, 0);
17218 check(" 0", 0LL, 0);
17219 check("18446744073709551615", 18446744073709551615ULL, 0);
17220 check("18446744073709551616", 18446744073709551615ULL, ERANGE);
17221 #if 0 /* strtoull() for /^-/ strings is undefined. */
17222 check("-1", 18446744073709551615ULL, 0);
17223 check("-18446744073709551614", 2LL, 0);
17224 check("-18446744073709551615", 1LL, 0);
17225 check("-18446744073709551616", 18446744073709551615ULL, ERANGE);
17226 check("-18446744073709551617", 18446744073709551615ULL, ERANGE);
17233 if eval $compile; then
17234 case "`$run ./try`" in
17235 ok) echo "Your strtoull() seems to be working okay." ;;
17237 Your strtoull() doesn't seem to be working okay.
17239 d_strtoull="$undef"
17246 : see if strtouq exists
17247 set strtouq d_strtouq
17250 case "$d_strtouq" in
17253 Checking whether your strtouq() works okay...
17255 $cat >try.c <<'EOCP'
17258 extern unsigned long long int strtouq(char *s, char **, int);
17259 static int bad = 0;
17260 void check(char *s, unsigned long long eull, int een) {
17261 unsigned long long gull;
17263 gull = strtouq(s, 0, 10);
17264 if (!((gull == eull) && (errno == een)))
17268 check(" 1", 1LL, 0);
17269 check(" 0", 0LL, 0);
17270 check("18446744073709551615", 18446744073709551615ULL, 0);
17271 check("18446744073709551616", 18446744073709551615ULL, ERANGE);
17272 #if 0 /* strtouq() for /^-/ strings is undefined. */
17273 check("-1", 18446744073709551615ULL, 0);
17274 check("-18446744073709551614", 2LL, 0);
17275 check("-18446744073709551615", 1LL, 0);
17276 check("-18446744073709551616", 18446744073709551615ULL, ERANGE);
17277 check("-18446744073709551617", 18446744073709551615ULL, ERANGE);
17285 if eval $compile; then
17286 case "`$run ./try`" in
17287 ok) echo "Your strtouq() seems to be working okay." ;;
17289 Your strtouq() doesn't seem to be working okay.
17298 : see if strxfrm exists
17299 set strxfrm d_strxfrm
17302 : see if symlink exists
17303 set symlink d_symlink
17306 : see if syscall exists
17307 set syscall d_syscall
17310 : see if prototype for syscall is available
17312 set d_syscallproto syscall $i_unistd unistd.h
17315 : see if sysconf exists
17316 set sysconf d_sysconf
17319 : see if system exists
17320 set system d_system
17323 : see if tcgetpgrp exists
17324 set tcgetpgrp d_tcgetpgrp
17327 : see if tcsetpgrp exists
17328 set tcsetpgrp d_tcsetpgrp
17331 : see if prototype for telldir is available
17333 set d_telldirproto telldir $i_systypes sys/types.h $i_dirent dirent.h
17336 : see if time exists
17338 if test "X$d_time" = X -o X"$timetype" = X; then
17339 if set time val -f d_time; eval $csym; $val; then
17340 echo 'time() found.' >&4
17342 rp="What is the type returned by time() on this system?"
17343 set time_t timetype long stdio.h sys/types.h
17346 echo 'time() not found, hope that will do.' >&4
17354 : see if this is a sys/times.h system
17355 set sys/times.h i_systimes
17358 : see if times exists
17360 if set times val -f d_times; eval $csym; $val; then
17361 echo 'times() found.' >&4
17364 case "$i_systimes" in
17365 "$define") inc='sys/times.h';;
17367 rp="What is the type returned by times() on this system?"
17368 set clock_t clocktype long stdio.h sys/types.h $inc
17371 echo 'times() NOT found, hope that will do.' >&4
17376 : see if tmpnam_r exists
17377 set tmpnam_r d_tmpnam_r
17379 case "$d_tmpnam_r" in
17381 hdrs="$i_systypes sys/types.h define stdio.h "
17382 case "$d_tmpnam_r_proto:$usethreads" in
17383 ":define") d_tmpnam_r_proto=define
17384 set d_tmpnam_r_proto tmpnam_r $hdrs
17388 case "$d_tmpnam_r_proto" in
17390 case "$tmpnam_r_proto" in
17391 ''|0) try='char* tmpnam_r(char*);'
17392 ./protochk "extern $try" $hdrs && tmpnam_r_proto=B_B ;;
17394 case "$tmpnam_r_proto" in
17395 ''|0) d_tmpnam_r=undef
17397 echo "Disabling tmpnam_r, cannot determine prototype." >&4 ;;
17398 * ) case "$tmpnam_r_proto" in
17399 REENTRANT_PROTO*) ;;
17400 *) tmpnam_r_proto="REENTRANT_PROTO_$tmpnam_r_proto" ;;
17402 echo "Prototype: $try" ;;
17405 *) case "$usethreads" in
17406 define) echo "tmpnam_r has no prototype, not using it." >&4 ;;
17413 *) tmpnam_r_proto=0
17417 : see if truncate exists
17418 set truncate d_truncate
17421 : see if ttyname_r exists
17422 set ttyname_r d_ttyname_r
17424 case "$d_ttyname_r" in
17426 hdrs="$i_systypes sys/types.h define stdio.h $i_unistd unistd.h"
17427 case "$d_ttyname_r_proto:$usethreads" in
17428 ":define") d_ttyname_r_proto=define
17429 set d_ttyname_r_proto ttyname_r $hdrs
17433 case "$d_ttyname_r_proto" in
17435 case "$ttyname_r_proto" in
17436 ''|0) try='int ttyname_r(int, char*, size_t);'
17437 ./protochk "extern $try" $hdrs && ttyname_r_proto=I_IBW ;;
17439 case "$ttyname_r_proto" in
17440 ''|0) try='int ttyname_r(int, char*, int);'
17441 ./protochk "extern $try" $hdrs && ttyname_r_proto=I_IBI ;;
17443 case "$ttyname_r_proto" in
17444 ''|0) try='char* ttyname_r(int, char*, int);'
17445 ./protochk "extern $try" $hdrs && ttyname_r_proto=B_IBI ;;
17447 case "$ttyname_r_proto" in
17448 ''|0) d_ttyname_r=undef
17450 echo "Disabling ttyname_r, cannot determine prototype." >&4 ;;
17451 * ) case "$ttyname_r_proto" in
17452 REENTRANT_PROTO*) ;;
17453 *) ttyname_r_proto="REENTRANT_PROTO_$ttyname_r_proto" ;;
17455 echo "Prototype: $try" ;;
17458 *) case "$usethreads" in
17459 define) echo "ttyname_r has no prototype, not using it." >&4 ;;
17466 *) ttyname_r_proto=0
17470 : see if tzname[] exists
17472 if set tzname val -a d_tzname; eval $csym; $val; then
17474 echo 'tzname[] found.' >&4
17477 echo 'tzname[] NOT found.' >&4
17483 next|rhapsody|darwin) multiarch="$define" ;;
17485 case "$multiarch" in
17486 ''|[nN]*) multiarch="$undef" ;;
17489 : check for ordering of bytes in a UV
17491 case "$usecrosscompile$multiarch" in
17494 You seem to be either cross-compiling or doing a multiarchitecture build,
17495 skipping the byteorder check.
17501 case "$byteorder" in
17504 In the following, larger digits indicate more significance. A big-endian
17505 machine like a Pyramid or a Motorola 680?0 chip will come out to 4321. A
17506 little-endian machine like a Vax or an Intel 80?86 chip would be 1234. Other
17507 machines may have weird orders like 3412. A Cray will report 87654321,
17508 an Alpha will report 12345678. If the test program works the default is
17510 I'm now running the test program...
17514 #$i_stdlib I_STDLIB
17516 #include <stdlib.h>
17518 #include <sys/types.h>
17519 typedef $uvtype UV;
17529 u.l = (((UV)0x08070605) << 32) | (UV)0x04030201;
17531 u.l = (UV)0x04030201;
17532 for (i = 0; i < $uvsize; i++)
17533 printf("%c", u.c[i]+'0');
17540 if eval $compile && ./try > /dev/null; then
17543 [1-4][1-4][1-4][1-4]|12345678|87654321)
17544 echo "(The test program ran ok.)"
17545 echo "byteorder=$dflt"
17548 ????|????????) echo "(The test program ran ok.)" ;;
17549 *) echo "(The test program didn't run right for some reason.)" ;;
17554 (I can't seem to compile the test program. Guessing big-endian...)
17557 case "$xxx_prompt" in
17559 rp="What is the order of bytes in $uvtype?"
17575 Checking to see whether you can access character data unalignedly...
17577 case "$d_u32align" in
17578 '') $cat >try.c <<EOCP
17580 #$i_stdlib I_STDLIB
17582 #include <stdlib.h>
17584 #define U32 $u32type
17585 #define BYTEORDER 0x$byteorder
17587 #include <signal.h>
17589 $signal_t bletch(s) int s; { exit(4); }
17592 #if BYTEORDER == 0x1234 || BYTEORDER == 0x4321
17597 if (sizeof(U32) != 4) {
17598 printf("sizeof(U32) is not 4, but %d\n", sizeof(U32));
17605 signal(SIGBUS, bletch);
17617 for (i = 0; i < 4; i++) {
17618 up = (U32*)(buf + i);
17619 if (! ((*up == 1 << (8*i)) || /* big-endian */
17620 (*up == 1 << (8*(3-i))) /* little-endian */
17624 printf("read failed (%x)\n", *up);
17630 for (i = 0; i < 4; i++) {
17631 up = (U32*)(buf + i);
17633 if (*up != 0xBeef) {
17634 printf("write failed (%x)\n", *up);
17648 if eval $compile_ok; then
17649 echo "(Testing for character data alignment may crash the test. That's okay.)" >&4
17650 $run ./try 2>&1 >/dev/null
17653 You can access character data pretty unalignedly.
17655 d_u32align="$undef"
17658 It seems that you must access character data in an aligned manner.
17660 d_u32align="$define"
17664 rp='Can you access character data at unaligned addresses?'
17668 [yY]*) d_u32align="$undef" ;;
17669 *) d_u32align="$define" ;;
17672 $rm -f core core.try.* try.core
17676 : see if ualarm exists
17677 set ualarm d_ualarm
17680 : see if umask exists
17684 : see if unordered exists
17685 set unordered d_unordered
17688 : see if unsetenv exists
17689 set unsetenv d_unsetenv
17692 : see if usleep exists
17693 set usleep d_usleep
17696 : see if prototype for usleep is available
17698 set d_usleepproto usleep $i_unistd unistd.h
17701 : see if ustat exists
17705 : backward compatibility for d_hvfork
17706 if test X$d_hvfork != X; then
17707 d_vfork="$d_hvfork"
17710 : see if there is a vfork
17715 : Ok, but do we want to use it. vfork is reportedly unreliable in
17716 : perl on Solaris 2.x, and probably elsewhere.
17720 case "$usevfork" in
17726 Perl can only use a vfork() that doesn't suffer from strict
17727 restrictions on calling functions or modifying global data in
17728 the child. For example, glibc-2.1 contains such a vfork()
17729 that is unsuitable. If your system provides a proper fork()
17730 call, chances are that you do NOT want perl to use vfork().
17733 rp="Do you still want to use vfork()?"
17738 echo "Ok, we won't use vfork()."
17747 $define) usevfork='true';;
17748 *) usevfork='false';;
17751 : see if closedir exists
17752 set closedir d_closedir
17755 case "$d_closedir" in
17758 echo "Checking whether closedir() returns a status..." >&4
17760 #$i_dirent I_DIRENT /**/
17761 #$i_sysdir I_SYS_DIR /**/
17762 #$i_sysndir I_SYS_NDIR /**/
17763 #$i_systypes I_SYS_TYPES /**/
17765 #if defined(I_SYS_TYPES)
17766 #include <sys/types.h>
17768 #if defined(I_DIRENT)
17769 #include <dirent.h>
17770 #if defined(NeXT) && defined(I_SYS_DIR) /* NeXT needs dirent + sys/dir.h */
17771 #include <sys/dir.h>
17775 #include <sys/ndir.h>
17779 #include <ndir.h> /* may be wrong in the future */
17781 #include <sys/dir.h>
17786 int main() { return closedir(opendir(".")); }
17789 if eval $compile_ok; then
17790 if $run ./try > /dev/null 2>&1 ; then
17791 echo "Yes, it does."
17794 echo "No, it doesn't."
17798 echo "(I can't seem to compile the test program--assuming it doesn't)"
17806 set d_void_closedir
17809 : see if there is a wait4
17813 : see if waitpid exists
17814 set waitpid d_waitpid
17817 : see if wcstombs exists
17818 set wcstombs d_wcstombs
17821 : see if wctomb exists
17822 set wctomb d_wctomb
17825 : see if writev exists
17826 set writev d_writev
17829 : preserve RCS keywords in files with variable substitution, grrr
17834 Revision='$Revision'
17836 : check for alignment requirements
17838 case "$usecrosscompile$multiarch" in
17841 You seem to be either cross-compiling or doing a multiarchitecture build,
17842 skipping the memory alignment check.
17845 case "$alignbytes" in
17846 '') alignbytes=8 ;;
17850 case "$alignbytes" in
17851 '') echo "Checking alignment constraints..." >&4
17852 if $test "X$uselongdouble" = Xdefine -a "X$d_longdbl" = Xdefine; then
17853 $cat >try.c <<'EOCP'
17854 typedef long double NV;
17857 $cat >try.c <<'EOCP'
17861 $cat >>try.c <<'EOCP'
17869 printf("%d\n", (int)((char *)&try_algn.bar - (char *)&try_algn.foo));
17874 if eval $compile_ok; then
17878 echo "(I can't seem to compile the test program...)"
17881 *) dflt="$alignbytes"
17884 rp="Doubles must be aligned on a how-many-byte boundary?"
17892 : set the base revision
17895 : how do we concatenate cpp tokens here?
17897 echo "Checking to see how your cpp does stuff like concatenate tokens..." >&4
17898 $cat >cpp_stuff.c <<'EOCP'
17899 #define RCAT(a,b)a/**/b
17900 #define ACAT(a,b)a ## b
17904 $cppstdin $cppflags $cppminus <cpp_stuff.c >cpp_stuff.out 2>&1
17905 if $contains 'Circus' cpp_stuff.out >/dev/null 2>&1; then
17906 echo "Oh! Smells like ANSI's been here." >&4
17907 echo "We can catify or stringify, separately or together!"
17909 elif $contains 'Reiser' cpp_stuff.out >/dev/null 2>&1; then
17910 echo "Ah, yes! The good old days!" >&4
17911 echo "However, in the good old days we don't know how to stringify and"
17912 echo "catify at the same time."
17916 Hmm, I don't seem to be able to concatenate tokens with your cpp.
17917 You're going to have to edit the values of CAT[2-5] in config.h...
17919 cpp_stuff="/* Help! How do we handle cpp_stuff? */*/"
17923 : see if this is a db.h system
17929 : Check db version.
17931 echo "Checking Berkeley DB version ..." >&4
17937 #include <sys/types.h>
17939 #$i_stdlib I_STDLIB
17941 #include <stdlib.h>
17944 int main(int argc, char *argv[])
17946 #ifdef DB_VERSION_MAJOR /* DB version >= 2 */
17947 int Major, Minor, Patch ;
17948 unsigned long Version ;
17949 (void)db_version(&Major, &Minor, &Patch) ;
17951 printf("%d %d %d %d %d %d\n",
17952 DB_VERSION_MAJOR, DB_VERSION_MINOR, DB_VERSION_PATCH,
17953 Major, Minor, Patch);
17956 printf("You have Berkeley DB Version 2 or greater.\n");
17958 printf("db.h is from Berkeley DB Version %d.%d.%d\n",
17959 DB_VERSION_MAJOR, DB_VERSION_MINOR, DB_VERSION_PATCH);
17960 printf("libdb is from Berkeley DB Version %d.%d.%d\n",
17961 Major, Minor, Patch) ;
17963 /* check that db.h & libdb are compatible */
17964 if (DB_VERSION_MAJOR != Major || DB_VERSION_MINOR != Minor || DB_VERSION_PATCH != Patch) {
17965 printf("db.h and libdb are incompatible.\n") ;
17969 printf("db.h and libdb are compatible.\n") ;
17971 Version = DB_VERSION_MAJOR * 1000000 + DB_VERSION_MINOR * 1000
17972 + DB_VERSION_PATCH ;
17974 /* needs to be >= 2.3.4 */
17975 if (Version < 2003004) {
17976 /* if (DB_VERSION_MAJOR == 2 && DB_VERSION_MINOR == 0 && DB_VERSION_PATCH < 5) { */
17977 printf("Perl needs Berkeley DB 2.3.4 or greater.\n") ;
17983 #if defined(_DB_H_) && defined(BTREEMAGIC) && defined(HASHMAGIC)
17988 printf("You have Berkeley DB Version 1.\n");
17989 exit(0); /* DB version < 2: the coast is clear. */
17991 exit(1); /* <db.h> not Berkeley DB? */
17997 if eval $compile_ok && $run ./try; then
17998 echo 'Looks OK.' >&4
18000 db_version_major=$1
18001 db_version_minor=$2
18002 db_version_patch=$3
18004 echo "I can't use Berkeley DB with your <db.h>. I'll disable Berkeley DB." >&4
18008 : Remove db from list of libraries to use
18009 echo "Removing unusable -ldb from library list" >&4
18010 set `echo X $libs | $sed -e 's/-ldb / /' -e 's/-ldb$//'`
18013 echo "libs = $libs" >&4
18023 : Check the return type needed for hash
18025 echo "Checking return type needed for hash for Berkeley DB ..." >&4
18031 #include <sys/types.h>
18034 #ifndef DB_VERSION_MAJOR
18035 u_int32_t hash_cb (ptr, size)
18043 info.hash = hash_cb;
18047 if $cc $ccflags -c try.c >try.out 2>&1 ; then
18048 if $contains warning try.out >>/dev/null 2>&1 ; then
18051 db_hashtype='u_int32_t'
18054 : XXX Maybe we should just give up here.
18055 db_hashtype=u_int32_t
18057 echo "Help: I can't seem to compile the db test program." >&4
18058 echo "Something's wrong, but I'll assume you use $db_hashtype." >&4
18061 echo "Your version of Berkeley DB uses $db_hashtype for hash."
18063 *) db_hashtype=u_int32_t
18068 : Check the return type needed for prefix
18070 echo "Checking return type needed for prefix for Berkeley DB ..." >&4
18076 #include <sys/types.h>
18079 #ifndef DB_VERSION_MAJOR
18080 size_t prefix_cb (key1, key2)
18088 info.prefix = prefix_cb;
18092 if $cc $ccflags -c try.c >try.out 2>&1 ; then
18093 if $contains warning try.out >>/dev/null 2>&1 ; then
18094 db_prefixtype='int'
18096 db_prefixtype='size_t'
18099 db_prefixtype='size_t'
18100 : XXX Maybe we should just give up here.
18102 echo "Help: I can't seem to compile the db test program." >&4
18103 echo "Something's wrong, but I'll assume you use $db_prefixtype." >&4
18106 echo "Your version of Berkeley DB uses $db_prefixtype for prefix."
18108 *) db_prefixtype='size_t'
18113 : How can we generate normalized random numbers ?
18115 echo "Looking for a random number function..." >&4
18116 case "$randfunc" in
18118 if set drand48 val -f; eval $csym; $val; then
18120 echo "Good, found drand48()." >&4
18121 elif set random val -f; eval $csym; $val; then
18123 echo "OK, found random()." >&4
18126 echo "Yick, looks like I have to use rand()." >&4
18137 *-Dmy_rand=*|*-Dmy_srand=*)
18138 echo "Removing obsolete -Dmy_rand, -Dmy_srand, and -Drandbits from ccflags." >&4
18139 ccflags="`echo $ccflags | sed -e 's/-Dmy_rand=random/ /'`"
18140 ccflags="`echo $ccflags | sed -e 's/-Dmy_srand=srandom/ /'`"
18141 ccflags="`echo $ccflags | sed -e 's/-Drandbits=[0-9][0-9]*/ /'`"
18145 while $test "$cont"; do
18146 rp="Use which function to generate random numbers?"
18148 if $test "$ans" = "$dflt"; then
18154 if set $ans val -f; eval $csym; $val; then
18158 rp="I cannot find function $ans. Use that name anyway?"
18167 case "$randfunc" in
18169 drand01="drand48()"
18175 case "$randbits" in
18177 echo "Checking to see how many bits your $randfunc() function produces..." >&4
18179 #$i_unistd I_UNISTD
18180 #$i_stdlib I_STDLIB
18183 # include <unistd.h>
18186 # include <stdlib.h>
18191 register unsigned long tmp;
18192 register unsigned long max = 0L;
18194 for (i = 1000; i; i--) {
18195 tmp = (unsigned long) $randfunc();
18196 if (tmp > max) max = tmp;
18198 for (i = 0; max; i++)
18204 if eval $compile_ok; then
18208 echo "(I can't seem to compile the test program...)"
18215 rp="How many bits does your $randfunc() function produce?"
18219 drand01="($randfunc() / (double) ((unsigned long)1 << $randbits))"
18220 seedfunc="s$randfunc"
18221 randseedtype=unsigned
18225 rp="How many bits does your $randfunc() function produce?"
18228 seedfunc="s$randfunc"
18229 drand01="($randfunc() / (double) ((unsigned long)1 << $randbits))"
18230 if set $seedfunc val -f; eval $csym; $val; then
18231 echo "(Using $seedfunc() to seed random generator)"
18233 echo "(Warning: no $seedfunc() to seed random generator)"
18236 randseedtype=unsigned
18244 echo "Determining whether or not we are on an EBCDIC system..." >&4
18245 $cat >try.c <<'EOM'
18248 if ('M'==0xd4) return 0;
18255 if eval $compile_ok; then
18256 if $run ./try; then
18257 echo "You seem to speak EBCDIC." >&4
18260 echo "Nope, no EBCDIC, probably ASCII or some ISO Latin. Or UTF-8." >&4
18263 echo "I'm unable to compile the test program." >&4
18264 echo "I'll assume ASCII or some ISO Latin. Or UTF8." >&4
18272 Checking how to flush all pending stdio output...
18274 # I only know how to find the first 32 possibly open files on SunOS.
18275 # See also hints/sunos_4_1.sh and util.c --AD
18277 sunos) $echo '#define PERL_FFLUSH_ALL_FOPEN_MAX 32' > try.c ;;
18279 $cat >>try.c <<EOCP
18281 #$i_stdlib I_STDLIB
18283 #include <stdlib.h>
18285 #$i_unistd I_UNISTD
18287 # include <unistd.h>
18289 #$d_sysconf HAS_SYSCONF
18290 #$d_stdio_stream_array HAS_STDIO_STREAM_ARRAY
18291 #ifdef HAS_STDIO_STREAM_ARRAY
18292 # define STDIO_STREAM_ARRAY $stdio_stream_array
18297 p = fopen("try.out", "w");
18301 # ifdef TRY_FPRINTF
18305 #ifdef TRY_FFLUSH_NULL
18308 #ifdef TRY_FFLUSH_ALL
18310 long open_max = -1;
18311 # ifdef PERL_FFLUSH_ALL_FOPEN_MAX
18312 open_max = PERL_FFLUSH_ALL_FOPEN_MAX;
18314 # if defined(HAS_SYSCONF) && defined(_SC_OPEN_MAX)
18315 open_max = sysconf(_SC_OPEN_MAX);
18318 open_max = FOPEN_MAX;
18321 open_max = OPEN_MAX;
18330 # ifdef HAS_STDIO_STREAM_ARRAY
18331 if (open_max > 0) {
18333 for (i = 0; i < open_max; i++)
18334 if (STDIO_STREAM_ARRAY[i]._file >= 0 &&
18335 STDIO_STREAM_ARRAY[i]._file < open_max &&
18336 STDIO_STREAM_ARRAY[i]._flag)
18337 fflush(&STDIO_STREAM_ARRAY[i]);
18345 : first we have to find out how _not_ to flush
18347 if $test "X$fflushNULL" = X -o "X$fflushall" = X; then
18349 set try -DTRY_FPUTC
18350 if eval $compile; then
18351 $run ./try 2>/dev/null
18354 if $test ! -s try.out -a "X$code" = X42; then
18360 set try -DTRY_FPRINTF
18361 if eval $compile; then
18362 $run ./try 2>/dev/null
18365 if $test ! -s try.out -a "X$code" = X42; then
18366 output=-DTRY_FPRINTF
18372 : check for fflush NULL behaviour
18373 case "$fflushNULL" in
18374 '') set try -DTRY_FFLUSH_NULL $output
18375 if eval $compile; then
18376 $run ./try 2>/dev/null
18379 if $test -s try.out -a "X$code" = X42; then
18380 fflushNULL="`$cat try.out`"
18382 if $test "X$code" != X42; then
18384 (If this test failed, don't worry, we'll try another method shortly.)
18389 $rm -f core try.core core.try.*
18390 case "$fflushNULL" in
18392 Your fflush(NULL) works okay for output streams.
18393 Let's see if it clobbers input pipes...
18395 # As of mid-March 2000 all versions of Solaris appear to have a stdio
18396 # bug that improperly flushes the input end of pipes. So we avoid the
18397 # autoflush on fork/system/exec support for now. :-(
18398 $cat >tryp.c <<EOCP
18401 main(int argc, char **argv)
18407 while ((i = getc(stdin)) != -1
18408 && (*bp++ = i) != '\n'
18409 && bp < &buf[1024])
18412 fprintf(stdout, "%s", buf);
18420 fflushNULL="$define"
18422 if eval $compile; then
18424 $cat tryp.c | $run ./tryp 2>/dev/null > tryp.out
18425 if cmp tryp.c tryp.out >/dev/null 2>&1; then
18427 fflush(NULL) seems to behave okay with input streams.
18429 fflushNULL="$define"
18432 Ouch, fflush(NULL) clobbers input pipes! We will not use it.
18434 fflushNULL="$undef"
18437 $rm -f core tryp.c tryp.core core.tryp.*
18440 Your fflush(NULL) isn't working (contrary to ANSI C).
18442 fflushNULL="$undef"
18445 Cannot figure out whether your fflush(NULL) works or not.
18446 I'm assuming it doesn't (contrary to ANSI C).
18448 fflushNULL="$undef"
18452 $define|true|[yY]*)
18453 fflushNULL="$define"
18456 fflushNULL="$undef"
18459 : check explicit looping only if NULL did not work, and if the pipe
18460 : bug does not show up on an explicit flush too
18461 case "$fflushNULL" in
18463 $cat >tryp.c <<EOCP
18466 main(int argc, char **argv)
18472 while ((i = getc(stdin)) != -1
18473 && (*bp++ = i) != '\n'
18474 && bp < &buf[1024])
18477 fprintf(stdout, "%s", buf);
18486 if eval $compile; then
18488 $cat tryp.c | $run ./tryp 2>/dev/null > tryp.out
18489 if cmp tryp.c tryp.out >/dev/null 2>&1; then
18491 Good, at least fflush(stdin) seems to behave okay when stdin is a pipe.
18493 : now check for fflushall behaviour
18494 case "$fflushall" in
18495 '') set try -DTRY_FFLUSH_ALL $output
18496 if eval $compile; then
18498 (Now testing the other method--but note that this also may fail.)
18500 $run ./try 2>/dev/null
18503 if $test -s try.out -a "X$code" = X42; then
18504 fflushall="`$cat try.out`"
18507 $rm -f core try.core core.try.*
18508 case "$fflushall" in
18510 Whew. Flushing explicitly all the stdio streams works.
18512 fflushall="$define"
18515 Sigh. Flushing explicitly all the stdio streams doesn't work.
18520 Cannot figure out whether flushing stdio streams explicitly works or not.
18521 I'm assuming it doesn't.
18527 "$define"|true|[yY]*)
18528 fflushall="$define"
18536 All is futile. Even fflush(stdin) clobbers input pipes!
18543 $rm -f core tryp.c tryp.core core.tryp.*
18545 *) fflushall="$undef"
18549 case "$fflushNULL$fflushall" in
18552 OK, I give up. I cannot figure out how to flush pending stdio output.
18553 We won't be flushing handles at all before fork/exec/popen.
18557 $rm -f try.* try$exe_ext
18559 : Store the full pathname to the ar program for use in the C program
18560 : Respect a hint or command line value for full_ar.
18565 : Store the full pathname to the sed program for use in the C program
18568 : see what type gids are declared as in the kernel
18570 echo "Looking for the type for group ids returned by getgid()."
18571 set gid_t gidtype xxx stdio.h sys/types.h
18575 xxx=`./findhdr sys/user.h`
18576 set `grep 'groups\[NGROUPS\];' "$xxx" 2>/dev/null` unsigned short
18578 unsigned) dflt="$1 $2" ;;
18582 *) dflt="$gidtype";;
18585 gid_t) echo "gid_t found." ;;
18586 *) rp="What is the type for group ids returned by getgid()?"
18594 *_t) zzz="$gidtype" ;;
18597 echo "Checking the size of $zzz..." >&4
18599 #include <sys/types.h>
18601 #$i_stdlib I_STDLIB
18603 #include <stdlib.h>
18606 printf("%d\n", (int)sizeof($gidtype));
18611 if eval $compile_ok; then
18615 echo "(I can't execute the test program--guessing $gidsize.)" >&4
18618 echo "Your $zzz is $gidsize bytes long."
18623 echo "(I can't compile the test program--guessing $gidsize.)" >&4
18629 *_t) zzz="$gidtype" ;;
18632 echo "Checking the sign of $zzz..." >&4
18634 #include <sys/types.h>
18645 if eval $compile; then
18649 echo "(I can't execute the test program--guessing unsigned.)" >&4
18653 1) echo "Your $zzz is unsigned." ;;
18654 -1) echo "Your $zzz is signed." ;;
18660 echo "(I can't compile the test program--guessing unsigned.)" >&4
18666 if $test X"$quadtype" != X; then
18668 echo "Checking how to print 64-bit integers..." >&4
18670 if $test X"$sPRId64" = X -a X"$quadtype" = Xint; then
18671 $cat >try.c <<'EOCP'
18672 #include <sys/types.h>
18675 int q = 12345678901;
18676 printf("%ld\n", q);
18680 if eval $compile; then
18684 sPRId64='"d"'; sPRIi64='"i"'; sPRIu64='"u"';
18685 sPRIo64='"o"'; sPRIx64='"x"'; sPRIXU64='"X"';
18686 echo "We will use %d."
18692 if $test X"$sPRId64" = X -a X"$quadtype" = Xlong; then
18693 $cat >try.c <<'EOCP'
18694 #include <sys/types.h>
18697 long q = 12345678901;
18698 printf("%ld\n", q);
18702 if eval $compile; then
18706 sPRId64='"ld"'; sPRIi64='"li"'; sPRIu64='"lu"';
18707 sPRIo64='"lo"'; sPRIx64='"lx"'; sPRIXU64='"lX"';
18708 echo "We will use %ld."
18714 if $test X"$sPRId64" = X -a X"$i_inttypes" = X"$define" -a X"$quadtype" = Xint64_t; then
18715 $cat >try.c <<'EOCP'
18716 #include <sys/types.h>
18717 #include <inttypes.h>
18720 int64_t q = 12345678901;
18721 printf("%" PRId64 "\n", q);
18725 if eval $compile; then
18729 sPRId64=PRId64; sPRIi64=PRIi64; sPRIu64=PRIu64;
18730 sPRIo64=PRIo64; sPRIx64=PRIx64; sPRIXU64=PRIXU64;
18731 echo "We will use the C9X style."
18737 if $test X"$sPRId64" = X -a X"$quadtype" != X; then
18739 #include <sys/types.h>
18742 $quadtype q = 12345678901;
18743 printf("%Ld\n", q);
18747 if eval $compile; then
18751 sPRId64='"Ld"'; sPRIi64='"Li"'; sPRIu64='"Lu"';
18752 sPRIo64='"Lo"'; sPRIx64='"Lx"'; sPRIXU64='"LX"';
18753 echo "We will use %Ld."
18759 if $test X"$sPRId64" = X -a X"$quadtype" = X"long long"; then
18760 $cat >try.c <<'EOCP'
18761 #include <sys/types.h>
18764 long long q = 12345678901LL; /* AIX cc requires the LL suffix. */
18765 printf("%lld\n", q);
18769 if eval $compile; then
18773 sPRId64='"lld"'; sPRIi64='"lli"'; sPRIu64='"llu"';
18774 sPRIo64='"llo"'; sPRIx64='"llx"'; sPRIXU64='"llX"';
18775 echo "We will use the %lld style."
18781 if $test X"$sPRId64" = X -a X"$quadtype" != X; then
18783 #include <sys/types.h>
18786 $quadtype q = 12345678901;
18787 printf("%qd\n", q);
18791 if eval $compile; then
18795 sPRId64='"qd"'; sPRIi64='"qi"'; sPRIu64='"qu"';
18796 sPRIo64='"qo"'; sPRIx64='"qx"'; sPRIXU64='"qX"';
18797 echo "We will use %qd."
18803 if $test X"$sPRId64" = X; then
18804 echo "Cannot figure out how to print 64-bit integers." >&4
18812 '') d_PRId64="$undef"; d_PRIi64="$undef"; d_PRIu64="$undef";
18813 d_PRIo64="$undef"; d_PRIx64="$undef"; d_PRIXU64="$undef";
18815 *) d_PRId64="$define"; d_PRIi64="$define"; d_PRIu64="$define";
18816 d_PRIo64="$define"; d_PRIx64="$define"; d_PRIXU64="$define";
18822 $echo "Checking the format strings to be used for Perl's internal types..." >&4
18824 if $test X"$ivsize" = X8; then
18825 ivdformat="$sPRId64"
18826 uvuformat="$sPRIu64"
18827 uvoformat="$sPRIo64"
18828 uvxformat="$sPRIx64"
18829 uvXUformat="$sPRIXU64"
18831 if $test X"$ivsize" = X"$longsize"; then
18838 if $test X"$ivsize" = X"$intsize"; then
18846 if $test X"$ivsize" = X"$shortsize"; then
18857 if $test X"$uselongdouble" = X"$define" -a X"$d_longdbl" = X"$define" -a X"$d_PRIgldbl" = X"$define"; then
18858 nveformat="$sPRIeldbl"
18859 nvfformat="$sPRIfldbl"
18860 nvgformat="$sPRIgldbl"
18861 nvEUformat="$sPRIEUldbl"
18862 nvFUformat="$sPRIFUldbl"
18863 nvGUformat="$sPRIGUldbl"
18873 case "$ivdformat" in
18874 '') echo "$0: Fatal: failed to find format strings, cannot continue." >&4
18881 $echo "Checking the format string to be used for gids..." >&4
18884 -1) if $test X"$gidsize" = X"$ivsize"; then
18885 gidformat="$ivdformat"
18887 if $test X"$gidsize" = X"$longsize"; then
18890 if $test X"$gidsize" = X"$intsize"; then
18893 if $test X"$gidsize" = X"$shortsize"; then
18900 *) if $test X"$gidsize" = X"$uvsize"; then
18901 gidformat="$uvuformat"
18903 if $test X"$gidsize" = X"$longsize"; then
18906 if $test X"$gidsize" = X"$intsize"; then
18909 if $test X"$gidsize" = X"$shortsize"; then
18918 : see if getgroups exists
18919 set getgroups d_getgrps
18922 : see if setgroups exists
18923 set setgroups d_setgrps
18927 : Find type of 2nd arg to 'getgroups()' and 'setgroups()'
18929 case "$d_getgrps$d_setgrps" in
18931 case "$groupstype" in
18932 '') dflt="$gidtype" ;;
18933 *) dflt="$groupstype" ;;
18936 What type of pointer is the second argument to getgroups() and setgroups()?
18937 Usually this is the same as group ids, $gidtype, but not always.
18940 rp='What type pointer is the second argument to getgroups() and setgroups()?'
18944 *) groupstype="$gidtype";;
18949 $define|true|[yY]*) dflt='y' ;;
18954 Would you like to build with Misc Attribute Decoration? This is development
18955 work leading to a Perl 5 to Perl 6 convertor, which imposes a space and speed
18956 overhead on the interpreter.
18958 If this doesn't make any sense to you, just accept the default '$dflt'.
18960 rp='Build Perl with MAD?'
18964 madlyh='madly.h madly.act madly.tab'
18966 madlyobj="madly$_o" ;;
18976 echo "Checking if your $make program sets \$(MAKE)..." >&4
18977 case "$make_set_make" in
18979 $sed 's/^X //' > testmake.mak << 'EOF'
18981 X @echo 'maketemp="$(MAKE)"'
18983 case "`$make -f testmake.mak 2>/dev/null`" in
18984 *maketemp=*) make_set_make='#' ;;
18985 *) make_set_make="MAKE=$make" ;;
18987 $rm -f testmake.mak
18990 case "$make_set_make" in
18991 '#') echo "Yup, it does.";;
18992 *) echo "Nope, it doesn't.";;
18995 : see what type is used for mode_t
18996 rp="What is the type used for file modes for system calls (e.g. fchmod())?"
18997 set mode_t modetype int stdio.h sys/types.h
19000 : see if stdarg is available
19002 if $test `./findhdr stdarg.h`; then
19003 echo "<stdarg.h> found." >&4
19006 echo "<stdarg.h> NOT found." >&4
19010 : see if varags is available
19012 if $test `./findhdr varargs.h`; then
19013 echo "<varargs.h> found." >&4
19015 echo "<varargs.h> NOT found, but that's ok (I hope)." >&4
19018 : set up the varargs testing programs
19019 $cat > varargs.c <<EOP
19021 #include <stdarg.h>
19024 #include <varargs.h>
19028 int f(char *p, ...)
19042 p = va_arg(ap, char *);
19047 $cat > varargs <<EOP
19049 if $cc -c $ccflags -D\$1 varargs.c >/dev/null 2>&1; then
19058 : now check which varargs header should be included
19063 if `./varargs I_STDARG`; then
19065 elif `./varargs I_VARARGS`; then
19070 if `./varargs I_VARARGS`; then
19077 echo "I could not find the definition for va_dcl... You have problems..." >&4
19078 val="$undef"; set i_stdarg; eval $setvar
19079 val="$undef"; set i_varargs; eval $setvar
19084 case "$i_varhdr" in
19086 val="$define"; set i_stdarg; eval $setvar
19087 val="$undef"; set i_varargs; eval $setvar
19090 val="$undef"; set i_stdarg; eval $setvar
19091 val="$define"; set i_varargs; eval $setvar
19094 echo "We'll include <$i_varhdr> to get va_dcl definition." >&4;;
19098 : see if we need va_copy
19100 case "$i_stdarg" in
19103 #include <stdarg.h>
19105 #$i_stdlib I_STDLIB
19107 #include <stdlib.h>
19109 #include <signal.h>
19112 ivfprintf(FILE *f, const char *fmt, va_list *valp)
19114 return vfprintf(f, fmt, *valp);
19118 myvfprintf(FILE *f, const char *fmt, va_list val)
19120 return ivfprintf(f, fmt, &val);
19124 myprintf(char *fmt, ...)
19127 va_start(val, fmt);
19128 return myvfprintf(stdout, fmt, val);
19132 main(int ac, char **av)
19134 signal(SIGSEGV, exit);
19136 myprintf("%s%cs all right, then\n", "that", '\'');
19141 if eval $compile && $run ./try 2>&1 >/dev/null; then
19142 case "`$run ./try`" in
19143 "that's all right, then")
19149 yes) echo "It seems that you don't need va_copy()." >&4
19150 need_va_copy="$undef"
19152 *) echo "It seems that va_copy() or similar will be needed." >&4
19153 need_va_copy="$define"
19156 $rm -f try.* core core.* *.core *.core.*
19158 *) echo "You don't have <stdarg.h>, not checking for va_copy()." >&4
19162 : see what type is used for size_t
19163 rp="What is the type used for the length parameter for string functions?"
19164 set size_t sizetype 'unsigned int' stdio.h sys/types.h
19167 : check for type of arguments to gethostbyaddr.
19168 if test "X$netdb_host_type" = X -o "X$netdb_hlen_type" = X; then
19169 case "$d_gethbyaddr" in
19173 Checking to see what type of arguments are accepted by gethostbyaddr().
19175 hdrs="$define sys/types.h
19176 $d_socket sys/socket.h
19177 $i_niin netinet/in.h
19179 $i_unistd unistd.h"
19180 : The first arg can 'char *' or 'void *'
19181 : The second arg is some of integral type
19182 for xxx in in_addr_t 'const void *' 'const char *' 'void *' 'char *'; do
19183 for yyy in size_t long int; do
19184 case "$netdb_host_type" in
19185 '') try="extern struct hostent *gethostbyaddr($xxx, $yyy, int);"
19186 if ./protochk "$try" $hdrs; then
19187 echo "Your system accepts $xxx for the first arg."
19188 echo "...and $yyy for the second arg."
19189 netdb_host_type="$xxx"
19190 netdb_hlen_type="$yyy"
19196 : In case none of those worked, prompt the user.
19197 case "$netdb_host_type" in
19198 '') rp='What is the type for the 1st argument to gethostbyaddr?'
19201 netdb_host_type=$ans
19202 rp='What is the type for the 2nd argument to gethostbyaddr?'
19205 netdb_hlen_type=$ans
19209 *) : no gethostbyaddr, so pick harmless defaults
19210 netdb_host_type='char *'
19211 netdb_hlen_type="$sizetype"
19214 # Remove the "const" if needed. -- but then we'll have a
19216 # netdb_host_type=`echo "$netdb_host_type" | sed 's/^const //'`
19219 : check for type of argument to gethostbyname.
19220 if test "X$netdb_name_type" = X ; then
19221 case "$d_gethbyname" in
19225 Checking to see what type of argument is accepted by gethostbyname().
19227 hdrs="$define sys/types.h
19228 $d_socket sys/socket.h
19229 $i_niin netinet/in.h
19231 $i_unistd unistd.h"
19232 for xxx in "const char *" "char *"; do
19233 case "$netdb_name_type" in
19234 '') try="extern struct hostent *gethostbyname($xxx);"
19235 if ./protochk "$try" $hdrs; then
19236 echo "Your system accepts $xxx."
19237 netdb_name_type="$xxx"
19242 : In case none of those worked, prompt the user.
19243 case "$netdb_name_type" in
19244 '') rp='What is the type for the 1st argument to gethostbyname?'
19247 netdb_name_type=$ans
19251 *) : no gethostbyname, so pick harmless default
19252 netdb_name_type='char *'
19257 : check for type of 1st argument to getnetbyaddr.
19258 if test "X$netdb_net_type" = X ; then
19259 case "$d_getnbyaddr" in
19263 Checking to see what type of 1st argument is accepted by getnetbyaddr().
19265 hdrs="$define sys/types.h
19266 $d_socket sys/socket.h
19267 $i_niin netinet/in.h
19269 $i_unistd unistd.h"
19270 for xxx in in_addr_t "unsigned long" long "unsigned int" int; do
19271 case "$netdb_net_type" in
19272 '') try="extern struct netent *getnetbyaddr($xxx, int);"
19273 if ./protochk "$try" $hdrs; then
19274 echo "Your system accepts $xxx."
19275 netdb_net_type="$xxx"
19280 : In case none of those worked, prompt the user.
19281 case "$netdb_net_type" in
19282 '') rp='What is the type for the 1st argument to getnetbyaddr?'
19285 netdb_net_type=$ans
19289 *) : no getnetbyaddr, so pick harmless default
19290 netdb_net_type='long'
19294 : locate the preferred pager for this system
19301 [a-zA-Z]:/*) dflt=$pg;;
19305 [a-zA-Z]:/*) dflt=$more;;
19309 [a-zA-Z]:/*) dflt=$less;;
19312 '') dflt=/usr/ucb/more;;
19316 : Instruct ./getfile to trust the hinted or previous pager value,
19317 : even if it does not begin with a slash. For example, on os2,
19318 : pager might be cmd /c more. See comments in UU/getfile.
19323 rp='What pager is used on your system?'
19327 : see what type pids are declared as in the kernel
19328 rp="What is the type of process ids on this system?"
19329 set pid_t pidtype int stdio.h sys/types.h
19332 : see if ar generates random libraries by itself
19334 echo "Checking how to generate random libraries on your machine..." >&4
19335 echo 'int bar1() { return bar2(); }' > bar1.c
19336 echo 'int bar2() { return 2; }' > bar2.c
19338 #$i_stdlib I_STDLIB
19340 #include <stdlib.h>
19342 int main() { printf("%d\n", bar1()); exit(0); }
19344 $cc $ccflags -c bar1.c >/dev/null 2>&1
19345 $cc $ccflags -c bar2.c >/dev/null 2>&1
19346 $cc $ccflags -c foo.c >/dev/null 2>&1
19347 $ar rc bar$_a bar2$_o bar1$_o >/dev/null 2>&1
19348 if $cc -o foobar $ccflags $ldflags foo$_o bar$_a $libs > /dev/null 2>&1 &&
19349 $run ./foobar >/dev/null 2>&1; then
19350 echo "$ar appears to generate random libraries itself."
19352 if [ "X$ranlib" = "X" ]; then
19355 elif $ar s bar$_a >/dev/null 2>&1 &&
19356 $cc -o foobar $ccflags $ldflags foo$_o bar$_a $libs > /dev/null 2>&1 &&
19357 $run ./foobar >/dev/null 2>&1; then
19358 echo "a table of contents needs to be added with '$ar s'."
19361 elif $ar ts bar$_a >/dev/null 2>&1 &&
19362 $cc -o foobar $ccflags $ldflags foo$_o bar$_a $libs > /dev/null 2>&1 &&
19363 $run ./foobar >/dev/null 2>&1; then
19364 echo "a table of contents needs to be added with '$ar ts'."
19371 ranlib=`./loc ranlib X /usr/bin /bin /usr/local/bin`
19372 $test -f $ranlib || ranlib=''
19375 if $test -n "$ranlib"; then
19376 echo "your system has '$ranlib'; we'll use that."
19379 echo "your system doesn't seem to support random libraries"
19380 echo "so we'll use lorder and tsort to order the libraries."
19387 : check for type of arguments to select.
19388 case "$selecttype" in
19389 '') case "$d_select" in
19393 Checking to see what type of arguments are accepted by select().
19395 hdrs="$define sys/types.h
19396 $i_systime sys/time.h
19397 $i_sysselct sys/select.h
19398 $d_socket sys/socket.h"
19399 : The first arg can be int, unsigned, or size_t
19400 : The last arg may or may not be 'const'
19402 : void pointer has been seen but using that
19403 : breaks the selectminbits test
19404 for xxx in 'fd_set *' 'int *'; do
19405 for nfd in 'int' 'size_t' 'unsigned long' 'unsigned' ; do
19406 for tmo in 'struct timeval *' 'const struct timeval *'; do
19408 '') try="extern select _(($nfd, $xxx, $xxx, $xxx, $tmo));"
19409 if ./protochk "$try" $hdrs; then
19410 echo "Your system accepts $xxx."
19419 '') rp='What is the type for the 2nd, 3rd, and 4th arguments to select?'
19420 case "$d_fd_set" in
19421 $define) dflt="fd_set *" ;;
19430 *) : no select, so pick a harmless default
19437 : check for the select 'width'
19438 case "$selectminbits" in
19439 '') safebits=`expr $ptrsize \* 8`
19440 case "$d_select" in
19444 Checking to see on how many bits at a time your select() operates...
19447 #include <sys/types.h>
19449 #$i_systime I_SYS_TIME
19450 #$i_systimek I_SYS_TIME_KERNEL
19455 # ifdef I_SYS_TIME_KERNEL
19458 # include <sys/time.h>
19459 # ifdef I_SYS_TIME_KERNEL
19463 #$i_sysselct I_SYS_SELECT
19464 #ifdef I_SYS_SELECT
19465 #include <sys/select.h>
19467 #$d_socket HAS_SOCKET
19469 # include <sys/socket.h> /* Might include <sys/bsdtypes.h> */
19472 #$i_stdlib I_STDLIB
19474 #include <stdlib.h>
19477 #define S sizeof(*(b))
19479 #define NBYTES (S * 8 > MINBITS ? S : MINBITS/8)
19480 #define NBITS (NBYTES * 8)
19482 char *s = malloc(NBYTES);
19491 fp = fopen("try.c", "r");
19497 b = ($selecttype)s;
19498 for (i = 0; i < NBITS; i++)
19502 select(fd + 1, b, 0, 0, &t);
19503 for (i = NBITS - 1; i > fd && FD_ISSET(i, b); i--);
19505 printf("%d\n", i + 1);
19510 if eval $compile_ok; then
19511 selectminbits=`$run ./try`
19512 case "$selectminbits" in
19514 Cannot figure out on how many bits at a time your select() operates.
19515 I'll play safe and guess it is $safebits bits.
19517 selectminbits=$safebits
19518 bits="$safebits bits"
19521 *) bits="$selectminbits bits" ;;
19523 echo "Your select() operates on $bits at a time." >&4
19525 rp='What is the minimum number of bits your select() operates on?'
19526 case "$byteorder" in
19527 12345678) dflt=64 ;;
19533 selectminbits="$val"
19537 *) : no select, so pick a harmless default
19538 selectminbits=$safebits
19544 : Trace out the files included by signal.h, then look for SIGxxx names.
19545 : Remove SIGARRAYSIZE used by HPUX.
19546 : Remove SIGSTKSIZE used by Linux.
19547 : Remove SIGSTKSZ used by Posix.
19548 : Remove SIGTYP void lines used by OS2.
19549 : Some cpps, like os390, dont give the file name anywhere
19550 if [ "X$fieldn" = X ]; then
19551 : Just make some guesses. We check them later.
19552 xxx='/usr/include/signal.h /usr/include/sys/signal.h'
19554 xxx=`echo '#include <signal.h>' |
19555 $cppstdin $cppminus $cppflags 2>/dev/null |
19556 $grep '^[ ]*#.*include' |
19557 $awk "{print \\$$fieldn}" | $sed 's!"!!g' | $sed 's!\\\\\\\\!/!g' | $sort | $uniq`
19559 : Check this list of files to be sure we have parsed the cpp output ok.
19560 : This will also avoid potentially non-existent files, such
19563 for xx in $xxx /dev/null ; do
19564 $test -f "$xx" && xxxfiles="$xxxfiles $xx"
19566 : If we have found no files, at least try signal.h
19567 case "$xxxfiles" in
19568 '') xxxfiles=`./findhdr signal.h` ;;
19571 $1 ~ /^#define$/ && $2 ~ /^SIG[A-Z0-9]*$/ && $2 !~ /SIGARRAYSIZE/ && $2 !~ /SIGSTKSIZE/ && $2 !~ /SIGSTKSZ/ && $3 !~ /void/ {
19572 print substr($2, 4, 20)
19574 $1 == "#" && $2 ~ /^define$/ && $3 ~ /^SIG[A-Z0-9]*$/ && $3 !~ /SIGARRAYSIZE/ && $4 !~ /void/ {
19575 print substr($3, 4, 20)
19577 : Append some common names just in case the awk scan failed.
19578 xxx="$xxx ABRT ALRM BUS CANCEL CHLD CLD CONT DIL EMT FPE"
19579 xxx="$xxx FREEZE HUP ILL INT IO IOT KILL LOST LWP PHONE"
19580 xxx="$xxx PIPE POLL PROF PWR QUIT RTMAX RTMIN SEGV STKFLT STOP"
19581 xxx="$xxx SYS TERM THAW TRAP TSTP TTIN TTOU URG USR1 USR2"
19582 xxx="$xxx USR3 USR4 VTALRM WAITING WINCH WIND WINDOW XCPU XFSZ"
19584 : generate a few handy files for later
19585 $cat > signal.c <<EOCP
19586 #include <sys/types.h>
19587 #include <signal.h>
19588 #$i_stdlib I_STDLIB
19590 #include <stdlib.h>
19595 /* Strange style to avoid deeply-nested #if/#else/#endif */
19598 # define NSIG (_NSIG)
19604 # define NSIG (SIGMAX+1)
19610 # define NSIG (SIG_MAX+1)
19616 # define NSIG (_SIG_MAX+1)
19622 # define NSIG (MAXSIG+1)
19628 # define NSIG (MAX_SIG+1)
19633 # ifdef SIGARRAYSIZE
19634 # define NSIG SIGARRAYSIZE /* Assume ary[SIGARRAYSIZE] */
19640 # define NSIG (_sys_nsig) /* Solaris 2.5 */
19644 /* Default to some arbitrary number that's big enough to get most
19645 of the common signals.
19651 printf("NSIG %d\n", NSIG);
19657 echo $xxx | $tr ' ' $trnl | $sort | $uniq | $awk '
19659 printf "#ifdef SIG"; printf $1; printf "\n"
19660 printf "printf(\""; printf $1; printf " %%d\\n\",SIG";
19661 printf $1; printf ");\n"
19665 printf "#endif /* JUST_NSIG */\n";
19666 printf "exit(0);\n}\n";
19669 $cat >signal.awk <<'EOP'
19670 BEGIN { ndups = 0 }
19671 $1 ~ /^NSIG$/ { nsig = $2 }
19672 ($1 !~ /^NSIG$/) && (NF == 2) && ($2 ~ /^[0-9][0-9]*$/) {
19673 if ($2 > maxsig) { maxsig = $2 }
19674 if (sig_name[$2]) {
19675 dup_name[ndups] = $1
19676 dup_num[ndups] = $2
19688 printf("NSIG %d\n", nsig);
19689 for (n = 1; n < nsig; n++) {
19691 printf("%s %d\n", sig_name[n], sig_num[n])
19694 printf("NUM%d %d\n", n, n)
19697 for (n = 0; n < ndups; n++) {
19698 printf("%s %d\n", dup_name[n], dup_num[n])
19702 $cat >signal_cmd <<EOS
19704 if $test -s signal.lst; then
19705 echo "Using your existing signal.lst file"
19710 $cat >>signal_cmd <<'EOS'
19713 if eval $compile_ok; then
19714 $run ./signal$_exe | ($sort -n -k 2 2>/dev/null || $sort -n +1) | $uniq | $awk -f signal.awk >signal.lst
19716 echo "(I can't seem be able to compile the whole test program)" >&4
19717 echo "(I'll try it in little pieces.)" >&4
19718 set signal -DJUST_NSIG
19719 if eval $compile_ok; then
19720 $run ./signal$_exe > signal.nsg
19723 echo "I can't seem to figure out how many signals you have." >&4
19724 echo "Guessing 50." >&4
19725 echo 'NSIG 50' > signal.nsg
19727 : Now look at all the signal names, one at a time.
19728 for xx in `echo $xxx | $tr ' ' $trnl | $sort | $uniq`; do
19729 $cat > signal.c <<EOCP
19730 #include <sys/types.h>
19731 #include <signal.h>
19734 printf("$xx %d\n", SIG${xx});
19739 if eval $compile; then
19740 echo "SIG${xx} found."
19741 $run ./signal$_exe >> signal.ls1
19743 echo "SIG${xx} NOT found."
19746 if $test -s signal.ls1; then
19747 $cat signal.nsg signal.ls1 |
19748 $sort -n | $uniq | $awk -f signal.awk >signal.lst
19752 if $test -s signal.lst; then
19755 echo "(AAK! I can't compile the test programs -- Guessing)" >&4
19756 echo 'kill -l' >signal
19757 set X `csh -f <signal`
19761 0) set HUP INT QUIT ILL TRAP ABRT EMT FPE KILL BUS SEGV SYS PIPE ALRM TERM;;
19763 echo $@ | $tr ' ' $trnl | \
19764 $awk '{ printf "%s %d\n", $1, ++s; }
19765 END { printf "NSIG %d\n", ++s }' >signal.lst
19767 $rm -f signal.c signal$_exe signal$_o signal.nsg signal.ls1
19769 chmod a+x signal_cmd
19770 $eunicefix signal_cmd
19772 : generate list of signal names
19774 case "$sig_name_init" in
19776 *) case "$sig_num_init" in
19777 ''|*,*) doinit=yes ;;
19782 echo "Generating a list of signal names and numbers..." >&4
19784 sig_count=`$awk '/^NSIG/ { printf "%d", $2 }' signal.lst`
19785 sig_name=`$awk 'BEGIN { printf "ZERO " }
19786 !/^NSIG/ { printf "%s ", $1 }' signal.lst`
19787 sig_num=`$awk 'BEGIN { printf "0 " }
19788 !/^NSIG/ { printf "%d ", $2 }' signal.lst`
19789 sig_name_init=`$awk 'BEGIN { printf "\"ZERO\", " }
19790 !/^NSIG/ { printf "\"%s\", ", $1 }
19791 END { printf "0\n" }' signal.lst`
19792 sig_num_init=`$awk 'BEGIN { printf "0, " }
19793 !/^NSIG/ { printf "%d, ", $2}
19794 END { printf "0\n"}' signal.lst`
19797 echo "The following $sig_count signals are available:"
19799 echo $sig_name | $awk \
19800 'BEGIN { linelen = 0 }
19802 for (i = 1; i <= NF; i++) {
19803 name = "SIG" $i " "
19804 linelen = linelen + length(name)
19805 if (linelen > 70) {
19807 linelen = length(name)
19813 sig_size=`echo $sig_name | awk '{print NF}'`
19814 $rm -f signal signal.c signal.awk signal.lst signal_cmd
19817 case "$sizetype" in
19818 *_t) zzz="$sizetype" ;;
19819 *) zzz="filesize" ;;
19821 echo "Checking the size of $zzz..." >&4
19823 #include <sys/types.h>
19825 #$i_stdlib I_STDLIB
19827 #include <stdlib.h>
19830 printf("%d\n", (int)sizeof($sizetype));
19835 if eval $compile_ok; then
19839 echo "(I can't execute the test program--guessing $sizesize.)" >&4
19842 echo "Your $zzz size is $sizesize bytes."
19847 echo "(I can't compile the test program--guessing $sizesize.)" >&4
19851 : check for socklen_t
19853 echo "Checking to see if you have socklen_t..." >&4
19855 #include <sys/types.h>
19856 #$d_socket HAS_SOCKET
19858 #include <sys/socket.h>
19860 int main() { socklen_t x = 16; }
19863 if eval $compile; then
19865 echo "You have socklen_t."
19868 echo "You do not have socklen_t."
19869 case "$sizetype" in
19870 size_t) echo "(You do have size_t, that might work. Some people are happy with just an int.)" ;;
19877 : see if this is a socks.h system
19878 set socks.h i_socks
19881 : check for type of the size argument to socket calls
19882 case "$d_socket" in
19886 Checking to see what type is the last argument of accept().
19889 case "$d_socklen_t" in
19890 "$define") yyy="$yyy socklen_t"
19892 yyy="$yyy $sizetype int long unsigned"
19893 for xxx in $yyy; do
19894 case "$socksizetype" in
19895 '') try="extern int accept(int, struct sockaddr *, $xxx *);"
19896 case "$usesocks" in
19898 if ./protochk "$try" $i_systypes sys/types.h $d_socket sys/socket.h literal '#define INCLUDE_PROTOTYPES' $i_socks socks.h.; then
19899 echo "Your system accepts '$xxx *' for the last argument of accept()."
19900 socksizetype="$xxx"
19903 *) if ./protochk "$try" $i_systypes sys/types.h $d_socket sys/socket.h; then
19904 echo "Your system accepts '$xxx *' for the last argument of accept()."
19905 socksizetype="$xxx"
19912 : In case none of those worked, prompt the user.
19913 case "$socksizetype" in
19914 '') rp='What is the type for socket address structure sizes?'
19921 *) : no sockets, so pick relatively harmless default
19926 : see what type is used for signed size_t
19927 set ssize_t ssizetype int stdio.h sys/types.h
19932 #$i_stdlib I_STDLIB
19934 #include <stdlib.h>
19936 #include <sys/types.h>
19937 #define Size_t $sizetype
19938 #define SSize_t $dflt
19941 if (sizeof(Size_t) == sizeof(SSize_t))
19943 else if (sizeof(Size_t) == sizeof(int))
19952 if eval $compile_ok && $run ./try > /dev/null; then
19953 ssizetype=`$run ./try`
19954 echo "I'll be using $ssizetype for functions returning a byte count." >&4
19957 Help! I can't compile and run the ssize_t test program: please enlighten me!
19958 (This is probably a misconfiguration in your system or libraries, and
19959 you really ought to fix it. Still, I'll try anyway.)
19961 I need a type that is the same size as $sizetype, but is guaranteed to
19962 be signed. Common values are ssize_t, int and long.
19965 rp="What signed type is the same size as $sizetype?"
19971 : see what type of char stdio uses.
19973 echo '#include <stdio.h>' > stdio.c
19974 $cppstdin $cppminus < stdio.c > stdioh
19975 if $contains 'unsigned.*char.*_ptr;' stdioh >/dev/null 2>&1 ; then
19976 echo "Your stdio uses unsigned chars." >&4
19977 stdchar="unsigned char"
19979 echo "Your stdio uses signed chars." >&4
19982 $rm -f stdio.* stdioh
19984 : see what type uids are declared as in the kernel
19986 echo "Looking for the type for user ids returned by getuid()."
19987 set uid_t uidtype xxx stdio.h sys/types.h
19991 xxx=`./findhdr sys/user.h`
19992 set `grep '_ruid;' "$xxx" 2>/dev/null` unsigned short
19994 unsigned) dflt="$1 $2" ;;
19998 *) dflt="$uidtype";;
20001 uid_t) echo "uid_t found." ;;
20002 *) rp="What is the type for user ids returned by getuid()?"
20010 *_t) zzz="$uidtype" ;;
20013 echo "Checking the size of $zzz..." >&4
20015 #include <sys/types.h>
20017 #$i_stdlib I_STDLIB
20019 #include <stdlib.h>
20022 printf("%d\n", (int)sizeof($uidtype));
20027 if eval $compile_ok; then
20031 echo "(I can't execute the test program--guessing $uidsize.)" >&4
20034 echo "Your $zzz is $uidsize bytes long."
20039 echo "(I can't compile the test program--guessing $uidsize.)" >&4
20044 *_t) zzz="$uidtype" ;;
20047 echo "Checking the sign of $zzz..." >&4
20049 #include <sys/types.h>
20060 if eval $compile; then
20064 echo "(I can't execute the test program--guessing unsigned.)" >&4
20068 1) echo "Your $zzz is unsigned." ;;
20069 -1) echo "Your $zzz is signed." ;;
20075 echo "(I can't compile the test program--guessing unsigned.)" >&4
20081 $echo "Checking the format string to be used for uids..." >&4
20084 -1) if $test X"$uidsize" = X"$ivsize"; then
20085 uidformat="$ivdformat"
20087 if $test X"$uidsize" = X"$longsize"; then
20090 if $test X"$uidsize" = X"$intsize"; then
20093 if $test X"$uidsize" = X"$shortsize"; then
20100 *) if $test X"$uidsize" = X"$uvsize"; then
20101 uidformat="$uvuformat"
20103 if $test X"$uidsize" = X"$longsize"; then
20106 if $test X"$uidsize" = X"$intsize"; then
20109 if $test X"$uidsize" = X"$shortsize"; then
20119 case "$usesitecustomize" in
20120 $define|true|[Yy]*)
20121 usesitecustomize="$define"
20124 usesitecustomize="$undef"
20128 : determine compiler compiler
20137 if $test -f "$byacc$_exe"; then
20139 comp="byacc or $comp"
20141 if $test -f "$bison$_exe"; then
20142 comp="$comp or bison -y"
20144 rp="Which compiler compiler ($comp) shall I use?"
20153 echo "(Adding -y option to bison to get yacc-compatible behaviour.)"
20159 : see if this is a fp.h system
20163 : see if this is a fp_class.h system
20164 set fp_class.h i_fp_class
20167 : see if this is a ieeefp.h system
20168 case "$i_ieeefp" in
20169 '' ) set ieeefp.h i_ieeefp
20174 : see if this is a libutil.h system
20175 set libutil.h i_libutil
20178 : see if mach cthreads are available
20179 if test "X$usethreads" = "X$define"; then
20180 set mach/cthreads.h i_machcthr
20183 i_machcthr="$undef"
20188 : see if this is a mntent.h system
20189 set mntent.h i_mntent
20192 : see if ndbm.h is available
20198 # Some Linux distributions such as RedHat 7.1 put the
20199 # ndbm.h header in /usr/include/gdbm/ndbm.h.
20200 if $test -f /usr/include/gdbm/ndbm.h; then
20201 echo '<gdbm/ndbm.h> found.'
20202 ccflags="$ccflags -I/usr/include/gdbm"
20203 cppflags="$cppflags -I/usr/include/gdbm"
20211 : see if dbm_open exists
20212 set dbm_open d_dbm_open
20214 case "$d_dbm_open" in
20217 echo "We won't be including <ndbm.h>"
20226 : see if net/errno.h is available
20228 set net/errno.h val
20231 : Unfortunately, it causes problems on some systems. Arrgh.
20234 cat > try.c <<'EOM'
20237 #include <net/errno.h>
20243 if $cc $ccflags -c try.c >/dev/null 2>&1; then
20244 echo "We'll be including <net/errno.h>." >&4
20246 echo "We won't be including <net/errno.h>." >&4
20255 : see if netinet/tcp.h is available
20256 set netinet/tcp.h i_netinettcp
20259 : see if this is a poll.h system
20263 : see if this is a prot.h system
20268 $echo "Guessing which symbols your C compiler and preprocessor define..." >&4
20269 $cat <<'EOSH' > Cppsym.know
20270 a29k ABI64 aegis AES_SOURCE AIX AIX32 AIX370
20271 AIX41 AIX42 AIX43 AIX_SOURCE aixpc ALL_SOURCE
20272 alliant alpha am29000 AM29000 AMD64 amd64 amiga AMIGAOS AMIX
20273 ansi ANSI_C_SOURCE apollo ardent ARM32 atarist att386 att3b
20274 BeOS BIG_ENDIAN BIT_MSF bsd BSD bsd43 bsd4_2 bsd4_3 BSD4_3 bsd4_4
20275 BSD_4_3 BSD_4_4 BSD_NET2 BSD_TIME BSD_TYPES BSDCOMPAT bsdi
20276 bull c cadmus clipper CMU COFF COMPILER_VERSION
20277 concurrent convex cpu cray CRAY CRAYMPP ctix CX_UX
20278 CYGWIN DECC DGUX DGUX_SOURCE DJGPP dmert DOLPHIN DPX2 DSO
20279 Dynix DynixPTX ELF encore EPI EXTENSIONS FAVOR_BSD
20280 FILE_OFFSET_BITS FreeBSD GCC_NEW_VARARGS gcos gcx gimpel
20282 GNU_SOURCE GNUC GNUC_MINOR GNU_LIBRARY GO32 gould GOULD_PN
20283 H3050R H3050RX hbullx20 hcx host_mips
20284 hp200 hp300 hp700 HP700 hp800 hp9000
20285 hp9000s200 hp9000s300 hp9000s400 hp9000s500
20286 hp9000s700 hp9000s800 hp9k8 hp_osf hppa hpux HPUX_SOURCE
20287 i186 i286 i386 i486 i586 i686 i8086 i80960 i860 I960
20288 IA64 iAPX286 ibm ibm032 ibmesa IBMR2 ibmrt ILP32 ILP64
20289 INLINE_INTRINSICS INTRINSICS INT64 interdata is68k ksr1
20290 LANGUAGE_C LARGE_FILE_API LARGEFILE64_SOURCE
20291 LARGEFILE_SOURCE LFS64_LARGEFILE LFS_LARGEFILE
20292 Linux LITTLE_ENDIAN LONG64 LONG_DOUBLE LONG_LONG
20293 LONGDOUBLE LONGLONG LP64 luna luna88k Lynx
20294 M68000 m68k m88100 m88k M88KBCS_TARGET M_COFF
20295 M_I186 M_I286 M_I386 M_I8086 M_I86 M_I86SM M_SYS3
20296 M_SYS5 M_SYSIII M_SYSV M_UNIX M_XENIX MACH machine MachTen
20297 MATH_HAS_NO_SIDE_EFFECTS
20298 mc300 mc500 mc68000 mc68010 mc68020 mc68030 mc68040
20299 mc68060 mc68k mc68k32 mc700 mc88000 mc88100 merlin
20300 mert MiNT mips MIPS_FPSET MIPS_ISA MIPS_SIM MIPS_SZINT
20301 MIPS_SZLONG MIPS_SZPTR MIPSEB MIPSEL MODERN_C motorola
20302 mpeix MSDOS MTXINU MULTIMAX mvs MVS n16 ncl_el ncl_mr
20303 NetBSD news1500 news1700 news1800 news1900 news3700
20304 news700 news800 news900 NeXT NLS nonstopux ns16000 ns32000
20305 ns32016 ns32332 ns32k nsc32000
20306 OCS88 OEMVS OpenBSD os OS2 OS390 osf OSF1 OSF_SOURCE
20307 pa_risc PA_RISC1_1 PA_RISC2_0 PARAGON parisc
20308 pc532 pdp11 PGC PIC plexus PORTAR posix
20309 POSIX1B_SOURCE POSIX2_SOURCE POSIX4_SOURCE
20310 POSIX_C_SOURCE POSIX_SOURCE POWER
20311 PROTOTYPES PWB pyr QNX R3000 REENTRANT RES Rhapsody RISC6000
20312 riscix riscos RT S390 SA110 scs SCO sequent sgi SGI_SOURCE SH3 sinix
20313 SIZE_INT SIZE_LONG SIZE_PTR SOCKET_SOURCE SOCKETS_SOURCE
20314 sony sony_news sonyrisc sparc sparclite spectrum
20315 stardent stdc STDC_EXT stratos sun sun3 sun386
20316 Sun386i svr3 svr4 SVR4_2 SVR4_SOURCE svr5
20317 SX system SYSTYPE_BSD SYSTYPE_BSD43 SYSTYPE_BSD44
20318 SYSTYPE_SVR4 SYSTYPE_SVR5 SYSTYPE_SYSV SYSV SYSV3 SYSV4 SYSV5
20319 sysV68 sysV88 Tek4132 Tek4300 titan
20320 TM3200 TM5400 TM5600
20321 tower tower32 tower32_200 tower32_600 tower32_700
20322 tower32_800 tower32_850 tss
20323 u370 u3b u3b2 u3b20 u3b200 u3b20d u3b5
20324 ultrix UMAXV UnicomPBB UnicomPBD UNICOS UNICOSMK
20325 unix UNIX95 UNIX99 unixpc unos
20326 USE_BSD USE_FILE_OFFSET64 USE_GNU USE_ISOC9X USE_LARGEFILE USE_LARGEFILE64
20327 USE_MISC USE_POSIX USE_POSIX199309 USE_POSIX199506 USE_POSIX2
20328 USE_REENTRANT USE_SVID USE_UNIX98 USE_XOPEN USE_XOPEN_EXTENDED
20330 Utek UTek UTS UWIN uxpm uxps vax venix VMESA vms x86_64 xenix Xenix286
20331 XOPEN_SOURCE XOPEN_SOURCE_EXTENDED XPG2 XPG2_EXTENDED
20332 XPG3 XPG3_EXTENDED XPG4 XPG4_EXTENDED
20335 # Maybe put other stuff here too.
20336 cat <<EOSH >>Cppsym.know
20339 ./tr '[a-z]' '[A-Z]' < Cppsym.know > Cppsym.a
20340 ./tr '[A-Z]' '[a-z]' < Cppsym.know > Cppsym.b
20341 $cat Cppsym.know > Cppsym.c
20342 $cat Cppsym.a Cppsym.b Cppsym.c | $tr ' ' $trnl | $sort | $uniq > Cppsym.know
20343 $rm -f Cppsym.a Cppsym.b Cppsym.c
20344 cat <<EOSH > Cppsym
20346 if $test \$# -gt 0; then
20347 echo \$* | $tr " " "$trnl" | ./Cppsym.try > Cppsym.got
20348 if $test -s Cppsym.got; then
20355 $tr " " "$trnl" | ./Cppsym.try
20361 cat <<EOSH > Cppsym.try
20363 cat <<'EOCP' > try.c
20366 #define STRINGIFY(a) "a"
20368 #if cpp_stuff == 42
20369 #define StGiFy(a) #a
20370 #define STRINGIFY(a) StGiFy(a)
20372 #if $cpp_stuff != 1 && $cpp_stuff != 42
20373 # include "Bletch: How does this C preprocessor stringify macros?"
20379 cat <<'EOSH' >> Cppsym.try
20381 printf "#ifdef %s\nprintf(\"%s=%%s\\n\", STRINGIFY(%s));\n#endif\n", $1, $1, $1
20382 printf "#ifdef _%s\nprintf(\"_%s=%%s\\n\", STRINGIFY(_%s));\n#endif\n", $1, $1, $1
20383 printf "#ifdef __%s\nprintf(\"__%s=%%s\\n\", STRINGIFY(__%s));\n#endif\n", $1, $1, $1
20384 printf "#ifdef __%s__\nprintf(\"__%s__=%%s\\n\", STRINGIFY(__%s__));\n#endif\n", $1, $1, $1
20386 echo 'return 0;}' >> try.c
20388 cat <<EOSH >> Cppsym.try
20390 case "$osname-$gccversion" in
20391 irix-) ccflags="\$ccflags -woff 1178" ;;
20392 os2-*) ccflags="\$ccflags -Zlinker /PM:VIO" ;;
20394 $cc -o try -Dcpp_stuff=$cpp_stuff $optimize \$ccflags $ldflags try.c $libs && $run ./try | $sed 's/ /\\\\ /g'
20396 chmod +x Cppsym.try
20397 $eunicefix Cppsym.try
20398 ./Cppsym < Cppsym.know > Cppsym.true
20399 : Add in any linux cpp "predefined macros":
20400 case "$osname::$gccversion" in
20403 rm -f $tHdrH'.h' $tHdrH
20405 if cpp -dM $tHdrH'.h' > $tHdrH'_cppsym.h' && [ -s $tHdrH'_cppsym.h' ]; then
20406 sed 's/#define[\ \ ]*//;s/[\ \ ].*$//' <$tHdrH'_cppsym.h' >$tHdrH'_cppsym.real'
20407 if [ -s $tHdrH'_cppsym.real' ]; then
20408 cat $tHdrH'_cppsym.real' Cppsym.know | sort | uniq | ./Cppsym | sort | uniq > Cppsym.true
20411 rm -f $tHdrH'.h' $tHdrH'_cppsym.h' $tHdrH'_cppsym.real'
20414 : now check the C compiler for additional symbols
20415 postprocess_cc_v=''
20417 aix) postprocess_cc_v="|$tr , ' '" ;;
20424 for i in \`$cc -v -c tmp.c 2>&1 $postprocess_cc_v\`
20427 -D*) echo "\$i" | $sed 's/^-D//';;
20428 -A*) $test "$gccversion" && echo "\$i" | $sed 's/^-A//' | $sed 's/\(.*\)(\(.*\))/\1=\2/';;
20433 postprocess_cc_v=''
20436 ./ccsym > ccsym1.raw
20437 if $test -s ccsym1.raw; then
20438 $sort ccsym1.raw | $uniq >ccsym.raw
20440 mv ccsym1.raw ccsym.raw
20443 $awk '/\=/ { print $0; next }
20444 { print $0"=1" }' ccsym.raw >ccsym.list
20445 $comm -13 Cppsym.true ccsym.list >ccsym.own
20446 $comm -12 Cppsym.true ccsym.list >ccsym.com
20447 $comm -23 Cppsym.true ccsym.list >ccsym.cpp
20449 if $test -z ccsym.raw; then
20450 echo "Your C compiler doesn't seem to define any symbols!" >&4
20452 echo "However, your C preprocessor defines the following symbols:"
20455 cppsymbols=`$cat Cppsym.true`
20456 cppsymbols=`echo $cppsymbols`
20457 cppccsymbols="$cppsymbols"
20459 if $test -s ccsym.com; then
20460 echo "Your C compiler and pre-processor define these symbols:"
20461 $sed -e 's/\(..*\)=.*/\1/' ccsym.com
20464 cppccsymbols=`$cat ccsym.com`
20465 cppccsymbols=`echo $cppccsymbols`
20466 $test "$silent" || sleep 1
20468 if $test -s ccsym.cpp; then
20469 $test "$also" && echo " "
20470 echo "Your C pre-processor ${also}defines the following symbols:"
20471 $sed -e 's/\(..*\)=.*/\1/' ccsym.cpp
20473 cppsymbols=`$cat ccsym.cpp`
20474 cppsymbols=`echo $cppsymbols`
20475 $test "$silent" || sleep 1
20477 if $test -s ccsym.own; then
20478 $test "$also" && echo " "
20479 echo "Your C compiler ${also}defines the following cpp symbols:"
20480 $sed -e 's/\(..*\)=1/\1/' ccsym.own
20481 $sed -e 's/\(..*\)=.*/\1/' ccsym.own | $uniq >>Cppsym.true
20482 ccsymbols=`$cat ccsym.own`
20483 ccsymbols=`echo $ccsymbols`
20484 $test "$silent" || sleep 1
20488 : see if this is a termio system
20492 if $test `./findhdr termios.h`; then
20493 set tcsetattr i_termios
20499 "$define") echo "You have POSIX termios.h... good!" >&4;;
20500 *) if ./Cppsym pyr; then
20501 case "`/bin/universe`" in
20502 ucb) if $test `./findhdr sgtty.h`; then
20504 echo "<sgtty.h> found." >&4
20506 echo "System is pyramid with BSD universe."
20507 echo "<sgtty.h> not found--you could have problems." >&4
20509 *) if $test `./findhdr termio.h`; then
20511 echo "<termio.h> found." >&4
20513 echo "System is pyramid with USG universe."
20514 echo "<termio.h> not found--you could have problems." >&4
20518 if $test `./findhdr termio.h`; then
20519 echo "<termio.h> found." >&4
20521 elif $test `./findhdr sgtty.h`; then
20522 echo "<sgtty.h> found." >&4
20525 echo "Neither <termio.h> nor <sgtty.h> found--you could have problems." >&4
20528 if $test `./findhdr sgtty.h`; then
20529 echo "<sgtty.h> found." >&4
20531 elif $test `./findhdr termio.h`; then
20532 echo "<termio.h> found." >&4
20535 echo "Neither <sgtty.h> nor <termio.h> found--you could have problems." >&4
20539 set i_termio; eval $setvar
20540 val=$val2; set i_sgtty; eval $setvar
20541 val=$val3; set i_termios; eval $setvar
20543 : see if stddef is available
20544 set stddef.h i_stddef
20547 : see if this is a sunmath.h system
20548 set sunmath.h i_sunmath
20551 : see if sys/access.h is available
20552 set sys/access.h i_sysaccess
20555 : see if ioctl defs are in sgtty, termio, sys/filio or sys/ioctl
20556 set sys/filio.h i_sysfilio
20559 if $test `./findhdr sys/ioctl.h`; then
20561 echo '<sys/ioctl.h> found.' >&4
20564 if $test $i_sysfilio = "$define"; then
20565 echo '<sys/ioctl.h> NOT found.' >&4
20567 $test $i_sgtty = "$define" && xxx="sgtty.h"
20568 $test $i_termio = "$define" && xxx="termio.h"
20569 $test $i_termios = "$define" && xxx="termios.h"
20570 echo "No <sys/ioctl.h> found, assuming ioctl args are defined in <$xxx>." >&4
20576 : see if socket ioctl defs are in sys/sockio.h
20578 xxx=`./findhdr sys/sockio.h`
20579 if $test "$xxx"; then
20580 if $contains SIOCATMARK $xxx >/dev/null 2>&1; then
20582 echo "You have socket ioctls defined in <sys/sockio.h>." >&4
20585 echo "No socket ioctls found in <sys/sockio.h>." >&4
20590 <sys/sockio.h> not found, assuming socket ioctls are in <sys/ioctl.h>.
20597 : see if this is a syslog.h system
20598 set syslog.h i_syslog
20602 : see if this is a sys/mode.h system
20603 set sys/mode.h i_sysmode
20606 : see if sys/resource.h has to be included
20607 set sys/resource.h i_sysresrc
20610 : see if sys/security.h is available
20611 set sys/security.h i_syssecrt
20614 : see if this is a sys/statvfs.h system
20615 set sys/statvfs.h i_sysstatvfs
20618 : see if this is a sys/un.h system
20619 set sys/un.h i_sysun
20623 : see if this is a sys/utsname.h system
20624 set sys/utsname.h i_sysutsname
20627 : see if this is a syswait system
20628 set sys/wait.h i_syswait
20631 : see if this is a ustat.h system
20632 set ustat.h i_ustat
20635 : see if this is an utime system
20636 set utime.h i_utime
20639 : see if this is a values.h system
20640 set values.h i_values
20643 : see if this is a vfork system
20646 set vfork.h i_vfork
20654 : see if gdbm.h is available
20659 : see if gdbm_open exists
20660 set gdbm_open d_gdbm_open
20662 case "$d_gdbm_open" in
20665 echo "We won't be including <gdbm.h>"
20675 echo "Looking for extensions..." >&4
20676 : If we are using the old config.sh, known_extensions may contain
20677 : old or inaccurate or duplicate values.
20678 known_extensions=''
20679 nonxs_extensions=''
20680 : We do not use find because it might not be available.
20681 : We do not just use MANIFEST because the user may have dropped
20682 : some additional extensions into the source tree and expect them
20685 : Function to recursively find available extensions, ignoring DynaLoader
20686 : NOTE: recursion limit of 10 to prevent runaway in case of symlink madness
20690 DynaLoader|dynaload) ;;
20692 if $test -f $xxx/$xxx.xs; then
20693 known_extensions="$known_extensions $1$xxx";
20694 elif $test -f $xxx/Makefile.PL; then
20695 nonxs_extensions="$nonxs_extensions $1$xxx";
20697 if $test -d $xxx -a $# -lt 10; then
20700 eval $find_extensions;
20712 eval $find_extensions
20713 # Special case: Add in threads/shared since it is not picked up by the
20714 # recursive find above (and adding in general recursive finding breaks
20715 # SDBM_File/sdbm). A.D. 10/25/2001.
20716 known_extensions="$known_extensions threads/shared"
20717 set X $nonxs_extensions
20719 nonxs_extensions="$*"
20720 set X $known_extensions
20722 known_extensions="$*"
20725 : Now see which are supported on this system.
20727 for xxx in $known_extensions ; do
20731 $define) avail_ext="$avail_ext $xxx" ;;
20734 GDBM_File|gdbm_fil)
20736 $define) avail_ext="$avail_ext $xxx" ;;
20739 I18N/Langinfo|i18n_lan)
20740 case "$i_langinfo$d_nl_langinfo" in
20741 $define$define) avail_ext="$avail_ext $xxx" ;;
20744 NDBM_File|ndbm_fil)
20747 case "$osname-$use64bitint" in
20750 *-lndbm*) avail_ext="$avail_ext $xxx" ;;
20753 *) avail_ext="$avail_ext $xxx" ;;
20758 ODBM_File|odbm_fil)
20759 case "${i_dbm}${i_rpcsvcdbm}" in
20761 case "$osname-$use64bitint" in
20764 *-ldbm*) avail_ext="$avail_ext $xxx" ;;
20767 *) avail_ext="$avail_ext $xxx" ;;
20773 case "$useposix" in
20774 true|define|y) avail_ext="$avail_ext $xxx" ;;
20778 case "$useopcode" in
20779 true|define|y) avail_ext="$avail_ext $xxx" ;;
20783 case "$d_socket" in
20786 beos) ;; # not unless BONE
20787 *) avail_ext="$avail_ext $xxx" ;;
20792 Sys/Syslog|sys/syslog)
20793 : XXX syslog requires socket
20794 case "$d_socket" in
20795 true|$define|y) avail_ext="$avail_ext $xxx" ;;
20799 case "$usethreads" in
20801 case "$useithreads" in
20802 $undef|false|[nN]*) avail_ext="$avail_ext $xxx" ;;
20806 XS/APItest|xs/apitest)
20807 # This is just for testing. Skip it unless we have dynamic loading.
20810 $define) avail_ext="$avail_ext $xxx" ;;
20813 XS/Typemap|xs/typemap)
20814 # This is just for testing. Skip it unless we have dynamic loading.
20816 $define) avail_ext="$avail_ext $xxx" ;;
20819 threads|threads/shared)
20820 # threads and threads::shared are special cases.
20821 # To stop people from asking "Perl 5.8.0 was supposed
20822 # to have this new fancy threads implementation but my
20823 # perl doesn't have it" and from people trying to
20824 # (re)install the threads module using CPAN.pm and
20825 # CPAN.pm then offering to reinstall Perl 5.8.0,
20826 # the threads.pm and threads/shared.pm will always be
20827 # there, croaking informatively ("you need to rebuild
20828 # all of Perl with threads, sorry") when threads haven't
20829 # been compiled in.
20831 avail_ext="$avail_ext $xxx"
20834 : XXX Do we need a useipcsysv variable here
20835 case "${d_msg}${d_sem}${d_shm}" in
20836 *"${define}"*) avail_ext="$avail_ext $xxx" ;;
20839 *) avail_ext="$avail_ext $xxx"
20848 case "$onlyextensions" in
20850 *) keepextensions=''
20851 echo "You have requested that only certains extensions be included..." >&4
20852 for i in $onlyextensions; do
20853 case " $avail_ext " in
20855 echo "Keeping extension $i."
20856 keepextensions="$keepextensions $i"
20858 *) echo "Ignoring extension $i." ;;
20861 avail_ext="$keepextensions"
20865 case "$noextensions" in
20867 *) keepextensions=''
20868 echo "You have requested that certain extensions be ignored..." >&4
20869 for i in $avail_ext; do
20870 case " $noextensions " in
20871 *" $i "*) echo "Ignoring extension $i." ;;
20872 *) echo "Keeping extension $i.";
20873 keepextensions="$keepextensions $i"
20877 avail_ext="$keepextensions"
20881 : Now see which nonxs extensions are supported on this system.
20882 : For now assume all are.
20884 for xxx in $nonxs_extensions ; do
20886 *) nonxs_ext="$nonxs_ext $xxx"
20898 A number of extensions are supplied with $package. You may choose to
20899 compile these extensions for dynamic loading (the default), compile
20900 them into the $package executable (static loading), or not include
20901 them at all. Answer "none" to include no extensions.
20902 Note that DynaLoader is always built and need not be mentioned here.
20905 case "$dynamic_ext" in
20907 : Exclude those listed in static_ext
20909 for xxx in $avail_ext; do
20910 case " $static_ext " in
20912 *) dflt="$dflt $xxx" ;;
20919 *) dflt="$dynamic_ext"
20920 # Perhaps we are reusing an old out-of-date config.sh.
20923 if test X"$dynamic_ext" != X"$avail_ext"; then
20925 NOTICE: Your previous config.sh list may be incorrect.
20926 The extensions now available to you are
20928 but the default list from your previous config.sh is
20940 rp="What extensions do you wish to load dynamically?"
20943 none) dynamic_ext=' ' ;;
20944 *) dynamic_ext="$ans" ;;
20947 case "$static_ext" in
20949 : Exclude those already listed in dynamic linking
20951 for xxx in $avail_ext; do
20952 case " $dynamic_ext " in
20954 *) dflt="$dflt $xxx" ;;
20961 *) dflt="$static_ext"
20968 rp="What extensions do you wish to load statically?"
20971 none) static_ext=' ' ;;
20972 *) static_ext="$ans" ;;
20977 A number of extensions are supplied with $package. Answer "none"
20978 to include no extensions.
20979 Note that DynaLoader is always built and need not be mentioned here.
20982 case "$static_ext" in
20983 '') dflt="$avail_ext" ;;
20984 *) dflt="$static_ext"
20985 # Perhaps we are reusing an old out-of-date config.sh.
20988 if test X"$static_ext" != X"$avail_ext"; then
20990 NOTICE: Your previous config.sh list may be incorrect.
20991 The extensions now available to you are
20993 but the default list from your previous config.sh is
21002 : Exclude those that are not xs extensions
21006 rp="What extensions do you wish to include?"
21009 none) static_ext=' ' ;;
21010 *) static_ext="$ans" ;;
21015 # Encode is a special case. If we are building Encode as a static
21016 # extension, we need to explicitly list its subextensions as well.
21017 # For other nested extensions, this is handled automatically by
21018 # the appropriate Makefile.PL.
21019 case " $static_ext " in
21020 *" Encode "*) # Add the subextensions of Encode
21022 for xxx in `ls Encode/*/Makefile.PL|awk -F/ '{print $2}'`; do
21023 static_ext="$static_ext Encode/$xxx"
21029 set X $dynamic_ext $static_ext $nonxs_ext
21033 # Sanity check: We require an extension suitable for use with
21034 # AnyDBM_File, as well as Fcntl and IO. (Failure to have these
21035 # should show up as failures in the test suite, but it's helpful to
21036 # catch them now.) The 'extensions' list is normally sorted
21037 # alphabetically, so we need to accept either
21038 # DB_File ... Fcntl ... IO ....
21039 # or something like
21040 # Fcntl ... NDBM_File ... IO ....
21041 case " $extensions" in
21042 *"_File "*" Fcntl "*" IO "*) ;; # DB_File
21043 *" Fcntl "*"_File "*" IO "*) ;; # GDBM_File
21044 *" Fcntl "*" IO "*"_File "*) ;; # NDBM_File
21045 *) echo "WARNING: Extensions DB_File or *DBM_File, Fcntl, and IO not configured." >&4
21046 echo "WARNING: The Perl you are building will be quite crippled." >& 4
21050 : Remove libraries needed only for extensions
21051 : The appropriate ext/Foo/Makefile.PL will add them back in, if necessary.
21052 : The exception is SunOS 4.x, which needs them.
21053 case "${osname}X${osvers}" in
21057 *) case "$usedl" in
21058 $define|true|[yY]*)
21059 set X `echo " $libs " | sed -e 's@ -lndbm @ @' -e 's@ -lgdbm @ @' -e 's@ -ldbm @ @' -e 's@ -ldb @ @'`
21063 *) perllibs="$libs"
21069 : Remove build directory name from cppstdin so it can be used from
21070 : either the present location or the final installed location.
21072 : Get out of the UU directory to get correct path name.
21074 case "$cppstdin" in
21076 echo "Stripping down cppstdin path name"
21082 : end of configuration questions
21084 echo "End of configuration questions."
21087 : back to where it started
21088 if test -d ../UU; then
21092 : configuration may be patched via a 'config.arch' file
21093 if $test -f config.arch; then
21094 echo "I see a config.arch file, loading it."
21098 : configuration may be patched via a 'config.over' file
21099 if $test -f config.over; then
21102 rp='I see a config.over file. Do you wish to load it?'
21105 n*) echo "OK, I'll ignore it.";;
21107 echo "Configuration override changes have been loaded."
21112 : in case they want portability, strip down executable paths
21113 case "$d_portable" in
21116 echo "Stripping down executable paths..." >&4
21117 for file in $loclist $trylist; do
21119 eval $file=`basename $temp`
21124 : create config.sh file
21126 echo "Creating config.sh..." >&4
21127 $spitshell <<EOT >config.sh
21130 # This file was produced by running the Configure script. It holds all the
21131 # definitions figured out by Configure. Should you modify one of these values,
21132 # do not forget to propagate your changes by running "Configure -der". You may
21133 # instead choose to run each of the .SH files by yourself, or "Configure -S".
21136 # Package name : $package
21137 # Source directory : $src
21138 # Configuration time: $cf_time
21139 # Configured by : $cf_by
21140 # Target system : $myuname
21150 Revision='$Revision'
21158 alignbytes='$alignbytes'
21159 ansi2knr='$ansi2knr'
21160 aphostname='$aphostname'
21161 api_revision='$api_revision'
21162 api_subversion='$api_subversion'
21163 api_version='$api_version'
21164 api_versionstring='$api_versionstring'
21167 archlibexp='$archlibexp'
21168 archname64='$archname64'
21169 archname='$archname'
21170 archobjs='$archobjs'
21171 asctime_r_proto='$asctime_r_proto'
21179 byteorder='$byteorder'
21181 castflags='$castflags'
21184 cccdlflags='$cccdlflags'
21185 ccdlflags='$ccdlflags'
21187 ccflags_uselargefiles='$ccflags_uselargefiles'
21189 ccsymbols='$ccsymbols'
21190 ccversion='$ccversion'
21192 cf_email='$cf_email'
21194 charsize='$charsize'
21198 clocktype='$clocktype'
21200 compress='$compress'
21201 contains='$contains'
21205 cpp_stuff='$cpp_stuff'
21206 cppccsymbols='$cppccsymbols'
21207 cppflags='$cppflags'
21209 cppminus='$cppminus'
21211 cppstdin='$cppstdin'
21212 cppsymbols='$cppsymbols'
21213 crypt_r_proto='$crypt_r_proto'
21214 cryptlib='$cryptlib'
21216 ctermid_r_proto='$ctermid_r_proto'
21217 ctime_r_proto='$ctime_r_proto'
21218 d_Gconvert='$d_Gconvert'
21219 d_PRIEUldbl='$d_PRIEUldbl'
21220 d_PRIFUldbl='$d_PRIFUldbl'
21221 d_PRIGUldbl='$d_PRIGUldbl'
21222 d_PRIXU64='$d_PRIXU64'
21223 d_PRId64='$d_PRId64'
21224 d_PRIeldbl='$d_PRIeldbl'
21225 d_PRIfldbl='$d_PRIfldbl'
21226 d_PRIgldbl='$d_PRIgldbl'
21227 d_PRIi64='$d_PRIi64'
21228 d_PRIo64='$d_PRIo64'
21229 d_PRIu64='$d_PRIu64'
21230 d_PRIx64='$d_PRIx64'
21231 d_SCNfldbl='$d_SCNfldbl'
21232 d__fwalk='$d__fwalk'
21233 d_access='$d_access'
21234 d_accessx='$d_accessx'
21237 d_archlib='$d_archlib'
21238 d_asctime_r='$d_asctime_r'
21241 d_attribute_format='$d_attribute_format'
21242 d_attribute_malloc='$d_attribute_malloc'
21243 d_attribute_nonnull='$d_attribute_nonnull'
21244 d_attribute_noreturn='$d_attribute_noreturn'
21245 d_attribute_pure='$d_attribute_pure'
21246 d_attribute_unused='$d_attribute_unused'
21247 d_attribute_warn_unused_result='$d_attribute_warn_unused_result'
21251 d_bsdgetpgrp='$d_bsdgetpgrp'
21252 d_bsdsetpgrp='$d_bsdsetpgrp'
21253 d_builtin_choose_expr='$d_builtin_choose_expr'
21254 d_builtin_expect='$d_builtin_expect'
21256 d_casti32='$d_casti32'
21257 d_castneg='$d_castneg'
21258 d_charvspr='$d_charvspr'
21260 d_chroot='$d_chroot'
21261 d_chsize='$d_chsize'
21263 d_clearenv='$d_clearenv'
21264 d_closedir='$d_closedir'
21265 d_cmsghdr_s='$d_cmsghdr_s'
21267 d_copysignl='$d_copysignl'
21269 d_crypt_r='$d_crypt_r'
21271 d_ctermid_r='$d_ctermid_r'
21272 d_ctime_r='$d_ctime_r'
21273 d_cuserid='$d_cuserid'
21274 d_dbl_dig='$d_dbl_dig'
21275 d_dbminitproto='$d_dbminitproto'
21276 d_difftime='$d_difftime'
21278 d_dirnamlen='$d_dirnamlen'
21279 d_dlerror='$d_dlerror'
21280 d_dlopen='$d_dlopen'
21281 d_dlsymun='$d_dlsymun'
21282 d_dosuid='$d_dosuid'
21283 d_drand48_r='$d_drand48_r'
21284 d_drand48proto='$d_drand48proto'
21286 d_eaccess='$d_eaccess'
21287 d_endgrent='$d_endgrent'
21288 d_endgrent_r='$d_endgrent_r'
21289 d_endhent='$d_endhent'
21290 d_endhostent_r='$d_endhostent_r'
21291 d_endnent='$d_endnent'
21292 d_endnetent_r='$d_endnetent_r'
21293 d_endpent='$d_endpent'
21294 d_endprotoent_r='$d_endprotoent_r'
21295 d_endpwent='$d_endpwent'
21296 d_endpwent_r='$d_endpwent_r'
21297 d_endsent='$d_endsent'
21298 d_endservent_r='$d_endservent_r'
21299 d_eofnblk='$d_eofnblk'
21300 d_eunice='$d_eunice'
21301 d_faststdio='$d_faststdio'
21302 d_fchdir='$d_fchdir'
21303 d_fchmod='$d_fchmod'
21304 d_fchown='$d_fchown'
21306 d_fcntl_can_lock='$d_fcntl_can_lock'
21307 d_fd_macros='$d_fd_macros'
21308 d_fd_set='$d_fd_set'
21309 d_fds_bits='$d_fds_bits'
21310 d_fgetpos='$d_fgetpos'
21311 d_finite='$d_finite'
21312 d_finitel='$d_finitel'
21313 d_flexfnam='$d_flexfnam'
21315 d_flockproto='$d_flockproto'
21317 d_fp_class='$d_fp_class'
21318 d_fpathconf='$d_fpathconf'
21319 d_fpclass='$d_fpclass'
21320 d_fpclassify='$d_fpclassify'
21321 d_fpclassl='$d_fpclassl'
21322 d_fpos64_t='$d_fpos64_t'
21323 d_frexpl='$d_frexpl'
21324 d_fs_data_s='$d_fs_data_s'
21325 d_fseeko='$d_fseeko'
21326 d_fsetpos='$d_fsetpos'
21327 d_fstatfs='$d_fstatfs'
21328 d_fstatvfs='$d_fstatvfs'
21330 d_ftello='$d_ftello'
21332 d_futimes='$d_futimes'
21333 d_getcwd='$d_getcwd'
21334 d_getespwnam='$d_getespwnam'
21335 d_getfsstat='$d_getfsstat'
21336 d_getgrent='$d_getgrent'
21337 d_getgrent_r='$d_getgrent_r'
21338 d_getgrgid_r='$d_getgrgid_r'
21339 d_getgrnam_r='$d_getgrnam_r'
21340 d_getgrps='$d_getgrps'
21341 d_gethbyaddr='$d_gethbyaddr'
21342 d_gethbyname='$d_gethbyname'
21343 d_gethent='$d_gethent'
21344 d_gethname='$d_gethname'
21345 d_gethostbyaddr_r='$d_gethostbyaddr_r'
21346 d_gethostbyname_r='$d_gethostbyname_r'
21347 d_gethostent_r='$d_gethostent_r'
21348 d_gethostprotos='$d_gethostprotos'
21349 d_getitimer='$d_getitimer'
21350 d_getlogin='$d_getlogin'
21351 d_getlogin_r='$d_getlogin_r'
21352 d_getmnt='$d_getmnt'
21353 d_getmntent='$d_getmntent'
21354 d_getnbyaddr='$d_getnbyaddr'
21355 d_getnbyname='$d_getnbyname'
21356 d_getnent='$d_getnent'
21357 d_getnetbyaddr_r='$d_getnetbyaddr_r'
21358 d_getnetbyname_r='$d_getnetbyname_r'
21359 d_getnetent_r='$d_getnetent_r'
21360 d_getnetprotos='$d_getnetprotos'
21361 d_getpagsz='$d_getpagsz'
21362 d_getpbyname='$d_getpbyname'
21363 d_getpbynumber='$d_getpbynumber'
21364 d_getpent='$d_getpent'
21365 d_getpgid='$d_getpgid'
21366 d_getpgrp2='$d_getpgrp2'
21367 d_getpgrp='$d_getpgrp'
21368 d_getppid='$d_getppid'
21369 d_getprior='$d_getprior'
21370 d_getprotobyname_r='$d_getprotobyname_r'
21371 d_getprotobynumber_r='$d_getprotobynumber_r'
21372 d_getprotoent_r='$d_getprotoent_r'
21373 d_getprotoprotos='$d_getprotoprotos'
21374 d_getprpwnam='$d_getprpwnam'
21375 d_getpwent='$d_getpwent'
21376 d_getpwent_r='$d_getpwent_r'
21377 d_getpwnam_r='$d_getpwnam_r'
21378 d_getpwuid_r='$d_getpwuid_r'
21379 d_getsbyname='$d_getsbyname'
21380 d_getsbyport='$d_getsbyport'
21381 d_getsent='$d_getsent'
21382 d_getservbyname_r='$d_getservbyname_r'
21383 d_getservbyport_r='$d_getservbyport_r'
21384 d_getservent_r='$d_getservent_r'
21385 d_getservprotos='$d_getservprotos'
21386 d_getspnam='$d_getspnam'
21387 d_getspnam_r='$d_getspnam_r'
21388 d_gettimeod='$d_gettimeod'
21389 d_gmtime_r='$d_gmtime_r'
21390 d_gnulibc='$d_gnulibc'
21391 d_grpasswd='$d_grpasswd'
21392 d_hasmntopt='$d_hasmntopt'
21394 d_ilogbl='$d_ilogbl'
21395 d_inc_version_list='$d_inc_version_list'
21397 d_inetaton='$d_inetaton'
21398 d_int64_t='$d_int64_t'
21399 d_isascii='$d_isascii'
21400 d_isfinite='$d_isfinite'
21403 d_isnanl='$d_isnanl'
21404 d_killpg='$d_killpg'
21405 d_lchown='$d_lchown'
21406 d_ldbl_dig='$d_ldbl_dig'
21407 d_libm_lib_version='$d_libm_lib_version'
21409 d_localtime_r='$d_localtime_r'
21410 d_locconv='$d_locconv'
21412 d_longdbl='$d_longdbl'
21413 d_longlong='$d_longlong'
21414 d_lseekproto='$d_lseekproto'
21416 d_madvise='$d_madvise'
21417 d_malloc_good_size='$d_malloc_good_size'
21418 d_malloc_size='$d_malloc_size'
21420 d_mbstowcs='$d_mbstowcs'
21421 d_mbtowc='$d_mbtowc'
21422 d_memchr='$d_memchr'
21423 d_memcmp='$d_memcmp'
21424 d_memcpy='$d_memcpy'
21425 d_memmove='$d_memmove'
21426 d_memset='$d_memset'
21428 d_mkdtemp='$d_mkdtemp'
21429 d_mkfifo='$d_mkfifo'
21430 d_mkstemp='$d_mkstemp'
21431 d_mkstemps='$d_mkstemps'
21432 d_mktime='$d_mktime'
21435 d_modfl_pow32_bug='$d_modfl_pow32_bug'
21436 d_modflproto='$d_modflproto'
21437 d_mprotect='$d_mprotect'
21439 d_msg_ctrunc='$d_msg_ctrunc'
21440 d_msg_dontroute='$d_msg_dontroute'
21441 d_msg_oob='$d_msg_oob'
21442 d_msg_peek='$d_msg_peek'
21443 d_msg_proxy='$d_msg_proxy'
21444 d_msgctl='$d_msgctl'
21445 d_msgget='$d_msgget'
21446 d_msghdr_s='$d_msghdr_s'
21447 d_msgrcv='$d_msgrcv'
21448 d_msgsnd='$d_msgsnd'
21450 d_munmap='$d_munmap'
21451 d_mymalloc='$d_mymalloc'
21453 d_nl_langinfo='$d_nl_langinfo'
21454 d_nv_preserves_uv='$d_nv_preserves_uv'
21455 d_nv_zero_is_allbits_zero='$d_nv_zero_is_allbits_zero'
21456 d_off64_t='$d_off64_t'
21457 d_old_pthread_create_joinable='$d_old_pthread_create_joinable'
21458 d_oldpthreads='$d_oldpthreads'
21459 d_oldsock='$d_oldsock'
21461 d_pathconf='$d_pathconf'
21463 d_perl_otherlibdirs='$d_perl_otherlibdirs'
21464 d_phostname='$d_phostname'
21467 d_portable='$d_portable'
21468 d_procselfexe='$d_procselfexe'
21469 d_pthread_atfork='$d_pthread_atfork'
21470 d_pthread_attr_setscope='$d_pthread_attr_setscope'
21471 d_pthread_yield='$d_pthread_yield'
21473 d_pwchange='$d_pwchange'
21474 d_pwclass='$d_pwclass'
21475 d_pwcomment='$d_pwcomment'
21476 d_pwexpire='$d_pwexpire'
21477 d_pwgecos='$d_pwgecos'
21478 d_pwpasswd='$d_pwpasswd'
21479 d_pwquota='$d_pwquota'
21482 d_random_r='$d_random_r'
21483 d_readdir64_r='$d_readdir64_r'
21484 d_readdir='$d_readdir'
21485 d_readdir_r='$d_readdir_r'
21486 d_readlink='$d_readlink'
21488 d_recvmsg='$d_recvmsg'
21489 d_rename='$d_rename'
21490 d_rewinddir='$d_rewinddir'
21492 d_safebcpy='$d_safebcpy'
21493 d_safemcpy='$d_safemcpy'
21494 d_sanemcmp='$d_sanemcmp'
21495 d_sbrkproto='$d_sbrkproto'
21496 d_scalbnl='$d_scalbnl'
21497 d_sched_yield='$d_sched_yield'
21498 d_scm_rights='$d_scm_rights'
21499 d_seekdir='$d_seekdir'
21500 d_select='$d_select'
21502 d_semctl='$d_semctl'
21503 d_semctl_semid_ds='$d_semctl_semid_ds'
21504 d_semctl_semun='$d_semctl_semun'
21505 d_semget='$d_semget'
21507 d_sendmsg='$d_sendmsg'
21508 d_setegid='$d_setegid'
21509 d_seteuid='$d_seteuid'
21510 d_setgrent='$d_setgrent'
21511 d_setgrent_r='$d_setgrent_r'
21512 d_setgrps='$d_setgrps'
21513 d_sethent='$d_sethent'
21514 d_sethostent_r='$d_sethostent_r'
21515 d_setitimer='$d_setitimer'
21516 d_setlinebuf='$d_setlinebuf'
21517 d_setlocale='$d_setlocale'
21518 d_setlocale_r='$d_setlocale_r'
21519 d_setnent='$d_setnent'
21520 d_setnetent_r='$d_setnetent_r'
21521 d_setpent='$d_setpent'
21522 d_setpgid='$d_setpgid'
21523 d_setpgrp2='$d_setpgrp2'
21524 d_setpgrp='$d_setpgrp'
21525 d_setprior='$d_setprior'
21526 d_setproctitle='$d_setproctitle'
21527 d_setprotoent_r='$d_setprotoent_r'
21528 d_setpwent='$d_setpwent'
21529 d_setpwent_r='$d_setpwent_r'
21530 d_setregid='$d_setregid'
21531 d_setresgid='$d_setresgid'
21532 d_setresuid='$d_setresuid'
21533 d_setreuid='$d_setreuid'
21534 d_setrgid='$d_setrgid'
21535 d_setruid='$d_setruid'
21536 d_setsent='$d_setsent'
21537 d_setservent_r='$d_setservent_r'
21538 d_setsid='$d_setsid'
21539 d_setvbuf='$d_setvbuf'
21543 d_shmatprototype='$d_shmatprototype'
21544 d_shmctl='$d_shmctl'
21546 d_shmget='$d_shmget'
21547 d_sigaction='$d_sigaction'
21548 d_sigprocmask='$d_sigprocmask'
21549 d_sigsetjmp='$d_sigsetjmp'
21550 d_sitearch='$d_sitearch'
21551 d_snprintf='$d_snprintf'
21552 d_sockatmark='$d_sockatmark'
21553 d_sockatmarkproto='$d_sockatmarkproto'
21554 d_socket='$d_socket'
21555 d_socklen_t='$d_socklen_t'
21556 d_sockpair='$d_sockpair'
21557 d_socks5_init='$d_socks5_init'
21558 d_sprintf_returns_strlen='$d_sprintf_returns_strlen'
21560 d_srand48_r='$d_srand48_r'
21561 d_srandom_r='$d_srandom_r'
21562 d_sresgproto='$d_sresgproto'
21563 d_sresuproto='$d_sresuproto'
21564 d_statblks='$d_statblks'
21565 d_statfs_f_flags='$d_statfs_f_flags'
21566 d_statfs_s='$d_statfs_s'
21567 d_statvfs='$d_statvfs'
21568 d_stdio_cnt_lval='$d_stdio_cnt_lval'
21569 d_stdio_ptr_lval='$d_stdio_ptr_lval'
21570 d_stdio_ptr_lval_nochange_cnt='$d_stdio_ptr_lval_nochange_cnt'
21571 d_stdio_ptr_lval_sets_cnt='$d_stdio_ptr_lval_sets_cnt'
21572 d_stdio_stream_array='$d_stdio_stream_array'
21573 d_stdiobase='$d_stdiobase'
21574 d_stdstdio='$d_stdstdio'
21575 d_strchr='$d_strchr'
21576 d_strcoll='$d_strcoll'
21577 d_strctcpy='$d_strctcpy'
21578 d_strerrm='$d_strerrm'
21579 d_strerror='$d_strerror'
21580 d_strerror_r='$d_strerror_r'
21581 d_strftime='$d_strftime'
21582 d_strlcat='$d_strlcat'
21583 d_strlcpy='$d_strlcpy'
21584 d_strtod='$d_strtod'
21585 d_strtol='$d_strtol'
21586 d_strtold='$d_strtold'
21587 d_strtoll='$d_strtoll'
21588 d_strtoq='$d_strtoq'
21589 d_strtoul='$d_strtoul'
21590 d_strtoull='$d_strtoull'
21591 d_strtouq='$d_strtouq'
21592 d_strxfrm='$d_strxfrm'
21593 d_suidsafe='$d_suidsafe'
21594 d_symlink='$d_symlink'
21595 d_syscall='$d_syscall'
21596 d_syscallproto='$d_syscallproto'
21597 d_sysconf='$d_sysconf'
21598 d_sysernlst='$d_sysernlst'
21599 d_syserrlst='$d_syserrlst'
21600 d_system='$d_system'
21601 d_tcgetpgrp='$d_tcgetpgrp'
21602 d_tcsetpgrp='$d_tcsetpgrp'
21603 d_telldir='$d_telldir'
21604 d_telldirproto='$d_telldirproto'
21607 d_tm_tm_gmtoff='$d_tm_tm_gmtoff'
21608 d_tm_tm_zone='$d_tm_tm_zone'
21609 d_tmpnam_r='$d_tmpnam_r'
21610 d_truncate='$d_truncate'
21611 d_ttyname_r='$d_ttyname_r'
21612 d_tzname='$d_tzname'
21613 d_u32align='$d_u32align'
21614 d_ualarm='$d_ualarm'
21617 d_union_semun='$d_union_semun'
21618 d_unordered='$d_unordered'
21619 d_unsetenv='$d_unsetenv'
21620 d_usleep='$d_usleep'
21621 d_usleepproto='$d_usleepproto'
21623 d_vendorarch='$d_vendorarch'
21624 d_vendorbin='$d_vendorbin'
21625 d_vendorlib='$d_vendorlib'
21626 d_vendorscript='$d_vendorscript'
21628 d_void_closedir='$d_void_closedir'
21629 d_voidsig='$d_voidsig'
21630 d_voidtty='$d_voidtty'
21631 d_volatile='$d_volatile'
21632 d_vprintf='$d_vprintf'
21633 d_vsnprintf='$d_vsnprintf'
21635 d_waitpid='$d_waitpid'
21636 d_wcstombs='$d_wcstombs'
21637 d_wctomb='$d_wctomb'
21638 d_writev='$d_writev'
21641 db_hashtype='$db_hashtype'
21642 db_prefixtype='$db_prefixtype'
21643 db_version_major='$db_version_major'
21644 db_version_minor='$db_version_minor'
21645 db_version_patch='$db_version_patch'
21646 defvoidused='$defvoidused'
21647 direntrytype='$direntrytype'
21650 doublesize='$doublesize'
21652 drand48_r_proto='$drand48_r_proto'
21653 dynamic_ext='$dynamic_ext'
21659 endgrent_r_proto='$endgrent_r_proto'
21660 endhostent_r_proto='$endhostent_r_proto'
21661 endnetent_r_proto='$endnetent_r_proto'
21662 endprotoent_r_proto='$endprotoent_r_proto'
21663 endpwent_r_proto='$endpwent_r_proto'
21664 endservent_r_proto='$endservent_r_proto'
21665 eunicefix='$eunicefix'
21668 extensions='$extensions'
21670 fflushNULL='$fflushNULL'
21671 fflushall='$fflushall'
21673 firstmakefile='$firstmakefile'
21675 fpossize='$fpossize'
21676 fpostype='$fpostype'
21677 freetype='$freetype'
21680 full_csh='$full_csh'
21681 full_sed='$full_sed'
21682 gccansipedantic='$gccansipedantic'
21683 gccosandvers='$gccosandvers'
21684 gccversion='$gccversion'
21685 getgrent_r_proto='$getgrent_r_proto'
21686 getgrgid_r_proto='$getgrgid_r_proto'
21687 getgrnam_r_proto='$getgrnam_r_proto'
21688 gethostbyaddr_r_proto='$gethostbyaddr_r_proto'
21689 gethostbyname_r_proto='$gethostbyname_r_proto'
21690 gethostent_r_proto='$gethostent_r_proto'
21691 getlogin_r_proto='$getlogin_r_proto'
21692 getnetbyaddr_r_proto='$getnetbyaddr_r_proto'
21693 getnetbyname_r_proto='$getnetbyname_r_proto'
21694 getnetent_r_proto='$getnetent_r_proto'
21695 getprotobyname_r_proto='$getprotobyname_r_proto'
21696 getprotobynumber_r_proto='$getprotobynumber_r_proto'
21697 getprotoent_r_proto='$getprotoent_r_proto'
21698 getpwent_r_proto='$getpwent_r_proto'
21699 getpwnam_r_proto='$getpwnam_r_proto'
21700 getpwuid_r_proto='$getpwuid_r_proto'
21701 getservbyname_r_proto='$getservbyname_r_proto'
21702 getservbyport_r_proto='$getservbyport_r_proto'
21703 getservent_r_proto='$getservent_r_proto'
21704 getspnam_r_proto='$getspnam_r_proto'
21705 gidformat='$gidformat'
21711 gmtime_r_proto='$gmtime_r_proto'
21712 gnulibc_version='$gnulibc_version'
21714 groupcat='$groupcat'
21715 groupstype='$groupstype'
21718 h_sysfile='$h_sysfile'
21721 html1dir='$html1dir'
21722 html1direxp='$html1direxp'
21723 html3dir='$html3dir'
21724 html3direxp='$html3direxp'
21733 i_arpainet='$i_arpainet'
21734 i_bsdioctl='$i_bsdioctl'
21738 i_dirent='$i_dirent'
21744 i_fp_class='$i_fp_class'
21747 i_ieeefp='$i_ieeefp'
21748 i_inttypes='$i_inttypes'
21749 i_langinfo='$i_langinfo'
21750 i_libutil='$i_libutil'
21751 i_limits='$i_limits'
21752 i_locale='$i_locale'
21753 i_machcthr='$i_machcthr'
21754 i_malloc='$i_malloc'
21756 i_memory='$i_memory'
21757 i_mntent='$i_mntent'
21760 i_neterrno='$i_neterrno'
21761 i_netinettcp='$i_netinettcp'
21765 i_pthread='$i_pthread'
21767 i_rpcsvcdbm='$i_rpcsvcdbm'
21770 i_shadow='$i_shadow'
21772 i_stdarg='$i_stdarg'
21773 i_stddef='$i_stddef'
21774 i_stdlib='$i_stdlib'
21775 i_string='$i_string'
21776 i_sunmath='$i_sunmath'
21777 i_sysaccess='$i_sysaccess'
21778 i_sysdir='$i_sysdir'
21779 i_sysfile='$i_sysfile'
21780 i_sysfilio='$i_sysfilio'
21782 i_sysioctl='$i_sysioctl'
21783 i_syslog='$i_syslog'
21784 i_sysmman='$i_sysmman'
21785 i_sysmode='$i_sysmode'
21786 i_sysmount='$i_sysmount'
21787 i_sysndir='$i_sysndir'
21788 i_sysparam='$i_sysparam'
21789 i_sysresrc='$i_sysresrc'
21790 i_syssecrt='$i_syssecrt'
21791 i_sysselct='$i_sysselct'
21792 i_syssockio='$i_syssockio'
21793 i_sysstat='$i_sysstat'
21794 i_sysstatfs='$i_sysstatfs'
21795 i_sysstatvfs='$i_sysstatvfs'
21796 i_systime='$i_systime'
21797 i_systimek='$i_systimek'
21798 i_systimes='$i_systimes'
21799 i_systypes='$i_systypes'
21800 i_sysuio='$i_sysuio'
21802 i_sysutsname='$i_sysutsname'
21803 i_sysvfs='$i_sysvfs'
21804 i_syswait='$i_syswait'
21805 i_termio='$i_termio'
21806 i_termios='$i_termios'
21808 i_unistd='$i_unistd'
21811 i_values='$i_values'
21812 i_varargs='$i_varargs'
21813 i_varhdr='$i_varhdr'
21815 ignore_versioned_solibs='$ignore_versioned_solibs'
21816 inc_version_list='$inc_version_list'
21817 inc_version_list_init='$inc_version_list_init'
21820 initialinstalllocation='$initialinstalllocation'
21821 installarchlib='$installarchlib'
21822 installbin='$installbin'
21823 installhtml1dir='$installhtml1dir'
21824 installhtml3dir='$installhtml3dir'
21825 installman1dir='$installman1dir'
21826 installman3dir='$installman3dir'
21827 installprefix='$installprefix'
21828 installprefixexp='$installprefixexp'
21829 installprivlib='$installprivlib'
21830 installscript='$installscript'
21831 installsitearch='$installsitearch'
21832 installsitebin='$installsitebin'
21833 installsitehtml1dir='$installsitehtml1dir'
21834 installsitehtml3dir='$installsitehtml3dir'
21835 installsitelib='$installsitelib'
21836 installsiteman1dir='$installsiteman1dir'
21837 installsiteman3dir='$installsiteman3dir'
21838 installsitescript='$installsitescript'
21839 installstyle='$installstyle'
21840 installusrbinperl='$installusrbinperl'
21841 installvendorarch='$installvendorarch'
21842 installvendorbin='$installvendorbin'
21843 installvendorhtml1dir='$installvendorhtml1dir'
21844 installvendorhtml3dir='$installvendorhtml3dir'
21845 installvendorlib='$installvendorlib'
21846 installvendorman1dir='$installvendorman1dir'
21847 installvendorman3dir='$installvendorman3dir'
21848 installvendorscript='$installvendorscript'
21850 issymlink='$issymlink'
21851 ivdformat='$ivdformat'
21854 known_extensions='$known_extensions'
21857 lddlflags='$lddlflags'
21859 ldflags_uselargefiles='$ldflags_uselargefiles'
21860 ldlibpthname='$ldlibpthname'
21867 libsdirs='$libsdirs'
21868 libsfiles='$libsfiles'
21869 libsfound='$libsfound'
21870 libspath='$libspath'
21871 libswanted='$libswanted'
21872 libswanted_uselargefiles='$libswanted_uselargefiles'
21878 localtime_r_proto='$localtime_r_proto'
21879 locincpth='$locincpth'
21880 loclibpth='$loclibpth'
21881 longdblsize='$longdblsize'
21882 longlongsize='$longlongsize'
21883 longsize='$longsize'
21887 lseeksize='$lseeksize'
21888 lseektype='$lseektype'
21891 madlyobj='$madlyobj'
21892 madlysrc='$madlysrc'
21896 make_set_make='$make_set_make'
21897 mallocobj='$mallocobj'
21898 mallocsrc='$mallocsrc'
21899 malloctype='$malloctype'
21901 man1direxp='$man1direxp'
21904 man3direxp='$man3direxp'
21906 mips_type='$mips_type'
21907 mistrustnm='$mistrustnm'
21909 mmaptype='$mmaptype'
21910 modetype='$modetype'
21912 multiarch='$multiarch'
21914 myarchname='$myarchname'
21915 mydomain='$mydomain'
21916 myhostname='$myhostname'
21919 need_va_copy='$need_va_copy'
21920 netdb_hlen_type='$netdb_hlen_type'
21921 netdb_host_type='$netdb_host_type'
21922 netdb_name_type='$netdb_name_type'
21923 netdb_net_type='$netdb_net_type'
21926 nm_so_opt='$nm_so_opt'
21927 nonxs_ext='$nonxs_ext'
21929 nvEUformat='$nvEUformat'
21930 nvFUformat='$nvFUformat'
21931 nvGUformat='$nvGUformat'
21932 nv_preserves_uv_bits='$nv_preserves_uv_bits'
21933 nveformat='$nveformat'
21934 nvfformat='$nvfformat'
21935 nvgformat='$nvgformat'
21938 o_nonblock='$o_nonblock'
21940 old_pthread_create_joinable='$old_pthread_create_joinable'
21941 optimize='$optimize'
21942 orderlib='$orderlib'
21945 otherlibdirs='$otherlibdirs'
21949 patchlevel='$patchlevel'
21950 path_sep='$path_sep'
21953 perl_patchlevel='$perl_patchlevel'
21954 perladmin='$perladmin'
21955 perllibs='$perllibs'
21956 perlpath='$perlpath'
21958 phostname='$phostname'
21964 prefixexp='$prefixexp'
21966 privlibexp='$privlibexp'
21967 procselfexe='$procselfexe'
21968 prototype='$prototype'
21970 quadkind='$quadkind'
21971 quadtype='$quadtype'
21972 randbits='$randbits'
21973 randfunc='$randfunc'
21974 random_r_proto='$random_r_proto'
21975 randseedtype='$randseedtype'
21977 rd_nodata='$rd_nodata'
21978 readdir64_r_proto='$readdir64_r_proto'
21979 readdir_r_proto='$readdir_r_proto'
21980 revision='$revision'
21985 sPRIEUldbl='$sPRIEUldbl'
21986 sPRIFUldbl='$sPRIFUldbl'
21987 sPRIGUldbl='$sPRIGUldbl'
21988 sPRIXU64='$sPRIXU64'
21990 sPRIeldbl='$sPRIeldbl'
21991 sPRIfldbl='$sPRIfldbl'
21992 sPRIgldbl='$sPRIgldbl'
21997 sSCNfldbl='$sSCNfldbl'
21998 sched_yield='$sched_yield'
21999 scriptdir='$scriptdir'
22000 scriptdirexp='$scriptdirexp'
22002 seedfunc='$seedfunc'
22003 selectminbits='$selectminbits'
22004 selecttype='$selecttype'
22005 sendmail='$sendmail'
22006 setgrent_r_proto='$setgrent_r_proto'
22007 sethostent_r_proto='$sethostent_r_proto'
22008 setlocale_r_proto='$setlocale_r_proto'
22009 setnetent_r_proto='$setnetent_r_proto'
22010 setprotoent_r_proto='$setprotoent_r_proto'
22011 setpwent_r_proto='$setpwent_r_proto'
22012 setservent_r_proto='$setservent_r_proto'
22015 sharpbang='$sharpbang'
22016 shmattype='$shmattype'
22017 shortsize='$shortsize'
22020 sig_count='$sig_count'
22021 sig_name='$sig_name'
22022 sig_name_init='$sig_name_init'
22024 sig_num_init='$sig_num_init'
22025 sig_size='$sig_size'
22026 signal_t='$signal_t'
22027 sitearch='$sitearch'
22028 sitearchexp='$sitearchexp'
22030 sitebinexp='$sitebinexp'
22031 sitehtml1dir='$sitehtml1dir'
22032 sitehtml1direxp='$sitehtml1direxp'
22033 sitehtml3dir='$sitehtml3dir'
22034 sitehtml3direxp='$sitehtml3direxp'
22036 sitelib_stem='$sitelib_stem'
22037 sitelibexp='$sitelibexp'
22038 siteman1dir='$siteman1dir'
22039 siteman1direxp='$siteman1direxp'
22040 siteman3dir='$siteman3dir'
22041 siteman3direxp='$siteman3direxp'
22042 siteprefix='$siteprefix'
22043 siteprefixexp='$siteprefixexp'
22044 sitescript='$sitescript'
22045 sitescriptexp='$sitescriptexp'
22046 sizesize='$sizesize'
22047 sizetype='$sizetype'
22051 sockethdr='$sockethdr'
22052 socketlib='$socketlib'
22053 socksizetype='$socksizetype'
22055 spackage='$spackage'
22056 spitshell='$spitshell'
22057 srand48_r_proto='$srand48_r_proto'
22058 srandom_r_proto='$srandom_r_proto'
22060 ssizetype='$ssizetype'
22061 startperl='$startperl'
22063 static_ext='$static_ext'
22065 stdio_base='$stdio_base'
22066 stdio_bufsiz='$stdio_bufsiz'
22067 stdio_cnt='$stdio_cnt'
22068 stdio_filbuf='$stdio_filbuf'
22069 stdio_ptr='$stdio_ptr'
22070 stdio_stream_array='$stdio_stream_array'
22071 strerror_r_proto='$strerror_r_proto'
22074 subversion='$subversion'
22078 targetarch='$targetarch'
22082 timeincl='$timeincl'
22083 timetype='$timetype'
22084 tmpnam_r_proto='$tmpnam_r_proto'
22090 ttyname_r_proto='$ttyname_r_proto'
22099 uidformat='$uidformat'
22105 uquadtype='$uquadtype'
22106 use5005threads='$use5005threads'
22107 use64bitall='$use64bitall'
22108 use64bitint='$use64bitint'
22109 usecrosscompile='$usecrosscompile'
22111 usefaststdio='$usefaststdio'
22112 useithreads='$useithreads'
22113 uselargefiles='$uselargefiles'
22114 uselongdouble='$uselongdouble'
22115 usemallocwrap='$usemallocwrap'
22116 usemorebits='$usemorebits'
22117 usemultiplicity='$usemultiplicity'
22118 usemymalloc='$usemymalloc'
22120 useopcode='$useopcode'
22121 useperlio='$useperlio'
22122 useposix='$useposix'
22123 usereentrant='$usereentrant'
22124 userelocatableinc='$userelocatableinc'
22126 useshrplib='$useshrplib'
22127 usesitecustomize='$usesitecustomize'
22128 usesocks='$usesocks'
22129 usethreads='$usethreads'
22130 usevendorprefix='$usevendorprefix'
22131 usevfork='$usevfork'
22134 uvXUformat='$uvXUformat'
22135 uvoformat='$uvoformat'
22138 uvuformat='$uvuformat'
22139 uvxformat='$uvxformat'
22140 vendorarch='$vendorarch'
22141 vendorarchexp='$vendorarchexp'
22142 vendorbin='$vendorbin'
22143 vendorbinexp='$vendorbinexp'
22144 vendorhtml1dir='$vendorhtml1dir'
22145 vendorhtml1direxp='$vendorhtml1direxp'
22146 vendorhtml3dir='$vendorhtml3dir'
22147 vendorhtml3direxp='$vendorhtml3direxp'
22148 vendorlib='$vendorlib'
22149 vendorlib_stem='$vendorlib_stem'
22150 vendorlibexp='$vendorlibexp'
22151 vendorman1dir='$vendorman1dir'
22152 vendorman1direxp='$vendorman1direxp'
22153 vendorman3dir='$vendorman3dir'
22154 vendorman3direxp='$vendorman3direxp'
22155 vendorprefix='$vendorprefix'
22156 vendorprefixexp='$vendorprefixexp'
22157 vendorscript='$vendorscript'
22158 vendorscriptexp='$vendorscriptexp'
22160 version_patchlevel_string='$version_patchlevel_string'
22161 versiononly='$versiononly'
22163 voidflags='$voidflags'
22166 yaccflags='$yaccflags'
22171 : Add in command line options if available
22172 $test -f UU/cmdline.opt && $cat UU/cmdline.opt >> config.sh
22174 : add special variables
22175 $test -f $src/patchlevel.h && \
22176 awk '/^#define[ ]+PERL_/ {printf "%s=%s\n",$2,$3}' $src/patchlevel.h >>config.sh
22177 echo "PERL_PATCHLEVEL=$perl_patchlevel" >>config.sh
22178 echo "PERL_CONFIG_SH=true" >>config.sh
22180 : propagate old symbols
22181 if $test -f UU/config.sh; then
22182 <UU/config.sh $sort | $uniq >UU/oldconfig.sh
22183 sed -n 's/^\([a-zA-Z_0-9]*\)=.*/\1/p' config.sh config.sh UU/oldconfig.sh |\
22184 $sort | $uniq -u >UU/oldsyms
22185 set X `cat UU/oldsyms`
22191 Hmm...You had some extra variables I don't know about...I'll try to keep 'em...
22193 echo "# Variables propagated from previous config.sh file." >>config.sh
22194 for sym in `cat UU/oldsyms`; do
22195 echo " Propagating $hint variable "'$'"$sym..."
22196 eval 'tmp="$'"${sym}"'"'
22198 sed -e "s/'/'\"'\"'/g" -e "s/^/$sym='/" -e "s/$/'/" >>config.sh
22204 : Finish up by extracting the .SH files
22208 echo "Extraction done."
22218 If you'd like to make any changes to the config.sh file before I begin
22219 to configure things, do it as a shell escape now (e.g. !vi config.sh).
22222 rp="Press return or use a shell escape to edit config.sh:"
22227 *) : in case they cannot read
22228 sh 1>&4 -c "$ans";;
22233 : if this fails, just run all the .SH files by hand
22242 if $contains '^depend:' [Mm]akefile >/dev/null 2>&1; then
22249 Now you need to generate make dependencies by running "$make depend".
22250 You might prefer to run it in background: "$make depend > makedepend.out &"
22251 It can take a while, so you might not want to run it right now.
22256 rp="Run $make depend now?"
22260 $make depend && echo "Now you must run '$make'."
22263 echo "You must run '$make depend' then '$make'."
22266 elif test -f [Mm]akefile; then
22268 echo "Now you must run a $make."
22270 echo "Configure done."
22273 if $test -f Policy.sh; then
22276 If you compile $package on a different machine or from a different object
22277 directory, copy the Policy.sh file from this object directory to the
22278 new one before you run Configure -- this will help you with most of
22279 the policy defaults.
22283 if $test -f config.msg; then
22284 echo "Hmm. I also noted the following information while running:"
22286 $cat config.msg >&4
22289 $rm -f kit*isdone ark*isdone