3 # If these # comments don't work, trim them. Don't worry about any other
4 # shell scripts, Configure will trim # comments from them for you.
6 # (If you are trying to port this package to a machine without sh,
7 # I would suggest you have a look at the prototypical config_h.SH file
8 # and edit it to reflect your system. Some packages may include samples
9 # of config.h for certain machines, so you might look for one of those.)
11 # Yes, you may rip this off to use in other distribution packages. This
12 # script belongs to the public domain and cannot be copyrighted.
14 # (Note: this Configure script was generated automatically. Rather than
15 # working with this copy of Configure, you may wish to get metaconfig.
16 # The dist-3.0 package (which contains metaconfig) was posted in
17 # comp.sources.misc and is available on CPAN under authors/id/RAM so
18 # you may fetch it yourself from your nearest archive site.)
21 # Though this script was generated by metaconfig, it is OK to send
22 # patches against it. It's up to the Configure pumpkin to backport
23 # the patch to the metaunits if it is accepted.
24 # See Porting/pumpkin.pod for more information on metaconfig.
27 # $Id: Head.U,v 3.0.1.9 1997/02/28 15:02:09 ram Exp $
29 # Generated on Mon Oct 10 16:08:59 CEST 2005 [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=''
400 endhostent_r_proto=''
406 endprotoent_r_proto=''
412 endservent_r_proto=''
463 gethostbyaddr_r_proto=''
465 gethostbyname_r_proto=''
467 gethostent_r_proto=''
479 getnetbyaddr_r_proto=''
481 getnetbyname_r_proto=''
495 d_getprotobyname_r=''
496 getprotobyname_r_proto=''
497 d_getprotobynumber_r=''
498 getprotobynumber_r_proto=''
500 getprotoent_r_proto=''
512 getservbyname_r_proto=''
514 getservbyport_r_proto=''
516 getservent_r_proto=''
540 d_libm_lib_version=''
553 d_malloc_good_size=''
595 d_old_pthread_create_joinable=''
596 old_pthread_create_joinable=''
598 d_pthread_attr_setscope=''
637 sethostent_r_proto=''
654 setprotoent_r_proto=''
666 setservent_r_proto=''
711 d_stdio_ptr_lval_nochange_cnt=''
712 d_stdio_ptr_lval_sets_cnt=''
916 inc_version_list_init=''
935 ignore_versioned_solibs=''
995 d_perl_otherlibdirs=''
1003 api_versionstring=''
1009 version_patchlevel_string=''
1013 d_nv_preserves_uv=''
1014 d_nv_zero_is_allbits_zero=''
1025 nv_preserves_uv_bits=''
1096 installsitehtml1dir=''
1099 installsitehtml3dir=''
1106 installsiteman1dir=''
1109 installsiteman3dir=''
1114 installsitescript=''
1129 d_stdio_stream_array=''
1130 stdio_stream_array=''
1141 ccflags_uselargefiles=''
1142 ldflags_uselargefiles=''
1143 libswanted_uselargefiles=''
1153 userelocatableinc=''
1164 installvendorarch=''
1171 installvendorhtml1dir=''
1173 vendorhtml1direxp=''
1174 installvendorhtml3dir=''
1176 vendorhtml3direxp=''
1182 installvendorman1dir=''
1185 installvendorman3dir=''
1192 installvendorscript=''
1204 smallmach='pdp11 i8086 z8000 i80286 iAPX286'
1207 : We must find out about Eunice early
1209 if test -f /etc/unixtovms; then
1210 eunicefix=/etc/unixtovms
1212 if test -f /etc/unixtovms.exe; then
1213 eunicefix=/etc/unixtovms.exe
1216 : Set executable suffix now -- needed before hints available
1217 if test -f "/libs/version.library"; then
1220 elif test -f "/system/gnu_library/bin/ar.pm"; then
1223 elif test -n "$DJGPP"; then
1226 elif test -d c:/. -o -n "$is_os2" ; then
1235 : set useposix=false in your hint file to disable the POSIX extension.
1237 : set useopcode=false in your hint file to disable the Opcode extension.
1239 : Trailing extension. Override this in a hint file, if needed.
1240 : Extra object files, if any, needed on this platform.
1243 : Possible local include directories to search.
1244 : Set locincpth to "" in a hint file to defeat local include searches.
1245 locincpth="/usr/local/include /opt/local/include /usr/gnu/include"
1246 locincpth="$locincpth /opt/gnu/include /usr/GNU/include /opt/GNU/include"
1248 : no include file wanted by default
1253 : change the next line if compiling for Xenix/286 on Xenix/386
1254 xlibpth='/usr/lib/386 /lib/386'
1255 : Possible local library directories to search.
1256 loclibpth="/usr/local/lib /opt/local/lib /usr/gnu/lib"
1257 loclibpth="$loclibpth /opt/gnu/lib /usr/GNU/lib /opt/GNU/lib"
1259 : general looking path for locating libraries
1260 glibpth="/lib /usr/lib $xlibpth"
1261 glibpth="$glibpth /usr/ccs/lib /usr/ucblib /usr/local/lib"
1262 test -f /usr/shlib/libc.so && glibpth="/usr/shlib $glibpth"
1263 test -f /shlib/libc.so && glibpth="/shlib $glibpth"
1265 : Private path used by Configure to find libraries. Its value
1266 : is prepended to libpth. This variable takes care of special
1267 : machines, like the mips. Usually, it should be empty.
1270 : default library list
1272 : some systems want to use only the non-versioned libso:s
1273 ignore_versioned_solibs=''
1278 ccflags_uselargefiles=''
1279 ldflags_uselargefiles=''
1280 libswanted_uselargefiles=''
1281 : set usemultiplicity on the Configure command line to enable multiplicity.
1282 : set usesocks on the Configure command line to enable socks.
1283 : set usethreads on the Configure command line to enable threads.
1284 usereentrant='undef'
1285 : full support for void wanted by default
1288 : List of libraries we want.
1289 : If anyone needs extra -lxxx, put those in a hint file.
1290 libswanted="sfio socket bind inet nsl nm ndbm gdbm dbm db malloc dl dld ld sun"
1291 libswanted="$libswanted m crypt sec util c cposix posix ucb bsd BSD"
1292 : We probably want to search /usr/shlib before most other libraries.
1293 : This is only used by the lib/ExtUtils/MakeMaker.pm routine extliblist.
1294 glibpth=`echo " $glibpth " | sed -e 's! /usr/shlib ! !'`
1295 glibpth="/usr/shlib $glibpth"
1296 : Do not use vfork unless overridden by a hint file.
1299 : Find the basic shell for Bourne shell scripts
1303 *bsd*|sys5*) xxx="/$SYSTYPE/bin/sh";;
1306 if test -f "$xxx"; then
1309 : Build up a list and do a single loop so we can 'break' out.
1310 pth=`echo $PATH | sed -e "s/$p_/ /g"`
1311 for xxx in sh bash ksh pdksh ash; do
1313 try="$try ${p}/${xxx}"
1317 if test -f "$xxx"; then
1320 elif test "X$_exe" != X -a -f "$xxx$_exe"; then
1323 elif test -f "$xxx.exe"; then
1334 $me: Fatal Error: I can't find a Bourne Shell anywhere.
1336 Usually it's in /bin/sh. How did you even get this far?
1337 Please contact me (Perl Maintainers) at perlbug@perl.org and
1338 we'll try to straighten this all out.
1344 : see if sh knows # comments
1345 if `$sh -c '#' >/dev/null 2>&1`; then
1349 test -f $xcat$_exe || xcat=/usr/bin/cat
1350 if test ! -f $xcat$_exe; then
1351 for p in `echo $PATH | sed -e "s/$p_/ /g"` $paths; do
1352 if test -f $p/cat$_exe; then
1357 if test ! -f $xcat$_exe; then
1358 echo "Can't find cat anywhere!"
1362 echo "#!$xcat" >sharp
1366 if test -s today; then
1369 echo "#! $xcat" > sharp
1373 if test -s today; then
1381 echo "Your $sh doesn't grok # comments--I will strip them later on."
1384 echo "exec grep -v '^[ ]*#'" >spitshell
1386 $eunicefix spitshell
1387 spitshell=`pwd`/spitshell
1389 echo "I presume that if # doesn't work, #! won't work either!"
1394 : figure out how to guarantee sh startup
1396 '') startsh=${sharpbang}${sh} ;;
1408 : echo "Yup, it does."
1410 echo "Hmm... '$startsh' does not guarantee sh startup..."
1411 echo "You may have to fix up the shell scripts to make sure $sh runs them."
1416 : Save command line options in file UU/cmdline.opt for later use in
1417 : generating config.sh.
1418 cat > cmdline.opt <<EOSH
1419 # Configure command line arguments.
1428 cat >>cmdline.opt <<EOSH
1429 config_arg$argn='$arg'
1431 # Extreme backslashitis: replace each ' by '"'"'
1432 cat <<EOC | sed -e "s/'/'"'"'"'"'"'"'/g" > cmdl.opt
1435 arg_exp=`cat cmdl.opt`
1436 args_exp="$args_exp$args_sep'$arg_exp'"
1437 argn=`expr $argn + 1`
1440 # args_exp is good for restarting self: eval "set X $args_exp"; shift; $0 "$@"
1441 # used by ./hints/os2.sh
1444 : produce awk script to parse command line options
1445 cat >options.awk <<'EOF'
1447 optstr = "A:dD:eEf:hKOrsSU:V"; # getopt-style specification
1449 len = length(optstr);
1450 for (i = 1; i <= len; i++) {
1451 c = substr(optstr, i, 1);
1452 if (i < len) a = substr(optstr, i + 1, 1); else a = "";
1463 if (substr(str, 1, 1) != "-") {
1464 printf("'%s'\n", str);
1468 for (i = 2; i <= len; i++) {
1469 c = substr(str, i, 1);
1471 printf("-%s\n", substr(str, i));
1477 printf("'%s'\n", substr(str, i + 1));
1490 : process the command line options
1491 set X `for arg in "$@"; do echo "X$arg"; done |
1492 sed -e s/X// | awk -f options.awk`
1497 : set up default values
1507 rm -f optdef.sh posthint.sh
1508 cat >optdef.sh <<EOS
1514 while test $# -gt 0; do
1516 -d) shift; fastread=yes;;
1517 -e) shift; alldone=cont;;
1521 if test -r "$1"; then
1524 echo "$me: cannot read config file $1." >&2
1529 -h) shift; error=true;;
1530 -r) shift; reuseval=true;;
1531 -s) shift; silent=true; realsilent=true;;
1532 -E) shift; alldone=exit;;
1533 -K) shift; knowitall=true;;
1534 -O) shift; override=true;;
1535 -S) shift; silent=true; extractsh=true;;
1540 echo "$me: use '-U symbol=', not '-D symbol='." >&2
1541 echo "$me: ignoring -D $1" >&2
1544 sed -e "s/'/'\"'\"'/g" -e "s/=\(.*\)/='\1'/" >> optdef.sh;;
1545 *) echo "$1='define'" >> optdef.sh;;
1552 *=) echo "$1" >> optdef.sh;;
1554 echo "$me: use '-D symbol=val', not '-U symbol=val'." >&2
1555 echo "$me: ignoring -U $1" >&2
1557 *) echo "$1='undef'" >> optdef.sh;;
1568 *=*) zzz=`echo "$yyy"|sed 's!=.*!!'`
1572 zzz=" "`echo "$yyy"|sed 's!^[^=]*=!!'`
1573 yyy=`echo "$yyy"|sed 's!=.*!!'` ;;
1579 *:*) xxx=`echo "$yyy"|sed 's!:.*!!'`
1580 yyy=`echo "$yyy"|sed 's!^[^:]*:!!'`
1581 zzz=`echo "$yyy"|sed 's!^[^=]*=!!'`
1582 yyy=`echo "$yyy"|sed 's!=.*!!'` ;;
1583 *) xxx=`echo "$yyy"|sed 's!:.*!!'`
1584 yyy=`echo "$yyy"|sed 's!^[^:]*:!!'` ;;
1590 echo "$yyy=\"\${$yyy}$zzz\"" >> posthint.sh ;;
1592 echo "$yyy=''" >> posthint.sh ;;
1597 echo "$yyy='$zzz'" >> posthint.sh ;;
1599 echo "eval \"$yyy=$zzz\"" >> posthint.sh ;;
1601 echo "$yyy=\"$zzz\${$yyy}\"" >> posthint.sh ;;
1606 echo "$yyy=$zzz" >> posthint.sh ;;
1607 *) echo "$me: unknown -A command '$xxx', ignoring -A $1" >&2 ;;
1611 -V) echo "$me generated by metaconfig 3.0 PL70." >&2
1614 -*) echo "$me: unknown option $1" >&2; shift; error=true;;
1622 Usage: $me [-dehrsEKOSV] [-f config.sh] [-D symbol] [-D symbol=value]
1623 [-U symbol] [-U symbol=] [-A command:symbol...]
1624 -d : use defaults for all answers.
1625 -e : go on without questioning past the production of config.sh.
1626 -f : specify an alternate default configuration file.
1627 -h : print this help message and exit (with an error status).
1628 -r : reuse C symbols value if possible (skips costly nm extraction).
1629 -s : silent mode, only echoes questions and essential information.
1630 -D : define symbol to have some value:
1631 -D symbol symbol gets the value 'define'
1632 -D symbol=value symbol gets the value 'value'
1633 -E : stop at the end of questions, after having produced config.sh.
1634 -K : do not use unless you know what you are doing.
1635 -O : let -D and -U override definitions from loaded configuration file.
1636 -S : perform variable substitutions on all .SH files (can mix with -f)
1637 -U : undefine symbol:
1638 -U symbol symbol gets the value 'undef'
1639 -U symbol= symbol gets completely empty
1640 -A : manipulate symbol after the platform specific hints have been applied:
1641 -A symbol=value append " "value to symbol
1642 -A append:symbol=value append value to symbol
1643 -A define:symbol=value define symbol to have value
1644 -A clear:symbol define symbol to be ''
1645 -A define:symbol define symbol to be 'define'
1646 -A eval:symbol=value define symbol to be eval of value
1647 -A prepend:symbol=value prepend value to symbol
1648 -A undef:symbol define symbol to be 'undef'
1649 -A undef:symbol= define symbol to be ''
1650 -V : print version number and exit (with a zero status).
1657 case "$fastread$alldone" in
1660 case "$extractsh" in
1663 if test ! -t 0; then
1664 echo "Say 'sh Configure', not 'sh <Configure'"
1674 true) exec 1>/dev/null;;
1677 : run the defines and the undefines, if any, but leave the file out there...
1680 : create the posthint manipulation script and leave the file out there...
1685 first=`echo $package | sed -e 's/^\(.\).*/\1/'`
1686 last=`echo $package | sed -e 's/^.\(.*\)/\1/'`
1687 case "`echo AbyZ | tr '[:lower:]' '[:upper:]' 2>/dev/null`" in
1688 ABYZ) spackage=`echo $first | tr '[:lower:]' '[:upper:]'`$last;;
1689 *) spackage=`echo $first | tr '[a-z]' '[A-Z]'`$last;;
1692 : Some greps do not return status, grrr.
1693 echo "grimblepritz" >grimble
1694 if grep blurfldyick grimble >/dev/null 2>&1 ; then
1696 elif grep grimblepritz grimble >/dev/null 2>&1 ; then
1702 : the following should work in any shell
1706 echo "AGH! Grep doesn't return a status. Attempting remedial action."
1707 cat >contains <<'EOSS'
1708 grep "$1" "$2" >.greptmp && cat .greptmp && test -s .greptmp
1713 : Find the path to the source tree
1716 */*) src=`echo $0 | sed -e 's%/[^/][^/]*$%%'`
1720 *) src=`cd ../$src && pwd` ;;
1733 if test -f $rsrc/Configure && \
1734 $contains "^package=$package$" $rsrc/Configure >/dev/null 2>&1
1736 : found it, so we are ok.
1739 for src in . .. ../.. ../../.. ../../../..; do
1740 if test -f ../$src/Configure && \
1741 $contains "^package=$package$" ../$src/Configure >/dev/null 2>&1
1752 Sorry, I can't seem to locate the source dir for $package. Please start
1753 Configure with an explicit path -- i.e. /some/path/Configure.
1761 echo "Sources for $package found in \"$src\"." >&4
1765 : script used to extract .SH files with variable substitutions
1766 cat >extract <<'EOS'
1768 echo "Doing variable substitutions on .SH files..."
1769 if test -f MANIFEST; then
1770 set x `awk '{print $1}' < MANIFEST | grep '\.SH$'`
1772 echo "(Looking for .SH files under the source directory.)"
1773 set x `(cd "$src"; find . -name "*.SH" -print)`
1777 0) set x `(cd "$src"; echo *.SH)`; shift;;
1779 if test ! -f "$src/$1"; then
1785 while test $name; do
1786 if test ! -d "$name"; then
1787 create="$name $create";
1788 name=`echo $name | sed -e "s|^[^/]*$||"`;
1789 name=`echo $name | sed -e "s|\(.*\)/.*|\1|"`;
1794 for file in $create; do
1803 dir=`expr X$file : 'X\(.*\)/'`
1804 file=`expr X$file : 'X.*/\(.*\)'`
1805 (cd "$dir" && . ./$file)
1815 dir=`expr X$file : 'X\(.*\)/'`
1816 file=`expr X$file : 'X.*/\(.*\)'`
1817 (set x $dir; shift; eval $mkdir_p)
1818 sh <"$src/$dir/$file"
1827 if test -f "$src/config_h.SH"; then
1828 if test ! -f config.h; then
1829 : oops, they left it out of MANIFEST, probably, so do it anyway.
1830 . "$src/config_h.SH"
1835 : extract files and exit if asked to do so
1836 case "$extractsh" in
1838 case "$realsilent" in
1842 case "$config_sh" in
1843 '') config_sh='config.sh';;
1846 echo "Fetching answers from $config_sh..."
1849 test "$override" && . ./optdef.sh
1853 echo "Extraction done."
1858 : Eunice requires " " instead of "", can you believe it
1861 echo "Beginning of configuration questions for $package."
1863 trap 'echo " "; test -d ../UU && rm -rf X $rmlist; exit 1' 1 2 3 15
1865 : first determine how to suppress newline on echo command
1867 echo "Checking echo to see how to suppress newlines..."
1868 (echo "hi there\c" ; echo " ") >.echotmp
1869 if $contains c .echotmp >/dev/null 2>&1 ; then
1880 echo $n "The star should be here-->$c"
1884 : Now test for existence of everything in MANIFEST
1886 if test -f "$rsrc/MANIFEST"; then
1887 echo "First let's make sure your kit is complete. Checking..." >&4
1888 awk '$1 !~ /PACK[A-Z]+/ {print $1}' "$rsrc/MANIFEST" | (split -l 50 2>/dev/null || split -50)
1891 for filelist in x??; do
1892 (cd "$rsrc"; ls `cat "$tmppwd/$filelist"` >/dev/null 2>>"$tmppwd/missing")
1894 if test -s missing; then
1898 THIS PACKAGE SEEMS TO BE INCOMPLETE.
1900 You have the option of continuing the configuration process, despite the
1901 distinct possibility that your kit is damaged, by typing 'y'es. If you
1902 do, don't blame me if something goes wrong. I advise you to type 'n'o
1903 and contact the author (perlbug@perl.org).
1906 echo $n "Continue? [n] $c" >&4
1910 echo "Continuing..." >&4
1914 echo "ABORTING..." >&4
1919 echo "Looks good..."
1922 echo "There is no MANIFEST file. I hope your kit is complete !"
1927 : Find the appropriate value for a newline for tr
1928 if test -n "$DJGPP"; then
1931 if test X"$trnl" = X; then
1932 case "`echo foo|tr '\n' x 2>/dev/null`" in
1936 if test X"$trnl" = X; then
1937 case "`echo foo|tr '\012' x 2>/dev/null`" in
1938 foox) trnl='\012' ;;
1941 if test X"$trnl" = X; then
1942 case "`echo foo|tr '\r\n' xy 2>/dev/null`" in
1943 fooxy) trnl='\n\r' ;;
1946 if test X"$trnl" = X; then
1949 $me: Fatal Error: cannot figure out how to translate newlines with 'tr'.
1955 : compute the number of columns on the terminal for proper question formatting
1960 : set up the echo used in my read
1961 myecho="case \"\$xxxm\" in
1962 '') echo $n \"\$rp $c\" >&4;;
1964 '') echo $n \"[\$xxxm] $c\";;
1966 if test \`echo \"\$rp [\$xxxm] \" | wc -c\` -ge $COLUMNS; then
1968 echo $n \"[\$xxxm] $c\" >&4
1970 echo $n \"\$rp [\$xxxm] $c\" >&4
1976 : now set up to do reads with possible shell escape and default assignment
1982 case "\$fastread" in
1983 yes) case "\$dflt" in
1986 case "\$silent-\$rp" in
1991 *) case "\$silent" in
1992 true) case "\$rp" in
1997 while expr "X\$ans" : "X!" >/dev/null; do
2001 aok=''; eval "ans=\\"\$answ\\"" && aok=y
2009 set x \`expr "X\$ans" : "X!\(.*\)\$"\`
2018 set x \`expr "X\$ans" : "X&\(.*\)\$"\`
2023 echo "(OK, I'll run with -d after this question.)" >&4
2026 echo "*** Sorry, \$1 not supported yet." >&4
2036 echo "*** Substitution done -- please confirm."
2038 ans=\`echo $n "\$ans$c" | tr '$trnl' ' '\`
2043 echo "*** Error -- try again."
2050 case "\$ans\$xxxm\$nostick" in
2062 : create .config dir to save info across Configure sessions
2063 test -d ../.config || mkdir ../.config
2064 cat >../.config/README <<EOF
2065 This directory created by Configure to save information that should
2066 persist across sessions for $package.
2068 You may safely delete it if you wish.
2071 xversion=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
2073 $define|true|[yY]*) ;;
2074 *) case "$xversion" in
2077 *** WHOA THERE!!! ***
2079 This is an UNSTABLE DEVELOPMENT release.
2080 The version of this $package distribution is $xversion, that is, odd,
2081 (as opposed to even) and that signifies a development release.
2082 If you want a maintenance release, you want an even-numbered version.
2084 Do ***NOT*** install this into production use.
2085 Data corruption and crashes are possible.
2087 It is most seriously suggested that you do not continue any further
2088 unless you want to help in developing and debugging Perl.
2090 If you *still* want to build perl, you can answer 'y' now,
2091 or pass -Dusedevel to Configure.
2094 rp='Do you really want to continue?'
2098 [yY]) echo >&4 "Okay, continuing."
2099 usedevel="$define" ;;
2100 *) echo >&4 "Okay, bye."
2110 case "$versiononly" in
2111 '') versiononly="$define" ;;
2113 case "$installusrbinperl" in
2114 '') installusrbinperl="$undef" ;;
2119 : general instructions
2122 user=`(logname) 2>/dev/null`
2124 '') user=`whoami 2>&1`;;
2126 if $contains "^$user\$" ../.config/instruct >/dev/null 2>&1; then
2129 rp='Would you like to see the instructions?'
2140 This installation shell script will examine your system and ask you questions
2141 to determine how the perl5 package should be installed. If you get
2142 stuck on a question, you may use a ! shell escape to start a subshell or
2143 execute a command. Many of the questions will have default answers in square
2144 brackets; typing carriage return will give you the default.
2146 On some of the questions which ask for file or directory names you are allowed
2147 to use the ~name construct to specify the login directory belonging to "name",
2148 even if you don't have a shell which knows about that. Questions where this is
2149 allowed will be marked "(~name ok)".
2153 dflt='Type carriage return to continue'
2157 The prompter used in this script allows you to use shell variables and
2158 backticks in your answers. You may use $1, $2, etc... to refer to the words
2159 in the default answer, as if the default line was a set of arguments given to a
2160 script shell. This means you may also use $* to repeat the whole default line,
2161 so you do not have to re-type everything to add something to the default.
2163 Everytime there is a substitution, you will have to confirm. If there is an
2164 error (e.g. an unmatched backtick), the default answer will remain unchanged
2165 and you will be prompted again.
2167 If you are in a hurry, you may run 'Configure -d'. This will bypass nearly all
2168 the questions and use the computed defaults (or the previous answers if there
2169 was already a config.sh file). Type 'Configure -h' for a list of options.
2170 You may also start interactively and then answer '& -d' at any prompt to turn
2171 on the non-interactive behaviour for the remainder of the execution.
2177 Much effort has been expended to ensure that this shell script will run on any
2178 Unix system. If despite that it blows up on yours, your best bet is to edit
2179 Configure and run it again. If you can't run Configure for some reason,
2180 you'll have to generate a config.sh file by hand. Whatever problems you
2181 have, let me (perlbug@perl.org) know how I blew it.
2183 This installation script affects things in two ways:
2185 1) it may do direct variable substitutions on some of the files included
2187 2) it builds a config.h file for inclusion in C programs. You may edit
2188 any of these files as the need arises after running this script.
2190 If you make a mistake on a question, there is no easy way to back up to it
2191 currently. The easiest thing to do is to edit config.sh and rerun all the SH
2192 files. Configure will offer to let you do this before it runs the SH files.
2195 dflt='Type carriage return to continue'
2197 case "$firsttime" in
2198 true) echo $user >>../.config/instruct;;
2202 : find out where common programs are
2204 echo "Locating common programs..." >&4
2217 if test -d \$dir/\$thing; then
2223 for thisthing in \$dir/\$thing; do
2224 : just loop through to pick last item
2226 if test -f \$thisthing; then
2229 elif test "X$_exe" != X -a -f \$thisthing$_exe; then
2232 elif test -f \$dir/\$thing.exe; then
2233 if test -n "$DJGPP"; then
2234 echo \$dir/\$thing.exe
2235 elif test "$eunicefix" != ":"; then
2236 : on Eunice apparently
2290 pth=`echo $PATH | sed -e "s/$p_/ /g"`
2291 pth="$pth /lib /usr/lib"
2292 for file in $loclist; do
2296 if test -f "$xxx"; then
2299 echo "WARNING: no $xxx -- ignoring your setting for $file." >&4
2300 xxx=`./loc $file $file $pth`
2303 '') xxx=`./loc $file $file $pth`;;
2304 *) xxx=`./loc $xxx $xxx $pth`;;
2306 eval $file=$xxx$_exe
2310 echo $file is in $xxx.
2313 echo $file is in $xxx.
2316 echo "I don't know where '$file' is, and my life depends on it." >&4
2317 echo "Go find a public domain implementation or fix your PATH setting!" >&4
2323 echo "Don't worry if any of the following aren't found..."
2325 for file in $trylist; do
2329 if test -f "$xxx"; then
2332 echo "WARNING: no $xxx -- ignoring your setting for $file." >&4
2333 xxx=`./loc $file $file $pth`
2336 '') xxx=`./loc $file $file $pth`;;
2337 *) xxx=`./loc $xxx $xxx $pth`;;
2339 eval $file=$xxx$_exe
2343 echo $file is in $xxx.
2346 echo $file is in $xxx.
2349 echo "I don't see $file out there, $say."
2356 echo "Substituting grep for egrep."
2363 echo "Substituting cp for ln."
2372 echo "I can't find make or gmake, and my life depends on it." >&4
2373 echo "Go find a public domain implementation or fix your PATH setting!" >&4
2381 *) # We can't have osname yet.
2382 if test -f "/system/gnu_library/bin/ar.pm"; then # Stratus VOS
2383 # Assume that gmake, if found, is definitely GNU make
2384 # and prefer it over the system make.
2385 echo "Substituting gmake for make."
2393 echo "Hopefully test is built into your sh."
2396 if `sh -c "PATH= test true" >/dev/null 2>&1`; then
2397 echo "Using the test built into your sh."
2405 echo "Hopefully echo is built into your sh."
2410 echo "Checking compatibility between $echo and builtin echo (if any)..." >&4
2411 $echo $n "hi there$c" >foo1
2412 echo $n "hi there$c" >foo2
2413 if cmp foo1 foo2 >/dev/null 2>&1; then
2414 echo "They are compatible. In fact, they may be identical."
2421 They are not compatible! You are probably running ksh on a non-USG system.
2422 I'll have to use $echo instead of the builtin, since Bourne shell doesn't
2423 have echo built in and we may have to run some Bourne shell scripts. That
2424 means I'll have to use '$n$c' to suppress newlines now. Life is ridiculous.
2427 $echo $n "The star should be here-->$c"
2437 cat <<'EOSC' >>trygcc
2442 int main(int argc, char *argv[]) {
2446 if $cc -o try $ccflags $ldflags try.c; then
2449 echo "Uh-oh, the C compiler '$cc' doesn't seem to be working." >&4
2455 case "`$cc -v -c try.c 2>&1`" in
2458 if $test X"$trygcc" = Xyes; then
2459 if gcc -o try -c try.c; then
2461 echo "You seem to have a working gcc, though." >&4
2462 rp="Would you like to use it?"
2464 if $test -f myread; then
2467 if $test -f UU/myread; then
2470 echo "Cannot find myread, sorry. Aborting." >&2
2475 [yY]*) cc=gcc; ccname=gcc; ccflags=''; despair=no;
2476 if $test -f usethreads.cbu; then
2479 *** However, any setting of the C compiler flags (e.g. for thread support)
2480 *** has been lost. It may be necessary to pass -Dcc=gcc to Configure
2481 *** (together with e.g. -Dusethreads).
2497 cat <<'EOSC' >>checkcc
2502 int main(int argc, char *argv[]) {
2506 if $cc -o try $ccflags $ldflags try.c; then
2509 if $test X"$despair" = Xyes; then
2510 echo "Uh-oh, the C compiler '$cc' doesn't seem to be working." >&4
2513 You need to find a working C compiler.
2514 Either (purchase and) install the C compiler supplied by your OS vendor,
2515 or for a free C compiler try http://gcc.gnu.org/
2516 I cannot continue any further, aborting.
2525 : determine whether symbolic links are supported
2528 if $ln -s blurfl sym > /dev/null 2>&1 ; then
2529 echo "Symbolic links are supported." >&4
2532 echo "Symbolic links are NOT supported." >&4
2537 : determine whether symbolic links are supported
2541 echo "Checking how to test for symbolic links..." >&4
2543 if $test "X$issymlink" = X; then
2545 '') sh -c "PATH= test -h sym" >/dev/null 2>&1 ;;
2546 *) $newsh -c "PATH= test -h sym" >/dev/null 2>&1 ;;
2548 if test $? = 0; then
2551 echo "Your builtin 'test -h' may be broken." >&4
2554 *) pth=`echo $PATH | sed -e "s/$p_/ /g"`
2557 if test -f "$p/$test"; then
2566 echo "Trying external '$test -h'." >&4
2567 issymlink="$test -h"
2568 if $test ! -h sym >/dev/null 2>&1; then
2569 echo "External '$test -h' is broken, too." >&4
2577 if $test "X$issymlink" = X; then
2578 if $test -L sym 2>/dev/null; then
2579 issymlink="$test -L"
2580 echo "The builtin '$test -L' worked." >&4
2583 if $test "X$issymlink" != X; then
2584 echo "You can test for symbolic links with '$issymlink'." >&4
2586 echo "I do not know how you can test for symbolic links." >&4
2590 *) echo "No symbolic links, so not testing for their testing..." >&4
2596 case "$mksymlinks" in
2599 ''|'.') echo "Cannot create symlinks in the original directory." >&4
2602 *) case "$lns:$issymlink" in
2603 *"ln"*" -s:"*"test -"?)
2604 echo "Creating the symbolic links..." >&4
2605 echo "(First creating the subdirectories...)" >&4
2607 awk '{print $1}' $src/MANIFEST | grep / | sed 's:/[^/]*$::' | sort -u | while true; do
2609 test -z "$directory" && break
2613 if test ! -d t/base; then
2614 echo "Failed to create the subdirectories. Aborting." >&4
2617 echo "(Then creating the symlinks...)" >&4
2618 awk '{print $1}' $src/MANIFEST | while true; do
2620 test -z "$filename" && break
2621 if test -f $filename; then
2622 if $issymlink $filename; then
2626 if test -f $filename; then
2627 echo "$filename already exists, not symlinking."
2629 ln -s $src/$filename $filename
2633 if test ! -f t/base/lex.t; then
2634 echo "Failed to create the symlinks (t/base/lex.t missing). Aborting." >&4
2639 *) echo "(I cannot figure out how to do symbolic links, ignoring mksymlinks)." >&4
2648 case "$usecrosscompile" in
2650 $echo "Cross-compiling..."
2653 *-*-gcc) # A cross-compiling gcc, probably.
2654 targetarch=`$echo $cc|$sed 's/-gcc$//'`
2656 # leave out ld, choosing it is more complex
2658 ranlib=$targetarch-ranlib
2659 $echo 'extern int foo;' > try.c
2660 set X `$cc -v -E try.c 2>&1 | $awk '/^#include </,/^End of search /'|$grep '/include'`
2662 if $test $# -gt 0; then
2664 incpth="`$echo $incpth|$sed 's/^ //'`"
2665 echo "Guessing incpth '$incpth'." >&4
2667 j="`$echo $i|$sed 's,/include$,/lib,'`"
2668 if $test -d $j; then
2672 libpth="`$echo $libpth|$sed 's/^ //'`"
2673 echo "Guessing libpth '$libpth'." >&4
2678 case "$targetarch" in
2679 '') echo "Targetarch not defined." >&4; croak=y ;;
2680 *) echo "Using targetarch $targetarch." >&4 ;;
2683 '') echo "Incpth not defined." >&4; croak=y ;;
2684 *) echo "Using incpth '$incpth'." >&4 ;;
2687 '') echo "Libpth not defined." >&4; croak=y ;;
2688 *) echo "Using libpth '$libpth'." >&4 ;;
2691 '') for i in $incpth; do
2692 if $test -f $i/errno.h -a -f $i/stdio.h -a -f $i/time.h; then
2694 echo "Guessing usrinc $usrinc." >&4
2699 '') echo "Usrinc not defined." >&4; croak=y ;;
2702 *) echo "Using usrinc $usrinc." >&4 ;;
2704 case "$targethost" in
2705 '') echo "Targethost not defined." >&4; croak=y ;;
2706 *) echo "Using targethost $targethost." >&4
2711 y) echo "Cannot continue, aborting." >&4; exit 1 ;;
2714 /*) run=$src/Cross/run
2715 targetmkdir=$src/Cross/mkdir
2717 from=$src/Cross/from
2719 *) pwd=`$test -f ../Configure & cd ..; pwd`
2721 targetmkdir=$pwd/Cross/mkdir
2723 from=$pwd/Cross/from
2726 case "$targetrun" in
2727 '') targetrun=ssh ;;
2732 case "$targetfrom" in
2733 '') targetfrom=scp ;;
2737 from=$from-$targetfrom
2738 case "$targetdir" in
2740 echo "Guessing targetdir $targetdir." >&4
2743 case "$targetuser" in
2745 echo "Guessing targetuser $targetuser." >&4
2748 case "$targetfrom" in
2752 case "$targetrun" in
2764 '') cwd=$targetdir ;;
2768 if $test ! -f \$exe.xok; then
2772 $targetrun -l $targetuser $targethost "cd \$cwd && ./\$exe \$@"
2775 *) echo "Unknown targetrun '$targetrun'" >&4
2779 case "$targetmkdir" in
2781 cat >$targetmkdir <<EOF
2783 $targetrun -l $targetuser $targethost "mkdir -p \$@"
2785 $chmod a+rx $targetmkdir
2787 *) echo "Unknown targetmkdir '$targetmkdir'" >&4
2799 $targetmkdir \`dirname \$f\`
2800 $targetto $q \$f $targetuser@$targethost:\$f || exit 1
2803 $targetmkdir $targetdir/\`dirname \$f\`
2804 $targetto $q \$f $targetuser@$targethost:$targetdir/\$f || exit 1
2817 $mkdir -p $targetdir/\`dirname \$f\`
2818 $cp \$f $targetdir/\$f || exit 1
2821 $targetmkdir $targetdir/\`dirname \$f\`
2822 $cp \$f $targetdir/\$f || exit 1
2829 *) echo "Unknown targetto '$targetto'" >&4
2833 case "$targetfrom" in
2840 $targetfrom $q $targetuser@$targethost:$targetdir/\$f . || exit 1
2845 cp) cat >$from <<EOF
2850 cp $targetdir/\$f . || exit 1
2855 *) echo "Unknown targetfrom '$targetfrom'" >&4
2859 if $test ! -f $run; then
2860 echo "Target 'run' script '$run' not found." >&4
2864 if $test ! -f $to; then
2865 echo "Target 'to' script '$to' not found." >&4
2869 if $test ! -f $from; then
2870 echo "Target 'from' script '$from' not found." >&4
2874 if $test ! -f $run -o ! -f $to -o ! -f $from; then
2878 Using '$run' for remote execution,
2879 and '$from' and '$to'
2880 for remote file transfer.
2886 usecrosscompile='undef'
2891 : see whether [:lower:] and [:upper:] are supported character classes
2893 case "`echo AbyZ | $tr '[:lower:]' '[:upper:]' 2>/dev/null`" in
2895 echo "Good, your tr supports [:lower:] and [:upper:] to convert case." >&4
2899 *) # There is a discontinuity in EBCDIC between 'R' and 'S'
2900 # (0xd9 and 0xe2), therefore that is a nice testing point.
2901 if test "X$up" = X -o "X$low" = X; then
2902 case "`echo RS | $tr '[R-S]' '[r-s]' 2>/dev/null`" in
2908 if test "X$up" = X -o "X$low" = X; then
2909 case "`echo RS | $tr R-S r-s 2>/dev/null`" in
2915 if test "X$up" = X -o "X$low" = X; then
2916 case "`echo RS | od -x 2>/dev/null`" in
2918 echo "Hey, this might be EBCDIC." >&4
2919 if test "X$up" = X -o "X$low" = X; then
2920 case "`echo RS | $tr '[A-IJ-RS-Z]' '[a-ij-rs-z]' 2>/dev/null`" in
2921 rs) up='[A-IJ-RS-Z]'
2926 if test "X$up" = X -o "X$low" = X; then
2927 case "`echo RS | $tr A-IJ-RS-Z a-ij-rs-z 2>/dev/null`" in
2937 case "`echo RS | $tr \"$up\" \"$low\" 2>/dev/null`" in
2939 echo "Using $up and $low to convert case." >&4
2942 echo "I don't know how to translate letters from upper to lower case." >&4
2943 echo "Your tr is not acting any way I know of." >&4
2947 : set up the translation script tr, must be called with ./tr of course
2951 '[A-Z][a-z]') exec $tr '$up' '$low';;
2952 '[a-z][A-Z]') exec $tr '$low' '$up';;
2959 : Try to determine whether config.sh was made on this system
2960 case "$config_sh" in
2962 myuname=`$uname -a 2>/dev/null`
2963 $test -z "$myuname" && myuname=`hostname 2>/dev/null`
2964 # tr '[A-Z]' '[a-z]' would not work in EBCDIC
2965 # because the A-Z/a-z are not consecutive.
2966 myuname=`echo $myuname | $sed -e 's/^[^=]*=//' -e 's/\///g' | \
2967 ./tr '[A-Z]' '[a-z]' | $tr $trnl ' '`
2968 newmyuname="$myuname"
2970 case "$knowitall" in
2972 if test -f ../config.sh; then
2973 if $contains myuname= ../config.sh >/dev/null 2>&1; then
2974 eval "`grep myuname= ../config.sh`"
2976 if test "X$myuname" = "X$newmyuname"; then
2984 : Get old answers from old config file if Configure was run on the
2985 : same system, otherwise use the hints.
2988 if test -f config.sh; then
2990 rp="I see a config.sh file. Shall I use it to set the defaults?"
2993 n*|N*) echo "OK, I'll ignore it."
2994 mv config.sh config.sh.old
2995 myuname="$newmyuname"
2997 *) echo "Fetching default answers from your old config.sh file..." >&4
3005 : Older versions did not always set $sh. Catch re-use of such
3015 if test ! -f config.sh; then
3018 First time through, eh? I have some defaults handy for some systems
3019 that need some extra help getting the Configure answers right:
3022 (cd $src/hints; ls -C *.sh) | $sed 's/\.sh/ /g' >&4
3024 : Half the following guesses are probably wrong... If you have better
3025 : tests or hints, please send them to perlbug@perl.org
3026 : The metaconfig authors would also appreciate a copy...
3027 $test -f /irix && osname=irix
3028 $test -f /xenix && osname=sco_xenix
3029 $test -f /dynix && osname=dynix
3030 $test -f /dnix && osname=dnix
3031 $test -f /lynx.os && osname=lynxos
3032 $test -f /unicos && osname=unicos && osvers=`$uname -r`
3033 $test -f /unicosmk && osname=unicosmk && osvers=`$uname -r`
3034 $test -f /unicosmk.ar && osname=unicosmk && osvers=`$uname -r`
3035 $test -f /bin/mips && /bin/mips && osname=mips
3036 $test -d /NextApps && set X `hostinfo | grep 'NeXT Mach.*:' | \
3037 $sed -e 's/://' -e 's/\./_/'` && osname=next && osvers=$4
3038 $test -d /usr/apollo/bin && osname=apollo
3039 $test -f /etc/saf/_sactab && osname=svr4
3040 $test -d /usr/include/minix && osname=minix
3041 $test -f /system/gnu_library/bin/ar.pm && osname=vos
3042 if $test -d /MachTen -o -d /MachTen_Folder; then
3044 if $test -x /sbin/version; then
3045 osvers=`/sbin/version | $awk '{print $2}' |
3046 $sed -e 's/[A-Za-z]$//'`
3047 elif $test -x /usr/etc/version; then
3048 osvers=`/usr/etc/version | $awk '{print $2}' |
3049 $sed -e 's/[A-Za-z]$//'`
3055 $test -f /sys/posix.dll &&
3056 $test -f /usr/bin/what &&
3057 set X `/usr/bin/what /sys/posix.dll` &&
3058 $test "$3" = UWIN &&
3062 if $test -f $uname; then
3070 umips) osname=umips ;;
3073 [23]100) osname=mips ;;
3074 next*) osname=next ;;
3076 tmp=`/bin/uname -X 2>/dev/null|awk '/3\.2v[45]/{ print $(NF) }'`
3077 if $test "$tmp" != "" -a "$3" = "3.2" -a -f '/etc/systemid'; then
3080 elif $test -f /etc/kconfig; then
3082 if test "$lns" = "$ln -s"; then
3084 elif $contains _SYSV3 /usr/include/stdio.h > /dev/null 2>&1 ; then
3086 elif $contains _POSIX_SOURCE /usr/include/stdio.h > /dev/null 2>&1 ; then
3093 if test -n "$DJGPP"; then
3102 tmp=`( (oslevel) 2>/dev/null || echo "not found") 2>&1`
3104 # oslevel can fail with:
3105 # oslevel: Unable to acquire lock.
3106 *not\ found) osvers="$4"."$3" ;;
3107 '<3240'|'<>3240') osvers=3.2.0 ;;
3108 '=3240'|'>3240'|'<3250'|'<>3250') osvers=3.2.4 ;;
3109 '=3250'|'>3250') osvers=3.2.5 ;;
3113 bsd386) osname=bsd386
3116 cygwin*) osname=cygwin
3119 *dc.osx) osname=dcosx
3125 domainos) osname=apollo
3131 dynixptx*) osname=dynixptx
3132 osvers=`echo "$4"|sed 's/^v//'`
3134 freebsd) osname=freebsd
3136 genix) osname=genix ;;
3140 osvers=`echo "$3" | $sed 's,.*\.\([0-9]*\.[0-9]*\),\1,'`
3156 netbsd*) osname=netbsd
3159 news-os) osvers="$3"
3161 4*) osname=newsos4 ;;
3165 next*) osname=next ;;
3166 nonstop-ux) osname=nonstopux ;;
3167 openbsd) osname=openbsd
3173 POSIX-BC | posix-bc ) osname=posix-bc
3176 powerux | power_ux | powermax_os | powermaxos | \
3177 powerunix | power_unix) osname=powerux
3183 solaris) osname=solaris
3185 5*) osvers=`echo $3 | $sed 's/^5/2/g'` ;;
3192 osvers=`echo $3 | $sed 's/^5/2/g'` ;;
3196 titanos) osname=titanos
3205 ultrix) osname=ultrix
3208 osf1|mls+) case "$5" in
3211 osvers=`sizer -v | awk -FUNIX '{print $2}' | awk '{print $1}' | tr '[A-Z]' '[a-z]' | sed 's/^[xvt]//'`
3214 *) osvers=`echo "$3" | sed 's/^[xvt]//'` ;;
3217 hp*) osname=hp_osf1 ;;
3218 mips) osname=mips_osf1 ;;
3221 # UnixWare 7.1.2 is known as Open UNIX 8
3222 openunix|unixware) osname=svr5
3230 $2) case "$osname" in
3234 : svr4.x or possibly later
3244 if test -f /stand/boot ; then
3245 eval `grep '^INITPROG=[a-z/0-9]*$' /stand/boot`
3246 if test -n "$INITPROG" -a -f "$INITPROG"; then
3247 isesix=`strings -a $INITPROG|grep 'ESIX SYSTEM V/386 Release 4.0'`
3248 if test -n "$isesix"; then
3256 *) if test -f /etc/systemid; then
3258 set `echo $3 | $sed 's/\./ /g'` $4
3259 if $test -f $src/hints/sco_$1_$2_$3.sh; then
3261 elif $test -f $src/hints/sco_$1_$2.sh; then
3263 elif $test -f $src/hints/sco_$1.sh; then
3268 '') : Still unknown. Probably a generic Sys V.
3277 *) case "$osname" in
3278 '') : Still unknown. Probably a generic BSD.
3286 if test -f /vmunix -a -f $src/hints/news_os.sh; then
3287 (what /vmunix | UU/tr '[A-Z]' '[a-z]') > UU/kernel.what 2>&1
3288 if $contains news-os UU/kernel.what >/dev/null 2>&1; then
3291 $rm -f UU/kernel.what
3292 elif test -d c:/. -o -n "$is_os2" ; then
3299 case "$targetarch" in
3302 osname=`echo $targetarch|sed 's,^[^-]*-,,'`
3307 : Now look for a hint file osname_osvers, unless one has been
3308 : specified already.
3311 file=`echo "${osname}_${osvers}" | $sed -e 's%\.%_%g' -e 's%_$%%'`
3312 : Also try without trailing minor version numbers.
3313 xfile=`echo $file | $sed -e 's%_[^_]*$%%'`
3314 xxfile=`echo $xfile | $sed -e 's%_[^_]*$%%'`
3315 xxxfile=`echo $xxfile | $sed -e 's%_[^_]*$%%'`
3316 xxxxfile=`echo $xxxfile | $sed -e 's%_[^_]*$%%'`
3319 *) case "$osvers" in
3322 *) if $test -f $src/hints/$file.sh ; then
3324 elif $test -f $src/hints/$xfile.sh ; then
3326 elif $test -f $src/hints/$xxfile.sh ; then
3328 elif $test -f $src/hints/$xxxfile.sh ; then
3330 elif $test -f $src/hints/$xxxxfile.sh ; then
3332 elif $test -f "$src/hints/${osname}.sh" ; then
3341 if $test -f Policy.sh ; then
3344 none) dflt="Policy" ;;
3345 *) dflt="Policy $dflt" ;;
3350 dflt=`echo $hintfile | $sed 's/\.sh$//'`
3354 if $test -f Policy.sh ; then
3357 There's also a Policy hint file available, which should make the
3358 site-specific (policy) questions easier to answer.
3365 You may give one or more space-separated answers, or "none" if appropriate.
3366 A well-behaved OS will have no hints, so answering "none" or just "Policy"
3367 is a good thing. DO NOT give a wrong version or a wrong OS.
3371 rp="Which of these apply, if any?"
3374 for file in $tans; do
3375 if $test X$file = XPolicy -a -f Policy.sh; then
3377 $cat Policy.sh >> UU/config.sh
3378 elif $test -f $src/hints/$file.sh; then
3379 . $src/hints/$file.sh
3380 $cat $src/hints/$file.sh >> UU/config.sh
3381 elif $test X"$tans" = X -o X"$tans" = Xnone ; then
3384 : Give one chance to correct a possible typo.
3385 echo "$file.sh does not exist"
3387 rp="hint to use instead?"
3389 for file in $ans; do
3390 if $test -f "$src/hints/$file.sh"; then
3391 . $src/hints/$file.sh
3392 $cat $src/hints/$file.sh >> UU/config.sh
3393 elif $test X$ans = X -o X$ans = Xnone ; then
3396 echo "$file.sh does not exist -- ignored."
3403 : Remember our hint file for later.
3404 if $test -f "$src/hints/$file.sh" ; then
3414 echo "Fetching default answers from $config_sh..." >&4
3418 cp $config_sh config.sh 2>/dev/null
3428 test "$override" && . ./optdef.sh
3430 : Restore computed paths
3431 for file in $loclist $trylist; do
3432 eval $file="\$_$file"
3437 Configure uses the operating system name and version to set some defaults.
3438 The default value is probably right if the name rings a bell. Otherwise,
3439 since spelling matters for me, either accept the default or answer "none"
3446 ''|' '|none) dflt=none ;;
3447 *) dflt=`echo $hintfile | $sed -e 's/\.sh$//' -e 's/_.*$//'` ;;
3450 *) dflt="$osname" ;;
3452 rp="Operating system name?"
3456 *) osname=`echo "$ans" | $sed -e 's/[ ][ ]*/_/g' | ./tr '[A-Z]' '[a-z]'`;;
3462 ''|' '|none) dflt=none ;;
3463 *) dflt=`echo $hintfile | $sed -e 's/\.sh$//' -e 's/^[^_]*//'`
3464 dflt=`echo $dflt | $sed -e 's/^_//' -e 's/_/./g'`
3466 ''|' ') dflt=none ;;
3471 *) dflt="$osvers" ;;
3473 rp="Operating system version?"
3483 : who configured the system
3484 cf_time=`LC_ALL=C; LANGUAGE=C; export LC_ALL; export LANGUAGE; $date 2>&1`
3487 cf_by=`(logname) 2>/dev/null`
3490 cf_by=`(whoami) 2>/dev/null`
3492 "") cf_by=unknown ;;
3497 : set up the script used to warn in case of inconsistency
3504 echo "*** WHOA THERE!!! ***" >&4
3505 echo " The $hint value for \$$var on this machine was \"$was\"!" >&4
3506 rp=" Keep the $hint value?"
3509 y) td=$was; tu=$was;;
3513 : function used to set $1 to $val
3514 setvar='var=$1; eval "was=\$$1"; td=$define; tu=$undef;
3516 $define$undef) . ./whoa; eval "$var=\$td";;
3517 $undef$define) . ./whoa; eval "$var=\$tu";;
3518 *) eval "$var=$val";;
3522 $define|true|[yY]*) dflt='y';;
3527 Perl can be built to use the SOCKS proxy protocol library. To do so,
3528 Configure must be run with -Dusesocks. If you use SOCKS you also need
3529 to use the PerlIO abstraction layer, this will be implicitly selected.
3531 If this doesn't make any sense to you, just accept the default '$dflt'.
3533 rp='Build Perl for SOCKS?'
3536 y|Y) val="$define" ;;
3543 $define|true|[yY]*) useperlio="$define";;
3546 case "$useperlio" in
3547 $define|true|[yY]*|'') dflt='y';;
3552 Previous version of $package used the standard IO mechanisms as
3553 defined in <stdio.h>. Versions 5.003_02 and later of $package allow
3554 alternate IO mechanisms via the PerlIO abstraction layer, but the
3555 stdio mechanism is still available if needed. The abstraction layer
3556 can use AT&T's sfio (if you already have sfio installed) or regular stdio.
3557 Using PerlIO with sfio may cause problems with some extension modules.
3559 If this doesn't make any sense to you, just accept the default '$dflt'.
3561 rp='Use the PerlIO abstraction layer?'
3568 echo "Ok, doing things the stdio way."
3577 case "$useperlio" in
3578 $define|true|[yY]*) ;;
3581 You are using the SOCKS proxy protocol library which means that you
3582 should also use the PerlIO layer. You may be headed for trouble.
3591 case "$usethreads" in
3592 $define|true|[yY]*) dflt='y';;
3593 *) # Catch case where user specified ithreads or 5005threads but
3594 # forgot -Dusethreads (A.D. 4/2002)
3595 case "$useithreads$use5005threads" in
3597 case "$useperlio" in
3598 "$define") dflt='y' ;;
3608 Perl can be built to take advantage of threads on some systems.
3609 To do so, Configure can be run with -Dusethreads.
3611 Note that Perl built with threading support runs slightly slower
3612 and uses more memory than plain Perl. The current implementation
3613 is believed to be stable, but it is fairly new, and so should be
3614 treated with caution.
3616 If this doesn't make any sense to you, just accept the default '$dflt'.
3618 rp='Build a threading Perl?'
3621 y|Y) val="$define" ;;
3627 case "$usethreads" in
3631 Since release 5.6, Perl has had two different threading implementations,
3632 the newer interpreter-based version (ithreads) with one interpreter per
3633 thread, and the older 5.005 version (5005threads).
3634 The 5005threads version is effectively unmaintained and will probably be
3635 removed in Perl 5.10, so there should be no need to build a Perl using it
3636 unless needed for backwards compatibility with some existing 5.005threads
3640 : Default to ithreads unless overridden on command line or with
3643 case "$use5005threads" in
3644 $define|true|[yY]*) dflt='n';;
3646 case "$useithreads" in
3647 $undef|false|[nN]*) dflt='n';;
3649 rp='Use the newer interpreter-based ithreads?'
3652 y|Y) val="$define" ;;
3657 : Now set use5005threads to the opposite value.
3658 case "$useithreads" in
3659 $define) val="$undef" ;;
3666 useithreads="$undef"
3667 use5005threads="$undef"
3671 case "$useithreads$use5005threads" in
3675 You cannot have both the ithreads and the 5.005 threads enabled
3676 at the same time. Disabling the 5.005 threads since they are
3677 much less stable than the ithreads.
3680 use5005threads="$undef"
3684 if test X"$usethreads" = "X$define" -a "X$useperlio" = "Xundef"; then
3687 *** To build with ithreads you must also use the PerlIO layer.
3688 *** Cannot continue, aborting.
3694 case "$d_oldpthreads" in
3695 '') : Configure tests would be welcome here. For now, assume undef.
3697 *) val="$d_oldpthreads" ;;
3703 : Look for a hint-file generated 'call-back-unit'. If the
3704 : user has specified that a threading perl is to be built,
3705 : we may need to set or change some other defaults.
3706 if $test -f usethreads.cbu; then
3707 echo "Your platform has some specific hints regarding threaded builds, using them..."
3710 case "$usethreads" in
3711 "$define"|true|[yY]*)
3713 (Your platform does not have any specific hints for threaded builds.
3714 Assuming POSIX threads, then.)
3722 Perl can be built so that multiple Perl interpreters can coexist
3723 within the same Perl executable.
3726 case "$useithreads" in
3729 This multiple interpreter support is required for interpreter-based threads.
3733 *) case "$usemultiplicity" in
3734 $define|true|[yY]*) dflt='y';;
3738 echo "If this doesn't make any sense to you, just accept the default '$dflt'."
3739 rp='Build Perl for multiplicity?'
3742 y|Y) val="$define" ;;
3751 case "$usemorebits" in
3752 "$define"|true|[yY]*)
3753 use64bitint="$define"
3754 uselongdouble="$define"
3755 usemorebits="$define"
3757 *) usemorebits="$undef"
3761 : make some quick guesses about what we are up against
3763 $echo $n "Hmm... $c"
3773 $cat /usr/include/signal.h /usr/include/sys/signal.h >foo 2>/dev/null
3774 if test -f /osf_boot || $contains 'OSF/1' /usr/include/ctype.h >/dev/null 2>&1
3776 echo "Looks kind of like an OSF/1 system, but we'll see..."
3778 elif test `echo abc | $tr a-z A-Z` = Abc ; then
3779 xxx=`./loc addbib blurfl $pth`
3780 if $test -f $xxx; then
3781 echo "Looks kind of like a USG system with BSD features, but we'll see..."
3785 if $contains SIGTSTP foo >/dev/null 2>&1 ; then
3786 echo "Looks kind of like an extended USG system, but we'll see..."
3788 echo "Looks kind of like a USG system, but we'll see..."
3792 elif $contains SIGTSTP foo >/dev/null 2>&1 ; then
3793 echo "Looks kind of like a BSD system, but we'll see..."
3797 echo "Looks kind of like a Version 7 system, but we'll see..."
3800 case "$eunicefix" in
3803 There is, however, a strange, musty smell in the air that reminds me of
3804 something...hmm...yes...I've got it...there's a VMS nearby, or I'm a Blit.
3808 : it so happens the Eunice I know will not run shell scripts in Unix format
3812 echo "Congratulations. You aren't running Eunice."
3816 : Detect OS2. The p_ variable is set above in the Head.U unit.
3817 : Note that this also -- wrongly -- detects e.g. dos-djgpp, which also uses
3818 : semicolon as a patch separator
3823 I have the feeling something is not exactly right, however...don't tell me...
3824 lemme think...does HAL ring a bell?...no, of course, you're only running OS/2!
3825 (Or you may be running DOS with DJGPP.)
3830 if test -f /xenix; then
3831 echo "Actually, this looks more like a XENIX system..."
3836 echo "It's not Xenix..."
3841 if test -f /venix; then
3842 echo "Actually, this looks more like a VENIX system..."
3849 echo "Nor is it Venix..."
3852 chmod +x bsd usg v7 osf1 eunice xenix venix os2
3853 $eunicefix bsd usg v7 osf1 eunice xenix venix os2
3860 rp="Use which C compiler?"
3864 : See if they have not cc but they do have gcc
3866 : Look for a hint-file generated 'call-back-unit'. Now that the
3867 : user has specified the compiler, we may need to set or change some
3869 if $test -f cc.cbu; then
3875 echo "Checking for GNU cc in disguise and/or its version number..." >&4
3881 printf("%s\n", __VERSION__);
3883 printf("%s\n", "1");
3889 if $cc -o try $ccflags $ldflags try.c; then
3890 gccversion=`$run ./try`
3891 case "$gccversion" in
3892 '') echo "You are not using GNU cc." ;;
3893 *) echo "You are using GNU cc $gccversion."
3899 echo "*** WHOA THERE!!! ***" >&4
3900 echo " Your C compiler \"$cc\" doesn't seem to be working!" >&4
3901 case "$knowitall" in
3903 echo " You'd better start hunting for one and let me know about it." >&4
3909 case "$gccversion" in
3910 1*) cpp=`./loc gcc-cpp $cpp $pth` ;;
3912 case "$gccversion" in
3913 '') gccosandvers='' ;;
3914 *) gccshortvers=`echo "$gccversion"|sed 's/ .*//'`
3915 gccosandvers=`$cc -v 2>&1|grep '/specs$'|sed "s!.*/[^-/]*-[^-/]*-\([^-/]*\)/$gccshortvers/specs!\1!"`
3917 case "$gccosandvers" in
3918 $osname) gccosandvers='' ;; # linux gccs seem to have no linux osvers, grr
3919 $osname$osvers) ;; # looking good
3920 $osname*) cat <<EOM >&4
3922 *** WHOA THERE!!! ***
3924 Your gcc has not been compiled for the exact release of
3925 your operating system ($gccosandvers versus $osname$osvers).
3927 In general it is a good idea to keep gcc synchronized with
3928 the operating system because otherwise serious problems
3929 may ensue when trying to compile software, like Perl.
3931 I'm trying to be optimistic here, though, and will continue.
3932 If later during the configuration and build icky compilation
3933 problems appear (headerfile conflicts being the most common
3934 manifestation), I suggest reinstalling the gcc to match
3935 your operating system release.
3939 *) gccosandvers='' ;; # failed to parse, better be silent
3947 # gcc 3.* complain about adding -Idirectories that they already know about,
3948 # so we will take those off from locincpth.
3949 case "$gccversion" in
3951 echo "main(){}">try.c
3952 for incdir in $locincpth; do
3953 warn=`$cc $ccflags -I$incdir -c try.c 2>&1 | \
3954 grep '^c[cp]p*[01]: warning: changing search order '`
3955 if test "X$warn" != X; then
3956 locincpth=`echo " $locincpth " | sed "s! $incdir ! !"`
3962 : decide how portable to be. Allow command line overrides.
3963 case "$d_portable" in
3965 *) d_portable="$define" ;;
3968 : set up shell script to do ~ expansion
3974 echo \$1 | $sed "s|~|\${HOME-\$LOGDIR}|"
3977 if $test -f /bin/csh; then
3978 /bin/csh -f -c "glob \$1"
3983 name=\`$expr x\$1 : '..\([^/]*\)'\`
3984 dir=\`$sed -n -e "/^\${name}:/{s/^[^:]*:[^:]*:[^:]*:[^:]*:[^:]*:\([^:]*\).*"'\$'"/\1/" -e p -e q -e '}' </etc/passwd\`
3985 if $test ! -d "\$dir"; then
3987 echo "\$me: can't locate home directory for: \$name" >&2
3992 echo \$dir/\`$expr x\$1 : '..[^/]*/\(.*\)'\`
4008 : now set up to get a file name
4012 cat <<'EOSC' >>getfile
4028 : getfile will accept an answer from the comma-separated list
4029 : enclosed in parentheses even if it does not meet other criteria.
4030 expr "$fn" : '.*(\(.*\)).*' | $tr ',' $trnl >getfile.ok
4031 fn=`echo $fn | sed 's/(.*)//'`
4037 loc_file=`expr $fn : '.*:\(.*\)'`
4038 fn=`expr $fn : '\(.*\):.*'`
4046 */*) fullpath=true;;
4055 *e*) exp_file=true;;
4058 *p*) nopath_ok=true;;
4063 *d*) type='Directory';;
4064 *l*) type='Locate';;
4069 Locate) what='File';;
4074 case "$d_portable" in
4082 while test "$type"; do
4087 true) rp="$rp (~name ok)";;
4090 if test -f UU/getfile.ok && \
4091 $contains "^$ans\$" UU/getfile.ok >/dev/null 2>&1
4110 value=`UU/filexp $ans`
4113 if test "$ans" != "$value"; then
4114 echo "(That expands to $value on this system.)"
4128 /*) value="$ansexp" ;;
4129 [a-zA-Z]:/*) value="$ansexp" ;;
4134 echo "I shall only accept a full path name, as in /bin/ls." >&4
4135 echo "Use a ! shell escape if you wish to check pathnames." >&4
4138 echo "Please give a full path name, starting with slash." >&4
4141 echo "Note that using ~name is ok provided it expands well." >&4
4154 for fp in $gfpth; do
4155 if test "X$fp" = X.; then
4160 if test -f "$pf"; then
4162 elif test -r "$pf" || (test -h "$pf") >/dev/null 2>&1
4164 echo "($value is not a plain file, but that's ok.)"
4167 if test X"$type" = X; then
4174 for fp in $gfpth; do
4175 if test "X$fp" = X.; then
4180 direxp="$fp/$ansexp"
4182 if test -d "$direxp"; then
4190 if test -d "$ansexp"; then
4191 echo "(Looking for $loc_file in directory $value.)"
4192 value="$value/$loc_file"
4193 ansexp="$ansexp/$loc_file"
4195 if test -f "$ansexp"; then
4198 case "$nopath_ok" in
4199 true) case "$value" in
4201 *) echo "Assuming $value will be in people's path."
4217 if test "$fastread" = yes; then
4222 rp="$what $value doesn't exist. Use that name anyway?"
4241 test "X$gfpthkeep" != Xy && gfpth=""
4244 : What should the include directory be ?
4246 $echo $n "Hmm... $c"
4250 if $test -f /bin/mips && /bin/mips; then
4251 echo "Looks like a MIPS system..."
4252 $cat >usr.c <<'EOCP'
4253 #ifdef SYSTYPE_BSD43
4257 if cc -E usr.c > usr.out && $contains / usr.out >/dev/null 2>&1; then
4258 dflt='/bsd43/usr/include'
4262 mips_type='System V'
4264 $rm -f usr.c usr.out
4265 echo "and you're compiling with the $mips_type compiler and libraries."
4269 echo "Doesn't look like a MIPS system."
4279 case "$xxx_prompt" in
4282 rp='Where are the include files you want to use?'
4290 : see how we invoke the C preprocessor
4292 echo "Now, how can we feed standard input to your C preprocessor..." >&4
4293 cat <<'EOT' >testcpp.c
4299 if test ! -f cppstdin; then
4300 if test "X$osname" = "Xaix" -a "X$gccversion" = X; then
4301 # AIX cc -E doesn't show the absolute headerfile
4302 # locations but we'll cheat by using the -M flag.
4303 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
4305 echo 'cat >.$$.c; '"$cc"' -E ${1+"$@"} .$$.c; rm .$$.c' >cppstdin
4308 echo "Keeping your $hint cppstdin wrapper."
4311 wrapper=`pwd`/cppstdin
4315 if $test "X$cppstdin" != "X" && \
4316 $cppstdin $cppminus <testcpp.c >testcpp.out 2>&1 && \
4317 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
4319 echo "You used to use $cppstdin $cppminus so we'll use that again."
4321 '') echo "But let's see if we can live without a wrapper..." ;;
4323 if $cpprun $cpplast <testcpp.c >testcpp.out 2>&1 && \
4324 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
4326 echo "(And we'll use $cpprun $cpplast to preprocess directly.)"
4329 echo "(However, $cpprun $cpplast does not work, let's see...)"
4337 echo "Good old $cppstdin $cppminus does not seem to be of any help..."
4344 elif echo 'Maybe "'"$cc"' -E" will work...'; \
4345 $cc -E <testcpp.c >testcpp.out 2>&1; \
4346 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4347 echo "Yup, it does."
4350 elif echo 'Nope...maybe "'"$cc"' -E -" will work...'; \
4351 $cc -E - <testcpp.c >testcpp.out 2>&1; \
4352 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4353 echo "Yup, it does."
4356 elif echo 'Nope...maybe "'"$cc"' -P" will work...'; \
4357 $cc -P <testcpp.c >testcpp.out 2>&1; \
4358 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4359 echo "Yipee, that works!"
4362 elif echo 'Nope...maybe "'"$cc"' -P -" will work...'; \
4363 $cc -P - <testcpp.c >testcpp.out 2>&1; \
4364 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4365 echo "At long last!"
4368 elif echo 'No such luck, maybe "'$cpp'" will work...'; \
4369 $cpp <testcpp.c >testcpp.out 2>&1; \
4370 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4374 elif echo 'Nixed again...maybe "'$cpp' -" will work...'; \
4375 $cpp - <testcpp.c >testcpp.out 2>&1; \
4376 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4377 echo "Hooray, it works! I was beginning to wonder."
4380 elif echo 'Uh-uh. Time to get fancy. Trying a wrapper...'; \
4381 $wrapper <testcpp.c >testcpp.out 2>&1; \
4382 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4388 rp="No dice. I can't find a C preprocessor. Name one:"
4392 $x_cpp <testcpp.c >testcpp.out 2>&1
4393 if $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4394 echo "OK, that will do." >&4
4396 echo "Sorry, I can't get that to work. Go find one and rerun Configure." >&4
4411 echo "Perhaps can we force $cc -E using a wrapper..."
4412 if $wrapper <testcpp.c >testcpp.out 2>&1; \
4413 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
4419 echo "Nope, we'll have to live without it..."
4433 "$wrapper"|'cppstdin') ;;
4434 *) $rm -f $wrapper;;
4436 $rm -f testcpp.c testcpp.out
4438 : Set private lib path
4441 plibpth="$incpath/usr/lib /usr/local/lib /usr/ccs/lib"
4446 '') dlist="$loclibpth $plibpth $glibpth";;
4447 *) dlist="$libpth";;
4450 : Now check and see which directories actually exist, avoiding duplicates
4454 if $test -d $xxx; then
4457 *) libpth="$libpth $xxx";;
4463 Some systems have incompatible or broken versions of libraries. Among
4464 the directories listed in the question below, please remove any you
4465 know not to be holding relevant libraries, and add any that are needed.
4466 Say "none" for none.
4477 rp="Directories to use for library searches?"
4484 : compute shared library extension
4487 if xxx=`./loc libc.sl X $libpth`; $test -f "$xxx"; then
4497 On some systems, shared libraries may be available. Answer 'none' if
4498 you want to suppress searching of shared libraries for the remainder
4499 of this configuration.
4502 rp='What is the file extension used for shared libraries?'
4506 : Define several unixisms.
4507 : Hints files or command line option can be used to override them.
4508 : The convoluted testing is in case hints files set either the old
4511 '') case "$exe_ext" in
4513 *) _exe="$exe_ext" ;;
4518 '') case "$lib_ext" in
4525 '') case "$obj_ext" in
4532 '') case "$path_sep" in
4543 : Which makefile gets called first. This is used by make depend.
4544 case "$firstmakefile" in
4545 '') firstmakefile='makefile';;
4549 *-DUSE_LONG_DOUBLE*|*-DUSE_MORE_BITS*) uselongdouble="$define" ;;
4552 case "$uselongdouble" in
4553 $define|true|[yY]*) dflt='y';;
4558 Perl can be built to take advantage of long doubles which
4559 (if available) may give more accuracy and range for floating point numbers.
4561 If this doesn't make any sense to you, just accept the default '$dflt'.
4563 rp='Try to use long doubles if available?'
4566 y|Y) val="$define" ;;
4572 case "$uselongdouble" in
4573 true|[yY]*) uselongdouble="$define" ;;
4576 : Look for a hint-file generated 'call-back-unit'. If the
4577 : user has specified that long doubles should be used,
4578 : we may need to set or change some other defaults.
4579 if $test -f uselongdouble.cbu; then
4580 echo "Your platform has some specific hints regarding long doubles, using them..."
4581 . ./uselongdouble.cbu
4583 case "$uselongdouble" in
4586 (Your platform does not have any specific hints for long doubles.)
4592 : Looking for optional libraries
4594 echo "Checking for optional libraries..." >&4
4599 case "$libswanted" in
4600 '') libswanted='c_s';;
4603 "$define") libswanted="$libswanted socks5 socks5_sh" ;;
4609 for thisdir in $libpth $xlibpth; do
4610 test -d $thisdir && libspath="$libspath $thisdir"
4612 for thislib in $libswanted; do
4613 for thisdir in $libspath; do
4615 if $test ! -f "$xxx" -a "X$ignore_versioned_solibs" = "X"; then
4616 xxx=`ls $thisdir/lib$thislib.$so.[0-9] 2>/dev/null|sed -n '$p'`
4617 $test -f "$xxx" && eval $libscheck
4618 $test -f "$xxx" && libstyle=shared
4620 if test ! -f "$xxx"; then
4621 xxx=$thisdir/lib$thislib.$so
4622 $test -f "$xxx" && eval $libscheck
4623 $test -f "$xxx" && libstyle=shared
4625 if test ! -f "$xxx"; then
4626 xxx=$thisdir/lib$thislib$_a
4627 $test -f "$xxx" && eval $libscheck
4628 $test -f "$xxx" && libstyle=static
4630 if test ! -f "$xxx"; then
4631 xxx=$thisdir/$thislib$_a
4632 $test -f "$xxx" && eval $libscheck
4633 $test -f "$xxx" && libstyle=static
4635 if test ! -f "$xxx"; then
4636 xxx=$thisdir/lib${thislib}_s$_a
4637 $test -f "$xxx" && eval $libscheck
4638 $test -f "$xxx" && libstyle=static
4639 $test -f "$xxx" && thislib=${thislib}_s
4641 if test ! -f "$xxx"; then
4642 xxx=$thisdir/Slib$thislib$_a
4643 $test -f "$xxx" && eval $libscheck
4644 $test -f "$xxx" && libstyle=static
4646 if $test -f "$xxx"; then
4648 shared) echo "Found -l$thislib (shared)." ;;
4649 static) echo "Found -l$thislib." ;;
4650 *) echo "Found -l$thislib ($libstyle)." ;;
4654 *) dflt="$dflt -l$thislib"
4655 libsfound="$libsfound $xxx"
4657 libsfiles="$libsfiles $yyy"
4658 yyy=`echo $xxx|$sed -e "s%/$yyy\\$%%"`
4659 case " $libsdirs " in
4661 *) libsdirs="$libsdirs $yyy" ;;
4668 if $test ! -f "$xxx"; then
4669 echo "No -l$thislib."
4680 ' '|'') dflt='none';;
4685 In order to compile $package on your machine, a number of libraries
4686 are usually needed. Include any other special libraries here as well.
4687 Say "none" for none. The default list is almost always right.
4691 rp="What libraries to use?"
4698 : determine optimization, if desired, or use for debug flag also
4700 ' '|$undef) dflt='none';;
4702 *) dflt="$optimize";;
4706 By default, $package compiles with the -O flag to use the optimizer.
4707 Alternately, you might want to use the symbolic debugger, which uses
4708 the -g flag (on traditional Unix systems). Either flag can be
4709 specified here. To use neither flag, specify the word "none".
4712 rp="What optimizer/debugger flag should be used?"
4716 'none') optimize=" ";;
4720 : We will not override a previous value, but we might want to
4721 : augment a hint file
4723 default|recommended)
4724 case "$gccversion" in
4725 1*) dflt='-fpcc-struct-return' ;;
4728 *-g*) dflt="$dflt -DDEBUGGING";;
4730 case "$gccversion" in
4731 2*) if test -d /etc/conf/kconfig.d &&
4732 $contains _POSIX_VERSION $usrinc/sys/unistd.h >/dev/null 2>&1
4734 # Interactive Systems (ISC) POSIX mode.
4739 case "$gccversion" in
4743 echo "Checking if your compiler accepts -fno-strict-aliasing" 2>&1
4744 echo 'int main(void) { return 0; }' > gcctest.c
4745 if $cc -O2 -fno-strict-aliasing -o gcctest gcctest.c; then
4746 echo "Yes, it does." 2>&1
4749 echo "Leaving current flags $ccflags alone." 2>&1
4751 *) dflt="$dflt -fno-strict-aliasing" ;;
4754 echo "Nope, it doesn't, but that's ok." 2>&1
4758 # For gcc, adding -pipe speeds up compilations for some, but apparently
4759 # some assemblers can't read from stdin. (It also slows down compilations
4760 # in other cases, but those are apparently rarer these days.) AD 5/2004.
4761 case "$gccversion" in
4763 echo "Checking if your compiler accepts -pipe" 2>&1
4764 echo 'int main(void) { return 0; }' > gcctest.c
4765 if $cc -pipe -o gcctest gcctest.c; then
4766 echo "Yes, it does." 2>&1
4769 echo "Leaving current flags $ccflags alone." 2>&1
4771 *) dflt="$dflt -pipe" ;;
4774 echo "Nope, it doesn't, but that's ok." 2>&1
4777 echo "Checking if your compiler accepts -Wdeclaration-after-statement" 2>&1
4778 echo 'int main(void) { return 0; }' > gcctest.c
4779 if $cc -Wdeclaration-after-statement -o gcctest gcctest.c; then
4780 echo "Yes, it does." 2>&1
4782 *-Wdeclaration-after-statement*)
4783 echo "Leaving current flags $ccflags alone." 2>&1
4785 *) dflt="$dflt -Wdeclaration-after-statement" ;;
4788 echo "Nope, it doesn't, but that's ok." 2>&1
4795 case "$mips_type" in
4796 *BSD*|'') inclwanted="$locincpth $usrinc";;
4797 *) inclwanted="$locincpth $inclwanted $usrinc/bsd";;
4799 for thisincl in $inclwanted; do
4800 if $test -d $thisincl; then
4801 if $test x$thisincl != x$usrinc; then
4803 *" -I$thisincl "*);;
4804 *) dflt="$dflt -I$thisincl ";;
4810 inctest='if $contains $2 $usrinc/$1 >/dev/null 2>&1; then
4812 elif $contains $2 $usrinc/sys/$1 >/dev/null 2>&1; then
4820 *) dflt="$dflt -D$2";;
4824 set signal.h LANGUAGE_C; eval $inctest
4828 ccflags="$ccflags -DSOCKS"
4833 default|recommended) dflt="$ccflags $dflt" ;;
4834 *) dflt="$ccflags";;
4843 Your C compiler may want other flags. For this question you should include
4844 -I/whatever and -DWHATEVER flags and any other flags used by the C compiler,
4845 but you should NOT include libraries or ld flags like -lwhatever. If you
4846 want $package to honor its debug switch, you should include -DDEBUGGING here.
4847 Your C compiler might also need additional flags, such as -D_POSIX_SOURCE.
4849 To use no flags, specify the word "none".
4855 rp="Any additional cc flags?"
4862 : the following weeds options from ccflags that are of no interest to cpp
4864 '') cppflags="$ccflags" ;;
4865 *) cppflags="$cppflags $ccflags" ;;
4867 case "$gccversion" in
4868 1*) cppflags="$cppflags -D__GNUC__"
4870 case "$mips_type" in
4872 *BSD*) cppflags="$cppflags -DSYSTYPE_BSD43";;
4878 echo "Let me guess what the preprocessor flags are..." >&4
4892 *) ftry="$previous $flag";;
4894 if $cppstdin -DLFRULB=bar $cppflags $ftry $cppminus <cpp.c \
4895 >cpp1.out 2>/dev/null && \
4896 $cpprun -DLFRULB=bar $cppflags $ftry $cpplast <cpp.c \
4897 >cpp2.out 2>/dev/null && \
4898 $contains 'foo.*xx.*bar' cpp1.out >/dev/null 2>&1 && \
4899 $contains 'foo.*xx.*bar' cpp2.out >/dev/null 2>&1
4901 cppflags="$cppflags $ftry"
4911 *-*) echo "They appear to be: $cppflags";;
4913 $rm -f cpp.c cpp?.out
4917 : flags used in final linking phase
4919 '') if ./venix; then
4925 *-posix*) dflt="$dflt -posix" ;;
4928 *) dflt="$ldflags";;
4931 : Try to guess additional flags to pick up local libraries.
4932 for thislibdir in $libpth; do
4933 case " $loclibpth " in
4936 *"-L$thislibdir "*) ;;
4937 *) dflt="$dflt -L$thislibdir" ;;
4949 Your C linker may need flags. For this question you should
4950 include -L/whatever and any other flags used by the C linker, but you
4951 should NOT include libraries like -lwhatever.
4953 Make sure you include the appropriate -L/path flags if your C linker
4954 does not normally search all of the directories you specified above,
4957 To use no flags, specify the word "none".
4961 rp="Any additional ld flags (NOT including libraries)?"
4967 rmlist="$rmlist pdp11"
4971 echo "Checking your choice of C compiler and flags for coherency..." >&4
4972 $cat > try.c <<'EOF'
4974 int main() { printf("Ok\n"); return(0); }
4976 set X $cc -o try $optimize $ccflags $ldflags try.c $libs
4978 $cat >try.msg <<'EOM'
4979 I've tried to compile and run the following simple program:
4982 $cat try.c >> try.msg
4984 $cat >> try.msg <<EOM
4991 and I got the following output:
4995 if $sh -c "$cc -o try $optimize $ccflags $ldflags try.c $libs" >>try.msg 2>&1; then
4996 if $sh -c "$run ./try" >>try.msg 2>&1; then
5000 *) echo 'The program compiled OK, but produced no output.' >> try.msg
5003 cat >> try.msg <<'EOQS'
5004 If $libs contains -lsfio, and sfio is mis-configured, then it
5005 sometimes (apparently) runs and exits with a 0 status, but with no
5006 output! It may have to do with sfio's use of _exit vs. exit.
5009 rp="You have a big problem. Shall I abort Configure"
5016 echo "The program compiled OK, but exited with status $?." >>try.msg
5017 rp="You have a problem. Shall I abort Configure"
5021 echo "I can't compile the test program." >>try.msg
5022 rp="You have a BIG problem. Shall I abort Configure"
5028 case "$knowitall" in
5030 echo "(The supplied flags or libraries might be incorrect.)"
5038 *) echo "Ok. Stopping Configure." >&4
5043 n) echo "OK, that should do.";;
5045 $rm -f try try.* core
5047 : define a shorthand compile call
5051 $cc -o ${mc_file} $optimize $ccflags $ldflags $* ${mc_file}.c $libs > /dev/null 2>&1;'
5052 : define a shorthand compile call for compilations that should be ok.
5056 $cc -o ${mc_file} $optimize $ccflags $ldflags $* ${mc_file}.c $libs;'
5058 : determine filename position in cpp output
5060 echo "Computing filename position in cpp output for #include directives..." >&4
5062 vos) testaccess=-e ;;
5065 echo '#include <stdio.h>' > foo.c
5068 $cppstdin $cppflags $cppminus <foo.c 2>/dev/null | \
5069 $grep '^[ ]*#.*stdio\.h' | \
5070 while read cline; do
5073 while $test \$# -gt 0; do
5074 if $test $testaccess \`echo \$1 | $tr -d '"'\`; then
5079 pos=\`expr \$pos + 1\`
5091 *) pos="${fieldn}th";;
5093 echo "Your cpp writes the filename in the $pos field of the line."
5096 vos) cppfilter="tr '\\\\>' '/' |" ;; # path component separator is >
5097 os2) cppfilter="sed -e 's|\\\\\\\\|/|g' |" ;; # path component separator is \
5100 : locate header file
5105 for usrincdir in $usrinc
5107 if test -f \$usrincdir/\$wanted; then
5108 echo "\$usrincdir/\$wanted"
5112 awkprg='{ print \$$fieldn }'
5113 echo "#include <\$wanted>" > foo\$\$.c
5114 $cppstdin $cppminus $cppflags < foo\$\$.c 2>/dev/null | \
5115 $cppfilter $grep "^[ ]*#.*\$wanted" | \
5116 while read cline; do
5117 name=\`echo \$cline | $awk "\$awkprg" | $tr -d '"'\`
5119 *[/\\\\]\$wanted) echo "\$name"; exit 1;;
5120 *[\\\\/]\$wanted) echo "\$name"; exit 1;;
5125 # status = 0: grep returned 0 lines, case statement not executed
5126 # status = 1: headerfile found
5127 # status = 2: while loop executed, no headerfile found
5131 if test \$status -eq 1; then
5138 : define an alternate in-header-list? function
5139 inhdr='echo " "; td=$define; tu=$undef; yyy=$@;
5140 cont=true; xxf="echo \"<\$1> found.\" >&4";
5141 case $# in 2) xxnf="echo \"<\$1> NOT found.\" >&4";;
5142 *) xxnf="echo \"<\$1> NOT found, ...\" >&4";;
5144 case $# in 4) instead=instead;; *) instead="at last";; esac;
5145 while $test "$cont"; do
5147 var=$2; eval "was=\$$2";
5148 if $test "$xxx" && $test -r "$xxx";
5150 eval "case \"\$$var\" in $undef) . ./whoa; esac"; eval "$var=\$td";
5153 eval "case \"\$$var\" in $define) . ./whoa; esac"; eval "$var=\$tu"; fi;
5154 set $yyy; shift; shift; yyy=$@;
5155 case $# in 0) cont="";;
5156 2) xxf="echo \"but I found <\$1> $instead.\" >&4";
5157 xxnf="echo \"and I did not find <\$1> either.\" >&4";;
5158 *) xxf="echo \"but I found <\$1\> instead.\" >&4";
5159 xxnf="echo \"there is no <\$1>, ...\" >&4";;
5163 do set $yyy; var=$2; eval "was=\$$2";
5164 eval "case \"\$$var\" in $define) . ./whoa; esac"; eval "$var=\$tu";
5165 set $yyy; shift; shift; yyy=$@;
5168 : see if stdlib is available
5169 set stdlib.h i_stdlib
5172 : check for lengths of integral types
5176 echo "Checking to see how big your integers are..." >&4
5185 printf("intsize=%d;\n", (int)sizeof(int));
5186 printf("longsize=%d;\n", (int)sizeof(long));
5187 printf("shortsize=%d;\n", (int)sizeof(short));
5192 if eval $compile_ok && $run ./try > /dev/null; then
5194 echo "Your integers are $intsize bytes long."
5195 echo "Your long integers are $longsize bytes long."
5196 echo "Your short integers are $shortsize bytes long."
5200 Help! I can't compile and run the intsize test program: please enlighten me!
5201 (This is probably a misconfiguration in your system or libraries, and
5202 you really ought to fix it. Still, I'll try anyway.)
5206 rp="What is the size of an integer (in bytes)?"
5210 rp="What is the size of a long integer (in bytes)?"
5214 rp="What is the size of a short integer (in bytes)?"
5222 : check for long long
5224 echo "Checking to see if you have long long..." >&4
5225 echo 'int main() { long long x = 7; return 0; }' > try.c
5227 if eval $compile; then
5229 echo "You have long long."
5232 echo "You do not have long long."
5238 : check for length of long long
5239 case "${d_longlong}${longlongsize}" in
5242 echo "Checking to see how big your long longs are..." >&4
5243 $cat >try.c <<'EOCP'
5247 printf("%d\n", (int)sizeof(long long));
5252 if eval $compile_ok; then
5253 longlongsize=`$run ./try`
5254 echo "Your long longs are $longlongsize bytes long."
5258 echo "(I can't seem to compile the test program. Guessing...)"
5259 rp="What is the size of a long long (in bytes)?"
5263 if $test "X$longsize" = "X$longlongsize"; then
5264 echo "(That isn't any different from an ordinary long.)"
5270 : see if inttypes.h is available
5271 : we want a real compile instead of Inhdr because some systems
5272 : have an inttypes.h which includes non-existent headers
5275 #include <inttypes.h>
5277 static int32_t foo32 = 0x12345678;
5281 if eval $compile; then
5282 echo "<inttypes.h> found." >&4
5285 echo "<inttypes.h> NOT found." >&4
5294 echo "Checking to see if you have int64_t..." >&4
5296 #include <sys/types.h>
5297 #$i_inttypes I_INTTYPES
5299 #include <inttypes.h>
5301 int main() { int64_t x = 7; }
5304 if eval $compile; then
5306 echo "You have int64_t."
5309 echo "You do not have int64_t."
5317 echo "Checking which 64-bit integer type we could use..." >&4
5323 val='"unsigned int"'
5328 *) case "$longsize" in
5332 val='"unsigned long"'
5337 *) case "$d_longlong:$longlongsize" in
5342 val='"unsigned long long"'
5347 *) case "$d_int64_t" in
5366 '') echo "Alas, no 64-bit integer types in sight." >&4
5369 *) echo "We could use '$quadtype' for 64-bit integers." >&4
5375 case "$uselonglong" in
5376 "$define"|true|[yY]*)
5379 *** Configure -Duselonglong is deprecated, using -Duse64bitint instead.
5381 use64bitint="$define"
5384 case "$use64bits" in
5385 "$define"|true|[yY]*)
5388 *** Configure -Duse64bits is deprecated, using -Duse64bitint instead.
5390 use64bitint="$define"
5393 case "$use64bitints" in
5394 "$define"|true|[yY]*)
5397 *** There is no Configure -Duse64bitints, using -Duse64bitint instead.
5399 use64bitint="$define"
5402 case "$use64bitsint" in
5403 "$define"|true|[yY]*)
5406 *** There is no Configure -Duse64bitsint, using -Duse64bitint instead.
5408 use64bitint="$define"
5411 case "$uselonglongs" in
5412 "$define"|true|[yY]*)
5415 *** There is no Configure -Duselonglongs, using -Duse64bitint instead.
5417 use64bitint="$define"
5420 case "$use64bitsall" in
5421 "$define"|true|[yY]*)
5424 *** There is no Configure -Duse64bitsall, using -Duse64bitall instead.
5426 use64bitall="$define"
5431 *-DUSE_LONG_LONG*|*-DUSE_64_BIT_INT*|*-DUSE_64_BIT_ALL*) use64bitint="$define";;
5433 case "$use64bitall" in
5434 "$define"|true|[yY]*) use64bitint="$define" ;;
5440 You have natively 64-bit long integers.
5444 *) case "$use64bitint" in
5445 "$define"|true|[yY]*) dflt='y';;
5454 Perl can be built to take advantage of 64-bit integer types
5455 on some systems. To do so, Configure can be run with -Duse64bitint.
5456 Choosing this option will most probably introduce binary incompatibilities.
5458 If this doesn't make any sense to you, just accept the default '$dflt'.
5459 (The default has been chosen based on your configuration.)
5461 rp='Try to use 64-bit integers, if available?'
5464 [yY]*) val="$define" ;;
5472 case "$use64bitall" in
5473 "$define"|true|[yY]*) dflt='y' ;;
5474 *) case "$longsize" in
5482 You may also choose to try maximal 64-bitness. It means using as much
5483 64-bitness as possible on the platform. This in turn means even more
5484 binary incompatibilities. On the other hand, your platform may not
5485 have any more 64-bitness available than what you already have chosen.
5487 If this doesn't make any sense to you, just accept the default '$dflt'.
5488 (The default has been chosen based on your configuration.)
5490 rp='Try to use maximal 64-bit support, if available?'
5493 [yY]*) val="$define" ;;
5498 case "$use64bitall" in
5500 case "$use64bitint" in
5504 Since you have chosen a maximally 64-bit build, I'm also turning on
5505 the use of 64-bit integers.
5507 use64bitint="$define" ;;
5512 : Look for a hint-file generated 'call-back-unit'. If the
5513 : user has specified that a 64-bit perl is to be built,
5514 : we may need to set or change some other defaults.
5515 if $test -f use64bitint.cbu; then
5516 echo "Your platform has some specific hints regarding 64-bit integers, using them..."
5519 case "$use64bitint" in
5520 "$define"|true|[yY]*)
5522 4) case "$archname64" in
5523 '') archname64=64int ;;
5530 : Look for a hint-file generated 'call-back-unit'. If the
5531 : user has specified that a maximally 64-bit perl is to be built,
5532 : we may need to set or change some other defaults.
5533 if $test -f use64bitall.cbu; then
5534 echo "Your platform has some specific hints regarding 64-bit builds, using them..."
5537 case "$use64bitall" in
5538 "$define"|true|[yY]*)
5540 4) case "$archname64" in
5541 ''|64int) archname64=64all ;;
5548 case "$d_quad:$use64bitint" in
5552 *** You have chosen to use 64-bit integers,
5553 *** but none can be found.
5554 *** Please rerun Configure without -Duse64bitint and/or -Dusemorebits.
5555 *** Cannot continue, aborting.
5562 : check for length of double
5564 case "$doublesize" in
5566 echo "Checking to see how big your double precision numbers are..." >&4
5575 printf("%d\n", (int)sizeof(double));
5580 if eval $compile_ok; then
5581 doublesize=`$run ./try`
5582 echo "Your double is $doublesize bytes long."
5585 echo "(I can't seem to compile the test program. Guessing...)"
5586 rp="What is the size of a double precision number (in bytes)?"
5594 : check for long doubles
5596 echo "Checking to see if you have long double..." >&4
5597 echo 'int main() { long double x = 7.0; }' > try.c
5599 if eval $compile; then
5601 echo "You have long double."
5604 echo "You do not have long double."
5610 : check for length of long double
5611 case "${d_longdbl}${longdblsize}" in
5614 echo "Checking to see how big your long doubles are..." >&4
5615 $cat >try.c <<'EOCP'
5619 printf("%d\n", sizeof(long double));
5624 if eval $compile; then
5625 longdblsize=`$run ./try`
5626 echo "Your long doubles are $longdblsize bytes long."
5630 echo "(I can't seem to compile the test program. Guessing...)" >&4
5631 rp="What is the size of a long double (in bytes)?"
5635 if $test "X$doublesize" = "X$longdblsize"; then
5636 echo "That isn't any different from an ordinary double."
5637 echo "I'll keep your setting anyway, but you may see some"
5638 echo "harmless compilation warnings."
5644 : determine the architecture name
5646 if xxx=`./loc arch blurfl $pth`; $test -f "$xxx"; then
5647 tarch=`arch`"-$osname"
5648 elif xxx=`./loc uname blurfl $pth`; $test -f "$xxx" ; then
5649 if uname -m > tmparch 2>&1 ; then
5650 tarch=`$sed -e 's/ *$//' -e 's/ /_/g' \
5651 -e 's/$/'"-$osname/" tmparch`
5659 case "$myarchname" in
5662 echo "(Your architecture name used to be $myarchname.)"
5666 case "$targetarch" in
5668 *) archname=`echo $targetarch|sed 's,^[^-]*-,,'` ;;
5673 *) dflt="$archname";;
5675 rp='What is your architecture name'
5678 case "$usethreads" in
5680 echo "Threads selected." >&4
5682 *-thread*) echo "...and architecture name already has -thread." >&4
5684 *) archname="$archname-thread"
5685 echo "...setting architecture name to $archname." >&4
5690 case "$usemultiplicity" in
5692 echo "Multiplicity selected." >&4
5694 *-multi*) echo "...and architecture name already has -multi." >&4
5696 *) archname="$archname-multi"
5697 echo "...setting architecture name to $archname." >&4
5702 case "$use64bitint$use64bitall" in
5704 case "$archname64" in
5706 echo "This architecture is naturally 64-bit, not changing architecture name." >&4
5709 case "$use64bitint" in
5710 "$define") echo "64 bit integers selected." >&4 ;;
5712 case "$use64bitall" in
5713 "$define") echo "Maximal 64 bitness selected." >&4 ;;
5716 *-$archname64*) echo "...and architecture name already has $archname64." >&4
5718 *) archname="$archname-$archname64"
5719 echo "...setting architecture name to $archname." >&4
5725 case "$uselongdouble" in
5727 echo "Long doubles selected." >&4
5728 case "$longdblsize" in
5730 echo "...but long doubles are equal to doubles, not changing architecture name." >&4
5734 *-ld*) echo "...and architecture name already has -ld." >&4
5736 *) archname="$archname-ld"
5737 echo "...setting architecture name to $archname." >&4
5744 case "$useperlio" in
5746 echo "Perlio selected." >&4
5749 echo "Perlio not selected, using stdio." >&4
5751 *-stdio*) echo "...and architecture name already has -stdio." >&4
5753 *) archname="$archname-stdio"
5754 echo "...setting architecture name to $archname." >&4
5759 if $test -f archname.cbu; then
5760 echo "Your platform has some specific hints for architecture name, using them..."
5764 : determine root of directory hierarchy where package will be installed.
5767 dflt=`./loc . /usr/local /usr/local /local /opt /usr`
5770 dflt=`echo "$prefix" | sed 's/.$//'`
5778 By default, $package will be installed in $dflt/bin, manual pages
5779 under $dflt/man, etc..., i.e. with $dflt as prefix for all
5780 installation directories. Typically this is something like /usr/local.
5781 If you wish to have binaries under /usr/bin but other parts of the
5782 installation under /usr/local, that's ok: you will be prompted
5783 separately for each of the installation directories, the prefix being
5784 only used to set the defaults.
5788 rp='Installation prefix to use?'
5796 *) oldprefix="$prefix";;
5805 *) afsroot=$afsroot ;;
5811 $define|true) afs=true ;;
5812 $undef|false) afs=false ;;
5813 *) if test -d $afsroot; then
5821 echo "AFS may be running... I'll be extra cautious then..." >&4
5823 echo "AFS does not seem to be running..." >&4
5826 : determine installation prefix for where package is to be installed.
5830 Since you are running AFS, I need to distinguish the directory in which
5831 files will reside from the directory in which they are installed (and from
5832 which they are presumably copied to the former directory by occult means).
5835 case "$installprefix" in
5836 '') dflt=`echo $prefix | sed 's#^/afs/#/afs/.#'`;;
5837 *) dflt="$installprefix";;
5842 In some special cases, particularly when building $package for distribution,
5843 it is convenient to distinguish the directory in which files should be
5844 installed from the directory ($prefix) in which they will
5845 eventually reside. For most users, these two directories are the same.
5848 case "$installprefix" in
5850 *) dflt=$installprefix;;
5854 rp='What installation prefix should I use for installing files?'
5856 installprefix="$ans"
5857 installprefixexp="$ansexp"
5859 : set the prefixit variable, to compute a suitable default value
5860 prefixit='case "$3" in
5862 case "$oldprefix" in
5863 "") eval "$1=\"\$$2\"";;
5870 ""|" ") eval "$1=\"\$$2\"";;
5876 eval "tp=\"$oldprefix-\$$2-\""; eval "tp=\"$tp\"";
5878 --|/*--|\~*--) eval "$1=\"$prefix/$3\"";;
5879 /*-$oldprefix/*|\~*-$oldprefix/*)
5880 eval "$1=\`echo \$$2 | sed \"s,^$oldprefix,$prefix,\"\`";;
5881 *) eval "$1=\"\$$2\"";;
5885 : get the patchlevel
5887 echo "Getting the current patchlevel..." >&4
5888 if $test -r $rsrc/patchlevel.h;then
5889 revision=`awk '/define[ ]+PERL_REVISION/ {print $3}' $rsrc/patchlevel.h`
5890 patchlevel=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
5891 subversion=`awk '/define[ ]+PERL_SUBVERSION/ {print $3}' $rsrc/patchlevel.h`
5892 api_revision=`awk '/define[ ]+PERL_API_REVISION/ {print $3}' $rsrc/patchlevel.h`
5893 api_version=`awk '/define[ ]+PERL_API_VERSION/ {print $3}' $rsrc/patchlevel.h`
5894 api_subversion=`awk '/define[ ]+PERL_API_SUBVERSION/ {print $3}' $rsrc/patchlevel.h`
5895 perl_patchlevel=`grep ',"DEVEL[0-9][0-9]*"' $rsrc/patchlevel.h|sed 's/[^0-9]//g'`
5904 $echo "(You do not have patchlevel.h. Eek.)"
5906 if $test -r $rsrc/.patch ; then
5907 if $test "`cat $rsrc/.patch`" -gt "$perl_patchlevel" ; then
5908 perl_patchlevel=`cat $rsrc/.patch`
5911 : Define a handy string here to avoid duplication in myconfig.SH and configpm.
5912 version_patchlevel_string="version $patchlevel subversion $subversion"
5913 case "$perl_patchlevel" in
5915 *) version_patchlevel_string="$version_patchlevel_string patch $perl_patchlevel" ;;
5918 $echo "(You have $package $version_patchlevel_string.)"
5922 : XXX Should be a Configure test for double-dots in filenames.
5923 version=`echo $revision $patchlevel $subversion | \
5924 $awk '{ printf "%d_%d_%d\n", $1, $2, $3 }'`
5925 api_versionstring=`echo $api_revision $api_version $api_subversion | \
5926 $awk '{ printf "%d_%d_%d\n", $1, $2, $3 }'`
5929 version=`echo $revision $patchlevel $subversion | \
5930 $awk '{ printf "%d.%d.%d\n", $1, $2, $3 }'`
5931 api_versionstring=`echo $api_revision $api_version $api_subversion | \
5932 $awk '{ printf "%d.%d.%d\n", $1, $2, $3 }'`
5935 : Special case the 5.005_xx maintenance series, which used 5.005
5936 : without any subversion label as a subdirectory in $sitelib
5937 if test "${api_revision}${api_version}${api_subversion}" = "550"; then
5938 api_versionstring='5.005'
5941 : determine installation style
5942 : For now, try to deduce it from prefix unless it is already set.
5943 : Reproduce behavior of 5.005 and earlier, maybe drop that in 5.7.
5944 case "$installstyle" in
5945 '') case "$prefix" in
5946 *perl*) dflt='lib';;
5947 *) dflt='lib/perl5' ;;
5950 *) dflt="$installstyle" ;;
5952 : Probably not worth prompting for this since we prompt for all
5953 : the directories individually, and the prompt would be too long and
5957 : determine where private library files go
5958 : Usual default is /usr/local/lib/perl5/$version.
5959 : Also allow things like /opt/perl/lib/$version, since
5960 : /opt/perl/lib/perl5... would be redundant.
5961 : The default "style" setting is made in installstyle.U
5962 case "$installstyle" in
5963 *lib/perl5*) set dflt privlib lib/$package/$version ;;
5964 *) set dflt privlib lib/$version ;;
5969 There are some auxiliary files for $package that need to be put into a
5970 private library directory that is accessible by everyone.
5974 rp='Pathname where the private library files will reside?'
5977 privlibexp="$ansexp"
5978 : Change installation prefix, if necessary.
5979 if $test X"$prefix" != X"$installprefix"; then
5980 installprivlib=`echo $privlibexp | sed "s#^$prefix#$installprefix#"`
5982 installprivlib="$privlibexp"
5985 : set the prefixup variable, to restore leading tilda escape
5986 prefixup='case "$prefixexp" in
5988 *) eval "$1=\`echo \$$1 | sed \"s,^$prefixexp,$prefix,\"\`";;
5991 : determine where public architecture dependent libraries go
5994 : privlib default is /usr/local/lib/$package/$version
5995 : archlib default is /usr/local/lib/$package/$version/$archname
5996 : privlib may have an optional trailing /share.
5997 tdflt=`echo $privlib | $sed 's,/share$,,'`
5998 tdflt=$tdflt/$archname
6007 $spackage contains architecture-dependent library files. If you are
6008 sharing libraries in a heterogeneous environment, you might store
6009 these files in a separate location. Otherwise, you can just include
6010 them with the rest of the public library files.
6014 rp='Where do you want to put the public architecture-dependent libraries?'
6017 archlibexp="$ansexp"
6018 if $test X"$archlib" = X"$privlib"; then
6023 : Change installation prefix, if necessary.
6024 if $test X"$prefix" != X"$installprefix"; then
6025 installarchlib=`echo $archlibexp | sed "s#^$prefix#$installprefix#"`
6027 installarchlib="$archlibexp"
6030 : see if setuid scripts can be secure
6033 Some kernels have a bug that prevents setuid #! scripts from being
6034 secure. Some sites have disabled setuid #! scripts because of this.
6036 First let's decide if your kernel supports secure setuid #! scripts.
6037 (If setuid #! scripts would be secure but have been disabled anyway,
6038 don't say that they are secure if asked.)
6043 if $test -d /dev/fd; then
6044 echo "#!$ls" >reflect
6045 chmod +x,u+s reflect
6046 ./reflect >flect 2>&1
6047 if $contains "/dev/fd" flect >/dev/null; then
6048 echo "Congratulations, your kernel has secure setuid scripts!" >&4
6052 If you are not sure if they are secure, I can check but I'll need a
6053 username and password different from the one you are using right now.
6054 If you don't have such a username or don't want me to test, simply
6058 rp='Other username to test security of setuid scripts with?'
6063 case "$d_suidsafe" in
6064 '') echo "I'll assume setuid scripts are *not* secure." >&4
6067 echo "Well, the $hint value is *not* secure." >&4
6069 *) echo "Well, the $hint value *is* secure." >&4
6074 $rm -f reflect flect
6075 echo "#!$ls" >reflect
6076 chmod +x,u+s reflect
6079 echo '"su" will (probably) prompt you for '"$ans's password."
6080 su $ans -c './reflect >flect'
6081 if $contains "/dev/fd" flect >/dev/null; then
6082 echo "Okay, it looks like setuid scripts are secure." >&4
6085 echo "I don't think setuid scripts are secure." >&4
6090 rp='Does your kernel have *secure* setuid scripts?'
6093 [yY]*) val="$define";;
6098 echo "I don't think setuid scripts are secure (no /dev/fd directory)." >&4
6099 echo "(That's for file descriptors, not floppy disks.)"
6105 $rm -f reflect flect
6107 : now see if they want to do setuid emulation
6110 case "$d_suidsafe" in
6113 echo "No need to emulate SUID scripts since they are secure here." >&4
6117 Some systems have disabled setuid scripts, especially systems where
6118 setuid scripts cannot be secure. On systems where setuid scripts have
6119 been disabled, the setuid/setgid bits on scripts are currently
6120 useless. It is possible for $package to detect those bits and emulate
6121 setuid/setgid in a secure fashion. This emulation will only work if
6122 setuid scripts have been disabled in your kernel.
6126 "$define") dflt=y ;;
6129 rp="Do you want to do setuid/setgid emulation?"
6132 [yY]*) val="$define";;
6140 : see if this is a malloc.h system
6141 : we want a real compile instead of Inhdr because some systems have a
6142 : malloc.h that just gives a compile error saying to use stdlib.h instead
6147 int main () { return 0; }
6150 if eval $compile; then
6151 echo "<malloc.h> found." >&4
6154 echo "<malloc.h> NOT found." >&4
6161 : check for void type
6163 echo "Checking to see how well your C compiler groks the void type..." >&4
6164 case "$voidflags" in
6176 extern void moo(); /* function returning void */
6177 void (*goo)(); /* ptr to func returning void */
6179 void *hue; /* generic ptr */
6192 int main() { sub(); }
6194 if $cc $ccflags -c -DTRY=$defvoidused try.c >.out 2>&1 ; then
6195 voidflags=$defvoidused
6196 echo "Good. It appears to support void to the level $package wants.">&4
6197 if $contains warning .out >/dev/null 2>&1; then
6198 echo "However, you might get some warnings that look like this:"
6202 echo "Hmm, your compiler has some difficulty with void. Checking further..." >&4
6203 if $cc $ccflags -c -DTRY=1 try.c >/dev/null 2>&1; then
6204 echo "It supports 1..."
6205 if $cc $ccflags -c -DTRY=3 try.c >/dev/null 2>&1; then
6206 echo "It also supports 2..."
6207 if $cc $ccflags -c -DTRY=7 try.c >/dev/null 2>&1; then
6209 echo "And it supports 4 but not 8 definitely."
6211 echo "It doesn't support 4..."
6212 if $cc $ccflags -c -DTRY=11 try.c >/dev/null 2>&1; then
6214 echo "But it supports 8."
6217 echo "Neither does it support 8."
6221 echo "It does not support 2..."
6222 if $cc $ccflags -c -DTRY=13 try.c >/dev/null 2>&1; then
6224 echo "But it supports 4 and 8."
6226 if $cc $ccflags -c -DTRY=5 try.c >/dev/null 2>&1; then
6228 echo "And it supports 4 but has not heard about 8."
6230 echo "However it supports 8 but not 4."
6235 echo "There is no support at all for void."
6240 case "$voidflags" in
6243 Support flag bits are:
6244 1: basic void declarations.
6245 2: arrays of pointers to functions returning void.
6246 4: operations between pointers to and addresses of void functions.
6247 8: generic void pointers.
6250 rp="Your void support flags add up to what?"
6257 : check for length of pointer
6261 echo "Checking to see how big your pointers are..." >&4
6262 if test "$voidflags" -gt 7; then
6263 echo '#define VOID_PTR char *' > try.c
6265 echo '#define VOID_PTR void *' > try.c
6275 printf("%d\n", (int)sizeof(VOID_PTR));
6280 if eval $compile_ok; then
6281 ptrsize=`$run ./try`
6282 echo "Your pointers are $ptrsize bytes long."
6285 echo "(I can't seem to compile the test program. Guessing...)" >&4
6286 rp="What is the size of a pointer (in bytes)?"
6293 case "$use64bitall" in
6294 "$define"|true|[yY]*)
6298 *** You have chosen a maximally 64-bit build,
6299 *** but your pointers are only 4 bytes wide.
6300 *** Please rerun Configure without -Duse64bitall.
6305 *** Since you have quads, you could possibly try with -Duse64bitint.
6310 *** Cannot continue, aborting.
6321 : determine whether to use malloc wrapping
6323 case "$usemallocwrap" in
6324 [yY]*|true|$define) dflt='y' ;;
6325 [nN]*|false|$undef) dflt='n' ;;
6326 *) case "$usedevel" in
6327 [yY]*|true|$define) dflt='y' ;;
6332 rp="Do you wish to wrap malloc calls to protect against potential overflows?"
6334 usemallocwrap="$ans"
6337 usemallocwrap="$define" ;;
6339 usemallocwrap="$undef" ;;
6342 : determine which malloc to compile in
6344 case "$usemymalloc" in
6345 [yY]*|true|$define) dflt='y' ;;
6346 [nN]*|false|$undef) dflt='n' ;;
6347 *) case "$ptrsize" in
6353 rp="Do you wish to attempt to use the malloc that comes with $package?"
6359 mallocsrc='malloc.c'
6360 mallocobj="malloc$_o"
6361 d_mymalloc="$define"
6364 : Remove malloc from list of libraries to use
6365 echo "Removing unneeded -lmalloc from library list" >&4
6366 set `echo X $libs | $sed -e 's/-lmalloc / /' -e 's/-lmalloc$//'`
6369 echo "libs = $libs" >&4
6381 : compute the return types of malloc and free
6383 $cat >malloc.c <<END
6387 #include <sys/types.h>
6401 case "$malloctype" in
6403 if $cc $ccflags -c -DTRY_MALLOC malloc.c >/dev/null 2>&1; then
6410 echo "Your system wants malloc to return '$malloctype', it would seem." >&4
6414 if $cc $ccflags -c -DTRY_FREE malloc.c >/dev/null 2>&1; then
6421 echo "Your system uses $freetype free(), it would seem." >&4
6425 After $package is installed, you may wish to install various
6426 add-on modules and utilities. Typically, these add-ons will
6427 be installed under $prefix with the rest
6428 of this package. However, you may wish to install such add-ons
6429 elsewhere under a different prefix.
6431 If you do not wish to put everything under a single prefix, that's
6432 ok. You will be prompted for the individual locations; this siteprefix
6433 is only used to suggest the defaults.
6435 The default should be fine for most people.
6439 rp='Installation prefix to use for add-on modules and utilities?'
6440 : XXX Here might be another good place for an installstyle setting.
6441 case "$siteprefix" in
6443 *) dflt=$siteprefix ;;
6446 : XXX Prefixit unit does not yet support siteprefix and vendorprefix
6448 case "$siteprefix" in
6452 *) oldsiteprefix="$prefix";;
6457 siteprefixexp="$ansexp"
6459 : determine where site specific libraries go.
6460 : Usual default is /usr/local/lib/perl5/site_perl/$version
6461 : The default "style" setting is made in installstyle.U
6462 : XXX No longer works with Prefixit stuff.
6463 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
6465 '') case "$installstyle" in
6466 *lib/perl5*) dflt=$siteprefix/lib/$package/site_$prog/$version ;;
6467 *) dflt=$siteprefix/lib/site_$prog/$version ;;
6475 The installation process will create a directory for
6476 site-specific extensions and modules. Most users find it convenient
6477 to place all site-specific files in this directory rather than in the
6478 main distribution directory.
6482 rp='Pathname for the site-specific library files?'
6485 sitelibexp="$ansexp"
6486 sitelib_stem=`echo "$sitelibexp" | sed "s,/$version$,,"`
6487 : Change installation prefix, if necessary.
6488 if $test X"$prefix" != X"$installprefix"; then
6489 installsitelib=`echo $sitelibexp | $sed "s#^$prefix#$installprefix#"`
6491 installsitelib="$sitelibexp"
6494 : determine where site specific architecture-dependent libraries go.
6495 : sitelib default is /usr/local/lib/perl5/site_perl/$version
6496 : sitearch default is /usr/local/lib/perl5/site_perl/$version/$archname
6497 : sitelib may have an optional trailing /share.
6499 '') dflt=`echo $sitelib | $sed 's,/share$,,'`
6500 dflt="$dflt/$archname"
6505 set sitearch sitearch none
6509 The installation process will also create a directory for
6510 architecture-dependent site-specific extensions and modules.
6514 rp='Pathname for the site-specific architecture-dependent library files?'
6517 sitearchexp="$ansexp"
6518 : Change installation prefix, if necessary.
6519 if $test X"$prefix" != X"$installprefix"; then
6520 installsitearch=`echo $sitearchexp | sed "s#^$prefix#$installprefix#"`
6522 installsitearch="$sitearchexp"
6527 The installation process will also create a directory for
6528 vendor-supplied add-ons. Vendors who supply perl with their system
6529 may find it convenient to place all vendor-supplied files in this
6530 directory rather than in the main distribution directory. This will
6531 ease upgrades between binary-compatible maintenance versions of perl.
6533 Of course you may also use these directories in whatever way you see
6534 fit. For example, you might use them to access modules shared over a
6535 company-wide network.
6537 The default answer should be fine for most people.
6538 This causes further questions about vendor add-ons to be skipped
6539 and no vendor-specific directories will be configured for perl.
6542 rp='Do you want to configure vendor-specific add-on directories?'
6543 case "$usevendorprefix" in
6544 define|true|[yY]*) dflt=y ;;
6545 *) : User may have set vendorprefix directly on Configure command line.
6546 case "$vendorprefix" in
6555 rp='Installation prefix to use for vendor-supplied add-ons?'
6556 case "$vendorprefix" in
6558 *) dflt=$vendorprefix ;;
6561 : XXX Prefixit unit does not yet support siteprefix and vendorprefix
6563 case "$vendorprefix" in
6567 *) oldvendorprefix="$prefix";;
6571 usevendorprefix="$define"
6573 vendorprefixexp="$ansexp"
6575 *) usevendorprefix="$undef"
6581 case "$vendorprefix" in
6582 '') d_vendorlib="$undef"
6586 *) d_vendorlib="$define"
6587 : determine where vendor-supplied modules go.
6588 : Usual default is /usr/local/lib/perl5/vendor_perl/$version
6589 case "$vendorlib" in
6591 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
6592 case "$installstyle" in
6593 *lib/perl5*) dflt=$vendorprefix/lib/$package/vendor_$prog/$version ;;
6594 *) dflt=$vendorprefix/lib/vendor_$prog/$version ;;
6597 *) dflt="$vendorlib"
6601 rp='Pathname for the vendor-supplied library files?'
6604 vendorlibexp="$ansexp"
6607 vendorlib_stem=`echo "$vendorlibexp" | sed "s,/$version$,,"`
6608 : Change installation prefix, if necessary.
6609 if $test X"$prefix" != X"$installprefix"; then
6610 installvendorlib=`echo $vendorlibexp | $sed "s#^$prefix#$installprefix#"`
6612 installvendorlib="$vendorlibexp"
6615 case "$vendorprefix" in
6616 '') d_vendorarch="$undef"
6620 *) d_vendorarch="$define"
6621 : determine where vendor-supplied architecture-dependent libraries go.
6622 : vendorlib default is /usr/local/lib/perl5/vendor_perl/$version
6623 : vendorarch default is /usr/local/lib/perl5/vendor_perl/$version/$archname
6624 : vendorlib may have an optional trailing /share.
6625 case "$vendorarch" in
6626 '') dflt=`echo $vendorlib | $sed 's,/share$,,'`
6627 dflt="$dflt/$archname"
6629 *) dflt="$vendorarch" ;;
6632 rp='Pathname for vendor-supplied architecture-dependent files?'
6635 vendorarchexp="$ansexp"
6638 : Change installation prefix, if necessary.
6639 if $test X"$prefix" != X"$installprefix"; then
6640 installvendorarch=`echo $vendorarchexp | sed "s#^$prefix#$installprefix#"`
6642 installvendorarch="$vendorarchexp"
6645 : Final catch-all directories to search
6648 Lastly, you can have perl look in other directories for extensions and
6649 modules in addition to those already specified.
6650 These directories will be searched after
6654 test X"$vendorlib" != "X" && echo ' ' $vendorlib
6655 test X"$vendorarch" != "X" && echo ' ' $vendorarch
6657 case "$otherlibdirs" in
6658 ''|' ') dflt='none' ;;
6659 *) dflt="$otherlibdirs" ;;
6662 Enter a colon-separated set of extra paths to include in perl's @INC
6663 search path, or enter 'none' for no extra paths.
6667 rp='Colon-separated list of additional directories for perl to search?'
6670 ' '|''|none) otherlibdirs=' ' ;;
6671 *) otherlibdirs="$ans" ;;
6673 case "$otherlibdirs" in
6677 set d_perl_otherlibdirs
6680 : Cruising for prototypes
6682 echo "Checking out function prototypes..." >&4
6683 $cat >prototype.c <<EOCP
6688 int main(int argc, char *argv[]) {
6691 if $cc $ccflags -c prototype.c >prototype.out 2>&1 ; then
6692 echo "Your C compiler appears to support function prototypes."
6695 echo "Your C compiler doesn't seem to understand function prototypes."
6702 case "$prototype" in
6704 *) ansi2knr='ansi2knr'
6709 This version of $package can only be compiled by a compiler that
6710 understands function prototypes. Unfortunately, your C compiler
6712 doesn't seem to understand them. Sorry about that.
6714 If GNU cc is available for your system, perhaps you could try that instead.
6716 Eventually, we hope to support building Perl with pre-ANSI compilers.
6717 If you would like to help in that effort, please contact <perlbug@perl.org>.
6719 Aborting Configure now.
6725 : determine where public executables go
6730 rp='Pathname where the public executables will reside?'
6732 if $test "X$ansexp" != "X$binexp"; then
6737 : Change installation prefix, if necessary.
6738 : XXX Bug? -- ignores Configure -Dinstallprefix setting.
6739 if $test X"$prefix" != X"$installprefix"; then
6740 installbin=`echo $binexp | sed "s#^$prefix#$installprefix#"`
6742 installbin="$binexp"
6751 Perl can be built with extra modules or bundles of modules which
6752 will be fetched from the CPAN and installed alongside Perl.
6754 Notice that you will need access to the CPAN; either via the Internet,
6755 or a local copy, for example a CD-ROM or a local CPAN mirror. (You will
6756 be asked later to configure the CPAN.pm module which will in turn do
6757 the installation of the rest of the extra modules or bundles.)
6759 Notice also that if the modules require any external software such as
6760 libraries and headers (the libz library and the zlib.h header for the
6761 Compress::Zlib module, for example) you MUST have any such software
6762 already installed, this configuration process will NOT install such
6765 If this doesn't make any sense to you, just accept the default '$dflt'.
6767 rp='Install any extra modules (y or n)?'
6773 Please list any extra modules or bundles to be installed from CPAN,
6774 with spaces between the names. The names can be in any format the
6775 'install' command of CPAN.pm will understand. (Answer 'none',
6776 without the quotes, to install no extra modules or bundles.)
6786 $rm -f ../extras.lst
6788 *) echo "(Saving the list of extras for later...)"
6789 echo "$extras" > ../extras.lst
6797 : determine where html pages for programs go
6798 set html1dir html1dir none
6802 If you wish to install html files for programs in $spackage, indicate
6803 the appropriate directory here. To skip installing html files,
6807 ''|none|$undef|' ') dflt=none ;;
6808 *) dflt=$html1dir ;;
6811 rp="Directory for the main $spackage html pages?"
6814 html1direxp="$ansexp"
6815 : Use ' ' for none so value is preserved next time through Configure
6816 $test X"$html1dir" = "X" && html1dir=' '
6817 : Change installation prefix, if necessary.
6818 if $test X"$prefix" != X"$installprefix"; then
6819 installhtml1dir=`echo $html1direxp | sed "s#^$prefix#$installprefix#"`
6821 installhtml1dir="$html1direxp"
6824 : determine where html pages for libraries and modules go
6825 set html3dir html3dir none
6829 If you wish to install html files for modules associated with $spackage,
6830 indicate the appropriate directory here. To skip installing html files,
6833 : There is no obvious default. If they have specified html1dir, then
6834 : try to key off that, possibly changing .../html1 into .../html3.
6836 '') html3dir=`echo "$html1dir" | $sed 's/1$/3$/'` ;;
6837 *) dflt=$html3dir ;;
6840 rp="Directory for the $spackage module html pages?"
6843 html3direxp="$ansexp"
6844 : Use ' ' for none so value is preserved next time through Configure
6845 $test X"$html3dir" = "X" && html3dir=' '
6846 : Change installation prefix, if necessary.
6847 if $test X"$prefix" != X"$installprefix"; then
6848 installhtml3dir=`echo $html3direxp | sed "s#^$prefix#$installprefix#"`
6850 installhtml3dir="$html3direxp"
6853 : Find perl5.005 or later.
6854 echo "Looking for a previously installed perl5.005 or later... "
6856 '') for tdir in `echo "$binexp$path_sep$PATH" | $sed "s/$path_sep/ /g"`; do
6857 : Check if this perl is recent and can load a simple module
6858 if $test -x $tdir/perl$exe_ext && $tdir/perl -Mless -e 'use 5.005;' >/dev/null 2>&1; then
6861 elif $test -x $tdir/perl5$exe_ext && $tdir/perl5 -Mless -e 'use 5.005;' >/dev/null 2>&1; then
6871 '') echo "None found. That's ok.";;
6872 *) echo "Using $perl5." ;;
6875 : Determine list of previous versions to include in @INC
6876 $cat > getverlist <<EOPL
6879 \$api_versionstring = "$api_versionstring";
6880 \$version = "$version";
6881 \$stem = "$sitelib_stem";
6882 \$archname = "$archname";
6884 $cat >> getverlist <<'EOPL'
6885 # Can't have leading @ because metaconfig interprets it as a command!
6886 ;@inc_version_list=();
6887 # XXX Redo to do opendir/readdir?
6890 ;@candidates = glob("5.*");
6896 # XXX ToDo: These comparisons must be reworked when two-digit
6897 # subversions come along, so that 5.7.10 compares as greater than
6898 # 5.7.3! By that time, hope that 5.6.x is sufficiently
6899 # widespread that we can use the built-in version vectors rather
6900 # than reinventing them here. For 5.6.0, however, we must
6901 # assume this script will likely be run by 5.005_0x. --AD 1/2000.
6902 foreach $d (@candidates) {
6903 if ($d lt $version) {
6904 if ($d ge $api_versionstring) {
6905 unshift(@inc_version_list, grep { -d } "$d/$archname", $d);
6907 elsif ($d ge "5.005") {
6908 unshift(@inc_version_list, grep { -d } $d);
6912 # Skip newer version. I.e. don't look in
6913 # 5.7.0 if we're installing 5.6.1.
6917 if (@inc_version_list) {
6918 print join(' ', @inc_version_list);
6921 # Blank space to preserve value for next Configure run.
6926 case "$inc_version_list" in
6927 '') if test -x "$perl5$exe_ext"; then
6928 dflt=`$perl5 getverlist`
6933 $undef) dflt='none' ;;
6934 *) eval dflt=\"$inc_version_list\" ;;
6937 ''|' ') dflt=none ;;
6944 In order to ease the process of upgrading, this version of perl
6945 can be configured to use modules built and installed with earlier
6946 versions of perl that were installed under $prefix. Specify here
6947 the list of earlier versions that this version of perl should check.
6948 If Configure detected no earlier versions of perl installed under
6949 $prefix, then the list will be empty. Answer 'none' to tell perl
6950 to not search earlier versions.
6952 The default should almost always be sensible, so if you're not sure,
6953 just accept the default.
6956 rp='List of earlier versions to include in @INC?'
6959 [Nn]one|''|' '|$undef) inc_version_list=' ' ;;
6960 *) inc_version_list="$ans" ;;
6962 case "$inc_version_list" in
6964 inc_version_list_init='0';;
6965 *) inc_version_list_init=`echo $inc_version_list |
6966 $sed -e 's/^/"/' -e 's/ /","/g' -e 's/$/",0/'`
6971 : determine whether to install perl also as /usr/bin/perl
6974 if $test -d /usr/bin -a "X$installbin" != X/usr/bin; then
6976 Many scripts expect perl to be installed as /usr/bin/perl.
6978 If you want to, I can install the perl you are about to compile
6979 as /usr/bin/perl (in addition to $bin/perl).
6981 if test -f /usr/bin/perl; then
6984 However, please note that because you already have a /usr/bin/perl,
6985 overwriting that with a new Perl would very probably cause problems.
6986 Therefore I'm assuming you don't want to do that (unless you insist).
6989 case "$installusrbinperl" in
6990 "$define"|[yY]*) dflt='y';;
6996 Since you don't have a /usr/bin/perl I'm assuming creating one is okay.
6999 case "$installusrbinperl" in
7000 "$undef"|[nN]*) dflt='n';;
7004 rp="Do you want to install perl as /usr/bin/perl?"
7007 [yY]*) val="$define";;
7013 set installusrbinperl
7017 echo "Checking for GNU C Library..." >&4
7019 /* Find out version of GNU C library. __GLIBC__ and __GLIBC_MINOR__
7020 alone are insufficient to distinguish different versions, such as
7021 2.0.6 and 2.0.7. The function gnu_get_libc_version() appeared in
7022 libc version 2.1.0. A. Dougherty, June 3, 2002.
7028 # ifdef __GLIBC_MINOR__
7029 # if __GLIBC__ >= 2 && __GLIBC_MINOR__ >= 1
7030 # include <gnu/libc-version.h>
7031 printf("%s\n", gnu_get_libc_version());
7033 printf("%d.%d\n", __GLIBC__, __GLIBC_MINOR__);
7036 printf("%d\n", __GLIBC__);
7045 if eval $compile_ok && $run ./try > glibc.ver; then
7047 gnulibc_version=`$cat glibc.ver`
7048 echo "You are using the GNU C Library version $gnulibc_version"
7052 echo "You are not using the GNU C Library"
7054 $rm -f try try.* glibc.ver
7058 : see if nm is to be used to determine whether a symbol is defined or not
7062 case "$d_gnulibc" in
7065 echo "nm probably won't work on the GNU C Library." >&4
7071 if $test "$osname" = aix -a "X$PASE" != "Xdefine" -a ! -f /lib/syscalls.exp; then
7073 echo "Whoops! This is an AIX system without /lib/syscalls.exp!" >&4
7074 echo "'nm' won't be sufficient on this sytem." >&4
7080 '') dflt=`$egrep 'inlibc|csym' $rsrc/Configure | wc -l 2>/dev/null`
7081 if $test $dflt -gt 20; then
7091 true|$define) dflt=y;;
7098 I can use $nm to extract the symbols from your C libraries. This
7099 is a time consuming task which may generate huge output on the disk (up
7100 to 3 megabytes) but that should make the symbols extraction faster. The
7101 alternative is to skip the 'nm' extraction part and to compile a small
7102 test program instead to determine whether each symbol is present. If
7103 you have a fast C compiler and/or if your 'nm' output cannot be parsed,
7104 this may be the best solution.
7106 You probably shouldn't let me use 'nm' if you are using the GNU C Library.
7109 rp="Shall I use $nm to extract C symbols from the libraries?"
7112 [Nn]*) usenm=false;;
7121 : nm options which may be necessary
7123 '') if $test -f /mach_boot; then
7125 elif $test -d /usr/ccs/lib; then
7126 nm_opt='-p' # Solaris (and SunOS?)
7127 elif $test -f /dgux; then
7129 elif $test -f /lib64/rld; then
7130 nm_opt='-p' # 64-bit Irix
7136 : nm options which may be necessary for shared libraries but illegal
7137 : for archive libraries. Thank you, Linux.
7138 case "$nm_so_opt" in
7139 '') case "$myuname" in
7141 if $nm --help | $grep 'dynamic' > /dev/null 2>&1; then
7142 nm_so_opt='--dynamic'
7151 : get list of predefined functions in a handy place
7156 *-lc_s*) libc=`./loc libc_s$_a $libc $libpth`
7162 *) for thislib in $libs; do
7165 : Handle C library specially below.
7168 thislib=`echo $thislib | $sed -e 's/^-l//'`
7169 if try=`./loc lib$thislib.$so.'*' X $libpth`; $test -f "$try"; then
7171 elif try=`./loc lib$thislib.$so X $libpth`; $test -f "$try"; then
7173 elif try=`./loc lib$thislib$_a X $libpth`; $test -f "$try"; then
7175 elif try=`./loc $thislib$_a X $libpth`; $test -f "$try"; then
7177 elif try=`./loc lib$thislib X $libpth`; $test -f "$try"; then
7179 elif try=`./loc $thislib X $libpth`; $test -f "$try"; then
7181 elif try=`./loc Slib$thislib$_a X $xlibpth`; $test -f "$try"; then
7186 libnames="$libnames $try"
7188 *) libnames="$libnames $thislib" ;;
7197 for xxx in $libpth; do
7198 $test -r $1 || set $xxx/libc.$so
7199 : The messy sed command sorts on library version numbers.
7201 set `echo blurfl; echo $xxx/libc.$so.[0-9]* | \
7202 tr ' ' $trnl | egrep -v '\.[A-Za-z]*$' | $sed -e '
7204 s/[0-9][0-9]*/0000&/g
7205 s/0*\([0-9][0-9][0-9][0-9][0-9]\)/\1/g
7208 $sort | $sed -e 's/^.* //'`
7211 $test -r $1 || set /usr/ccs/lib/libc.$so
7212 $test -r $1 || set /lib/libsys_s$_a
7218 if $test -r "$1"; then
7219 echo "Your (shared) C library seems to be in $1."
7221 elif $test -r /lib/libc && $test -r /lib/clib; then
7222 echo "Your C library seems to be in both /lib/clib and /lib/libc."
7224 libc='/lib/clib /lib/libc'
7225 if $test -r /lib/syslib; then
7226 echo "(Your math library is in /lib/syslib.)"
7227 libc="$libc /lib/syslib"
7229 elif $test -r "$libc" || (test -h "$libc") >/dev/null 2>&1; then
7230 echo "Your C library seems to be in $libc, as you said before."
7231 elif $test -r $incpath/usr/lib/libc$_a; then
7232 libc=$incpath/usr/lib/libc$_a;
7233 echo "Your C library seems to be in $libc. That's fine."
7234 elif $test -r /lib/libc$_a; then
7236 echo "Your C library seems to be in $libc. You're normal."
7238 if tans=`./loc libc$_a blurfl/dyick $libpth`; $test -r "$tans"; then
7240 elif tans=`./loc libc blurfl/dyick $libpth`; $test -r "$tans"; then
7241 libnames="$libnames "`./loc clib blurfl/dyick $libpth`
7242 elif tans=`./loc clib blurfl/dyick $libpth`; $test -r "$tans"; then
7244 elif tans=`./loc Slibc$_a blurfl/dyick $xlibpth`; $test -r "$tans"; then
7246 elif tans=`./loc Mlibc$_a blurfl/dyick $xlibpth`; $test -r "$tans"; then
7249 tans=`./loc Llibc$_a blurfl/dyick $xlibpth`
7251 if $test -r "$tans"; then
7252 echo "Your C library seems to be in $tans, of all places."
7258 if $test $xxx = apollo -o -r "$libc" || (test -h "$libc") >/dev/null 2>&1; then
7262 If the guess above is wrong (which it might be if you're using a strange
7263 compiler, or your machine supports multiple models), you can override it here.
7268 echo $libpth | $tr ' ' $trnl | $sort | $uniq > libpath
7270 I can't seem to find your C library. I've looked in the following places:
7273 $sed 's/^/ /' libpath
7276 None of these seems to contain your C library. I need to get its name...
7281 rp='Where is your C library?'
7286 echo $libc $libnames | $tr ' ' $trnl | $sort | $uniq > libnames
7287 set X `cat libnames`
7290 case $# in 1) xxx=file; esac
7291 echo "Extracting names from the following $xxx for later perusal:" >&4
7293 $sed 's/^/ /' libnames >&4
7295 $echo $n "This may take a while...$c" >&4
7299 *$so*) $nm $nm_so_opt $nm_opt $file 2>/dev/null;;
7300 *) $nm $nm_opt $file 2>/dev/null;;
7305 $grep fprintf libc.tmp > libc.ptf
7306 xscan='eval "<libc.ptf $com >libc.list"; $echo $n ".$c" >&4'
7307 xrun='eval "<libc.tmp $com >libc.list"; echo "done." >&4'
7309 if com="$sed -n -e 's/__IO//' -e 's/^.* $xxx *//p'";\
7311 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7313 elif com="$sed -n -e 's/^__*//' -e 's/^\([a-zA-Z_0-9$]*\).*xtern.*/\1/p'";\
7315 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7317 elif com="$sed -n -e '/|UNDEF/d' -e '/FUNC..GL/s/^.*|__*//p'";\
7319 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7321 elif com="$sed -n -e 's/^.* D __*//p' -e 's/^.* D //p'";\
7323 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7325 elif com="$sed -n -e 's/^_//' -e 's/^\([a-zA-Z_0-9]*\).*xtern.*text.*/\1/p'";\
7327 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7329 elif com="$sed -n -e 's/^.*|FUNC |GLOB .*|//p'";\
7331 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7333 elif com="$grep '|' | $sed -n -e '/|COMMON/d' -e '/|DATA/d' \
7334 -e '/ file/d' -e 's/^\([^ ]*\).*/\1/p'";\
7336 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7338 elif com="$sed -n -e 's/^.*|FUNC |GLOB .*|//p' -e 's/^.*|FUNC |WEAK .*|//p'";\
7340 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7342 elif com="$sed -n -e 's/^__//' -e '/|Undef/d' -e '/|Proc/s/ .*//p'";\
7344 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7346 elif com="$sed -n -e 's/^.*|Proc .*|Text *| *//p'";\
7348 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7350 elif com="$sed -n -e '/Def. Text/s/.* \([^ ]*\)\$/\1/p'";\
7352 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7354 elif com="$sed -n -e 's/^[-0-9a-f ]*_\(.*\)=.*/\1/p'";\
7356 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7358 elif com="$sed -n -e 's/.*\.text n\ \ \ \.//p'";\
7360 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7362 elif com="sed -n -e 's/^__.*//' -e 's/[ ]*D[ ]*[0-9]*.*//p'";\
7364 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7367 $nm -p $* 2>/dev/null >libc.tmp
7368 $grep fprintf libc.tmp > libc.ptf
7369 if com="$sed -n -e 's/^.* [ADTSIW] *_[_.]*//p' -e 's/^.* [ADTSIW] //p'";\
7370 eval $xscan; $contains '^fprintf$' libc.list >/dev/null 2>&1
7376 echo "$nm didn't seem to work right. Trying $ar instead..." >&4
7378 if $ar t $libc > libc.tmp && $contains '^fprintf$' libc.tmp >/dev/null 2>&1; then
7379 for thisname in $libnames $libc; do
7380 $ar t $thisname >>libc.tmp
7382 $sed -e "s/\\$_o\$//" < libc.tmp > libc.list
7384 elif test "X$osname" = "Xos2" && $ar tv $libc > libc.tmp; then
7385 # Repeat libc to extract forwarders to DLL entries too
7386 for thisname in $libnames $libc; do
7387 $ar tv $thisname >>libc.tmp
7388 # Revision 50 of EMX has bug in $ar.
7389 # it will not extract forwarders to DLL entries
7390 # Use emximp which will extract exactly them.
7391 emximp -o tmp.imp $thisname \
7393 $sed -e 's/^\([_a-zA-Z0-9]*\) .*$/\1/p' \
7394 < tmp.imp >>libc.tmp
7397 $sed -e "s/\\$_o\$//" -e 's/^ \+//' < libc.tmp > libc.list
7400 echo "$ar didn't seem to work right." >&4
7401 echo "Maybe this is a Cray...trying bld instead..." >&4
7402 if bld t $libc | $sed -e 's/.*\///' -e "s/\\$_o:.*\$//" > libc.list
7404 for thisname in $libnames; do
7406 $sed -e 's/.*\///' -e "s/\\$_o:.*\$//" >>libc.list
7407 $ar t $thisname >>libc.tmp
7411 echo "That didn't work either. Giving up." >&4
7421 echo "Since you are compiling for PASE, extracting more symbols from libc.a ...">&4
7422 dump -Tv /lib/libc.a | awk '$7 == "/unix" {print $5 " " $8}' | grep "^SV" | awk '{print $2}' >> libc.list
7424 *) if $test -f /lib/syscalls.exp; then
7426 echo "Also extracting names from /lib/syscalls.exp for good ole AIX..." >&4
7427 $sed -n 's/^\([^ ]*\)[ ]*syscall[0-9]*[ ]*$/\1/p' /lib/syscalls.exp >>libc.list
7433 $rm -f libnames libpath
7435 : see if dld is available
7439 : is a C symbol defined?
7442 -v) tf=libc.tmp; tdc="";;
7443 -a) tf=libc.tmp; tdc="[]";;
7444 *) tlook="^$1\$"; tf=libc.list; tdc="()";;
7447 case "$reuseval-$4" in
7449 true-*) tx=no; eval "tval=\$$4"; case "$tval" in "") tx=yes;; esac;;
7454 if $test "$runnm" = true; then
7455 if $contains $tlook $tf >/dev/null 2>&1; then
7457 elif $test "$mistrustnm" = compile -o "$mistrustnm" = run; then
7458 echo "void *(*(p()))$tdc { extern void *$1$tdc; return &$1; } int main() { if(p()) return(0); else return(1); }"> try.c;
7459 $cc -o try $optimize $ccflags $ldflags try.c >/dev/null 2>&1 $libs && tval=true;
7460 $test "$mistrustnm" = run -a -x try && { $run ./try$_exe >/dev/null 2>&1 || tval=false; };
7461 $rm -f try$_exe try.c core core.* try.core;
7464 echo "void *(*(p()))$tdc { extern void *$1$tdc; return &$1; } int main() { if(p()) return(0); else return(1); }"> try.c;
7465 $cc -o try $optimize $ccflags $ldflags try.c $libs >/dev/null 2>&1 && tval=true;
7466 $rm -f try$_exe try.c;
7471 $define) tval=true;;
7478 : define an is-in-libc? function
7479 inlibc='echo " "; td=$define; tu=$undef;
7480 sym=$1; var=$2; eval "was=\$$2";
7482 case "$reuseval$was" in
7492 echo "$sym() found." >&4;
7493 case "$was" in $undef) . ./whoa; esac; eval "$var=\$td";;
7495 echo "$sym() NOT found." >&4;
7496 case "$was" in $define) . ./whoa; esac; eval "$var=\$tu";;
7500 $define) echo "$sym() found." >&4;;
7501 *) echo "$sym() NOT found." >&4;;
7505 : see if dlopen exists
7512 : determine which dynamic loading, if any, to compile in
7514 dldir="ext/DynaLoader"
7527 $define) dflt='y' ;;
7530 $define) dflt='y' ;;
7532 : Does a dl_xxx.xs file exist for this operating system
7533 $test -f $rsrc/$dldir/dl_${osname}.xs && dflt='y'
7536 rp="Do you wish to use dynamic loading?"
7543 if $test -f $rsrc/$dldir/dl_${osname}.xs ; then
7544 dflt="$dldir/dl_${osname}.xs"
7545 elif $test "$d_dlopen" = "$define" ; then
7546 dflt="$dldir/dl_dlopen.xs"
7547 elif $test "$i_dld" = "$define" ; then
7548 dflt="$dldir/dl_dld.xs"
7553 *) dflt="$dldir/$dlsrc"
7556 echo "The following dynamic loading files are available:"
7557 : Can not go over to $dldir because getfile has path hard-coded in.
7558 tdir=`pwd`; cd "$rsrc"; $ls -C $dldir/dl*.xs; cd "$tdir"
7559 rp="Source file to use for dynamic loading"
7565 dlsrc=`echo $ans | $sed -e 's%.*/\([^/]*\)$%\1%'`
7569 Some systems may require passing special flags to $cc -c to
7570 compile modules that will be used to create a shared library.
7571 To use no flags, say "none".
7574 case "$cccdlflags" in
7575 '') case "$gccversion" in
7576 '') case "$osname" in
7578 next) dflt='none' ;;
7579 irix*) dflt='-KPIC' ;;
7580 svr4*|esix*|solaris|nonstopux) dflt='-KPIC' ;;
7581 sunos) dflt='-pic' ;;
7585 *) case "$osname" in
7586 darwin) dflt='none' ;;
7587 svr4*|esix*|solaris|nonstopux) dflt='-fPIC' ;;
7592 *) dflt="$cccdlflags" ;;
7594 rp="Any special flags to pass to $cc -c to compile shared library modules?"
7597 none) cccdlflags=' ' ;;
7598 *) cccdlflags="$ans" ;;
7603 Some systems use ld to create libraries that can be dynamically loaded,
7604 while other systems (such as those using ELF) use $cc.
7608 '') $cat >try.c <<EOM
7609 /* Test for whether ELF binaries are produced */
7617 int i = open("a.out",O_RDONLY);
7620 if(read(i,b,4)==4 && b[0]==127 && b[1]=='E' && b[2]=='L' && b[3]=='F')
7621 exit(0); /* succeed (yes, it's ELF) */
7626 if $cc $ccflags $ldflags try.c >/dev/null 2>&1 && $run ./a.out; then
7628 You appear to have ELF support. I'll use $cc to build dynamic libraries.
7632 echo "I'll use ld to build dynamic libraries."
7641 rp="What command should be used to create dynamic libraries?"
7647 Some systems may require passing special flags to $ld to create a
7648 library that can be dynamically loaded. If your ld flags include
7649 -L/other/path options to locate libraries outside your loader's normal
7650 search path, you may need to specify those -L options here as well. To
7651 use no flags, say "none".
7654 case "$lddlflags" in
7655 '') case "$osname" in
7656 beos) dflt='-nostart' ;;
7658 case "$gccversion" in
7659 '') dflt="$dflt +vnocompatwarnings" ;;
7662 linux|irix*|gnu*) dflt='-shared' ;;
7663 next) dflt='none' ;;
7664 solaris) dflt='-G' ;;
7665 sunos) dflt='-assert nodefinitions' ;;
7666 svr4*|esix*|nonstopux) dflt="-G $ldflags" ;;
7670 *) dflt="$lddlflags" ;;
7673 : Try to guess additional flags to pick up local libraries.
7674 : Be careful not to append to a plain 'none'
7678 for thisflag in $ldflags; do
7683 *) dflt="$dflt $thisflag" ;;
7690 ''|' ') dflt='none' ;;
7693 rp="Any special flags to pass to $ld to create a dynamically loaded library?"
7696 none) lddlflags=' ' ;;
7697 *) lddlflags="$ans" ;;
7702 Some systems may require passing special flags to $cc to indicate that
7703 the resulting executable will use dynamic linking. To use no flags,
7707 case "$ccdlflags" in
7708 '') case "$osname" in
7709 linux|hpux|gnu*) dflt='-Wl,-E' ;;
7710 next|sunos) dflt='none' ;;
7714 *) dflt="$ccdlflags" ;;
7716 rp="Any special flags to pass to $cc to use dynamic linking?"
7719 none) ccdlflags=' ' ;;
7720 *) ccdlflags="$ans" ;;
7734 # No dynamic loading being used, so don't bother even to prompt.
7737 *) case "$useshrplib" in
7738 '') case "$osname" in
7739 svr4*|nonstopux|dgux|dynixptx|esix|powerux|beos|cygwin*)
7741 also='Building a shared libperl is required for dynamic loading to work on your system.'
7746 also='Building a shared libperl is needed for MAB support.'
7764 The perl executable is normally obtained by linking perlmain.c with
7765 libperl${_a}, any static extensions (usually just DynaLoader), and
7766 any other libraries needed on this system (such as -lm, etc.). Since
7767 your system supports dynamic loading, it is probably possible to build
7768 a shared libperl.$so. If you will have more than one executable linked
7769 to libperl.$so, this will significantly reduce the size of each
7770 executable, but it may have a noticeable effect on performance. The
7771 default is probably sensible for your system.
7775 rp="Build a shared libperl.$so (y/n)"
7779 useshrplib='true' ;;
7780 *) useshrplib='false' ;;
7785 case "$useshrplib" in
7789 # Figure out a good name for libperl.so. Since it gets stored in
7790 # a version-specific architecture-dependent library, the version
7791 # number isn't really that important, except for making cc/ld happy.
7793 # A name such as libperl.so.3.1
7794 majmin="libperl.$so.$patchlevel.$subversion"
7795 # A name such as libperl.so.301
7796 majonly=`echo $patchlevel $subversion |
7797 $awk '{printf "%d%02d", $1, $2}'`
7798 majonly=libperl.$so.$majonly
7799 # I'd prefer to keep the os-specific stuff here to a minimum, and
7800 # rely on figuring it out from the naming of libc.
7801 case "${osname}${osvers}" in
7804 # XXX How handle the --version stuff for MAB?
7806 linux*|gnu*) # ld won't link with a bare -lperl otherwise.
7809 cygwin*) # ld links against an importlib
7810 dflt=libperl$lib_ext
7812 *) # Try to guess based on whether libc has major.minor.
7814 *libc.$so.[0-9]*.[0-9]*) dflt=$majmin ;;
7815 *libc.$so.[0-9]*) dflt=$majonly ;;
7816 *) dflt=libperl.$so ;;
7826 I need to select a good name for the shared libperl. If your system uses
7827 library names with major and minor numbers, then you might want something
7828 like $majmin. Alternatively, if your system uses a single version
7829 number for shared libraries, then you might want to use $majonly.
7830 Or, your system might be quite happy with a simple libperl.$so.
7832 Since the shared libperl will get installed into a version-specific
7833 architecture-dependent directory, the version number of the shared perl
7834 library probably isn't important, so the default should be o.k.
7837 rp='What name do you want to give to the shared libperl?'
7840 echo "Ok, I'll use $libperl"
7843 libperl="libperl${_a}"
7847 # Detect old use of shrpdir via undocumented Configure -Dshrpdir
7851 WARNING: Use of the shrpdir variable for the installation location of
7852 the shared $libperl is not supported. It was never documented and
7853 will not work in this version. Let me (perlbug@perl.org)
7854 know of any problems this may cause.
7860 But your current setting of $shrpdir is
7861 the default anyway, so it's harmless.
7866 Further, your current attempted setting of $shrpdir
7867 conflicts with the value of $archlibexp/CORE
7868 that installperl will use.
7875 # How will the perl executable find the installed shared $libperl?
7876 # Add $xxx to ccdlflags.
7877 # If we can't figure out a command-line option, use $shrpenv to
7878 # set env LD_RUN_PATH. The main perl makefile uses this.
7879 shrpdir=$archlibexp/CORE
7882 if "$useshrplib"; then
7885 # We'll set it in Makefile.SH...
7890 freebsd|netbsd|openbsd|interix)
7891 xxx="-Wl,-R$shrpdir"
7893 bsdos|linux|irix*|dec_osf|gnu*)
7894 xxx="-Wl,-rpath,$shrpdir"
7897 # next doesn't like the default...
7900 # beos doesn't like the default, either.
7903 # hpux doesn't like the default, either.
7904 tmp_shrpenv="env LDOPTS=\"+s +b${shrpdir}\""
7907 tmp_shrpenv="env LD_RUN_PATH=$shrpdir"
7913 # Only add $xxx if it isn't already in ccdlflags.
7914 case " $ccdlflags " in
7916 *) ccdlflags="$ccdlflags $xxx"
7919 Adding $xxx to the flags
7920 passed to $ld so that the perl executable will find the
7921 installed shared $libperl.
7929 # Fix ccdlflags in AIX for building external extensions.
7930 # (For building Perl itself bare -bE:perl.exp is needed,
7931 # Makefile.SH takes care of this.)
7933 aix) ccdlflags="$ccdlflags -bE:$installarchlib/CORE/perl.exp" ;;
7935 # Respect a hint or command-line value.
7937 '') shrpenv="$tmp_shrpenv" ;;
7939 case "$ldlibpthname" in
7940 '') ldlibpthname=LD_LIBRARY_PATH ;;
7941 none) ldlibpthname='' ;;
7944 : determine where manual pages are on this system
7948 syspath='/usr/share/man/man1 /usr/man/man1'
7949 syspath="$syspath /usr/man/mann /usr/man/manl /usr/man/local/man1"
7950 syspath="$syspath /usr/man/u_man/man1"
7951 syspath="$syspath /usr/catman/u_man/man1 /usr/man/l_man/man1"
7952 syspath="$syspath /usr/local/man/u_man/man1 /usr/local/man/l_man/man1"
7953 syspath="$syspath /usr/man/man.L /local/man/man1 /usr/local/man/man1"
7954 sysman=`./loc . /usr/man/man1 $syspath`
7957 if $test -d "$sysman"; then
7958 echo "System manual is in $sysman." >&4
7960 echo "Could not find manual pages in source form." >&4
7963 : determine where manual pages go
7964 set man1dir man1dir none
7968 $spackage has manual pages available in source form.
7972 echo "However, you don't have nroff, so they're probably useless to you."
7974 '') man1dir="none";;
7977 echo "If you don't want the manual sources installed, answer 'none'."
7982 lookpath="$prefixexp/share/man/man1"
7983 lookpath="$lookpath $prefixexp/man/man1 $prefixexp/man/l_man/man1"
7984 lookpath="$lookpath $prefixexp/man/p_man/man1"
7985 lookpath="$lookpath $prefixexp/man/u_man/man1"
7986 lookpath="$lookpath $prefixexp/man/man.1"
7988 */?_man*) dflt=`./loc . $prefixexp/l_man/man1 $lookpath` ;;
7989 *) dflt=`./loc . $prefixexp/man/man1 $lookpath` ;;
7999 rp="Where do the main $spackage manual pages (source) go?"
8001 if $test "X$man1direxp" != "X$ansexp"; then
8005 man1direxp="$ansexp"
8011 : Change installation prefix, if necessary.
8012 if $test X"$prefix" != X"$installprefix"; then
8013 installman1dir=`echo $man1direxp | $sed "s#^$prefix#$installprefix#"`
8015 installman1dir="$man1direxp"
8018 : What suffix to use on installed man pages
8025 rp="What suffix should be used for the main $spackage man pages?"
8027 '') case "$man1dir" in
8041 *) dflt="$man1ext";;
8048 : see if we can have long filenames
8050 first=123456789abcdef
8052 if (echo hi >$first) 2>/dev/null; then
8053 if $test -f 123456789abcde; then
8054 echo 'You cannot have filenames longer than 14 characters. Sigh.' >&4
8057 echo 'You can have filenames longer than 14 characters.'>&4
8062 You can't have filenames longer than 14 chars.
8063 You can't even think about them!
8069 $rm -rf 123456789abcde*
8071 : determine where library module manual pages go
8072 set man3dir man3dir none
8076 $spackage has manual pages for many of the library modules.
8082 However, you don't have nroff, so they're probably useless to you.
8085 '') man3dir="none";;
8089 case "$d_flexfnam" in
8092 However, your system can't handle the long file names like File::Basename.3.
8095 '') man3dir="none";;
8099 echo "If you don't want the manual sources installed, answer 'none'."
8100 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
8102 '') dflt=`echo "$man1dir" | $sed -e 's/man1/man3/g' -e 's/man\.1/man\.3/g'`
8103 if $test -d "$privlib/man/man3"; then
8106 WARNING: Previous versions of perl installed man3 pages into
8107 $privlib/man/man3. This version will suggest a
8108 new default of $dflt.
8112 rp='Do you wish to preserve the old behavior?(y/n)'
8115 y*) dflt="$privlib/man/man3" ;;
8120 *) dflt="$man3dir" ;;
8127 rp="Where do the $package library man pages (source) go?"
8130 man3direxp="$ansexp"
8136 : Change installation prefix, if necessary.
8137 if $test X"$prefix" != X"$installprefix"; then
8138 installman3dir=`echo $man3direxp | $sed "s#^$prefix#$installprefix#"`
8140 installman3dir="$man3direxp"
8143 : What suffix to use on installed man pages
8149 rp="What suffix should be used for the $package library man pages?"
8151 '') case "$man3dir" in
8165 *) dflt="$man3ext";;
8172 : see if we have to deal with yellow pages, now NIS.
8173 if $test -d /usr/etc/yp || $test -d /etc/yp || $test -d /usr/lib/yp; then
8174 if $test -f /usr/etc/nibindd; then
8176 echo "I'm fairly confident you're on a NeXT."
8178 rp='Do you get the hosts file via NetInfo?'
8187 y*) hostcat='nidump hosts .';;
8188 *) case "$hostcat" in
8189 nidump*) hostcat='';;
8199 '') if $contains '^\+' /etc/passwd >/dev/null 2>&1; then
8207 rp='Are you getting the hosts file via yellow pages?'
8210 y*) hostcat='ypcat hosts';;
8211 *) hostcat='cat /etc/hosts';;
8217 '') test -f /etc/hosts && hostcat='cat /etc/hosts';;
8220 '') test -f /etc/group && groupcat='cat /etc/group';;
8223 '') test -f /etc/passwd && passcat='cat /etc/passwd';;
8226 : now get the host name
8228 echo "Figuring out host name..." >&4
8229 case "$myhostname" in
8231 echo 'Maybe "hostname" will work...'
8232 if tans=`sh -c hostname 2>&1` ; then
8240 if $test "$cont"; then
8242 echo 'Oh, dear. Maybe "/etc/systemid" is the key...'
8243 if tans=`cat /etc/systemid 2>&1` ; then
8245 phostname='cat /etc/systemid'
8246 echo "Whadyaknow. Xenix always was a bit strange..."
8249 elif $test -r /etc/systemid; then
8250 echo "(What is a non-Xenix system doing with /etc/systemid?)"
8253 if $test "$cont"; then
8254 echo 'No, maybe "uuname -l" will work...'
8255 if tans=`sh -c 'uuname -l' 2>&1` ; then
8257 phostname='uuname -l'
8259 echo 'Strange. Maybe "uname -n" will work...'
8260 if tans=`sh -c 'uname -n' 2>&1` ; then
8262 phostname='uname -n'
8264 echo 'Oh well, maybe I can mine it out of whoami.h...'
8265 if tans=`sh -c $contains' sysname $usrinc/whoami.h' 2>&1` ; then
8266 myhostname=`echo "$tans" | $sed 's/^.*"\(.*\)"/\1/'`
8267 phostname="sed -n -e '"'/sysname/s/^.*\"\\(.*\\)\"/\1/{'"' -e p -e q -e '}' <$usrinc/whoami.h"
8269 case "$myhostname" in
8270 '') echo "Does this machine have an identity crisis or something?"
8273 echo "Well, you said $myhostname before..."
8274 phostname='echo $myhostname';;
8280 case "$myhostname" in
8281 '') myhostname=noname ;;
8283 : you do not want to know about this
8288 if $test "$myhostname" ; then
8290 rp='Your host name appears to be "'$myhostname'".'" Right?"
8298 : bad guess or no guess
8299 while $test "X$myhostname" = X ; do
8301 rp="Please type the (one word) name of your host:"
8306 : translate upper to lower if necessary
8307 case "$myhostname" in
8309 echo "(Normalizing case in your host name)"
8310 myhostname=`echo $myhostname | ./tr '[A-Z]' '[a-z]'`
8314 case "$myhostname" in
8316 dflt=`expr "X$myhostname" : "X[^.]*\(\..*\)"`
8317 myhostname=`expr "X$myhostname" : "X\([^.]*\)\."`
8318 echo "(Trimming domain name from host name--host name is now $myhostname)"
8320 *) case "$mydomain" in
8323 test "X$hostcat" = "Xypcat hosts" &&
8324 ypmatch "$myhostname" hosts 2>/dev/null |\
8325 $sed -e 's/[ ]*#.*//; s/$/ /' > hosts && \
8328 test "X$hostcat" != "X" &&
8329 $hostcat | $sed -n -e "s/[ ]*#.*//; s/\$/ /
8330 /[ ]$myhostname[ . ]/p" > hosts
8333 if $test -f hosts; then
8334 $test x`$awk "/[0-9].*[ ]$myhostname$tmp_re/ { sum++ }
8335 END { print sum }" hosts` = x1 || tmp_re="[ ]"
8336 dflt=.`$awk "/[0-9].*[ ]$myhostname$tmp_re/ {for(i=2; i<=NF;i++) print \\\$i}" \
8337 hosts | $sort | $uniq | \
8338 $sed -n -e "s/$myhostname\.\([-a-zA-Z0-9_.]\)/\1/p"`
8339 case `$echo X$dflt` in
8340 X*\ *) echo "(Several hosts in the database matched hostname)"
8343 X.) echo "(You do not have fully-qualified names in the hosts database)"
8347 echo "(I cannot locate a hosts database anywhere)"
8352 tans=`./loc resolv.conf X /etc /usr/etc`
8353 if $test -f "$tans"; then
8354 echo "(Attempting domain name extraction from $tans)"
8355 dflt=.`$sed -n -e 's/ / /g' \
8356 -e 's/^search *\([^ ]*\).*/\1/p' $tans \
8357 | ./tr '[A-Z]' '[a-z]' 2>/dev/null`
8359 .) dflt=.`$sed -n -e 's/ / /g' \
8360 -e 's/^domain *\([^ ]*\).*/\1/p' $tans \
8361 | ./tr '[A-Z]' '[a-z]' 2>/dev/null`
8368 .) echo "(No help from resolv.conf either -- attempting clever guess)"
8369 dflt=.`sh -c domainname 2>/dev/null`
8372 .nis.*|.yp.*|.main.*) dflt=`echo $dflt | $sed -e 's/^\.[^.]*//'`;;
8376 case "$dflt$osname" in
8377 .os390) echo "(Attempting domain name extraction from //'SYS1.TCPPARMS(TCPDATA)')"
8378 dflt=.`awk '/^DOMAINORIGIN/ {print $2}' "//'SYS1.TCPPARMS(TCPDATA)'" 2>/dev/null`
8382 .) echo "(Lost all hope -- silly guess then)"
8388 *) dflt="$mydomain";;
8392 rp="What is your domain name?"
8402 : translate upper to lower if necessary
8405 echo "(Normalizing case in your domain name)"
8406 mydomain=`echo $mydomain | ./tr '[A-Z]' '[a-z]'`
8410 : a little sanity check here
8411 case "$phostname" in
8414 case `$phostname | ./tr '[A-Z]' '[a-z]'` in
8415 $myhostname$mydomain|$myhostname) ;;
8417 case "$phostname" in
8419 echo "(That doesn't agree with your whoami.h file, by the way.)"
8422 echo "(That doesn't agree with your $phostname command, by the way.)"
8432 I need to get your e-mail address in Internet format if possible, i.e.
8433 something like user@host.domain. Please answer accurately since I have
8434 no easy means to double check it. The default value provided below
8435 is most probably close to reality but may not be valid from outside
8436 your organization...
8440 while test "$cont"; do
8442 '') dflt="$cf_by@$myhostname$mydomain";;
8443 *) dflt="$cf_email";;
8445 rp='What is your e-mail address?'
8451 rp='Address does not look like an Internet one. Use it anyway?'
8467 If you or somebody else will be maintaining perl at your site, please
8468 fill in the correct e-mail address here so that they may be contacted
8469 if necessary. Currently, the "perlbug" program included with perl
8470 will send mail to this address in addition to perlbug@perl.org. You may
8471 enter "none" for no administrator.
8474 case "$perladmin" in
8475 '') dflt="$cf_email";;
8476 *) dflt="$perladmin";;
8478 rp='Perl administrator e-mail address'
8482 : determine whether to only install version-specific parts.
8485 Do you want to install only the version-specific parts of the perl
8486 distribution? Usually you do *not* want to do this.
8488 case "$versiononly" in
8489 "$define"|[Yy]*|true) dflt='y' ;;
8492 rp="Do you want to install only the version-specific parts of perl?"
8495 [yY]*) val="$define";;
8501 case "$versiononly" in
8502 "$define") inc_version_list=''
8503 inc_version_list_init=0
8507 : figure out how to guarantee perl startup
8508 case "$startperl" in
8510 case "$sharpbang" in
8514 I can use the #! construct to start perl on your system. This will
8515 make startup of perl scripts faster, but may cause problems if you
8516 want to share those scripts and perl is not in a standard place
8517 ($binexp/perl) on all your platforms. The alternative is to force
8518 a shell by starting the script with a single ':' character.
8521 case "$versiononly" in
8522 "$define") dflt="$binexp/perl$version";;
8523 *) dflt="$binexp/perl";;
8525 rp='What shall I put after the #! to start up perl ("none" to not use #!)?'
8528 none) startperl=": # use perl";;
8529 *) startperl="#!$ans"
8530 if $test 30 -lt `echo "$ans" | wc -c`; then
8533 WARNING: Some systems limit the #! command to 32 characters.
8534 If you experience difficulty running Perl scripts with #!, try
8535 installing Perl in a directory with a shorter pathname.
8541 *) startperl=": # use perl"
8546 echo "I'll use $startperl to start perl scripts."
8548 : figure best path for perl in scripts
8551 case "$versiononly" in
8552 "$define") perlpath="$binexp/perl$version";;
8553 *) perlpath="$binexp/perl";;
8555 case "$startperl" in
8560 I will use the "eval 'exec'" idiom to start Perl on your system.
8561 I can use the full path of your Perl binary for this purpose, but
8562 doing so may cause problems if you want to share those scripts and
8563 Perl is not always in a standard place ($binexp/perl).
8567 rp="What path shall I use in \"eval 'exec'\"?"
8574 case "$startperl" in
8576 *) echo "I'll use $perlpath in \"eval 'exec'\"" ;;
8579 : determine where public executable scripts go
8580 set scriptdir scriptdir
8582 case "$scriptdir" in
8585 : guess some guesses
8586 $test -d /usr/share/scripts && dflt=/usr/share/scripts
8587 $test -d /usr/share/bin && dflt=/usr/share/bin
8588 $test -d /usr/local/script && dflt=/usr/local/script
8589 $test -d /usr/local/scripts && dflt=/usr/local/scripts
8590 $test -d $prefixexp/script && dflt=$prefixexp/script
8594 *) dflt="$scriptdir"
8599 Some installations have a separate directory just for executable scripts so
8600 that they can mount it across multiple architectures but keep the scripts in
8601 one spot. You might, for example, have a subdirectory of /usr/share for this.
8602 Or you might just lump your scripts in with all your other executables.
8606 rp='Where do you keep publicly executable scripts?'
8608 if $test "X$ansexp" != "X$scriptdirexp"; then
8612 scriptdirexp="$ansexp"
8613 : Change installation prefix, if necessary.
8614 if $test X"$prefix" != X"$installprefix"; then
8615 installscript=`echo $scriptdirexp | sed "s#^$prefix#$installprefix#"`
8617 installscript="$scriptdirexp"
8620 : determine where add-on public executables go
8622 '') dflt=$siteprefix/bin ;;
8626 rp='Pathname where the add-on public executables should be installed?'
8629 sitebinexp="$ansexp"
8630 : Change installation prefix, if necessary.
8631 if $test X"$prefix" != X"$installprefix"; then
8632 installsitebin=`echo $sitebinexp | sed "s#^$prefix#$installprefix#"`
8634 installsitebin="$sitebinexp"
8637 : determine where add-on html pages go
8638 : There is no standard location, so try to copy the previously-selected
8639 : directory structure for the core html pages.
8640 case "$sitehtml1dir" in
8641 '') dflt=`echo "$html1dir" | $sed "s#^$prefix#$siteprefix#"` ;;
8642 *) dflt=$sitehtml1dir ;;
8645 ''|' ') dflt=none ;;
8648 rp='Pathname where the site-specific html pages should be installed?'
8651 sitehtml1direxp="$ansexp"
8652 : Change installation prefix, if necessary.
8653 if $test X"$prefix" != X"$installprefix"; then
8654 installsitehtml1dir=`echo $sitehtml1direxp | $sed "s#^$prefix#$installprefix#"`
8656 installsitehtml1dir="$sitehtml1direxp"
8659 : determine where add-on library html pages go
8660 : There is no standard location, so try to copy the previously-selected
8661 : directory structure for the core html pages.
8662 case "$sitehtml3dir" in
8663 '') dflt=`echo "$html3dir" | $sed "s#^$prefix#$siteprefix#"` ;;
8664 *) dflt=$sitehtml3dir ;;
8667 ''|' ') dflt=none ;;
8670 rp='Pathname where the site-specific library html pages should be installed?'
8673 sitehtml3direxp="$ansexp"
8674 : Change installation prefix, if necessary.
8675 if $test X"$prefix" != X"$installprefix"; then
8676 installsitehtml3dir=`echo $sitehtml3direxp | $sed "s#^$prefix#$installprefix#"`
8678 installsitehtml3dir="$sitehtml3direxp"
8681 : determine where add-on manual pages go
8682 case "$siteman1dir" in
8683 '') dflt=`echo $man1dir | $sed "s#^$prefix#$siteprefix#"` ;;
8684 *) dflt=$siteman1dir ;;
8687 ''|' ') dflt=none ;;
8690 rp='Pathname where the site-specific manual pages should be installed?'
8693 siteman1direxp="$ansexp"
8694 : Change installation prefix, if necessary.
8695 if $test X"$prefix" != X"$installprefix"; then
8696 installsiteman1dir=`echo $siteman1direxp | $sed "s#^$prefix#$installprefix#"`
8698 installsiteman1dir="$siteman1direxp"
8701 : determine where add-on library man pages go
8702 case "$siteman3dir" in
8703 '') dflt=`echo $man3dir | $sed "s#^$prefix#$siteprefix#"` ;;
8704 *) dflt=$siteman3dir ;;
8707 ''|' ') dflt=none ;;
8710 rp='Pathname where the site-specific library manual pages should be installed?'
8713 siteman3direxp="$ansexp"
8714 : Change installation prefix, if necessary.
8715 if $test X"$prefix" != X"$installprefix"; then
8716 installsiteman3dir=`echo $siteman3direxp | $sed "s#^$prefix#$installprefix#"`
8718 installsiteman3dir="$siteman3direxp"
8721 : determine where add-on public executable scripts go
8722 case "$sitescript" in
8723 '') dflt=$siteprefix/script
8724 $test -d $dflt || dflt=$sitebin ;;
8725 *) dflt="$sitescript" ;;
8728 rp='Pathname where add-on public executable scripts should be installed?'
8731 sitescriptexp="$ansexp"
8732 : Change installation prefix, if necessary.
8733 if $test X"$prefix" != X"$installprefix"; then
8734 installsitescript=`echo $sitescriptexp | sed "s#^$prefix#$installprefix#"`
8736 installsitescript="$sitescriptexp"
8739 case "$usefaststdio" in
8740 $define|true|[yY]*|'')
8741 xversion=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
8751 Perl can be built to use 'fast stdio', which means using the stdio
8752 library but also directly manipulating the stdio buffers to enable
8753 faster I/O. Using stdio is better for backward compatibility (especially
8754 for Perl extensions), but on the other hand since Perl 5.8 the 'perlio'
8755 interface has been preferred instead of stdio.
8757 If this doesn't make any sense to you, just accept the default '$dflt'.
8759 rp='Use the "fast stdio" if available?'
8762 y|Y) val="$define" ;;
8769 : define an is-a-typedef? function
8770 typedef='type=$1; var=$2; def=$3; shift; shift; shift; inclist=$@;
8772 "") inclist="sys/types.h";;
8774 eval "varval=\$$var";
8778 for inc in $inclist; do
8779 echo "#include <$inc>" >>temp.c;
8781 echo "#ifdef $type" >> temp.c;
8782 echo "printf(\"We have $type\");" >> temp.c;
8783 echo "#endif" >> temp.c;
8784 $cppstdin $cppflags $cppminus < temp.c >temp.E 2>/dev/null;
8785 if $contains $type temp.E >/dev/null 2>&1; then
8791 *) eval "$var=\$varval";;
8794 : define an is-a-typedef? function that prompts if the type is not available.
8795 typedef_ask='type=$1; var=$2; def=$3; shift; shift; shift; inclist=$@;
8797 "") inclist="sys/types.h";;
8799 eval "varval=\$$var";
8803 for inc in $inclist; do
8804 echo "#include <$inc>" >>temp.c;
8806 echo "#ifdef $type" >> temp.c;
8807 echo "printf(\"We have $type\");" >> temp.c;
8808 echo "#endif" >> temp.c;
8809 $cppstdin $cppflags $cppminus < temp.c >temp.E 2>/dev/null;
8811 echo "$rp" | $sed -e "s/What is/Looking for/" -e "s/?/./";
8812 if $contains $type temp.E >/dev/null 2>&1; then
8813 echo "$type found." >&4;
8816 echo "$type NOT found." >&4;
8822 *) eval "$var=\$varval";;
8825 : see what type lseek is declared as in the kernel
8826 rp="What is the type used for lseek's offset on this system?"
8827 set off_t lseektype long stdio.h sys/types.h
8831 echo "Checking to see how big your file offsets are..." >&4
8833 #include <sys/types.h>
8837 printf("%d\n", (int)sizeof($lseektype));
8842 if eval $compile_ok; then
8843 lseeksize=`$run ./try`
8844 echo "Your file offsets are $lseeksize bytes long."
8848 echo "(I can't seem to compile the test program. Guessing...)"
8849 rp="What is the size of your file offsets (in bytes)?"
8855 : see what type file positions are declared as in the library
8856 rp="What is the type for file position used by fsetpos()?"
8857 set fpos_t fpostype long stdio.h sys/types.h
8862 *_t) zzz="$fpostype" ;;
8865 echo "Checking the size of $zzz..." >&4
8867 #include <sys/types.h>
8874 printf("%d\n", (int)sizeof($fpostype));
8879 if eval $compile_ok; then
8883 echo "(I can't execute the test program--guessing $fpossize.)" >&4
8886 echo "Your $zzz is $fpossize bytes long."
8892 echo "(I can't compile the test program. Guessing...)" >&4
8893 rp="What is the size of your file positions (in bytes)?"
8898 # Backward compatibility (uselfs is deprecated).
8900 "$define"|true|[yY]*)
8903 *** Configure -Duselfs is deprecated, using -Duselargefiles instead.
8905 uselargefiles="$define"
8909 case "$lseeksize:$fpossize" in
8912 You can have files larger than 2 gigabytes.
8915 *) case "$uselargefiles" in
8916 "$undef"|false|[nN]*) dflt='n' ;;
8921 Perl can be built to understand large files (files larger than 2 gigabytes)
8922 on some systems. To do so, Configure can be run with -Duselargefiles.
8924 If this doesn't make any sense to you, just accept the default '$dflt'.
8926 rp='Try to understand large files, if available?'
8929 y|Y) val="$define" ;;
8936 : Look for a hint-file generated 'call-back-unit'. If the
8937 : user has specified that a large files perl is to be built,
8938 : we may need to set or change some other defaults.
8939 if $test -f uselargefiles.cbu; then
8940 echo "Your platform has some specific hints regarding large file builds, using them..."
8941 . ./uselargefiles.cbu
8943 case "$uselargefiles" in
8945 if $test -f uselargefiles.cbu; then
8947 echo "Rechecking to see how big your file offsets are..." >&4
8949 #include <sys/types.h>
8953 printf("%d\n", (int)sizeof($lseektype));
8958 if eval $compile_ok; then
8959 lseeksize=`$run ./try`
8960 $echo "Your file offsets are now $lseeksize bytes long."
8964 echo "(I can't seem to compile the test program. Guessing...)"
8965 rp="What is the size of your file offsets (in bytes)?"
8970 *_t) zzz="$fpostype" ;;
8973 $echo $n "Rechecking the size of $zzz...$c" >&4
8975 #include <sys/types.h>
8982 printf("%d\n", (int)sizeof($fpostype));
8987 if eval $compile_ok; then
8992 echo "(I can't execute the test program--guessing $fpossize.)" >&4
8995 echo " $fpossize bytes." >&4
9001 echo "(I can't compile the test program. Guessing...)" >&4
9002 rp="What is the size of your file positions (in bytes)?"
9011 # probably will refer to
9012 # $archlib $privlib $sitearch $sitelib $vendorarch $vendorlib
9014 userelocatableinc=undef
9016 case "$vendorprefix" in
9017 '') d_vendorbin="$undef"
9021 *) d_vendorbin="$define"
9022 : determine where vendor-supplied executables go.
9023 case "$vendorbin" in
9024 '') dflt=$vendorprefix/bin ;;
9025 *) dflt="$vendorbin" ;;
9028 rp='Pathname for the vendor-supplied executables directory?'
9031 vendorbinexp="$ansexp"
9034 : Change installation prefix, if necessary.
9035 if $test X"$prefix" != X"$installprefix"; then
9036 installvendorbin=`echo $vendorbinexp | $sed "s#^$prefix#$installprefix#"`
9038 installvendorbin="$vendorbinexp"
9041 case "$vendorprefix" in
9042 '') vendorhtml1dir=''
9043 vendorhtml1direxp=''
9045 *) : determine where vendor-supplied html pages go.
9046 : There is no standard location, so try to copy the previously-selected
9047 : directory structure for the core html pages.
9048 : XXX Better default suggestions would be welcome.
9049 case "$vendorhtml1dir" in
9050 '') dflt=`echo "$html1dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
9051 *) dflt=$vendorhtml1dir ;;
9054 ''|' ') dflt=none ;;
9057 rp='Pathname for the vendor-supplied html pages?'
9059 vendorhtml1dir="$ans"
9060 vendorhtml1direxp="$ansexp"
9063 : Use ' ' for none so value is preserved next time through Configure
9064 $test X"$vendorhtml1dir" = "X" && vendorhtml1dir=' '
9065 : Change installation prefix, if necessary.
9066 if $test X"$prefix" != X"$installprefix"; then
9067 installvendorhtml1dir=`echo $vendorhtml1direxp | $sed "s#^$prefix#$installprefix#"`
9069 installvendorhtml1dir="$vendorhtml1direxp"
9072 case "$vendorprefix" in
9073 '') vendorhtml3dir=''
9074 vendorhtml3direxp=''
9076 *) : determine where vendor-supplied module html pages go.
9077 : There is no standard location, so try to copy the previously-selected
9078 : directory structure for the core html pages.
9079 : XXX Better default suggestions would be welcome.
9080 case "$vendorhtml3dir" in
9081 '') dflt=`echo "$html3dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
9082 *) dflt=$vendorhtml3dir ;;
9085 ''|' ') dflt=none ;;
9088 rp='Pathname for the vendor-supplied html pages?'
9090 vendorhtml3dir="$ans"
9091 vendorhtml3direxp="$ansexp"
9094 : Use ' ' for none so value is preserved next time through Configure
9095 $test X"$vendorhtml3dir" = "X" && vendorhtml3dir=' '
9096 : Change installation prefix, if necessary.
9097 if $test X"$prefix" != X"$installprefix"; then
9098 installvendorhtml3dir=`echo $vendorhtml3direxp | $sed "s#^$prefix#$installprefix#"`
9100 installvendorhtml3dir="$vendorhtml3direxp"
9103 case "$vendorprefix" in
9104 '') vendorman1dir=''
9107 *) : determine where vendor-supplied manual pages go.
9108 case "$vendorman1dir" in
9109 '') dflt=`echo "$man1dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
9110 *) dflt=$vendorman1dir ;;
9113 ''|' ') dflt=none ;;
9116 rp='Pathname for the vendor-supplied manual section 1 pages?'
9118 vendorman1dir="$ans"
9119 vendorman1direxp="$ansexp"
9122 : Use ' ' for none so value is preserved next time through Configure
9123 $test X"$vendorman1dir" = "X" && vendorman1dir=' '
9124 : Change installation prefix, if necessary.
9125 if $test X"$prefix" != X"$installprefix"; then
9126 installvendorman1dir=`echo "$vendorman1direxp" | $sed "s#^$prefix#$installprefix#"`
9128 installvendorman1dir="$vendorman1direxp"
9131 case "$vendorprefix" in
9132 '') vendorman3dir=''
9135 *) : determine where vendor-supplied module manual pages go.
9136 case "$vendorman3dir" in
9137 '') dflt=`echo "$man3dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
9138 *) dflt=$vendorman3dir ;;
9141 ''|' ') dflt=none ;;
9144 rp='Pathname for the vendor-supplied manual section 3 pages?'
9146 vendorman3dir="$ans"
9147 vendorman3direxp="$ansexp"
9150 : Use ' ' for none so value is preserved next time through Configure
9151 $test X"$vendorman3dir" = "X" && vendorman3dir=' '
9152 : Change installation prefix, if necessary.
9153 if $test X"$prefix" != X"$installprefix"; then
9154 installvendorman3dir=`echo "$vendorman3direxp" | $sed "s#^$prefix#$installprefix#"`
9156 installvendorman3dir="$vendorman3direxp"
9159 case "$vendorprefix" in
9160 '') d_vendorscript="$undef"
9164 *) d_vendorscript="$define"
9165 : determine where vendor-supplied scripts go.
9166 case "$vendorscript" in
9167 '') dflt=$vendorprefix/script
9168 $test -d $dflt || dflt=$vendorbin ;;
9169 *) dflt="$vendorscript" ;;
9173 The installation process will create a directory for
9174 vendor-supplied scripts.
9178 rp='Pathname for the vendor-supplied scripts directory?'
9181 vendorscriptexp="$ansexp"
9184 : Change installation prefix, if necessary.
9185 if $test X"$prefix" != X"$installprefix"; then
9186 installvendorscript=`echo $vendorscriptexp | $sed "s#^$prefix#$installprefix#"`
9188 installvendorscript="$vendorscriptexp"
9191 : see if qgcvt exists
9197 if $test X"$d_longdbl" = X"$define"; then
9199 echo "Checking how to print long doubles..." >&4
9201 if $test X"$sPRIfldbl" = X -a X"$doublesize" = X"$longdblsize"; then
9202 $cat >try.c <<'EOCP'
9203 #include <sys/types.h>
9207 printf("%.3f\n", d);
9211 if eval $compile; then
9215 sPRIfldbl='"f"'; sPRIgldbl='"g"'; sPRIeldbl='"e"';
9216 sPRIFUldbl='"F"'; sPRIGUldbl='"G"'; sPRIEUldbl='"E"';
9217 echo "We will use %f."
9223 if $test X"$sPRIfldbl" = X; then
9224 $cat >try.c <<'EOCP'
9225 #include <sys/types.h>
9228 long double d = 123.456;
9229 printf("%.3Lf\n", d);
9233 if eval $compile; then
9237 sPRIfldbl='"Lf"'; sPRIgldbl='"Lg"'; sPRIeldbl='"Le"';
9238 sPRIFUldbl='"LF"'; sPRIGUldbl='"LG"'; sPRIEUldbl='"LE"';
9239 echo "We will use %Lf."
9245 if $test X"$sPRIfldbl" = X; then
9246 $cat >try.c <<'EOCP'
9247 #include <sys/types.h>
9250 long double d = 123.456;
9251 printf("%.3llf\n", d);
9255 if eval $compile; then
9259 sPRIfldbl='"llf"'; sPRIgldbl='"llg"'; sPRIeldbl='"lle"';
9260 sPRIFUldbl='"llF"'; sPRIGUldbl='"llG"'; sPRIEUldbl='"llE"';
9261 echo "We will use %llf."
9267 if $test X"$sPRIfldbl" = X; then
9268 $cat >try.c <<'EOCP'
9269 #include <sys/types.h>
9272 long double d = 123.456;
9273 printf("%.3lf\n", d);
9277 if eval $compile; then
9281 sPRIfldbl='"lf"'; sPRIgldbl='"lg"'; sPRIeldbl='"le"';
9282 sPRIFUldbl='"lF"'; sPRIGUldbl='"lG"'; sPRIEUldbl='"lE"';
9283 echo "We will use %lf."
9289 if $test X"$sPRIfldbl" = X; then
9290 echo "Cannot figure out how to print long doubles." >&4
9292 sSCNfldbl=$sPRIfldbl # expect consistency
9299 case "$sPRIfldbl" in
9300 '') d_PRIfldbl="$undef"; d_PRIgldbl="$undef"; d_PRIeldbl="$undef";
9301 d_PRIFUldbl="$undef"; d_PRIGUldbl="$undef"; d_PRIEUldbl="$undef";
9302 d_SCNfldbl="$undef";
9304 *) d_PRIfldbl="$define"; d_PRIgldbl="$define"; d_PRIeldbl="$define";
9305 d_PRIFUldbl="$define"; d_PRIGUldbl="$define"; d_PRIEUldbl="$define";
9306 d_SCNfldbl="$define";
9310 : Check how to convert floats to strings.
9312 if test "X$d_Gconvert" = X; then
9315 echo "Checking for an efficient way to convert floats to strings."
9317 case "$uselongdouble" in
9318 "$define") echo "#define USE_LONG_DOUBLE" >>try.c ;;
9320 case "$d_longdbl" in
9321 "$define") echo "#define HAS_LONG_DOUBLE" >>try.c ;;
9323 case "$d_PRIgldbl" in
9324 "$define") echo "#define HAS_PRIgldbl" >>try.c ;;
9328 #define Gconvert(x,n,t,b) gconvert((x),(n),(t),(b))
9329 char *myname = "gconvert";
9332 #define Gconvert(x,n,t,b) gcvt((x),(n),(b))
9333 char *myname = "gcvt";
9336 #define Gconvert(x,n,t,b) qgcvt((x),(n),(b))
9337 char *myname = "qgcvt";
9338 #define DOUBLETYPE long double
9341 #if defined(USE_LONG_DOUBLE) && defined(HAS_LONG_DOUBLE)
9343 #define Gconvert(x,n,t,b) sprintf((b),"%.*"$sPRIgldbl,(n),(x))
9345 #define Gconvert(x,n,t,b) sprintf((b),"%.*g",(n),(double)(x))
9348 #define Gconvert(x,n,t,b) sprintf((b),"%.*g",(n),(x))
9350 char *myname = "sprintf";
9354 #if defined(USE_LONG_DOUBLE) && defined(HAS_LONG_DOUBLE)
9355 #define DOUBLETYPE long double
9357 #define DOUBLETYPE double
9363 #define I_STDLIB $i_stdlib
9369 checkit(expect, got)
9373 if (strcmp(expect, got)) {
9374 printf("%s oddity: Expected %s, got %s\n",
9375 myname, expect, got);
9385 /* This must be 1st test on (which?) platform */
9386 /* Alan Burlison <AlanBurlsin@unn.unisys.com> */
9387 Gconvert((DOUBLETYPE)0.1, 8, 0, buf);
9388 checkit("0.1", buf);
9390 Gconvert((DOUBLETYPE)0.01, 8, 0, buf);
9391 checkit("0.01", buf);
9393 Gconvert((DOUBLETYPE)0.001, 8, 0, buf);
9394 checkit("0.001", buf);
9396 Gconvert((DOUBLETYPE)0.0001, 8, 0, buf);
9397 checkit("0.0001", buf);
9399 Gconvert((DOUBLETYPE)0.00009, 8, 0, buf);
9400 if (strlen(buf) > 5)
9401 checkit("9e-005", buf); /* for Microsoft ?? */
9403 checkit("9e-05", buf);
9405 Gconvert((DOUBLETYPE)1.0, 8, 0, buf);
9408 Gconvert((DOUBLETYPE)1.1, 8, 0, buf);
9409 checkit("1.1", buf);
9411 Gconvert((DOUBLETYPE)1.01, 8, 0, buf);
9412 checkit("1.01", buf);
9414 Gconvert((DOUBLETYPE)1.001, 8, 0, buf);
9415 checkit("1.001", buf);
9417 Gconvert((DOUBLETYPE)1.0001, 8, 0, buf);
9418 checkit("1.0001", buf);
9420 Gconvert((DOUBLETYPE)1.00001, 8, 0, buf);
9421 checkit("1.00001", buf);
9423 Gconvert((DOUBLETYPE)1.000001, 8, 0, buf);
9424 checkit("1.000001", buf);
9426 Gconvert((DOUBLETYPE)0.0, 8, 0, buf);
9429 Gconvert((DOUBLETYPE)-1.0, 8, 0, buf);
9432 /* Some Linux gcvt's give 1.e+5 here. */
9433 Gconvert((DOUBLETYPE)100000.0, 8, 0, buf);
9434 checkit("100000", buf);
9436 /* Some Linux gcvt's give -1.e+5 here. */
9437 Gconvert((DOUBLETYPE)-100000.0, 8, 0, buf);
9438 checkit("-100000", buf);
9440 Gconvert((DOUBLETYPE)123.456, 8, 0, buf);
9441 checkit("123.456", buf);
9443 /* Testing of 1e+129 in bigintpm.t must not get extra '.' here. */
9444 Gconvert((DOUBLETYPE)1e34, 8, 0, buf);
9445 /* 34 should be enough to scare even long double
9446 * places into using the e notation. */
9447 if (strlen(buf) > 5)
9448 checkit("1e+034", buf); /* for Microsoft */
9450 checkit("1e+34", buf);
9452 /* For Perl, if you add additional tests here, also add them to
9453 * t/base/num.t for benefit of platforms not using Configure or
9454 * overriding d_Gconvert */
9459 : first add preferred functions to our list
9461 for xxx_convert in $gconvert_preference; do
9462 case $xxx_convert in
9463 gcvt|gconvert|sprintf) xxx_list="$xxx_list $xxx_convert" ;;
9464 *) echo "Discarding unrecognized gconvert_preference $xxx_convert" >&4 ;;
9467 : then add any others
9468 for xxx_convert in gconvert gcvt sprintf; do
9471 *) xxx_list="$xxx_list $xxx_convert" ;;
9475 case "$d_longdbl$uselongdouble" in
9477 : again, add prefered functions to our list first
9479 for xxx_convert in $gconvert_ld_preference; do
9480 case $xxx_convert in
9481 qgcvt|gcvt|gconvert|sprintf) xxx_ld_list="$xxx_ld_list $xxx_convert" ;;
9482 *) echo "Discarding unrecognized gconvert_ld_preference $xxx_convert" ;;
9485 : then add qgcvt, sprintf--then, in xxx_list order, gconvert and gcvt
9486 for xxx_convert in qgcvt sprintf $xxx_list; do
9487 case "$xxx_ld_list" in
9488 $xxx_convert*|*" $xxx_convert"*) ;;
9489 *) xxx_ld_list="$xxx_ld_list $xxx_convert" ;;
9492 : if sprintf cannot do long doubles, move it to the end
9493 if test "$d_PRIgldbl" != "$define"; then
9494 xxx_ld_list="`echo $xxx_ld_list|sed s/sprintf//` sprintf"
9496 : if no qgcvt, remove it
9497 if test "$d_qgcvt" != "$define"; then
9498 xxx_ld_list="`echo $xxx_ld_list|sed s/qgcvt//`"
9501 xxx_list="$xxx_ld_list"
9505 for xxx_convert in $xxx_list; do
9506 echo "Trying $xxx_convert..."
9508 set try -DTRY_$xxx_convert
9509 if eval $compile; then
9510 echo "$xxx_convert() found." >&4
9512 echo "I'll use $xxx_convert to convert floats into a string." >&4
9515 echo "...But $xxx_convert didn't work as I expected."
9519 echo "$xxx_convert NOT found." >&4
9523 if test X$xxx_convert = X; then
9524 echo "*** WHOA THERE!!! ***" >&4
9525 echo "None of ($xxx_list) seemed to work properly. I'll use sprintf." >&4
9529 case "$xxx_convert" in
9530 gconvert) d_Gconvert='gconvert((x),(n),(t),(b))' ;;
9531 gcvt) d_Gconvert='gcvt((x),(n),(b))' ;;
9532 qgcvt) d_Gconvert='qgcvt((x),(n),(b))' ;;
9533 *) case "$uselongdouble$d_longdbl$d_PRIgldbl" in
9534 "$define$define$define")
9535 d_Gconvert="sprintf((b),\"%.*\"$sPRIgldbl,(n),(x))" ;;
9536 "$define$define$undef")
9537 d_Gconvert='sprintf((b),"%.*g",(n),(double)(x))' ;;
9538 *) d_Gconvert='sprintf((b),"%.*g",(n),(x))' ;;
9545 : see if _fwalk exists
9549 : Initialize h_fcntl
9552 : Initialize h_sysfile
9555 : access call always available on UNIX
9559 : locate the flags for 'access()'
9563 $cat >access.c <<EOCP
9564 #include <sys/types.h>
9569 #include <sys/file.h>
9582 : check sys/file.h first, no particular reason here
9583 if $test `./findhdr sys/file.h` && \
9584 $cc -o access $cppflags -DI_SYS_FILE access.c >/dev/null 2>&1 ; then
9586 echo "<sys/file.h> defines the *_OK access constants." >&4
9587 elif $test `./findhdr fcntl.h` && \
9588 $cc -o access $cppflags -DI_FCNTL access.c >/dev/null 2>&1 ; then
9590 echo "<fcntl.h> defines the *_OK access constants." >&4
9591 elif $test `./findhdr unistd.h` && \
9592 $cc -o access $cppflags -DI_UNISTD access.c >/dev/null 2>&1 ; then
9593 echo "<unistd.h> defines the *_OK access constants." >&4
9595 echo "I can't find the four *_OK access constants--I'll use mine." >&4
9601 : see if accessx exists
9602 set accessx d_accessx
9605 : see if aintl exists
9609 : see if alarm exists
9613 : see if POSIX threads are available
9614 set pthread.h i_pthread
9617 : define a fucntion to check prototypes
9618 $cat > protochk <<EOSH
9621 optimize="$optimize"
9623 prototype="$prototype"
9626 usethreads=$usethreads
9627 i_pthread=$i_pthread
9628 pthread_h_first=$pthread_h_first
9631 $cat >> protochk <<'EOSH'
9636 while test $# -ge 2; do
9638 $define) echo "#include <$2>" >> try.c ;;
9639 literal) echo "$2" >> try.c ;;
9641 # Extra magic for the benefit of systems that need pthread.h
9642 # to be included early to correctly detect threadsafe functions.
9643 # Such functions must guarantee themselves, though, that the usethreads
9644 # and i_pthread have been defined, before calling protochk.
9645 if test "$usethreads" = "$define" -a "$i_pthread" = "$define" -a "$pthread_h_first" = "$define" -a "$pthread_h_done" = ""; then
9646 echo "#include <pthread.h>" >> try.c
9651 test "$prototype" = "$define" && echo '#define CAN_PROTOTYPE' >> try.c
9652 cat >> try.c <<'EOCP'
9653 #ifdef CAN_PROTOTYPE
9654 #define _(args) args
9659 echo "$foo" >> try.c
9660 echo 'int no_real_function_has_this_name _((void)) { return 0; }' >> try.c
9661 $cc $optimize $ccflags -c try.c > /dev/null 2>&1
9669 hasproto='varname=$1; func=$2; shift; shift;
9670 while $test $# -ge 2; do
9672 $define) echo "#include <$2>";;
9676 $cppstdin $cppflags $cppminus < try.c > tryout.c 2>/dev/null;
9677 if $contains "$func.*(" tryout.c >/dev/null 2>&1; then
9678 echo "$func() prototype found.";
9681 echo "$func() prototype NOT found.";
9686 $rm -f try.c tryout.c'
9688 : see if sys/types.h has to be included
9689 set sys/types.h i_systypes
9692 : see if sys/select.h has to be included
9693 set sys/select.h i_sysselct
9696 hasfield='varname=$1; struct=$2; field=$3; shift; shift; shift;
9697 while $test $# -ge 2; do
9699 $define) echo "#include <$2>";;
9703 echo "int main () { struct $struct foo; char* bar; bar = (char*)foo.$field; }" >> try.c;
9705 if eval $compile; then
9714 : see if we should include time.h, sys/time.h, or both
9716 if test "X$timeincl" = X; then
9717 echo "Testing to see if we should include <time.h>, <sys/time.h> or both." >&4
9718 $echo $n "I'm now running the test program...$c"
9720 #include <sys/types.h>
9725 #ifdef SYSTIMEKERNEL
9728 #include <sys/time.h>
9731 #include <sys/select.h>
9744 struct timezone tzp;
9746 if (foo.tm_sec == foo.tm_sec)
9749 if (bar.tv_sec == bar.tv_sec)
9756 for s_timezone in '-DS_TIMEZONE' ''; do
9758 for s_timeval in '-DS_TIMEVAL' ''; do
9759 for i_systimek in '' '-DSYSTIMEKERNEL'; do
9760 for i_time in '' '-DI_TIME'; do
9761 for i_systime in '-DI_SYSTIME' ''; do
9764 set try $i_time $i_systime $i_systimek $sysselect $s_timeval $s_timezone
9765 if eval $compile; then
9766 set X $i_time $i_systime $i_systimek $sysselect $s_timeval
9770 $echo $n "Succeeded with $flags$c"
9782 *SYSTIMEKERNEL*) i_systimek="$define"
9783 timeincl=`./findhdr sys/time.h`
9784 echo "We'll include <sys/time.h> with KERNEL defined." >&4;;
9785 *) i_systimek="$undef";;
9788 *I_TIME*) i_time="$define"
9789 timeincl=`./findhdr time.h`" $timeincl"
9790 echo "We'll include <time.h>." >&4;;
9791 *) i_time="$undef";;
9794 *I_SYSTIME*) i_systime="$define"
9795 timeincl=`./findhdr sys/time.h`" $timeincl"
9796 echo "We'll include <sys/time.h>." >&4;;
9797 *) i_systime="$undef";;
9801 : see if struct tm knows about tm_zone
9802 case "$i_systime$i_time" in
9805 echo "Checking to see if your struct tm has tm_zone field..." >&4
9806 set d_tm_tm_zone tm tm_zone $i_systime sys/time.h $i_time time.h
9814 case "$d_tm_tm_zone" in
9815 "$define") echo "Yes, it does." ;;
9816 *) echo "No, it doesn't." ;;
9818 : see if struct tm knows about tm_gmtoff
9819 case "$i_systime$i_time" in
9822 echo "Checking to see if your struct tm has tm_gmtoff field..." >&4
9823 set d_tm_tm_gmtoff tm tm_gmtoff $i_systime sys/time.h $i_time time.h
9831 case "$d_tm_tm_gmtoff" in
9832 "$define") echo "Yes, it does." ;;
9833 *) echo "No, it doesn't." ;;
9836 : see if asctime_r exists
9837 set asctime_r d_asctime_r
9839 case "$d_asctime_r" in
9841 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
9842 case "$d_asctime_r_proto:$usethreads" in
9843 ":define") d_asctime_r_proto=define
9844 set d_asctime_r_proto asctime_r $hdrs
9848 case "$d_asctime_r_proto" in
9850 case "$asctime_r_proto" in
9851 ''|0) try='char* asctime_r(const struct tm*, char*);'
9852 ./protochk "extern $try" $hdrs && asctime_r_proto=B_SB ;;
9854 case "$asctime_r_proto" in
9855 ''|0) try='char* asctime_r(const struct tm*, char*, int);'
9856 ./protochk "extern $try" $hdrs && asctime_r_proto=B_SBI ;;
9858 case "$asctime_r_proto" in
9859 ''|0) try='int asctime_r(const struct tm*, char*);'
9860 ./protochk "extern $try" $hdrs && asctime_r_proto=I_SB ;;
9862 case "$asctime_r_proto" in
9863 ''|0) try='int asctime_r(const struct tm*, char*, int);'
9864 ./protochk "extern $try" $hdrs && asctime_r_proto=I_SBI ;;
9866 case "$asctime_r_proto" in
9867 ''|0) d_asctime_r=undef
9869 echo "Disabling asctime_r, cannot determine prototype." >&4 ;;
9870 * ) case "$asctime_r_proto" in
9871 REENTRANT_PROTO*) ;;
9872 *) asctime_r_proto="REENTRANT_PROTO_$asctime_r_proto" ;;
9874 echo "Prototype: $try" ;;
9877 *) case "$usethreads" in
9878 define) echo "asctime_r has no prototype, not using it." >&4 ;;
9885 *) asctime_r_proto=0
9889 : see if atolf exists
9893 : see if atoll exists
9897 : Look for GCC-style attribute format
9898 case "$d_attribute_format" in
9901 echo "Checking whether your compiler can handle __attribute__((format)) ..." >&4
9902 $cat >attrib.c <<'EOCP'
9904 void my_special_printf(char* pat,...) __attribute__((__format__(__printf__,1,2)));
9906 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
9907 if $contains 'warning' attrib.out >/dev/null 2>&1; then
9908 echo "Your C compiler doesn't support __attribute__((format))."
9911 echo "Your C compiler supports __attribute__((format))."
9915 echo "Your C compiler doesn't seem to understand __attribute__ at all."
9919 *) val="$d_attribute_format" ;;
9921 set d_attribute_format
9925 : Look for GCC-style attribute malloc
9926 case "$d_attribute_malloc" in
9929 echo "Checking whether your compiler can handle __attribute__((malloc)) ..." >&4
9930 $cat >attrib.c <<'EOCP'
9932 char *go_get_some_memory( int how_many_bytes ) __attribute__((malloc));
9934 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
9935 if $contains 'warning' attrib.out >/dev/null 2>&1; then
9936 echo "Your C compiler doesn't support __attribute__((malloc))."
9939 echo "Your C compiler supports __attribute__((malloc))."
9943 echo "Your C compiler doesn't seem to understand __attribute__ at all."
9947 *) val="$d_attribute_malloc" ;;
9949 set d_attribute_malloc
9953 : Look for GCC-style attribute nonnull
9954 case "$d_attribute_nonnull" in
9957 echo "Checking whether your compiler can handle __attribute__((nonnull(1))) ..." >&4
9958 $cat >attrib.c <<'EOCP'
9960 void do_something (char *some_pointer,...) __attribute__((nonnull(1)));
9962 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
9963 if $contains 'warning' attrib.out >/dev/null 2>&1; then
9964 echo "Your C compiler doesn't support __attribute__((nonnull))."
9967 echo "Your C compiler supports __attribute__((nonnull))."
9971 echo "Your C compiler doesn't seem to understand __attribute__ at all."
9975 *) val="$d_attribute_nonnull" ;;
9977 set d_attribute_nonnull
9981 : Look for GCC-style attribute noreturn
9982 case "$d_attribute_noreturn" in
9985 echo "Checking whether your compiler can handle __attribute__((noreturn)) ..." >&4
9986 $cat >attrib.c <<'EOCP'
9988 void fall_over_dead( void ) __attribute__((noreturn));
9990 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
9991 if $contains 'warning' attrib.out >/dev/null 2>&1; then
9992 echo "Your C compiler doesn't support __attribute__((noreturn))."
9995 echo "Your C compiler supports __attribute__((noreturn))."
9999 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10003 *) val="$d_attribute_noreturn" ;;
10005 set d_attribute_noreturn
10009 : Look for GCC-style attribute pure
10010 case "$d_attribute_pure" in
10013 echo "Checking whether your compiler can handle __attribute__((pure)) ..." >&4
10014 $cat >attrib.c <<'EOCP'
10016 int square( int n ) __attribute__((pure));
10018 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10019 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10020 echo "Your C compiler doesn't support __attribute__((pure))."
10023 echo "Your C compiler supports __attribute__((pure))."
10027 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10031 *) val="$d_attribute_pure" ;;
10033 set d_attribute_pure
10037 : Look for GCC-style attribute unused
10038 case "$d_attribute_unused" in
10041 echo "Checking whether your compiler can handle __attribute__((unused)) ..." >&4
10042 $cat >attrib.c <<'EOCP'
10044 int do_something( int dummy __attribute__((unused)), int n );
10046 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10047 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10048 echo "Your C compiler doesn't support __attribute__((unused))."
10051 echo "Your C compiler supports __attribute__((unused))."
10055 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10059 *) val="$d_attribute_unused" ;;
10061 set d_attribute_unused
10065 : Look for GCC-style attribute warn_unused_result
10066 case "$d_attribute_warn_unused_result" in
10069 echo "Checking whether your compiler can handle __attribute__((warn_unused_result)) ..." >&4
10070 $cat >attrib.c <<'EOCP'
10072 int I_will_not_be_ignored(void) __attribute__((warn_unused_result));
10074 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10075 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10076 echo "Your C compiler doesn't support __attribute__((warn_unused_result))."
10079 echo "Your C compiler supports __attribute__((warn_unused_result))."
10083 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10087 *) val="$d_attribute_warn_unused_result" ;;
10089 set d_attribute_warn_unused_result
10093 : see if bcmp exists
10097 : see if bcopy exists
10101 : see if this is a unistd.h system
10102 set unistd.h i_unistd
10105 : see if getpgrp exists
10106 set getpgrp d_getpgrp
10109 case "$d_getpgrp" in
10112 echo "Checking to see which flavor of getpgrp is in use..."
10114 #$i_unistd I_UNISTD
10115 #include <sys/types.h>
10117 # include <unistd.h>
10119 #$i_stdlib I_STDLIB
10121 #include <stdlib.h>
10125 if (getuid() == 0) {
10126 printf("(I see you are running Configure as super-user...)\n");
10129 #ifdef TRY_BSD_PGRP
10130 if (getpgrp(1) == 0)
10139 if $cc -o try -DTRY_BSD_PGRP $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
10140 echo "You have to use getpgrp(pid) instead of getpgrp()." >&4
10142 elif $cc -o try $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
10143 echo "You have to use getpgrp() instead of getpgrp(pid)." >&4
10146 echo "I can't seem to compile and run the test program."
10148 xxx="a USG one, i.e. you use getpgrp()."
10150 # SVR4 systems can appear rather BSD-ish.
10151 case "$i_unistd" in
10153 xxx="a BSD one, i.e. you use getpgrp(pid)."
10157 xxx="probably a USG one, i.e. you use getpgrp()."
10162 echo "Assuming your getpgrp is $xxx" >&4
10171 : see if setpgrp exists
10172 set setpgrp d_setpgrp
10175 case "$d_setpgrp" in
10178 echo "Checking to see which flavor of setpgrp is in use..."
10180 #$i_unistd I_UNISTD
10181 #include <sys/types.h>
10183 # include <unistd.h>
10185 #$i_stdlib I_STDLIB
10187 #include <stdlib.h>
10191 if (getuid() == 0) {
10192 printf("(I see you are running Configure as super-user...)\n");
10195 #ifdef TRY_BSD_PGRP
10196 if (-1 == setpgrp(1, 1))
10199 if (setpgrp() != -1)
10205 if $cc -o try -DTRY_BSD_PGRP $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
10206 echo 'You have to use setpgrp(pid,pgrp) instead of setpgrp().' >&4
10208 elif $cc -o try $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
10209 echo 'You have to use setpgrp() instead of setpgrp(pid,pgrp).' >&4
10212 echo "(I can't seem to compile and run the test program.)"
10214 xxx="a USG one, i.e. you use setpgrp()."
10216 # SVR4 systems can appear rather BSD-ish.
10217 case "$i_unistd" in
10219 xxx="a BSD one, i.e. you use setpgrp(pid,pgrp)."
10223 xxx="probably a USG one, i.e. you use setpgrp()."
10228 echo "Assuming your setpgrp is $xxx" >&4
10236 : see if bzero exists
10240 : see if signal is declared as pointer to function returning int or void
10242 xxx=`./findhdr signal.h`
10243 $test "$xxx" && $cppstdin $cppminus $cppflags < $xxx >$$.tmp 2>/dev/null
10244 if $contains 'int.*\*[ ]*signal' $$.tmp >/dev/null 2>&1 ; then
10245 echo "You have int (*signal())() instead of void." >&4
10247 elif $contains 'void.*\*[ ]*signal' $$.tmp >/dev/null 2>&1 ; then
10248 echo "You have void (*signal())()." >&4
10250 elif $contains 'extern[ ]*[(\*]*signal' $$.tmp >/dev/null 2>&1 ; then
10251 echo "You have int (*signal())() instead of void." >&4
10253 elif $contains 'void.*\*.*sig' $$.tmp >/dev/null 2>&1 ; then
10254 echo "You have void (*signal())()." >&4
10257 case "$d_voidsig" in
10259 echo "I can't determine whether signal handler returns void or int..." >&4
10261 rp="What type does your signal handler return?"
10264 v*) val="$define";;
10268 echo "As you already told me, signal handler returns void." >&4
10271 *) echo "As you already told me, signal handler returns int." >&4
10278 case "$d_voidsig" in
10279 "$define") signal_t="void";;
10280 *) signal_t="int";;
10284 : check for ability to cast large floats to 32-bit ints.
10286 echo 'Checking whether your C compiler can cast large floats to int32.' >&4
10287 if $test "$intsize" -ge 4; then
10294 #$i_stdlib I_STDLIB
10296 #include <stdlib.h>
10298 #include <sys/types.h>
10299 #include <signal.h>
10300 $signal_t blech(s) int s; { exit(3); }
10307 signal(SIGFPE, blech);
10309 /* Don't let compiler optimize the test away. Store the number
10310 in a writable string for gcc to pass to sscanf under HP/UX.
10312 sprintf(str, "2147483647");
10313 sscanf(str, "%lf", &f); /* f = (double) 0x7fffffff; */
10317 /* x86 processors will probably give 0x8000 0000, which is a
10318 sign change. We don't want that. We want to mimic SPARC
10319 behavior here, which is to preserve the sign and give
10322 if (i32 != ($xxx) f)
10328 if eval $compile_ok; then
10332 echo "(I can't seem to compile the test program--assuming it can't)"
10337 echo "Yup, it can."
10340 echo "Nope, it can't."
10347 : check for ability to cast negative floats to unsigned
10349 echo 'Checking whether your C compiler can cast negative float to unsigned.' >&4
10352 #$i_stdlib I_STDLIB
10354 #include <stdlib.h>
10356 #include <sys/types.h>
10357 #include <signal.h>
10358 $signal_t blech(s) int s; { exit(7); }
10359 $signal_t blech_in_list(s) int s; { exit(4); }
10360 unsigned long dummy_long(p) unsigned long p; { return p; }
10361 unsigned int dummy_int(p) unsigned int p; { return p; }
10362 unsigned short dummy_short(p) unsigned short p; { return p; }
10366 unsigned long along;
10368 unsigned short ashort;
10372 /* Frustrate gcc-2.7.2's optimizer which failed this test with
10373 a direct f = -123. assignment. gcc-2.8.0 reportedly
10374 optimized the whole file away
10376 /* Store the number in a writable string for gcc to pass to
10377 sscanf under HP/UX.
10379 sprintf(str, "-123");
10380 sscanf(str, "%lf", &f); /* f = -123.; */
10382 signal(SIGFPE, blech);
10383 along = (unsigned long)f;
10384 aint = (unsigned int)f;
10385 ashort = (unsigned short)f;
10386 if (along != (unsigned long)-123)
10388 if (aint != (unsigned int)-123)
10390 if (ashort != (unsigned short)-123)
10392 sprintf(str, "1073741824.");
10393 sscanf(str, "%lf", &f); /* f = (double)0x40000000; */
10396 along = (unsigned long)f;
10397 if (along != 0x80000000)
10401 along = (unsigned long)f;
10402 if (along != 0x7fffffff)
10406 along = (unsigned long)f;
10407 if (along != 0x80000001)
10411 signal(SIGFPE, blech_in_list);
10412 sprintf(str, "123.");
10413 sscanf(str, "%lf", &f); /* f = 123.; */
10414 along = dummy_long((unsigned long)f);
10415 aint = dummy_int((unsigned int)f);
10416 ashort = dummy_short((unsigned short)f);
10417 if (along != (unsigned long)123)
10419 if (aint != (unsigned int)123)
10421 if (ashort != (unsigned short)123)
10428 if eval $compile_ok; then
10432 echo "(I can't seem to compile the test program--assuming it can't)"
10435 case "$castflags" in
10437 echo "Yup, it can."
10440 echo "Nope, it can't."
10447 : see if vprintf exists
10449 if set vprintf val -f d_vprintf; eval $csym; $val; then
10450 echo 'vprintf() found.' >&4
10453 #include <varargs.h>
10454 #$i_stdlib I_STDLIB
10456 #include <stdlib.h>
10459 int main() { xxx("foo"); }
10468 exit((unsigned long)vsprintf(buf,"%s",args) > 10L);
10472 if eval $compile && $run ./try; then
10473 echo "Your vsprintf() returns (int)." >&4
10476 echo "Your vsprintf() returns (char*)." >&4
10480 echo 'vprintf() NOT found.' >&4
10491 : see if chown exists
10495 : see if chroot exists
10496 set chroot d_chroot
10499 : see if chsize exists
10500 set chsize d_chsize
10503 : see if class exists
10507 hasstruct='varname=$1; struct=$2; shift; shift;
10508 while $test $# -ge 2; do
10510 $define) echo "#include <$2>";;
10514 echo "int main () { struct $struct foo; }" >> try.c;
10516 if eval $compile; then
10523 $rm -f try.c try.o'
10527 : see whether socket exists
10529 $echo $n "Hmm... $c" >&4
10530 if set socket val -f d_socket; eval $csym; $val; then
10531 echo "Looks like you have Berkeley networking support." >&4
10533 if set setsockopt val -f; eval $csym; $val; then
10536 echo "...but it uses the old BSD 4.1c interface, rather than 4.2." >&4
10537 d_oldsock="$define"
10540 if $contains socklib libc.list >/dev/null 2>&1; then
10541 echo "Looks like you have Berkeley networking support." >&4
10543 : we will have to assume that it supports the 4.2 BSD interface
10546 echo "You don't have Berkeley networking in libc$_a..." >&4
10547 if test "X$d_socket" = "X$define"; then
10548 echo "...but you seem to believe that you have sockets." >&4
10550 for net in net socket
10552 if test -f /usr/lib/lib$net$_a; then
10553 ( ($nm $nm_opt /usr/lib/lib$net$_a | eval $nm_extract) || \
10554 $ar t /usr/lib/lib$net$_a) 2>/dev/null >> libc.list
10555 if $contains socket libc.list >/dev/null 2>&1; then
10560 echo "...but the Wollongong group seems to have hacked it in." >&4
10561 sockethdr="-I/usr/netinclude"
10564 echo "Found Berkeley sockets interface in lib$net." >&4
10565 if $contains setsockopt libc.list >/dev/null 2>&1; then
10568 echo "...using the old BSD 4.1c interface, rather than 4.2." >&4
10569 d_oldsock="$define"
10575 if test "X$d_socket" != "X$define"; then
10576 echo "or anywhere else I see." >&4
10584 : see if socketpair exists
10585 set socketpair d_sockpair
10590 echo "Checking the availability of certain socket constants..." >&4
10591 for ENUM in MSG_CTRUNC MSG_DONTROUTE MSG_OOB MSG_PEEK MSG_PROXY SCM_RIGHTS; do
10592 enum=`$echo $ENUM|./tr '[A-Z]' '[a-z]'`
10594 #include <sys/types.h>
10595 #include <sys/socket.h>
10601 set try; if eval $compile; then
10604 set d_${enum}; eval $setvar
10608 : see if this is a sys/uio.h system
10609 set sys/uio.h i_sysuio
10614 echo "Checking to see if your system supports struct cmsghdr..." >&4
10615 set d_cmsghdr_s cmsghdr $i_systypes sys/types.h $d_socket sys/socket.h $i_sysuio sys/uio.h
10617 case "$d_cmsghdr_s" in
10618 "$define") echo "Yes, it does." ;;
10619 *) echo "No, it doesn't." ;;
10623 : check for const keyword
10625 echo 'Checking to see if your C compiler knows about "const"...' >&4
10626 $cat >const.c <<'EOCP'
10627 typedef struct spug { int drokk; } spug;
10634 if $cc -c $ccflags const.c >/dev/null 2>&1 ; then
10636 echo "Yup, it does."
10639 echo "Nope, it doesn't."
10644 : see if copysignl exists
10645 set copysignl d_copysignl
10648 : see if crypt exists
10653 $define) cryptlib='' ;;
10654 *) if set crypt val -f d_crypt; eval $csym; $val; then
10655 echo 'crypt() found.' >&4
10659 cryptlib=`./loc Slibcrypt$_a "" $xlibpth`
10660 if $test -z "$cryptlib"; then
10661 cryptlib=`./loc Mlibcrypt$_a "" $xlibpth`
10665 if $test -z "$cryptlib"; then
10666 cryptlib=`./loc Llibcrypt$_a "" $xlibpth`
10670 if $test -z "$cryptlib"; then
10671 cryptlib=`./loc libcrypt$_a "" $libpth`
10675 if $test -z "$cryptlib"; then
10676 echo 'crypt() NOT found.' >&4
10687 : see if this is a crypt.h system
10688 set crypt.h i_crypt
10691 : see if crypt_r exists
10692 set crypt_r d_crypt_r
10694 case "$d_crypt_r" in
10696 hdrs="$i_systypes sys/types.h define stdio.h $i_crypt crypt.h"
10697 case "$d_crypt_r_proto:$usethreads" in
10698 ":define") d_crypt_r_proto=define
10699 set d_crypt_r_proto crypt_r $hdrs
10703 case "$d_crypt_r_proto" in
10705 case "$crypt_r_proto" in
10706 ''|0) try='char* crypt_r(const char*, const char*, struct crypt_data*);'
10707 ./protochk "extern $try" $hdrs && crypt_r_proto=B_CCS ;;
10709 case "$crypt_r_proto" in
10710 ''|0) try='char* crypt_r(const char*, const char*, CRYPTD*);'
10711 ./protochk "extern $try" $hdrs && crypt_r_proto=B_CCD ;;
10713 case "$crypt_r_proto" in
10714 ''|0) d_crypt_r=undef
10716 echo "Disabling crypt_r, cannot determine prototype." >&4 ;;
10717 * ) case "$crypt_r_proto" in
10718 REENTRANT_PROTO*) ;;
10719 *) crypt_r_proto="REENTRANT_PROTO_$crypt_r_proto" ;;
10721 echo "Prototype: $try" ;;
10724 *) case "$usethreads" in
10725 define) echo "crypt_r has no prototype, not using it." >&4 ;;
10736 : get csh whereabouts
10738 'csh') val="$undef" ;;
10739 *) val="$define" ;;
10743 : Respect a hint or command line value for full_csh.
10744 case "$full_csh" in
10745 '') full_csh=$csh ;;
10748 : see if ctermid_r exists
10749 set ctermid_r d_ctermid_r
10751 case "$d_ctermid_r" in
10753 hdrs="$i_systypes sys/types.h define stdio.h "
10754 case "$d_ctermid_r_proto:$usethreads" in
10755 ":define") d_ctermid_r_proto=define
10756 set d_ctermid_r_proto ctermid_r $hdrs
10760 case "$d_ctermid_r_proto" in
10762 case "$ctermid_r_proto" in
10763 ''|0) try='char* ctermid_r(char*);'
10764 ./protochk "extern $try" $hdrs && ctermid_r_proto=B_B ;;
10766 case "$ctermid_r_proto" in
10767 ''|0) d_ctermid_r=undef
10769 echo "Disabling ctermid_r, cannot determine prototype." >&4 ;;
10770 * ) case "$ctermid_r_proto" in
10771 REENTRANT_PROTO*) ;;
10772 *) ctermid_r_proto="REENTRANT_PROTO_$ctermid_r_proto" ;;
10774 echo "Prototype: $try" ;;
10777 *) case "$usethreads" in
10778 define) echo "ctermid_r has no prototype, not using it." >&4 ;;
10785 *) ctermid_r_proto=0
10789 : see if ctime_r exists
10790 set ctime_r d_ctime_r
10792 case "$d_ctime_r" in
10794 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
10795 case "$d_ctime_r_proto:$usethreads" in
10796 ":define") d_ctime_r_proto=define
10797 set d_ctime_r_proto ctime_r $hdrs
10801 case "$d_ctime_r_proto" in
10803 case "$ctime_r_proto" in
10804 ''|0) try='char* ctime_r(const time_t*, char*);'
10805 ./protochk "extern $try" $hdrs && ctime_r_proto=B_SB ;;
10807 case "$ctime_r_proto" in
10808 ''|0) try='char* ctime_r(const time_t*, char*, int);'
10809 ./protochk "extern $try" $hdrs && ctime_r_proto=B_SBI ;;
10811 case "$ctime_r_proto" in
10812 ''|0) try='int ctime_r(const time_t*, char*);'
10813 ./protochk "extern $try" $hdrs && ctime_r_proto=I_SB ;;
10815 case "$ctime_r_proto" in
10816 ''|0) try='int ctime_r(const time_t*, char*, int);'
10817 ./protochk "extern $try" $hdrs && ctime_r_proto=I_SBI ;;
10819 case "$ctime_r_proto" in
10820 ''|0) d_ctime_r=undef
10822 echo "Disabling ctime_r, cannot determine prototype." >&4 ;;
10823 * ) case "$ctime_r_proto" in
10824 REENTRANT_PROTO*) ;;
10825 *) ctime_r_proto="REENTRANT_PROTO_$ctime_r_proto" ;;
10827 echo "Prototype: $try" ;;
10830 *) case "$usethreads" in
10831 define) echo "ctime_r has no prototype, not using it." >&4 ;;
10842 : see if cuserid exists
10843 set cuserid d_cuserid
10846 : see if this is a limits.h system
10847 set limits.h i_limits
10850 : see if this is a float.h system
10851 set float.h i_float
10854 : See if number of significant digits in a double precision number is known
10856 $cat >dbl_dig.c <<EOM
10857 #$i_limits I_LIMITS
10860 #include <limits.h>
10866 printf("Contains DBL_DIG");
10869 $cppstdin $cppflags $cppminus < dbl_dig.c >dbl_dig.E 2>/dev/null
10870 if $contains 'DBL_DIG' dbl_dig.E >/dev/null 2>&1; then
10871 echo "DBL_DIG found." >&4
10874 echo "DBL_DIG NOT found." >&4
10881 : see if dbm.h is available
10882 : see if dbmclose exists
10883 set dbmclose d_dbmclose
10886 case "$d_dbmclose" in
10896 *) set rpcsvc/dbm.h i_rpcsvcdbm
10901 *) echo "We won't be including <dbm.h>"
10911 : see if prototype for dbminit is available
10913 set d_dbminitproto dbminit $i_dbm dbm.h
10916 : see if difftime exists
10917 set difftime d_difftime
10920 : see if this is a dirent system
10922 if xinc=`./findhdr dirent.h`; $test "$xinc"; then
10924 echo "<dirent.h> found." >&4
10927 if xinc=`./findhdr sys/dir.h`; $test "$xinc"; then
10928 echo "<sys/dir.h> found." >&4
10931 xinc=`./findhdr sys/ndir.h`
10933 echo "<dirent.h> NOT found." >&4
10938 : Look for type of directory structure.
10940 $cppstdin $cppflags $cppminus < "$xinc" > try.c
10942 case "$direntrytype" in
10944 case "$i_dirent" in
10945 $define) guess1='struct dirent' ;;
10946 *) guess1='struct direct' ;;
10949 *) guess1="$direntrytype"
10954 'struct dirent') guess2='struct direct' ;;
10955 *) guess2='struct dirent' ;;
10958 if $contains "$guess1" try.c >/dev/null 2>&1; then
10959 direntrytype="$guess1"
10960 echo "Your directory entries are $direntrytype." >&4
10961 elif $contains "$guess2" try.c >/dev/null 2>&1; then
10962 direntrytype="$guess2"
10963 echo "Your directory entries seem to be $direntrytype." >&4
10965 echo "I don't recognize your system's directory entries." >&4
10966 rp="What type is used for directory entries on this system?"
10969 direntrytype="$ans"
10974 : see if the directory entry stores field length
10976 $cppstdin $cppflags $cppminus < "$xinc" > try.c
10977 if $contains 'd_namlen' try.c >/dev/null 2>&1; then
10978 echo "Good, your directory entry keeps length information in d_namlen." >&4
10981 echo "Your directory entry does not know about the d_namlen field." >&4
10988 : see if this is an sysdir system
10989 set sys/dir.h i_sysdir
10992 : see if this is an sysndir system
10993 set sys/ndir.h i_sysndir
10998 $cat >dirfd.c <<EOM
11000 #$i_stdlib I_STDLIB
11002 #include <stdlib.h>
11004 #$i_dirent I_DIRENT /**/
11005 #$i_sysdir I_SYS_DIR /**/
11006 #$i_sysndir I_SYS_NDIR /**/
11007 #$i_systypes I_SYS_TYPES /**/
11008 #if defined(I_SYS_TYPES)
11009 #include <sys/types.h>
11011 #if defined(I_DIRENT)
11012 #include <dirent.h>
11013 #if defined(NeXT) && defined(I_SYS_DIR) /* NeXT needs dirent + sys/dir.h */
11014 #include <sys/dir.h>
11018 #include <sys/ndir.h>
11022 #include <ndir.h> /* may be wrong in the future */
11024 #include <sys/dir.h>
11030 DIR *dirp = opendir(".");
11031 if (dirfd(dirp) >= 0)
11039 if eval $compile; then
11043 $define) echo "dirfd() found." >&4 ;;
11044 *) echo "dirfd() NOT found." >&4 ;;
11050 : see if dlerror exists
11053 set dlerror d_dlerror
11057 : see if dlfcn is available
11058 set dlfcn.h i_dlfcn
11065 On a few systems, the dynamically loaded modules that perl generates and uses
11066 will need a different extension than shared libs. The default will probably
11072 *) dflt="$dlext" ;;
11074 rp='What is the extension of dynamically loaded modules'
11083 : Check if dlsym need a leading underscore
11089 echo "Checking whether your dlsym() needs a leading underscore ..." >&4
11090 $cat >dyna.c <<'EOM'
11097 #$i_stdlib I_STDLIB
11099 #include <stdlib.h>
11103 #include <dlfcn.h> /* the dynamic linker include file for SunOS/Solaris */
11105 #include <sys/types.h>
11110 extern int fred() ;
11119 int mode = RTLD_LAZY ;
11121 handle = dlopen("./dyna.$dlext", mode) ;
11122 if (handle == NULL) {
11127 symbol = dlsym(handle, "fred") ;
11128 if (symbol == NULL) {
11129 /* try putting a leading underscore */
11130 symbol = dlsym(handle, "_fred") ;
11131 if (symbol == NULL) {
11144 : Call the object file tmp-dyna.o in case dlext=o.
11145 if $cc $ccflags $cccdlflags -c dyna.c > /dev/null 2>&1 &&
11146 mv dyna${_o} tmp-dyna${_o} > /dev/null 2>&1 &&
11147 $ld -o dyna.$dlext $ldflags $lddlflags tmp-dyna${_o} > /dev/null 2>&1 &&
11148 $cc -o fred $ccflags $ldflags $cccdlflags $ccdlflags fred.c $libs > /dev/null 2>&1 && $to dyna.$dlext; then
11151 1) echo "Test program failed using dlopen." >&4
11152 echo "Perhaps you should not use dynamic loading." >&4;;
11153 2) echo "Test program failed using dlsym." >&4
11154 echo "Perhaps you should not use dynamic loading." >&4;;
11155 3) echo "dlsym needs a leading underscore" >&4
11157 4) echo "dlsym doesn't need a leading underscore." >&4;;
11160 echo "I can't compile and run the test program." >&4
11161 echo "I'm guessing that dlsym doesn't need a leading underscore." >&4
11166 $rm -f fred fred.* dyna.$dlext dyna.* tmp-dyna.*
11171 : see if drand48_r exists
11172 set drand48_r d_drand48_r
11174 case "$d_drand48_r" in
11176 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
11177 case "$d_drand48_r_proto:$usethreads" in
11178 ":define") d_drand48_r_proto=define
11179 set d_drand48_r_proto drand48_r $hdrs
11183 case "$d_drand48_r_proto" in
11185 case "$drand48_r_proto" in
11186 ''|0) try='int drand48_r(struct drand48_data*, double*);'
11187 ./protochk "extern $try" $hdrs && drand48_r_proto=I_ST ;;
11189 case "$drand48_r_proto" in
11190 ''|0) d_drand48_r=undef
11192 echo "Disabling drand48_r, cannot determine prototype." >&4 ;;
11193 * ) case "$drand48_r_proto" in
11194 REENTRANT_PROTO*) ;;
11195 *) drand48_r_proto="REENTRANT_PROTO_$drand48_r_proto" ;;
11197 echo "Prototype: $try" ;;
11200 *) case "$usethreads" in
11201 define) echo "drand48_r has no prototype, not using it." >&4 ;;
11208 *) drand48_r_proto=0
11212 : see if prototype for drand48 is available
11214 set d_drand48proto drand48 $i_stdlib stdlib.h $i_unistd unistd.h
11217 : see if dup2 exists
11221 : see if eaccess exists
11222 set eaccess d_eaccess
11225 : see if endgrent exists
11226 set endgrent d_endgrent
11229 : see if this is an grp system
11235 xxx=`./findhdr grp.h`
11236 $cppstdin $cppflags $cppminus < $xxx >$$.h
11238 if $contains 'gr_passwd' $$.h >/dev/null 2>&1; then
11250 set d_grpasswd; eval $setvar
11254 : see if endgrent_r exists
11255 set endgrent_r d_endgrent_r
11257 case "$d_endgrent_r" in
11259 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
11260 case "$d_endgrent_r_proto:$usethreads" in
11261 ":define") d_endgrent_r_proto=define
11262 set d_endgrent_r_proto endgrent_r $hdrs
11266 case "$d_endgrent_r_proto" in
11268 case "$endgrent_r_proto" in
11269 ''|0) try='int endgrent_r(FILE**);'
11270 ./protochk "extern $try" $hdrs && endgrent_r_proto=I_H ;;
11272 case "$endgrent_r_proto" in
11273 ''|0) try='void endgrent_r(FILE**);'
11274 ./protochk "extern $try" $hdrs && endgrent_r_proto=V_H ;;
11276 case "$endgrent_r_proto" in
11277 ''|0) d_endgrent_r=undef
11279 echo "Disabling endgrent_r, cannot determine prototype." >&4 ;;
11280 * ) case "$endgrent_r_proto" in
11281 REENTRANT_PROTO*) ;;
11282 *) endgrent_r_proto="REENTRANT_PROTO_$endgrent_r_proto" ;;
11284 echo "Prototype: $try" ;;
11287 *) case "$usethreads" in
11288 define) echo "endgrent_r has no prototype, not using it." >&4 ;;
11295 *) endgrent_r_proto=0
11299 : see if endhostent exists
11300 set endhostent d_endhent
11303 : see if this is a netdb.h system
11304 set netdb.h i_netdb
11307 : see if endhostent_r exists
11308 set endhostent_r d_endhostent_r
11310 case "$d_endhostent_r" in
11312 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
11313 case "$d_endhostent_r_proto:$usethreads" in
11314 ":define") d_endhostent_r_proto=define
11315 set d_endhostent_r_proto endhostent_r $hdrs
11319 case "$d_endhostent_r_proto" in
11321 case "$endhostent_r_proto" in
11322 ''|0) try='int endhostent_r(struct hostent_data*);'
11323 ./protochk "extern $try" $hdrs && endhostent_r_proto=I_D ;;
11325 case "$endhostent_r_proto" in
11326 ''|0) try='void endhostent_r(struct hostent_data*);'
11327 ./protochk "extern $try" $hdrs && endhostent_r_proto=V_D ;;
11329 case "$endhostent_r_proto" in
11330 ''|0) d_endhostent_r=undef
11331 endhostent_r_proto=0
11332 echo "Disabling endhostent_r, cannot determine prototype." >&4 ;;
11333 * ) case "$endhostent_r_proto" in
11334 REENTRANT_PROTO*) ;;
11335 *) endhostent_r_proto="REENTRANT_PROTO_$endhostent_r_proto" ;;
11337 echo "Prototype: $try" ;;
11340 *) case "$usethreads" in
11341 define) echo "endhostent_r has no prototype, not using it." >&4 ;;
11343 d_endhostent_r=undef
11344 endhostent_r_proto=0
11348 *) endhostent_r_proto=0
11352 : see if endnetent exists
11353 set endnetent d_endnent
11356 : see if endnetent_r exists
11357 set endnetent_r d_endnetent_r
11359 case "$d_endnetent_r" in
11361 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
11362 case "$d_endnetent_r_proto:$usethreads" in
11363 ":define") d_endnetent_r_proto=define
11364 set d_endnetent_r_proto endnetent_r $hdrs
11368 case "$d_endnetent_r_proto" in
11370 case "$endnetent_r_proto" in
11371 ''|0) try='int endnetent_r(struct netent_data*);'
11372 ./protochk "extern $try" $hdrs && endnetent_r_proto=I_D ;;
11374 case "$endnetent_r_proto" in
11375 ''|0) try='void endnetent_r(struct netent_data*);'
11376 ./protochk "extern $try" $hdrs && endnetent_r_proto=V_D ;;
11378 case "$endnetent_r_proto" in
11379 ''|0) d_endnetent_r=undef
11380 endnetent_r_proto=0
11381 echo "Disabling endnetent_r, cannot determine prototype." >&4 ;;
11382 * ) case "$endnetent_r_proto" in
11383 REENTRANT_PROTO*) ;;
11384 *) endnetent_r_proto="REENTRANT_PROTO_$endnetent_r_proto" ;;
11386 echo "Prototype: $try" ;;
11389 *) case "$usethreads" in
11390 define) echo "endnetent_r has no prototype, not using it." >&4 ;;
11392 d_endnetent_r=undef
11393 endnetent_r_proto=0
11397 *) endnetent_r_proto=0
11401 : see if endprotoent exists
11402 set endprotoent d_endpent
11405 : see if endprotoent_r exists
11406 set endprotoent_r d_endprotoent_r
11408 case "$d_endprotoent_r" in
11410 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
11411 case "$d_endprotoent_r_proto:$usethreads" in
11412 ":define") d_endprotoent_r_proto=define
11413 set d_endprotoent_r_proto endprotoent_r $hdrs
11417 case "$d_endprotoent_r_proto" in
11419 case "$endprotoent_r_proto" in
11420 ''|0) try='int endprotoent_r(struct protoent_data*);'
11421 ./protochk "extern $try" $hdrs && endprotoent_r_proto=I_D ;;
11423 case "$endprotoent_r_proto" in
11424 ''|0) try='void endprotoent_r(struct protoent_data*);'
11425 ./protochk "extern $try" $hdrs && endprotoent_r_proto=V_D ;;
11427 case "$endprotoent_r_proto" in
11428 ''|0) d_endprotoent_r=undef
11429 endprotoent_r_proto=0
11430 echo "Disabling endprotoent_r, cannot determine prototype." >&4 ;;
11431 * ) case "$endprotoent_r_proto" in
11432 REENTRANT_PROTO*) ;;
11433 *) endprotoent_r_proto="REENTRANT_PROTO_$endprotoent_r_proto" ;;
11435 echo "Prototype: $try" ;;
11438 *) case "$usethreads" in
11439 define) echo "endprotoent_r has no prototype, not using it." >&4 ;;
11441 d_endprotoent_r=undef
11442 endprotoent_r_proto=0
11446 *) endprotoent_r_proto=0
11450 : see if endpwent exists
11451 set endpwent d_endpwent
11454 : see if this is a pwd.h system
11460 xxx=`./findhdr pwd.h`
11461 $cppstdin $cppflags $cppminus < $xxx >$$.h
11463 if $contains 'pw_quota' $$.h >/dev/null 2>&1; then
11471 if $contains 'pw_age' $$.h >/dev/null 2>&1; then
11479 if $contains 'pw_change' $$.h >/dev/null 2>&1; then
11487 if $contains 'pw_class' $$.h >/dev/null 2>&1; then
11495 if $contains 'pw_expire' $$.h >/dev/null 2>&1; then
11503 if $contains 'pw_comment' $$.h >/dev/null 2>&1; then
11511 if $contains 'pw_gecos' $$.h >/dev/null 2>&1; then
11519 if $contains 'pw_passwd' $$.h >/dev/null 2>&1; then
11531 set d_pwquota; eval $setvar
11532 set d_pwage; eval $setvar
11533 set d_pwchange; eval $setvar
11534 set d_pwclass; eval $setvar
11535 set d_pwexpire; eval $setvar
11536 set d_pwcomment; eval $setvar
11537 set d_pwgecos; eval $setvar
11538 set d_pwpasswd; eval $setvar
11542 : see if endpwent_r exists
11543 set endpwent_r d_endpwent_r
11545 case "$d_endpwent_r" in
11547 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
11548 case "$d_endpwent_r_proto:$usethreads" in
11549 ":define") d_endpwent_r_proto=define
11550 set d_endpwent_r_proto endpwent_r $hdrs
11554 case "$d_endpwent_r_proto" in
11556 case "$endpwent_r_proto" in
11557 ''|0) try='int endpwent_r(FILE**);'
11558 ./protochk "extern $try" $hdrs && endpwent_r_proto=I_H ;;
11560 case "$endpwent_r_proto" in
11561 ''|0) try='void endpwent_r(FILE**);'
11562 ./protochk "extern $try" $hdrs && endpwent_r_proto=V_H ;;
11564 case "$endpwent_r_proto" in
11565 ''|0) d_endpwent_r=undef
11567 echo "Disabling endpwent_r, cannot determine prototype." >&4 ;;
11568 * ) case "$endpwent_r_proto" in
11569 REENTRANT_PROTO*) ;;
11570 *) endpwent_r_proto="REENTRANT_PROTO_$endpwent_r_proto" ;;
11572 echo "Prototype: $try" ;;
11575 *) case "$usethreads" in
11576 define) echo "endpwent_r has no prototype, not using it." >&4 ;;
11583 *) endpwent_r_proto=0
11587 : see if endservent exists
11588 set endservent d_endsent
11591 : see if endservent_r exists
11592 set endservent_r d_endservent_r
11594 case "$d_endservent_r" in
11596 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
11597 case "$d_endservent_r_proto:$usethreads" in
11598 ":define") d_endservent_r_proto=define
11599 set d_endservent_r_proto endservent_r $hdrs
11603 case "$d_endservent_r_proto" in
11605 case "$endservent_r_proto" in
11606 ''|0) try='int endservent_r(struct servent_data*);'
11607 ./protochk "extern $try" $hdrs && endservent_r_proto=I_D ;;
11609 case "$endservent_r_proto" in
11610 ''|0) try='void endservent_r(struct servent_data*);'
11611 ./protochk "extern $try" $hdrs && endservent_r_proto=V_D ;;
11613 case "$endservent_r_proto" in
11614 ''|0) d_endservent_r=undef
11615 endservent_r_proto=0
11616 echo "Disabling endservent_r, cannot determine prototype." >&4 ;;
11617 * ) case "$endservent_r_proto" in
11618 REENTRANT_PROTO*) ;;
11619 *) endservent_r_proto="REENTRANT_PROTO_$endservent_r_proto" ;;
11621 echo "Prototype: $try" ;;
11624 *) case "$usethreads" in
11625 define) echo "endservent_r has no prototype, not using it." >&4 ;;
11627 d_endservent_r=undef
11628 endservent_r_proto=0
11632 *) endservent_r_proto=0
11636 : Locate the flags for 'open()'
11639 #include <sys/types.h>
11644 #include <sys/file.h>
11646 #$i_stdlib I_STDLIB
11648 #include <stdlib.h>
11659 : check sys/file.h first to get FREAD on Sun
11660 if $test `./findhdr sys/file.h` && \
11661 set try -DI_SYS_FILE && eval $compile; then
11663 echo "<sys/file.h> defines the O_* constants..." >&4
11664 if $run ./try; then
11665 echo "and you have the 3 argument form of open()." >&4
11668 echo "but not the 3 argument form of open(). Oh, well." >&4
11671 elif $test `./findhdr fcntl.h` && \
11672 set try -DI_FCNTL && eval $compile; then
11674 echo "<fcntl.h> defines the O_* constants..." >&4
11675 if $run ./try; then
11676 echo "and you have the 3 argument form of open()." >&4
11679 echo "but not the 3 argument form of open(). Oh, well." >&4
11684 echo "I can't find the O_* constant definitions! You got problems." >&4
11690 : see which of string.h or strings.h is needed
11692 strings=`./findhdr string.h`
11693 if $test "$strings" && $test -r "$strings"; then
11694 echo "Using <string.h> instead of <strings.h>." >&4
11698 strings=`./findhdr strings.h`
11699 if $test "$strings" && $test -r "$strings"; then
11700 echo "Using <strings.h> instead of <string.h>." >&4
11702 echo "No string header found -- You'll surely have problems." >&4
11707 case "$i_string" in
11708 "$undef") strings=`./findhdr strings.h`;;
11709 *) strings=`./findhdr string.h`;;
11712 : see if this is a sys/file.h system
11717 : do we need to include sys/file.h ?
11721 if $h_sysfile; then
11723 echo "We'll be including <sys/file.h>." >&4
11726 echo "We won't be including <sys/file.h>." >&4
11736 : see if fcntl.h is there
11741 : see if we can include fcntl.h
11747 echo "We'll be including <fcntl.h>." >&4
11750 if $h_sysfile; then
11751 echo "We don't need to include <fcntl.h> if we include <sys/file.h>." >&4
11753 echo "We won't be including <fcntl.h>." >&4
11765 : check for non-blocking I/O stuff
11766 case "$h_sysfile" in
11767 true) echo "#include <sys/file.h>" > head.c;;
11770 true) echo "#include <fcntl.h>" > head.c;;
11771 *) echo "#include <sys/fcntl.h>" > head.c;;
11776 echo "Figuring out the flag used by open() for non-blocking I/O..." >&4
11777 case "$o_nonblock" in
11779 $cat head.c > try.c
11780 $cat >>try.c <<EOCP
11782 #$i_stdlib I_STDLIB
11784 #include <stdlib.h>
11792 printf("O_NONBLOCK\n");
11796 printf("O_NDELAY\n");
11800 printf("FNDELAY\n");
11807 if eval $compile_ok; then
11808 o_nonblock=`$run ./try`
11809 case "$o_nonblock" in
11810 '') echo "I can't figure it out, assuming O_NONBLOCK will do.";;
11811 *) echo "Seems like we can use $o_nonblock.";;
11814 echo "(I can't compile the test program; pray O_NONBLOCK is right!)"
11817 *) echo "Using $hint value $o_nonblock.";;
11819 $rm -f try try.* .out core
11822 echo "Let's see what value errno gets from read() on a $o_nonblock file..." >&4
11825 $cat head.c > try.c
11826 $cat >>try.c <<EOCP
11828 #include <sys/types.h>
11829 #include <signal.h>
11831 #$i_stdlib I_STDLIB
11833 #include <stdlib.h>
11839 #define MY_O_NONBLOCK $o_nonblock
11840 #ifndef errno /* XXX need better Configure test */
11843 #$i_unistd I_UNISTD
11845 #include <unistd.h>
11847 #$i_string I_STRING
11849 #include <string.h>
11851 #include <strings.h>
11853 $signal_t blech(x) int x; { exit(3); }
11855 $cat >> try.c <<'EOCP'
11863 pipe(pd); /* Down: child -> parent */
11864 pipe(pu); /* Up: parent -> child */
11867 close(pd[1]); /* Parent reads from pd[0] */
11868 close(pu[0]); /* Parent writes (blocking) to pu[1] */
11870 if (-1 == fcntl(pd[0], F_SETFL, MY_O_NONBLOCK))
11875 signal(SIGALRM, blech);
11877 if ((ret = read(pd[0], buf, 1)) > 0) /* Nothing to read! */
11879 sprintf(string, "%d\n", ret);
11880 write(2, string, strlen(string));
11883 if (errno == EAGAIN) {
11884 printf("EAGAIN\n");
11889 if (errno == EWOULDBLOCK)
11890 printf("EWOULDBLOCK\n");
11893 write(pu[1], buf, 1); /* Unblocks child, tell it to close our pipe */
11894 sleep(2); /* Give it time to close our pipe */
11896 ret = read(pd[0], buf, 1); /* Should read EOF */
11898 sprintf(string, "%d\n", ret);
11899 write(4, string, strlen(string));
11903 close(pd[0]); /* We write to pd[1] */
11904 close(pu[1]); /* We read from pu[0] */
11905 read(pu[0], buf, 1); /* Wait for parent to signal us we may continue */
11906 close(pd[1]); /* Pipe pd is now fully closed! */
11907 exit(0); /* Bye bye, thank you for playing! */
11911 if eval $compile_ok; then
11912 echo "$startsh" >mtry
11913 echo "$run ./try >try.out 2>try.ret 4>try.err || exit 4" >>mtry
11915 ./mtry >/dev/null 2>&1
11917 0) eagain=`$cat try.out`;;
11918 1) echo "Could not perform non-blocking setting!";;
11919 2) echo "I did a successful read() for something that was not there!";;
11920 3) echo "Hmm... non-blocking I/O does not seem to be working!";;
11921 4) echo "Could not find F_SETFL!";;
11922 *) echo "Something terribly wrong happened during testing.";;
11924 rd_nodata=`$cat try.ret`
11925 echo "A read() system call with no data present returns $rd_nodata."
11926 case "$rd_nodata" in
11929 echo "(That's peculiar, fixing that to be -1.)"
11935 echo "Forcing errno EAGAIN on read() with no data available."
11939 echo "Your read() sets errno to $eagain when no data is available."
11942 status=`$cat try.err`
11944 0) echo "And it correctly returns 0 to signal EOF.";;
11945 -1) echo "But it also returns -1 to signal EOF, so be careful!";;
11946 *) echo "However, your read() returns '$status' on EOF??";;
11949 if test "$status" = "$rd_nodata"; then
11950 echo "WARNING: you can't distinguish between EOF and no data!"
11954 echo "I can't compile the test program--assuming errno EAGAIN will do."
11961 echo "Using $hint value $eagain."
11962 echo "Your read() returns $rd_nodata when no data is present."
11963 case "$d_eofnblk" in
11964 "$define") echo "And you can see EOF because read() returns 0.";;
11965 "$undef") echo "But you can't see EOF status from read() returned value.";;
11967 echo "(Assuming you can't see EOF status from read anyway.)"
11973 $rm -f try try.* .out core head.c mtry
11975 : see if _ptr and _cnt from stdio act std
11978 if $contains '_lbfsize' `./findhdr stdio.h` >/dev/null 2>&1 ; then
11979 echo "(Looks like you have stdio.h from BSD.)"
11980 case "$stdio_ptr" in
11981 '') stdio_ptr='((fp)->_p)'
11984 *) ptr_lval=$d_stdio_ptr_lval;;
11986 case "$stdio_cnt" in
11987 '') stdio_cnt='((fp)->_r)'
11990 *) cnt_lval=$d_stdio_cnt_lval;;
11992 case "$stdio_base" in
11993 '') stdio_base='((fp)->_ub._base ? (fp)->_ub._base : (fp)->_bf._base)';;
11995 case "$stdio_bufsiz" in
11996 '') stdio_bufsiz='((fp)->_ub._base ? (fp)->_ub._size : (fp)->_bf._size)';;
11998 elif $contains '_IO_fpos_t' `./findhdr stdio.h` `./findhdr libio.h` >/dev/null 2>&1 ; then
11999 echo "(Looks like you have stdio.h from Linux.)"
12000 case "$stdio_ptr" in
12001 '') stdio_ptr='((fp)->_IO_read_ptr)'
12004 *) ptr_lval=$d_stdio_ptr_lval;;
12006 case "$stdio_cnt" in
12007 '') stdio_cnt='((fp)->_IO_read_end - (fp)->_IO_read_ptr)'
12010 *) cnt_lval=$d_stdio_cnt_lval;;
12012 case "$stdio_base" in
12013 '') stdio_base='((fp)->_IO_read_base)';;
12015 case "$stdio_bufsiz" in
12016 '') stdio_bufsiz='((fp)->_IO_read_end - (fp)->_IO_read_base)';;
12019 case "$stdio_ptr" in
12020 '') stdio_ptr='((fp)->_ptr)'
12023 *) ptr_lval=$d_stdio_ptr_lval;;
12025 case "$stdio_cnt" in
12026 '') stdio_cnt='((fp)->_cnt)'
12029 *) cnt_lval=$d_stdio_cnt_lval;;
12031 case "$stdio_base" in
12032 '') stdio_base='((fp)->_base)';;
12034 case "$stdio_bufsiz" in
12035 '') stdio_bufsiz='((fp)->_cnt + (fp)->_ptr - (fp)->_base)';;
12039 : test whether _ptr and _cnt really work
12040 echo "Checking how std your stdio is..." >&4
12043 #$i_stdlib I_STDLIB
12045 #include <stdlib.h>
12047 #define FILE_ptr(fp) $stdio_ptr
12048 #define FILE_cnt(fp) $stdio_cnt
12050 FILE *fp = fopen("try.c", "r");
12053 18 <= FILE_cnt(fp) &&
12054 strncmp(FILE_ptr(fp), "include <stdio.h>\n", 18) == 0
12062 if eval $compile && $to try.c; then
12063 if $run ./try; then
12064 echo "Your stdio acts pretty std."
12067 echo "Your stdio isn't very std."
12070 echo "Your stdio doesn't appear very std."
12074 # glibc 2.2.90 and above apparently change stdio streams so Perl's
12075 # direct buffer manipulation no longer works. The Configure tests
12076 # should be changed to correctly detect this, but until then,
12077 # the following check should at least let perl compile and run.
12078 # (This quick fix should be updated before 5.8.1.)
12079 # To be defensive, reject all unknown versions, and all versions > 2.2.9.
12080 # A. Dougherty, June 3, 2002.
12081 case "$d_gnulibc" in
12083 case "$gnulibc_version" in
12087 *) echo "But I will not snoop inside glibc $gnulibc_version stdio buffers."
12096 : Can _ptr be used as an lvalue?
12097 case "$d_stdstdio$ptr_lval" in
12098 $define$define) val=$define ;;
12101 set d_stdio_ptr_lval
12104 : Can _cnt be used as an lvalue?
12105 case "$d_stdstdio$cnt_lval" in
12106 $define$define) val=$define ;;
12109 set d_stdio_cnt_lval
12113 : test whether setting _ptr sets _cnt as a side effect
12114 d_stdio_ptr_lval_sets_cnt="$undef"
12115 d_stdio_ptr_lval_nochange_cnt="$undef"
12116 case "$d_stdio_ptr_lval$d_stdstdio" in
12118 echo "Checking to see what happens if we set the stdio ptr..." >&4
12121 /* Can we scream? */
12122 /* Eat dust sed :-) */
12123 /* In the buffer space, no one can hear you scream. */
12124 #$i_stdlib I_STDLIB
12126 #include <stdlib.h>
12128 #define FILE_ptr(fp) $stdio_ptr
12129 #define FILE_cnt(fp) $stdio_cnt
12130 #include <sys/types.h>
12132 FILE *fp = fopen("try.c", "r");
12137 puts("Fail even to read");
12140 c = getc(fp); /* Read away the first # */
12142 puts("Fail even to read");
12146 18 <= FILE_cnt(fp) &&
12147 strncmp(FILE_ptr(fp), "include <stdio.h>\n", 18) == 0
12149 puts("Fail even to read");
12152 ptr = (char*) FILE_ptr(fp);
12153 cnt = (size_t)FILE_cnt(fp);
12155 FILE_ptr(fp) += 42;
12157 if ((char*)FILE_ptr(fp) != (ptr + 42)) {
12158 printf("Fail ptr check %p != %p", FILE_ptr(fp), (ptr + 42));
12161 if (FILE_cnt(fp) <= 20) {
12162 printf ("Fail (<20 chars to test)");
12165 if (strncmp(FILE_ptr(fp), "Eat dust sed :-) */\n", 20) != 0) {
12166 puts("Fail compare");
12169 if (cnt == FILE_cnt(fp)) {
12170 puts("Pass_unchanged");
12173 if (FILE_cnt(fp) == (cnt - 42)) {
12174 puts("Pass_changed");
12177 printf("Fail count was %d now %d\n", cnt, FILE_cnt(fp));
12183 if eval $compile && $to try.c; then
12184 case `$run ./try` in
12186 echo "Increasing ptr in your stdio decreases cnt by the same amount. Good." >&4
12187 d_stdio_ptr_lval_sets_cnt="$define" ;;
12189 echo "Increasing ptr in your stdio leaves cnt unchanged. Good." >&4
12190 d_stdio_ptr_lval_nochange_cnt="$define" ;;
12192 echo "Increasing ptr in your stdio didn't do exactly what I expected. We'll not be doing that then." >&4 ;;
12194 echo "It appears attempting to set ptr in your stdio is a bad plan." >&4 ;;
12197 echo "It seems we can't set ptr in your stdio. Nevermind." >&4
12203 : see if _base is also standard
12205 case "$d_stdstdio" in
12209 #$i_stdlib I_STDLIB
12211 #include <stdlib.h>
12213 #define FILE_base(fp) $stdio_base
12214 #define FILE_bufsiz(fp) $stdio_bufsiz
12216 FILE *fp = fopen("try.c", "r");
12219 19 <= FILE_bufsiz(fp) &&
12220 strncmp(FILE_base(fp), "#include <stdio.h>\n", 19) == 0
12227 if eval $compile && $to try.c; then
12228 if $run ./try; then
12229 echo "And its _base field acts std."
12232 echo "But its _base field isn't std."
12235 echo "However, it seems to be lacking the _base field."
12243 : see if fast_stdio exists
12245 case "$d_stdstdio:$d_stdio_ptr_lval" in
12247 case "$d_stdio_cnt_lval$d_stdio_ptr_lval_sets_cnt" in
12249 echo "You seem to have 'fast stdio' to directly manipulate the stdio buffers." >& 4
12260 : see if fchdir exists
12261 set fchdir d_fchdir
12264 : see if fchmod exists
12265 set fchmod d_fchmod
12268 : see if fchown exists
12269 set fchown d_fchown
12272 : see if this is an fcntl system
12277 : See if fcntl-based locking works.
12279 #$i_stdlib I_STDLIB
12281 #include <stdlib.h>
12283 #include <unistd.h>
12285 #include <signal.h>
12286 $signal_t blech(x) int x; { exit(3); }
12288 #if defined(F_SETLK) && defined(F_SETLKW)
12289 struct flock flock;
12291 fd = open("try.c", O_RDONLY);
12292 flock.l_type = F_RDLCK;
12293 flock.l_whence = SEEK_SET;
12294 flock.l_start = flock.l_len = 0;
12295 signal(SIGALRM, blech);
12297 retval = fcntl(fd, F_SETLK, &flock);
12299 (retval < 0 ? exit(2) : exit(0));
12305 echo "Checking if fcntl-based file locking works... "
12309 if eval $compile_ok; then
12310 if $run ./try; then
12311 echo "Yes, it seems to work."
12314 echo "Nope, it didn't work."
12319 *** I had to forcibly timeout from fcntl(..., F_SETLK, ...).
12320 *** This is (almost) impossible.
12321 *** If your NFS lock daemons are not feeling well, something like
12322 *** this may happen, please investigate. Cannot continue, aborting.
12330 echo "I'm unable to compile the test program, so I'll assume not."
12335 echo "Nope, since you don't even have fcntl()."
12338 set d_fcntl_can_lock
12343 : check for fd_set items
12346 Checking to see how well your C compiler handles fd_set and friends ...
12349 #$i_stdlib I_STDLIB
12351 #include <stdlib.h>
12353 #$i_systime I_SYS_TIME
12354 #$i_sysselct I_SYS_SELECT
12355 #$d_socket HAS_SOCKET
12356 #include <sys/types.h>
12358 #include <sys/socket.h> /* Might include <sys/bsdtypes.h> */
12361 #include <sys/time.h>
12363 #ifdef I_SYS_SELECT
12364 #include <sys/select.h>
12373 #if defined(FD_SET) && defined(FD_CLR) && defined(FD_ISSET) && defined(FD_ZERO)
12381 if eval $compile; then
12382 d_fds_bits="$define"
12384 echo "Well, your system knows about the normal fd_set typedef..." >&4
12385 if $run ./try; then
12386 echo "and you have the normal fd_set macros (just as I'd expect)." >&4
12387 d_fd_macros="$define"
12390 but not the normal fd_set macros! Gaaack! I'll have to cover for you.
12392 d_fd_macros="$undef"
12396 Hmm, your compiler has some difficulty with fd_set. Checking further...
12399 if eval $compile; then
12400 d_fds_bits="$undef"
12402 echo "Well, your system has some sort of fd_set available..." >&4
12403 if $run ./try; then
12404 echo "and you have the normal fd_set macros." >&4
12405 d_fd_macros="$define"
12408 but not the normal fd_set macros! Gross! More work for me...
12410 d_fd_macros="$undef"
12413 echo "Well, you got zip. That's OK, I can roll my own fd_set stuff." >&4
12415 d_fds_bits="$undef"
12416 d_fd_macros="$undef"
12421 : see if fgetpos exists
12422 set fgetpos d_fgetpos
12425 : see if finite exists
12426 set finite d_finite
12429 : see if finitel exists
12430 set finitel d_finitel
12433 : see if flock exists
12437 : see if prototype for flock is available
12439 set d_flockproto flock $i_sysfile sys/file.h
12442 : see if fork exists
12446 : see if fp_class exists
12447 set fp_class d_fp_class
12450 : see if pathconf exists
12451 set pathconf d_pathconf
12454 : see if fpathconf exists
12455 set fpathconf d_fpathconf
12458 : see if fpclass exists
12459 set fpclass d_fpclass
12462 : see if fpclassify exists
12463 set fpclassify d_fpclassify
12466 : see if fpclassl exists
12467 set fpclassl d_fpclassl
12471 : check for fpos64_t
12473 echo "Checking to see if you have fpos64_t..." >&4
12476 int main() { fpos64_t x = 7; }
12479 if eval $compile; then
12481 echo "You have fpos64_t."
12484 echo "You do not have fpos64_t."
12485 case "$fpossize" in
12486 8) echo "(Your fpos_t is 64 bits, so you could use that.)" ;;
12493 : see if frexpl exists
12494 set frexpl d_frexpl
12497 : see if this is a sys/param system
12498 set sys/param.h i_sysparam
12501 : see if this is a sys/mount.h system
12502 set sys/mount.h i_sysmount
12507 echo "Checking to see if your system supports struct fs_data..." >&4
12508 set d_fs_data_s fs_data $i_systypes sys/types.h $i_sysparam sys/param.h $i_sysmount sys/mount.h
12510 case "$d_fs_data_s" in
12511 "$define") echo "Yes, it does." ;;
12512 *) echo "No, it doesn't." ;;
12515 : see if fseeko exists
12516 set fseeko d_fseeko
12518 case "$longsize" in
12519 8) echo "(Your long is 64 bits, so you could use fseek.)" ;;
12522 : see if fsetpos exists
12523 set fsetpos d_fsetpos
12527 : see if fstatfs exists
12528 set fstatfs d_fstatfs
12532 : see if statvfs exists
12533 set statvfs d_statvfs
12536 : see if fstatvfs exists
12537 set fstatvfs d_fstatvfs
12541 : see if fsync exists
12545 : see if ftello exists
12546 set ftello d_ftello
12548 case "$longsize" in
12549 8) echo "(Your long is 64 bits, so you could use ftell.)" ;;
12552 : see if getcwd exists
12553 set getcwd d_getcwd
12556 : see if getespwnam exists
12557 set getespwnam d_getespwnam
12561 : see if getfsstat exists
12562 set getfsstat d_getfsstat
12565 : see if getgrent exists
12566 set getgrent d_getgrent
12569 : see if getgrent_r exists
12570 set getgrent_r d_getgrent_r
12572 case "$d_getgrent_r" in
12574 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
12575 case "$d_getgrent_r_proto:$usethreads" in
12576 ":define") d_getgrent_r_proto=define
12577 set d_getgrent_r_proto getgrent_r $hdrs
12581 case "$d_getgrent_r_proto" in
12583 case "$getgrent_r_proto" in
12584 ''|0) try='int getgrent_r(struct group*, char*, size_t, struct group**);'
12585 ./protochk "extern $try" $hdrs && getgrent_r_proto=I_SBWR ;;
12587 case "$getgrent_r_proto" in
12588 ''|0) try='int getgrent_r(struct group*, char*, int, struct group**);'
12589 ./protochk "extern $try" $hdrs && getgrent_r_proto=I_SBIR ;;
12591 case "$getgrent_r_proto" in
12592 ''|0) try='struct group* getgrent_r(struct group*, char*, size_t);'
12593 ./protochk "extern $try" $hdrs && getgrent_r_proto=S_SBW ;;
12595 case "$getgrent_r_proto" in
12596 ''|0) try='struct group* getgrent_r(struct group*, char*, int);'
12597 ./protochk "extern $try" $hdrs && getgrent_r_proto=S_SBI ;;
12599 case "$getgrent_r_proto" in
12600 ''|0) try='int getgrent_r(struct group*, char*, int);'
12601 ./protochk "extern $try" $hdrs && getgrent_r_proto=I_SBI ;;
12603 case "$getgrent_r_proto" in
12604 ''|0) try='int getgrent_r(struct group*, char*, int, FILE**);'
12605 ./protochk "extern $try" $hdrs && getgrent_r_proto=I_SBIH ;;
12607 case "$getgrent_r_proto" in
12608 ''|0) d_getgrent_r=undef
12610 echo "Disabling getgrent_r, cannot determine prototype." >&4 ;;
12611 * ) case "$getgrent_r_proto" in
12612 REENTRANT_PROTO*) ;;
12613 *) getgrent_r_proto="REENTRANT_PROTO_$getgrent_r_proto" ;;
12615 echo "Prototype: $try" ;;
12618 *) case "$usethreads" in
12619 define) echo "getgrent_r has no prototype, not using it." >&4 ;;
12626 *) getgrent_r_proto=0
12630 : see if getgrgid_r exists
12631 set getgrgid_r d_getgrgid_r
12633 case "$d_getgrgid_r" in
12635 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
12636 case "$d_getgrgid_r_proto:$usethreads" in
12637 ":define") d_getgrgid_r_proto=define
12638 set d_getgrgid_r_proto getgrgid_r $hdrs
12642 case "$d_getgrgid_r_proto" in
12644 case "$getgrgid_r_proto" in
12645 ''|0) try='int getgrgid_r(gid_t, struct group*, char*, size_t, struct group**);'
12646 ./protochk "extern $try" $hdrs && getgrgid_r_proto=I_TSBWR ;;
12648 case "$getgrgid_r_proto" in
12649 ''|0) try='int getgrgid_r(gid_t, struct group*, char*, int, struct group**);'
12650 ./protochk "extern $try" $hdrs && getgrgid_r_proto=I_TSBIR ;;
12652 case "$getgrgid_r_proto" in
12653 ''|0) try='int getgrgid_r(gid_t, struct group*, char*, int);'
12654 ./protochk "extern $try" $hdrs && getgrgid_r_proto=I_TSBI ;;
12656 case "$getgrgid_r_proto" in
12657 ''|0) try='struct group* getgrgid_r(gid_t, struct group*, char*, int);'
12658 ./protochk "extern $try" $hdrs && getgrgid_r_proto=S_TSBI ;;
12660 case "$getgrgid_r_proto" in
12661 ''|0) d_getgrgid_r=undef
12663 echo "Disabling getgrgid_r, cannot determine prototype." >&4 ;;
12664 * ) case "$getgrgid_r_proto" in
12665 REENTRANT_PROTO*) ;;
12666 *) getgrgid_r_proto="REENTRANT_PROTO_$getgrgid_r_proto" ;;
12668 echo "Prototype: $try" ;;
12671 *) case "$usethreads" in
12672 define) echo "getgrgid_r has no prototype, not using it." >&4 ;;
12679 *) getgrgid_r_proto=0
12683 : see if getgrnam_r exists
12684 set getgrnam_r d_getgrnam_r
12686 case "$d_getgrnam_r" in
12688 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
12689 case "$d_getgrnam_r_proto:$usethreads" in
12690 ":define") d_getgrnam_r_proto=define
12691 set d_getgrnam_r_proto getgrnam_r $hdrs
12695 case "$d_getgrnam_r_proto" in
12697 case "$getgrnam_r_proto" in
12698 ''|0) try='int getgrnam_r(const char*, struct group*, char*, size_t, struct group**);'
12699 ./protochk "extern $try" $hdrs && getgrnam_r_proto=I_CSBWR ;;
12701 case "$getgrnam_r_proto" in
12702 ''|0) try='int getgrnam_r(const char*, struct group*, char*, int, struct group**);'
12703 ./protochk "extern $try" $hdrs && getgrnam_r_proto=I_CSBIR ;;
12705 case "$getgrnam_r_proto" in
12706 ''|0) try='struct group* getgrnam_r(const char*, char*, int);'
12707 ./protochk "extern $try" $hdrs && getgrnam_r_proto=S_CBI ;;
12709 case "$getgrnam_r_proto" in
12710 ''|0) try='int getgrnam_r(const char*, struct group*, char*, int);'
12711 ./protochk "extern $try" $hdrs && getgrnam_r_proto=I_CSBI ;;
12713 case "$getgrnam_r_proto" in
12714 ''|0) try='struct group* getgrnam_r(const char*, struct group*, char*, int);'
12715 ./protochk "extern $try" $hdrs && getgrnam_r_proto=S_CSBI ;;
12717 case "$getgrnam_r_proto" in
12718 ''|0) d_getgrnam_r=undef
12720 echo "Disabling getgrnam_r, cannot determine prototype." >&4 ;;
12721 * ) case "$getgrnam_r_proto" in
12722 REENTRANT_PROTO*) ;;
12723 *) getgrnam_r_proto="REENTRANT_PROTO_$getgrnam_r_proto" ;;
12725 echo "Prototype: $try" ;;
12728 *) case "$usethreads" in
12729 define) echo "getgrnam_r has no prototype, not using it." >&4 ;;
12736 *) getgrnam_r_proto=0
12740 : see if gethostbyaddr exists
12741 set gethostbyaddr d_gethbyaddr
12744 : see if gethostbyname exists
12745 set gethostbyname d_gethbyname
12748 : see if gethostent exists
12749 set gethostent d_gethent
12752 : see how we will look up host name
12755 if set gethostname val -f d_gethname; eval $csym; $val; then
12756 echo 'gethostname() found.' >&4
12757 d_gethname="$define"
12760 if set uname val -f d_uname; eval $csym; $val; then
12763 uname() was found, but you're running xenix, and older versions of xenix
12764 have a broken uname(). If you don't really know whether your xenix is old
12765 enough to have a broken system call, use the default answer.
12770 "$define") dflt=n;;
12772 rp='Is your uname() broken?'
12775 n*) d_uname="$define"; call=uname;;
12778 echo 'uname() found.' >&4
12785 case "$d_gethname" in
12786 '') d_gethname="$undef";;
12789 '') d_uname="$undef";;
12791 case "$d_uname$d_gethname" in
12796 Every now and then someone has a $call() that lies about the hostname
12797 but can't be fixed for political or economic reasons. If you wish, I can
12798 pretend $call() isn't there and maybe compute hostname at run-time
12799 thanks to the '$phostname' command.
12802 rp="Shall I ignore $call() from now on?"
12805 y*) d_uname="$undef" d_gethname="$undef"; $echo $n "Okay...$c";;
12808 case "$phostname" in
12809 '') aphostname='';;
12810 *) case "$aphostname" in
12812 *) set X $phostname
12816 file=`./loc $file $file $pth`
12817 aphostname=`echo $file $*`
12822 case "$d_uname$d_gethname" in
12825 case "$phostname" in
12827 echo "There will be no way for $package to get your hostname." >&4;;
12829 echo "I'll use 'popen("'"'$aphostname'", "r")'"' to get your hostname." >&4
12833 case "$d_phostname" in
12834 '') d_phostname="$undef";;
12837 : see if gethostbyaddr_r exists
12838 set gethostbyaddr_r d_gethostbyaddr_r
12840 case "$d_gethostbyaddr_r" in
12842 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
12843 case "$d_gethostbyaddr_r_proto:$usethreads" in
12844 ":define") d_gethostbyaddr_r_proto=define
12845 set d_gethostbyaddr_r_proto gethostbyaddr_r $hdrs
12849 case "$d_gethostbyaddr_r_proto" in
12851 case "$gethostbyaddr_r_proto" in
12852 ''|0) try='int gethostbyaddr_r(const char*, size_t, int, struct hostent*, char*, size_t, struct hostent**, int*);'
12853 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=I_CWISBWRE ;;
12855 case "$gethostbyaddr_r_proto" in
12856 ''|0) try='struct hostent* gethostbyaddr_r(const char*, size_t, int, struct hostent*, char*, size_t, int, int*);'
12857 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=S_CWISBWIE ;;
12859 case "$gethostbyaddr_r_proto" in
12860 ''|0) try='struct hostent* gethostbyaddr_r(const char*, size_t, int, struct hostent*, char*, int, int*);'
12861 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=S_CWISBIE ;;
12863 case "$gethostbyaddr_r_proto" in
12864 ''|0) try='struct hostent* gethostbyaddr_r(const void*, size_t, int, struct hostent*, char*, int, int*);'
12865 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=S_TWISBIE ;;
12867 case "$gethostbyaddr_r_proto" in
12868 ''|0) try='struct hostent* gethostbyaddr_r(const char*, int, int, struct hostent*, char*, int, int*);'
12869 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=S_CIISBIE ;;
12871 case "$gethostbyaddr_r_proto" in
12872 ''|0) try='struct hostent* gethostbyaddr_r(const char*, struct hostent*, char*, int, int*);'
12873 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=S_CSBIE ;;
12875 case "$gethostbyaddr_r_proto" in
12876 ''|0) try='struct hostent* gethostbyaddr_r(const void*, struct hostent*, char*, int, int*);'
12877 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=S_TSBIE ;;
12879 case "$gethostbyaddr_r_proto" in
12880 ''|0) try='int gethostbyaddr_r(const char*, size_t, int, struct hostent*, struct hostent_data*);'
12881 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=I_CWISD ;;
12883 case "$gethostbyaddr_r_proto" in
12884 ''|0) try='int gethostbyaddr_r(const char*, int, int, struct hostent*, struct hostent_data*);'
12885 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=I_CIISD ;;
12887 case "$gethostbyaddr_r_proto" in
12888 ''|0) try='int gethostbyaddr_r(const char*, int, int);'
12889 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=I_CII ;;
12891 case "$gethostbyaddr_r_proto" in
12892 ''|0) try='int gethostbyaddr_r(const void*, socklen_t, int, struct hostent*, char*, size_t, struct hostent**, int*);'
12893 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=I_TsISBWRE ;;
12895 case "$gethostbyaddr_r_proto" in
12896 ''|0) d_gethostbyaddr_r=undef
12897 gethostbyaddr_r_proto=0
12898 echo "Disabling gethostbyaddr_r, cannot determine prototype." >&4 ;;
12899 * ) case "$gethostbyaddr_r_proto" in
12900 REENTRANT_PROTO*) ;;
12901 *) gethostbyaddr_r_proto="REENTRANT_PROTO_$gethostbyaddr_r_proto" ;;
12903 echo "Prototype: $try" ;;
12906 *) case "$usethreads" in
12907 define) echo "gethostbyaddr_r has no prototype, not using it." >&4 ;;
12909 d_gethostbyaddr_r=undef
12910 gethostbyaddr_r_proto=0
12914 *) gethostbyaddr_r_proto=0
12918 : see if gethostbyname_r exists
12919 set gethostbyname_r d_gethostbyname_r
12921 case "$d_gethostbyname_r" in
12923 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
12924 case "$d_gethostbyname_r_proto:$usethreads" in
12925 ":define") d_gethostbyname_r_proto=define
12926 set d_gethostbyname_r_proto gethostbyname_r $hdrs
12930 case "$d_gethostbyname_r_proto" in
12932 case "$gethostbyname_r_proto" in
12933 ''|0) try='int gethostbyname_r(const char*, struct hostent*, char*, size_t, struct hostent**, int*);'
12934 ./protochk "extern $try" $hdrs && gethostbyname_r_proto=I_CSBWRE ;;
12936 case "$gethostbyname_r_proto" in
12937 ''|0) try='struct hostent* gethostbyname_r(const char*, struct hostent*, char*, int, int*);'
12938 ./protochk "extern $try" $hdrs && gethostbyname_r_proto=S_CSBIE ;;
12940 case "$gethostbyname_r_proto" in
12941 ''|0) try='int gethostbyname_r(const char*, struct hostent*, struct hostent_data*);'
12942 ./protochk "extern $try" $hdrs && gethostbyname_r_proto=I_CSD ;;
12944 case "$gethostbyname_r_proto" in
12945 ''|0) d_gethostbyname_r=undef
12946 gethostbyname_r_proto=0
12947 echo "Disabling gethostbyname_r, cannot determine prototype." >&4 ;;
12948 * ) case "$gethostbyname_r_proto" in
12949 REENTRANT_PROTO*) ;;
12950 *) gethostbyname_r_proto="REENTRANT_PROTO_$gethostbyname_r_proto" ;;
12952 echo "Prototype: $try" ;;
12955 *) case "$usethreads" in
12956 define) echo "gethostbyname_r has no prototype, not using it." >&4 ;;
12958 d_gethostbyname_r=undef
12959 gethostbyname_r_proto=0
12963 *) gethostbyname_r_proto=0
12967 : see if gethostent_r exists
12968 set gethostent_r d_gethostent_r
12970 case "$d_gethostent_r" in
12972 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
12973 case "$d_gethostent_r_proto:$usethreads" in
12974 ":define") d_gethostent_r_proto=define
12975 set d_gethostent_r_proto gethostent_r $hdrs
12979 case "$d_gethostent_r_proto" in
12981 case "$gethostent_r_proto" in
12982 ''|0) try='int gethostent_r(struct hostent*, char*, size_t, struct hostent**, int*);'
12983 ./protochk "extern $try" $hdrs && gethostent_r_proto=I_SBWRE ;;
12985 case "$gethostent_r_proto" in
12986 ''|0) try='int gethostent_r(struct hostent*, char*, int, int*);'
12987 ./protochk "extern $try" $hdrs && gethostent_r_proto=I_SBIE ;;
12989 case "$gethostent_r_proto" in
12990 ''|0) try='struct hostent* gethostent_r(struct hostent*, char*, int, int*);'
12991 ./protochk "extern $try" $hdrs && gethostent_r_proto=S_SBIE ;;
12993 case "$gethostent_r_proto" in
12994 ''|0) try='struct hostent* gethostent_r(struct hostent*, char*, int);'
12995 ./protochk "extern $try" $hdrs && gethostent_r_proto=S_SBI ;;
12997 case "$gethostent_r_proto" in
12998 ''|0) try='int gethostent_r(struct hostent*, char*, int);'
12999 ./protochk "extern $try" $hdrs && gethostent_r_proto=I_SBI ;;
13001 case "$gethostent_r_proto" in
13002 ''|0) try='int gethostent_r(struct hostent*, struct hostent_data*);'
13003 ./protochk "extern $try" $hdrs && gethostent_r_proto=I_SD ;;
13005 case "$gethostent_r_proto" in
13006 ''|0) d_gethostent_r=undef
13007 gethostent_r_proto=0
13008 echo "Disabling gethostent_r, cannot determine prototype." >&4 ;;
13009 * ) case "$gethostent_r_proto" in
13010 REENTRANT_PROTO*) ;;
13011 *) gethostent_r_proto="REENTRANT_PROTO_$gethostent_r_proto" ;;
13013 echo "Prototype: $try" ;;
13016 *) case "$usethreads" in
13017 define) echo "gethostent_r has no prototype, not using it." >&4 ;;
13019 d_gethostent_r=undef
13020 gethostent_r_proto=0
13024 *) gethostent_r_proto=0
13028 : see if prototypes for various gethostxxx netdb.h functions are available
13030 set d_gethostprotos gethostent $i_netdb netdb.h
13033 : see if getitimer exists
13034 set getitimer d_getitimer
13037 : see if getlogin exists
13038 set getlogin d_getlogin
13041 : see if getlogin_r exists
13042 set getlogin_r d_getlogin_r
13044 case "$d_getlogin_r" in
13046 hdrs="$i_systypes sys/types.h define stdio.h $i_unistd unistd.h"
13047 case "$d_getlogin_r_proto:$usethreads" in
13048 ":define") d_getlogin_r_proto=define
13049 set d_getlogin_r_proto getlogin_r $hdrs
13053 case "$d_getlogin_r_proto" in
13055 case "$getlogin_r_proto" in
13056 ''|0) try='int getlogin_r(char*, size_t);'
13057 ./protochk "extern $try" $hdrs && getlogin_r_proto=I_BW ;;
13059 case "$getlogin_r_proto" in
13060 ''|0) try='int getlogin_r(char*, int);'
13061 ./protochk "extern $try" $hdrs && getlogin_r_proto=I_BI ;;
13063 case "$getlogin_r_proto" in
13064 ''|0) try='char* getlogin_r(char*, size_t);'
13065 ./protochk "extern $try" $hdrs && getlogin_r_proto=B_BW ;;
13067 case "$getlogin_r_proto" in
13068 ''|0) try='char* getlogin_r(char*, int);'
13069 ./protochk "extern $try" $hdrs && getlogin_r_proto=B_BI ;;
13071 case "$getlogin_r_proto" in
13072 ''|0) d_getlogin_r=undef
13074 echo "Disabling getlogin_r, cannot determine prototype." >&4 ;;
13075 * ) case "$getlogin_r_proto" in
13076 REENTRANT_PROTO*) ;;
13077 *) getlogin_r_proto="REENTRANT_PROTO_$getlogin_r_proto" ;;
13079 echo "Prototype: $try" ;;
13082 *) case "$usethreads" in
13083 define) echo "getlogin_r has no prototype, not using it." >&4 ;;
13090 *) getlogin_r_proto=0
13094 : see if getmnt exists
13095 set getmnt d_getmnt
13098 : see if getmntent exists
13099 set getmntent d_getmntent
13102 : see if getnetbyaddr exists
13103 set getnetbyaddr d_getnbyaddr
13106 : see if getnetbyname exists
13107 set getnetbyname d_getnbyname
13110 : see if getnetent exists
13111 set getnetent d_getnent
13114 : see if getnetbyaddr_r exists
13115 set getnetbyaddr_r d_getnetbyaddr_r
13117 case "$d_getnetbyaddr_r" in
13119 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13120 case "$d_getnetbyaddr_r_proto:$usethreads" in
13121 ":define") d_getnetbyaddr_r_proto=define
13122 set d_getnetbyaddr_r_proto getnetbyaddr_r $hdrs
13126 case "$d_getnetbyaddr_r_proto" in
13128 case "$getnetbyaddr_r_proto" in
13129 ''|0) try='int getnetbyaddr_r(unsigned long, int, struct netent*, char*, size_t, struct netent**, int*);'
13130 ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=I_UISBWRE ;;
13132 case "$getnetbyaddr_r_proto" in
13133 ''|0) try='int getnetbyaddr_r(long, int, struct netent*, char*, int);'
13134 ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=I_LISBI ;;
13136 case "$getnetbyaddr_r_proto" in
13137 ''|0) try='struct netent* getnetbyaddr_r(in_addr_t, int, struct netent*, char*, int);'
13138 ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=S_TISBI ;;
13140 case "$getnetbyaddr_r_proto" in
13141 ''|0) try='struct netent* getnetbyaddr_r(long, int, struct netent*, char*, int);'
13142 ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=S_LISBI ;;
13144 case "$getnetbyaddr_r_proto" in
13145 ''|0) try='int getnetbyaddr_r(in_addr_t, int, struct netent*, struct netent_data*);'
13146 ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=I_TISD ;;
13148 case "$getnetbyaddr_r_proto" in
13149 ''|0) try='int getnetbyaddr_r(long, int, struct netent*, struct netent_data*);'
13150 ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=I_LISD ;;
13152 case "$getnetbyaddr_r_proto" in
13153 ''|0) try='int getnetbyaddr_r(int, int, struct netent*, struct netent_data*);'
13154 ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=I_IISD ;;
13156 case "$getnetbyaddr_r_proto" in
13157 ''|0) try='int getnetbyaddr_r(uint32_t, int, struct netent*, char*, size_t, struct netent**, int*);'
13158 ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=I_uISBWRE ;;
13160 case "$getnetbyaddr_r_proto" in
13161 ''|0) d_getnetbyaddr_r=undef
13162 getnetbyaddr_r_proto=0
13163 echo "Disabling getnetbyaddr_r, cannot determine prototype." >&4 ;;
13164 * ) case "$getnetbyaddr_r_proto" in
13165 REENTRANT_PROTO*) ;;
13166 *) getnetbyaddr_r_proto="REENTRANT_PROTO_$getnetbyaddr_r_proto" ;;
13168 echo "Prototype: $try" ;;
13171 *) case "$usethreads" in
13172 define) echo "getnetbyaddr_r has no prototype, not using it." >&4 ;;
13174 d_getnetbyaddr_r=undef
13175 getnetbyaddr_r_proto=0
13179 *) getnetbyaddr_r_proto=0
13183 : see if getnetbyname_r exists
13184 set getnetbyname_r d_getnetbyname_r
13186 case "$d_getnetbyname_r" in
13188 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13189 case "$d_getnetbyname_r_proto:$usethreads" in
13190 ":define") d_getnetbyname_r_proto=define
13191 set d_getnetbyname_r_proto getnetbyname_r $hdrs
13195 case "$d_getnetbyname_r_proto" in
13197 case "$getnetbyname_r_proto" in
13198 ''|0) try='int getnetbyname_r(const char*, struct netent*, char*, size_t, struct netent**, int*);'
13199 ./protochk "extern $try" $hdrs && getnetbyname_r_proto=I_CSBWRE ;;
13201 case "$getnetbyname_r_proto" in
13202 ''|0) try='int getnetbyname_r(const char*, struct netent*, char*, int);'
13203 ./protochk "extern $try" $hdrs && getnetbyname_r_proto=I_CSBI ;;
13205 case "$getnetbyname_r_proto" in
13206 ''|0) try='struct netent* getnetbyname_r(const char*, struct netent*, char*, int);'
13207 ./protochk "extern $try" $hdrs && getnetbyname_r_proto=S_CSBI ;;
13209 case "$getnetbyname_r_proto" in
13210 ''|0) try='int getnetbyname_r(const char*, struct netent*, struct netent_data*);'
13211 ./protochk "extern $try" $hdrs && getnetbyname_r_proto=I_CSD ;;
13213 case "$getnetbyname_r_proto" in
13214 ''|0) d_getnetbyname_r=undef
13215 getnetbyname_r_proto=0
13216 echo "Disabling getnetbyname_r, cannot determine prototype." >&4 ;;
13217 * ) case "$getnetbyname_r_proto" in
13218 REENTRANT_PROTO*) ;;
13219 *) getnetbyname_r_proto="REENTRANT_PROTO_$getnetbyname_r_proto" ;;
13221 echo "Prototype: $try" ;;
13224 *) case "$usethreads" in
13225 define) echo "getnetbyname_r has no prototype, not using it." >&4 ;;
13227 d_getnetbyname_r=undef
13228 getnetbyname_r_proto=0
13232 *) getnetbyname_r_proto=0
13236 : see if getnetent_r exists
13237 set getnetent_r d_getnetent_r
13239 case "$d_getnetent_r" in
13241 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13242 case "$d_getnetent_r_proto:$usethreads" in
13243 ":define") d_getnetent_r_proto=define
13244 set d_getnetent_r_proto getnetent_r $hdrs
13248 case "$d_getnetent_r_proto" in
13250 case "$getnetent_r_proto" in
13251 ''|0) try='int getnetent_r(struct netent*, char*, size_t, struct netent**, int*);'
13252 ./protochk "extern $try" $hdrs && getnetent_r_proto=I_SBWRE ;;
13254 case "$getnetent_r_proto" in
13255 ''|0) try='int getnetent_r(struct netent*, char*, int, int*);'
13256 ./protochk "extern $try" $hdrs && getnetent_r_proto=I_SBIE ;;
13258 case "$getnetent_r_proto" in
13259 ''|0) try='struct netent* getnetent_r(struct netent*, char*, int, int*);'
13260 ./protochk "extern $try" $hdrs && getnetent_r_proto=S_SBIE ;;
13262 case "$getnetent_r_proto" in
13263 ''|0) try='struct netent* getnetent_r(struct netent*, char*, int);'
13264 ./protochk "extern $try" $hdrs && getnetent_r_proto=S_SBI ;;
13266 case "$getnetent_r_proto" in
13267 ''|0) try='int getnetent_r(struct netent*, char*, int);'
13268 ./protochk "extern $try" $hdrs && getnetent_r_proto=I_SBI ;;
13270 case "$getnetent_r_proto" in
13271 ''|0) try='int getnetent_r(struct netent*, struct netent_data*);'
13272 ./protochk "extern $try" $hdrs && getnetent_r_proto=I_SD ;;
13274 case "$getnetent_r_proto" in
13275 ''|0) d_getnetent_r=undef
13276 getnetent_r_proto=0
13277 echo "Disabling getnetent_r, cannot determine prototype." >&4 ;;
13278 * ) case "$getnetent_r_proto" in
13279 REENTRANT_PROTO*) ;;
13280 *) getnetent_r_proto="REENTRANT_PROTO_$getnetent_r_proto" ;;
13282 echo "Prototype: $try" ;;
13285 *) case "$usethreads" in
13286 define) echo "getnetent_r has no prototype, not using it." >&4 ;;
13288 d_getnetent_r=undef
13289 getnetent_r_proto=0
13293 *) getnetent_r_proto=0
13297 : see if prototypes for various getnetxxx netdb.h functions are available
13299 set d_getnetprotos getnetent $i_netdb netdb.h
13302 : see if getpagesize exists
13303 set getpagesize d_getpagsz
13307 : see if getprotobyname exists
13308 set getprotobyname d_getpbyname
13311 : see if getprotobynumber exists
13312 set getprotobynumber d_getpbynumber
13315 : see if getprotoent exists
13316 set getprotoent d_getpent
13319 : see if getpgid exists
13320 set getpgid d_getpgid
13323 : see if getpgrp2 exists
13324 set getpgrp2 d_getpgrp2
13327 : see if getppid exists
13328 set getppid d_getppid
13331 : see if getpriority exists
13332 set getpriority d_getprior
13335 : see if getprotobyname_r exists
13336 set getprotobyname_r d_getprotobyname_r
13338 case "$d_getprotobyname_r" in
13340 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13341 case "$d_getprotobyname_r_proto:$usethreads" in
13342 ":define") d_getprotobyname_r_proto=define
13343 set d_getprotobyname_r_proto getprotobyname_r $hdrs
13347 case "$d_getprotobyname_r_proto" in
13349 case "$getprotobyname_r_proto" in
13350 ''|0) try='int getprotobyname_r(const char*, struct protoent*, char*, size_t, struct protoent**);'
13351 ./protochk "extern $try" $hdrs && getprotobyname_r_proto=I_CSBWR ;;
13353 case "$getprotobyname_r_proto" in
13354 ''|0) try='struct protoent* getprotobyname_r(const char*, struct protoent*, char*, int);'
13355 ./protochk "extern $try" $hdrs && getprotobyname_r_proto=S_CSBI ;;
13357 case "$getprotobyname_r_proto" in
13358 ''|0) try='int getprotobyname_r(const char*, struct protoent*, struct protoent_data*);'
13359 ./protochk "extern $try" $hdrs && getprotobyname_r_proto=I_CSD ;;
13361 case "$getprotobyname_r_proto" in
13362 ''|0) d_getprotobyname_r=undef
13363 getprotobyname_r_proto=0
13364 echo "Disabling getprotobyname_r, cannot determine prototype." >&4 ;;
13365 * ) case "$getprotobyname_r_proto" in
13366 REENTRANT_PROTO*) ;;
13367 *) getprotobyname_r_proto="REENTRANT_PROTO_$getprotobyname_r_proto" ;;
13369 echo "Prototype: $try" ;;
13372 *) case "$usethreads" in
13373 define) echo "getprotobyname_r has no prototype, not using it." >&4 ;;
13375 d_getprotobyname_r=undef
13376 getprotobyname_r_proto=0
13380 *) getprotobyname_r_proto=0
13384 : see if getprotobynumber_r exists
13385 set getprotobynumber_r d_getprotobynumber_r
13387 case "$d_getprotobynumber_r" in
13389 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13390 case "$d_getprotobynumber_r_proto:$usethreads" in
13391 ":define") d_getprotobynumber_r_proto=define
13392 set d_getprotobynumber_r_proto getprotobynumber_r $hdrs
13396 case "$d_getprotobynumber_r_proto" in
13398 case "$getprotobynumber_r_proto" in
13399 ''|0) try='int getprotobynumber_r(int, struct protoent*, char*, size_t, struct protoent**);'
13400 ./protochk "extern $try" $hdrs && getprotobynumber_r_proto=I_ISBWR ;;
13402 case "$getprotobynumber_r_proto" in
13403 ''|0) try='struct protoent* getprotobynumber_r(int, struct protoent*, char*, int);'
13404 ./protochk "extern $try" $hdrs && getprotobynumber_r_proto=S_ISBI ;;
13406 case "$getprotobynumber_r_proto" in
13407 ''|0) try='int getprotobynumber_r(int, struct protoent*, struct protoent_data*);'
13408 ./protochk "extern $try" $hdrs && getprotobynumber_r_proto=I_ISD ;;
13410 case "$getprotobynumber_r_proto" in
13411 ''|0) d_getprotobynumber_r=undef
13412 getprotobynumber_r_proto=0
13413 echo "Disabling getprotobynumber_r, cannot determine prototype." >&4 ;;
13414 * ) case "$getprotobynumber_r_proto" in
13415 REENTRANT_PROTO*) ;;
13416 *) getprotobynumber_r_proto="REENTRANT_PROTO_$getprotobynumber_r_proto" ;;
13418 echo "Prototype: $try" ;;
13421 *) case "$usethreads" in
13422 define) echo "getprotobynumber_r has no prototype, not using it." >&4 ;;
13424 d_getprotobynumber_r=undef
13425 getprotobynumber_r_proto=0
13429 *) getprotobynumber_r_proto=0
13433 : see if getprotoent_r exists
13434 set getprotoent_r d_getprotoent_r
13436 case "$d_getprotoent_r" in
13438 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13439 case "$d_getprotoent_r_proto:$usethreads" in
13440 ":define") d_getprotoent_r_proto=define
13441 set d_getprotoent_r_proto getprotoent_r $hdrs
13445 case "$d_getprotoent_r_proto" in
13447 case "$getprotoent_r_proto" in
13448 ''|0) try='int getprotoent_r(struct protoent*, char*, size_t, struct protoent**);'
13449 ./protochk "extern $try" $hdrs && getprotoent_r_proto=I_SBWR ;;
13451 case "$getprotoent_r_proto" in
13452 ''|0) try='int getprotoent_r(struct protoent*, char*, int);'
13453 ./protochk "extern $try" $hdrs && getprotoent_r_proto=I_SBI ;;
13455 case "$getprotoent_r_proto" in
13456 ''|0) try='struct protoent* getprotoent_r(struct protoent*, char*, int);'
13457 ./protochk "extern $try" $hdrs && getprotoent_r_proto=S_SBI ;;
13459 case "$getprotoent_r_proto" in
13460 ''|0) try='int getprotoent_r(struct protoent*, struct protoent_data*);'
13461 ./protochk "extern $try" $hdrs && getprotoent_r_proto=I_SD ;;
13463 case "$getprotoent_r_proto" in
13464 ''|0) d_getprotoent_r=undef
13465 getprotoent_r_proto=0
13466 echo "Disabling getprotoent_r, cannot determine prototype." >&4 ;;
13467 * ) case "$getprotoent_r_proto" in
13468 REENTRANT_PROTO*) ;;
13469 *) getprotoent_r_proto="REENTRANT_PROTO_$getprotoent_r_proto" ;;
13471 echo "Prototype: $try" ;;
13474 *) case "$usethreads" in
13475 define) echo "getprotoent_r has no prototype, not using it." >&4 ;;
13477 d_getprotoent_r=undef
13478 getprotoent_r_proto=0
13482 *) getprotoent_r_proto=0
13486 : see if prototypes for various getprotoxxx netdb.h functions are available
13488 set d_getprotoprotos getprotoent $i_netdb netdb.h
13491 : see if getprpwnam exists
13492 set getprpwnam d_getprpwnam
13495 : see if getpwent exists
13496 set getpwent d_getpwent
13499 : see if getpwent_r exists
13500 set getpwent_r d_getpwent_r
13502 case "$d_getpwent_r" in
13504 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
13505 case "$d_getpwent_r_proto:$usethreads" in
13506 ":define") d_getpwent_r_proto=define
13507 set d_getpwent_r_proto getpwent_r $hdrs
13511 case "$d_getpwent_r_proto" in
13513 case "$getpwent_r_proto" in
13514 ''|0) try='int getpwent_r(struct passwd*, char*, size_t, struct passwd**);'
13515 ./protochk "extern $try" $hdrs && getpwent_r_proto=I_SBWR ;;
13517 case "$getpwent_r_proto" in
13518 ''|0) try='int getpwent_r(struct passwd*, char*, int, struct passwd**);'
13519 ./protochk "extern $try" $hdrs && getpwent_r_proto=I_SBIR ;;
13521 case "$getpwent_r_proto" in
13522 ''|0) try='struct passwd* getpwent_r(struct passwd*, char*, size_t);'
13523 ./protochk "extern $try" $hdrs && getpwent_r_proto=S_SBW ;;
13525 case "$getpwent_r_proto" in
13526 ''|0) try='struct passwd* getpwent_r(struct passwd*, char*, int);'
13527 ./protochk "extern $try" $hdrs && getpwent_r_proto=S_SBI ;;
13529 case "$getpwent_r_proto" in
13530 ''|0) try='int getpwent_r(struct passwd*, char*, int);'
13531 ./protochk "extern $try" $hdrs && getpwent_r_proto=I_SBI ;;
13533 case "$getpwent_r_proto" in
13534 ''|0) try='int getpwent_r(struct passwd*, char*, int, FILE**);'
13535 ./protochk "extern $try" $hdrs && getpwent_r_proto=I_SBIH ;;
13537 case "$getpwent_r_proto" in
13538 ''|0) d_getpwent_r=undef
13540 echo "Disabling getpwent_r, cannot determine prototype." >&4 ;;
13541 * ) case "$getpwent_r_proto" in
13542 REENTRANT_PROTO*) ;;
13543 *) getpwent_r_proto="REENTRANT_PROTO_$getpwent_r_proto" ;;
13545 echo "Prototype: $try" ;;
13548 *) case "$usethreads" in
13549 define) echo "getpwent_r has no prototype, not using it." >&4 ;;
13556 *) getpwent_r_proto=0
13560 : see if getpwnam_r exists
13561 set getpwnam_r d_getpwnam_r
13563 case "$d_getpwnam_r" in
13565 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
13566 case "$d_getpwnam_r_proto:$usethreads" in
13567 ":define") d_getpwnam_r_proto=define
13568 set d_getpwnam_r_proto getpwnam_r $hdrs
13572 case "$d_getpwnam_r_proto" in
13574 case "$getpwnam_r_proto" in
13575 ''|0) try='int getpwnam_r(const char*, struct passwd*, char*, size_t, struct passwd**);'
13576 ./protochk "extern $try" $hdrs && getpwnam_r_proto=I_CSBWR ;;
13578 case "$getpwnam_r_proto" in
13579 ''|0) try='int getpwnam_r(const char*, struct passwd*, char*, int, struct passwd**);'
13580 ./protochk "extern $try" $hdrs && getpwnam_r_proto=I_CSBIR ;;
13582 case "$getpwnam_r_proto" in
13583 ''|0) try='struct passwd* getpwnam_r(const char*, struct passwd*, char*, int);'
13584 ./protochk "extern $try" $hdrs && getpwnam_r_proto=S_CSBI ;;
13586 case "$getpwnam_r_proto" in
13587 ''|0) try='int getpwnam_r(const char*, struct passwd*, char*, int);'
13588 ./protochk "extern $try" $hdrs && getpwnam_r_proto=I_CSBI ;;
13590 case "$getpwnam_r_proto" in
13591 ''|0) d_getpwnam_r=undef
13593 echo "Disabling getpwnam_r, cannot determine prototype." >&4 ;;
13594 * ) case "$getpwnam_r_proto" in
13595 REENTRANT_PROTO*) ;;
13596 *) getpwnam_r_proto="REENTRANT_PROTO_$getpwnam_r_proto" ;;
13598 echo "Prototype: $try" ;;
13601 *) case "$usethreads" in
13602 define) echo "getpwnam_r has no prototype, not using it." >&4 ;;
13609 *) getpwnam_r_proto=0
13613 : see if getpwuid_r exists
13614 set getpwuid_r d_getpwuid_r
13616 case "$d_getpwuid_r" in
13618 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
13619 case "$d_getpwuid_r_proto:$usethreads" in
13620 ":define") d_getpwuid_r_proto=define
13621 set d_getpwuid_r_proto getpwuid_r $hdrs
13625 case "$d_getpwuid_r_proto" in
13627 case "$getpwuid_r_proto" in
13628 ''|0) try='int getpwuid_r(uid_t, struct passwd*, char*, size_t, struct passwd**);'
13629 ./protochk "extern $try" $hdrs && getpwuid_r_proto=I_TSBWR ;;
13631 case "$getpwuid_r_proto" in
13632 ''|0) try='int getpwuid_r(uid_t, struct passwd*, char*, int, struct passwd**);'
13633 ./protochk "extern $try" $hdrs && getpwuid_r_proto=I_TSBIR ;;
13635 case "$getpwuid_r_proto" in
13636 ''|0) try='int getpwuid_r(uid_t, struct passwd*, char*, int);'
13637 ./protochk "extern $try" $hdrs && getpwuid_r_proto=I_TSBI ;;
13639 case "$getpwuid_r_proto" in
13640 ''|0) try='struct passwd* getpwuid_r(uid_t, struct passwd*, char*, int);'
13641 ./protochk "extern $try" $hdrs && getpwuid_r_proto=S_TSBI ;;
13643 case "$getpwuid_r_proto" in
13644 ''|0) d_getpwuid_r=undef
13646 echo "Disabling getpwuid_r, cannot determine prototype." >&4 ;;
13647 * ) case "$getpwuid_r_proto" in
13648 REENTRANT_PROTO*) ;;
13649 *) getpwuid_r_proto="REENTRANT_PROTO_$getpwuid_r_proto" ;;
13651 echo "Prototype: $try" ;;
13654 *) case "$usethreads" in
13655 define) echo "getpwuid_r has no prototype, not using it." >&4 ;;
13662 *) getpwuid_r_proto=0
13667 : see if getservbyname exists
13668 set getservbyname d_getsbyname
13671 : see if getservbyport exists
13672 set getservbyport d_getsbyport
13675 : see if getservent exists
13676 set getservent d_getsent
13679 : see if getservbyname_r exists
13680 set getservbyname_r d_getservbyname_r
13682 case "$d_getservbyname_r" in
13684 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13685 case "$d_getservbyname_r_proto:$usethreads" in
13686 ":define") d_getservbyname_r_proto=define
13687 set d_getservbyname_r_proto getservbyname_r $hdrs
13691 case "$d_getservbyname_r_proto" in
13693 case "$getservbyname_r_proto" in
13694 ''|0) try='int getservbyname_r(const char*, const char*, struct servent*, char*, size_t, struct servent**);'
13695 ./protochk "extern $try" $hdrs && getservbyname_r_proto=I_CCSBWR ;;
13697 case "$getservbyname_r_proto" in
13698 ''|0) try='struct servent* getservbyname_r(const char*, const char*, struct servent*, char*, int);'
13699 ./protochk "extern $try" $hdrs && getservbyname_r_proto=S_CCSBI ;;
13701 case "$getservbyname_r_proto" in
13702 ''|0) try='int getservbyname_r(const char*, const char*, struct servent*, struct servent_data*);'
13703 ./protochk "extern $try" $hdrs && getservbyname_r_proto=I_CCSD ;;
13705 case "$getservbyname_r_proto" in
13706 ''|0) d_getservbyname_r=undef
13707 getservbyname_r_proto=0
13708 echo "Disabling getservbyname_r, cannot determine prototype." >&4 ;;
13709 * ) case "$getservbyname_r_proto" in
13710 REENTRANT_PROTO*) ;;
13711 *) getservbyname_r_proto="REENTRANT_PROTO_$getservbyname_r_proto" ;;
13713 echo "Prototype: $try" ;;
13716 *) case "$usethreads" in
13717 define) echo "getservbyname_r has no prototype, not using it." >&4 ;;
13719 d_getservbyname_r=undef
13720 getservbyname_r_proto=0
13724 *) getservbyname_r_proto=0
13728 : see if getservbyport_r exists
13729 set getservbyport_r d_getservbyport_r
13731 case "$d_getservbyport_r" in
13733 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13734 case "$d_getservbyport_r_proto:$usethreads" in
13735 ":define") d_getservbyport_r_proto=define
13736 set d_getservbyport_r_proto getservbyport_r $hdrs
13740 case "$d_getservbyport_r_proto" in
13742 case "$getservbyport_r_proto" in
13743 ''|0) try='int getservbyport_r(int, const char*, struct servent*, char*, size_t, struct servent**);'
13744 ./protochk "extern $try" $hdrs && getservbyport_r_proto=I_ICSBWR ;;
13746 case "$getservbyport_r_proto" in
13747 ''|0) try='struct servent* getservbyport_r(int, const char*, struct servent*, char*, int);'
13748 ./protochk "extern $try" $hdrs && getservbyport_r_proto=S_ICSBI ;;
13750 case "$getservbyport_r_proto" in
13751 ''|0) try='int getservbyport_r(int, const char*, struct servent*, struct servent_data*);'
13752 ./protochk "extern $try" $hdrs && getservbyport_r_proto=I_ICSD ;;
13754 case "$getservbyport_r_proto" in
13755 ''|0) d_getservbyport_r=undef
13756 getservbyport_r_proto=0
13757 echo "Disabling getservbyport_r, cannot determine prototype." >&4 ;;
13758 * ) case "$getservbyport_r_proto" in
13759 REENTRANT_PROTO*) ;;
13760 *) getservbyport_r_proto="REENTRANT_PROTO_$getservbyport_r_proto" ;;
13762 echo "Prototype: $try" ;;
13765 *) case "$usethreads" in
13766 define) echo "getservbyport_r has no prototype, not using it." >&4 ;;
13768 d_getservbyport_r=undef
13769 getservbyport_r_proto=0
13773 *) getservbyport_r_proto=0
13777 : see if getservent_r exists
13778 set getservent_r d_getservent_r
13780 case "$d_getservent_r" in
13782 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13783 case "$d_getservent_r_proto:$usethreads" in
13784 ":define") d_getservent_r_proto=define
13785 set d_getservent_r_proto getservent_r $hdrs
13789 case "$d_getservent_r_proto" in
13791 case "$getservent_r_proto" in
13792 ''|0) try='int getservent_r(struct servent*, char*, size_t, struct servent**);'
13793 ./protochk "extern $try" $hdrs && getservent_r_proto=I_SBWR ;;
13795 case "$getservent_r_proto" in
13796 ''|0) try='int getservent_r(struct servent*, char*, int);'
13797 ./protochk "extern $try" $hdrs && getservent_r_proto=I_SBI ;;
13799 case "$getservent_r_proto" in
13800 ''|0) try='struct servent* getservent_r(struct servent*, char*, int);'
13801 ./protochk "extern $try" $hdrs && getservent_r_proto=S_SBI ;;
13803 case "$getservent_r_proto" in
13804 ''|0) try='int getservent_r(struct servent*, struct servent_data*);'
13805 ./protochk "extern $try" $hdrs && getservent_r_proto=I_SD ;;
13807 case "$getservent_r_proto" in
13808 ''|0) d_getservent_r=undef
13809 getservent_r_proto=0
13810 echo "Disabling getservent_r, cannot determine prototype." >&4 ;;
13811 * ) case "$getservent_r_proto" in
13812 REENTRANT_PROTO*) ;;
13813 *) getservent_r_proto="REENTRANT_PROTO_$getservent_r_proto" ;;
13815 echo "Prototype: $try" ;;
13818 *) case "$usethreads" in
13819 define) echo "getservent_r has no prototype, not using it." >&4 ;;
13821 d_getservent_r=undef
13822 getservent_r_proto=0
13826 *) getservent_r_proto=0
13830 : see if prototypes for various getservxxx netdb.h functions are available
13832 set d_getservprotos getservent $i_netdb netdb.h
13835 : see if getspnam exists
13836 set getspnam d_getspnam
13839 : see if this is a shadow.h system
13840 set shadow.h i_shadow
13843 : see if getspnam_r exists
13844 set getspnam_r d_getspnam_r
13846 case "$d_getspnam_r" in
13848 hdrs="$i_systypes sys/types.h define stdio.h $i_shadow shadow.h"
13849 case "$d_getspnam_r_proto:$usethreads" in
13850 ":define") d_getspnam_r_proto=define
13851 set d_getspnam_r_proto getspnam_r $hdrs
13855 case "$d_getspnam_r_proto" in
13857 case "$getspnam_r_proto" in
13858 ''|0) try='int getspnam_r(const char*, struct spwd*, char*, size_t, struct spwd**);'
13859 ./protochk "extern $try" $hdrs && getspnam_r_proto=I_CSBWR ;;
13861 case "$getspnam_r_proto" in
13862 ''|0) try='struct spwd* getspnam_r(const char*, struct spwd*, char*, int);'
13863 ./protochk "extern $try" $hdrs && getspnam_r_proto=S_CSBI ;;
13865 case "$getspnam_r_proto" in
13866 ''|0) d_getspnam_r=undef
13868 echo "Disabling getspnam_r, cannot determine prototype." >&4 ;;
13869 * ) case "$getspnam_r_proto" in
13870 REENTRANT_PROTO*) ;;
13871 *) getspnam_r_proto="REENTRANT_PROTO_$getspnam_r_proto" ;;
13873 echo "Prototype: $try" ;;
13876 *) case "$usethreads" in
13877 define) echo "getspnam_r has no prototype, not using it." >&4 ;;
13884 *) getspnam_r_proto=0
13888 : see if gettimeofday or ftime exists
13889 set gettimeofday d_gettimeod
13891 case "$d_gettimeod" in
13897 val="$undef"; set d_ftime; eval $setvar
13900 case "$d_gettimeod$d_ftime" in
13903 echo 'No ftime() nor gettimeofday() -- timing may be less accurate.' >&4
13907 : see if gmtime_r exists
13908 set gmtime_r d_gmtime_r
13910 case "$d_gmtime_r" in
13912 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
13913 case "$d_gmtime_r_proto:$usethreads" in
13914 ":define") d_gmtime_r_proto=define
13915 set d_gmtime_r_proto gmtime_r $hdrs
13919 case "$d_gmtime_r_proto" in
13921 case "$gmtime_r_proto" in
13922 ''|0) try='struct tm* gmtime_r(const time_t*, struct tm*);'
13923 ./protochk "extern $try" $hdrs && gmtime_r_proto=S_TS ;;
13925 case "$gmtime_r_proto" in
13926 ''|0) try='int gmtime_r(const time_t*, struct tm*);'
13927 ./protochk "extern $try" $hdrs && gmtime_r_proto=I_TS ;;
13929 case "$gmtime_r_proto" in
13930 ''|0) d_gmtime_r=undef
13932 echo "Disabling gmtime_r, cannot determine prototype." >&4 ;;
13933 * ) case "$gmtime_r_proto" in
13934 REENTRANT_PROTO*) ;;
13935 *) gmtime_r_proto="REENTRANT_PROTO_$gmtime_r_proto" ;;
13937 echo "Prototype: $try" ;;
13940 *) case "$usethreads" in
13941 define) echo "gmtime_r has no prototype, not using it." >&4 ;;
13948 *) gmtime_r_proto=0
13952 : see if hasmntopt exists
13953 set hasmntopt d_hasmntopt
13956 : see if this is a netinet/in.h or sys/in.h system
13957 set netinet/in.h i_niin sys/in.h i_sysin
13960 : see if arpa/inet.h has to be included
13961 set arpa/inet.h i_arpainet
13964 : see if htonl --and friends-- exists
13969 : Maybe they are macros.
13972 $cat >htonl.c <<EOM
13974 #include <sys/types.h>
13975 #$i_niin I_NETINET_IN
13977 #$i_arpainet I_ARPA_INET
13978 #ifdef I_NETINET_IN
13979 #include <netinet/in.h>
13982 #include <sys/in.h>
13985 #include <arpa/inet.h>
13988 printf("Defined as a macro.");
13991 $cppstdin $cppflags $cppminus < htonl.c >htonl.E 2>/dev/null
13992 if $contains 'Defined as a macro' htonl.E >/dev/null 2>&1; then
13994 echo "But it seems to be defined as a macro." >&4
14002 : see if ilogbl exists
14003 set ilogbl d_ilogbl
14008 if set index val -f; eval $csym; $val; then
14009 if set strchr val -f d_strchr; eval $csym; $val; then
14010 if $contains strchr "$strings" >/dev/null 2>&1 ; then
14013 echo "strchr() found." >&4
14017 echo "index() found." >&4
14022 echo "index() found." >&4
14025 if set strchr val -f d_strchr; eval $csym; $val; then
14028 echo "strchr() found." >&4
14030 echo "No index() or strchr() found!" >&4
14035 set d_strchr; eval $setvar
14037 set d_index; eval $setvar
14039 : check whether inet_aton exists
14040 set inet_aton d_inetaton
14045 $cat >isascii.c <<EOCP
14048 #$i_stdlib I_STDLIB
14050 #include <stdlib.h>
14061 if eval $compile; then
14062 echo "isascii() found." >&4
14065 echo "isascii() NOT found." >&4
14072 : see if isfinite exists
14073 set isfinite d_isfinite
14076 : see if isinf exists
14080 : see if isnan exists
14084 : see if isnanl exists
14085 set isnanl d_isnanl
14088 : see if killpg exists
14089 set killpg d_killpg
14092 : see if lchown exists
14094 $cat > try.c <<'EOCP'
14095 /* System header to define __stub macros and hopefully few prototypes,
14096 which can conflict with char lchown(); below. */
14097 #include <assert.h>
14098 /* Override any gcc2 internal prototype to avoid an error. */
14099 /* We use char because int might match the return type of a gcc2
14100 builtin and then its argument prototype would still apply. */
14103 /* The GNU C library defines this for functions which it implements
14104 to always fail with ENOSYS. Some functions are actually named
14105 something starting with __ and the normal name is an alias. */
14106 #if defined (__stub_lchown) || defined (__stub___lchown)
14114 if eval $compile; then
14115 $echo "lchown() found." >&4
14118 $echo "lchown() NOT found." >&4
14124 : See if number of significant digits in a double precision number is known
14126 $cat >ldbl_dig.c <<EOM
14127 #$i_limits I_LIMITS
14130 #include <limits.h>
14136 printf("Contains LDBL_DIG");
14139 $cppstdin $cppflags $cppminus < ldbl_dig.c >ldbl_dig.E 2>/dev/null
14140 if $contains 'LDBL_DIG' ldbl_dig.E >/dev/null 2>&1; then
14141 echo "LDBL_DIG found." >&4
14144 echo "LDBL_DIG NOT found." >&4
14151 : see if this is a math.h system
14155 d_libm_lib_version="$undef"
14158 : check to see if math.h defines _LIB_VERSION
14160 echo "Checking to see if your libm supports _LIB_VERSION..." >&4
14162 #include <unistd.h>
14164 int main (int argc, char *argv[])
14166 printf ("%d\n", _LIB_VERSION);
14171 if eval $compile; then
14173 echo "Yes, it does ($foo)" >&4
14174 d_libm_lib_version="$define"
14176 echo "No, it does not (probably harmless)\n" >&4
14178 $rm -f try.* try core core.try.*
14183 : see if link exists
14187 : see if localtime_r exists
14188 set localtime_r d_localtime_r
14190 case "$d_localtime_r" in
14192 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
14193 case "$d_localtime_r_proto:$usethreads" in
14194 ":define") d_localtime_r_proto=define
14195 set d_localtime_r_proto localtime_r $hdrs
14199 case "$d_localtime_r_proto" in
14201 case "$localtime_r_proto" in
14202 ''|0) try='struct tm* localtime_r(const time_t*, struct tm*);'
14203 ./protochk "extern $try" $hdrs && localtime_r_proto=S_TS ;;
14205 case "$localtime_r_proto" in
14206 ''|0) try='int localtime_r(const time_t*, struct tm*);'
14207 ./protochk "extern $try" $hdrs && localtime_r_proto=I_TS ;;
14209 case "$localtime_r_proto" in
14210 ''|0) d_localtime_r=undef
14211 localtime_r_proto=0
14212 echo "Disabling localtime_r, cannot determine prototype." >&4 ;;
14213 * ) case "$localtime_r_proto" in
14214 REENTRANT_PROTO*) ;;
14215 *) localtime_r_proto="REENTRANT_PROTO_$localtime_r_proto" ;;
14217 echo "Prototype: $try" ;;
14220 *) case "$usethreads" in
14221 define) echo "localtime_r has no prototype, not using it." >&4 ;;
14223 d_localtime_r=undef
14224 localtime_r_proto=0
14228 *) localtime_r_proto=0
14232 : see if localeconv exists
14233 set localeconv d_locconv
14236 : see if lockf exists
14240 : see if prototype for lseek is available
14242 set d_lseekproto lseek $i_systypes sys/types.h $i_unistd unistd.h
14245 : see if lstat exists
14249 : see if madvise exists
14250 set madvise d_madvise
14253 : see if malloc_size exists
14254 set malloc_size d_malloc_size
14257 : see if malloc_size_good exists
14258 set malloc_good_size d_malloc_good_size
14261 : see if mblen exists
14265 : see if mbstowcs exists
14266 set mbstowcs d_mbstowcs
14269 : see if mbtowc exists
14270 set mbtowc d_mbtowc
14273 : see if memchr exists
14274 set memchr d_memchr
14277 : see if memcmp exists
14278 set memcmp d_memcmp
14281 : see if memcpy exists
14282 set memcpy d_memcpy
14285 : see if memmove exists
14286 set memmove d_memmove
14289 : see if memset exists
14290 set memset d_memset
14293 : see if mkdir exists
14297 : see if mkdtemp exists
14298 set mkdtemp d_mkdtemp
14301 : see if mkfifo exists
14302 set mkfifo d_mkfifo
14305 : see if mkstemp exists
14306 set mkstemp d_mkstemp
14309 : see if mkstemps exists
14310 set mkstemps d_mkstemps
14313 : see if mktime exists
14314 set mktime d_mktime
14317 : see if this is a sys/mman.h system
14318 set sys/mman.h i_sysmman
14321 : see if mmap exists
14324 : see what shmat returns
14325 : default to something harmless
14327 case "$i_sysmman$d_mmap" in
14329 $cat >mmap.c <<'END'
14330 #include <sys/mman.h>
14333 if $cc $ccflags -c mmap.c >/dev/null 2>&1; then
14338 echo "and it returns ($mmaptype)." >&4
14344 : see if sqrtl exists
14348 : see if scalbnl exists
14349 set scalbnl d_scalbnl
14352 : see if modfl exists
14356 : see if prototype for modfl is available
14358 set d_modflproto modfl $i_math math.h
14361 d_modfl_pow32_bug="$undef"
14363 case "$d_longdbl$d_modfl" in
14366 Checking to see whether your modfl() is okay for large values...
14372 if $test "X$d_modflproto" != "X$define"; then
14373 $cat >>try.c <<EOCP
14374 /* Sigh. many current glibcs provide the function, but do not prototype it. */
14375 long double modfl (long double, long double *);
14378 $cat >>try.c <<EOCP
14380 long double nv = 4294967303.15;
14386 printf(" %"$sPRIfldbl" %"$sPRIfldbl" %"$sPRIfldbl"\n", nv, v, w);
14390 case "$osname:$gccversion" in
14391 aix:) saveccflags="$ccflags"
14392 ccflags="$ccflags -qlongdouble" ;; # to avoid core dump
14395 if eval $compile; then
14398 *" 4294967303.150000 1.150000 4294967302.000000")
14399 echo >&4 "Your modfl() is broken for large values."
14400 d_modfl_pow32_bug="$define"
14402 glibc) echo >&4 "You should upgrade your glibc to at least 2.2.2 to get a fixed modfl()."
14406 *" 4294967303.150000 0.150000 4294967303.000000")
14407 echo >&4 "Your modfl() seems okay for large values."
14409 *) echo >&4 "I don't understand your modfl() at all."
14413 $rm -f try.* try core core.try.*
14415 echo "I cannot figure out whether your modfl() is okay, assuming it isn't."
14418 case "$osname:$gccversion" in
14419 aix:) ccflags="$saveccflags" ;; # restore
14424 if $test "$uselongdouble" = "$define"; then
14426 if $test "$d_sqrtl" != "$define"; then
14427 message="$message sqrtl"
14429 if $test "$d_modfl" != "$define"; then
14430 if $test "$d_aintl:$d_copysignl" = "$define:$define"; then
14431 echo "You have both aintl and copysignl, so I can emulate modfl."
14433 message="$message modfl"
14436 if $test "$d_frexpl" != "$define"; then
14437 if $test "$d_ilogbl:$d_scalbnl" = "$define:$define"; then
14438 echo "You have both ilogbl and scalbnl, so I can emulate frexpl."
14440 message="$message frexpl"
14444 if $test "$message" != ""; then
14447 *** You requested the use of long doubles but you do not seem to have
14448 *** the following mathematical functions needed for long double support:
14450 *** Please rerun Configure without -Duselongdouble and/or -Dusemorebits.
14451 *** Cannot continue, aborting.
14459 : see if mprotect exists
14460 set mprotect d_mprotect
14463 : see if msgctl exists
14464 set msgctl d_msgctl
14467 : see if msgget exists
14468 set msgget d_msgget
14471 : see if msgsnd exists
14472 set msgsnd d_msgsnd
14475 : see if msgrcv exists
14476 set msgrcv d_msgrcv
14479 : see how much of the 'msg*(2)' library is present.
14482 case "$d_msgctl$d_msgget$d_msgsnd$d_msgrcv" in
14483 *"$undef"*) h_msg=false;;
14487 case "`ipcs 2>&1`" in
14488 "SVID messages"*"not configured"*)
14489 echo "Your $osname does not have the msg*(2) configured." >&4
14492 set msgctl d_msgctl
14494 set msgget d_msgget
14496 set msgsnd d_msgsnd
14498 set msgrcv d_msgrcv
14504 : we could also check for sys/ipc.h ...
14505 if $h_msg && $test `./findhdr sys/msg.h`; then
14506 echo "You have the full msg*(2) library." >&4
14509 echo "You don't have the full msg*(2) library." >&4
14517 echo "Checking to see if your system supports struct msghdr..." >&4
14518 set d_msghdr_s msghdr $i_systypes sys/types.h $d_socket sys/socket.h $i_sysuio sys/uio.h
14520 case "$d_msghdr_s" in
14521 "$define") echo "Yes, it does." ;;
14522 *) echo "No, it doesn't." ;;
14526 : see if msync exists
14530 : see if munmap exists
14531 set munmap d_munmap
14534 : see if nice exists
14538 : see if this is a langinfo.h system
14539 set langinfo.h i_langinfo
14542 : see if nl_langinfo exists
14543 set nl_langinfo d_nl_langinfo
14546 : check for length of character
14548 case "$charsize" in
14550 echo "Checking to see how big your characters are (hey, you never know)..." >&4
14553 #$i_stdlib I_STDLIB
14555 #include <stdlib.h>
14559 printf("%d\n", (int)sizeof(char));
14564 if eval $compile_ok; then
14568 echo "(I can't seem to compile the test program. Guessing...)"
14575 rp="What is the size of a character (in bytes)?"
14580 : check for volatile keyword
14582 echo 'Checking to see if your C compiler knows about "volatile"...' >&4
14583 $cat >try.c <<'EOCP'
14586 typedef struct _goo_struct goo_struct;
14587 goo_struct * volatile goo = ((goo_struct *)0);
14588 struct _goo_struct {
14593 typedef unsigned short foo_t;
14594 char *volatile foo;
14596 volatile foo_t blech;
14600 if $cc -c $ccflags try.c >/dev/null 2>&1 ; then
14602 echo "Yup, it does."
14605 echo "Nope, it doesn't."
14613 $echo "Choosing the C types to be used for Perl's internal types..." >&4
14615 case "$use64bitint:$d_quad:$quadtype" in
14618 uvtype="$uquadtype"
14623 uvtype="unsigned long"
14629 case "$uselongdouble:$d_longdbl" in
14631 nvtype="long double"
14632 nvsize=$longdblsize
14639 $echo "(IV will be "$ivtype", $ivsize bytes)"
14640 $echo "(UV will be "$uvtype", $uvsize bytes)"
14641 $echo "(NV will be "$nvtype", $nvsize bytes)"
14644 #$i_inttypes I_INTTYPES
14646 #include <inttypes.h>
14651 int8_t i = INT8_MAX;
14652 uint8_t u = UINT8_MAX;
14653 printf("int8_t\n");
14656 int16_t i = INT16_MAX;
14657 uint16_t i = UINT16_MAX;
14658 printf("int16_t\n");
14661 int32_t i = INT32_MAX;
14662 uint32_t u = UINT32_MAX;
14663 printf("int32_t\n");
14669 '') case "$charsize" in
14671 u8type="unsigned char"
14680 if eval $compile; then
14681 case "`$run ./try`" in
14682 int8_t) i8type=int8_t
14692 '') if $test $charsize -ge 1; then
14694 u8type="unsigned char"
14702 '') case "$shortsize" in
14704 u16type="unsigned short"
14712 '') set try -DINT16
14713 if eval $compile; then
14714 case "`$run ./try`" in
14726 '') if $test $shortsize -ge 2; then
14728 u16type="unsigned short"
14736 '') case "$longsize" in
14738 u32type="unsigned long"
14742 *) case "$intsize" in
14744 u32type="unsigned int"
14754 '') set try -DINT32
14755 if eval $compile; then
14756 case "`$run ./try`" in
14768 '') if $test $intsize -ge 4; then
14770 u32type="unsigned int"
14778 '') case "$d_quad:$quadtype" in
14780 i64type="$quadtype"
14781 u64type="$uquadtype"
14789 $echo "Checking how many bits of your UVs your NVs can preserve..." >&4
14790 : volatile so that the compiler has to store it out to memory.
14791 if test X"$d_volatile" = X"$define"; then
14796 #$i_stdlib I_STDLIB
14798 #include <stdlib.h>
14800 #include <sys/types.h>
14801 #include <signal.h>
14803 $volatile int bletched = 0;
14804 $signal_t blech(s) int s; { bletched = 1; }
14809 int n = 8 * $uvsize;
14812 signal(SIGFPE, blech);
14815 for (i = 0; i < n; i++) {
14816 u = u << 1 | ($uvtype)1;
14818 if (($uvtype)d != u)
14822 d = ($nvtype)(u - 1);
14823 if (($uvtype)d != (u - 1))
14831 printf("%d\n", ((i == n) ? -n : i));
14837 d_nv_preserves_uv="$undef"
14838 if eval $compile; then
14839 nv_preserves_uv_bits="`$run ./try`"
14841 case "$nv_preserves_uv_bits" in
14843 nv_preserves_uv_bits=`expr 0 - $nv_preserves_uv_bits`
14844 $echo "Your NVs can preserve all $nv_preserves_uv_bits bits of your UVs." 2>&1
14845 d_nv_preserves_uv="$define"
14847 [1-9]*) $echo "Your NVs can preserve only $nv_preserves_uv_bits bits of your UVs." 2>&1
14848 d_nv_preserves_uv="$undef" ;;
14849 *) $echo "Can't figure out how many bits your NVs preserve." 2>&1
14850 nv_preserves_uv_bits="$undef" ;;
14855 $echo "Checking whether NV 0.0 is all bits zero in memory..." >&4
14856 : volatile so that the compiler has to store it out to memory.
14857 if test X"$d_volatile" = X"$define"; then
14862 #$i_stdlib I_STDLIB
14864 #include <stdlib.h>
14866 #$i_string I_STRING
14868 # include <string.h>
14870 # include <strings.h>
14872 #include <sys/types.h>
14873 #include <signal.h>
14875 $volatile int bletched = 0;
14876 $signal_t blech(s) int s; { bletched = 1; }
14879 int checkit($nvtype d, char *where) {
14880 unsigned char *p = (char *)&d;
14881 unsigned char *end = p + sizeof(d);
14891 printf("No - %s: 0x", where);
14893 printf ("%02X", *p++);
14898 int main(int argc, char **argv) {
14901 fail += checkit(d, "0.0");
14903 /* The compiler shouldn't be assuming that bletched is 0 */
14906 fail += checkit(d, "bleched");
14909 signal(SIGFPE, blech);
14912 /* Paranoia - the compiler should have no way of knowing that ANSI says
14913 that argv[argc] will always be NULL. Actually, if it did assume this it
14914 would be buggy, as this is C and main() can be called from elsewhere in
14916 d = argv[argc] ? 1 : 0;
14919 printf("Odd argv[argc]=%p, d=%g\n", argv[argc], d);
14922 fail += checkit(d, "ternary");
14924 memset(&d, sizeof(d), argv[argc] ? 1 : 0);
14927 printf("No - memset doesn't give 0.0\n");
14928 /* This might just blow up: */
14929 printf("(gives %g)\n", d);
14935 printf("No - something bleched\n");
14940 printf("No - %d fail(s)\n", fail);
14949 d_nv_zero_is_allbits_zero="$undef"
14950 if eval $compile; then
14956 0.0 is represented as all bits zero in memory
14958 d_nv_zero_is_allbits_zero="$define"
14961 0.0 is not represented as all bits zero in memory
14963 d_nv_zero_is_allbits_zero="$undef"
14968 0.0 is not represented as all bits zero in memory
14970 d_nv_zero_is_allbits_zero="$undef"
14978 : check for off64_t
14980 echo "Checking to see if you have off64_t..." >&4
14982 #include <sys/types.h>
14983 #include <unistd.h>
14984 int main() { off64_t x = 7; }
14987 if eval $compile; then
14989 echo "You have off64_t."
14992 echo "You do not have off64_t."
14993 case "$lseeksize" in
14994 8) echo "(Your off_t is 64 bits, so you could use that.)" ;;
15001 : how to create joinable pthreads
15002 if test "X$usethreads" = "X$define" -a "X$i_pthread" = "X$define"; then
15004 echo "Checking what constant to use for creating joinable pthreads..." >&4
15005 $cat >try.c <<'EOCP'
15006 #include <pthread.h>
15008 int detachstate = JOINABLE;
15011 set try -DJOINABLE=PTHREAD_CREATE_JOINABLE
15012 if eval $compile; then
15013 echo "You seem to use PTHREAD_CREATE_JOINABLE." >&4
15014 val="$undef" # Yes, undef.
15015 set d_old_pthread_create_joinable
15018 set old_pthread_create_joinable
15021 set try -DJOINABLE=PTHREAD_CREATE_UNDETACHED
15022 if eval $compile; then
15023 echo "You seem to use PTHREAD_CREATE_UNDETACHED." >&4
15025 set d_old_pthread_create_joinable
15027 val=PTHREAD_CREATE_UNDETACHED
15028 set old_pthread_create_joinable
15031 set try -DJOINABLE=__UNDETACHED
15032 if eval $compile; then
15033 echo "You seem to use __UNDETACHED." >&4
15035 set d_old_pthread_create_joinable
15038 set old_pthread_create_joinable
15041 echo "Egads, nothing obvious found. Guessing that you use 0." >&4
15043 set d_old_pthread_create_joinable
15046 set old_pthread_create_joinable
15053 d_old_pthread_create_joinable="$undef"
15054 old_pthread_create_joinable=""
15057 : see if pause exists
15061 : see if pipe exists
15065 : see if poll exists
15069 : see if readlink exists
15070 set readlink d_readlink
15076 case "$d_readlink" in
15078 if $issymlink /proc/self/exe ; then
15079 $ls -l /proc/self/exe > reflect
15080 if $contains /`basename $ls` reflect >/dev/null 2>&1; then
15081 echo "You have Linux-like /proc/self/exe."
15082 procselfexe='"/proc/self/exe"'
15086 if $issymlink /proc/curproc/file ; then
15087 $ls -l /proc/curproc/file > reflect
15088 if $contains /`basename $ls` reflect >/dev/null 2>&1; then
15089 echo "You have BSD-like /proc/curproc/file."
15090 procselfexe='"/proc/curproc/file"'
15100 : see whether the pthread_atfork exists
15102 #include <pthread.h>
15105 #ifdef PTHREAD_ATFORK
15106 pthread_atfork(NULL,NULL,NULL);
15111 : see if pthread_atfork exists
15112 set try -DPTHREAD_ATFORK
15113 if eval $compile; then
15118 case "$usethreads" in
15121 $define) echo 'pthread_atfork found.' >&4 ;;
15122 *) echo 'pthread_atfork NOT found.' >&4 ;;
15125 set d_pthread_atfork
15128 : see if pthread_attr_setscope exists
15129 set pthread_attr_setscope d_pthread_attr_setscope
15133 : see whether the various POSIXish _yields exist
15135 #include <pthread.h>
15141 #ifdef PTHREAD_YIELD
15144 #ifdef PTHREAD_YIELD_NULL
15145 pthread_yield(NULL);
15151 : see if sched_yield exists
15152 set try -DSCHED_YIELD
15153 if eval $compile; then
15155 sched_yield='sched_yield()'
15159 case "$usethreads" in
15162 $define) echo 'sched_yield() found.' >&4 ;;
15163 *) echo 'sched_yield() NOT found.' >&4 ;;
15169 : see if pthread_yield exists
15170 set try -DPTHREAD_YIELD
15171 if eval $compile; then
15173 case "$sched_yield" in
15174 '') sched_yield='pthread_yield()' ;;
15177 set try -DPTHREAD_YIELD_NULL
15178 if eval $compile; then
15180 case "$sched_yield" in
15181 '') sched_yield='pthread_yield(NULL)' ;;
15187 case "$usethreads" in
15190 $define) echo 'pthread_yield() found.' >&4 ;;
15191 *) echo 'pthread_yield() NOT found.' >&4 ;;
15195 set d_pthread_yield
15198 case "$sched_yield" in
15199 '') sched_yield=undef ;;
15204 : see if random_r exists
15205 set random_r d_random_r
15207 case "$d_random_r" in
15209 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
15210 case "$d_random_r_proto:$usethreads" in
15211 ":define") d_random_r_proto=define
15212 set d_random_r_proto random_r $hdrs
15216 case "$d_random_r_proto" in
15218 case "$random_r_proto" in
15219 ''|0) try='int random_r(int*, struct random_data*);'
15220 ./protochk "extern $try" $hdrs && random_r_proto=I_iS ;;
15222 case "$random_r_proto" in
15223 ''|0) try='int random_r(long*, struct random_data*);'
15224 ./protochk "extern $try" $hdrs && random_r_proto=I_lS ;;
15226 case "$random_r_proto" in
15227 ''|0) try='int random_r(struct random_data*, int32_t*);'
15228 ./protochk "extern $try" $hdrs && random_r_proto=I_St ;;
15230 case "$random_r_proto" in
15231 ''|0) d_random_r=undef
15233 echo "Disabling random_r, cannot determine prototype." >&4 ;;
15234 * ) case "$random_r_proto" in
15235 REENTRANT_PROTO*) ;;
15236 *) random_r_proto="REENTRANT_PROTO_$random_r_proto" ;;
15238 echo "Prototype: $try" ;;
15241 *) case "$usethreads" in
15242 define) echo "random_r has no prototype, not using it." >&4 ;;
15249 *) random_r_proto=0
15253 : see if readdir and friends exist
15254 set readdir d_readdir
15256 set seekdir d_seekdir
15258 set telldir d_telldir
15260 set rewinddir d_rewinddir
15263 : see if readdir64_r exists
15264 set readdir64_r d_readdir64_r
15266 case "$d_readdir64_r" in
15268 hdrs="$i_systypes sys/types.h define stdio.h $i_dirent dirent.h"
15269 case "$d_readdir64_r_proto:$usethreads" in
15270 ":define") d_readdir64_r_proto=define
15271 set d_readdir64_r_proto readdir64_r $hdrs
15275 case "$d_readdir64_r_proto" in
15277 case "$readdir64_r_proto" in
15278 ''|0) try='int readdir64_r(DIR*, struct dirent64*, struct dirent64**);'
15279 ./protochk "extern $try" $hdrs && readdir64_r_proto=I_TSR ;;
15281 case "$readdir64_r_proto" in
15282 ''|0) try='int readdir64_r(DIR*, struct dirent64*);'
15283 ./protochk "extern $try" $hdrs && readdir64_r_proto=I_TS ;;
15285 case "$readdir64_r_proto" in
15286 ''|0) d_readdir64_r=undef
15287 readdir64_r_proto=0
15288 echo "Disabling readdir64_r, cannot determine prototype." >&4 ;;
15289 * ) case "$readdir64_r_proto" in
15290 REENTRANT_PROTO*) ;;
15291 *) readdir64_r_proto="REENTRANT_PROTO_$readdir64_r_proto" ;;
15293 echo "Prototype: $try" ;;
15296 *) case "$usethreads" in
15297 define) echo "readdir64_r has no prototype, not using it." >&4 ;;
15299 d_readdir64_r=undef
15300 readdir64_r_proto=0
15304 *) readdir64_r_proto=0
15308 : see if readdir_r exists
15309 set readdir_r d_readdir_r
15311 case "$d_readdir_r" in
15313 hdrs="$i_systypes sys/types.h define stdio.h $i_dirent dirent.h"
15314 case "$d_readdir_r_proto:$usethreads" in
15315 ":define") d_readdir_r_proto=define
15316 set d_readdir_r_proto readdir_r $hdrs
15320 case "$d_readdir_r_proto" in
15322 case "$readdir_r_proto" in
15323 ''|0) try='int readdir_r(DIR*, struct dirent*, struct dirent**);'
15324 ./protochk "extern $try" $hdrs && readdir_r_proto=I_TSR ;;
15326 case "$readdir_r_proto" in
15327 ''|0) try='int readdir_r(DIR*, struct dirent*);'
15328 ./protochk "extern $try" $hdrs && readdir_r_proto=I_TS ;;
15330 case "$readdir_r_proto" in
15331 ''|0) d_readdir_r=undef
15333 echo "Disabling readdir_r, cannot determine prototype." >&4 ;;
15334 * ) case "$readdir_r_proto" in
15335 REENTRANT_PROTO*) ;;
15336 *) readdir_r_proto="REENTRANT_PROTO_$readdir_r_proto" ;;
15338 echo "Prototype: $try" ;;
15341 *) case "$usethreads" in
15342 define) echo "readdir_r has no prototype, not using it." >&4 ;;
15349 *) readdir_r_proto=0
15353 : see if readv exists
15357 : see if recvmsg exists
15358 set recvmsg d_recvmsg
15361 : see if rename exists
15362 set rename d_rename
15365 : see if rmdir exists
15369 : see if memory.h is available.
15374 : See if it conflicts with string.h
15380 $cppstdin $cppflags $cppminus < $strings > mem.h
15381 if $contains 'memcpy' mem.h >/dev/null 2>&1; then
15383 echo "We won't be including <memory.h>."
15393 : can bcopy handle overlapping blocks?
15396 case "$d_memmove" in
15397 "$define") echo "I'll use memmove() instead of bcopy() for overlapping copies." ;;
15398 *) case "$d_bcopy" in
15400 echo "Checking to see if bcopy() can do overlapping copies..." >&4
15402 #$i_memory I_MEMORY
15403 #$i_stdlib I_STDLIB
15404 #$i_string I_STRING
15405 #$i_unistd I_UNISTD
15407 $cat >>try.c <<'EOCP'
15410 # include <memory.h>
15413 # include <stdlib.h>
15416 # include <string.h>
15418 # include <strings.h>
15421 # include <unistd.h> /* Needed for NetBSD */
15425 char buf[128], abc[128];
15431 /* Copy "abcde..." string to char abc[] so that gcc doesn't
15432 try to store the string in read-only memory. */
15433 bcopy("abcdefghijklmnopqrstuvwxyz0123456789", abc, 36);
15435 for (align = 7; align >= 0; align--) {
15436 for (len = 36; len; len--) {
15438 bcopy(abc, b, len);
15439 for (off = 1; off <= len; off++) {
15440 bcopy(b, b+off, len);
15441 bcopy(b+off, b, len);
15442 if (bcmp(b, abc, len))
15451 if eval $compile_ok; then
15452 if ./try 2>/dev/null; then
15453 echo "Yes, it can."
15456 echo "It can't, sorry."
15459 echo "(I can't compile the test program, so we'll assume not...)"
15463 $rm -f try.* try core
15469 : can memcpy handle overlapping blocks?
15472 case "$d_memmove" in
15473 "$define") echo "I'll use memmove() instead of memcpy() for overlapping copies." ;;
15474 *) case "$d_memcpy" in
15476 echo "Checking to see if memcpy() can do overlapping copies..." >&4
15478 #$i_memory I_MEMORY
15479 #$i_stdlib I_STDLIB
15480 #$i_string I_STRING
15481 #$i_unistd I_UNISTD
15483 $cat >>try.c <<'EOCP'
15486 # include <memory.h>
15489 # include <stdlib.h>
15492 # include <string.h>
15494 # include <strings.h>
15497 # include <unistd.h> /* Needed for NetBSD */
15501 char buf[128], abc[128];
15507 /* Copy "abcde..." string to char abc[] so that gcc doesn't
15508 try to store the string in read-only memory. */
15509 memcpy(abc, "abcdefghijklmnopqrstuvwxyz0123456789", 36);
15511 for (align = 7; align >= 0; align--) {
15512 for (len = 36; len; len--) {
15514 memcpy(b, abc, len);
15515 for (off = 1; off <= len; off++) {
15516 memcpy(b+off, b, len);
15517 memcpy(b, b+off, len);
15518 if (memcmp(b, abc, len))
15527 if eval $compile_ok; then
15528 if ./try 2>/dev/null; then
15529 echo "Yes, it can."
15532 echo "It can't, sorry."
15535 echo "(I can't compile the test program, so we'll assume not...)"
15539 $rm -f try.* try core
15545 : can memcmp be trusted to compare relative magnitude?
15547 case "$d_memcmp" in
15550 echo "Checking if your memcmp() can compare relative magnitude..." >&4
15552 #$i_memory I_MEMORY
15553 #$i_stdlib I_STDLIB
15554 #$i_string I_STRING
15555 #$i_unistd I_UNISTD
15557 $cat >>try.c <<'EOCP'
15560 # include <memory.h>
15563 # include <stdlib.h>
15566 # include <string.h>
15568 # include <strings.h>
15571 # include <unistd.h> /* Needed for NetBSD */
15577 if ((a < b) && memcmp(&a, &b, 1) < 0)
15583 if eval $compile_ok; then
15584 if $run ./try 2>/dev/null; then
15585 echo "Yes, it can."
15588 echo "No, it can't (it uses signed chars)."
15591 echo "(I can't compile the test program, so we'll assume not...)"
15595 $rm -f try.* try core
15599 : see if prototype for sbrk is available
15601 set d_sbrkproto sbrk $i_unistd unistd.h
15604 : see if select exists
15605 set select d_select
15608 : see if semctl exists
15609 set semctl d_semctl
15612 : see if semget exists
15613 set semget d_semget
15616 : see if semop exists
15620 : see how much of the 'sem*(2)' library is present.
15623 case "$d_semctl$d_semget$d_semop" in
15624 *"$undef"*) h_sem=false;;
15628 case "`ipcs 2>&1`" in
15629 "SVID messages"*"not configured"*)
15630 echo "Your $osname does not have the sem*(2) configured." >&4
15633 set semctl d_semctl
15635 set semget d_semget
15643 : we could also check for sys/ipc.h ...
15644 if $h_sem && $test `./findhdr sys/sem.h`; then
15645 echo "You have the full sem*(2) library." >&4
15648 echo "You don't have the full sem*(2) library." >&4
15654 : see whether sys/sem.h defines union semun
15656 $cat > try.c <<'END'
15657 #include <sys/types.h>
15658 #include <sys/ipc.h>
15659 #include <sys/sem.h>
15660 int main () { union semun semun; semun.buf = 0; }
15663 if eval $compile; then
15664 echo "You have union semun in <sys/sem.h>." >&4
15667 echo "You do not have union semun in <sys/sem.h>." >&4
15674 : see how to do semctl IPC_STAT
15681 # define S_IRUSR S_IREAD
15682 # define S_IWUSR S_IWRITE
15683 # define S_IXUSR S_IEXEC
15685 # define S_IRUSR 0400
15686 # define S_IWUSR 0200
15687 # define S_IXUSR 0100
15689 # define S_IRGRP (S_IRUSR>>3)
15690 # define S_IWGRP (S_IWUSR>>3)
15691 # define S_IXGRP (S_IXUSR>>3)
15692 # define S_IROTH (S_IRUSR>>6)
15693 # define S_IWOTH (S_IWUSR>>6)
15694 # define S_IXOTH (S_IXUSR>>6)
15697 # define S_IRWXU (S_IRUSR|S_IWUSR|S_IXUSR)
15698 # define S_IRWXG (S_IRGRP|S_IWGRP|S_IXGRP)
15699 # define S_IRWXO (S_IROTH|S_IWOTH|S_IXOTH)
15702 : see whether semctl IPC_STAT can use union semun
15704 case "$d_semctl_semun" in
15707 #include <sys/types.h>
15708 #include <sys/ipc.h>
15709 #include <sys/sem.h>
15710 #include <sys/stat.h>
15717 #$d_union_semun HAS_UNION_SEMUN
15720 #ifndef HAS_UNION_SEMUN
15723 struct semid_ds *buf;
15724 unsigned short *array;
15730 #if defined(IPC_PRIVATE) && defined(S_IRWXU) && defined(S_IRWXG) && defined(S_IRWXO) && defined(IPC_CREAT)
15731 sem = semget(IPC_PRIVATE, 1, S_IRWXU|S_IRWXG|S_IRWXO|IPC_CREAT);
15733 struct semid_ds argbuf;
15736 st = semctl(sem, 0, IPC_STAT, arg);
15740 # endif /* IPC_STAT */
15741 printf("semctl IPC_STAT failed: errno = %d\n", errno);
15743 if (semctl(sem, 0, IPC_RMID, arg) != 0)
15744 # endif /* IPC_RMID */
15745 printf("semctl IPC_RMID failed: errno = %d\n", errno);
15747 #endif /* IPC_PRIVATE && ... */
15748 printf("semget failed: errno = %d\n", errno);
15753 if eval $compile; then
15756 semun) val="$define" ;;
15764 case "$d_semctl_semun" in
15766 echo "You can use union semun for semctl IPC_STAT." >&4
15769 *) echo "You cannot use union semun for semctl IPC_STAT." >&4
15774 : see whether semctl IPC_STAT can use struct semid_ds pointer
15776 case "$d_semctl_semid_ds" in
15778 $cat > try.c <<'END'
15779 #include <sys/types.h>
15780 #include <sys/ipc.h>
15781 #include <sys/sem.h>
15782 #include <sys/stat.h>
15790 struct semid_ds arg;
15793 #if defined(IPC_PRIVATE) && defined(S_IRWXU) && defined(S_IRWXG) && defined(S_IRWXO) && defined(IPC_CREAT)
15794 sem = semget(IPC_PRIVATE, 1, S_IRWXU|S_IRWXG|S_IRWXO|IPC_CREAT);
15797 st = semctl(sem, 0, IPC_STAT, &arg);
15799 printf("semid_ds\n");
15801 # endif /* IPC_STAT */
15802 printf("semctl IPC_STAT failed: errno = %d\n", errno);
15804 if (semctl(sem, 0, IPC_RMID, &arg) != 0)
15805 # endif /* IPC_RMID */
15806 printf("semctl IPC_RMID failed: errno = %d\n", errno);
15808 #endif /* IPC_PRIVATE && ... */
15809 printf("semget failed: errno = %d\n", errno);
15815 if eval $compile; then
15818 semid_ds) val="$define" ;;
15824 set d_semctl_semid_ds
15826 case "$d_semctl_semid_ds" in
15828 echo "You can $also use struct semid_ds* for semctl IPC_STAT." >&4
15830 *) echo "You cannot use struct semid_ds* for semctl IPC_STAT." >&4
15837 # We do not have the full sem*(2) library, so assume we can not
15843 set d_semctl_semid_ds
15848 : see if sendmsg exists
15849 set sendmsg d_sendmsg
15852 : see if setegid exists
15853 set setegid d_setegid
15856 : see if seteuid exists
15857 set seteuid d_seteuid
15860 : see if setgrent exists
15861 set setgrent d_setgrent
15864 : see if setgrent_r exists
15865 set setgrent_r d_setgrent_r
15867 case "$d_setgrent_r" in
15869 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
15870 case "$d_setgrent_r_proto:$usethreads" in
15871 ":define") d_setgrent_r_proto=define
15872 set d_setgrent_r_proto setgrent_r $hdrs
15876 case "$d_setgrent_r_proto" in
15878 case "$setgrent_r_proto" in
15879 ''|0) try='int setgrent_r(FILE**);'
15880 ./protochk "extern $try" $hdrs && setgrent_r_proto=I_H ;;
15882 case "$setgrent_r_proto" in
15883 ''|0) try='void setgrent_r(FILE**);'
15884 ./protochk "extern $try" $hdrs && setgrent_r_proto=V_H ;;
15886 case "$setgrent_r_proto" in
15887 ''|0) d_setgrent_r=undef
15889 echo "Disabling setgrent_r, cannot determine prototype." >&4 ;;
15890 * ) case "$setgrent_r_proto" in
15891 REENTRANT_PROTO*) ;;
15892 *) setgrent_r_proto="REENTRANT_PROTO_$setgrent_r_proto" ;;
15894 echo "Prototype: $try" ;;
15897 *) case "$usethreads" in
15898 define) echo "setgrent_r has no prototype, not using it." >&4 ;;
15905 *) setgrent_r_proto=0
15909 : see if sethostent exists
15910 set sethostent d_sethent
15913 : see if sethostent_r exists
15914 set sethostent_r d_sethostent_r
15916 case "$d_sethostent_r" in
15918 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
15919 case "$d_sethostent_r_proto:$usethreads" in
15920 ":define") d_sethostent_r_proto=define
15921 set d_sethostent_r_proto sethostent_r $hdrs
15925 case "$d_sethostent_r_proto" in
15927 case "$sethostent_r_proto" in
15928 ''|0) try='int sethostent_r(int, struct hostent_data*);'
15929 ./protochk "extern $try" $hdrs && sethostent_r_proto=I_ID ;;
15931 case "$sethostent_r_proto" in
15932 ''|0) try='void sethostent_r(int, struct hostent_data*);'
15933 ./protochk "extern $try" $hdrs && sethostent_r_proto=V_ID ;;
15935 case "$sethostent_r_proto" in
15936 ''|0) d_sethostent_r=undef
15937 sethostent_r_proto=0
15938 echo "Disabling sethostent_r, cannot determine prototype." >&4 ;;
15939 * ) case "$sethostent_r_proto" in
15940 REENTRANT_PROTO*) ;;
15941 *) sethostent_r_proto="REENTRANT_PROTO_$sethostent_r_proto" ;;
15943 echo "Prototype: $try" ;;
15946 *) case "$usethreads" in
15947 define) echo "sethostent_r has no prototype, not using it." >&4 ;;
15949 d_sethostent_r=undef
15950 sethostent_r_proto=0
15954 *) sethostent_r_proto=0
15958 : see if setitimer exists
15959 set setitimer d_setitimer
15962 : see if setlinebuf exists
15963 set setlinebuf d_setlinebuf
15966 : see if setlocale exists
15967 set setlocale d_setlocale
15970 : see if locale.h is available
15971 set locale.h i_locale
15974 : see if setlocale_r exists
15975 set setlocale_r d_setlocale_r
15977 case "$d_setlocale_r" in
15979 hdrs="$i_systypes sys/types.h define stdio.h $i_locale locale.h"
15980 case "$d_setlocale_r_proto:$usethreads" in
15981 ":define") d_setlocale_r_proto=define
15982 set d_setlocale_r_proto setlocale_r $hdrs
15986 case "$d_setlocale_r_proto" in
15988 case "$setlocale_r_proto" in
15989 ''|0) try='int setlocale_r(int, const char*, char*, int);'
15990 ./protochk "extern $try" $hdrs && setlocale_r_proto=I_ICBI ;;
15992 case "$setlocale_r_proto" in
15993 ''|0) d_setlocale_r=undef
15994 setlocale_r_proto=0
15995 echo "Disabling setlocale_r, cannot determine prototype." >&4 ;;
15996 * ) case "$setlocale_r_proto" in
15997 REENTRANT_PROTO*) ;;
15998 *) setlocale_r_proto="REENTRANT_PROTO_$setlocale_r_proto" ;;
16000 echo "Prototype: $try" ;;
16003 *) case "$usethreads" in
16004 define) echo "setlocale_r has no prototype, not using it." >&4 ;;
16006 d_setlocale_r=undef
16007 setlocale_r_proto=0
16011 *) setlocale_r_proto=0
16015 : see if setnetent exists
16016 set setnetent d_setnent
16019 : see if setnetent_r exists
16020 set setnetent_r d_setnetent_r
16022 case "$d_setnetent_r" in
16024 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
16025 case "$d_setnetent_r_proto:$usethreads" in
16026 ":define") d_setnetent_r_proto=define
16027 set d_setnetent_r_proto setnetent_r $hdrs
16031 case "$d_setnetent_r_proto" in
16033 case "$setnetent_r_proto" in
16034 ''|0) try='int setnetent_r(int, struct netent_data*);'
16035 ./protochk "extern $try" $hdrs && setnetent_r_proto=I_ID ;;
16037 case "$setnetent_r_proto" in
16038 ''|0) try='void setnetent_r(int, struct netent_data*);'
16039 ./protochk "extern $try" $hdrs && setnetent_r_proto=V_ID ;;
16041 case "$setnetent_r_proto" in
16042 ''|0) d_setnetent_r=undef
16043 setnetent_r_proto=0
16044 echo "Disabling setnetent_r, cannot determine prototype." >&4 ;;
16045 * ) case "$setnetent_r_proto" in
16046 REENTRANT_PROTO*) ;;
16047 *) setnetent_r_proto="REENTRANT_PROTO_$setnetent_r_proto" ;;
16049 echo "Prototype: $try" ;;
16052 *) case "$usethreads" in
16053 define) echo "setnetent_r has no prototype, not using it." >&4 ;;
16055 d_setnetent_r=undef
16056 setnetent_r_proto=0
16060 *) setnetent_r_proto=0
16064 : see if setprotoent exists
16065 set setprotoent d_setpent
16068 : see if setpgid exists
16069 set setpgid d_setpgid
16072 : see if setpgrp2 exists
16073 set setpgrp2 d_setpgrp2
16076 : see if setpriority exists
16077 set setpriority d_setprior
16080 : see if setproctitle exists
16081 set setproctitle d_setproctitle
16084 : see if setprotoent_r exists
16085 set setprotoent_r d_setprotoent_r
16087 case "$d_setprotoent_r" in
16089 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
16090 case "$d_setprotoent_r_proto:$usethreads" in
16091 ":define") d_setprotoent_r_proto=define
16092 set d_setprotoent_r_proto setprotoent_r $hdrs
16096 case "$d_setprotoent_r_proto" in
16098 case "$setprotoent_r_proto" in
16099 ''|0) try='int setprotoent_r(int, struct protoent_data*);'
16100 ./protochk "extern $try" $hdrs && setprotoent_r_proto=I_ID ;;
16102 case "$setprotoent_r_proto" in
16103 ''|0) try='void setprotoent_r(int, struct protoent_data*);'
16104 ./protochk "extern $try" $hdrs && setprotoent_r_proto=V_ID ;;
16106 case "$setprotoent_r_proto" in
16107 ''|0) d_setprotoent_r=undef
16108 setprotoent_r_proto=0
16109 echo "Disabling setprotoent_r, cannot determine prototype." >&4 ;;
16110 * ) case "$setprotoent_r_proto" in
16111 REENTRANT_PROTO*) ;;
16112 *) setprotoent_r_proto="REENTRANT_PROTO_$setprotoent_r_proto" ;;
16114 echo "Prototype: $try" ;;
16117 *) case "$usethreads" in
16118 define) echo "setprotoent_r has no prototype, not using it." >&4 ;;
16120 d_setprotoent_r=undef
16121 setprotoent_r_proto=0
16125 *) setprotoent_r_proto=0
16129 : see if setpwent exists
16130 set setpwent d_setpwent
16133 : see if setpwent_r exists
16134 set setpwent_r d_setpwent_r
16136 case "$d_setpwent_r" in
16138 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
16139 case "$d_setpwent_r_proto:$usethreads" in
16140 ":define") d_setpwent_r_proto=define
16141 set d_setpwent_r_proto setpwent_r $hdrs
16145 case "$d_setpwent_r_proto" in
16147 case "$setpwent_r_proto" in
16148 ''|0) try='int setpwent_r(FILE**);'
16149 ./protochk "extern $try" $hdrs && setpwent_r_proto=I_H ;;
16151 case "$setpwent_r_proto" in
16152 ''|0) try='void setpwent_r(FILE**);'
16153 ./protochk "extern $try" $hdrs && setpwent_r_proto=V_H ;;
16155 case "$setpwent_r_proto" in
16156 ''|0) d_setpwent_r=undef
16158 echo "Disabling setpwent_r, cannot determine prototype." >&4 ;;
16159 * ) case "$setpwent_r_proto" in
16160 REENTRANT_PROTO*) ;;
16161 *) setpwent_r_proto="REENTRANT_PROTO_$setpwent_r_proto" ;;
16163 echo "Prototype: $try" ;;
16166 *) case "$usethreads" in
16167 define) echo "setpwent_r has no prototype, not using it." >&4 ;;
16174 *) setpwent_r_proto=0
16178 : see if setregid exists
16179 set setregid d_setregid
16181 set setresgid d_setresgid
16184 : see if setreuid exists
16185 set setreuid d_setreuid
16187 set setresuid d_setresuid
16190 : see if setrgid exists
16191 set setrgid d_setrgid
16194 : see if setruid exists
16195 set setruid d_setruid
16198 : see if setservent exists
16199 set setservent d_setsent
16202 : see if setservent_r exists
16203 set setservent_r d_setservent_r
16205 case "$d_setservent_r" in
16207 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
16208 case "$d_setservent_r_proto:$usethreads" in
16209 ":define") d_setservent_r_proto=define
16210 set d_setservent_r_proto setservent_r $hdrs
16214 case "$d_setservent_r_proto" in
16216 case "$setservent_r_proto" in
16217 ''|0) try='int setservent_r(int, struct servent_data*);'
16218 ./protochk "extern $try" $hdrs && setservent_r_proto=I_ID ;;
16220 case "$setservent_r_proto" in
16221 ''|0) try='void setservent_r(int, struct servent_data*);'
16222 ./protochk "extern $try" $hdrs && setservent_r_proto=V_ID ;;
16224 case "$setservent_r_proto" in
16225 ''|0) d_setservent_r=undef
16226 setservent_r_proto=0
16227 echo "Disabling setservent_r, cannot determine prototype." >&4 ;;
16228 * ) case "$setservent_r_proto" in
16229 REENTRANT_PROTO*) ;;
16230 *) setservent_r_proto="REENTRANT_PROTO_$setservent_r_proto" ;;
16232 echo "Prototype: $try" ;;
16235 *) case "$usethreads" in
16236 define) echo "setservent_r has no prototype, not using it." >&4 ;;
16238 d_setservent_r=undef
16239 setservent_r_proto=0
16243 *) setservent_r_proto=0
16247 : see if setsid exists
16248 set setsid d_setsid
16251 : see if setvbuf exists
16252 set setvbuf d_setvbuf
16255 : see if sfio.h is available
16260 : see if sfio library is available
16271 : Ok, but do we want to use it.
16275 true|$define|[yY]*) dflt='y';;
16278 echo "$package can use the sfio library, but it is experimental."
16279 case "$useperlio" in
16281 echo "For sfio also the PerlIO abstraction layer is needed."
16282 echo "Earlier you said you wouldn't want that."
16285 rp="You seem to have sfio available, do you want to try using it?"
16288 y|Y) echo "Ok, turning on both sfio and PerlIO, then."
16289 useperlio="$define"
16292 *) echo "Ok, avoiding sfio this time. I'll use stdio instead."
16297 *) case "$usesfio" in
16298 true|$define|[yY]*)
16299 echo "Sorry, cannot find sfio on this machine." >&4
16300 echo "Ignoring your setting of usesfio=$usesfio." >&4
16309 $define) usesfio='true';;
16310 *) usesfio='false';;
16314 *) : Remove sfio from list of libraries to use
16317 echo "Removing unneeded -lsfio from library list" >&4
16318 set `echo X $libs | $sed -e 's/-lsfio / /' -e 's/-lsfio$//'`
16321 echo "libs = $libs" >&4
16328 : see if shmctl exists
16329 set shmctl d_shmctl
16332 : see if shmget exists
16333 set shmget d_shmget
16336 : see if shmat exists
16339 : see what shmat returns
16342 $cat >shmat.c <<'END'
16343 #include <sys/shm.h>
16346 if $cc $ccflags -c shmat.c >/dev/null 2>&1; then
16351 echo "and it returns ($shmattype)." >&4
16352 : see if a prototype for shmat is available
16353 xxx=`./findhdr sys/shm.h`
16354 $cppstdin $cppflags $cppminus < $xxx > shmat.c 2>/dev/null
16355 if $contains 'shmat.*(' shmat.c >/dev/null 2>&1; then
16366 set d_shmatprototype
16369 : see if shmdt exists
16373 : see how much of the 'shm*(2)' library is present.
16376 case "$d_shmctl$d_shmget$d_shmat$d_shmdt" in
16377 *"$undef"*) h_shm=false;;
16381 case "`ipcs 2>&1`" in
16382 "SVID shared memory"*"not configured"*)
16383 echo "Your $osname does not have the shm*(2) configured." >&4
16386 set shmctl d_shmctl
16388 set shmget d_shmget
16398 : we could also check for sys/ipc.h ...
16399 if $h_shm && $test `./findhdr sys/shm.h`; then
16400 echo "You have the full shm*(2) library." >&4
16403 echo "You don't have the full shm*(2) library." >&4
16410 : see if we have sigaction
16411 if set sigaction val -f d_sigaction; eval $csym; $val; then
16412 echo 'sigaction() found.' >&4
16415 #include <sys/types.h>
16416 #include <signal.h>
16417 #$i_stdlib I_STDLIB
16419 #include <stdlib.h>
16423 struct sigaction act, oact;
16425 oact.sa_handler = 0;
16426 /* so that act and oact are used */
16427 exit(act.sa_flags == 0 && oact.sa_handler == 0);
16431 if eval $compile_ok; then
16434 echo "But you don't seem to have a useable struct sigaction." >&4
16438 echo 'sigaction NOT found.' >&4
16441 set d_sigaction; eval $setvar
16442 $rm -f try try$_o try.c
16444 : see if sigprocmask exists
16445 set sigprocmask d_sigprocmask
16448 : see if sigsetjmp exists
16450 case "$d_sigsetjmp" in
16453 #include <setjmp.h>
16454 #$i_stdlib I_STDLIB
16456 #include <stdlib.h>
16462 if (sigsetjmp(env,1))
16465 siglongjmp(env, 1);
16470 if eval $compile; then
16471 if $run ./try >/dev/null 2>&1; then
16472 echo "POSIX sigsetjmp found." >&4
16476 Uh-Oh! You have POSIX sigsetjmp and siglongjmp, but they do not work properly!!
16482 echo "sigsetjmp not found." >&4
16486 *) val="$d_sigsetjmp"
16487 case "$d_sigsetjmp" in
16488 $define) echo "POSIX sigsetjmp found." >&4;;
16489 $undef) echo "sigsetjmp not found." >&4;;
16497 : see if sockatmark exists
16498 set sockatmark d_sockatmark
16501 : see if prototype for sockatmark is available
16503 set d_sockatmarkproto sockatmark $d_socket sys/socket.h
16506 : see if socks5_init exists
16507 set socks5_init d_socks5_init
16510 : see if srand48_r exists
16511 set srand48_r d_srand48_r
16513 case "$d_srand48_r" in
16515 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
16516 case "$d_srand48_r_proto:$usethreads" in
16517 ":define") d_srand48_r_proto=define
16518 set d_srand48_r_proto srand48_r $hdrs
16522 case "$d_srand48_r_proto" in
16524 case "$srand48_r_proto" in
16525 ''|0) try='int srand48_r(long, struct drand48_data*);'
16526 ./protochk "extern $try" $hdrs && srand48_r_proto=I_LS ;;
16528 case "$srand48_r_proto" in
16529 ''|0) d_srand48_r=undef
16531 echo "Disabling srand48_r, cannot determine prototype." >&4 ;;
16532 * ) case "$srand48_r_proto" in
16533 REENTRANT_PROTO*) ;;
16534 *) srand48_r_proto="REENTRANT_PROTO_$srand48_r_proto" ;;
16536 echo "Prototype: $try" ;;
16539 *) case "$usethreads" in
16540 define) echo "srand48_r has no prototype, not using it." >&4 ;;
16547 *) srand48_r_proto=0
16551 : see if srandom_r exists
16552 set srandom_r d_srandom_r
16554 case "$d_srandom_r" in
16556 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
16557 case "$d_srandom_r_proto:$usethreads" in
16558 ":define") d_srandom_r_proto=define
16559 set d_srandom_r_proto srandom_r $hdrs
16563 case "$d_srandom_r_proto" in
16565 case "$srandom_r_proto" in
16566 ''|0) try='int srandom_r(unsigned int, struct random_data*);'
16567 ./protochk "extern $try" $hdrs && srandom_r_proto=I_TS ;;
16569 case "$srandom_r_proto" in
16570 ''|0) d_srandom_r=undef
16572 echo "Disabling srandom_r, cannot determine prototype." >&4 ;;
16573 * ) case "$srandom_r_proto" in
16574 REENTRANT_PROTO*) ;;
16575 *) srandom_r_proto="REENTRANT_PROTO_$srandom_r_proto" ;;
16577 echo "Prototype: $try" ;;
16580 *) case "$usethreads" in
16581 define) echo "srandom_r has no prototype, not using it." >&4 ;;
16588 *) srandom_r_proto=0
16592 : see if prototype for setresgid is available
16594 set d_sresgproto setresgid $i_unistd unistd.h
16597 : see if prototype for setresuid is available
16599 set d_sresuproto setresuid $i_unistd unistd.h
16602 : see if sys/stat.h is available
16603 set sys/stat.h i_sysstat
16607 : see if stat knows about block sizes
16609 echo "Checking to see if your struct stat has st_blocks field..." >&4
16610 set d_statblks stat st_blocks $i_sysstat sys/stat.h
16614 : see if this is a sys/vfs.h system
16615 set sys/vfs.h i_sysvfs
16619 : see if this is a sys/statfs.h system
16620 set sys/statfs.h i_sysstatfs
16625 echo "Checking to see if your system supports struct statfs..." >&4
16626 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
16628 case "$d_statfs_s" in
16629 "$define") echo "Yes, it does." ;;
16630 *) echo "No, it doesn't." ;;
16635 : see if struct statfs knows about f_flags
16636 case "$d_statfs_s" in
16639 echo "Checking to see if your struct statfs has f_flags field..." >&4
16640 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
16644 set d_statfs_f_flags
16648 case "$d_statfs_f_flags" in
16649 "$define") echo "Yes, it does." ;;
16650 *) echo "No, it doesn't." ;;
16654 Checking how to access stdio streams by file descriptor number...
16656 case "$stdio_stream_array" in
16657 '') $cat >try.c <<EOCP
16660 if (&STDIO_STREAM_ARRAY[fileno(stdin)] == stdin)
16664 for s in _iob __iob __sF
16666 set try -DSTDIO_STREAM_ARRAY=$s
16667 if eval $compile; then
16668 case "`$run ./try`" in
16669 yes) stdio_stream_array=$s; break ;;
16673 $rm -f try.* try$exe_ext
16675 case "$stdio_stream_array" in
16677 I can't figure out how to access stdio streams by file descriptor number.
16679 d_stdio_stream_array="$undef"
16682 You can access stdio streams by file descriptor number by the $stdio_stream_array array.
16684 d_stdio_stream_array="$define"
16688 : see if strcoll exists
16689 set strcoll d_strcoll
16692 : check for structure copying
16694 echo "Checking to see if your C compiler can copy structs..." >&4
16695 $cat >try.c <<'EOCP'
16705 if $cc -c try.c >/dev/null 2>&1 ; then
16707 echo "Yup, it can."
16710 echo "Nope, it can't."
16716 : see if strerror and/or sys_errlist[] exist
16718 if test "X$d_strerror" = X -o "X$d_syserrlst" = X; then
16719 if set strerror val -f d_strerror; eval $csym; $val; then
16720 echo 'strerror() found.' >&4
16721 d_strerror="$define"
16722 d_strerrm='strerror(e)'
16723 if set sys_errlist val -a d_syserrlst; eval $csym; $val; then
16724 echo "(You also have sys_errlist[], so we could roll our own strerror.)"
16725 d_syserrlst="$define"
16727 echo "(Since you don't have sys_errlist[], sterror() is welcome.)"
16728 d_syserrlst="$undef"
16730 elif xxx=`./findhdr string.h`; test "$xxx" || xxx=`./findhdr strings.h`; \
16731 $contains '#[ ]*define.*strerror' "$xxx" >/dev/null 2>&1; then
16732 echo 'strerror() found in string header.' >&4
16733 d_strerror="$define"
16734 d_strerrm='strerror(e)'
16735 if set sys_errlist val -a d_syserrlst; eval $csym; $val; then
16736 echo "(Most probably, strerror() uses sys_errlist[] for descriptions.)"
16737 d_syserrlst="$define"
16739 echo "(You don't appear to have any sys_errlist[], how can this be?)"
16740 d_syserrlst="$undef"
16742 elif set sys_errlist val -a d_syserrlst; eval $csym; $val; then
16743 echo "strerror() not found, but you have sys_errlist[] so we'll use that." >&4
16744 d_strerror="$undef"
16745 d_syserrlst="$define"
16746 d_strerrm='((e)<0||(e)>=sys_nerr?"unknown":sys_errlist[e])'
16748 echo 'strerror() and sys_errlist[] NOT found.' >&4
16749 d_strerror="$undef"
16750 d_syserrlst="$undef"
16751 d_strerrm='"unknown"'
16755 : see if strerror_r exists
16756 set strerror_r d_strerror_r
16758 case "$d_strerror_r" in
16760 hdrs="$i_systypes sys/types.h define stdio.h $i_string string.h"
16761 case "$d_strerror_r_proto:$usethreads" in
16762 ":define") d_strerror_r_proto=define
16763 set d_strerror_r_proto strerror_r $hdrs
16767 case "$d_strerror_r_proto" in
16769 case "$strerror_r_proto" in
16770 ''|0) try='int strerror_r(int, char*, size_t);'
16771 ./protochk "extern $try" $hdrs && strerror_r_proto=I_IBW ;;
16773 case "$strerror_r_proto" in
16774 ''|0) try='int strerror_r(int, char*, int);'
16775 ./protochk "extern $try" $hdrs && strerror_r_proto=I_IBI ;;
16777 case "$strerror_r_proto" in
16778 ''|0) try='char* strerror_r(int, char*, size_t);'
16779 ./protochk "extern $try" $hdrs && strerror_r_proto=B_IBW ;;
16781 case "$strerror_r_proto" in
16782 ''|0) d_strerror_r=undef
16784 echo "Disabling strerror_r, cannot determine prototype." >&4 ;;
16785 * ) case "$strerror_r_proto" in
16786 REENTRANT_PROTO*) ;;
16787 *) strerror_r_proto="REENTRANT_PROTO_$strerror_r_proto" ;;
16789 echo "Prototype: $try" ;;
16792 *) case "$usethreads" in
16793 define) echo "strerror_r has no prototype, not using it." >&4 ;;
16800 *) strerror_r_proto=0
16804 : see if strftime exists
16805 set strftime d_strftime
16808 : see if strlcat exists
16809 set strlcat d_strlcat
16812 : see if strlcpy exists
16813 set strlcpy d_strlcpy
16816 : see if strtod exists
16817 set strtod d_strtod
16820 : see if strtol exists
16821 set strtol d_strtol
16824 : see if strtold exists
16825 set strtold d_strtold
16828 : see if strtoll exists
16829 set strtoll d_strtoll
16832 case "$d_longlong-$d_strtoll" in
16835 Checking whether your strtoll() works okay...
16837 $cat >try.c <<'EOCP'
16840 #define strtoll __strtoll
16843 #define strtoll _strtoll
16846 extern long long int strtoll(char *s, char **, int);
16847 static int bad = 0;
16848 int check(char *s, long long ell, int een) {
16851 gll = strtoll(s, 0, 10);
16852 if (!((gll == ell) && (errno == een)))
16856 check(" 1", 1LL, 0);
16857 check(" 0", 0LL, 0);
16858 check("-1", -1LL, 0);
16859 check("-9223372036854775808", -9223372036854775808LL, 0);
16860 check("-9223372036854775808", -9223372036854775808LL, 0);
16861 check(" 9223372036854775807", 9223372036854775807LL, 0);
16862 check("-9223372036854775808", -9223372036854775808LL, 0);
16863 check(" 9223372036854775808", 9223372036854775807LL, ERANGE);
16864 check("-9223372036854775809", -9223372036854775808LL, ERANGE);
16870 if eval $compile; then
16873 ok) echo "Your strtoll() seems to be working okay." ;;
16875 Your strtoll() doesn't seem to be working okay.
16881 echo "(I can't seem to compile the test program--assuming it doesn't)"
16887 : see if strtoq exists
16888 set strtoq d_strtoq
16891 : see if strtoul exists
16892 set strtoul d_strtoul
16895 case "$d_strtoul" in
16898 Checking whether your strtoul() works okay...
16900 $cat >try.c <<'EOCP'
16903 extern unsigned long int strtoul(char *s, char **, int);
16904 static int bad = 0;
16905 void check(char *s, unsigned long eul, int een) {
16908 gul = strtoul(s, 0, 10);
16909 if (!((gul == eul) && (errno == een)))
16913 check(" 1", 1L, 0);
16914 check(" 0", 0L, 0);
16916 case "$longsize" in
16918 $cat >>try.c <<'EOCP'
16919 check("18446744073709551615", 18446744073709551615UL, 0);
16920 check("18446744073709551616", 18446744073709551615UL, ERANGE);
16921 #if 0 /* strtoul() for /^-/ strings is undefined. */
16922 check("-1", 18446744073709551615UL, 0);
16923 check("-18446744073709551614", 2, 0);
16924 check("-18446744073709551615", 1, 0);
16925 check("-18446744073709551616", 18446744073709551615UL, ERANGE);
16926 check("-18446744073709551617", 18446744073709551615UL, ERANGE);
16931 $cat >>try.c <<'EOCP'
16932 check("4294967295", 4294967295UL, 0);
16933 check("4294967296", 4294967295UL, ERANGE);
16934 #if 0 /* strtoul() for /^-/ strings is undefined. */
16935 check("-1", 4294967295UL, 0);
16936 check("-4294967294", 2, 0);
16937 check("-4294967295", 1, 0);
16938 check("-4294967296", 4294967295UL, ERANGE);
16939 check("-4294967297", 4294967295UL, ERANGE);
16944 : Should we write these tests to be more portable by sprintf-ing
16945 : ~0 and then manipulating that char string as input for strtol?
16948 $cat >>try.c <<'EOCP'
16955 if eval $compile; then
16956 case "`$run ./try`" in
16957 ok) echo "Your strtoul() seems to be working okay." ;;
16959 Your strtoul() doesn't seem to be working okay.
16968 : see if strtoull exists
16969 set strtoull d_strtoull
16972 case "$d_longlong-$d_strtoull" in
16975 Checking whether your strtoull() works okay...
16977 $cat >try.c <<'EOCP'
16980 #define strtoull __strtoull
16983 extern unsigned long long int strtoull(char *s, char **, int);
16984 static int bad = 0;
16985 int check(char *s, long long eull, int een) {
16988 gull = strtoull(s, 0, 10);
16989 if (!((gull == eull) && (errno == een)))
16993 check(" 1", 1LL, 0);
16994 check(" 0", 0LL, 0);
16995 check("18446744073709551615", 18446744073709551615ULL, 0);
16996 check("18446744073709551616", 18446744073709551615ULL, ERANGE);
16997 #if 0 /* strtoull() for /^-/ strings is undefined. */
16998 check("-1", 18446744073709551615ULL, 0);
16999 check("-18446744073709551614", 2LL, 0);
17000 check("-18446744073709551615", 1LL, 0);
17001 check("-18446744073709551616", 18446744073709551615ULL, ERANGE);
17002 check("-18446744073709551617", 18446744073709551615ULL, ERANGE);
17009 if eval $compile; then
17010 case "`$run ./try`" in
17011 ok) echo "Your strtoull() seems to be working okay." ;;
17013 Your strtoull() doesn't seem to be working okay.
17015 d_strtoull="$undef"
17022 : see if strtouq exists
17023 set strtouq d_strtouq
17026 case "$d_strtouq" in
17029 Checking whether your strtouq() works okay...
17031 $cat >try.c <<'EOCP'
17034 extern unsigned long long int strtouq(char *s, char **, int);
17035 static int bad = 0;
17036 void check(char *s, unsigned long long eull, int een) {
17037 unsigned long long gull;
17039 gull = strtouq(s, 0, 10);
17040 if (!((gull == eull) && (errno == een)))
17044 check(" 1", 1LL, 0);
17045 check(" 0", 0LL, 0);
17046 check("18446744073709551615", 18446744073709551615ULL, 0);
17047 check("18446744073709551616", 18446744073709551615ULL, ERANGE);
17048 #if 0 /* strtouq() for /^-/ strings is undefined. */
17049 check("-1", 18446744073709551615ULL, 0);
17050 check("-18446744073709551614", 2LL, 0);
17051 check("-18446744073709551615", 1LL, 0);
17052 check("-18446744073709551616", 18446744073709551615ULL, ERANGE);
17053 check("-18446744073709551617", 18446744073709551615ULL, ERANGE);
17061 if eval $compile; then
17062 case "`$run ./try`" in
17063 ok) echo "Your strtouq() seems to be working okay." ;;
17065 Your strtouq() doesn't seem to be working okay.
17074 : see if strxfrm exists
17075 set strxfrm d_strxfrm
17078 : see if symlink exists
17079 set symlink d_symlink
17082 : see if syscall exists
17083 set syscall d_syscall
17086 : see if prototype for syscall is available
17088 set d_syscallproto syscall $i_unistd unistd.h
17091 : see if sysconf exists
17092 set sysconf d_sysconf
17095 : see if system exists
17096 set system d_system
17099 : see if tcgetpgrp exists
17100 set tcgetpgrp d_tcgetpgrp
17103 : see if tcsetpgrp exists
17104 set tcsetpgrp d_tcsetpgrp
17107 : see if prototype for telldir is available
17109 set d_telldirproto telldir $i_systypes sys/types.h $i_dirent dirent.h
17112 : see if time exists
17114 if test "X$d_time" = X -o X"$timetype" = X; then
17115 if set time val -f d_time; eval $csym; $val; then
17116 echo 'time() found.' >&4
17118 rp="What is the type returned by time() on this system?"
17119 set time_t timetype long stdio.h sys/types.h
17122 echo 'time() not found, hope that will do.' >&4
17130 : see if this is a sys/times.h system
17131 set sys/times.h i_systimes
17134 : see if times exists
17136 if set times val -f d_times; eval $csym; $val; then
17137 echo 'times() found.' >&4
17140 case "$i_systimes" in
17141 "$define") inc='sys/times.h';;
17143 rp="What is the type returned by times() on this system?"
17144 set clock_t clocktype long stdio.h sys/types.h $inc
17147 echo 'times() NOT found, hope that will do.' >&4
17152 : see if tmpnam_r exists
17153 set tmpnam_r d_tmpnam_r
17155 case "$d_tmpnam_r" in
17157 hdrs="$i_systypes sys/types.h define stdio.h "
17158 case "$d_tmpnam_r_proto:$usethreads" in
17159 ":define") d_tmpnam_r_proto=define
17160 set d_tmpnam_r_proto tmpnam_r $hdrs
17164 case "$d_tmpnam_r_proto" in
17166 case "$tmpnam_r_proto" in
17167 ''|0) try='char* tmpnam_r(char*);'
17168 ./protochk "extern $try" $hdrs && tmpnam_r_proto=B_B ;;
17170 case "$tmpnam_r_proto" in
17171 ''|0) d_tmpnam_r=undef
17173 echo "Disabling tmpnam_r, cannot determine prototype." >&4 ;;
17174 * ) case "$tmpnam_r_proto" in
17175 REENTRANT_PROTO*) ;;
17176 *) tmpnam_r_proto="REENTRANT_PROTO_$tmpnam_r_proto" ;;
17178 echo "Prototype: $try" ;;
17181 *) case "$usethreads" in
17182 define) echo "tmpnam_r has no prototype, not using it." >&4 ;;
17189 *) tmpnam_r_proto=0
17193 : see if truncate exists
17194 set truncate d_truncate
17197 : see if ttyname_r exists
17198 set ttyname_r d_ttyname_r
17200 case "$d_ttyname_r" in
17202 hdrs="$i_systypes sys/types.h define stdio.h $i_unistd unistd.h"
17203 case "$d_ttyname_r_proto:$usethreads" in
17204 ":define") d_ttyname_r_proto=define
17205 set d_ttyname_r_proto ttyname_r $hdrs
17209 case "$d_ttyname_r_proto" in
17211 case "$ttyname_r_proto" in
17212 ''|0) try='int ttyname_r(int, char*, size_t);'
17213 ./protochk "extern $try" $hdrs && ttyname_r_proto=I_IBW ;;
17215 case "$ttyname_r_proto" in
17216 ''|0) try='int ttyname_r(int, char*, int);'
17217 ./protochk "extern $try" $hdrs && ttyname_r_proto=I_IBI ;;
17219 case "$ttyname_r_proto" in
17220 ''|0) try='char* ttyname_r(int, char*, int);'
17221 ./protochk "extern $try" $hdrs && ttyname_r_proto=B_IBI ;;
17223 case "$ttyname_r_proto" in
17224 ''|0) d_ttyname_r=undef
17226 echo "Disabling ttyname_r, cannot determine prototype." >&4 ;;
17227 * ) case "$ttyname_r_proto" in
17228 REENTRANT_PROTO*) ;;
17229 *) ttyname_r_proto="REENTRANT_PROTO_$ttyname_r_proto" ;;
17231 echo "Prototype: $try" ;;
17234 *) case "$usethreads" in
17235 define) echo "ttyname_r has no prototype, not using it." >&4 ;;
17242 *) ttyname_r_proto=0
17246 : see if tzname[] exists
17248 if set tzname val -a d_tzname; eval $csym; $val; then
17250 echo 'tzname[] found.' >&4
17253 echo 'tzname[] NOT found.' >&4
17259 next|rhapsody|darwin) multiarch="$define" ;;
17261 case "$multiarch" in
17262 ''|[nN]*) multiarch="$undef" ;;
17265 : check for ordering of bytes in a UV
17267 case "$usecrosscompile$multiarch" in
17270 You seem to be either cross-compiling or doing a multiarchitecture build,
17271 skipping the byteorder check.
17277 case "$byteorder" in
17280 In the following, larger digits indicate more significance. A big-endian
17281 machine like a Pyramid or a Motorola 680?0 chip will come out to 4321. A
17282 little-endian machine like a Vax or an Intel 80?86 chip would be 1234. Other
17283 machines may have weird orders like 3412. A Cray will report 87654321,
17284 an Alpha will report 12345678. If the test program works the default is
17286 I'm now running the test program...
17290 #$i_stdlib I_STDLIB
17292 #include <stdlib.h>
17294 #include <sys/types.h>
17295 typedef $uvtype UV;
17305 u.l = (((UV)0x08070605) << 32) | (UV)0x04030201;
17307 u.l = (UV)0x04030201;
17308 for (i = 0; i < $uvsize; i++)
17309 printf("%c", u.c[i]+'0');
17316 if eval $compile && ./try > /dev/null; then
17319 [1-4][1-4][1-4][1-4]|12345678|87654321)
17320 echo "(The test program ran ok.)"
17321 echo "byteorder=$dflt"
17324 ????|????????) echo "(The test program ran ok.)" ;;
17325 *) echo "(The test program didn't run right for some reason.)" ;;
17330 (I can't seem to compile the test program. Guessing big-endian...)
17333 case "$xxx_prompt" in
17335 rp="What is the order of bytes in $uvtype?"
17351 Checking to see whether you can access character data unalignedly...
17353 case "$d_u32align" in
17354 '') $cat >try.c <<EOCP
17356 #$i_stdlib I_STDLIB
17358 #include <stdlib.h>
17360 #define U32 $u32type
17361 #define BYTEORDER 0x$byteorder
17363 #include <signal.h>
17365 $signal_t bletch(s) int s; { exit(4); }
17368 #if BYTEORDER == 0x1234 || BYTEORDER == 0x4321
17373 if (sizeof(U32) != 4) {
17374 printf("sizeof(U32) is not 4, but %d\n", sizeof(U32));
17381 signal(SIGBUS, bletch);
17393 for (i = 0; i < 4; i++) {
17394 up = (U32*)(buf + i);
17395 if (! ((*up == 1 << (8*i)) || /* big-endian */
17396 (*up == 1 << (8*(3-i))) /* little-endian */
17400 printf("read failed (%x)\n", *up);
17406 for (i = 0; i < 4; i++) {
17407 up = (U32*)(buf + i);
17409 if (*up != 0xBeef) {
17410 printf("write failed (%x)\n", *up);
17424 if eval $compile_ok; then
17425 echo "(Testing for character data alignment may crash the test. That's okay.)" >&4
17426 $run ./try 2>&1 >/dev/null
17429 You can access character data pretty unalignedly.
17431 d_u32align="$undef"
17434 It seems that you must access character data in an aligned manner.
17436 d_u32align="$define"
17440 rp='Can you access character data at unaligned addresses?'
17444 [yY]*) d_u32align="$undef" ;;
17445 *) d_u32align="$define" ;;
17448 $rm -f core core.try.* try.core
17452 : see if ualarm exists
17453 set ualarm d_ualarm
17456 : see if umask exists
17460 : see if unordered exists
17461 set unordered d_unordered
17464 : see if unsetenv exists
17465 set unsetenv d_unsetenv
17468 : see if usleep exists
17469 set usleep d_usleep
17472 : see if prototype for usleep is available
17474 set d_usleepproto usleep $i_unistd unistd.h
17477 : see if ustat exists
17481 : backward compatibility for d_hvfork
17482 if test X$d_hvfork != X; then
17483 d_vfork="$d_hvfork"
17486 : see if there is a vfork
17491 : Ok, but do we want to use it. vfork is reportedly unreliable in
17492 : perl on Solaris 2.x, and probably elsewhere.
17496 case "$usevfork" in
17502 Perl can only use a vfork() that doesn't suffer from strict
17503 restrictions on calling functions or modifying global data in
17504 the child. For example, glibc-2.1 contains such a vfork()
17505 that is unsuitable. If your system provides a proper fork()
17506 call, chances are that you do NOT want perl to use vfork().
17509 rp="Do you still want to use vfork()?"
17514 echo "Ok, we won't use vfork()."
17523 $define) usevfork='true';;
17524 *) usevfork='false';;
17527 : see if closedir exists
17528 set closedir d_closedir
17531 case "$d_closedir" in
17534 echo "Checking whether closedir() returns a status..." >&4
17536 #$i_dirent I_DIRENT /**/
17537 #$i_sysdir I_SYS_DIR /**/
17538 #$i_sysndir I_SYS_NDIR /**/
17539 #$i_systypes I_SYS_TYPES /**/
17541 #if defined(I_SYS_TYPES)
17542 #include <sys/types.h>
17544 #if defined(I_DIRENT)
17545 #include <dirent.h>
17546 #if defined(NeXT) && defined(I_SYS_DIR) /* NeXT needs dirent + sys/dir.h */
17547 #include <sys/dir.h>
17551 #include <sys/ndir.h>
17555 #include <ndir.h> /* may be wrong in the future */
17557 #include <sys/dir.h>
17562 int main() { return closedir(opendir(".")); }
17565 if eval $compile_ok; then
17566 if $run ./try > /dev/null 2>&1 ; then
17567 echo "Yes, it does."
17570 echo "No, it doesn't."
17574 echo "(I can't seem to compile the test program--assuming it doesn't)"
17582 set d_void_closedir
17585 : see if there is a wait4
17589 : see if waitpid exists
17590 set waitpid d_waitpid
17593 : see if wcstombs exists
17594 set wcstombs d_wcstombs
17597 : see if wctomb exists
17598 set wctomb d_wctomb
17601 : see if writev exists
17602 set writev d_writev
17605 : preserve RCS keywords in files with variable substitution, grrr
17610 Revision='$Revision'
17612 : check for alignment requirements
17614 case "$usecrosscompile$multiarch" in
17617 You seem to be either cross-compiling or doing a multiarchitecture build,
17618 skipping the memory alignment check.
17621 case "$alignbytes" in
17622 '') alignbytes=8 ;;
17626 case "$alignbytes" in
17627 '') echo "Checking alignment constraints..." >&4
17628 if $test "X$uselongdouble" = Xdefine -a "X$d_longdbl" = Xdefine; then
17629 $cat >try.c <<'EOCP'
17630 typedef long double NV;
17633 $cat >try.c <<'EOCP'
17637 $cat >>try.c <<'EOCP'
17645 printf("%d\n", (int)((char *)&try_algn.bar - (char *)&try_algn.foo));
17650 if eval $compile_ok; then
17654 echo "(I can't seem to compile the test program...)"
17657 *) dflt="$alignbytes"
17660 rp="Doubles must be aligned on a how-many-byte boundary?"
17668 : set the base revision
17671 : how do we concatenate cpp tokens here?
17673 echo "Checking to see how your cpp does stuff like concatenate tokens..." >&4
17674 $cat >cpp_stuff.c <<'EOCP'
17675 #define RCAT(a,b)a/**/b
17676 #define ACAT(a,b)a ## b
17680 $cppstdin $cppflags $cppminus <cpp_stuff.c >cpp_stuff.out 2>&1
17681 if $contains 'Circus' cpp_stuff.out >/dev/null 2>&1; then
17682 echo "Oh! Smells like ANSI's been here." >&4
17683 echo "We can catify or stringify, separately or together!"
17685 elif $contains 'Reiser' cpp_stuff.out >/dev/null 2>&1; then
17686 echo "Ah, yes! The good old days!" >&4
17687 echo "However, in the good old days we don't know how to stringify and"
17688 echo "catify at the same time."
17692 Hmm, I don't seem to be able to concatenate tokens with your cpp.
17693 You're going to have to edit the values of CAT[2-5] in config.h...
17695 cpp_stuff="/* Help! How do we handle cpp_stuff? */*/"
17699 : see if this is a db.h system
17705 : Check db version.
17707 echo "Checking Berkeley DB version ..." >&4
17713 #include <sys/types.h>
17715 #$i_stdlib I_STDLIB
17717 #include <stdlib.h>
17720 int main(int argc, char *argv[])
17722 #ifdef DB_VERSION_MAJOR /* DB version >= 2 */
17723 int Major, Minor, Patch ;
17724 unsigned long Version ;
17725 (void)db_version(&Major, &Minor, &Patch) ;
17727 printf("%d %d %d %d %d %d\n",
17728 DB_VERSION_MAJOR, DB_VERSION_MINOR, DB_VERSION_PATCH,
17729 Major, Minor, Patch);
17732 printf("You have Berkeley DB Version 2 or greater.\n");
17734 printf("db.h is from Berkeley DB Version %d.%d.%d\n",
17735 DB_VERSION_MAJOR, DB_VERSION_MINOR, DB_VERSION_PATCH);
17736 printf("libdb is from Berkeley DB Version %d.%d.%d\n",
17737 Major, Minor, Patch) ;
17739 /* check that db.h & libdb are compatible */
17740 if (DB_VERSION_MAJOR != Major || DB_VERSION_MINOR != Minor || DB_VERSION_PATCH != Patch) {
17741 printf("db.h and libdb are incompatible.\n") ;
17745 printf("db.h and libdb are compatible.\n") ;
17747 Version = DB_VERSION_MAJOR * 1000000 + DB_VERSION_MINOR * 1000
17748 + DB_VERSION_PATCH ;
17750 /* needs to be >= 2.3.4 */
17751 if (Version < 2003004) {
17752 /* if (DB_VERSION_MAJOR == 2 && DB_VERSION_MINOR == 0 && DB_VERSION_PATCH < 5) { */
17753 printf("Perl needs Berkeley DB 2.3.4 or greater.\n") ;
17759 #if defined(_DB_H_) && defined(BTREEMAGIC) && defined(HASHMAGIC)
17764 printf("You have Berkeley DB Version 1.\n");
17765 exit(0); /* DB version < 2: the coast is clear. */
17767 exit(1); /* <db.h> not Berkeley DB? */
17773 if eval $compile_ok && $run ./try; then
17774 echo 'Looks OK.' >&4
17776 db_version_major=$1
17777 db_version_minor=$2
17778 db_version_patch=$3
17780 echo "I can't use Berkeley DB with your <db.h>. I'll disable Berkeley DB." >&4
17784 : Remove db from list of libraries to use
17785 echo "Removing unusable -ldb from library list" >&4
17786 set `echo X $libs | $sed -e 's/-ldb / /' -e 's/-ldb$//'`
17789 echo "libs = $libs" >&4
17799 : Check the return type needed for hash
17801 echo "Checking return type needed for hash for Berkeley DB ..." >&4
17807 #include <sys/types.h>
17810 #ifndef DB_VERSION_MAJOR
17811 u_int32_t hash_cb (ptr, size)
17819 info.hash = hash_cb;
17823 if $cc $ccflags -c try.c >try.out 2>&1 ; then
17824 if $contains warning try.out >>/dev/null 2>&1 ; then
17827 db_hashtype='u_int32_t'
17830 : XXX Maybe we should just give up here.
17831 db_hashtype=u_int32_t
17833 echo "Help: I can't seem to compile the db test program." >&4
17834 echo "Something's wrong, but I'll assume you use $db_hashtype." >&4
17837 echo "Your version of Berkeley DB uses $db_hashtype for hash."
17839 *) db_hashtype=u_int32_t
17844 : Check the return type needed for prefix
17846 echo "Checking return type needed for prefix for Berkeley DB ..." >&4
17852 #include <sys/types.h>
17855 #ifndef DB_VERSION_MAJOR
17856 size_t prefix_cb (key1, key2)
17864 info.prefix = prefix_cb;
17868 if $cc $ccflags -c try.c >try.out 2>&1 ; then
17869 if $contains warning try.out >>/dev/null 2>&1 ; then
17870 db_prefixtype='int'
17872 db_prefixtype='size_t'
17875 db_prefixtype='size_t'
17876 : XXX Maybe we should just give up here.
17878 echo "Help: I can't seem to compile the db test program." >&4
17879 echo "Something's wrong, but I'll assume you use $db_prefixtype." >&4
17882 echo "Your version of Berkeley DB uses $db_prefixtype for prefix."
17884 *) db_prefixtype='size_t'
17889 : How can we generate normalized random numbers ?
17891 echo "Looking for a random number function..." >&4
17892 case "$randfunc" in
17894 if set drand48 val -f; eval $csym; $val; then
17896 echo "Good, found drand48()." >&4
17897 elif set random val -f; eval $csym; $val; then
17899 echo "OK, found random()." >&4
17902 echo "Yick, looks like I have to use rand()." >&4
17913 *-Dmy_rand=*|*-Dmy_srand=*)
17914 echo "Removing obsolete -Dmy_rand, -Dmy_srand, and -Drandbits from ccflags." >&4
17915 ccflags="`echo $ccflags | sed -e 's/-Dmy_rand=random/ /'`"
17916 ccflags="`echo $ccflags | sed -e 's/-Dmy_srand=srandom/ /'`"
17917 ccflags="`echo $ccflags | sed -e 's/-Drandbits=[0-9][0-9]*/ /'`"
17921 while $test "$cont"; do
17922 rp="Use which function to generate random numbers?"
17924 if $test "$ans" = "$dflt"; then
17930 if set $ans val -f; eval $csym; $val; then
17934 rp="I cannot find function $ans. Use that name anyway?"
17943 case "$randfunc" in
17945 drand01="drand48()"
17951 case "$randbits" in
17953 echo "Checking to see how many bits your $randfunc() function produces..." >&4
17955 #$i_unistd I_UNISTD
17956 #$i_stdlib I_STDLIB
17959 # include <unistd.h>
17962 # include <stdlib.h>
17967 register unsigned long tmp;
17968 register unsigned long max = 0L;
17970 for (i = 1000; i; i--) {
17971 tmp = (unsigned long) $randfunc();
17972 if (tmp > max) max = tmp;
17974 for (i = 0; max; i++)
17980 if eval $compile_ok; then
17984 echo "(I can't seem to compile the test program...)"
17991 rp="How many bits does your $randfunc() function produce?"
17995 drand01="($randfunc() / (double) ((unsigned long)1 << $randbits))"
17996 seedfunc="s$randfunc"
17997 randseedtype=unsigned
18001 rp="How many bits does your $randfunc() function produce?"
18004 seedfunc="s$randfunc"
18005 drand01="($randfunc() / (double) ((unsigned long)1 << $randbits))"
18006 if set $seedfunc val -f; eval $csym; $val; then
18007 echo "(Using $seedfunc() to seed random generator)"
18009 echo "(Warning: no $seedfunc() to seed random generator)"
18012 randseedtype=unsigned
18020 echo "Determining whether or not we are on an EBCDIC system..." >&4
18021 $cat >try.c <<'EOM'
18024 if ('M'==0xd4) return 0;
18031 if eval $compile_ok; then
18032 if $run ./try; then
18033 echo "You seem to speak EBCDIC." >&4
18036 echo "Nope, no EBCDIC, probably ASCII or some ISO Latin. Or UTF-8." >&4
18039 echo "I'm unable to compile the test program." >&4
18040 echo "I'll assume ASCII or some ISO Latin. Or UTF8." >&4
18048 Checking how to flush all pending stdio output...
18050 # I only know how to find the first 32 possibly open files on SunOS.
18051 # See also hints/sunos_4_1.sh and util.c --AD
18053 sunos) $echo '#define PERL_FFLUSH_ALL_FOPEN_MAX 32' > try.c ;;
18055 $cat >>try.c <<EOCP
18057 #$i_stdlib I_STDLIB
18059 #include <stdlib.h>
18061 #$i_unistd I_UNISTD
18063 # include <unistd.h>
18065 #$d_sysconf HAS_SYSCONF
18066 #$d_stdio_stream_array HAS_STDIO_STREAM_ARRAY
18067 #ifdef HAS_STDIO_STREAM_ARRAY
18068 # define STDIO_STREAM_ARRAY $stdio_stream_array
18073 p = fopen("try.out", "w");
18077 # ifdef TRY_FPRINTF
18081 #ifdef TRY_FFLUSH_NULL
18084 #ifdef TRY_FFLUSH_ALL
18086 long open_max = -1;
18087 # ifdef PERL_FFLUSH_ALL_FOPEN_MAX
18088 open_max = PERL_FFLUSH_ALL_FOPEN_MAX;
18090 # if defined(HAS_SYSCONF) && defined(_SC_OPEN_MAX)
18091 open_max = sysconf(_SC_OPEN_MAX);
18094 open_max = FOPEN_MAX;
18097 open_max = OPEN_MAX;
18106 # ifdef HAS_STDIO_STREAM_ARRAY
18107 if (open_max > 0) {
18109 for (i = 0; i < open_max; i++)
18110 if (STDIO_STREAM_ARRAY[i]._file >= 0 &&
18111 STDIO_STREAM_ARRAY[i]._file < open_max &&
18112 STDIO_STREAM_ARRAY[i]._flag)
18113 fflush(&STDIO_STREAM_ARRAY[i]);
18121 : first we have to find out how _not_ to flush
18123 if $test "X$fflushNULL" = X -o "X$fflushall" = X; then
18125 set try -DTRY_FPUTC
18126 if eval $compile; then
18127 $run ./try 2>/dev/null
18130 if $test ! -s try.out -a "X$code" = X42; then
18136 set try -DTRY_FPRINTF
18137 if eval $compile; then
18138 $run ./try 2>/dev/null
18141 if $test ! -s try.out -a "X$code" = X42; then
18142 output=-DTRY_FPRINTF
18148 : check for fflush NULL behaviour
18149 case "$fflushNULL" in
18150 '') set try -DTRY_FFLUSH_NULL $output
18151 if eval $compile; then
18152 $run ./try 2>/dev/null
18155 if $test -s try.out -a "X$code" = X42; then
18156 fflushNULL="`$cat try.out`"
18158 if $test "X$code" != X42; then
18160 (If this test failed, don't worry, we'll try another method shortly.)
18165 $rm -f core try.core core.try.*
18166 case "$fflushNULL" in
18168 Your fflush(NULL) works okay for output streams.
18169 Let's see if it clobbers input pipes...
18171 # As of mid-March 2000 all versions of Solaris appear to have a stdio
18172 # bug that improperly flushes the input end of pipes. So we avoid the
18173 # autoflush on fork/system/exec support for now. :-(
18174 $cat >tryp.c <<EOCP
18177 main(int argc, char **argv)
18183 while ((i = getc(stdin)) != -1
18184 && (*bp++ = i) != '\n'
18185 && bp < &buf[1024])
18188 fprintf(stdout, "%s", buf);
18196 fflushNULL="$define"
18198 if eval $compile; then
18200 $cat tryp.c | $run ./tryp 2>/dev/null > tryp.out
18201 if cmp tryp.c tryp.out >/dev/null 2>&1; then
18203 fflush(NULL) seems to behave okay with input streams.
18205 fflushNULL="$define"
18208 Ouch, fflush(NULL) clobbers input pipes! We will not use it.
18210 fflushNULL="$undef"
18213 $rm -f core tryp.c tryp.core core.tryp.*
18216 Your fflush(NULL) isn't working (contrary to ANSI C).
18218 fflushNULL="$undef"
18221 Cannot figure out whether your fflush(NULL) works or not.
18222 I'm assuming it doesn't (contrary to ANSI C).
18224 fflushNULL="$undef"
18228 $define|true|[yY]*)
18229 fflushNULL="$define"
18232 fflushNULL="$undef"
18235 : check explicit looping only if NULL did not work, and if the pipe
18236 : bug does not show up on an explicit flush too
18237 case "$fflushNULL" in
18239 $cat >tryp.c <<EOCP
18242 main(int argc, char **argv)
18248 while ((i = getc(stdin)) != -1
18249 && (*bp++ = i) != '\n'
18250 && bp < &buf[1024])
18253 fprintf(stdout, "%s", buf);
18262 if eval $compile; then
18264 $cat tryp.c | $run ./tryp 2>/dev/null > tryp.out
18265 if cmp tryp.c tryp.out >/dev/null 2>&1; then
18267 Good, at least fflush(stdin) seems to behave okay when stdin is a pipe.
18269 : now check for fflushall behaviour
18270 case "$fflushall" in
18271 '') set try -DTRY_FFLUSH_ALL $output
18272 if eval $compile; then
18274 (Now testing the other method--but note that this also may fail.)
18276 $run ./try 2>/dev/null
18279 if $test -s try.out -a "X$code" = X42; then
18280 fflushall="`$cat try.out`"
18283 $rm -f core try.core core.try.*
18284 case "$fflushall" in
18286 Whew. Flushing explicitly all the stdio streams works.
18288 fflushall="$define"
18291 Sigh. Flushing explicitly all the stdio streams doesn't work.
18296 Cannot figure out whether flushing stdio streams explicitly works or not.
18297 I'm assuming it doesn't.
18303 "$define"|true|[yY]*)
18304 fflushall="$define"
18312 All is futile. Even fflush(stdin) clobbers input pipes!
18319 $rm -f core tryp.c tryp.core core.tryp.*
18321 *) fflushall="$undef"
18325 case "$fflushNULL$fflushall" in
18328 OK, I give up. I cannot figure out how to flush pending stdio output.
18329 We won't be flushing handles at all before fork/exec/popen.
18333 $rm -f try.* try$exe_ext
18335 : Store the full pathname to the ar program for use in the C program
18336 : Respect a hint or command line value for full_ar.
18341 : Store the full pathname to the sed program for use in the C program
18344 : see what type gids are declared as in the kernel
18346 echo "Looking for the type for group ids returned by getgid()."
18347 set gid_t gidtype xxx stdio.h sys/types.h
18351 xxx=`./findhdr sys/user.h`
18352 set `grep 'groups\[NGROUPS\];' "$xxx" 2>/dev/null` unsigned short
18354 unsigned) dflt="$1 $2" ;;
18358 *) dflt="$gidtype";;
18361 gid_t) echo "gid_t found." ;;
18362 *) rp="What is the type for group ids returned by getgid()?"
18370 *_t) zzz="$gidtype" ;;
18373 echo "Checking the size of $zzz..." >&4
18375 #include <sys/types.h>
18377 #$i_stdlib I_STDLIB
18379 #include <stdlib.h>
18382 printf("%d\n", (int)sizeof($gidtype));
18387 if eval $compile_ok; then
18391 echo "(I can't execute the test program--guessing $gidsize.)" >&4
18394 echo "Your $zzz is $gidsize bytes long."
18399 echo "(I can't compile the test program--guessing $gidsize.)" >&4
18405 *_t) zzz="$gidtype" ;;
18408 echo "Checking the sign of $zzz..." >&4
18410 #include <sys/types.h>
18421 if eval $compile; then
18425 echo "(I can't execute the test program--guessing unsigned.)" >&4
18429 1) echo "Your $zzz is unsigned." ;;
18430 -1) echo "Your $zzz is signed." ;;
18436 echo "(I can't compile the test program--guessing unsigned.)" >&4
18442 if $test X"$quadtype" != X; then
18444 echo "Checking how to print 64-bit integers..." >&4
18446 if $test X"$sPRId64" = X -a X"$quadtype" = Xint; then
18447 $cat >try.c <<'EOCP'
18448 #include <sys/types.h>
18451 int q = 12345678901;
18452 printf("%ld\n", q);
18456 if eval $compile; then
18460 sPRId64='"d"'; sPRIi64='"i"'; sPRIu64='"u"';
18461 sPRIo64='"o"'; sPRIx64='"x"'; sPRIXU64='"X"';
18462 echo "We will use %d."
18468 if $test X"$sPRId64" = X -a X"$quadtype" = Xlong; then
18469 $cat >try.c <<'EOCP'
18470 #include <sys/types.h>
18473 long q = 12345678901;
18474 printf("%ld\n", q);
18478 if eval $compile; then
18482 sPRId64='"ld"'; sPRIi64='"li"'; sPRIu64='"lu"';
18483 sPRIo64='"lo"'; sPRIx64='"lx"'; sPRIXU64='"lX"';
18484 echo "We will use %ld."
18490 if $test X"$sPRId64" = X -a X"$i_inttypes" = X"$define" -a X"$quadtype" = Xint64_t; then
18491 $cat >try.c <<'EOCP'
18492 #include <sys/types.h>
18493 #include <inttypes.h>
18496 int64_t q = 12345678901;
18497 printf("%" PRId64 "\n", q);
18501 if eval $compile; then
18505 sPRId64=PRId64; sPRIi64=PRIi64; sPRIu64=PRIu64;
18506 sPRIo64=PRIo64; sPRIx64=PRIx64; sPRIXU64=PRIXU64;
18507 echo "We will use the C9X style."
18513 if $test X"$sPRId64" = X -a X"$quadtype" != X; then
18515 #include <sys/types.h>
18518 $quadtype q = 12345678901;
18519 printf("%Ld\n", q);
18523 if eval $compile; then
18527 sPRId64='"Ld"'; sPRIi64='"Li"'; sPRIu64='"Lu"';
18528 sPRIo64='"Lo"'; sPRIx64='"Lx"'; sPRIXU64='"LX"';
18529 echo "We will use %Ld."
18535 if $test X"$sPRId64" = X -a X"$quadtype" = X"long long"; then
18536 $cat >try.c <<'EOCP'
18537 #include <sys/types.h>
18540 long long q = 12345678901LL; /* AIX cc requires the LL suffix. */
18541 printf("%lld\n", q);
18545 if eval $compile; then
18549 sPRId64='"lld"'; sPRIi64='"lli"'; sPRIu64='"llu"';
18550 sPRIo64='"llo"'; sPRIx64='"llx"'; sPRIXU64='"llX"';
18551 echo "We will use the %lld style."
18557 if $test X"$sPRId64" = X -a X"$quadtype" != X; then
18559 #include <sys/types.h>
18562 $quadtype q = 12345678901;
18563 printf("%qd\n", q);
18567 if eval $compile; then
18571 sPRId64='"qd"'; sPRIi64='"qi"'; sPRIu64='"qu"';
18572 sPRIo64='"qo"'; sPRIx64='"qx"'; sPRIXU64='"qX"';
18573 echo "We will use %qd."
18579 if $test X"$sPRId64" = X; then
18580 echo "Cannot figure out how to print 64-bit integers." >&4
18588 '') d_PRId64="$undef"; d_PRIi64="$undef"; d_PRIu64="$undef";
18589 d_PRIo64="$undef"; d_PRIx64="$undef"; d_PRIXU64="$undef";
18591 *) d_PRId64="$define"; d_PRIi64="$define"; d_PRIu64="$define";
18592 d_PRIo64="$define"; d_PRIx64="$define"; d_PRIXU64="$define";
18598 $echo "Checking the format strings to be used for Perl's internal types..." >&4
18600 if $test X"$ivsize" = X8; then
18601 ivdformat="$sPRId64"
18602 uvuformat="$sPRIu64"
18603 uvoformat="$sPRIo64"
18604 uvxformat="$sPRIx64"
18605 uvXUformat="$sPRIXU64"
18607 if $test X"$ivsize" = X"$longsize"; then
18614 if $test X"$ivsize" = X"$intsize"; then
18622 if $test X"$ivsize" = X"$shortsize"; then
18633 if $test X"$uselongdouble" = X"$define" -a X"$d_longdbl" = X"$define" -a X"$d_PRIgldbl" = X"$define"; then
18634 nveformat="$sPRIeldbl"
18635 nvfformat="$sPRIfldbl"
18636 nvgformat="$sPRIgldbl"
18637 nvEUformat="$sPRIEUldbl"
18638 nvFUformat="$sPRIFUldbl"
18639 nvGUformat="$sPRIGUldbl"
18649 case "$ivdformat" in
18650 '') echo "$0: Fatal: failed to find format strings, cannot continue." >&4
18657 $echo "Checking the format string to be used for gids..." >&4
18660 -1) if $test X"$gidsize" = X"$ivsize"; then
18661 gidformat="$ivdformat"
18663 if $test X"$gidsize" = X"$longsize"; then
18666 if $test X"$gidsize" = X"$intsize"; then
18669 if $test X"$gidsize" = X"$shortsize"; then
18676 *) if $test X"$gidsize" = X"$uvsize"; then
18677 gidformat="$uvuformat"
18679 if $test X"$gidsize" = X"$longsize"; then
18682 if $test X"$gidsize" = X"$intsize"; then
18685 if $test X"$gidsize" = X"$shortsize"; then
18694 : see if getgroups exists
18695 set getgroups d_getgrps
18698 : see if setgroups exists
18699 set setgroups d_setgrps
18703 : Find type of 2nd arg to 'getgroups()' and 'setgroups()'
18705 case "$d_getgrps$d_setgrps" in
18707 case "$groupstype" in
18708 '') dflt="$gidtype" ;;
18709 *) dflt="$groupstype" ;;
18712 What type of pointer is the second argument to getgroups() and setgroups()?
18713 Usually this is the same as group ids, $gidtype, but not always.
18716 rp='What type pointer is the second argument to getgroups() and setgroups()?'
18720 *) groupstype="$gidtype";;
18724 echo "Checking if your $make program sets \$(MAKE)..." >&4
18725 case "$make_set_make" in
18727 $sed 's/^X //' > testmake.mak << 'EOF'
18729 X @echo 'maketemp="$(MAKE)"'
18731 case "`$make -f testmake.mak 2>/dev/null`" in
18732 *maketemp=*) make_set_make='#' ;;
18733 *) make_set_make="MAKE=$make" ;;
18735 $rm -f testmake.mak
18738 case "$make_set_make" in
18739 '#') echo "Yup, it does.";;
18740 *) echo "Nope, it doesn't.";;
18743 : see what type is used for mode_t
18744 rp="What is the type used for file modes for system calls (e.g. fchmod())?"
18745 set mode_t modetype int stdio.h sys/types.h
18748 : see if stdarg is available
18750 if $test `./findhdr stdarg.h`; then
18751 echo "<stdarg.h> found." >&4
18754 echo "<stdarg.h> NOT found." >&4
18758 : see if varags is available
18760 if $test `./findhdr varargs.h`; then
18761 echo "<varargs.h> found." >&4
18763 echo "<varargs.h> NOT found, but that's ok (I hope)." >&4
18766 : set up the varargs testing programs
18767 $cat > varargs.c <<EOP
18769 #include <stdarg.h>
18772 #include <varargs.h>
18776 int f(char *p, ...)
18790 p = va_arg(ap, char *);
18795 $cat > varargs <<EOP
18797 if $cc -c $ccflags -D\$1 varargs.c >/dev/null 2>&1; then
18806 : now check which varargs header should be included
18811 if `./varargs I_STDARG`; then
18813 elif `./varargs I_VARARGS`; then
18818 if `./varargs I_VARARGS`; then
18825 echo "I could not find the definition for va_dcl... You have problems..." >&4
18826 val="$undef"; set i_stdarg; eval $setvar
18827 val="$undef"; set i_varargs; eval $setvar
18832 case "$i_varhdr" in
18834 val="$define"; set i_stdarg; eval $setvar
18835 val="$undef"; set i_varargs; eval $setvar
18838 val="$undef"; set i_stdarg; eval $setvar
18839 val="$define"; set i_varargs; eval $setvar
18842 echo "We'll include <$i_varhdr> to get va_dcl definition." >&4;;
18846 : see if we need va_copy
18848 case "$i_stdarg" in
18851 #include <stdarg.h>
18853 #$i_stdlib I_STDLIB
18855 #include <stdlib.h>
18857 #include <signal.h>
18860 ivfprintf(FILE *f, const char *fmt, va_list *valp)
18862 return vfprintf(f, fmt, *valp);
18866 myvfprintf(FILE *f, const char *fmt, va_list val)
18868 return ivfprintf(f, fmt, &val);
18872 myprintf(char *fmt, ...)
18875 va_start(val, fmt);
18876 return myvfprintf(stdout, fmt, val);
18880 main(int ac, char **av)
18882 signal(SIGSEGV, exit);
18884 myprintf("%s%cs all right, then\n", "that", '\'');
18889 if eval $compile && $run ./try 2>&1 >/dev/null; then
18890 case "`$run ./try`" in
18891 "that's all right, then")
18897 yes) echo "It seems that you don't need va_copy()." >&4
18898 need_va_copy="$undef"
18900 *) echo "It seems that va_copy() or similar will be needed." >&4
18901 need_va_copy="$define"
18904 $rm -f try.* core core.* *.core *.core.*
18906 *) echo "You don't have <stdarg.h>, not checking for va_copy()." >&4
18910 : see what type is used for size_t
18911 rp="What is the type used for the length parameter for string functions?"
18912 set size_t sizetype 'unsigned int' stdio.h sys/types.h
18915 : check for type of arguments to gethostbyaddr.
18916 if test "X$netdb_host_type" = X -o "X$netdb_hlen_type" = X; then
18917 case "$d_gethbyaddr" in
18921 Checking to see what type of arguments are accepted by gethostbyaddr().
18923 hdrs="$define sys/types.h
18924 $d_socket sys/socket.h
18925 $i_niin netinet/in.h
18927 $i_unistd unistd.h"
18928 : The first arg can 'char *' or 'void *'
18929 : The second arg is some of integral type
18930 for xxx in in_addr_t 'const void *' 'const char *' 'void *' 'char *'; do
18931 for yyy in size_t long int; do
18932 case "$netdb_host_type" in
18933 '') try="extern struct hostent *gethostbyaddr($xxx, $yyy, int);"
18934 if ./protochk "$try" $hdrs; then
18935 echo "Your system accepts $xxx for the first arg."
18936 echo "...and $yyy for the second arg."
18937 netdb_host_type="$xxx"
18938 netdb_hlen_type="$yyy"
18944 : In case none of those worked, prompt the user.
18945 case "$netdb_host_type" in
18946 '') rp='What is the type for the 1st argument to gethostbyaddr?'
18949 netdb_host_type=$ans
18950 rp='What is the type for the 2nd argument to gethostbyaddr?'
18953 netdb_hlen_type=$ans
18957 *) : no gethostbyaddr, so pick harmless defaults
18958 netdb_host_type='char *'
18959 netdb_hlen_type="$sizetype"
18962 # Remove the "const" if needed. -- but then we'll have a
18964 # netdb_host_type=`echo "$netdb_host_type" | sed 's/^const //'`
18967 : check for type of argument to gethostbyname.
18968 if test "X$netdb_name_type" = X ; then
18969 case "$d_gethbyname" in
18973 Checking to see what type of argument is accepted by gethostbyname().
18975 hdrs="$define sys/types.h
18976 $d_socket sys/socket.h
18977 $i_niin netinet/in.h
18979 $i_unistd unistd.h"
18980 for xxx in "const char *" "char *"; do
18981 case "$netdb_name_type" in
18982 '') try="extern struct hostent *gethostbyname($xxx);"
18983 if ./protochk "$try" $hdrs; then
18984 echo "Your system accepts $xxx."
18985 netdb_name_type="$xxx"
18990 : In case none of those worked, prompt the user.
18991 case "$netdb_name_type" in
18992 '') rp='What is the type for the 1st argument to gethostbyname?'
18995 netdb_name_type=$ans
18999 *) : no gethostbyname, so pick harmless default
19000 netdb_name_type='char *'
19005 : check for type of 1st argument to getnetbyaddr.
19006 if test "X$netdb_net_type" = X ; then
19007 case "$d_getnbyaddr" in
19011 Checking to see what type of 1st argument is accepted by getnetbyaddr().
19013 hdrs="$define sys/types.h
19014 $d_socket sys/socket.h
19015 $i_niin netinet/in.h
19017 $i_unistd unistd.h"
19018 for xxx in in_addr_t "unsigned long" long "unsigned int" int; do
19019 case "$netdb_net_type" in
19020 '') try="extern struct netent *getnetbyaddr($xxx, int);"
19021 if ./protochk "$try" $hdrs; then
19022 echo "Your system accepts $xxx."
19023 netdb_net_type="$xxx"
19028 : In case none of those worked, prompt the user.
19029 case "$netdb_net_type" in
19030 '') rp='What is the type for the 1st argument to getnetbyaddr?'
19033 netdb_net_type=$ans
19037 *) : no getnetbyaddr, so pick harmless default
19038 netdb_net_type='long'
19042 : locate the preferred pager for this system
19049 [a-zA-Z]:/*) dflt=$pg;;
19053 [a-zA-Z]:/*) dflt=$more;;
19057 [a-zA-Z]:/*) dflt=$less;;
19060 '') dflt=/usr/ucb/more;;
19064 : Instruct ./getfile to trust the hinted or previous pager value,
19065 : even if it does not begin with a slash. For example, on os2,
19066 : pager might be cmd /c more. See comments in UU/getfile.
19071 rp='What pager is used on your system?'
19075 : see what type pids are declared as in the kernel
19076 rp="What is the type of process ids on this system?"
19077 set pid_t pidtype int stdio.h sys/types.h
19080 : see if ar generates random libraries by itself
19082 echo "Checking how to generate random libraries on your machine..." >&4
19083 echo 'int bar1() { return bar2(); }' > bar1.c
19084 echo 'int bar2() { return 2; }' > bar2.c
19086 #$i_stdlib I_STDLIB
19088 #include <stdlib.h>
19090 int main() { printf("%d\n", bar1()); exit(0); }
19092 $cc $ccflags -c bar1.c >/dev/null 2>&1
19093 $cc $ccflags -c bar2.c >/dev/null 2>&1
19094 $cc $ccflags -c foo.c >/dev/null 2>&1
19095 $ar rc bar$_a bar2$_o bar1$_o >/dev/null 2>&1
19096 if $cc -o foobar $ccflags $ldflags foo$_o bar$_a $libs > /dev/null 2>&1 &&
19097 $run ./foobar >/dev/null 2>&1; then
19098 echo "$ar appears to generate random libraries itself."
19100 if [ "X$ranlib" = "X" ]; then
19103 elif $ar ts bar$_a >/dev/null 2>&1 &&
19104 $cc -o foobar $ccflags $ldflags foo$_o bar$_a $libs > /dev/null 2>&1 &&
19105 $run ./foobar >/dev/null 2>&1; then
19106 echo "a table of contents needs to be added with '$ar ts'."
19113 ranlib=`./loc ranlib X /usr/bin /bin /usr/local/bin`
19114 $test -f $ranlib || ranlib=''
19117 if $test -n "$ranlib"; then
19118 echo "your system has '$ranlib'; we'll use that."
19121 echo "your system doesn't seem to support random libraries"
19122 echo "so we'll use lorder and tsort to order the libraries."
19129 : check for type of arguments to select.
19130 case "$selecttype" in
19131 '') case "$d_select" in
19135 Checking to see what type of arguments are accepted by select().
19137 hdrs="$define sys/types.h
19138 $i_systime sys/time.h
19139 $i_sysselct sys/select.h
19140 $d_socket sys/socket.h"
19141 : The first arg can be int, unsigned, or size_t
19142 : The last arg may or may not be 'const'
19144 : void pointer has been seen but using that
19145 : breaks the selectminbits test
19146 for xxx in 'fd_set *' 'int *'; do
19147 for nfd in 'int' 'size_t' 'unsigned long' 'unsigned' ; do
19148 for tmo in 'struct timeval *' 'const struct timeval *'; do
19150 '') try="extern select _(($nfd, $xxx, $xxx, $xxx, $tmo));"
19151 if ./protochk "$try" $hdrs; then
19152 echo "Your system accepts $xxx."
19161 '') rp='What is the type for the 2nd, 3rd, and 4th arguments to select?'
19162 case "$d_fd_set" in
19163 $define) dflt="fd_set *" ;;
19172 *) : no select, so pick a harmless default
19179 : check for the select 'width'
19180 case "$selectminbits" in
19181 '') safebits=`expr $ptrsize \* 8`
19182 case "$d_select" in
19186 Checking to see on how many bits at a time your select() operates...
19189 #include <sys/types.h>
19191 #$i_systime I_SYS_TIME
19192 #$i_systimek I_SYS_TIME_KERNEL
19197 # ifdef I_SYS_TIME_KERNEL
19200 # include <sys/time.h>
19201 # ifdef I_SYS_TIME_KERNEL
19205 #$i_sysselct I_SYS_SELECT
19206 #ifdef I_SYS_SELECT
19207 #include <sys/select.h>
19209 #$d_socket HAS_SOCKET
19211 # include <sys/socket.h> /* Might include <sys/bsdtypes.h> */
19214 #$i_stdlib I_STDLIB
19216 #include <stdlib.h>
19219 #define S sizeof(*(b))
19221 #define NBYTES (S * 8 > MINBITS ? S : MINBITS/8)
19222 #define NBITS (NBYTES * 8)
19224 char *s = malloc(NBYTES);
19233 fp = fopen("try.c", "r");
19239 b = ($selecttype)s;
19240 for (i = 0; i < NBITS; i++)
19244 select(fd + 1, b, 0, 0, &t);
19245 for (i = NBITS - 1; i > fd && FD_ISSET(i, b); i--);
19247 printf("%d\n", i + 1);
19252 if eval $compile_ok; then
19253 selectminbits=`$run ./try`
19254 case "$selectminbits" in
19256 Cannot figure out on how many bits at a time your select() operates.
19257 I'll play safe and guess it is $safebits bits.
19259 selectminbits=$safebits
19260 bits="$safebits bits"
19263 *) bits="$selectminbits bits" ;;
19265 echo "Your select() operates on $bits at a time." >&4
19267 rp='What is the minimum number of bits your select() operates on?'
19268 case "$byteorder" in
19269 12345678) dflt=64 ;;
19275 selectminbits="$val"
19279 *) : no select, so pick a harmless default
19280 selectminbits=$safebits
19286 : Trace out the files included by signal.h, then look for SIGxxx names.
19287 : Remove SIGARRAYSIZE used by HPUX.
19288 : Remove SIGSTKSIZE used by Linux.
19289 : Remove SIGSTKSZ used by Posix.
19290 : Remove SIGTYP void lines used by OS2.
19291 : Some cpps, like os390, dont give the file name anywhere
19292 if [ "X$fieldn" = X ]; then
19293 : Just make some guesses. We check them later.
19294 xxx='/usr/include/signal.h /usr/include/sys/signal.h'
19296 xxx=`echo '#include <signal.h>' |
19297 $cppstdin $cppminus $cppflags 2>/dev/null |
19298 $grep '^[ ]*#.*include' |
19299 $awk "{print \\$$fieldn}" | $sed 's!"!!g' | $sed 's!\\\\\\\\!/!g' | $sort | $uniq`
19301 : Check this list of files to be sure we have parsed the cpp output ok.
19302 : This will also avoid potentially non-existent files, such
19305 for xx in $xxx /dev/null ; do
19306 $test -f "$xx" && xxxfiles="$xxxfiles $xx"
19308 : If we have found no files, at least try signal.h
19309 case "$xxxfiles" in
19310 '') xxxfiles=`./findhdr signal.h` ;;
19313 $1 ~ /^#define$/ && $2 ~ /^SIG[A-Z0-9]*$/ && $2 !~ /SIGARRAYSIZE/ && $2 !~ /SIGSTKSIZE/ && $2 !~ /SIGSTKSZ/ && $3 !~ /void/ {
19314 print substr($2, 4, 20)
19316 $1 == "#" && $2 ~ /^define$/ && $3 ~ /^SIG[A-Z0-9]*$/ && $3 !~ /SIGARRAYSIZE/ && $4 !~ /void/ {
19317 print substr($3, 4, 20)
19319 : Append some common names just in case the awk scan failed.
19320 xxx="$xxx ABRT ALRM BUS CANCEL CHLD CLD CONT DIL EMT FPE"
19321 xxx="$xxx FREEZE HUP ILL INT IO IOT KILL LOST LWP PHONE"
19322 xxx="$xxx PIPE POLL PROF PWR QUIT RTMAX RTMIN SEGV STKFLT STOP"
19323 xxx="$xxx SYS TERM THAW TRAP TSTP TTIN TTOU URG USR1 USR2"
19324 xxx="$xxx USR3 USR4 VTALRM WAITING WINCH WIND WINDOW XCPU XFSZ"
19326 : generate a few handy files for later
19327 $cat > signal.c <<EOCP
19328 #include <sys/types.h>
19329 #include <signal.h>
19330 #$i_stdlib I_STDLIB
19332 #include <stdlib.h>
19337 /* Strange style to avoid deeply-nested #if/#else/#endif */
19340 # define NSIG (_NSIG)
19346 # define NSIG (SIGMAX+1)
19352 # define NSIG (SIG_MAX+1)
19358 # define NSIG (_SIG_MAX+1)
19364 # define NSIG (MAXSIG+1)
19370 # define NSIG (MAX_SIG+1)
19375 # ifdef SIGARRAYSIZE
19376 # define NSIG SIGARRAYSIZE /* Assume ary[SIGARRAYSIZE] */
19382 # define NSIG (_sys_nsig) /* Solaris 2.5 */
19386 /* Default to some arbitrary number that's big enough to get most
19387 of the common signals.
19393 printf("NSIG %d\n", NSIG);
19399 echo $xxx | $tr ' ' $trnl | $sort | $uniq | $awk '
19401 printf "#ifdef SIG"; printf $1; printf "\n"
19402 printf "printf(\""; printf $1; printf " %%d\\n\",SIG";
19403 printf $1; printf ");\n"
19407 printf "#endif /* JUST_NSIG */\n";
19408 printf "exit(0);\n}\n";
19411 $cat >signal.awk <<'EOP'
19412 BEGIN { ndups = 0 }
19413 $1 ~ /^NSIG$/ { nsig = $2 }
19414 ($1 !~ /^NSIG$/) && (NF == 2) && ($2 ~ /^[0-9][0-9]*$/) {
19415 if ($2 > maxsig) { maxsig = $2 }
19416 if (sig_name[$2]) {
19417 dup_name[ndups] = $1
19418 dup_num[ndups] = $2
19430 printf("NSIG %d\n", nsig);
19431 for (n = 1; n < nsig; n++) {
19433 printf("%s %d\n", sig_name[n], sig_num[n])
19436 printf("NUM%d %d\n", n, n)
19439 for (n = 0; n < ndups; n++) {
19440 printf("%s %d\n", dup_name[n], dup_num[n])
19444 $cat >signal_cmd <<EOS
19446 if $test -s signal.lst; then
19447 echo "Using your existing signal.lst file"
19452 $cat >>signal_cmd <<'EOS'
19455 if eval $compile_ok; then
19456 $run ./signal$_exe | ($sort -n -k 2 2>/dev/null || $sort -n +1) | $uniq | $awk -f signal.awk >signal.lst
19458 echo "(I can't seem be able to compile the whole test program)" >&4
19459 echo "(I'll try it in little pieces.)" >&4
19460 set signal -DJUST_NSIG
19461 if eval $compile_ok; then
19462 $run ./signal$_exe > signal.nsg
19465 echo "I can't seem to figure out how many signals you have." >&4
19466 echo "Guessing 50." >&4
19467 echo 'NSIG 50' > signal.nsg
19469 : Now look at all the signal names, one at a time.
19470 for xx in `echo $xxx | $tr ' ' $trnl | $sort | $uniq`; do
19471 $cat > signal.c <<EOCP
19472 #include <sys/types.h>
19473 #include <signal.h>
19476 printf("$xx %d\n", SIG${xx});
19481 if eval $compile; then
19482 echo "SIG${xx} found."
19483 $run ./signal$_exe >> signal.ls1
19485 echo "SIG${xx} NOT found."
19488 if $test -s signal.ls1; then
19489 $cat signal.nsg signal.ls1 |
19490 $sort -n | $uniq | $awk -f signal.awk >signal.lst
19494 if $test -s signal.lst; then
19497 echo "(AAK! I can't compile the test programs -- Guessing)" >&4
19498 echo 'kill -l' >signal
19499 set X `csh -f <signal`
19503 0) set HUP INT QUIT ILL TRAP ABRT EMT FPE KILL BUS SEGV SYS PIPE ALRM TERM;;
19505 echo $@ | $tr ' ' $trnl | \
19506 $awk '{ printf "%s %d\n", $1, ++s; }
19507 END { printf "NSIG %d\n", ++s }' >signal.lst
19509 $rm -f signal.c signal$_exe signal$_o signal.nsg signal.ls1
19511 chmod a+x signal_cmd
19512 $eunicefix signal_cmd
19514 : generate list of signal names
19516 case "$sig_name_init" in
19518 *) case "$sig_num_init" in
19519 ''|*,*) doinit=yes ;;
19524 echo "Generating a list of signal names and numbers..." >&4
19526 sig_count=`$awk '/^NSIG/ { printf "%d", $2 }' signal.lst`
19527 sig_name=`$awk 'BEGIN { printf "ZERO " }
19528 !/^NSIG/ { printf "%s ", $1 }' signal.lst`
19529 sig_num=`$awk 'BEGIN { printf "0 " }
19530 !/^NSIG/ { printf "%d ", $2 }' signal.lst`
19531 sig_name_init=`$awk 'BEGIN { printf "\"ZERO\", " }
19532 !/^NSIG/ { printf "\"%s\", ", $1 }
19533 END { printf "0\n" }' signal.lst`
19534 sig_num_init=`$awk 'BEGIN { printf "0, " }
19535 !/^NSIG/ { printf "%d, ", $2}
19536 END { printf "0\n"}' signal.lst`
19539 echo "The following $sig_count signals are available:"
19541 echo $sig_name | $awk \
19542 'BEGIN { linelen = 0 }
19544 for (i = 1; i <= NF; i++) {
19545 name = "SIG" $i " "
19546 linelen = linelen + length(name)
19547 if (linelen > 70) {
19549 linelen = length(name)
19555 sig_size=`echo $sig_name | awk '{print NF}'`
19556 $rm -f signal signal.c signal.awk signal.lst signal_cmd
19559 case "$sizetype" in
19560 *_t) zzz="$sizetype" ;;
19561 *) zzz="filesize" ;;
19563 echo "Checking the size of $zzz..." >&4
19565 #include <sys/types.h>
19567 #$i_stdlib I_STDLIB
19569 #include <stdlib.h>
19572 printf("%d\n", (int)sizeof($sizetype));
19577 if eval $compile_ok; then
19581 echo "(I can't execute the test program--guessing $sizesize.)" >&4
19584 echo "Your $zzz size is $sizesize bytes."
19589 echo "(I can't compile the test program--guessing $sizesize.)" >&4
19593 : check for socklen_t
19595 echo "Checking to see if you have socklen_t..." >&4
19597 #include <sys/types.h>
19598 #$d_socket HAS_SOCKET
19600 #include <sys/socket.h>
19602 int main() { socklen_t x = 16; }
19605 if eval $compile; then
19607 echo "You have socklen_t."
19610 echo "You do not have socklen_t."
19611 case "$sizetype" in
19612 size_t) echo "(You do have size_t, that might work. Some people are happy with just an int.)" ;;
19619 : see if this is a socks.h system
19620 set socks.h i_socks
19623 : check for type of the size argument to socket calls
19624 case "$d_socket" in
19628 Checking to see what type is the last argument of accept().
19631 case "$d_socklen_t" in
19632 "$define") yyy="$yyy socklen_t"
19634 yyy="$yyy $sizetype int long unsigned"
19635 for xxx in $yyy; do
19636 case "$socksizetype" in
19637 '') try="extern int accept(int, struct sockaddr *, $xxx *);"
19638 case "$usesocks" in
19640 if ./protochk "$try" $i_systypes sys/types.h $d_socket sys/socket.h literal '#define INCLUDE_PROTOTYPES' $i_socks socks.h.; then
19641 echo "Your system accepts '$xxx *' for the last argument of accept()."
19642 socksizetype="$xxx"
19645 *) if ./protochk "$try" $i_systypes sys/types.h $d_socket sys/socket.h; then
19646 echo "Your system accepts '$xxx *' for the last argument of accept()."
19647 socksizetype="$xxx"
19654 : In case none of those worked, prompt the user.
19655 case "$socksizetype" in
19656 '') rp='What is the type for socket address structure sizes?'
19663 *) : no sockets, so pick relatively harmless default
19668 : see what type is used for signed size_t
19669 set ssize_t ssizetype int stdio.h sys/types.h
19674 #$i_stdlib I_STDLIB
19676 #include <stdlib.h>
19678 #include <sys/types.h>
19679 #define Size_t $sizetype
19680 #define SSize_t $dflt
19683 if (sizeof(Size_t) == sizeof(SSize_t))
19685 else if (sizeof(Size_t) == sizeof(int))
19694 if eval $compile_ok && $run ./try > /dev/null; then
19695 ssizetype=`$run ./try`
19696 echo "I'll be using $ssizetype for functions returning a byte count." >&4
19699 Help! I can't compile and run the ssize_t test program: please enlighten me!
19700 (This is probably a misconfiguration in your system or libraries, and
19701 you really ought to fix it. Still, I'll try anyway.)
19703 I need a type that is the same size as $sizetype, but is guaranteed to
19704 be signed. Common values are ssize_t, int and long.
19707 rp="What signed type is the same size as $sizetype?"
19713 : see what type of char stdio uses.
19715 echo '#include <stdio.h>' | $cppstdin $cppminus > stdioh
19716 if $contains 'unsigned.*char.*_ptr;' stdioh >/dev/null 2>&1 ; then
19717 echo "Your stdio uses unsigned chars." >&4
19718 stdchar="unsigned char"
19720 echo "Your stdio uses signed chars." >&4
19727 : see what type uids are declared as in the kernel
19729 echo "Looking for the type for user ids returned by getuid()."
19730 set uid_t uidtype xxx stdio.h sys/types.h
19734 xxx=`./findhdr sys/user.h`
19735 set `grep '_ruid;' "$xxx" 2>/dev/null` unsigned short
19737 unsigned) dflt="$1 $2" ;;
19741 *) dflt="$uidtype";;
19744 uid_t) echo "uid_t found." ;;
19745 *) rp="What is the type for user ids returned by getuid()?"
19753 *_t) zzz="$uidtype" ;;
19756 echo "Checking the size of $zzz..." >&4
19758 #include <sys/types.h>
19760 #$i_stdlib I_STDLIB
19762 #include <stdlib.h>
19765 printf("%d\n", (int)sizeof($uidtype));
19770 if eval $compile_ok; then
19774 echo "(I can't execute the test program--guessing $uidsize.)" >&4
19777 echo "Your $zzz is $uidsize bytes long."
19782 echo "(I can't compile the test program--guessing $uidsize.)" >&4
19787 *_t) zzz="$uidtype" ;;
19790 echo "Checking the sign of $zzz..." >&4
19792 #include <sys/types.h>
19803 if eval $compile; then
19807 echo "(I can't execute the test program--guessing unsigned.)" >&4
19811 1) echo "Your $zzz is unsigned." ;;
19812 -1) echo "Your $zzz is signed." ;;
19818 echo "(I can't compile the test program--guessing unsigned.)" >&4
19824 $echo "Checking the format string to be used for uids..." >&4
19827 -1) if $test X"$uidsize" = X"$ivsize"; then
19828 uidformat="$ivdformat"
19830 if $test X"$uidsize" = X"$longsize"; then
19833 if $test X"$uidsize" = X"$intsize"; then
19836 if $test X"$uidsize" = X"$shortsize"; then
19843 *) if $test X"$uidsize" = X"$uvsize"; then
19844 uidformat="$uvuformat"
19846 if $test X"$uidsize" = X"$longsize"; then
19849 if $test X"$uidsize" = X"$intsize"; then
19852 if $test X"$uidsize" = X"$shortsize"; then
19862 case "$usesitecustomize" in
19863 $define|true|[Yy]*)
19864 usesitecustomize="$define"
19867 usesitecustomize="$undef"
19871 : determine compiler compiler
19880 if $test -f "$byacc$_exe"; then
19882 comp="byacc or $comp"
19884 if $test -f "$bison$_exe"; then
19885 comp="$comp or bison -y"
19887 rp="Which compiler compiler ($comp) shall I use?"
19896 echo "(Adding -y option to bison to get yacc-compatible behaviour.)"
19902 : see if this is a fp.h system
19906 : see if this is a fp_class.h system
19907 set fp_class.h i_fp_class
19910 : see if this is a ieeefp.h system
19911 case "$i_ieeefp" in
19912 '' ) set ieeefp.h i_ieeefp
19917 : see if this is a libutil.h system
19918 set libutil.h i_libutil
19921 : see if mach cthreads are available
19922 if test "X$usethreads" = "X$define"; then
19923 set mach/cthreads.h i_machcthr
19926 i_machcthr="$undef"
19931 : see if this is a mntent.h system
19932 set mntent.h i_mntent
19935 : see if ndbm.h is available
19941 # Some Linux distributions such as RedHat 7.1 put the
19942 # ndbm.h header in /usr/include/gdbm/ndbm.h.
19943 if $test -f /usr/include/gdbm/ndbm.h; then
19944 echo '<gdbm/ndbm.h> found.'
19945 ccflags="$ccflags -I/usr/include/gdbm"
19946 cppflags="$cppflags -I/usr/include/gdbm"
19954 : see if dbm_open exists
19955 set dbm_open d_dbm_open
19957 case "$d_dbm_open" in
19960 echo "We won't be including <ndbm.h>"
19969 : see if net/errno.h is available
19971 set net/errno.h val
19974 : Unfortunately, it causes problems on some systems. Arrgh.
19977 cat > try.c <<'EOM'
19980 #include <net/errno.h>
19986 if $cc $ccflags -c try.c >/dev/null 2>&1; then
19987 echo "We'll be including <net/errno.h>." >&4
19989 echo "We won't be including <net/errno.h>." >&4
19998 : see if netinet/tcp.h is available
19999 set netinet/tcp.h i_netinettcp
20002 : see if this is a poll.h system
20006 : see if this is a prot.h system
20011 $echo "Guessing which symbols your C compiler and preprocessor define..." >&4
20012 $cat <<'EOSH' > Cppsym.know
20013 a29k ABI64 aegis AES_SOURCE AIX AIX32 AIX370
20014 AIX41 AIX42 AIX43 AIX_SOURCE aixpc ALL_SOURCE
20015 alliant alpha am29000 AM29000 AMD64 amd64 amiga AMIGAOS AMIX
20016 ansi ANSI_C_SOURCE apollo ardent ARM32 atarist att386 att3b
20017 BeOS BIG_ENDIAN BIT_MSF bsd BSD bsd43 bsd4_2 bsd4_3 BSD4_3 bsd4_4
20018 BSD_4_3 BSD_4_4 BSD_NET2 BSD_TIME BSD_TYPES BSDCOMPAT bsdi
20019 bull c cadmus clipper CMU COFF COMPILER_VERSION
20020 concurrent convex cpu cray CRAY CRAYMPP ctix CX_UX
20021 CYGWIN DECC DGUX DGUX_SOURCE DJGPP dmert DOLPHIN DPX2 DSO
20022 Dynix DynixPTX ELF encore EPI EXTENSIONS FAVOR_BSD
20023 FILE_OFFSET_BITS FreeBSD GCC_NEW_VARARGS gcos gcx gimpel
20025 GNU_SOURCE GNUC GNUC_MINOR GNU_LIBRARY GO32 gould GOULD_PN
20026 H3050R H3050RX hbullx20 hcx host_mips
20027 hp200 hp300 hp700 HP700 hp800 hp9000
20028 hp9000s200 hp9000s300 hp9000s400 hp9000s500
20029 hp9000s700 hp9000s800 hp9k8 hp_osf hppa hpux HPUX_SOURCE
20030 i186 i286 i386 i486 i586 i686 i8086 i80960 i860 I960
20031 IA64 iAPX286 ibm ibm032 ibmesa IBMR2 ibmrt ILP32 ILP64
20032 INLINE_INTRINSICS INTRINSICS INT64 interdata is68k ksr1
20033 LANGUAGE_C LARGE_FILE_API LARGEFILE64_SOURCE
20034 LARGEFILE_SOURCE LFS64_LARGEFILE LFS_LARGEFILE
20035 Linux LITTLE_ENDIAN LONG64 LONG_DOUBLE LONG_LONG
20036 LONGDOUBLE LONGLONG LP64 luna luna88k Lynx
20037 M68000 m68k m88100 m88k M88KBCS_TARGET M_COFF
20038 M_I186 M_I286 M_I386 M_I8086 M_I86 M_I86SM M_SYS3
20039 M_SYS5 M_SYSIII M_SYSV M_UNIX M_XENIX MACH machine MachTen
20040 MATH_HAS_NO_SIDE_EFFECTS
20041 mc300 mc500 mc68000 mc68010 mc68020 mc68030 mc68040
20042 mc68060 mc68k mc68k32 mc700 mc88000 mc88100 merlin
20043 mert MiNT mips MIPS_FPSET MIPS_ISA MIPS_SIM MIPS_SZINT
20044 MIPS_SZLONG MIPS_SZPTR MIPSEB MIPSEL MODERN_C motorola
20045 mpeix MSDOS MTXINU MULTIMAX mvs MVS n16 ncl_el ncl_mr
20046 NetBSD news1500 news1700 news1800 news1900 news3700
20047 news700 news800 news900 NeXT NLS nonstopux ns16000 ns32000
20048 ns32016 ns32332 ns32k nsc32000
20049 OCS88 OEMVS OpenBSD os OS2 OS390 osf OSF1 OSF_SOURCE
20050 pa_risc PA_RISC1_1 PA_RISC2_0 PARAGON parisc
20051 pc532 pdp11 PGC PIC plexus PORTAR posix
20052 POSIX1B_SOURCE POSIX2_SOURCE POSIX4_SOURCE
20053 POSIX_C_SOURCE POSIX_SOURCE POWER
20054 PROTOTYPES PWB pyr QNX R3000 REENTRANT RES Rhapsody RISC6000
20055 riscix riscos RT S390 SA110 scs SCO sequent sgi SGI_SOURCE SH3 sinix
20056 SIZE_INT SIZE_LONG SIZE_PTR SOCKET_SOURCE SOCKETS_SOURCE
20057 sony sony_news sonyrisc sparc sparclite spectrum
20058 stardent stdc STDC_EXT stratos sun sun3 sun386
20059 Sun386i svr3 svr4 SVR4_2 SVR4_SOURCE svr5
20060 SX system SYSTYPE_BSD SYSTYPE_BSD43 SYSTYPE_BSD44
20061 SYSTYPE_SVR4 SYSTYPE_SVR5 SYSTYPE_SYSV SYSV SYSV3 SYSV4 SYSV5
20062 sysV68 sysV88 Tek4132 Tek4300 titan
20063 TM3200 TM5400 TM5600
20064 tower tower32 tower32_200 tower32_600 tower32_700
20065 tower32_800 tower32_850 tss
20066 u370 u3b u3b2 u3b20 u3b200 u3b20d u3b5
20067 ultrix UMAXV UnicomPBB UnicomPBD UNICOS UNICOSMK
20068 unix UNIX95 UNIX99 unixpc unos
20069 USE_BSD USE_FILE_OFFSET64 USE_GNU USE_ISOC9X USE_LARGEFILE USE_LARGEFILE64
20070 USE_MISC USE_POSIX USE_POSIX199309 USE_POSIX199506 USE_POSIX2
20071 USE_REENTRANT USE_SVID USE_UNIX98 USE_XOPEN USE_XOPEN_EXTENDED
20073 Utek UTek UTS UWIN uxpm uxps vax venix VMESA vms x86_64 xenix Xenix286
20074 XOPEN_SOURCE XOPEN_SOURCE_EXTENDED XPG2 XPG2_EXTENDED
20075 XPG3 XPG3_EXTENDED XPG4 XPG4_EXTENDED
20078 # Maybe put other stuff here too.
20079 cat <<EOSH >>Cppsym.know
20082 ./tr '[a-z]' '[A-Z]' < Cppsym.know > Cppsym.a
20083 ./tr '[A-Z]' '[a-z]' < Cppsym.know > Cppsym.b
20084 $cat Cppsym.know > Cppsym.c
20085 $cat Cppsym.a Cppsym.b Cppsym.c | $tr ' ' $trnl | $sort | $uniq > Cppsym.know
20086 $rm -f Cppsym.a Cppsym.b Cppsym.c
20087 cat <<EOSH > Cppsym
20089 if $test \$# -gt 0; then
20090 echo \$* | $tr " " "$trnl" | ./Cppsym.try > Cppsym.got
20091 if $test -s Cppsym.got; then
20098 $tr " " "$trnl" | ./Cppsym.try
20104 cat <<EOSH > Cppsym.try
20106 cat <<'EOCP' > try.c
20112 cat <<'EOSH' >> Cppsym.try
20114 printf "#ifdef %s\n#if %s+0\nprintf(\"%s=%%ld\\n\", (long)%s);\n#else\nprintf(\"%s\\n\");\n#endif\n#endif\n", $1, $1, $1, $1, $1
20115 printf "#ifdef _%s\n#if _%s+0\nprintf(\"_%s=%%ld\\n\", (long)_%s);\n#else\nprintf(\"_%s\\n\");\n#endif\n#endif\n", $1, $1, $1, $1, $1
20116 printf "#ifdef __%s\n#if __%s+0\nprintf(\"__%s=%%ld\\n\", (long)__%s);\n#else\nprintf(\"__%s\\n\");\n#endif\n#endif\n", $1, $1, $1, $1, $1
20117 printf "#ifdef __%s__\n#if __%s__+0\nprintf(\"__%s__=%%ld\\n\", (long)__%s__);\n#else\nprintf(\"__%s__\\n\");\n#endif\n#endif\n", $1, $1, $1, $1, $1
20119 echo 'return 0;}' >> try.c
20121 cat <<EOSH >> Cppsym.try
20123 case "$osname-$gccversion" in
20124 irix-) ccflags="\$ccflags -woff 1178" ;;
20125 os2-*) ccflags="\$ccflags -Zlinker /PM:VIO" ;;
20127 $cc -o try $optimize \$ccflags $ldflags try.c $libs && $run ./try
20129 chmod +x Cppsym.try
20130 $eunicefix Cppsym.try
20131 ./Cppsym < Cppsym.know > Cppsym.true
20132 : now check the C compiler for additional symbols
20133 postprocess_cc_v=''
20135 aix) postprocess_cc_v="|$tr , ' '" ;;
20142 for i in \`$cc -v -c tmp.c 2>&1 $postprocess_cc_v\`
20145 -D*) echo "\$i" | $sed 's/^-D//';;
20146 -A*) $test "$gccversion" && echo "\$i" | $sed 's/^-A//' | $sed 's/\(.*\)(\(.*\))/\1=\2/';;
20151 postprocess_cc_v=''
20154 ./ccsym > ccsym1.raw
20155 if $test -s ccsym1.raw; then
20156 $sort ccsym1.raw | $uniq >ccsym.raw
20158 mv ccsym1.raw ccsym.raw
20161 $awk '/\=/ { print $0; next }
20162 { print $0"=1" }' ccsym.raw >ccsym.list
20163 $awk '/\=/ { print $0; next }
20164 { print $0"=1" }' Cppsym.true >ccsym.true
20165 $comm -13 ccsym.true ccsym.list >ccsym.own
20166 $comm -12 ccsym.true ccsym.list >ccsym.com
20167 $comm -23 ccsym.true ccsym.list >ccsym.cpp
20169 if $test -z ccsym.raw; then
20170 echo "Your C compiler doesn't seem to define any symbols!" >&4
20172 echo "However, your C preprocessor defines the following symbols:"
20175 cppsymbols=`$cat Cppsym.true`
20176 cppsymbols=`echo $cppsymbols`
20177 cppccsymbols="$cppsymbols"
20179 if $test -s ccsym.com; then
20180 echo "Your C compiler and pre-processor define these symbols:"
20181 $sed -e 's/\(..*\)=.*/\1/' ccsym.com
20184 cppccsymbols=`$cat ccsym.com`
20185 cppccsymbols=`echo $cppccsymbols`
20186 $test "$silent" || sleep 1
20188 if $test -s ccsym.cpp; then
20189 $test "$also" && echo " "
20190 echo "Your C pre-processor ${also}defines the following symbols:"
20191 $sed -e 's/\(..*\)=.*/\1/' ccsym.cpp
20193 cppsymbols=`$cat ccsym.cpp`
20194 cppsymbols=`echo $cppsymbols`
20195 $test "$silent" || sleep 1
20197 if $test -s ccsym.own; then
20198 $test "$also" && echo " "
20199 echo "Your C compiler ${also}defines the following cpp symbols:"
20200 $sed -e 's/\(..*\)=1/\1/' ccsym.own
20201 $sed -e 's/\(..*\)=.*/\1/' ccsym.own | $uniq >>Cppsym.true
20202 ccsymbols=`$cat ccsym.own`
20203 ccsymbols=`echo $ccsymbols`
20204 $test "$silent" || sleep 1
20208 : see if this is a termio system
20212 if $test `./findhdr termios.h`; then
20213 set tcsetattr i_termios
20219 "$define") echo "You have POSIX termios.h... good!" >&4;;
20220 *) if ./Cppsym pyr; then
20221 case "`/bin/universe`" in
20222 ucb) if $test `./findhdr sgtty.h`; then
20224 echo "<sgtty.h> found." >&4
20226 echo "System is pyramid with BSD universe."
20227 echo "<sgtty.h> not found--you could have problems." >&4
20229 *) if $test `./findhdr termio.h`; then
20231 echo "<termio.h> found." >&4
20233 echo "System is pyramid with USG universe."
20234 echo "<termio.h> not found--you could have problems." >&4
20238 if $test `./findhdr termio.h`; then
20239 echo "<termio.h> found." >&4
20241 elif $test `./findhdr sgtty.h`; then
20242 echo "<sgtty.h> found." >&4
20245 echo "Neither <termio.h> nor <sgtty.h> found--you could have problems." >&4
20248 if $test `./findhdr sgtty.h`; then
20249 echo "<sgtty.h> found." >&4
20251 elif $test `./findhdr termio.h`; then
20252 echo "<termio.h> found." >&4
20255 echo "Neither <sgtty.h> nor <termio.h> found--you could have problems." >&4
20259 set i_termio; eval $setvar
20260 val=$val2; set i_sgtty; eval $setvar
20261 val=$val3; set i_termios; eval $setvar
20263 : see if stddef is available
20264 set stddef.h i_stddef
20267 : see if this is a sunmath.h system
20268 set sunmath.h i_sunmath
20271 : see if sys/access.h is available
20272 set sys/access.h i_sysaccess
20275 : see if ioctl defs are in sgtty, termio, sys/filio or sys/ioctl
20276 set sys/filio.h i_sysfilio
20279 if $test `./findhdr sys/ioctl.h`; then
20281 echo '<sys/ioctl.h> found.' >&4
20284 if $test $i_sysfilio = "$define"; then
20285 echo '<sys/ioctl.h> NOT found.' >&4
20287 $test $i_sgtty = "$define" && xxx="sgtty.h"
20288 $test $i_termio = "$define" && xxx="termio.h"
20289 $test $i_termios = "$define" && xxx="termios.h"
20290 echo "No <sys/ioctl.h> found, assuming ioctl args are defined in <$xxx>." >&4
20296 : see if socket ioctl defs are in sys/sockio.h
20298 xxx=`./findhdr sys/sockio.h`
20299 if $test "$xxx"; then
20300 if $contains SIOCATMARK $xxx >/dev/null 2>&1; then
20302 echo "You have socket ioctls defined in <sys/sockio.h>." >&4
20305 echo "No socket ioctls found in <sys/sockio.h>." >&4
20310 <sys/sockio.h> not found, assuming socket ioctls are in <sys/ioctl.h>.
20317 : see if this is a syslog.h system
20318 set syslog.h i_syslog
20322 : see if this is a sys/mode.h system
20323 set sys/mode.h i_sysmode
20326 : see if sys/resource.h has to be included
20327 set sys/resource.h i_sysresrc
20330 : see if sys/security.h is available
20331 set sys/security.h i_syssecrt
20334 : see if this is a sys/statvfs.h system
20335 set sys/statvfs.h i_sysstatvfs
20338 : see if this is a sys/un.h system
20339 set sys/un.h i_sysun
20343 : see if this is a sys/utsname.h system
20344 set sys/utsname.h i_sysutsname
20347 : see if this is a syswait system
20348 set sys/wait.h i_syswait
20351 : see if this is a ustat.h system
20352 set ustat.h i_ustat
20355 : see if this is an utime system
20356 set utime.h i_utime
20359 : see if this is a values.h system
20360 set values.h i_values
20363 : see if this is a vfork system
20366 set vfork.h i_vfork
20374 : see if gdbm.h is available
20379 : see if gdbm_open exists
20380 set gdbm_open d_gdbm_open
20382 case "$d_gdbm_open" in
20385 echo "We won't be including <gdbm.h>"
20395 echo "Looking for extensions..." >&4
20396 : If we are using the old config.sh, known_extensions may contain
20397 : old or inaccurate or duplicate values.
20398 known_extensions=''
20399 nonxs_extensions=''
20400 : We do not use find because it might not be available.
20401 : We do not just use MANIFEST because the user may have dropped
20402 : some additional extensions into the source tree and expect them
20405 : Function to recursively find available extensions, ignoring DynaLoader
20406 : NOTE: recursion limit of 10 to prevent runaway in case of symlink madness
20410 DynaLoader|dynaload) ;;
20412 if $test -f $xxx/$xxx.xs; then
20413 known_extensions="$known_extensions $1$xxx";
20414 elif $test -f $xxx/Makefile.PL; then
20415 nonxs_extensions="$nonxs_extensions $1$xxx";
20417 if $test -d $xxx -a $# -lt 10; then
20420 eval $find_extensions;
20432 eval $find_extensions
20433 # Special case: Add in threads/shared since it is not picked up by the
20434 # recursive find above (and adding in general recursive finding breaks
20435 # SDBM_File/sdbm). A.D. 10/25/2001.
20436 known_extensions="$known_extensions threads/shared"
20437 set X $nonxs_extensions
20439 nonxs_extensions="$*"
20440 set X $known_extensions
20442 known_extensions="$*"
20445 : Now see which are supported on this system.
20447 for xxx in $known_extensions ; do
20451 $define) avail_ext="$avail_ext $xxx" ;;
20454 GDBM_File|gdbm_fil)
20456 $define) avail_ext="$avail_ext $xxx" ;;
20459 I18N/Langinfo|i18n_lan)
20460 case "$i_langinfo$d_nl_langinfo" in
20461 $define$define) avail_ext="$avail_ext $xxx" ;;
20464 NDBM_File|ndbm_fil)
20467 case "$osname-$use64bitint" in
20470 *-lndbm*) avail_ext="$avail_ext $xxx" ;;
20473 *) avail_ext="$avail_ext $xxx" ;;
20478 ODBM_File|odbm_fil)
20479 case "${i_dbm}${i_rpcsvcdbm}" in
20481 case "$osname-$use64bitint" in
20484 *-ldbm*) avail_ext="$avail_ext $xxx" ;;
20487 *) avail_ext="$avail_ext $xxx" ;;
20493 case "$useposix" in
20494 true|define|y) avail_ext="$avail_ext $xxx" ;;
20498 case "$useopcode" in
20499 true|define|y) avail_ext="$avail_ext $xxx" ;;
20503 case "$d_socket" in
20506 beos) ;; # not unless BONE
20507 *) avail_ext="$avail_ext $xxx" ;;
20512 Sys/Syslog|sys/syslog)
20513 : XXX syslog requires socket
20514 case "$d_socket" in
20515 true|$define|y) avail_ext="$avail_ext $xxx" ;;
20519 case "$usethreads" in
20521 case "$useithreads" in
20522 $undef|false|[nN]*) avail_ext="$avail_ext $xxx" ;;
20526 XS/APItest|xs/apitest)
20527 # This is just for testing. Skip it unless we have dynamic loading.
20530 $define) avail_ext="$avail_ext $xxx" ;;
20533 XS/Typemap|xs/typemap)
20534 # This is just for testing. Skip it unless we have dynamic loading.
20536 $define) avail_ext="$avail_ext $xxx" ;;
20539 threads|threads/shared)
20540 # threads and threads::shared are special cases.
20541 # To stop people from asking "Perl 5.8.0 was supposed
20542 # to have this new fancy threads implementation but my
20543 # perl doesn't have it" and from people trying to
20544 # (re)install the threads module using CPAN.pm and
20545 # CPAN.pm then offering to reinstall Perl 5.8.0,
20546 # the threads.pm and threads/shared.pm will always be
20547 # there, croaking informatively ("you need to rebuild
20548 # all of Perl with threads, sorry") when threads haven't
20549 # been compiled in.
20551 avail_ext="$avail_ext $xxx"
20554 : XXX Do we need a useipcsysv variable here
20555 case "${d_msg}${d_sem}${d_shm}" in
20556 *"${define}"*) avail_ext="$avail_ext $xxx" ;;
20559 *) avail_ext="$avail_ext $xxx"
20568 case "$onlyextensions" in
20570 *) keepextensions=''
20571 echo "You have requested that only certains extensions be included..." >&4
20572 for i in $onlyextensions; do
20573 case " $avail_ext " in
20575 echo "Keeping extension $i."
20576 keepextensions="$keepextensions $i"
20578 *) echo "Ignoring extension $i." ;;
20581 avail_ext="$keepextensions"
20585 case "$noextensions" in
20587 *) keepextensions=''
20588 echo "You have requested that certain extensions be ignored..." >&4
20589 for i in $avail_ext; do
20590 case " $noextensions " in
20591 *" $i "*) echo "Ignoring extension $i." ;;
20592 *) echo "Keeping extension $i.";
20593 keepextensions="$keepextensions $i"
20597 avail_ext="$keepextensions"
20601 : Now see which nonxs extensions are supported on this system.
20602 : For now assume all are.
20604 for xxx in $nonxs_extensions ; do
20606 *) nonxs_ext="$nonxs_ext $xxx"
20618 A number of extensions are supplied with $package. You may choose to
20619 compile these extensions for dynamic loading (the default), compile
20620 them into the $package executable (static loading), or not include
20621 them at all. Answer "none" to include no extensions.
20622 Note that DynaLoader is always built and need not be mentioned here.
20625 case "$dynamic_ext" in
20627 : Exclude those listed in static_ext
20629 for xxx in $avail_ext; do
20630 case " $static_ext " in
20632 *) dflt="$dflt $xxx" ;;
20639 *) dflt="$dynamic_ext"
20640 # Perhaps we are reusing an old out-of-date config.sh.
20643 if test X"$dynamic_ext" != X"$avail_ext"; then
20645 NOTICE: Your previous config.sh list may be incorrect.
20646 The extensions now available to you are
20648 but the default list from your previous config.sh is
20660 rp="What extensions do you wish to load dynamically?"
20663 none) dynamic_ext=' ' ;;
20664 *) dynamic_ext="$ans" ;;
20667 case "$static_ext" in
20669 : Exclude those already listed in dynamic linking
20671 for xxx in $avail_ext; do
20672 case " $dynamic_ext " in
20674 *) dflt="$dflt $xxx" ;;
20681 *) dflt="$static_ext"
20688 rp="What extensions do you wish to load statically?"
20691 none) static_ext=' ' ;;
20692 *) static_ext="$ans" ;;
20697 A number of extensions are supplied with $package. Answer "none"
20698 to include no extensions.
20699 Note that DynaLoader is always built and need not be mentioned here.
20702 case "$static_ext" in
20703 '') dflt="$avail_ext" ;;
20704 *) dflt="$static_ext"
20705 # Perhaps we are reusing an old out-of-date config.sh.
20708 if test X"$static_ext" != X"$avail_ext"; then
20710 NOTICE: Your previous config.sh list may be incorrect.
20711 The extensions now available to you are
20713 but the default list from your previous config.sh is
20722 : Exclude those that are not xs extensions
20726 rp="What extensions do you wish to include?"
20729 none) static_ext=' ' ;;
20730 *) static_ext="$ans" ;;
20735 # Encode is a special case. If we are building Encode as a static
20736 # extension, we need to explicitly list its subextensions as well.
20737 # For other nested extensions, this is handled automatically by
20738 # the appropriate Makefile.PL.
20739 case " $static_ext " in
20740 *" Encode "*) # Add the subextensions of Encode
20742 for xxx in `ls Encode/*/Makefile.PL|awk -F/ '{print $2}'`; do
20743 static_ext="$static_ext Encode/$xxx"
20749 set X $dynamic_ext $static_ext $nonxs_ext
20753 # Sanity check: We require an extension suitable for use with
20754 # AnyDBM_File, as well as Fcntl and IO. (Failure to have these
20755 # should show up as failures in the test suite, but it's helpful to
20756 # catch them now.) The 'extensions' list is normally sorted
20757 # alphabetically, so we need to accept either
20758 # DB_File ... Fcntl ... IO ....
20759 # or something like
20760 # Fcntl ... NDBM_File ... IO ....
20761 case " $extensions" in
20762 *"_File "*" Fcntl "*" IO "*) ;; # DB_File
20763 *" Fcntl "*"_File "*" IO "*) ;; # GDBM_File
20764 *" Fcntl "*" IO "*"_File "*) ;; # NDBM_File
20765 *) echo "WARNING: Extensions DB_File or *DBM_File, Fcntl, and IO not configured." >&4
20766 echo "WARNING: The Perl you are building will be quite crippled." >& 4
20770 : Remove libraries needed only for extensions
20771 : The appropriate ext/Foo/Makefile.PL will add them back in, if necessary.
20772 : The exception is SunOS 4.x, which needs them.
20773 case "${osname}X${osvers}" in
20777 *) case "$usedl" in
20778 $define|true|[yY]*)
20779 set X `echo " $libs " | sed -e 's@ -lndbm @ @' -e 's@ -lgdbm @ @' -e 's@ -ldbm @ @' -e 's@ -ldb @ @'`
20783 *) perllibs="$libs"
20789 : Remove build directory name from cppstdin so it can be used from
20790 : either the present location or the final installed location.
20792 : Get out of the UU directory to get correct path name.
20794 case "$cppstdin" in
20796 echo "Stripping down cppstdin path name"
20802 : end of configuration questions
20804 echo "End of configuration questions."
20807 : back to where it started
20808 if test -d ../UU; then
20812 : configuration may be patched via a 'config.arch' file
20813 if $test -f config.arch; then
20814 echo "I see a config.arch file, loading it."
20818 : configuration may be patched via a 'config.over' file
20819 if $test -f config.over; then
20822 rp='I see a config.over file. Do you wish to load it?'
20825 n*) echo "OK, I'll ignore it.";;
20827 echo "Configuration override changes have been loaded."
20832 : in case they want portability, strip down executable paths
20833 case "$d_portable" in
20836 echo "Stripping down executable paths..." >&4
20837 for file in $loclist $trylist; do
20839 eval $file=`basename $temp`
20844 : create config.sh file
20846 echo "Creating config.sh..." >&4
20847 $spitshell <<EOT >config.sh
20850 # This file was produced by running the Configure script. It holds all the
20851 # definitions figured out by Configure. Should you modify one of these values,
20852 # do not forget to propagate your changes by running "Configure -der". You may
20853 # instead choose to run each of the .SH files by yourself, or "Configure -S".
20856 # Package name : $package
20857 # Source directory : $src
20858 # Configuration time: $cf_time
20859 # Configured by : $cf_by
20860 # Target system : $myuname
20870 Revision='$Revision'
20878 alignbytes='$alignbytes'
20879 ansi2knr='$ansi2knr'
20880 aphostname='$aphostname'
20881 api_revision='$api_revision'
20882 api_subversion='$api_subversion'
20883 api_version='$api_version'
20884 api_versionstring='$api_versionstring'
20887 archlibexp='$archlibexp'
20888 archname64='$archname64'
20889 archname='$archname'
20890 archobjs='$archobjs'
20891 asctime_r_proto='$asctime_r_proto'
20899 byteorder='$byteorder'
20901 castflags='$castflags'
20904 cccdlflags='$cccdlflags'
20905 ccdlflags='$ccdlflags'
20907 ccflags_uselargefiles='$ccflags_uselargefiles'
20909 ccsymbols='$ccsymbols'
20910 ccversion='$ccversion'
20912 cf_email='$cf_email'
20914 charsize='$charsize'
20918 clocktype='$clocktype'
20920 compress='$compress'
20921 contains='$contains'
20925 cpp_stuff='$cpp_stuff'
20926 cppccsymbols='$cppccsymbols'
20927 cppflags='$cppflags'
20929 cppminus='$cppminus'
20931 cppstdin='$cppstdin'
20932 cppsymbols='$cppsymbols'
20933 crypt_r_proto='$crypt_r_proto'
20934 cryptlib='$cryptlib'
20936 ctermid_r_proto='$ctermid_r_proto'
20937 ctime_r_proto='$ctime_r_proto'
20938 d_Gconvert='$d_Gconvert'
20939 d_PRIEUldbl='$d_PRIEUldbl'
20940 d_PRIFUldbl='$d_PRIFUldbl'
20941 d_PRIGUldbl='$d_PRIGUldbl'
20942 d_PRIXU64='$d_PRIXU64'
20943 d_PRId64='$d_PRId64'
20944 d_PRIeldbl='$d_PRIeldbl'
20945 d_PRIfldbl='$d_PRIfldbl'
20946 d_PRIgldbl='$d_PRIgldbl'
20947 d_PRIi64='$d_PRIi64'
20948 d_PRIo64='$d_PRIo64'
20949 d_PRIu64='$d_PRIu64'
20950 d_PRIx64='$d_PRIx64'
20951 d_SCNfldbl='$d_SCNfldbl'
20952 d__fwalk='$d__fwalk'
20953 d_access='$d_access'
20954 d_accessx='$d_accessx'
20957 d_archlib='$d_archlib'
20958 d_asctime_r='$d_asctime_r'
20961 d_attribute_format='$d_attribute_format'
20962 d_attribute_malloc='$d_attribute_malloc'
20963 d_attribute_nonnull='$d_attribute_nonnull'
20964 d_attribute_noreturn='$d_attribute_noreturn'
20965 d_attribute_pure='$d_attribute_pure'
20966 d_attribute_unused='$d_attribute_unused'
20967 d_attribute_warn_unused_result='$d_attribute_warn_unused_result'
20971 d_bsdgetpgrp='$d_bsdgetpgrp'
20972 d_bsdsetpgrp='$d_bsdsetpgrp'
20974 d_casti32='$d_casti32'
20975 d_castneg='$d_castneg'
20976 d_charvspr='$d_charvspr'
20978 d_chroot='$d_chroot'
20979 d_chsize='$d_chsize'
20981 d_closedir='$d_closedir'
20982 d_cmsghdr_s='$d_cmsghdr_s'
20984 d_copysignl='$d_copysignl'
20986 d_crypt_r='$d_crypt_r'
20988 d_ctermid_r='$d_ctermid_r'
20989 d_ctime_r='$d_ctime_r'
20990 d_cuserid='$d_cuserid'
20991 d_dbl_dig='$d_dbl_dig'
20992 d_dbminitproto='$d_dbminitproto'
20993 d_difftime='$d_difftime'
20995 d_dirnamlen='$d_dirnamlen'
20996 d_dlerror='$d_dlerror'
20997 d_dlopen='$d_dlopen'
20998 d_dlsymun='$d_dlsymun'
20999 d_dosuid='$d_dosuid'
21000 d_drand48_r='$d_drand48_r'
21001 d_drand48proto='$d_drand48proto'
21003 d_eaccess='$d_eaccess'
21004 d_endgrent='$d_endgrent'
21005 d_endgrent_r='$d_endgrent_r'
21006 d_endhent='$d_endhent'
21007 d_endhostent_r='$d_endhostent_r'
21008 d_endnent='$d_endnent'
21009 d_endnetent_r='$d_endnetent_r'
21010 d_endpent='$d_endpent'
21011 d_endprotoent_r='$d_endprotoent_r'
21012 d_endpwent='$d_endpwent'
21013 d_endpwent_r='$d_endpwent_r'
21014 d_endsent='$d_endsent'
21015 d_endservent_r='$d_endservent_r'
21016 d_eofnblk='$d_eofnblk'
21017 d_eunice='$d_eunice'
21018 d_faststdio='$d_faststdio'
21019 d_fchdir='$d_fchdir'
21020 d_fchmod='$d_fchmod'
21021 d_fchown='$d_fchown'
21023 d_fcntl_can_lock='$d_fcntl_can_lock'
21024 d_fd_macros='$d_fd_macros'
21025 d_fd_set='$d_fd_set'
21026 d_fds_bits='$d_fds_bits'
21027 d_fgetpos='$d_fgetpos'
21028 d_finite='$d_finite'
21029 d_finitel='$d_finitel'
21030 d_flexfnam='$d_flexfnam'
21032 d_flockproto='$d_flockproto'
21034 d_fp_class='$d_fp_class'
21035 d_fpathconf='$d_fpathconf'
21036 d_fpclass='$d_fpclass'
21037 d_fpclassify='$d_fpclassify'
21038 d_fpclassl='$d_fpclassl'
21039 d_fpos64_t='$d_fpos64_t'
21040 d_frexpl='$d_frexpl'
21041 d_fs_data_s='$d_fs_data_s'
21042 d_fseeko='$d_fseeko'
21043 d_fsetpos='$d_fsetpos'
21044 d_fstatfs='$d_fstatfs'
21045 d_fstatvfs='$d_fstatvfs'
21047 d_ftello='$d_ftello'
21049 d_getcwd='$d_getcwd'
21050 d_getespwnam='$d_getespwnam'
21051 d_getfsstat='$d_getfsstat'
21052 d_getgrent='$d_getgrent'
21053 d_getgrent_r='$d_getgrent_r'
21054 d_getgrgid_r='$d_getgrgid_r'
21055 d_getgrnam_r='$d_getgrnam_r'
21056 d_getgrps='$d_getgrps'
21057 d_gethbyaddr='$d_gethbyaddr'
21058 d_gethbyname='$d_gethbyname'
21059 d_gethent='$d_gethent'
21060 d_gethname='$d_gethname'
21061 d_gethostbyaddr_r='$d_gethostbyaddr_r'
21062 d_gethostbyname_r='$d_gethostbyname_r'
21063 d_gethostent_r='$d_gethostent_r'
21064 d_gethostprotos='$d_gethostprotos'
21065 d_getitimer='$d_getitimer'
21066 d_getlogin='$d_getlogin'
21067 d_getlogin_r='$d_getlogin_r'
21068 d_getmnt='$d_getmnt'
21069 d_getmntent='$d_getmntent'
21070 d_getnbyaddr='$d_getnbyaddr'
21071 d_getnbyname='$d_getnbyname'
21072 d_getnent='$d_getnent'
21073 d_getnetbyaddr_r='$d_getnetbyaddr_r'
21074 d_getnetbyname_r='$d_getnetbyname_r'
21075 d_getnetent_r='$d_getnetent_r'
21076 d_getnetprotos='$d_getnetprotos'
21077 d_getpagsz='$d_getpagsz'
21078 d_getpbyname='$d_getpbyname'
21079 d_getpbynumber='$d_getpbynumber'
21080 d_getpent='$d_getpent'
21081 d_getpgid='$d_getpgid'
21082 d_getpgrp2='$d_getpgrp2'
21083 d_getpgrp='$d_getpgrp'
21084 d_getppid='$d_getppid'
21085 d_getprior='$d_getprior'
21086 d_getprotobyname_r='$d_getprotobyname_r'
21087 d_getprotobynumber_r='$d_getprotobynumber_r'
21088 d_getprotoent_r='$d_getprotoent_r'
21089 d_getprotoprotos='$d_getprotoprotos'
21090 d_getprpwnam='$d_getprpwnam'
21091 d_getpwent='$d_getpwent'
21092 d_getpwent_r='$d_getpwent_r'
21093 d_getpwnam_r='$d_getpwnam_r'
21094 d_getpwuid_r='$d_getpwuid_r'
21095 d_getsbyname='$d_getsbyname'
21096 d_getsbyport='$d_getsbyport'
21097 d_getsent='$d_getsent'
21098 d_getservbyname_r='$d_getservbyname_r'
21099 d_getservbyport_r='$d_getservbyport_r'
21100 d_getservent_r='$d_getservent_r'
21101 d_getservprotos='$d_getservprotos'
21102 d_getspnam='$d_getspnam'
21103 d_getspnam_r='$d_getspnam_r'
21104 d_gettimeod='$d_gettimeod'
21105 d_gmtime_r='$d_gmtime_r'
21106 d_gnulibc='$d_gnulibc'
21107 d_grpasswd='$d_grpasswd'
21108 d_hasmntopt='$d_hasmntopt'
21110 d_ilogbl='$d_ilogbl'
21112 d_inetaton='$d_inetaton'
21113 d_int64_t='$d_int64_t'
21114 d_isascii='$d_isascii'
21115 d_isfinite='$d_isfinite'
21118 d_isnanl='$d_isnanl'
21119 d_killpg='$d_killpg'
21120 d_lchown='$d_lchown'
21121 d_ldbl_dig='$d_ldbl_dig'
21122 d_libm_lib_version='$d_libm_lib_version'
21124 d_localtime_r='$d_localtime_r'
21125 d_locconv='$d_locconv'
21127 d_longdbl='$d_longdbl'
21128 d_longlong='$d_longlong'
21129 d_lseekproto='$d_lseekproto'
21131 d_madvise='$d_madvise'
21132 d_malloc_good_size='$d_malloc_good_size'
21133 d_malloc_size='$d_malloc_size'
21135 d_mbstowcs='$d_mbstowcs'
21136 d_mbtowc='$d_mbtowc'
21137 d_memchr='$d_memchr'
21138 d_memcmp='$d_memcmp'
21139 d_memcpy='$d_memcpy'
21140 d_memmove='$d_memmove'
21141 d_memset='$d_memset'
21143 d_mkdtemp='$d_mkdtemp'
21144 d_mkfifo='$d_mkfifo'
21145 d_mkstemp='$d_mkstemp'
21146 d_mkstemps='$d_mkstemps'
21147 d_mktime='$d_mktime'
21150 d_modfl_pow32_bug='$d_modfl_pow32_bug'
21151 d_modflproto='$d_modflproto'
21152 d_mprotect='$d_mprotect'
21154 d_msg_ctrunc='$d_msg_ctrunc'
21155 d_msg_dontroute='$d_msg_dontroute'
21156 d_msg_oob='$d_msg_oob'
21157 d_msg_peek='$d_msg_peek'
21158 d_msg_proxy='$d_msg_proxy'
21159 d_msgctl='$d_msgctl'
21160 d_msgget='$d_msgget'
21161 d_msghdr_s='$d_msghdr_s'
21162 d_msgrcv='$d_msgrcv'
21163 d_msgsnd='$d_msgsnd'
21165 d_munmap='$d_munmap'
21166 d_mymalloc='$d_mymalloc'
21168 d_nl_langinfo='$d_nl_langinfo'
21169 d_nv_preserves_uv='$d_nv_preserves_uv'
21170 d_nv_zero_is_allbits_zero='$d_nv_zero_is_allbits_zero'
21171 d_off64_t='$d_off64_t'
21172 d_old_pthread_create_joinable='$d_old_pthread_create_joinable'
21173 d_oldpthreads='$d_oldpthreads'
21174 d_oldsock='$d_oldsock'
21176 d_pathconf='$d_pathconf'
21178 d_perl_otherlibdirs='$d_perl_otherlibdirs'
21179 d_phostname='$d_phostname'
21182 d_portable='$d_portable'
21183 d_procselfexe='$d_procselfexe'
21184 d_pthread_atfork='$d_pthread_atfork'
21185 d_pthread_attr_setscope='$d_pthread_attr_setscope'
21186 d_pthread_yield='$d_pthread_yield'
21188 d_pwchange='$d_pwchange'
21189 d_pwclass='$d_pwclass'
21190 d_pwcomment='$d_pwcomment'
21191 d_pwexpire='$d_pwexpire'
21192 d_pwgecos='$d_pwgecos'
21193 d_pwpasswd='$d_pwpasswd'
21194 d_pwquota='$d_pwquota'
21197 d_random_r='$d_random_r'
21198 d_readdir64_r='$d_readdir64_r'
21199 d_readdir='$d_readdir'
21200 d_readdir_r='$d_readdir_r'
21201 d_readlink='$d_readlink'
21203 d_recvmsg='$d_recvmsg'
21204 d_rename='$d_rename'
21205 d_rewinddir='$d_rewinddir'
21207 d_safebcpy='$d_safebcpy'
21208 d_safemcpy='$d_safemcpy'
21209 d_sanemcmp='$d_sanemcmp'
21210 d_sbrkproto='$d_sbrkproto'
21211 d_scalbnl='$d_scalbnl'
21212 d_sched_yield='$d_sched_yield'
21213 d_scm_rights='$d_scm_rights'
21214 d_seekdir='$d_seekdir'
21215 d_select='$d_select'
21217 d_semctl='$d_semctl'
21218 d_semctl_semid_ds='$d_semctl_semid_ds'
21219 d_semctl_semun='$d_semctl_semun'
21220 d_semget='$d_semget'
21222 d_sendmsg='$d_sendmsg'
21223 d_setegid='$d_setegid'
21224 d_seteuid='$d_seteuid'
21225 d_setgrent='$d_setgrent'
21226 d_setgrent_r='$d_setgrent_r'
21227 d_setgrps='$d_setgrps'
21228 d_sethent='$d_sethent'
21229 d_sethostent_r='$d_sethostent_r'
21230 d_setitimer='$d_setitimer'
21231 d_setlinebuf='$d_setlinebuf'
21232 d_setlocale='$d_setlocale'
21233 d_setlocale_r='$d_setlocale_r'
21234 d_setnent='$d_setnent'
21235 d_setnetent_r='$d_setnetent_r'
21236 d_setpent='$d_setpent'
21237 d_setpgid='$d_setpgid'
21238 d_setpgrp2='$d_setpgrp2'
21239 d_setpgrp='$d_setpgrp'
21240 d_setprior='$d_setprior'
21241 d_setproctitle='$d_setproctitle'
21242 d_setprotoent_r='$d_setprotoent_r'
21243 d_setpwent='$d_setpwent'
21244 d_setpwent_r='$d_setpwent_r'
21245 d_setregid='$d_setregid'
21246 d_setresgid='$d_setresgid'
21247 d_setresuid='$d_setresuid'
21248 d_setreuid='$d_setreuid'
21249 d_setrgid='$d_setrgid'
21250 d_setruid='$d_setruid'
21251 d_setsent='$d_setsent'
21252 d_setservent_r='$d_setservent_r'
21253 d_setsid='$d_setsid'
21254 d_setvbuf='$d_setvbuf'
21258 d_shmatprototype='$d_shmatprototype'
21259 d_shmctl='$d_shmctl'
21261 d_shmget='$d_shmget'
21262 d_sigaction='$d_sigaction'
21263 d_sigprocmask='$d_sigprocmask'
21264 d_sigsetjmp='$d_sigsetjmp'
21265 d_sockatmark='$d_sockatmark'
21266 d_sockatmarkproto='$d_sockatmarkproto'
21267 d_socket='$d_socket'
21268 d_socklen_t='$d_socklen_t'
21269 d_sockpair='$d_sockpair'
21270 d_socks5_init='$d_socks5_init'
21272 d_srand48_r='$d_srand48_r'
21273 d_srandom_r='$d_srandom_r'
21274 d_sresgproto='$d_sresgproto'
21275 d_sresuproto='$d_sresuproto'
21276 d_statblks='$d_statblks'
21277 d_statfs_f_flags='$d_statfs_f_flags'
21278 d_statfs_s='$d_statfs_s'
21279 d_statvfs='$d_statvfs'
21280 d_stdio_cnt_lval='$d_stdio_cnt_lval'
21281 d_stdio_ptr_lval='$d_stdio_ptr_lval'
21282 d_stdio_ptr_lval_nochange_cnt='$d_stdio_ptr_lval_nochange_cnt'
21283 d_stdio_ptr_lval_sets_cnt='$d_stdio_ptr_lval_sets_cnt'
21284 d_stdio_stream_array='$d_stdio_stream_array'
21285 d_stdiobase='$d_stdiobase'
21286 d_stdstdio='$d_stdstdio'
21287 d_strchr='$d_strchr'
21288 d_strcoll='$d_strcoll'
21289 d_strctcpy='$d_strctcpy'
21290 d_strerrm='$d_strerrm'
21291 d_strerror='$d_strerror'
21292 d_strerror_r='$d_strerror_r'
21293 d_strftime='$d_strftime'
21294 d_strlcat='$d_strlcat'
21295 d_strlcpy='$d_strlcpy'
21296 d_strtod='$d_strtod'
21297 d_strtol='$d_strtol'
21298 d_strtold='$d_strtold'
21299 d_strtoll='$d_strtoll'
21300 d_strtoq='$d_strtoq'
21301 d_strtoul='$d_strtoul'
21302 d_strtoull='$d_strtoull'
21303 d_strtouq='$d_strtouq'
21304 d_strxfrm='$d_strxfrm'
21305 d_suidsafe='$d_suidsafe'
21306 d_symlink='$d_symlink'
21307 d_syscall='$d_syscall'
21308 d_syscallproto='$d_syscallproto'
21309 d_sysconf='$d_sysconf'
21310 d_sysernlst='$d_sysernlst'
21311 d_syserrlst='$d_syserrlst'
21312 d_system='$d_system'
21313 d_tcgetpgrp='$d_tcgetpgrp'
21314 d_tcsetpgrp='$d_tcsetpgrp'
21315 d_telldir='$d_telldir'
21316 d_telldirproto='$d_telldirproto'
21319 d_tm_tm_gmtoff='$d_tm_tm_gmtoff'
21320 d_tm_tm_zone='$d_tm_tm_zone'
21321 d_tmpnam_r='$d_tmpnam_r'
21322 d_truncate='$d_truncate'
21323 d_ttyname_r='$d_ttyname_r'
21324 d_tzname='$d_tzname'
21325 d_u32align='$d_u32align'
21326 d_ualarm='$d_ualarm'
21329 d_union_semun='$d_union_semun'
21330 d_unordered='$d_unordered'
21331 d_unsetenv='$d_unsetenv'
21332 d_usleep='$d_usleep'
21333 d_usleepproto='$d_usleepproto'
21335 d_vendorarch='$d_vendorarch'
21336 d_vendorbin='$d_vendorbin'
21337 d_vendorlib='$d_vendorlib'
21338 d_vendorscript='$d_vendorscript'
21340 d_void_closedir='$d_void_closedir'
21341 d_voidsig='$d_voidsig'
21342 d_voidtty='$d_voidtty'
21343 d_volatile='$d_volatile'
21344 d_vprintf='$d_vprintf'
21346 d_waitpid='$d_waitpid'
21347 d_wcstombs='$d_wcstombs'
21348 d_wctomb='$d_wctomb'
21349 d_writev='$d_writev'
21352 db_hashtype='$db_hashtype'
21353 db_prefixtype='$db_prefixtype'
21354 db_version_major='$db_version_major'
21355 db_version_minor='$db_version_minor'
21356 db_version_patch='$db_version_patch'
21357 defvoidused='$defvoidused'
21358 direntrytype='$direntrytype'
21361 doublesize='$doublesize'
21363 drand48_r_proto='$drand48_r_proto'
21364 dynamic_ext='$dynamic_ext'
21370 endgrent_r_proto='$endgrent_r_proto'
21371 endhostent_r_proto='$endhostent_r_proto'
21372 endnetent_r_proto='$endnetent_r_proto'
21373 endprotoent_r_proto='$endprotoent_r_proto'
21374 endpwent_r_proto='$endpwent_r_proto'
21375 endservent_r_proto='$endservent_r_proto'
21376 eunicefix='$eunicefix'
21379 extensions='$extensions'
21381 fflushNULL='$fflushNULL'
21382 fflushall='$fflushall'
21384 firstmakefile='$firstmakefile'
21386 fpossize='$fpossize'
21387 fpostype='$fpostype'
21388 freetype='$freetype'
21391 full_csh='$full_csh'
21392 full_sed='$full_sed'
21393 gccansipedantic='$gccansipedantic'
21394 gccosandvers='$gccosandvers'
21395 gccversion='$gccversion'
21396 getgrent_r_proto='$getgrent_r_proto'
21397 getgrgid_r_proto='$getgrgid_r_proto'
21398 getgrnam_r_proto='$getgrnam_r_proto'
21399 gethostbyaddr_r_proto='$gethostbyaddr_r_proto'
21400 gethostbyname_r_proto='$gethostbyname_r_proto'
21401 gethostent_r_proto='$gethostent_r_proto'
21402 getlogin_r_proto='$getlogin_r_proto'
21403 getnetbyaddr_r_proto='$getnetbyaddr_r_proto'
21404 getnetbyname_r_proto='$getnetbyname_r_proto'
21405 getnetent_r_proto='$getnetent_r_proto'
21406 getprotobyname_r_proto='$getprotobyname_r_proto'
21407 getprotobynumber_r_proto='$getprotobynumber_r_proto'
21408 getprotoent_r_proto='$getprotoent_r_proto'
21409 getpwent_r_proto='$getpwent_r_proto'
21410 getpwnam_r_proto='$getpwnam_r_proto'
21411 getpwuid_r_proto='$getpwuid_r_proto'
21412 getservbyname_r_proto='$getservbyname_r_proto'
21413 getservbyport_r_proto='$getservbyport_r_proto'
21414 getservent_r_proto='$getservent_r_proto'
21415 getspnam_r_proto='$getspnam_r_proto'
21416 gidformat='$gidformat'
21422 gmtime_r_proto='$gmtime_r_proto'
21423 gnulibc_version='$gnulibc_version'
21425 groupcat='$groupcat'
21426 groupstype='$groupstype'
21429 h_sysfile='$h_sysfile'
21432 html1dir='$html1dir'
21433 html1direxp='$html1direxp'
21434 html3dir='$html3dir'
21435 html3direxp='$html3direxp'
21444 i_arpainet='$i_arpainet'
21445 i_bsdioctl='$i_bsdioctl'
21449 i_dirent='$i_dirent'
21455 i_fp_class='$i_fp_class'
21458 i_ieeefp='$i_ieeefp'
21459 i_inttypes='$i_inttypes'
21460 i_langinfo='$i_langinfo'
21461 i_libutil='$i_libutil'
21462 i_limits='$i_limits'
21463 i_locale='$i_locale'
21464 i_machcthr='$i_machcthr'
21465 i_malloc='$i_malloc'
21467 i_memory='$i_memory'
21468 i_mntent='$i_mntent'
21471 i_neterrno='$i_neterrno'
21472 i_netinettcp='$i_netinettcp'
21476 i_pthread='$i_pthread'
21478 i_rpcsvcdbm='$i_rpcsvcdbm'
21481 i_shadow='$i_shadow'
21483 i_stdarg='$i_stdarg'
21484 i_stddef='$i_stddef'
21485 i_stdlib='$i_stdlib'
21486 i_string='$i_string'
21487 i_sunmath='$i_sunmath'
21488 i_sysaccess='$i_sysaccess'
21489 i_sysdir='$i_sysdir'
21490 i_sysfile='$i_sysfile'
21491 i_sysfilio='$i_sysfilio'
21493 i_sysioctl='$i_sysioctl'
21494 i_syslog='$i_syslog'
21495 i_sysmman='$i_sysmman'
21496 i_sysmode='$i_sysmode'
21497 i_sysmount='$i_sysmount'
21498 i_sysndir='$i_sysndir'
21499 i_sysparam='$i_sysparam'
21500 i_sysresrc='$i_sysresrc'
21501 i_syssecrt='$i_syssecrt'
21502 i_sysselct='$i_sysselct'
21503 i_syssockio='$i_syssockio'
21504 i_sysstat='$i_sysstat'
21505 i_sysstatfs='$i_sysstatfs'
21506 i_sysstatvfs='$i_sysstatvfs'
21507 i_systime='$i_systime'
21508 i_systimek='$i_systimek'
21509 i_systimes='$i_systimes'
21510 i_systypes='$i_systypes'
21511 i_sysuio='$i_sysuio'
21513 i_sysutsname='$i_sysutsname'
21514 i_sysvfs='$i_sysvfs'
21515 i_syswait='$i_syswait'
21516 i_termio='$i_termio'
21517 i_termios='$i_termios'
21519 i_unistd='$i_unistd'
21522 i_values='$i_values'
21523 i_varargs='$i_varargs'
21524 i_varhdr='$i_varhdr'
21526 ignore_versioned_solibs='$ignore_versioned_solibs'
21527 inc_version_list='$inc_version_list'
21528 inc_version_list_init='$inc_version_list_init'
21531 installarchlib='$installarchlib'
21532 installbin='$installbin'
21533 installhtml1dir='$installhtml1dir'
21534 installhtml3dir='$installhtml3dir'
21535 installman1dir='$installman1dir'
21536 installman3dir='$installman3dir'
21537 installprefix='$installprefix'
21538 installprefixexp='$installprefixexp'
21539 installprivlib='$installprivlib'
21540 installscript='$installscript'
21541 installsitearch='$installsitearch'
21542 installsitebin='$installsitebin'
21543 installsitehtml1dir='$installsitehtml1dir'
21544 installsitehtml3dir='$installsitehtml3dir'
21545 installsitelib='$installsitelib'
21546 installsiteman1dir='$installsiteman1dir'
21547 installsiteman3dir='$installsiteman3dir'
21548 installsitescript='$installsitescript'
21549 installstyle='$installstyle'
21550 installusrbinperl='$installusrbinperl'
21551 installvendorarch='$installvendorarch'
21552 installvendorbin='$installvendorbin'
21553 installvendorhtml1dir='$installvendorhtml1dir'
21554 installvendorhtml3dir='$installvendorhtml3dir'
21555 installvendorlib='$installvendorlib'
21556 installvendorman1dir='$installvendorman1dir'
21557 installvendorman3dir='$installvendorman3dir'
21558 installvendorscript='$installvendorscript'
21560 issymlink='$issymlink'
21561 ivdformat='$ivdformat'
21564 known_extensions='$known_extensions'
21567 lddlflags='$lddlflags'
21569 ldflags_uselargefiles='$ldflags_uselargefiles'
21570 ldlibpthname='$ldlibpthname'
21577 libsdirs='$libsdirs'
21578 libsfiles='$libsfiles'
21579 libsfound='$libsfound'
21580 libspath='$libspath'
21581 libswanted='$libswanted'
21582 libswanted_uselargefiles='$libswanted_uselargefiles'
21588 localtime_r_proto='$localtime_r_proto'
21589 locincpth='$locincpth'
21590 loclibpth='$loclibpth'
21591 longdblsize='$longdblsize'
21592 longlongsize='$longlongsize'
21593 longsize='$longsize'
21597 lseeksize='$lseeksize'
21598 lseektype='$lseektype'
21602 make_set_make='$make_set_make'
21603 mallocobj='$mallocobj'
21604 mallocsrc='$mallocsrc'
21605 malloctype='$malloctype'
21607 man1direxp='$man1direxp'
21610 man3direxp='$man3direxp'
21612 mips_type='$mips_type'
21613 mistrustnm='$mistrustnm'
21615 mmaptype='$mmaptype'
21616 modetype='$modetype'
21618 multiarch='$multiarch'
21620 myarchname='$myarchname'
21621 mydomain='$mydomain'
21622 myhostname='$myhostname'
21625 need_va_copy='$need_va_copy'
21626 netdb_hlen_type='$netdb_hlen_type'
21627 netdb_host_type='$netdb_host_type'
21628 netdb_name_type='$netdb_name_type'
21629 netdb_net_type='$netdb_net_type'
21632 nm_so_opt='$nm_so_opt'
21633 nonxs_ext='$nonxs_ext'
21635 nvEUformat='$nvEUformat'
21636 nvFUformat='$nvFUformat'
21637 nvGUformat='$nvGUformat'
21638 nv_preserves_uv_bits='$nv_preserves_uv_bits'
21639 nveformat='$nveformat'
21640 nvfformat='$nvfformat'
21641 nvgformat='$nvgformat'
21644 o_nonblock='$o_nonblock'
21646 old_pthread_create_joinable='$old_pthread_create_joinable'
21647 optimize='$optimize'
21648 orderlib='$orderlib'
21651 otherlibdirs='$otherlibdirs'
21655 patchlevel='$patchlevel'
21656 path_sep='$path_sep'
21659 perl_patchlevel='$perl_patchlevel'
21660 perladmin='$perladmin'
21661 perllibs='$perllibs'
21662 perlpath='$perlpath'
21664 phostname='$phostname'
21670 prefixexp='$prefixexp'
21672 privlibexp='$privlibexp'
21673 procselfexe='$procselfexe'
21674 prototype='$prototype'
21676 quadkind='$quadkind'
21677 quadtype='$quadtype'
21678 randbits='$randbits'
21679 randfunc='$randfunc'
21680 random_r_proto='$random_r_proto'
21681 randseedtype='$randseedtype'
21683 rd_nodata='$rd_nodata'
21684 readdir64_r_proto='$readdir64_r_proto'
21685 readdir_r_proto='$readdir_r_proto'
21686 revision='$revision'
21691 sPRIEUldbl='$sPRIEUldbl'
21692 sPRIFUldbl='$sPRIFUldbl'
21693 sPRIGUldbl='$sPRIGUldbl'
21694 sPRIXU64='$sPRIXU64'
21696 sPRIeldbl='$sPRIeldbl'
21697 sPRIfldbl='$sPRIfldbl'
21698 sPRIgldbl='$sPRIgldbl'
21703 sSCNfldbl='$sSCNfldbl'
21704 sched_yield='$sched_yield'
21705 scriptdir='$scriptdir'
21706 scriptdirexp='$scriptdirexp'
21708 seedfunc='$seedfunc'
21709 selectminbits='$selectminbits'
21710 selecttype='$selecttype'
21711 sendmail='$sendmail'
21712 setgrent_r_proto='$setgrent_r_proto'
21713 sethostent_r_proto='$sethostent_r_proto'
21714 setlocale_r_proto='$setlocale_r_proto'
21715 setnetent_r_proto='$setnetent_r_proto'
21716 setprotoent_r_proto='$setprotoent_r_proto'
21717 setpwent_r_proto='$setpwent_r_proto'
21718 setservent_r_proto='$setservent_r_proto'
21721 sharpbang='$sharpbang'
21722 shmattype='$shmattype'
21723 shortsize='$shortsize'
21726 sig_count='$sig_count'
21727 sig_name='$sig_name'
21728 sig_name_init='$sig_name_init'
21730 sig_num_init='$sig_num_init'
21731 sig_size='$sig_size'
21732 signal_t='$signal_t'
21733 sitearch='$sitearch'
21734 sitearchexp='$sitearchexp'
21736 sitebinexp='$sitebinexp'
21737 sitehtml1dir='$sitehtml1dir'
21738 sitehtml1direxp='$sitehtml1direxp'
21739 sitehtml3dir='$sitehtml3dir'
21740 sitehtml3direxp='$sitehtml3direxp'
21742 sitelib_stem='$sitelib_stem'
21743 sitelibexp='$sitelibexp'
21744 siteman1dir='$siteman1dir'
21745 siteman1direxp='$siteman1direxp'
21746 siteman3dir='$siteman3dir'
21747 siteman3direxp='$siteman3direxp'
21748 siteprefix='$siteprefix'
21749 siteprefixexp='$siteprefixexp'
21750 sitescript='$sitescript'
21751 sitescriptexp='$sitescriptexp'
21752 sizesize='$sizesize'
21753 sizetype='$sizetype'
21757 sockethdr='$sockethdr'
21758 socketlib='$socketlib'
21759 socksizetype='$socksizetype'
21761 spackage='$spackage'
21762 spitshell='$spitshell'
21763 srand48_r_proto='$srand48_r_proto'
21764 srandom_r_proto='$srandom_r_proto'
21766 ssizetype='$ssizetype'
21767 startperl='$startperl'
21769 static_ext='$static_ext'
21771 stdio_base='$stdio_base'
21772 stdio_bufsiz='$stdio_bufsiz'
21773 stdio_cnt='$stdio_cnt'
21774 stdio_filbuf='$stdio_filbuf'
21775 stdio_ptr='$stdio_ptr'
21776 stdio_stream_array='$stdio_stream_array'
21777 strerror_r_proto='$strerror_r_proto'
21780 subversion='$subversion'
21784 targetarch='$targetarch'
21788 timeincl='$timeincl'
21789 timetype='$timetype'
21790 tmpnam_r_proto='$tmpnam_r_proto'
21796 ttyname_r_proto='$ttyname_r_proto'
21805 uidformat='$uidformat'
21811 uquadtype='$uquadtype'
21812 use5005threads='$use5005threads'
21813 use64bitall='$use64bitall'
21814 use64bitint='$use64bitint'
21815 usecrosscompile='$usecrosscompile'
21817 usefaststdio='$usefaststdio'
21818 useithreads='$useithreads'
21819 uselargefiles='$uselargefiles'
21820 uselongdouble='$uselongdouble'
21821 usemallocwrap='$usemallocwrap'
21822 usemorebits='$usemorebits'
21823 usemultiplicity='$usemultiplicity'
21824 usemymalloc='$usemymalloc'
21826 useopcode='$useopcode'
21827 useperlio='$useperlio'
21828 useposix='$useposix'
21829 usereentrant='$usereentrant'
21830 userelocatableinc='$userelocatableinc'
21832 useshrplib='$useshrplib'
21833 usesitecustomize='$usesitecustomize'
21834 usesocks='$usesocks'
21835 usethreads='$usethreads'
21836 usevendorprefix='$usevendorprefix'
21837 usevfork='$usevfork'
21840 uvXUformat='$uvXUformat'
21841 uvoformat='$uvoformat'
21844 uvuformat='$uvuformat'
21845 uvxformat='$uvxformat'
21846 vendorarch='$vendorarch'
21847 vendorarchexp='$vendorarchexp'
21848 vendorbin='$vendorbin'
21849 vendorbinexp='$vendorbinexp'
21850 vendorhtml1dir='$vendorhtml1dir'
21851 vendorhtml1direxp='$vendorhtml1direxp'
21852 vendorhtml3dir='$vendorhtml3dir'
21853 vendorhtml3direxp='$vendorhtml3direxp'
21854 vendorlib='$vendorlib'
21855 vendorlib_stem='$vendorlib_stem'
21856 vendorlibexp='$vendorlibexp'
21857 vendorman1dir='$vendorman1dir'
21858 vendorman1direxp='$vendorman1direxp'
21859 vendorman3dir='$vendorman3dir'
21860 vendorman3direxp='$vendorman3direxp'
21861 vendorprefix='$vendorprefix'
21862 vendorprefixexp='$vendorprefixexp'
21863 vendorscript='$vendorscript'
21864 vendorscriptexp='$vendorscriptexp'
21866 version_patchlevel_string='$version_patchlevel_string'
21867 versiononly='$versiononly'
21869 voidflags='$voidflags'
21872 yaccflags='$yaccflags'
21877 : Add in command line options if available
21878 $test -f UU/cmdline.opt && $cat UU/cmdline.opt >> config.sh
21880 : add special variables
21881 $test -f $src/patchlevel.h && \
21882 awk '/^#define[ ]+PERL_/ {printf "%s=%s\n",$2,$3}' $src/patchlevel.h >>config.sh
21883 echo "PERL_PATCHLEVEL=$perl_patchlevel" >>config.sh
21884 echo "PERL_CONFIG_SH=true" >>config.sh
21886 : propagate old symbols
21887 if $test -f UU/config.sh; then
21888 <UU/config.sh $sort | $uniq >UU/oldconfig.sh
21889 sed -n 's/^\([a-zA-Z_0-9]*\)=.*/\1/p' config.sh config.sh UU/oldconfig.sh |\
21890 $sort | $uniq -u >UU/oldsyms
21891 set X `cat UU/oldsyms`
21897 Hmm...You had some extra variables I don't know about...I'll try to keep 'em...
21899 echo "# Variables propagated from previous config.sh file." >>config.sh
21900 for sym in `cat UU/oldsyms`; do
21901 echo " Propagating $hint variable "'$'"$sym..."
21902 eval 'tmp="$'"${sym}"'"'
21904 sed -e "s/'/'\"'\"'/g" -e "s/^/$sym='/" -e "s/$/'/" >>config.sh
21910 : Finish up by extracting the .SH files
21914 echo "Extraction done."
21924 If you'd like to make any changes to the config.sh file before I begin
21925 to configure things, do it as a shell escape now (e.g. !vi config.sh).
21928 rp="Press return or use a shell escape to edit config.sh:"
21933 *) : in case they cannot read
21934 sh 1>&4 -c "$ans";;
21939 : if this fails, just run all the .SH files by hand
21948 if $contains '^depend:' [Mm]akefile >/dev/null 2>&1; then
21955 Now you need to generate make dependencies by running "$make depend".
21956 You might prefer to run it in background: "$make depend > makedepend.out &"
21957 It can take a while, so you might not want to run it right now.
21962 rp="Run $make depend now?"
21966 $make depend && echo "Now you must run '$make'."
21969 echo "You must run '$make depend' then '$make'."
21972 elif test -f [Mm]akefile; then
21974 echo "Now you must run a $make."
21976 echo "Configure done."
21979 if $test -f Policy.sh; then
21982 If you compile $package on a different machine or from a different object
21983 directory, copy the Policy.sh file from this object directory to the
21984 new one before you run Configure -- this will help you with most of
21985 the policy defaults.
21989 if $test -f config.msg; then
21990 echo "Hmm. I also noted the following information while running:"
21992 $cat config.msg >&4
21995 $rm -f kit*isdone ark*isdone