3 # If these # comments don't work, trim them. Don't worry about any other
4 # shell scripts, Configure will trim # comments from them for you.
6 # (If you are trying to port this package to a machine without sh,
7 # I would suggest you have a look at the prototypical config_h.SH file
8 # and edit it to reflect your system. Some packages may include samples
9 # of config.h for certain machines, so you might look for one of those.)
11 # Yes, you may rip this off to use in other distribution packages. This
12 # script belongs to the public domain and cannot be copyrighted.
14 # (Note: this Configure script was generated automatically. Rather than
15 # working with this copy of Configure, you may wish to get metaconfig.
16 # The dist-3.0 package (which contains metaconfig) was posted in
17 # comp.sources.misc and is available on CPAN under authors/id/RAM so
18 # you may fetch it yourself from your nearest archive site.)
21 # Though this script was generated by metaconfig, it is OK to send
22 # patches against it. It's up to the Configure pumpkin to backport
23 # the patch to the metaunits if it is accepted.
24 # See Porting/pumpkin.pod for more information on metaconfig.
27 # $Id: Head.U,v 3.0.1.9 1997/02/28 15:02:09 ram Exp $
29 # Generated on Tue Oct 25 01:58:55 CEST 2005 [metaconfig 3.0 PL70]
30 # (with additional metaconfig patches by perlbug@perl.org)
35 SCO csh still thinks true is false. Write to SCO today and tell them that next
36 year Configure ought to "rm /bin/csh" unless they fix their blasted shell. :-)
38 (Actually, Configure ought to just patch csh in place. Hmm. Hmmmmm. All
39 we'd have to do is go in and swap the && and || tokens, wherever they are.)
41 [End of diatribe. We now return you to your regularly scheduled programming...]
45 OOPS! You naughty creature! You didn't run Configure with sh!
46 I will attempt to remedy the situation by running sh for you...
50 true || exec sh $0 $argv:q
52 (exit $?0) || cat c2$$
53 (exit $?0) || exec sh $0 $argv:q
56 if test -f /dev/cputype -a -f /dev/drivers -a -f /dev/osversion; then
59 *** I'm sorry but this system looks like Plan 9 and Plan 9 doesn't do
60 *** Configure that well. (Plan 9 is close to UNIX but not close enough.)
61 *** Please read the README.plan9 for further instructions.
62 *** Cannot continue, aborting.
68 : compute my invocation name
72 me=`echo $0 | sed -e 's!.*/\(.*\)!\1!' 2>/dev/null`
77 : Proper separator for the PATH environment variable
79 : On OS/2 this directory should exist if this is not floppy only system :-]
80 if test -d c:/. || ( uname -a | grep -i 'os\(/\|\)2' ) 2>&1 >/dev/null ; then
81 if test -n "$OS2_SHELL"; then
83 PATH=`cmd /c "echo %PATH%" | tr '\\\\' / `
84 OS2_SHELL=`cmd /c "echo %OS2_SHELL%" | tr '\\\\' / | tr '[A-Z]' '[a-z]'`
86 elif test -n "$DJGPP"; then
87 case "X${MACHTYPE:-nonesuchmach}" in
95 paths='/bin /usr/bin /usr/local/bin /usr/ucb /usr/local /usr/lbin'
96 paths="$paths /opt/bin /opt/local/bin /opt/local /opt/lbin"
97 paths="$paths /usr/5bin /etc /usr/gnu/bin /usr/new /usr/new/bin /usr/nbin"
98 paths="$paths /opt/gnu/bin /opt/new /opt/new/bin /opt/nbin"
99 paths="$paths /sys5.3/bin /sys5.3/usr/bin /bsd4.3/bin /bsd4.3/usr/ucb"
100 paths="$paths /bsd4.3/usr/bin /usr/bsd /bsd43/bin /opt/ansic/bin /usr/ccs/bin"
101 paths="$paths /etc /usr/lib /usr/ucblib /lib /usr/ccs/lib"
102 paths="$paths /sbin /usr/sbin /usr/libexec"
103 paths="$paths /system/gnu_library/bin"
107 case "$p_$PATH$p_" in
109 *) test -d $p && PATH=$PATH$p_$p ;;
116 : shall we be using ksh?
122 if (PATH=.; alias -x) >/dev/null 2>&1; then
125 if test -f /hp-ux -a -f /bin/ksh; then
126 needksh='to avoid sh bug in "here document" expansion'
128 if test -d /usr/lpp -a -f /usr/bin/bsh -a -f /usr/bin/uname; then
129 if test X`/usr/bin/uname -v` = X4; then
130 avoidksh="to avoid AIX 4's /bin/sh"
134 if test -f /osf_boot -a -f /usr/sbin/setld; then
135 if test X`/usr/bin/uname -s` = XOSF1; then
136 avoidksh="to avoid Digital UNIX' ksh"
138 unset BIN_SH # if this is 'xpg4' sh will start up ksh
141 case "$inksh/$needksh" in
148 case "$inksh/$avoidksh" in
154 case "$inksh/$needksh-$avoidksh-" in
157 (I see you are using the Korn shell. Some ksh's blow up on $me,
158 mainly on older exotic systems. If yours does, try the Bourne shell instead.)
165 echo "(Feeding myself to $newsh $reason.)"
167 Configure|*/Configure) exec $newsh $0 "$@";;
168 *) exec $newsh Configure "$@";;
173 : if needed set CDPATH to a harmless value that is not chatty
174 : avoid bash 2.02 problems with empty CDPATH.
178 *bash*) CDPATH='.' ;;
183 : Configure runs within the UU subdirectory
184 test -d UU || mkdir UU
348 d_attribute_format=''
349 d_attribute_malloc=''
350 d_attribute_nonnull=''
351 d_attribute_noreturn=''
353 d_attribute_unused=''
354 d_attribute_warn_unused_result=''
401 endhostent_r_proto=''
407 endprotoent_r_proto=''
413 endservent_r_proto=''
464 gethostbyaddr_r_proto=''
466 gethostbyname_r_proto=''
468 gethostent_r_proto=''
480 getnetbyaddr_r_proto=''
482 getnetbyname_r_proto=''
496 d_getprotobyname_r=''
497 getprotobyname_r_proto=''
498 d_getprotobynumber_r=''
499 getprotobynumber_r_proto=''
501 getprotoent_r_proto=''
513 getservbyname_r_proto=''
515 getservbyport_r_proto=''
517 getservent_r_proto=''
541 d_libm_lib_version=''
554 d_malloc_good_size=''
596 d_old_pthread_create_joinable=''
597 old_pthread_create_joinable=''
599 d_pthread_attr_setscope=''
638 sethostent_r_proto=''
655 setprotoent_r_proto=''
667 setservent_r_proto=''
698 d_sprintf_returns_strlen=''
713 d_stdio_ptr_lval_nochange_cnt=''
714 d_stdio_ptr_lval_sets_cnt=''
918 inc_version_list_init=''
937 ignore_versioned_solibs=''
997 d_perl_otherlibdirs=''
1005 api_versionstring=''
1011 version_patchlevel_string=''
1015 d_nv_preserves_uv=''
1016 d_nv_zero_is_allbits_zero=''
1027 nv_preserves_uv_bits=''
1098 installsitehtml1dir=''
1101 installsitehtml3dir=''
1108 installsiteman1dir=''
1111 installsiteman3dir=''
1116 installsitescript=''
1131 d_stdio_stream_array=''
1132 stdio_stream_array=''
1143 ccflags_uselargefiles=''
1144 ldflags_uselargefiles=''
1145 libswanted_uselargefiles=''
1155 userelocatableinc=''
1166 installvendorarch=''
1173 installvendorhtml1dir=''
1175 vendorhtml1direxp=''
1176 installvendorhtml3dir=''
1178 vendorhtml3direxp=''
1184 installvendorman1dir=''
1187 installvendorman3dir=''
1194 installvendorscript=''
1206 smallmach='pdp11 i8086 z8000 i80286 iAPX286'
1209 : We must find out about Eunice early
1211 if test -f /etc/unixtovms; then
1212 eunicefix=/etc/unixtovms
1214 if test -f /etc/unixtovms.exe; then
1215 eunicefix=/etc/unixtovms.exe
1218 : Set executable suffix now -- needed before hints available
1219 if test -f "/libs/version.library"; then
1222 elif test -f "/system/gnu_library/bin/ar.pm"; then
1225 elif test -n "$DJGPP"; then
1228 elif test -d c:/. -o -n "$is_os2" ; then
1237 : set useposix=false in your hint file to disable the POSIX extension.
1239 : set useopcode=false in your hint file to disable the Opcode extension.
1241 : Trailing extension. Override this in a hint file, if needed.
1242 : Extra object files, if any, needed on this platform.
1245 : Possible local include directories to search.
1246 : Set locincpth to "" in a hint file to defeat local include searches.
1247 locincpth="/usr/local/include /opt/local/include /usr/gnu/include"
1248 locincpth="$locincpth /opt/gnu/include /usr/GNU/include /opt/GNU/include"
1250 : no include file wanted by default
1255 : change the next line if compiling for Xenix/286 on Xenix/386
1256 xlibpth='/usr/lib/386 /lib/386'
1257 : Possible local library directories to search.
1258 loclibpth="/usr/local/lib /opt/local/lib /usr/gnu/lib"
1259 loclibpth="$loclibpth /opt/gnu/lib /usr/GNU/lib /opt/GNU/lib"
1261 : general looking path for locating libraries
1262 glibpth="/lib /usr/lib $xlibpth"
1263 glibpth="$glibpth /usr/ccs/lib /usr/ucblib /usr/local/lib"
1264 test -f /usr/shlib/libc.so && glibpth="/usr/shlib $glibpth"
1265 test -f /shlib/libc.so && glibpth="/shlib $glibpth"
1267 : Private path used by Configure to find libraries. Its value
1268 : is prepended to libpth. This variable takes care of special
1269 : machines, like the mips. Usually, it should be empty.
1272 : default library list
1274 : some systems want to use only the non-versioned libso:s
1275 ignore_versioned_solibs=''
1280 ccflags_uselargefiles=''
1281 ldflags_uselargefiles=''
1282 libswanted_uselargefiles=''
1283 : set usemultiplicity on the Configure command line to enable multiplicity.
1284 : set usesocks on the Configure command line to enable socks.
1285 : set usethreads on the Configure command line to enable threads.
1286 usereentrant='undef'
1287 : full support for void wanted by default
1290 : List of libraries we want.
1291 : If anyone needs extra -lxxx, put those in a hint file.
1292 libswanted="sfio socket bind inet nsl nm ndbm gdbm dbm db malloc dl dld ld sun"
1293 libswanted="$libswanted m crypt sec util c cposix posix ucb bsd BSD"
1294 : We probably want to search /usr/shlib before most other libraries.
1295 : This is only used by the lib/ExtUtils/MakeMaker.pm routine extliblist.
1296 glibpth=`echo " $glibpth " | sed -e 's! /usr/shlib ! !'`
1297 glibpth="/usr/shlib $glibpth"
1298 : Do not use vfork unless overridden by a hint file.
1301 : Find the basic shell for Bourne shell scripts
1305 *bsd*|sys5*) xxx="/$SYSTYPE/bin/sh";;
1308 if test -f "$xxx"; then
1311 : Build up a list and do a single loop so we can 'break' out.
1312 pth=`echo $PATH | sed -e "s/$p_/ /g"`
1313 for xxx in sh bash ksh pdksh ash; do
1315 try="$try ${p}/${xxx}"
1319 if test -f "$xxx"; then
1322 elif test "X$_exe" != X -a -f "$xxx$_exe"; then
1325 elif test -f "$xxx.exe"; then
1336 $me: Fatal Error: I can't find a Bourne Shell anywhere.
1338 Usually it's in /bin/sh. How did you even get this far?
1339 Please contact me (Perl Maintainers) at perlbug@perl.org and
1340 we'll try to straighten this all out.
1346 : see if sh knows # comments
1347 if `$sh -c '#' >/dev/null 2>&1`; then
1351 test -f $xcat$_exe || xcat=/usr/bin/cat
1352 if test ! -f $xcat$_exe; then
1353 for p in `echo $PATH | sed -e "s/$p_/ /g"` $paths; do
1354 if test -f $p/cat$_exe; then
1359 if test ! -f $xcat$_exe; then
1360 echo "Can't find cat anywhere!"
1364 echo "#!$xcat" >sharp
1368 if test -s today; then
1371 echo "#! $xcat" > sharp
1375 if test -s today; then
1383 echo "Your $sh doesn't grok # comments--I will strip them later on."
1386 echo "exec grep -v '^[ ]*#'" >spitshell
1388 $eunicefix spitshell
1389 spitshell=`pwd`/spitshell
1391 echo "I presume that if # doesn't work, #! won't work either!"
1396 : figure out how to guarantee sh startup
1398 '') startsh=${sharpbang}${sh} ;;
1410 : echo "Yup, it does."
1412 echo "Hmm... '$startsh' does not guarantee sh startup..."
1413 echo "You may have to fix up the shell scripts to make sure $sh runs them."
1418 : Save command line options in file UU/cmdline.opt for later use in
1419 : generating config.sh.
1420 cat > cmdline.opt <<EOSH
1421 # Configure command line arguments.
1430 cat >>cmdline.opt <<EOSH
1431 config_arg$argn='$arg'
1433 # Extreme backslashitis: replace each ' by '"'"'
1434 cat <<EOC | sed -e "s/'/'"'"'"'"'"'"'/g" > cmdl.opt
1437 arg_exp=`cat cmdl.opt`
1438 args_exp="$args_exp$args_sep'$arg_exp'"
1439 argn=`expr $argn + 1`
1442 # args_exp is good for restarting self: eval "set X $args_exp"; shift; $0 "$@"
1443 # used by ./hints/os2.sh
1446 : produce awk script to parse command line options
1447 cat >options.awk <<'EOF'
1449 optstr = "A:dD:eEf:hKOrsSU:V"; # getopt-style specification
1451 len = length(optstr);
1452 for (i = 1; i <= len; i++) {
1453 c = substr(optstr, i, 1);
1454 if (i < len) a = substr(optstr, i + 1, 1); else a = "";
1465 if (substr(str, 1, 1) != "-") {
1466 printf("'%s'\n", str);
1470 for (i = 2; i <= len; i++) {
1471 c = substr(str, i, 1);
1473 printf("-%s\n", substr(str, i));
1479 printf("'%s'\n", substr(str, i + 1));
1492 : process the command line options
1493 set X `for arg in "$@"; do echo "X$arg"; done |
1494 sed -e s/X// | awk -f options.awk`
1499 : set up default values
1509 rm -f optdef.sh posthint.sh
1510 cat >optdef.sh <<EOS
1516 while test $# -gt 0; do
1518 -d) shift; fastread=yes;;
1519 -e) shift; alldone=cont;;
1523 if test -r "$1"; then
1526 echo "$me: cannot read config file $1." >&2
1531 -h) shift; error=true;;
1532 -r) shift; reuseval=true;;
1533 -s) shift; silent=true; realsilent=true;;
1534 -E) shift; alldone=exit;;
1535 -K) shift; knowitall=true;;
1536 -O) shift; override=true;;
1537 -S) shift; silent=true; extractsh=true;;
1542 echo "$me: use '-U symbol=', not '-D symbol='." >&2
1543 echo "$me: ignoring -D $1" >&2
1546 sed -e "s/'/'\"'\"'/g" -e "s/=\(.*\)/='\1'/" >> optdef.sh;;
1547 *) echo "$1='define'" >> optdef.sh;;
1554 *=) echo "$1" >> optdef.sh;;
1556 echo "$me: use '-D symbol=val', not '-U symbol=val'." >&2
1557 echo "$me: ignoring -U $1" >&2
1559 *) echo "$1='undef'" >> optdef.sh;;
1570 *=*) zzz=`echo "$yyy"|sed 's!=.*!!'`
1574 zzz=" "`echo "$yyy"|sed 's!^[^=]*=!!'`
1575 yyy=`echo "$yyy"|sed 's!=.*!!'` ;;
1581 *:*) xxx=`echo "$yyy"|sed 's!:.*!!'`
1582 yyy=`echo "$yyy"|sed 's!^[^:]*:!!'`
1583 zzz=`echo "$yyy"|sed 's!^[^=]*=!!'`
1584 yyy=`echo "$yyy"|sed 's!=.*!!'` ;;
1585 *) xxx=`echo "$yyy"|sed 's!:.*!!'`
1586 yyy=`echo "$yyy"|sed 's!^[^:]*:!!'` ;;
1592 echo "$yyy=\"\${$yyy}$zzz\"" >> posthint.sh ;;
1594 echo "$yyy=''" >> posthint.sh ;;
1599 echo "$yyy='$zzz'" >> posthint.sh ;;
1601 echo "eval \"$yyy=$zzz\"" >> posthint.sh ;;
1603 echo "$yyy=\"$zzz\${$yyy}\"" >> posthint.sh ;;
1608 echo "$yyy=$zzz" >> posthint.sh ;;
1609 *) echo "$me: unknown -A command '$xxx', ignoring -A $1" >&2 ;;
1613 -V) echo "$me generated by metaconfig 3.0 PL70." >&2
1616 -*) echo "$me: unknown option $1" >&2; shift; error=true;;
1624 Usage: $me [-dehrsEKOSV] [-f config.sh] [-D symbol] [-D symbol=value]
1625 [-U symbol] [-U symbol=] [-A command:symbol...]
1626 -d : use defaults for all answers.
1627 -e : go on without questioning past the production of config.sh.
1628 -f : specify an alternate default configuration file.
1629 -h : print this help message and exit (with an error status).
1630 -r : reuse C symbols value if possible (skips costly nm extraction).
1631 -s : silent mode, only echoes questions and essential information.
1632 -D : define symbol to have some value:
1633 -D symbol symbol gets the value 'define'
1634 -D symbol=value symbol gets the value 'value'
1635 -E : stop at the end of questions, after having produced config.sh.
1636 -K : do not use unless you know what you are doing.
1637 -O : let -D and -U override definitions from loaded configuration file.
1638 -S : perform variable substitutions on all .SH files (can mix with -f)
1639 -U : undefine symbol:
1640 -U symbol symbol gets the value 'undef'
1641 -U symbol= symbol gets completely empty
1642 -A : manipulate symbol after the platform specific hints have been applied:
1643 -A symbol=value append " "value to symbol
1644 -A append:symbol=value append value to symbol
1645 -A define:symbol=value define symbol to have value
1646 -A clear:symbol define symbol to be ''
1647 -A define:symbol define symbol to be 'define'
1648 -A eval:symbol=value define symbol to be eval of value
1649 -A prepend:symbol=value prepend value to symbol
1650 -A undef:symbol define symbol to be 'undef'
1651 -A undef:symbol= define symbol to be ''
1652 -V : print version number and exit (with a zero status).
1659 case "$fastread$alldone" in
1662 case "$extractsh" in
1665 if test ! -t 0; then
1666 echo "Say 'sh Configure', not 'sh <Configure'"
1676 true) exec 1>/dev/null;;
1679 : run the defines and the undefines, if any, but leave the file out there...
1682 : create the posthint manipulation script and leave the file out there...
1687 first=`echo $package | sed -e 's/^\(.\).*/\1/'`
1688 last=`echo $package | sed -e 's/^.\(.*\)/\1/'`
1689 case "`echo AbyZ | tr '[:lower:]' '[:upper:]' 2>/dev/null`" in
1690 ABYZ) spackage=`echo $first | tr '[:lower:]' '[:upper:]'`$last;;
1691 *) spackage=`echo $first | tr '[a-z]' '[A-Z]'`$last;;
1694 : Some greps do not return status, grrr.
1695 echo "grimblepritz" >grimble
1696 if grep blurfldyick grimble >/dev/null 2>&1 ; then
1698 elif grep grimblepritz grimble >/dev/null 2>&1 ; then
1704 : the following should work in any shell
1708 echo "AGH! Grep doesn't return a status. Attempting remedial action."
1709 cat >contains <<'EOSS'
1710 grep "$1" "$2" >.greptmp && cat .greptmp && test -s .greptmp
1715 : Find the path to the source tree
1718 */*) src=`echo $0 | sed -e 's%/[^/][^/]*$%%'`
1722 *) src=`cd ../$src && pwd` ;;
1735 if test -f $rsrc/Configure && \
1736 $contains "^package=$package$" $rsrc/Configure >/dev/null 2>&1
1738 : found it, so we are ok.
1741 for src in . .. ../.. ../../.. ../../../..; do
1742 if test -f ../$src/Configure && \
1743 $contains "^package=$package$" ../$src/Configure >/dev/null 2>&1
1754 Sorry, I can't seem to locate the source dir for $package. Please start
1755 Configure with an explicit path -- i.e. /some/path/Configure.
1763 echo "Sources for $package found in \"$src\"." >&4
1767 : script used to extract .SH files with variable substitutions
1768 cat >extract <<'EOS'
1770 echo "Doing variable substitutions on .SH files..."
1771 if test -f MANIFEST; then
1772 set x `awk '{print $1}' < MANIFEST | grep '\.SH$'`
1774 echo "(Looking for .SH files under the source directory.)"
1775 set x `(cd "$src"; find . -name "*.SH" -print)`
1779 0) set x `(cd "$src"; echo *.SH)`; shift;;
1781 if test ! -f "$src/$1"; then
1787 while test $name; do
1788 if test ! -d "$name"; then
1789 create="$name $create";
1790 name=`echo $name | sed -e "s|^[^/]*$||"`;
1791 name=`echo $name | sed -e "s|\(.*\)/.*|\1|"`;
1796 for file in $create; do
1805 dir=`expr X$file : 'X\(.*\)/'`
1806 file=`expr X$file : 'X.*/\(.*\)'`
1807 (cd "$dir" && . ./$file)
1817 dir=`expr X$file : 'X\(.*\)/'`
1818 file=`expr X$file : 'X.*/\(.*\)'`
1819 (set x $dir; shift; eval $mkdir_p)
1820 sh <"$src/$dir/$file"
1829 if test -f "$src/config_h.SH"; then
1830 if test ! -f config.h; then
1831 : oops, they left it out of MANIFEST, probably, so do it anyway.
1832 . "$src/config_h.SH"
1837 : extract files and exit if asked to do so
1838 case "$extractsh" in
1840 case "$realsilent" in
1844 case "$config_sh" in
1845 '') config_sh='config.sh';;
1848 echo "Fetching answers from $config_sh..."
1851 test "$override" && . ./optdef.sh
1855 echo "Extraction done."
1860 : Eunice requires " " instead of "", can you believe it
1863 echo "Beginning of configuration questions for $package."
1865 trap 'echo " "; test -d ../UU && rm -rf X $rmlist; exit 1' 1 2 3 15
1867 : first determine how to suppress newline on echo command
1869 echo "Checking echo to see how to suppress newlines..."
1870 (echo "hi there\c" ; echo " ") >.echotmp
1871 if $contains c .echotmp >/dev/null 2>&1 ; then
1882 echo $n "The star should be here-->$c"
1886 : Now test for existence of everything in MANIFEST
1888 if test -f "$rsrc/MANIFEST"; then
1889 echo "First let's make sure your kit is complete. Checking..." >&4
1890 awk '$1 !~ /PACK[A-Z]+/ {print $1}' "$rsrc/MANIFEST" | (split -l 50 2>/dev/null || split -50)
1893 for filelist in x??; do
1894 (cd "$rsrc"; ls `cat "$tmppwd/$filelist"` >/dev/null 2>>"$tmppwd/missing")
1896 if test -s missing; then
1900 THIS PACKAGE SEEMS TO BE INCOMPLETE.
1902 You have the option of continuing the configuration process, despite the
1903 distinct possibility that your kit is damaged, by typing 'y'es. If you
1904 do, don't blame me if something goes wrong. I advise you to type 'n'o
1905 and contact the author (perlbug@perl.org).
1908 echo $n "Continue? [n] $c" >&4
1912 echo "Continuing..." >&4
1916 echo "ABORTING..." >&4
1921 echo "Looks good..."
1924 echo "There is no MANIFEST file. I hope your kit is complete !"
1929 : Find the appropriate value for a newline for tr
1930 if test -n "$DJGPP"; then
1933 if test X"$trnl" = X; then
1934 case "`echo foo|tr '\n' x 2>/dev/null`" in
1938 if test X"$trnl" = X; then
1939 case "`echo foo|tr '\012' x 2>/dev/null`" in
1940 foox) trnl='\012' ;;
1943 if test X"$trnl" = X; then
1944 case "`echo foo|tr '\r\n' xy 2>/dev/null`" in
1945 fooxy) trnl='\n\r' ;;
1948 if test X"$trnl" = X; then
1951 $me: Fatal Error: cannot figure out how to translate newlines with 'tr'.
1957 : compute the number of columns on the terminal for proper question formatting
1962 : set up the echo used in my read
1963 myecho="case \"\$xxxm\" in
1964 '') echo $n \"\$rp $c\" >&4;;
1966 '') echo $n \"[\$xxxm] $c\";;
1968 if test \`echo \"\$rp [\$xxxm] \" | wc -c\` -ge $COLUMNS; then
1970 echo $n \"[\$xxxm] $c\" >&4
1972 echo $n \"\$rp [\$xxxm] $c\" >&4
1978 : now set up to do reads with possible shell escape and default assignment
1984 case "\$fastread" in
1985 yes) case "\$dflt" in
1988 case "\$silent-\$rp" in
1993 *) case "\$silent" in
1994 true) case "\$rp" in
1999 while expr "X\$ans" : "X!" >/dev/null; do
2003 aok=''; eval "ans=\\"\$answ\\"" && aok=y
2011 set x \`expr "X\$ans" : "X!\(.*\)\$"\`
2020 set x \`expr "X\$ans" : "X&\(.*\)\$"\`
2025 echo "(OK, I'll run with -d after this question.)" >&4
2028 echo "*** Sorry, \$1 not supported yet." >&4
2038 echo "*** Substitution done -- please confirm."
2040 ans=\`echo $n "\$ans$c" | tr '$trnl' ' '\`
2045 echo "*** Error -- try again."
2052 case "\$ans\$xxxm\$nostick" in
2064 : create .config dir to save info across Configure sessions
2065 test -d ../.config || mkdir ../.config
2066 cat >../.config/README <<EOF
2067 This directory created by Configure to save information that should
2068 persist across sessions for $package.
2070 You may safely delete it if you wish.
2073 xversion=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
2075 $define|true|[yY]*) ;;
2076 *) case "$xversion" in
2079 *** WHOA THERE!!! ***
2081 This is an UNSTABLE DEVELOPMENT release.
2082 The version of this $package distribution is $xversion, that is, odd,
2083 (as opposed to even) and that signifies a development release.
2084 If you want a maintenance release, you want an even-numbered version.
2086 Do ***NOT*** install this into production use.
2087 Data corruption and crashes are possible.
2089 It is most seriously suggested that you do not continue any further
2090 unless you want to help in developing and debugging Perl.
2092 If you *still* want to build perl, you can answer 'y' now,
2093 or pass -Dusedevel to Configure.
2096 rp='Do you really want to continue?'
2100 [yY]) echo >&4 "Okay, continuing."
2101 usedevel="$define" ;;
2102 *) echo >&4 "Okay, bye."
2112 case "$versiononly" in
2113 '') versiononly="$define" ;;
2115 case "$installusrbinperl" in
2116 '') installusrbinperl="$undef" ;;
2121 : general instructions
2124 user=`(logname) 2>/dev/null`
2126 '') user=`whoami 2>&1`;;
2128 if $contains "^$user\$" ../.config/instruct >/dev/null 2>&1; then
2131 rp='Would you like to see the instructions?'
2142 This installation shell script will examine your system and ask you questions
2143 to determine how the perl5 package should be installed. If you get
2144 stuck on a question, you may use a ! shell escape to start a subshell or
2145 execute a command. Many of the questions will have default answers in square
2146 brackets; typing carriage return will give you the default.
2148 On some of the questions which ask for file or directory names you are allowed
2149 to use the ~name construct to specify the login directory belonging to "name",
2150 even if you don't have a shell which knows about that. Questions where this is
2151 allowed will be marked "(~name ok)".
2155 dflt='Type carriage return to continue'
2159 The prompter used in this script allows you to use shell variables and
2160 backticks in your answers. You may use $1, $2, etc... to refer to the words
2161 in the default answer, as if the default line was a set of arguments given to a
2162 script shell. This means you may also use $* to repeat the whole default line,
2163 so you do not have to re-type everything to add something to the default.
2165 Everytime there is a substitution, you will have to confirm. If there is an
2166 error (e.g. an unmatched backtick), the default answer will remain unchanged
2167 and you will be prompted again.
2169 If you are in a hurry, you may run 'Configure -d'. This will bypass nearly all
2170 the questions and use the computed defaults (or the previous answers if there
2171 was already a config.sh file). Type 'Configure -h' for a list of options.
2172 You may also start interactively and then answer '& -d' at any prompt to turn
2173 on the non-interactive behaviour for the remainder of the execution.
2179 Much effort has been expended to ensure that this shell script will run on any
2180 Unix system. If despite that it blows up on yours, your best bet is to edit
2181 Configure and run it again. If you can't run Configure for some reason,
2182 you'll have to generate a config.sh file by hand. Whatever problems you
2183 have, let me (perlbug@perl.org) know how I blew it.
2185 This installation script affects things in two ways:
2187 1) it may do direct variable substitutions on some of the files included
2189 2) it builds a config.h file for inclusion in C programs. You may edit
2190 any of these files as the need arises after running this script.
2192 If you make a mistake on a question, there is no easy way to back up to it
2193 currently. The easiest thing to do is to edit config.sh and rerun all the SH
2194 files. Configure will offer to let you do this before it runs the SH files.
2197 dflt='Type carriage return to continue'
2199 case "$firsttime" in
2200 true) echo $user >>../.config/instruct;;
2204 : find out where common programs are
2206 echo "Locating common programs..." >&4
2219 if test -d \$dir/\$thing; then
2225 for thisthing in \$dir/\$thing; do
2226 : just loop through to pick last item
2228 if test -f \$thisthing; then
2231 elif test "X$_exe" != X -a -f \$thisthing$_exe; then
2234 elif test -f \$dir/\$thing.exe; then
2235 if test -n "$DJGPP"; then
2236 echo \$dir/\$thing.exe
2237 elif test "$eunicefix" != ":"; then
2238 : on Eunice apparently
2292 pth=`echo $PATH | sed -e "s/$p_/ /g"`
2293 pth="$pth /lib /usr/lib"
2294 for file in $loclist; do
2298 if test -f "$xxx"; then
2301 echo "WARNING: no $xxx -- ignoring your setting for $file." >&4
2302 xxx=`./loc $file $file $pth`
2305 '') xxx=`./loc $file $file $pth`;;
2306 *) xxx=`./loc $xxx $xxx $pth`;;
2308 eval $file=$xxx$_exe
2312 echo $file is in $xxx.
2315 echo $file is in $xxx.
2318 echo "I don't know where '$file' is, and my life depends on it." >&4
2319 echo "Go find a public domain implementation or fix your PATH setting!" >&4
2325 echo "Don't worry if any of the following aren't found..."
2327 for file in $trylist; do
2331 if test -f "$xxx"; then
2334 echo "WARNING: no $xxx -- ignoring your setting for $file." >&4
2335 xxx=`./loc $file $file $pth`
2338 '') xxx=`./loc $file $file $pth`;;
2339 *) xxx=`./loc $xxx $xxx $pth`;;
2341 eval $file=$xxx$_exe
2345 echo $file is in $xxx.
2348 echo $file is in $xxx.
2351 echo "I don't see $file out there, $say."
2358 echo "Substituting grep for egrep."
2365 echo "Substituting cp for ln."
2374 echo "I can't find make or gmake, and my life depends on it." >&4
2375 echo "Go find a public domain implementation or fix your PATH setting!" >&4
2383 *) # We can't have osname yet.
2384 if test -f "/system/gnu_library/bin/ar.pm"; then # Stratus VOS
2385 # Assume that gmake, if found, is definitely GNU make
2386 # and prefer it over the system make.
2387 echo "Substituting gmake for make."
2395 echo "Hopefully test is built into your sh."
2398 if `sh -c "PATH= test true" >/dev/null 2>&1`; then
2399 echo "Using the test built into your sh."
2407 echo "Hopefully echo is built into your sh."
2412 echo "Checking compatibility between $echo and builtin echo (if any)..." >&4
2413 $echo $n "hi there$c" >foo1
2414 echo $n "hi there$c" >foo2
2415 if cmp foo1 foo2 >/dev/null 2>&1; then
2416 echo "They are compatible. In fact, they may be identical."
2423 They are not compatible! You are probably running ksh on a non-USG system.
2424 I'll have to use $echo instead of the builtin, since Bourne shell doesn't
2425 have echo built in and we may have to run some Bourne shell scripts. That
2426 means I'll have to use '$n$c' to suppress newlines now. Life is ridiculous.
2429 $echo $n "The star should be here-->$c"
2439 cat <<'EOSC' >>trygcc
2444 int main(int argc, char *argv[]) {
2448 if $cc -o try $ccflags $ldflags try.c; then
2451 echo "Uh-oh, the C compiler '$cc' doesn't seem to be working." >&4
2457 case "`$cc -v -c try.c 2>&1`" in
2460 if $test X"$trygcc" = Xyes; then
2461 if gcc -o try -c try.c; then
2463 echo "You seem to have a working gcc, though." >&4
2464 rp="Would you like to use it?"
2466 if $test -f myread; then
2469 if $test -f UU/myread; then
2472 echo "Cannot find myread, sorry. Aborting." >&2
2477 [yY]*) cc=gcc; ccname=gcc; ccflags=''; despair=no;
2478 if $test -f usethreads.cbu; then
2481 *** However, any setting of the C compiler flags (e.g. for thread support)
2482 *** has been lost. It may be necessary to pass -Dcc=gcc to Configure
2483 *** (together with e.g. -Dusethreads).
2499 cat <<'EOSC' >>checkcc
2504 int main(int argc, char *argv[]) {
2508 if $cc -o try $ccflags $ldflags try.c; then
2511 if $test X"$despair" = Xyes; then
2512 echo "Uh-oh, the C compiler '$cc' doesn't seem to be working." >&4
2515 You need to find a working C compiler.
2516 Either (purchase and) install the C compiler supplied by your OS vendor,
2517 or for a free C compiler try http://gcc.gnu.org/
2518 I cannot continue any further, aborting.
2527 : determine whether symbolic links are supported
2530 if $ln -s blurfl sym > /dev/null 2>&1 ; then
2531 echo "Symbolic links are supported." >&4
2534 echo "Symbolic links are NOT supported." >&4
2539 : determine whether symbolic links are supported
2543 echo "Checking how to test for symbolic links..." >&4
2545 if $test "X$issymlink" = X; then
2547 '') sh -c "PATH= test -h sym" >/dev/null 2>&1 ;;
2548 *) $newsh -c "PATH= test -h sym" >/dev/null 2>&1 ;;
2550 if test $? = 0; then
2553 echo "Your builtin 'test -h' may be broken." >&4
2556 *) pth=`echo $PATH | sed -e "s/$p_/ /g"`
2559 if test -f "$p/$test"; then
2568 echo "Trying external '$test -h'." >&4
2569 issymlink="$test -h"
2570 if $test ! -h sym >/dev/null 2>&1; then
2571 echo "External '$test -h' is broken, too." >&4
2579 if $test "X$issymlink" = X; then
2580 if $test -L sym 2>/dev/null; then
2581 issymlink="$test -L"
2582 echo "The builtin '$test -L' worked." >&4
2585 if $test "X$issymlink" != X; then
2586 echo "You can test for symbolic links with '$issymlink'." >&4
2588 echo "I do not know how you can test for symbolic links." >&4
2592 *) echo "No symbolic links, so not testing for their testing..." >&4
2598 case "$mksymlinks" in
2601 ''|'.') echo "Cannot create symlinks in the original directory." >&4
2604 *) case "$lns:$issymlink" in
2605 *"ln"*" -s:"*"test -"?)
2606 echo "Creating the symbolic links..." >&4
2607 echo "(First creating the subdirectories...)" >&4
2609 awk '{print $1}' $src/MANIFEST | grep / | sed 's:/[^/]*$::' | sort -u | while true; do
2611 test -z "$directory" && break
2615 if test ! -d t/base; then
2616 echo "Failed to create the subdirectories. Aborting." >&4
2619 echo "(Then creating the symlinks...)" >&4
2620 awk '{print $1}' $src/MANIFEST | while true; do
2622 test -z "$filename" && break
2623 if test -f $filename; then
2624 if $issymlink $filename; then
2628 if test -f $filename; then
2629 echo "$filename already exists, not symlinking."
2631 ln -s $src/$filename $filename
2635 if test ! -f t/base/lex.t; then
2636 echo "Failed to create the symlinks (t/base/lex.t missing). Aborting." >&4
2641 *) echo "(I cannot figure out how to do symbolic links, ignoring mksymlinks)." >&4
2650 case "$usecrosscompile" in
2652 $echo "Cross-compiling..."
2655 *-*-gcc) # A cross-compiling gcc, probably.
2656 targetarch=`$echo $cc|$sed 's/-gcc$//'`
2658 # leave out ld, choosing it is more complex
2660 ranlib=$targetarch-ranlib
2661 $echo 'extern int foo;' > try.c
2662 set X `$cc -v -E try.c 2>&1 | $awk '/^#include </,/^End of search /'|$grep '/include'`
2664 if $test $# -gt 0; then
2666 incpth="`$echo $incpth|$sed 's/^ //'`"
2667 echo "Guessing incpth '$incpth'." >&4
2669 j="`$echo $i|$sed 's,/include$,/lib,'`"
2670 if $test -d $j; then
2674 libpth="`$echo $libpth|$sed 's/^ //'`"
2675 echo "Guessing libpth '$libpth'." >&4
2680 case "$targetarch" in
2681 '') echo "Targetarch not defined." >&4; croak=y ;;
2682 *) echo "Using targetarch $targetarch." >&4 ;;
2685 '') echo "Incpth not defined." >&4; croak=y ;;
2686 *) echo "Using incpth '$incpth'." >&4 ;;
2689 '') echo "Libpth not defined." >&4; croak=y ;;
2690 *) echo "Using libpth '$libpth'." >&4 ;;
2693 '') for i in $incpth; do
2694 if $test -f $i/errno.h -a -f $i/stdio.h -a -f $i/time.h; then
2696 echo "Guessing usrinc $usrinc." >&4
2701 '') echo "Usrinc not defined." >&4; croak=y ;;
2704 *) echo "Using usrinc $usrinc." >&4 ;;
2706 case "$targethost" in
2707 '') echo "Targethost not defined." >&4; croak=y ;;
2708 *) echo "Using targethost $targethost." >&4
2713 y) echo "Cannot continue, aborting." >&4; exit 1 ;;
2716 /*) run=$src/Cross/run
2717 targetmkdir=$src/Cross/mkdir
2719 from=$src/Cross/from
2721 *) pwd=`$test -f ../Configure & cd ..; pwd`
2723 targetmkdir=$pwd/Cross/mkdir
2725 from=$pwd/Cross/from
2728 case "$targetrun" in
2729 '') targetrun=ssh ;;
2734 case "$targetfrom" in
2735 '') targetfrom=scp ;;
2739 from=$from-$targetfrom
2740 case "$targetdir" in
2742 echo "Guessing targetdir $targetdir." >&4
2745 case "$targetuser" in
2747 echo "Guessing targetuser $targetuser." >&4
2750 case "$targetfrom" in
2754 case "$targetrun" in
2766 '') cwd=$targetdir ;;
2770 if $test ! -f \$exe.xok; then
2774 $targetrun -l $targetuser $targethost "cd \$cwd && ./\$exe \$@"
2777 *) echo "Unknown targetrun '$targetrun'" >&4
2781 case "$targetmkdir" in
2783 cat >$targetmkdir <<EOF
2785 $targetrun -l $targetuser $targethost "mkdir -p \$@"
2787 $chmod a+rx $targetmkdir
2789 *) echo "Unknown targetmkdir '$targetmkdir'" >&4
2801 $targetmkdir \`dirname \$f\`
2802 $targetto $q \$f $targetuser@$targethost:\$f || exit 1
2805 $targetmkdir $targetdir/\`dirname \$f\`
2806 $targetto $q \$f $targetuser@$targethost:$targetdir/\$f || exit 1
2819 $mkdir -p $targetdir/\`dirname \$f\`
2820 $cp \$f $targetdir/\$f || exit 1
2823 $targetmkdir $targetdir/\`dirname \$f\`
2824 $cp \$f $targetdir/\$f || exit 1
2831 *) echo "Unknown targetto '$targetto'" >&4
2835 case "$targetfrom" in
2842 $targetfrom $q $targetuser@$targethost:$targetdir/\$f . || exit 1
2847 cp) cat >$from <<EOF
2852 cp $targetdir/\$f . || exit 1
2857 *) echo "Unknown targetfrom '$targetfrom'" >&4
2861 if $test ! -f $run; then
2862 echo "Target 'run' script '$run' not found." >&4
2866 if $test ! -f $to; then
2867 echo "Target 'to' script '$to' not found." >&4
2871 if $test ! -f $from; then
2872 echo "Target 'from' script '$from' not found." >&4
2876 if $test ! -f $run -o ! -f $to -o ! -f $from; then
2880 Using '$run' for remote execution,
2881 and '$from' and '$to'
2882 for remote file transfer.
2888 usecrosscompile='undef'
2893 : see whether [:lower:] and [:upper:] are supported character classes
2895 case "`echo AbyZ | $tr '[:lower:]' '[:upper:]' 2>/dev/null`" in
2897 echo "Good, your tr supports [:lower:] and [:upper:] to convert case." >&4
2901 *) # There is a discontinuity in EBCDIC between 'R' and 'S'
2902 # (0xd9 and 0xe2), therefore that is a nice testing point.
2903 if test "X$up" = X -o "X$low" = X; then
2904 case "`echo RS | $tr '[R-S]' '[r-s]' 2>/dev/null`" in
2910 if test "X$up" = X -o "X$low" = X; then
2911 case "`echo RS | $tr R-S r-s 2>/dev/null`" in
2917 if test "X$up" = X -o "X$low" = X; then
2918 case "`echo RS | od -x 2>/dev/null`" in
2920 echo "Hey, this might be EBCDIC." >&4
2921 if test "X$up" = X -o "X$low" = X; then
2922 case "`echo RS | $tr '[A-IJ-RS-Z]' '[a-ij-rs-z]' 2>/dev/null`" in
2923 rs) up='[A-IJ-RS-Z]'
2928 if test "X$up" = X -o "X$low" = X; then
2929 case "`echo RS | $tr A-IJ-RS-Z a-ij-rs-z 2>/dev/null`" in
2939 case "`echo RS | $tr \"$up\" \"$low\" 2>/dev/null`" in
2941 echo "Using $up and $low to convert case." >&4
2944 echo "I don't know how to translate letters from upper to lower case." >&4
2945 echo "Your tr is not acting any way I know of." >&4
2949 : set up the translation script tr, must be called with ./tr of course
2953 '[A-Z][a-z]') exec $tr '$up' '$low';;
2954 '[a-z][A-Z]') exec $tr '$low' '$up';;
2961 : Try to determine whether config.sh was made on this system
2962 case "$config_sh" in
2964 myuname=`$uname -a 2>/dev/null`
2965 $test -z "$myuname" && myuname=`hostname 2>/dev/null`
2966 # tr '[A-Z]' '[a-z]' would not work in EBCDIC
2967 # because the A-Z/a-z are not consecutive.
2968 myuname=`echo $myuname | $sed -e 's/^[^=]*=//' -e 's/\///g' | \
2969 ./tr '[A-Z]' '[a-z]' | $tr $trnl ' '`
2970 newmyuname="$myuname"
2972 case "$knowitall" in
2974 if test -f ../config.sh; then
2975 if $contains myuname= ../config.sh >/dev/null 2>&1; then
2976 eval "`grep myuname= ../config.sh`"
2978 if test "X$myuname" = "X$newmyuname"; then
2986 : Get old answers from old config file if Configure was run on the
2987 : same system, otherwise use the hints.
2990 if test -f config.sh; then
2992 rp="I see a config.sh file. Shall I use it to set the defaults?"
2995 n*|N*) echo "OK, I'll ignore it."
2996 mv config.sh config.sh.old
2997 myuname="$newmyuname"
2999 *) echo "Fetching default answers from your old config.sh file..." >&4
3007 : Older versions did not always set $sh. Catch re-use of such
3017 if test ! -f config.sh; then
3020 First time through, eh? I have some defaults handy for some systems
3021 that need some extra help getting the Configure answers right:
3024 (cd $src/hints; ls -C *.sh) | $sed 's/\.sh/ /g' >&4
3026 : Half the following guesses are probably wrong... If you have better
3027 : tests or hints, please send them to perlbug@perl.org
3028 : The metaconfig authors would also appreciate a copy...
3029 $test -f /irix && osname=irix
3030 $test -f /xenix && osname=sco_xenix
3031 $test -f /dynix && osname=dynix
3032 $test -f /dnix && osname=dnix
3033 $test -f /lynx.os && osname=lynxos
3034 $test -f /unicos && osname=unicos && osvers=`$uname -r`
3035 $test -f /unicosmk && osname=unicosmk && osvers=`$uname -r`
3036 $test -f /unicosmk.ar && osname=unicosmk && osvers=`$uname -r`
3037 $test -f /bin/mips && /bin/mips && osname=mips
3038 $test -d /NextApps && set X `hostinfo | grep 'NeXT Mach.*:' | \
3039 $sed -e 's/://' -e 's/\./_/'` && osname=next && osvers=$4
3040 $test -d /usr/apollo/bin && osname=apollo
3041 $test -f /etc/saf/_sactab && osname=svr4
3042 $test -d /usr/include/minix && osname=minix
3043 $test -f /system/gnu_library/bin/ar.pm && osname=vos
3044 if $test -d /MachTen -o -d /MachTen_Folder; then
3046 if $test -x /sbin/version; then
3047 osvers=`/sbin/version | $awk '{print $2}' |
3048 $sed -e 's/[A-Za-z]$//'`
3049 elif $test -x /usr/etc/version; then
3050 osvers=`/usr/etc/version | $awk '{print $2}' |
3051 $sed -e 's/[A-Za-z]$//'`
3057 $test -f /sys/posix.dll &&
3058 $test -f /usr/bin/what &&
3059 set X `/usr/bin/what /sys/posix.dll` &&
3060 $test "$3" = UWIN &&
3064 if $test -f $uname; then
3072 umips) osname=umips ;;
3075 [23]100) osname=mips ;;
3076 next*) osname=next ;;
3078 tmp=`/bin/uname -X 2>/dev/null|awk '/3\.2v[45]/{ print $(NF) }'`
3079 if $test "$tmp" != "" -a "$3" = "3.2" -a -f '/etc/systemid'; then
3082 elif $test -f /etc/kconfig; then
3084 if test "$lns" = "$ln -s"; then
3086 elif $contains _SYSV3 /usr/include/stdio.h > /dev/null 2>&1 ; then
3088 elif $contains _POSIX_SOURCE /usr/include/stdio.h > /dev/null 2>&1 ; then
3095 if test -n "$DJGPP"; then
3104 tmp=`( (oslevel) 2>/dev/null || echo "not found") 2>&1`
3106 # oslevel can fail with:
3107 # oslevel: Unable to acquire lock.
3108 *not\ found) osvers="$4"."$3" ;;
3109 '<3240'|'<>3240') osvers=3.2.0 ;;
3110 '=3240'|'>3240'|'<3250'|'<>3250') osvers=3.2.4 ;;
3111 '=3250'|'>3250') osvers=3.2.5 ;;
3115 bsd386) osname=bsd386
3118 cygwin*) osname=cygwin
3121 *dc.osx) osname=dcosx
3127 domainos) osname=apollo
3133 dynixptx*) osname=dynixptx
3134 osvers=`echo "$4"|sed 's/^v//'`
3136 freebsd) osname=freebsd
3138 genix) osname=genix ;;
3142 osvers=`echo "$3" | $sed 's,.*\.\([0-9]*\.[0-9]*\),\1,'`
3158 netbsd*) osname=netbsd
3161 news-os) osvers="$3"
3163 4*) osname=newsos4 ;;
3167 next*) osname=next ;;
3168 nonstop-ux) osname=nonstopux ;;
3169 openbsd) osname=openbsd
3175 POSIX-BC | posix-bc ) osname=posix-bc
3178 powerux | power_ux | powermax_os | powermaxos | \
3179 powerunix | power_unix) osname=powerux
3185 solaris) osname=solaris
3187 5*) osvers=`echo $3 | $sed 's/^5/2/g'` ;;
3194 osvers=`echo $3 | $sed 's/^5/2/g'` ;;
3198 titanos) osname=titanos
3207 ultrix) osname=ultrix
3210 osf1|mls+) case "$5" in
3213 osvers=`sizer -v | awk -FUNIX '{print $2}' | awk '{print $1}' | tr '[A-Z]' '[a-z]' | sed 's/^[xvt]//'`
3216 *) osvers=`echo "$3" | sed 's/^[xvt]//'` ;;
3219 hp*) osname=hp_osf1 ;;
3220 mips) osname=mips_osf1 ;;
3223 # UnixWare 7.1.2 is known as Open UNIX 8
3224 openunix|unixware) osname=svr5
3232 $2) case "$osname" in
3236 : svr4.x or possibly later
3246 if test -f /stand/boot ; then
3247 eval `grep '^INITPROG=[a-z/0-9]*$' /stand/boot`
3248 if test -n "$INITPROG" -a -f "$INITPROG"; then
3249 isesix=`strings -a $INITPROG|grep 'ESIX SYSTEM V/386 Release 4.0'`
3250 if test -n "$isesix"; then
3258 *) if test -f /etc/systemid; then
3260 set `echo $3 | $sed 's/\./ /g'` $4
3261 if $test -f $src/hints/sco_$1_$2_$3.sh; then
3263 elif $test -f $src/hints/sco_$1_$2.sh; then
3265 elif $test -f $src/hints/sco_$1.sh; then
3270 '') : Still unknown. Probably a generic Sys V.
3279 *) case "$osname" in
3280 '') : Still unknown. Probably a generic BSD.
3288 if test -f /vmunix -a -f $src/hints/news_os.sh; then
3289 (what /vmunix | UU/tr '[A-Z]' '[a-z]') > UU/kernel.what 2>&1
3290 if $contains news-os UU/kernel.what >/dev/null 2>&1; then
3293 $rm -f UU/kernel.what
3294 elif test -d c:/. -o -n "$is_os2" ; then
3301 case "$targetarch" in
3304 osname=`echo $targetarch|sed 's,^[^-]*-,,'`
3309 : Now look for a hint file osname_osvers, unless one has been
3310 : specified already.
3313 file=`echo "${osname}_${osvers}" | $sed -e 's%\.%_%g' -e 's%_$%%'`
3314 : Also try without trailing minor version numbers.
3315 xfile=`echo $file | $sed -e 's%_[^_]*$%%'`
3316 xxfile=`echo $xfile | $sed -e 's%_[^_]*$%%'`
3317 xxxfile=`echo $xxfile | $sed -e 's%_[^_]*$%%'`
3318 xxxxfile=`echo $xxxfile | $sed -e 's%_[^_]*$%%'`
3321 *) case "$osvers" in
3324 *) if $test -f $src/hints/$file.sh ; then
3326 elif $test -f $src/hints/$xfile.sh ; then
3328 elif $test -f $src/hints/$xxfile.sh ; then
3330 elif $test -f $src/hints/$xxxfile.sh ; then
3332 elif $test -f $src/hints/$xxxxfile.sh ; then
3334 elif $test -f "$src/hints/${osname}.sh" ; then
3343 if $test -f Policy.sh ; then
3346 none) dflt="Policy" ;;
3347 *) dflt="Policy $dflt" ;;
3352 dflt=`echo $hintfile | $sed 's/\.sh$//'`
3356 if $test -f Policy.sh ; then
3359 There's also a Policy hint file available, which should make the
3360 site-specific (policy) questions easier to answer.
3367 You may give one or more space-separated answers, or "none" if appropriate.
3368 A well-behaved OS will have no hints, so answering "none" or just "Policy"
3369 is a good thing. DO NOT give a wrong version or a wrong OS.
3373 rp="Which of these apply, if any?"
3376 for file in $tans; do
3377 if $test X$file = XPolicy -a -f Policy.sh; then
3379 $cat Policy.sh >> UU/config.sh
3380 elif $test -f $src/hints/$file.sh; then
3381 . $src/hints/$file.sh
3382 $cat $src/hints/$file.sh >> UU/config.sh
3383 elif $test X"$tans" = X -o X"$tans" = Xnone ; then
3386 : Give one chance to correct a possible typo.
3387 echo "$file.sh does not exist"
3389 rp="hint to use instead?"
3391 for file in $ans; do
3392 if $test -f "$src/hints/$file.sh"; then
3393 . $src/hints/$file.sh
3394 $cat $src/hints/$file.sh >> UU/config.sh
3395 elif $test X$ans = X -o X$ans = Xnone ; then
3398 echo "$file.sh does not exist -- ignored."
3405 : Remember our hint file for later.
3406 if $test -f "$src/hints/$file.sh" ; then
3416 echo "Fetching default answers from $config_sh..." >&4
3420 cp $config_sh config.sh 2>/dev/null
3430 test "$override" && . ./optdef.sh
3432 : Restore computed paths
3433 for file in $loclist $trylist; do
3434 eval $file="\$_$file"
3439 Configure uses the operating system name and version to set some defaults.
3440 The default value is probably right if the name rings a bell. Otherwise,
3441 since spelling matters for me, either accept the default or answer "none"
3448 ''|' '|none) dflt=none ;;
3449 *) dflt=`echo $hintfile | $sed -e 's/\.sh$//' -e 's/_.*$//'` ;;
3452 *) dflt="$osname" ;;
3454 rp="Operating system name?"
3458 *) osname=`echo "$ans" | $sed -e 's/[ ][ ]*/_/g' | ./tr '[A-Z]' '[a-z]'`;;
3464 ''|' '|none) dflt=none ;;
3465 *) dflt=`echo $hintfile | $sed -e 's/\.sh$//' -e 's/^[^_]*//'`
3466 dflt=`echo $dflt | $sed -e 's/^_//' -e 's/_/./g'`
3468 ''|' ') dflt=none ;;
3473 *) dflt="$osvers" ;;
3475 rp="Operating system version?"
3485 : who configured the system
3486 cf_time=`LC_ALL=C; LANGUAGE=C; export LC_ALL; export LANGUAGE; $date 2>&1`
3489 cf_by=`(logname) 2>/dev/null`
3492 cf_by=`(whoami) 2>/dev/null`
3494 "") cf_by=unknown ;;
3499 : set up the script used to warn in case of inconsistency
3506 echo "*** WHOA THERE!!! ***" >&4
3507 echo " The $hint value for \$$var on this machine was \"$was\"!" >&4
3508 rp=" Keep the $hint value?"
3511 y) td=$was; tu=$was;;
3515 : function used to set $1 to $val
3516 setvar='var=$1; eval "was=\$$1"; td=$define; tu=$undef;
3518 $define$undef) . ./whoa; eval "$var=\$td";;
3519 $undef$define) . ./whoa; eval "$var=\$tu";;
3520 *) eval "$var=$val";;
3524 $define|true|[yY]*) dflt='y';;
3529 Perl can be built to use the SOCKS proxy protocol library. To do so,
3530 Configure must be run with -Dusesocks. If you use SOCKS you also need
3531 to use the PerlIO abstraction layer, this will be implicitly selected.
3533 If this doesn't make any sense to you, just accept the default '$dflt'.
3535 rp='Build Perl for SOCKS?'
3538 y|Y) val="$define" ;;
3545 $define|true|[yY]*) useperlio="$define";;
3548 case "$useperlio" in
3549 $define|true|[yY]*|'') dflt='y';;
3554 Previous version of $package used the standard IO mechanisms as
3555 defined in <stdio.h>. Versions 5.003_02 and later of $package allow
3556 alternate IO mechanisms via the PerlIO abstraction layer, but the
3557 stdio mechanism is still available if needed. The abstraction layer
3558 can use AT&T's sfio (if you already have sfio installed) or regular stdio.
3559 Using PerlIO with sfio may cause problems with some extension modules.
3561 If this doesn't make any sense to you, just accept the default '$dflt'.
3563 rp='Use the PerlIO abstraction layer?'
3570 echo "Ok, doing things the stdio way."
3579 case "$useperlio" in
3580 $define|true|[yY]*) ;;
3583 You are using the SOCKS proxy protocol library which means that you
3584 should also use the PerlIO layer. You may be headed for trouble.
3593 case "$usethreads" in
3594 $define|true|[yY]*) dflt='y';;
3595 *) # Catch case where user specified ithreads or 5005threads but
3596 # forgot -Dusethreads (A.D. 4/2002)
3597 case "$useithreads$use5005threads" in
3599 case "$useperlio" in
3600 "$define") dflt='y' ;;
3610 Perl can be built to take advantage of threads on some systems.
3611 To do so, Configure can be run with -Dusethreads.
3613 Note that Perl built with threading support runs slightly slower
3614 and uses more memory than plain Perl. The current implementation
3615 is believed to be stable, but it is fairly new, and so should be
3616 treated with caution.
3618 If this doesn't make any sense to you, just accept the default '$dflt'.
3620 rp='Build a threading Perl?'
3623 y|Y) val="$define" ;;
3629 case "$usethreads" in
3633 Since release 5.6, Perl has had two different threading implementations,
3634 the newer interpreter-based version (ithreads) with one interpreter per
3635 thread, and the older 5.005 version (5005threads).
3636 The 5005threads version is effectively unmaintained and will probably be
3637 removed in Perl 5.10, so there should be no need to build a Perl using it
3638 unless needed for backwards compatibility with some existing 5.005threads
3642 : Default to ithreads unless overridden on command line or with
3645 case "$use5005threads" in
3646 $define|true|[yY]*) dflt='n';;
3648 case "$useithreads" in
3649 $undef|false|[nN]*) dflt='n';;
3651 rp='Use the newer interpreter-based ithreads?'
3654 y|Y) val="$define" ;;
3659 : Now set use5005threads to the opposite value.
3660 case "$useithreads" in
3661 $define) val="$undef" ;;
3668 useithreads="$undef"
3669 use5005threads="$undef"
3673 case "$useithreads$use5005threads" in
3677 You cannot have both the ithreads and the 5.005 threads enabled
3678 at the same time. Disabling the 5.005 threads since they are
3679 much less stable than the ithreads.
3682 use5005threads="$undef"
3686 if test X"$usethreads" = "X$define" -a "X$useperlio" = "Xundef"; then
3689 *** To build with ithreads you must also use the PerlIO layer.
3690 *** Cannot continue, aborting.
3696 case "$d_oldpthreads" in
3697 '') : Configure tests would be welcome here. For now, assume undef.
3699 *) val="$d_oldpthreads" ;;
3705 : Look for a hint-file generated 'call-back-unit'. If the
3706 : user has specified that a threading perl is to be built,
3707 : we may need to set or change some other defaults.
3708 if $test -f usethreads.cbu; then
3709 echo "Your platform has some specific hints regarding threaded builds, using them..."
3712 case "$usethreads" in
3713 "$define"|true|[yY]*)
3715 (Your platform does not have any specific hints for threaded builds.
3716 Assuming POSIX threads, then.)
3724 Perl can be built so that multiple Perl interpreters can coexist
3725 within the same Perl executable.
3728 case "$useithreads" in
3731 This multiple interpreter support is required for interpreter-based threads.
3735 *) case "$usemultiplicity" in
3736 $define|true|[yY]*) dflt='y';;
3740 echo "If this doesn't make any sense to you, just accept the default '$dflt'."
3741 rp='Build Perl for multiplicity?'
3744 y|Y) val="$define" ;;
3753 case "$usemorebits" in
3754 "$define"|true|[yY]*)
3755 use64bitint="$define"
3756 uselongdouble="$define"
3757 usemorebits="$define"
3759 *) usemorebits="$undef"
3763 : make some quick guesses about what we are up against
3765 $echo $n "Hmm... $c"
3775 $cat /usr/include/signal.h /usr/include/sys/signal.h >foo 2>/dev/null
3776 if test -f /osf_boot || $contains 'OSF/1' /usr/include/ctype.h >/dev/null 2>&1
3778 echo "Looks kind of like an OSF/1 system, but we'll see..."
3780 elif test `echo abc | $tr a-z A-Z` = Abc ; then
3781 xxx=`./loc addbib blurfl $pth`
3782 if $test -f $xxx; then
3783 echo "Looks kind of like a USG system with BSD features, but we'll see..."
3787 if $contains SIGTSTP foo >/dev/null 2>&1 ; then
3788 echo "Looks kind of like an extended USG system, but we'll see..."
3790 echo "Looks kind of like a USG system, but we'll see..."
3794 elif $contains SIGTSTP foo >/dev/null 2>&1 ; then
3795 echo "Looks kind of like a BSD system, but we'll see..."
3799 echo "Looks kind of like a Version 7 system, but we'll see..."
3802 case "$eunicefix" in
3805 There is, however, a strange, musty smell in the air that reminds me of
3806 something...hmm...yes...I've got it...there's a VMS nearby, or I'm a Blit.
3810 : it so happens the Eunice I know will not run shell scripts in Unix format
3814 echo "Congratulations. You aren't running Eunice."
3818 : Detect OS2. The p_ variable is set above in the Head.U unit.
3819 : Note that this also -- wrongly -- detects e.g. dos-djgpp, which also uses
3820 : semicolon as a patch separator
3825 I have the feeling something is not exactly right, however...don't tell me...
3826 lemme think...does HAL ring a bell?...no, of course, you're only running OS/2!
3827 (Or you may be running DOS with DJGPP.)
3832 if test -f /xenix; then
3833 echo "Actually, this looks more like a XENIX system..."
3838 echo "It's not Xenix..."
3843 if test -f /venix; then
3844 echo "Actually, this looks more like a VENIX system..."
3851 echo "Nor is it Venix..."
3854 chmod +x bsd usg v7 osf1 eunice xenix venix os2
3855 $eunicefix bsd usg v7 osf1 eunice xenix venix os2
3862 rp="Use which C compiler?"
3866 : See if they have not cc but they do have gcc
3868 : Look for a hint-file generated 'call-back-unit'. Now that the
3869 : user has specified the compiler, we may need to set or change some
3871 if $test -f cc.cbu; then
3877 echo "Checking for GNU cc in disguise and/or its version number..." >&4
3883 printf("%s\n", __VERSION__);
3885 printf("%s\n", "1");
3891 if $cc -o try $ccflags $ldflags try.c; then
3892 gccversion=`$run ./try`
3893 case "$gccversion" in
3894 '') echo "You are not using GNU cc." ;;
3895 *) echo "You are using GNU cc $gccversion."
3901 echo "*** WHOA THERE!!! ***" >&4
3902 echo " Your C compiler \"$cc\" doesn't seem to be working!" >&4
3903 case "$knowitall" in
3905 echo " You'd better start hunting for one and let me know about it." >&4
3911 case "$gccversion" in
3912 1*) cpp=`./loc gcc-cpp $cpp $pth` ;;
3914 case "$gccversion" in
3915 '') gccosandvers='' ;;
3916 *) gccshortvers=`echo "$gccversion"|sed 's/ .*//'`
3917 gccosandvers=`$cc -v 2>&1|grep '/specs$'|sed "s!.*/[^-/]*-[^-/]*-\([^-/]*\)/$gccshortvers/specs!\1!"`
3919 case "$gccosandvers" in
3920 $osname) gccosandvers='' ;; # linux gccs seem to have no linux osvers, grr
3921 $osname$osvers) ;; # looking good
3922 $osname*) cat <<EOM >&4
3924 *** WHOA THERE!!! ***
3926 Your gcc has not been compiled for the exact release of
3927 your operating system ($gccosandvers versus $osname$osvers).
3929 In general it is a good idea to keep gcc synchronized with
3930 the operating system because otherwise serious problems
3931 may ensue when trying to compile software, like Perl.
3933 I'm trying to be optimistic here, though, and will continue.
3934 If later during the configuration and build icky compilation
3935 problems appear (headerfile conflicts being the most common
3936 manifestation), I suggest reinstalling the gcc to match
3937 your operating system release.
3941 *) gccosandvers='' ;; # failed to parse, better be silent
3949 # gcc 3.* complain about adding -Idirectories that they already know about,
3950 # so we will take those off from locincpth.
3951 case "$gccversion" in
3953 echo "main(){}">try.c
3954 for incdir in $locincpth; do
3955 warn=`$cc $ccflags -I$incdir -c try.c 2>&1 | \
3956 grep '^c[cp]p*[01]: warning: changing search order '`
3957 if test "X$warn" != X; then
3958 locincpth=`echo " $locincpth " | sed "s! $incdir ! !"`
3964 : decide how portable to be. Allow command line overrides.
3965 case "$d_portable" in
3967 *) d_portable="$define" ;;
3970 : set up shell script to do ~ expansion
3976 echo \$1 | $sed "s|~|\${HOME-\$LOGDIR}|"
3979 if $test -f /bin/csh; then
3980 /bin/csh -f -c "glob \$1"
3985 name=\`$expr x\$1 : '..\([^/]*\)'\`
3986 dir=\`$sed -n -e "/^\${name}:/{s/^[^:]*:[^:]*:[^:]*:[^:]*:[^:]*:\([^:]*\).*"'\$'"/\1/" -e p -e q -e '}' </etc/passwd\`
3987 if $test ! -d "\$dir"; then
3989 echo "\$me: can't locate home directory for: \$name" >&2
3994 echo \$dir/\`$expr x\$1 : '..[^/]*/\(.*\)'\`
4010 : now set up to get a file name
4014 cat <<'EOSC' >>getfile
4030 : getfile will accept an answer from the comma-separated list
4031 : enclosed in parentheses even if it does not meet other criteria.
4032 expr "$fn" : '.*(\(.*\)).*' | $tr ',' $trnl >getfile.ok
4033 fn=`echo $fn | sed 's/(.*)//'`
4039 loc_file=`expr $fn : '.*:\(.*\)'`
4040 fn=`expr $fn : '\(.*\):.*'`
4048 */*) fullpath=true;;
4057 *e*) exp_file=true;;
4060 *p*) nopath_ok=true;;
4065 *d*) type='Directory';;
4066 *l*) type='Locate';;
4071 Locate) what='File';;
4076 case "$d_portable" in
4084 while test "$type"; do
4089 true) rp="$rp (~name ok)";;
4092 if test -f UU/getfile.ok && \
4093 $contains "^$ans\$" UU/getfile.ok >/dev/null 2>&1
4112 value=`UU/filexp $ans`
4115 if test "$ans" != "$value"; then
4116 echo "(That expands to $value on this system.)"
4130 /*) value="$ansexp" ;;
4131 [a-zA-Z]:/*) value="$ansexp" ;;
4136 echo "I shall only accept a full path name, as in /bin/ls." >&4
4137 echo "Use a ! shell escape if you wish to check pathnames." >&4
4140 echo "Please give a full path name, starting with slash." >&4
4143 echo "Note that using ~name is ok provided it expands well." >&4
4156 for fp in $gfpth; do
4157 if test "X$fp" = X.; then
4162 if test -f "$pf"; then
4164 elif test -r "$pf" || (test -h "$pf") >/dev/null 2>&1
4166 echo "($value is not a plain file, but that's ok.)"
4169 if test X"$type" = X; then
4176 for fp in $gfpth; do
4177 if test "X$fp" = X.; then
4182 direxp="$fp/$ansexp"
4184 if test -d "$direxp"; then
4192 if test -d "$ansexp"; then
4193 echo "(Looking for $loc_file in directory $value.)"
4194 value="$value/$loc_file"
4195 ansexp="$ansexp/$loc_file"
4197 if test -f "$ansexp"; then
4200 case "$nopath_ok" in
4201 true) case "$value" in
4203 *) echo "Assuming $value will be in people's path."
4219 if test "$fastread" = yes; then
4224 rp="$what $value doesn't exist. Use that name anyway?"
4243 test "X$gfpthkeep" != Xy && gfpth=""
4246 : What should the include directory be ?
4248 $echo $n "Hmm... $c"
4252 if $test -f /bin/mips && /bin/mips; then
4253 echo "Looks like a MIPS system..."
4254 $cat >usr.c <<'EOCP'
4255 #ifdef SYSTYPE_BSD43
4259 if cc -E usr.c > usr.out && $contains / usr.out >/dev/null 2>&1; then
4260 dflt='/bsd43/usr/include'
4264 mips_type='System V'
4266 $rm -f usr.c usr.out
4267 echo "and you're compiling with the $mips_type compiler and libraries."
4271 echo "Doesn't look like a MIPS system."
4281 case "$xxx_prompt" in
4284 rp='Where are the include files you want to use?'
4292 : see how we invoke the C preprocessor
4294 echo "Now, how can we feed standard input to your C preprocessor..." >&4
4295 cat <<'EOT' >testcpp.c
4301 if test ! -f cppstdin; then
4302 if test "X$osname" = "Xaix" -a "X$gccversion" = X; then
4303 # AIX cc -E doesn't show the absolute headerfile
4304 # locations but we'll cheat by using the -M flag.
4305 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
4307 echo 'cat >.$$.c; '"$cc"' -E ${1+"$@"} .$$.c; rm .$$.c' >cppstdin
4310 echo "Keeping your $hint cppstdin wrapper."
4313 wrapper=`pwd`/cppstdin
4317 if $test "X$cppstdin" != "X" && \
4318 $cppstdin $cppminus <testcpp.c >testcpp.out 2>&1 && \
4319 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
4321 echo "You used to use $cppstdin $cppminus so we'll use that again."
4323 '') echo "But let's see if we can live without a wrapper..." ;;
4325 if $cpprun $cpplast <testcpp.c >testcpp.out 2>&1 && \
4326 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
4328 echo "(And we'll use $cpprun $cpplast to preprocess directly.)"
4331 echo "(However, $cpprun $cpplast does not work, let's see...)"
4339 echo "Good old $cppstdin $cppminus does not seem to be of any help..."
4346 elif echo 'Maybe "'"$cc"' -E" will work...'; \
4347 $cc -E <testcpp.c >testcpp.out 2>&1; \
4348 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4349 echo "Yup, it does."
4352 elif echo 'Nope...maybe "'"$cc"' -E -" will work...'; \
4353 $cc -E - <testcpp.c >testcpp.out 2>&1; \
4354 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4355 echo "Yup, it does."
4358 elif echo 'Nope...maybe "'"$cc"' -P" will work...'; \
4359 $cc -P <testcpp.c >testcpp.out 2>&1; \
4360 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4361 echo "Yipee, that works!"
4364 elif echo 'Nope...maybe "'"$cc"' -P -" will work...'; \
4365 $cc -P - <testcpp.c >testcpp.out 2>&1; \
4366 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4367 echo "At long last!"
4370 elif echo 'No such luck, maybe "'$cpp'" will work...'; \
4371 $cpp <testcpp.c >testcpp.out 2>&1; \
4372 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4376 elif echo 'Nixed again...maybe "'$cpp' -" will work...'; \
4377 $cpp - <testcpp.c >testcpp.out 2>&1; \
4378 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4379 echo "Hooray, it works! I was beginning to wonder."
4382 elif echo 'Uh-uh. Time to get fancy. Trying a wrapper...'; \
4383 $wrapper <testcpp.c >testcpp.out 2>&1; \
4384 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4390 rp="No dice. I can't find a C preprocessor. Name one:"
4394 $x_cpp <testcpp.c >testcpp.out 2>&1
4395 if $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4396 echo "OK, that will do." >&4
4398 echo "Sorry, I can't get that to work. Go find one and rerun Configure." >&4
4413 echo "Perhaps can we force $cc -E using a wrapper..."
4414 if $wrapper <testcpp.c >testcpp.out 2>&1; \
4415 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
4421 echo "Nope, we'll have to live without it..."
4435 "$wrapper"|'cppstdin') ;;
4436 *) $rm -f $wrapper;;
4438 $rm -f testcpp.c testcpp.out
4440 : Set private lib path
4443 plibpth="$incpath/usr/lib /usr/local/lib /usr/ccs/lib"
4448 '') dlist="$loclibpth $plibpth $glibpth";;
4449 *) dlist="$libpth";;
4452 : Now check and see which directories actually exist, avoiding duplicates
4456 if $test -d $xxx; then
4459 *) libpth="$libpth $xxx";;
4465 Some systems have incompatible or broken versions of libraries. Among
4466 the directories listed in the question below, please remove any you
4467 know not to be holding relevant libraries, and add any that are needed.
4468 Say "none" for none.
4479 rp="Directories to use for library searches?"
4486 : compute shared library extension
4489 if xxx=`./loc libc.sl X $libpth`; $test -f "$xxx"; then
4499 On some systems, shared libraries may be available. Answer 'none' if
4500 you want to suppress searching of shared libraries for the remainder
4501 of this configuration.
4504 rp='What is the file extension used for shared libraries?'
4508 : Define several unixisms.
4509 : Hints files or command line option can be used to override them.
4510 : The convoluted testing is in case hints files set either the old
4513 '') case "$exe_ext" in
4515 *) _exe="$exe_ext" ;;
4520 '') case "$lib_ext" in
4527 '') case "$obj_ext" in
4534 '') case "$path_sep" in
4545 : Which makefile gets called first. This is used by make depend.
4546 case "$firstmakefile" in
4547 '') firstmakefile='makefile';;
4551 *-DUSE_LONG_DOUBLE*|*-DUSE_MORE_BITS*) uselongdouble="$define" ;;
4554 case "$uselongdouble" in
4555 $define|true|[yY]*) dflt='y';;
4560 Perl can be built to take advantage of long doubles which
4561 (if available) may give more accuracy and range for floating point numbers.
4563 If this doesn't make any sense to you, just accept the default '$dflt'.
4565 rp='Try to use long doubles if available?'
4568 y|Y) val="$define" ;;
4574 case "$uselongdouble" in
4575 true|[yY]*) uselongdouble="$define" ;;
4578 : Look for a hint-file generated 'call-back-unit'. If the
4579 : user has specified that long doubles should be used,
4580 : we may need to set or change some other defaults.
4581 if $test -f uselongdouble.cbu; then
4582 echo "Your platform has some specific hints regarding long doubles, using them..."
4583 . ./uselongdouble.cbu
4585 case "$uselongdouble" in
4588 (Your platform does not have any specific hints for long doubles.)
4594 : Looking for optional libraries
4596 echo "Checking for optional libraries..." >&4
4601 case "$libswanted" in
4602 '') libswanted='c_s';;
4605 "$define") libswanted="$libswanted socks5 socks5_sh" ;;
4611 for thisdir in $libpth $xlibpth; do
4612 test -d $thisdir && libspath="$libspath $thisdir"
4614 for thislib in $libswanted; do
4615 for thisdir in $libspath; do
4617 if $test ! -f "$xxx" -a "X$ignore_versioned_solibs" = "X"; then
4618 xxx=`ls $thisdir/lib$thislib.$so.[0-9] 2>/dev/null|sed -n '$p'`
4619 $test -f "$xxx" && eval $libscheck
4620 $test -f "$xxx" && libstyle=shared
4622 if test ! -f "$xxx"; then
4623 xxx=$thisdir/lib$thislib.$so
4624 $test -f "$xxx" && eval $libscheck
4625 $test -f "$xxx" && libstyle=shared
4627 if test ! -f "$xxx"; then
4628 xxx=$thisdir/lib$thislib$_a
4629 $test -f "$xxx" && eval $libscheck
4630 $test -f "$xxx" && libstyle=static
4632 if test ! -f "$xxx"; then
4633 xxx=$thisdir/$thislib$_a
4634 $test -f "$xxx" && eval $libscheck
4635 $test -f "$xxx" && libstyle=static
4637 if test ! -f "$xxx"; then
4638 xxx=$thisdir/lib${thislib}_s$_a
4639 $test -f "$xxx" && eval $libscheck
4640 $test -f "$xxx" && libstyle=static
4641 $test -f "$xxx" && thislib=${thislib}_s
4643 if test ! -f "$xxx"; then
4644 xxx=$thisdir/Slib$thislib$_a
4645 $test -f "$xxx" && eval $libscheck
4646 $test -f "$xxx" && libstyle=static
4648 if $test -f "$xxx"; then
4650 shared) echo "Found -l$thislib (shared)." ;;
4651 static) echo "Found -l$thislib." ;;
4652 *) echo "Found -l$thislib ($libstyle)." ;;
4656 *) dflt="$dflt -l$thislib"
4657 libsfound="$libsfound $xxx"
4659 libsfiles="$libsfiles $yyy"
4660 yyy=`echo $xxx|$sed -e "s%/$yyy\\$%%"`
4661 case " $libsdirs " in
4663 *) libsdirs="$libsdirs $yyy" ;;
4670 if $test ! -f "$xxx"; then
4671 echo "No -l$thislib."
4682 ' '|'') dflt='none';;
4687 In order to compile $package on your machine, a number of libraries
4688 are usually needed. Include any other special libraries here as well.
4689 Say "none" for none. The default list is almost always right.
4693 rp="What libraries to use?"
4700 : determine optimization, if desired, or use for debug flag also
4702 ' '|$undef) dflt='none';;
4704 *) dflt="$optimize";;
4708 By default, $package compiles with the -O flag to use the optimizer.
4709 Alternately, you might want to use the symbolic debugger, which uses
4710 the -g flag (on traditional Unix systems). Either flag can be
4711 specified here. To use neither flag, specify the word "none".
4714 rp="What optimizer/debugger flag should be used?"
4718 'none') optimize=" ";;
4722 : We will not override a previous value, but we might want to
4723 : augment a hint file
4725 default|recommended)
4726 case "$gccversion" in
4727 1*) dflt='-fpcc-struct-return' ;;
4730 *-g*) dflt="$dflt -DDEBUGGING";;
4732 case "$gccversion" in
4733 2*) if test -d /etc/conf/kconfig.d &&
4734 $contains _POSIX_VERSION $usrinc/sys/unistd.h >/dev/null 2>&1
4736 # Interactive Systems (ISC) POSIX mode.
4741 case "$gccversion" in
4745 echo "Checking if your compiler accepts -fno-strict-aliasing" 2>&1
4746 echo 'int main(void) { return 0; }' > gcctest.c
4747 if $cc -O2 -fno-strict-aliasing -o gcctest gcctest.c; then
4748 echo "Yes, it does." 2>&1
4751 echo "Leaving current flags $ccflags alone." 2>&1
4753 *) dflt="$dflt -fno-strict-aliasing" ;;
4756 echo "Nope, it doesn't, but that's ok." 2>&1
4760 # For gcc, adding -pipe speeds up compilations for some, but apparently
4761 # some assemblers can't read from stdin. (It also slows down compilations
4762 # in other cases, but those are apparently rarer these days.) AD 5/2004.
4763 case "$gccversion" in
4765 echo "Checking if your compiler accepts -pipe" 2>&1
4766 echo 'int main(void) { return 0; }' > gcctest.c
4767 if $cc -pipe -o gcctest gcctest.c; then
4768 echo "Yes, it does." 2>&1
4771 echo "Leaving current flags $ccflags alone." 2>&1
4773 *) dflt="$dflt -pipe" ;;
4776 echo "Nope, it doesn't, but that's ok." 2>&1
4779 echo "Checking if your compiler accepts -Wdeclaration-after-statement" 2>&1
4780 echo 'int main(void) { return 0; }' > gcctest.c
4781 if $cc -Wdeclaration-after-statement -o gcctest gcctest.c; then
4782 echo "Yes, it does." 2>&1
4784 *-Wdeclaration-after-statement*)
4785 echo "Leaving current flags $ccflags alone." 2>&1
4787 *) dflt="$dflt -Wdeclaration-after-statement" ;;
4790 echo "Nope, it doesn't, but that's ok." 2>&1
4797 case "$mips_type" in
4798 *BSD*|'') inclwanted="$locincpth $usrinc";;
4799 *) inclwanted="$locincpth $inclwanted $usrinc/bsd";;
4801 for thisincl in $inclwanted; do
4802 if $test -d $thisincl; then
4803 if $test x$thisincl != x$usrinc; then
4805 *" -I$thisincl "*);;
4806 *) dflt="$dflt -I$thisincl ";;
4812 inctest='if $contains $2 $usrinc/$1 >/dev/null 2>&1; then
4814 elif $contains $2 $usrinc/sys/$1 >/dev/null 2>&1; then
4822 *) dflt="$dflt -D$2";;
4826 set signal.h LANGUAGE_C; eval $inctest
4830 ccflags="$ccflags -DSOCKS"
4835 default|recommended) dflt="$ccflags $dflt" ;;
4836 *) dflt="$ccflags";;
4845 Your C compiler may want other flags. For this question you should include
4846 -I/whatever and -DWHATEVER flags and any other flags used by the C compiler,
4847 but you should NOT include libraries or ld flags like -lwhatever. If you
4848 want $package to honor its debug switch, you should include -DDEBUGGING here.
4849 Your C compiler might also need additional flags, such as -D_POSIX_SOURCE.
4851 To use no flags, specify the word "none".
4857 rp="Any additional cc flags?"
4864 : the following weeds options from ccflags that are of no interest to cpp
4866 '') cppflags="$ccflags" ;;
4867 *) cppflags="$cppflags $ccflags" ;;
4869 case "$gccversion" in
4870 1*) cppflags="$cppflags -D__GNUC__"
4872 case "$mips_type" in
4874 *BSD*) cppflags="$cppflags -DSYSTYPE_BSD43";;
4880 echo "Let me guess what the preprocessor flags are..." >&4
4894 *) ftry="$previous $flag";;
4896 if $cppstdin -DLFRULB=bar $cppflags $ftry $cppminus <cpp.c \
4897 >cpp1.out 2>/dev/null && \
4898 $cpprun -DLFRULB=bar $cppflags $ftry $cpplast <cpp.c \
4899 >cpp2.out 2>/dev/null && \
4900 $contains 'foo.*xx.*bar' cpp1.out >/dev/null 2>&1 && \
4901 $contains 'foo.*xx.*bar' cpp2.out >/dev/null 2>&1
4903 cppflags="$cppflags $ftry"
4913 *-*) echo "They appear to be: $cppflags";;
4915 $rm -f cpp.c cpp?.out
4919 : flags used in final linking phase
4921 '') if ./venix; then
4927 *-posix*) dflt="$dflt -posix" ;;
4930 *) dflt="$ldflags";;
4933 : Try to guess additional flags to pick up local libraries.
4934 for thislibdir in $libpth; do
4935 case " $loclibpth " in
4938 *"-L$thislibdir "*) ;;
4939 *) dflt="$dflt -L$thislibdir" ;;
4951 Your C linker may need flags. For this question you should
4952 include -L/whatever and any other flags used by the C linker, but you
4953 should NOT include libraries like -lwhatever.
4955 Make sure you include the appropriate -L/path flags if your C linker
4956 does not normally search all of the directories you specified above,
4959 To use no flags, specify the word "none".
4963 rp="Any additional ld flags (NOT including libraries)?"
4969 rmlist="$rmlist pdp11"
4973 echo "Checking your choice of C compiler and flags for coherency..." >&4
4974 $cat > try.c <<'EOF'
4976 int main() { printf("Ok\n"); return(0); }
4978 set X $cc -o try $optimize $ccflags $ldflags try.c $libs
4980 $cat >try.msg <<'EOM'
4981 I've tried to compile and run the following simple program:
4984 $cat try.c >> try.msg
4986 $cat >> try.msg <<EOM
4993 and I got the following output:
4997 if $sh -c "$cc -o try $optimize $ccflags $ldflags try.c $libs" >>try.msg 2>&1; then
4998 if $sh -c "$run ./try" >>try.msg 2>&1; then
5002 *) echo 'The program compiled OK, but produced no output.' >> try.msg
5005 cat >> try.msg <<'EOQS'
5006 If $libs contains -lsfio, and sfio is mis-configured, then it
5007 sometimes (apparently) runs and exits with a 0 status, but with no
5008 output! It may have to do with sfio's use of _exit vs. exit.
5011 rp="You have a big problem. Shall I abort Configure"
5018 echo "The program compiled OK, but exited with status $?." >>try.msg
5019 rp="You have a problem. Shall I abort Configure"
5023 echo "I can't compile the test program." >>try.msg
5024 rp="You have a BIG problem. Shall I abort Configure"
5030 case "$knowitall" in
5032 echo "(The supplied flags or libraries might be incorrect.)"
5040 *) echo "Ok. Stopping Configure." >&4
5045 n) echo "OK, that should do.";;
5047 $rm -f try try.* core
5049 : define a shorthand compile call
5053 $cc -o ${mc_file} $optimize $ccflags $ldflags $* ${mc_file}.c $libs > /dev/null 2>&1;'
5054 : define a shorthand compile call for compilations that should be ok.
5058 $cc -o ${mc_file} $optimize $ccflags $ldflags $* ${mc_file}.c $libs;'
5060 : determine filename position in cpp output
5062 echo "Computing filename position in cpp output for #include directives..." >&4
5064 vos) testaccess=-e ;;
5067 echo '#include <stdio.h>' > foo.c
5070 $cppstdin $cppflags $cppminus <foo.c 2>/dev/null | \
5071 $grep '^[ ]*#.*stdio\.h' | \
5072 while read cline; do
5075 while $test \$# -gt 0; do
5076 if $test $testaccess \`echo \$1 | $tr -d '"'\`; then
5081 pos=\`expr \$pos + 1\`
5093 *) pos="${fieldn}th";;
5095 echo "Your cpp writes the filename in the $pos field of the line."
5098 vos) cppfilter="tr '\\\\>' '/' |" ;; # path component separator is >
5099 os2) cppfilter="sed -e 's|\\\\\\\\|/|g' |" ;; # path component separator is \
5102 : locate header file
5107 for usrincdir in $usrinc
5109 if test -f \$usrincdir/\$wanted; then
5110 echo "\$usrincdir/\$wanted"
5114 awkprg='{ print \$$fieldn }'
5115 echo "#include <\$wanted>" > foo\$\$.c
5116 $cppstdin $cppminus $cppflags < foo\$\$.c 2>/dev/null | \
5117 $cppfilter $grep "^[ ]*#.*\$wanted" | \
5118 while read cline; do
5119 name=\`echo \$cline | $awk "\$awkprg" | $tr -d '"'\`
5121 *[/\\\\]\$wanted) echo "\$name"; exit 1;;
5122 *[\\\\/]\$wanted) echo "\$name"; exit 1;;
5127 # status = 0: grep returned 0 lines, case statement not executed
5128 # status = 1: headerfile found
5129 # status = 2: while loop executed, no headerfile found
5133 if test \$status -eq 1; then
5140 : define an alternate in-header-list? function
5141 inhdr='echo " "; td=$define; tu=$undef; yyy=$@;
5142 cont=true; xxf="echo \"<\$1> found.\" >&4";
5143 case $# in 2) xxnf="echo \"<\$1> NOT found.\" >&4";;
5144 *) xxnf="echo \"<\$1> NOT found, ...\" >&4";;
5146 case $# in 4) instead=instead;; *) instead="at last";; esac;
5147 while $test "$cont"; do
5149 var=$2; eval "was=\$$2";
5150 if $test "$xxx" && $test -r "$xxx";
5152 eval "case \"\$$var\" in $undef) . ./whoa; esac"; eval "$var=\$td";
5155 eval "case \"\$$var\" in $define) . ./whoa; esac"; eval "$var=\$tu"; fi;
5156 set $yyy; shift; shift; yyy=$@;
5157 case $# in 0) cont="";;
5158 2) xxf="echo \"but I found <\$1> $instead.\" >&4";
5159 xxnf="echo \"and I did not find <\$1> either.\" >&4";;
5160 *) xxf="echo \"but I found <\$1\> instead.\" >&4";
5161 xxnf="echo \"there is no <\$1>, ...\" >&4";;
5165 do set $yyy; var=$2; eval "was=\$$2";
5166 eval "case \"\$$var\" in $define) . ./whoa; esac"; eval "$var=\$tu";
5167 set $yyy; shift; shift; yyy=$@;
5170 : see if stdlib is available
5171 set stdlib.h i_stdlib
5174 : check for lengths of integral types
5178 echo "Checking to see how big your integers are..." >&4
5187 printf("intsize=%d;\n", (int)sizeof(int));
5188 printf("longsize=%d;\n", (int)sizeof(long));
5189 printf("shortsize=%d;\n", (int)sizeof(short));
5194 if eval $compile_ok && $run ./try > /dev/null; then
5196 echo "Your integers are $intsize bytes long."
5197 echo "Your long integers are $longsize bytes long."
5198 echo "Your short integers are $shortsize bytes long."
5202 Help! I can't compile and run the intsize test program: please enlighten me!
5203 (This is probably a misconfiguration in your system or libraries, and
5204 you really ought to fix it. Still, I'll try anyway.)
5208 rp="What is the size of an integer (in bytes)?"
5212 rp="What is the size of a long integer (in bytes)?"
5216 rp="What is the size of a short integer (in bytes)?"
5224 : check for long long
5226 echo "Checking to see if you have long long..." >&4
5227 echo 'int main() { long long x = 7; return 0; }' > try.c
5229 if eval $compile; then
5231 echo "You have long long."
5234 echo "You do not have long long."
5240 : check for length of long long
5241 case "${d_longlong}${longlongsize}" in
5244 echo "Checking to see how big your long longs are..." >&4
5245 $cat >try.c <<'EOCP'
5249 printf("%d\n", (int)sizeof(long long));
5254 if eval $compile_ok; then
5255 longlongsize=`$run ./try`
5256 echo "Your long longs are $longlongsize bytes long."
5260 echo "(I can't seem to compile the test program. Guessing...)"
5261 rp="What is the size of a long long (in bytes)?"
5265 if $test "X$longsize" = "X$longlongsize"; then
5266 echo "(That isn't any different from an ordinary long.)"
5272 : see if inttypes.h is available
5273 : we want a real compile instead of Inhdr because some systems
5274 : have an inttypes.h which includes non-existent headers
5277 #include <inttypes.h>
5279 static int32_t foo32 = 0x12345678;
5283 if eval $compile; then
5284 echo "<inttypes.h> found." >&4
5287 echo "<inttypes.h> NOT found." >&4
5296 echo "Checking to see if you have int64_t..." >&4
5298 #include <sys/types.h>
5299 #$i_inttypes I_INTTYPES
5301 #include <inttypes.h>
5303 int main() { int64_t x = 7; }
5306 if eval $compile; then
5308 echo "You have int64_t."
5311 echo "You do not have int64_t."
5319 echo "Checking which 64-bit integer type we could use..." >&4
5325 val='"unsigned int"'
5330 *) case "$longsize" in
5334 val='"unsigned long"'
5339 *) case "$d_longlong:$longlongsize" in
5344 val='"unsigned long long"'
5349 *) case "$d_int64_t" in
5368 '') echo "Alas, no 64-bit integer types in sight." >&4
5371 *) echo "We could use '$quadtype' for 64-bit integers." >&4
5377 case "$uselonglong" in
5378 "$define"|true|[yY]*)
5381 *** Configure -Duselonglong is deprecated, using -Duse64bitint instead.
5383 use64bitint="$define"
5386 case "$use64bits" in
5387 "$define"|true|[yY]*)
5390 *** Configure -Duse64bits is deprecated, using -Duse64bitint instead.
5392 use64bitint="$define"
5395 case "$use64bitints" in
5396 "$define"|true|[yY]*)
5399 *** There is no Configure -Duse64bitints, using -Duse64bitint instead.
5401 use64bitint="$define"
5404 case "$use64bitsint" in
5405 "$define"|true|[yY]*)
5408 *** There is no Configure -Duse64bitsint, using -Duse64bitint instead.
5410 use64bitint="$define"
5413 case "$uselonglongs" in
5414 "$define"|true|[yY]*)
5417 *** There is no Configure -Duselonglongs, using -Duse64bitint instead.
5419 use64bitint="$define"
5422 case "$use64bitsall" in
5423 "$define"|true|[yY]*)
5426 *** There is no Configure -Duse64bitsall, using -Duse64bitall instead.
5428 use64bitall="$define"
5433 *-DUSE_LONG_LONG*|*-DUSE_64_BIT_INT*|*-DUSE_64_BIT_ALL*) use64bitint="$define";;
5435 case "$use64bitall" in
5436 "$define"|true|[yY]*) use64bitint="$define" ;;
5442 You have natively 64-bit long integers.
5446 *) case "$use64bitint" in
5447 "$define"|true|[yY]*) dflt='y';;
5456 Perl can be built to take advantage of 64-bit integer types
5457 on some systems. To do so, Configure can be run with -Duse64bitint.
5458 Choosing this option will most probably introduce binary incompatibilities.
5460 If this doesn't make any sense to you, just accept the default '$dflt'.
5461 (The default has been chosen based on your configuration.)
5463 rp='Try to use 64-bit integers, if available?'
5466 [yY]*) val="$define" ;;
5474 case "$use64bitall" in
5475 "$define"|true|[yY]*) dflt='y' ;;
5476 *) case "$longsize" in
5484 You may also choose to try maximal 64-bitness. It means using as much
5485 64-bitness as possible on the platform. This in turn means even more
5486 binary incompatibilities. On the other hand, your platform may not
5487 have any more 64-bitness available than what you already have chosen.
5489 If this doesn't make any sense to you, just accept the default '$dflt'.
5490 (The default has been chosen based on your configuration.)
5492 rp='Try to use maximal 64-bit support, if available?'
5495 [yY]*) val="$define" ;;
5500 case "$use64bitall" in
5502 case "$use64bitint" in
5506 Since you have chosen a maximally 64-bit build, I'm also turning on
5507 the use of 64-bit integers.
5509 use64bitint="$define" ;;
5514 : Look for a hint-file generated 'call-back-unit'. If the
5515 : user has specified that a 64-bit perl is to be built,
5516 : we may need to set or change some other defaults.
5517 if $test -f use64bitint.cbu; then
5518 echo "Your platform has some specific hints regarding 64-bit integers, using them..."
5521 case "$use64bitint" in
5522 "$define"|true|[yY]*)
5524 4) case "$archname64" in
5525 '') archname64=64int ;;
5532 : Look for a hint-file generated 'call-back-unit'. If the
5533 : user has specified that a maximally 64-bit perl is to be built,
5534 : we may need to set or change some other defaults.
5535 if $test -f use64bitall.cbu; then
5536 echo "Your platform has some specific hints regarding 64-bit builds, using them..."
5539 case "$use64bitall" in
5540 "$define"|true|[yY]*)
5542 4) case "$archname64" in
5543 ''|64int) archname64=64all ;;
5550 case "$d_quad:$use64bitint" in
5554 *** You have chosen to use 64-bit integers,
5555 *** but none can be found.
5556 *** Please rerun Configure without -Duse64bitint and/or -Dusemorebits.
5557 *** Cannot continue, aborting.
5564 : check for length of double
5566 case "$doublesize" in
5568 echo "Checking to see how big your double precision numbers are..." >&4
5577 printf("%d\n", (int)sizeof(double));
5582 if eval $compile_ok; then
5583 doublesize=`$run ./try`
5584 echo "Your double is $doublesize bytes long."
5587 echo "(I can't seem to compile the test program. Guessing...)"
5588 rp="What is the size of a double precision number (in bytes)?"
5596 : check for long doubles
5598 echo "Checking to see if you have long double..." >&4
5599 echo 'int main() { long double x = 7.0; }' > try.c
5601 if eval $compile; then
5603 echo "You have long double."
5606 echo "You do not have long double."
5612 : check for length of long double
5613 case "${d_longdbl}${longdblsize}" in
5616 echo "Checking to see how big your long doubles are..." >&4
5617 $cat >try.c <<'EOCP'
5621 printf("%d\n", sizeof(long double));
5626 if eval $compile; then
5627 longdblsize=`$run ./try`
5628 echo "Your long doubles are $longdblsize bytes long."
5632 echo "(I can't seem to compile the test program. Guessing...)" >&4
5633 rp="What is the size of a long double (in bytes)?"
5637 if $test "X$doublesize" = "X$longdblsize"; then
5638 echo "That isn't any different from an ordinary double."
5639 echo "I'll keep your setting anyway, but you may see some"
5640 echo "harmless compilation warnings."
5646 : determine the architecture name
5648 if xxx=`./loc arch blurfl $pth`; $test -f "$xxx"; then
5649 tarch=`arch`"-$osname"
5650 elif xxx=`./loc uname blurfl $pth`; $test -f "$xxx" ; then
5651 if uname -m > tmparch 2>&1 ; then
5652 tarch=`$sed -e 's/ *$//' -e 's/ /_/g' \
5653 -e 's/$/'"-$osname/" tmparch`
5661 case "$myarchname" in
5664 echo "(Your architecture name used to be $myarchname.)"
5668 case "$targetarch" in
5670 *) archname=`echo $targetarch|sed 's,^[^-]*-,,'` ;;
5675 *) dflt="$archname";;
5677 rp='What is your architecture name'
5680 case "$usethreads" in
5682 echo "Threads selected." >&4
5684 *-thread*) echo "...and architecture name already has -thread." >&4
5686 *) archname="$archname-thread"
5687 echo "...setting architecture name to $archname." >&4
5692 case "$usemultiplicity" in
5694 echo "Multiplicity selected." >&4
5696 *-multi*) echo "...and architecture name already has -multi." >&4
5698 *) archname="$archname-multi"
5699 echo "...setting architecture name to $archname." >&4
5704 case "$use64bitint$use64bitall" in
5706 case "$archname64" in
5708 echo "This architecture is naturally 64-bit, not changing architecture name." >&4
5711 case "$use64bitint" in
5712 "$define") echo "64 bit integers selected." >&4 ;;
5714 case "$use64bitall" in
5715 "$define") echo "Maximal 64 bitness selected." >&4 ;;
5718 *-$archname64*) echo "...and architecture name already has $archname64." >&4
5720 *) archname="$archname-$archname64"
5721 echo "...setting architecture name to $archname." >&4
5727 case "$uselongdouble" in
5729 echo "Long doubles selected." >&4
5730 case "$longdblsize" in
5732 echo "...but long doubles are equal to doubles, not changing architecture name." >&4
5736 *-ld*) echo "...and architecture name already has -ld." >&4
5738 *) archname="$archname-ld"
5739 echo "...setting architecture name to $archname." >&4
5746 case "$useperlio" in
5748 echo "Perlio selected." >&4
5751 echo "Perlio not selected, using stdio." >&4
5753 *-stdio*) echo "...and architecture name already has -stdio." >&4
5755 *) archname="$archname-stdio"
5756 echo "...setting architecture name to $archname." >&4
5761 if $test -f archname.cbu; then
5762 echo "Your platform has some specific hints for architecture name, using them..."
5766 : determine root of directory hierarchy where package will be installed.
5769 dflt=`./loc . /usr/local /usr/local /local /opt /usr`
5772 dflt=`echo "$prefix" | sed 's/.$//'`
5780 By default, $package will be installed in $dflt/bin, manual pages
5781 under $dflt/man, etc..., i.e. with $dflt as prefix for all
5782 installation directories. Typically this is something like /usr/local.
5783 If you wish to have binaries under /usr/bin but other parts of the
5784 installation under /usr/local, that's ok: you will be prompted
5785 separately for each of the installation directories, the prefix being
5786 only used to set the defaults.
5790 rp='Installation prefix to use?'
5798 *) oldprefix="$prefix";;
5807 *) afsroot=$afsroot ;;
5813 $define|true) afs=true ;;
5814 $undef|false) afs=false ;;
5815 *) if test -d $afsroot; then
5823 echo "AFS may be running... I'll be extra cautious then..." >&4
5825 echo "AFS does not seem to be running..." >&4
5828 : determine installation prefix for where package is to be installed.
5832 Since you are running AFS, I need to distinguish the directory in which
5833 files will reside from the directory in which they are installed (and from
5834 which they are presumably copied to the former directory by occult means).
5837 case "$installprefix" in
5838 '') dflt=`echo $prefix | sed 's#^/afs/#/afs/.#'`;;
5839 *) dflt="$installprefix";;
5844 In some special cases, particularly when building $package for distribution,
5845 it is convenient to distinguish the directory in which files should be
5846 installed from the directory ($prefix) in which they will
5847 eventually reside. For most users, these two directories are the same.
5850 case "$installprefix" in
5852 *) dflt=$installprefix;;
5856 rp='What installation prefix should I use for installing files?'
5858 installprefix="$ans"
5859 installprefixexp="$ansexp"
5861 : set the prefixit variable, to compute a suitable default value
5862 prefixit='case "$3" in
5864 case "$oldprefix" in
5865 "") eval "$1=\"\$$2\"";;
5872 ""|" ") eval "$1=\"\$$2\"";;
5878 eval "tp=\"$oldprefix-\$$2-\""; eval "tp=\"$tp\"";
5880 --|/*--|\~*--) eval "$1=\"$prefix/$3\"";;
5881 /*-$oldprefix/*|\~*-$oldprefix/*)
5882 eval "$1=\`echo \$$2 | sed \"s,^$oldprefix,$prefix,\"\`";;
5883 *) eval "$1=\"\$$2\"";;
5887 : get the patchlevel
5889 echo "Getting the current patchlevel..." >&4
5890 if $test -r $rsrc/patchlevel.h;then
5891 revision=`awk '/define[ ]+PERL_REVISION/ {print $3}' $rsrc/patchlevel.h`
5892 patchlevel=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
5893 subversion=`awk '/define[ ]+PERL_SUBVERSION/ {print $3}' $rsrc/patchlevel.h`
5894 api_revision=`awk '/define[ ]+PERL_API_REVISION/ {print $3}' $rsrc/patchlevel.h`
5895 api_version=`awk '/define[ ]+PERL_API_VERSION/ {print $3}' $rsrc/patchlevel.h`
5896 api_subversion=`awk '/define[ ]+PERL_API_SUBVERSION/ {print $3}' $rsrc/patchlevel.h`
5897 perl_patchlevel=`grep ',"DEVEL[0-9][0-9]*"' $rsrc/patchlevel.h|sed 's/[^0-9]//g'`
5906 $echo "(You do not have patchlevel.h. Eek.)"
5908 if $test -r $rsrc/.patch ; then
5909 if $test "`cat $rsrc/.patch`" -gt "$perl_patchlevel" ; then
5910 perl_patchlevel=`cat $rsrc/.patch`
5913 : Define a handy string here to avoid duplication in myconfig.SH and configpm.
5914 version_patchlevel_string="version $patchlevel subversion $subversion"
5915 case "$perl_patchlevel" in
5917 *) version_patchlevel_string="$version_patchlevel_string patch $perl_patchlevel" ;;
5920 $echo "(You have $package $version_patchlevel_string.)"
5924 : XXX Should be a Configure test for double-dots in filenames.
5925 version=`echo $revision $patchlevel $subversion | \
5926 $awk '{ printf "%d_%d_%d\n", $1, $2, $3 }'`
5927 api_versionstring=`echo $api_revision $api_version $api_subversion | \
5928 $awk '{ printf "%d_%d_%d\n", $1, $2, $3 }'`
5931 version=`echo $revision $patchlevel $subversion | \
5932 $awk '{ printf "%d.%d.%d\n", $1, $2, $3 }'`
5933 api_versionstring=`echo $api_revision $api_version $api_subversion | \
5934 $awk '{ printf "%d.%d.%d\n", $1, $2, $3 }'`
5937 : Special case the 5.005_xx maintenance series, which used 5.005
5938 : without any subversion label as a subdirectory in $sitelib
5939 if test "${api_revision}${api_version}${api_subversion}" = "550"; then
5940 api_versionstring='5.005'
5943 : determine installation style
5944 : For now, try to deduce it from prefix unless it is already set.
5945 : Reproduce behavior of 5.005 and earlier, maybe drop that in 5.7.
5946 case "$installstyle" in
5947 '') case "$prefix" in
5948 *perl*) dflt='lib';;
5949 *) dflt='lib/perl5' ;;
5952 *) dflt="$installstyle" ;;
5954 : Probably not worth prompting for this since we prompt for all
5955 : the directories individually, and the prompt would be too long and
5959 : determine where private library files go
5960 : Usual default is /usr/local/lib/perl5/$version.
5961 : Also allow things like /opt/perl/lib/$version, since
5962 : /opt/perl/lib/perl5... would be redundant.
5963 : The default "style" setting is made in installstyle.U
5964 case "$installstyle" in
5965 *lib/perl5*) set dflt privlib lib/$package/$version ;;
5966 *) set dflt privlib lib/$version ;;
5971 There are some auxiliary files for $package that need to be put into a
5972 private library directory that is accessible by everyone.
5976 rp='Pathname where the private library files will reside?'
5979 privlibexp="$ansexp"
5980 : Change installation prefix, if necessary.
5981 if $test X"$prefix" != X"$installprefix"; then
5982 installprivlib=`echo $privlibexp | sed "s#^$prefix#$installprefix#"`
5984 installprivlib="$privlibexp"
5987 : set the prefixup variable, to restore leading tilda escape
5988 prefixup='case "$prefixexp" in
5990 *) eval "$1=\`echo \$$1 | sed \"s,^$prefixexp,$prefix,\"\`";;
5993 : determine where public architecture dependent libraries go
5996 : privlib default is /usr/local/lib/$package/$version
5997 : archlib default is /usr/local/lib/$package/$version/$archname
5998 : privlib may have an optional trailing /share.
5999 tdflt=`echo $privlib | $sed 's,/share$,,'`
6000 tdflt=$tdflt/$archname
6009 $spackage contains architecture-dependent library files. If you are
6010 sharing libraries in a heterogeneous environment, you might store
6011 these files in a separate location. Otherwise, you can just include
6012 them with the rest of the public library files.
6016 rp='Where do you want to put the public architecture-dependent libraries?'
6019 archlibexp="$ansexp"
6020 if $test X"$archlib" = X"$privlib"; then
6025 : Change installation prefix, if necessary.
6026 if $test X"$prefix" != X"$installprefix"; then
6027 installarchlib=`echo $archlibexp | sed "s#^$prefix#$installprefix#"`
6029 installarchlib="$archlibexp"
6032 : see if setuid scripts can be secure
6035 Some kernels have a bug that prevents setuid #! scripts from being
6036 secure. Some sites have disabled setuid #! scripts because of this.
6038 First let's decide if your kernel supports secure setuid #! scripts.
6039 (If setuid #! scripts would be secure but have been disabled anyway,
6040 don't say that they are secure if asked.)
6045 if $test -d /dev/fd; then
6046 echo "#!$ls" >reflect
6047 chmod +x,u+s reflect
6048 ./reflect >flect 2>&1
6049 if $contains "/dev/fd" flect >/dev/null; then
6050 echo "Congratulations, your kernel has secure setuid scripts!" >&4
6054 If you are not sure if they are secure, I can check but I'll need a
6055 username and password different from the one you are using right now.
6056 If you don't have such a username or don't want me to test, simply
6060 rp='Other username to test security of setuid scripts with?'
6065 case "$d_suidsafe" in
6066 '') echo "I'll assume setuid scripts are *not* secure." >&4
6069 echo "Well, the $hint value is *not* secure." >&4
6071 *) echo "Well, the $hint value *is* secure." >&4
6076 $rm -f reflect flect
6077 echo "#!$ls" >reflect
6078 chmod +x,u+s reflect
6081 echo '"su" will (probably) prompt you for '"$ans's password."
6082 su $ans -c './reflect >flect'
6083 if $contains "/dev/fd" flect >/dev/null; then
6084 echo "Okay, it looks like setuid scripts are secure." >&4
6087 echo "I don't think setuid scripts are secure." >&4
6092 rp='Does your kernel have *secure* setuid scripts?'
6095 [yY]*) val="$define";;
6100 echo "I don't think setuid scripts are secure (no /dev/fd directory)." >&4
6101 echo "(That's for file descriptors, not floppy disks.)"
6107 $rm -f reflect flect
6109 : now see if they want to do setuid emulation
6112 case "$d_suidsafe" in
6115 echo "No need to emulate SUID scripts since they are secure here." >&4
6119 Some systems have disabled setuid scripts, especially systems where
6120 setuid scripts cannot be secure. On systems where setuid scripts have
6121 been disabled, the setuid/setgid bits on scripts are currently
6122 useless. It is possible for $package to detect those bits and emulate
6123 setuid/setgid in a secure fashion. This emulation will only work if
6124 setuid scripts have been disabled in your kernel.
6128 "$define") dflt=y ;;
6131 rp="Do you want to do setuid/setgid emulation?"
6134 [yY]*) val="$define";;
6142 : see if this is a malloc.h system
6143 : we want a real compile instead of Inhdr because some systems have a
6144 : malloc.h that just gives a compile error saying to use stdlib.h instead
6149 int main () { return 0; }
6152 if eval $compile; then
6153 echo "<malloc.h> found." >&4
6156 echo "<malloc.h> NOT found." >&4
6163 : check for void type
6165 echo "Checking to see how well your C compiler groks the void type..." >&4
6166 case "$voidflags" in
6178 extern void moo(); /* function returning void */
6179 void (*goo)(); /* ptr to func returning void */
6181 void *hue; /* generic ptr */
6194 int main() { sub(); }
6196 if $cc $ccflags -c -DTRY=$defvoidused try.c >.out 2>&1 ; then
6197 voidflags=$defvoidused
6198 echo "Good. It appears to support void to the level $package wants.">&4
6199 if $contains warning .out >/dev/null 2>&1; then
6200 echo "However, you might get some warnings that look like this:"
6204 echo "Hmm, your compiler has some difficulty with void. Checking further..." >&4
6205 if $cc $ccflags -c -DTRY=1 try.c >/dev/null 2>&1; then
6206 echo "It supports 1..."
6207 if $cc $ccflags -c -DTRY=3 try.c >/dev/null 2>&1; then
6208 echo "It also supports 2..."
6209 if $cc $ccflags -c -DTRY=7 try.c >/dev/null 2>&1; then
6211 echo "And it supports 4 but not 8 definitely."
6213 echo "It doesn't support 4..."
6214 if $cc $ccflags -c -DTRY=11 try.c >/dev/null 2>&1; then
6216 echo "But it supports 8."
6219 echo "Neither does it support 8."
6223 echo "It does not support 2..."
6224 if $cc $ccflags -c -DTRY=13 try.c >/dev/null 2>&1; then
6226 echo "But it supports 4 and 8."
6228 if $cc $ccflags -c -DTRY=5 try.c >/dev/null 2>&1; then
6230 echo "And it supports 4 but has not heard about 8."
6232 echo "However it supports 8 but not 4."
6237 echo "There is no support at all for void."
6242 case "$voidflags" in
6245 Support flag bits are:
6246 1: basic void declarations.
6247 2: arrays of pointers to functions returning void.
6248 4: operations between pointers to and addresses of void functions.
6249 8: generic void pointers.
6252 rp="Your void support flags add up to what?"
6259 : check for length of pointer
6263 echo "Checking to see how big your pointers are..." >&4
6264 if test "$voidflags" -gt 7; then
6265 echo '#define VOID_PTR char *' > try.c
6267 echo '#define VOID_PTR void *' > try.c
6277 printf("%d\n", (int)sizeof(VOID_PTR));
6282 if eval $compile_ok; then
6283 ptrsize=`$run ./try`
6284 echo "Your pointers are $ptrsize bytes long."
6287 echo "(I can't seem to compile the test program. Guessing...)" >&4
6288 rp="What is the size of a pointer (in bytes)?"
6295 case "$use64bitall" in
6296 "$define"|true|[yY]*)
6300 *** You have chosen a maximally 64-bit build,
6301 *** but your pointers are only 4 bytes wide.
6302 *** Please rerun Configure without -Duse64bitall.
6307 *** Since you have quads, you could possibly try with -Duse64bitint.
6312 *** Cannot continue, aborting.
6323 : determine whether to use malloc wrapping
6325 case "$usemallocwrap" in
6326 [yY]*|true|$define) dflt='y' ;;
6327 [nN]*|false|$undef) dflt='n' ;;
6328 *) case "$usedevel" in
6329 [yY]*|true|$define) dflt='y' ;;
6334 rp="Do you wish to wrap malloc calls to protect against potential overflows?"
6336 usemallocwrap="$ans"
6339 usemallocwrap="$define" ;;
6341 usemallocwrap="$undef" ;;
6344 : determine which malloc to compile in
6346 case "$usemymalloc" in
6347 [yY]*|true|$define) dflt='y' ;;
6348 [nN]*|false|$undef) dflt='n' ;;
6349 *) case "$ptrsize" in
6355 rp="Do you wish to attempt to use the malloc that comes with $package?"
6361 mallocsrc='malloc.c'
6362 mallocobj="malloc$_o"
6363 d_mymalloc="$define"
6366 : Remove malloc from list of libraries to use
6367 echo "Removing unneeded -lmalloc from library list" >&4
6368 set `echo X $libs | $sed -e 's/-lmalloc / /' -e 's/-lmalloc$//'`
6371 echo "libs = $libs" >&4
6383 : compute the return types of malloc and free
6385 $cat >malloc.c <<END
6389 #include <sys/types.h>
6403 case "$malloctype" in
6405 if $cc $ccflags -c -DTRY_MALLOC malloc.c >/dev/null 2>&1; then
6412 echo "Your system wants malloc to return '$malloctype', it would seem." >&4
6416 if $cc $ccflags -c -DTRY_FREE malloc.c >/dev/null 2>&1; then
6423 echo "Your system uses $freetype free(), it would seem." >&4
6427 After $package is installed, you may wish to install various
6428 add-on modules and utilities. Typically, these add-ons will
6429 be installed under $prefix with the rest
6430 of this package. However, you may wish to install such add-ons
6431 elsewhere under a different prefix.
6433 If you do not wish to put everything under a single prefix, that's
6434 ok. You will be prompted for the individual locations; this siteprefix
6435 is only used to suggest the defaults.
6437 The default should be fine for most people.
6441 rp='Installation prefix to use for add-on modules and utilities?'
6442 : XXX Here might be another good place for an installstyle setting.
6443 case "$siteprefix" in
6445 *) dflt=$siteprefix ;;
6448 : XXX Prefixit unit does not yet support siteprefix and vendorprefix
6450 case "$siteprefix" in
6454 *) oldsiteprefix="$prefix";;
6459 siteprefixexp="$ansexp"
6461 : determine where site specific libraries go.
6462 : Usual default is /usr/local/lib/perl5/site_perl/$version
6463 : The default "style" setting is made in installstyle.U
6464 : XXX No longer works with Prefixit stuff.
6465 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
6467 '') case "$installstyle" in
6468 *lib/perl5*) dflt=$siteprefix/lib/$package/site_$prog/$version ;;
6469 *) dflt=$siteprefix/lib/site_$prog/$version ;;
6477 The installation process will create a directory for
6478 site-specific extensions and modules. Most users find it convenient
6479 to place all site-specific files in this directory rather than in the
6480 main distribution directory.
6484 rp='Pathname for the site-specific library files?'
6487 sitelibexp="$ansexp"
6488 sitelib_stem=`echo "$sitelibexp" | sed "s,/$version$,,"`
6489 : Change installation prefix, if necessary.
6490 if $test X"$prefix" != X"$installprefix"; then
6491 installsitelib=`echo $sitelibexp | $sed "s#^$prefix#$installprefix#"`
6493 installsitelib="$sitelibexp"
6496 : determine where site specific architecture-dependent libraries go.
6497 : sitelib default is /usr/local/lib/perl5/site_perl/$version
6498 : sitearch default is /usr/local/lib/perl5/site_perl/$version/$archname
6499 : sitelib may have an optional trailing /share.
6501 '') dflt=`echo $sitelib | $sed 's,/share$,,'`
6502 dflt="$dflt/$archname"
6507 set sitearch sitearch none
6511 The installation process will also create a directory for
6512 architecture-dependent site-specific extensions and modules.
6516 rp='Pathname for the site-specific architecture-dependent library files?'
6519 sitearchexp="$ansexp"
6520 : Change installation prefix, if necessary.
6521 if $test X"$prefix" != X"$installprefix"; then
6522 installsitearch=`echo $sitearchexp | sed "s#^$prefix#$installprefix#"`
6524 installsitearch="$sitearchexp"
6529 The installation process will also create a directory for
6530 vendor-supplied add-ons. Vendors who supply perl with their system
6531 may find it convenient to place all vendor-supplied files in this
6532 directory rather than in the main distribution directory. This will
6533 ease upgrades between binary-compatible maintenance versions of perl.
6535 Of course you may also use these directories in whatever way you see
6536 fit. For example, you might use them to access modules shared over a
6537 company-wide network.
6539 The default answer should be fine for most people.
6540 This causes further questions about vendor add-ons to be skipped
6541 and no vendor-specific directories will be configured for perl.
6544 rp='Do you want to configure vendor-specific add-on directories?'
6545 case "$usevendorprefix" in
6546 define|true|[yY]*) dflt=y ;;
6547 *) : User may have set vendorprefix directly on Configure command line.
6548 case "$vendorprefix" in
6557 rp='Installation prefix to use for vendor-supplied add-ons?'
6558 case "$vendorprefix" in
6560 *) dflt=$vendorprefix ;;
6563 : XXX Prefixit unit does not yet support siteprefix and vendorprefix
6565 case "$vendorprefix" in
6569 *) oldvendorprefix="$prefix";;
6573 usevendorprefix="$define"
6575 vendorprefixexp="$ansexp"
6577 *) usevendorprefix="$undef"
6583 case "$vendorprefix" in
6584 '') d_vendorlib="$undef"
6588 *) d_vendorlib="$define"
6589 : determine where vendor-supplied modules go.
6590 : Usual default is /usr/local/lib/perl5/vendor_perl/$version
6591 case "$vendorlib" in
6593 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
6594 case "$installstyle" in
6595 *lib/perl5*) dflt=$vendorprefix/lib/$package/vendor_$prog/$version ;;
6596 *) dflt=$vendorprefix/lib/vendor_$prog/$version ;;
6599 *) dflt="$vendorlib"
6603 rp='Pathname for the vendor-supplied library files?'
6606 vendorlibexp="$ansexp"
6609 vendorlib_stem=`echo "$vendorlibexp" | sed "s,/$version$,,"`
6610 : Change installation prefix, if necessary.
6611 if $test X"$prefix" != X"$installprefix"; then
6612 installvendorlib=`echo $vendorlibexp | $sed "s#^$prefix#$installprefix#"`
6614 installvendorlib="$vendorlibexp"
6617 case "$vendorprefix" in
6618 '') d_vendorarch="$undef"
6622 *) d_vendorarch="$define"
6623 : determine where vendor-supplied architecture-dependent libraries go.
6624 : vendorlib default is /usr/local/lib/perl5/vendor_perl/$version
6625 : vendorarch default is /usr/local/lib/perl5/vendor_perl/$version/$archname
6626 : vendorlib may have an optional trailing /share.
6627 case "$vendorarch" in
6628 '') dflt=`echo $vendorlib | $sed 's,/share$,,'`
6629 dflt="$dflt/$archname"
6631 *) dflt="$vendorarch" ;;
6634 rp='Pathname for vendor-supplied architecture-dependent files?'
6637 vendorarchexp="$ansexp"
6640 : Change installation prefix, if necessary.
6641 if $test X"$prefix" != X"$installprefix"; then
6642 installvendorarch=`echo $vendorarchexp | sed "s#^$prefix#$installprefix#"`
6644 installvendorarch="$vendorarchexp"
6647 : Final catch-all directories to search
6650 Lastly, you can have perl look in other directories for extensions and
6651 modules in addition to those already specified.
6652 These directories will be searched after
6656 test X"$vendorlib" != "X" && echo ' ' $vendorlib
6657 test X"$vendorarch" != "X" && echo ' ' $vendorarch
6659 case "$otherlibdirs" in
6660 ''|' ') dflt='none' ;;
6661 *) dflt="$otherlibdirs" ;;
6664 Enter a colon-separated set of extra paths to include in perl's @INC
6665 search path, or enter 'none' for no extra paths.
6669 rp='Colon-separated list of additional directories for perl to search?'
6672 ' '|''|none) otherlibdirs=' ' ;;
6673 *) otherlibdirs="$ans" ;;
6675 case "$otherlibdirs" in
6679 set d_perl_otherlibdirs
6682 : Cruising for prototypes
6684 echo "Checking out function prototypes..." >&4
6685 $cat >prototype.c <<EOCP
6690 int main(int argc, char *argv[]) {
6693 if $cc $ccflags -c prototype.c >prototype.out 2>&1 ; then
6694 echo "Your C compiler appears to support function prototypes."
6697 echo "Your C compiler doesn't seem to understand function prototypes."
6704 case "$prototype" in
6706 *) ansi2knr='ansi2knr'
6711 This version of $package can only be compiled by a compiler that
6712 understands function prototypes. Unfortunately, your C compiler
6714 doesn't seem to understand them. Sorry about that.
6716 If GNU cc is available for your system, perhaps you could try that instead.
6718 Eventually, we hope to support building Perl with pre-ANSI compilers.
6719 If you would like to help in that effort, please contact <perlbug@perl.org>.
6721 Aborting Configure now.
6727 : determine where public executables go
6732 rp='Pathname where the public executables will reside?'
6734 if $test "X$ansexp" != "X$binexp"; then
6739 : Change installation prefix, if necessary.
6740 : XXX Bug? -- ignores Configure -Dinstallprefix setting.
6741 if $test X"$prefix" != X"$installprefix"; then
6742 installbin=`echo $binexp | sed "s#^$prefix#$installprefix#"`
6744 installbin="$binexp"
6753 Perl can be built with extra modules or bundles of modules which
6754 will be fetched from the CPAN and installed alongside Perl.
6756 Notice that you will need access to the CPAN; either via the Internet,
6757 or a local copy, for example a CD-ROM or a local CPAN mirror. (You will
6758 be asked later to configure the CPAN.pm module which will in turn do
6759 the installation of the rest of the extra modules or bundles.)
6761 Notice also that if the modules require any external software such as
6762 libraries and headers (the libz library and the zlib.h header for the
6763 Compress::Zlib module, for example) you MUST have any such software
6764 already installed, this configuration process will NOT install such
6767 If this doesn't make any sense to you, just accept the default '$dflt'.
6769 rp='Install any extra modules (y or n)?'
6775 Please list any extra modules or bundles to be installed from CPAN,
6776 with spaces between the names. The names can be in any format the
6777 'install' command of CPAN.pm will understand. (Answer 'none',
6778 without the quotes, to install no extra modules or bundles.)
6788 $rm -f ../extras.lst
6790 *) echo "(Saving the list of extras for later...)"
6791 echo "$extras" > ../extras.lst
6799 : determine where html pages for programs go
6800 set html1dir html1dir none
6804 If you wish to install html files for programs in $spackage, indicate
6805 the appropriate directory here. To skip installing html files,
6809 ''|none|$undef|' ') dflt=none ;;
6810 *) dflt=$html1dir ;;
6813 rp="Directory for the main $spackage html pages?"
6816 html1direxp="$ansexp"
6817 : Use ' ' for none so value is preserved next time through Configure
6818 $test X"$html1dir" = "X" && html1dir=' '
6819 : Change installation prefix, if necessary.
6820 if $test X"$prefix" != X"$installprefix"; then
6821 installhtml1dir=`echo $html1direxp | sed "s#^$prefix#$installprefix#"`
6823 installhtml1dir="$html1direxp"
6826 : determine where html pages for libraries and modules go
6827 set html3dir html3dir none
6831 If you wish to install html files for modules associated with $spackage,
6832 indicate the appropriate directory here. To skip installing html files,
6835 : There is no obvious default. If they have specified html1dir, then
6836 : try to key off that, possibly changing .../html1 into .../html3.
6838 '') html3dir=`echo "$html1dir" | $sed 's/1$/3$/'` ;;
6839 *) dflt=$html3dir ;;
6842 rp="Directory for the $spackage module html pages?"
6845 html3direxp="$ansexp"
6846 : Use ' ' for none so value is preserved next time through Configure
6847 $test X"$html3dir" = "X" && html3dir=' '
6848 : Change installation prefix, if necessary.
6849 if $test X"$prefix" != X"$installprefix"; then
6850 installhtml3dir=`echo $html3direxp | sed "s#^$prefix#$installprefix#"`
6852 installhtml3dir="$html3direxp"
6855 : Find perl5.005 or later.
6856 echo "Looking for a previously installed perl5.005 or later... "
6858 '') for tdir in `echo "$binexp$path_sep$PATH" | $sed "s/$path_sep/ /g"`; do
6859 : Check if this perl is recent and can load a simple module
6860 if $test -x $tdir/perl$exe_ext && $tdir/perl -Mless -e 'use 5.005;' >/dev/null 2>&1; then
6863 elif $test -x $tdir/perl5$exe_ext && $tdir/perl5 -Mless -e 'use 5.005;' >/dev/null 2>&1; then
6873 '') echo "None found. That's ok.";;
6874 *) echo "Using $perl5." ;;
6877 : Determine list of previous versions to include in @INC
6878 $cat > getverlist <<EOPL
6881 \$api_versionstring = "$api_versionstring";
6882 \$version = "$version";
6883 \$stem = "$sitelib_stem";
6884 \$archname = "$archname";
6886 $cat >> getverlist <<'EOPL'
6887 # Can't have leading @ because metaconfig interprets it as a command!
6888 ;@inc_version_list=();
6889 # XXX Redo to do opendir/readdir?
6892 ;@candidates = glob("5.*");
6898 # XXX ToDo: These comparisons must be reworked when two-digit
6899 # subversions come along, so that 5.7.10 compares as greater than
6900 # 5.7.3! By that time, hope that 5.6.x is sufficiently
6901 # widespread that we can use the built-in version vectors rather
6902 # than reinventing them here. For 5.6.0, however, we must
6903 # assume this script will likely be run by 5.005_0x. --AD 1/2000.
6904 foreach $d (@candidates) {
6905 if ($d lt $version) {
6906 if ($d ge $api_versionstring) {
6907 unshift(@inc_version_list, grep { -d } "$d/$archname", $d);
6909 elsif ($d ge "5.005") {
6910 unshift(@inc_version_list, grep { -d } $d);
6914 # Skip newer version. I.e. don't look in
6915 # 5.7.0 if we're installing 5.6.1.
6919 if (@inc_version_list) {
6920 print join(' ', @inc_version_list);
6923 # Blank space to preserve value for next Configure run.
6928 case "$inc_version_list" in
6929 '') if test -x "$perl5$exe_ext"; then
6930 dflt=`$perl5 getverlist`
6935 $undef) dflt='none' ;;
6936 *) eval dflt=\"$inc_version_list\" ;;
6939 ''|' ') dflt=none ;;
6946 In order to ease the process of upgrading, this version of perl
6947 can be configured to use modules built and installed with earlier
6948 versions of perl that were installed under $prefix. Specify here
6949 the list of earlier versions that this version of perl should check.
6950 If Configure detected no earlier versions of perl installed under
6951 $prefix, then the list will be empty. Answer 'none' to tell perl
6952 to not search earlier versions.
6954 The default should almost always be sensible, so if you're not sure,
6955 just accept the default.
6958 rp='List of earlier versions to include in @INC?'
6961 [Nn]one|''|' '|$undef) inc_version_list=' ' ;;
6962 *) inc_version_list="$ans" ;;
6964 case "$inc_version_list" in
6966 inc_version_list_init='0';;
6967 *) inc_version_list_init=`echo $inc_version_list |
6968 $sed -e 's/^/"/' -e 's/ /","/g' -e 's/$/",0/'`
6973 : determine whether to install perl also as /usr/bin/perl
6976 if $test -d /usr/bin -a "X$installbin" != X/usr/bin; then
6978 Many scripts expect perl to be installed as /usr/bin/perl.
6980 If you want to, I can install the perl you are about to compile
6981 as /usr/bin/perl (in addition to $bin/perl).
6983 if test -f /usr/bin/perl; then
6986 However, please note that because you already have a /usr/bin/perl,
6987 overwriting that with a new Perl would very probably cause problems.
6988 Therefore I'm assuming you don't want to do that (unless you insist).
6991 case "$installusrbinperl" in
6992 "$define"|[yY]*) dflt='y';;
6998 Since you don't have a /usr/bin/perl I'm assuming creating one is okay.
7001 case "$installusrbinperl" in
7002 "$undef"|[nN]*) dflt='n';;
7006 rp="Do you want to install perl as /usr/bin/perl?"
7009 [yY]*) val="$define";;
7015 set installusrbinperl
7019 echo "Checking for GNU C Library..." >&4
7021 /* Find out version of GNU C library. __GLIBC__ and __GLIBC_MINOR__
7022 alone are insufficient to distinguish different versions, such as
7023 2.0.6 and 2.0.7. The function gnu_get_libc_version() appeared in
7024 libc version 2.1.0. A. Dougherty, June 3, 2002.
7030 # ifdef __GLIBC_MINOR__
7031 # if __GLIBC__ >= 2 && __GLIBC_MINOR__ >= 1
7032 # include <gnu/libc-version.h>
7033 printf("%s\n", gnu_get_libc_version());
7035 printf("%d.%d\n", __GLIBC__, __GLIBC_MINOR__);
7038 printf("%d\n", __GLIBC__);
7047 if eval $compile_ok && $run ./try > glibc.ver; then
7049 gnulibc_version=`$cat glibc.ver`
7050 echo "You are using the GNU C Library version $gnulibc_version"
7054 echo "You are not using the GNU C Library"
7056 $rm -f try try.* glibc.ver
7060 : see if nm is to be used to determine whether a symbol is defined or not
7064 case "$d_gnulibc" in
7067 echo "nm probably won't work on the GNU C Library." >&4
7073 if $test "$osname" = aix -a "X$PASE" != "Xdefine" -a ! -f /lib/syscalls.exp; then
7075 echo "Whoops! This is an AIX system without /lib/syscalls.exp!" >&4
7076 echo "'nm' won't be sufficient on this sytem." >&4
7082 '') dflt=`$egrep 'inlibc|csym' $rsrc/Configure | wc -l 2>/dev/null`
7083 if $test $dflt -gt 20; then
7093 true|$define) dflt=y;;
7100 I can use $nm to extract the symbols from your C libraries. This
7101 is a time consuming task which may generate huge output on the disk (up
7102 to 3 megabytes) but that should make the symbols extraction faster. The
7103 alternative is to skip the 'nm' extraction part and to compile a small
7104 test program instead to determine whether each symbol is present. If
7105 you have a fast C compiler and/or if your 'nm' output cannot be parsed,
7106 this may be the best solution.
7108 You probably shouldn't let me use 'nm' if you are using the GNU C Library.
7111 rp="Shall I use $nm to extract C symbols from the libraries?"
7114 [Nn]*) usenm=false;;
7123 : nm options which may be necessary
7125 '') if $test -f /mach_boot; then
7127 elif $test -d /usr/ccs/lib; then
7128 nm_opt='-p' # Solaris (and SunOS?)
7129 elif $test -f /dgux; then
7131 elif $test -f /lib64/rld; then
7132 nm_opt='-p' # 64-bit Irix
7138 : nm options which may be necessary for shared libraries but illegal
7139 : for archive libraries. Thank you, Linux.
7140 case "$nm_so_opt" in
7141 '') case "$myuname" in
7143 if $nm --help | $grep 'dynamic' > /dev/null 2>&1; then
7144 nm_so_opt='--dynamic'
7153 : get list of predefined functions in a handy place
7158 *-lc_s*) libc=`./loc libc_s$_a $libc $libpth`
7164 *) for thislib in $libs; do
7167 : Handle C library specially below.
7170 thislib=`echo $thislib | $sed -e 's/^-l//'`
7171 if try=`./loc lib$thislib.$so.'*' X $libpth`; $test -f "$try"; then
7173 elif try=`./loc lib$thislib.$so X $libpth`; $test -f "$try"; then
7175 elif try=`./loc lib$thislib$_a X $libpth`; $test -f "$try"; then
7177 elif try=`./loc $thislib$_a X $libpth`; $test -f "$try"; then
7179 elif try=`./loc lib$thislib X $libpth`; $test -f "$try"; then
7181 elif try=`./loc $thislib X $libpth`; $test -f "$try"; then
7183 elif try=`./loc Slib$thislib$_a X $xlibpth`; $test -f "$try"; then
7188 libnames="$libnames $try"
7190 *) libnames="$libnames $thislib" ;;
7199 for xxx in $libpth; do
7200 $test -r $1 || set $xxx/libc.$so
7201 : The messy sed command sorts on library version numbers.
7203 set `echo blurfl; echo $xxx/libc.$so.[0-9]* | \
7204 tr ' ' $trnl | egrep -v '\.[A-Za-z]*$' | $sed -e '
7206 s/[0-9][0-9]*/0000&/g
7207 s/0*\([0-9][0-9][0-9][0-9][0-9]\)/\1/g
7210 $sort | $sed -e 's/^.* //'`
7213 $test -r $1 || set /usr/ccs/lib/libc.$so
7214 $test -r $1 || set /lib/libsys_s$_a
7220 if $test -r "$1"; then
7221 echo "Your (shared) C library seems to be in $1."
7223 elif $test -r /lib/libc && $test -r /lib/clib; then
7224 echo "Your C library seems to be in both /lib/clib and /lib/libc."
7226 libc='/lib/clib /lib/libc'
7227 if $test -r /lib/syslib; then
7228 echo "(Your math library is in /lib/syslib.)"
7229 libc="$libc /lib/syslib"
7231 elif $test -r "$libc" || (test -h "$libc") >/dev/null 2>&1; then
7232 echo "Your C library seems to be in $libc, as you said before."
7233 elif $test -r $incpath/usr/lib/libc$_a; then
7234 libc=$incpath/usr/lib/libc$_a;
7235 echo "Your C library seems to be in $libc. That's fine."
7236 elif $test -r /lib/libc$_a; then
7238 echo "Your C library seems to be in $libc. You're normal."
7240 if tans=`./loc libc$_a blurfl/dyick $libpth`; $test -r "$tans"; then
7242 elif tans=`./loc libc blurfl/dyick $libpth`; $test -r "$tans"; then
7243 libnames="$libnames "`./loc clib blurfl/dyick $libpth`
7244 elif tans=`./loc clib blurfl/dyick $libpth`; $test -r "$tans"; then
7246 elif tans=`./loc Slibc$_a blurfl/dyick $xlibpth`; $test -r "$tans"; then
7248 elif tans=`./loc Mlibc$_a blurfl/dyick $xlibpth`; $test -r "$tans"; then
7251 tans=`./loc Llibc$_a blurfl/dyick $xlibpth`
7253 if $test -r "$tans"; then
7254 echo "Your C library seems to be in $tans, of all places."
7260 if $test $xxx = apollo -o -r "$libc" || (test -h "$libc") >/dev/null 2>&1; then
7264 If the guess above is wrong (which it might be if you're using a strange
7265 compiler, or your machine supports multiple models), you can override it here.
7270 echo $libpth | $tr ' ' $trnl | $sort | $uniq > libpath
7272 I can't seem to find your C library. I've looked in the following places:
7275 $sed 's/^/ /' libpath
7278 None of these seems to contain your C library. I need to get its name...
7283 rp='Where is your C library?'
7288 echo $libc $libnames | $tr ' ' $trnl | $sort | $uniq > libnames
7289 set X `cat libnames`
7292 case $# in 1) xxx=file; esac
7293 echo "Extracting names from the following $xxx for later perusal:" >&4
7295 $sed 's/^/ /' libnames >&4
7297 $echo $n "This may take a while...$c" >&4
7301 *$so*) $nm $nm_so_opt $nm_opt $file 2>/dev/null;;
7302 *) $nm $nm_opt $file 2>/dev/null;;
7307 $grep fprintf libc.tmp > libc.ptf
7308 xscan='eval "<libc.ptf $com >libc.list"; $echo $n ".$c" >&4'
7309 xrun='eval "<libc.tmp $com >libc.list"; echo "done." >&4'
7311 if com="$sed -n -e 's/__IO//' -e 's/^.* $xxx *//p'";\
7313 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7315 elif com="$sed -n -e 's/^__*//' -e 's/^\([a-zA-Z_0-9$]*\).*xtern.*/\1/p'";\
7317 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7319 elif com="$sed -n -e '/|UNDEF/d' -e '/FUNC..GL/s/^.*|__*//p'";\
7321 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7323 elif com="$sed -n -e 's/^.* D __*//p' -e 's/^.* D //p'";\
7325 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7327 elif com="$sed -n -e 's/^_//' -e 's/^\([a-zA-Z_0-9]*\).*xtern.*text.*/\1/p'";\
7329 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7331 elif com="$sed -n -e 's/^.*|FUNC |GLOB .*|//p'";\
7333 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7335 elif com="$grep '|' | $sed -n -e '/|COMMON/d' -e '/|DATA/d' \
7336 -e '/ file/d' -e 's/^\([^ ]*\).*/\1/p'";\
7338 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7340 elif com="$sed -n -e 's/^.*|FUNC |GLOB .*|//p' -e 's/^.*|FUNC |WEAK .*|//p'";\
7342 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7344 elif com="$sed -n -e 's/^__//' -e '/|Undef/d' -e '/|Proc/s/ .*//p'";\
7346 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7348 elif com="$sed -n -e 's/^.*|Proc .*|Text *| *//p'";\
7350 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7352 elif com="$sed -n -e '/Def. Text/s/.* \([^ ]*\)\$/\1/p'";\
7354 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7356 elif com="$sed -n -e 's/^[-0-9a-f ]*_\(.*\)=.*/\1/p'";\
7358 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7360 elif com="$sed -n -e 's/.*\.text n\ \ \ \.//p'";\
7362 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7364 elif com="sed -n -e 's/^__.*//' -e 's/[ ]*D[ ]*[0-9]*.*//p'";\
7366 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7369 $nm -p $* 2>/dev/null >libc.tmp
7370 $grep fprintf libc.tmp > libc.ptf
7371 if com="$sed -n -e 's/^.* [ADTSIW] *_[_.]*//p' -e 's/^.* [ADTSIW] //p'";\
7372 eval $xscan; $contains '^fprintf$' libc.list >/dev/null 2>&1
7378 echo "$nm didn't seem to work right. Trying $ar instead..." >&4
7380 if $ar t $libc > libc.tmp && $contains '^fprintf$' libc.tmp >/dev/null 2>&1; then
7381 for thisname in $libnames $libc; do
7382 $ar t $thisname >>libc.tmp
7384 $sed -e "s/\\$_o\$//" < libc.tmp > libc.list
7386 elif test "X$osname" = "Xos2" && $ar tv $libc > libc.tmp; then
7387 # Repeat libc to extract forwarders to DLL entries too
7388 for thisname in $libnames $libc; do
7389 $ar tv $thisname >>libc.tmp
7390 # Revision 50 of EMX has bug in $ar.
7391 # it will not extract forwarders to DLL entries
7392 # Use emximp which will extract exactly them.
7393 emximp -o tmp.imp $thisname \
7395 $sed -e 's/^\([_a-zA-Z0-9]*\) .*$/\1/p' \
7396 < tmp.imp >>libc.tmp
7399 $sed -e "s/\\$_o\$//" -e 's/^ \+//' < libc.tmp > libc.list
7402 echo "$ar didn't seem to work right." >&4
7403 echo "Maybe this is a Cray...trying bld instead..." >&4
7404 if bld t $libc | $sed -e 's/.*\///' -e "s/\\$_o:.*\$//" > libc.list
7406 for thisname in $libnames; do
7408 $sed -e 's/.*\///' -e "s/\\$_o:.*\$//" >>libc.list
7409 $ar t $thisname >>libc.tmp
7413 echo "That didn't work either. Giving up." >&4
7423 echo "Since you are compiling for PASE, extracting more symbols from libc.a ...">&4
7424 dump -Tv /lib/libc.a | awk '$7 == "/unix" {print $5 " " $8}' | grep "^SV" | awk '{print $2}' >> libc.list
7426 *) if $test -f /lib/syscalls.exp; then
7428 echo "Also extracting names from /lib/syscalls.exp for good ole AIX..." >&4
7429 $sed -n 's/^\([^ ]*\)[ ]*syscall[0-9]*[ ]*$/\1/p' /lib/syscalls.exp >>libc.list
7435 $rm -f libnames libpath
7437 : see if dld is available
7441 : is a C symbol defined?
7444 -v) tf=libc.tmp; tdc="";;
7445 -a) tf=libc.tmp; tdc="[]";;
7446 *) tlook="^$1\$"; tf=libc.list; tdc="()";;
7449 case "$reuseval-$4" in
7451 true-*) tx=no; eval "tval=\$$4"; case "$tval" in "") tx=yes;; esac;;
7456 if $test "$runnm" = true; then
7457 if $contains $tlook $tf >/dev/null 2>&1; then
7459 elif $test "$mistrustnm" = compile -o "$mistrustnm" = run; then
7460 echo "void *(*(p()))$tdc { extern void *$1$tdc; return &$1; } int main() { if(p()) return(0); else return(1); }"> try.c;
7461 $cc -o try $optimize $ccflags $ldflags try.c >/dev/null 2>&1 $libs && tval=true;
7462 $test "$mistrustnm" = run -a -x try && { $run ./try$_exe >/dev/null 2>&1 || tval=false; };
7463 $rm -f try$_exe try.c core core.* try.core;
7466 echo "void *(*(p()))$tdc { extern void *$1$tdc; return &$1; } int main() { if(p()) return(0); else return(1); }"> try.c;
7467 $cc -o try $optimize $ccflags $ldflags try.c $libs >/dev/null 2>&1 && tval=true;
7468 $rm -f try$_exe try.c;
7473 $define) tval=true;;
7480 : define an is-in-libc? function
7481 inlibc='echo " "; td=$define; tu=$undef;
7482 sym=$1; var=$2; eval "was=\$$2";
7484 case "$reuseval$was" in
7494 echo "$sym() found." >&4;
7495 case "$was" in $undef) . ./whoa; esac; eval "$var=\$td";;
7497 echo "$sym() NOT found." >&4;
7498 case "$was" in $define) . ./whoa; esac; eval "$var=\$tu";;
7502 $define) echo "$sym() found." >&4;;
7503 *) echo "$sym() NOT found." >&4;;
7507 : see if dlopen exists
7514 : determine which dynamic loading, if any, to compile in
7516 dldir="ext/DynaLoader"
7529 $define) dflt='y' ;;
7532 $define) dflt='y' ;;
7534 : Does a dl_xxx.xs file exist for this operating system
7535 $test -f $rsrc/$dldir/dl_${osname}.xs && dflt='y'
7538 rp="Do you wish to use dynamic loading?"
7545 if $test -f $rsrc/$dldir/dl_${osname}.xs ; then
7546 dflt="$dldir/dl_${osname}.xs"
7547 elif $test "$d_dlopen" = "$define" ; then
7548 dflt="$dldir/dl_dlopen.xs"
7549 elif $test "$i_dld" = "$define" ; then
7550 dflt="$dldir/dl_dld.xs"
7555 *) dflt="$dldir/$dlsrc"
7558 echo "The following dynamic loading files are available:"
7559 : Can not go over to $dldir because getfile has path hard-coded in.
7560 tdir=`pwd`; cd "$rsrc"; $ls -C $dldir/dl*.xs; cd "$tdir"
7561 rp="Source file to use for dynamic loading"
7567 dlsrc=`echo $ans | $sed -e 's%.*/\([^/]*\)$%\1%'`
7571 Some systems may require passing special flags to $cc -c to
7572 compile modules that will be used to create a shared library.
7573 To use no flags, say "none".
7576 case "$cccdlflags" in
7577 '') case "$gccversion" in
7578 '') case "$osname" in
7580 next) dflt='none' ;;
7581 irix*) dflt='-KPIC' ;;
7582 svr4*|esix*|solaris|nonstopux) dflt='-KPIC' ;;
7583 sunos) dflt='-pic' ;;
7587 *) case "$osname" in
7588 darwin) dflt='none' ;;
7589 svr4*|esix*|solaris|nonstopux) dflt='-fPIC' ;;
7594 *) dflt="$cccdlflags" ;;
7596 rp="Any special flags to pass to $cc -c to compile shared library modules?"
7599 none) cccdlflags=' ' ;;
7600 *) cccdlflags="$ans" ;;
7605 Some systems use ld to create libraries that can be dynamically loaded,
7606 while other systems (such as those using ELF) use $cc.
7610 '') $cat >try.c <<EOM
7611 /* Test for whether ELF binaries are produced */
7619 int i = open("a.out",O_RDONLY);
7622 if(read(i,b,4)==4 && b[0]==127 && b[1]=='E' && b[2]=='L' && b[3]=='F')
7623 exit(0); /* succeed (yes, it's ELF) */
7628 if $cc $ccflags $ldflags try.c >/dev/null 2>&1 && $run ./a.out; then
7630 You appear to have ELF support. I'll use $cc to build dynamic libraries.
7634 echo "I'll use ld to build dynamic libraries."
7643 rp="What command should be used to create dynamic libraries?"
7649 Some systems may require passing special flags to $ld to create a
7650 library that can be dynamically loaded. If your ld flags include
7651 -L/other/path options to locate libraries outside your loader's normal
7652 search path, you may need to specify those -L options here as well. To
7653 use no flags, say "none".
7656 case "$lddlflags" in
7657 '') case "$osname" in
7658 beos) dflt='-nostart' ;;
7660 case "$gccversion" in
7661 '') dflt="$dflt +vnocompatwarnings" ;;
7664 linux|irix*|gnu*) dflt='-shared' ;;
7665 next) dflt='none' ;;
7666 solaris) dflt='-G' ;;
7667 sunos) dflt='-assert nodefinitions' ;;
7668 svr4*|esix*|nonstopux) dflt="-G $ldflags" ;;
7672 *) dflt="$lddlflags" ;;
7675 : Try to guess additional flags to pick up local libraries.
7676 : Be careful not to append to a plain 'none'
7680 for thisflag in $ldflags; do
7685 *) dflt="$dflt $thisflag" ;;
7692 ''|' ') dflt='none' ;;
7695 rp="Any special flags to pass to $ld to create a dynamically loaded library?"
7698 none) lddlflags=' ' ;;
7699 *) lddlflags="$ans" ;;
7704 Some systems may require passing special flags to $cc to indicate that
7705 the resulting executable will use dynamic linking. To use no flags,
7709 case "$ccdlflags" in
7710 '') case "$osname" in
7711 linux|hpux|gnu*) dflt='-Wl,-E' ;;
7712 next|sunos) dflt='none' ;;
7716 *) dflt="$ccdlflags" ;;
7718 rp="Any special flags to pass to $cc to use dynamic linking?"
7721 none) ccdlflags=' ' ;;
7722 *) ccdlflags="$ans" ;;
7736 # No dynamic loading being used, so don't bother even to prompt.
7739 *) case "$useshrplib" in
7740 '') case "$osname" in
7741 svr4*|nonstopux|dgux|dynixptx|esix|powerux|beos|cygwin*)
7743 also='Building a shared libperl is required for dynamic loading to work on your system.'
7748 also='Building a shared libperl is needed for MAB support.'
7766 The perl executable is normally obtained by linking perlmain.c with
7767 libperl${_a}, any static extensions (usually just DynaLoader), and
7768 any other libraries needed on this system (such as -lm, etc.). Since
7769 your system supports dynamic loading, it is probably possible to build
7770 a shared libperl.$so. If you will have more than one executable linked
7771 to libperl.$so, this will significantly reduce the size of each
7772 executable, but it may have a noticeable effect on performance. The
7773 default is probably sensible for your system.
7777 rp="Build a shared libperl.$so (y/n)"
7781 useshrplib='true' ;;
7782 *) useshrplib='false' ;;
7787 case "$useshrplib" in
7791 # Figure out a good name for libperl.so. Since it gets stored in
7792 # a version-specific architecture-dependent library, the version
7793 # number isn't really that important, except for making cc/ld happy.
7795 # A name such as libperl.so.3.1
7796 majmin="libperl.$so.$patchlevel.$subversion"
7797 # A name such as libperl.so.301
7798 majonly=`echo $patchlevel $subversion |
7799 $awk '{printf "%d%02d", $1, $2}'`
7800 majonly=libperl.$so.$majonly
7801 # I'd prefer to keep the os-specific stuff here to a minimum, and
7802 # rely on figuring it out from the naming of libc.
7803 case "${osname}${osvers}" in
7806 # XXX How handle the --version stuff for MAB?
7808 linux*|gnu*) # ld won't link with a bare -lperl otherwise.
7811 cygwin*) # ld links against an importlib
7812 dflt=libperl$lib_ext
7814 *) # Try to guess based on whether libc has major.minor.
7816 *libc.$so.[0-9]*.[0-9]*) dflt=$majmin ;;
7817 *libc.$so.[0-9]*) dflt=$majonly ;;
7818 *) dflt=libperl.$so ;;
7828 I need to select a good name for the shared libperl. If your system uses
7829 library names with major and minor numbers, then you might want something
7830 like $majmin. Alternatively, if your system uses a single version
7831 number for shared libraries, then you might want to use $majonly.
7832 Or, your system might be quite happy with a simple libperl.$so.
7834 Since the shared libperl will get installed into a version-specific
7835 architecture-dependent directory, the version number of the shared perl
7836 library probably isn't important, so the default should be o.k.
7839 rp='What name do you want to give to the shared libperl?'
7842 echo "Ok, I'll use $libperl"
7845 libperl="libperl${_a}"
7849 # Detect old use of shrpdir via undocumented Configure -Dshrpdir
7853 WARNING: Use of the shrpdir variable for the installation location of
7854 the shared $libperl is not supported. It was never documented and
7855 will not work in this version. Let me (perlbug@perl.org)
7856 know of any problems this may cause.
7862 But your current setting of $shrpdir is
7863 the default anyway, so it's harmless.
7868 Further, your current attempted setting of $shrpdir
7869 conflicts with the value of $archlibexp/CORE
7870 that installperl will use.
7877 # How will the perl executable find the installed shared $libperl?
7878 # Add $xxx to ccdlflags.
7879 # If we can't figure out a command-line option, use $shrpenv to
7880 # set env LD_RUN_PATH. The main perl makefile uses this.
7881 shrpdir=$archlibexp/CORE
7884 if "$useshrplib"; then
7887 # We'll set it in Makefile.SH...
7892 freebsd|netbsd|openbsd|interix)
7893 xxx="-Wl,-R$shrpdir"
7895 bsdos|linux|irix*|dec_osf|gnu*)
7896 xxx="-Wl,-rpath,$shrpdir"
7899 # next doesn't like the default...
7902 # beos doesn't like the default, either.
7905 # hpux doesn't like the default, either.
7906 tmp_shrpenv="env LDOPTS=\"+s +b${shrpdir}\""
7909 tmp_shrpenv="env LD_RUN_PATH=$shrpdir"
7915 # Only add $xxx if it isn't already in ccdlflags.
7916 case " $ccdlflags " in
7918 *) ccdlflags="$ccdlflags $xxx"
7921 Adding $xxx to the flags
7922 passed to $ld so that the perl executable will find the
7923 installed shared $libperl.
7931 # Fix ccdlflags in AIX for building external extensions.
7932 # (For building Perl itself bare -bE:perl.exp is needed,
7933 # Makefile.SH takes care of this.)
7935 aix) ccdlflags="$ccdlflags -bE:$installarchlib/CORE/perl.exp" ;;
7937 # Respect a hint or command-line value.
7939 '') shrpenv="$tmp_shrpenv" ;;
7941 case "$ldlibpthname" in
7942 '') ldlibpthname=LD_LIBRARY_PATH ;;
7943 none) ldlibpthname='' ;;
7946 : determine where manual pages are on this system
7950 syspath='/usr/share/man/man1 /usr/man/man1'
7951 syspath="$syspath /usr/man/mann /usr/man/manl /usr/man/local/man1"
7952 syspath="$syspath /usr/man/u_man/man1"
7953 syspath="$syspath /usr/catman/u_man/man1 /usr/man/l_man/man1"
7954 syspath="$syspath /usr/local/man/u_man/man1 /usr/local/man/l_man/man1"
7955 syspath="$syspath /usr/man/man.L /local/man/man1 /usr/local/man/man1"
7956 sysman=`./loc . /usr/man/man1 $syspath`
7959 if $test -d "$sysman"; then
7960 echo "System manual is in $sysman." >&4
7962 echo "Could not find manual pages in source form." >&4
7965 : determine where manual pages go
7966 set man1dir man1dir none
7970 $spackage has manual pages available in source form.
7974 echo "However, you don't have nroff, so they're probably useless to you."
7976 '') man1dir="none";;
7979 echo "If you don't want the manual sources installed, answer 'none'."
7984 lookpath="$prefixexp/share/man/man1"
7985 lookpath="$lookpath $prefixexp/man/man1 $prefixexp/man/l_man/man1"
7986 lookpath="$lookpath $prefixexp/man/p_man/man1"
7987 lookpath="$lookpath $prefixexp/man/u_man/man1"
7988 lookpath="$lookpath $prefixexp/man/man.1"
7990 */?_man*) dflt=`./loc . $prefixexp/l_man/man1 $lookpath` ;;
7991 *) dflt=`./loc . $prefixexp/man/man1 $lookpath` ;;
8001 rp="Where do the main $spackage manual pages (source) go?"
8003 if $test "X$man1direxp" != "X$ansexp"; then
8007 man1direxp="$ansexp"
8013 : Change installation prefix, if necessary.
8014 if $test X"$prefix" != X"$installprefix"; then
8015 installman1dir=`echo $man1direxp | $sed "s#^$prefix#$installprefix#"`
8017 installman1dir="$man1direxp"
8020 : What suffix to use on installed man pages
8027 rp="What suffix should be used for the main $spackage man pages?"
8029 '') case "$man1dir" in
8043 *) dflt="$man1ext";;
8050 : see if we can have long filenames
8052 first=123456789abcdef
8054 if (echo hi >$first) 2>/dev/null; then
8055 if $test -f 123456789abcde; then
8056 echo 'You cannot have filenames longer than 14 characters. Sigh.' >&4
8059 echo 'You can have filenames longer than 14 characters.'>&4
8064 You can't have filenames longer than 14 chars.
8065 You can't even think about them!
8071 $rm -rf 123456789abcde*
8073 : determine where library module manual pages go
8074 set man3dir man3dir none
8078 $spackage has manual pages for many of the library modules.
8084 However, you don't have nroff, so they're probably useless to you.
8087 '') man3dir="none";;
8091 case "$d_flexfnam" in
8094 However, your system can't handle the long file names like File::Basename.3.
8097 '') man3dir="none";;
8101 echo "If you don't want the manual sources installed, answer 'none'."
8102 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
8104 '') dflt=`echo "$man1dir" | $sed -e 's/man1/man3/g' -e 's/man\.1/man\.3/g'`
8105 if $test -d "$privlib/man/man3"; then
8108 WARNING: Previous versions of perl installed man3 pages into
8109 $privlib/man/man3. This version will suggest a
8110 new default of $dflt.
8114 rp='Do you wish to preserve the old behavior?(y/n)'
8117 y*) dflt="$privlib/man/man3" ;;
8122 *) dflt="$man3dir" ;;
8129 rp="Where do the $package library man pages (source) go?"
8132 man3direxp="$ansexp"
8138 : Change installation prefix, if necessary.
8139 if $test X"$prefix" != X"$installprefix"; then
8140 installman3dir=`echo $man3direxp | $sed "s#^$prefix#$installprefix#"`
8142 installman3dir="$man3direxp"
8145 : What suffix to use on installed man pages
8151 rp="What suffix should be used for the $package library man pages?"
8153 '') case "$man3dir" in
8167 *) dflt="$man3ext";;
8174 : see if we have to deal with yellow pages, now NIS.
8175 if $test -d /usr/etc/yp || $test -d /etc/yp || $test -d /usr/lib/yp; then
8176 if $test -f /usr/etc/nibindd; then
8178 echo "I'm fairly confident you're on a NeXT."
8180 rp='Do you get the hosts file via NetInfo?'
8189 y*) hostcat='nidump hosts .';;
8190 *) case "$hostcat" in
8191 nidump*) hostcat='';;
8201 '') if $contains '^\+' /etc/passwd >/dev/null 2>&1; then
8209 rp='Are you getting the hosts file via yellow pages?'
8212 y*) hostcat='ypcat hosts';;
8213 *) hostcat='cat /etc/hosts';;
8219 '') test -f /etc/hosts && hostcat='cat /etc/hosts';;
8222 '') test -f /etc/group && groupcat='cat /etc/group';;
8225 '') test -f /etc/passwd && passcat='cat /etc/passwd';;
8228 : now get the host name
8230 echo "Figuring out host name..." >&4
8231 case "$myhostname" in
8233 echo 'Maybe "hostname" will work...'
8234 if tans=`sh -c hostname 2>&1` ; then
8242 if $test "$cont"; then
8244 echo 'Oh, dear. Maybe "/etc/systemid" is the key...'
8245 if tans=`cat /etc/systemid 2>&1` ; then
8247 phostname='cat /etc/systemid'
8248 echo "Whadyaknow. Xenix always was a bit strange..."
8251 elif $test -r /etc/systemid; then
8252 echo "(What is a non-Xenix system doing with /etc/systemid?)"
8255 if $test "$cont"; then
8256 echo 'No, maybe "uuname -l" will work...'
8257 if tans=`sh -c 'uuname -l' 2>&1` ; then
8259 phostname='uuname -l'
8261 echo 'Strange. Maybe "uname -n" will work...'
8262 if tans=`sh -c 'uname -n' 2>&1` ; then
8264 phostname='uname -n'
8266 echo 'Oh well, maybe I can mine it out of whoami.h...'
8267 if tans=`sh -c $contains' sysname $usrinc/whoami.h' 2>&1` ; then
8268 myhostname=`echo "$tans" | $sed 's/^.*"\(.*\)"/\1/'`
8269 phostname="sed -n -e '"'/sysname/s/^.*\"\\(.*\\)\"/\1/{'"' -e p -e q -e '}' <$usrinc/whoami.h"
8271 case "$myhostname" in
8272 '') echo "Does this machine have an identity crisis or something?"
8275 echo "Well, you said $myhostname before..."
8276 phostname='echo $myhostname';;
8282 case "$myhostname" in
8283 '') myhostname=noname ;;
8285 : you do not want to know about this
8290 if $test "$myhostname" ; then
8292 rp='Your host name appears to be "'$myhostname'".'" Right?"
8300 : bad guess or no guess
8301 while $test "X$myhostname" = X ; do
8303 rp="Please type the (one word) name of your host:"
8308 : translate upper to lower if necessary
8309 case "$myhostname" in
8311 echo "(Normalizing case in your host name)"
8312 myhostname=`echo $myhostname | ./tr '[A-Z]' '[a-z]'`
8316 case "$myhostname" in
8318 dflt=`expr "X$myhostname" : "X[^.]*\(\..*\)"`
8319 myhostname=`expr "X$myhostname" : "X\([^.]*\)\."`
8320 echo "(Trimming domain name from host name--host name is now $myhostname)"
8322 *) case "$mydomain" in
8325 test "X$hostcat" = "Xypcat hosts" &&
8326 ypmatch "$myhostname" hosts 2>/dev/null |\
8327 $sed -e 's/[ ]*#.*//; s/$/ /' > hosts && \
8330 test "X$hostcat" != "X" &&
8331 $hostcat | $sed -n -e "s/[ ]*#.*//; s/\$/ /
8332 /[ ]$myhostname[ . ]/p" > hosts
8335 if $test -f hosts; then
8336 $test x`$awk "/[0-9].*[ ]$myhostname$tmp_re/ { sum++ }
8337 END { print sum }" hosts` = x1 || tmp_re="[ ]"
8338 dflt=.`$awk "/[0-9].*[ ]$myhostname$tmp_re/ {for(i=2; i<=NF;i++) print \\\$i}" \
8339 hosts | $sort | $uniq | \
8340 $sed -n -e "s/$myhostname\.\([-a-zA-Z0-9_.]\)/\1/p"`
8341 case `$echo X$dflt` in
8342 X*\ *) echo "(Several hosts in the database matched hostname)"
8345 X.) echo "(You do not have fully-qualified names in the hosts database)"
8349 echo "(I cannot locate a hosts database anywhere)"
8354 tans=`./loc resolv.conf X /etc /usr/etc`
8355 if $test -f "$tans"; then
8356 echo "(Attempting domain name extraction from $tans)"
8357 dflt=.`$sed -n -e 's/ / /g' \
8358 -e 's/^search *\([^ ]*\).*/\1/p' $tans \
8359 | ./tr '[A-Z]' '[a-z]' 2>/dev/null`
8361 .) dflt=.`$sed -n -e 's/ / /g' \
8362 -e 's/^domain *\([^ ]*\).*/\1/p' $tans \
8363 | ./tr '[A-Z]' '[a-z]' 2>/dev/null`
8370 .) echo "(No help from resolv.conf either -- attempting clever guess)"
8371 dflt=.`sh -c domainname 2>/dev/null`
8374 .nis.*|.yp.*|.main.*) dflt=`echo $dflt | $sed -e 's/^\.[^.]*//'`;;
8378 case "$dflt$osname" in
8379 .os390) echo "(Attempting domain name extraction from //'SYS1.TCPPARMS(TCPDATA)')"
8380 dflt=.`awk '/^DOMAINORIGIN/ {print $2}' "//'SYS1.TCPPARMS(TCPDATA)'" 2>/dev/null`
8384 .) echo "(Lost all hope -- silly guess then)"
8390 *) dflt="$mydomain";;
8394 rp="What is your domain name?"
8404 : translate upper to lower if necessary
8407 echo "(Normalizing case in your domain name)"
8408 mydomain=`echo $mydomain | ./tr '[A-Z]' '[a-z]'`
8412 : a little sanity check here
8413 case "$phostname" in
8416 case `$phostname | ./tr '[A-Z]' '[a-z]'` in
8417 $myhostname$mydomain|$myhostname) ;;
8419 case "$phostname" in
8421 echo "(That doesn't agree with your whoami.h file, by the way.)"
8424 echo "(That doesn't agree with your $phostname command, by the way.)"
8434 I need to get your e-mail address in Internet format if possible, i.e.
8435 something like user@host.domain. Please answer accurately since I have
8436 no easy means to double check it. The default value provided below
8437 is most probably close to reality but may not be valid from outside
8438 your organization...
8442 while test "$cont"; do
8444 '') dflt="$cf_by@$myhostname$mydomain";;
8445 *) dflt="$cf_email";;
8447 rp='What is your e-mail address?'
8453 rp='Address does not look like an Internet one. Use it anyway?'
8469 If you or somebody else will be maintaining perl at your site, please
8470 fill in the correct e-mail address here so that they may be contacted
8471 if necessary. Currently, the "perlbug" program included with perl
8472 will send mail to this address in addition to perlbug@perl.org. You may
8473 enter "none" for no administrator.
8476 case "$perladmin" in
8477 '') dflt="$cf_email";;
8478 *) dflt="$perladmin";;
8480 rp='Perl administrator e-mail address'
8484 : determine whether to only install version-specific parts.
8487 Do you want to install only the version-specific parts of the perl
8488 distribution? Usually you do *not* want to do this.
8490 case "$versiononly" in
8491 "$define"|[Yy]*|true) dflt='y' ;;
8494 rp="Do you want to install only the version-specific parts of perl?"
8497 [yY]*) val="$define";;
8503 case "$versiononly" in
8504 "$define") inc_version_list=''
8505 inc_version_list_init=0
8509 : figure out how to guarantee perl startup
8510 case "$startperl" in
8512 case "$sharpbang" in
8516 I can use the #! construct to start perl on your system. This will
8517 make startup of perl scripts faster, but may cause problems if you
8518 want to share those scripts and perl is not in a standard place
8519 ($binexp/perl) on all your platforms. The alternative is to force
8520 a shell by starting the script with a single ':' character.
8523 case "$versiononly" in
8524 "$define") dflt="$binexp/perl$version";;
8525 *) dflt="$binexp/perl";;
8527 rp='What shall I put after the #! to start up perl ("none" to not use #!)?'
8530 none) startperl=": # use perl";;
8531 *) startperl="#!$ans"
8532 if $test 30 -lt `echo "$ans" | wc -c`; then
8535 WARNING: Some systems limit the #! command to 32 characters.
8536 If you experience difficulty running Perl scripts with #!, try
8537 installing Perl in a directory with a shorter pathname.
8543 *) startperl=": # use perl"
8548 echo "I'll use $startperl to start perl scripts."
8550 : figure best path for perl in scripts
8553 case "$versiononly" in
8554 "$define") perlpath="$binexp/perl$version";;
8555 *) perlpath="$binexp/perl";;
8557 case "$startperl" in
8562 I will use the "eval 'exec'" idiom to start Perl on your system.
8563 I can use the full path of your Perl binary for this purpose, but
8564 doing so may cause problems if you want to share those scripts and
8565 Perl is not always in a standard place ($binexp/perl).
8569 rp="What path shall I use in \"eval 'exec'\"?"
8576 case "$startperl" in
8578 *) echo "I'll use $perlpath in \"eval 'exec'\"" ;;
8581 : determine where public executable scripts go
8582 set scriptdir scriptdir
8584 case "$scriptdir" in
8587 : guess some guesses
8588 $test -d /usr/share/scripts && dflt=/usr/share/scripts
8589 $test -d /usr/share/bin && dflt=/usr/share/bin
8590 $test -d /usr/local/script && dflt=/usr/local/script
8591 $test -d /usr/local/scripts && dflt=/usr/local/scripts
8592 $test -d $prefixexp/script && dflt=$prefixexp/script
8596 *) dflt="$scriptdir"
8601 Some installations have a separate directory just for executable scripts so
8602 that they can mount it across multiple architectures but keep the scripts in
8603 one spot. You might, for example, have a subdirectory of /usr/share for this.
8604 Or you might just lump your scripts in with all your other executables.
8608 rp='Where do you keep publicly executable scripts?'
8610 if $test "X$ansexp" != "X$scriptdirexp"; then
8614 scriptdirexp="$ansexp"
8615 : Change installation prefix, if necessary.
8616 if $test X"$prefix" != X"$installprefix"; then
8617 installscript=`echo $scriptdirexp | sed "s#^$prefix#$installprefix#"`
8619 installscript="$scriptdirexp"
8622 : determine where add-on public executables go
8624 '') dflt=$siteprefix/bin ;;
8628 rp='Pathname where the add-on public executables should be installed?'
8631 sitebinexp="$ansexp"
8632 : Change installation prefix, if necessary.
8633 if $test X"$prefix" != X"$installprefix"; then
8634 installsitebin=`echo $sitebinexp | sed "s#^$prefix#$installprefix#"`
8636 installsitebin="$sitebinexp"
8639 : determine where add-on html pages go
8640 : There is no standard location, so try to copy the previously-selected
8641 : directory structure for the core html pages.
8642 case "$sitehtml1dir" in
8643 '') dflt=`echo "$html1dir" | $sed "s#^$prefix#$siteprefix#"` ;;
8644 *) dflt=$sitehtml1dir ;;
8647 ''|' ') dflt=none ;;
8650 rp='Pathname where the site-specific html pages should be installed?'
8653 sitehtml1direxp="$ansexp"
8654 : Change installation prefix, if necessary.
8655 if $test X"$prefix" != X"$installprefix"; then
8656 installsitehtml1dir=`echo $sitehtml1direxp | $sed "s#^$prefix#$installprefix#"`
8658 installsitehtml1dir="$sitehtml1direxp"
8661 : determine where add-on library html pages go
8662 : There is no standard location, so try to copy the previously-selected
8663 : directory structure for the core html pages.
8664 case "$sitehtml3dir" in
8665 '') dflt=`echo "$html3dir" | $sed "s#^$prefix#$siteprefix#"` ;;
8666 *) dflt=$sitehtml3dir ;;
8669 ''|' ') dflt=none ;;
8672 rp='Pathname where the site-specific library html pages should be installed?'
8675 sitehtml3direxp="$ansexp"
8676 : Change installation prefix, if necessary.
8677 if $test X"$prefix" != X"$installprefix"; then
8678 installsitehtml3dir=`echo $sitehtml3direxp | $sed "s#^$prefix#$installprefix#"`
8680 installsitehtml3dir="$sitehtml3direxp"
8683 : determine where add-on manual pages go
8684 case "$siteman1dir" in
8685 '') dflt=`echo $man1dir | $sed "s#^$prefix#$siteprefix#"` ;;
8686 *) dflt=$siteman1dir ;;
8689 ''|' ') dflt=none ;;
8692 rp='Pathname where the site-specific manual pages should be installed?'
8695 siteman1direxp="$ansexp"
8696 : Change installation prefix, if necessary.
8697 if $test X"$prefix" != X"$installprefix"; then
8698 installsiteman1dir=`echo $siteman1direxp | $sed "s#^$prefix#$installprefix#"`
8700 installsiteman1dir="$siteman1direxp"
8703 : determine where add-on library man pages go
8704 case "$siteman3dir" in
8705 '') dflt=`echo $man3dir | $sed "s#^$prefix#$siteprefix#"` ;;
8706 *) dflt=$siteman3dir ;;
8709 ''|' ') dflt=none ;;
8712 rp='Pathname where the site-specific library manual pages should be installed?'
8715 siteman3direxp="$ansexp"
8716 : Change installation prefix, if necessary.
8717 if $test X"$prefix" != X"$installprefix"; then
8718 installsiteman3dir=`echo $siteman3direxp | $sed "s#^$prefix#$installprefix#"`
8720 installsiteman3dir="$siteman3direxp"
8723 : determine where add-on public executable scripts go
8724 case "$sitescript" in
8725 '') dflt=$siteprefix/script
8726 $test -d $dflt || dflt=$sitebin ;;
8727 *) dflt="$sitescript" ;;
8730 rp='Pathname where add-on public executable scripts should be installed?'
8733 sitescriptexp="$ansexp"
8734 : Change installation prefix, if necessary.
8735 if $test X"$prefix" != X"$installprefix"; then
8736 installsitescript=`echo $sitescriptexp | sed "s#^$prefix#$installprefix#"`
8738 installsitescript="$sitescriptexp"
8741 case "$usefaststdio" in
8742 $define|true|[yY]*|'')
8743 xversion=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
8753 Perl can be built to use 'fast stdio', which means using the stdio
8754 library but also directly manipulating the stdio buffers to enable
8755 faster I/O. Using stdio is better for backward compatibility (especially
8756 for Perl extensions), but on the other hand since Perl 5.8 the 'perlio'
8757 interface has been preferred instead of stdio.
8759 If this doesn't make any sense to you, just accept the default '$dflt'.
8761 rp='Use the "fast stdio" if available?'
8764 y|Y) val="$define" ;;
8771 : define an is-a-typedef? function
8772 typedef='type=$1; var=$2; def=$3; shift; shift; shift; inclist=$@;
8774 "") inclist="sys/types.h";;
8776 eval "varval=\$$var";
8780 for inc in $inclist; do
8781 echo "#include <$inc>" >>temp.c;
8783 echo "#ifdef $type" >> temp.c;
8784 echo "printf(\"We have $type\");" >> temp.c;
8785 echo "#endif" >> temp.c;
8786 $cppstdin $cppflags $cppminus < temp.c >temp.E 2>/dev/null;
8787 if $contains $type temp.E >/dev/null 2>&1; then
8793 *) eval "$var=\$varval";;
8796 : define an is-a-typedef? function that prompts if the type is not available.
8797 typedef_ask='type=$1; var=$2; def=$3; shift; shift; shift; inclist=$@;
8799 "") inclist="sys/types.h";;
8801 eval "varval=\$$var";
8805 for inc in $inclist; do
8806 echo "#include <$inc>" >>temp.c;
8808 echo "#ifdef $type" >> temp.c;
8809 echo "printf(\"We have $type\");" >> temp.c;
8810 echo "#endif" >> temp.c;
8811 $cppstdin $cppflags $cppminus < temp.c >temp.E 2>/dev/null;
8813 echo "$rp" | $sed -e "s/What is/Looking for/" -e "s/?/./";
8814 if $contains $type temp.E >/dev/null 2>&1; then
8815 echo "$type found." >&4;
8818 echo "$type NOT found." >&4;
8824 *) eval "$var=\$varval";;
8827 : see what type lseek is declared as in the kernel
8828 rp="What is the type used for lseek's offset on this system?"
8829 set off_t lseektype long stdio.h sys/types.h
8833 echo "Checking to see how big your file offsets are..." >&4
8835 #include <sys/types.h>
8839 printf("%d\n", (int)sizeof($lseektype));
8844 if eval $compile_ok; then
8845 lseeksize=`$run ./try`
8846 echo "Your file offsets are $lseeksize bytes long."
8850 echo "(I can't seem to compile the test program. Guessing...)"
8851 rp="What is the size of your file offsets (in bytes)?"
8857 : see what type file positions are declared as in the library
8858 rp="What is the type for file position used by fsetpos()?"
8859 set fpos_t fpostype long stdio.h sys/types.h
8864 *_t) zzz="$fpostype" ;;
8867 echo "Checking the size of $zzz..." >&4
8869 #include <sys/types.h>
8876 printf("%d\n", (int)sizeof($fpostype));
8881 if eval $compile_ok; then
8885 echo "(I can't execute the test program--guessing $fpossize.)" >&4
8888 echo "Your $zzz is $fpossize bytes long."
8894 echo "(I can't compile the test program. Guessing...)" >&4
8895 rp="What is the size of your file positions (in bytes)?"
8900 # Backward compatibility (uselfs is deprecated).
8902 "$define"|true|[yY]*)
8905 *** Configure -Duselfs is deprecated, using -Duselargefiles instead.
8907 uselargefiles="$define"
8911 case "$lseeksize:$fpossize" in
8914 You can have files larger than 2 gigabytes.
8917 *) case "$uselargefiles" in
8918 "$undef"|false|[nN]*) dflt='n' ;;
8923 Perl can be built to understand large files (files larger than 2 gigabytes)
8924 on some systems. To do so, Configure can be run with -Duselargefiles.
8926 If this doesn't make any sense to you, just accept the default '$dflt'.
8928 rp='Try to understand large files, if available?'
8931 y|Y) val="$define" ;;
8938 : Look for a hint-file generated 'call-back-unit'. If the
8939 : user has specified that a large files perl is to be built,
8940 : we may need to set or change some other defaults.
8941 if $test -f uselargefiles.cbu; then
8942 echo "Your platform has some specific hints regarding large file builds, using them..."
8943 . ./uselargefiles.cbu
8945 case "$uselargefiles" in
8947 if $test -f uselargefiles.cbu; then
8949 echo "Rechecking to see how big your file offsets are..." >&4
8951 #include <sys/types.h>
8955 printf("%d\n", (int)sizeof($lseektype));
8960 if eval $compile_ok; then
8961 lseeksize=`$run ./try`
8962 $echo "Your file offsets are now $lseeksize bytes long."
8966 echo "(I can't seem to compile the test program. Guessing...)"
8967 rp="What is the size of your file offsets (in bytes)?"
8972 *_t) zzz="$fpostype" ;;
8975 $echo $n "Rechecking the size of $zzz...$c" >&4
8977 #include <sys/types.h>
8984 printf("%d\n", (int)sizeof($fpostype));
8989 if eval $compile_ok; then
8994 echo "(I can't execute the test program--guessing $fpossize.)" >&4
8997 echo " $fpossize bytes." >&4
9003 echo "(I can't compile the test program. Guessing...)" >&4
9004 rp="What is the size of your file positions (in bytes)?"
9013 # probably will refer to
9014 # $archlib $privlib $sitearch $sitelib $vendorarch $vendorlib
9016 userelocatableinc=undef
9018 case "$vendorprefix" in
9019 '') d_vendorbin="$undef"
9023 *) d_vendorbin="$define"
9024 : determine where vendor-supplied executables go.
9025 case "$vendorbin" in
9026 '') dflt=$vendorprefix/bin ;;
9027 *) dflt="$vendorbin" ;;
9030 rp='Pathname for the vendor-supplied executables directory?'
9033 vendorbinexp="$ansexp"
9036 : Change installation prefix, if necessary.
9037 if $test X"$prefix" != X"$installprefix"; then
9038 installvendorbin=`echo $vendorbinexp | $sed "s#^$prefix#$installprefix#"`
9040 installvendorbin="$vendorbinexp"
9043 case "$vendorprefix" in
9044 '') vendorhtml1dir=''
9045 vendorhtml1direxp=''
9047 *) : determine where vendor-supplied html pages go.
9048 : There is no standard location, so try to copy the previously-selected
9049 : directory structure for the core html pages.
9050 : XXX Better default suggestions would be welcome.
9051 case "$vendorhtml1dir" in
9052 '') dflt=`echo "$html1dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
9053 *) dflt=$vendorhtml1dir ;;
9056 ''|' ') dflt=none ;;
9059 rp='Pathname for the vendor-supplied html pages?'
9061 vendorhtml1dir="$ans"
9062 vendorhtml1direxp="$ansexp"
9065 : Use ' ' for none so value is preserved next time through Configure
9066 $test X"$vendorhtml1dir" = "X" && vendorhtml1dir=' '
9067 : Change installation prefix, if necessary.
9068 if $test X"$prefix" != X"$installprefix"; then
9069 installvendorhtml1dir=`echo $vendorhtml1direxp | $sed "s#^$prefix#$installprefix#"`
9071 installvendorhtml1dir="$vendorhtml1direxp"
9074 case "$vendorprefix" in
9075 '') vendorhtml3dir=''
9076 vendorhtml3direxp=''
9078 *) : determine where vendor-supplied module html pages go.
9079 : There is no standard location, so try to copy the previously-selected
9080 : directory structure for the core html pages.
9081 : XXX Better default suggestions would be welcome.
9082 case "$vendorhtml3dir" in
9083 '') dflt=`echo "$html3dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
9084 *) dflt=$vendorhtml3dir ;;
9087 ''|' ') dflt=none ;;
9090 rp='Pathname for the vendor-supplied html pages?'
9092 vendorhtml3dir="$ans"
9093 vendorhtml3direxp="$ansexp"
9096 : Use ' ' for none so value is preserved next time through Configure
9097 $test X"$vendorhtml3dir" = "X" && vendorhtml3dir=' '
9098 : Change installation prefix, if necessary.
9099 if $test X"$prefix" != X"$installprefix"; then
9100 installvendorhtml3dir=`echo $vendorhtml3direxp | $sed "s#^$prefix#$installprefix#"`
9102 installvendorhtml3dir="$vendorhtml3direxp"
9105 case "$vendorprefix" in
9106 '') vendorman1dir=''
9109 *) : determine where vendor-supplied manual pages go.
9110 case "$vendorman1dir" in
9111 '') dflt=`echo "$man1dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
9112 *) dflt=$vendorman1dir ;;
9115 ''|' ') dflt=none ;;
9118 rp='Pathname for the vendor-supplied manual section 1 pages?'
9120 vendorman1dir="$ans"
9121 vendorman1direxp="$ansexp"
9124 : Use ' ' for none so value is preserved next time through Configure
9125 $test X"$vendorman1dir" = "X" && vendorman1dir=' '
9126 : Change installation prefix, if necessary.
9127 if $test X"$prefix" != X"$installprefix"; then
9128 installvendorman1dir=`echo "$vendorman1direxp" | $sed "s#^$prefix#$installprefix#"`
9130 installvendorman1dir="$vendorman1direxp"
9133 case "$vendorprefix" in
9134 '') vendorman3dir=''
9137 *) : determine where vendor-supplied module manual pages go.
9138 case "$vendorman3dir" in
9139 '') dflt=`echo "$man3dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
9140 *) dflt=$vendorman3dir ;;
9143 ''|' ') dflt=none ;;
9146 rp='Pathname for the vendor-supplied manual section 3 pages?'
9148 vendorman3dir="$ans"
9149 vendorman3direxp="$ansexp"
9152 : Use ' ' for none so value is preserved next time through Configure
9153 $test X"$vendorman3dir" = "X" && vendorman3dir=' '
9154 : Change installation prefix, if necessary.
9155 if $test X"$prefix" != X"$installprefix"; then
9156 installvendorman3dir=`echo "$vendorman3direxp" | $sed "s#^$prefix#$installprefix#"`
9158 installvendorman3dir="$vendorman3direxp"
9161 case "$vendorprefix" in
9162 '') d_vendorscript="$undef"
9166 *) d_vendorscript="$define"
9167 : determine where vendor-supplied scripts go.
9168 case "$vendorscript" in
9169 '') dflt=$vendorprefix/script
9170 $test -d $dflt || dflt=$vendorbin ;;
9171 *) dflt="$vendorscript" ;;
9175 The installation process will create a directory for
9176 vendor-supplied scripts.
9180 rp='Pathname for the vendor-supplied scripts directory?'
9183 vendorscriptexp="$ansexp"
9186 : Change installation prefix, if necessary.
9187 if $test X"$prefix" != X"$installprefix"; then
9188 installvendorscript=`echo $vendorscriptexp | $sed "s#^$prefix#$installprefix#"`
9190 installvendorscript="$vendorscriptexp"
9193 : see if qgcvt exists
9199 if $test X"$d_longdbl" = X"$define"; then
9201 echo "Checking how to print long doubles..." >&4
9203 if $test X"$sPRIfldbl" = X -a X"$doublesize" = X"$longdblsize"; then
9204 $cat >try.c <<'EOCP'
9205 #include <sys/types.h>
9209 printf("%.3f\n", d);
9213 if eval $compile; then
9217 sPRIfldbl='"f"'; sPRIgldbl='"g"'; sPRIeldbl='"e"';
9218 sPRIFUldbl='"F"'; sPRIGUldbl='"G"'; sPRIEUldbl='"E"';
9219 echo "We will use %f."
9225 if $test X"$sPRIfldbl" = X; then
9226 $cat >try.c <<'EOCP'
9227 #include <sys/types.h>
9230 long double d = 123.456;
9231 printf("%.3Lf\n", d);
9235 if eval $compile; then
9239 sPRIfldbl='"Lf"'; sPRIgldbl='"Lg"'; sPRIeldbl='"Le"';
9240 sPRIFUldbl='"LF"'; sPRIGUldbl='"LG"'; sPRIEUldbl='"LE"';
9241 echo "We will use %Lf."
9247 if $test X"$sPRIfldbl" = X; then
9248 $cat >try.c <<'EOCP'
9249 #include <sys/types.h>
9252 long double d = 123.456;
9253 printf("%.3llf\n", d);
9257 if eval $compile; then
9261 sPRIfldbl='"llf"'; sPRIgldbl='"llg"'; sPRIeldbl='"lle"';
9262 sPRIFUldbl='"llF"'; sPRIGUldbl='"llG"'; sPRIEUldbl='"llE"';
9263 echo "We will use %llf."
9269 if $test X"$sPRIfldbl" = X; then
9270 $cat >try.c <<'EOCP'
9271 #include <sys/types.h>
9274 long double d = 123.456;
9275 printf("%.3lf\n", d);
9279 if eval $compile; then
9283 sPRIfldbl='"lf"'; sPRIgldbl='"lg"'; sPRIeldbl='"le"';
9284 sPRIFUldbl='"lF"'; sPRIGUldbl='"lG"'; sPRIEUldbl='"lE"';
9285 echo "We will use %lf."
9291 if $test X"$sPRIfldbl" = X; then
9292 echo "Cannot figure out how to print long doubles." >&4
9294 sSCNfldbl=$sPRIfldbl # expect consistency
9301 case "$sPRIfldbl" in
9302 '') d_PRIfldbl="$undef"; d_PRIgldbl="$undef"; d_PRIeldbl="$undef";
9303 d_PRIFUldbl="$undef"; d_PRIGUldbl="$undef"; d_PRIEUldbl="$undef";
9304 d_SCNfldbl="$undef";
9306 *) d_PRIfldbl="$define"; d_PRIgldbl="$define"; d_PRIeldbl="$define";
9307 d_PRIFUldbl="$define"; d_PRIGUldbl="$define"; d_PRIEUldbl="$define";
9308 d_SCNfldbl="$define";
9312 : Check how to convert floats to strings.
9314 if test "X$d_Gconvert" = X; then
9317 echo "Checking for an efficient way to convert floats to strings."
9319 case "$uselongdouble" in
9320 "$define") echo "#define USE_LONG_DOUBLE" >>try.c ;;
9322 case "$d_longdbl" in
9323 "$define") echo "#define HAS_LONG_DOUBLE" >>try.c ;;
9325 case "$d_PRIgldbl" in
9326 "$define") echo "#define HAS_PRIgldbl" >>try.c ;;
9330 #define Gconvert(x,n,t,b) gconvert((x),(n),(t),(b))
9331 char *myname = "gconvert";
9334 #define Gconvert(x,n,t,b) gcvt((x),(n),(b))
9335 char *myname = "gcvt";
9338 #define Gconvert(x,n,t,b) qgcvt((x),(n),(b))
9339 char *myname = "qgcvt";
9340 #define DOUBLETYPE long double
9343 #if defined(USE_LONG_DOUBLE) && defined(HAS_LONG_DOUBLE)
9345 #define Gconvert(x,n,t,b) sprintf((b),"%.*"$sPRIgldbl,(n),(x))
9347 #define Gconvert(x,n,t,b) sprintf((b),"%.*g",(n),(double)(x))
9350 #define Gconvert(x,n,t,b) sprintf((b),"%.*g",(n),(x))
9352 char *myname = "sprintf";
9356 #if defined(USE_LONG_DOUBLE) && defined(HAS_LONG_DOUBLE)
9357 #define DOUBLETYPE long double
9359 #define DOUBLETYPE double
9365 #define I_STDLIB $i_stdlib
9371 checkit(expect, got)
9375 if (strcmp(expect, got)) {
9376 printf("%s oddity: Expected %s, got %s\n",
9377 myname, expect, got);
9387 /* This must be 1st test on (which?) platform */
9388 /* Alan Burlison <AlanBurlsin@unn.unisys.com> */
9389 Gconvert((DOUBLETYPE)0.1, 8, 0, buf);
9390 checkit("0.1", buf);
9392 Gconvert((DOUBLETYPE)0.01, 8, 0, buf);
9393 checkit("0.01", buf);
9395 Gconvert((DOUBLETYPE)0.001, 8, 0, buf);
9396 checkit("0.001", buf);
9398 Gconvert((DOUBLETYPE)0.0001, 8, 0, buf);
9399 checkit("0.0001", buf);
9401 Gconvert((DOUBLETYPE)0.00009, 8, 0, buf);
9402 if (strlen(buf) > 5)
9403 checkit("9e-005", buf); /* for Microsoft ?? */
9405 checkit("9e-05", buf);
9407 Gconvert((DOUBLETYPE)1.0, 8, 0, buf);
9410 Gconvert((DOUBLETYPE)1.1, 8, 0, buf);
9411 checkit("1.1", buf);
9413 Gconvert((DOUBLETYPE)1.01, 8, 0, buf);
9414 checkit("1.01", buf);
9416 Gconvert((DOUBLETYPE)1.001, 8, 0, buf);
9417 checkit("1.001", buf);
9419 Gconvert((DOUBLETYPE)1.0001, 8, 0, buf);
9420 checkit("1.0001", buf);
9422 Gconvert((DOUBLETYPE)1.00001, 8, 0, buf);
9423 checkit("1.00001", buf);
9425 Gconvert((DOUBLETYPE)1.000001, 8, 0, buf);
9426 checkit("1.000001", buf);
9428 Gconvert((DOUBLETYPE)0.0, 8, 0, buf);
9431 Gconvert((DOUBLETYPE)-1.0, 8, 0, buf);
9434 /* Some Linux gcvt's give 1.e+5 here. */
9435 Gconvert((DOUBLETYPE)100000.0, 8, 0, buf);
9436 checkit("100000", buf);
9438 /* Some Linux gcvt's give -1.e+5 here. */
9439 Gconvert((DOUBLETYPE)-100000.0, 8, 0, buf);
9440 checkit("-100000", buf);
9442 Gconvert((DOUBLETYPE)123.456, 8, 0, buf);
9443 checkit("123.456", buf);
9445 /* Testing of 1e+129 in bigintpm.t must not get extra '.' here. */
9446 Gconvert((DOUBLETYPE)1e34, 8, 0, buf);
9447 /* 34 should be enough to scare even long double
9448 * places into using the e notation. */
9449 if (strlen(buf) > 5)
9450 checkit("1e+034", buf); /* for Microsoft */
9452 checkit("1e+34", buf);
9454 /* For Perl, if you add additional tests here, also add them to
9455 * t/base/num.t for benefit of platforms not using Configure or
9456 * overriding d_Gconvert */
9461 : first add preferred functions to our list
9463 for xxx_convert in $gconvert_preference; do
9464 case $xxx_convert in
9465 gcvt|gconvert|sprintf) xxx_list="$xxx_list $xxx_convert" ;;
9466 *) echo "Discarding unrecognized gconvert_preference $xxx_convert" >&4 ;;
9469 : then add any others
9470 for xxx_convert in gconvert gcvt sprintf; do
9473 *) xxx_list="$xxx_list $xxx_convert" ;;
9477 case "$d_longdbl$uselongdouble" in
9479 : again, add prefered functions to our list first
9481 for xxx_convert in $gconvert_ld_preference; do
9482 case $xxx_convert in
9483 qgcvt|gcvt|gconvert|sprintf) xxx_ld_list="$xxx_ld_list $xxx_convert" ;;
9484 *) echo "Discarding unrecognized gconvert_ld_preference $xxx_convert" ;;
9487 : then add qgcvt, sprintf--then, in xxx_list order, gconvert and gcvt
9488 for xxx_convert in qgcvt sprintf $xxx_list; do
9489 case "$xxx_ld_list" in
9490 $xxx_convert*|*" $xxx_convert"*) ;;
9491 *) xxx_ld_list="$xxx_ld_list $xxx_convert" ;;
9494 : if sprintf cannot do long doubles, move it to the end
9495 if test "$d_PRIgldbl" != "$define"; then
9496 xxx_ld_list="`echo $xxx_ld_list|sed s/sprintf//` sprintf"
9498 : if no qgcvt, remove it
9499 if test "$d_qgcvt" != "$define"; then
9500 xxx_ld_list="`echo $xxx_ld_list|sed s/qgcvt//`"
9503 xxx_list="$xxx_ld_list"
9507 for xxx_convert in $xxx_list; do
9508 echo "Trying $xxx_convert..."
9510 set try -DTRY_$xxx_convert
9511 if eval $compile; then
9512 echo "$xxx_convert() found." >&4
9514 echo "I'll use $xxx_convert to convert floats into a string." >&4
9517 echo "...But $xxx_convert didn't work as I expected."
9521 echo "$xxx_convert NOT found." >&4
9525 if test X$xxx_convert = X; then
9526 echo "*** WHOA THERE!!! ***" >&4
9527 echo "None of ($xxx_list) seemed to work properly. I'll use sprintf." >&4
9531 case "$xxx_convert" in
9532 gconvert) d_Gconvert='gconvert((x),(n),(t),(b))' ;;
9533 gcvt) d_Gconvert='gcvt((x),(n),(b))' ;;
9534 qgcvt) d_Gconvert='qgcvt((x),(n),(b))' ;;
9535 *) case "$uselongdouble$d_longdbl$d_PRIgldbl" in
9536 "$define$define$define")
9537 d_Gconvert="sprintf((b),\"%.*\"$sPRIgldbl,(n),(x))" ;;
9538 "$define$define$undef")
9539 d_Gconvert='sprintf((b),"%.*g",(n),(double)(x))' ;;
9540 *) d_Gconvert='sprintf((b),"%.*g",(n),(x))' ;;
9547 : see if _fwalk exists
9551 : Initialize h_fcntl
9554 : Initialize h_sysfile
9557 : access call always available on UNIX
9561 : locate the flags for 'access()'
9565 $cat >access.c <<EOCP
9566 #include <sys/types.h>
9571 #include <sys/file.h>
9584 : check sys/file.h first, no particular reason here
9585 if $test `./findhdr sys/file.h` && \
9586 $cc -o access $cppflags -DI_SYS_FILE access.c >/dev/null 2>&1 ; then
9588 echo "<sys/file.h> defines the *_OK access constants." >&4
9589 elif $test `./findhdr fcntl.h` && \
9590 $cc -o access $cppflags -DI_FCNTL access.c >/dev/null 2>&1 ; then
9592 echo "<fcntl.h> defines the *_OK access constants." >&4
9593 elif $test `./findhdr unistd.h` && \
9594 $cc -o access $cppflags -DI_UNISTD access.c >/dev/null 2>&1 ; then
9595 echo "<unistd.h> defines the *_OK access constants." >&4
9597 echo "I can't find the four *_OK access constants--I'll use mine." >&4
9603 : see if accessx exists
9604 set accessx d_accessx
9607 : see if aintl exists
9611 : see if alarm exists
9615 : see if POSIX threads are available
9616 set pthread.h i_pthread
9619 : define a fucntion to check prototypes
9620 $cat > protochk <<EOSH
9623 optimize="$optimize"
9625 prototype="$prototype"
9628 usethreads=$usethreads
9629 i_pthread=$i_pthread
9630 pthread_h_first=$pthread_h_first
9633 $cat >> protochk <<'EOSH'
9638 while test $# -ge 2; do
9640 $define) echo "#include <$2>" >> try.c ;;
9641 literal) echo "$2" >> try.c ;;
9643 # Extra magic for the benefit of systems that need pthread.h
9644 # to be included early to correctly detect threadsafe functions.
9645 # Such functions must guarantee themselves, though, that the usethreads
9646 # and i_pthread have been defined, before calling protochk.
9647 if test "$usethreads" = "$define" -a "$i_pthread" = "$define" -a "$pthread_h_first" = "$define" -a "$pthread_h_done" = ""; then
9648 echo "#include <pthread.h>" >> try.c
9653 test "$prototype" = "$define" && echo '#define CAN_PROTOTYPE' >> try.c
9654 cat >> try.c <<'EOCP'
9655 #ifdef CAN_PROTOTYPE
9656 #define _(args) args
9661 echo "$foo" >> try.c
9662 echo 'int no_real_function_has_this_name _((void)) { return 0; }' >> try.c
9663 $cc $optimize $ccflags -c try.c > /dev/null 2>&1
9671 hasproto='varname=$1; func=$2; shift; shift;
9672 while $test $# -ge 2; do
9674 $define) echo "#include <$2>";;
9678 $cppstdin $cppflags $cppminus < try.c > tryout.c 2>/dev/null;
9679 if $contains "$func.*(" tryout.c >/dev/null 2>&1; then
9680 echo "$func() prototype found.";
9683 echo "$func() prototype NOT found.";
9688 $rm -f try.c tryout.c'
9690 : see if sys/types.h has to be included
9691 set sys/types.h i_systypes
9694 : see if sys/select.h has to be included
9695 set sys/select.h i_sysselct
9698 hasfield='varname=$1; struct=$2; field=$3; shift; shift; shift;
9699 while $test $# -ge 2; do
9701 $define) echo "#include <$2>";;
9705 echo "int main () { struct $struct foo; char* bar; bar = (char*)foo.$field; }" >> try.c;
9707 if eval $compile; then
9716 : see if we should include time.h, sys/time.h, or both
9718 if test "X$timeincl" = X; then
9719 echo "Testing to see if we should include <time.h>, <sys/time.h> or both." >&4
9720 $echo $n "I'm now running the test program...$c"
9722 #include <sys/types.h>
9727 #ifdef SYSTIMEKERNEL
9730 #include <sys/time.h>
9733 #include <sys/select.h>
9746 struct timezone tzp;
9748 if (foo.tm_sec == foo.tm_sec)
9751 if (bar.tv_sec == bar.tv_sec)
9758 for s_timezone in '-DS_TIMEZONE' ''; do
9760 for s_timeval in '-DS_TIMEVAL' ''; do
9761 for i_systimek in '' '-DSYSTIMEKERNEL'; do
9762 for i_time in '' '-DI_TIME'; do
9763 for i_systime in '-DI_SYSTIME' ''; do
9766 set try $i_time $i_systime $i_systimek $sysselect $s_timeval $s_timezone
9767 if eval $compile; then
9768 set X $i_time $i_systime $i_systimek $sysselect $s_timeval
9772 $echo $n "Succeeded with $flags$c"
9784 *SYSTIMEKERNEL*) i_systimek="$define"
9785 timeincl=`./findhdr sys/time.h`
9786 echo "We'll include <sys/time.h> with KERNEL defined." >&4;;
9787 *) i_systimek="$undef";;
9790 *I_TIME*) i_time="$define"
9791 timeincl=`./findhdr time.h`" $timeincl"
9792 echo "We'll include <time.h>." >&4;;
9793 *) i_time="$undef";;
9796 *I_SYSTIME*) i_systime="$define"
9797 timeincl=`./findhdr sys/time.h`" $timeincl"
9798 echo "We'll include <sys/time.h>." >&4;;
9799 *) i_systime="$undef";;
9803 : see if struct tm knows about tm_zone
9804 case "$i_systime$i_time" in
9807 echo "Checking to see if your struct tm has tm_zone field..." >&4
9808 set d_tm_tm_zone tm tm_zone $i_systime sys/time.h $i_time time.h
9816 case "$d_tm_tm_zone" in
9817 "$define") echo "Yes, it does." ;;
9818 *) echo "No, it doesn't." ;;
9820 : see if struct tm knows about tm_gmtoff
9821 case "$i_systime$i_time" in
9824 echo "Checking to see if your struct tm has tm_gmtoff field..." >&4
9825 set d_tm_tm_gmtoff tm tm_gmtoff $i_systime sys/time.h $i_time time.h
9833 case "$d_tm_tm_gmtoff" in
9834 "$define") echo "Yes, it does." ;;
9835 *) echo "No, it doesn't." ;;
9838 : see if asctime_r exists
9839 set asctime_r d_asctime_r
9841 case "$d_asctime_r" in
9843 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
9844 case "$d_asctime_r_proto:$usethreads" in
9845 ":define") d_asctime_r_proto=define
9846 set d_asctime_r_proto asctime_r $hdrs
9850 case "$d_asctime_r_proto" in
9852 case "$asctime_r_proto" in
9853 ''|0) try='char* asctime_r(const struct tm*, char*);'
9854 ./protochk "extern $try" $hdrs && asctime_r_proto=B_SB ;;
9856 case "$asctime_r_proto" in
9857 ''|0) try='char* asctime_r(const struct tm*, char*, int);'
9858 ./protochk "extern $try" $hdrs && asctime_r_proto=B_SBI ;;
9860 case "$asctime_r_proto" in
9861 ''|0) try='int asctime_r(const struct tm*, char*);'
9862 ./protochk "extern $try" $hdrs && asctime_r_proto=I_SB ;;
9864 case "$asctime_r_proto" in
9865 ''|0) try='int asctime_r(const struct tm*, char*, int);'
9866 ./protochk "extern $try" $hdrs && asctime_r_proto=I_SBI ;;
9868 case "$asctime_r_proto" in
9869 ''|0) d_asctime_r=undef
9871 echo "Disabling asctime_r, cannot determine prototype." >&4 ;;
9872 * ) case "$asctime_r_proto" in
9873 REENTRANT_PROTO*) ;;
9874 *) asctime_r_proto="REENTRANT_PROTO_$asctime_r_proto" ;;
9876 echo "Prototype: $try" ;;
9879 *) case "$usethreads" in
9880 define) echo "asctime_r has no prototype, not using it." >&4 ;;
9887 *) asctime_r_proto=0
9891 : see if atolf exists
9895 : see if atoll exists
9899 : Look for GCC-style attribute format
9900 case "$d_attribute_format" in
9903 echo "Checking whether your compiler can handle __attribute__((format)) ..." >&4
9904 $cat >attrib.c <<'EOCP'
9906 void my_special_printf(char* pat,...) __attribute__((__format__(__printf__,1,2)));
9908 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
9909 if $contains 'warning' attrib.out >/dev/null 2>&1; then
9910 echo "Your C compiler doesn't support __attribute__((format))."
9913 echo "Your C compiler supports __attribute__((format))."
9917 echo "Your C compiler doesn't seem to understand __attribute__ at all."
9921 *) val="$d_attribute_format" ;;
9923 set d_attribute_format
9927 : Look for GCC-style attribute malloc
9928 case "$d_attribute_malloc" in
9931 echo "Checking whether your compiler can handle __attribute__((malloc)) ..." >&4
9932 $cat >attrib.c <<'EOCP'
9934 char *go_get_some_memory( int how_many_bytes ) __attribute__((malloc));
9936 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
9937 if $contains 'warning' attrib.out >/dev/null 2>&1; then
9938 echo "Your C compiler doesn't support __attribute__((malloc))."
9941 echo "Your C compiler supports __attribute__((malloc))."
9945 echo "Your C compiler doesn't seem to understand __attribute__ at all."
9949 *) val="$d_attribute_malloc" ;;
9951 set d_attribute_malloc
9955 : Look for GCC-style attribute nonnull
9956 case "$d_attribute_nonnull" in
9959 echo "Checking whether your compiler can handle __attribute__((nonnull(1))) ..." >&4
9960 $cat >attrib.c <<'EOCP'
9962 void do_something (char *some_pointer,...) __attribute__((nonnull(1)));
9964 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
9965 if $contains 'warning' attrib.out >/dev/null 2>&1; then
9966 echo "Your C compiler doesn't support __attribute__((nonnull))."
9969 echo "Your C compiler supports __attribute__((nonnull))."
9973 echo "Your C compiler doesn't seem to understand __attribute__ at all."
9977 *) val="$d_attribute_nonnull" ;;
9979 set d_attribute_nonnull
9983 : Look for GCC-style attribute noreturn
9984 case "$d_attribute_noreturn" in
9987 echo "Checking whether your compiler can handle __attribute__((noreturn)) ..." >&4
9988 $cat >attrib.c <<'EOCP'
9990 void fall_over_dead( void ) __attribute__((noreturn));
9992 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
9993 if $contains 'warning' attrib.out >/dev/null 2>&1; then
9994 echo "Your C compiler doesn't support __attribute__((noreturn))."
9997 echo "Your C compiler supports __attribute__((noreturn))."
10001 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10005 *) val="$d_attribute_noreturn" ;;
10007 set d_attribute_noreturn
10011 : Look for GCC-style attribute pure
10012 case "$d_attribute_pure" in
10015 echo "Checking whether your compiler can handle __attribute__((pure)) ..." >&4
10016 $cat >attrib.c <<'EOCP'
10018 int square( int n ) __attribute__((pure));
10020 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10021 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10022 echo "Your C compiler doesn't support __attribute__((pure))."
10025 echo "Your C compiler supports __attribute__((pure))."
10029 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10033 *) val="$d_attribute_pure" ;;
10035 set d_attribute_pure
10039 : Look for GCC-style attribute unused
10040 case "$d_attribute_unused" in
10043 echo "Checking whether your compiler can handle __attribute__((unused)) ..." >&4
10044 $cat >attrib.c <<'EOCP'
10046 int do_something( int dummy __attribute__((unused)), int n );
10048 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10049 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10050 echo "Your C compiler doesn't support __attribute__((unused))."
10053 echo "Your C compiler supports __attribute__((unused))."
10057 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10061 *) val="$d_attribute_unused" ;;
10063 set d_attribute_unused
10067 : Look for GCC-style attribute warn_unused_result
10068 case "$d_attribute_warn_unused_result" in
10071 echo "Checking whether your compiler can handle __attribute__((warn_unused_result)) ..." >&4
10072 $cat >attrib.c <<'EOCP'
10074 int I_will_not_be_ignored(void) __attribute__((warn_unused_result));
10076 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10077 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10078 echo "Your C compiler doesn't support __attribute__((warn_unused_result))."
10081 echo "Your C compiler supports __attribute__((warn_unused_result))."
10085 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10089 *) val="$d_attribute_warn_unused_result" ;;
10091 set d_attribute_warn_unused_result
10095 : see if bcmp exists
10099 : see if bcopy exists
10103 : see if this is a unistd.h system
10104 set unistd.h i_unistd
10107 : see if getpgrp exists
10108 set getpgrp d_getpgrp
10111 case "$d_getpgrp" in
10114 echo "Checking to see which flavor of getpgrp is in use..."
10116 #$i_unistd I_UNISTD
10117 #include <sys/types.h>
10119 # include <unistd.h>
10121 #$i_stdlib I_STDLIB
10123 #include <stdlib.h>
10127 if (getuid() == 0) {
10128 printf("(I see you are running Configure as super-user...)\n");
10131 #ifdef TRY_BSD_PGRP
10132 if (getpgrp(1) == 0)
10141 if $cc -o try -DTRY_BSD_PGRP $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
10142 echo "You have to use getpgrp(pid) instead of getpgrp()." >&4
10144 elif $cc -o try $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
10145 echo "You have to use getpgrp() instead of getpgrp(pid)." >&4
10148 echo "I can't seem to compile and run the test program."
10150 xxx="a USG one, i.e. you use getpgrp()."
10152 # SVR4 systems can appear rather BSD-ish.
10153 case "$i_unistd" in
10155 xxx="a BSD one, i.e. you use getpgrp(pid)."
10159 xxx="probably a USG one, i.e. you use getpgrp()."
10164 echo "Assuming your getpgrp is $xxx" >&4
10173 : see if setpgrp exists
10174 set setpgrp d_setpgrp
10177 case "$d_setpgrp" in
10180 echo "Checking to see which flavor of setpgrp is in use..."
10182 #$i_unistd I_UNISTD
10183 #include <sys/types.h>
10185 # include <unistd.h>
10187 #$i_stdlib I_STDLIB
10189 #include <stdlib.h>
10193 if (getuid() == 0) {
10194 printf("(I see you are running Configure as super-user...)\n");
10197 #ifdef TRY_BSD_PGRP
10198 if (-1 == setpgrp(1, 1))
10201 if (setpgrp() != -1)
10207 if $cc -o try -DTRY_BSD_PGRP $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
10208 echo 'You have to use setpgrp(pid,pgrp) instead of setpgrp().' >&4
10210 elif $cc -o try $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
10211 echo 'You have to use setpgrp() instead of setpgrp(pid,pgrp).' >&4
10214 echo "(I can't seem to compile and run the test program.)"
10216 xxx="a USG one, i.e. you use setpgrp()."
10218 # SVR4 systems can appear rather BSD-ish.
10219 case "$i_unistd" in
10221 xxx="a BSD one, i.e. you use setpgrp(pid,pgrp)."
10225 xxx="probably a USG one, i.e. you use setpgrp()."
10230 echo "Assuming your setpgrp is $xxx" >&4
10238 : see if bzero exists
10242 : see if signal is declared as pointer to function returning int or void
10244 xxx=`./findhdr signal.h`
10245 $test "$xxx" && $cppstdin $cppminus $cppflags < $xxx >$$.tmp 2>/dev/null
10246 if $contains 'int.*\*[ ]*signal' $$.tmp >/dev/null 2>&1 ; then
10247 echo "You have int (*signal())() instead of void." >&4
10249 elif $contains 'void.*\*[ ]*signal' $$.tmp >/dev/null 2>&1 ; then
10250 echo "You have void (*signal())()." >&4
10252 elif $contains 'extern[ ]*[(\*]*signal' $$.tmp >/dev/null 2>&1 ; then
10253 echo "You have int (*signal())() instead of void." >&4
10255 elif $contains 'void.*\*.*sig' $$.tmp >/dev/null 2>&1 ; then
10256 echo "You have void (*signal())()." >&4
10259 case "$d_voidsig" in
10261 echo "I can't determine whether signal handler returns void or int..." >&4
10263 rp="What type does your signal handler return?"
10266 v*) val="$define";;
10270 echo "As you already told me, signal handler returns void." >&4
10273 *) echo "As you already told me, signal handler returns int." >&4
10280 case "$d_voidsig" in
10281 "$define") signal_t="void";;
10282 *) signal_t="int";;
10286 : check for ability to cast large floats to 32-bit ints.
10288 echo 'Checking whether your C compiler can cast large floats to int32.' >&4
10289 if $test "$intsize" -ge 4; then
10296 #$i_stdlib I_STDLIB
10298 #include <stdlib.h>
10300 #include <sys/types.h>
10301 #include <signal.h>
10302 $signal_t blech(s) int s; { exit(3); }
10309 signal(SIGFPE, blech);
10311 /* Don't let compiler optimize the test away. Store the number
10312 in a writable string for gcc to pass to sscanf under HP/UX.
10314 sprintf(str, "2147483647");
10315 sscanf(str, "%lf", &f); /* f = (double) 0x7fffffff; */
10319 /* x86 processors will probably give 0x8000 0000, which is a
10320 sign change. We don't want that. We want to mimic SPARC
10321 behavior here, which is to preserve the sign and give
10324 if (i32 != ($xxx) f)
10330 if eval $compile_ok; then
10334 echo "(I can't seem to compile the test program--assuming it can't)"
10339 echo "Yup, it can."
10342 echo "Nope, it can't."
10349 : check for ability to cast negative floats to unsigned
10351 echo 'Checking whether your C compiler can cast negative float to unsigned.' >&4
10354 #$i_stdlib I_STDLIB
10356 #include <stdlib.h>
10358 #include <sys/types.h>
10359 #include <signal.h>
10360 $signal_t blech(s) int s; { exit(7); }
10361 $signal_t blech_in_list(s) int s; { exit(4); }
10362 unsigned long dummy_long(p) unsigned long p; { return p; }
10363 unsigned int dummy_int(p) unsigned int p; { return p; }
10364 unsigned short dummy_short(p) unsigned short p; { return p; }
10368 unsigned long along;
10370 unsigned short ashort;
10374 /* Frustrate gcc-2.7.2's optimizer which failed this test with
10375 a direct f = -123. assignment. gcc-2.8.0 reportedly
10376 optimized the whole file away
10378 /* Store the number in a writable string for gcc to pass to
10379 sscanf under HP/UX.
10381 sprintf(str, "-123");
10382 sscanf(str, "%lf", &f); /* f = -123.; */
10384 signal(SIGFPE, blech);
10385 along = (unsigned long)f;
10386 aint = (unsigned int)f;
10387 ashort = (unsigned short)f;
10388 if (along != (unsigned long)-123)
10390 if (aint != (unsigned int)-123)
10392 if (ashort != (unsigned short)-123)
10394 sprintf(str, "1073741824.");
10395 sscanf(str, "%lf", &f); /* f = (double)0x40000000; */
10398 along = (unsigned long)f;
10399 if (along != 0x80000000)
10403 along = (unsigned long)f;
10404 if (along != 0x7fffffff)
10408 along = (unsigned long)f;
10409 if (along != 0x80000001)
10413 signal(SIGFPE, blech_in_list);
10414 sprintf(str, "123.");
10415 sscanf(str, "%lf", &f); /* f = 123.; */
10416 along = dummy_long((unsigned long)f);
10417 aint = dummy_int((unsigned int)f);
10418 ashort = dummy_short((unsigned short)f);
10419 if (along != (unsigned long)123)
10421 if (aint != (unsigned int)123)
10423 if (ashort != (unsigned short)123)
10430 if eval $compile_ok; then
10434 echo "(I can't seem to compile the test program--assuming it can't)"
10437 case "$castflags" in
10439 echo "Yup, it can."
10442 echo "Nope, it can't."
10449 : see if vprintf exists
10451 if set vprintf val -f d_vprintf; eval $csym; $val; then
10452 echo 'vprintf() found.' >&4
10455 #include <varargs.h>
10456 #$i_stdlib I_STDLIB
10458 #include <stdlib.h>
10461 int main() { xxx("foo"); }
10470 exit((unsigned long)vsprintf(buf,"%s",args) > 10L);
10474 if eval $compile && $run ./try; then
10475 echo "Your vsprintf() returns (int)." >&4
10478 echo "Your vsprintf() returns (char*)." >&4
10482 echo 'vprintf() NOT found.' >&4
10493 : see if chown exists
10497 : see if chroot exists
10498 set chroot d_chroot
10501 : see if chsize exists
10502 set chsize d_chsize
10505 : see if class exists
10509 : see if clearenv exists
10510 set clearenv d_clearenv
10513 hasstruct='varname=$1; struct=$2; shift; shift;
10514 while $test $# -ge 2; do
10516 $define) echo "#include <$2>";;
10520 echo "int main () { struct $struct foo; }" >> try.c;
10522 if eval $compile; then
10529 $rm -f try.c try.o'
10533 : see whether socket exists
10535 $echo $n "Hmm... $c" >&4
10536 if set socket val -f d_socket; eval $csym; $val; then
10537 echo "Looks like you have Berkeley networking support." >&4
10539 if set setsockopt val -f; eval $csym; $val; then
10542 echo "...but it uses the old BSD 4.1c interface, rather than 4.2." >&4
10543 d_oldsock="$define"
10546 if $contains socklib libc.list >/dev/null 2>&1; then
10547 echo "Looks like you have Berkeley networking support." >&4
10549 : we will have to assume that it supports the 4.2 BSD interface
10552 echo "You don't have Berkeley networking in libc$_a..." >&4
10553 if test "X$d_socket" = "X$define"; then
10554 echo "...but you seem to believe that you have sockets." >&4
10556 for net in net socket
10558 if test -f /usr/lib/lib$net$_a; then
10559 ( ($nm $nm_opt /usr/lib/lib$net$_a | eval $nm_extract) || \
10560 $ar t /usr/lib/lib$net$_a) 2>/dev/null >> libc.list
10561 if $contains socket libc.list >/dev/null 2>&1; then
10566 echo "...but the Wollongong group seems to have hacked it in." >&4
10567 sockethdr="-I/usr/netinclude"
10570 echo "Found Berkeley sockets interface in lib$net." >&4
10571 if $contains setsockopt libc.list >/dev/null 2>&1; then
10574 echo "...using the old BSD 4.1c interface, rather than 4.2." >&4
10575 d_oldsock="$define"
10581 if test "X$d_socket" != "X$define"; then
10582 echo "or anywhere else I see." >&4
10590 : see if socketpair exists
10591 set socketpair d_sockpair
10596 echo "Checking the availability of certain socket constants..." >&4
10597 for ENUM in MSG_CTRUNC MSG_DONTROUTE MSG_OOB MSG_PEEK MSG_PROXY SCM_RIGHTS; do
10598 enum=`$echo $ENUM|./tr '[A-Z]' '[a-z]'`
10600 #include <sys/types.h>
10601 #include <sys/socket.h>
10607 set try; if eval $compile; then
10610 set d_${enum}; eval $setvar
10614 : see if this is a sys/uio.h system
10615 set sys/uio.h i_sysuio
10620 echo "Checking to see if your system supports struct cmsghdr..." >&4
10621 set d_cmsghdr_s cmsghdr $i_systypes sys/types.h $d_socket sys/socket.h $i_sysuio sys/uio.h
10623 case "$d_cmsghdr_s" in
10624 "$define") echo "Yes, it does." ;;
10625 *) echo "No, it doesn't." ;;
10629 : check for const keyword
10631 echo 'Checking to see if your C compiler knows about "const"...' >&4
10632 $cat >const.c <<'EOCP'
10633 typedef struct spug { int drokk; } spug;
10640 if $cc -c $ccflags const.c >/dev/null 2>&1 ; then
10642 echo "Yup, it does."
10645 echo "Nope, it doesn't."
10650 : see if copysignl exists
10651 set copysignl d_copysignl
10654 : see if crypt exists
10659 $define) cryptlib='' ;;
10660 *) if set crypt val -f d_crypt; eval $csym; $val; then
10661 echo 'crypt() found.' >&4
10665 cryptlib=`./loc Slibcrypt$_a "" $xlibpth`
10666 if $test -z "$cryptlib"; then
10667 cryptlib=`./loc Mlibcrypt$_a "" $xlibpth`
10671 if $test -z "$cryptlib"; then
10672 cryptlib=`./loc Llibcrypt$_a "" $xlibpth`
10676 if $test -z "$cryptlib"; then
10677 cryptlib=`./loc libcrypt$_a "" $libpth`
10681 if $test -z "$cryptlib"; then
10682 echo 'crypt() NOT found.' >&4
10693 : see if this is a crypt.h system
10694 set crypt.h i_crypt
10697 : see if crypt_r exists
10698 set crypt_r d_crypt_r
10700 case "$d_crypt_r" in
10702 hdrs="$i_systypes sys/types.h define stdio.h $i_crypt crypt.h"
10703 case "$d_crypt_r_proto:$usethreads" in
10704 ":define") d_crypt_r_proto=define
10705 set d_crypt_r_proto crypt_r $hdrs
10709 case "$d_crypt_r_proto" in
10711 case "$crypt_r_proto" in
10712 ''|0) try='char* crypt_r(const char*, const char*, struct crypt_data*);'
10713 ./protochk "extern $try" $hdrs && crypt_r_proto=B_CCS ;;
10715 case "$crypt_r_proto" in
10716 ''|0) try='char* crypt_r(const char*, const char*, CRYPTD*);'
10717 ./protochk "extern $try" $hdrs && crypt_r_proto=B_CCD ;;
10719 case "$crypt_r_proto" in
10720 ''|0) d_crypt_r=undef
10722 echo "Disabling crypt_r, cannot determine prototype." >&4 ;;
10723 * ) case "$crypt_r_proto" in
10724 REENTRANT_PROTO*) ;;
10725 *) crypt_r_proto="REENTRANT_PROTO_$crypt_r_proto" ;;
10727 echo "Prototype: $try" ;;
10730 *) case "$usethreads" in
10731 define) echo "crypt_r has no prototype, not using it." >&4 ;;
10742 : get csh whereabouts
10744 'csh') val="$undef" ;;
10745 *) val="$define" ;;
10749 : Respect a hint or command line value for full_csh.
10750 case "$full_csh" in
10751 '') full_csh=$csh ;;
10754 : see if ctermid_r exists
10755 set ctermid_r d_ctermid_r
10757 case "$d_ctermid_r" in
10759 hdrs="$i_systypes sys/types.h define stdio.h "
10760 case "$d_ctermid_r_proto:$usethreads" in
10761 ":define") d_ctermid_r_proto=define
10762 set d_ctermid_r_proto ctermid_r $hdrs
10766 case "$d_ctermid_r_proto" in
10768 case "$ctermid_r_proto" in
10769 ''|0) try='char* ctermid_r(char*);'
10770 ./protochk "extern $try" $hdrs && ctermid_r_proto=B_B ;;
10772 case "$ctermid_r_proto" in
10773 ''|0) d_ctermid_r=undef
10775 echo "Disabling ctermid_r, cannot determine prototype." >&4 ;;
10776 * ) case "$ctermid_r_proto" in
10777 REENTRANT_PROTO*) ;;
10778 *) ctermid_r_proto="REENTRANT_PROTO_$ctermid_r_proto" ;;
10780 echo "Prototype: $try" ;;
10783 *) case "$usethreads" in
10784 define) echo "ctermid_r has no prototype, not using it." >&4 ;;
10791 *) ctermid_r_proto=0
10795 : see if ctime_r exists
10796 set ctime_r d_ctime_r
10798 case "$d_ctime_r" in
10800 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
10801 case "$d_ctime_r_proto:$usethreads" in
10802 ":define") d_ctime_r_proto=define
10803 set d_ctime_r_proto ctime_r $hdrs
10807 case "$d_ctime_r_proto" in
10809 case "$ctime_r_proto" in
10810 ''|0) try='char* ctime_r(const time_t*, char*);'
10811 ./protochk "extern $try" $hdrs && ctime_r_proto=B_SB ;;
10813 case "$ctime_r_proto" in
10814 ''|0) try='char* ctime_r(const time_t*, char*, int);'
10815 ./protochk "extern $try" $hdrs && ctime_r_proto=B_SBI ;;
10817 case "$ctime_r_proto" in
10818 ''|0) try='int ctime_r(const time_t*, char*);'
10819 ./protochk "extern $try" $hdrs && ctime_r_proto=I_SB ;;
10821 case "$ctime_r_proto" in
10822 ''|0) try='int ctime_r(const time_t*, char*, int);'
10823 ./protochk "extern $try" $hdrs && ctime_r_proto=I_SBI ;;
10825 case "$ctime_r_proto" in
10826 ''|0) d_ctime_r=undef
10828 echo "Disabling ctime_r, cannot determine prototype." >&4 ;;
10829 * ) case "$ctime_r_proto" in
10830 REENTRANT_PROTO*) ;;
10831 *) ctime_r_proto="REENTRANT_PROTO_$ctime_r_proto" ;;
10833 echo "Prototype: $try" ;;
10836 *) case "$usethreads" in
10837 define) echo "ctime_r has no prototype, not using it." >&4 ;;
10848 : see if cuserid exists
10849 set cuserid d_cuserid
10852 : see if this is a limits.h system
10853 set limits.h i_limits
10856 : see if this is a float.h system
10857 set float.h i_float
10860 : See if number of significant digits in a double precision number is known
10862 $cat >dbl_dig.c <<EOM
10863 #$i_limits I_LIMITS
10866 #include <limits.h>
10872 printf("Contains DBL_DIG");
10875 $cppstdin $cppflags $cppminus < dbl_dig.c >dbl_dig.E 2>/dev/null
10876 if $contains 'DBL_DIG' dbl_dig.E >/dev/null 2>&1; then
10877 echo "DBL_DIG found." >&4
10880 echo "DBL_DIG NOT found." >&4
10887 : see if dbm.h is available
10888 : see if dbmclose exists
10889 set dbmclose d_dbmclose
10892 case "$d_dbmclose" in
10902 *) set rpcsvc/dbm.h i_rpcsvcdbm
10907 *) echo "We won't be including <dbm.h>"
10917 : see if prototype for dbminit is available
10919 set d_dbminitproto dbminit $i_dbm dbm.h
10922 : see if difftime exists
10923 set difftime d_difftime
10926 : see if this is a dirent system
10928 if xinc=`./findhdr dirent.h`; $test "$xinc"; then
10930 echo "<dirent.h> found." >&4
10933 if xinc=`./findhdr sys/dir.h`; $test "$xinc"; then
10934 echo "<sys/dir.h> found." >&4
10937 xinc=`./findhdr sys/ndir.h`
10939 echo "<dirent.h> NOT found." >&4
10944 : Look for type of directory structure.
10946 $cppstdin $cppflags $cppminus < "$xinc" > try.c
10948 case "$direntrytype" in
10950 case "$i_dirent" in
10951 $define) guess1='struct dirent' ;;
10952 *) guess1='struct direct' ;;
10955 *) guess1="$direntrytype"
10960 'struct dirent') guess2='struct direct' ;;
10961 *) guess2='struct dirent' ;;
10964 if $contains "$guess1" try.c >/dev/null 2>&1; then
10965 direntrytype="$guess1"
10966 echo "Your directory entries are $direntrytype." >&4
10967 elif $contains "$guess2" try.c >/dev/null 2>&1; then
10968 direntrytype="$guess2"
10969 echo "Your directory entries seem to be $direntrytype." >&4
10971 echo "I don't recognize your system's directory entries." >&4
10972 rp="What type is used for directory entries on this system?"
10975 direntrytype="$ans"
10980 : see if the directory entry stores field length
10982 $cppstdin $cppflags $cppminus < "$xinc" > try.c
10983 if $contains 'd_namlen' try.c >/dev/null 2>&1; then
10984 echo "Good, your directory entry keeps length information in d_namlen." >&4
10987 echo "Your directory entry does not know about the d_namlen field." >&4
10994 : see if this is an sysdir system
10995 set sys/dir.h i_sysdir
10998 : see if this is an sysndir system
10999 set sys/ndir.h i_sysndir
11004 $cat >dirfd.c <<EOM
11006 #$i_stdlib I_STDLIB
11008 #include <stdlib.h>
11010 #$i_dirent I_DIRENT /**/
11011 #$i_sysdir I_SYS_DIR /**/
11012 #$i_sysndir I_SYS_NDIR /**/
11013 #$i_systypes I_SYS_TYPES /**/
11014 #if defined(I_SYS_TYPES)
11015 #include <sys/types.h>
11017 #if defined(I_DIRENT)
11018 #include <dirent.h>
11019 #if defined(NeXT) && defined(I_SYS_DIR) /* NeXT needs dirent + sys/dir.h */
11020 #include <sys/dir.h>
11024 #include <sys/ndir.h>
11028 #include <ndir.h> /* may be wrong in the future */
11030 #include <sys/dir.h>
11036 DIR *dirp = opendir(".");
11037 if (dirfd(dirp) >= 0)
11045 if eval $compile; then
11049 $define) echo "dirfd() found." >&4 ;;
11050 *) echo "dirfd() NOT found." >&4 ;;
11056 : see if dlerror exists
11059 set dlerror d_dlerror
11063 : see if dlfcn is available
11064 set dlfcn.h i_dlfcn
11071 On a few systems, the dynamically loaded modules that perl generates and uses
11072 will need a different extension than shared libs. The default will probably
11078 *) dflt="$dlext" ;;
11080 rp='What is the extension of dynamically loaded modules'
11089 : Check if dlsym need a leading underscore
11095 echo "Checking whether your dlsym() needs a leading underscore ..." >&4
11096 $cat >dyna.c <<'EOM'
11103 #$i_stdlib I_STDLIB
11105 #include <stdlib.h>
11109 #include <dlfcn.h> /* the dynamic linker include file for SunOS/Solaris */
11111 #include <sys/types.h>
11116 extern int fred() ;
11125 int mode = RTLD_LAZY ;
11127 handle = dlopen("./dyna.$dlext", mode) ;
11128 if (handle == NULL) {
11133 symbol = dlsym(handle, "fred") ;
11134 if (symbol == NULL) {
11135 /* try putting a leading underscore */
11136 symbol = dlsym(handle, "_fred") ;
11137 if (symbol == NULL) {
11150 : Call the object file tmp-dyna.o in case dlext=o.
11151 if $cc $ccflags $cccdlflags -c dyna.c > /dev/null 2>&1 &&
11152 mv dyna${_o} tmp-dyna${_o} > /dev/null 2>&1 &&
11153 $ld -o dyna.$dlext $ldflags $lddlflags tmp-dyna${_o} > /dev/null 2>&1 &&
11154 $cc -o fred $ccflags $ldflags $cccdlflags $ccdlflags fred.c $libs > /dev/null 2>&1 && $to dyna.$dlext; then
11157 1) echo "Test program failed using dlopen." >&4
11158 echo "Perhaps you should not use dynamic loading." >&4;;
11159 2) echo "Test program failed using dlsym." >&4
11160 echo "Perhaps you should not use dynamic loading." >&4;;
11161 3) echo "dlsym needs a leading underscore" >&4
11163 4) echo "dlsym doesn't need a leading underscore." >&4;;
11166 echo "I can't compile and run the test program." >&4
11167 echo "I'm guessing that dlsym doesn't need a leading underscore." >&4
11172 $rm -f fred fred.* dyna.$dlext dyna.* tmp-dyna.*
11177 : see if drand48_r exists
11178 set drand48_r d_drand48_r
11180 case "$d_drand48_r" in
11182 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
11183 case "$d_drand48_r_proto:$usethreads" in
11184 ":define") d_drand48_r_proto=define
11185 set d_drand48_r_proto drand48_r $hdrs
11189 case "$d_drand48_r_proto" in
11191 case "$drand48_r_proto" in
11192 ''|0) try='int drand48_r(struct drand48_data*, double*);'
11193 ./protochk "extern $try" $hdrs && drand48_r_proto=I_ST ;;
11195 case "$drand48_r_proto" in
11196 ''|0) d_drand48_r=undef
11198 echo "Disabling drand48_r, cannot determine prototype." >&4 ;;
11199 * ) case "$drand48_r_proto" in
11200 REENTRANT_PROTO*) ;;
11201 *) drand48_r_proto="REENTRANT_PROTO_$drand48_r_proto" ;;
11203 echo "Prototype: $try" ;;
11206 *) case "$usethreads" in
11207 define) echo "drand48_r has no prototype, not using it." >&4 ;;
11214 *) drand48_r_proto=0
11218 : see if prototype for drand48 is available
11220 set d_drand48proto drand48 $i_stdlib stdlib.h $i_unistd unistd.h
11223 : see if dup2 exists
11227 : see if eaccess exists
11228 set eaccess d_eaccess
11231 : see if endgrent exists
11232 set endgrent d_endgrent
11235 : see if this is an grp system
11241 xxx=`./findhdr grp.h`
11242 $cppstdin $cppflags $cppminus < $xxx >$$.h
11244 if $contains 'gr_passwd' $$.h >/dev/null 2>&1; then
11256 set d_grpasswd; eval $setvar
11260 : see if endgrent_r exists
11261 set endgrent_r d_endgrent_r
11263 case "$d_endgrent_r" in
11265 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
11266 case "$d_endgrent_r_proto:$usethreads" in
11267 ":define") d_endgrent_r_proto=define
11268 set d_endgrent_r_proto endgrent_r $hdrs
11272 case "$d_endgrent_r_proto" in
11274 case "$endgrent_r_proto" in
11275 ''|0) try='int endgrent_r(FILE**);'
11276 ./protochk "extern $try" $hdrs && endgrent_r_proto=I_H ;;
11278 case "$endgrent_r_proto" in
11279 ''|0) try='void endgrent_r(FILE**);'
11280 ./protochk "extern $try" $hdrs && endgrent_r_proto=V_H ;;
11282 case "$endgrent_r_proto" in
11283 ''|0) d_endgrent_r=undef
11285 echo "Disabling endgrent_r, cannot determine prototype." >&4 ;;
11286 * ) case "$endgrent_r_proto" in
11287 REENTRANT_PROTO*) ;;
11288 *) endgrent_r_proto="REENTRANT_PROTO_$endgrent_r_proto" ;;
11290 echo "Prototype: $try" ;;
11293 *) case "$usethreads" in
11294 define) echo "endgrent_r has no prototype, not using it." >&4 ;;
11301 *) endgrent_r_proto=0
11305 : see if endhostent exists
11306 set endhostent d_endhent
11309 : see if this is a netdb.h system
11310 set netdb.h i_netdb
11313 : see if endhostent_r exists
11314 set endhostent_r d_endhostent_r
11316 case "$d_endhostent_r" in
11318 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
11319 case "$d_endhostent_r_proto:$usethreads" in
11320 ":define") d_endhostent_r_proto=define
11321 set d_endhostent_r_proto endhostent_r $hdrs
11325 case "$d_endhostent_r_proto" in
11327 case "$endhostent_r_proto" in
11328 ''|0) try='int endhostent_r(struct hostent_data*);'
11329 ./protochk "extern $try" $hdrs && endhostent_r_proto=I_D ;;
11331 case "$endhostent_r_proto" in
11332 ''|0) try='void endhostent_r(struct hostent_data*);'
11333 ./protochk "extern $try" $hdrs && endhostent_r_proto=V_D ;;
11335 case "$endhostent_r_proto" in
11336 ''|0) d_endhostent_r=undef
11337 endhostent_r_proto=0
11338 echo "Disabling endhostent_r, cannot determine prototype." >&4 ;;
11339 * ) case "$endhostent_r_proto" in
11340 REENTRANT_PROTO*) ;;
11341 *) endhostent_r_proto="REENTRANT_PROTO_$endhostent_r_proto" ;;
11343 echo "Prototype: $try" ;;
11346 *) case "$usethreads" in
11347 define) echo "endhostent_r has no prototype, not using it." >&4 ;;
11349 d_endhostent_r=undef
11350 endhostent_r_proto=0
11354 *) endhostent_r_proto=0
11358 : see if endnetent exists
11359 set endnetent d_endnent
11362 : see if endnetent_r exists
11363 set endnetent_r d_endnetent_r
11365 case "$d_endnetent_r" in
11367 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
11368 case "$d_endnetent_r_proto:$usethreads" in
11369 ":define") d_endnetent_r_proto=define
11370 set d_endnetent_r_proto endnetent_r $hdrs
11374 case "$d_endnetent_r_proto" in
11376 case "$endnetent_r_proto" in
11377 ''|0) try='int endnetent_r(struct netent_data*);'
11378 ./protochk "extern $try" $hdrs && endnetent_r_proto=I_D ;;
11380 case "$endnetent_r_proto" in
11381 ''|0) try='void endnetent_r(struct netent_data*);'
11382 ./protochk "extern $try" $hdrs && endnetent_r_proto=V_D ;;
11384 case "$endnetent_r_proto" in
11385 ''|0) d_endnetent_r=undef
11386 endnetent_r_proto=0
11387 echo "Disabling endnetent_r, cannot determine prototype." >&4 ;;
11388 * ) case "$endnetent_r_proto" in
11389 REENTRANT_PROTO*) ;;
11390 *) endnetent_r_proto="REENTRANT_PROTO_$endnetent_r_proto" ;;
11392 echo "Prototype: $try" ;;
11395 *) case "$usethreads" in
11396 define) echo "endnetent_r has no prototype, not using it." >&4 ;;
11398 d_endnetent_r=undef
11399 endnetent_r_proto=0
11403 *) endnetent_r_proto=0
11407 : see if endprotoent exists
11408 set endprotoent d_endpent
11411 : see if endprotoent_r exists
11412 set endprotoent_r d_endprotoent_r
11414 case "$d_endprotoent_r" in
11416 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
11417 case "$d_endprotoent_r_proto:$usethreads" in
11418 ":define") d_endprotoent_r_proto=define
11419 set d_endprotoent_r_proto endprotoent_r $hdrs
11423 case "$d_endprotoent_r_proto" in
11425 case "$endprotoent_r_proto" in
11426 ''|0) try='int endprotoent_r(struct protoent_data*);'
11427 ./protochk "extern $try" $hdrs && endprotoent_r_proto=I_D ;;
11429 case "$endprotoent_r_proto" in
11430 ''|0) try='void endprotoent_r(struct protoent_data*);'
11431 ./protochk "extern $try" $hdrs && endprotoent_r_proto=V_D ;;
11433 case "$endprotoent_r_proto" in
11434 ''|0) d_endprotoent_r=undef
11435 endprotoent_r_proto=0
11436 echo "Disabling endprotoent_r, cannot determine prototype." >&4 ;;
11437 * ) case "$endprotoent_r_proto" in
11438 REENTRANT_PROTO*) ;;
11439 *) endprotoent_r_proto="REENTRANT_PROTO_$endprotoent_r_proto" ;;
11441 echo "Prototype: $try" ;;
11444 *) case "$usethreads" in
11445 define) echo "endprotoent_r has no prototype, not using it." >&4 ;;
11447 d_endprotoent_r=undef
11448 endprotoent_r_proto=0
11452 *) endprotoent_r_proto=0
11456 : see if endpwent exists
11457 set endpwent d_endpwent
11460 : see if this is a pwd.h system
11466 xxx=`./findhdr pwd.h`
11467 $cppstdin $cppflags $cppminus < $xxx >$$.h
11469 if $contains 'pw_quota' $$.h >/dev/null 2>&1; then
11477 if $contains 'pw_age' $$.h >/dev/null 2>&1; then
11485 if $contains 'pw_change' $$.h >/dev/null 2>&1; then
11493 if $contains 'pw_class' $$.h >/dev/null 2>&1; then
11501 if $contains 'pw_expire' $$.h >/dev/null 2>&1; then
11509 if $contains 'pw_comment' $$.h >/dev/null 2>&1; then
11517 if $contains 'pw_gecos' $$.h >/dev/null 2>&1; then
11525 if $contains 'pw_passwd' $$.h >/dev/null 2>&1; then
11537 set d_pwquota; eval $setvar
11538 set d_pwage; eval $setvar
11539 set d_pwchange; eval $setvar
11540 set d_pwclass; eval $setvar
11541 set d_pwexpire; eval $setvar
11542 set d_pwcomment; eval $setvar
11543 set d_pwgecos; eval $setvar
11544 set d_pwpasswd; eval $setvar
11548 : see if endpwent_r exists
11549 set endpwent_r d_endpwent_r
11551 case "$d_endpwent_r" in
11553 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
11554 case "$d_endpwent_r_proto:$usethreads" in
11555 ":define") d_endpwent_r_proto=define
11556 set d_endpwent_r_proto endpwent_r $hdrs
11560 case "$d_endpwent_r_proto" in
11562 case "$endpwent_r_proto" in
11563 ''|0) try='int endpwent_r(FILE**);'
11564 ./protochk "extern $try" $hdrs && endpwent_r_proto=I_H ;;
11566 case "$endpwent_r_proto" in
11567 ''|0) try='void endpwent_r(FILE**);'
11568 ./protochk "extern $try" $hdrs && endpwent_r_proto=V_H ;;
11570 case "$endpwent_r_proto" in
11571 ''|0) d_endpwent_r=undef
11573 echo "Disabling endpwent_r, cannot determine prototype." >&4 ;;
11574 * ) case "$endpwent_r_proto" in
11575 REENTRANT_PROTO*) ;;
11576 *) endpwent_r_proto="REENTRANT_PROTO_$endpwent_r_proto" ;;
11578 echo "Prototype: $try" ;;
11581 *) case "$usethreads" in
11582 define) echo "endpwent_r has no prototype, not using it." >&4 ;;
11589 *) endpwent_r_proto=0
11593 : see if endservent exists
11594 set endservent d_endsent
11597 : see if endservent_r exists
11598 set endservent_r d_endservent_r
11600 case "$d_endservent_r" in
11602 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
11603 case "$d_endservent_r_proto:$usethreads" in
11604 ":define") d_endservent_r_proto=define
11605 set d_endservent_r_proto endservent_r $hdrs
11609 case "$d_endservent_r_proto" in
11611 case "$endservent_r_proto" in
11612 ''|0) try='int endservent_r(struct servent_data*);'
11613 ./protochk "extern $try" $hdrs && endservent_r_proto=I_D ;;
11615 case "$endservent_r_proto" in
11616 ''|0) try='void endservent_r(struct servent_data*);'
11617 ./protochk "extern $try" $hdrs && endservent_r_proto=V_D ;;
11619 case "$endservent_r_proto" in
11620 ''|0) d_endservent_r=undef
11621 endservent_r_proto=0
11622 echo "Disabling endservent_r, cannot determine prototype." >&4 ;;
11623 * ) case "$endservent_r_proto" in
11624 REENTRANT_PROTO*) ;;
11625 *) endservent_r_proto="REENTRANT_PROTO_$endservent_r_proto" ;;
11627 echo "Prototype: $try" ;;
11630 *) case "$usethreads" in
11631 define) echo "endservent_r has no prototype, not using it." >&4 ;;
11633 d_endservent_r=undef
11634 endservent_r_proto=0
11638 *) endservent_r_proto=0
11642 : Locate the flags for 'open()'
11645 #include <sys/types.h>
11650 #include <sys/file.h>
11652 #$i_stdlib I_STDLIB
11654 #include <stdlib.h>
11665 : check sys/file.h first to get FREAD on Sun
11666 if $test `./findhdr sys/file.h` && \
11667 set try -DI_SYS_FILE && eval $compile; then
11669 echo "<sys/file.h> defines the O_* constants..." >&4
11670 if $run ./try; then
11671 echo "and you have the 3 argument form of open()." >&4
11674 echo "but not the 3 argument form of open(). Oh, well." >&4
11677 elif $test `./findhdr fcntl.h` && \
11678 set try -DI_FCNTL && eval $compile; then
11680 echo "<fcntl.h> defines the O_* constants..." >&4
11681 if $run ./try; then
11682 echo "and you have the 3 argument form of open()." >&4
11685 echo "but not the 3 argument form of open(). Oh, well." >&4
11690 echo "I can't find the O_* constant definitions! You got problems." >&4
11696 : see which of string.h or strings.h is needed
11698 strings=`./findhdr string.h`
11699 if $test "$strings" && $test -r "$strings"; then
11700 echo "Using <string.h> instead of <strings.h>." >&4
11704 strings=`./findhdr strings.h`
11705 if $test "$strings" && $test -r "$strings"; then
11706 echo "Using <strings.h> instead of <string.h>." >&4
11708 echo "No string header found -- You'll surely have problems." >&4
11713 case "$i_string" in
11714 "$undef") strings=`./findhdr strings.h`;;
11715 *) strings=`./findhdr string.h`;;
11718 : see if this is a sys/file.h system
11723 : do we need to include sys/file.h ?
11727 if $h_sysfile; then
11729 echo "We'll be including <sys/file.h>." >&4
11732 echo "We won't be including <sys/file.h>." >&4
11742 : see if fcntl.h is there
11747 : see if we can include fcntl.h
11753 echo "We'll be including <fcntl.h>." >&4
11756 if $h_sysfile; then
11757 echo "We don't need to include <fcntl.h> if we include <sys/file.h>." >&4
11759 echo "We won't be including <fcntl.h>." >&4
11771 : check for non-blocking I/O stuff
11772 case "$h_sysfile" in
11773 true) echo "#include <sys/file.h>" > head.c;;
11776 true) echo "#include <fcntl.h>" > head.c;;
11777 *) echo "#include <sys/fcntl.h>" > head.c;;
11782 echo "Figuring out the flag used by open() for non-blocking I/O..." >&4
11783 case "$o_nonblock" in
11785 $cat head.c > try.c
11786 $cat >>try.c <<EOCP
11788 #$i_stdlib I_STDLIB
11790 #include <stdlib.h>
11798 printf("O_NONBLOCK\n");
11802 printf("O_NDELAY\n");
11806 printf("FNDELAY\n");
11813 if eval $compile_ok; then
11814 o_nonblock=`$run ./try`
11815 case "$o_nonblock" in
11816 '') echo "I can't figure it out, assuming O_NONBLOCK will do.";;
11817 *) echo "Seems like we can use $o_nonblock.";;
11820 echo "(I can't compile the test program; pray O_NONBLOCK is right!)"
11823 *) echo "Using $hint value $o_nonblock.";;
11825 $rm -f try try.* .out core
11828 echo "Let's see what value errno gets from read() on a $o_nonblock file..." >&4
11831 $cat head.c > try.c
11832 $cat >>try.c <<EOCP
11834 #include <sys/types.h>
11835 #include <signal.h>
11837 #$i_stdlib I_STDLIB
11839 #include <stdlib.h>
11845 #define MY_O_NONBLOCK $o_nonblock
11846 #ifndef errno /* XXX need better Configure test */
11849 #$i_unistd I_UNISTD
11851 #include <unistd.h>
11853 #$i_string I_STRING
11855 #include <string.h>
11857 #include <strings.h>
11859 $signal_t blech(x) int x; { exit(3); }
11861 $cat >> try.c <<'EOCP'
11869 pipe(pd); /* Down: child -> parent */
11870 pipe(pu); /* Up: parent -> child */
11873 close(pd[1]); /* Parent reads from pd[0] */
11874 close(pu[0]); /* Parent writes (blocking) to pu[1] */
11876 if (-1 == fcntl(pd[0], F_SETFL, MY_O_NONBLOCK))
11881 signal(SIGALRM, blech);
11883 if ((ret = read(pd[0], buf, 1)) > 0) /* Nothing to read! */
11885 sprintf(string, "%d\n", ret);
11886 write(2, string, strlen(string));
11889 if (errno == EAGAIN) {
11890 printf("EAGAIN\n");
11895 if (errno == EWOULDBLOCK)
11896 printf("EWOULDBLOCK\n");
11899 write(pu[1], buf, 1); /* Unblocks child, tell it to close our pipe */
11900 sleep(2); /* Give it time to close our pipe */
11902 ret = read(pd[0], buf, 1); /* Should read EOF */
11904 sprintf(string, "%d\n", ret);
11905 write(4, string, strlen(string));
11909 close(pd[0]); /* We write to pd[1] */
11910 close(pu[1]); /* We read from pu[0] */
11911 read(pu[0], buf, 1); /* Wait for parent to signal us we may continue */
11912 close(pd[1]); /* Pipe pd is now fully closed! */
11913 exit(0); /* Bye bye, thank you for playing! */
11917 if eval $compile_ok; then
11918 echo "$startsh" >mtry
11919 echo "$run ./try >try.out 2>try.ret 4>try.err || exit 4" >>mtry
11921 ./mtry >/dev/null 2>&1
11923 0) eagain=`$cat try.out`;;
11924 1) echo "Could not perform non-blocking setting!";;
11925 2) echo "I did a successful read() for something that was not there!";;
11926 3) echo "Hmm... non-blocking I/O does not seem to be working!";;
11927 4) echo "Could not find F_SETFL!";;
11928 *) echo "Something terribly wrong happened during testing.";;
11930 rd_nodata=`$cat try.ret`
11931 echo "A read() system call with no data present returns $rd_nodata."
11932 case "$rd_nodata" in
11935 echo "(That's peculiar, fixing that to be -1.)"
11941 echo "Forcing errno EAGAIN on read() with no data available."
11945 echo "Your read() sets errno to $eagain when no data is available."
11948 status=`$cat try.err`
11950 0) echo "And it correctly returns 0 to signal EOF.";;
11951 -1) echo "But it also returns -1 to signal EOF, so be careful!";;
11952 *) echo "However, your read() returns '$status' on EOF??";;
11955 if test "$status" = "$rd_nodata"; then
11956 echo "WARNING: you can't distinguish between EOF and no data!"
11960 echo "I can't compile the test program--assuming errno EAGAIN will do."
11967 echo "Using $hint value $eagain."
11968 echo "Your read() returns $rd_nodata when no data is present."
11969 case "$d_eofnblk" in
11970 "$define") echo "And you can see EOF because read() returns 0.";;
11971 "$undef") echo "But you can't see EOF status from read() returned value.";;
11973 echo "(Assuming you can't see EOF status from read anyway.)"
11979 $rm -f try try.* .out core head.c mtry
11981 : see if _ptr and _cnt from stdio act std
11984 if $contains '_lbfsize' `./findhdr stdio.h` >/dev/null 2>&1 ; then
11985 echo "(Looks like you have stdio.h from BSD.)"
11986 case "$stdio_ptr" in
11987 '') stdio_ptr='((fp)->_p)'
11990 *) ptr_lval=$d_stdio_ptr_lval;;
11992 case "$stdio_cnt" in
11993 '') stdio_cnt='((fp)->_r)'
11996 *) cnt_lval=$d_stdio_cnt_lval;;
11998 case "$stdio_base" in
11999 '') stdio_base='((fp)->_ub._base ? (fp)->_ub._base : (fp)->_bf._base)';;
12001 case "$stdio_bufsiz" in
12002 '') stdio_bufsiz='((fp)->_ub._base ? (fp)->_ub._size : (fp)->_bf._size)';;
12004 elif $contains '_IO_fpos_t' `./findhdr stdio.h` `./findhdr libio.h` >/dev/null 2>&1 ; then
12005 echo "(Looks like you have stdio.h from Linux.)"
12006 case "$stdio_ptr" in
12007 '') stdio_ptr='((fp)->_IO_read_ptr)'
12010 *) ptr_lval=$d_stdio_ptr_lval;;
12012 case "$stdio_cnt" in
12013 '') stdio_cnt='((fp)->_IO_read_end - (fp)->_IO_read_ptr)'
12016 *) cnt_lval=$d_stdio_cnt_lval;;
12018 case "$stdio_base" in
12019 '') stdio_base='((fp)->_IO_read_base)';;
12021 case "$stdio_bufsiz" in
12022 '') stdio_bufsiz='((fp)->_IO_read_end - (fp)->_IO_read_base)';;
12025 case "$stdio_ptr" in
12026 '') stdio_ptr='((fp)->_ptr)'
12029 *) ptr_lval=$d_stdio_ptr_lval;;
12031 case "$stdio_cnt" in
12032 '') stdio_cnt='((fp)->_cnt)'
12035 *) cnt_lval=$d_stdio_cnt_lval;;
12037 case "$stdio_base" in
12038 '') stdio_base='((fp)->_base)';;
12040 case "$stdio_bufsiz" in
12041 '') stdio_bufsiz='((fp)->_cnt + (fp)->_ptr - (fp)->_base)';;
12045 : test whether _ptr and _cnt really work
12046 echo "Checking how std your stdio is..." >&4
12049 #$i_stdlib I_STDLIB
12051 #include <stdlib.h>
12053 #define FILE_ptr(fp) $stdio_ptr
12054 #define FILE_cnt(fp) $stdio_cnt
12056 FILE *fp = fopen("try.c", "r");
12059 18 <= FILE_cnt(fp) &&
12060 strncmp(FILE_ptr(fp), "include <stdio.h>\n", 18) == 0
12068 if eval $compile && $to try.c; then
12069 if $run ./try; then
12070 echo "Your stdio acts pretty std."
12073 echo "Your stdio isn't very std."
12076 echo "Your stdio doesn't appear very std."
12080 # glibc 2.2.90 and above apparently change stdio streams so Perl's
12081 # direct buffer manipulation no longer works. The Configure tests
12082 # should be changed to correctly detect this, but until then,
12083 # the following check should at least let perl compile and run.
12084 # (This quick fix should be updated before 5.8.1.)
12085 # To be defensive, reject all unknown versions, and all versions > 2.2.9.
12086 # A. Dougherty, June 3, 2002.
12087 case "$d_gnulibc" in
12089 case "$gnulibc_version" in
12093 *) echo "But I will not snoop inside glibc $gnulibc_version stdio buffers."
12102 : Can _ptr be used as an lvalue?
12103 case "$d_stdstdio$ptr_lval" in
12104 $define$define) val=$define ;;
12107 set d_stdio_ptr_lval
12110 : Can _cnt be used as an lvalue?
12111 case "$d_stdstdio$cnt_lval" in
12112 $define$define) val=$define ;;
12115 set d_stdio_cnt_lval
12119 : test whether setting _ptr sets _cnt as a side effect
12120 d_stdio_ptr_lval_sets_cnt="$undef"
12121 d_stdio_ptr_lval_nochange_cnt="$undef"
12122 case "$d_stdio_ptr_lval$d_stdstdio" in
12124 echo "Checking to see what happens if we set the stdio ptr..." >&4
12127 /* Can we scream? */
12128 /* Eat dust sed :-) */
12129 /* In the buffer space, no one can hear you scream. */
12130 #$i_stdlib I_STDLIB
12132 #include <stdlib.h>
12134 #define FILE_ptr(fp) $stdio_ptr
12135 #define FILE_cnt(fp) $stdio_cnt
12136 #include <sys/types.h>
12138 FILE *fp = fopen("try.c", "r");
12143 puts("Fail even to read");
12146 c = getc(fp); /* Read away the first # */
12148 puts("Fail even to read");
12152 18 <= FILE_cnt(fp) &&
12153 strncmp(FILE_ptr(fp), "include <stdio.h>\n", 18) == 0
12155 puts("Fail even to read");
12158 ptr = (char*) FILE_ptr(fp);
12159 cnt = (size_t)FILE_cnt(fp);
12161 FILE_ptr(fp) += 42;
12163 if ((char*)FILE_ptr(fp) != (ptr + 42)) {
12164 printf("Fail ptr check %p != %p", FILE_ptr(fp), (ptr + 42));
12167 if (FILE_cnt(fp) <= 20) {
12168 printf ("Fail (<20 chars to test)");
12171 if (strncmp(FILE_ptr(fp), "Eat dust sed :-) */\n", 20) != 0) {
12172 puts("Fail compare");
12175 if (cnt == FILE_cnt(fp)) {
12176 puts("Pass_unchanged");
12179 if (FILE_cnt(fp) == (cnt - 42)) {
12180 puts("Pass_changed");
12183 printf("Fail count was %d now %d\n", cnt, FILE_cnt(fp));
12189 if eval $compile && $to try.c; then
12190 case `$run ./try` in
12192 echo "Increasing ptr in your stdio decreases cnt by the same amount. Good." >&4
12193 d_stdio_ptr_lval_sets_cnt="$define" ;;
12195 echo "Increasing ptr in your stdio leaves cnt unchanged. Good." >&4
12196 d_stdio_ptr_lval_nochange_cnt="$define" ;;
12198 echo "Increasing ptr in your stdio didn't do exactly what I expected. We'll not be doing that then." >&4 ;;
12200 echo "It appears attempting to set ptr in your stdio is a bad plan." >&4 ;;
12203 echo "It seems we can't set ptr in your stdio. Nevermind." >&4
12209 : see if _base is also standard
12211 case "$d_stdstdio" in
12215 #$i_stdlib I_STDLIB
12217 #include <stdlib.h>
12219 #define FILE_base(fp) $stdio_base
12220 #define FILE_bufsiz(fp) $stdio_bufsiz
12222 FILE *fp = fopen("try.c", "r");
12225 19 <= FILE_bufsiz(fp) &&
12226 strncmp(FILE_base(fp), "#include <stdio.h>\n", 19) == 0
12233 if eval $compile && $to try.c; then
12234 if $run ./try; then
12235 echo "And its _base field acts std."
12238 echo "But its _base field isn't std."
12241 echo "However, it seems to be lacking the _base field."
12249 : see if fast_stdio exists
12251 case "$d_stdstdio:$d_stdio_ptr_lval" in
12253 case "$d_stdio_cnt_lval$d_stdio_ptr_lval_sets_cnt" in
12255 echo "You seem to have 'fast stdio' to directly manipulate the stdio buffers." >& 4
12266 : see if fchdir exists
12267 set fchdir d_fchdir
12270 : see if fchmod exists
12271 set fchmod d_fchmod
12274 : see if fchown exists
12275 set fchown d_fchown
12278 : see if this is an fcntl system
12283 : See if fcntl-based locking works.
12285 #$i_stdlib I_STDLIB
12287 #include <stdlib.h>
12289 #include <unistd.h>
12291 #include <signal.h>
12292 $signal_t blech(x) int x; { exit(3); }
12294 #if defined(F_SETLK) && defined(F_SETLKW)
12295 struct flock flock;
12297 fd = open("try.c", O_RDONLY);
12298 flock.l_type = F_RDLCK;
12299 flock.l_whence = SEEK_SET;
12300 flock.l_start = flock.l_len = 0;
12301 signal(SIGALRM, blech);
12303 retval = fcntl(fd, F_SETLK, &flock);
12305 (retval < 0 ? exit(2) : exit(0));
12311 echo "Checking if fcntl-based file locking works... "
12315 if eval $compile_ok; then
12316 if $run ./try; then
12317 echo "Yes, it seems to work."
12320 echo "Nope, it didn't work."
12325 *** I had to forcibly timeout from fcntl(..., F_SETLK, ...).
12326 *** This is (almost) impossible.
12327 *** If your NFS lock daemons are not feeling well, something like
12328 *** this may happen, please investigate. Cannot continue, aborting.
12336 echo "I'm unable to compile the test program, so I'll assume not."
12341 echo "Nope, since you don't even have fcntl()."
12344 set d_fcntl_can_lock
12349 : check for fd_set items
12352 Checking to see how well your C compiler handles fd_set and friends ...
12355 #$i_stdlib I_STDLIB
12357 #include <stdlib.h>
12359 #$i_systime I_SYS_TIME
12360 #$i_sysselct I_SYS_SELECT
12361 #$d_socket HAS_SOCKET
12362 #include <sys/types.h>
12364 #include <sys/socket.h> /* Might include <sys/bsdtypes.h> */
12367 #include <sys/time.h>
12369 #ifdef I_SYS_SELECT
12370 #include <sys/select.h>
12379 #if defined(FD_SET) && defined(FD_CLR) && defined(FD_ISSET) && defined(FD_ZERO)
12387 if eval $compile; then
12388 d_fds_bits="$define"
12390 echo "Well, your system knows about the normal fd_set typedef..." >&4
12391 if $run ./try; then
12392 echo "and you have the normal fd_set macros (just as I'd expect)." >&4
12393 d_fd_macros="$define"
12396 but not the normal fd_set macros! Gaaack! I'll have to cover for you.
12398 d_fd_macros="$undef"
12402 Hmm, your compiler has some difficulty with fd_set. Checking further...
12405 if eval $compile; then
12406 d_fds_bits="$undef"
12408 echo "Well, your system has some sort of fd_set available..." >&4
12409 if $run ./try; then
12410 echo "and you have the normal fd_set macros." >&4
12411 d_fd_macros="$define"
12414 but not the normal fd_set macros! Gross! More work for me...
12416 d_fd_macros="$undef"
12419 echo "Well, you got zip. That's OK, I can roll my own fd_set stuff." >&4
12421 d_fds_bits="$undef"
12422 d_fd_macros="$undef"
12427 : see if fgetpos exists
12428 set fgetpos d_fgetpos
12431 : see if finite exists
12432 set finite d_finite
12435 : see if finitel exists
12436 set finitel d_finitel
12439 : see if flock exists
12443 : see if prototype for flock is available
12445 set d_flockproto flock $i_sysfile sys/file.h
12448 : see if fork exists
12452 : see if fp_class exists
12453 set fp_class d_fp_class
12456 : see if pathconf exists
12457 set pathconf d_pathconf
12460 : see if fpathconf exists
12461 set fpathconf d_fpathconf
12464 : see if fpclass exists
12465 set fpclass d_fpclass
12468 : see if fpclassify exists
12469 set fpclassify d_fpclassify
12472 : see if fpclassl exists
12473 set fpclassl d_fpclassl
12477 : check for fpos64_t
12479 echo "Checking to see if you have fpos64_t..." >&4
12482 int main() { fpos64_t x = 7; }
12485 if eval $compile; then
12487 echo "You have fpos64_t."
12490 echo "You do not have fpos64_t."
12491 case "$fpossize" in
12492 8) echo "(Your fpos_t is 64 bits, so you could use that.)" ;;
12499 : see if frexpl exists
12500 set frexpl d_frexpl
12503 : see if this is a sys/param system
12504 set sys/param.h i_sysparam
12507 : see if this is a sys/mount.h system
12508 set sys/mount.h i_sysmount
12513 echo "Checking to see if your system supports struct fs_data..." >&4
12514 set d_fs_data_s fs_data $i_systypes sys/types.h $i_sysparam sys/param.h $i_sysmount sys/mount.h
12516 case "$d_fs_data_s" in
12517 "$define") echo "Yes, it does." ;;
12518 *) echo "No, it doesn't." ;;
12521 : see if fseeko exists
12522 set fseeko d_fseeko
12524 case "$longsize" in
12525 8) echo "(Your long is 64 bits, so you could use fseek.)" ;;
12528 : see if fsetpos exists
12529 set fsetpos d_fsetpos
12533 : see if fstatfs exists
12534 set fstatfs d_fstatfs
12538 : see if statvfs exists
12539 set statvfs d_statvfs
12542 : see if fstatvfs exists
12543 set fstatvfs d_fstatvfs
12547 : see if fsync exists
12551 : see if ftello exists
12552 set ftello d_ftello
12554 case "$longsize" in
12555 8) echo "(Your long is 64 bits, so you could use ftell.)" ;;
12558 : see if getcwd exists
12559 set getcwd d_getcwd
12562 : see if getespwnam exists
12563 set getespwnam d_getespwnam
12567 : see if getfsstat exists
12568 set getfsstat d_getfsstat
12571 : see if getgrent exists
12572 set getgrent d_getgrent
12575 : see if getgrent_r exists
12576 set getgrent_r d_getgrent_r
12578 case "$d_getgrent_r" in
12580 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
12581 case "$d_getgrent_r_proto:$usethreads" in
12582 ":define") d_getgrent_r_proto=define
12583 set d_getgrent_r_proto getgrent_r $hdrs
12587 case "$d_getgrent_r_proto" in
12589 case "$getgrent_r_proto" in
12590 ''|0) try='int getgrent_r(struct group*, char*, size_t, struct group**);'
12591 ./protochk "extern $try" $hdrs && getgrent_r_proto=I_SBWR ;;
12593 case "$getgrent_r_proto" in
12594 ''|0) try='int getgrent_r(struct group*, char*, int, struct group**);'
12595 ./protochk "extern $try" $hdrs && getgrent_r_proto=I_SBIR ;;
12597 case "$getgrent_r_proto" in
12598 ''|0) try='struct group* getgrent_r(struct group*, char*, size_t);'
12599 ./protochk "extern $try" $hdrs && getgrent_r_proto=S_SBW ;;
12601 case "$getgrent_r_proto" in
12602 ''|0) try='struct group* getgrent_r(struct group*, char*, int);'
12603 ./protochk "extern $try" $hdrs && getgrent_r_proto=S_SBI ;;
12605 case "$getgrent_r_proto" in
12606 ''|0) try='int getgrent_r(struct group*, char*, int);'
12607 ./protochk "extern $try" $hdrs && getgrent_r_proto=I_SBI ;;
12609 case "$getgrent_r_proto" in
12610 ''|0) try='int getgrent_r(struct group*, char*, int, FILE**);'
12611 ./protochk "extern $try" $hdrs && getgrent_r_proto=I_SBIH ;;
12613 case "$getgrent_r_proto" in
12614 ''|0) d_getgrent_r=undef
12616 echo "Disabling getgrent_r, cannot determine prototype." >&4 ;;
12617 * ) case "$getgrent_r_proto" in
12618 REENTRANT_PROTO*) ;;
12619 *) getgrent_r_proto="REENTRANT_PROTO_$getgrent_r_proto" ;;
12621 echo "Prototype: $try" ;;
12624 *) case "$usethreads" in
12625 define) echo "getgrent_r has no prototype, not using it." >&4 ;;
12632 *) getgrent_r_proto=0
12636 : see if getgrgid_r exists
12637 set getgrgid_r d_getgrgid_r
12639 case "$d_getgrgid_r" in
12641 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
12642 case "$d_getgrgid_r_proto:$usethreads" in
12643 ":define") d_getgrgid_r_proto=define
12644 set d_getgrgid_r_proto getgrgid_r $hdrs
12648 case "$d_getgrgid_r_proto" in
12650 case "$getgrgid_r_proto" in
12651 ''|0) try='int getgrgid_r(gid_t, struct group*, char*, size_t, struct group**);'
12652 ./protochk "extern $try" $hdrs && getgrgid_r_proto=I_TSBWR ;;
12654 case "$getgrgid_r_proto" in
12655 ''|0) try='int getgrgid_r(gid_t, struct group*, char*, int, struct group**);'
12656 ./protochk "extern $try" $hdrs && getgrgid_r_proto=I_TSBIR ;;
12658 case "$getgrgid_r_proto" in
12659 ''|0) try='int getgrgid_r(gid_t, struct group*, char*, int);'
12660 ./protochk "extern $try" $hdrs && getgrgid_r_proto=I_TSBI ;;
12662 case "$getgrgid_r_proto" in
12663 ''|0) try='struct group* getgrgid_r(gid_t, struct group*, char*, int);'
12664 ./protochk "extern $try" $hdrs && getgrgid_r_proto=S_TSBI ;;
12666 case "$getgrgid_r_proto" in
12667 ''|0) d_getgrgid_r=undef
12669 echo "Disabling getgrgid_r, cannot determine prototype." >&4 ;;
12670 * ) case "$getgrgid_r_proto" in
12671 REENTRANT_PROTO*) ;;
12672 *) getgrgid_r_proto="REENTRANT_PROTO_$getgrgid_r_proto" ;;
12674 echo "Prototype: $try" ;;
12677 *) case "$usethreads" in
12678 define) echo "getgrgid_r has no prototype, not using it." >&4 ;;
12685 *) getgrgid_r_proto=0
12689 : see if getgrnam_r exists
12690 set getgrnam_r d_getgrnam_r
12692 case "$d_getgrnam_r" in
12694 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
12695 case "$d_getgrnam_r_proto:$usethreads" in
12696 ":define") d_getgrnam_r_proto=define
12697 set d_getgrnam_r_proto getgrnam_r $hdrs
12701 case "$d_getgrnam_r_proto" in
12703 case "$getgrnam_r_proto" in
12704 ''|0) try='int getgrnam_r(const char*, struct group*, char*, size_t, struct group**);'
12705 ./protochk "extern $try" $hdrs && getgrnam_r_proto=I_CSBWR ;;
12707 case "$getgrnam_r_proto" in
12708 ''|0) try='int getgrnam_r(const char*, struct group*, char*, int, struct group**);'
12709 ./protochk "extern $try" $hdrs && getgrnam_r_proto=I_CSBIR ;;
12711 case "$getgrnam_r_proto" in
12712 ''|0) try='struct group* getgrnam_r(const char*, char*, int);'
12713 ./protochk "extern $try" $hdrs && getgrnam_r_proto=S_CBI ;;
12715 case "$getgrnam_r_proto" in
12716 ''|0) try='int getgrnam_r(const char*, struct group*, char*, int);'
12717 ./protochk "extern $try" $hdrs && getgrnam_r_proto=I_CSBI ;;
12719 case "$getgrnam_r_proto" in
12720 ''|0) try='struct group* getgrnam_r(const char*, struct group*, char*, int);'
12721 ./protochk "extern $try" $hdrs && getgrnam_r_proto=S_CSBI ;;
12723 case "$getgrnam_r_proto" in
12724 ''|0) d_getgrnam_r=undef
12726 echo "Disabling getgrnam_r, cannot determine prototype." >&4 ;;
12727 * ) case "$getgrnam_r_proto" in
12728 REENTRANT_PROTO*) ;;
12729 *) getgrnam_r_proto="REENTRANT_PROTO_$getgrnam_r_proto" ;;
12731 echo "Prototype: $try" ;;
12734 *) case "$usethreads" in
12735 define) echo "getgrnam_r has no prototype, not using it." >&4 ;;
12742 *) getgrnam_r_proto=0
12746 : see if gethostbyaddr exists
12747 set gethostbyaddr d_gethbyaddr
12750 : see if gethostbyname exists
12751 set gethostbyname d_gethbyname
12754 : see if gethostent exists
12755 set gethostent d_gethent
12758 : see how we will look up host name
12761 if set gethostname val -f d_gethname; eval $csym; $val; then
12762 echo 'gethostname() found.' >&4
12763 d_gethname="$define"
12766 if set uname val -f d_uname; eval $csym; $val; then
12769 uname() was found, but you're running xenix, and older versions of xenix
12770 have a broken uname(). If you don't really know whether your xenix is old
12771 enough to have a broken system call, use the default answer.
12776 "$define") dflt=n;;
12778 rp='Is your uname() broken?'
12781 n*) d_uname="$define"; call=uname;;
12784 echo 'uname() found.' >&4
12791 case "$d_gethname" in
12792 '') d_gethname="$undef";;
12795 '') d_uname="$undef";;
12797 case "$d_uname$d_gethname" in
12802 Every now and then someone has a $call() that lies about the hostname
12803 but can't be fixed for political or economic reasons. If you wish, I can
12804 pretend $call() isn't there and maybe compute hostname at run-time
12805 thanks to the '$phostname' command.
12808 rp="Shall I ignore $call() from now on?"
12811 y*) d_uname="$undef" d_gethname="$undef"; $echo $n "Okay...$c";;
12814 case "$phostname" in
12815 '') aphostname='';;
12816 *) case "$aphostname" in
12818 *) set X $phostname
12822 file=`./loc $file $file $pth`
12823 aphostname=`echo $file $*`
12828 case "$d_uname$d_gethname" in
12831 case "$phostname" in
12833 echo "There will be no way for $package to get your hostname." >&4;;
12835 echo "I'll use 'popen("'"'$aphostname'", "r")'"' to get your hostname." >&4
12839 case "$d_phostname" in
12840 '') d_phostname="$undef";;
12843 : see if gethostbyaddr_r exists
12844 set gethostbyaddr_r d_gethostbyaddr_r
12846 case "$d_gethostbyaddr_r" in
12848 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
12849 case "$d_gethostbyaddr_r_proto:$usethreads" in
12850 ":define") d_gethostbyaddr_r_proto=define
12851 set d_gethostbyaddr_r_proto gethostbyaddr_r $hdrs
12855 case "$d_gethostbyaddr_r_proto" in
12857 case "$gethostbyaddr_r_proto" in
12858 ''|0) try='int gethostbyaddr_r(const char*, size_t, int, struct hostent*, char*, size_t, struct hostent**, int*);'
12859 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=I_CWISBWRE ;;
12861 case "$gethostbyaddr_r_proto" in
12862 ''|0) try='struct hostent* gethostbyaddr_r(const char*, size_t, int, struct hostent*, char*, size_t, int, int*);'
12863 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=S_CWISBWIE ;;
12865 case "$gethostbyaddr_r_proto" in
12866 ''|0) try='struct hostent* gethostbyaddr_r(const char*, size_t, int, struct hostent*, char*, int, int*);'
12867 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=S_CWISBIE ;;
12869 case "$gethostbyaddr_r_proto" in
12870 ''|0) try='struct hostent* gethostbyaddr_r(const void*, size_t, int, struct hostent*, char*, int, int*);'
12871 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=S_TWISBIE ;;
12873 case "$gethostbyaddr_r_proto" in
12874 ''|0) try='struct hostent* gethostbyaddr_r(const char*, int, int, struct hostent*, char*, int, int*);'
12875 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=S_CIISBIE ;;
12877 case "$gethostbyaddr_r_proto" in
12878 ''|0) try='struct hostent* gethostbyaddr_r(const char*, struct hostent*, char*, int, int*);'
12879 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=S_CSBIE ;;
12881 case "$gethostbyaddr_r_proto" in
12882 ''|0) try='struct hostent* gethostbyaddr_r(const void*, struct hostent*, char*, int, int*);'
12883 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=S_TSBIE ;;
12885 case "$gethostbyaddr_r_proto" in
12886 ''|0) try='int gethostbyaddr_r(const char*, size_t, int, struct hostent*, struct hostent_data*);'
12887 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=I_CWISD ;;
12889 case "$gethostbyaddr_r_proto" in
12890 ''|0) try='int gethostbyaddr_r(const char*, int, int, struct hostent*, struct hostent_data*);'
12891 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=I_CIISD ;;
12893 case "$gethostbyaddr_r_proto" in
12894 ''|0) try='int gethostbyaddr_r(const char*, int, int);'
12895 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=I_CII ;;
12897 case "$gethostbyaddr_r_proto" in
12898 ''|0) try='int gethostbyaddr_r(const void*, socklen_t, int, struct hostent*, char*, size_t, struct hostent**, int*);'
12899 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=I_TsISBWRE ;;
12901 case "$gethostbyaddr_r_proto" in
12902 ''|0) d_gethostbyaddr_r=undef
12903 gethostbyaddr_r_proto=0
12904 echo "Disabling gethostbyaddr_r, cannot determine prototype." >&4 ;;
12905 * ) case "$gethostbyaddr_r_proto" in
12906 REENTRANT_PROTO*) ;;
12907 *) gethostbyaddr_r_proto="REENTRANT_PROTO_$gethostbyaddr_r_proto" ;;
12909 echo "Prototype: $try" ;;
12912 *) case "$usethreads" in
12913 define) echo "gethostbyaddr_r has no prototype, not using it." >&4 ;;
12915 d_gethostbyaddr_r=undef
12916 gethostbyaddr_r_proto=0
12920 *) gethostbyaddr_r_proto=0
12924 : see if gethostbyname_r exists
12925 set gethostbyname_r d_gethostbyname_r
12927 case "$d_gethostbyname_r" in
12929 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
12930 case "$d_gethostbyname_r_proto:$usethreads" in
12931 ":define") d_gethostbyname_r_proto=define
12932 set d_gethostbyname_r_proto gethostbyname_r $hdrs
12936 case "$d_gethostbyname_r_proto" in
12938 case "$gethostbyname_r_proto" in
12939 ''|0) try='int gethostbyname_r(const char*, struct hostent*, char*, size_t, struct hostent**, int*);'
12940 ./protochk "extern $try" $hdrs && gethostbyname_r_proto=I_CSBWRE ;;
12942 case "$gethostbyname_r_proto" in
12943 ''|0) try='struct hostent* gethostbyname_r(const char*, struct hostent*, char*, int, int*);'
12944 ./protochk "extern $try" $hdrs && gethostbyname_r_proto=S_CSBIE ;;
12946 case "$gethostbyname_r_proto" in
12947 ''|0) try='int gethostbyname_r(const char*, struct hostent*, struct hostent_data*);'
12948 ./protochk "extern $try" $hdrs && gethostbyname_r_proto=I_CSD ;;
12950 case "$gethostbyname_r_proto" in
12951 ''|0) d_gethostbyname_r=undef
12952 gethostbyname_r_proto=0
12953 echo "Disabling gethostbyname_r, cannot determine prototype." >&4 ;;
12954 * ) case "$gethostbyname_r_proto" in
12955 REENTRANT_PROTO*) ;;
12956 *) gethostbyname_r_proto="REENTRANT_PROTO_$gethostbyname_r_proto" ;;
12958 echo "Prototype: $try" ;;
12961 *) case "$usethreads" in
12962 define) echo "gethostbyname_r has no prototype, not using it." >&4 ;;
12964 d_gethostbyname_r=undef
12965 gethostbyname_r_proto=0
12969 *) gethostbyname_r_proto=0
12973 : see if gethostent_r exists
12974 set gethostent_r d_gethostent_r
12976 case "$d_gethostent_r" in
12978 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
12979 case "$d_gethostent_r_proto:$usethreads" in
12980 ":define") d_gethostent_r_proto=define
12981 set d_gethostent_r_proto gethostent_r $hdrs
12985 case "$d_gethostent_r_proto" in
12987 case "$gethostent_r_proto" in
12988 ''|0) try='int gethostent_r(struct hostent*, char*, size_t, struct hostent**, int*);'
12989 ./protochk "extern $try" $hdrs && gethostent_r_proto=I_SBWRE ;;
12991 case "$gethostent_r_proto" in
12992 ''|0) try='int gethostent_r(struct hostent*, char*, int, int*);'
12993 ./protochk "extern $try" $hdrs && gethostent_r_proto=I_SBIE ;;
12995 case "$gethostent_r_proto" in
12996 ''|0) try='struct hostent* gethostent_r(struct hostent*, char*, int, int*);'
12997 ./protochk "extern $try" $hdrs && gethostent_r_proto=S_SBIE ;;
12999 case "$gethostent_r_proto" in
13000 ''|0) try='struct hostent* gethostent_r(struct hostent*, char*, int);'
13001 ./protochk "extern $try" $hdrs && gethostent_r_proto=S_SBI ;;
13003 case "$gethostent_r_proto" in
13004 ''|0) try='int gethostent_r(struct hostent*, char*, int);'
13005 ./protochk "extern $try" $hdrs && gethostent_r_proto=I_SBI ;;
13007 case "$gethostent_r_proto" in
13008 ''|0) try='int gethostent_r(struct hostent*, struct hostent_data*);'
13009 ./protochk "extern $try" $hdrs && gethostent_r_proto=I_SD ;;
13011 case "$gethostent_r_proto" in
13012 ''|0) d_gethostent_r=undef
13013 gethostent_r_proto=0
13014 echo "Disabling gethostent_r, cannot determine prototype." >&4 ;;
13015 * ) case "$gethostent_r_proto" in
13016 REENTRANT_PROTO*) ;;
13017 *) gethostent_r_proto="REENTRANT_PROTO_$gethostent_r_proto" ;;
13019 echo "Prototype: $try" ;;
13022 *) case "$usethreads" in
13023 define) echo "gethostent_r has no prototype, not using it." >&4 ;;
13025 d_gethostent_r=undef
13026 gethostent_r_proto=0
13030 *) gethostent_r_proto=0
13034 : see if prototypes for various gethostxxx netdb.h functions are available
13036 set d_gethostprotos gethostent $i_netdb netdb.h
13039 : see if getitimer exists
13040 set getitimer d_getitimer
13043 : see if getlogin exists
13044 set getlogin d_getlogin
13047 : see if getlogin_r exists
13048 set getlogin_r d_getlogin_r
13050 case "$d_getlogin_r" in
13052 hdrs="$i_systypes sys/types.h define stdio.h $i_unistd unistd.h"
13053 case "$d_getlogin_r_proto:$usethreads" in
13054 ":define") d_getlogin_r_proto=define
13055 set d_getlogin_r_proto getlogin_r $hdrs
13059 case "$d_getlogin_r_proto" in
13061 case "$getlogin_r_proto" in
13062 ''|0) try='int getlogin_r(char*, size_t);'
13063 ./protochk "extern $try" $hdrs && getlogin_r_proto=I_BW ;;
13065 case "$getlogin_r_proto" in
13066 ''|0) try='int getlogin_r(char*, int);'
13067 ./protochk "extern $try" $hdrs && getlogin_r_proto=I_BI ;;
13069 case "$getlogin_r_proto" in
13070 ''|0) try='char* getlogin_r(char*, size_t);'
13071 ./protochk "extern $try" $hdrs && getlogin_r_proto=B_BW ;;
13073 case "$getlogin_r_proto" in
13074 ''|0) try='char* getlogin_r(char*, int);'
13075 ./protochk "extern $try" $hdrs && getlogin_r_proto=B_BI ;;
13077 case "$getlogin_r_proto" in
13078 ''|0) d_getlogin_r=undef
13080 echo "Disabling getlogin_r, cannot determine prototype." >&4 ;;
13081 * ) case "$getlogin_r_proto" in
13082 REENTRANT_PROTO*) ;;
13083 *) getlogin_r_proto="REENTRANT_PROTO_$getlogin_r_proto" ;;
13085 echo "Prototype: $try" ;;
13088 *) case "$usethreads" in
13089 define) echo "getlogin_r has no prototype, not using it." >&4 ;;
13096 *) getlogin_r_proto=0
13100 : see if getmnt exists
13101 set getmnt d_getmnt
13104 : see if getmntent exists
13105 set getmntent d_getmntent
13108 : see if getnetbyaddr exists
13109 set getnetbyaddr d_getnbyaddr
13112 : see if getnetbyname exists
13113 set getnetbyname d_getnbyname
13116 : see if getnetent exists
13117 set getnetent d_getnent
13120 : see if getnetbyaddr_r exists
13121 set getnetbyaddr_r d_getnetbyaddr_r
13123 case "$d_getnetbyaddr_r" in
13125 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13126 case "$d_getnetbyaddr_r_proto:$usethreads" in
13127 ":define") d_getnetbyaddr_r_proto=define
13128 set d_getnetbyaddr_r_proto getnetbyaddr_r $hdrs
13132 case "$d_getnetbyaddr_r_proto" in
13134 case "$getnetbyaddr_r_proto" in
13135 ''|0) try='int getnetbyaddr_r(unsigned long, int, struct netent*, char*, size_t, struct netent**, int*);'
13136 ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=I_UISBWRE ;;
13138 case "$getnetbyaddr_r_proto" in
13139 ''|0) try='int getnetbyaddr_r(long, int, struct netent*, char*, int);'
13140 ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=I_LISBI ;;
13142 case "$getnetbyaddr_r_proto" in
13143 ''|0) try='struct netent* getnetbyaddr_r(in_addr_t, int, struct netent*, char*, int);'
13144 ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=S_TISBI ;;
13146 case "$getnetbyaddr_r_proto" in
13147 ''|0) try='struct netent* getnetbyaddr_r(long, int, struct netent*, char*, int);'
13148 ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=S_LISBI ;;
13150 case "$getnetbyaddr_r_proto" in
13151 ''|0) try='int getnetbyaddr_r(in_addr_t, int, struct netent*, struct netent_data*);'
13152 ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=I_TISD ;;
13154 case "$getnetbyaddr_r_proto" in
13155 ''|0) try='int getnetbyaddr_r(long, int, struct netent*, struct netent_data*);'
13156 ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=I_LISD ;;
13158 case "$getnetbyaddr_r_proto" in
13159 ''|0) try='int getnetbyaddr_r(int, int, struct netent*, struct netent_data*);'
13160 ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=I_IISD ;;
13162 case "$getnetbyaddr_r_proto" in
13163 ''|0) try='int getnetbyaddr_r(uint32_t, int, struct netent*, char*, size_t, struct netent**, int*);'
13164 ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=I_uISBWRE ;;
13166 case "$getnetbyaddr_r_proto" in
13167 ''|0) d_getnetbyaddr_r=undef
13168 getnetbyaddr_r_proto=0
13169 echo "Disabling getnetbyaddr_r, cannot determine prototype." >&4 ;;
13170 * ) case "$getnetbyaddr_r_proto" in
13171 REENTRANT_PROTO*) ;;
13172 *) getnetbyaddr_r_proto="REENTRANT_PROTO_$getnetbyaddr_r_proto" ;;
13174 echo "Prototype: $try" ;;
13177 *) case "$usethreads" in
13178 define) echo "getnetbyaddr_r has no prototype, not using it." >&4 ;;
13180 d_getnetbyaddr_r=undef
13181 getnetbyaddr_r_proto=0
13185 *) getnetbyaddr_r_proto=0
13189 : see if getnetbyname_r exists
13190 set getnetbyname_r d_getnetbyname_r
13192 case "$d_getnetbyname_r" in
13194 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13195 case "$d_getnetbyname_r_proto:$usethreads" in
13196 ":define") d_getnetbyname_r_proto=define
13197 set d_getnetbyname_r_proto getnetbyname_r $hdrs
13201 case "$d_getnetbyname_r_proto" in
13203 case "$getnetbyname_r_proto" in
13204 ''|0) try='int getnetbyname_r(const char*, struct netent*, char*, size_t, struct netent**, int*);'
13205 ./protochk "extern $try" $hdrs && getnetbyname_r_proto=I_CSBWRE ;;
13207 case "$getnetbyname_r_proto" in
13208 ''|0) try='int getnetbyname_r(const char*, struct netent*, char*, int);'
13209 ./protochk "extern $try" $hdrs && getnetbyname_r_proto=I_CSBI ;;
13211 case "$getnetbyname_r_proto" in
13212 ''|0) try='struct netent* getnetbyname_r(const char*, struct netent*, char*, int);'
13213 ./protochk "extern $try" $hdrs && getnetbyname_r_proto=S_CSBI ;;
13215 case "$getnetbyname_r_proto" in
13216 ''|0) try='int getnetbyname_r(const char*, struct netent*, struct netent_data*);'
13217 ./protochk "extern $try" $hdrs && getnetbyname_r_proto=I_CSD ;;
13219 case "$getnetbyname_r_proto" in
13220 ''|0) d_getnetbyname_r=undef
13221 getnetbyname_r_proto=0
13222 echo "Disabling getnetbyname_r, cannot determine prototype." >&4 ;;
13223 * ) case "$getnetbyname_r_proto" in
13224 REENTRANT_PROTO*) ;;
13225 *) getnetbyname_r_proto="REENTRANT_PROTO_$getnetbyname_r_proto" ;;
13227 echo "Prototype: $try" ;;
13230 *) case "$usethreads" in
13231 define) echo "getnetbyname_r has no prototype, not using it." >&4 ;;
13233 d_getnetbyname_r=undef
13234 getnetbyname_r_proto=0
13238 *) getnetbyname_r_proto=0
13242 : see if getnetent_r exists
13243 set getnetent_r d_getnetent_r
13245 case "$d_getnetent_r" in
13247 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13248 case "$d_getnetent_r_proto:$usethreads" in
13249 ":define") d_getnetent_r_proto=define
13250 set d_getnetent_r_proto getnetent_r $hdrs
13254 case "$d_getnetent_r_proto" in
13256 case "$getnetent_r_proto" in
13257 ''|0) try='int getnetent_r(struct netent*, char*, size_t, struct netent**, int*);'
13258 ./protochk "extern $try" $hdrs && getnetent_r_proto=I_SBWRE ;;
13260 case "$getnetent_r_proto" in
13261 ''|0) try='int getnetent_r(struct netent*, char*, int, int*);'
13262 ./protochk "extern $try" $hdrs && getnetent_r_proto=I_SBIE ;;
13264 case "$getnetent_r_proto" in
13265 ''|0) try='struct netent* getnetent_r(struct netent*, char*, int, int*);'
13266 ./protochk "extern $try" $hdrs && getnetent_r_proto=S_SBIE ;;
13268 case "$getnetent_r_proto" in
13269 ''|0) try='struct netent* getnetent_r(struct netent*, char*, int);'
13270 ./protochk "extern $try" $hdrs && getnetent_r_proto=S_SBI ;;
13272 case "$getnetent_r_proto" in
13273 ''|0) try='int getnetent_r(struct netent*, char*, int);'
13274 ./protochk "extern $try" $hdrs && getnetent_r_proto=I_SBI ;;
13276 case "$getnetent_r_proto" in
13277 ''|0) try='int getnetent_r(struct netent*, struct netent_data*);'
13278 ./protochk "extern $try" $hdrs && getnetent_r_proto=I_SD ;;
13280 case "$getnetent_r_proto" in
13281 ''|0) d_getnetent_r=undef
13282 getnetent_r_proto=0
13283 echo "Disabling getnetent_r, cannot determine prototype." >&4 ;;
13284 * ) case "$getnetent_r_proto" in
13285 REENTRANT_PROTO*) ;;
13286 *) getnetent_r_proto="REENTRANT_PROTO_$getnetent_r_proto" ;;
13288 echo "Prototype: $try" ;;
13291 *) case "$usethreads" in
13292 define) echo "getnetent_r has no prototype, not using it." >&4 ;;
13294 d_getnetent_r=undef
13295 getnetent_r_proto=0
13299 *) getnetent_r_proto=0
13303 : see if prototypes for various getnetxxx netdb.h functions are available
13305 set d_getnetprotos getnetent $i_netdb netdb.h
13308 : see if getpagesize exists
13309 set getpagesize d_getpagsz
13313 : see if getprotobyname exists
13314 set getprotobyname d_getpbyname
13317 : see if getprotobynumber exists
13318 set getprotobynumber d_getpbynumber
13321 : see if getprotoent exists
13322 set getprotoent d_getpent
13325 : see if getpgid exists
13326 set getpgid d_getpgid
13329 : see if getpgrp2 exists
13330 set getpgrp2 d_getpgrp2
13333 : see if getppid exists
13334 set getppid d_getppid
13337 : see if getpriority exists
13338 set getpriority d_getprior
13341 : see if getprotobyname_r exists
13342 set getprotobyname_r d_getprotobyname_r
13344 case "$d_getprotobyname_r" in
13346 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13347 case "$d_getprotobyname_r_proto:$usethreads" in
13348 ":define") d_getprotobyname_r_proto=define
13349 set d_getprotobyname_r_proto getprotobyname_r $hdrs
13353 case "$d_getprotobyname_r_proto" in
13355 case "$getprotobyname_r_proto" in
13356 ''|0) try='int getprotobyname_r(const char*, struct protoent*, char*, size_t, struct protoent**);'
13357 ./protochk "extern $try" $hdrs && getprotobyname_r_proto=I_CSBWR ;;
13359 case "$getprotobyname_r_proto" in
13360 ''|0) try='struct protoent* getprotobyname_r(const char*, struct protoent*, char*, int);'
13361 ./protochk "extern $try" $hdrs && getprotobyname_r_proto=S_CSBI ;;
13363 case "$getprotobyname_r_proto" in
13364 ''|0) try='int getprotobyname_r(const char*, struct protoent*, struct protoent_data*);'
13365 ./protochk "extern $try" $hdrs && getprotobyname_r_proto=I_CSD ;;
13367 case "$getprotobyname_r_proto" in
13368 ''|0) d_getprotobyname_r=undef
13369 getprotobyname_r_proto=0
13370 echo "Disabling getprotobyname_r, cannot determine prototype." >&4 ;;
13371 * ) case "$getprotobyname_r_proto" in
13372 REENTRANT_PROTO*) ;;
13373 *) getprotobyname_r_proto="REENTRANT_PROTO_$getprotobyname_r_proto" ;;
13375 echo "Prototype: $try" ;;
13378 *) case "$usethreads" in
13379 define) echo "getprotobyname_r has no prototype, not using it." >&4 ;;
13381 d_getprotobyname_r=undef
13382 getprotobyname_r_proto=0
13386 *) getprotobyname_r_proto=0
13390 : see if getprotobynumber_r exists
13391 set getprotobynumber_r d_getprotobynumber_r
13393 case "$d_getprotobynumber_r" in
13395 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13396 case "$d_getprotobynumber_r_proto:$usethreads" in
13397 ":define") d_getprotobynumber_r_proto=define
13398 set d_getprotobynumber_r_proto getprotobynumber_r $hdrs
13402 case "$d_getprotobynumber_r_proto" in
13404 case "$getprotobynumber_r_proto" in
13405 ''|0) try='int getprotobynumber_r(int, struct protoent*, char*, size_t, struct protoent**);'
13406 ./protochk "extern $try" $hdrs && getprotobynumber_r_proto=I_ISBWR ;;
13408 case "$getprotobynumber_r_proto" in
13409 ''|0) try='struct protoent* getprotobynumber_r(int, struct protoent*, char*, int);'
13410 ./protochk "extern $try" $hdrs && getprotobynumber_r_proto=S_ISBI ;;
13412 case "$getprotobynumber_r_proto" in
13413 ''|0) try='int getprotobynumber_r(int, struct protoent*, struct protoent_data*);'
13414 ./protochk "extern $try" $hdrs && getprotobynumber_r_proto=I_ISD ;;
13416 case "$getprotobynumber_r_proto" in
13417 ''|0) d_getprotobynumber_r=undef
13418 getprotobynumber_r_proto=0
13419 echo "Disabling getprotobynumber_r, cannot determine prototype." >&4 ;;
13420 * ) case "$getprotobynumber_r_proto" in
13421 REENTRANT_PROTO*) ;;
13422 *) getprotobynumber_r_proto="REENTRANT_PROTO_$getprotobynumber_r_proto" ;;
13424 echo "Prototype: $try" ;;
13427 *) case "$usethreads" in
13428 define) echo "getprotobynumber_r has no prototype, not using it." >&4 ;;
13430 d_getprotobynumber_r=undef
13431 getprotobynumber_r_proto=0
13435 *) getprotobynumber_r_proto=0
13439 : see if getprotoent_r exists
13440 set getprotoent_r d_getprotoent_r
13442 case "$d_getprotoent_r" in
13444 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13445 case "$d_getprotoent_r_proto:$usethreads" in
13446 ":define") d_getprotoent_r_proto=define
13447 set d_getprotoent_r_proto getprotoent_r $hdrs
13451 case "$d_getprotoent_r_proto" in
13453 case "$getprotoent_r_proto" in
13454 ''|0) try='int getprotoent_r(struct protoent*, char*, size_t, struct protoent**);'
13455 ./protochk "extern $try" $hdrs && getprotoent_r_proto=I_SBWR ;;
13457 case "$getprotoent_r_proto" in
13458 ''|0) try='int getprotoent_r(struct protoent*, char*, int);'
13459 ./protochk "extern $try" $hdrs && getprotoent_r_proto=I_SBI ;;
13461 case "$getprotoent_r_proto" in
13462 ''|0) try='struct protoent* getprotoent_r(struct protoent*, char*, int);'
13463 ./protochk "extern $try" $hdrs && getprotoent_r_proto=S_SBI ;;
13465 case "$getprotoent_r_proto" in
13466 ''|0) try='int getprotoent_r(struct protoent*, struct protoent_data*);'
13467 ./protochk "extern $try" $hdrs && getprotoent_r_proto=I_SD ;;
13469 case "$getprotoent_r_proto" in
13470 ''|0) d_getprotoent_r=undef
13471 getprotoent_r_proto=0
13472 echo "Disabling getprotoent_r, cannot determine prototype." >&4 ;;
13473 * ) case "$getprotoent_r_proto" in
13474 REENTRANT_PROTO*) ;;
13475 *) getprotoent_r_proto="REENTRANT_PROTO_$getprotoent_r_proto" ;;
13477 echo "Prototype: $try" ;;
13480 *) case "$usethreads" in
13481 define) echo "getprotoent_r has no prototype, not using it." >&4 ;;
13483 d_getprotoent_r=undef
13484 getprotoent_r_proto=0
13488 *) getprotoent_r_proto=0
13492 : see if prototypes for various getprotoxxx netdb.h functions are available
13494 set d_getprotoprotos getprotoent $i_netdb netdb.h
13497 : see if getprpwnam exists
13498 set getprpwnam d_getprpwnam
13501 : see if getpwent exists
13502 set getpwent d_getpwent
13505 : see if getpwent_r exists
13506 set getpwent_r d_getpwent_r
13508 case "$d_getpwent_r" in
13510 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
13511 case "$d_getpwent_r_proto:$usethreads" in
13512 ":define") d_getpwent_r_proto=define
13513 set d_getpwent_r_proto getpwent_r $hdrs
13517 case "$d_getpwent_r_proto" in
13519 case "$getpwent_r_proto" in
13520 ''|0) try='int getpwent_r(struct passwd*, char*, size_t, struct passwd**);'
13521 ./protochk "extern $try" $hdrs && getpwent_r_proto=I_SBWR ;;
13523 case "$getpwent_r_proto" in
13524 ''|0) try='int getpwent_r(struct passwd*, char*, int, struct passwd**);'
13525 ./protochk "extern $try" $hdrs && getpwent_r_proto=I_SBIR ;;
13527 case "$getpwent_r_proto" in
13528 ''|0) try='struct passwd* getpwent_r(struct passwd*, char*, size_t);'
13529 ./protochk "extern $try" $hdrs && getpwent_r_proto=S_SBW ;;
13531 case "$getpwent_r_proto" in
13532 ''|0) try='struct passwd* getpwent_r(struct passwd*, char*, int);'
13533 ./protochk "extern $try" $hdrs && getpwent_r_proto=S_SBI ;;
13535 case "$getpwent_r_proto" in
13536 ''|0) try='int getpwent_r(struct passwd*, char*, int);'
13537 ./protochk "extern $try" $hdrs && getpwent_r_proto=I_SBI ;;
13539 case "$getpwent_r_proto" in
13540 ''|0) try='int getpwent_r(struct passwd*, char*, int, FILE**);'
13541 ./protochk "extern $try" $hdrs && getpwent_r_proto=I_SBIH ;;
13543 case "$getpwent_r_proto" in
13544 ''|0) d_getpwent_r=undef
13546 echo "Disabling getpwent_r, cannot determine prototype." >&4 ;;
13547 * ) case "$getpwent_r_proto" in
13548 REENTRANT_PROTO*) ;;
13549 *) getpwent_r_proto="REENTRANT_PROTO_$getpwent_r_proto" ;;
13551 echo "Prototype: $try" ;;
13554 *) case "$usethreads" in
13555 define) echo "getpwent_r has no prototype, not using it." >&4 ;;
13562 *) getpwent_r_proto=0
13566 : see if getpwnam_r exists
13567 set getpwnam_r d_getpwnam_r
13569 case "$d_getpwnam_r" in
13571 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
13572 case "$d_getpwnam_r_proto:$usethreads" in
13573 ":define") d_getpwnam_r_proto=define
13574 set d_getpwnam_r_proto getpwnam_r $hdrs
13578 case "$d_getpwnam_r_proto" in
13580 case "$getpwnam_r_proto" in
13581 ''|0) try='int getpwnam_r(const char*, struct passwd*, char*, size_t, struct passwd**);'
13582 ./protochk "extern $try" $hdrs && getpwnam_r_proto=I_CSBWR ;;
13584 case "$getpwnam_r_proto" in
13585 ''|0) try='int getpwnam_r(const char*, struct passwd*, char*, int, struct passwd**);'
13586 ./protochk "extern $try" $hdrs && getpwnam_r_proto=I_CSBIR ;;
13588 case "$getpwnam_r_proto" in
13589 ''|0) try='struct passwd* getpwnam_r(const char*, struct passwd*, char*, int);'
13590 ./protochk "extern $try" $hdrs && getpwnam_r_proto=S_CSBI ;;
13592 case "$getpwnam_r_proto" in
13593 ''|0) try='int getpwnam_r(const char*, struct passwd*, char*, int);'
13594 ./protochk "extern $try" $hdrs && getpwnam_r_proto=I_CSBI ;;
13596 case "$getpwnam_r_proto" in
13597 ''|0) d_getpwnam_r=undef
13599 echo "Disabling getpwnam_r, cannot determine prototype." >&4 ;;
13600 * ) case "$getpwnam_r_proto" in
13601 REENTRANT_PROTO*) ;;
13602 *) getpwnam_r_proto="REENTRANT_PROTO_$getpwnam_r_proto" ;;
13604 echo "Prototype: $try" ;;
13607 *) case "$usethreads" in
13608 define) echo "getpwnam_r has no prototype, not using it." >&4 ;;
13615 *) getpwnam_r_proto=0
13619 : see if getpwuid_r exists
13620 set getpwuid_r d_getpwuid_r
13622 case "$d_getpwuid_r" in
13624 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
13625 case "$d_getpwuid_r_proto:$usethreads" in
13626 ":define") d_getpwuid_r_proto=define
13627 set d_getpwuid_r_proto getpwuid_r $hdrs
13631 case "$d_getpwuid_r_proto" in
13633 case "$getpwuid_r_proto" in
13634 ''|0) try='int getpwuid_r(uid_t, struct passwd*, char*, size_t, struct passwd**);'
13635 ./protochk "extern $try" $hdrs && getpwuid_r_proto=I_TSBWR ;;
13637 case "$getpwuid_r_proto" in
13638 ''|0) try='int getpwuid_r(uid_t, struct passwd*, char*, int, struct passwd**);'
13639 ./protochk "extern $try" $hdrs && getpwuid_r_proto=I_TSBIR ;;
13641 case "$getpwuid_r_proto" in
13642 ''|0) try='int getpwuid_r(uid_t, struct passwd*, char*, int);'
13643 ./protochk "extern $try" $hdrs && getpwuid_r_proto=I_TSBI ;;
13645 case "$getpwuid_r_proto" in
13646 ''|0) try='struct passwd* getpwuid_r(uid_t, struct passwd*, char*, int);'
13647 ./protochk "extern $try" $hdrs && getpwuid_r_proto=S_TSBI ;;
13649 case "$getpwuid_r_proto" in
13650 ''|0) d_getpwuid_r=undef
13652 echo "Disabling getpwuid_r, cannot determine prototype." >&4 ;;
13653 * ) case "$getpwuid_r_proto" in
13654 REENTRANT_PROTO*) ;;
13655 *) getpwuid_r_proto="REENTRANT_PROTO_$getpwuid_r_proto" ;;
13657 echo "Prototype: $try" ;;
13660 *) case "$usethreads" in
13661 define) echo "getpwuid_r has no prototype, not using it." >&4 ;;
13668 *) getpwuid_r_proto=0
13673 : see if getservbyname exists
13674 set getservbyname d_getsbyname
13677 : see if getservbyport exists
13678 set getservbyport d_getsbyport
13681 : see if getservent exists
13682 set getservent d_getsent
13685 : see if getservbyname_r exists
13686 set getservbyname_r d_getservbyname_r
13688 case "$d_getservbyname_r" in
13690 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13691 case "$d_getservbyname_r_proto:$usethreads" in
13692 ":define") d_getservbyname_r_proto=define
13693 set d_getservbyname_r_proto getservbyname_r $hdrs
13697 case "$d_getservbyname_r_proto" in
13699 case "$getservbyname_r_proto" in
13700 ''|0) try='int getservbyname_r(const char*, const char*, struct servent*, char*, size_t, struct servent**);'
13701 ./protochk "extern $try" $hdrs && getservbyname_r_proto=I_CCSBWR ;;
13703 case "$getservbyname_r_proto" in
13704 ''|0) try='struct servent* getservbyname_r(const char*, const char*, struct servent*, char*, int);'
13705 ./protochk "extern $try" $hdrs && getservbyname_r_proto=S_CCSBI ;;
13707 case "$getservbyname_r_proto" in
13708 ''|0) try='int getservbyname_r(const char*, const char*, struct servent*, struct servent_data*);'
13709 ./protochk "extern $try" $hdrs && getservbyname_r_proto=I_CCSD ;;
13711 case "$getservbyname_r_proto" in
13712 ''|0) d_getservbyname_r=undef
13713 getservbyname_r_proto=0
13714 echo "Disabling getservbyname_r, cannot determine prototype." >&4 ;;
13715 * ) case "$getservbyname_r_proto" in
13716 REENTRANT_PROTO*) ;;
13717 *) getservbyname_r_proto="REENTRANT_PROTO_$getservbyname_r_proto" ;;
13719 echo "Prototype: $try" ;;
13722 *) case "$usethreads" in
13723 define) echo "getservbyname_r has no prototype, not using it." >&4 ;;
13725 d_getservbyname_r=undef
13726 getservbyname_r_proto=0
13730 *) getservbyname_r_proto=0
13734 : see if getservbyport_r exists
13735 set getservbyport_r d_getservbyport_r
13737 case "$d_getservbyport_r" in
13739 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13740 case "$d_getservbyport_r_proto:$usethreads" in
13741 ":define") d_getservbyport_r_proto=define
13742 set d_getservbyport_r_proto getservbyport_r $hdrs
13746 case "$d_getservbyport_r_proto" in
13748 case "$getservbyport_r_proto" in
13749 ''|0) try='int getservbyport_r(int, const char*, struct servent*, char*, size_t, struct servent**);'
13750 ./protochk "extern $try" $hdrs && getservbyport_r_proto=I_ICSBWR ;;
13752 case "$getservbyport_r_proto" in
13753 ''|0) try='struct servent* getservbyport_r(int, const char*, struct servent*, char*, int);'
13754 ./protochk "extern $try" $hdrs && getservbyport_r_proto=S_ICSBI ;;
13756 case "$getservbyport_r_proto" in
13757 ''|0) try='int getservbyport_r(int, const char*, struct servent*, struct servent_data*);'
13758 ./protochk "extern $try" $hdrs && getservbyport_r_proto=I_ICSD ;;
13760 case "$getservbyport_r_proto" in
13761 ''|0) d_getservbyport_r=undef
13762 getservbyport_r_proto=0
13763 echo "Disabling getservbyport_r, cannot determine prototype." >&4 ;;
13764 * ) case "$getservbyport_r_proto" in
13765 REENTRANT_PROTO*) ;;
13766 *) getservbyport_r_proto="REENTRANT_PROTO_$getservbyport_r_proto" ;;
13768 echo "Prototype: $try" ;;
13771 *) case "$usethreads" in
13772 define) echo "getservbyport_r has no prototype, not using it." >&4 ;;
13774 d_getservbyport_r=undef
13775 getservbyport_r_proto=0
13779 *) getservbyport_r_proto=0
13783 : see if getservent_r exists
13784 set getservent_r d_getservent_r
13786 case "$d_getservent_r" in
13788 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13789 case "$d_getservent_r_proto:$usethreads" in
13790 ":define") d_getservent_r_proto=define
13791 set d_getservent_r_proto getservent_r $hdrs
13795 case "$d_getservent_r_proto" in
13797 case "$getservent_r_proto" in
13798 ''|0) try='int getservent_r(struct servent*, char*, size_t, struct servent**);'
13799 ./protochk "extern $try" $hdrs && getservent_r_proto=I_SBWR ;;
13801 case "$getservent_r_proto" in
13802 ''|0) try='int getservent_r(struct servent*, char*, int);'
13803 ./protochk "extern $try" $hdrs && getservent_r_proto=I_SBI ;;
13805 case "$getservent_r_proto" in
13806 ''|0) try='struct servent* getservent_r(struct servent*, char*, int);'
13807 ./protochk "extern $try" $hdrs && getservent_r_proto=S_SBI ;;
13809 case "$getservent_r_proto" in
13810 ''|0) try='int getservent_r(struct servent*, struct servent_data*);'
13811 ./protochk "extern $try" $hdrs && getservent_r_proto=I_SD ;;
13813 case "$getservent_r_proto" in
13814 ''|0) d_getservent_r=undef
13815 getservent_r_proto=0
13816 echo "Disabling getservent_r, cannot determine prototype." >&4 ;;
13817 * ) case "$getservent_r_proto" in
13818 REENTRANT_PROTO*) ;;
13819 *) getservent_r_proto="REENTRANT_PROTO_$getservent_r_proto" ;;
13821 echo "Prototype: $try" ;;
13824 *) case "$usethreads" in
13825 define) echo "getservent_r has no prototype, not using it." >&4 ;;
13827 d_getservent_r=undef
13828 getservent_r_proto=0
13832 *) getservent_r_proto=0
13836 : see if prototypes for various getservxxx netdb.h functions are available
13838 set d_getservprotos getservent $i_netdb netdb.h
13841 : see if getspnam exists
13842 set getspnam d_getspnam
13845 : see if this is a shadow.h system
13846 set shadow.h i_shadow
13849 : see if getspnam_r exists
13850 set getspnam_r d_getspnam_r
13852 case "$d_getspnam_r" in
13854 hdrs="$i_systypes sys/types.h define stdio.h $i_shadow shadow.h"
13855 case "$d_getspnam_r_proto:$usethreads" in
13856 ":define") d_getspnam_r_proto=define
13857 set d_getspnam_r_proto getspnam_r $hdrs
13861 case "$d_getspnam_r_proto" in
13863 case "$getspnam_r_proto" in
13864 ''|0) try='int getspnam_r(const char*, struct spwd*, char*, size_t, struct spwd**);'
13865 ./protochk "extern $try" $hdrs && getspnam_r_proto=I_CSBWR ;;
13867 case "$getspnam_r_proto" in
13868 ''|0) try='struct spwd* getspnam_r(const char*, struct spwd*, char*, int);'
13869 ./protochk "extern $try" $hdrs && getspnam_r_proto=S_CSBI ;;
13871 case "$getspnam_r_proto" in
13872 ''|0) d_getspnam_r=undef
13874 echo "Disabling getspnam_r, cannot determine prototype." >&4 ;;
13875 * ) case "$getspnam_r_proto" in
13876 REENTRANT_PROTO*) ;;
13877 *) getspnam_r_proto="REENTRANT_PROTO_$getspnam_r_proto" ;;
13879 echo "Prototype: $try" ;;
13882 *) case "$usethreads" in
13883 define) echo "getspnam_r has no prototype, not using it." >&4 ;;
13890 *) getspnam_r_proto=0
13894 : see if gettimeofday or ftime exists
13895 set gettimeofday d_gettimeod
13897 case "$d_gettimeod" in
13903 val="$undef"; set d_ftime; eval $setvar
13906 case "$d_gettimeod$d_ftime" in
13909 echo 'No ftime() nor gettimeofday() -- timing may be less accurate.' >&4
13913 : see if gmtime_r exists
13914 set gmtime_r d_gmtime_r
13916 case "$d_gmtime_r" in
13918 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
13919 case "$d_gmtime_r_proto:$usethreads" in
13920 ":define") d_gmtime_r_proto=define
13921 set d_gmtime_r_proto gmtime_r $hdrs
13925 case "$d_gmtime_r_proto" in
13927 case "$gmtime_r_proto" in
13928 ''|0) try='struct tm* gmtime_r(const time_t*, struct tm*);'
13929 ./protochk "extern $try" $hdrs && gmtime_r_proto=S_TS ;;
13931 case "$gmtime_r_proto" in
13932 ''|0) try='int gmtime_r(const time_t*, struct tm*);'
13933 ./protochk "extern $try" $hdrs && gmtime_r_proto=I_TS ;;
13935 case "$gmtime_r_proto" in
13936 ''|0) d_gmtime_r=undef
13938 echo "Disabling gmtime_r, cannot determine prototype." >&4 ;;
13939 * ) case "$gmtime_r_proto" in
13940 REENTRANT_PROTO*) ;;
13941 *) gmtime_r_proto="REENTRANT_PROTO_$gmtime_r_proto" ;;
13943 echo "Prototype: $try" ;;
13946 *) case "$usethreads" in
13947 define) echo "gmtime_r has no prototype, not using it." >&4 ;;
13954 *) gmtime_r_proto=0
13958 : see if hasmntopt exists
13959 set hasmntopt d_hasmntopt
13962 : see if this is a netinet/in.h or sys/in.h system
13963 set netinet/in.h i_niin sys/in.h i_sysin
13966 : see if arpa/inet.h has to be included
13967 set arpa/inet.h i_arpainet
13970 : see if htonl --and friends-- exists
13975 : Maybe they are macros.
13978 $cat >htonl.c <<EOM
13980 #include <sys/types.h>
13981 #$i_niin I_NETINET_IN
13983 #$i_arpainet I_ARPA_INET
13984 #ifdef I_NETINET_IN
13985 #include <netinet/in.h>
13988 #include <sys/in.h>
13991 #include <arpa/inet.h>
13994 printf("Defined as a macro.");
13997 $cppstdin $cppflags $cppminus < htonl.c >htonl.E 2>/dev/null
13998 if $contains 'Defined as a macro' htonl.E >/dev/null 2>&1; then
14000 echo "But it seems to be defined as a macro." >&4
14008 : see if ilogbl exists
14009 set ilogbl d_ilogbl
14014 if set index val -f; eval $csym; $val; then
14015 if set strchr val -f d_strchr; eval $csym; $val; then
14016 if $contains strchr "$strings" >/dev/null 2>&1 ; then
14019 echo "strchr() found." >&4
14023 echo "index() found." >&4
14028 echo "index() found." >&4
14031 if set strchr val -f d_strchr; eval $csym; $val; then
14034 echo "strchr() found." >&4
14036 echo "No index() or strchr() found!" >&4
14041 set d_strchr; eval $setvar
14043 set d_index; eval $setvar
14045 : check whether inet_aton exists
14046 set inet_aton d_inetaton
14051 $cat >isascii.c <<EOCP
14054 #$i_stdlib I_STDLIB
14056 #include <stdlib.h>
14067 if eval $compile; then
14068 echo "isascii() found." >&4
14071 echo "isascii() NOT found." >&4
14078 : see if isfinite exists
14079 set isfinite d_isfinite
14082 : see if isinf exists
14086 : see if isnan exists
14090 : see if isnanl exists
14091 set isnanl d_isnanl
14094 : see if killpg exists
14095 set killpg d_killpg
14098 : see if lchown exists
14100 $cat > try.c <<'EOCP'
14101 /* System header to define __stub macros and hopefully few prototypes,
14102 which can conflict with char lchown(); below. */
14103 #include <assert.h>
14104 /* Override any gcc2 internal prototype to avoid an error. */
14105 /* We use char because int might match the return type of a gcc2
14106 builtin and then its argument prototype would still apply. */
14109 /* The GNU C library defines this for functions which it implements
14110 to always fail with ENOSYS. Some functions are actually named
14111 something starting with __ and the normal name is an alias. */
14112 #if defined (__stub_lchown) || defined (__stub___lchown)
14120 if eval $compile; then
14121 $echo "lchown() found." >&4
14124 $echo "lchown() NOT found." >&4
14130 : See if number of significant digits in a double precision number is known
14132 $cat >ldbl_dig.c <<EOM
14133 #$i_limits I_LIMITS
14136 #include <limits.h>
14142 printf("Contains LDBL_DIG");
14145 $cppstdin $cppflags $cppminus < ldbl_dig.c >ldbl_dig.E 2>/dev/null
14146 if $contains 'LDBL_DIG' ldbl_dig.E >/dev/null 2>&1; then
14147 echo "LDBL_DIG found." >&4
14150 echo "LDBL_DIG NOT found." >&4
14157 : see if this is a math.h system
14161 d_libm_lib_version="$undef"
14164 : check to see if math.h defines _LIB_VERSION
14166 echo "Checking to see if your libm supports _LIB_VERSION..." >&4
14168 #include <unistd.h>
14170 int main (int argc, char *argv[])
14172 printf ("%d\n", _LIB_VERSION);
14177 if eval $compile; then
14179 echo "Yes, it does ($foo)" >&4
14180 d_libm_lib_version="$define"
14182 echo "No, it does not (probably harmless)\n" >&4
14184 $rm -f try.* try core core.try.*
14189 : see if link exists
14193 : see if localtime_r exists
14194 set localtime_r d_localtime_r
14196 case "$d_localtime_r" in
14198 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
14199 case "$d_localtime_r_proto:$usethreads" in
14200 ":define") d_localtime_r_proto=define
14201 set d_localtime_r_proto localtime_r $hdrs
14205 case "$d_localtime_r_proto" in
14207 case "$localtime_r_proto" in
14208 ''|0) try='struct tm* localtime_r(const time_t*, struct tm*);'
14209 ./protochk "extern $try" $hdrs && localtime_r_proto=S_TS ;;
14211 case "$localtime_r_proto" in
14212 ''|0) try='int localtime_r(const time_t*, struct tm*);'
14213 ./protochk "extern $try" $hdrs && localtime_r_proto=I_TS ;;
14215 case "$localtime_r_proto" in
14216 ''|0) d_localtime_r=undef
14217 localtime_r_proto=0
14218 echo "Disabling localtime_r, cannot determine prototype." >&4 ;;
14219 * ) case "$localtime_r_proto" in
14220 REENTRANT_PROTO*) ;;
14221 *) localtime_r_proto="REENTRANT_PROTO_$localtime_r_proto" ;;
14223 echo "Prototype: $try" ;;
14226 *) case "$usethreads" in
14227 define) echo "localtime_r has no prototype, not using it." >&4 ;;
14229 d_localtime_r=undef
14230 localtime_r_proto=0
14234 *) localtime_r_proto=0
14238 : see if localeconv exists
14239 set localeconv d_locconv
14242 : see if lockf exists
14246 : see if prototype for lseek is available
14248 set d_lseekproto lseek $i_systypes sys/types.h $i_unistd unistd.h
14251 : see if lstat exists
14255 : see if madvise exists
14256 set madvise d_madvise
14259 : see if malloc_size exists
14260 set malloc_size d_malloc_size
14263 : see if malloc_size_good exists
14264 set malloc_good_size d_malloc_good_size
14267 : see if mblen exists
14271 : see if mbstowcs exists
14272 set mbstowcs d_mbstowcs
14275 : see if mbtowc exists
14276 set mbtowc d_mbtowc
14279 : see if memchr exists
14280 set memchr d_memchr
14283 : see if memcmp exists
14284 set memcmp d_memcmp
14287 : see if memcpy exists
14288 set memcpy d_memcpy
14291 : see if memmove exists
14292 set memmove d_memmove
14295 : see if memset exists
14296 set memset d_memset
14299 : see if mkdir exists
14303 : see if mkdtemp exists
14304 set mkdtemp d_mkdtemp
14307 : see if mkfifo exists
14308 set mkfifo d_mkfifo
14311 : see if mkstemp exists
14312 set mkstemp d_mkstemp
14315 : see if mkstemps exists
14316 set mkstemps d_mkstemps
14319 : see if mktime exists
14320 set mktime d_mktime
14323 : see if this is a sys/mman.h system
14324 set sys/mman.h i_sysmman
14327 : see if mmap exists
14330 : see what shmat returns
14331 : default to something harmless
14333 case "$i_sysmman$d_mmap" in
14335 $cat >mmap.c <<'END'
14336 #include <sys/mman.h>
14339 if $cc $ccflags -c mmap.c >/dev/null 2>&1; then
14344 echo "and it returns ($mmaptype)." >&4
14350 : see if sqrtl exists
14354 : see if scalbnl exists
14355 set scalbnl d_scalbnl
14358 : see if modfl exists
14362 : see if prototype for modfl is available
14364 set d_modflproto modfl $i_math math.h
14367 d_modfl_pow32_bug="$undef"
14369 case "$d_longdbl$d_modfl" in
14372 Checking to see whether your modfl() is okay for large values...
14378 if $test "X$d_modflproto" != "X$define"; then
14379 $cat >>try.c <<EOCP
14380 /* Sigh. many current glibcs provide the function, but do not prototype it. */
14381 long double modfl (long double, long double *);
14384 $cat >>try.c <<EOCP
14386 long double nv = 4294967303.15;
14392 printf(" %"$sPRIfldbl" %"$sPRIfldbl" %"$sPRIfldbl"\n", nv, v, w);
14396 case "$osname:$gccversion" in
14397 aix:) saveccflags="$ccflags"
14398 ccflags="$ccflags -qlongdouble" ;; # to avoid core dump
14401 if eval $compile; then
14404 *" 4294967303.150000 1.150000 4294967302.000000")
14405 echo >&4 "Your modfl() is broken for large values."
14406 d_modfl_pow32_bug="$define"
14408 glibc) echo >&4 "You should upgrade your glibc to at least 2.2.2 to get a fixed modfl()."
14412 *" 4294967303.150000 0.150000 4294967303.000000")
14413 echo >&4 "Your modfl() seems okay for large values."
14415 *) echo >&4 "I don't understand your modfl() at all."
14419 $rm -f try.* try core core.try.*
14421 echo "I cannot figure out whether your modfl() is okay, assuming it isn't."
14424 case "$osname:$gccversion" in
14425 aix:) ccflags="$saveccflags" ;; # restore
14430 if $test "$uselongdouble" = "$define"; then
14432 if $test "$d_sqrtl" != "$define"; then
14433 message="$message sqrtl"
14435 if $test "$d_modfl" != "$define"; then
14436 if $test "$d_aintl:$d_copysignl" = "$define:$define"; then
14437 echo "You have both aintl and copysignl, so I can emulate modfl."
14439 message="$message modfl"
14442 if $test "$d_frexpl" != "$define"; then
14443 if $test "$d_ilogbl:$d_scalbnl" = "$define:$define"; then
14444 echo "You have both ilogbl and scalbnl, so I can emulate frexpl."
14446 message="$message frexpl"
14450 if $test "$message" != ""; then
14453 *** You requested the use of long doubles but you do not seem to have
14454 *** the following mathematical functions needed for long double support:
14456 *** Please rerun Configure without -Duselongdouble and/or -Dusemorebits.
14457 *** Cannot continue, aborting.
14465 : see if mprotect exists
14466 set mprotect d_mprotect
14469 : see if msgctl exists
14470 set msgctl d_msgctl
14473 : see if msgget exists
14474 set msgget d_msgget
14477 : see if msgsnd exists
14478 set msgsnd d_msgsnd
14481 : see if msgrcv exists
14482 set msgrcv d_msgrcv
14485 : see how much of the 'msg*(2)' library is present.
14488 case "$d_msgctl$d_msgget$d_msgsnd$d_msgrcv" in
14489 *"$undef"*) h_msg=false;;
14493 case "`ipcs 2>&1`" in
14494 "SVID messages"*"not configured"*)
14495 echo "Your $osname does not have the msg*(2) configured." >&4
14498 set msgctl d_msgctl
14500 set msgget d_msgget
14502 set msgsnd d_msgsnd
14504 set msgrcv d_msgrcv
14510 : we could also check for sys/ipc.h ...
14511 if $h_msg && $test `./findhdr sys/msg.h`; then
14512 echo "You have the full msg*(2) library." >&4
14515 echo "You don't have the full msg*(2) library." >&4
14523 echo "Checking to see if your system supports struct msghdr..." >&4
14524 set d_msghdr_s msghdr $i_systypes sys/types.h $d_socket sys/socket.h $i_sysuio sys/uio.h
14526 case "$d_msghdr_s" in
14527 "$define") echo "Yes, it does." ;;
14528 *) echo "No, it doesn't." ;;
14532 : see if msync exists
14536 : see if munmap exists
14537 set munmap d_munmap
14540 : see if nice exists
14544 : see if this is a langinfo.h system
14545 set langinfo.h i_langinfo
14548 : see if nl_langinfo exists
14549 set nl_langinfo d_nl_langinfo
14552 : check for length of character
14554 case "$charsize" in
14556 echo "Checking to see how big your characters are (hey, you never know)..." >&4
14559 #$i_stdlib I_STDLIB
14561 #include <stdlib.h>
14565 printf("%d\n", (int)sizeof(char));
14570 if eval $compile_ok; then
14574 echo "(I can't seem to compile the test program. Guessing...)"
14581 rp="What is the size of a character (in bytes)?"
14586 : check for volatile keyword
14588 echo 'Checking to see if your C compiler knows about "volatile"...' >&4
14589 $cat >try.c <<'EOCP'
14592 typedef struct _goo_struct goo_struct;
14593 goo_struct * volatile goo = ((goo_struct *)0);
14594 struct _goo_struct {
14599 typedef unsigned short foo_t;
14600 char *volatile foo;
14602 volatile foo_t blech;
14606 if $cc -c $ccflags try.c >/dev/null 2>&1 ; then
14608 echo "Yup, it does."
14611 echo "Nope, it doesn't."
14619 $echo "Choosing the C types to be used for Perl's internal types..." >&4
14621 case "$use64bitint:$d_quad:$quadtype" in
14624 uvtype="$uquadtype"
14629 uvtype="unsigned long"
14635 case "$uselongdouble:$d_longdbl" in
14637 nvtype="long double"
14638 nvsize=$longdblsize
14645 $echo "(IV will be "$ivtype", $ivsize bytes)"
14646 $echo "(UV will be "$uvtype", $uvsize bytes)"
14647 $echo "(NV will be "$nvtype", $nvsize bytes)"
14650 #$i_inttypes I_INTTYPES
14652 #include <inttypes.h>
14657 int8_t i = INT8_MAX;
14658 uint8_t u = UINT8_MAX;
14659 printf("int8_t\n");
14662 int16_t i = INT16_MAX;
14663 uint16_t i = UINT16_MAX;
14664 printf("int16_t\n");
14667 int32_t i = INT32_MAX;
14668 uint32_t u = UINT32_MAX;
14669 printf("int32_t\n");
14675 '') case "$charsize" in
14677 u8type="unsigned char"
14686 if eval $compile; then
14687 case "`$run ./try`" in
14688 int8_t) i8type=int8_t
14698 '') if $test $charsize -ge 1; then
14700 u8type="unsigned char"
14708 '') case "$shortsize" in
14710 u16type="unsigned short"
14718 '') set try -DINT16
14719 if eval $compile; then
14720 case "`$run ./try`" in
14732 '') if $test $shortsize -ge 2; then
14734 u16type="unsigned short"
14742 '') case "$longsize" in
14744 u32type="unsigned long"
14748 *) case "$intsize" in
14750 u32type="unsigned int"
14760 '') set try -DINT32
14761 if eval $compile; then
14762 case "`$run ./try`" in
14774 '') if $test $intsize -ge 4; then
14776 u32type="unsigned int"
14784 '') case "$d_quad:$quadtype" in
14786 i64type="$quadtype"
14787 u64type="$uquadtype"
14795 $echo "Checking how many bits of your UVs your NVs can preserve..." >&4
14796 : volatile so that the compiler has to store it out to memory.
14797 if test X"$d_volatile" = X"$define"; then
14802 #$i_stdlib I_STDLIB
14804 #include <stdlib.h>
14806 #include <sys/types.h>
14807 #include <signal.h>
14809 $volatile int bletched = 0;
14810 $signal_t blech(s) int s; { bletched = 1; }
14815 int n = 8 * $uvsize;
14818 signal(SIGFPE, blech);
14821 for (i = 0; i < n; i++) {
14822 u = u << 1 | ($uvtype)1;
14824 if (($uvtype)d != u)
14828 d = ($nvtype)(u - 1);
14829 if (($uvtype)d != (u - 1))
14837 printf("%d\n", ((i == n) ? -n : i));
14843 d_nv_preserves_uv="$undef"
14844 if eval $compile; then
14845 nv_preserves_uv_bits="`$run ./try`"
14847 case "$nv_preserves_uv_bits" in
14849 nv_preserves_uv_bits=`expr 0 - $nv_preserves_uv_bits`
14850 $echo "Your NVs can preserve all $nv_preserves_uv_bits bits of your UVs." 2>&1
14851 d_nv_preserves_uv="$define"
14853 [1-9]*) $echo "Your NVs can preserve only $nv_preserves_uv_bits bits of your UVs." 2>&1
14854 d_nv_preserves_uv="$undef" ;;
14855 *) $echo "Can't figure out how many bits your NVs preserve." 2>&1
14856 nv_preserves_uv_bits="$undef" ;;
14861 $echo "Checking whether NV 0.0 is all bits zero in memory..." >&4
14862 : volatile so that the compiler has to store it out to memory.
14863 if test X"$d_volatile" = X"$define"; then
14868 #$i_stdlib I_STDLIB
14870 #include <stdlib.h>
14872 #$i_string I_STRING
14874 # include <string.h>
14876 # include <strings.h>
14878 #include <sys/types.h>
14879 #include <signal.h>
14881 $volatile int bletched = 0;
14882 $signal_t blech(s) int s; { bletched = 1; }
14885 int checkit($nvtype d, char *where) {
14886 unsigned char *p = (char *)&d;
14887 unsigned char *end = p + sizeof(d);
14897 printf("No - %s: 0x", where);
14899 printf ("%02X", *p++);
14904 int main(int argc, char **argv) {
14907 fail += checkit(d, "0.0");
14909 /* The compiler shouldn't be assuming that bletched is 0 */
14912 fail += checkit(d, "bleched");
14915 signal(SIGFPE, blech);
14918 /* Paranoia - the compiler should have no way of knowing that ANSI says
14919 that argv[argc] will always be NULL. Actually, if it did assume this it
14920 would be buggy, as this is C and main() can be called from elsewhere in
14922 d = argv[argc] ? 1 : 0;
14925 printf("Odd argv[argc]=%p, d=%g\n", argv[argc], d);
14928 fail += checkit(d, "ternary");
14930 memset(&d, sizeof(d), argv[argc] ? 1 : 0);
14933 printf("No - memset doesn't give 0.0\n");
14934 /* This might just blow up: */
14935 printf("(gives %g)\n", d);
14941 printf("No - something bleched\n");
14946 printf("No - %d fail(s)\n", fail);
14955 d_nv_zero_is_allbits_zero="$undef"
14956 if eval $compile; then
14962 0.0 is represented as all bits zero in memory
14964 d_nv_zero_is_allbits_zero="$define"
14967 0.0 is not represented as all bits zero in memory
14969 d_nv_zero_is_allbits_zero="$undef"
14974 0.0 is not represented as all bits zero in memory
14976 d_nv_zero_is_allbits_zero="$undef"
14984 : check for off64_t
14986 echo "Checking to see if you have off64_t..." >&4
14988 #include <sys/types.h>
14989 #include <unistd.h>
14990 int main() { off64_t x = 7; }
14993 if eval $compile; then
14995 echo "You have off64_t."
14998 echo "You do not have off64_t."
14999 case "$lseeksize" in
15000 8) echo "(Your off_t is 64 bits, so you could use that.)" ;;
15007 : how to create joinable pthreads
15008 if test "X$usethreads" = "X$define" -a "X$i_pthread" = "X$define"; then
15010 echo "Checking what constant to use for creating joinable pthreads..." >&4
15011 $cat >try.c <<'EOCP'
15012 #include <pthread.h>
15014 int detachstate = JOINABLE;
15017 set try -DJOINABLE=PTHREAD_CREATE_JOINABLE
15018 if eval $compile; then
15019 echo "You seem to use PTHREAD_CREATE_JOINABLE." >&4
15020 val="$undef" # Yes, undef.
15021 set d_old_pthread_create_joinable
15024 set old_pthread_create_joinable
15027 set try -DJOINABLE=PTHREAD_CREATE_UNDETACHED
15028 if eval $compile; then
15029 echo "You seem to use PTHREAD_CREATE_UNDETACHED." >&4
15031 set d_old_pthread_create_joinable
15033 val=PTHREAD_CREATE_UNDETACHED
15034 set old_pthread_create_joinable
15037 set try -DJOINABLE=__UNDETACHED
15038 if eval $compile; then
15039 echo "You seem to use __UNDETACHED." >&4
15041 set d_old_pthread_create_joinable
15044 set old_pthread_create_joinable
15047 echo "Egads, nothing obvious found. Guessing that you use 0." >&4
15049 set d_old_pthread_create_joinable
15052 set old_pthread_create_joinable
15059 d_old_pthread_create_joinable="$undef"
15060 old_pthread_create_joinable=""
15063 : see if pause exists
15067 : see if pipe exists
15071 : see if poll exists
15075 : see if readlink exists
15076 set readlink d_readlink
15082 case "$d_readlink" in
15084 if $issymlink /proc/self/exe ; then
15085 $ls -l /proc/self/exe > reflect
15086 if $contains /`basename $ls` reflect >/dev/null 2>&1; then
15087 echo "You have Linux-like /proc/self/exe."
15088 procselfexe='"/proc/self/exe"'
15092 if $issymlink /proc/curproc/file ; then
15093 $ls -l /proc/curproc/file > reflect
15094 if $contains /`basename $ls` reflect >/dev/null 2>&1; then
15095 echo "You have BSD-like /proc/curproc/file."
15096 procselfexe='"/proc/curproc/file"'
15106 : see whether the pthread_atfork exists
15108 #include <pthread.h>
15111 #ifdef PTHREAD_ATFORK
15112 pthread_atfork(NULL,NULL,NULL);
15117 : see if pthread_atfork exists
15118 set try -DPTHREAD_ATFORK
15119 if eval $compile; then
15124 case "$usethreads" in
15127 $define) echo 'pthread_atfork found.' >&4 ;;
15128 *) echo 'pthread_atfork NOT found.' >&4 ;;
15131 set d_pthread_atfork
15134 : see if pthread_attr_setscope exists
15135 set pthread_attr_setscope d_pthread_attr_setscope
15139 : see whether the various POSIXish _yields exist
15141 #include <pthread.h>
15147 #ifdef PTHREAD_YIELD
15150 #ifdef PTHREAD_YIELD_NULL
15151 pthread_yield(NULL);
15157 : see if sched_yield exists
15158 set try -DSCHED_YIELD
15159 if eval $compile; then
15161 sched_yield='sched_yield()'
15165 case "$usethreads" in
15168 $define) echo 'sched_yield() found.' >&4 ;;
15169 *) echo 'sched_yield() NOT found.' >&4 ;;
15175 : see if pthread_yield exists
15176 set try -DPTHREAD_YIELD
15177 if eval $compile; then
15179 case "$sched_yield" in
15180 '') sched_yield='pthread_yield()' ;;
15183 set try -DPTHREAD_YIELD_NULL
15184 if eval $compile; then
15186 case "$sched_yield" in
15187 '') sched_yield='pthread_yield(NULL)' ;;
15193 case "$usethreads" in
15196 $define) echo 'pthread_yield() found.' >&4 ;;
15197 *) echo 'pthread_yield() NOT found.' >&4 ;;
15201 set d_pthread_yield
15204 case "$sched_yield" in
15205 '') sched_yield=undef ;;
15210 : see if random_r exists
15211 set random_r d_random_r
15213 case "$d_random_r" in
15215 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
15216 case "$d_random_r_proto:$usethreads" in
15217 ":define") d_random_r_proto=define
15218 set d_random_r_proto random_r $hdrs
15222 case "$d_random_r_proto" in
15224 case "$random_r_proto" in
15225 ''|0) try='int random_r(int*, struct random_data*);'
15226 ./protochk "extern $try" $hdrs && random_r_proto=I_iS ;;
15228 case "$random_r_proto" in
15229 ''|0) try='int random_r(long*, struct random_data*);'
15230 ./protochk "extern $try" $hdrs && random_r_proto=I_lS ;;
15232 case "$random_r_proto" in
15233 ''|0) try='int random_r(struct random_data*, int32_t*);'
15234 ./protochk "extern $try" $hdrs && random_r_proto=I_St ;;
15236 case "$random_r_proto" in
15237 ''|0) d_random_r=undef
15239 echo "Disabling random_r, cannot determine prototype." >&4 ;;
15240 * ) case "$random_r_proto" in
15241 REENTRANT_PROTO*) ;;
15242 *) random_r_proto="REENTRANT_PROTO_$random_r_proto" ;;
15244 echo "Prototype: $try" ;;
15247 *) case "$usethreads" in
15248 define) echo "random_r has no prototype, not using it." >&4 ;;
15255 *) random_r_proto=0
15259 : see if readdir and friends exist
15260 set readdir d_readdir
15262 set seekdir d_seekdir
15264 set telldir d_telldir
15266 set rewinddir d_rewinddir
15269 : see if readdir64_r exists
15270 set readdir64_r d_readdir64_r
15272 case "$d_readdir64_r" in
15274 hdrs="$i_systypes sys/types.h define stdio.h $i_dirent dirent.h"
15275 case "$d_readdir64_r_proto:$usethreads" in
15276 ":define") d_readdir64_r_proto=define
15277 set d_readdir64_r_proto readdir64_r $hdrs
15281 case "$d_readdir64_r_proto" in
15283 case "$readdir64_r_proto" in
15284 ''|0) try='int readdir64_r(DIR*, struct dirent64*, struct dirent64**);'
15285 ./protochk "extern $try" $hdrs && readdir64_r_proto=I_TSR ;;
15287 case "$readdir64_r_proto" in
15288 ''|0) try='int readdir64_r(DIR*, struct dirent64*);'
15289 ./protochk "extern $try" $hdrs && readdir64_r_proto=I_TS ;;
15291 case "$readdir64_r_proto" in
15292 ''|0) d_readdir64_r=undef
15293 readdir64_r_proto=0
15294 echo "Disabling readdir64_r, cannot determine prototype." >&4 ;;
15295 * ) case "$readdir64_r_proto" in
15296 REENTRANT_PROTO*) ;;
15297 *) readdir64_r_proto="REENTRANT_PROTO_$readdir64_r_proto" ;;
15299 echo "Prototype: $try" ;;
15302 *) case "$usethreads" in
15303 define) echo "readdir64_r has no prototype, not using it." >&4 ;;
15305 d_readdir64_r=undef
15306 readdir64_r_proto=0
15310 *) readdir64_r_proto=0
15314 : see if readdir_r exists
15315 set readdir_r d_readdir_r
15317 case "$d_readdir_r" in
15319 hdrs="$i_systypes sys/types.h define stdio.h $i_dirent dirent.h"
15320 case "$d_readdir_r_proto:$usethreads" in
15321 ":define") d_readdir_r_proto=define
15322 set d_readdir_r_proto readdir_r $hdrs
15326 case "$d_readdir_r_proto" in
15328 case "$readdir_r_proto" in
15329 ''|0) try='int readdir_r(DIR*, struct dirent*, struct dirent**);'
15330 ./protochk "extern $try" $hdrs && readdir_r_proto=I_TSR ;;
15332 case "$readdir_r_proto" in
15333 ''|0) try='int readdir_r(DIR*, struct dirent*);'
15334 ./protochk "extern $try" $hdrs && readdir_r_proto=I_TS ;;
15336 case "$readdir_r_proto" in
15337 ''|0) d_readdir_r=undef
15339 echo "Disabling readdir_r, cannot determine prototype." >&4 ;;
15340 * ) case "$readdir_r_proto" in
15341 REENTRANT_PROTO*) ;;
15342 *) readdir_r_proto="REENTRANT_PROTO_$readdir_r_proto" ;;
15344 echo "Prototype: $try" ;;
15347 *) case "$usethreads" in
15348 define) echo "readdir_r has no prototype, not using it." >&4 ;;
15355 *) readdir_r_proto=0
15359 : see if readv exists
15363 : see if recvmsg exists
15364 set recvmsg d_recvmsg
15367 : see if rename exists
15368 set rename d_rename
15371 : see if rmdir exists
15375 : see if memory.h is available.
15380 : See if it conflicts with string.h
15386 $cppstdin $cppflags $cppminus < $strings > mem.h
15387 if $contains 'memcpy' mem.h >/dev/null 2>&1; then
15389 echo "We won't be including <memory.h>."
15399 : can bcopy handle overlapping blocks?
15402 case "$d_memmove" in
15403 "$define") echo "I'll use memmove() instead of bcopy() for overlapping copies." ;;
15404 *) case "$d_bcopy" in
15406 echo "Checking to see if bcopy() can do overlapping copies..." >&4
15408 #$i_memory I_MEMORY
15409 #$i_stdlib I_STDLIB
15410 #$i_string I_STRING
15411 #$i_unistd I_UNISTD
15413 $cat >>try.c <<'EOCP'
15416 # include <memory.h>
15419 # include <stdlib.h>
15422 # include <string.h>
15424 # include <strings.h>
15427 # include <unistd.h> /* Needed for NetBSD */
15431 char buf[128], abc[128];
15437 /* Copy "abcde..." string to char abc[] so that gcc doesn't
15438 try to store the string in read-only memory. */
15439 bcopy("abcdefghijklmnopqrstuvwxyz0123456789", abc, 36);
15441 for (align = 7; align >= 0; align--) {
15442 for (len = 36; len; len--) {
15444 bcopy(abc, b, len);
15445 for (off = 1; off <= len; off++) {
15446 bcopy(b, b+off, len);
15447 bcopy(b+off, b, len);
15448 if (bcmp(b, abc, len))
15457 if eval $compile_ok; then
15458 if ./try 2>/dev/null; then
15459 echo "Yes, it can."
15462 echo "It can't, sorry."
15465 echo "(I can't compile the test program, so we'll assume not...)"
15469 $rm -f try.* try core
15475 : can memcpy handle overlapping blocks?
15478 case "$d_memmove" in
15479 "$define") echo "I'll use memmove() instead of memcpy() for overlapping copies." ;;
15480 *) case "$d_memcpy" in
15482 echo "Checking to see if memcpy() can do overlapping copies..." >&4
15484 #$i_memory I_MEMORY
15485 #$i_stdlib I_STDLIB
15486 #$i_string I_STRING
15487 #$i_unistd I_UNISTD
15489 $cat >>try.c <<'EOCP'
15492 # include <memory.h>
15495 # include <stdlib.h>
15498 # include <string.h>
15500 # include <strings.h>
15503 # include <unistd.h> /* Needed for NetBSD */
15507 char buf[128], abc[128];
15513 /* Copy "abcde..." string to char abc[] so that gcc doesn't
15514 try to store the string in read-only memory. */
15515 memcpy(abc, "abcdefghijklmnopqrstuvwxyz0123456789", 36);
15517 for (align = 7; align >= 0; align--) {
15518 for (len = 36; len; len--) {
15520 memcpy(b, abc, len);
15521 for (off = 1; off <= len; off++) {
15522 memcpy(b+off, b, len);
15523 memcpy(b, b+off, len);
15524 if (memcmp(b, abc, len))
15533 if eval $compile_ok; then
15534 if ./try 2>/dev/null; then
15535 echo "Yes, it can."
15538 echo "It can't, sorry."
15541 echo "(I can't compile the test program, so we'll assume not...)"
15545 $rm -f try.* try core
15551 : can memcmp be trusted to compare relative magnitude?
15553 case "$d_memcmp" in
15556 echo "Checking if your memcmp() can compare relative magnitude..." >&4
15558 #$i_memory I_MEMORY
15559 #$i_stdlib I_STDLIB
15560 #$i_string I_STRING
15561 #$i_unistd I_UNISTD
15563 $cat >>try.c <<'EOCP'
15566 # include <memory.h>
15569 # include <stdlib.h>
15572 # include <string.h>
15574 # include <strings.h>
15577 # include <unistd.h> /* Needed for NetBSD */
15583 if ((a < b) && memcmp(&a, &b, 1) < 0)
15589 if eval $compile_ok; then
15590 if $run ./try 2>/dev/null; then
15591 echo "Yes, it can."
15594 echo "No, it can't (it uses signed chars)."
15597 echo "(I can't compile the test program, so we'll assume not...)"
15601 $rm -f try.* try core
15605 : see if prototype for sbrk is available
15607 set d_sbrkproto sbrk $i_unistd unistd.h
15610 : see if select exists
15611 set select d_select
15614 : see if semctl exists
15615 set semctl d_semctl
15618 : see if semget exists
15619 set semget d_semget
15622 : see if semop exists
15626 : see how much of the 'sem*(2)' library is present.
15629 case "$d_semctl$d_semget$d_semop" in
15630 *"$undef"*) h_sem=false;;
15634 case "`ipcs 2>&1`" in
15635 "SVID messages"*"not configured"*)
15636 echo "Your $osname does not have the sem*(2) configured." >&4
15639 set semctl d_semctl
15641 set semget d_semget
15649 : we could also check for sys/ipc.h ...
15650 if $h_sem && $test `./findhdr sys/sem.h`; then
15651 echo "You have the full sem*(2) library." >&4
15654 echo "You don't have the full sem*(2) library." >&4
15660 : see whether sys/sem.h defines union semun
15662 $cat > try.c <<'END'
15663 #include <sys/types.h>
15664 #include <sys/ipc.h>
15665 #include <sys/sem.h>
15666 int main () { union semun semun; semun.buf = 0; }
15669 if eval $compile; then
15670 echo "You have union semun in <sys/sem.h>." >&4
15673 echo "You do not have union semun in <sys/sem.h>." >&4
15680 : see how to do semctl IPC_STAT
15687 # define S_IRUSR S_IREAD
15688 # define S_IWUSR S_IWRITE
15689 # define S_IXUSR S_IEXEC
15691 # define S_IRUSR 0400
15692 # define S_IWUSR 0200
15693 # define S_IXUSR 0100
15695 # define S_IRGRP (S_IRUSR>>3)
15696 # define S_IWGRP (S_IWUSR>>3)
15697 # define S_IXGRP (S_IXUSR>>3)
15698 # define S_IROTH (S_IRUSR>>6)
15699 # define S_IWOTH (S_IWUSR>>6)
15700 # define S_IXOTH (S_IXUSR>>6)
15703 # define S_IRWXU (S_IRUSR|S_IWUSR|S_IXUSR)
15704 # define S_IRWXG (S_IRGRP|S_IWGRP|S_IXGRP)
15705 # define S_IRWXO (S_IROTH|S_IWOTH|S_IXOTH)
15708 : see whether semctl IPC_STAT can use union semun
15710 case "$d_semctl_semun" in
15713 #include <sys/types.h>
15714 #include <sys/ipc.h>
15715 #include <sys/sem.h>
15716 #include <sys/stat.h>
15723 #$d_union_semun HAS_UNION_SEMUN
15726 #ifndef HAS_UNION_SEMUN
15729 struct semid_ds *buf;
15730 unsigned short *array;
15736 #if defined(IPC_PRIVATE) && defined(S_IRWXU) && defined(S_IRWXG) && defined(S_IRWXO) && defined(IPC_CREAT)
15737 sem = semget(IPC_PRIVATE, 1, S_IRWXU|S_IRWXG|S_IRWXO|IPC_CREAT);
15739 struct semid_ds argbuf;
15742 st = semctl(sem, 0, IPC_STAT, arg);
15746 # endif /* IPC_STAT */
15747 printf("semctl IPC_STAT failed: errno = %d\n", errno);
15749 if (semctl(sem, 0, IPC_RMID, arg) != 0)
15750 # endif /* IPC_RMID */
15751 printf("semctl IPC_RMID failed: errno = %d\n", errno);
15753 #endif /* IPC_PRIVATE && ... */
15754 printf("semget failed: errno = %d\n", errno);
15759 if eval $compile; then
15762 semun) val="$define" ;;
15770 case "$d_semctl_semun" in
15772 echo "You can use union semun for semctl IPC_STAT." >&4
15775 *) echo "You cannot use union semun for semctl IPC_STAT." >&4
15780 : see whether semctl IPC_STAT can use struct semid_ds pointer
15782 case "$d_semctl_semid_ds" in
15784 $cat > try.c <<'END'
15785 #include <sys/types.h>
15786 #include <sys/ipc.h>
15787 #include <sys/sem.h>
15788 #include <sys/stat.h>
15796 struct semid_ds arg;
15799 #if defined(IPC_PRIVATE) && defined(S_IRWXU) && defined(S_IRWXG) && defined(S_IRWXO) && defined(IPC_CREAT)
15800 sem = semget(IPC_PRIVATE, 1, S_IRWXU|S_IRWXG|S_IRWXO|IPC_CREAT);
15803 st = semctl(sem, 0, IPC_STAT, &arg);
15805 printf("semid_ds\n");
15807 # endif /* IPC_STAT */
15808 printf("semctl IPC_STAT failed: errno = %d\n", errno);
15810 if (semctl(sem, 0, IPC_RMID, &arg) != 0)
15811 # endif /* IPC_RMID */
15812 printf("semctl IPC_RMID failed: errno = %d\n", errno);
15814 #endif /* IPC_PRIVATE && ... */
15815 printf("semget failed: errno = %d\n", errno);
15821 if eval $compile; then
15824 semid_ds) val="$define" ;;
15830 set d_semctl_semid_ds
15832 case "$d_semctl_semid_ds" in
15834 echo "You can $also use struct semid_ds* for semctl IPC_STAT." >&4
15836 *) echo "You cannot use struct semid_ds* for semctl IPC_STAT." >&4
15843 # We do not have the full sem*(2) library, so assume we can not
15849 set d_semctl_semid_ds
15854 : see if sendmsg exists
15855 set sendmsg d_sendmsg
15858 : see if setegid exists
15859 set setegid d_setegid
15862 : see if seteuid exists
15863 set seteuid d_seteuid
15866 : see if setgrent exists
15867 set setgrent d_setgrent
15870 : see if setgrent_r exists
15871 set setgrent_r d_setgrent_r
15873 case "$d_setgrent_r" in
15875 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
15876 case "$d_setgrent_r_proto:$usethreads" in
15877 ":define") d_setgrent_r_proto=define
15878 set d_setgrent_r_proto setgrent_r $hdrs
15882 case "$d_setgrent_r_proto" in
15884 case "$setgrent_r_proto" in
15885 ''|0) try='int setgrent_r(FILE**);'
15886 ./protochk "extern $try" $hdrs && setgrent_r_proto=I_H ;;
15888 case "$setgrent_r_proto" in
15889 ''|0) try='void setgrent_r(FILE**);'
15890 ./protochk "extern $try" $hdrs && setgrent_r_proto=V_H ;;
15892 case "$setgrent_r_proto" in
15893 ''|0) d_setgrent_r=undef
15895 echo "Disabling setgrent_r, cannot determine prototype." >&4 ;;
15896 * ) case "$setgrent_r_proto" in
15897 REENTRANT_PROTO*) ;;
15898 *) setgrent_r_proto="REENTRANT_PROTO_$setgrent_r_proto" ;;
15900 echo "Prototype: $try" ;;
15903 *) case "$usethreads" in
15904 define) echo "setgrent_r has no prototype, not using it." >&4 ;;
15911 *) setgrent_r_proto=0
15915 : see if sethostent exists
15916 set sethostent d_sethent
15919 : see if sethostent_r exists
15920 set sethostent_r d_sethostent_r
15922 case "$d_sethostent_r" in
15924 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
15925 case "$d_sethostent_r_proto:$usethreads" in
15926 ":define") d_sethostent_r_proto=define
15927 set d_sethostent_r_proto sethostent_r $hdrs
15931 case "$d_sethostent_r_proto" in
15933 case "$sethostent_r_proto" in
15934 ''|0) try='int sethostent_r(int, struct hostent_data*);'
15935 ./protochk "extern $try" $hdrs && sethostent_r_proto=I_ID ;;
15937 case "$sethostent_r_proto" in
15938 ''|0) try='void sethostent_r(int, struct hostent_data*);'
15939 ./protochk "extern $try" $hdrs && sethostent_r_proto=V_ID ;;
15941 case "$sethostent_r_proto" in
15942 ''|0) d_sethostent_r=undef
15943 sethostent_r_proto=0
15944 echo "Disabling sethostent_r, cannot determine prototype." >&4 ;;
15945 * ) case "$sethostent_r_proto" in
15946 REENTRANT_PROTO*) ;;
15947 *) sethostent_r_proto="REENTRANT_PROTO_$sethostent_r_proto" ;;
15949 echo "Prototype: $try" ;;
15952 *) case "$usethreads" in
15953 define) echo "sethostent_r has no prototype, not using it." >&4 ;;
15955 d_sethostent_r=undef
15956 sethostent_r_proto=0
15960 *) sethostent_r_proto=0
15964 : see if setitimer exists
15965 set setitimer d_setitimer
15968 : see if setlinebuf exists
15969 set setlinebuf d_setlinebuf
15972 : see if setlocale exists
15973 set setlocale d_setlocale
15976 : see if locale.h is available
15977 set locale.h i_locale
15980 : see if setlocale_r exists
15981 set setlocale_r d_setlocale_r
15983 case "$d_setlocale_r" in
15985 hdrs="$i_systypes sys/types.h define stdio.h $i_locale locale.h"
15986 case "$d_setlocale_r_proto:$usethreads" in
15987 ":define") d_setlocale_r_proto=define
15988 set d_setlocale_r_proto setlocale_r $hdrs
15992 case "$d_setlocale_r_proto" in
15994 case "$setlocale_r_proto" in
15995 ''|0) try='int setlocale_r(int, const char*, char*, int);'
15996 ./protochk "extern $try" $hdrs && setlocale_r_proto=I_ICBI ;;
15998 case "$setlocale_r_proto" in
15999 ''|0) d_setlocale_r=undef
16000 setlocale_r_proto=0
16001 echo "Disabling setlocale_r, cannot determine prototype." >&4 ;;
16002 * ) case "$setlocale_r_proto" in
16003 REENTRANT_PROTO*) ;;
16004 *) setlocale_r_proto="REENTRANT_PROTO_$setlocale_r_proto" ;;
16006 echo "Prototype: $try" ;;
16009 *) case "$usethreads" in
16010 define) echo "setlocale_r has no prototype, not using it." >&4 ;;
16012 d_setlocale_r=undef
16013 setlocale_r_proto=0
16017 *) setlocale_r_proto=0
16021 : see if setnetent exists
16022 set setnetent d_setnent
16025 : see if setnetent_r exists
16026 set setnetent_r d_setnetent_r
16028 case "$d_setnetent_r" in
16030 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
16031 case "$d_setnetent_r_proto:$usethreads" in
16032 ":define") d_setnetent_r_proto=define
16033 set d_setnetent_r_proto setnetent_r $hdrs
16037 case "$d_setnetent_r_proto" in
16039 case "$setnetent_r_proto" in
16040 ''|0) try='int setnetent_r(int, struct netent_data*);'
16041 ./protochk "extern $try" $hdrs && setnetent_r_proto=I_ID ;;
16043 case "$setnetent_r_proto" in
16044 ''|0) try='void setnetent_r(int, struct netent_data*);'
16045 ./protochk "extern $try" $hdrs && setnetent_r_proto=V_ID ;;
16047 case "$setnetent_r_proto" in
16048 ''|0) d_setnetent_r=undef
16049 setnetent_r_proto=0
16050 echo "Disabling setnetent_r, cannot determine prototype." >&4 ;;
16051 * ) case "$setnetent_r_proto" in
16052 REENTRANT_PROTO*) ;;
16053 *) setnetent_r_proto="REENTRANT_PROTO_$setnetent_r_proto" ;;
16055 echo "Prototype: $try" ;;
16058 *) case "$usethreads" in
16059 define) echo "setnetent_r has no prototype, not using it." >&4 ;;
16061 d_setnetent_r=undef
16062 setnetent_r_proto=0
16066 *) setnetent_r_proto=0
16070 : see if setprotoent exists
16071 set setprotoent d_setpent
16074 : see if setpgid exists
16075 set setpgid d_setpgid
16078 : see if setpgrp2 exists
16079 set setpgrp2 d_setpgrp2
16082 : see if setpriority exists
16083 set setpriority d_setprior
16086 : see if setproctitle exists
16087 set setproctitle d_setproctitle
16090 : see if setprotoent_r exists
16091 set setprotoent_r d_setprotoent_r
16093 case "$d_setprotoent_r" in
16095 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
16096 case "$d_setprotoent_r_proto:$usethreads" in
16097 ":define") d_setprotoent_r_proto=define
16098 set d_setprotoent_r_proto setprotoent_r $hdrs
16102 case "$d_setprotoent_r_proto" in
16104 case "$setprotoent_r_proto" in
16105 ''|0) try='int setprotoent_r(int, struct protoent_data*);'
16106 ./protochk "extern $try" $hdrs && setprotoent_r_proto=I_ID ;;
16108 case "$setprotoent_r_proto" in
16109 ''|0) try='void setprotoent_r(int, struct protoent_data*);'
16110 ./protochk "extern $try" $hdrs && setprotoent_r_proto=V_ID ;;
16112 case "$setprotoent_r_proto" in
16113 ''|0) d_setprotoent_r=undef
16114 setprotoent_r_proto=0
16115 echo "Disabling setprotoent_r, cannot determine prototype." >&4 ;;
16116 * ) case "$setprotoent_r_proto" in
16117 REENTRANT_PROTO*) ;;
16118 *) setprotoent_r_proto="REENTRANT_PROTO_$setprotoent_r_proto" ;;
16120 echo "Prototype: $try" ;;
16123 *) case "$usethreads" in
16124 define) echo "setprotoent_r has no prototype, not using it." >&4 ;;
16126 d_setprotoent_r=undef
16127 setprotoent_r_proto=0
16131 *) setprotoent_r_proto=0
16135 : see if setpwent exists
16136 set setpwent d_setpwent
16139 : see if setpwent_r exists
16140 set setpwent_r d_setpwent_r
16142 case "$d_setpwent_r" in
16144 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
16145 case "$d_setpwent_r_proto:$usethreads" in
16146 ":define") d_setpwent_r_proto=define
16147 set d_setpwent_r_proto setpwent_r $hdrs
16151 case "$d_setpwent_r_proto" in
16153 case "$setpwent_r_proto" in
16154 ''|0) try='int setpwent_r(FILE**);'
16155 ./protochk "extern $try" $hdrs && setpwent_r_proto=I_H ;;
16157 case "$setpwent_r_proto" in
16158 ''|0) try='void setpwent_r(FILE**);'
16159 ./protochk "extern $try" $hdrs && setpwent_r_proto=V_H ;;
16161 case "$setpwent_r_proto" in
16162 ''|0) d_setpwent_r=undef
16164 echo "Disabling setpwent_r, cannot determine prototype." >&4 ;;
16165 * ) case "$setpwent_r_proto" in
16166 REENTRANT_PROTO*) ;;
16167 *) setpwent_r_proto="REENTRANT_PROTO_$setpwent_r_proto" ;;
16169 echo "Prototype: $try" ;;
16172 *) case "$usethreads" in
16173 define) echo "setpwent_r has no prototype, not using it." >&4 ;;
16180 *) setpwent_r_proto=0
16184 : see if setregid exists
16185 set setregid d_setregid
16187 set setresgid d_setresgid
16190 : see if setreuid exists
16191 set setreuid d_setreuid
16193 set setresuid d_setresuid
16196 : see if setrgid exists
16197 set setrgid d_setrgid
16200 : see if setruid exists
16201 set setruid d_setruid
16204 : see if setservent exists
16205 set setservent d_setsent
16208 : see if setservent_r exists
16209 set setservent_r d_setservent_r
16211 case "$d_setservent_r" in
16213 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
16214 case "$d_setservent_r_proto:$usethreads" in
16215 ":define") d_setservent_r_proto=define
16216 set d_setservent_r_proto setservent_r $hdrs
16220 case "$d_setservent_r_proto" in
16222 case "$setservent_r_proto" in
16223 ''|0) try='int setservent_r(int, struct servent_data*);'
16224 ./protochk "extern $try" $hdrs && setservent_r_proto=I_ID ;;
16226 case "$setservent_r_proto" in
16227 ''|0) try='void setservent_r(int, struct servent_data*);'
16228 ./protochk "extern $try" $hdrs && setservent_r_proto=V_ID ;;
16230 case "$setservent_r_proto" in
16231 ''|0) d_setservent_r=undef
16232 setservent_r_proto=0
16233 echo "Disabling setservent_r, cannot determine prototype." >&4 ;;
16234 * ) case "$setservent_r_proto" in
16235 REENTRANT_PROTO*) ;;
16236 *) setservent_r_proto="REENTRANT_PROTO_$setservent_r_proto" ;;
16238 echo "Prototype: $try" ;;
16241 *) case "$usethreads" in
16242 define) echo "setservent_r has no prototype, not using it." >&4 ;;
16244 d_setservent_r=undef
16245 setservent_r_proto=0
16249 *) setservent_r_proto=0
16253 : see if setsid exists
16254 set setsid d_setsid
16257 : see if setvbuf exists
16258 set setvbuf d_setvbuf
16261 : see if sfio.h is available
16266 : see if sfio library is available
16277 : Ok, but do we want to use it.
16281 true|$define|[yY]*) dflt='y';;
16284 echo "$package can use the sfio library, but it is experimental."
16285 case "$useperlio" in
16287 echo "For sfio also the PerlIO abstraction layer is needed."
16288 echo "Earlier you said you wouldn't want that."
16291 rp="You seem to have sfio available, do you want to try using it?"
16294 y|Y) echo "Ok, turning on both sfio and PerlIO, then."
16295 useperlio="$define"
16298 *) echo "Ok, avoiding sfio this time. I'll use stdio instead."
16303 *) case "$usesfio" in
16304 true|$define|[yY]*)
16305 echo "Sorry, cannot find sfio on this machine." >&4
16306 echo "Ignoring your setting of usesfio=$usesfio." >&4
16315 $define) usesfio='true';;
16316 *) usesfio='false';;
16320 *) : Remove sfio from list of libraries to use
16323 echo "Removing unneeded -lsfio from library list" >&4
16324 set `echo X $libs | $sed -e 's/-lsfio / /' -e 's/-lsfio$//'`
16327 echo "libs = $libs" >&4
16334 : see if shmctl exists
16335 set shmctl d_shmctl
16338 : see if shmget exists
16339 set shmget d_shmget
16342 : see if shmat exists
16345 : see what shmat returns
16348 $cat >shmat.c <<'END'
16349 #include <sys/shm.h>
16352 if $cc $ccflags -c shmat.c >/dev/null 2>&1; then
16357 echo "and it returns ($shmattype)." >&4
16358 : see if a prototype for shmat is available
16359 xxx=`./findhdr sys/shm.h`
16360 $cppstdin $cppflags $cppminus < $xxx > shmat.c 2>/dev/null
16361 if $contains 'shmat.*(' shmat.c >/dev/null 2>&1; then
16372 set d_shmatprototype
16375 : see if shmdt exists
16379 : see how much of the 'shm*(2)' library is present.
16382 case "$d_shmctl$d_shmget$d_shmat$d_shmdt" in
16383 *"$undef"*) h_shm=false;;
16387 case "`ipcs 2>&1`" in
16388 "SVID shared memory"*"not configured"*)
16389 echo "Your $osname does not have the shm*(2) configured." >&4
16392 set shmctl d_shmctl
16394 set shmget d_shmget
16404 : we could also check for sys/ipc.h ...
16405 if $h_shm && $test `./findhdr sys/shm.h`; then
16406 echo "You have the full shm*(2) library." >&4
16409 echo "You don't have the full shm*(2) library." >&4
16416 : see if we have sigaction
16417 if set sigaction val -f d_sigaction; eval $csym; $val; then
16418 echo 'sigaction() found.' >&4
16421 #include <sys/types.h>
16422 #include <signal.h>
16423 #$i_stdlib I_STDLIB
16425 #include <stdlib.h>
16429 struct sigaction act, oact;
16431 oact.sa_handler = 0;
16432 /* so that act and oact are used */
16433 exit(act.sa_flags == 0 && oact.sa_handler == 0);
16437 if eval $compile_ok; then
16440 echo "But you don't seem to have a useable struct sigaction." >&4
16444 echo 'sigaction NOT found.' >&4
16447 set d_sigaction; eval $setvar
16448 $rm -f try try$_o try.c
16450 : see if sigprocmask exists
16451 set sigprocmask d_sigprocmask
16454 : see if sigsetjmp exists
16456 case "$d_sigsetjmp" in
16459 #include <setjmp.h>
16460 #$i_stdlib I_STDLIB
16462 #include <stdlib.h>
16468 if (sigsetjmp(env,1))
16471 siglongjmp(env, 1);
16476 if eval $compile; then
16477 if $run ./try >/dev/null 2>&1; then
16478 echo "POSIX sigsetjmp found." >&4
16482 Uh-Oh! You have POSIX sigsetjmp and siglongjmp, but they do not work properly!!
16488 echo "sigsetjmp not found." >&4
16492 *) val="$d_sigsetjmp"
16493 case "$d_sigsetjmp" in
16494 $define) echo "POSIX sigsetjmp found." >&4;;
16495 $undef) echo "sigsetjmp not found." >&4;;
16503 : see if sockatmark exists
16504 set sockatmark d_sockatmark
16507 : see if prototype for sockatmark is available
16509 set d_sockatmarkproto sockatmark $d_socket sys/socket.h
16512 : see if socks5_init exists
16513 set socks5_init d_socks5_init
16516 : see if sprintf returns the length of the string in the buffer as per ANSI
16517 $echo "Checking whether sprintf returns the length of the string..." >&4
16520 #$i_stdlib I_STDLIB
16522 #include <stdlib.h>
16524 #$i_string I_STRING
16526 # include <string.h>
16528 # include <strings.h>
16537 int check (size_t expect, int test) {
16538 size_t got = strlen(buffer);
16542 printf("expected %ld, got %ld in test %d '%s'\n", (long) expect, (long) got,
16547 int main(int argc, char **argv) {
16550 check(sprintf(buffer, ""), ++test);
16551 check(sprintf(buffer, "%s %s", "perl", "rules"), ++test);
16552 check(sprintf(buffer, "I like %g", atan2(0,-1)), ++test);
16559 d_sprintf_returns_strlen="$undef"
16560 if eval $compile; then
16564 sprintf returns the length of the string (as ANSI says it should)
16566 d_sprintf_returns_strlen="$define"
16569 sprintf does not return the length of the string (how old is this system?)
16571 d_sprintf_returns_strlen="$undef"
16578 : see if srand48_r exists
16579 set srand48_r d_srand48_r
16581 case "$d_srand48_r" in
16583 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
16584 case "$d_srand48_r_proto:$usethreads" in
16585 ":define") d_srand48_r_proto=define
16586 set d_srand48_r_proto srand48_r $hdrs
16590 case "$d_srand48_r_proto" in
16592 case "$srand48_r_proto" in
16593 ''|0) try='int srand48_r(long, struct drand48_data*);'
16594 ./protochk "extern $try" $hdrs && srand48_r_proto=I_LS ;;
16596 case "$srand48_r_proto" in
16597 ''|0) d_srand48_r=undef
16599 echo "Disabling srand48_r, cannot determine prototype." >&4 ;;
16600 * ) case "$srand48_r_proto" in
16601 REENTRANT_PROTO*) ;;
16602 *) srand48_r_proto="REENTRANT_PROTO_$srand48_r_proto" ;;
16604 echo "Prototype: $try" ;;
16607 *) case "$usethreads" in
16608 define) echo "srand48_r has no prototype, not using it." >&4 ;;
16615 *) srand48_r_proto=0
16619 : see if srandom_r exists
16620 set srandom_r d_srandom_r
16622 case "$d_srandom_r" in
16624 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
16625 case "$d_srandom_r_proto:$usethreads" in
16626 ":define") d_srandom_r_proto=define
16627 set d_srandom_r_proto srandom_r $hdrs
16631 case "$d_srandom_r_proto" in
16633 case "$srandom_r_proto" in
16634 ''|0) try='int srandom_r(unsigned int, struct random_data*);'
16635 ./protochk "extern $try" $hdrs && srandom_r_proto=I_TS ;;
16637 case "$srandom_r_proto" in
16638 ''|0) d_srandom_r=undef
16640 echo "Disabling srandom_r, cannot determine prototype." >&4 ;;
16641 * ) case "$srandom_r_proto" in
16642 REENTRANT_PROTO*) ;;
16643 *) srandom_r_proto="REENTRANT_PROTO_$srandom_r_proto" ;;
16645 echo "Prototype: $try" ;;
16648 *) case "$usethreads" in
16649 define) echo "srandom_r has no prototype, not using it." >&4 ;;
16656 *) srandom_r_proto=0
16660 : see if prototype for setresgid is available
16662 set d_sresgproto setresgid $i_unistd unistd.h
16665 : see if prototype for setresuid is available
16667 set d_sresuproto setresuid $i_unistd unistd.h
16670 : see if sys/stat.h is available
16671 set sys/stat.h i_sysstat
16675 : see if stat knows about block sizes
16677 echo "Checking to see if your struct stat has st_blocks field..." >&4
16678 set d_statblks stat st_blocks $i_sysstat sys/stat.h
16682 : see if this is a sys/vfs.h system
16683 set sys/vfs.h i_sysvfs
16687 : see if this is a sys/statfs.h system
16688 set sys/statfs.h i_sysstatfs
16693 echo "Checking to see if your system supports struct statfs..." >&4
16694 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
16696 case "$d_statfs_s" in
16697 "$define") echo "Yes, it does." ;;
16698 *) echo "No, it doesn't." ;;
16703 : see if struct statfs knows about f_flags
16704 case "$d_statfs_s" in
16707 echo "Checking to see if your struct statfs has f_flags field..." >&4
16708 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
16712 set d_statfs_f_flags
16716 case "$d_statfs_f_flags" in
16717 "$define") echo "Yes, it does." ;;
16718 *) echo "No, it doesn't." ;;
16722 Checking how to access stdio streams by file descriptor number...
16724 case "$stdio_stream_array" in
16725 '') $cat >try.c <<EOCP
16728 if (&STDIO_STREAM_ARRAY[fileno(stdin)] == stdin)
16732 for s in _iob __iob __sF
16734 set try -DSTDIO_STREAM_ARRAY=$s
16735 if eval $compile; then
16736 case "`$run ./try`" in
16737 yes) stdio_stream_array=$s; break ;;
16741 $rm -f try.* try$exe_ext
16743 case "$stdio_stream_array" in
16745 I can't figure out how to access stdio streams by file descriptor number.
16747 d_stdio_stream_array="$undef"
16750 You can access stdio streams by file descriptor number by the $stdio_stream_array array.
16752 d_stdio_stream_array="$define"
16756 : see if strcoll exists
16757 set strcoll d_strcoll
16760 : check for structure copying
16762 echo "Checking to see if your C compiler can copy structs..." >&4
16763 $cat >try.c <<'EOCP'
16773 if $cc -c try.c >/dev/null 2>&1 ; then
16775 echo "Yup, it can."
16778 echo "Nope, it can't."
16784 : see if strerror and/or sys_errlist[] exist
16786 if test "X$d_strerror" = X -o "X$d_syserrlst" = X; then
16787 if set strerror val -f d_strerror; eval $csym; $val; then
16788 echo 'strerror() found.' >&4
16789 d_strerror="$define"
16790 d_strerrm='strerror(e)'
16791 if set sys_errlist val -a d_syserrlst; eval $csym; $val; then
16792 echo "(You also have sys_errlist[], so we could roll our own strerror.)"
16793 d_syserrlst="$define"
16795 echo "(Since you don't have sys_errlist[], sterror() is welcome.)"
16796 d_syserrlst="$undef"
16798 elif xxx=`./findhdr string.h`; test "$xxx" || xxx=`./findhdr strings.h`; \
16799 $contains '#[ ]*define.*strerror' "$xxx" >/dev/null 2>&1; then
16800 echo 'strerror() found in string header.' >&4
16801 d_strerror="$define"
16802 d_strerrm='strerror(e)'
16803 if set sys_errlist val -a d_syserrlst; eval $csym; $val; then
16804 echo "(Most probably, strerror() uses sys_errlist[] for descriptions.)"
16805 d_syserrlst="$define"
16807 echo "(You don't appear to have any sys_errlist[], how can this be?)"
16808 d_syserrlst="$undef"
16810 elif set sys_errlist val -a d_syserrlst; eval $csym; $val; then
16811 echo "strerror() not found, but you have sys_errlist[] so we'll use that." >&4
16812 d_strerror="$undef"
16813 d_syserrlst="$define"
16814 d_strerrm='((e)<0||(e)>=sys_nerr?"unknown":sys_errlist[e])'
16816 echo 'strerror() and sys_errlist[] NOT found.' >&4
16817 d_strerror="$undef"
16818 d_syserrlst="$undef"
16819 d_strerrm='"unknown"'
16823 : see if strerror_r exists
16824 set strerror_r d_strerror_r
16826 case "$d_strerror_r" in
16828 hdrs="$i_systypes sys/types.h define stdio.h $i_string string.h"
16829 case "$d_strerror_r_proto:$usethreads" in
16830 ":define") d_strerror_r_proto=define
16831 set d_strerror_r_proto strerror_r $hdrs
16835 case "$d_strerror_r_proto" in
16837 case "$strerror_r_proto" in
16838 ''|0) try='int strerror_r(int, char*, size_t);'
16839 ./protochk "extern $try" $hdrs && strerror_r_proto=I_IBW ;;
16841 case "$strerror_r_proto" in
16842 ''|0) try='int strerror_r(int, char*, int);'
16843 ./protochk "extern $try" $hdrs && strerror_r_proto=I_IBI ;;
16845 case "$strerror_r_proto" in
16846 ''|0) try='char* strerror_r(int, char*, size_t);'
16847 ./protochk "extern $try" $hdrs && strerror_r_proto=B_IBW ;;
16849 case "$strerror_r_proto" in
16850 ''|0) d_strerror_r=undef
16852 echo "Disabling strerror_r, cannot determine prototype." >&4 ;;
16853 * ) case "$strerror_r_proto" in
16854 REENTRANT_PROTO*) ;;
16855 *) strerror_r_proto="REENTRANT_PROTO_$strerror_r_proto" ;;
16857 echo "Prototype: $try" ;;
16860 *) case "$usethreads" in
16861 define) echo "strerror_r has no prototype, not using it." >&4 ;;
16868 *) strerror_r_proto=0
16872 : see if strftime exists
16873 set strftime d_strftime
16876 : see if strlcat exists
16877 set strlcat d_strlcat
16880 : see if strlcpy exists
16881 set strlcpy d_strlcpy
16884 : see if strtod exists
16885 set strtod d_strtod
16888 : see if strtol exists
16889 set strtol d_strtol
16892 : see if strtold exists
16893 set strtold d_strtold
16896 : see if strtoll exists
16897 set strtoll d_strtoll
16900 case "$d_longlong-$d_strtoll" in
16903 Checking whether your strtoll() works okay...
16905 $cat >try.c <<'EOCP'
16908 #define strtoll __strtoll
16911 #define strtoll _strtoll
16914 extern long long int strtoll(char *s, char **, int);
16915 static int bad = 0;
16916 int check(char *s, long long ell, int een) {
16919 gll = strtoll(s, 0, 10);
16920 if (!((gll == ell) && (errno == een)))
16924 check(" 1", 1LL, 0);
16925 check(" 0", 0LL, 0);
16926 check("-1", -1LL, 0);
16927 check("-9223372036854775808", -9223372036854775808LL, 0);
16928 check("-9223372036854775808", -9223372036854775808LL, 0);
16929 check(" 9223372036854775807", 9223372036854775807LL, 0);
16930 check("-9223372036854775808", -9223372036854775808LL, 0);
16931 check(" 9223372036854775808", 9223372036854775807LL, ERANGE);
16932 check("-9223372036854775809", -9223372036854775808LL, ERANGE);
16938 if eval $compile; then
16941 ok) echo "Your strtoll() seems to be working okay." ;;
16943 Your strtoll() doesn't seem to be working okay.
16949 echo "(I can't seem to compile the test program--assuming it doesn't)"
16955 : see if strtoq exists
16956 set strtoq d_strtoq
16959 : see if strtoul exists
16960 set strtoul d_strtoul
16963 case "$d_strtoul" in
16966 Checking whether your strtoul() works okay...
16968 $cat >try.c <<'EOCP'
16971 extern unsigned long int strtoul(char *s, char **, int);
16972 static int bad = 0;
16973 void check(char *s, unsigned long eul, int een) {
16976 gul = strtoul(s, 0, 10);
16977 if (!((gul == eul) && (errno == een)))
16981 check(" 1", 1L, 0);
16982 check(" 0", 0L, 0);
16984 case "$longsize" in
16986 $cat >>try.c <<'EOCP'
16987 check("18446744073709551615", 18446744073709551615UL, 0);
16988 check("18446744073709551616", 18446744073709551615UL, ERANGE);
16989 #if 0 /* strtoul() for /^-/ strings is undefined. */
16990 check("-1", 18446744073709551615UL, 0);
16991 check("-18446744073709551614", 2, 0);
16992 check("-18446744073709551615", 1, 0);
16993 check("-18446744073709551616", 18446744073709551615UL, ERANGE);
16994 check("-18446744073709551617", 18446744073709551615UL, ERANGE);
16999 $cat >>try.c <<'EOCP'
17000 check("4294967295", 4294967295UL, 0);
17001 check("4294967296", 4294967295UL, ERANGE);
17002 #if 0 /* strtoul() for /^-/ strings is undefined. */
17003 check("-1", 4294967295UL, 0);
17004 check("-4294967294", 2, 0);
17005 check("-4294967295", 1, 0);
17006 check("-4294967296", 4294967295UL, ERANGE);
17007 check("-4294967297", 4294967295UL, ERANGE);
17012 : Should we write these tests to be more portable by sprintf-ing
17013 : ~0 and then manipulating that char string as input for strtol?
17016 $cat >>try.c <<'EOCP'
17023 if eval $compile; then
17024 case "`$run ./try`" in
17025 ok) echo "Your strtoul() seems to be working okay." ;;
17027 Your strtoul() doesn't seem to be working okay.
17036 : see if strtoull exists
17037 set strtoull d_strtoull
17040 case "$d_longlong-$d_strtoull" in
17043 Checking whether your strtoull() works okay...
17045 $cat >try.c <<'EOCP'
17048 #define strtoull __strtoull
17051 extern unsigned long long int strtoull(char *s, char **, int);
17052 static int bad = 0;
17053 int check(char *s, long long eull, int een) {
17056 gull = strtoull(s, 0, 10);
17057 if (!((gull == eull) && (errno == een)))
17061 check(" 1", 1LL, 0);
17062 check(" 0", 0LL, 0);
17063 check("18446744073709551615", 18446744073709551615ULL, 0);
17064 check("18446744073709551616", 18446744073709551615ULL, ERANGE);
17065 #if 0 /* strtoull() for /^-/ strings is undefined. */
17066 check("-1", 18446744073709551615ULL, 0);
17067 check("-18446744073709551614", 2LL, 0);
17068 check("-18446744073709551615", 1LL, 0);
17069 check("-18446744073709551616", 18446744073709551615ULL, ERANGE);
17070 check("-18446744073709551617", 18446744073709551615ULL, ERANGE);
17077 if eval $compile; then
17078 case "`$run ./try`" in
17079 ok) echo "Your strtoull() seems to be working okay." ;;
17081 Your strtoull() doesn't seem to be working okay.
17083 d_strtoull="$undef"
17090 : see if strtouq exists
17091 set strtouq d_strtouq
17094 case "$d_strtouq" in
17097 Checking whether your strtouq() works okay...
17099 $cat >try.c <<'EOCP'
17102 extern unsigned long long int strtouq(char *s, char **, int);
17103 static int bad = 0;
17104 void check(char *s, unsigned long long eull, int een) {
17105 unsigned long long gull;
17107 gull = strtouq(s, 0, 10);
17108 if (!((gull == eull) && (errno == een)))
17112 check(" 1", 1LL, 0);
17113 check(" 0", 0LL, 0);
17114 check("18446744073709551615", 18446744073709551615ULL, 0);
17115 check("18446744073709551616", 18446744073709551615ULL, ERANGE);
17116 #if 0 /* strtouq() for /^-/ strings is undefined. */
17117 check("-1", 18446744073709551615ULL, 0);
17118 check("-18446744073709551614", 2LL, 0);
17119 check("-18446744073709551615", 1LL, 0);
17120 check("-18446744073709551616", 18446744073709551615ULL, ERANGE);
17121 check("-18446744073709551617", 18446744073709551615ULL, ERANGE);
17129 if eval $compile; then
17130 case "`$run ./try`" in
17131 ok) echo "Your strtouq() seems to be working okay." ;;
17133 Your strtouq() doesn't seem to be working okay.
17142 : see if strxfrm exists
17143 set strxfrm d_strxfrm
17146 : see if symlink exists
17147 set symlink d_symlink
17150 : see if syscall exists
17151 set syscall d_syscall
17154 : see if prototype for syscall is available
17156 set d_syscallproto syscall $i_unistd unistd.h
17159 : see if sysconf exists
17160 set sysconf d_sysconf
17163 : see if system exists
17164 set system d_system
17167 : see if tcgetpgrp exists
17168 set tcgetpgrp d_tcgetpgrp
17171 : see if tcsetpgrp exists
17172 set tcsetpgrp d_tcsetpgrp
17175 : see if prototype for telldir is available
17177 set d_telldirproto telldir $i_systypes sys/types.h $i_dirent dirent.h
17180 : see if time exists
17182 if test "X$d_time" = X -o X"$timetype" = X; then
17183 if set time val -f d_time; eval $csym; $val; then
17184 echo 'time() found.' >&4
17186 rp="What is the type returned by time() on this system?"
17187 set time_t timetype long stdio.h sys/types.h
17190 echo 'time() not found, hope that will do.' >&4
17198 : see if this is a sys/times.h system
17199 set sys/times.h i_systimes
17202 : see if times exists
17204 if set times val -f d_times; eval $csym; $val; then
17205 echo 'times() found.' >&4
17208 case "$i_systimes" in
17209 "$define") inc='sys/times.h';;
17211 rp="What is the type returned by times() on this system?"
17212 set clock_t clocktype long stdio.h sys/types.h $inc
17215 echo 'times() NOT found, hope that will do.' >&4
17220 : see if tmpnam_r exists
17221 set tmpnam_r d_tmpnam_r
17223 case "$d_tmpnam_r" in
17225 hdrs="$i_systypes sys/types.h define stdio.h "
17226 case "$d_tmpnam_r_proto:$usethreads" in
17227 ":define") d_tmpnam_r_proto=define
17228 set d_tmpnam_r_proto tmpnam_r $hdrs
17232 case "$d_tmpnam_r_proto" in
17234 case "$tmpnam_r_proto" in
17235 ''|0) try='char* tmpnam_r(char*);'
17236 ./protochk "extern $try" $hdrs && tmpnam_r_proto=B_B ;;
17238 case "$tmpnam_r_proto" in
17239 ''|0) d_tmpnam_r=undef
17241 echo "Disabling tmpnam_r, cannot determine prototype." >&4 ;;
17242 * ) case "$tmpnam_r_proto" in
17243 REENTRANT_PROTO*) ;;
17244 *) tmpnam_r_proto="REENTRANT_PROTO_$tmpnam_r_proto" ;;
17246 echo "Prototype: $try" ;;
17249 *) case "$usethreads" in
17250 define) echo "tmpnam_r has no prototype, not using it." >&4 ;;
17257 *) tmpnam_r_proto=0
17261 : see if truncate exists
17262 set truncate d_truncate
17265 : see if ttyname_r exists
17266 set ttyname_r d_ttyname_r
17268 case "$d_ttyname_r" in
17270 hdrs="$i_systypes sys/types.h define stdio.h $i_unistd unistd.h"
17271 case "$d_ttyname_r_proto:$usethreads" in
17272 ":define") d_ttyname_r_proto=define
17273 set d_ttyname_r_proto ttyname_r $hdrs
17277 case "$d_ttyname_r_proto" in
17279 case "$ttyname_r_proto" in
17280 ''|0) try='int ttyname_r(int, char*, size_t);'
17281 ./protochk "extern $try" $hdrs && ttyname_r_proto=I_IBW ;;
17283 case "$ttyname_r_proto" in
17284 ''|0) try='int ttyname_r(int, char*, int);'
17285 ./protochk "extern $try" $hdrs && ttyname_r_proto=I_IBI ;;
17287 case "$ttyname_r_proto" in
17288 ''|0) try='char* ttyname_r(int, char*, int);'
17289 ./protochk "extern $try" $hdrs && ttyname_r_proto=B_IBI ;;
17291 case "$ttyname_r_proto" in
17292 ''|0) d_ttyname_r=undef
17294 echo "Disabling ttyname_r, cannot determine prototype." >&4 ;;
17295 * ) case "$ttyname_r_proto" in
17296 REENTRANT_PROTO*) ;;
17297 *) ttyname_r_proto="REENTRANT_PROTO_$ttyname_r_proto" ;;
17299 echo "Prototype: $try" ;;
17302 *) case "$usethreads" in
17303 define) echo "ttyname_r has no prototype, not using it." >&4 ;;
17310 *) ttyname_r_proto=0
17314 : see if tzname[] exists
17316 if set tzname val -a d_tzname; eval $csym; $val; then
17318 echo 'tzname[] found.' >&4
17321 echo 'tzname[] NOT found.' >&4
17327 next|rhapsody|darwin) multiarch="$define" ;;
17329 case "$multiarch" in
17330 ''|[nN]*) multiarch="$undef" ;;
17333 : check for ordering of bytes in a UV
17335 case "$usecrosscompile$multiarch" in
17338 You seem to be either cross-compiling or doing a multiarchitecture build,
17339 skipping the byteorder check.
17345 case "$byteorder" in
17348 In the following, larger digits indicate more significance. A big-endian
17349 machine like a Pyramid or a Motorola 680?0 chip will come out to 4321. A
17350 little-endian machine like a Vax or an Intel 80?86 chip would be 1234. Other
17351 machines may have weird orders like 3412. A Cray will report 87654321,
17352 an Alpha will report 12345678. If the test program works the default is
17354 I'm now running the test program...
17358 #$i_stdlib I_STDLIB
17360 #include <stdlib.h>
17362 #include <sys/types.h>
17363 typedef $uvtype UV;
17373 u.l = (((UV)0x08070605) << 32) | (UV)0x04030201;
17375 u.l = (UV)0x04030201;
17376 for (i = 0; i < $uvsize; i++)
17377 printf("%c", u.c[i]+'0');
17384 if eval $compile && ./try > /dev/null; then
17387 [1-4][1-4][1-4][1-4]|12345678|87654321)
17388 echo "(The test program ran ok.)"
17389 echo "byteorder=$dflt"
17392 ????|????????) echo "(The test program ran ok.)" ;;
17393 *) echo "(The test program didn't run right for some reason.)" ;;
17398 (I can't seem to compile the test program. Guessing big-endian...)
17401 case "$xxx_prompt" in
17403 rp="What is the order of bytes in $uvtype?"
17419 Checking to see whether you can access character data unalignedly...
17421 case "$d_u32align" in
17422 '') $cat >try.c <<EOCP
17424 #$i_stdlib I_STDLIB
17426 #include <stdlib.h>
17428 #define U32 $u32type
17429 #define BYTEORDER 0x$byteorder
17431 #include <signal.h>
17433 $signal_t bletch(s) int s; { exit(4); }
17436 #if BYTEORDER == 0x1234 || BYTEORDER == 0x4321
17441 if (sizeof(U32) != 4) {
17442 printf("sizeof(U32) is not 4, but %d\n", sizeof(U32));
17449 signal(SIGBUS, bletch);
17461 for (i = 0; i < 4; i++) {
17462 up = (U32*)(buf + i);
17463 if (! ((*up == 1 << (8*i)) || /* big-endian */
17464 (*up == 1 << (8*(3-i))) /* little-endian */
17468 printf("read failed (%x)\n", *up);
17474 for (i = 0; i < 4; i++) {
17475 up = (U32*)(buf + i);
17477 if (*up != 0xBeef) {
17478 printf("write failed (%x)\n", *up);
17492 if eval $compile_ok; then
17493 echo "(Testing for character data alignment may crash the test. That's okay.)" >&4
17494 $run ./try 2>&1 >/dev/null
17497 You can access character data pretty unalignedly.
17499 d_u32align="$undef"
17502 It seems that you must access character data in an aligned manner.
17504 d_u32align="$define"
17508 rp='Can you access character data at unaligned addresses?'
17512 [yY]*) d_u32align="$undef" ;;
17513 *) d_u32align="$define" ;;
17516 $rm -f core core.try.* try.core
17520 : see if ualarm exists
17521 set ualarm d_ualarm
17524 : see if umask exists
17528 : see if unordered exists
17529 set unordered d_unordered
17532 : see if unsetenv exists
17533 set unsetenv d_unsetenv
17536 : see if usleep exists
17537 set usleep d_usleep
17540 : see if prototype for usleep is available
17542 set d_usleepproto usleep $i_unistd unistd.h
17545 : see if ustat exists
17549 : backward compatibility for d_hvfork
17550 if test X$d_hvfork != X; then
17551 d_vfork="$d_hvfork"
17554 : see if there is a vfork
17559 : Ok, but do we want to use it. vfork is reportedly unreliable in
17560 : perl on Solaris 2.x, and probably elsewhere.
17564 case "$usevfork" in
17570 Perl can only use a vfork() that doesn't suffer from strict
17571 restrictions on calling functions or modifying global data in
17572 the child. For example, glibc-2.1 contains such a vfork()
17573 that is unsuitable. If your system provides a proper fork()
17574 call, chances are that you do NOT want perl to use vfork().
17577 rp="Do you still want to use vfork()?"
17582 echo "Ok, we won't use vfork()."
17591 $define) usevfork='true';;
17592 *) usevfork='false';;
17595 : see if closedir exists
17596 set closedir d_closedir
17599 case "$d_closedir" in
17602 echo "Checking whether closedir() returns a status..." >&4
17604 #$i_dirent I_DIRENT /**/
17605 #$i_sysdir I_SYS_DIR /**/
17606 #$i_sysndir I_SYS_NDIR /**/
17607 #$i_systypes I_SYS_TYPES /**/
17609 #if defined(I_SYS_TYPES)
17610 #include <sys/types.h>
17612 #if defined(I_DIRENT)
17613 #include <dirent.h>
17614 #if defined(NeXT) && defined(I_SYS_DIR) /* NeXT needs dirent + sys/dir.h */
17615 #include <sys/dir.h>
17619 #include <sys/ndir.h>
17623 #include <ndir.h> /* may be wrong in the future */
17625 #include <sys/dir.h>
17630 int main() { return closedir(opendir(".")); }
17633 if eval $compile_ok; then
17634 if $run ./try > /dev/null 2>&1 ; then
17635 echo "Yes, it does."
17638 echo "No, it doesn't."
17642 echo "(I can't seem to compile the test program--assuming it doesn't)"
17650 set d_void_closedir
17653 : see if there is a wait4
17657 : see if waitpid exists
17658 set waitpid d_waitpid
17661 : see if wcstombs exists
17662 set wcstombs d_wcstombs
17665 : see if wctomb exists
17666 set wctomb d_wctomb
17669 : see if writev exists
17670 set writev d_writev
17673 : preserve RCS keywords in files with variable substitution, grrr
17678 Revision='$Revision'
17680 : check for alignment requirements
17682 case "$usecrosscompile$multiarch" in
17685 You seem to be either cross-compiling or doing a multiarchitecture build,
17686 skipping the memory alignment check.
17689 case "$alignbytes" in
17690 '') alignbytes=8 ;;
17694 case "$alignbytes" in
17695 '') echo "Checking alignment constraints..." >&4
17696 if $test "X$uselongdouble" = Xdefine -a "X$d_longdbl" = Xdefine; then
17697 $cat >try.c <<'EOCP'
17698 typedef long double NV;
17701 $cat >try.c <<'EOCP'
17705 $cat >>try.c <<'EOCP'
17713 printf("%d\n", (int)((char *)&try_algn.bar - (char *)&try_algn.foo));
17718 if eval $compile_ok; then
17722 echo "(I can't seem to compile the test program...)"
17725 *) dflt="$alignbytes"
17728 rp="Doubles must be aligned on a how-many-byte boundary?"
17736 : set the base revision
17739 : how do we concatenate cpp tokens here?
17741 echo "Checking to see how your cpp does stuff like concatenate tokens..." >&4
17742 $cat >cpp_stuff.c <<'EOCP'
17743 #define RCAT(a,b)a/**/b
17744 #define ACAT(a,b)a ## b
17748 $cppstdin $cppflags $cppminus <cpp_stuff.c >cpp_stuff.out 2>&1
17749 if $contains 'Circus' cpp_stuff.out >/dev/null 2>&1; then
17750 echo "Oh! Smells like ANSI's been here." >&4
17751 echo "We can catify or stringify, separately or together!"
17753 elif $contains 'Reiser' cpp_stuff.out >/dev/null 2>&1; then
17754 echo "Ah, yes! The good old days!" >&4
17755 echo "However, in the good old days we don't know how to stringify and"
17756 echo "catify at the same time."
17760 Hmm, I don't seem to be able to concatenate tokens with your cpp.
17761 You're going to have to edit the values of CAT[2-5] in config.h...
17763 cpp_stuff="/* Help! How do we handle cpp_stuff? */*/"
17767 : see if this is a db.h system
17773 : Check db version.
17775 echo "Checking Berkeley DB version ..." >&4
17781 #include <sys/types.h>
17783 #$i_stdlib I_STDLIB
17785 #include <stdlib.h>
17788 int main(int argc, char *argv[])
17790 #ifdef DB_VERSION_MAJOR /* DB version >= 2 */
17791 int Major, Minor, Patch ;
17792 unsigned long Version ;
17793 (void)db_version(&Major, &Minor, &Patch) ;
17795 printf("%d %d %d %d %d %d\n",
17796 DB_VERSION_MAJOR, DB_VERSION_MINOR, DB_VERSION_PATCH,
17797 Major, Minor, Patch);
17800 printf("You have Berkeley DB Version 2 or greater.\n");
17802 printf("db.h is from Berkeley DB Version %d.%d.%d\n",
17803 DB_VERSION_MAJOR, DB_VERSION_MINOR, DB_VERSION_PATCH);
17804 printf("libdb is from Berkeley DB Version %d.%d.%d\n",
17805 Major, Minor, Patch) ;
17807 /* check that db.h & libdb are compatible */
17808 if (DB_VERSION_MAJOR != Major || DB_VERSION_MINOR != Minor || DB_VERSION_PATCH != Patch) {
17809 printf("db.h and libdb are incompatible.\n") ;
17813 printf("db.h and libdb are compatible.\n") ;
17815 Version = DB_VERSION_MAJOR * 1000000 + DB_VERSION_MINOR * 1000
17816 + DB_VERSION_PATCH ;
17818 /* needs to be >= 2.3.4 */
17819 if (Version < 2003004) {
17820 /* if (DB_VERSION_MAJOR == 2 && DB_VERSION_MINOR == 0 && DB_VERSION_PATCH < 5) { */
17821 printf("Perl needs Berkeley DB 2.3.4 or greater.\n") ;
17827 #if defined(_DB_H_) && defined(BTREEMAGIC) && defined(HASHMAGIC)
17832 printf("You have Berkeley DB Version 1.\n");
17833 exit(0); /* DB version < 2: the coast is clear. */
17835 exit(1); /* <db.h> not Berkeley DB? */
17841 if eval $compile_ok && $run ./try; then
17842 echo 'Looks OK.' >&4
17844 db_version_major=$1
17845 db_version_minor=$2
17846 db_version_patch=$3
17848 echo "I can't use Berkeley DB with your <db.h>. I'll disable Berkeley DB." >&4
17852 : Remove db from list of libraries to use
17853 echo "Removing unusable -ldb from library list" >&4
17854 set `echo X $libs | $sed -e 's/-ldb / /' -e 's/-ldb$//'`
17857 echo "libs = $libs" >&4
17867 : Check the return type needed for hash
17869 echo "Checking return type needed for hash for Berkeley DB ..." >&4
17875 #include <sys/types.h>
17878 #ifndef DB_VERSION_MAJOR
17879 u_int32_t hash_cb (ptr, size)
17887 info.hash = hash_cb;
17891 if $cc $ccflags -c try.c >try.out 2>&1 ; then
17892 if $contains warning try.out >>/dev/null 2>&1 ; then
17895 db_hashtype='u_int32_t'
17898 : XXX Maybe we should just give up here.
17899 db_hashtype=u_int32_t
17901 echo "Help: I can't seem to compile the db test program." >&4
17902 echo "Something's wrong, but I'll assume you use $db_hashtype." >&4
17905 echo "Your version of Berkeley DB uses $db_hashtype for hash."
17907 *) db_hashtype=u_int32_t
17912 : Check the return type needed for prefix
17914 echo "Checking return type needed for prefix for Berkeley DB ..." >&4
17920 #include <sys/types.h>
17923 #ifndef DB_VERSION_MAJOR
17924 size_t prefix_cb (key1, key2)
17932 info.prefix = prefix_cb;
17936 if $cc $ccflags -c try.c >try.out 2>&1 ; then
17937 if $contains warning try.out >>/dev/null 2>&1 ; then
17938 db_prefixtype='int'
17940 db_prefixtype='size_t'
17943 db_prefixtype='size_t'
17944 : XXX Maybe we should just give up here.
17946 echo "Help: I can't seem to compile the db test program." >&4
17947 echo "Something's wrong, but I'll assume you use $db_prefixtype." >&4
17950 echo "Your version of Berkeley DB uses $db_prefixtype for prefix."
17952 *) db_prefixtype='size_t'
17957 : How can we generate normalized random numbers ?
17959 echo "Looking for a random number function..." >&4
17960 case "$randfunc" in
17962 if set drand48 val -f; eval $csym; $val; then
17964 echo "Good, found drand48()." >&4
17965 elif set random val -f; eval $csym; $val; then
17967 echo "OK, found random()." >&4
17970 echo "Yick, looks like I have to use rand()." >&4
17981 *-Dmy_rand=*|*-Dmy_srand=*)
17982 echo "Removing obsolete -Dmy_rand, -Dmy_srand, and -Drandbits from ccflags." >&4
17983 ccflags="`echo $ccflags | sed -e 's/-Dmy_rand=random/ /'`"
17984 ccflags="`echo $ccflags | sed -e 's/-Dmy_srand=srandom/ /'`"
17985 ccflags="`echo $ccflags | sed -e 's/-Drandbits=[0-9][0-9]*/ /'`"
17989 while $test "$cont"; do
17990 rp="Use which function to generate random numbers?"
17992 if $test "$ans" = "$dflt"; then
17998 if set $ans val -f; eval $csym; $val; then
18002 rp="I cannot find function $ans. Use that name anyway?"
18011 case "$randfunc" in
18013 drand01="drand48()"
18019 case "$randbits" in
18021 echo "Checking to see how many bits your $randfunc() function produces..." >&4
18023 #$i_unistd I_UNISTD
18024 #$i_stdlib I_STDLIB
18027 # include <unistd.h>
18030 # include <stdlib.h>
18035 register unsigned long tmp;
18036 register unsigned long max = 0L;
18038 for (i = 1000; i; i--) {
18039 tmp = (unsigned long) $randfunc();
18040 if (tmp > max) max = tmp;
18042 for (i = 0; max; i++)
18048 if eval $compile_ok; then
18052 echo "(I can't seem to compile the test program...)"
18059 rp="How many bits does your $randfunc() function produce?"
18063 drand01="($randfunc() / (double) ((unsigned long)1 << $randbits))"
18064 seedfunc="s$randfunc"
18065 randseedtype=unsigned
18069 rp="How many bits does your $randfunc() function produce?"
18072 seedfunc="s$randfunc"
18073 drand01="($randfunc() / (double) ((unsigned long)1 << $randbits))"
18074 if set $seedfunc val -f; eval $csym; $val; then
18075 echo "(Using $seedfunc() to seed random generator)"
18077 echo "(Warning: no $seedfunc() to seed random generator)"
18080 randseedtype=unsigned
18088 echo "Determining whether or not we are on an EBCDIC system..." >&4
18089 $cat >try.c <<'EOM'
18092 if ('M'==0xd4) return 0;
18099 if eval $compile_ok; then
18100 if $run ./try; then
18101 echo "You seem to speak EBCDIC." >&4
18104 echo "Nope, no EBCDIC, probably ASCII or some ISO Latin. Or UTF-8." >&4
18107 echo "I'm unable to compile the test program." >&4
18108 echo "I'll assume ASCII or some ISO Latin. Or UTF8." >&4
18116 Checking how to flush all pending stdio output...
18118 # I only know how to find the first 32 possibly open files on SunOS.
18119 # See also hints/sunos_4_1.sh and util.c --AD
18121 sunos) $echo '#define PERL_FFLUSH_ALL_FOPEN_MAX 32' > try.c ;;
18123 $cat >>try.c <<EOCP
18125 #$i_stdlib I_STDLIB
18127 #include <stdlib.h>
18129 #$i_unistd I_UNISTD
18131 # include <unistd.h>
18133 #$d_sysconf HAS_SYSCONF
18134 #$d_stdio_stream_array HAS_STDIO_STREAM_ARRAY
18135 #ifdef HAS_STDIO_STREAM_ARRAY
18136 # define STDIO_STREAM_ARRAY $stdio_stream_array
18141 p = fopen("try.out", "w");
18145 # ifdef TRY_FPRINTF
18149 #ifdef TRY_FFLUSH_NULL
18152 #ifdef TRY_FFLUSH_ALL
18154 long open_max = -1;
18155 # ifdef PERL_FFLUSH_ALL_FOPEN_MAX
18156 open_max = PERL_FFLUSH_ALL_FOPEN_MAX;
18158 # if defined(HAS_SYSCONF) && defined(_SC_OPEN_MAX)
18159 open_max = sysconf(_SC_OPEN_MAX);
18162 open_max = FOPEN_MAX;
18165 open_max = OPEN_MAX;
18174 # ifdef HAS_STDIO_STREAM_ARRAY
18175 if (open_max > 0) {
18177 for (i = 0; i < open_max; i++)
18178 if (STDIO_STREAM_ARRAY[i]._file >= 0 &&
18179 STDIO_STREAM_ARRAY[i]._file < open_max &&
18180 STDIO_STREAM_ARRAY[i]._flag)
18181 fflush(&STDIO_STREAM_ARRAY[i]);
18189 : first we have to find out how _not_ to flush
18191 if $test "X$fflushNULL" = X -o "X$fflushall" = X; then
18193 set try -DTRY_FPUTC
18194 if eval $compile; then
18195 $run ./try 2>/dev/null
18198 if $test ! -s try.out -a "X$code" = X42; then
18204 set try -DTRY_FPRINTF
18205 if eval $compile; then
18206 $run ./try 2>/dev/null
18209 if $test ! -s try.out -a "X$code" = X42; then
18210 output=-DTRY_FPRINTF
18216 : check for fflush NULL behaviour
18217 case "$fflushNULL" in
18218 '') set try -DTRY_FFLUSH_NULL $output
18219 if eval $compile; then
18220 $run ./try 2>/dev/null
18223 if $test -s try.out -a "X$code" = X42; then
18224 fflushNULL="`$cat try.out`"
18226 if $test "X$code" != X42; then
18228 (If this test failed, don't worry, we'll try another method shortly.)
18233 $rm -f core try.core core.try.*
18234 case "$fflushNULL" in
18236 Your fflush(NULL) works okay for output streams.
18237 Let's see if it clobbers input pipes...
18239 # As of mid-March 2000 all versions of Solaris appear to have a stdio
18240 # bug that improperly flushes the input end of pipes. So we avoid the
18241 # autoflush on fork/system/exec support for now. :-(
18242 $cat >tryp.c <<EOCP
18245 main(int argc, char **argv)
18251 while ((i = getc(stdin)) != -1
18252 && (*bp++ = i) != '\n'
18253 && bp < &buf[1024])
18256 fprintf(stdout, "%s", buf);
18264 fflushNULL="$define"
18266 if eval $compile; then
18268 $cat tryp.c | $run ./tryp 2>/dev/null > tryp.out
18269 if cmp tryp.c tryp.out >/dev/null 2>&1; then
18271 fflush(NULL) seems to behave okay with input streams.
18273 fflushNULL="$define"
18276 Ouch, fflush(NULL) clobbers input pipes! We will not use it.
18278 fflushNULL="$undef"
18281 $rm -f core tryp.c tryp.core core.tryp.*
18284 Your fflush(NULL) isn't working (contrary to ANSI C).
18286 fflushNULL="$undef"
18289 Cannot figure out whether your fflush(NULL) works or not.
18290 I'm assuming it doesn't (contrary to ANSI C).
18292 fflushNULL="$undef"
18296 $define|true|[yY]*)
18297 fflushNULL="$define"
18300 fflushNULL="$undef"
18303 : check explicit looping only if NULL did not work, and if the pipe
18304 : bug does not show up on an explicit flush too
18305 case "$fflushNULL" in
18307 $cat >tryp.c <<EOCP
18310 main(int argc, char **argv)
18316 while ((i = getc(stdin)) != -1
18317 && (*bp++ = i) != '\n'
18318 && bp < &buf[1024])
18321 fprintf(stdout, "%s", buf);
18330 if eval $compile; then
18332 $cat tryp.c | $run ./tryp 2>/dev/null > tryp.out
18333 if cmp tryp.c tryp.out >/dev/null 2>&1; then
18335 Good, at least fflush(stdin) seems to behave okay when stdin is a pipe.
18337 : now check for fflushall behaviour
18338 case "$fflushall" in
18339 '') set try -DTRY_FFLUSH_ALL $output
18340 if eval $compile; then
18342 (Now testing the other method--but note that this also may fail.)
18344 $run ./try 2>/dev/null
18347 if $test -s try.out -a "X$code" = X42; then
18348 fflushall="`$cat try.out`"
18351 $rm -f core try.core core.try.*
18352 case "$fflushall" in
18354 Whew. Flushing explicitly all the stdio streams works.
18356 fflushall="$define"
18359 Sigh. Flushing explicitly all the stdio streams doesn't work.
18364 Cannot figure out whether flushing stdio streams explicitly works or not.
18365 I'm assuming it doesn't.
18371 "$define"|true|[yY]*)
18372 fflushall="$define"
18380 All is futile. Even fflush(stdin) clobbers input pipes!
18387 $rm -f core tryp.c tryp.core core.tryp.*
18389 *) fflushall="$undef"
18393 case "$fflushNULL$fflushall" in
18396 OK, I give up. I cannot figure out how to flush pending stdio output.
18397 We won't be flushing handles at all before fork/exec/popen.
18401 $rm -f try.* try$exe_ext
18403 : Store the full pathname to the ar program for use in the C program
18404 : Respect a hint or command line value for full_ar.
18409 : Store the full pathname to the sed program for use in the C program
18412 : see what type gids are declared as in the kernel
18414 echo "Looking for the type for group ids returned by getgid()."
18415 set gid_t gidtype xxx stdio.h sys/types.h
18419 xxx=`./findhdr sys/user.h`
18420 set `grep 'groups\[NGROUPS\];' "$xxx" 2>/dev/null` unsigned short
18422 unsigned) dflt="$1 $2" ;;
18426 *) dflt="$gidtype";;
18429 gid_t) echo "gid_t found." ;;
18430 *) rp="What is the type for group ids returned by getgid()?"
18438 *_t) zzz="$gidtype" ;;
18441 echo "Checking the size of $zzz..." >&4
18443 #include <sys/types.h>
18445 #$i_stdlib I_STDLIB
18447 #include <stdlib.h>
18450 printf("%d\n", (int)sizeof($gidtype));
18455 if eval $compile_ok; then
18459 echo "(I can't execute the test program--guessing $gidsize.)" >&4
18462 echo "Your $zzz is $gidsize bytes long."
18467 echo "(I can't compile the test program--guessing $gidsize.)" >&4
18473 *_t) zzz="$gidtype" ;;
18476 echo "Checking the sign of $zzz..." >&4
18478 #include <sys/types.h>
18489 if eval $compile; then
18493 echo "(I can't execute the test program--guessing unsigned.)" >&4
18497 1) echo "Your $zzz is unsigned." ;;
18498 -1) echo "Your $zzz is signed." ;;
18504 echo "(I can't compile the test program--guessing unsigned.)" >&4
18510 if $test X"$quadtype" != X; then
18512 echo "Checking how to print 64-bit integers..." >&4
18514 if $test X"$sPRId64" = X -a X"$quadtype" = Xint; then
18515 $cat >try.c <<'EOCP'
18516 #include <sys/types.h>
18519 int q = 12345678901;
18520 printf("%ld\n", q);
18524 if eval $compile; then
18528 sPRId64='"d"'; sPRIi64='"i"'; sPRIu64='"u"';
18529 sPRIo64='"o"'; sPRIx64='"x"'; sPRIXU64='"X"';
18530 echo "We will use %d."
18536 if $test X"$sPRId64" = X -a X"$quadtype" = Xlong; then
18537 $cat >try.c <<'EOCP'
18538 #include <sys/types.h>
18541 long q = 12345678901;
18542 printf("%ld\n", q);
18546 if eval $compile; then
18550 sPRId64='"ld"'; sPRIi64='"li"'; sPRIu64='"lu"';
18551 sPRIo64='"lo"'; sPRIx64='"lx"'; sPRIXU64='"lX"';
18552 echo "We will use %ld."
18558 if $test X"$sPRId64" = X -a X"$i_inttypes" = X"$define" -a X"$quadtype" = Xint64_t; then
18559 $cat >try.c <<'EOCP'
18560 #include <sys/types.h>
18561 #include <inttypes.h>
18564 int64_t q = 12345678901;
18565 printf("%" PRId64 "\n", q);
18569 if eval $compile; then
18573 sPRId64=PRId64; sPRIi64=PRIi64; sPRIu64=PRIu64;
18574 sPRIo64=PRIo64; sPRIx64=PRIx64; sPRIXU64=PRIXU64;
18575 echo "We will use the C9X style."
18581 if $test X"$sPRId64" = X -a X"$quadtype" != X; then
18583 #include <sys/types.h>
18586 $quadtype q = 12345678901;
18587 printf("%Ld\n", q);
18591 if eval $compile; then
18595 sPRId64='"Ld"'; sPRIi64='"Li"'; sPRIu64='"Lu"';
18596 sPRIo64='"Lo"'; sPRIx64='"Lx"'; sPRIXU64='"LX"';
18597 echo "We will use %Ld."
18603 if $test X"$sPRId64" = X -a X"$quadtype" = X"long long"; then
18604 $cat >try.c <<'EOCP'
18605 #include <sys/types.h>
18608 long long q = 12345678901LL; /* AIX cc requires the LL suffix. */
18609 printf("%lld\n", q);
18613 if eval $compile; then
18617 sPRId64='"lld"'; sPRIi64='"lli"'; sPRIu64='"llu"';
18618 sPRIo64='"llo"'; sPRIx64='"llx"'; sPRIXU64='"llX"';
18619 echo "We will use the %lld style."
18625 if $test X"$sPRId64" = X -a X"$quadtype" != X; then
18627 #include <sys/types.h>
18630 $quadtype q = 12345678901;
18631 printf("%qd\n", q);
18635 if eval $compile; then
18639 sPRId64='"qd"'; sPRIi64='"qi"'; sPRIu64='"qu"';
18640 sPRIo64='"qo"'; sPRIx64='"qx"'; sPRIXU64='"qX"';
18641 echo "We will use %qd."
18647 if $test X"$sPRId64" = X; then
18648 echo "Cannot figure out how to print 64-bit integers." >&4
18656 '') d_PRId64="$undef"; d_PRIi64="$undef"; d_PRIu64="$undef";
18657 d_PRIo64="$undef"; d_PRIx64="$undef"; d_PRIXU64="$undef";
18659 *) d_PRId64="$define"; d_PRIi64="$define"; d_PRIu64="$define";
18660 d_PRIo64="$define"; d_PRIx64="$define"; d_PRIXU64="$define";
18666 $echo "Checking the format strings to be used for Perl's internal types..." >&4
18668 if $test X"$ivsize" = X8; then
18669 ivdformat="$sPRId64"
18670 uvuformat="$sPRIu64"
18671 uvoformat="$sPRIo64"
18672 uvxformat="$sPRIx64"
18673 uvXUformat="$sPRIXU64"
18675 if $test X"$ivsize" = X"$longsize"; then
18682 if $test X"$ivsize" = X"$intsize"; then
18690 if $test X"$ivsize" = X"$shortsize"; then
18701 if $test X"$uselongdouble" = X"$define" -a X"$d_longdbl" = X"$define" -a X"$d_PRIgldbl" = X"$define"; then
18702 nveformat="$sPRIeldbl"
18703 nvfformat="$sPRIfldbl"
18704 nvgformat="$sPRIgldbl"
18705 nvEUformat="$sPRIEUldbl"
18706 nvFUformat="$sPRIFUldbl"
18707 nvGUformat="$sPRIGUldbl"
18717 case "$ivdformat" in
18718 '') echo "$0: Fatal: failed to find format strings, cannot continue." >&4
18725 $echo "Checking the format string to be used for gids..." >&4
18728 -1) if $test X"$gidsize" = X"$ivsize"; then
18729 gidformat="$ivdformat"
18731 if $test X"$gidsize" = X"$longsize"; then
18734 if $test X"$gidsize" = X"$intsize"; then
18737 if $test X"$gidsize" = X"$shortsize"; then
18744 *) if $test X"$gidsize" = X"$uvsize"; then
18745 gidformat="$uvuformat"
18747 if $test X"$gidsize" = X"$longsize"; then
18750 if $test X"$gidsize" = X"$intsize"; then
18753 if $test X"$gidsize" = X"$shortsize"; then
18762 : see if getgroups exists
18763 set getgroups d_getgrps
18766 : see if setgroups exists
18767 set setgroups d_setgrps
18771 : Find type of 2nd arg to 'getgroups()' and 'setgroups()'
18773 case "$d_getgrps$d_setgrps" in
18775 case "$groupstype" in
18776 '') dflt="$gidtype" ;;
18777 *) dflt="$groupstype" ;;
18780 What type of pointer is the second argument to getgroups() and setgroups()?
18781 Usually this is the same as group ids, $gidtype, but not always.
18784 rp='What type pointer is the second argument to getgroups() and setgroups()?'
18788 *) groupstype="$gidtype";;
18792 echo "Checking if your $make program sets \$(MAKE)..." >&4
18793 case "$make_set_make" in
18795 $sed 's/^X //' > testmake.mak << 'EOF'
18797 X @echo 'maketemp="$(MAKE)"'
18799 case "`$make -f testmake.mak 2>/dev/null`" in
18800 *maketemp=*) make_set_make='#' ;;
18801 *) make_set_make="MAKE=$make" ;;
18803 $rm -f testmake.mak
18806 case "$make_set_make" in
18807 '#') echo "Yup, it does.";;
18808 *) echo "Nope, it doesn't.";;
18811 : see what type is used for mode_t
18812 rp="What is the type used for file modes for system calls (e.g. fchmod())?"
18813 set mode_t modetype int stdio.h sys/types.h
18816 : see if stdarg is available
18818 if $test `./findhdr stdarg.h`; then
18819 echo "<stdarg.h> found." >&4
18822 echo "<stdarg.h> NOT found." >&4
18826 : see if varags is available
18828 if $test `./findhdr varargs.h`; then
18829 echo "<varargs.h> found." >&4
18831 echo "<varargs.h> NOT found, but that's ok (I hope)." >&4
18834 : set up the varargs testing programs
18835 $cat > varargs.c <<EOP
18837 #include <stdarg.h>
18840 #include <varargs.h>
18844 int f(char *p, ...)
18858 p = va_arg(ap, char *);
18863 $cat > varargs <<EOP
18865 if $cc -c $ccflags -D\$1 varargs.c >/dev/null 2>&1; then
18874 : now check which varargs header should be included
18879 if `./varargs I_STDARG`; then
18881 elif `./varargs I_VARARGS`; then
18886 if `./varargs I_VARARGS`; then
18893 echo "I could not find the definition for va_dcl... You have problems..." >&4
18894 val="$undef"; set i_stdarg; eval $setvar
18895 val="$undef"; set i_varargs; eval $setvar
18900 case "$i_varhdr" in
18902 val="$define"; set i_stdarg; eval $setvar
18903 val="$undef"; set i_varargs; eval $setvar
18906 val="$undef"; set i_stdarg; eval $setvar
18907 val="$define"; set i_varargs; eval $setvar
18910 echo "We'll include <$i_varhdr> to get va_dcl definition." >&4;;
18914 : see if we need va_copy
18916 case "$i_stdarg" in
18919 #include <stdarg.h>
18921 #$i_stdlib I_STDLIB
18923 #include <stdlib.h>
18925 #include <signal.h>
18928 ivfprintf(FILE *f, const char *fmt, va_list *valp)
18930 return vfprintf(f, fmt, *valp);
18934 myvfprintf(FILE *f, const char *fmt, va_list val)
18936 return ivfprintf(f, fmt, &val);
18940 myprintf(char *fmt, ...)
18943 va_start(val, fmt);
18944 return myvfprintf(stdout, fmt, val);
18948 main(int ac, char **av)
18950 signal(SIGSEGV, exit);
18952 myprintf("%s%cs all right, then\n", "that", '\'');
18957 if eval $compile && $run ./try 2>&1 >/dev/null; then
18958 case "`$run ./try`" in
18959 "that's all right, then")
18965 yes) echo "It seems that you don't need va_copy()." >&4
18966 need_va_copy="$undef"
18968 *) echo "It seems that va_copy() or similar will be needed." >&4
18969 need_va_copy="$define"
18972 $rm -f try.* core core.* *.core *.core.*
18974 *) echo "You don't have <stdarg.h>, not checking for va_copy()." >&4
18978 : see what type is used for size_t
18979 rp="What is the type used for the length parameter for string functions?"
18980 set size_t sizetype 'unsigned int' stdio.h sys/types.h
18983 : check for type of arguments to gethostbyaddr.
18984 if test "X$netdb_host_type" = X -o "X$netdb_hlen_type" = X; then
18985 case "$d_gethbyaddr" in
18989 Checking to see what type of arguments are accepted by gethostbyaddr().
18991 hdrs="$define sys/types.h
18992 $d_socket sys/socket.h
18993 $i_niin netinet/in.h
18995 $i_unistd unistd.h"
18996 : The first arg can 'char *' or 'void *'
18997 : The second arg is some of integral type
18998 for xxx in in_addr_t 'const void *' 'const char *' 'void *' 'char *'; do
18999 for yyy in size_t long int; do
19000 case "$netdb_host_type" in
19001 '') try="extern struct hostent *gethostbyaddr($xxx, $yyy, int);"
19002 if ./protochk "$try" $hdrs; then
19003 echo "Your system accepts $xxx for the first arg."
19004 echo "...and $yyy for the second arg."
19005 netdb_host_type="$xxx"
19006 netdb_hlen_type="$yyy"
19012 : In case none of those worked, prompt the user.
19013 case "$netdb_host_type" in
19014 '') rp='What is the type for the 1st argument to gethostbyaddr?'
19017 netdb_host_type=$ans
19018 rp='What is the type for the 2nd argument to gethostbyaddr?'
19021 netdb_hlen_type=$ans
19025 *) : no gethostbyaddr, so pick harmless defaults
19026 netdb_host_type='char *'
19027 netdb_hlen_type="$sizetype"
19030 # Remove the "const" if needed. -- but then we'll have a
19032 # netdb_host_type=`echo "$netdb_host_type" | sed 's/^const //'`
19035 : check for type of argument to gethostbyname.
19036 if test "X$netdb_name_type" = X ; then
19037 case "$d_gethbyname" in
19041 Checking to see what type of argument is accepted by gethostbyname().
19043 hdrs="$define sys/types.h
19044 $d_socket sys/socket.h
19045 $i_niin netinet/in.h
19047 $i_unistd unistd.h"
19048 for xxx in "const char *" "char *"; do
19049 case "$netdb_name_type" in
19050 '') try="extern struct hostent *gethostbyname($xxx);"
19051 if ./protochk "$try" $hdrs; then
19052 echo "Your system accepts $xxx."
19053 netdb_name_type="$xxx"
19058 : In case none of those worked, prompt the user.
19059 case "$netdb_name_type" in
19060 '') rp='What is the type for the 1st argument to gethostbyname?'
19063 netdb_name_type=$ans
19067 *) : no gethostbyname, so pick harmless default
19068 netdb_name_type='char *'
19073 : check for type of 1st argument to getnetbyaddr.
19074 if test "X$netdb_net_type" = X ; then
19075 case "$d_getnbyaddr" in
19079 Checking to see what type of 1st argument is accepted by getnetbyaddr().
19081 hdrs="$define sys/types.h
19082 $d_socket sys/socket.h
19083 $i_niin netinet/in.h
19085 $i_unistd unistd.h"
19086 for xxx in in_addr_t "unsigned long" long "unsigned int" int; do
19087 case "$netdb_net_type" in
19088 '') try="extern struct netent *getnetbyaddr($xxx, int);"
19089 if ./protochk "$try" $hdrs; then
19090 echo "Your system accepts $xxx."
19091 netdb_net_type="$xxx"
19096 : In case none of those worked, prompt the user.
19097 case "$netdb_net_type" in
19098 '') rp='What is the type for the 1st argument to getnetbyaddr?'
19101 netdb_net_type=$ans
19105 *) : no getnetbyaddr, so pick harmless default
19106 netdb_net_type='long'
19110 : locate the preferred pager for this system
19117 [a-zA-Z]:/*) dflt=$pg;;
19121 [a-zA-Z]:/*) dflt=$more;;
19125 [a-zA-Z]:/*) dflt=$less;;
19128 '') dflt=/usr/ucb/more;;
19132 : Instruct ./getfile to trust the hinted or previous pager value,
19133 : even if it does not begin with a slash. For example, on os2,
19134 : pager might be cmd /c more. See comments in UU/getfile.
19139 rp='What pager is used on your system?'
19143 : see what type pids are declared as in the kernel
19144 rp="What is the type of process ids on this system?"
19145 set pid_t pidtype int stdio.h sys/types.h
19148 : see if ar generates random libraries by itself
19150 echo "Checking how to generate random libraries on your machine..." >&4
19151 echo 'int bar1() { return bar2(); }' > bar1.c
19152 echo 'int bar2() { return 2; }' > bar2.c
19154 #$i_stdlib I_STDLIB
19156 #include <stdlib.h>
19158 int main() { printf("%d\n", bar1()); exit(0); }
19160 $cc $ccflags -c bar1.c >/dev/null 2>&1
19161 $cc $ccflags -c bar2.c >/dev/null 2>&1
19162 $cc $ccflags -c foo.c >/dev/null 2>&1
19163 $ar rc bar$_a bar2$_o bar1$_o >/dev/null 2>&1
19164 if $cc -o foobar $ccflags $ldflags foo$_o bar$_a $libs > /dev/null 2>&1 &&
19165 $run ./foobar >/dev/null 2>&1; then
19166 echo "$ar appears to generate random libraries itself."
19168 if [ "X$ranlib" = "X" ]; then
19171 elif $ar ts bar$_a >/dev/null 2>&1 &&
19172 $cc -o foobar $ccflags $ldflags foo$_o bar$_a $libs > /dev/null 2>&1 &&
19173 $run ./foobar >/dev/null 2>&1; then
19174 echo "a table of contents needs to be added with '$ar ts'."
19181 ranlib=`./loc ranlib X /usr/bin /bin /usr/local/bin`
19182 $test -f $ranlib || ranlib=''
19185 if $test -n "$ranlib"; then
19186 echo "your system has '$ranlib'; we'll use that."
19189 echo "your system doesn't seem to support random libraries"
19190 echo "so we'll use lorder and tsort to order the libraries."
19197 : check for type of arguments to select.
19198 case "$selecttype" in
19199 '') case "$d_select" in
19203 Checking to see what type of arguments are accepted by select().
19205 hdrs="$define sys/types.h
19206 $i_systime sys/time.h
19207 $i_sysselct sys/select.h
19208 $d_socket sys/socket.h"
19209 : The first arg can be int, unsigned, or size_t
19210 : The last arg may or may not be 'const'
19212 : void pointer has been seen but using that
19213 : breaks the selectminbits test
19214 for xxx in 'fd_set *' 'int *'; do
19215 for nfd in 'int' 'size_t' 'unsigned long' 'unsigned' ; do
19216 for tmo in 'struct timeval *' 'const struct timeval *'; do
19218 '') try="extern select _(($nfd, $xxx, $xxx, $xxx, $tmo));"
19219 if ./protochk "$try" $hdrs; then
19220 echo "Your system accepts $xxx."
19229 '') rp='What is the type for the 2nd, 3rd, and 4th arguments to select?'
19230 case "$d_fd_set" in
19231 $define) dflt="fd_set *" ;;
19240 *) : no select, so pick a harmless default
19247 : check for the select 'width'
19248 case "$selectminbits" in
19249 '') safebits=`expr $ptrsize \* 8`
19250 case "$d_select" in
19254 Checking to see on how many bits at a time your select() operates...
19257 #include <sys/types.h>
19259 #$i_systime I_SYS_TIME
19260 #$i_systimek I_SYS_TIME_KERNEL
19265 # ifdef I_SYS_TIME_KERNEL
19268 # include <sys/time.h>
19269 # ifdef I_SYS_TIME_KERNEL
19273 #$i_sysselct I_SYS_SELECT
19274 #ifdef I_SYS_SELECT
19275 #include <sys/select.h>
19277 #$d_socket HAS_SOCKET
19279 # include <sys/socket.h> /* Might include <sys/bsdtypes.h> */
19282 #$i_stdlib I_STDLIB
19284 #include <stdlib.h>
19287 #define S sizeof(*(b))
19289 #define NBYTES (S * 8 > MINBITS ? S : MINBITS/8)
19290 #define NBITS (NBYTES * 8)
19292 char *s = malloc(NBYTES);
19301 fp = fopen("try.c", "r");
19307 b = ($selecttype)s;
19308 for (i = 0; i < NBITS; i++)
19312 select(fd + 1, b, 0, 0, &t);
19313 for (i = NBITS - 1; i > fd && FD_ISSET(i, b); i--);
19315 printf("%d\n", i + 1);
19320 if eval $compile_ok; then
19321 selectminbits=`$run ./try`
19322 case "$selectminbits" in
19324 Cannot figure out on how many bits at a time your select() operates.
19325 I'll play safe and guess it is $safebits bits.
19327 selectminbits=$safebits
19328 bits="$safebits bits"
19331 *) bits="$selectminbits bits" ;;
19333 echo "Your select() operates on $bits at a time." >&4
19335 rp='What is the minimum number of bits your select() operates on?'
19336 case "$byteorder" in
19337 12345678) dflt=64 ;;
19343 selectminbits="$val"
19347 *) : no select, so pick a harmless default
19348 selectminbits=$safebits
19354 : Trace out the files included by signal.h, then look for SIGxxx names.
19355 : Remove SIGARRAYSIZE used by HPUX.
19356 : Remove SIGSTKSIZE used by Linux.
19357 : Remove SIGSTKSZ used by Posix.
19358 : Remove SIGTYP void lines used by OS2.
19359 : Some cpps, like os390, dont give the file name anywhere
19360 if [ "X$fieldn" = X ]; then
19361 : Just make some guesses. We check them later.
19362 xxx='/usr/include/signal.h /usr/include/sys/signal.h'
19364 xxx=`echo '#include <signal.h>' |
19365 $cppstdin $cppminus $cppflags 2>/dev/null |
19366 $grep '^[ ]*#.*include' |
19367 $awk "{print \\$$fieldn}" | $sed 's!"!!g' | $sed 's!\\\\\\\\!/!g' | $sort | $uniq`
19369 : Check this list of files to be sure we have parsed the cpp output ok.
19370 : This will also avoid potentially non-existent files, such
19373 for xx in $xxx /dev/null ; do
19374 $test -f "$xx" && xxxfiles="$xxxfiles $xx"
19376 : If we have found no files, at least try signal.h
19377 case "$xxxfiles" in
19378 '') xxxfiles=`./findhdr signal.h` ;;
19381 $1 ~ /^#define$/ && $2 ~ /^SIG[A-Z0-9]*$/ && $2 !~ /SIGARRAYSIZE/ && $2 !~ /SIGSTKSIZE/ && $2 !~ /SIGSTKSZ/ && $3 !~ /void/ {
19382 print substr($2, 4, 20)
19384 $1 == "#" && $2 ~ /^define$/ && $3 ~ /^SIG[A-Z0-9]*$/ && $3 !~ /SIGARRAYSIZE/ && $4 !~ /void/ {
19385 print substr($3, 4, 20)
19387 : Append some common names just in case the awk scan failed.
19388 xxx="$xxx ABRT ALRM BUS CANCEL CHLD CLD CONT DIL EMT FPE"
19389 xxx="$xxx FREEZE HUP ILL INT IO IOT KILL LOST LWP PHONE"
19390 xxx="$xxx PIPE POLL PROF PWR QUIT RTMAX RTMIN SEGV STKFLT STOP"
19391 xxx="$xxx SYS TERM THAW TRAP TSTP TTIN TTOU URG USR1 USR2"
19392 xxx="$xxx USR3 USR4 VTALRM WAITING WINCH WIND WINDOW XCPU XFSZ"
19394 : generate a few handy files for later
19395 $cat > signal.c <<EOCP
19396 #include <sys/types.h>
19397 #include <signal.h>
19398 #$i_stdlib I_STDLIB
19400 #include <stdlib.h>
19405 /* Strange style to avoid deeply-nested #if/#else/#endif */
19408 # define NSIG (_NSIG)
19414 # define NSIG (SIGMAX+1)
19420 # define NSIG (SIG_MAX+1)
19426 # define NSIG (_SIG_MAX+1)
19432 # define NSIG (MAXSIG+1)
19438 # define NSIG (MAX_SIG+1)
19443 # ifdef SIGARRAYSIZE
19444 # define NSIG SIGARRAYSIZE /* Assume ary[SIGARRAYSIZE] */
19450 # define NSIG (_sys_nsig) /* Solaris 2.5 */
19454 /* Default to some arbitrary number that's big enough to get most
19455 of the common signals.
19461 printf("NSIG %d\n", NSIG);
19467 echo $xxx | $tr ' ' $trnl | $sort | $uniq | $awk '
19469 printf "#ifdef SIG"; printf $1; printf "\n"
19470 printf "printf(\""; printf $1; printf " %%d\\n\",SIG";
19471 printf $1; printf ");\n"
19475 printf "#endif /* JUST_NSIG */\n";
19476 printf "exit(0);\n}\n";
19479 $cat >signal.awk <<'EOP'
19480 BEGIN { ndups = 0 }
19481 $1 ~ /^NSIG$/ { nsig = $2 }
19482 ($1 !~ /^NSIG$/) && (NF == 2) && ($2 ~ /^[0-9][0-9]*$/) {
19483 if ($2 > maxsig) { maxsig = $2 }
19484 if (sig_name[$2]) {
19485 dup_name[ndups] = $1
19486 dup_num[ndups] = $2
19498 printf("NSIG %d\n", nsig);
19499 for (n = 1; n < nsig; n++) {
19501 printf("%s %d\n", sig_name[n], sig_num[n])
19504 printf("NUM%d %d\n", n, n)
19507 for (n = 0; n < ndups; n++) {
19508 printf("%s %d\n", dup_name[n], dup_num[n])
19512 $cat >signal_cmd <<EOS
19514 if $test -s signal.lst; then
19515 echo "Using your existing signal.lst file"
19520 $cat >>signal_cmd <<'EOS'
19523 if eval $compile_ok; then
19524 $run ./signal$_exe | ($sort -n -k 2 2>/dev/null || $sort -n +1) | $uniq | $awk -f signal.awk >signal.lst
19526 echo "(I can't seem be able to compile the whole test program)" >&4
19527 echo "(I'll try it in little pieces.)" >&4
19528 set signal -DJUST_NSIG
19529 if eval $compile_ok; then
19530 $run ./signal$_exe > signal.nsg
19533 echo "I can't seem to figure out how many signals you have." >&4
19534 echo "Guessing 50." >&4
19535 echo 'NSIG 50' > signal.nsg
19537 : Now look at all the signal names, one at a time.
19538 for xx in `echo $xxx | $tr ' ' $trnl | $sort | $uniq`; do
19539 $cat > signal.c <<EOCP
19540 #include <sys/types.h>
19541 #include <signal.h>
19544 printf("$xx %d\n", SIG${xx});
19549 if eval $compile; then
19550 echo "SIG${xx} found."
19551 $run ./signal$_exe >> signal.ls1
19553 echo "SIG${xx} NOT found."
19556 if $test -s signal.ls1; then
19557 $cat signal.nsg signal.ls1 |
19558 $sort -n | $uniq | $awk -f signal.awk >signal.lst
19562 if $test -s signal.lst; then
19565 echo "(AAK! I can't compile the test programs -- Guessing)" >&4
19566 echo 'kill -l' >signal
19567 set X `csh -f <signal`
19571 0) set HUP INT QUIT ILL TRAP ABRT EMT FPE KILL BUS SEGV SYS PIPE ALRM TERM;;
19573 echo $@ | $tr ' ' $trnl | \
19574 $awk '{ printf "%s %d\n", $1, ++s; }
19575 END { printf "NSIG %d\n", ++s }' >signal.lst
19577 $rm -f signal.c signal$_exe signal$_o signal.nsg signal.ls1
19579 chmod a+x signal_cmd
19580 $eunicefix signal_cmd
19582 : generate list of signal names
19584 case "$sig_name_init" in
19586 *) case "$sig_num_init" in
19587 ''|*,*) doinit=yes ;;
19592 echo "Generating a list of signal names and numbers..." >&4
19594 sig_count=`$awk '/^NSIG/ { printf "%d", $2 }' signal.lst`
19595 sig_name=`$awk 'BEGIN { printf "ZERO " }
19596 !/^NSIG/ { printf "%s ", $1 }' signal.lst`
19597 sig_num=`$awk 'BEGIN { printf "0 " }
19598 !/^NSIG/ { printf "%d ", $2 }' signal.lst`
19599 sig_name_init=`$awk 'BEGIN { printf "\"ZERO\", " }
19600 !/^NSIG/ { printf "\"%s\", ", $1 }
19601 END { printf "0\n" }' signal.lst`
19602 sig_num_init=`$awk 'BEGIN { printf "0, " }
19603 !/^NSIG/ { printf "%d, ", $2}
19604 END { printf "0\n"}' signal.lst`
19607 echo "The following $sig_count signals are available:"
19609 echo $sig_name | $awk \
19610 'BEGIN { linelen = 0 }
19612 for (i = 1; i <= NF; i++) {
19613 name = "SIG" $i " "
19614 linelen = linelen + length(name)
19615 if (linelen > 70) {
19617 linelen = length(name)
19623 sig_size=`echo $sig_name | awk '{print NF}'`
19624 $rm -f signal signal.c signal.awk signal.lst signal_cmd
19627 case "$sizetype" in
19628 *_t) zzz="$sizetype" ;;
19629 *) zzz="filesize" ;;
19631 echo "Checking the size of $zzz..." >&4
19633 #include <sys/types.h>
19635 #$i_stdlib I_STDLIB
19637 #include <stdlib.h>
19640 printf("%d\n", (int)sizeof($sizetype));
19645 if eval $compile_ok; then
19649 echo "(I can't execute the test program--guessing $sizesize.)" >&4
19652 echo "Your $zzz size is $sizesize bytes."
19657 echo "(I can't compile the test program--guessing $sizesize.)" >&4
19661 : check for socklen_t
19663 echo "Checking to see if you have socklen_t..." >&4
19665 #include <sys/types.h>
19666 #$d_socket HAS_SOCKET
19668 #include <sys/socket.h>
19670 int main() { socklen_t x = 16; }
19673 if eval $compile; then
19675 echo "You have socklen_t."
19678 echo "You do not have socklen_t."
19679 case "$sizetype" in
19680 size_t) echo "(You do have size_t, that might work. Some people are happy with just an int.)" ;;
19687 : see if this is a socks.h system
19688 set socks.h i_socks
19691 : check for type of the size argument to socket calls
19692 case "$d_socket" in
19696 Checking to see what type is the last argument of accept().
19699 case "$d_socklen_t" in
19700 "$define") yyy="$yyy socklen_t"
19702 yyy="$yyy $sizetype int long unsigned"
19703 for xxx in $yyy; do
19704 case "$socksizetype" in
19705 '') try="extern int accept(int, struct sockaddr *, $xxx *);"
19706 case "$usesocks" in
19708 if ./protochk "$try" $i_systypes sys/types.h $d_socket sys/socket.h literal '#define INCLUDE_PROTOTYPES' $i_socks socks.h.; then
19709 echo "Your system accepts '$xxx *' for the last argument of accept()."
19710 socksizetype="$xxx"
19713 *) if ./protochk "$try" $i_systypes sys/types.h $d_socket sys/socket.h; then
19714 echo "Your system accepts '$xxx *' for the last argument of accept()."
19715 socksizetype="$xxx"
19722 : In case none of those worked, prompt the user.
19723 case "$socksizetype" in
19724 '') rp='What is the type for socket address structure sizes?'
19731 *) : no sockets, so pick relatively harmless default
19736 : see what type is used for signed size_t
19737 set ssize_t ssizetype int stdio.h sys/types.h
19742 #$i_stdlib I_STDLIB
19744 #include <stdlib.h>
19746 #include <sys/types.h>
19747 #define Size_t $sizetype
19748 #define SSize_t $dflt
19751 if (sizeof(Size_t) == sizeof(SSize_t))
19753 else if (sizeof(Size_t) == sizeof(int))
19762 if eval $compile_ok && $run ./try > /dev/null; then
19763 ssizetype=`$run ./try`
19764 echo "I'll be using $ssizetype for functions returning a byte count." >&4
19767 Help! I can't compile and run the ssize_t test program: please enlighten me!
19768 (This is probably a misconfiguration in your system or libraries, and
19769 you really ought to fix it. Still, I'll try anyway.)
19771 I need a type that is the same size as $sizetype, but is guaranteed to
19772 be signed. Common values are ssize_t, int and long.
19775 rp="What signed type is the same size as $sizetype?"
19781 : see what type of char stdio uses.
19783 echo '#include <stdio.h>' | $cppstdin $cppminus > stdioh
19784 if $contains 'unsigned.*char.*_ptr;' stdioh >/dev/null 2>&1 ; then
19785 echo "Your stdio uses unsigned chars." >&4
19786 stdchar="unsigned char"
19788 echo "Your stdio uses signed chars." >&4
19795 : see what type uids are declared as in the kernel
19797 echo "Looking for the type for user ids returned by getuid()."
19798 set uid_t uidtype xxx stdio.h sys/types.h
19802 xxx=`./findhdr sys/user.h`
19803 set `grep '_ruid;' "$xxx" 2>/dev/null` unsigned short
19805 unsigned) dflt="$1 $2" ;;
19809 *) dflt="$uidtype";;
19812 uid_t) echo "uid_t found." ;;
19813 *) rp="What is the type for user ids returned by getuid()?"
19821 *_t) zzz="$uidtype" ;;
19824 echo "Checking the size of $zzz..." >&4
19826 #include <sys/types.h>
19828 #$i_stdlib I_STDLIB
19830 #include <stdlib.h>
19833 printf("%d\n", (int)sizeof($uidtype));
19838 if eval $compile_ok; then
19842 echo "(I can't execute the test program--guessing $uidsize.)" >&4
19845 echo "Your $zzz is $uidsize bytes long."
19850 echo "(I can't compile the test program--guessing $uidsize.)" >&4
19855 *_t) zzz="$uidtype" ;;
19858 echo "Checking the sign of $zzz..." >&4
19860 #include <sys/types.h>
19871 if eval $compile; then
19875 echo "(I can't execute the test program--guessing unsigned.)" >&4
19879 1) echo "Your $zzz is unsigned." ;;
19880 -1) echo "Your $zzz is signed." ;;
19886 echo "(I can't compile the test program--guessing unsigned.)" >&4
19892 $echo "Checking the format string to be used for uids..." >&4
19895 -1) if $test X"$uidsize" = X"$ivsize"; then
19896 uidformat="$ivdformat"
19898 if $test X"$uidsize" = X"$longsize"; then
19901 if $test X"$uidsize" = X"$intsize"; then
19904 if $test X"$uidsize" = X"$shortsize"; then
19911 *) if $test X"$uidsize" = X"$uvsize"; then
19912 uidformat="$uvuformat"
19914 if $test X"$uidsize" = X"$longsize"; then
19917 if $test X"$uidsize" = X"$intsize"; then
19920 if $test X"$uidsize" = X"$shortsize"; then
19930 case "$usesitecustomize" in
19931 $define|true|[Yy]*)
19932 usesitecustomize="$define"
19935 usesitecustomize="$undef"
19939 : determine compiler compiler
19948 if $test -f "$byacc$_exe"; then
19950 comp="byacc or $comp"
19952 if $test -f "$bison$_exe"; then
19953 comp="$comp or bison -y"
19955 rp="Which compiler compiler ($comp) shall I use?"
19964 echo "(Adding -y option to bison to get yacc-compatible behaviour.)"
19970 : see if this is a fp.h system
19974 : see if this is a fp_class.h system
19975 set fp_class.h i_fp_class
19978 : see if this is a ieeefp.h system
19979 case "$i_ieeefp" in
19980 '' ) set ieeefp.h i_ieeefp
19985 : see if this is a libutil.h system
19986 set libutil.h i_libutil
19989 : see if mach cthreads are available
19990 if test "X$usethreads" = "X$define"; then
19991 set mach/cthreads.h i_machcthr
19994 i_machcthr="$undef"
19999 : see if this is a mntent.h system
20000 set mntent.h i_mntent
20003 : see if ndbm.h is available
20009 # Some Linux distributions such as RedHat 7.1 put the
20010 # ndbm.h header in /usr/include/gdbm/ndbm.h.
20011 if $test -f /usr/include/gdbm/ndbm.h; then
20012 echo '<gdbm/ndbm.h> found.'
20013 ccflags="$ccflags -I/usr/include/gdbm"
20014 cppflags="$cppflags -I/usr/include/gdbm"
20022 : see if dbm_open exists
20023 set dbm_open d_dbm_open
20025 case "$d_dbm_open" in
20028 echo "We won't be including <ndbm.h>"
20037 : see if net/errno.h is available
20039 set net/errno.h val
20042 : Unfortunately, it causes problems on some systems. Arrgh.
20045 cat > try.c <<'EOM'
20048 #include <net/errno.h>
20054 if $cc $ccflags -c try.c >/dev/null 2>&1; then
20055 echo "We'll be including <net/errno.h>." >&4
20057 echo "We won't be including <net/errno.h>." >&4
20066 : see if netinet/tcp.h is available
20067 set netinet/tcp.h i_netinettcp
20070 : see if this is a poll.h system
20074 : see if this is a prot.h system
20079 $echo "Guessing which symbols your C compiler and preprocessor define..." >&4
20080 $cat <<'EOSH' > Cppsym.know
20081 a29k ABI64 aegis AES_SOURCE AIX AIX32 AIX370
20082 AIX41 AIX42 AIX43 AIX_SOURCE aixpc ALL_SOURCE
20083 alliant alpha am29000 AM29000 AMD64 amd64 amiga AMIGAOS AMIX
20084 ansi ANSI_C_SOURCE apollo ardent ARM32 atarist att386 att3b
20085 BeOS BIG_ENDIAN BIT_MSF bsd BSD bsd43 bsd4_2 bsd4_3 BSD4_3 bsd4_4
20086 BSD_4_3 BSD_4_4 BSD_NET2 BSD_TIME BSD_TYPES BSDCOMPAT bsdi
20087 bull c cadmus clipper CMU COFF COMPILER_VERSION
20088 concurrent convex cpu cray CRAY CRAYMPP ctix CX_UX
20089 CYGWIN DECC DGUX DGUX_SOURCE DJGPP dmert DOLPHIN DPX2 DSO
20090 Dynix DynixPTX ELF encore EPI EXTENSIONS FAVOR_BSD
20091 FILE_OFFSET_BITS FreeBSD GCC_NEW_VARARGS gcos gcx gimpel
20093 GNU_SOURCE GNUC GNUC_MINOR GNU_LIBRARY GO32 gould GOULD_PN
20094 H3050R H3050RX hbullx20 hcx host_mips
20095 hp200 hp300 hp700 HP700 hp800 hp9000
20096 hp9000s200 hp9000s300 hp9000s400 hp9000s500
20097 hp9000s700 hp9000s800 hp9k8 hp_osf hppa hpux HPUX_SOURCE
20098 i186 i286 i386 i486 i586 i686 i8086 i80960 i860 I960
20099 IA64 iAPX286 ibm ibm032 ibmesa IBMR2 ibmrt ILP32 ILP64
20100 INLINE_INTRINSICS INTRINSICS INT64 interdata is68k ksr1
20101 LANGUAGE_C LARGE_FILE_API LARGEFILE64_SOURCE
20102 LARGEFILE_SOURCE LFS64_LARGEFILE LFS_LARGEFILE
20103 Linux LITTLE_ENDIAN LONG64 LONG_DOUBLE LONG_LONG
20104 LONGDOUBLE LONGLONG LP64 luna luna88k Lynx
20105 M68000 m68k m88100 m88k M88KBCS_TARGET M_COFF
20106 M_I186 M_I286 M_I386 M_I8086 M_I86 M_I86SM M_SYS3
20107 M_SYS5 M_SYSIII M_SYSV M_UNIX M_XENIX MACH machine MachTen
20108 MATH_HAS_NO_SIDE_EFFECTS
20109 mc300 mc500 mc68000 mc68010 mc68020 mc68030 mc68040
20110 mc68060 mc68k mc68k32 mc700 mc88000 mc88100 merlin
20111 mert MiNT mips MIPS_FPSET MIPS_ISA MIPS_SIM MIPS_SZINT
20112 MIPS_SZLONG MIPS_SZPTR MIPSEB MIPSEL MODERN_C motorola
20113 mpeix MSDOS MTXINU MULTIMAX mvs MVS n16 ncl_el ncl_mr
20114 NetBSD news1500 news1700 news1800 news1900 news3700
20115 news700 news800 news900 NeXT NLS nonstopux ns16000 ns32000
20116 ns32016 ns32332 ns32k nsc32000
20117 OCS88 OEMVS OpenBSD os OS2 OS390 osf OSF1 OSF_SOURCE
20118 pa_risc PA_RISC1_1 PA_RISC2_0 PARAGON parisc
20119 pc532 pdp11 PGC PIC plexus PORTAR posix
20120 POSIX1B_SOURCE POSIX2_SOURCE POSIX4_SOURCE
20121 POSIX_C_SOURCE POSIX_SOURCE POWER
20122 PROTOTYPES PWB pyr QNX R3000 REENTRANT RES Rhapsody RISC6000
20123 riscix riscos RT S390 SA110 scs SCO sequent sgi SGI_SOURCE SH3 sinix
20124 SIZE_INT SIZE_LONG SIZE_PTR SOCKET_SOURCE SOCKETS_SOURCE
20125 sony sony_news sonyrisc sparc sparclite spectrum
20126 stardent stdc STDC_EXT stratos sun sun3 sun386
20127 Sun386i svr3 svr4 SVR4_2 SVR4_SOURCE svr5
20128 SX system SYSTYPE_BSD SYSTYPE_BSD43 SYSTYPE_BSD44
20129 SYSTYPE_SVR4 SYSTYPE_SVR5 SYSTYPE_SYSV SYSV SYSV3 SYSV4 SYSV5
20130 sysV68 sysV88 Tek4132 Tek4300 titan
20131 TM3200 TM5400 TM5600
20132 tower tower32 tower32_200 tower32_600 tower32_700
20133 tower32_800 tower32_850 tss
20134 u370 u3b u3b2 u3b20 u3b200 u3b20d u3b5
20135 ultrix UMAXV UnicomPBB UnicomPBD UNICOS UNICOSMK
20136 unix UNIX95 UNIX99 unixpc unos
20137 USE_BSD USE_FILE_OFFSET64 USE_GNU USE_ISOC9X USE_LARGEFILE USE_LARGEFILE64
20138 USE_MISC USE_POSIX USE_POSIX199309 USE_POSIX199506 USE_POSIX2
20139 USE_REENTRANT USE_SVID USE_UNIX98 USE_XOPEN USE_XOPEN_EXTENDED
20141 Utek UTek UTS UWIN uxpm uxps vax venix VMESA vms x86_64 xenix Xenix286
20142 XOPEN_SOURCE XOPEN_SOURCE_EXTENDED XPG2 XPG2_EXTENDED
20143 XPG3 XPG3_EXTENDED XPG4 XPG4_EXTENDED
20146 # Maybe put other stuff here too.
20147 cat <<EOSH >>Cppsym.know
20150 ./tr '[a-z]' '[A-Z]' < Cppsym.know > Cppsym.a
20151 ./tr '[A-Z]' '[a-z]' < Cppsym.know > Cppsym.b
20152 $cat Cppsym.know > Cppsym.c
20153 $cat Cppsym.a Cppsym.b Cppsym.c | $tr ' ' $trnl | $sort | $uniq > Cppsym.know
20154 $rm -f Cppsym.a Cppsym.b Cppsym.c
20155 cat <<EOSH > Cppsym
20157 if $test \$# -gt 0; then
20158 echo \$* | $tr " " "$trnl" | ./Cppsym.try > Cppsym.got
20159 if $test -s Cppsym.got; then
20166 $tr " " "$trnl" | ./Cppsym.try
20172 cat <<EOSH > Cppsym.try
20174 cat <<'EOCP' > try.c
20177 #define STRINGIFY(a) "a"
20179 #if cpp_stuff == 42
20180 #define StGiFy(a) #a
20181 #define STRINGIFY(a) StGiFy(a)
20183 #if $cpp_stuff != 1 && $cpp_stuff != 42
20184 # include "Bletch: How does this C preprocessor stringify macros?"
20190 cat <<'EOSH' >> Cppsym.try
20192 printf "#ifdef %s\nprintf(\"%s=%%s\\n\", STRINGIFY(%s));\n#endif\n", $1, $1, $1
20193 printf "#ifdef _%s\nprintf(\"_%s=%%s\\n\", STRINGIFY(_%s));\n#endif\n", $1, $1, $1
20194 printf "#ifdef __%s\nprintf(\"__%s=%%s\\n\", STRINGIFY(__%s));\n#endif\n", $1, $1, $1
20195 printf "#ifdef __%s__\nprintf(\"__%s__=%%s\\n\", STRINGIFY(__%s__));\n#endif\n", $1, $1, $1
20197 echo 'return 0;}' >> try.c
20199 cat <<EOSH >> Cppsym.try
20201 case "$osname-$gccversion" in
20202 irix-) ccflags="\$ccflags -woff 1178" ;;
20203 os2-*) ccflags="\$ccflags -Zlinker /PM:VIO" ;;
20205 $cc -o try -Dcpp_stuff=$cpp_stuff $optimize \$ccflags $ldflags try.c $libs && $run ./try | $sed 's/ /\\\\ /g'
20207 chmod +x Cppsym.try
20208 $eunicefix Cppsym.try
20209 ./Cppsym < Cppsym.know > Cppsym.true
20210 : now check the C compiler for additional symbols
20211 postprocess_cc_v=''
20213 aix) postprocess_cc_v="|$tr , ' '" ;;
20220 for i in \`$cc -v -c tmp.c 2>&1 $postprocess_cc_v\`
20223 -D*) echo "\$i" | $sed 's/^-D//';;
20224 -A*) $test "$gccversion" && echo "\$i" | $sed 's/^-A//' | $sed 's/\(.*\)(\(.*\))/\1=\2/';;
20229 postprocess_cc_v=''
20232 ./ccsym > ccsym1.raw
20233 if $test -s ccsym1.raw; then
20234 $sort ccsym1.raw | $uniq >ccsym.raw
20236 mv ccsym1.raw ccsym.raw
20239 $awk '/\=/ { print $0; next }
20240 { print $0"=1" }' ccsym.raw >ccsym.list
20241 $comm -13 Cppsym.true ccsym.list >ccsym.own
20242 $comm -12 Cppsym.true ccsym.list >ccsym.com
20243 $comm -23 Cppsym.true ccsym.list >ccsym.cpp
20245 if $test -z ccsym.raw; then
20246 echo "Your C compiler doesn't seem to define any symbols!" >&4
20248 echo "However, your C preprocessor defines the following symbols:"
20251 cppsymbols=`$cat Cppsym.true`
20252 cppsymbols=`echo $cppsymbols`
20253 cppccsymbols="$cppsymbols"
20255 if $test -s ccsym.com; then
20256 echo "Your C compiler and pre-processor define these symbols:"
20257 $sed -e 's/\(..*\)=.*/\1/' ccsym.com
20260 cppccsymbols=`$cat ccsym.com`
20261 cppccsymbols=`echo $cppccsymbols`
20262 $test "$silent" || sleep 1
20264 if $test -s ccsym.cpp; then
20265 $test "$also" && echo " "
20266 echo "Your C pre-processor ${also}defines the following symbols:"
20267 $sed -e 's/\(..*\)=.*/\1/' ccsym.cpp
20269 cppsymbols=`$cat ccsym.cpp`
20270 cppsymbols=`echo $cppsymbols`
20271 $test "$silent" || sleep 1
20273 if $test -s ccsym.own; then
20274 $test "$also" && echo " "
20275 echo "Your C compiler ${also}defines the following cpp symbols:"
20276 $sed -e 's/\(..*\)=1/\1/' ccsym.own
20277 $sed -e 's/\(..*\)=.*/\1/' ccsym.own | $uniq >>Cppsym.true
20278 ccsymbols=`$cat ccsym.own`
20279 ccsymbols=`echo $ccsymbols`
20280 $test "$silent" || sleep 1
20284 : see if this is a termio system
20288 if $test `./findhdr termios.h`; then
20289 set tcsetattr i_termios
20295 "$define") echo "You have POSIX termios.h... good!" >&4;;
20296 *) if ./Cppsym pyr; then
20297 case "`/bin/universe`" in
20298 ucb) if $test `./findhdr sgtty.h`; then
20300 echo "<sgtty.h> found." >&4
20302 echo "System is pyramid with BSD universe."
20303 echo "<sgtty.h> not found--you could have problems." >&4
20305 *) if $test `./findhdr termio.h`; then
20307 echo "<termio.h> found." >&4
20309 echo "System is pyramid with USG universe."
20310 echo "<termio.h> not found--you could have problems." >&4
20314 if $test `./findhdr termio.h`; then
20315 echo "<termio.h> found." >&4
20317 elif $test `./findhdr sgtty.h`; then
20318 echo "<sgtty.h> found." >&4
20321 echo "Neither <termio.h> nor <sgtty.h> found--you could have problems." >&4
20324 if $test `./findhdr sgtty.h`; then
20325 echo "<sgtty.h> found." >&4
20327 elif $test `./findhdr termio.h`; then
20328 echo "<termio.h> found." >&4
20331 echo "Neither <sgtty.h> nor <termio.h> found--you could have problems." >&4
20335 set i_termio; eval $setvar
20336 val=$val2; set i_sgtty; eval $setvar
20337 val=$val3; set i_termios; eval $setvar
20339 : see if stddef is available
20340 set stddef.h i_stddef
20343 : see if this is a sunmath.h system
20344 set sunmath.h i_sunmath
20347 : see if sys/access.h is available
20348 set sys/access.h i_sysaccess
20351 : see if ioctl defs are in sgtty, termio, sys/filio or sys/ioctl
20352 set sys/filio.h i_sysfilio
20355 if $test `./findhdr sys/ioctl.h`; then
20357 echo '<sys/ioctl.h> found.' >&4
20360 if $test $i_sysfilio = "$define"; then
20361 echo '<sys/ioctl.h> NOT found.' >&4
20363 $test $i_sgtty = "$define" && xxx="sgtty.h"
20364 $test $i_termio = "$define" && xxx="termio.h"
20365 $test $i_termios = "$define" && xxx="termios.h"
20366 echo "No <sys/ioctl.h> found, assuming ioctl args are defined in <$xxx>." >&4
20372 : see if socket ioctl defs are in sys/sockio.h
20374 xxx=`./findhdr sys/sockio.h`
20375 if $test "$xxx"; then
20376 if $contains SIOCATMARK $xxx >/dev/null 2>&1; then
20378 echo "You have socket ioctls defined in <sys/sockio.h>." >&4
20381 echo "No socket ioctls found in <sys/sockio.h>." >&4
20386 <sys/sockio.h> not found, assuming socket ioctls are in <sys/ioctl.h>.
20393 : see if this is a syslog.h system
20394 set syslog.h i_syslog
20398 : see if this is a sys/mode.h system
20399 set sys/mode.h i_sysmode
20402 : see if sys/resource.h has to be included
20403 set sys/resource.h i_sysresrc
20406 : see if sys/security.h is available
20407 set sys/security.h i_syssecrt
20410 : see if this is a sys/statvfs.h system
20411 set sys/statvfs.h i_sysstatvfs
20414 : see if this is a sys/un.h system
20415 set sys/un.h i_sysun
20419 : see if this is a sys/utsname.h system
20420 set sys/utsname.h i_sysutsname
20423 : see if this is a syswait system
20424 set sys/wait.h i_syswait
20427 : see if this is a ustat.h system
20428 set ustat.h i_ustat
20431 : see if this is an utime system
20432 set utime.h i_utime
20435 : see if this is a values.h system
20436 set values.h i_values
20439 : see if this is a vfork system
20442 set vfork.h i_vfork
20450 : see if gdbm.h is available
20455 : see if gdbm_open exists
20456 set gdbm_open d_gdbm_open
20458 case "$d_gdbm_open" in
20461 echo "We won't be including <gdbm.h>"
20471 echo "Looking for extensions..." >&4
20472 : If we are using the old config.sh, known_extensions may contain
20473 : old or inaccurate or duplicate values.
20474 known_extensions=''
20475 nonxs_extensions=''
20476 : We do not use find because it might not be available.
20477 : We do not just use MANIFEST because the user may have dropped
20478 : some additional extensions into the source tree and expect them
20481 : Function to recursively find available extensions, ignoring DynaLoader
20482 : NOTE: recursion limit of 10 to prevent runaway in case of symlink madness
20486 DynaLoader|dynaload) ;;
20488 if $test -f $xxx/$xxx.xs; then
20489 known_extensions="$known_extensions $1$xxx";
20490 elif $test -f $xxx/Makefile.PL; then
20491 nonxs_extensions="$nonxs_extensions $1$xxx";
20493 if $test -d $xxx -a $# -lt 10; then
20496 eval $find_extensions;
20508 eval $find_extensions
20509 # Special case: Add in threads/shared since it is not picked up by the
20510 # recursive find above (and adding in general recursive finding breaks
20511 # SDBM_File/sdbm). A.D. 10/25/2001.
20512 known_extensions="$known_extensions threads/shared"
20513 set X $nonxs_extensions
20515 nonxs_extensions="$*"
20516 set X $known_extensions
20518 known_extensions="$*"
20521 : Now see which are supported on this system.
20523 for xxx in $known_extensions ; do
20527 $define) avail_ext="$avail_ext $xxx" ;;
20530 GDBM_File|gdbm_fil)
20532 $define) avail_ext="$avail_ext $xxx" ;;
20535 I18N/Langinfo|i18n_lan)
20536 case "$i_langinfo$d_nl_langinfo" in
20537 $define$define) avail_ext="$avail_ext $xxx" ;;
20540 NDBM_File|ndbm_fil)
20543 case "$osname-$use64bitint" in
20546 *-lndbm*) avail_ext="$avail_ext $xxx" ;;
20549 *) avail_ext="$avail_ext $xxx" ;;
20554 ODBM_File|odbm_fil)
20555 case "${i_dbm}${i_rpcsvcdbm}" in
20557 case "$osname-$use64bitint" in
20560 *-ldbm*) avail_ext="$avail_ext $xxx" ;;
20563 *) avail_ext="$avail_ext $xxx" ;;
20569 case "$useposix" in
20570 true|define|y) avail_ext="$avail_ext $xxx" ;;
20574 case "$useopcode" in
20575 true|define|y) avail_ext="$avail_ext $xxx" ;;
20579 case "$d_socket" in
20582 beos) ;; # not unless BONE
20583 *) avail_ext="$avail_ext $xxx" ;;
20588 Sys/Syslog|sys/syslog)
20589 : XXX syslog requires socket
20590 case "$d_socket" in
20591 true|$define|y) avail_ext="$avail_ext $xxx" ;;
20595 case "$usethreads" in
20597 case "$useithreads" in
20598 $undef|false|[nN]*) avail_ext="$avail_ext $xxx" ;;
20602 XS/APItest|xs/apitest)
20603 # This is just for testing. Skip it unless we have dynamic loading.
20606 $define) avail_ext="$avail_ext $xxx" ;;
20609 XS/Typemap|xs/typemap)
20610 # This is just for testing. Skip it unless we have dynamic loading.
20612 $define) avail_ext="$avail_ext $xxx" ;;
20615 threads|threads/shared)
20616 # threads and threads::shared are special cases.
20617 # To stop people from asking "Perl 5.8.0 was supposed
20618 # to have this new fancy threads implementation but my
20619 # perl doesn't have it" and from people trying to
20620 # (re)install the threads module using CPAN.pm and
20621 # CPAN.pm then offering to reinstall Perl 5.8.0,
20622 # the threads.pm and threads/shared.pm will always be
20623 # there, croaking informatively ("you need to rebuild
20624 # all of Perl with threads, sorry") when threads haven't
20625 # been compiled in.
20627 avail_ext="$avail_ext $xxx"
20630 : XXX Do we need a useipcsysv variable here
20631 case "${d_msg}${d_sem}${d_shm}" in
20632 *"${define}"*) avail_ext="$avail_ext $xxx" ;;
20635 *) avail_ext="$avail_ext $xxx"
20644 case "$onlyextensions" in
20646 *) keepextensions=''
20647 echo "You have requested that only certains extensions be included..." >&4
20648 for i in $onlyextensions; do
20649 case " $avail_ext " in
20651 echo "Keeping extension $i."
20652 keepextensions="$keepextensions $i"
20654 *) echo "Ignoring extension $i." ;;
20657 avail_ext="$keepextensions"
20661 case "$noextensions" in
20663 *) keepextensions=''
20664 echo "You have requested that certain extensions be ignored..." >&4
20665 for i in $avail_ext; do
20666 case " $noextensions " in
20667 *" $i "*) echo "Ignoring extension $i." ;;
20668 *) echo "Keeping extension $i.";
20669 keepextensions="$keepextensions $i"
20673 avail_ext="$keepextensions"
20677 : Now see which nonxs extensions are supported on this system.
20678 : For now assume all are.
20680 for xxx in $nonxs_extensions ; do
20682 *) nonxs_ext="$nonxs_ext $xxx"
20694 A number of extensions are supplied with $package. You may choose to
20695 compile these extensions for dynamic loading (the default), compile
20696 them into the $package executable (static loading), or not include
20697 them at all. Answer "none" to include no extensions.
20698 Note that DynaLoader is always built and need not be mentioned here.
20701 case "$dynamic_ext" in
20703 : Exclude those listed in static_ext
20705 for xxx in $avail_ext; do
20706 case " $static_ext " in
20708 *) dflt="$dflt $xxx" ;;
20715 *) dflt="$dynamic_ext"
20716 # Perhaps we are reusing an old out-of-date config.sh.
20719 if test X"$dynamic_ext" != X"$avail_ext"; then
20721 NOTICE: Your previous config.sh list may be incorrect.
20722 The extensions now available to you are
20724 but the default list from your previous config.sh is
20736 rp="What extensions do you wish to load dynamically?"
20739 none) dynamic_ext=' ' ;;
20740 *) dynamic_ext="$ans" ;;
20743 case "$static_ext" in
20745 : Exclude those already listed in dynamic linking
20747 for xxx in $avail_ext; do
20748 case " $dynamic_ext " in
20750 *) dflt="$dflt $xxx" ;;
20757 *) dflt="$static_ext"
20764 rp="What extensions do you wish to load statically?"
20767 none) static_ext=' ' ;;
20768 *) static_ext="$ans" ;;
20773 A number of extensions are supplied with $package. Answer "none"
20774 to include no extensions.
20775 Note that DynaLoader is always built and need not be mentioned here.
20778 case "$static_ext" in
20779 '') dflt="$avail_ext" ;;
20780 *) dflt="$static_ext"
20781 # Perhaps we are reusing an old out-of-date config.sh.
20784 if test X"$static_ext" != X"$avail_ext"; then
20786 NOTICE: Your previous config.sh list may be incorrect.
20787 The extensions now available to you are
20789 but the default list from your previous config.sh is
20798 : Exclude those that are not xs extensions
20802 rp="What extensions do you wish to include?"
20805 none) static_ext=' ' ;;
20806 *) static_ext="$ans" ;;
20811 # Encode is a special case. If we are building Encode as a static
20812 # extension, we need to explicitly list its subextensions as well.
20813 # For other nested extensions, this is handled automatically by
20814 # the appropriate Makefile.PL.
20815 case " $static_ext " in
20816 *" Encode "*) # Add the subextensions of Encode
20818 for xxx in `ls Encode/*/Makefile.PL|awk -F/ '{print $2}'`; do
20819 static_ext="$static_ext Encode/$xxx"
20825 set X $dynamic_ext $static_ext $nonxs_ext
20829 # Sanity check: We require an extension suitable for use with
20830 # AnyDBM_File, as well as Fcntl and IO. (Failure to have these
20831 # should show up as failures in the test suite, but it's helpful to
20832 # catch them now.) The 'extensions' list is normally sorted
20833 # alphabetically, so we need to accept either
20834 # DB_File ... Fcntl ... IO ....
20835 # or something like
20836 # Fcntl ... NDBM_File ... IO ....
20837 case " $extensions" in
20838 *"_File "*" Fcntl "*" IO "*) ;; # DB_File
20839 *" Fcntl "*"_File "*" IO "*) ;; # GDBM_File
20840 *" Fcntl "*" IO "*"_File "*) ;; # NDBM_File
20841 *) echo "WARNING: Extensions DB_File or *DBM_File, Fcntl, and IO not configured." >&4
20842 echo "WARNING: The Perl you are building will be quite crippled." >& 4
20846 : Remove libraries needed only for extensions
20847 : The appropriate ext/Foo/Makefile.PL will add them back in, if necessary.
20848 : The exception is SunOS 4.x, which needs them.
20849 case "${osname}X${osvers}" in
20853 *) case "$usedl" in
20854 $define|true|[yY]*)
20855 set X `echo " $libs " | sed -e 's@ -lndbm @ @' -e 's@ -lgdbm @ @' -e 's@ -ldbm @ @' -e 's@ -ldb @ @'`
20859 *) perllibs="$libs"
20865 : Remove build directory name from cppstdin so it can be used from
20866 : either the present location or the final installed location.
20868 : Get out of the UU directory to get correct path name.
20870 case "$cppstdin" in
20872 echo "Stripping down cppstdin path name"
20878 : end of configuration questions
20880 echo "End of configuration questions."
20883 : back to where it started
20884 if test -d ../UU; then
20888 : configuration may be patched via a 'config.arch' file
20889 if $test -f config.arch; then
20890 echo "I see a config.arch file, loading it."
20894 : configuration may be patched via a 'config.over' file
20895 if $test -f config.over; then
20898 rp='I see a config.over file. Do you wish to load it?'
20901 n*) echo "OK, I'll ignore it.";;
20903 echo "Configuration override changes have been loaded."
20908 : in case they want portability, strip down executable paths
20909 case "$d_portable" in
20912 echo "Stripping down executable paths..." >&4
20913 for file in $loclist $trylist; do
20915 eval $file=`basename $temp`
20920 : create config.sh file
20922 echo "Creating config.sh..." >&4
20923 $spitshell <<EOT >config.sh
20926 # This file was produced by running the Configure script. It holds all the
20927 # definitions figured out by Configure. Should you modify one of these values,
20928 # do not forget to propagate your changes by running "Configure -der". You may
20929 # instead choose to run each of the .SH files by yourself, or "Configure -S".
20932 # Package name : $package
20933 # Source directory : $src
20934 # Configuration time: $cf_time
20935 # Configured by : $cf_by
20936 # Target system : $myuname
20946 Revision='$Revision'
20954 alignbytes='$alignbytes'
20955 ansi2knr='$ansi2knr'
20956 aphostname='$aphostname'
20957 api_revision='$api_revision'
20958 api_subversion='$api_subversion'
20959 api_version='$api_version'
20960 api_versionstring='$api_versionstring'
20963 archlibexp='$archlibexp'
20964 archname64='$archname64'
20965 archname='$archname'
20966 archobjs='$archobjs'
20967 asctime_r_proto='$asctime_r_proto'
20975 byteorder='$byteorder'
20977 castflags='$castflags'
20980 cccdlflags='$cccdlflags'
20981 ccdlflags='$ccdlflags'
20983 ccflags_uselargefiles='$ccflags_uselargefiles'
20985 ccsymbols='$ccsymbols'
20986 ccversion='$ccversion'
20988 cf_email='$cf_email'
20990 charsize='$charsize'
20994 clocktype='$clocktype'
20996 compress='$compress'
20997 contains='$contains'
21001 cpp_stuff='$cpp_stuff'
21002 cppccsymbols='$cppccsymbols'
21003 cppflags='$cppflags'
21005 cppminus='$cppminus'
21007 cppstdin='$cppstdin'
21008 cppsymbols='$cppsymbols'
21009 crypt_r_proto='$crypt_r_proto'
21010 cryptlib='$cryptlib'
21012 ctermid_r_proto='$ctermid_r_proto'
21013 ctime_r_proto='$ctime_r_proto'
21014 d_Gconvert='$d_Gconvert'
21015 d_PRIEUldbl='$d_PRIEUldbl'
21016 d_PRIFUldbl='$d_PRIFUldbl'
21017 d_PRIGUldbl='$d_PRIGUldbl'
21018 d_PRIXU64='$d_PRIXU64'
21019 d_PRId64='$d_PRId64'
21020 d_PRIeldbl='$d_PRIeldbl'
21021 d_PRIfldbl='$d_PRIfldbl'
21022 d_PRIgldbl='$d_PRIgldbl'
21023 d_PRIi64='$d_PRIi64'
21024 d_PRIo64='$d_PRIo64'
21025 d_PRIu64='$d_PRIu64'
21026 d_PRIx64='$d_PRIx64'
21027 d_SCNfldbl='$d_SCNfldbl'
21028 d__fwalk='$d__fwalk'
21029 d_access='$d_access'
21030 d_accessx='$d_accessx'
21033 d_archlib='$d_archlib'
21034 d_asctime_r='$d_asctime_r'
21037 d_attribute_format='$d_attribute_format'
21038 d_attribute_malloc='$d_attribute_malloc'
21039 d_attribute_nonnull='$d_attribute_nonnull'
21040 d_attribute_noreturn='$d_attribute_noreturn'
21041 d_attribute_pure='$d_attribute_pure'
21042 d_attribute_unused='$d_attribute_unused'
21043 d_attribute_warn_unused_result='$d_attribute_warn_unused_result'
21047 d_bsdgetpgrp='$d_bsdgetpgrp'
21048 d_bsdsetpgrp='$d_bsdsetpgrp'
21050 d_casti32='$d_casti32'
21051 d_castneg='$d_castneg'
21052 d_charvspr='$d_charvspr'
21054 d_chroot='$d_chroot'
21055 d_chsize='$d_chsize'
21057 d_clearenv='$d_clearenv'
21058 d_closedir='$d_closedir'
21059 d_cmsghdr_s='$d_cmsghdr_s'
21061 d_copysignl='$d_copysignl'
21063 d_crypt_r='$d_crypt_r'
21065 d_ctermid_r='$d_ctermid_r'
21066 d_ctime_r='$d_ctime_r'
21067 d_cuserid='$d_cuserid'
21068 d_dbl_dig='$d_dbl_dig'
21069 d_dbminitproto='$d_dbminitproto'
21070 d_difftime='$d_difftime'
21072 d_dirnamlen='$d_dirnamlen'
21073 d_dlerror='$d_dlerror'
21074 d_dlopen='$d_dlopen'
21075 d_dlsymun='$d_dlsymun'
21076 d_dosuid='$d_dosuid'
21077 d_drand48_r='$d_drand48_r'
21078 d_drand48proto='$d_drand48proto'
21080 d_eaccess='$d_eaccess'
21081 d_endgrent='$d_endgrent'
21082 d_endgrent_r='$d_endgrent_r'
21083 d_endhent='$d_endhent'
21084 d_endhostent_r='$d_endhostent_r'
21085 d_endnent='$d_endnent'
21086 d_endnetent_r='$d_endnetent_r'
21087 d_endpent='$d_endpent'
21088 d_endprotoent_r='$d_endprotoent_r'
21089 d_endpwent='$d_endpwent'
21090 d_endpwent_r='$d_endpwent_r'
21091 d_endsent='$d_endsent'
21092 d_endservent_r='$d_endservent_r'
21093 d_eofnblk='$d_eofnblk'
21094 d_eunice='$d_eunice'
21095 d_faststdio='$d_faststdio'
21096 d_fchdir='$d_fchdir'
21097 d_fchmod='$d_fchmod'
21098 d_fchown='$d_fchown'
21100 d_fcntl_can_lock='$d_fcntl_can_lock'
21101 d_fd_macros='$d_fd_macros'
21102 d_fd_set='$d_fd_set'
21103 d_fds_bits='$d_fds_bits'
21104 d_fgetpos='$d_fgetpos'
21105 d_finite='$d_finite'
21106 d_finitel='$d_finitel'
21107 d_flexfnam='$d_flexfnam'
21109 d_flockproto='$d_flockproto'
21111 d_fp_class='$d_fp_class'
21112 d_fpathconf='$d_fpathconf'
21113 d_fpclass='$d_fpclass'
21114 d_fpclassify='$d_fpclassify'
21115 d_fpclassl='$d_fpclassl'
21116 d_fpos64_t='$d_fpos64_t'
21117 d_frexpl='$d_frexpl'
21118 d_fs_data_s='$d_fs_data_s'
21119 d_fseeko='$d_fseeko'
21120 d_fsetpos='$d_fsetpos'
21121 d_fstatfs='$d_fstatfs'
21122 d_fstatvfs='$d_fstatvfs'
21124 d_ftello='$d_ftello'
21126 d_getcwd='$d_getcwd'
21127 d_getespwnam='$d_getespwnam'
21128 d_getfsstat='$d_getfsstat'
21129 d_getgrent='$d_getgrent'
21130 d_getgrent_r='$d_getgrent_r'
21131 d_getgrgid_r='$d_getgrgid_r'
21132 d_getgrnam_r='$d_getgrnam_r'
21133 d_getgrps='$d_getgrps'
21134 d_gethbyaddr='$d_gethbyaddr'
21135 d_gethbyname='$d_gethbyname'
21136 d_gethent='$d_gethent'
21137 d_gethname='$d_gethname'
21138 d_gethostbyaddr_r='$d_gethostbyaddr_r'
21139 d_gethostbyname_r='$d_gethostbyname_r'
21140 d_gethostent_r='$d_gethostent_r'
21141 d_gethostprotos='$d_gethostprotos'
21142 d_getitimer='$d_getitimer'
21143 d_getlogin='$d_getlogin'
21144 d_getlogin_r='$d_getlogin_r'
21145 d_getmnt='$d_getmnt'
21146 d_getmntent='$d_getmntent'
21147 d_getnbyaddr='$d_getnbyaddr'
21148 d_getnbyname='$d_getnbyname'
21149 d_getnent='$d_getnent'
21150 d_getnetbyaddr_r='$d_getnetbyaddr_r'
21151 d_getnetbyname_r='$d_getnetbyname_r'
21152 d_getnetent_r='$d_getnetent_r'
21153 d_getnetprotos='$d_getnetprotos'
21154 d_getpagsz='$d_getpagsz'
21155 d_getpbyname='$d_getpbyname'
21156 d_getpbynumber='$d_getpbynumber'
21157 d_getpent='$d_getpent'
21158 d_getpgid='$d_getpgid'
21159 d_getpgrp2='$d_getpgrp2'
21160 d_getpgrp='$d_getpgrp'
21161 d_getppid='$d_getppid'
21162 d_getprior='$d_getprior'
21163 d_getprotobyname_r='$d_getprotobyname_r'
21164 d_getprotobynumber_r='$d_getprotobynumber_r'
21165 d_getprotoent_r='$d_getprotoent_r'
21166 d_getprotoprotos='$d_getprotoprotos'
21167 d_getprpwnam='$d_getprpwnam'
21168 d_getpwent='$d_getpwent'
21169 d_getpwent_r='$d_getpwent_r'
21170 d_getpwnam_r='$d_getpwnam_r'
21171 d_getpwuid_r='$d_getpwuid_r'
21172 d_getsbyname='$d_getsbyname'
21173 d_getsbyport='$d_getsbyport'
21174 d_getsent='$d_getsent'
21175 d_getservbyname_r='$d_getservbyname_r'
21176 d_getservbyport_r='$d_getservbyport_r'
21177 d_getservent_r='$d_getservent_r'
21178 d_getservprotos='$d_getservprotos'
21179 d_getspnam='$d_getspnam'
21180 d_getspnam_r='$d_getspnam_r'
21181 d_gettimeod='$d_gettimeod'
21182 d_gmtime_r='$d_gmtime_r'
21183 d_gnulibc='$d_gnulibc'
21184 d_grpasswd='$d_grpasswd'
21185 d_hasmntopt='$d_hasmntopt'
21187 d_ilogbl='$d_ilogbl'
21189 d_inetaton='$d_inetaton'
21190 d_int64_t='$d_int64_t'
21191 d_isascii='$d_isascii'
21192 d_isfinite='$d_isfinite'
21195 d_isnanl='$d_isnanl'
21196 d_killpg='$d_killpg'
21197 d_lchown='$d_lchown'
21198 d_ldbl_dig='$d_ldbl_dig'
21199 d_libm_lib_version='$d_libm_lib_version'
21201 d_localtime_r='$d_localtime_r'
21202 d_locconv='$d_locconv'
21204 d_longdbl='$d_longdbl'
21205 d_longlong='$d_longlong'
21206 d_lseekproto='$d_lseekproto'
21208 d_madvise='$d_madvise'
21209 d_malloc_good_size='$d_malloc_good_size'
21210 d_malloc_size='$d_malloc_size'
21212 d_mbstowcs='$d_mbstowcs'
21213 d_mbtowc='$d_mbtowc'
21214 d_memchr='$d_memchr'
21215 d_memcmp='$d_memcmp'
21216 d_memcpy='$d_memcpy'
21217 d_memmove='$d_memmove'
21218 d_memset='$d_memset'
21220 d_mkdtemp='$d_mkdtemp'
21221 d_mkfifo='$d_mkfifo'
21222 d_mkstemp='$d_mkstemp'
21223 d_mkstemps='$d_mkstemps'
21224 d_mktime='$d_mktime'
21227 d_modfl_pow32_bug='$d_modfl_pow32_bug'
21228 d_modflproto='$d_modflproto'
21229 d_mprotect='$d_mprotect'
21231 d_msg_ctrunc='$d_msg_ctrunc'
21232 d_msg_dontroute='$d_msg_dontroute'
21233 d_msg_oob='$d_msg_oob'
21234 d_msg_peek='$d_msg_peek'
21235 d_msg_proxy='$d_msg_proxy'
21236 d_msgctl='$d_msgctl'
21237 d_msgget='$d_msgget'
21238 d_msghdr_s='$d_msghdr_s'
21239 d_msgrcv='$d_msgrcv'
21240 d_msgsnd='$d_msgsnd'
21242 d_munmap='$d_munmap'
21243 d_mymalloc='$d_mymalloc'
21245 d_nl_langinfo='$d_nl_langinfo'
21246 d_nv_preserves_uv='$d_nv_preserves_uv'
21247 d_nv_zero_is_allbits_zero='$d_nv_zero_is_allbits_zero'
21248 d_off64_t='$d_off64_t'
21249 d_old_pthread_create_joinable='$d_old_pthread_create_joinable'
21250 d_oldpthreads='$d_oldpthreads'
21251 d_oldsock='$d_oldsock'
21253 d_pathconf='$d_pathconf'
21255 d_perl_otherlibdirs='$d_perl_otherlibdirs'
21256 d_phostname='$d_phostname'
21259 d_portable='$d_portable'
21260 d_procselfexe='$d_procselfexe'
21261 d_pthread_atfork='$d_pthread_atfork'
21262 d_pthread_attr_setscope='$d_pthread_attr_setscope'
21263 d_pthread_yield='$d_pthread_yield'
21265 d_pwchange='$d_pwchange'
21266 d_pwclass='$d_pwclass'
21267 d_pwcomment='$d_pwcomment'
21268 d_pwexpire='$d_pwexpire'
21269 d_pwgecos='$d_pwgecos'
21270 d_pwpasswd='$d_pwpasswd'
21271 d_pwquota='$d_pwquota'
21274 d_random_r='$d_random_r'
21275 d_readdir64_r='$d_readdir64_r'
21276 d_readdir='$d_readdir'
21277 d_readdir_r='$d_readdir_r'
21278 d_readlink='$d_readlink'
21280 d_recvmsg='$d_recvmsg'
21281 d_rename='$d_rename'
21282 d_rewinddir='$d_rewinddir'
21284 d_safebcpy='$d_safebcpy'
21285 d_safemcpy='$d_safemcpy'
21286 d_sanemcmp='$d_sanemcmp'
21287 d_sbrkproto='$d_sbrkproto'
21288 d_scalbnl='$d_scalbnl'
21289 d_sched_yield='$d_sched_yield'
21290 d_scm_rights='$d_scm_rights'
21291 d_seekdir='$d_seekdir'
21292 d_select='$d_select'
21294 d_semctl='$d_semctl'
21295 d_semctl_semid_ds='$d_semctl_semid_ds'
21296 d_semctl_semun='$d_semctl_semun'
21297 d_semget='$d_semget'
21299 d_sendmsg='$d_sendmsg'
21300 d_setegid='$d_setegid'
21301 d_seteuid='$d_seteuid'
21302 d_setgrent='$d_setgrent'
21303 d_setgrent_r='$d_setgrent_r'
21304 d_setgrps='$d_setgrps'
21305 d_sethent='$d_sethent'
21306 d_sethostent_r='$d_sethostent_r'
21307 d_setitimer='$d_setitimer'
21308 d_setlinebuf='$d_setlinebuf'
21309 d_setlocale='$d_setlocale'
21310 d_setlocale_r='$d_setlocale_r'
21311 d_setnent='$d_setnent'
21312 d_setnetent_r='$d_setnetent_r'
21313 d_setpent='$d_setpent'
21314 d_setpgid='$d_setpgid'
21315 d_setpgrp2='$d_setpgrp2'
21316 d_setpgrp='$d_setpgrp'
21317 d_setprior='$d_setprior'
21318 d_setproctitle='$d_setproctitle'
21319 d_setprotoent_r='$d_setprotoent_r'
21320 d_setpwent='$d_setpwent'
21321 d_setpwent_r='$d_setpwent_r'
21322 d_setregid='$d_setregid'
21323 d_setresgid='$d_setresgid'
21324 d_setresuid='$d_setresuid'
21325 d_setreuid='$d_setreuid'
21326 d_setrgid='$d_setrgid'
21327 d_setruid='$d_setruid'
21328 d_setsent='$d_setsent'
21329 d_setservent_r='$d_setservent_r'
21330 d_setsid='$d_setsid'
21331 d_setvbuf='$d_setvbuf'
21335 d_shmatprototype='$d_shmatprototype'
21336 d_shmctl='$d_shmctl'
21338 d_shmget='$d_shmget'
21339 d_sigaction='$d_sigaction'
21340 d_sigprocmask='$d_sigprocmask'
21341 d_sigsetjmp='$d_sigsetjmp'
21342 d_sockatmark='$d_sockatmark'
21343 d_sockatmarkproto='$d_sockatmarkproto'
21344 d_socket='$d_socket'
21345 d_socklen_t='$d_socklen_t'
21346 d_sockpair='$d_sockpair'
21347 d_socks5_init='$d_socks5_init'
21348 d_sprintf_returns_strlen='$d_sprintf_returns_strlen'
21350 d_srand48_r='$d_srand48_r'
21351 d_srandom_r='$d_srandom_r'
21352 d_sresgproto='$d_sresgproto'
21353 d_sresuproto='$d_sresuproto'
21354 d_statblks='$d_statblks'
21355 d_statfs_f_flags='$d_statfs_f_flags'
21356 d_statfs_s='$d_statfs_s'
21357 d_statvfs='$d_statvfs'
21358 d_stdio_cnt_lval='$d_stdio_cnt_lval'
21359 d_stdio_ptr_lval='$d_stdio_ptr_lval'
21360 d_stdio_ptr_lval_nochange_cnt='$d_stdio_ptr_lval_nochange_cnt'
21361 d_stdio_ptr_lval_sets_cnt='$d_stdio_ptr_lval_sets_cnt'
21362 d_stdio_stream_array='$d_stdio_stream_array'
21363 d_stdiobase='$d_stdiobase'
21364 d_stdstdio='$d_stdstdio'
21365 d_strchr='$d_strchr'
21366 d_strcoll='$d_strcoll'
21367 d_strctcpy='$d_strctcpy'
21368 d_strerrm='$d_strerrm'
21369 d_strerror='$d_strerror'
21370 d_strerror_r='$d_strerror_r'
21371 d_strftime='$d_strftime'
21372 d_strlcat='$d_strlcat'
21373 d_strlcpy='$d_strlcpy'
21374 d_strtod='$d_strtod'
21375 d_strtol='$d_strtol'
21376 d_strtold='$d_strtold'
21377 d_strtoll='$d_strtoll'
21378 d_strtoq='$d_strtoq'
21379 d_strtoul='$d_strtoul'
21380 d_strtoull='$d_strtoull'
21381 d_strtouq='$d_strtouq'
21382 d_strxfrm='$d_strxfrm'
21383 d_suidsafe='$d_suidsafe'
21384 d_symlink='$d_symlink'
21385 d_syscall='$d_syscall'
21386 d_syscallproto='$d_syscallproto'
21387 d_sysconf='$d_sysconf'
21388 d_sysernlst='$d_sysernlst'
21389 d_syserrlst='$d_syserrlst'
21390 d_system='$d_system'
21391 d_tcgetpgrp='$d_tcgetpgrp'
21392 d_tcsetpgrp='$d_tcsetpgrp'
21393 d_telldir='$d_telldir'
21394 d_telldirproto='$d_telldirproto'
21397 d_tm_tm_gmtoff='$d_tm_tm_gmtoff'
21398 d_tm_tm_zone='$d_tm_tm_zone'
21399 d_tmpnam_r='$d_tmpnam_r'
21400 d_truncate='$d_truncate'
21401 d_ttyname_r='$d_ttyname_r'
21402 d_tzname='$d_tzname'
21403 d_u32align='$d_u32align'
21404 d_ualarm='$d_ualarm'
21407 d_union_semun='$d_union_semun'
21408 d_unordered='$d_unordered'
21409 d_unsetenv='$d_unsetenv'
21410 d_usleep='$d_usleep'
21411 d_usleepproto='$d_usleepproto'
21413 d_vendorarch='$d_vendorarch'
21414 d_vendorbin='$d_vendorbin'
21415 d_vendorlib='$d_vendorlib'
21416 d_vendorscript='$d_vendorscript'
21418 d_void_closedir='$d_void_closedir'
21419 d_voidsig='$d_voidsig'
21420 d_voidtty='$d_voidtty'
21421 d_volatile='$d_volatile'
21422 d_vprintf='$d_vprintf'
21424 d_waitpid='$d_waitpid'
21425 d_wcstombs='$d_wcstombs'
21426 d_wctomb='$d_wctomb'
21427 d_writev='$d_writev'
21430 db_hashtype='$db_hashtype'
21431 db_prefixtype='$db_prefixtype'
21432 db_version_major='$db_version_major'
21433 db_version_minor='$db_version_minor'
21434 db_version_patch='$db_version_patch'
21435 defvoidused='$defvoidused'
21436 direntrytype='$direntrytype'
21439 doublesize='$doublesize'
21441 drand48_r_proto='$drand48_r_proto'
21442 dynamic_ext='$dynamic_ext'
21448 endgrent_r_proto='$endgrent_r_proto'
21449 endhostent_r_proto='$endhostent_r_proto'
21450 endnetent_r_proto='$endnetent_r_proto'
21451 endprotoent_r_proto='$endprotoent_r_proto'
21452 endpwent_r_proto='$endpwent_r_proto'
21453 endservent_r_proto='$endservent_r_proto'
21454 eunicefix='$eunicefix'
21457 extensions='$extensions'
21459 fflushNULL='$fflushNULL'
21460 fflushall='$fflushall'
21462 firstmakefile='$firstmakefile'
21464 fpossize='$fpossize'
21465 fpostype='$fpostype'
21466 freetype='$freetype'
21469 full_csh='$full_csh'
21470 full_sed='$full_sed'
21471 gccansipedantic='$gccansipedantic'
21472 gccosandvers='$gccosandvers'
21473 gccversion='$gccversion'
21474 getgrent_r_proto='$getgrent_r_proto'
21475 getgrgid_r_proto='$getgrgid_r_proto'
21476 getgrnam_r_proto='$getgrnam_r_proto'
21477 gethostbyaddr_r_proto='$gethostbyaddr_r_proto'
21478 gethostbyname_r_proto='$gethostbyname_r_proto'
21479 gethostent_r_proto='$gethostent_r_proto'
21480 getlogin_r_proto='$getlogin_r_proto'
21481 getnetbyaddr_r_proto='$getnetbyaddr_r_proto'
21482 getnetbyname_r_proto='$getnetbyname_r_proto'
21483 getnetent_r_proto='$getnetent_r_proto'
21484 getprotobyname_r_proto='$getprotobyname_r_proto'
21485 getprotobynumber_r_proto='$getprotobynumber_r_proto'
21486 getprotoent_r_proto='$getprotoent_r_proto'
21487 getpwent_r_proto='$getpwent_r_proto'
21488 getpwnam_r_proto='$getpwnam_r_proto'
21489 getpwuid_r_proto='$getpwuid_r_proto'
21490 getservbyname_r_proto='$getservbyname_r_proto'
21491 getservbyport_r_proto='$getservbyport_r_proto'
21492 getservent_r_proto='$getservent_r_proto'
21493 getspnam_r_proto='$getspnam_r_proto'
21494 gidformat='$gidformat'
21500 gmtime_r_proto='$gmtime_r_proto'
21501 gnulibc_version='$gnulibc_version'
21503 groupcat='$groupcat'
21504 groupstype='$groupstype'
21507 h_sysfile='$h_sysfile'
21510 html1dir='$html1dir'
21511 html1direxp='$html1direxp'
21512 html3dir='$html3dir'
21513 html3direxp='$html3direxp'
21522 i_arpainet='$i_arpainet'
21523 i_bsdioctl='$i_bsdioctl'
21527 i_dirent='$i_dirent'
21533 i_fp_class='$i_fp_class'
21536 i_ieeefp='$i_ieeefp'
21537 i_inttypes='$i_inttypes'
21538 i_langinfo='$i_langinfo'
21539 i_libutil='$i_libutil'
21540 i_limits='$i_limits'
21541 i_locale='$i_locale'
21542 i_machcthr='$i_machcthr'
21543 i_malloc='$i_malloc'
21545 i_memory='$i_memory'
21546 i_mntent='$i_mntent'
21549 i_neterrno='$i_neterrno'
21550 i_netinettcp='$i_netinettcp'
21554 i_pthread='$i_pthread'
21556 i_rpcsvcdbm='$i_rpcsvcdbm'
21559 i_shadow='$i_shadow'
21561 i_stdarg='$i_stdarg'
21562 i_stddef='$i_stddef'
21563 i_stdlib='$i_stdlib'
21564 i_string='$i_string'
21565 i_sunmath='$i_sunmath'
21566 i_sysaccess='$i_sysaccess'
21567 i_sysdir='$i_sysdir'
21568 i_sysfile='$i_sysfile'
21569 i_sysfilio='$i_sysfilio'
21571 i_sysioctl='$i_sysioctl'
21572 i_syslog='$i_syslog'
21573 i_sysmman='$i_sysmman'
21574 i_sysmode='$i_sysmode'
21575 i_sysmount='$i_sysmount'
21576 i_sysndir='$i_sysndir'
21577 i_sysparam='$i_sysparam'
21578 i_sysresrc='$i_sysresrc'
21579 i_syssecrt='$i_syssecrt'
21580 i_sysselct='$i_sysselct'
21581 i_syssockio='$i_syssockio'
21582 i_sysstat='$i_sysstat'
21583 i_sysstatfs='$i_sysstatfs'
21584 i_sysstatvfs='$i_sysstatvfs'
21585 i_systime='$i_systime'
21586 i_systimek='$i_systimek'
21587 i_systimes='$i_systimes'
21588 i_systypes='$i_systypes'
21589 i_sysuio='$i_sysuio'
21591 i_sysutsname='$i_sysutsname'
21592 i_sysvfs='$i_sysvfs'
21593 i_syswait='$i_syswait'
21594 i_termio='$i_termio'
21595 i_termios='$i_termios'
21597 i_unistd='$i_unistd'
21600 i_values='$i_values'
21601 i_varargs='$i_varargs'
21602 i_varhdr='$i_varhdr'
21604 ignore_versioned_solibs='$ignore_versioned_solibs'
21605 inc_version_list='$inc_version_list'
21606 inc_version_list_init='$inc_version_list_init'
21609 installarchlib='$installarchlib'
21610 installbin='$installbin'
21611 installhtml1dir='$installhtml1dir'
21612 installhtml3dir='$installhtml3dir'
21613 installman1dir='$installman1dir'
21614 installman3dir='$installman3dir'
21615 installprefix='$installprefix'
21616 installprefixexp='$installprefixexp'
21617 installprivlib='$installprivlib'
21618 installscript='$installscript'
21619 installsitearch='$installsitearch'
21620 installsitebin='$installsitebin'
21621 installsitehtml1dir='$installsitehtml1dir'
21622 installsitehtml3dir='$installsitehtml3dir'
21623 installsitelib='$installsitelib'
21624 installsiteman1dir='$installsiteman1dir'
21625 installsiteman3dir='$installsiteman3dir'
21626 installsitescript='$installsitescript'
21627 installstyle='$installstyle'
21628 installusrbinperl='$installusrbinperl'
21629 installvendorarch='$installvendorarch'
21630 installvendorbin='$installvendorbin'
21631 installvendorhtml1dir='$installvendorhtml1dir'
21632 installvendorhtml3dir='$installvendorhtml3dir'
21633 installvendorlib='$installvendorlib'
21634 installvendorman1dir='$installvendorman1dir'
21635 installvendorman3dir='$installvendorman3dir'
21636 installvendorscript='$installvendorscript'
21638 issymlink='$issymlink'
21639 ivdformat='$ivdformat'
21642 known_extensions='$known_extensions'
21645 lddlflags='$lddlflags'
21647 ldflags_uselargefiles='$ldflags_uselargefiles'
21648 ldlibpthname='$ldlibpthname'
21655 libsdirs='$libsdirs'
21656 libsfiles='$libsfiles'
21657 libsfound='$libsfound'
21658 libspath='$libspath'
21659 libswanted='$libswanted'
21660 libswanted_uselargefiles='$libswanted_uselargefiles'
21666 localtime_r_proto='$localtime_r_proto'
21667 locincpth='$locincpth'
21668 loclibpth='$loclibpth'
21669 longdblsize='$longdblsize'
21670 longlongsize='$longlongsize'
21671 longsize='$longsize'
21675 lseeksize='$lseeksize'
21676 lseektype='$lseektype'
21680 make_set_make='$make_set_make'
21681 mallocobj='$mallocobj'
21682 mallocsrc='$mallocsrc'
21683 malloctype='$malloctype'
21685 man1direxp='$man1direxp'
21688 man3direxp='$man3direxp'
21690 mips_type='$mips_type'
21691 mistrustnm='$mistrustnm'
21693 mmaptype='$mmaptype'
21694 modetype='$modetype'
21696 multiarch='$multiarch'
21698 myarchname='$myarchname'
21699 mydomain='$mydomain'
21700 myhostname='$myhostname'
21703 need_va_copy='$need_va_copy'
21704 netdb_hlen_type='$netdb_hlen_type'
21705 netdb_host_type='$netdb_host_type'
21706 netdb_name_type='$netdb_name_type'
21707 netdb_net_type='$netdb_net_type'
21710 nm_so_opt='$nm_so_opt'
21711 nonxs_ext='$nonxs_ext'
21713 nvEUformat='$nvEUformat'
21714 nvFUformat='$nvFUformat'
21715 nvGUformat='$nvGUformat'
21716 nv_preserves_uv_bits='$nv_preserves_uv_bits'
21717 nveformat='$nveformat'
21718 nvfformat='$nvfformat'
21719 nvgformat='$nvgformat'
21722 o_nonblock='$o_nonblock'
21724 old_pthread_create_joinable='$old_pthread_create_joinable'
21725 optimize='$optimize'
21726 orderlib='$orderlib'
21729 otherlibdirs='$otherlibdirs'
21733 patchlevel='$patchlevel'
21734 path_sep='$path_sep'
21737 perl_patchlevel='$perl_patchlevel'
21738 perladmin='$perladmin'
21739 perllibs='$perllibs'
21740 perlpath='$perlpath'
21742 phostname='$phostname'
21748 prefixexp='$prefixexp'
21750 privlibexp='$privlibexp'
21751 procselfexe='$procselfexe'
21752 prototype='$prototype'
21754 quadkind='$quadkind'
21755 quadtype='$quadtype'
21756 randbits='$randbits'
21757 randfunc='$randfunc'
21758 random_r_proto='$random_r_proto'
21759 randseedtype='$randseedtype'
21761 rd_nodata='$rd_nodata'
21762 readdir64_r_proto='$readdir64_r_proto'
21763 readdir_r_proto='$readdir_r_proto'
21764 revision='$revision'
21769 sPRIEUldbl='$sPRIEUldbl'
21770 sPRIFUldbl='$sPRIFUldbl'
21771 sPRIGUldbl='$sPRIGUldbl'
21772 sPRIXU64='$sPRIXU64'
21774 sPRIeldbl='$sPRIeldbl'
21775 sPRIfldbl='$sPRIfldbl'
21776 sPRIgldbl='$sPRIgldbl'
21781 sSCNfldbl='$sSCNfldbl'
21782 sched_yield='$sched_yield'
21783 scriptdir='$scriptdir'
21784 scriptdirexp='$scriptdirexp'
21786 seedfunc='$seedfunc'
21787 selectminbits='$selectminbits'
21788 selecttype='$selecttype'
21789 sendmail='$sendmail'
21790 setgrent_r_proto='$setgrent_r_proto'
21791 sethostent_r_proto='$sethostent_r_proto'
21792 setlocale_r_proto='$setlocale_r_proto'
21793 setnetent_r_proto='$setnetent_r_proto'
21794 setprotoent_r_proto='$setprotoent_r_proto'
21795 setpwent_r_proto='$setpwent_r_proto'
21796 setservent_r_proto='$setservent_r_proto'
21799 sharpbang='$sharpbang'
21800 shmattype='$shmattype'
21801 shortsize='$shortsize'
21804 sig_count='$sig_count'
21805 sig_name='$sig_name'
21806 sig_name_init='$sig_name_init'
21808 sig_num_init='$sig_num_init'
21809 sig_size='$sig_size'
21810 signal_t='$signal_t'
21811 sitearch='$sitearch'
21812 sitearchexp='$sitearchexp'
21814 sitebinexp='$sitebinexp'
21815 sitehtml1dir='$sitehtml1dir'
21816 sitehtml1direxp='$sitehtml1direxp'
21817 sitehtml3dir='$sitehtml3dir'
21818 sitehtml3direxp='$sitehtml3direxp'
21820 sitelib_stem='$sitelib_stem'
21821 sitelibexp='$sitelibexp'
21822 siteman1dir='$siteman1dir'
21823 siteman1direxp='$siteman1direxp'
21824 siteman3dir='$siteman3dir'
21825 siteman3direxp='$siteman3direxp'
21826 siteprefix='$siteprefix'
21827 siteprefixexp='$siteprefixexp'
21828 sitescript='$sitescript'
21829 sitescriptexp='$sitescriptexp'
21830 sizesize='$sizesize'
21831 sizetype='$sizetype'
21835 sockethdr='$sockethdr'
21836 socketlib='$socketlib'
21837 socksizetype='$socksizetype'
21839 spackage='$spackage'
21840 spitshell='$spitshell'
21841 srand48_r_proto='$srand48_r_proto'
21842 srandom_r_proto='$srandom_r_proto'
21844 ssizetype='$ssizetype'
21845 startperl='$startperl'
21847 static_ext='$static_ext'
21849 stdio_base='$stdio_base'
21850 stdio_bufsiz='$stdio_bufsiz'
21851 stdio_cnt='$stdio_cnt'
21852 stdio_filbuf='$stdio_filbuf'
21853 stdio_ptr='$stdio_ptr'
21854 stdio_stream_array='$stdio_stream_array'
21855 strerror_r_proto='$strerror_r_proto'
21858 subversion='$subversion'
21862 targetarch='$targetarch'
21866 timeincl='$timeincl'
21867 timetype='$timetype'
21868 tmpnam_r_proto='$tmpnam_r_proto'
21874 ttyname_r_proto='$ttyname_r_proto'
21883 uidformat='$uidformat'
21889 uquadtype='$uquadtype'
21890 use5005threads='$use5005threads'
21891 use64bitall='$use64bitall'
21892 use64bitint='$use64bitint'
21893 usecrosscompile='$usecrosscompile'
21895 usefaststdio='$usefaststdio'
21896 useithreads='$useithreads'
21897 uselargefiles='$uselargefiles'
21898 uselongdouble='$uselongdouble'
21899 usemallocwrap='$usemallocwrap'
21900 usemorebits='$usemorebits'
21901 usemultiplicity='$usemultiplicity'
21902 usemymalloc='$usemymalloc'
21904 useopcode='$useopcode'
21905 useperlio='$useperlio'
21906 useposix='$useposix'
21907 usereentrant='$usereentrant'
21908 userelocatableinc='$userelocatableinc'
21910 useshrplib='$useshrplib'
21911 usesitecustomize='$usesitecustomize'
21912 usesocks='$usesocks'
21913 usethreads='$usethreads'
21914 usevendorprefix='$usevendorprefix'
21915 usevfork='$usevfork'
21918 uvXUformat='$uvXUformat'
21919 uvoformat='$uvoformat'
21922 uvuformat='$uvuformat'
21923 uvxformat='$uvxformat'
21924 vendorarch='$vendorarch'
21925 vendorarchexp='$vendorarchexp'
21926 vendorbin='$vendorbin'
21927 vendorbinexp='$vendorbinexp'
21928 vendorhtml1dir='$vendorhtml1dir'
21929 vendorhtml1direxp='$vendorhtml1direxp'
21930 vendorhtml3dir='$vendorhtml3dir'
21931 vendorhtml3direxp='$vendorhtml3direxp'
21932 vendorlib='$vendorlib'
21933 vendorlib_stem='$vendorlib_stem'
21934 vendorlibexp='$vendorlibexp'
21935 vendorman1dir='$vendorman1dir'
21936 vendorman1direxp='$vendorman1direxp'
21937 vendorman3dir='$vendorman3dir'
21938 vendorman3direxp='$vendorman3direxp'
21939 vendorprefix='$vendorprefix'
21940 vendorprefixexp='$vendorprefixexp'
21941 vendorscript='$vendorscript'
21942 vendorscriptexp='$vendorscriptexp'
21944 version_patchlevel_string='$version_patchlevel_string'
21945 versiononly='$versiononly'
21947 voidflags='$voidflags'
21950 yaccflags='$yaccflags'
21955 : Add in command line options if available
21956 $test -f UU/cmdline.opt && $cat UU/cmdline.opt >> config.sh
21958 : add special variables
21959 $test -f $src/patchlevel.h && \
21960 awk '/^#define[ ]+PERL_/ {printf "%s=%s\n",$2,$3}' $src/patchlevel.h >>config.sh
21961 echo "PERL_PATCHLEVEL=$perl_patchlevel" >>config.sh
21962 echo "PERL_CONFIG_SH=true" >>config.sh
21964 : propagate old symbols
21965 if $test -f UU/config.sh; then
21966 <UU/config.sh $sort | $uniq >UU/oldconfig.sh
21967 sed -n 's/^\([a-zA-Z_0-9]*\)=.*/\1/p' config.sh config.sh UU/oldconfig.sh |\
21968 $sort | $uniq -u >UU/oldsyms
21969 set X `cat UU/oldsyms`
21975 Hmm...You had some extra variables I don't know about...I'll try to keep 'em...
21977 echo "# Variables propagated from previous config.sh file." >>config.sh
21978 for sym in `cat UU/oldsyms`; do
21979 echo " Propagating $hint variable "'$'"$sym..."
21980 eval 'tmp="$'"${sym}"'"'
21982 sed -e "s/'/'\"'\"'/g" -e "s/^/$sym='/" -e "s/$/'/" >>config.sh
21988 : Finish up by extracting the .SH files
21992 echo "Extraction done."
22002 If you'd like to make any changes to the config.sh file before I begin
22003 to configure things, do it as a shell escape now (e.g. !vi config.sh).
22006 rp="Press return or use a shell escape to edit config.sh:"
22011 *) : in case they cannot read
22012 sh 1>&4 -c "$ans";;
22017 : if this fails, just run all the .SH files by hand
22026 if $contains '^depend:' [Mm]akefile >/dev/null 2>&1; then
22033 Now you need to generate make dependencies by running "$make depend".
22034 You might prefer to run it in background: "$make depend > makedepend.out &"
22035 It can take a while, so you might not want to run it right now.
22040 rp="Run $make depend now?"
22044 $make depend && echo "Now you must run '$make'."
22047 echo "You must run '$make depend' then '$make'."
22050 elif test -f [Mm]akefile; then
22052 echo "Now you must run a $make."
22054 echo "Configure done."
22057 if $test -f Policy.sh; then
22060 If you compile $package on a different machine or from a different object
22061 directory, copy the Policy.sh file from this object directory to the
22062 new one before you run Configure -- this will help you with most of
22063 the policy defaults.
22067 if $test -f config.msg; then
22068 echo "Hmm. I also noted the following information while running:"
22070 $cat config.msg >&4
22073 $rm -f kit*isdone ark*isdone