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 Fri Mar 3 17:34:44 CET 2006 [metaconfig 3.0 PL70]
30 # (with additional metaconfig patches by perlbug@perl.org)
35 SCO csh still thinks true is false. Write to SCO today and tell them that next
36 year Configure ought to "rm /bin/csh" unless they fix their blasted shell. :-)
38 (Actually, Configure ought to just patch csh in place. Hmm. Hmmmmm. All
39 we'd have to do is go in and swap the && and || tokens, wherever they are.)
41 [End of diatribe. We now return you to your regularly scheduled programming...]
45 OOPS! You naughty creature! You didn't run Configure with sh!
46 I will attempt to remedy the situation by running sh for you...
50 true || exec sh $0 $argv:q
52 (exit $?0) || cat c2$$
53 (exit $?0) || exec sh $0 $argv:q
56 if test -f /dev/cputype -a -f /dev/drivers -a -f /dev/osversion; then
59 *** I'm sorry but this system looks like Plan 9 and Plan 9 doesn't do
60 *** Configure that well. (Plan 9 is close to UNIX but not close enough.)
61 *** Please read the README.plan9 for further instructions.
62 *** Cannot continue, aborting.
68 : compute my invocation name
72 me=`echo $0 | sed -e 's!.*/\(.*\)!\1!' 2>/dev/null`
77 : Proper separator for the PATH environment variable
79 : On OS/2 this directory should exist if this is not floppy only system :-]
80 if test -d c:/. || ( uname -a | grep -i 'os\(/\|\)2' ) 2>&1 >/dev/null ; then
81 if test -n "$OS2_SHELL"; then
83 PATH=`cmd /c "echo %PATH%" | tr '\\\\' / `
84 OS2_SHELL=`cmd /c "echo %OS2_SHELL%" | tr '\\\\' / | tr '[A-Z]' '[a-z]'`
86 elif test -n "$DJGPP"; then
87 case "X${MACHTYPE:-nonesuchmach}" in
95 paths='/bin /usr/bin /usr/local/bin /usr/ucb /usr/local /usr/lbin'
96 paths="$paths /opt/bin /opt/local/bin /opt/local /opt/lbin"
97 paths="$paths /usr/5bin /etc /usr/gnu/bin /usr/new /usr/new/bin /usr/nbin"
98 paths="$paths /opt/gnu/bin /opt/new /opt/new/bin /opt/nbin"
99 paths="$paths /sys5.3/bin /sys5.3/usr/bin /bsd4.3/bin /bsd4.3/usr/ucb"
100 paths="$paths /bsd4.3/usr/bin /usr/bsd /bsd43/bin /opt/ansic/bin /usr/ccs/bin"
101 paths="$paths /etc /usr/lib /usr/ucblib /lib /usr/ccs/lib"
102 paths="$paths /sbin /usr/sbin /usr/libexec"
103 paths="$paths /system/gnu_library/bin"
107 case "$p_$PATH$p_" in
109 *) test -d $p && PATH=$PATH$p_$p ;;
116 : shall we be using ksh?
122 if (PATH=.; alias -x) >/dev/null 2>&1; then
125 if test -f /hp-ux -a -f /bin/ksh; then
126 needksh='to avoid sh bug in "here document" expansion'
128 if test -d /usr/lpp -a -f /usr/bin/bsh -a -f /usr/bin/uname; then
129 if test X`/usr/bin/uname -v` = X4; then
130 avoidksh="to avoid AIX 4's /bin/sh"
134 if test -f /osf_boot -a -f /usr/sbin/setld; then
135 if test X`/usr/bin/uname -s` = XOSF1; then
136 avoidksh="to avoid Digital UNIX' ksh"
138 unset BIN_SH # if this is 'xpg4' sh will start up ksh
141 case "$inksh/$needksh" in
148 case "$inksh/$avoidksh" in
154 case "$inksh/$needksh-$avoidksh-" in
157 (I see you are using the Korn shell. Some ksh's blow up on $me,
158 mainly on older exotic systems. If yours does, try the Bourne shell instead.)
165 echo "(Feeding myself to $newsh $reason.)"
167 Configure|*/Configure) exec $newsh $0 "$@";;
168 *) exec $newsh Configure "$@";;
173 : if needed set CDPATH to a harmless value that is not chatty
174 : avoid bash 2.02 problems with empty CDPATH.
178 *bash*) CDPATH='.' ;;
183 : Configure runs within the UU subdirectory
184 test -d UU || mkdir UU
348 d_attribute_format=''
349 d_attribute_malloc=''
350 d_attribute_nonnull=''
351 d_attribute_noreturn=''
353 d_attribute_unused=''
354 d_attribute_warn_unused_result=''
357 d_builtin_choose_expr=''
403 endhostent_r_proto=''
409 endprotoent_r_proto=''
415 endservent_r_proto=''
467 gethostbyaddr_r_proto=''
469 gethostbyname_r_proto=''
471 gethostent_r_proto=''
483 getnetbyaddr_r_proto=''
485 getnetbyname_r_proto=''
499 d_getprotobyname_r=''
500 getprotobyname_r_proto=''
501 d_getprotobynumber_r=''
502 getprotobynumber_r_proto=''
504 getprotoent_r_proto=''
516 getservbyname_r_proto=''
518 getservbyport_r_proto=''
520 getservent_r_proto=''
544 d_libm_lib_version=''
557 d_malloc_good_size=''
599 d_old_pthread_create_joinable=''
600 old_pthread_create_joinable=''
602 d_pthread_attr_setscope=''
641 sethostent_r_proto=''
658 setprotoent_r_proto=''
670 setservent_r_proto=''
703 d_sprintf_returns_strlen=''
718 d_stdio_ptr_lval_nochange_cnt=''
719 d_stdio_ptr_lval_sets_cnt=''
923 inc_version_list_init=''
942 ignore_versioned_solibs=''
1002 d_perl_otherlibdirs=''
1010 api_versionstring=''
1016 version_patchlevel_string=''
1020 d_nv_preserves_uv=''
1021 d_nv_zero_is_allbits_zero=''
1032 nv_preserves_uv_bits=''
1103 installsitehtml1dir=''
1106 installsitehtml3dir=''
1113 installsiteman1dir=''
1116 installsiteman3dir=''
1121 installsitescript=''
1136 d_stdio_stream_array=''
1137 stdio_stream_array=''
1148 ccflags_uselargefiles=''
1149 ldflags_uselargefiles=''
1150 libswanted_uselargefiles=''
1160 userelocatableinc=''
1171 installvendorarch=''
1178 installvendorhtml1dir=''
1180 vendorhtml1direxp=''
1181 installvendorhtml3dir=''
1183 vendorhtml3direxp=''
1189 installvendorman1dir=''
1192 installvendorman3dir=''
1199 installvendorscript=''
1211 smallmach='pdp11 i8086 z8000 i80286 iAPX286'
1214 : We must find out about Eunice early
1216 if test -f /etc/unixtovms; then
1217 eunicefix=/etc/unixtovms
1219 if test -f /etc/unixtovms.exe; then
1220 eunicefix=/etc/unixtovms.exe
1223 : Set executable suffix now -- needed before hints available
1224 if test -f "/libs/version.library"; then
1227 elif test -f "/system/gnu_library/bin/ar.pm"; then
1230 elif test -n "$DJGPP"; then
1233 elif test -d c:/. -o -n "$is_os2" ; then
1242 : set useposix=false in your hint file to disable the POSIX extension.
1244 : set useopcode=false in your hint file to disable the Opcode extension.
1246 : Trailing extension. Override this in a hint file, if needed.
1247 : Extra object files, if any, needed on this platform.
1250 : Possible local include directories to search.
1251 : Set locincpth to "" in a hint file to defeat local include searches.
1252 locincpth="/usr/local/include /opt/local/include /usr/gnu/include"
1253 locincpth="$locincpth /opt/gnu/include /usr/GNU/include /opt/GNU/include"
1255 : no include file wanted by default
1260 : change the next line if compiling for Xenix/286 on Xenix/386
1261 xlibpth='/usr/lib/386 /lib/386'
1262 : Possible local library directories to search.
1263 loclibpth="/usr/local/lib /opt/local/lib /usr/gnu/lib"
1264 loclibpth="$loclibpth /opt/gnu/lib /usr/GNU/lib /opt/GNU/lib"
1266 : general looking path for locating libraries
1267 glibpth="/lib /usr/lib $xlibpth"
1268 glibpth="$glibpth /usr/ccs/lib /usr/ucblib /usr/local/lib"
1269 test -f /usr/shlib/libc.so && glibpth="/usr/shlib $glibpth"
1270 test -f /shlib/libc.so && glibpth="/shlib $glibpth"
1272 : Private path used by Configure to find libraries. Its value
1273 : is prepended to libpth. This variable takes care of special
1274 : machines, like the mips. Usually, it should be empty.
1277 : default library list
1279 : some systems want to use only the non-versioned libso:s
1280 ignore_versioned_solibs=''
1285 ccflags_uselargefiles=''
1286 ldflags_uselargefiles=''
1287 libswanted_uselargefiles=''
1288 : set usemultiplicity on the Configure command line to enable multiplicity.
1289 : set usesocks on the Configure command line to enable socks.
1290 : set usethreads on the Configure command line to enable threads.
1291 usereentrant='undef'
1292 : full support for void wanted by default
1295 : List of libraries we want.
1296 : If anyone needs extra -lxxx, put those in a hint file.
1297 libswanted="sfio socket bind inet nsl nm ndbm gdbm dbm db malloc dl dld ld sun"
1298 libswanted="$libswanted m crypt sec util c cposix posix ucb bsd BSD"
1299 : We probably want to search /usr/shlib before most other libraries.
1300 : This is only used by the lib/ExtUtils/MakeMaker.pm routine extliblist.
1301 glibpth=`echo " $glibpth " | sed -e 's! /usr/shlib ! !'`
1302 glibpth="/usr/shlib $glibpth"
1303 : Do not use vfork unless overridden by a hint file.
1306 : Find the basic shell for Bourne shell scripts
1310 *bsd*|sys5*) xxx="/$SYSTYPE/bin/sh";;
1313 if test -f "$xxx"; then
1316 : Build up a list and do a single loop so we can 'break' out.
1317 pth=`echo $PATH | sed -e "s/$p_/ /g"`
1318 for xxx in sh bash ksh pdksh ash; do
1320 try="$try ${p}/${xxx}"
1324 if test -f "$xxx"; then
1327 elif test "X$_exe" != X -a -f "$xxx$_exe"; then
1330 elif test -f "$xxx.exe"; then
1341 $me: Fatal Error: I can't find a Bourne Shell anywhere.
1343 Usually it's in /bin/sh. How did you even get this far?
1344 Please contact me (Perl Maintainers) at perlbug@perl.org and
1345 we'll try to straighten this all out.
1351 : see if sh knows # comments
1352 if `$sh -c '#' >/dev/null 2>&1`; then
1356 test -f $xcat$_exe || xcat=/usr/bin/cat
1357 if test ! -f $xcat$_exe; then
1358 for p in `echo $PATH | sed -e "s/$p_/ /g"` $paths; do
1359 if test -f $p/cat$_exe; then
1364 if test ! -f $xcat$_exe; then
1365 echo "Can't find cat anywhere!"
1369 echo "#!$xcat" >sharp
1373 if test -s today; then
1376 echo "#! $xcat" > sharp
1380 if test -s today; then
1388 echo "Your $sh doesn't grok # comments--I will strip them later on."
1391 echo "exec grep -v '^[ ]*#'" >spitshell
1393 $eunicefix spitshell
1394 spitshell=`pwd`/spitshell
1396 echo "I presume that if # doesn't work, #! won't work either!"
1401 : figure out how to guarantee sh startup
1403 '') startsh=${sharpbang}${sh} ;;
1415 : echo "Yup, it does."
1417 echo "Hmm... '$startsh' does not guarantee sh startup..."
1418 echo "You may have to fix up the shell scripts to make sure $sh runs them."
1423 : Save command line options in file UU/cmdline.opt for later use in
1424 : generating config.sh.
1425 cat > cmdline.opt <<EOSH
1426 # Configure command line arguments.
1435 cat >>cmdline.opt <<EOSH
1436 config_arg$argn='$arg'
1438 # Extreme backslashitis: replace each ' by '"'"'
1439 cat <<EOC | sed -e "s/'/'"'"'"'"'"'"'/g" > cmdl.opt
1442 arg_exp=`cat cmdl.opt`
1443 args_exp="$args_exp$args_sep'$arg_exp'"
1444 argn=`expr $argn + 1`
1447 # args_exp is good for restarting self: eval "set X $args_exp"; shift; $0 "$@"
1448 # used by ./hints/os2.sh
1451 : produce awk script to parse command line options
1452 cat >options.awk <<'EOF'
1454 optstr = "A:dD:eEf:hKOrsSU:V"; # getopt-style specification
1456 len = length(optstr);
1457 for (i = 1; i <= len; i++) {
1458 c = substr(optstr, i, 1);
1459 if (i < len) a = substr(optstr, i + 1, 1); else a = "";
1470 if (substr(str, 1, 1) != "-") {
1471 printf("'%s'\n", str);
1475 for (i = 2; i <= len; i++) {
1476 c = substr(str, i, 1);
1478 printf("-%s\n", substr(str, i));
1484 printf("'%s'\n", substr(str, i + 1));
1497 : process the command line options
1498 set X `for arg in "$@"; do echo "X$arg"; done |
1499 sed -e s/X// | awk -f options.awk`
1504 : set up default values
1514 rm -f optdef.sh posthint.sh
1515 cat >optdef.sh <<EOS
1521 while test $# -gt 0; do
1523 -d) shift; fastread=yes;;
1524 -e) shift; alldone=cont;;
1528 if test -r "$1"; then
1531 echo "$me: cannot read config file $1." >&2
1536 -h) shift; error=true;;
1537 -r) shift; reuseval=true;;
1538 -s) shift; silent=true; realsilent=true;;
1539 -E) shift; alldone=exit;;
1540 -K) shift; knowitall=true;;
1541 -O) shift; override=true;;
1542 -S) shift; silent=true; extractsh=true;;
1547 echo "$me: use '-U symbol=', not '-D symbol='." >&2
1548 echo "$me: ignoring -D $1" >&2
1551 sed -e "s/'/'\"'\"'/g" -e "s/=\(.*\)/='\1'/" >> optdef.sh;;
1552 *) echo "$1='define'" >> optdef.sh;;
1559 *=) echo "$1" >> optdef.sh;;
1561 echo "$me: use '-D symbol=val', not '-U symbol=val'." >&2
1562 echo "$me: ignoring -U $1" >&2
1564 *) echo "$1='undef'" >> optdef.sh;;
1575 *=*) zzz=`echo "$yyy"|sed 's!=.*!!'`
1579 zzz=" "`echo "$yyy"|sed 's!^[^=]*=!!'`
1580 yyy=`echo "$yyy"|sed 's!=.*!!'` ;;
1586 *:*) xxx=`echo "$yyy"|sed 's!:.*!!'`
1587 yyy=`echo "$yyy"|sed 's!^[^:]*:!!'`
1588 zzz=`echo "$yyy"|sed 's!^[^=]*=!!'`
1589 yyy=`echo "$yyy"|sed 's!=.*!!'` ;;
1590 *) xxx=`echo "$yyy"|sed 's!:.*!!'`
1591 yyy=`echo "$yyy"|sed 's!^[^:]*:!!'` ;;
1597 echo "$yyy=\"\${$yyy}$zzz\"" >> posthint.sh ;;
1599 echo "$yyy=''" >> posthint.sh ;;
1604 echo "$yyy='$zzz'" >> posthint.sh ;;
1606 echo "eval \"$yyy=$zzz\"" >> posthint.sh ;;
1608 echo "$yyy=\"$zzz\${$yyy}\"" >> posthint.sh ;;
1613 echo "$yyy=$zzz" >> posthint.sh ;;
1614 *) echo "$me: unknown -A command '$xxx', ignoring -A $1" >&2 ;;
1618 -V) echo "$me generated by metaconfig 3.0 PL70." >&2
1621 -*) echo "$me: unknown option $1" >&2; shift; error=true;;
1629 Usage: $me [-dehrsEKOSV] [-f config.sh] [-D symbol] [-D symbol=value]
1630 [-U symbol] [-U symbol=] [-A command:symbol...]
1631 -d : use defaults for all answers.
1632 -e : go on without questioning past the production of config.sh.
1633 -f : specify an alternate default configuration file.
1634 -h : print this help message and exit (with an error status).
1635 -r : reuse C symbols value if possible (skips costly nm extraction).
1636 -s : silent mode, only echoes questions and essential information.
1637 -D : define symbol to have some value:
1638 -D symbol symbol gets the value 'define'
1639 -D symbol=value symbol gets the value 'value'
1640 -E : stop at the end of questions, after having produced config.sh.
1641 -K : do not use unless you know what you are doing.
1642 -O : let -D and -U override definitions from loaded configuration file.
1643 -S : perform variable substitutions on all .SH files (can mix with -f)
1644 -U : undefine symbol:
1645 -U symbol symbol gets the value 'undef'
1646 -U symbol= symbol gets completely empty
1647 -A : manipulate symbol after the platform specific hints have been applied:
1648 -A symbol=value append " "value to symbol
1649 -A append:symbol=value append value to symbol
1650 -A define:symbol=value define symbol to have value
1651 -A clear:symbol define symbol to be ''
1652 -A define:symbol define symbol to be 'define'
1653 -A eval:symbol=value define symbol to be eval of value
1654 -A prepend:symbol=value prepend value to symbol
1655 -A undef:symbol define symbol to be 'undef'
1656 -A undef:symbol= define symbol to be ''
1657 -V : print version number and exit (with a zero status).
1664 case "$fastread$alldone" in
1667 case "$extractsh" in
1670 if test ! -t 0; then
1671 echo "Say 'sh Configure', not 'sh <Configure'"
1681 true) exec 1>/dev/null;;
1684 : run the defines and the undefines, if any, but leave the file out there...
1687 : create the posthint manipulation script and leave the file out there...
1692 first=`echo $package | sed -e 's/^\(.\).*/\1/'`
1693 last=`echo $package | sed -e 's/^.\(.*\)/\1/'`
1694 case "`echo AbyZ | tr '[:lower:]' '[:upper:]' 2>/dev/null`" in
1695 ABYZ) spackage=`echo $first | tr '[:lower:]' '[:upper:]'`$last;;
1696 *) spackage=`echo $first | tr '[a-z]' '[A-Z]'`$last;;
1699 : Some greps do not return status, grrr.
1700 echo "grimblepritz" >grimble
1701 if grep blurfldyick grimble >/dev/null 2>&1 ; then
1703 elif grep grimblepritz grimble >/dev/null 2>&1 ; then
1709 : the following should work in any shell
1713 echo "AGH! Grep doesn't return a status. Attempting remedial action."
1714 cat >contains <<'EOSS'
1715 grep "$1" "$2" >.greptmp && cat .greptmp && test -s .greptmp
1720 : Find the path to the source tree
1723 */*) src=`echo $0 | sed -e 's%/[^/][^/]*$%%'`
1727 *) src=`cd ../$src && pwd` ;;
1740 if test -f $rsrc/Configure && \
1741 $contains "^package=$package$" $rsrc/Configure >/dev/null 2>&1
1743 : found it, so we are ok.
1746 for src in . .. ../.. ../../.. ../../../..; do
1747 if test -f ../$src/Configure && \
1748 $contains "^package=$package$" ../$src/Configure >/dev/null 2>&1
1759 Sorry, I can't seem to locate the source dir for $package. Please start
1760 Configure with an explicit path -- i.e. /some/path/Configure.
1768 echo "Sources for $package found in \"$src\"." >&4
1772 : script used to extract .SH files with variable substitutions
1773 cat >extract <<'EOS'
1775 echo "Doing variable substitutions on .SH files..."
1776 if test -f MANIFEST; then
1777 set x `awk '{print $1}' < MANIFEST | grep '\.SH$'`
1779 echo "(Looking for .SH files under the source directory.)"
1780 set x `(cd "$src"; find . -name "*.SH" -print)`
1784 0) set x `(cd "$src"; echo *.SH)`; shift;;
1786 if test ! -f "$src/$1"; then
1792 while test $name; do
1793 if test ! -d "$name"; then
1794 create="$name $create";
1795 name=`echo $name | sed -e "s|^[^/]*$||"`;
1796 name=`echo $name | sed -e "s|\(.*\)/.*|\1|"`;
1801 for file in $create; do
1810 dir=`expr X$file : 'X\(.*\)/'`
1811 file=`expr X$file : 'X.*/\(.*\)'`
1812 (cd "$dir" && . ./$file)
1822 dir=`expr X$file : 'X\(.*\)/'`
1823 file=`expr X$file : 'X.*/\(.*\)'`
1824 (set x $dir; shift; eval $mkdir_p)
1825 sh <"$src/$dir/$file"
1834 if test -f "$src/config_h.SH"; then
1835 if test ! -f config.h; then
1836 : oops, they left it out of MANIFEST, probably, so do it anyway.
1837 . "$src/config_h.SH"
1842 : extract files and exit if asked to do so
1843 case "$extractsh" in
1845 case "$realsilent" in
1849 case "$config_sh" in
1850 '') config_sh='config.sh';;
1853 echo "Fetching answers from $config_sh..."
1856 test "$override" && . ./optdef.sh
1860 echo "Extraction done."
1865 : Eunice requires " " instead of "", can you believe it
1868 echo "Beginning of configuration questions for $package."
1870 trap 'echo " "; test -d ../UU && rm -rf X $rmlist; exit 1' 1 2 3 15
1872 : first determine how to suppress newline on echo command
1874 echo "Checking echo to see how to suppress newlines..."
1875 (echo "hi there\c" ; echo " ") >.echotmp
1876 if $contains c .echotmp >/dev/null 2>&1 ; then
1887 echo $n "The star should be here-->$c"
1891 : Now test for existence of everything in MANIFEST
1893 if test -f "$rsrc/MANIFEST"; then
1894 echo "First let's make sure your kit is complete. Checking..." >&4
1895 awk '$1 !~ /PACK[A-Z]+/ {print $1}' "$rsrc/MANIFEST" | (split -l 50 2>/dev/null || split -50)
1898 for filelist in x??; do
1899 (cd "$rsrc"; ls `cat "$tmppwd/$filelist"` >/dev/null 2>>"$tmppwd/missing")
1901 if test -s missing; then
1905 THIS PACKAGE SEEMS TO BE INCOMPLETE.
1907 You have the option of continuing the configuration process, despite the
1908 distinct possibility that your kit is damaged, by typing 'y'es. If you
1909 do, don't blame me if something goes wrong. I advise you to type 'n'o
1910 and contact the author (perlbug@perl.org).
1913 echo $n "Continue? [n] $c" >&4
1917 echo "Continuing..." >&4
1921 echo "ABORTING..." >&4
1926 echo "Looks good..."
1929 echo "There is no MANIFEST file. I hope your kit is complete !"
1934 : Find the appropriate value for a newline for tr
1935 if test -n "$DJGPP"; then
1938 if test X"$trnl" = X; then
1939 case "`echo foo|tr '\n' x 2>/dev/null`" in
1943 if test X"$trnl" = X; then
1944 case "`echo foo|tr '\012' x 2>/dev/null`" in
1945 foox) trnl='\012' ;;
1948 if test X"$trnl" = X; then
1949 case "`echo foo|tr '\r\n' xy 2>/dev/null`" in
1950 fooxy) trnl='\n\r' ;;
1953 if test X"$trnl" = X; then
1956 $me: Fatal Error: cannot figure out how to translate newlines with 'tr'.
1962 : compute the number of columns on the terminal for proper question formatting
1967 : set up the echo used in my read
1968 myecho="case \"\$xxxm\" in
1969 '') echo $n \"\$rp $c\" >&4;;
1971 '') echo $n \"[\$xxxm] $c\";;
1973 if test \`echo \"\$rp [\$xxxm] \" | wc -c\` -ge $COLUMNS; then
1975 echo $n \"[\$xxxm] $c\" >&4
1977 echo $n \"\$rp [\$xxxm] $c\" >&4
1983 : now set up to do reads with possible shell escape and default assignment
1989 case "\$fastread" in
1990 yes) case "\$dflt" in
1993 case "\$silent-\$rp" in
1998 *) case "\$silent" in
1999 true) case "\$rp" in
2004 while expr "X\$ans" : "X!" >/dev/null; do
2008 aok=''; eval "ans=\\"\$answ\\"" && aok=y
2016 set x \`expr "X\$ans" : "X!\(.*\)\$"\`
2025 set x \`expr "X\$ans" : "X&\(.*\)\$"\`
2030 echo "(OK, I'll run with -d after this question.)" >&4
2033 echo "*** Sorry, \$1 not supported yet." >&4
2043 echo "*** Substitution done -- please confirm."
2045 ans=\`echo $n "\$ans$c" | tr '$trnl' ' '\`
2050 echo "*** Error -- try again."
2057 case "\$ans\$xxxm\$nostick" in
2069 : create .config dir to save info across Configure sessions
2070 test -d ../.config || mkdir ../.config
2071 cat >../.config/README <<EOF
2072 This directory created by Configure to save information that should
2073 persist across sessions for $package.
2075 You may safely delete it if you wish.
2078 xversion=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
2080 $define|true|[yY]*) ;;
2081 *) case "$xversion" in
2084 *** WHOA THERE!!! ***
2086 This is an UNSTABLE DEVELOPMENT release.
2087 The version of this $package distribution is $xversion, that is, odd,
2088 (as opposed to even) and that signifies a development release.
2089 If you want a maintenance release, you want an even-numbered version.
2091 Do ***NOT*** install this into production use.
2092 Data corruption and crashes are possible.
2094 It is most seriously suggested that you do not continue any further
2095 unless you want to help in developing and debugging Perl.
2097 If you *still* want to build perl, you can answer 'y' now,
2098 or pass -Dusedevel to Configure.
2101 rp='Do you really want to continue?'
2105 [yY]) echo >&4 "Okay, continuing."
2106 usedevel="$define" ;;
2107 *) echo >&4 "Okay, bye."
2117 case "$versiononly" in
2118 '') versiononly="$define" ;;
2120 case "$installusrbinperl" in
2121 '') installusrbinperl="$undef" ;;
2126 : general instructions
2129 user=`(logname) 2>/dev/null`
2131 '') user=`whoami 2>&1`;;
2133 if $contains "^$user\$" ../.config/instruct >/dev/null 2>&1; then
2136 rp='Would you like to see the instructions?'
2147 This installation shell script will examine your system and ask you questions
2148 to determine how the perl5 package should be installed. If you get
2149 stuck on a question, you may use a ! shell escape to start a subshell or
2150 execute a command. Many of the questions will have default answers in square
2151 brackets; typing carriage return will give you the default.
2153 On some of the questions which ask for file or directory names you are allowed
2154 to use the ~name construct to specify the login directory belonging to "name",
2155 even if you don't have a shell which knows about that. Questions where this is
2156 allowed will be marked "(~name ok)".
2160 dflt='Type carriage return to continue'
2164 The prompter used in this script allows you to use shell variables and
2165 backticks in your answers. You may use $1, $2, etc... to refer to the words
2166 in the default answer, as if the default line was a set of arguments given to a
2167 script shell. This means you may also use $* to repeat the whole default line,
2168 so you do not have to re-type everything to add something to the default.
2170 Everytime there is a substitution, you will have to confirm. If there is an
2171 error (e.g. an unmatched backtick), the default answer will remain unchanged
2172 and you will be prompted again.
2174 If you are in a hurry, you may run 'Configure -d'. This will bypass nearly all
2175 the questions and use the computed defaults (or the previous answers if there
2176 was already a config.sh file). Type 'Configure -h' for a list of options.
2177 You may also start interactively and then answer '& -d' at any prompt to turn
2178 on the non-interactive behaviour for the remainder of the execution.
2184 Much effort has been expended to ensure that this shell script will run on any
2185 Unix system. If despite that it blows up on yours, your best bet is to edit
2186 Configure and run it again. If you can't run Configure for some reason,
2187 you'll have to generate a config.sh file by hand. Whatever problems you
2188 have, let me (perlbug@perl.org) know how I blew it.
2190 This installation script affects things in two ways:
2192 1) it may do direct variable substitutions on some of the files included
2194 2) it builds a config.h file for inclusion in C programs. You may edit
2195 any of these files as the need arises after running this script.
2197 If you make a mistake on a question, there is no easy way to back up to it
2198 currently. The easiest thing to do is to edit config.sh and rerun all the SH
2199 files. Configure will offer to let you do this before it runs the SH files.
2202 dflt='Type carriage return to continue'
2204 case "$firsttime" in
2205 true) echo $user >>../.config/instruct;;
2209 : find out where common programs are
2211 echo "Locating common programs..." >&4
2224 if test -d \$dir/\$thing; then
2230 for thisthing in \$dir/\$thing; do
2231 : just loop through to pick last item
2233 if test -f \$thisthing; then
2236 elif test "X$_exe" != X -a -f \$thisthing$_exe; then
2239 elif test -f \$dir/\$thing.exe; then
2240 if test -n "$DJGPP"; then
2241 echo \$dir/\$thing.exe
2242 elif test "$eunicefix" != ":"; then
2243 : on Eunice apparently
2297 pth=`echo $PATH | sed -e "s/$p_/ /g"`
2298 pth="$pth /lib /usr/lib"
2299 for file in $loclist; do
2303 if test -f "$xxx"; then
2306 echo "WARNING: no $xxx -- ignoring your setting for $file." >&4
2307 xxx=`./loc $file $file $pth`
2310 '') xxx=`./loc $file $file $pth`;;
2311 *) xxx=`./loc $xxx $xxx $pth`;;
2313 eval $file=$xxx$_exe
2317 echo $file is in $xxx.
2320 echo $file is in $xxx.
2323 echo "I don't know where '$file' is, and my life depends on it." >&4
2324 echo "Go find a public domain implementation or fix your PATH setting!" >&4
2330 echo "Don't worry if any of the following aren't found..."
2332 for file in $trylist; do
2336 if test -f "$xxx"; then
2339 echo "WARNING: no $xxx -- ignoring your setting for $file." >&4
2340 xxx=`./loc $file $file $pth`
2343 '') xxx=`./loc $file $file $pth`;;
2344 *) xxx=`./loc $xxx $xxx $pth`;;
2346 eval $file=$xxx$_exe
2350 echo $file is in $xxx.
2353 echo $file is in $xxx.
2356 echo "I don't see $file out there, $say."
2363 echo "Substituting grep for egrep."
2370 echo "Substituting cp for ln."
2379 echo "I can't find make or gmake, and my life depends on it." >&4
2380 echo "Go find a public domain implementation or fix your PATH setting!" >&4
2388 *) # We can't have osname yet.
2389 if test -f "/system/gnu_library/bin/ar.pm"; then # Stratus VOS
2390 # Assume that gmake, if found, is definitely GNU make
2391 # and prefer it over the system make.
2392 echo "Substituting gmake for make."
2400 echo "Hopefully test is built into your sh."
2403 if `sh -c "PATH= test true" >/dev/null 2>&1`; then
2404 echo "Using the test built into your sh."
2412 echo "Hopefully echo is built into your sh."
2417 echo "Checking compatibility between $echo and builtin echo (if any)..." >&4
2418 $echo $n "hi there$c" >foo1
2419 echo $n "hi there$c" >foo2
2420 if cmp foo1 foo2 >/dev/null 2>&1; then
2421 echo "They are compatible. In fact, they may be identical."
2428 They are not compatible! You are probably running ksh on a non-USG system.
2429 I'll have to use $echo instead of the builtin, since Bourne shell doesn't
2430 have echo built in and we may have to run some Bourne shell scripts. That
2431 means I'll have to use '$n$c' to suppress newlines now. Life is ridiculous.
2434 $echo $n "The star should be here-->$c"
2444 cat <<'EOSC' >>trygcc
2449 int main(int argc, char *argv[]) {
2453 if $cc -o try $ccflags $ldflags try.c; then
2456 echo "Uh-oh, the C compiler '$cc' doesn't seem to be working." >&4
2462 case "`$cc -v -c try.c 2>&1`" in
2465 if $test X"$trygcc" = Xyes; then
2466 if gcc -o try -c try.c; then
2468 echo "You seem to have a working gcc, though." >&4
2469 rp="Would you like to use it?"
2471 if $test -f myread; then
2474 if $test -f UU/myread; then
2477 echo "Cannot find myread, sorry. Aborting." >&2
2482 [yY]*) cc=gcc; ccname=gcc; ccflags=''; despair=no;
2483 if $test -f usethreads.cbu; then
2486 *** However, any setting of the C compiler flags (e.g. for thread support)
2487 *** has been lost. It may be necessary to pass -Dcc=gcc to Configure
2488 *** (together with e.g. -Dusethreads).
2504 cat <<'EOSC' >>checkcc
2509 int main(int argc, char *argv[]) {
2513 if $cc -o try $ccflags $ldflags try.c; then
2516 if $test X"$despair" = Xyes; then
2517 echo "Uh-oh, the C compiler '$cc' doesn't seem to be working." >&4
2520 You need to find a working C compiler.
2521 Either (purchase and) install the C compiler supplied by your OS vendor,
2522 or for a free C compiler try http://gcc.gnu.org/
2523 I cannot continue any further, aborting.
2532 : determine whether symbolic links are supported
2535 if $ln -s blurfl sym > /dev/null 2>&1 ; then
2536 echo "Symbolic links are supported." >&4
2539 echo "Symbolic links are NOT supported." >&4
2544 : determine whether symbolic links are supported
2548 echo "Checking how to test for symbolic links..." >&4
2550 if $test "X$issymlink" = X; then
2552 '') sh -c "PATH= test -h sym" >/dev/null 2>&1 ;;
2553 *) $newsh -c "PATH= test -h sym" >/dev/null 2>&1 ;;
2555 if test $? = 0; then
2558 echo "Your builtin 'test -h' may be broken." >&4
2561 *) pth=`echo $PATH | sed -e "s/$p_/ /g"`
2564 if test -f "$p/$test"; then
2573 echo "Trying external '$test -h'." >&4
2574 issymlink="$test -h"
2575 if $test ! -h sym >/dev/null 2>&1; then
2576 echo "External '$test -h' is broken, too." >&4
2584 if $test "X$issymlink" = X; then
2585 if $test -L sym 2>/dev/null; then
2586 issymlink="$test -L"
2587 echo "The builtin '$test -L' worked." >&4
2590 if $test "X$issymlink" != X; then
2591 echo "You can test for symbolic links with '$issymlink'." >&4
2593 echo "I do not know how you can test for symbolic links." >&4
2597 *) echo "No symbolic links, so not testing for their testing..." >&4
2603 case "$mksymlinks" in
2606 ''|'.') echo "Cannot create symlinks in the original directory." >&4
2609 *) case "$lns:$issymlink" in
2610 *"ln"*" -s:"*"test -"?)
2611 echo "Creating the symbolic links..." >&4
2612 echo "(First creating the subdirectories...)" >&4
2614 awk '{print $1}' $src/MANIFEST | grep / | sed 's:/[^/]*$::' | sort -u | while true; do
2616 test -z "$directory" && break
2620 if test ! -d t/base; then
2621 echo "Failed to create the subdirectories. Aborting." >&4
2624 echo "(Then creating the symlinks...)" >&4
2625 awk '{print $1}' $src/MANIFEST | while true; do
2627 test -z "$filename" && break
2628 if test -f $filename; then
2629 if $issymlink $filename; then
2633 if test -f $filename; then
2634 echo "$filename already exists, not symlinking."
2636 ln -s $src/$filename $filename
2640 if test ! -f t/base/lex.t; then
2641 echo "Failed to create the symlinks (t/base/lex.t missing). Aborting." >&4
2646 *) echo "(I cannot figure out how to do symbolic links, ignoring mksymlinks)." >&4
2655 case "$usecrosscompile" in
2657 $echo "Cross-compiling..."
2660 *-*-gcc) # A cross-compiling gcc, probably.
2661 targetarch=`$echo $cc|$sed 's/-gcc$//'`
2663 # leave out ld, choosing it is more complex
2665 ranlib=$targetarch-ranlib
2666 $echo 'extern int foo;' > try.c
2667 set X `$cc -v -E try.c 2>&1 | $awk '/^#include </,/^End of search /'|$grep '/include'`
2669 if $test $# -gt 0; then
2671 incpth="`$echo $incpth|$sed 's/^ //'`"
2672 echo "Guessing incpth '$incpth'." >&4
2674 j="`$echo $i|$sed 's,/include$,/lib,'`"
2675 if $test -d $j; then
2679 libpth="`$echo $libpth|$sed 's/^ //'`"
2680 echo "Guessing libpth '$libpth'." >&4
2685 case "$targetarch" in
2686 '') echo "Targetarch not defined." >&4; croak=y ;;
2687 *) echo "Using targetarch $targetarch." >&4 ;;
2690 '') echo "Incpth not defined." >&4; croak=y ;;
2691 *) echo "Using incpth '$incpth'." >&4 ;;
2694 '') echo "Libpth not defined." >&4; croak=y ;;
2695 *) echo "Using libpth '$libpth'." >&4 ;;
2698 '') for i in $incpth; do
2699 if $test -f $i/errno.h -a -f $i/stdio.h -a -f $i/time.h; then
2701 echo "Guessing usrinc $usrinc." >&4
2706 '') echo "Usrinc not defined." >&4; croak=y ;;
2709 *) echo "Using usrinc $usrinc." >&4 ;;
2711 case "$targethost" in
2712 '') echo "Targethost not defined." >&4; croak=y ;;
2713 *) echo "Using targethost $targethost." >&4
2718 y) echo "Cannot continue, aborting." >&4; exit 1 ;;
2721 /*) run=$src/Cross/run
2722 targetmkdir=$src/Cross/mkdir
2724 from=$src/Cross/from
2726 *) pwd=`$test -f ../Configure & cd ..; pwd`
2728 targetmkdir=$pwd/Cross/mkdir
2730 from=$pwd/Cross/from
2733 case "$targetrun" in
2734 '') targetrun=ssh ;;
2739 case "$targetfrom" in
2740 '') targetfrom=scp ;;
2744 from=$from-$targetfrom
2745 case "$targetdir" in
2747 echo "Guessing targetdir $targetdir." >&4
2750 case "$targetuser" in
2752 echo "Guessing targetuser $targetuser." >&4
2755 case "$targetfrom" in
2759 case "$targetrun" in
2771 '') cwd=$targetdir ;;
2775 if $test ! -f \$exe.xok; then
2779 $targetrun -l $targetuser $targethost "cd \$cwd && ./\$exe \$@"
2782 *) echo "Unknown targetrun '$targetrun'" >&4
2786 case "$targetmkdir" in
2788 cat >$targetmkdir <<EOF
2790 $targetrun -l $targetuser $targethost "mkdir -p \$@"
2792 $chmod a+rx $targetmkdir
2794 *) echo "Unknown targetmkdir '$targetmkdir'" >&4
2806 $targetmkdir \`dirname \$f\`
2807 $targetto $q \$f $targetuser@$targethost:\$f || exit 1
2810 $targetmkdir $targetdir/\`dirname \$f\`
2811 $targetto $q \$f $targetuser@$targethost:$targetdir/\$f || exit 1
2824 $mkdir -p $targetdir/\`dirname \$f\`
2825 $cp \$f $targetdir/\$f || exit 1
2828 $targetmkdir $targetdir/\`dirname \$f\`
2829 $cp \$f $targetdir/\$f || exit 1
2836 *) echo "Unknown targetto '$targetto'" >&4
2840 case "$targetfrom" in
2847 $targetfrom $q $targetuser@$targethost:$targetdir/\$f . || exit 1
2852 cp) cat >$from <<EOF
2857 cp $targetdir/\$f . || exit 1
2862 *) echo "Unknown targetfrom '$targetfrom'" >&4
2866 if $test ! -f $run; then
2867 echo "Target 'run' script '$run' not found." >&4
2871 if $test ! -f $to; then
2872 echo "Target 'to' script '$to' not found." >&4
2876 if $test ! -f $from; then
2877 echo "Target 'from' script '$from' not found." >&4
2881 if $test ! -f $run -o ! -f $to -o ! -f $from; then
2885 Using '$run' for remote execution,
2886 and '$from' and '$to'
2887 for remote file transfer.
2893 usecrosscompile='undef'
2898 : see whether [:lower:] and [:upper:] are supported character classes
2900 case "`echo AbyZ | $tr '[:lower:]' '[:upper:]' 2>/dev/null`" in
2902 echo "Good, your tr supports [:lower:] and [:upper:] to convert case." >&4
2906 *) # There is a discontinuity in EBCDIC between 'R' and 'S'
2907 # (0xd9 and 0xe2), therefore that is a nice testing point.
2908 if test "X$up" = X -o "X$low" = X; then
2909 case "`echo RS | $tr '[R-S]' '[r-s]' 2>/dev/null`" in
2915 if test "X$up" = X -o "X$low" = X; then
2916 case "`echo RS | $tr R-S r-s 2>/dev/null`" in
2922 if test "X$up" = X -o "X$low" = X; then
2923 case "`echo RS | od -x 2>/dev/null`" in
2925 echo "Hey, this might be EBCDIC." >&4
2926 if test "X$up" = X -o "X$low" = X; then
2927 case "`echo RS | $tr '[A-IJ-RS-Z]' '[a-ij-rs-z]' 2>/dev/null`" in
2928 rs) up='[A-IJ-RS-Z]'
2933 if test "X$up" = X -o "X$low" = X; then
2934 case "`echo RS | $tr A-IJ-RS-Z a-ij-rs-z 2>/dev/null`" in
2944 case "`echo RS | $tr \"$up\" \"$low\" 2>/dev/null`" in
2946 echo "Using $up and $low to convert case." >&4
2949 echo "I don't know how to translate letters from upper to lower case." >&4
2950 echo "Your tr is not acting any way I know of." >&4
2954 : set up the translation script tr, must be called with ./tr of course
2958 '[A-Z][a-z]') exec $tr '$up' '$low';;
2959 '[a-z][A-Z]') exec $tr '$low' '$up';;
2966 : Try to determine whether config.sh was made on this system
2967 case "$config_sh" in
2969 myuname=`$uname -a 2>/dev/null`
2970 $test -z "$myuname" && myuname=`hostname 2>/dev/null`
2971 # tr '[A-Z]' '[a-z]' would not work in EBCDIC
2972 # because the A-Z/a-z are not consecutive.
2973 myuname=`echo $myuname | $sed -e 's/^[^=]*=//' -e 's/\///g' | \
2974 ./tr '[A-Z]' '[a-z]' | $tr $trnl ' '`
2975 newmyuname="$myuname"
2977 case "$knowitall" in
2979 if test -f ../config.sh; then
2980 if $contains myuname= ../config.sh >/dev/null 2>&1; then
2981 eval "`grep myuname= ../config.sh`"
2983 if test "X$myuname" = "X$newmyuname"; then
2991 : Get old answers from old config file if Configure was run on the
2992 : same system, otherwise use the hints.
2995 if test -f config.sh; then
2997 rp="I see a config.sh file. Shall I use it to set the defaults?"
3000 n*|N*) echo "OK, I'll ignore it."
3001 mv config.sh config.sh.old
3002 myuname="$newmyuname"
3004 *) echo "Fetching default answers from your old config.sh file..." >&4
3012 : Older versions did not always set $sh. Catch re-use of such
3022 if test ! -f config.sh; then
3025 First time through, eh? I have some defaults handy for some systems
3026 that need some extra help getting the Configure answers right:
3029 (cd $src/hints; ls -C *.sh) | $sed 's/\.sh/ /g' >&4
3031 : Half the following guesses are probably wrong... If you have better
3032 : tests or hints, please send them to perlbug@perl.org
3033 : The metaconfig authors would also appreciate a copy...
3034 $test -f /irix && osname=irix
3035 $test -f /xenix && osname=sco_xenix
3036 $test -f /dynix && osname=dynix
3037 $test -f /dnix && osname=dnix
3038 $test -f /lynx.os && osname=lynxos
3039 $test -f /unicos && osname=unicos && osvers=`$uname -r`
3040 $test -f /unicosmk && osname=unicosmk && osvers=`$uname -r`
3041 $test -f /unicosmk.ar && osname=unicosmk && osvers=`$uname -r`
3042 $test -f /bin/mips && /bin/mips && osname=mips
3043 $test -d /NextApps && set X `hostinfo | grep 'NeXT Mach.*:' | \
3044 $sed -e 's/://' -e 's/\./_/'` && osname=next && osvers=$4
3045 $test -d /usr/apollo/bin && osname=apollo
3046 $test -f /etc/saf/_sactab && osname=svr4
3047 $test -d /usr/include/minix && osname=minix
3048 $test -f /system/gnu_library/bin/ar.pm && osname=vos
3049 if $test -d /MachTen -o -d /MachTen_Folder; then
3051 if $test -x /sbin/version; then
3052 osvers=`/sbin/version | $awk '{print $2}' |
3053 $sed -e 's/[A-Za-z]$//'`
3054 elif $test -x /usr/etc/version; then
3055 osvers=`/usr/etc/version | $awk '{print $2}' |
3056 $sed -e 's/[A-Za-z]$//'`
3062 $test -f /sys/posix.dll &&
3063 $test -f /usr/bin/what &&
3064 set X `/usr/bin/what /sys/posix.dll` &&
3065 $test "$3" = UWIN &&
3069 if $test -f $uname; then
3077 umips) osname=umips ;;
3080 [23]100) osname=mips ;;
3081 next*) osname=next ;;
3083 tmp=`/bin/uname -X 2>/dev/null|awk '/3\.2v[45]/{ print $(NF) }'`
3084 if $test "$tmp" != "" -a "$3" = "3.2" -a -f '/etc/systemid'; then
3087 elif $test -f /etc/kconfig; then
3089 if test "$lns" = "$ln -s"; then
3091 elif $contains _SYSV3 /usr/include/stdio.h > /dev/null 2>&1 ; then
3093 elif $contains _POSIX_SOURCE /usr/include/stdio.h > /dev/null 2>&1 ; then
3100 if test -n "$DJGPP"; then
3109 tmp=`( (oslevel) 2>/dev/null || echo "not found") 2>&1`
3111 # oslevel can fail with:
3112 # oslevel: Unable to acquire lock.
3113 *not\ found) osvers="$4"."$3" ;;
3114 '<3240'|'<>3240') osvers=3.2.0 ;;
3115 '=3240'|'>3240'|'<3250'|'<>3250') osvers=3.2.4 ;;
3116 '=3250'|'>3250') osvers=3.2.5 ;;
3120 bsd386) osname=bsd386
3123 cygwin*) osname=cygwin
3126 *dc.osx) osname=dcosx
3132 domainos) osname=apollo
3138 dragonfly) osname=dragonfly
3141 dynixptx*) osname=dynixptx
3142 osvers=`echo "$4"|sed 's/^v//'`
3144 freebsd) osname=freebsd
3146 genix) osname=genix ;;
3150 osvers=`echo "$3" | $sed 's,.*\.\([0-9]*\.[0-9]*\),\1,'`
3166 netbsd*) osname=netbsd
3169 news-os) osvers="$3"
3171 4*) osname=newsos4 ;;
3175 next*) osname=next ;;
3176 nonstop-ux) osname=nonstopux ;;
3177 openbsd) osname=openbsd
3183 POSIX-BC | posix-bc ) osname=posix-bc
3186 powerux | power_ux | powermax_os | powermaxos | \
3187 powerunix | power_unix) osname=powerux
3193 solaris) osname=solaris
3195 5*) osvers=`echo $3 | $sed 's/^5/2/g'` ;;
3202 osvers=`echo $3 | $sed 's/^5/2/g'` ;;
3206 titanos) osname=titanos
3215 ultrix) osname=ultrix
3218 osf1|mls+) case "$5" in
3221 osvers=`sizer -v | awk -FUNIX '{print $2}' | awk '{print $1}' | tr '[A-Z]' '[a-z]' | sed 's/^[xvt]//'`
3224 *) osvers=`echo "$3" | sed 's/^[xvt]//'` ;;
3227 hp*) osname=hp_osf1 ;;
3228 mips) osname=mips_osf1 ;;
3231 # UnixWare 7.1.2 is known as Open UNIX 8
3232 openunix|unixware) osname=svr5
3240 $2) case "$osname" in
3244 : svr4.x or possibly later
3254 if test -f /stand/boot ; then
3255 eval `grep '^INITPROG=[a-z/0-9]*$' /stand/boot`
3256 if test -n "$INITPROG" -a -f "$INITPROG"; then
3257 isesix=`strings -a $INITPROG|grep 'ESIX SYSTEM V/386 Release 4.0'`
3258 if test -n "$isesix"; then
3266 *) if test -f /etc/systemid; then
3268 set `echo $3 | $sed 's/\./ /g'` $4
3269 if $test -f $src/hints/sco_$1_$2_$3.sh; then
3271 elif $test -f $src/hints/sco_$1_$2.sh; then
3273 elif $test -f $src/hints/sco_$1.sh; then
3278 '') : Still unknown. Probably a generic Sys V.
3287 *) case "$osname" in
3288 '') : Still unknown. Probably a generic BSD.
3296 if test -f /vmunix -a -f $src/hints/news_os.sh; then
3297 (what /vmunix | UU/tr '[A-Z]' '[a-z]') > UU/kernel.what 2>&1
3298 if $contains news-os UU/kernel.what >/dev/null 2>&1; then
3301 $rm -f UU/kernel.what
3302 elif test -d c:/. -o -n "$is_os2" ; then
3309 case "$targetarch" in
3312 osname=`echo $targetarch|sed 's,^[^-]*-,,'`
3317 : Now look for a hint file osname_osvers, unless one has been
3318 : specified already.
3321 file=`echo "${osname}_${osvers}" | $sed -e 's%\.%_%g' -e 's%_$%%'`
3322 : Also try without trailing minor version numbers.
3323 xfile=`echo $file | $sed -e 's%_[^_]*$%%'`
3324 xxfile=`echo $xfile | $sed -e 's%_[^_]*$%%'`
3325 xxxfile=`echo $xxfile | $sed -e 's%_[^_]*$%%'`
3326 xxxxfile=`echo $xxxfile | $sed -e 's%_[^_]*$%%'`
3329 *) case "$osvers" in
3332 *) if $test -f $src/hints/$file.sh ; then
3334 elif $test -f $src/hints/$xfile.sh ; then
3336 elif $test -f $src/hints/$xxfile.sh ; then
3338 elif $test -f $src/hints/$xxxfile.sh ; then
3340 elif $test -f $src/hints/$xxxxfile.sh ; then
3342 elif $test -f "$src/hints/${osname}.sh" ; then
3351 if $test -f Policy.sh ; then
3354 none) dflt="Policy" ;;
3355 *) dflt="Policy $dflt" ;;
3360 dflt=`echo $hintfile | $sed 's/\.sh$//'`
3364 if $test -f Policy.sh ; then
3367 There's also a Policy hint file available, which should make the
3368 site-specific (policy) questions easier to answer.
3375 You may give one or more space-separated answers, or "none" if appropriate.
3376 A well-behaved OS will have no hints, so answering "none" or just "Policy"
3377 is a good thing. DO NOT give a wrong version or a wrong OS.
3381 rp="Which of these apply, if any?"
3384 for file in $tans; do
3385 if $test X$file = XPolicy -a -f Policy.sh; then
3387 $cat Policy.sh >> UU/config.sh
3388 elif $test -f $src/hints/$file.sh; then
3389 . $src/hints/$file.sh
3390 $cat $src/hints/$file.sh >> UU/config.sh
3391 elif $test X"$tans" = X -o X"$tans" = Xnone ; then
3394 : Give one chance to correct a possible typo.
3395 echo "$file.sh does not exist"
3397 rp="hint to use instead?"
3399 for file in $ans; do
3400 if $test -f "$src/hints/$file.sh"; then
3401 . $src/hints/$file.sh
3402 $cat $src/hints/$file.sh >> UU/config.sh
3403 elif $test X$ans = X -o X$ans = Xnone ; then
3406 echo "$file.sh does not exist -- ignored."
3413 : Remember our hint file for later.
3414 if $test -f "$src/hints/$file.sh" ; then
3424 echo "Fetching default answers from $config_sh..." >&4
3428 cp $config_sh config.sh 2>/dev/null
3438 test "$override" && . ./optdef.sh
3440 : Restore computed paths
3441 for file in $loclist $trylist; do
3442 eval $file="\$_$file"
3447 Configure uses the operating system name and version to set some defaults.
3448 The default value is probably right if the name rings a bell. Otherwise,
3449 since spelling matters for me, either accept the default or answer "none"
3456 ''|' '|none) dflt=none ;;
3457 *) dflt=`echo $hintfile | $sed -e 's/\.sh$//' -e 's/_.*$//'` ;;
3460 *) dflt="$osname" ;;
3462 rp="Operating system name?"
3466 *) osname=`echo "$ans" | $sed -e 's/[ ][ ]*/_/g' | ./tr '[A-Z]' '[a-z]'`;;
3472 ''|' '|none) dflt=none ;;
3473 *) dflt=`echo $hintfile | $sed -e 's/\.sh$//' -e 's/^[^_]*//'`
3474 dflt=`echo $dflt | $sed -e 's/^_//' -e 's/_/./g'`
3476 ''|' ') dflt=none ;;
3481 *) dflt="$osvers" ;;
3483 rp="Operating system version?"
3493 : who configured the system
3494 cf_time=`LC_ALL=C; LANGUAGE=C; export LC_ALL; export LANGUAGE; $date 2>&1`
3497 cf_by=`(logname) 2>/dev/null`
3500 cf_by=`(whoami) 2>/dev/null`
3502 "") cf_by=unknown ;;
3507 : set up the script used to warn in case of inconsistency
3514 echo "*** WHOA THERE!!! ***" >&4
3515 echo " The $hint value for \$$var on this machine was \"$was\"!" >&4
3516 rp=" Keep the $hint value?"
3519 y) td=$was; tu=$was;;
3523 : function used to set $1 to $val
3524 setvar='var=$1; eval "was=\$$1"; td=$define; tu=$undef;
3526 $define$undef) . ./whoa; eval "$var=\$td";;
3527 $undef$define) . ./whoa; eval "$var=\$tu";;
3528 *) eval "$var=$val";;
3532 $define|true|[yY]*) dflt='y';;
3537 Perl can be built to use the SOCKS proxy protocol library. To do so,
3538 Configure must be run with -Dusesocks. If you use SOCKS you also need
3539 to use the PerlIO abstraction layer, this will be implicitly selected.
3541 If this doesn't make any sense to you, just accept the default '$dflt'.
3543 rp='Build Perl for SOCKS?'
3546 y|Y) val="$define" ;;
3553 $define|true|[yY]*) useperlio="$define";;
3556 case "$useperlio" in
3557 $define|true|[yY]*|'') dflt='y';;
3562 Previous version of $package used the standard IO mechanisms as
3563 defined in <stdio.h>. Versions 5.003_02 and later of $package allow
3564 alternate IO mechanisms via the PerlIO abstraction layer, but the
3565 stdio mechanism is still available if needed. The abstraction layer
3566 can use AT&T's sfio (if you already have sfio installed) or regular stdio.
3567 Using PerlIO with sfio may cause problems with some extension modules.
3569 If this doesn't make any sense to you, just accept the default '$dflt'.
3571 rp='Use the PerlIO abstraction layer?'
3578 echo "Ok, doing things the stdio way."
3587 case "$useperlio" in
3588 $define|true|[yY]*) ;;
3591 You are using the SOCKS proxy protocol library which means that you
3592 should also use the PerlIO layer. You may be headed for trouble.
3601 case "$usethreads" in
3602 $define|true|[yY]*) dflt='y';;
3603 *) # Catch case where user specified ithreads or 5005threads but
3604 # forgot -Dusethreads (A.D. 4/2002)
3605 case "$useithreads$use5005threads" in
3607 case "$useperlio" in
3608 "$define") dflt='y' ;;
3618 Perl can be built to take advantage of threads on some systems.
3619 To do so, Configure can be run with -Dusethreads.
3621 Note that Perl built with threading support runs slightly slower
3622 and uses more memory than plain Perl. The current implementation
3623 is believed to be stable, but it is fairly new, and so should be
3624 treated with caution.
3626 If this doesn't make any sense to you, just accept the default '$dflt'.
3628 rp='Build a threading Perl?'
3631 y|Y) val="$define" ;;
3637 case "$usethreads" in
3641 Since release 5.6, Perl has had two different threading implementations,
3642 the newer interpreter-based version (ithreads) with one interpreter per
3643 thread, and the older 5.005 version (5005threads).
3644 The 5005threads version is effectively unmaintained and will probably be
3645 removed in Perl 5.10, so there should be no need to build a Perl using it
3646 unless needed for backwards compatibility with some existing 5.005threads
3650 : Default to ithreads unless overridden on command line or with
3653 case "$use5005threads" in
3654 $define|true|[yY]*) dflt='n';;
3656 case "$useithreads" in
3657 $undef|false|[nN]*) dflt='n';;
3659 rp='Use the newer interpreter-based ithreads?'
3662 y|Y) val="$define" ;;
3667 : Now set use5005threads to the opposite value.
3668 case "$useithreads" in
3669 $define) val="$undef" ;;
3676 useithreads="$undef"
3677 use5005threads="$undef"
3681 case "$useithreads$use5005threads" in
3685 You cannot have both the ithreads and the 5.005 threads enabled
3686 at the same time. Disabling the 5.005 threads since they are
3687 much less stable than the ithreads.
3690 use5005threads="$undef"
3694 if test X"$usethreads" = "X$define" -a "X$useperlio" = "Xundef"; then
3697 *** To build with ithreads you must also use the PerlIO layer.
3698 *** Cannot continue, aborting.
3704 case "$d_oldpthreads" in
3705 '') : Configure tests would be welcome here. For now, assume undef.
3707 *) val="$d_oldpthreads" ;;
3713 : Look for a hint-file generated 'call-back-unit'. If the
3714 : user has specified that a threading perl is to be built,
3715 : we may need to set or change some other defaults.
3716 if $test -f usethreads.cbu; then
3717 echo "Your platform has some specific hints regarding threaded builds, using them..."
3720 case "$usethreads" in
3721 "$define"|true|[yY]*)
3723 (Your platform does not have any specific hints for threaded builds.
3724 Assuming POSIX threads, then.)
3732 Perl can be built so that multiple Perl interpreters can coexist
3733 within the same Perl executable.
3736 case "$useithreads" in
3739 This multiple interpreter support is required for interpreter-based threads.
3743 *) case "$usemultiplicity" in
3744 $define|true|[yY]*) dflt='y';;
3748 echo "If this doesn't make any sense to you, just accept the default '$dflt'."
3749 rp='Build Perl for multiplicity?'
3752 y|Y) val="$define" ;;
3761 case "$usemorebits" in
3762 "$define"|true|[yY]*)
3763 use64bitint="$define"
3764 uselongdouble="$define"
3765 usemorebits="$define"
3767 *) usemorebits="$undef"
3771 : make some quick guesses about what we are up against
3773 $echo $n "Hmm... $c"
3783 $cat /usr/include/signal.h /usr/include/sys/signal.h >foo 2>/dev/null
3784 if test -f /osf_boot || $contains 'OSF/1' /usr/include/ctype.h >/dev/null 2>&1
3786 echo "Looks kind of like an OSF/1 system, but we'll see..."
3788 elif test `echo abc | $tr a-z A-Z` = Abc ; then
3789 xxx=`./loc addbib blurfl $pth`
3790 if $test -f $xxx; then
3791 echo "Looks kind of like a USG system with BSD features, but we'll see..."
3795 if $contains SIGTSTP foo >/dev/null 2>&1 ; then
3796 echo "Looks kind of like an extended USG system, but we'll see..."
3798 echo "Looks kind of like a USG system, but we'll see..."
3802 elif $contains SIGTSTP foo >/dev/null 2>&1 ; then
3803 echo "Looks kind of like a BSD system, but we'll see..."
3807 echo "Looks kind of like a Version 7 system, but we'll see..."
3810 case "$eunicefix" in
3813 There is, however, a strange, musty smell in the air that reminds me of
3814 something...hmm...yes...I've got it...there's a VMS nearby, or I'm a Blit.
3818 : it so happens the Eunice I know will not run shell scripts in Unix format
3822 echo "Congratulations. You aren't running Eunice."
3826 : Detect OS2. The p_ variable is set above in the Head.U unit.
3827 : Note that this also -- wrongly -- detects e.g. dos-djgpp, which also uses
3828 : semicolon as a patch separator
3833 I have the feeling something is not exactly right, however...don't tell me...
3834 lemme think...does HAL ring a bell?...no, of course, you're only running OS/2!
3835 (Or you may be running DOS with DJGPP.)
3840 if test -f /xenix; then
3841 echo "Actually, this looks more like a XENIX system..."
3846 echo "It's not Xenix..."
3851 if test -f /venix; then
3852 echo "Actually, this looks more like a VENIX system..."
3859 echo "Nor is it Venix..."
3862 chmod +x bsd usg v7 osf1 eunice xenix venix os2
3863 $eunicefix bsd usg v7 osf1 eunice xenix venix os2
3870 rp="Use which C compiler?"
3874 : See if they have not cc but they do have gcc
3876 : Look for a hint-file generated 'call-back-unit'. Now that the
3877 : user has specified the compiler, we may need to set or change some
3879 if $test -f cc.cbu; then
3885 echo "Checking for GNU cc in disguise and/or its version number..." >&4
3891 printf("%s\n", __VERSION__);
3893 printf("%s\n", "1");
3899 if $cc -o try $ccflags $ldflags try.c; then
3900 gccversion=`$run ./try`
3901 case "$gccversion" in
3902 '') echo "You are not using GNU cc." ;;
3903 *) echo "You are using GNU cc $gccversion."
3909 echo "*** WHOA THERE!!! ***" >&4
3910 echo " Your C compiler \"$cc\" doesn't seem to be working!" >&4
3911 case "$knowitall" in
3913 echo " You'd better start hunting for one and let me know about it." >&4
3919 case "$gccversion" in
3920 1*) cpp=`./loc gcc-cpp $cpp $pth` ;;
3922 case "$gccversion" in
3923 '') gccosandvers='' ;;
3924 *) gccshortvers=`echo "$gccversion"|sed 's/ .*//'`
3925 gccosandvers=`$cc -v 2>&1|grep '/specs$'|sed "s!.*/[^-/]*-[^-/]*-\([^-/]*\)/$gccshortvers/specs!\1!"`
3927 case "$gccosandvers" in
3928 $osname) gccosandvers='' ;; # linux gccs seem to have no linux osvers, grr
3929 $osname$osvers) ;; # looking good
3930 $osname*) cat <<EOM >&4
3932 *** WHOA THERE!!! ***
3934 Your gcc has not been compiled for the exact release of
3935 your operating system ($gccosandvers versus $osname$osvers).
3937 In general it is a good idea to keep gcc synchronized with
3938 the operating system because otherwise serious problems
3939 may ensue when trying to compile software, like Perl.
3941 I'm trying to be optimistic here, though, and will continue.
3942 If later during the configuration and build icky compilation
3943 problems appear (headerfile conflicts being the most common
3944 manifestation), I suggest reinstalling the gcc to match
3945 your operating system release.
3949 *) gccosandvers='' ;; # failed to parse, better be silent
3957 # gcc 3.* complain about adding -Idirectories that they already know about,
3958 # so we will take those off from locincpth.
3959 case "$gccversion" in
3961 echo "main(){}">try.c
3962 for incdir in $locincpth; do
3963 warn=`$cc $ccflags -I$incdir -c try.c 2>&1 | \
3964 grep '^c[cp]p*[01]: warning: changing search order '`
3965 if test "X$warn" != X; then
3966 locincpth=`echo " $locincpth " | sed "s! $incdir ! !"`
3972 : decide how portable to be. Allow command line overrides.
3973 case "$d_portable" in
3975 *) d_portable="$define" ;;
3978 : set up shell script to do ~ expansion
3984 echo \$1 | $sed "s|~|\${HOME-\$LOGDIR}|"
3987 if $test -f /bin/csh; then
3988 /bin/csh -f -c "glob \$1"
3993 name=\`$expr x\$1 : '..\([^/]*\)'\`
3994 dir=\`$sed -n -e "/^\${name}:/{s/^[^:]*:[^:]*:[^:]*:[^:]*:[^:]*:\([^:]*\).*"'\$'"/\1/" -e p -e q -e '}' </etc/passwd\`
3995 if $test ! -d "\$dir"; then
3997 echo "\$me: can't locate home directory for: \$name" >&2
4002 echo \$dir/\`$expr x\$1 : '..[^/]*/\(.*\)'\`
4018 : now set up to get a file name
4022 cat <<'EOSC' >>getfile
4038 : getfile will accept an answer from the comma-separated list
4039 : enclosed in parentheses even if it does not meet other criteria.
4040 expr "$fn" : '.*(\(.*\)).*' | $tr ',' $trnl >getfile.ok
4041 fn=`echo $fn | sed 's/(.*)//'`
4047 loc_file=`expr $fn : '.*:\(.*\)'`
4048 fn=`expr $fn : '\(.*\):.*'`
4056 */*) fullpath=true;;
4065 *e*) exp_file=true;;
4068 *p*) nopath_ok=true;;
4073 *d*) type='Directory';;
4074 *l*) type='Locate';;
4079 Locate) what='File';;
4084 case "$d_portable" in
4092 while test "$type"; do
4097 true) rp="$rp (~name ok)";;
4100 if test -f UU/getfile.ok && \
4101 $contains "^$ans\$" UU/getfile.ok >/dev/null 2>&1
4120 value=`UU/filexp $ans`
4123 if test "$ans" != "$value"; then
4124 echo "(That expands to $value on this system.)"
4138 /*) value="$ansexp" ;;
4139 [a-zA-Z]:/*) value="$ansexp" ;;
4144 echo "I shall only accept a full path name, as in /bin/ls." >&4
4145 echo "Use a ! shell escape if you wish to check pathnames." >&4
4148 echo "Please give a full path name, starting with slash." >&4
4151 echo "Note that using ~name is ok provided it expands well." >&4
4164 for fp in $gfpth; do
4165 if test "X$fp" = X.; then
4170 if test -f "$pf"; then
4172 elif test -r "$pf" || (test -h "$pf") >/dev/null 2>&1
4174 echo "($value is not a plain file, but that's ok.)"
4177 if test X"$type" = X; then
4184 for fp in $gfpth; do
4185 if test "X$fp" = X.; then
4190 direxp="$fp/$ansexp"
4192 if test -d "$direxp"; then
4200 if test -d "$ansexp"; then
4201 echo "(Looking for $loc_file in directory $value.)"
4202 value="$value/$loc_file"
4203 ansexp="$ansexp/$loc_file"
4205 if test -f "$ansexp"; then
4208 case "$nopath_ok" in
4209 true) case "$value" in
4211 *) echo "Assuming $value will be in people's path."
4227 if test "$fastread" = yes; then
4232 rp="$what $value doesn't exist. Use that name anyway?"
4251 test "X$gfpthkeep" != Xy && gfpth=""
4254 : What should the include directory be ?
4256 $echo $n "Hmm... $c"
4260 if $test -f /bin/mips && /bin/mips; then
4261 echo "Looks like a MIPS system..."
4262 $cat >usr.c <<'EOCP'
4263 #ifdef SYSTYPE_BSD43
4267 if cc -E usr.c > usr.out && $contains / usr.out >/dev/null 2>&1; then
4268 dflt='/bsd43/usr/include'
4272 mips_type='System V'
4274 $rm -f usr.c usr.out
4275 echo "and you're compiling with the $mips_type compiler and libraries."
4279 echo "Doesn't look like a MIPS system."
4289 case "$xxx_prompt" in
4292 rp='Where are the include files you want to use?'
4300 : see how we invoke the C preprocessor
4302 echo "Now, how can we feed standard input to your C preprocessor..." >&4
4303 cat <<'EOT' >testcpp.c
4309 if test ! -f cppstdin; then
4310 if test "X$osname" = "Xaix" -a "X$gccversion" = X; then
4311 # AIX cc -E doesn't show the absolute headerfile
4312 # locations but we'll cheat by using the -M flag.
4313 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
4315 echo 'cat >.$$.c; '"$cc"' -E ${1+"$@"} .$$.c; rm .$$.c' >cppstdin
4318 echo "Keeping your $hint cppstdin wrapper."
4321 wrapper=`pwd`/cppstdin
4325 if $test "X$cppstdin" != "X" && \
4326 $cppstdin $cppminus <testcpp.c >testcpp.out 2>&1 && \
4327 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
4329 echo "You used to use $cppstdin $cppminus so we'll use that again."
4331 '') echo "But let's see if we can live without a wrapper..." ;;
4333 if $cpprun $cpplast <testcpp.c >testcpp.out 2>&1 && \
4334 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
4336 echo "(And we'll use $cpprun $cpplast to preprocess directly.)"
4339 echo "(However, $cpprun $cpplast does not work, let's see...)"
4347 echo "Good old $cppstdin $cppminus does not seem to be of any help..."
4354 elif echo 'Maybe "'"$cc"' -E" will work...'; \
4355 $cc -E <testcpp.c >testcpp.out 2>&1; \
4356 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4357 echo "Yup, it does."
4360 elif echo 'Nope...maybe "'"$cc"' -E -" will work...'; \
4361 $cc -E - <testcpp.c >testcpp.out 2>&1; \
4362 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4363 echo "Yup, it does."
4366 elif echo 'Nope...maybe "'"$cc"' -P" will work...'; \
4367 $cc -P <testcpp.c >testcpp.out 2>&1; \
4368 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4369 echo "Yipee, that works!"
4372 elif echo 'Nope...maybe "'"$cc"' -P -" will work...'; \
4373 $cc -P - <testcpp.c >testcpp.out 2>&1; \
4374 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4375 echo "At long last!"
4378 elif echo 'No such luck, maybe "'$cpp'" will work...'; \
4379 $cpp <testcpp.c >testcpp.out 2>&1; \
4380 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4384 elif echo 'Nixed again...maybe "'$cpp' -" will work...'; \
4385 $cpp - <testcpp.c >testcpp.out 2>&1; \
4386 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4387 echo "Hooray, it works! I was beginning to wonder."
4390 elif echo 'Uh-uh. Time to get fancy. Trying a wrapper...'; \
4391 $wrapper <testcpp.c >testcpp.out 2>&1; \
4392 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4398 rp="No dice. I can't find a C preprocessor. Name one:"
4402 $x_cpp <testcpp.c >testcpp.out 2>&1
4403 if $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4404 echo "OK, that will do." >&4
4406 echo "Sorry, I can't get that to work. Go find one and rerun Configure." >&4
4421 echo "Perhaps can we force $cc -E using a wrapper..."
4422 if $wrapper <testcpp.c >testcpp.out 2>&1; \
4423 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
4429 echo "Nope, we'll have to live without it..."
4443 "$wrapper"|'cppstdin') ;;
4444 *) $rm -f $wrapper;;
4446 $rm -f testcpp.c testcpp.out
4448 : Set private lib path
4451 plibpth="$incpath/usr/lib /usr/local/lib /usr/ccs/lib"
4456 '') dlist="$loclibpth $plibpth $glibpth";;
4457 *) dlist="$libpth";;
4460 : Now check and see which directories actually exist, avoiding duplicates
4464 if $test -d $xxx; then
4467 *) libpth="$libpth $xxx";;
4473 Some systems have incompatible or broken versions of libraries. Among
4474 the directories listed in the question below, please remove any you
4475 know not to be holding relevant libraries, and add any that are needed.
4476 Say "none" for none.
4487 rp="Directories to use for library searches?"
4494 : compute shared library extension
4497 if xxx=`./loc libc.sl X $libpth`; $test -f "$xxx"; then
4507 On some systems, shared libraries may be available. Answer 'none' if
4508 you want to suppress searching of shared libraries for the remainder
4509 of this configuration.
4512 rp='What is the file extension used for shared libraries?'
4516 : Define several unixisms.
4517 : Hints files or command line option can be used to override them.
4518 : The convoluted testing is in case hints files set either the old
4521 '') case "$exe_ext" in
4523 *) _exe="$exe_ext" ;;
4528 '') case "$lib_ext" in
4535 '') case "$obj_ext" in
4542 '') case "$path_sep" in
4553 : Which makefile gets called first. This is used by make depend.
4554 case "$firstmakefile" in
4555 '') firstmakefile='makefile';;
4559 *-DUSE_LONG_DOUBLE*|*-DUSE_MORE_BITS*) uselongdouble="$define" ;;
4562 case "$uselongdouble" in
4563 $define|true|[yY]*) dflt='y';;
4568 Perl can be built to take advantage of long doubles which
4569 (if available) may give more accuracy and range for floating point numbers.
4571 If this doesn't make any sense to you, just accept the default '$dflt'.
4573 rp='Try to use long doubles if available?'
4576 y|Y) val="$define" ;;
4582 case "$uselongdouble" in
4583 true|[yY]*) uselongdouble="$define" ;;
4586 : Look for a hint-file generated 'call-back-unit'. If the
4587 : user has specified that long doubles should be used,
4588 : we may need to set or change some other defaults.
4589 if $test -f uselongdouble.cbu; then
4590 echo "Your platform has some specific hints regarding long doubles, using them..."
4591 . ./uselongdouble.cbu
4593 case "$uselongdouble" in
4596 (Your platform does not have any specific hints for long doubles.)
4602 : Looking for optional libraries
4604 echo "Checking for optional libraries..." >&4
4609 case "$libswanted" in
4610 '') libswanted='c_s';;
4613 "$define") libswanted="$libswanted socks5 socks5_sh" ;;
4619 for thisdir in $libpth $xlibpth; do
4620 test -d $thisdir && libspath="$libspath $thisdir"
4622 for thislib in $libswanted; do
4623 for thisdir in $libspath; do
4625 if $test ! -f "$xxx" -a "X$ignore_versioned_solibs" = "X"; then
4626 xxx=`ls $thisdir/lib$thislib.$so.[0-9] 2>/dev/null|sed -n '$p'`
4627 $test -f "$xxx" && eval $libscheck
4628 $test -f "$xxx" && libstyle=shared
4630 if test ! -f "$xxx"; then
4631 xxx=$thisdir/lib$thislib.$so
4632 $test -f "$xxx" && eval $libscheck
4633 $test -f "$xxx" && libstyle=shared
4635 if test ! -f "$xxx"; then
4636 xxx=$thisdir/lib$thislib$_a
4637 $test -f "$xxx" && eval $libscheck
4638 $test -f "$xxx" && libstyle=static
4640 if test ! -f "$xxx"; then
4641 xxx=$thisdir/$thislib$_a
4642 $test -f "$xxx" && eval $libscheck
4643 $test -f "$xxx" && libstyle=static
4645 if test ! -f "$xxx"; then
4646 xxx=$thisdir/lib${thislib}_s$_a
4647 $test -f "$xxx" && eval $libscheck
4648 $test -f "$xxx" && libstyle=static
4649 $test -f "$xxx" && thislib=${thislib}_s
4651 if test ! -f "$xxx"; then
4652 xxx=$thisdir/Slib$thislib$_a
4653 $test -f "$xxx" && eval $libscheck
4654 $test -f "$xxx" && libstyle=static
4656 if $test -f "$xxx"; then
4658 shared) echo "Found -l$thislib (shared)." ;;
4659 static) echo "Found -l$thislib." ;;
4660 *) echo "Found -l$thislib ($libstyle)." ;;
4664 *) dflt="$dflt -l$thislib"
4665 libsfound="$libsfound $xxx"
4667 libsfiles="$libsfiles $yyy"
4668 yyy=`echo $xxx|$sed -e "s%/$yyy\\$%%"`
4669 case " $libsdirs " in
4671 *) libsdirs="$libsdirs $yyy" ;;
4678 if $test ! -f "$xxx"; then
4679 echo "No -l$thislib."
4690 ' '|'') dflt='none';;
4695 In order to compile $package on your machine, a number of libraries
4696 are usually needed. Include any other special libraries here as well.
4697 Say "none" for none. The default list is almost always right.
4701 rp="What libraries to use?"
4708 : determine optimization, if desired, or use for debug flag also
4710 ' '|$undef) dflt='none';;
4712 *) dflt="$optimize";;
4716 By default, $package compiles with the -O flag to use the optimizer.
4717 Alternately, you might want to use the symbolic debugger, which uses
4718 the -g flag (on traditional Unix systems). Either flag can be
4719 specified here. To use neither flag, specify the word "none".
4722 rp="What optimizer/debugger flag should be used?"
4726 'none') optimize=" ";;
4730 : We will not override a previous value, but we might want to
4731 : augment a hint file
4733 default|recommended)
4734 case "$gccversion" in
4735 1*) dflt='-fpcc-struct-return' ;;
4738 *-g*) dflt="$dflt -DDEBUGGING";;
4740 case "$gccversion" in
4741 2*) if test -d /etc/conf/kconfig.d &&
4742 $contains _POSIX_VERSION $usrinc/sys/unistd.h >/dev/null 2>&1
4744 # Interactive Systems (ISC) POSIX mode.
4749 case "$gccversion" in
4753 echo "Checking if your compiler accepts -fno-strict-aliasing" 2>&1
4754 echo 'int main(void) { return 0; }' > gcctest.c
4755 if $cc -O2 -fno-strict-aliasing -o gcctest gcctest.c; then
4756 echo "Yes, it does." 2>&1
4759 echo "Leaving current flags $ccflags alone." 2>&1
4761 *) dflt="$dflt -fno-strict-aliasing" ;;
4764 echo "Nope, it doesn't, but that's ok." 2>&1
4768 # For gcc, adding -pipe speeds up compilations for some, but apparently
4769 # some assemblers can't read from stdin. (It also slows down compilations
4770 # in other cases, but those are apparently rarer these days.) AD 5/2004.
4771 case "$gccversion" in
4773 echo "Checking if your compiler accepts -pipe" 2>&1
4774 echo 'int main(void) { return 0; }' > gcctest.c
4775 if $cc -pipe -o gcctest gcctest.c; then
4776 echo "Yes, it does." 2>&1
4779 echo "Leaving current flags $ccflags alone." 2>&1
4781 *) dflt="$dflt -pipe" ;;
4784 echo "Nope, it doesn't, but that's ok." 2>&1
4787 echo "Checking if your compiler accepts -Wdeclaration-after-statement" 2>&1
4788 echo 'int main(void) { return 0; }' > gcctest.c
4789 if $cc -Wdeclaration-after-statement -o gcctest gcctest.c; then
4790 echo "Yes, it does." 2>&1
4792 *-Wdeclaration-after-statement*)
4793 echo "Leaving current flags $ccflags alone." 2>&1
4795 *) dflt="$dflt -Wdeclaration-after-statement" ;;
4798 echo "Nope, it doesn't, but that's ok." 2>&1
4805 case "$mips_type" in
4806 *BSD*|'') inclwanted="$locincpth $usrinc";;
4807 *) inclwanted="$locincpth $inclwanted $usrinc/bsd";;
4809 for thisincl in $inclwanted; do
4810 if $test -d $thisincl; then
4811 if $test x$thisincl != x$usrinc; then
4813 *" -I$thisincl "*);;
4814 *) dflt="$dflt -I$thisincl ";;
4820 inctest='if $contains $2 $usrinc/$1 >/dev/null 2>&1; then
4822 elif $contains $2 $usrinc/sys/$1 >/dev/null 2>&1; then
4830 *) dflt="$dflt -D$2";;
4834 set signal.h LANGUAGE_C; eval $inctest
4838 ccflags="$ccflags -DSOCKS"
4843 default|recommended) dflt="$ccflags $dflt" ;;
4844 *) dflt="$ccflags";;
4853 Your C compiler may want other flags. For this question you should include
4854 -I/whatever and -DWHATEVER flags and any other flags used by the C compiler,
4855 but you should NOT include libraries or ld flags like -lwhatever. If you
4856 want $package to honor its debug switch, you should include -DDEBUGGING here.
4857 Your C compiler might also need additional flags, such as -D_POSIX_SOURCE.
4859 To use no flags, specify the word "none".
4865 rp="Any additional cc flags?"
4872 : the following weeds options from ccflags that are of no interest to cpp
4874 '') cppflags="$ccflags" ;;
4875 *) cppflags="$cppflags $ccflags" ;;
4877 case "$gccversion" in
4878 1*) cppflags="$cppflags -D__GNUC__"
4880 case "$mips_type" in
4882 *BSD*) cppflags="$cppflags -DSYSTYPE_BSD43";;
4888 echo "Let me guess what the preprocessor flags are..." >&4
4902 *) ftry="$previous $flag";;
4904 if $cppstdin -DLFRULB=bar $cppflags $ftry $cppminus <cpp.c \
4905 >cpp1.out 2>/dev/null && \
4906 $cpprun -DLFRULB=bar $cppflags $ftry $cpplast <cpp.c \
4907 >cpp2.out 2>/dev/null && \
4908 $contains 'foo.*xx.*bar' cpp1.out >/dev/null 2>&1 && \
4909 $contains 'foo.*xx.*bar' cpp2.out >/dev/null 2>&1
4911 cppflags="$cppflags $ftry"
4921 *-*) echo "They appear to be: $cppflags";;
4923 $rm -f cpp.c cpp?.out
4927 : flags used in final linking phase
4929 '') if ./venix; then
4935 *-posix*) dflt="$dflt -posix" ;;
4938 *) dflt="$ldflags";;
4941 : Try to guess additional flags to pick up local libraries.
4942 for thislibdir in $libpth; do
4943 case " $loclibpth " in
4946 *"-L$thislibdir "*) ;;
4947 *) dflt="$dflt -L$thislibdir" ;;
4959 Your C linker may need flags. For this question you should
4960 include -L/whatever and any other flags used by the C linker, but you
4961 should NOT include libraries like -lwhatever.
4963 Make sure you include the appropriate -L/path flags if your C linker
4964 does not normally search all of the directories you specified above,
4967 To use no flags, specify the word "none".
4971 rp="Any additional ld flags (NOT including libraries)?"
4977 rmlist="$rmlist pdp11"
4981 echo "Checking your choice of C compiler and flags for coherency..." >&4
4982 $cat > try.c <<'EOF'
4984 int main() { printf("Ok\n"); return(0); }
4986 set X $cc -o try $optimize $ccflags $ldflags try.c $libs
4988 $cat >try.msg <<'EOM'
4989 I've tried to compile and run the following simple program:
4992 $cat try.c >> try.msg
4994 $cat >> try.msg <<EOM
5001 and I got the following output:
5005 if $sh -c "$cc -o try $optimize $ccflags $ldflags try.c $libs" >>try.msg 2>&1; then
5006 if $sh -c "$run ./try" >>try.msg 2>&1; then
5010 *) echo 'The program compiled OK, but produced no output.' >> try.msg
5013 cat >> try.msg <<'EOQS'
5014 If $libs contains -lsfio, and sfio is mis-configured, then it
5015 sometimes (apparently) runs and exits with a 0 status, but with no
5016 output! It may have to do with sfio's use of _exit vs. exit.
5019 rp="You have a big problem. Shall I abort Configure"
5026 echo "The program compiled OK, but exited with status $?." >>try.msg
5027 rp="You have a problem. Shall I abort Configure"
5031 echo "I can't compile the test program." >>try.msg
5032 rp="You have a BIG problem. Shall I abort Configure"
5038 case "$knowitall" in
5040 echo "(The supplied flags or libraries might be incorrect.)"
5048 *) echo "Ok. Stopping Configure." >&4
5053 n) echo "OK, that should do.";;
5055 $rm -f try try.* core
5057 : define a shorthand compile call
5061 $cc -o ${mc_file} $optimize $ccflags $ldflags $* ${mc_file}.c $libs > /dev/null 2>&1;'
5062 : define a shorthand compile call for compilations that should be ok.
5066 $cc -o ${mc_file} $optimize $ccflags $ldflags $* ${mc_file}.c $libs;'
5068 : determine filename position in cpp output
5070 echo "Computing filename position in cpp output for #include directives..." >&4
5072 vos) testaccess=-e ;;
5075 echo '#include <stdio.h>' > foo.c
5078 $cppstdin $cppflags $cppminus <foo.c 2>/dev/null | \
5079 $grep '^[ ]*#.*stdio\.h' | \
5080 while read cline; do
5083 while $test \$# -gt 0; do
5084 if $test $testaccess \`echo \$1 | $tr -d '"'\`; then
5089 pos=\`expr \$pos + 1\`
5101 *) pos="${fieldn}th";;
5103 echo "Your cpp writes the filename in the $pos field of the line."
5106 vos) cppfilter="tr '\\\\>' '/' |" ;; # path component separator is >
5107 os2) cppfilter="sed -e 's|\\\\\\\\|/|g' |" ;; # path component separator is \
5110 : locate header file
5115 for usrincdir in $usrinc
5117 if test -f \$usrincdir/\$wanted; then
5118 echo "\$usrincdir/\$wanted"
5122 awkprg='{ print \$$fieldn }'
5123 echo "#include <\$wanted>" > foo\$\$.c
5124 $cppstdin $cppminus $cppflags < foo\$\$.c 2>/dev/null | \
5125 $cppfilter $grep "^[ ]*#.*\$wanted" | \
5126 while read cline; do
5127 name=\`echo \$cline | $awk "\$awkprg" | $tr -d '"'\`
5129 *[/\\\\]\$wanted) echo "\$name"; exit 1;;
5130 *[\\\\/]\$wanted) echo "\$name"; exit 1;;
5135 # status = 0: grep returned 0 lines, case statement not executed
5136 # status = 1: headerfile found
5137 # status = 2: while loop executed, no headerfile found
5141 if test \$status -eq 1; then
5148 : define an alternate in-header-list? function
5149 inhdr='echo " "; td=$define; tu=$undef; yyy=$@;
5150 cont=true; xxf="echo \"<\$1> found.\" >&4";
5151 case $# in 2) xxnf="echo \"<\$1> NOT found.\" >&4";;
5152 *) xxnf="echo \"<\$1> NOT found, ...\" >&4";;
5154 case $# in 4) instead=instead;; *) instead="at last";; esac;
5155 while $test "$cont"; do
5157 var=$2; eval "was=\$$2";
5158 if $test "$xxx" && $test -r "$xxx";
5160 eval "case \"\$$var\" in $undef) . ./whoa; esac"; eval "$var=\$td";
5163 eval "case \"\$$var\" in $define) . ./whoa; esac"; eval "$var=\$tu"; fi;
5164 set $yyy; shift; shift; yyy=$@;
5165 case $# in 0) cont="";;
5166 2) xxf="echo \"but I found <\$1> $instead.\" >&4";
5167 xxnf="echo \"and I did not find <\$1> either.\" >&4";;
5168 *) xxf="echo \"but I found <\$1\> instead.\" >&4";
5169 xxnf="echo \"there is no <\$1>, ...\" >&4";;
5173 do set $yyy; var=$2; eval "was=\$$2";
5174 eval "case \"\$$var\" in $define) . ./whoa; esac"; eval "$var=\$tu";
5175 set $yyy; shift; shift; yyy=$@;
5178 : see if stdlib is available
5179 set stdlib.h i_stdlib
5182 : check for lengths of integral types
5186 echo "Checking to see how big your integers are..." >&4
5195 printf("intsize=%d;\n", (int)sizeof(int));
5196 printf("longsize=%d;\n", (int)sizeof(long));
5197 printf("shortsize=%d;\n", (int)sizeof(short));
5202 if eval $compile_ok && $run ./try > /dev/null; then
5204 echo "Your integers are $intsize bytes long."
5205 echo "Your long integers are $longsize bytes long."
5206 echo "Your short integers are $shortsize bytes long."
5210 Help! I can't compile and run the intsize test program: please enlighten me!
5211 (This is probably a misconfiguration in your system or libraries, and
5212 you really ought to fix it. Still, I'll try anyway.)
5216 rp="What is the size of an integer (in bytes)?"
5220 rp="What is the size of a long integer (in bytes)?"
5224 rp="What is the size of a short integer (in bytes)?"
5232 : check for long long
5234 echo "Checking to see if you have long long..." >&4
5235 echo 'int main() { long long x = 7; return 0; }' > try.c
5237 if eval $compile; then
5239 echo "You have long long."
5242 echo "You do not have long long."
5248 : check for length of long long
5249 case "${d_longlong}${longlongsize}" in
5252 echo "Checking to see how big your long longs are..." >&4
5253 $cat >try.c <<'EOCP'
5257 printf("%d\n", (int)sizeof(long long));
5262 if eval $compile_ok; then
5263 longlongsize=`$run ./try`
5264 echo "Your long longs are $longlongsize bytes long."
5268 echo "(I can't seem to compile the test program. Guessing...)"
5269 rp="What is the size of a long long (in bytes)?"
5273 if $test "X$longsize" = "X$longlongsize"; then
5274 echo "(That isn't any different from an ordinary long.)"
5280 : see if inttypes.h is available
5281 : we want a real compile instead of Inhdr because some systems
5282 : have an inttypes.h which includes non-existent headers
5285 #include <inttypes.h>
5287 static int32_t foo32 = 0x12345678;
5291 if eval $compile; then
5292 echo "<inttypes.h> found." >&4
5295 echo "<inttypes.h> NOT found." >&4
5304 echo "Checking to see if you have int64_t..." >&4
5306 #include <sys/types.h>
5307 #$i_inttypes I_INTTYPES
5309 #include <inttypes.h>
5311 int main() { int64_t x = 7; }
5314 if eval $compile; then
5316 echo "You have int64_t."
5319 echo "You do not have int64_t."
5327 echo "Checking which 64-bit integer type we could use..." >&4
5333 val='"unsigned int"'
5338 *) case "$longsize" in
5342 val='"unsigned long"'
5347 *) case "$d_longlong:$longlongsize" in
5352 val='"unsigned long long"'
5357 *) case "$d_int64_t" in
5376 '') echo "Alas, no 64-bit integer types in sight." >&4
5379 *) echo "We could use '$quadtype' for 64-bit integers." >&4
5385 case "$uselonglong" in
5386 "$define"|true|[yY]*)
5389 *** Configure -Duselonglong is deprecated, using -Duse64bitint instead.
5391 use64bitint="$define"
5394 case "$use64bits" in
5395 "$define"|true|[yY]*)
5398 *** Configure -Duse64bits is deprecated, using -Duse64bitint instead.
5400 use64bitint="$define"
5403 case "$use64bitints" in
5404 "$define"|true|[yY]*)
5407 *** There is no Configure -Duse64bitints, using -Duse64bitint instead.
5409 use64bitint="$define"
5412 case "$use64bitsint" in
5413 "$define"|true|[yY]*)
5416 *** There is no Configure -Duse64bitsint, using -Duse64bitint instead.
5418 use64bitint="$define"
5421 case "$uselonglongs" in
5422 "$define"|true|[yY]*)
5425 *** There is no Configure -Duselonglongs, using -Duse64bitint instead.
5427 use64bitint="$define"
5430 case "$use64bitsall" in
5431 "$define"|true|[yY]*)
5434 *** There is no Configure -Duse64bitsall, using -Duse64bitall instead.
5436 use64bitall="$define"
5441 *-DUSE_LONG_LONG*|*-DUSE_64_BIT_INT*|*-DUSE_64_BIT_ALL*) use64bitint="$define";;
5443 case "$use64bitall" in
5444 "$define"|true|[yY]*) use64bitint="$define" ;;
5450 You have natively 64-bit long integers.
5454 *) case "$use64bitint" in
5455 "$define"|true|[yY]*) dflt='y';;
5464 Perl can be built to take advantage of 64-bit integer types
5465 on some systems. To do so, Configure can be run with -Duse64bitint.
5466 Choosing this option will most probably introduce binary incompatibilities.
5468 If this doesn't make any sense to you, just accept the default '$dflt'.
5469 (The default has been chosen based on your configuration.)
5471 rp='Try to use 64-bit integers, if available?'
5474 [yY]*) val="$define" ;;
5482 case "$use64bitall" in
5483 "$define"|true|[yY]*) dflt='y' ;;
5484 *) case "$longsize" in
5492 You may also choose to try maximal 64-bitness. It means using as much
5493 64-bitness as possible on the platform. This in turn means even more
5494 binary incompatibilities. On the other hand, your platform may not
5495 have any more 64-bitness available than what you already have chosen.
5497 If this doesn't make any sense to you, just accept the default '$dflt'.
5498 (The default has been chosen based on your configuration.)
5500 rp='Try to use maximal 64-bit support, if available?'
5503 [yY]*) val="$define" ;;
5508 case "$use64bitall" in
5510 case "$use64bitint" in
5514 Since you have chosen a maximally 64-bit build, I'm also turning on
5515 the use of 64-bit integers.
5517 use64bitint="$define" ;;
5522 : Look for a hint-file generated 'call-back-unit'. If the
5523 : user has specified that a 64-bit perl is to be built,
5524 : we may need to set or change some other defaults.
5525 if $test -f use64bitint.cbu; then
5526 echo "Your platform has some specific hints regarding 64-bit integers, using them..."
5529 case "$use64bitint" in
5530 "$define"|true|[yY]*)
5532 4) case "$archname64" in
5533 '') archname64=64int ;;
5540 : Look for a hint-file generated 'call-back-unit'. If the
5541 : user has specified that a maximally 64-bit perl is to be built,
5542 : we may need to set or change some other defaults.
5543 if $test -f use64bitall.cbu; then
5544 echo "Your platform has some specific hints regarding 64-bit builds, using them..."
5547 case "$use64bitall" in
5548 "$define"|true|[yY]*)
5550 4) case "$archname64" in
5551 ''|64int) archname64=64all ;;
5558 case "$d_quad:$use64bitint" in
5562 *** You have chosen to use 64-bit integers,
5563 *** but none can be found.
5564 *** Please rerun Configure without -Duse64bitint and/or -Dusemorebits.
5565 *** Cannot continue, aborting.
5572 : check for length of double
5574 case "$doublesize" in
5576 echo "Checking to see how big your double precision numbers are..." >&4
5585 printf("%d\n", (int)sizeof(double));
5590 if eval $compile_ok; then
5591 doublesize=`$run ./try`
5592 echo "Your double is $doublesize bytes long."
5595 echo "(I can't seem to compile the test program. Guessing...)"
5596 rp="What is the size of a double precision number (in bytes)?"
5604 : check for long doubles
5606 echo "Checking to see if you have long double..." >&4
5607 echo 'int main() { long double x = 7.0; }' > try.c
5609 if eval $compile; then
5611 echo "You have long double."
5614 echo "You do not have long double."
5620 : check for length of long double
5621 case "${d_longdbl}${longdblsize}" in
5624 echo "Checking to see how big your long doubles are..." >&4
5625 $cat >try.c <<'EOCP'
5629 printf("%d\n", sizeof(long double));
5634 if eval $compile; then
5635 longdblsize=`$run ./try`
5636 echo "Your long doubles are $longdblsize bytes long."
5640 echo "(I can't seem to compile the test program. Guessing...)" >&4
5641 rp="What is the size of a long double (in bytes)?"
5645 if $test "X$doublesize" = "X$longdblsize"; then
5646 echo "That isn't any different from an ordinary double."
5647 echo "I'll keep your setting anyway, but you may see some"
5648 echo "harmless compilation warnings."
5654 : determine the architecture name
5656 if xxx=`./loc arch blurfl $pth`; $test -f "$xxx"; then
5657 tarch=`arch`"-$osname"
5658 elif xxx=`./loc uname blurfl $pth`; $test -f "$xxx" ; then
5659 if uname -m > tmparch 2>&1 ; then
5660 tarch=`$sed -e 's/ *$//' -e 's/ /_/g' \
5661 -e 's/$/'"-$osname/" tmparch`
5669 case "$myarchname" in
5672 echo "(Your architecture name used to be $myarchname.)"
5676 case "$targetarch" in
5678 *) archname=`echo $targetarch|sed 's,^[^-]*-,,'` ;;
5683 *) dflt="$archname";;
5685 rp='What is your architecture name'
5688 case "$usethreads" in
5690 echo "Threads selected." >&4
5692 *-thread*) echo "...and architecture name already has -thread." >&4
5694 *) archname="$archname-thread"
5695 echo "...setting architecture name to $archname." >&4
5700 case "$usemultiplicity" in
5702 echo "Multiplicity selected." >&4
5704 *-multi*) echo "...and architecture name already has -multi." >&4
5706 *) archname="$archname-multi"
5707 echo "...setting architecture name to $archname." >&4
5712 case "$use64bitint$use64bitall" in
5714 case "$archname64" in
5716 echo "This architecture is naturally 64-bit, not changing architecture name." >&4
5719 case "$use64bitint" in
5720 "$define") echo "64 bit integers selected." >&4 ;;
5722 case "$use64bitall" in
5723 "$define") echo "Maximal 64 bitness selected." >&4 ;;
5726 *-$archname64*) echo "...and architecture name already has $archname64." >&4
5728 *) archname="$archname-$archname64"
5729 echo "...setting architecture name to $archname." >&4
5735 case "$uselongdouble" in
5737 echo "Long doubles selected." >&4
5738 case "$longdblsize" in
5740 echo "...but long doubles are equal to doubles, not changing architecture name." >&4
5744 *-ld*) echo "...and architecture name already has -ld." >&4
5746 *) archname="$archname-ld"
5747 echo "...setting architecture name to $archname." >&4
5754 case "$useperlio" in
5756 echo "Perlio selected." >&4
5759 echo "Perlio not selected, using stdio." >&4
5761 *-stdio*) echo "...and architecture name already has -stdio." >&4
5763 *) archname="$archname-stdio"
5764 echo "...setting architecture name to $archname." >&4
5769 if $test -f archname.cbu; then
5770 echo "Your platform has some specific hints for architecture name, using them..."
5774 : determine root of directory hierarchy where package will be installed.
5777 dflt=`./loc . /usr/local /usr/local /local /opt /usr`
5780 dflt=`echo "$prefix" | sed 's/.$//'`
5788 By default, $package will be installed in $dflt/bin, manual pages
5789 under $dflt/man, etc..., i.e. with $dflt as prefix for all
5790 installation directories. Typically this is something like /usr/local.
5791 If you wish to have binaries under /usr/bin but other parts of the
5792 installation under /usr/local, that's ok: you will be prompted
5793 separately for each of the installation directories, the prefix being
5794 only used to set the defaults.
5798 rp='Installation prefix to use?'
5806 *) oldprefix="$prefix";;
5815 *) afsroot=$afsroot ;;
5821 $define|true) afs=true ;;
5822 $undef|false) afs=false ;;
5823 *) if test -d $afsroot; then
5831 echo "AFS may be running... I'll be extra cautious then..." >&4
5833 echo "AFS does not seem to be running..." >&4
5836 : determine installation prefix for where package is to be installed.
5840 Since you are running AFS, I need to distinguish the directory in which
5841 files will reside from the directory in which they are installed (and from
5842 which they are presumably copied to the former directory by occult means).
5845 case "$installprefix" in
5846 '') dflt=`echo $prefix | sed 's#^/afs/#/afs/.#'`;;
5847 *) dflt="$installprefix";;
5852 In some special cases, particularly when building $package for distribution,
5853 it is convenient to distinguish the directory in which files should be
5854 installed from the directory ($prefix) in which they will
5855 eventually reside. For most users, these two directories are the same.
5858 case "$installprefix" in
5860 *) dflt=$installprefix;;
5864 rp='What installation prefix should I use for installing files?'
5866 installprefix="$ans"
5867 installprefixexp="$ansexp"
5869 : set the prefixit variable, to compute a suitable default value
5870 prefixit='case "$3" in
5872 case "$oldprefix" in
5873 "") eval "$1=\"\$$2\"";;
5880 ""|" ") eval "$1=\"\$$2\"";;
5886 eval "tp=\"$oldprefix-\$$2-\""; eval "tp=\"$tp\"";
5888 --|/*--|\~*--) eval "$1=\"$prefix/$3\"";;
5889 /*-$oldprefix/*|\~*-$oldprefix/*)
5890 eval "$1=\`echo \$$2 | sed \"s,^$oldprefix,$prefix,\"\`";;
5891 *) eval "$1=\"\$$2\"";;
5895 : get the patchlevel
5897 echo "Getting the current patchlevel..." >&4
5898 if $test -r $rsrc/patchlevel.h;then
5899 revision=`awk '/define[ ]+PERL_REVISION/ {print $3}' $rsrc/patchlevel.h`
5900 patchlevel=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
5901 subversion=`awk '/define[ ]+PERL_SUBVERSION/ {print $3}' $rsrc/patchlevel.h`
5902 api_revision=`awk '/define[ ]+PERL_API_REVISION/ {print $3}' $rsrc/patchlevel.h`
5903 api_version=`awk '/define[ ]+PERL_API_VERSION/ {print $3}' $rsrc/patchlevel.h`
5904 api_subversion=`awk '/define[ ]+PERL_API_SUBVERSION/ {print $3}' $rsrc/patchlevel.h`
5905 perl_patchlevel=`egrep 'define PERL_PATCHNUM [0-9][0-9]|,"MAINT[0-9][0-9]*"' $rsrc/patchlevel.h|sed 's/[^0-9]//g'`
5914 $echo "(You do not have patchlevel.h. Eek.)"
5916 if $test -r $rsrc/.patch ; then
5917 if $test "X$perl_patchlevel" = "X" || $test "`cat $rsrc/.patch`" -gt "$perl_patchlevel" ; then
5918 perl_patchlevel=`cat $rsrc/.patch`
5921 : Define a handy string here to avoid duplication in myconfig.SH and configpm.
5922 version_patchlevel_string="version $patchlevel subversion $subversion"
5923 case "$perl_patchlevel" in
5925 *) version_patchlevel_string="$version_patchlevel_string patch $perl_patchlevel" ;;
5928 $echo "(You have $package $version_patchlevel_string.)"
5932 : XXX Should be a Configure test for double-dots in filenames.
5933 version=`echo $revision $patchlevel $subversion | \
5934 $awk '{ printf "%d_%d_%d\n", $1, $2, $3 }'`
5935 api_versionstring=`echo $api_revision $api_version $api_subversion | \
5936 $awk '{ printf "%d_%d_%d\n", $1, $2, $3 }'`
5939 version=`echo $revision $patchlevel $subversion | \
5940 $awk '{ printf "%d.%d.%d\n", $1, $2, $3 }'`
5941 api_versionstring=`echo $api_revision $api_version $api_subversion | \
5942 $awk '{ printf "%d.%d.%d\n", $1, $2, $3 }'`
5945 : Special case the 5.005_xx maintenance series, which used 5.005
5946 : without any subversion label as a subdirectory in $sitelib
5947 if test "${api_revision}${api_version}${api_subversion}" = "550"; then
5948 api_versionstring='5.005'
5951 : determine installation style
5952 : For now, try to deduce it from prefix unless it is already set.
5953 : Reproduce behavior of 5.005 and earlier, maybe drop that in 5.7.
5954 case "$installstyle" in
5955 '') case "$prefix" in
5956 *perl*) dflt='lib';;
5957 *) dflt='lib/perl5' ;;
5960 *) dflt="$installstyle" ;;
5962 : Probably not worth prompting for this since we prompt for all
5963 : the directories individually, and the prompt would be too long and
5967 : determine where private library files go
5968 : Usual default is /usr/local/lib/perl5/$version.
5969 : Also allow things like /opt/perl/lib/$version, since
5970 : /opt/perl/lib/perl5... would be redundant.
5971 : The default "style" setting is made in installstyle.U
5972 case "$installstyle" in
5973 *lib/perl5*) set dflt privlib lib/$package/$version ;;
5974 *) set dflt privlib lib/$version ;;
5979 There are some auxiliary files for $package that need to be put into a
5980 private library directory that is accessible by everyone.
5984 rp='Pathname where the private library files will reside?'
5987 privlibexp="$ansexp"
5988 : Change installation prefix, if necessary.
5989 if $test X"$prefix" != X"$installprefix"; then
5990 installprivlib=`echo $privlibexp | sed "s#^$prefix#$installprefix#"`
5992 installprivlib="$privlibexp"
5995 : set the prefixup variable, to restore leading tilda escape
5996 prefixup='case "$prefixexp" in
5998 *) eval "$1=\`echo \$$1 | sed \"s,^$prefixexp,$prefix,\"\`";;
6001 : determine where public architecture dependent libraries go
6004 : privlib default is /usr/local/lib/$package/$version
6005 : archlib default is /usr/local/lib/$package/$version/$archname
6006 : privlib may have an optional trailing /share.
6007 tdflt=`echo $privlib | $sed 's,/share$,,'`
6008 tdflt=$tdflt/$archname
6017 $spackage contains architecture-dependent library files. If you are
6018 sharing libraries in a heterogeneous environment, you might store
6019 these files in a separate location. Otherwise, you can just include
6020 them with the rest of the public library files.
6024 rp='Where do you want to put the public architecture-dependent libraries?'
6027 archlibexp="$ansexp"
6028 if $test X"$archlib" = X"$privlib"; then
6033 : Change installation prefix, if necessary.
6034 if $test X"$prefix" != X"$installprefix"; then
6035 installarchlib=`echo $archlibexp | sed "s#^$prefix#$installprefix#"`
6037 installarchlib="$archlibexp"
6040 : see if setuid scripts can be secure
6043 Some kernels have a bug that prevents setuid #! scripts from being
6044 secure. Some sites have disabled setuid #! scripts because of this.
6046 First let's decide if your kernel supports secure setuid #! scripts.
6047 (If setuid #! scripts would be secure but have been disabled anyway,
6048 don't say that they are secure if asked.)
6053 if $test -d /dev/fd; then
6054 echo "#!$ls" >reflect
6055 chmod +x,u+s reflect
6056 ./reflect >flect 2>&1
6057 if $contains "/dev/fd" flect >/dev/null; then
6058 echo "Congratulations, your kernel has secure setuid scripts!" >&4
6062 If you are not sure if they are secure, I can check but I'll need a
6063 username and password different from the one you are using right now.
6064 If you don't have such a username or don't want me to test, simply
6068 rp='Other username to test security of setuid scripts with?'
6073 case "$d_suidsafe" in
6074 '') echo "I'll assume setuid scripts are *not* secure." >&4
6077 echo "Well, the $hint value is *not* secure." >&4
6079 *) echo "Well, the $hint value *is* secure." >&4
6084 $rm -f reflect flect
6085 echo "#!$ls" >reflect
6086 chmod +x,u+s reflect
6089 echo '"su" will (probably) prompt you for '"$ans's password."
6090 su $ans -c './reflect >flect'
6091 if $contains "/dev/fd" flect >/dev/null; then
6092 echo "Okay, it looks like setuid scripts are secure." >&4
6095 echo "I don't think setuid scripts are secure." >&4
6100 rp='Does your kernel have *secure* setuid scripts?'
6103 [yY]*) val="$define";;
6108 echo "I don't think setuid scripts are secure (no /dev/fd directory)." >&4
6109 echo "(That's for file descriptors, not floppy disks.)"
6115 $rm -f reflect flect
6117 : now see if they want to do setuid emulation
6120 case "$d_suidsafe" in
6123 echo "No need to emulate SUID scripts since they are secure here." >&4
6127 Some systems have disabled setuid scripts, especially systems where
6128 setuid scripts cannot be secure. On systems where setuid scripts have
6129 been disabled, the setuid/setgid bits on scripts are currently
6130 useless. It is possible for $package to detect those bits and emulate
6131 setuid/setgid in a secure fashion. This emulation will only work if
6132 setuid scripts have been disabled in your kernel.
6136 "$define") dflt=y ;;
6139 rp="Do you want to do setuid/setgid emulation?"
6142 [yY]*) val="$define";;
6150 : see if this is a malloc.h system
6151 : we want a real compile instead of Inhdr because some systems have a
6152 : malloc.h that just gives a compile error saying to use stdlib.h instead
6157 int main () { return 0; }
6160 if eval $compile; then
6161 echo "<malloc.h> found." >&4
6164 echo "<malloc.h> NOT found." >&4
6171 : check for void type
6173 echo "Checking to see how well your C compiler groks the void type..." >&4
6174 case "$voidflags" in
6186 extern void moo(); /* function returning void */
6187 void (*goo)(); /* ptr to func returning void */
6189 void *hue; /* generic ptr */
6202 int main() { sub(); }
6204 if $cc $ccflags -c -DTRY=$defvoidused try.c >.out 2>&1 ; then
6205 voidflags=$defvoidused
6206 echo "Good. It appears to support void to the level $package wants.">&4
6207 if $contains warning .out >/dev/null 2>&1; then
6208 echo "However, you might get some warnings that look like this:"
6212 echo "Hmm, your compiler has some difficulty with void. Checking further..." >&4
6213 if $cc $ccflags -c -DTRY=1 try.c >/dev/null 2>&1; then
6214 echo "It supports 1..."
6215 if $cc $ccflags -c -DTRY=3 try.c >/dev/null 2>&1; then
6216 echo "It also supports 2..."
6217 if $cc $ccflags -c -DTRY=7 try.c >/dev/null 2>&1; then
6219 echo "And it supports 4 but not 8 definitely."
6221 echo "It doesn't support 4..."
6222 if $cc $ccflags -c -DTRY=11 try.c >/dev/null 2>&1; then
6224 echo "But it supports 8."
6227 echo "Neither does it support 8."
6231 echo "It does not support 2..."
6232 if $cc $ccflags -c -DTRY=13 try.c >/dev/null 2>&1; then
6234 echo "But it supports 4 and 8."
6236 if $cc $ccflags -c -DTRY=5 try.c >/dev/null 2>&1; then
6238 echo "And it supports 4 but has not heard about 8."
6240 echo "However it supports 8 but not 4."
6245 echo "There is no support at all for void."
6250 case "$voidflags" in
6253 Support flag bits are:
6254 1: basic void declarations.
6255 2: arrays of pointers to functions returning void.
6256 4: operations between pointers to and addresses of void functions.
6257 8: generic void pointers.
6260 rp="Your void support flags add up to what?"
6267 : check for length of pointer
6271 echo "Checking to see how big your pointers are..." >&4
6272 if test "$voidflags" -gt 7; then
6273 echo '#define VOID_PTR char *' > try.c
6275 echo '#define VOID_PTR void *' > try.c
6285 printf("%d\n", (int)sizeof(VOID_PTR));
6290 if eval $compile_ok; then
6291 ptrsize=`$run ./try`
6292 echo "Your pointers are $ptrsize bytes long."
6295 echo "(I can't seem to compile the test program. Guessing...)" >&4
6296 rp="What is the size of a pointer (in bytes)?"
6303 case "$use64bitall" in
6304 "$define"|true|[yY]*)
6308 *** You have chosen a maximally 64-bit build,
6309 *** but your pointers are only 4 bytes wide.
6310 *** Please rerun Configure without -Duse64bitall.
6315 *** Since you have quads, you could possibly try with -Duse64bitint.
6320 *** Cannot continue, aborting.
6331 : determine whether to use malloc wrapping
6333 case "$usemallocwrap" in
6334 [yY]*|true|$define) dflt='y' ;;
6335 [nN]*|false|$undef) dflt='n' ;;
6336 *) case "$usedevel" in
6337 [yY]*|true|$define) dflt='y' ;;
6342 rp="Do you wish to wrap malloc calls to protect against potential overflows?"
6344 usemallocwrap="$ans"
6347 usemallocwrap="$define" ;;
6349 usemallocwrap="$undef" ;;
6352 : determine which malloc to compile in
6354 case "$usemymalloc" in
6355 [yY]*|true|$define) dflt='y' ;;
6356 [nN]*|false|$undef) dflt='n' ;;
6357 *) case "$ptrsize" in
6363 rp="Do you wish to attempt to use the malloc that comes with $package?"
6369 mallocsrc='malloc.c'
6370 mallocobj="malloc$_o"
6371 d_mymalloc="$define"
6374 : Remove malloc from list of libraries to use
6375 echo "Removing unneeded -lmalloc from library list" >&4
6376 set `echo X $libs | $sed -e 's/-lmalloc / /' -e 's/-lmalloc$//'`
6379 echo "libs = $libs" >&4
6391 : compute the return types of malloc and free
6393 $cat >malloc.c <<END
6397 #include <sys/types.h>
6411 case "$malloctype" in
6413 if $cc $ccflags -c -DTRY_MALLOC malloc.c >/dev/null 2>&1; then
6420 echo "Your system wants malloc to return '$malloctype', it would seem." >&4
6424 if $cc $ccflags -c -DTRY_FREE malloc.c >/dev/null 2>&1; then
6431 echo "Your system uses $freetype free(), it would seem." >&4
6435 After $package is installed, you may wish to install various
6436 add-on modules and utilities. Typically, these add-ons will
6437 be installed under $prefix with the rest
6438 of this package. However, you may wish to install such add-ons
6439 elsewhere under a different prefix.
6441 If you do not wish to put everything under a single prefix, that's
6442 ok. You will be prompted for the individual locations; this siteprefix
6443 is only used to suggest the defaults.
6445 The default should be fine for most people.
6449 rp='Installation prefix to use for add-on modules and utilities?'
6450 : XXX Here might be another good place for an installstyle setting.
6451 case "$siteprefix" in
6453 *) dflt=$siteprefix ;;
6456 : XXX Prefixit unit does not yet support siteprefix and vendorprefix
6458 case "$siteprefix" in
6462 *) oldsiteprefix="$prefix";;
6467 siteprefixexp="$ansexp"
6469 : determine where site specific libraries go.
6470 : Usual default is /usr/local/lib/perl5/site_perl/$version
6471 : The default "style" setting is made in installstyle.U
6472 : XXX No longer works with Prefixit stuff.
6473 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
6475 '') case "$installstyle" in
6476 *lib/perl5*) dflt=$siteprefix/lib/$package/site_$prog/$version ;;
6477 *) dflt=$siteprefix/lib/site_$prog/$version ;;
6485 The installation process will create a directory for
6486 site-specific extensions and modules. Most users find it convenient
6487 to place all site-specific files in this directory rather than in the
6488 main distribution directory.
6492 rp='Pathname for the site-specific library files?'
6495 sitelibexp="$ansexp"
6496 sitelib_stem=`echo "$sitelibexp" | sed "s,/$version$,,"`
6497 : Change installation prefix, if necessary.
6498 if $test X"$prefix" != X"$installprefix"; then
6499 installsitelib=`echo $sitelibexp | $sed "s#^$prefix#$installprefix#"`
6501 installsitelib="$sitelibexp"
6504 : determine where site specific architecture-dependent libraries go.
6505 : sitelib default is /usr/local/lib/perl5/site_perl/$version
6506 : sitearch default is /usr/local/lib/perl5/site_perl/$version/$archname
6507 : sitelib may have an optional trailing /share.
6509 '') dflt=`echo $sitelib | $sed 's,/share$,,'`
6510 dflt="$dflt/$archname"
6515 set sitearch sitearch none
6519 The installation process will also create a directory for
6520 architecture-dependent site-specific extensions and modules.
6524 rp='Pathname for the site-specific architecture-dependent library files?'
6527 sitearchexp="$ansexp"
6528 : Change installation prefix, if necessary.
6529 if $test X"$prefix" != X"$installprefix"; then
6530 installsitearch=`echo $sitearchexp | sed "s#^$prefix#$installprefix#"`
6532 installsitearch="$sitearchexp"
6537 The installation process will also create a directory for
6538 vendor-supplied add-ons. Vendors who supply perl with their system
6539 may find it convenient to place all vendor-supplied files in this
6540 directory rather than in the main distribution directory. This will
6541 ease upgrades between binary-compatible maintenance versions of perl.
6543 Of course you may also use these directories in whatever way you see
6544 fit. For example, you might use them to access modules shared over a
6545 company-wide network.
6547 The default answer should be fine for most people.
6548 This causes further questions about vendor add-ons to be skipped
6549 and no vendor-specific directories will be configured for perl.
6552 rp='Do you want to configure vendor-specific add-on directories?'
6553 case "$usevendorprefix" in
6554 define|true|[yY]*) dflt=y ;;
6555 *) : User may have set vendorprefix directly on Configure command line.
6556 case "$vendorprefix" in
6565 rp='Installation prefix to use for vendor-supplied add-ons?'
6566 case "$vendorprefix" in
6568 *) dflt=$vendorprefix ;;
6571 : XXX Prefixit unit does not yet support siteprefix and vendorprefix
6573 case "$vendorprefix" in
6577 *) oldvendorprefix="$prefix";;
6581 usevendorprefix="$define"
6583 vendorprefixexp="$ansexp"
6585 *) usevendorprefix="$undef"
6591 case "$vendorprefix" in
6592 '') d_vendorlib="$undef"
6596 *) d_vendorlib="$define"
6597 : determine where vendor-supplied modules go.
6598 : Usual default is /usr/local/lib/perl5/vendor_perl/$version
6599 case "$vendorlib" in
6601 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
6602 case "$installstyle" in
6603 *lib/perl5*) dflt=$vendorprefix/lib/$package/vendor_$prog/$version ;;
6604 *) dflt=$vendorprefix/lib/vendor_$prog/$version ;;
6607 *) dflt="$vendorlib"
6611 rp='Pathname for the vendor-supplied library files?'
6614 vendorlibexp="$ansexp"
6617 vendorlib_stem=`echo "$vendorlibexp" | sed "s,/$version$,,"`
6618 : Change installation prefix, if necessary.
6619 if $test X"$prefix" != X"$installprefix"; then
6620 installvendorlib=`echo $vendorlibexp | $sed "s#^$prefix#$installprefix#"`
6622 installvendorlib="$vendorlibexp"
6625 case "$vendorprefix" in
6626 '') d_vendorarch="$undef"
6630 *) d_vendorarch="$define"
6631 : determine where vendor-supplied architecture-dependent libraries go.
6632 : vendorlib default is /usr/local/lib/perl5/vendor_perl/$version
6633 : vendorarch default is /usr/local/lib/perl5/vendor_perl/$version/$archname
6634 : vendorlib may have an optional trailing /share.
6635 case "$vendorarch" in
6636 '') dflt=`echo $vendorlib | $sed 's,/share$,,'`
6637 dflt="$dflt/$archname"
6639 *) dflt="$vendorarch" ;;
6642 rp='Pathname for vendor-supplied architecture-dependent files?'
6645 vendorarchexp="$ansexp"
6648 : Change installation prefix, if necessary.
6649 if $test X"$prefix" != X"$installprefix"; then
6650 installvendorarch=`echo $vendorarchexp | sed "s#^$prefix#$installprefix#"`
6652 installvendorarch="$vendorarchexp"
6655 : Final catch-all directories to search
6658 Lastly, you can have perl look in other directories for extensions and
6659 modules in addition to those already specified.
6660 These directories will be searched after
6664 test X"$vendorlib" != "X" && echo ' ' $vendorlib
6665 test X"$vendorarch" != "X" && echo ' ' $vendorarch
6667 case "$otherlibdirs" in
6668 ''|' ') dflt='none' ;;
6669 *) dflt="$otherlibdirs" ;;
6672 Enter a colon-separated set of extra paths to include in perl's @INC
6673 search path, or enter 'none' for no extra paths.
6677 rp='Colon-separated list of additional directories for perl to search?'
6680 ' '|''|none) otherlibdirs=' ' ;;
6681 *) otherlibdirs="$ans" ;;
6683 case "$otherlibdirs" in
6687 set d_perl_otherlibdirs
6690 : Cruising for prototypes
6692 echo "Checking out function prototypes..." >&4
6693 $cat >prototype.c <<EOCP
6698 int main(int argc, char *argv[]) {
6701 if $cc $ccflags -c prototype.c >prototype.out 2>&1 ; then
6702 echo "Your C compiler appears to support function prototypes."
6705 echo "Your C compiler doesn't seem to understand function prototypes."
6712 case "$prototype" in
6714 *) ansi2knr='ansi2knr'
6719 This version of $package can only be compiled by a compiler that
6720 understands function prototypes. Unfortunately, your C compiler
6722 doesn't seem to understand them. Sorry about that.
6724 If GNU cc is available for your system, perhaps you could try that instead.
6726 Eventually, we hope to support building Perl with pre-ANSI compilers.
6727 If you would like to help in that effort, please contact <perlbug@perl.org>.
6729 Aborting Configure now.
6735 : determine where public executables go
6740 rp='Pathname where the public executables will reside?'
6742 if $test "X$ansexp" != "X$binexp"; then
6747 : Change installation prefix, if necessary.
6748 : XXX Bug? -- ignores Configure -Dinstallprefix setting.
6749 if $test X"$prefix" != X"$installprefix"; then
6750 installbin=`echo $binexp | sed "s#^$prefix#$installprefix#"`
6752 installbin="$binexp"
6761 Perl can be built with extra modules or bundles of modules which
6762 will be fetched from the CPAN and installed alongside Perl.
6764 Notice that you will need access to the CPAN; either via the Internet,
6765 or a local copy, for example a CD-ROM or a local CPAN mirror. (You will
6766 be asked later to configure the CPAN.pm module which will in turn do
6767 the installation of the rest of the extra modules or bundles.)
6769 Notice also that if the modules require any external software such as
6770 libraries and headers (the libz library and the zlib.h header for the
6771 Compress::Zlib module, for example) you MUST have any such software
6772 already installed, this configuration process will NOT install such
6775 If this doesn't make any sense to you, just accept the default '$dflt'.
6777 rp='Install any extra modules (y or n)?'
6783 Please list any extra modules or bundles to be installed from CPAN,
6784 with spaces between the names. The names can be in any format the
6785 'install' command of CPAN.pm will understand. (Answer 'none',
6786 without the quotes, to install no extra modules or bundles.)
6796 $rm -f ../extras.lst
6798 *) echo "(Saving the list of extras for later...)"
6799 echo "$extras" > ../extras.lst
6807 : determine where html pages for programs go
6808 set html1dir html1dir none
6812 If you wish to install html files for programs in $spackage, indicate
6813 the appropriate directory here. To skip installing html files,
6817 ''|none|$undef|' ') dflt=none ;;
6818 *) dflt=$html1dir ;;
6821 rp="Directory for the main $spackage html pages?"
6824 html1direxp="$ansexp"
6825 : Use ' ' for none so value is preserved next time through Configure
6826 $test X"$html1dir" = "X" && html1dir=' '
6827 : Change installation prefix, if necessary.
6828 if $test X"$prefix" != X"$installprefix"; then
6829 installhtml1dir=`echo $html1direxp | sed "s#^$prefix#$installprefix#"`
6831 installhtml1dir="$html1direxp"
6834 : determine where html pages for libraries and modules go
6835 set html3dir html3dir none
6839 If you wish to install html files for modules associated with $spackage,
6840 indicate the appropriate directory here. To skip installing html files,
6843 : There is no obvious default. If they have specified html1dir, then
6844 : try to key off that, possibly changing .../html1 into .../html3.
6846 '') html3dir=`echo "$html1dir" | $sed 's/1$/3$/'` ;;
6847 *) dflt=$html3dir ;;
6850 rp="Directory for the $spackage module html pages?"
6853 html3direxp="$ansexp"
6854 : Use ' ' for none so value is preserved next time through Configure
6855 $test X"$html3dir" = "X" && html3dir=' '
6856 : Change installation prefix, if necessary.
6857 if $test X"$prefix" != X"$installprefix"; then
6858 installhtml3dir=`echo $html3direxp | sed "s#^$prefix#$installprefix#"`
6860 installhtml3dir="$html3direxp"
6863 : Find perl5.005 or later.
6864 echo "Looking for a previously installed perl5.005 or later... "
6866 '') for tdir in `echo "$binexp$path_sep$PATH" | $sed "s/$path_sep/ /g"`; do
6867 : Check if this perl is recent and can load a simple module
6868 if $test -x $tdir/perl$exe_ext && $tdir/perl -Mless -e 'use 5.005;' >/dev/null 2>&1; then
6871 elif $test -x $tdir/perl5$exe_ext && $tdir/perl5 -Mless -e 'use 5.005;' >/dev/null 2>&1; then
6881 '') echo "None found. That's ok.";;
6882 *) echo "Using $perl5." ;;
6885 : Determine list of previous versions to include in @INC
6886 $cat > getverlist <<EOPL
6889 \$api_versionstring = "$api_versionstring";
6890 \$version = "$version";
6891 \$stem = "$sitelib_stem";
6892 \$archname = "$archname";
6894 $cat >> getverlist <<'EOPL'
6895 # Can't have leading @ because metaconfig interprets it as a command!
6896 ;@inc_version_list=();
6897 # XXX Redo to do opendir/readdir?
6900 ;@candidates = glob("5.*");
6906 # XXX ToDo: These comparisons must be reworked when two-digit
6907 # subversions come along, so that 5.7.10 compares as greater than
6908 # 5.7.3! By that time, hope that 5.6.x is sufficiently
6909 # widespread that we can use the built-in version vectors rather
6910 # than reinventing them here. For 5.6.0, however, we must
6911 # assume this script will likely be run by 5.005_0x. --AD 1/2000.
6912 foreach $d (@candidates) {
6913 if ($d lt $version) {
6914 if ($d ge $api_versionstring) {
6915 unshift(@inc_version_list, grep { -d } "$d/$archname", $d);
6917 elsif ($d ge "5.005") {
6918 unshift(@inc_version_list, grep { -d } $d);
6922 # Skip newer version. I.e. don't look in
6923 # 5.7.0 if we're installing 5.6.1.
6927 if (@inc_version_list) {
6928 print join(' ', @inc_version_list);
6931 # Blank space to preserve value for next Configure run.
6936 case "$inc_version_list" in
6937 '') if test -x "$perl5$exe_ext"; then
6938 dflt=`$perl5 getverlist`
6943 $undef) dflt='none' ;;
6944 *) eval dflt=\"$inc_version_list\" ;;
6947 ''|' ') dflt=none ;;
6954 In order to ease the process of upgrading, this version of perl
6955 can be configured to use modules built and installed with earlier
6956 versions of perl that were installed under $prefix. Specify here
6957 the list of earlier versions that this version of perl should check.
6958 If Configure detected no earlier versions of perl installed under
6959 $prefix, then the list will be empty. Answer 'none' to tell perl
6960 to not search earlier versions.
6962 The default should almost always be sensible, so if you're not sure,
6963 just accept the default.
6966 rp='List of earlier versions to include in @INC?'
6969 [Nn]one|''|' '|$undef) inc_version_list=' ' ;;
6970 *) inc_version_list="$ans" ;;
6972 case "$inc_version_list" in
6974 inc_version_list_init='0';;
6975 *) inc_version_list_init=`echo $inc_version_list |
6976 $sed -e 's/^/"/' -e 's/ /","/g' -e 's/$/",0/'`
6981 : determine whether to install perl also as /usr/bin/perl
6984 if $test -d /usr/bin -a "X$installbin" != X/usr/bin; then
6986 Many scripts expect perl to be installed as /usr/bin/perl.
6988 If you want to, I can install the perl you are about to compile
6989 as /usr/bin/perl (in addition to $bin/perl).
6991 if test -f /usr/bin/perl; then
6994 However, please note that because you already have a /usr/bin/perl,
6995 overwriting that with a new Perl would very probably cause problems.
6996 Therefore I'm assuming you don't want to do that (unless you insist).
6999 case "$installusrbinperl" in
7000 "$define"|[yY]*) dflt='y';;
7006 Since you don't have a /usr/bin/perl I'm assuming creating one is okay.
7009 case "$installusrbinperl" in
7010 "$undef"|[nN]*) dflt='n';;
7014 rp="Do you want to install perl as /usr/bin/perl?"
7017 [yY]*) val="$define";;
7023 set installusrbinperl
7027 echo "Checking for GNU C Library..." >&4
7029 /* Find out version of GNU C library. __GLIBC__ and __GLIBC_MINOR__
7030 alone are insufficient to distinguish different versions, such as
7031 2.0.6 and 2.0.7. The function gnu_get_libc_version() appeared in
7032 libc version 2.1.0. A. Dougherty, June 3, 2002.
7038 # ifdef __GLIBC_MINOR__
7039 # if __GLIBC__ >= 2 && __GLIBC_MINOR__ >= 1
7040 # include <gnu/libc-version.h>
7041 printf("%s\n", gnu_get_libc_version());
7043 printf("%d.%d\n", __GLIBC__, __GLIBC_MINOR__);
7046 printf("%d\n", __GLIBC__);
7055 if eval $compile_ok && $run ./try > glibc.ver; then
7057 gnulibc_version=`$cat glibc.ver`
7058 echo "You are using the GNU C Library version $gnulibc_version"
7062 echo "You are not using the GNU C Library"
7064 $rm -f try try.* glibc.ver
7068 : see if nm is to be used to determine whether a symbol is defined or not
7072 case "$d_gnulibc" in
7075 echo "nm probably won't work on the GNU C Library." >&4
7081 if $test "$osname" = aix -a "X$PASE" != "Xdefine" -a ! -f /lib/syscalls.exp; then
7083 echo "Whoops! This is an AIX system without /lib/syscalls.exp!" >&4
7084 echo "'nm' won't be sufficient on this sytem." >&4
7090 '') dflt=`$egrep 'inlibc|csym' $rsrc/Configure | wc -l 2>/dev/null`
7091 if $test $dflt -gt 20; then
7101 true|$define) dflt=y;;
7108 I can use $nm to extract the symbols from your C libraries. This
7109 is a time consuming task which may generate huge output on the disk (up
7110 to 3 megabytes) but that should make the symbols extraction faster. The
7111 alternative is to skip the 'nm' extraction part and to compile a small
7112 test program instead to determine whether each symbol is present. If
7113 you have a fast C compiler and/or if your 'nm' output cannot be parsed,
7114 this may be the best solution.
7116 You probably shouldn't let me use 'nm' if you are using the GNU C Library.
7119 rp="Shall I use $nm to extract C symbols from the libraries?"
7122 [Nn]*) usenm=false;;
7131 : nm options which may be necessary
7133 '') if $test -f /mach_boot; then
7135 elif $test -d /usr/ccs/lib; then
7136 nm_opt='-p' # Solaris (and SunOS?)
7137 elif $test -f /dgux; then
7139 elif $test -f /lib64/rld; then
7140 nm_opt='-p' # 64-bit Irix
7146 : nm options which may be necessary for shared libraries but illegal
7147 : for archive libraries. Thank you, Linux.
7148 case "$nm_so_opt" in
7149 '') case "$myuname" in
7151 if $nm --help | $grep 'dynamic' > /dev/null 2>&1; then
7152 nm_so_opt='--dynamic'
7161 : get list of predefined functions in a handy place
7166 *-lc_s*) libc=`./loc libc_s$_a $libc $libpth`
7172 *) for thislib in $libs; do
7175 : Handle C library specially below.
7178 thislib=`echo $thislib | $sed -e 's/^-l//'`
7179 if try=`./loc lib$thislib.$so.'*' X $libpth`; $test -f "$try"; then
7181 elif try=`./loc lib$thislib.$so X $libpth`; $test -f "$try"; then
7183 elif try=`./loc lib$thislib$_a X $libpth`; $test -f "$try"; then
7185 elif try=`./loc $thislib$_a X $libpth`; $test -f "$try"; then
7187 elif try=`./loc lib$thislib X $libpth`; $test -f "$try"; then
7189 elif try=`./loc $thislib X $libpth`; $test -f "$try"; then
7191 elif try=`./loc Slib$thislib$_a X $xlibpth`; $test -f "$try"; then
7196 libnames="$libnames $try"
7198 *) libnames="$libnames $thislib" ;;
7207 for xxx in $libpth; do
7208 $test -r $1 || set $xxx/libc.$so
7209 : The messy sed command sorts on library version numbers.
7211 set `echo blurfl; echo $xxx/libc.$so.[0-9]* | \
7212 tr ' ' $trnl | egrep -v '\.[A-Za-z]*$' | $sed -e '
7214 s/[0-9][0-9]*/0000&/g
7215 s/0*\([0-9][0-9][0-9][0-9][0-9]\)/\1/g
7218 $sort | $sed -e 's/^.* //'`
7221 $test -r $1 || set /usr/ccs/lib/libc.$so
7222 $test -r $1 || set /lib/libsys_s$_a
7228 if $test -r "$1"; then
7229 echo "Your (shared) C library seems to be in $1."
7231 elif $test -r /lib/libc && $test -r /lib/clib; then
7232 echo "Your C library seems to be in both /lib/clib and /lib/libc."
7234 libc='/lib/clib /lib/libc'
7235 if $test -r /lib/syslib; then
7236 echo "(Your math library is in /lib/syslib.)"
7237 libc="$libc /lib/syslib"
7239 elif $test -r "$libc" || (test -h "$libc") >/dev/null 2>&1; then
7240 echo "Your C library seems to be in $libc, as you said before."
7241 elif $test -r $incpath/usr/lib/libc$_a; then
7242 libc=$incpath/usr/lib/libc$_a;
7243 echo "Your C library seems to be in $libc. That's fine."
7244 elif $test -r /lib/libc$_a; then
7246 echo "Your C library seems to be in $libc. You're normal."
7248 if tans=`./loc libc$_a blurfl/dyick $libpth`; $test -r "$tans"; then
7250 elif tans=`./loc libc blurfl/dyick $libpth`; $test -r "$tans"; then
7251 libnames="$libnames "`./loc clib blurfl/dyick $libpth`
7252 elif tans=`./loc clib blurfl/dyick $libpth`; $test -r "$tans"; then
7254 elif tans=`./loc Slibc$_a blurfl/dyick $xlibpth`; $test -r "$tans"; then
7256 elif tans=`./loc Mlibc$_a blurfl/dyick $xlibpth`; $test -r "$tans"; then
7259 tans=`./loc Llibc$_a blurfl/dyick $xlibpth`
7261 if $test -r "$tans"; then
7262 echo "Your C library seems to be in $tans, of all places."
7268 if $test $xxx = apollo -o -r "$libc" || (test -h "$libc") >/dev/null 2>&1; then
7272 If the guess above is wrong (which it might be if you're using a strange
7273 compiler, or your machine supports multiple models), you can override it here.
7278 echo $libpth | $tr ' ' $trnl | $sort | $uniq > libpath
7280 I can't seem to find your C library. I've looked in the following places:
7283 $sed 's/^/ /' libpath
7286 None of these seems to contain your C library. I need to get its name...
7291 rp='Where is your C library?'
7296 echo $libc $libnames | $tr ' ' $trnl | $sort | $uniq > libnames
7297 set X `cat libnames`
7300 case $# in 1) xxx=file; esac
7301 echo "Extracting names from the following $xxx for later perusal:" >&4
7303 $sed 's/^/ /' libnames >&4
7305 $echo $n "This may take a while...$c" >&4
7309 *$so*) $nm $nm_so_opt $nm_opt $file 2>/dev/null;;
7310 *) $nm $nm_opt $file 2>/dev/null;;
7315 $grep fprintf libc.tmp > libc.ptf
7316 xscan='eval "<libc.ptf $com >libc.list"; $echo $n ".$c" >&4'
7317 xrun='eval "<libc.tmp $com >libc.list"; echo "done." >&4'
7319 if com="$sed -n -e 's/__IO//' -e 's/^.* $xxx *//p'";\
7321 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7323 elif com="$sed -n -e 's/^__*//' -e 's/^\([a-zA-Z_0-9$]*\).*xtern.*/\1/p'";\
7325 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7327 elif com="$sed -n -e '/|UNDEF/d' -e '/FUNC..GL/s/^.*|__*//p'";\
7329 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7331 elif com="$sed -n -e 's/^.* D __*//p' -e 's/^.* D //p'";\
7333 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7335 elif com="$sed -n -e 's/^_//' -e 's/^\([a-zA-Z_0-9]*\).*xtern.*text.*/\1/p'";\
7337 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7339 elif com="$sed -n -e 's/^.*|FUNC |GLOB .*|//p'";\
7341 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7343 elif com="$grep '|' | $sed -n -e '/|COMMON/d' -e '/|DATA/d' \
7344 -e '/ file/d' -e 's/^\([^ ]*\).*/\1/p'";\
7346 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7348 elif com="$sed -n -e 's/^.*|FUNC |GLOB .*|//p' -e 's/^.*|FUNC |WEAK .*|//p'";\
7350 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7352 elif com="$sed -n -e 's/^__//' -e '/|Undef/d' -e '/|Proc/s/ .*//p'";\
7354 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7356 elif com="$sed -n -e 's/^.*|Proc .*|Text *| *//p'";\
7358 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7360 elif com="$sed -n -e '/Def. Text/s/.* \([^ ]*\)\$/\1/p'";\
7362 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7364 elif com="$sed -n -e 's/^[-0-9a-f ]*_\(.*\)=.*/\1/p'";\
7366 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7368 elif com="$sed -n -e 's/.*\.text n\ \ \ \.//p'";\
7370 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7372 elif com="sed -n -e 's/^__.*//' -e 's/[ ]*D[ ]*[0-9]*.*//p'";\
7374 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7377 $nm -p $* 2>/dev/null >libc.tmp
7378 $grep fprintf libc.tmp > libc.ptf
7379 if com="$sed -n -e 's/^.* [ADTSIW] *_[_.]*//p' -e 's/^.* [ADTSIW] //p'";\
7380 eval $xscan; $contains '^fprintf$' libc.list >/dev/null 2>&1
7386 echo "$nm didn't seem to work right. Trying $ar instead..." >&4
7388 if $ar t $libc > libc.tmp && $contains '^fprintf$' libc.tmp >/dev/null 2>&1; then
7389 for thisname in $libnames $libc; do
7390 $ar t $thisname >>libc.tmp
7392 $sed -e "s/\\$_o\$//" < libc.tmp > libc.list
7394 elif test "X$osname" = "Xos2" && $ar tv $libc > libc.tmp; then
7395 # Repeat libc to extract forwarders to DLL entries too
7396 for thisname in $libnames $libc; do
7397 $ar tv $thisname >>libc.tmp
7398 # Revision 50 of EMX has bug in $ar.
7399 # it will not extract forwarders to DLL entries
7400 # Use emximp which will extract exactly them.
7401 emximp -o tmp.imp $thisname \
7403 $sed -e 's/^\([_a-zA-Z0-9]*\) .*$/\1/p' \
7404 < tmp.imp >>libc.tmp
7407 $sed -e "s/\\$_o\$//" -e 's/^ \+//' < libc.tmp > libc.list
7410 echo "$ar didn't seem to work right." >&4
7411 echo "Maybe this is a Cray...trying bld instead..." >&4
7412 if bld t $libc | $sed -e 's/.*\///' -e "s/\\$_o:.*\$//" > libc.list
7414 for thisname in $libnames; do
7416 $sed -e 's/.*\///' -e "s/\\$_o:.*\$//" >>libc.list
7417 $ar t $thisname >>libc.tmp
7421 echo "That didn't work either. Giving up." >&4
7431 echo "Since you are compiling for PASE, extracting more symbols from libc.a ...">&4
7432 dump -Tv /lib/libc.a | awk '$7 == "/unix" {print $5 " " $8}' | grep "^SV" | awk '{print $2}' >> libc.list
7434 *) if $test -f /lib/syscalls.exp; then
7436 echo "Also extracting names from /lib/syscalls.exp for good ole AIX..." >&4
7437 $sed -n 's/^\([^ ]*\)[ ]*syscall[0-9]*[ ]*$/\1/p' /lib/syscalls.exp >>libc.list
7443 $rm -f libnames libpath
7445 : see if dld is available
7449 : is a C symbol defined?
7452 -v) tf=libc.tmp; tdc="";;
7453 -a) tf=libc.tmp; tdc="[]";;
7454 *) tlook="^$1\$"; tf=libc.list; tdc="()";;
7457 case "$reuseval-$4" in
7459 true-*) tx=no; eval "tval=\$$4"; case "$tval" in "") tx=yes;; esac;;
7464 if $test "$runnm" = true; then
7465 if $contains $tlook $tf >/dev/null 2>&1; then
7467 elif $test "$mistrustnm" = compile -o "$mistrustnm" = run; then
7468 echo "void *(*(p()))$tdc { extern void *$1$tdc; return &$1; } int main() { if(p()) return(0); else return(1); }"> try.c;
7469 $cc -o try $optimize $ccflags $ldflags try.c >/dev/null 2>&1 $libs && tval=true;
7470 $test "$mistrustnm" = run -a -x try && { $run ./try$_exe >/dev/null 2>&1 || tval=false; };
7471 $rm -f try$_exe try.c core core.* try.core;
7474 echo "void *(*(p()))$tdc { extern void *$1$tdc; return &$1; } int main() { if(p()) return(0); else return(1); }"> try.c;
7475 $cc -o try $optimize $ccflags $ldflags try.c $libs >/dev/null 2>&1 && tval=true;
7476 $rm -f try$_exe try.c;
7481 $define) tval=true;;
7488 : define an is-in-libc? function
7489 inlibc='echo " "; td=$define; tu=$undef;
7490 sym=$1; var=$2; eval "was=\$$2";
7492 case "$reuseval$was" in
7502 echo "$sym() found." >&4;
7503 case "$was" in $undef) . ./whoa; esac; eval "$var=\$td";;
7505 echo "$sym() NOT found." >&4;
7506 case "$was" in $define) . ./whoa; esac; eval "$var=\$tu";;
7510 $define) echo "$sym() found." >&4;;
7511 *) echo "$sym() NOT found." >&4;;
7515 : see if dlopen exists
7522 : determine which dynamic loading, if any, to compile in
7524 dldir="ext/DynaLoader"
7537 $define) dflt='y' ;;
7540 $define) dflt='y' ;;
7542 : Does a dl_xxx.xs file exist for this operating system
7543 $test -f $rsrc/$dldir/dl_${osname}.xs && dflt='y'
7546 rp="Do you wish to use dynamic loading?"
7553 if $test -f $rsrc/$dldir/dl_${osname}.xs ; then
7554 dflt="$dldir/dl_${osname}.xs"
7555 elif $test "$d_dlopen" = "$define" ; then
7556 dflt="$dldir/dl_dlopen.xs"
7557 elif $test "$i_dld" = "$define" ; then
7558 dflt="$dldir/dl_dld.xs"
7563 *) dflt="$dldir/$dlsrc"
7566 echo "The following dynamic loading files are available:"
7567 : Can not go over to $dldir because getfile has path hard-coded in.
7568 tdir=`pwd`; cd "$rsrc"; $ls -C $dldir/dl*.xs; cd "$tdir"
7569 rp="Source file to use for dynamic loading"
7575 dlsrc=`echo $ans | $sed -e 's%.*/\([^/]*\)$%\1%'`
7579 Some systems may require passing special flags to $cc -c to
7580 compile modules that will be used to create a shared library.
7581 To use no flags, say "none".
7584 case "$cccdlflags" in
7585 '') case "$gccversion" in
7586 '') case "$osname" in
7588 next) dflt='none' ;;
7589 irix*) dflt='-KPIC' ;;
7590 svr4*|esix*|solaris|nonstopux) dflt='-KPIC' ;;
7591 sunos) dflt='-pic' ;;
7595 *) case "$osname" in
7596 darwin) dflt='none' ;;
7597 svr4*|esix*|solaris|nonstopux) dflt='-fPIC' ;;
7602 *) dflt="$cccdlflags" ;;
7604 rp="Any special flags to pass to $cc -c to compile shared library modules?"
7607 none) cccdlflags=' ' ;;
7608 *) cccdlflags="$ans" ;;
7613 Some systems use ld to create libraries that can be dynamically loaded,
7614 while other systems (such as those using ELF) use $cc.
7618 '') $cat >try.c <<EOM
7619 /* Test for whether ELF binaries are produced */
7627 int i = open("a.out",O_RDONLY);
7630 if(read(i,b,4)==4 && b[0]==127 && b[1]=='E' && b[2]=='L' && b[3]=='F')
7631 exit(0); /* succeed (yes, it's ELF) */
7636 if $cc $ccflags $ldflags try.c >/dev/null 2>&1 && $run ./a.out; then
7638 You appear to have ELF support. I'll use $cc to build dynamic libraries.
7642 echo "I'll use ld to build dynamic libraries."
7651 rp="What command should be used to create dynamic libraries?"
7657 Some systems may require passing special flags to $ld to create a
7658 library that can be dynamically loaded. If your ld flags include
7659 -L/other/path options to locate libraries outside your loader's normal
7660 search path, you may need to specify those -L options here as well. To
7661 use no flags, say "none".
7664 case "$lddlflags" in
7665 '') case "$osname" in
7666 beos) dflt='-nostart' ;;
7668 case "$gccversion" in
7669 '') dflt="$dflt +vnocompatwarnings" ;;
7672 linux|irix*|gnu*) dflt='-shared' ;;
7673 next) dflt='none' ;;
7674 solaris) dflt='-G' ;;
7675 sunos) dflt='-assert nodefinitions' ;;
7676 svr4*|esix*|nonstopux) dflt="-G $ldflags" ;;
7680 *) dflt="$lddlflags" ;;
7683 : Try to guess additional flags to pick up local libraries.
7684 : Be careful not to append to a plain 'none'
7688 for thisflag in $ldflags; do
7693 *) dflt="$dflt $thisflag" ;;
7700 ''|' ') dflt='none' ;;
7703 rp="Any special flags to pass to $ld to create a dynamically loaded library?"
7706 none) lddlflags=' ' ;;
7707 *) lddlflags="$ans" ;;
7712 Some systems may require passing special flags to $cc to indicate that
7713 the resulting executable will use dynamic linking. To use no flags,
7717 case "$ccdlflags" in
7718 '') case "$osname" in
7719 linux|hpux|gnu*) dflt='-Wl,-E' ;;
7720 next|sunos) dflt='none' ;;
7724 *) dflt="$ccdlflags" ;;
7726 rp="Any special flags to pass to $cc to use dynamic linking?"
7729 none) ccdlflags=' ' ;;
7730 *) ccdlflags="$ans" ;;
7744 # No dynamic loading being used, so don't bother even to prompt.
7747 *) case "$useshrplib" in
7748 '') case "$osname" in
7749 svr4*|nonstopux|dgux|dynixptx|esix|powerux|beos|cygwin*)
7751 also='Building a shared libperl is required for dynamic loading to work on your system.'
7756 also='Building a shared libperl is needed for MAB support.'
7774 The perl executable is normally obtained by linking perlmain.c with
7775 libperl${_a}, any static extensions (usually just DynaLoader), and
7776 any other libraries needed on this system (such as -lm, etc.). Since
7777 your system supports dynamic loading, it is probably possible to build
7778 a shared libperl.$so. If you will have more than one executable linked
7779 to libperl.$so, this will significantly reduce the size of each
7780 executable, but it may have a noticeable effect on performance. The
7781 default is probably sensible for your system.
7785 rp="Build a shared libperl.$so (y/n)"
7789 useshrplib='true' ;;
7790 *) useshrplib='false' ;;
7795 case "$useshrplib" in
7799 # Figure out a good name for libperl.so. Since it gets stored in
7800 # a version-specific architecture-dependent library, the version
7801 # number isn't really that important, except for making cc/ld happy.
7803 # A name such as libperl.so.3.1
7804 majmin="libperl.$so.$patchlevel.$subversion"
7805 # A name such as libperl.so.301
7806 majonly=`echo $patchlevel $subversion |
7807 $awk '{printf "%d%02d", $1, $2}'`
7808 majonly=libperl.$so.$majonly
7809 # I'd prefer to keep the os-specific stuff here to a minimum, and
7810 # rely on figuring it out from the naming of libc.
7811 case "${osname}${osvers}" in
7814 # XXX How handle the --version stuff for MAB?
7816 linux*|gnu*) # ld won't link with a bare -lperl otherwise.
7819 cygwin*) # ld links against an importlib
7820 dflt=libperl$lib_ext
7822 *) # Try to guess based on whether libc has major.minor.
7824 *libc.$so.[0-9]*.[0-9]*) dflt=$majmin ;;
7825 *libc.$so.[0-9]*) dflt=$majonly ;;
7826 *) dflt=libperl.$so ;;
7836 I need to select a good name for the shared libperl. If your system uses
7837 library names with major and minor numbers, then you might want something
7838 like $majmin. Alternatively, if your system uses a single version
7839 number for shared libraries, then you might want to use $majonly.
7840 Or, your system might be quite happy with a simple libperl.$so.
7842 Since the shared libperl will get installed into a version-specific
7843 architecture-dependent directory, the version number of the shared perl
7844 library probably isn't important, so the default should be o.k.
7847 rp='What name do you want to give to the shared libperl?'
7850 echo "Ok, I'll use $libperl"
7853 libperl="libperl${_a}"
7857 # Detect old use of shrpdir via undocumented Configure -Dshrpdir
7861 WARNING: Use of the shrpdir variable for the installation location of
7862 the shared $libperl is not supported. It was never documented and
7863 will not work in this version. Let me (perlbug@perl.org)
7864 know of any problems this may cause.
7870 But your current setting of $shrpdir is
7871 the default anyway, so it's harmless.
7876 Further, your current attempted setting of $shrpdir
7877 conflicts with the value of $archlibexp/CORE
7878 that installperl will use.
7885 # How will the perl executable find the installed shared $libperl?
7886 # Add $xxx to ccdlflags.
7887 # If we can't figure out a command-line option, use $shrpenv to
7888 # set env LD_RUN_PATH. The main perl makefile uses this.
7889 shrpdir=$archlibexp/CORE
7892 if "$useshrplib"; then
7895 # We'll set it in Makefile.SH...
7900 freebsd|netbsd|openbsd|interix|dragonfly)
7901 xxx="-Wl,-R$shrpdir"
7903 bsdos|linux|irix*|dec_osf|gnu*)
7904 xxx="-Wl,-rpath,$shrpdir"
7907 # next doesn't like the default...
7910 # beos doesn't like the default, either.
7913 # hpux doesn't like the default, either.
7914 tmp_shrpenv="env LDOPTS=\"+s +b${shrpdir}\""
7917 tmp_shrpenv="env LD_RUN_PATH=$shrpdir"
7923 # Only add $xxx if it isn't already in ccdlflags.
7924 case " $ccdlflags " in
7926 *) ccdlflags="$ccdlflags $xxx"
7929 Adding $xxx to the flags
7930 passed to $ld so that the perl executable will find the
7931 installed shared $libperl.
7939 # Fix ccdlflags in AIX for building external extensions.
7940 # (For building Perl itself bare -bE:perl.exp is needed,
7941 # Makefile.SH takes care of this.)
7943 aix) ccdlflags="$ccdlflags -bE:$installarchlib/CORE/perl.exp" ;;
7945 # Respect a hint or command-line value.
7947 '') shrpenv="$tmp_shrpenv" ;;
7949 case "$ldlibpthname" in
7950 '') ldlibpthname=LD_LIBRARY_PATH ;;
7951 none) ldlibpthname='' ;;
7954 : determine where manual pages are on this system
7958 syspath='/usr/share/man/man1 /usr/man/man1'
7959 syspath="$syspath /usr/man/mann /usr/man/manl /usr/man/local/man1"
7960 syspath="$syspath /usr/man/u_man/man1"
7961 syspath="$syspath /usr/catman/u_man/man1 /usr/man/l_man/man1"
7962 syspath="$syspath /usr/local/man/u_man/man1 /usr/local/man/l_man/man1"
7963 syspath="$syspath /usr/man/man.L /local/man/man1 /usr/local/man/man1"
7964 sysman=`./loc . /usr/man/man1 $syspath`
7967 if $test -d "$sysman"; then
7968 echo "System manual is in $sysman." >&4
7970 echo "Could not find manual pages in source form." >&4
7973 : determine where manual pages go
7974 set man1dir man1dir none
7978 $spackage has manual pages available in source form.
7982 echo "However, you don't have nroff, so they're probably useless to you."
7984 '') man1dir="none";;
7987 echo "If you don't want the manual sources installed, answer 'none'."
7992 lookpath="$prefixexp/share/man/man1"
7993 lookpath="$lookpath $prefixexp/man/man1 $prefixexp/man/l_man/man1"
7994 lookpath="$lookpath $prefixexp/man/p_man/man1"
7995 lookpath="$lookpath $prefixexp/man/u_man/man1"
7996 lookpath="$lookpath $prefixexp/man/man.1"
7998 */?_man*) dflt=`./loc . $prefixexp/l_man/man1 $lookpath` ;;
7999 *) dflt=`./loc . $prefixexp/man/man1 $lookpath` ;;
8009 rp="Where do the main $spackage manual pages (source) go?"
8011 if $test "X$man1direxp" != "X$ansexp"; then
8015 man1direxp="$ansexp"
8021 : Change installation prefix, if necessary.
8022 if $test X"$prefix" != X"$installprefix"; then
8023 installman1dir=`echo $man1direxp | $sed "s#^$prefix#$installprefix#"`
8025 installman1dir="$man1direxp"
8028 : What suffix to use on installed man pages
8035 rp="What suffix should be used for the main $spackage man pages?"
8037 '') case "$man1dir" in
8051 *) dflt="$man1ext";;
8058 : see if we can have long filenames
8060 first=123456789abcdef
8062 if (echo hi >$first) 2>/dev/null; then
8063 if $test -f 123456789abcde; then
8064 echo 'You cannot have filenames longer than 14 characters. Sigh.' >&4
8067 echo 'You can have filenames longer than 14 characters.'>&4
8072 You can't have filenames longer than 14 chars.
8073 You can't even think about them!
8079 $rm -rf 123456789abcde*
8081 : determine where library module manual pages go
8082 set man3dir man3dir none
8086 $spackage has manual pages for many of the library modules.
8092 However, you don't have nroff, so they're probably useless to you.
8095 '') man3dir="none";;
8099 case "$d_flexfnam" in
8102 However, your system can't handle the long file names like File::Basename.3.
8105 '') man3dir="none";;
8109 echo "If you don't want the manual sources installed, answer 'none'."
8110 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
8112 '') dflt=`echo "$man1dir" | $sed -e 's/man1/man3/g' -e 's/man\.1/man\.3/g'`
8113 if $test -d "$privlib/man/man3"; then
8116 WARNING: Previous versions of perl installed man3 pages into
8117 $privlib/man/man3. This version will suggest a
8118 new default of $dflt.
8122 rp='Do you wish to preserve the old behavior?(y/n)'
8125 y*) dflt="$privlib/man/man3" ;;
8130 *) dflt="$man3dir" ;;
8137 rp="Where do the $package library man pages (source) go?"
8140 man3direxp="$ansexp"
8146 : Change installation prefix, if necessary.
8147 if $test X"$prefix" != X"$installprefix"; then
8148 installman3dir=`echo $man3direxp | $sed "s#^$prefix#$installprefix#"`
8150 installman3dir="$man3direxp"
8153 : What suffix to use on installed man pages
8159 rp="What suffix should be used for the $package library man pages?"
8161 '') case "$man3dir" in
8175 *) dflt="$man3ext";;
8182 : see if we have to deal with yellow pages, now NIS.
8183 if $test -d /usr/etc/yp || $test -d /etc/yp || $test -d /usr/lib/yp; then
8184 if $test -f /usr/etc/nibindd; then
8186 echo "I'm fairly confident you're on a NeXT."
8188 rp='Do you get the hosts file via NetInfo?'
8197 y*) hostcat='nidump hosts .';;
8198 *) case "$hostcat" in
8199 nidump*) hostcat='';;
8209 '') if $contains '^\+' /etc/passwd >/dev/null 2>&1; then
8217 rp='Are you getting the hosts file via yellow pages?'
8220 y*) hostcat='ypcat hosts';;
8221 *) hostcat='cat /etc/hosts';;
8227 '') test -f /etc/hosts && hostcat='cat /etc/hosts';;
8230 '') test -f /etc/group && groupcat='cat /etc/group';;
8233 '') test -f /etc/passwd && passcat='cat /etc/passwd';;
8236 : now get the host name
8238 echo "Figuring out host name..." >&4
8239 case "$myhostname" in
8241 echo 'Maybe "hostname" will work...'
8242 if tans=`sh -c hostname 2>&1` ; then
8250 if $test "$cont"; then
8252 echo 'Oh, dear. Maybe "/etc/systemid" is the key...'
8253 if tans=`cat /etc/systemid 2>&1` ; then
8255 phostname='cat /etc/systemid'
8256 echo "Whadyaknow. Xenix always was a bit strange..."
8259 elif $test -r /etc/systemid; then
8260 echo "(What is a non-Xenix system doing with /etc/systemid?)"
8263 if $test "$cont"; then
8264 echo 'No, maybe "uuname -l" will work...'
8265 if tans=`sh -c 'uuname -l' 2>&1` ; then
8267 phostname='uuname -l'
8269 echo 'Strange. Maybe "uname -n" will work...'
8270 if tans=`sh -c 'uname -n' 2>&1` ; then
8272 phostname='uname -n'
8274 echo 'Oh well, maybe I can mine it out of whoami.h...'
8275 if tans=`sh -c $contains' sysname $usrinc/whoami.h' 2>&1` ; then
8276 myhostname=`echo "$tans" | $sed 's/^.*"\(.*\)"/\1/'`
8277 phostname="sed -n -e '"'/sysname/s/^.*\"\\(.*\\)\"/\1/{'"' -e p -e q -e '}' <$usrinc/whoami.h"
8279 case "$myhostname" in
8280 '') echo "Does this machine have an identity crisis or something?"
8283 echo "Well, you said $myhostname before..."
8284 phostname='echo $myhostname';;
8290 case "$myhostname" in
8291 '') myhostname=noname ;;
8293 : you do not want to know about this
8298 if $test "$myhostname" ; then
8300 rp='Your host name appears to be "'$myhostname'".'" Right?"
8308 : bad guess or no guess
8309 while $test "X$myhostname" = X ; do
8311 rp="Please type the (one word) name of your host:"
8316 : translate upper to lower if necessary
8317 case "$myhostname" in
8319 echo "(Normalizing case in your host name)"
8320 myhostname=`echo $myhostname | ./tr '[A-Z]' '[a-z]'`
8324 case "$myhostname" in
8326 dflt=`expr "X$myhostname" : "X[^.]*\(\..*\)"`
8327 myhostname=`expr "X$myhostname" : "X\([^.]*\)\."`
8328 echo "(Trimming domain name from host name--host name is now $myhostname)"
8330 *) case "$mydomain" in
8333 test "X$hostcat" = "Xypcat hosts" &&
8334 ypmatch "$myhostname" hosts 2>/dev/null |\
8335 $sed -e 's/[ ]*#.*//; s/$/ /' > hosts && \
8338 test "X$hostcat" != "X" &&
8339 $hostcat | $sed -n -e "s/[ ]*#.*//; s/\$/ /
8340 /[ ]$myhostname[ . ]/p" > hosts
8343 if $test -f hosts; then
8344 $test x`$awk "/[0-9].*[ ]$myhostname$tmp_re/ { sum++ }
8345 END { print sum }" hosts` = x1 || tmp_re="[ ]"
8346 dflt=.`$awk "/[0-9].*[ ]$myhostname$tmp_re/ {for(i=2; i<=NF;i++) print \\\$i}" \
8347 hosts | $sort | $uniq | \
8348 $sed -n -e "s/$myhostname\.\([-a-zA-Z0-9_.]\)/\1/p"`
8349 case `$echo X$dflt` in
8350 X*\ *) echo "(Several hosts in the database matched hostname)"
8353 X.) echo "(You do not have fully-qualified names in the hosts database)"
8357 echo "(I cannot locate a hosts database anywhere)"
8362 tans=`./loc resolv.conf X /etc /usr/etc`
8363 if $test -f "$tans"; then
8364 echo "(Attempting domain name extraction from $tans)"
8365 dflt=.`$sed -n -e 's/ / /g' \
8366 -e 's/^search *\([^ ]*\).*/\1/p' $tans \
8367 | ./tr '[A-Z]' '[a-z]' 2>/dev/null`
8369 .) dflt=.`$sed -n -e 's/ / /g' \
8370 -e 's/^domain *\([^ ]*\).*/\1/p' $tans \
8371 | ./tr '[A-Z]' '[a-z]' 2>/dev/null`
8378 .) echo "(No help from resolv.conf either -- attempting clever guess)"
8379 dflt=.`sh -c domainname 2>/dev/null`
8382 .nis.*|.yp.*|.main.*) dflt=`echo $dflt | $sed -e 's/^\.[^.]*//'`;;
8386 case "$dflt$osname" in
8387 .os390) echo "(Attempting domain name extraction from //'SYS1.TCPPARMS(TCPDATA)')"
8388 dflt=.`awk '/^DOMAINORIGIN/ {print $2}' "//'SYS1.TCPPARMS(TCPDATA)'" 2>/dev/null`
8392 .) echo "(Lost all hope -- silly guess then)"
8398 *) dflt="$mydomain";;
8402 rp="What is your domain name?"
8412 : translate upper to lower if necessary
8415 echo "(Normalizing case in your domain name)"
8416 mydomain=`echo $mydomain | ./tr '[A-Z]' '[a-z]'`
8420 : a little sanity check here
8421 case "$phostname" in
8424 case `$phostname | ./tr '[A-Z]' '[a-z]'` in
8425 $myhostname$mydomain|$myhostname) ;;
8427 case "$phostname" in
8429 echo "(That doesn't agree with your whoami.h file, by the way.)"
8432 echo "(That doesn't agree with your $phostname command, by the way.)"
8442 I need to get your e-mail address in Internet format if possible, i.e.
8443 something like user@host.domain. Please answer accurately since I have
8444 no easy means to double check it. The default value provided below
8445 is most probably close to reality but may not be valid from outside
8446 your organization...
8450 while test "$cont"; do
8452 '') dflt="$cf_by@$myhostname$mydomain";;
8453 *) dflt="$cf_email";;
8455 rp='What is your e-mail address?'
8461 rp='Address does not look like an Internet one. Use it anyway?'
8477 If you or somebody else will be maintaining perl at your site, please
8478 fill in the correct e-mail address here so that they may be contacted
8479 if necessary. Currently, the "perlbug" program included with perl
8480 will send mail to this address in addition to perlbug@perl.org. You may
8481 enter "none" for no administrator.
8484 case "$perladmin" in
8485 '') dflt="$cf_email";;
8486 *) dflt="$perladmin";;
8488 rp='Perl administrator e-mail address'
8492 : determine whether to only install version-specific parts.
8495 Do you want to install only the version-specific parts of the perl
8496 distribution? Usually you do *not* want to do this.
8498 case "$versiononly" in
8499 "$define"|[Yy]*|true) dflt='y' ;;
8502 rp="Do you want to install only the version-specific parts of perl?"
8505 [yY]*) val="$define";;
8511 case "$versiononly" in
8512 "$define") inc_version_list=''
8513 inc_version_list_init=0
8517 : figure out how to guarantee perl startup
8518 case "$startperl" in
8520 case "$sharpbang" in
8524 I can use the #! construct to start perl on your system. This will
8525 make startup of perl scripts faster, but may cause problems if you
8526 want to share those scripts and perl is not in a standard place
8527 ($binexp/perl) on all your platforms. The alternative is to force
8528 a shell by starting the script with a single ':' character.
8531 case "$versiononly" in
8532 "$define") dflt="$binexp/perl$version";;
8533 *) dflt="$binexp/perl";;
8535 rp='What shall I put after the #! to start up perl ("none" to not use #!)?'
8538 none) startperl=": # use perl";;
8539 *) startperl="#!$ans"
8540 if $test 30 -lt `echo "$ans" | wc -c`; then
8543 WARNING: Some systems limit the #! command to 32 characters.
8544 If you experience difficulty running Perl scripts with #!, try
8545 installing Perl in a directory with a shorter pathname.
8551 *) startperl=": # use perl"
8556 echo "I'll use $startperl to start perl scripts."
8558 : figure best path for perl in scripts
8561 case "$versiononly" in
8562 "$define") perlpath="$binexp/perl$version";;
8563 *) perlpath="$binexp/perl";;
8565 case "$startperl" in
8570 I will use the "eval 'exec'" idiom to start Perl on your system.
8571 I can use the full path of your Perl binary for this purpose, but
8572 doing so may cause problems if you want to share those scripts and
8573 Perl is not always in a standard place ($binexp/perl).
8577 rp="What path shall I use in \"eval 'exec'\"?"
8584 case "$startperl" in
8586 *) echo "I'll use $perlpath in \"eval 'exec'\"" ;;
8589 : determine where public executable scripts go
8590 set scriptdir scriptdir
8592 case "$scriptdir" in
8595 : guess some guesses
8596 $test -d /usr/share/scripts && dflt=/usr/share/scripts
8597 $test -d /usr/share/bin && dflt=/usr/share/bin
8598 $test -d /usr/local/script && dflt=/usr/local/script
8599 $test -d /usr/local/scripts && dflt=/usr/local/scripts
8600 $test -d $prefixexp/script && dflt=$prefixexp/script
8604 *) dflt="$scriptdir"
8609 Some installations have a separate directory just for executable scripts so
8610 that they can mount it across multiple architectures but keep the scripts in
8611 one spot. You might, for example, have a subdirectory of /usr/share for this.
8612 Or you might just lump your scripts in with all your other executables.
8616 rp='Where do you keep publicly executable scripts?'
8618 if $test "X$ansexp" != "X$scriptdirexp"; then
8622 scriptdirexp="$ansexp"
8623 : Change installation prefix, if necessary.
8624 if $test X"$prefix" != X"$installprefix"; then
8625 installscript=`echo $scriptdirexp | sed "s#^$prefix#$installprefix#"`
8627 installscript="$scriptdirexp"
8630 : determine where add-on public executables go
8632 '') dflt=$siteprefix/bin ;;
8636 rp='Pathname where the add-on public executables should be installed?'
8639 sitebinexp="$ansexp"
8640 : Change installation prefix, if necessary.
8641 if $test X"$prefix" != X"$installprefix"; then
8642 installsitebin=`echo $sitebinexp | sed "s#^$prefix#$installprefix#"`
8644 installsitebin="$sitebinexp"
8647 : determine where add-on html pages go
8648 : There is no standard location, so try to copy the previously-selected
8649 : directory structure for the core html pages.
8650 case "$sitehtml1dir" in
8651 '') dflt=`echo "$html1dir" | $sed "s#^$prefix#$siteprefix#"` ;;
8652 *) dflt=$sitehtml1dir ;;
8655 ''|' ') dflt=none ;;
8658 rp='Pathname where the site-specific html pages should be installed?'
8661 sitehtml1direxp="$ansexp"
8662 : Change installation prefix, if necessary.
8663 if $test X"$prefix" != X"$installprefix"; then
8664 installsitehtml1dir=`echo $sitehtml1direxp | $sed "s#^$prefix#$installprefix#"`
8666 installsitehtml1dir="$sitehtml1direxp"
8669 : determine where add-on library html pages go
8670 : There is no standard location, so try to copy the previously-selected
8671 : directory structure for the core html pages.
8672 case "$sitehtml3dir" in
8673 '') dflt=`echo "$html3dir" | $sed "s#^$prefix#$siteprefix#"` ;;
8674 *) dflt=$sitehtml3dir ;;
8677 ''|' ') dflt=none ;;
8680 rp='Pathname where the site-specific library html pages should be installed?'
8683 sitehtml3direxp="$ansexp"
8684 : Change installation prefix, if necessary.
8685 if $test X"$prefix" != X"$installprefix"; then
8686 installsitehtml3dir=`echo $sitehtml3direxp | $sed "s#^$prefix#$installprefix#"`
8688 installsitehtml3dir="$sitehtml3direxp"
8691 : determine where add-on manual pages go
8692 case "$siteman1dir" in
8693 '') dflt=`echo $man1dir | $sed "s#^$prefix#$siteprefix#"` ;;
8694 *) dflt=$siteman1dir ;;
8697 ''|' ') dflt=none ;;
8700 rp='Pathname where the site-specific manual pages should be installed?'
8703 siteman1direxp="$ansexp"
8704 : Change installation prefix, if necessary.
8705 if $test X"$prefix" != X"$installprefix"; then
8706 installsiteman1dir=`echo $siteman1direxp | $sed "s#^$prefix#$installprefix#"`
8708 installsiteman1dir="$siteman1direxp"
8711 : determine where add-on library man pages go
8712 case "$siteman3dir" in
8713 '') dflt=`echo $man3dir | $sed "s#^$prefix#$siteprefix#"` ;;
8714 *) dflt=$siteman3dir ;;
8717 ''|' ') dflt=none ;;
8720 rp='Pathname where the site-specific library manual pages should be installed?'
8723 siteman3direxp="$ansexp"
8724 : Change installation prefix, if necessary.
8725 if $test X"$prefix" != X"$installprefix"; then
8726 installsiteman3dir=`echo $siteman3direxp | $sed "s#^$prefix#$installprefix#"`
8728 installsiteman3dir="$siteman3direxp"
8731 : determine where add-on public executable scripts go
8732 case "$sitescript" in
8733 '') dflt=$siteprefix/script
8734 $test -d $dflt || dflt=$sitebin ;;
8735 *) dflt="$sitescript" ;;
8738 rp='Pathname where add-on public executable scripts should be installed?'
8741 sitescriptexp="$ansexp"
8742 : Change installation prefix, if necessary.
8743 if $test X"$prefix" != X"$installprefix"; then
8744 installsitescript=`echo $sitescriptexp | sed "s#^$prefix#$installprefix#"`
8746 installsitescript="$sitescriptexp"
8749 case "$usefaststdio" in
8750 $define|true|[yY]*|'')
8751 xversion=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
8761 Perl can be built to use 'fast stdio', which means using the stdio
8762 library but also directly manipulating the stdio buffers to enable
8763 faster I/O. Using stdio is better for backward compatibility (especially
8764 for Perl extensions), but on the other hand since Perl 5.8 the 'perlio'
8765 interface has been preferred instead of stdio.
8767 If this doesn't make any sense to you, just accept the default '$dflt'.
8769 rp='Use the "fast stdio" if available?'
8772 y|Y) val="$define" ;;
8779 : define an is-a-typedef? function
8780 typedef='type=$1; var=$2; def=$3; shift; shift; shift; inclist=$@;
8782 "") inclist="sys/types.h";;
8784 eval "varval=\$$var";
8788 for inc in $inclist; do
8789 echo "#include <$inc>" >>temp.c;
8791 echo "#ifdef $type" >> temp.c;
8792 echo "printf(\"We have $type\");" >> temp.c;
8793 echo "#endif" >> temp.c;
8794 $cppstdin $cppflags $cppminus < temp.c >temp.E 2>/dev/null;
8795 if $contains $type temp.E >/dev/null 2>&1; then
8801 *) eval "$var=\$varval";;
8804 : define an is-a-typedef? function that prompts if the type is not available.
8805 typedef_ask='type=$1; var=$2; def=$3; shift; shift; shift; inclist=$@;
8807 "") inclist="sys/types.h";;
8809 eval "varval=\$$var";
8813 for inc in $inclist; do
8814 echo "#include <$inc>" >>temp.c;
8816 echo "#ifdef $type" >> temp.c;
8817 echo "printf(\"We have $type\");" >> temp.c;
8818 echo "#endif" >> temp.c;
8819 $cppstdin $cppflags $cppminus < temp.c >temp.E 2>/dev/null;
8821 echo "$rp" | $sed -e "s/What is/Looking for/" -e "s/?/./";
8822 if $contains $type temp.E >/dev/null 2>&1; then
8823 echo "$type found." >&4;
8826 echo "$type NOT found." >&4;
8832 *) eval "$var=\$varval";;
8835 : see what type lseek is declared as in the kernel
8836 rp="What is the type used for lseek's offset on this system?"
8837 set off_t lseektype long stdio.h sys/types.h
8841 echo "Checking to see how big your file offsets are..." >&4
8843 #include <sys/types.h>
8847 printf("%d\n", (int)sizeof($lseektype));
8852 if eval $compile_ok; then
8853 lseeksize=`$run ./try`
8854 echo "Your file offsets are $lseeksize bytes long."
8858 echo "(I can't seem to compile the test program. Guessing...)"
8859 rp="What is the size of your file offsets (in bytes)?"
8865 : see what type file positions are declared as in the library
8866 rp="What is the type for file position used by fsetpos()?"
8867 set fpos_t fpostype long stdio.h sys/types.h
8872 *_t) zzz="$fpostype" ;;
8875 echo "Checking the size of $zzz..." >&4
8877 #include <sys/types.h>
8884 printf("%d\n", (int)sizeof($fpostype));
8889 if eval $compile_ok; then
8893 echo "(I can't execute the test program--guessing $fpossize.)" >&4
8896 echo "Your $zzz is $fpossize bytes long."
8902 echo "(I can't compile the test program. Guessing...)" >&4
8903 rp="What is the size of your file positions (in bytes)?"
8908 # Backward compatibility (uselfs is deprecated).
8910 "$define"|true|[yY]*)
8913 *** Configure -Duselfs is deprecated, using -Duselargefiles instead.
8915 uselargefiles="$define"
8919 case "$lseeksize:$fpossize" in
8922 You can have files larger than 2 gigabytes.
8925 *) case "$uselargefiles" in
8926 "$undef"|false|[nN]*) dflt='n' ;;
8931 Perl can be built to understand large files (files larger than 2 gigabytes)
8932 on some systems. To do so, Configure can be run with -Duselargefiles.
8934 If this doesn't make any sense to you, just accept the default '$dflt'.
8936 rp='Try to understand large files, if available?'
8939 y|Y) val="$define" ;;
8946 : Look for a hint-file generated 'call-back-unit'. If the
8947 : user has specified that a large files perl is to be built,
8948 : we may need to set or change some other defaults.
8949 if $test -f uselargefiles.cbu; then
8950 echo "Your platform has some specific hints regarding large file builds, using them..."
8951 . ./uselargefiles.cbu
8953 case "$uselargefiles" in
8955 if $test -f uselargefiles.cbu; then
8957 echo "Rechecking to see how big your file offsets are..." >&4
8959 #include <sys/types.h>
8963 printf("%d\n", (int)sizeof($lseektype));
8968 if eval $compile_ok; then
8969 lseeksize=`$run ./try`
8970 $echo "Your file offsets are now $lseeksize bytes long."
8974 echo "(I can't seem to compile the test program. Guessing...)"
8975 rp="What is the size of your file offsets (in bytes)?"
8980 *_t) zzz="$fpostype" ;;
8983 $echo $n "Rechecking the size of $zzz...$c" >&4
8985 #include <sys/types.h>
8992 printf("%d\n", (int)sizeof($fpostype));
8997 if eval $compile_ok; then
9002 echo "(I can't execute the test program--guessing $fpossize.)" >&4
9005 echo " $fpossize bytes." >&4
9011 echo "(I can't compile the test program. Guessing...)" >&4
9012 rp="What is the size of your file positions (in bytes)?"
9021 # probably will refer to
9022 # $archlib $privlib $sitearch $sitelib $vendorarch $vendorlib
9024 userelocatableinc=undef
9026 case "$vendorprefix" in
9027 '') d_vendorbin="$undef"
9031 *) d_vendorbin="$define"
9032 : determine where vendor-supplied executables go.
9033 case "$vendorbin" in
9034 '') dflt=$vendorprefix/bin ;;
9035 *) dflt="$vendorbin" ;;
9038 rp='Pathname for the vendor-supplied executables directory?'
9041 vendorbinexp="$ansexp"
9044 : Change installation prefix, if necessary.
9045 if $test X"$prefix" != X"$installprefix"; then
9046 installvendorbin=`echo $vendorbinexp | $sed "s#^$prefix#$installprefix#"`
9048 installvendorbin="$vendorbinexp"
9051 case "$vendorprefix" in
9052 '') vendorhtml1dir=''
9053 vendorhtml1direxp=''
9055 *) : determine where vendor-supplied html pages go.
9056 : There is no standard location, so try to copy the previously-selected
9057 : directory structure for the core html pages.
9058 : XXX Better default suggestions would be welcome.
9059 case "$vendorhtml1dir" in
9060 '') dflt=`echo "$html1dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
9061 *) dflt=$vendorhtml1dir ;;
9064 ''|' ') dflt=none ;;
9067 rp='Pathname for the vendor-supplied html pages?'
9069 vendorhtml1dir="$ans"
9070 vendorhtml1direxp="$ansexp"
9073 : Use ' ' for none so value is preserved next time through Configure
9074 $test X"$vendorhtml1dir" = "X" && vendorhtml1dir=' '
9075 : Change installation prefix, if necessary.
9076 if $test X"$prefix" != X"$installprefix"; then
9077 installvendorhtml1dir=`echo $vendorhtml1direxp | $sed "s#^$prefix#$installprefix#"`
9079 installvendorhtml1dir="$vendorhtml1direxp"
9082 case "$vendorprefix" in
9083 '') vendorhtml3dir=''
9084 vendorhtml3direxp=''
9086 *) : determine where vendor-supplied module html pages go.
9087 : There is no standard location, so try to copy the previously-selected
9088 : directory structure for the core html pages.
9089 : XXX Better default suggestions would be welcome.
9090 case "$vendorhtml3dir" in
9091 '') dflt=`echo "$html3dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
9092 *) dflt=$vendorhtml3dir ;;
9095 ''|' ') dflt=none ;;
9098 rp='Pathname for the vendor-supplied html pages?'
9100 vendorhtml3dir="$ans"
9101 vendorhtml3direxp="$ansexp"
9104 : Use ' ' for none so value is preserved next time through Configure
9105 $test X"$vendorhtml3dir" = "X" && vendorhtml3dir=' '
9106 : Change installation prefix, if necessary.
9107 if $test X"$prefix" != X"$installprefix"; then
9108 installvendorhtml3dir=`echo $vendorhtml3direxp | $sed "s#^$prefix#$installprefix#"`
9110 installvendorhtml3dir="$vendorhtml3direxp"
9113 case "$vendorprefix" in
9114 '') vendorman1dir=''
9117 *) : determine where vendor-supplied manual pages go.
9118 case "$vendorman1dir" in
9119 '') dflt=`echo "$man1dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
9120 *) dflt=$vendorman1dir ;;
9123 ''|' ') dflt=none ;;
9126 rp='Pathname for the vendor-supplied manual section 1 pages?'
9128 vendorman1dir="$ans"
9129 vendorman1direxp="$ansexp"
9132 : Use ' ' for none so value is preserved next time through Configure
9133 $test X"$vendorman1dir" = "X" && vendorman1dir=' '
9134 : Change installation prefix, if necessary.
9135 if $test X"$prefix" != X"$installprefix"; then
9136 installvendorman1dir=`echo "$vendorman1direxp" | $sed "s#^$prefix#$installprefix#"`
9138 installvendorman1dir="$vendorman1direxp"
9141 case "$vendorprefix" in
9142 '') vendorman3dir=''
9145 *) : determine where vendor-supplied module manual pages go.
9146 case "$vendorman3dir" in
9147 '') dflt=`echo "$man3dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
9148 *) dflt=$vendorman3dir ;;
9151 ''|' ') dflt=none ;;
9154 rp='Pathname for the vendor-supplied manual section 3 pages?'
9156 vendorman3dir="$ans"
9157 vendorman3direxp="$ansexp"
9160 : Use ' ' for none so value is preserved next time through Configure
9161 $test X"$vendorman3dir" = "X" && vendorman3dir=' '
9162 : Change installation prefix, if necessary.
9163 if $test X"$prefix" != X"$installprefix"; then
9164 installvendorman3dir=`echo "$vendorman3direxp" | $sed "s#^$prefix#$installprefix#"`
9166 installvendorman3dir="$vendorman3direxp"
9169 case "$vendorprefix" in
9170 '') d_vendorscript="$undef"
9174 *) d_vendorscript="$define"
9175 : determine where vendor-supplied scripts go.
9176 case "$vendorscript" in
9177 '') dflt=$vendorprefix/script
9178 $test -d $dflt || dflt=$vendorbin ;;
9179 *) dflt="$vendorscript" ;;
9183 The installation process will create a directory for
9184 vendor-supplied scripts.
9188 rp='Pathname for the vendor-supplied scripts directory?'
9191 vendorscriptexp="$ansexp"
9194 : Change installation prefix, if necessary.
9195 if $test X"$prefix" != X"$installprefix"; then
9196 installvendorscript=`echo $vendorscriptexp | $sed "s#^$prefix#$installprefix#"`
9198 installvendorscript="$vendorscriptexp"
9201 : see if qgcvt exists
9207 if $test X"$d_longdbl" = X"$define"; then
9209 echo "Checking how to print long doubles..." >&4
9211 if $test X"$sPRIfldbl" = X -a X"$doublesize" = X"$longdblsize"; then
9212 $cat >try.c <<'EOCP'
9213 #include <sys/types.h>
9217 printf("%.3f\n", d);
9221 if eval $compile; then
9225 sPRIfldbl='"f"'; sPRIgldbl='"g"'; sPRIeldbl='"e"';
9226 sPRIFUldbl='"F"'; sPRIGUldbl='"G"'; sPRIEUldbl='"E"';
9227 echo "We will use %f."
9233 if $test X"$sPRIfldbl" = X; then
9234 $cat >try.c <<'EOCP'
9235 #include <sys/types.h>
9238 long double d = 123.456;
9239 printf("%.3Lf\n", d);
9243 if eval $compile; then
9247 sPRIfldbl='"Lf"'; sPRIgldbl='"Lg"'; sPRIeldbl='"Le"';
9248 sPRIFUldbl='"LF"'; sPRIGUldbl='"LG"'; sPRIEUldbl='"LE"';
9249 echo "We will use %Lf."
9255 if $test X"$sPRIfldbl" = X; then
9256 $cat >try.c <<'EOCP'
9257 #include <sys/types.h>
9260 long double d = 123.456;
9261 printf("%.3llf\n", d);
9265 if eval $compile; then
9269 sPRIfldbl='"llf"'; sPRIgldbl='"llg"'; sPRIeldbl='"lle"';
9270 sPRIFUldbl='"llF"'; sPRIGUldbl='"llG"'; sPRIEUldbl='"llE"';
9271 echo "We will use %llf."
9277 if $test X"$sPRIfldbl" = X; then
9278 $cat >try.c <<'EOCP'
9279 #include <sys/types.h>
9282 long double d = 123.456;
9283 printf("%.3lf\n", d);
9287 if eval $compile; then
9291 sPRIfldbl='"lf"'; sPRIgldbl='"lg"'; sPRIeldbl='"le"';
9292 sPRIFUldbl='"lF"'; sPRIGUldbl='"lG"'; sPRIEUldbl='"lE"';
9293 echo "We will use %lf."
9299 if $test X"$sPRIfldbl" = X; then
9300 echo "Cannot figure out how to print long doubles." >&4
9302 sSCNfldbl=$sPRIfldbl # expect consistency
9309 case "$sPRIfldbl" in
9310 '') d_PRIfldbl="$undef"; d_PRIgldbl="$undef"; d_PRIeldbl="$undef";
9311 d_PRIFUldbl="$undef"; d_PRIGUldbl="$undef"; d_PRIEUldbl="$undef";
9312 d_SCNfldbl="$undef";
9314 *) d_PRIfldbl="$define"; d_PRIgldbl="$define"; d_PRIeldbl="$define";
9315 d_PRIFUldbl="$define"; d_PRIGUldbl="$define"; d_PRIEUldbl="$define";
9316 d_SCNfldbl="$define";
9320 : Check how to convert floats to strings.
9322 if test "X$d_Gconvert" = X; then
9325 echo "Checking for an efficient way to convert floats to strings."
9327 case "$uselongdouble" in
9328 "$define") echo "#define USE_LONG_DOUBLE" >>try.c ;;
9330 case "$d_longdbl" in
9331 "$define") echo "#define HAS_LONG_DOUBLE" >>try.c ;;
9333 case "$d_PRIgldbl" in
9334 "$define") echo "#define HAS_PRIgldbl" >>try.c ;;
9338 #define Gconvert(x,n,t,b) gconvert((x),(n),(t),(b))
9339 char *myname = "gconvert";
9342 #define Gconvert(x,n,t,b) gcvt((x),(n),(b))
9343 char *myname = "gcvt";
9346 #define Gconvert(x,n,t,b) qgcvt((x),(n),(b))
9347 char *myname = "qgcvt";
9348 #define DOUBLETYPE long double
9351 #if defined(USE_LONG_DOUBLE) && defined(HAS_LONG_DOUBLE)
9353 #define Gconvert(x,n,t,b) sprintf((b),"%.*"$sPRIgldbl,(n),(x))
9355 #define Gconvert(x,n,t,b) sprintf((b),"%.*g",(n),(double)(x))
9358 #define Gconvert(x,n,t,b) sprintf((b),"%.*g",(n),(x))
9360 char *myname = "sprintf";
9364 #if defined(USE_LONG_DOUBLE) && defined(HAS_LONG_DOUBLE)
9365 #define DOUBLETYPE long double
9367 #define DOUBLETYPE double
9373 #define I_STDLIB $i_stdlib
9379 checkit(expect, got)
9383 if (strcmp(expect, got)) {
9384 printf("%s oddity: Expected %s, got %s\n",
9385 myname, expect, got);
9395 /* This must be 1st test on (which?) platform */
9396 /* Alan Burlison <AlanBurlsin@unn.unisys.com> */
9397 Gconvert((DOUBLETYPE)0.1, 8, 0, buf);
9398 checkit("0.1", buf);
9400 Gconvert((DOUBLETYPE)0.01, 8, 0, buf);
9401 checkit("0.01", buf);
9403 Gconvert((DOUBLETYPE)0.001, 8, 0, buf);
9404 checkit("0.001", buf);
9406 Gconvert((DOUBLETYPE)0.0001, 8, 0, buf);
9407 checkit("0.0001", buf);
9409 Gconvert((DOUBLETYPE)0.00009, 8, 0, buf);
9410 if (strlen(buf) > 5)
9411 checkit("9e-005", buf); /* for Microsoft ?? */
9413 checkit("9e-05", buf);
9415 Gconvert((DOUBLETYPE)1.0, 8, 0, buf);
9418 Gconvert((DOUBLETYPE)1.1, 8, 0, buf);
9419 checkit("1.1", buf);
9421 Gconvert((DOUBLETYPE)1.01, 8, 0, buf);
9422 checkit("1.01", buf);
9424 Gconvert((DOUBLETYPE)1.001, 8, 0, buf);
9425 checkit("1.001", buf);
9427 Gconvert((DOUBLETYPE)1.0001, 8, 0, buf);
9428 checkit("1.0001", buf);
9430 Gconvert((DOUBLETYPE)1.00001, 8, 0, buf);
9431 checkit("1.00001", buf);
9433 Gconvert((DOUBLETYPE)1.000001, 8, 0, buf);
9434 checkit("1.000001", buf);
9436 Gconvert((DOUBLETYPE)0.0, 8, 0, buf);
9439 Gconvert((DOUBLETYPE)-1.0, 8, 0, buf);
9442 /* Some Linux gcvt's give 1.e+5 here. */
9443 Gconvert((DOUBLETYPE)100000.0, 8, 0, buf);
9444 checkit("100000", buf);
9446 /* Some Linux gcvt's give -1.e+5 here. */
9447 Gconvert((DOUBLETYPE)-100000.0, 8, 0, buf);
9448 checkit("-100000", buf);
9450 Gconvert((DOUBLETYPE)123.456, 8, 0, buf);
9451 checkit("123.456", buf);
9453 /* Testing of 1e+129 in bigintpm.t must not get extra '.' here. */
9454 Gconvert((DOUBLETYPE)1e34, 8, 0, buf);
9455 /* 34 should be enough to scare even long double
9456 * places into using the e notation. */
9457 if (strlen(buf) > 5)
9458 checkit("1e+034", buf); /* for Microsoft */
9460 checkit("1e+34", buf);
9462 /* For Perl, if you add additional tests here, also add them to
9463 * t/base/num.t for benefit of platforms not using Configure or
9464 * overriding d_Gconvert */
9469 : first add preferred functions to our list
9471 for xxx_convert in $gconvert_preference; do
9472 case $xxx_convert in
9473 gcvt|gconvert|sprintf) xxx_list="$xxx_list $xxx_convert" ;;
9474 *) echo "Discarding unrecognized gconvert_preference $xxx_convert" >&4 ;;
9477 : then add any others
9478 for xxx_convert in gconvert gcvt sprintf; do
9481 *) xxx_list="$xxx_list $xxx_convert" ;;
9485 case "$d_longdbl$uselongdouble" in
9487 : again, add prefered functions to our list first
9489 for xxx_convert in $gconvert_ld_preference; do
9490 case $xxx_convert in
9491 qgcvt|gcvt|gconvert|sprintf) xxx_ld_list="$xxx_ld_list $xxx_convert" ;;
9492 *) echo "Discarding unrecognized gconvert_ld_preference $xxx_convert" ;;
9495 : then add qgcvt, sprintf--then, in xxx_list order, gconvert and gcvt
9496 for xxx_convert in qgcvt sprintf $xxx_list; do
9497 case "$xxx_ld_list" in
9498 $xxx_convert*|*" $xxx_convert"*) ;;
9499 *) xxx_ld_list="$xxx_ld_list $xxx_convert" ;;
9502 : if sprintf cannot do long doubles, move it to the end
9503 if test "$d_PRIgldbl" != "$define"; then
9504 xxx_ld_list="`echo $xxx_ld_list|sed s/sprintf//` sprintf"
9506 : if no qgcvt, remove it
9507 if test "$d_qgcvt" != "$define"; then
9508 xxx_ld_list="`echo $xxx_ld_list|sed s/qgcvt//`"
9511 xxx_list="$xxx_ld_list"
9515 for xxx_convert in $xxx_list; do
9516 echo "Trying $xxx_convert..."
9518 set try -DTRY_$xxx_convert
9519 if eval $compile; then
9520 echo "$xxx_convert() found." >&4
9522 echo "I'll use $xxx_convert to convert floats into a string." >&4
9525 echo "...But $xxx_convert didn't work as I expected."
9529 echo "$xxx_convert NOT found." >&4
9533 if test X$xxx_convert = X; then
9534 echo "*** WHOA THERE!!! ***" >&4
9535 echo "None of ($xxx_list) seemed to work properly. I'll use sprintf." >&4
9539 case "$xxx_convert" in
9540 gconvert) d_Gconvert='gconvert((x),(n),(t),(b))' ;;
9541 gcvt) d_Gconvert='gcvt((x),(n),(b))' ;;
9542 qgcvt) d_Gconvert='qgcvt((x),(n),(b))' ;;
9543 *) case "$uselongdouble$d_longdbl$d_PRIgldbl" in
9544 "$define$define$define")
9545 d_Gconvert="sprintf((b),\"%.*\"$sPRIgldbl,(n),(x))" ;;
9546 "$define$define$undef")
9547 d_Gconvert='sprintf((b),"%.*g",(n),(double)(x))' ;;
9548 *) d_Gconvert='sprintf((b),"%.*g",(n),(x))' ;;
9555 : see if _fwalk exists
9559 : Initialize h_fcntl
9562 : Initialize h_sysfile
9565 : access call always available on UNIX
9569 : locate the flags for 'access()'
9573 $cat >access.c <<EOCP
9574 #include <sys/types.h>
9579 #include <sys/file.h>
9592 : check sys/file.h first, no particular reason here
9593 if $test `./findhdr sys/file.h` && \
9594 $cc -o access $cppflags -DI_SYS_FILE access.c >/dev/null 2>&1 ; then
9596 echo "<sys/file.h> defines the *_OK access constants." >&4
9597 elif $test `./findhdr fcntl.h` && \
9598 $cc -o access $cppflags -DI_FCNTL access.c >/dev/null 2>&1 ; then
9600 echo "<fcntl.h> defines the *_OK access constants." >&4
9601 elif $test `./findhdr unistd.h` && \
9602 $cc -o access $cppflags -DI_UNISTD access.c >/dev/null 2>&1 ; then
9603 echo "<unistd.h> defines the *_OK access constants." >&4
9605 echo "I can't find the four *_OK access constants--I'll use mine." >&4
9611 : see if accessx exists
9612 set accessx d_accessx
9615 : see if aintl exists
9619 : see if alarm exists
9623 : see if POSIX threads are available
9624 set pthread.h i_pthread
9627 : define a fucntion to check prototypes
9628 $cat > protochk <<EOSH
9631 optimize="$optimize"
9633 prototype="$prototype"
9636 usethreads=$usethreads
9637 i_pthread=$i_pthread
9638 pthread_h_first=$pthread_h_first
9641 $cat >> protochk <<'EOSH'
9646 while test $# -ge 2; do
9648 $define) echo "#include <$2>" >> try.c ;;
9649 literal) echo "$2" >> try.c ;;
9651 # Extra magic for the benefit of systems that need pthread.h
9652 # to be included early to correctly detect threadsafe functions.
9653 # Such functions must guarantee themselves, though, that the usethreads
9654 # and i_pthread have been defined, before calling protochk.
9655 if test "$usethreads" = "$define" -a "$i_pthread" = "$define" -a "$pthread_h_first" = "$define" -a "$pthread_h_done" = ""; then
9656 echo "#include <pthread.h>" >> try.c
9661 test "$prototype" = "$define" && echo '#define CAN_PROTOTYPE' >> try.c
9662 cat >> try.c <<'EOCP'
9663 #ifdef CAN_PROTOTYPE
9664 #define _(args) args
9669 echo "$foo" >> try.c
9670 echo 'int no_real_function_has_this_name _((void)) { return 0; }' >> try.c
9671 $cc $optimize $ccflags -c try.c > /dev/null 2>&1
9679 hasproto='varname=$1; func=$2; shift; shift;
9680 while $test $# -ge 2; do
9682 $define) echo "#include <$2>";;
9686 $cppstdin $cppflags $cppminus < try.c > tryout.c 2>/dev/null;
9687 if $contains "$func.*(" tryout.c >/dev/null 2>&1; then
9688 echo "$func() prototype found.";
9691 echo "$func() prototype NOT found.";
9696 $rm -f try.c tryout.c'
9698 : see if sys/types.h has to be included
9699 set sys/types.h i_systypes
9702 : see if sys/select.h has to be included
9703 set sys/select.h i_sysselct
9706 hasfield='varname=$1; struct=$2; field=$3; shift; shift; shift;
9707 while $test $# -ge 2; do
9709 $define) echo "#include <$2>";;
9713 echo "int main () { struct $struct foo; char* bar; bar = (char*)foo.$field; }" >> try.c;
9715 if eval $compile; then
9724 : see if we should include time.h, sys/time.h, or both
9726 if test "X$timeincl" = X; then
9727 echo "Testing to see if we should include <time.h>, <sys/time.h> or both." >&4
9728 $echo $n "I'm now running the test program...$c"
9730 #include <sys/types.h>
9735 #ifdef SYSTIMEKERNEL
9738 #include <sys/time.h>
9741 #include <sys/select.h>
9754 struct timezone tzp;
9756 if (foo.tm_sec == foo.tm_sec)
9759 if (bar.tv_sec == bar.tv_sec)
9766 for s_timezone in '-DS_TIMEZONE' ''; do
9768 for s_timeval in '-DS_TIMEVAL' ''; do
9769 for i_systimek in '' '-DSYSTIMEKERNEL'; do
9770 for i_time in '' '-DI_TIME'; do
9771 for i_systime in '-DI_SYSTIME' ''; do
9774 set try $i_time $i_systime $i_systimek $sysselect $s_timeval $s_timezone
9775 if eval $compile; then
9776 set X $i_time $i_systime $i_systimek $sysselect $s_timeval
9780 $echo $n "Succeeded with $flags$c"
9792 *SYSTIMEKERNEL*) i_systimek="$define"
9793 timeincl=`./findhdr sys/time.h`
9794 echo "We'll include <sys/time.h> with KERNEL defined." >&4;;
9795 *) i_systimek="$undef";;
9798 *I_TIME*) i_time="$define"
9799 timeincl=`./findhdr time.h`" $timeincl"
9800 echo "We'll include <time.h>." >&4;;
9801 *) i_time="$undef";;
9804 *I_SYSTIME*) i_systime="$define"
9805 timeincl=`./findhdr sys/time.h`" $timeincl"
9806 echo "We'll include <sys/time.h>." >&4;;
9807 *) i_systime="$undef";;
9811 : see if struct tm knows about tm_zone
9812 case "$i_systime$i_time" in
9815 echo "Checking to see if your struct tm has tm_zone field..." >&4
9816 set d_tm_tm_zone tm tm_zone $i_systime sys/time.h $i_time time.h
9824 case "$d_tm_tm_zone" in
9825 "$define") echo "Yes, it does." ;;
9826 *) echo "No, it doesn't." ;;
9828 : see if struct tm knows about tm_gmtoff
9829 case "$i_systime$i_time" in
9832 echo "Checking to see if your struct tm has tm_gmtoff field..." >&4
9833 set d_tm_tm_gmtoff tm tm_gmtoff $i_systime sys/time.h $i_time time.h
9841 case "$d_tm_tm_gmtoff" in
9842 "$define") echo "Yes, it does." ;;
9843 *) echo "No, it doesn't." ;;
9846 : see if asctime_r exists
9847 set asctime_r d_asctime_r
9849 case "$d_asctime_r" in
9851 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
9852 case "$d_asctime_r_proto:$usethreads" in
9853 ":define") d_asctime_r_proto=define
9854 set d_asctime_r_proto asctime_r $hdrs
9858 case "$d_asctime_r_proto" in
9860 case "$asctime_r_proto" in
9861 ''|0) try='char* asctime_r(const struct tm*, char*);'
9862 ./protochk "extern $try" $hdrs && asctime_r_proto=B_SB ;;
9864 case "$asctime_r_proto" in
9865 ''|0) try='char* asctime_r(const struct tm*, char*, int);'
9866 ./protochk "extern $try" $hdrs && asctime_r_proto=B_SBI ;;
9868 case "$asctime_r_proto" in
9869 ''|0) try='int asctime_r(const struct tm*, char*);'
9870 ./protochk "extern $try" $hdrs && asctime_r_proto=I_SB ;;
9872 case "$asctime_r_proto" in
9873 ''|0) try='int asctime_r(const struct tm*, char*, int);'
9874 ./protochk "extern $try" $hdrs && asctime_r_proto=I_SBI ;;
9876 case "$asctime_r_proto" in
9877 ''|0) d_asctime_r=undef
9879 echo "Disabling asctime_r, cannot determine prototype." >&4 ;;
9880 * ) case "$asctime_r_proto" in
9881 REENTRANT_PROTO*) ;;
9882 *) asctime_r_proto="REENTRANT_PROTO_$asctime_r_proto" ;;
9884 echo "Prototype: $try" ;;
9887 *) case "$usethreads" in
9888 define) echo "asctime_r has no prototype, not using it." >&4 ;;
9895 *) asctime_r_proto=0
9899 : see if atolf exists
9903 : see if atoll exists
9907 : Look for GCC-style attribute format
9908 case "$d_attribute_format" in
9911 echo "Checking whether your compiler can handle __attribute__((format)) ..." >&4
9912 $cat >attrib.c <<'EOCP'
9914 void my_special_printf(char* pat,...) __attribute__((__format__(__printf__,1,2)));
9916 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
9917 if $contains 'warning' attrib.out >/dev/null 2>&1; then
9918 echo "Your C compiler doesn't support __attribute__((format))."
9921 echo "Your C compiler supports __attribute__((format))."
9925 echo "Your C compiler doesn't seem to understand __attribute__ at all."
9929 *) val="$d_attribute_format" ;;
9931 set d_attribute_format
9935 : Look for GCC-style attribute malloc
9936 case "$d_attribute_malloc" in
9939 echo "Checking whether your compiler can handle __attribute__((malloc)) ..." >&4
9940 $cat >attrib.c <<'EOCP'
9942 char *go_get_some_memory( int how_many_bytes ) __attribute__((malloc));
9944 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
9945 if $contains 'warning' attrib.out >/dev/null 2>&1; then
9946 echo "Your C compiler doesn't support __attribute__((malloc))."
9949 echo "Your C compiler supports __attribute__((malloc))."
9953 echo "Your C compiler doesn't seem to understand __attribute__ at all."
9957 *) val="$d_attribute_malloc" ;;
9959 set d_attribute_malloc
9963 : Look for GCC-style attribute nonnull
9964 case "$d_attribute_nonnull" in
9967 echo "Checking whether your compiler can handle __attribute__((nonnull(1))) ..." >&4
9968 $cat >attrib.c <<'EOCP'
9970 void do_something (char *some_pointer,...) __attribute__((nonnull(1)));
9972 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
9973 if $contains 'warning' attrib.out >/dev/null 2>&1; then
9974 echo "Your C compiler doesn't support __attribute__((nonnull))."
9977 echo "Your C compiler supports __attribute__((nonnull))."
9981 echo "Your C compiler doesn't seem to understand __attribute__ at all."
9985 *) val="$d_attribute_nonnull" ;;
9987 set d_attribute_nonnull
9991 : Look for GCC-style attribute noreturn
9992 case "$d_attribute_noreturn" in
9995 echo "Checking whether your compiler can handle __attribute__((noreturn)) ..." >&4
9996 $cat >attrib.c <<'EOCP'
9998 void fall_over_dead( void ) __attribute__((noreturn));
10000 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10001 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10002 echo "Your C compiler doesn't support __attribute__((noreturn))."
10005 echo "Your C compiler supports __attribute__((noreturn))."
10009 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10013 *) val="$d_attribute_noreturn" ;;
10015 set d_attribute_noreturn
10019 : Look for GCC-style attribute pure
10020 case "$d_attribute_pure" in
10023 echo "Checking whether your compiler can handle __attribute__((pure)) ..." >&4
10024 $cat >attrib.c <<'EOCP'
10026 int square( int n ) __attribute__((pure));
10028 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10029 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10030 echo "Your C compiler doesn't support __attribute__((pure))."
10033 echo "Your C compiler supports __attribute__((pure))."
10037 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10041 *) val="$d_attribute_pure" ;;
10043 set d_attribute_pure
10047 : Look for GCC-style attribute unused
10048 case "$d_attribute_unused" in
10051 echo "Checking whether your compiler can handle __attribute__((unused)) ..." >&4
10052 $cat >attrib.c <<'EOCP'
10054 int do_something( int dummy __attribute__((unused)), int n );
10056 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10057 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10058 echo "Your C compiler doesn't support __attribute__((unused))."
10061 echo "Your C compiler supports __attribute__((unused))."
10065 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10069 *) val="$d_attribute_unused" ;;
10071 set d_attribute_unused
10075 : Look for GCC-style attribute warn_unused_result
10076 case "$d_attribute_warn_unused_result" in
10079 echo "Checking whether your compiler can handle __attribute__((warn_unused_result)) ..." >&4
10080 $cat >attrib.c <<'EOCP'
10082 int I_will_not_be_ignored(void) __attribute__((warn_unused_result));
10084 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10085 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10086 echo "Your C compiler doesn't support __attribute__((warn_unused_result))."
10089 echo "Your C compiler supports __attribute__((warn_unused_result))."
10093 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10097 *) val="$d_attribute_warn_unused_result" ;;
10099 set d_attribute_warn_unused_result
10103 : see if bcmp exists
10107 : see if bcopy exists
10111 : see if this is a unistd.h system
10112 set unistd.h i_unistd
10115 : see if getpgrp exists
10116 set getpgrp d_getpgrp
10119 case "$d_getpgrp" in
10122 echo "Checking to see which flavor of getpgrp is in use..."
10124 #$i_unistd I_UNISTD
10125 #include <sys/types.h>
10127 # include <unistd.h>
10129 #$i_stdlib I_STDLIB
10131 #include <stdlib.h>
10135 if (getuid() == 0) {
10136 printf("(I see you are running Configure as super-user...)\n");
10139 #ifdef TRY_BSD_PGRP
10140 if (getpgrp(1) == 0)
10149 if $cc -o try -DTRY_BSD_PGRP $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
10150 echo "You have to use getpgrp(pid) instead of getpgrp()." >&4
10152 elif $cc -o try $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
10153 echo "You have to use getpgrp() instead of getpgrp(pid)." >&4
10156 echo "I can't seem to compile and run the test program."
10158 xxx="a USG one, i.e. you use getpgrp()."
10160 # SVR4 systems can appear rather BSD-ish.
10161 case "$i_unistd" in
10163 xxx="a BSD one, i.e. you use getpgrp(pid)."
10167 xxx="probably a USG one, i.e. you use getpgrp()."
10172 echo "Assuming your getpgrp is $xxx" >&4
10181 : see if setpgrp exists
10182 set setpgrp d_setpgrp
10185 case "$d_setpgrp" in
10188 echo "Checking to see which flavor of setpgrp is in use..."
10190 #$i_unistd I_UNISTD
10191 #include <sys/types.h>
10193 # include <unistd.h>
10195 #$i_stdlib I_STDLIB
10197 #include <stdlib.h>
10201 if (getuid() == 0) {
10202 printf("(I see you are running Configure as super-user...)\n");
10205 #ifdef TRY_BSD_PGRP
10206 if (-1 == setpgrp(1, 1))
10209 if (setpgrp() != -1)
10215 if $cc -o try -DTRY_BSD_PGRP $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
10216 echo 'You have to use setpgrp(pid,pgrp) instead of setpgrp().' >&4
10218 elif $cc -o try $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
10219 echo 'You have to use setpgrp() instead of setpgrp(pid,pgrp).' >&4
10222 echo "(I can't seem to compile and run the test program.)"
10224 xxx="a USG one, i.e. you use setpgrp()."
10226 # SVR4 systems can appear rather BSD-ish.
10227 case "$i_unistd" in
10229 xxx="a BSD one, i.e. you use setpgrp(pid,pgrp)."
10233 xxx="probably a USG one, i.e. you use setpgrp()."
10238 echo "Assuming your setpgrp is $xxx" >&4
10246 : Look for GCC-style __builtin_choose_expr
10247 case "$d_builtin_choose_expr" in
10250 echo "Checking whether your compiler can handle __builtin_choose_expr ..." >&4
10251 $cat >try.c <<'EOCP'
10252 #include <assert.h>
10253 #include <stdlib.h>
10256 #define SYRINX(x) __builtin_choose_expr( x, (1056*2), (103*50) )
10259 assert( SYRINX(1) == 2112 );
10260 assert( SYRINX(1) != 5150 );
10261 assert( SYRINX(0) == 5150 );
10262 assert( SYRINX(0) != 2112 );
10263 puts( "All good!" );
10269 if eval $compile; then
10270 echo "Your C compiler supports __builtin_choose_expr."
10273 echo "Your C compiler doesn't seem to understand __builtin_choose_expr."
10277 *) val="$d_builtin_choose_expr" ;;
10280 set d_builtin_choose_expr
10282 $rm -f try.* try core core.try.*
10284 : Look for GCC-style __builtin_expect
10285 case "$d_builtin_expect" in
10288 echo "Checking whether your compiler can handle __builtin_expect ..." >&4
10289 $cat >builtin.c <<'EOCP'
10292 if ( __builtin_expect(n, 0) ) n = 1;
10296 if eval $compile; then
10297 echo "Your C compiler supports __builtin_choose_expr."
10300 echo "Your C compiler doesn't seem to understand __builtin_choose_expr."
10304 *) val="$d_builtin_expect" ;;
10307 set d_builtin_expect
10309 $rm -f try.* try core core.try.*
10311 : see if bzero exists
10315 : see if signal is declared as pointer to function returning int or void
10317 xxx=`./findhdr signal.h`
10318 $test "$xxx" && $cppstdin $cppminus $cppflags < $xxx >$$.tmp 2>/dev/null
10319 if $contains 'int.*\*[ ]*signal' $$.tmp >/dev/null 2>&1 ; then
10320 echo "You have int (*signal())() instead of void." >&4
10322 elif $contains 'void.*\*[ ]*signal' $$.tmp >/dev/null 2>&1 ; then
10323 echo "You have void (*signal())()." >&4
10325 elif $contains 'extern[ ]*[(\*]*signal' $$.tmp >/dev/null 2>&1 ; then
10326 echo "You have int (*signal())() instead of void." >&4
10328 elif $contains 'void.*\*.*sig' $$.tmp >/dev/null 2>&1 ; then
10329 echo "You have void (*signal())()." >&4
10332 case "$d_voidsig" in
10334 echo "I can't determine whether signal handler returns void or int..." >&4
10336 rp="What type does your signal handler return?"
10339 v*) val="$define";;
10343 echo "As you already told me, signal handler returns void." >&4
10346 *) echo "As you already told me, signal handler returns int." >&4
10353 case "$d_voidsig" in
10354 "$define") signal_t="void";;
10355 *) signal_t="int";;
10359 : check for ability to cast large floats to 32-bit ints.
10361 echo 'Checking whether your C compiler can cast large floats to int32.' >&4
10362 if $test "$intsize" -ge 4; then
10369 #$i_stdlib I_STDLIB
10371 #include <stdlib.h>
10373 #include <sys/types.h>
10374 #include <signal.h>
10375 $signal_t blech(s) int s; { exit(3); }
10382 signal(SIGFPE, blech);
10384 /* Don't let compiler optimize the test away. Store the number
10385 in a writable string for gcc to pass to sscanf under HP/UX.
10387 sprintf(str, "2147483647");
10388 sscanf(str, "%lf", &f); /* f = (double) 0x7fffffff; */
10392 /* x86 processors will probably give 0x8000 0000, which is a
10393 sign change. We don't want that. We want to mimic SPARC
10394 behavior here, which is to preserve the sign and give
10397 if (i32 != ($xxx) f)
10403 if eval $compile_ok; then
10407 echo "(I can't seem to compile the test program--assuming it can't)"
10412 echo "Yup, it can."
10415 echo "Nope, it can't."
10422 : check for ability to cast negative floats to unsigned
10424 echo 'Checking whether your C compiler can cast negative float to unsigned.' >&4
10427 #$i_stdlib I_STDLIB
10429 #include <stdlib.h>
10431 #include <sys/types.h>
10432 #include <signal.h>
10433 $signal_t blech(s) int s; { exit(7); }
10434 $signal_t blech_in_list(s) int s; { exit(4); }
10435 unsigned long dummy_long(p) unsigned long p; { return p; }
10436 unsigned int dummy_int(p) unsigned int p; { return p; }
10437 unsigned short dummy_short(p) unsigned short p; { return p; }
10441 unsigned long along;
10443 unsigned short ashort;
10447 /* Frustrate gcc-2.7.2's optimizer which failed this test with
10448 a direct f = -123. assignment. gcc-2.8.0 reportedly
10449 optimized the whole file away
10451 /* Store the number in a writable string for gcc to pass to
10452 sscanf under HP/UX.
10454 sprintf(str, "-123");
10455 sscanf(str, "%lf", &f); /* f = -123.; */
10457 signal(SIGFPE, blech);
10458 along = (unsigned long)f;
10459 aint = (unsigned int)f;
10460 ashort = (unsigned short)f;
10461 if (along != (unsigned long)-123)
10463 if (aint != (unsigned int)-123)
10465 if (ashort != (unsigned short)-123)
10467 sprintf(str, "1073741824.");
10468 sscanf(str, "%lf", &f); /* f = (double)0x40000000; */
10471 along = (unsigned long)f;
10472 if (along != 0x80000000)
10476 along = (unsigned long)f;
10477 if (along != 0x7fffffff)
10481 along = (unsigned long)f;
10482 if (along != 0x80000001)
10486 signal(SIGFPE, blech_in_list);
10487 sprintf(str, "123.");
10488 sscanf(str, "%lf", &f); /* f = 123.; */
10489 along = dummy_long((unsigned long)f);
10490 aint = dummy_int((unsigned int)f);
10491 ashort = dummy_short((unsigned short)f);
10492 if (along != (unsigned long)123)
10494 if (aint != (unsigned int)123)
10496 if (ashort != (unsigned short)123)
10503 if eval $compile_ok; then
10507 echo "(I can't seem to compile the test program--assuming it can't)"
10510 case "$castflags" in
10512 echo "Yup, it can."
10515 echo "Nope, it can't."
10522 : see if vprintf exists
10524 if set vprintf val -f d_vprintf; eval $csym; $val; then
10525 echo 'vprintf() found.' >&4
10528 #include <varargs.h>
10529 #$i_stdlib I_STDLIB
10531 #include <stdlib.h>
10534 int main() { xxx("foo"); }
10543 exit((unsigned long)vsprintf(buf,"%s",args) > 10L);
10547 if eval $compile && $run ./try; then
10548 echo "Your vsprintf() returns (int)." >&4
10551 echo "Your vsprintf() returns (char*)." >&4
10555 echo 'vprintf() NOT found.' >&4
10566 : see if chown exists
10570 : see if chroot exists
10571 set chroot d_chroot
10574 : see if chsize exists
10575 set chsize d_chsize
10578 : see if class exists
10582 : see if clearenv exists
10583 set clearenv d_clearenv
10586 hasstruct='varname=$1; struct=$2; shift; shift;
10587 while $test $# -ge 2; do
10589 $define) echo "#include <$2>";;
10593 echo "int main () { struct $struct foo; }" >> try.c;
10595 if eval $compile; then
10602 $rm -f try.c try.o'
10606 : see whether socket exists
10608 $echo $n "Hmm... $c" >&4
10609 if set socket val -f d_socket; eval $csym; $val; then
10610 echo "Looks like you have Berkeley networking support." >&4
10612 if set setsockopt val -f; eval $csym; $val; then
10615 echo "...but it uses the old BSD 4.1c interface, rather than 4.2." >&4
10616 d_oldsock="$define"
10619 if $contains socklib libc.list >/dev/null 2>&1; then
10620 echo "Looks like you have Berkeley networking support." >&4
10622 : we will have to assume that it supports the 4.2 BSD interface
10625 echo "You don't have Berkeley networking in libc$_a..." >&4
10626 if test "X$d_socket" = "X$define"; then
10627 echo "...but you seem to believe that you have sockets." >&4
10629 for net in net socket
10631 if test -f /usr/lib/lib$net$_a; then
10632 ( ($nm $nm_opt /usr/lib/lib$net$_a | eval $nm_extract) || \
10633 $ar t /usr/lib/lib$net$_a) 2>/dev/null >> libc.list
10634 if $contains socket libc.list >/dev/null 2>&1; then
10639 echo "...but the Wollongong group seems to have hacked it in." >&4
10640 sockethdr="-I/usr/netinclude"
10643 echo "Found Berkeley sockets interface in lib$net." >&4
10644 if $contains setsockopt libc.list >/dev/null 2>&1; then
10647 echo "...using the old BSD 4.1c interface, rather than 4.2." >&4
10648 d_oldsock="$define"
10654 if test "X$d_socket" != "X$define"; then
10655 echo "or anywhere else I see." >&4
10663 : see if socketpair exists
10664 set socketpair d_sockpair
10669 echo "Checking the availability of certain socket constants..." >&4
10670 for ENUM in MSG_CTRUNC MSG_DONTROUTE MSG_OOB MSG_PEEK MSG_PROXY SCM_RIGHTS; do
10671 enum=`$echo $ENUM|./tr '[A-Z]' '[a-z]'`
10673 #include <sys/types.h>
10674 #include <sys/socket.h>
10680 set try; if eval $compile; then
10683 set d_${enum}; eval $setvar
10687 : see if this is a sys/uio.h system
10688 set sys/uio.h i_sysuio
10693 echo "Checking to see if your system supports struct cmsghdr..." >&4
10694 set d_cmsghdr_s cmsghdr $i_systypes sys/types.h $d_socket sys/socket.h $i_sysuio sys/uio.h
10696 case "$d_cmsghdr_s" in
10697 "$define") echo "Yes, it does." ;;
10698 *) echo "No, it doesn't." ;;
10702 : check for const keyword
10704 echo 'Checking to see if your C compiler knows about "const"...' >&4
10705 $cat >const.c <<'EOCP'
10706 typedef struct spug { int drokk; } spug;
10713 if $cc -c $ccflags const.c >/dev/null 2>&1 ; then
10715 echo "Yup, it does."
10718 echo "Nope, it doesn't."
10723 : see if copysignl exists
10724 set copysignl d_copysignl
10727 : see if crypt exists
10732 $define) cryptlib='' ;;
10733 *) if set crypt val -f d_crypt; eval $csym; $val; then
10734 echo 'crypt() found.' >&4
10738 cryptlib=`./loc Slibcrypt$_a "" $xlibpth`
10739 if $test -z "$cryptlib"; then
10740 cryptlib=`./loc Mlibcrypt$_a "" $xlibpth`
10744 if $test -z "$cryptlib"; then
10745 cryptlib=`./loc Llibcrypt$_a "" $xlibpth`
10749 if $test -z "$cryptlib"; then
10750 cryptlib=`./loc libcrypt$_a "" $libpth`
10754 if $test -z "$cryptlib"; then
10755 echo 'crypt() NOT found.' >&4
10766 : see if this is a crypt.h system
10767 set crypt.h i_crypt
10770 : see if crypt_r exists
10771 set crypt_r d_crypt_r
10773 case "$d_crypt_r" in
10775 hdrs="$i_systypes sys/types.h define stdio.h $i_crypt crypt.h"
10776 case "$d_crypt_r_proto:$usethreads" in
10777 ":define") d_crypt_r_proto=define
10778 set d_crypt_r_proto crypt_r $hdrs
10782 case "$d_crypt_r_proto" in
10784 case "$crypt_r_proto" in
10785 ''|0) try='char* crypt_r(const char*, const char*, struct crypt_data*);'
10786 ./protochk "extern $try" $hdrs && crypt_r_proto=B_CCS ;;
10788 case "$crypt_r_proto" in
10789 ''|0) try='char* crypt_r(const char*, const char*, CRYPTD*);'
10790 ./protochk "extern $try" $hdrs && crypt_r_proto=B_CCD ;;
10792 case "$crypt_r_proto" in
10793 ''|0) d_crypt_r=undef
10795 echo "Disabling crypt_r, cannot determine prototype." >&4 ;;
10796 * ) case "$crypt_r_proto" in
10797 REENTRANT_PROTO*) ;;
10798 *) crypt_r_proto="REENTRANT_PROTO_$crypt_r_proto" ;;
10800 echo "Prototype: $try" ;;
10803 *) case "$usethreads" in
10804 define) echo "crypt_r has no prototype, not using it." >&4 ;;
10815 : get csh whereabouts
10817 'csh') val="$undef" ;;
10818 *) val="$define" ;;
10822 : Respect a hint or command line value for full_csh.
10823 case "$full_csh" in
10824 '') full_csh=$csh ;;
10827 : see if ctermid_r exists
10828 set ctermid_r d_ctermid_r
10830 case "$d_ctermid_r" in
10832 hdrs="$i_systypes sys/types.h define stdio.h "
10833 case "$d_ctermid_r_proto:$usethreads" in
10834 ":define") d_ctermid_r_proto=define
10835 set d_ctermid_r_proto ctermid_r $hdrs
10839 case "$d_ctermid_r_proto" in
10841 case "$ctermid_r_proto" in
10842 ''|0) try='char* ctermid_r(char*);'
10843 ./protochk "extern $try" $hdrs && ctermid_r_proto=B_B ;;
10845 case "$ctermid_r_proto" in
10846 ''|0) d_ctermid_r=undef
10848 echo "Disabling ctermid_r, cannot determine prototype." >&4 ;;
10849 * ) case "$ctermid_r_proto" in
10850 REENTRANT_PROTO*) ;;
10851 *) ctermid_r_proto="REENTRANT_PROTO_$ctermid_r_proto" ;;
10853 echo "Prototype: $try" ;;
10856 *) case "$usethreads" in
10857 define) echo "ctermid_r has no prototype, not using it." >&4 ;;
10864 *) ctermid_r_proto=0
10868 : see if ctime_r exists
10869 set ctime_r d_ctime_r
10871 case "$d_ctime_r" in
10873 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
10874 case "$d_ctime_r_proto:$usethreads" in
10875 ":define") d_ctime_r_proto=define
10876 set d_ctime_r_proto ctime_r $hdrs
10880 case "$d_ctime_r_proto" in
10882 case "$ctime_r_proto" in
10883 ''|0) try='char* ctime_r(const time_t*, char*);'
10884 ./protochk "extern $try" $hdrs && ctime_r_proto=B_SB ;;
10886 case "$ctime_r_proto" in
10887 ''|0) try='char* ctime_r(const time_t*, char*, int);'
10888 ./protochk "extern $try" $hdrs && ctime_r_proto=B_SBI ;;
10890 case "$ctime_r_proto" in
10891 ''|0) try='int ctime_r(const time_t*, char*);'
10892 ./protochk "extern $try" $hdrs && ctime_r_proto=I_SB ;;
10894 case "$ctime_r_proto" in
10895 ''|0) try='int ctime_r(const time_t*, char*, int);'
10896 ./protochk "extern $try" $hdrs && ctime_r_proto=I_SBI ;;
10898 case "$ctime_r_proto" in
10899 ''|0) d_ctime_r=undef
10901 echo "Disabling ctime_r, cannot determine prototype." >&4 ;;
10902 * ) case "$ctime_r_proto" in
10903 REENTRANT_PROTO*) ;;
10904 *) ctime_r_proto="REENTRANT_PROTO_$ctime_r_proto" ;;
10906 echo "Prototype: $try" ;;
10909 *) case "$usethreads" in
10910 define) echo "ctime_r has no prototype, not using it." >&4 ;;
10921 : see if cuserid exists
10922 set cuserid d_cuserid
10925 : see if this is a limits.h system
10926 set limits.h i_limits
10929 : see if this is a float.h system
10930 set float.h i_float
10933 : See if number of significant digits in a double precision number is known
10935 $cat >dbl_dig.c <<EOM
10936 #$i_limits I_LIMITS
10939 #include <limits.h>
10945 printf("Contains DBL_DIG");
10948 $cppstdin $cppflags $cppminus < dbl_dig.c >dbl_dig.E 2>/dev/null
10949 if $contains 'DBL_DIG' dbl_dig.E >/dev/null 2>&1; then
10950 echo "DBL_DIG found." >&4
10953 echo "DBL_DIG NOT found." >&4
10960 : see if dbm.h is available
10961 : see if dbmclose exists
10962 set dbmclose d_dbmclose
10965 case "$d_dbmclose" in
10975 *) set rpcsvc/dbm.h i_rpcsvcdbm
10980 *) echo "We won't be including <dbm.h>"
10990 : see if prototype for dbminit is available
10992 set d_dbminitproto dbminit $i_dbm dbm.h
10995 : see if difftime exists
10996 set difftime d_difftime
10999 : see if this is a dirent system
11001 if xinc=`./findhdr dirent.h`; $test "$xinc"; then
11003 echo "<dirent.h> found." >&4
11006 if xinc=`./findhdr sys/dir.h`; $test "$xinc"; then
11007 echo "<sys/dir.h> found." >&4
11010 xinc=`./findhdr sys/ndir.h`
11012 echo "<dirent.h> NOT found." >&4
11017 : Look for type of directory structure.
11019 $cppstdin $cppflags $cppminus < "$xinc" > try.c
11021 case "$direntrytype" in
11023 case "$i_dirent" in
11024 $define) guess1='struct dirent' ;;
11025 *) guess1='struct direct' ;;
11028 *) guess1="$direntrytype"
11033 'struct dirent') guess2='struct direct' ;;
11034 *) guess2='struct dirent' ;;
11037 if $contains "$guess1" try.c >/dev/null 2>&1; then
11038 direntrytype="$guess1"
11039 echo "Your directory entries are $direntrytype." >&4
11040 elif $contains "$guess2" try.c >/dev/null 2>&1; then
11041 direntrytype="$guess2"
11042 echo "Your directory entries seem to be $direntrytype." >&4
11044 echo "I don't recognize your system's directory entries." >&4
11045 rp="What type is used for directory entries on this system?"
11048 direntrytype="$ans"
11053 : see if the directory entry stores field length
11055 $cppstdin $cppflags $cppminus < "$xinc" > try.c
11056 if $contains 'd_namlen' try.c >/dev/null 2>&1; then
11057 echo "Good, your directory entry keeps length information in d_namlen." >&4
11060 echo "Your directory entry does not know about the d_namlen field." >&4
11067 : see if this is an sysdir system
11068 set sys/dir.h i_sysdir
11071 : see if this is an sysndir system
11072 set sys/ndir.h i_sysndir
11077 $cat >dirfd.c <<EOM
11079 #$i_stdlib I_STDLIB
11081 #include <stdlib.h>
11083 #$i_dirent I_DIRENT /**/
11084 #$i_sysdir I_SYS_DIR /**/
11085 #$i_sysndir I_SYS_NDIR /**/
11086 #$i_systypes I_SYS_TYPES /**/
11087 #if defined(I_SYS_TYPES)
11088 #include <sys/types.h>
11090 #if defined(I_DIRENT)
11091 #include <dirent.h>
11092 #if defined(NeXT) && defined(I_SYS_DIR) /* NeXT needs dirent + sys/dir.h */
11093 #include <sys/dir.h>
11097 #include <sys/ndir.h>
11101 #include <ndir.h> /* may be wrong in the future */
11103 #include <sys/dir.h>
11109 DIR *dirp = opendir(".");
11110 if (dirfd(dirp) >= 0)
11118 if eval $compile; then
11122 $define) echo "dirfd() found." >&4 ;;
11123 *) echo "dirfd() NOT found." >&4 ;;
11129 : see if dlerror exists
11132 set dlerror d_dlerror
11136 : see if dlfcn is available
11137 set dlfcn.h i_dlfcn
11144 On a few systems, the dynamically loaded modules that perl generates and uses
11145 will need a different extension than shared libs. The default will probably
11151 *) dflt="$dlext" ;;
11153 rp='What is the extension of dynamically loaded modules'
11162 : Check if dlsym need a leading underscore
11168 echo "Checking whether your dlsym() needs a leading underscore ..." >&4
11169 $cat >dyna.c <<'EOM'
11176 #$i_stdlib I_STDLIB
11178 #include <stdlib.h>
11182 #include <dlfcn.h> /* the dynamic linker include file for SunOS/Solaris */
11184 #include <sys/types.h>
11189 extern int fred() ;
11198 int mode = RTLD_LAZY ;
11200 handle = dlopen("./dyna.$dlext", mode) ;
11201 if (handle == NULL) {
11206 symbol = dlsym(handle, "fred") ;
11207 if (symbol == NULL) {
11208 /* try putting a leading underscore */
11209 symbol = dlsym(handle, "_fred") ;
11210 if (symbol == NULL) {
11223 : Call the object file tmp-dyna.o in case dlext=o.
11224 if $cc $ccflags $cccdlflags -c dyna.c > /dev/null 2>&1 &&
11225 mv dyna${_o} tmp-dyna${_o} > /dev/null 2>&1 &&
11226 $ld -o dyna.$dlext $ldflags $lddlflags tmp-dyna${_o} > /dev/null 2>&1 &&
11227 $cc -o fred $ccflags $ldflags $cccdlflags $ccdlflags fred.c $libs > /dev/null 2>&1 && $to dyna.$dlext; then
11230 1) echo "Test program failed using dlopen." >&4
11231 echo "Perhaps you should not use dynamic loading." >&4;;
11232 2) echo "Test program failed using dlsym." >&4
11233 echo "Perhaps you should not use dynamic loading." >&4;;
11234 3) echo "dlsym needs a leading underscore" >&4
11236 4) echo "dlsym doesn't need a leading underscore." >&4;;
11239 echo "I can't compile and run the test program." >&4
11240 echo "I'm guessing that dlsym doesn't need a leading underscore." >&4
11245 $rm -f fred fred.* dyna.$dlext dyna.* tmp-dyna.*
11250 : see if drand48_r exists
11251 set drand48_r d_drand48_r
11253 case "$d_drand48_r" in
11255 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
11256 case "$d_drand48_r_proto:$usethreads" in
11257 ":define") d_drand48_r_proto=define
11258 set d_drand48_r_proto drand48_r $hdrs
11262 case "$d_drand48_r_proto" in
11264 case "$drand48_r_proto" in
11265 ''|0) try='int drand48_r(struct drand48_data*, double*);'
11266 ./protochk "extern $try" $hdrs && drand48_r_proto=I_ST ;;
11268 case "$drand48_r_proto" in
11269 ''|0) d_drand48_r=undef
11271 echo "Disabling drand48_r, cannot determine prototype." >&4 ;;
11272 * ) case "$drand48_r_proto" in
11273 REENTRANT_PROTO*) ;;
11274 *) drand48_r_proto="REENTRANT_PROTO_$drand48_r_proto" ;;
11276 echo "Prototype: $try" ;;
11279 *) case "$usethreads" in
11280 define) echo "drand48_r has no prototype, not using it." >&4 ;;
11287 *) drand48_r_proto=0
11291 : see if prototype for drand48 is available
11293 set d_drand48proto drand48 $i_stdlib stdlib.h $i_unistd unistd.h
11296 : see if dup2 exists
11300 : see if eaccess exists
11301 set eaccess d_eaccess
11304 : see if endgrent exists
11305 set endgrent d_endgrent
11308 : see if this is an grp system
11314 xxx=`./findhdr grp.h`
11315 $cppstdin $cppflags $cppminus < $xxx >$$.h
11317 if $contains 'gr_passwd' $$.h >/dev/null 2>&1; then
11329 set d_grpasswd; eval $setvar
11333 : see if endgrent_r exists
11334 set endgrent_r d_endgrent_r
11336 case "$d_endgrent_r" in
11338 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
11339 case "$d_endgrent_r_proto:$usethreads" in
11340 ":define") d_endgrent_r_proto=define
11341 set d_endgrent_r_proto endgrent_r $hdrs
11345 case "$d_endgrent_r_proto" in
11347 case "$endgrent_r_proto" in
11348 ''|0) try='int endgrent_r(FILE**);'
11349 ./protochk "extern $try" $hdrs && endgrent_r_proto=I_H ;;
11351 case "$endgrent_r_proto" in
11352 ''|0) try='void endgrent_r(FILE**);'
11353 ./protochk "extern $try" $hdrs && endgrent_r_proto=V_H ;;
11355 case "$endgrent_r_proto" in
11356 ''|0) d_endgrent_r=undef
11358 echo "Disabling endgrent_r, cannot determine prototype." >&4 ;;
11359 * ) case "$endgrent_r_proto" in
11360 REENTRANT_PROTO*) ;;
11361 *) endgrent_r_proto="REENTRANT_PROTO_$endgrent_r_proto" ;;
11363 echo "Prototype: $try" ;;
11366 *) case "$usethreads" in
11367 define) echo "endgrent_r has no prototype, not using it." >&4 ;;
11374 *) endgrent_r_proto=0
11378 : see if endhostent exists
11379 set endhostent d_endhent
11382 : see if this is a netdb.h system
11383 set netdb.h i_netdb
11386 : see if endhostent_r exists
11387 set endhostent_r d_endhostent_r
11389 case "$d_endhostent_r" in
11391 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
11392 case "$d_endhostent_r_proto:$usethreads" in
11393 ":define") d_endhostent_r_proto=define
11394 set d_endhostent_r_proto endhostent_r $hdrs
11398 case "$d_endhostent_r_proto" in
11400 case "$endhostent_r_proto" in
11401 ''|0) try='int endhostent_r(struct hostent_data*);'
11402 ./protochk "extern $try" $hdrs && endhostent_r_proto=I_D ;;
11404 case "$endhostent_r_proto" in
11405 ''|0) try='void endhostent_r(struct hostent_data*);'
11406 ./protochk "extern $try" $hdrs && endhostent_r_proto=V_D ;;
11408 case "$endhostent_r_proto" in
11409 ''|0) d_endhostent_r=undef
11410 endhostent_r_proto=0
11411 echo "Disabling endhostent_r, cannot determine prototype." >&4 ;;
11412 * ) case "$endhostent_r_proto" in
11413 REENTRANT_PROTO*) ;;
11414 *) endhostent_r_proto="REENTRANT_PROTO_$endhostent_r_proto" ;;
11416 echo "Prototype: $try" ;;
11419 *) case "$usethreads" in
11420 define) echo "endhostent_r has no prototype, not using it." >&4 ;;
11422 d_endhostent_r=undef
11423 endhostent_r_proto=0
11427 *) endhostent_r_proto=0
11431 : see if endnetent exists
11432 set endnetent d_endnent
11435 : see if endnetent_r exists
11436 set endnetent_r d_endnetent_r
11438 case "$d_endnetent_r" in
11440 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
11441 case "$d_endnetent_r_proto:$usethreads" in
11442 ":define") d_endnetent_r_proto=define
11443 set d_endnetent_r_proto endnetent_r $hdrs
11447 case "$d_endnetent_r_proto" in
11449 case "$endnetent_r_proto" in
11450 ''|0) try='int endnetent_r(struct netent_data*);'
11451 ./protochk "extern $try" $hdrs && endnetent_r_proto=I_D ;;
11453 case "$endnetent_r_proto" in
11454 ''|0) try='void endnetent_r(struct netent_data*);'
11455 ./protochk "extern $try" $hdrs && endnetent_r_proto=V_D ;;
11457 case "$endnetent_r_proto" in
11458 ''|0) d_endnetent_r=undef
11459 endnetent_r_proto=0
11460 echo "Disabling endnetent_r, cannot determine prototype." >&4 ;;
11461 * ) case "$endnetent_r_proto" in
11462 REENTRANT_PROTO*) ;;
11463 *) endnetent_r_proto="REENTRANT_PROTO_$endnetent_r_proto" ;;
11465 echo "Prototype: $try" ;;
11468 *) case "$usethreads" in
11469 define) echo "endnetent_r has no prototype, not using it." >&4 ;;
11471 d_endnetent_r=undef
11472 endnetent_r_proto=0
11476 *) endnetent_r_proto=0
11480 : see if endprotoent exists
11481 set endprotoent d_endpent
11484 : see if endprotoent_r exists
11485 set endprotoent_r d_endprotoent_r
11487 case "$d_endprotoent_r" in
11489 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
11490 case "$d_endprotoent_r_proto:$usethreads" in
11491 ":define") d_endprotoent_r_proto=define
11492 set d_endprotoent_r_proto endprotoent_r $hdrs
11496 case "$d_endprotoent_r_proto" in
11498 case "$endprotoent_r_proto" in
11499 ''|0) try='int endprotoent_r(struct protoent_data*);'
11500 ./protochk "extern $try" $hdrs && endprotoent_r_proto=I_D ;;
11502 case "$endprotoent_r_proto" in
11503 ''|0) try='void endprotoent_r(struct protoent_data*);'
11504 ./protochk "extern $try" $hdrs && endprotoent_r_proto=V_D ;;
11506 case "$endprotoent_r_proto" in
11507 ''|0) d_endprotoent_r=undef
11508 endprotoent_r_proto=0
11509 echo "Disabling endprotoent_r, cannot determine prototype." >&4 ;;
11510 * ) case "$endprotoent_r_proto" in
11511 REENTRANT_PROTO*) ;;
11512 *) endprotoent_r_proto="REENTRANT_PROTO_$endprotoent_r_proto" ;;
11514 echo "Prototype: $try" ;;
11517 *) case "$usethreads" in
11518 define) echo "endprotoent_r has no prototype, not using it." >&4 ;;
11520 d_endprotoent_r=undef
11521 endprotoent_r_proto=0
11525 *) endprotoent_r_proto=0
11529 : see if endpwent exists
11530 set endpwent d_endpwent
11533 : see if this is a pwd.h system
11539 xxx=`./findhdr pwd.h`
11540 $cppstdin $cppflags $cppminus < $xxx >$$.h
11542 if $contains 'pw_quota' $$.h >/dev/null 2>&1; then
11550 if $contains 'pw_age' $$.h >/dev/null 2>&1; then
11558 if $contains 'pw_change' $$.h >/dev/null 2>&1; then
11566 if $contains 'pw_class' $$.h >/dev/null 2>&1; then
11574 if $contains 'pw_expire' $$.h >/dev/null 2>&1; then
11582 if $contains 'pw_comment' $$.h >/dev/null 2>&1; then
11590 if $contains 'pw_gecos' $$.h >/dev/null 2>&1; then
11598 if $contains 'pw_passwd' $$.h >/dev/null 2>&1; then
11610 set d_pwquota; eval $setvar
11611 set d_pwage; eval $setvar
11612 set d_pwchange; eval $setvar
11613 set d_pwclass; eval $setvar
11614 set d_pwexpire; eval $setvar
11615 set d_pwcomment; eval $setvar
11616 set d_pwgecos; eval $setvar
11617 set d_pwpasswd; eval $setvar
11621 : see if endpwent_r exists
11622 set endpwent_r d_endpwent_r
11624 case "$d_endpwent_r" in
11626 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
11627 case "$d_endpwent_r_proto:$usethreads" in
11628 ":define") d_endpwent_r_proto=define
11629 set d_endpwent_r_proto endpwent_r $hdrs
11633 case "$d_endpwent_r_proto" in
11635 case "$endpwent_r_proto" in
11636 ''|0) try='int endpwent_r(FILE**);'
11637 ./protochk "extern $try" $hdrs && endpwent_r_proto=I_H ;;
11639 case "$endpwent_r_proto" in
11640 ''|0) try='void endpwent_r(FILE**);'
11641 ./protochk "extern $try" $hdrs && endpwent_r_proto=V_H ;;
11643 case "$endpwent_r_proto" in
11644 ''|0) d_endpwent_r=undef
11646 echo "Disabling endpwent_r, cannot determine prototype." >&4 ;;
11647 * ) case "$endpwent_r_proto" in
11648 REENTRANT_PROTO*) ;;
11649 *) endpwent_r_proto="REENTRANT_PROTO_$endpwent_r_proto" ;;
11651 echo "Prototype: $try" ;;
11654 *) case "$usethreads" in
11655 define) echo "endpwent_r has no prototype, not using it." >&4 ;;
11662 *) endpwent_r_proto=0
11666 : see if endservent exists
11667 set endservent d_endsent
11670 : see if endservent_r exists
11671 set endservent_r d_endservent_r
11673 case "$d_endservent_r" in
11675 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
11676 case "$d_endservent_r_proto:$usethreads" in
11677 ":define") d_endservent_r_proto=define
11678 set d_endservent_r_proto endservent_r $hdrs
11682 case "$d_endservent_r_proto" in
11684 case "$endservent_r_proto" in
11685 ''|0) try='int endservent_r(struct servent_data*);'
11686 ./protochk "extern $try" $hdrs && endservent_r_proto=I_D ;;
11688 case "$endservent_r_proto" in
11689 ''|0) try='void endservent_r(struct servent_data*);'
11690 ./protochk "extern $try" $hdrs && endservent_r_proto=V_D ;;
11692 case "$endservent_r_proto" in
11693 ''|0) d_endservent_r=undef
11694 endservent_r_proto=0
11695 echo "Disabling endservent_r, cannot determine prototype." >&4 ;;
11696 * ) case "$endservent_r_proto" in
11697 REENTRANT_PROTO*) ;;
11698 *) endservent_r_proto="REENTRANT_PROTO_$endservent_r_proto" ;;
11700 echo "Prototype: $try" ;;
11703 *) case "$usethreads" in
11704 define) echo "endservent_r has no prototype, not using it." >&4 ;;
11706 d_endservent_r=undef
11707 endservent_r_proto=0
11711 *) endservent_r_proto=0
11715 : Locate the flags for 'open()'
11718 #include <sys/types.h>
11723 #include <sys/file.h>
11725 #$i_stdlib I_STDLIB
11727 #include <stdlib.h>
11738 : check sys/file.h first to get FREAD on Sun
11739 if $test `./findhdr sys/file.h` && \
11740 set try -DI_SYS_FILE && eval $compile; then
11742 echo "<sys/file.h> defines the O_* constants..." >&4
11743 if $run ./try; then
11744 echo "and you have the 3 argument form of open()." >&4
11747 echo "but not the 3 argument form of open(). Oh, well." >&4
11750 elif $test `./findhdr fcntl.h` && \
11751 set try -DI_FCNTL && eval $compile; then
11753 echo "<fcntl.h> defines the O_* constants..." >&4
11754 if $run ./try; then
11755 echo "and you have the 3 argument form of open()." >&4
11758 echo "but not the 3 argument form of open(). Oh, well." >&4
11763 echo "I can't find the O_* constant definitions! You got problems." >&4
11769 : see which of string.h or strings.h is needed
11771 strings=`./findhdr string.h`
11772 if $test "$strings" && $test -r "$strings"; then
11773 echo "Using <string.h> instead of <strings.h>." >&4
11777 strings=`./findhdr strings.h`
11778 if $test "$strings" && $test -r "$strings"; then
11779 echo "Using <strings.h> instead of <string.h>." >&4
11781 echo "No string header found -- You'll surely have problems." >&4
11786 case "$i_string" in
11787 "$undef") strings=`./findhdr strings.h`;;
11788 *) strings=`./findhdr string.h`;;
11791 : see if this is a sys/file.h system
11796 : do we need to include sys/file.h ?
11800 if $h_sysfile; then
11802 echo "We'll be including <sys/file.h>." >&4
11805 echo "We won't be including <sys/file.h>." >&4
11815 : see if fcntl.h is there
11820 : see if we can include fcntl.h
11826 echo "We'll be including <fcntl.h>." >&4
11829 if $h_sysfile; then
11830 echo "We don't need to include <fcntl.h> if we include <sys/file.h>." >&4
11832 echo "We won't be including <fcntl.h>." >&4
11844 : check for non-blocking I/O stuff
11845 case "$h_sysfile" in
11846 true) echo "#include <sys/file.h>" > head.c;;
11849 true) echo "#include <fcntl.h>" > head.c;;
11850 *) echo "#include <sys/fcntl.h>" > head.c;;
11855 echo "Figuring out the flag used by open() for non-blocking I/O..." >&4
11856 case "$o_nonblock" in
11858 $cat head.c > try.c
11859 $cat >>try.c <<EOCP
11861 #$i_stdlib I_STDLIB
11863 #include <stdlib.h>
11871 printf("O_NONBLOCK\n");
11875 printf("O_NDELAY\n");
11879 printf("FNDELAY\n");
11886 if eval $compile_ok; then
11887 o_nonblock=`$run ./try`
11888 case "$o_nonblock" in
11889 '') echo "I can't figure it out, assuming O_NONBLOCK will do.";;
11890 *) echo "Seems like we can use $o_nonblock.";;
11893 echo "(I can't compile the test program; pray O_NONBLOCK is right!)"
11896 *) echo "Using $hint value $o_nonblock.";;
11898 $rm -f try try.* .out core
11901 echo "Let's see what value errno gets from read() on a $o_nonblock file..." >&4
11904 $cat head.c > try.c
11905 $cat >>try.c <<EOCP
11907 #include <sys/types.h>
11908 #include <signal.h>
11910 #$i_stdlib I_STDLIB
11912 #include <stdlib.h>
11918 #define MY_O_NONBLOCK $o_nonblock
11919 #ifndef errno /* XXX need better Configure test */
11922 #$i_unistd I_UNISTD
11924 #include <unistd.h>
11926 #$i_string I_STRING
11928 #include <string.h>
11930 #include <strings.h>
11932 $signal_t blech(x) int x; { exit(3); }
11934 $cat >> try.c <<'EOCP'
11942 pipe(pd); /* Down: child -> parent */
11943 pipe(pu); /* Up: parent -> child */
11946 close(pd[1]); /* Parent reads from pd[0] */
11947 close(pu[0]); /* Parent writes (blocking) to pu[1] */
11949 if (-1 == fcntl(pd[0], F_SETFL, MY_O_NONBLOCK))
11954 signal(SIGALRM, blech);
11956 if ((ret = read(pd[0], buf, 1)) > 0) /* Nothing to read! */
11958 sprintf(string, "%d\n", ret);
11959 write(2, string, strlen(string));
11962 if (errno == EAGAIN) {
11963 printf("EAGAIN\n");
11968 if (errno == EWOULDBLOCK)
11969 printf("EWOULDBLOCK\n");
11972 write(pu[1], buf, 1); /* Unblocks child, tell it to close our pipe */
11973 sleep(2); /* Give it time to close our pipe */
11975 ret = read(pd[0], buf, 1); /* Should read EOF */
11977 sprintf(string, "%d\n", ret);
11978 write(4, string, strlen(string));
11982 close(pd[0]); /* We write to pd[1] */
11983 close(pu[1]); /* We read from pu[0] */
11984 read(pu[0], buf, 1); /* Wait for parent to signal us we may continue */
11985 close(pd[1]); /* Pipe pd is now fully closed! */
11986 exit(0); /* Bye bye, thank you for playing! */
11990 if eval $compile_ok; then
11991 echo "$startsh" >mtry
11992 echo "$run ./try >try.out 2>try.ret 4>try.err || exit 4" >>mtry
11994 ./mtry >/dev/null 2>&1
11996 0) eagain=`$cat try.out`;;
11997 1) echo "Could not perform non-blocking setting!";;
11998 2) echo "I did a successful read() for something that was not there!";;
11999 3) echo "Hmm... non-blocking I/O does not seem to be working!";;
12000 4) echo "Could not find F_SETFL!";;
12001 *) echo "Something terribly wrong happened during testing.";;
12003 rd_nodata=`$cat try.ret`
12004 echo "A read() system call with no data present returns $rd_nodata."
12005 case "$rd_nodata" in
12008 echo "(That's peculiar, fixing that to be -1.)"
12014 echo "Forcing errno EAGAIN on read() with no data available."
12018 echo "Your read() sets errno to $eagain when no data is available."
12021 status=`$cat try.err`
12023 0) echo "And it correctly returns 0 to signal EOF.";;
12024 -1) echo "But it also returns -1 to signal EOF, so be careful!";;
12025 *) echo "However, your read() returns '$status' on EOF??";;
12028 if test "$status" = "$rd_nodata"; then
12029 echo "WARNING: you can't distinguish between EOF and no data!"
12033 echo "I can't compile the test program--assuming errno EAGAIN will do."
12040 echo "Using $hint value $eagain."
12041 echo "Your read() returns $rd_nodata when no data is present."
12042 case "$d_eofnblk" in
12043 "$define") echo "And you can see EOF because read() returns 0.";;
12044 "$undef") echo "But you can't see EOF status from read() returned value.";;
12046 echo "(Assuming you can't see EOF status from read anyway.)"
12052 $rm -f try try.* .out core head.c mtry
12054 : see if _ptr and _cnt from stdio act std
12057 if $contains '_lbfsize' `./findhdr stdio.h` >/dev/null 2>&1 ; then
12058 echo "(Looks like you have stdio.h from BSD.)"
12059 case "$stdio_ptr" in
12060 '') stdio_ptr='((fp)->_p)'
12063 *) ptr_lval=$d_stdio_ptr_lval;;
12065 case "$stdio_cnt" in
12066 '') stdio_cnt='((fp)->_r)'
12069 *) cnt_lval=$d_stdio_cnt_lval;;
12071 case "$stdio_base" in
12072 '') stdio_base='((fp)->_ub._base ? (fp)->_ub._base : (fp)->_bf._base)';;
12074 case "$stdio_bufsiz" in
12075 '') stdio_bufsiz='((fp)->_ub._base ? (fp)->_ub._size : (fp)->_bf._size)';;
12077 elif $contains '_IO_fpos_t' `./findhdr stdio.h` `./findhdr libio.h` >/dev/null 2>&1 ; then
12078 echo "(Looks like you have stdio.h from Linux.)"
12079 case "$stdio_ptr" in
12080 '') stdio_ptr='((fp)->_IO_read_ptr)'
12083 *) ptr_lval=$d_stdio_ptr_lval;;
12085 case "$stdio_cnt" in
12086 '') stdio_cnt='((fp)->_IO_read_end - (fp)->_IO_read_ptr)'
12089 *) cnt_lval=$d_stdio_cnt_lval;;
12091 case "$stdio_base" in
12092 '') stdio_base='((fp)->_IO_read_base)';;
12094 case "$stdio_bufsiz" in
12095 '') stdio_bufsiz='((fp)->_IO_read_end - (fp)->_IO_read_base)';;
12098 case "$stdio_ptr" in
12099 '') stdio_ptr='((fp)->_ptr)'
12102 *) ptr_lval=$d_stdio_ptr_lval;;
12104 case "$stdio_cnt" in
12105 '') stdio_cnt='((fp)->_cnt)'
12108 *) cnt_lval=$d_stdio_cnt_lval;;
12110 case "$stdio_base" in
12111 '') stdio_base='((fp)->_base)';;
12113 case "$stdio_bufsiz" in
12114 '') stdio_bufsiz='((fp)->_cnt + (fp)->_ptr - (fp)->_base)';;
12118 : test whether _ptr and _cnt really work
12119 echo "Checking how std your stdio is..." >&4
12122 #$i_stdlib I_STDLIB
12124 #include <stdlib.h>
12126 #define FILE_ptr(fp) $stdio_ptr
12127 #define FILE_cnt(fp) $stdio_cnt
12129 FILE *fp = fopen("try.c", "r");
12132 18 <= FILE_cnt(fp) &&
12133 strncmp(FILE_ptr(fp), "include <stdio.h>\n", 18) == 0
12141 if eval $compile && $to try.c; then
12142 if $run ./try; then
12143 echo "Your stdio acts pretty std."
12146 echo "Your stdio isn't very std."
12149 echo "Your stdio doesn't appear very std."
12153 # glibc 2.2.90 and above apparently change stdio streams so Perl's
12154 # direct buffer manipulation no longer works. The Configure tests
12155 # should be changed to correctly detect this, but until then,
12156 # the following check should at least let perl compile and run.
12157 # (This quick fix should be updated before 5.8.1.)
12158 # To be defensive, reject all unknown versions, and all versions > 2.2.9.
12159 # A. Dougherty, June 3, 2002.
12160 case "$d_gnulibc" in
12162 case "$gnulibc_version" in
12166 *) echo "But I will not snoop inside glibc $gnulibc_version stdio buffers."
12175 : Can _ptr be used as an lvalue?
12176 case "$d_stdstdio$ptr_lval" in
12177 $define$define) val=$define ;;
12180 set d_stdio_ptr_lval
12183 : Can _cnt be used as an lvalue?
12184 case "$d_stdstdio$cnt_lval" in
12185 $define$define) val=$define ;;
12188 set d_stdio_cnt_lval
12192 : test whether setting _ptr sets _cnt as a side effect
12193 d_stdio_ptr_lval_sets_cnt="$undef"
12194 d_stdio_ptr_lval_nochange_cnt="$undef"
12195 case "$d_stdio_ptr_lval$d_stdstdio" in
12197 echo "Checking to see what happens if we set the stdio ptr..." >&4
12200 /* Can we scream? */
12201 /* Eat dust sed :-) */
12202 /* In the buffer space, no one can hear you scream. */
12203 #$i_stdlib I_STDLIB
12205 #include <stdlib.h>
12207 #define FILE_ptr(fp) $stdio_ptr
12208 #define FILE_cnt(fp) $stdio_cnt
12209 #include <sys/types.h>
12211 FILE *fp = fopen("try.c", "r");
12216 puts("Fail even to read");
12219 c = getc(fp); /* Read away the first # */
12221 puts("Fail even to read");
12225 18 <= FILE_cnt(fp) &&
12226 strncmp(FILE_ptr(fp), "include <stdio.h>\n", 18) == 0
12228 puts("Fail even to read");
12231 ptr = (char*) FILE_ptr(fp);
12232 cnt = (size_t)FILE_cnt(fp);
12234 FILE_ptr(fp) += 42;
12236 if ((char*)FILE_ptr(fp) != (ptr + 42)) {
12237 printf("Fail ptr check %p != %p", FILE_ptr(fp), (ptr + 42));
12240 if (FILE_cnt(fp) <= 20) {
12241 printf ("Fail (<20 chars to test)");
12244 if (strncmp(FILE_ptr(fp), "Eat dust sed :-) */\n", 20) != 0) {
12245 puts("Fail compare");
12248 if (cnt == FILE_cnt(fp)) {
12249 puts("Pass_unchanged");
12252 if (FILE_cnt(fp) == (cnt - 42)) {
12253 puts("Pass_changed");
12256 printf("Fail count was %d now %d\n", cnt, FILE_cnt(fp));
12262 if eval $compile && $to try.c; then
12263 case `$run ./try` in
12265 echo "Increasing ptr in your stdio decreases cnt by the same amount. Good." >&4
12266 d_stdio_ptr_lval_sets_cnt="$define" ;;
12268 echo "Increasing ptr in your stdio leaves cnt unchanged. Good." >&4
12269 d_stdio_ptr_lval_nochange_cnt="$define" ;;
12271 echo "Increasing ptr in your stdio didn't do exactly what I expected. We'll not be doing that then." >&4 ;;
12273 echo "It appears attempting to set ptr in your stdio is a bad plan." >&4 ;;
12276 echo "It seems we can't set ptr in your stdio. Nevermind." >&4
12282 : see if _base is also standard
12284 case "$d_stdstdio" in
12288 #$i_stdlib I_STDLIB
12290 #include <stdlib.h>
12292 #define FILE_base(fp) $stdio_base
12293 #define FILE_bufsiz(fp) $stdio_bufsiz
12295 FILE *fp = fopen("try.c", "r");
12298 19 <= FILE_bufsiz(fp) &&
12299 strncmp(FILE_base(fp), "#include <stdio.h>\n", 19) == 0
12306 if eval $compile && $to try.c; then
12307 if $run ./try; then
12308 echo "And its _base field acts std."
12311 echo "But its _base field isn't std."
12314 echo "However, it seems to be lacking the _base field."
12322 : see if fast_stdio exists
12324 case "$d_stdstdio:$d_stdio_ptr_lval" in
12326 case "$d_stdio_cnt_lval$d_stdio_ptr_lval_sets_cnt" in
12328 echo "You seem to have 'fast stdio' to directly manipulate the stdio buffers." >& 4
12339 : see if fchdir exists
12340 set fchdir d_fchdir
12343 : see if fchmod exists
12344 set fchmod d_fchmod
12347 : see if fchown exists
12348 set fchown d_fchown
12351 : see if this is an fcntl system
12356 : See if fcntl-based locking works.
12358 #$i_stdlib I_STDLIB
12360 #include <stdlib.h>
12362 #include <unistd.h>
12364 #include <signal.h>
12365 $signal_t blech(x) int x; { exit(3); }
12367 #if defined(F_SETLK) && defined(F_SETLKW)
12368 struct flock flock;
12370 fd = open("try.c", O_RDONLY);
12371 flock.l_type = F_RDLCK;
12372 flock.l_whence = SEEK_SET;
12373 flock.l_start = flock.l_len = 0;
12374 signal(SIGALRM, blech);
12376 retval = fcntl(fd, F_SETLK, &flock);
12378 (retval < 0 ? exit(2) : exit(0));
12384 echo "Checking if fcntl-based file locking works... "
12388 if eval $compile_ok; then
12389 if $run ./try; then
12390 echo "Yes, it seems to work."
12393 echo "Nope, it didn't work."
12398 *** I had to forcibly timeout from fcntl(..., F_SETLK, ...).
12399 *** This is (almost) impossible.
12400 *** If your NFS lock daemons are not feeling well, something like
12401 *** this may happen, please investigate. Cannot continue, aborting.
12409 echo "I'm unable to compile the test program, so I'll assume not."
12414 echo "Nope, since you don't even have fcntl()."
12417 set d_fcntl_can_lock
12422 : check for fd_set items
12425 Checking to see how well your C compiler handles fd_set and friends ...
12428 #$i_stdlib I_STDLIB
12430 #include <stdlib.h>
12432 #$i_systime I_SYS_TIME
12433 #$i_sysselct I_SYS_SELECT
12434 #$d_socket HAS_SOCKET
12435 #include <sys/types.h>
12437 #include <sys/socket.h> /* Might include <sys/bsdtypes.h> */
12440 #include <sys/time.h>
12442 #ifdef I_SYS_SELECT
12443 #include <sys/select.h>
12452 #if defined(FD_SET) && defined(FD_CLR) && defined(FD_ISSET) && defined(FD_ZERO)
12460 if eval $compile; then
12461 d_fds_bits="$define"
12463 echo "Well, your system knows about the normal fd_set typedef..." >&4
12464 if $run ./try; then
12465 echo "and you have the normal fd_set macros (just as I'd expect)." >&4
12466 d_fd_macros="$define"
12469 but not the normal fd_set macros! Gaaack! I'll have to cover for you.
12471 d_fd_macros="$undef"
12475 Hmm, your compiler has some difficulty with fd_set. Checking further...
12478 if eval $compile; then
12479 d_fds_bits="$undef"
12481 echo "Well, your system has some sort of fd_set available..." >&4
12482 if $run ./try; then
12483 echo "and you have the normal fd_set macros." >&4
12484 d_fd_macros="$define"
12487 but not the normal fd_set macros! Gross! More work for me...
12489 d_fd_macros="$undef"
12492 echo "Well, you got zip. That's OK, I can roll my own fd_set stuff." >&4
12494 d_fds_bits="$undef"
12495 d_fd_macros="$undef"
12500 : see if fgetpos exists
12501 set fgetpos d_fgetpos
12504 : see if finite exists
12505 set finite d_finite
12508 : see if finitel exists
12509 set finitel d_finitel
12512 : see if flock exists
12516 : see if prototype for flock is available
12518 set d_flockproto flock $i_sysfile sys/file.h
12521 : see if fork exists
12525 : see if fp_class exists
12526 set fp_class d_fp_class
12529 : see if pathconf exists
12530 set pathconf d_pathconf
12533 : see if fpathconf exists
12534 set fpathconf d_fpathconf
12537 : see if fpclass exists
12538 set fpclass d_fpclass
12541 : see if fpclassify exists
12542 set fpclassify d_fpclassify
12545 : see if fpclassl exists
12546 set fpclassl d_fpclassl
12550 : check for fpos64_t
12552 echo "Checking to see if you have fpos64_t..." >&4
12555 int main() { fpos64_t x = 7; }
12558 if eval $compile; then
12560 echo "You have fpos64_t."
12563 echo "You do not have fpos64_t."
12564 case "$fpossize" in
12565 8) echo "(Your fpos_t is 64 bits, so you could use that.)" ;;
12572 : see if frexpl exists
12573 set frexpl d_frexpl
12576 : see if this is a sys/param system
12577 set sys/param.h i_sysparam
12580 : see if this is a sys/mount.h system
12581 set sys/mount.h i_sysmount
12586 echo "Checking to see if your system supports struct fs_data..." >&4
12587 set d_fs_data_s fs_data $i_systypes sys/types.h $i_sysparam sys/param.h $i_sysmount sys/mount.h
12589 case "$d_fs_data_s" in
12590 "$define") echo "Yes, it does." ;;
12591 *) echo "No, it doesn't." ;;
12594 : see if fseeko exists
12595 set fseeko d_fseeko
12597 case "$longsize" in
12598 8) echo "(Your long is 64 bits, so you could use fseek.)" ;;
12601 : see if fsetpos exists
12602 set fsetpos d_fsetpos
12606 : see if fstatfs exists
12607 set fstatfs d_fstatfs
12611 : see if statvfs exists
12612 set statvfs d_statvfs
12615 : see if fstatvfs exists
12616 set fstatvfs d_fstatvfs
12620 : see if fsync exists
12624 : see if ftello exists
12625 set ftello d_ftello
12627 case "$longsize" in
12628 8) echo "(Your long is 64 bits, so you could use ftell.)" ;;
12632 : check for a working futimes
12634 echo "Checking for a working futimes()" >&4
12637 #include <sys/time.h>
12644 fd = open ("try.c", O_RDWR);
12645 if (-1 == fd) exit (1);
12646 rv = futimes (fd, NULL);
12647 exit (rv == -1 ? errno : 0);
12651 if eval $compile; then
12655 0) echo "Yes, it does" >&4
12656 d_futimes="$define"
12658 *) echo "No, it has futimes, but it isn't working ($rc) (probably harmless)\n" >&4
12662 echo "No, it does not (probably harmless)\n" >&4
12664 $rm -f try.* try core core.try.*
12666 : see if getcwd exists
12667 set getcwd d_getcwd
12670 : see if getespwnam exists
12671 set getespwnam d_getespwnam
12675 : see if getfsstat exists
12676 set getfsstat d_getfsstat
12679 : see if getgrent exists
12680 set getgrent d_getgrent
12683 : see if getgrent_r exists
12684 set getgrent_r d_getgrent_r
12686 case "$d_getgrent_r" in
12688 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
12689 case "$d_getgrent_r_proto:$usethreads" in
12690 ":define") d_getgrent_r_proto=define
12691 set d_getgrent_r_proto getgrent_r $hdrs
12695 case "$d_getgrent_r_proto" in
12697 case "$getgrent_r_proto" in
12698 ''|0) try='int getgrent_r(struct group*, char*, size_t, struct group**);'
12699 ./protochk "extern $try" $hdrs && getgrent_r_proto=I_SBWR ;;
12701 case "$getgrent_r_proto" in
12702 ''|0) try='int getgrent_r(struct group*, char*, int, struct group**);'
12703 ./protochk "extern $try" $hdrs && getgrent_r_proto=I_SBIR ;;
12705 case "$getgrent_r_proto" in
12706 ''|0) try='struct group* getgrent_r(struct group*, char*, size_t);'
12707 ./protochk "extern $try" $hdrs && getgrent_r_proto=S_SBW ;;
12709 case "$getgrent_r_proto" in
12710 ''|0) try='struct group* getgrent_r(struct group*, char*, int);'
12711 ./protochk "extern $try" $hdrs && getgrent_r_proto=S_SBI ;;
12713 case "$getgrent_r_proto" in
12714 ''|0) try='int getgrent_r(struct group*, char*, int);'
12715 ./protochk "extern $try" $hdrs && getgrent_r_proto=I_SBI ;;
12717 case "$getgrent_r_proto" in
12718 ''|0) try='int getgrent_r(struct group*, char*, int, FILE**);'
12719 ./protochk "extern $try" $hdrs && getgrent_r_proto=I_SBIH ;;
12721 case "$getgrent_r_proto" in
12722 ''|0) d_getgrent_r=undef
12724 echo "Disabling getgrent_r, cannot determine prototype." >&4 ;;
12725 * ) case "$getgrent_r_proto" in
12726 REENTRANT_PROTO*) ;;
12727 *) getgrent_r_proto="REENTRANT_PROTO_$getgrent_r_proto" ;;
12729 echo "Prototype: $try" ;;
12732 *) case "$usethreads" in
12733 define) echo "getgrent_r has no prototype, not using it." >&4 ;;
12740 *) getgrent_r_proto=0
12744 : see if getgrgid_r exists
12745 set getgrgid_r d_getgrgid_r
12747 case "$d_getgrgid_r" in
12749 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
12750 case "$d_getgrgid_r_proto:$usethreads" in
12751 ":define") d_getgrgid_r_proto=define
12752 set d_getgrgid_r_proto getgrgid_r $hdrs
12756 case "$d_getgrgid_r_proto" in
12758 case "$getgrgid_r_proto" in
12759 ''|0) try='int getgrgid_r(gid_t, struct group*, char*, size_t, struct group**);'
12760 ./protochk "extern $try" $hdrs && getgrgid_r_proto=I_TSBWR ;;
12762 case "$getgrgid_r_proto" in
12763 ''|0) try='int getgrgid_r(gid_t, struct group*, char*, int, struct group**);'
12764 ./protochk "extern $try" $hdrs && getgrgid_r_proto=I_TSBIR ;;
12766 case "$getgrgid_r_proto" in
12767 ''|0) try='int getgrgid_r(gid_t, struct group*, char*, int);'
12768 ./protochk "extern $try" $hdrs && getgrgid_r_proto=I_TSBI ;;
12770 case "$getgrgid_r_proto" in
12771 ''|0) try='struct group* getgrgid_r(gid_t, struct group*, char*, int);'
12772 ./protochk "extern $try" $hdrs && getgrgid_r_proto=S_TSBI ;;
12774 case "$getgrgid_r_proto" in
12775 ''|0) d_getgrgid_r=undef
12777 echo "Disabling getgrgid_r, cannot determine prototype." >&4 ;;
12778 * ) case "$getgrgid_r_proto" in
12779 REENTRANT_PROTO*) ;;
12780 *) getgrgid_r_proto="REENTRANT_PROTO_$getgrgid_r_proto" ;;
12782 echo "Prototype: $try" ;;
12785 *) case "$usethreads" in
12786 define) echo "getgrgid_r has no prototype, not using it." >&4 ;;
12793 *) getgrgid_r_proto=0
12797 : see if getgrnam_r exists
12798 set getgrnam_r d_getgrnam_r
12800 case "$d_getgrnam_r" in
12802 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
12803 case "$d_getgrnam_r_proto:$usethreads" in
12804 ":define") d_getgrnam_r_proto=define
12805 set d_getgrnam_r_proto getgrnam_r $hdrs
12809 case "$d_getgrnam_r_proto" in
12811 case "$getgrnam_r_proto" in
12812 ''|0) try='int getgrnam_r(const char*, struct group*, char*, size_t, struct group**);'
12813 ./protochk "extern $try" $hdrs && getgrnam_r_proto=I_CSBWR ;;
12815 case "$getgrnam_r_proto" in
12816 ''|0) try='int getgrnam_r(const char*, struct group*, char*, int, struct group**);'
12817 ./protochk "extern $try" $hdrs && getgrnam_r_proto=I_CSBIR ;;
12819 case "$getgrnam_r_proto" in
12820 ''|0) try='struct group* getgrnam_r(const char*, char*, int);'
12821 ./protochk "extern $try" $hdrs && getgrnam_r_proto=S_CBI ;;
12823 case "$getgrnam_r_proto" in
12824 ''|0) try='int getgrnam_r(const char*, struct group*, char*, int);'
12825 ./protochk "extern $try" $hdrs && getgrnam_r_proto=I_CSBI ;;
12827 case "$getgrnam_r_proto" in
12828 ''|0) try='struct group* getgrnam_r(const char*, struct group*, char*, int);'
12829 ./protochk "extern $try" $hdrs && getgrnam_r_proto=S_CSBI ;;
12831 case "$getgrnam_r_proto" in
12832 ''|0) d_getgrnam_r=undef
12834 echo "Disabling getgrnam_r, cannot determine prototype." >&4 ;;
12835 * ) case "$getgrnam_r_proto" in
12836 REENTRANT_PROTO*) ;;
12837 *) getgrnam_r_proto="REENTRANT_PROTO_$getgrnam_r_proto" ;;
12839 echo "Prototype: $try" ;;
12842 *) case "$usethreads" in
12843 define) echo "getgrnam_r has no prototype, not using it." >&4 ;;
12850 *) getgrnam_r_proto=0
12854 : see if gethostbyaddr exists
12855 set gethostbyaddr d_gethbyaddr
12858 : see if gethostbyname exists
12859 set gethostbyname d_gethbyname
12862 : see if gethostent exists
12863 set gethostent d_gethent
12866 : see how we will look up host name
12869 if set gethostname val -f d_gethname; eval $csym; $val; then
12870 echo 'gethostname() found.' >&4
12871 d_gethname="$define"
12874 if set uname val -f d_uname; eval $csym; $val; then
12877 uname() was found, but you're running xenix, and older versions of xenix
12878 have a broken uname(). If you don't really know whether your xenix is old
12879 enough to have a broken system call, use the default answer.
12884 "$define") dflt=n;;
12886 rp='Is your uname() broken?'
12889 n*) d_uname="$define"; call=uname;;
12892 echo 'uname() found.' >&4
12899 case "$d_gethname" in
12900 '') d_gethname="$undef";;
12903 '') d_uname="$undef";;
12905 case "$d_uname$d_gethname" in
12910 Every now and then someone has a $call() that lies about the hostname
12911 but can't be fixed for political or economic reasons. If you wish, I can
12912 pretend $call() isn't there and maybe compute hostname at run-time
12913 thanks to the '$phostname' command.
12916 rp="Shall I ignore $call() from now on?"
12919 y*) d_uname="$undef" d_gethname="$undef"; $echo $n "Okay...$c";;
12922 case "$phostname" in
12923 '') aphostname='';;
12924 *) case "$aphostname" in
12926 *) set X $phostname
12930 file=`./loc $file $file $pth`
12931 aphostname=`echo $file $*`
12936 case "$d_uname$d_gethname" in
12939 case "$phostname" in
12941 echo "There will be no way for $package to get your hostname." >&4;;
12943 echo "I'll use 'popen("'"'$aphostname'", "r")'"' to get your hostname." >&4
12947 case "$d_phostname" in
12948 '') d_phostname="$undef";;
12951 : see if gethostbyaddr_r exists
12952 set gethostbyaddr_r d_gethostbyaddr_r
12954 case "$d_gethostbyaddr_r" in
12956 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
12957 case "$d_gethostbyaddr_r_proto:$usethreads" in
12958 ":define") d_gethostbyaddr_r_proto=define
12959 set d_gethostbyaddr_r_proto gethostbyaddr_r $hdrs
12963 case "$d_gethostbyaddr_r_proto" in
12965 case "$gethostbyaddr_r_proto" in
12966 ''|0) try='int gethostbyaddr_r(const char*, size_t, int, struct hostent*, char*, size_t, struct hostent**, int*);'
12967 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=I_CWISBWRE ;;
12969 case "$gethostbyaddr_r_proto" in
12970 ''|0) try='struct hostent* gethostbyaddr_r(const char*, size_t, int, struct hostent*, char*, size_t, int, int*);'
12971 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=S_CWISBWIE ;;
12973 case "$gethostbyaddr_r_proto" in
12974 ''|0) try='struct hostent* gethostbyaddr_r(const char*, size_t, int, struct hostent*, char*, int, int*);'
12975 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=S_CWISBIE ;;
12977 case "$gethostbyaddr_r_proto" in
12978 ''|0) try='struct hostent* gethostbyaddr_r(const void*, size_t, int, struct hostent*, char*, int, int*);'
12979 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=S_TWISBIE ;;
12981 case "$gethostbyaddr_r_proto" in
12982 ''|0) try='struct hostent* gethostbyaddr_r(const char*, int, int, struct hostent*, char*, int, int*);'
12983 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=S_CIISBIE ;;
12985 case "$gethostbyaddr_r_proto" in
12986 ''|0) try='struct hostent* gethostbyaddr_r(const char*, struct hostent*, char*, int, int*);'
12987 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=S_CSBIE ;;
12989 case "$gethostbyaddr_r_proto" in
12990 ''|0) try='struct hostent* gethostbyaddr_r(const void*, struct hostent*, char*, int, int*);'
12991 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=S_TSBIE ;;
12993 case "$gethostbyaddr_r_proto" in
12994 ''|0) try='int gethostbyaddr_r(const char*, size_t, int, struct hostent*, struct hostent_data*);'
12995 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=I_CWISD ;;
12997 case "$gethostbyaddr_r_proto" in
12998 ''|0) try='int gethostbyaddr_r(const char*, int, int, struct hostent*, struct hostent_data*);'
12999 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=I_CIISD ;;
13001 case "$gethostbyaddr_r_proto" in
13002 ''|0) try='int gethostbyaddr_r(const char*, int, int);'
13003 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=I_CII ;;
13005 case "$gethostbyaddr_r_proto" in
13006 ''|0) try='int gethostbyaddr_r(const void*, socklen_t, int, struct hostent*, char*, size_t, struct hostent**, int*);'
13007 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=I_TsISBWRE ;;
13009 case "$gethostbyaddr_r_proto" in
13010 ''|0) d_gethostbyaddr_r=undef
13011 gethostbyaddr_r_proto=0
13012 echo "Disabling gethostbyaddr_r, cannot determine prototype." >&4 ;;
13013 * ) case "$gethostbyaddr_r_proto" in
13014 REENTRANT_PROTO*) ;;
13015 *) gethostbyaddr_r_proto="REENTRANT_PROTO_$gethostbyaddr_r_proto" ;;
13017 echo "Prototype: $try" ;;
13020 *) case "$usethreads" in
13021 define) echo "gethostbyaddr_r has no prototype, not using it." >&4 ;;
13023 d_gethostbyaddr_r=undef
13024 gethostbyaddr_r_proto=0
13028 *) gethostbyaddr_r_proto=0
13032 : see if gethostbyname_r exists
13033 set gethostbyname_r d_gethostbyname_r
13035 case "$d_gethostbyname_r" in
13037 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13038 case "$d_gethostbyname_r_proto:$usethreads" in
13039 ":define") d_gethostbyname_r_proto=define
13040 set d_gethostbyname_r_proto gethostbyname_r $hdrs
13044 case "$d_gethostbyname_r_proto" in
13046 case "$gethostbyname_r_proto" in
13047 ''|0) try='int gethostbyname_r(const char*, struct hostent*, char*, size_t, struct hostent**, int*);'
13048 ./protochk "extern $try" $hdrs && gethostbyname_r_proto=I_CSBWRE ;;
13050 case "$gethostbyname_r_proto" in
13051 ''|0) try='struct hostent* gethostbyname_r(const char*, struct hostent*, char*, int, int*);'
13052 ./protochk "extern $try" $hdrs && gethostbyname_r_proto=S_CSBIE ;;
13054 case "$gethostbyname_r_proto" in
13055 ''|0) try='int gethostbyname_r(const char*, struct hostent*, struct hostent_data*);'
13056 ./protochk "extern $try" $hdrs && gethostbyname_r_proto=I_CSD ;;
13058 case "$gethostbyname_r_proto" in
13059 ''|0) d_gethostbyname_r=undef
13060 gethostbyname_r_proto=0
13061 echo "Disabling gethostbyname_r, cannot determine prototype." >&4 ;;
13062 * ) case "$gethostbyname_r_proto" in
13063 REENTRANT_PROTO*) ;;
13064 *) gethostbyname_r_proto="REENTRANT_PROTO_$gethostbyname_r_proto" ;;
13066 echo "Prototype: $try" ;;
13069 *) case "$usethreads" in
13070 define) echo "gethostbyname_r has no prototype, not using it." >&4 ;;
13072 d_gethostbyname_r=undef
13073 gethostbyname_r_proto=0
13077 *) gethostbyname_r_proto=0
13081 : see if gethostent_r exists
13082 set gethostent_r d_gethostent_r
13084 case "$d_gethostent_r" in
13086 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13087 case "$d_gethostent_r_proto:$usethreads" in
13088 ":define") d_gethostent_r_proto=define
13089 set d_gethostent_r_proto gethostent_r $hdrs
13093 case "$d_gethostent_r_proto" in
13095 case "$gethostent_r_proto" in
13096 ''|0) try='int gethostent_r(struct hostent*, char*, size_t, struct hostent**, int*);'
13097 ./protochk "extern $try" $hdrs && gethostent_r_proto=I_SBWRE ;;
13099 case "$gethostent_r_proto" in
13100 ''|0) try='int gethostent_r(struct hostent*, char*, int, int*);'
13101 ./protochk "extern $try" $hdrs && gethostent_r_proto=I_SBIE ;;
13103 case "$gethostent_r_proto" in
13104 ''|0) try='struct hostent* gethostent_r(struct hostent*, char*, int, int*);'
13105 ./protochk "extern $try" $hdrs && gethostent_r_proto=S_SBIE ;;
13107 case "$gethostent_r_proto" in
13108 ''|0) try='struct hostent* gethostent_r(struct hostent*, char*, int);'
13109 ./protochk "extern $try" $hdrs && gethostent_r_proto=S_SBI ;;
13111 case "$gethostent_r_proto" in
13112 ''|0) try='int gethostent_r(struct hostent*, char*, int);'
13113 ./protochk "extern $try" $hdrs && gethostent_r_proto=I_SBI ;;
13115 case "$gethostent_r_proto" in
13116 ''|0) try='int gethostent_r(struct hostent*, struct hostent_data*);'
13117 ./protochk "extern $try" $hdrs && gethostent_r_proto=I_SD ;;
13119 case "$gethostent_r_proto" in
13120 ''|0) d_gethostent_r=undef
13121 gethostent_r_proto=0
13122 echo "Disabling gethostent_r, cannot determine prototype." >&4 ;;
13123 * ) case "$gethostent_r_proto" in
13124 REENTRANT_PROTO*) ;;
13125 *) gethostent_r_proto="REENTRANT_PROTO_$gethostent_r_proto" ;;
13127 echo "Prototype: $try" ;;
13130 *) case "$usethreads" in
13131 define) echo "gethostent_r has no prototype, not using it." >&4 ;;
13133 d_gethostent_r=undef
13134 gethostent_r_proto=0
13138 *) gethostent_r_proto=0
13142 : see if prototypes for various gethostxxx netdb.h functions are available
13144 set d_gethostprotos gethostent $i_netdb netdb.h
13147 : see if getitimer exists
13148 set getitimer d_getitimer
13151 : see if getlogin exists
13152 set getlogin d_getlogin
13155 : see if getlogin_r exists
13156 set getlogin_r d_getlogin_r
13158 case "$d_getlogin_r" in
13160 hdrs="$i_systypes sys/types.h define stdio.h $i_unistd unistd.h"
13161 case "$d_getlogin_r_proto:$usethreads" in
13162 ":define") d_getlogin_r_proto=define
13163 set d_getlogin_r_proto getlogin_r $hdrs
13167 case "$d_getlogin_r_proto" in
13169 case "$getlogin_r_proto" in
13170 ''|0) try='int getlogin_r(char*, size_t);'
13171 ./protochk "extern $try" $hdrs && getlogin_r_proto=I_BW ;;
13173 case "$getlogin_r_proto" in
13174 ''|0) try='int getlogin_r(char*, int);'
13175 ./protochk "extern $try" $hdrs && getlogin_r_proto=I_BI ;;
13177 case "$getlogin_r_proto" in
13178 ''|0) try='char* getlogin_r(char*, size_t);'
13179 ./protochk "extern $try" $hdrs && getlogin_r_proto=B_BW ;;
13181 case "$getlogin_r_proto" in
13182 ''|0) try='char* getlogin_r(char*, int);'
13183 ./protochk "extern $try" $hdrs && getlogin_r_proto=B_BI ;;
13185 case "$getlogin_r_proto" in
13186 ''|0) d_getlogin_r=undef
13188 echo "Disabling getlogin_r, cannot determine prototype." >&4 ;;
13189 * ) case "$getlogin_r_proto" in
13190 REENTRANT_PROTO*) ;;
13191 *) getlogin_r_proto="REENTRANT_PROTO_$getlogin_r_proto" ;;
13193 echo "Prototype: $try" ;;
13196 *) case "$usethreads" in
13197 define) echo "getlogin_r has no prototype, not using it." >&4 ;;
13204 *) getlogin_r_proto=0
13208 : see if getmnt exists
13209 set getmnt d_getmnt
13212 : see if getmntent exists
13213 set getmntent d_getmntent
13216 : see if getnetbyaddr exists
13217 set getnetbyaddr d_getnbyaddr
13220 : see if getnetbyname exists
13221 set getnetbyname d_getnbyname
13224 : see if getnetent exists
13225 set getnetent d_getnent
13228 : see if getnetbyaddr_r exists
13229 set getnetbyaddr_r d_getnetbyaddr_r
13231 case "$d_getnetbyaddr_r" in
13233 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13234 case "$d_getnetbyaddr_r_proto:$usethreads" in
13235 ":define") d_getnetbyaddr_r_proto=define
13236 set d_getnetbyaddr_r_proto getnetbyaddr_r $hdrs
13240 case "$d_getnetbyaddr_r_proto" in
13242 case "$getnetbyaddr_r_proto" in
13243 ''|0) try='int getnetbyaddr_r(unsigned long, int, struct netent*, char*, size_t, struct netent**, int*);'
13244 ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=I_UISBWRE ;;
13246 case "$getnetbyaddr_r_proto" in
13247 ''|0) try='int getnetbyaddr_r(long, int, struct netent*, char*, int);'
13248 ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=I_LISBI ;;
13250 case "$getnetbyaddr_r_proto" in
13251 ''|0) try='struct netent* getnetbyaddr_r(in_addr_t, int, struct netent*, char*, int);'
13252 ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=S_TISBI ;;
13254 case "$getnetbyaddr_r_proto" in
13255 ''|0) try='struct netent* getnetbyaddr_r(long, int, struct netent*, char*, int);'
13256 ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=S_LISBI ;;
13258 case "$getnetbyaddr_r_proto" in
13259 ''|0) try='int getnetbyaddr_r(in_addr_t, int, struct netent*, struct netent_data*);'
13260 ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=I_TISD ;;
13262 case "$getnetbyaddr_r_proto" in
13263 ''|0) try='int getnetbyaddr_r(long, int, struct netent*, struct netent_data*);'
13264 ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=I_LISD ;;
13266 case "$getnetbyaddr_r_proto" in
13267 ''|0) try='int getnetbyaddr_r(int, int, struct netent*, struct netent_data*);'
13268 ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=I_IISD ;;
13270 case "$getnetbyaddr_r_proto" in
13271 ''|0) try='int getnetbyaddr_r(uint32_t, int, struct netent*, char*, size_t, struct netent**, int*);'
13272 ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=I_uISBWRE ;;
13274 case "$getnetbyaddr_r_proto" in
13275 ''|0) d_getnetbyaddr_r=undef
13276 getnetbyaddr_r_proto=0
13277 echo "Disabling getnetbyaddr_r, cannot determine prototype." >&4 ;;
13278 * ) case "$getnetbyaddr_r_proto" in
13279 REENTRANT_PROTO*) ;;
13280 *) getnetbyaddr_r_proto="REENTRANT_PROTO_$getnetbyaddr_r_proto" ;;
13282 echo "Prototype: $try" ;;
13285 *) case "$usethreads" in
13286 define) echo "getnetbyaddr_r has no prototype, not using it." >&4 ;;
13288 d_getnetbyaddr_r=undef
13289 getnetbyaddr_r_proto=0
13293 *) getnetbyaddr_r_proto=0
13297 : see if getnetbyname_r exists
13298 set getnetbyname_r d_getnetbyname_r
13300 case "$d_getnetbyname_r" in
13302 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13303 case "$d_getnetbyname_r_proto:$usethreads" in
13304 ":define") d_getnetbyname_r_proto=define
13305 set d_getnetbyname_r_proto getnetbyname_r $hdrs
13309 case "$d_getnetbyname_r_proto" in
13311 case "$getnetbyname_r_proto" in
13312 ''|0) try='int getnetbyname_r(const char*, struct netent*, char*, size_t, struct netent**, int*);'
13313 ./protochk "extern $try" $hdrs && getnetbyname_r_proto=I_CSBWRE ;;
13315 case "$getnetbyname_r_proto" in
13316 ''|0) try='int getnetbyname_r(const char*, struct netent*, char*, int);'
13317 ./protochk "extern $try" $hdrs && getnetbyname_r_proto=I_CSBI ;;
13319 case "$getnetbyname_r_proto" in
13320 ''|0) try='struct netent* getnetbyname_r(const char*, struct netent*, char*, int);'
13321 ./protochk "extern $try" $hdrs && getnetbyname_r_proto=S_CSBI ;;
13323 case "$getnetbyname_r_proto" in
13324 ''|0) try='int getnetbyname_r(const char*, struct netent*, struct netent_data*);'
13325 ./protochk "extern $try" $hdrs && getnetbyname_r_proto=I_CSD ;;
13327 case "$getnetbyname_r_proto" in
13328 ''|0) d_getnetbyname_r=undef
13329 getnetbyname_r_proto=0
13330 echo "Disabling getnetbyname_r, cannot determine prototype." >&4 ;;
13331 * ) case "$getnetbyname_r_proto" in
13332 REENTRANT_PROTO*) ;;
13333 *) getnetbyname_r_proto="REENTRANT_PROTO_$getnetbyname_r_proto" ;;
13335 echo "Prototype: $try" ;;
13338 *) case "$usethreads" in
13339 define) echo "getnetbyname_r has no prototype, not using it." >&4 ;;
13341 d_getnetbyname_r=undef
13342 getnetbyname_r_proto=0
13346 *) getnetbyname_r_proto=0
13350 : see if getnetent_r exists
13351 set getnetent_r d_getnetent_r
13353 case "$d_getnetent_r" in
13355 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13356 case "$d_getnetent_r_proto:$usethreads" in
13357 ":define") d_getnetent_r_proto=define
13358 set d_getnetent_r_proto getnetent_r $hdrs
13362 case "$d_getnetent_r_proto" in
13364 case "$getnetent_r_proto" in
13365 ''|0) try='int getnetent_r(struct netent*, char*, size_t, struct netent**, int*);'
13366 ./protochk "extern $try" $hdrs && getnetent_r_proto=I_SBWRE ;;
13368 case "$getnetent_r_proto" in
13369 ''|0) try='int getnetent_r(struct netent*, char*, int, int*);'
13370 ./protochk "extern $try" $hdrs && getnetent_r_proto=I_SBIE ;;
13372 case "$getnetent_r_proto" in
13373 ''|0) try='struct netent* getnetent_r(struct netent*, char*, int, int*);'
13374 ./protochk "extern $try" $hdrs && getnetent_r_proto=S_SBIE ;;
13376 case "$getnetent_r_proto" in
13377 ''|0) try='struct netent* getnetent_r(struct netent*, char*, int);'
13378 ./protochk "extern $try" $hdrs && getnetent_r_proto=S_SBI ;;
13380 case "$getnetent_r_proto" in
13381 ''|0) try='int getnetent_r(struct netent*, char*, int);'
13382 ./protochk "extern $try" $hdrs && getnetent_r_proto=I_SBI ;;
13384 case "$getnetent_r_proto" in
13385 ''|0) try='int getnetent_r(struct netent*, struct netent_data*);'
13386 ./protochk "extern $try" $hdrs && getnetent_r_proto=I_SD ;;
13388 case "$getnetent_r_proto" in
13389 ''|0) d_getnetent_r=undef
13390 getnetent_r_proto=0
13391 echo "Disabling getnetent_r, cannot determine prototype." >&4 ;;
13392 * ) case "$getnetent_r_proto" in
13393 REENTRANT_PROTO*) ;;
13394 *) getnetent_r_proto="REENTRANT_PROTO_$getnetent_r_proto" ;;
13396 echo "Prototype: $try" ;;
13399 *) case "$usethreads" in
13400 define) echo "getnetent_r has no prototype, not using it." >&4 ;;
13402 d_getnetent_r=undef
13403 getnetent_r_proto=0
13407 *) getnetent_r_proto=0
13411 : see if prototypes for various getnetxxx netdb.h functions are available
13413 set d_getnetprotos getnetent $i_netdb netdb.h
13416 : see if getpagesize exists
13417 set getpagesize d_getpagsz
13421 : see if getprotobyname exists
13422 set getprotobyname d_getpbyname
13425 : see if getprotobynumber exists
13426 set getprotobynumber d_getpbynumber
13429 : see if getprotoent exists
13430 set getprotoent d_getpent
13433 : see if getpgid exists
13434 set getpgid d_getpgid
13437 : see if getpgrp2 exists
13438 set getpgrp2 d_getpgrp2
13441 : see if getppid exists
13442 set getppid d_getppid
13445 : see if getpriority exists
13446 set getpriority d_getprior
13449 : see if getprotobyname_r exists
13450 set getprotobyname_r d_getprotobyname_r
13452 case "$d_getprotobyname_r" in
13454 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13455 case "$d_getprotobyname_r_proto:$usethreads" in
13456 ":define") d_getprotobyname_r_proto=define
13457 set d_getprotobyname_r_proto getprotobyname_r $hdrs
13461 case "$d_getprotobyname_r_proto" in
13463 case "$getprotobyname_r_proto" in
13464 ''|0) try='int getprotobyname_r(const char*, struct protoent*, char*, size_t, struct protoent**);'
13465 ./protochk "extern $try" $hdrs && getprotobyname_r_proto=I_CSBWR ;;
13467 case "$getprotobyname_r_proto" in
13468 ''|0) try='struct protoent* getprotobyname_r(const char*, struct protoent*, char*, int);'
13469 ./protochk "extern $try" $hdrs && getprotobyname_r_proto=S_CSBI ;;
13471 case "$getprotobyname_r_proto" in
13472 ''|0) try='int getprotobyname_r(const char*, struct protoent*, struct protoent_data*);'
13473 ./protochk "extern $try" $hdrs && getprotobyname_r_proto=I_CSD ;;
13475 case "$getprotobyname_r_proto" in
13476 ''|0) d_getprotobyname_r=undef
13477 getprotobyname_r_proto=0
13478 echo "Disabling getprotobyname_r, cannot determine prototype." >&4 ;;
13479 * ) case "$getprotobyname_r_proto" in
13480 REENTRANT_PROTO*) ;;
13481 *) getprotobyname_r_proto="REENTRANT_PROTO_$getprotobyname_r_proto" ;;
13483 echo "Prototype: $try" ;;
13486 *) case "$usethreads" in
13487 define) echo "getprotobyname_r has no prototype, not using it." >&4 ;;
13489 d_getprotobyname_r=undef
13490 getprotobyname_r_proto=0
13494 *) getprotobyname_r_proto=0
13498 : see if getprotobynumber_r exists
13499 set getprotobynumber_r d_getprotobynumber_r
13501 case "$d_getprotobynumber_r" in
13503 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13504 case "$d_getprotobynumber_r_proto:$usethreads" in
13505 ":define") d_getprotobynumber_r_proto=define
13506 set d_getprotobynumber_r_proto getprotobynumber_r $hdrs
13510 case "$d_getprotobynumber_r_proto" in
13512 case "$getprotobynumber_r_proto" in
13513 ''|0) try='int getprotobynumber_r(int, struct protoent*, char*, size_t, struct protoent**);'
13514 ./protochk "extern $try" $hdrs && getprotobynumber_r_proto=I_ISBWR ;;
13516 case "$getprotobynumber_r_proto" in
13517 ''|0) try='struct protoent* getprotobynumber_r(int, struct protoent*, char*, int);'
13518 ./protochk "extern $try" $hdrs && getprotobynumber_r_proto=S_ISBI ;;
13520 case "$getprotobynumber_r_proto" in
13521 ''|0) try='int getprotobynumber_r(int, struct protoent*, struct protoent_data*);'
13522 ./protochk "extern $try" $hdrs && getprotobynumber_r_proto=I_ISD ;;
13524 case "$getprotobynumber_r_proto" in
13525 ''|0) d_getprotobynumber_r=undef
13526 getprotobynumber_r_proto=0
13527 echo "Disabling getprotobynumber_r, cannot determine prototype." >&4 ;;
13528 * ) case "$getprotobynumber_r_proto" in
13529 REENTRANT_PROTO*) ;;
13530 *) getprotobynumber_r_proto="REENTRANT_PROTO_$getprotobynumber_r_proto" ;;
13532 echo "Prototype: $try" ;;
13535 *) case "$usethreads" in
13536 define) echo "getprotobynumber_r has no prototype, not using it." >&4 ;;
13538 d_getprotobynumber_r=undef
13539 getprotobynumber_r_proto=0
13543 *) getprotobynumber_r_proto=0
13547 : see if getprotoent_r exists
13548 set getprotoent_r d_getprotoent_r
13550 case "$d_getprotoent_r" in
13552 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13553 case "$d_getprotoent_r_proto:$usethreads" in
13554 ":define") d_getprotoent_r_proto=define
13555 set d_getprotoent_r_proto getprotoent_r $hdrs
13559 case "$d_getprotoent_r_proto" in
13561 case "$getprotoent_r_proto" in
13562 ''|0) try='int getprotoent_r(struct protoent*, char*, size_t, struct protoent**);'
13563 ./protochk "extern $try" $hdrs && getprotoent_r_proto=I_SBWR ;;
13565 case "$getprotoent_r_proto" in
13566 ''|0) try='int getprotoent_r(struct protoent*, char*, int);'
13567 ./protochk "extern $try" $hdrs && getprotoent_r_proto=I_SBI ;;
13569 case "$getprotoent_r_proto" in
13570 ''|0) try='struct protoent* getprotoent_r(struct protoent*, char*, int);'
13571 ./protochk "extern $try" $hdrs && getprotoent_r_proto=S_SBI ;;
13573 case "$getprotoent_r_proto" in
13574 ''|0) try='int getprotoent_r(struct protoent*, struct protoent_data*);'
13575 ./protochk "extern $try" $hdrs && getprotoent_r_proto=I_SD ;;
13577 case "$getprotoent_r_proto" in
13578 ''|0) d_getprotoent_r=undef
13579 getprotoent_r_proto=0
13580 echo "Disabling getprotoent_r, cannot determine prototype." >&4 ;;
13581 * ) case "$getprotoent_r_proto" in
13582 REENTRANT_PROTO*) ;;
13583 *) getprotoent_r_proto="REENTRANT_PROTO_$getprotoent_r_proto" ;;
13585 echo "Prototype: $try" ;;
13588 *) case "$usethreads" in
13589 define) echo "getprotoent_r has no prototype, not using it." >&4 ;;
13591 d_getprotoent_r=undef
13592 getprotoent_r_proto=0
13596 *) getprotoent_r_proto=0
13600 : see if prototypes for various getprotoxxx netdb.h functions are available
13602 set d_getprotoprotos getprotoent $i_netdb netdb.h
13605 : see if getprpwnam exists
13606 set getprpwnam d_getprpwnam
13609 : see if getpwent exists
13610 set getpwent d_getpwent
13613 : see if getpwent_r exists
13614 set getpwent_r d_getpwent_r
13616 case "$d_getpwent_r" in
13618 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
13619 case "$d_getpwent_r_proto:$usethreads" in
13620 ":define") d_getpwent_r_proto=define
13621 set d_getpwent_r_proto getpwent_r $hdrs
13625 case "$d_getpwent_r_proto" in
13627 case "$getpwent_r_proto" in
13628 ''|0) try='int getpwent_r(struct passwd*, char*, size_t, struct passwd**);'
13629 ./protochk "extern $try" $hdrs && getpwent_r_proto=I_SBWR ;;
13631 case "$getpwent_r_proto" in
13632 ''|0) try='int getpwent_r(struct passwd*, char*, int, struct passwd**);'
13633 ./protochk "extern $try" $hdrs && getpwent_r_proto=I_SBIR ;;
13635 case "$getpwent_r_proto" in
13636 ''|0) try='struct passwd* getpwent_r(struct passwd*, char*, size_t);'
13637 ./protochk "extern $try" $hdrs && getpwent_r_proto=S_SBW ;;
13639 case "$getpwent_r_proto" in
13640 ''|0) try='struct passwd* getpwent_r(struct passwd*, char*, int);'
13641 ./protochk "extern $try" $hdrs && getpwent_r_proto=S_SBI ;;
13643 case "$getpwent_r_proto" in
13644 ''|0) try='int getpwent_r(struct passwd*, char*, int);'
13645 ./protochk "extern $try" $hdrs && getpwent_r_proto=I_SBI ;;
13647 case "$getpwent_r_proto" in
13648 ''|0) try='int getpwent_r(struct passwd*, char*, int, FILE**);'
13649 ./protochk "extern $try" $hdrs && getpwent_r_proto=I_SBIH ;;
13651 case "$getpwent_r_proto" in
13652 ''|0) d_getpwent_r=undef
13654 echo "Disabling getpwent_r, cannot determine prototype." >&4 ;;
13655 * ) case "$getpwent_r_proto" in
13656 REENTRANT_PROTO*) ;;
13657 *) getpwent_r_proto="REENTRANT_PROTO_$getpwent_r_proto" ;;
13659 echo "Prototype: $try" ;;
13662 *) case "$usethreads" in
13663 define) echo "getpwent_r has no prototype, not using it." >&4 ;;
13670 *) getpwent_r_proto=0
13674 : see if getpwnam_r exists
13675 set getpwnam_r d_getpwnam_r
13677 case "$d_getpwnam_r" in
13679 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
13680 case "$d_getpwnam_r_proto:$usethreads" in
13681 ":define") d_getpwnam_r_proto=define
13682 set d_getpwnam_r_proto getpwnam_r $hdrs
13686 case "$d_getpwnam_r_proto" in
13688 case "$getpwnam_r_proto" in
13689 ''|0) try='int getpwnam_r(const char*, struct passwd*, char*, size_t, struct passwd**);'
13690 ./protochk "extern $try" $hdrs && getpwnam_r_proto=I_CSBWR ;;
13692 case "$getpwnam_r_proto" in
13693 ''|0) try='int getpwnam_r(const char*, struct passwd*, char*, int, struct passwd**);'
13694 ./protochk "extern $try" $hdrs && getpwnam_r_proto=I_CSBIR ;;
13696 case "$getpwnam_r_proto" in
13697 ''|0) try='struct passwd* getpwnam_r(const char*, struct passwd*, char*, int);'
13698 ./protochk "extern $try" $hdrs && getpwnam_r_proto=S_CSBI ;;
13700 case "$getpwnam_r_proto" in
13701 ''|0) try='int getpwnam_r(const char*, struct passwd*, char*, int);'
13702 ./protochk "extern $try" $hdrs && getpwnam_r_proto=I_CSBI ;;
13704 case "$getpwnam_r_proto" in
13705 ''|0) d_getpwnam_r=undef
13707 echo "Disabling getpwnam_r, cannot determine prototype." >&4 ;;
13708 * ) case "$getpwnam_r_proto" in
13709 REENTRANT_PROTO*) ;;
13710 *) getpwnam_r_proto="REENTRANT_PROTO_$getpwnam_r_proto" ;;
13712 echo "Prototype: $try" ;;
13715 *) case "$usethreads" in
13716 define) echo "getpwnam_r has no prototype, not using it." >&4 ;;
13723 *) getpwnam_r_proto=0
13727 : see if getpwuid_r exists
13728 set getpwuid_r d_getpwuid_r
13730 case "$d_getpwuid_r" in
13732 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
13733 case "$d_getpwuid_r_proto:$usethreads" in
13734 ":define") d_getpwuid_r_proto=define
13735 set d_getpwuid_r_proto getpwuid_r $hdrs
13739 case "$d_getpwuid_r_proto" in
13741 case "$getpwuid_r_proto" in
13742 ''|0) try='int getpwuid_r(uid_t, struct passwd*, char*, size_t, struct passwd**);'
13743 ./protochk "extern $try" $hdrs && getpwuid_r_proto=I_TSBWR ;;
13745 case "$getpwuid_r_proto" in
13746 ''|0) try='int getpwuid_r(uid_t, struct passwd*, char*, int, struct passwd**);'
13747 ./protochk "extern $try" $hdrs && getpwuid_r_proto=I_TSBIR ;;
13749 case "$getpwuid_r_proto" in
13750 ''|0) try='int getpwuid_r(uid_t, struct passwd*, char*, int);'
13751 ./protochk "extern $try" $hdrs && getpwuid_r_proto=I_TSBI ;;
13753 case "$getpwuid_r_proto" in
13754 ''|0) try='struct passwd* getpwuid_r(uid_t, struct passwd*, char*, int);'
13755 ./protochk "extern $try" $hdrs && getpwuid_r_proto=S_TSBI ;;
13757 case "$getpwuid_r_proto" in
13758 ''|0) d_getpwuid_r=undef
13760 echo "Disabling getpwuid_r, cannot determine prototype." >&4 ;;
13761 * ) case "$getpwuid_r_proto" in
13762 REENTRANT_PROTO*) ;;
13763 *) getpwuid_r_proto="REENTRANT_PROTO_$getpwuid_r_proto" ;;
13765 echo "Prototype: $try" ;;
13768 *) case "$usethreads" in
13769 define) echo "getpwuid_r has no prototype, not using it." >&4 ;;
13776 *) getpwuid_r_proto=0
13781 : see if getservbyname exists
13782 set getservbyname d_getsbyname
13785 : see if getservbyport exists
13786 set getservbyport d_getsbyport
13789 : see if getservent exists
13790 set getservent d_getsent
13793 : see if getservbyname_r exists
13794 set getservbyname_r d_getservbyname_r
13796 case "$d_getservbyname_r" in
13798 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13799 case "$d_getservbyname_r_proto:$usethreads" in
13800 ":define") d_getservbyname_r_proto=define
13801 set d_getservbyname_r_proto getservbyname_r $hdrs
13805 case "$d_getservbyname_r_proto" in
13807 case "$getservbyname_r_proto" in
13808 ''|0) try='int getservbyname_r(const char*, const char*, struct servent*, char*, size_t, struct servent**);'
13809 ./protochk "extern $try" $hdrs && getservbyname_r_proto=I_CCSBWR ;;
13811 case "$getservbyname_r_proto" in
13812 ''|0) try='struct servent* getservbyname_r(const char*, const char*, struct servent*, char*, int);'
13813 ./protochk "extern $try" $hdrs && getservbyname_r_proto=S_CCSBI ;;
13815 case "$getservbyname_r_proto" in
13816 ''|0) try='int getservbyname_r(const char*, const char*, struct servent*, struct servent_data*);'
13817 ./protochk "extern $try" $hdrs && getservbyname_r_proto=I_CCSD ;;
13819 case "$getservbyname_r_proto" in
13820 ''|0) d_getservbyname_r=undef
13821 getservbyname_r_proto=0
13822 echo "Disabling getservbyname_r, cannot determine prototype." >&4 ;;
13823 * ) case "$getservbyname_r_proto" in
13824 REENTRANT_PROTO*) ;;
13825 *) getservbyname_r_proto="REENTRANT_PROTO_$getservbyname_r_proto" ;;
13827 echo "Prototype: $try" ;;
13830 *) case "$usethreads" in
13831 define) echo "getservbyname_r has no prototype, not using it." >&4 ;;
13833 d_getservbyname_r=undef
13834 getservbyname_r_proto=0
13838 *) getservbyname_r_proto=0
13842 : see if getservbyport_r exists
13843 set getservbyport_r d_getservbyport_r
13845 case "$d_getservbyport_r" in
13847 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13848 case "$d_getservbyport_r_proto:$usethreads" in
13849 ":define") d_getservbyport_r_proto=define
13850 set d_getservbyport_r_proto getservbyport_r $hdrs
13854 case "$d_getservbyport_r_proto" in
13856 case "$getservbyport_r_proto" in
13857 ''|0) try='int getservbyport_r(int, const char*, struct servent*, char*, size_t, struct servent**);'
13858 ./protochk "extern $try" $hdrs && getservbyport_r_proto=I_ICSBWR ;;
13860 case "$getservbyport_r_proto" in
13861 ''|0) try='struct servent* getservbyport_r(int, const char*, struct servent*, char*, int);'
13862 ./protochk "extern $try" $hdrs && getservbyport_r_proto=S_ICSBI ;;
13864 case "$getservbyport_r_proto" in
13865 ''|0) try='int getservbyport_r(int, const char*, struct servent*, struct servent_data*);'
13866 ./protochk "extern $try" $hdrs && getservbyport_r_proto=I_ICSD ;;
13868 case "$getservbyport_r_proto" in
13869 ''|0) d_getservbyport_r=undef
13870 getservbyport_r_proto=0
13871 echo "Disabling getservbyport_r, cannot determine prototype." >&4 ;;
13872 * ) case "$getservbyport_r_proto" in
13873 REENTRANT_PROTO*) ;;
13874 *) getservbyport_r_proto="REENTRANT_PROTO_$getservbyport_r_proto" ;;
13876 echo "Prototype: $try" ;;
13879 *) case "$usethreads" in
13880 define) echo "getservbyport_r has no prototype, not using it." >&4 ;;
13882 d_getservbyport_r=undef
13883 getservbyport_r_proto=0
13887 *) getservbyport_r_proto=0
13891 : see if getservent_r exists
13892 set getservent_r d_getservent_r
13894 case "$d_getservent_r" in
13896 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13897 case "$d_getservent_r_proto:$usethreads" in
13898 ":define") d_getservent_r_proto=define
13899 set d_getservent_r_proto getservent_r $hdrs
13903 case "$d_getservent_r_proto" in
13905 case "$getservent_r_proto" in
13906 ''|0) try='int getservent_r(struct servent*, char*, size_t, struct servent**);'
13907 ./protochk "extern $try" $hdrs && getservent_r_proto=I_SBWR ;;
13909 case "$getservent_r_proto" in
13910 ''|0) try='int getservent_r(struct servent*, char*, int);'
13911 ./protochk "extern $try" $hdrs && getservent_r_proto=I_SBI ;;
13913 case "$getservent_r_proto" in
13914 ''|0) try='struct servent* getservent_r(struct servent*, char*, int);'
13915 ./protochk "extern $try" $hdrs && getservent_r_proto=S_SBI ;;
13917 case "$getservent_r_proto" in
13918 ''|0) try='int getservent_r(struct servent*, struct servent_data*);'
13919 ./protochk "extern $try" $hdrs && getservent_r_proto=I_SD ;;
13921 case "$getservent_r_proto" in
13922 ''|0) d_getservent_r=undef
13923 getservent_r_proto=0
13924 echo "Disabling getservent_r, cannot determine prototype." >&4 ;;
13925 * ) case "$getservent_r_proto" in
13926 REENTRANT_PROTO*) ;;
13927 *) getservent_r_proto="REENTRANT_PROTO_$getservent_r_proto" ;;
13929 echo "Prototype: $try" ;;
13932 *) case "$usethreads" in
13933 define) echo "getservent_r has no prototype, not using it." >&4 ;;
13935 d_getservent_r=undef
13936 getservent_r_proto=0
13940 *) getservent_r_proto=0
13944 : see if prototypes for various getservxxx netdb.h functions are available
13946 set d_getservprotos getservent $i_netdb netdb.h
13949 : see if getspnam exists
13950 set getspnam d_getspnam
13953 : see if this is a shadow.h system
13954 set shadow.h i_shadow
13957 : see if getspnam_r exists
13958 set getspnam_r d_getspnam_r
13960 case "$d_getspnam_r" in
13962 hdrs="$i_systypes sys/types.h define stdio.h $i_shadow shadow.h"
13963 case "$d_getspnam_r_proto:$usethreads" in
13964 ":define") d_getspnam_r_proto=define
13965 set d_getspnam_r_proto getspnam_r $hdrs
13969 case "$d_getspnam_r_proto" in
13971 case "$getspnam_r_proto" in
13972 ''|0) try='int getspnam_r(const char*, struct spwd*, char*, size_t, struct spwd**);'
13973 ./protochk "extern $try" $hdrs && getspnam_r_proto=I_CSBWR ;;
13975 case "$getspnam_r_proto" in
13976 ''|0) try='struct spwd* getspnam_r(const char*, struct spwd*, char*, int);'
13977 ./protochk "extern $try" $hdrs && getspnam_r_proto=S_CSBI ;;
13979 case "$getspnam_r_proto" in
13980 ''|0) d_getspnam_r=undef
13982 echo "Disabling getspnam_r, cannot determine prototype." >&4 ;;
13983 * ) case "$getspnam_r_proto" in
13984 REENTRANT_PROTO*) ;;
13985 *) getspnam_r_proto="REENTRANT_PROTO_$getspnam_r_proto" ;;
13987 echo "Prototype: $try" ;;
13990 *) case "$usethreads" in
13991 define) echo "getspnam_r has no prototype, not using it." >&4 ;;
13998 *) getspnam_r_proto=0
14002 : see if gettimeofday or ftime exists
14003 set gettimeofday d_gettimeod
14005 case "$d_gettimeod" in
14011 val="$undef"; set d_ftime; eval $setvar
14014 case "$d_gettimeod$d_ftime" in
14017 echo 'No ftime() nor gettimeofday() -- timing may be less accurate.' >&4
14021 : see if gmtime_r exists
14022 set gmtime_r d_gmtime_r
14024 case "$d_gmtime_r" in
14026 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
14027 case "$d_gmtime_r_proto:$usethreads" in
14028 ":define") d_gmtime_r_proto=define
14029 set d_gmtime_r_proto gmtime_r $hdrs
14033 case "$d_gmtime_r_proto" in
14035 case "$gmtime_r_proto" in
14036 ''|0) try='struct tm* gmtime_r(const time_t*, struct tm*);'
14037 ./protochk "extern $try" $hdrs && gmtime_r_proto=S_TS ;;
14039 case "$gmtime_r_proto" in
14040 ''|0) try='int gmtime_r(const time_t*, struct tm*);'
14041 ./protochk "extern $try" $hdrs && gmtime_r_proto=I_TS ;;
14043 case "$gmtime_r_proto" in
14044 ''|0) d_gmtime_r=undef
14046 echo "Disabling gmtime_r, cannot determine prototype." >&4 ;;
14047 * ) case "$gmtime_r_proto" in
14048 REENTRANT_PROTO*) ;;
14049 *) gmtime_r_proto="REENTRANT_PROTO_$gmtime_r_proto" ;;
14051 echo "Prototype: $try" ;;
14054 *) case "$usethreads" in
14055 define) echo "gmtime_r has no prototype, not using it." >&4 ;;
14062 *) gmtime_r_proto=0
14066 : see if hasmntopt exists
14067 set hasmntopt d_hasmntopt
14070 : see if this is a netinet/in.h or sys/in.h system
14071 set netinet/in.h i_niin sys/in.h i_sysin
14074 : see if arpa/inet.h has to be included
14075 set arpa/inet.h i_arpainet
14078 : see if htonl --and friends-- exists
14083 : Maybe they are macros.
14086 $cat >htonl.c <<EOM
14088 #include <sys/types.h>
14089 #$i_niin I_NETINET_IN
14091 #$i_arpainet I_ARPA_INET
14092 #ifdef I_NETINET_IN
14093 #include <netinet/in.h>
14096 #include <sys/in.h>
14099 #include <arpa/inet.h>
14102 printf("Defined as a macro.");
14105 $cppstdin $cppflags $cppminus < htonl.c >htonl.E 2>/dev/null
14106 if $contains 'Defined as a macro' htonl.E >/dev/null 2>&1; then
14108 echo "But it seems to be defined as a macro." >&4
14116 : see if ilogbl exists
14117 set ilogbl d_ilogbl
14122 if set index val -f; eval $csym; $val; then
14123 if set strchr val -f d_strchr; eval $csym; $val; then
14124 if $contains strchr "$strings" >/dev/null 2>&1 ; then
14127 echo "strchr() found." >&4
14131 echo "index() found." >&4
14136 echo "index() found." >&4
14139 if set strchr val -f d_strchr; eval $csym; $val; then
14142 echo "strchr() found." >&4
14144 echo "No index() or strchr() found!" >&4
14149 set d_strchr; eval $setvar
14151 set d_index; eval $setvar
14153 : check whether inet_aton exists
14154 set inet_aton d_inetaton
14159 $cat >isascii.c <<EOCP
14162 #$i_stdlib I_STDLIB
14164 #include <stdlib.h>
14175 if eval $compile; then
14176 echo "isascii() found." >&4
14179 echo "isascii() NOT found." >&4
14186 : see if isfinite exists
14187 set isfinite d_isfinite
14190 : see if isinf exists
14194 : see if isnan exists
14198 : see if isnanl exists
14199 set isnanl d_isnanl
14202 : see if killpg exists
14203 set killpg d_killpg
14206 : see if lchown exists
14208 $cat > try.c <<'EOCP'
14209 /* System header to define __stub macros and hopefully few prototypes,
14210 which can conflict with char lchown(); below. */
14211 #include <assert.h>
14212 /* Override any gcc2 internal prototype to avoid an error. */
14213 /* We use char because int might match the return type of a gcc2
14214 builtin and then its argument prototype would still apply. */
14217 /* The GNU C library defines this for functions which it implements
14218 to always fail with ENOSYS. Some functions are actually named
14219 something starting with __ and the normal name is an alias. */
14220 #if defined (__stub_lchown) || defined (__stub___lchown)
14228 if eval $compile; then
14229 $echo "lchown() found." >&4
14232 $echo "lchown() NOT found." >&4
14238 : See if number of significant digits in a double precision number is known
14240 $cat >ldbl_dig.c <<EOM
14241 #$i_limits I_LIMITS
14244 #include <limits.h>
14250 printf("Contains LDBL_DIG");
14253 $cppstdin $cppflags $cppminus < ldbl_dig.c >ldbl_dig.E 2>/dev/null
14254 if $contains 'LDBL_DIG' ldbl_dig.E >/dev/null 2>&1; then
14255 echo "LDBL_DIG found." >&4
14258 echo "LDBL_DIG NOT found." >&4
14265 : see if this is a math.h system
14269 d_libm_lib_version="$undef"
14272 : check to see if math.h defines _LIB_VERSION
14274 echo "Checking to see if your libm supports _LIB_VERSION..." >&4
14276 #include <unistd.h>
14278 int main (int argc, char *argv[])
14280 printf ("%d\n", _LIB_VERSION);
14285 if eval $compile; then
14287 echo "Yes, it does ($foo)" >&4
14288 d_libm_lib_version="$define"
14290 echo "No, it does not (probably harmless)\n" >&4
14292 $rm -f try.* try core core.try.*
14297 : see if link exists
14301 : see if localtime_r exists
14302 set localtime_r d_localtime_r
14304 case "$d_localtime_r" in
14306 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
14307 case "$d_localtime_r_proto:$usethreads" in
14308 ":define") d_localtime_r_proto=define
14309 set d_localtime_r_proto localtime_r $hdrs
14313 case "$d_localtime_r_proto" in
14315 case "$localtime_r_proto" in
14316 ''|0) try='struct tm* localtime_r(const time_t*, struct tm*);'
14317 ./protochk "extern $try" $hdrs && localtime_r_proto=S_TS ;;
14319 case "$localtime_r_proto" in
14320 ''|0) try='int localtime_r(const time_t*, struct tm*);'
14321 ./protochk "extern $try" $hdrs && localtime_r_proto=I_TS ;;
14323 case "$localtime_r_proto" in
14324 ''|0) d_localtime_r=undef
14325 localtime_r_proto=0
14326 echo "Disabling localtime_r, cannot determine prototype." >&4 ;;
14327 * ) case "$localtime_r_proto" in
14328 REENTRANT_PROTO*) ;;
14329 *) localtime_r_proto="REENTRANT_PROTO_$localtime_r_proto" ;;
14331 echo "Prototype: $try" ;;
14334 *) case "$usethreads" in
14335 define) echo "localtime_r has no prototype, not using it." >&4 ;;
14337 d_localtime_r=undef
14338 localtime_r_proto=0
14342 *) localtime_r_proto=0
14346 : see if localeconv exists
14347 set localeconv d_locconv
14350 : see if lockf exists
14354 : see if prototype for lseek is available
14356 set d_lseekproto lseek $i_systypes sys/types.h $i_unistd unistd.h
14359 : see if lstat exists
14363 : see if madvise exists
14364 set madvise d_madvise
14367 : see if malloc_size exists
14368 set malloc_size d_malloc_size
14371 : see if malloc_size_good exists
14372 set malloc_good_size d_malloc_good_size
14375 : see if mblen exists
14379 : see if mbstowcs exists
14380 set mbstowcs d_mbstowcs
14383 : see if mbtowc exists
14384 set mbtowc d_mbtowc
14387 : see if memchr exists
14388 set memchr d_memchr
14391 : see if memcmp exists
14392 set memcmp d_memcmp
14395 : see if memcpy exists
14396 set memcpy d_memcpy
14399 : see if memmove exists
14400 set memmove d_memmove
14403 : see if memset exists
14404 set memset d_memset
14407 : see if mkdir exists
14411 : see if mkdtemp exists
14412 set mkdtemp d_mkdtemp
14415 : see if mkfifo exists
14416 set mkfifo d_mkfifo
14419 : see if mkstemp exists
14420 set mkstemp d_mkstemp
14423 : see if mkstemps exists
14424 set mkstemps d_mkstemps
14427 : see if mktime exists
14428 set mktime d_mktime
14431 : see if this is a sys/mman.h system
14432 set sys/mman.h i_sysmman
14435 : see if mmap exists
14438 : see what shmat returns
14439 : default to something harmless
14441 case "$i_sysmman$d_mmap" in
14443 $cat >mmap.c <<'END'
14444 #include <sys/mman.h>
14447 if $cc $ccflags -c mmap.c >/dev/null 2>&1; then
14452 echo "and it returns ($mmaptype)." >&4
14458 : see if sqrtl exists
14462 : see if scalbnl exists
14463 set scalbnl d_scalbnl
14466 : see if modfl exists
14470 : see if prototype for modfl is available
14472 set d_modflproto modfl $i_math math.h
14475 d_modfl_pow32_bug="$undef"
14477 case "$d_longdbl$d_modfl" in
14480 Checking to see whether your modfl() is okay for large values...
14486 if $test "X$d_modflproto" != "X$define"; then
14487 $cat >>try.c <<EOCP
14488 /* Sigh. many current glibcs provide the function, but do not prototype it. */
14489 long double modfl (long double, long double *);
14492 $cat >>try.c <<EOCP
14494 long double nv = 4294967303.15;
14500 printf(" %"$sPRIfldbl" %"$sPRIfldbl" %"$sPRIfldbl"\n", nv, v, w);
14504 case "$osname:$gccversion" in
14505 aix:) saveccflags="$ccflags"
14506 ccflags="$ccflags -qlongdouble" ;; # to avoid core dump
14509 if eval $compile; then
14512 *" 4294967303.150000 1.150000 4294967302.000000")
14513 echo >&4 "Your modfl() is broken for large values."
14514 d_modfl_pow32_bug="$define"
14516 glibc) echo >&4 "You should upgrade your glibc to at least 2.2.2 to get a fixed modfl()."
14520 *" 4294967303.150000 0.150000 4294967303.000000")
14521 echo >&4 "Your modfl() seems okay for large values."
14523 *) echo >&4 "I don't understand your modfl() at all."
14527 $rm -f try.* try core core.try.*
14529 echo "I cannot figure out whether your modfl() is okay, assuming it isn't."
14532 case "$osname:$gccversion" in
14533 aix:) ccflags="$saveccflags" ;; # restore
14538 if $test "$uselongdouble" = "$define"; then
14540 if $test "$d_sqrtl" != "$define"; then
14541 message="$message sqrtl"
14543 if $test "$d_modfl" != "$define"; then
14544 if $test "$d_aintl:$d_copysignl" = "$define:$define"; then
14545 echo "You have both aintl and copysignl, so I can emulate modfl."
14547 message="$message modfl"
14550 if $test "$d_frexpl" != "$define"; then
14551 if $test "$d_ilogbl:$d_scalbnl" = "$define:$define"; then
14552 echo "You have both ilogbl and scalbnl, so I can emulate frexpl."
14554 message="$message frexpl"
14558 if $test "$message" != ""; then
14561 *** You requested the use of long doubles but you do not seem to have
14562 *** the following mathematical functions needed for long double support:
14564 *** Please rerun Configure without -Duselongdouble and/or -Dusemorebits.
14565 *** Cannot continue, aborting.
14573 : see if mprotect exists
14574 set mprotect d_mprotect
14577 : see if msgctl exists
14578 set msgctl d_msgctl
14581 : see if msgget exists
14582 set msgget d_msgget
14585 : see if msgsnd exists
14586 set msgsnd d_msgsnd
14589 : see if msgrcv exists
14590 set msgrcv d_msgrcv
14593 : see how much of the 'msg*(2)' library is present.
14596 case "$d_msgctl$d_msgget$d_msgsnd$d_msgrcv" in
14597 *"$undef"*) h_msg=false;;
14601 case "`ipcs 2>&1`" in
14602 "SVID messages"*"not configured"*)
14603 echo "Your $osname does not have the msg*(2) configured." >&4
14606 set msgctl d_msgctl
14608 set msgget d_msgget
14610 set msgsnd d_msgsnd
14612 set msgrcv d_msgrcv
14618 : we could also check for sys/ipc.h ...
14619 if $h_msg && $test `./findhdr sys/msg.h`; then
14620 echo "You have the full msg*(2) library." >&4
14623 echo "You don't have the full msg*(2) library." >&4
14631 echo "Checking to see if your system supports struct msghdr..." >&4
14632 set d_msghdr_s msghdr $i_systypes sys/types.h $d_socket sys/socket.h $i_sysuio sys/uio.h
14634 case "$d_msghdr_s" in
14635 "$define") echo "Yes, it does." ;;
14636 *) echo "No, it doesn't." ;;
14640 : see if msync exists
14644 : see if munmap exists
14645 set munmap d_munmap
14648 : see if nice exists
14652 : see if this is a langinfo.h system
14653 set langinfo.h i_langinfo
14656 : see if nl_langinfo exists
14657 set nl_langinfo d_nl_langinfo
14660 : check for length of character
14662 case "$charsize" in
14664 echo "Checking to see how big your characters are (hey, you never know)..." >&4
14667 #$i_stdlib I_STDLIB
14669 #include <stdlib.h>
14673 printf("%d\n", (int)sizeof(char));
14678 if eval $compile_ok; then
14682 echo "(I can't seem to compile the test program. Guessing...)"
14689 rp="What is the size of a character (in bytes)?"
14694 : check for volatile keyword
14696 echo 'Checking to see if your C compiler knows about "volatile"...' >&4
14697 $cat >try.c <<'EOCP'
14700 typedef struct _goo_struct goo_struct;
14701 goo_struct * volatile goo = ((goo_struct *)0);
14702 struct _goo_struct {
14707 typedef unsigned short foo_t;
14708 char *volatile foo;
14710 volatile foo_t blech;
14714 if $cc -c $ccflags try.c >/dev/null 2>&1 ; then
14716 echo "Yup, it does."
14719 echo "Nope, it doesn't."
14727 $echo "Choosing the C types to be used for Perl's internal types..." >&4
14729 case "$use64bitint:$d_quad:$quadtype" in
14732 uvtype="$uquadtype"
14737 uvtype="unsigned long"
14743 case "$uselongdouble:$d_longdbl" in
14745 nvtype="long double"
14746 nvsize=$longdblsize
14753 $echo "(IV will be "$ivtype", $ivsize bytes)"
14754 $echo "(UV will be "$uvtype", $uvsize bytes)"
14755 $echo "(NV will be "$nvtype", $nvsize bytes)"
14758 #$i_inttypes I_INTTYPES
14760 #include <inttypes.h>
14765 int8_t i = INT8_MAX;
14766 uint8_t u = UINT8_MAX;
14767 printf("int8_t\n");
14770 int16_t i = INT16_MAX;
14771 uint16_t i = UINT16_MAX;
14772 printf("int16_t\n");
14775 int32_t i = INT32_MAX;
14776 uint32_t u = UINT32_MAX;
14777 printf("int32_t\n");
14783 '') case "$charsize" in
14785 u8type="unsigned char"
14794 if eval $compile; then
14795 case "`$run ./try`" in
14796 int8_t) i8type=int8_t
14806 '') if $test $charsize -ge 1; then
14808 u8type="unsigned char"
14816 '') case "$shortsize" in
14818 u16type="unsigned short"
14826 '') set try -DINT16
14827 if eval $compile; then
14828 case "`$run ./try`" in
14840 '') if $test $shortsize -ge 2; then
14842 u16type="unsigned short"
14850 '') case "$longsize" in
14852 u32type="unsigned long"
14856 *) case "$intsize" in
14858 u32type="unsigned int"
14868 '') set try -DINT32
14869 if eval $compile; then
14870 case "`$run ./try`" in
14882 '') if $test $intsize -ge 4; then
14884 u32type="unsigned int"
14892 '') case "$d_quad:$quadtype" in
14894 i64type="$quadtype"
14895 u64type="$uquadtype"
14903 $echo "Checking how many bits of your UVs your NVs can preserve..." >&4
14904 : volatile so that the compiler has to store it out to memory.
14905 if test X"$d_volatile" = X"$define"; then
14910 #$i_stdlib I_STDLIB
14912 #include <stdlib.h>
14914 #include <sys/types.h>
14915 #include <signal.h>
14917 $volatile int bletched = 0;
14918 $signal_t blech(s) int s; { bletched = 1; }
14923 int n = 8 * $uvsize;
14926 signal(SIGFPE, blech);
14929 for (i = 0; i < n; i++) {
14930 u = u << 1 | ($uvtype)1;
14932 if (($uvtype)d != u)
14936 d = ($nvtype)(u - 1);
14937 if (($uvtype)d != (u - 1))
14945 printf("%d\n", ((i == n) ? -n : i));
14951 d_nv_preserves_uv="$undef"
14952 if eval $compile; then
14953 nv_preserves_uv_bits="`$run ./try`"
14955 case "$nv_preserves_uv_bits" in
14957 nv_preserves_uv_bits=`expr 0 - $nv_preserves_uv_bits`
14958 $echo "Your NVs can preserve all $nv_preserves_uv_bits bits of your UVs." 2>&1
14959 d_nv_preserves_uv="$define"
14961 [1-9]*) $echo "Your NVs can preserve only $nv_preserves_uv_bits bits of your UVs." 2>&1
14962 d_nv_preserves_uv="$undef" ;;
14963 *) $echo "Can't figure out how many bits your NVs preserve." 2>&1
14964 nv_preserves_uv_bits="$undef" ;;
14969 $echo "Checking whether NV 0.0 is all bits zero in memory..." >&4
14970 : volatile so that the compiler has to store it out to memory.
14971 if test X"$d_volatile" = X"$define"; then
14976 #$i_stdlib I_STDLIB
14978 #include <stdlib.h>
14980 #$i_string I_STRING
14982 # include <string.h>
14984 # include <strings.h>
14986 #include <sys/types.h>
14987 #include <signal.h>
14989 $volatile int bletched = 0;
14990 $signal_t blech(s) int s; { bletched = 1; }
14993 int checkit($nvtype d, char *where) {
14994 unsigned char *p = (char *)&d;
14995 unsigned char *end = p + sizeof(d);
15005 printf("No - %s: 0x", where);
15007 printf ("%02X", *p++);
15012 int main(int argc, char **argv) {
15015 fail += checkit(d, "0.0");
15017 /* The compiler shouldn't be assuming that bletched is 0 */
15020 fail += checkit(d, "bleched");
15023 signal(SIGFPE, blech);
15026 /* Paranoia - the compiler should have no way of knowing that ANSI says
15027 that argv[argc] will always be NULL. Actually, if it did assume this it
15028 would be buggy, as this is C and main() can be called from elsewhere in
15030 d = argv[argc] ? 1 : 0;
15033 printf("Odd argv[argc]=%p, d=%g\n", argv[argc], d);
15036 fail += checkit(d, "ternary");
15038 memset(&d, sizeof(d), argv[argc] ? 1 : 0);
15041 printf("No - memset doesn't give 0.0\n");
15042 /* This might just blow up: */
15043 printf("(gives %g)\n", d);
15049 printf("No - something bleched\n");
15054 printf("No - %d fail(s)\n", fail);
15063 d_nv_zero_is_allbits_zero="$undef"
15064 if eval $compile; then
15070 0.0 is represented as all bits zero in memory
15072 d_nv_zero_is_allbits_zero="$define"
15075 0.0 is not represented as all bits zero in memory
15077 d_nv_zero_is_allbits_zero="$undef"
15082 0.0 is not represented as all bits zero in memory
15084 d_nv_zero_is_allbits_zero="$undef"
15092 : check for off64_t
15094 echo "Checking to see if you have off64_t..." >&4
15096 #include <sys/types.h>
15097 #include <unistd.h>
15098 int main() { off64_t x = 7; }
15101 if eval $compile; then
15103 echo "You have off64_t."
15106 echo "You do not have off64_t."
15107 case "$lseeksize" in
15108 8) echo "(Your off_t is 64 bits, so you could use that.)" ;;
15115 : how to create joinable pthreads
15116 if test "X$usethreads" = "X$define" -a "X$i_pthread" = "X$define"; then
15118 echo "Checking what constant to use for creating joinable pthreads..." >&4
15119 $cat >try.c <<'EOCP'
15120 #include <pthread.h>
15122 int detachstate = JOINABLE;
15125 set try -DJOINABLE=PTHREAD_CREATE_JOINABLE
15126 if eval $compile; then
15127 echo "You seem to use PTHREAD_CREATE_JOINABLE." >&4
15128 val="$undef" # Yes, undef.
15129 set d_old_pthread_create_joinable
15132 set old_pthread_create_joinable
15135 set try -DJOINABLE=PTHREAD_CREATE_UNDETACHED
15136 if eval $compile; then
15137 echo "You seem to use PTHREAD_CREATE_UNDETACHED." >&4
15139 set d_old_pthread_create_joinable
15141 val=PTHREAD_CREATE_UNDETACHED
15142 set old_pthread_create_joinable
15145 set try -DJOINABLE=__UNDETACHED
15146 if eval $compile; then
15147 echo "You seem to use __UNDETACHED." >&4
15149 set d_old_pthread_create_joinable
15152 set old_pthread_create_joinable
15155 echo "Egads, nothing obvious found. Guessing that you use 0." >&4
15157 set d_old_pthread_create_joinable
15160 set old_pthread_create_joinable
15167 d_old_pthread_create_joinable="$undef"
15168 old_pthread_create_joinable=""
15171 : see if pause exists
15175 : see if pipe exists
15179 : see if poll exists
15183 : see if readlink exists
15184 set readlink d_readlink
15190 case "$d_readlink" in
15192 if $issymlink /proc/self/exe ; then
15193 $ls -l /proc/self/exe > reflect
15194 if $contains /`basename $ls` reflect >/dev/null 2>&1; then
15195 echo "You have Linux-like /proc/self/exe."
15196 procselfexe='"/proc/self/exe"'
15200 if $issymlink /proc/curproc/file ; then
15201 $ls -l /proc/curproc/file > reflect
15202 if $contains /`basename $ls` reflect >/dev/null 2>&1; then
15203 echo "You have BSD-like /proc/curproc/file."
15204 procselfexe='"/proc/curproc/file"'
15214 : see whether the pthread_atfork exists
15216 #include <pthread.h>
15219 #ifdef PTHREAD_ATFORK
15220 pthread_atfork(NULL,NULL,NULL);
15225 : see if pthread_atfork exists
15226 set try -DPTHREAD_ATFORK
15227 if eval $compile; then
15232 case "$usethreads" in
15235 $define) echo 'pthread_atfork found.' >&4 ;;
15236 *) echo 'pthread_atfork NOT found.' >&4 ;;
15239 set d_pthread_atfork
15242 : see if pthread_attr_setscope exists
15243 set pthread_attr_setscope d_pthread_attr_setscope
15247 : see whether the various POSIXish _yields exist
15249 #include <pthread.h>
15255 #ifdef PTHREAD_YIELD
15258 #ifdef PTHREAD_YIELD_NULL
15259 pthread_yield(NULL);
15265 : see if sched_yield exists
15266 set try -DSCHED_YIELD
15267 if eval $compile; then
15269 sched_yield='sched_yield()'
15273 case "$usethreads" in
15276 $define) echo 'sched_yield() found.' >&4 ;;
15277 *) echo 'sched_yield() NOT found.' >&4 ;;
15283 : see if pthread_yield exists
15284 set try -DPTHREAD_YIELD
15285 if eval $compile; then
15287 case "$sched_yield" in
15288 '') sched_yield='pthread_yield()' ;;
15291 set try -DPTHREAD_YIELD_NULL
15292 if eval $compile; then
15294 case "$sched_yield" in
15295 '') sched_yield='pthread_yield(NULL)' ;;
15301 case "$usethreads" in
15304 $define) echo 'pthread_yield() found.' >&4 ;;
15305 *) echo 'pthread_yield() NOT found.' >&4 ;;
15309 set d_pthread_yield
15312 case "$sched_yield" in
15313 '') sched_yield=undef ;;
15318 : see if random_r exists
15319 set random_r d_random_r
15321 case "$d_random_r" in
15323 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
15324 case "$d_random_r_proto:$usethreads" in
15325 ":define") d_random_r_proto=define
15326 set d_random_r_proto random_r $hdrs
15330 case "$d_random_r_proto" in
15332 case "$random_r_proto" in
15333 ''|0) try='int random_r(int*, struct random_data*);'
15334 ./protochk "extern $try" $hdrs && random_r_proto=I_iS ;;
15336 case "$random_r_proto" in
15337 ''|0) try='int random_r(long*, struct random_data*);'
15338 ./protochk "extern $try" $hdrs && random_r_proto=I_lS ;;
15340 case "$random_r_proto" in
15341 ''|0) try='int random_r(struct random_data*, int32_t*);'
15342 ./protochk "extern $try" $hdrs && random_r_proto=I_St ;;
15344 case "$random_r_proto" in
15345 ''|0) d_random_r=undef
15347 echo "Disabling random_r, cannot determine prototype." >&4 ;;
15348 * ) case "$random_r_proto" in
15349 REENTRANT_PROTO*) ;;
15350 *) random_r_proto="REENTRANT_PROTO_$random_r_proto" ;;
15352 echo "Prototype: $try" ;;
15355 *) case "$usethreads" in
15356 define) echo "random_r has no prototype, not using it." >&4 ;;
15363 *) random_r_proto=0
15367 : see if readdir and friends exist
15368 set readdir d_readdir
15370 set seekdir d_seekdir
15372 set telldir d_telldir
15374 set rewinddir d_rewinddir
15377 : see if readdir64_r exists
15378 set readdir64_r d_readdir64_r
15380 case "$d_readdir64_r" in
15382 hdrs="$i_systypes sys/types.h define stdio.h $i_dirent dirent.h"
15383 case "$d_readdir64_r_proto:$usethreads" in
15384 ":define") d_readdir64_r_proto=define
15385 set d_readdir64_r_proto readdir64_r $hdrs
15389 case "$d_readdir64_r_proto" in
15391 case "$readdir64_r_proto" in
15392 ''|0) try='int readdir64_r(DIR*, struct dirent64*, struct dirent64**);'
15393 ./protochk "extern $try" $hdrs && readdir64_r_proto=I_TSR ;;
15395 case "$readdir64_r_proto" in
15396 ''|0) try='int readdir64_r(DIR*, struct dirent64*);'
15397 ./protochk "extern $try" $hdrs && readdir64_r_proto=I_TS ;;
15399 case "$readdir64_r_proto" in
15400 ''|0) d_readdir64_r=undef
15401 readdir64_r_proto=0
15402 echo "Disabling readdir64_r, cannot determine prototype." >&4 ;;
15403 * ) case "$readdir64_r_proto" in
15404 REENTRANT_PROTO*) ;;
15405 *) readdir64_r_proto="REENTRANT_PROTO_$readdir64_r_proto" ;;
15407 echo "Prototype: $try" ;;
15410 *) case "$usethreads" in
15411 define) echo "readdir64_r has no prototype, not using it." >&4 ;;
15413 d_readdir64_r=undef
15414 readdir64_r_proto=0
15418 *) readdir64_r_proto=0
15422 : see if readdir_r exists
15423 set readdir_r d_readdir_r
15425 case "$d_readdir_r" in
15427 hdrs="$i_systypes sys/types.h define stdio.h $i_dirent dirent.h"
15428 case "$d_readdir_r_proto:$usethreads" in
15429 ":define") d_readdir_r_proto=define
15430 set d_readdir_r_proto readdir_r $hdrs
15434 case "$d_readdir_r_proto" in
15436 case "$readdir_r_proto" in
15437 ''|0) try='int readdir_r(DIR*, struct dirent*, struct dirent**);'
15438 ./protochk "extern $try" $hdrs && readdir_r_proto=I_TSR ;;
15440 case "$readdir_r_proto" in
15441 ''|0) try='int readdir_r(DIR*, struct dirent*);'
15442 ./protochk "extern $try" $hdrs && readdir_r_proto=I_TS ;;
15444 case "$readdir_r_proto" in
15445 ''|0) d_readdir_r=undef
15447 echo "Disabling readdir_r, cannot determine prototype." >&4 ;;
15448 * ) case "$readdir_r_proto" in
15449 REENTRANT_PROTO*) ;;
15450 *) readdir_r_proto="REENTRANT_PROTO_$readdir_r_proto" ;;
15452 echo "Prototype: $try" ;;
15455 *) case "$usethreads" in
15456 define) echo "readdir_r has no prototype, not using it." >&4 ;;
15463 *) readdir_r_proto=0
15467 : see if readv exists
15471 : see if recvmsg exists
15472 set recvmsg d_recvmsg
15475 : see if rename exists
15476 set rename d_rename
15479 : see if rmdir exists
15483 : see if memory.h is available.
15488 : See if it conflicts with string.h
15494 $cppstdin $cppflags $cppminus < $strings > mem.h
15495 if $contains 'memcpy' mem.h >/dev/null 2>&1; then
15497 echo "We won't be including <memory.h>."
15507 : can bcopy handle overlapping blocks?
15510 case "$d_memmove" in
15511 "$define") echo "I'll use memmove() instead of bcopy() for overlapping copies." ;;
15512 *) case "$d_bcopy" in
15514 echo "Checking to see if bcopy() can do overlapping copies..." >&4
15516 #$i_memory I_MEMORY
15517 #$i_stdlib I_STDLIB
15518 #$i_string I_STRING
15519 #$i_unistd I_UNISTD
15521 $cat >>try.c <<'EOCP'
15524 # include <memory.h>
15527 # include <stdlib.h>
15530 # include <string.h>
15532 # include <strings.h>
15535 # include <unistd.h> /* Needed for NetBSD */
15539 char buf[128], abc[128];
15545 /* Copy "abcde..." string to char abc[] so that gcc doesn't
15546 try to store the string in read-only memory. */
15547 bcopy("abcdefghijklmnopqrstuvwxyz0123456789", abc, 36);
15549 for (align = 7; align >= 0; align--) {
15550 for (len = 36; len; len--) {
15552 bcopy(abc, b, len);
15553 for (off = 1; off <= len; off++) {
15554 bcopy(b, b+off, len);
15555 bcopy(b+off, b, len);
15556 if (bcmp(b, abc, len))
15565 if eval $compile_ok; then
15566 if ./try 2>/dev/null; then
15567 echo "Yes, it can."
15570 echo "It can't, sorry."
15573 echo "(I can't compile the test program, so we'll assume not...)"
15577 $rm -f try.* try core
15583 : can memcpy handle overlapping blocks?
15586 case "$d_memmove" in
15587 "$define") echo "I'll use memmove() instead of memcpy() for overlapping copies." ;;
15588 *) case "$d_memcpy" in
15590 echo "Checking to see if memcpy() can do overlapping copies..." >&4
15592 #$i_memory I_MEMORY
15593 #$i_stdlib I_STDLIB
15594 #$i_string I_STRING
15595 #$i_unistd I_UNISTD
15597 $cat >>try.c <<'EOCP'
15600 # include <memory.h>
15603 # include <stdlib.h>
15606 # include <string.h>
15608 # include <strings.h>
15611 # include <unistd.h> /* Needed for NetBSD */
15615 char buf[128], abc[128];
15621 /* Copy "abcde..." string to char abc[] so that gcc doesn't
15622 try to store the string in read-only memory. */
15623 memcpy(abc, "abcdefghijklmnopqrstuvwxyz0123456789", 36);
15625 for (align = 7; align >= 0; align--) {
15626 for (len = 36; len; len--) {
15628 memcpy(b, abc, len);
15629 for (off = 1; off <= len; off++) {
15630 memcpy(b+off, b, len);
15631 memcpy(b, b+off, len);
15632 if (memcmp(b, abc, len))
15641 if eval $compile_ok; then
15642 if ./try 2>/dev/null; then
15643 echo "Yes, it can."
15646 echo "It can't, sorry."
15649 echo "(I can't compile the test program, so we'll assume not...)"
15653 $rm -f try.* try core
15659 : can memcmp be trusted to compare relative magnitude?
15661 case "$d_memcmp" in
15664 echo "Checking if your memcmp() can compare relative magnitude..." >&4
15666 #$i_memory I_MEMORY
15667 #$i_stdlib I_STDLIB
15668 #$i_string I_STRING
15669 #$i_unistd I_UNISTD
15671 $cat >>try.c <<'EOCP'
15674 # include <memory.h>
15677 # include <stdlib.h>
15680 # include <string.h>
15682 # include <strings.h>
15685 # include <unistd.h> /* Needed for NetBSD */
15691 if ((a < b) && memcmp(&a, &b, 1) < 0)
15697 if eval $compile_ok; then
15698 if $run ./try 2>/dev/null; then
15699 echo "Yes, it can."
15702 echo "No, it can't (it uses signed chars)."
15705 echo "(I can't compile the test program, so we'll assume not...)"
15709 $rm -f try.* try core
15713 : see if prototype for sbrk is available
15715 set d_sbrkproto sbrk $i_unistd unistd.h
15718 : see if select exists
15719 set select d_select
15722 : see if semctl exists
15723 set semctl d_semctl
15726 : see if semget exists
15727 set semget d_semget
15730 : see if semop exists
15734 : see how much of the 'sem*(2)' library is present.
15737 case "$d_semctl$d_semget$d_semop" in
15738 *"$undef"*) h_sem=false;;
15742 case "`ipcs 2>&1`" in
15743 "SVID messages"*"not configured"*)
15744 echo "Your $osname does not have the sem*(2) configured." >&4
15747 set semctl d_semctl
15749 set semget d_semget
15757 : we could also check for sys/ipc.h ...
15758 if $h_sem && $test `./findhdr sys/sem.h`; then
15759 echo "You have the full sem*(2) library." >&4
15762 echo "You don't have the full sem*(2) library." >&4
15768 : see whether sys/sem.h defines union semun
15770 $cat > try.c <<'END'
15771 #include <sys/types.h>
15772 #include <sys/ipc.h>
15773 #include <sys/sem.h>
15774 int main () { union semun semun; semun.buf = 0; }
15777 if eval $compile; then
15778 echo "You have union semun in <sys/sem.h>." >&4
15781 echo "You do not have union semun in <sys/sem.h>." >&4
15788 : see how to do semctl IPC_STAT
15795 # define S_IRUSR S_IREAD
15796 # define S_IWUSR S_IWRITE
15797 # define S_IXUSR S_IEXEC
15799 # define S_IRUSR 0400
15800 # define S_IWUSR 0200
15801 # define S_IXUSR 0100
15803 # define S_IRGRP (S_IRUSR>>3)
15804 # define S_IWGRP (S_IWUSR>>3)
15805 # define S_IXGRP (S_IXUSR>>3)
15806 # define S_IROTH (S_IRUSR>>6)
15807 # define S_IWOTH (S_IWUSR>>6)
15808 # define S_IXOTH (S_IXUSR>>6)
15811 # define S_IRWXU (S_IRUSR|S_IWUSR|S_IXUSR)
15812 # define S_IRWXG (S_IRGRP|S_IWGRP|S_IXGRP)
15813 # define S_IRWXO (S_IROTH|S_IWOTH|S_IXOTH)
15816 : see whether semctl IPC_STAT can use union semun
15817 case "$d_semctl_semun" in
15821 #include <sys/types.h>
15822 #include <sys/ipc.h>
15823 #include <sys/sem.h>
15824 #include <sys/stat.h>
15831 #$d_union_semun HAS_UNION_SEMUN
15834 #ifndef HAS_UNION_SEMUN
15837 struct semid_ds *buf;
15838 unsigned short *array;
15844 #if defined(IPC_PRIVATE) && defined(S_IRWXU) && defined(S_IRWXG) && defined(S_IRWXO) && defined(IPC_CREAT)
15845 sem = semget(IPC_PRIVATE, 1, S_IRWXU|S_IRWXG|S_IRWXO|IPC_CREAT);
15847 struct semid_ds argbuf;
15850 st = semctl(sem, 0, IPC_STAT, arg);
15854 # endif /* IPC_STAT */
15855 printf("semctl IPC_STAT failed: errno = %d\n", errno);
15857 if (semctl(sem, 0, IPC_RMID, arg) != 0)
15858 # endif /* IPC_RMID */
15859 printf("semctl IPC_RMID failed: errno = %d\n", errno);
15861 #endif /* IPC_PRIVATE && ... */
15862 printf("semget failed: errno = %d\n", errno);
15867 if eval $compile; then
15870 semun) val="$define" ;;
15878 case "$d_semctl_semun" in
15880 echo "You can use union semun for semctl IPC_STAT." >&4
15883 *) echo "You cannot use union semun for semctl IPC_STAT." >&4
15888 : see whether semctl IPC_STAT can use struct semid_ds pointer
15889 case "$d_semctl_semid_ds" in
15892 $cat > try.c <<'END'
15893 #include <sys/types.h>
15894 #include <sys/ipc.h>
15895 #include <sys/sem.h>
15896 #include <sys/stat.h>
15904 struct semid_ds arg;
15907 #if defined(IPC_PRIVATE) && defined(S_IRWXU) && defined(S_IRWXG) && defined(S_IRWXO) && defined(IPC_CREAT)
15908 sem = semget(IPC_PRIVATE, 1, S_IRWXU|S_IRWXG|S_IRWXO|IPC_CREAT);
15911 st = semctl(sem, 0, IPC_STAT, &arg);
15913 printf("semid_ds\n");
15915 # endif /* IPC_STAT */
15916 printf("semctl IPC_STAT failed: errno = %d\n", errno);
15918 if (semctl(sem, 0, IPC_RMID, &arg) != 0)
15919 # endif /* IPC_RMID */
15920 printf("semctl IPC_RMID failed: errno = %d\n", errno);
15922 #endif /* IPC_PRIVATE && ... */
15923 printf("semget failed: errno = %d\n", errno);
15929 if eval $compile; then
15932 semid_ds) val="$define" ;;
15936 set d_semctl_semid_ds
15940 case "$d_semctl_semid_ds" in
15942 echo "You can $also use struct semid_ds* for semctl IPC_STAT." >&4
15944 *) echo "You cannot use struct semid_ds* for semctl IPC_STAT." >&4
15951 # We do not have the full sem*(2) library, so assume we can not
15957 set d_semctl_semid_ds
15962 : see if sendmsg exists
15963 set sendmsg d_sendmsg
15966 : see if setegid exists
15967 set setegid d_setegid
15970 : see if seteuid exists
15971 set seteuid d_seteuid
15974 : see if setgrent exists
15975 set setgrent d_setgrent
15978 : see if setgrent_r exists
15979 set setgrent_r d_setgrent_r
15981 case "$d_setgrent_r" in
15983 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
15984 case "$d_setgrent_r_proto:$usethreads" in
15985 ":define") d_setgrent_r_proto=define
15986 set d_setgrent_r_proto setgrent_r $hdrs
15990 case "$d_setgrent_r_proto" in
15992 case "$setgrent_r_proto" in
15993 ''|0) try='int setgrent_r(FILE**);'
15994 ./protochk "extern $try" $hdrs && setgrent_r_proto=I_H ;;
15996 case "$setgrent_r_proto" in
15997 ''|0) try='void setgrent_r(FILE**);'
15998 ./protochk "extern $try" $hdrs && setgrent_r_proto=V_H ;;
16000 case "$setgrent_r_proto" in
16001 ''|0) d_setgrent_r=undef
16003 echo "Disabling setgrent_r, cannot determine prototype." >&4 ;;
16004 * ) case "$setgrent_r_proto" in
16005 REENTRANT_PROTO*) ;;
16006 *) setgrent_r_proto="REENTRANT_PROTO_$setgrent_r_proto" ;;
16008 echo "Prototype: $try" ;;
16011 *) case "$usethreads" in
16012 define) echo "setgrent_r has no prototype, not using it." >&4 ;;
16019 *) setgrent_r_proto=0
16023 : see if sethostent exists
16024 set sethostent d_sethent
16027 : see if sethostent_r exists
16028 set sethostent_r d_sethostent_r
16030 case "$d_sethostent_r" in
16032 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
16033 case "$d_sethostent_r_proto:$usethreads" in
16034 ":define") d_sethostent_r_proto=define
16035 set d_sethostent_r_proto sethostent_r $hdrs
16039 case "$d_sethostent_r_proto" in
16041 case "$sethostent_r_proto" in
16042 ''|0) try='int sethostent_r(int, struct hostent_data*);'
16043 ./protochk "extern $try" $hdrs && sethostent_r_proto=I_ID ;;
16045 case "$sethostent_r_proto" in
16046 ''|0) try='void sethostent_r(int, struct hostent_data*);'
16047 ./protochk "extern $try" $hdrs && sethostent_r_proto=V_ID ;;
16049 case "$sethostent_r_proto" in
16050 ''|0) d_sethostent_r=undef
16051 sethostent_r_proto=0
16052 echo "Disabling sethostent_r, cannot determine prototype." >&4 ;;
16053 * ) case "$sethostent_r_proto" in
16054 REENTRANT_PROTO*) ;;
16055 *) sethostent_r_proto="REENTRANT_PROTO_$sethostent_r_proto" ;;
16057 echo "Prototype: $try" ;;
16060 *) case "$usethreads" in
16061 define) echo "sethostent_r has no prototype, not using it." >&4 ;;
16063 d_sethostent_r=undef
16064 sethostent_r_proto=0
16068 *) sethostent_r_proto=0
16072 : see if setitimer exists
16073 set setitimer d_setitimer
16076 : see if setlinebuf exists
16077 set setlinebuf d_setlinebuf
16080 : see if setlocale exists
16081 set setlocale d_setlocale
16084 : see if locale.h is available
16085 set locale.h i_locale
16088 : see if setlocale_r exists
16089 set setlocale_r d_setlocale_r
16091 case "$d_setlocale_r" in
16093 hdrs="$i_systypes sys/types.h define stdio.h $i_locale locale.h"
16094 case "$d_setlocale_r_proto:$usethreads" in
16095 ":define") d_setlocale_r_proto=define
16096 set d_setlocale_r_proto setlocale_r $hdrs
16100 case "$d_setlocale_r_proto" in
16102 case "$setlocale_r_proto" in
16103 ''|0) try='int setlocale_r(int, const char*, char*, int);'
16104 ./protochk "extern $try" $hdrs && setlocale_r_proto=I_ICBI ;;
16106 case "$setlocale_r_proto" in
16107 ''|0) d_setlocale_r=undef
16108 setlocale_r_proto=0
16109 echo "Disabling setlocale_r, cannot determine prototype." >&4 ;;
16110 * ) case "$setlocale_r_proto" in
16111 REENTRANT_PROTO*) ;;
16112 *) setlocale_r_proto="REENTRANT_PROTO_$setlocale_r_proto" ;;
16114 echo "Prototype: $try" ;;
16117 *) case "$usethreads" in
16118 define) echo "setlocale_r has no prototype, not using it." >&4 ;;
16120 d_setlocale_r=undef
16121 setlocale_r_proto=0
16125 *) setlocale_r_proto=0
16129 : see if setnetent exists
16130 set setnetent d_setnent
16133 : see if setnetent_r exists
16134 set setnetent_r d_setnetent_r
16136 case "$d_setnetent_r" in
16138 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
16139 case "$d_setnetent_r_proto:$usethreads" in
16140 ":define") d_setnetent_r_proto=define
16141 set d_setnetent_r_proto setnetent_r $hdrs
16145 case "$d_setnetent_r_proto" in
16147 case "$setnetent_r_proto" in
16148 ''|0) try='int setnetent_r(int, struct netent_data*);'
16149 ./protochk "extern $try" $hdrs && setnetent_r_proto=I_ID ;;
16151 case "$setnetent_r_proto" in
16152 ''|0) try='void setnetent_r(int, struct netent_data*);'
16153 ./protochk "extern $try" $hdrs && setnetent_r_proto=V_ID ;;
16155 case "$setnetent_r_proto" in
16156 ''|0) d_setnetent_r=undef
16157 setnetent_r_proto=0
16158 echo "Disabling setnetent_r, cannot determine prototype." >&4 ;;
16159 * ) case "$setnetent_r_proto" in
16160 REENTRANT_PROTO*) ;;
16161 *) setnetent_r_proto="REENTRANT_PROTO_$setnetent_r_proto" ;;
16163 echo "Prototype: $try" ;;
16166 *) case "$usethreads" in
16167 define) echo "setnetent_r has no prototype, not using it." >&4 ;;
16169 d_setnetent_r=undef
16170 setnetent_r_proto=0
16174 *) setnetent_r_proto=0
16178 : see if setprotoent exists
16179 set setprotoent d_setpent
16182 : see if setpgid exists
16183 set setpgid d_setpgid
16186 : see if setpgrp2 exists
16187 set setpgrp2 d_setpgrp2
16190 : see if setpriority exists
16191 set setpriority d_setprior
16194 : see if setproctitle exists
16195 set setproctitle d_setproctitle
16198 : see if setprotoent_r exists
16199 set setprotoent_r d_setprotoent_r
16201 case "$d_setprotoent_r" in
16203 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
16204 case "$d_setprotoent_r_proto:$usethreads" in
16205 ":define") d_setprotoent_r_proto=define
16206 set d_setprotoent_r_proto setprotoent_r $hdrs
16210 case "$d_setprotoent_r_proto" in
16212 case "$setprotoent_r_proto" in
16213 ''|0) try='int setprotoent_r(int, struct protoent_data*);'
16214 ./protochk "extern $try" $hdrs && setprotoent_r_proto=I_ID ;;
16216 case "$setprotoent_r_proto" in
16217 ''|0) try='void setprotoent_r(int, struct protoent_data*);'
16218 ./protochk "extern $try" $hdrs && setprotoent_r_proto=V_ID ;;
16220 case "$setprotoent_r_proto" in
16221 ''|0) d_setprotoent_r=undef
16222 setprotoent_r_proto=0
16223 echo "Disabling setprotoent_r, cannot determine prototype." >&4 ;;
16224 * ) case "$setprotoent_r_proto" in
16225 REENTRANT_PROTO*) ;;
16226 *) setprotoent_r_proto="REENTRANT_PROTO_$setprotoent_r_proto" ;;
16228 echo "Prototype: $try" ;;
16231 *) case "$usethreads" in
16232 define) echo "setprotoent_r has no prototype, not using it." >&4 ;;
16234 d_setprotoent_r=undef
16235 setprotoent_r_proto=0
16239 *) setprotoent_r_proto=0
16243 : see if setpwent exists
16244 set setpwent d_setpwent
16247 : see if setpwent_r exists
16248 set setpwent_r d_setpwent_r
16250 case "$d_setpwent_r" in
16252 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
16253 case "$d_setpwent_r_proto:$usethreads" in
16254 ":define") d_setpwent_r_proto=define
16255 set d_setpwent_r_proto setpwent_r $hdrs
16259 case "$d_setpwent_r_proto" in
16261 case "$setpwent_r_proto" in
16262 ''|0) try='int setpwent_r(FILE**);'
16263 ./protochk "extern $try" $hdrs && setpwent_r_proto=I_H ;;
16265 case "$setpwent_r_proto" in
16266 ''|0) try='void setpwent_r(FILE**);'
16267 ./protochk "extern $try" $hdrs && setpwent_r_proto=V_H ;;
16269 case "$setpwent_r_proto" in
16270 ''|0) d_setpwent_r=undef
16272 echo "Disabling setpwent_r, cannot determine prototype." >&4 ;;
16273 * ) case "$setpwent_r_proto" in
16274 REENTRANT_PROTO*) ;;
16275 *) setpwent_r_proto="REENTRANT_PROTO_$setpwent_r_proto" ;;
16277 echo "Prototype: $try" ;;
16280 *) case "$usethreads" in
16281 define) echo "setpwent_r has no prototype, not using it." >&4 ;;
16288 *) setpwent_r_proto=0
16292 : see if setregid exists
16293 set setregid d_setregid
16295 set setresgid d_setresgid
16298 : see if setreuid exists
16299 set setreuid d_setreuid
16301 set setresuid d_setresuid
16304 : see if setrgid exists
16305 set setrgid d_setrgid
16308 : see if setruid exists
16309 set setruid d_setruid
16312 : see if setservent exists
16313 set setservent d_setsent
16316 : see if setservent_r exists
16317 set setservent_r d_setservent_r
16319 case "$d_setservent_r" in
16321 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
16322 case "$d_setservent_r_proto:$usethreads" in
16323 ":define") d_setservent_r_proto=define
16324 set d_setservent_r_proto setservent_r $hdrs
16328 case "$d_setservent_r_proto" in
16330 case "$setservent_r_proto" in
16331 ''|0) try='int setservent_r(int, struct servent_data*);'
16332 ./protochk "extern $try" $hdrs && setservent_r_proto=I_ID ;;
16334 case "$setservent_r_proto" in
16335 ''|0) try='void setservent_r(int, struct servent_data*);'
16336 ./protochk "extern $try" $hdrs && setservent_r_proto=V_ID ;;
16338 case "$setservent_r_proto" in
16339 ''|0) d_setservent_r=undef
16340 setservent_r_proto=0
16341 echo "Disabling setservent_r, cannot determine prototype." >&4 ;;
16342 * ) case "$setservent_r_proto" in
16343 REENTRANT_PROTO*) ;;
16344 *) setservent_r_proto="REENTRANT_PROTO_$setservent_r_proto" ;;
16346 echo "Prototype: $try" ;;
16349 *) case "$usethreads" in
16350 define) echo "setservent_r has no prototype, not using it." >&4 ;;
16352 d_setservent_r=undef
16353 setservent_r_proto=0
16357 *) setservent_r_proto=0
16361 : see if setsid exists
16362 set setsid d_setsid
16365 : see if setvbuf exists
16366 set setvbuf d_setvbuf
16369 : see if sfio.h is available
16374 : see if sfio library is available
16385 : Ok, but do we want to use it.
16389 true|$define|[yY]*) dflt='y';;
16392 echo "$package can use the sfio library, but it is experimental."
16393 case "$useperlio" in
16395 echo "For sfio also the PerlIO abstraction layer is needed."
16396 echo "Earlier you said you wouldn't want that."
16399 rp="You seem to have sfio available, do you want to try using it?"
16402 y|Y) echo "Ok, turning on both sfio and PerlIO, then."
16403 useperlio="$define"
16406 *) echo "Ok, avoiding sfio this time. I'll use stdio instead."
16411 *) case "$usesfio" in
16412 true|$define|[yY]*)
16413 echo "Sorry, cannot find sfio on this machine." >&4
16414 echo "Ignoring your setting of usesfio=$usesfio." >&4
16423 $define) usesfio='true';;
16424 *) usesfio='false';;
16428 *) : Remove sfio from list of libraries to use
16431 echo "Removing unneeded -lsfio from library list" >&4
16432 set `echo X $libs | $sed -e 's/-lsfio / /' -e 's/-lsfio$//'`
16435 echo "libs = $libs" >&4
16442 : see if shmctl exists
16443 set shmctl d_shmctl
16446 : see if shmget exists
16447 set shmget d_shmget
16450 : see if shmat exists
16453 : see what shmat returns
16456 $cat >shmat.c <<'END'
16457 #include <sys/shm.h>
16460 if $cc $ccflags -c shmat.c >/dev/null 2>&1; then
16465 echo "and it returns ($shmattype)." >&4
16466 : see if a prototype for shmat is available
16467 xxx=`./findhdr sys/shm.h`
16468 $cppstdin $cppflags $cppminus < $xxx > shmat.c 2>/dev/null
16469 if $contains 'shmat.*(' shmat.c >/dev/null 2>&1; then
16480 set d_shmatprototype
16483 : see if shmdt exists
16487 : see how much of the 'shm*(2)' library is present.
16490 case "$d_shmctl$d_shmget$d_shmat$d_shmdt" in
16491 *"$undef"*) h_shm=false;;
16495 case "`ipcs 2>&1`" in
16496 "SVID shared memory"*"not configured"*)
16497 echo "Your $osname does not have the shm*(2) configured." >&4
16500 set shmctl d_shmctl
16502 set shmget d_shmget
16512 : we could also check for sys/ipc.h ...
16513 if $h_shm && $test `./findhdr sys/shm.h`; then
16514 echo "You have the full shm*(2) library." >&4
16517 echo "You don't have the full shm*(2) library." >&4
16524 : see if we have sigaction
16525 if set sigaction val -f d_sigaction; eval $csym; $val; then
16526 echo 'sigaction() found.' >&4
16529 #include <sys/types.h>
16530 #include <signal.h>
16531 #$i_stdlib I_STDLIB
16533 #include <stdlib.h>
16537 struct sigaction act, oact;
16539 oact.sa_handler = 0;
16540 /* so that act and oact are used */
16541 exit(act.sa_flags == 0 && oact.sa_handler == 0);
16545 if eval $compile_ok; then
16548 echo "But you don't seem to have a useable struct sigaction." >&4
16552 echo 'sigaction NOT found.' >&4
16555 set d_sigaction; eval $setvar
16556 $rm -f try try$_o try.c
16558 : see if sigprocmask exists
16559 set sigprocmask d_sigprocmask
16562 : see if sigsetjmp exists
16564 case "$d_sigsetjmp" in
16567 #include <setjmp.h>
16568 #$i_stdlib I_STDLIB
16570 #include <stdlib.h>
16576 if (sigsetjmp(env,1))
16579 siglongjmp(env, 1);
16584 if eval $compile; then
16585 if $run ./try >/dev/null 2>&1; then
16586 echo "POSIX sigsetjmp found." >&4
16590 Uh-Oh! You have POSIX sigsetjmp and siglongjmp, but they do not work properly!!
16596 echo "sigsetjmp not found." >&4
16600 *) val="$d_sigsetjmp"
16601 case "$d_sigsetjmp" in
16602 $define) echo "POSIX sigsetjmp found." >&4;;
16603 $undef) echo "sigsetjmp not found." >&4;;
16611 : see if snprintf exists
16612 set snprintf d_snprintf
16615 : see if vsnprintf exists
16616 set vsnprintf d_vsnprintf
16619 case "$d_snprintf-$d_vsnprintf" in
16622 Checking whether your snprintf() and vsnprintf() work okay...
16624 $cat >try.c <<'EOCP'
16625 /* v?snprintf testing logic courtesy of Russ Allbery.
16626 * According to C99:
16627 * - if the buffer is too short it still must be \0-terminated
16628 * - if the buffer is too short the potentially required length
16629 * must be returned and not -1
16630 * - if the buffer is NULL the potentially required length
16631 * must be returned and not -1 or core dump
16634 #include <stdarg.h>
16638 int test (char *format, ...)
16643 va_start (args, format);
16644 count = vsnprintf (buf, sizeof buf, format, args);
16651 return ((test ("%s", "abcd") == 4 && buf[0] == 'a' && buf[1] == '\0'
16652 && snprintf (NULL, 0, "%s", "abcd") == 4) ? 0 : 1);
16656 if eval $compile; then
16659 0) echo "Your snprintf() and vsnprintf() seem to be working okay." ;;
16661 Your snprintf() and snprintf() don't seem to be working okay.
16663 d_snprintf="$undef"
16664 d_vsnprintf="$undef"
16668 echo "(I can't seem to compile the test program--assuming they don't)"
16669 d_snprintf="$undef"
16670 d_vsnprintf="$undef"
16672 $rm -f try.* try core core.try.*
16676 : see if sockatmark exists
16677 set sockatmark d_sockatmark
16680 : see if prototype for sockatmark is available
16682 set d_sockatmarkproto sockatmark $d_socket sys/socket.h
16685 : see if socks5_init exists
16686 set socks5_init d_socks5_init
16689 : see if sprintf returns the length of the string in the buffer as per ANSI
16690 $echo "Checking whether sprintf returns the length of the string..." >&4
16693 #$i_stdlib I_STDLIB
16695 #include <stdlib.h>
16697 #$i_string I_STRING
16699 # include <string.h>
16701 # include <strings.h>
16710 int check (size_t expect, int test) {
16711 size_t got = strlen(buffer);
16715 printf("expected %ld, got %ld in test %d '%s'\n", (long) expect, (long) got,
16720 int main(int argc, char **argv) {
16723 check(sprintf(buffer, ""), ++test);
16724 check(sprintf(buffer, "%s %s", "perl", "rules"), ++test);
16725 check(sprintf(buffer, "I like %g", atan2(0,-1)), ++test);
16732 d_sprintf_returns_strlen="$undef"
16733 if eval $compile; then
16737 sprintf returns the length of the string (as ANSI says it should)
16739 d_sprintf_returns_strlen="$define"
16742 sprintf does not return the length of the string (how old is this system?)
16744 d_sprintf_returns_strlen="$undef"
16751 : see if srand48_r exists
16752 set srand48_r d_srand48_r
16754 case "$d_srand48_r" in
16756 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
16757 case "$d_srand48_r_proto:$usethreads" in
16758 ":define") d_srand48_r_proto=define
16759 set d_srand48_r_proto srand48_r $hdrs
16763 case "$d_srand48_r_proto" in
16765 case "$srand48_r_proto" in
16766 ''|0) try='int srand48_r(long, struct drand48_data*);'
16767 ./protochk "extern $try" $hdrs && srand48_r_proto=I_LS ;;
16769 case "$srand48_r_proto" in
16770 ''|0) d_srand48_r=undef
16772 echo "Disabling srand48_r, cannot determine prototype." >&4 ;;
16773 * ) case "$srand48_r_proto" in
16774 REENTRANT_PROTO*) ;;
16775 *) srand48_r_proto="REENTRANT_PROTO_$srand48_r_proto" ;;
16777 echo "Prototype: $try" ;;
16780 *) case "$usethreads" in
16781 define) echo "srand48_r has no prototype, not using it." >&4 ;;
16788 *) srand48_r_proto=0
16792 : see if srandom_r exists
16793 set srandom_r d_srandom_r
16795 case "$d_srandom_r" in
16797 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
16798 case "$d_srandom_r_proto:$usethreads" in
16799 ":define") d_srandom_r_proto=define
16800 set d_srandom_r_proto srandom_r $hdrs
16804 case "$d_srandom_r_proto" in
16806 case "$srandom_r_proto" in
16807 ''|0) try='int srandom_r(unsigned int, struct random_data*);'
16808 ./protochk "extern $try" $hdrs && srandom_r_proto=I_TS ;;
16810 case "$srandom_r_proto" in
16811 ''|0) d_srandom_r=undef
16813 echo "Disabling srandom_r, cannot determine prototype." >&4 ;;
16814 * ) case "$srandom_r_proto" in
16815 REENTRANT_PROTO*) ;;
16816 *) srandom_r_proto="REENTRANT_PROTO_$srandom_r_proto" ;;
16818 echo "Prototype: $try" ;;
16821 *) case "$usethreads" in
16822 define) echo "srandom_r has no prototype, not using it." >&4 ;;
16829 *) srandom_r_proto=0
16833 : see if prototype for setresgid is available
16835 set d_sresgproto setresgid $i_unistd unistd.h
16838 : see if prototype for setresuid is available
16840 set d_sresuproto setresuid $i_unistd unistd.h
16843 : see if sys/stat.h is available
16844 set sys/stat.h i_sysstat
16848 : see if stat knows about block sizes
16850 echo "Checking to see if your struct stat has st_blocks field..." >&4
16851 set d_statblks stat st_blocks $i_sysstat sys/stat.h
16855 : see if this is a sys/vfs.h system
16856 set sys/vfs.h i_sysvfs
16860 : see if this is a sys/statfs.h system
16861 set sys/statfs.h i_sysstatfs
16866 echo "Checking to see if your system supports struct statfs..." >&4
16867 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
16869 case "$d_statfs_s" in
16870 "$define") echo "Yes, it does." ;;
16871 *) echo "No, it doesn't." ;;
16876 : see if struct statfs knows about f_flags
16877 case "$d_statfs_s" in
16880 echo "Checking to see if your struct statfs has f_flags field..." >&4
16881 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
16885 set d_statfs_f_flags
16889 case "$d_statfs_f_flags" in
16890 "$define") echo "Yes, it does." ;;
16891 *) echo "No, it doesn't." ;;
16895 Checking how to access stdio streams by file descriptor number...
16897 case "$stdio_stream_array" in
16898 '') $cat >try.c <<EOCP
16901 if (&STDIO_STREAM_ARRAY[fileno(stdin)] == stdin)
16905 for s in _iob __iob __sF
16907 set try -DSTDIO_STREAM_ARRAY=$s
16908 if eval $compile; then
16909 case "`$run ./try`" in
16910 yes) stdio_stream_array=$s; break ;;
16914 $rm -f try.* try$exe_ext
16916 case "$stdio_stream_array" in
16918 I can't figure out how to access stdio streams by file descriptor number.
16920 d_stdio_stream_array="$undef"
16923 You can access stdio streams by file descriptor number by the $stdio_stream_array array.
16925 d_stdio_stream_array="$define"
16929 : see if strcoll exists
16930 set strcoll d_strcoll
16933 : check for structure copying
16935 echo "Checking to see if your C compiler can copy structs..." >&4
16936 $cat >try.c <<'EOCP'
16946 if $cc -c try.c >/dev/null 2>&1 ; then
16948 echo "Yup, it can."
16951 echo "Nope, it can't."
16957 : see if strerror and/or sys_errlist[] exist
16959 if test "X$d_strerror" = X -o "X$d_syserrlst" = X; then
16960 if set strerror val -f d_strerror; eval $csym; $val; then
16961 echo 'strerror() found.' >&4
16962 d_strerror="$define"
16963 d_strerrm='strerror(e)'
16964 if set sys_errlist val -a d_syserrlst; eval $csym; $val; then
16965 echo "(You also have sys_errlist[], so we could roll our own strerror.)"
16966 d_syserrlst="$define"
16968 echo "(Since you don't have sys_errlist[], sterror() is welcome.)"
16969 d_syserrlst="$undef"
16971 elif xxx=`./findhdr string.h`; test "$xxx" || xxx=`./findhdr strings.h`; \
16972 $contains '#[ ]*define.*strerror' "$xxx" >/dev/null 2>&1; then
16973 echo 'strerror() found in string header.' >&4
16974 d_strerror="$define"
16975 d_strerrm='strerror(e)'
16976 if set sys_errlist val -a d_syserrlst; eval $csym; $val; then
16977 echo "(Most probably, strerror() uses sys_errlist[] for descriptions.)"
16978 d_syserrlst="$define"
16980 echo "(You don't appear to have any sys_errlist[], how can this be?)"
16981 d_syserrlst="$undef"
16983 elif set sys_errlist val -a d_syserrlst; eval $csym; $val; then
16984 echo "strerror() not found, but you have sys_errlist[] so we'll use that." >&4
16985 d_strerror="$undef"
16986 d_syserrlst="$define"
16987 d_strerrm='((e)<0||(e)>=sys_nerr?"unknown":sys_errlist[e])'
16989 echo 'strerror() and sys_errlist[] NOT found.' >&4
16990 d_strerror="$undef"
16991 d_syserrlst="$undef"
16992 d_strerrm='"unknown"'
16996 : see if strerror_r exists
16997 set strerror_r d_strerror_r
16999 case "$d_strerror_r" in
17001 hdrs="$i_systypes sys/types.h define stdio.h $i_string string.h"
17002 case "$d_strerror_r_proto:$usethreads" in
17003 ":define") d_strerror_r_proto=define
17004 set d_strerror_r_proto strerror_r $hdrs
17008 case "$d_strerror_r_proto" in
17010 case "$strerror_r_proto" in
17011 ''|0) try='int strerror_r(int, char*, size_t);'
17012 ./protochk "extern $try" $hdrs && strerror_r_proto=I_IBW ;;
17014 case "$strerror_r_proto" in
17015 ''|0) try='int strerror_r(int, char*, int);'
17016 ./protochk "extern $try" $hdrs && strerror_r_proto=I_IBI ;;
17018 case "$strerror_r_proto" in
17019 ''|0) try='char* strerror_r(int, char*, size_t);'
17020 ./protochk "extern $try" $hdrs && strerror_r_proto=B_IBW ;;
17022 case "$strerror_r_proto" in
17023 ''|0) d_strerror_r=undef
17025 echo "Disabling strerror_r, cannot determine prototype." >&4 ;;
17026 * ) case "$strerror_r_proto" in
17027 REENTRANT_PROTO*) ;;
17028 *) strerror_r_proto="REENTRANT_PROTO_$strerror_r_proto" ;;
17030 echo "Prototype: $try" ;;
17033 *) case "$usethreads" in
17034 define) echo "strerror_r has no prototype, not using it." >&4 ;;
17041 *) strerror_r_proto=0
17045 : see if strftime exists
17046 set strftime d_strftime
17049 : see if strlcat exists
17050 set strlcat d_strlcat
17053 : see if strlcpy exists
17054 set strlcpy d_strlcpy
17057 : see if strtod exists
17058 set strtod d_strtod
17061 : see if strtol exists
17062 set strtol d_strtol
17065 : see if strtold exists
17066 set strtold d_strtold
17069 : see if strtoll exists
17070 set strtoll d_strtoll
17073 case "$d_longlong-$d_strtoll" in
17076 Checking whether your strtoll() works okay...
17078 $cat >try.c <<'EOCP'
17081 #define strtoll __strtoll
17084 #define strtoll _strtoll
17087 extern long long int strtoll(char *s, char **, int);
17088 static int bad = 0;
17089 int check(char *s, long long ell, int een) {
17092 gll = strtoll(s, 0, 10);
17093 if (!((gll == ell) && (errno == een)))
17097 check(" 1", 1LL, 0);
17098 check(" 0", 0LL, 0);
17099 check("-1", -1LL, 0);
17100 check("-9223372036854775808", -9223372036854775808LL, 0);
17101 check("-9223372036854775808", -9223372036854775808LL, 0);
17102 check(" 9223372036854775807", 9223372036854775807LL, 0);
17103 check("-9223372036854775808", -9223372036854775808LL, 0);
17104 check(" 9223372036854775808", 9223372036854775807LL, ERANGE);
17105 check("-9223372036854775809", -9223372036854775808LL, ERANGE);
17111 if eval $compile; then
17114 ok) echo "Your strtoll() seems to be working okay." ;;
17116 Your strtoll() doesn't seem to be working okay.
17122 echo "(I can't seem to compile the test program--assuming it doesn't)"
17128 : see if strtoq exists
17129 set strtoq d_strtoq
17132 : see if strtoul exists
17133 set strtoul d_strtoul
17136 case "$d_strtoul" in
17139 Checking whether your strtoul() works okay...
17141 $cat >try.c <<'EOCP'
17144 extern unsigned long int strtoul(char *s, char **, int);
17145 static int bad = 0;
17146 void check(char *s, unsigned long eul, int een) {
17149 gul = strtoul(s, 0, 10);
17150 if (!((gul == eul) && (errno == een)))
17154 check(" 1", 1L, 0);
17155 check(" 0", 0L, 0);
17157 case "$longsize" in
17159 $cat >>try.c <<'EOCP'
17160 check("18446744073709551615", 18446744073709551615UL, 0);
17161 check("18446744073709551616", 18446744073709551615UL, ERANGE);
17162 #if 0 /* strtoul() for /^-/ strings is undefined. */
17163 check("-1", 18446744073709551615UL, 0);
17164 check("-18446744073709551614", 2, 0);
17165 check("-18446744073709551615", 1, 0);
17166 check("-18446744073709551616", 18446744073709551615UL, ERANGE);
17167 check("-18446744073709551617", 18446744073709551615UL, ERANGE);
17172 $cat >>try.c <<'EOCP'
17173 check("4294967295", 4294967295UL, 0);
17174 check("4294967296", 4294967295UL, ERANGE);
17175 #if 0 /* strtoul() for /^-/ strings is undefined. */
17176 check("-1", 4294967295UL, 0);
17177 check("-4294967294", 2, 0);
17178 check("-4294967295", 1, 0);
17179 check("-4294967296", 4294967295UL, ERANGE);
17180 check("-4294967297", 4294967295UL, ERANGE);
17185 : Should we write these tests to be more portable by sprintf-ing
17186 : ~0 and then manipulating that char string as input for strtol?
17189 $cat >>try.c <<'EOCP'
17196 if eval $compile; then
17197 case "`$run ./try`" in
17198 ok) echo "Your strtoul() seems to be working okay." ;;
17200 Your strtoul() doesn't seem to be working okay.
17209 : see if strtoull exists
17210 set strtoull d_strtoull
17213 case "$d_longlong-$d_strtoull" in
17216 Checking whether your strtoull() works okay...
17218 $cat >try.c <<'EOCP'
17221 #define strtoull __strtoull
17224 extern unsigned long long int strtoull(char *s, char **, int);
17225 static int bad = 0;
17226 int check(char *s, long long eull, int een) {
17229 gull = strtoull(s, 0, 10);
17230 if (!((gull == eull) && (errno == een)))
17234 check(" 1", 1LL, 0);
17235 check(" 0", 0LL, 0);
17236 check("18446744073709551615", 18446744073709551615ULL, 0);
17237 check("18446744073709551616", 18446744073709551615ULL, ERANGE);
17238 #if 0 /* strtoull() for /^-/ strings is undefined. */
17239 check("-1", 18446744073709551615ULL, 0);
17240 check("-18446744073709551614", 2LL, 0);
17241 check("-18446744073709551615", 1LL, 0);
17242 check("-18446744073709551616", 18446744073709551615ULL, ERANGE);
17243 check("-18446744073709551617", 18446744073709551615ULL, ERANGE);
17250 if eval $compile; then
17251 case "`$run ./try`" in
17252 ok) echo "Your strtoull() seems to be working okay." ;;
17254 Your strtoull() doesn't seem to be working okay.
17256 d_strtoull="$undef"
17263 : see if strtouq exists
17264 set strtouq d_strtouq
17267 case "$d_strtouq" in
17270 Checking whether your strtouq() works okay...
17272 $cat >try.c <<'EOCP'
17275 extern unsigned long long int strtouq(char *s, char **, int);
17276 static int bad = 0;
17277 void check(char *s, unsigned long long eull, int een) {
17278 unsigned long long gull;
17280 gull = strtouq(s, 0, 10);
17281 if (!((gull == eull) && (errno == een)))
17285 check(" 1", 1LL, 0);
17286 check(" 0", 0LL, 0);
17287 check("18446744073709551615", 18446744073709551615ULL, 0);
17288 check("18446744073709551616", 18446744073709551615ULL, ERANGE);
17289 #if 0 /* strtouq() for /^-/ strings is undefined. */
17290 check("-1", 18446744073709551615ULL, 0);
17291 check("-18446744073709551614", 2LL, 0);
17292 check("-18446744073709551615", 1LL, 0);
17293 check("-18446744073709551616", 18446744073709551615ULL, ERANGE);
17294 check("-18446744073709551617", 18446744073709551615ULL, ERANGE);
17302 if eval $compile; then
17303 case "`$run ./try`" in
17304 ok) echo "Your strtouq() seems to be working okay." ;;
17306 Your strtouq() doesn't seem to be working okay.
17315 : see if strxfrm exists
17316 set strxfrm d_strxfrm
17319 : see if symlink exists
17320 set symlink d_symlink
17323 : see if syscall exists
17324 set syscall d_syscall
17327 : see if prototype for syscall is available
17329 set d_syscallproto syscall $i_unistd unistd.h
17332 : see if sysconf exists
17333 set sysconf d_sysconf
17336 : see if system exists
17337 set system d_system
17340 : see if tcgetpgrp exists
17341 set tcgetpgrp d_tcgetpgrp
17344 : see if tcsetpgrp exists
17345 set tcsetpgrp d_tcsetpgrp
17348 : see if prototype for telldir is available
17350 set d_telldirproto telldir $i_systypes sys/types.h $i_dirent dirent.h
17353 : see if time exists
17355 if test "X$d_time" = X -o X"$timetype" = X; then
17356 if set time val -f d_time; eval $csym; $val; then
17357 echo 'time() found.' >&4
17359 rp="What is the type returned by time() on this system?"
17360 set time_t timetype long stdio.h sys/types.h
17363 echo 'time() not found, hope that will do.' >&4
17371 : see if this is a sys/times.h system
17372 set sys/times.h i_systimes
17375 : see if times exists
17377 if set times val -f d_times; eval $csym; $val; then
17378 echo 'times() found.' >&4
17381 case "$i_systimes" in
17382 "$define") inc='sys/times.h';;
17384 rp="What is the type returned by times() on this system?"
17385 set clock_t clocktype long stdio.h sys/types.h $inc
17388 echo 'times() NOT found, hope that will do.' >&4
17393 : see if tmpnam_r exists
17394 set tmpnam_r d_tmpnam_r
17396 case "$d_tmpnam_r" in
17398 hdrs="$i_systypes sys/types.h define stdio.h "
17399 case "$d_tmpnam_r_proto:$usethreads" in
17400 ":define") d_tmpnam_r_proto=define
17401 set d_tmpnam_r_proto tmpnam_r $hdrs
17405 case "$d_tmpnam_r_proto" in
17407 case "$tmpnam_r_proto" in
17408 ''|0) try='char* tmpnam_r(char*);'
17409 ./protochk "extern $try" $hdrs && tmpnam_r_proto=B_B ;;
17411 case "$tmpnam_r_proto" in
17412 ''|0) d_tmpnam_r=undef
17414 echo "Disabling tmpnam_r, cannot determine prototype." >&4 ;;
17415 * ) case "$tmpnam_r_proto" in
17416 REENTRANT_PROTO*) ;;
17417 *) tmpnam_r_proto="REENTRANT_PROTO_$tmpnam_r_proto" ;;
17419 echo "Prototype: $try" ;;
17422 *) case "$usethreads" in
17423 define) echo "tmpnam_r has no prototype, not using it." >&4 ;;
17430 *) tmpnam_r_proto=0
17434 : see if truncate exists
17435 set truncate d_truncate
17438 : see if ttyname_r exists
17439 set ttyname_r d_ttyname_r
17441 case "$d_ttyname_r" in
17443 hdrs="$i_systypes sys/types.h define stdio.h $i_unistd unistd.h"
17444 case "$d_ttyname_r_proto:$usethreads" in
17445 ":define") d_ttyname_r_proto=define
17446 set d_ttyname_r_proto ttyname_r $hdrs
17450 case "$d_ttyname_r_proto" in
17452 case "$ttyname_r_proto" in
17453 ''|0) try='int ttyname_r(int, char*, size_t);'
17454 ./protochk "extern $try" $hdrs && ttyname_r_proto=I_IBW ;;
17456 case "$ttyname_r_proto" in
17457 ''|0) try='int ttyname_r(int, char*, int);'
17458 ./protochk "extern $try" $hdrs && ttyname_r_proto=I_IBI ;;
17460 case "$ttyname_r_proto" in
17461 ''|0) try='char* ttyname_r(int, char*, int);'
17462 ./protochk "extern $try" $hdrs && ttyname_r_proto=B_IBI ;;
17464 case "$ttyname_r_proto" in
17465 ''|0) d_ttyname_r=undef
17467 echo "Disabling ttyname_r, cannot determine prototype." >&4 ;;
17468 * ) case "$ttyname_r_proto" in
17469 REENTRANT_PROTO*) ;;
17470 *) ttyname_r_proto="REENTRANT_PROTO_$ttyname_r_proto" ;;
17472 echo "Prototype: $try" ;;
17475 *) case "$usethreads" in
17476 define) echo "ttyname_r has no prototype, not using it." >&4 ;;
17483 *) ttyname_r_proto=0
17487 : see if tzname[] exists
17489 if set tzname val -a d_tzname; eval $csym; $val; then
17491 echo 'tzname[] found.' >&4
17494 echo 'tzname[] NOT found.' >&4
17500 next|rhapsody|darwin) multiarch="$define" ;;
17502 case "$multiarch" in
17503 ''|[nN]*) multiarch="$undef" ;;
17506 : check for ordering of bytes in a UV
17508 case "$usecrosscompile$multiarch" in
17511 You seem to be either cross-compiling or doing a multiarchitecture build,
17512 skipping the byteorder check.
17518 case "$byteorder" in
17521 In the following, larger digits indicate more significance. A big-endian
17522 machine like a Pyramid or a Motorola 680?0 chip will come out to 4321. A
17523 little-endian machine like a Vax or an Intel 80?86 chip would be 1234. Other
17524 machines may have weird orders like 3412. A Cray will report 87654321,
17525 an Alpha will report 12345678. If the test program works the default is
17527 I'm now running the test program...
17531 #$i_stdlib I_STDLIB
17533 #include <stdlib.h>
17535 #include <sys/types.h>
17536 typedef $uvtype UV;
17546 u.l = (((UV)0x08070605) << 32) | (UV)0x04030201;
17548 u.l = (UV)0x04030201;
17549 for (i = 0; i < $uvsize; i++)
17550 printf("%c", u.c[i]+'0');
17557 if eval $compile && ./try > /dev/null; then
17560 [1-4][1-4][1-4][1-4]|12345678|87654321)
17561 echo "(The test program ran ok.)"
17562 echo "byteorder=$dflt"
17565 ????|????????) echo "(The test program ran ok.)" ;;
17566 *) echo "(The test program didn't run right for some reason.)" ;;
17571 (I can't seem to compile the test program. Guessing big-endian...)
17574 case "$xxx_prompt" in
17576 rp="What is the order of bytes in $uvtype?"
17592 Checking to see whether you can access character data unalignedly...
17594 case "$d_u32align" in
17595 '') $cat >try.c <<EOCP
17597 #$i_stdlib I_STDLIB
17599 #include <stdlib.h>
17601 #define U32 $u32type
17602 #define BYTEORDER 0x$byteorder
17604 #include <signal.h>
17606 $signal_t bletch(s) int s; { exit(4); }
17609 #if BYTEORDER == 0x1234 || BYTEORDER == 0x4321
17614 if (sizeof(U32) != 4) {
17615 printf("sizeof(U32) is not 4, but %d\n", sizeof(U32));
17622 signal(SIGBUS, bletch);
17634 for (i = 0; i < 4; i++) {
17635 up = (U32*)(buf + i);
17636 if (! ((*up == 1 << (8*i)) || /* big-endian */
17637 (*up == 1 << (8*(3-i))) /* little-endian */
17641 printf("read failed (%x)\n", *up);
17647 for (i = 0; i < 4; i++) {
17648 up = (U32*)(buf + i);
17650 if (*up != 0xBeef) {
17651 printf("write failed (%x)\n", *up);
17665 if eval $compile_ok; then
17666 echo "(Testing for character data alignment may crash the test. That's okay.)" >&4
17667 $run ./try 2>&1 >/dev/null
17670 You can access character data pretty unalignedly.
17672 d_u32align="$undef"
17675 It seems that you must access character data in an aligned manner.
17677 d_u32align="$define"
17681 rp='Can you access character data at unaligned addresses?'
17685 [yY]*) d_u32align="$undef" ;;
17686 *) d_u32align="$define" ;;
17689 $rm -f core core.try.* try.core
17693 : see if ualarm exists
17694 set ualarm d_ualarm
17697 : see if umask exists
17701 : see if unordered exists
17702 set unordered d_unordered
17705 : see if unsetenv exists
17706 set unsetenv d_unsetenv
17709 : see if usleep exists
17710 set usleep d_usleep
17713 : see if prototype for usleep is available
17715 set d_usleepproto usleep $i_unistd unistd.h
17718 : see if ustat exists
17722 : backward compatibility for d_hvfork
17723 if test X$d_hvfork != X; then
17724 d_vfork="$d_hvfork"
17727 : see if there is a vfork
17732 : Ok, but do we want to use it. vfork is reportedly unreliable in
17733 : perl on Solaris 2.x, and probably elsewhere.
17737 case "$usevfork" in
17743 Perl can only use a vfork() that doesn't suffer from strict
17744 restrictions on calling functions or modifying global data in
17745 the child. For example, glibc-2.1 contains such a vfork()
17746 that is unsuitable. If your system provides a proper fork()
17747 call, chances are that you do NOT want perl to use vfork().
17750 rp="Do you still want to use vfork()?"
17755 echo "Ok, we won't use vfork()."
17764 $define) usevfork='true';;
17765 *) usevfork='false';;
17768 : see if closedir exists
17769 set closedir d_closedir
17772 case "$d_closedir" in
17775 echo "Checking whether closedir() returns a status..." >&4
17777 #$i_dirent I_DIRENT /**/
17778 #$i_sysdir I_SYS_DIR /**/
17779 #$i_sysndir I_SYS_NDIR /**/
17780 #$i_systypes I_SYS_TYPES /**/
17782 #if defined(I_SYS_TYPES)
17783 #include <sys/types.h>
17785 #if defined(I_DIRENT)
17786 #include <dirent.h>
17787 #if defined(NeXT) && defined(I_SYS_DIR) /* NeXT needs dirent + sys/dir.h */
17788 #include <sys/dir.h>
17792 #include <sys/ndir.h>
17796 #include <ndir.h> /* may be wrong in the future */
17798 #include <sys/dir.h>
17803 int main() { return closedir(opendir(".")); }
17806 if eval $compile_ok; then
17807 if $run ./try > /dev/null 2>&1 ; then
17808 echo "Yes, it does."
17811 echo "No, it doesn't."
17815 echo "(I can't seem to compile the test program--assuming it doesn't)"
17823 set d_void_closedir
17826 : see if there is a wait4
17830 : see if waitpid exists
17831 set waitpid d_waitpid
17834 : see if wcstombs exists
17835 set wcstombs d_wcstombs
17838 : see if wctomb exists
17839 set wctomb d_wctomb
17842 : see if writev exists
17843 set writev d_writev
17846 : preserve RCS keywords in files with variable substitution, grrr
17851 Revision='$Revision'
17853 : check for alignment requirements
17855 case "$usecrosscompile$multiarch" in
17858 You seem to be either cross-compiling or doing a multiarchitecture build,
17859 skipping the memory alignment check.
17862 case "$alignbytes" in
17863 '') alignbytes=8 ;;
17867 case "$alignbytes" in
17868 '') echo "Checking alignment constraints..." >&4
17869 if $test "X$uselongdouble" = Xdefine -a "X$d_longdbl" = Xdefine; then
17870 $cat >try.c <<'EOCP'
17871 typedef long double NV;
17874 $cat >try.c <<'EOCP'
17878 $cat >>try.c <<'EOCP'
17886 printf("%d\n", (int)((char *)&try_algn.bar - (char *)&try_algn.foo));
17891 if eval $compile_ok; then
17895 echo "(I can't seem to compile the test program...)"
17898 *) dflt="$alignbytes"
17901 rp="Doubles must be aligned on a how-many-byte boundary?"
17909 : set the base revision
17912 : how do we concatenate cpp tokens here?
17914 echo "Checking to see how your cpp does stuff like concatenate tokens..." >&4
17915 $cat >cpp_stuff.c <<'EOCP'
17916 #define RCAT(a,b)a/**/b
17917 #define ACAT(a,b)a ## b
17921 $cppstdin $cppflags $cppminus <cpp_stuff.c >cpp_stuff.out 2>&1
17922 if $contains 'Circus' cpp_stuff.out >/dev/null 2>&1; then
17923 echo "Oh! Smells like ANSI's been here." >&4
17924 echo "We can catify or stringify, separately or together!"
17926 elif $contains 'Reiser' cpp_stuff.out >/dev/null 2>&1; then
17927 echo "Ah, yes! The good old days!" >&4
17928 echo "However, in the good old days we don't know how to stringify and"
17929 echo "catify at the same time."
17933 Hmm, I don't seem to be able to concatenate tokens with your cpp.
17934 You're going to have to edit the values of CAT[2-5] in config.h...
17936 cpp_stuff="/* Help! How do we handle cpp_stuff? */*/"
17940 : see if this is a db.h system
17946 : Check db version.
17948 echo "Checking Berkeley DB version ..." >&4
17954 #include <sys/types.h>
17956 #$i_stdlib I_STDLIB
17958 #include <stdlib.h>
17961 int main(int argc, char *argv[])
17963 #ifdef DB_VERSION_MAJOR /* DB version >= 2 */
17964 int Major, Minor, Patch ;
17965 unsigned long Version ;
17966 (void)db_version(&Major, &Minor, &Patch) ;
17968 printf("%d %d %d %d %d %d\n",
17969 DB_VERSION_MAJOR, DB_VERSION_MINOR, DB_VERSION_PATCH,
17970 Major, Minor, Patch);
17973 printf("You have Berkeley DB Version 2 or greater.\n");
17975 printf("db.h is from Berkeley DB Version %d.%d.%d\n",
17976 DB_VERSION_MAJOR, DB_VERSION_MINOR, DB_VERSION_PATCH);
17977 printf("libdb is from Berkeley DB Version %d.%d.%d\n",
17978 Major, Minor, Patch) ;
17980 /* check that db.h & libdb are compatible */
17981 if (DB_VERSION_MAJOR != Major || DB_VERSION_MINOR != Minor || DB_VERSION_PATCH != Patch) {
17982 printf("db.h and libdb are incompatible.\n") ;
17986 printf("db.h and libdb are compatible.\n") ;
17988 Version = DB_VERSION_MAJOR * 1000000 + DB_VERSION_MINOR * 1000
17989 + DB_VERSION_PATCH ;
17991 /* needs to be >= 2.3.4 */
17992 if (Version < 2003004) {
17993 /* if (DB_VERSION_MAJOR == 2 && DB_VERSION_MINOR == 0 && DB_VERSION_PATCH < 5) { */
17994 printf("Perl needs Berkeley DB 2.3.4 or greater.\n") ;
18000 #if defined(_DB_H_) && defined(BTREEMAGIC) && defined(HASHMAGIC)
18005 printf("You have Berkeley DB Version 1.\n");
18006 exit(0); /* DB version < 2: the coast is clear. */
18008 exit(1); /* <db.h> not Berkeley DB? */
18014 if eval $compile_ok && $run ./try; then
18015 echo 'Looks OK.' >&4
18017 db_version_major=$1
18018 db_version_minor=$2
18019 db_version_patch=$3
18021 echo "I can't use Berkeley DB with your <db.h>. I'll disable Berkeley DB." >&4
18025 : Remove db from list of libraries to use
18026 echo "Removing unusable -ldb from library list" >&4
18027 set `echo X $libs | $sed -e 's/-ldb / /' -e 's/-ldb$//'`
18030 echo "libs = $libs" >&4
18040 : Check the return type needed for hash
18042 echo "Checking return type needed for hash for Berkeley DB ..." >&4
18048 #include <sys/types.h>
18051 #ifndef DB_VERSION_MAJOR
18052 u_int32_t hash_cb (ptr, size)
18060 info.hash = hash_cb;
18064 if $cc $ccflags -c try.c >try.out 2>&1 ; then
18065 if $contains warning try.out >>/dev/null 2>&1 ; then
18068 db_hashtype='u_int32_t'
18071 : XXX Maybe we should just give up here.
18072 db_hashtype=u_int32_t
18074 echo "Help: I can't seem to compile the db test program." >&4
18075 echo "Something's wrong, but I'll assume you use $db_hashtype." >&4
18078 echo "Your version of Berkeley DB uses $db_hashtype for hash."
18080 *) db_hashtype=u_int32_t
18085 : Check the return type needed for prefix
18087 echo "Checking return type needed for prefix for Berkeley DB ..." >&4
18093 #include <sys/types.h>
18096 #ifndef DB_VERSION_MAJOR
18097 size_t prefix_cb (key1, key2)
18105 info.prefix = prefix_cb;
18109 if $cc $ccflags -c try.c >try.out 2>&1 ; then
18110 if $contains warning try.out >>/dev/null 2>&1 ; then
18111 db_prefixtype='int'
18113 db_prefixtype='size_t'
18116 db_prefixtype='size_t'
18117 : XXX Maybe we should just give up here.
18119 echo "Help: I can't seem to compile the db test program." >&4
18120 echo "Something's wrong, but I'll assume you use $db_prefixtype." >&4
18123 echo "Your version of Berkeley DB uses $db_prefixtype for prefix."
18125 *) db_prefixtype='size_t'
18130 : How can we generate normalized random numbers ?
18132 echo "Looking for a random number function..." >&4
18133 case "$randfunc" in
18135 if set drand48 val -f; eval $csym; $val; then
18137 echo "Good, found drand48()." >&4
18138 elif set random val -f; eval $csym; $val; then
18140 echo "OK, found random()." >&4
18143 echo "Yick, looks like I have to use rand()." >&4
18154 *-Dmy_rand=*|*-Dmy_srand=*)
18155 echo "Removing obsolete -Dmy_rand, -Dmy_srand, and -Drandbits from ccflags." >&4
18156 ccflags="`echo $ccflags | sed -e 's/-Dmy_rand=random/ /'`"
18157 ccflags="`echo $ccflags | sed -e 's/-Dmy_srand=srandom/ /'`"
18158 ccflags="`echo $ccflags | sed -e 's/-Drandbits=[0-9][0-9]*/ /'`"
18162 while $test "$cont"; do
18163 rp="Use which function to generate random numbers?"
18165 if $test "$ans" = "$dflt"; then
18171 if set $ans val -f; eval $csym; $val; then
18175 rp="I cannot find function $ans. Use that name anyway?"
18184 case "$randfunc" in
18186 drand01="drand48()"
18192 case "$randbits" in
18194 echo "Checking to see how many bits your $randfunc() function produces..." >&4
18196 #$i_unistd I_UNISTD
18197 #$i_stdlib I_STDLIB
18200 # include <unistd.h>
18203 # include <stdlib.h>
18208 register unsigned long tmp;
18209 register unsigned long max = 0L;
18211 for (i = 1000; i; i--) {
18212 tmp = (unsigned long) $randfunc();
18213 if (tmp > max) max = tmp;
18215 for (i = 0; max; i++)
18221 if eval $compile_ok; then
18225 echo "(I can't seem to compile the test program...)"
18232 rp="How many bits does your $randfunc() function produce?"
18236 drand01="($randfunc() / (double) ((unsigned long)1 << $randbits))"
18237 seedfunc="s$randfunc"
18238 randseedtype=unsigned
18242 rp="How many bits does your $randfunc() function produce?"
18245 seedfunc="s$randfunc"
18246 drand01="($randfunc() / (double) ((unsigned long)1 << $randbits))"
18247 if set $seedfunc val -f; eval $csym; $val; then
18248 echo "(Using $seedfunc() to seed random generator)"
18250 echo "(Warning: no $seedfunc() to seed random generator)"
18253 randseedtype=unsigned
18261 echo "Determining whether or not we are on an EBCDIC system..." >&4
18262 $cat >try.c <<'EOM'
18265 if ('M'==0xd4) return 0;
18272 if eval $compile_ok; then
18273 if $run ./try; then
18274 echo "You seem to speak EBCDIC." >&4
18277 echo "Nope, no EBCDIC, probably ASCII or some ISO Latin. Or UTF-8." >&4
18280 echo "I'm unable to compile the test program." >&4
18281 echo "I'll assume ASCII or some ISO Latin. Or UTF8." >&4
18289 Checking how to flush all pending stdio output...
18291 # I only know how to find the first 32 possibly open files on SunOS.
18292 # See also hints/sunos_4_1.sh and util.c --AD
18294 sunos) $echo '#define PERL_FFLUSH_ALL_FOPEN_MAX 32' > try.c ;;
18296 $cat >>try.c <<EOCP
18298 #$i_stdlib I_STDLIB
18300 #include <stdlib.h>
18302 #$i_unistd I_UNISTD
18304 # include <unistd.h>
18306 #$d_sysconf HAS_SYSCONF
18307 #$d_stdio_stream_array HAS_STDIO_STREAM_ARRAY
18308 #ifdef HAS_STDIO_STREAM_ARRAY
18309 # define STDIO_STREAM_ARRAY $stdio_stream_array
18314 p = fopen("try.out", "w");
18318 # ifdef TRY_FPRINTF
18322 #ifdef TRY_FFLUSH_NULL
18325 #ifdef TRY_FFLUSH_ALL
18327 long open_max = -1;
18328 # ifdef PERL_FFLUSH_ALL_FOPEN_MAX
18329 open_max = PERL_FFLUSH_ALL_FOPEN_MAX;
18331 # if defined(HAS_SYSCONF) && defined(_SC_OPEN_MAX)
18332 open_max = sysconf(_SC_OPEN_MAX);
18335 open_max = FOPEN_MAX;
18338 open_max = OPEN_MAX;
18347 # ifdef HAS_STDIO_STREAM_ARRAY
18348 if (open_max > 0) {
18350 for (i = 0; i < open_max; i++)
18351 if (STDIO_STREAM_ARRAY[i]._file >= 0 &&
18352 STDIO_STREAM_ARRAY[i]._file < open_max &&
18353 STDIO_STREAM_ARRAY[i]._flag)
18354 fflush(&STDIO_STREAM_ARRAY[i]);
18362 : first we have to find out how _not_ to flush
18364 if $test "X$fflushNULL" = X -o "X$fflushall" = X; then
18366 set try -DTRY_FPUTC
18367 if eval $compile; then
18368 $run ./try 2>/dev/null
18371 if $test ! -s try.out -a "X$code" = X42; then
18377 set try -DTRY_FPRINTF
18378 if eval $compile; then
18379 $run ./try 2>/dev/null
18382 if $test ! -s try.out -a "X$code" = X42; then
18383 output=-DTRY_FPRINTF
18389 : check for fflush NULL behaviour
18390 case "$fflushNULL" in
18391 '') set try -DTRY_FFLUSH_NULL $output
18392 if eval $compile; then
18393 $run ./try 2>/dev/null
18396 if $test -s try.out -a "X$code" = X42; then
18397 fflushNULL="`$cat try.out`"
18399 if $test "X$code" != X42; then
18401 (If this test failed, don't worry, we'll try another method shortly.)
18406 $rm -f core try.core core.try.*
18407 case "$fflushNULL" in
18409 Your fflush(NULL) works okay for output streams.
18410 Let's see if it clobbers input pipes...
18412 # As of mid-March 2000 all versions of Solaris appear to have a stdio
18413 # bug that improperly flushes the input end of pipes. So we avoid the
18414 # autoflush on fork/system/exec support for now. :-(
18415 $cat >tryp.c <<EOCP
18418 main(int argc, char **argv)
18424 while ((i = getc(stdin)) != -1
18425 && (*bp++ = i) != '\n'
18426 && bp < &buf[1024])
18429 fprintf(stdout, "%s", buf);
18437 fflushNULL="$define"
18439 if eval $compile; then
18441 $cat tryp.c | $run ./tryp 2>/dev/null > tryp.out
18442 if cmp tryp.c tryp.out >/dev/null 2>&1; then
18444 fflush(NULL) seems to behave okay with input streams.
18446 fflushNULL="$define"
18449 Ouch, fflush(NULL) clobbers input pipes! We will not use it.
18451 fflushNULL="$undef"
18454 $rm -f core tryp.c tryp.core core.tryp.*
18457 Your fflush(NULL) isn't working (contrary to ANSI C).
18459 fflushNULL="$undef"
18462 Cannot figure out whether your fflush(NULL) works or not.
18463 I'm assuming it doesn't (contrary to ANSI C).
18465 fflushNULL="$undef"
18469 $define|true|[yY]*)
18470 fflushNULL="$define"
18473 fflushNULL="$undef"
18476 : check explicit looping only if NULL did not work, and if the pipe
18477 : bug does not show up on an explicit flush too
18478 case "$fflushNULL" in
18480 $cat >tryp.c <<EOCP
18483 main(int argc, char **argv)
18489 while ((i = getc(stdin)) != -1
18490 && (*bp++ = i) != '\n'
18491 && bp < &buf[1024])
18494 fprintf(stdout, "%s", buf);
18503 if eval $compile; then
18505 $cat tryp.c | $run ./tryp 2>/dev/null > tryp.out
18506 if cmp tryp.c tryp.out >/dev/null 2>&1; then
18508 Good, at least fflush(stdin) seems to behave okay when stdin is a pipe.
18510 : now check for fflushall behaviour
18511 case "$fflushall" in
18512 '') set try -DTRY_FFLUSH_ALL $output
18513 if eval $compile; then
18515 (Now testing the other method--but note that this also may fail.)
18517 $run ./try 2>/dev/null
18520 if $test -s try.out -a "X$code" = X42; then
18521 fflushall="`$cat try.out`"
18524 $rm -f core try.core core.try.*
18525 case "$fflushall" in
18527 Whew. Flushing explicitly all the stdio streams works.
18529 fflushall="$define"
18532 Sigh. Flushing explicitly all the stdio streams doesn't work.
18537 Cannot figure out whether flushing stdio streams explicitly works or not.
18538 I'm assuming it doesn't.
18544 "$define"|true|[yY]*)
18545 fflushall="$define"
18553 All is futile. Even fflush(stdin) clobbers input pipes!
18560 $rm -f core tryp.c tryp.core core.tryp.*
18562 *) fflushall="$undef"
18566 case "$fflushNULL$fflushall" in
18569 OK, I give up. I cannot figure out how to flush pending stdio output.
18570 We won't be flushing handles at all before fork/exec/popen.
18574 $rm -f try.* try$exe_ext
18576 : Store the full pathname to the ar program for use in the C program
18577 : Respect a hint or command line value for full_ar.
18582 : Store the full pathname to the sed program for use in the C program
18585 : see what type gids are declared as in the kernel
18587 echo "Looking for the type for group ids returned by getgid()."
18588 set gid_t gidtype xxx stdio.h sys/types.h
18592 xxx=`./findhdr sys/user.h`
18593 set `grep 'groups\[NGROUPS\];' "$xxx" 2>/dev/null` unsigned short
18595 unsigned) dflt="$1 $2" ;;
18599 *) dflt="$gidtype";;
18602 gid_t) echo "gid_t found." ;;
18603 *) rp="What is the type for group ids returned by getgid()?"
18611 *_t) zzz="$gidtype" ;;
18614 echo "Checking the size of $zzz..." >&4
18616 #include <sys/types.h>
18618 #$i_stdlib I_STDLIB
18620 #include <stdlib.h>
18623 printf("%d\n", (int)sizeof($gidtype));
18628 if eval $compile_ok; then
18632 echo "(I can't execute the test program--guessing $gidsize.)" >&4
18635 echo "Your $zzz is $gidsize bytes long."
18640 echo "(I can't compile the test program--guessing $gidsize.)" >&4
18646 *_t) zzz="$gidtype" ;;
18649 echo "Checking the sign of $zzz..." >&4
18651 #include <sys/types.h>
18662 if eval $compile; then
18666 echo "(I can't execute the test program--guessing unsigned.)" >&4
18670 1) echo "Your $zzz is unsigned." ;;
18671 -1) echo "Your $zzz is signed." ;;
18677 echo "(I can't compile the test program--guessing unsigned.)" >&4
18683 if $test X"$quadtype" != X; then
18685 echo "Checking how to print 64-bit integers..." >&4
18687 if $test X"$sPRId64" = X -a X"$quadtype" = Xint; then
18688 $cat >try.c <<'EOCP'
18689 #include <sys/types.h>
18692 int q = 12345678901;
18693 printf("%ld\n", q);
18697 if eval $compile; then
18701 sPRId64='"d"'; sPRIi64='"i"'; sPRIu64='"u"';
18702 sPRIo64='"o"'; sPRIx64='"x"'; sPRIXU64='"X"';
18703 echo "We will use %d."
18709 if $test X"$sPRId64" = X -a X"$quadtype" = Xlong; then
18710 $cat >try.c <<'EOCP'
18711 #include <sys/types.h>
18714 long q = 12345678901;
18715 printf("%ld\n", q);
18719 if eval $compile; then
18723 sPRId64='"ld"'; sPRIi64='"li"'; sPRIu64='"lu"';
18724 sPRIo64='"lo"'; sPRIx64='"lx"'; sPRIXU64='"lX"';
18725 echo "We will use %ld."
18731 if $test X"$sPRId64" = X -a X"$i_inttypes" = X"$define" -a X"$quadtype" = Xint64_t; then
18732 $cat >try.c <<'EOCP'
18733 #include <sys/types.h>
18734 #include <inttypes.h>
18737 int64_t q = 12345678901;
18738 printf("%" PRId64 "\n", q);
18742 if eval $compile; then
18746 sPRId64=PRId64; sPRIi64=PRIi64; sPRIu64=PRIu64;
18747 sPRIo64=PRIo64; sPRIx64=PRIx64; sPRIXU64=PRIXU64;
18748 echo "We will use the C9X style."
18754 if $test X"$sPRId64" = X -a X"$quadtype" != X; then
18756 #include <sys/types.h>
18759 $quadtype q = 12345678901;
18760 printf("%Ld\n", q);
18764 if eval $compile; then
18768 sPRId64='"Ld"'; sPRIi64='"Li"'; sPRIu64='"Lu"';
18769 sPRIo64='"Lo"'; sPRIx64='"Lx"'; sPRIXU64='"LX"';
18770 echo "We will use %Ld."
18776 if $test X"$sPRId64" = X -a X"$quadtype" = X"long long"; then
18777 $cat >try.c <<'EOCP'
18778 #include <sys/types.h>
18781 long long q = 12345678901LL; /* AIX cc requires the LL suffix. */
18782 printf("%lld\n", q);
18786 if eval $compile; then
18790 sPRId64='"lld"'; sPRIi64='"lli"'; sPRIu64='"llu"';
18791 sPRIo64='"llo"'; sPRIx64='"llx"'; sPRIXU64='"llX"';
18792 echo "We will use the %lld style."
18798 if $test X"$sPRId64" = X -a X"$quadtype" != X; then
18800 #include <sys/types.h>
18803 $quadtype q = 12345678901;
18804 printf("%qd\n", q);
18808 if eval $compile; then
18812 sPRId64='"qd"'; sPRIi64='"qi"'; sPRIu64='"qu"';
18813 sPRIo64='"qo"'; sPRIx64='"qx"'; sPRIXU64='"qX"';
18814 echo "We will use %qd."
18820 if $test X"$sPRId64" = X; then
18821 echo "Cannot figure out how to print 64-bit integers." >&4
18829 '') d_PRId64="$undef"; d_PRIi64="$undef"; d_PRIu64="$undef";
18830 d_PRIo64="$undef"; d_PRIx64="$undef"; d_PRIXU64="$undef";
18832 *) d_PRId64="$define"; d_PRIi64="$define"; d_PRIu64="$define";
18833 d_PRIo64="$define"; d_PRIx64="$define"; d_PRIXU64="$define";
18839 $echo "Checking the format strings to be used for Perl's internal types..." >&4
18841 if $test X"$ivsize" = X8; then
18842 ivdformat="$sPRId64"
18843 uvuformat="$sPRIu64"
18844 uvoformat="$sPRIo64"
18845 uvxformat="$sPRIx64"
18846 uvXUformat="$sPRIXU64"
18848 if $test X"$ivsize" = X"$longsize"; then
18855 if $test X"$ivsize" = X"$intsize"; then
18863 if $test X"$ivsize" = X"$shortsize"; then
18874 if $test X"$uselongdouble" = X"$define" -a X"$d_longdbl" = X"$define" -a X"$d_PRIgldbl" = X"$define"; then
18875 nveformat="$sPRIeldbl"
18876 nvfformat="$sPRIfldbl"
18877 nvgformat="$sPRIgldbl"
18878 nvEUformat="$sPRIEUldbl"
18879 nvFUformat="$sPRIFUldbl"
18880 nvGUformat="$sPRIGUldbl"
18890 case "$ivdformat" in
18891 '') echo "$0: Fatal: failed to find format strings, cannot continue." >&4
18898 $echo "Checking the format string to be used for gids..." >&4
18901 -1) if $test X"$gidsize" = X"$ivsize"; then
18902 gidformat="$ivdformat"
18904 if $test X"$gidsize" = X"$longsize"; then
18907 if $test X"$gidsize" = X"$intsize"; then
18910 if $test X"$gidsize" = X"$shortsize"; then
18917 *) if $test X"$gidsize" = X"$uvsize"; then
18918 gidformat="$uvuformat"
18920 if $test X"$gidsize" = X"$longsize"; then
18923 if $test X"$gidsize" = X"$intsize"; then
18926 if $test X"$gidsize" = X"$shortsize"; then
18935 : see if getgroups exists
18936 set getgroups d_getgrps
18939 : see if setgroups exists
18940 set setgroups d_setgrps
18944 : Find type of 2nd arg to 'getgroups()' and 'setgroups()'
18946 case "$d_getgrps$d_setgrps" in
18948 case "$groupstype" in
18949 '') dflt="$gidtype" ;;
18950 *) dflt="$groupstype" ;;
18953 What type of pointer is the second argument to getgroups() and setgroups()?
18954 Usually this is the same as group ids, $gidtype, but not always.
18957 rp='What type pointer is the second argument to getgroups() and setgroups()?'
18961 *) groupstype="$gidtype";;
18965 echo "Checking if your $make program sets \$(MAKE)..." >&4
18966 case "$make_set_make" in
18968 $sed 's/^X //' > testmake.mak << 'EOF'
18970 X @echo 'maketemp="$(MAKE)"'
18972 case "`$make -f testmake.mak 2>/dev/null`" in
18973 *maketemp=*) make_set_make='#' ;;
18974 *) make_set_make="MAKE=$make" ;;
18976 $rm -f testmake.mak
18979 case "$make_set_make" in
18980 '#') echo "Yup, it does.";;
18981 *) echo "Nope, it doesn't.";;
18984 : see what type is used for mode_t
18985 rp="What is the type used for file modes for system calls (e.g. fchmod())?"
18986 set mode_t modetype int stdio.h sys/types.h
18989 : see if stdarg is available
18991 if $test `./findhdr stdarg.h`; then
18992 echo "<stdarg.h> found." >&4
18995 echo "<stdarg.h> NOT found." >&4
18999 : see if varags is available
19001 if $test `./findhdr varargs.h`; then
19002 echo "<varargs.h> found." >&4
19004 echo "<varargs.h> NOT found, but that's ok (I hope)." >&4
19007 : set up the varargs testing programs
19008 $cat > varargs.c <<EOP
19010 #include <stdarg.h>
19013 #include <varargs.h>
19017 int f(char *p, ...)
19031 p = va_arg(ap, char *);
19036 $cat > varargs <<EOP
19038 if $cc -c $ccflags -D\$1 varargs.c >/dev/null 2>&1; then
19047 : now check which varargs header should be included
19052 if `./varargs I_STDARG`; then
19054 elif `./varargs I_VARARGS`; then
19059 if `./varargs I_VARARGS`; then
19066 echo "I could not find the definition for va_dcl... You have problems..." >&4
19067 val="$undef"; set i_stdarg; eval $setvar
19068 val="$undef"; set i_varargs; eval $setvar
19073 case "$i_varhdr" in
19075 val="$define"; set i_stdarg; eval $setvar
19076 val="$undef"; set i_varargs; eval $setvar
19079 val="$undef"; set i_stdarg; eval $setvar
19080 val="$define"; set i_varargs; eval $setvar
19083 echo "We'll include <$i_varhdr> to get va_dcl definition." >&4;;
19087 : see if we need va_copy
19089 case "$i_stdarg" in
19092 #include <stdarg.h>
19094 #$i_stdlib I_STDLIB
19096 #include <stdlib.h>
19098 #include <signal.h>
19101 ivfprintf(FILE *f, const char *fmt, va_list *valp)
19103 return vfprintf(f, fmt, *valp);
19107 myvfprintf(FILE *f, const char *fmt, va_list val)
19109 return ivfprintf(f, fmt, &val);
19113 myprintf(char *fmt, ...)
19116 va_start(val, fmt);
19117 return myvfprintf(stdout, fmt, val);
19121 main(int ac, char **av)
19123 signal(SIGSEGV, exit);
19125 myprintf("%s%cs all right, then\n", "that", '\'');
19130 if eval $compile && $run ./try 2>&1 >/dev/null; then
19131 case "`$run ./try`" in
19132 "that's all right, then")
19138 yes) echo "It seems that you don't need va_copy()." >&4
19139 need_va_copy="$undef"
19141 *) echo "It seems that va_copy() or similar will be needed." >&4
19142 need_va_copy="$define"
19145 $rm -f try.* core core.* *.core *.core.*
19147 *) echo "You don't have <stdarg.h>, not checking for va_copy()." >&4
19151 : see what type is used for size_t
19152 rp="What is the type used for the length parameter for string functions?"
19153 set size_t sizetype 'unsigned int' stdio.h sys/types.h
19156 : check for type of arguments to gethostbyaddr.
19157 if test "X$netdb_host_type" = X -o "X$netdb_hlen_type" = X; then
19158 case "$d_gethbyaddr" in
19162 Checking to see what type of arguments are accepted by gethostbyaddr().
19164 hdrs="$define sys/types.h
19165 $d_socket sys/socket.h
19166 $i_niin netinet/in.h
19168 $i_unistd unistd.h"
19169 : The first arg can 'char *' or 'void *'
19170 : The second arg is some of integral type
19171 for xxx in in_addr_t 'const void *' 'const char *' 'void *' 'char *'; do
19172 for yyy in size_t long int; do
19173 case "$netdb_host_type" in
19174 '') try="extern struct hostent *gethostbyaddr($xxx, $yyy, int);"
19175 if ./protochk "$try" $hdrs; then
19176 echo "Your system accepts $xxx for the first arg."
19177 echo "...and $yyy for the second arg."
19178 netdb_host_type="$xxx"
19179 netdb_hlen_type="$yyy"
19185 : In case none of those worked, prompt the user.
19186 case "$netdb_host_type" in
19187 '') rp='What is the type for the 1st argument to gethostbyaddr?'
19190 netdb_host_type=$ans
19191 rp='What is the type for the 2nd argument to gethostbyaddr?'
19194 netdb_hlen_type=$ans
19198 *) : no gethostbyaddr, so pick harmless defaults
19199 netdb_host_type='char *'
19200 netdb_hlen_type="$sizetype"
19203 # Remove the "const" if needed. -- but then we'll have a
19205 # netdb_host_type=`echo "$netdb_host_type" | sed 's/^const //'`
19208 : check for type of argument to gethostbyname.
19209 if test "X$netdb_name_type" = X ; then
19210 case "$d_gethbyname" in
19214 Checking to see what type of argument is accepted by gethostbyname().
19216 hdrs="$define sys/types.h
19217 $d_socket sys/socket.h
19218 $i_niin netinet/in.h
19220 $i_unistd unistd.h"
19221 for xxx in "const char *" "char *"; do
19222 case "$netdb_name_type" in
19223 '') try="extern struct hostent *gethostbyname($xxx);"
19224 if ./protochk "$try" $hdrs; then
19225 echo "Your system accepts $xxx."
19226 netdb_name_type="$xxx"
19231 : In case none of those worked, prompt the user.
19232 case "$netdb_name_type" in
19233 '') rp='What is the type for the 1st argument to gethostbyname?'
19236 netdb_name_type=$ans
19240 *) : no gethostbyname, so pick harmless default
19241 netdb_name_type='char *'
19246 : check for type of 1st argument to getnetbyaddr.
19247 if test "X$netdb_net_type" = X ; then
19248 case "$d_getnbyaddr" in
19252 Checking to see what type of 1st argument is accepted by getnetbyaddr().
19254 hdrs="$define sys/types.h
19255 $d_socket sys/socket.h
19256 $i_niin netinet/in.h
19258 $i_unistd unistd.h"
19259 for xxx in in_addr_t "unsigned long" long "unsigned int" int; do
19260 case "$netdb_net_type" in
19261 '') try="extern struct netent *getnetbyaddr($xxx, int);"
19262 if ./protochk "$try" $hdrs; then
19263 echo "Your system accepts $xxx."
19264 netdb_net_type="$xxx"
19269 : In case none of those worked, prompt the user.
19270 case "$netdb_net_type" in
19271 '') rp='What is the type for the 1st argument to getnetbyaddr?'
19274 netdb_net_type=$ans
19278 *) : no getnetbyaddr, so pick harmless default
19279 netdb_net_type='long'
19283 : locate the preferred pager for this system
19290 [a-zA-Z]:/*) dflt=$pg;;
19294 [a-zA-Z]:/*) dflt=$more;;
19298 [a-zA-Z]:/*) dflt=$less;;
19301 '') dflt=/usr/ucb/more;;
19305 : Instruct ./getfile to trust the hinted or previous pager value,
19306 : even if it does not begin with a slash. For example, on os2,
19307 : pager might be cmd /c more. See comments in UU/getfile.
19312 rp='What pager is used on your system?'
19316 : see what type pids are declared as in the kernel
19317 rp="What is the type of process ids on this system?"
19318 set pid_t pidtype int stdio.h sys/types.h
19321 : see if ar generates random libraries by itself
19323 echo "Checking how to generate random libraries on your machine..." >&4
19324 echo 'int bar1() { return bar2(); }' > bar1.c
19325 echo 'int bar2() { return 2; }' > bar2.c
19327 #$i_stdlib I_STDLIB
19329 #include <stdlib.h>
19331 int main() { printf("%d\n", bar1()); exit(0); }
19333 $cc $ccflags -c bar1.c >/dev/null 2>&1
19334 $cc $ccflags -c bar2.c >/dev/null 2>&1
19335 $cc $ccflags -c foo.c >/dev/null 2>&1
19336 $ar rc bar$_a bar2$_o bar1$_o >/dev/null 2>&1
19337 if $cc -o foobar $ccflags $ldflags foo$_o bar$_a $libs > /dev/null 2>&1 &&
19338 $run ./foobar >/dev/null 2>&1; then
19339 echo "$ar appears to generate random libraries itself."
19341 if [ "X$ranlib" = "X" ]; then
19344 elif $ar s bar$_a >/dev/null 2>&1 &&
19345 $cc -o foobar $ccflags $ldflags foo$_o bar$_a $libs > /dev/null 2>&1 &&
19346 $run ./foobar >/dev/null 2>&1; then
19347 echo "a table of contents needs to be added with '$ar s'."
19350 elif $ar ts bar$_a >/dev/null 2>&1 &&
19351 $cc -o foobar $ccflags $ldflags foo$_o bar$_a $libs > /dev/null 2>&1 &&
19352 $run ./foobar >/dev/null 2>&1; then
19353 echo "a table of contents needs to be added with '$ar ts'."
19360 ranlib=`./loc ranlib X /usr/bin /bin /usr/local/bin`
19361 $test -f $ranlib || ranlib=''
19364 if $test -n "$ranlib"; then
19365 echo "your system has '$ranlib'; we'll use that."
19368 echo "your system doesn't seem to support random libraries"
19369 echo "so we'll use lorder and tsort to order the libraries."
19376 : check for type of arguments to select.
19377 case "$selecttype" in
19378 '') case "$d_select" in
19382 Checking to see what type of arguments are accepted by select().
19384 hdrs="$define sys/types.h
19385 $i_systime sys/time.h
19386 $i_sysselct sys/select.h
19387 $d_socket sys/socket.h"
19388 : The first arg can be int, unsigned, or size_t
19389 : The last arg may or may not be 'const'
19391 : void pointer has been seen but using that
19392 : breaks the selectminbits test
19393 for xxx in 'fd_set *' 'int *'; do
19394 for nfd in 'int' 'size_t' 'unsigned long' 'unsigned' ; do
19395 for tmo in 'struct timeval *' 'const struct timeval *'; do
19397 '') try="extern select _(($nfd, $xxx, $xxx, $xxx, $tmo));"
19398 if ./protochk "$try" $hdrs; then
19399 echo "Your system accepts $xxx."
19408 '') rp='What is the type for the 2nd, 3rd, and 4th arguments to select?'
19409 case "$d_fd_set" in
19410 $define) dflt="fd_set *" ;;
19419 *) : no select, so pick a harmless default
19426 : check for the select 'width'
19427 case "$selectminbits" in
19428 '') safebits=`expr $ptrsize \* 8`
19429 case "$d_select" in
19433 Checking to see on how many bits at a time your select() operates...
19436 #include <sys/types.h>
19438 #$i_systime I_SYS_TIME
19439 #$i_systimek I_SYS_TIME_KERNEL
19444 # ifdef I_SYS_TIME_KERNEL
19447 # include <sys/time.h>
19448 # ifdef I_SYS_TIME_KERNEL
19452 #$i_sysselct I_SYS_SELECT
19453 #ifdef I_SYS_SELECT
19454 #include <sys/select.h>
19456 #$d_socket HAS_SOCKET
19458 # include <sys/socket.h> /* Might include <sys/bsdtypes.h> */
19461 #$i_stdlib I_STDLIB
19463 #include <stdlib.h>
19466 #define S sizeof(*(b))
19468 #define NBYTES (S * 8 > MINBITS ? S : MINBITS/8)
19469 #define NBITS (NBYTES * 8)
19471 char *s = malloc(NBYTES);
19480 fp = fopen("try.c", "r");
19486 b = ($selecttype)s;
19487 for (i = 0; i < NBITS; i++)
19491 select(fd + 1, b, 0, 0, &t);
19492 for (i = NBITS - 1; i > fd && FD_ISSET(i, b); i--);
19494 printf("%d\n", i + 1);
19499 if eval $compile_ok; then
19500 selectminbits=`$run ./try`
19501 case "$selectminbits" in
19503 Cannot figure out on how many bits at a time your select() operates.
19504 I'll play safe and guess it is $safebits bits.
19506 selectminbits=$safebits
19507 bits="$safebits bits"
19510 *) bits="$selectminbits bits" ;;
19512 echo "Your select() operates on $bits at a time." >&4
19514 rp='What is the minimum number of bits your select() operates on?'
19515 case "$byteorder" in
19516 12345678) dflt=64 ;;
19522 selectminbits="$val"
19526 *) : no select, so pick a harmless default
19527 selectminbits=$safebits
19533 : Trace out the files included by signal.h, then look for SIGxxx names.
19534 : Remove SIGARRAYSIZE used by HPUX.
19535 : Remove SIGSTKSIZE used by Linux.
19536 : Remove SIGSTKSZ used by Posix.
19537 : Remove SIGTYP void lines used by OS2.
19538 : Some cpps, like os390, dont give the file name anywhere
19539 if [ "X$fieldn" = X ]; then
19540 : Just make some guesses. We check them later.
19541 xxx='/usr/include/signal.h /usr/include/sys/signal.h'
19543 xxx=`echo '#include <signal.h>' |
19544 $cppstdin $cppminus $cppflags 2>/dev/null |
19545 $grep '^[ ]*#.*include' |
19546 $awk "{print \\$$fieldn}" | $sed 's!"!!g' | $sed 's!\\\\\\\\!/!g' | $sort | $uniq`
19548 : Check this list of files to be sure we have parsed the cpp output ok.
19549 : This will also avoid potentially non-existent files, such
19552 for xx in $xxx /dev/null ; do
19553 $test -f "$xx" && xxxfiles="$xxxfiles $xx"
19555 : If we have found no files, at least try signal.h
19556 case "$xxxfiles" in
19557 '') xxxfiles=`./findhdr signal.h` ;;
19560 $1 ~ /^#define$/ && $2 ~ /^SIG[A-Z0-9]*$/ && $2 !~ /SIGARRAYSIZE/ && $2 !~ /SIGSTKSIZE/ && $2 !~ /SIGSTKSZ/ && $3 !~ /void/ {
19561 print substr($2, 4, 20)
19563 $1 == "#" && $2 ~ /^define$/ && $3 ~ /^SIG[A-Z0-9]*$/ && $3 !~ /SIGARRAYSIZE/ && $4 !~ /void/ {
19564 print substr($3, 4, 20)
19566 : Append some common names just in case the awk scan failed.
19567 xxx="$xxx ABRT ALRM BUS CANCEL CHLD CLD CONT DIL EMT FPE"
19568 xxx="$xxx FREEZE HUP ILL INT IO IOT KILL LOST LWP PHONE"
19569 xxx="$xxx PIPE POLL PROF PWR QUIT RTMAX RTMIN SEGV STKFLT STOP"
19570 xxx="$xxx SYS TERM THAW TRAP TSTP TTIN TTOU URG USR1 USR2"
19571 xxx="$xxx USR3 USR4 VTALRM WAITING WINCH WIND WINDOW XCPU XFSZ"
19573 : generate a few handy files for later
19574 $cat > signal.c <<EOCP
19575 #include <sys/types.h>
19576 #include <signal.h>
19577 #$i_stdlib I_STDLIB
19579 #include <stdlib.h>
19584 /* Strange style to avoid deeply-nested #if/#else/#endif */
19587 # define NSIG (_NSIG)
19593 # define NSIG (SIGMAX+1)
19599 # define NSIG (SIG_MAX+1)
19605 # define NSIG (_SIG_MAX+1)
19611 # define NSIG (MAXSIG+1)
19617 # define NSIG (MAX_SIG+1)
19622 # ifdef SIGARRAYSIZE
19623 # define NSIG SIGARRAYSIZE /* Assume ary[SIGARRAYSIZE] */
19629 # define NSIG (_sys_nsig) /* Solaris 2.5 */
19633 /* Default to some arbitrary number that's big enough to get most
19634 of the common signals.
19640 printf("NSIG %d\n", NSIG);
19646 echo $xxx | $tr ' ' $trnl | $sort | $uniq | $awk '
19648 printf "#ifdef SIG"; printf $1; printf "\n"
19649 printf "printf(\""; printf $1; printf " %%d\\n\",SIG";
19650 printf $1; printf ");\n"
19654 printf "#endif /* JUST_NSIG */\n";
19655 printf "exit(0);\n}\n";
19658 $cat >signal.awk <<'EOP'
19659 BEGIN { ndups = 0 }
19660 $1 ~ /^NSIG$/ { nsig = $2 }
19661 ($1 !~ /^NSIG$/) && (NF == 2) && ($2 ~ /^[0-9][0-9]*$/) {
19662 if ($2 > maxsig) { maxsig = $2 }
19663 if (sig_name[$2]) {
19664 dup_name[ndups] = $1
19665 dup_num[ndups] = $2
19677 printf("NSIG %d\n", nsig);
19678 for (n = 1; n < nsig; n++) {
19680 printf("%s %d\n", sig_name[n], sig_num[n])
19683 printf("NUM%d %d\n", n, n)
19686 for (n = 0; n < ndups; n++) {
19687 printf("%s %d\n", dup_name[n], dup_num[n])
19691 $cat >signal_cmd <<EOS
19693 if $test -s signal.lst; then
19694 echo "Using your existing signal.lst file"
19699 $cat >>signal_cmd <<'EOS'
19702 if eval $compile_ok; then
19703 $run ./signal$_exe | ($sort -n -k 2 2>/dev/null || $sort -n +1) | $uniq | $awk -f signal.awk >signal.lst
19705 echo "(I can't seem be able to compile the whole test program)" >&4
19706 echo "(I'll try it in little pieces.)" >&4
19707 set signal -DJUST_NSIG
19708 if eval $compile_ok; then
19709 $run ./signal$_exe > signal.nsg
19712 echo "I can't seem to figure out how many signals you have." >&4
19713 echo "Guessing 50." >&4
19714 echo 'NSIG 50' > signal.nsg
19716 : Now look at all the signal names, one at a time.
19717 for xx in `echo $xxx | $tr ' ' $trnl | $sort | $uniq`; do
19718 $cat > signal.c <<EOCP
19719 #include <sys/types.h>
19720 #include <signal.h>
19723 printf("$xx %d\n", SIG${xx});
19728 if eval $compile; then
19729 echo "SIG${xx} found."
19730 $run ./signal$_exe >> signal.ls1
19732 echo "SIG${xx} NOT found."
19735 if $test -s signal.ls1; then
19736 $cat signal.nsg signal.ls1 |
19737 $sort -n | $uniq | $awk -f signal.awk >signal.lst
19741 if $test -s signal.lst; then
19744 echo "(AAK! I can't compile the test programs -- Guessing)" >&4
19745 echo 'kill -l' >signal
19746 set X `csh -f <signal`
19750 0) set HUP INT QUIT ILL TRAP ABRT EMT FPE KILL BUS SEGV SYS PIPE ALRM TERM;;
19752 echo $@ | $tr ' ' $trnl | \
19753 $awk '{ printf "%s %d\n", $1, ++s; }
19754 END { printf "NSIG %d\n", ++s }' >signal.lst
19756 $rm -f signal.c signal$_exe signal$_o signal.nsg signal.ls1
19758 chmod a+x signal_cmd
19759 $eunicefix signal_cmd
19761 : generate list of signal names
19763 case "$sig_name_init" in
19765 *) case "$sig_num_init" in
19766 ''|*,*) doinit=yes ;;
19771 echo "Generating a list of signal names and numbers..." >&4
19773 sig_count=`$awk '/^NSIG/ { printf "%d", $2 }' signal.lst`
19774 sig_name=`$awk 'BEGIN { printf "ZERO " }
19775 !/^NSIG/ { printf "%s ", $1 }' signal.lst`
19776 sig_num=`$awk 'BEGIN { printf "0 " }
19777 !/^NSIG/ { printf "%d ", $2 }' signal.lst`
19778 sig_name_init=`$awk 'BEGIN { printf "\"ZERO\", " }
19779 !/^NSIG/ { printf "\"%s\", ", $1 }
19780 END { printf "0\n" }' signal.lst`
19781 sig_num_init=`$awk 'BEGIN { printf "0, " }
19782 !/^NSIG/ { printf "%d, ", $2}
19783 END { printf "0\n"}' signal.lst`
19786 echo "The following $sig_count signals are available:"
19788 echo $sig_name | $awk \
19789 'BEGIN { linelen = 0 }
19791 for (i = 1; i <= NF; i++) {
19792 name = "SIG" $i " "
19793 linelen = linelen + length(name)
19794 if (linelen > 70) {
19796 linelen = length(name)
19802 sig_size=`echo $sig_name | awk '{print NF}'`
19803 $rm -f signal signal.c signal.awk signal.lst signal_cmd
19806 case "$sizetype" in
19807 *_t) zzz="$sizetype" ;;
19808 *) zzz="filesize" ;;
19810 echo "Checking the size of $zzz..." >&4
19812 #include <sys/types.h>
19814 #$i_stdlib I_STDLIB
19816 #include <stdlib.h>
19819 printf("%d\n", (int)sizeof($sizetype));
19824 if eval $compile_ok; then
19828 echo "(I can't execute the test program--guessing $sizesize.)" >&4
19831 echo "Your $zzz size is $sizesize bytes."
19836 echo "(I can't compile the test program--guessing $sizesize.)" >&4
19840 : check for socklen_t
19842 echo "Checking to see if you have socklen_t..." >&4
19844 #include <sys/types.h>
19845 #$d_socket HAS_SOCKET
19847 #include <sys/socket.h>
19849 int main() { socklen_t x = 16; }
19852 if eval $compile; then
19854 echo "You have socklen_t."
19857 echo "You do not have socklen_t."
19858 case "$sizetype" in
19859 size_t) echo "(You do have size_t, that might work. Some people are happy with just an int.)" ;;
19866 : see if this is a socks.h system
19867 set socks.h i_socks
19870 : check for type of the size argument to socket calls
19871 case "$d_socket" in
19875 Checking to see what type is the last argument of accept().
19878 case "$d_socklen_t" in
19879 "$define") yyy="$yyy socklen_t"
19881 yyy="$yyy $sizetype int long unsigned"
19882 for xxx in $yyy; do
19883 case "$socksizetype" in
19884 '') try="extern int accept(int, struct sockaddr *, $xxx *);"
19885 case "$usesocks" in
19887 if ./protochk "$try" $i_systypes sys/types.h $d_socket sys/socket.h literal '#define INCLUDE_PROTOTYPES' $i_socks socks.h.; then
19888 echo "Your system accepts '$xxx *' for the last argument of accept()."
19889 socksizetype="$xxx"
19892 *) if ./protochk "$try" $i_systypes sys/types.h $d_socket sys/socket.h; then
19893 echo "Your system accepts '$xxx *' for the last argument of accept()."
19894 socksizetype="$xxx"
19901 : In case none of those worked, prompt the user.
19902 case "$socksizetype" in
19903 '') rp='What is the type for socket address structure sizes?'
19910 *) : no sockets, so pick relatively harmless default
19915 : see what type is used for signed size_t
19916 set ssize_t ssizetype int stdio.h sys/types.h
19921 #$i_stdlib I_STDLIB
19923 #include <stdlib.h>
19925 #include <sys/types.h>
19926 #define Size_t $sizetype
19927 #define SSize_t $dflt
19930 if (sizeof(Size_t) == sizeof(SSize_t))
19932 else if (sizeof(Size_t) == sizeof(int))
19941 if eval $compile_ok && $run ./try > /dev/null; then
19942 ssizetype=`$run ./try`
19943 echo "I'll be using $ssizetype for functions returning a byte count." >&4
19946 Help! I can't compile and run the ssize_t test program: please enlighten me!
19947 (This is probably a misconfiguration in your system or libraries, and
19948 you really ought to fix it. Still, I'll try anyway.)
19950 I need a type that is the same size as $sizetype, but is guaranteed to
19951 be signed. Common values are ssize_t, int and long.
19954 rp="What signed type is the same size as $sizetype?"
19960 : see what type of char stdio uses.
19962 echo '#include <stdio.h>' > stdio.c
19963 $cppstdin $cppminus < stdio.c > stdioh
19964 if $contains 'unsigned.*char.*_ptr;' stdioh >/dev/null 2>&1 ; then
19965 echo "Your stdio uses unsigned chars." >&4
19966 stdchar="unsigned char"
19968 echo "Your stdio uses signed chars." >&4
19971 $rm -f stdio.* stdioh
19973 : see what type uids are declared as in the kernel
19975 echo "Looking for the type for user ids returned by getuid()."
19976 set uid_t uidtype xxx stdio.h sys/types.h
19980 xxx=`./findhdr sys/user.h`
19981 set `grep '_ruid;' "$xxx" 2>/dev/null` unsigned short
19983 unsigned) dflt="$1 $2" ;;
19987 *) dflt="$uidtype";;
19990 uid_t) echo "uid_t found." ;;
19991 *) rp="What is the type for user ids returned by getuid()?"
19999 *_t) zzz="$uidtype" ;;
20002 echo "Checking the size of $zzz..." >&4
20004 #include <sys/types.h>
20006 #$i_stdlib I_STDLIB
20008 #include <stdlib.h>
20011 printf("%d\n", (int)sizeof($uidtype));
20016 if eval $compile_ok; then
20020 echo "(I can't execute the test program--guessing $uidsize.)" >&4
20023 echo "Your $zzz is $uidsize bytes long."
20028 echo "(I can't compile the test program--guessing $uidsize.)" >&4
20033 *_t) zzz="$uidtype" ;;
20036 echo "Checking the sign of $zzz..." >&4
20038 #include <sys/types.h>
20049 if eval $compile; then
20053 echo "(I can't execute the test program--guessing unsigned.)" >&4
20057 1) echo "Your $zzz is unsigned." ;;
20058 -1) echo "Your $zzz is signed." ;;
20064 echo "(I can't compile the test program--guessing unsigned.)" >&4
20070 $echo "Checking the format string to be used for uids..." >&4
20073 -1) if $test X"$uidsize" = X"$ivsize"; then
20074 uidformat="$ivdformat"
20076 if $test X"$uidsize" = X"$longsize"; then
20079 if $test X"$uidsize" = X"$intsize"; then
20082 if $test X"$uidsize" = X"$shortsize"; then
20089 *) if $test X"$uidsize" = X"$uvsize"; then
20090 uidformat="$uvuformat"
20092 if $test X"$uidsize" = X"$longsize"; then
20095 if $test X"$uidsize" = X"$intsize"; then
20098 if $test X"$uidsize" = X"$shortsize"; then
20108 case "$usesitecustomize" in
20109 $define|true|[Yy]*)
20110 usesitecustomize="$define"
20113 usesitecustomize="$undef"
20117 : determine compiler compiler
20126 if $test -f "$byacc$_exe"; then
20128 comp="byacc or $comp"
20130 if $test -f "$bison$_exe"; then
20131 comp="$comp or bison -y"
20133 rp="Which compiler compiler ($comp) shall I use?"
20142 echo "(Adding -y option to bison to get yacc-compatible behaviour.)"
20148 : see if this is a fp.h system
20152 : see if this is a fp_class.h system
20153 set fp_class.h i_fp_class
20156 : see if this is a ieeefp.h system
20157 case "$i_ieeefp" in
20158 '' ) set ieeefp.h i_ieeefp
20163 : see if this is a libutil.h system
20164 set libutil.h i_libutil
20167 : see if mach cthreads are available
20168 if test "X$usethreads" = "X$define"; then
20169 set mach/cthreads.h i_machcthr
20172 i_machcthr="$undef"
20177 : see if this is a mntent.h system
20178 set mntent.h i_mntent
20181 : see if ndbm.h is available
20187 # Some Linux distributions such as RedHat 7.1 put the
20188 # ndbm.h header in /usr/include/gdbm/ndbm.h.
20189 if $test -f /usr/include/gdbm/ndbm.h; then
20190 echo '<gdbm/ndbm.h> found.'
20191 ccflags="$ccflags -I/usr/include/gdbm"
20192 cppflags="$cppflags -I/usr/include/gdbm"
20200 : see if dbm_open exists
20201 set dbm_open d_dbm_open
20203 case "$d_dbm_open" in
20206 echo "We won't be including <ndbm.h>"
20215 : see if net/errno.h is available
20217 set net/errno.h val
20220 : Unfortunately, it causes problems on some systems. Arrgh.
20223 cat > try.c <<'EOM'
20226 #include <net/errno.h>
20232 if $cc $ccflags -c try.c >/dev/null 2>&1; then
20233 echo "We'll be including <net/errno.h>." >&4
20235 echo "We won't be including <net/errno.h>." >&4
20244 : see if netinet/tcp.h is available
20245 set netinet/tcp.h i_netinettcp
20248 : see if this is a poll.h system
20252 : see if this is a prot.h system
20257 $echo "Guessing which symbols your C compiler and preprocessor define..." >&4
20258 $cat <<'EOSH' > Cppsym.know
20259 a29k ABI64 aegis AES_SOURCE AIX AIX32 AIX370
20260 AIX41 AIX42 AIX43 AIX_SOURCE aixpc ALL_SOURCE
20261 alliant alpha am29000 AM29000 AMD64 amd64 amiga AMIGAOS AMIX
20262 ansi ANSI_C_SOURCE apollo ardent ARM32 atarist att386 att3b
20263 BeOS BIG_ENDIAN BIT_MSF bsd BSD bsd43 bsd4_2 bsd4_3 BSD4_3 bsd4_4
20264 BSD_4_3 BSD_4_4 BSD_NET2 BSD_TIME BSD_TYPES BSDCOMPAT bsdi
20265 bull c cadmus clipper CMU COFF COMPILER_VERSION
20266 concurrent convex cpu cray CRAY CRAYMPP ctix CX_UX
20267 CYGWIN DECC DGUX DGUX_SOURCE DJGPP dmert DOLPHIN DPX2 DSO
20268 Dynix DynixPTX ELF encore EPI EXTENSIONS FAVOR_BSD
20269 FILE_OFFSET_BITS FreeBSD GCC_NEW_VARARGS gcos gcx gimpel
20271 GNU_SOURCE GNUC GNUC_MINOR GNU_LIBRARY GO32 gould GOULD_PN
20272 H3050R H3050RX hbullx20 hcx host_mips
20273 hp200 hp300 hp700 HP700 hp800 hp9000
20274 hp9000s200 hp9000s300 hp9000s400 hp9000s500
20275 hp9000s700 hp9000s800 hp9k8 hp_osf hppa hpux HPUX_SOURCE
20276 i186 i286 i386 i486 i586 i686 i8086 i80960 i860 I960
20277 IA64 iAPX286 ibm ibm032 ibmesa IBMR2 ibmrt ILP32 ILP64
20278 INLINE_INTRINSICS INTRINSICS INT64 interdata is68k ksr1
20279 LANGUAGE_C LARGE_FILE_API LARGEFILE64_SOURCE
20280 LARGEFILE_SOURCE LFS64_LARGEFILE LFS_LARGEFILE
20281 Linux LITTLE_ENDIAN LONG64 LONG_DOUBLE LONG_LONG
20282 LONGDOUBLE LONGLONG LP64 luna luna88k Lynx
20283 M68000 m68k m88100 m88k M88KBCS_TARGET M_COFF
20284 M_I186 M_I286 M_I386 M_I8086 M_I86 M_I86SM M_SYS3
20285 M_SYS5 M_SYSIII M_SYSV M_UNIX M_XENIX MACH machine MachTen
20286 MATH_HAS_NO_SIDE_EFFECTS
20287 mc300 mc500 mc68000 mc68010 mc68020 mc68030 mc68040
20288 mc68060 mc68k mc68k32 mc700 mc88000 mc88100 merlin
20289 mert MiNT mips MIPS_FPSET MIPS_ISA MIPS_SIM MIPS_SZINT
20290 MIPS_SZLONG MIPS_SZPTR MIPSEB MIPSEL MODERN_C motorola
20291 mpeix MSDOS MTXINU MULTIMAX mvs MVS n16 ncl_el ncl_mr
20292 NetBSD news1500 news1700 news1800 news1900 news3700
20293 news700 news800 news900 NeXT NLS nonstopux ns16000 ns32000
20294 ns32016 ns32332 ns32k nsc32000
20295 OCS88 OEMVS OpenBSD os OS2 OS390 osf OSF1 OSF_SOURCE
20296 pa_risc PA_RISC1_1 PA_RISC2_0 PARAGON parisc
20297 pc532 pdp11 PGC PIC plexus PORTAR posix
20298 POSIX1B_SOURCE POSIX2_SOURCE POSIX4_SOURCE
20299 POSIX_C_SOURCE POSIX_SOURCE POWER
20300 PROTOTYPES PWB pyr QNX R3000 REENTRANT RES Rhapsody RISC6000
20301 riscix riscos RT S390 SA110 scs SCO sequent sgi SGI_SOURCE SH3 sinix
20302 SIZE_INT SIZE_LONG SIZE_PTR SOCKET_SOURCE SOCKETS_SOURCE
20303 sony sony_news sonyrisc sparc sparclite spectrum
20304 stardent stdc STDC_EXT stratos sun sun3 sun386
20305 Sun386i svr3 svr4 SVR4_2 SVR4_SOURCE svr5
20306 SX system SYSTYPE_BSD SYSTYPE_BSD43 SYSTYPE_BSD44
20307 SYSTYPE_SVR4 SYSTYPE_SVR5 SYSTYPE_SYSV SYSV SYSV3 SYSV4 SYSV5
20308 sysV68 sysV88 Tek4132 Tek4300 titan
20309 TM3200 TM5400 TM5600
20310 tower tower32 tower32_200 tower32_600 tower32_700
20311 tower32_800 tower32_850 tss
20312 u370 u3b u3b2 u3b20 u3b200 u3b20d u3b5
20313 ultrix UMAXV UnicomPBB UnicomPBD UNICOS UNICOSMK
20314 unix UNIX95 UNIX99 unixpc unos
20315 USE_BSD USE_FILE_OFFSET64 USE_GNU USE_ISOC9X USE_LARGEFILE USE_LARGEFILE64
20316 USE_MISC USE_POSIX USE_POSIX199309 USE_POSIX199506 USE_POSIX2
20317 USE_REENTRANT USE_SVID USE_UNIX98 USE_XOPEN USE_XOPEN_EXTENDED
20319 Utek UTek UTS UWIN uxpm uxps vax venix VMESA vms x86_64 xenix Xenix286
20320 XOPEN_SOURCE XOPEN_SOURCE_EXTENDED XPG2 XPG2_EXTENDED
20321 XPG3 XPG3_EXTENDED XPG4 XPG4_EXTENDED
20324 # Maybe put other stuff here too.
20325 cat <<EOSH >>Cppsym.know
20328 ./tr '[a-z]' '[A-Z]' < Cppsym.know > Cppsym.a
20329 ./tr '[A-Z]' '[a-z]' < Cppsym.know > Cppsym.b
20330 $cat Cppsym.know > Cppsym.c
20331 $cat Cppsym.a Cppsym.b Cppsym.c | $tr ' ' $trnl | $sort | $uniq > Cppsym.know
20332 $rm -f Cppsym.a Cppsym.b Cppsym.c
20333 cat <<EOSH > Cppsym
20335 if $test \$# -gt 0; then
20336 echo \$* | $tr " " "$trnl" | ./Cppsym.try > Cppsym.got
20337 if $test -s Cppsym.got; then
20344 $tr " " "$trnl" | ./Cppsym.try
20350 cat <<EOSH > Cppsym.try
20352 cat <<'EOCP' > try.c
20355 #define STRINGIFY(a) "a"
20357 #if cpp_stuff == 42
20358 #define StGiFy(a) #a
20359 #define STRINGIFY(a) StGiFy(a)
20361 #if $cpp_stuff != 1 && $cpp_stuff != 42
20362 # include "Bletch: How does this C preprocessor stringify macros?"
20368 cat <<'EOSH' >> Cppsym.try
20370 printf "#ifdef %s\nprintf(\"%s=%%s\\n\", STRINGIFY(%s));\n#endif\n", $1, $1, $1
20371 printf "#ifdef _%s\nprintf(\"_%s=%%s\\n\", STRINGIFY(_%s));\n#endif\n", $1, $1, $1
20372 printf "#ifdef __%s\nprintf(\"__%s=%%s\\n\", STRINGIFY(__%s));\n#endif\n", $1, $1, $1
20373 printf "#ifdef __%s__\nprintf(\"__%s__=%%s\\n\", STRINGIFY(__%s__));\n#endif\n", $1, $1, $1
20375 echo 'return 0;}' >> try.c
20377 cat <<EOSH >> Cppsym.try
20379 case "$osname-$gccversion" in
20380 irix-) ccflags="\$ccflags -woff 1178" ;;
20381 os2-*) ccflags="\$ccflags -Zlinker /PM:VIO" ;;
20383 $cc -o try -Dcpp_stuff=$cpp_stuff $optimize \$ccflags $ldflags try.c $libs && $run ./try | $sed 's/ /\\\\ /g'
20385 chmod +x Cppsym.try
20386 $eunicefix Cppsym.try
20387 ./Cppsym < Cppsym.know > Cppsym.true
20388 : Add in any linux cpp "predefined macros":
20389 case "$osname::$gccversion" in
20392 rm -f $tHdrH'.h' $tHdrH
20394 if cpp -dM $tHdrH'.h' > $tHdrH'_cppsym.h' && [ -s $tHdrH'_cppsym.h' ]; then
20395 sed 's/#define[\ \ ]*//;s/[\ \ ].*$//' <$tHdrH'_cppsym.h' >$tHdrH'_cppsym.real'
20396 if [ -s $tHdrH'_cppsym.real' ]; then
20397 cat $tHdrH'_cppsym.real' Cppsym.know | sort | uniq | ./Cppsym | sort | uniq > Cppsym.true
20400 rm -f $tHdrH'.h' $tHdrH'_cppsym.h' $tHdrH'_cppsym.real'
20403 : now check the C compiler for additional symbols
20404 postprocess_cc_v=''
20406 aix) postprocess_cc_v="|$tr , ' '" ;;
20413 for i in \`$cc -v -c tmp.c 2>&1 $postprocess_cc_v\`
20416 -D*) echo "\$i" | $sed 's/^-D//';;
20417 -A*) $test "$gccversion" && echo "\$i" | $sed 's/^-A//' | $sed 's/\(.*\)(\(.*\))/\1=\2/';;
20422 postprocess_cc_v=''
20425 ./ccsym > ccsym1.raw
20426 if $test -s ccsym1.raw; then
20427 $sort ccsym1.raw | $uniq >ccsym.raw
20429 mv ccsym1.raw ccsym.raw
20432 $awk '/\=/ { print $0; next }
20433 { print $0"=1" }' ccsym.raw >ccsym.list
20434 $comm -13 Cppsym.true ccsym.list >ccsym.own
20435 $comm -12 Cppsym.true ccsym.list >ccsym.com
20436 $comm -23 Cppsym.true ccsym.list >ccsym.cpp
20438 if $test -z ccsym.raw; then
20439 echo "Your C compiler doesn't seem to define any symbols!" >&4
20441 echo "However, your C preprocessor defines the following symbols:"
20444 cppsymbols=`$cat Cppsym.true`
20445 cppsymbols=`echo $cppsymbols`
20446 cppccsymbols="$cppsymbols"
20448 if $test -s ccsym.com; then
20449 echo "Your C compiler and pre-processor define these symbols:"
20450 $sed -e 's/\(..*\)=.*/\1/' ccsym.com
20453 cppccsymbols=`$cat ccsym.com`
20454 cppccsymbols=`echo $cppccsymbols`
20455 $test "$silent" || sleep 1
20457 if $test -s ccsym.cpp; then
20458 $test "$also" && echo " "
20459 echo "Your C pre-processor ${also}defines the following symbols:"
20460 $sed -e 's/\(..*\)=.*/\1/' ccsym.cpp
20462 cppsymbols=`$cat ccsym.cpp`
20463 cppsymbols=`echo $cppsymbols`
20464 $test "$silent" || sleep 1
20466 if $test -s ccsym.own; then
20467 $test "$also" && echo " "
20468 echo "Your C compiler ${also}defines the following cpp symbols:"
20469 $sed -e 's/\(..*\)=1/\1/' ccsym.own
20470 $sed -e 's/\(..*\)=.*/\1/' ccsym.own | $uniq >>Cppsym.true
20471 ccsymbols=`$cat ccsym.own`
20472 ccsymbols=`echo $ccsymbols`
20473 $test "$silent" || sleep 1
20477 : see if this is a termio system
20481 if $test `./findhdr termios.h`; then
20482 set tcsetattr i_termios
20488 "$define") echo "You have POSIX termios.h... good!" >&4;;
20489 *) if ./Cppsym pyr; then
20490 case "`/bin/universe`" in
20491 ucb) if $test `./findhdr sgtty.h`; then
20493 echo "<sgtty.h> found." >&4
20495 echo "System is pyramid with BSD universe."
20496 echo "<sgtty.h> not found--you could have problems." >&4
20498 *) if $test `./findhdr termio.h`; then
20500 echo "<termio.h> found." >&4
20502 echo "System is pyramid with USG universe."
20503 echo "<termio.h> not found--you could have problems." >&4
20507 if $test `./findhdr termio.h`; then
20508 echo "<termio.h> found." >&4
20510 elif $test `./findhdr sgtty.h`; then
20511 echo "<sgtty.h> found." >&4
20514 echo "Neither <termio.h> nor <sgtty.h> found--you could have problems." >&4
20517 if $test `./findhdr sgtty.h`; then
20518 echo "<sgtty.h> found." >&4
20520 elif $test `./findhdr termio.h`; then
20521 echo "<termio.h> found." >&4
20524 echo "Neither <sgtty.h> nor <termio.h> found--you could have problems." >&4
20528 set i_termio; eval $setvar
20529 val=$val2; set i_sgtty; eval $setvar
20530 val=$val3; set i_termios; eval $setvar
20532 : see if stddef is available
20533 set stddef.h i_stddef
20536 : see if this is a sunmath.h system
20537 set sunmath.h i_sunmath
20540 : see if sys/access.h is available
20541 set sys/access.h i_sysaccess
20544 : see if ioctl defs are in sgtty, termio, sys/filio or sys/ioctl
20545 set sys/filio.h i_sysfilio
20548 if $test `./findhdr sys/ioctl.h`; then
20550 echo '<sys/ioctl.h> found.' >&4
20553 if $test $i_sysfilio = "$define"; then
20554 echo '<sys/ioctl.h> NOT found.' >&4
20556 $test $i_sgtty = "$define" && xxx="sgtty.h"
20557 $test $i_termio = "$define" && xxx="termio.h"
20558 $test $i_termios = "$define" && xxx="termios.h"
20559 echo "No <sys/ioctl.h> found, assuming ioctl args are defined in <$xxx>." >&4
20565 : see if socket ioctl defs are in sys/sockio.h
20567 xxx=`./findhdr sys/sockio.h`
20568 if $test "$xxx"; then
20569 if $contains SIOCATMARK $xxx >/dev/null 2>&1; then
20571 echo "You have socket ioctls defined in <sys/sockio.h>." >&4
20574 echo "No socket ioctls found in <sys/sockio.h>." >&4
20579 <sys/sockio.h> not found, assuming socket ioctls are in <sys/ioctl.h>.
20586 : see if this is a syslog.h system
20587 set syslog.h i_syslog
20591 : see if this is a sys/mode.h system
20592 set sys/mode.h i_sysmode
20595 : see if sys/resource.h has to be included
20596 set sys/resource.h i_sysresrc
20599 : see if sys/security.h is available
20600 set sys/security.h i_syssecrt
20603 : see if this is a sys/statvfs.h system
20604 set sys/statvfs.h i_sysstatvfs
20607 : see if this is a sys/un.h system
20608 set sys/un.h i_sysun
20612 : see if this is a sys/utsname.h system
20613 set sys/utsname.h i_sysutsname
20616 : see if this is a syswait system
20617 set sys/wait.h i_syswait
20620 : see if this is a ustat.h system
20621 set ustat.h i_ustat
20624 : see if this is an utime system
20625 set utime.h i_utime
20628 : see if this is a values.h system
20629 set values.h i_values
20632 : see if this is a vfork system
20635 set vfork.h i_vfork
20643 : see if gdbm.h is available
20648 : see if gdbm_open exists
20649 set gdbm_open d_gdbm_open
20651 case "$d_gdbm_open" in
20654 echo "We won't be including <gdbm.h>"
20664 echo "Looking for extensions..." >&4
20665 : If we are using the old config.sh, known_extensions may contain
20666 : old or inaccurate or duplicate values.
20667 known_extensions=''
20668 nonxs_extensions=''
20669 : We do not use find because it might not be available.
20670 : We do not just use MANIFEST because the user may have dropped
20671 : some additional extensions into the source tree and expect them
20674 : Function to recursively find available extensions, ignoring DynaLoader
20675 : NOTE: recursion limit of 10 to prevent runaway in case of symlink madness
20679 DynaLoader|dynaload) ;;
20681 if $test -f $xxx/$xxx.xs; then
20682 known_extensions="$known_extensions $1$xxx";
20683 elif $test -f $xxx/Makefile.PL; then
20684 nonxs_extensions="$nonxs_extensions $1$xxx";
20686 if $test -d $xxx -a $# -lt 10; then
20689 eval $find_extensions;
20701 eval $find_extensions
20702 # Special case: Add in threads/shared since it is not picked up by the
20703 # recursive find above (and adding in general recursive finding breaks
20704 # SDBM_File/sdbm). A.D. 10/25/2001.
20705 known_extensions="$known_extensions threads/shared"
20706 set X $nonxs_extensions
20708 nonxs_extensions="$*"
20709 set X $known_extensions
20711 known_extensions="$*"
20714 : Now see which are supported on this system.
20716 for xxx in $known_extensions ; do
20720 $define) avail_ext="$avail_ext $xxx" ;;
20723 GDBM_File|gdbm_fil)
20725 $define) avail_ext="$avail_ext $xxx" ;;
20728 I18N/Langinfo|i18n_lan)
20729 case "$i_langinfo$d_nl_langinfo" in
20730 $define$define) avail_ext="$avail_ext $xxx" ;;
20733 NDBM_File|ndbm_fil)
20736 case "$osname-$use64bitint" in
20739 *-lndbm*) avail_ext="$avail_ext $xxx" ;;
20742 *) avail_ext="$avail_ext $xxx" ;;
20747 ODBM_File|odbm_fil)
20748 case "${i_dbm}${i_rpcsvcdbm}" in
20750 case "$osname-$use64bitint" in
20753 *-ldbm*) avail_ext="$avail_ext $xxx" ;;
20756 *) avail_ext="$avail_ext $xxx" ;;
20762 case "$useposix" in
20763 true|define|y) avail_ext="$avail_ext $xxx" ;;
20767 case "$useopcode" in
20768 true|define|y) avail_ext="$avail_ext $xxx" ;;
20772 case "$d_socket" in
20775 beos) ;; # not unless BONE
20776 *) avail_ext="$avail_ext $xxx" ;;
20781 Sys/Syslog|sys/syslog)
20782 : XXX syslog requires socket
20783 case "$d_socket" in
20784 true|$define|y) avail_ext="$avail_ext $xxx" ;;
20788 case "$usethreads" in
20790 case "$useithreads" in
20791 $undef|false|[nN]*) avail_ext="$avail_ext $xxx" ;;
20795 XS/APItest|xs/apitest)
20796 # This is just for testing. Skip it unless we have dynamic loading.
20799 $define) avail_ext="$avail_ext $xxx" ;;
20802 XS/Typemap|xs/typemap)
20803 # This is just for testing. Skip it unless we have dynamic loading.
20805 $define) avail_ext="$avail_ext $xxx" ;;
20808 threads|threads/shared)
20809 # threads and threads::shared are special cases.
20810 # To stop people from asking "Perl 5.8.0 was supposed
20811 # to have this new fancy threads implementation but my
20812 # perl doesn't have it" and from people trying to
20813 # (re)install the threads module using CPAN.pm and
20814 # CPAN.pm then offering to reinstall Perl 5.8.0,
20815 # the threads.pm and threads/shared.pm will always be
20816 # there, croaking informatively ("you need to rebuild
20817 # all of Perl with threads, sorry") when threads haven't
20818 # been compiled in.
20820 avail_ext="$avail_ext $xxx"
20823 : XXX Do we need a useipcsysv variable here
20824 case "${d_msg}${d_sem}${d_shm}" in
20825 *"${define}"*) avail_ext="$avail_ext $xxx" ;;
20828 *) avail_ext="$avail_ext $xxx"
20837 case "$onlyextensions" in
20839 *) keepextensions=''
20840 echo "You have requested that only certains extensions be included..." >&4
20841 for i in $onlyextensions; do
20842 case " $avail_ext " in
20844 echo "Keeping extension $i."
20845 keepextensions="$keepextensions $i"
20847 *) echo "Ignoring extension $i." ;;
20850 avail_ext="$keepextensions"
20854 case "$noextensions" in
20856 *) keepextensions=''
20857 echo "You have requested that certain extensions be ignored..." >&4
20858 for i in $avail_ext; do
20859 case " $noextensions " in
20860 *" $i "*) echo "Ignoring extension $i." ;;
20861 *) echo "Keeping extension $i.";
20862 keepextensions="$keepextensions $i"
20866 avail_ext="$keepextensions"
20870 : Now see which nonxs extensions are supported on this system.
20871 : For now assume all are.
20873 for xxx in $nonxs_extensions ; do
20875 *) nonxs_ext="$nonxs_ext $xxx"
20887 A number of extensions are supplied with $package. You may choose to
20888 compile these extensions for dynamic loading (the default), compile
20889 them into the $package executable (static loading), or not include
20890 them at all. Answer "none" to include no extensions.
20891 Note that DynaLoader is always built and need not be mentioned here.
20894 case "$dynamic_ext" in
20896 : Exclude those listed in static_ext
20898 for xxx in $avail_ext; do
20899 case " $static_ext " in
20901 *) dflt="$dflt $xxx" ;;
20908 *) dflt="$dynamic_ext"
20909 # Perhaps we are reusing an old out-of-date config.sh.
20912 if test X"$dynamic_ext" != X"$avail_ext"; then
20914 NOTICE: Your previous config.sh list may be incorrect.
20915 The extensions now available to you are
20917 but the default list from your previous config.sh is
20929 rp="What extensions do you wish to load dynamically?"
20932 none) dynamic_ext=' ' ;;
20933 *) dynamic_ext="$ans" ;;
20936 case "$static_ext" in
20938 : Exclude those already listed in dynamic linking
20940 for xxx in $avail_ext; do
20941 case " $dynamic_ext " in
20943 *) dflt="$dflt $xxx" ;;
20950 *) dflt="$static_ext"
20957 rp="What extensions do you wish to load statically?"
20960 none) static_ext=' ' ;;
20961 *) static_ext="$ans" ;;
20966 A number of extensions are supplied with $package. Answer "none"
20967 to include no extensions.
20968 Note that DynaLoader is always built and need not be mentioned here.
20971 case "$static_ext" in
20972 '') dflt="$avail_ext" ;;
20973 *) dflt="$static_ext"
20974 # Perhaps we are reusing an old out-of-date config.sh.
20977 if test X"$static_ext" != X"$avail_ext"; then
20979 NOTICE: Your previous config.sh list may be incorrect.
20980 The extensions now available to you are
20982 but the default list from your previous config.sh is
20991 : Exclude those that are not xs extensions
20995 rp="What extensions do you wish to include?"
20998 none) static_ext=' ' ;;
20999 *) static_ext="$ans" ;;
21004 # Encode is a special case. If we are building Encode as a static
21005 # extension, we need to explicitly list its subextensions as well.
21006 # For other nested extensions, this is handled automatically by
21007 # the appropriate Makefile.PL.
21008 case " $static_ext " in
21009 *" Encode "*) # Add the subextensions of Encode
21011 for xxx in `ls Encode/*/Makefile.PL|awk -F/ '{print $2}'`; do
21012 static_ext="$static_ext Encode/$xxx"
21018 set X $dynamic_ext $static_ext $nonxs_ext
21022 # Sanity check: We require an extension suitable for use with
21023 # AnyDBM_File, as well as Fcntl and IO. (Failure to have these
21024 # should show up as failures in the test suite, but it's helpful to
21025 # catch them now.) The 'extensions' list is normally sorted
21026 # alphabetically, so we need to accept either
21027 # DB_File ... Fcntl ... IO ....
21028 # or something like
21029 # Fcntl ... NDBM_File ... IO ....
21030 case " $extensions" in
21031 *"_File "*" Fcntl "*" IO "*) ;; # DB_File
21032 *" Fcntl "*"_File "*" IO "*) ;; # GDBM_File
21033 *" Fcntl "*" IO "*"_File "*) ;; # NDBM_File
21034 *) echo "WARNING: Extensions DB_File or *DBM_File, Fcntl, and IO not configured." >&4
21035 echo "WARNING: The Perl you are building will be quite crippled." >& 4
21039 : Remove libraries needed only for extensions
21040 : The appropriate ext/Foo/Makefile.PL will add them back in, if necessary.
21041 : The exception is SunOS 4.x, which needs them.
21042 case "${osname}X${osvers}" in
21046 *) case "$usedl" in
21047 $define|true|[yY]*)
21048 set X `echo " $libs " | sed -e 's@ -lndbm @ @' -e 's@ -lgdbm @ @' -e 's@ -ldbm @ @' -e 's@ -ldb @ @'`
21052 *) perllibs="$libs"
21058 : Remove build directory name from cppstdin so it can be used from
21059 : either the present location or the final installed location.
21061 : Get out of the UU directory to get correct path name.
21063 case "$cppstdin" in
21065 echo "Stripping down cppstdin path name"
21071 : end of configuration questions
21073 echo "End of configuration questions."
21076 : back to where it started
21077 if test -d ../UU; then
21081 : configuration may be patched via a 'config.arch' file
21082 if $test -f config.arch; then
21083 echo "I see a config.arch file, loading it."
21087 : configuration may be patched via a 'config.over' file
21088 if $test -f config.over; then
21091 rp='I see a config.over file. Do you wish to load it?'
21094 n*) echo "OK, I'll ignore it.";;
21096 echo "Configuration override changes have been loaded."
21101 : in case they want portability, strip down executable paths
21102 case "$d_portable" in
21105 echo "Stripping down executable paths..." >&4
21106 for file in $loclist $trylist; do
21108 eval $file=`basename $temp`
21113 : create config.sh file
21115 echo "Creating config.sh..." >&4
21116 $spitshell <<EOT >config.sh
21119 # This file was produced by running the Configure script. It holds all the
21120 # definitions figured out by Configure. Should you modify one of these values,
21121 # do not forget to propagate your changes by running "Configure -der". You may
21122 # instead choose to run each of the .SH files by yourself, or "Configure -S".
21125 # Package name : $package
21126 # Source directory : $src
21127 # Configuration time: $cf_time
21128 # Configured by : $cf_by
21129 # Target system : $myuname
21139 Revision='$Revision'
21147 alignbytes='$alignbytes'
21148 ansi2knr='$ansi2knr'
21149 aphostname='$aphostname'
21150 api_revision='$api_revision'
21151 api_subversion='$api_subversion'
21152 api_version='$api_version'
21153 api_versionstring='$api_versionstring'
21156 archlibexp='$archlibexp'
21157 archname64='$archname64'
21158 archname='$archname'
21159 archobjs='$archobjs'
21160 asctime_r_proto='$asctime_r_proto'
21168 byteorder='$byteorder'
21170 castflags='$castflags'
21173 cccdlflags='$cccdlflags'
21174 ccdlflags='$ccdlflags'
21176 ccflags_uselargefiles='$ccflags_uselargefiles'
21178 ccsymbols='$ccsymbols'
21179 ccversion='$ccversion'
21181 cf_email='$cf_email'
21183 charsize='$charsize'
21187 clocktype='$clocktype'
21189 compress='$compress'
21190 contains='$contains'
21194 cpp_stuff='$cpp_stuff'
21195 cppccsymbols='$cppccsymbols'
21196 cppflags='$cppflags'
21198 cppminus='$cppminus'
21200 cppstdin='$cppstdin'
21201 cppsymbols='$cppsymbols'
21202 crypt_r_proto='$crypt_r_proto'
21203 cryptlib='$cryptlib'
21205 ctermid_r_proto='$ctermid_r_proto'
21206 ctime_r_proto='$ctime_r_proto'
21207 d_Gconvert='$d_Gconvert'
21208 d_PRIEUldbl='$d_PRIEUldbl'
21209 d_PRIFUldbl='$d_PRIFUldbl'
21210 d_PRIGUldbl='$d_PRIGUldbl'
21211 d_PRIXU64='$d_PRIXU64'
21212 d_PRId64='$d_PRId64'
21213 d_PRIeldbl='$d_PRIeldbl'
21214 d_PRIfldbl='$d_PRIfldbl'
21215 d_PRIgldbl='$d_PRIgldbl'
21216 d_PRIi64='$d_PRIi64'
21217 d_PRIo64='$d_PRIo64'
21218 d_PRIu64='$d_PRIu64'
21219 d_PRIx64='$d_PRIx64'
21220 d_SCNfldbl='$d_SCNfldbl'
21221 d__fwalk='$d__fwalk'
21222 d_access='$d_access'
21223 d_accessx='$d_accessx'
21226 d_archlib='$d_archlib'
21227 d_asctime_r='$d_asctime_r'
21230 d_attribute_format='$d_attribute_format'
21231 d_attribute_malloc='$d_attribute_malloc'
21232 d_attribute_nonnull='$d_attribute_nonnull'
21233 d_attribute_noreturn='$d_attribute_noreturn'
21234 d_attribute_pure='$d_attribute_pure'
21235 d_attribute_unused='$d_attribute_unused'
21236 d_attribute_warn_unused_result='$d_attribute_warn_unused_result'
21240 d_bsdgetpgrp='$d_bsdgetpgrp'
21241 d_bsdsetpgrp='$d_bsdsetpgrp'
21242 d_builtin_choose_expr='$d_builtin_choose_expr'
21243 d_builtin_expect='$d_builtin_expect'
21245 d_casti32='$d_casti32'
21246 d_castneg='$d_castneg'
21247 d_charvspr='$d_charvspr'
21249 d_chroot='$d_chroot'
21250 d_chsize='$d_chsize'
21252 d_clearenv='$d_clearenv'
21253 d_closedir='$d_closedir'
21254 d_cmsghdr_s='$d_cmsghdr_s'
21256 d_copysignl='$d_copysignl'
21258 d_crypt_r='$d_crypt_r'
21260 d_ctermid_r='$d_ctermid_r'
21261 d_ctime_r='$d_ctime_r'
21262 d_cuserid='$d_cuserid'
21263 d_dbl_dig='$d_dbl_dig'
21264 d_dbminitproto='$d_dbminitproto'
21265 d_difftime='$d_difftime'
21267 d_dirnamlen='$d_dirnamlen'
21268 d_dlerror='$d_dlerror'
21269 d_dlopen='$d_dlopen'
21270 d_dlsymun='$d_dlsymun'
21271 d_dosuid='$d_dosuid'
21272 d_drand48_r='$d_drand48_r'
21273 d_drand48proto='$d_drand48proto'
21275 d_eaccess='$d_eaccess'
21276 d_endgrent='$d_endgrent'
21277 d_endgrent_r='$d_endgrent_r'
21278 d_endhent='$d_endhent'
21279 d_endhostent_r='$d_endhostent_r'
21280 d_endnent='$d_endnent'
21281 d_endnetent_r='$d_endnetent_r'
21282 d_endpent='$d_endpent'
21283 d_endprotoent_r='$d_endprotoent_r'
21284 d_endpwent='$d_endpwent'
21285 d_endpwent_r='$d_endpwent_r'
21286 d_endsent='$d_endsent'
21287 d_endservent_r='$d_endservent_r'
21288 d_eofnblk='$d_eofnblk'
21289 d_eunice='$d_eunice'
21290 d_faststdio='$d_faststdio'
21291 d_fchdir='$d_fchdir'
21292 d_fchmod='$d_fchmod'
21293 d_fchown='$d_fchown'
21295 d_fcntl_can_lock='$d_fcntl_can_lock'
21296 d_fd_macros='$d_fd_macros'
21297 d_fd_set='$d_fd_set'
21298 d_fds_bits='$d_fds_bits'
21299 d_fgetpos='$d_fgetpos'
21300 d_finite='$d_finite'
21301 d_finitel='$d_finitel'
21302 d_flexfnam='$d_flexfnam'
21304 d_flockproto='$d_flockproto'
21306 d_fp_class='$d_fp_class'
21307 d_fpathconf='$d_fpathconf'
21308 d_fpclass='$d_fpclass'
21309 d_fpclassify='$d_fpclassify'
21310 d_fpclassl='$d_fpclassl'
21311 d_fpos64_t='$d_fpos64_t'
21312 d_frexpl='$d_frexpl'
21313 d_fs_data_s='$d_fs_data_s'
21314 d_fseeko='$d_fseeko'
21315 d_fsetpos='$d_fsetpos'
21316 d_fstatfs='$d_fstatfs'
21317 d_fstatvfs='$d_fstatvfs'
21319 d_ftello='$d_ftello'
21321 d_futimes='$d_futimes'
21322 d_getcwd='$d_getcwd'
21323 d_getespwnam='$d_getespwnam'
21324 d_getfsstat='$d_getfsstat'
21325 d_getgrent='$d_getgrent'
21326 d_getgrent_r='$d_getgrent_r'
21327 d_getgrgid_r='$d_getgrgid_r'
21328 d_getgrnam_r='$d_getgrnam_r'
21329 d_getgrps='$d_getgrps'
21330 d_gethbyaddr='$d_gethbyaddr'
21331 d_gethbyname='$d_gethbyname'
21332 d_gethent='$d_gethent'
21333 d_gethname='$d_gethname'
21334 d_gethostbyaddr_r='$d_gethostbyaddr_r'
21335 d_gethostbyname_r='$d_gethostbyname_r'
21336 d_gethostent_r='$d_gethostent_r'
21337 d_gethostprotos='$d_gethostprotos'
21338 d_getitimer='$d_getitimer'
21339 d_getlogin='$d_getlogin'
21340 d_getlogin_r='$d_getlogin_r'
21341 d_getmnt='$d_getmnt'
21342 d_getmntent='$d_getmntent'
21343 d_getnbyaddr='$d_getnbyaddr'
21344 d_getnbyname='$d_getnbyname'
21345 d_getnent='$d_getnent'
21346 d_getnetbyaddr_r='$d_getnetbyaddr_r'
21347 d_getnetbyname_r='$d_getnetbyname_r'
21348 d_getnetent_r='$d_getnetent_r'
21349 d_getnetprotos='$d_getnetprotos'
21350 d_getpagsz='$d_getpagsz'
21351 d_getpbyname='$d_getpbyname'
21352 d_getpbynumber='$d_getpbynumber'
21353 d_getpent='$d_getpent'
21354 d_getpgid='$d_getpgid'
21355 d_getpgrp2='$d_getpgrp2'
21356 d_getpgrp='$d_getpgrp'
21357 d_getppid='$d_getppid'
21358 d_getprior='$d_getprior'
21359 d_getprotobyname_r='$d_getprotobyname_r'
21360 d_getprotobynumber_r='$d_getprotobynumber_r'
21361 d_getprotoent_r='$d_getprotoent_r'
21362 d_getprotoprotos='$d_getprotoprotos'
21363 d_getprpwnam='$d_getprpwnam'
21364 d_getpwent='$d_getpwent'
21365 d_getpwent_r='$d_getpwent_r'
21366 d_getpwnam_r='$d_getpwnam_r'
21367 d_getpwuid_r='$d_getpwuid_r'
21368 d_getsbyname='$d_getsbyname'
21369 d_getsbyport='$d_getsbyport'
21370 d_getsent='$d_getsent'
21371 d_getservbyname_r='$d_getservbyname_r'
21372 d_getservbyport_r='$d_getservbyport_r'
21373 d_getservent_r='$d_getservent_r'
21374 d_getservprotos='$d_getservprotos'
21375 d_getspnam='$d_getspnam'
21376 d_getspnam_r='$d_getspnam_r'
21377 d_gettimeod='$d_gettimeod'
21378 d_gmtime_r='$d_gmtime_r'
21379 d_gnulibc='$d_gnulibc'
21380 d_grpasswd='$d_grpasswd'
21381 d_hasmntopt='$d_hasmntopt'
21383 d_ilogbl='$d_ilogbl'
21385 d_inetaton='$d_inetaton'
21386 d_int64_t='$d_int64_t'
21387 d_isascii='$d_isascii'
21388 d_isfinite='$d_isfinite'
21391 d_isnanl='$d_isnanl'
21392 d_killpg='$d_killpg'
21393 d_lchown='$d_lchown'
21394 d_ldbl_dig='$d_ldbl_dig'
21395 d_libm_lib_version='$d_libm_lib_version'
21397 d_localtime_r='$d_localtime_r'
21398 d_locconv='$d_locconv'
21400 d_longdbl='$d_longdbl'
21401 d_longlong='$d_longlong'
21402 d_lseekproto='$d_lseekproto'
21404 d_madvise='$d_madvise'
21405 d_malloc_good_size='$d_malloc_good_size'
21406 d_malloc_size='$d_malloc_size'
21408 d_mbstowcs='$d_mbstowcs'
21409 d_mbtowc='$d_mbtowc'
21410 d_memchr='$d_memchr'
21411 d_memcmp='$d_memcmp'
21412 d_memcpy='$d_memcpy'
21413 d_memmove='$d_memmove'
21414 d_memset='$d_memset'
21416 d_mkdtemp='$d_mkdtemp'
21417 d_mkfifo='$d_mkfifo'
21418 d_mkstemp='$d_mkstemp'
21419 d_mkstemps='$d_mkstemps'
21420 d_mktime='$d_mktime'
21423 d_modfl_pow32_bug='$d_modfl_pow32_bug'
21424 d_modflproto='$d_modflproto'
21425 d_mprotect='$d_mprotect'
21427 d_msg_ctrunc='$d_msg_ctrunc'
21428 d_msg_dontroute='$d_msg_dontroute'
21429 d_msg_oob='$d_msg_oob'
21430 d_msg_peek='$d_msg_peek'
21431 d_msg_proxy='$d_msg_proxy'
21432 d_msgctl='$d_msgctl'
21433 d_msgget='$d_msgget'
21434 d_msghdr_s='$d_msghdr_s'
21435 d_msgrcv='$d_msgrcv'
21436 d_msgsnd='$d_msgsnd'
21438 d_munmap='$d_munmap'
21439 d_mymalloc='$d_mymalloc'
21441 d_nl_langinfo='$d_nl_langinfo'
21442 d_nv_preserves_uv='$d_nv_preserves_uv'
21443 d_nv_zero_is_allbits_zero='$d_nv_zero_is_allbits_zero'
21444 d_off64_t='$d_off64_t'
21445 d_old_pthread_create_joinable='$d_old_pthread_create_joinable'
21446 d_oldpthreads='$d_oldpthreads'
21447 d_oldsock='$d_oldsock'
21449 d_pathconf='$d_pathconf'
21451 d_perl_otherlibdirs='$d_perl_otherlibdirs'
21452 d_phostname='$d_phostname'
21455 d_portable='$d_portable'
21456 d_procselfexe='$d_procselfexe'
21457 d_pthread_atfork='$d_pthread_atfork'
21458 d_pthread_attr_setscope='$d_pthread_attr_setscope'
21459 d_pthread_yield='$d_pthread_yield'
21461 d_pwchange='$d_pwchange'
21462 d_pwclass='$d_pwclass'
21463 d_pwcomment='$d_pwcomment'
21464 d_pwexpire='$d_pwexpire'
21465 d_pwgecos='$d_pwgecos'
21466 d_pwpasswd='$d_pwpasswd'
21467 d_pwquota='$d_pwquota'
21470 d_random_r='$d_random_r'
21471 d_readdir64_r='$d_readdir64_r'
21472 d_readdir='$d_readdir'
21473 d_readdir_r='$d_readdir_r'
21474 d_readlink='$d_readlink'
21476 d_recvmsg='$d_recvmsg'
21477 d_rename='$d_rename'
21478 d_rewinddir='$d_rewinddir'
21480 d_safebcpy='$d_safebcpy'
21481 d_safemcpy='$d_safemcpy'
21482 d_sanemcmp='$d_sanemcmp'
21483 d_sbrkproto='$d_sbrkproto'
21484 d_scalbnl='$d_scalbnl'
21485 d_sched_yield='$d_sched_yield'
21486 d_scm_rights='$d_scm_rights'
21487 d_seekdir='$d_seekdir'
21488 d_select='$d_select'
21490 d_semctl='$d_semctl'
21491 d_semctl_semid_ds='$d_semctl_semid_ds'
21492 d_semctl_semun='$d_semctl_semun'
21493 d_semget='$d_semget'
21495 d_sendmsg='$d_sendmsg'
21496 d_setegid='$d_setegid'
21497 d_seteuid='$d_seteuid'
21498 d_setgrent='$d_setgrent'
21499 d_setgrent_r='$d_setgrent_r'
21500 d_setgrps='$d_setgrps'
21501 d_sethent='$d_sethent'
21502 d_sethostent_r='$d_sethostent_r'
21503 d_setitimer='$d_setitimer'
21504 d_setlinebuf='$d_setlinebuf'
21505 d_setlocale='$d_setlocale'
21506 d_setlocale_r='$d_setlocale_r'
21507 d_setnent='$d_setnent'
21508 d_setnetent_r='$d_setnetent_r'
21509 d_setpent='$d_setpent'
21510 d_setpgid='$d_setpgid'
21511 d_setpgrp2='$d_setpgrp2'
21512 d_setpgrp='$d_setpgrp'
21513 d_setprior='$d_setprior'
21514 d_setproctitle='$d_setproctitle'
21515 d_setprotoent_r='$d_setprotoent_r'
21516 d_setpwent='$d_setpwent'
21517 d_setpwent_r='$d_setpwent_r'
21518 d_setregid='$d_setregid'
21519 d_setresgid='$d_setresgid'
21520 d_setresuid='$d_setresuid'
21521 d_setreuid='$d_setreuid'
21522 d_setrgid='$d_setrgid'
21523 d_setruid='$d_setruid'
21524 d_setsent='$d_setsent'
21525 d_setservent_r='$d_setservent_r'
21526 d_setsid='$d_setsid'
21527 d_setvbuf='$d_setvbuf'
21531 d_shmatprototype='$d_shmatprototype'
21532 d_shmctl='$d_shmctl'
21534 d_shmget='$d_shmget'
21535 d_sigaction='$d_sigaction'
21536 d_sigprocmask='$d_sigprocmask'
21537 d_sigsetjmp='$d_sigsetjmp'
21538 d_snprintf='$d_snprintf'
21539 d_sockatmark='$d_sockatmark'
21540 d_sockatmarkproto='$d_sockatmarkproto'
21541 d_socket='$d_socket'
21542 d_socklen_t='$d_socklen_t'
21543 d_sockpair='$d_sockpair'
21544 d_socks5_init='$d_socks5_init'
21545 d_sprintf_returns_strlen='$d_sprintf_returns_strlen'
21547 d_srand48_r='$d_srand48_r'
21548 d_srandom_r='$d_srandom_r'
21549 d_sresgproto='$d_sresgproto'
21550 d_sresuproto='$d_sresuproto'
21551 d_statblks='$d_statblks'
21552 d_statfs_f_flags='$d_statfs_f_flags'
21553 d_statfs_s='$d_statfs_s'
21554 d_statvfs='$d_statvfs'
21555 d_stdio_cnt_lval='$d_stdio_cnt_lval'
21556 d_stdio_ptr_lval='$d_stdio_ptr_lval'
21557 d_stdio_ptr_lval_nochange_cnt='$d_stdio_ptr_lval_nochange_cnt'
21558 d_stdio_ptr_lval_sets_cnt='$d_stdio_ptr_lval_sets_cnt'
21559 d_stdio_stream_array='$d_stdio_stream_array'
21560 d_stdiobase='$d_stdiobase'
21561 d_stdstdio='$d_stdstdio'
21562 d_strchr='$d_strchr'
21563 d_strcoll='$d_strcoll'
21564 d_strctcpy='$d_strctcpy'
21565 d_strerrm='$d_strerrm'
21566 d_strerror='$d_strerror'
21567 d_strerror_r='$d_strerror_r'
21568 d_strftime='$d_strftime'
21569 d_strlcat='$d_strlcat'
21570 d_strlcpy='$d_strlcpy'
21571 d_strtod='$d_strtod'
21572 d_strtol='$d_strtol'
21573 d_strtold='$d_strtold'
21574 d_strtoll='$d_strtoll'
21575 d_strtoq='$d_strtoq'
21576 d_strtoul='$d_strtoul'
21577 d_strtoull='$d_strtoull'
21578 d_strtouq='$d_strtouq'
21579 d_strxfrm='$d_strxfrm'
21580 d_suidsafe='$d_suidsafe'
21581 d_symlink='$d_symlink'
21582 d_syscall='$d_syscall'
21583 d_syscallproto='$d_syscallproto'
21584 d_sysconf='$d_sysconf'
21585 d_sysernlst='$d_sysernlst'
21586 d_syserrlst='$d_syserrlst'
21587 d_system='$d_system'
21588 d_tcgetpgrp='$d_tcgetpgrp'
21589 d_tcsetpgrp='$d_tcsetpgrp'
21590 d_telldir='$d_telldir'
21591 d_telldirproto='$d_telldirproto'
21594 d_tm_tm_gmtoff='$d_tm_tm_gmtoff'
21595 d_tm_tm_zone='$d_tm_tm_zone'
21596 d_tmpnam_r='$d_tmpnam_r'
21597 d_truncate='$d_truncate'
21598 d_ttyname_r='$d_ttyname_r'
21599 d_tzname='$d_tzname'
21600 d_u32align='$d_u32align'
21601 d_ualarm='$d_ualarm'
21604 d_union_semun='$d_union_semun'
21605 d_unordered='$d_unordered'
21606 d_unsetenv='$d_unsetenv'
21607 d_usleep='$d_usleep'
21608 d_usleepproto='$d_usleepproto'
21610 d_vendorarch='$d_vendorarch'
21611 d_vendorbin='$d_vendorbin'
21612 d_vendorlib='$d_vendorlib'
21613 d_vendorscript='$d_vendorscript'
21615 d_void_closedir='$d_void_closedir'
21616 d_voidsig='$d_voidsig'
21617 d_voidtty='$d_voidtty'
21618 d_volatile='$d_volatile'
21619 d_vprintf='$d_vprintf'
21620 d_vsnprintf='$d_vsnprintf'
21622 d_waitpid='$d_waitpid'
21623 d_wcstombs='$d_wcstombs'
21624 d_wctomb='$d_wctomb'
21625 d_writev='$d_writev'
21628 db_hashtype='$db_hashtype'
21629 db_prefixtype='$db_prefixtype'
21630 db_version_major='$db_version_major'
21631 db_version_minor='$db_version_minor'
21632 db_version_patch='$db_version_patch'
21633 defvoidused='$defvoidused'
21634 direntrytype='$direntrytype'
21637 doublesize='$doublesize'
21639 drand48_r_proto='$drand48_r_proto'
21640 dynamic_ext='$dynamic_ext'
21646 endgrent_r_proto='$endgrent_r_proto'
21647 endhostent_r_proto='$endhostent_r_proto'
21648 endnetent_r_proto='$endnetent_r_proto'
21649 endprotoent_r_proto='$endprotoent_r_proto'
21650 endpwent_r_proto='$endpwent_r_proto'
21651 endservent_r_proto='$endservent_r_proto'
21652 eunicefix='$eunicefix'
21655 extensions='$extensions'
21657 fflushNULL='$fflushNULL'
21658 fflushall='$fflushall'
21660 firstmakefile='$firstmakefile'
21662 fpossize='$fpossize'
21663 fpostype='$fpostype'
21664 freetype='$freetype'
21667 full_csh='$full_csh'
21668 full_sed='$full_sed'
21669 gccansipedantic='$gccansipedantic'
21670 gccosandvers='$gccosandvers'
21671 gccversion='$gccversion'
21672 getgrent_r_proto='$getgrent_r_proto'
21673 getgrgid_r_proto='$getgrgid_r_proto'
21674 getgrnam_r_proto='$getgrnam_r_proto'
21675 gethostbyaddr_r_proto='$gethostbyaddr_r_proto'
21676 gethostbyname_r_proto='$gethostbyname_r_proto'
21677 gethostent_r_proto='$gethostent_r_proto'
21678 getlogin_r_proto='$getlogin_r_proto'
21679 getnetbyaddr_r_proto='$getnetbyaddr_r_proto'
21680 getnetbyname_r_proto='$getnetbyname_r_proto'
21681 getnetent_r_proto='$getnetent_r_proto'
21682 getprotobyname_r_proto='$getprotobyname_r_proto'
21683 getprotobynumber_r_proto='$getprotobynumber_r_proto'
21684 getprotoent_r_proto='$getprotoent_r_proto'
21685 getpwent_r_proto='$getpwent_r_proto'
21686 getpwnam_r_proto='$getpwnam_r_proto'
21687 getpwuid_r_proto='$getpwuid_r_proto'
21688 getservbyname_r_proto='$getservbyname_r_proto'
21689 getservbyport_r_proto='$getservbyport_r_proto'
21690 getservent_r_proto='$getservent_r_proto'
21691 getspnam_r_proto='$getspnam_r_proto'
21692 gidformat='$gidformat'
21698 gmtime_r_proto='$gmtime_r_proto'
21699 gnulibc_version='$gnulibc_version'
21701 groupcat='$groupcat'
21702 groupstype='$groupstype'
21705 h_sysfile='$h_sysfile'
21708 html1dir='$html1dir'
21709 html1direxp='$html1direxp'
21710 html3dir='$html3dir'
21711 html3direxp='$html3direxp'
21720 i_arpainet='$i_arpainet'
21721 i_bsdioctl='$i_bsdioctl'
21725 i_dirent='$i_dirent'
21731 i_fp_class='$i_fp_class'
21734 i_ieeefp='$i_ieeefp'
21735 i_inttypes='$i_inttypes'
21736 i_langinfo='$i_langinfo'
21737 i_libutil='$i_libutil'
21738 i_limits='$i_limits'
21739 i_locale='$i_locale'
21740 i_machcthr='$i_machcthr'
21741 i_malloc='$i_malloc'
21743 i_memory='$i_memory'
21744 i_mntent='$i_mntent'
21747 i_neterrno='$i_neterrno'
21748 i_netinettcp='$i_netinettcp'
21752 i_pthread='$i_pthread'
21754 i_rpcsvcdbm='$i_rpcsvcdbm'
21757 i_shadow='$i_shadow'
21759 i_stdarg='$i_stdarg'
21760 i_stddef='$i_stddef'
21761 i_stdlib='$i_stdlib'
21762 i_string='$i_string'
21763 i_sunmath='$i_sunmath'
21764 i_sysaccess='$i_sysaccess'
21765 i_sysdir='$i_sysdir'
21766 i_sysfile='$i_sysfile'
21767 i_sysfilio='$i_sysfilio'
21769 i_sysioctl='$i_sysioctl'
21770 i_syslog='$i_syslog'
21771 i_sysmman='$i_sysmman'
21772 i_sysmode='$i_sysmode'
21773 i_sysmount='$i_sysmount'
21774 i_sysndir='$i_sysndir'
21775 i_sysparam='$i_sysparam'
21776 i_sysresrc='$i_sysresrc'
21777 i_syssecrt='$i_syssecrt'
21778 i_sysselct='$i_sysselct'
21779 i_syssockio='$i_syssockio'
21780 i_sysstat='$i_sysstat'
21781 i_sysstatfs='$i_sysstatfs'
21782 i_sysstatvfs='$i_sysstatvfs'
21783 i_systime='$i_systime'
21784 i_systimek='$i_systimek'
21785 i_systimes='$i_systimes'
21786 i_systypes='$i_systypes'
21787 i_sysuio='$i_sysuio'
21789 i_sysutsname='$i_sysutsname'
21790 i_sysvfs='$i_sysvfs'
21791 i_syswait='$i_syswait'
21792 i_termio='$i_termio'
21793 i_termios='$i_termios'
21795 i_unistd='$i_unistd'
21798 i_values='$i_values'
21799 i_varargs='$i_varargs'
21800 i_varhdr='$i_varhdr'
21802 ignore_versioned_solibs='$ignore_versioned_solibs'
21803 inc_version_list='$inc_version_list'
21804 inc_version_list_init='$inc_version_list_init'
21807 installarchlib='$installarchlib'
21808 installbin='$installbin'
21809 installhtml1dir='$installhtml1dir'
21810 installhtml3dir='$installhtml3dir'
21811 installman1dir='$installman1dir'
21812 installman3dir='$installman3dir'
21813 installprefix='$installprefix'
21814 installprefixexp='$installprefixexp'
21815 installprivlib='$installprivlib'
21816 installscript='$installscript'
21817 installsitearch='$installsitearch'
21818 installsitebin='$installsitebin'
21819 installsitehtml1dir='$installsitehtml1dir'
21820 installsitehtml3dir='$installsitehtml3dir'
21821 installsitelib='$installsitelib'
21822 installsiteman1dir='$installsiteman1dir'
21823 installsiteman3dir='$installsiteman3dir'
21824 installsitescript='$installsitescript'
21825 installstyle='$installstyle'
21826 installusrbinperl='$installusrbinperl'
21827 installvendorarch='$installvendorarch'
21828 installvendorbin='$installvendorbin'
21829 installvendorhtml1dir='$installvendorhtml1dir'
21830 installvendorhtml3dir='$installvendorhtml3dir'
21831 installvendorlib='$installvendorlib'
21832 installvendorman1dir='$installvendorman1dir'
21833 installvendorman3dir='$installvendorman3dir'
21834 installvendorscript='$installvendorscript'
21836 issymlink='$issymlink'
21837 ivdformat='$ivdformat'
21840 known_extensions='$known_extensions'
21843 lddlflags='$lddlflags'
21845 ldflags_uselargefiles='$ldflags_uselargefiles'
21846 ldlibpthname='$ldlibpthname'
21853 libsdirs='$libsdirs'
21854 libsfiles='$libsfiles'
21855 libsfound='$libsfound'
21856 libspath='$libspath'
21857 libswanted='$libswanted'
21858 libswanted_uselargefiles='$libswanted_uselargefiles'
21864 localtime_r_proto='$localtime_r_proto'
21865 locincpth='$locincpth'
21866 loclibpth='$loclibpth'
21867 longdblsize='$longdblsize'
21868 longlongsize='$longlongsize'
21869 longsize='$longsize'
21873 lseeksize='$lseeksize'
21874 lseektype='$lseektype'
21878 make_set_make='$make_set_make'
21879 mallocobj='$mallocobj'
21880 mallocsrc='$mallocsrc'
21881 malloctype='$malloctype'
21883 man1direxp='$man1direxp'
21886 man3direxp='$man3direxp'
21888 mips_type='$mips_type'
21889 mistrustnm='$mistrustnm'
21891 mmaptype='$mmaptype'
21892 modetype='$modetype'
21894 multiarch='$multiarch'
21896 myarchname='$myarchname'
21897 mydomain='$mydomain'
21898 myhostname='$myhostname'
21901 need_va_copy='$need_va_copy'
21902 netdb_hlen_type='$netdb_hlen_type'
21903 netdb_host_type='$netdb_host_type'
21904 netdb_name_type='$netdb_name_type'
21905 netdb_net_type='$netdb_net_type'
21908 nm_so_opt='$nm_so_opt'
21909 nonxs_ext='$nonxs_ext'
21911 nvEUformat='$nvEUformat'
21912 nvFUformat='$nvFUformat'
21913 nvGUformat='$nvGUformat'
21914 nv_preserves_uv_bits='$nv_preserves_uv_bits'
21915 nveformat='$nveformat'
21916 nvfformat='$nvfformat'
21917 nvgformat='$nvgformat'
21920 o_nonblock='$o_nonblock'
21922 old_pthread_create_joinable='$old_pthread_create_joinable'
21923 optimize='$optimize'
21924 orderlib='$orderlib'
21927 otherlibdirs='$otherlibdirs'
21931 patchlevel='$patchlevel'
21932 path_sep='$path_sep'
21935 perl_patchlevel='$perl_patchlevel'
21936 perladmin='$perladmin'
21937 perllibs='$perllibs'
21938 perlpath='$perlpath'
21940 phostname='$phostname'
21946 prefixexp='$prefixexp'
21948 privlibexp='$privlibexp'
21949 procselfexe='$procselfexe'
21950 prototype='$prototype'
21952 quadkind='$quadkind'
21953 quadtype='$quadtype'
21954 randbits='$randbits'
21955 randfunc='$randfunc'
21956 random_r_proto='$random_r_proto'
21957 randseedtype='$randseedtype'
21959 rd_nodata='$rd_nodata'
21960 readdir64_r_proto='$readdir64_r_proto'
21961 readdir_r_proto='$readdir_r_proto'
21962 revision='$revision'
21967 sPRIEUldbl='$sPRIEUldbl'
21968 sPRIFUldbl='$sPRIFUldbl'
21969 sPRIGUldbl='$sPRIGUldbl'
21970 sPRIXU64='$sPRIXU64'
21972 sPRIeldbl='$sPRIeldbl'
21973 sPRIfldbl='$sPRIfldbl'
21974 sPRIgldbl='$sPRIgldbl'
21979 sSCNfldbl='$sSCNfldbl'
21980 sched_yield='$sched_yield'
21981 scriptdir='$scriptdir'
21982 scriptdirexp='$scriptdirexp'
21984 seedfunc='$seedfunc'
21985 selectminbits='$selectminbits'
21986 selecttype='$selecttype'
21987 sendmail='$sendmail'
21988 setgrent_r_proto='$setgrent_r_proto'
21989 sethostent_r_proto='$sethostent_r_proto'
21990 setlocale_r_proto='$setlocale_r_proto'
21991 setnetent_r_proto='$setnetent_r_proto'
21992 setprotoent_r_proto='$setprotoent_r_proto'
21993 setpwent_r_proto='$setpwent_r_proto'
21994 setservent_r_proto='$setservent_r_proto'
21997 sharpbang='$sharpbang'
21998 shmattype='$shmattype'
21999 shortsize='$shortsize'
22002 sig_count='$sig_count'
22003 sig_name='$sig_name'
22004 sig_name_init='$sig_name_init'
22006 sig_num_init='$sig_num_init'
22007 sig_size='$sig_size'
22008 signal_t='$signal_t'
22009 sitearch='$sitearch'
22010 sitearchexp='$sitearchexp'
22012 sitebinexp='$sitebinexp'
22013 sitehtml1dir='$sitehtml1dir'
22014 sitehtml1direxp='$sitehtml1direxp'
22015 sitehtml3dir='$sitehtml3dir'
22016 sitehtml3direxp='$sitehtml3direxp'
22018 sitelib_stem='$sitelib_stem'
22019 sitelibexp='$sitelibexp'
22020 siteman1dir='$siteman1dir'
22021 siteman1direxp='$siteman1direxp'
22022 siteman3dir='$siteman3dir'
22023 siteman3direxp='$siteman3direxp'
22024 siteprefix='$siteprefix'
22025 siteprefixexp='$siteprefixexp'
22026 sitescript='$sitescript'
22027 sitescriptexp='$sitescriptexp'
22028 sizesize='$sizesize'
22029 sizetype='$sizetype'
22033 sockethdr='$sockethdr'
22034 socketlib='$socketlib'
22035 socksizetype='$socksizetype'
22037 spackage='$spackage'
22038 spitshell='$spitshell'
22039 srand48_r_proto='$srand48_r_proto'
22040 srandom_r_proto='$srandom_r_proto'
22042 ssizetype='$ssizetype'
22043 startperl='$startperl'
22045 static_ext='$static_ext'
22047 stdio_base='$stdio_base'
22048 stdio_bufsiz='$stdio_bufsiz'
22049 stdio_cnt='$stdio_cnt'
22050 stdio_filbuf='$stdio_filbuf'
22051 stdio_ptr='$stdio_ptr'
22052 stdio_stream_array='$stdio_stream_array'
22053 strerror_r_proto='$strerror_r_proto'
22056 subversion='$subversion'
22060 targetarch='$targetarch'
22064 timeincl='$timeincl'
22065 timetype='$timetype'
22066 tmpnam_r_proto='$tmpnam_r_proto'
22072 ttyname_r_proto='$ttyname_r_proto'
22081 uidformat='$uidformat'
22087 uquadtype='$uquadtype'
22088 use5005threads='$use5005threads'
22089 use64bitall='$use64bitall'
22090 use64bitint='$use64bitint'
22091 usecrosscompile='$usecrosscompile'
22093 usefaststdio='$usefaststdio'
22094 useithreads='$useithreads'
22095 uselargefiles='$uselargefiles'
22096 uselongdouble='$uselongdouble'
22097 usemallocwrap='$usemallocwrap'
22098 usemorebits='$usemorebits'
22099 usemultiplicity='$usemultiplicity'
22100 usemymalloc='$usemymalloc'
22102 useopcode='$useopcode'
22103 useperlio='$useperlio'
22104 useposix='$useposix'
22105 usereentrant='$usereentrant'
22106 userelocatableinc='$userelocatableinc'
22108 useshrplib='$useshrplib'
22109 usesitecustomize='$usesitecustomize'
22110 usesocks='$usesocks'
22111 usethreads='$usethreads'
22112 usevendorprefix='$usevendorprefix'
22113 usevfork='$usevfork'
22116 uvXUformat='$uvXUformat'
22117 uvoformat='$uvoformat'
22120 uvuformat='$uvuformat'
22121 uvxformat='$uvxformat'
22122 vendorarch='$vendorarch'
22123 vendorarchexp='$vendorarchexp'
22124 vendorbin='$vendorbin'
22125 vendorbinexp='$vendorbinexp'
22126 vendorhtml1dir='$vendorhtml1dir'
22127 vendorhtml1direxp='$vendorhtml1direxp'
22128 vendorhtml3dir='$vendorhtml3dir'
22129 vendorhtml3direxp='$vendorhtml3direxp'
22130 vendorlib='$vendorlib'
22131 vendorlib_stem='$vendorlib_stem'
22132 vendorlibexp='$vendorlibexp'
22133 vendorman1dir='$vendorman1dir'
22134 vendorman1direxp='$vendorman1direxp'
22135 vendorman3dir='$vendorman3dir'
22136 vendorman3direxp='$vendorman3direxp'
22137 vendorprefix='$vendorprefix'
22138 vendorprefixexp='$vendorprefixexp'
22139 vendorscript='$vendorscript'
22140 vendorscriptexp='$vendorscriptexp'
22142 version_patchlevel_string='$version_patchlevel_string'
22143 versiononly='$versiononly'
22145 voidflags='$voidflags'
22148 yaccflags='$yaccflags'
22153 : Add in command line options if available
22154 $test -f UU/cmdline.opt && $cat UU/cmdline.opt >> config.sh
22156 : add special variables
22157 $test -f $src/patchlevel.h && \
22158 awk '/^#define[ ]+PERL_/ {printf "%s=%s\n",$2,$3}' $src/patchlevel.h >>config.sh
22159 echo "PERL_PATCHLEVEL=$perl_patchlevel" >>config.sh
22160 echo "PERL_CONFIG_SH=true" >>config.sh
22162 : propagate old symbols
22163 if $test -f UU/config.sh; then
22164 <UU/config.sh $sort | $uniq >UU/oldconfig.sh
22165 sed -n 's/^\([a-zA-Z_0-9]*\)=.*/\1/p' config.sh config.sh UU/oldconfig.sh |\
22166 $sort | $uniq -u >UU/oldsyms
22167 set X `cat UU/oldsyms`
22173 Hmm...You had some extra variables I don't know about...I'll try to keep 'em...
22175 echo "# Variables propagated from previous config.sh file." >>config.sh
22176 for sym in `cat UU/oldsyms`; do
22177 echo " Propagating $hint variable "'$'"$sym..."
22178 eval 'tmp="$'"${sym}"'"'
22180 sed -e "s/'/'\"'\"'/g" -e "s/^/$sym='/" -e "s/$/'/" >>config.sh
22186 : Finish up by extracting the .SH files
22190 echo "Extraction done."
22200 If you'd like to make any changes to the config.sh file before I begin
22201 to configure things, do it as a shell escape now (e.g. !vi config.sh).
22204 rp="Press return or use a shell escape to edit config.sh:"
22209 *) : in case they cannot read
22210 sh 1>&4 -c "$ans";;
22215 : if this fails, just run all the .SH files by hand
22224 if $contains '^depend:' [Mm]akefile >/dev/null 2>&1; then
22231 Now you need to generate make dependencies by running "$make depend".
22232 You might prefer to run it in background: "$make depend > makedepend.out &"
22233 It can take a while, so you might not want to run it right now.
22238 rp="Run $make depend now?"
22242 $make depend && echo "Now you must run '$make'."
22245 echo "You must run '$make depend' then '$make'."
22248 elif test -f [Mm]akefile; then
22250 echo "Now you must run a $make."
22252 echo "Configure done."
22255 if $test -f Policy.sh; then
22258 If you compile $package on a different machine or from a different object
22259 directory, copy the Policy.sh file from this object directory to the
22260 new one before you run Configure -- this will help you with most of
22261 the policy defaults.
22265 if $test -f config.msg; then
22266 echo "Hmm. I also noted the following information while running:"
22268 $cat config.msg >&4
22271 $rm -f kit*isdone ark*isdone