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 Tue Jan 3 16:44:36 CET 2006 [metaconfig 3.0 PL70]
30 # (with additional metaconfig patches by perlbug@perl.org)
35 SCO csh still thinks true is false. Write to SCO today and tell them that next
36 year Configure ought to "rm /bin/csh" unless they fix their blasted shell. :-)
38 (Actually, Configure ought to just patch csh in place. Hmm. Hmmmmm. All
39 we'd have to do is go in and swap the && and || tokens, wherever they are.)
41 [End of diatribe. We now return you to your regularly scheduled programming...]
45 OOPS! You naughty creature! You didn't run Configure with sh!
46 I will attempt to remedy the situation by running sh for you...
50 true || exec sh $0 $argv:q
52 (exit $?0) || cat c2$$
53 (exit $?0) || exec sh $0 $argv:q
56 if test -f /dev/cputype -a -f /dev/drivers -a -f /dev/osversion; then
59 *** I'm sorry but this system looks like Plan 9 and Plan 9 doesn't do
60 *** Configure that well. (Plan 9 is close to UNIX but not close enough.)
61 *** Please read the README.plan9 for further instructions.
62 *** Cannot continue, aborting.
68 : compute my invocation name
72 me=`echo $0 | sed -e 's!.*/\(.*\)!\1!' 2>/dev/null`
77 : Proper separator for the PATH environment variable
79 : On OS/2 this directory should exist if this is not floppy only system :-]
80 if test -d c:/. || ( uname -a | grep -i 'os\(/\|\)2' ) 2>&1 >/dev/null ; then
81 if test -n "$OS2_SHELL"; then
83 PATH=`cmd /c "echo %PATH%" | tr '\\\\' / `
84 OS2_SHELL=`cmd /c "echo %OS2_SHELL%" | tr '\\\\' / | tr '[A-Z]' '[a-z]'`
86 elif test -n "$DJGPP"; then
87 case "X${MACHTYPE:-nonesuchmach}" in
95 paths='/bin /usr/bin /usr/local/bin /usr/ucb /usr/local /usr/lbin'
96 paths="$paths /opt/bin /opt/local/bin /opt/local /opt/lbin"
97 paths="$paths /usr/5bin /etc /usr/gnu/bin /usr/new /usr/new/bin /usr/nbin"
98 paths="$paths /opt/gnu/bin /opt/new /opt/new/bin /opt/nbin"
99 paths="$paths /sys5.3/bin /sys5.3/usr/bin /bsd4.3/bin /bsd4.3/usr/ucb"
100 paths="$paths /bsd4.3/usr/bin /usr/bsd /bsd43/bin /opt/ansic/bin /usr/ccs/bin"
101 paths="$paths /etc /usr/lib /usr/ucblib /lib /usr/ccs/lib"
102 paths="$paths /sbin /usr/sbin /usr/libexec"
103 paths="$paths /system/gnu_library/bin"
107 case "$p_$PATH$p_" in
109 *) test -d $p && PATH=$PATH$p_$p ;;
116 : shall we be using ksh?
122 if (PATH=.; alias -x) >/dev/null 2>&1; then
125 if test -f /hp-ux -a -f /bin/ksh; then
126 needksh='to avoid sh bug in "here document" expansion'
128 if test -d /usr/lpp -a -f /usr/bin/bsh -a -f /usr/bin/uname; then
129 if test X`/usr/bin/uname -v` = X4; then
130 avoidksh="to avoid AIX 4's /bin/sh"
134 if test -f /osf_boot -a -f /usr/sbin/setld; then
135 if test X`/usr/bin/uname -s` = XOSF1; then
136 avoidksh="to avoid Digital UNIX' ksh"
138 unset BIN_SH # if this is 'xpg4' sh will start up ksh
141 case "$inksh/$needksh" in
148 case "$inksh/$avoidksh" in
154 case "$inksh/$needksh-$avoidksh-" in
157 (I see you are using the Korn shell. Some ksh's blow up on $me,
158 mainly on older exotic systems. If yours does, try the Bourne shell instead.)
165 echo "(Feeding myself to $newsh $reason.)"
167 Configure|*/Configure) exec $newsh $0 "$@";;
168 *) exec $newsh Configure "$@";;
173 : if needed set CDPATH to a harmless value that is not chatty
174 : avoid bash 2.02 problems with empty CDPATH.
178 *bash*) CDPATH='.' ;;
183 : Configure runs within the UU subdirectory
184 test -d UU || mkdir UU
348 d_attribute_format=''
349 d_attribute_malloc=''
350 d_attribute_nonnull=''
351 d_attribute_noreturn=''
353 d_attribute_unused=''
354 d_attribute_warn_unused_result=''
401 endhostent_r_proto=''
407 endprotoent_r_proto=''
413 endservent_r_proto=''
465 gethostbyaddr_r_proto=''
467 gethostbyname_r_proto=''
469 gethostent_r_proto=''
481 getnetbyaddr_r_proto=''
483 getnetbyname_r_proto=''
497 d_getprotobyname_r=''
498 getprotobyname_r_proto=''
499 d_getprotobynumber_r=''
500 getprotobynumber_r_proto=''
502 getprotoent_r_proto=''
514 getservbyname_r_proto=''
516 getservbyport_r_proto=''
518 getservent_r_proto=''
542 d_libm_lib_version=''
555 d_malloc_good_size=''
597 d_old_pthread_create_joinable=''
598 old_pthread_create_joinable=''
600 d_pthread_attr_setscope=''
639 sethostent_r_proto=''
656 setprotoent_r_proto=''
668 setservent_r_proto=''
701 d_sprintf_returns_strlen=''
716 d_stdio_ptr_lval_nochange_cnt=''
717 d_stdio_ptr_lval_sets_cnt=''
921 inc_version_list_init=''
940 ignore_versioned_solibs=''
1000 d_perl_otherlibdirs=''
1008 api_versionstring=''
1014 version_patchlevel_string=''
1018 d_nv_preserves_uv=''
1019 d_nv_zero_is_allbits_zero=''
1030 nv_preserves_uv_bits=''
1101 installsitehtml1dir=''
1104 installsitehtml3dir=''
1111 installsiteman1dir=''
1114 installsiteman3dir=''
1119 installsitescript=''
1134 d_stdio_stream_array=''
1135 stdio_stream_array=''
1146 ccflags_uselargefiles=''
1147 ldflags_uselargefiles=''
1148 libswanted_uselargefiles=''
1158 userelocatableinc=''
1169 installvendorarch=''
1176 installvendorhtml1dir=''
1178 vendorhtml1direxp=''
1179 installvendorhtml3dir=''
1181 vendorhtml3direxp=''
1187 installvendorman1dir=''
1190 installvendorman3dir=''
1197 installvendorscript=''
1209 smallmach='pdp11 i8086 z8000 i80286 iAPX286'
1212 : We must find out about Eunice early
1214 if test -f /etc/unixtovms; then
1215 eunicefix=/etc/unixtovms
1217 if test -f /etc/unixtovms.exe; then
1218 eunicefix=/etc/unixtovms.exe
1221 : Set executable suffix now -- needed before hints available
1222 if test -f "/libs/version.library"; then
1225 elif test -f "/system/gnu_library/bin/ar.pm"; then
1228 elif test -n "$DJGPP"; then
1231 elif test -d c:/. -o -n "$is_os2" ; then
1240 : set useposix=false in your hint file to disable the POSIX extension.
1242 : set useopcode=false in your hint file to disable the Opcode extension.
1244 : Trailing extension. Override this in a hint file, if needed.
1245 : Extra object files, if any, needed on this platform.
1248 : Possible local include directories to search.
1249 : Set locincpth to "" in a hint file to defeat local include searches.
1250 locincpth="/usr/local/include /opt/local/include /usr/gnu/include"
1251 locincpth="$locincpth /opt/gnu/include /usr/GNU/include /opt/GNU/include"
1253 : no include file wanted by default
1258 : change the next line if compiling for Xenix/286 on Xenix/386
1259 xlibpth='/usr/lib/386 /lib/386'
1260 : Possible local library directories to search.
1261 loclibpth="/usr/local/lib /opt/local/lib /usr/gnu/lib"
1262 loclibpth="$loclibpth /opt/gnu/lib /usr/GNU/lib /opt/GNU/lib"
1264 : general looking path for locating libraries
1265 glibpth="/lib /usr/lib $xlibpth"
1266 glibpth="$glibpth /usr/ccs/lib /usr/ucblib /usr/local/lib"
1267 test -f /usr/shlib/libc.so && glibpth="/usr/shlib $glibpth"
1268 test -f /shlib/libc.so && glibpth="/shlib $glibpth"
1270 : Private path used by Configure to find libraries. Its value
1271 : is prepended to libpth. This variable takes care of special
1272 : machines, like the mips. Usually, it should be empty.
1275 : default library list
1277 : some systems want to use only the non-versioned libso:s
1278 ignore_versioned_solibs=''
1283 ccflags_uselargefiles=''
1284 ldflags_uselargefiles=''
1285 libswanted_uselargefiles=''
1286 : set usemultiplicity on the Configure command line to enable multiplicity.
1287 : set usesocks on the Configure command line to enable socks.
1288 : set usethreads on the Configure command line to enable threads.
1289 usereentrant='undef'
1290 : full support for void wanted by default
1293 : List of libraries we want.
1294 : If anyone needs extra -lxxx, put those in a hint file.
1295 libswanted="sfio socket bind inet nsl nm ndbm gdbm dbm db malloc dl dld ld sun"
1296 libswanted="$libswanted m crypt sec util c cposix posix ucb bsd BSD"
1297 : We probably want to search /usr/shlib before most other libraries.
1298 : This is only used by the lib/ExtUtils/MakeMaker.pm routine extliblist.
1299 glibpth=`echo " $glibpth " | sed -e 's! /usr/shlib ! !'`
1300 glibpth="/usr/shlib $glibpth"
1301 : Do not use vfork unless overridden by a hint file.
1304 : Find the basic shell for Bourne shell scripts
1308 *bsd*|sys5*) xxx="/$SYSTYPE/bin/sh";;
1311 if test -f "$xxx"; then
1314 : Build up a list and do a single loop so we can 'break' out.
1315 pth=`echo $PATH | sed -e "s/$p_/ /g"`
1316 for xxx in sh bash ksh pdksh ash; do
1318 try="$try ${p}/${xxx}"
1322 if test -f "$xxx"; then
1325 elif test "X$_exe" != X -a -f "$xxx$_exe"; then
1328 elif test -f "$xxx.exe"; then
1339 $me: Fatal Error: I can't find a Bourne Shell anywhere.
1341 Usually it's in /bin/sh. How did you even get this far?
1342 Please contact me (Perl Maintainers) at perlbug@perl.org and
1343 we'll try to straighten this all out.
1349 : see if sh knows # comments
1350 if `$sh -c '#' >/dev/null 2>&1`; then
1354 test -f $xcat$_exe || xcat=/usr/bin/cat
1355 if test ! -f $xcat$_exe; then
1356 for p in `echo $PATH | sed -e "s/$p_/ /g"` $paths; do
1357 if test -f $p/cat$_exe; then
1362 if test ! -f $xcat$_exe; then
1363 echo "Can't find cat anywhere!"
1367 echo "#!$xcat" >sharp
1371 if test -s today; then
1374 echo "#! $xcat" > sharp
1378 if test -s today; then
1386 echo "Your $sh doesn't grok # comments--I will strip them later on."
1389 echo "exec grep -v '^[ ]*#'" >spitshell
1391 $eunicefix spitshell
1392 spitshell=`pwd`/spitshell
1394 echo "I presume that if # doesn't work, #! won't work either!"
1399 : figure out how to guarantee sh startup
1401 '') startsh=${sharpbang}${sh} ;;
1413 : echo "Yup, it does."
1415 echo "Hmm... '$startsh' does not guarantee sh startup..."
1416 echo "You may have to fix up the shell scripts to make sure $sh runs them."
1421 : Save command line options in file UU/cmdline.opt for later use in
1422 : generating config.sh.
1423 cat > cmdline.opt <<EOSH
1424 # Configure command line arguments.
1433 cat >>cmdline.opt <<EOSH
1434 config_arg$argn='$arg'
1436 # Extreme backslashitis: replace each ' by '"'"'
1437 cat <<EOC | sed -e "s/'/'"'"'"'"'"'"'/g" > cmdl.opt
1440 arg_exp=`cat cmdl.opt`
1441 args_exp="$args_exp$args_sep'$arg_exp'"
1442 argn=`expr $argn + 1`
1445 # args_exp is good for restarting self: eval "set X $args_exp"; shift; $0 "$@"
1446 # used by ./hints/os2.sh
1449 : produce awk script to parse command line options
1450 cat >options.awk <<'EOF'
1452 optstr = "A:dD:eEf:hKOrsSU:V"; # getopt-style specification
1454 len = length(optstr);
1455 for (i = 1; i <= len; i++) {
1456 c = substr(optstr, i, 1);
1457 if (i < len) a = substr(optstr, i + 1, 1); else a = "";
1468 if (substr(str, 1, 1) != "-") {
1469 printf("'%s'\n", str);
1473 for (i = 2; i <= len; i++) {
1474 c = substr(str, i, 1);
1476 printf("-%s\n", substr(str, i));
1482 printf("'%s'\n", substr(str, i + 1));
1495 : process the command line options
1496 set X `for arg in "$@"; do echo "X$arg"; done |
1497 sed -e s/X// | awk -f options.awk`
1502 : set up default values
1512 rm -f optdef.sh posthint.sh
1513 cat >optdef.sh <<EOS
1519 while test $# -gt 0; do
1521 -d) shift; fastread=yes;;
1522 -e) shift; alldone=cont;;
1526 if test -r "$1"; then
1529 echo "$me: cannot read config file $1." >&2
1534 -h) shift; error=true;;
1535 -r) shift; reuseval=true;;
1536 -s) shift; silent=true; realsilent=true;;
1537 -E) shift; alldone=exit;;
1538 -K) shift; knowitall=true;;
1539 -O) shift; override=true;;
1540 -S) shift; silent=true; extractsh=true;;
1545 echo "$me: use '-U symbol=', not '-D symbol='." >&2
1546 echo "$me: ignoring -D $1" >&2
1549 sed -e "s/'/'\"'\"'/g" -e "s/=\(.*\)/='\1'/" >> optdef.sh;;
1550 *) echo "$1='define'" >> optdef.sh;;
1557 *=) echo "$1" >> optdef.sh;;
1559 echo "$me: use '-D symbol=val', not '-U symbol=val'." >&2
1560 echo "$me: ignoring -U $1" >&2
1562 *) echo "$1='undef'" >> optdef.sh;;
1573 *=*) zzz=`echo "$yyy"|sed 's!=.*!!'`
1577 zzz=" "`echo "$yyy"|sed 's!^[^=]*=!!'`
1578 yyy=`echo "$yyy"|sed 's!=.*!!'` ;;
1584 *:*) xxx=`echo "$yyy"|sed 's!:.*!!'`
1585 yyy=`echo "$yyy"|sed 's!^[^:]*:!!'`
1586 zzz=`echo "$yyy"|sed 's!^[^=]*=!!'`
1587 yyy=`echo "$yyy"|sed 's!=.*!!'` ;;
1588 *) xxx=`echo "$yyy"|sed 's!:.*!!'`
1589 yyy=`echo "$yyy"|sed 's!^[^:]*:!!'` ;;
1595 echo "$yyy=\"\${$yyy}$zzz\"" >> posthint.sh ;;
1597 echo "$yyy=''" >> posthint.sh ;;
1602 echo "$yyy='$zzz'" >> posthint.sh ;;
1604 echo "eval \"$yyy=$zzz\"" >> posthint.sh ;;
1606 echo "$yyy=\"$zzz\${$yyy}\"" >> posthint.sh ;;
1611 echo "$yyy=$zzz" >> posthint.sh ;;
1612 *) echo "$me: unknown -A command '$xxx', ignoring -A $1" >&2 ;;
1616 -V) echo "$me generated by metaconfig 3.0 PL70." >&2
1619 -*) echo "$me: unknown option $1" >&2; shift; error=true;;
1627 Usage: $me [-dehrsEKOSV] [-f config.sh] [-D symbol] [-D symbol=value]
1628 [-U symbol] [-U symbol=] [-A command:symbol...]
1629 -d : use defaults for all answers.
1630 -e : go on without questioning past the production of config.sh.
1631 -f : specify an alternate default configuration file.
1632 -h : print this help message and exit (with an error status).
1633 -r : reuse C symbols value if possible (skips costly nm extraction).
1634 -s : silent mode, only echoes questions and essential information.
1635 -D : define symbol to have some value:
1636 -D symbol symbol gets the value 'define'
1637 -D symbol=value symbol gets the value 'value'
1638 -E : stop at the end of questions, after having produced config.sh.
1639 -K : do not use unless you know what you are doing.
1640 -O : let -D and -U override definitions from loaded configuration file.
1641 -S : perform variable substitutions on all .SH files (can mix with -f)
1642 -U : undefine symbol:
1643 -U symbol symbol gets the value 'undef'
1644 -U symbol= symbol gets completely empty
1645 -A : manipulate symbol after the platform specific hints have been applied:
1646 -A symbol=value append " "value to symbol
1647 -A append:symbol=value append value to symbol
1648 -A define:symbol=value define symbol to have value
1649 -A clear:symbol define symbol to be ''
1650 -A define:symbol define symbol to be 'define'
1651 -A eval:symbol=value define symbol to be eval of value
1652 -A prepend:symbol=value prepend value to symbol
1653 -A undef:symbol define symbol to be 'undef'
1654 -A undef:symbol= define symbol to be ''
1655 -V : print version number and exit (with a zero status).
1662 case "$fastread$alldone" in
1665 case "$extractsh" in
1668 if test ! -t 0; then
1669 echo "Say 'sh Configure', not 'sh <Configure'"
1679 true) exec 1>/dev/null;;
1682 : run the defines and the undefines, if any, but leave the file out there...
1685 : create the posthint manipulation script and leave the file out there...
1690 first=`echo $package | sed -e 's/^\(.\).*/\1/'`
1691 last=`echo $package | sed -e 's/^.\(.*\)/\1/'`
1692 case "`echo AbyZ | tr '[:lower:]' '[:upper:]' 2>/dev/null`" in
1693 ABYZ) spackage=`echo $first | tr '[:lower:]' '[:upper:]'`$last;;
1694 *) spackage=`echo $first | tr '[a-z]' '[A-Z]'`$last;;
1697 : Some greps do not return status, grrr.
1698 echo "grimblepritz" >grimble
1699 if grep blurfldyick grimble >/dev/null 2>&1 ; then
1701 elif grep grimblepritz grimble >/dev/null 2>&1 ; then
1707 : the following should work in any shell
1711 echo "AGH! Grep doesn't return a status. Attempting remedial action."
1712 cat >contains <<'EOSS'
1713 grep "$1" "$2" >.greptmp && cat .greptmp && test -s .greptmp
1718 : Find the path to the source tree
1721 */*) src=`echo $0 | sed -e 's%/[^/][^/]*$%%'`
1725 *) src=`cd ../$src && pwd` ;;
1738 if test -f $rsrc/Configure && \
1739 $contains "^package=$package$" $rsrc/Configure >/dev/null 2>&1
1741 : found it, so we are ok.
1744 for src in . .. ../.. ../../.. ../../../..; do
1745 if test -f ../$src/Configure && \
1746 $contains "^package=$package$" ../$src/Configure >/dev/null 2>&1
1757 Sorry, I can't seem to locate the source dir for $package. Please start
1758 Configure with an explicit path -- i.e. /some/path/Configure.
1766 echo "Sources for $package found in \"$src\"." >&4
1770 : script used to extract .SH files with variable substitutions
1771 cat >extract <<'EOS'
1773 echo "Doing variable substitutions on .SH files..."
1774 if test -f MANIFEST; then
1775 set x `awk '{print $1}' < MANIFEST | grep '\.SH$'`
1777 echo "(Looking for .SH files under the source directory.)"
1778 set x `(cd "$src"; find . -name "*.SH" -print)`
1782 0) set x `(cd "$src"; echo *.SH)`; shift;;
1784 if test ! -f "$src/$1"; then
1790 while test $name; do
1791 if test ! -d "$name"; then
1792 create="$name $create";
1793 name=`echo $name | sed -e "s|^[^/]*$||"`;
1794 name=`echo $name | sed -e "s|\(.*\)/.*|\1|"`;
1799 for file in $create; do
1808 dir=`expr X$file : 'X\(.*\)/'`
1809 file=`expr X$file : 'X.*/\(.*\)'`
1810 (cd "$dir" && . ./$file)
1820 dir=`expr X$file : 'X\(.*\)/'`
1821 file=`expr X$file : 'X.*/\(.*\)'`
1822 (set x $dir; shift; eval $mkdir_p)
1823 sh <"$src/$dir/$file"
1832 if test -f "$src/config_h.SH"; then
1833 if test ! -f config.h; then
1834 : oops, they left it out of MANIFEST, probably, so do it anyway.
1835 . "$src/config_h.SH"
1840 : extract files and exit if asked to do so
1841 case "$extractsh" in
1843 case "$realsilent" in
1847 case "$config_sh" in
1848 '') config_sh='config.sh';;
1851 echo "Fetching answers from $config_sh..."
1854 test "$override" && . ./optdef.sh
1858 echo "Extraction done."
1863 : Eunice requires " " instead of "", can you believe it
1866 echo "Beginning of configuration questions for $package."
1868 trap 'echo " "; test -d ../UU && rm -rf X $rmlist; exit 1' 1 2 3 15
1870 : first determine how to suppress newline on echo command
1872 echo "Checking echo to see how to suppress newlines..."
1873 (echo "hi there\c" ; echo " ") >.echotmp
1874 if $contains c .echotmp >/dev/null 2>&1 ; then
1885 echo $n "The star should be here-->$c"
1889 : Now test for existence of everything in MANIFEST
1891 if test -f "$rsrc/MANIFEST"; then
1892 echo "First let's make sure your kit is complete. Checking..." >&4
1893 awk '$1 !~ /PACK[A-Z]+/ {print $1}' "$rsrc/MANIFEST" | (split -l 50 2>/dev/null || split -50)
1896 for filelist in x??; do
1897 (cd "$rsrc"; ls `cat "$tmppwd/$filelist"` >/dev/null 2>>"$tmppwd/missing")
1899 if test -s missing; then
1903 THIS PACKAGE SEEMS TO BE INCOMPLETE.
1905 You have the option of continuing the configuration process, despite the
1906 distinct possibility that your kit is damaged, by typing 'y'es. If you
1907 do, don't blame me if something goes wrong. I advise you to type 'n'o
1908 and contact the author (perlbug@perl.org).
1911 echo $n "Continue? [n] $c" >&4
1915 echo "Continuing..." >&4
1919 echo "ABORTING..." >&4
1924 echo "Looks good..."
1927 echo "There is no MANIFEST file. I hope your kit is complete !"
1932 : Find the appropriate value for a newline for tr
1933 if test -n "$DJGPP"; then
1936 if test X"$trnl" = X; then
1937 case "`echo foo|tr '\n' x 2>/dev/null`" in
1941 if test X"$trnl" = X; then
1942 case "`echo foo|tr '\012' x 2>/dev/null`" in
1943 foox) trnl='\012' ;;
1946 if test X"$trnl" = X; then
1947 case "`echo foo|tr '\r\n' xy 2>/dev/null`" in
1948 fooxy) trnl='\n\r' ;;
1951 if test X"$trnl" = X; then
1954 $me: Fatal Error: cannot figure out how to translate newlines with 'tr'.
1960 : compute the number of columns on the terminal for proper question formatting
1965 : set up the echo used in my read
1966 myecho="case \"\$xxxm\" in
1967 '') echo $n \"\$rp $c\" >&4;;
1969 '') echo $n \"[\$xxxm] $c\";;
1971 if test \`echo \"\$rp [\$xxxm] \" | wc -c\` -ge $COLUMNS; then
1973 echo $n \"[\$xxxm] $c\" >&4
1975 echo $n \"\$rp [\$xxxm] $c\" >&4
1981 : now set up to do reads with possible shell escape and default assignment
1987 case "\$fastread" in
1988 yes) case "\$dflt" in
1991 case "\$silent-\$rp" in
1996 *) case "\$silent" in
1997 true) case "\$rp" in
2002 while expr "X\$ans" : "X!" >/dev/null; do
2006 aok=''; eval "ans=\\"\$answ\\"" && aok=y
2014 set x \`expr "X\$ans" : "X!\(.*\)\$"\`
2023 set x \`expr "X\$ans" : "X&\(.*\)\$"\`
2028 echo "(OK, I'll run with -d after this question.)" >&4
2031 echo "*** Sorry, \$1 not supported yet." >&4
2041 echo "*** Substitution done -- please confirm."
2043 ans=\`echo $n "\$ans$c" | tr '$trnl' ' '\`
2048 echo "*** Error -- try again."
2055 case "\$ans\$xxxm\$nostick" in
2067 : create .config dir to save info across Configure sessions
2068 test -d ../.config || mkdir ../.config
2069 cat >../.config/README <<EOF
2070 This directory created by Configure to save information that should
2071 persist across sessions for $package.
2073 You may safely delete it if you wish.
2076 xversion=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
2078 $define|true|[yY]*) ;;
2079 *) case "$xversion" in
2082 *** WHOA THERE!!! ***
2084 This is an UNSTABLE DEVELOPMENT release.
2085 The version of this $package distribution is $xversion, that is, odd,
2086 (as opposed to even) and that signifies a development release.
2087 If you want a maintenance release, you want an even-numbered version.
2089 Do ***NOT*** install this into production use.
2090 Data corruption and crashes are possible.
2092 It is most seriously suggested that you do not continue any further
2093 unless you want to help in developing and debugging Perl.
2095 If you *still* want to build perl, you can answer 'y' now,
2096 or pass -Dusedevel to Configure.
2099 rp='Do you really want to continue?'
2103 [yY]) echo >&4 "Okay, continuing."
2104 usedevel="$define" ;;
2105 *) echo >&4 "Okay, bye."
2115 case "$versiononly" in
2116 '') versiononly="$define" ;;
2118 case "$installusrbinperl" in
2119 '') installusrbinperl="$undef" ;;
2124 : general instructions
2127 user=`(logname) 2>/dev/null`
2129 '') user=`whoami 2>&1`;;
2131 if $contains "^$user\$" ../.config/instruct >/dev/null 2>&1; then
2134 rp='Would you like to see the instructions?'
2145 This installation shell script will examine your system and ask you questions
2146 to determine how the perl5 package should be installed. If you get
2147 stuck on a question, you may use a ! shell escape to start a subshell or
2148 execute a command. Many of the questions will have default answers in square
2149 brackets; typing carriage return will give you the default.
2151 On some of the questions which ask for file or directory names you are allowed
2152 to use the ~name construct to specify the login directory belonging to "name",
2153 even if you don't have a shell which knows about that. Questions where this is
2154 allowed will be marked "(~name ok)".
2158 dflt='Type carriage return to continue'
2162 The prompter used in this script allows you to use shell variables and
2163 backticks in your answers. You may use $1, $2, etc... to refer to the words
2164 in the default answer, as if the default line was a set of arguments given to a
2165 script shell. This means you may also use $* to repeat the whole default line,
2166 so you do not have to re-type everything to add something to the default.
2168 Everytime there is a substitution, you will have to confirm. If there is an
2169 error (e.g. an unmatched backtick), the default answer will remain unchanged
2170 and you will be prompted again.
2172 If you are in a hurry, you may run 'Configure -d'. This will bypass nearly all
2173 the questions and use the computed defaults (or the previous answers if there
2174 was already a config.sh file). Type 'Configure -h' for a list of options.
2175 You may also start interactively and then answer '& -d' at any prompt to turn
2176 on the non-interactive behaviour for the remainder of the execution.
2182 Much effort has been expended to ensure that this shell script will run on any
2183 Unix system. If despite that it blows up on yours, your best bet is to edit
2184 Configure and run it again. If you can't run Configure for some reason,
2185 you'll have to generate a config.sh file by hand. Whatever problems you
2186 have, let me (perlbug@perl.org) know how I blew it.
2188 This installation script affects things in two ways:
2190 1) it may do direct variable substitutions on some of the files included
2192 2) it builds a config.h file for inclusion in C programs. You may edit
2193 any of these files as the need arises after running this script.
2195 If you make a mistake on a question, there is no easy way to back up to it
2196 currently. The easiest thing to do is to edit config.sh and rerun all the SH
2197 files. Configure will offer to let you do this before it runs the SH files.
2200 dflt='Type carriage return to continue'
2202 case "$firsttime" in
2203 true) echo $user >>../.config/instruct;;
2207 : find out where common programs are
2209 echo "Locating common programs..." >&4
2222 if test -d \$dir/\$thing; then
2228 for thisthing in \$dir/\$thing; do
2229 : just loop through to pick last item
2231 if test -f \$thisthing; then
2234 elif test "X$_exe" != X -a -f \$thisthing$_exe; then
2237 elif test -f \$dir/\$thing.exe; then
2238 if test -n "$DJGPP"; then
2239 echo \$dir/\$thing.exe
2240 elif test "$eunicefix" != ":"; then
2241 : on Eunice apparently
2295 pth=`echo $PATH | sed -e "s/$p_/ /g"`
2296 pth="$pth /lib /usr/lib"
2297 for file in $loclist; do
2301 if test -f "$xxx"; then
2304 echo "WARNING: no $xxx -- ignoring your setting for $file." >&4
2305 xxx=`./loc $file $file $pth`
2308 '') xxx=`./loc $file $file $pth`;;
2309 *) xxx=`./loc $xxx $xxx $pth`;;
2311 eval $file=$xxx$_exe
2315 echo $file is in $xxx.
2318 echo $file is in $xxx.
2321 echo "I don't know where '$file' is, and my life depends on it." >&4
2322 echo "Go find a public domain implementation or fix your PATH setting!" >&4
2328 echo "Don't worry if any of the following aren't found..."
2330 for file in $trylist; do
2334 if test -f "$xxx"; then
2337 echo "WARNING: no $xxx -- ignoring your setting for $file." >&4
2338 xxx=`./loc $file $file $pth`
2341 '') xxx=`./loc $file $file $pth`;;
2342 *) xxx=`./loc $xxx $xxx $pth`;;
2344 eval $file=$xxx$_exe
2348 echo $file is in $xxx.
2351 echo $file is in $xxx.
2354 echo "I don't see $file out there, $say."
2361 echo "Substituting grep for egrep."
2368 echo "Substituting cp for ln."
2377 echo "I can't find make or gmake, and my life depends on it." >&4
2378 echo "Go find a public domain implementation or fix your PATH setting!" >&4
2386 *) # We can't have osname yet.
2387 if test -f "/system/gnu_library/bin/ar.pm"; then # Stratus VOS
2388 # Assume that gmake, if found, is definitely GNU make
2389 # and prefer it over the system make.
2390 echo "Substituting gmake for make."
2398 echo "Hopefully test is built into your sh."
2401 if `sh -c "PATH= test true" >/dev/null 2>&1`; then
2402 echo "Using the test built into your sh."
2410 echo "Hopefully echo is built into your sh."
2415 echo "Checking compatibility between $echo and builtin echo (if any)..." >&4
2416 $echo $n "hi there$c" >foo1
2417 echo $n "hi there$c" >foo2
2418 if cmp foo1 foo2 >/dev/null 2>&1; then
2419 echo "They are compatible. In fact, they may be identical."
2426 They are not compatible! You are probably running ksh on a non-USG system.
2427 I'll have to use $echo instead of the builtin, since Bourne shell doesn't
2428 have echo built in and we may have to run some Bourne shell scripts. That
2429 means I'll have to use '$n$c' to suppress newlines now. Life is ridiculous.
2432 $echo $n "The star should be here-->$c"
2442 cat <<'EOSC' >>trygcc
2447 int main(int argc, char *argv[]) {
2451 if $cc -o try $ccflags $ldflags try.c; then
2454 echo "Uh-oh, the C compiler '$cc' doesn't seem to be working." >&4
2460 case "`$cc -v -c try.c 2>&1`" in
2463 if $test X"$trygcc" = Xyes; then
2464 if gcc -o try -c try.c; then
2466 echo "You seem to have a working gcc, though." >&4
2467 rp="Would you like to use it?"
2469 if $test -f myread; then
2472 if $test -f UU/myread; then
2475 echo "Cannot find myread, sorry. Aborting." >&2
2480 [yY]*) cc=gcc; ccname=gcc; ccflags=''; despair=no;
2481 if $test -f usethreads.cbu; then
2484 *** However, any setting of the C compiler flags (e.g. for thread support)
2485 *** has been lost. It may be necessary to pass -Dcc=gcc to Configure
2486 *** (together with e.g. -Dusethreads).
2502 cat <<'EOSC' >>checkcc
2507 int main(int argc, char *argv[]) {
2511 if $cc -o try $ccflags $ldflags try.c; then
2514 if $test X"$despair" = Xyes; then
2515 echo "Uh-oh, the C compiler '$cc' doesn't seem to be working." >&4
2518 You need to find a working C compiler.
2519 Either (purchase and) install the C compiler supplied by your OS vendor,
2520 or for a free C compiler try http://gcc.gnu.org/
2521 I cannot continue any further, aborting.
2530 : determine whether symbolic links are supported
2533 if $ln -s blurfl sym > /dev/null 2>&1 ; then
2534 echo "Symbolic links are supported." >&4
2537 echo "Symbolic links are NOT supported." >&4
2542 : determine whether symbolic links are supported
2546 echo "Checking how to test for symbolic links..." >&4
2548 if $test "X$issymlink" = X; then
2550 '') sh -c "PATH= test -h sym" >/dev/null 2>&1 ;;
2551 *) $newsh -c "PATH= test -h sym" >/dev/null 2>&1 ;;
2553 if test $? = 0; then
2556 echo "Your builtin 'test -h' may be broken." >&4
2559 *) pth=`echo $PATH | sed -e "s/$p_/ /g"`
2562 if test -f "$p/$test"; then
2571 echo "Trying external '$test -h'." >&4
2572 issymlink="$test -h"
2573 if $test ! -h sym >/dev/null 2>&1; then
2574 echo "External '$test -h' is broken, too." >&4
2582 if $test "X$issymlink" = X; then
2583 if $test -L sym 2>/dev/null; then
2584 issymlink="$test -L"
2585 echo "The builtin '$test -L' worked." >&4
2588 if $test "X$issymlink" != X; then
2589 echo "You can test for symbolic links with '$issymlink'." >&4
2591 echo "I do not know how you can test for symbolic links." >&4
2595 *) echo "No symbolic links, so not testing for their testing..." >&4
2601 case "$mksymlinks" in
2604 ''|'.') echo "Cannot create symlinks in the original directory." >&4
2607 *) case "$lns:$issymlink" in
2608 *"ln"*" -s:"*"test -"?)
2609 echo "Creating the symbolic links..." >&4
2610 echo "(First creating the subdirectories...)" >&4
2612 awk '{print $1}' $src/MANIFEST | grep / | sed 's:/[^/]*$::' | sort -u | while true; do
2614 test -z "$directory" && break
2618 if test ! -d t/base; then
2619 echo "Failed to create the subdirectories. Aborting." >&4
2622 echo "(Then creating the symlinks...)" >&4
2623 awk '{print $1}' $src/MANIFEST | while true; do
2625 test -z "$filename" && break
2626 if test -f $filename; then
2627 if $issymlink $filename; then
2631 if test -f $filename; then
2632 echo "$filename already exists, not symlinking."
2634 ln -s $src/$filename $filename
2638 if test ! -f t/base/lex.t; then
2639 echo "Failed to create the symlinks (t/base/lex.t missing). Aborting." >&4
2644 *) echo "(I cannot figure out how to do symbolic links, ignoring mksymlinks)." >&4
2653 case "$usecrosscompile" in
2655 $echo "Cross-compiling..."
2658 *-*-gcc) # A cross-compiling gcc, probably.
2659 targetarch=`$echo $cc|$sed 's/-gcc$//'`
2661 # leave out ld, choosing it is more complex
2663 ranlib=$targetarch-ranlib
2664 $echo 'extern int foo;' > try.c
2665 set X `$cc -v -E try.c 2>&1 | $awk '/^#include </,/^End of search /'|$grep '/include'`
2667 if $test $# -gt 0; then
2669 incpth="`$echo $incpth|$sed 's/^ //'`"
2670 echo "Guessing incpth '$incpth'." >&4
2672 j="`$echo $i|$sed 's,/include$,/lib,'`"
2673 if $test -d $j; then
2677 libpth="`$echo $libpth|$sed 's/^ //'`"
2678 echo "Guessing libpth '$libpth'." >&4
2683 case "$targetarch" in
2684 '') echo "Targetarch not defined." >&4; croak=y ;;
2685 *) echo "Using targetarch $targetarch." >&4 ;;
2688 '') echo "Incpth not defined." >&4; croak=y ;;
2689 *) echo "Using incpth '$incpth'." >&4 ;;
2692 '') echo "Libpth not defined." >&4; croak=y ;;
2693 *) echo "Using libpth '$libpth'." >&4 ;;
2696 '') for i in $incpth; do
2697 if $test -f $i/errno.h -a -f $i/stdio.h -a -f $i/time.h; then
2699 echo "Guessing usrinc $usrinc." >&4
2704 '') echo "Usrinc not defined." >&4; croak=y ;;
2707 *) echo "Using usrinc $usrinc." >&4 ;;
2709 case "$targethost" in
2710 '') echo "Targethost not defined." >&4; croak=y ;;
2711 *) echo "Using targethost $targethost." >&4
2716 y) echo "Cannot continue, aborting." >&4; exit 1 ;;
2719 /*) run=$src/Cross/run
2720 targetmkdir=$src/Cross/mkdir
2722 from=$src/Cross/from
2724 *) pwd=`$test -f ../Configure & cd ..; pwd`
2726 targetmkdir=$pwd/Cross/mkdir
2728 from=$pwd/Cross/from
2731 case "$targetrun" in
2732 '') targetrun=ssh ;;
2737 case "$targetfrom" in
2738 '') targetfrom=scp ;;
2742 from=$from-$targetfrom
2743 case "$targetdir" in
2745 echo "Guessing targetdir $targetdir." >&4
2748 case "$targetuser" in
2750 echo "Guessing targetuser $targetuser." >&4
2753 case "$targetfrom" in
2757 case "$targetrun" in
2769 '') cwd=$targetdir ;;
2773 if $test ! -f \$exe.xok; then
2777 $targetrun -l $targetuser $targethost "cd \$cwd && ./\$exe \$@"
2780 *) echo "Unknown targetrun '$targetrun'" >&4
2784 case "$targetmkdir" in
2786 cat >$targetmkdir <<EOF
2788 $targetrun -l $targetuser $targethost "mkdir -p \$@"
2790 $chmod a+rx $targetmkdir
2792 *) echo "Unknown targetmkdir '$targetmkdir'" >&4
2804 $targetmkdir \`dirname \$f\`
2805 $targetto $q \$f $targetuser@$targethost:\$f || exit 1
2808 $targetmkdir $targetdir/\`dirname \$f\`
2809 $targetto $q \$f $targetuser@$targethost:$targetdir/\$f || exit 1
2822 $mkdir -p $targetdir/\`dirname \$f\`
2823 $cp \$f $targetdir/\$f || exit 1
2826 $targetmkdir $targetdir/\`dirname \$f\`
2827 $cp \$f $targetdir/\$f || exit 1
2834 *) echo "Unknown targetto '$targetto'" >&4
2838 case "$targetfrom" in
2845 $targetfrom $q $targetuser@$targethost:$targetdir/\$f . || exit 1
2850 cp) cat >$from <<EOF
2855 cp $targetdir/\$f . || exit 1
2860 *) echo "Unknown targetfrom '$targetfrom'" >&4
2864 if $test ! -f $run; then
2865 echo "Target 'run' script '$run' not found." >&4
2869 if $test ! -f $to; then
2870 echo "Target 'to' script '$to' not found." >&4
2874 if $test ! -f $from; then
2875 echo "Target 'from' script '$from' not found." >&4
2879 if $test ! -f $run -o ! -f $to -o ! -f $from; then
2883 Using '$run' for remote execution,
2884 and '$from' and '$to'
2885 for remote file transfer.
2891 usecrosscompile='undef'
2896 : see whether [:lower:] and [:upper:] are supported character classes
2898 case "`echo AbyZ | $tr '[:lower:]' '[:upper:]' 2>/dev/null`" in
2900 echo "Good, your tr supports [:lower:] and [:upper:] to convert case." >&4
2904 *) # There is a discontinuity in EBCDIC between 'R' and 'S'
2905 # (0xd9 and 0xe2), therefore that is a nice testing point.
2906 if test "X$up" = X -o "X$low" = X; then
2907 case "`echo RS | $tr '[R-S]' '[r-s]' 2>/dev/null`" in
2913 if test "X$up" = X -o "X$low" = X; then
2914 case "`echo RS | $tr R-S r-s 2>/dev/null`" in
2920 if test "X$up" = X -o "X$low" = X; then
2921 case "`echo RS | od -x 2>/dev/null`" in
2923 echo "Hey, this might be EBCDIC." >&4
2924 if test "X$up" = X -o "X$low" = X; then
2925 case "`echo RS | $tr '[A-IJ-RS-Z]' '[a-ij-rs-z]' 2>/dev/null`" in
2926 rs) up='[A-IJ-RS-Z]'
2931 if test "X$up" = X -o "X$low" = X; then
2932 case "`echo RS | $tr A-IJ-RS-Z a-ij-rs-z 2>/dev/null`" in
2942 case "`echo RS | $tr \"$up\" \"$low\" 2>/dev/null`" in
2944 echo "Using $up and $low to convert case." >&4
2947 echo "I don't know how to translate letters from upper to lower case." >&4
2948 echo "Your tr is not acting any way I know of." >&4
2952 : set up the translation script tr, must be called with ./tr of course
2956 '[A-Z][a-z]') exec $tr '$up' '$low';;
2957 '[a-z][A-Z]') exec $tr '$low' '$up';;
2964 : Try to determine whether config.sh was made on this system
2965 case "$config_sh" in
2967 myuname=`$uname -a 2>/dev/null`
2968 $test -z "$myuname" && myuname=`hostname 2>/dev/null`
2969 # tr '[A-Z]' '[a-z]' would not work in EBCDIC
2970 # because the A-Z/a-z are not consecutive.
2971 myuname=`echo $myuname | $sed -e 's/^[^=]*=//' -e 's/\///g' | \
2972 ./tr '[A-Z]' '[a-z]' | $tr $trnl ' '`
2973 newmyuname="$myuname"
2975 case "$knowitall" in
2977 if test -f ../config.sh; then
2978 if $contains myuname= ../config.sh >/dev/null 2>&1; then
2979 eval "`grep myuname= ../config.sh`"
2981 if test "X$myuname" = "X$newmyuname"; then
2989 : Get old answers from old config file if Configure was run on the
2990 : same system, otherwise use the hints.
2993 if test -f config.sh; then
2995 rp="I see a config.sh file. Shall I use it to set the defaults?"
2998 n*|N*) echo "OK, I'll ignore it."
2999 mv config.sh config.sh.old
3000 myuname="$newmyuname"
3002 *) echo "Fetching default answers from your old config.sh file..." >&4
3010 : Older versions did not always set $sh. Catch re-use of such
3020 if test ! -f config.sh; then
3023 First time through, eh? I have some defaults handy for some systems
3024 that need some extra help getting the Configure answers right:
3027 (cd $src/hints; ls -C *.sh) | $sed 's/\.sh/ /g' >&4
3029 : Half the following guesses are probably wrong... If you have better
3030 : tests or hints, please send them to perlbug@perl.org
3031 : The metaconfig authors would also appreciate a copy...
3032 $test -f /irix && osname=irix
3033 $test -f /xenix && osname=sco_xenix
3034 $test -f /dynix && osname=dynix
3035 $test -f /dnix && osname=dnix
3036 $test -f /lynx.os && osname=lynxos
3037 $test -f /unicos && osname=unicos && osvers=`$uname -r`
3038 $test -f /unicosmk && osname=unicosmk && osvers=`$uname -r`
3039 $test -f /unicosmk.ar && osname=unicosmk && osvers=`$uname -r`
3040 $test -f /bin/mips && /bin/mips && osname=mips
3041 $test -d /NextApps && set X `hostinfo | grep 'NeXT Mach.*:' | \
3042 $sed -e 's/://' -e 's/\./_/'` && osname=next && osvers=$4
3043 $test -d /usr/apollo/bin && osname=apollo
3044 $test -f /etc/saf/_sactab && osname=svr4
3045 $test -d /usr/include/minix && osname=minix
3046 $test -f /system/gnu_library/bin/ar.pm && osname=vos
3047 if $test -d /MachTen -o -d /MachTen_Folder; then
3049 if $test -x /sbin/version; then
3050 osvers=`/sbin/version | $awk '{print $2}' |
3051 $sed -e 's/[A-Za-z]$//'`
3052 elif $test -x /usr/etc/version; then
3053 osvers=`/usr/etc/version | $awk '{print $2}' |
3054 $sed -e 's/[A-Za-z]$//'`
3060 $test -f /sys/posix.dll &&
3061 $test -f /usr/bin/what &&
3062 set X `/usr/bin/what /sys/posix.dll` &&
3063 $test "$3" = UWIN &&
3067 if $test -f $uname; then
3075 umips) osname=umips ;;
3078 [23]100) osname=mips ;;
3079 next*) osname=next ;;
3081 tmp=`/bin/uname -X 2>/dev/null|awk '/3\.2v[45]/{ print $(NF) }'`
3082 if $test "$tmp" != "" -a "$3" = "3.2" -a -f '/etc/systemid'; then
3085 elif $test -f /etc/kconfig; then
3087 if test "$lns" = "$ln -s"; then
3089 elif $contains _SYSV3 /usr/include/stdio.h > /dev/null 2>&1 ; then
3091 elif $contains _POSIX_SOURCE /usr/include/stdio.h > /dev/null 2>&1 ; then
3098 if test -n "$DJGPP"; then
3107 tmp=`( (oslevel) 2>/dev/null || echo "not found") 2>&1`
3109 # oslevel can fail with:
3110 # oslevel: Unable to acquire lock.
3111 *not\ found) osvers="$4"."$3" ;;
3112 '<3240'|'<>3240') osvers=3.2.0 ;;
3113 '=3240'|'>3240'|'<3250'|'<>3250') osvers=3.2.4 ;;
3114 '=3250'|'>3250') osvers=3.2.5 ;;
3118 bsd386) osname=bsd386
3121 cygwin*) osname=cygwin
3124 *dc.osx) osname=dcosx
3130 domainos) osname=apollo
3136 dynixptx*) osname=dynixptx
3137 osvers=`echo "$4"|sed 's/^v//'`
3139 freebsd) osname=freebsd
3141 genix) osname=genix ;;
3145 osvers=`echo "$3" | $sed 's,.*\.\([0-9]*\.[0-9]*\),\1,'`
3161 netbsd*) osname=netbsd
3164 news-os) osvers="$3"
3166 4*) osname=newsos4 ;;
3170 next*) osname=next ;;
3171 nonstop-ux) osname=nonstopux ;;
3172 openbsd) osname=openbsd
3178 POSIX-BC | posix-bc ) osname=posix-bc
3181 powerux | power_ux | powermax_os | powermaxos | \
3182 powerunix | power_unix) osname=powerux
3188 solaris) osname=solaris
3190 5*) osvers=`echo $3 | $sed 's/^5/2/g'` ;;
3197 osvers=`echo $3 | $sed 's/^5/2/g'` ;;
3201 titanos) osname=titanos
3210 ultrix) osname=ultrix
3213 osf1|mls+) case "$5" in
3216 osvers=`sizer -v | awk -FUNIX '{print $2}' | awk '{print $1}' | tr '[A-Z]' '[a-z]' | sed 's/^[xvt]//'`
3219 *) osvers=`echo "$3" | sed 's/^[xvt]//'` ;;
3222 hp*) osname=hp_osf1 ;;
3223 mips) osname=mips_osf1 ;;
3226 # UnixWare 7.1.2 is known as Open UNIX 8
3227 openunix|unixware) osname=svr5
3235 $2) case "$osname" in
3239 : svr4.x or possibly later
3249 if test -f /stand/boot ; then
3250 eval `grep '^INITPROG=[a-z/0-9]*$' /stand/boot`
3251 if test -n "$INITPROG" -a -f "$INITPROG"; then
3252 isesix=`strings -a $INITPROG|grep 'ESIX SYSTEM V/386 Release 4.0'`
3253 if test -n "$isesix"; then
3261 *) if test -f /etc/systemid; then
3263 set `echo $3 | $sed 's/\./ /g'` $4
3264 if $test -f $src/hints/sco_$1_$2_$3.sh; then
3266 elif $test -f $src/hints/sco_$1_$2.sh; then
3268 elif $test -f $src/hints/sco_$1.sh; then
3273 '') : Still unknown. Probably a generic Sys V.
3282 *) case "$osname" in
3283 '') : Still unknown. Probably a generic BSD.
3291 if test -f /vmunix -a -f $src/hints/news_os.sh; then
3292 (what /vmunix | UU/tr '[A-Z]' '[a-z]') > UU/kernel.what 2>&1
3293 if $contains news-os UU/kernel.what >/dev/null 2>&1; then
3296 $rm -f UU/kernel.what
3297 elif test -d c:/. -o -n "$is_os2" ; then
3304 case "$targetarch" in
3307 osname=`echo $targetarch|sed 's,^[^-]*-,,'`
3312 : Now look for a hint file osname_osvers, unless one has been
3313 : specified already.
3316 file=`echo "${osname}_${osvers}" | $sed -e 's%\.%_%g' -e 's%_$%%'`
3317 : Also try without trailing minor version numbers.
3318 xfile=`echo $file | $sed -e 's%_[^_]*$%%'`
3319 xxfile=`echo $xfile | $sed -e 's%_[^_]*$%%'`
3320 xxxfile=`echo $xxfile | $sed -e 's%_[^_]*$%%'`
3321 xxxxfile=`echo $xxxfile | $sed -e 's%_[^_]*$%%'`
3324 *) case "$osvers" in
3327 *) if $test -f $src/hints/$file.sh ; then
3329 elif $test -f $src/hints/$xfile.sh ; then
3331 elif $test -f $src/hints/$xxfile.sh ; then
3333 elif $test -f $src/hints/$xxxfile.sh ; then
3335 elif $test -f $src/hints/$xxxxfile.sh ; then
3337 elif $test -f "$src/hints/${osname}.sh" ; then
3346 if $test -f Policy.sh ; then
3349 none) dflt="Policy" ;;
3350 *) dflt="Policy $dflt" ;;
3355 dflt=`echo $hintfile | $sed 's/\.sh$//'`
3359 if $test -f Policy.sh ; then
3362 There's also a Policy hint file available, which should make the
3363 site-specific (policy) questions easier to answer.
3370 You may give one or more space-separated answers, or "none" if appropriate.
3371 A well-behaved OS will have no hints, so answering "none" or just "Policy"
3372 is a good thing. DO NOT give a wrong version or a wrong OS.
3376 rp="Which of these apply, if any?"
3379 for file in $tans; do
3380 if $test X$file = XPolicy -a -f Policy.sh; then
3382 $cat Policy.sh >> UU/config.sh
3383 elif $test -f $src/hints/$file.sh; then
3384 . $src/hints/$file.sh
3385 $cat $src/hints/$file.sh >> UU/config.sh
3386 elif $test X"$tans" = X -o X"$tans" = Xnone ; then
3389 : Give one chance to correct a possible typo.
3390 echo "$file.sh does not exist"
3392 rp="hint to use instead?"
3394 for file in $ans; do
3395 if $test -f "$src/hints/$file.sh"; then
3396 . $src/hints/$file.sh
3397 $cat $src/hints/$file.sh >> UU/config.sh
3398 elif $test X$ans = X -o X$ans = Xnone ; then
3401 echo "$file.sh does not exist -- ignored."
3408 : Remember our hint file for later.
3409 if $test -f "$src/hints/$file.sh" ; then
3419 echo "Fetching default answers from $config_sh..." >&4
3423 cp $config_sh config.sh 2>/dev/null
3433 test "$override" && . ./optdef.sh
3435 : Restore computed paths
3436 for file in $loclist $trylist; do
3437 eval $file="\$_$file"
3442 Configure uses the operating system name and version to set some defaults.
3443 The default value is probably right if the name rings a bell. Otherwise,
3444 since spelling matters for me, either accept the default or answer "none"
3451 ''|' '|none) dflt=none ;;
3452 *) dflt=`echo $hintfile | $sed -e 's/\.sh$//' -e 's/_.*$//'` ;;
3455 *) dflt="$osname" ;;
3457 rp="Operating system name?"
3461 *) osname=`echo "$ans" | $sed -e 's/[ ][ ]*/_/g' | ./tr '[A-Z]' '[a-z]'`;;
3467 ''|' '|none) dflt=none ;;
3468 *) dflt=`echo $hintfile | $sed -e 's/\.sh$//' -e 's/^[^_]*//'`
3469 dflt=`echo $dflt | $sed -e 's/^_//' -e 's/_/./g'`
3471 ''|' ') dflt=none ;;
3476 *) dflt="$osvers" ;;
3478 rp="Operating system version?"
3488 : who configured the system
3489 cf_time=`LC_ALL=C; LANGUAGE=C; export LC_ALL; export LANGUAGE; $date 2>&1`
3492 cf_by=`(logname) 2>/dev/null`
3495 cf_by=`(whoami) 2>/dev/null`
3497 "") cf_by=unknown ;;
3502 : set up the script used to warn in case of inconsistency
3509 echo "*** WHOA THERE!!! ***" >&4
3510 echo " The $hint value for \$$var on this machine was \"$was\"!" >&4
3511 rp=" Keep the $hint value?"
3514 y) td=$was; tu=$was;;
3518 : function used to set $1 to $val
3519 setvar='var=$1; eval "was=\$$1"; td=$define; tu=$undef;
3521 $define$undef) . ./whoa; eval "$var=\$td";;
3522 $undef$define) . ./whoa; eval "$var=\$tu";;
3523 *) eval "$var=$val";;
3527 $define|true|[yY]*) dflt='y';;
3532 Perl can be built to use the SOCKS proxy protocol library. To do so,
3533 Configure must be run with -Dusesocks. If you use SOCKS you also need
3534 to use the PerlIO abstraction layer, this will be implicitly selected.
3536 If this doesn't make any sense to you, just accept the default '$dflt'.
3538 rp='Build Perl for SOCKS?'
3541 y|Y) val="$define" ;;
3548 $define|true|[yY]*) useperlio="$define";;
3551 case "$useperlio" in
3552 $define|true|[yY]*|'') dflt='y';;
3557 Previous version of $package used the standard IO mechanisms as
3558 defined in <stdio.h>. Versions 5.003_02 and later of $package allow
3559 alternate IO mechanisms via the PerlIO abstraction layer, but the
3560 stdio mechanism is still available if needed. The abstraction layer
3561 can use AT&T's sfio (if you already have sfio installed) or regular stdio.
3562 Using PerlIO with sfio may cause problems with some extension modules.
3564 If this doesn't make any sense to you, just accept the default '$dflt'.
3566 rp='Use the PerlIO abstraction layer?'
3573 echo "Ok, doing things the stdio way."
3582 case "$useperlio" in
3583 $define|true|[yY]*) ;;
3586 You are using the SOCKS proxy protocol library which means that you
3587 should also use the PerlIO layer. You may be headed for trouble.
3596 case "$usethreads" in
3597 $define|true|[yY]*) dflt='y';;
3598 *) # Catch case where user specified ithreads or 5005threads but
3599 # forgot -Dusethreads (A.D. 4/2002)
3600 case "$useithreads$use5005threads" in
3602 case "$useperlio" in
3603 "$define") dflt='y' ;;
3613 Perl can be built to take advantage of threads on some systems.
3614 To do so, Configure can be run with -Dusethreads.
3616 Note that Perl built with threading support runs slightly slower
3617 and uses more memory than plain Perl. The current implementation
3618 is believed to be stable, but it is fairly new, and so should be
3619 treated with caution.
3621 If this doesn't make any sense to you, just accept the default '$dflt'.
3623 rp='Build a threading Perl?'
3626 y|Y) val="$define" ;;
3632 case "$usethreads" in
3636 Since release 5.6, Perl has had two different threading implementations,
3637 the newer interpreter-based version (ithreads) with one interpreter per
3638 thread, and the older 5.005 version (5005threads).
3639 The 5005threads version is effectively unmaintained and will probably be
3640 removed in Perl 5.10, so there should be no need to build a Perl using it
3641 unless needed for backwards compatibility with some existing 5.005threads
3645 : Default to ithreads unless overridden on command line or with
3648 case "$use5005threads" in
3649 $define|true|[yY]*) dflt='n';;
3651 case "$useithreads" in
3652 $undef|false|[nN]*) dflt='n';;
3654 rp='Use the newer interpreter-based ithreads?'
3657 y|Y) val="$define" ;;
3662 : Now set use5005threads to the opposite value.
3663 case "$useithreads" in
3664 $define) val="$undef" ;;
3671 useithreads="$undef"
3672 use5005threads="$undef"
3676 case "$useithreads$use5005threads" in
3680 You cannot have both the ithreads and the 5.005 threads enabled
3681 at the same time. Disabling the 5.005 threads since they are
3682 much less stable than the ithreads.
3685 use5005threads="$undef"
3689 if test X"$usethreads" = "X$define" -a "X$useperlio" = "Xundef"; then
3692 *** To build with ithreads you must also use the PerlIO layer.
3693 *** Cannot continue, aborting.
3699 case "$d_oldpthreads" in
3700 '') : Configure tests would be welcome here. For now, assume undef.
3702 *) val="$d_oldpthreads" ;;
3708 : Look for a hint-file generated 'call-back-unit'. If the
3709 : user has specified that a threading perl is to be built,
3710 : we may need to set or change some other defaults.
3711 if $test -f usethreads.cbu; then
3712 echo "Your platform has some specific hints regarding threaded builds, using them..."
3715 case "$usethreads" in
3716 "$define"|true|[yY]*)
3718 (Your platform does not have any specific hints for threaded builds.
3719 Assuming POSIX threads, then.)
3727 Perl can be built so that multiple Perl interpreters can coexist
3728 within the same Perl executable.
3731 case "$useithreads" in
3734 This multiple interpreter support is required for interpreter-based threads.
3738 *) case "$usemultiplicity" in
3739 $define|true|[yY]*) dflt='y';;
3743 echo "If this doesn't make any sense to you, just accept the default '$dflt'."
3744 rp='Build Perl for multiplicity?'
3747 y|Y) val="$define" ;;
3756 case "$usemorebits" in
3757 "$define"|true|[yY]*)
3758 use64bitint="$define"
3759 uselongdouble="$define"
3760 usemorebits="$define"
3762 *) usemorebits="$undef"
3766 : make some quick guesses about what we are up against
3768 $echo $n "Hmm... $c"
3778 $cat /usr/include/signal.h /usr/include/sys/signal.h >foo 2>/dev/null
3779 if test -f /osf_boot || $contains 'OSF/1' /usr/include/ctype.h >/dev/null 2>&1
3781 echo "Looks kind of like an OSF/1 system, but we'll see..."
3783 elif test `echo abc | $tr a-z A-Z` = Abc ; then
3784 xxx=`./loc addbib blurfl $pth`
3785 if $test -f $xxx; then
3786 echo "Looks kind of like a USG system with BSD features, but we'll see..."
3790 if $contains SIGTSTP foo >/dev/null 2>&1 ; then
3791 echo "Looks kind of like an extended USG system, but we'll see..."
3793 echo "Looks kind of like a USG system, but we'll see..."
3797 elif $contains SIGTSTP foo >/dev/null 2>&1 ; then
3798 echo "Looks kind of like a BSD system, but we'll see..."
3802 echo "Looks kind of like a Version 7 system, but we'll see..."
3805 case "$eunicefix" in
3808 There is, however, a strange, musty smell in the air that reminds me of
3809 something...hmm...yes...I've got it...there's a VMS nearby, or I'm a Blit.
3813 : it so happens the Eunice I know will not run shell scripts in Unix format
3817 echo "Congratulations. You aren't running Eunice."
3821 : Detect OS2. The p_ variable is set above in the Head.U unit.
3822 : Note that this also -- wrongly -- detects e.g. dos-djgpp, which also uses
3823 : semicolon as a patch separator
3828 I have the feeling something is not exactly right, however...don't tell me...
3829 lemme think...does HAL ring a bell?...no, of course, you're only running OS/2!
3830 (Or you may be running DOS with DJGPP.)
3835 if test -f /xenix; then
3836 echo "Actually, this looks more like a XENIX system..."
3841 echo "It's not Xenix..."
3846 if test -f /venix; then
3847 echo "Actually, this looks more like a VENIX system..."
3854 echo "Nor is it Venix..."
3857 chmod +x bsd usg v7 osf1 eunice xenix venix os2
3858 $eunicefix bsd usg v7 osf1 eunice xenix venix os2
3865 rp="Use which C compiler?"
3869 : See if they have not cc but they do have gcc
3871 : Look for a hint-file generated 'call-back-unit'. Now that the
3872 : user has specified the compiler, we may need to set or change some
3874 if $test -f cc.cbu; then
3880 echo "Checking for GNU cc in disguise and/or its version number..." >&4
3886 printf("%s\n", __VERSION__);
3888 printf("%s\n", "1");
3894 if $cc -o try $ccflags $ldflags try.c; then
3895 gccversion=`$run ./try`
3896 case "$gccversion" in
3897 '') echo "You are not using GNU cc." ;;
3898 *) echo "You are using GNU cc $gccversion."
3904 echo "*** WHOA THERE!!! ***" >&4
3905 echo " Your C compiler \"$cc\" doesn't seem to be working!" >&4
3906 case "$knowitall" in
3908 echo " You'd better start hunting for one and let me know about it." >&4
3914 case "$gccversion" in
3915 1*) cpp=`./loc gcc-cpp $cpp $pth` ;;
3917 case "$gccversion" in
3918 '') gccosandvers='' ;;
3919 *) gccshortvers=`echo "$gccversion"|sed 's/ .*//'`
3920 gccosandvers=`$cc -v 2>&1|grep '/specs$'|sed "s!.*/[^-/]*-[^-/]*-\([^-/]*\)/$gccshortvers/specs!\1!"`
3922 case "$gccosandvers" in
3923 $osname) gccosandvers='' ;; # linux gccs seem to have no linux osvers, grr
3924 $osname$osvers) ;; # looking good
3925 $osname*) cat <<EOM >&4
3927 *** WHOA THERE!!! ***
3929 Your gcc has not been compiled for the exact release of
3930 your operating system ($gccosandvers versus $osname$osvers).
3932 In general it is a good idea to keep gcc synchronized with
3933 the operating system because otherwise serious problems
3934 may ensue when trying to compile software, like Perl.
3936 I'm trying to be optimistic here, though, and will continue.
3937 If later during the configuration and build icky compilation
3938 problems appear (headerfile conflicts being the most common
3939 manifestation), I suggest reinstalling the gcc to match
3940 your operating system release.
3944 *) gccosandvers='' ;; # failed to parse, better be silent
3952 # gcc 3.* complain about adding -Idirectories that they already know about,
3953 # so we will take those off from locincpth.
3954 case "$gccversion" in
3956 echo "main(){}">try.c
3957 for incdir in $locincpth; do
3958 warn=`$cc $ccflags -I$incdir -c try.c 2>&1 | \
3959 grep '^c[cp]p*[01]: warning: changing search order '`
3960 if test "X$warn" != X; then
3961 locincpth=`echo " $locincpth " | sed "s! $incdir ! !"`
3967 : decide how portable to be. Allow command line overrides.
3968 case "$d_portable" in
3970 *) d_portable="$define" ;;
3973 : set up shell script to do ~ expansion
3979 echo \$1 | $sed "s|~|\${HOME-\$LOGDIR}|"
3982 if $test -f /bin/csh; then
3983 /bin/csh -f -c "glob \$1"
3988 name=\`$expr x\$1 : '..\([^/]*\)'\`
3989 dir=\`$sed -n -e "/^\${name}:/{s/^[^:]*:[^:]*:[^:]*:[^:]*:[^:]*:\([^:]*\).*"'\$'"/\1/" -e p -e q -e '}' </etc/passwd\`
3990 if $test ! -d "\$dir"; then
3992 echo "\$me: can't locate home directory for: \$name" >&2
3997 echo \$dir/\`$expr x\$1 : '..[^/]*/\(.*\)'\`
4013 : now set up to get a file name
4017 cat <<'EOSC' >>getfile
4033 : getfile will accept an answer from the comma-separated list
4034 : enclosed in parentheses even if it does not meet other criteria.
4035 expr "$fn" : '.*(\(.*\)).*' | $tr ',' $trnl >getfile.ok
4036 fn=`echo $fn | sed 's/(.*)//'`
4042 loc_file=`expr $fn : '.*:\(.*\)'`
4043 fn=`expr $fn : '\(.*\):.*'`
4051 */*) fullpath=true;;
4060 *e*) exp_file=true;;
4063 *p*) nopath_ok=true;;
4068 *d*) type='Directory';;
4069 *l*) type='Locate';;
4074 Locate) what='File';;
4079 case "$d_portable" in
4087 while test "$type"; do
4092 true) rp="$rp (~name ok)";;
4095 if test -f UU/getfile.ok && \
4096 $contains "^$ans\$" UU/getfile.ok >/dev/null 2>&1
4115 value=`UU/filexp $ans`
4118 if test "$ans" != "$value"; then
4119 echo "(That expands to $value on this system.)"
4133 /*) value="$ansexp" ;;
4134 [a-zA-Z]:/*) value="$ansexp" ;;
4139 echo "I shall only accept a full path name, as in /bin/ls." >&4
4140 echo "Use a ! shell escape if you wish to check pathnames." >&4
4143 echo "Please give a full path name, starting with slash." >&4
4146 echo "Note that using ~name is ok provided it expands well." >&4
4159 for fp in $gfpth; do
4160 if test "X$fp" = X.; then
4165 if test -f "$pf"; then
4167 elif test -r "$pf" || (test -h "$pf") >/dev/null 2>&1
4169 echo "($value is not a plain file, but that's ok.)"
4172 if test X"$type" = X; then
4179 for fp in $gfpth; do
4180 if test "X$fp" = X.; then
4185 direxp="$fp/$ansexp"
4187 if test -d "$direxp"; then
4195 if test -d "$ansexp"; then
4196 echo "(Looking for $loc_file in directory $value.)"
4197 value="$value/$loc_file"
4198 ansexp="$ansexp/$loc_file"
4200 if test -f "$ansexp"; then
4203 case "$nopath_ok" in
4204 true) case "$value" in
4206 *) echo "Assuming $value will be in people's path."
4222 if test "$fastread" = yes; then
4227 rp="$what $value doesn't exist. Use that name anyway?"
4246 test "X$gfpthkeep" != Xy && gfpth=""
4249 : What should the include directory be ?
4251 $echo $n "Hmm... $c"
4255 if $test -f /bin/mips && /bin/mips; then
4256 echo "Looks like a MIPS system..."
4257 $cat >usr.c <<'EOCP'
4258 #ifdef SYSTYPE_BSD43
4262 if cc -E usr.c > usr.out && $contains / usr.out >/dev/null 2>&1; then
4263 dflt='/bsd43/usr/include'
4267 mips_type='System V'
4269 $rm -f usr.c usr.out
4270 echo "and you're compiling with the $mips_type compiler and libraries."
4274 echo "Doesn't look like a MIPS system."
4284 case "$xxx_prompt" in
4287 rp='Where are the include files you want to use?'
4295 : see how we invoke the C preprocessor
4297 echo "Now, how can we feed standard input to your C preprocessor..." >&4
4298 cat <<'EOT' >testcpp.c
4304 if test ! -f cppstdin; then
4305 if test "X$osname" = "Xaix" -a "X$gccversion" = X; then
4306 # AIX cc -E doesn't show the absolute headerfile
4307 # locations but we'll cheat by using the -M flag.
4308 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
4310 echo 'cat >.$$.c; '"$cc"' -E ${1+"$@"} .$$.c; rm .$$.c' >cppstdin
4313 echo "Keeping your $hint cppstdin wrapper."
4316 wrapper=`pwd`/cppstdin
4320 if $test "X$cppstdin" != "X" && \
4321 $cppstdin $cppminus <testcpp.c >testcpp.out 2>&1 && \
4322 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
4324 echo "You used to use $cppstdin $cppminus so we'll use that again."
4326 '') echo "But let's see if we can live without a wrapper..." ;;
4328 if $cpprun $cpplast <testcpp.c >testcpp.out 2>&1 && \
4329 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
4331 echo "(And we'll use $cpprun $cpplast to preprocess directly.)"
4334 echo "(However, $cpprun $cpplast does not work, let's see...)"
4342 echo "Good old $cppstdin $cppminus does not seem to be of any help..."
4349 elif echo 'Maybe "'"$cc"' -E" will work...'; \
4350 $cc -E <testcpp.c >testcpp.out 2>&1; \
4351 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4352 echo "Yup, it does."
4355 elif echo 'Nope...maybe "'"$cc"' -E -" will work...'; \
4356 $cc -E - <testcpp.c >testcpp.out 2>&1; \
4357 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4358 echo "Yup, it does."
4361 elif echo 'Nope...maybe "'"$cc"' -P" will work...'; \
4362 $cc -P <testcpp.c >testcpp.out 2>&1; \
4363 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4364 echo "Yipee, that works!"
4367 elif echo 'Nope...maybe "'"$cc"' -P -" will work...'; \
4368 $cc -P - <testcpp.c >testcpp.out 2>&1; \
4369 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4370 echo "At long last!"
4373 elif echo 'No such luck, maybe "'$cpp'" will work...'; \
4374 $cpp <testcpp.c >testcpp.out 2>&1; \
4375 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4379 elif echo 'Nixed again...maybe "'$cpp' -" will work...'; \
4380 $cpp - <testcpp.c >testcpp.out 2>&1; \
4381 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4382 echo "Hooray, it works! I was beginning to wonder."
4385 elif echo 'Uh-uh. Time to get fancy. Trying a wrapper...'; \
4386 $wrapper <testcpp.c >testcpp.out 2>&1; \
4387 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4393 rp="No dice. I can't find a C preprocessor. Name one:"
4397 $x_cpp <testcpp.c >testcpp.out 2>&1
4398 if $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4399 echo "OK, that will do." >&4
4401 echo "Sorry, I can't get that to work. Go find one and rerun Configure." >&4
4416 echo "Perhaps can we force $cc -E using a wrapper..."
4417 if $wrapper <testcpp.c >testcpp.out 2>&1; \
4418 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
4424 echo "Nope, we'll have to live without it..."
4438 "$wrapper"|'cppstdin') ;;
4439 *) $rm -f $wrapper;;
4441 $rm -f testcpp.c testcpp.out
4443 : Set private lib path
4446 plibpth="$incpath/usr/lib /usr/local/lib /usr/ccs/lib"
4451 '') dlist="$loclibpth $plibpth $glibpth";;
4452 *) dlist="$libpth";;
4455 : Now check and see which directories actually exist, avoiding duplicates
4459 if $test -d $xxx; then
4462 *) libpth="$libpth $xxx";;
4468 Some systems have incompatible or broken versions of libraries. Among
4469 the directories listed in the question below, please remove any you
4470 know not to be holding relevant libraries, and add any that are needed.
4471 Say "none" for none.
4482 rp="Directories to use for library searches?"
4489 : compute shared library extension
4492 if xxx=`./loc libc.sl X $libpth`; $test -f "$xxx"; then
4502 On some systems, shared libraries may be available. Answer 'none' if
4503 you want to suppress searching of shared libraries for the remainder
4504 of this configuration.
4507 rp='What is the file extension used for shared libraries?'
4511 : Define several unixisms.
4512 : Hints files or command line option can be used to override them.
4513 : The convoluted testing is in case hints files set either the old
4516 '') case "$exe_ext" in
4518 *) _exe="$exe_ext" ;;
4523 '') case "$lib_ext" in
4530 '') case "$obj_ext" in
4537 '') case "$path_sep" in
4548 : Which makefile gets called first. This is used by make depend.
4549 case "$firstmakefile" in
4550 '') firstmakefile='makefile';;
4554 *-DUSE_LONG_DOUBLE*|*-DUSE_MORE_BITS*) uselongdouble="$define" ;;
4557 case "$uselongdouble" in
4558 $define|true|[yY]*) dflt='y';;
4563 Perl can be built to take advantage of long doubles which
4564 (if available) may give more accuracy and range for floating point numbers.
4566 If this doesn't make any sense to you, just accept the default '$dflt'.
4568 rp='Try to use long doubles if available?'
4571 y|Y) val="$define" ;;
4577 case "$uselongdouble" in
4578 true|[yY]*) uselongdouble="$define" ;;
4581 : Look for a hint-file generated 'call-back-unit'. If the
4582 : user has specified that long doubles should be used,
4583 : we may need to set or change some other defaults.
4584 if $test -f uselongdouble.cbu; then
4585 echo "Your platform has some specific hints regarding long doubles, using them..."
4586 . ./uselongdouble.cbu
4588 case "$uselongdouble" in
4591 (Your platform does not have any specific hints for long doubles.)
4597 : Looking for optional libraries
4599 echo "Checking for optional libraries..." >&4
4604 case "$libswanted" in
4605 '') libswanted='c_s';;
4608 "$define") libswanted="$libswanted socks5 socks5_sh" ;;
4614 for thisdir in $libpth $xlibpth; do
4615 test -d $thisdir && libspath="$libspath $thisdir"
4617 for thislib in $libswanted; do
4618 for thisdir in $libspath; do
4620 if $test ! -f "$xxx" -a "X$ignore_versioned_solibs" = "X"; then
4621 xxx=`ls $thisdir/lib$thislib.$so.[0-9] 2>/dev/null|sed -n '$p'`
4622 $test -f "$xxx" && eval $libscheck
4623 $test -f "$xxx" && libstyle=shared
4625 if test ! -f "$xxx"; then
4626 xxx=$thisdir/lib$thislib.$so
4627 $test -f "$xxx" && eval $libscheck
4628 $test -f "$xxx" && libstyle=shared
4630 if test ! -f "$xxx"; then
4631 xxx=$thisdir/lib$thislib$_a
4632 $test -f "$xxx" && eval $libscheck
4633 $test -f "$xxx" && libstyle=static
4635 if test ! -f "$xxx"; then
4636 xxx=$thisdir/$thislib$_a
4637 $test -f "$xxx" && eval $libscheck
4638 $test -f "$xxx" && libstyle=static
4640 if test ! -f "$xxx"; then
4641 xxx=$thisdir/lib${thislib}_s$_a
4642 $test -f "$xxx" && eval $libscheck
4643 $test -f "$xxx" && libstyle=static
4644 $test -f "$xxx" && thislib=${thislib}_s
4646 if test ! -f "$xxx"; then
4647 xxx=$thisdir/Slib$thislib$_a
4648 $test -f "$xxx" && eval $libscheck
4649 $test -f "$xxx" && libstyle=static
4651 if $test -f "$xxx"; then
4653 shared) echo "Found -l$thislib (shared)." ;;
4654 static) echo "Found -l$thislib." ;;
4655 *) echo "Found -l$thislib ($libstyle)." ;;
4659 *) dflt="$dflt -l$thislib"
4660 libsfound="$libsfound $xxx"
4662 libsfiles="$libsfiles $yyy"
4663 yyy=`echo $xxx|$sed -e "s%/$yyy\\$%%"`
4664 case " $libsdirs " in
4666 *) libsdirs="$libsdirs $yyy" ;;
4673 if $test ! -f "$xxx"; then
4674 echo "No -l$thislib."
4685 ' '|'') dflt='none';;
4690 In order to compile $package on your machine, a number of libraries
4691 are usually needed. Include any other special libraries here as well.
4692 Say "none" for none. The default list is almost always right.
4696 rp="What libraries to use?"
4703 : determine optimization, if desired, or use for debug flag also
4705 ' '|$undef) dflt='none';;
4707 *) dflt="$optimize";;
4711 By default, $package compiles with the -O flag to use the optimizer.
4712 Alternately, you might want to use the symbolic debugger, which uses
4713 the -g flag (on traditional Unix systems). Either flag can be
4714 specified here. To use neither flag, specify the word "none".
4717 rp="What optimizer/debugger flag should be used?"
4721 'none') optimize=" ";;
4725 : We will not override a previous value, but we might want to
4726 : augment a hint file
4728 default|recommended)
4729 case "$gccversion" in
4730 1*) dflt='-fpcc-struct-return' ;;
4733 *-g*) dflt="$dflt -DDEBUGGING";;
4735 case "$gccversion" in
4736 2*) if test -d /etc/conf/kconfig.d &&
4737 $contains _POSIX_VERSION $usrinc/sys/unistd.h >/dev/null 2>&1
4739 # Interactive Systems (ISC) POSIX mode.
4744 case "$gccversion" in
4748 echo "Checking if your compiler accepts -fno-strict-aliasing" 2>&1
4749 echo 'int main(void) { return 0; }' > gcctest.c
4750 if $cc -O2 -fno-strict-aliasing -o gcctest gcctest.c; then
4751 echo "Yes, it does." 2>&1
4754 echo "Leaving current flags $ccflags alone." 2>&1
4756 *) dflt="$dflt -fno-strict-aliasing" ;;
4759 echo "Nope, it doesn't, but that's ok." 2>&1
4763 # For gcc, adding -pipe speeds up compilations for some, but apparently
4764 # some assemblers can't read from stdin. (It also slows down compilations
4765 # in other cases, but those are apparently rarer these days.) AD 5/2004.
4766 case "$gccversion" in
4768 echo "Checking if your compiler accepts -pipe" 2>&1
4769 echo 'int main(void) { return 0; }' > gcctest.c
4770 if $cc -pipe -o gcctest gcctest.c; then
4771 echo "Yes, it does." 2>&1
4774 echo "Leaving current flags $ccflags alone." 2>&1
4776 *) dflt="$dflt -pipe" ;;
4779 echo "Nope, it doesn't, but that's ok." 2>&1
4782 echo "Checking if your compiler accepts -Wdeclaration-after-statement" 2>&1
4783 echo 'int main(void) { return 0; }' > gcctest.c
4784 if $cc -Wdeclaration-after-statement -o gcctest gcctest.c; then
4785 echo "Yes, it does." 2>&1
4787 *-Wdeclaration-after-statement*)
4788 echo "Leaving current flags $ccflags alone." 2>&1
4790 *) dflt="$dflt -Wdeclaration-after-statement" ;;
4793 echo "Nope, it doesn't, but that's ok." 2>&1
4800 case "$mips_type" in
4801 *BSD*|'') inclwanted="$locincpth $usrinc";;
4802 *) inclwanted="$locincpth $inclwanted $usrinc/bsd";;
4804 for thisincl in $inclwanted; do
4805 if $test -d $thisincl; then
4806 if $test x$thisincl != x$usrinc; then
4808 *" -I$thisincl "*);;
4809 *) dflt="$dflt -I$thisincl ";;
4815 inctest='if $contains $2 $usrinc/$1 >/dev/null 2>&1; then
4817 elif $contains $2 $usrinc/sys/$1 >/dev/null 2>&1; then
4825 *) dflt="$dflt -D$2";;
4829 set signal.h LANGUAGE_C; eval $inctest
4833 ccflags="$ccflags -DSOCKS"
4838 default|recommended) dflt="$ccflags $dflt" ;;
4839 *) dflt="$ccflags";;
4848 Your C compiler may want other flags. For this question you should include
4849 -I/whatever and -DWHATEVER flags and any other flags used by the C compiler,
4850 but you should NOT include libraries or ld flags like -lwhatever. If you
4851 want $package to honor its debug switch, you should include -DDEBUGGING here.
4852 Your C compiler might also need additional flags, such as -D_POSIX_SOURCE.
4854 To use no flags, specify the word "none".
4860 rp="Any additional cc flags?"
4867 : the following weeds options from ccflags that are of no interest to cpp
4869 '') cppflags="$ccflags" ;;
4870 *) cppflags="$cppflags $ccflags" ;;
4872 case "$gccversion" in
4873 1*) cppflags="$cppflags -D__GNUC__"
4875 case "$mips_type" in
4877 *BSD*) cppflags="$cppflags -DSYSTYPE_BSD43";;
4883 echo "Let me guess what the preprocessor flags are..." >&4
4897 *) ftry="$previous $flag";;
4899 if $cppstdin -DLFRULB=bar $cppflags $ftry $cppminus <cpp.c \
4900 >cpp1.out 2>/dev/null && \
4901 $cpprun -DLFRULB=bar $cppflags $ftry $cpplast <cpp.c \
4902 >cpp2.out 2>/dev/null && \
4903 $contains 'foo.*xx.*bar' cpp1.out >/dev/null 2>&1 && \
4904 $contains 'foo.*xx.*bar' cpp2.out >/dev/null 2>&1
4906 cppflags="$cppflags $ftry"
4916 *-*) echo "They appear to be: $cppflags";;
4918 $rm -f cpp.c cpp?.out
4922 : flags used in final linking phase
4924 '') if ./venix; then
4930 *-posix*) dflt="$dflt -posix" ;;
4933 *) dflt="$ldflags";;
4936 : Try to guess additional flags to pick up local libraries.
4937 for thislibdir in $libpth; do
4938 case " $loclibpth " in
4941 *"-L$thislibdir "*) ;;
4942 *) dflt="$dflt -L$thislibdir" ;;
4954 Your C linker may need flags. For this question you should
4955 include -L/whatever and any other flags used by the C linker, but you
4956 should NOT include libraries like -lwhatever.
4958 Make sure you include the appropriate -L/path flags if your C linker
4959 does not normally search all of the directories you specified above,
4962 To use no flags, specify the word "none".
4966 rp="Any additional ld flags (NOT including libraries)?"
4972 rmlist="$rmlist pdp11"
4976 echo "Checking your choice of C compiler and flags for coherency..." >&4
4977 $cat > try.c <<'EOF'
4979 int main() { printf("Ok\n"); return(0); }
4981 set X $cc -o try $optimize $ccflags $ldflags try.c $libs
4983 $cat >try.msg <<'EOM'
4984 I've tried to compile and run the following simple program:
4987 $cat try.c >> try.msg
4989 $cat >> try.msg <<EOM
4996 and I got the following output:
5000 if $sh -c "$cc -o try $optimize $ccflags $ldflags try.c $libs" >>try.msg 2>&1; then
5001 if $sh -c "$run ./try" >>try.msg 2>&1; then
5005 *) echo 'The program compiled OK, but produced no output.' >> try.msg
5008 cat >> try.msg <<'EOQS'
5009 If $libs contains -lsfio, and sfio is mis-configured, then it
5010 sometimes (apparently) runs and exits with a 0 status, but with no
5011 output! It may have to do with sfio's use of _exit vs. exit.
5014 rp="You have a big problem. Shall I abort Configure"
5021 echo "The program compiled OK, but exited with status $?." >>try.msg
5022 rp="You have a problem. Shall I abort Configure"
5026 echo "I can't compile the test program." >>try.msg
5027 rp="You have a BIG problem. Shall I abort Configure"
5033 case "$knowitall" in
5035 echo "(The supplied flags or libraries might be incorrect.)"
5043 *) echo "Ok. Stopping Configure." >&4
5048 n) echo "OK, that should do.";;
5050 $rm -f try try.* core
5052 : define a shorthand compile call
5056 $cc -o ${mc_file} $optimize $ccflags $ldflags $* ${mc_file}.c $libs > /dev/null 2>&1;'
5057 : define a shorthand compile call for compilations that should be ok.
5061 $cc -o ${mc_file} $optimize $ccflags $ldflags $* ${mc_file}.c $libs;'
5063 : determine filename position in cpp output
5065 echo "Computing filename position in cpp output for #include directives..." >&4
5067 vos) testaccess=-e ;;
5070 echo '#include <stdio.h>' > foo.c
5073 $cppstdin $cppflags $cppminus <foo.c 2>/dev/null | \
5074 $grep '^[ ]*#.*stdio\.h' | \
5075 while read cline; do
5078 while $test \$# -gt 0; do
5079 if $test $testaccess \`echo \$1 | $tr -d '"'\`; then
5084 pos=\`expr \$pos + 1\`
5096 *) pos="${fieldn}th";;
5098 echo "Your cpp writes the filename in the $pos field of the line."
5101 vos) cppfilter="tr '\\\\>' '/' |" ;; # path component separator is >
5102 os2) cppfilter="sed -e 's|\\\\\\\\|/|g' |" ;; # path component separator is \
5105 : locate header file
5110 for usrincdir in $usrinc
5112 if test -f \$usrincdir/\$wanted; then
5113 echo "\$usrincdir/\$wanted"
5117 awkprg='{ print \$$fieldn }'
5118 echo "#include <\$wanted>" > foo\$\$.c
5119 $cppstdin $cppminus $cppflags < foo\$\$.c 2>/dev/null | \
5120 $cppfilter $grep "^[ ]*#.*\$wanted" | \
5121 while read cline; do
5122 name=\`echo \$cline | $awk "\$awkprg" | $tr -d '"'\`
5124 *[/\\\\]\$wanted) echo "\$name"; exit 1;;
5125 *[\\\\/]\$wanted) echo "\$name"; exit 1;;
5130 # status = 0: grep returned 0 lines, case statement not executed
5131 # status = 1: headerfile found
5132 # status = 2: while loop executed, no headerfile found
5136 if test \$status -eq 1; then
5143 : define an alternate in-header-list? function
5144 inhdr='echo " "; td=$define; tu=$undef; yyy=$@;
5145 cont=true; xxf="echo \"<\$1> found.\" >&4";
5146 case $# in 2) xxnf="echo \"<\$1> NOT found.\" >&4";;
5147 *) xxnf="echo \"<\$1> NOT found, ...\" >&4";;
5149 case $# in 4) instead=instead;; *) instead="at last";; esac;
5150 while $test "$cont"; do
5152 var=$2; eval "was=\$$2";
5153 if $test "$xxx" && $test -r "$xxx";
5155 eval "case \"\$$var\" in $undef) . ./whoa; esac"; eval "$var=\$td";
5158 eval "case \"\$$var\" in $define) . ./whoa; esac"; eval "$var=\$tu"; fi;
5159 set $yyy; shift; shift; yyy=$@;
5160 case $# in 0) cont="";;
5161 2) xxf="echo \"but I found <\$1> $instead.\" >&4";
5162 xxnf="echo \"and I did not find <\$1> either.\" >&4";;
5163 *) xxf="echo \"but I found <\$1\> instead.\" >&4";
5164 xxnf="echo \"there is no <\$1>, ...\" >&4";;
5168 do set $yyy; var=$2; eval "was=\$$2";
5169 eval "case \"\$$var\" in $define) . ./whoa; esac"; eval "$var=\$tu";
5170 set $yyy; shift; shift; yyy=$@;
5173 : see if stdlib is available
5174 set stdlib.h i_stdlib
5177 : check for lengths of integral types
5181 echo "Checking to see how big your integers are..." >&4
5190 printf("intsize=%d;\n", (int)sizeof(int));
5191 printf("longsize=%d;\n", (int)sizeof(long));
5192 printf("shortsize=%d;\n", (int)sizeof(short));
5197 if eval $compile_ok && $run ./try > /dev/null; then
5199 echo "Your integers are $intsize bytes long."
5200 echo "Your long integers are $longsize bytes long."
5201 echo "Your short integers are $shortsize bytes long."
5205 Help! I can't compile and run the intsize test program: please enlighten me!
5206 (This is probably a misconfiguration in your system or libraries, and
5207 you really ought to fix it. Still, I'll try anyway.)
5211 rp="What is the size of an integer (in bytes)?"
5215 rp="What is the size of a long integer (in bytes)?"
5219 rp="What is the size of a short integer (in bytes)?"
5227 : check for long long
5229 echo "Checking to see if you have long long..." >&4
5230 echo 'int main() { long long x = 7; return 0; }' > try.c
5232 if eval $compile; then
5234 echo "You have long long."
5237 echo "You do not have long long."
5243 : check for length of long long
5244 case "${d_longlong}${longlongsize}" in
5247 echo "Checking to see how big your long longs are..." >&4
5248 $cat >try.c <<'EOCP'
5252 printf("%d\n", (int)sizeof(long long));
5257 if eval $compile_ok; then
5258 longlongsize=`$run ./try`
5259 echo "Your long longs are $longlongsize bytes long."
5263 echo "(I can't seem to compile the test program. Guessing...)"
5264 rp="What is the size of a long long (in bytes)?"
5268 if $test "X$longsize" = "X$longlongsize"; then
5269 echo "(That isn't any different from an ordinary long.)"
5275 : see if inttypes.h is available
5276 : we want a real compile instead of Inhdr because some systems
5277 : have an inttypes.h which includes non-existent headers
5280 #include <inttypes.h>
5282 static int32_t foo32 = 0x12345678;
5286 if eval $compile; then
5287 echo "<inttypes.h> found." >&4
5290 echo "<inttypes.h> NOT found." >&4
5299 echo "Checking to see if you have int64_t..." >&4
5301 #include <sys/types.h>
5302 #$i_inttypes I_INTTYPES
5304 #include <inttypes.h>
5306 int main() { int64_t x = 7; }
5309 if eval $compile; then
5311 echo "You have int64_t."
5314 echo "You do not have int64_t."
5322 echo "Checking which 64-bit integer type we could use..." >&4
5328 val='"unsigned int"'
5333 *) case "$longsize" in
5337 val='"unsigned long"'
5342 *) case "$d_longlong:$longlongsize" in
5347 val='"unsigned long long"'
5352 *) case "$d_int64_t" in
5371 '') echo "Alas, no 64-bit integer types in sight." >&4
5374 *) echo "We could use '$quadtype' for 64-bit integers." >&4
5380 case "$uselonglong" in
5381 "$define"|true|[yY]*)
5384 *** Configure -Duselonglong is deprecated, using -Duse64bitint instead.
5386 use64bitint="$define"
5389 case "$use64bits" in
5390 "$define"|true|[yY]*)
5393 *** Configure -Duse64bits is deprecated, using -Duse64bitint instead.
5395 use64bitint="$define"
5398 case "$use64bitints" in
5399 "$define"|true|[yY]*)
5402 *** There is no Configure -Duse64bitints, using -Duse64bitint instead.
5404 use64bitint="$define"
5407 case "$use64bitsint" in
5408 "$define"|true|[yY]*)
5411 *** There is no Configure -Duse64bitsint, using -Duse64bitint instead.
5413 use64bitint="$define"
5416 case "$uselonglongs" in
5417 "$define"|true|[yY]*)
5420 *** There is no Configure -Duselonglongs, using -Duse64bitint instead.
5422 use64bitint="$define"
5425 case "$use64bitsall" in
5426 "$define"|true|[yY]*)
5429 *** There is no Configure -Duse64bitsall, using -Duse64bitall instead.
5431 use64bitall="$define"
5436 *-DUSE_LONG_LONG*|*-DUSE_64_BIT_INT*|*-DUSE_64_BIT_ALL*) use64bitint="$define";;
5438 case "$use64bitall" in
5439 "$define"|true|[yY]*) use64bitint="$define" ;;
5445 You have natively 64-bit long integers.
5449 *) case "$use64bitint" in
5450 "$define"|true|[yY]*) dflt='y';;
5459 Perl can be built to take advantage of 64-bit integer types
5460 on some systems. To do so, Configure can be run with -Duse64bitint.
5461 Choosing this option will most probably introduce binary incompatibilities.
5463 If this doesn't make any sense to you, just accept the default '$dflt'.
5464 (The default has been chosen based on your configuration.)
5466 rp='Try to use 64-bit integers, if available?'
5469 [yY]*) val="$define" ;;
5477 case "$use64bitall" in
5478 "$define"|true|[yY]*) dflt='y' ;;
5479 *) case "$longsize" in
5487 You may also choose to try maximal 64-bitness. It means using as much
5488 64-bitness as possible on the platform. This in turn means even more
5489 binary incompatibilities. On the other hand, your platform may not
5490 have any more 64-bitness available than what you already have chosen.
5492 If this doesn't make any sense to you, just accept the default '$dflt'.
5493 (The default has been chosen based on your configuration.)
5495 rp='Try to use maximal 64-bit support, if available?'
5498 [yY]*) val="$define" ;;
5503 case "$use64bitall" in
5505 case "$use64bitint" in
5509 Since you have chosen a maximally 64-bit build, I'm also turning on
5510 the use of 64-bit integers.
5512 use64bitint="$define" ;;
5517 : Look for a hint-file generated 'call-back-unit'. If the
5518 : user has specified that a 64-bit perl is to be built,
5519 : we may need to set or change some other defaults.
5520 if $test -f use64bitint.cbu; then
5521 echo "Your platform has some specific hints regarding 64-bit integers, using them..."
5524 case "$use64bitint" in
5525 "$define"|true|[yY]*)
5527 4) case "$archname64" in
5528 '') archname64=64int ;;
5535 : Look for a hint-file generated 'call-back-unit'. If the
5536 : user has specified that a maximally 64-bit perl is to be built,
5537 : we may need to set or change some other defaults.
5538 if $test -f use64bitall.cbu; then
5539 echo "Your platform has some specific hints regarding 64-bit builds, using them..."
5542 case "$use64bitall" in
5543 "$define"|true|[yY]*)
5545 4) case "$archname64" in
5546 ''|64int) archname64=64all ;;
5553 case "$d_quad:$use64bitint" in
5557 *** You have chosen to use 64-bit integers,
5558 *** but none can be found.
5559 *** Please rerun Configure without -Duse64bitint and/or -Dusemorebits.
5560 *** Cannot continue, aborting.
5567 : check for length of double
5569 case "$doublesize" in
5571 echo "Checking to see how big your double precision numbers are..." >&4
5580 printf("%d\n", (int)sizeof(double));
5585 if eval $compile_ok; then
5586 doublesize=`$run ./try`
5587 echo "Your double is $doublesize bytes long."
5590 echo "(I can't seem to compile the test program. Guessing...)"
5591 rp="What is the size of a double precision number (in bytes)?"
5599 : check for long doubles
5601 echo "Checking to see if you have long double..." >&4
5602 echo 'int main() { long double x = 7.0; }' > try.c
5604 if eval $compile; then
5606 echo "You have long double."
5609 echo "You do not have long double."
5615 : check for length of long double
5616 case "${d_longdbl}${longdblsize}" in
5619 echo "Checking to see how big your long doubles are..." >&4
5620 $cat >try.c <<'EOCP'
5624 printf("%d\n", sizeof(long double));
5629 if eval $compile; then
5630 longdblsize=`$run ./try`
5631 echo "Your long doubles are $longdblsize bytes long."
5635 echo "(I can't seem to compile the test program. Guessing...)" >&4
5636 rp="What is the size of a long double (in bytes)?"
5640 if $test "X$doublesize" = "X$longdblsize"; then
5641 echo "That isn't any different from an ordinary double."
5642 echo "I'll keep your setting anyway, but you may see some"
5643 echo "harmless compilation warnings."
5649 : determine the architecture name
5651 if xxx=`./loc arch blurfl $pth`; $test -f "$xxx"; then
5652 tarch=`arch`"-$osname"
5653 elif xxx=`./loc uname blurfl $pth`; $test -f "$xxx" ; then
5654 if uname -m > tmparch 2>&1 ; then
5655 tarch=`$sed -e 's/ *$//' -e 's/ /_/g' \
5656 -e 's/$/'"-$osname/" tmparch`
5664 case "$myarchname" in
5667 echo "(Your architecture name used to be $myarchname.)"
5671 case "$targetarch" in
5673 *) archname=`echo $targetarch|sed 's,^[^-]*-,,'` ;;
5678 *) dflt="$archname";;
5680 rp='What is your architecture name'
5683 case "$usethreads" in
5685 echo "Threads selected." >&4
5687 *-thread*) echo "...and architecture name already has -thread." >&4
5689 *) archname="$archname-thread"
5690 echo "...setting architecture name to $archname." >&4
5695 case "$usemultiplicity" in
5697 echo "Multiplicity selected." >&4
5699 *-multi*) echo "...and architecture name already has -multi." >&4
5701 *) archname="$archname-multi"
5702 echo "...setting architecture name to $archname." >&4
5707 case "$use64bitint$use64bitall" in
5709 case "$archname64" in
5711 echo "This architecture is naturally 64-bit, not changing architecture name." >&4
5714 case "$use64bitint" in
5715 "$define") echo "64 bit integers selected." >&4 ;;
5717 case "$use64bitall" in
5718 "$define") echo "Maximal 64 bitness selected." >&4 ;;
5721 *-$archname64*) echo "...and architecture name already has $archname64." >&4
5723 *) archname="$archname-$archname64"
5724 echo "...setting architecture name to $archname." >&4
5730 case "$uselongdouble" in
5732 echo "Long doubles selected." >&4
5733 case "$longdblsize" in
5735 echo "...but long doubles are equal to doubles, not changing architecture name." >&4
5739 *-ld*) echo "...and architecture name already has -ld." >&4
5741 *) archname="$archname-ld"
5742 echo "...setting architecture name to $archname." >&4
5749 case "$useperlio" in
5751 echo "Perlio selected." >&4
5754 echo "Perlio not selected, using stdio." >&4
5756 *-stdio*) echo "...and architecture name already has -stdio." >&4
5758 *) archname="$archname-stdio"
5759 echo "...setting architecture name to $archname." >&4
5764 if $test -f archname.cbu; then
5765 echo "Your platform has some specific hints for architecture name, using them..."
5769 : determine root of directory hierarchy where package will be installed.
5772 dflt=`./loc . /usr/local /usr/local /local /opt /usr`
5775 dflt=`echo "$prefix" | sed 's/.$//'`
5783 By default, $package will be installed in $dflt/bin, manual pages
5784 under $dflt/man, etc..., i.e. with $dflt as prefix for all
5785 installation directories. Typically this is something like /usr/local.
5786 If you wish to have binaries under /usr/bin but other parts of the
5787 installation under /usr/local, that's ok: you will be prompted
5788 separately for each of the installation directories, the prefix being
5789 only used to set the defaults.
5793 rp='Installation prefix to use?'
5801 *) oldprefix="$prefix";;
5810 *) afsroot=$afsroot ;;
5816 $define|true) afs=true ;;
5817 $undef|false) afs=false ;;
5818 *) if test -d $afsroot; then
5826 echo "AFS may be running... I'll be extra cautious then..." >&4
5828 echo "AFS does not seem to be running..." >&4
5831 : determine installation prefix for where package is to be installed.
5835 Since you are running AFS, I need to distinguish the directory in which
5836 files will reside from the directory in which they are installed (and from
5837 which they are presumably copied to the former directory by occult means).
5840 case "$installprefix" in
5841 '') dflt=`echo $prefix | sed 's#^/afs/#/afs/.#'`;;
5842 *) dflt="$installprefix";;
5847 In some special cases, particularly when building $package for distribution,
5848 it is convenient to distinguish the directory in which files should be
5849 installed from the directory ($prefix) in which they will
5850 eventually reside. For most users, these two directories are the same.
5853 case "$installprefix" in
5855 *) dflt=$installprefix;;
5859 rp='What installation prefix should I use for installing files?'
5861 installprefix="$ans"
5862 installprefixexp="$ansexp"
5864 : set the prefixit variable, to compute a suitable default value
5865 prefixit='case "$3" in
5867 case "$oldprefix" in
5868 "") eval "$1=\"\$$2\"";;
5875 ""|" ") eval "$1=\"\$$2\"";;
5881 eval "tp=\"$oldprefix-\$$2-\""; eval "tp=\"$tp\"";
5883 --|/*--|\~*--) eval "$1=\"$prefix/$3\"";;
5884 /*-$oldprefix/*|\~*-$oldprefix/*)
5885 eval "$1=\`echo \$$2 | sed \"s,^$oldprefix,$prefix,\"\`";;
5886 *) eval "$1=\"\$$2\"";;
5890 : get the patchlevel
5892 echo "Getting the current patchlevel..." >&4
5893 if $test -r $rsrc/patchlevel.h;then
5894 revision=`awk '/define[ ]+PERL_REVISION/ {print $3}' $rsrc/patchlevel.h`
5895 patchlevel=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
5896 subversion=`awk '/define[ ]+PERL_SUBVERSION/ {print $3}' $rsrc/patchlevel.h`
5897 api_revision=`awk '/define[ ]+PERL_API_REVISION/ {print $3}' $rsrc/patchlevel.h`
5898 api_version=`awk '/define[ ]+PERL_API_VERSION/ {print $3}' $rsrc/patchlevel.h`
5899 api_subversion=`awk '/define[ ]+PERL_API_SUBVERSION/ {print $3}' $rsrc/patchlevel.h`
5900 perl_patchlevel=`grep 'define PERL_PATCHNUM [0-9][0-9]*' $rsrc/patchlevel.h|sed 's/[^0-9]//g'`
5909 $echo "(You do not have patchlevel.h. Eek.)"
5911 if $test -r $rsrc/.patch ; then
5912 if $test "`cat $rsrc/.patch`" -gt "$perl_patchlevel" ; then
5913 perl_patchlevel=`cat $rsrc/.patch`
5916 : Define a handy string here to avoid duplication in myconfig.SH and configpm.
5917 version_patchlevel_string="version $patchlevel subversion $subversion"
5918 case "$perl_patchlevel" in
5920 *) version_patchlevel_string="$version_patchlevel_string patch $perl_patchlevel" ;;
5923 $echo "(You have $package $version_patchlevel_string.)"
5927 : XXX Should be a Configure test for double-dots in filenames.
5928 version=`echo $revision $patchlevel $subversion | \
5929 $awk '{ printf "%d_%d_%d\n", $1, $2, $3 }'`
5930 api_versionstring=`echo $api_revision $api_version $api_subversion | \
5931 $awk '{ printf "%d_%d_%d\n", $1, $2, $3 }'`
5934 version=`echo $revision $patchlevel $subversion | \
5935 $awk '{ printf "%d.%d.%d\n", $1, $2, $3 }'`
5936 api_versionstring=`echo $api_revision $api_version $api_subversion | \
5937 $awk '{ printf "%d.%d.%d\n", $1, $2, $3 }'`
5940 : Special case the 5.005_xx maintenance series, which used 5.005
5941 : without any subversion label as a subdirectory in $sitelib
5942 if test "${api_revision}${api_version}${api_subversion}" = "550"; then
5943 api_versionstring='5.005'
5946 : determine installation style
5947 : For now, try to deduce it from prefix unless it is already set.
5948 : Reproduce behavior of 5.005 and earlier, maybe drop that in 5.7.
5949 case "$installstyle" in
5950 '') case "$prefix" in
5951 *perl*) dflt='lib';;
5952 *) dflt='lib/perl5' ;;
5955 *) dflt="$installstyle" ;;
5957 : Probably not worth prompting for this since we prompt for all
5958 : the directories individually, and the prompt would be too long and
5962 : determine where private library files go
5963 : Usual default is /usr/local/lib/perl5/$version.
5964 : Also allow things like /opt/perl/lib/$version, since
5965 : /opt/perl/lib/perl5... would be redundant.
5966 : The default "style" setting is made in installstyle.U
5967 case "$installstyle" in
5968 *lib/perl5*) set dflt privlib lib/$package/$version ;;
5969 *) set dflt privlib lib/$version ;;
5974 There are some auxiliary files for $package that need to be put into a
5975 private library directory that is accessible by everyone.
5979 rp='Pathname where the private library files will reside?'
5982 privlibexp="$ansexp"
5983 : Change installation prefix, if necessary.
5984 if $test X"$prefix" != X"$installprefix"; then
5985 installprivlib=`echo $privlibexp | sed "s#^$prefix#$installprefix#"`
5987 installprivlib="$privlibexp"
5990 : set the prefixup variable, to restore leading tilda escape
5991 prefixup='case "$prefixexp" in
5993 *) eval "$1=\`echo \$$1 | sed \"s,^$prefixexp,$prefix,\"\`";;
5996 : determine where public architecture dependent libraries go
5999 : privlib default is /usr/local/lib/$package/$version
6000 : archlib default is /usr/local/lib/$package/$version/$archname
6001 : privlib may have an optional trailing /share.
6002 tdflt=`echo $privlib | $sed 's,/share$,,'`
6003 tdflt=$tdflt/$archname
6012 $spackage contains architecture-dependent library files. If you are
6013 sharing libraries in a heterogeneous environment, you might store
6014 these files in a separate location. Otherwise, you can just include
6015 them with the rest of the public library files.
6019 rp='Where do you want to put the public architecture-dependent libraries?'
6022 archlibexp="$ansexp"
6023 if $test X"$archlib" = X"$privlib"; then
6028 : Change installation prefix, if necessary.
6029 if $test X"$prefix" != X"$installprefix"; then
6030 installarchlib=`echo $archlibexp | sed "s#^$prefix#$installprefix#"`
6032 installarchlib="$archlibexp"
6035 : see if setuid scripts can be secure
6038 Some kernels have a bug that prevents setuid #! scripts from being
6039 secure. Some sites have disabled setuid #! scripts because of this.
6041 First let's decide if your kernel supports secure setuid #! scripts.
6042 (If setuid #! scripts would be secure but have been disabled anyway,
6043 don't say that they are secure if asked.)
6048 if $test -d /dev/fd; then
6049 echo "#!$ls" >reflect
6050 chmod +x,u+s reflect
6051 ./reflect >flect 2>&1
6052 if $contains "/dev/fd" flect >/dev/null; then
6053 echo "Congratulations, your kernel has secure setuid scripts!" >&4
6057 If you are not sure if they are secure, I can check but I'll need a
6058 username and password different from the one you are using right now.
6059 If you don't have such a username or don't want me to test, simply
6063 rp='Other username to test security of setuid scripts with?'
6068 case "$d_suidsafe" in
6069 '') echo "I'll assume setuid scripts are *not* secure." >&4
6072 echo "Well, the $hint value is *not* secure." >&4
6074 *) echo "Well, the $hint value *is* secure." >&4
6079 $rm -f reflect flect
6080 echo "#!$ls" >reflect
6081 chmod +x,u+s reflect
6084 echo '"su" will (probably) prompt you for '"$ans's password."
6085 su $ans -c './reflect >flect'
6086 if $contains "/dev/fd" flect >/dev/null; then
6087 echo "Okay, it looks like setuid scripts are secure." >&4
6090 echo "I don't think setuid scripts are secure." >&4
6095 rp='Does your kernel have *secure* setuid scripts?'
6098 [yY]*) val="$define";;
6103 echo "I don't think setuid scripts are secure (no /dev/fd directory)." >&4
6104 echo "(That's for file descriptors, not floppy disks.)"
6110 $rm -f reflect flect
6112 : now see if they want to do setuid emulation
6115 case "$d_suidsafe" in
6118 echo "No need to emulate SUID scripts since they are secure here." >&4
6122 Some systems have disabled setuid scripts, especially systems where
6123 setuid scripts cannot be secure. On systems where setuid scripts have
6124 been disabled, the setuid/setgid bits on scripts are currently
6125 useless. It is possible for $package to detect those bits and emulate
6126 setuid/setgid in a secure fashion. This emulation will only work if
6127 setuid scripts have been disabled in your kernel.
6131 "$define") dflt=y ;;
6134 rp="Do you want to do setuid/setgid emulation?"
6137 [yY]*) val="$define";;
6145 : see if this is a malloc.h system
6146 : we want a real compile instead of Inhdr because some systems have a
6147 : malloc.h that just gives a compile error saying to use stdlib.h instead
6152 int main () { return 0; }
6155 if eval $compile; then
6156 echo "<malloc.h> found." >&4
6159 echo "<malloc.h> NOT found." >&4
6166 : check for void type
6168 echo "Checking to see how well your C compiler groks the void type..." >&4
6169 case "$voidflags" in
6181 extern void moo(); /* function returning void */
6182 void (*goo)(); /* ptr to func returning void */
6184 void *hue; /* generic ptr */
6197 int main() { sub(); }
6199 if $cc $ccflags -c -DTRY=$defvoidused try.c >.out 2>&1 ; then
6200 voidflags=$defvoidused
6201 echo "Good. It appears to support void to the level $package wants.">&4
6202 if $contains warning .out >/dev/null 2>&1; then
6203 echo "However, you might get some warnings that look like this:"
6207 echo "Hmm, your compiler has some difficulty with void. Checking further..." >&4
6208 if $cc $ccflags -c -DTRY=1 try.c >/dev/null 2>&1; then
6209 echo "It supports 1..."
6210 if $cc $ccflags -c -DTRY=3 try.c >/dev/null 2>&1; then
6211 echo "It also supports 2..."
6212 if $cc $ccflags -c -DTRY=7 try.c >/dev/null 2>&1; then
6214 echo "And it supports 4 but not 8 definitely."
6216 echo "It doesn't support 4..."
6217 if $cc $ccflags -c -DTRY=11 try.c >/dev/null 2>&1; then
6219 echo "But it supports 8."
6222 echo "Neither does it support 8."
6226 echo "It does not support 2..."
6227 if $cc $ccflags -c -DTRY=13 try.c >/dev/null 2>&1; then
6229 echo "But it supports 4 and 8."
6231 if $cc $ccflags -c -DTRY=5 try.c >/dev/null 2>&1; then
6233 echo "And it supports 4 but has not heard about 8."
6235 echo "However it supports 8 but not 4."
6240 echo "There is no support at all for void."
6245 case "$voidflags" in
6248 Support flag bits are:
6249 1: basic void declarations.
6250 2: arrays of pointers to functions returning void.
6251 4: operations between pointers to and addresses of void functions.
6252 8: generic void pointers.
6255 rp="Your void support flags add up to what?"
6262 : check for length of pointer
6266 echo "Checking to see how big your pointers are..." >&4
6267 if test "$voidflags" -gt 7; then
6268 echo '#define VOID_PTR char *' > try.c
6270 echo '#define VOID_PTR void *' > try.c
6280 printf("%d\n", (int)sizeof(VOID_PTR));
6285 if eval $compile_ok; then
6286 ptrsize=`$run ./try`
6287 echo "Your pointers are $ptrsize bytes long."
6290 echo "(I can't seem to compile the test program. Guessing...)" >&4
6291 rp="What is the size of a pointer (in bytes)?"
6298 case "$use64bitall" in
6299 "$define"|true|[yY]*)
6303 *** You have chosen a maximally 64-bit build,
6304 *** but your pointers are only 4 bytes wide.
6305 *** Please rerun Configure without -Duse64bitall.
6310 *** Since you have quads, you could possibly try with -Duse64bitint.
6315 *** Cannot continue, aborting.
6326 : determine whether to use malloc wrapping
6328 case "$usemallocwrap" in
6329 [yY]*|true|$define) dflt='y' ;;
6330 [nN]*|false|$undef) dflt='n' ;;
6331 *) case "$usedevel" in
6332 [yY]*|true|$define) dflt='y' ;;
6337 rp="Do you wish to wrap malloc calls to protect against potential overflows?"
6339 usemallocwrap="$ans"
6342 usemallocwrap="$define" ;;
6344 usemallocwrap="$undef" ;;
6347 : determine which malloc to compile in
6349 case "$usemymalloc" in
6350 [yY]*|true|$define) dflt='y' ;;
6351 [nN]*|false|$undef) dflt='n' ;;
6352 *) case "$ptrsize" in
6358 rp="Do you wish to attempt to use the malloc that comes with $package?"
6364 mallocsrc='malloc.c'
6365 mallocobj="malloc$_o"
6366 d_mymalloc="$define"
6369 : Remove malloc from list of libraries to use
6370 echo "Removing unneeded -lmalloc from library list" >&4
6371 set `echo X $libs | $sed -e 's/-lmalloc / /' -e 's/-lmalloc$//'`
6374 echo "libs = $libs" >&4
6386 : compute the return types of malloc and free
6388 $cat >malloc.c <<END
6392 #include <sys/types.h>
6406 case "$malloctype" in
6408 if $cc $ccflags -c -DTRY_MALLOC malloc.c >/dev/null 2>&1; then
6415 echo "Your system wants malloc to return '$malloctype', it would seem." >&4
6419 if $cc $ccflags -c -DTRY_FREE malloc.c >/dev/null 2>&1; then
6426 echo "Your system uses $freetype free(), it would seem." >&4
6430 After $package is installed, you may wish to install various
6431 add-on modules and utilities. Typically, these add-ons will
6432 be installed under $prefix with the rest
6433 of this package. However, you may wish to install such add-ons
6434 elsewhere under a different prefix.
6436 If you do not wish to put everything under a single prefix, that's
6437 ok. You will be prompted for the individual locations; this siteprefix
6438 is only used to suggest the defaults.
6440 The default should be fine for most people.
6444 rp='Installation prefix to use for add-on modules and utilities?'
6445 : XXX Here might be another good place for an installstyle setting.
6446 case "$siteprefix" in
6448 *) dflt=$siteprefix ;;
6451 : XXX Prefixit unit does not yet support siteprefix and vendorprefix
6453 case "$siteprefix" in
6457 *) oldsiteprefix="$prefix";;
6462 siteprefixexp="$ansexp"
6464 : determine where site specific libraries go.
6465 : Usual default is /usr/local/lib/perl5/site_perl/$version
6466 : The default "style" setting is made in installstyle.U
6467 : XXX No longer works with Prefixit stuff.
6468 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
6470 '') case "$installstyle" in
6471 *lib/perl5*) dflt=$siteprefix/lib/$package/site_$prog/$version ;;
6472 *) dflt=$siteprefix/lib/site_$prog/$version ;;
6480 The installation process will create a directory for
6481 site-specific extensions and modules. Most users find it convenient
6482 to place all site-specific files in this directory rather than in the
6483 main distribution directory.
6487 rp='Pathname for the site-specific library files?'
6490 sitelibexp="$ansexp"
6491 sitelib_stem=`echo "$sitelibexp" | sed "s,/$version$,,"`
6492 : Change installation prefix, if necessary.
6493 if $test X"$prefix" != X"$installprefix"; then
6494 installsitelib=`echo $sitelibexp | $sed "s#^$prefix#$installprefix#"`
6496 installsitelib="$sitelibexp"
6499 : determine where site specific architecture-dependent libraries go.
6500 : sitelib default is /usr/local/lib/perl5/site_perl/$version
6501 : sitearch default is /usr/local/lib/perl5/site_perl/$version/$archname
6502 : sitelib may have an optional trailing /share.
6504 '') dflt=`echo $sitelib | $sed 's,/share$,,'`
6505 dflt="$dflt/$archname"
6510 set sitearch sitearch none
6514 The installation process will also create a directory for
6515 architecture-dependent site-specific extensions and modules.
6519 rp='Pathname for the site-specific architecture-dependent library files?'
6522 sitearchexp="$ansexp"
6523 : Change installation prefix, if necessary.
6524 if $test X"$prefix" != X"$installprefix"; then
6525 installsitearch=`echo $sitearchexp | sed "s#^$prefix#$installprefix#"`
6527 installsitearch="$sitearchexp"
6532 The installation process will also create a directory for
6533 vendor-supplied add-ons. Vendors who supply perl with their system
6534 may find it convenient to place all vendor-supplied files in this
6535 directory rather than in the main distribution directory. This will
6536 ease upgrades between binary-compatible maintenance versions of perl.
6538 Of course you may also use these directories in whatever way you see
6539 fit. For example, you might use them to access modules shared over a
6540 company-wide network.
6542 The default answer should be fine for most people.
6543 This causes further questions about vendor add-ons to be skipped
6544 and no vendor-specific directories will be configured for perl.
6547 rp='Do you want to configure vendor-specific add-on directories?'
6548 case "$usevendorprefix" in
6549 define|true|[yY]*) dflt=y ;;
6550 *) : User may have set vendorprefix directly on Configure command line.
6551 case "$vendorprefix" in
6560 rp='Installation prefix to use for vendor-supplied add-ons?'
6561 case "$vendorprefix" in
6563 *) dflt=$vendorprefix ;;
6566 : XXX Prefixit unit does not yet support siteprefix and vendorprefix
6568 case "$vendorprefix" in
6572 *) oldvendorprefix="$prefix";;
6576 usevendorprefix="$define"
6578 vendorprefixexp="$ansexp"
6580 *) usevendorprefix="$undef"
6586 case "$vendorprefix" in
6587 '') d_vendorlib="$undef"
6591 *) d_vendorlib="$define"
6592 : determine where vendor-supplied modules go.
6593 : Usual default is /usr/local/lib/perl5/vendor_perl/$version
6594 case "$vendorlib" in
6596 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
6597 case "$installstyle" in
6598 *lib/perl5*) dflt=$vendorprefix/lib/$package/vendor_$prog/$version ;;
6599 *) dflt=$vendorprefix/lib/vendor_$prog/$version ;;
6602 *) dflt="$vendorlib"
6606 rp='Pathname for the vendor-supplied library files?'
6609 vendorlibexp="$ansexp"
6612 vendorlib_stem=`echo "$vendorlibexp" | sed "s,/$version$,,"`
6613 : Change installation prefix, if necessary.
6614 if $test X"$prefix" != X"$installprefix"; then
6615 installvendorlib=`echo $vendorlibexp | $sed "s#^$prefix#$installprefix#"`
6617 installvendorlib="$vendorlibexp"
6620 case "$vendorprefix" in
6621 '') d_vendorarch="$undef"
6625 *) d_vendorarch="$define"
6626 : determine where vendor-supplied architecture-dependent libraries go.
6627 : vendorlib default is /usr/local/lib/perl5/vendor_perl/$version
6628 : vendorarch default is /usr/local/lib/perl5/vendor_perl/$version/$archname
6629 : vendorlib may have an optional trailing /share.
6630 case "$vendorarch" in
6631 '') dflt=`echo $vendorlib | $sed 's,/share$,,'`
6632 dflt="$dflt/$archname"
6634 *) dflt="$vendorarch" ;;
6637 rp='Pathname for vendor-supplied architecture-dependent files?'
6640 vendorarchexp="$ansexp"
6643 : Change installation prefix, if necessary.
6644 if $test X"$prefix" != X"$installprefix"; then
6645 installvendorarch=`echo $vendorarchexp | sed "s#^$prefix#$installprefix#"`
6647 installvendorarch="$vendorarchexp"
6650 : Final catch-all directories to search
6653 Lastly, you can have perl look in other directories for extensions and
6654 modules in addition to those already specified.
6655 These directories will be searched after
6659 test X"$vendorlib" != "X" && echo ' ' $vendorlib
6660 test X"$vendorarch" != "X" && echo ' ' $vendorarch
6662 case "$otherlibdirs" in
6663 ''|' ') dflt='none' ;;
6664 *) dflt="$otherlibdirs" ;;
6667 Enter a colon-separated set of extra paths to include in perl's @INC
6668 search path, or enter 'none' for no extra paths.
6672 rp='Colon-separated list of additional directories for perl to search?'
6675 ' '|''|none) otherlibdirs=' ' ;;
6676 *) otherlibdirs="$ans" ;;
6678 case "$otherlibdirs" in
6682 set d_perl_otherlibdirs
6685 : Cruising for prototypes
6687 echo "Checking out function prototypes..." >&4
6688 $cat >prototype.c <<EOCP
6693 int main(int argc, char *argv[]) {
6696 if $cc $ccflags -c prototype.c >prototype.out 2>&1 ; then
6697 echo "Your C compiler appears to support function prototypes."
6700 echo "Your C compiler doesn't seem to understand function prototypes."
6707 case "$prototype" in
6709 *) ansi2knr='ansi2knr'
6714 This version of $package can only be compiled by a compiler that
6715 understands function prototypes. Unfortunately, your C compiler
6717 doesn't seem to understand them. Sorry about that.
6719 If GNU cc is available for your system, perhaps you could try that instead.
6721 Eventually, we hope to support building Perl with pre-ANSI compilers.
6722 If you would like to help in that effort, please contact <perlbug@perl.org>.
6724 Aborting Configure now.
6730 : determine where public executables go
6735 rp='Pathname where the public executables will reside?'
6737 if $test "X$ansexp" != "X$binexp"; then
6742 : Change installation prefix, if necessary.
6743 : XXX Bug? -- ignores Configure -Dinstallprefix setting.
6744 if $test X"$prefix" != X"$installprefix"; then
6745 installbin=`echo $binexp | sed "s#^$prefix#$installprefix#"`
6747 installbin="$binexp"
6756 Perl can be built with extra modules or bundles of modules which
6757 will be fetched from the CPAN and installed alongside Perl.
6759 Notice that you will need access to the CPAN; either via the Internet,
6760 or a local copy, for example a CD-ROM or a local CPAN mirror. (You will
6761 be asked later to configure the CPAN.pm module which will in turn do
6762 the installation of the rest of the extra modules or bundles.)
6764 Notice also that if the modules require any external software such as
6765 libraries and headers (the libz library and the zlib.h header for the
6766 Compress::Zlib module, for example) you MUST have any such software
6767 already installed, this configuration process will NOT install such
6770 If this doesn't make any sense to you, just accept the default '$dflt'.
6772 rp='Install any extra modules (y or n)?'
6778 Please list any extra modules or bundles to be installed from CPAN,
6779 with spaces between the names. The names can be in any format the
6780 'install' command of CPAN.pm will understand. (Answer 'none',
6781 without the quotes, to install no extra modules or bundles.)
6791 $rm -f ../extras.lst
6793 *) echo "(Saving the list of extras for later...)"
6794 echo "$extras" > ../extras.lst
6802 : determine where html pages for programs go
6803 set html1dir html1dir none
6807 If you wish to install html files for programs in $spackage, indicate
6808 the appropriate directory here. To skip installing html files,
6812 ''|none|$undef|' ') dflt=none ;;
6813 *) dflt=$html1dir ;;
6816 rp="Directory for the main $spackage html pages?"
6819 html1direxp="$ansexp"
6820 : Use ' ' for none so value is preserved next time through Configure
6821 $test X"$html1dir" = "X" && html1dir=' '
6822 : Change installation prefix, if necessary.
6823 if $test X"$prefix" != X"$installprefix"; then
6824 installhtml1dir=`echo $html1direxp | sed "s#^$prefix#$installprefix#"`
6826 installhtml1dir="$html1direxp"
6829 : determine where html pages for libraries and modules go
6830 set html3dir html3dir none
6834 If you wish to install html files for modules associated with $spackage,
6835 indicate the appropriate directory here. To skip installing html files,
6838 : There is no obvious default. If they have specified html1dir, then
6839 : try to key off that, possibly changing .../html1 into .../html3.
6841 '') html3dir=`echo "$html1dir" | $sed 's/1$/3$/'` ;;
6842 *) dflt=$html3dir ;;
6845 rp="Directory for the $spackage module html pages?"
6848 html3direxp="$ansexp"
6849 : Use ' ' for none so value is preserved next time through Configure
6850 $test X"$html3dir" = "X" && html3dir=' '
6851 : Change installation prefix, if necessary.
6852 if $test X"$prefix" != X"$installprefix"; then
6853 installhtml3dir=`echo $html3direxp | sed "s#^$prefix#$installprefix#"`
6855 installhtml3dir="$html3direxp"
6858 : Find perl5.005 or later.
6859 echo "Looking for a previously installed perl5.005 or later... "
6861 '') for tdir in `echo "$binexp$path_sep$PATH" | $sed "s/$path_sep/ /g"`; do
6862 : Check if this perl is recent and can load a simple module
6863 if $test -x $tdir/perl$exe_ext && $tdir/perl -Mless -e 'use 5.005;' >/dev/null 2>&1; then
6866 elif $test -x $tdir/perl5$exe_ext && $tdir/perl5 -Mless -e 'use 5.005;' >/dev/null 2>&1; then
6876 '') echo "None found. That's ok.";;
6877 *) echo "Using $perl5." ;;
6880 : Determine list of previous versions to include in @INC
6881 $cat > getverlist <<EOPL
6884 \$api_versionstring = "$api_versionstring";
6885 \$version = "$version";
6886 \$stem = "$sitelib_stem";
6887 \$archname = "$archname";
6889 $cat >> getverlist <<'EOPL'
6890 # Can't have leading @ because metaconfig interprets it as a command!
6891 ;@inc_version_list=();
6892 # XXX Redo to do opendir/readdir?
6895 ;@candidates = glob("5.*");
6901 # XXX ToDo: These comparisons must be reworked when two-digit
6902 # subversions come along, so that 5.7.10 compares as greater than
6903 # 5.7.3! By that time, hope that 5.6.x is sufficiently
6904 # widespread that we can use the built-in version vectors rather
6905 # than reinventing them here. For 5.6.0, however, we must
6906 # assume this script will likely be run by 5.005_0x. --AD 1/2000.
6907 foreach $d (@candidates) {
6908 if ($d lt $version) {
6909 if ($d ge $api_versionstring) {
6910 unshift(@inc_version_list, grep { -d } "$d/$archname", $d);
6912 elsif ($d ge "5.005") {
6913 unshift(@inc_version_list, grep { -d } $d);
6917 # Skip newer version. I.e. don't look in
6918 # 5.7.0 if we're installing 5.6.1.
6922 if (@inc_version_list) {
6923 print join(' ', @inc_version_list);
6926 # Blank space to preserve value for next Configure run.
6931 case "$inc_version_list" in
6932 '') if test -x "$perl5$exe_ext"; then
6933 dflt=`$perl5 getverlist`
6938 $undef) dflt='none' ;;
6939 *) eval dflt=\"$inc_version_list\" ;;
6942 ''|' ') dflt=none ;;
6949 In order to ease the process of upgrading, this version of perl
6950 can be configured to use modules built and installed with earlier
6951 versions of perl that were installed under $prefix. Specify here
6952 the list of earlier versions that this version of perl should check.
6953 If Configure detected no earlier versions of perl installed under
6954 $prefix, then the list will be empty. Answer 'none' to tell perl
6955 to not search earlier versions.
6957 The default should almost always be sensible, so if you're not sure,
6958 just accept the default.
6961 rp='List of earlier versions to include in @INC?'
6964 [Nn]one|''|' '|$undef) inc_version_list=' ' ;;
6965 *) inc_version_list="$ans" ;;
6967 case "$inc_version_list" in
6969 inc_version_list_init='0';;
6970 *) inc_version_list_init=`echo $inc_version_list |
6971 $sed -e 's/^/"/' -e 's/ /","/g' -e 's/$/",0/'`
6976 : determine whether to install perl also as /usr/bin/perl
6979 if $test -d /usr/bin -a "X$installbin" != X/usr/bin; then
6981 Many scripts expect perl to be installed as /usr/bin/perl.
6983 If you want to, I can install the perl you are about to compile
6984 as /usr/bin/perl (in addition to $bin/perl).
6986 if test -f /usr/bin/perl; then
6989 However, please note that because you already have a /usr/bin/perl,
6990 overwriting that with a new Perl would very probably cause problems.
6991 Therefore I'm assuming you don't want to do that (unless you insist).
6994 case "$installusrbinperl" in
6995 "$define"|[yY]*) dflt='y';;
7001 Since you don't have a /usr/bin/perl I'm assuming creating one is okay.
7004 case "$installusrbinperl" in
7005 "$undef"|[nN]*) dflt='n';;
7009 rp="Do you want to install perl as /usr/bin/perl?"
7012 [yY]*) val="$define";;
7018 set installusrbinperl
7022 echo "Checking for GNU C Library..." >&4
7024 /* Find out version of GNU C library. __GLIBC__ and __GLIBC_MINOR__
7025 alone are insufficient to distinguish different versions, such as
7026 2.0.6 and 2.0.7. The function gnu_get_libc_version() appeared in
7027 libc version 2.1.0. A. Dougherty, June 3, 2002.
7033 # ifdef __GLIBC_MINOR__
7034 # if __GLIBC__ >= 2 && __GLIBC_MINOR__ >= 1
7035 # include <gnu/libc-version.h>
7036 printf("%s\n", gnu_get_libc_version());
7038 printf("%d.%d\n", __GLIBC__, __GLIBC_MINOR__);
7041 printf("%d\n", __GLIBC__);
7050 if eval $compile_ok && $run ./try > glibc.ver; then
7052 gnulibc_version=`$cat glibc.ver`
7053 echo "You are using the GNU C Library version $gnulibc_version"
7057 echo "You are not using the GNU C Library"
7059 $rm -f try try.* glibc.ver
7063 : see if nm is to be used to determine whether a symbol is defined or not
7067 case "$d_gnulibc" in
7070 echo "nm probably won't work on the GNU C Library." >&4
7076 if $test "$osname" = aix -a "X$PASE" != "Xdefine" -a ! -f /lib/syscalls.exp; then
7078 echo "Whoops! This is an AIX system without /lib/syscalls.exp!" >&4
7079 echo "'nm' won't be sufficient on this sytem." >&4
7085 '') dflt=`$egrep 'inlibc|csym' $rsrc/Configure | wc -l 2>/dev/null`
7086 if $test $dflt -gt 20; then
7096 true|$define) dflt=y;;
7103 I can use $nm to extract the symbols from your C libraries. This
7104 is a time consuming task which may generate huge output on the disk (up
7105 to 3 megabytes) but that should make the symbols extraction faster. The
7106 alternative is to skip the 'nm' extraction part and to compile a small
7107 test program instead to determine whether each symbol is present. If
7108 you have a fast C compiler and/or if your 'nm' output cannot be parsed,
7109 this may be the best solution.
7111 You probably shouldn't let me use 'nm' if you are using the GNU C Library.
7114 rp="Shall I use $nm to extract C symbols from the libraries?"
7117 [Nn]*) usenm=false;;
7126 : nm options which may be necessary
7128 '') if $test -f /mach_boot; then
7130 elif $test -d /usr/ccs/lib; then
7131 nm_opt='-p' # Solaris (and SunOS?)
7132 elif $test -f /dgux; then
7134 elif $test -f /lib64/rld; then
7135 nm_opt='-p' # 64-bit Irix
7141 : nm options which may be necessary for shared libraries but illegal
7142 : for archive libraries. Thank you, Linux.
7143 case "$nm_so_opt" in
7144 '') case "$myuname" in
7146 if $nm --help | $grep 'dynamic' > /dev/null 2>&1; then
7147 nm_so_opt='--dynamic'
7156 : get list of predefined functions in a handy place
7161 *-lc_s*) libc=`./loc libc_s$_a $libc $libpth`
7167 *) for thislib in $libs; do
7170 : Handle C library specially below.
7173 thislib=`echo $thislib | $sed -e 's/^-l//'`
7174 if try=`./loc lib$thislib.$so.'*' X $libpth`; $test -f "$try"; then
7176 elif try=`./loc lib$thislib.$so X $libpth`; $test -f "$try"; then
7178 elif try=`./loc lib$thislib$_a X $libpth`; $test -f "$try"; then
7180 elif try=`./loc $thislib$_a X $libpth`; $test -f "$try"; then
7182 elif try=`./loc lib$thislib X $libpth`; $test -f "$try"; then
7184 elif try=`./loc $thislib X $libpth`; $test -f "$try"; then
7186 elif try=`./loc Slib$thislib$_a X $xlibpth`; $test -f "$try"; then
7191 libnames="$libnames $try"
7193 *) libnames="$libnames $thislib" ;;
7202 for xxx in $libpth; do
7203 $test -r $1 || set $xxx/libc.$so
7204 : The messy sed command sorts on library version numbers.
7206 set `echo blurfl; echo $xxx/libc.$so.[0-9]* | \
7207 tr ' ' $trnl | egrep -v '\.[A-Za-z]*$' | $sed -e '
7209 s/[0-9][0-9]*/0000&/g
7210 s/0*\([0-9][0-9][0-9][0-9][0-9]\)/\1/g
7213 $sort | $sed -e 's/^.* //'`
7216 $test -r $1 || set /usr/ccs/lib/libc.$so
7217 $test -r $1 || set /lib/libsys_s$_a
7223 if $test -r "$1"; then
7224 echo "Your (shared) C library seems to be in $1."
7226 elif $test -r /lib/libc && $test -r /lib/clib; then
7227 echo "Your C library seems to be in both /lib/clib and /lib/libc."
7229 libc='/lib/clib /lib/libc'
7230 if $test -r /lib/syslib; then
7231 echo "(Your math library is in /lib/syslib.)"
7232 libc="$libc /lib/syslib"
7234 elif $test -r "$libc" || (test -h "$libc") >/dev/null 2>&1; then
7235 echo "Your C library seems to be in $libc, as you said before."
7236 elif $test -r $incpath/usr/lib/libc$_a; then
7237 libc=$incpath/usr/lib/libc$_a;
7238 echo "Your C library seems to be in $libc. That's fine."
7239 elif $test -r /lib/libc$_a; then
7241 echo "Your C library seems to be in $libc. You're normal."
7243 if tans=`./loc libc$_a blurfl/dyick $libpth`; $test -r "$tans"; then
7245 elif tans=`./loc libc blurfl/dyick $libpth`; $test -r "$tans"; then
7246 libnames="$libnames "`./loc clib blurfl/dyick $libpth`
7247 elif tans=`./loc clib blurfl/dyick $libpth`; $test -r "$tans"; then
7249 elif tans=`./loc Slibc$_a blurfl/dyick $xlibpth`; $test -r "$tans"; then
7251 elif tans=`./loc Mlibc$_a blurfl/dyick $xlibpth`; $test -r "$tans"; then
7254 tans=`./loc Llibc$_a blurfl/dyick $xlibpth`
7256 if $test -r "$tans"; then
7257 echo "Your C library seems to be in $tans, of all places."
7263 if $test $xxx = apollo -o -r "$libc" || (test -h "$libc") >/dev/null 2>&1; then
7267 If the guess above is wrong (which it might be if you're using a strange
7268 compiler, or your machine supports multiple models), you can override it here.
7273 echo $libpth | $tr ' ' $trnl | $sort | $uniq > libpath
7275 I can't seem to find your C library. I've looked in the following places:
7278 $sed 's/^/ /' libpath
7281 None of these seems to contain your C library. I need to get its name...
7286 rp='Where is your C library?'
7291 echo $libc $libnames | $tr ' ' $trnl | $sort | $uniq > libnames
7292 set X `cat libnames`
7295 case $# in 1) xxx=file; esac
7296 echo "Extracting names from the following $xxx for later perusal:" >&4
7298 $sed 's/^/ /' libnames >&4
7300 $echo $n "This may take a while...$c" >&4
7304 *$so*) $nm $nm_so_opt $nm_opt $file 2>/dev/null;;
7305 *) $nm $nm_opt $file 2>/dev/null;;
7310 $grep fprintf libc.tmp > libc.ptf
7311 xscan='eval "<libc.ptf $com >libc.list"; $echo $n ".$c" >&4'
7312 xrun='eval "<libc.tmp $com >libc.list"; echo "done." >&4'
7314 if com="$sed -n -e 's/__IO//' -e 's/^.* $xxx *//p'";\
7316 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7318 elif com="$sed -n -e 's/^__*//' -e 's/^\([a-zA-Z_0-9$]*\).*xtern.*/\1/p'";\
7320 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7322 elif com="$sed -n -e '/|UNDEF/d' -e '/FUNC..GL/s/^.*|__*//p'";\
7324 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7326 elif com="$sed -n -e 's/^.* D __*//p' -e 's/^.* D //p'";\
7328 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7330 elif com="$sed -n -e 's/^_//' -e 's/^\([a-zA-Z_0-9]*\).*xtern.*text.*/\1/p'";\
7332 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7334 elif com="$sed -n -e 's/^.*|FUNC |GLOB .*|//p'";\
7336 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7338 elif com="$grep '|' | $sed -n -e '/|COMMON/d' -e '/|DATA/d' \
7339 -e '/ file/d' -e 's/^\([^ ]*\).*/\1/p'";\
7341 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7343 elif com="$sed -n -e 's/^.*|FUNC |GLOB .*|//p' -e 's/^.*|FUNC |WEAK .*|//p'";\
7345 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7347 elif com="$sed -n -e 's/^__//' -e '/|Undef/d' -e '/|Proc/s/ .*//p'";\
7349 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7351 elif com="$sed -n -e 's/^.*|Proc .*|Text *| *//p'";\
7353 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7355 elif com="$sed -n -e '/Def. Text/s/.* \([^ ]*\)\$/\1/p'";\
7357 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7359 elif com="$sed -n -e 's/^[-0-9a-f ]*_\(.*\)=.*/\1/p'";\
7361 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7363 elif com="$sed -n -e 's/.*\.text n\ \ \ \.//p'";\
7365 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7367 elif com="sed -n -e 's/^__.*//' -e 's/[ ]*D[ ]*[0-9]*.*//p'";\
7369 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7372 $nm -p $* 2>/dev/null >libc.tmp
7373 $grep fprintf libc.tmp > libc.ptf
7374 if com="$sed -n -e 's/^.* [ADTSIW] *_[_.]*//p' -e 's/^.* [ADTSIW] //p'";\
7375 eval $xscan; $contains '^fprintf$' libc.list >/dev/null 2>&1
7381 echo "$nm didn't seem to work right. Trying $ar instead..." >&4
7383 if $ar t $libc > libc.tmp && $contains '^fprintf$' libc.tmp >/dev/null 2>&1; then
7384 for thisname in $libnames $libc; do
7385 $ar t $thisname >>libc.tmp
7387 $sed -e "s/\\$_o\$//" < libc.tmp > libc.list
7389 elif test "X$osname" = "Xos2" && $ar tv $libc > libc.tmp; then
7390 # Repeat libc to extract forwarders to DLL entries too
7391 for thisname in $libnames $libc; do
7392 $ar tv $thisname >>libc.tmp
7393 # Revision 50 of EMX has bug in $ar.
7394 # it will not extract forwarders to DLL entries
7395 # Use emximp which will extract exactly them.
7396 emximp -o tmp.imp $thisname \
7398 $sed -e 's/^\([_a-zA-Z0-9]*\) .*$/\1/p' \
7399 < tmp.imp >>libc.tmp
7402 $sed -e "s/\\$_o\$//" -e 's/^ \+//' < libc.tmp > libc.list
7405 echo "$ar didn't seem to work right." >&4
7406 echo "Maybe this is a Cray...trying bld instead..." >&4
7407 if bld t $libc | $sed -e 's/.*\///' -e "s/\\$_o:.*\$//" > libc.list
7409 for thisname in $libnames; do
7411 $sed -e 's/.*\///' -e "s/\\$_o:.*\$//" >>libc.list
7412 $ar t $thisname >>libc.tmp
7416 echo "That didn't work either. Giving up." >&4
7426 echo "Since you are compiling for PASE, extracting more symbols from libc.a ...">&4
7427 dump -Tv /lib/libc.a | awk '$7 == "/unix" {print $5 " " $8}' | grep "^SV" | awk '{print $2}' >> libc.list
7429 *) if $test -f /lib/syscalls.exp; then
7431 echo "Also extracting names from /lib/syscalls.exp for good ole AIX..." >&4
7432 $sed -n 's/^\([^ ]*\)[ ]*syscall[0-9]*[ ]*$/\1/p' /lib/syscalls.exp >>libc.list
7438 $rm -f libnames libpath
7440 : see if dld is available
7444 : is a C symbol defined?
7447 -v) tf=libc.tmp; tdc="";;
7448 -a) tf=libc.tmp; tdc="[]";;
7449 *) tlook="^$1\$"; tf=libc.list; tdc="()";;
7452 case "$reuseval-$4" in
7454 true-*) tx=no; eval "tval=\$$4"; case "$tval" in "") tx=yes;; esac;;
7459 if $test "$runnm" = true; then
7460 if $contains $tlook $tf >/dev/null 2>&1; then
7462 elif $test "$mistrustnm" = compile -o "$mistrustnm" = run; then
7463 echo "void *(*(p()))$tdc { extern void *$1$tdc; return &$1; } int main() { if(p()) return(0); else return(1); }"> try.c;
7464 $cc -o try $optimize $ccflags $ldflags try.c >/dev/null 2>&1 $libs && tval=true;
7465 $test "$mistrustnm" = run -a -x try && { $run ./try$_exe >/dev/null 2>&1 || tval=false; };
7466 $rm -f try$_exe try.c core core.* try.core;
7469 echo "void *(*(p()))$tdc { extern void *$1$tdc; return &$1; } int main() { if(p()) return(0); else return(1); }"> try.c;
7470 $cc -o try $optimize $ccflags $ldflags try.c $libs >/dev/null 2>&1 && tval=true;
7471 $rm -f try$_exe try.c;
7476 $define) tval=true;;
7483 : define an is-in-libc? function
7484 inlibc='echo " "; td=$define; tu=$undef;
7485 sym=$1; var=$2; eval "was=\$$2";
7487 case "$reuseval$was" in
7497 echo "$sym() found." >&4;
7498 case "$was" in $undef) . ./whoa; esac; eval "$var=\$td";;
7500 echo "$sym() NOT found." >&4;
7501 case "$was" in $define) . ./whoa; esac; eval "$var=\$tu";;
7505 $define) echo "$sym() found." >&4;;
7506 *) echo "$sym() NOT found." >&4;;
7510 : see if dlopen exists
7517 : determine which dynamic loading, if any, to compile in
7519 dldir="ext/DynaLoader"
7532 $define) dflt='y' ;;
7535 $define) dflt='y' ;;
7537 : Does a dl_xxx.xs file exist for this operating system
7538 $test -f $rsrc/$dldir/dl_${osname}.xs && dflt='y'
7541 rp="Do you wish to use dynamic loading?"
7548 if $test -f $rsrc/$dldir/dl_${osname}.xs ; then
7549 dflt="$dldir/dl_${osname}.xs"
7550 elif $test "$d_dlopen" = "$define" ; then
7551 dflt="$dldir/dl_dlopen.xs"
7552 elif $test "$i_dld" = "$define" ; then
7553 dflt="$dldir/dl_dld.xs"
7558 *) dflt="$dldir/$dlsrc"
7561 echo "The following dynamic loading files are available:"
7562 : Can not go over to $dldir because getfile has path hard-coded in.
7563 tdir=`pwd`; cd "$rsrc"; $ls -C $dldir/dl*.xs; cd "$tdir"
7564 rp="Source file to use for dynamic loading"
7570 dlsrc=`echo $ans | $sed -e 's%.*/\([^/]*\)$%\1%'`
7574 Some systems may require passing special flags to $cc -c to
7575 compile modules that will be used to create a shared library.
7576 To use no flags, say "none".
7579 case "$cccdlflags" in
7580 '') case "$gccversion" in
7581 '') case "$osname" in
7583 next) dflt='none' ;;
7584 irix*) dflt='-KPIC' ;;
7585 svr4*|esix*|solaris|nonstopux) dflt='-KPIC' ;;
7586 sunos) dflt='-pic' ;;
7590 *) case "$osname" in
7591 darwin) dflt='none' ;;
7592 svr4*|esix*|solaris|nonstopux) dflt='-fPIC' ;;
7597 *) dflt="$cccdlflags" ;;
7599 rp="Any special flags to pass to $cc -c to compile shared library modules?"
7602 none) cccdlflags=' ' ;;
7603 *) cccdlflags="$ans" ;;
7608 Some systems use ld to create libraries that can be dynamically loaded,
7609 while other systems (such as those using ELF) use $cc.
7613 '') $cat >try.c <<EOM
7614 /* Test for whether ELF binaries are produced */
7622 int i = open("a.out",O_RDONLY);
7625 if(read(i,b,4)==4 && b[0]==127 && b[1]=='E' && b[2]=='L' && b[3]=='F')
7626 exit(0); /* succeed (yes, it's ELF) */
7631 if $cc $ccflags $ldflags try.c >/dev/null 2>&1 && $run ./a.out; then
7633 You appear to have ELF support. I'll use $cc to build dynamic libraries.
7637 echo "I'll use ld to build dynamic libraries."
7646 rp="What command should be used to create dynamic libraries?"
7652 Some systems may require passing special flags to $ld to create a
7653 library that can be dynamically loaded. If your ld flags include
7654 -L/other/path options to locate libraries outside your loader's normal
7655 search path, you may need to specify those -L options here as well. To
7656 use no flags, say "none".
7659 case "$lddlflags" in
7660 '') case "$osname" in
7661 beos) dflt='-nostart' ;;
7663 case "$gccversion" in
7664 '') dflt="$dflt +vnocompatwarnings" ;;
7667 linux|irix*|gnu*) dflt='-shared' ;;
7668 next) dflt='none' ;;
7669 solaris) dflt='-G' ;;
7670 sunos) dflt='-assert nodefinitions' ;;
7671 svr4*|esix*|nonstopux) dflt="-G $ldflags" ;;
7675 *) dflt="$lddlflags" ;;
7678 : Try to guess additional flags to pick up local libraries.
7679 : Be careful not to append to a plain 'none'
7683 for thisflag in $ldflags; do
7688 *) dflt="$dflt $thisflag" ;;
7695 ''|' ') dflt='none' ;;
7698 rp="Any special flags to pass to $ld to create a dynamically loaded library?"
7701 none) lddlflags=' ' ;;
7702 *) lddlflags="$ans" ;;
7707 Some systems may require passing special flags to $cc to indicate that
7708 the resulting executable will use dynamic linking. To use no flags,
7712 case "$ccdlflags" in
7713 '') case "$osname" in
7714 linux|hpux|gnu*) dflt='-Wl,-E' ;;
7715 next|sunos) dflt='none' ;;
7719 *) dflt="$ccdlflags" ;;
7721 rp="Any special flags to pass to $cc to use dynamic linking?"
7724 none) ccdlflags=' ' ;;
7725 *) ccdlflags="$ans" ;;
7739 # No dynamic loading being used, so don't bother even to prompt.
7742 *) case "$useshrplib" in
7743 '') case "$osname" in
7744 svr4*|nonstopux|dgux|dynixptx|esix|powerux|beos|cygwin*)
7746 also='Building a shared libperl is required for dynamic loading to work on your system.'
7751 also='Building a shared libperl is needed for MAB support.'
7769 The perl executable is normally obtained by linking perlmain.c with
7770 libperl${_a}, any static extensions (usually just DynaLoader), and
7771 any other libraries needed on this system (such as -lm, etc.). Since
7772 your system supports dynamic loading, it is probably possible to build
7773 a shared libperl.$so. If you will have more than one executable linked
7774 to libperl.$so, this will significantly reduce the size of each
7775 executable, but it may have a noticeable effect on performance. The
7776 default is probably sensible for your system.
7780 rp="Build a shared libperl.$so (y/n)"
7784 useshrplib='true' ;;
7785 *) useshrplib='false' ;;
7790 case "$useshrplib" in
7794 # Figure out a good name for libperl.so. Since it gets stored in
7795 # a version-specific architecture-dependent library, the version
7796 # number isn't really that important, except for making cc/ld happy.
7798 # A name such as libperl.so.3.1
7799 majmin="libperl.$so.$patchlevel.$subversion"
7800 # A name such as libperl.so.301
7801 majonly=`echo $patchlevel $subversion |
7802 $awk '{printf "%d%02d", $1, $2}'`
7803 majonly=libperl.$so.$majonly
7804 # I'd prefer to keep the os-specific stuff here to a minimum, and
7805 # rely on figuring it out from the naming of libc.
7806 case "${osname}${osvers}" in
7809 # XXX How handle the --version stuff for MAB?
7811 linux*|gnu*) # ld won't link with a bare -lperl otherwise.
7814 cygwin*) # ld links against an importlib
7815 dflt=libperl$lib_ext
7817 *) # Try to guess based on whether libc has major.minor.
7819 *libc.$so.[0-9]*.[0-9]*) dflt=$majmin ;;
7820 *libc.$so.[0-9]*) dflt=$majonly ;;
7821 *) dflt=libperl.$so ;;
7831 I need to select a good name for the shared libperl. If your system uses
7832 library names with major and minor numbers, then you might want something
7833 like $majmin. Alternatively, if your system uses a single version
7834 number for shared libraries, then you might want to use $majonly.
7835 Or, your system might be quite happy with a simple libperl.$so.
7837 Since the shared libperl will get installed into a version-specific
7838 architecture-dependent directory, the version number of the shared perl
7839 library probably isn't important, so the default should be o.k.
7842 rp='What name do you want to give to the shared libperl?'
7845 echo "Ok, I'll use $libperl"
7848 libperl="libperl${_a}"
7852 # Detect old use of shrpdir via undocumented Configure -Dshrpdir
7856 WARNING: Use of the shrpdir variable for the installation location of
7857 the shared $libperl is not supported. It was never documented and
7858 will not work in this version. Let me (perlbug@perl.org)
7859 know of any problems this may cause.
7865 But your current setting of $shrpdir is
7866 the default anyway, so it's harmless.
7871 Further, your current attempted setting of $shrpdir
7872 conflicts with the value of $archlibexp/CORE
7873 that installperl will use.
7880 # How will the perl executable find the installed shared $libperl?
7881 # Add $xxx to ccdlflags.
7882 # If we can't figure out a command-line option, use $shrpenv to
7883 # set env LD_RUN_PATH. The main perl makefile uses this.
7884 shrpdir=$archlibexp/CORE
7887 if "$useshrplib"; then
7890 # We'll set it in Makefile.SH...
7895 freebsd|netbsd|openbsd|interix)
7896 xxx="-Wl,-R$shrpdir"
7898 bsdos|linux|irix*|dec_osf|gnu*)
7899 xxx="-Wl,-rpath,$shrpdir"
7902 # next doesn't like the default...
7905 # beos doesn't like the default, either.
7908 # hpux doesn't like the default, either.
7909 tmp_shrpenv="env LDOPTS=\"+s +b${shrpdir}\""
7912 tmp_shrpenv="env LD_RUN_PATH=$shrpdir"
7918 # Only add $xxx if it isn't already in ccdlflags.
7919 case " $ccdlflags " in
7921 *) ccdlflags="$ccdlflags $xxx"
7924 Adding $xxx to the flags
7925 passed to $ld so that the perl executable will find the
7926 installed shared $libperl.
7934 # Fix ccdlflags in AIX for building external extensions.
7935 # (For building Perl itself bare -bE:perl.exp is needed,
7936 # Makefile.SH takes care of this.)
7938 aix) ccdlflags="$ccdlflags -bE:$installarchlib/CORE/perl.exp" ;;
7940 # Respect a hint or command-line value.
7942 '') shrpenv="$tmp_shrpenv" ;;
7944 case "$ldlibpthname" in
7945 '') ldlibpthname=LD_LIBRARY_PATH ;;
7946 none) ldlibpthname='' ;;
7949 : determine where manual pages are on this system
7953 syspath='/usr/share/man/man1 /usr/man/man1'
7954 syspath="$syspath /usr/man/mann /usr/man/manl /usr/man/local/man1"
7955 syspath="$syspath /usr/man/u_man/man1"
7956 syspath="$syspath /usr/catman/u_man/man1 /usr/man/l_man/man1"
7957 syspath="$syspath /usr/local/man/u_man/man1 /usr/local/man/l_man/man1"
7958 syspath="$syspath /usr/man/man.L /local/man/man1 /usr/local/man/man1"
7959 sysman=`./loc . /usr/man/man1 $syspath`
7962 if $test -d "$sysman"; then
7963 echo "System manual is in $sysman." >&4
7965 echo "Could not find manual pages in source form." >&4
7968 : determine where manual pages go
7969 set man1dir man1dir none
7973 $spackage has manual pages available in source form.
7977 echo "However, you don't have nroff, so they're probably useless to you."
7979 '') man1dir="none";;
7982 echo "If you don't want the manual sources installed, answer 'none'."
7987 lookpath="$prefixexp/share/man/man1"
7988 lookpath="$lookpath $prefixexp/man/man1 $prefixexp/man/l_man/man1"
7989 lookpath="$lookpath $prefixexp/man/p_man/man1"
7990 lookpath="$lookpath $prefixexp/man/u_man/man1"
7991 lookpath="$lookpath $prefixexp/man/man.1"
7993 */?_man*) dflt=`./loc . $prefixexp/l_man/man1 $lookpath` ;;
7994 *) dflt=`./loc . $prefixexp/man/man1 $lookpath` ;;
8004 rp="Where do the main $spackage manual pages (source) go?"
8006 if $test "X$man1direxp" != "X$ansexp"; then
8010 man1direxp="$ansexp"
8016 : Change installation prefix, if necessary.
8017 if $test X"$prefix" != X"$installprefix"; then
8018 installman1dir=`echo $man1direxp | $sed "s#^$prefix#$installprefix#"`
8020 installman1dir="$man1direxp"
8023 : What suffix to use on installed man pages
8030 rp="What suffix should be used for the main $spackage man pages?"
8032 '') case "$man1dir" in
8046 *) dflt="$man1ext";;
8053 : see if we can have long filenames
8055 first=123456789abcdef
8057 if (echo hi >$first) 2>/dev/null; then
8058 if $test -f 123456789abcde; then
8059 echo 'You cannot have filenames longer than 14 characters. Sigh.' >&4
8062 echo 'You can have filenames longer than 14 characters.'>&4
8067 You can't have filenames longer than 14 chars.
8068 You can't even think about them!
8074 $rm -rf 123456789abcde*
8076 : determine where library module manual pages go
8077 set man3dir man3dir none
8081 $spackage has manual pages for many of the library modules.
8087 However, you don't have nroff, so they're probably useless to you.
8090 '') man3dir="none";;
8094 case "$d_flexfnam" in
8097 However, your system can't handle the long file names like File::Basename.3.
8100 '') man3dir="none";;
8104 echo "If you don't want the manual sources installed, answer 'none'."
8105 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
8107 '') dflt=`echo "$man1dir" | $sed -e 's/man1/man3/g' -e 's/man\.1/man\.3/g'`
8108 if $test -d "$privlib/man/man3"; then
8111 WARNING: Previous versions of perl installed man3 pages into
8112 $privlib/man/man3. This version will suggest a
8113 new default of $dflt.
8117 rp='Do you wish to preserve the old behavior?(y/n)'
8120 y*) dflt="$privlib/man/man3" ;;
8125 *) dflt="$man3dir" ;;
8132 rp="Where do the $package library man pages (source) go?"
8135 man3direxp="$ansexp"
8141 : Change installation prefix, if necessary.
8142 if $test X"$prefix" != X"$installprefix"; then
8143 installman3dir=`echo $man3direxp | $sed "s#^$prefix#$installprefix#"`
8145 installman3dir="$man3direxp"
8148 : What suffix to use on installed man pages
8154 rp="What suffix should be used for the $package library man pages?"
8156 '') case "$man3dir" in
8170 *) dflt="$man3ext";;
8177 : see if we have to deal with yellow pages, now NIS.
8178 if $test -d /usr/etc/yp || $test -d /etc/yp || $test -d /usr/lib/yp; then
8179 if $test -f /usr/etc/nibindd; then
8181 echo "I'm fairly confident you're on a NeXT."
8183 rp='Do you get the hosts file via NetInfo?'
8192 y*) hostcat='nidump hosts .';;
8193 *) case "$hostcat" in
8194 nidump*) hostcat='';;
8204 '') if $contains '^\+' /etc/passwd >/dev/null 2>&1; then
8212 rp='Are you getting the hosts file via yellow pages?'
8215 y*) hostcat='ypcat hosts';;
8216 *) hostcat='cat /etc/hosts';;
8222 '') test -f /etc/hosts && hostcat='cat /etc/hosts';;
8225 '') test -f /etc/group && groupcat='cat /etc/group';;
8228 '') test -f /etc/passwd && passcat='cat /etc/passwd';;
8231 : now get the host name
8233 echo "Figuring out host name..." >&4
8234 case "$myhostname" in
8236 echo 'Maybe "hostname" will work...'
8237 if tans=`sh -c hostname 2>&1` ; then
8245 if $test "$cont"; then
8247 echo 'Oh, dear. Maybe "/etc/systemid" is the key...'
8248 if tans=`cat /etc/systemid 2>&1` ; then
8250 phostname='cat /etc/systemid'
8251 echo "Whadyaknow. Xenix always was a bit strange..."
8254 elif $test -r /etc/systemid; then
8255 echo "(What is a non-Xenix system doing with /etc/systemid?)"
8258 if $test "$cont"; then
8259 echo 'No, maybe "uuname -l" will work...'
8260 if tans=`sh -c 'uuname -l' 2>&1` ; then
8262 phostname='uuname -l'
8264 echo 'Strange. Maybe "uname -n" will work...'
8265 if tans=`sh -c 'uname -n' 2>&1` ; then
8267 phostname='uname -n'
8269 echo 'Oh well, maybe I can mine it out of whoami.h...'
8270 if tans=`sh -c $contains' sysname $usrinc/whoami.h' 2>&1` ; then
8271 myhostname=`echo "$tans" | $sed 's/^.*"\(.*\)"/\1/'`
8272 phostname="sed -n -e '"'/sysname/s/^.*\"\\(.*\\)\"/\1/{'"' -e p -e q -e '}' <$usrinc/whoami.h"
8274 case "$myhostname" in
8275 '') echo "Does this machine have an identity crisis or something?"
8278 echo "Well, you said $myhostname before..."
8279 phostname='echo $myhostname';;
8285 case "$myhostname" in
8286 '') myhostname=noname ;;
8288 : you do not want to know about this
8293 if $test "$myhostname" ; then
8295 rp='Your host name appears to be "'$myhostname'".'" Right?"
8303 : bad guess or no guess
8304 while $test "X$myhostname" = X ; do
8306 rp="Please type the (one word) name of your host:"
8311 : translate upper to lower if necessary
8312 case "$myhostname" in
8314 echo "(Normalizing case in your host name)"
8315 myhostname=`echo $myhostname | ./tr '[A-Z]' '[a-z]'`
8319 case "$myhostname" in
8321 dflt=`expr "X$myhostname" : "X[^.]*\(\..*\)"`
8322 myhostname=`expr "X$myhostname" : "X\([^.]*\)\."`
8323 echo "(Trimming domain name from host name--host name is now $myhostname)"
8325 *) case "$mydomain" in
8328 test "X$hostcat" = "Xypcat hosts" &&
8329 ypmatch "$myhostname" hosts 2>/dev/null |\
8330 $sed -e 's/[ ]*#.*//; s/$/ /' > hosts && \
8333 test "X$hostcat" != "X" &&
8334 $hostcat | $sed -n -e "s/[ ]*#.*//; s/\$/ /
8335 /[ ]$myhostname[ . ]/p" > hosts
8338 if $test -f hosts; then
8339 $test x`$awk "/[0-9].*[ ]$myhostname$tmp_re/ { sum++ }
8340 END { print sum }" hosts` = x1 || tmp_re="[ ]"
8341 dflt=.`$awk "/[0-9].*[ ]$myhostname$tmp_re/ {for(i=2; i<=NF;i++) print \\\$i}" \
8342 hosts | $sort | $uniq | \
8343 $sed -n -e "s/$myhostname\.\([-a-zA-Z0-9_.]\)/\1/p"`
8344 case `$echo X$dflt` in
8345 X*\ *) echo "(Several hosts in the database matched hostname)"
8348 X.) echo "(You do not have fully-qualified names in the hosts database)"
8352 echo "(I cannot locate a hosts database anywhere)"
8357 tans=`./loc resolv.conf X /etc /usr/etc`
8358 if $test -f "$tans"; then
8359 echo "(Attempting domain name extraction from $tans)"
8360 dflt=.`$sed -n -e 's/ / /g' \
8361 -e 's/^search *\([^ ]*\).*/\1/p' $tans \
8362 | ./tr '[A-Z]' '[a-z]' 2>/dev/null`
8364 .) dflt=.`$sed -n -e 's/ / /g' \
8365 -e 's/^domain *\([^ ]*\).*/\1/p' $tans \
8366 | ./tr '[A-Z]' '[a-z]' 2>/dev/null`
8373 .) echo "(No help from resolv.conf either -- attempting clever guess)"
8374 dflt=.`sh -c domainname 2>/dev/null`
8377 .nis.*|.yp.*|.main.*) dflt=`echo $dflt | $sed -e 's/^\.[^.]*//'`;;
8381 case "$dflt$osname" in
8382 .os390) echo "(Attempting domain name extraction from //'SYS1.TCPPARMS(TCPDATA)')"
8383 dflt=.`awk '/^DOMAINORIGIN/ {print $2}' "//'SYS1.TCPPARMS(TCPDATA)'" 2>/dev/null`
8387 .) echo "(Lost all hope -- silly guess then)"
8393 *) dflt="$mydomain";;
8397 rp="What is your domain name?"
8407 : translate upper to lower if necessary
8410 echo "(Normalizing case in your domain name)"
8411 mydomain=`echo $mydomain | ./tr '[A-Z]' '[a-z]'`
8415 : a little sanity check here
8416 case "$phostname" in
8419 case `$phostname | ./tr '[A-Z]' '[a-z]'` in
8420 $myhostname$mydomain|$myhostname) ;;
8422 case "$phostname" in
8424 echo "(That doesn't agree with your whoami.h file, by the way.)"
8427 echo "(That doesn't agree with your $phostname command, by the way.)"
8437 I need to get your e-mail address in Internet format if possible, i.e.
8438 something like user@host.domain. Please answer accurately since I have
8439 no easy means to double check it. The default value provided below
8440 is most probably close to reality but may not be valid from outside
8441 your organization...
8445 while test "$cont"; do
8447 '') dflt="$cf_by@$myhostname$mydomain";;
8448 *) dflt="$cf_email";;
8450 rp='What is your e-mail address?'
8456 rp='Address does not look like an Internet one. Use it anyway?'
8472 If you or somebody else will be maintaining perl at your site, please
8473 fill in the correct e-mail address here so that they may be contacted
8474 if necessary. Currently, the "perlbug" program included with perl
8475 will send mail to this address in addition to perlbug@perl.org. You may
8476 enter "none" for no administrator.
8479 case "$perladmin" in
8480 '') dflt="$cf_email";;
8481 *) dflt="$perladmin";;
8483 rp='Perl administrator e-mail address'
8487 : determine whether to only install version-specific parts.
8490 Do you want to install only the version-specific parts of the perl
8491 distribution? Usually you do *not* want to do this.
8493 case "$versiononly" in
8494 "$define"|[Yy]*|true) dflt='y' ;;
8497 rp="Do you want to install only the version-specific parts of perl?"
8500 [yY]*) val="$define";;
8506 case "$versiononly" in
8507 "$define") inc_version_list=''
8508 inc_version_list_init=0
8512 : figure out how to guarantee perl startup
8513 case "$startperl" in
8515 case "$sharpbang" in
8519 I can use the #! construct to start perl on your system. This will
8520 make startup of perl scripts faster, but may cause problems if you
8521 want to share those scripts and perl is not in a standard place
8522 ($binexp/perl) on all your platforms. The alternative is to force
8523 a shell by starting the script with a single ':' character.
8526 case "$versiononly" in
8527 "$define") dflt="$binexp/perl$version";;
8528 *) dflt="$binexp/perl";;
8530 rp='What shall I put after the #! to start up perl ("none" to not use #!)?'
8533 none) startperl=": # use perl";;
8534 *) startperl="#!$ans"
8535 if $test 30 -lt `echo "$ans" | wc -c`; then
8538 WARNING: Some systems limit the #! command to 32 characters.
8539 If you experience difficulty running Perl scripts with #!, try
8540 installing Perl in a directory with a shorter pathname.
8546 *) startperl=": # use perl"
8551 echo "I'll use $startperl to start perl scripts."
8553 : figure best path for perl in scripts
8556 case "$versiononly" in
8557 "$define") perlpath="$binexp/perl$version";;
8558 *) perlpath="$binexp/perl";;
8560 case "$startperl" in
8565 I will use the "eval 'exec'" idiom to start Perl on your system.
8566 I can use the full path of your Perl binary for this purpose, but
8567 doing so may cause problems if you want to share those scripts and
8568 Perl is not always in a standard place ($binexp/perl).
8572 rp="What path shall I use in \"eval 'exec'\"?"
8579 case "$startperl" in
8581 *) echo "I'll use $perlpath in \"eval 'exec'\"" ;;
8584 : determine where public executable scripts go
8585 set scriptdir scriptdir
8587 case "$scriptdir" in
8590 : guess some guesses
8591 $test -d /usr/share/scripts && dflt=/usr/share/scripts
8592 $test -d /usr/share/bin && dflt=/usr/share/bin
8593 $test -d /usr/local/script && dflt=/usr/local/script
8594 $test -d /usr/local/scripts && dflt=/usr/local/scripts
8595 $test -d $prefixexp/script && dflt=$prefixexp/script
8599 *) dflt="$scriptdir"
8604 Some installations have a separate directory just for executable scripts so
8605 that they can mount it across multiple architectures but keep the scripts in
8606 one spot. You might, for example, have a subdirectory of /usr/share for this.
8607 Or you might just lump your scripts in with all your other executables.
8611 rp='Where do you keep publicly executable scripts?'
8613 if $test "X$ansexp" != "X$scriptdirexp"; then
8617 scriptdirexp="$ansexp"
8618 : Change installation prefix, if necessary.
8619 if $test X"$prefix" != X"$installprefix"; then
8620 installscript=`echo $scriptdirexp | sed "s#^$prefix#$installprefix#"`
8622 installscript="$scriptdirexp"
8625 : determine where add-on public executables go
8627 '') dflt=$siteprefix/bin ;;
8631 rp='Pathname where the add-on public executables should be installed?'
8634 sitebinexp="$ansexp"
8635 : Change installation prefix, if necessary.
8636 if $test X"$prefix" != X"$installprefix"; then
8637 installsitebin=`echo $sitebinexp | sed "s#^$prefix#$installprefix#"`
8639 installsitebin="$sitebinexp"
8642 : determine where add-on html pages go
8643 : There is no standard location, so try to copy the previously-selected
8644 : directory structure for the core html pages.
8645 case "$sitehtml1dir" in
8646 '') dflt=`echo "$html1dir" | $sed "s#^$prefix#$siteprefix#"` ;;
8647 *) dflt=$sitehtml1dir ;;
8650 ''|' ') dflt=none ;;
8653 rp='Pathname where the site-specific html pages should be installed?'
8656 sitehtml1direxp="$ansexp"
8657 : Change installation prefix, if necessary.
8658 if $test X"$prefix" != X"$installprefix"; then
8659 installsitehtml1dir=`echo $sitehtml1direxp | $sed "s#^$prefix#$installprefix#"`
8661 installsitehtml1dir="$sitehtml1direxp"
8664 : determine where add-on library html pages go
8665 : There is no standard location, so try to copy the previously-selected
8666 : directory structure for the core html pages.
8667 case "$sitehtml3dir" in
8668 '') dflt=`echo "$html3dir" | $sed "s#^$prefix#$siteprefix#"` ;;
8669 *) dflt=$sitehtml3dir ;;
8672 ''|' ') dflt=none ;;
8675 rp='Pathname where the site-specific library html pages should be installed?'
8678 sitehtml3direxp="$ansexp"
8679 : Change installation prefix, if necessary.
8680 if $test X"$prefix" != X"$installprefix"; then
8681 installsitehtml3dir=`echo $sitehtml3direxp | $sed "s#^$prefix#$installprefix#"`
8683 installsitehtml3dir="$sitehtml3direxp"
8686 : determine where add-on manual pages go
8687 case "$siteman1dir" in
8688 '') dflt=`echo $man1dir | $sed "s#^$prefix#$siteprefix#"` ;;
8689 *) dflt=$siteman1dir ;;
8692 ''|' ') dflt=none ;;
8695 rp='Pathname where the site-specific manual pages should be installed?'
8698 siteman1direxp="$ansexp"
8699 : Change installation prefix, if necessary.
8700 if $test X"$prefix" != X"$installprefix"; then
8701 installsiteman1dir=`echo $siteman1direxp | $sed "s#^$prefix#$installprefix#"`
8703 installsiteman1dir="$siteman1direxp"
8706 : determine where add-on library man pages go
8707 case "$siteman3dir" in
8708 '') dflt=`echo $man3dir | $sed "s#^$prefix#$siteprefix#"` ;;
8709 *) dflt=$siteman3dir ;;
8712 ''|' ') dflt=none ;;
8715 rp='Pathname where the site-specific library manual pages should be installed?'
8718 siteman3direxp="$ansexp"
8719 : Change installation prefix, if necessary.
8720 if $test X"$prefix" != X"$installprefix"; then
8721 installsiteman3dir=`echo $siteman3direxp | $sed "s#^$prefix#$installprefix#"`
8723 installsiteman3dir="$siteman3direxp"
8726 : determine where add-on public executable scripts go
8727 case "$sitescript" in
8728 '') dflt=$siteprefix/script
8729 $test -d $dflt || dflt=$sitebin ;;
8730 *) dflt="$sitescript" ;;
8733 rp='Pathname where add-on public executable scripts should be installed?'
8736 sitescriptexp="$ansexp"
8737 : Change installation prefix, if necessary.
8738 if $test X"$prefix" != X"$installprefix"; then
8739 installsitescript=`echo $sitescriptexp | sed "s#^$prefix#$installprefix#"`
8741 installsitescript="$sitescriptexp"
8744 case "$usefaststdio" in
8745 $define|true|[yY]*|'')
8746 xversion=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
8756 Perl can be built to use 'fast stdio', which means using the stdio
8757 library but also directly manipulating the stdio buffers to enable
8758 faster I/O. Using stdio is better for backward compatibility (especially
8759 for Perl extensions), but on the other hand since Perl 5.8 the 'perlio'
8760 interface has been preferred instead of stdio.
8762 If this doesn't make any sense to you, just accept the default '$dflt'.
8764 rp='Use the "fast stdio" if available?'
8767 y|Y) val="$define" ;;
8774 : define an is-a-typedef? function
8775 typedef='type=$1; var=$2; def=$3; shift; shift; shift; inclist=$@;
8777 "") inclist="sys/types.h";;
8779 eval "varval=\$$var";
8783 for inc in $inclist; do
8784 echo "#include <$inc>" >>temp.c;
8786 echo "#ifdef $type" >> temp.c;
8787 echo "printf(\"We have $type\");" >> temp.c;
8788 echo "#endif" >> temp.c;
8789 $cppstdin $cppflags $cppminus < temp.c >temp.E 2>/dev/null;
8790 if $contains $type temp.E >/dev/null 2>&1; then
8796 *) eval "$var=\$varval";;
8799 : define an is-a-typedef? function that prompts if the type is not available.
8800 typedef_ask='type=$1; var=$2; def=$3; shift; shift; shift; inclist=$@;
8802 "") inclist="sys/types.h";;
8804 eval "varval=\$$var";
8808 for inc in $inclist; do
8809 echo "#include <$inc>" >>temp.c;
8811 echo "#ifdef $type" >> temp.c;
8812 echo "printf(\"We have $type\");" >> temp.c;
8813 echo "#endif" >> temp.c;
8814 $cppstdin $cppflags $cppminus < temp.c >temp.E 2>/dev/null;
8816 echo "$rp" | $sed -e "s/What is/Looking for/" -e "s/?/./";
8817 if $contains $type temp.E >/dev/null 2>&1; then
8818 echo "$type found." >&4;
8821 echo "$type NOT found." >&4;
8827 *) eval "$var=\$varval";;
8830 : see what type lseek is declared as in the kernel
8831 rp="What is the type used for lseek's offset on this system?"
8832 set off_t lseektype long stdio.h sys/types.h
8836 echo "Checking to see how big your file offsets are..." >&4
8838 #include <sys/types.h>
8842 printf("%d\n", (int)sizeof($lseektype));
8847 if eval $compile_ok; then
8848 lseeksize=`$run ./try`
8849 echo "Your file offsets are $lseeksize bytes long."
8853 echo "(I can't seem to compile the test program. Guessing...)"
8854 rp="What is the size of your file offsets (in bytes)?"
8860 : see what type file positions are declared as in the library
8861 rp="What is the type for file position used by fsetpos()?"
8862 set fpos_t fpostype long stdio.h sys/types.h
8867 *_t) zzz="$fpostype" ;;
8870 echo "Checking the size of $zzz..." >&4
8872 #include <sys/types.h>
8879 printf("%d\n", (int)sizeof($fpostype));
8884 if eval $compile_ok; then
8888 echo "(I can't execute the test program--guessing $fpossize.)" >&4
8891 echo "Your $zzz is $fpossize bytes long."
8897 echo "(I can't compile the test program. Guessing...)" >&4
8898 rp="What is the size of your file positions (in bytes)?"
8903 # Backward compatibility (uselfs is deprecated).
8905 "$define"|true|[yY]*)
8908 *** Configure -Duselfs is deprecated, using -Duselargefiles instead.
8910 uselargefiles="$define"
8914 case "$lseeksize:$fpossize" in
8917 You can have files larger than 2 gigabytes.
8920 *) case "$uselargefiles" in
8921 "$undef"|false|[nN]*) dflt='n' ;;
8926 Perl can be built to understand large files (files larger than 2 gigabytes)
8927 on some systems. To do so, Configure can be run with -Duselargefiles.
8929 If this doesn't make any sense to you, just accept the default '$dflt'.
8931 rp='Try to understand large files, if available?'
8934 y|Y) val="$define" ;;
8941 : Look for a hint-file generated 'call-back-unit'. If the
8942 : user has specified that a large files perl is to be built,
8943 : we may need to set or change some other defaults.
8944 if $test -f uselargefiles.cbu; then
8945 echo "Your platform has some specific hints regarding large file builds, using them..."
8946 . ./uselargefiles.cbu
8948 case "$uselargefiles" in
8950 if $test -f uselargefiles.cbu; then
8952 echo "Rechecking to see how big your file offsets are..." >&4
8954 #include <sys/types.h>
8958 printf("%d\n", (int)sizeof($lseektype));
8963 if eval $compile_ok; then
8964 lseeksize=`$run ./try`
8965 $echo "Your file offsets are now $lseeksize bytes long."
8969 echo "(I can't seem to compile the test program. Guessing...)"
8970 rp="What is the size of your file offsets (in bytes)?"
8975 *_t) zzz="$fpostype" ;;
8978 $echo $n "Rechecking the size of $zzz...$c" >&4
8980 #include <sys/types.h>
8987 printf("%d\n", (int)sizeof($fpostype));
8992 if eval $compile_ok; then
8997 echo "(I can't execute the test program--guessing $fpossize.)" >&4
9000 echo " $fpossize bytes." >&4
9006 echo "(I can't compile the test program. Guessing...)" >&4
9007 rp="What is the size of your file positions (in bytes)?"
9016 # probably will refer to
9017 # $archlib $privlib $sitearch $sitelib $vendorarch $vendorlib
9019 userelocatableinc=undef
9021 case "$vendorprefix" in
9022 '') d_vendorbin="$undef"
9026 *) d_vendorbin="$define"
9027 : determine where vendor-supplied executables go.
9028 case "$vendorbin" in
9029 '') dflt=$vendorprefix/bin ;;
9030 *) dflt="$vendorbin" ;;
9033 rp='Pathname for the vendor-supplied executables directory?'
9036 vendorbinexp="$ansexp"
9039 : Change installation prefix, if necessary.
9040 if $test X"$prefix" != X"$installprefix"; then
9041 installvendorbin=`echo $vendorbinexp | $sed "s#^$prefix#$installprefix#"`
9043 installvendorbin="$vendorbinexp"
9046 case "$vendorprefix" in
9047 '') vendorhtml1dir=''
9048 vendorhtml1direxp=''
9050 *) : determine where vendor-supplied html pages go.
9051 : There is no standard location, so try to copy the previously-selected
9052 : directory structure for the core html pages.
9053 : XXX Better default suggestions would be welcome.
9054 case "$vendorhtml1dir" in
9055 '') dflt=`echo "$html1dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
9056 *) dflt=$vendorhtml1dir ;;
9059 ''|' ') dflt=none ;;
9062 rp='Pathname for the vendor-supplied html pages?'
9064 vendorhtml1dir="$ans"
9065 vendorhtml1direxp="$ansexp"
9068 : Use ' ' for none so value is preserved next time through Configure
9069 $test X"$vendorhtml1dir" = "X" && vendorhtml1dir=' '
9070 : Change installation prefix, if necessary.
9071 if $test X"$prefix" != X"$installprefix"; then
9072 installvendorhtml1dir=`echo $vendorhtml1direxp | $sed "s#^$prefix#$installprefix#"`
9074 installvendorhtml1dir="$vendorhtml1direxp"
9077 case "$vendorprefix" in
9078 '') vendorhtml3dir=''
9079 vendorhtml3direxp=''
9081 *) : determine where vendor-supplied module html pages go.
9082 : There is no standard location, so try to copy the previously-selected
9083 : directory structure for the core html pages.
9084 : XXX Better default suggestions would be welcome.
9085 case "$vendorhtml3dir" in
9086 '') dflt=`echo "$html3dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
9087 *) dflt=$vendorhtml3dir ;;
9090 ''|' ') dflt=none ;;
9093 rp='Pathname for the vendor-supplied html pages?'
9095 vendorhtml3dir="$ans"
9096 vendorhtml3direxp="$ansexp"
9099 : Use ' ' for none so value is preserved next time through Configure
9100 $test X"$vendorhtml3dir" = "X" && vendorhtml3dir=' '
9101 : Change installation prefix, if necessary.
9102 if $test X"$prefix" != X"$installprefix"; then
9103 installvendorhtml3dir=`echo $vendorhtml3direxp | $sed "s#^$prefix#$installprefix#"`
9105 installvendorhtml3dir="$vendorhtml3direxp"
9108 case "$vendorprefix" in
9109 '') vendorman1dir=''
9112 *) : determine where vendor-supplied manual pages go.
9113 case "$vendorman1dir" in
9114 '') dflt=`echo "$man1dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
9115 *) dflt=$vendorman1dir ;;
9118 ''|' ') dflt=none ;;
9121 rp='Pathname for the vendor-supplied manual section 1 pages?'
9123 vendorman1dir="$ans"
9124 vendorman1direxp="$ansexp"
9127 : Use ' ' for none so value is preserved next time through Configure
9128 $test X"$vendorman1dir" = "X" && vendorman1dir=' '
9129 : Change installation prefix, if necessary.
9130 if $test X"$prefix" != X"$installprefix"; then
9131 installvendorman1dir=`echo "$vendorman1direxp" | $sed "s#^$prefix#$installprefix#"`
9133 installvendorman1dir="$vendorman1direxp"
9136 case "$vendorprefix" in
9137 '') vendorman3dir=''
9140 *) : determine where vendor-supplied module manual pages go.
9141 case "$vendorman3dir" in
9142 '') dflt=`echo "$man3dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
9143 *) dflt=$vendorman3dir ;;
9146 ''|' ') dflt=none ;;
9149 rp='Pathname for the vendor-supplied manual section 3 pages?'
9151 vendorman3dir="$ans"
9152 vendorman3direxp="$ansexp"
9155 : Use ' ' for none so value is preserved next time through Configure
9156 $test X"$vendorman3dir" = "X" && vendorman3dir=' '
9157 : Change installation prefix, if necessary.
9158 if $test X"$prefix" != X"$installprefix"; then
9159 installvendorman3dir=`echo "$vendorman3direxp" | $sed "s#^$prefix#$installprefix#"`
9161 installvendorman3dir="$vendorman3direxp"
9164 case "$vendorprefix" in
9165 '') d_vendorscript="$undef"
9169 *) d_vendorscript="$define"
9170 : determine where vendor-supplied scripts go.
9171 case "$vendorscript" in
9172 '') dflt=$vendorprefix/script
9173 $test -d $dflt || dflt=$vendorbin ;;
9174 *) dflt="$vendorscript" ;;
9178 The installation process will create a directory for
9179 vendor-supplied scripts.
9183 rp='Pathname for the vendor-supplied scripts directory?'
9186 vendorscriptexp="$ansexp"
9189 : Change installation prefix, if necessary.
9190 if $test X"$prefix" != X"$installprefix"; then
9191 installvendorscript=`echo $vendorscriptexp | $sed "s#^$prefix#$installprefix#"`
9193 installvendorscript="$vendorscriptexp"
9196 : see if qgcvt exists
9202 if $test X"$d_longdbl" = X"$define"; then
9204 echo "Checking how to print long doubles..." >&4
9206 if $test X"$sPRIfldbl" = X -a X"$doublesize" = X"$longdblsize"; then
9207 $cat >try.c <<'EOCP'
9208 #include <sys/types.h>
9212 printf("%.3f\n", d);
9216 if eval $compile; then
9220 sPRIfldbl='"f"'; sPRIgldbl='"g"'; sPRIeldbl='"e"';
9221 sPRIFUldbl='"F"'; sPRIGUldbl='"G"'; sPRIEUldbl='"E"';
9222 echo "We will use %f."
9228 if $test X"$sPRIfldbl" = X; then
9229 $cat >try.c <<'EOCP'
9230 #include <sys/types.h>
9233 long double d = 123.456;
9234 printf("%.3Lf\n", d);
9238 if eval $compile; then
9242 sPRIfldbl='"Lf"'; sPRIgldbl='"Lg"'; sPRIeldbl='"Le"';
9243 sPRIFUldbl='"LF"'; sPRIGUldbl='"LG"'; sPRIEUldbl='"LE"';
9244 echo "We will use %Lf."
9250 if $test X"$sPRIfldbl" = X; then
9251 $cat >try.c <<'EOCP'
9252 #include <sys/types.h>
9255 long double d = 123.456;
9256 printf("%.3llf\n", d);
9260 if eval $compile; then
9264 sPRIfldbl='"llf"'; sPRIgldbl='"llg"'; sPRIeldbl='"lle"';
9265 sPRIFUldbl='"llF"'; sPRIGUldbl='"llG"'; sPRIEUldbl='"llE"';
9266 echo "We will use %llf."
9272 if $test X"$sPRIfldbl" = X; then
9273 $cat >try.c <<'EOCP'
9274 #include <sys/types.h>
9277 long double d = 123.456;
9278 printf("%.3lf\n", d);
9282 if eval $compile; then
9286 sPRIfldbl='"lf"'; sPRIgldbl='"lg"'; sPRIeldbl='"le"';
9287 sPRIFUldbl='"lF"'; sPRIGUldbl='"lG"'; sPRIEUldbl='"lE"';
9288 echo "We will use %lf."
9294 if $test X"$sPRIfldbl" = X; then
9295 echo "Cannot figure out how to print long doubles." >&4
9297 sSCNfldbl=$sPRIfldbl # expect consistency
9304 case "$sPRIfldbl" in
9305 '') d_PRIfldbl="$undef"; d_PRIgldbl="$undef"; d_PRIeldbl="$undef";
9306 d_PRIFUldbl="$undef"; d_PRIGUldbl="$undef"; d_PRIEUldbl="$undef";
9307 d_SCNfldbl="$undef";
9309 *) d_PRIfldbl="$define"; d_PRIgldbl="$define"; d_PRIeldbl="$define";
9310 d_PRIFUldbl="$define"; d_PRIGUldbl="$define"; d_PRIEUldbl="$define";
9311 d_SCNfldbl="$define";
9315 : Check how to convert floats to strings.
9317 if test "X$d_Gconvert" = X; then
9320 echo "Checking for an efficient way to convert floats to strings."
9322 case "$uselongdouble" in
9323 "$define") echo "#define USE_LONG_DOUBLE" >>try.c ;;
9325 case "$d_longdbl" in
9326 "$define") echo "#define HAS_LONG_DOUBLE" >>try.c ;;
9328 case "$d_PRIgldbl" in
9329 "$define") echo "#define HAS_PRIgldbl" >>try.c ;;
9333 #define Gconvert(x,n,t,b) gconvert((x),(n),(t),(b))
9334 char *myname = "gconvert";
9337 #define Gconvert(x,n,t,b) gcvt((x),(n),(b))
9338 char *myname = "gcvt";
9341 #define Gconvert(x,n,t,b) qgcvt((x),(n),(b))
9342 char *myname = "qgcvt";
9343 #define DOUBLETYPE long double
9346 #if defined(USE_LONG_DOUBLE) && defined(HAS_LONG_DOUBLE)
9348 #define Gconvert(x,n,t,b) sprintf((b),"%.*"$sPRIgldbl,(n),(x))
9350 #define Gconvert(x,n,t,b) sprintf((b),"%.*g",(n),(double)(x))
9353 #define Gconvert(x,n,t,b) sprintf((b),"%.*g",(n),(x))
9355 char *myname = "sprintf";
9359 #if defined(USE_LONG_DOUBLE) && defined(HAS_LONG_DOUBLE)
9360 #define DOUBLETYPE long double
9362 #define DOUBLETYPE double
9368 #define I_STDLIB $i_stdlib
9374 checkit(expect, got)
9378 if (strcmp(expect, got)) {
9379 printf("%s oddity: Expected %s, got %s\n",
9380 myname, expect, got);
9390 /* This must be 1st test on (which?) platform */
9391 /* Alan Burlison <AlanBurlsin@unn.unisys.com> */
9392 Gconvert((DOUBLETYPE)0.1, 8, 0, buf);
9393 checkit("0.1", buf);
9395 Gconvert((DOUBLETYPE)0.01, 8, 0, buf);
9396 checkit("0.01", buf);
9398 Gconvert((DOUBLETYPE)0.001, 8, 0, buf);
9399 checkit("0.001", buf);
9401 Gconvert((DOUBLETYPE)0.0001, 8, 0, buf);
9402 checkit("0.0001", buf);
9404 Gconvert((DOUBLETYPE)0.00009, 8, 0, buf);
9405 if (strlen(buf) > 5)
9406 checkit("9e-005", buf); /* for Microsoft ?? */
9408 checkit("9e-05", buf);
9410 Gconvert((DOUBLETYPE)1.0, 8, 0, buf);
9413 Gconvert((DOUBLETYPE)1.1, 8, 0, buf);
9414 checkit("1.1", buf);
9416 Gconvert((DOUBLETYPE)1.01, 8, 0, buf);
9417 checkit("1.01", buf);
9419 Gconvert((DOUBLETYPE)1.001, 8, 0, buf);
9420 checkit("1.001", buf);
9422 Gconvert((DOUBLETYPE)1.0001, 8, 0, buf);
9423 checkit("1.0001", buf);
9425 Gconvert((DOUBLETYPE)1.00001, 8, 0, buf);
9426 checkit("1.00001", buf);
9428 Gconvert((DOUBLETYPE)1.000001, 8, 0, buf);
9429 checkit("1.000001", buf);
9431 Gconvert((DOUBLETYPE)0.0, 8, 0, buf);
9434 Gconvert((DOUBLETYPE)-1.0, 8, 0, buf);
9437 /* Some Linux gcvt's give 1.e+5 here. */
9438 Gconvert((DOUBLETYPE)100000.0, 8, 0, buf);
9439 checkit("100000", buf);
9441 /* Some Linux gcvt's give -1.e+5 here. */
9442 Gconvert((DOUBLETYPE)-100000.0, 8, 0, buf);
9443 checkit("-100000", buf);
9445 Gconvert((DOUBLETYPE)123.456, 8, 0, buf);
9446 checkit("123.456", buf);
9448 /* Testing of 1e+129 in bigintpm.t must not get extra '.' here. */
9449 Gconvert((DOUBLETYPE)1e34, 8, 0, buf);
9450 /* 34 should be enough to scare even long double
9451 * places into using the e notation. */
9452 if (strlen(buf) > 5)
9453 checkit("1e+034", buf); /* for Microsoft */
9455 checkit("1e+34", buf);
9457 /* For Perl, if you add additional tests here, also add them to
9458 * t/base/num.t for benefit of platforms not using Configure or
9459 * overriding d_Gconvert */
9464 : first add preferred functions to our list
9466 for xxx_convert in $gconvert_preference; do
9467 case $xxx_convert in
9468 gcvt|gconvert|sprintf) xxx_list="$xxx_list $xxx_convert" ;;
9469 *) echo "Discarding unrecognized gconvert_preference $xxx_convert" >&4 ;;
9472 : then add any others
9473 for xxx_convert in gconvert gcvt sprintf; do
9476 *) xxx_list="$xxx_list $xxx_convert" ;;
9480 case "$d_longdbl$uselongdouble" in
9482 : again, add prefered functions to our list first
9484 for xxx_convert in $gconvert_ld_preference; do
9485 case $xxx_convert in
9486 qgcvt|gcvt|gconvert|sprintf) xxx_ld_list="$xxx_ld_list $xxx_convert" ;;
9487 *) echo "Discarding unrecognized gconvert_ld_preference $xxx_convert" ;;
9490 : then add qgcvt, sprintf--then, in xxx_list order, gconvert and gcvt
9491 for xxx_convert in qgcvt sprintf $xxx_list; do
9492 case "$xxx_ld_list" in
9493 $xxx_convert*|*" $xxx_convert"*) ;;
9494 *) xxx_ld_list="$xxx_ld_list $xxx_convert" ;;
9497 : if sprintf cannot do long doubles, move it to the end
9498 if test "$d_PRIgldbl" != "$define"; then
9499 xxx_ld_list="`echo $xxx_ld_list|sed s/sprintf//` sprintf"
9501 : if no qgcvt, remove it
9502 if test "$d_qgcvt" != "$define"; then
9503 xxx_ld_list="`echo $xxx_ld_list|sed s/qgcvt//`"
9506 xxx_list="$xxx_ld_list"
9510 for xxx_convert in $xxx_list; do
9511 echo "Trying $xxx_convert..."
9513 set try -DTRY_$xxx_convert
9514 if eval $compile; then
9515 echo "$xxx_convert() found." >&4
9517 echo "I'll use $xxx_convert to convert floats into a string." >&4
9520 echo "...But $xxx_convert didn't work as I expected."
9524 echo "$xxx_convert NOT found." >&4
9528 if test X$xxx_convert = X; then
9529 echo "*** WHOA THERE!!! ***" >&4
9530 echo "None of ($xxx_list) seemed to work properly. I'll use sprintf." >&4
9534 case "$xxx_convert" in
9535 gconvert) d_Gconvert='gconvert((x),(n),(t),(b))' ;;
9536 gcvt) d_Gconvert='gcvt((x),(n),(b))' ;;
9537 qgcvt) d_Gconvert='qgcvt((x),(n),(b))' ;;
9538 *) case "$uselongdouble$d_longdbl$d_PRIgldbl" in
9539 "$define$define$define")
9540 d_Gconvert="sprintf((b),\"%.*\"$sPRIgldbl,(n),(x))" ;;
9541 "$define$define$undef")
9542 d_Gconvert='sprintf((b),"%.*g",(n),(double)(x))' ;;
9543 *) d_Gconvert='sprintf((b),"%.*g",(n),(x))' ;;
9550 : see if _fwalk exists
9554 : Initialize h_fcntl
9557 : Initialize h_sysfile
9560 : access call always available on UNIX
9564 : locate the flags for 'access()'
9568 $cat >access.c <<EOCP
9569 #include <sys/types.h>
9574 #include <sys/file.h>
9587 : check sys/file.h first, no particular reason here
9588 if $test `./findhdr sys/file.h` && \
9589 $cc -o access $cppflags -DI_SYS_FILE access.c >/dev/null 2>&1 ; then
9591 echo "<sys/file.h> defines the *_OK access constants." >&4
9592 elif $test `./findhdr fcntl.h` && \
9593 $cc -o access $cppflags -DI_FCNTL access.c >/dev/null 2>&1 ; then
9595 echo "<fcntl.h> defines the *_OK access constants." >&4
9596 elif $test `./findhdr unistd.h` && \
9597 $cc -o access $cppflags -DI_UNISTD access.c >/dev/null 2>&1 ; then
9598 echo "<unistd.h> defines the *_OK access constants." >&4
9600 echo "I can't find the four *_OK access constants--I'll use mine." >&4
9606 : see if accessx exists
9607 set accessx d_accessx
9610 : see if aintl exists
9614 : see if alarm exists
9618 : see if POSIX threads are available
9619 set pthread.h i_pthread
9622 : define a fucntion to check prototypes
9623 $cat > protochk <<EOSH
9626 optimize="$optimize"
9628 prototype="$prototype"
9631 usethreads=$usethreads
9632 i_pthread=$i_pthread
9633 pthread_h_first=$pthread_h_first
9636 $cat >> protochk <<'EOSH'
9641 while test $# -ge 2; do
9643 $define) echo "#include <$2>" >> try.c ;;
9644 literal) echo "$2" >> try.c ;;
9646 # Extra magic for the benefit of systems that need pthread.h
9647 # to be included early to correctly detect threadsafe functions.
9648 # Such functions must guarantee themselves, though, that the usethreads
9649 # and i_pthread have been defined, before calling protochk.
9650 if test "$usethreads" = "$define" -a "$i_pthread" = "$define" -a "$pthread_h_first" = "$define" -a "$pthread_h_done" = ""; then
9651 echo "#include <pthread.h>" >> try.c
9656 test "$prototype" = "$define" && echo '#define CAN_PROTOTYPE' >> try.c
9657 cat >> try.c <<'EOCP'
9658 #ifdef CAN_PROTOTYPE
9659 #define _(args) args
9664 echo "$foo" >> try.c
9665 echo 'int no_real_function_has_this_name _((void)) { return 0; }' >> try.c
9666 $cc $optimize $ccflags -c try.c > /dev/null 2>&1
9674 hasproto='varname=$1; func=$2; shift; shift;
9675 while $test $# -ge 2; do
9677 $define) echo "#include <$2>";;
9681 $cppstdin $cppflags $cppminus < try.c > tryout.c 2>/dev/null;
9682 if $contains "$func.*(" tryout.c >/dev/null 2>&1; then
9683 echo "$func() prototype found.";
9686 echo "$func() prototype NOT found.";
9691 $rm -f try.c tryout.c'
9693 : see if sys/types.h has to be included
9694 set sys/types.h i_systypes
9697 : see if sys/select.h has to be included
9698 set sys/select.h i_sysselct
9701 hasfield='varname=$1; struct=$2; field=$3; shift; shift; shift;
9702 while $test $# -ge 2; do
9704 $define) echo "#include <$2>";;
9708 echo "int main () { struct $struct foo; char* bar; bar = (char*)foo.$field; }" >> try.c;
9710 if eval $compile; then
9719 : see if we should include time.h, sys/time.h, or both
9721 if test "X$timeincl" = X; then
9722 echo "Testing to see if we should include <time.h>, <sys/time.h> or both." >&4
9723 $echo $n "I'm now running the test program...$c"
9725 #include <sys/types.h>
9730 #ifdef SYSTIMEKERNEL
9733 #include <sys/time.h>
9736 #include <sys/select.h>
9749 struct timezone tzp;
9751 if (foo.tm_sec == foo.tm_sec)
9754 if (bar.tv_sec == bar.tv_sec)
9761 for s_timezone in '-DS_TIMEZONE' ''; do
9763 for s_timeval in '-DS_TIMEVAL' ''; do
9764 for i_systimek in '' '-DSYSTIMEKERNEL'; do
9765 for i_time in '' '-DI_TIME'; do
9766 for i_systime in '-DI_SYSTIME' ''; do
9769 set try $i_time $i_systime $i_systimek $sysselect $s_timeval $s_timezone
9770 if eval $compile; then
9771 set X $i_time $i_systime $i_systimek $sysselect $s_timeval
9775 $echo $n "Succeeded with $flags$c"
9787 *SYSTIMEKERNEL*) i_systimek="$define"
9788 timeincl=`./findhdr sys/time.h`
9789 echo "We'll include <sys/time.h> with KERNEL defined." >&4;;
9790 *) i_systimek="$undef";;
9793 *I_TIME*) i_time="$define"
9794 timeincl=`./findhdr time.h`" $timeincl"
9795 echo "We'll include <time.h>." >&4;;
9796 *) i_time="$undef";;
9799 *I_SYSTIME*) i_systime="$define"
9800 timeincl=`./findhdr sys/time.h`" $timeincl"
9801 echo "We'll include <sys/time.h>." >&4;;
9802 *) i_systime="$undef";;
9806 : see if struct tm knows about tm_zone
9807 case "$i_systime$i_time" in
9810 echo "Checking to see if your struct tm has tm_zone field..." >&4
9811 set d_tm_tm_zone tm tm_zone $i_systime sys/time.h $i_time time.h
9819 case "$d_tm_tm_zone" in
9820 "$define") echo "Yes, it does." ;;
9821 *) echo "No, it doesn't." ;;
9823 : see if struct tm knows about tm_gmtoff
9824 case "$i_systime$i_time" in
9827 echo "Checking to see if your struct tm has tm_gmtoff field..." >&4
9828 set d_tm_tm_gmtoff tm tm_gmtoff $i_systime sys/time.h $i_time time.h
9836 case "$d_tm_tm_gmtoff" in
9837 "$define") echo "Yes, it does." ;;
9838 *) echo "No, it doesn't." ;;
9841 : see if asctime_r exists
9842 set asctime_r d_asctime_r
9844 case "$d_asctime_r" in
9846 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
9847 case "$d_asctime_r_proto:$usethreads" in
9848 ":define") d_asctime_r_proto=define
9849 set d_asctime_r_proto asctime_r $hdrs
9853 case "$d_asctime_r_proto" in
9855 case "$asctime_r_proto" in
9856 ''|0) try='char* asctime_r(const struct tm*, char*);'
9857 ./protochk "extern $try" $hdrs && asctime_r_proto=B_SB ;;
9859 case "$asctime_r_proto" in
9860 ''|0) try='char* asctime_r(const struct tm*, char*, int);'
9861 ./protochk "extern $try" $hdrs && asctime_r_proto=B_SBI ;;
9863 case "$asctime_r_proto" in
9864 ''|0) try='int asctime_r(const struct tm*, char*);'
9865 ./protochk "extern $try" $hdrs && asctime_r_proto=I_SB ;;
9867 case "$asctime_r_proto" in
9868 ''|0) try='int asctime_r(const struct tm*, char*, int);'
9869 ./protochk "extern $try" $hdrs && asctime_r_proto=I_SBI ;;
9871 case "$asctime_r_proto" in
9872 ''|0) d_asctime_r=undef
9874 echo "Disabling asctime_r, cannot determine prototype." >&4 ;;
9875 * ) case "$asctime_r_proto" in
9876 REENTRANT_PROTO*) ;;
9877 *) asctime_r_proto="REENTRANT_PROTO_$asctime_r_proto" ;;
9879 echo "Prototype: $try" ;;
9882 *) case "$usethreads" in
9883 define) echo "asctime_r has no prototype, not using it." >&4 ;;
9890 *) asctime_r_proto=0
9894 : see if atolf exists
9898 : see if atoll exists
9902 : Look for GCC-style attribute format
9903 case "$d_attribute_format" in
9906 echo "Checking whether your compiler can handle __attribute__((format)) ..." >&4
9907 $cat >attrib.c <<'EOCP'
9909 void my_special_printf(char* pat,...) __attribute__((__format__(__printf__,1,2)));
9911 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
9912 if $contains 'warning' attrib.out >/dev/null 2>&1; then
9913 echo "Your C compiler doesn't support __attribute__((format))."
9916 echo "Your C compiler supports __attribute__((format))."
9920 echo "Your C compiler doesn't seem to understand __attribute__ at all."
9924 *) val="$d_attribute_format" ;;
9926 set d_attribute_format
9930 : Look for GCC-style attribute malloc
9931 case "$d_attribute_malloc" in
9934 echo "Checking whether your compiler can handle __attribute__((malloc)) ..." >&4
9935 $cat >attrib.c <<'EOCP'
9937 char *go_get_some_memory( int how_many_bytes ) __attribute__((malloc));
9939 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
9940 if $contains 'warning' attrib.out >/dev/null 2>&1; then
9941 echo "Your C compiler doesn't support __attribute__((malloc))."
9944 echo "Your C compiler supports __attribute__((malloc))."
9948 echo "Your C compiler doesn't seem to understand __attribute__ at all."
9952 *) val="$d_attribute_malloc" ;;
9954 set d_attribute_malloc
9958 : Look for GCC-style attribute nonnull
9959 case "$d_attribute_nonnull" in
9962 echo "Checking whether your compiler can handle __attribute__((nonnull(1))) ..." >&4
9963 $cat >attrib.c <<'EOCP'
9965 void do_something (char *some_pointer,...) __attribute__((nonnull(1)));
9967 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
9968 if $contains 'warning' attrib.out >/dev/null 2>&1; then
9969 echo "Your C compiler doesn't support __attribute__((nonnull))."
9972 echo "Your C compiler supports __attribute__((nonnull))."
9976 echo "Your C compiler doesn't seem to understand __attribute__ at all."
9980 *) val="$d_attribute_nonnull" ;;
9982 set d_attribute_nonnull
9986 : Look for GCC-style attribute noreturn
9987 case "$d_attribute_noreturn" in
9990 echo "Checking whether your compiler can handle __attribute__((noreturn)) ..." >&4
9991 $cat >attrib.c <<'EOCP'
9993 void fall_over_dead( void ) __attribute__((noreturn));
9995 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
9996 if $contains 'warning' attrib.out >/dev/null 2>&1; then
9997 echo "Your C compiler doesn't support __attribute__((noreturn))."
10000 echo "Your C compiler supports __attribute__((noreturn))."
10004 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10008 *) val="$d_attribute_noreturn" ;;
10010 set d_attribute_noreturn
10014 : Look for GCC-style attribute pure
10015 case "$d_attribute_pure" in
10018 echo "Checking whether your compiler can handle __attribute__((pure)) ..." >&4
10019 $cat >attrib.c <<'EOCP'
10021 int square( int n ) __attribute__((pure));
10023 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10024 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10025 echo "Your C compiler doesn't support __attribute__((pure))."
10028 echo "Your C compiler supports __attribute__((pure))."
10032 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10036 *) val="$d_attribute_pure" ;;
10038 set d_attribute_pure
10042 : Look for GCC-style attribute unused
10043 case "$d_attribute_unused" in
10046 echo "Checking whether your compiler can handle __attribute__((unused)) ..." >&4
10047 $cat >attrib.c <<'EOCP'
10049 int do_something( int dummy __attribute__((unused)), int n );
10051 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10052 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10053 echo "Your C compiler doesn't support __attribute__((unused))."
10056 echo "Your C compiler supports __attribute__((unused))."
10060 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10064 *) val="$d_attribute_unused" ;;
10066 set d_attribute_unused
10070 : Look for GCC-style attribute warn_unused_result
10071 case "$d_attribute_warn_unused_result" in
10074 echo "Checking whether your compiler can handle __attribute__((warn_unused_result)) ..." >&4
10075 $cat >attrib.c <<'EOCP'
10077 int I_will_not_be_ignored(void) __attribute__((warn_unused_result));
10079 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10080 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10081 echo "Your C compiler doesn't support __attribute__((warn_unused_result))."
10084 echo "Your C compiler supports __attribute__((warn_unused_result))."
10088 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10092 *) val="$d_attribute_warn_unused_result" ;;
10094 set d_attribute_warn_unused_result
10098 : see if bcmp exists
10102 : see if bcopy exists
10106 : see if this is a unistd.h system
10107 set unistd.h i_unistd
10110 : see if getpgrp exists
10111 set getpgrp d_getpgrp
10114 case "$d_getpgrp" in
10117 echo "Checking to see which flavor of getpgrp is in use..."
10119 #$i_unistd I_UNISTD
10120 #include <sys/types.h>
10122 # include <unistd.h>
10124 #$i_stdlib I_STDLIB
10126 #include <stdlib.h>
10130 if (getuid() == 0) {
10131 printf("(I see you are running Configure as super-user...)\n");
10134 #ifdef TRY_BSD_PGRP
10135 if (getpgrp(1) == 0)
10144 if $cc -o try -DTRY_BSD_PGRP $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
10145 echo "You have to use getpgrp(pid) instead of getpgrp()." >&4
10147 elif $cc -o try $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
10148 echo "You have to use getpgrp() instead of getpgrp(pid)." >&4
10151 echo "I can't seem to compile and run the test program."
10153 xxx="a USG one, i.e. you use getpgrp()."
10155 # SVR4 systems can appear rather BSD-ish.
10156 case "$i_unistd" in
10158 xxx="a BSD one, i.e. you use getpgrp(pid)."
10162 xxx="probably a USG one, i.e. you use getpgrp()."
10167 echo "Assuming your getpgrp is $xxx" >&4
10176 : see if setpgrp exists
10177 set setpgrp d_setpgrp
10180 case "$d_setpgrp" in
10183 echo "Checking to see which flavor of setpgrp is in use..."
10185 #$i_unistd I_UNISTD
10186 #include <sys/types.h>
10188 # include <unistd.h>
10190 #$i_stdlib I_STDLIB
10192 #include <stdlib.h>
10196 if (getuid() == 0) {
10197 printf("(I see you are running Configure as super-user...)\n");
10200 #ifdef TRY_BSD_PGRP
10201 if (-1 == setpgrp(1, 1))
10204 if (setpgrp() != -1)
10210 if $cc -o try -DTRY_BSD_PGRP $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
10211 echo 'You have to use setpgrp(pid,pgrp) instead of setpgrp().' >&4
10213 elif $cc -o try $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
10214 echo 'You have to use setpgrp() instead of setpgrp(pid,pgrp).' >&4
10217 echo "(I can't seem to compile and run the test program.)"
10219 xxx="a USG one, i.e. you use setpgrp()."
10221 # SVR4 systems can appear rather BSD-ish.
10222 case "$i_unistd" in
10224 xxx="a BSD one, i.e. you use setpgrp(pid,pgrp)."
10228 xxx="probably a USG one, i.e. you use setpgrp()."
10233 echo "Assuming your setpgrp is $xxx" >&4
10241 : see if bzero exists
10245 : see if signal is declared as pointer to function returning int or void
10247 xxx=`./findhdr signal.h`
10248 $test "$xxx" && $cppstdin $cppminus $cppflags < $xxx >$$.tmp 2>/dev/null
10249 if $contains 'int.*\*[ ]*signal' $$.tmp >/dev/null 2>&1 ; then
10250 echo "You have int (*signal())() instead of void." >&4
10252 elif $contains 'void.*\*[ ]*signal' $$.tmp >/dev/null 2>&1 ; then
10253 echo "You have void (*signal())()." >&4
10255 elif $contains 'extern[ ]*[(\*]*signal' $$.tmp >/dev/null 2>&1 ; then
10256 echo "You have int (*signal())() instead of void." >&4
10258 elif $contains 'void.*\*.*sig' $$.tmp >/dev/null 2>&1 ; then
10259 echo "You have void (*signal())()." >&4
10262 case "$d_voidsig" in
10264 echo "I can't determine whether signal handler returns void or int..." >&4
10266 rp="What type does your signal handler return?"
10269 v*) val="$define";;
10273 echo "As you already told me, signal handler returns void." >&4
10276 *) echo "As you already told me, signal handler returns int." >&4
10283 case "$d_voidsig" in
10284 "$define") signal_t="void";;
10285 *) signal_t="int";;
10289 : check for ability to cast large floats to 32-bit ints.
10291 echo 'Checking whether your C compiler can cast large floats to int32.' >&4
10292 if $test "$intsize" -ge 4; then
10299 #$i_stdlib I_STDLIB
10301 #include <stdlib.h>
10303 #include <sys/types.h>
10304 #include <signal.h>
10305 $signal_t blech(s) int s; { exit(3); }
10312 signal(SIGFPE, blech);
10314 /* Don't let compiler optimize the test away. Store the number
10315 in a writable string for gcc to pass to sscanf under HP/UX.
10317 sprintf(str, "2147483647");
10318 sscanf(str, "%lf", &f); /* f = (double) 0x7fffffff; */
10322 /* x86 processors will probably give 0x8000 0000, which is a
10323 sign change. We don't want that. We want to mimic SPARC
10324 behavior here, which is to preserve the sign and give
10327 if (i32 != ($xxx) f)
10333 if eval $compile_ok; then
10337 echo "(I can't seem to compile the test program--assuming it can't)"
10342 echo "Yup, it can."
10345 echo "Nope, it can't."
10352 : check for ability to cast negative floats to unsigned
10354 echo 'Checking whether your C compiler can cast negative float to unsigned.' >&4
10357 #$i_stdlib I_STDLIB
10359 #include <stdlib.h>
10361 #include <sys/types.h>
10362 #include <signal.h>
10363 $signal_t blech(s) int s; { exit(7); }
10364 $signal_t blech_in_list(s) int s; { exit(4); }
10365 unsigned long dummy_long(p) unsigned long p; { return p; }
10366 unsigned int dummy_int(p) unsigned int p; { return p; }
10367 unsigned short dummy_short(p) unsigned short p; { return p; }
10371 unsigned long along;
10373 unsigned short ashort;
10377 /* Frustrate gcc-2.7.2's optimizer which failed this test with
10378 a direct f = -123. assignment. gcc-2.8.0 reportedly
10379 optimized the whole file away
10381 /* Store the number in a writable string for gcc to pass to
10382 sscanf under HP/UX.
10384 sprintf(str, "-123");
10385 sscanf(str, "%lf", &f); /* f = -123.; */
10387 signal(SIGFPE, blech);
10388 along = (unsigned long)f;
10389 aint = (unsigned int)f;
10390 ashort = (unsigned short)f;
10391 if (along != (unsigned long)-123)
10393 if (aint != (unsigned int)-123)
10395 if (ashort != (unsigned short)-123)
10397 sprintf(str, "1073741824.");
10398 sscanf(str, "%lf", &f); /* f = (double)0x40000000; */
10401 along = (unsigned long)f;
10402 if (along != 0x80000000)
10406 along = (unsigned long)f;
10407 if (along != 0x7fffffff)
10411 along = (unsigned long)f;
10412 if (along != 0x80000001)
10416 signal(SIGFPE, blech_in_list);
10417 sprintf(str, "123.");
10418 sscanf(str, "%lf", &f); /* f = 123.; */
10419 along = dummy_long((unsigned long)f);
10420 aint = dummy_int((unsigned int)f);
10421 ashort = dummy_short((unsigned short)f);
10422 if (along != (unsigned long)123)
10424 if (aint != (unsigned int)123)
10426 if (ashort != (unsigned short)123)
10433 if eval $compile_ok; then
10437 echo "(I can't seem to compile the test program--assuming it can't)"
10440 case "$castflags" in
10442 echo "Yup, it can."
10445 echo "Nope, it can't."
10452 : see if vprintf exists
10454 if set vprintf val -f d_vprintf; eval $csym; $val; then
10455 echo 'vprintf() found.' >&4
10458 #include <varargs.h>
10459 #$i_stdlib I_STDLIB
10461 #include <stdlib.h>
10464 int main() { xxx("foo"); }
10473 exit((unsigned long)vsprintf(buf,"%s",args) > 10L);
10477 if eval $compile && $run ./try; then
10478 echo "Your vsprintf() returns (int)." >&4
10481 echo "Your vsprintf() returns (char*)." >&4
10485 echo 'vprintf() NOT found.' >&4
10496 : see if chown exists
10500 : see if chroot exists
10501 set chroot d_chroot
10504 : see if chsize exists
10505 set chsize d_chsize
10508 : see if class exists
10512 : see if clearenv exists
10513 set clearenv d_clearenv
10516 hasstruct='varname=$1; struct=$2; shift; shift;
10517 while $test $# -ge 2; do
10519 $define) echo "#include <$2>";;
10523 echo "int main () { struct $struct foo; }" >> try.c;
10525 if eval $compile; then
10532 $rm -f try.c try.o'
10536 : see whether socket exists
10538 $echo $n "Hmm... $c" >&4
10539 if set socket val -f d_socket; eval $csym; $val; then
10540 echo "Looks like you have Berkeley networking support." >&4
10542 if set setsockopt val -f; eval $csym; $val; then
10545 echo "...but it uses the old BSD 4.1c interface, rather than 4.2." >&4
10546 d_oldsock="$define"
10549 if $contains socklib libc.list >/dev/null 2>&1; then
10550 echo "Looks like you have Berkeley networking support." >&4
10552 : we will have to assume that it supports the 4.2 BSD interface
10555 echo "You don't have Berkeley networking in libc$_a..." >&4
10556 if test "X$d_socket" = "X$define"; then
10557 echo "...but you seem to believe that you have sockets." >&4
10559 for net in net socket
10561 if test -f /usr/lib/lib$net$_a; then
10562 ( ($nm $nm_opt /usr/lib/lib$net$_a | eval $nm_extract) || \
10563 $ar t /usr/lib/lib$net$_a) 2>/dev/null >> libc.list
10564 if $contains socket libc.list >/dev/null 2>&1; then
10569 echo "...but the Wollongong group seems to have hacked it in." >&4
10570 sockethdr="-I/usr/netinclude"
10573 echo "Found Berkeley sockets interface in lib$net." >&4
10574 if $contains setsockopt libc.list >/dev/null 2>&1; then
10577 echo "...using the old BSD 4.1c interface, rather than 4.2." >&4
10578 d_oldsock="$define"
10584 if test "X$d_socket" != "X$define"; then
10585 echo "or anywhere else I see." >&4
10593 : see if socketpair exists
10594 set socketpair d_sockpair
10599 echo "Checking the availability of certain socket constants..." >&4
10600 for ENUM in MSG_CTRUNC MSG_DONTROUTE MSG_OOB MSG_PEEK MSG_PROXY SCM_RIGHTS; do
10601 enum=`$echo $ENUM|./tr '[A-Z]' '[a-z]'`
10603 #include <sys/types.h>
10604 #include <sys/socket.h>
10610 set try; if eval $compile; then
10613 set d_${enum}; eval $setvar
10617 : see if this is a sys/uio.h system
10618 set sys/uio.h i_sysuio
10623 echo "Checking to see if your system supports struct cmsghdr..." >&4
10624 set d_cmsghdr_s cmsghdr $i_systypes sys/types.h $d_socket sys/socket.h $i_sysuio sys/uio.h
10626 case "$d_cmsghdr_s" in
10627 "$define") echo "Yes, it does." ;;
10628 *) echo "No, it doesn't." ;;
10632 : check for const keyword
10634 echo 'Checking to see if your C compiler knows about "const"...' >&4
10635 $cat >const.c <<'EOCP'
10636 typedef struct spug { int drokk; } spug;
10643 if $cc -c $ccflags const.c >/dev/null 2>&1 ; then
10645 echo "Yup, it does."
10648 echo "Nope, it doesn't."
10653 : see if copysignl exists
10654 set copysignl d_copysignl
10657 : see if crypt exists
10662 $define) cryptlib='' ;;
10663 *) if set crypt val -f d_crypt; eval $csym; $val; then
10664 echo 'crypt() found.' >&4
10668 cryptlib=`./loc Slibcrypt$_a "" $xlibpth`
10669 if $test -z "$cryptlib"; then
10670 cryptlib=`./loc Mlibcrypt$_a "" $xlibpth`
10674 if $test -z "$cryptlib"; then
10675 cryptlib=`./loc Llibcrypt$_a "" $xlibpth`
10679 if $test -z "$cryptlib"; then
10680 cryptlib=`./loc libcrypt$_a "" $libpth`
10684 if $test -z "$cryptlib"; then
10685 echo 'crypt() NOT found.' >&4
10696 : see if this is a crypt.h system
10697 set crypt.h i_crypt
10700 : see if crypt_r exists
10701 set crypt_r d_crypt_r
10703 case "$d_crypt_r" in
10705 hdrs="$i_systypes sys/types.h define stdio.h $i_crypt crypt.h"
10706 case "$d_crypt_r_proto:$usethreads" in
10707 ":define") d_crypt_r_proto=define
10708 set d_crypt_r_proto crypt_r $hdrs
10712 case "$d_crypt_r_proto" in
10714 case "$crypt_r_proto" in
10715 ''|0) try='char* crypt_r(const char*, const char*, struct crypt_data*);'
10716 ./protochk "extern $try" $hdrs && crypt_r_proto=B_CCS ;;
10718 case "$crypt_r_proto" in
10719 ''|0) try='char* crypt_r(const char*, const char*, CRYPTD*);'
10720 ./protochk "extern $try" $hdrs && crypt_r_proto=B_CCD ;;
10722 case "$crypt_r_proto" in
10723 ''|0) d_crypt_r=undef
10725 echo "Disabling crypt_r, cannot determine prototype." >&4 ;;
10726 * ) case "$crypt_r_proto" in
10727 REENTRANT_PROTO*) ;;
10728 *) crypt_r_proto="REENTRANT_PROTO_$crypt_r_proto" ;;
10730 echo "Prototype: $try" ;;
10733 *) case "$usethreads" in
10734 define) echo "crypt_r has no prototype, not using it." >&4 ;;
10745 : get csh whereabouts
10747 'csh') val="$undef" ;;
10748 *) val="$define" ;;
10752 : Respect a hint or command line value for full_csh.
10753 case "$full_csh" in
10754 '') full_csh=$csh ;;
10757 : see if ctermid_r exists
10758 set ctermid_r d_ctermid_r
10760 case "$d_ctermid_r" in
10762 hdrs="$i_systypes sys/types.h define stdio.h "
10763 case "$d_ctermid_r_proto:$usethreads" in
10764 ":define") d_ctermid_r_proto=define
10765 set d_ctermid_r_proto ctermid_r $hdrs
10769 case "$d_ctermid_r_proto" in
10771 case "$ctermid_r_proto" in
10772 ''|0) try='char* ctermid_r(char*);'
10773 ./protochk "extern $try" $hdrs && ctermid_r_proto=B_B ;;
10775 case "$ctermid_r_proto" in
10776 ''|0) d_ctermid_r=undef
10778 echo "Disabling ctermid_r, cannot determine prototype." >&4 ;;
10779 * ) case "$ctermid_r_proto" in
10780 REENTRANT_PROTO*) ;;
10781 *) ctermid_r_proto="REENTRANT_PROTO_$ctermid_r_proto" ;;
10783 echo "Prototype: $try" ;;
10786 *) case "$usethreads" in
10787 define) echo "ctermid_r has no prototype, not using it." >&4 ;;
10794 *) ctermid_r_proto=0
10798 : see if ctime_r exists
10799 set ctime_r d_ctime_r
10801 case "$d_ctime_r" in
10803 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
10804 case "$d_ctime_r_proto:$usethreads" in
10805 ":define") d_ctime_r_proto=define
10806 set d_ctime_r_proto ctime_r $hdrs
10810 case "$d_ctime_r_proto" in
10812 case "$ctime_r_proto" in
10813 ''|0) try='char* ctime_r(const time_t*, char*);'
10814 ./protochk "extern $try" $hdrs && ctime_r_proto=B_SB ;;
10816 case "$ctime_r_proto" in
10817 ''|0) try='char* ctime_r(const time_t*, char*, int);'
10818 ./protochk "extern $try" $hdrs && ctime_r_proto=B_SBI ;;
10820 case "$ctime_r_proto" in
10821 ''|0) try='int ctime_r(const time_t*, char*);'
10822 ./protochk "extern $try" $hdrs && ctime_r_proto=I_SB ;;
10824 case "$ctime_r_proto" in
10825 ''|0) try='int ctime_r(const time_t*, char*, int);'
10826 ./protochk "extern $try" $hdrs && ctime_r_proto=I_SBI ;;
10828 case "$ctime_r_proto" in
10829 ''|0) d_ctime_r=undef
10831 echo "Disabling ctime_r, cannot determine prototype." >&4 ;;
10832 * ) case "$ctime_r_proto" in
10833 REENTRANT_PROTO*) ;;
10834 *) ctime_r_proto="REENTRANT_PROTO_$ctime_r_proto" ;;
10836 echo "Prototype: $try" ;;
10839 *) case "$usethreads" in
10840 define) echo "ctime_r has no prototype, not using it." >&4 ;;
10851 : see if cuserid exists
10852 set cuserid d_cuserid
10855 : see if this is a limits.h system
10856 set limits.h i_limits
10859 : see if this is a float.h system
10860 set float.h i_float
10863 : See if number of significant digits in a double precision number is known
10865 $cat >dbl_dig.c <<EOM
10866 #$i_limits I_LIMITS
10869 #include <limits.h>
10875 printf("Contains DBL_DIG");
10878 $cppstdin $cppflags $cppminus < dbl_dig.c >dbl_dig.E 2>/dev/null
10879 if $contains 'DBL_DIG' dbl_dig.E >/dev/null 2>&1; then
10880 echo "DBL_DIG found." >&4
10883 echo "DBL_DIG NOT found." >&4
10890 : see if dbm.h is available
10891 : see if dbmclose exists
10892 set dbmclose d_dbmclose
10895 case "$d_dbmclose" in
10905 *) set rpcsvc/dbm.h i_rpcsvcdbm
10910 *) echo "We won't be including <dbm.h>"
10920 : see if prototype for dbminit is available
10922 set d_dbminitproto dbminit $i_dbm dbm.h
10925 : see if difftime exists
10926 set difftime d_difftime
10929 : see if this is a dirent system
10931 if xinc=`./findhdr dirent.h`; $test "$xinc"; then
10933 echo "<dirent.h> found." >&4
10936 if xinc=`./findhdr sys/dir.h`; $test "$xinc"; then
10937 echo "<sys/dir.h> found." >&4
10940 xinc=`./findhdr sys/ndir.h`
10942 echo "<dirent.h> NOT found." >&4
10947 : Look for type of directory structure.
10949 $cppstdin $cppflags $cppminus < "$xinc" > try.c
10951 case "$direntrytype" in
10953 case "$i_dirent" in
10954 $define) guess1='struct dirent' ;;
10955 *) guess1='struct direct' ;;
10958 *) guess1="$direntrytype"
10963 'struct dirent') guess2='struct direct' ;;
10964 *) guess2='struct dirent' ;;
10967 if $contains "$guess1" try.c >/dev/null 2>&1; then
10968 direntrytype="$guess1"
10969 echo "Your directory entries are $direntrytype." >&4
10970 elif $contains "$guess2" try.c >/dev/null 2>&1; then
10971 direntrytype="$guess2"
10972 echo "Your directory entries seem to be $direntrytype." >&4
10974 echo "I don't recognize your system's directory entries." >&4
10975 rp="What type is used for directory entries on this system?"
10978 direntrytype="$ans"
10983 : see if the directory entry stores field length
10985 $cppstdin $cppflags $cppminus < "$xinc" > try.c
10986 if $contains 'd_namlen' try.c >/dev/null 2>&1; then
10987 echo "Good, your directory entry keeps length information in d_namlen." >&4
10990 echo "Your directory entry does not know about the d_namlen field." >&4
10997 : see if this is an sysdir system
10998 set sys/dir.h i_sysdir
11001 : see if this is an sysndir system
11002 set sys/ndir.h i_sysndir
11007 $cat >dirfd.c <<EOM
11009 #$i_stdlib I_STDLIB
11011 #include <stdlib.h>
11013 #$i_dirent I_DIRENT /**/
11014 #$i_sysdir I_SYS_DIR /**/
11015 #$i_sysndir I_SYS_NDIR /**/
11016 #$i_systypes I_SYS_TYPES /**/
11017 #if defined(I_SYS_TYPES)
11018 #include <sys/types.h>
11020 #if defined(I_DIRENT)
11021 #include <dirent.h>
11022 #if defined(NeXT) && defined(I_SYS_DIR) /* NeXT needs dirent + sys/dir.h */
11023 #include <sys/dir.h>
11027 #include <sys/ndir.h>
11031 #include <ndir.h> /* may be wrong in the future */
11033 #include <sys/dir.h>
11039 DIR *dirp = opendir(".");
11040 if (dirfd(dirp) >= 0)
11048 if eval $compile; then
11052 $define) echo "dirfd() found." >&4 ;;
11053 *) echo "dirfd() NOT found." >&4 ;;
11059 : see if dlerror exists
11062 set dlerror d_dlerror
11066 : see if dlfcn is available
11067 set dlfcn.h i_dlfcn
11074 On a few systems, the dynamically loaded modules that perl generates and uses
11075 will need a different extension than shared libs. The default will probably
11081 *) dflt="$dlext" ;;
11083 rp='What is the extension of dynamically loaded modules'
11092 : Check if dlsym need a leading underscore
11098 echo "Checking whether your dlsym() needs a leading underscore ..." >&4
11099 $cat >dyna.c <<'EOM'
11106 #$i_stdlib I_STDLIB
11108 #include <stdlib.h>
11112 #include <dlfcn.h> /* the dynamic linker include file for SunOS/Solaris */
11114 #include <sys/types.h>
11119 extern int fred() ;
11128 int mode = RTLD_LAZY ;
11130 handle = dlopen("./dyna.$dlext", mode) ;
11131 if (handle == NULL) {
11136 symbol = dlsym(handle, "fred") ;
11137 if (symbol == NULL) {
11138 /* try putting a leading underscore */
11139 symbol = dlsym(handle, "_fred") ;
11140 if (symbol == NULL) {
11153 : Call the object file tmp-dyna.o in case dlext=o.
11154 if $cc $ccflags $cccdlflags -c dyna.c > /dev/null 2>&1 &&
11155 mv dyna${_o} tmp-dyna${_o} > /dev/null 2>&1 &&
11156 $ld -o dyna.$dlext $ldflags $lddlflags tmp-dyna${_o} > /dev/null 2>&1 &&
11157 $cc -o fred $ccflags $ldflags $cccdlflags $ccdlflags fred.c $libs > /dev/null 2>&1 && $to dyna.$dlext; then
11160 1) echo "Test program failed using dlopen." >&4
11161 echo "Perhaps you should not use dynamic loading." >&4;;
11162 2) echo "Test program failed using dlsym." >&4
11163 echo "Perhaps you should not use dynamic loading." >&4;;
11164 3) echo "dlsym needs a leading underscore" >&4
11166 4) echo "dlsym doesn't need a leading underscore." >&4;;
11169 echo "I can't compile and run the test program." >&4
11170 echo "I'm guessing that dlsym doesn't need a leading underscore." >&4
11175 $rm -f fred fred.* dyna.$dlext dyna.* tmp-dyna.*
11180 : see if drand48_r exists
11181 set drand48_r d_drand48_r
11183 case "$d_drand48_r" in
11185 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
11186 case "$d_drand48_r_proto:$usethreads" in
11187 ":define") d_drand48_r_proto=define
11188 set d_drand48_r_proto drand48_r $hdrs
11192 case "$d_drand48_r_proto" in
11194 case "$drand48_r_proto" in
11195 ''|0) try='int drand48_r(struct drand48_data*, double*);'
11196 ./protochk "extern $try" $hdrs && drand48_r_proto=I_ST ;;
11198 case "$drand48_r_proto" in
11199 ''|0) d_drand48_r=undef
11201 echo "Disabling drand48_r, cannot determine prototype." >&4 ;;
11202 * ) case "$drand48_r_proto" in
11203 REENTRANT_PROTO*) ;;
11204 *) drand48_r_proto="REENTRANT_PROTO_$drand48_r_proto" ;;
11206 echo "Prototype: $try" ;;
11209 *) case "$usethreads" in
11210 define) echo "drand48_r has no prototype, not using it." >&4 ;;
11217 *) drand48_r_proto=0
11221 : see if prototype for drand48 is available
11223 set d_drand48proto drand48 $i_stdlib stdlib.h $i_unistd unistd.h
11226 : see if dup2 exists
11230 : see if eaccess exists
11231 set eaccess d_eaccess
11234 : see if endgrent exists
11235 set endgrent d_endgrent
11238 : see if this is an grp system
11244 xxx=`./findhdr grp.h`
11245 $cppstdin $cppflags $cppminus < $xxx >$$.h
11247 if $contains 'gr_passwd' $$.h >/dev/null 2>&1; then
11259 set d_grpasswd; eval $setvar
11263 : see if endgrent_r exists
11264 set endgrent_r d_endgrent_r
11266 case "$d_endgrent_r" in
11268 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
11269 case "$d_endgrent_r_proto:$usethreads" in
11270 ":define") d_endgrent_r_proto=define
11271 set d_endgrent_r_proto endgrent_r $hdrs
11275 case "$d_endgrent_r_proto" in
11277 case "$endgrent_r_proto" in
11278 ''|0) try='int endgrent_r(FILE**);'
11279 ./protochk "extern $try" $hdrs && endgrent_r_proto=I_H ;;
11281 case "$endgrent_r_proto" in
11282 ''|0) try='void endgrent_r(FILE**);'
11283 ./protochk "extern $try" $hdrs && endgrent_r_proto=V_H ;;
11285 case "$endgrent_r_proto" in
11286 ''|0) d_endgrent_r=undef
11288 echo "Disabling endgrent_r, cannot determine prototype." >&4 ;;
11289 * ) case "$endgrent_r_proto" in
11290 REENTRANT_PROTO*) ;;
11291 *) endgrent_r_proto="REENTRANT_PROTO_$endgrent_r_proto" ;;
11293 echo "Prototype: $try" ;;
11296 *) case "$usethreads" in
11297 define) echo "endgrent_r has no prototype, not using it." >&4 ;;
11304 *) endgrent_r_proto=0
11308 : see if endhostent exists
11309 set endhostent d_endhent
11312 : see if this is a netdb.h system
11313 set netdb.h i_netdb
11316 : see if endhostent_r exists
11317 set endhostent_r d_endhostent_r
11319 case "$d_endhostent_r" in
11321 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
11322 case "$d_endhostent_r_proto:$usethreads" in
11323 ":define") d_endhostent_r_proto=define
11324 set d_endhostent_r_proto endhostent_r $hdrs
11328 case "$d_endhostent_r_proto" in
11330 case "$endhostent_r_proto" in
11331 ''|0) try='int endhostent_r(struct hostent_data*);'
11332 ./protochk "extern $try" $hdrs && endhostent_r_proto=I_D ;;
11334 case "$endhostent_r_proto" in
11335 ''|0) try='void endhostent_r(struct hostent_data*);'
11336 ./protochk "extern $try" $hdrs && endhostent_r_proto=V_D ;;
11338 case "$endhostent_r_proto" in
11339 ''|0) d_endhostent_r=undef
11340 endhostent_r_proto=0
11341 echo "Disabling endhostent_r, cannot determine prototype." >&4 ;;
11342 * ) case "$endhostent_r_proto" in
11343 REENTRANT_PROTO*) ;;
11344 *) endhostent_r_proto="REENTRANT_PROTO_$endhostent_r_proto" ;;
11346 echo "Prototype: $try" ;;
11349 *) case "$usethreads" in
11350 define) echo "endhostent_r has no prototype, not using it." >&4 ;;
11352 d_endhostent_r=undef
11353 endhostent_r_proto=0
11357 *) endhostent_r_proto=0
11361 : see if endnetent exists
11362 set endnetent d_endnent
11365 : see if endnetent_r exists
11366 set endnetent_r d_endnetent_r
11368 case "$d_endnetent_r" in
11370 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
11371 case "$d_endnetent_r_proto:$usethreads" in
11372 ":define") d_endnetent_r_proto=define
11373 set d_endnetent_r_proto endnetent_r $hdrs
11377 case "$d_endnetent_r_proto" in
11379 case "$endnetent_r_proto" in
11380 ''|0) try='int endnetent_r(struct netent_data*);'
11381 ./protochk "extern $try" $hdrs && endnetent_r_proto=I_D ;;
11383 case "$endnetent_r_proto" in
11384 ''|0) try='void endnetent_r(struct netent_data*);'
11385 ./protochk "extern $try" $hdrs && endnetent_r_proto=V_D ;;
11387 case "$endnetent_r_proto" in
11388 ''|0) d_endnetent_r=undef
11389 endnetent_r_proto=0
11390 echo "Disabling endnetent_r, cannot determine prototype." >&4 ;;
11391 * ) case "$endnetent_r_proto" in
11392 REENTRANT_PROTO*) ;;
11393 *) endnetent_r_proto="REENTRANT_PROTO_$endnetent_r_proto" ;;
11395 echo "Prototype: $try" ;;
11398 *) case "$usethreads" in
11399 define) echo "endnetent_r has no prototype, not using it." >&4 ;;
11401 d_endnetent_r=undef
11402 endnetent_r_proto=0
11406 *) endnetent_r_proto=0
11410 : see if endprotoent exists
11411 set endprotoent d_endpent
11414 : see if endprotoent_r exists
11415 set endprotoent_r d_endprotoent_r
11417 case "$d_endprotoent_r" in
11419 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
11420 case "$d_endprotoent_r_proto:$usethreads" in
11421 ":define") d_endprotoent_r_proto=define
11422 set d_endprotoent_r_proto endprotoent_r $hdrs
11426 case "$d_endprotoent_r_proto" in
11428 case "$endprotoent_r_proto" in
11429 ''|0) try='int endprotoent_r(struct protoent_data*);'
11430 ./protochk "extern $try" $hdrs && endprotoent_r_proto=I_D ;;
11432 case "$endprotoent_r_proto" in
11433 ''|0) try='void endprotoent_r(struct protoent_data*);'
11434 ./protochk "extern $try" $hdrs && endprotoent_r_proto=V_D ;;
11436 case "$endprotoent_r_proto" in
11437 ''|0) d_endprotoent_r=undef
11438 endprotoent_r_proto=0
11439 echo "Disabling endprotoent_r, cannot determine prototype." >&4 ;;
11440 * ) case "$endprotoent_r_proto" in
11441 REENTRANT_PROTO*) ;;
11442 *) endprotoent_r_proto="REENTRANT_PROTO_$endprotoent_r_proto" ;;
11444 echo "Prototype: $try" ;;
11447 *) case "$usethreads" in
11448 define) echo "endprotoent_r has no prototype, not using it." >&4 ;;
11450 d_endprotoent_r=undef
11451 endprotoent_r_proto=0
11455 *) endprotoent_r_proto=0
11459 : see if endpwent exists
11460 set endpwent d_endpwent
11463 : see if this is a pwd.h system
11469 xxx=`./findhdr pwd.h`
11470 $cppstdin $cppflags $cppminus < $xxx >$$.h
11472 if $contains 'pw_quota' $$.h >/dev/null 2>&1; then
11480 if $contains 'pw_age' $$.h >/dev/null 2>&1; then
11488 if $contains 'pw_change' $$.h >/dev/null 2>&1; then
11496 if $contains 'pw_class' $$.h >/dev/null 2>&1; then
11504 if $contains 'pw_expire' $$.h >/dev/null 2>&1; then
11512 if $contains 'pw_comment' $$.h >/dev/null 2>&1; then
11520 if $contains 'pw_gecos' $$.h >/dev/null 2>&1; then
11528 if $contains 'pw_passwd' $$.h >/dev/null 2>&1; then
11540 set d_pwquota; eval $setvar
11541 set d_pwage; eval $setvar
11542 set d_pwchange; eval $setvar
11543 set d_pwclass; eval $setvar
11544 set d_pwexpire; eval $setvar
11545 set d_pwcomment; eval $setvar
11546 set d_pwgecos; eval $setvar
11547 set d_pwpasswd; eval $setvar
11551 : see if endpwent_r exists
11552 set endpwent_r d_endpwent_r
11554 case "$d_endpwent_r" in
11556 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
11557 case "$d_endpwent_r_proto:$usethreads" in
11558 ":define") d_endpwent_r_proto=define
11559 set d_endpwent_r_proto endpwent_r $hdrs
11563 case "$d_endpwent_r_proto" in
11565 case "$endpwent_r_proto" in
11566 ''|0) try='int endpwent_r(FILE**);'
11567 ./protochk "extern $try" $hdrs && endpwent_r_proto=I_H ;;
11569 case "$endpwent_r_proto" in
11570 ''|0) try='void endpwent_r(FILE**);'
11571 ./protochk "extern $try" $hdrs && endpwent_r_proto=V_H ;;
11573 case "$endpwent_r_proto" in
11574 ''|0) d_endpwent_r=undef
11576 echo "Disabling endpwent_r, cannot determine prototype." >&4 ;;
11577 * ) case "$endpwent_r_proto" in
11578 REENTRANT_PROTO*) ;;
11579 *) endpwent_r_proto="REENTRANT_PROTO_$endpwent_r_proto" ;;
11581 echo "Prototype: $try" ;;
11584 *) case "$usethreads" in
11585 define) echo "endpwent_r has no prototype, not using it." >&4 ;;
11592 *) endpwent_r_proto=0
11596 : see if endservent exists
11597 set endservent d_endsent
11600 : see if endservent_r exists
11601 set endservent_r d_endservent_r
11603 case "$d_endservent_r" in
11605 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
11606 case "$d_endservent_r_proto:$usethreads" in
11607 ":define") d_endservent_r_proto=define
11608 set d_endservent_r_proto endservent_r $hdrs
11612 case "$d_endservent_r_proto" in
11614 case "$endservent_r_proto" in
11615 ''|0) try='int endservent_r(struct servent_data*);'
11616 ./protochk "extern $try" $hdrs && endservent_r_proto=I_D ;;
11618 case "$endservent_r_proto" in
11619 ''|0) try='void endservent_r(struct servent_data*);'
11620 ./protochk "extern $try" $hdrs && endservent_r_proto=V_D ;;
11622 case "$endservent_r_proto" in
11623 ''|0) d_endservent_r=undef
11624 endservent_r_proto=0
11625 echo "Disabling endservent_r, cannot determine prototype." >&4 ;;
11626 * ) case "$endservent_r_proto" in
11627 REENTRANT_PROTO*) ;;
11628 *) endservent_r_proto="REENTRANT_PROTO_$endservent_r_proto" ;;
11630 echo "Prototype: $try" ;;
11633 *) case "$usethreads" in
11634 define) echo "endservent_r has no prototype, not using it." >&4 ;;
11636 d_endservent_r=undef
11637 endservent_r_proto=0
11641 *) endservent_r_proto=0
11645 : Locate the flags for 'open()'
11648 #include <sys/types.h>
11653 #include <sys/file.h>
11655 #$i_stdlib I_STDLIB
11657 #include <stdlib.h>
11668 : check sys/file.h first to get FREAD on Sun
11669 if $test `./findhdr sys/file.h` && \
11670 set try -DI_SYS_FILE && eval $compile; then
11672 echo "<sys/file.h> defines the O_* constants..." >&4
11673 if $run ./try; then
11674 echo "and you have the 3 argument form of open()." >&4
11677 echo "but not the 3 argument form of open(). Oh, well." >&4
11680 elif $test `./findhdr fcntl.h` && \
11681 set try -DI_FCNTL && eval $compile; then
11683 echo "<fcntl.h> defines the O_* constants..." >&4
11684 if $run ./try; then
11685 echo "and you have the 3 argument form of open()." >&4
11688 echo "but not the 3 argument form of open(). Oh, well." >&4
11693 echo "I can't find the O_* constant definitions! You got problems." >&4
11699 : see which of string.h or strings.h is needed
11701 strings=`./findhdr string.h`
11702 if $test "$strings" && $test -r "$strings"; then
11703 echo "Using <string.h> instead of <strings.h>." >&4
11707 strings=`./findhdr strings.h`
11708 if $test "$strings" && $test -r "$strings"; then
11709 echo "Using <strings.h> instead of <string.h>." >&4
11711 echo "No string header found -- You'll surely have problems." >&4
11716 case "$i_string" in
11717 "$undef") strings=`./findhdr strings.h`;;
11718 *) strings=`./findhdr string.h`;;
11721 : see if this is a sys/file.h system
11726 : do we need to include sys/file.h ?
11730 if $h_sysfile; then
11732 echo "We'll be including <sys/file.h>." >&4
11735 echo "We won't be including <sys/file.h>." >&4
11745 : see if fcntl.h is there
11750 : see if we can include fcntl.h
11756 echo "We'll be including <fcntl.h>." >&4
11759 if $h_sysfile; then
11760 echo "We don't need to include <fcntl.h> if we include <sys/file.h>." >&4
11762 echo "We won't be including <fcntl.h>." >&4
11774 : check for non-blocking I/O stuff
11775 case "$h_sysfile" in
11776 true) echo "#include <sys/file.h>" > head.c;;
11779 true) echo "#include <fcntl.h>" > head.c;;
11780 *) echo "#include <sys/fcntl.h>" > head.c;;
11785 echo "Figuring out the flag used by open() for non-blocking I/O..." >&4
11786 case "$o_nonblock" in
11788 $cat head.c > try.c
11789 $cat >>try.c <<EOCP
11791 #$i_stdlib I_STDLIB
11793 #include <stdlib.h>
11801 printf("O_NONBLOCK\n");
11805 printf("O_NDELAY\n");
11809 printf("FNDELAY\n");
11816 if eval $compile_ok; then
11817 o_nonblock=`$run ./try`
11818 case "$o_nonblock" in
11819 '') echo "I can't figure it out, assuming O_NONBLOCK will do.";;
11820 *) echo "Seems like we can use $o_nonblock.";;
11823 echo "(I can't compile the test program; pray O_NONBLOCK is right!)"
11826 *) echo "Using $hint value $o_nonblock.";;
11828 $rm -f try try.* .out core
11831 echo "Let's see what value errno gets from read() on a $o_nonblock file..." >&4
11834 $cat head.c > try.c
11835 $cat >>try.c <<EOCP
11837 #include <sys/types.h>
11838 #include <signal.h>
11840 #$i_stdlib I_STDLIB
11842 #include <stdlib.h>
11848 #define MY_O_NONBLOCK $o_nonblock
11849 #ifndef errno /* XXX need better Configure test */
11852 #$i_unistd I_UNISTD
11854 #include <unistd.h>
11856 #$i_string I_STRING
11858 #include <string.h>
11860 #include <strings.h>
11862 $signal_t blech(x) int x; { exit(3); }
11864 $cat >> try.c <<'EOCP'
11872 pipe(pd); /* Down: child -> parent */
11873 pipe(pu); /* Up: parent -> child */
11876 close(pd[1]); /* Parent reads from pd[0] */
11877 close(pu[0]); /* Parent writes (blocking) to pu[1] */
11879 if (-1 == fcntl(pd[0], F_SETFL, MY_O_NONBLOCK))
11884 signal(SIGALRM, blech);
11886 if ((ret = read(pd[0], buf, 1)) > 0) /* Nothing to read! */
11888 sprintf(string, "%d\n", ret);
11889 write(2, string, strlen(string));
11892 if (errno == EAGAIN) {
11893 printf("EAGAIN\n");
11898 if (errno == EWOULDBLOCK)
11899 printf("EWOULDBLOCK\n");
11902 write(pu[1], buf, 1); /* Unblocks child, tell it to close our pipe */
11903 sleep(2); /* Give it time to close our pipe */
11905 ret = read(pd[0], buf, 1); /* Should read EOF */
11907 sprintf(string, "%d\n", ret);
11908 write(4, string, strlen(string));
11912 close(pd[0]); /* We write to pd[1] */
11913 close(pu[1]); /* We read from pu[0] */
11914 read(pu[0], buf, 1); /* Wait for parent to signal us we may continue */
11915 close(pd[1]); /* Pipe pd is now fully closed! */
11916 exit(0); /* Bye bye, thank you for playing! */
11920 if eval $compile_ok; then
11921 echo "$startsh" >mtry
11922 echo "$run ./try >try.out 2>try.ret 4>try.err || exit 4" >>mtry
11924 ./mtry >/dev/null 2>&1
11926 0) eagain=`$cat try.out`;;
11927 1) echo "Could not perform non-blocking setting!";;
11928 2) echo "I did a successful read() for something that was not there!";;
11929 3) echo "Hmm... non-blocking I/O does not seem to be working!";;
11930 4) echo "Could not find F_SETFL!";;
11931 *) echo "Something terribly wrong happened during testing.";;
11933 rd_nodata=`$cat try.ret`
11934 echo "A read() system call with no data present returns $rd_nodata."
11935 case "$rd_nodata" in
11938 echo "(That's peculiar, fixing that to be -1.)"
11944 echo "Forcing errno EAGAIN on read() with no data available."
11948 echo "Your read() sets errno to $eagain when no data is available."
11951 status=`$cat try.err`
11953 0) echo "And it correctly returns 0 to signal EOF.";;
11954 -1) echo "But it also returns -1 to signal EOF, so be careful!";;
11955 *) echo "However, your read() returns '$status' on EOF??";;
11958 if test "$status" = "$rd_nodata"; then
11959 echo "WARNING: you can't distinguish between EOF and no data!"
11963 echo "I can't compile the test program--assuming errno EAGAIN will do."
11970 echo "Using $hint value $eagain."
11971 echo "Your read() returns $rd_nodata when no data is present."
11972 case "$d_eofnblk" in
11973 "$define") echo "And you can see EOF because read() returns 0.";;
11974 "$undef") echo "But you can't see EOF status from read() returned value.";;
11976 echo "(Assuming you can't see EOF status from read anyway.)"
11982 $rm -f try try.* .out core head.c mtry
11984 : see if _ptr and _cnt from stdio act std
11987 if $contains '_lbfsize' `./findhdr stdio.h` >/dev/null 2>&1 ; then
11988 echo "(Looks like you have stdio.h from BSD.)"
11989 case "$stdio_ptr" in
11990 '') stdio_ptr='((fp)->_p)'
11993 *) ptr_lval=$d_stdio_ptr_lval;;
11995 case "$stdio_cnt" in
11996 '') stdio_cnt='((fp)->_r)'
11999 *) cnt_lval=$d_stdio_cnt_lval;;
12001 case "$stdio_base" in
12002 '') stdio_base='((fp)->_ub._base ? (fp)->_ub._base : (fp)->_bf._base)';;
12004 case "$stdio_bufsiz" in
12005 '') stdio_bufsiz='((fp)->_ub._base ? (fp)->_ub._size : (fp)->_bf._size)';;
12007 elif $contains '_IO_fpos_t' `./findhdr stdio.h` `./findhdr libio.h` >/dev/null 2>&1 ; then
12008 echo "(Looks like you have stdio.h from Linux.)"
12009 case "$stdio_ptr" in
12010 '') stdio_ptr='((fp)->_IO_read_ptr)'
12013 *) ptr_lval=$d_stdio_ptr_lval;;
12015 case "$stdio_cnt" in
12016 '') stdio_cnt='((fp)->_IO_read_end - (fp)->_IO_read_ptr)'
12019 *) cnt_lval=$d_stdio_cnt_lval;;
12021 case "$stdio_base" in
12022 '') stdio_base='((fp)->_IO_read_base)';;
12024 case "$stdio_bufsiz" in
12025 '') stdio_bufsiz='((fp)->_IO_read_end - (fp)->_IO_read_base)';;
12028 case "$stdio_ptr" in
12029 '') stdio_ptr='((fp)->_ptr)'
12032 *) ptr_lval=$d_stdio_ptr_lval;;
12034 case "$stdio_cnt" in
12035 '') stdio_cnt='((fp)->_cnt)'
12038 *) cnt_lval=$d_stdio_cnt_lval;;
12040 case "$stdio_base" in
12041 '') stdio_base='((fp)->_base)';;
12043 case "$stdio_bufsiz" in
12044 '') stdio_bufsiz='((fp)->_cnt + (fp)->_ptr - (fp)->_base)';;
12048 : test whether _ptr and _cnt really work
12049 echo "Checking how std your stdio is..." >&4
12052 #$i_stdlib I_STDLIB
12054 #include <stdlib.h>
12056 #define FILE_ptr(fp) $stdio_ptr
12057 #define FILE_cnt(fp) $stdio_cnt
12059 FILE *fp = fopen("try.c", "r");
12062 18 <= FILE_cnt(fp) &&
12063 strncmp(FILE_ptr(fp), "include <stdio.h>\n", 18) == 0
12071 if eval $compile && $to try.c; then
12072 if $run ./try; then
12073 echo "Your stdio acts pretty std."
12076 echo "Your stdio isn't very std."
12079 echo "Your stdio doesn't appear very std."
12083 # glibc 2.2.90 and above apparently change stdio streams so Perl's
12084 # direct buffer manipulation no longer works. The Configure tests
12085 # should be changed to correctly detect this, but until then,
12086 # the following check should at least let perl compile and run.
12087 # (This quick fix should be updated before 5.8.1.)
12088 # To be defensive, reject all unknown versions, and all versions > 2.2.9.
12089 # A. Dougherty, June 3, 2002.
12090 case "$d_gnulibc" in
12092 case "$gnulibc_version" in
12096 *) echo "But I will not snoop inside glibc $gnulibc_version stdio buffers."
12105 : Can _ptr be used as an lvalue?
12106 case "$d_stdstdio$ptr_lval" in
12107 $define$define) val=$define ;;
12110 set d_stdio_ptr_lval
12113 : Can _cnt be used as an lvalue?
12114 case "$d_stdstdio$cnt_lval" in
12115 $define$define) val=$define ;;
12118 set d_stdio_cnt_lval
12122 : test whether setting _ptr sets _cnt as a side effect
12123 d_stdio_ptr_lval_sets_cnt="$undef"
12124 d_stdio_ptr_lval_nochange_cnt="$undef"
12125 case "$d_stdio_ptr_lval$d_stdstdio" in
12127 echo "Checking to see what happens if we set the stdio ptr..." >&4
12130 /* Can we scream? */
12131 /* Eat dust sed :-) */
12132 /* In the buffer space, no one can hear you scream. */
12133 #$i_stdlib I_STDLIB
12135 #include <stdlib.h>
12137 #define FILE_ptr(fp) $stdio_ptr
12138 #define FILE_cnt(fp) $stdio_cnt
12139 #include <sys/types.h>
12141 FILE *fp = fopen("try.c", "r");
12146 puts("Fail even to read");
12149 c = getc(fp); /* Read away the first # */
12151 puts("Fail even to read");
12155 18 <= FILE_cnt(fp) &&
12156 strncmp(FILE_ptr(fp), "include <stdio.h>\n", 18) == 0
12158 puts("Fail even to read");
12161 ptr = (char*) FILE_ptr(fp);
12162 cnt = (size_t)FILE_cnt(fp);
12164 FILE_ptr(fp) += 42;
12166 if ((char*)FILE_ptr(fp) != (ptr + 42)) {
12167 printf("Fail ptr check %p != %p", FILE_ptr(fp), (ptr + 42));
12170 if (FILE_cnt(fp) <= 20) {
12171 printf ("Fail (<20 chars to test)");
12174 if (strncmp(FILE_ptr(fp), "Eat dust sed :-) */\n", 20) != 0) {
12175 puts("Fail compare");
12178 if (cnt == FILE_cnt(fp)) {
12179 puts("Pass_unchanged");
12182 if (FILE_cnt(fp) == (cnt - 42)) {
12183 puts("Pass_changed");
12186 printf("Fail count was %d now %d\n", cnt, FILE_cnt(fp));
12192 if eval $compile && $to try.c; then
12193 case `$run ./try` in
12195 echo "Increasing ptr in your stdio decreases cnt by the same amount. Good." >&4
12196 d_stdio_ptr_lval_sets_cnt="$define" ;;
12198 echo "Increasing ptr in your stdio leaves cnt unchanged. Good." >&4
12199 d_stdio_ptr_lval_nochange_cnt="$define" ;;
12201 echo "Increasing ptr in your stdio didn't do exactly what I expected. We'll not be doing that then." >&4 ;;
12203 echo "It appears attempting to set ptr in your stdio is a bad plan." >&4 ;;
12206 echo "It seems we can't set ptr in your stdio. Nevermind." >&4
12212 : see if _base is also standard
12214 case "$d_stdstdio" in
12218 #$i_stdlib I_STDLIB
12220 #include <stdlib.h>
12222 #define FILE_base(fp) $stdio_base
12223 #define FILE_bufsiz(fp) $stdio_bufsiz
12225 FILE *fp = fopen("try.c", "r");
12228 19 <= FILE_bufsiz(fp) &&
12229 strncmp(FILE_base(fp), "#include <stdio.h>\n", 19) == 0
12236 if eval $compile && $to try.c; then
12237 if $run ./try; then
12238 echo "And its _base field acts std."
12241 echo "But its _base field isn't std."
12244 echo "However, it seems to be lacking the _base field."
12252 : see if fast_stdio exists
12254 case "$d_stdstdio:$d_stdio_ptr_lval" in
12256 case "$d_stdio_cnt_lval$d_stdio_ptr_lval_sets_cnt" in
12258 echo "You seem to have 'fast stdio' to directly manipulate the stdio buffers." >& 4
12269 : see if fchdir exists
12270 set fchdir d_fchdir
12273 : see if fchmod exists
12274 set fchmod d_fchmod
12277 : see if fchown exists
12278 set fchown d_fchown
12281 : see if this is an fcntl system
12286 : See if fcntl-based locking works.
12288 #$i_stdlib I_STDLIB
12290 #include <stdlib.h>
12292 #include <unistd.h>
12294 #include <signal.h>
12295 $signal_t blech(x) int x; { exit(3); }
12297 #if defined(F_SETLK) && defined(F_SETLKW)
12298 struct flock flock;
12300 fd = open("try.c", O_RDONLY);
12301 flock.l_type = F_RDLCK;
12302 flock.l_whence = SEEK_SET;
12303 flock.l_start = flock.l_len = 0;
12304 signal(SIGALRM, blech);
12306 retval = fcntl(fd, F_SETLK, &flock);
12308 (retval < 0 ? exit(2) : exit(0));
12314 echo "Checking if fcntl-based file locking works... "
12318 if eval $compile_ok; then
12319 if $run ./try; then
12320 echo "Yes, it seems to work."
12323 echo "Nope, it didn't work."
12328 *** I had to forcibly timeout from fcntl(..., F_SETLK, ...).
12329 *** This is (almost) impossible.
12330 *** If your NFS lock daemons are not feeling well, something like
12331 *** this may happen, please investigate. Cannot continue, aborting.
12339 echo "I'm unable to compile the test program, so I'll assume not."
12344 echo "Nope, since you don't even have fcntl()."
12347 set d_fcntl_can_lock
12352 : check for fd_set items
12355 Checking to see how well your C compiler handles fd_set and friends ...
12358 #$i_stdlib I_STDLIB
12360 #include <stdlib.h>
12362 #$i_systime I_SYS_TIME
12363 #$i_sysselct I_SYS_SELECT
12364 #$d_socket HAS_SOCKET
12365 #include <sys/types.h>
12367 #include <sys/socket.h> /* Might include <sys/bsdtypes.h> */
12370 #include <sys/time.h>
12372 #ifdef I_SYS_SELECT
12373 #include <sys/select.h>
12382 #if defined(FD_SET) && defined(FD_CLR) && defined(FD_ISSET) && defined(FD_ZERO)
12390 if eval $compile; then
12391 d_fds_bits="$define"
12393 echo "Well, your system knows about the normal fd_set typedef..." >&4
12394 if $run ./try; then
12395 echo "and you have the normal fd_set macros (just as I'd expect)." >&4
12396 d_fd_macros="$define"
12399 but not the normal fd_set macros! Gaaack! I'll have to cover for you.
12401 d_fd_macros="$undef"
12405 Hmm, your compiler has some difficulty with fd_set. Checking further...
12408 if eval $compile; then
12409 d_fds_bits="$undef"
12411 echo "Well, your system has some sort of fd_set available..." >&4
12412 if $run ./try; then
12413 echo "and you have the normal fd_set macros." >&4
12414 d_fd_macros="$define"
12417 but not the normal fd_set macros! Gross! More work for me...
12419 d_fd_macros="$undef"
12422 echo "Well, you got zip. That's OK, I can roll my own fd_set stuff." >&4
12424 d_fds_bits="$undef"
12425 d_fd_macros="$undef"
12430 : see if fgetpos exists
12431 set fgetpos d_fgetpos
12434 : see if finite exists
12435 set finite d_finite
12438 : see if finitel exists
12439 set finitel d_finitel
12442 : see if flock exists
12446 : see if prototype for flock is available
12448 set d_flockproto flock $i_sysfile sys/file.h
12451 : see if fork exists
12455 : see if fp_class exists
12456 set fp_class d_fp_class
12459 : see if pathconf exists
12460 set pathconf d_pathconf
12463 : see if fpathconf exists
12464 set fpathconf d_fpathconf
12467 : see if fpclass exists
12468 set fpclass d_fpclass
12471 : see if fpclassify exists
12472 set fpclassify d_fpclassify
12475 : see if fpclassl exists
12476 set fpclassl d_fpclassl
12480 : check for fpos64_t
12482 echo "Checking to see if you have fpos64_t..." >&4
12485 int main() { fpos64_t x = 7; }
12488 if eval $compile; then
12490 echo "You have fpos64_t."
12493 echo "You do not have fpos64_t."
12494 case "$fpossize" in
12495 8) echo "(Your fpos_t is 64 bits, so you could use that.)" ;;
12502 : see if frexpl exists
12503 set frexpl d_frexpl
12506 : see if this is a sys/param system
12507 set sys/param.h i_sysparam
12510 : see if this is a sys/mount.h system
12511 set sys/mount.h i_sysmount
12516 echo "Checking to see if your system supports struct fs_data..." >&4
12517 set d_fs_data_s fs_data $i_systypes sys/types.h $i_sysparam sys/param.h $i_sysmount sys/mount.h
12519 case "$d_fs_data_s" in
12520 "$define") echo "Yes, it does." ;;
12521 *) echo "No, it doesn't." ;;
12524 : see if fseeko exists
12525 set fseeko d_fseeko
12527 case "$longsize" in
12528 8) echo "(Your long is 64 bits, so you could use fseek.)" ;;
12531 : see if fsetpos exists
12532 set fsetpos d_fsetpos
12536 : see if fstatfs exists
12537 set fstatfs d_fstatfs
12541 : see if statvfs exists
12542 set statvfs d_statvfs
12545 : see if fstatvfs exists
12546 set fstatvfs d_fstatvfs
12550 : see if fsync exists
12554 : see if ftello exists
12555 set ftello d_ftello
12557 case "$longsize" in
12558 8) echo "(Your long is 64 bits, so you could use ftell.)" ;;
12562 : check for a working futimes
12564 echo "Checking for a working futimes()" >&4
12567 #include <sys/time.h>
12574 fd = open ("try.c", O_RDWR);
12575 if (-1 == fd) exit (1);
12576 rv = futimes (fd, NULL);
12577 exit (rv == -1 ? errno : 0);
12581 if eval $compile; then
12585 0) echo "Yes, it does" >&4
12586 d_futimes="$define"
12588 *) echo "No, it has futimes, but it isn't working ($rc) (probably harmless)\n" >&4
12592 echo "No, it does not (probably harmless)\n" >&4
12594 $rm -f try.* try core core.try.*
12596 : see if getcwd exists
12597 set getcwd d_getcwd
12600 : see if getespwnam exists
12601 set getespwnam d_getespwnam
12605 : see if getfsstat exists
12606 set getfsstat d_getfsstat
12609 : see if getgrent exists
12610 set getgrent d_getgrent
12613 : see if getgrent_r exists
12614 set getgrent_r d_getgrent_r
12616 case "$d_getgrent_r" in
12618 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
12619 case "$d_getgrent_r_proto:$usethreads" in
12620 ":define") d_getgrent_r_proto=define
12621 set d_getgrent_r_proto getgrent_r $hdrs
12625 case "$d_getgrent_r_proto" in
12627 case "$getgrent_r_proto" in
12628 ''|0) try='int getgrent_r(struct group*, char*, size_t, struct group**);'
12629 ./protochk "extern $try" $hdrs && getgrent_r_proto=I_SBWR ;;
12631 case "$getgrent_r_proto" in
12632 ''|0) try='int getgrent_r(struct group*, char*, int, struct group**);'
12633 ./protochk "extern $try" $hdrs && getgrent_r_proto=I_SBIR ;;
12635 case "$getgrent_r_proto" in
12636 ''|0) try='struct group* getgrent_r(struct group*, char*, size_t);'
12637 ./protochk "extern $try" $hdrs && getgrent_r_proto=S_SBW ;;
12639 case "$getgrent_r_proto" in
12640 ''|0) try='struct group* getgrent_r(struct group*, char*, int);'
12641 ./protochk "extern $try" $hdrs && getgrent_r_proto=S_SBI ;;
12643 case "$getgrent_r_proto" in
12644 ''|0) try='int getgrent_r(struct group*, char*, int);'
12645 ./protochk "extern $try" $hdrs && getgrent_r_proto=I_SBI ;;
12647 case "$getgrent_r_proto" in
12648 ''|0) try='int getgrent_r(struct group*, char*, int, FILE**);'
12649 ./protochk "extern $try" $hdrs && getgrent_r_proto=I_SBIH ;;
12651 case "$getgrent_r_proto" in
12652 ''|0) d_getgrent_r=undef
12654 echo "Disabling getgrent_r, cannot determine prototype." >&4 ;;
12655 * ) case "$getgrent_r_proto" in
12656 REENTRANT_PROTO*) ;;
12657 *) getgrent_r_proto="REENTRANT_PROTO_$getgrent_r_proto" ;;
12659 echo "Prototype: $try" ;;
12662 *) case "$usethreads" in
12663 define) echo "getgrent_r has no prototype, not using it." >&4 ;;
12670 *) getgrent_r_proto=0
12674 : see if getgrgid_r exists
12675 set getgrgid_r d_getgrgid_r
12677 case "$d_getgrgid_r" in
12679 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
12680 case "$d_getgrgid_r_proto:$usethreads" in
12681 ":define") d_getgrgid_r_proto=define
12682 set d_getgrgid_r_proto getgrgid_r $hdrs
12686 case "$d_getgrgid_r_proto" in
12688 case "$getgrgid_r_proto" in
12689 ''|0) try='int getgrgid_r(gid_t, struct group*, char*, size_t, struct group**);'
12690 ./protochk "extern $try" $hdrs && getgrgid_r_proto=I_TSBWR ;;
12692 case "$getgrgid_r_proto" in
12693 ''|0) try='int getgrgid_r(gid_t, struct group*, char*, int, struct group**);'
12694 ./protochk "extern $try" $hdrs && getgrgid_r_proto=I_TSBIR ;;
12696 case "$getgrgid_r_proto" in
12697 ''|0) try='int getgrgid_r(gid_t, struct group*, char*, int);'
12698 ./protochk "extern $try" $hdrs && getgrgid_r_proto=I_TSBI ;;
12700 case "$getgrgid_r_proto" in
12701 ''|0) try='struct group* getgrgid_r(gid_t, struct group*, char*, int);'
12702 ./protochk "extern $try" $hdrs && getgrgid_r_proto=S_TSBI ;;
12704 case "$getgrgid_r_proto" in
12705 ''|0) d_getgrgid_r=undef
12707 echo "Disabling getgrgid_r, cannot determine prototype." >&4 ;;
12708 * ) case "$getgrgid_r_proto" in
12709 REENTRANT_PROTO*) ;;
12710 *) getgrgid_r_proto="REENTRANT_PROTO_$getgrgid_r_proto" ;;
12712 echo "Prototype: $try" ;;
12715 *) case "$usethreads" in
12716 define) echo "getgrgid_r has no prototype, not using it." >&4 ;;
12723 *) getgrgid_r_proto=0
12727 : see if getgrnam_r exists
12728 set getgrnam_r d_getgrnam_r
12730 case "$d_getgrnam_r" in
12732 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
12733 case "$d_getgrnam_r_proto:$usethreads" in
12734 ":define") d_getgrnam_r_proto=define
12735 set d_getgrnam_r_proto getgrnam_r $hdrs
12739 case "$d_getgrnam_r_proto" in
12741 case "$getgrnam_r_proto" in
12742 ''|0) try='int getgrnam_r(const char*, struct group*, char*, size_t, struct group**);'
12743 ./protochk "extern $try" $hdrs && getgrnam_r_proto=I_CSBWR ;;
12745 case "$getgrnam_r_proto" in
12746 ''|0) try='int getgrnam_r(const char*, struct group*, char*, int, struct group**);'
12747 ./protochk "extern $try" $hdrs && getgrnam_r_proto=I_CSBIR ;;
12749 case "$getgrnam_r_proto" in
12750 ''|0) try='struct group* getgrnam_r(const char*, char*, int);'
12751 ./protochk "extern $try" $hdrs && getgrnam_r_proto=S_CBI ;;
12753 case "$getgrnam_r_proto" in
12754 ''|0) try='int getgrnam_r(const char*, struct group*, char*, int);'
12755 ./protochk "extern $try" $hdrs && getgrnam_r_proto=I_CSBI ;;
12757 case "$getgrnam_r_proto" in
12758 ''|0) try='struct group* getgrnam_r(const char*, struct group*, char*, int);'
12759 ./protochk "extern $try" $hdrs && getgrnam_r_proto=S_CSBI ;;
12761 case "$getgrnam_r_proto" in
12762 ''|0) d_getgrnam_r=undef
12764 echo "Disabling getgrnam_r, cannot determine prototype." >&4 ;;
12765 * ) case "$getgrnam_r_proto" in
12766 REENTRANT_PROTO*) ;;
12767 *) getgrnam_r_proto="REENTRANT_PROTO_$getgrnam_r_proto" ;;
12769 echo "Prototype: $try" ;;
12772 *) case "$usethreads" in
12773 define) echo "getgrnam_r has no prototype, not using it." >&4 ;;
12780 *) getgrnam_r_proto=0
12784 : see if gethostbyaddr exists
12785 set gethostbyaddr d_gethbyaddr
12788 : see if gethostbyname exists
12789 set gethostbyname d_gethbyname
12792 : see if gethostent exists
12793 set gethostent d_gethent
12796 : see how we will look up host name
12799 if set gethostname val -f d_gethname; eval $csym; $val; then
12800 echo 'gethostname() found.' >&4
12801 d_gethname="$define"
12804 if set uname val -f d_uname; eval $csym; $val; then
12807 uname() was found, but you're running xenix, and older versions of xenix
12808 have a broken uname(). If you don't really know whether your xenix is old
12809 enough to have a broken system call, use the default answer.
12814 "$define") dflt=n;;
12816 rp='Is your uname() broken?'
12819 n*) d_uname="$define"; call=uname;;
12822 echo 'uname() found.' >&4
12829 case "$d_gethname" in
12830 '') d_gethname="$undef";;
12833 '') d_uname="$undef";;
12835 case "$d_uname$d_gethname" in
12840 Every now and then someone has a $call() that lies about the hostname
12841 but can't be fixed for political or economic reasons. If you wish, I can
12842 pretend $call() isn't there and maybe compute hostname at run-time
12843 thanks to the '$phostname' command.
12846 rp="Shall I ignore $call() from now on?"
12849 y*) d_uname="$undef" d_gethname="$undef"; $echo $n "Okay...$c";;
12852 case "$phostname" in
12853 '') aphostname='';;
12854 *) case "$aphostname" in
12856 *) set X $phostname
12860 file=`./loc $file $file $pth`
12861 aphostname=`echo $file $*`
12866 case "$d_uname$d_gethname" in
12869 case "$phostname" in
12871 echo "There will be no way for $package to get your hostname." >&4;;
12873 echo "I'll use 'popen("'"'$aphostname'", "r")'"' to get your hostname." >&4
12877 case "$d_phostname" in
12878 '') d_phostname="$undef";;
12881 : see if gethostbyaddr_r exists
12882 set gethostbyaddr_r d_gethostbyaddr_r
12884 case "$d_gethostbyaddr_r" in
12886 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
12887 case "$d_gethostbyaddr_r_proto:$usethreads" in
12888 ":define") d_gethostbyaddr_r_proto=define
12889 set d_gethostbyaddr_r_proto gethostbyaddr_r $hdrs
12893 case "$d_gethostbyaddr_r_proto" in
12895 case "$gethostbyaddr_r_proto" in
12896 ''|0) try='int gethostbyaddr_r(const char*, size_t, int, struct hostent*, char*, size_t, struct hostent**, int*);'
12897 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=I_CWISBWRE ;;
12899 case "$gethostbyaddr_r_proto" in
12900 ''|0) try='struct hostent* gethostbyaddr_r(const char*, size_t, int, struct hostent*, char*, size_t, int, int*);'
12901 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=S_CWISBWIE ;;
12903 case "$gethostbyaddr_r_proto" in
12904 ''|0) try='struct hostent* gethostbyaddr_r(const char*, size_t, int, struct hostent*, char*, int, int*);'
12905 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=S_CWISBIE ;;
12907 case "$gethostbyaddr_r_proto" in
12908 ''|0) try='struct hostent* gethostbyaddr_r(const void*, size_t, int, struct hostent*, char*, int, int*);'
12909 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=S_TWISBIE ;;
12911 case "$gethostbyaddr_r_proto" in
12912 ''|0) try='struct hostent* gethostbyaddr_r(const char*, int, int, struct hostent*, char*, int, int*);'
12913 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=S_CIISBIE ;;
12915 case "$gethostbyaddr_r_proto" in
12916 ''|0) try='struct hostent* gethostbyaddr_r(const char*, struct hostent*, char*, int, int*);'
12917 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=S_CSBIE ;;
12919 case "$gethostbyaddr_r_proto" in
12920 ''|0) try='struct hostent* gethostbyaddr_r(const void*, struct hostent*, char*, int, int*);'
12921 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=S_TSBIE ;;
12923 case "$gethostbyaddr_r_proto" in
12924 ''|0) try='int gethostbyaddr_r(const char*, size_t, int, struct hostent*, struct hostent_data*);'
12925 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=I_CWISD ;;
12927 case "$gethostbyaddr_r_proto" in
12928 ''|0) try='int gethostbyaddr_r(const char*, int, int, struct hostent*, struct hostent_data*);'
12929 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=I_CIISD ;;
12931 case "$gethostbyaddr_r_proto" in
12932 ''|0) try='int gethostbyaddr_r(const char*, int, int);'
12933 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=I_CII ;;
12935 case "$gethostbyaddr_r_proto" in
12936 ''|0) try='int gethostbyaddr_r(const void*, socklen_t, int, struct hostent*, char*, size_t, struct hostent**, int*);'
12937 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=I_TsISBWRE ;;
12939 case "$gethostbyaddr_r_proto" in
12940 ''|0) d_gethostbyaddr_r=undef
12941 gethostbyaddr_r_proto=0
12942 echo "Disabling gethostbyaddr_r, cannot determine prototype." >&4 ;;
12943 * ) case "$gethostbyaddr_r_proto" in
12944 REENTRANT_PROTO*) ;;
12945 *) gethostbyaddr_r_proto="REENTRANT_PROTO_$gethostbyaddr_r_proto" ;;
12947 echo "Prototype: $try" ;;
12950 *) case "$usethreads" in
12951 define) echo "gethostbyaddr_r has no prototype, not using it." >&4 ;;
12953 d_gethostbyaddr_r=undef
12954 gethostbyaddr_r_proto=0
12958 *) gethostbyaddr_r_proto=0
12962 : see if gethostbyname_r exists
12963 set gethostbyname_r d_gethostbyname_r
12965 case "$d_gethostbyname_r" in
12967 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
12968 case "$d_gethostbyname_r_proto:$usethreads" in
12969 ":define") d_gethostbyname_r_proto=define
12970 set d_gethostbyname_r_proto gethostbyname_r $hdrs
12974 case "$d_gethostbyname_r_proto" in
12976 case "$gethostbyname_r_proto" in
12977 ''|0) try='int gethostbyname_r(const char*, struct hostent*, char*, size_t, struct hostent**, int*);'
12978 ./protochk "extern $try" $hdrs && gethostbyname_r_proto=I_CSBWRE ;;
12980 case "$gethostbyname_r_proto" in
12981 ''|0) try='struct hostent* gethostbyname_r(const char*, struct hostent*, char*, int, int*);'
12982 ./protochk "extern $try" $hdrs && gethostbyname_r_proto=S_CSBIE ;;
12984 case "$gethostbyname_r_proto" in
12985 ''|0) try='int gethostbyname_r(const char*, struct hostent*, struct hostent_data*);'
12986 ./protochk "extern $try" $hdrs && gethostbyname_r_proto=I_CSD ;;
12988 case "$gethostbyname_r_proto" in
12989 ''|0) d_gethostbyname_r=undef
12990 gethostbyname_r_proto=0
12991 echo "Disabling gethostbyname_r, cannot determine prototype." >&4 ;;
12992 * ) case "$gethostbyname_r_proto" in
12993 REENTRANT_PROTO*) ;;
12994 *) gethostbyname_r_proto="REENTRANT_PROTO_$gethostbyname_r_proto" ;;
12996 echo "Prototype: $try" ;;
12999 *) case "$usethreads" in
13000 define) echo "gethostbyname_r has no prototype, not using it." >&4 ;;
13002 d_gethostbyname_r=undef
13003 gethostbyname_r_proto=0
13007 *) gethostbyname_r_proto=0
13011 : see if gethostent_r exists
13012 set gethostent_r d_gethostent_r
13014 case "$d_gethostent_r" in
13016 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13017 case "$d_gethostent_r_proto:$usethreads" in
13018 ":define") d_gethostent_r_proto=define
13019 set d_gethostent_r_proto gethostent_r $hdrs
13023 case "$d_gethostent_r_proto" in
13025 case "$gethostent_r_proto" in
13026 ''|0) try='int gethostent_r(struct hostent*, char*, size_t, struct hostent**, int*);'
13027 ./protochk "extern $try" $hdrs && gethostent_r_proto=I_SBWRE ;;
13029 case "$gethostent_r_proto" in
13030 ''|0) try='int gethostent_r(struct hostent*, char*, int, int*);'
13031 ./protochk "extern $try" $hdrs && gethostent_r_proto=I_SBIE ;;
13033 case "$gethostent_r_proto" in
13034 ''|0) try='struct hostent* gethostent_r(struct hostent*, char*, int, int*);'
13035 ./protochk "extern $try" $hdrs && gethostent_r_proto=S_SBIE ;;
13037 case "$gethostent_r_proto" in
13038 ''|0) try='struct hostent* gethostent_r(struct hostent*, char*, int);'
13039 ./protochk "extern $try" $hdrs && gethostent_r_proto=S_SBI ;;
13041 case "$gethostent_r_proto" in
13042 ''|0) try='int gethostent_r(struct hostent*, char*, int);'
13043 ./protochk "extern $try" $hdrs && gethostent_r_proto=I_SBI ;;
13045 case "$gethostent_r_proto" in
13046 ''|0) try='int gethostent_r(struct hostent*, struct hostent_data*);'
13047 ./protochk "extern $try" $hdrs && gethostent_r_proto=I_SD ;;
13049 case "$gethostent_r_proto" in
13050 ''|0) d_gethostent_r=undef
13051 gethostent_r_proto=0
13052 echo "Disabling gethostent_r, cannot determine prototype." >&4 ;;
13053 * ) case "$gethostent_r_proto" in
13054 REENTRANT_PROTO*) ;;
13055 *) gethostent_r_proto="REENTRANT_PROTO_$gethostent_r_proto" ;;
13057 echo "Prototype: $try" ;;
13060 *) case "$usethreads" in
13061 define) echo "gethostent_r has no prototype, not using it." >&4 ;;
13063 d_gethostent_r=undef
13064 gethostent_r_proto=0
13068 *) gethostent_r_proto=0
13072 : see if prototypes for various gethostxxx netdb.h functions are available
13074 set d_gethostprotos gethostent $i_netdb netdb.h
13077 : see if getitimer exists
13078 set getitimer d_getitimer
13081 : see if getlogin exists
13082 set getlogin d_getlogin
13085 : see if getlogin_r exists
13086 set getlogin_r d_getlogin_r
13088 case "$d_getlogin_r" in
13090 hdrs="$i_systypes sys/types.h define stdio.h $i_unistd unistd.h"
13091 case "$d_getlogin_r_proto:$usethreads" in
13092 ":define") d_getlogin_r_proto=define
13093 set d_getlogin_r_proto getlogin_r $hdrs
13097 case "$d_getlogin_r_proto" in
13099 case "$getlogin_r_proto" in
13100 ''|0) try='int getlogin_r(char*, size_t);'
13101 ./protochk "extern $try" $hdrs && getlogin_r_proto=I_BW ;;
13103 case "$getlogin_r_proto" in
13104 ''|0) try='int getlogin_r(char*, int);'
13105 ./protochk "extern $try" $hdrs && getlogin_r_proto=I_BI ;;
13107 case "$getlogin_r_proto" in
13108 ''|0) try='char* getlogin_r(char*, size_t);'
13109 ./protochk "extern $try" $hdrs && getlogin_r_proto=B_BW ;;
13111 case "$getlogin_r_proto" in
13112 ''|0) try='char* getlogin_r(char*, int);'
13113 ./protochk "extern $try" $hdrs && getlogin_r_proto=B_BI ;;
13115 case "$getlogin_r_proto" in
13116 ''|0) d_getlogin_r=undef
13118 echo "Disabling getlogin_r, cannot determine prototype." >&4 ;;
13119 * ) case "$getlogin_r_proto" in
13120 REENTRANT_PROTO*) ;;
13121 *) getlogin_r_proto="REENTRANT_PROTO_$getlogin_r_proto" ;;
13123 echo "Prototype: $try" ;;
13126 *) case "$usethreads" in
13127 define) echo "getlogin_r has no prototype, not using it." >&4 ;;
13134 *) getlogin_r_proto=0
13138 : see if getmnt exists
13139 set getmnt d_getmnt
13142 : see if getmntent exists
13143 set getmntent d_getmntent
13146 : see if getnetbyaddr exists
13147 set getnetbyaddr d_getnbyaddr
13150 : see if getnetbyname exists
13151 set getnetbyname d_getnbyname
13154 : see if getnetent exists
13155 set getnetent d_getnent
13158 : see if getnetbyaddr_r exists
13159 set getnetbyaddr_r d_getnetbyaddr_r
13161 case "$d_getnetbyaddr_r" in
13163 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13164 case "$d_getnetbyaddr_r_proto:$usethreads" in
13165 ":define") d_getnetbyaddr_r_proto=define
13166 set d_getnetbyaddr_r_proto getnetbyaddr_r $hdrs
13170 case "$d_getnetbyaddr_r_proto" in
13172 case "$getnetbyaddr_r_proto" in
13173 ''|0) try='int getnetbyaddr_r(unsigned long, int, struct netent*, char*, size_t, struct netent**, int*);'
13174 ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=I_UISBWRE ;;
13176 case "$getnetbyaddr_r_proto" in
13177 ''|0) try='int getnetbyaddr_r(long, int, struct netent*, char*, int);'
13178 ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=I_LISBI ;;
13180 case "$getnetbyaddr_r_proto" in
13181 ''|0) try='struct netent* getnetbyaddr_r(in_addr_t, int, struct netent*, char*, int);'
13182 ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=S_TISBI ;;
13184 case "$getnetbyaddr_r_proto" in
13185 ''|0) try='struct netent* getnetbyaddr_r(long, int, struct netent*, char*, int);'
13186 ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=S_LISBI ;;
13188 case "$getnetbyaddr_r_proto" in
13189 ''|0) try='int getnetbyaddr_r(in_addr_t, int, struct netent*, struct netent_data*);'
13190 ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=I_TISD ;;
13192 case "$getnetbyaddr_r_proto" in
13193 ''|0) try='int getnetbyaddr_r(long, int, struct netent*, struct netent_data*);'
13194 ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=I_LISD ;;
13196 case "$getnetbyaddr_r_proto" in
13197 ''|0) try='int getnetbyaddr_r(int, int, struct netent*, struct netent_data*);'
13198 ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=I_IISD ;;
13200 case "$getnetbyaddr_r_proto" in
13201 ''|0) try='int getnetbyaddr_r(uint32_t, int, struct netent*, char*, size_t, struct netent**, int*);'
13202 ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=I_uISBWRE ;;
13204 case "$getnetbyaddr_r_proto" in
13205 ''|0) d_getnetbyaddr_r=undef
13206 getnetbyaddr_r_proto=0
13207 echo "Disabling getnetbyaddr_r, cannot determine prototype." >&4 ;;
13208 * ) case "$getnetbyaddr_r_proto" in
13209 REENTRANT_PROTO*) ;;
13210 *) getnetbyaddr_r_proto="REENTRANT_PROTO_$getnetbyaddr_r_proto" ;;
13212 echo "Prototype: $try" ;;
13215 *) case "$usethreads" in
13216 define) echo "getnetbyaddr_r has no prototype, not using it." >&4 ;;
13218 d_getnetbyaddr_r=undef
13219 getnetbyaddr_r_proto=0
13223 *) getnetbyaddr_r_proto=0
13227 : see if getnetbyname_r exists
13228 set getnetbyname_r d_getnetbyname_r
13230 case "$d_getnetbyname_r" in
13232 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13233 case "$d_getnetbyname_r_proto:$usethreads" in
13234 ":define") d_getnetbyname_r_proto=define
13235 set d_getnetbyname_r_proto getnetbyname_r $hdrs
13239 case "$d_getnetbyname_r_proto" in
13241 case "$getnetbyname_r_proto" in
13242 ''|0) try='int getnetbyname_r(const char*, struct netent*, char*, size_t, struct netent**, int*);'
13243 ./protochk "extern $try" $hdrs && getnetbyname_r_proto=I_CSBWRE ;;
13245 case "$getnetbyname_r_proto" in
13246 ''|0) try='int getnetbyname_r(const char*, struct netent*, char*, int);'
13247 ./protochk "extern $try" $hdrs && getnetbyname_r_proto=I_CSBI ;;
13249 case "$getnetbyname_r_proto" in
13250 ''|0) try='struct netent* getnetbyname_r(const char*, struct netent*, char*, int);'
13251 ./protochk "extern $try" $hdrs && getnetbyname_r_proto=S_CSBI ;;
13253 case "$getnetbyname_r_proto" in
13254 ''|0) try='int getnetbyname_r(const char*, struct netent*, struct netent_data*);'
13255 ./protochk "extern $try" $hdrs && getnetbyname_r_proto=I_CSD ;;
13257 case "$getnetbyname_r_proto" in
13258 ''|0) d_getnetbyname_r=undef
13259 getnetbyname_r_proto=0
13260 echo "Disabling getnetbyname_r, cannot determine prototype." >&4 ;;
13261 * ) case "$getnetbyname_r_proto" in
13262 REENTRANT_PROTO*) ;;
13263 *) getnetbyname_r_proto="REENTRANT_PROTO_$getnetbyname_r_proto" ;;
13265 echo "Prototype: $try" ;;
13268 *) case "$usethreads" in
13269 define) echo "getnetbyname_r has no prototype, not using it." >&4 ;;
13271 d_getnetbyname_r=undef
13272 getnetbyname_r_proto=0
13276 *) getnetbyname_r_proto=0
13280 : see if getnetent_r exists
13281 set getnetent_r d_getnetent_r
13283 case "$d_getnetent_r" in
13285 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13286 case "$d_getnetent_r_proto:$usethreads" in
13287 ":define") d_getnetent_r_proto=define
13288 set d_getnetent_r_proto getnetent_r $hdrs
13292 case "$d_getnetent_r_proto" in
13294 case "$getnetent_r_proto" in
13295 ''|0) try='int getnetent_r(struct netent*, char*, size_t, struct netent**, int*);'
13296 ./protochk "extern $try" $hdrs && getnetent_r_proto=I_SBWRE ;;
13298 case "$getnetent_r_proto" in
13299 ''|0) try='int getnetent_r(struct netent*, char*, int, int*);'
13300 ./protochk "extern $try" $hdrs && getnetent_r_proto=I_SBIE ;;
13302 case "$getnetent_r_proto" in
13303 ''|0) try='struct netent* getnetent_r(struct netent*, char*, int, int*);'
13304 ./protochk "extern $try" $hdrs && getnetent_r_proto=S_SBIE ;;
13306 case "$getnetent_r_proto" in
13307 ''|0) try='struct netent* getnetent_r(struct netent*, char*, int);'
13308 ./protochk "extern $try" $hdrs && getnetent_r_proto=S_SBI ;;
13310 case "$getnetent_r_proto" in
13311 ''|0) try='int getnetent_r(struct netent*, char*, int);'
13312 ./protochk "extern $try" $hdrs && getnetent_r_proto=I_SBI ;;
13314 case "$getnetent_r_proto" in
13315 ''|0) try='int getnetent_r(struct netent*, struct netent_data*);'
13316 ./protochk "extern $try" $hdrs && getnetent_r_proto=I_SD ;;
13318 case "$getnetent_r_proto" in
13319 ''|0) d_getnetent_r=undef
13320 getnetent_r_proto=0
13321 echo "Disabling getnetent_r, cannot determine prototype." >&4 ;;
13322 * ) case "$getnetent_r_proto" in
13323 REENTRANT_PROTO*) ;;
13324 *) getnetent_r_proto="REENTRANT_PROTO_$getnetent_r_proto" ;;
13326 echo "Prototype: $try" ;;
13329 *) case "$usethreads" in
13330 define) echo "getnetent_r has no prototype, not using it." >&4 ;;
13332 d_getnetent_r=undef
13333 getnetent_r_proto=0
13337 *) getnetent_r_proto=0
13341 : see if prototypes for various getnetxxx netdb.h functions are available
13343 set d_getnetprotos getnetent $i_netdb netdb.h
13346 : see if getpagesize exists
13347 set getpagesize d_getpagsz
13351 : see if getprotobyname exists
13352 set getprotobyname d_getpbyname
13355 : see if getprotobynumber exists
13356 set getprotobynumber d_getpbynumber
13359 : see if getprotoent exists
13360 set getprotoent d_getpent
13363 : see if getpgid exists
13364 set getpgid d_getpgid
13367 : see if getpgrp2 exists
13368 set getpgrp2 d_getpgrp2
13371 : see if getppid exists
13372 set getppid d_getppid
13375 : see if getpriority exists
13376 set getpriority d_getprior
13379 : see if getprotobyname_r exists
13380 set getprotobyname_r d_getprotobyname_r
13382 case "$d_getprotobyname_r" in
13384 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13385 case "$d_getprotobyname_r_proto:$usethreads" in
13386 ":define") d_getprotobyname_r_proto=define
13387 set d_getprotobyname_r_proto getprotobyname_r $hdrs
13391 case "$d_getprotobyname_r_proto" in
13393 case "$getprotobyname_r_proto" in
13394 ''|0) try='int getprotobyname_r(const char*, struct protoent*, char*, size_t, struct protoent**);'
13395 ./protochk "extern $try" $hdrs && getprotobyname_r_proto=I_CSBWR ;;
13397 case "$getprotobyname_r_proto" in
13398 ''|0) try='struct protoent* getprotobyname_r(const char*, struct protoent*, char*, int);'
13399 ./protochk "extern $try" $hdrs && getprotobyname_r_proto=S_CSBI ;;
13401 case "$getprotobyname_r_proto" in
13402 ''|0) try='int getprotobyname_r(const char*, struct protoent*, struct protoent_data*);'
13403 ./protochk "extern $try" $hdrs && getprotobyname_r_proto=I_CSD ;;
13405 case "$getprotobyname_r_proto" in
13406 ''|0) d_getprotobyname_r=undef
13407 getprotobyname_r_proto=0
13408 echo "Disabling getprotobyname_r, cannot determine prototype." >&4 ;;
13409 * ) case "$getprotobyname_r_proto" in
13410 REENTRANT_PROTO*) ;;
13411 *) getprotobyname_r_proto="REENTRANT_PROTO_$getprotobyname_r_proto" ;;
13413 echo "Prototype: $try" ;;
13416 *) case "$usethreads" in
13417 define) echo "getprotobyname_r has no prototype, not using it." >&4 ;;
13419 d_getprotobyname_r=undef
13420 getprotobyname_r_proto=0
13424 *) getprotobyname_r_proto=0
13428 : see if getprotobynumber_r exists
13429 set getprotobynumber_r d_getprotobynumber_r
13431 case "$d_getprotobynumber_r" in
13433 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13434 case "$d_getprotobynumber_r_proto:$usethreads" in
13435 ":define") d_getprotobynumber_r_proto=define
13436 set d_getprotobynumber_r_proto getprotobynumber_r $hdrs
13440 case "$d_getprotobynumber_r_proto" in
13442 case "$getprotobynumber_r_proto" in
13443 ''|0) try='int getprotobynumber_r(int, struct protoent*, char*, size_t, struct protoent**);'
13444 ./protochk "extern $try" $hdrs && getprotobynumber_r_proto=I_ISBWR ;;
13446 case "$getprotobynumber_r_proto" in
13447 ''|0) try='struct protoent* getprotobynumber_r(int, struct protoent*, char*, int);'
13448 ./protochk "extern $try" $hdrs && getprotobynumber_r_proto=S_ISBI ;;
13450 case "$getprotobynumber_r_proto" in
13451 ''|0) try='int getprotobynumber_r(int, struct protoent*, struct protoent_data*);'
13452 ./protochk "extern $try" $hdrs && getprotobynumber_r_proto=I_ISD ;;
13454 case "$getprotobynumber_r_proto" in
13455 ''|0) d_getprotobynumber_r=undef
13456 getprotobynumber_r_proto=0
13457 echo "Disabling getprotobynumber_r, cannot determine prototype." >&4 ;;
13458 * ) case "$getprotobynumber_r_proto" in
13459 REENTRANT_PROTO*) ;;
13460 *) getprotobynumber_r_proto="REENTRANT_PROTO_$getprotobynumber_r_proto" ;;
13462 echo "Prototype: $try" ;;
13465 *) case "$usethreads" in
13466 define) echo "getprotobynumber_r has no prototype, not using it." >&4 ;;
13468 d_getprotobynumber_r=undef
13469 getprotobynumber_r_proto=0
13473 *) getprotobynumber_r_proto=0
13477 : see if getprotoent_r exists
13478 set getprotoent_r d_getprotoent_r
13480 case "$d_getprotoent_r" in
13482 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13483 case "$d_getprotoent_r_proto:$usethreads" in
13484 ":define") d_getprotoent_r_proto=define
13485 set d_getprotoent_r_proto getprotoent_r $hdrs
13489 case "$d_getprotoent_r_proto" in
13491 case "$getprotoent_r_proto" in
13492 ''|0) try='int getprotoent_r(struct protoent*, char*, size_t, struct protoent**);'
13493 ./protochk "extern $try" $hdrs && getprotoent_r_proto=I_SBWR ;;
13495 case "$getprotoent_r_proto" in
13496 ''|0) try='int getprotoent_r(struct protoent*, char*, int);'
13497 ./protochk "extern $try" $hdrs && getprotoent_r_proto=I_SBI ;;
13499 case "$getprotoent_r_proto" in
13500 ''|0) try='struct protoent* getprotoent_r(struct protoent*, char*, int);'
13501 ./protochk "extern $try" $hdrs && getprotoent_r_proto=S_SBI ;;
13503 case "$getprotoent_r_proto" in
13504 ''|0) try='int getprotoent_r(struct protoent*, struct protoent_data*);'
13505 ./protochk "extern $try" $hdrs && getprotoent_r_proto=I_SD ;;
13507 case "$getprotoent_r_proto" in
13508 ''|0) d_getprotoent_r=undef
13509 getprotoent_r_proto=0
13510 echo "Disabling getprotoent_r, cannot determine prototype." >&4 ;;
13511 * ) case "$getprotoent_r_proto" in
13512 REENTRANT_PROTO*) ;;
13513 *) getprotoent_r_proto="REENTRANT_PROTO_$getprotoent_r_proto" ;;
13515 echo "Prototype: $try" ;;
13518 *) case "$usethreads" in
13519 define) echo "getprotoent_r has no prototype, not using it." >&4 ;;
13521 d_getprotoent_r=undef
13522 getprotoent_r_proto=0
13526 *) getprotoent_r_proto=0
13530 : see if prototypes for various getprotoxxx netdb.h functions are available
13532 set d_getprotoprotos getprotoent $i_netdb netdb.h
13535 : see if getprpwnam exists
13536 set getprpwnam d_getprpwnam
13539 : see if getpwent exists
13540 set getpwent d_getpwent
13543 : see if getpwent_r exists
13544 set getpwent_r d_getpwent_r
13546 case "$d_getpwent_r" in
13548 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
13549 case "$d_getpwent_r_proto:$usethreads" in
13550 ":define") d_getpwent_r_proto=define
13551 set d_getpwent_r_proto getpwent_r $hdrs
13555 case "$d_getpwent_r_proto" in
13557 case "$getpwent_r_proto" in
13558 ''|0) try='int getpwent_r(struct passwd*, char*, size_t, struct passwd**);'
13559 ./protochk "extern $try" $hdrs && getpwent_r_proto=I_SBWR ;;
13561 case "$getpwent_r_proto" in
13562 ''|0) try='int getpwent_r(struct passwd*, char*, int, struct passwd**);'
13563 ./protochk "extern $try" $hdrs && getpwent_r_proto=I_SBIR ;;
13565 case "$getpwent_r_proto" in
13566 ''|0) try='struct passwd* getpwent_r(struct passwd*, char*, size_t);'
13567 ./protochk "extern $try" $hdrs && getpwent_r_proto=S_SBW ;;
13569 case "$getpwent_r_proto" in
13570 ''|0) try='struct passwd* getpwent_r(struct passwd*, char*, int);'
13571 ./protochk "extern $try" $hdrs && getpwent_r_proto=S_SBI ;;
13573 case "$getpwent_r_proto" in
13574 ''|0) try='int getpwent_r(struct passwd*, char*, int);'
13575 ./protochk "extern $try" $hdrs && getpwent_r_proto=I_SBI ;;
13577 case "$getpwent_r_proto" in
13578 ''|0) try='int getpwent_r(struct passwd*, char*, int, FILE**);'
13579 ./protochk "extern $try" $hdrs && getpwent_r_proto=I_SBIH ;;
13581 case "$getpwent_r_proto" in
13582 ''|0) d_getpwent_r=undef
13584 echo "Disabling getpwent_r, cannot determine prototype." >&4 ;;
13585 * ) case "$getpwent_r_proto" in
13586 REENTRANT_PROTO*) ;;
13587 *) getpwent_r_proto="REENTRANT_PROTO_$getpwent_r_proto" ;;
13589 echo "Prototype: $try" ;;
13592 *) case "$usethreads" in
13593 define) echo "getpwent_r has no prototype, not using it." >&4 ;;
13600 *) getpwent_r_proto=0
13604 : see if getpwnam_r exists
13605 set getpwnam_r d_getpwnam_r
13607 case "$d_getpwnam_r" in
13609 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
13610 case "$d_getpwnam_r_proto:$usethreads" in
13611 ":define") d_getpwnam_r_proto=define
13612 set d_getpwnam_r_proto getpwnam_r $hdrs
13616 case "$d_getpwnam_r_proto" in
13618 case "$getpwnam_r_proto" in
13619 ''|0) try='int getpwnam_r(const char*, struct passwd*, char*, size_t, struct passwd**);'
13620 ./protochk "extern $try" $hdrs && getpwnam_r_proto=I_CSBWR ;;
13622 case "$getpwnam_r_proto" in
13623 ''|0) try='int getpwnam_r(const char*, struct passwd*, char*, int, struct passwd**);'
13624 ./protochk "extern $try" $hdrs && getpwnam_r_proto=I_CSBIR ;;
13626 case "$getpwnam_r_proto" in
13627 ''|0) try='struct passwd* getpwnam_r(const char*, struct passwd*, char*, int);'
13628 ./protochk "extern $try" $hdrs && getpwnam_r_proto=S_CSBI ;;
13630 case "$getpwnam_r_proto" in
13631 ''|0) try='int getpwnam_r(const char*, struct passwd*, char*, int);'
13632 ./protochk "extern $try" $hdrs && getpwnam_r_proto=I_CSBI ;;
13634 case "$getpwnam_r_proto" in
13635 ''|0) d_getpwnam_r=undef
13637 echo "Disabling getpwnam_r, cannot determine prototype." >&4 ;;
13638 * ) case "$getpwnam_r_proto" in
13639 REENTRANT_PROTO*) ;;
13640 *) getpwnam_r_proto="REENTRANT_PROTO_$getpwnam_r_proto" ;;
13642 echo "Prototype: $try" ;;
13645 *) case "$usethreads" in
13646 define) echo "getpwnam_r has no prototype, not using it." >&4 ;;
13653 *) getpwnam_r_proto=0
13657 : see if getpwuid_r exists
13658 set getpwuid_r d_getpwuid_r
13660 case "$d_getpwuid_r" in
13662 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
13663 case "$d_getpwuid_r_proto:$usethreads" in
13664 ":define") d_getpwuid_r_proto=define
13665 set d_getpwuid_r_proto getpwuid_r $hdrs
13669 case "$d_getpwuid_r_proto" in
13671 case "$getpwuid_r_proto" in
13672 ''|0) try='int getpwuid_r(uid_t, struct passwd*, char*, size_t, struct passwd**);'
13673 ./protochk "extern $try" $hdrs && getpwuid_r_proto=I_TSBWR ;;
13675 case "$getpwuid_r_proto" in
13676 ''|0) try='int getpwuid_r(uid_t, struct passwd*, char*, int, struct passwd**);'
13677 ./protochk "extern $try" $hdrs && getpwuid_r_proto=I_TSBIR ;;
13679 case "$getpwuid_r_proto" in
13680 ''|0) try='int getpwuid_r(uid_t, struct passwd*, char*, int);'
13681 ./protochk "extern $try" $hdrs && getpwuid_r_proto=I_TSBI ;;
13683 case "$getpwuid_r_proto" in
13684 ''|0) try='struct passwd* getpwuid_r(uid_t, struct passwd*, char*, int);'
13685 ./protochk "extern $try" $hdrs && getpwuid_r_proto=S_TSBI ;;
13687 case "$getpwuid_r_proto" in
13688 ''|0) d_getpwuid_r=undef
13690 echo "Disabling getpwuid_r, cannot determine prototype." >&4 ;;
13691 * ) case "$getpwuid_r_proto" in
13692 REENTRANT_PROTO*) ;;
13693 *) getpwuid_r_proto="REENTRANT_PROTO_$getpwuid_r_proto" ;;
13695 echo "Prototype: $try" ;;
13698 *) case "$usethreads" in
13699 define) echo "getpwuid_r has no prototype, not using it." >&4 ;;
13706 *) getpwuid_r_proto=0
13711 : see if getservbyname exists
13712 set getservbyname d_getsbyname
13715 : see if getservbyport exists
13716 set getservbyport d_getsbyport
13719 : see if getservent exists
13720 set getservent d_getsent
13723 : see if getservbyname_r exists
13724 set getservbyname_r d_getservbyname_r
13726 case "$d_getservbyname_r" in
13728 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13729 case "$d_getservbyname_r_proto:$usethreads" in
13730 ":define") d_getservbyname_r_proto=define
13731 set d_getservbyname_r_proto getservbyname_r $hdrs
13735 case "$d_getservbyname_r_proto" in
13737 case "$getservbyname_r_proto" in
13738 ''|0) try='int getservbyname_r(const char*, const char*, struct servent*, char*, size_t, struct servent**);'
13739 ./protochk "extern $try" $hdrs && getservbyname_r_proto=I_CCSBWR ;;
13741 case "$getservbyname_r_proto" in
13742 ''|0) try='struct servent* getservbyname_r(const char*, const char*, struct servent*, char*, int);'
13743 ./protochk "extern $try" $hdrs && getservbyname_r_proto=S_CCSBI ;;
13745 case "$getservbyname_r_proto" in
13746 ''|0) try='int getservbyname_r(const char*, const char*, struct servent*, struct servent_data*);'
13747 ./protochk "extern $try" $hdrs && getservbyname_r_proto=I_CCSD ;;
13749 case "$getservbyname_r_proto" in
13750 ''|0) d_getservbyname_r=undef
13751 getservbyname_r_proto=0
13752 echo "Disabling getservbyname_r, cannot determine prototype." >&4 ;;
13753 * ) case "$getservbyname_r_proto" in
13754 REENTRANT_PROTO*) ;;
13755 *) getservbyname_r_proto="REENTRANT_PROTO_$getservbyname_r_proto" ;;
13757 echo "Prototype: $try" ;;
13760 *) case "$usethreads" in
13761 define) echo "getservbyname_r has no prototype, not using it." >&4 ;;
13763 d_getservbyname_r=undef
13764 getservbyname_r_proto=0
13768 *) getservbyname_r_proto=0
13772 : see if getservbyport_r exists
13773 set getservbyport_r d_getservbyport_r
13775 case "$d_getservbyport_r" in
13777 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13778 case "$d_getservbyport_r_proto:$usethreads" in
13779 ":define") d_getservbyport_r_proto=define
13780 set d_getservbyport_r_proto getservbyport_r $hdrs
13784 case "$d_getservbyport_r_proto" in
13786 case "$getservbyport_r_proto" in
13787 ''|0) try='int getservbyport_r(int, const char*, struct servent*, char*, size_t, struct servent**);'
13788 ./protochk "extern $try" $hdrs && getservbyport_r_proto=I_ICSBWR ;;
13790 case "$getservbyport_r_proto" in
13791 ''|0) try='struct servent* getservbyport_r(int, const char*, struct servent*, char*, int);'
13792 ./protochk "extern $try" $hdrs && getservbyport_r_proto=S_ICSBI ;;
13794 case "$getservbyport_r_proto" in
13795 ''|0) try='int getservbyport_r(int, const char*, struct servent*, struct servent_data*);'
13796 ./protochk "extern $try" $hdrs && getservbyport_r_proto=I_ICSD ;;
13798 case "$getservbyport_r_proto" in
13799 ''|0) d_getservbyport_r=undef
13800 getservbyport_r_proto=0
13801 echo "Disabling getservbyport_r, cannot determine prototype." >&4 ;;
13802 * ) case "$getservbyport_r_proto" in
13803 REENTRANT_PROTO*) ;;
13804 *) getservbyport_r_proto="REENTRANT_PROTO_$getservbyport_r_proto" ;;
13806 echo "Prototype: $try" ;;
13809 *) case "$usethreads" in
13810 define) echo "getservbyport_r has no prototype, not using it." >&4 ;;
13812 d_getservbyport_r=undef
13813 getservbyport_r_proto=0
13817 *) getservbyport_r_proto=0
13821 : see if getservent_r exists
13822 set getservent_r d_getservent_r
13824 case "$d_getservent_r" in
13826 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13827 case "$d_getservent_r_proto:$usethreads" in
13828 ":define") d_getservent_r_proto=define
13829 set d_getservent_r_proto getservent_r $hdrs
13833 case "$d_getservent_r_proto" in
13835 case "$getservent_r_proto" in
13836 ''|0) try='int getservent_r(struct servent*, char*, size_t, struct servent**);'
13837 ./protochk "extern $try" $hdrs && getservent_r_proto=I_SBWR ;;
13839 case "$getservent_r_proto" in
13840 ''|0) try='int getservent_r(struct servent*, char*, int);'
13841 ./protochk "extern $try" $hdrs && getservent_r_proto=I_SBI ;;
13843 case "$getservent_r_proto" in
13844 ''|0) try='struct servent* getservent_r(struct servent*, char*, int);'
13845 ./protochk "extern $try" $hdrs && getservent_r_proto=S_SBI ;;
13847 case "$getservent_r_proto" in
13848 ''|0) try='int getservent_r(struct servent*, struct servent_data*);'
13849 ./protochk "extern $try" $hdrs && getservent_r_proto=I_SD ;;
13851 case "$getservent_r_proto" in
13852 ''|0) d_getservent_r=undef
13853 getservent_r_proto=0
13854 echo "Disabling getservent_r, cannot determine prototype." >&4 ;;
13855 * ) case "$getservent_r_proto" in
13856 REENTRANT_PROTO*) ;;
13857 *) getservent_r_proto="REENTRANT_PROTO_$getservent_r_proto" ;;
13859 echo "Prototype: $try" ;;
13862 *) case "$usethreads" in
13863 define) echo "getservent_r has no prototype, not using it." >&4 ;;
13865 d_getservent_r=undef
13866 getservent_r_proto=0
13870 *) getservent_r_proto=0
13874 : see if prototypes for various getservxxx netdb.h functions are available
13876 set d_getservprotos getservent $i_netdb netdb.h
13879 : see if getspnam exists
13880 set getspnam d_getspnam
13883 : see if this is a shadow.h system
13884 set shadow.h i_shadow
13887 : see if getspnam_r exists
13888 set getspnam_r d_getspnam_r
13890 case "$d_getspnam_r" in
13892 hdrs="$i_systypes sys/types.h define stdio.h $i_shadow shadow.h"
13893 case "$d_getspnam_r_proto:$usethreads" in
13894 ":define") d_getspnam_r_proto=define
13895 set d_getspnam_r_proto getspnam_r $hdrs
13899 case "$d_getspnam_r_proto" in
13901 case "$getspnam_r_proto" in
13902 ''|0) try='int getspnam_r(const char*, struct spwd*, char*, size_t, struct spwd**);'
13903 ./protochk "extern $try" $hdrs && getspnam_r_proto=I_CSBWR ;;
13905 case "$getspnam_r_proto" in
13906 ''|0) try='struct spwd* getspnam_r(const char*, struct spwd*, char*, int);'
13907 ./protochk "extern $try" $hdrs && getspnam_r_proto=S_CSBI ;;
13909 case "$getspnam_r_proto" in
13910 ''|0) d_getspnam_r=undef
13912 echo "Disabling getspnam_r, cannot determine prototype." >&4 ;;
13913 * ) case "$getspnam_r_proto" in
13914 REENTRANT_PROTO*) ;;
13915 *) getspnam_r_proto="REENTRANT_PROTO_$getspnam_r_proto" ;;
13917 echo "Prototype: $try" ;;
13920 *) case "$usethreads" in
13921 define) echo "getspnam_r has no prototype, not using it." >&4 ;;
13928 *) getspnam_r_proto=0
13932 : see if gettimeofday or ftime exists
13933 set gettimeofday d_gettimeod
13935 case "$d_gettimeod" in
13941 val="$undef"; set d_ftime; eval $setvar
13944 case "$d_gettimeod$d_ftime" in
13947 echo 'No ftime() nor gettimeofday() -- timing may be less accurate.' >&4
13951 : see if gmtime_r exists
13952 set gmtime_r d_gmtime_r
13954 case "$d_gmtime_r" in
13956 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
13957 case "$d_gmtime_r_proto:$usethreads" in
13958 ":define") d_gmtime_r_proto=define
13959 set d_gmtime_r_proto gmtime_r $hdrs
13963 case "$d_gmtime_r_proto" in
13965 case "$gmtime_r_proto" in
13966 ''|0) try='struct tm* gmtime_r(const time_t*, struct tm*);'
13967 ./protochk "extern $try" $hdrs && gmtime_r_proto=S_TS ;;
13969 case "$gmtime_r_proto" in
13970 ''|0) try='int gmtime_r(const time_t*, struct tm*);'
13971 ./protochk "extern $try" $hdrs && gmtime_r_proto=I_TS ;;
13973 case "$gmtime_r_proto" in
13974 ''|0) d_gmtime_r=undef
13976 echo "Disabling gmtime_r, cannot determine prototype." >&4 ;;
13977 * ) case "$gmtime_r_proto" in
13978 REENTRANT_PROTO*) ;;
13979 *) gmtime_r_proto="REENTRANT_PROTO_$gmtime_r_proto" ;;
13981 echo "Prototype: $try" ;;
13984 *) case "$usethreads" in
13985 define) echo "gmtime_r has no prototype, not using it." >&4 ;;
13992 *) gmtime_r_proto=0
13996 : see if hasmntopt exists
13997 set hasmntopt d_hasmntopt
14000 : see if this is a netinet/in.h or sys/in.h system
14001 set netinet/in.h i_niin sys/in.h i_sysin
14004 : see if arpa/inet.h has to be included
14005 set arpa/inet.h i_arpainet
14008 : see if htonl --and friends-- exists
14013 : Maybe they are macros.
14016 $cat >htonl.c <<EOM
14018 #include <sys/types.h>
14019 #$i_niin I_NETINET_IN
14021 #$i_arpainet I_ARPA_INET
14022 #ifdef I_NETINET_IN
14023 #include <netinet/in.h>
14026 #include <sys/in.h>
14029 #include <arpa/inet.h>
14032 printf("Defined as a macro.");
14035 $cppstdin $cppflags $cppminus < htonl.c >htonl.E 2>/dev/null
14036 if $contains 'Defined as a macro' htonl.E >/dev/null 2>&1; then
14038 echo "But it seems to be defined as a macro." >&4
14046 : see if ilogbl exists
14047 set ilogbl d_ilogbl
14052 if set index val -f; eval $csym; $val; then
14053 if set strchr val -f d_strchr; eval $csym; $val; then
14054 if $contains strchr "$strings" >/dev/null 2>&1 ; then
14057 echo "strchr() found." >&4
14061 echo "index() found." >&4
14066 echo "index() found." >&4
14069 if set strchr val -f d_strchr; eval $csym; $val; then
14072 echo "strchr() found." >&4
14074 echo "No index() or strchr() found!" >&4
14079 set d_strchr; eval $setvar
14081 set d_index; eval $setvar
14083 : check whether inet_aton exists
14084 set inet_aton d_inetaton
14089 $cat >isascii.c <<EOCP
14092 #$i_stdlib I_STDLIB
14094 #include <stdlib.h>
14105 if eval $compile; then
14106 echo "isascii() found." >&4
14109 echo "isascii() NOT found." >&4
14116 : see if isfinite exists
14117 set isfinite d_isfinite
14120 : see if isinf exists
14124 : see if isnan exists
14128 : see if isnanl exists
14129 set isnanl d_isnanl
14132 : see if killpg exists
14133 set killpg d_killpg
14136 : see if lchown exists
14138 $cat > try.c <<'EOCP'
14139 /* System header to define __stub macros and hopefully few prototypes,
14140 which can conflict with char lchown(); below. */
14141 #include <assert.h>
14142 /* Override any gcc2 internal prototype to avoid an error. */
14143 /* We use char because int might match the return type of a gcc2
14144 builtin and then its argument prototype would still apply. */
14147 /* The GNU C library defines this for functions which it implements
14148 to always fail with ENOSYS. Some functions are actually named
14149 something starting with __ and the normal name is an alias. */
14150 #if defined (__stub_lchown) || defined (__stub___lchown)
14158 if eval $compile; then
14159 $echo "lchown() found." >&4
14162 $echo "lchown() NOT found." >&4
14168 : See if number of significant digits in a double precision number is known
14170 $cat >ldbl_dig.c <<EOM
14171 #$i_limits I_LIMITS
14174 #include <limits.h>
14180 printf("Contains LDBL_DIG");
14183 $cppstdin $cppflags $cppminus < ldbl_dig.c >ldbl_dig.E 2>/dev/null
14184 if $contains 'LDBL_DIG' ldbl_dig.E >/dev/null 2>&1; then
14185 echo "LDBL_DIG found." >&4
14188 echo "LDBL_DIG NOT found." >&4
14195 : see if this is a math.h system
14199 d_libm_lib_version="$undef"
14202 : check to see if math.h defines _LIB_VERSION
14204 echo "Checking to see if your libm supports _LIB_VERSION..." >&4
14206 #include <unistd.h>
14208 int main (int argc, char *argv[])
14210 printf ("%d\n", _LIB_VERSION);
14215 if eval $compile; then
14217 echo "Yes, it does ($foo)" >&4
14218 d_libm_lib_version="$define"
14220 echo "No, it does not (probably harmless)\n" >&4
14222 $rm -f try.* try core core.try.*
14227 : see if link exists
14231 : see if localtime_r exists
14232 set localtime_r d_localtime_r
14234 case "$d_localtime_r" in
14236 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
14237 case "$d_localtime_r_proto:$usethreads" in
14238 ":define") d_localtime_r_proto=define
14239 set d_localtime_r_proto localtime_r $hdrs
14243 case "$d_localtime_r_proto" in
14245 case "$localtime_r_proto" in
14246 ''|0) try='struct tm* localtime_r(const time_t*, struct tm*);'
14247 ./protochk "extern $try" $hdrs && localtime_r_proto=S_TS ;;
14249 case "$localtime_r_proto" in
14250 ''|0) try='int localtime_r(const time_t*, struct tm*);'
14251 ./protochk "extern $try" $hdrs && localtime_r_proto=I_TS ;;
14253 case "$localtime_r_proto" in
14254 ''|0) d_localtime_r=undef
14255 localtime_r_proto=0
14256 echo "Disabling localtime_r, cannot determine prototype." >&4 ;;
14257 * ) case "$localtime_r_proto" in
14258 REENTRANT_PROTO*) ;;
14259 *) localtime_r_proto="REENTRANT_PROTO_$localtime_r_proto" ;;
14261 echo "Prototype: $try" ;;
14264 *) case "$usethreads" in
14265 define) echo "localtime_r has no prototype, not using it." >&4 ;;
14267 d_localtime_r=undef
14268 localtime_r_proto=0
14272 *) localtime_r_proto=0
14276 : see if localeconv exists
14277 set localeconv d_locconv
14280 : see if lockf exists
14284 : see if prototype for lseek is available
14286 set d_lseekproto lseek $i_systypes sys/types.h $i_unistd unistd.h
14289 : see if lstat exists
14293 : see if madvise exists
14294 set madvise d_madvise
14297 : see if malloc_size exists
14298 set malloc_size d_malloc_size
14301 : see if malloc_size_good exists
14302 set malloc_good_size d_malloc_good_size
14305 : see if mblen exists
14309 : see if mbstowcs exists
14310 set mbstowcs d_mbstowcs
14313 : see if mbtowc exists
14314 set mbtowc d_mbtowc
14317 : see if memchr exists
14318 set memchr d_memchr
14321 : see if memcmp exists
14322 set memcmp d_memcmp
14325 : see if memcpy exists
14326 set memcpy d_memcpy
14329 : see if memmove exists
14330 set memmove d_memmove
14333 : see if memset exists
14334 set memset d_memset
14337 : see if mkdir exists
14341 : see if mkdtemp exists
14342 set mkdtemp d_mkdtemp
14345 : see if mkfifo exists
14346 set mkfifo d_mkfifo
14349 : see if mkstemp exists
14350 set mkstemp d_mkstemp
14353 : see if mkstemps exists
14354 set mkstemps d_mkstemps
14357 : see if mktime exists
14358 set mktime d_mktime
14361 : see if this is a sys/mman.h system
14362 set sys/mman.h i_sysmman
14365 : see if mmap exists
14368 : see what shmat returns
14369 : default to something harmless
14371 case "$i_sysmman$d_mmap" in
14373 $cat >mmap.c <<'END'
14374 #include <sys/mman.h>
14377 if $cc $ccflags -c mmap.c >/dev/null 2>&1; then
14382 echo "and it returns ($mmaptype)." >&4
14388 : see if sqrtl exists
14392 : see if scalbnl exists
14393 set scalbnl d_scalbnl
14396 : see if modfl exists
14400 : see if prototype for modfl is available
14402 set d_modflproto modfl $i_math math.h
14405 d_modfl_pow32_bug="$undef"
14407 case "$d_longdbl$d_modfl" in
14410 Checking to see whether your modfl() is okay for large values...
14416 if $test "X$d_modflproto" != "X$define"; then
14417 $cat >>try.c <<EOCP
14418 /* Sigh. many current glibcs provide the function, but do not prototype it. */
14419 long double modfl (long double, long double *);
14422 $cat >>try.c <<EOCP
14424 long double nv = 4294967303.15;
14430 printf(" %"$sPRIfldbl" %"$sPRIfldbl" %"$sPRIfldbl"\n", nv, v, w);
14434 case "$osname:$gccversion" in
14435 aix:) saveccflags="$ccflags"
14436 ccflags="$ccflags -qlongdouble" ;; # to avoid core dump
14439 if eval $compile; then
14442 *" 4294967303.150000 1.150000 4294967302.000000")
14443 echo >&4 "Your modfl() is broken for large values."
14444 d_modfl_pow32_bug="$define"
14446 glibc) echo >&4 "You should upgrade your glibc to at least 2.2.2 to get a fixed modfl()."
14450 *" 4294967303.150000 0.150000 4294967303.000000")
14451 echo >&4 "Your modfl() seems okay for large values."
14453 *) echo >&4 "I don't understand your modfl() at all."
14457 $rm -f try.* try core core.try.*
14459 echo "I cannot figure out whether your modfl() is okay, assuming it isn't."
14462 case "$osname:$gccversion" in
14463 aix:) ccflags="$saveccflags" ;; # restore
14468 if $test "$uselongdouble" = "$define"; then
14470 if $test "$d_sqrtl" != "$define"; then
14471 message="$message sqrtl"
14473 if $test "$d_modfl" != "$define"; then
14474 if $test "$d_aintl:$d_copysignl" = "$define:$define"; then
14475 echo "You have both aintl and copysignl, so I can emulate modfl."
14477 message="$message modfl"
14480 if $test "$d_frexpl" != "$define"; then
14481 if $test "$d_ilogbl:$d_scalbnl" = "$define:$define"; then
14482 echo "You have both ilogbl and scalbnl, so I can emulate frexpl."
14484 message="$message frexpl"
14488 if $test "$message" != ""; then
14491 *** You requested the use of long doubles but you do not seem to have
14492 *** the following mathematical functions needed for long double support:
14494 *** Please rerun Configure without -Duselongdouble and/or -Dusemorebits.
14495 *** Cannot continue, aborting.
14503 : see if mprotect exists
14504 set mprotect d_mprotect
14507 : see if msgctl exists
14508 set msgctl d_msgctl
14511 : see if msgget exists
14512 set msgget d_msgget
14515 : see if msgsnd exists
14516 set msgsnd d_msgsnd
14519 : see if msgrcv exists
14520 set msgrcv d_msgrcv
14523 : see how much of the 'msg*(2)' library is present.
14526 case "$d_msgctl$d_msgget$d_msgsnd$d_msgrcv" in
14527 *"$undef"*) h_msg=false;;
14531 case "`ipcs 2>&1`" in
14532 "SVID messages"*"not configured"*)
14533 echo "Your $osname does not have the msg*(2) configured." >&4
14536 set msgctl d_msgctl
14538 set msgget d_msgget
14540 set msgsnd d_msgsnd
14542 set msgrcv d_msgrcv
14548 : we could also check for sys/ipc.h ...
14549 if $h_msg && $test `./findhdr sys/msg.h`; then
14550 echo "You have the full msg*(2) library." >&4
14553 echo "You don't have the full msg*(2) library." >&4
14561 echo "Checking to see if your system supports struct msghdr..." >&4
14562 set d_msghdr_s msghdr $i_systypes sys/types.h $d_socket sys/socket.h $i_sysuio sys/uio.h
14564 case "$d_msghdr_s" in
14565 "$define") echo "Yes, it does." ;;
14566 *) echo "No, it doesn't." ;;
14570 : see if msync exists
14574 : see if munmap exists
14575 set munmap d_munmap
14578 : see if nice exists
14582 : see if this is a langinfo.h system
14583 set langinfo.h i_langinfo
14586 : see if nl_langinfo exists
14587 set nl_langinfo d_nl_langinfo
14590 : check for length of character
14592 case "$charsize" in
14594 echo "Checking to see how big your characters are (hey, you never know)..." >&4
14597 #$i_stdlib I_STDLIB
14599 #include <stdlib.h>
14603 printf("%d\n", (int)sizeof(char));
14608 if eval $compile_ok; then
14612 echo "(I can't seem to compile the test program. Guessing...)"
14619 rp="What is the size of a character (in bytes)?"
14624 : check for volatile keyword
14626 echo 'Checking to see if your C compiler knows about "volatile"...' >&4
14627 $cat >try.c <<'EOCP'
14630 typedef struct _goo_struct goo_struct;
14631 goo_struct * volatile goo = ((goo_struct *)0);
14632 struct _goo_struct {
14637 typedef unsigned short foo_t;
14638 char *volatile foo;
14640 volatile foo_t blech;
14644 if $cc -c $ccflags try.c >/dev/null 2>&1 ; then
14646 echo "Yup, it does."
14649 echo "Nope, it doesn't."
14657 $echo "Choosing the C types to be used for Perl's internal types..." >&4
14659 case "$use64bitint:$d_quad:$quadtype" in
14662 uvtype="$uquadtype"
14667 uvtype="unsigned long"
14673 case "$uselongdouble:$d_longdbl" in
14675 nvtype="long double"
14676 nvsize=$longdblsize
14683 $echo "(IV will be "$ivtype", $ivsize bytes)"
14684 $echo "(UV will be "$uvtype", $uvsize bytes)"
14685 $echo "(NV will be "$nvtype", $nvsize bytes)"
14688 #$i_inttypes I_INTTYPES
14690 #include <inttypes.h>
14695 int8_t i = INT8_MAX;
14696 uint8_t u = UINT8_MAX;
14697 printf("int8_t\n");
14700 int16_t i = INT16_MAX;
14701 uint16_t i = UINT16_MAX;
14702 printf("int16_t\n");
14705 int32_t i = INT32_MAX;
14706 uint32_t u = UINT32_MAX;
14707 printf("int32_t\n");
14713 '') case "$charsize" in
14715 u8type="unsigned char"
14724 if eval $compile; then
14725 case "`$run ./try`" in
14726 int8_t) i8type=int8_t
14736 '') if $test $charsize -ge 1; then
14738 u8type="unsigned char"
14746 '') case "$shortsize" in
14748 u16type="unsigned short"
14756 '') set try -DINT16
14757 if eval $compile; then
14758 case "`$run ./try`" in
14770 '') if $test $shortsize -ge 2; then
14772 u16type="unsigned short"
14780 '') case "$longsize" in
14782 u32type="unsigned long"
14786 *) case "$intsize" in
14788 u32type="unsigned int"
14798 '') set try -DINT32
14799 if eval $compile; then
14800 case "`$run ./try`" in
14812 '') if $test $intsize -ge 4; then
14814 u32type="unsigned int"
14822 '') case "$d_quad:$quadtype" in
14824 i64type="$quadtype"
14825 u64type="$uquadtype"
14833 $echo "Checking how many bits of your UVs your NVs can preserve..." >&4
14834 : volatile so that the compiler has to store it out to memory.
14835 if test X"$d_volatile" = X"$define"; then
14840 #$i_stdlib I_STDLIB
14842 #include <stdlib.h>
14844 #include <sys/types.h>
14845 #include <signal.h>
14847 $volatile int bletched = 0;
14848 $signal_t blech(s) int s; { bletched = 1; }
14853 int n = 8 * $uvsize;
14856 signal(SIGFPE, blech);
14859 for (i = 0; i < n; i++) {
14860 u = u << 1 | ($uvtype)1;
14862 if (($uvtype)d != u)
14866 d = ($nvtype)(u - 1);
14867 if (($uvtype)d != (u - 1))
14875 printf("%d\n", ((i == n) ? -n : i));
14881 d_nv_preserves_uv="$undef"
14882 if eval $compile; then
14883 nv_preserves_uv_bits="`$run ./try`"
14885 case "$nv_preserves_uv_bits" in
14887 nv_preserves_uv_bits=`expr 0 - $nv_preserves_uv_bits`
14888 $echo "Your NVs can preserve all $nv_preserves_uv_bits bits of your UVs." 2>&1
14889 d_nv_preserves_uv="$define"
14891 [1-9]*) $echo "Your NVs can preserve only $nv_preserves_uv_bits bits of your UVs." 2>&1
14892 d_nv_preserves_uv="$undef" ;;
14893 *) $echo "Can't figure out how many bits your NVs preserve." 2>&1
14894 nv_preserves_uv_bits="$undef" ;;
14899 $echo "Checking whether NV 0.0 is all bits zero in memory..." >&4
14900 : volatile so that the compiler has to store it out to memory.
14901 if test X"$d_volatile" = X"$define"; then
14906 #$i_stdlib I_STDLIB
14908 #include <stdlib.h>
14910 #$i_string I_STRING
14912 # include <string.h>
14914 # include <strings.h>
14916 #include <sys/types.h>
14917 #include <signal.h>
14919 $volatile int bletched = 0;
14920 $signal_t blech(s) int s; { bletched = 1; }
14923 int checkit($nvtype d, char *where) {
14924 unsigned char *p = (char *)&d;
14925 unsigned char *end = p + sizeof(d);
14935 printf("No - %s: 0x", where);
14937 printf ("%02X", *p++);
14942 int main(int argc, char **argv) {
14945 fail += checkit(d, "0.0");
14947 /* The compiler shouldn't be assuming that bletched is 0 */
14950 fail += checkit(d, "bleched");
14953 signal(SIGFPE, blech);
14956 /* Paranoia - the compiler should have no way of knowing that ANSI says
14957 that argv[argc] will always be NULL. Actually, if it did assume this it
14958 would be buggy, as this is C and main() can be called from elsewhere in
14960 d = argv[argc] ? 1 : 0;
14963 printf("Odd argv[argc]=%p, d=%g\n", argv[argc], d);
14966 fail += checkit(d, "ternary");
14968 memset(&d, sizeof(d), argv[argc] ? 1 : 0);
14971 printf("No - memset doesn't give 0.0\n");
14972 /* This might just blow up: */
14973 printf("(gives %g)\n", d);
14979 printf("No - something bleched\n");
14984 printf("No - %d fail(s)\n", fail);
14993 d_nv_zero_is_allbits_zero="$undef"
14994 if eval $compile; then
15000 0.0 is represented as all bits zero in memory
15002 d_nv_zero_is_allbits_zero="$define"
15005 0.0 is not represented as all bits zero in memory
15007 d_nv_zero_is_allbits_zero="$undef"
15012 0.0 is not represented as all bits zero in memory
15014 d_nv_zero_is_allbits_zero="$undef"
15022 : check for off64_t
15024 echo "Checking to see if you have off64_t..." >&4
15026 #include <sys/types.h>
15027 #include <unistd.h>
15028 int main() { off64_t x = 7; }
15031 if eval $compile; then
15033 echo "You have off64_t."
15036 echo "You do not have off64_t."
15037 case "$lseeksize" in
15038 8) echo "(Your off_t is 64 bits, so you could use that.)" ;;
15045 : how to create joinable pthreads
15046 if test "X$usethreads" = "X$define" -a "X$i_pthread" = "X$define"; then
15048 echo "Checking what constant to use for creating joinable pthreads..." >&4
15049 $cat >try.c <<'EOCP'
15050 #include <pthread.h>
15052 int detachstate = JOINABLE;
15055 set try -DJOINABLE=PTHREAD_CREATE_JOINABLE
15056 if eval $compile; then
15057 echo "You seem to use PTHREAD_CREATE_JOINABLE." >&4
15058 val="$undef" # Yes, undef.
15059 set d_old_pthread_create_joinable
15062 set old_pthread_create_joinable
15065 set try -DJOINABLE=PTHREAD_CREATE_UNDETACHED
15066 if eval $compile; then
15067 echo "You seem to use PTHREAD_CREATE_UNDETACHED." >&4
15069 set d_old_pthread_create_joinable
15071 val=PTHREAD_CREATE_UNDETACHED
15072 set old_pthread_create_joinable
15075 set try -DJOINABLE=__UNDETACHED
15076 if eval $compile; then
15077 echo "You seem to use __UNDETACHED." >&4
15079 set d_old_pthread_create_joinable
15082 set old_pthread_create_joinable
15085 echo "Egads, nothing obvious found. Guessing that you use 0." >&4
15087 set d_old_pthread_create_joinable
15090 set old_pthread_create_joinable
15097 d_old_pthread_create_joinable="$undef"
15098 old_pthread_create_joinable=""
15101 : see if pause exists
15105 : see if pipe exists
15109 : see if poll exists
15113 : see if readlink exists
15114 set readlink d_readlink
15120 case "$d_readlink" in
15122 if $issymlink /proc/self/exe ; then
15123 $ls -l /proc/self/exe > reflect
15124 if $contains /`basename $ls` reflect >/dev/null 2>&1; then
15125 echo "You have Linux-like /proc/self/exe."
15126 procselfexe='"/proc/self/exe"'
15130 if $issymlink /proc/curproc/file ; then
15131 $ls -l /proc/curproc/file > reflect
15132 if $contains /`basename $ls` reflect >/dev/null 2>&1; then
15133 echo "You have BSD-like /proc/curproc/file."
15134 procselfexe='"/proc/curproc/file"'
15144 : see whether the pthread_atfork exists
15146 #include <pthread.h>
15149 #ifdef PTHREAD_ATFORK
15150 pthread_atfork(NULL,NULL,NULL);
15155 : see if pthread_atfork exists
15156 set try -DPTHREAD_ATFORK
15157 if eval $compile; then
15162 case "$usethreads" in
15165 $define) echo 'pthread_atfork found.' >&4 ;;
15166 *) echo 'pthread_atfork NOT found.' >&4 ;;
15169 set d_pthread_atfork
15172 : see if pthread_attr_setscope exists
15173 set pthread_attr_setscope d_pthread_attr_setscope
15177 : see whether the various POSIXish _yields exist
15179 #include <pthread.h>
15185 #ifdef PTHREAD_YIELD
15188 #ifdef PTHREAD_YIELD_NULL
15189 pthread_yield(NULL);
15195 : see if sched_yield exists
15196 set try -DSCHED_YIELD
15197 if eval $compile; then
15199 sched_yield='sched_yield()'
15203 case "$usethreads" in
15206 $define) echo 'sched_yield() found.' >&4 ;;
15207 *) echo 'sched_yield() NOT found.' >&4 ;;
15213 : see if pthread_yield exists
15214 set try -DPTHREAD_YIELD
15215 if eval $compile; then
15217 case "$sched_yield" in
15218 '') sched_yield='pthread_yield()' ;;
15221 set try -DPTHREAD_YIELD_NULL
15222 if eval $compile; then
15224 case "$sched_yield" in
15225 '') sched_yield='pthread_yield(NULL)' ;;
15231 case "$usethreads" in
15234 $define) echo 'pthread_yield() found.' >&4 ;;
15235 *) echo 'pthread_yield() NOT found.' >&4 ;;
15239 set d_pthread_yield
15242 case "$sched_yield" in
15243 '') sched_yield=undef ;;
15248 : see if random_r exists
15249 set random_r d_random_r
15251 case "$d_random_r" in
15253 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
15254 case "$d_random_r_proto:$usethreads" in
15255 ":define") d_random_r_proto=define
15256 set d_random_r_proto random_r $hdrs
15260 case "$d_random_r_proto" in
15262 case "$random_r_proto" in
15263 ''|0) try='int random_r(int*, struct random_data*);'
15264 ./protochk "extern $try" $hdrs && random_r_proto=I_iS ;;
15266 case "$random_r_proto" in
15267 ''|0) try='int random_r(long*, struct random_data*);'
15268 ./protochk "extern $try" $hdrs && random_r_proto=I_lS ;;
15270 case "$random_r_proto" in
15271 ''|0) try='int random_r(struct random_data*, int32_t*);'
15272 ./protochk "extern $try" $hdrs && random_r_proto=I_St ;;
15274 case "$random_r_proto" in
15275 ''|0) d_random_r=undef
15277 echo "Disabling random_r, cannot determine prototype." >&4 ;;
15278 * ) case "$random_r_proto" in
15279 REENTRANT_PROTO*) ;;
15280 *) random_r_proto="REENTRANT_PROTO_$random_r_proto" ;;
15282 echo "Prototype: $try" ;;
15285 *) case "$usethreads" in
15286 define) echo "random_r has no prototype, not using it." >&4 ;;
15293 *) random_r_proto=0
15297 : see if readdir and friends exist
15298 set readdir d_readdir
15300 set seekdir d_seekdir
15302 set telldir d_telldir
15304 set rewinddir d_rewinddir
15307 : see if readdir64_r exists
15308 set readdir64_r d_readdir64_r
15310 case "$d_readdir64_r" in
15312 hdrs="$i_systypes sys/types.h define stdio.h $i_dirent dirent.h"
15313 case "$d_readdir64_r_proto:$usethreads" in
15314 ":define") d_readdir64_r_proto=define
15315 set d_readdir64_r_proto readdir64_r $hdrs
15319 case "$d_readdir64_r_proto" in
15321 case "$readdir64_r_proto" in
15322 ''|0) try='int readdir64_r(DIR*, struct dirent64*, struct dirent64**);'
15323 ./protochk "extern $try" $hdrs && readdir64_r_proto=I_TSR ;;
15325 case "$readdir64_r_proto" in
15326 ''|0) try='int readdir64_r(DIR*, struct dirent64*);'
15327 ./protochk "extern $try" $hdrs && readdir64_r_proto=I_TS ;;
15329 case "$readdir64_r_proto" in
15330 ''|0) d_readdir64_r=undef
15331 readdir64_r_proto=0
15332 echo "Disabling readdir64_r, cannot determine prototype." >&4 ;;
15333 * ) case "$readdir64_r_proto" in
15334 REENTRANT_PROTO*) ;;
15335 *) readdir64_r_proto="REENTRANT_PROTO_$readdir64_r_proto" ;;
15337 echo "Prototype: $try" ;;
15340 *) case "$usethreads" in
15341 define) echo "readdir64_r has no prototype, not using it." >&4 ;;
15343 d_readdir64_r=undef
15344 readdir64_r_proto=0
15348 *) readdir64_r_proto=0
15352 : see if readdir_r exists
15353 set readdir_r d_readdir_r
15355 case "$d_readdir_r" in
15357 hdrs="$i_systypes sys/types.h define stdio.h $i_dirent dirent.h"
15358 case "$d_readdir_r_proto:$usethreads" in
15359 ":define") d_readdir_r_proto=define
15360 set d_readdir_r_proto readdir_r $hdrs
15364 case "$d_readdir_r_proto" in
15366 case "$readdir_r_proto" in
15367 ''|0) try='int readdir_r(DIR*, struct dirent*, struct dirent**);'
15368 ./protochk "extern $try" $hdrs && readdir_r_proto=I_TSR ;;
15370 case "$readdir_r_proto" in
15371 ''|0) try='int readdir_r(DIR*, struct dirent*);'
15372 ./protochk "extern $try" $hdrs && readdir_r_proto=I_TS ;;
15374 case "$readdir_r_proto" in
15375 ''|0) d_readdir_r=undef
15377 echo "Disabling readdir_r, cannot determine prototype." >&4 ;;
15378 * ) case "$readdir_r_proto" in
15379 REENTRANT_PROTO*) ;;
15380 *) readdir_r_proto="REENTRANT_PROTO_$readdir_r_proto" ;;
15382 echo "Prototype: $try" ;;
15385 *) case "$usethreads" in
15386 define) echo "readdir_r has no prototype, not using it." >&4 ;;
15393 *) readdir_r_proto=0
15397 : see if readv exists
15401 : see if recvmsg exists
15402 set recvmsg d_recvmsg
15405 : see if rename exists
15406 set rename d_rename
15409 : see if rmdir exists
15413 : see if memory.h is available.
15418 : See if it conflicts with string.h
15424 $cppstdin $cppflags $cppminus < $strings > mem.h
15425 if $contains 'memcpy' mem.h >/dev/null 2>&1; then
15427 echo "We won't be including <memory.h>."
15437 : can bcopy handle overlapping blocks?
15440 case "$d_memmove" in
15441 "$define") echo "I'll use memmove() instead of bcopy() for overlapping copies." ;;
15442 *) case "$d_bcopy" in
15444 echo "Checking to see if bcopy() can do overlapping copies..." >&4
15446 #$i_memory I_MEMORY
15447 #$i_stdlib I_STDLIB
15448 #$i_string I_STRING
15449 #$i_unistd I_UNISTD
15451 $cat >>try.c <<'EOCP'
15454 # include <memory.h>
15457 # include <stdlib.h>
15460 # include <string.h>
15462 # include <strings.h>
15465 # include <unistd.h> /* Needed for NetBSD */
15469 char buf[128], abc[128];
15475 /* Copy "abcde..." string to char abc[] so that gcc doesn't
15476 try to store the string in read-only memory. */
15477 bcopy("abcdefghijklmnopqrstuvwxyz0123456789", abc, 36);
15479 for (align = 7; align >= 0; align--) {
15480 for (len = 36; len; len--) {
15482 bcopy(abc, b, len);
15483 for (off = 1; off <= len; off++) {
15484 bcopy(b, b+off, len);
15485 bcopy(b+off, b, len);
15486 if (bcmp(b, abc, len))
15495 if eval $compile_ok; then
15496 if ./try 2>/dev/null; then
15497 echo "Yes, it can."
15500 echo "It can't, sorry."
15503 echo "(I can't compile the test program, so we'll assume not...)"
15507 $rm -f try.* try core
15513 : can memcpy handle overlapping blocks?
15516 case "$d_memmove" in
15517 "$define") echo "I'll use memmove() instead of memcpy() for overlapping copies." ;;
15518 *) case "$d_memcpy" in
15520 echo "Checking to see if memcpy() can do overlapping copies..." >&4
15522 #$i_memory I_MEMORY
15523 #$i_stdlib I_STDLIB
15524 #$i_string I_STRING
15525 #$i_unistd I_UNISTD
15527 $cat >>try.c <<'EOCP'
15530 # include <memory.h>
15533 # include <stdlib.h>
15536 # include <string.h>
15538 # include <strings.h>
15541 # include <unistd.h> /* Needed for NetBSD */
15545 char buf[128], abc[128];
15551 /* Copy "abcde..." string to char abc[] so that gcc doesn't
15552 try to store the string in read-only memory. */
15553 memcpy(abc, "abcdefghijklmnopqrstuvwxyz0123456789", 36);
15555 for (align = 7; align >= 0; align--) {
15556 for (len = 36; len; len--) {
15558 memcpy(b, abc, len);
15559 for (off = 1; off <= len; off++) {
15560 memcpy(b+off, b, len);
15561 memcpy(b, b+off, len);
15562 if (memcmp(b, abc, len))
15571 if eval $compile_ok; then
15572 if ./try 2>/dev/null; then
15573 echo "Yes, it can."
15576 echo "It can't, sorry."
15579 echo "(I can't compile the test program, so we'll assume not...)"
15583 $rm -f try.* try core
15589 : can memcmp be trusted to compare relative magnitude?
15591 case "$d_memcmp" in
15594 echo "Checking if your memcmp() can compare relative magnitude..." >&4
15596 #$i_memory I_MEMORY
15597 #$i_stdlib I_STDLIB
15598 #$i_string I_STRING
15599 #$i_unistd I_UNISTD
15601 $cat >>try.c <<'EOCP'
15604 # include <memory.h>
15607 # include <stdlib.h>
15610 # include <string.h>
15612 # include <strings.h>
15615 # include <unistd.h> /* Needed for NetBSD */
15621 if ((a < b) && memcmp(&a, &b, 1) < 0)
15627 if eval $compile_ok; then
15628 if $run ./try 2>/dev/null; then
15629 echo "Yes, it can."
15632 echo "No, it can't (it uses signed chars)."
15635 echo "(I can't compile the test program, so we'll assume not...)"
15639 $rm -f try.* try core
15643 : see if prototype for sbrk is available
15645 set d_sbrkproto sbrk $i_unistd unistd.h
15648 : see if select exists
15649 set select d_select
15652 : see if semctl exists
15653 set semctl d_semctl
15656 : see if semget exists
15657 set semget d_semget
15660 : see if semop exists
15664 : see how much of the 'sem*(2)' library is present.
15667 case "$d_semctl$d_semget$d_semop" in
15668 *"$undef"*) h_sem=false;;
15672 case "`ipcs 2>&1`" in
15673 "SVID messages"*"not configured"*)
15674 echo "Your $osname does not have the sem*(2) configured." >&4
15677 set semctl d_semctl
15679 set semget d_semget
15687 : we could also check for sys/ipc.h ...
15688 if $h_sem && $test `./findhdr sys/sem.h`; then
15689 echo "You have the full sem*(2) library." >&4
15692 echo "You don't have the full sem*(2) library." >&4
15698 : see whether sys/sem.h defines union semun
15700 $cat > try.c <<'END'
15701 #include <sys/types.h>
15702 #include <sys/ipc.h>
15703 #include <sys/sem.h>
15704 int main () { union semun semun; semun.buf = 0; }
15707 if eval $compile; then
15708 echo "You have union semun in <sys/sem.h>." >&4
15711 echo "You do not have union semun in <sys/sem.h>." >&4
15718 : see how to do semctl IPC_STAT
15725 # define S_IRUSR S_IREAD
15726 # define S_IWUSR S_IWRITE
15727 # define S_IXUSR S_IEXEC
15729 # define S_IRUSR 0400
15730 # define S_IWUSR 0200
15731 # define S_IXUSR 0100
15733 # define S_IRGRP (S_IRUSR>>3)
15734 # define S_IWGRP (S_IWUSR>>3)
15735 # define S_IXGRP (S_IXUSR>>3)
15736 # define S_IROTH (S_IRUSR>>6)
15737 # define S_IWOTH (S_IWUSR>>6)
15738 # define S_IXOTH (S_IXUSR>>6)
15741 # define S_IRWXU (S_IRUSR|S_IWUSR|S_IXUSR)
15742 # define S_IRWXG (S_IRGRP|S_IWGRP|S_IXGRP)
15743 # define S_IRWXO (S_IROTH|S_IWOTH|S_IXOTH)
15746 : see whether semctl IPC_STAT can use union semun
15748 case "$d_semctl_semun" in
15751 #include <sys/types.h>
15752 #include <sys/ipc.h>
15753 #include <sys/sem.h>
15754 #include <sys/stat.h>
15761 #$d_union_semun HAS_UNION_SEMUN
15764 #ifndef HAS_UNION_SEMUN
15767 struct semid_ds *buf;
15768 unsigned short *array;
15774 #if defined(IPC_PRIVATE) && defined(S_IRWXU) && defined(S_IRWXG) && defined(S_IRWXO) && defined(IPC_CREAT)
15775 sem = semget(IPC_PRIVATE, 1, S_IRWXU|S_IRWXG|S_IRWXO|IPC_CREAT);
15777 struct semid_ds argbuf;
15780 st = semctl(sem, 0, IPC_STAT, arg);
15784 # endif /* IPC_STAT */
15785 printf("semctl IPC_STAT failed: errno = %d\n", errno);
15787 if (semctl(sem, 0, IPC_RMID, arg) != 0)
15788 # endif /* IPC_RMID */
15789 printf("semctl IPC_RMID failed: errno = %d\n", errno);
15791 #endif /* IPC_PRIVATE && ... */
15792 printf("semget failed: errno = %d\n", errno);
15797 if eval $compile; then
15800 semun) val="$define" ;;
15808 case "$d_semctl_semun" in
15810 echo "You can use union semun for semctl IPC_STAT." >&4
15813 *) echo "You cannot use union semun for semctl IPC_STAT." >&4
15818 : see whether semctl IPC_STAT can use struct semid_ds pointer
15820 case "$d_semctl_semid_ds" in
15822 $cat > try.c <<'END'
15823 #include <sys/types.h>
15824 #include <sys/ipc.h>
15825 #include <sys/sem.h>
15826 #include <sys/stat.h>
15834 struct semid_ds arg;
15837 #if defined(IPC_PRIVATE) && defined(S_IRWXU) && defined(S_IRWXG) && defined(S_IRWXO) && defined(IPC_CREAT)
15838 sem = semget(IPC_PRIVATE, 1, S_IRWXU|S_IRWXG|S_IRWXO|IPC_CREAT);
15841 st = semctl(sem, 0, IPC_STAT, &arg);
15843 printf("semid_ds\n");
15845 # endif /* IPC_STAT */
15846 printf("semctl IPC_STAT failed: errno = %d\n", errno);
15848 if (semctl(sem, 0, IPC_RMID, &arg) != 0)
15849 # endif /* IPC_RMID */
15850 printf("semctl IPC_RMID failed: errno = %d\n", errno);
15852 #endif /* IPC_PRIVATE && ... */
15853 printf("semget failed: errno = %d\n", errno);
15859 if eval $compile; then
15862 semid_ds) val="$define" ;;
15868 set d_semctl_semid_ds
15870 case "$d_semctl_semid_ds" in
15872 echo "You can $also use struct semid_ds* for semctl IPC_STAT." >&4
15874 *) echo "You cannot use struct semid_ds* for semctl IPC_STAT." >&4
15881 # We do not have the full sem*(2) library, so assume we can not
15887 set d_semctl_semid_ds
15892 : see if sendmsg exists
15893 set sendmsg d_sendmsg
15896 : see if setegid exists
15897 set setegid d_setegid
15900 : see if seteuid exists
15901 set seteuid d_seteuid
15904 : see if setgrent exists
15905 set setgrent d_setgrent
15908 : see if setgrent_r exists
15909 set setgrent_r d_setgrent_r
15911 case "$d_setgrent_r" in
15913 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
15914 case "$d_setgrent_r_proto:$usethreads" in
15915 ":define") d_setgrent_r_proto=define
15916 set d_setgrent_r_proto setgrent_r $hdrs
15920 case "$d_setgrent_r_proto" in
15922 case "$setgrent_r_proto" in
15923 ''|0) try='int setgrent_r(FILE**);'
15924 ./protochk "extern $try" $hdrs && setgrent_r_proto=I_H ;;
15926 case "$setgrent_r_proto" in
15927 ''|0) try='void setgrent_r(FILE**);'
15928 ./protochk "extern $try" $hdrs && setgrent_r_proto=V_H ;;
15930 case "$setgrent_r_proto" in
15931 ''|0) d_setgrent_r=undef
15933 echo "Disabling setgrent_r, cannot determine prototype." >&4 ;;
15934 * ) case "$setgrent_r_proto" in
15935 REENTRANT_PROTO*) ;;
15936 *) setgrent_r_proto="REENTRANT_PROTO_$setgrent_r_proto" ;;
15938 echo "Prototype: $try" ;;
15941 *) case "$usethreads" in
15942 define) echo "setgrent_r has no prototype, not using it." >&4 ;;
15949 *) setgrent_r_proto=0
15953 : see if sethostent exists
15954 set sethostent d_sethent
15957 : see if sethostent_r exists
15958 set sethostent_r d_sethostent_r
15960 case "$d_sethostent_r" in
15962 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
15963 case "$d_sethostent_r_proto:$usethreads" in
15964 ":define") d_sethostent_r_proto=define
15965 set d_sethostent_r_proto sethostent_r $hdrs
15969 case "$d_sethostent_r_proto" in
15971 case "$sethostent_r_proto" in
15972 ''|0) try='int sethostent_r(int, struct hostent_data*);'
15973 ./protochk "extern $try" $hdrs && sethostent_r_proto=I_ID ;;
15975 case "$sethostent_r_proto" in
15976 ''|0) try='void sethostent_r(int, struct hostent_data*);'
15977 ./protochk "extern $try" $hdrs && sethostent_r_proto=V_ID ;;
15979 case "$sethostent_r_proto" in
15980 ''|0) d_sethostent_r=undef
15981 sethostent_r_proto=0
15982 echo "Disabling sethostent_r, cannot determine prototype." >&4 ;;
15983 * ) case "$sethostent_r_proto" in
15984 REENTRANT_PROTO*) ;;
15985 *) sethostent_r_proto="REENTRANT_PROTO_$sethostent_r_proto" ;;
15987 echo "Prototype: $try" ;;
15990 *) case "$usethreads" in
15991 define) echo "sethostent_r has no prototype, not using it." >&4 ;;
15993 d_sethostent_r=undef
15994 sethostent_r_proto=0
15998 *) sethostent_r_proto=0
16002 : see if setitimer exists
16003 set setitimer d_setitimer
16006 : see if setlinebuf exists
16007 set setlinebuf d_setlinebuf
16010 : see if setlocale exists
16011 set setlocale d_setlocale
16014 : see if locale.h is available
16015 set locale.h i_locale
16018 : see if setlocale_r exists
16019 set setlocale_r d_setlocale_r
16021 case "$d_setlocale_r" in
16023 hdrs="$i_systypes sys/types.h define stdio.h $i_locale locale.h"
16024 case "$d_setlocale_r_proto:$usethreads" in
16025 ":define") d_setlocale_r_proto=define
16026 set d_setlocale_r_proto setlocale_r $hdrs
16030 case "$d_setlocale_r_proto" in
16032 case "$setlocale_r_proto" in
16033 ''|0) try='int setlocale_r(int, const char*, char*, int);'
16034 ./protochk "extern $try" $hdrs && setlocale_r_proto=I_ICBI ;;
16036 case "$setlocale_r_proto" in
16037 ''|0) d_setlocale_r=undef
16038 setlocale_r_proto=0
16039 echo "Disabling setlocale_r, cannot determine prototype." >&4 ;;
16040 * ) case "$setlocale_r_proto" in
16041 REENTRANT_PROTO*) ;;
16042 *) setlocale_r_proto="REENTRANT_PROTO_$setlocale_r_proto" ;;
16044 echo "Prototype: $try" ;;
16047 *) case "$usethreads" in
16048 define) echo "setlocale_r has no prototype, not using it." >&4 ;;
16050 d_setlocale_r=undef
16051 setlocale_r_proto=0
16055 *) setlocale_r_proto=0
16059 : see if setnetent exists
16060 set setnetent d_setnent
16063 : see if setnetent_r exists
16064 set setnetent_r d_setnetent_r
16066 case "$d_setnetent_r" in
16068 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
16069 case "$d_setnetent_r_proto:$usethreads" in
16070 ":define") d_setnetent_r_proto=define
16071 set d_setnetent_r_proto setnetent_r $hdrs
16075 case "$d_setnetent_r_proto" in
16077 case "$setnetent_r_proto" in
16078 ''|0) try='int setnetent_r(int, struct netent_data*);'
16079 ./protochk "extern $try" $hdrs && setnetent_r_proto=I_ID ;;
16081 case "$setnetent_r_proto" in
16082 ''|0) try='void setnetent_r(int, struct netent_data*);'
16083 ./protochk "extern $try" $hdrs && setnetent_r_proto=V_ID ;;
16085 case "$setnetent_r_proto" in
16086 ''|0) d_setnetent_r=undef
16087 setnetent_r_proto=0
16088 echo "Disabling setnetent_r, cannot determine prototype." >&4 ;;
16089 * ) case "$setnetent_r_proto" in
16090 REENTRANT_PROTO*) ;;
16091 *) setnetent_r_proto="REENTRANT_PROTO_$setnetent_r_proto" ;;
16093 echo "Prototype: $try" ;;
16096 *) case "$usethreads" in
16097 define) echo "setnetent_r has no prototype, not using it." >&4 ;;
16099 d_setnetent_r=undef
16100 setnetent_r_proto=0
16104 *) setnetent_r_proto=0
16108 : see if setprotoent exists
16109 set setprotoent d_setpent
16112 : see if setpgid exists
16113 set setpgid d_setpgid
16116 : see if setpgrp2 exists
16117 set setpgrp2 d_setpgrp2
16120 : see if setpriority exists
16121 set setpriority d_setprior
16124 : see if setproctitle exists
16125 set setproctitle d_setproctitle
16128 : see if setprotoent_r exists
16129 set setprotoent_r d_setprotoent_r
16131 case "$d_setprotoent_r" in
16133 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
16134 case "$d_setprotoent_r_proto:$usethreads" in
16135 ":define") d_setprotoent_r_proto=define
16136 set d_setprotoent_r_proto setprotoent_r $hdrs
16140 case "$d_setprotoent_r_proto" in
16142 case "$setprotoent_r_proto" in
16143 ''|0) try='int setprotoent_r(int, struct protoent_data*);'
16144 ./protochk "extern $try" $hdrs && setprotoent_r_proto=I_ID ;;
16146 case "$setprotoent_r_proto" in
16147 ''|0) try='void setprotoent_r(int, struct protoent_data*);'
16148 ./protochk "extern $try" $hdrs && setprotoent_r_proto=V_ID ;;
16150 case "$setprotoent_r_proto" in
16151 ''|0) d_setprotoent_r=undef
16152 setprotoent_r_proto=0
16153 echo "Disabling setprotoent_r, cannot determine prototype." >&4 ;;
16154 * ) case "$setprotoent_r_proto" in
16155 REENTRANT_PROTO*) ;;
16156 *) setprotoent_r_proto="REENTRANT_PROTO_$setprotoent_r_proto" ;;
16158 echo "Prototype: $try" ;;
16161 *) case "$usethreads" in
16162 define) echo "setprotoent_r has no prototype, not using it." >&4 ;;
16164 d_setprotoent_r=undef
16165 setprotoent_r_proto=0
16169 *) setprotoent_r_proto=0
16173 : see if setpwent exists
16174 set setpwent d_setpwent
16177 : see if setpwent_r exists
16178 set setpwent_r d_setpwent_r
16180 case "$d_setpwent_r" in
16182 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
16183 case "$d_setpwent_r_proto:$usethreads" in
16184 ":define") d_setpwent_r_proto=define
16185 set d_setpwent_r_proto setpwent_r $hdrs
16189 case "$d_setpwent_r_proto" in
16191 case "$setpwent_r_proto" in
16192 ''|0) try='int setpwent_r(FILE**);'
16193 ./protochk "extern $try" $hdrs && setpwent_r_proto=I_H ;;
16195 case "$setpwent_r_proto" in
16196 ''|0) try='void setpwent_r(FILE**);'
16197 ./protochk "extern $try" $hdrs && setpwent_r_proto=V_H ;;
16199 case "$setpwent_r_proto" in
16200 ''|0) d_setpwent_r=undef
16202 echo "Disabling setpwent_r, cannot determine prototype." >&4 ;;
16203 * ) case "$setpwent_r_proto" in
16204 REENTRANT_PROTO*) ;;
16205 *) setpwent_r_proto="REENTRANT_PROTO_$setpwent_r_proto" ;;
16207 echo "Prototype: $try" ;;
16210 *) case "$usethreads" in
16211 define) echo "setpwent_r has no prototype, not using it." >&4 ;;
16218 *) setpwent_r_proto=0
16222 : see if setregid exists
16223 set setregid d_setregid
16225 set setresgid d_setresgid
16228 : see if setreuid exists
16229 set setreuid d_setreuid
16231 set setresuid d_setresuid
16234 : see if setrgid exists
16235 set setrgid d_setrgid
16238 : see if setruid exists
16239 set setruid d_setruid
16242 : see if setservent exists
16243 set setservent d_setsent
16246 : see if setservent_r exists
16247 set setservent_r d_setservent_r
16249 case "$d_setservent_r" in
16251 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
16252 case "$d_setservent_r_proto:$usethreads" in
16253 ":define") d_setservent_r_proto=define
16254 set d_setservent_r_proto setservent_r $hdrs
16258 case "$d_setservent_r_proto" in
16260 case "$setservent_r_proto" in
16261 ''|0) try='int setservent_r(int, struct servent_data*);'
16262 ./protochk "extern $try" $hdrs && setservent_r_proto=I_ID ;;
16264 case "$setservent_r_proto" in
16265 ''|0) try='void setservent_r(int, struct servent_data*);'
16266 ./protochk "extern $try" $hdrs && setservent_r_proto=V_ID ;;
16268 case "$setservent_r_proto" in
16269 ''|0) d_setservent_r=undef
16270 setservent_r_proto=0
16271 echo "Disabling setservent_r, cannot determine prototype." >&4 ;;
16272 * ) case "$setservent_r_proto" in
16273 REENTRANT_PROTO*) ;;
16274 *) setservent_r_proto="REENTRANT_PROTO_$setservent_r_proto" ;;
16276 echo "Prototype: $try" ;;
16279 *) case "$usethreads" in
16280 define) echo "setservent_r has no prototype, not using it." >&4 ;;
16282 d_setservent_r=undef
16283 setservent_r_proto=0
16287 *) setservent_r_proto=0
16291 : see if setsid exists
16292 set setsid d_setsid
16295 : see if setvbuf exists
16296 set setvbuf d_setvbuf
16299 : see if sfio.h is available
16304 : see if sfio library is available
16315 : Ok, but do we want to use it.
16319 true|$define|[yY]*) dflt='y';;
16322 echo "$package can use the sfio library, but it is experimental."
16323 case "$useperlio" in
16325 echo "For sfio also the PerlIO abstraction layer is needed."
16326 echo "Earlier you said you wouldn't want that."
16329 rp="You seem to have sfio available, do you want to try using it?"
16332 y|Y) echo "Ok, turning on both sfio and PerlIO, then."
16333 useperlio="$define"
16336 *) echo "Ok, avoiding sfio this time. I'll use stdio instead."
16341 *) case "$usesfio" in
16342 true|$define|[yY]*)
16343 echo "Sorry, cannot find sfio on this machine." >&4
16344 echo "Ignoring your setting of usesfio=$usesfio." >&4
16353 $define) usesfio='true';;
16354 *) usesfio='false';;
16358 *) : Remove sfio from list of libraries to use
16361 echo "Removing unneeded -lsfio from library list" >&4
16362 set `echo X $libs | $sed -e 's/-lsfio / /' -e 's/-lsfio$//'`
16365 echo "libs = $libs" >&4
16372 : see if shmctl exists
16373 set shmctl d_shmctl
16376 : see if shmget exists
16377 set shmget d_shmget
16380 : see if shmat exists
16383 : see what shmat returns
16386 $cat >shmat.c <<'END'
16387 #include <sys/shm.h>
16390 if $cc $ccflags -c shmat.c >/dev/null 2>&1; then
16395 echo "and it returns ($shmattype)." >&4
16396 : see if a prototype for shmat is available
16397 xxx=`./findhdr sys/shm.h`
16398 $cppstdin $cppflags $cppminus < $xxx > shmat.c 2>/dev/null
16399 if $contains 'shmat.*(' shmat.c >/dev/null 2>&1; then
16410 set d_shmatprototype
16413 : see if shmdt exists
16417 : see how much of the 'shm*(2)' library is present.
16420 case "$d_shmctl$d_shmget$d_shmat$d_shmdt" in
16421 *"$undef"*) h_shm=false;;
16425 case "`ipcs 2>&1`" in
16426 "SVID shared memory"*"not configured"*)
16427 echo "Your $osname does not have the shm*(2) configured." >&4
16430 set shmctl d_shmctl
16432 set shmget d_shmget
16442 : we could also check for sys/ipc.h ...
16443 if $h_shm && $test `./findhdr sys/shm.h`; then
16444 echo "You have the full shm*(2) library." >&4
16447 echo "You don't have the full shm*(2) library." >&4
16454 : see if we have sigaction
16455 if set sigaction val -f d_sigaction; eval $csym; $val; then
16456 echo 'sigaction() found.' >&4
16459 #include <sys/types.h>
16460 #include <signal.h>
16461 #$i_stdlib I_STDLIB
16463 #include <stdlib.h>
16467 struct sigaction act, oact;
16469 oact.sa_handler = 0;
16470 /* so that act and oact are used */
16471 exit(act.sa_flags == 0 && oact.sa_handler == 0);
16475 if eval $compile_ok; then
16478 echo "But you don't seem to have a useable struct sigaction." >&4
16482 echo 'sigaction NOT found.' >&4
16485 set d_sigaction; eval $setvar
16486 $rm -f try try$_o try.c
16488 : see if sigprocmask exists
16489 set sigprocmask d_sigprocmask
16492 : see if sigsetjmp exists
16494 case "$d_sigsetjmp" in
16497 #include <setjmp.h>
16498 #$i_stdlib I_STDLIB
16500 #include <stdlib.h>
16506 if (sigsetjmp(env,1))
16509 siglongjmp(env, 1);
16514 if eval $compile; then
16515 if $run ./try >/dev/null 2>&1; then
16516 echo "POSIX sigsetjmp found." >&4
16520 Uh-Oh! You have POSIX sigsetjmp and siglongjmp, but they do not work properly!!
16526 echo "sigsetjmp not found." >&4
16530 *) val="$d_sigsetjmp"
16531 case "$d_sigsetjmp" in
16532 $define) echo "POSIX sigsetjmp found." >&4;;
16533 $undef) echo "sigsetjmp not found." >&4;;
16541 : see if snprintf exists
16542 set snprintf d_snprintf
16545 : see if vsnprintf exists
16546 set vsnprintf d_vsnprintf
16549 : see if sockatmark exists
16550 set sockatmark d_sockatmark
16553 : see if prototype for sockatmark is available
16555 set d_sockatmarkproto sockatmark $d_socket sys/socket.h
16558 : see if socks5_init exists
16559 set socks5_init d_socks5_init
16562 : see if sprintf returns the length of the string in the buffer as per ANSI
16563 $echo "Checking whether sprintf returns the length of the string..." >&4
16566 #$i_stdlib I_STDLIB
16568 #include <stdlib.h>
16570 #$i_string I_STRING
16572 # include <string.h>
16574 # include <strings.h>
16583 int check (size_t expect, int test) {
16584 size_t got = strlen(buffer);
16588 printf("expected %ld, got %ld in test %d '%s'\n", (long) expect, (long) got,
16593 int main(int argc, char **argv) {
16596 check(sprintf(buffer, ""), ++test);
16597 check(sprintf(buffer, "%s %s", "perl", "rules"), ++test);
16598 check(sprintf(buffer, "I like %g", atan2(0,-1)), ++test);
16605 d_sprintf_returns_strlen="$undef"
16606 if eval $compile; then
16610 sprintf returns the length of the string (as ANSI says it should)
16612 d_sprintf_returns_strlen="$define"
16615 sprintf does not return the length of the string (how old is this system?)
16617 d_sprintf_returns_strlen="$undef"
16624 : see if srand48_r exists
16625 set srand48_r d_srand48_r
16627 case "$d_srand48_r" in
16629 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
16630 case "$d_srand48_r_proto:$usethreads" in
16631 ":define") d_srand48_r_proto=define
16632 set d_srand48_r_proto srand48_r $hdrs
16636 case "$d_srand48_r_proto" in
16638 case "$srand48_r_proto" in
16639 ''|0) try='int srand48_r(long, struct drand48_data*);'
16640 ./protochk "extern $try" $hdrs && srand48_r_proto=I_LS ;;
16642 case "$srand48_r_proto" in
16643 ''|0) d_srand48_r=undef
16645 echo "Disabling srand48_r, cannot determine prototype." >&4 ;;
16646 * ) case "$srand48_r_proto" in
16647 REENTRANT_PROTO*) ;;
16648 *) srand48_r_proto="REENTRANT_PROTO_$srand48_r_proto" ;;
16650 echo "Prototype: $try" ;;
16653 *) case "$usethreads" in
16654 define) echo "srand48_r has no prototype, not using it." >&4 ;;
16661 *) srand48_r_proto=0
16665 : see if srandom_r exists
16666 set srandom_r d_srandom_r
16668 case "$d_srandom_r" in
16670 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
16671 case "$d_srandom_r_proto:$usethreads" in
16672 ":define") d_srandom_r_proto=define
16673 set d_srandom_r_proto srandom_r $hdrs
16677 case "$d_srandom_r_proto" in
16679 case "$srandom_r_proto" in
16680 ''|0) try='int srandom_r(unsigned int, struct random_data*);'
16681 ./protochk "extern $try" $hdrs && srandom_r_proto=I_TS ;;
16683 case "$srandom_r_proto" in
16684 ''|0) d_srandom_r=undef
16686 echo "Disabling srandom_r, cannot determine prototype." >&4 ;;
16687 * ) case "$srandom_r_proto" in
16688 REENTRANT_PROTO*) ;;
16689 *) srandom_r_proto="REENTRANT_PROTO_$srandom_r_proto" ;;
16691 echo "Prototype: $try" ;;
16694 *) case "$usethreads" in
16695 define) echo "srandom_r has no prototype, not using it." >&4 ;;
16702 *) srandom_r_proto=0
16706 : see if prototype for setresgid is available
16708 set d_sresgproto setresgid $i_unistd unistd.h
16711 : see if prototype for setresuid is available
16713 set d_sresuproto setresuid $i_unistd unistd.h
16716 : see if sys/stat.h is available
16717 set sys/stat.h i_sysstat
16721 : see if stat knows about block sizes
16723 echo "Checking to see if your struct stat has st_blocks field..." >&4
16724 set d_statblks stat st_blocks $i_sysstat sys/stat.h
16728 : see if this is a sys/vfs.h system
16729 set sys/vfs.h i_sysvfs
16733 : see if this is a sys/statfs.h system
16734 set sys/statfs.h i_sysstatfs
16739 echo "Checking to see if your system supports struct statfs..." >&4
16740 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
16742 case "$d_statfs_s" in
16743 "$define") echo "Yes, it does." ;;
16744 *) echo "No, it doesn't." ;;
16749 : see if struct statfs knows about f_flags
16750 case "$d_statfs_s" in
16753 echo "Checking to see if your struct statfs has f_flags field..." >&4
16754 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
16758 set d_statfs_f_flags
16762 case "$d_statfs_f_flags" in
16763 "$define") echo "Yes, it does." ;;
16764 *) echo "No, it doesn't." ;;
16768 Checking how to access stdio streams by file descriptor number...
16770 case "$stdio_stream_array" in
16771 '') $cat >try.c <<EOCP
16774 if (&STDIO_STREAM_ARRAY[fileno(stdin)] == stdin)
16778 for s in _iob __iob __sF
16780 set try -DSTDIO_STREAM_ARRAY=$s
16781 if eval $compile; then
16782 case "`$run ./try`" in
16783 yes) stdio_stream_array=$s; break ;;
16787 $rm -f try.* try$exe_ext
16789 case "$stdio_stream_array" in
16791 I can't figure out how to access stdio streams by file descriptor number.
16793 d_stdio_stream_array="$undef"
16796 You can access stdio streams by file descriptor number by the $stdio_stream_array array.
16798 d_stdio_stream_array="$define"
16802 : see if strcoll exists
16803 set strcoll d_strcoll
16806 : check for structure copying
16808 echo "Checking to see if your C compiler can copy structs..." >&4
16809 $cat >try.c <<'EOCP'
16819 if $cc -c try.c >/dev/null 2>&1 ; then
16821 echo "Yup, it can."
16824 echo "Nope, it can't."
16830 : see if strerror and/or sys_errlist[] exist
16832 if test "X$d_strerror" = X -o "X$d_syserrlst" = X; then
16833 if set strerror val -f d_strerror; eval $csym; $val; then
16834 echo 'strerror() found.' >&4
16835 d_strerror="$define"
16836 d_strerrm='strerror(e)'
16837 if set sys_errlist val -a d_syserrlst; eval $csym; $val; then
16838 echo "(You also have sys_errlist[], so we could roll our own strerror.)"
16839 d_syserrlst="$define"
16841 echo "(Since you don't have sys_errlist[], sterror() is welcome.)"
16842 d_syserrlst="$undef"
16844 elif xxx=`./findhdr string.h`; test "$xxx" || xxx=`./findhdr strings.h`; \
16845 $contains '#[ ]*define.*strerror' "$xxx" >/dev/null 2>&1; then
16846 echo 'strerror() found in string header.' >&4
16847 d_strerror="$define"
16848 d_strerrm='strerror(e)'
16849 if set sys_errlist val -a d_syserrlst; eval $csym; $val; then
16850 echo "(Most probably, strerror() uses sys_errlist[] for descriptions.)"
16851 d_syserrlst="$define"
16853 echo "(You don't appear to have any sys_errlist[], how can this be?)"
16854 d_syserrlst="$undef"
16856 elif set sys_errlist val -a d_syserrlst; eval $csym; $val; then
16857 echo "strerror() not found, but you have sys_errlist[] so we'll use that." >&4
16858 d_strerror="$undef"
16859 d_syserrlst="$define"
16860 d_strerrm='((e)<0||(e)>=sys_nerr?"unknown":sys_errlist[e])'
16862 echo 'strerror() and sys_errlist[] NOT found.' >&4
16863 d_strerror="$undef"
16864 d_syserrlst="$undef"
16865 d_strerrm='"unknown"'
16869 : see if strerror_r exists
16870 set strerror_r d_strerror_r
16872 case "$d_strerror_r" in
16874 hdrs="$i_systypes sys/types.h define stdio.h $i_string string.h"
16875 case "$d_strerror_r_proto:$usethreads" in
16876 ":define") d_strerror_r_proto=define
16877 set d_strerror_r_proto strerror_r $hdrs
16881 case "$d_strerror_r_proto" in
16883 case "$strerror_r_proto" in
16884 ''|0) try='int strerror_r(int, char*, size_t);'
16885 ./protochk "extern $try" $hdrs && strerror_r_proto=I_IBW ;;
16887 case "$strerror_r_proto" in
16888 ''|0) try='int strerror_r(int, char*, int);'
16889 ./protochk "extern $try" $hdrs && strerror_r_proto=I_IBI ;;
16891 case "$strerror_r_proto" in
16892 ''|0) try='char* strerror_r(int, char*, size_t);'
16893 ./protochk "extern $try" $hdrs && strerror_r_proto=B_IBW ;;
16895 case "$strerror_r_proto" in
16896 ''|0) d_strerror_r=undef
16898 echo "Disabling strerror_r, cannot determine prototype." >&4 ;;
16899 * ) case "$strerror_r_proto" in
16900 REENTRANT_PROTO*) ;;
16901 *) strerror_r_proto="REENTRANT_PROTO_$strerror_r_proto" ;;
16903 echo "Prototype: $try" ;;
16906 *) case "$usethreads" in
16907 define) echo "strerror_r has no prototype, not using it." >&4 ;;
16914 *) strerror_r_proto=0
16918 : see if strftime exists
16919 set strftime d_strftime
16922 : see if strlcat exists
16923 set strlcat d_strlcat
16926 : see if strlcpy exists
16927 set strlcpy d_strlcpy
16930 : see if strtod exists
16931 set strtod d_strtod
16934 : see if strtol exists
16935 set strtol d_strtol
16938 : see if strtold exists
16939 set strtold d_strtold
16942 : see if strtoll exists
16943 set strtoll d_strtoll
16946 case "$d_longlong-$d_strtoll" in
16949 Checking whether your strtoll() works okay...
16951 $cat >try.c <<'EOCP'
16954 #define strtoll __strtoll
16957 #define strtoll _strtoll
16960 extern long long int strtoll(char *s, char **, int);
16961 static int bad = 0;
16962 int check(char *s, long long ell, int een) {
16965 gll = strtoll(s, 0, 10);
16966 if (!((gll == ell) && (errno == een)))
16970 check(" 1", 1LL, 0);
16971 check(" 0", 0LL, 0);
16972 check("-1", -1LL, 0);
16973 check("-9223372036854775808", -9223372036854775808LL, 0);
16974 check("-9223372036854775808", -9223372036854775808LL, 0);
16975 check(" 9223372036854775807", 9223372036854775807LL, 0);
16976 check("-9223372036854775808", -9223372036854775808LL, 0);
16977 check(" 9223372036854775808", 9223372036854775807LL, ERANGE);
16978 check("-9223372036854775809", -9223372036854775808LL, ERANGE);
16984 if eval $compile; then
16987 ok) echo "Your strtoll() seems to be working okay." ;;
16989 Your strtoll() doesn't seem to be working okay.
16995 echo "(I can't seem to compile the test program--assuming it doesn't)"
17001 : see if strtoq exists
17002 set strtoq d_strtoq
17005 : see if strtoul exists
17006 set strtoul d_strtoul
17009 case "$d_strtoul" in
17012 Checking whether your strtoul() works okay...
17014 $cat >try.c <<'EOCP'
17017 extern unsigned long int strtoul(char *s, char **, int);
17018 static int bad = 0;
17019 void check(char *s, unsigned long eul, int een) {
17022 gul = strtoul(s, 0, 10);
17023 if (!((gul == eul) && (errno == een)))
17027 check(" 1", 1L, 0);
17028 check(" 0", 0L, 0);
17030 case "$longsize" in
17032 $cat >>try.c <<'EOCP'
17033 check("18446744073709551615", 18446744073709551615UL, 0);
17034 check("18446744073709551616", 18446744073709551615UL, ERANGE);
17035 #if 0 /* strtoul() for /^-/ strings is undefined. */
17036 check("-1", 18446744073709551615UL, 0);
17037 check("-18446744073709551614", 2, 0);
17038 check("-18446744073709551615", 1, 0);
17039 check("-18446744073709551616", 18446744073709551615UL, ERANGE);
17040 check("-18446744073709551617", 18446744073709551615UL, ERANGE);
17045 $cat >>try.c <<'EOCP'
17046 check("4294967295", 4294967295UL, 0);
17047 check("4294967296", 4294967295UL, ERANGE);
17048 #if 0 /* strtoul() for /^-/ strings is undefined. */
17049 check("-1", 4294967295UL, 0);
17050 check("-4294967294", 2, 0);
17051 check("-4294967295", 1, 0);
17052 check("-4294967296", 4294967295UL, ERANGE);
17053 check("-4294967297", 4294967295UL, ERANGE);
17058 : Should we write these tests to be more portable by sprintf-ing
17059 : ~0 and then manipulating that char string as input for strtol?
17062 $cat >>try.c <<'EOCP'
17069 if eval $compile; then
17070 case "`$run ./try`" in
17071 ok) echo "Your strtoul() seems to be working okay." ;;
17073 Your strtoul() doesn't seem to be working okay.
17082 : see if strtoull exists
17083 set strtoull d_strtoull
17086 case "$d_longlong-$d_strtoull" in
17089 Checking whether your strtoull() works okay...
17091 $cat >try.c <<'EOCP'
17094 #define strtoull __strtoull
17097 extern unsigned long long int strtoull(char *s, char **, int);
17098 static int bad = 0;
17099 int check(char *s, long long eull, int een) {
17102 gull = strtoull(s, 0, 10);
17103 if (!((gull == eull) && (errno == een)))
17107 check(" 1", 1LL, 0);
17108 check(" 0", 0LL, 0);
17109 check("18446744073709551615", 18446744073709551615ULL, 0);
17110 check("18446744073709551616", 18446744073709551615ULL, ERANGE);
17111 #if 0 /* strtoull() for /^-/ strings is undefined. */
17112 check("-1", 18446744073709551615ULL, 0);
17113 check("-18446744073709551614", 2LL, 0);
17114 check("-18446744073709551615", 1LL, 0);
17115 check("-18446744073709551616", 18446744073709551615ULL, ERANGE);
17116 check("-18446744073709551617", 18446744073709551615ULL, ERANGE);
17123 if eval $compile; then
17124 case "`$run ./try`" in
17125 ok) echo "Your strtoull() seems to be working okay." ;;
17127 Your strtoull() doesn't seem to be working okay.
17129 d_strtoull="$undef"
17136 : see if strtouq exists
17137 set strtouq d_strtouq
17140 case "$d_strtouq" in
17143 Checking whether your strtouq() works okay...
17145 $cat >try.c <<'EOCP'
17148 extern unsigned long long int strtouq(char *s, char **, int);
17149 static int bad = 0;
17150 void check(char *s, unsigned long long eull, int een) {
17151 unsigned long long gull;
17153 gull = strtouq(s, 0, 10);
17154 if (!((gull == eull) && (errno == een)))
17158 check(" 1", 1LL, 0);
17159 check(" 0", 0LL, 0);
17160 check("18446744073709551615", 18446744073709551615ULL, 0);
17161 check("18446744073709551616", 18446744073709551615ULL, ERANGE);
17162 #if 0 /* strtouq() for /^-/ strings is undefined. */
17163 check("-1", 18446744073709551615ULL, 0);
17164 check("-18446744073709551614", 2LL, 0);
17165 check("-18446744073709551615", 1LL, 0);
17166 check("-18446744073709551616", 18446744073709551615ULL, ERANGE);
17167 check("-18446744073709551617", 18446744073709551615ULL, ERANGE);
17175 if eval $compile; then
17176 case "`$run ./try`" in
17177 ok) echo "Your strtouq() seems to be working okay." ;;
17179 Your strtouq() doesn't seem to be working okay.
17188 : see if strxfrm exists
17189 set strxfrm d_strxfrm
17192 : see if symlink exists
17193 set symlink d_symlink
17196 : see if syscall exists
17197 set syscall d_syscall
17200 : see if prototype for syscall is available
17202 set d_syscallproto syscall $i_unistd unistd.h
17205 : see if sysconf exists
17206 set sysconf d_sysconf
17209 : see if system exists
17210 set system d_system
17213 : see if tcgetpgrp exists
17214 set tcgetpgrp d_tcgetpgrp
17217 : see if tcsetpgrp exists
17218 set tcsetpgrp d_tcsetpgrp
17221 : see if prototype for telldir is available
17223 set d_telldirproto telldir $i_systypes sys/types.h $i_dirent dirent.h
17226 : see if time exists
17228 if test "X$d_time" = X -o X"$timetype" = X; then
17229 if set time val -f d_time; eval $csym; $val; then
17230 echo 'time() found.' >&4
17232 rp="What is the type returned by time() on this system?"
17233 set time_t timetype long stdio.h sys/types.h
17236 echo 'time() not found, hope that will do.' >&4
17244 : see if this is a sys/times.h system
17245 set sys/times.h i_systimes
17248 : see if times exists
17250 if set times val -f d_times; eval $csym; $val; then
17251 echo 'times() found.' >&4
17254 case "$i_systimes" in
17255 "$define") inc='sys/times.h';;
17257 rp="What is the type returned by times() on this system?"
17258 set clock_t clocktype long stdio.h sys/types.h $inc
17261 echo 'times() NOT found, hope that will do.' >&4
17266 : see if tmpnam_r exists
17267 set tmpnam_r d_tmpnam_r
17269 case "$d_tmpnam_r" in
17271 hdrs="$i_systypes sys/types.h define stdio.h "
17272 case "$d_tmpnam_r_proto:$usethreads" in
17273 ":define") d_tmpnam_r_proto=define
17274 set d_tmpnam_r_proto tmpnam_r $hdrs
17278 case "$d_tmpnam_r_proto" in
17280 case "$tmpnam_r_proto" in
17281 ''|0) try='char* tmpnam_r(char*);'
17282 ./protochk "extern $try" $hdrs && tmpnam_r_proto=B_B ;;
17284 case "$tmpnam_r_proto" in
17285 ''|0) d_tmpnam_r=undef
17287 echo "Disabling tmpnam_r, cannot determine prototype." >&4 ;;
17288 * ) case "$tmpnam_r_proto" in
17289 REENTRANT_PROTO*) ;;
17290 *) tmpnam_r_proto="REENTRANT_PROTO_$tmpnam_r_proto" ;;
17292 echo "Prototype: $try" ;;
17295 *) case "$usethreads" in
17296 define) echo "tmpnam_r has no prototype, not using it." >&4 ;;
17303 *) tmpnam_r_proto=0
17307 : see if truncate exists
17308 set truncate d_truncate
17311 : see if ttyname_r exists
17312 set ttyname_r d_ttyname_r
17314 case "$d_ttyname_r" in
17316 hdrs="$i_systypes sys/types.h define stdio.h $i_unistd unistd.h"
17317 case "$d_ttyname_r_proto:$usethreads" in
17318 ":define") d_ttyname_r_proto=define
17319 set d_ttyname_r_proto ttyname_r $hdrs
17323 case "$d_ttyname_r_proto" in
17325 case "$ttyname_r_proto" in
17326 ''|0) try='int ttyname_r(int, char*, size_t);'
17327 ./protochk "extern $try" $hdrs && ttyname_r_proto=I_IBW ;;
17329 case "$ttyname_r_proto" in
17330 ''|0) try='int ttyname_r(int, char*, int);'
17331 ./protochk "extern $try" $hdrs && ttyname_r_proto=I_IBI ;;
17333 case "$ttyname_r_proto" in
17334 ''|0) try='char* ttyname_r(int, char*, int);'
17335 ./protochk "extern $try" $hdrs && ttyname_r_proto=B_IBI ;;
17337 case "$ttyname_r_proto" in
17338 ''|0) d_ttyname_r=undef
17340 echo "Disabling ttyname_r, cannot determine prototype." >&4 ;;
17341 * ) case "$ttyname_r_proto" in
17342 REENTRANT_PROTO*) ;;
17343 *) ttyname_r_proto="REENTRANT_PROTO_$ttyname_r_proto" ;;
17345 echo "Prototype: $try" ;;
17348 *) case "$usethreads" in
17349 define) echo "ttyname_r has no prototype, not using it." >&4 ;;
17356 *) ttyname_r_proto=0
17360 : see if tzname[] exists
17362 if set tzname val -a d_tzname; eval $csym; $val; then
17364 echo 'tzname[] found.' >&4
17367 echo 'tzname[] NOT found.' >&4
17373 next|rhapsody|darwin) multiarch="$define" ;;
17375 case "$multiarch" in
17376 ''|[nN]*) multiarch="$undef" ;;
17379 : check for ordering of bytes in a UV
17381 case "$usecrosscompile$multiarch" in
17384 You seem to be either cross-compiling or doing a multiarchitecture build,
17385 skipping the byteorder check.
17391 case "$byteorder" in
17394 In the following, larger digits indicate more significance. A big-endian
17395 machine like a Pyramid or a Motorola 680?0 chip will come out to 4321. A
17396 little-endian machine like a Vax or an Intel 80?86 chip would be 1234. Other
17397 machines may have weird orders like 3412. A Cray will report 87654321,
17398 an Alpha will report 12345678. If the test program works the default is
17400 I'm now running the test program...
17404 #$i_stdlib I_STDLIB
17406 #include <stdlib.h>
17408 #include <sys/types.h>
17409 typedef $uvtype UV;
17419 u.l = (((UV)0x08070605) << 32) | (UV)0x04030201;
17421 u.l = (UV)0x04030201;
17422 for (i = 0; i < $uvsize; i++)
17423 printf("%c", u.c[i]+'0');
17430 if eval $compile && ./try > /dev/null; then
17433 [1-4][1-4][1-4][1-4]|12345678|87654321)
17434 echo "(The test program ran ok.)"
17435 echo "byteorder=$dflt"
17438 ????|????????) echo "(The test program ran ok.)" ;;
17439 *) echo "(The test program didn't run right for some reason.)" ;;
17444 (I can't seem to compile the test program. Guessing big-endian...)
17447 case "$xxx_prompt" in
17449 rp="What is the order of bytes in $uvtype?"
17465 Checking to see whether you can access character data unalignedly...
17467 case "$d_u32align" in
17468 '') $cat >try.c <<EOCP
17470 #$i_stdlib I_STDLIB
17472 #include <stdlib.h>
17474 #define U32 $u32type
17475 #define BYTEORDER 0x$byteorder
17477 #include <signal.h>
17479 $signal_t bletch(s) int s; { exit(4); }
17482 #if BYTEORDER == 0x1234 || BYTEORDER == 0x4321
17487 if (sizeof(U32) != 4) {
17488 printf("sizeof(U32) is not 4, but %d\n", sizeof(U32));
17495 signal(SIGBUS, bletch);
17507 for (i = 0; i < 4; i++) {
17508 up = (U32*)(buf + i);
17509 if (! ((*up == 1 << (8*i)) || /* big-endian */
17510 (*up == 1 << (8*(3-i))) /* little-endian */
17514 printf("read failed (%x)\n", *up);
17520 for (i = 0; i < 4; i++) {
17521 up = (U32*)(buf + i);
17523 if (*up != 0xBeef) {
17524 printf("write failed (%x)\n", *up);
17538 if eval $compile_ok; then
17539 echo "(Testing for character data alignment may crash the test. That's okay.)" >&4
17540 $run ./try 2>&1 >/dev/null
17543 You can access character data pretty unalignedly.
17545 d_u32align="$undef"
17548 It seems that you must access character data in an aligned manner.
17550 d_u32align="$define"
17554 rp='Can you access character data at unaligned addresses?'
17558 [yY]*) d_u32align="$undef" ;;
17559 *) d_u32align="$define" ;;
17562 $rm -f core core.try.* try.core
17566 : see if ualarm exists
17567 set ualarm d_ualarm
17570 : see if umask exists
17574 : see if unordered exists
17575 set unordered d_unordered
17578 : see if unsetenv exists
17579 set unsetenv d_unsetenv
17582 : see if usleep exists
17583 set usleep d_usleep
17586 : see if prototype for usleep is available
17588 set d_usleepproto usleep $i_unistd unistd.h
17591 : see if ustat exists
17595 : backward compatibility for d_hvfork
17596 if test X$d_hvfork != X; then
17597 d_vfork="$d_hvfork"
17600 : see if there is a vfork
17605 : Ok, but do we want to use it. vfork is reportedly unreliable in
17606 : perl on Solaris 2.x, and probably elsewhere.
17610 case "$usevfork" in
17616 Perl can only use a vfork() that doesn't suffer from strict
17617 restrictions on calling functions or modifying global data in
17618 the child. For example, glibc-2.1 contains such a vfork()
17619 that is unsuitable. If your system provides a proper fork()
17620 call, chances are that you do NOT want perl to use vfork().
17623 rp="Do you still want to use vfork()?"
17628 echo "Ok, we won't use vfork()."
17637 $define) usevfork='true';;
17638 *) usevfork='false';;
17641 : see if closedir exists
17642 set closedir d_closedir
17645 case "$d_closedir" in
17648 echo "Checking whether closedir() returns a status..." >&4
17650 #$i_dirent I_DIRENT /**/
17651 #$i_sysdir I_SYS_DIR /**/
17652 #$i_sysndir I_SYS_NDIR /**/
17653 #$i_systypes I_SYS_TYPES /**/
17655 #if defined(I_SYS_TYPES)
17656 #include <sys/types.h>
17658 #if defined(I_DIRENT)
17659 #include <dirent.h>
17660 #if defined(NeXT) && defined(I_SYS_DIR) /* NeXT needs dirent + sys/dir.h */
17661 #include <sys/dir.h>
17665 #include <sys/ndir.h>
17669 #include <ndir.h> /* may be wrong in the future */
17671 #include <sys/dir.h>
17676 int main() { return closedir(opendir(".")); }
17679 if eval $compile_ok; then
17680 if $run ./try > /dev/null 2>&1 ; then
17681 echo "Yes, it does."
17684 echo "No, it doesn't."
17688 echo "(I can't seem to compile the test program--assuming it doesn't)"
17696 set d_void_closedir
17699 : see if there is a wait4
17703 : see if waitpid exists
17704 set waitpid d_waitpid
17707 : see if wcstombs exists
17708 set wcstombs d_wcstombs
17711 : see if wctomb exists
17712 set wctomb d_wctomb
17715 : see if writev exists
17716 set writev d_writev
17719 : preserve RCS keywords in files with variable substitution, grrr
17724 Revision='$Revision'
17726 : check for alignment requirements
17728 case "$usecrosscompile$multiarch" in
17731 You seem to be either cross-compiling or doing a multiarchitecture build,
17732 skipping the memory alignment check.
17735 case "$alignbytes" in
17736 '') alignbytes=8 ;;
17740 case "$alignbytes" in
17741 '') echo "Checking alignment constraints..." >&4
17742 if $test "X$uselongdouble" = Xdefine -a "X$d_longdbl" = Xdefine; then
17743 $cat >try.c <<'EOCP'
17744 typedef long double NV;
17747 $cat >try.c <<'EOCP'
17751 $cat >>try.c <<'EOCP'
17759 printf("%d\n", (int)((char *)&try_algn.bar - (char *)&try_algn.foo));
17764 if eval $compile_ok; then
17768 echo "(I can't seem to compile the test program...)"
17771 *) dflt="$alignbytes"
17774 rp="Doubles must be aligned on a how-many-byte boundary?"
17782 : set the base revision
17785 : how do we concatenate cpp tokens here?
17787 echo "Checking to see how your cpp does stuff like concatenate tokens..." >&4
17788 $cat >cpp_stuff.c <<'EOCP'
17789 #define RCAT(a,b)a/**/b
17790 #define ACAT(a,b)a ## b
17794 $cppstdin $cppflags $cppminus <cpp_stuff.c >cpp_stuff.out 2>&1
17795 if $contains 'Circus' cpp_stuff.out >/dev/null 2>&1; then
17796 echo "Oh! Smells like ANSI's been here." >&4
17797 echo "We can catify or stringify, separately or together!"
17799 elif $contains 'Reiser' cpp_stuff.out >/dev/null 2>&1; then
17800 echo "Ah, yes! The good old days!" >&4
17801 echo "However, in the good old days we don't know how to stringify and"
17802 echo "catify at the same time."
17806 Hmm, I don't seem to be able to concatenate tokens with your cpp.
17807 You're going to have to edit the values of CAT[2-5] in config.h...
17809 cpp_stuff="/* Help! How do we handle cpp_stuff? */*/"
17813 : see if this is a db.h system
17819 : Check db version.
17821 echo "Checking Berkeley DB version ..." >&4
17827 #include <sys/types.h>
17829 #$i_stdlib I_STDLIB
17831 #include <stdlib.h>
17834 int main(int argc, char *argv[])
17836 #ifdef DB_VERSION_MAJOR /* DB version >= 2 */
17837 int Major, Minor, Patch ;
17838 unsigned long Version ;
17839 (void)db_version(&Major, &Minor, &Patch) ;
17841 printf("%d %d %d %d %d %d\n",
17842 DB_VERSION_MAJOR, DB_VERSION_MINOR, DB_VERSION_PATCH,
17843 Major, Minor, Patch);
17846 printf("You have Berkeley DB Version 2 or greater.\n");
17848 printf("db.h is from Berkeley DB Version %d.%d.%d\n",
17849 DB_VERSION_MAJOR, DB_VERSION_MINOR, DB_VERSION_PATCH);
17850 printf("libdb is from Berkeley DB Version %d.%d.%d\n",
17851 Major, Minor, Patch) ;
17853 /* check that db.h & libdb are compatible */
17854 if (DB_VERSION_MAJOR != Major || DB_VERSION_MINOR != Minor || DB_VERSION_PATCH != Patch) {
17855 printf("db.h and libdb are incompatible.\n") ;
17859 printf("db.h and libdb are compatible.\n") ;
17861 Version = DB_VERSION_MAJOR * 1000000 + DB_VERSION_MINOR * 1000
17862 + DB_VERSION_PATCH ;
17864 /* needs to be >= 2.3.4 */
17865 if (Version < 2003004) {
17866 /* if (DB_VERSION_MAJOR == 2 && DB_VERSION_MINOR == 0 && DB_VERSION_PATCH < 5) { */
17867 printf("Perl needs Berkeley DB 2.3.4 or greater.\n") ;
17873 #if defined(_DB_H_) && defined(BTREEMAGIC) && defined(HASHMAGIC)
17878 printf("You have Berkeley DB Version 1.\n");
17879 exit(0); /* DB version < 2: the coast is clear. */
17881 exit(1); /* <db.h> not Berkeley DB? */
17887 if eval $compile_ok && $run ./try; then
17888 echo 'Looks OK.' >&4
17890 db_version_major=$1
17891 db_version_minor=$2
17892 db_version_patch=$3
17894 echo "I can't use Berkeley DB with your <db.h>. I'll disable Berkeley DB." >&4
17898 : Remove db from list of libraries to use
17899 echo "Removing unusable -ldb from library list" >&4
17900 set `echo X $libs | $sed -e 's/-ldb / /' -e 's/-ldb$//'`
17903 echo "libs = $libs" >&4
17913 : Check the return type needed for hash
17915 echo "Checking return type needed for hash for Berkeley DB ..." >&4
17921 #include <sys/types.h>
17924 #ifndef DB_VERSION_MAJOR
17925 u_int32_t hash_cb (ptr, size)
17933 info.hash = hash_cb;
17937 if $cc $ccflags -c try.c >try.out 2>&1 ; then
17938 if $contains warning try.out >>/dev/null 2>&1 ; then
17941 db_hashtype='u_int32_t'
17944 : XXX Maybe we should just give up here.
17945 db_hashtype=u_int32_t
17947 echo "Help: I can't seem to compile the db test program." >&4
17948 echo "Something's wrong, but I'll assume you use $db_hashtype." >&4
17951 echo "Your version of Berkeley DB uses $db_hashtype for hash."
17953 *) db_hashtype=u_int32_t
17958 : Check the return type needed for prefix
17960 echo "Checking return type needed for prefix for Berkeley DB ..." >&4
17966 #include <sys/types.h>
17969 #ifndef DB_VERSION_MAJOR
17970 size_t prefix_cb (key1, key2)
17978 info.prefix = prefix_cb;
17982 if $cc $ccflags -c try.c >try.out 2>&1 ; then
17983 if $contains warning try.out >>/dev/null 2>&1 ; then
17984 db_prefixtype='int'
17986 db_prefixtype='size_t'
17989 db_prefixtype='size_t'
17990 : XXX Maybe we should just give up here.
17992 echo "Help: I can't seem to compile the db test program." >&4
17993 echo "Something's wrong, but I'll assume you use $db_prefixtype." >&4
17996 echo "Your version of Berkeley DB uses $db_prefixtype for prefix."
17998 *) db_prefixtype='size_t'
18003 : How can we generate normalized random numbers ?
18005 echo "Looking for a random number function..." >&4
18006 case "$randfunc" in
18008 if set drand48 val -f; eval $csym; $val; then
18010 echo "Good, found drand48()." >&4
18011 elif set random val -f; eval $csym; $val; then
18013 echo "OK, found random()." >&4
18016 echo "Yick, looks like I have to use rand()." >&4
18027 *-Dmy_rand=*|*-Dmy_srand=*)
18028 echo "Removing obsolete -Dmy_rand, -Dmy_srand, and -Drandbits from ccflags." >&4
18029 ccflags="`echo $ccflags | sed -e 's/-Dmy_rand=random/ /'`"
18030 ccflags="`echo $ccflags | sed -e 's/-Dmy_srand=srandom/ /'`"
18031 ccflags="`echo $ccflags | sed -e 's/-Drandbits=[0-9][0-9]*/ /'`"
18035 while $test "$cont"; do
18036 rp="Use which function to generate random numbers?"
18038 if $test "$ans" = "$dflt"; then
18044 if set $ans val -f; eval $csym; $val; then
18048 rp="I cannot find function $ans. Use that name anyway?"
18057 case "$randfunc" in
18059 drand01="drand48()"
18065 case "$randbits" in
18067 echo "Checking to see how many bits your $randfunc() function produces..." >&4
18069 #$i_unistd I_UNISTD
18070 #$i_stdlib I_STDLIB
18073 # include <unistd.h>
18076 # include <stdlib.h>
18081 register unsigned long tmp;
18082 register unsigned long max = 0L;
18084 for (i = 1000; i; i--) {
18085 tmp = (unsigned long) $randfunc();
18086 if (tmp > max) max = tmp;
18088 for (i = 0; max; i++)
18094 if eval $compile_ok; then
18098 echo "(I can't seem to compile the test program...)"
18105 rp="How many bits does your $randfunc() function produce?"
18109 drand01="($randfunc() / (double) ((unsigned long)1 << $randbits))"
18110 seedfunc="s$randfunc"
18111 randseedtype=unsigned
18115 rp="How many bits does your $randfunc() function produce?"
18118 seedfunc="s$randfunc"
18119 drand01="($randfunc() / (double) ((unsigned long)1 << $randbits))"
18120 if set $seedfunc val -f; eval $csym; $val; then
18121 echo "(Using $seedfunc() to seed random generator)"
18123 echo "(Warning: no $seedfunc() to seed random generator)"
18126 randseedtype=unsigned
18134 echo "Determining whether or not we are on an EBCDIC system..." >&4
18135 $cat >try.c <<'EOM'
18138 if ('M'==0xd4) return 0;
18145 if eval $compile_ok; then
18146 if $run ./try; then
18147 echo "You seem to speak EBCDIC." >&4
18150 echo "Nope, no EBCDIC, probably ASCII or some ISO Latin. Or UTF-8." >&4
18153 echo "I'm unable to compile the test program." >&4
18154 echo "I'll assume ASCII or some ISO Latin. Or UTF8." >&4
18162 Checking how to flush all pending stdio output...
18164 # I only know how to find the first 32 possibly open files on SunOS.
18165 # See also hints/sunos_4_1.sh and util.c --AD
18167 sunos) $echo '#define PERL_FFLUSH_ALL_FOPEN_MAX 32' > try.c ;;
18169 $cat >>try.c <<EOCP
18171 #$i_stdlib I_STDLIB
18173 #include <stdlib.h>
18175 #$i_unistd I_UNISTD
18177 # include <unistd.h>
18179 #$d_sysconf HAS_SYSCONF
18180 #$d_stdio_stream_array HAS_STDIO_STREAM_ARRAY
18181 #ifdef HAS_STDIO_STREAM_ARRAY
18182 # define STDIO_STREAM_ARRAY $stdio_stream_array
18187 p = fopen("try.out", "w");
18191 # ifdef TRY_FPRINTF
18195 #ifdef TRY_FFLUSH_NULL
18198 #ifdef TRY_FFLUSH_ALL
18200 long open_max = -1;
18201 # ifdef PERL_FFLUSH_ALL_FOPEN_MAX
18202 open_max = PERL_FFLUSH_ALL_FOPEN_MAX;
18204 # if defined(HAS_SYSCONF) && defined(_SC_OPEN_MAX)
18205 open_max = sysconf(_SC_OPEN_MAX);
18208 open_max = FOPEN_MAX;
18211 open_max = OPEN_MAX;
18220 # ifdef HAS_STDIO_STREAM_ARRAY
18221 if (open_max > 0) {
18223 for (i = 0; i < open_max; i++)
18224 if (STDIO_STREAM_ARRAY[i]._file >= 0 &&
18225 STDIO_STREAM_ARRAY[i]._file < open_max &&
18226 STDIO_STREAM_ARRAY[i]._flag)
18227 fflush(&STDIO_STREAM_ARRAY[i]);
18235 : first we have to find out how _not_ to flush
18237 if $test "X$fflushNULL" = X -o "X$fflushall" = X; then
18239 set try -DTRY_FPUTC
18240 if eval $compile; then
18241 $run ./try 2>/dev/null
18244 if $test ! -s try.out -a "X$code" = X42; then
18250 set try -DTRY_FPRINTF
18251 if eval $compile; then
18252 $run ./try 2>/dev/null
18255 if $test ! -s try.out -a "X$code" = X42; then
18256 output=-DTRY_FPRINTF
18262 : check for fflush NULL behaviour
18263 case "$fflushNULL" in
18264 '') set try -DTRY_FFLUSH_NULL $output
18265 if eval $compile; then
18266 $run ./try 2>/dev/null
18269 if $test -s try.out -a "X$code" = X42; then
18270 fflushNULL="`$cat try.out`"
18272 if $test "X$code" != X42; then
18274 (If this test failed, don't worry, we'll try another method shortly.)
18279 $rm -f core try.core core.try.*
18280 case "$fflushNULL" in
18282 Your fflush(NULL) works okay for output streams.
18283 Let's see if it clobbers input pipes...
18285 # As of mid-March 2000 all versions of Solaris appear to have a stdio
18286 # bug that improperly flushes the input end of pipes. So we avoid the
18287 # autoflush on fork/system/exec support for now. :-(
18288 $cat >tryp.c <<EOCP
18291 main(int argc, char **argv)
18297 while ((i = getc(stdin)) != -1
18298 && (*bp++ = i) != '\n'
18299 && bp < &buf[1024])
18302 fprintf(stdout, "%s", buf);
18310 fflushNULL="$define"
18312 if eval $compile; then
18314 $cat tryp.c | $run ./tryp 2>/dev/null > tryp.out
18315 if cmp tryp.c tryp.out >/dev/null 2>&1; then
18317 fflush(NULL) seems to behave okay with input streams.
18319 fflushNULL="$define"
18322 Ouch, fflush(NULL) clobbers input pipes! We will not use it.
18324 fflushNULL="$undef"
18327 $rm -f core tryp.c tryp.core core.tryp.*
18330 Your fflush(NULL) isn't working (contrary to ANSI C).
18332 fflushNULL="$undef"
18335 Cannot figure out whether your fflush(NULL) works or not.
18336 I'm assuming it doesn't (contrary to ANSI C).
18338 fflushNULL="$undef"
18342 $define|true|[yY]*)
18343 fflushNULL="$define"
18346 fflushNULL="$undef"
18349 : check explicit looping only if NULL did not work, and if the pipe
18350 : bug does not show up on an explicit flush too
18351 case "$fflushNULL" in
18353 $cat >tryp.c <<EOCP
18356 main(int argc, char **argv)
18362 while ((i = getc(stdin)) != -1
18363 && (*bp++ = i) != '\n'
18364 && bp < &buf[1024])
18367 fprintf(stdout, "%s", buf);
18376 if eval $compile; then
18378 $cat tryp.c | $run ./tryp 2>/dev/null > tryp.out
18379 if cmp tryp.c tryp.out >/dev/null 2>&1; then
18381 Good, at least fflush(stdin) seems to behave okay when stdin is a pipe.
18383 : now check for fflushall behaviour
18384 case "$fflushall" in
18385 '') set try -DTRY_FFLUSH_ALL $output
18386 if eval $compile; then
18388 (Now testing the other method--but note that this also may fail.)
18390 $run ./try 2>/dev/null
18393 if $test -s try.out -a "X$code" = X42; then
18394 fflushall="`$cat try.out`"
18397 $rm -f core try.core core.try.*
18398 case "$fflushall" in
18400 Whew. Flushing explicitly all the stdio streams works.
18402 fflushall="$define"
18405 Sigh. Flushing explicitly all the stdio streams doesn't work.
18410 Cannot figure out whether flushing stdio streams explicitly works or not.
18411 I'm assuming it doesn't.
18417 "$define"|true|[yY]*)
18418 fflushall="$define"
18426 All is futile. Even fflush(stdin) clobbers input pipes!
18433 $rm -f core tryp.c tryp.core core.tryp.*
18435 *) fflushall="$undef"
18439 case "$fflushNULL$fflushall" in
18442 OK, I give up. I cannot figure out how to flush pending stdio output.
18443 We won't be flushing handles at all before fork/exec/popen.
18447 $rm -f try.* try$exe_ext
18449 : Store the full pathname to the ar program for use in the C program
18450 : Respect a hint or command line value for full_ar.
18455 : Store the full pathname to the sed program for use in the C program
18458 : see what type gids are declared as in the kernel
18460 echo "Looking for the type for group ids returned by getgid()."
18461 set gid_t gidtype xxx stdio.h sys/types.h
18465 xxx=`./findhdr sys/user.h`
18466 set `grep 'groups\[NGROUPS\];' "$xxx" 2>/dev/null` unsigned short
18468 unsigned) dflt="$1 $2" ;;
18472 *) dflt="$gidtype";;
18475 gid_t) echo "gid_t found." ;;
18476 *) rp="What is the type for group ids returned by getgid()?"
18484 *_t) zzz="$gidtype" ;;
18487 echo "Checking the size of $zzz..." >&4
18489 #include <sys/types.h>
18491 #$i_stdlib I_STDLIB
18493 #include <stdlib.h>
18496 printf("%d\n", (int)sizeof($gidtype));
18501 if eval $compile_ok; then
18505 echo "(I can't execute the test program--guessing $gidsize.)" >&4
18508 echo "Your $zzz is $gidsize bytes long."
18513 echo "(I can't compile the test program--guessing $gidsize.)" >&4
18519 *_t) zzz="$gidtype" ;;
18522 echo "Checking the sign of $zzz..." >&4
18524 #include <sys/types.h>
18535 if eval $compile; then
18539 echo "(I can't execute the test program--guessing unsigned.)" >&4
18543 1) echo "Your $zzz is unsigned." ;;
18544 -1) echo "Your $zzz is signed." ;;
18550 echo "(I can't compile the test program--guessing unsigned.)" >&4
18556 if $test X"$quadtype" != X; then
18558 echo "Checking how to print 64-bit integers..." >&4
18560 if $test X"$sPRId64" = X -a X"$quadtype" = Xint; then
18561 $cat >try.c <<'EOCP'
18562 #include <sys/types.h>
18565 int q = 12345678901;
18566 printf("%ld\n", q);
18570 if eval $compile; then
18574 sPRId64='"d"'; sPRIi64='"i"'; sPRIu64='"u"';
18575 sPRIo64='"o"'; sPRIx64='"x"'; sPRIXU64='"X"';
18576 echo "We will use %d."
18582 if $test X"$sPRId64" = X -a X"$quadtype" = Xlong; then
18583 $cat >try.c <<'EOCP'
18584 #include <sys/types.h>
18587 long q = 12345678901;
18588 printf("%ld\n", q);
18592 if eval $compile; then
18596 sPRId64='"ld"'; sPRIi64='"li"'; sPRIu64='"lu"';
18597 sPRIo64='"lo"'; sPRIx64='"lx"'; sPRIXU64='"lX"';
18598 echo "We will use %ld."
18604 if $test X"$sPRId64" = X -a X"$i_inttypes" = X"$define" -a X"$quadtype" = Xint64_t; then
18605 $cat >try.c <<'EOCP'
18606 #include <sys/types.h>
18607 #include <inttypes.h>
18610 int64_t q = 12345678901;
18611 printf("%" PRId64 "\n", q);
18615 if eval $compile; then
18619 sPRId64=PRId64; sPRIi64=PRIi64; sPRIu64=PRIu64;
18620 sPRIo64=PRIo64; sPRIx64=PRIx64; sPRIXU64=PRIXU64;
18621 echo "We will use the C9X style."
18627 if $test X"$sPRId64" = X -a X"$quadtype" != X; then
18629 #include <sys/types.h>
18632 $quadtype q = 12345678901;
18633 printf("%Ld\n", q);
18637 if eval $compile; then
18641 sPRId64='"Ld"'; sPRIi64='"Li"'; sPRIu64='"Lu"';
18642 sPRIo64='"Lo"'; sPRIx64='"Lx"'; sPRIXU64='"LX"';
18643 echo "We will use %Ld."
18649 if $test X"$sPRId64" = X -a X"$quadtype" = X"long long"; then
18650 $cat >try.c <<'EOCP'
18651 #include <sys/types.h>
18654 long long q = 12345678901LL; /* AIX cc requires the LL suffix. */
18655 printf("%lld\n", q);
18659 if eval $compile; then
18663 sPRId64='"lld"'; sPRIi64='"lli"'; sPRIu64='"llu"';
18664 sPRIo64='"llo"'; sPRIx64='"llx"'; sPRIXU64='"llX"';
18665 echo "We will use the %lld style."
18671 if $test X"$sPRId64" = X -a X"$quadtype" != X; then
18673 #include <sys/types.h>
18676 $quadtype q = 12345678901;
18677 printf("%qd\n", q);
18681 if eval $compile; then
18685 sPRId64='"qd"'; sPRIi64='"qi"'; sPRIu64='"qu"';
18686 sPRIo64='"qo"'; sPRIx64='"qx"'; sPRIXU64='"qX"';
18687 echo "We will use %qd."
18693 if $test X"$sPRId64" = X; then
18694 echo "Cannot figure out how to print 64-bit integers." >&4
18702 '') d_PRId64="$undef"; d_PRIi64="$undef"; d_PRIu64="$undef";
18703 d_PRIo64="$undef"; d_PRIx64="$undef"; d_PRIXU64="$undef";
18705 *) d_PRId64="$define"; d_PRIi64="$define"; d_PRIu64="$define";
18706 d_PRIo64="$define"; d_PRIx64="$define"; d_PRIXU64="$define";
18712 $echo "Checking the format strings to be used for Perl's internal types..." >&4
18714 if $test X"$ivsize" = X8; then
18715 ivdformat="$sPRId64"
18716 uvuformat="$sPRIu64"
18717 uvoformat="$sPRIo64"
18718 uvxformat="$sPRIx64"
18719 uvXUformat="$sPRIXU64"
18721 if $test X"$ivsize" = X"$longsize"; then
18728 if $test X"$ivsize" = X"$intsize"; then
18736 if $test X"$ivsize" = X"$shortsize"; then
18747 if $test X"$uselongdouble" = X"$define" -a X"$d_longdbl" = X"$define" -a X"$d_PRIgldbl" = X"$define"; then
18748 nveformat="$sPRIeldbl"
18749 nvfformat="$sPRIfldbl"
18750 nvgformat="$sPRIgldbl"
18751 nvEUformat="$sPRIEUldbl"
18752 nvFUformat="$sPRIFUldbl"
18753 nvGUformat="$sPRIGUldbl"
18763 case "$ivdformat" in
18764 '') echo "$0: Fatal: failed to find format strings, cannot continue." >&4
18771 $echo "Checking the format string to be used for gids..." >&4
18774 -1) if $test X"$gidsize" = X"$ivsize"; then
18775 gidformat="$ivdformat"
18777 if $test X"$gidsize" = X"$longsize"; then
18780 if $test X"$gidsize" = X"$intsize"; then
18783 if $test X"$gidsize" = X"$shortsize"; then
18790 *) if $test X"$gidsize" = X"$uvsize"; then
18791 gidformat="$uvuformat"
18793 if $test X"$gidsize" = X"$longsize"; then
18796 if $test X"$gidsize" = X"$intsize"; then
18799 if $test X"$gidsize" = X"$shortsize"; then
18808 : see if getgroups exists
18809 set getgroups d_getgrps
18812 : see if setgroups exists
18813 set setgroups d_setgrps
18817 : Find type of 2nd arg to 'getgroups()' and 'setgroups()'
18819 case "$d_getgrps$d_setgrps" in
18821 case "$groupstype" in
18822 '') dflt="$gidtype" ;;
18823 *) dflt="$groupstype" ;;
18826 What type of pointer is the second argument to getgroups() and setgroups()?
18827 Usually this is the same as group ids, $gidtype, but not always.
18830 rp='What type pointer is the second argument to getgroups() and setgroups()?'
18834 *) groupstype="$gidtype";;
18838 echo "Checking if your $make program sets \$(MAKE)..." >&4
18839 case "$make_set_make" in
18841 $sed 's/^X //' > testmake.mak << 'EOF'
18843 X @echo 'maketemp="$(MAKE)"'
18845 case "`$make -f testmake.mak 2>/dev/null`" in
18846 *maketemp=*) make_set_make='#' ;;
18847 *) make_set_make="MAKE=$make" ;;
18849 $rm -f testmake.mak
18852 case "$make_set_make" in
18853 '#') echo "Yup, it does.";;
18854 *) echo "Nope, it doesn't.";;
18857 : see what type is used for mode_t
18858 rp="What is the type used for file modes for system calls (e.g. fchmod())?"
18859 set mode_t modetype int stdio.h sys/types.h
18862 : see if stdarg is available
18864 if $test `./findhdr stdarg.h`; then
18865 echo "<stdarg.h> found." >&4
18868 echo "<stdarg.h> NOT found." >&4
18872 : see if varags is available
18874 if $test `./findhdr varargs.h`; then
18875 echo "<varargs.h> found." >&4
18877 echo "<varargs.h> NOT found, but that's ok (I hope)." >&4
18880 : set up the varargs testing programs
18881 $cat > varargs.c <<EOP
18883 #include <stdarg.h>
18886 #include <varargs.h>
18890 int f(char *p, ...)
18904 p = va_arg(ap, char *);
18909 $cat > varargs <<EOP
18911 if $cc -c $ccflags -D\$1 varargs.c >/dev/null 2>&1; then
18920 : now check which varargs header should be included
18925 if `./varargs I_STDARG`; then
18927 elif `./varargs I_VARARGS`; then
18932 if `./varargs I_VARARGS`; then
18939 echo "I could not find the definition for va_dcl... You have problems..." >&4
18940 val="$undef"; set i_stdarg; eval $setvar
18941 val="$undef"; set i_varargs; eval $setvar
18946 case "$i_varhdr" in
18948 val="$define"; set i_stdarg; eval $setvar
18949 val="$undef"; set i_varargs; eval $setvar
18952 val="$undef"; set i_stdarg; eval $setvar
18953 val="$define"; set i_varargs; eval $setvar
18956 echo "We'll include <$i_varhdr> to get va_dcl definition." >&4;;
18960 : see if we need va_copy
18962 case "$i_stdarg" in
18965 #include <stdarg.h>
18967 #$i_stdlib I_STDLIB
18969 #include <stdlib.h>
18971 #include <signal.h>
18974 ivfprintf(FILE *f, const char *fmt, va_list *valp)
18976 return vfprintf(f, fmt, *valp);
18980 myvfprintf(FILE *f, const char *fmt, va_list val)
18982 return ivfprintf(f, fmt, &val);
18986 myprintf(char *fmt, ...)
18989 va_start(val, fmt);
18990 return myvfprintf(stdout, fmt, val);
18994 main(int ac, char **av)
18996 signal(SIGSEGV, exit);
18998 myprintf("%s%cs all right, then\n", "that", '\'');
19003 if eval $compile && $run ./try 2>&1 >/dev/null; then
19004 case "`$run ./try`" in
19005 "that's all right, then")
19011 yes) echo "It seems that you don't need va_copy()." >&4
19012 need_va_copy="$undef"
19014 *) echo "It seems that va_copy() or similar will be needed." >&4
19015 need_va_copy="$define"
19018 $rm -f try.* core core.* *.core *.core.*
19020 *) echo "You don't have <stdarg.h>, not checking for va_copy()." >&4
19024 : see what type is used for size_t
19025 rp="What is the type used for the length parameter for string functions?"
19026 set size_t sizetype 'unsigned int' stdio.h sys/types.h
19029 : check for type of arguments to gethostbyaddr.
19030 if test "X$netdb_host_type" = X -o "X$netdb_hlen_type" = X; then
19031 case "$d_gethbyaddr" in
19035 Checking to see what type of arguments are accepted by gethostbyaddr().
19037 hdrs="$define sys/types.h
19038 $d_socket sys/socket.h
19039 $i_niin netinet/in.h
19041 $i_unistd unistd.h"
19042 : The first arg can 'char *' or 'void *'
19043 : The second arg is some of integral type
19044 for xxx in in_addr_t 'const void *' 'const char *' 'void *' 'char *'; do
19045 for yyy in size_t long int; do
19046 case "$netdb_host_type" in
19047 '') try="extern struct hostent *gethostbyaddr($xxx, $yyy, int);"
19048 if ./protochk "$try" $hdrs; then
19049 echo "Your system accepts $xxx for the first arg."
19050 echo "...and $yyy for the second arg."
19051 netdb_host_type="$xxx"
19052 netdb_hlen_type="$yyy"
19058 : In case none of those worked, prompt the user.
19059 case "$netdb_host_type" in
19060 '') rp='What is the type for the 1st argument to gethostbyaddr?'
19063 netdb_host_type=$ans
19064 rp='What is the type for the 2nd argument to gethostbyaddr?'
19067 netdb_hlen_type=$ans
19071 *) : no gethostbyaddr, so pick harmless defaults
19072 netdb_host_type='char *'
19073 netdb_hlen_type="$sizetype"
19076 # Remove the "const" if needed. -- but then we'll have a
19078 # netdb_host_type=`echo "$netdb_host_type" | sed 's/^const //'`
19081 : check for type of argument to gethostbyname.
19082 if test "X$netdb_name_type" = X ; then
19083 case "$d_gethbyname" in
19087 Checking to see what type of argument is accepted by gethostbyname().
19089 hdrs="$define sys/types.h
19090 $d_socket sys/socket.h
19091 $i_niin netinet/in.h
19093 $i_unistd unistd.h"
19094 for xxx in "const char *" "char *"; do
19095 case "$netdb_name_type" in
19096 '') try="extern struct hostent *gethostbyname($xxx);"
19097 if ./protochk "$try" $hdrs; then
19098 echo "Your system accepts $xxx."
19099 netdb_name_type="$xxx"
19104 : In case none of those worked, prompt the user.
19105 case "$netdb_name_type" in
19106 '') rp='What is the type for the 1st argument to gethostbyname?'
19109 netdb_name_type=$ans
19113 *) : no gethostbyname, so pick harmless default
19114 netdb_name_type='char *'
19119 : check for type of 1st argument to getnetbyaddr.
19120 if test "X$netdb_net_type" = X ; then
19121 case "$d_getnbyaddr" in
19125 Checking to see what type of 1st argument is accepted by getnetbyaddr().
19127 hdrs="$define sys/types.h
19128 $d_socket sys/socket.h
19129 $i_niin netinet/in.h
19131 $i_unistd unistd.h"
19132 for xxx in in_addr_t "unsigned long" long "unsigned int" int; do
19133 case "$netdb_net_type" in
19134 '') try="extern struct netent *getnetbyaddr($xxx, int);"
19135 if ./protochk "$try" $hdrs; then
19136 echo "Your system accepts $xxx."
19137 netdb_net_type="$xxx"
19142 : In case none of those worked, prompt the user.
19143 case "$netdb_net_type" in
19144 '') rp='What is the type for the 1st argument to getnetbyaddr?'
19147 netdb_net_type=$ans
19151 *) : no getnetbyaddr, so pick harmless default
19152 netdb_net_type='long'
19156 : locate the preferred pager for this system
19163 [a-zA-Z]:/*) dflt=$pg;;
19167 [a-zA-Z]:/*) dflt=$more;;
19171 [a-zA-Z]:/*) dflt=$less;;
19174 '') dflt=/usr/ucb/more;;
19178 : Instruct ./getfile to trust the hinted or previous pager value,
19179 : even if it does not begin with a slash. For example, on os2,
19180 : pager might be cmd /c more. See comments in UU/getfile.
19185 rp='What pager is used on your system?'
19189 : see what type pids are declared as in the kernel
19190 rp="What is the type of process ids on this system?"
19191 set pid_t pidtype int stdio.h sys/types.h
19194 : see if ar generates random libraries by itself
19196 echo "Checking how to generate random libraries on your machine..." >&4
19197 echo 'int bar1() { return bar2(); }' > bar1.c
19198 echo 'int bar2() { return 2; }' > bar2.c
19200 #$i_stdlib I_STDLIB
19202 #include <stdlib.h>
19204 int main() { printf("%d\n", bar1()); exit(0); }
19206 $cc $ccflags -c bar1.c >/dev/null 2>&1
19207 $cc $ccflags -c bar2.c >/dev/null 2>&1
19208 $cc $ccflags -c foo.c >/dev/null 2>&1
19209 $ar rc bar$_a bar2$_o bar1$_o >/dev/null 2>&1
19210 if $cc -o foobar $ccflags $ldflags foo$_o bar$_a $libs > /dev/null 2>&1 &&
19211 $run ./foobar >/dev/null 2>&1; then
19212 echo "$ar appears to generate random libraries itself."
19214 if [ "X$ranlib" = "X" ]; then
19217 elif $ar ts bar$_a >/dev/null 2>&1 &&
19218 $cc -o foobar $ccflags $ldflags foo$_o bar$_a $libs > /dev/null 2>&1 &&
19219 $run ./foobar >/dev/null 2>&1; then
19220 echo "a table of contents needs to be added with '$ar ts'."
19227 ranlib=`./loc ranlib X /usr/bin /bin /usr/local/bin`
19228 $test -f $ranlib || ranlib=''
19231 if $test -n "$ranlib"; then
19232 echo "your system has '$ranlib'; we'll use that."
19235 echo "your system doesn't seem to support random libraries"
19236 echo "so we'll use lorder and tsort to order the libraries."
19243 : check for type of arguments to select.
19244 case "$selecttype" in
19245 '') case "$d_select" in
19249 Checking to see what type of arguments are accepted by select().
19251 hdrs="$define sys/types.h
19252 $i_systime sys/time.h
19253 $i_sysselct sys/select.h
19254 $d_socket sys/socket.h"
19255 : The first arg can be int, unsigned, or size_t
19256 : The last arg may or may not be 'const'
19258 : void pointer has been seen but using that
19259 : breaks the selectminbits test
19260 for xxx in 'fd_set *' 'int *'; do
19261 for nfd in 'int' 'size_t' 'unsigned long' 'unsigned' ; do
19262 for tmo in 'struct timeval *' 'const struct timeval *'; do
19264 '') try="extern select _(($nfd, $xxx, $xxx, $xxx, $tmo));"
19265 if ./protochk "$try" $hdrs; then
19266 echo "Your system accepts $xxx."
19275 '') rp='What is the type for the 2nd, 3rd, and 4th arguments to select?'
19276 case "$d_fd_set" in
19277 $define) dflt="fd_set *" ;;
19286 *) : no select, so pick a harmless default
19293 : check for the select 'width'
19294 case "$selectminbits" in
19295 '') safebits=`expr $ptrsize \* 8`
19296 case "$d_select" in
19300 Checking to see on how many bits at a time your select() operates...
19303 #include <sys/types.h>
19305 #$i_systime I_SYS_TIME
19306 #$i_systimek I_SYS_TIME_KERNEL
19311 # ifdef I_SYS_TIME_KERNEL
19314 # include <sys/time.h>
19315 # ifdef I_SYS_TIME_KERNEL
19319 #$i_sysselct I_SYS_SELECT
19320 #ifdef I_SYS_SELECT
19321 #include <sys/select.h>
19323 #$d_socket HAS_SOCKET
19325 # include <sys/socket.h> /* Might include <sys/bsdtypes.h> */
19328 #$i_stdlib I_STDLIB
19330 #include <stdlib.h>
19333 #define S sizeof(*(b))
19335 #define NBYTES (S * 8 > MINBITS ? S : MINBITS/8)
19336 #define NBITS (NBYTES * 8)
19338 char *s = malloc(NBYTES);
19347 fp = fopen("try.c", "r");
19353 b = ($selecttype)s;
19354 for (i = 0; i < NBITS; i++)
19358 select(fd + 1, b, 0, 0, &t);
19359 for (i = NBITS - 1; i > fd && FD_ISSET(i, b); i--);
19361 printf("%d\n", i + 1);
19366 if eval $compile_ok; then
19367 selectminbits=`$run ./try`
19368 case "$selectminbits" in
19370 Cannot figure out on how many bits at a time your select() operates.
19371 I'll play safe and guess it is $safebits bits.
19373 selectminbits=$safebits
19374 bits="$safebits bits"
19377 *) bits="$selectminbits bits" ;;
19379 echo "Your select() operates on $bits at a time." >&4
19381 rp='What is the minimum number of bits your select() operates on?'
19382 case "$byteorder" in
19383 12345678) dflt=64 ;;
19389 selectminbits="$val"
19393 *) : no select, so pick a harmless default
19394 selectminbits=$safebits
19400 : Trace out the files included by signal.h, then look for SIGxxx names.
19401 : Remove SIGARRAYSIZE used by HPUX.
19402 : Remove SIGSTKSIZE used by Linux.
19403 : Remove SIGSTKSZ used by Posix.
19404 : Remove SIGTYP void lines used by OS2.
19405 : Some cpps, like os390, dont give the file name anywhere
19406 if [ "X$fieldn" = X ]; then
19407 : Just make some guesses. We check them later.
19408 xxx='/usr/include/signal.h /usr/include/sys/signal.h'
19410 xxx=`echo '#include <signal.h>' |
19411 $cppstdin $cppminus $cppflags 2>/dev/null |
19412 $grep '^[ ]*#.*include' |
19413 $awk "{print \\$$fieldn}" | $sed 's!"!!g' | $sed 's!\\\\\\\\!/!g' | $sort | $uniq`
19415 : Check this list of files to be sure we have parsed the cpp output ok.
19416 : This will also avoid potentially non-existent files, such
19419 for xx in $xxx /dev/null ; do
19420 $test -f "$xx" && xxxfiles="$xxxfiles $xx"
19422 : If we have found no files, at least try signal.h
19423 case "$xxxfiles" in
19424 '') xxxfiles=`./findhdr signal.h` ;;
19427 $1 ~ /^#define$/ && $2 ~ /^SIG[A-Z0-9]*$/ && $2 !~ /SIGARRAYSIZE/ && $2 !~ /SIGSTKSIZE/ && $2 !~ /SIGSTKSZ/ && $3 !~ /void/ {
19428 print substr($2, 4, 20)
19430 $1 == "#" && $2 ~ /^define$/ && $3 ~ /^SIG[A-Z0-9]*$/ && $3 !~ /SIGARRAYSIZE/ && $4 !~ /void/ {
19431 print substr($3, 4, 20)
19433 : Append some common names just in case the awk scan failed.
19434 xxx="$xxx ABRT ALRM BUS CANCEL CHLD CLD CONT DIL EMT FPE"
19435 xxx="$xxx FREEZE HUP ILL INT IO IOT KILL LOST LWP PHONE"
19436 xxx="$xxx PIPE POLL PROF PWR QUIT RTMAX RTMIN SEGV STKFLT STOP"
19437 xxx="$xxx SYS TERM THAW TRAP TSTP TTIN TTOU URG USR1 USR2"
19438 xxx="$xxx USR3 USR4 VTALRM WAITING WINCH WIND WINDOW XCPU XFSZ"
19440 : generate a few handy files for later
19441 $cat > signal.c <<EOCP
19442 #include <sys/types.h>
19443 #include <signal.h>
19444 #$i_stdlib I_STDLIB
19446 #include <stdlib.h>
19451 /* Strange style to avoid deeply-nested #if/#else/#endif */
19454 # define NSIG (_NSIG)
19460 # define NSIG (SIGMAX+1)
19466 # define NSIG (SIG_MAX+1)
19472 # define NSIG (_SIG_MAX+1)
19478 # define NSIG (MAXSIG+1)
19484 # define NSIG (MAX_SIG+1)
19489 # ifdef SIGARRAYSIZE
19490 # define NSIG SIGARRAYSIZE /* Assume ary[SIGARRAYSIZE] */
19496 # define NSIG (_sys_nsig) /* Solaris 2.5 */
19500 /* Default to some arbitrary number that's big enough to get most
19501 of the common signals.
19507 printf("NSIG %d\n", NSIG);
19513 echo $xxx | $tr ' ' $trnl | $sort | $uniq | $awk '
19515 printf "#ifdef SIG"; printf $1; printf "\n"
19516 printf "printf(\""; printf $1; printf " %%d\\n\",SIG";
19517 printf $1; printf ");\n"
19521 printf "#endif /* JUST_NSIG */\n";
19522 printf "exit(0);\n}\n";
19525 $cat >signal.awk <<'EOP'
19526 BEGIN { ndups = 0 }
19527 $1 ~ /^NSIG$/ { nsig = $2 }
19528 ($1 !~ /^NSIG$/) && (NF == 2) && ($2 ~ /^[0-9][0-9]*$/) {
19529 if ($2 > maxsig) { maxsig = $2 }
19530 if (sig_name[$2]) {
19531 dup_name[ndups] = $1
19532 dup_num[ndups] = $2
19544 printf("NSIG %d\n", nsig);
19545 for (n = 1; n < nsig; n++) {
19547 printf("%s %d\n", sig_name[n], sig_num[n])
19550 printf("NUM%d %d\n", n, n)
19553 for (n = 0; n < ndups; n++) {
19554 printf("%s %d\n", dup_name[n], dup_num[n])
19558 $cat >signal_cmd <<EOS
19560 if $test -s signal.lst; then
19561 echo "Using your existing signal.lst file"
19566 $cat >>signal_cmd <<'EOS'
19569 if eval $compile_ok; then
19570 $run ./signal$_exe | ($sort -n -k 2 2>/dev/null || $sort -n +1) | $uniq | $awk -f signal.awk >signal.lst
19572 echo "(I can't seem be able to compile the whole test program)" >&4
19573 echo "(I'll try it in little pieces.)" >&4
19574 set signal -DJUST_NSIG
19575 if eval $compile_ok; then
19576 $run ./signal$_exe > signal.nsg
19579 echo "I can't seem to figure out how many signals you have." >&4
19580 echo "Guessing 50." >&4
19581 echo 'NSIG 50' > signal.nsg
19583 : Now look at all the signal names, one at a time.
19584 for xx in `echo $xxx | $tr ' ' $trnl | $sort | $uniq`; do
19585 $cat > signal.c <<EOCP
19586 #include <sys/types.h>
19587 #include <signal.h>
19590 printf("$xx %d\n", SIG${xx});
19595 if eval $compile; then
19596 echo "SIG${xx} found."
19597 $run ./signal$_exe >> signal.ls1
19599 echo "SIG${xx} NOT found."
19602 if $test -s signal.ls1; then
19603 $cat signal.nsg signal.ls1 |
19604 $sort -n | $uniq | $awk -f signal.awk >signal.lst
19608 if $test -s signal.lst; then
19611 echo "(AAK! I can't compile the test programs -- Guessing)" >&4
19612 echo 'kill -l' >signal
19613 set X `csh -f <signal`
19617 0) set HUP INT QUIT ILL TRAP ABRT EMT FPE KILL BUS SEGV SYS PIPE ALRM TERM;;
19619 echo $@ | $tr ' ' $trnl | \
19620 $awk '{ printf "%s %d\n", $1, ++s; }
19621 END { printf "NSIG %d\n", ++s }' >signal.lst
19623 $rm -f signal.c signal$_exe signal$_o signal.nsg signal.ls1
19625 chmod a+x signal_cmd
19626 $eunicefix signal_cmd
19628 : generate list of signal names
19630 case "$sig_name_init" in
19632 *) case "$sig_num_init" in
19633 ''|*,*) doinit=yes ;;
19638 echo "Generating a list of signal names and numbers..." >&4
19640 sig_count=`$awk '/^NSIG/ { printf "%d", $2 }' signal.lst`
19641 sig_name=`$awk 'BEGIN { printf "ZERO " }
19642 !/^NSIG/ { printf "%s ", $1 }' signal.lst`
19643 sig_num=`$awk 'BEGIN { printf "0 " }
19644 !/^NSIG/ { printf "%d ", $2 }' signal.lst`
19645 sig_name_init=`$awk 'BEGIN { printf "\"ZERO\", " }
19646 !/^NSIG/ { printf "\"%s\", ", $1 }
19647 END { printf "0\n" }' signal.lst`
19648 sig_num_init=`$awk 'BEGIN { printf "0, " }
19649 !/^NSIG/ { printf "%d, ", $2}
19650 END { printf "0\n"}' signal.lst`
19653 echo "The following $sig_count signals are available:"
19655 echo $sig_name | $awk \
19656 'BEGIN { linelen = 0 }
19658 for (i = 1; i <= NF; i++) {
19659 name = "SIG" $i " "
19660 linelen = linelen + length(name)
19661 if (linelen > 70) {
19663 linelen = length(name)
19669 sig_size=`echo $sig_name | awk '{print NF}'`
19670 $rm -f signal signal.c signal.awk signal.lst signal_cmd
19673 case "$sizetype" in
19674 *_t) zzz="$sizetype" ;;
19675 *) zzz="filesize" ;;
19677 echo "Checking the size of $zzz..." >&4
19679 #include <sys/types.h>
19681 #$i_stdlib I_STDLIB
19683 #include <stdlib.h>
19686 printf("%d\n", (int)sizeof($sizetype));
19691 if eval $compile_ok; then
19695 echo "(I can't execute the test program--guessing $sizesize.)" >&4
19698 echo "Your $zzz size is $sizesize bytes."
19703 echo "(I can't compile the test program--guessing $sizesize.)" >&4
19707 : check for socklen_t
19709 echo "Checking to see if you have socklen_t..." >&4
19711 #include <sys/types.h>
19712 #$d_socket HAS_SOCKET
19714 #include <sys/socket.h>
19716 int main() { socklen_t x = 16; }
19719 if eval $compile; then
19721 echo "You have socklen_t."
19724 echo "You do not have socklen_t."
19725 case "$sizetype" in
19726 size_t) echo "(You do have size_t, that might work. Some people are happy with just an int.)" ;;
19733 : see if this is a socks.h system
19734 set socks.h i_socks
19737 : check for type of the size argument to socket calls
19738 case "$d_socket" in
19742 Checking to see what type is the last argument of accept().
19745 case "$d_socklen_t" in
19746 "$define") yyy="$yyy socklen_t"
19748 yyy="$yyy $sizetype int long unsigned"
19749 for xxx in $yyy; do
19750 case "$socksizetype" in
19751 '') try="extern int accept(int, struct sockaddr *, $xxx *);"
19752 case "$usesocks" in
19754 if ./protochk "$try" $i_systypes sys/types.h $d_socket sys/socket.h literal '#define INCLUDE_PROTOTYPES' $i_socks socks.h.; then
19755 echo "Your system accepts '$xxx *' for the last argument of accept()."
19756 socksizetype="$xxx"
19759 *) if ./protochk "$try" $i_systypes sys/types.h $d_socket sys/socket.h; then
19760 echo "Your system accepts '$xxx *' for the last argument of accept()."
19761 socksizetype="$xxx"
19768 : In case none of those worked, prompt the user.
19769 case "$socksizetype" in
19770 '') rp='What is the type for socket address structure sizes?'
19777 *) : no sockets, so pick relatively harmless default
19782 : see what type is used for signed size_t
19783 set ssize_t ssizetype int stdio.h sys/types.h
19788 #$i_stdlib I_STDLIB
19790 #include <stdlib.h>
19792 #include <sys/types.h>
19793 #define Size_t $sizetype
19794 #define SSize_t $dflt
19797 if (sizeof(Size_t) == sizeof(SSize_t))
19799 else if (sizeof(Size_t) == sizeof(int))
19808 if eval $compile_ok && $run ./try > /dev/null; then
19809 ssizetype=`$run ./try`
19810 echo "I'll be using $ssizetype for functions returning a byte count." >&4
19813 Help! I can't compile and run the ssize_t test program: please enlighten me!
19814 (This is probably a misconfiguration in your system or libraries, and
19815 you really ought to fix it. Still, I'll try anyway.)
19817 I need a type that is the same size as $sizetype, but is guaranteed to
19818 be signed. Common values are ssize_t, int and long.
19821 rp="What signed type is the same size as $sizetype?"
19827 : see what type of char stdio uses.
19829 echo '#include <stdio.h>' > stdio.c
19830 $cppstdin $cppminus < stdio.c > stdioh
19831 if $contains 'unsigned.*char.*_ptr;' stdioh >/dev/null 2>&1 ; then
19832 echo "Your stdio uses unsigned chars." >&4
19833 stdchar="unsigned char"
19835 echo "Your stdio uses signed chars." >&4
19838 $rm -f stdio.* stdioh
19840 : see what type uids are declared as in the kernel
19842 echo "Looking for the type for user ids returned by getuid()."
19843 set uid_t uidtype xxx stdio.h sys/types.h
19847 xxx=`./findhdr sys/user.h`
19848 set `grep '_ruid;' "$xxx" 2>/dev/null` unsigned short
19850 unsigned) dflt="$1 $2" ;;
19854 *) dflt="$uidtype";;
19857 uid_t) echo "uid_t found." ;;
19858 *) rp="What is the type for user ids returned by getuid()?"
19866 *_t) zzz="$uidtype" ;;
19869 echo "Checking the size of $zzz..." >&4
19871 #include <sys/types.h>
19873 #$i_stdlib I_STDLIB
19875 #include <stdlib.h>
19878 printf("%d\n", (int)sizeof($uidtype));
19883 if eval $compile_ok; then
19887 echo "(I can't execute the test program--guessing $uidsize.)" >&4
19890 echo "Your $zzz is $uidsize bytes long."
19895 echo "(I can't compile the test program--guessing $uidsize.)" >&4
19900 *_t) zzz="$uidtype" ;;
19903 echo "Checking the sign of $zzz..." >&4
19905 #include <sys/types.h>
19916 if eval $compile; then
19920 echo "(I can't execute the test program--guessing unsigned.)" >&4
19924 1) echo "Your $zzz is unsigned." ;;
19925 -1) echo "Your $zzz is signed." ;;
19931 echo "(I can't compile the test program--guessing unsigned.)" >&4
19937 $echo "Checking the format string to be used for uids..." >&4
19940 -1) if $test X"$uidsize" = X"$ivsize"; then
19941 uidformat="$ivdformat"
19943 if $test X"$uidsize" = X"$longsize"; then
19946 if $test X"$uidsize" = X"$intsize"; then
19949 if $test X"$uidsize" = X"$shortsize"; then
19956 *) if $test X"$uidsize" = X"$uvsize"; then
19957 uidformat="$uvuformat"
19959 if $test X"$uidsize" = X"$longsize"; then
19962 if $test X"$uidsize" = X"$intsize"; then
19965 if $test X"$uidsize" = X"$shortsize"; then
19975 case "$usesitecustomize" in
19976 $define|true|[Yy]*)
19977 usesitecustomize="$define"
19980 usesitecustomize="$undef"
19984 : determine compiler compiler
19993 if $test -f "$byacc$_exe"; then
19995 comp="byacc or $comp"
19997 if $test -f "$bison$_exe"; then
19998 comp="$comp or bison -y"
20000 rp="Which compiler compiler ($comp) shall I use?"
20009 echo "(Adding -y option to bison to get yacc-compatible behaviour.)"
20015 : see if this is a fp.h system
20019 : see if this is a fp_class.h system
20020 set fp_class.h i_fp_class
20023 : see if this is a ieeefp.h system
20024 case "$i_ieeefp" in
20025 '' ) set ieeefp.h i_ieeefp
20030 : see if this is a libutil.h system
20031 set libutil.h i_libutil
20034 : see if mach cthreads are available
20035 if test "X$usethreads" = "X$define"; then
20036 set mach/cthreads.h i_machcthr
20039 i_machcthr="$undef"
20044 : see if this is a mntent.h system
20045 set mntent.h i_mntent
20048 : see if ndbm.h is available
20054 # Some Linux distributions such as RedHat 7.1 put the
20055 # ndbm.h header in /usr/include/gdbm/ndbm.h.
20056 if $test -f /usr/include/gdbm/ndbm.h; then
20057 echo '<gdbm/ndbm.h> found.'
20058 ccflags="$ccflags -I/usr/include/gdbm"
20059 cppflags="$cppflags -I/usr/include/gdbm"
20067 : see if dbm_open exists
20068 set dbm_open d_dbm_open
20070 case "$d_dbm_open" in
20073 echo "We won't be including <ndbm.h>"
20082 : see if net/errno.h is available
20084 set net/errno.h val
20087 : Unfortunately, it causes problems on some systems. Arrgh.
20090 cat > try.c <<'EOM'
20093 #include <net/errno.h>
20099 if $cc $ccflags -c try.c >/dev/null 2>&1; then
20100 echo "We'll be including <net/errno.h>." >&4
20102 echo "We won't be including <net/errno.h>." >&4
20111 : see if netinet/tcp.h is available
20112 set netinet/tcp.h i_netinettcp
20115 : see if this is a poll.h system
20119 : see if this is a prot.h system
20124 $echo "Guessing which symbols your C compiler and preprocessor define..." >&4
20125 $cat <<'EOSH' > Cppsym.know
20126 a29k ABI64 aegis AES_SOURCE AIX AIX32 AIX370
20127 AIX41 AIX42 AIX43 AIX_SOURCE aixpc ALL_SOURCE
20128 alliant alpha am29000 AM29000 AMD64 amd64 amiga AMIGAOS AMIX
20129 ansi ANSI_C_SOURCE apollo ardent ARM32 atarist att386 att3b
20130 BeOS BIG_ENDIAN BIT_MSF bsd BSD bsd43 bsd4_2 bsd4_3 BSD4_3 bsd4_4
20131 BSD_4_3 BSD_4_4 BSD_NET2 BSD_TIME BSD_TYPES BSDCOMPAT bsdi
20132 bull c cadmus clipper CMU COFF COMPILER_VERSION
20133 concurrent convex cpu cray CRAY CRAYMPP ctix CX_UX
20134 CYGWIN DECC DGUX DGUX_SOURCE DJGPP dmert DOLPHIN DPX2 DSO
20135 Dynix DynixPTX ELF encore EPI EXTENSIONS FAVOR_BSD
20136 FILE_OFFSET_BITS FreeBSD GCC_NEW_VARARGS gcos gcx gimpel
20138 GNU_SOURCE GNUC GNUC_MINOR GNU_LIBRARY GO32 gould GOULD_PN
20139 H3050R H3050RX hbullx20 hcx host_mips
20140 hp200 hp300 hp700 HP700 hp800 hp9000
20141 hp9000s200 hp9000s300 hp9000s400 hp9000s500
20142 hp9000s700 hp9000s800 hp9k8 hp_osf hppa hpux HPUX_SOURCE
20143 i186 i286 i386 i486 i586 i686 i8086 i80960 i860 I960
20144 IA64 iAPX286 ibm ibm032 ibmesa IBMR2 ibmrt ILP32 ILP64
20145 INLINE_INTRINSICS INTRINSICS INT64 interdata is68k ksr1
20146 LANGUAGE_C LARGE_FILE_API LARGEFILE64_SOURCE
20147 LARGEFILE_SOURCE LFS64_LARGEFILE LFS_LARGEFILE
20148 Linux LITTLE_ENDIAN LONG64 LONG_DOUBLE LONG_LONG
20149 LONGDOUBLE LONGLONG LP64 luna luna88k Lynx
20150 M68000 m68k m88100 m88k M88KBCS_TARGET M_COFF
20151 M_I186 M_I286 M_I386 M_I8086 M_I86 M_I86SM M_SYS3
20152 M_SYS5 M_SYSIII M_SYSV M_UNIX M_XENIX MACH machine MachTen
20153 MATH_HAS_NO_SIDE_EFFECTS
20154 mc300 mc500 mc68000 mc68010 mc68020 mc68030 mc68040
20155 mc68060 mc68k mc68k32 mc700 mc88000 mc88100 merlin
20156 mert MiNT mips MIPS_FPSET MIPS_ISA MIPS_SIM MIPS_SZINT
20157 MIPS_SZLONG MIPS_SZPTR MIPSEB MIPSEL MODERN_C motorola
20158 mpeix MSDOS MTXINU MULTIMAX mvs MVS n16 ncl_el ncl_mr
20159 NetBSD news1500 news1700 news1800 news1900 news3700
20160 news700 news800 news900 NeXT NLS nonstopux ns16000 ns32000
20161 ns32016 ns32332 ns32k nsc32000
20162 OCS88 OEMVS OpenBSD os OS2 OS390 osf OSF1 OSF_SOURCE
20163 pa_risc PA_RISC1_1 PA_RISC2_0 PARAGON parisc
20164 pc532 pdp11 PGC PIC plexus PORTAR posix
20165 POSIX1B_SOURCE POSIX2_SOURCE POSIX4_SOURCE
20166 POSIX_C_SOURCE POSIX_SOURCE POWER
20167 PROTOTYPES PWB pyr QNX R3000 REENTRANT RES Rhapsody RISC6000
20168 riscix riscos RT S390 SA110 scs SCO sequent sgi SGI_SOURCE SH3 sinix
20169 SIZE_INT SIZE_LONG SIZE_PTR SOCKET_SOURCE SOCKETS_SOURCE
20170 sony sony_news sonyrisc sparc sparclite spectrum
20171 stardent stdc STDC_EXT stratos sun sun3 sun386
20172 Sun386i svr3 svr4 SVR4_2 SVR4_SOURCE svr5
20173 SX system SYSTYPE_BSD SYSTYPE_BSD43 SYSTYPE_BSD44
20174 SYSTYPE_SVR4 SYSTYPE_SVR5 SYSTYPE_SYSV SYSV SYSV3 SYSV4 SYSV5
20175 sysV68 sysV88 Tek4132 Tek4300 titan
20176 TM3200 TM5400 TM5600
20177 tower tower32 tower32_200 tower32_600 tower32_700
20178 tower32_800 tower32_850 tss
20179 u370 u3b u3b2 u3b20 u3b200 u3b20d u3b5
20180 ultrix UMAXV UnicomPBB UnicomPBD UNICOS UNICOSMK
20181 unix UNIX95 UNIX99 unixpc unos
20182 USE_BSD USE_FILE_OFFSET64 USE_GNU USE_ISOC9X USE_LARGEFILE USE_LARGEFILE64
20183 USE_MISC USE_POSIX USE_POSIX199309 USE_POSIX199506 USE_POSIX2
20184 USE_REENTRANT USE_SVID USE_UNIX98 USE_XOPEN USE_XOPEN_EXTENDED
20186 Utek UTek UTS UWIN uxpm uxps vax venix VMESA vms x86_64 xenix Xenix286
20187 XOPEN_SOURCE XOPEN_SOURCE_EXTENDED XPG2 XPG2_EXTENDED
20188 XPG3 XPG3_EXTENDED XPG4 XPG4_EXTENDED
20191 # Maybe put other stuff here too.
20192 cat <<EOSH >>Cppsym.know
20195 ./tr '[a-z]' '[A-Z]' < Cppsym.know > Cppsym.a
20196 ./tr '[A-Z]' '[a-z]' < Cppsym.know > Cppsym.b
20197 $cat Cppsym.know > Cppsym.c
20198 $cat Cppsym.a Cppsym.b Cppsym.c | $tr ' ' $trnl | $sort | $uniq > Cppsym.know
20199 $rm -f Cppsym.a Cppsym.b Cppsym.c
20200 cat <<EOSH > Cppsym
20202 if $test \$# -gt 0; then
20203 echo \$* | $tr " " "$trnl" | ./Cppsym.try > Cppsym.got
20204 if $test -s Cppsym.got; then
20211 $tr " " "$trnl" | ./Cppsym.try
20217 cat <<EOSH > Cppsym.try
20219 cat <<'EOCP' > try.c
20222 #define STRINGIFY(a) "a"
20224 #if cpp_stuff == 42
20225 #define StGiFy(a) #a
20226 #define STRINGIFY(a) StGiFy(a)
20228 #if $cpp_stuff != 1 && $cpp_stuff != 42
20229 # include "Bletch: How does this C preprocessor stringify macros?"
20235 cat <<'EOSH' >> Cppsym.try
20237 printf "#ifdef %s\nprintf(\"%s=%%s\\n\", STRINGIFY(%s));\n#endif\n", $1, $1, $1
20238 printf "#ifdef _%s\nprintf(\"_%s=%%s\\n\", STRINGIFY(_%s));\n#endif\n", $1, $1, $1
20239 printf "#ifdef __%s\nprintf(\"__%s=%%s\\n\", STRINGIFY(__%s));\n#endif\n", $1, $1, $1
20240 printf "#ifdef __%s__\nprintf(\"__%s__=%%s\\n\", STRINGIFY(__%s__));\n#endif\n", $1, $1, $1
20242 echo 'return 0;}' >> try.c
20244 cat <<EOSH >> Cppsym.try
20246 case "$osname-$gccversion" in
20247 irix-) ccflags="\$ccflags -woff 1178" ;;
20248 os2-*) ccflags="\$ccflags -Zlinker /PM:VIO" ;;
20250 $cc -o try -Dcpp_stuff=$cpp_stuff $optimize \$ccflags $ldflags try.c $libs && $run ./try | $sed 's/ /\\\\ /g'
20252 chmod +x Cppsym.try
20253 $eunicefix Cppsym.try
20254 ./Cppsym < Cppsym.know > Cppsym.true
20255 : now check the C compiler for additional symbols
20256 postprocess_cc_v=''
20258 aix) postprocess_cc_v="|$tr , ' '" ;;
20265 for i in \`$cc -v -c tmp.c 2>&1 $postprocess_cc_v\`
20268 -D*) echo "\$i" | $sed 's/^-D//';;
20269 -A*) $test "$gccversion" && echo "\$i" | $sed 's/^-A//' | $sed 's/\(.*\)(\(.*\))/\1=\2/';;
20274 postprocess_cc_v=''
20277 ./ccsym > ccsym1.raw
20278 if $test -s ccsym1.raw; then
20279 $sort ccsym1.raw | $uniq >ccsym.raw
20281 mv ccsym1.raw ccsym.raw
20284 $awk '/\=/ { print $0; next }
20285 { print $0"=1" }' ccsym.raw >ccsym.list
20286 $comm -13 Cppsym.true ccsym.list >ccsym.own
20287 $comm -12 Cppsym.true ccsym.list >ccsym.com
20288 $comm -23 Cppsym.true ccsym.list >ccsym.cpp
20290 if $test -z ccsym.raw; then
20291 echo "Your C compiler doesn't seem to define any symbols!" >&4
20293 echo "However, your C preprocessor defines the following symbols:"
20296 cppsymbols=`$cat Cppsym.true`
20297 cppsymbols=`echo $cppsymbols`
20298 cppccsymbols="$cppsymbols"
20300 if $test -s ccsym.com; then
20301 echo "Your C compiler and pre-processor define these symbols:"
20302 $sed -e 's/\(..*\)=.*/\1/' ccsym.com
20305 cppccsymbols=`$cat ccsym.com`
20306 cppccsymbols=`echo $cppccsymbols`
20307 $test "$silent" || sleep 1
20309 if $test -s ccsym.cpp; then
20310 $test "$also" && echo " "
20311 echo "Your C pre-processor ${also}defines the following symbols:"
20312 $sed -e 's/\(..*\)=.*/\1/' ccsym.cpp
20314 cppsymbols=`$cat ccsym.cpp`
20315 cppsymbols=`echo $cppsymbols`
20316 $test "$silent" || sleep 1
20318 if $test -s ccsym.own; then
20319 $test "$also" && echo " "
20320 echo "Your C compiler ${also}defines the following cpp symbols:"
20321 $sed -e 's/\(..*\)=1/\1/' ccsym.own
20322 $sed -e 's/\(..*\)=.*/\1/' ccsym.own | $uniq >>Cppsym.true
20323 ccsymbols=`$cat ccsym.own`
20324 ccsymbols=`echo $ccsymbols`
20325 $test "$silent" || sleep 1
20329 : see if this is a termio system
20333 if $test `./findhdr termios.h`; then
20334 set tcsetattr i_termios
20340 "$define") echo "You have POSIX termios.h... good!" >&4;;
20341 *) if ./Cppsym pyr; then
20342 case "`/bin/universe`" in
20343 ucb) if $test `./findhdr sgtty.h`; then
20345 echo "<sgtty.h> found." >&4
20347 echo "System is pyramid with BSD universe."
20348 echo "<sgtty.h> not found--you could have problems." >&4
20350 *) if $test `./findhdr termio.h`; then
20352 echo "<termio.h> found." >&4
20354 echo "System is pyramid with USG universe."
20355 echo "<termio.h> not found--you could have problems." >&4
20359 if $test `./findhdr termio.h`; then
20360 echo "<termio.h> found." >&4
20362 elif $test `./findhdr sgtty.h`; then
20363 echo "<sgtty.h> found." >&4
20366 echo "Neither <termio.h> nor <sgtty.h> found--you could have problems." >&4
20369 if $test `./findhdr sgtty.h`; then
20370 echo "<sgtty.h> found." >&4
20372 elif $test `./findhdr termio.h`; then
20373 echo "<termio.h> found." >&4
20376 echo "Neither <sgtty.h> nor <termio.h> found--you could have problems." >&4
20380 set i_termio; eval $setvar
20381 val=$val2; set i_sgtty; eval $setvar
20382 val=$val3; set i_termios; eval $setvar
20384 : see if stddef is available
20385 set stddef.h i_stddef
20388 : see if this is a sunmath.h system
20389 set sunmath.h i_sunmath
20392 : see if sys/access.h is available
20393 set sys/access.h i_sysaccess
20396 : see if ioctl defs are in sgtty, termio, sys/filio or sys/ioctl
20397 set sys/filio.h i_sysfilio
20400 if $test `./findhdr sys/ioctl.h`; then
20402 echo '<sys/ioctl.h> found.' >&4
20405 if $test $i_sysfilio = "$define"; then
20406 echo '<sys/ioctl.h> NOT found.' >&4
20408 $test $i_sgtty = "$define" && xxx="sgtty.h"
20409 $test $i_termio = "$define" && xxx="termio.h"
20410 $test $i_termios = "$define" && xxx="termios.h"
20411 echo "No <sys/ioctl.h> found, assuming ioctl args are defined in <$xxx>." >&4
20417 : see if socket ioctl defs are in sys/sockio.h
20419 xxx=`./findhdr sys/sockio.h`
20420 if $test "$xxx"; then
20421 if $contains SIOCATMARK $xxx >/dev/null 2>&1; then
20423 echo "You have socket ioctls defined in <sys/sockio.h>." >&4
20426 echo "No socket ioctls found in <sys/sockio.h>." >&4
20431 <sys/sockio.h> not found, assuming socket ioctls are in <sys/ioctl.h>.
20438 : see if this is a syslog.h system
20439 set syslog.h i_syslog
20443 : see if this is a sys/mode.h system
20444 set sys/mode.h i_sysmode
20447 : see if sys/resource.h has to be included
20448 set sys/resource.h i_sysresrc
20451 : see if sys/security.h is available
20452 set sys/security.h i_syssecrt
20455 : see if this is a sys/statvfs.h system
20456 set sys/statvfs.h i_sysstatvfs
20459 : see if this is a sys/un.h system
20460 set sys/un.h i_sysun
20464 : see if this is a sys/utsname.h system
20465 set sys/utsname.h i_sysutsname
20468 : see if this is a syswait system
20469 set sys/wait.h i_syswait
20472 : see if this is a ustat.h system
20473 set ustat.h i_ustat
20476 : see if this is an utime system
20477 set utime.h i_utime
20480 : see if this is a values.h system
20481 set values.h i_values
20484 : see if this is a vfork system
20487 set vfork.h i_vfork
20495 : see if gdbm.h is available
20500 : see if gdbm_open exists
20501 set gdbm_open d_gdbm_open
20503 case "$d_gdbm_open" in
20506 echo "We won't be including <gdbm.h>"
20516 echo "Looking for extensions..." >&4
20517 : If we are using the old config.sh, known_extensions may contain
20518 : old or inaccurate or duplicate values.
20519 known_extensions=''
20520 nonxs_extensions=''
20521 : We do not use find because it might not be available.
20522 : We do not just use MANIFEST because the user may have dropped
20523 : some additional extensions into the source tree and expect them
20526 : Function to recursively find available extensions, ignoring DynaLoader
20527 : NOTE: recursion limit of 10 to prevent runaway in case of symlink madness
20531 DynaLoader|dynaload) ;;
20533 if $test -f $xxx/$xxx.xs; then
20534 known_extensions="$known_extensions $1$xxx";
20535 elif $test -f $xxx/Makefile.PL; then
20536 nonxs_extensions="$nonxs_extensions $1$xxx";
20538 if $test -d $xxx -a $# -lt 10; then
20541 eval $find_extensions;
20553 eval $find_extensions
20554 # Special case: Add in threads/shared since it is not picked up by the
20555 # recursive find above (and adding in general recursive finding breaks
20556 # SDBM_File/sdbm). A.D. 10/25/2001.
20557 known_extensions="$known_extensions threads/shared"
20558 set X $nonxs_extensions
20560 nonxs_extensions="$*"
20561 set X $known_extensions
20563 known_extensions="$*"
20566 : Now see which are supported on this system.
20568 for xxx in $known_extensions ; do
20572 $define) avail_ext="$avail_ext $xxx" ;;
20575 GDBM_File|gdbm_fil)
20577 $define) avail_ext="$avail_ext $xxx" ;;
20580 I18N/Langinfo|i18n_lan)
20581 case "$i_langinfo$d_nl_langinfo" in
20582 $define$define) avail_ext="$avail_ext $xxx" ;;
20585 NDBM_File|ndbm_fil)
20588 case "$osname-$use64bitint" in
20591 *-lndbm*) avail_ext="$avail_ext $xxx" ;;
20594 *) avail_ext="$avail_ext $xxx" ;;
20599 ODBM_File|odbm_fil)
20600 case "${i_dbm}${i_rpcsvcdbm}" in
20602 case "$osname-$use64bitint" in
20605 *-ldbm*) avail_ext="$avail_ext $xxx" ;;
20608 *) avail_ext="$avail_ext $xxx" ;;
20614 case "$useposix" in
20615 true|define|y) avail_ext="$avail_ext $xxx" ;;
20619 case "$useopcode" in
20620 true|define|y) avail_ext="$avail_ext $xxx" ;;
20624 case "$d_socket" in
20627 beos) ;; # not unless BONE
20628 *) avail_ext="$avail_ext $xxx" ;;
20633 Sys/Syslog|sys/syslog)
20634 : XXX syslog requires socket
20635 case "$d_socket" in
20636 true|$define|y) avail_ext="$avail_ext $xxx" ;;
20640 case "$usethreads" in
20642 case "$useithreads" in
20643 $undef|false|[nN]*) avail_ext="$avail_ext $xxx" ;;
20647 XS/APItest|xs/apitest)
20648 # This is just for testing. Skip it unless we have dynamic loading.
20651 $define) avail_ext="$avail_ext $xxx" ;;
20654 XS/Typemap|xs/typemap)
20655 # This is just for testing. Skip it unless we have dynamic loading.
20657 $define) avail_ext="$avail_ext $xxx" ;;
20660 threads|threads/shared)
20661 # threads and threads::shared are special cases.
20662 # To stop people from asking "Perl 5.8.0 was supposed
20663 # to have this new fancy threads implementation but my
20664 # perl doesn't have it" and from people trying to
20665 # (re)install the threads module using CPAN.pm and
20666 # CPAN.pm then offering to reinstall Perl 5.8.0,
20667 # the threads.pm and threads/shared.pm will always be
20668 # there, croaking informatively ("you need to rebuild
20669 # all of Perl with threads, sorry") when threads haven't
20670 # been compiled in.
20672 avail_ext="$avail_ext $xxx"
20675 : XXX Do we need a useipcsysv variable here
20676 case "${d_msg}${d_sem}${d_shm}" in
20677 *"${define}"*) avail_ext="$avail_ext $xxx" ;;
20680 *) avail_ext="$avail_ext $xxx"
20689 case "$onlyextensions" in
20691 *) keepextensions=''
20692 echo "You have requested that only certains extensions be included..." >&4
20693 for i in $onlyextensions; do
20694 case " $avail_ext " in
20696 echo "Keeping extension $i."
20697 keepextensions="$keepextensions $i"
20699 *) echo "Ignoring extension $i." ;;
20702 avail_ext="$keepextensions"
20706 case "$noextensions" in
20708 *) keepextensions=''
20709 echo "You have requested that certain extensions be ignored..." >&4
20710 for i in $avail_ext; do
20711 case " $noextensions " in
20712 *" $i "*) echo "Ignoring extension $i." ;;
20713 *) echo "Keeping extension $i.";
20714 keepextensions="$keepextensions $i"
20718 avail_ext="$keepextensions"
20722 : Now see which nonxs extensions are supported on this system.
20723 : For now assume all are.
20725 for xxx in $nonxs_extensions ; do
20727 *) nonxs_ext="$nonxs_ext $xxx"
20739 A number of extensions are supplied with $package. You may choose to
20740 compile these extensions for dynamic loading (the default), compile
20741 them into the $package executable (static loading), or not include
20742 them at all. Answer "none" to include no extensions.
20743 Note that DynaLoader is always built and need not be mentioned here.
20746 case "$dynamic_ext" in
20748 : Exclude those listed in static_ext
20750 for xxx in $avail_ext; do
20751 case " $static_ext " in
20753 *) dflt="$dflt $xxx" ;;
20760 *) dflt="$dynamic_ext"
20761 # Perhaps we are reusing an old out-of-date config.sh.
20764 if test X"$dynamic_ext" != X"$avail_ext"; then
20766 NOTICE: Your previous config.sh list may be incorrect.
20767 The extensions now available to you are
20769 but the default list from your previous config.sh is
20781 rp="What extensions do you wish to load dynamically?"
20784 none) dynamic_ext=' ' ;;
20785 *) dynamic_ext="$ans" ;;
20788 case "$static_ext" in
20790 : Exclude those already listed in dynamic linking
20792 for xxx in $avail_ext; do
20793 case " $dynamic_ext " in
20795 *) dflt="$dflt $xxx" ;;
20802 *) dflt="$static_ext"
20809 rp="What extensions do you wish to load statically?"
20812 none) static_ext=' ' ;;
20813 *) static_ext="$ans" ;;
20818 A number of extensions are supplied with $package. Answer "none"
20819 to include no extensions.
20820 Note that DynaLoader is always built and need not be mentioned here.
20823 case "$static_ext" in
20824 '') dflt="$avail_ext" ;;
20825 *) dflt="$static_ext"
20826 # Perhaps we are reusing an old out-of-date config.sh.
20829 if test X"$static_ext" != X"$avail_ext"; then
20831 NOTICE: Your previous config.sh list may be incorrect.
20832 The extensions now available to you are
20834 but the default list from your previous config.sh is
20843 : Exclude those that are not xs extensions
20847 rp="What extensions do you wish to include?"
20850 none) static_ext=' ' ;;
20851 *) static_ext="$ans" ;;
20856 # Encode is a special case. If we are building Encode as a static
20857 # extension, we need to explicitly list its subextensions as well.
20858 # For other nested extensions, this is handled automatically by
20859 # the appropriate Makefile.PL.
20860 case " $static_ext " in
20861 *" Encode "*) # Add the subextensions of Encode
20863 for xxx in `ls Encode/*/Makefile.PL|awk -F/ '{print $2}'`; do
20864 static_ext="$static_ext Encode/$xxx"
20870 set X $dynamic_ext $static_ext $nonxs_ext
20874 # Sanity check: We require an extension suitable for use with
20875 # AnyDBM_File, as well as Fcntl and IO. (Failure to have these
20876 # should show up as failures in the test suite, but it's helpful to
20877 # catch them now.) The 'extensions' list is normally sorted
20878 # alphabetically, so we need to accept either
20879 # DB_File ... Fcntl ... IO ....
20880 # or something like
20881 # Fcntl ... NDBM_File ... IO ....
20882 case " $extensions" in
20883 *"_File "*" Fcntl "*" IO "*) ;; # DB_File
20884 *" Fcntl "*"_File "*" IO "*) ;; # GDBM_File
20885 *" Fcntl "*" IO "*"_File "*) ;; # NDBM_File
20886 *) echo "WARNING: Extensions DB_File or *DBM_File, Fcntl, and IO not configured." >&4
20887 echo "WARNING: The Perl you are building will be quite crippled." >& 4
20891 : Remove libraries needed only for extensions
20892 : The appropriate ext/Foo/Makefile.PL will add them back in, if necessary.
20893 : The exception is SunOS 4.x, which needs them.
20894 case "${osname}X${osvers}" in
20898 *) case "$usedl" in
20899 $define|true|[yY]*)
20900 set X `echo " $libs " | sed -e 's@ -lndbm @ @' -e 's@ -lgdbm @ @' -e 's@ -ldbm @ @' -e 's@ -ldb @ @'`
20904 *) perllibs="$libs"
20910 : Remove build directory name from cppstdin so it can be used from
20911 : either the present location or the final installed location.
20913 : Get out of the UU directory to get correct path name.
20915 case "$cppstdin" in
20917 echo "Stripping down cppstdin path name"
20923 : end of configuration questions
20925 echo "End of configuration questions."
20928 : back to where it started
20929 if test -d ../UU; then
20933 : configuration may be patched via a 'config.arch' file
20934 if $test -f config.arch; then
20935 echo "I see a config.arch file, loading it."
20939 : configuration may be patched via a 'config.over' file
20940 if $test -f config.over; then
20943 rp='I see a config.over file. Do you wish to load it?'
20946 n*) echo "OK, I'll ignore it.";;
20948 echo "Configuration override changes have been loaded."
20953 : in case they want portability, strip down executable paths
20954 case "$d_portable" in
20957 echo "Stripping down executable paths..." >&4
20958 for file in $loclist $trylist; do
20960 eval $file=`basename $temp`
20965 : create config.sh file
20967 echo "Creating config.sh..." >&4
20968 $spitshell <<EOT >config.sh
20971 # This file was produced by running the Configure script. It holds all the
20972 # definitions figured out by Configure. Should you modify one of these values,
20973 # do not forget to propagate your changes by running "Configure -der". You may
20974 # instead choose to run each of the .SH files by yourself, or "Configure -S".
20977 # Package name : $package
20978 # Source directory : $src
20979 # Configuration time: $cf_time
20980 # Configured by : $cf_by
20981 # Target system : $myuname
20991 Revision='$Revision'
20999 alignbytes='$alignbytes'
21000 ansi2knr='$ansi2knr'
21001 aphostname='$aphostname'
21002 api_revision='$api_revision'
21003 api_subversion='$api_subversion'
21004 api_version='$api_version'
21005 api_versionstring='$api_versionstring'
21008 archlibexp='$archlibexp'
21009 archname64='$archname64'
21010 archname='$archname'
21011 archobjs='$archobjs'
21012 asctime_r_proto='$asctime_r_proto'
21020 byteorder='$byteorder'
21022 castflags='$castflags'
21025 cccdlflags='$cccdlflags'
21026 ccdlflags='$ccdlflags'
21028 ccflags_uselargefiles='$ccflags_uselargefiles'
21030 ccsymbols='$ccsymbols'
21031 ccversion='$ccversion'
21033 cf_email='$cf_email'
21035 charsize='$charsize'
21039 clocktype='$clocktype'
21041 compress='$compress'
21042 contains='$contains'
21046 cpp_stuff='$cpp_stuff'
21047 cppccsymbols='$cppccsymbols'
21048 cppflags='$cppflags'
21050 cppminus='$cppminus'
21052 cppstdin='$cppstdin'
21053 cppsymbols='$cppsymbols'
21054 crypt_r_proto='$crypt_r_proto'
21055 cryptlib='$cryptlib'
21057 ctermid_r_proto='$ctermid_r_proto'
21058 ctime_r_proto='$ctime_r_proto'
21059 d_Gconvert='$d_Gconvert'
21060 d_PRIEUldbl='$d_PRIEUldbl'
21061 d_PRIFUldbl='$d_PRIFUldbl'
21062 d_PRIGUldbl='$d_PRIGUldbl'
21063 d_PRIXU64='$d_PRIXU64'
21064 d_PRId64='$d_PRId64'
21065 d_PRIeldbl='$d_PRIeldbl'
21066 d_PRIfldbl='$d_PRIfldbl'
21067 d_PRIgldbl='$d_PRIgldbl'
21068 d_PRIi64='$d_PRIi64'
21069 d_PRIo64='$d_PRIo64'
21070 d_PRIu64='$d_PRIu64'
21071 d_PRIx64='$d_PRIx64'
21072 d_SCNfldbl='$d_SCNfldbl'
21073 d__fwalk='$d__fwalk'
21074 d_access='$d_access'
21075 d_accessx='$d_accessx'
21078 d_archlib='$d_archlib'
21079 d_asctime_r='$d_asctime_r'
21082 d_attribute_format='$d_attribute_format'
21083 d_attribute_malloc='$d_attribute_malloc'
21084 d_attribute_nonnull='$d_attribute_nonnull'
21085 d_attribute_noreturn='$d_attribute_noreturn'
21086 d_attribute_pure='$d_attribute_pure'
21087 d_attribute_unused='$d_attribute_unused'
21088 d_attribute_warn_unused_result='$d_attribute_warn_unused_result'
21092 d_bsdgetpgrp='$d_bsdgetpgrp'
21093 d_bsdsetpgrp='$d_bsdsetpgrp'
21095 d_casti32='$d_casti32'
21096 d_castneg='$d_castneg'
21097 d_charvspr='$d_charvspr'
21099 d_chroot='$d_chroot'
21100 d_chsize='$d_chsize'
21102 d_clearenv='$d_clearenv'
21103 d_closedir='$d_closedir'
21104 d_cmsghdr_s='$d_cmsghdr_s'
21106 d_copysignl='$d_copysignl'
21108 d_crypt_r='$d_crypt_r'
21110 d_ctermid_r='$d_ctermid_r'
21111 d_ctime_r='$d_ctime_r'
21112 d_cuserid='$d_cuserid'
21113 d_dbl_dig='$d_dbl_dig'
21114 d_dbminitproto='$d_dbminitproto'
21115 d_difftime='$d_difftime'
21117 d_dirnamlen='$d_dirnamlen'
21118 d_dlerror='$d_dlerror'
21119 d_dlopen='$d_dlopen'
21120 d_dlsymun='$d_dlsymun'
21121 d_dosuid='$d_dosuid'
21122 d_drand48_r='$d_drand48_r'
21123 d_drand48proto='$d_drand48proto'
21125 d_eaccess='$d_eaccess'
21126 d_endgrent='$d_endgrent'
21127 d_endgrent_r='$d_endgrent_r'
21128 d_endhent='$d_endhent'
21129 d_endhostent_r='$d_endhostent_r'
21130 d_endnent='$d_endnent'
21131 d_endnetent_r='$d_endnetent_r'
21132 d_endpent='$d_endpent'
21133 d_endprotoent_r='$d_endprotoent_r'
21134 d_endpwent='$d_endpwent'
21135 d_endpwent_r='$d_endpwent_r'
21136 d_endsent='$d_endsent'
21137 d_endservent_r='$d_endservent_r'
21138 d_eofnblk='$d_eofnblk'
21139 d_eunice='$d_eunice'
21140 d_faststdio='$d_faststdio'
21141 d_fchdir='$d_fchdir'
21142 d_fchmod='$d_fchmod'
21143 d_fchown='$d_fchown'
21145 d_fcntl_can_lock='$d_fcntl_can_lock'
21146 d_fd_macros='$d_fd_macros'
21147 d_fd_set='$d_fd_set'
21148 d_fds_bits='$d_fds_bits'
21149 d_fgetpos='$d_fgetpos'
21150 d_finite='$d_finite'
21151 d_finitel='$d_finitel'
21152 d_flexfnam='$d_flexfnam'
21154 d_flockproto='$d_flockproto'
21156 d_fp_class='$d_fp_class'
21157 d_fpathconf='$d_fpathconf'
21158 d_fpclass='$d_fpclass'
21159 d_fpclassify='$d_fpclassify'
21160 d_fpclassl='$d_fpclassl'
21161 d_fpos64_t='$d_fpos64_t'
21162 d_frexpl='$d_frexpl'
21163 d_fs_data_s='$d_fs_data_s'
21164 d_fseeko='$d_fseeko'
21165 d_fsetpos='$d_fsetpos'
21166 d_fstatfs='$d_fstatfs'
21167 d_fstatvfs='$d_fstatvfs'
21169 d_ftello='$d_ftello'
21171 d_futimes='$d_futimes'
21172 d_getcwd='$d_getcwd'
21173 d_getespwnam='$d_getespwnam'
21174 d_getfsstat='$d_getfsstat'
21175 d_getgrent='$d_getgrent'
21176 d_getgrent_r='$d_getgrent_r'
21177 d_getgrgid_r='$d_getgrgid_r'
21178 d_getgrnam_r='$d_getgrnam_r'
21179 d_getgrps='$d_getgrps'
21180 d_gethbyaddr='$d_gethbyaddr'
21181 d_gethbyname='$d_gethbyname'
21182 d_gethent='$d_gethent'
21183 d_gethname='$d_gethname'
21184 d_gethostbyaddr_r='$d_gethostbyaddr_r'
21185 d_gethostbyname_r='$d_gethostbyname_r'
21186 d_gethostent_r='$d_gethostent_r'
21187 d_gethostprotos='$d_gethostprotos'
21188 d_getitimer='$d_getitimer'
21189 d_getlogin='$d_getlogin'
21190 d_getlogin_r='$d_getlogin_r'
21191 d_getmnt='$d_getmnt'
21192 d_getmntent='$d_getmntent'
21193 d_getnbyaddr='$d_getnbyaddr'
21194 d_getnbyname='$d_getnbyname'
21195 d_getnent='$d_getnent'
21196 d_getnetbyaddr_r='$d_getnetbyaddr_r'
21197 d_getnetbyname_r='$d_getnetbyname_r'
21198 d_getnetent_r='$d_getnetent_r'
21199 d_getnetprotos='$d_getnetprotos'
21200 d_getpagsz='$d_getpagsz'
21201 d_getpbyname='$d_getpbyname'
21202 d_getpbynumber='$d_getpbynumber'
21203 d_getpent='$d_getpent'
21204 d_getpgid='$d_getpgid'
21205 d_getpgrp2='$d_getpgrp2'
21206 d_getpgrp='$d_getpgrp'
21207 d_getppid='$d_getppid'
21208 d_getprior='$d_getprior'
21209 d_getprotobyname_r='$d_getprotobyname_r'
21210 d_getprotobynumber_r='$d_getprotobynumber_r'
21211 d_getprotoent_r='$d_getprotoent_r'
21212 d_getprotoprotos='$d_getprotoprotos'
21213 d_getprpwnam='$d_getprpwnam'
21214 d_getpwent='$d_getpwent'
21215 d_getpwent_r='$d_getpwent_r'
21216 d_getpwnam_r='$d_getpwnam_r'
21217 d_getpwuid_r='$d_getpwuid_r'
21218 d_getsbyname='$d_getsbyname'
21219 d_getsbyport='$d_getsbyport'
21220 d_getsent='$d_getsent'
21221 d_getservbyname_r='$d_getservbyname_r'
21222 d_getservbyport_r='$d_getservbyport_r'
21223 d_getservent_r='$d_getservent_r'
21224 d_getservprotos='$d_getservprotos'
21225 d_getspnam='$d_getspnam'
21226 d_getspnam_r='$d_getspnam_r'
21227 d_gettimeod='$d_gettimeod'
21228 d_gmtime_r='$d_gmtime_r'
21229 d_gnulibc='$d_gnulibc'
21230 d_grpasswd='$d_grpasswd'
21231 d_hasmntopt='$d_hasmntopt'
21233 d_ilogbl='$d_ilogbl'
21235 d_inetaton='$d_inetaton'
21236 d_int64_t='$d_int64_t'
21237 d_isascii='$d_isascii'
21238 d_isfinite='$d_isfinite'
21241 d_isnanl='$d_isnanl'
21242 d_killpg='$d_killpg'
21243 d_lchown='$d_lchown'
21244 d_ldbl_dig='$d_ldbl_dig'
21245 d_libm_lib_version='$d_libm_lib_version'
21247 d_localtime_r='$d_localtime_r'
21248 d_locconv='$d_locconv'
21250 d_longdbl='$d_longdbl'
21251 d_longlong='$d_longlong'
21252 d_lseekproto='$d_lseekproto'
21254 d_madvise='$d_madvise'
21255 d_malloc_good_size='$d_malloc_good_size'
21256 d_malloc_size='$d_malloc_size'
21258 d_mbstowcs='$d_mbstowcs'
21259 d_mbtowc='$d_mbtowc'
21260 d_memchr='$d_memchr'
21261 d_memcmp='$d_memcmp'
21262 d_memcpy='$d_memcpy'
21263 d_memmove='$d_memmove'
21264 d_memset='$d_memset'
21266 d_mkdtemp='$d_mkdtemp'
21267 d_mkfifo='$d_mkfifo'
21268 d_mkstemp='$d_mkstemp'
21269 d_mkstemps='$d_mkstemps'
21270 d_mktime='$d_mktime'
21273 d_modfl_pow32_bug='$d_modfl_pow32_bug'
21274 d_modflproto='$d_modflproto'
21275 d_mprotect='$d_mprotect'
21277 d_msg_ctrunc='$d_msg_ctrunc'
21278 d_msg_dontroute='$d_msg_dontroute'
21279 d_msg_oob='$d_msg_oob'
21280 d_msg_peek='$d_msg_peek'
21281 d_msg_proxy='$d_msg_proxy'
21282 d_msgctl='$d_msgctl'
21283 d_msgget='$d_msgget'
21284 d_msghdr_s='$d_msghdr_s'
21285 d_msgrcv='$d_msgrcv'
21286 d_msgsnd='$d_msgsnd'
21288 d_munmap='$d_munmap'
21289 d_mymalloc='$d_mymalloc'
21291 d_nl_langinfo='$d_nl_langinfo'
21292 d_nv_preserves_uv='$d_nv_preserves_uv'
21293 d_nv_zero_is_allbits_zero='$d_nv_zero_is_allbits_zero'
21294 d_off64_t='$d_off64_t'
21295 d_old_pthread_create_joinable='$d_old_pthread_create_joinable'
21296 d_oldpthreads='$d_oldpthreads'
21297 d_oldsock='$d_oldsock'
21299 d_pathconf='$d_pathconf'
21301 d_perl_otherlibdirs='$d_perl_otherlibdirs'
21302 d_phostname='$d_phostname'
21305 d_portable='$d_portable'
21306 d_procselfexe='$d_procselfexe'
21307 d_pthread_atfork='$d_pthread_atfork'
21308 d_pthread_attr_setscope='$d_pthread_attr_setscope'
21309 d_pthread_yield='$d_pthread_yield'
21311 d_pwchange='$d_pwchange'
21312 d_pwclass='$d_pwclass'
21313 d_pwcomment='$d_pwcomment'
21314 d_pwexpire='$d_pwexpire'
21315 d_pwgecos='$d_pwgecos'
21316 d_pwpasswd='$d_pwpasswd'
21317 d_pwquota='$d_pwquota'
21320 d_random_r='$d_random_r'
21321 d_readdir64_r='$d_readdir64_r'
21322 d_readdir='$d_readdir'
21323 d_readdir_r='$d_readdir_r'
21324 d_readlink='$d_readlink'
21326 d_recvmsg='$d_recvmsg'
21327 d_rename='$d_rename'
21328 d_rewinddir='$d_rewinddir'
21330 d_safebcpy='$d_safebcpy'
21331 d_safemcpy='$d_safemcpy'
21332 d_sanemcmp='$d_sanemcmp'
21333 d_sbrkproto='$d_sbrkproto'
21334 d_scalbnl='$d_scalbnl'
21335 d_sched_yield='$d_sched_yield'
21336 d_scm_rights='$d_scm_rights'
21337 d_seekdir='$d_seekdir'
21338 d_select='$d_select'
21340 d_semctl='$d_semctl'
21341 d_semctl_semid_ds='$d_semctl_semid_ds'
21342 d_semctl_semun='$d_semctl_semun'
21343 d_semget='$d_semget'
21345 d_sendmsg='$d_sendmsg'
21346 d_setegid='$d_setegid'
21347 d_seteuid='$d_seteuid'
21348 d_setgrent='$d_setgrent'
21349 d_setgrent_r='$d_setgrent_r'
21350 d_setgrps='$d_setgrps'
21351 d_sethent='$d_sethent'
21352 d_sethostent_r='$d_sethostent_r'
21353 d_setitimer='$d_setitimer'
21354 d_setlinebuf='$d_setlinebuf'
21355 d_setlocale='$d_setlocale'
21356 d_setlocale_r='$d_setlocale_r'
21357 d_setnent='$d_setnent'
21358 d_setnetent_r='$d_setnetent_r'
21359 d_setpent='$d_setpent'
21360 d_setpgid='$d_setpgid'
21361 d_setpgrp2='$d_setpgrp2'
21362 d_setpgrp='$d_setpgrp'
21363 d_setprior='$d_setprior'
21364 d_setproctitle='$d_setproctitle'
21365 d_setprotoent_r='$d_setprotoent_r'
21366 d_setpwent='$d_setpwent'
21367 d_setpwent_r='$d_setpwent_r'
21368 d_setregid='$d_setregid'
21369 d_setresgid='$d_setresgid'
21370 d_setresuid='$d_setresuid'
21371 d_setreuid='$d_setreuid'
21372 d_setrgid='$d_setrgid'
21373 d_setruid='$d_setruid'
21374 d_setsent='$d_setsent'
21375 d_setservent_r='$d_setservent_r'
21376 d_setsid='$d_setsid'
21377 d_setvbuf='$d_setvbuf'
21381 d_shmatprototype='$d_shmatprototype'
21382 d_shmctl='$d_shmctl'
21384 d_shmget='$d_shmget'
21385 d_sigaction='$d_sigaction'
21386 d_sigprocmask='$d_sigprocmask'
21387 d_sigsetjmp='$d_sigsetjmp'
21388 d_snprintf='$d_snprintf'
21389 d_sockatmark='$d_sockatmark'
21390 d_sockatmarkproto='$d_sockatmarkproto'
21391 d_socket='$d_socket'
21392 d_socklen_t='$d_socklen_t'
21393 d_sockpair='$d_sockpair'
21394 d_socks5_init='$d_socks5_init'
21395 d_sprintf_returns_strlen='$d_sprintf_returns_strlen'
21397 d_srand48_r='$d_srand48_r'
21398 d_srandom_r='$d_srandom_r'
21399 d_sresgproto='$d_sresgproto'
21400 d_sresuproto='$d_sresuproto'
21401 d_statblks='$d_statblks'
21402 d_statfs_f_flags='$d_statfs_f_flags'
21403 d_statfs_s='$d_statfs_s'
21404 d_statvfs='$d_statvfs'
21405 d_stdio_cnt_lval='$d_stdio_cnt_lval'
21406 d_stdio_ptr_lval='$d_stdio_ptr_lval'
21407 d_stdio_ptr_lval_nochange_cnt='$d_stdio_ptr_lval_nochange_cnt'
21408 d_stdio_ptr_lval_sets_cnt='$d_stdio_ptr_lval_sets_cnt'
21409 d_stdio_stream_array='$d_stdio_stream_array'
21410 d_stdiobase='$d_stdiobase'
21411 d_stdstdio='$d_stdstdio'
21412 d_strchr='$d_strchr'
21413 d_strcoll='$d_strcoll'
21414 d_strctcpy='$d_strctcpy'
21415 d_strerrm='$d_strerrm'
21416 d_strerror='$d_strerror'
21417 d_strerror_r='$d_strerror_r'
21418 d_strftime='$d_strftime'
21419 d_strlcat='$d_strlcat'
21420 d_strlcpy='$d_strlcpy'
21421 d_strtod='$d_strtod'
21422 d_strtol='$d_strtol'
21423 d_strtold='$d_strtold'
21424 d_strtoll='$d_strtoll'
21425 d_strtoq='$d_strtoq'
21426 d_strtoul='$d_strtoul'
21427 d_strtoull='$d_strtoull'
21428 d_strtouq='$d_strtouq'
21429 d_strxfrm='$d_strxfrm'
21430 d_suidsafe='$d_suidsafe'
21431 d_symlink='$d_symlink'
21432 d_syscall='$d_syscall'
21433 d_syscallproto='$d_syscallproto'
21434 d_sysconf='$d_sysconf'
21435 d_sysernlst='$d_sysernlst'
21436 d_syserrlst='$d_syserrlst'
21437 d_system='$d_system'
21438 d_tcgetpgrp='$d_tcgetpgrp'
21439 d_tcsetpgrp='$d_tcsetpgrp'
21440 d_telldir='$d_telldir'
21441 d_telldirproto='$d_telldirproto'
21444 d_tm_tm_gmtoff='$d_tm_tm_gmtoff'
21445 d_tm_tm_zone='$d_tm_tm_zone'
21446 d_tmpnam_r='$d_tmpnam_r'
21447 d_truncate='$d_truncate'
21448 d_ttyname_r='$d_ttyname_r'
21449 d_tzname='$d_tzname'
21450 d_u32align='$d_u32align'
21451 d_ualarm='$d_ualarm'
21454 d_union_semun='$d_union_semun'
21455 d_unordered='$d_unordered'
21456 d_unsetenv='$d_unsetenv'
21457 d_usleep='$d_usleep'
21458 d_usleepproto='$d_usleepproto'
21460 d_vendorarch='$d_vendorarch'
21461 d_vendorbin='$d_vendorbin'
21462 d_vendorlib='$d_vendorlib'
21463 d_vendorscript='$d_vendorscript'
21465 d_void_closedir='$d_void_closedir'
21466 d_voidsig='$d_voidsig'
21467 d_voidtty='$d_voidtty'
21468 d_volatile='$d_volatile'
21469 d_vprintf='$d_vprintf'
21470 d_vsnprintf='$d_vsnprintf'
21472 d_waitpid='$d_waitpid'
21473 d_wcstombs='$d_wcstombs'
21474 d_wctomb='$d_wctomb'
21475 d_writev='$d_writev'
21478 db_hashtype='$db_hashtype'
21479 db_prefixtype='$db_prefixtype'
21480 db_version_major='$db_version_major'
21481 db_version_minor='$db_version_minor'
21482 db_version_patch='$db_version_patch'
21483 defvoidused='$defvoidused'
21484 direntrytype='$direntrytype'
21487 doublesize='$doublesize'
21489 drand48_r_proto='$drand48_r_proto'
21490 dynamic_ext='$dynamic_ext'
21496 endgrent_r_proto='$endgrent_r_proto'
21497 endhostent_r_proto='$endhostent_r_proto'
21498 endnetent_r_proto='$endnetent_r_proto'
21499 endprotoent_r_proto='$endprotoent_r_proto'
21500 endpwent_r_proto='$endpwent_r_proto'
21501 endservent_r_proto='$endservent_r_proto'
21502 eunicefix='$eunicefix'
21505 extensions='$extensions'
21507 fflushNULL='$fflushNULL'
21508 fflushall='$fflushall'
21510 firstmakefile='$firstmakefile'
21512 fpossize='$fpossize'
21513 fpostype='$fpostype'
21514 freetype='$freetype'
21517 full_csh='$full_csh'
21518 full_sed='$full_sed'
21519 gccansipedantic='$gccansipedantic'
21520 gccosandvers='$gccosandvers'
21521 gccversion='$gccversion'
21522 getgrent_r_proto='$getgrent_r_proto'
21523 getgrgid_r_proto='$getgrgid_r_proto'
21524 getgrnam_r_proto='$getgrnam_r_proto'
21525 gethostbyaddr_r_proto='$gethostbyaddr_r_proto'
21526 gethostbyname_r_proto='$gethostbyname_r_proto'
21527 gethostent_r_proto='$gethostent_r_proto'
21528 getlogin_r_proto='$getlogin_r_proto'
21529 getnetbyaddr_r_proto='$getnetbyaddr_r_proto'
21530 getnetbyname_r_proto='$getnetbyname_r_proto'
21531 getnetent_r_proto='$getnetent_r_proto'
21532 getprotobyname_r_proto='$getprotobyname_r_proto'
21533 getprotobynumber_r_proto='$getprotobynumber_r_proto'
21534 getprotoent_r_proto='$getprotoent_r_proto'
21535 getpwent_r_proto='$getpwent_r_proto'
21536 getpwnam_r_proto='$getpwnam_r_proto'
21537 getpwuid_r_proto='$getpwuid_r_proto'
21538 getservbyname_r_proto='$getservbyname_r_proto'
21539 getservbyport_r_proto='$getservbyport_r_proto'
21540 getservent_r_proto='$getservent_r_proto'
21541 getspnam_r_proto='$getspnam_r_proto'
21542 gidformat='$gidformat'
21548 gmtime_r_proto='$gmtime_r_proto'
21549 gnulibc_version='$gnulibc_version'
21551 groupcat='$groupcat'
21552 groupstype='$groupstype'
21555 h_sysfile='$h_sysfile'
21558 html1dir='$html1dir'
21559 html1direxp='$html1direxp'
21560 html3dir='$html3dir'
21561 html3direxp='$html3direxp'
21570 i_arpainet='$i_arpainet'
21571 i_bsdioctl='$i_bsdioctl'
21575 i_dirent='$i_dirent'
21581 i_fp_class='$i_fp_class'
21584 i_ieeefp='$i_ieeefp'
21585 i_inttypes='$i_inttypes'
21586 i_langinfo='$i_langinfo'
21587 i_libutil='$i_libutil'
21588 i_limits='$i_limits'
21589 i_locale='$i_locale'
21590 i_machcthr='$i_machcthr'
21591 i_malloc='$i_malloc'
21593 i_memory='$i_memory'
21594 i_mntent='$i_mntent'
21597 i_neterrno='$i_neterrno'
21598 i_netinettcp='$i_netinettcp'
21602 i_pthread='$i_pthread'
21604 i_rpcsvcdbm='$i_rpcsvcdbm'
21607 i_shadow='$i_shadow'
21609 i_stdarg='$i_stdarg'
21610 i_stddef='$i_stddef'
21611 i_stdlib='$i_stdlib'
21612 i_string='$i_string'
21613 i_sunmath='$i_sunmath'
21614 i_sysaccess='$i_sysaccess'
21615 i_sysdir='$i_sysdir'
21616 i_sysfile='$i_sysfile'
21617 i_sysfilio='$i_sysfilio'
21619 i_sysioctl='$i_sysioctl'
21620 i_syslog='$i_syslog'
21621 i_sysmman='$i_sysmman'
21622 i_sysmode='$i_sysmode'
21623 i_sysmount='$i_sysmount'
21624 i_sysndir='$i_sysndir'
21625 i_sysparam='$i_sysparam'
21626 i_sysresrc='$i_sysresrc'
21627 i_syssecrt='$i_syssecrt'
21628 i_sysselct='$i_sysselct'
21629 i_syssockio='$i_syssockio'
21630 i_sysstat='$i_sysstat'
21631 i_sysstatfs='$i_sysstatfs'
21632 i_sysstatvfs='$i_sysstatvfs'
21633 i_systime='$i_systime'
21634 i_systimek='$i_systimek'
21635 i_systimes='$i_systimes'
21636 i_systypes='$i_systypes'
21637 i_sysuio='$i_sysuio'
21639 i_sysutsname='$i_sysutsname'
21640 i_sysvfs='$i_sysvfs'
21641 i_syswait='$i_syswait'
21642 i_termio='$i_termio'
21643 i_termios='$i_termios'
21645 i_unistd='$i_unistd'
21648 i_values='$i_values'
21649 i_varargs='$i_varargs'
21650 i_varhdr='$i_varhdr'
21652 ignore_versioned_solibs='$ignore_versioned_solibs'
21653 inc_version_list='$inc_version_list'
21654 inc_version_list_init='$inc_version_list_init'
21657 installarchlib='$installarchlib'
21658 installbin='$installbin'
21659 installhtml1dir='$installhtml1dir'
21660 installhtml3dir='$installhtml3dir'
21661 installman1dir='$installman1dir'
21662 installman3dir='$installman3dir'
21663 installprefix='$installprefix'
21664 installprefixexp='$installprefixexp'
21665 installprivlib='$installprivlib'
21666 installscript='$installscript'
21667 installsitearch='$installsitearch'
21668 installsitebin='$installsitebin'
21669 installsitehtml1dir='$installsitehtml1dir'
21670 installsitehtml3dir='$installsitehtml3dir'
21671 installsitelib='$installsitelib'
21672 installsiteman1dir='$installsiteman1dir'
21673 installsiteman3dir='$installsiteman3dir'
21674 installsitescript='$installsitescript'
21675 installstyle='$installstyle'
21676 installusrbinperl='$installusrbinperl'
21677 installvendorarch='$installvendorarch'
21678 installvendorbin='$installvendorbin'
21679 installvendorhtml1dir='$installvendorhtml1dir'
21680 installvendorhtml3dir='$installvendorhtml3dir'
21681 installvendorlib='$installvendorlib'
21682 installvendorman1dir='$installvendorman1dir'
21683 installvendorman3dir='$installvendorman3dir'
21684 installvendorscript='$installvendorscript'
21686 issymlink='$issymlink'
21687 ivdformat='$ivdformat'
21690 known_extensions='$known_extensions'
21693 lddlflags='$lddlflags'
21695 ldflags_uselargefiles='$ldflags_uselargefiles'
21696 ldlibpthname='$ldlibpthname'
21703 libsdirs='$libsdirs'
21704 libsfiles='$libsfiles'
21705 libsfound='$libsfound'
21706 libspath='$libspath'
21707 libswanted='$libswanted'
21708 libswanted_uselargefiles='$libswanted_uselargefiles'
21714 localtime_r_proto='$localtime_r_proto'
21715 locincpth='$locincpth'
21716 loclibpth='$loclibpth'
21717 longdblsize='$longdblsize'
21718 longlongsize='$longlongsize'
21719 longsize='$longsize'
21723 lseeksize='$lseeksize'
21724 lseektype='$lseektype'
21728 make_set_make='$make_set_make'
21729 mallocobj='$mallocobj'
21730 mallocsrc='$mallocsrc'
21731 malloctype='$malloctype'
21733 man1direxp='$man1direxp'
21736 man3direxp='$man3direxp'
21738 mips_type='$mips_type'
21739 mistrustnm='$mistrustnm'
21741 mmaptype='$mmaptype'
21742 modetype='$modetype'
21744 multiarch='$multiarch'
21746 myarchname='$myarchname'
21747 mydomain='$mydomain'
21748 myhostname='$myhostname'
21751 need_va_copy='$need_va_copy'
21752 netdb_hlen_type='$netdb_hlen_type'
21753 netdb_host_type='$netdb_host_type'
21754 netdb_name_type='$netdb_name_type'
21755 netdb_net_type='$netdb_net_type'
21758 nm_so_opt='$nm_so_opt'
21759 nonxs_ext='$nonxs_ext'
21761 nvEUformat='$nvEUformat'
21762 nvFUformat='$nvFUformat'
21763 nvGUformat='$nvGUformat'
21764 nv_preserves_uv_bits='$nv_preserves_uv_bits'
21765 nveformat='$nveformat'
21766 nvfformat='$nvfformat'
21767 nvgformat='$nvgformat'
21770 o_nonblock='$o_nonblock'
21772 old_pthread_create_joinable='$old_pthread_create_joinable'
21773 optimize='$optimize'
21774 orderlib='$orderlib'
21777 otherlibdirs='$otherlibdirs'
21781 patchlevel='$patchlevel'
21782 path_sep='$path_sep'
21785 perl_patchlevel='$perl_patchlevel'
21786 perladmin='$perladmin'
21787 perllibs='$perllibs'
21788 perlpath='$perlpath'
21790 phostname='$phostname'
21796 prefixexp='$prefixexp'
21798 privlibexp='$privlibexp'
21799 procselfexe='$procselfexe'
21800 prototype='$prototype'
21802 quadkind='$quadkind'
21803 quadtype='$quadtype'
21804 randbits='$randbits'
21805 randfunc='$randfunc'
21806 random_r_proto='$random_r_proto'
21807 randseedtype='$randseedtype'
21809 rd_nodata='$rd_nodata'
21810 readdir64_r_proto='$readdir64_r_proto'
21811 readdir_r_proto='$readdir_r_proto'
21812 revision='$revision'
21817 sPRIEUldbl='$sPRIEUldbl'
21818 sPRIFUldbl='$sPRIFUldbl'
21819 sPRIGUldbl='$sPRIGUldbl'
21820 sPRIXU64='$sPRIXU64'
21822 sPRIeldbl='$sPRIeldbl'
21823 sPRIfldbl='$sPRIfldbl'
21824 sPRIgldbl='$sPRIgldbl'
21829 sSCNfldbl='$sSCNfldbl'
21830 sched_yield='$sched_yield'
21831 scriptdir='$scriptdir'
21832 scriptdirexp='$scriptdirexp'
21834 seedfunc='$seedfunc'
21835 selectminbits='$selectminbits'
21836 selecttype='$selecttype'
21837 sendmail='$sendmail'
21838 setgrent_r_proto='$setgrent_r_proto'
21839 sethostent_r_proto='$sethostent_r_proto'
21840 setlocale_r_proto='$setlocale_r_proto'
21841 setnetent_r_proto='$setnetent_r_proto'
21842 setprotoent_r_proto='$setprotoent_r_proto'
21843 setpwent_r_proto='$setpwent_r_proto'
21844 setservent_r_proto='$setservent_r_proto'
21847 sharpbang='$sharpbang'
21848 shmattype='$shmattype'
21849 shortsize='$shortsize'
21852 sig_count='$sig_count'
21853 sig_name='$sig_name'
21854 sig_name_init='$sig_name_init'
21856 sig_num_init='$sig_num_init'
21857 sig_size='$sig_size'
21858 signal_t='$signal_t'
21859 sitearch='$sitearch'
21860 sitearchexp='$sitearchexp'
21862 sitebinexp='$sitebinexp'
21863 sitehtml1dir='$sitehtml1dir'
21864 sitehtml1direxp='$sitehtml1direxp'
21865 sitehtml3dir='$sitehtml3dir'
21866 sitehtml3direxp='$sitehtml3direxp'
21868 sitelib_stem='$sitelib_stem'
21869 sitelibexp='$sitelibexp'
21870 siteman1dir='$siteman1dir'
21871 siteman1direxp='$siteman1direxp'
21872 siteman3dir='$siteman3dir'
21873 siteman3direxp='$siteman3direxp'
21874 siteprefix='$siteprefix'
21875 siteprefixexp='$siteprefixexp'
21876 sitescript='$sitescript'
21877 sitescriptexp='$sitescriptexp'
21878 sizesize='$sizesize'
21879 sizetype='$sizetype'
21883 sockethdr='$sockethdr'
21884 socketlib='$socketlib'
21885 socksizetype='$socksizetype'
21887 spackage='$spackage'
21888 spitshell='$spitshell'
21889 srand48_r_proto='$srand48_r_proto'
21890 srandom_r_proto='$srandom_r_proto'
21892 ssizetype='$ssizetype'
21893 startperl='$startperl'
21895 static_ext='$static_ext'
21897 stdio_base='$stdio_base'
21898 stdio_bufsiz='$stdio_bufsiz'
21899 stdio_cnt='$stdio_cnt'
21900 stdio_filbuf='$stdio_filbuf'
21901 stdio_ptr='$stdio_ptr'
21902 stdio_stream_array='$stdio_stream_array'
21903 strerror_r_proto='$strerror_r_proto'
21906 subversion='$subversion'
21910 targetarch='$targetarch'
21914 timeincl='$timeincl'
21915 timetype='$timetype'
21916 tmpnam_r_proto='$tmpnam_r_proto'
21922 ttyname_r_proto='$ttyname_r_proto'
21931 uidformat='$uidformat'
21937 uquadtype='$uquadtype'
21938 use5005threads='$use5005threads'
21939 use64bitall='$use64bitall'
21940 use64bitint='$use64bitint'
21941 usecrosscompile='$usecrosscompile'
21943 usefaststdio='$usefaststdio'
21944 useithreads='$useithreads'
21945 uselargefiles='$uselargefiles'
21946 uselongdouble='$uselongdouble'
21947 usemallocwrap='$usemallocwrap'
21948 usemorebits='$usemorebits'
21949 usemultiplicity='$usemultiplicity'
21950 usemymalloc='$usemymalloc'
21952 useopcode='$useopcode'
21953 useperlio='$useperlio'
21954 useposix='$useposix'
21955 usereentrant='$usereentrant'
21956 userelocatableinc='$userelocatableinc'
21958 useshrplib='$useshrplib'
21959 usesitecustomize='$usesitecustomize'
21960 usesocks='$usesocks'
21961 usethreads='$usethreads'
21962 usevendorprefix='$usevendorprefix'
21963 usevfork='$usevfork'
21966 uvXUformat='$uvXUformat'
21967 uvoformat='$uvoformat'
21970 uvuformat='$uvuformat'
21971 uvxformat='$uvxformat'
21972 vendorarch='$vendorarch'
21973 vendorarchexp='$vendorarchexp'
21974 vendorbin='$vendorbin'
21975 vendorbinexp='$vendorbinexp'
21976 vendorhtml1dir='$vendorhtml1dir'
21977 vendorhtml1direxp='$vendorhtml1direxp'
21978 vendorhtml3dir='$vendorhtml3dir'
21979 vendorhtml3direxp='$vendorhtml3direxp'
21980 vendorlib='$vendorlib'
21981 vendorlib_stem='$vendorlib_stem'
21982 vendorlibexp='$vendorlibexp'
21983 vendorman1dir='$vendorman1dir'
21984 vendorman1direxp='$vendorman1direxp'
21985 vendorman3dir='$vendorman3dir'
21986 vendorman3direxp='$vendorman3direxp'
21987 vendorprefix='$vendorprefix'
21988 vendorprefixexp='$vendorprefixexp'
21989 vendorscript='$vendorscript'
21990 vendorscriptexp='$vendorscriptexp'
21992 version_patchlevel_string='$version_patchlevel_string'
21993 versiononly='$versiononly'
21995 voidflags='$voidflags'
21998 yaccflags='$yaccflags'
22003 : Add in command line options if available
22004 $test -f UU/cmdline.opt && $cat UU/cmdline.opt >> config.sh
22006 : add special variables
22007 $test -f $src/patchlevel.h && \
22008 awk '/^#define[ ]+PERL_/ {printf "%s=%s\n",$2,$3}' $src/patchlevel.h >>config.sh
22009 echo "PERL_PATCHLEVEL=$perl_patchlevel" >>config.sh
22010 echo "PERL_CONFIG_SH=true" >>config.sh
22012 : propagate old symbols
22013 if $test -f UU/config.sh; then
22014 <UU/config.sh $sort | $uniq >UU/oldconfig.sh
22015 sed -n 's/^\([a-zA-Z_0-9]*\)=.*/\1/p' config.sh config.sh UU/oldconfig.sh |\
22016 $sort | $uniq -u >UU/oldsyms
22017 set X `cat UU/oldsyms`
22023 Hmm...You had some extra variables I don't know about...I'll try to keep 'em...
22025 echo "# Variables propagated from previous config.sh file." >>config.sh
22026 for sym in `cat UU/oldsyms`; do
22027 echo " Propagating $hint variable "'$'"$sym..."
22028 eval 'tmp="$'"${sym}"'"'
22030 sed -e "s/'/'\"'\"'/g" -e "s/^/$sym='/" -e "s/$/'/" >>config.sh
22036 : Finish up by extracting the .SH files
22040 echo "Extraction done."
22050 If you'd like to make any changes to the config.sh file before I begin
22051 to configure things, do it as a shell escape now (e.g. !vi config.sh).
22054 rp="Press return or use a shell escape to edit config.sh:"
22059 *) : in case they cannot read
22060 sh 1>&4 -c "$ans";;
22065 : if this fails, just run all the .SH files by hand
22074 if $contains '^depend:' [Mm]akefile >/dev/null 2>&1; then
22081 Now you need to generate make dependencies by running "$make depend".
22082 You might prefer to run it in background: "$make depend > makedepend.out &"
22083 It can take a while, so you might not want to run it right now.
22088 rp="Run $make depend now?"
22092 $make depend && echo "Now you must run '$make'."
22095 echo "You must run '$make depend' then '$make'."
22098 elif test -f [Mm]akefile; then
22100 echo "Now you must run a $make."
22102 echo "Configure done."
22105 if $test -f Policy.sh; then
22108 If you compile $package on a different machine or from a different object
22109 directory, copy the Policy.sh file from this object directory to the
22110 new one before you run Configure -- this will help you with most of
22111 the policy defaults.
22115 if $test -f config.msg; then
22116 echo "Hmm. I also noted the following information while running:"
22118 $cat config.msg >&4
22121 $rm -f kit*isdone ark*isdone