3 # If these # comments don't work, trim them. Don't worry about any other
4 # shell scripts, Configure will trim # comments from them for you.
6 # (If you are trying to port this package to a machine without sh,
7 # I would suggest you have a look at the prototypical config_h.SH file
8 # and edit it to reflect your system. Some packages may include samples
9 # of config.h for certain machines, so you might look for one of those.)
11 # Yes, you may rip this off to use in other distribution packages. This
12 # script belongs to the public domain and cannot be copyrighted.
14 # (Note: this Configure script was generated automatically. Rather than
15 # working with this copy of Configure, you may wish to get metaconfig.
16 # The dist-3.0 package (which contains metaconfig) was posted in
17 # comp.sources.misc and is available on CPAN under authors/id/RAM so
18 # you may fetch it yourself from your nearest archive site.)
21 # Though this script was generated by metaconfig, it is OK to send
22 # patches against it. It's up to the Configure pumpkin to backport
23 # the patch to the metaunits if it is accepted.
24 # See Porting/pumpkin.pod for more information on metaconfig.
27 # $Id: Head.U,v 3.0.1.9 1997/02/28 15:02:09 ram Exp $
29 # Generated on Wed Mar 8 09:08:03 CET 2006 [metaconfig 3.0 PL70]
30 # (with additional metaconfig patches by perlbug@perl.org)
35 SCO csh still thinks true is false. Write to SCO today and tell them that next
36 year Configure ought to "rm /bin/csh" unless they fix their blasted shell. :-)
38 (Actually, Configure ought to just patch csh in place. Hmm. Hmmmmm. All
39 we'd have to do is go in and swap the && and || tokens, wherever they are.)
41 [End of diatribe. We now return you to your regularly scheduled programming...]
45 OOPS! You naughty creature! You didn't run Configure with sh!
46 I will attempt to remedy the situation by running sh for you...
50 true || exec sh $0 $argv:q
52 (exit $?0) || cat c2$$
53 (exit $?0) || exec sh $0 $argv:q
56 if test -f /dev/cputype -a -f /dev/drivers -a -f /dev/osversion; then
59 *** I'm sorry but this system looks like Plan 9 and Plan 9 doesn't do
60 *** Configure that well. (Plan 9 is close to UNIX but not close enough.)
61 *** Please read the README.plan9 for further instructions.
62 *** Cannot continue, aborting.
68 : 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
348 d_attribute_format=''
349 d_attribute_malloc=''
350 d_attribute_nonnull=''
351 d_attribute_noreturn=''
353 d_attribute_unused=''
354 d_attribute_warn_unused_result=''
357 d_builtin_choose_expr=''
403 endhostent_r_proto=''
409 endprotoent_r_proto=''
415 endservent_r_proto=''
467 gethostbyaddr_r_proto=''
469 gethostbyname_r_proto=''
471 gethostent_r_proto=''
483 getnetbyaddr_r_proto=''
485 getnetbyname_r_proto=''
499 d_getprotobyname_r=''
500 getprotobyname_r_proto=''
501 d_getprotobynumber_r=''
502 getprotobynumber_r_proto=''
504 getprotoent_r_proto=''
516 getservbyname_r_proto=''
518 getservbyport_r_proto=''
520 getservent_r_proto=''
544 d_libm_lib_version=''
557 d_malloc_good_size=''
599 d_old_pthread_create_joinable=''
600 old_pthread_create_joinable=''
602 d_pthread_attr_setscope=''
641 sethostent_r_proto=''
658 setprotoent_r_proto=''
670 setservent_r_proto=''
703 d_sprintf_returns_strlen=''
718 d_stdio_ptr_lval_nochange_cnt=''
719 d_stdio_ptr_lval_sets_cnt=''
923 inc_version_list_init=''
942 ignore_versioned_solibs=''
1003 d_perl_otherlibdirs=''
1011 api_versionstring=''
1017 version_patchlevel_string=''
1021 d_nv_preserves_uv=''
1022 d_nv_zero_is_allbits_zero=''
1033 nv_preserves_uv_bits=''
1104 installsitehtml1dir=''
1107 installsitehtml3dir=''
1114 installsiteman1dir=''
1117 installsiteman3dir=''
1122 installsitescript=''
1137 d_stdio_stream_array=''
1138 stdio_stream_array=''
1149 ccflags_uselargefiles=''
1150 ldflags_uselargefiles=''
1151 libswanted_uselargefiles=''
1161 userelocatableinc=''
1172 installvendorarch=''
1179 installvendorhtml1dir=''
1181 vendorhtml1direxp=''
1182 installvendorhtml3dir=''
1184 vendorhtml3direxp=''
1190 installvendorman1dir=''
1193 installvendorman3dir=''
1200 installvendorscript=''
1212 smallmach='pdp11 i8086 z8000 i80286 iAPX286'
1215 : We must find out about Eunice early
1217 if test -f /etc/unixtovms; then
1218 eunicefix=/etc/unixtovms
1220 if test -f /etc/unixtovms.exe; then
1221 eunicefix=/etc/unixtovms.exe
1224 : Set executable suffix now -- needed before hints available
1225 if test -f "/libs/version.library"; then
1228 elif test -f "/system/gnu_library/bin/ar.pm"; then
1231 elif test -n "$DJGPP"; then
1234 elif test -d c:/. -o -n "$is_os2" ; then
1243 : set useposix=false in your hint file to disable the POSIX extension.
1245 : set useopcode=false in your hint file to disable the Opcode extension.
1247 : Trailing extension. Override this in a hint file, if needed.
1248 : Extra object files, if any, needed on this platform.
1251 : Possible local include directories to search.
1252 : Set locincpth to "" in a hint file to defeat local include searches.
1253 locincpth="/usr/local/include /opt/local/include /usr/gnu/include"
1254 locincpth="$locincpth /opt/gnu/include /usr/GNU/include /opt/GNU/include"
1256 : no include file wanted by default
1261 : change the next line if compiling for Xenix/286 on Xenix/386
1262 xlibpth='/usr/lib/386 /lib/386'
1263 : Possible local library directories to search.
1264 loclibpth="/usr/local/lib /opt/local/lib /usr/gnu/lib"
1265 loclibpth="$loclibpth /opt/gnu/lib /usr/GNU/lib /opt/GNU/lib"
1267 : general looking path for locating libraries
1268 glibpth="/lib /usr/lib $xlibpth"
1269 glibpth="$glibpth /usr/ccs/lib /usr/ucblib /usr/local/lib"
1270 test -f /usr/shlib/libc.so && glibpth="/usr/shlib $glibpth"
1271 test -f /shlib/libc.so && glibpth="/shlib $glibpth"
1273 : Private path used by Configure to find libraries. Its value
1274 : is prepended to libpth. This variable takes care of special
1275 : machines, like the mips. Usually, it should be empty.
1278 : default library list
1280 : some systems want to use only the non-versioned libso:s
1281 ignore_versioned_solibs=''
1286 ccflags_uselargefiles=''
1287 ldflags_uselargefiles=''
1288 libswanted_uselargefiles=''
1289 : set usemultiplicity on the Configure command line to enable multiplicity.
1290 : set usesocks on the Configure command line to enable socks.
1291 : set usethreads on the Configure command line to enable threads.
1292 usereentrant='undef'
1293 : full support for void wanted by default
1296 : List of libraries we want.
1297 : If anyone needs extra -lxxx, put those in a hint file.
1298 libswanted="sfio socket bind inet nsl nm ndbm gdbm dbm db malloc dl dld ld sun"
1299 libswanted="$libswanted m crypt sec util c cposix posix ucb bsd BSD"
1300 : We probably want to search /usr/shlib before most other libraries.
1301 : This is only used by the lib/ExtUtils/MakeMaker.pm routine extliblist.
1302 glibpth=`echo " $glibpth " | sed -e 's! /usr/shlib ! !'`
1303 glibpth="/usr/shlib $glibpth"
1304 : Do not use vfork unless overridden by a hint file.
1307 : Find the basic shell for Bourne shell scripts
1311 *bsd*|sys5*) xxx="/$SYSTYPE/bin/sh";;
1314 if test -f "$xxx"; then
1317 : Build up a list and do a single loop so we can 'break' out.
1318 pth=`echo $PATH | sed -e "s/$p_/ /g"`
1319 for xxx in sh bash ksh pdksh ash; do
1321 try="$try ${p}/${xxx}"
1325 if test -f "$xxx"; then
1328 elif test "X$_exe" != X -a -f "$xxx$_exe"; then
1331 elif test -f "$xxx.exe"; then
1342 $me: Fatal Error: I can't find a Bourne Shell anywhere.
1344 Usually it's in /bin/sh. How did you even get this far?
1345 Please contact me (Perl Maintainers) at perlbug@perl.org and
1346 we'll try to straighten this all out.
1352 : see if sh knows # comments
1353 if `$sh -c '#' >/dev/null 2>&1`; then
1357 test -f $xcat$_exe || xcat=/usr/bin/cat
1358 if test ! -f $xcat$_exe; then
1359 for p in `echo $PATH | sed -e "s/$p_/ /g"` $paths; do
1360 if test -f $p/cat$_exe; then
1365 if test ! -f $xcat$_exe; then
1366 echo "Can't find cat anywhere!"
1370 echo "#!$xcat" >sharp
1374 if test -s today; then
1377 echo "#! $xcat" > sharp
1381 if test -s today; then
1389 echo "Your $sh doesn't grok # comments--I will strip them later on."
1392 echo "exec grep -v '^[ ]*#'" >spitshell
1394 $eunicefix spitshell
1395 spitshell=`pwd`/spitshell
1397 echo "I presume that if # doesn't work, #! won't work either!"
1402 : figure out how to guarantee sh startup
1404 '') startsh=${sharpbang}${sh} ;;
1416 : echo "Yup, it does."
1418 echo "Hmm... '$startsh' does not guarantee sh startup..."
1419 echo "You may have to fix up the shell scripts to make sure $sh runs them."
1424 : Save command line options in file UU/cmdline.opt for later use in
1425 : generating config.sh.
1426 cat > cmdline.opt <<EOSH
1427 # Configure command line arguments.
1436 cat >>cmdline.opt <<EOSH
1437 config_arg$argn='$arg'
1439 # Extreme backslashitis: replace each ' by '"'"'
1440 cat <<EOC | sed -e "s/'/'"'"'"'"'"'"'/g" > cmdl.opt
1443 arg_exp=`cat cmdl.opt`
1444 args_exp="$args_exp$args_sep'$arg_exp'"
1445 argn=`expr $argn + 1`
1448 # args_exp is good for restarting self: eval "set X $args_exp"; shift; $0 "$@"
1449 # used by ./hints/os2.sh
1452 : produce awk script to parse command line options
1453 cat >options.awk <<'EOF'
1455 optstr = "A:dD:eEf:hKOrsSU:V"; # getopt-style specification
1457 len = length(optstr);
1458 for (i = 1; i <= len; i++) {
1459 c = substr(optstr, i, 1);
1460 if (i < len) a = substr(optstr, i + 1, 1); else a = "";
1471 if (substr(str, 1, 1) != "-") {
1472 printf("'%s'\n", str);
1476 for (i = 2; i <= len; i++) {
1477 c = substr(str, i, 1);
1479 printf("-%s\n", substr(str, i));
1485 printf("'%s'\n", substr(str, i + 1));
1498 : process the command line options
1499 set X `for arg in "$@"; do echo "X$arg"; done |
1500 sed -e s/X// | awk -f options.awk`
1505 : set up default values
1515 rm -f optdef.sh posthint.sh
1516 cat >optdef.sh <<EOS
1522 while test $# -gt 0; do
1524 -d) shift; fastread=yes;;
1525 -e) shift; alldone=cont;;
1529 if test -r "$1"; then
1532 echo "$me: cannot read config file $1." >&2
1537 -h) shift; error=true;;
1538 -r) shift; reuseval=true;;
1539 -s) shift; silent=true; realsilent=true;;
1540 -E) shift; alldone=exit;;
1541 -K) shift; knowitall=true;;
1542 -O) shift; override=true;;
1543 -S) shift; silent=true; extractsh=true;;
1548 echo "$me: use '-U symbol=', not '-D symbol='." >&2
1549 echo "$me: ignoring -D $1" >&2
1552 sed -e "s/'/'\"'\"'/g" -e "s/=\(.*\)/='\1'/" >> optdef.sh;;
1553 *) echo "$1='define'" >> optdef.sh;;
1560 *=) echo "$1" >> optdef.sh;;
1562 echo "$me: use '-D symbol=val', not '-U symbol=val'." >&2
1563 echo "$me: ignoring -U $1" >&2
1565 *) echo "$1='undef'" >> optdef.sh;;
1576 *=*) zzz=`echo "$yyy"|sed 's!=.*!!'`
1580 zzz=" "`echo "$yyy"|sed 's!^[^=]*=!!'`
1581 yyy=`echo "$yyy"|sed 's!=.*!!'` ;;
1587 *:*) xxx=`echo "$yyy"|sed 's!:.*!!'`
1588 yyy=`echo "$yyy"|sed 's!^[^:]*:!!'`
1589 zzz=`echo "$yyy"|sed 's!^[^=]*=!!'`
1590 yyy=`echo "$yyy"|sed 's!=.*!!'` ;;
1591 *) xxx=`echo "$yyy"|sed 's!:.*!!'`
1592 yyy=`echo "$yyy"|sed 's!^[^:]*:!!'` ;;
1598 echo "$yyy=\"\${$yyy}$zzz\"" >> posthint.sh ;;
1600 echo "$yyy=''" >> posthint.sh ;;
1605 echo "$yyy='$zzz'" >> posthint.sh ;;
1607 echo "eval \"$yyy=$zzz\"" >> posthint.sh ;;
1609 echo "$yyy=\"$zzz\${$yyy}\"" >> posthint.sh ;;
1614 echo "$yyy=$zzz" >> posthint.sh ;;
1615 *) echo "$me: unknown -A command '$xxx', ignoring -A $1" >&2 ;;
1619 -V) echo "$me generated by metaconfig 3.0 PL70." >&2
1622 -*) echo "$me: unknown option $1" >&2; shift; error=true;;
1630 Usage: $me [-dehrsEKOSV] [-f config.sh] [-D symbol] [-D symbol=value]
1631 [-U symbol] [-U symbol=] [-A command:symbol...]
1632 -d : use defaults for all answers.
1633 -e : go on without questioning past the production of config.sh.
1634 -f : specify an alternate default configuration file.
1635 -h : print this help message and exit (with an error status).
1636 -r : reuse C symbols value if possible (skips costly nm extraction).
1637 -s : silent mode, only echoes questions and essential information.
1638 -D : define symbol to have some value:
1639 -D symbol symbol gets the value 'define'
1640 -D symbol=value symbol gets the value 'value'
1641 -E : stop at the end of questions, after having produced config.sh.
1642 -K : do not use unless you know what you are doing.
1643 -O : let -D and -U override definitions from loaded configuration file.
1644 -S : perform variable substitutions on all .SH files (can mix with -f)
1645 -U : undefine symbol:
1646 -U symbol symbol gets the value 'undef'
1647 -U symbol= symbol gets completely empty
1648 -A : manipulate symbol after the platform specific hints have been applied:
1649 -A symbol=value append " "value to symbol
1650 -A append:symbol=value append value to symbol
1651 -A define:symbol=value define symbol to have value
1652 -A clear:symbol define symbol to be ''
1653 -A define:symbol define symbol to be 'define'
1654 -A eval:symbol=value define symbol to be eval of value
1655 -A prepend:symbol=value prepend value to symbol
1656 -A undef:symbol define symbol to be 'undef'
1657 -A undef:symbol= define symbol to be ''
1658 -V : print version number and exit (with a zero status).
1665 case "$fastread$alldone" in
1668 case "$extractsh" in
1671 if test ! -t 0; then
1672 echo "Say 'sh Configure', not 'sh <Configure'"
1682 true) exec 1>/dev/null;;
1685 : run the defines and the undefines, if any, but leave the file out there...
1688 : create the posthint manipulation script and leave the file out there...
1693 first=`echo $package | sed -e 's/^\(.\).*/\1/'`
1694 last=`echo $package | sed -e 's/^.\(.*\)/\1/'`
1695 case "`echo AbyZ | tr '[:lower:]' '[:upper:]' 2>/dev/null`" in
1696 ABYZ) spackage=`echo $first | tr '[:lower:]' '[:upper:]'`$last;;
1697 *) spackage=`echo $first | tr '[a-z]' '[A-Z]'`$last;;
1700 : Some greps do not return status, grrr.
1701 echo "grimblepritz" >grimble
1702 if grep blurfldyick grimble >/dev/null 2>&1 ; then
1704 elif grep grimblepritz grimble >/dev/null 2>&1 ; then
1710 : the following should work in any shell
1714 echo "AGH! Grep doesn't return a status. Attempting remedial action."
1715 cat >contains <<'EOSS'
1716 grep "$1" "$2" >.greptmp && cat .greptmp && test -s .greptmp
1721 : Find the path to the source tree
1724 */*) src=`echo $0 | sed -e 's%/[^/][^/]*$%%'`
1728 *) src=`cd ../$src && pwd` ;;
1741 if test -f $rsrc/Configure && \
1742 $contains "^package=$package$" $rsrc/Configure >/dev/null 2>&1
1744 : found it, so we are ok.
1747 for src in . .. ../.. ../../.. ../../../..; do
1748 if test -f ../$src/Configure && \
1749 $contains "^package=$package$" ../$src/Configure >/dev/null 2>&1
1760 Sorry, I can't seem to locate the source dir for $package. Please start
1761 Configure with an explicit path -- i.e. /some/path/Configure.
1769 echo "Sources for $package found in \"$src\"." >&4
1773 : script used to extract .SH files with variable substitutions
1774 cat >extract <<'EOS'
1776 echo "Doing variable substitutions on .SH files..."
1777 if test -f MANIFEST; then
1778 set x `awk '{print $1}' < MANIFEST | grep '\.SH$'`
1780 echo "(Looking for .SH files under the source directory.)"
1781 set x `(cd "$src"; find . -name "*.SH" -print)`
1785 0) set x `(cd "$src"; echo *.SH)`; shift;;
1787 if test ! -f "$src/$1"; then
1793 while test $name; do
1794 if test ! -d "$name"; then
1795 create="$name $create";
1796 name=`echo $name | sed -e "s|^[^/]*$||"`;
1797 name=`echo $name | sed -e "s|\(.*\)/.*|\1|"`;
1802 for file in $create; do
1811 dir=`expr X$file : 'X\(.*\)/'`
1812 file=`expr X$file : 'X.*/\(.*\)'`
1813 (cd "$dir" && . ./$file)
1823 dir=`expr X$file : 'X\(.*\)/'`
1824 file=`expr X$file : 'X.*/\(.*\)'`
1825 (set x $dir; shift; eval $mkdir_p)
1826 sh <"$src/$dir/$file"
1835 if test -f "$src/config_h.SH"; then
1836 if test ! -f config.h; then
1837 : oops, they left it out of MANIFEST, probably, so do it anyway.
1838 . "$src/config_h.SH"
1843 : extract files and exit if asked to do so
1844 case "$extractsh" in
1846 case "$realsilent" in
1850 case "$config_sh" in
1851 '') config_sh='config.sh';;
1854 echo "Fetching answers from $config_sh..."
1857 test "$override" && . ./optdef.sh
1861 echo "Extraction done."
1866 : Eunice requires " " instead of "", can you believe it
1869 echo "Beginning of configuration questions for $package."
1871 trap 'echo " "; test -d ../UU && rm -rf X $rmlist; exit 1' 1 2 3 15
1873 : first determine how to suppress newline on echo command
1875 echo "Checking echo to see how to suppress newlines..."
1876 (echo "hi there\c" ; echo " ") >.echotmp
1877 if $contains c .echotmp >/dev/null 2>&1 ; then
1888 echo $n "The star should be here-->$c"
1892 : Now test for existence of everything in MANIFEST
1894 if test -f "$rsrc/MANIFEST"; then
1895 echo "First let's make sure your kit is complete. Checking..." >&4
1896 awk '$1 !~ /PACK[A-Z]+/ {print $1}' "$rsrc/MANIFEST" | (split -l 50 2>/dev/null || split -50)
1899 for filelist in x??; do
1900 (cd "$rsrc"; ls `cat "$tmppwd/$filelist"` >/dev/null 2>>"$tmppwd/missing")
1902 if test -s missing; then
1906 THIS PACKAGE SEEMS TO BE INCOMPLETE.
1908 You have the option of continuing the configuration process, despite the
1909 distinct possibility that your kit is damaged, by typing 'y'es. If you
1910 do, don't blame me if something goes wrong. I advise you to type 'n'o
1911 and contact the author (perlbug@perl.org).
1914 echo $n "Continue? [n] $c" >&4
1918 echo "Continuing..." >&4
1922 echo "ABORTING..." >&4
1927 echo "Looks good..."
1930 echo "There is no MANIFEST file. I hope your kit is complete !"
1935 : Find the appropriate value for a newline for tr
1936 if test -n "$DJGPP"; then
1939 if test X"$trnl" = X; then
1940 case "`echo foo|tr '\n' x 2>/dev/null`" in
1944 if test X"$trnl" = X; then
1945 case "`echo foo|tr '\012' x 2>/dev/null`" in
1946 foox) trnl='\012' ;;
1949 if test X"$trnl" = X; then
1950 case "`echo foo|tr '\r\n' xy 2>/dev/null`" in
1951 fooxy) trnl='\n\r' ;;
1954 if test X"$trnl" = X; then
1957 $me: Fatal Error: cannot figure out how to translate newlines with 'tr'.
1963 : compute the number of columns on the terminal for proper question formatting
1968 : set up the echo used in my read
1969 myecho="case \"\$xxxm\" in
1970 '') echo $n \"\$rp $c\" >&4;;
1972 '') echo $n \"[\$xxxm] $c\";;
1974 if test \`echo \"\$rp [\$xxxm] \" | wc -c\` -ge $COLUMNS; then
1976 echo $n \"[\$xxxm] $c\" >&4
1978 echo $n \"\$rp [\$xxxm] $c\" >&4
1984 : now set up to do reads with possible shell escape and default assignment
1990 case "\$fastread" in
1991 yes) case "\$dflt" in
1994 case "\$silent-\$rp" in
1999 *) case "\$silent" in
2000 true) case "\$rp" in
2005 while expr "X\$ans" : "X!" >/dev/null; do
2009 aok=''; eval "ans=\\"\$answ\\"" && aok=y
2017 set x \`expr "X\$ans" : "X!\(.*\)\$"\`
2026 set x \`expr "X\$ans" : "X&\(.*\)\$"\`
2031 echo "(OK, I'll run with -d after this question.)" >&4
2034 echo "*** Sorry, \$1 not supported yet." >&4
2044 echo "*** Substitution done -- please confirm."
2046 ans=\`echo $n "\$ans$c" | tr '$trnl' ' '\`
2051 echo "*** Error -- try again."
2058 case "\$ans\$xxxm\$nostick" in
2070 : create .config dir to save info across Configure sessions
2071 test -d ../.config || mkdir ../.config
2072 cat >../.config/README <<EOF
2073 This directory created by Configure to save information that should
2074 persist across sessions for $package.
2076 You may safely delete it if you wish.
2079 xversion=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
2081 $define|true|[yY]*) ;;
2082 *) case "$xversion" in
2085 *** WHOA THERE!!! ***
2087 This is an UNSTABLE DEVELOPMENT release.
2088 The version of this $package distribution is $xversion, that is, odd,
2089 (as opposed to even) and that signifies a development release.
2090 If you want a maintenance release, you want an even-numbered version.
2092 Do ***NOT*** install this into production use.
2093 Data corruption and crashes are possible.
2095 It is most seriously suggested that you do not continue any further
2096 unless you want to help in developing and debugging Perl.
2098 If you *still* want to build perl, you can answer 'y' now,
2099 or pass -Dusedevel to Configure.
2102 rp='Do you really want to continue?'
2106 [yY]) echo >&4 "Okay, continuing."
2107 usedevel="$define" ;;
2108 *) echo >&4 "Okay, bye."
2118 case "$versiononly" in
2119 '') versiononly="$define" ;;
2121 case "$installusrbinperl" in
2122 '') installusrbinperl="$undef" ;;
2127 : general instructions
2130 user=`(logname) 2>/dev/null`
2132 '') user=`whoami 2>&1`;;
2134 if $contains "^$user\$" ../.config/instruct >/dev/null 2>&1; then
2137 rp='Would you like to see the instructions?'
2148 This installation shell script will examine your system and ask you questions
2149 to determine how the perl5 package should be installed. If you get
2150 stuck on a question, you may use a ! shell escape to start a subshell or
2151 execute a command. Many of the questions will have default answers in square
2152 brackets; typing carriage return will give you the default.
2154 On some of the questions which ask for file or directory names you are allowed
2155 to use the ~name construct to specify the login directory belonging to "name",
2156 even if you don't have a shell which knows about that. Questions where this is
2157 allowed will be marked "(~name ok)".
2161 dflt='Type carriage return to continue'
2165 The prompter used in this script allows you to use shell variables and
2166 backticks in your answers. You may use $1, $2, etc... to refer to the words
2167 in the default answer, as if the default line was a set of arguments given to a
2168 script shell. This means you may also use $* to repeat the whole default line,
2169 so you do not have to re-type everything to add something to the default.
2171 Everytime there is a substitution, you will have to confirm. If there is an
2172 error (e.g. an unmatched backtick), the default answer will remain unchanged
2173 and you will be prompted again.
2175 If you are in a hurry, you may run 'Configure -d'. This will bypass nearly all
2176 the questions and use the computed defaults (or the previous answers if there
2177 was already a config.sh file). Type 'Configure -h' for a list of options.
2178 You may also start interactively and then answer '& -d' at any prompt to turn
2179 on the non-interactive behaviour for the remainder of the execution.
2185 Much effort has been expended to ensure that this shell script will run on any
2186 Unix system. If despite that it blows up on yours, your best bet is to edit
2187 Configure and run it again. If you can't run Configure for some reason,
2188 you'll have to generate a config.sh file by hand. Whatever problems you
2189 have, let me (perlbug@perl.org) know how I blew it.
2191 This installation script affects things in two ways:
2193 1) it may do direct variable substitutions on some of the files included
2195 2) it builds a config.h file for inclusion in C programs. You may edit
2196 any of these files as the need arises after running this script.
2198 If you make a mistake on a question, there is no easy way to back up to it
2199 currently. The easiest thing to do is to edit config.sh and rerun all the SH
2200 files. Configure will offer to let you do this before it runs the SH files.
2203 dflt='Type carriage return to continue'
2205 case "$firsttime" in
2206 true) echo $user >>../.config/instruct;;
2210 : find out where common programs are
2212 echo "Locating common programs..." >&4
2225 if test -d \$dir/\$thing; then
2231 for thisthing in \$dir/\$thing; do
2232 : just loop through to pick last item
2234 if test -f \$thisthing; then
2237 elif test "X$_exe" != X -a -f \$thisthing$_exe; then
2240 elif test -f \$dir/\$thing.exe; then
2241 if test -n "$DJGPP"; then
2242 echo \$dir/\$thing.exe
2243 elif test "$eunicefix" != ":"; then
2244 : on Eunice apparently
2298 pth=`echo $PATH | sed -e "s/$p_/ /g"`
2299 pth="$pth /lib /usr/lib"
2300 for file in $loclist; do
2304 if test -f "$xxx"; then
2307 echo "WARNING: no $xxx -- ignoring your setting for $file." >&4
2308 xxx=`./loc $file $file $pth`
2311 '') xxx=`./loc $file $file $pth`;;
2312 *) xxx=`./loc $xxx $xxx $pth`;;
2314 eval $file=$xxx$_exe
2318 echo $file is in $xxx.
2321 echo $file is in $xxx.
2324 echo "I don't know where '$file' is, and my life depends on it." >&4
2325 echo "Go find a public domain implementation or fix your PATH setting!" >&4
2331 echo "Don't worry if any of the following aren't found..."
2333 for file in $trylist; do
2337 if test -f "$xxx"; then
2340 echo "WARNING: no $xxx -- ignoring your setting for $file." >&4
2341 xxx=`./loc $file $file $pth`
2344 '') xxx=`./loc $file $file $pth`;;
2345 *) xxx=`./loc $xxx $xxx $pth`;;
2347 eval $file=$xxx$_exe
2351 echo $file is in $xxx.
2354 echo $file is in $xxx.
2357 echo "I don't see $file out there, $say."
2364 echo "Substituting grep for egrep."
2371 echo "Substituting cp for ln."
2380 echo "I can't find make or gmake, and my life depends on it." >&4
2381 echo "Go find a public domain implementation or fix your PATH setting!" >&4
2389 *) # We can't have osname yet.
2390 if test -f "/system/gnu_library/bin/ar.pm"; then # Stratus VOS
2391 # Assume that gmake, if found, is definitely GNU make
2392 # and prefer it over the system make.
2393 echo "Substituting gmake for make."
2401 echo "Hopefully test is built into your sh."
2404 if `sh -c "PATH= test true" >/dev/null 2>&1`; then
2405 echo "Using the test built into your sh."
2413 echo "Hopefully echo is built into your sh."
2418 echo "Checking compatibility between $echo and builtin echo (if any)..." >&4
2419 $echo $n "hi there$c" >foo1
2420 echo $n "hi there$c" >foo2
2421 if cmp foo1 foo2 >/dev/null 2>&1; then
2422 echo "They are compatible. In fact, they may be identical."
2429 They are not compatible! You are probably running ksh on a non-USG system.
2430 I'll have to use $echo instead of the builtin, since Bourne shell doesn't
2431 have echo built in and we may have to run some Bourne shell scripts. That
2432 means I'll have to use '$n$c' to suppress newlines now. Life is ridiculous.
2435 $echo $n "The star should be here-->$c"
2445 cat <<'EOSC' >>trygcc
2450 int main(int argc, char *argv[]) {
2454 if $cc -o try $ccflags $ldflags try.c; then
2457 echo "Uh-oh, the C compiler '$cc' doesn't seem to be working." >&4
2463 case "`$cc -v -c try.c 2>&1`" in
2466 if $test X"$trygcc" = Xyes; then
2467 if gcc -o try -c try.c; then
2469 echo "You seem to have a working gcc, though." >&4
2470 rp="Would you like to use it?"
2472 if $test -f myread; then
2475 if $test -f UU/myread; then
2478 echo "Cannot find myread, sorry. Aborting." >&2
2483 [yY]*) cc=gcc; ccname=gcc; ccflags=''; despair=no;
2484 if $test -f usethreads.cbu; then
2487 *** However, any setting of the C compiler flags (e.g. for thread support)
2488 *** has been lost. It may be necessary to pass -Dcc=gcc to Configure
2489 *** (together with e.g. -Dusethreads).
2505 cat <<'EOSC' >>checkcc
2510 int main(int argc, char *argv[]) {
2514 if $cc -o try $ccflags $ldflags try.c; then
2517 if $test X"$despair" = Xyes; then
2518 echo "Uh-oh, the C compiler '$cc' doesn't seem to be working." >&4
2521 You need to find a working C compiler.
2522 Either (purchase and) install the C compiler supplied by your OS vendor,
2523 or for a free C compiler try http://gcc.gnu.org/
2524 I cannot continue any further, aborting.
2533 : determine whether symbolic links are supported
2536 if $ln -s blurfl sym > /dev/null 2>&1 ; then
2537 echo "Symbolic links are supported." >&4
2540 echo "Symbolic links are NOT supported." >&4
2545 : determine whether symbolic links are supported
2549 echo "Checking how to test for symbolic links..." >&4
2551 if $test "X$issymlink" = X; then
2553 '') sh -c "PATH= test -h sym" >/dev/null 2>&1 ;;
2554 *) $newsh -c "PATH= test -h sym" >/dev/null 2>&1 ;;
2556 if test $? = 0; then
2559 echo "Your builtin 'test -h' may be broken." >&4
2562 *) pth=`echo $PATH | sed -e "s/$p_/ /g"`
2565 if test -f "$p/$test"; then
2574 echo "Trying external '$test -h'." >&4
2575 issymlink="$test -h"
2576 if $test ! -h sym >/dev/null 2>&1; then
2577 echo "External '$test -h' is broken, too." >&4
2585 if $test "X$issymlink" = X; then
2586 if $test -L sym 2>/dev/null; then
2587 issymlink="$test -L"
2588 echo "The builtin '$test -L' worked." >&4
2591 if $test "X$issymlink" != X; then
2592 echo "You can test for symbolic links with '$issymlink'." >&4
2594 echo "I do not know how you can test for symbolic links." >&4
2598 *) echo "No symbolic links, so not testing for their testing..." >&4
2604 case "$mksymlinks" in
2607 ''|'.') echo "Cannot create symlinks in the original directory." >&4
2610 *) case "$lns:$issymlink" in
2611 *"ln"*" -s:"*"test -"?)
2612 echo "Creating the symbolic links..." >&4
2613 echo "(First creating the subdirectories...)" >&4
2615 awk '{print $1}' $src/MANIFEST | grep / | sed 's:/[^/]*$::' | sort -u | while true; do
2617 test -z "$directory" && break
2621 if test ! -d t/base; then
2622 echo "Failed to create the subdirectories. Aborting." >&4
2625 echo "(Then creating the symlinks...)" >&4
2626 awk '{print $1}' $src/MANIFEST | while true; do
2628 test -z "$filename" && break
2629 if test -f $filename; then
2630 if $issymlink $filename; then
2634 if test -f $filename; then
2635 echo "$filename already exists, not symlinking."
2637 ln -s $src/$filename $filename
2641 if test ! -f t/base/lex.t; then
2642 echo "Failed to create the symlinks (t/base/lex.t missing). Aborting." >&4
2647 *) echo "(I cannot figure out how to do symbolic links, ignoring mksymlinks)." >&4
2656 case "$usecrosscompile" in
2658 $echo "Cross-compiling..."
2661 *-*-gcc) # A cross-compiling gcc, probably.
2662 targetarch=`$echo $cc|$sed 's/-gcc$//'`
2664 # leave out ld, choosing it is more complex
2666 ranlib=$targetarch-ranlib
2667 $echo 'extern int foo;' > try.c
2668 set X `$cc -v -E try.c 2>&1 | $awk '/^#include </,/^End of search /'|$grep '/include'`
2670 if $test $# -gt 0; then
2672 incpth="`$echo $incpth|$sed 's/^ //'`"
2673 echo "Guessing incpth '$incpth'." >&4
2675 j="`$echo $i|$sed 's,/include$,/lib,'`"
2676 if $test -d $j; then
2680 libpth="`$echo $libpth|$sed 's/^ //'`"
2681 echo "Guessing libpth '$libpth'." >&4
2686 case "$targetarch" in
2687 '') echo "Targetarch not defined." >&4; croak=y ;;
2688 *) echo "Using targetarch $targetarch." >&4 ;;
2691 '') echo "Incpth not defined." >&4; croak=y ;;
2692 *) echo "Using incpth '$incpth'." >&4 ;;
2695 '') echo "Libpth not defined." >&4; croak=y ;;
2696 *) echo "Using libpth '$libpth'." >&4 ;;
2699 '') for i in $incpth; do
2700 if $test -f $i/errno.h -a -f $i/stdio.h -a -f $i/time.h; then
2702 echo "Guessing usrinc $usrinc." >&4
2707 '') echo "Usrinc not defined." >&4; croak=y ;;
2710 *) echo "Using usrinc $usrinc." >&4 ;;
2712 case "$targethost" in
2713 '') echo "Targethost not defined." >&4; croak=y ;;
2714 *) echo "Using targethost $targethost." >&4
2719 y) echo "Cannot continue, aborting." >&4; exit 1 ;;
2722 /*) run=$src/Cross/run
2723 targetmkdir=$src/Cross/mkdir
2725 from=$src/Cross/from
2727 *) pwd=`$test -f ../Configure & cd ..; pwd`
2729 targetmkdir=$pwd/Cross/mkdir
2731 from=$pwd/Cross/from
2734 case "$targetrun" in
2735 '') targetrun=ssh ;;
2740 case "$targetfrom" in
2741 '') targetfrom=scp ;;
2745 from=$from-$targetfrom
2746 case "$targetdir" in
2748 echo "Guessing targetdir $targetdir." >&4
2751 case "$targetuser" in
2753 echo "Guessing targetuser $targetuser." >&4
2756 case "$targetfrom" in
2760 case "$targetrun" in
2772 '') cwd=$targetdir ;;
2776 if $test ! -f \$exe.xok; then
2780 $targetrun -l $targetuser $targethost "cd \$cwd && ./\$exe \$@"
2783 *) echo "Unknown targetrun '$targetrun'" >&4
2787 case "$targetmkdir" in
2789 cat >$targetmkdir <<EOF
2791 $targetrun -l $targetuser $targethost "mkdir -p \$@"
2793 $chmod a+rx $targetmkdir
2795 *) echo "Unknown targetmkdir '$targetmkdir'" >&4
2807 $targetmkdir \`dirname \$f\`
2808 $targetto $q \$f $targetuser@$targethost:\$f || exit 1
2811 $targetmkdir $targetdir/\`dirname \$f\`
2812 $targetto $q \$f $targetuser@$targethost:$targetdir/\$f || exit 1
2825 $mkdir -p $targetdir/\`dirname \$f\`
2826 $cp \$f $targetdir/\$f || exit 1
2829 $targetmkdir $targetdir/\`dirname \$f\`
2830 $cp \$f $targetdir/\$f || exit 1
2837 *) echo "Unknown targetto '$targetto'" >&4
2841 case "$targetfrom" in
2848 $targetfrom $q $targetuser@$targethost:$targetdir/\$f . || exit 1
2853 cp) cat >$from <<EOF
2858 cp $targetdir/\$f . || exit 1
2863 *) echo "Unknown targetfrom '$targetfrom'" >&4
2867 if $test ! -f $run; then
2868 echo "Target 'run' script '$run' not found." >&4
2872 if $test ! -f $to; then
2873 echo "Target 'to' script '$to' not found." >&4
2877 if $test ! -f $from; then
2878 echo "Target 'from' script '$from' not found." >&4
2882 if $test ! -f $run -o ! -f $to -o ! -f $from; then
2886 Using '$run' for remote execution,
2887 and '$from' and '$to'
2888 for remote file transfer.
2894 usecrosscompile='undef'
2899 : see whether [:lower:] and [:upper:] are supported character classes
2901 case "`echo AbyZ | $tr '[:lower:]' '[:upper:]' 2>/dev/null`" in
2903 echo "Good, your tr supports [:lower:] and [:upper:] to convert case." >&4
2907 *) # There is a discontinuity in EBCDIC between 'R' and 'S'
2908 # (0xd9 and 0xe2), therefore that is a nice testing point.
2909 if test "X$up" = X -o "X$low" = X; then
2910 case "`echo RS | $tr '[R-S]' '[r-s]' 2>/dev/null`" in
2916 if test "X$up" = X -o "X$low" = X; then
2917 case "`echo RS | $tr R-S r-s 2>/dev/null`" in
2923 if test "X$up" = X -o "X$low" = X; then
2924 case "`echo RS | od -x 2>/dev/null`" in
2926 echo "Hey, this might be EBCDIC." >&4
2927 if test "X$up" = X -o "X$low" = X; then
2928 case "`echo RS | $tr '[A-IJ-RS-Z]' '[a-ij-rs-z]' 2>/dev/null`" in
2929 rs) up='[A-IJ-RS-Z]'
2934 if test "X$up" = X -o "X$low" = X; then
2935 case "`echo RS | $tr A-IJ-RS-Z a-ij-rs-z 2>/dev/null`" in
2945 case "`echo RS | $tr \"$up\" \"$low\" 2>/dev/null`" in
2947 echo "Using $up and $low to convert case." >&4
2950 echo "I don't know how to translate letters from upper to lower case." >&4
2951 echo "Your tr is not acting any way I know of." >&4
2955 : set up the translation script tr, must be called with ./tr of course
2959 '[A-Z][a-z]') exec $tr '$up' '$low';;
2960 '[a-z][A-Z]') exec $tr '$low' '$up';;
2967 : Try to determine whether config.sh was made on this system
2968 case "$config_sh" in
2970 myuname=`$uname -a 2>/dev/null`
2971 $test -z "$myuname" && myuname=`hostname 2>/dev/null`
2972 # tr '[A-Z]' '[a-z]' would not work in EBCDIC
2973 # because the A-Z/a-z are not consecutive.
2974 myuname=`echo $myuname | $sed -e 's/^[^=]*=//' -e 's/\///g' | \
2975 ./tr '[A-Z]' '[a-z]' | $tr $trnl ' '`
2976 newmyuname="$myuname"
2978 case "$knowitall" in
2980 if test -f ../config.sh; then
2981 if $contains myuname= ../config.sh >/dev/null 2>&1; then
2982 eval "`grep myuname= ../config.sh`"
2984 if test "X$myuname" = "X$newmyuname"; then
2992 : Get old answers from old config file if Configure was run on the
2993 : same system, otherwise use the hints.
2996 if test -f config.sh; then
2998 rp="I see a config.sh file. Shall I use it to set the defaults?"
3001 n*|N*) echo "OK, I'll ignore it."
3002 mv config.sh config.sh.old
3003 myuname="$newmyuname"
3005 *) echo "Fetching default answers from your old config.sh file..." >&4
3013 : Older versions did not always set $sh. Catch re-use of such
3023 if test ! -f config.sh; then
3026 First time through, eh? I have some defaults handy for some systems
3027 that need some extra help getting the Configure answers right:
3030 (cd $src/hints; ls -C *.sh) | $sed 's/\.sh/ /g' >&4
3032 : Half the following guesses are probably wrong... If you have better
3033 : tests or hints, please send them to perlbug@perl.org
3034 : The metaconfig authors would also appreciate a copy...
3035 $test -f /irix && osname=irix
3036 $test -f /xenix && osname=sco_xenix
3037 $test -f /dynix && osname=dynix
3038 $test -f /dnix && osname=dnix
3039 $test -f /lynx.os && osname=lynxos
3040 $test -f /unicos && osname=unicos && osvers=`$uname -r`
3041 $test -f /unicosmk && osname=unicosmk && osvers=`$uname -r`
3042 $test -f /unicosmk.ar && osname=unicosmk && osvers=`$uname -r`
3043 $test -f /bin/mips && /bin/mips && osname=mips
3044 $test -d /NextApps && set X `hostinfo | grep 'NeXT Mach.*:' | \
3045 $sed -e 's/://' -e 's/\./_/'` && osname=next && osvers=$4
3046 $test -d /usr/apollo/bin && osname=apollo
3047 $test -f /etc/saf/_sactab && osname=svr4
3048 $test -d /usr/include/minix && osname=minix
3049 $test -f /system/gnu_library/bin/ar.pm && osname=vos
3050 if $test -d /MachTen -o -d /MachTen_Folder; then
3052 if $test -x /sbin/version; then
3053 osvers=`/sbin/version | $awk '{print $2}' |
3054 $sed -e 's/[A-Za-z]$//'`
3055 elif $test -x /usr/etc/version; then
3056 osvers=`/usr/etc/version | $awk '{print $2}' |
3057 $sed -e 's/[A-Za-z]$//'`
3063 $test -f /sys/posix.dll &&
3064 $test -f /usr/bin/what &&
3065 set X `/usr/bin/what /sys/posix.dll` &&
3066 $test "$3" = UWIN &&
3070 if $test -f $uname; then
3078 umips) osname=umips ;;
3081 [23]100) osname=mips ;;
3082 next*) osname=next ;;
3084 tmp=`/bin/uname -X 2>/dev/null|awk '/3\.2v[45]/{ print $(NF) }'`
3085 if $test "$tmp" != "" -a "$3" = "3.2" -a -f '/etc/systemid'; then
3088 elif $test -f /etc/kconfig; then
3090 if test "$lns" = "$ln -s"; then
3092 elif $contains _SYSV3 /usr/include/stdio.h > /dev/null 2>&1 ; then
3094 elif $contains _POSIX_SOURCE /usr/include/stdio.h > /dev/null 2>&1 ; then
3101 if test -n "$DJGPP"; then
3110 tmp=`( (oslevel) 2>/dev/null || echo "not found") 2>&1`
3112 # oslevel can fail with:
3113 # oslevel: Unable to acquire lock.
3114 *not\ found) osvers="$4"."$3" ;;
3115 '<3240'|'<>3240') osvers=3.2.0 ;;
3116 '=3240'|'>3240'|'<3250'|'<>3250') osvers=3.2.4 ;;
3117 '=3250'|'>3250') osvers=3.2.5 ;;
3121 bsd386) osname=bsd386
3124 cygwin*) osname=cygwin
3127 *dc.osx) osname=dcosx
3133 domainos) osname=apollo
3139 dragonfly) osname=dragonfly
3142 dynixptx*) osname=dynixptx
3143 osvers=`echo "$4"|sed 's/^v//'`
3145 freebsd) osname=freebsd
3147 genix) osname=genix ;;
3151 osvers=`echo "$3" | $sed 's,.*\.\([0-9]*\.[0-9]*\),\1,'`
3167 netbsd*) osname=netbsd
3170 news-os) osvers="$3"
3172 4*) osname=newsos4 ;;
3176 next*) osname=next ;;
3177 nonstop-ux) osname=nonstopux ;;
3178 openbsd) osname=openbsd
3184 POSIX-BC | posix-bc ) osname=posix-bc
3187 powerux | power_ux | powermax_os | powermaxos | \
3188 powerunix | power_unix) osname=powerux
3194 solaris) osname=solaris
3196 5*) osvers=`echo $3 | $sed 's/^5/2/g'` ;;
3203 osvers=`echo $3 | $sed 's/^5/2/g'` ;;
3207 titanos) osname=titanos
3216 ultrix) osname=ultrix
3219 osf1|mls+) case "$5" in
3222 osvers=`sizer -v | awk -FUNIX '{print $2}' | awk '{print $1}' | tr '[A-Z]' '[a-z]' | sed 's/^[xvt]//'`
3225 *) osvers=`echo "$3" | sed 's/^[xvt]//'` ;;
3228 hp*) osname=hp_osf1 ;;
3229 mips) osname=mips_osf1 ;;
3232 # UnixWare 7.1.2 is known as Open UNIX 8
3233 openunix|unixware) osname=svr5
3241 $2) case "$osname" in
3245 : svr4.x or possibly later
3255 if test -f /stand/boot ; then
3256 eval `grep '^INITPROG=[a-z/0-9]*$' /stand/boot`
3257 if test -n "$INITPROG" -a -f "$INITPROG"; then
3258 isesix=`strings -a $INITPROG|grep 'ESIX SYSTEM V/386 Release 4.0'`
3259 if test -n "$isesix"; then
3267 *) if test -f /etc/systemid; then
3269 set `echo $3 | $sed 's/\./ /g'` $4
3270 if $test -f $src/hints/sco_$1_$2_$3.sh; then
3272 elif $test -f $src/hints/sco_$1_$2.sh; then
3274 elif $test -f $src/hints/sco_$1.sh; then
3279 '') : Still unknown. Probably a generic Sys V.
3288 *) case "$osname" in
3289 '') : Still unknown. Probably a generic BSD.
3297 if test -f /vmunix -a -f $src/hints/news_os.sh; then
3298 (what /vmunix | UU/tr '[A-Z]' '[a-z]') > UU/kernel.what 2>&1
3299 if $contains news-os UU/kernel.what >/dev/null 2>&1; then
3302 $rm -f UU/kernel.what
3303 elif test -d c:/. -o -n "$is_os2" ; then
3310 case "$targetarch" in
3313 osname=`echo $targetarch|sed 's,^[^-]*-,,'`
3318 : Now look for a hint file osname_osvers, unless one has been
3319 : specified already.
3322 file=`echo "${osname}_${osvers}" | $sed -e 's%\.%_%g' -e 's%_$%%'`
3323 : Also try without trailing minor version numbers.
3324 xfile=`echo $file | $sed -e 's%_[^_]*$%%'`
3325 xxfile=`echo $xfile | $sed -e 's%_[^_]*$%%'`
3326 xxxfile=`echo $xxfile | $sed -e 's%_[^_]*$%%'`
3327 xxxxfile=`echo $xxxfile | $sed -e 's%_[^_]*$%%'`
3330 *) case "$osvers" in
3333 *) if $test -f $src/hints/$file.sh ; then
3335 elif $test -f $src/hints/$xfile.sh ; then
3337 elif $test -f $src/hints/$xxfile.sh ; then
3339 elif $test -f $src/hints/$xxxfile.sh ; then
3341 elif $test -f $src/hints/$xxxxfile.sh ; then
3343 elif $test -f "$src/hints/${osname}.sh" ; then
3352 if $test -f Policy.sh ; then
3355 none) dflt="Policy" ;;
3356 *) dflt="Policy $dflt" ;;
3361 dflt=`echo $hintfile | $sed 's/\.sh$//'`
3365 if $test -f Policy.sh ; then
3368 There's also a Policy hint file available, which should make the
3369 site-specific (policy) questions easier to answer.
3376 You may give one or more space-separated answers, or "none" if appropriate.
3377 A well-behaved OS will have no hints, so answering "none" or just "Policy"
3378 is a good thing. DO NOT give a wrong version or a wrong OS.
3382 rp="Which of these apply, if any?"
3385 for file in $tans; do
3386 if $test X$file = XPolicy -a -f Policy.sh; then
3388 $cat Policy.sh >> UU/config.sh
3389 elif $test -f $src/hints/$file.sh; then
3390 . $src/hints/$file.sh
3391 $cat $src/hints/$file.sh >> UU/config.sh
3392 elif $test X"$tans" = X -o X"$tans" = Xnone ; then
3395 : Give one chance to correct a possible typo.
3396 echo "$file.sh does not exist"
3398 rp="hint to use instead?"
3400 for file in $ans; do
3401 if $test -f "$src/hints/$file.sh"; then
3402 . $src/hints/$file.sh
3403 $cat $src/hints/$file.sh >> UU/config.sh
3404 elif $test X$ans = X -o X$ans = Xnone ; then
3407 echo "$file.sh does not exist -- ignored."
3414 : Remember our hint file for later.
3415 if $test -f "$src/hints/$file.sh" ; then
3425 echo "Fetching default answers from $config_sh..." >&4
3429 cp $config_sh config.sh 2>/dev/null
3439 test "$override" && . ./optdef.sh
3441 : Restore computed paths
3442 for file in $loclist $trylist; do
3443 eval $file="\$_$file"
3448 Configure uses the operating system name and version to set some defaults.
3449 The default value is probably right if the name rings a bell. Otherwise,
3450 since spelling matters for me, either accept the default or answer "none"
3457 ''|' '|none) dflt=none ;;
3458 *) dflt=`echo $hintfile | $sed -e 's/\.sh$//' -e 's/_.*$//'` ;;
3461 *) dflt="$osname" ;;
3463 rp="Operating system name?"
3467 *) osname=`echo "$ans" | $sed -e 's/[ ][ ]*/_/g' | ./tr '[A-Z]' '[a-z]'`;;
3473 ''|' '|none) dflt=none ;;
3474 *) dflt=`echo $hintfile | $sed -e 's/\.sh$//' -e 's/^[^_]*//'`
3475 dflt=`echo $dflt | $sed -e 's/^_//' -e 's/_/./g'`
3477 ''|' ') dflt=none ;;
3482 *) dflt="$osvers" ;;
3484 rp="Operating system version?"
3494 : who configured the system
3495 cf_time=`LC_ALL=C; LANGUAGE=C; export LC_ALL; export LANGUAGE; $date 2>&1`
3498 cf_by=`(logname) 2>/dev/null`
3501 cf_by=`(whoami) 2>/dev/null`
3503 "") cf_by=unknown ;;
3508 : set up the script used to warn in case of inconsistency
3515 echo "*** WHOA THERE!!! ***" >&4
3516 echo " The $hint value for \$$var on this machine was \"$was\"!" >&4
3517 rp=" Keep the $hint value?"
3520 y) td=$was; tu=$was;;
3524 : function used to set $1 to $val
3525 setvar='var=$1; eval "was=\$$1"; td=$define; tu=$undef;
3527 $define$undef) . ./whoa; eval "$var=\$td";;
3528 $undef$define) . ./whoa; eval "$var=\$tu";;
3529 *) eval "$var=$val";;
3533 $define|true|[yY]*) dflt='y';;
3538 Perl can be built to use the SOCKS proxy protocol library. To do so,
3539 Configure must be run with -Dusesocks. If you use SOCKS you also need
3540 to use the PerlIO abstraction layer, this will be implicitly selected.
3542 If this doesn't make any sense to you, just accept the default '$dflt'.
3544 rp='Build Perl for SOCKS?'
3547 y|Y) val="$define" ;;
3554 $define|true|[yY]*) useperlio="$define";;
3557 case "$useperlio" in
3558 $define|true|[yY]*|'') dflt='y';;
3563 Previous version of $package used the standard IO mechanisms as
3564 defined in <stdio.h>. Versions 5.003_02 and later of $package allow
3565 alternate IO mechanisms via the PerlIO abstraction layer, but the
3566 stdio mechanism is still available if needed. The abstraction layer
3567 can use AT&T's sfio (if you already have sfio installed) or regular stdio.
3568 Using PerlIO with sfio may cause problems with some extension modules.
3570 If this doesn't make any sense to you, just accept the default '$dflt'.
3572 rp='Use the PerlIO abstraction layer?'
3579 echo "Ok, doing things the stdio way."
3588 case "$useperlio" in
3589 $define|true|[yY]*) ;;
3592 You are using the SOCKS proxy protocol library which means that you
3593 should also use the PerlIO layer. You may be headed for trouble.
3602 case "$usethreads" in
3603 $define|true|[yY]*) dflt='y';;
3604 *) # Catch case where user specified ithreads or 5005threads but
3605 # forgot -Dusethreads (A.D. 4/2002)
3606 case "$useithreads$use5005threads" in
3608 case "$useperlio" in
3609 "$define") dflt='y' ;;
3619 Perl can be built to take advantage of threads on some systems.
3620 To do so, Configure can be run with -Dusethreads.
3622 Note that Perl built with threading support runs slightly slower
3623 and uses more memory than plain Perl. The current implementation
3624 is believed to be stable, but it is fairly new, and so should be
3625 treated with caution.
3627 If this doesn't make any sense to you, just accept the default '$dflt'.
3629 rp='Build a threading Perl?'
3632 y|Y) val="$define" ;;
3638 case "$usethreads" in
3642 Since release 5.6, Perl has had two different threading implementations,
3643 the newer interpreter-based version (ithreads) with one interpreter per
3644 thread, and the older 5.005 version (5005threads).
3645 The 5005threads version is effectively unmaintained and will probably be
3646 removed in Perl 5.10, so there should be no need to build a Perl using it
3647 unless needed for backwards compatibility with some existing 5.005threads
3651 : Default to ithreads unless overridden on command line or with
3654 case "$use5005threads" in
3655 $define|true|[yY]*) dflt='n';;
3657 case "$useithreads" in
3658 $undef|false|[nN]*) dflt='n';;
3660 rp='Use the newer interpreter-based ithreads?'
3663 y|Y) val="$define" ;;
3668 : Now set use5005threads to the opposite value.
3669 case "$useithreads" in
3670 $define) val="$undef" ;;
3677 useithreads="$undef"
3678 use5005threads="$undef"
3682 case "$useithreads$use5005threads" in
3686 You cannot have both the ithreads and the 5.005 threads enabled
3687 at the same time. Disabling the 5.005 threads since they are
3688 much less stable than the ithreads.
3691 use5005threads="$undef"
3695 if test X"$usethreads" = "X$define" -a "X$useperlio" = "Xundef"; then
3698 *** To build with ithreads you must also use the PerlIO layer.
3699 *** Cannot continue, aborting.
3705 case "$d_oldpthreads" in
3706 '') : Configure tests would be welcome here. For now, assume undef.
3708 *) val="$d_oldpthreads" ;;
3714 : Look for a hint-file generated 'call-back-unit'. If the
3715 : user has specified that a threading perl is to be built,
3716 : we may need to set or change some other defaults.
3717 if $test -f usethreads.cbu; then
3718 echo "Your platform has some specific hints regarding threaded builds, using them..."
3721 case "$usethreads" in
3722 "$define"|true|[yY]*)
3724 (Your platform does not have any specific hints for threaded builds.
3725 Assuming POSIX threads, then.)
3733 Perl can be built so that multiple Perl interpreters can coexist
3734 within the same Perl executable.
3737 case "$useithreads" in
3740 This multiple interpreter support is required for interpreter-based threads.
3744 *) case "$usemultiplicity" in
3745 $define|true|[yY]*) dflt='y';;
3749 echo "If this doesn't make any sense to you, just accept the default '$dflt'."
3750 rp='Build Perl for multiplicity?'
3753 y|Y) val="$define" ;;
3762 case "$usemorebits" in
3763 "$define"|true|[yY]*)
3764 use64bitint="$define"
3765 uselongdouble="$define"
3766 usemorebits="$define"
3768 *) usemorebits="$undef"
3772 : make some quick guesses about what we are up against
3774 $echo $n "Hmm... $c"
3784 $cat /usr/include/signal.h /usr/include/sys/signal.h >foo 2>/dev/null
3785 if test -f /osf_boot || $contains 'OSF/1' /usr/include/ctype.h >/dev/null 2>&1
3787 echo "Looks kind of like an OSF/1 system, but we'll see..."
3789 elif test `echo abc | $tr a-z A-Z` = Abc ; then
3790 xxx=`./loc addbib blurfl $pth`
3791 if $test -f $xxx; then
3792 echo "Looks kind of like a USG system with BSD features, but we'll see..."
3796 if $contains SIGTSTP foo >/dev/null 2>&1 ; then
3797 echo "Looks kind of like an extended USG system, but we'll see..."
3799 echo "Looks kind of like a USG system, but we'll see..."
3803 elif $contains SIGTSTP foo >/dev/null 2>&1 ; then
3804 echo "Looks kind of like a BSD system, but we'll see..."
3808 echo "Looks kind of like a Version 7 system, but we'll see..."
3811 case "$eunicefix" in
3814 There is, however, a strange, musty smell in the air that reminds me of
3815 something...hmm...yes...I've got it...there's a VMS nearby, or I'm a Blit.
3819 : it so happens the Eunice I know will not run shell scripts in Unix format
3823 echo "Congratulations. You aren't running Eunice."
3827 : Detect OS2. The p_ variable is set above in the Head.U unit.
3828 : Note that this also -- wrongly -- detects e.g. dos-djgpp, which also uses
3829 : semicolon as a patch separator
3834 I have the feeling something is not exactly right, however...don't tell me...
3835 lemme think...does HAL ring a bell?...no, of course, you're only running OS/2!
3836 (Or you may be running DOS with DJGPP.)
3841 if test -f /xenix; then
3842 echo "Actually, this looks more like a XENIX system..."
3847 echo "It's not Xenix..."
3852 if test -f /venix; then
3853 echo "Actually, this looks more like a VENIX system..."
3860 echo "Nor is it Venix..."
3863 chmod +x bsd usg v7 osf1 eunice xenix venix os2
3864 $eunicefix bsd usg v7 osf1 eunice xenix venix os2
3871 rp="Use which C compiler?"
3875 : See if they have not cc but they do have gcc
3877 : Look for a hint-file generated 'call-back-unit'. Now that the
3878 : user has specified the compiler, we may need to set or change some
3880 if $test -f cc.cbu; then
3886 echo "Checking for GNU cc in disguise and/or its version number..." >&4
3892 printf("%s\n", __VERSION__);
3894 printf("%s\n", "1");
3900 if $cc -o try $ccflags $ldflags try.c; then
3901 gccversion=`$run ./try`
3902 case "$gccversion" in
3903 '') echo "You are not using GNU cc." ;;
3904 *) echo "You are using GNU cc $gccversion."
3910 echo "*** WHOA THERE!!! ***" >&4
3911 echo " Your C compiler \"$cc\" doesn't seem to be working!" >&4
3912 case "$knowitall" in
3914 echo " You'd better start hunting for one and let me know about it." >&4
3920 case "$gccversion" in
3921 1*) cpp=`./loc gcc-cpp $cpp $pth` ;;
3923 case "$gccversion" in
3924 '') gccosandvers='' ;;
3925 *) gccshortvers=`echo "$gccversion"|sed 's/ .*//'`
3926 gccosandvers=`$cc -v 2>&1|grep '/specs$'|sed "s!.*/[^-/]*-[^-/]*-\([^-/]*\)/$gccshortvers/specs!\1!"`
3928 case "$gccosandvers" in
3929 $osname) gccosandvers='' ;; # linux gccs seem to have no linux osvers, grr
3930 $osname$osvers) ;; # looking good
3931 $osname*) cat <<EOM >&4
3933 *** WHOA THERE!!! ***
3935 Your gcc has not been compiled for the exact release of
3936 your operating system ($gccosandvers versus $osname$osvers).
3938 In general it is a good idea to keep gcc synchronized with
3939 the operating system because otherwise serious problems
3940 may ensue when trying to compile software, like Perl.
3942 I'm trying to be optimistic here, though, and will continue.
3943 If later during the configuration and build icky compilation
3944 problems appear (headerfile conflicts being the most common
3945 manifestation), I suggest reinstalling the gcc to match
3946 your operating system release.
3950 *) gccosandvers='' ;; # failed to parse, better be silent
3958 # gcc 3.* complain about adding -Idirectories that they already know about,
3959 # so we will take those off from locincpth.
3960 case "$gccversion" in
3962 echo "main(){}">try.c
3963 for incdir in $locincpth; do
3964 warn=`$cc $ccflags -I$incdir -c try.c 2>&1 | \
3965 grep '^c[cp]p*[01]: warning: changing search order '`
3966 if test "X$warn" != X; then
3967 locincpth=`echo " $locincpth " | sed "s! $incdir ! !"`
3973 : decide how portable to be. Allow command line overrides.
3974 case "$d_portable" in
3976 *) d_portable="$define" ;;
3979 : set up shell script to do ~ expansion
3985 echo \$1 | $sed "s|~|\${HOME-\$LOGDIR}|"
3988 if $test -f /bin/csh; then
3989 /bin/csh -f -c "glob \$1"
3994 name=\`$expr x\$1 : '..\([^/]*\)'\`
3995 dir=\`$sed -n -e "/^\${name}:/{s/^[^:]*:[^:]*:[^:]*:[^:]*:[^:]*:\([^:]*\).*"'\$'"/\1/" -e p -e q -e '}' </etc/passwd\`
3996 if $test ! -d "\$dir"; then
3998 echo "\$me: can't locate home directory for: \$name" >&2
4003 echo \$dir/\`$expr x\$1 : '..[^/]*/\(.*\)'\`
4019 : now set up to get a file name
4023 cat <<'EOSC' >>getfile
4039 : getfile will accept an answer from the comma-separated list
4040 : enclosed in parentheses even if it does not meet other criteria.
4041 expr "$fn" : '.*(\(.*\)).*' | $tr ',' $trnl >getfile.ok
4042 fn=`echo $fn | sed 's/(.*)//'`
4048 loc_file=`expr $fn : '.*:\(.*\)'`
4049 fn=`expr $fn : '\(.*\):.*'`
4057 */*) fullpath=true;;
4066 *e*) exp_file=true;;
4069 *p*) nopath_ok=true;;
4074 *d*) type='Directory';;
4075 *l*) type='Locate';;
4080 Locate) what='File';;
4085 case "$d_portable" in
4093 while test "$type"; do
4098 true) rp="$rp (~name ok)";;
4101 if test -f UU/getfile.ok && \
4102 $contains "^$ans\$" UU/getfile.ok >/dev/null 2>&1
4121 value=`UU/filexp $ans`
4124 if test "$ans" != "$value"; then
4125 echo "(That expands to $value on this system.)"
4139 /*) value="$ansexp" ;;
4140 [a-zA-Z]:/*) value="$ansexp" ;;
4145 echo "I shall only accept a full path name, as in /bin/ls." >&4
4146 echo "Use a ! shell escape if you wish to check pathnames." >&4
4149 echo "Please give a full path name, starting with slash." >&4
4152 echo "Note that using ~name is ok provided it expands well." >&4
4165 for fp in $gfpth; do
4166 if test "X$fp" = X.; then
4171 if test -f "$pf"; then
4173 elif test -r "$pf" || (test -h "$pf") >/dev/null 2>&1
4175 echo "($value is not a plain file, but that's ok.)"
4178 if test X"$type" = X; then
4185 for fp in $gfpth; do
4186 if test "X$fp" = X.; then
4191 direxp="$fp/$ansexp"
4193 if test -d "$direxp"; then
4201 if test -d "$ansexp"; then
4202 echo "(Looking for $loc_file in directory $value.)"
4203 value="$value/$loc_file"
4204 ansexp="$ansexp/$loc_file"
4206 if test -f "$ansexp"; then
4209 case "$nopath_ok" in
4210 true) case "$value" in
4212 *) echo "Assuming $value will be in people's path."
4228 if test "$fastread" = yes; then
4233 rp="$what $value doesn't exist. Use that name anyway?"
4252 test "X$gfpthkeep" != Xy && gfpth=""
4255 : What should the include directory be ?
4257 $echo $n "Hmm... $c"
4261 if $test -f /bin/mips && /bin/mips; then
4262 echo "Looks like a MIPS system..."
4263 $cat >usr.c <<'EOCP'
4264 #ifdef SYSTYPE_BSD43
4268 if cc -E usr.c > usr.out && $contains / usr.out >/dev/null 2>&1; then
4269 dflt='/bsd43/usr/include'
4273 mips_type='System V'
4275 $rm -f usr.c usr.out
4276 echo "and you're compiling with the $mips_type compiler and libraries."
4280 echo "Doesn't look like a MIPS system."
4290 case "$xxx_prompt" in
4293 rp='Where are the include files you want to use?'
4301 : see how we invoke the C preprocessor
4303 echo "Now, how can we feed standard input to your C preprocessor..." >&4
4304 cat <<'EOT' >testcpp.c
4310 if test ! -f cppstdin; then
4311 if test "X$osname" = "Xaix" -a "X$gccversion" = X; then
4312 # AIX cc -E doesn't show the absolute headerfile
4313 # locations but we'll cheat by using the -M flag.
4314 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
4316 echo 'cat >.$$.c; '"$cc"' -E ${1+"$@"} .$$.c; rm .$$.c' >cppstdin
4319 echo "Keeping your $hint cppstdin wrapper."
4322 wrapper=`pwd`/cppstdin
4326 if $test "X$cppstdin" != "X" && \
4327 $cppstdin $cppminus <testcpp.c >testcpp.out 2>&1 && \
4328 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
4330 echo "You used to use $cppstdin $cppminus so we'll use that again."
4332 '') echo "But let's see if we can live without a wrapper..." ;;
4334 if $cpprun $cpplast <testcpp.c >testcpp.out 2>&1 && \
4335 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
4337 echo "(And we'll use $cpprun $cpplast to preprocess directly.)"
4340 echo "(However, $cpprun $cpplast does not work, let's see...)"
4348 echo "Good old $cppstdin $cppminus does not seem to be of any help..."
4355 elif echo 'Maybe "'"$cc"' -E" will work...'; \
4356 $cc -E <testcpp.c >testcpp.out 2>&1; \
4357 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4358 echo "Yup, it does."
4361 elif echo 'Nope...maybe "'"$cc"' -E -" will work...'; \
4362 $cc -E - <testcpp.c >testcpp.out 2>&1; \
4363 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4364 echo "Yup, it does."
4367 elif echo 'Nope...maybe "'"$cc"' -P" will work...'; \
4368 $cc -P <testcpp.c >testcpp.out 2>&1; \
4369 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4370 echo "Yipee, that works!"
4373 elif echo 'Nope...maybe "'"$cc"' -P -" will work...'; \
4374 $cc -P - <testcpp.c >testcpp.out 2>&1; \
4375 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4376 echo "At long last!"
4379 elif echo 'No such luck, maybe "'$cpp'" will work...'; \
4380 $cpp <testcpp.c >testcpp.out 2>&1; \
4381 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4385 elif echo 'Nixed again...maybe "'$cpp' -" will work...'; \
4386 $cpp - <testcpp.c >testcpp.out 2>&1; \
4387 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4388 echo "Hooray, it works! I was beginning to wonder."
4391 elif echo 'Uh-uh. Time to get fancy. Trying a wrapper...'; \
4392 $wrapper <testcpp.c >testcpp.out 2>&1; \
4393 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4399 rp="No dice. I can't find a C preprocessor. Name one:"
4403 $x_cpp <testcpp.c >testcpp.out 2>&1
4404 if $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4405 echo "OK, that will do." >&4
4407 echo "Sorry, I can't get that to work. Go find one and rerun Configure." >&4
4422 echo "Perhaps can we force $cc -E using a wrapper..."
4423 if $wrapper <testcpp.c >testcpp.out 2>&1; \
4424 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
4430 echo "Nope, we'll have to live without it..."
4444 "$wrapper"|'cppstdin') ;;
4445 *) $rm -f $wrapper;;
4447 $rm -f testcpp.c testcpp.out
4449 : Set private lib path
4452 plibpth="$incpath/usr/lib /usr/local/lib /usr/ccs/lib"
4457 '') dlist="$loclibpth $plibpth $glibpth";;
4458 *) dlist="$libpth";;
4461 : Now check and see which directories actually exist, avoiding duplicates
4465 if $test -d $xxx; then
4468 *) libpth="$libpth $xxx";;
4474 Some systems have incompatible or broken versions of libraries. Among
4475 the directories listed in the question below, please remove any you
4476 know not to be holding relevant libraries, and add any that are needed.
4477 Say "none" for none.
4488 rp="Directories to use for library searches?"
4495 : compute shared library extension
4498 if xxx=`./loc libc.sl X $libpth`; $test -f "$xxx"; then
4508 On some systems, shared libraries may be available. Answer 'none' if
4509 you want to suppress searching of shared libraries for the remainder
4510 of this configuration.
4513 rp='What is the file extension used for shared libraries?'
4517 : Define several unixisms.
4518 : Hints files or command line option can be used to override them.
4519 : The convoluted testing is in case hints files set either the old
4522 '') case "$exe_ext" in
4524 *) _exe="$exe_ext" ;;
4529 '') case "$lib_ext" in
4536 '') case "$obj_ext" in
4543 '') case "$path_sep" in
4554 : Which makefile gets called first. This is used by make depend.
4555 case "$firstmakefile" in
4556 '') firstmakefile='makefile';;
4560 *-DUSE_LONG_DOUBLE*|*-DUSE_MORE_BITS*) uselongdouble="$define" ;;
4563 case "$uselongdouble" in
4564 $define|true|[yY]*) dflt='y';;
4569 Perl can be built to take advantage of long doubles which
4570 (if available) may give more accuracy and range for floating point numbers.
4572 If this doesn't make any sense to you, just accept the default '$dflt'.
4574 rp='Try to use long doubles if available?'
4577 y|Y) val="$define" ;;
4583 case "$uselongdouble" in
4584 true|[yY]*) uselongdouble="$define" ;;
4587 : Look for a hint-file generated 'call-back-unit'. If the
4588 : user has specified that long doubles should be used,
4589 : we may need to set or change some other defaults.
4590 if $test -f uselongdouble.cbu; then
4591 echo "Your platform has some specific hints regarding long doubles, using them..."
4592 . ./uselongdouble.cbu
4594 case "$uselongdouble" in
4597 (Your platform does not have any specific hints for long doubles.)
4603 : Looking for optional libraries
4605 echo "Checking for optional libraries..." >&4
4610 case "$libswanted" in
4611 '') libswanted='c_s';;
4614 "$define") libswanted="$libswanted socks5 socks5_sh" ;;
4620 for thisdir in $libpth $xlibpth; do
4621 test -d $thisdir && libspath="$libspath $thisdir"
4623 for thislib in $libswanted; do
4624 for thisdir in $libspath; do
4626 if $test ! -f "$xxx" -a "X$ignore_versioned_solibs" = "X"; then
4627 xxx=`ls $thisdir/lib$thislib.$so.[0-9] 2>/dev/null|sed -n '$p'`
4628 $test -f "$xxx" && eval $libscheck
4629 $test -f "$xxx" && libstyle=shared
4631 if test ! -f "$xxx"; then
4632 xxx=$thisdir/lib$thislib.$so
4633 $test -f "$xxx" && eval $libscheck
4634 $test -f "$xxx" && libstyle=shared
4636 if test ! -f "$xxx"; then
4637 xxx=$thisdir/lib$thislib$_a
4638 $test -f "$xxx" && eval $libscheck
4639 $test -f "$xxx" && libstyle=static
4641 if test ! -f "$xxx"; then
4642 xxx=$thisdir/$thislib$_a
4643 $test -f "$xxx" && eval $libscheck
4644 $test -f "$xxx" && libstyle=static
4646 if test ! -f "$xxx"; then
4647 xxx=$thisdir/lib${thislib}_s$_a
4648 $test -f "$xxx" && eval $libscheck
4649 $test -f "$xxx" && libstyle=static
4650 $test -f "$xxx" && thislib=${thislib}_s
4652 if test ! -f "$xxx"; then
4653 xxx=$thisdir/Slib$thislib$_a
4654 $test -f "$xxx" && eval $libscheck
4655 $test -f "$xxx" && libstyle=static
4657 if $test -f "$xxx"; then
4659 shared) echo "Found -l$thislib (shared)." ;;
4660 static) echo "Found -l$thislib." ;;
4661 *) echo "Found -l$thislib ($libstyle)." ;;
4665 *) dflt="$dflt -l$thislib"
4666 libsfound="$libsfound $xxx"
4668 libsfiles="$libsfiles $yyy"
4669 yyy=`echo $xxx|$sed -e "s%/$yyy\\$%%"`
4670 case " $libsdirs " in
4672 *) libsdirs="$libsdirs $yyy" ;;
4679 if $test ! -f "$xxx"; then
4680 echo "No -l$thislib."
4691 ' '|'') dflt='none';;
4696 In order to compile $package on your machine, a number of libraries
4697 are usually needed. Include any other special libraries here as well.
4698 Say "none" for none. The default list is almost always right.
4702 rp="What libraries to use?"
4709 : determine optimization, if desired, or use for debug flag also
4711 ' '|$undef) dflt='none';;
4713 *) dflt="$optimize";;
4717 By default, $package compiles with the -O flag to use the optimizer.
4718 Alternately, you might want to use the symbolic debugger, which uses
4719 the -g flag (on traditional Unix systems). Either flag can be
4720 specified here. To use neither flag, specify the word "none".
4723 rp="What optimizer/debugger flag should be used?"
4727 'none') optimize=" ";;
4731 : We will not override a previous value, but we might want to
4732 : augment a hint file
4734 default|recommended)
4735 case "$gccversion" in
4736 1*) dflt='-fpcc-struct-return' ;;
4739 *-g*) dflt="$dflt -DDEBUGGING";;
4741 case "$gccversion" in
4742 2*) if test -d /etc/conf/kconfig.d &&
4743 $contains _POSIX_VERSION $usrinc/sys/unistd.h >/dev/null 2>&1
4745 # Interactive Systems (ISC) POSIX mode.
4750 case "$gccversion" in
4754 echo "Checking if your compiler accepts -fno-strict-aliasing" 2>&1
4755 echo 'int main(void) { return 0; }' > gcctest.c
4756 if $cc -O2 -fno-strict-aliasing -o gcctest gcctest.c; then
4757 echo "Yes, it does." 2>&1
4760 echo "Leaving current flags $ccflags alone." 2>&1
4762 *) dflt="$dflt -fno-strict-aliasing" ;;
4765 echo "Nope, it doesn't, but that's ok." 2>&1
4769 # For gcc, adding -pipe speeds up compilations for some, but apparently
4770 # some assemblers can't read from stdin. (It also slows down compilations
4771 # in other cases, but those are apparently rarer these days.) AD 5/2004.
4772 case "$gccversion" in
4774 echo "Checking if your compiler accepts -pipe" 2>&1
4775 echo 'int main(void) { return 0; }' > gcctest.c
4776 if $cc -pipe -o gcctest gcctest.c; then
4777 echo "Yes, it does." 2>&1
4780 echo "Leaving current flags $ccflags alone." 2>&1
4782 *) dflt="$dflt -pipe" ;;
4785 echo "Nope, it doesn't, but that's ok." 2>&1
4788 echo "Checking if your compiler accepts -Wdeclaration-after-statement" 2>&1
4789 echo 'int main(void) { return 0; }' > gcctest.c
4790 if $cc -Wdeclaration-after-statement -o gcctest gcctest.c; then
4791 echo "Yes, it does." 2>&1
4793 *-Wdeclaration-after-statement*)
4794 echo "Leaving current flags $ccflags alone." 2>&1
4796 *) dflt="$dflt -Wdeclaration-after-statement" ;;
4799 echo "Nope, it doesn't, but that's ok." 2>&1
4806 case "$mips_type" in
4807 *BSD*|'') inclwanted="$locincpth $usrinc";;
4808 *) inclwanted="$locincpth $inclwanted $usrinc/bsd";;
4810 for thisincl in $inclwanted; do
4811 if $test -d $thisincl; then
4812 if $test x$thisincl != x$usrinc; then
4814 *" -I$thisincl "*);;
4815 *) dflt="$dflt -I$thisincl ";;
4821 inctest='if $contains $2 $usrinc/$1 >/dev/null 2>&1; then
4823 elif $contains $2 $usrinc/sys/$1 >/dev/null 2>&1; then
4831 *) dflt="$dflt -D$2";;
4835 set signal.h LANGUAGE_C; eval $inctest
4839 ccflags="$ccflags -DSOCKS"
4844 default|recommended) dflt="$ccflags $dflt" ;;
4845 *) dflt="$ccflags";;
4854 Your C compiler may want other flags. For this question you should include
4855 -I/whatever and -DWHATEVER flags and any other flags used by the C compiler,
4856 but you should NOT include libraries or ld flags like -lwhatever. If you
4857 want $package to honor its debug switch, you should include -DDEBUGGING here.
4858 Your C compiler might also need additional flags, such as -D_POSIX_SOURCE.
4860 To use no flags, specify the word "none".
4866 rp="Any additional cc flags?"
4873 : the following weeds options from ccflags that are of no interest to cpp
4875 '') cppflags="$ccflags" ;;
4876 *) cppflags="$cppflags $ccflags" ;;
4878 case "$gccversion" in
4879 1*) cppflags="$cppflags -D__GNUC__"
4881 case "$mips_type" in
4883 *BSD*) cppflags="$cppflags -DSYSTYPE_BSD43";;
4889 echo "Let me guess what the preprocessor flags are..." >&4
4903 *) ftry="$previous $flag";;
4905 if $cppstdin -DLFRULB=bar $cppflags $ftry $cppminus <cpp.c \
4906 >cpp1.out 2>/dev/null && \
4907 $cpprun -DLFRULB=bar $cppflags $ftry $cpplast <cpp.c \
4908 >cpp2.out 2>/dev/null && \
4909 $contains 'foo.*xx.*bar' cpp1.out >/dev/null 2>&1 && \
4910 $contains 'foo.*xx.*bar' cpp2.out >/dev/null 2>&1
4912 cppflags="$cppflags $ftry"
4922 *-*) echo "They appear to be: $cppflags";;
4924 $rm -f cpp.c cpp?.out
4928 : flags used in final linking phase
4930 '') if ./venix; then
4936 *-posix*) dflt="$dflt -posix" ;;
4939 *) dflt="$ldflags";;
4942 : Try to guess additional flags to pick up local libraries.
4943 for thislibdir in $libpth; do
4944 case " $loclibpth " in
4947 *"-L$thislibdir "*) ;;
4948 *) dflt="$dflt -L$thislibdir" ;;
4960 Your C linker may need flags. For this question you should
4961 include -L/whatever and any other flags used by the C linker, but you
4962 should NOT include libraries like -lwhatever.
4964 Make sure you include the appropriate -L/path flags if your C linker
4965 does not normally search all of the directories you specified above,
4968 To use no flags, specify the word "none".
4972 rp="Any additional ld flags (NOT including libraries)?"
4978 rmlist="$rmlist pdp11"
4982 echo "Checking your choice of C compiler and flags for coherency..." >&4
4983 $cat > try.c <<'EOF'
4985 int main() { printf("Ok\n"); return(0); }
4987 set X $cc -o try $optimize $ccflags $ldflags try.c $libs
4989 $cat >try.msg <<'EOM'
4990 I've tried to compile and run the following simple program:
4993 $cat try.c >> try.msg
4995 $cat >> try.msg <<EOM
5002 and I got the following output:
5006 if $sh -c "$cc -o try $optimize $ccflags $ldflags try.c $libs" >>try.msg 2>&1; then
5007 if $sh -c "$run ./try" >>try.msg 2>&1; then
5011 *) echo 'The program compiled OK, but produced no output.' >> try.msg
5014 cat >> try.msg <<'EOQS'
5015 If $libs contains -lsfio, and sfio is mis-configured, then it
5016 sometimes (apparently) runs and exits with a 0 status, but with no
5017 output! It may have to do with sfio's use of _exit vs. exit.
5020 rp="You have a big problem. Shall I abort Configure"
5027 echo "The program compiled OK, but exited with status $?." >>try.msg
5028 rp="You have a problem. Shall I abort Configure"
5032 echo "I can't compile the test program." >>try.msg
5033 rp="You have a BIG problem. Shall I abort Configure"
5039 case "$knowitall" in
5041 echo "(The supplied flags or libraries might be incorrect.)"
5049 *) echo "Ok. Stopping Configure." >&4
5054 n) echo "OK, that should do.";;
5056 $rm -f try try.* core
5058 : define a shorthand compile call
5062 $cc -o ${mc_file} $optimize $ccflags $ldflags $* ${mc_file}.c $libs > /dev/null 2>&1;'
5063 : define a shorthand compile call for compilations that should be ok.
5067 $cc -o ${mc_file} $optimize $ccflags $ldflags $* ${mc_file}.c $libs;'
5069 : determine filename position in cpp output
5071 echo "Computing filename position in cpp output for #include directives..." >&4
5073 vos) testaccess=-e ;;
5076 echo '#include <stdio.h>' > foo.c
5079 $cppstdin $cppflags $cppminus <foo.c 2>/dev/null | \
5080 $grep '^[ ]*#.*stdio\.h' | \
5081 while read cline; do
5084 while $test \$# -gt 0; do
5085 if $test $testaccess \`echo \$1 | $tr -d '"'\`; then
5090 pos=\`expr \$pos + 1\`
5102 *) pos="${fieldn}th";;
5104 echo "Your cpp writes the filename in the $pos field of the line."
5107 vos) cppfilter="tr '\\\\>' '/' |" ;; # path component separator is >
5108 os2) cppfilter="sed -e 's|\\\\\\\\|/|g' |" ;; # path component separator is \
5111 : locate header file
5116 for usrincdir in $usrinc
5118 if test -f \$usrincdir/\$wanted; then
5119 echo "\$usrincdir/\$wanted"
5123 awkprg='{ print \$$fieldn }'
5124 echo "#include <\$wanted>" > foo\$\$.c
5125 $cppstdin $cppminus $cppflags < foo\$\$.c 2>/dev/null | \
5126 $cppfilter $grep "^[ ]*#.*\$wanted" | \
5127 while read cline; do
5128 name=\`echo \$cline | $awk "\$awkprg" | $tr -d '"'\`
5130 *[/\\\\]\$wanted) echo "\$name"; exit 1;;
5131 *[\\\\/]\$wanted) echo "\$name"; exit 1;;
5136 # status = 0: grep returned 0 lines, case statement not executed
5137 # status = 1: headerfile found
5138 # status = 2: while loop executed, no headerfile found
5142 if test \$status -eq 1; then
5149 : define an alternate in-header-list? function
5150 inhdr='echo " "; td=$define; tu=$undef; yyy=$@;
5151 cont=true; xxf="echo \"<\$1> found.\" >&4";
5152 case $# in 2) xxnf="echo \"<\$1> NOT found.\" >&4";;
5153 *) xxnf="echo \"<\$1> NOT found, ...\" >&4";;
5155 case $# in 4) instead=instead;; *) instead="at last";; esac;
5156 while $test "$cont"; do
5158 var=$2; eval "was=\$$2";
5159 if $test "$xxx" && $test -r "$xxx";
5161 eval "case \"\$$var\" in $undef) . ./whoa; esac"; eval "$var=\$td";
5164 eval "case \"\$$var\" in $define) . ./whoa; esac"; eval "$var=\$tu"; fi;
5165 set $yyy; shift; shift; yyy=$@;
5166 case $# in 0) cont="";;
5167 2) xxf="echo \"but I found <\$1> $instead.\" >&4";
5168 xxnf="echo \"and I did not find <\$1> either.\" >&4";;
5169 *) xxf="echo \"but I found <\$1\> instead.\" >&4";
5170 xxnf="echo \"there is no <\$1>, ...\" >&4";;
5174 do set $yyy; var=$2; eval "was=\$$2";
5175 eval "case \"\$$var\" in $define) . ./whoa; esac"; eval "$var=\$tu";
5176 set $yyy; shift; shift; yyy=$@;
5179 : see if stdlib is available
5180 set stdlib.h i_stdlib
5183 : check for lengths of integral types
5187 echo "Checking to see how big your integers are..." >&4
5196 printf("intsize=%d;\n", (int)sizeof(int));
5197 printf("longsize=%d;\n", (int)sizeof(long));
5198 printf("shortsize=%d;\n", (int)sizeof(short));
5203 if eval $compile_ok && $run ./try > /dev/null; then
5205 echo "Your integers are $intsize bytes long."
5206 echo "Your long integers are $longsize bytes long."
5207 echo "Your short integers are $shortsize bytes long."
5211 Help! I can't compile and run the intsize test program: please enlighten me!
5212 (This is probably a misconfiguration in your system or libraries, and
5213 you really ought to fix it. Still, I'll try anyway.)
5217 rp="What is the size of an integer (in bytes)?"
5221 rp="What is the size of a long integer (in bytes)?"
5225 rp="What is the size of a short integer (in bytes)?"
5233 : check for long long
5235 echo "Checking to see if you have long long..." >&4
5236 echo 'int main() { long long x = 7; return 0; }' > try.c
5238 if eval $compile; then
5240 echo "You have long long."
5243 echo "You do not have long long."
5249 : check for length of long long
5250 case "${d_longlong}${longlongsize}" in
5253 echo "Checking to see how big your long longs are..." >&4
5254 $cat >try.c <<'EOCP'
5258 printf("%d\n", (int)sizeof(long long));
5263 if eval $compile_ok; then
5264 longlongsize=`$run ./try`
5265 echo "Your long longs are $longlongsize bytes long."
5269 echo "(I can't seem to compile the test program. Guessing...)"
5270 rp="What is the size of a long long (in bytes)?"
5274 if $test "X$longsize" = "X$longlongsize"; then
5275 echo "(That isn't any different from an ordinary long.)"
5281 : see if inttypes.h is available
5282 : we want a real compile instead of Inhdr because some systems
5283 : have an inttypes.h which includes non-existent headers
5286 #include <inttypes.h>
5288 static int32_t foo32 = 0x12345678;
5292 if eval $compile; then
5293 echo "<inttypes.h> found." >&4
5296 echo "<inttypes.h> NOT found." >&4
5305 echo "Checking to see if you have int64_t..." >&4
5307 #include <sys/types.h>
5308 #$i_inttypes I_INTTYPES
5310 #include <inttypes.h>
5312 int main() { int64_t x = 7; }
5315 if eval $compile; then
5317 echo "You have int64_t."
5320 echo "You do not have int64_t."
5328 echo "Checking which 64-bit integer type we could use..." >&4
5334 val='"unsigned int"'
5339 *) case "$longsize" in
5343 val='"unsigned long"'
5348 *) case "$d_longlong:$longlongsize" in
5353 val='"unsigned long long"'
5358 *) case "$d_int64_t" in
5377 '') echo "Alas, no 64-bit integer types in sight." >&4
5380 *) echo "We could use '$quadtype' for 64-bit integers." >&4
5386 case "$uselonglong" in
5387 "$define"|true|[yY]*)
5390 *** Configure -Duselonglong is deprecated, using -Duse64bitint instead.
5392 use64bitint="$define"
5395 case "$use64bits" in
5396 "$define"|true|[yY]*)
5399 *** Configure -Duse64bits is deprecated, using -Duse64bitint instead.
5401 use64bitint="$define"
5404 case "$use64bitints" in
5405 "$define"|true|[yY]*)
5408 *** There is no Configure -Duse64bitints, using -Duse64bitint instead.
5410 use64bitint="$define"
5413 case "$use64bitsint" in
5414 "$define"|true|[yY]*)
5417 *** There is no Configure -Duse64bitsint, using -Duse64bitint instead.
5419 use64bitint="$define"
5422 case "$uselonglongs" in
5423 "$define"|true|[yY]*)
5426 *** There is no Configure -Duselonglongs, using -Duse64bitint instead.
5428 use64bitint="$define"
5431 case "$use64bitsall" in
5432 "$define"|true|[yY]*)
5435 *** There is no Configure -Duse64bitsall, using -Duse64bitall instead.
5437 use64bitall="$define"
5442 *-DUSE_LONG_LONG*|*-DUSE_64_BIT_INT*|*-DUSE_64_BIT_ALL*) use64bitint="$define";;
5444 case "$use64bitall" in
5445 "$define"|true|[yY]*) use64bitint="$define" ;;
5451 You have natively 64-bit long integers.
5455 *) case "$use64bitint" in
5456 "$define"|true|[yY]*) dflt='y';;
5465 Perl can be built to take advantage of 64-bit integer types
5466 on some systems. To do so, Configure can be run with -Duse64bitint.
5467 Choosing this option will most probably introduce binary incompatibilities.
5469 If this doesn't make any sense to you, just accept the default '$dflt'.
5470 (The default has been chosen based on your configuration.)
5472 rp='Try to use 64-bit integers, if available?'
5475 [yY]*) val="$define" ;;
5483 case "$use64bitall" in
5484 "$define"|true|[yY]*) dflt='y' ;;
5485 *) case "$longsize" in
5493 You may also choose to try maximal 64-bitness. It means using as much
5494 64-bitness as possible on the platform. This in turn means even more
5495 binary incompatibilities. On the other hand, your platform may not
5496 have any more 64-bitness available than what you already have chosen.
5498 If this doesn't make any sense to you, just accept the default '$dflt'.
5499 (The default has been chosen based on your configuration.)
5501 rp='Try to use maximal 64-bit support, if available?'
5504 [yY]*) val="$define" ;;
5509 case "$use64bitall" in
5511 case "$use64bitint" in
5515 Since you have chosen a maximally 64-bit build, I'm also turning on
5516 the use of 64-bit integers.
5518 use64bitint="$define" ;;
5523 : Look for a hint-file generated 'call-back-unit'. If the
5524 : user has specified that a 64-bit perl is to be built,
5525 : we may need to set or change some other defaults.
5526 if $test -f use64bitint.cbu; then
5527 echo "Your platform has some specific hints regarding 64-bit integers, using them..."
5530 case "$use64bitint" in
5531 "$define"|true|[yY]*)
5533 4) case "$archname64" in
5534 '') archname64=64int ;;
5541 : Look for a hint-file generated 'call-back-unit'. If the
5542 : user has specified that a maximally 64-bit perl is to be built,
5543 : we may need to set or change some other defaults.
5544 if $test -f use64bitall.cbu; then
5545 echo "Your platform has some specific hints regarding 64-bit builds, using them..."
5548 case "$use64bitall" in
5549 "$define"|true|[yY]*)
5551 4) case "$archname64" in
5552 ''|64int) archname64=64all ;;
5559 case "$d_quad:$use64bitint" in
5563 *** You have chosen to use 64-bit integers,
5564 *** but none can be found.
5565 *** Please rerun Configure without -Duse64bitint and/or -Dusemorebits.
5566 *** Cannot continue, aborting.
5573 : check for length of double
5575 case "$doublesize" in
5577 echo "Checking to see how big your double precision numbers are..." >&4
5586 printf("%d\n", (int)sizeof(double));
5591 if eval $compile_ok; then
5592 doublesize=`$run ./try`
5593 echo "Your double is $doublesize bytes long."
5596 echo "(I can't seem to compile the test program. Guessing...)"
5597 rp="What is the size of a double precision number (in bytes)?"
5605 : check for long doubles
5607 echo "Checking to see if you have long double..." >&4
5608 echo 'int main() { long double x = 7.0; }' > try.c
5610 if eval $compile; then
5612 echo "You have long double."
5615 echo "You do not have long double."
5621 : check for length of long double
5622 case "${d_longdbl}${longdblsize}" in
5625 echo "Checking to see how big your long doubles are..." >&4
5626 $cat >try.c <<'EOCP'
5630 printf("%d\n", sizeof(long double));
5635 if eval $compile; then
5636 longdblsize=`$run ./try`
5637 echo "Your long doubles are $longdblsize bytes long."
5641 echo "(I can't seem to compile the test program. Guessing...)" >&4
5642 rp="What is the size of a long double (in bytes)?"
5646 if $test "X$doublesize" = "X$longdblsize"; then
5647 echo "That isn't any different from an ordinary double."
5648 echo "I'll keep your setting anyway, but you may see some"
5649 echo "harmless compilation warnings."
5655 : determine the architecture name
5657 if xxx=`./loc arch blurfl $pth`; $test -f "$xxx"; then
5658 tarch=`arch`"-$osname"
5659 elif xxx=`./loc uname blurfl $pth`; $test -f "$xxx" ; then
5660 if uname -m > tmparch 2>&1 ; then
5661 tarch=`$sed -e 's/ *$//' -e 's/ /_/g' \
5662 -e 's/$/'"-$osname/" tmparch`
5670 case "$myarchname" in
5673 echo "(Your architecture name used to be $myarchname.)"
5677 case "$targetarch" in
5679 *) archname=`echo $targetarch|sed 's,^[^-]*-,,'` ;;
5684 *) dflt="$archname";;
5686 rp='What is your architecture name'
5689 case "$usethreads" in
5691 echo "Threads selected." >&4
5693 *-thread*) echo "...and architecture name already has -thread." >&4
5695 *) archname="$archname-thread"
5696 echo "...setting architecture name to $archname." >&4
5701 case "$usemultiplicity" in
5703 echo "Multiplicity selected." >&4
5705 *-multi*) echo "...and architecture name already has -multi." >&4
5707 *) archname="$archname-multi"
5708 echo "...setting architecture name to $archname." >&4
5713 case "$use64bitint$use64bitall" in
5715 case "$archname64" in
5717 echo "This architecture is naturally 64-bit, not changing architecture name." >&4
5720 case "$use64bitint" in
5721 "$define") echo "64 bit integers selected." >&4 ;;
5723 case "$use64bitall" in
5724 "$define") echo "Maximal 64 bitness selected." >&4 ;;
5727 *-$archname64*) echo "...and architecture name already has $archname64." >&4
5729 *) archname="$archname-$archname64"
5730 echo "...setting architecture name to $archname." >&4
5736 case "$uselongdouble" in
5738 echo "Long doubles selected." >&4
5739 case "$longdblsize" in
5741 echo "...but long doubles are equal to doubles, not changing architecture name." >&4
5745 *-ld*) echo "...and architecture name already has -ld." >&4
5747 *) archname="$archname-ld"
5748 echo "...setting architecture name to $archname." >&4
5755 case "$useperlio" in
5757 echo "Perlio selected." >&4
5760 echo "Perlio not selected, using stdio." >&4
5762 *-stdio*) echo "...and architecture name already has -stdio." >&4
5764 *) archname="$archname-stdio"
5765 echo "...setting architecture name to $archname." >&4
5770 if $test -f archname.cbu; then
5771 echo "Your platform has some specific hints for architecture name, using them..."
5775 : determine root of directory hierarchy where package will be installed.
5778 dflt=`./loc . /usr/local /usr/local /local /opt /usr`
5781 dflt=`echo "$prefix" | sed 's/.$//'`
5789 By default, $package will be installed in $dflt/bin, manual pages
5790 under $dflt/man, etc..., i.e. with $dflt as prefix for all
5791 installation directories. Typically this is something like /usr/local.
5792 If you wish to have binaries under /usr/bin but other parts of the
5793 installation under /usr/local, that's ok: you will be prompted
5794 separately for each of the installation directories, the prefix being
5795 only used to set the defaults.
5799 rp='Installation prefix to use?'
5807 *) oldprefix="$prefix";;
5816 *) afsroot=$afsroot ;;
5822 $define|true) afs=true ;;
5823 $undef|false) afs=false ;;
5824 *) if test -d $afsroot; then
5832 echo "AFS may be running... I'll be extra cautious then..." >&4
5834 echo "AFS does not seem to be running..." >&4
5837 : determine installation prefix for where package is to be installed.
5841 Since you are running AFS, I need to distinguish the directory in which
5842 files will reside from the directory in which they are installed (and from
5843 which they are presumably copied to the former directory by occult means).
5846 case "$installprefix" in
5847 '') dflt=`echo $prefix | sed 's#^/afs/#/afs/.#'`;;
5848 *) dflt="$installprefix";;
5853 In some special cases, particularly when building $package for distribution,
5854 it is convenient to distinguish the directory in which files should be
5855 installed from the directory ($prefix) in which they will
5856 eventually reside. For most users, these two directories are the same.
5859 case "$installprefix" in
5861 *) dflt=$installprefix;;
5865 rp='What installation prefix should I use for installing files?'
5867 installprefix="$ans"
5868 installprefixexp="$ansexp"
5870 : set the prefixit variable, to compute a suitable default value
5871 prefixit='case "$3" in
5873 case "$oldprefix" in
5874 "") eval "$1=\"\$$2\"";;
5881 ""|" ") eval "$1=\"\$$2\"";;
5887 eval "tp=\"$oldprefix-\$$2-\""; eval "tp=\"$tp\"";
5889 --|/*--|\~*--) eval "$1=\"$prefix/$3\"";;
5890 /*-$oldprefix/*|\~*-$oldprefix/*)
5891 eval "$1=\`echo \$$2 | sed \"s,^$oldprefix,$prefix,\"\`";;
5892 *) eval "$1=\"\$$2\"";;
5896 : get the patchlevel
5898 echo "Getting the current patchlevel..." >&4
5899 if $test -r $rsrc/patchlevel.h;then
5900 revision=`awk '/define[ ]+PERL_REVISION/ {print $3}' $rsrc/patchlevel.h`
5901 patchlevel=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
5902 subversion=`awk '/define[ ]+PERL_SUBVERSION/ {print $3}' $rsrc/patchlevel.h`
5903 api_revision=`awk '/define[ ]+PERL_API_REVISION/ {print $3}' $rsrc/patchlevel.h`
5904 api_version=`awk '/define[ ]+PERL_API_VERSION/ {print $3}' $rsrc/patchlevel.h`
5905 api_subversion=`awk '/define[ ]+PERL_API_SUBVERSION/ {print $3}' $rsrc/patchlevel.h`
5906 perl_patchlevel=`egrep 'define PERL_PATCHNUM [0-9][0-9]|,"MAINT[0-9][0-9]*"' $rsrc/patchlevel.h|sed 's/[^0-9]//g'`
5915 $echo "(You do not have patchlevel.h. Eek.)"
5917 if $test -r $rsrc/.patch ; then
5918 if $test "X$perl_patchlevel" = "X" || $test "`cat $rsrc/.patch`" -gt "$perl_patchlevel" ; then
5919 perl_patchlevel=`cat $rsrc/.patch`
5922 : Define a handy string here to avoid duplication in myconfig.SH and configpm.
5923 version_patchlevel_string="version $patchlevel subversion $subversion"
5924 case "$perl_patchlevel" in
5926 *) version_patchlevel_string="$version_patchlevel_string patch $perl_patchlevel" ;;
5929 $echo "(You have $package $version_patchlevel_string.)"
5933 : XXX Should be a Configure test for double-dots in filenames.
5934 version=`echo $revision $patchlevel $subversion | \
5935 $awk '{ printf "%d_%d_%d\n", $1, $2, $3 }'`
5936 api_versionstring=`echo $api_revision $api_version $api_subversion | \
5937 $awk '{ printf "%d_%d_%d\n", $1, $2, $3 }'`
5940 version=`echo $revision $patchlevel $subversion | \
5941 $awk '{ printf "%d.%d.%d\n", $1, $2, $3 }'`
5942 api_versionstring=`echo $api_revision $api_version $api_subversion | \
5943 $awk '{ printf "%d.%d.%d\n", $1, $2, $3 }'`
5946 : Special case the 5.005_xx maintenance series, which used 5.005
5947 : without any subversion label as a subdirectory in $sitelib
5948 if test "${api_revision}${api_version}${api_subversion}" = "550"; then
5949 api_versionstring='5.005'
5952 : determine installation style
5953 : For now, try to deduce it from prefix unless it is already set.
5954 : Reproduce behavior of 5.005 and earlier, maybe drop that in 5.7.
5955 case "$installstyle" in
5956 '') case "$prefix" in
5957 *perl*) dflt='lib';;
5958 *) dflt='lib/perl5' ;;
5961 *) dflt="$installstyle" ;;
5963 : Probably not worth prompting for this since we prompt for all
5964 : the directories individually, and the prompt would be too long and
5968 : determine where private library files go
5969 : Usual default is /usr/local/lib/perl5/$version.
5970 : Also allow things like /opt/perl/lib/$version, since
5971 : /opt/perl/lib/perl5... would be redundant.
5972 : The default "style" setting is made in installstyle.U
5973 case "$installstyle" in
5974 *lib/perl5*) set dflt privlib lib/$package/$version ;;
5975 *) set dflt privlib lib/$version ;;
5980 There are some auxiliary files for $package that need to be put into a
5981 private library directory that is accessible by everyone.
5985 rp='Pathname where the private library files will reside?'
5988 privlibexp="$ansexp"
5989 : Change installation prefix, if necessary.
5990 if $test X"$prefix" != X"$installprefix"; then
5991 installprivlib=`echo $privlibexp | sed "s#^$prefix#$installprefix#"`
5993 installprivlib="$privlibexp"
5996 : set the prefixup variable, to restore leading tilda escape
5997 prefixup='case "$prefixexp" in
5999 *) eval "$1=\`echo \$$1 | sed \"s,^$prefixexp,$prefix,\"\`";;
6002 : determine where public architecture dependent libraries go
6005 : privlib default is /usr/local/lib/$package/$version
6006 : archlib default is /usr/local/lib/$package/$version/$archname
6007 : privlib may have an optional trailing /share.
6008 tdflt=`echo $privlib | $sed 's,/share$,,'`
6009 tdflt=$tdflt/$archname
6018 $spackage contains architecture-dependent library files. If you are
6019 sharing libraries in a heterogeneous environment, you might store
6020 these files in a separate location. Otherwise, you can just include
6021 them with the rest of the public library files.
6025 rp='Where do you want to put the public architecture-dependent libraries?'
6028 archlibexp="$ansexp"
6029 if $test X"$archlib" = X"$privlib"; then
6034 : Change installation prefix, if necessary.
6035 if $test X"$prefix" != X"$installprefix"; then
6036 installarchlib=`echo $archlibexp | sed "s#^$prefix#$installprefix#"`
6038 installarchlib="$archlibexp"
6041 : see if setuid scripts can be secure
6044 Some kernels have a bug that prevents setuid #! scripts from being
6045 secure. Some sites have disabled setuid #! scripts because of this.
6047 First let's decide if your kernel supports secure setuid #! scripts.
6048 (If setuid #! scripts would be secure but have been disabled anyway,
6049 don't say that they are secure if asked.)
6054 if $test -d /dev/fd; then
6055 echo "#!$ls" >reflect
6056 chmod +x,u+s reflect
6057 ./reflect >flect 2>&1
6058 if $contains "/dev/fd" flect >/dev/null; then
6059 echo "Congratulations, your kernel has secure setuid scripts!" >&4
6063 If you are not sure if they are secure, I can check but I'll need a
6064 username and password different from the one you are using right now.
6065 If you don't have such a username or don't want me to test, simply
6069 rp='Other username to test security of setuid scripts with?'
6074 case "$d_suidsafe" in
6075 '') echo "I'll assume setuid scripts are *not* secure." >&4
6078 echo "Well, the $hint value is *not* secure." >&4
6080 *) echo "Well, the $hint value *is* secure." >&4
6085 $rm -f reflect flect
6086 echo "#!$ls" >reflect
6087 chmod +x,u+s reflect
6090 echo '"su" will (probably) prompt you for '"$ans's password."
6091 su $ans -c './reflect >flect'
6092 if $contains "/dev/fd" flect >/dev/null; then
6093 echo "Okay, it looks like setuid scripts are secure." >&4
6096 echo "I don't think setuid scripts are secure." >&4
6101 rp='Does your kernel have *secure* setuid scripts?'
6104 [yY]*) val="$define";;
6109 echo "I don't think setuid scripts are secure (no /dev/fd directory)." >&4
6110 echo "(That's for file descriptors, not floppy disks.)"
6116 $rm -f reflect flect
6118 : now see if they want to do setuid emulation
6121 case "$d_suidsafe" in
6124 echo "No need to emulate SUID scripts since they are secure here." >&4
6128 Some systems have disabled setuid scripts, especially systems where
6129 setuid scripts cannot be secure. On systems where setuid scripts have
6130 been disabled, the setuid/setgid bits on scripts are currently
6131 useless. It is possible for $package to detect those bits and emulate
6132 setuid/setgid in a secure fashion. This emulation will only work if
6133 setuid scripts have been disabled in your kernel.
6137 "$define") dflt=y ;;
6140 rp="Do you want to do setuid/setgid emulation?"
6143 [yY]*) val="$define";;
6151 : see if this is a malloc.h system
6152 : we want a real compile instead of Inhdr because some systems have a
6153 : malloc.h that just gives a compile error saying to use stdlib.h instead
6158 int main () { return 0; }
6161 if eval $compile; then
6162 echo "<malloc.h> found." >&4
6165 echo "<malloc.h> NOT found." >&4
6172 : check for void type
6174 echo "Checking to see how well your C compiler groks the void type..." >&4
6175 case "$voidflags" in
6187 extern void moo(); /* function returning void */
6188 void (*goo)(); /* ptr to func returning void */
6190 void *hue; /* generic ptr */
6203 int main() { sub(); }
6205 if $cc $ccflags -c -DTRY=$defvoidused try.c >.out 2>&1 ; then
6206 voidflags=$defvoidused
6207 echo "Good. It appears to support void to the level $package wants.">&4
6208 if $contains warning .out >/dev/null 2>&1; then
6209 echo "However, you might get some warnings that look like this:"
6213 echo "Hmm, your compiler has some difficulty with void. Checking further..." >&4
6214 if $cc $ccflags -c -DTRY=1 try.c >/dev/null 2>&1; then
6215 echo "It supports 1..."
6216 if $cc $ccflags -c -DTRY=3 try.c >/dev/null 2>&1; then
6217 echo "It also supports 2..."
6218 if $cc $ccflags -c -DTRY=7 try.c >/dev/null 2>&1; then
6220 echo "And it supports 4 but not 8 definitely."
6222 echo "It doesn't support 4..."
6223 if $cc $ccflags -c -DTRY=11 try.c >/dev/null 2>&1; then
6225 echo "But it supports 8."
6228 echo "Neither does it support 8."
6232 echo "It does not support 2..."
6233 if $cc $ccflags -c -DTRY=13 try.c >/dev/null 2>&1; then
6235 echo "But it supports 4 and 8."
6237 if $cc $ccflags -c -DTRY=5 try.c >/dev/null 2>&1; then
6239 echo "And it supports 4 but has not heard about 8."
6241 echo "However it supports 8 but not 4."
6246 echo "There is no support at all for void."
6251 case "$voidflags" in
6254 Support flag bits are:
6255 1: basic void declarations.
6256 2: arrays of pointers to functions returning void.
6257 4: operations between pointers to and addresses of void functions.
6258 8: generic void pointers.
6261 rp="Your void support flags add up to what?"
6268 : check for length of pointer
6272 echo "Checking to see how big your pointers are..." >&4
6273 if test "$voidflags" -gt 7; then
6274 echo '#define VOID_PTR char *' > try.c
6276 echo '#define VOID_PTR void *' > try.c
6286 printf("%d\n", (int)sizeof(VOID_PTR));
6291 if eval $compile_ok; then
6292 ptrsize=`$run ./try`
6293 echo "Your pointers are $ptrsize bytes long."
6296 echo "(I can't seem to compile the test program. Guessing...)" >&4
6297 rp="What is the size of a pointer (in bytes)?"
6304 case "$use64bitall" in
6305 "$define"|true|[yY]*)
6309 *** You have chosen a maximally 64-bit build,
6310 *** but your pointers are only 4 bytes wide.
6311 *** Please rerun Configure without -Duse64bitall.
6316 *** Since you have quads, you could possibly try with -Duse64bitint.
6321 *** Cannot continue, aborting.
6332 : determine whether to use malloc wrapping
6334 case "$usemallocwrap" in
6335 [yY]*|true|$define) dflt='y' ;;
6336 [nN]*|false|$undef) dflt='n' ;;
6337 *) case "$usedevel" in
6338 [yY]*|true|$define) dflt='y' ;;
6343 rp="Do you wish to wrap malloc calls to protect against potential overflows?"
6345 usemallocwrap="$ans"
6348 usemallocwrap="$define" ;;
6350 usemallocwrap="$undef" ;;
6353 : determine which malloc to compile in
6355 case "$usemymalloc" in
6356 [yY]*|true|$define) dflt='y' ;;
6357 [nN]*|false|$undef) dflt='n' ;;
6358 *) case "$ptrsize" in
6364 rp="Do you wish to attempt to use the malloc that comes with $package?"
6370 mallocsrc='malloc.c'
6371 mallocobj="malloc$_o"
6372 d_mymalloc="$define"
6375 : Remove malloc from list of libraries to use
6376 echo "Removing unneeded -lmalloc from library list" >&4
6377 set `echo X $libs | $sed -e 's/-lmalloc / /' -e 's/-lmalloc$//'`
6380 echo "libs = $libs" >&4
6392 : compute the return types of malloc and free
6394 $cat >malloc.c <<END
6398 #include <sys/types.h>
6412 case "$malloctype" in
6414 if $cc $ccflags -c -DTRY_MALLOC malloc.c >/dev/null 2>&1; then
6421 echo "Your system wants malloc to return '$malloctype', it would seem." >&4
6425 if $cc $ccflags -c -DTRY_FREE malloc.c >/dev/null 2>&1; then
6432 echo "Your system uses $freetype free(), it would seem." >&4
6436 After $package is installed, you may wish to install various
6437 add-on modules and utilities. Typically, these add-ons will
6438 be installed under $prefix with the rest
6439 of this package. However, you may wish to install such add-ons
6440 elsewhere under a different prefix.
6442 If you do not wish to put everything under a single prefix, that's
6443 ok. You will be prompted for the individual locations; this siteprefix
6444 is only used to suggest the defaults.
6446 The default should be fine for most people.
6450 rp='Installation prefix to use for add-on modules and utilities?'
6451 : XXX Here might be another good place for an installstyle setting.
6452 case "$siteprefix" in
6454 *) dflt=$siteprefix ;;
6457 : XXX Prefixit unit does not yet support siteprefix and vendorprefix
6459 case "$siteprefix" in
6463 *) oldsiteprefix="$prefix";;
6468 siteprefixexp="$ansexp"
6470 : determine where site specific libraries go.
6471 : Usual default is /usr/local/lib/perl5/site_perl/$version
6472 : The default "style" setting is made in installstyle.U
6473 : XXX No longer works with Prefixit stuff.
6474 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
6476 '') case "$installstyle" in
6477 *lib/perl5*) dflt=$siteprefix/lib/$package/site_$prog/$version ;;
6478 *) dflt=$siteprefix/lib/site_$prog/$version ;;
6486 The installation process will create a directory for
6487 site-specific extensions and modules. Most users find it convenient
6488 to place all site-specific files in this directory rather than in the
6489 main distribution directory.
6493 rp='Pathname for the site-specific library files?'
6496 sitelibexp="$ansexp"
6497 sitelib_stem=`echo "$sitelibexp" | sed "s,/$version$,,"`
6498 : Change installation prefix, if necessary.
6499 if $test X"$prefix" != X"$installprefix"; then
6500 installsitelib=`echo $sitelibexp | $sed "s#^$prefix#$installprefix#"`
6502 installsitelib="$sitelibexp"
6505 : determine where site specific architecture-dependent libraries go.
6506 : sitelib default is /usr/local/lib/perl5/site_perl/$version
6507 : sitearch default is /usr/local/lib/perl5/site_perl/$version/$archname
6508 : sitelib may have an optional trailing /share.
6510 '') dflt=`echo $sitelib | $sed 's,/share$,,'`
6511 dflt="$dflt/$archname"
6516 set sitearch sitearch none
6520 The installation process will also create a directory for
6521 architecture-dependent site-specific extensions and modules.
6525 rp='Pathname for the site-specific architecture-dependent library files?'
6528 sitearchexp="$ansexp"
6529 : Change installation prefix, if necessary.
6530 if $test X"$prefix" != X"$installprefix"; then
6531 installsitearch=`echo $sitearchexp | sed "s#^$prefix#$installprefix#"`
6533 installsitearch="$sitearchexp"
6538 The installation process will also create a directory for
6539 vendor-supplied add-ons. Vendors who supply perl with their system
6540 may find it convenient to place all vendor-supplied files in this
6541 directory rather than in the main distribution directory. This will
6542 ease upgrades between binary-compatible maintenance versions of perl.
6544 Of course you may also use these directories in whatever way you see
6545 fit. For example, you might use them to access modules shared over a
6546 company-wide network.
6548 The default answer should be fine for most people.
6549 This causes further questions about vendor add-ons to be skipped
6550 and no vendor-specific directories will be configured for perl.
6553 rp='Do you want to configure vendor-specific add-on directories?'
6554 case "$usevendorprefix" in
6555 define|true|[yY]*) dflt=y ;;
6556 *) : User may have set vendorprefix directly on Configure command line.
6557 case "$vendorprefix" in
6566 rp='Installation prefix to use for vendor-supplied add-ons?'
6567 case "$vendorprefix" in
6569 *) dflt=$vendorprefix ;;
6572 : XXX Prefixit unit does not yet support siteprefix and vendorprefix
6574 case "$vendorprefix" in
6578 *) oldvendorprefix="$prefix";;
6582 usevendorprefix="$define"
6584 vendorprefixexp="$ansexp"
6586 *) usevendorprefix="$undef"
6592 case "$vendorprefix" in
6593 '') d_vendorlib="$undef"
6597 *) d_vendorlib="$define"
6598 : determine where vendor-supplied modules go.
6599 : Usual default is /usr/local/lib/perl5/vendor_perl/$version
6600 case "$vendorlib" in
6602 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
6603 case "$installstyle" in
6604 *lib/perl5*) dflt=$vendorprefix/lib/$package/vendor_$prog/$version ;;
6605 *) dflt=$vendorprefix/lib/vendor_$prog/$version ;;
6608 *) dflt="$vendorlib"
6612 rp='Pathname for the vendor-supplied library files?'
6615 vendorlibexp="$ansexp"
6618 vendorlib_stem=`echo "$vendorlibexp" | sed "s,/$version$,,"`
6619 : Change installation prefix, if necessary.
6620 if $test X"$prefix" != X"$installprefix"; then
6621 installvendorlib=`echo $vendorlibexp | $sed "s#^$prefix#$installprefix#"`
6623 installvendorlib="$vendorlibexp"
6626 case "$vendorprefix" in
6627 '') d_vendorarch="$undef"
6631 *) d_vendorarch="$define"
6632 : determine where vendor-supplied architecture-dependent libraries go.
6633 : vendorlib default is /usr/local/lib/perl5/vendor_perl/$version
6634 : vendorarch default is /usr/local/lib/perl5/vendor_perl/$version/$archname
6635 : vendorlib may have an optional trailing /share.
6636 case "$vendorarch" in
6637 '') dflt=`echo $vendorlib | $sed 's,/share$,,'`
6638 dflt="$dflt/$archname"
6640 *) dflt="$vendorarch" ;;
6643 rp='Pathname for vendor-supplied architecture-dependent files?'
6646 vendorarchexp="$ansexp"
6649 : Change installation prefix, if necessary.
6650 if $test X"$prefix" != X"$installprefix"; then
6651 installvendorarch=`echo $vendorarchexp | sed "s#^$prefix#$installprefix#"`
6653 installvendorarch="$vendorarchexp"
6656 : Final catch-all directories to search
6659 Lastly, you can have perl look in other directories for extensions and
6660 modules in addition to those already specified.
6661 These directories will be searched after
6665 test X"$vendorlib" != "X" && echo ' ' $vendorlib
6666 test X"$vendorarch" != "X" && echo ' ' $vendorarch
6668 case "$otherlibdirs" in
6669 ''|' ') dflt='none' ;;
6670 *) dflt="$otherlibdirs" ;;
6673 Enter a colon-separated set of extra paths to include in perl's @INC
6674 search path, or enter 'none' for no extra paths.
6678 rp='Colon-separated list of additional directories for perl to search?'
6681 ' '|''|none) otherlibdirs=' ' ;;
6682 *) otherlibdirs="$ans" ;;
6684 case "$otherlibdirs" in
6688 set d_perl_otherlibdirs
6691 : Cruising for prototypes
6693 echo "Checking out function prototypes..." >&4
6694 $cat >prototype.c <<EOCP
6699 int main(int argc, char *argv[]) {
6702 if $cc $ccflags -c prototype.c >prototype.out 2>&1 ; then
6703 echo "Your C compiler appears to support function prototypes."
6706 echo "Your C compiler doesn't seem to understand function prototypes."
6713 case "$prototype" in
6715 *) ansi2knr='ansi2knr'
6720 This version of $package can only be compiled by a compiler that
6721 understands function prototypes. Unfortunately, your C compiler
6723 doesn't seem to understand them. Sorry about that.
6725 If GNU cc is available for your system, perhaps you could try that instead.
6727 Eventually, we hope to support building Perl with pre-ANSI compilers.
6728 If you would like to help in that effort, please contact <perlbug@perl.org>.
6730 Aborting Configure now.
6736 : determine where public executables go
6741 rp='Pathname where the public executables will reside?'
6743 if $test "X$ansexp" != "X$binexp"; then
6748 : Change installation prefix, if necessary.
6749 : XXX Bug? -- ignores Configure -Dinstallprefix setting.
6750 if $test X"$prefix" != X"$installprefix"; then
6751 installbin=`echo $binexp | sed "s#^$prefix#$installprefix#"`
6753 installbin="$binexp"
6762 Perl can be built with extra modules or bundles of modules which
6763 will be fetched from the CPAN and installed alongside Perl.
6765 Notice that you will need access to the CPAN; either via the Internet,
6766 or a local copy, for example a CD-ROM or a local CPAN mirror. (You will
6767 be asked later to configure the CPAN.pm module which will in turn do
6768 the installation of the rest of the extra modules or bundles.)
6770 Notice also that if the modules require any external software such as
6771 libraries and headers (the libz library and the zlib.h header for the
6772 Compress::Zlib module, for example) you MUST have any such software
6773 already installed, this configuration process will NOT install such
6776 If this doesn't make any sense to you, just accept the default '$dflt'.
6778 rp='Install any extra modules (y or n)?'
6784 Please list any extra modules or bundles to be installed from CPAN,
6785 with spaces between the names. The names can be in any format the
6786 'install' command of CPAN.pm will understand. (Answer 'none',
6787 without the quotes, to install no extra modules or bundles.)
6797 $rm -f ../extras.lst
6799 *) echo "(Saving the list of extras for later...)"
6800 echo "$extras" > ../extras.lst
6808 : determine where html pages for programs go
6809 set html1dir html1dir none
6813 If you wish to install html files for programs in $spackage, indicate
6814 the appropriate directory here. To skip installing html files,
6818 ''|none|$undef|' ') dflt=none ;;
6819 *) dflt=$html1dir ;;
6822 rp="Directory for the main $spackage html pages?"
6825 html1direxp="$ansexp"
6826 : Use ' ' for none so value is preserved next time through Configure
6827 $test X"$html1dir" = "X" && html1dir=' '
6828 : Change installation prefix, if necessary.
6829 if $test X"$prefix" != X"$installprefix"; then
6830 installhtml1dir=`echo $html1direxp | sed "s#^$prefix#$installprefix#"`
6832 installhtml1dir="$html1direxp"
6835 : determine where html pages for libraries and modules go
6836 set html3dir html3dir none
6840 If you wish to install html files for modules associated with $spackage,
6841 indicate the appropriate directory here. To skip installing html files,
6844 : There is no obvious default. If they have specified html1dir, then
6845 : try to key off that, possibly changing .../html1 into .../html3.
6847 '') html3dir=`echo "$html1dir" | $sed 's/1$/3$/'` ;;
6848 *) dflt=$html3dir ;;
6851 rp="Directory for the $spackage module html pages?"
6854 html3direxp="$ansexp"
6855 : Use ' ' for none so value is preserved next time through Configure
6856 $test X"$html3dir" = "X" && html3dir=' '
6857 : Change installation prefix, if necessary.
6858 if $test X"$prefix" != X"$installprefix"; then
6859 installhtml3dir=`echo $html3direxp | sed "s#^$prefix#$installprefix#"`
6861 installhtml3dir="$html3direxp"
6864 : Find perl5.005 or later.
6865 echo "Looking for a previously installed perl5.005 or later... "
6867 '') for tdir in `echo "$binexp$path_sep$PATH" | $sed "s/$path_sep/ /g"`; do
6868 : Check if this perl is recent and can load a simple module
6869 if $test -x $tdir/perl$exe_ext && $tdir/perl -Mless -e 'use 5.005;' >/dev/null 2>&1; then
6872 elif $test -x $tdir/perl5$exe_ext && $tdir/perl5 -Mless -e 'use 5.005;' >/dev/null 2>&1; then
6882 '') echo "None found. That's ok.";;
6883 *) echo "Using $perl5." ;;
6886 : Determine list of previous versions to include in @INC
6887 $cat > getverlist <<EOPL
6890 \$api_versionstring = "$api_versionstring";
6891 \$version = "$version";
6892 \$stem = "$sitelib_stem";
6893 \$archname = "$archname";
6895 $cat >> getverlist <<'EOPL'
6896 # Can't have leading @ because metaconfig interprets it as a command!
6897 ;@inc_version_list=();
6898 # XXX Redo to do opendir/readdir?
6901 ;@candidates = glob("5.*");
6907 # XXX ToDo: These comparisons must be reworked when two-digit
6908 # subversions come along, so that 5.7.10 compares as greater than
6909 # 5.7.3! By that time, hope that 5.6.x is sufficiently
6910 # widespread that we can use the built-in version vectors rather
6911 # than reinventing them here. For 5.6.0, however, we must
6912 # assume this script will likely be run by 5.005_0x. --AD 1/2000.
6913 foreach $d (@candidates) {
6914 if ($d lt $version) {
6915 if ($d ge $api_versionstring) {
6916 unshift(@inc_version_list, grep { -d } "$d/$archname", $d);
6918 elsif ($d ge "5.005") {
6919 unshift(@inc_version_list, grep { -d } $d);
6923 # Skip newer version. I.e. don't look in
6924 # 5.7.0 if we're installing 5.6.1.
6928 if (@inc_version_list) {
6929 print join(' ', @inc_version_list);
6932 # Blank space to preserve value for next Configure run.
6937 case "$inc_version_list" in
6938 '') if test -x "$perl5$exe_ext"; then
6939 dflt=`$perl5 getverlist`
6944 $undef) dflt='none' ;;
6945 *) eval dflt=\"$inc_version_list\" ;;
6948 ''|' ') dflt=none ;;
6955 In order to ease the process of upgrading, this version of perl
6956 can be configured to use modules built and installed with earlier
6957 versions of perl that were installed under $prefix. Specify here
6958 the list of earlier versions that this version of perl should check.
6959 If Configure detected no earlier versions of perl installed under
6960 $prefix, then the list will be empty. Answer 'none' to tell perl
6961 to not search earlier versions.
6963 The default should almost always be sensible, so if you're not sure,
6964 just accept the default.
6967 rp='List of earlier versions to include in @INC?'
6970 [Nn]one|''|' '|$undef) inc_version_list=' ' ;;
6971 *) inc_version_list="$ans" ;;
6973 case "$inc_version_list" in
6975 inc_version_list_init='0';;
6976 *) inc_version_list_init=`echo $inc_version_list |
6977 $sed -e 's/^/"/' -e 's/ /","/g' -e 's/$/",0/'`
6982 : determine whether to install perl also as /usr/bin/perl
6985 if $test -d /usr/bin -a "X$installbin" != X/usr/bin; then
6987 Many scripts expect perl to be installed as /usr/bin/perl.
6989 If you want to, I can install the perl you are about to compile
6990 as /usr/bin/perl (in addition to $bin/perl).
6992 if test -f /usr/bin/perl; then
6995 However, please note that because you already have a /usr/bin/perl,
6996 overwriting that with a new Perl would very probably cause problems.
6997 Therefore I'm assuming you don't want to do that (unless you insist).
7000 case "$installusrbinperl" in
7001 "$define"|[yY]*) dflt='y';;
7007 Since you don't have a /usr/bin/perl I'm assuming creating one is okay.
7010 case "$installusrbinperl" in
7011 "$undef"|[nN]*) dflt='n';;
7015 rp="Do you want to install perl as /usr/bin/perl?"
7018 [yY]*) val="$define";;
7024 set installusrbinperl
7028 echo "Checking for GNU C Library..." >&4
7030 /* Find out version of GNU C library. __GLIBC__ and __GLIBC_MINOR__
7031 alone are insufficient to distinguish different versions, such as
7032 2.0.6 and 2.0.7. The function gnu_get_libc_version() appeared in
7033 libc version 2.1.0. A. Dougherty, June 3, 2002.
7039 # ifdef __GLIBC_MINOR__
7040 # if __GLIBC__ >= 2 && __GLIBC_MINOR__ >= 1
7041 # include <gnu/libc-version.h>
7042 printf("%s\n", gnu_get_libc_version());
7044 printf("%d.%d\n", __GLIBC__, __GLIBC_MINOR__);
7047 printf("%d\n", __GLIBC__);
7056 if eval $compile_ok && $run ./try > glibc.ver; then
7058 gnulibc_version=`$cat glibc.ver`
7059 echo "You are using the GNU C Library version $gnulibc_version"
7063 echo "You are not using the GNU C Library"
7065 $rm -f try try.* glibc.ver
7069 : see if nm is to be used to determine whether a symbol is defined or not
7073 case "$d_gnulibc" in
7076 echo "nm probably won't work on the GNU C Library." >&4
7082 if $test "$osname" = aix -a "X$PASE" != "Xdefine" -a ! -f /lib/syscalls.exp; then
7084 echo "Whoops! This is an AIX system without /lib/syscalls.exp!" >&4
7085 echo "'nm' won't be sufficient on this sytem." >&4
7091 '') dflt=`$egrep 'inlibc|csym' $rsrc/Configure | wc -l 2>/dev/null`
7092 if $test $dflt -gt 20; then
7102 true|$define) dflt=y;;
7109 I can use $nm to extract the symbols from your C libraries. This
7110 is a time consuming task which may generate huge output on the disk (up
7111 to 3 megabytes) but that should make the symbols extraction faster. The
7112 alternative is to skip the 'nm' extraction part and to compile a small
7113 test program instead to determine whether each symbol is present. If
7114 you have a fast C compiler and/or if your 'nm' output cannot be parsed,
7115 this may be the best solution.
7117 You probably shouldn't let me use 'nm' if you are using the GNU C Library.
7120 rp="Shall I use $nm to extract C symbols from the libraries?"
7123 [Nn]*) usenm=false;;
7132 : nm options which may be necessary
7134 '') if $test -f /mach_boot; then
7136 elif $test -d /usr/ccs/lib; then
7137 nm_opt='-p' # Solaris (and SunOS?)
7138 elif $test -f /dgux; then
7140 elif $test -f /lib64/rld; then
7141 nm_opt='-p' # 64-bit Irix
7147 : nm options which may be necessary for shared libraries but illegal
7148 : for archive libraries. Thank you, Linux.
7149 case "$nm_so_opt" in
7150 '') case "$myuname" in
7152 if $nm --help | $grep 'dynamic' > /dev/null 2>&1; then
7153 nm_so_opt='--dynamic'
7162 : get list of predefined functions in a handy place
7167 *-lc_s*) libc=`./loc libc_s$_a $libc $libpth`
7173 *) for thislib in $libs; do
7176 : Handle C library specially below.
7179 thislib=`echo $thislib | $sed -e 's/^-l//'`
7180 if try=`./loc lib$thislib.$so.'*' X $libpth`; $test -f "$try"; then
7182 elif try=`./loc lib$thislib.$so X $libpth`; $test -f "$try"; then
7184 elif try=`./loc lib$thislib$_a X $libpth`; $test -f "$try"; then
7186 elif try=`./loc $thislib$_a X $libpth`; $test -f "$try"; then
7188 elif try=`./loc lib$thislib X $libpth`; $test -f "$try"; then
7190 elif try=`./loc $thislib X $libpth`; $test -f "$try"; then
7192 elif try=`./loc Slib$thislib$_a X $xlibpth`; $test -f "$try"; then
7197 libnames="$libnames $try"
7199 *) libnames="$libnames $thislib" ;;
7208 for xxx in $libpth; do
7209 $test -r $1 || set $xxx/libc.$so
7210 : The messy sed command sorts on library version numbers.
7212 set `echo blurfl; echo $xxx/libc.$so.[0-9]* | \
7213 tr ' ' $trnl | egrep -v '\.[A-Za-z]*$' | $sed -e '
7215 s/[0-9][0-9]*/0000&/g
7216 s/0*\([0-9][0-9][0-9][0-9][0-9]\)/\1/g
7219 $sort | $sed -e 's/^.* //'`
7222 $test -r $1 || set /usr/ccs/lib/libc.$so
7223 $test -r $1 || set /lib/libsys_s$_a
7229 if $test -r "$1"; then
7230 echo "Your (shared) C library seems to be in $1."
7232 elif $test -r /lib/libc && $test -r /lib/clib; then
7233 echo "Your C library seems to be in both /lib/clib and /lib/libc."
7235 libc='/lib/clib /lib/libc'
7236 if $test -r /lib/syslib; then
7237 echo "(Your math library is in /lib/syslib.)"
7238 libc="$libc /lib/syslib"
7240 elif $test -r "$libc" || (test -h "$libc") >/dev/null 2>&1; then
7241 echo "Your C library seems to be in $libc, as you said before."
7242 elif $test -r $incpath/usr/lib/libc$_a; then
7243 libc=$incpath/usr/lib/libc$_a;
7244 echo "Your C library seems to be in $libc. That's fine."
7245 elif $test -r /lib/libc$_a; then
7247 echo "Your C library seems to be in $libc. You're normal."
7249 if tans=`./loc libc$_a blurfl/dyick $libpth`; $test -r "$tans"; then
7251 elif tans=`./loc libc blurfl/dyick $libpth`; $test -r "$tans"; then
7252 libnames="$libnames "`./loc clib blurfl/dyick $libpth`
7253 elif tans=`./loc clib blurfl/dyick $libpth`; $test -r "$tans"; then
7255 elif tans=`./loc Slibc$_a blurfl/dyick $xlibpth`; $test -r "$tans"; then
7257 elif tans=`./loc Mlibc$_a blurfl/dyick $xlibpth`; $test -r "$tans"; then
7260 tans=`./loc Llibc$_a blurfl/dyick $xlibpth`
7262 if $test -r "$tans"; then
7263 echo "Your C library seems to be in $tans, of all places."
7269 if $test $xxx = apollo -o -r "$libc" || (test -h "$libc") >/dev/null 2>&1; then
7273 If the guess above is wrong (which it might be if you're using a strange
7274 compiler, or your machine supports multiple models), you can override it here.
7279 echo $libpth | $tr ' ' $trnl | $sort | $uniq > libpath
7281 I can't seem to find your C library. I've looked in the following places:
7284 $sed 's/^/ /' libpath
7287 None of these seems to contain your C library. I need to get its name...
7292 rp='Where is your C library?'
7297 echo $libc $libnames | $tr ' ' $trnl | $sort | $uniq > libnames
7298 set X `cat libnames`
7301 case $# in 1) xxx=file; esac
7302 echo "Extracting names from the following $xxx for later perusal:" >&4
7304 $sed 's/^/ /' libnames >&4
7306 $echo $n "This may take a while...$c" >&4
7310 *$so*) $nm $nm_so_opt $nm_opt $file 2>/dev/null;;
7311 *) $nm $nm_opt $file 2>/dev/null;;
7316 $grep fprintf libc.tmp > libc.ptf
7317 xscan='eval "<libc.ptf $com >libc.list"; $echo $n ".$c" >&4'
7318 xrun='eval "<libc.tmp $com >libc.list"; echo "done." >&4'
7320 if com="$sed -n -e 's/__IO//' -e 's/^.* $xxx *//p'";\
7322 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7324 elif com="$sed -n -e 's/^__*//' -e 's/^\([a-zA-Z_0-9$]*\).*xtern.*/\1/p'";\
7326 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7328 elif com="$sed -n -e '/|UNDEF/d' -e '/FUNC..GL/s/^.*|__*//p'";\
7330 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7332 elif com="$sed -n -e 's/^.* D __*//p' -e 's/^.* D //p'";\
7334 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7336 elif com="$sed -n -e 's/^_//' -e 's/^\([a-zA-Z_0-9]*\).*xtern.*text.*/\1/p'";\
7338 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7340 elif com="$sed -n -e 's/^.*|FUNC |GLOB .*|//p'";\
7342 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7344 elif com="$grep '|' | $sed -n -e '/|COMMON/d' -e '/|DATA/d' \
7345 -e '/ file/d' -e 's/^\([^ ]*\).*/\1/p'";\
7347 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7349 elif com="$sed -n -e 's/^.*|FUNC |GLOB .*|//p' -e 's/^.*|FUNC |WEAK .*|//p'";\
7351 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7353 elif com="$sed -n -e 's/^__//' -e '/|Undef/d' -e '/|Proc/s/ .*//p'";\
7355 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7357 elif com="$sed -n -e 's/^.*|Proc .*|Text *| *//p'";\
7359 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7361 elif com="$sed -n -e '/Def. Text/s/.* \([^ ]*\)\$/\1/p'";\
7363 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7365 elif com="$sed -n -e 's/^[-0-9a-f ]*_\(.*\)=.*/\1/p'";\
7367 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7369 elif com="$sed -n -e 's/.*\.text n\ \ \ \.//p'";\
7371 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7373 elif com="sed -n -e 's/^__.*//' -e 's/[ ]*D[ ]*[0-9]*.*//p'";\
7375 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7378 $nm -p $* 2>/dev/null >libc.tmp
7379 $grep fprintf libc.tmp > libc.ptf
7380 if com="$sed -n -e 's/^.* [ADTSIW] *_[_.]*//p' -e 's/^.* [ADTSIW] //p'";\
7381 eval $xscan; $contains '^fprintf$' libc.list >/dev/null 2>&1
7387 echo "$nm didn't seem to work right. Trying $ar instead..." >&4
7389 if $ar t $libc > libc.tmp && $contains '^fprintf$' libc.tmp >/dev/null 2>&1; then
7390 for thisname in $libnames $libc; do
7391 $ar t $thisname >>libc.tmp
7393 $sed -e "s/\\$_o\$//" < libc.tmp > libc.list
7395 elif test "X$osname" = "Xos2" && $ar tv $libc > libc.tmp; then
7396 # Repeat libc to extract forwarders to DLL entries too
7397 for thisname in $libnames $libc; do
7398 $ar tv $thisname >>libc.tmp
7399 # Revision 50 of EMX has bug in $ar.
7400 # it will not extract forwarders to DLL entries
7401 # Use emximp which will extract exactly them.
7402 emximp -o tmp.imp $thisname \
7404 $sed -e 's/^\([_a-zA-Z0-9]*\) .*$/\1/p' \
7405 < tmp.imp >>libc.tmp
7408 $sed -e "s/\\$_o\$//" -e 's/^ \+//' < libc.tmp > libc.list
7411 echo "$ar didn't seem to work right." >&4
7412 echo "Maybe this is a Cray...trying bld instead..." >&4
7413 if bld t $libc | $sed -e 's/.*\///' -e "s/\\$_o:.*\$//" > libc.list
7415 for thisname in $libnames; do
7417 $sed -e 's/.*\///' -e "s/\\$_o:.*\$//" >>libc.list
7418 $ar t $thisname >>libc.tmp
7422 echo "That didn't work either. Giving up." >&4
7432 echo "Since you are compiling for PASE, extracting more symbols from libc.a ...">&4
7433 dump -Tv /lib/libc.a | awk '$7 == "/unix" {print $5 " " $8}' | grep "^SV" | awk '{print $2}' >> libc.list
7435 *) if $test -f /lib/syscalls.exp; then
7437 echo "Also extracting names from /lib/syscalls.exp for good ole AIX..." >&4
7438 $sed -n 's/^\([^ ]*\)[ ]*syscall[0-9]*[ ]*$/\1/p' /lib/syscalls.exp >>libc.list
7444 $rm -f libnames libpath
7446 : see if dld is available
7450 : is a C symbol defined?
7453 -v) tf=libc.tmp; tdc="";;
7454 -a) tf=libc.tmp; tdc="[]";;
7455 *) tlook="^$1\$"; tf=libc.list; tdc="()";;
7458 case "$reuseval-$4" in
7460 true-*) tx=no; eval "tval=\$$4"; case "$tval" in "") tx=yes;; esac;;
7465 if $test "$runnm" = true; then
7466 if $contains $tlook $tf >/dev/null 2>&1; then
7468 elif $test "$mistrustnm" = compile -o "$mistrustnm" = run; then
7469 echo "void *(*(p()))$tdc { extern void *$1$tdc; return &$1; } int main() { if(p()) return(0); else return(1); }"> try.c;
7470 $cc -o try $optimize $ccflags $ldflags try.c >/dev/null 2>&1 $libs && tval=true;
7471 $test "$mistrustnm" = run -a -x try && { $run ./try$_exe >/dev/null 2>&1 || tval=false; };
7472 $rm -f try$_exe try.c core core.* try.core;
7475 echo "void *(*(p()))$tdc { extern void *$1$tdc; return &$1; } int main() { if(p()) return(0); else return(1); }"> try.c;
7476 $cc -o try $optimize $ccflags $ldflags try.c $libs >/dev/null 2>&1 && tval=true;
7477 $rm -f try$_exe try.c;
7482 $define) tval=true;;
7489 : define an is-in-libc? function
7490 inlibc='echo " "; td=$define; tu=$undef;
7491 sym=$1; var=$2; eval "was=\$$2";
7493 case "$reuseval$was" in
7503 echo "$sym() found." >&4;
7504 case "$was" in $undef) . ./whoa; esac; eval "$var=\$td";;
7506 echo "$sym() NOT found." >&4;
7507 case "$was" in $define) . ./whoa; esac; eval "$var=\$tu";;
7511 $define) echo "$sym() found." >&4;;
7512 *) echo "$sym() NOT found." >&4;;
7516 : see if dlopen exists
7523 : determine which dynamic loading, if any, to compile in
7525 dldir="ext/DynaLoader"
7538 $define) dflt='y' ;;
7541 $define) dflt='y' ;;
7543 : Does a dl_xxx.xs file exist for this operating system
7544 $test -f $rsrc/$dldir/dl_${osname}.xs && dflt='y'
7547 rp="Do you wish to use dynamic loading?"
7554 if $test -f $rsrc/$dldir/dl_${osname}.xs ; then
7555 dflt="$dldir/dl_${osname}.xs"
7556 elif $test "$d_dlopen" = "$define" ; then
7557 dflt="$dldir/dl_dlopen.xs"
7558 elif $test "$i_dld" = "$define" ; then
7559 dflt="$dldir/dl_dld.xs"
7564 *) dflt="$dldir/$dlsrc"
7567 echo "The following dynamic loading files are available:"
7568 : Can not go over to $dldir because getfile has path hard-coded in.
7569 tdir=`pwd`; cd "$rsrc"; $ls -C $dldir/dl*.xs; cd "$tdir"
7570 rp="Source file to use for dynamic loading"
7576 dlsrc=`echo $ans | $sed -e 's%.*/\([^/]*\)$%\1%'`
7580 Some systems may require passing special flags to $cc -c to
7581 compile modules that will be used to create a shared library.
7582 To use no flags, say "none".
7585 case "$cccdlflags" in
7586 '') case "$gccversion" in
7587 '') case "$osname" in
7589 next) dflt='none' ;;
7590 irix*) dflt='-KPIC' ;;
7591 svr4*|esix*|solaris|nonstopux) dflt='-KPIC' ;;
7592 sunos) dflt='-pic' ;;
7596 *) case "$osname" in
7597 darwin) dflt='none' ;;
7598 svr4*|esix*|solaris|nonstopux) dflt='-fPIC' ;;
7603 *) dflt="$cccdlflags" ;;
7605 rp="Any special flags to pass to $cc -c to compile shared library modules?"
7608 none) cccdlflags=' ' ;;
7609 *) cccdlflags="$ans" ;;
7614 Some systems use ld to create libraries that can be dynamically loaded,
7615 while other systems (such as those using ELF) use $cc.
7619 '') $cat >try.c <<EOM
7620 /* Test for whether ELF binaries are produced */
7628 int i = open("a.out",O_RDONLY);
7631 if(read(i,b,4)==4 && b[0]==127 && b[1]=='E' && b[2]=='L' && b[3]=='F')
7632 exit(0); /* succeed (yes, it's ELF) */
7637 if $cc $ccflags $ldflags try.c >/dev/null 2>&1 && $run ./a.out; then
7639 You appear to have ELF support. I'll use $cc to build dynamic libraries.
7643 echo "I'll use ld to build dynamic libraries."
7652 rp="What command should be used to create dynamic libraries?"
7658 Some systems may require passing special flags to $ld to create a
7659 library that can be dynamically loaded. If your ld flags include
7660 -L/other/path options to locate libraries outside your loader's normal
7661 search path, you may need to specify those -L options here as well. To
7662 use no flags, say "none".
7665 case "$lddlflags" in
7666 '') case "$osname" in
7667 beos) dflt='-nostart' ;;
7669 case "$gccversion" in
7670 '') dflt="$dflt +vnocompatwarnings" ;;
7673 linux|irix*|gnu*) dflt='-shared' ;;
7674 next) dflt='none' ;;
7675 solaris) dflt='-G' ;;
7676 sunos) dflt='-assert nodefinitions' ;;
7677 svr4*|esix*|nonstopux) dflt="-G $ldflags" ;;
7681 *) dflt="$lddlflags" ;;
7684 : Try to guess additional flags to pick up local libraries.
7685 : Be careful not to append to a plain 'none'
7689 for thisflag in $ldflags; do
7694 *) dflt="$dflt $thisflag" ;;
7701 ''|' ') dflt='none' ;;
7704 rp="Any special flags to pass to $ld to create a dynamically loaded library?"
7707 none) lddlflags=' ' ;;
7708 *) lddlflags="$ans" ;;
7713 Some systems may require passing special flags to $cc to indicate that
7714 the resulting executable will use dynamic linking. To use no flags,
7718 case "$ccdlflags" in
7719 '') case "$osname" in
7720 linux|hpux|gnu*) dflt='-Wl,-E' ;;
7721 next|sunos) dflt='none' ;;
7725 *) dflt="$ccdlflags" ;;
7727 rp="Any special flags to pass to $cc to use dynamic linking?"
7730 none) ccdlflags=' ' ;;
7731 *) ccdlflags="$ans" ;;
7745 # No dynamic loading being used, so don't bother even to prompt.
7748 *) case "$useshrplib" in
7749 '') case "$osname" in
7750 svr4*|nonstopux|dgux|dynixptx|esix|powerux|beos|cygwin*)
7752 also='Building a shared libperl is required for dynamic loading to work on your system.'
7757 also='Building a shared libperl is needed for MAB support.'
7775 The perl executable is normally obtained by linking perlmain.c with
7776 libperl${_a}, any static extensions (usually just DynaLoader), and
7777 any other libraries needed on this system (such as -lm, etc.). Since
7778 your system supports dynamic loading, it is probably possible to build
7779 a shared libperl.$so. If you will have more than one executable linked
7780 to libperl.$so, this will significantly reduce the size of each
7781 executable, but it may have a noticeable effect on performance. The
7782 default is probably sensible for your system.
7786 rp="Build a shared libperl.$so (y/n)"
7790 useshrplib='true' ;;
7791 *) useshrplib='false' ;;
7796 case "$useshrplib" in
7800 # Figure out a good name for libperl.so. Since it gets stored in
7801 # a version-specific architecture-dependent library, the version
7802 # number isn't really that important, except for making cc/ld happy.
7804 # A name such as libperl.so.3.1
7805 majmin="libperl.$so.$patchlevel.$subversion"
7806 # A name such as libperl.so.301
7807 majonly=`echo $patchlevel $subversion |
7808 $awk '{printf "%d%02d", $1, $2}'`
7809 majonly=libperl.$so.$majonly
7810 # I'd prefer to keep the os-specific stuff here to a minimum, and
7811 # rely on figuring it out from the naming of libc.
7812 case "${osname}${osvers}" in
7815 # XXX How handle the --version stuff for MAB?
7817 linux*|gnu*) # ld won't link with a bare -lperl otherwise.
7820 cygwin*) # ld links against an importlib
7821 dflt=libperl$lib_ext
7823 *) # Try to guess based on whether libc has major.minor.
7825 *libc.$so.[0-9]*.[0-9]*) dflt=$majmin ;;
7826 *libc.$so.[0-9]*) dflt=$majonly ;;
7827 *) dflt=libperl.$so ;;
7837 I need to select a good name for the shared libperl. If your system uses
7838 library names with major and minor numbers, then you might want something
7839 like $majmin. Alternatively, if your system uses a single version
7840 number for shared libraries, then you might want to use $majonly.
7841 Or, your system might be quite happy with a simple libperl.$so.
7843 Since the shared libperl will get installed into a version-specific
7844 architecture-dependent directory, the version number of the shared perl
7845 library probably isn't important, so the default should be o.k.
7848 rp='What name do you want to give to the shared libperl?'
7851 echo "Ok, I'll use $libperl"
7854 libperl="libperl${_a}"
7858 # Detect old use of shrpdir via undocumented Configure -Dshrpdir
7862 WARNING: Use of the shrpdir variable for the installation location of
7863 the shared $libperl is not supported. It was never documented and
7864 will not work in this version. Let me (perlbug@perl.org)
7865 know of any problems this may cause.
7871 But your current setting of $shrpdir is
7872 the default anyway, so it's harmless.
7877 Further, your current attempted setting of $shrpdir
7878 conflicts with the value of $archlibexp/CORE
7879 that installperl will use.
7886 # How will the perl executable find the installed shared $libperl?
7887 # Add $xxx to ccdlflags.
7888 # If we can't figure out a command-line option, use $shrpenv to
7889 # set env LD_RUN_PATH. The main perl makefile uses this.
7890 shrpdir=$archlibexp/CORE
7893 if "$useshrplib"; then
7896 # We'll set it in Makefile.SH...
7901 freebsd|netbsd|openbsd|interix|dragonfly)
7902 xxx="-Wl,-R$shrpdir"
7904 bsdos|linux|irix*|dec_osf|gnu*)
7905 xxx="-Wl,-rpath,$shrpdir"
7908 # next doesn't like the default...
7911 # beos doesn't like the default, either.
7914 # hpux doesn't like the default, either.
7915 tmp_shrpenv="env LDOPTS=\"+s +b${shrpdir}\""
7918 tmp_shrpenv="env LD_RUN_PATH=$shrpdir"
7924 # Only add $xxx if it isn't already in ccdlflags.
7925 case " $ccdlflags " in
7927 *) ccdlflags="$ccdlflags $xxx"
7930 Adding $xxx to the flags
7931 passed to $ld so that the perl executable will find the
7932 installed shared $libperl.
7940 # Fix ccdlflags in AIX for building external extensions.
7941 # (For building Perl itself bare -bE:perl.exp is needed,
7942 # Makefile.SH takes care of this.)
7944 aix) ccdlflags="$ccdlflags -bE:$installarchlib/CORE/perl.exp" ;;
7946 # Respect a hint or command-line value.
7948 '') shrpenv="$tmp_shrpenv" ;;
7950 case "$ldlibpthname" in
7951 '') ldlibpthname=LD_LIBRARY_PATH ;;
7952 none) ldlibpthname='' ;;
7955 : determine where manual pages are on this system
7959 syspath='/usr/share/man/man1 /usr/man/man1'
7960 syspath="$syspath /usr/man/mann /usr/man/manl /usr/man/local/man1"
7961 syspath="$syspath /usr/man/u_man/man1"
7962 syspath="$syspath /usr/catman/u_man/man1 /usr/man/l_man/man1"
7963 syspath="$syspath /usr/local/man/u_man/man1 /usr/local/man/l_man/man1"
7964 syspath="$syspath /usr/man/man.L /local/man/man1 /usr/local/man/man1"
7965 sysman=`./loc . /usr/man/man1 $syspath`
7968 if $test -d "$sysman"; then
7969 echo "System manual is in $sysman." >&4
7971 echo "Could not find manual pages in source form." >&4
7974 : determine where manual pages go
7975 set man1dir man1dir none
7979 $spackage has manual pages available in source form.
7983 echo "However, you don't have nroff, so they're probably useless to you."
7985 '') man1dir="none";;
7988 echo "If you don't want the manual sources installed, answer 'none'."
7993 lookpath="$prefixexp/share/man/man1"
7994 lookpath="$lookpath $prefixexp/man/man1 $prefixexp/man/l_man/man1"
7995 lookpath="$lookpath $prefixexp/man/p_man/man1"
7996 lookpath="$lookpath $prefixexp/man/u_man/man1"
7997 lookpath="$lookpath $prefixexp/man/man.1"
7999 */?_man*) dflt=`./loc . $prefixexp/l_man/man1 $lookpath` ;;
8000 *) dflt=`./loc . $prefixexp/man/man1 $lookpath` ;;
8010 rp="Where do the main $spackage manual pages (source) go?"
8012 if $test "X$man1direxp" != "X$ansexp"; then
8016 man1direxp="$ansexp"
8022 : Change installation prefix, if necessary.
8023 if $test X"$prefix" != X"$installprefix"; then
8024 installman1dir=`echo $man1direxp | $sed "s#^$prefix#$installprefix#"`
8026 installman1dir="$man1direxp"
8029 : What suffix to use on installed man pages
8036 rp="What suffix should be used for the main $spackage man pages?"
8038 '') case "$man1dir" in
8052 *) dflt="$man1ext";;
8059 : see if we can have long filenames
8061 first=123456789abcdef
8063 if (echo hi >$first) 2>/dev/null; then
8064 if $test -f 123456789abcde; then
8065 echo 'You cannot have filenames longer than 14 characters. Sigh.' >&4
8068 echo 'You can have filenames longer than 14 characters.'>&4
8073 You can't have filenames longer than 14 chars.
8074 You can't even think about them!
8080 $rm -rf 123456789abcde*
8082 : determine where library module manual pages go
8083 set man3dir man3dir none
8087 $spackage has manual pages for many of the library modules.
8093 However, you don't have nroff, so they're probably useless to you.
8096 '') man3dir="none";;
8100 case "$d_flexfnam" in
8103 However, your system can't handle the long file names like File::Basename.3.
8106 '') man3dir="none";;
8110 echo "If you don't want the manual sources installed, answer 'none'."
8111 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
8113 '') dflt=`echo "$man1dir" | $sed -e 's/man1/man3/g' -e 's/man\.1/man\.3/g'`
8114 if $test -d "$privlib/man/man3"; then
8117 WARNING: Previous versions of perl installed man3 pages into
8118 $privlib/man/man3. This version will suggest a
8119 new default of $dflt.
8123 rp='Do you wish to preserve the old behavior?(y/n)'
8126 y*) dflt="$privlib/man/man3" ;;
8131 *) dflt="$man3dir" ;;
8138 rp="Where do the $package library man pages (source) go?"
8141 man3direxp="$ansexp"
8147 : Change installation prefix, if necessary.
8148 if $test X"$prefix" != X"$installprefix"; then
8149 installman3dir=`echo $man3direxp | $sed "s#^$prefix#$installprefix#"`
8151 installman3dir="$man3direxp"
8154 : What suffix to use on installed man pages
8160 rp="What suffix should be used for the $package library man pages?"
8162 '') case "$man3dir" in
8176 *) dflt="$man3ext";;
8183 : see if we have to deal with yellow pages, now NIS.
8184 if $test -d /usr/etc/yp || $test -d /etc/yp || $test -d /usr/lib/yp; then
8185 if $test -f /usr/etc/nibindd; then
8187 echo "I'm fairly confident you're on a NeXT."
8189 rp='Do you get the hosts file via NetInfo?'
8198 y*) hostcat='nidump hosts .';;
8199 *) case "$hostcat" in
8200 nidump*) hostcat='';;
8210 '') if $contains '^\+' /etc/passwd >/dev/null 2>&1; then
8218 rp='Are you getting the hosts file via yellow pages?'
8221 y*) hostcat='ypcat hosts';;
8222 *) hostcat='cat /etc/hosts';;
8228 '') test -f /etc/hosts && hostcat='cat /etc/hosts';;
8231 '') test -f /etc/group && groupcat='cat /etc/group';;
8234 '') test -f /etc/passwd && passcat='cat /etc/passwd';;
8237 : now get the host name
8239 echo "Figuring out host name..." >&4
8240 case "$myhostname" in
8242 echo 'Maybe "hostname" will work...'
8243 if tans=`sh -c hostname 2>&1` ; then
8251 if $test "$cont"; then
8253 echo 'Oh, dear. Maybe "/etc/systemid" is the key...'
8254 if tans=`cat /etc/systemid 2>&1` ; then
8256 phostname='cat /etc/systemid'
8257 echo "Whadyaknow. Xenix always was a bit strange..."
8260 elif $test -r /etc/systemid; then
8261 echo "(What is a non-Xenix system doing with /etc/systemid?)"
8264 if $test "$cont"; then
8265 echo 'No, maybe "uuname -l" will work...'
8266 if tans=`sh -c 'uuname -l' 2>&1` ; then
8268 phostname='uuname -l'
8270 echo 'Strange. Maybe "uname -n" will work...'
8271 if tans=`sh -c 'uname -n' 2>&1` ; then
8273 phostname='uname -n'
8275 echo 'Oh well, maybe I can mine it out of whoami.h...'
8276 if tans=`sh -c $contains' sysname $usrinc/whoami.h' 2>&1` ; then
8277 myhostname=`echo "$tans" | $sed 's/^.*"\(.*\)"/\1/'`
8278 phostname="sed -n -e '"'/sysname/s/^.*\"\\(.*\\)\"/\1/{'"' -e p -e q -e '}' <$usrinc/whoami.h"
8280 case "$myhostname" in
8281 '') echo "Does this machine have an identity crisis or something?"
8284 echo "Well, you said $myhostname before..."
8285 phostname='echo $myhostname';;
8291 case "$myhostname" in
8292 '') myhostname=noname ;;
8294 : you do not want to know about this
8299 if $test "$myhostname" ; then
8301 rp='Your host name appears to be "'$myhostname'".'" Right?"
8309 : bad guess or no guess
8310 while $test "X$myhostname" = X ; do
8312 rp="Please type the (one word) name of your host:"
8317 : translate upper to lower if necessary
8318 case "$myhostname" in
8320 echo "(Normalizing case in your host name)"
8321 myhostname=`echo $myhostname | ./tr '[A-Z]' '[a-z]'`
8325 case "$myhostname" in
8327 dflt=`expr "X$myhostname" : "X[^.]*\(\..*\)"`
8328 myhostname=`expr "X$myhostname" : "X\([^.]*\)\."`
8329 echo "(Trimming domain name from host name--host name is now $myhostname)"
8331 *) case "$mydomain" in
8334 test "X$hostcat" = "Xypcat hosts" &&
8335 ypmatch "$myhostname" hosts 2>/dev/null |\
8336 $sed -e 's/[ ]*#.*//; s/$/ /' > hosts && \
8339 test "X$hostcat" != "X" &&
8340 $hostcat | $sed -n -e "s/[ ]*#.*//; s/\$/ /
8341 /[ ]$myhostname[ . ]/p" > hosts
8344 if $test -f hosts; then
8345 $test x`$awk "/[0-9].*[ ]$myhostname$tmp_re/ { sum++ }
8346 END { print sum }" hosts` = x1 || tmp_re="[ ]"
8347 dflt=.`$awk "/[0-9].*[ ]$myhostname$tmp_re/ {for(i=2; i<=NF;i++) print \\\$i}" \
8348 hosts | $sort | $uniq | \
8349 $sed -n -e "s/$myhostname\.\([-a-zA-Z0-9_.]\)/\1/p"`
8350 case `$echo X$dflt` in
8351 X*\ *) echo "(Several hosts in the database matched hostname)"
8354 X.) echo "(You do not have fully-qualified names in the hosts database)"
8358 echo "(I cannot locate a hosts database anywhere)"
8363 tans=`./loc resolv.conf X /etc /usr/etc`
8364 if $test -f "$tans"; then
8365 echo "(Attempting domain name extraction from $tans)"
8366 dflt=.`$sed -n -e 's/ / /g' \
8367 -e 's/^search *\([^ ]*\).*/\1/p' $tans \
8368 | ./tr '[A-Z]' '[a-z]' 2>/dev/null`
8370 .) dflt=.`$sed -n -e 's/ / /g' \
8371 -e 's/^domain *\([^ ]*\).*/\1/p' $tans \
8372 | ./tr '[A-Z]' '[a-z]' 2>/dev/null`
8379 .) echo "(No help from resolv.conf either -- attempting clever guess)"
8380 dflt=.`sh -c domainname 2>/dev/null`
8383 .nis.*|.yp.*|.main.*) dflt=`echo $dflt | $sed -e 's/^\.[^.]*//'`;;
8387 case "$dflt$osname" in
8388 .os390) echo "(Attempting domain name extraction from //'SYS1.TCPPARMS(TCPDATA)')"
8389 dflt=.`awk '/^DOMAINORIGIN/ {print $2}' "//'SYS1.TCPPARMS(TCPDATA)'" 2>/dev/null`
8393 .) echo "(Lost all hope -- silly guess then)"
8399 *) dflt="$mydomain";;
8403 rp="What is your domain name?"
8413 : translate upper to lower if necessary
8416 echo "(Normalizing case in your domain name)"
8417 mydomain=`echo $mydomain | ./tr '[A-Z]' '[a-z]'`
8421 : a little sanity check here
8422 case "$phostname" in
8425 case `$phostname | ./tr '[A-Z]' '[a-z]'` in
8426 $myhostname$mydomain|$myhostname) ;;
8428 case "$phostname" in
8430 echo "(That doesn't agree with your whoami.h file, by the way.)"
8433 echo "(That doesn't agree with your $phostname command, by the way.)"
8443 I need to get your e-mail address in Internet format if possible, i.e.
8444 something like user@host.domain. Please answer accurately since I have
8445 no easy means to double check it. The default value provided below
8446 is most probably close to reality but may not be valid from outside
8447 your organization...
8451 while test "$cont"; do
8453 '') dflt="$cf_by@$myhostname$mydomain";;
8454 *) dflt="$cf_email";;
8456 rp='What is your e-mail address?'
8462 rp='Address does not look like an Internet one. Use it anyway?'
8478 If you or somebody else will be maintaining perl at your site, please
8479 fill in the correct e-mail address here so that they may be contacted
8480 if necessary. Currently, the "perlbug" program included with perl
8481 will send mail to this address in addition to perlbug@perl.org. You may
8482 enter "none" for no administrator.
8485 case "$perladmin" in
8486 '') dflt="$cf_email";;
8487 *) dflt="$perladmin";;
8489 rp='Perl administrator e-mail address'
8493 : determine whether to only install version-specific parts.
8496 Do you want to install only the version-specific parts of the perl
8497 distribution? Usually you do *not* want to do this.
8499 case "$versiononly" in
8500 "$define"|[Yy]*|true) dflt='y' ;;
8503 rp="Do you want to install only the version-specific parts of perl?"
8506 [yY]*) val="$define";;
8512 case "$versiononly" in
8513 "$define") inc_version_list=''
8514 inc_version_list_init=0
8518 : figure out how to guarantee perl startup
8519 case "$startperl" in
8521 case "$sharpbang" in
8525 I can use the #! construct to start perl on your system. This will
8526 make startup of perl scripts faster, but may cause problems if you
8527 want to share those scripts and perl is not in a standard place
8528 ($binexp/perl) on all your platforms. The alternative is to force
8529 a shell by starting the script with a single ':' character.
8532 case "$versiononly" in
8533 "$define") dflt="$binexp/perl$version";;
8534 *) dflt="$binexp/perl";;
8536 rp='What shall I put after the #! to start up perl ("none" to not use #!)?'
8539 none) startperl=": # use perl";;
8540 *) startperl="#!$ans"
8541 if $test 30 -lt `echo "$ans" | wc -c`; then
8544 WARNING: Some systems limit the #! command to 32 characters.
8545 If you experience difficulty running Perl scripts with #!, try
8546 installing Perl in a directory with a shorter pathname.
8552 *) startperl=": # use perl"
8557 echo "I'll use $startperl to start perl scripts."
8559 : figure best path for perl in scripts
8562 case "$versiononly" in
8563 "$define") perlpath="$binexp/perl$version";;
8564 *) perlpath="$binexp/perl";;
8566 case "$startperl" in
8571 I will use the "eval 'exec'" idiom to start Perl on your system.
8572 I can use the full path of your Perl binary for this purpose, but
8573 doing so may cause problems if you want to share those scripts and
8574 Perl is not always in a standard place ($binexp/perl).
8578 rp="What path shall I use in \"eval 'exec'\"?"
8585 case "$startperl" in
8587 *) echo "I'll use $perlpath in \"eval 'exec'\"" ;;
8590 : determine where public executable scripts go
8591 set scriptdir scriptdir
8593 case "$scriptdir" in
8596 : guess some guesses
8597 $test -d /usr/share/scripts && dflt=/usr/share/scripts
8598 $test -d /usr/share/bin && dflt=/usr/share/bin
8599 $test -d /usr/local/script && dflt=/usr/local/script
8600 $test -d /usr/local/scripts && dflt=/usr/local/scripts
8601 $test -d $prefixexp/script && dflt=$prefixexp/script
8605 *) dflt="$scriptdir"
8610 Some installations have a separate directory just for executable scripts so
8611 that they can mount it across multiple architectures but keep the scripts in
8612 one spot. You might, for example, have a subdirectory of /usr/share for this.
8613 Or you might just lump your scripts in with all your other executables.
8617 rp='Where do you keep publicly executable scripts?'
8619 if $test "X$ansexp" != "X$scriptdirexp"; then
8623 scriptdirexp="$ansexp"
8624 : Change installation prefix, if necessary.
8625 if $test X"$prefix" != X"$installprefix"; then
8626 installscript=`echo $scriptdirexp | sed "s#^$prefix#$installprefix#"`
8628 installscript="$scriptdirexp"
8631 : determine where add-on public executables go
8633 '') dflt=$siteprefix/bin ;;
8637 rp='Pathname where the add-on public executables should be installed?'
8640 sitebinexp="$ansexp"
8641 : Change installation prefix, if necessary.
8642 if $test X"$prefix" != X"$installprefix"; then
8643 installsitebin=`echo $sitebinexp | sed "s#^$prefix#$installprefix#"`
8645 installsitebin="$sitebinexp"
8648 : determine where add-on html pages go
8649 : There is no standard location, so try to copy the previously-selected
8650 : directory structure for the core html pages.
8651 case "$sitehtml1dir" in
8652 '') dflt=`echo "$html1dir" | $sed "s#^$prefix#$siteprefix#"` ;;
8653 *) dflt=$sitehtml1dir ;;
8656 ''|' ') dflt=none ;;
8659 rp='Pathname where the site-specific html pages should be installed?'
8662 sitehtml1direxp="$ansexp"
8663 : Change installation prefix, if necessary.
8664 if $test X"$prefix" != X"$installprefix"; then
8665 installsitehtml1dir=`echo $sitehtml1direxp | $sed "s#^$prefix#$installprefix#"`
8667 installsitehtml1dir="$sitehtml1direxp"
8670 : determine where add-on library html pages go
8671 : There is no standard location, so try to copy the previously-selected
8672 : directory structure for the core html pages.
8673 case "$sitehtml3dir" in
8674 '') dflt=`echo "$html3dir" | $sed "s#^$prefix#$siteprefix#"` ;;
8675 *) dflt=$sitehtml3dir ;;
8678 ''|' ') dflt=none ;;
8681 rp='Pathname where the site-specific library html pages should be installed?'
8684 sitehtml3direxp="$ansexp"
8685 : Change installation prefix, if necessary.
8686 if $test X"$prefix" != X"$installprefix"; then
8687 installsitehtml3dir=`echo $sitehtml3direxp | $sed "s#^$prefix#$installprefix#"`
8689 installsitehtml3dir="$sitehtml3direxp"
8692 : determine where add-on manual pages go
8693 case "$siteman1dir" in
8694 '') dflt=`echo $man1dir | $sed "s#^$prefix#$siteprefix#"` ;;
8695 *) dflt=$siteman1dir ;;
8698 ''|' ') dflt=none ;;
8701 rp='Pathname where the site-specific manual pages should be installed?'
8704 siteman1direxp="$ansexp"
8705 : Change installation prefix, if necessary.
8706 if $test X"$prefix" != X"$installprefix"; then
8707 installsiteman1dir=`echo $siteman1direxp | $sed "s#^$prefix#$installprefix#"`
8709 installsiteman1dir="$siteman1direxp"
8712 : determine where add-on library man pages go
8713 case "$siteman3dir" in
8714 '') dflt=`echo $man3dir | $sed "s#^$prefix#$siteprefix#"` ;;
8715 *) dflt=$siteman3dir ;;
8718 ''|' ') dflt=none ;;
8721 rp='Pathname where the site-specific library manual pages should be installed?'
8724 siteman3direxp="$ansexp"
8725 : Change installation prefix, if necessary.
8726 if $test X"$prefix" != X"$installprefix"; then
8727 installsiteman3dir=`echo $siteman3direxp | $sed "s#^$prefix#$installprefix#"`
8729 installsiteman3dir="$siteman3direxp"
8732 : determine where add-on public executable scripts go
8733 case "$sitescript" in
8734 '') dflt=$siteprefix/script
8735 $test -d $dflt || dflt=$sitebin ;;
8736 *) dflt="$sitescript" ;;
8739 rp='Pathname where add-on public executable scripts should be installed?'
8742 sitescriptexp="$ansexp"
8743 : Change installation prefix, if necessary.
8744 if $test X"$prefix" != X"$installprefix"; then
8745 installsitescript=`echo $sitescriptexp | sed "s#^$prefix#$installprefix#"`
8747 installsitescript="$sitescriptexp"
8750 case "$usefaststdio" in
8751 $define|true|[yY]*|'')
8752 xversion=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
8762 Perl can be built to use 'fast stdio', which means using the stdio
8763 library but also directly manipulating the stdio buffers to enable
8764 faster I/O. Using stdio is better for backward compatibility (especially
8765 for Perl extensions), but on the other hand since Perl 5.8 the 'perlio'
8766 interface has been preferred instead of stdio.
8768 If this doesn't make any sense to you, just accept the default '$dflt'.
8770 rp='Use the "fast stdio" if available?'
8773 y|Y) val="$define" ;;
8780 : define an is-a-typedef? function
8781 typedef='type=$1; var=$2; def=$3; shift; shift; shift; inclist=$@;
8783 "") inclist="sys/types.h";;
8785 eval "varval=\$$var";
8789 for inc in $inclist; do
8790 echo "#include <$inc>" >>temp.c;
8792 echo "#ifdef $type" >> temp.c;
8793 echo "printf(\"We have $type\");" >> temp.c;
8794 echo "#endif" >> temp.c;
8795 $cppstdin $cppflags $cppminus < temp.c >temp.E 2>/dev/null;
8796 if $contains $type temp.E >/dev/null 2>&1; then
8802 *) eval "$var=\$varval";;
8805 : define an is-a-typedef? function that prompts if the type is not available.
8806 typedef_ask='type=$1; var=$2; def=$3; shift; shift; shift; inclist=$@;
8808 "") inclist="sys/types.h";;
8810 eval "varval=\$$var";
8814 for inc in $inclist; do
8815 echo "#include <$inc>" >>temp.c;
8817 echo "#ifdef $type" >> temp.c;
8818 echo "printf(\"We have $type\");" >> temp.c;
8819 echo "#endif" >> temp.c;
8820 $cppstdin $cppflags $cppminus < temp.c >temp.E 2>/dev/null;
8822 echo "$rp" | $sed -e "s/What is/Looking for/" -e "s/?/./";
8823 if $contains $type temp.E >/dev/null 2>&1; then
8824 echo "$type found." >&4;
8827 echo "$type NOT found." >&4;
8833 *) eval "$var=\$varval";;
8836 : see what type lseek is declared as in the kernel
8837 rp="What is the type used for lseek's offset on this system?"
8838 set off_t lseektype long stdio.h sys/types.h
8842 echo "Checking to see how big your file offsets are..." >&4
8844 #include <sys/types.h>
8848 printf("%d\n", (int)sizeof($lseektype));
8853 if eval $compile_ok; then
8854 lseeksize=`$run ./try`
8855 echo "Your file offsets are $lseeksize bytes long."
8859 echo "(I can't seem to compile the test program. Guessing...)"
8860 rp="What is the size of your file offsets (in bytes)?"
8866 : see what type file positions are declared as in the library
8867 rp="What is the type for file position used by fsetpos()?"
8868 set fpos_t fpostype long stdio.h sys/types.h
8873 *_t) zzz="$fpostype" ;;
8876 echo "Checking the size of $zzz..." >&4
8878 #include <sys/types.h>
8885 printf("%d\n", (int)sizeof($fpostype));
8890 if eval $compile_ok; then
8894 echo "(I can't execute the test program--guessing $fpossize.)" >&4
8897 echo "Your $zzz is $fpossize bytes long."
8903 echo "(I can't compile the test program. Guessing...)" >&4
8904 rp="What is the size of your file positions (in bytes)?"
8909 # Backward compatibility (uselfs is deprecated).
8911 "$define"|true|[yY]*)
8914 *** Configure -Duselfs is deprecated, using -Duselargefiles instead.
8916 uselargefiles="$define"
8920 case "$lseeksize:$fpossize" in
8923 You can have files larger than 2 gigabytes.
8926 *) case "$uselargefiles" in
8927 "$undef"|false|[nN]*) dflt='n' ;;
8932 Perl can be built to understand large files (files larger than 2 gigabytes)
8933 on some systems. To do so, Configure can be run with -Duselargefiles.
8935 If this doesn't make any sense to you, just accept the default '$dflt'.
8937 rp='Try to understand large files, if available?'
8940 y|Y) val="$define" ;;
8947 : Look for a hint-file generated 'call-back-unit'. If the
8948 : user has specified that a large files perl is to be built,
8949 : we may need to set or change some other defaults.
8950 if $test -f uselargefiles.cbu; then
8951 echo "Your platform has some specific hints regarding large file builds, using them..."
8952 . ./uselargefiles.cbu
8954 case "$uselargefiles" in
8956 if $test -f uselargefiles.cbu; then
8958 echo "Rechecking to see how big your file offsets are..." >&4
8960 #include <sys/types.h>
8964 printf("%d\n", (int)sizeof($lseektype));
8969 if eval $compile_ok; then
8970 lseeksize=`$run ./try`
8971 $echo "Your file offsets are now $lseeksize bytes long."
8975 echo "(I can't seem to compile the test program. Guessing...)"
8976 rp="What is the size of your file offsets (in bytes)?"
8981 *_t) zzz="$fpostype" ;;
8984 $echo $n "Rechecking the size of $zzz...$c" >&4
8986 #include <sys/types.h>
8993 printf("%d\n", (int)sizeof($fpostype));
8998 if eval $compile_ok; then
9003 echo "(I can't execute the test program--guessing $fpossize.)" >&4
9006 echo " $fpossize bytes." >&4
9012 echo "(I can't compile the test program. Guessing...)" >&4
9013 rp="What is the size of your file positions (in bytes)?"
9022 # probably will refer to
9023 # $archlib $privlib $sitearch $sitelib $vendorarch $vendorlib
9025 userelocatableinc=undef
9027 case "$vendorprefix" in
9028 '') d_vendorbin="$undef"
9032 *) d_vendorbin="$define"
9033 : determine where vendor-supplied executables go.
9034 case "$vendorbin" in
9035 '') dflt=$vendorprefix/bin ;;
9036 *) dflt="$vendorbin" ;;
9039 rp='Pathname for the vendor-supplied executables directory?'
9042 vendorbinexp="$ansexp"
9045 : Change installation prefix, if necessary.
9046 if $test X"$prefix" != X"$installprefix"; then
9047 installvendorbin=`echo $vendorbinexp | $sed "s#^$prefix#$installprefix#"`
9049 installvendorbin="$vendorbinexp"
9052 case "$vendorprefix" in
9053 '') vendorhtml1dir=''
9054 vendorhtml1direxp=''
9056 *) : determine where vendor-supplied html pages go.
9057 : There is no standard location, so try to copy the previously-selected
9058 : directory structure for the core html pages.
9059 : XXX Better default suggestions would be welcome.
9060 case "$vendorhtml1dir" in
9061 '') dflt=`echo "$html1dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
9062 *) dflt=$vendorhtml1dir ;;
9065 ''|' ') dflt=none ;;
9068 rp='Pathname for the vendor-supplied html pages?'
9070 vendorhtml1dir="$ans"
9071 vendorhtml1direxp="$ansexp"
9074 : Use ' ' for none so value is preserved next time through Configure
9075 $test X"$vendorhtml1dir" = "X" && vendorhtml1dir=' '
9076 : Change installation prefix, if necessary.
9077 if $test X"$prefix" != X"$installprefix"; then
9078 installvendorhtml1dir=`echo $vendorhtml1direxp | $sed "s#^$prefix#$installprefix#"`
9080 installvendorhtml1dir="$vendorhtml1direxp"
9083 case "$vendorprefix" in
9084 '') vendorhtml3dir=''
9085 vendorhtml3direxp=''
9087 *) : determine where vendor-supplied module html pages go.
9088 : There is no standard location, so try to copy the previously-selected
9089 : directory structure for the core html pages.
9090 : XXX Better default suggestions would be welcome.
9091 case "$vendorhtml3dir" in
9092 '') dflt=`echo "$html3dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
9093 *) dflt=$vendorhtml3dir ;;
9096 ''|' ') dflt=none ;;
9099 rp='Pathname for the vendor-supplied html pages?'
9101 vendorhtml3dir="$ans"
9102 vendorhtml3direxp="$ansexp"
9105 : Use ' ' for none so value is preserved next time through Configure
9106 $test X"$vendorhtml3dir" = "X" && vendorhtml3dir=' '
9107 : Change installation prefix, if necessary.
9108 if $test X"$prefix" != X"$installprefix"; then
9109 installvendorhtml3dir=`echo $vendorhtml3direxp | $sed "s#^$prefix#$installprefix#"`
9111 installvendorhtml3dir="$vendorhtml3direxp"
9114 case "$vendorprefix" in
9115 '') vendorman1dir=''
9118 *) : determine where vendor-supplied manual pages go.
9119 case "$vendorman1dir" in
9120 '') dflt=`echo "$man1dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
9121 *) dflt=$vendorman1dir ;;
9124 ''|' ') dflt=none ;;
9127 rp='Pathname for the vendor-supplied manual section 1 pages?'
9129 vendorman1dir="$ans"
9130 vendorman1direxp="$ansexp"
9133 : Use ' ' for none so value is preserved next time through Configure
9134 $test X"$vendorman1dir" = "X" && vendorman1dir=' '
9135 : Change installation prefix, if necessary.
9136 if $test X"$prefix" != X"$installprefix"; then
9137 installvendorman1dir=`echo "$vendorman1direxp" | $sed "s#^$prefix#$installprefix#"`
9139 installvendorman1dir="$vendorman1direxp"
9142 case "$vendorprefix" in
9143 '') vendorman3dir=''
9146 *) : determine where vendor-supplied module manual pages go.
9147 case "$vendorman3dir" in
9148 '') dflt=`echo "$man3dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
9149 *) dflt=$vendorman3dir ;;
9152 ''|' ') dflt=none ;;
9155 rp='Pathname for the vendor-supplied manual section 3 pages?'
9157 vendorman3dir="$ans"
9158 vendorman3direxp="$ansexp"
9161 : Use ' ' for none so value is preserved next time through Configure
9162 $test X"$vendorman3dir" = "X" && vendorman3dir=' '
9163 : Change installation prefix, if necessary.
9164 if $test X"$prefix" != X"$installprefix"; then
9165 installvendorman3dir=`echo "$vendorman3direxp" | $sed "s#^$prefix#$installprefix#"`
9167 installvendorman3dir="$vendorman3direxp"
9170 case "$vendorprefix" in
9171 '') d_vendorscript="$undef"
9175 *) d_vendorscript="$define"
9176 : determine where vendor-supplied scripts go.
9177 case "$vendorscript" in
9178 '') dflt=$vendorprefix/script
9179 $test -d $dflt || dflt=$vendorbin ;;
9180 *) dflt="$vendorscript" ;;
9184 The installation process will create a directory for
9185 vendor-supplied scripts.
9189 rp='Pathname for the vendor-supplied scripts directory?'
9192 vendorscriptexp="$ansexp"
9195 : Change installation prefix, if necessary.
9196 if $test X"$prefix" != X"$installprefix"; then
9197 installvendorscript=`echo $vendorscriptexp | $sed "s#^$prefix#$installprefix#"`
9199 installvendorscript="$vendorscriptexp"
9202 : see if qgcvt exists
9208 if $test X"$d_longdbl" = X"$define"; then
9210 echo "Checking how to print long doubles..." >&4
9212 if $test X"$sPRIfldbl" = X -a X"$doublesize" = X"$longdblsize"; then
9213 $cat >try.c <<'EOCP'
9214 #include <sys/types.h>
9218 printf("%.3f\n", d);
9222 if eval $compile; then
9226 sPRIfldbl='"f"'; sPRIgldbl='"g"'; sPRIeldbl='"e"';
9227 sPRIFUldbl='"F"'; sPRIGUldbl='"G"'; sPRIEUldbl='"E"';
9228 echo "We will use %f."
9234 if $test X"$sPRIfldbl" = X; then
9235 $cat >try.c <<'EOCP'
9236 #include <sys/types.h>
9239 long double d = 123.456;
9240 printf("%.3Lf\n", d);
9244 if eval $compile; then
9248 sPRIfldbl='"Lf"'; sPRIgldbl='"Lg"'; sPRIeldbl='"Le"';
9249 sPRIFUldbl='"LF"'; sPRIGUldbl='"LG"'; sPRIEUldbl='"LE"';
9250 echo "We will use %Lf."
9256 if $test X"$sPRIfldbl" = X; then
9257 $cat >try.c <<'EOCP'
9258 #include <sys/types.h>
9261 long double d = 123.456;
9262 printf("%.3llf\n", d);
9266 if eval $compile; then
9270 sPRIfldbl='"llf"'; sPRIgldbl='"llg"'; sPRIeldbl='"lle"';
9271 sPRIFUldbl='"llF"'; sPRIGUldbl='"llG"'; sPRIEUldbl='"llE"';
9272 echo "We will use %llf."
9278 if $test X"$sPRIfldbl" = X; then
9279 $cat >try.c <<'EOCP'
9280 #include <sys/types.h>
9283 long double d = 123.456;
9284 printf("%.3lf\n", d);
9288 if eval $compile; then
9292 sPRIfldbl='"lf"'; sPRIgldbl='"lg"'; sPRIeldbl='"le"';
9293 sPRIFUldbl='"lF"'; sPRIGUldbl='"lG"'; sPRIEUldbl='"lE"';
9294 echo "We will use %lf."
9300 if $test X"$sPRIfldbl" = X; then
9301 echo "Cannot figure out how to print long doubles." >&4
9303 sSCNfldbl=$sPRIfldbl # expect consistency
9310 case "$sPRIfldbl" in
9311 '') d_PRIfldbl="$undef"; d_PRIgldbl="$undef"; d_PRIeldbl="$undef";
9312 d_PRIFUldbl="$undef"; d_PRIGUldbl="$undef"; d_PRIEUldbl="$undef";
9313 d_SCNfldbl="$undef";
9315 *) d_PRIfldbl="$define"; d_PRIgldbl="$define"; d_PRIeldbl="$define";
9316 d_PRIFUldbl="$define"; d_PRIGUldbl="$define"; d_PRIEUldbl="$define";
9317 d_SCNfldbl="$define";
9321 : Check how to convert floats to strings.
9323 if test "X$d_Gconvert" = X; then
9326 echo "Checking for an efficient way to convert floats to strings."
9328 case "$uselongdouble" in
9329 "$define") echo "#define USE_LONG_DOUBLE" >>try.c ;;
9331 case "$d_longdbl" in
9332 "$define") echo "#define HAS_LONG_DOUBLE" >>try.c ;;
9334 case "$d_PRIgldbl" in
9335 "$define") echo "#define HAS_PRIgldbl" >>try.c ;;
9339 #define Gconvert(x,n,t,b) gconvert((x),(n),(t),(b))
9340 char *myname = "gconvert";
9343 #define Gconvert(x,n,t,b) gcvt((x),(n),(b))
9344 char *myname = "gcvt";
9347 #define Gconvert(x,n,t,b) qgcvt((x),(n),(b))
9348 char *myname = "qgcvt";
9349 #define DOUBLETYPE long double
9352 #if defined(USE_LONG_DOUBLE) && defined(HAS_LONG_DOUBLE)
9354 #define Gconvert(x,n,t,b) sprintf((b),"%.*"$sPRIgldbl,(n),(x))
9356 #define Gconvert(x,n,t,b) sprintf((b),"%.*g",(n),(double)(x))
9359 #define Gconvert(x,n,t,b) sprintf((b),"%.*g",(n),(x))
9361 char *myname = "sprintf";
9365 #if defined(USE_LONG_DOUBLE) && defined(HAS_LONG_DOUBLE)
9366 #define DOUBLETYPE long double
9368 #define DOUBLETYPE double
9374 #define I_STDLIB $i_stdlib
9380 checkit(expect, got)
9384 if (strcmp(expect, got)) {
9385 printf("%s oddity: Expected %s, got %s\n",
9386 myname, expect, got);
9396 /* This must be 1st test on (which?) platform */
9397 /* Alan Burlison <AlanBurlsin@unn.unisys.com> */
9398 Gconvert((DOUBLETYPE)0.1, 8, 0, buf);
9399 checkit("0.1", buf);
9401 Gconvert((DOUBLETYPE)0.01, 8, 0, buf);
9402 checkit("0.01", buf);
9404 Gconvert((DOUBLETYPE)0.001, 8, 0, buf);
9405 checkit("0.001", buf);
9407 Gconvert((DOUBLETYPE)0.0001, 8, 0, buf);
9408 checkit("0.0001", buf);
9410 Gconvert((DOUBLETYPE)0.00009, 8, 0, buf);
9411 if (strlen(buf) > 5)
9412 checkit("9e-005", buf); /* for Microsoft ?? */
9414 checkit("9e-05", buf);
9416 Gconvert((DOUBLETYPE)1.0, 8, 0, buf);
9419 Gconvert((DOUBLETYPE)1.1, 8, 0, buf);
9420 checkit("1.1", buf);
9422 Gconvert((DOUBLETYPE)1.01, 8, 0, buf);
9423 checkit("1.01", buf);
9425 Gconvert((DOUBLETYPE)1.001, 8, 0, buf);
9426 checkit("1.001", buf);
9428 Gconvert((DOUBLETYPE)1.0001, 8, 0, buf);
9429 checkit("1.0001", buf);
9431 Gconvert((DOUBLETYPE)1.00001, 8, 0, buf);
9432 checkit("1.00001", buf);
9434 Gconvert((DOUBLETYPE)1.000001, 8, 0, buf);
9435 checkit("1.000001", buf);
9437 Gconvert((DOUBLETYPE)0.0, 8, 0, buf);
9440 Gconvert((DOUBLETYPE)-1.0, 8, 0, buf);
9443 /* Some Linux gcvt's give 1.e+5 here. */
9444 Gconvert((DOUBLETYPE)100000.0, 8, 0, buf);
9445 checkit("100000", buf);
9447 /* Some Linux gcvt's give -1.e+5 here. */
9448 Gconvert((DOUBLETYPE)-100000.0, 8, 0, buf);
9449 checkit("-100000", buf);
9451 Gconvert((DOUBLETYPE)123.456, 8, 0, buf);
9452 checkit("123.456", buf);
9454 /* Testing of 1e+129 in bigintpm.t must not get extra '.' here. */
9455 Gconvert((DOUBLETYPE)1e34, 8, 0, buf);
9456 /* 34 should be enough to scare even long double
9457 * places into using the e notation. */
9458 if (strlen(buf) > 5)
9459 checkit("1e+034", buf); /* for Microsoft */
9461 checkit("1e+34", buf);
9463 /* For Perl, if you add additional tests here, also add them to
9464 * t/base/num.t for benefit of platforms not using Configure or
9465 * overriding d_Gconvert */
9470 : first add preferred functions to our list
9472 for xxx_convert in $gconvert_preference; do
9473 case $xxx_convert in
9474 gcvt|gconvert|sprintf) xxx_list="$xxx_list $xxx_convert" ;;
9475 *) echo "Discarding unrecognized gconvert_preference $xxx_convert" >&4 ;;
9478 : then add any others
9479 for xxx_convert in gconvert gcvt sprintf; do
9482 *) xxx_list="$xxx_list $xxx_convert" ;;
9486 case "$d_longdbl$uselongdouble" in
9488 : again, add prefered functions to our list first
9490 for xxx_convert in $gconvert_ld_preference; do
9491 case $xxx_convert in
9492 qgcvt|gcvt|gconvert|sprintf) xxx_ld_list="$xxx_ld_list $xxx_convert" ;;
9493 *) echo "Discarding unrecognized gconvert_ld_preference $xxx_convert" ;;
9496 : then add qgcvt, sprintf--then, in xxx_list order, gconvert and gcvt
9497 for xxx_convert in qgcvt sprintf $xxx_list; do
9498 case "$xxx_ld_list" in
9499 $xxx_convert*|*" $xxx_convert"*) ;;
9500 *) xxx_ld_list="$xxx_ld_list $xxx_convert" ;;
9503 : if sprintf cannot do long doubles, move it to the end
9504 if test "$d_PRIgldbl" != "$define"; then
9505 xxx_ld_list="`echo $xxx_ld_list|sed s/sprintf//` sprintf"
9507 : if no qgcvt, remove it
9508 if test "$d_qgcvt" != "$define"; then
9509 xxx_ld_list="`echo $xxx_ld_list|sed s/qgcvt//`"
9512 xxx_list="$xxx_ld_list"
9516 for xxx_convert in $xxx_list; do
9517 echo "Trying $xxx_convert..."
9519 set try -DTRY_$xxx_convert
9520 if eval $compile; then
9521 echo "$xxx_convert() found." >&4
9523 echo "I'll use $xxx_convert to convert floats into a string." >&4
9526 echo "...But $xxx_convert didn't work as I expected."
9530 echo "$xxx_convert NOT found." >&4
9534 if test X$xxx_convert = X; then
9535 echo "*** WHOA THERE!!! ***" >&4
9536 echo "None of ($xxx_list) seemed to work properly. I'll use sprintf." >&4
9540 case "$xxx_convert" in
9541 gconvert) d_Gconvert='gconvert((x),(n),(t),(b))' ;;
9542 gcvt) d_Gconvert='gcvt((x),(n),(b))' ;;
9543 qgcvt) d_Gconvert='qgcvt((x),(n),(b))' ;;
9544 *) case "$uselongdouble$d_longdbl$d_PRIgldbl" in
9545 "$define$define$define")
9546 d_Gconvert="sprintf((b),\"%.*\"$sPRIgldbl,(n),(x))" ;;
9547 "$define$define$undef")
9548 d_Gconvert='sprintf((b),"%.*g",(n),(double)(x))' ;;
9549 *) d_Gconvert='sprintf((b),"%.*g",(n),(x))' ;;
9556 : see if _fwalk exists
9560 : Initialize h_fcntl
9563 : Initialize h_sysfile
9566 : access call always available on UNIX
9570 : locate the flags for 'access()'
9574 $cat >access.c <<EOCP
9575 #include <sys/types.h>
9580 #include <sys/file.h>
9593 : check sys/file.h first, no particular reason here
9594 if $test `./findhdr sys/file.h` && \
9595 $cc -o access $cppflags -DI_SYS_FILE access.c >/dev/null 2>&1 ; then
9597 echo "<sys/file.h> defines the *_OK access constants." >&4
9598 elif $test `./findhdr fcntl.h` && \
9599 $cc -o access $cppflags -DI_FCNTL access.c >/dev/null 2>&1 ; then
9601 echo "<fcntl.h> defines the *_OK access constants." >&4
9602 elif $test `./findhdr unistd.h` && \
9603 $cc -o access $cppflags -DI_UNISTD access.c >/dev/null 2>&1 ; then
9604 echo "<unistd.h> defines the *_OK access constants." >&4
9606 echo "I can't find the four *_OK access constants--I'll use mine." >&4
9612 : see if accessx exists
9613 set accessx d_accessx
9616 : see if aintl exists
9620 : see if alarm exists
9624 : see if POSIX threads are available
9625 set pthread.h i_pthread
9628 : define a fucntion to check prototypes
9629 $cat > protochk <<EOSH
9632 optimize="$optimize"
9634 prototype="$prototype"
9637 usethreads=$usethreads
9638 i_pthread=$i_pthread
9639 pthread_h_first=$pthread_h_first
9642 $cat >> protochk <<'EOSH'
9647 while test $# -ge 2; do
9649 $define) echo "#include <$2>" >> try.c ;;
9650 literal) echo "$2" >> try.c ;;
9652 # Extra magic for the benefit of systems that need pthread.h
9653 # to be included early to correctly detect threadsafe functions.
9654 # Such functions must guarantee themselves, though, that the usethreads
9655 # and i_pthread have been defined, before calling protochk.
9656 if test "$usethreads" = "$define" -a "$i_pthread" = "$define" -a "$pthread_h_first" = "$define" -a "$pthread_h_done" = ""; then
9657 echo "#include <pthread.h>" >> try.c
9662 test "$prototype" = "$define" && echo '#define CAN_PROTOTYPE' >> try.c
9663 cat >> try.c <<'EOCP'
9664 #ifdef CAN_PROTOTYPE
9665 #define _(args) args
9670 echo "$foo" >> try.c
9671 echo 'int no_real_function_has_this_name _((void)) { return 0; }' >> try.c
9672 $cc $optimize $ccflags -c try.c > /dev/null 2>&1
9680 hasproto='varname=$1; func=$2; shift; shift;
9681 while $test $# -ge 2; do
9683 $define) echo "#include <$2>";;
9687 $cppstdin $cppflags $cppminus < try.c > tryout.c 2>/dev/null;
9688 if $contains "$func.*(" tryout.c >/dev/null 2>&1; then
9689 echo "$func() prototype found.";
9692 echo "$func() prototype NOT found.";
9697 $rm -f try.c tryout.c'
9699 : see if sys/types.h has to be included
9700 set sys/types.h i_systypes
9703 : see if sys/select.h has to be included
9704 set sys/select.h i_sysselct
9707 hasfield='varname=$1; struct=$2; field=$3; shift; shift; shift;
9708 while $test $# -ge 2; do
9710 $define) echo "#include <$2>";;
9714 echo "int main () { struct $struct foo; char* bar; bar = (char*)foo.$field; }" >> try.c;
9716 if eval $compile; then
9725 : see if we should include time.h, sys/time.h, or both
9727 if test "X$timeincl" = X; then
9728 echo "Testing to see if we should include <time.h>, <sys/time.h> or both." >&4
9729 $echo $n "I'm now running the test program...$c"
9731 #include <sys/types.h>
9736 #ifdef SYSTIMEKERNEL
9739 #include <sys/time.h>
9742 #include <sys/select.h>
9755 struct timezone tzp;
9757 if (foo.tm_sec == foo.tm_sec)
9760 if (bar.tv_sec == bar.tv_sec)
9767 for s_timezone in '-DS_TIMEZONE' ''; do
9769 for s_timeval in '-DS_TIMEVAL' ''; do
9770 for i_systimek in '' '-DSYSTIMEKERNEL'; do
9771 for i_time in '' '-DI_TIME'; do
9772 for i_systime in '-DI_SYSTIME' ''; do
9775 set try $i_time $i_systime $i_systimek $sysselect $s_timeval $s_timezone
9776 if eval $compile; then
9777 set X $i_time $i_systime $i_systimek $sysselect $s_timeval
9781 $echo $n "Succeeded with $flags$c"
9793 *SYSTIMEKERNEL*) i_systimek="$define"
9794 timeincl=`./findhdr sys/time.h`
9795 echo "We'll include <sys/time.h> with KERNEL defined." >&4;;
9796 *) i_systimek="$undef";;
9799 *I_TIME*) i_time="$define"
9800 timeincl=`./findhdr time.h`" $timeincl"
9801 echo "We'll include <time.h>." >&4;;
9802 *) i_time="$undef";;
9805 *I_SYSTIME*) i_systime="$define"
9806 timeincl=`./findhdr sys/time.h`" $timeincl"
9807 echo "We'll include <sys/time.h>." >&4;;
9808 *) i_systime="$undef";;
9812 : see if struct tm knows about tm_zone
9813 case "$i_systime$i_time" in
9816 echo "Checking to see if your struct tm has tm_zone field..." >&4
9817 set d_tm_tm_zone tm tm_zone $i_systime sys/time.h $i_time time.h
9825 case "$d_tm_tm_zone" in
9826 "$define") echo "Yes, it does." ;;
9827 *) echo "No, it doesn't." ;;
9829 : see if struct tm knows about tm_gmtoff
9830 case "$i_systime$i_time" in
9833 echo "Checking to see if your struct tm has tm_gmtoff field..." >&4
9834 set d_tm_tm_gmtoff tm tm_gmtoff $i_systime sys/time.h $i_time time.h
9842 case "$d_tm_tm_gmtoff" in
9843 "$define") echo "Yes, it does." ;;
9844 *) echo "No, it doesn't." ;;
9847 : see if asctime_r exists
9848 set asctime_r d_asctime_r
9850 case "$d_asctime_r" in
9852 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
9853 case "$d_asctime_r_proto:$usethreads" in
9854 ":define") d_asctime_r_proto=define
9855 set d_asctime_r_proto asctime_r $hdrs
9859 case "$d_asctime_r_proto" in
9861 case "$asctime_r_proto" in
9862 ''|0) try='char* asctime_r(const struct tm*, char*);'
9863 ./protochk "extern $try" $hdrs && asctime_r_proto=B_SB ;;
9865 case "$asctime_r_proto" in
9866 ''|0) try='char* asctime_r(const struct tm*, char*, int);'
9867 ./protochk "extern $try" $hdrs && asctime_r_proto=B_SBI ;;
9869 case "$asctime_r_proto" in
9870 ''|0) try='int asctime_r(const struct tm*, char*);'
9871 ./protochk "extern $try" $hdrs && asctime_r_proto=I_SB ;;
9873 case "$asctime_r_proto" in
9874 ''|0) try='int asctime_r(const struct tm*, char*, int);'
9875 ./protochk "extern $try" $hdrs && asctime_r_proto=I_SBI ;;
9877 case "$asctime_r_proto" in
9878 ''|0) d_asctime_r=undef
9880 echo "Disabling asctime_r, cannot determine prototype." >&4 ;;
9881 * ) case "$asctime_r_proto" in
9882 REENTRANT_PROTO*) ;;
9883 *) asctime_r_proto="REENTRANT_PROTO_$asctime_r_proto" ;;
9885 echo "Prototype: $try" ;;
9888 *) case "$usethreads" in
9889 define) echo "asctime_r has no prototype, not using it." >&4 ;;
9896 *) asctime_r_proto=0
9900 : see if atolf exists
9904 : see if atoll exists
9908 : Look for GCC-style attribute format
9909 case "$d_attribute_format" in
9912 echo "Checking whether your compiler can handle __attribute__((format)) ..." >&4
9913 $cat >attrib.c <<'EOCP'
9915 void my_special_printf(char* pat,...) __attribute__((__format__(__printf__,1,2)));
9917 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
9918 if $contains 'warning' attrib.out >/dev/null 2>&1; then
9919 echo "Your C compiler doesn't support __attribute__((format))."
9922 echo "Your C compiler supports __attribute__((format))."
9926 echo "Your C compiler doesn't seem to understand __attribute__ at all."
9930 *) val="$d_attribute_format" ;;
9932 set d_attribute_format
9936 : Look for GCC-style attribute malloc
9937 case "$d_attribute_malloc" in
9940 echo "Checking whether your compiler can handle __attribute__((malloc)) ..." >&4
9941 $cat >attrib.c <<'EOCP'
9943 char *go_get_some_memory( int how_many_bytes ) __attribute__((malloc));
9945 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
9946 if $contains 'warning' attrib.out >/dev/null 2>&1; then
9947 echo "Your C compiler doesn't support __attribute__((malloc))."
9950 echo "Your C compiler supports __attribute__((malloc))."
9954 echo "Your C compiler doesn't seem to understand __attribute__ at all."
9958 *) val="$d_attribute_malloc" ;;
9960 set d_attribute_malloc
9964 : Look for GCC-style attribute nonnull
9965 case "$d_attribute_nonnull" in
9968 echo "Checking whether your compiler can handle __attribute__((nonnull(1))) ..." >&4
9969 $cat >attrib.c <<'EOCP'
9971 void do_something (char *some_pointer,...) __attribute__((nonnull(1)));
9973 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
9974 if $contains 'warning' attrib.out >/dev/null 2>&1; then
9975 echo "Your C compiler doesn't support __attribute__((nonnull))."
9978 echo "Your C compiler supports __attribute__((nonnull))."
9982 echo "Your C compiler doesn't seem to understand __attribute__ at all."
9986 *) val="$d_attribute_nonnull" ;;
9988 set d_attribute_nonnull
9992 : Look for GCC-style attribute noreturn
9993 case "$d_attribute_noreturn" in
9996 echo "Checking whether your compiler can handle __attribute__((noreturn)) ..." >&4
9997 $cat >attrib.c <<'EOCP'
9999 void fall_over_dead( void ) __attribute__((noreturn));
10001 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10002 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10003 echo "Your C compiler doesn't support __attribute__((noreturn))."
10006 echo "Your C compiler supports __attribute__((noreturn))."
10010 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10014 *) val="$d_attribute_noreturn" ;;
10016 set d_attribute_noreturn
10020 : Look for GCC-style attribute pure
10021 case "$d_attribute_pure" in
10024 echo "Checking whether your compiler can handle __attribute__((pure)) ..." >&4
10025 $cat >attrib.c <<'EOCP'
10027 int square( int n ) __attribute__((pure));
10029 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10030 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10031 echo "Your C compiler doesn't support __attribute__((pure))."
10034 echo "Your C compiler supports __attribute__((pure))."
10038 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10042 *) val="$d_attribute_pure" ;;
10044 set d_attribute_pure
10048 : Look for GCC-style attribute unused
10049 case "$d_attribute_unused" in
10052 echo "Checking whether your compiler can handle __attribute__((unused)) ..." >&4
10053 $cat >attrib.c <<'EOCP'
10055 int do_something( int dummy __attribute__((unused)), int n );
10057 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10058 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10059 echo "Your C compiler doesn't support __attribute__((unused))."
10062 echo "Your C compiler supports __attribute__((unused))."
10066 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10070 *) val="$d_attribute_unused" ;;
10072 set d_attribute_unused
10076 : Look for GCC-style attribute warn_unused_result
10077 case "$d_attribute_warn_unused_result" in
10080 echo "Checking whether your compiler can handle __attribute__((warn_unused_result)) ..." >&4
10081 $cat >attrib.c <<'EOCP'
10083 int I_will_not_be_ignored(void) __attribute__((warn_unused_result));
10085 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10086 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10087 echo "Your C compiler doesn't support __attribute__((warn_unused_result))."
10090 echo "Your C compiler supports __attribute__((warn_unused_result))."
10094 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10098 *) val="$d_attribute_warn_unused_result" ;;
10100 set d_attribute_warn_unused_result
10104 : see if bcmp exists
10108 : see if bcopy exists
10112 : see if this is a unistd.h system
10113 set unistd.h i_unistd
10116 : see if getpgrp exists
10117 set getpgrp d_getpgrp
10120 case "$d_getpgrp" in
10123 echo "Checking to see which flavor of getpgrp is in use..."
10125 #$i_unistd I_UNISTD
10126 #include <sys/types.h>
10128 # include <unistd.h>
10130 #$i_stdlib I_STDLIB
10132 #include <stdlib.h>
10136 if (getuid() == 0) {
10137 printf("(I see you are running Configure as super-user...)\n");
10140 #ifdef TRY_BSD_PGRP
10141 if (getpgrp(1) == 0)
10150 if $cc -o try -DTRY_BSD_PGRP $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
10151 echo "You have to use getpgrp(pid) instead of getpgrp()." >&4
10153 elif $cc -o try $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
10154 echo "You have to use getpgrp() instead of getpgrp(pid)." >&4
10157 echo "I can't seem to compile and run the test program."
10159 xxx="a USG one, i.e. you use getpgrp()."
10161 # SVR4 systems can appear rather BSD-ish.
10162 case "$i_unistd" in
10164 xxx="a BSD one, i.e. you use getpgrp(pid)."
10168 xxx="probably a USG one, i.e. you use getpgrp()."
10173 echo "Assuming your getpgrp is $xxx" >&4
10182 : see if setpgrp exists
10183 set setpgrp d_setpgrp
10186 case "$d_setpgrp" in
10189 echo "Checking to see which flavor of setpgrp is in use..."
10191 #$i_unistd I_UNISTD
10192 #include <sys/types.h>
10194 # include <unistd.h>
10196 #$i_stdlib I_STDLIB
10198 #include <stdlib.h>
10202 if (getuid() == 0) {
10203 printf("(I see you are running Configure as super-user...)\n");
10206 #ifdef TRY_BSD_PGRP
10207 if (-1 == setpgrp(1, 1))
10210 if (setpgrp() != -1)
10216 if $cc -o try -DTRY_BSD_PGRP $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
10217 echo 'You have to use setpgrp(pid,pgrp) instead of setpgrp().' >&4
10219 elif $cc -o try $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
10220 echo 'You have to use setpgrp() instead of setpgrp(pid,pgrp).' >&4
10223 echo "(I can't seem to compile and run the test program.)"
10225 xxx="a USG one, i.e. you use setpgrp()."
10227 # SVR4 systems can appear rather BSD-ish.
10228 case "$i_unistd" in
10230 xxx="a BSD one, i.e. you use setpgrp(pid,pgrp)."
10234 xxx="probably a USG one, i.e. you use setpgrp()."
10239 echo "Assuming your setpgrp is $xxx" >&4
10247 : Look for GCC-style __builtin_choose_expr
10248 case "$d_builtin_choose_expr" in
10251 echo "Checking whether your compiler can handle __builtin_choose_expr ..." >&4
10252 $cat >try.c <<'EOCP'
10253 #include <assert.h>
10254 #include <stdlib.h>
10257 #define SYRINX(x) __builtin_choose_expr( x, (1056*2), (103*50) )
10260 assert( SYRINX(1) == 2112 );
10261 assert( SYRINX(1) != 5150 );
10262 assert( SYRINX(0) == 5150 );
10263 assert( SYRINX(0) != 2112 );
10264 puts( "All good!" );
10270 if eval $compile; then
10271 echo "Your C compiler supports __builtin_choose_expr."
10274 echo "Your C compiler doesn't seem to understand __builtin_choose_expr."
10278 *) val="$d_builtin_choose_expr" ;;
10281 set d_builtin_choose_expr
10283 $rm -f try.* try core core.try.*
10285 : Look for GCC-style __builtin_expect
10286 case "$d_builtin_expect" in
10289 echo "Checking whether your compiler can handle __builtin_expect ..." >&4
10290 $cat >builtin.c <<'EOCP'
10293 if ( __builtin_expect(n, 0) ) n = 1;
10297 if eval $compile; then
10298 echo "Your C compiler supports __builtin_choose_expr."
10301 echo "Your C compiler doesn't seem to understand __builtin_choose_expr."
10305 *) val="$d_builtin_expect" ;;
10308 set d_builtin_expect
10310 $rm -f try.* try core core.try.*
10312 : see if bzero exists
10316 : see if signal is declared as pointer to function returning int or void
10318 xxx=`./findhdr signal.h`
10319 $test "$xxx" && $cppstdin $cppminus $cppflags < $xxx >$$.tmp 2>/dev/null
10320 if $contains 'int.*\*[ ]*signal' $$.tmp >/dev/null 2>&1 ; then
10321 echo "You have int (*signal())() instead of void." >&4
10323 elif $contains 'void.*\*[ ]*signal' $$.tmp >/dev/null 2>&1 ; then
10324 echo "You have void (*signal())()." >&4
10326 elif $contains 'extern[ ]*[(\*]*signal' $$.tmp >/dev/null 2>&1 ; then
10327 echo "You have int (*signal())() instead of void." >&4
10329 elif $contains 'void.*\*.*sig' $$.tmp >/dev/null 2>&1 ; then
10330 echo "You have void (*signal())()." >&4
10333 case "$d_voidsig" in
10335 echo "I can't determine whether signal handler returns void or int..." >&4
10337 rp="What type does your signal handler return?"
10340 v*) val="$define";;
10344 echo "As you already told me, signal handler returns void." >&4
10347 *) echo "As you already told me, signal handler returns int." >&4
10354 case "$d_voidsig" in
10355 "$define") signal_t="void";;
10356 *) signal_t="int";;
10360 : check for ability to cast large floats to 32-bit ints.
10362 echo 'Checking whether your C compiler can cast large floats to int32.' >&4
10363 if $test "$intsize" -ge 4; then
10370 #$i_stdlib I_STDLIB
10372 #include <stdlib.h>
10374 #include <sys/types.h>
10375 #include <signal.h>
10376 $signal_t blech(s) int s; { exit(3); }
10383 signal(SIGFPE, blech);
10385 /* Don't let compiler optimize the test away. Store the number
10386 in a writable string for gcc to pass to sscanf under HP/UX.
10388 sprintf(str, "2147483647");
10389 sscanf(str, "%lf", &f); /* f = (double) 0x7fffffff; */
10393 /* x86 processors will probably give 0x8000 0000, which is a
10394 sign change. We don't want that. We want to mimic SPARC
10395 behavior here, which is to preserve the sign and give
10398 if (i32 != ($xxx) f)
10404 if eval $compile_ok; then
10408 echo "(I can't seem to compile the test program--assuming it can't)"
10413 echo "Yup, it can."
10416 echo "Nope, it can't."
10423 : check for ability to cast negative floats to unsigned
10425 echo 'Checking whether your C compiler can cast negative float to unsigned.' >&4
10428 #$i_stdlib I_STDLIB
10430 #include <stdlib.h>
10432 #include <sys/types.h>
10433 #include <signal.h>
10434 $signal_t blech(s) int s; { exit(7); }
10435 $signal_t blech_in_list(s) int s; { exit(4); }
10436 unsigned long dummy_long(p) unsigned long p; { return p; }
10437 unsigned int dummy_int(p) unsigned int p; { return p; }
10438 unsigned short dummy_short(p) unsigned short p; { return p; }
10442 unsigned long along;
10444 unsigned short ashort;
10448 /* Frustrate gcc-2.7.2's optimizer which failed this test with
10449 a direct f = -123. assignment. gcc-2.8.0 reportedly
10450 optimized the whole file away
10452 /* Store the number in a writable string for gcc to pass to
10453 sscanf under HP/UX.
10455 sprintf(str, "-123");
10456 sscanf(str, "%lf", &f); /* f = -123.; */
10458 signal(SIGFPE, blech);
10459 along = (unsigned long)f;
10460 aint = (unsigned int)f;
10461 ashort = (unsigned short)f;
10462 if (along != (unsigned long)-123)
10464 if (aint != (unsigned int)-123)
10466 if (ashort != (unsigned short)-123)
10468 sprintf(str, "1073741824.");
10469 sscanf(str, "%lf", &f); /* f = (double)0x40000000; */
10472 along = (unsigned long)f;
10473 if (along != 0x80000000)
10477 along = (unsigned long)f;
10478 if (along != 0x7fffffff)
10482 along = (unsigned long)f;
10483 if (along != 0x80000001)
10487 signal(SIGFPE, blech_in_list);
10488 sprintf(str, "123.");
10489 sscanf(str, "%lf", &f); /* f = 123.; */
10490 along = dummy_long((unsigned long)f);
10491 aint = dummy_int((unsigned int)f);
10492 ashort = dummy_short((unsigned short)f);
10493 if (along != (unsigned long)123)
10495 if (aint != (unsigned int)123)
10497 if (ashort != (unsigned short)123)
10504 if eval $compile_ok; then
10508 echo "(I can't seem to compile the test program--assuming it can't)"
10511 case "$castflags" in
10513 echo "Yup, it can."
10516 echo "Nope, it can't."
10523 : see if vprintf exists
10525 if set vprintf val -f d_vprintf; eval $csym; $val; then
10526 echo 'vprintf() found.' >&4
10529 #include <varargs.h>
10530 #$i_stdlib I_STDLIB
10532 #include <stdlib.h>
10535 int main() { xxx("foo"); }
10544 exit((unsigned long)vsprintf(buf,"%s",args) > 10L);
10548 if eval $compile && $run ./try; then
10549 echo "Your vsprintf() returns (int)." >&4
10552 echo "Your vsprintf() returns (char*)." >&4
10556 echo 'vprintf() NOT found.' >&4
10567 : see if chown exists
10571 : see if chroot exists
10572 set chroot d_chroot
10575 : see if chsize exists
10576 set chsize d_chsize
10579 : see if class exists
10583 : see if clearenv exists
10584 set clearenv d_clearenv
10587 hasstruct='varname=$1; struct=$2; shift; shift;
10588 while $test $# -ge 2; do
10590 $define) echo "#include <$2>";;
10594 echo "int main () { struct $struct foo; }" >> try.c;
10596 if eval $compile; then
10603 $rm -f try.c try.o'
10607 : see whether socket exists
10609 $echo $n "Hmm... $c" >&4
10610 if set socket val -f d_socket; eval $csym; $val; then
10611 echo "Looks like you have Berkeley networking support." >&4
10613 if set setsockopt val -f; eval $csym; $val; then
10616 echo "...but it uses the old BSD 4.1c interface, rather than 4.2." >&4
10617 d_oldsock="$define"
10620 if $contains socklib libc.list >/dev/null 2>&1; then
10621 echo "Looks like you have Berkeley networking support." >&4
10623 : we will have to assume that it supports the 4.2 BSD interface
10626 echo "You don't have Berkeley networking in libc$_a..." >&4
10627 if test "X$d_socket" = "X$define"; then
10628 echo "...but you seem to believe that you have sockets." >&4
10630 for net in net socket
10632 if test -f /usr/lib/lib$net$_a; then
10633 ( ($nm $nm_opt /usr/lib/lib$net$_a | eval $nm_extract) || \
10634 $ar t /usr/lib/lib$net$_a) 2>/dev/null >> libc.list
10635 if $contains socket libc.list >/dev/null 2>&1; then
10640 echo "...but the Wollongong group seems to have hacked it in." >&4
10641 sockethdr="-I/usr/netinclude"
10644 echo "Found Berkeley sockets interface in lib$net." >&4
10645 if $contains setsockopt libc.list >/dev/null 2>&1; then
10648 echo "...using the old BSD 4.1c interface, rather than 4.2." >&4
10649 d_oldsock="$define"
10655 if test "X$d_socket" != "X$define"; then
10656 echo "or anywhere else I see." >&4
10664 : see if socketpair exists
10665 set socketpair d_sockpair
10670 echo "Checking the availability of certain socket constants..." >&4
10671 for ENUM in MSG_CTRUNC MSG_DONTROUTE MSG_OOB MSG_PEEK MSG_PROXY SCM_RIGHTS; do
10672 enum=`$echo $ENUM|./tr '[A-Z]' '[a-z]'`
10674 #include <sys/types.h>
10675 #include <sys/socket.h>
10681 set try; if eval $compile; then
10684 set d_${enum}; eval $setvar
10688 : see if this is a sys/uio.h system
10689 set sys/uio.h i_sysuio
10694 echo "Checking to see if your system supports struct cmsghdr..." >&4
10695 set d_cmsghdr_s cmsghdr $i_systypes sys/types.h $d_socket sys/socket.h $i_sysuio sys/uio.h
10697 case "$d_cmsghdr_s" in
10698 "$define") echo "Yes, it does." ;;
10699 *) echo "No, it doesn't." ;;
10703 : check for const keyword
10705 echo 'Checking to see if your C compiler knows about "const"...' >&4
10706 $cat >const.c <<'EOCP'
10707 typedef struct spug { int drokk; } spug;
10714 if $cc -c $ccflags const.c >/dev/null 2>&1 ; then
10716 echo "Yup, it does."
10719 echo "Nope, it doesn't."
10724 : see if copysignl exists
10725 set copysignl d_copysignl
10728 : see if crypt exists
10733 $define) cryptlib='' ;;
10734 *) if set crypt val -f d_crypt; eval $csym; $val; then
10735 echo 'crypt() found.' >&4
10739 cryptlib=`./loc Slibcrypt$_a "" $xlibpth`
10740 if $test -z "$cryptlib"; then
10741 cryptlib=`./loc Mlibcrypt$_a "" $xlibpth`
10745 if $test -z "$cryptlib"; then
10746 cryptlib=`./loc Llibcrypt$_a "" $xlibpth`
10750 if $test -z "$cryptlib"; then
10751 cryptlib=`./loc libcrypt$_a "" $libpth`
10755 if $test -z "$cryptlib"; then
10756 echo 'crypt() NOT found.' >&4
10767 : see if this is a crypt.h system
10768 set crypt.h i_crypt
10771 : see if crypt_r exists
10772 set crypt_r d_crypt_r
10774 case "$d_crypt_r" in
10776 hdrs="$i_systypes sys/types.h define stdio.h $i_crypt crypt.h"
10777 case "$d_crypt_r_proto:$usethreads" in
10778 ":define") d_crypt_r_proto=define
10779 set d_crypt_r_proto crypt_r $hdrs
10783 case "$d_crypt_r_proto" in
10785 case "$crypt_r_proto" in
10786 ''|0) try='char* crypt_r(const char*, const char*, struct crypt_data*);'
10787 ./protochk "extern $try" $hdrs && crypt_r_proto=B_CCS ;;
10789 case "$crypt_r_proto" in
10790 ''|0) try='char* crypt_r(const char*, const char*, CRYPTD*);'
10791 ./protochk "extern $try" $hdrs && crypt_r_proto=B_CCD ;;
10793 case "$crypt_r_proto" in
10794 ''|0) d_crypt_r=undef
10796 echo "Disabling crypt_r, cannot determine prototype." >&4 ;;
10797 * ) case "$crypt_r_proto" in
10798 REENTRANT_PROTO*) ;;
10799 *) crypt_r_proto="REENTRANT_PROTO_$crypt_r_proto" ;;
10801 echo "Prototype: $try" ;;
10804 *) case "$usethreads" in
10805 define) echo "crypt_r has no prototype, not using it." >&4 ;;
10816 : get csh whereabouts
10818 'csh') val="$undef" ;;
10819 *) val="$define" ;;
10823 : Respect a hint or command line value for full_csh.
10824 case "$full_csh" in
10825 '') full_csh=$csh ;;
10828 : see if ctermid_r exists
10829 set ctermid_r d_ctermid_r
10831 case "$d_ctermid_r" in
10833 hdrs="$i_systypes sys/types.h define stdio.h "
10834 case "$d_ctermid_r_proto:$usethreads" in
10835 ":define") d_ctermid_r_proto=define
10836 set d_ctermid_r_proto ctermid_r $hdrs
10840 case "$d_ctermid_r_proto" in
10842 case "$ctermid_r_proto" in
10843 ''|0) try='char* ctermid_r(char*);'
10844 ./protochk "extern $try" $hdrs && ctermid_r_proto=B_B ;;
10846 case "$ctermid_r_proto" in
10847 ''|0) d_ctermid_r=undef
10849 echo "Disabling ctermid_r, cannot determine prototype." >&4 ;;
10850 * ) case "$ctermid_r_proto" in
10851 REENTRANT_PROTO*) ;;
10852 *) ctermid_r_proto="REENTRANT_PROTO_$ctermid_r_proto" ;;
10854 echo "Prototype: $try" ;;
10857 *) case "$usethreads" in
10858 define) echo "ctermid_r has no prototype, not using it." >&4 ;;
10865 *) ctermid_r_proto=0
10869 : see if ctime_r exists
10870 set ctime_r d_ctime_r
10872 case "$d_ctime_r" in
10874 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
10875 case "$d_ctime_r_proto:$usethreads" in
10876 ":define") d_ctime_r_proto=define
10877 set d_ctime_r_proto ctime_r $hdrs
10881 case "$d_ctime_r_proto" in
10883 case "$ctime_r_proto" in
10884 ''|0) try='char* ctime_r(const time_t*, char*);'
10885 ./protochk "extern $try" $hdrs && ctime_r_proto=B_SB ;;
10887 case "$ctime_r_proto" in
10888 ''|0) try='char* ctime_r(const time_t*, char*, int);'
10889 ./protochk "extern $try" $hdrs && ctime_r_proto=B_SBI ;;
10891 case "$ctime_r_proto" in
10892 ''|0) try='int ctime_r(const time_t*, char*);'
10893 ./protochk "extern $try" $hdrs && ctime_r_proto=I_SB ;;
10895 case "$ctime_r_proto" in
10896 ''|0) try='int ctime_r(const time_t*, char*, int);'
10897 ./protochk "extern $try" $hdrs && ctime_r_proto=I_SBI ;;
10899 case "$ctime_r_proto" in
10900 ''|0) d_ctime_r=undef
10902 echo "Disabling ctime_r, cannot determine prototype." >&4 ;;
10903 * ) case "$ctime_r_proto" in
10904 REENTRANT_PROTO*) ;;
10905 *) ctime_r_proto="REENTRANT_PROTO_$ctime_r_proto" ;;
10907 echo "Prototype: $try" ;;
10910 *) case "$usethreads" in
10911 define) echo "ctime_r has no prototype, not using it." >&4 ;;
10922 : see if cuserid exists
10923 set cuserid d_cuserid
10926 : see if this is a limits.h system
10927 set limits.h i_limits
10930 : see if this is a float.h system
10931 set float.h i_float
10934 : See if number of significant digits in a double precision number is known
10936 $cat >dbl_dig.c <<EOM
10937 #$i_limits I_LIMITS
10940 #include <limits.h>
10946 printf("Contains DBL_DIG");
10949 $cppstdin $cppflags $cppminus < dbl_dig.c >dbl_dig.E 2>/dev/null
10950 if $contains 'DBL_DIG' dbl_dig.E >/dev/null 2>&1; then
10951 echo "DBL_DIG found." >&4
10954 echo "DBL_DIG NOT found." >&4
10961 : see if dbm.h is available
10962 : see if dbmclose exists
10963 set dbmclose d_dbmclose
10966 case "$d_dbmclose" in
10976 *) set rpcsvc/dbm.h i_rpcsvcdbm
10981 *) echo "We won't be including <dbm.h>"
10991 : see if prototype for dbminit is available
10993 set d_dbminitproto dbminit $i_dbm dbm.h
10996 : see if difftime exists
10997 set difftime d_difftime
11000 : see if this is a dirent system
11002 if xinc=`./findhdr dirent.h`; $test "$xinc"; then
11004 echo "<dirent.h> found." >&4
11007 if xinc=`./findhdr sys/dir.h`; $test "$xinc"; then
11008 echo "<sys/dir.h> found." >&4
11011 xinc=`./findhdr sys/ndir.h`
11013 echo "<dirent.h> NOT found." >&4
11018 : Look for type of directory structure.
11020 $cppstdin $cppflags $cppminus < "$xinc" > try.c
11022 case "$direntrytype" in
11024 case "$i_dirent" in
11025 $define) guess1='struct dirent' ;;
11026 *) guess1='struct direct' ;;
11029 *) guess1="$direntrytype"
11034 'struct dirent') guess2='struct direct' ;;
11035 *) guess2='struct dirent' ;;
11038 if $contains "$guess1" try.c >/dev/null 2>&1; then
11039 direntrytype="$guess1"
11040 echo "Your directory entries are $direntrytype." >&4
11041 elif $contains "$guess2" try.c >/dev/null 2>&1; then
11042 direntrytype="$guess2"
11043 echo "Your directory entries seem to be $direntrytype." >&4
11045 echo "I don't recognize your system's directory entries." >&4
11046 rp="What type is used for directory entries on this system?"
11049 direntrytype="$ans"
11054 : see if the directory entry stores field length
11056 $cppstdin $cppflags $cppminus < "$xinc" > try.c
11057 if $contains 'd_namlen' try.c >/dev/null 2>&1; then
11058 echo "Good, your directory entry keeps length information in d_namlen." >&4
11061 echo "Your directory entry does not know about the d_namlen field." >&4
11068 : see if this is an sysdir system
11069 set sys/dir.h i_sysdir
11072 : see if this is an sysndir system
11073 set sys/ndir.h i_sysndir
11078 $cat >dirfd.c <<EOM
11080 #$i_stdlib I_STDLIB
11082 #include <stdlib.h>
11084 #$i_dirent I_DIRENT /**/
11085 #$i_sysdir I_SYS_DIR /**/
11086 #$i_sysndir I_SYS_NDIR /**/
11087 #$i_systypes I_SYS_TYPES /**/
11088 #if defined(I_SYS_TYPES)
11089 #include <sys/types.h>
11091 #if defined(I_DIRENT)
11092 #include <dirent.h>
11093 #if defined(NeXT) && defined(I_SYS_DIR) /* NeXT needs dirent + sys/dir.h */
11094 #include <sys/dir.h>
11098 #include <sys/ndir.h>
11102 #include <ndir.h> /* may be wrong in the future */
11104 #include <sys/dir.h>
11110 DIR *dirp = opendir(".");
11111 if (dirfd(dirp) >= 0)
11119 if eval $compile; then
11123 $define) echo "dirfd() found." >&4 ;;
11124 *) echo "dirfd() NOT found." >&4 ;;
11130 : see if dlerror exists
11133 set dlerror d_dlerror
11137 : see if dlfcn is available
11138 set dlfcn.h i_dlfcn
11145 On a few systems, the dynamically loaded modules that perl generates and uses
11146 will need a different extension than shared libs. The default will probably
11152 *) dflt="$dlext" ;;
11154 rp='What is the extension of dynamically loaded modules'
11163 : Check if dlsym need a leading underscore
11169 echo "Checking whether your dlsym() needs a leading underscore ..." >&4
11170 $cat >dyna.c <<'EOM'
11177 #$i_stdlib I_STDLIB
11179 #include <stdlib.h>
11183 #include <dlfcn.h> /* the dynamic linker include file for SunOS/Solaris */
11185 #include <sys/types.h>
11190 extern int fred() ;
11199 int mode = RTLD_LAZY ;
11201 handle = dlopen("./dyna.$dlext", mode) ;
11202 if (handle == NULL) {
11207 symbol = dlsym(handle, "fred") ;
11208 if (symbol == NULL) {
11209 /* try putting a leading underscore */
11210 symbol = dlsym(handle, "_fred") ;
11211 if (symbol == NULL) {
11224 : Call the object file tmp-dyna.o in case dlext=o.
11225 if $cc $ccflags $cccdlflags -c dyna.c > /dev/null 2>&1 &&
11226 mv dyna${_o} tmp-dyna${_o} > /dev/null 2>&1 &&
11227 $ld -o dyna.$dlext $ldflags $lddlflags tmp-dyna${_o} > /dev/null 2>&1 &&
11228 $cc -o fred $ccflags $ldflags $cccdlflags $ccdlflags fred.c $libs > /dev/null 2>&1 && $to dyna.$dlext; then
11231 1) echo "Test program failed using dlopen." >&4
11232 echo "Perhaps you should not use dynamic loading." >&4;;
11233 2) echo "Test program failed using dlsym." >&4
11234 echo "Perhaps you should not use dynamic loading." >&4;;
11235 3) echo "dlsym needs a leading underscore" >&4
11237 4) echo "dlsym doesn't need a leading underscore." >&4;;
11240 echo "I can't compile and run the test program." >&4
11241 echo "I'm guessing that dlsym doesn't need a leading underscore." >&4
11246 $rm -f fred fred.* dyna.$dlext dyna.* tmp-dyna.*
11251 : see if drand48_r exists
11252 set drand48_r d_drand48_r
11254 case "$d_drand48_r" in
11256 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
11257 case "$d_drand48_r_proto:$usethreads" in
11258 ":define") d_drand48_r_proto=define
11259 set d_drand48_r_proto drand48_r $hdrs
11263 case "$d_drand48_r_proto" in
11265 case "$drand48_r_proto" in
11266 ''|0) try='int drand48_r(struct drand48_data*, double*);'
11267 ./protochk "extern $try" $hdrs && drand48_r_proto=I_ST ;;
11269 case "$drand48_r_proto" in
11270 ''|0) d_drand48_r=undef
11272 echo "Disabling drand48_r, cannot determine prototype." >&4 ;;
11273 * ) case "$drand48_r_proto" in
11274 REENTRANT_PROTO*) ;;
11275 *) drand48_r_proto="REENTRANT_PROTO_$drand48_r_proto" ;;
11277 echo "Prototype: $try" ;;
11280 *) case "$usethreads" in
11281 define) echo "drand48_r has no prototype, not using it." >&4 ;;
11288 *) drand48_r_proto=0
11292 : see if prototype for drand48 is available
11294 set d_drand48proto drand48 $i_stdlib stdlib.h $i_unistd unistd.h
11297 : see if dup2 exists
11301 : see if eaccess exists
11302 set eaccess d_eaccess
11305 : see if endgrent exists
11306 set endgrent d_endgrent
11309 : see if this is an grp system
11315 xxx=`./findhdr grp.h`
11316 $cppstdin $cppflags $cppminus < $xxx >$$.h
11318 if $contains 'gr_passwd' $$.h >/dev/null 2>&1; then
11330 set d_grpasswd; eval $setvar
11334 : see if endgrent_r exists
11335 set endgrent_r d_endgrent_r
11337 case "$d_endgrent_r" in
11339 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
11340 case "$d_endgrent_r_proto:$usethreads" in
11341 ":define") d_endgrent_r_proto=define
11342 set d_endgrent_r_proto endgrent_r $hdrs
11346 case "$d_endgrent_r_proto" in
11348 case "$endgrent_r_proto" in
11349 ''|0) try='int endgrent_r(FILE**);'
11350 ./protochk "extern $try" $hdrs && endgrent_r_proto=I_H ;;
11352 case "$endgrent_r_proto" in
11353 ''|0) try='void endgrent_r(FILE**);'
11354 ./protochk "extern $try" $hdrs && endgrent_r_proto=V_H ;;
11356 case "$endgrent_r_proto" in
11357 ''|0) d_endgrent_r=undef
11359 echo "Disabling endgrent_r, cannot determine prototype." >&4 ;;
11360 * ) case "$endgrent_r_proto" in
11361 REENTRANT_PROTO*) ;;
11362 *) endgrent_r_proto="REENTRANT_PROTO_$endgrent_r_proto" ;;
11364 echo "Prototype: $try" ;;
11367 *) case "$usethreads" in
11368 define) echo "endgrent_r has no prototype, not using it." >&4 ;;
11375 *) endgrent_r_proto=0
11379 : see if endhostent exists
11380 set endhostent d_endhent
11383 : see if this is a netdb.h system
11384 set netdb.h i_netdb
11387 : see if endhostent_r exists
11388 set endhostent_r d_endhostent_r
11390 case "$d_endhostent_r" in
11392 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
11393 case "$d_endhostent_r_proto:$usethreads" in
11394 ":define") d_endhostent_r_proto=define
11395 set d_endhostent_r_proto endhostent_r $hdrs
11399 case "$d_endhostent_r_proto" in
11401 case "$endhostent_r_proto" in
11402 ''|0) try='int endhostent_r(struct hostent_data*);'
11403 ./protochk "extern $try" $hdrs && endhostent_r_proto=I_D ;;
11405 case "$endhostent_r_proto" in
11406 ''|0) try='void endhostent_r(struct hostent_data*);'
11407 ./protochk "extern $try" $hdrs && endhostent_r_proto=V_D ;;
11409 case "$endhostent_r_proto" in
11410 ''|0) d_endhostent_r=undef
11411 endhostent_r_proto=0
11412 echo "Disabling endhostent_r, cannot determine prototype." >&4 ;;
11413 * ) case "$endhostent_r_proto" in
11414 REENTRANT_PROTO*) ;;
11415 *) endhostent_r_proto="REENTRANT_PROTO_$endhostent_r_proto" ;;
11417 echo "Prototype: $try" ;;
11420 *) case "$usethreads" in
11421 define) echo "endhostent_r has no prototype, not using it." >&4 ;;
11423 d_endhostent_r=undef
11424 endhostent_r_proto=0
11428 *) endhostent_r_proto=0
11432 : see if endnetent exists
11433 set endnetent d_endnent
11436 : see if endnetent_r exists
11437 set endnetent_r d_endnetent_r
11439 case "$d_endnetent_r" in
11441 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
11442 case "$d_endnetent_r_proto:$usethreads" in
11443 ":define") d_endnetent_r_proto=define
11444 set d_endnetent_r_proto endnetent_r $hdrs
11448 case "$d_endnetent_r_proto" in
11450 case "$endnetent_r_proto" in
11451 ''|0) try='int endnetent_r(struct netent_data*);'
11452 ./protochk "extern $try" $hdrs && endnetent_r_proto=I_D ;;
11454 case "$endnetent_r_proto" in
11455 ''|0) try='void endnetent_r(struct netent_data*);'
11456 ./protochk "extern $try" $hdrs && endnetent_r_proto=V_D ;;
11458 case "$endnetent_r_proto" in
11459 ''|0) d_endnetent_r=undef
11460 endnetent_r_proto=0
11461 echo "Disabling endnetent_r, cannot determine prototype." >&4 ;;
11462 * ) case "$endnetent_r_proto" in
11463 REENTRANT_PROTO*) ;;
11464 *) endnetent_r_proto="REENTRANT_PROTO_$endnetent_r_proto" ;;
11466 echo "Prototype: $try" ;;
11469 *) case "$usethreads" in
11470 define) echo "endnetent_r has no prototype, not using it." >&4 ;;
11472 d_endnetent_r=undef
11473 endnetent_r_proto=0
11477 *) endnetent_r_proto=0
11481 : see if endprotoent exists
11482 set endprotoent d_endpent
11485 : see if endprotoent_r exists
11486 set endprotoent_r d_endprotoent_r
11488 case "$d_endprotoent_r" in
11490 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
11491 case "$d_endprotoent_r_proto:$usethreads" in
11492 ":define") d_endprotoent_r_proto=define
11493 set d_endprotoent_r_proto endprotoent_r $hdrs
11497 case "$d_endprotoent_r_proto" in
11499 case "$endprotoent_r_proto" in
11500 ''|0) try='int endprotoent_r(struct protoent_data*);'
11501 ./protochk "extern $try" $hdrs && endprotoent_r_proto=I_D ;;
11503 case "$endprotoent_r_proto" in
11504 ''|0) try='void endprotoent_r(struct protoent_data*);'
11505 ./protochk "extern $try" $hdrs && endprotoent_r_proto=V_D ;;
11507 case "$endprotoent_r_proto" in
11508 ''|0) d_endprotoent_r=undef
11509 endprotoent_r_proto=0
11510 echo "Disabling endprotoent_r, cannot determine prototype." >&4 ;;
11511 * ) case "$endprotoent_r_proto" in
11512 REENTRANT_PROTO*) ;;
11513 *) endprotoent_r_proto="REENTRANT_PROTO_$endprotoent_r_proto" ;;
11515 echo "Prototype: $try" ;;
11518 *) case "$usethreads" in
11519 define) echo "endprotoent_r has no prototype, not using it." >&4 ;;
11521 d_endprotoent_r=undef
11522 endprotoent_r_proto=0
11526 *) endprotoent_r_proto=0
11530 : see if endpwent exists
11531 set endpwent d_endpwent
11534 : see if this is a pwd.h system
11540 xxx=`./findhdr pwd.h`
11541 $cppstdin $cppflags $cppminus < $xxx >$$.h
11543 if $contains 'pw_quota' $$.h >/dev/null 2>&1; then
11551 if $contains 'pw_age' $$.h >/dev/null 2>&1; then
11559 if $contains 'pw_change' $$.h >/dev/null 2>&1; then
11567 if $contains 'pw_class' $$.h >/dev/null 2>&1; then
11575 if $contains 'pw_expire' $$.h >/dev/null 2>&1; then
11583 if $contains 'pw_comment' $$.h >/dev/null 2>&1; then
11591 if $contains 'pw_gecos' $$.h >/dev/null 2>&1; then
11599 if $contains 'pw_passwd' $$.h >/dev/null 2>&1; then
11611 set d_pwquota; eval $setvar
11612 set d_pwage; eval $setvar
11613 set d_pwchange; eval $setvar
11614 set d_pwclass; eval $setvar
11615 set d_pwexpire; eval $setvar
11616 set d_pwcomment; eval $setvar
11617 set d_pwgecos; eval $setvar
11618 set d_pwpasswd; eval $setvar
11622 : see if endpwent_r exists
11623 set endpwent_r d_endpwent_r
11625 case "$d_endpwent_r" in
11627 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
11628 case "$d_endpwent_r_proto:$usethreads" in
11629 ":define") d_endpwent_r_proto=define
11630 set d_endpwent_r_proto endpwent_r $hdrs
11634 case "$d_endpwent_r_proto" in
11636 case "$endpwent_r_proto" in
11637 ''|0) try='int endpwent_r(FILE**);'
11638 ./protochk "extern $try" $hdrs && endpwent_r_proto=I_H ;;
11640 case "$endpwent_r_proto" in
11641 ''|0) try='void endpwent_r(FILE**);'
11642 ./protochk "extern $try" $hdrs && endpwent_r_proto=V_H ;;
11644 case "$endpwent_r_proto" in
11645 ''|0) d_endpwent_r=undef
11647 echo "Disabling endpwent_r, cannot determine prototype." >&4 ;;
11648 * ) case "$endpwent_r_proto" in
11649 REENTRANT_PROTO*) ;;
11650 *) endpwent_r_proto="REENTRANT_PROTO_$endpwent_r_proto" ;;
11652 echo "Prototype: $try" ;;
11655 *) case "$usethreads" in
11656 define) echo "endpwent_r has no prototype, not using it." >&4 ;;
11663 *) endpwent_r_proto=0
11667 : see if endservent exists
11668 set endservent d_endsent
11671 : see if endservent_r exists
11672 set endservent_r d_endservent_r
11674 case "$d_endservent_r" in
11676 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
11677 case "$d_endservent_r_proto:$usethreads" in
11678 ":define") d_endservent_r_proto=define
11679 set d_endservent_r_proto endservent_r $hdrs
11683 case "$d_endservent_r_proto" in
11685 case "$endservent_r_proto" in
11686 ''|0) try='int endservent_r(struct servent_data*);'
11687 ./protochk "extern $try" $hdrs && endservent_r_proto=I_D ;;
11689 case "$endservent_r_proto" in
11690 ''|0) try='void endservent_r(struct servent_data*);'
11691 ./protochk "extern $try" $hdrs && endservent_r_proto=V_D ;;
11693 case "$endservent_r_proto" in
11694 ''|0) d_endservent_r=undef
11695 endservent_r_proto=0
11696 echo "Disabling endservent_r, cannot determine prototype." >&4 ;;
11697 * ) case "$endservent_r_proto" in
11698 REENTRANT_PROTO*) ;;
11699 *) endservent_r_proto="REENTRANT_PROTO_$endservent_r_proto" ;;
11701 echo "Prototype: $try" ;;
11704 *) case "$usethreads" in
11705 define) echo "endservent_r has no prototype, not using it." >&4 ;;
11707 d_endservent_r=undef
11708 endservent_r_proto=0
11712 *) endservent_r_proto=0
11716 : Locate the flags for 'open()'
11719 #include <sys/types.h>
11724 #include <sys/file.h>
11726 #$i_stdlib I_STDLIB
11728 #include <stdlib.h>
11739 : check sys/file.h first to get FREAD on Sun
11740 if $test `./findhdr sys/file.h` && \
11741 set try -DI_SYS_FILE && eval $compile; then
11743 echo "<sys/file.h> defines the O_* constants..." >&4
11744 if $run ./try; then
11745 echo "and you have the 3 argument form of open()." >&4
11748 echo "but not the 3 argument form of open(). Oh, well." >&4
11751 elif $test `./findhdr fcntl.h` && \
11752 set try -DI_FCNTL && eval $compile; then
11754 echo "<fcntl.h> defines the O_* constants..." >&4
11755 if $run ./try; then
11756 echo "and you have the 3 argument form of open()." >&4
11759 echo "but not the 3 argument form of open(). Oh, well." >&4
11764 echo "I can't find the O_* constant definitions! You got problems." >&4
11770 : see which of string.h or strings.h is needed
11772 strings=`./findhdr string.h`
11773 if $test "$strings" && $test -r "$strings"; then
11774 echo "Using <string.h> instead of <strings.h>." >&4
11778 strings=`./findhdr strings.h`
11779 if $test "$strings" && $test -r "$strings"; then
11780 echo "Using <strings.h> instead of <string.h>." >&4
11782 echo "No string header found -- You'll surely have problems." >&4
11787 case "$i_string" in
11788 "$undef") strings=`./findhdr strings.h`;;
11789 *) strings=`./findhdr string.h`;;
11792 : see if this is a sys/file.h system
11797 : do we need to include sys/file.h ?
11801 if $h_sysfile; then
11803 echo "We'll be including <sys/file.h>." >&4
11806 echo "We won't be including <sys/file.h>." >&4
11816 : see if fcntl.h is there
11821 : see if we can include fcntl.h
11827 echo "We'll be including <fcntl.h>." >&4
11830 if $h_sysfile; then
11831 echo "We don't need to include <fcntl.h> if we include <sys/file.h>." >&4
11833 echo "We won't be including <fcntl.h>." >&4
11845 : check for non-blocking I/O stuff
11846 case "$h_sysfile" in
11847 true) echo "#include <sys/file.h>" > head.c;;
11850 true) echo "#include <fcntl.h>" > head.c;;
11851 *) echo "#include <sys/fcntl.h>" > head.c;;
11856 echo "Figuring out the flag used by open() for non-blocking I/O..." >&4
11857 case "$o_nonblock" in
11859 $cat head.c > try.c
11860 $cat >>try.c <<EOCP
11862 #$i_stdlib I_STDLIB
11864 #include <stdlib.h>
11872 printf("O_NONBLOCK\n");
11876 printf("O_NDELAY\n");
11880 printf("FNDELAY\n");
11887 if eval $compile_ok; then
11888 o_nonblock=`$run ./try`
11889 case "$o_nonblock" in
11890 '') echo "I can't figure it out, assuming O_NONBLOCK will do.";;
11891 *) echo "Seems like we can use $o_nonblock.";;
11894 echo "(I can't compile the test program; pray O_NONBLOCK is right!)"
11897 *) echo "Using $hint value $o_nonblock.";;
11899 $rm -f try try.* .out core
11902 echo "Let's see what value errno gets from read() on a $o_nonblock file..." >&4
11905 $cat head.c > try.c
11906 $cat >>try.c <<EOCP
11908 #include <sys/types.h>
11909 #include <signal.h>
11911 #$i_stdlib I_STDLIB
11913 #include <stdlib.h>
11919 #define MY_O_NONBLOCK $o_nonblock
11920 #ifndef errno /* XXX need better Configure test */
11923 #$i_unistd I_UNISTD
11925 #include <unistd.h>
11927 #$i_string I_STRING
11929 #include <string.h>
11931 #include <strings.h>
11933 $signal_t blech(x) int x; { exit(3); }
11935 $cat >> try.c <<'EOCP'
11943 pipe(pd); /* Down: child -> parent */
11944 pipe(pu); /* Up: parent -> child */
11947 close(pd[1]); /* Parent reads from pd[0] */
11948 close(pu[0]); /* Parent writes (blocking) to pu[1] */
11950 if (-1 == fcntl(pd[0], F_SETFL, MY_O_NONBLOCK))
11955 signal(SIGALRM, blech);
11957 if ((ret = read(pd[0], buf, 1)) > 0) /* Nothing to read! */
11959 sprintf(string, "%d\n", ret);
11960 write(2, string, strlen(string));
11963 if (errno == EAGAIN) {
11964 printf("EAGAIN\n");
11969 if (errno == EWOULDBLOCK)
11970 printf("EWOULDBLOCK\n");
11973 write(pu[1], buf, 1); /* Unblocks child, tell it to close our pipe */
11974 sleep(2); /* Give it time to close our pipe */
11976 ret = read(pd[0], buf, 1); /* Should read EOF */
11978 sprintf(string, "%d\n", ret);
11979 write(4, string, strlen(string));
11983 close(pd[0]); /* We write to pd[1] */
11984 close(pu[1]); /* We read from pu[0] */
11985 read(pu[0], buf, 1); /* Wait for parent to signal us we may continue */
11986 close(pd[1]); /* Pipe pd is now fully closed! */
11987 exit(0); /* Bye bye, thank you for playing! */
11991 if eval $compile_ok; then
11992 echo "$startsh" >mtry
11993 echo "$run ./try >try.out 2>try.ret 4>try.err || exit 4" >>mtry
11995 ./mtry >/dev/null 2>&1
11997 0) eagain=`$cat try.out`;;
11998 1) echo "Could not perform non-blocking setting!";;
11999 2) echo "I did a successful read() for something that was not there!";;
12000 3) echo "Hmm... non-blocking I/O does not seem to be working!";;
12001 4) echo "Could not find F_SETFL!";;
12002 *) echo "Something terribly wrong happened during testing.";;
12004 rd_nodata=`$cat try.ret`
12005 echo "A read() system call with no data present returns $rd_nodata."
12006 case "$rd_nodata" in
12009 echo "(That's peculiar, fixing that to be -1.)"
12015 echo "Forcing errno EAGAIN on read() with no data available."
12019 echo "Your read() sets errno to $eagain when no data is available."
12022 status=`$cat try.err`
12024 0) echo "And it correctly returns 0 to signal EOF.";;
12025 -1) echo "But it also returns -1 to signal EOF, so be careful!";;
12026 *) echo "However, your read() returns '$status' on EOF??";;
12029 if test "$status" = "$rd_nodata"; then
12030 echo "WARNING: you can't distinguish between EOF and no data!"
12034 echo "I can't compile the test program--assuming errno EAGAIN will do."
12041 echo "Using $hint value $eagain."
12042 echo "Your read() returns $rd_nodata when no data is present."
12043 case "$d_eofnblk" in
12044 "$define") echo "And you can see EOF because read() returns 0.";;
12045 "$undef") echo "But you can't see EOF status from read() returned value.";;
12047 echo "(Assuming you can't see EOF status from read anyway.)"
12053 $rm -f try try.* .out core head.c mtry
12055 : see if _ptr and _cnt from stdio act std
12058 if $contains '_lbfsize' `./findhdr stdio.h` >/dev/null 2>&1 ; then
12059 echo "(Looks like you have stdio.h from BSD.)"
12060 case "$stdio_ptr" in
12061 '') stdio_ptr='((fp)->_p)'
12064 *) ptr_lval=$d_stdio_ptr_lval;;
12066 case "$stdio_cnt" in
12067 '') stdio_cnt='((fp)->_r)'
12070 *) cnt_lval=$d_stdio_cnt_lval;;
12072 case "$stdio_base" in
12073 '') stdio_base='((fp)->_ub._base ? (fp)->_ub._base : (fp)->_bf._base)';;
12075 case "$stdio_bufsiz" in
12076 '') stdio_bufsiz='((fp)->_ub._base ? (fp)->_ub._size : (fp)->_bf._size)';;
12078 elif $contains '_IO_fpos_t' `./findhdr stdio.h` `./findhdr libio.h` >/dev/null 2>&1 ; then
12079 echo "(Looks like you have stdio.h from Linux.)"
12080 case "$stdio_ptr" in
12081 '') stdio_ptr='((fp)->_IO_read_ptr)'
12084 *) ptr_lval=$d_stdio_ptr_lval;;
12086 case "$stdio_cnt" in
12087 '') stdio_cnt='((fp)->_IO_read_end - (fp)->_IO_read_ptr)'
12090 *) cnt_lval=$d_stdio_cnt_lval;;
12092 case "$stdio_base" in
12093 '') stdio_base='((fp)->_IO_read_base)';;
12095 case "$stdio_bufsiz" in
12096 '') stdio_bufsiz='((fp)->_IO_read_end - (fp)->_IO_read_base)';;
12099 case "$stdio_ptr" in
12100 '') stdio_ptr='((fp)->_ptr)'
12103 *) ptr_lval=$d_stdio_ptr_lval;;
12105 case "$stdio_cnt" in
12106 '') stdio_cnt='((fp)->_cnt)'
12109 *) cnt_lval=$d_stdio_cnt_lval;;
12111 case "$stdio_base" in
12112 '') stdio_base='((fp)->_base)';;
12114 case "$stdio_bufsiz" in
12115 '') stdio_bufsiz='((fp)->_cnt + (fp)->_ptr - (fp)->_base)';;
12119 : test whether _ptr and _cnt really work
12120 echo "Checking how std your stdio is..." >&4
12123 #$i_stdlib I_STDLIB
12125 #include <stdlib.h>
12127 #define FILE_ptr(fp) $stdio_ptr
12128 #define FILE_cnt(fp) $stdio_cnt
12130 FILE *fp = fopen("try.c", "r");
12133 18 <= FILE_cnt(fp) &&
12134 strncmp(FILE_ptr(fp), "include <stdio.h>\n", 18) == 0
12142 if eval $compile && $to try.c; then
12143 if $run ./try; then
12144 echo "Your stdio acts pretty std."
12147 echo "Your stdio isn't very std."
12150 echo "Your stdio doesn't appear very std."
12154 # glibc 2.2.90 and above apparently change stdio streams so Perl's
12155 # direct buffer manipulation no longer works. The Configure tests
12156 # should be changed to correctly detect this, but until then,
12157 # the following check should at least let perl compile and run.
12158 # (This quick fix should be updated before 5.8.1.)
12159 # To be defensive, reject all unknown versions, and all versions > 2.2.9.
12160 # A. Dougherty, June 3, 2002.
12161 case "$d_gnulibc" in
12163 case "$gnulibc_version" in
12167 *) echo "But I will not snoop inside glibc $gnulibc_version stdio buffers."
12176 : Can _ptr be used as an lvalue?
12177 case "$d_stdstdio$ptr_lval" in
12178 $define$define) val=$define ;;
12181 set d_stdio_ptr_lval
12184 : Can _cnt be used as an lvalue?
12185 case "$d_stdstdio$cnt_lval" in
12186 $define$define) val=$define ;;
12189 set d_stdio_cnt_lval
12193 : test whether setting _ptr sets _cnt as a side effect
12194 d_stdio_ptr_lval_sets_cnt="$undef"
12195 d_stdio_ptr_lval_nochange_cnt="$undef"
12196 case "$d_stdio_ptr_lval$d_stdstdio" in
12198 echo "Checking to see what happens if we set the stdio ptr..." >&4
12201 /* Can we scream? */
12202 /* Eat dust sed :-) */
12203 /* In the buffer space, no one can hear you scream. */
12204 #$i_stdlib I_STDLIB
12206 #include <stdlib.h>
12208 #define FILE_ptr(fp) $stdio_ptr
12209 #define FILE_cnt(fp) $stdio_cnt
12210 #include <sys/types.h>
12212 FILE *fp = fopen("try.c", "r");
12217 puts("Fail even to read");
12220 c = getc(fp); /* Read away the first # */
12222 puts("Fail even to read");
12226 18 <= FILE_cnt(fp) &&
12227 strncmp(FILE_ptr(fp), "include <stdio.h>\n", 18) == 0
12229 puts("Fail even to read");
12232 ptr = (char*) FILE_ptr(fp);
12233 cnt = (size_t)FILE_cnt(fp);
12235 FILE_ptr(fp) += 42;
12237 if ((char*)FILE_ptr(fp) != (ptr + 42)) {
12238 printf("Fail ptr check %p != %p", FILE_ptr(fp), (ptr + 42));
12241 if (FILE_cnt(fp) <= 20) {
12242 printf ("Fail (<20 chars to test)");
12245 if (strncmp(FILE_ptr(fp), "Eat dust sed :-) */\n", 20) != 0) {
12246 puts("Fail compare");
12249 if (cnt == FILE_cnt(fp)) {
12250 puts("Pass_unchanged");
12253 if (FILE_cnt(fp) == (cnt - 42)) {
12254 puts("Pass_changed");
12257 printf("Fail count was %d now %d\n", cnt, FILE_cnt(fp));
12263 if eval $compile && $to try.c; then
12264 case `$run ./try` in
12266 echo "Increasing ptr in your stdio decreases cnt by the same amount. Good." >&4
12267 d_stdio_ptr_lval_sets_cnt="$define" ;;
12269 echo "Increasing ptr in your stdio leaves cnt unchanged. Good." >&4
12270 d_stdio_ptr_lval_nochange_cnt="$define" ;;
12272 echo "Increasing ptr in your stdio didn't do exactly what I expected. We'll not be doing that then." >&4 ;;
12274 echo "It appears attempting to set ptr in your stdio is a bad plan." >&4 ;;
12277 echo "It seems we can't set ptr in your stdio. Nevermind." >&4
12283 : see if _base is also standard
12285 case "$d_stdstdio" in
12289 #$i_stdlib I_STDLIB
12291 #include <stdlib.h>
12293 #define FILE_base(fp) $stdio_base
12294 #define FILE_bufsiz(fp) $stdio_bufsiz
12296 FILE *fp = fopen("try.c", "r");
12299 19 <= FILE_bufsiz(fp) &&
12300 strncmp(FILE_base(fp), "#include <stdio.h>\n", 19) == 0
12307 if eval $compile && $to try.c; then
12308 if $run ./try; then
12309 echo "And its _base field acts std."
12312 echo "But its _base field isn't std."
12315 echo "However, it seems to be lacking the _base field."
12323 : see if fast_stdio exists
12325 case "$d_stdstdio:$d_stdio_ptr_lval" in
12327 case "$d_stdio_cnt_lval$d_stdio_ptr_lval_sets_cnt" in
12329 echo "You seem to have 'fast stdio' to directly manipulate the stdio buffers." >& 4
12340 : see if fchdir exists
12341 set fchdir d_fchdir
12344 : see if fchmod exists
12345 set fchmod d_fchmod
12348 : see if fchown exists
12349 set fchown d_fchown
12352 : see if this is an fcntl system
12357 : See if fcntl-based locking works.
12359 #$i_stdlib I_STDLIB
12361 #include <stdlib.h>
12363 #include <unistd.h>
12365 #include <signal.h>
12366 $signal_t blech(x) int x; { exit(3); }
12368 #if defined(F_SETLK) && defined(F_SETLKW)
12369 struct flock flock;
12371 fd = open("try.c", O_RDONLY);
12372 flock.l_type = F_RDLCK;
12373 flock.l_whence = SEEK_SET;
12374 flock.l_start = flock.l_len = 0;
12375 signal(SIGALRM, blech);
12377 retval = fcntl(fd, F_SETLK, &flock);
12379 (retval < 0 ? exit(2) : exit(0));
12385 echo "Checking if fcntl-based file locking works... "
12389 if eval $compile_ok; then
12390 if $run ./try; then
12391 echo "Yes, it seems to work."
12394 echo "Nope, it didn't work."
12399 *** I had to forcibly timeout from fcntl(..., F_SETLK, ...).
12400 *** This is (almost) impossible.
12401 *** If your NFS lock daemons are not feeling well, something like
12402 *** this may happen, please investigate. Cannot continue, aborting.
12410 echo "I'm unable to compile the test program, so I'll assume not."
12415 echo "Nope, since you don't even have fcntl()."
12418 set d_fcntl_can_lock
12423 : check for fd_set items
12426 Checking to see how well your C compiler handles fd_set and friends ...
12429 #$i_stdlib I_STDLIB
12431 #include <stdlib.h>
12433 #$i_systime I_SYS_TIME
12434 #$i_sysselct I_SYS_SELECT
12435 #$d_socket HAS_SOCKET
12436 #include <sys/types.h>
12438 #include <sys/socket.h> /* Might include <sys/bsdtypes.h> */
12441 #include <sys/time.h>
12443 #ifdef I_SYS_SELECT
12444 #include <sys/select.h>
12453 #if defined(FD_SET) && defined(FD_CLR) && defined(FD_ISSET) && defined(FD_ZERO)
12461 if eval $compile; then
12462 d_fds_bits="$define"
12464 echo "Well, your system knows about the normal fd_set typedef..." >&4
12465 if $run ./try; then
12466 echo "and you have the normal fd_set macros (just as I'd expect)." >&4
12467 d_fd_macros="$define"
12470 but not the normal fd_set macros! Gaaack! I'll have to cover for you.
12472 d_fd_macros="$undef"
12476 Hmm, your compiler has some difficulty with fd_set. Checking further...
12479 if eval $compile; then
12480 d_fds_bits="$undef"
12482 echo "Well, your system has some sort of fd_set available..." >&4
12483 if $run ./try; then
12484 echo "and you have the normal fd_set macros." >&4
12485 d_fd_macros="$define"
12488 but not the normal fd_set macros! Gross! More work for me...
12490 d_fd_macros="$undef"
12493 echo "Well, you got zip. That's OK, I can roll my own fd_set stuff." >&4
12495 d_fds_bits="$undef"
12496 d_fd_macros="$undef"
12501 : see if fgetpos exists
12502 set fgetpos d_fgetpos
12505 : see if finite exists
12506 set finite d_finite
12509 : see if finitel exists
12510 set finitel d_finitel
12513 : see if flock exists
12517 : see if prototype for flock is available
12519 set d_flockproto flock $i_sysfile sys/file.h
12522 : see if fork exists
12526 : see if fp_class exists
12527 set fp_class d_fp_class
12530 : see if pathconf exists
12531 set pathconf d_pathconf
12534 : see if fpathconf exists
12535 set fpathconf d_fpathconf
12538 : see if fpclass exists
12539 set fpclass d_fpclass
12542 : see if fpclassify exists
12543 set fpclassify d_fpclassify
12546 : see if fpclassl exists
12547 set fpclassl d_fpclassl
12551 : check for fpos64_t
12553 echo "Checking to see if you have fpos64_t..." >&4
12556 int main() { fpos64_t x = 7; }
12559 if eval $compile; then
12561 echo "You have fpos64_t."
12564 echo "You do not have fpos64_t."
12565 case "$fpossize" in
12566 8) echo "(Your fpos_t is 64 bits, so you could use that.)" ;;
12573 : see if frexpl exists
12574 set frexpl d_frexpl
12577 : see if this is a sys/param system
12578 set sys/param.h i_sysparam
12581 : see if this is a sys/mount.h system
12582 set sys/mount.h i_sysmount
12587 echo "Checking to see if your system supports struct fs_data..." >&4
12588 set d_fs_data_s fs_data $i_systypes sys/types.h $i_sysparam sys/param.h $i_sysmount sys/mount.h
12590 case "$d_fs_data_s" in
12591 "$define") echo "Yes, it does." ;;
12592 *) echo "No, it doesn't." ;;
12595 : see if fseeko exists
12596 set fseeko d_fseeko
12598 case "$longsize" in
12599 8) echo "(Your long is 64 bits, so you could use fseek.)" ;;
12602 : see if fsetpos exists
12603 set fsetpos d_fsetpos
12607 : see if fstatfs exists
12608 set fstatfs d_fstatfs
12612 : see if statvfs exists
12613 set statvfs d_statvfs
12616 : see if fstatvfs exists
12617 set fstatvfs d_fstatvfs
12621 : see if fsync exists
12625 : see if ftello exists
12626 set ftello d_ftello
12628 case "$longsize" in
12629 8) echo "(Your long is 64 bits, so you could use ftell.)" ;;
12633 : check for a working futimes
12635 echo "Checking for a working futimes()" >&4
12638 #include <sys/time.h>
12645 fd = open ("try.c", O_RDWR);
12646 if (-1 == fd) exit (1);
12647 rv = futimes (fd, NULL);
12648 exit (rv == -1 ? errno : 0);
12652 if eval $compile; then
12656 0) echo "Yes, it does" >&4
12657 d_futimes="$define"
12659 *) echo "No, it has futimes, but it isn't working ($rc) (probably harmless)\n" >&4
12663 echo "No, it does not (probably harmless)\n" >&4
12665 $rm -f try.* try core core.try.*
12667 : see if getcwd exists
12668 set getcwd d_getcwd
12671 : see if getespwnam exists
12672 set getespwnam d_getespwnam
12676 : see if getfsstat exists
12677 set getfsstat d_getfsstat
12680 : see if getgrent exists
12681 set getgrent d_getgrent
12684 : see if getgrent_r exists
12685 set getgrent_r d_getgrent_r
12687 case "$d_getgrent_r" in
12689 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
12690 case "$d_getgrent_r_proto:$usethreads" in
12691 ":define") d_getgrent_r_proto=define
12692 set d_getgrent_r_proto getgrent_r $hdrs
12696 case "$d_getgrent_r_proto" in
12698 case "$getgrent_r_proto" in
12699 ''|0) try='int getgrent_r(struct group*, char*, size_t, struct group**);'
12700 ./protochk "extern $try" $hdrs && getgrent_r_proto=I_SBWR ;;
12702 case "$getgrent_r_proto" in
12703 ''|0) try='int getgrent_r(struct group*, char*, int, struct group**);'
12704 ./protochk "extern $try" $hdrs && getgrent_r_proto=I_SBIR ;;
12706 case "$getgrent_r_proto" in
12707 ''|0) try='struct group* getgrent_r(struct group*, char*, size_t);'
12708 ./protochk "extern $try" $hdrs && getgrent_r_proto=S_SBW ;;
12710 case "$getgrent_r_proto" in
12711 ''|0) try='struct group* getgrent_r(struct group*, char*, int);'
12712 ./protochk "extern $try" $hdrs && getgrent_r_proto=S_SBI ;;
12714 case "$getgrent_r_proto" in
12715 ''|0) try='int getgrent_r(struct group*, char*, int);'
12716 ./protochk "extern $try" $hdrs && getgrent_r_proto=I_SBI ;;
12718 case "$getgrent_r_proto" in
12719 ''|0) try='int getgrent_r(struct group*, char*, int, FILE**);'
12720 ./protochk "extern $try" $hdrs && getgrent_r_proto=I_SBIH ;;
12722 case "$getgrent_r_proto" in
12723 ''|0) d_getgrent_r=undef
12725 echo "Disabling getgrent_r, cannot determine prototype." >&4 ;;
12726 * ) case "$getgrent_r_proto" in
12727 REENTRANT_PROTO*) ;;
12728 *) getgrent_r_proto="REENTRANT_PROTO_$getgrent_r_proto" ;;
12730 echo "Prototype: $try" ;;
12733 *) case "$usethreads" in
12734 define) echo "getgrent_r has no prototype, not using it." >&4 ;;
12741 *) getgrent_r_proto=0
12745 : see if getgrgid_r exists
12746 set getgrgid_r d_getgrgid_r
12748 case "$d_getgrgid_r" in
12750 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
12751 case "$d_getgrgid_r_proto:$usethreads" in
12752 ":define") d_getgrgid_r_proto=define
12753 set d_getgrgid_r_proto getgrgid_r $hdrs
12757 case "$d_getgrgid_r_proto" in
12759 case "$getgrgid_r_proto" in
12760 ''|0) try='int getgrgid_r(gid_t, struct group*, char*, size_t, struct group**);'
12761 ./protochk "extern $try" $hdrs && getgrgid_r_proto=I_TSBWR ;;
12763 case "$getgrgid_r_proto" in
12764 ''|0) try='int getgrgid_r(gid_t, struct group*, char*, int, struct group**);'
12765 ./protochk "extern $try" $hdrs && getgrgid_r_proto=I_TSBIR ;;
12767 case "$getgrgid_r_proto" in
12768 ''|0) try='int getgrgid_r(gid_t, struct group*, char*, int);'
12769 ./protochk "extern $try" $hdrs && getgrgid_r_proto=I_TSBI ;;
12771 case "$getgrgid_r_proto" in
12772 ''|0) try='struct group* getgrgid_r(gid_t, struct group*, char*, int);'
12773 ./protochk "extern $try" $hdrs && getgrgid_r_proto=S_TSBI ;;
12775 case "$getgrgid_r_proto" in
12776 ''|0) d_getgrgid_r=undef
12778 echo "Disabling getgrgid_r, cannot determine prototype." >&4 ;;
12779 * ) case "$getgrgid_r_proto" in
12780 REENTRANT_PROTO*) ;;
12781 *) getgrgid_r_proto="REENTRANT_PROTO_$getgrgid_r_proto" ;;
12783 echo "Prototype: $try" ;;
12786 *) case "$usethreads" in
12787 define) echo "getgrgid_r has no prototype, not using it." >&4 ;;
12794 *) getgrgid_r_proto=0
12798 : see if getgrnam_r exists
12799 set getgrnam_r d_getgrnam_r
12801 case "$d_getgrnam_r" in
12803 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
12804 case "$d_getgrnam_r_proto:$usethreads" in
12805 ":define") d_getgrnam_r_proto=define
12806 set d_getgrnam_r_proto getgrnam_r $hdrs
12810 case "$d_getgrnam_r_proto" in
12812 case "$getgrnam_r_proto" in
12813 ''|0) try='int getgrnam_r(const char*, struct group*, char*, size_t, struct group**);'
12814 ./protochk "extern $try" $hdrs && getgrnam_r_proto=I_CSBWR ;;
12816 case "$getgrnam_r_proto" in
12817 ''|0) try='int getgrnam_r(const char*, struct group*, char*, int, struct group**);'
12818 ./protochk "extern $try" $hdrs && getgrnam_r_proto=I_CSBIR ;;
12820 case "$getgrnam_r_proto" in
12821 ''|0) try='struct group* getgrnam_r(const char*, char*, int);'
12822 ./protochk "extern $try" $hdrs && getgrnam_r_proto=S_CBI ;;
12824 case "$getgrnam_r_proto" in
12825 ''|0) try='int getgrnam_r(const char*, struct group*, char*, int);'
12826 ./protochk "extern $try" $hdrs && getgrnam_r_proto=I_CSBI ;;
12828 case "$getgrnam_r_proto" in
12829 ''|0) try='struct group* getgrnam_r(const char*, struct group*, char*, int);'
12830 ./protochk "extern $try" $hdrs && getgrnam_r_proto=S_CSBI ;;
12832 case "$getgrnam_r_proto" in
12833 ''|0) d_getgrnam_r=undef
12835 echo "Disabling getgrnam_r, cannot determine prototype." >&4 ;;
12836 * ) case "$getgrnam_r_proto" in
12837 REENTRANT_PROTO*) ;;
12838 *) getgrnam_r_proto="REENTRANT_PROTO_$getgrnam_r_proto" ;;
12840 echo "Prototype: $try" ;;
12843 *) case "$usethreads" in
12844 define) echo "getgrnam_r has no prototype, not using it." >&4 ;;
12851 *) getgrnam_r_proto=0
12855 : see if gethostbyaddr exists
12856 set gethostbyaddr d_gethbyaddr
12859 : see if gethostbyname exists
12860 set gethostbyname d_gethbyname
12863 : see if gethostent exists
12864 set gethostent d_gethent
12867 : see how we will look up host name
12870 if set gethostname val -f d_gethname; eval $csym; $val; then
12871 echo 'gethostname() found.' >&4
12872 d_gethname="$define"
12875 if set uname val -f d_uname; eval $csym; $val; then
12878 uname() was found, but you're running xenix, and older versions of xenix
12879 have a broken uname(). If you don't really know whether your xenix is old
12880 enough to have a broken system call, use the default answer.
12885 "$define") dflt=n;;
12887 rp='Is your uname() broken?'
12890 n*) d_uname="$define"; call=uname;;
12893 echo 'uname() found.' >&4
12900 case "$d_gethname" in
12901 '') d_gethname="$undef";;
12904 '') d_uname="$undef";;
12906 case "$d_uname$d_gethname" in
12911 Every now and then someone has a $call() that lies about the hostname
12912 but can't be fixed for political or economic reasons. If you wish, I can
12913 pretend $call() isn't there and maybe compute hostname at run-time
12914 thanks to the '$phostname' command.
12917 rp="Shall I ignore $call() from now on?"
12920 y*) d_uname="$undef" d_gethname="$undef"; $echo $n "Okay...$c";;
12923 case "$phostname" in
12924 '') aphostname='';;
12925 *) case "$aphostname" in
12927 *) set X $phostname
12931 file=`./loc $file $file $pth`
12932 aphostname=`echo $file $*`
12937 case "$d_uname$d_gethname" in
12940 case "$phostname" in
12942 echo "There will be no way for $package to get your hostname." >&4;;
12944 echo "I'll use 'popen("'"'$aphostname'", "r")'"' to get your hostname." >&4
12948 case "$d_phostname" in
12949 '') d_phostname="$undef";;
12952 : see if gethostbyaddr_r exists
12953 set gethostbyaddr_r d_gethostbyaddr_r
12955 case "$d_gethostbyaddr_r" in
12957 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
12958 case "$d_gethostbyaddr_r_proto:$usethreads" in
12959 ":define") d_gethostbyaddr_r_proto=define
12960 set d_gethostbyaddr_r_proto gethostbyaddr_r $hdrs
12964 case "$d_gethostbyaddr_r_proto" in
12966 case "$gethostbyaddr_r_proto" in
12967 ''|0) try='int gethostbyaddr_r(const char*, size_t, int, struct hostent*, char*, size_t, struct hostent**, int*);'
12968 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=I_CWISBWRE ;;
12970 case "$gethostbyaddr_r_proto" in
12971 ''|0) try='struct hostent* gethostbyaddr_r(const char*, size_t, int, struct hostent*, char*, size_t, int, int*);'
12972 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=S_CWISBWIE ;;
12974 case "$gethostbyaddr_r_proto" in
12975 ''|0) try='struct hostent* gethostbyaddr_r(const char*, size_t, int, struct hostent*, char*, int, int*);'
12976 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=S_CWISBIE ;;
12978 case "$gethostbyaddr_r_proto" in
12979 ''|0) try='struct hostent* gethostbyaddr_r(const void*, size_t, int, struct hostent*, char*, int, int*);'
12980 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=S_TWISBIE ;;
12982 case "$gethostbyaddr_r_proto" in
12983 ''|0) try='struct hostent* gethostbyaddr_r(const char*, int, int, struct hostent*, char*, int, int*);'
12984 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=S_CIISBIE ;;
12986 case "$gethostbyaddr_r_proto" in
12987 ''|0) try='struct hostent* gethostbyaddr_r(const char*, struct hostent*, char*, int, int*);'
12988 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=S_CSBIE ;;
12990 case "$gethostbyaddr_r_proto" in
12991 ''|0) try='struct hostent* gethostbyaddr_r(const void*, struct hostent*, char*, int, int*);'
12992 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=S_TSBIE ;;
12994 case "$gethostbyaddr_r_proto" in
12995 ''|0) try='int gethostbyaddr_r(const char*, size_t, int, struct hostent*, struct hostent_data*);'
12996 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=I_CWISD ;;
12998 case "$gethostbyaddr_r_proto" in
12999 ''|0) try='int gethostbyaddr_r(const char*, int, int, struct hostent*, struct hostent_data*);'
13000 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=I_CIISD ;;
13002 case "$gethostbyaddr_r_proto" in
13003 ''|0) try='int gethostbyaddr_r(const char*, int, int);'
13004 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=I_CII ;;
13006 case "$gethostbyaddr_r_proto" in
13007 ''|0) try='int gethostbyaddr_r(const void*, socklen_t, int, struct hostent*, char*, size_t, struct hostent**, int*);'
13008 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=I_TsISBWRE ;;
13010 case "$gethostbyaddr_r_proto" in
13011 ''|0) d_gethostbyaddr_r=undef
13012 gethostbyaddr_r_proto=0
13013 echo "Disabling gethostbyaddr_r, cannot determine prototype." >&4 ;;
13014 * ) case "$gethostbyaddr_r_proto" in
13015 REENTRANT_PROTO*) ;;
13016 *) gethostbyaddr_r_proto="REENTRANT_PROTO_$gethostbyaddr_r_proto" ;;
13018 echo "Prototype: $try" ;;
13021 *) case "$usethreads" in
13022 define) echo "gethostbyaddr_r has no prototype, not using it." >&4 ;;
13024 d_gethostbyaddr_r=undef
13025 gethostbyaddr_r_proto=0
13029 *) gethostbyaddr_r_proto=0
13033 : see if gethostbyname_r exists
13034 set gethostbyname_r d_gethostbyname_r
13036 case "$d_gethostbyname_r" in
13038 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13039 case "$d_gethostbyname_r_proto:$usethreads" in
13040 ":define") d_gethostbyname_r_proto=define
13041 set d_gethostbyname_r_proto gethostbyname_r $hdrs
13045 case "$d_gethostbyname_r_proto" in
13047 case "$gethostbyname_r_proto" in
13048 ''|0) try='int gethostbyname_r(const char*, struct hostent*, char*, size_t, struct hostent**, int*);'
13049 ./protochk "extern $try" $hdrs && gethostbyname_r_proto=I_CSBWRE ;;
13051 case "$gethostbyname_r_proto" in
13052 ''|0) try='struct hostent* gethostbyname_r(const char*, struct hostent*, char*, int, int*);'
13053 ./protochk "extern $try" $hdrs && gethostbyname_r_proto=S_CSBIE ;;
13055 case "$gethostbyname_r_proto" in
13056 ''|0) try='int gethostbyname_r(const char*, struct hostent*, struct hostent_data*);'
13057 ./protochk "extern $try" $hdrs && gethostbyname_r_proto=I_CSD ;;
13059 case "$gethostbyname_r_proto" in
13060 ''|0) d_gethostbyname_r=undef
13061 gethostbyname_r_proto=0
13062 echo "Disabling gethostbyname_r, cannot determine prototype." >&4 ;;
13063 * ) case "$gethostbyname_r_proto" in
13064 REENTRANT_PROTO*) ;;
13065 *) gethostbyname_r_proto="REENTRANT_PROTO_$gethostbyname_r_proto" ;;
13067 echo "Prototype: $try" ;;
13070 *) case "$usethreads" in
13071 define) echo "gethostbyname_r has no prototype, not using it." >&4 ;;
13073 d_gethostbyname_r=undef
13074 gethostbyname_r_proto=0
13078 *) gethostbyname_r_proto=0
13082 : see if gethostent_r exists
13083 set gethostent_r d_gethostent_r
13085 case "$d_gethostent_r" in
13087 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13088 case "$d_gethostent_r_proto:$usethreads" in
13089 ":define") d_gethostent_r_proto=define
13090 set d_gethostent_r_proto gethostent_r $hdrs
13094 case "$d_gethostent_r_proto" in
13096 case "$gethostent_r_proto" in
13097 ''|0) try='int gethostent_r(struct hostent*, char*, size_t, struct hostent**, int*);'
13098 ./protochk "extern $try" $hdrs && gethostent_r_proto=I_SBWRE ;;
13100 case "$gethostent_r_proto" in
13101 ''|0) try='int gethostent_r(struct hostent*, char*, int, int*);'
13102 ./protochk "extern $try" $hdrs && gethostent_r_proto=I_SBIE ;;
13104 case "$gethostent_r_proto" in
13105 ''|0) try='struct hostent* gethostent_r(struct hostent*, char*, int, int*);'
13106 ./protochk "extern $try" $hdrs && gethostent_r_proto=S_SBIE ;;
13108 case "$gethostent_r_proto" in
13109 ''|0) try='struct hostent* gethostent_r(struct hostent*, char*, int);'
13110 ./protochk "extern $try" $hdrs && gethostent_r_proto=S_SBI ;;
13112 case "$gethostent_r_proto" in
13113 ''|0) try='int gethostent_r(struct hostent*, char*, int);'
13114 ./protochk "extern $try" $hdrs && gethostent_r_proto=I_SBI ;;
13116 case "$gethostent_r_proto" in
13117 ''|0) try='int gethostent_r(struct hostent*, struct hostent_data*);'
13118 ./protochk "extern $try" $hdrs && gethostent_r_proto=I_SD ;;
13120 case "$gethostent_r_proto" in
13121 ''|0) d_gethostent_r=undef
13122 gethostent_r_proto=0
13123 echo "Disabling gethostent_r, cannot determine prototype." >&4 ;;
13124 * ) case "$gethostent_r_proto" in
13125 REENTRANT_PROTO*) ;;
13126 *) gethostent_r_proto="REENTRANT_PROTO_$gethostent_r_proto" ;;
13128 echo "Prototype: $try" ;;
13131 *) case "$usethreads" in
13132 define) echo "gethostent_r has no prototype, not using it." >&4 ;;
13134 d_gethostent_r=undef
13135 gethostent_r_proto=0
13139 *) gethostent_r_proto=0
13143 : see if prototypes for various gethostxxx netdb.h functions are available
13145 set d_gethostprotos gethostent $i_netdb netdb.h
13148 : see if getitimer exists
13149 set getitimer d_getitimer
13152 : see if getlogin exists
13153 set getlogin d_getlogin
13156 : see if getlogin_r exists
13157 set getlogin_r d_getlogin_r
13159 case "$d_getlogin_r" in
13161 hdrs="$i_systypes sys/types.h define stdio.h $i_unistd unistd.h"
13162 case "$d_getlogin_r_proto:$usethreads" in
13163 ":define") d_getlogin_r_proto=define
13164 set d_getlogin_r_proto getlogin_r $hdrs
13168 case "$d_getlogin_r_proto" in
13170 case "$getlogin_r_proto" in
13171 ''|0) try='int getlogin_r(char*, size_t);'
13172 ./protochk "extern $try" $hdrs && getlogin_r_proto=I_BW ;;
13174 case "$getlogin_r_proto" in
13175 ''|0) try='int getlogin_r(char*, int);'
13176 ./protochk "extern $try" $hdrs && getlogin_r_proto=I_BI ;;
13178 case "$getlogin_r_proto" in
13179 ''|0) try='char* getlogin_r(char*, size_t);'
13180 ./protochk "extern $try" $hdrs && getlogin_r_proto=B_BW ;;
13182 case "$getlogin_r_proto" in
13183 ''|0) try='char* getlogin_r(char*, int);'
13184 ./protochk "extern $try" $hdrs && getlogin_r_proto=B_BI ;;
13186 case "$getlogin_r_proto" in
13187 ''|0) d_getlogin_r=undef
13189 echo "Disabling getlogin_r, cannot determine prototype." >&4 ;;
13190 * ) case "$getlogin_r_proto" in
13191 REENTRANT_PROTO*) ;;
13192 *) getlogin_r_proto="REENTRANT_PROTO_$getlogin_r_proto" ;;
13194 echo "Prototype: $try" ;;
13197 *) case "$usethreads" in
13198 define) echo "getlogin_r has no prototype, not using it." >&4 ;;
13205 *) getlogin_r_proto=0
13209 : see if getmnt exists
13210 set getmnt d_getmnt
13213 : see if getmntent exists
13214 set getmntent d_getmntent
13217 : see if getnetbyaddr exists
13218 set getnetbyaddr d_getnbyaddr
13221 : see if getnetbyname exists
13222 set getnetbyname d_getnbyname
13225 : see if getnetent exists
13226 set getnetent d_getnent
13229 : see if getnetbyaddr_r exists
13230 set getnetbyaddr_r d_getnetbyaddr_r
13232 case "$d_getnetbyaddr_r" in
13234 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13235 case "$d_getnetbyaddr_r_proto:$usethreads" in
13236 ":define") d_getnetbyaddr_r_proto=define
13237 set d_getnetbyaddr_r_proto getnetbyaddr_r $hdrs
13241 case "$d_getnetbyaddr_r_proto" in
13243 case "$getnetbyaddr_r_proto" in
13244 ''|0) try='int getnetbyaddr_r(unsigned long, int, struct netent*, char*, size_t, struct netent**, int*);'
13245 ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=I_UISBWRE ;;
13247 case "$getnetbyaddr_r_proto" in
13248 ''|0) try='int getnetbyaddr_r(long, int, struct netent*, char*, int);'
13249 ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=I_LISBI ;;
13251 case "$getnetbyaddr_r_proto" in
13252 ''|0) try='struct netent* getnetbyaddr_r(in_addr_t, int, struct netent*, char*, int);'
13253 ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=S_TISBI ;;
13255 case "$getnetbyaddr_r_proto" in
13256 ''|0) try='struct netent* getnetbyaddr_r(long, int, struct netent*, char*, int);'
13257 ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=S_LISBI ;;
13259 case "$getnetbyaddr_r_proto" in
13260 ''|0) try='int getnetbyaddr_r(in_addr_t, int, struct netent*, struct netent_data*);'
13261 ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=I_TISD ;;
13263 case "$getnetbyaddr_r_proto" in
13264 ''|0) try='int getnetbyaddr_r(long, int, struct netent*, struct netent_data*);'
13265 ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=I_LISD ;;
13267 case "$getnetbyaddr_r_proto" in
13268 ''|0) try='int getnetbyaddr_r(int, int, struct netent*, struct netent_data*);'
13269 ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=I_IISD ;;
13271 case "$getnetbyaddr_r_proto" in
13272 ''|0) try='int getnetbyaddr_r(uint32_t, int, struct netent*, char*, size_t, struct netent**, int*);'
13273 ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=I_uISBWRE ;;
13275 case "$getnetbyaddr_r_proto" in
13276 ''|0) d_getnetbyaddr_r=undef
13277 getnetbyaddr_r_proto=0
13278 echo "Disabling getnetbyaddr_r, cannot determine prototype." >&4 ;;
13279 * ) case "$getnetbyaddr_r_proto" in
13280 REENTRANT_PROTO*) ;;
13281 *) getnetbyaddr_r_proto="REENTRANT_PROTO_$getnetbyaddr_r_proto" ;;
13283 echo "Prototype: $try" ;;
13286 *) case "$usethreads" in
13287 define) echo "getnetbyaddr_r has no prototype, not using it." >&4 ;;
13289 d_getnetbyaddr_r=undef
13290 getnetbyaddr_r_proto=0
13294 *) getnetbyaddr_r_proto=0
13298 : see if getnetbyname_r exists
13299 set getnetbyname_r d_getnetbyname_r
13301 case "$d_getnetbyname_r" in
13303 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13304 case "$d_getnetbyname_r_proto:$usethreads" in
13305 ":define") d_getnetbyname_r_proto=define
13306 set d_getnetbyname_r_proto getnetbyname_r $hdrs
13310 case "$d_getnetbyname_r_proto" in
13312 case "$getnetbyname_r_proto" in
13313 ''|0) try='int getnetbyname_r(const char*, struct netent*, char*, size_t, struct netent**, int*);'
13314 ./protochk "extern $try" $hdrs && getnetbyname_r_proto=I_CSBWRE ;;
13316 case "$getnetbyname_r_proto" in
13317 ''|0) try='int getnetbyname_r(const char*, struct netent*, char*, int);'
13318 ./protochk "extern $try" $hdrs && getnetbyname_r_proto=I_CSBI ;;
13320 case "$getnetbyname_r_proto" in
13321 ''|0) try='struct netent* getnetbyname_r(const char*, struct netent*, char*, int);'
13322 ./protochk "extern $try" $hdrs && getnetbyname_r_proto=S_CSBI ;;
13324 case "$getnetbyname_r_proto" in
13325 ''|0) try='int getnetbyname_r(const char*, struct netent*, struct netent_data*);'
13326 ./protochk "extern $try" $hdrs && getnetbyname_r_proto=I_CSD ;;
13328 case "$getnetbyname_r_proto" in
13329 ''|0) d_getnetbyname_r=undef
13330 getnetbyname_r_proto=0
13331 echo "Disabling getnetbyname_r, cannot determine prototype." >&4 ;;
13332 * ) case "$getnetbyname_r_proto" in
13333 REENTRANT_PROTO*) ;;
13334 *) getnetbyname_r_proto="REENTRANT_PROTO_$getnetbyname_r_proto" ;;
13336 echo "Prototype: $try" ;;
13339 *) case "$usethreads" in
13340 define) echo "getnetbyname_r has no prototype, not using it." >&4 ;;
13342 d_getnetbyname_r=undef
13343 getnetbyname_r_proto=0
13347 *) getnetbyname_r_proto=0
13351 : see if getnetent_r exists
13352 set getnetent_r d_getnetent_r
13354 case "$d_getnetent_r" in
13356 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13357 case "$d_getnetent_r_proto:$usethreads" in
13358 ":define") d_getnetent_r_proto=define
13359 set d_getnetent_r_proto getnetent_r $hdrs
13363 case "$d_getnetent_r_proto" in
13365 case "$getnetent_r_proto" in
13366 ''|0) try='int getnetent_r(struct netent*, char*, size_t, struct netent**, int*);'
13367 ./protochk "extern $try" $hdrs && getnetent_r_proto=I_SBWRE ;;
13369 case "$getnetent_r_proto" in
13370 ''|0) try='int getnetent_r(struct netent*, char*, int, int*);'
13371 ./protochk "extern $try" $hdrs && getnetent_r_proto=I_SBIE ;;
13373 case "$getnetent_r_proto" in
13374 ''|0) try='struct netent* getnetent_r(struct netent*, char*, int, int*);'
13375 ./protochk "extern $try" $hdrs && getnetent_r_proto=S_SBIE ;;
13377 case "$getnetent_r_proto" in
13378 ''|0) try='struct netent* getnetent_r(struct netent*, char*, int);'
13379 ./protochk "extern $try" $hdrs && getnetent_r_proto=S_SBI ;;
13381 case "$getnetent_r_proto" in
13382 ''|0) try='int getnetent_r(struct netent*, char*, int);'
13383 ./protochk "extern $try" $hdrs && getnetent_r_proto=I_SBI ;;
13385 case "$getnetent_r_proto" in
13386 ''|0) try='int getnetent_r(struct netent*, struct netent_data*);'
13387 ./protochk "extern $try" $hdrs && getnetent_r_proto=I_SD ;;
13389 case "$getnetent_r_proto" in
13390 ''|0) d_getnetent_r=undef
13391 getnetent_r_proto=0
13392 echo "Disabling getnetent_r, cannot determine prototype." >&4 ;;
13393 * ) case "$getnetent_r_proto" in
13394 REENTRANT_PROTO*) ;;
13395 *) getnetent_r_proto="REENTRANT_PROTO_$getnetent_r_proto" ;;
13397 echo "Prototype: $try" ;;
13400 *) case "$usethreads" in
13401 define) echo "getnetent_r has no prototype, not using it." >&4 ;;
13403 d_getnetent_r=undef
13404 getnetent_r_proto=0
13408 *) getnetent_r_proto=0
13412 : see if prototypes for various getnetxxx netdb.h functions are available
13414 set d_getnetprotos getnetent $i_netdb netdb.h
13417 : see if getpagesize exists
13418 set getpagesize d_getpagsz
13422 : see if getprotobyname exists
13423 set getprotobyname d_getpbyname
13426 : see if getprotobynumber exists
13427 set getprotobynumber d_getpbynumber
13430 : see if getprotoent exists
13431 set getprotoent d_getpent
13434 : see if getpgid exists
13435 set getpgid d_getpgid
13438 : see if getpgrp2 exists
13439 set getpgrp2 d_getpgrp2
13442 : see if getppid exists
13443 set getppid d_getppid
13446 : see if getpriority exists
13447 set getpriority d_getprior
13450 : see if getprotobyname_r exists
13451 set getprotobyname_r d_getprotobyname_r
13453 case "$d_getprotobyname_r" in
13455 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13456 case "$d_getprotobyname_r_proto:$usethreads" in
13457 ":define") d_getprotobyname_r_proto=define
13458 set d_getprotobyname_r_proto getprotobyname_r $hdrs
13462 case "$d_getprotobyname_r_proto" in
13464 case "$getprotobyname_r_proto" in
13465 ''|0) try='int getprotobyname_r(const char*, struct protoent*, char*, size_t, struct protoent**);'
13466 ./protochk "extern $try" $hdrs && getprotobyname_r_proto=I_CSBWR ;;
13468 case "$getprotobyname_r_proto" in
13469 ''|0) try='struct protoent* getprotobyname_r(const char*, struct protoent*, char*, int);'
13470 ./protochk "extern $try" $hdrs && getprotobyname_r_proto=S_CSBI ;;
13472 case "$getprotobyname_r_proto" in
13473 ''|0) try='int getprotobyname_r(const char*, struct protoent*, struct protoent_data*);'
13474 ./protochk "extern $try" $hdrs && getprotobyname_r_proto=I_CSD ;;
13476 case "$getprotobyname_r_proto" in
13477 ''|0) d_getprotobyname_r=undef
13478 getprotobyname_r_proto=0
13479 echo "Disabling getprotobyname_r, cannot determine prototype." >&4 ;;
13480 * ) case "$getprotobyname_r_proto" in
13481 REENTRANT_PROTO*) ;;
13482 *) getprotobyname_r_proto="REENTRANT_PROTO_$getprotobyname_r_proto" ;;
13484 echo "Prototype: $try" ;;
13487 *) case "$usethreads" in
13488 define) echo "getprotobyname_r has no prototype, not using it." >&4 ;;
13490 d_getprotobyname_r=undef
13491 getprotobyname_r_proto=0
13495 *) getprotobyname_r_proto=0
13499 : see if getprotobynumber_r exists
13500 set getprotobynumber_r d_getprotobynumber_r
13502 case "$d_getprotobynumber_r" in
13504 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13505 case "$d_getprotobynumber_r_proto:$usethreads" in
13506 ":define") d_getprotobynumber_r_proto=define
13507 set d_getprotobynumber_r_proto getprotobynumber_r $hdrs
13511 case "$d_getprotobynumber_r_proto" in
13513 case "$getprotobynumber_r_proto" in
13514 ''|0) try='int getprotobynumber_r(int, struct protoent*, char*, size_t, struct protoent**);'
13515 ./protochk "extern $try" $hdrs && getprotobynumber_r_proto=I_ISBWR ;;
13517 case "$getprotobynumber_r_proto" in
13518 ''|0) try='struct protoent* getprotobynumber_r(int, struct protoent*, char*, int);'
13519 ./protochk "extern $try" $hdrs && getprotobynumber_r_proto=S_ISBI ;;
13521 case "$getprotobynumber_r_proto" in
13522 ''|0) try='int getprotobynumber_r(int, struct protoent*, struct protoent_data*);'
13523 ./protochk "extern $try" $hdrs && getprotobynumber_r_proto=I_ISD ;;
13525 case "$getprotobynumber_r_proto" in
13526 ''|0) d_getprotobynumber_r=undef
13527 getprotobynumber_r_proto=0
13528 echo "Disabling getprotobynumber_r, cannot determine prototype." >&4 ;;
13529 * ) case "$getprotobynumber_r_proto" in
13530 REENTRANT_PROTO*) ;;
13531 *) getprotobynumber_r_proto="REENTRANT_PROTO_$getprotobynumber_r_proto" ;;
13533 echo "Prototype: $try" ;;
13536 *) case "$usethreads" in
13537 define) echo "getprotobynumber_r has no prototype, not using it." >&4 ;;
13539 d_getprotobynumber_r=undef
13540 getprotobynumber_r_proto=0
13544 *) getprotobynumber_r_proto=0
13548 : see if getprotoent_r exists
13549 set getprotoent_r d_getprotoent_r
13551 case "$d_getprotoent_r" in
13553 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13554 case "$d_getprotoent_r_proto:$usethreads" in
13555 ":define") d_getprotoent_r_proto=define
13556 set d_getprotoent_r_proto getprotoent_r $hdrs
13560 case "$d_getprotoent_r_proto" in
13562 case "$getprotoent_r_proto" in
13563 ''|0) try='int getprotoent_r(struct protoent*, char*, size_t, struct protoent**);'
13564 ./protochk "extern $try" $hdrs && getprotoent_r_proto=I_SBWR ;;
13566 case "$getprotoent_r_proto" in
13567 ''|0) try='int getprotoent_r(struct protoent*, char*, int);'
13568 ./protochk "extern $try" $hdrs && getprotoent_r_proto=I_SBI ;;
13570 case "$getprotoent_r_proto" in
13571 ''|0) try='struct protoent* getprotoent_r(struct protoent*, char*, int);'
13572 ./protochk "extern $try" $hdrs && getprotoent_r_proto=S_SBI ;;
13574 case "$getprotoent_r_proto" in
13575 ''|0) try='int getprotoent_r(struct protoent*, struct protoent_data*);'
13576 ./protochk "extern $try" $hdrs && getprotoent_r_proto=I_SD ;;
13578 case "$getprotoent_r_proto" in
13579 ''|0) d_getprotoent_r=undef
13580 getprotoent_r_proto=0
13581 echo "Disabling getprotoent_r, cannot determine prototype." >&4 ;;
13582 * ) case "$getprotoent_r_proto" in
13583 REENTRANT_PROTO*) ;;
13584 *) getprotoent_r_proto="REENTRANT_PROTO_$getprotoent_r_proto" ;;
13586 echo "Prototype: $try" ;;
13589 *) case "$usethreads" in
13590 define) echo "getprotoent_r has no prototype, not using it." >&4 ;;
13592 d_getprotoent_r=undef
13593 getprotoent_r_proto=0
13597 *) getprotoent_r_proto=0
13601 : see if prototypes for various getprotoxxx netdb.h functions are available
13603 set d_getprotoprotos getprotoent $i_netdb netdb.h
13606 : see if getprpwnam exists
13607 set getprpwnam d_getprpwnam
13610 : see if getpwent exists
13611 set getpwent d_getpwent
13614 : see if getpwent_r exists
13615 set getpwent_r d_getpwent_r
13617 case "$d_getpwent_r" in
13619 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
13620 case "$d_getpwent_r_proto:$usethreads" in
13621 ":define") d_getpwent_r_proto=define
13622 set d_getpwent_r_proto getpwent_r $hdrs
13626 case "$d_getpwent_r_proto" in
13628 case "$getpwent_r_proto" in
13629 ''|0) try='int getpwent_r(struct passwd*, char*, size_t, struct passwd**);'
13630 ./protochk "extern $try" $hdrs && getpwent_r_proto=I_SBWR ;;
13632 case "$getpwent_r_proto" in
13633 ''|0) try='int getpwent_r(struct passwd*, char*, int, struct passwd**);'
13634 ./protochk "extern $try" $hdrs && getpwent_r_proto=I_SBIR ;;
13636 case "$getpwent_r_proto" in
13637 ''|0) try='struct passwd* getpwent_r(struct passwd*, char*, size_t);'
13638 ./protochk "extern $try" $hdrs && getpwent_r_proto=S_SBW ;;
13640 case "$getpwent_r_proto" in
13641 ''|0) try='struct passwd* getpwent_r(struct passwd*, char*, int);'
13642 ./protochk "extern $try" $hdrs && getpwent_r_proto=S_SBI ;;
13644 case "$getpwent_r_proto" in
13645 ''|0) try='int getpwent_r(struct passwd*, char*, int);'
13646 ./protochk "extern $try" $hdrs && getpwent_r_proto=I_SBI ;;
13648 case "$getpwent_r_proto" in
13649 ''|0) try='int getpwent_r(struct passwd*, char*, int, FILE**);'
13650 ./protochk "extern $try" $hdrs && getpwent_r_proto=I_SBIH ;;
13652 case "$getpwent_r_proto" in
13653 ''|0) d_getpwent_r=undef
13655 echo "Disabling getpwent_r, cannot determine prototype." >&4 ;;
13656 * ) case "$getpwent_r_proto" in
13657 REENTRANT_PROTO*) ;;
13658 *) getpwent_r_proto="REENTRANT_PROTO_$getpwent_r_proto" ;;
13660 echo "Prototype: $try" ;;
13663 *) case "$usethreads" in
13664 define) echo "getpwent_r has no prototype, not using it." >&4 ;;
13671 *) getpwent_r_proto=0
13675 : see if getpwnam_r exists
13676 set getpwnam_r d_getpwnam_r
13678 case "$d_getpwnam_r" in
13680 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
13681 case "$d_getpwnam_r_proto:$usethreads" in
13682 ":define") d_getpwnam_r_proto=define
13683 set d_getpwnam_r_proto getpwnam_r $hdrs
13687 case "$d_getpwnam_r_proto" in
13689 case "$getpwnam_r_proto" in
13690 ''|0) try='int getpwnam_r(const char*, struct passwd*, char*, size_t, struct passwd**);'
13691 ./protochk "extern $try" $hdrs && getpwnam_r_proto=I_CSBWR ;;
13693 case "$getpwnam_r_proto" in
13694 ''|0) try='int getpwnam_r(const char*, struct passwd*, char*, int, struct passwd**);'
13695 ./protochk "extern $try" $hdrs && getpwnam_r_proto=I_CSBIR ;;
13697 case "$getpwnam_r_proto" in
13698 ''|0) try='struct passwd* getpwnam_r(const char*, struct passwd*, char*, int);'
13699 ./protochk "extern $try" $hdrs && getpwnam_r_proto=S_CSBI ;;
13701 case "$getpwnam_r_proto" in
13702 ''|0) try='int getpwnam_r(const char*, struct passwd*, char*, int);'
13703 ./protochk "extern $try" $hdrs && getpwnam_r_proto=I_CSBI ;;
13705 case "$getpwnam_r_proto" in
13706 ''|0) d_getpwnam_r=undef
13708 echo "Disabling getpwnam_r, cannot determine prototype." >&4 ;;
13709 * ) case "$getpwnam_r_proto" in
13710 REENTRANT_PROTO*) ;;
13711 *) getpwnam_r_proto="REENTRANT_PROTO_$getpwnam_r_proto" ;;
13713 echo "Prototype: $try" ;;
13716 *) case "$usethreads" in
13717 define) echo "getpwnam_r has no prototype, not using it." >&4 ;;
13724 *) getpwnam_r_proto=0
13728 : see if getpwuid_r exists
13729 set getpwuid_r d_getpwuid_r
13731 case "$d_getpwuid_r" in
13733 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
13734 case "$d_getpwuid_r_proto:$usethreads" in
13735 ":define") d_getpwuid_r_proto=define
13736 set d_getpwuid_r_proto getpwuid_r $hdrs
13740 case "$d_getpwuid_r_proto" in
13742 case "$getpwuid_r_proto" in
13743 ''|0) try='int getpwuid_r(uid_t, struct passwd*, char*, size_t, struct passwd**);'
13744 ./protochk "extern $try" $hdrs && getpwuid_r_proto=I_TSBWR ;;
13746 case "$getpwuid_r_proto" in
13747 ''|0) try='int getpwuid_r(uid_t, struct passwd*, char*, int, struct passwd**);'
13748 ./protochk "extern $try" $hdrs && getpwuid_r_proto=I_TSBIR ;;
13750 case "$getpwuid_r_proto" in
13751 ''|0) try='int getpwuid_r(uid_t, struct passwd*, char*, int);'
13752 ./protochk "extern $try" $hdrs && getpwuid_r_proto=I_TSBI ;;
13754 case "$getpwuid_r_proto" in
13755 ''|0) try='struct passwd* getpwuid_r(uid_t, struct passwd*, char*, int);'
13756 ./protochk "extern $try" $hdrs && getpwuid_r_proto=S_TSBI ;;
13758 case "$getpwuid_r_proto" in
13759 ''|0) d_getpwuid_r=undef
13761 echo "Disabling getpwuid_r, cannot determine prototype." >&4 ;;
13762 * ) case "$getpwuid_r_proto" in
13763 REENTRANT_PROTO*) ;;
13764 *) getpwuid_r_proto="REENTRANT_PROTO_$getpwuid_r_proto" ;;
13766 echo "Prototype: $try" ;;
13769 *) case "$usethreads" in
13770 define) echo "getpwuid_r has no prototype, not using it." >&4 ;;
13777 *) getpwuid_r_proto=0
13782 : see if getservbyname exists
13783 set getservbyname d_getsbyname
13786 : see if getservbyport exists
13787 set getservbyport d_getsbyport
13790 : see if getservent exists
13791 set getservent d_getsent
13794 : see if getservbyname_r exists
13795 set getservbyname_r d_getservbyname_r
13797 case "$d_getservbyname_r" in
13799 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13800 case "$d_getservbyname_r_proto:$usethreads" in
13801 ":define") d_getservbyname_r_proto=define
13802 set d_getservbyname_r_proto getservbyname_r $hdrs
13806 case "$d_getservbyname_r_proto" in
13808 case "$getservbyname_r_proto" in
13809 ''|0) try='int getservbyname_r(const char*, const char*, struct servent*, char*, size_t, struct servent**);'
13810 ./protochk "extern $try" $hdrs && getservbyname_r_proto=I_CCSBWR ;;
13812 case "$getservbyname_r_proto" in
13813 ''|0) try='struct servent* getservbyname_r(const char*, const char*, struct servent*, char*, int);'
13814 ./protochk "extern $try" $hdrs && getservbyname_r_proto=S_CCSBI ;;
13816 case "$getservbyname_r_proto" in
13817 ''|0) try='int getservbyname_r(const char*, const char*, struct servent*, struct servent_data*);'
13818 ./protochk "extern $try" $hdrs && getservbyname_r_proto=I_CCSD ;;
13820 case "$getservbyname_r_proto" in
13821 ''|0) d_getservbyname_r=undef
13822 getservbyname_r_proto=0
13823 echo "Disabling getservbyname_r, cannot determine prototype." >&4 ;;
13824 * ) case "$getservbyname_r_proto" in
13825 REENTRANT_PROTO*) ;;
13826 *) getservbyname_r_proto="REENTRANT_PROTO_$getservbyname_r_proto" ;;
13828 echo "Prototype: $try" ;;
13831 *) case "$usethreads" in
13832 define) echo "getservbyname_r has no prototype, not using it." >&4 ;;
13834 d_getservbyname_r=undef
13835 getservbyname_r_proto=0
13839 *) getservbyname_r_proto=0
13843 : see if getservbyport_r exists
13844 set getservbyport_r d_getservbyport_r
13846 case "$d_getservbyport_r" in
13848 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13849 case "$d_getservbyport_r_proto:$usethreads" in
13850 ":define") d_getservbyport_r_proto=define
13851 set d_getservbyport_r_proto getservbyport_r $hdrs
13855 case "$d_getservbyport_r_proto" in
13857 case "$getservbyport_r_proto" in
13858 ''|0) try='int getservbyport_r(int, const char*, struct servent*, char*, size_t, struct servent**);'
13859 ./protochk "extern $try" $hdrs && getservbyport_r_proto=I_ICSBWR ;;
13861 case "$getservbyport_r_proto" in
13862 ''|0) try='struct servent* getservbyport_r(int, const char*, struct servent*, char*, int);'
13863 ./protochk "extern $try" $hdrs && getservbyport_r_proto=S_ICSBI ;;
13865 case "$getservbyport_r_proto" in
13866 ''|0) try='int getservbyport_r(int, const char*, struct servent*, struct servent_data*);'
13867 ./protochk "extern $try" $hdrs && getservbyport_r_proto=I_ICSD ;;
13869 case "$getservbyport_r_proto" in
13870 ''|0) d_getservbyport_r=undef
13871 getservbyport_r_proto=0
13872 echo "Disabling getservbyport_r, cannot determine prototype." >&4 ;;
13873 * ) case "$getservbyport_r_proto" in
13874 REENTRANT_PROTO*) ;;
13875 *) getservbyport_r_proto="REENTRANT_PROTO_$getservbyport_r_proto" ;;
13877 echo "Prototype: $try" ;;
13880 *) case "$usethreads" in
13881 define) echo "getservbyport_r has no prototype, not using it." >&4 ;;
13883 d_getservbyport_r=undef
13884 getservbyport_r_proto=0
13888 *) getservbyport_r_proto=0
13892 : see if getservent_r exists
13893 set getservent_r d_getservent_r
13895 case "$d_getservent_r" in
13897 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13898 case "$d_getservent_r_proto:$usethreads" in
13899 ":define") d_getservent_r_proto=define
13900 set d_getservent_r_proto getservent_r $hdrs
13904 case "$d_getservent_r_proto" in
13906 case "$getservent_r_proto" in
13907 ''|0) try='int getservent_r(struct servent*, char*, size_t, struct servent**);'
13908 ./protochk "extern $try" $hdrs && getservent_r_proto=I_SBWR ;;
13910 case "$getservent_r_proto" in
13911 ''|0) try='int getservent_r(struct servent*, char*, int);'
13912 ./protochk "extern $try" $hdrs && getservent_r_proto=I_SBI ;;
13914 case "$getservent_r_proto" in
13915 ''|0) try='struct servent* getservent_r(struct servent*, char*, int);'
13916 ./protochk "extern $try" $hdrs && getservent_r_proto=S_SBI ;;
13918 case "$getservent_r_proto" in
13919 ''|0) try='int getservent_r(struct servent*, struct servent_data*);'
13920 ./protochk "extern $try" $hdrs && getservent_r_proto=I_SD ;;
13922 case "$getservent_r_proto" in
13923 ''|0) d_getservent_r=undef
13924 getservent_r_proto=0
13925 echo "Disabling getservent_r, cannot determine prototype." >&4 ;;
13926 * ) case "$getservent_r_proto" in
13927 REENTRANT_PROTO*) ;;
13928 *) getservent_r_proto="REENTRANT_PROTO_$getservent_r_proto" ;;
13930 echo "Prototype: $try" ;;
13933 *) case "$usethreads" in
13934 define) echo "getservent_r has no prototype, not using it." >&4 ;;
13936 d_getservent_r=undef
13937 getservent_r_proto=0
13941 *) getservent_r_proto=0
13945 : see if prototypes for various getservxxx netdb.h functions are available
13947 set d_getservprotos getservent $i_netdb netdb.h
13950 : see if getspnam exists
13951 set getspnam d_getspnam
13954 : see if this is a shadow.h system
13955 set shadow.h i_shadow
13958 : see if getspnam_r exists
13959 set getspnam_r d_getspnam_r
13961 case "$d_getspnam_r" in
13963 hdrs="$i_systypes sys/types.h define stdio.h $i_shadow shadow.h"
13964 case "$d_getspnam_r_proto:$usethreads" in
13965 ":define") d_getspnam_r_proto=define
13966 set d_getspnam_r_proto getspnam_r $hdrs
13970 case "$d_getspnam_r_proto" in
13972 case "$getspnam_r_proto" in
13973 ''|0) try='int getspnam_r(const char*, struct spwd*, char*, size_t, struct spwd**);'
13974 ./protochk "extern $try" $hdrs && getspnam_r_proto=I_CSBWR ;;
13976 case "$getspnam_r_proto" in
13977 ''|0) try='struct spwd* getspnam_r(const char*, struct spwd*, char*, int);'
13978 ./protochk "extern $try" $hdrs && getspnam_r_proto=S_CSBI ;;
13980 case "$getspnam_r_proto" in
13981 ''|0) d_getspnam_r=undef
13983 echo "Disabling getspnam_r, cannot determine prototype." >&4 ;;
13984 * ) case "$getspnam_r_proto" in
13985 REENTRANT_PROTO*) ;;
13986 *) getspnam_r_proto="REENTRANT_PROTO_$getspnam_r_proto" ;;
13988 echo "Prototype: $try" ;;
13991 *) case "$usethreads" in
13992 define) echo "getspnam_r has no prototype, not using it." >&4 ;;
13999 *) getspnam_r_proto=0
14003 : see if gettimeofday or ftime exists
14004 set gettimeofday d_gettimeod
14006 case "$d_gettimeod" in
14012 val="$undef"; set d_ftime; eval $setvar
14015 case "$d_gettimeod$d_ftime" in
14018 echo 'No ftime() nor gettimeofday() -- timing may be less accurate.' >&4
14022 : see if gmtime_r exists
14023 set gmtime_r d_gmtime_r
14025 case "$d_gmtime_r" in
14027 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
14028 case "$d_gmtime_r_proto:$usethreads" in
14029 ":define") d_gmtime_r_proto=define
14030 set d_gmtime_r_proto gmtime_r $hdrs
14034 case "$d_gmtime_r_proto" in
14036 case "$gmtime_r_proto" in
14037 ''|0) try='struct tm* gmtime_r(const time_t*, struct tm*);'
14038 ./protochk "extern $try" $hdrs && gmtime_r_proto=S_TS ;;
14040 case "$gmtime_r_proto" in
14041 ''|0) try='int gmtime_r(const time_t*, struct tm*);'
14042 ./protochk "extern $try" $hdrs && gmtime_r_proto=I_TS ;;
14044 case "$gmtime_r_proto" in
14045 ''|0) d_gmtime_r=undef
14047 echo "Disabling gmtime_r, cannot determine prototype." >&4 ;;
14048 * ) case "$gmtime_r_proto" in
14049 REENTRANT_PROTO*) ;;
14050 *) gmtime_r_proto="REENTRANT_PROTO_$gmtime_r_proto" ;;
14052 echo "Prototype: $try" ;;
14055 *) case "$usethreads" in
14056 define) echo "gmtime_r has no prototype, not using it." >&4 ;;
14063 *) gmtime_r_proto=0
14067 : see if hasmntopt exists
14068 set hasmntopt d_hasmntopt
14071 : see if this is a netinet/in.h or sys/in.h system
14072 set netinet/in.h i_niin sys/in.h i_sysin
14075 : see if arpa/inet.h has to be included
14076 set arpa/inet.h i_arpainet
14079 : see if htonl --and friends-- exists
14084 : Maybe they are macros.
14087 $cat >htonl.c <<EOM
14089 #include <sys/types.h>
14090 #$i_niin I_NETINET_IN
14092 #$i_arpainet I_ARPA_INET
14093 #ifdef I_NETINET_IN
14094 #include <netinet/in.h>
14097 #include <sys/in.h>
14100 #include <arpa/inet.h>
14103 printf("Defined as a macro.");
14106 $cppstdin $cppflags $cppminus < htonl.c >htonl.E 2>/dev/null
14107 if $contains 'Defined as a macro' htonl.E >/dev/null 2>&1; then
14109 echo "But it seems to be defined as a macro." >&4
14117 : see if ilogbl exists
14118 set ilogbl d_ilogbl
14123 if set index val -f; eval $csym; $val; then
14124 if set strchr val -f d_strchr; eval $csym; $val; then
14125 if $contains strchr "$strings" >/dev/null 2>&1 ; then
14128 echo "strchr() found." >&4
14132 echo "index() found." >&4
14137 echo "index() found." >&4
14140 if set strchr val -f d_strchr; eval $csym; $val; then
14143 echo "strchr() found." >&4
14145 echo "No index() or strchr() found!" >&4
14150 set d_strchr; eval $setvar
14152 set d_index; eval $setvar
14154 : check whether inet_aton exists
14155 set inet_aton d_inetaton
14160 $cat >isascii.c <<EOCP
14163 #$i_stdlib I_STDLIB
14165 #include <stdlib.h>
14176 if eval $compile; then
14177 echo "isascii() found." >&4
14180 echo "isascii() NOT found." >&4
14187 : see if isfinite exists
14188 set isfinite d_isfinite
14191 : see if isinf exists
14195 : see if isnan exists
14199 : see if isnanl exists
14200 set isnanl d_isnanl
14203 : see if killpg exists
14204 set killpg d_killpg
14207 : see if lchown exists
14209 $cat > try.c <<'EOCP'
14210 /* System header to define __stub macros and hopefully few prototypes,
14211 which can conflict with char lchown(); below. */
14212 #include <assert.h>
14213 /* Override any gcc2 internal prototype to avoid an error. */
14214 /* We use char because int might match the return type of a gcc2
14215 builtin and then its argument prototype would still apply. */
14218 /* The GNU C library defines this for functions which it implements
14219 to always fail with ENOSYS. Some functions are actually named
14220 something starting with __ and the normal name is an alias. */
14221 #if defined (__stub_lchown) || defined (__stub___lchown)
14229 if eval $compile; then
14230 $echo "lchown() found." >&4
14233 $echo "lchown() NOT found." >&4
14239 : See if number of significant digits in a double precision number is known
14241 $cat >ldbl_dig.c <<EOM
14242 #$i_limits I_LIMITS
14245 #include <limits.h>
14251 printf("Contains LDBL_DIG");
14254 $cppstdin $cppflags $cppminus < ldbl_dig.c >ldbl_dig.E 2>/dev/null
14255 if $contains 'LDBL_DIG' ldbl_dig.E >/dev/null 2>&1; then
14256 echo "LDBL_DIG found." >&4
14259 echo "LDBL_DIG NOT found." >&4
14266 : see if this is a math.h system
14270 d_libm_lib_version="$undef"
14273 : check to see if math.h defines _LIB_VERSION
14275 echo "Checking to see if your libm supports _LIB_VERSION..." >&4
14277 #include <unistd.h>
14279 int main (int argc, char *argv[])
14281 printf ("%d\n", _LIB_VERSION);
14286 if eval $compile; then
14288 echo "Yes, it does ($foo)" >&4
14289 d_libm_lib_version="$define"
14291 echo "No, it does not (probably harmless)\n" >&4
14293 $rm -f try.* try core core.try.*
14298 : see if link exists
14302 : see if localtime_r exists
14303 set localtime_r d_localtime_r
14305 case "$d_localtime_r" in
14307 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
14308 case "$d_localtime_r_proto:$usethreads" in
14309 ":define") d_localtime_r_proto=define
14310 set d_localtime_r_proto localtime_r $hdrs
14314 case "$d_localtime_r_proto" in
14316 case "$localtime_r_proto" in
14317 ''|0) try='struct tm* localtime_r(const time_t*, struct tm*);'
14318 ./protochk "extern $try" $hdrs && localtime_r_proto=S_TS ;;
14320 case "$localtime_r_proto" in
14321 ''|0) try='int localtime_r(const time_t*, struct tm*);'
14322 ./protochk "extern $try" $hdrs && localtime_r_proto=I_TS ;;
14324 case "$localtime_r_proto" in
14325 ''|0) d_localtime_r=undef
14326 localtime_r_proto=0
14327 echo "Disabling localtime_r, cannot determine prototype." >&4 ;;
14328 * ) case "$localtime_r_proto" in
14329 REENTRANT_PROTO*) ;;
14330 *) localtime_r_proto="REENTRANT_PROTO_$localtime_r_proto" ;;
14332 echo "Prototype: $try" ;;
14335 *) case "$usethreads" in
14336 define) echo "localtime_r has no prototype, not using it." >&4 ;;
14338 d_localtime_r=undef
14339 localtime_r_proto=0
14343 *) localtime_r_proto=0
14347 : see if localeconv exists
14348 set localeconv d_locconv
14351 : see if lockf exists
14355 : see if prototype for lseek is available
14357 set d_lseekproto lseek $i_systypes sys/types.h $i_unistd unistd.h
14360 : see if lstat exists
14364 : see if madvise exists
14365 set madvise d_madvise
14368 : see if malloc_size exists
14369 set malloc_size d_malloc_size
14372 : see if malloc_size_good exists
14373 set malloc_good_size d_malloc_good_size
14376 : see if mblen exists
14380 : see if mbstowcs exists
14381 set mbstowcs d_mbstowcs
14384 : see if mbtowc exists
14385 set mbtowc d_mbtowc
14388 : see if memchr exists
14389 set memchr d_memchr
14392 : see if memcmp exists
14393 set memcmp d_memcmp
14396 : see if memcpy exists
14397 set memcpy d_memcpy
14400 : see if memmove exists
14401 set memmove d_memmove
14404 : see if memset exists
14405 set memset d_memset
14408 : see if mkdir exists
14412 : see if mkdtemp exists
14413 set mkdtemp d_mkdtemp
14416 : see if mkfifo exists
14417 set mkfifo d_mkfifo
14420 : see if mkstemp exists
14421 set mkstemp d_mkstemp
14424 : see if mkstemps exists
14425 set mkstemps d_mkstemps
14428 : see if mktime exists
14429 set mktime d_mktime
14432 : see if this is a sys/mman.h system
14433 set sys/mman.h i_sysmman
14436 : see if mmap exists
14439 : see what shmat returns
14440 : default to something harmless
14442 case "$i_sysmman$d_mmap" in
14444 $cat >mmap.c <<'END'
14445 #include <sys/mman.h>
14448 if $cc $ccflags -c mmap.c >/dev/null 2>&1; then
14453 echo "and it returns ($mmaptype)." >&4
14459 : see if sqrtl exists
14463 : see if scalbnl exists
14464 set scalbnl d_scalbnl
14467 : see if modfl exists
14471 : see if prototype for modfl is available
14473 set d_modflproto modfl $i_math math.h
14476 d_modfl_pow32_bug="$undef"
14478 case "$d_longdbl$d_modfl" in
14481 Checking to see whether your modfl() is okay for large values...
14487 if $test "X$d_modflproto" != "X$define"; then
14488 $cat >>try.c <<EOCP
14489 /* Sigh. many current glibcs provide the function, but do not prototype it. */
14490 long double modfl (long double, long double *);
14493 $cat >>try.c <<EOCP
14495 long double nv = 4294967303.15;
14501 printf(" %"$sPRIfldbl" %"$sPRIfldbl" %"$sPRIfldbl"\n", nv, v, w);
14505 case "$osname:$gccversion" in
14506 aix:) saveccflags="$ccflags"
14507 ccflags="$ccflags -qlongdouble" ;; # to avoid core dump
14510 if eval $compile; then
14513 *" 4294967303.150000 1.150000 4294967302.000000")
14514 echo >&4 "Your modfl() is broken for large values."
14515 d_modfl_pow32_bug="$define"
14517 glibc) echo >&4 "You should upgrade your glibc to at least 2.2.2 to get a fixed modfl()."
14521 *" 4294967303.150000 0.150000 4294967303.000000")
14522 echo >&4 "Your modfl() seems okay for large values."
14524 *) echo >&4 "I don't understand your modfl() at all."
14528 $rm -f try.* try core core.try.*
14530 echo "I cannot figure out whether your modfl() is okay, assuming it isn't."
14533 case "$osname:$gccversion" in
14534 aix:) ccflags="$saveccflags" ;; # restore
14539 if $test "$uselongdouble" = "$define"; then
14541 if $test "$d_sqrtl" != "$define"; then
14542 message="$message sqrtl"
14544 if $test "$d_modfl" != "$define"; then
14545 if $test "$d_aintl:$d_copysignl" = "$define:$define"; then
14546 echo "You have both aintl and copysignl, so I can emulate modfl."
14548 message="$message modfl"
14551 if $test "$d_frexpl" != "$define"; then
14552 if $test "$d_ilogbl:$d_scalbnl" = "$define:$define"; then
14553 echo "You have both ilogbl and scalbnl, so I can emulate frexpl."
14555 message="$message frexpl"
14559 if $test "$message" != ""; then
14562 *** You requested the use of long doubles but you do not seem to have
14563 *** the following mathematical functions needed for long double support:
14565 *** Please rerun Configure without -Duselongdouble and/or -Dusemorebits.
14566 *** Cannot continue, aborting.
14574 : see if mprotect exists
14575 set mprotect d_mprotect
14578 : see if msgctl exists
14579 set msgctl d_msgctl
14582 : see if msgget exists
14583 set msgget d_msgget
14586 : see if msgsnd exists
14587 set msgsnd d_msgsnd
14590 : see if msgrcv exists
14591 set msgrcv d_msgrcv
14594 : see how much of the 'msg*(2)' library is present.
14597 case "$d_msgctl$d_msgget$d_msgsnd$d_msgrcv" in
14598 *"$undef"*) h_msg=false;;
14602 case "`ipcs 2>&1`" in
14603 "SVID messages"*"not configured"*)
14604 echo "Your $osname does not have the msg*(2) configured." >&4
14607 set msgctl d_msgctl
14609 set msgget d_msgget
14611 set msgsnd d_msgsnd
14613 set msgrcv d_msgrcv
14619 : we could also check for sys/ipc.h ...
14620 if $h_msg && $test `./findhdr sys/msg.h`; then
14621 echo "You have the full msg*(2) library." >&4
14624 echo "You don't have the full msg*(2) library." >&4
14632 echo "Checking to see if your system supports struct msghdr..." >&4
14633 set d_msghdr_s msghdr $i_systypes sys/types.h $d_socket sys/socket.h $i_sysuio sys/uio.h
14635 case "$d_msghdr_s" in
14636 "$define") echo "Yes, it does." ;;
14637 *) echo "No, it doesn't." ;;
14641 : see if msync exists
14645 : see if munmap exists
14646 set munmap d_munmap
14649 : see if nice exists
14653 : see if this is a langinfo.h system
14654 set langinfo.h i_langinfo
14657 : see if nl_langinfo exists
14658 set nl_langinfo d_nl_langinfo
14661 : check for length of character
14663 case "$charsize" in
14665 echo "Checking to see how big your characters are (hey, you never know)..." >&4
14668 #$i_stdlib I_STDLIB
14670 #include <stdlib.h>
14674 printf("%d\n", (int)sizeof(char));
14679 if eval $compile_ok; then
14683 echo "(I can't seem to compile the test program. Guessing...)"
14690 rp="What is the size of a character (in bytes)?"
14695 : check for volatile keyword
14697 echo 'Checking to see if your C compiler knows about "volatile"...' >&4
14698 $cat >try.c <<'EOCP'
14701 typedef struct _goo_struct goo_struct;
14702 goo_struct * volatile goo = ((goo_struct *)0);
14703 struct _goo_struct {
14708 typedef unsigned short foo_t;
14709 char *volatile foo;
14711 volatile foo_t blech;
14715 if $cc -c $ccflags try.c >/dev/null 2>&1 ; then
14717 echo "Yup, it does."
14720 echo "Nope, it doesn't."
14728 $echo "Choosing the C types to be used for Perl's internal types..." >&4
14730 case "$use64bitint:$d_quad:$quadtype" in
14733 uvtype="$uquadtype"
14738 uvtype="unsigned long"
14744 case "$uselongdouble:$d_longdbl" in
14746 nvtype="long double"
14747 nvsize=$longdblsize
14754 $echo "(IV will be "$ivtype", $ivsize bytes)"
14755 $echo "(UV will be "$uvtype", $uvsize bytes)"
14756 $echo "(NV will be "$nvtype", $nvsize bytes)"
14759 #$i_inttypes I_INTTYPES
14761 #include <inttypes.h>
14766 int8_t i = INT8_MAX;
14767 uint8_t u = UINT8_MAX;
14768 printf("int8_t\n");
14771 int16_t i = INT16_MAX;
14772 uint16_t i = UINT16_MAX;
14773 printf("int16_t\n");
14776 int32_t i = INT32_MAX;
14777 uint32_t u = UINT32_MAX;
14778 printf("int32_t\n");
14784 '') case "$charsize" in
14786 u8type="unsigned char"
14795 if eval $compile; then
14796 case "`$run ./try`" in
14797 int8_t) i8type=int8_t
14807 '') if $test $charsize -ge 1; then
14809 u8type="unsigned char"
14817 '') case "$shortsize" in
14819 u16type="unsigned short"
14827 '') set try -DINT16
14828 if eval $compile; then
14829 case "`$run ./try`" in
14841 '') if $test $shortsize -ge 2; then
14843 u16type="unsigned short"
14851 '') case "$longsize" in
14853 u32type="unsigned long"
14857 *) case "$intsize" in
14859 u32type="unsigned int"
14869 '') set try -DINT32
14870 if eval $compile; then
14871 case "`$run ./try`" in
14883 '') if $test $intsize -ge 4; then
14885 u32type="unsigned int"
14893 '') case "$d_quad:$quadtype" in
14895 i64type="$quadtype"
14896 u64type="$uquadtype"
14904 $echo "Checking how many bits of your UVs your NVs can preserve..." >&4
14905 : volatile so that the compiler has to store it out to memory.
14906 if test X"$d_volatile" = X"$define"; then
14911 #$i_stdlib I_STDLIB
14913 #include <stdlib.h>
14915 #include <sys/types.h>
14916 #include <signal.h>
14918 $volatile int bletched = 0;
14919 $signal_t blech(s) int s; { bletched = 1; }
14924 int n = 8 * $uvsize;
14927 signal(SIGFPE, blech);
14930 for (i = 0; i < n; i++) {
14931 u = u << 1 | ($uvtype)1;
14933 if (($uvtype)d != u)
14937 d = ($nvtype)(u - 1);
14938 if (($uvtype)d != (u - 1))
14946 printf("%d\n", ((i == n) ? -n : i));
14952 d_nv_preserves_uv="$undef"
14953 if eval $compile; then
14954 nv_preserves_uv_bits="`$run ./try`"
14956 case "$nv_preserves_uv_bits" in
14958 nv_preserves_uv_bits=`expr 0 - $nv_preserves_uv_bits`
14959 $echo "Your NVs can preserve all $nv_preserves_uv_bits bits of your UVs." 2>&1
14960 d_nv_preserves_uv="$define"
14962 [1-9]*) $echo "Your NVs can preserve only $nv_preserves_uv_bits bits of your UVs." 2>&1
14963 d_nv_preserves_uv="$undef" ;;
14964 *) $echo "Can't figure out how many bits your NVs preserve." 2>&1
14965 nv_preserves_uv_bits="$undef" ;;
14970 $echo "Checking whether NV 0.0 is all bits zero in memory..." >&4
14971 : volatile so that the compiler has to store it out to memory.
14972 if test X"$d_volatile" = X"$define"; then
14977 #$i_stdlib I_STDLIB
14979 #include <stdlib.h>
14981 #$i_string I_STRING
14983 # include <string.h>
14985 # include <strings.h>
14987 #include <sys/types.h>
14988 #include <signal.h>
14990 $volatile int bletched = 0;
14991 $signal_t blech(s) int s; { bletched = 1; }
14994 int checkit($nvtype d, char *where) {
14995 unsigned char *p = (char *)&d;
14996 unsigned char *end = p + sizeof(d);
15006 printf("No - %s: 0x", where);
15008 printf ("%02X", *p++);
15013 int main(int argc, char **argv) {
15016 fail += checkit(d, "0.0");
15018 /* The compiler shouldn't be assuming that bletched is 0 */
15021 fail += checkit(d, "bleched");
15024 signal(SIGFPE, blech);
15027 /* Paranoia - the compiler should have no way of knowing that ANSI says
15028 that argv[argc] will always be NULL. Actually, if it did assume this it
15029 would be buggy, as this is C and main() can be called from elsewhere in
15031 d = argv[argc] ? 1 : 0;
15034 printf("Odd argv[argc]=%p, d=%g\n", argv[argc], d);
15037 fail += checkit(d, "ternary");
15039 memset(&d, sizeof(d), argv[argc] ? 1 : 0);
15042 printf("No - memset doesn't give 0.0\n");
15043 /* This might just blow up: */
15044 printf("(gives %g)\n", d);
15050 printf("No - something bleched\n");
15055 printf("No - %d fail(s)\n", fail);
15064 d_nv_zero_is_allbits_zero="$undef"
15065 if eval $compile; then
15071 0.0 is represented as all bits zero in memory
15073 d_nv_zero_is_allbits_zero="$define"
15076 0.0 is not represented as all bits zero in memory
15078 d_nv_zero_is_allbits_zero="$undef"
15083 0.0 is not represented as all bits zero in memory
15085 d_nv_zero_is_allbits_zero="$undef"
15093 : check for off64_t
15095 echo "Checking to see if you have off64_t..." >&4
15097 #include <sys/types.h>
15098 #include <unistd.h>
15099 int main() { off64_t x = 7; }
15102 if eval $compile; then
15104 echo "You have off64_t."
15107 echo "You do not have off64_t."
15108 case "$lseeksize" in
15109 8) echo "(Your off_t is 64 bits, so you could use that.)" ;;
15116 : how to create joinable pthreads
15117 if test "X$usethreads" = "X$define" -a "X$i_pthread" = "X$define"; then
15119 echo "Checking what constant to use for creating joinable pthreads..." >&4
15120 $cat >try.c <<'EOCP'
15121 #include <pthread.h>
15123 int detachstate = JOINABLE;
15126 set try -DJOINABLE=PTHREAD_CREATE_JOINABLE
15127 if eval $compile; then
15128 echo "You seem to use PTHREAD_CREATE_JOINABLE." >&4
15129 val="$undef" # Yes, undef.
15130 set d_old_pthread_create_joinable
15133 set old_pthread_create_joinable
15136 set try -DJOINABLE=PTHREAD_CREATE_UNDETACHED
15137 if eval $compile; then
15138 echo "You seem to use PTHREAD_CREATE_UNDETACHED." >&4
15140 set d_old_pthread_create_joinable
15142 val=PTHREAD_CREATE_UNDETACHED
15143 set old_pthread_create_joinable
15146 set try -DJOINABLE=__UNDETACHED
15147 if eval $compile; then
15148 echo "You seem to use __UNDETACHED." >&4
15150 set d_old_pthread_create_joinable
15153 set old_pthread_create_joinable
15156 echo "Egads, nothing obvious found. Guessing that you use 0." >&4
15158 set d_old_pthread_create_joinable
15161 set old_pthread_create_joinable
15168 d_old_pthread_create_joinable="$undef"
15169 old_pthread_create_joinable=""
15172 : see if pause exists
15176 : see if pipe exists
15180 : see if poll exists
15184 : see if readlink exists
15185 set readlink d_readlink
15191 case "$d_readlink" in
15193 if $issymlink /proc/self/exe ; then
15194 $ls -l /proc/self/exe > reflect
15195 if $contains /`basename $ls` reflect >/dev/null 2>&1; then
15196 echo "You have Linux-like /proc/self/exe."
15197 procselfexe='"/proc/self/exe"'
15201 if $issymlink /proc/curproc/file ; then
15202 $ls -l /proc/curproc/file > reflect
15203 if $contains /`basename $ls` reflect >/dev/null 2>&1; then
15204 echo "You have BSD-like /proc/curproc/file."
15205 procselfexe='"/proc/curproc/file"'
15215 : see whether the pthread_atfork exists
15217 #include <pthread.h>
15220 #ifdef PTHREAD_ATFORK
15221 pthread_atfork(NULL,NULL,NULL);
15226 : see if pthread_atfork exists
15227 set try -DPTHREAD_ATFORK
15228 if eval $compile; then
15233 case "$usethreads" in
15236 $define) echo 'pthread_atfork found.' >&4 ;;
15237 *) echo 'pthread_atfork NOT found.' >&4 ;;
15240 set d_pthread_atfork
15243 : see if pthread_attr_setscope exists
15244 set pthread_attr_setscope d_pthread_attr_setscope
15248 : see whether the various POSIXish _yields exist
15250 #include <pthread.h>
15256 #ifdef PTHREAD_YIELD
15259 #ifdef PTHREAD_YIELD_NULL
15260 pthread_yield(NULL);
15266 : see if sched_yield exists
15267 set try -DSCHED_YIELD
15268 if eval $compile; then
15270 sched_yield='sched_yield()'
15274 case "$usethreads" in
15277 $define) echo 'sched_yield() found.' >&4 ;;
15278 *) echo 'sched_yield() NOT found.' >&4 ;;
15284 : see if pthread_yield exists
15285 set try -DPTHREAD_YIELD
15286 if eval $compile; then
15288 case "$sched_yield" in
15289 '') sched_yield='pthread_yield()' ;;
15292 set try -DPTHREAD_YIELD_NULL
15293 if eval $compile; then
15295 case "$sched_yield" in
15296 '') sched_yield='pthread_yield(NULL)' ;;
15302 case "$usethreads" in
15305 $define) echo 'pthread_yield() found.' >&4 ;;
15306 *) echo 'pthread_yield() NOT found.' >&4 ;;
15310 set d_pthread_yield
15313 case "$sched_yield" in
15314 '') sched_yield=undef ;;
15319 : see if random_r exists
15320 set random_r d_random_r
15322 case "$d_random_r" in
15324 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
15325 case "$d_random_r_proto:$usethreads" in
15326 ":define") d_random_r_proto=define
15327 set d_random_r_proto random_r $hdrs
15331 case "$d_random_r_proto" in
15333 case "$random_r_proto" in
15334 ''|0) try='int random_r(int*, struct random_data*);'
15335 ./protochk "extern $try" $hdrs && random_r_proto=I_iS ;;
15337 case "$random_r_proto" in
15338 ''|0) try='int random_r(long*, struct random_data*);'
15339 ./protochk "extern $try" $hdrs && random_r_proto=I_lS ;;
15341 case "$random_r_proto" in
15342 ''|0) try='int random_r(struct random_data*, int32_t*);'
15343 ./protochk "extern $try" $hdrs && random_r_proto=I_St ;;
15345 case "$random_r_proto" in
15346 ''|0) d_random_r=undef
15348 echo "Disabling random_r, cannot determine prototype." >&4 ;;
15349 * ) case "$random_r_proto" in
15350 REENTRANT_PROTO*) ;;
15351 *) random_r_proto="REENTRANT_PROTO_$random_r_proto" ;;
15353 echo "Prototype: $try" ;;
15356 *) case "$usethreads" in
15357 define) echo "random_r has no prototype, not using it." >&4 ;;
15364 *) random_r_proto=0
15368 : see if readdir and friends exist
15369 set readdir d_readdir
15371 set seekdir d_seekdir
15373 set telldir d_telldir
15375 set rewinddir d_rewinddir
15378 : see if readdir64_r exists
15379 set readdir64_r d_readdir64_r
15381 case "$d_readdir64_r" in
15383 hdrs="$i_systypes sys/types.h define stdio.h $i_dirent dirent.h"
15384 case "$d_readdir64_r_proto:$usethreads" in
15385 ":define") d_readdir64_r_proto=define
15386 set d_readdir64_r_proto readdir64_r $hdrs
15390 case "$d_readdir64_r_proto" in
15392 case "$readdir64_r_proto" in
15393 ''|0) try='int readdir64_r(DIR*, struct dirent64*, struct dirent64**);'
15394 ./protochk "extern $try" $hdrs && readdir64_r_proto=I_TSR ;;
15396 case "$readdir64_r_proto" in
15397 ''|0) try='int readdir64_r(DIR*, struct dirent64*);'
15398 ./protochk "extern $try" $hdrs && readdir64_r_proto=I_TS ;;
15400 case "$readdir64_r_proto" in
15401 ''|0) d_readdir64_r=undef
15402 readdir64_r_proto=0
15403 echo "Disabling readdir64_r, cannot determine prototype." >&4 ;;
15404 * ) case "$readdir64_r_proto" in
15405 REENTRANT_PROTO*) ;;
15406 *) readdir64_r_proto="REENTRANT_PROTO_$readdir64_r_proto" ;;
15408 echo "Prototype: $try" ;;
15411 *) case "$usethreads" in
15412 define) echo "readdir64_r has no prototype, not using it." >&4 ;;
15414 d_readdir64_r=undef
15415 readdir64_r_proto=0
15419 *) readdir64_r_proto=0
15423 : see if readdir_r exists
15424 set readdir_r d_readdir_r
15426 case "$d_readdir_r" in
15428 hdrs="$i_systypes sys/types.h define stdio.h $i_dirent dirent.h"
15429 case "$d_readdir_r_proto:$usethreads" in
15430 ":define") d_readdir_r_proto=define
15431 set d_readdir_r_proto readdir_r $hdrs
15435 case "$d_readdir_r_proto" in
15437 case "$readdir_r_proto" in
15438 ''|0) try='int readdir_r(DIR*, struct dirent*, struct dirent**);'
15439 ./protochk "extern $try" $hdrs && readdir_r_proto=I_TSR ;;
15441 case "$readdir_r_proto" in
15442 ''|0) try='int readdir_r(DIR*, struct dirent*);'
15443 ./protochk "extern $try" $hdrs && readdir_r_proto=I_TS ;;
15445 case "$readdir_r_proto" in
15446 ''|0) d_readdir_r=undef
15448 echo "Disabling readdir_r, cannot determine prototype." >&4 ;;
15449 * ) case "$readdir_r_proto" in
15450 REENTRANT_PROTO*) ;;
15451 *) readdir_r_proto="REENTRANT_PROTO_$readdir_r_proto" ;;
15453 echo "Prototype: $try" ;;
15456 *) case "$usethreads" in
15457 define) echo "readdir_r has no prototype, not using it." >&4 ;;
15464 *) readdir_r_proto=0
15468 : see if readv exists
15472 : see if recvmsg exists
15473 set recvmsg d_recvmsg
15476 : see if rename exists
15477 set rename d_rename
15480 : see if rmdir exists
15484 : see if memory.h is available.
15489 : See if it conflicts with string.h
15495 $cppstdin $cppflags $cppminus < $strings > mem.h
15496 if $contains 'memcpy' mem.h >/dev/null 2>&1; then
15498 echo "We won't be including <memory.h>."
15508 : can bcopy handle overlapping blocks?
15511 case "$d_memmove" in
15512 "$define") echo "I'll use memmove() instead of bcopy() for overlapping copies." ;;
15513 *) case "$d_bcopy" in
15515 echo "Checking to see if bcopy() can do overlapping copies..." >&4
15517 #$i_memory I_MEMORY
15518 #$i_stdlib I_STDLIB
15519 #$i_string I_STRING
15520 #$i_unistd I_UNISTD
15522 $cat >>try.c <<'EOCP'
15525 # include <memory.h>
15528 # include <stdlib.h>
15531 # include <string.h>
15533 # include <strings.h>
15536 # include <unistd.h> /* Needed for NetBSD */
15540 char buf[128], abc[128];
15546 /* Copy "abcde..." string to char abc[] so that gcc doesn't
15547 try to store the string in read-only memory. */
15548 bcopy("abcdefghijklmnopqrstuvwxyz0123456789", abc, 36);
15550 for (align = 7; align >= 0; align--) {
15551 for (len = 36; len; len--) {
15553 bcopy(abc, b, len);
15554 for (off = 1; off <= len; off++) {
15555 bcopy(b, b+off, len);
15556 bcopy(b+off, b, len);
15557 if (bcmp(b, abc, len))
15566 if eval $compile_ok; then
15567 if ./try 2>/dev/null; then
15568 echo "Yes, it can."
15571 echo "It can't, sorry."
15574 echo "(I can't compile the test program, so we'll assume not...)"
15578 $rm -f try.* try core
15584 : can memcpy handle overlapping blocks?
15587 case "$d_memmove" in
15588 "$define") echo "I'll use memmove() instead of memcpy() for overlapping copies." ;;
15589 *) case "$d_memcpy" in
15591 echo "Checking to see if memcpy() can do overlapping copies..." >&4
15593 #$i_memory I_MEMORY
15594 #$i_stdlib I_STDLIB
15595 #$i_string I_STRING
15596 #$i_unistd I_UNISTD
15598 $cat >>try.c <<'EOCP'
15601 # include <memory.h>
15604 # include <stdlib.h>
15607 # include <string.h>
15609 # include <strings.h>
15612 # include <unistd.h> /* Needed for NetBSD */
15616 char buf[128], abc[128];
15622 /* Copy "abcde..." string to char abc[] so that gcc doesn't
15623 try to store the string in read-only memory. */
15624 memcpy(abc, "abcdefghijklmnopqrstuvwxyz0123456789", 36);
15626 for (align = 7; align >= 0; align--) {
15627 for (len = 36; len; len--) {
15629 memcpy(b, abc, len);
15630 for (off = 1; off <= len; off++) {
15631 memcpy(b+off, b, len);
15632 memcpy(b, b+off, len);
15633 if (memcmp(b, abc, len))
15642 if eval $compile_ok; then
15643 if ./try 2>/dev/null; then
15644 echo "Yes, it can."
15647 echo "It can't, sorry."
15650 echo "(I can't compile the test program, so we'll assume not...)"
15654 $rm -f try.* try core
15660 : can memcmp be trusted to compare relative magnitude?
15662 case "$d_memcmp" in
15665 echo "Checking if your memcmp() can compare relative magnitude..." >&4
15667 #$i_memory I_MEMORY
15668 #$i_stdlib I_STDLIB
15669 #$i_string I_STRING
15670 #$i_unistd I_UNISTD
15672 $cat >>try.c <<'EOCP'
15675 # include <memory.h>
15678 # include <stdlib.h>
15681 # include <string.h>
15683 # include <strings.h>
15686 # include <unistd.h> /* Needed for NetBSD */
15692 if ((a < b) && memcmp(&a, &b, 1) < 0)
15698 if eval $compile_ok; then
15699 if $run ./try 2>/dev/null; then
15700 echo "Yes, it can."
15703 echo "No, it can't (it uses signed chars)."
15706 echo "(I can't compile the test program, so we'll assume not...)"
15710 $rm -f try.* try core
15714 : see if prototype for sbrk is available
15716 set d_sbrkproto sbrk $i_unistd unistd.h
15719 : see if select exists
15720 set select d_select
15723 : see if semctl exists
15724 set semctl d_semctl
15727 : see if semget exists
15728 set semget d_semget
15731 : see if semop exists
15735 : see how much of the 'sem*(2)' library is present.
15738 case "$d_semctl$d_semget$d_semop" in
15739 *"$undef"*) h_sem=false;;
15743 case "`ipcs 2>&1`" in
15744 "SVID messages"*"not configured"*)
15745 echo "Your $osname does not have the sem*(2) configured." >&4
15748 set semctl d_semctl
15750 set semget d_semget
15758 : we could also check for sys/ipc.h ...
15759 if $h_sem && $test `./findhdr sys/sem.h`; then
15760 echo "You have the full sem*(2) library." >&4
15763 echo "You don't have the full sem*(2) library." >&4
15769 : see whether sys/sem.h defines union semun
15771 $cat > try.c <<'END'
15772 #include <sys/types.h>
15773 #include <sys/ipc.h>
15774 #include <sys/sem.h>
15775 int main () { union semun semun; semun.buf = 0; }
15778 if eval $compile; then
15779 echo "You have union semun in <sys/sem.h>." >&4
15782 echo "You do not have union semun in <sys/sem.h>." >&4
15789 : see how to do semctl IPC_STAT
15796 # define S_IRUSR S_IREAD
15797 # define S_IWUSR S_IWRITE
15798 # define S_IXUSR S_IEXEC
15800 # define S_IRUSR 0400
15801 # define S_IWUSR 0200
15802 # define S_IXUSR 0100
15804 # define S_IRGRP (S_IRUSR>>3)
15805 # define S_IWGRP (S_IWUSR>>3)
15806 # define S_IXGRP (S_IXUSR>>3)
15807 # define S_IROTH (S_IRUSR>>6)
15808 # define S_IWOTH (S_IWUSR>>6)
15809 # define S_IXOTH (S_IXUSR>>6)
15812 # define S_IRWXU (S_IRUSR|S_IWUSR|S_IXUSR)
15813 # define S_IRWXG (S_IRGRP|S_IWGRP|S_IXGRP)
15814 # define S_IRWXO (S_IROTH|S_IWOTH|S_IXOTH)
15817 : see whether semctl IPC_STAT can use union semun
15818 case "$d_semctl_semun" in
15822 #include <sys/types.h>
15823 #include <sys/ipc.h>
15824 #include <sys/sem.h>
15825 #include <sys/stat.h>
15832 #$d_union_semun HAS_UNION_SEMUN
15835 #ifndef HAS_UNION_SEMUN
15838 struct semid_ds *buf;
15839 unsigned short *array;
15845 #if defined(IPC_PRIVATE) && defined(S_IRWXU) && defined(S_IRWXG) && defined(S_IRWXO) && defined(IPC_CREAT)
15846 sem = semget(IPC_PRIVATE, 1, S_IRWXU|S_IRWXG|S_IRWXO|IPC_CREAT);
15848 struct semid_ds argbuf;
15851 st = semctl(sem, 0, IPC_STAT, arg);
15855 # endif /* IPC_STAT */
15856 printf("semctl IPC_STAT failed: errno = %d\n", errno);
15858 if (semctl(sem, 0, IPC_RMID, arg) != 0)
15859 # endif /* IPC_RMID */
15860 printf("semctl IPC_RMID failed: errno = %d\n", errno);
15862 #endif /* IPC_PRIVATE && ... */
15863 printf("semget failed: errno = %d\n", errno);
15868 if eval $compile; then
15871 semun) val="$define" ;;
15879 case "$d_semctl_semun" in
15881 echo "You can use union semun for semctl IPC_STAT." >&4
15884 *) echo "You cannot use union semun for semctl IPC_STAT." >&4
15889 : see whether semctl IPC_STAT can use struct semid_ds pointer
15890 case "$d_semctl_semid_ds" in
15893 $cat > try.c <<'END'
15894 #include <sys/types.h>
15895 #include <sys/ipc.h>
15896 #include <sys/sem.h>
15897 #include <sys/stat.h>
15905 struct semid_ds arg;
15908 #if defined(IPC_PRIVATE) && defined(S_IRWXU) && defined(S_IRWXG) && defined(S_IRWXO) && defined(IPC_CREAT)
15909 sem = semget(IPC_PRIVATE, 1, S_IRWXU|S_IRWXG|S_IRWXO|IPC_CREAT);
15912 st = semctl(sem, 0, IPC_STAT, &arg);
15914 printf("semid_ds\n");
15916 # endif /* IPC_STAT */
15917 printf("semctl IPC_STAT failed: errno = %d\n", errno);
15919 if (semctl(sem, 0, IPC_RMID, &arg) != 0)
15920 # endif /* IPC_RMID */
15921 printf("semctl IPC_RMID failed: errno = %d\n", errno);
15923 #endif /* IPC_PRIVATE && ... */
15924 printf("semget failed: errno = %d\n", errno);
15930 if eval $compile; then
15933 semid_ds) val="$define" ;;
15937 set d_semctl_semid_ds
15941 case "$d_semctl_semid_ds" in
15943 echo "You can $also use struct semid_ds* for semctl IPC_STAT." >&4
15945 *) echo "You cannot use struct semid_ds* for semctl IPC_STAT." >&4
15952 # We do not have the full sem*(2) library, so assume we can not
15958 set d_semctl_semid_ds
15963 : see if sendmsg exists
15964 set sendmsg d_sendmsg
15967 : see if setegid exists
15968 set setegid d_setegid
15971 : see if seteuid exists
15972 set seteuid d_seteuid
15975 : see if setgrent exists
15976 set setgrent d_setgrent
15979 : see if setgrent_r exists
15980 set setgrent_r d_setgrent_r
15982 case "$d_setgrent_r" in
15984 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
15985 case "$d_setgrent_r_proto:$usethreads" in
15986 ":define") d_setgrent_r_proto=define
15987 set d_setgrent_r_proto setgrent_r $hdrs
15991 case "$d_setgrent_r_proto" in
15993 case "$setgrent_r_proto" in
15994 ''|0) try='int setgrent_r(FILE**);'
15995 ./protochk "extern $try" $hdrs && setgrent_r_proto=I_H ;;
15997 case "$setgrent_r_proto" in
15998 ''|0) try='void setgrent_r(FILE**);'
15999 ./protochk "extern $try" $hdrs && setgrent_r_proto=V_H ;;
16001 case "$setgrent_r_proto" in
16002 ''|0) d_setgrent_r=undef
16004 echo "Disabling setgrent_r, cannot determine prototype." >&4 ;;
16005 * ) case "$setgrent_r_proto" in
16006 REENTRANT_PROTO*) ;;
16007 *) setgrent_r_proto="REENTRANT_PROTO_$setgrent_r_proto" ;;
16009 echo "Prototype: $try" ;;
16012 *) case "$usethreads" in
16013 define) echo "setgrent_r has no prototype, not using it." >&4 ;;
16020 *) setgrent_r_proto=0
16024 : see if sethostent exists
16025 set sethostent d_sethent
16028 : see if sethostent_r exists
16029 set sethostent_r d_sethostent_r
16031 case "$d_sethostent_r" in
16033 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
16034 case "$d_sethostent_r_proto:$usethreads" in
16035 ":define") d_sethostent_r_proto=define
16036 set d_sethostent_r_proto sethostent_r $hdrs
16040 case "$d_sethostent_r_proto" in
16042 case "$sethostent_r_proto" in
16043 ''|0) try='int sethostent_r(int, struct hostent_data*);'
16044 ./protochk "extern $try" $hdrs && sethostent_r_proto=I_ID ;;
16046 case "$sethostent_r_proto" in
16047 ''|0) try='void sethostent_r(int, struct hostent_data*);'
16048 ./protochk "extern $try" $hdrs && sethostent_r_proto=V_ID ;;
16050 case "$sethostent_r_proto" in
16051 ''|0) d_sethostent_r=undef
16052 sethostent_r_proto=0
16053 echo "Disabling sethostent_r, cannot determine prototype." >&4 ;;
16054 * ) case "$sethostent_r_proto" in
16055 REENTRANT_PROTO*) ;;
16056 *) sethostent_r_proto="REENTRANT_PROTO_$sethostent_r_proto" ;;
16058 echo "Prototype: $try" ;;
16061 *) case "$usethreads" in
16062 define) echo "sethostent_r has no prototype, not using it." >&4 ;;
16064 d_sethostent_r=undef
16065 sethostent_r_proto=0
16069 *) sethostent_r_proto=0
16073 : see if setitimer exists
16074 set setitimer d_setitimer
16077 : see if setlinebuf exists
16078 set setlinebuf d_setlinebuf
16081 : see if setlocale exists
16082 set setlocale d_setlocale
16085 : see if locale.h is available
16086 set locale.h i_locale
16089 : see if setlocale_r exists
16090 set setlocale_r d_setlocale_r
16092 case "$d_setlocale_r" in
16094 hdrs="$i_systypes sys/types.h define stdio.h $i_locale locale.h"
16095 case "$d_setlocale_r_proto:$usethreads" in
16096 ":define") d_setlocale_r_proto=define
16097 set d_setlocale_r_proto setlocale_r $hdrs
16101 case "$d_setlocale_r_proto" in
16103 case "$setlocale_r_proto" in
16104 ''|0) try='int setlocale_r(int, const char*, char*, int);'
16105 ./protochk "extern $try" $hdrs && setlocale_r_proto=I_ICBI ;;
16107 case "$setlocale_r_proto" in
16108 ''|0) d_setlocale_r=undef
16109 setlocale_r_proto=0
16110 echo "Disabling setlocale_r, cannot determine prototype." >&4 ;;
16111 * ) case "$setlocale_r_proto" in
16112 REENTRANT_PROTO*) ;;
16113 *) setlocale_r_proto="REENTRANT_PROTO_$setlocale_r_proto" ;;
16115 echo "Prototype: $try" ;;
16118 *) case "$usethreads" in
16119 define) echo "setlocale_r has no prototype, not using it." >&4 ;;
16121 d_setlocale_r=undef
16122 setlocale_r_proto=0
16126 *) setlocale_r_proto=0
16130 : see if setnetent exists
16131 set setnetent d_setnent
16134 : see if setnetent_r exists
16135 set setnetent_r d_setnetent_r
16137 case "$d_setnetent_r" in
16139 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
16140 case "$d_setnetent_r_proto:$usethreads" in
16141 ":define") d_setnetent_r_proto=define
16142 set d_setnetent_r_proto setnetent_r $hdrs
16146 case "$d_setnetent_r_proto" in
16148 case "$setnetent_r_proto" in
16149 ''|0) try='int setnetent_r(int, struct netent_data*);'
16150 ./protochk "extern $try" $hdrs && setnetent_r_proto=I_ID ;;
16152 case "$setnetent_r_proto" in
16153 ''|0) try='void setnetent_r(int, struct netent_data*);'
16154 ./protochk "extern $try" $hdrs && setnetent_r_proto=V_ID ;;
16156 case "$setnetent_r_proto" in
16157 ''|0) d_setnetent_r=undef
16158 setnetent_r_proto=0
16159 echo "Disabling setnetent_r, cannot determine prototype." >&4 ;;
16160 * ) case "$setnetent_r_proto" in
16161 REENTRANT_PROTO*) ;;
16162 *) setnetent_r_proto="REENTRANT_PROTO_$setnetent_r_proto" ;;
16164 echo "Prototype: $try" ;;
16167 *) case "$usethreads" in
16168 define) echo "setnetent_r has no prototype, not using it." >&4 ;;
16170 d_setnetent_r=undef
16171 setnetent_r_proto=0
16175 *) setnetent_r_proto=0
16179 : see if setprotoent exists
16180 set setprotoent d_setpent
16183 : see if setpgid exists
16184 set setpgid d_setpgid
16187 : see if setpgrp2 exists
16188 set setpgrp2 d_setpgrp2
16191 : see if setpriority exists
16192 set setpriority d_setprior
16195 : see if setproctitle exists
16196 set setproctitle d_setproctitle
16199 : see if setprotoent_r exists
16200 set setprotoent_r d_setprotoent_r
16202 case "$d_setprotoent_r" in
16204 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
16205 case "$d_setprotoent_r_proto:$usethreads" in
16206 ":define") d_setprotoent_r_proto=define
16207 set d_setprotoent_r_proto setprotoent_r $hdrs
16211 case "$d_setprotoent_r_proto" in
16213 case "$setprotoent_r_proto" in
16214 ''|0) try='int setprotoent_r(int, struct protoent_data*);'
16215 ./protochk "extern $try" $hdrs && setprotoent_r_proto=I_ID ;;
16217 case "$setprotoent_r_proto" in
16218 ''|0) try='void setprotoent_r(int, struct protoent_data*);'
16219 ./protochk "extern $try" $hdrs && setprotoent_r_proto=V_ID ;;
16221 case "$setprotoent_r_proto" in
16222 ''|0) d_setprotoent_r=undef
16223 setprotoent_r_proto=0
16224 echo "Disabling setprotoent_r, cannot determine prototype." >&4 ;;
16225 * ) case "$setprotoent_r_proto" in
16226 REENTRANT_PROTO*) ;;
16227 *) setprotoent_r_proto="REENTRANT_PROTO_$setprotoent_r_proto" ;;
16229 echo "Prototype: $try" ;;
16232 *) case "$usethreads" in
16233 define) echo "setprotoent_r has no prototype, not using it." >&4 ;;
16235 d_setprotoent_r=undef
16236 setprotoent_r_proto=0
16240 *) setprotoent_r_proto=0
16244 : see if setpwent exists
16245 set setpwent d_setpwent
16248 : see if setpwent_r exists
16249 set setpwent_r d_setpwent_r
16251 case "$d_setpwent_r" in
16253 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
16254 case "$d_setpwent_r_proto:$usethreads" in
16255 ":define") d_setpwent_r_proto=define
16256 set d_setpwent_r_proto setpwent_r $hdrs
16260 case "$d_setpwent_r_proto" in
16262 case "$setpwent_r_proto" in
16263 ''|0) try='int setpwent_r(FILE**);'
16264 ./protochk "extern $try" $hdrs && setpwent_r_proto=I_H ;;
16266 case "$setpwent_r_proto" in
16267 ''|0) try='void setpwent_r(FILE**);'
16268 ./protochk "extern $try" $hdrs && setpwent_r_proto=V_H ;;
16270 case "$setpwent_r_proto" in
16271 ''|0) d_setpwent_r=undef
16273 echo "Disabling setpwent_r, cannot determine prototype." >&4 ;;
16274 * ) case "$setpwent_r_proto" in
16275 REENTRANT_PROTO*) ;;
16276 *) setpwent_r_proto="REENTRANT_PROTO_$setpwent_r_proto" ;;
16278 echo "Prototype: $try" ;;
16281 *) case "$usethreads" in
16282 define) echo "setpwent_r has no prototype, not using it." >&4 ;;
16289 *) setpwent_r_proto=0
16293 : see if setregid exists
16294 set setregid d_setregid
16296 set setresgid d_setresgid
16299 : see if setreuid exists
16300 set setreuid d_setreuid
16302 set setresuid d_setresuid
16305 : see if setrgid exists
16306 set setrgid d_setrgid
16309 : see if setruid exists
16310 set setruid d_setruid
16313 : see if setservent exists
16314 set setservent d_setsent
16317 : see if setservent_r exists
16318 set setservent_r d_setservent_r
16320 case "$d_setservent_r" in
16322 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
16323 case "$d_setservent_r_proto:$usethreads" in
16324 ":define") d_setservent_r_proto=define
16325 set d_setservent_r_proto setservent_r $hdrs
16329 case "$d_setservent_r_proto" in
16331 case "$setservent_r_proto" in
16332 ''|0) try='int setservent_r(int, struct servent_data*);'
16333 ./protochk "extern $try" $hdrs && setservent_r_proto=I_ID ;;
16335 case "$setservent_r_proto" in
16336 ''|0) try='void setservent_r(int, struct servent_data*);'
16337 ./protochk "extern $try" $hdrs && setservent_r_proto=V_ID ;;
16339 case "$setservent_r_proto" in
16340 ''|0) d_setservent_r=undef
16341 setservent_r_proto=0
16342 echo "Disabling setservent_r, cannot determine prototype." >&4 ;;
16343 * ) case "$setservent_r_proto" in
16344 REENTRANT_PROTO*) ;;
16345 *) setservent_r_proto="REENTRANT_PROTO_$setservent_r_proto" ;;
16347 echo "Prototype: $try" ;;
16350 *) case "$usethreads" in
16351 define) echo "setservent_r has no prototype, not using it." >&4 ;;
16353 d_setservent_r=undef
16354 setservent_r_proto=0
16358 *) setservent_r_proto=0
16362 : see if setsid exists
16363 set setsid d_setsid
16366 : see if setvbuf exists
16367 set setvbuf d_setvbuf
16370 : see if sfio.h is available
16375 : see if sfio library is available
16386 : Ok, but do we want to use it.
16390 true|$define|[yY]*) dflt='y';;
16393 echo "$package can use the sfio library, but it is experimental."
16394 case "$useperlio" in
16396 echo "For sfio also the PerlIO abstraction layer is needed."
16397 echo "Earlier you said you wouldn't want that."
16400 rp="You seem to have sfio available, do you want to try using it?"
16403 y|Y) echo "Ok, turning on both sfio and PerlIO, then."
16404 useperlio="$define"
16407 *) echo "Ok, avoiding sfio this time. I'll use stdio instead."
16412 *) case "$usesfio" in
16413 true|$define|[yY]*)
16414 echo "Sorry, cannot find sfio on this machine." >&4
16415 echo "Ignoring your setting of usesfio=$usesfio." >&4
16424 $define) usesfio='true';;
16425 *) usesfio='false';;
16429 *) : Remove sfio from list of libraries to use
16432 echo "Removing unneeded -lsfio from library list" >&4
16433 set `echo X $libs | $sed -e 's/-lsfio / /' -e 's/-lsfio$//'`
16436 echo "libs = $libs" >&4
16443 : see if shmctl exists
16444 set shmctl d_shmctl
16447 : see if shmget exists
16448 set shmget d_shmget
16451 : see if shmat exists
16454 : see what shmat returns
16457 $cat >shmat.c <<'END'
16458 #include <sys/shm.h>
16461 if $cc $ccflags -c shmat.c >/dev/null 2>&1; then
16466 echo "and it returns ($shmattype)." >&4
16467 : see if a prototype for shmat is available
16468 xxx=`./findhdr sys/shm.h`
16469 $cppstdin $cppflags $cppminus < $xxx > shmat.c 2>/dev/null
16470 if $contains 'shmat.*(' shmat.c >/dev/null 2>&1; then
16481 set d_shmatprototype
16484 : see if shmdt exists
16488 : see how much of the 'shm*(2)' library is present.
16491 case "$d_shmctl$d_shmget$d_shmat$d_shmdt" in
16492 *"$undef"*) h_shm=false;;
16496 case "`ipcs 2>&1`" in
16497 "SVID shared memory"*"not configured"*)
16498 echo "Your $osname does not have the shm*(2) configured." >&4
16501 set shmctl d_shmctl
16503 set shmget d_shmget
16513 : we could also check for sys/ipc.h ...
16514 if $h_shm && $test `./findhdr sys/shm.h`; then
16515 echo "You have the full shm*(2) library." >&4
16518 echo "You don't have the full shm*(2) library." >&4
16525 : see if we have sigaction
16526 if set sigaction val -f d_sigaction; eval $csym; $val; then
16527 echo 'sigaction() found.' >&4
16530 #include <sys/types.h>
16531 #include <signal.h>
16532 #$i_stdlib I_STDLIB
16534 #include <stdlib.h>
16538 struct sigaction act, oact;
16540 oact.sa_handler = 0;
16541 /* so that act and oact are used */
16542 exit(act.sa_flags == 0 && oact.sa_handler == 0);
16546 if eval $compile_ok; then
16549 echo "But you don't seem to have a useable struct sigaction." >&4
16553 echo 'sigaction NOT found.' >&4
16556 set d_sigaction; eval $setvar
16557 $rm -f try try$_o try.c
16559 : see if sigprocmask exists
16560 set sigprocmask d_sigprocmask
16563 : see if sigsetjmp exists
16565 case "$d_sigsetjmp" in
16568 #include <setjmp.h>
16569 #$i_stdlib I_STDLIB
16571 #include <stdlib.h>
16577 if (sigsetjmp(env,1))
16580 siglongjmp(env, 1);
16585 if eval $compile; then
16586 if $run ./try >/dev/null 2>&1; then
16587 echo "POSIX sigsetjmp found." >&4
16591 Uh-Oh! You have POSIX sigsetjmp and siglongjmp, but they do not work properly!!
16597 echo "sigsetjmp not found." >&4
16601 *) val="$d_sigsetjmp"
16602 case "$d_sigsetjmp" in
16603 $define) echo "POSIX sigsetjmp found." >&4;;
16604 $undef) echo "sigsetjmp not found." >&4;;
16612 : see if snprintf exists
16613 set snprintf d_snprintf
16616 : see if vsnprintf exists
16617 set vsnprintf d_vsnprintf
16620 case "$d_snprintf-$d_vsnprintf" in
16623 Checking whether your snprintf() and vsnprintf() work okay...
16625 $cat >try.c <<'EOCP'
16626 /* v?snprintf testing logic courtesy of Russ Allbery.
16627 * According to C99:
16628 * - if the buffer is too short it still must be \0-terminated
16629 * - if the buffer is too short the potentially required length
16630 * must be returned and not -1
16631 * - if the buffer is NULL the potentially required length
16632 * must be returned and not -1 or core dump
16635 #include <stdarg.h>
16639 int test (char *format, ...)
16644 va_start (args, format);
16645 count = vsnprintf (buf, sizeof buf, format, args);
16652 return ((test ("%s", "abcd") == 4 && buf[0] == 'a' && buf[1] == '\0'
16653 && snprintf (NULL, 0, "%s", "abcd") == 4) ? 0 : 1);
16657 if eval $compile; then
16660 0) echo "Your snprintf() and vsnprintf() seem to be working okay." ;;
16662 Your snprintf() and snprintf() don't seem to be working okay.
16664 d_snprintf="$undef"
16665 d_vsnprintf="$undef"
16669 echo "(I can't seem to compile the test program--assuming they don't)"
16670 d_snprintf="$undef"
16671 d_vsnprintf="$undef"
16673 $rm -f try.* try core core.try.*
16677 : see if sockatmark exists
16678 set sockatmark d_sockatmark
16681 : see if prototype for sockatmark is available
16683 set d_sockatmarkproto sockatmark $d_socket sys/socket.h
16686 : see if socks5_init exists
16687 set socks5_init d_socks5_init
16690 : see if sprintf returns the length of the string in the buffer as per ANSI
16691 $echo "Checking whether sprintf returns the length of the string..." >&4
16694 #$i_stdlib I_STDLIB
16696 #include <stdlib.h>
16698 #$i_string I_STRING
16700 # include <string.h>
16702 # include <strings.h>
16711 int check (size_t expect, int test) {
16712 size_t got = strlen(buffer);
16716 printf("expected %ld, got %ld in test %d '%s'\n", (long) expect, (long) got,
16721 int main(int argc, char **argv) {
16724 check(sprintf(buffer, ""), ++test);
16725 check(sprintf(buffer, "%s %s", "perl", "rules"), ++test);
16726 check(sprintf(buffer, "I like %g", atan2(0,-1)), ++test);
16733 d_sprintf_returns_strlen="$undef"
16734 if eval $compile; then
16738 sprintf returns the length of the string (as ANSI says it should)
16740 d_sprintf_returns_strlen="$define"
16743 sprintf does not return the length of the string (how old is this system?)
16745 d_sprintf_returns_strlen="$undef"
16752 : see if srand48_r exists
16753 set srand48_r d_srand48_r
16755 case "$d_srand48_r" in
16757 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
16758 case "$d_srand48_r_proto:$usethreads" in
16759 ":define") d_srand48_r_proto=define
16760 set d_srand48_r_proto srand48_r $hdrs
16764 case "$d_srand48_r_proto" in
16766 case "$srand48_r_proto" in
16767 ''|0) try='int srand48_r(long, struct drand48_data*);'
16768 ./protochk "extern $try" $hdrs && srand48_r_proto=I_LS ;;
16770 case "$srand48_r_proto" in
16771 ''|0) d_srand48_r=undef
16773 echo "Disabling srand48_r, cannot determine prototype." >&4 ;;
16774 * ) case "$srand48_r_proto" in
16775 REENTRANT_PROTO*) ;;
16776 *) srand48_r_proto="REENTRANT_PROTO_$srand48_r_proto" ;;
16778 echo "Prototype: $try" ;;
16781 *) case "$usethreads" in
16782 define) echo "srand48_r has no prototype, not using it." >&4 ;;
16789 *) srand48_r_proto=0
16793 : see if srandom_r exists
16794 set srandom_r d_srandom_r
16796 case "$d_srandom_r" in
16798 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
16799 case "$d_srandom_r_proto:$usethreads" in
16800 ":define") d_srandom_r_proto=define
16801 set d_srandom_r_proto srandom_r $hdrs
16805 case "$d_srandom_r_proto" in
16807 case "$srandom_r_proto" in
16808 ''|0) try='int srandom_r(unsigned int, struct random_data*);'
16809 ./protochk "extern $try" $hdrs && srandom_r_proto=I_TS ;;
16811 case "$srandom_r_proto" in
16812 ''|0) d_srandom_r=undef
16814 echo "Disabling srandom_r, cannot determine prototype." >&4 ;;
16815 * ) case "$srandom_r_proto" in
16816 REENTRANT_PROTO*) ;;
16817 *) srandom_r_proto="REENTRANT_PROTO_$srandom_r_proto" ;;
16819 echo "Prototype: $try" ;;
16822 *) case "$usethreads" in
16823 define) echo "srandom_r has no prototype, not using it." >&4 ;;
16830 *) srandom_r_proto=0
16834 : see if prototype for setresgid is available
16836 set d_sresgproto setresgid $i_unistd unistd.h
16839 : see if prototype for setresuid is available
16841 set d_sresuproto setresuid $i_unistd unistd.h
16844 : see if sys/stat.h is available
16845 set sys/stat.h i_sysstat
16849 : see if stat knows about block sizes
16851 echo "Checking to see if your struct stat has st_blocks field..." >&4
16852 set d_statblks stat st_blocks $i_sysstat sys/stat.h
16856 : see if this is a sys/vfs.h system
16857 set sys/vfs.h i_sysvfs
16861 : see if this is a sys/statfs.h system
16862 set sys/statfs.h i_sysstatfs
16867 echo "Checking to see if your system supports struct statfs..." >&4
16868 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
16870 case "$d_statfs_s" in
16871 "$define") echo "Yes, it does." ;;
16872 *) echo "No, it doesn't." ;;
16877 : see if struct statfs knows about f_flags
16878 case "$d_statfs_s" in
16881 echo "Checking to see if your struct statfs has f_flags field..." >&4
16882 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
16886 set d_statfs_f_flags
16890 case "$d_statfs_f_flags" in
16891 "$define") echo "Yes, it does." ;;
16892 *) echo "No, it doesn't." ;;
16896 Checking how to access stdio streams by file descriptor number...
16898 case "$stdio_stream_array" in
16899 '') $cat >try.c <<EOCP
16902 if (&STDIO_STREAM_ARRAY[fileno(stdin)] == stdin)
16906 for s in _iob __iob __sF
16908 set try -DSTDIO_STREAM_ARRAY=$s
16909 if eval $compile; then
16910 case "`$run ./try`" in
16911 yes) stdio_stream_array=$s; break ;;
16915 $rm -f try.* try$exe_ext
16917 case "$stdio_stream_array" in
16919 I can't figure out how to access stdio streams by file descriptor number.
16921 d_stdio_stream_array="$undef"
16924 You can access stdio streams by file descriptor number by the $stdio_stream_array array.
16926 d_stdio_stream_array="$define"
16930 : see if strcoll exists
16931 set strcoll d_strcoll
16934 : check for structure copying
16936 echo "Checking to see if your C compiler can copy structs..." >&4
16937 $cat >try.c <<'EOCP'
16947 if $cc -c try.c >/dev/null 2>&1 ; then
16949 echo "Yup, it can."
16952 echo "Nope, it can't."
16958 : see if strerror and/or sys_errlist[] exist
16960 if test "X$d_strerror" = X -o "X$d_syserrlst" = X; then
16961 if set strerror val -f d_strerror; eval $csym; $val; then
16962 echo 'strerror() found.' >&4
16963 d_strerror="$define"
16964 d_strerrm='strerror(e)'
16965 if set sys_errlist val -a d_syserrlst; eval $csym; $val; then
16966 echo "(You also have sys_errlist[], so we could roll our own strerror.)"
16967 d_syserrlst="$define"
16969 echo "(Since you don't have sys_errlist[], sterror() is welcome.)"
16970 d_syserrlst="$undef"
16972 elif xxx=`./findhdr string.h`; test "$xxx" || xxx=`./findhdr strings.h`; \
16973 $contains '#[ ]*define.*strerror' "$xxx" >/dev/null 2>&1; then
16974 echo 'strerror() found in string header.' >&4
16975 d_strerror="$define"
16976 d_strerrm='strerror(e)'
16977 if set sys_errlist val -a d_syserrlst; eval $csym; $val; then
16978 echo "(Most probably, strerror() uses sys_errlist[] for descriptions.)"
16979 d_syserrlst="$define"
16981 echo "(You don't appear to have any sys_errlist[], how can this be?)"
16982 d_syserrlst="$undef"
16984 elif set sys_errlist val -a d_syserrlst; eval $csym; $val; then
16985 echo "strerror() not found, but you have sys_errlist[] so we'll use that." >&4
16986 d_strerror="$undef"
16987 d_syserrlst="$define"
16988 d_strerrm='((e)<0||(e)>=sys_nerr?"unknown":sys_errlist[e])'
16990 echo 'strerror() and sys_errlist[] NOT found.' >&4
16991 d_strerror="$undef"
16992 d_syserrlst="$undef"
16993 d_strerrm='"unknown"'
16997 : see if strerror_r exists
16998 set strerror_r d_strerror_r
17000 case "$d_strerror_r" in
17002 hdrs="$i_systypes sys/types.h define stdio.h $i_string string.h"
17003 case "$d_strerror_r_proto:$usethreads" in
17004 ":define") d_strerror_r_proto=define
17005 set d_strerror_r_proto strerror_r $hdrs
17009 case "$d_strerror_r_proto" in
17011 case "$strerror_r_proto" in
17012 ''|0) try='int strerror_r(int, char*, size_t);'
17013 ./protochk "extern $try" $hdrs && strerror_r_proto=I_IBW ;;
17015 case "$strerror_r_proto" in
17016 ''|0) try='int strerror_r(int, char*, int);'
17017 ./protochk "extern $try" $hdrs && strerror_r_proto=I_IBI ;;
17019 case "$strerror_r_proto" in
17020 ''|0) try='char* strerror_r(int, char*, size_t);'
17021 ./protochk "extern $try" $hdrs && strerror_r_proto=B_IBW ;;
17023 case "$strerror_r_proto" in
17024 ''|0) d_strerror_r=undef
17026 echo "Disabling strerror_r, cannot determine prototype." >&4 ;;
17027 * ) case "$strerror_r_proto" in
17028 REENTRANT_PROTO*) ;;
17029 *) strerror_r_proto="REENTRANT_PROTO_$strerror_r_proto" ;;
17031 echo "Prototype: $try" ;;
17034 *) case "$usethreads" in
17035 define) echo "strerror_r has no prototype, not using it." >&4 ;;
17042 *) strerror_r_proto=0
17046 : see if strftime exists
17047 set strftime d_strftime
17050 : see if strlcat exists
17051 set strlcat d_strlcat
17054 : see if strlcpy exists
17055 set strlcpy d_strlcpy
17058 : see if strtod exists
17059 set strtod d_strtod
17062 : see if strtol exists
17063 set strtol d_strtol
17066 : see if strtold exists
17067 set strtold d_strtold
17070 : see if strtoll exists
17071 set strtoll d_strtoll
17074 case "$d_longlong-$d_strtoll" in
17077 Checking whether your strtoll() works okay...
17079 $cat >try.c <<'EOCP'
17082 #define strtoll __strtoll
17085 #define strtoll _strtoll
17088 extern long long int strtoll(char *s, char **, int);
17089 static int bad = 0;
17090 int check(char *s, long long ell, int een) {
17093 gll = strtoll(s, 0, 10);
17094 if (!((gll == ell) && (errno == een)))
17098 check(" 1", 1LL, 0);
17099 check(" 0", 0LL, 0);
17100 check("-1", -1LL, 0);
17101 check("-9223372036854775808", -9223372036854775808LL, 0);
17102 check("-9223372036854775808", -9223372036854775808LL, 0);
17103 check(" 9223372036854775807", 9223372036854775807LL, 0);
17104 check("-9223372036854775808", -9223372036854775808LL, 0);
17105 check(" 9223372036854775808", 9223372036854775807LL, ERANGE);
17106 check("-9223372036854775809", -9223372036854775808LL, ERANGE);
17112 if eval $compile; then
17115 ok) echo "Your strtoll() seems to be working okay." ;;
17117 Your strtoll() doesn't seem to be working okay.
17123 echo "(I can't seem to compile the test program--assuming it doesn't)"
17129 : see if strtoq exists
17130 set strtoq d_strtoq
17133 : see if strtoul exists
17134 set strtoul d_strtoul
17137 case "$d_strtoul" in
17140 Checking whether your strtoul() works okay...
17142 $cat >try.c <<'EOCP'
17145 extern unsigned long int strtoul(char *s, char **, int);
17146 static int bad = 0;
17147 void check(char *s, unsigned long eul, int een) {
17150 gul = strtoul(s, 0, 10);
17151 if (!((gul == eul) && (errno == een)))
17155 check(" 1", 1L, 0);
17156 check(" 0", 0L, 0);
17158 case "$longsize" in
17160 $cat >>try.c <<'EOCP'
17161 check("18446744073709551615", 18446744073709551615UL, 0);
17162 check("18446744073709551616", 18446744073709551615UL, ERANGE);
17163 #if 0 /* strtoul() for /^-/ strings is undefined. */
17164 check("-1", 18446744073709551615UL, 0);
17165 check("-18446744073709551614", 2, 0);
17166 check("-18446744073709551615", 1, 0);
17167 check("-18446744073709551616", 18446744073709551615UL, ERANGE);
17168 check("-18446744073709551617", 18446744073709551615UL, ERANGE);
17173 $cat >>try.c <<'EOCP'
17174 check("4294967295", 4294967295UL, 0);
17175 check("4294967296", 4294967295UL, ERANGE);
17176 #if 0 /* strtoul() for /^-/ strings is undefined. */
17177 check("-1", 4294967295UL, 0);
17178 check("-4294967294", 2, 0);
17179 check("-4294967295", 1, 0);
17180 check("-4294967296", 4294967295UL, ERANGE);
17181 check("-4294967297", 4294967295UL, ERANGE);
17186 : Should we write these tests to be more portable by sprintf-ing
17187 : ~0 and then manipulating that char string as input for strtol?
17190 $cat >>try.c <<'EOCP'
17197 if eval $compile; then
17198 case "`$run ./try`" in
17199 ok) echo "Your strtoul() seems to be working okay." ;;
17201 Your strtoul() doesn't seem to be working okay.
17210 : see if strtoull exists
17211 set strtoull d_strtoull
17214 case "$d_longlong-$d_strtoull" in
17217 Checking whether your strtoull() works okay...
17219 $cat >try.c <<'EOCP'
17222 #define strtoull __strtoull
17225 extern unsigned long long int strtoull(char *s, char **, int);
17226 static int bad = 0;
17227 int check(char *s, long long eull, int een) {
17230 gull = strtoull(s, 0, 10);
17231 if (!((gull == eull) && (errno == een)))
17235 check(" 1", 1LL, 0);
17236 check(" 0", 0LL, 0);
17237 check("18446744073709551615", 18446744073709551615ULL, 0);
17238 check("18446744073709551616", 18446744073709551615ULL, ERANGE);
17239 #if 0 /* strtoull() for /^-/ strings is undefined. */
17240 check("-1", 18446744073709551615ULL, 0);
17241 check("-18446744073709551614", 2LL, 0);
17242 check("-18446744073709551615", 1LL, 0);
17243 check("-18446744073709551616", 18446744073709551615ULL, ERANGE);
17244 check("-18446744073709551617", 18446744073709551615ULL, ERANGE);
17251 if eval $compile; then
17252 case "`$run ./try`" in
17253 ok) echo "Your strtoull() seems to be working okay." ;;
17255 Your strtoull() doesn't seem to be working okay.
17257 d_strtoull="$undef"
17264 : see if strtouq exists
17265 set strtouq d_strtouq
17268 case "$d_strtouq" in
17271 Checking whether your strtouq() works okay...
17273 $cat >try.c <<'EOCP'
17276 extern unsigned long long int strtouq(char *s, char **, int);
17277 static int bad = 0;
17278 void check(char *s, unsigned long long eull, int een) {
17279 unsigned long long gull;
17281 gull = strtouq(s, 0, 10);
17282 if (!((gull == eull) && (errno == een)))
17286 check(" 1", 1LL, 0);
17287 check(" 0", 0LL, 0);
17288 check("18446744073709551615", 18446744073709551615ULL, 0);
17289 check("18446744073709551616", 18446744073709551615ULL, ERANGE);
17290 #if 0 /* strtouq() for /^-/ strings is undefined. */
17291 check("-1", 18446744073709551615ULL, 0);
17292 check("-18446744073709551614", 2LL, 0);
17293 check("-18446744073709551615", 1LL, 0);
17294 check("-18446744073709551616", 18446744073709551615ULL, ERANGE);
17295 check("-18446744073709551617", 18446744073709551615ULL, ERANGE);
17303 if eval $compile; then
17304 case "`$run ./try`" in
17305 ok) echo "Your strtouq() seems to be working okay." ;;
17307 Your strtouq() doesn't seem to be working okay.
17316 : see if strxfrm exists
17317 set strxfrm d_strxfrm
17320 : see if symlink exists
17321 set symlink d_symlink
17324 : see if syscall exists
17325 set syscall d_syscall
17328 : see if prototype for syscall is available
17330 set d_syscallproto syscall $i_unistd unistd.h
17333 : see if sysconf exists
17334 set sysconf d_sysconf
17337 : see if system exists
17338 set system d_system
17341 : see if tcgetpgrp exists
17342 set tcgetpgrp d_tcgetpgrp
17345 : see if tcsetpgrp exists
17346 set tcsetpgrp d_tcsetpgrp
17349 : see if prototype for telldir is available
17351 set d_telldirproto telldir $i_systypes sys/types.h $i_dirent dirent.h
17354 : see if time exists
17356 if test "X$d_time" = X -o X"$timetype" = X; then
17357 if set time val -f d_time; eval $csym; $val; then
17358 echo 'time() found.' >&4
17360 rp="What is the type returned by time() on this system?"
17361 set time_t timetype long stdio.h sys/types.h
17364 echo 'time() not found, hope that will do.' >&4
17372 : see if this is a sys/times.h system
17373 set sys/times.h i_systimes
17376 : see if times exists
17378 if set times val -f d_times; eval $csym; $val; then
17379 echo 'times() found.' >&4
17382 case "$i_systimes" in
17383 "$define") inc='sys/times.h';;
17385 rp="What is the type returned by times() on this system?"
17386 set clock_t clocktype long stdio.h sys/types.h $inc
17389 echo 'times() NOT found, hope that will do.' >&4
17394 : see if tmpnam_r exists
17395 set tmpnam_r d_tmpnam_r
17397 case "$d_tmpnam_r" in
17399 hdrs="$i_systypes sys/types.h define stdio.h "
17400 case "$d_tmpnam_r_proto:$usethreads" in
17401 ":define") d_tmpnam_r_proto=define
17402 set d_tmpnam_r_proto tmpnam_r $hdrs
17406 case "$d_tmpnam_r_proto" in
17408 case "$tmpnam_r_proto" in
17409 ''|0) try='char* tmpnam_r(char*);'
17410 ./protochk "extern $try" $hdrs && tmpnam_r_proto=B_B ;;
17412 case "$tmpnam_r_proto" in
17413 ''|0) d_tmpnam_r=undef
17415 echo "Disabling tmpnam_r, cannot determine prototype." >&4 ;;
17416 * ) case "$tmpnam_r_proto" in
17417 REENTRANT_PROTO*) ;;
17418 *) tmpnam_r_proto="REENTRANT_PROTO_$tmpnam_r_proto" ;;
17420 echo "Prototype: $try" ;;
17423 *) case "$usethreads" in
17424 define) echo "tmpnam_r has no prototype, not using it." >&4 ;;
17431 *) tmpnam_r_proto=0
17435 : see if truncate exists
17436 set truncate d_truncate
17439 : see if ttyname_r exists
17440 set ttyname_r d_ttyname_r
17442 case "$d_ttyname_r" in
17444 hdrs="$i_systypes sys/types.h define stdio.h $i_unistd unistd.h"
17445 case "$d_ttyname_r_proto:$usethreads" in
17446 ":define") d_ttyname_r_proto=define
17447 set d_ttyname_r_proto ttyname_r $hdrs
17451 case "$d_ttyname_r_proto" in
17453 case "$ttyname_r_proto" in
17454 ''|0) try='int ttyname_r(int, char*, size_t);'
17455 ./protochk "extern $try" $hdrs && ttyname_r_proto=I_IBW ;;
17457 case "$ttyname_r_proto" in
17458 ''|0) try='int ttyname_r(int, char*, int);'
17459 ./protochk "extern $try" $hdrs && ttyname_r_proto=I_IBI ;;
17461 case "$ttyname_r_proto" in
17462 ''|0) try='char* ttyname_r(int, char*, int);'
17463 ./protochk "extern $try" $hdrs && ttyname_r_proto=B_IBI ;;
17465 case "$ttyname_r_proto" in
17466 ''|0) d_ttyname_r=undef
17468 echo "Disabling ttyname_r, cannot determine prototype." >&4 ;;
17469 * ) case "$ttyname_r_proto" in
17470 REENTRANT_PROTO*) ;;
17471 *) ttyname_r_proto="REENTRANT_PROTO_$ttyname_r_proto" ;;
17473 echo "Prototype: $try" ;;
17476 *) case "$usethreads" in
17477 define) echo "ttyname_r has no prototype, not using it." >&4 ;;
17484 *) ttyname_r_proto=0
17488 : see if tzname[] exists
17490 if set tzname val -a d_tzname; eval $csym; $val; then
17492 echo 'tzname[] found.' >&4
17495 echo 'tzname[] NOT found.' >&4
17501 next|rhapsody|darwin) multiarch="$define" ;;
17503 case "$multiarch" in
17504 ''|[nN]*) multiarch="$undef" ;;
17507 : check for ordering of bytes in a UV
17509 case "$usecrosscompile$multiarch" in
17512 You seem to be either cross-compiling or doing a multiarchitecture build,
17513 skipping the byteorder check.
17519 case "$byteorder" in
17522 In the following, larger digits indicate more significance. A big-endian
17523 machine like a Pyramid or a Motorola 680?0 chip will come out to 4321. A
17524 little-endian machine like a Vax or an Intel 80?86 chip would be 1234. Other
17525 machines may have weird orders like 3412. A Cray will report 87654321,
17526 an Alpha will report 12345678. If the test program works the default is
17528 I'm now running the test program...
17532 #$i_stdlib I_STDLIB
17534 #include <stdlib.h>
17536 #include <sys/types.h>
17537 typedef $uvtype UV;
17547 u.l = (((UV)0x08070605) << 32) | (UV)0x04030201;
17549 u.l = (UV)0x04030201;
17550 for (i = 0; i < $uvsize; i++)
17551 printf("%c", u.c[i]+'0');
17558 if eval $compile && ./try > /dev/null; then
17561 [1-4][1-4][1-4][1-4]|12345678|87654321)
17562 echo "(The test program ran ok.)"
17563 echo "byteorder=$dflt"
17566 ????|????????) echo "(The test program ran ok.)" ;;
17567 *) echo "(The test program didn't run right for some reason.)" ;;
17572 (I can't seem to compile the test program. Guessing big-endian...)
17575 case "$xxx_prompt" in
17577 rp="What is the order of bytes in $uvtype?"
17593 Checking to see whether you can access character data unalignedly...
17595 case "$d_u32align" in
17596 '') $cat >try.c <<EOCP
17598 #$i_stdlib I_STDLIB
17600 #include <stdlib.h>
17602 #define U32 $u32type
17603 #define BYTEORDER 0x$byteorder
17605 #include <signal.h>
17607 $signal_t bletch(s) int s; { exit(4); }
17610 #if BYTEORDER == 0x1234 || BYTEORDER == 0x4321
17615 if (sizeof(U32) != 4) {
17616 printf("sizeof(U32) is not 4, but %d\n", sizeof(U32));
17623 signal(SIGBUS, bletch);
17635 for (i = 0; i < 4; i++) {
17636 up = (U32*)(buf + i);
17637 if (! ((*up == 1 << (8*i)) || /* big-endian */
17638 (*up == 1 << (8*(3-i))) /* little-endian */
17642 printf("read failed (%x)\n", *up);
17648 for (i = 0; i < 4; i++) {
17649 up = (U32*)(buf + i);
17651 if (*up != 0xBeef) {
17652 printf("write failed (%x)\n", *up);
17666 if eval $compile_ok; then
17667 echo "(Testing for character data alignment may crash the test. That's okay.)" >&4
17668 $run ./try 2>&1 >/dev/null
17671 You can access character data pretty unalignedly.
17673 d_u32align="$undef"
17676 It seems that you must access character data in an aligned manner.
17678 d_u32align="$define"
17682 rp='Can you access character data at unaligned addresses?'
17686 [yY]*) d_u32align="$undef" ;;
17687 *) d_u32align="$define" ;;
17690 $rm -f core core.try.* try.core
17694 : see if ualarm exists
17695 set ualarm d_ualarm
17698 : see if umask exists
17702 : see if unordered exists
17703 set unordered d_unordered
17706 : see if unsetenv exists
17707 set unsetenv d_unsetenv
17710 : see if usleep exists
17711 set usleep d_usleep
17714 : see if prototype for usleep is available
17716 set d_usleepproto usleep $i_unistd unistd.h
17719 : see if ustat exists
17723 : backward compatibility for d_hvfork
17724 if test X$d_hvfork != X; then
17725 d_vfork="$d_hvfork"
17728 : see if there is a vfork
17733 : Ok, but do we want to use it. vfork is reportedly unreliable in
17734 : perl on Solaris 2.x, and probably elsewhere.
17738 case "$usevfork" in
17744 Perl can only use a vfork() that doesn't suffer from strict
17745 restrictions on calling functions or modifying global data in
17746 the child. For example, glibc-2.1 contains such a vfork()
17747 that is unsuitable. If your system provides a proper fork()
17748 call, chances are that you do NOT want perl to use vfork().
17751 rp="Do you still want to use vfork()?"
17756 echo "Ok, we won't use vfork()."
17765 $define) usevfork='true';;
17766 *) usevfork='false';;
17769 : see if closedir exists
17770 set closedir d_closedir
17773 case "$d_closedir" in
17776 echo "Checking whether closedir() returns a status..." >&4
17778 #$i_dirent I_DIRENT /**/
17779 #$i_sysdir I_SYS_DIR /**/
17780 #$i_sysndir I_SYS_NDIR /**/
17781 #$i_systypes I_SYS_TYPES /**/
17783 #if defined(I_SYS_TYPES)
17784 #include <sys/types.h>
17786 #if defined(I_DIRENT)
17787 #include <dirent.h>
17788 #if defined(NeXT) && defined(I_SYS_DIR) /* NeXT needs dirent + sys/dir.h */
17789 #include <sys/dir.h>
17793 #include <sys/ndir.h>
17797 #include <ndir.h> /* may be wrong in the future */
17799 #include <sys/dir.h>
17804 int main() { return closedir(opendir(".")); }
17807 if eval $compile_ok; then
17808 if $run ./try > /dev/null 2>&1 ; then
17809 echo "Yes, it does."
17812 echo "No, it doesn't."
17816 echo "(I can't seem to compile the test program--assuming it doesn't)"
17824 set d_void_closedir
17827 : see if there is a wait4
17831 : see if waitpid exists
17832 set waitpid d_waitpid
17835 : see if wcstombs exists
17836 set wcstombs d_wcstombs
17839 : see if wctomb exists
17840 set wctomb d_wctomb
17843 : see if writev exists
17844 set writev d_writev
17847 : preserve RCS keywords in files with variable substitution, grrr
17852 Revision='$Revision'
17854 : check for alignment requirements
17856 case "$usecrosscompile$multiarch" in
17859 You seem to be either cross-compiling or doing a multiarchitecture build,
17860 skipping the memory alignment check.
17863 case "$alignbytes" in
17864 '') alignbytes=8 ;;
17868 case "$alignbytes" in
17869 '') echo "Checking alignment constraints..." >&4
17870 if $test "X$uselongdouble" = Xdefine -a "X$d_longdbl" = Xdefine; then
17871 $cat >try.c <<'EOCP'
17872 typedef long double NV;
17875 $cat >try.c <<'EOCP'
17879 $cat >>try.c <<'EOCP'
17887 printf("%d\n", (int)((char *)&try_algn.bar - (char *)&try_algn.foo));
17892 if eval $compile_ok; then
17896 echo "(I can't seem to compile the test program...)"
17899 *) dflt="$alignbytes"
17902 rp="Doubles must be aligned on a how-many-byte boundary?"
17910 : set the base revision
17913 : how do we concatenate cpp tokens here?
17915 echo "Checking to see how your cpp does stuff like concatenate tokens..." >&4
17916 $cat >cpp_stuff.c <<'EOCP'
17917 #define RCAT(a,b)a/**/b
17918 #define ACAT(a,b)a ## b
17922 $cppstdin $cppflags $cppminus <cpp_stuff.c >cpp_stuff.out 2>&1
17923 if $contains 'Circus' cpp_stuff.out >/dev/null 2>&1; then
17924 echo "Oh! Smells like ANSI's been here." >&4
17925 echo "We can catify or stringify, separately or together!"
17927 elif $contains 'Reiser' cpp_stuff.out >/dev/null 2>&1; then
17928 echo "Ah, yes! The good old days!" >&4
17929 echo "However, in the good old days we don't know how to stringify and"
17930 echo "catify at the same time."
17934 Hmm, I don't seem to be able to concatenate tokens with your cpp.
17935 You're going to have to edit the values of CAT[2-5] in config.h...
17937 cpp_stuff="/* Help! How do we handle cpp_stuff? */*/"
17941 : see if this is a db.h system
17947 : Check db version.
17949 echo "Checking Berkeley DB version ..." >&4
17955 #include <sys/types.h>
17957 #$i_stdlib I_STDLIB
17959 #include <stdlib.h>
17962 int main(int argc, char *argv[])
17964 #ifdef DB_VERSION_MAJOR /* DB version >= 2 */
17965 int Major, Minor, Patch ;
17966 unsigned long Version ;
17967 (void)db_version(&Major, &Minor, &Patch) ;
17969 printf("%d %d %d %d %d %d\n",
17970 DB_VERSION_MAJOR, DB_VERSION_MINOR, DB_VERSION_PATCH,
17971 Major, Minor, Patch);
17974 printf("You have Berkeley DB Version 2 or greater.\n");
17976 printf("db.h is from Berkeley DB Version %d.%d.%d\n",
17977 DB_VERSION_MAJOR, DB_VERSION_MINOR, DB_VERSION_PATCH);
17978 printf("libdb is from Berkeley DB Version %d.%d.%d\n",
17979 Major, Minor, Patch) ;
17981 /* check that db.h & libdb are compatible */
17982 if (DB_VERSION_MAJOR != Major || DB_VERSION_MINOR != Minor || DB_VERSION_PATCH != Patch) {
17983 printf("db.h and libdb are incompatible.\n") ;
17987 printf("db.h and libdb are compatible.\n") ;
17989 Version = DB_VERSION_MAJOR * 1000000 + DB_VERSION_MINOR * 1000
17990 + DB_VERSION_PATCH ;
17992 /* needs to be >= 2.3.4 */
17993 if (Version < 2003004) {
17994 /* if (DB_VERSION_MAJOR == 2 && DB_VERSION_MINOR == 0 && DB_VERSION_PATCH < 5) { */
17995 printf("Perl needs Berkeley DB 2.3.4 or greater.\n") ;
18001 #if defined(_DB_H_) && defined(BTREEMAGIC) && defined(HASHMAGIC)
18006 printf("You have Berkeley DB Version 1.\n");
18007 exit(0); /* DB version < 2: the coast is clear. */
18009 exit(1); /* <db.h> not Berkeley DB? */
18015 if eval $compile_ok && $run ./try; then
18016 echo 'Looks OK.' >&4
18018 db_version_major=$1
18019 db_version_minor=$2
18020 db_version_patch=$3
18022 echo "I can't use Berkeley DB with your <db.h>. I'll disable Berkeley DB." >&4
18026 : Remove db from list of libraries to use
18027 echo "Removing unusable -ldb from library list" >&4
18028 set `echo X $libs | $sed -e 's/-ldb / /' -e 's/-ldb$//'`
18031 echo "libs = $libs" >&4
18041 : Check the return type needed for hash
18043 echo "Checking return type needed for hash for Berkeley DB ..." >&4
18049 #include <sys/types.h>
18052 #ifndef DB_VERSION_MAJOR
18053 u_int32_t hash_cb (ptr, size)
18061 info.hash = hash_cb;
18065 if $cc $ccflags -c try.c >try.out 2>&1 ; then
18066 if $contains warning try.out >>/dev/null 2>&1 ; then
18069 db_hashtype='u_int32_t'
18072 : XXX Maybe we should just give up here.
18073 db_hashtype=u_int32_t
18075 echo "Help: I can't seem to compile the db test program." >&4
18076 echo "Something's wrong, but I'll assume you use $db_hashtype." >&4
18079 echo "Your version of Berkeley DB uses $db_hashtype for hash."
18081 *) db_hashtype=u_int32_t
18086 : Check the return type needed for prefix
18088 echo "Checking return type needed for prefix for Berkeley DB ..." >&4
18094 #include <sys/types.h>
18097 #ifndef DB_VERSION_MAJOR
18098 size_t prefix_cb (key1, key2)
18106 info.prefix = prefix_cb;
18110 if $cc $ccflags -c try.c >try.out 2>&1 ; then
18111 if $contains warning try.out >>/dev/null 2>&1 ; then
18112 db_prefixtype='int'
18114 db_prefixtype='size_t'
18117 db_prefixtype='size_t'
18118 : XXX Maybe we should just give up here.
18120 echo "Help: I can't seem to compile the db test program." >&4
18121 echo "Something's wrong, but I'll assume you use $db_prefixtype." >&4
18124 echo "Your version of Berkeley DB uses $db_prefixtype for prefix."
18126 *) db_prefixtype='size_t'
18131 : How can we generate normalized random numbers ?
18133 echo "Looking for a random number function..." >&4
18134 case "$randfunc" in
18136 if set drand48 val -f; eval $csym; $val; then
18138 echo "Good, found drand48()." >&4
18139 elif set random val -f; eval $csym; $val; then
18141 echo "OK, found random()." >&4
18144 echo "Yick, looks like I have to use rand()." >&4
18155 *-Dmy_rand=*|*-Dmy_srand=*)
18156 echo "Removing obsolete -Dmy_rand, -Dmy_srand, and -Drandbits from ccflags." >&4
18157 ccflags="`echo $ccflags | sed -e 's/-Dmy_rand=random/ /'`"
18158 ccflags="`echo $ccflags | sed -e 's/-Dmy_srand=srandom/ /'`"
18159 ccflags="`echo $ccflags | sed -e 's/-Drandbits=[0-9][0-9]*/ /'`"
18163 while $test "$cont"; do
18164 rp="Use which function to generate random numbers?"
18166 if $test "$ans" = "$dflt"; then
18172 if set $ans val -f; eval $csym; $val; then
18176 rp="I cannot find function $ans. Use that name anyway?"
18185 case "$randfunc" in
18187 drand01="drand48()"
18193 case "$randbits" in
18195 echo "Checking to see how many bits your $randfunc() function produces..." >&4
18197 #$i_unistd I_UNISTD
18198 #$i_stdlib I_STDLIB
18201 # include <unistd.h>
18204 # include <stdlib.h>
18209 register unsigned long tmp;
18210 register unsigned long max = 0L;
18212 for (i = 1000; i; i--) {
18213 tmp = (unsigned long) $randfunc();
18214 if (tmp > max) max = tmp;
18216 for (i = 0; max; i++)
18222 if eval $compile_ok; then
18226 echo "(I can't seem to compile the test program...)"
18233 rp="How many bits does your $randfunc() function produce?"
18237 drand01="($randfunc() / (double) ((unsigned long)1 << $randbits))"
18238 seedfunc="s$randfunc"
18239 randseedtype=unsigned
18243 rp="How many bits does your $randfunc() function produce?"
18246 seedfunc="s$randfunc"
18247 drand01="($randfunc() / (double) ((unsigned long)1 << $randbits))"
18248 if set $seedfunc val -f; eval $csym; $val; then
18249 echo "(Using $seedfunc() to seed random generator)"
18251 echo "(Warning: no $seedfunc() to seed random generator)"
18254 randseedtype=unsigned
18262 echo "Determining whether or not we are on an EBCDIC system..." >&4
18263 $cat >try.c <<'EOM'
18266 if ('M'==0xd4) return 0;
18273 if eval $compile_ok; then
18274 if $run ./try; then
18275 echo "You seem to speak EBCDIC." >&4
18278 echo "Nope, no EBCDIC, probably ASCII or some ISO Latin. Or UTF-8." >&4
18281 echo "I'm unable to compile the test program." >&4
18282 echo "I'll assume ASCII or some ISO Latin. Or UTF8." >&4
18290 Checking how to flush all pending stdio output...
18292 # I only know how to find the first 32 possibly open files on SunOS.
18293 # See also hints/sunos_4_1.sh and util.c --AD
18295 sunos) $echo '#define PERL_FFLUSH_ALL_FOPEN_MAX 32' > try.c ;;
18297 $cat >>try.c <<EOCP
18299 #$i_stdlib I_STDLIB
18301 #include <stdlib.h>
18303 #$i_unistd I_UNISTD
18305 # include <unistd.h>
18307 #$d_sysconf HAS_SYSCONF
18308 #$d_stdio_stream_array HAS_STDIO_STREAM_ARRAY
18309 #ifdef HAS_STDIO_STREAM_ARRAY
18310 # define STDIO_STREAM_ARRAY $stdio_stream_array
18315 p = fopen("try.out", "w");
18319 # ifdef TRY_FPRINTF
18323 #ifdef TRY_FFLUSH_NULL
18326 #ifdef TRY_FFLUSH_ALL
18328 long open_max = -1;
18329 # ifdef PERL_FFLUSH_ALL_FOPEN_MAX
18330 open_max = PERL_FFLUSH_ALL_FOPEN_MAX;
18332 # if defined(HAS_SYSCONF) && defined(_SC_OPEN_MAX)
18333 open_max = sysconf(_SC_OPEN_MAX);
18336 open_max = FOPEN_MAX;
18339 open_max = OPEN_MAX;
18348 # ifdef HAS_STDIO_STREAM_ARRAY
18349 if (open_max > 0) {
18351 for (i = 0; i < open_max; i++)
18352 if (STDIO_STREAM_ARRAY[i]._file >= 0 &&
18353 STDIO_STREAM_ARRAY[i]._file < open_max &&
18354 STDIO_STREAM_ARRAY[i]._flag)
18355 fflush(&STDIO_STREAM_ARRAY[i]);
18363 : first we have to find out how _not_ to flush
18365 if $test "X$fflushNULL" = X -o "X$fflushall" = X; then
18367 set try -DTRY_FPUTC
18368 if eval $compile; then
18369 $run ./try 2>/dev/null
18372 if $test ! -s try.out -a "X$code" = X42; then
18378 set try -DTRY_FPRINTF
18379 if eval $compile; then
18380 $run ./try 2>/dev/null
18383 if $test ! -s try.out -a "X$code" = X42; then
18384 output=-DTRY_FPRINTF
18390 : check for fflush NULL behaviour
18391 case "$fflushNULL" in
18392 '') set try -DTRY_FFLUSH_NULL $output
18393 if eval $compile; then
18394 $run ./try 2>/dev/null
18397 if $test -s try.out -a "X$code" = X42; then
18398 fflushNULL="`$cat try.out`"
18400 if $test "X$code" != X42; then
18402 (If this test failed, don't worry, we'll try another method shortly.)
18407 $rm -f core try.core core.try.*
18408 case "$fflushNULL" in
18410 Your fflush(NULL) works okay for output streams.
18411 Let's see if it clobbers input pipes...
18413 # As of mid-March 2000 all versions of Solaris appear to have a stdio
18414 # bug that improperly flushes the input end of pipes. So we avoid the
18415 # autoflush on fork/system/exec support for now. :-(
18416 $cat >tryp.c <<EOCP
18419 main(int argc, char **argv)
18425 while ((i = getc(stdin)) != -1
18426 && (*bp++ = i) != '\n'
18427 && bp < &buf[1024])
18430 fprintf(stdout, "%s", buf);
18438 fflushNULL="$define"
18440 if eval $compile; then
18442 $cat tryp.c | $run ./tryp 2>/dev/null > tryp.out
18443 if cmp tryp.c tryp.out >/dev/null 2>&1; then
18445 fflush(NULL) seems to behave okay with input streams.
18447 fflushNULL="$define"
18450 Ouch, fflush(NULL) clobbers input pipes! We will not use it.
18452 fflushNULL="$undef"
18455 $rm -f core tryp.c tryp.core core.tryp.*
18458 Your fflush(NULL) isn't working (contrary to ANSI C).
18460 fflushNULL="$undef"
18463 Cannot figure out whether your fflush(NULL) works or not.
18464 I'm assuming it doesn't (contrary to ANSI C).
18466 fflushNULL="$undef"
18470 $define|true|[yY]*)
18471 fflushNULL="$define"
18474 fflushNULL="$undef"
18477 : check explicit looping only if NULL did not work, and if the pipe
18478 : bug does not show up on an explicit flush too
18479 case "$fflushNULL" in
18481 $cat >tryp.c <<EOCP
18484 main(int argc, char **argv)
18490 while ((i = getc(stdin)) != -1
18491 && (*bp++ = i) != '\n'
18492 && bp < &buf[1024])
18495 fprintf(stdout, "%s", buf);
18504 if eval $compile; then
18506 $cat tryp.c | $run ./tryp 2>/dev/null > tryp.out
18507 if cmp tryp.c tryp.out >/dev/null 2>&1; then
18509 Good, at least fflush(stdin) seems to behave okay when stdin is a pipe.
18511 : now check for fflushall behaviour
18512 case "$fflushall" in
18513 '') set try -DTRY_FFLUSH_ALL $output
18514 if eval $compile; then
18516 (Now testing the other method--but note that this also may fail.)
18518 $run ./try 2>/dev/null
18521 if $test -s try.out -a "X$code" = X42; then
18522 fflushall="`$cat try.out`"
18525 $rm -f core try.core core.try.*
18526 case "$fflushall" in
18528 Whew. Flushing explicitly all the stdio streams works.
18530 fflushall="$define"
18533 Sigh. Flushing explicitly all the stdio streams doesn't work.
18538 Cannot figure out whether flushing stdio streams explicitly works or not.
18539 I'm assuming it doesn't.
18545 "$define"|true|[yY]*)
18546 fflushall="$define"
18554 All is futile. Even fflush(stdin) clobbers input pipes!
18561 $rm -f core tryp.c tryp.core core.tryp.*
18563 *) fflushall="$undef"
18567 case "$fflushNULL$fflushall" in
18570 OK, I give up. I cannot figure out how to flush pending stdio output.
18571 We won't be flushing handles at all before fork/exec/popen.
18575 $rm -f try.* try$exe_ext
18577 : Store the full pathname to the ar program for use in the C program
18578 : Respect a hint or command line value for full_ar.
18583 : Store the full pathname to the sed program for use in the C program
18586 : see what type gids are declared as in the kernel
18588 echo "Looking for the type for group ids returned by getgid()."
18589 set gid_t gidtype xxx stdio.h sys/types.h
18593 xxx=`./findhdr sys/user.h`
18594 set `grep 'groups\[NGROUPS\];' "$xxx" 2>/dev/null` unsigned short
18596 unsigned) dflt="$1 $2" ;;
18600 *) dflt="$gidtype";;
18603 gid_t) echo "gid_t found." ;;
18604 *) rp="What is the type for group ids returned by getgid()?"
18612 *_t) zzz="$gidtype" ;;
18615 echo "Checking the size of $zzz..." >&4
18617 #include <sys/types.h>
18619 #$i_stdlib I_STDLIB
18621 #include <stdlib.h>
18624 printf("%d\n", (int)sizeof($gidtype));
18629 if eval $compile_ok; then
18633 echo "(I can't execute the test program--guessing $gidsize.)" >&4
18636 echo "Your $zzz is $gidsize bytes long."
18641 echo "(I can't compile the test program--guessing $gidsize.)" >&4
18647 *_t) zzz="$gidtype" ;;
18650 echo "Checking the sign of $zzz..." >&4
18652 #include <sys/types.h>
18663 if eval $compile; then
18667 echo "(I can't execute the test program--guessing unsigned.)" >&4
18671 1) echo "Your $zzz is unsigned." ;;
18672 -1) echo "Your $zzz is signed." ;;
18678 echo "(I can't compile the test program--guessing unsigned.)" >&4
18684 if $test X"$quadtype" != X; then
18686 echo "Checking how to print 64-bit integers..." >&4
18688 if $test X"$sPRId64" = X -a X"$quadtype" = Xint; then
18689 $cat >try.c <<'EOCP'
18690 #include <sys/types.h>
18693 int q = 12345678901;
18694 printf("%ld\n", q);
18698 if eval $compile; then
18702 sPRId64='"d"'; sPRIi64='"i"'; sPRIu64='"u"';
18703 sPRIo64='"o"'; sPRIx64='"x"'; sPRIXU64='"X"';
18704 echo "We will use %d."
18710 if $test X"$sPRId64" = X -a X"$quadtype" = Xlong; then
18711 $cat >try.c <<'EOCP'
18712 #include <sys/types.h>
18715 long q = 12345678901;
18716 printf("%ld\n", q);
18720 if eval $compile; then
18724 sPRId64='"ld"'; sPRIi64='"li"'; sPRIu64='"lu"';
18725 sPRIo64='"lo"'; sPRIx64='"lx"'; sPRIXU64='"lX"';
18726 echo "We will use %ld."
18732 if $test X"$sPRId64" = X -a X"$i_inttypes" = X"$define" -a X"$quadtype" = Xint64_t; then
18733 $cat >try.c <<'EOCP'
18734 #include <sys/types.h>
18735 #include <inttypes.h>
18738 int64_t q = 12345678901;
18739 printf("%" PRId64 "\n", q);
18743 if eval $compile; then
18747 sPRId64=PRId64; sPRIi64=PRIi64; sPRIu64=PRIu64;
18748 sPRIo64=PRIo64; sPRIx64=PRIx64; sPRIXU64=PRIXU64;
18749 echo "We will use the C9X style."
18755 if $test X"$sPRId64" = X -a X"$quadtype" != X; then
18757 #include <sys/types.h>
18760 $quadtype q = 12345678901;
18761 printf("%Ld\n", q);
18765 if eval $compile; then
18769 sPRId64='"Ld"'; sPRIi64='"Li"'; sPRIu64='"Lu"';
18770 sPRIo64='"Lo"'; sPRIx64='"Lx"'; sPRIXU64='"LX"';
18771 echo "We will use %Ld."
18777 if $test X"$sPRId64" = X -a X"$quadtype" = X"long long"; then
18778 $cat >try.c <<'EOCP'
18779 #include <sys/types.h>
18782 long long q = 12345678901LL; /* AIX cc requires the LL suffix. */
18783 printf("%lld\n", q);
18787 if eval $compile; then
18791 sPRId64='"lld"'; sPRIi64='"lli"'; sPRIu64='"llu"';
18792 sPRIo64='"llo"'; sPRIx64='"llx"'; sPRIXU64='"llX"';
18793 echo "We will use the %lld style."
18799 if $test X"$sPRId64" = X -a X"$quadtype" != X; then
18801 #include <sys/types.h>
18804 $quadtype q = 12345678901;
18805 printf("%qd\n", q);
18809 if eval $compile; then
18813 sPRId64='"qd"'; sPRIi64='"qi"'; sPRIu64='"qu"';
18814 sPRIo64='"qo"'; sPRIx64='"qx"'; sPRIXU64='"qX"';
18815 echo "We will use %qd."
18821 if $test X"$sPRId64" = X; then
18822 echo "Cannot figure out how to print 64-bit integers." >&4
18830 '') d_PRId64="$undef"; d_PRIi64="$undef"; d_PRIu64="$undef";
18831 d_PRIo64="$undef"; d_PRIx64="$undef"; d_PRIXU64="$undef";
18833 *) d_PRId64="$define"; d_PRIi64="$define"; d_PRIu64="$define";
18834 d_PRIo64="$define"; d_PRIx64="$define"; d_PRIXU64="$define";
18840 $echo "Checking the format strings to be used for Perl's internal types..." >&4
18842 if $test X"$ivsize" = X8; then
18843 ivdformat="$sPRId64"
18844 uvuformat="$sPRIu64"
18845 uvoformat="$sPRIo64"
18846 uvxformat="$sPRIx64"
18847 uvXUformat="$sPRIXU64"
18849 if $test X"$ivsize" = X"$longsize"; then
18856 if $test X"$ivsize" = X"$intsize"; then
18864 if $test X"$ivsize" = X"$shortsize"; then
18875 if $test X"$uselongdouble" = X"$define" -a X"$d_longdbl" = X"$define" -a X"$d_PRIgldbl" = X"$define"; then
18876 nveformat="$sPRIeldbl"
18877 nvfformat="$sPRIfldbl"
18878 nvgformat="$sPRIgldbl"
18879 nvEUformat="$sPRIEUldbl"
18880 nvFUformat="$sPRIFUldbl"
18881 nvGUformat="$sPRIGUldbl"
18891 case "$ivdformat" in
18892 '') echo "$0: Fatal: failed to find format strings, cannot continue." >&4
18899 $echo "Checking the format string to be used for gids..." >&4
18902 -1) if $test X"$gidsize" = X"$ivsize"; then
18903 gidformat="$ivdformat"
18905 if $test X"$gidsize" = X"$longsize"; then
18908 if $test X"$gidsize" = X"$intsize"; then
18911 if $test X"$gidsize" = X"$shortsize"; then
18918 *) if $test X"$gidsize" = X"$uvsize"; then
18919 gidformat="$uvuformat"
18921 if $test X"$gidsize" = X"$longsize"; then
18924 if $test X"$gidsize" = X"$intsize"; then
18927 if $test X"$gidsize" = X"$shortsize"; then
18936 : see if getgroups exists
18937 set getgroups d_getgrps
18940 : see if setgroups exists
18941 set setgroups d_setgrps
18945 : Find type of 2nd arg to 'getgroups()' and 'setgroups()'
18947 case "$d_getgrps$d_setgrps" in
18949 case "$groupstype" in
18950 '') dflt="$gidtype" ;;
18951 *) dflt="$groupstype" ;;
18954 What type of pointer is the second argument to getgroups() and setgroups()?
18955 Usually this is the same as group ids, $gidtype, but not always.
18958 rp='What type pointer is the second argument to getgroups() and setgroups()?'
18962 *) groupstype="$gidtype";;
18967 $define|true|[yY]*) dflt='y' ;;
18972 Would you like to build with Misc Attribute Decoration? This is development
18973 work leading to a Perl 5 to Perl 6 convertor, which imposes a space and speed
18974 overhead on the interpreter.
18976 If this doesn't make any sense to you, just accept the default '$dflt'.
18978 rp='Build Perl with MAD?'
18981 y|Y) val="$define" ;;
18988 echo "Checking if your $make program sets \$(MAKE)..." >&4
18989 case "$make_set_make" in
18991 $sed 's/^X //' > testmake.mak << 'EOF'
18993 X @echo 'maketemp="$(MAKE)"'
18995 case "`$make -f testmake.mak 2>/dev/null`" in
18996 *maketemp=*) make_set_make='#' ;;
18997 *) make_set_make="MAKE=$make" ;;
18999 $rm -f testmake.mak
19002 case "$make_set_make" in
19003 '#') echo "Yup, it does.";;
19004 *) echo "Nope, it doesn't.";;
19007 : see what type is used for mode_t
19008 rp="What is the type used for file modes for system calls (e.g. fchmod())?"
19009 set mode_t modetype int stdio.h sys/types.h
19012 : see if stdarg is available
19014 if $test `./findhdr stdarg.h`; then
19015 echo "<stdarg.h> found." >&4
19018 echo "<stdarg.h> NOT found." >&4
19022 : see if varags is available
19024 if $test `./findhdr varargs.h`; then
19025 echo "<varargs.h> found." >&4
19027 echo "<varargs.h> NOT found, but that's ok (I hope)." >&4
19030 : set up the varargs testing programs
19031 $cat > varargs.c <<EOP
19033 #include <stdarg.h>
19036 #include <varargs.h>
19040 int f(char *p, ...)
19054 p = va_arg(ap, char *);
19059 $cat > varargs <<EOP
19061 if $cc -c $ccflags -D\$1 varargs.c >/dev/null 2>&1; then
19070 : now check which varargs header should be included
19075 if `./varargs I_STDARG`; then
19077 elif `./varargs I_VARARGS`; then
19082 if `./varargs I_VARARGS`; then
19089 echo "I could not find the definition for va_dcl... You have problems..." >&4
19090 val="$undef"; set i_stdarg; eval $setvar
19091 val="$undef"; set i_varargs; eval $setvar
19096 case "$i_varhdr" in
19098 val="$define"; set i_stdarg; eval $setvar
19099 val="$undef"; set i_varargs; eval $setvar
19102 val="$undef"; set i_stdarg; eval $setvar
19103 val="$define"; set i_varargs; eval $setvar
19106 echo "We'll include <$i_varhdr> to get va_dcl definition." >&4;;
19110 : see if we need va_copy
19112 case "$i_stdarg" in
19115 #include <stdarg.h>
19117 #$i_stdlib I_STDLIB
19119 #include <stdlib.h>
19121 #include <signal.h>
19124 ivfprintf(FILE *f, const char *fmt, va_list *valp)
19126 return vfprintf(f, fmt, *valp);
19130 myvfprintf(FILE *f, const char *fmt, va_list val)
19132 return ivfprintf(f, fmt, &val);
19136 myprintf(char *fmt, ...)
19139 va_start(val, fmt);
19140 return myvfprintf(stdout, fmt, val);
19144 main(int ac, char **av)
19146 signal(SIGSEGV, exit);
19148 myprintf("%s%cs all right, then\n", "that", '\'');
19153 if eval $compile && $run ./try 2>&1 >/dev/null; then
19154 case "`$run ./try`" in
19155 "that's all right, then")
19161 yes) echo "It seems that you don't need va_copy()." >&4
19162 need_va_copy="$undef"
19164 *) echo "It seems that va_copy() or similar will be needed." >&4
19165 need_va_copy="$define"
19168 $rm -f try.* core core.* *.core *.core.*
19170 *) echo "You don't have <stdarg.h>, not checking for va_copy()." >&4
19174 : see what type is used for size_t
19175 rp="What is the type used for the length parameter for string functions?"
19176 set size_t sizetype 'unsigned int' stdio.h sys/types.h
19179 : check for type of arguments to gethostbyaddr.
19180 if test "X$netdb_host_type" = X -o "X$netdb_hlen_type" = X; then
19181 case "$d_gethbyaddr" in
19185 Checking to see what type of arguments are accepted by gethostbyaddr().
19187 hdrs="$define sys/types.h
19188 $d_socket sys/socket.h
19189 $i_niin netinet/in.h
19191 $i_unistd unistd.h"
19192 : The first arg can 'char *' or 'void *'
19193 : The second arg is some of integral type
19194 for xxx in in_addr_t 'const void *' 'const char *' 'void *' 'char *'; do
19195 for yyy in size_t long int; do
19196 case "$netdb_host_type" in
19197 '') try="extern struct hostent *gethostbyaddr($xxx, $yyy, int);"
19198 if ./protochk "$try" $hdrs; then
19199 echo "Your system accepts $xxx for the first arg."
19200 echo "...and $yyy for the second arg."
19201 netdb_host_type="$xxx"
19202 netdb_hlen_type="$yyy"
19208 : In case none of those worked, prompt the user.
19209 case "$netdb_host_type" in
19210 '') rp='What is the type for the 1st argument to gethostbyaddr?'
19213 netdb_host_type=$ans
19214 rp='What is the type for the 2nd argument to gethostbyaddr?'
19217 netdb_hlen_type=$ans
19221 *) : no gethostbyaddr, so pick harmless defaults
19222 netdb_host_type='char *'
19223 netdb_hlen_type="$sizetype"
19226 # Remove the "const" if needed. -- but then we'll have a
19228 # netdb_host_type=`echo "$netdb_host_type" | sed 's/^const //'`
19231 : check for type of argument to gethostbyname.
19232 if test "X$netdb_name_type" = X ; then
19233 case "$d_gethbyname" in
19237 Checking to see what type of argument is accepted by gethostbyname().
19239 hdrs="$define sys/types.h
19240 $d_socket sys/socket.h
19241 $i_niin netinet/in.h
19243 $i_unistd unistd.h"
19244 for xxx in "const char *" "char *"; do
19245 case "$netdb_name_type" in
19246 '') try="extern struct hostent *gethostbyname($xxx);"
19247 if ./protochk "$try" $hdrs; then
19248 echo "Your system accepts $xxx."
19249 netdb_name_type="$xxx"
19254 : In case none of those worked, prompt the user.
19255 case "$netdb_name_type" in
19256 '') rp='What is the type for the 1st argument to gethostbyname?'
19259 netdb_name_type=$ans
19263 *) : no gethostbyname, so pick harmless default
19264 netdb_name_type='char *'
19269 : check for type of 1st argument to getnetbyaddr.
19270 if test "X$netdb_net_type" = X ; then
19271 case "$d_getnbyaddr" in
19275 Checking to see what type of 1st argument is accepted by getnetbyaddr().
19277 hdrs="$define sys/types.h
19278 $d_socket sys/socket.h
19279 $i_niin netinet/in.h
19281 $i_unistd unistd.h"
19282 for xxx in in_addr_t "unsigned long" long "unsigned int" int; do
19283 case "$netdb_net_type" in
19284 '') try="extern struct netent *getnetbyaddr($xxx, int);"
19285 if ./protochk "$try" $hdrs; then
19286 echo "Your system accepts $xxx."
19287 netdb_net_type="$xxx"
19292 : In case none of those worked, prompt the user.
19293 case "$netdb_net_type" in
19294 '') rp='What is the type for the 1st argument to getnetbyaddr?'
19297 netdb_net_type=$ans
19301 *) : no getnetbyaddr, so pick harmless default
19302 netdb_net_type='long'
19306 : locate the preferred pager for this system
19313 [a-zA-Z]:/*) dflt=$pg;;
19317 [a-zA-Z]:/*) dflt=$more;;
19321 [a-zA-Z]:/*) dflt=$less;;
19324 '') dflt=/usr/ucb/more;;
19328 : Instruct ./getfile to trust the hinted or previous pager value,
19329 : even if it does not begin with a slash. For example, on os2,
19330 : pager might be cmd /c more. See comments in UU/getfile.
19335 rp='What pager is used on your system?'
19339 : see what type pids are declared as in the kernel
19340 rp="What is the type of process ids on this system?"
19341 set pid_t pidtype int stdio.h sys/types.h
19344 : see if ar generates random libraries by itself
19346 echo "Checking how to generate random libraries on your machine..." >&4
19347 echo 'int bar1() { return bar2(); }' > bar1.c
19348 echo 'int bar2() { return 2; }' > bar2.c
19350 #$i_stdlib I_STDLIB
19352 #include <stdlib.h>
19354 int main() { printf("%d\n", bar1()); exit(0); }
19356 $cc $ccflags -c bar1.c >/dev/null 2>&1
19357 $cc $ccflags -c bar2.c >/dev/null 2>&1
19358 $cc $ccflags -c foo.c >/dev/null 2>&1
19359 $ar rc bar$_a bar2$_o bar1$_o >/dev/null 2>&1
19360 if $cc -o foobar $ccflags $ldflags foo$_o bar$_a $libs > /dev/null 2>&1 &&
19361 $run ./foobar >/dev/null 2>&1; then
19362 echo "$ar appears to generate random libraries itself."
19364 if [ "X$ranlib" = "X" ]; then
19367 elif $ar s bar$_a >/dev/null 2>&1 &&
19368 $cc -o foobar $ccflags $ldflags foo$_o bar$_a $libs > /dev/null 2>&1 &&
19369 $run ./foobar >/dev/null 2>&1; then
19370 echo "a table of contents needs to be added with '$ar s'."
19373 elif $ar ts bar$_a >/dev/null 2>&1 &&
19374 $cc -o foobar $ccflags $ldflags foo$_o bar$_a $libs > /dev/null 2>&1 &&
19375 $run ./foobar >/dev/null 2>&1; then
19376 echo "a table of contents needs to be added with '$ar ts'."
19383 ranlib=`./loc ranlib X /usr/bin /bin /usr/local/bin`
19384 $test -f $ranlib || ranlib=''
19387 if $test -n "$ranlib"; then
19388 echo "your system has '$ranlib'; we'll use that."
19391 echo "your system doesn't seem to support random libraries"
19392 echo "so we'll use lorder and tsort to order the libraries."
19399 : check for type of arguments to select.
19400 case "$selecttype" in
19401 '') case "$d_select" in
19405 Checking to see what type of arguments are accepted by select().
19407 hdrs="$define sys/types.h
19408 $i_systime sys/time.h
19409 $i_sysselct sys/select.h
19410 $d_socket sys/socket.h"
19411 : The first arg can be int, unsigned, or size_t
19412 : The last arg may or may not be 'const'
19414 : void pointer has been seen but using that
19415 : breaks the selectminbits test
19416 for xxx in 'fd_set *' 'int *'; do
19417 for nfd in 'int' 'size_t' 'unsigned long' 'unsigned' ; do
19418 for tmo in 'struct timeval *' 'const struct timeval *'; do
19420 '') try="extern select _(($nfd, $xxx, $xxx, $xxx, $tmo));"
19421 if ./protochk "$try" $hdrs; then
19422 echo "Your system accepts $xxx."
19431 '') rp='What is the type for the 2nd, 3rd, and 4th arguments to select?'
19432 case "$d_fd_set" in
19433 $define) dflt="fd_set *" ;;
19442 *) : no select, so pick a harmless default
19449 : check for the select 'width'
19450 case "$selectminbits" in
19451 '') safebits=`expr $ptrsize \* 8`
19452 case "$d_select" in
19456 Checking to see on how many bits at a time your select() operates...
19459 #include <sys/types.h>
19461 #$i_systime I_SYS_TIME
19462 #$i_systimek I_SYS_TIME_KERNEL
19467 # ifdef I_SYS_TIME_KERNEL
19470 # include <sys/time.h>
19471 # ifdef I_SYS_TIME_KERNEL
19475 #$i_sysselct I_SYS_SELECT
19476 #ifdef I_SYS_SELECT
19477 #include <sys/select.h>
19479 #$d_socket HAS_SOCKET
19481 # include <sys/socket.h> /* Might include <sys/bsdtypes.h> */
19484 #$i_stdlib I_STDLIB
19486 #include <stdlib.h>
19489 #define S sizeof(*(b))
19491 #define NBYTES (S * 8 > MINBITS ? S : MINBITS/8)
19492 #define NBITS (NBYTES * 8)
19494 char *s = malloc(NBYTES);
19503 fp = fopen("try.c", "r");
19509 b = ($selecttype)s;
19510 for (i = 0; i < NBITS; i++)
19514 select(fd + 1, b, 0, 0, &t);
19515 for (i = NBITS - 1; i > fd && FD_ISSET(i, b); i--);
19517 printf("%d\n", i + 1);
19522 if eval $compile_ok; then
19523 selectminbits=`$run ./try`
19524 case "$selectminbits" in
19526 Cannot figure out on how many bits at a time your select() operates.
19527 I'll play safe and guess it is $safebits bits.
19529 selectminbits=$safebits
19530 bits="$safebits bits"
19533 *) bits="$selectminbits bits" ;;
19535 echo "Your select() operates on $bits at a time." >&4
19537 rp='What is the minimum number of bits your select() operates on?'
19538 case "$byteorder" in
19539 12345678) dflt=64 ;;
19545 selectminbits="$val"
19549 *) : no select, so pick a harmless default
19550 selectminbits=$safebits
19556 : Trace out the files included by signal.h, then look for SIGxxx names.
19557 : Remove SIGARRAYSIZE used by HPUX.
19558 : Remove SIGSTKSIZE used by Linux.
19559 : Remove SIGSTKSZ used by Posix.
19560 : Remove SIGTYP void lines used by OS2.
19561 : Some cpps, like os390, dont give the file name anywhere
19562 if [ "X$fieldn" = X ]; then
19563 : Just make some guesses. We check them later.
19564 xxx='/usr/include/signal.h /usr/include/sys/signal.h'
19566 xxx=`echo '#include <signal.h>' |
19567 $cppstdin $cppminus $cppflags 2>/dev/null |
19568 $grep '^[ ]*#.*include' |
19569 $awk "{print \\$$fieldn}" | $sed 's!"!!g' | $sed 's!\\\\\\\\!/!g' | $sort | $uniq`
19571 : Check this list of files to be sure we have parsed the cpp output ok.
19572 : This will also avoid potentially non-existent files, such
19575 for xx in $xxx /dev/null ; do
19576 $test -f "$xx" && xxxfiles="$xxxfiles $xx"
19578 : If we have found no files, at least try signal.h
19579 case "$xxxfiles" in
19580 '') xxxfiles=`./findhdr signal.h` ;;
19583 $1 ~ /^#define$/ && $2 ~ /^SIG[A-Z0-9]*$/ && $2 !~ /SIGARRAYSIZE/ && $2 !~ /SIGSTKSIZE/ && $2 !~ /SIGSTKSZ/ && $3 !~ /void/ {
19584 print substr($2, 4, 20)
19586 $1 == "#" && $2 ~ /^define$/ && $3 ~ /^SIG[A-Z0-9]*$/ && $3 !~ /SIGARRAYSIZE/ && $4 !~ /void/ {
19587 print substr($3, 4, 20)
19589 : Append some common names just in case the awk scan failed.
19590 xxx="$xxx ABRT ALRM BUS CANCEL CHLD CLD CONT DIL EMT FPE"
19591 xxx="$xxx FREEZE HUP ILL INT IO IOT KILL LOST LWP PHONE"
19592 xxx="$xxx PIPE POLL PROF PWR QUIT RTMAX RTMIN SEGV STKFLT STOP"
19593 xxx="$xxx SYS TERM THAW TRAP TSTP TTIN TTOU URG USR1 USR2"
19594 xxx="$xxx USR3 USR4 VTALRM WAITING WINCH WIND WINDOW XCPU XFSZ"
19596 : generate a few handy files for later
19597 $cat > signal.c <<EOCP
19598 #include <sys/types.h>
19599 #include <signal.h>
19600 #$i_stdlib I_STDLIB
19602 #include <stdlib.h>
19607 /* Strange style to avoid deeply-nested #if/#else/#endif */
19610 # define NSIG (_NSIG)
19616 # define NSIG (SIGMAX+1)
19622 # define NSIG (SIG_MAX+1)
19628 # define NSIG (_SIG_MAX+1)
19634 # define NSIG (MAXSIG+1)
19640 # define NSIG (MAX_SIG+1)
19645 # ifdef SIGARRAYSIZE
19646 # define NSIG SIGARRAYSIZE /* Assume ary[SIGARRAYSIZE] */
19652 # define NSIG (_sys_nsig) /* Solaris 2.5 */
19656 /* Default to some arbitrary number that's big enough to get most
19657 of the common signals.
19663 printf("NSIG %d\n", NSIG);
19669 echo $xxx | $tr ' ' $trnl | $sort | $uniq | $awk '
19671 printf "#ifdef SIG"; printf $1; printf "\n"
19672 printf "printf(\""; printf $1; printf " %%d\\n\",SIG";
19673 printf $1; printf ");\n"
19677 printf "#endif /* JUST_NSIG */\n";
19678 printf "exit(0);\n}\n";
19681 $cat >signal.awk <<'EOP'
19682 BEGIN { ndups = 0 }
19683 $1 ~ /^NSIG$/ { nsig = $2 }
19684 ($1 !~ /^NSIG$/) && (NF == 2) && ($2 ~ /^[0-9][0-9]*$/) {
19685 if ($2 > maxsig) { maxsig = $2 }
19686 if (sig_name[$2]) {
19687 dup_name[ndups] = $1
19688 dup_num[ndups] = $2
19700 printf("NSIG %d\n", nsig);
19701 for (n = 1; n < nsig; n++) {
19703 printf("%s %d\n", sig_name[n], sig_num[n])
19706 printf("NUM%d %d\n", n, n)
19709 for (n = 0; n < ndups; n++) {
19710 printf("%s %d\n", dup_name[n], dup_num[n])
19714 $cat >signal_cmd <<EOS
19716 if $test -s signal.lst; then
19717 echo "Using your existing signal.lst file"
19722 $cat >>signal_cmd <<'EOS'
19725 if eval $compile_ok; then
19726 $run ./signal$_exe | ($sort -n -k 2 2>/dev/null || $sort -n +1) | $uniq | $awk -f signal.awk >signal.lst
19728 echo "(I can't seem be able to compile the whole test program)" >&4
19729 echo "(I'll try it in little pieces.)" >&4
19730 set signal -DJUST_NSIG
19731 if eval $compile_ok; then
19732 $run ./signal$_exe > signal.nsg
19735 echo "I can't seem to figure out how many signals you have." >&4
19736 echo "Guessing 50." >&4
19737 echo 'NSIG 50' > signal.nsg
19739 : Now look at all the signal names, one at a time.
19740 for xx in `echo $xxx | $tr ' ' $trnl | $sort | $uniq`; do
19741 $cat > signal.c <<EOCP
19742 #include <sys/types.h>
19743 #include <signal.h>
19746 printf("$xx %d\n", SIG${xx});
19751 if eval $compile; then
19752 echo "SIG${xx} found."
19753 $run ./signal$_exe >> signal.ls1
19755 echo "SIG${xx} NOT found."
19758 if $test -s signal.ls1; then
19759 $cat signal.nsg signal.ls1 |
19760 $sort -n | $uniq | $awk -f signal.awk >signal.lst
19764 if $test -s signal.lst; then
19767 echo "(AAK! I can't compile the test programs -- Guessing)" >&4
19768 echo 'kill -l' >signal
19769 set X `csh -f <signal`
19773 0) set HUP INT QUIT ILL TRAP ABRT EMT FPE KILL BUS SEGV SYS PIPE ALRM TERM;;
19775 echo $@ | $tr ' ' $trnl | \
19776 $awk '{ printf "%s %d\n", $1, ++s; }
19777 END { printf "NSIG %d\n", ++s }' >signal.lst
19779 $rm -f signal.c signal$_exe signal$_o signal.nsg signal.ls1
19781 chmod a+x signal_cmd
19782 $eunicefix signal_cmd
19784 : generate list of signal names
19786 case "$sig_name_init" in
19788 *) case "$sig_num_init" in
19789 ''|*,*) doinit=yes ;;
19794 echo "Generating a list of signal names and numbers..." >&4
19796 sig_count=`$awk '/^NSIG/ { printf "%d", $2 }' signal.lst`
19797 sig_name=`$awk 'BEGIN { printf "ZERO " }
19798 !/^NSIG/ { printf "%s ", $1 }' signal.lst`
19799 sig_num=`$awk 'BEGIN { printf "0 " }
19800 !/^NSIG/ { printf "%d ", $2 }' signal.lst`
19801 sig_name_init=`$awk 'BEGIN { printf "\"ZERO\", " }
19802 !/^NSIG/ { printf "\"%s\", ", $1 }
19803 END { printf "0\n" }' signal.lst`
19804 sig_num_init=`$awk 'BEGIN { printf "0, " }
19805 !/^NSIG/ { printf "%d, ", $2}
19806 END { printf "0\n"}' signal.lst`
19809 echo "The following $sig_count signals are available:"
19811 echo $sig_name | $awk \
19812 'BEGIN { linelen = 0 }
19814 for (i = 1; i <= NF; i++) {
19815 name = "SIG" $i " "
19816 linelen = linelen + length(name)
19817 if (linelen > 70) {
19819 linelen = length(name)
19825 sig_size=`echo $sig_name | awk '{print NF}'`
19826 $rm -f signal signal.c signal.awk signal.lst signal_cmd
19829 case "$sizetype" in
19830 *_t) zzz="$sizetype" ;;
19831 *) zzz="filesize" ;;
19833 echo "Checking the size of $zzz..." >&4
19835 #include <sys/types.h>
19837 #$i_stdlib I_STDLIB
19839 #include <stdlib.h>
19842 printf("%d\n", (int)sizeof($sizetype));
19847 if eval $compile_ok; then
19851 echo "(I can't execute the test program--guessing $sizesize.)" >&4
19854 echo "Your $zzz size is $sizesize bytes."
19859 echo "(I can't compile the test program--guessing $sizesize.)" >&4
19863 : check for socklen_t
19865 echo "Checking to see if you have socklen_t..." >&4
19867 #include <sys/types.h>
19868 #$d_socket HAS_SOCKET
19870 #include <sys/socket.h>
19872 int main() { socklen_t x = 16; }
19875 if eval $compile; then
19877 echo "You have socklen_t."
19880 echo "You do not have socklen_t."
19881 case "$sizetype" in
19882 size_t) echo "(You do have size_t, that might work. Some people are happy with just an int.)" ;;
19889 : see if this is a socks.h system
19890 set socks.h i_socks
19893 : check for type of the size argument to socket calls
19894 case "$d_socket" in
19898 Checking to see what type is the last argument of accept().
19901 case "$d_socklen_t" in
19902 "$define") yyy="$yyy socklen_t"
19904 yyy="$yyy $sizetype int long unsigned"
19905 for xxx in $yyy; do
19906 case "$socksizetype" in
19907 '') try="extern int accept(int, struct sockaddr *, $xxx *);"
19908 case "$usesocks" in
19910 if ./protochk "$try" $i_systypes sys/types.h $d_socket sys/socket.h literal '#define INCLUDE_PROTOTYPES' $i_socks socks.h.; then
19911 echo "Your system accepts '$xxx *' for the last argument of accept()."
19912 socksizetype="$xxx"
19915 *) if ./protochk "$try" $i_systypes sys/types.h $d_socket sys/socket.h; then
19916 echo "Your system accepts '$xxx *' for the last argument of accept()."
19917 socksizetype="$xxx"
19924 : In case none of those worked, prompt the user.
19925 case "$socksizetype" in
19926 '') rp='What is the type for socket address structure sizes?'
19933 *) : no sockets, so pick relatively harmless default
19938 : see what type is used for signed size_t
19939 set ssize_t ssizetype int stdio.h sys/types.h
19944 #$i_stdlib I_STDLIB
19946 #include <stdlib.h>
19948 #include <sys/types.h>
19949 #define Size_t $sizetype
19950 #define SSize_t $dflt
19953 if (sizeof(Size_t) == sizeof(SSize_t))
19955 else if (sizeof(Size_t) == sizeof(int))
19964 if eval $compile_ok && $run ./try > /dev/null; then
19965 ssizetype=`$run ./try`
19966 echo "I'll be using $ssizetype for functions returning a byte count." >&4
19969 Help! I can't compile and run the ssize_t test program: please enlighten me!
19970 (This is probably a misconfiguration in your system or libraries, and
19971 you really ought to fix it. Still, I'll try anyway.)
19973 I need a type that is the same size as $sizetype, but is guaranteed to
19974 be signed. Common values are ssize_t, int and long.
19977 rp="What signed type is the same size as $sizetype?"
19983 : see what type of char stdio uses.
19985 echo '#include <stdio.h>' > stdio.c
19986 $cppstdin $cppminus < stdio.c > stdioh
19987 if $contains 'unsigned.*char.*_ptr;' stdioh >/dev/null 2>&1 ; then
19988 echo "Your stdio uses unsigned chars." >&4
19989 stdchar="unsigned char"
19991 echo "Your stdio uses signed chars." >&4
19994 $rm -f stdio.* stdioh
19996 : see what type uids are declared as in the kernel
19998 echo "Looking for the type for user ids returned by getuid()."
19999 set uid_t uidtype xxx stdio.h sys/types.h
20003 xxx=`./findhdr sys/user.h`
20004 set `grep '_ruid;' "$xxx" 2>/dev/null` unsigned short
20006 unsigned) dflt="$1 $2" ;;
20010 *) dflt="$uidtype";;
20013 uid_t) echo "uid_t found." ;;
20014 *) rp="What is the type for user ids returned by getuid()?"
20022 *_t) zzz="$uidtype" ;;
20025 echo "Checking the size of $zzz..." >&4
20027 #include <sys/types.h>
20029 #$i_stdlib I_STDLIB
20031 #include <stdlib.h>
20034 printf("%d\n", (int)sizeof($uidtype));
20039 if eval $compile_ok; then
20043 echo "(I can't execute the test program--guessing $uidsize.)" >&4
20046 echo "Your $zzz is $uidsize bytes long."
20051 echo "(I can't compile the test program--guessing $uidsize.)" >&4
20056 *_t) zzz="$uidtype" ;;
20059 echo "Checking the sign of $zzz..." >&4
20061 #include <sys/types.h>
20072 if eval $compile; then
20076 echo "(I can't execute the test program--guessing unsigned.)" >&4
20080 1) echo "Your $zzz is unsigned." ;;
20081 -1) echo "Your $zzz is signed." ;;
20087 echo "(I can't compile the test program--guessing unsigned.)" >&4
20093 $echo "Checking the format string to be used for uids..." >&4
20096 -1) if $test X"$uidsize" = X"$ivsize"; then
20097 uidformat="$ivdformat"
20099 if $test X"$uidsize" = X"$longsize"; then
20102 if $test X"$uidsize" = X"$intsize"; then
20105 if $test X"$uidsize" = X"$shortsize"; then
20112 *) if $test X"$uidsize" = X"$uvsize"; then
20113 uidformat="$uvuformat"
20115 if $test X"$uidsize" = X"$longsize"; then
20118 if $test X"$uidsize" = X"$intsize"; then
20121 if $test X"$uidsize" = X"$shortsize"; then
20131 case "$usesitecustomize" in
20132 $define|true|[Yy]*)
20133 usesitecustomize="$define"
20136 usesitecustomize="$undef"
20140 : determine compiler compiler
20149 if $test -f "$byacc$_exe"; then
20151 comp="byacc or $comp"
20153 if $test -f "$bison$_exe"; then
20154 comp="$comp or bison -y"
20156 rp="Which compiler compiler ($comp) shall I use?"
20165 echo "(Adding -y option to bison to get yacc-compatible behaviour.)"
20171 : see if this is a fp.h system
20175 : see if this is a fp_class.h system
20176 set fp_class.h i_fp_class
20179 : see if this is a ieeefp.h system
20180 case "$i_ieeefp" in
20181 '' ) set ieeefp.h i_ieeefp
20186 : see if this is a libutil.h system
20187 set libutil.h i_libutil
20190 : see if mach cthreads are available
20191 if test "X$usethreads" = "X$define"; then
20192 set mach/cthreads.h i_machcthr
20195 i_machcthr="$undef"
20200 : see if this is a mntent.h system
20201 set mntent.h i_mntent
20204 : see if ndbm.h is available
20210 # Some Linux distributions such as RedHat 7.1 put the
20211 # ndbm.h header in /usr/include/gdbm/ndbm.h.
20212 if $test -f /usr/include/gdbm/ndbm.h; then
20213 echo '<gdbm/ndbm.h> found.'
20214 ccflags="$ccflags -I/usr/include/gdbm"
20215 cppflags="$cppflags -I/usr/include/gdbm"
20223 : see if dbm_open exists
20224 set dbm_open d_dbm_open
20226 case "$d_dbm_open" in
20229 echo "We won't be including <ndbm.h>"
20238 : see if net/errno.h is available
20240 set net/errno.h val
20243 : Unfortunately, it causes problems on some systems. Arrgh.
20246 cat > try.c <<'EOM'
20249 #include <net/errno.h>
20255 if $cc $ccflags -c try.c >/dev/null 2>&1; then
20256 echo "We'll be including <net/errno.h>." >&4
20258 echo "We won't be including <net/errno.h>." >&4
20267 : see if netinet/tcp.h is available
20268 set netinet/tcp.h i_netinettcp
20271 : see if this is a poll.h system
20275 : see if this is a prot.h system
20280 $echo "Guessing which symbols your C compiler and preprocessor define..." >&4
20281 $cat <<'EOSH' > Cppsym.know
20282 a29k ABI64 aegis AES_SOURCE AIX AIX32 AIX370
20283 AIX41 AIX42 AIX43 AIX_SOURCE aixpc ALL_SOURCE
20284 alliant alpha am29000 AM29000 AMD64 amd64 amiga AMIGAOS AMIX
20285 ansi ANSI_C_SOURCE apollo ardent ARM32 atarist att386 att3b
20286 BeOS BIG_ENDIAN BIT_MSF bsd BSD bsd43 bsd4_2 bsd4_3 BSD4_3 bsd4_4
20287 BSD_4_3 BSD_4_4 BSD_NET2 BSD_TIME BSD_TYPES BSDCOMPAT bsdi
20288 bull c cadmus clipper CMU COFF COMPILER_VERSION
20289 concurrent convex cpu cray CRAY CRAYMPP ctix CX_UX
20290 CYGWIN DECC DGUX DGUX_SOURCE DJGPP dmert DOLPHIN DPX2 DSO
20291 Dynix DynixPTX ELF encore EPI EXTENSIONS FAVOR_BSD
20292 FILE_OFFSET_BITS FreeBSD GCC_NEW_VARARGS gcos gcx gimpel
20294 GNU_SOURCE GNUC GNUC_MINOR GNU_LIBRARY GO32 gould GOULD_PN
20295 H3050R H3050RX hbullx20 hcx host_mips
20296 hp200 hp300 hp700 HP700 hp800 hp9000
20297 hp9000s200 hp9000s300 hp9000s400 hp9000s500
20298 hp9000s700 hp9000s800 hp9k8 hp_osf hppa hpux HPUX_SOURCE
20299 i186 i286 i386 i486 i586 i686 i8086 i80960 i860 I960
20300 IA64 iAPX286 ibm ibm032 ibmesa IBMR2 ibmrt ILP32 ILP64
20301 INLINE_INTRINSICS INTRINSICS INT64 interdata is68k ksr1
20302 LANGUAGE_C LARGE_FILE_API LARGEFILE64_SOURCE
20303 LARGEFILE_SOURCE LFS64_LARGEFILE LFS_LARGEFILE
20304 Linux LITTLE_ENDIAN LONG64 LONG_DOUBLE LONG_LONG
20305 LONGDOUBLE LONGLONG LP64 luna luna88k Lynx
20306 M68000 m68k m88100 m88k M88KBCS_TARGET M_COFF
20307 M_I186 M_I286 M_I386 M_I8086 M_I86 M_I86SM M_SYS3
20308 M_SYS5 M_SYSIII M_SYSV M_UNIX M_XENIX MACH machine MachTen
20309 MATH_HAS_NO_SIDE_EFFECTS
20310 mc300 mc500 mc68000 mc68010 mc68020 mc68030 mc68040
20311 mc68060 mc68k mc68k32 mc700 mc88000 mc88100 merlin
20312 mert MiNT mips MIPS_FPSET MIPS_ISA MIPS_SIM MIPS_SZINT
20313 MIPS_SZLONG MIPS_SZPTR MIPSEB MIPSEL MODERN_C motorola
20314 mpeix MSDOS MTXINU MULTIMAX mvs MVS n16 ncl_el ncl_mr
20315 NetBSD news1500 news1700 news1800 news1900 news3700
20316 news700 news800 news900 NeXT NLS nonstopux ns16000 ns32000
20317 ns32016 ns32332 ns32k nsc32000
20318 OCS88 OEMVS OpenBSD os OS2 OS390 osf OSF1 OSF_SOURCE
20319 pa_risc PA_RISC1_1 PA_RISC2_0 PARAGON parisc
20320 pc532 pdp11 PGC PIC plexus PORTAR posix
20321 POSIX1B_SOURCE POSIX2_SOURCE POSIX4_SOURCE
20322 POSIX_C_SOURCE POSIX_SOURCE POWER
20323 PROTOTYPES PWB pyr QNX R3000 REENTRANT RES Rhapsody RISC6000
20324 riscix riscos RT S390 SA110 scs SCO sequent sgi SGI_SOURCE SH3 sinix
20325 SIZE_INT SIZE_LONG SIZE_PTR SOCKET_SOURCE SOCKETS_SOURCE
20326 sony sony_news sonyrisc sparc sparclite spectrum
20327 stardent stdc STDC_EXT stratos sun sun3 sun386
20328 Sun386i svr3 svr4 SVR4_2 SVR4_SOURCE svr5
20329 SX system SYSTYPE_BSD SYSTYPE_BSD43 SYSTYPE_BSD44
20330 SYSTYPE_SVR4 SYSTYPE_SVR5 SYSTYPE_SYSV SYSV SYSV3 SYSV4 SYSV5
20331 sysV68 sysV88 Tek4132 Tek4300 titan
20332 TM3200 TM5400 TM5600
20333 tower tower32 tower32_200 tower32_600 tower32_700
20334 tower32_800 tower32_850 tss
20335 u370 u3b u3b2 u3b20 u3b200 u3b20d u3b5
20336 ultrix UMAXV UnicomPBB UnicomPBD UNICOS UNICOSMK
20337 unix UNIX95 UNIX99 unixpc unos
20338 USE_BSD USE_FILE_OFFSET64 USE_GNU USE_ISOC9X USE_LARGEFILE USE_LARGEFILE64
20339 USE_MISC USE_POSIX USE_POSIX199309 USE_POSIX199506 USE_POSIX2
20340 USE_REENTRANT USE_SVID USE_UNIX98 USE_XOPEN USE_XOPEN_EXTENDED
20342 Utek UTek UTS UWIN uxpm uxps vax venix VMESA vms x86_64 xenix Xenix286
20343 XOPEN_SOURCE XOPEN_SOURCE_EXTENDED XPG2 XPG2_EXTENDED
20344 XPG3 XPG3_EXTENDED XPG4 XPG4_EXTENDED
20347 # Maybe put other stuff here too.
20348 cat <<EOSH >>Cppsym.know
20351 ./tr '[a-z]' '[A-Z]' < Cppsym.know > Cppsym.a
20352 ./tr '[A-Z]' '[a-z]' < Cppsym.know > Cppsym.b
20353 $cat Cppsym.know > Cppsym.c
20354 $cat Cppsym.a Cppsym.b Cppsym.c | $tr ' ' $trnl | $sort | $uniq > Cppsym.know
20355 $rm -f Cppsym.a Cppsym.b Cppsym.c
20356 cat <<EOSH > Cppsym
20358 if $test \$# -gt 0; then
20359 echo \$* | $tr " " "$trnl" | ./Cppsym.try > Cppsym.got
20360 if $test -s Cppsym.got; then
20367 $tr " " "$trnl" | ./Cppsym.try
20373 cat <<EOSH > Cppsym.try
20375 cat <<'EOCP' > try.c
20378 #define STRINGIFY(a) "a"
20380 #if cpp_stuff == 42
20381 #define StGiFy(a) #a
20382 #define STRINGIFY(a) StGiFy(a)
20384 #if $cpp_stuff != 1 && $cpp_stuff != 42
20385 # include "Bletch: How does this C preprocessor stringify macros?"
20391 cat <<'EOSH' >> Cppsym.try
20393 printf "#ifdef %s\nprintf(\"%s=%%s\\n\", STRINGIFY(%s));\n#endif\n", $1, $1, $1
20394 printf "#ifdef _%s\nprintf(\"_%s=%%s\\n\", STRINGIFY(_%s));\n#endif\n", $1, $1, $1
20395 printf "#ifdef __%s\nprintf(\"__%s=%%s\\n\", STRINGIFY(__%s));\n#endif\n", $1, $1, $1
20396 printf "#ifdef __%s__\nprintf(\"__%s__=%%s\\n\", STRINGIFY(__%s__));\n#endif\n", $1, $1, $1
20398 echo 'return 0;}' >> try.c
20400 cat <<EOSH >> Cppsym.try
20402 case "$osname-$gccversion" in
20403 irix-) ccflags="\$ccflags -woff 1178" ;;
20404 os2-*) ccflags="\$ccflags -Zlinker /PM:VIO" ;;
20406 $cc -o try -Dcpp_stuff=$cpp_stuff $optimize \$ccflags $ldflags try.c $libs && $run ./try | $sed 's/ /\\\\ /g'
20408 chmod +x Cppsym.try
20409 $eunicefix Cppsym.try
20410 ./Cppsym < Cppsym.know > Cppsym.true
20411 : Add in any linux cpp "predefined macros":
20412 case "$osname::$gccversion" in
20415 rm -f $tHdrH'.h' $tHdrH
20417 if cpp -dM $tHdrH'.h' > $tHdrH'_cppsym.h' && [ -s $tHdrH'_cppsym.h' ]; then
20418 sed 's/#define[\ \ ]*//;s/[\ \ ].*$//' <$tHdrH'_cppsym.h' >$tHdrH'_cppsym.real'
20419 if [ -s $tHdrH'_cppsym.real' ]; then
20420 cat $tHdrH'_cppsym.real' Cppsym.know | sort | uniq | ./Cppsym | sort | uniq > Cppsym.true
20423 rm -f $tHdrH'.h' $tHdrH'_cppsym.h' $tHdrH'_cppsym.real'
20426 : now check the C compiler for additional symbols
20427 postprocess_cc_v=''
20429 aix) postprocess_cc_v="|$tr , ' '" ;;
20436 for i in \`$cc -v -c tmp.c 2>&1 $postprocess_cc_v\`
20439 -D*) echo "\$i" | $sed 's/^-D//';;
20440 -A*) $test "$gccversion" && echo "\$i" | $sed 's/^-A//' | $sed 's/\(.*\)(\(.*\))/\1=\2/';;
20445 postprocess_cc_v=''
20448 ./ccsym > ccsym1.raw
20449 if $test -s ccsym1.raw; then
20450 $sort ccsym1.raw | $uniq >ccsym.raw
20452 mv ccsym1.raw ccsym.raw
20455 $awk '/\=/ { print $0; next }
20456 { print $0"=1" }' ccsym.raw >ccsym.list
20457 $comm -13 Cppsym.true ccsym.list >ccsym.own
20458 $comm -12 Cppsym.true ccsym.list >ccsym.com
20459 $comm -23 Cppsym.true ccsym.list >ccsym.cpp
20461 if $test -z ccsym.raw; then
20462 echo "Your C compiler doesn't seem to define any symbols!" >&4
20464 echo "However, your C preprocessor defines the following symbols:"
20467 cppsymbols=`$cat Cppsym.true`
20468 cppsymbols=`echo $cppsymbols`
20469 cppccsymbols="$cppsymbols"
20471 if $test -s ccsym.com; then
20472 echo "Your C compiler and pre-processor define these symbols:"
20473 $sed -e 's/\(..*\)=.*/\1/' ccsym.com
20476 cppccsymbols=`$cat ccsym.com`
20477 cppccsymbols=`echo $cppccsymbols`
20478 $test "$silent" || sleep 1
20480 if $test -s ccsym.cpp; then
20481 $test "$also" && echo " "
20482 echo "Your C pre-processor ${also}defines the following symbols:"
20483 $sed -e 's/\(..*\)=.*/\1/' ccsym.cpp
20485 cppsymbols=`$cat ccsym.cpp`
20486 cppsymbols=`echo $cppsymbols`
20487 $test "$silent" || sleep 1
20489 if $test -s ccsym.own; then
20490 $test "$also" && echo " "
20491 echo "Your C compiler ${also}defines the following cpp symbols:"
20492 $sed -e 's/\(..*\)=1/\1/' ccsym.own
20493 $sed -e 's/\(..*\)=.*/\1/' ccsym.own | $uniq >>Cppsym.true
20494 ccsymbols=`$cat ccsym.own`
20495 ccsymbols=`echo $ccsymbols`
20496 $test "$silent" || sleep 1
20500 : see if this is a termio system
20504 if $test `./findhdr termios.h`; then
20505 set tcsetattr i_termios
20511 "$define") echo "You have POSIX termios.h... good!" >&4;;
20512 *) if ./Cppsym pyr; then
20513 case "`/bin/universe`" in
20514 ucb) if $test `./findhdr sgtty.h`; then
20516 echo "<sgtty.h> found." >&4
20518 echo "System is pyramid with BSD universe."
20519 echo "<sgtty.h> not found--you could have problems." >&4
20521 *) if $test `./findhdr termio.h`; then
20523 echo "<termio.h> found." >&4
20525 echo "System is pyramid with USG universe."
20526 echo "<termio.h> not found--you could have problems." >&4
20530 if $test `./findhdr termio.h`; then
20531 echo "<termio.h> found." >&4
20533 elif $test `./findhdr sgtty.h`; then
20534 echo "<sgtty.h> found." >&4
20537 echo "Neither <termio.h> nor <sgtty.h> found--you could have problems." >&4
20540 if $test `./findhdr sgtty.h`; then
20541 echo "<sgtty.h> found." >&4
20543 elif $test `./findhdr termio.h`; then
20544 echo "<termio.h> found." >&4
20547 echo "Neither <sgtty.h> nor <termio.h> found--you could have problems." >&4
20551 set i_termio; eval $setvar
20552 val=$val2; set i_sgtty; eval $setvar
20553 val=$val3; set i_termios; eval $setvar
20555 : see if stddef is available
20556 set stddef.h i_stddef
20559 : see if this is a sunmath.h system
20560 set sunmath.h i_sunmath
20563 : see if sys/access.h is available
20564 set sys/access.h i_sysaccess
20567 : see if ioctl defs are in sgtty, termio, sys/filio or sys/ioctl
20568 set sys/filio.h i_sysfilio
20571 if $test `./findhdr sys/ioctl.h`; then
20573 echo '<sys/ioctl.h> found.' >&4
20576 if $test $i_sysfilio = "$define"; then
20577 echo '<sys/ioctl.h> NOT found.' >&4
20579 $test $i_sgtty = "$define" && xxx="sgtty.h"
20580 $test $i_termio = "$define" && xxx="termio.h"
20581 $test $i_termios = "$define" && xxx="termios.h"
20582 echo "No <sys/ioctl.h> found, assuming ioctl args are defined in <$xxx>." >&4
20588 : see if socket ioctl defs are in sys/sockio.h
20590 xxx=`./findhdr sys/sockio.h`
20591 if $test "$xxx"; then
20592 if $contains SIOCATMARK $xxx >/dev/null 2>&1; then
20594 echo "You have socket ioctls defined in <sys/sockio.h>." >&4
20597 echo "No socket ioctls found in <sys/sockio.h>." >&4
20602 <sys/sockio.h> not found, assuming socket ioctls are in <sys/ioctl.h>.
20609 : see if this is a syslog.h system
20610 set syslog.h i_syslog
20614 : see if this is a sys/mode.h system
20615 set sys/mode.h i_sysmode
20618 : see if sys/resource.h has to be included
20619 set sys/resource.h i_sysresrc
20622 : see if sys/security.h is available
20623 set sys/security.h i_syssecrt
20626 : see if this is a sys/statvfs.h system
20627 set sys/statvfs.h i_sysstatvfs
20630 : see if this is a sys/un.h system
20631 set sys/un.h i_sysun
20635 : see if this is a sys/utsname.h system
20636 set sys/utsname.h i_sysutsname
20639 : see if this is a syswait system
20640 set sys/wait.h i_syswait
20643 : see if this is a ustat.h system
20644 set ustat.h i_ustat
20647 : see if this is an utime system
20648 set utime.h i_utime
20651 : see if this is a values.h system
20652 set values.h i_values
20655 : see if this is a vfork system
20658 set vfork.h i_vfork
20666 : see if gdbm.h is available
20671 : see if gdbm_open exists
20672 set gdbm_open d_gdbm_open
20674 case "$d_gdbm_open" in
20677 echo "We won't be including <gdbm.h>"
20687 echo "Looking for extensions..." >&4
20688 : If we are using the old config.sh, known_extensions may contain
20689 : old or inaccurate or duplicate values.
20690 known_extensions=''
20691 nonxs_extensions=''
20692 : We do not use find because it might not be available.
20693 : We do not just use MANIFEST because the user may have dropped
20694 : some additional extensions into the source tree and expect them
20697 : Function to recursively find available extensions, ignoring DynaLoader
20698 : NOTE: recursion limit of 10 to prevent runaway in case of symlink madness
20702 DynaLoader|dynaload) ;;
20704 if $test -f $xxx/$xxx.xs; then
20705 known_extensions="$known_extensions $1$xxx";
20706 elif $test -f $xxx/Makefile.PL; then
20707 nonxs_extensions="$nonxs_extensions $1$xxx";
20709 if $test -d $xxx -a $# -lt 10; then
20712 eval $find_extensions;
20724 eval $find_extensions
20725 # Special case: Add in threads/shared since it is not picked up by the
20726 # recursive find above (and adding in general recursive finding breaks
20727 # SDBM_File/sdbm). A.D. 10/25/2001.
20728 known_extensions="$known_extensions threads/shared"
20729 set X $nonxs_extensions
20731 nonxs_extensions="$*"
20732 set X $known_extensions
20734 known_extensions="$*"
20737 : Now see which are supported on this system.
20739 for xxx in $known_extensions ; do
20743 $define) avail_ext="$avail_ext $xxx" ;;
20746 GDBM_File|gdbm_fil)
20748 $define) avail_ext="$avail_ext $xxx" ;;
20751 I18N/Langinfo|i18n_lan)
20752 case "$i_langinfo$d_nl_langinfo" in
20753 $define$define) avail_ext="$avail_ext $xxx" ;;
20756 NDBM_File|ndbm_fil)
20759 case "$osname-$use64bitint" in
20762 *-lndbm*) avail_ext="$avail_ext $xxx" ;;
20765 *) avail_ext="$avail_ext $xxx" ;;
20770 ODBM_File|odbm_fil)
20771 case "${i_dbm}${i_rpcsvcdbm}" in
20773 case "$osname-$use64bitint" in
20776 *-ldbm*) avail_ext="$avail_ext $xxx" ;;
20779 *) avail_ext="$avail_ext $xxx" ;;
20785 case "$useposix" in
20786 true|define|y) avail_ext="$avail_ext $xxx" ;;
20790 case "$useopcode" in
20791 true|define|y) avail_ext="$avail_ext $xxx" ;;
20795 case "$d_socket" in
20798 beos) ;; # not unless BONE
20799 *) avail_ext="$avail_ext $xxx" ;;
20804 Sys/Syslog|sys/syslog)
20805 : XXX syslog requires socket
20806 case "$d_socket" in
20807 true|$define|y) avail_ext="$avail_ext $xxx" ;;
20811 case "$usethreads" in
20813 case "$useithreads" in
20814 $undef|false|[nN]*) avail_ext="$avail_ext $xxx" ;;
20818 XS/APItest|xs/apitest)
20819 # This is just for testing. Skip it unless we have dynamic loading.
20822 $define) avail_ext="$avail_ext $xxx" ;;
20825 XS/Typemap|xs/typemap)
20826 # This is just for testing. Skip it unless we have dynamic loading.
20828 $define) avail_ext="$avail_ext $xxx" ;;
20831 threads|threads/shared)
20832 # threads and threads::shared are special cases.
20833 # To stop people from asking "Perl 5.8.0 was supposed
20834 # to have this new fancy threads implementation but my
20835 # perl doesn't have it" and from people trying to
20836 # (re)install the threads module using CPAN.pm and
20837 # CPAN.pm then offering to reinstall Perl 5.8.0,
20838 # the threads.pm and threads/shared.pm will always be
20839 # there, croaking informatively ("you need to rebuild
20840 # all of Perl with threads, sorry") when threads haven't
20841 # been compiled in.
20843 avail_ext="$avail_ext $xxx"
20846 : XXX Do we need a useipcsysv variable here
20847 case "${d_msg}${d_sem}${d_shm}" in
20848 *"${define}"*) avail_ext="$avail_ext $xxx" ;;
20851 *) avail_ext="$avail_ext $xxx"
20860 case "$onlyextensions" in
20862 *) keepextensions=''
20863 echo "You have requested that only certains extensions be included..." >&4
20864 for i in $onlyextensions; do
20865 case " $avail_ext " in
20867 echo "Keeping extension $i."
20868 keepextensions="$keepextensions $i"
20870 *) echo "Ignoring extension $i." ;;
20873 avail_ext="$keepextensions"
20877 case "$noextensions" in
20879 *) keepextensions=''
20880 echo "You have requested that certain extensions be ignored..." >&4
20881 for i in $avail_ext; do
20882 case " $noextensions " in
20883 *" $i "*) echo "Ignoring extension $i." ;;
20884 *) echo "Keeping extension $i.";
20885 keepextensions="$keepextensions $i"
20889 avail_ext="$keepextensions"
20893 : Now see which nonxs extensions are supported on this system.
20894 : For now assume all are.
20896 for xxx in $nonxs_extensions ; do
20898 *) nonxs_ext="$nonxs_ext $xxx"
20910 A number of extensions are supplied with $package. You may choose to
20911 compile these extensions for dynamic loading (the default), compile
20912 them into the $package executable (static loading), or not include
20913 them at all. Answer "none" to include no extensions.
20914 Note that DynaLoader is always built and need not be mentioned here.
20917 case "$dynamic_ext" in
20919 : Exclude those listed in static_ext
20921 for xxx in $avail_ext; do
20922 case " $static_ext " in
20924 *) dflt="$dflt $xxx" ;;
20931 *) dflt="$dynamic_ext"
20932 # Perhaps we are reusing an old out-of-date config.sh.
20935 if test X"$dynamic_ext" != X"$avail_ext"; then
20937 NOTICE: Your previous config.sh list may be incorrect.
20938 The extensions now available to you are
20940 but the default list from your previous config.sh is
20952 rp="What extensions do you wish to load dynamically?"
20955 none) dynamic_ext=' ' ;;
20956 *) dynamic_ext="$ans" ;;
20959 case "$static_ext" in
20961 : Exclude those already listed in dynamic linking
20963 for xxx in $avail_ext; do
20964 case " $dynamic_ext " in
20966 *) dflt="$dflt $xxx" ;;
20973 *) dflt="$static_ext"
20980 rp="What extensions do you wish to load statically?"
20983 none) static_ext=' ' ;;
20984 *) static_ext="$ans" ;;
20989 A number of extensions are supplied with $package. Answer "none"
20990 to include no extensions.
20991 Note that DynaLoader is always built and need not be mentioned here.
20994 case "$static_ext" in
20995 '') dflt="$avail_ext" ;;
20996 *) dflt="$static_ext"
20997 # Perhaps we are reusing an old out-of-date config.sh.
21000 if test X"$static_ext" != X"$avail_ext"; then
21002 NOTICE: Your previous config.sh list may be incorrect.
21003 The extensions now available to you are
21005 but the default list from your previous config.sh is
21014 : Exclude those that are not xs extensions
21018 rp="What extensions do you wish to include?"
21021 none) static_ext=' ' ;;
21022 *) static_ext="$ans" ;;
21027 # Encode is a special case. If we are building Encode as a static
21028 # extension, we need to explicitly list its subextensions as well.
21029 # For other nested extensions, this is handled automatically by
21030 # the appropriate Makefile.PL.
21031 case " $static_ext " in
21032 *" Encode "*) # Add the subextensions of Encode
21034 for xxx in `ls Encode/*/Makefile.PL|awk -F/ '{print $2}'`; do
21035 static_ext="$static_ext Encode/$xxx"
21041 set X $dynamic_ext $static_ext $nonxs_ext
21045 # Sanity check: We require an extension suitable for use with
21046 # AnyDBM_File, as well as Fcntl and IO. (Failure to have these
21047 # should show up as failures in the test suite, but it's helpful to
21048 # catch them now.) The 'extensions' list is normally sorted
21049 # alphabetically, so we need to accept either
21050 # DB_File ... Fcntl ... IO ....
21051 # or something like
21052 # Fcntl ... NDBM_File ... IO ....
21053 case " $extensions" in
21054 *"_File "*" Fcntl "*" IO "*) ;; # DB_File
21055 *" Fcntl "*"_File "*" IO "*) ;; # GDBM_File
21056 *" Fcntl "*" IO "*"_File "*) ;; # NDBM_File
21057 *) echo "WARNING: Extensions DB_File or *DBM_File, Fcntl, and IO not configured." >&4
21058 echo "WARNING: The Perl you are building will be quite crippled." >& 4
21062 : Remove libraries needed only for extensions
21063 : The appropriate ext/Foo/Makefile.PL will add them back in, if necessary.
21064 : The exception is SunOS 4.x, which needs them.
21065 case "${osname}X${osvers}" in
21069 *) case "$usedl" in
21070 $define|true|[yY]*)
21071 set X `echo " $libs " | sed -e 's@ -lndbm @ @' -e 's@ -lgdbm @ @' -e 's@ -ldbm @ @' -e 's@ -ldb @ @'`
21075 *) perllibs="$libs"
21081 : Remove build directory name from cppstdin so it can be used from
21082 : either the present location or the final installed location.
21084 : Get out of the UU directory to get correct path name.
21086 case "$cppstdin" in
21088 echo "Stripping down cppstdin path name"
21094 : end of configuration questions
21096 echo "End of configuration questions."
21099 : back to where it started
21100 if test -d ../UU; then
21104 : configuration may be patched via a 'config.arch' file
21105 if $test -f config.arch; then
21106 echo "I see a config.arch file, loading it."
21110 : configuration may be patched via a 'config.over' file
21111 if $test -f config.over; then
21114 rp='I see a config.over file. Do you wish to load it?'
21117 n*) echo "OK, I'll ignore it.";;
21119 echo "Configuration override changes have been loaded."
21124 : in case they want portability, strip down executable paths
21125 case "$d_portable" in
21128 echo "Stripping down executable paths..." >&4
21129 for file in $loclist $trylist; do
21131 eval $file=`basename $temp`
21136 : create config.sh file
21138 echo "Creating config.sh..." >&4
21139 $spitshell <<EOT >config.sh
21142 # This file was produced by running the Configure script. It holds all the
21143 # definitions figured out by Configure. Should you modify one of these values,
21144 # do not forget to propagate your changes by running "Configure -der". You may
21145 # instead choose to run each of the .SH files by yourself, or "Configure -S".
21148 # Package name : $package
21149 # Source directory : $src
21150 # Configuration time: $cf_time
21151 # Configured by : $cf_by
21152 # Target system : $myuname
21162 Revision='$Revision'
21170 alignbytes='$alignbytes'
21171 ansi2knr='$ansi2knr'
21172 aphostname='$aphostname'
21173 api_revision='$api_revision'
21174 api_subversion='$api_subversion'
21175 api_version='$api_version'
21176 api_versionstring='$api_versionstring'
21179 archlibexp='$archlibexp'
21180 archname64='$archname64'
21181 archname='$archname'
21182 archobjs='$archobjs'
21183 asctime_r_proto='$asctime_r_proto'
21191 byteorder='$byteorder'
21193 castflags='$castflags'
21196 cccdlflags='$cccdlflags'
21197 ccdlflags='$ccdlflags'
21199 ccflags_uselargefiles='$ccflags_uselargefiles'
21201 ccsymbols='$ccsymbols'
21202 ccversion='$ccversion'
21204 cf_email='$cf_email'
21206 charsize='$charsize'
21210 clocktype='$clocktype'
21212 compress='$compress'
21213 contains='$contains'
21217 cpp_stuff='$cpp_stuff'
21218 cppccsymbols='$cppccsymbols'
21219 cppflags='$cppflags'
21221 cppminus='$cppminus'
21223 cppstdin='$cppstdin'
21224 cppsymbols='$cppsymbols'
21225 crypt_r_proto='$crypt_r_proto'
21226 cryptlib='$cryptlib'
21228 ctermid_r_proto='$ctermid_r_proto'
21229 ctime_r_proto='$ctime_r_proto'
21230 d_Gconvert='$d_Gconvert'
21231 d_PRIEUldbl='$d_PRIEUldbl'
21232 d_PRIFUldbl='$d_PRIFUldbl'
21233 d_PRIGUldbl='$d_PRIGUldbl'
21234 d_PRIXU64='$d_PRIXU64'
21235 d_PRId64='$d_PRId64'
21236 d_PRIeldbl='$d_PRIeldbl'
21237 d_PRIfldbl='$d_PRIfldbl'
21238 d_PRIgldbl='$d_PRIgldbl'
21239 d_PRIi64='$d_PRIi64'
21240 d_PRIo64='$d_PRIo64'
21241 d_PRIu64='$d_PRIu64'
21242 d_PRIx64='$d_PRIx64'
21243 d_SCNfldbl='$d_SCNfldbl'
21244 d__fwalk='$d__fwalk'
21245 d_access='$d_access'
21246 d_accessx='$d_accessx'
21249 d_archlib='$d_archlib'
21250 d_asctime_r='$d_asctime_r'
21253 d_attribute_format='$d_attribute_format'
21254 d_attribute_malloc='$d_attribute_malloc'
21255 d_attribute_nonnull='$d_attribute_nonnull'
21256 d_attribute_noreturn='$d_attribute_noreturn'
21257 d_attribute_pure='$d_attribute_pure'
21258 d_attribute_unused='$d_attribute_unused'
21259 d_attribute_warn_unused_result='$d_attribute_warn_unused_result'
21263 d_bsdgetpgrp='$d_bsdgetpgrp'
21264 d_bsdsetpgrp='$d_bsdsetpgrp'
21265 d_builtin_choose_expr='$d_builtin_choose_expr'
21266 d_builtin_expect='$d_builtin_expect'
21268 d_casti32='$d_casti32'
21269 d_castneg='$d_castneg'
21270 d_charvspr='$d_charvspr'
21272 d_chroot='$d_chroot'
21273 d_chsize='$d_chsize'
21275 d_clearenv='$d_clearenv'
21276 d_closedir='$d_closedir'
21277 d_cmsghdr_s='$d_cmsghdr_s'
21279 d_copysignl='$d_copysignl'
21281 d_crypt_r='$d_crypt_r'
21283 d_ctermid_r='$d_ctermid_r'
21284 d_ctime_r='$d_ctime_r'
21285 d_cuserid='$d_cuserid'
21286 d_dbl_dig='$d_dbl_dig'
21287 d_dbminitproto='$d_dbminitproto'
21288 d_difftime='$d_difftime'
21290 d_dirnamlen='$d_dirnamlen'
21291 d_dlerror='$d_dlerror'
21292 d_dlopen='$d_dlopen'
21293 d_dlsymun='$d_dlsymun'
21294 d_dosuid='$d_dosuid'
21295 d_drand48_r='$d_drand48_r'
21296 d_drand48proto='$d_drand48proto'
21298 d_eaccess='$d_eaccess'
21299 d_endgrent='$d_endgrent'
21300 d_endgrent_r='$d_endgrent_r'
21301 d_endhent='$d_endhent'
21302 d_endhostent_r='$d_endhostent_r'
21303 d_endnent='$d_endnent'
21304 d_endnetent_r='$d_endnetent_r'
21305 d_endpent='$d_endpent'
21306 d_endprotoent_r='$d_endprotoent_r'
21307 d_endpwent='$d_endpwent'
21308 d_endpwent_r='$d_endpwent_r'
21309 d_endsent='$d_endsent'
21310 d_endservent_r='$d_endservent_r'
21311 d_eofnblk='$d_eofnblk'
21312 d_eunice='$d_eunice'
21313 d_faststdio='$d_faststdio'
21314 d_fchdir='$d_fchdir'
21315 d_fchmod='$d_fchmod'
21316 d_fchown='$d_fchown'
21318 d_fcntl_can_lock='$d_fcntl_can_lock'
21319 d_fd_macros='$d_fd_macros'
21320 d_fd_set='$d_fd_set'
21321 d_fds_bits='$d_fds_bits'
21322 d_fgetpos='$d_fgetpos'
21323 d_finite='$d_finite'
21324 d_finitel='$d_finitel'
21325 d_flexfnam='$d_flexfnam'
21327 d_flockproto='$d_flockproto'
21329 d_fp_class='$d_fp_class'
21330 d_fpathconf='$d_fpathconf'
21331 d_fpclass='$d_fpclass'
21332 d_fpclassify='$d_fpclassify'
21333 d_fpclassl='$d_fpclassl'
21334 d_fpos64_t='$d_fpos64_t'
21335 d_frexpl='$d_frexpl'
21336 d_fs_data_s='$d_fs_data_s'
21337 d_fseeko='$d_fseeko'
21338 d_fsetpos='$d_fsetpos'
21339 d_fstatfs='$d_fstatfs'
21340 d_fstatvfs='$d_fstatvfs'
21342 d_ftello='$d_ftello'
21344 d_futimes='$d_futimes'
21345 d_getcwd='$d_getcwd'
21346 d_getespwnam='$d_getespwnam'
21347 d_getfsstat='$d_getfsstat'
21348 d_getgrent='$d_getgrent'
21349 d_getgrent_r='$d_getgrent_r'
21350 d_getgrgid_r='$d_getgrgid_r'
21351 d_getgrnam_r='$d_getgrnam_r'
21352 d_getgrps='$d_getgrps'
21353 d_gethbyaddr='$d_gethbyaddr'
21354 d_gethbyname='$d_gethbyname'
21355 d_gethent='$d_gethent'
21356 d_gethname='$d_gethname'
21357 d_gethostbyaddr_r='$d_gethostbyaddr_r'
21358 d_gethostbyname_r='$d_gethostbyname_r'
21359 d_gethostent_r='$d_gethostent_r'
21360 d_gethostprotos='$d_gethostprotos'
21361 d_getitimer='$d_getitimer'
21362 d_getlogin='$d_getlogin'
21363 d_getlogin_r='$d_getlogin_r'
21364 d_getmnt='$d_getmnt'
21365 d_getmntent='$d_getmntent'
21366 d_getnbyaddr='$d_getnbyaddr'
21367 d_getnbyname='$d_getnbyname'
21368 d_getnent='$d_getnent'
21369 d_getnetbyaddr_r='$d_getnetbyaddr_r'
21370 d_getnetbyname_r='$d_getnetbyname_r'
21371 d_getnetent_r='$d_getnetent_r'
21372 d_getnetprotos='$d_getnetprotos'
21373 d_getpagsz='$d_getpagsz'
21374 d_getpbyname='$d_getpbyname'
21375 d_getpbynumber='$d_getpbynumber'
21376 d_getpent='$d_getpent'
21377 d_getpgid='$d_getpgid'
21378 d_getpgrp2='$d_getpgrp2'
21379 d_getpgrp='$d_getpgrp'
21380 d_getppid='$d_getppid'
21381 d_getprior='$d_getprior'
21382 d_getprotobyname_r='$d_getprotobyname_r'
21383 d_getprotobynumber_r='$d_getprotobynumber_r'
21384 d_getprotoent_r='$d_getprotoent_r'
21385 d_getprotoprotos='$d_getprotoprotos'
21386 d_getprpwnam='$d_getprpwnam'
21387 d_getpwent='$d_getpwent'
21388 d_getpwent_r='$d_getpwent_r'
21389 d_getpwnam_r='$d_getpwnam_r'
21390 d_getpwuid_r='$d_getpwuid_r'
21391 d_getsbyname='$d_getsbyname'
21392 d_getsbyport='$d_getsbyport'
21393 d_getsent='$d_getsent'
21394 d_getservbyname_r='$d_getservbyname_r'
21395 d_getservbyport_r='$d_getservbyport_r'
21396 d_getservent_r='$d_getservent_r'
21397 d_getservprotos='$d_getservprotos'
21398 d_getspnam='$d_getspnam'
21399 d_getspnam_r='$d_getspnam_r'
21400 d_gettimeod='$d_gettimeod'
21401 d_gmtime_r='$d_gmtime_r'
21402 d_gnulibc='$d_gnulibc'
21403 d_grpasswd='$d_grpasswd'
21404 d_hasmntopt='$d_hasmntopt'
21406 d_ilogbl='$d_ilogbl'
21408 d_inetaton='$d_inetaton'
21409 d_int64_t='$d_int64_t'
21410 d_isascii='$d_isascii'
21411 d_isfinite='$d_isfinite'
21414 d_isnanl='$d_isnanl'
21415 d_killpg='$d_killpg'
21416 d_lchown='$d_lchown'
21417 d_ldbl_dig='$d_ldbl_dig'
21418 d_libm_lib_version='$d_libm_lib_version'
21420 d_localtime_r='$d_localtime_r'
21421 d_locconv='$d_locconv'
21423 d_longdbl='$d_longdbl'
21424 d_longlong='$d_longlong'
21425 d_lseekproto='$d_lseekproto'
21427 d_madvise='$d_madvise'
21428 d_malloc_good_size='$d_malloc_good_size'
21429 d_malloc_size='$d_malloc_size'
21431 d_mbstowcs='$d_mbstowcs'
21432 d_mbtowc='$d_mbtowc'
21433 d_memchr='$d_memchr'
21434 d_memcmp='$d_memcmp'
21435 d_memcpy='$d_memcpy'
21436 d_memmove='$d_memmove'
21437 d_memset='$d_memset'
21439 d_mkdtemp='$d_mkdtemp'
21440 d_mkfifo='$d_mkfifo'
21441 d_mkstemp='$d_mkstemp'
21442 d_mkstemps='$d_mkstemps'
21443 d_mktime='$d_mktime'
21446 d_modfl_pow32_bug='$d_modfl_pow32_bug'
21447 d_modflproto='$d_modflproto'
21448 d_mprotect='$d_mprotect'
21450 d_msg_ctrunc='$d_msg_ctrunc'
21451 d_msg_dontroute='$d_msg_dontroute'
21452 d_msg_oob='$d_msg_oob'
21453 d_msg_peek='$d_msg_peek'
21454 d_msg_proxy='$d_msg_proxy'
21455 d_msgctl='$d_msgctl'
21456 d_msgget='$d_msgget'
21457 d_msghdr_s='$d_msghdr_s'
21458 d_msgrcv='$d_msgrcv'
21459 d_msgsnd='$d_msgsnd'
21461 d_munmap='$d_munmap'
21462 d_mymalloc='$d_mymalloc'
21464 d_nl_langinfo='$d_nl_langinfo'
21465 d_nv_preserves_uv='$d_nv_preserves_uv'
21466 d_nv_zero_is_allbits_zero='$d_nv_zero_is_allbits_zero'
21467 d_off64_t='$d_off64_t'
21468 d_old_pthread_create_joinable='$d_old_pthread_create_joinable'
21469 d_oldpthreads='$d_oldpthreads'
21470 d_oldsock='$d_oldsock'
21472 d_pathconf='$d_pathconf'
21474 d_perl_otherlibdirs='$d_perl_otherlibdirs'
21475 d_phostname='$d_phostname'
21478 d_portable='$d_portable'
21479 d_procselfexe='$d_procselfexe'
21480 d_pthread_atfork='$d_pthread_atfork'
21481 d_pthread_attr_setscope='$d_pthread_attr_setscope'
21482 d_pthread_yield='$d_pthread_yield'
21484 d_pwchange='$d_pwchange'
21485 d_pwclass='$d_pwclass'
21486 d_pwcomment='$d_pwcomment'
21487 d_pwexpire='$d_pwexpire'
21488 d_pwgecos='$d_pwgecos'
21489 d_pwpasswd='$d_pwpasswd'
21490 d_pwquota='$d_pwquota'
21493 d_random_r='$d_random_r'
21494 d_readdir64_r='$d_readdir64_r'
21495 d_readdir='$d_readdir'
21496 d_readdir_r='$d_readdir_r'
21497 d_readlink='$d_readlink'
21499 d_recvmsg='$d_recvmsg'
21500 d_rename='$d_rename'
21501 d_rewinddir='$d_rewinddir'
21503 d_safebcpy='$d_safebcpy'
21504 d_safemcpy='$d_safemcpy'
21505 d_sanemcmp='$d_sanemcmp'
21506 d_sbrkproto='$d_sbrkproto'
21507 d_scalbnl='$d_scalbnl'
21508 d_sched_yield='$d_sched_yield'
21509 d_scm_rights='$d_scm_rights'
21510 d_seekdir='$d_seekdir'
21511 d_select='$d_select'
21513 d_semctl='$d_semctl'
21514 d_semctl_semid_ds='$d_semctl_semid_ds'
21515 d_semctl_semun='$d_semctl_semun'
21516 d_semget='$d_semget'
21518 d_sendmsg='$d_sendmsg'
21519 d_setegid='$d_setegid'
21520 d_seteuid='$d_seteuid'
21521 d_setgrent='$d_setgrent'
21522 d_setgrent_r='$d_setgrent_r'
21523 d_setgrps='$d_setgrps'
21524 d_sethent='$d_sethent'
21525 d_sethostent_r='$d_sethostent_r'
21526 d_setitimer='$d_setitimer'
21527 d_setlinebuf='$d_setlinebuf'
21528 d_setlocale='$d_setlocale'
21529 d_setlocale_r='$d_setlocale_r'
21530 d_setnent='$d_setnent'
21531 d_setnetent_r='$d_setnetent_r'
21532 d_setpent='$d_setpent'
21533 d_setpgid='$d_setpgid'
21534 d_setpgrp2='$d_setpgrp2'
21535 d_setpgrp='$d_setpgrp'
21536 d_setprior='$d_setprior'
21537 d_setproctitle='$d_setproctitle'
21538 d_setprotoent_r='$d_setprotoent_r'
21539 d_setpwent='$d_setpwent'
21540 d_setpwent_r='$d_setpwent_r'
21541 d_setregid='$d_setregid'
21542 d_setresgid='$d_setresgid'
21543 d_setresuid='$d_setresuid'
21544 d_setreuid='$d_setreuid'
21545 d_setrgid='$d_setrgid'
21546 d_setruid='$d_setruid'
21547 d_setsent='$d_setsent'
21548 d_setservent_r='$d_setservent_r'
21549 d_setsid='$d_setsid'
21550 d_setvbuf='$d_setvbuf'
21554 d_shmatprototype='$d_shmatprototype'
21555 d_shmctl='$d_shmctl'
21557 d_shmget='$d_shmget'
21558 d_sigaction='$d_sigaction'
21559 d_sigprocmask='$d_sigprocmask'
21560 d_sigsetjmp='$d_sigsetjmp'
21561 d_snprintf='$d_snprintf'
21562 d_sockatmark='$d_sockatmark'
21563 d_sockatmarkproto='$d_sockatmarkproto'
21564 d_socket='$d_socket'
21565 d_socklen_t='$d_socklen_t'
21566 d_sockpair='$d_sockpair'
21567 d_socks5_init='$d_socks5_init'
21568 d_sprintf_returns_strlen='$d_sprintf_returns_strlen'
21570 d_srand48_r='$d_srand48_r'
21571 d_srandom_r='$d_srandom_r'
21572 d_sresgproto='$d_sresgproto'
21573 d_sresuproto='$d_sresuproto'
21574 d_statblks='$d_statblks'
21575 d_statfs_f_flags='$d_statfs_f_flags'
21576 d_statfs_s='$d_statfs_s'
21577 d_statvfs='$d_statvfs'
21578 d_stdio_cnt_lval='$d_stdio_cnt_lval'
21579 d_stdio_ptr_lval='$d_stdio_ptr_lval'
21580 d_stdio_ptr_lval_nochange_cnt='$d_stdio_ptr_lval_nochange_cnt'
21581 d_stdio_ptr_lval_sets_cnt='$d_stdio_ptr_lval_sets_cnt'
21582 d_stdio_stream_array='$d_stdio_stream_array'
21583 d_stdiobase='$d_stdiobase'
21584 d_stdstdio='$d_stdstdio'
21585 d_strchr='$d_strchr'
21586 d_strcoll='$d_strcoll'
21587 d_strctcpy='$d_strctcpy'
21588 d_strerrm='$d_strerrm'
21589 d_strerror='$d_strerror'
21590 d_strerror_r='$d_strerror_r'
21591 d_strftime='$d_strftime'
21592 d_strlcat='$d_strlcat'
21593 d_strlcpy='$d_strlcpy'
21594 d_strtod='$d_strtod'
21595 d_strtol='$d_strtol'
21596 d_strtold='$d_strtold'
21597 d_strtoll='$d_strtoll'
21598 d_strtoq='$d_strtoq'
21599 d_strtoul='$d_strtoul'
21600 d_strtoull='$d_strtoull'
21601 d_strtouq='$d_strtouq'
21602 d_strxfrm='$d_strxfrm'
21603 d_suidsafe='$d_suidsafe'
21604 d_symlink='$d_symlink'
21605 d_syscall='$d_syscall'
21606 d_syscallproto='$d_syscallproto'
21607 d_sysconf='$d_sysconf'
21608 d_sysernlst='$d_sysernlst'
21609 d_syserrlst='$d_syserrlst'
21610 d_system='$d_system'
21611 d_tcgetpgrp='$d_tcgetpgrp'
21612 d_tcsetpgrp='$d_tcsetpgrp'
21613 d_telldir='$d_telldir'
21614 d_telldirproto='$d_telldirproto'
21617 d_tm_tm_gmtoff='$d_tm_tm_gmtoff'
21618 d_tm_tm_zone='$d_tm_tm_zone'
21619 d_tmpnam_r='$d_tmpnam_r'
21620 d_truncate='$d_truncate'
21621 d_ttyname_r='$d_ttyname_r'
21622 d_tzname='$d_tzname'
21623 d_u32align='$d_u32align'
21624 d_ualarm='$d_ualarm'
21627 d_union_semun='$d_union_semun'
21628 d_unordered='$d_unordered'
21629 d_unsetenv='$d_unsetenv'
21630 d_usleep='$d_usleep'
21631 d_usleepproto='$d_usleepproto'
21633 d_vendorarch='$d_vendorarch'
21634 d_vendorbin='$d_vendorbin'
21635 d_vendorlib='$d_vendorlib'
21636 d_vendorscript='$d_vendorscript'
21638 d_void_closedir='$d_void_closedir'
21639 d_voidsig='$d_voidsig'
21640 d_voidtty='$d_voidtty'
21641 d_volatile='$d_volatile'
21642 d_vprintf='$d_vprintf'
21643 d_vsnprintf='$d_vsnprintf'
21645 d_waitpid='$d_waitpid'
21646 d_wcstombs='$d_wcstombs'
21647 d_wctomb='$d_wctomb'
21648 d_writev='$d_writev'
21651 db_hashtype='$db_hashtype'
21652 db_prefixtype='$db_prefixtype'
21653 db_version_major='$db_version_major'
21654 db_version_minor='$db_version_minor'
21655 db_version_patch='$db_version_patch'
21656 defvoidused='$defvoidused'
21657 direntrytype='$direntrytype'
21660 doublesize='$doublesize'
21662 drand48_r_proto='$drand48_r_proto'
21663 dynamic_ext='$dynamic_ext'
21669 endgrent_r_proto='$endgrent_r_proto'
21670 endhostent_r_proto='$endhostent_r_proto'
21671 endnetent_r_proto='$endnetent_r_proto'
21672 endprotoent_r_proto='$endprotoent_r_proto'
21673 endpwent_r_proto='$endpwent_r_proto'
21674 endservent_r_proto='$endservent_r_proto'
21675 eunicefix='$eunicefix'
21678 extensions='$extensions'
21680 fflushNULL='$fflushNULL'
21681 fflushall='$fflushall'
21683 firstmakefile='$firstmakefile'
21685 fpossize='$fpossize'
21686 fpostype='$fpostype'
21687 freetype='$freetype'
21690 full_csh='$full_csh'
21691 full_sed='$full_sed'
21692 gccansipedantic='$gccansipedantic'
21693 gccosandvers='$gccosandvers'
21694 gccversion='$gccversion'
21695 getgrent_r_proto='$getgrent_r_proto'
21696 getgrgid_r_proto='$getgrgid_r_proto'
21697 getgrnam_r_proto='$getgrnam_r_proto'
21698 gethostbyaddr_r_proto='$gethostbyaddr_r_proto'
21699 gethostbyname_r_proto='$gethostbyname_r_proto'
21700 gethostent_r_proto='$gethostent_r_proto'
21701 getlogin_r_proto='$getlogin_r_proto'
21702 getnetbyaddr_r_proto='$getnetbyaddr_r_proto'
21703 getnetbyname_r_proto='$getnetbyname_r_proto'
21704 getnetent_r_proto='$getnetent_r_proto'
21705 getprotobyname_r_proto='$getprotobyname_r_proto'
21706 getprotobynumber_r_proto='$getprotobynumber_r_proto'
21707 getprotoent_r_proto='$getprotoent_r_proto'
21708 getpwent_r_proto='$getpwent_r_proto'
21709 getpwnam_r_proto='$getpwnam_r_proto'
21710 getpwuid_r_proto='$getpwuid_r_proto'
21711 getservbyname_r_proto='$getservbyname_r_proto'
21712 getservbyport_r_proto='$getservbyport_r_proto'
21713 getservent_r_proto='$getservent_r_proto'
21714 getspnam_r_proto='$getspnam_r_proto'
21715 gidformat='$gidformat'
21721 gmtime_r_proto='$gmtime_r_proto'
21722 gnulibc_version='$gnulibc_version'
21724 groupcat='$groupcat'
21725 groupstype='$groupstype'
21728 h_sysfile='$h_sysfile'
21731 html1dir='$html1dir'
21732 html1direxp='$html1direxp'
21733 html3dir='$html3dir'
21734 html3direxp='$html3direxp'
21743 i_arpainet='$i_arpainet'
21744 i_bsdioctl='$i_bsdioctl'
21748 i_dirent='$i_dirent'
21754 i_fp_class='$i_fp_class'
21757 i_ieeefp='$i_ieeefp'
21758 i_inttypes='$i_inttypes'
21759 i_langinfo='$i_langinfo'
21760 i_libutil='$i_libutil'
21761 i_limits='$i_limits'
21762 i_locale='$i_locale'
21763 i_machcthr='$i_machcthr'
21764 i_malloc='$i_malloc'
21766 i_memory='$i_memory'
21767 i_mntent='$i_mntent'
21770 i_neterrno='$i_neterrno'
21771 i_netinettcp='$i_netinettcp'
21775 i_pthread='$i_pthread'
21777 i_rpcsvcdbm='$i_rpcsvcdbm'
21780 i_shadow='$i_shadow'
21782 i_stdarg='$i_stdarg'
21783 i_stddef='$i_stddef'
21784 i_stdlib='$i_stdlib'
21785 i_string='$i_string'
21786 i_sunmath='$i_sunmath'
21787 i_sysaccess='$i_sysaccess'
21788 i_sysdir='$i_sysdir'
21789 i_sysfile='$i_sysfile'
21790 i_sysfilio='$i_sysfilio'
21792 i_sysioctl='$i_sysioctl'
21793 i_syslog='$i_syslog'
21794 i_sysmman='$i_sysmman'
21795 i_sysmode='$i_sysmode'
21796 i_sysmount='$i_sysmount'
21797 i_sysndir='$i_sysndir'
21798 i_sysparam='$i_sysparam'
21799 i_sysresrc='$i_sysresrc'
21800 i_syssecrt='$i_syssecrt'
21801 i_sysselct='$i_sysselct'
21802 i_syssockio='$i_syssockio'
21803 i_sysstat='$i_sysstat'
21804 i_sysstatfs='$i_sysstatfs'
21805 i_sysstatvfs='$i_sysstatvfs'
21806 i_systime='$i_systime'
21807 i_systimek='$i_systimek'
21808 i_systimes='$i_systimes'
21809 i_systypes='$i_systypes'
21810 i_sysuio='$i_sysuio'
21812 i_sysutsname='$i_sysutsname'
21813 i_sysvfs='$i_sysvfs'
21814 i_syswait='$i_syswait'
21815 i_termio='$i_termio'
21816 i_termios='$i_termios'
21818 i_unistd='$i_unistd'
21821 i_values='$i_values'
21822 i_varargs='$i_varargs'
21823 i_varhdr='$i_varhdr'
21825 ignore_versioned_solibs='$ignore_versioned_solibs'
21826 inc_version_list='$inc_version_list'
21827 inc_version_list_init='$inc_version_list_init'
21830 installarchlib='$installarchlib'
21831 installbin='$installbin'
21832 installhtml1dir='$installhtml1dir'
21833 installhtml3dir='$installhtml3dir'
21834 installman1dir='$installman1dir'
21835 installman3dir='$installman3dir'
21836 installprefix='$installprefix'
21837 installprefixexp='$installprefixexp'
21838 installprivlib='$installprivlib'
21839 installscript='$installscript'
21840 installsitearch='$installsitearch'
21841 installsitebin='$installsitebin'
21842 installsitehtml1dir='$installsitehtml1dir'
21843 installsitehtml3dir='$installsitehtml3dir'
21844 installsitelib='$installsitelib'
21845 installsiteman1dir='$installsiteman1dir'
21846 installsiteman3dir='$installsiteman3dir'
21847 installsitescript='$installsitescript'
21848 installstyle='$installstyle'
21849 installusrbinperl='$installusrbinperl'
21850 installvendorarch='$installvendorarch'
21851 installvendorbin='$installvendorbin'
21852 installvendorhtml1dir='$installvendorhtml1dir'
21853 installvendorhtml3dir='$installvendorhtml3dir'
21854 installvendorlib='$installvendorlib'
21855 installvendorman1dir='$installvendorman1dir'
21856 installvendorman3dir='$installvendorman3dir'
21857 installvendorscript='$installvendorscript'
21859 issymlink='$issymlink'
21860 ivdformat='$ivdformat'
21863 known_extensions='$known_extensions'
21866 lddlflags='$lddlflags'
21868 ldflags_uselargefiles='$ldflags_uselargefiles'
21869 ldlibpthname='$ldlibpthname'
21876 libsdirs='$libsdirs'
21877 libsfiles='$libsfiles'
21878 libsfound='$libsfound'
21879 libspath='$libspath'
21880 libswanted='$libswanted'
21881 libswanted_uselargefiles='$libswanted_uselargefiles'
21887 localtime_r_proto='$localtime_r_proto'
21888 locincpth='$locincpth'
21889 loclibpth='$loclibpth'
21890 longdblsize='$longdblsize'
21891 longlongsize='$longlongsize'
21892 longsize='$longsize'
21896 lseeksize='$lseeksize'
21897 lseektype='$lseektype'
21902 make_set_make='$make_set_make'
21903 mallocobj='$mallocobj'
21904 mallocsrc='$mallocsrc'
21905 malloctype='$malloctype'
21907 man1direxp='$man1direxp'
21910 man3direxp='$man3direxp'
21912 mips_type='$mips_type'
21913 mistrustnm='$mistrustnm'
21915 mmaptype='$mmaptype'
21916 modetype='$modetype'
21918 multiarch='$multiarch'
21920 myarchname='$myarchname'
21921 mydomain='$mydomain'
21922 myhostname='$myhostname'
21925 need_va_copy='$need_va_copy'
21926 netdb_hlen_type='$netdb_hlen_type'
21927 netdb_host_type='$netdb_host_type'
21928 netdb_name_type='$netdb_name_type'
21929 netdb_net_type='$netdb_net_type'
21932 nm_so_opt='$nm_so_opt'
21933 nonxs_ext='$nonxs_ext'
21935 nvEUformat='$nvEUformat'
21936 nvFUformat='$nvFUformat'
21937 nvGUformat='$nvGUformat'
21938 nv_preserves_uv_bits='$nv_preserves_uv_bits'
21939 nveformat='$nveformat'
21940 nvfformat='$nvfformat'
21941 nvgformat='$nvgformat'
21944 o_nonblock='$o_nonblock'
21946 old_pthread_create_joinable='$old_pthread_create_joinable'
21947 optimize='$optimize'
21948 orderlib='$orderlib'
21951 otherlibdirs='$otherlibdirs'
21955 patchlevel='$patchlevel'
21956 path_sep='$path_sep'
21959 perl_patchlevel='$perl_patchlevel'
21960 perladmin='$perladmin'
21961 perllibs='$perllibs'
21962 perlpath='$perlpath'
21964 phostname='$phostname'
21970 prefixexp='$prefixexp'
21972 privlibexp='$privlibexp'
21973 procselfexe='$procselfexe'
21974 prototype='$prototype'
21976 quadkind='$quadkind'
21977 quadtype='$quadtype'
21978 randbits='$randbits'
21979 randfunc='$randfunc'
21980 random_r_proto='$random_r_proto'
21981 randseedtype='$randseedtype'
21983 rd_nodata='$rd_nodata'
21984 readdir64_r_proto='$readdir64_r_proto'
21985 readdir_r_proto='$readdir_r_proto'
21986 revision='$revision'
21991 sPRIEUldbl='$sPRIEUldbl'
21992 sPRIFUldbl='$sPRIFUldbl'
21993 sPRIGUldbl='$sPRIGUldbl'
21994 sPRIXU64='$sPRIXU64'
21996 sPRIeldbl='$sPRIeldbl'
21997 sPRIfldbl='$sPRIfldbl'
21998 sPRIgldbl='$sPRIgldbl'
22003 sSCNfldbl='$sSCNfldbl'
22004 sched_yield='$sched_yield'
22005 scriptdir='$scriptdir'
22006 scriptdirexp='$scriptdirexp'
22008 seedfunc='$seedfunc'
22009 selectminbits='$selectminbits'
22010 selecttype='$selecttype'
22011 sendmail='$sendmail'
22012 setgrent_r_proto='$setgrent_r_proto'
22013 sethostent_r_proto='$sethostent_r_proto'
22014 setlocale_r_proto='$setlocale_r_proto'
22015 setnetent_r_proto='$setnetent_r_proto'
22016 setprotoent_r_proto='$setprotoent_r_proto'
22017 setpwent_r_proto='$setpwent_r_proto'
22018 setservent_r_proto='$setservent_r_proto'
22021 sharpbang='$sharpbang'
22022 shmattype='$shmattype'
22023 shortsize='$shortsize'
22026 sig_count='$sig_count'
22027 sig_name='$sig_name'
22028 sig_name_init='$sig_name_init'
22030 sig_num_init='$sig_num_init'
22031 sig_size='$sig_size'
22032 signal_t='$signal_t'
22033 sitearch='$sitearch'
22034 sitearchexp='$sitearchexp'
22036 sitebinexp='$sitebinexp'
22037 sitehtml1dir='$sitehtml1dir'
22038 sitehtml1direxp='$sitehtml1direxp'
22039 sitehtml3dir='$sitehtml3dir'
22040 sitehtml3direxp='$sitehtml3direxp'
22042 sitelib_stem='$sitelib_stem'
22043 sitelibexp='$sitelibexp'
22044 siteman1dir='$siteman1dir'
22045 siteman1direxp='$siteman1direxp'
22046 siteman3dir='$siteman3dir'
22047 siteman3direxp='$siteman3direxp'
22048 siteprefix='$siteprefix'
22049 siteprefixexp='$siteprefixexp'
22050 sitescript='$sitescript'
22051 sitescriptexp='$sitescriptexp'
22052 sizesize='$sizesize'
22053 sizetype='$sizetype'
22057 sockethdr='$sockethdr'
22058 socketlib='$socketlib'
22059 socksizetype='$socksizetype'
22061 spackage='$spackage'
22062 spitshell='$spitshell'
22063 srand48_r_proto='$srand48_r_proto'
22064 srandom_r_proto='$srandom_r_proto'
22066 ssizetype='$ssizetype'
22067 startperl='$startperl'
22069 static_ext='$static_ext'
22071 stdio_base='$stdio_base'
22072 stdio_bufsiz='$stdio_bufsiz'
22073 stdio_cnt='$stdio_cnt'
22074 stdio_filbuf='$stdio_filbuf'
22075 stdio_ptr='$stdio_ptr'
22076 stdio_stream_array='$stdio_stream_array'
22077 strerror_r_proto='$strerror_r_proto'
22080 subversion='$subversion'
22084 targetarch='$targetarch'
22088 timeincl='$timeincl'
22089 timetype='$timetype'
22090 tmpnam_r_proto='$tmpnam_r_proto'
22096 ttyname_r_proto='$ttyname_r_proto'
22105 uidformat='$uidformat'
22111 uquadtype='$uquadtype'
22112 use5005threads='$use5005threads'
22113 use64bitall='$use64bitall'
22114 use64bitint='$use64bitint'
22115 usecrosscompile='$usecrosscompile'
22117 usefaststdio='$usefaststdio'
22118 useithreads='$useithreads'
22119 uselargefiles='$uselargefiles'
22120 uselongdouble='$uselongdouble'
22121 usemallocwrap='$usemallocwrap'
22122 usemorebits='$usemorebits'
22123 usemultiplicity='$usemultiplicity'
22124 usemymalloc='$usemymalloc'
22126 useopcode='$useopcode'
22127 useperlio='$useperlio'
22128 useposix='$useposix'
22129 usereentrant='$usereentrant'
22130 userelocatableinc='$userelocatableinc'
22132 useshrplib='$useshrplib'
22133 usesitecustomize='$usesitecustomize'
22134 usesocks='$usesocks'
22135 usethreads='$usethreads'
22136 usevendorprefix='$usevendorprefix'
22137 usevfork='$usevfork'
22140 uvXUformat='$uvXUformat'
22141 uvoformat='$uvoformat'
22144 uvuformat='$uvuformat'
22145 uvxformat='$uvxformat'
22146 vendorarch='$vendorarch'
22147 vendorarchexp='$vendorarchexp'
22148 vendorbin='$vendorbin'
22149 vendorbinexp='$vendorbinexp'
22150 vendorhtml1dir='$vendorhtml1dir'
22151 vendorhtml1direxp='$vendorhtml1direxp'
22152 vendorhtml3dir='$vendorhtml3dir'
22153 vendorhtml3direxp='$vendorhtml3direxp'
22154 vendorlib='$vendorlib'
22155 vendorlib_stem='$vendorlib_stem'
22156 vendorlibexp='$vendorlibexp'
22157 vendorman1dir='$vendorman1dir'
22158 vendorman1direxp='$vendorman1direxp'
22159 vendorman3dir='$vendorman3dir'
22160 vendorman3direxp='$vendorman3direxp'
22161 vendorprefix='$vendorprefix'
22162 vendorprefixexp='$vendorprefixexp'
22163 vendorscript='$vendorscript'
22164 vendorscriptexp='$vendorscriptexp'
22166 version_patchlevel_string='$version_patchlevel_string'
22167 versiononly='$versiononly'
22169 voidflags='$voidflags'
22172 yaccflags='$yaccflags'
22177 : Add in command line options if available
22178 $test -f UU/cmdline.opt && $cat UU/cmdline.opt >> config.sh
22180 : add special variables
22181 $test -f $src/patchlevel.h && \
22182 awk '/^#define[ ]+PERL_/ {printf "%s=%s\n",$2,$3}' $src/patchlevel.h >>config.sh
22183 echo "PERL_PATCHLEVEL=$perl_patchlevel" >>config.sh
22184 echo "PERL_CONFIG_SH=true" >>config.sh
22186 : propagate old symbols
22187 if $test -f UU/config.sh; then
22188 <UU/config.sh $sort | $uniq >UU/oldconfig.sh
22189 sed -n 's/^\([a-zA-Z_0-9]*\)=.*/\1/p' config.sh config.sh UU/oldconfig.sh |\
22190 $sort | $uniq -u >UU/oldsyms
22191 set X `cat UU/oldsyms`
22197 Hmm...You had some extra variables I don't know about...I'll try to keep 'em...
22199 echo "# Variables propagated from previous config.sh file." >>config.sh
22200 for sym in `cat UU/oldsyms`; do
22201 echo " Propagating $hint variable "'$'"$sym..."
22202 eval 'tmp="$'"${sym}"'"'
22204 sed -e "s/'/'\"'\"'/g" -e "s/^/$sym='/" -e "s/$/'/" >>config.sh
22210 : Finish up by extracting the .SH files
22214 echo "Extraction done."
22224 If you'd like to make any changes to the config.sh file before I begin
22225 to configure things, do it as a shell escape now (e.g. !vi config.sh).
22228 rp="Press return or use a shell escape to edit config.sh:"
22233 *) : in case they cannot read
22234 sh 1>&4 -c "$ans";;
22239 : if this fails, just run all the .SH files by hand
22248 if $contains '^depend:' [Mm]akefile >/dev/null 2>&1; then
22255 Now you need to generate make dependencies by running "$make depend".
22256 You might prefer to run it in background: "$make depend > makedepend.out &"
22257 It can take a while, so you might not want to run it right now.
22262 rp="Run $make depend now?"
22266 $make depend && echo "Now you must run '$make'."
22269 echo "You must run '$make depend' then '$make'."
22272 elif test -f [Mm]akefile; then
22274 echo "Now you must run a $make."
22276 echo "Configure done."
22279 if $test -f Policy.sh; then
22282 If you compile $package on a different machine or from a different object
22283 directory, copy the Policy.sh file from this object directory to the
22284 new one before you run Configure -- this will help you with most of
22285 the policy defaults.
22289 if $test -f config.msg; then
22290 echo "Hmm. I also noted the following information while running:"
22292 $cat config.msg >&4
22295 $rm -f kit*isdone ark*isdone