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 # $Id: Head.U,v 3.0.1.9 1997/02/28 15:02:09 ram Exp $
23 # Generated on Fri Feb 15 01:22:14 EET 2002 [metaconfig 3.0 PL70]
24 # (with additional metaconfig patches by perlbug@perl.org)
29 SCO csh still thinks true is false. Write to SCO today and tell them that next
30 year Configure ought to "rm /bin/csh" unless they fix their blasted shell. :-)
32 (Actually, Configure ought to just patch csh in place. Hmm. Hmmmmm. All
33 we'd have to do is go in and swap the && and || tokens, wherever they are.)
35 [End of diatribe. We now return you to your regularly scheduled programming...]
39 OOPS! You naughty creature! You didn't run Configure with sh!
40 I will attempt to remedy the situation by running sh for you...
44 true || exec sh $0 $argv:q
46 (exit $?0) || cat c2$$
47 (exit $?0) || exec sh $0 $argv:q
50 : compute my invocation name
54 me=`echo $0 | sed -e 's!.*/\(.*\)!\1!' 2>/dev/null`
59 : Proper separator for the PATH environment variable
61 : On OS/2 this directory should exist if this is not floppy only system :-]
62 if test -d c:/. ; then
63 if test -n "$OS2_SHELL"; then
65 PATH=`cmd /c "echo %PATH%" | tr '\\\\' / `
66 OS2_SHELL=`cmd /c "echo %OS2_SHELL%" | tr '\\\\' / | tr '[A-Z]' '[a-z]'`
67 elif test -n "$DJGPP"; then
68 case "X${MACHTYPE:-nonesuchmach}" in
76 paths='/bin /usr/bin /usr/local/bin /usr/ucb /usr/local /usr/lbin'
77 paths="$paths /opt/bin /opt/local/bin /opt/local /opt/lbin"
78 paths="$paths /usr/5bin /etc /usr/gnu/bin /usr/new /usr/new/bin /usr/nbin"
79 paths="$paths /opt/gnu/bin /opt/new /opt/new/bin /opt/nbin"
80 paths="$paths /sys5.3/bin /sys5.3/usr/bin /bsd4.3/bin /bsd4.3/usr/ucb"
81 paths="$paths /bsd4.3/usr/bin /usr/bsd /bsd43/bin /usr/ccs/bin"
82 paths="$paths /etc /usr/lib /usr/ucblib /lib /usr/ccs/lib"
83 paths="$paths /sbin /usr/sbin /usr/libexec"
84 paths="$paths /system/gnu_library/bin"
90 *) test -d $p && PATH=$PATH$p_$p ;;
97 : shall we be using ksh?
103 if (PATH=.; alias -x) >/dev/null 2>&1; then
106 if test -f /hp-ux -a -f /bin/ksh; then
107 needksh='to avoid sh bug in "here document" expansion'
109 if test -d /usr/lpp -a -f /usr/bin/bsh -a -f /usr/bin/uname; then
110 if test X`/usr/bin/uname -v` = X4; then
111 avoidksh="to avoid AIX 4's /bin/sh"
115 if test -f /osf_boot -a -f /usr/sbin/setld; then
116 if test X`/usr/bin/uname -s` = XOSF1; then
117 avoidksh="to avoid Digital UNIX' ksh"
119 unset BIN_SH # if this is 'xpg4' sh will start up ksh
122 case "$inksh/$needksh" in
129 case "$inksh/$avoidksh" in
135 case "$inksh/$needksh-$avoidksh-" in
138 (I see you are using the Korn shell. Some ksh's blow up on $me,
139 mainly on older exotic systems. If yours does, try the Bourne shell instead.)
146 echo "(Feeding myself to $newsh $reason.)"
148 Configure|*/Configure) exec $newsh $0 "$@";;
149 *) exec $newsh Configure "$@";;
154 : if needed set CDPATH to a harmless value that is not chatty
155 : avoid bash 2.02 problems with empty CDPATH.
159 *bash*) CDPATH='.' ;;
164 : Configure runs within the UU subdirectory
165 test -d UU || mkdir UU
497 d_old_pthread_create_joinable=''
498 old_pthread_create_joinable=''
586 d_stdio_ptr_lval_nochange_cnt=''
587 d_stdio_ptr_lval_sets_cnt=''
772 inc_version_list_init=''
791 ignore_versioned_solibs=''
850 d_perl_otherlibdirs=''
864 version_patchlevel_string=''
869 d_nv_preserves_uv_bits=''
968 d_stdio_stream_array=''
969 stdio_stream_array=''
979 ccflags_uselargefiles=''
980 ldflags_uselargefiles=''
981 libswanted_uselargefiles=''
1001 installvendorarch=''
1027 smallmach='pdp11 i8086 z8000 i80286 iAPX286'
1030 : We must find out about Eunice early
1032 if test -f /etc/unixtovms; then
1033 eunicefix=/etc/unixtovms
1035 if test -f /etc/unixtovms.exe; then
1036 eunicefix=/etc/unixtovms.exe
1039 : Set executable suffix now -- needed before hints available
1041 if test -f "/system/gnu_library/bin/ar.pm"; then
1045 if test -n "$DJGPP"; then
1049 if test -d c:/. ; then
1057 : set useposix=false in your hint file to disable the POSIX extension.
1059 : set useopcode=false in your hint file to disable the Opcode extension.
1061 : Trailing extension. Override this in a hint file, if needed.
1062 : Extra object files, if any, needed on this platform.
1065 : Possible local include directories to search.
1066 : Set locincpth to "" in a hint file to defeat local include searches.
1067 locincpth="/usr/local/include /opt/local/include /usr/gnu/include"
1068 locincpth="$locincpth /opt/gnu/include /usr/GNU/include /opt/GNU/include"
1070 : no include file wanted by default
1075 : change the next line if compiling for Xenix/286 on Xenix/386
1076 xlibpth='/usr/lib/386 /lib/386'
1077 : Possible local library directories to search.
1078 loclibpth="/usr/local/lib /opt/local/lib /usr/gnu/lib"
1079 loclibpth="$loclibpth /opt/gnu/lib /usr/GNU/lib /opt/GNU/lib"
1081 : general looking path for locating libraries
1082 glibpth="/lib /usr/lib $xlibpth"
1083 glibpth="$glibpth /usr/ccs/lib /usr/ucblib /usr/local/lib"
1084 test -f /usr/shlib/libc.so && glibpth="/usr/shlib $glibpth"
1085 test -f /shlib/libc.so && glibpth="/shlib $glibpth"
1087 : Private path used by Configure to find libraries. Its value
1088 : is prepended to libpth. This variable takes care of special
1089 : machines, like the mips. Usually, it should be empty.
1092 : default library list
1094 : some systems want to use only the non-versioned libso:s
1095 ignore_versioned_solibs=''
1097 ccflags_uselargefiles=''
1098 ldflags_uselargefiles=''
1099 libswanted_uselargefiles=''
1100 : set usemultiplicity on the Configure command line to enable multiplicity.
1101 : set usesocks on the Configure command line to enable socks.
1102 : set usethreads on the Configure command line to enable threads.
1103 usereentrant='undef'
1104 : full support for void wanted by default
1107 : List of libraries we want.
1108 : If anyone needs -lnet, put it in a hint file.
1109 libswanted='sfio socket bind inet nsl nm ndbm gdbm dbm db malloc dl'
1110 libswanted="$libswanted dld ld sun m c cposix posix"
1111 libswanted="$libswanted ndir dir crypt sec"
1112 libswanted="$libswanted ucb bsd BSD PW x util"
1113 : We probably want to search /usr/shlib before most other libraries.
1114 : This is only used by the lib/ExtUtils/MakeMaker.pm routine extliblist.
1115 glibpth=`echo " $glibpth " | sed -e 's! /usr/shlib ! !'`
1116 glibpth="/usr/shlib $glibpth"
1117 : Do not use vfork unless overridden by a hint file.
1120 : Find the basic shell for Bourne shell scripts
1124 *bsd*|sys5*) xxx="/$SYSTYPE/bin/sh";;
1127 if test -f "$xxx"; then
1130 : Build up a list and do a single loop so we can 'break' out.
1131 pth=`echo $PATH | sed -e "s/$p_/ /g"`
1132 for xxx in sh bash ksh pdksh ash; do
1134 try="$try ${p}/${xxx}"
1138 if test -f "$xxx"; then
1141 elif test "X$_exe" != X -a -f "$xxx$_exe"; then
1144 elif test -f "$xxx.exe"; then
1155 $me: Fatal Error: I can't find a Bourne Shell anywhere.
1157 Usually it's in /bin/sh. How did you even get this far?
1158 Please contact me (Perl Maintainers) at perlbug@perl.org and
1159 we'll try to straighten this all out.
1165 : see if sh knows # comments
1166 if `$sh -c '#' >/dev/null 2>&1`; then
1170 test -f $xcat$_exe || xcat=/usr/bin/cat
1171 if test ! -f $xcat$_exe; then
1172 for p in `echo $PATH | sed -e "s/$p_/ /g"` $paths; do
1173 if test -f $p/cat$_exe; then
1178 if test ! -f $xcat$_exe; then
1179 echo "Can't find cat anywhere!"
1183 echo "#!$xcat" >sharp
1187 if test -s today; then
1190 echo "#! $xcat" > sharp
1194 if test -s today; then
1202 echo "Your $sh doesn't grok # comments--I will strip them later on."
1205 echo "exec grep -v '^[ ]*#'" >spitshell
1207 $eunicefix spitshell
1208 spitshell=`pwd`/spitshell
1210 echo "I presume that if # doesn't work, #! won't work either!"
1215 : figure out how to guarantee sh startup
1217 '') startsh=${sharpbang}${sh} ;;
1229 : echo "Yup, it does."
1231 echo "Hmm... '$startsh' does not guarantee sh startup..."
1232 echo "You may have to fix up the shell scripts to make sure $sh runs them."
1237 : Save command line options in file UU/cmdline.opt for later use in
1238 : generating config.sh.
1239 cat > cmdline.opt <<EOSH
1240 # Configure command line arguments.
1249 cat >>cmdline.opt <<EOSH
1250 config_arg$argn='$arg'
1252 # Extreme backslashitis: replace each ' by '"'"'
1253 cat <<EOC | sed -e "s/'/'"'"'"'"'"'"'/g" > cmdl.opt
1256 arg_exp=`cat cmdl.opt`
1257 args_exp="$args_exp$args_sep'$arg_exp'"
1258 argn=`expr $argn + 1`
1261 # args_exp is good for restarting self: eval "set X $args_exp"; shift; $0 "$@"
1262 # used by ./hints/os2.sh
1265 : produce awk script to parse command line options
1266 cat >options.awk <<'EOF'
1268 optstr = "A:dD:eEf:hKOrsSU:V"; # getopt-style specification
1270 len = length(optstr);
1271 for (i = 1; i <= len; i++) {
1272 c = substr(optstr, i, 1);
1273 if (i < len) a = substr(optstr, i + 1, 1); else a = "";
1284 if (substr(str, 1, 1) != "-") {
1285 printf("'%s'\n", str);
1289 for (i = 2; i <= len; i++) {
1290 c = substr(str, i, 1);
1292 printf("-%s\n", substr(str, i));
1298 printf("'%s'\n", substr(str, i + 1));
1311 : process the command line options
1312 set X `for arg in "$@"; do echo "X$arg"; done |
1313 sed -e s/X// | awk -f options.awk`
1318 : set up default values
1328 rm -f optdef.sh posthint.sh
1329 cat >optdef.sh <<EOS
1335 while test $# -gt 0; do
1337 -d) shift; fastread=yes;;
1338 -e) shift; alldone=cont;;
1342 if test -r "$1"; then
1345 echo "$me: cannot read config file $1." >&2
1350 -h) shift; error=true;;
1351 -r) shift; reuseval=true;;
1352 -s) shift; silent=true; realsilent=true;;
1353 -E) shift; alldone=exit;;
1354 -K) shift; knowitall=true;;
1355 -O) shift; override=true;;
1356 -S) shift; silent=true; extractsh=true;;
1361 echo "$me: use '-U symbol=', not '-D symbol='." >&2
1362 echo "$me: ignoring -D $1" >&2
1365 sed -e "s/'/'\"'\"'/g" -e "s/=\(.*\)/='\1'/" >> optdef.sh;;
1366 *) echo "$1='define'" >> optdef.sh;;
1373 *=) echo "$1" >> optdef.sh;;
1375 echo "$me: use '-D symbol=val', not '-U symbol=val'." >&2
1376 echo "$me: ignoring -U $1" >&2
1378 *) echo "$1='undef'" >> optdef.sh;;
1389 *=*) zzz=`echo $yyy|sed 's!=.*!!'`
1393 zzz=" "`echo $yyy|sed 's!^[^=]*=!!'`
1394 yyy=`echo $yyy|sed 's!=.*!!'` ;;
1400 *:*) xxx=`echo $yyy|sed 's!:.*!!'`
1401 yyy=`echo $yyy|sed 's!^[^:]*:!!'`
1402 zzz=`echo $yyy|sed 's!^[^=]*=!!'`
1403 yyy=`echo $yyy|sed 's!=.*!!'` ;;
1404 *) xxx=`echo $yyy|sed 's!:.*!!'`
1405 yyy=`echo $yyy|sed 's!^[^:]*:!!'` ;;
1411 echo "$yyy=\"\${$yyy}$zzz\"" >> posthint.sh ;;
1413 echo "$yyy=''" >> posthint.sh ;;
1418 echo "$yyy='$zzz'" >> posthint.sh ;;
1420 echo "eval \"$yyy=$zzz\"" >> posthint.sh ;;
1422 echo "$yyy=\"$zzz\${$yyy}\"" >> posthint.sh ;;
1427 echo "$yyy=$zzz" >> posthint.sh ;;
1428 *) echo "$me: unknown -A command '$xxx', ignoring -A $1" >&2 ;;
1432 -V) echo "$me generated by metaconfig 3.0 PL70." >&2
1435 -*) echo "$me: unknown option $1" >&2; shift; error=true;;
1443 Usage: $me [-dehrsEKOSV] [-f config.sh] [-D symbol] [-D symbol=value]
1444 [-U symbol] [-U symbol=] [-A command:symbol...]
1445 -d : use defaults for all answers.
1446 -e : go on without questioning past the production of config.sh.
1447 -f : specify an alternate default configuration file.
1448 -h : print this help message and exit (with an error status).
1449 -r : reuse C symbols value if possible (skips costly nm extraction).
1450 -s : silent mode, only echoes questions and essential information.
1451 -D : define symbol to have some value:
1452 -D symbol symbol gets the value 'define'
1453 -D symbol=value symbol gets the value 'value'
1454 -E : stop at the end of questions, after having produced config.sh.
1455 -K : do not use unless you know what you are doing.
1456 -O : let -D and -U override definitions from loaded configuration file.
1457 -S : perform variable substitutions on all .SH files (can mix with -f)
1458 -U : undefine symbol:
1459 -U symbol symbol gets the value 'undef'
1460 -U symbol= symbol gets completely empty
1461 -A : manipulate symbol after the platform specific hints have been applied:
1462 -A symbol=value append " "value to symbol
1463 -A append:symbol=value append value to symbol
1464 -A define:symbol=value define symbol to have value
1465 -A clear:symbol define symbol to be ''
1466 -A define:symbol define symbol to be 'define'
1467 -A eval:symbol=value define symbol to be eval of value
1468 -A prepend:symbol=value prepend value to symbol
1469 -A undef:symbol define symbol to be 'undef'
1470 -A undef:symbol= define symbol to be ''
1471 -V : print version number and exit (with a zero status).
1478 case "$fastread$alldone" in
1481 case "$extractsh" in
1484 if test ! -t 0; then
1485 echo "Say 'sh Configure', not 'sh <Configure'"
1495 true) exec 1>/dev/null;;
1498 : run the defines and the undefines, if any, but leave the file out there...
1501 : create the posthint manipulation script and leave the file out there...
1506 first=`echo $package | sed -e 's/^\(.\).*/\1/'`
1507 last=`echo $package | sed -e 's/^.\(.*\)/\1/'`
1508 case "`echo AbyZ | tr '[:lower:]' '[:upper:]' 2>/dev/null`" in
1509 ABYZ) spackage=`echo $first | tr '[:lower:]' '[:upper:]'`$last;;
1510 *) spackage=`echo $first | tr '[a-z]' '[A-Z]'`$last;;
1513 : Some greps do not return status, grrr.
1514 echo "grimblepritz" >grimble
1515 if grep blurfldyick grimble >/dev/null 2>&1 ; then
1517 elif grep grimblepritz grimble >/dev/null 2>&1 ; then
1523 : the following should work in any shell
1527 echo "AGH! Grep doesn't return a status. Attempting remedial action."
1528 cat >contains <<'EOSS'
1529 grep "$1" "$2" >.greptmp && cat .greptmp && test -s .greptmp
1534 : Find the path to the source tree
1537 */*) src=`echo $0 | sed -e 's%/[^/][^/]*$%%'`
1541 *) src=`cd ../$src && pwd` ;;
1554 if test -f $rsrc/Configure && \
1555 $contains "^package=$package$" $rsrc/Configure >/dev/null 2>&1
1557 : found it, so we are ok.
1560 for src in . .. ../.. ../../.. ../../../..; do
1561 if test -f ../$src/Configure && \
1562 $contains "^package=$package$" ../$src/Configure >/dev/null 2>&1
1573 Sorry, I can't seem to locate the source dir for $package. Please start
1574 Configure with an explicit path -- i.e. /some/path/Configure.
1582 echo "Sources for $package found in \"$src\"." >&4
1586 : script used to extract .SH files with variable substitutions
1587 cat >extract <<'EOS'
1589 echo "Doing variable substitutions on .SH files..."
1590 if test -f MANIFEST; then
1591 set x `awk '{print $1}' < MANIFEST | grep '\.SH$'`
1593 echo "(Looking for .SH files under the source directory.)"
1594 set x `(cd "$src"; find . -name "*.SH" -print)`
1598 0) set x `(cd "$src"; echo *.SH)`; shift;;
1600 if test ! -f "$src/$1"; then
1606 while test $name; do
1607 if test ! -d "$name"; then
1608 create="$name $create";
1609 name=`echo $name | sed -e "s|^[^/]*$||"`;
1610 name=`echo $name | sed -e "s|\(.*\)/.*|\1|"`;
1615 for file in $create; do
1624 dir=`expr X$file : 'X\(.*\)/'`
1625 file=`expr X$file : 'X.*/\(.*\)'`
1626 (cd "$dir" && . ./$file)
1636 dir=`expr X$file : 'X\(.*\)/'`
1637 file=`expr X$file : 'X.*/\(.*\)'`
1638 (set x $dir; shift; eval $mkdir_p)
1639 sh <"$src/$dir/$file"
1648 if test -f "$src/config_h.SH"; then
1649 if test ! -f config.h; then
1650 : oops, they left it out of MANIFEST, probably, so do it anyway.
1651 . "$src/config_h.SH"
1656 : extract files and exit if asked to do so
1657 case "$extractsh" in
1659 case "$realsilent" in
1663 case "$config_sh" in
1664 '') config_sh='config.sh';;
1667 echo "Fetching answers from $config_sh..."
1670 test "$override" && . ./optdef.sh
1674 echo "Extraction done."
1679 : Eunice requires " " instead of "", can you believe it
1682 echo "Beginning of configuration questions for $package."
1684 trap 'echo " "; test -d ../UU && rm -rf X $rmlist; exit 1' 1 2 3 15
1686 : first determine how to suppress newline on echo command
1688 echo "Checking echo to see how to suppress newlines..."
1689 (echo "hi there\c" ; echo " ") >.echotmp
1690 if $contains c .echotmp >/dev/null 2>&1 ; then
1701 echo $n "The star should be here-->$c"
1705 : Now test for existence of everything in MANIFEST
1707 if test -f "$rsrc/MANIFEST"; then
1708 echo "First let's make sure your kit is complete. Checking..." >&4
1709 awk '$1 !~ /PACK[A-Z]+/ {print $1}' "$rsrc/MANIFEST" | split -50
1712 for filelist in x??; do
1713 (cd "$rsrc"; ls `cat "$tmppwd/$filelist"` >/dev/null 2>>"$tmppwd/missing")
1715 if test -s missing; then
1719 THIS PACKAGE SEEMS TO BE INCOMPLETE.
1721 You have the option of continuing the configuration process, despite the
1722 distinct possibility that your kit is damaged, by typing 'y'es. If you
1723 do, don't blame me if something goes wrong. I advise you to type 'n'o
1724 and contact the author (perlbug@perl.org).
1727 echo $n "Continue? [n] $c" >&4
1731 echo "Continuing..." >&4
1735 echo "ABORTING..." >&4
1740 echo "Looks good..."
1743 echo "There is no MANIFEST file. I hope your kit is complete !"
1748 : Find the appropriate value for a newline for tr
1749 if test -n "$DJGPP"; then
1752 if test X"$trnl" = X; then
1753 case "`echo foo|tr '\n' x 2>/dev/null`" in
1757 if test X"$trnl" = X; then
1758 case "`echo foo|tr '\012' x 2>/dev/null`" in
1759 foox) trnl='\012' ;;
1762 if test X"$trnl" = X; then
1765 $me: Fatal Error: cannot figure out how to translate newlines with 'tr'.
1771 : compute the number of columns on the terminal for proper question formatting
1776 : set up the echo used in my read
1777 myecho="case \"\$xxxm\" in
1778 '') echo $n \"\$rp $c\" >&4;;
1780 '') echo $n \"[\$xxxm] $c\";;
1782 if test \`echo \"\$rp [\$xxxm] \" | wc -c\` -ge $COLUMNS; then
1784 echo $n \"[\$xxxm] $c\" >&4
1786 echo $n \"\$rp [\$xxxm] $c\" >&4
1792 : now set up to do reads with possible shell escape and default assignment
1798 case "\$fastread" in
1799 yes) case "\$dflt" in
1802 case "\$silent-\$rp" in
1807 *) case "\$silent" in
1808 true) case "\$rp" in
1813 while expr "X\$ans" : "X!" >/dev/null; do
1817 aok=''; eval "ans=\\"\$answ\\"" && aok=y
1825 set x \`expr "X\$ans" : "X!\(.*\)\$"\`
1834 set x \`expr "X\$ans" : "X&\(.*\)\$"\`
1839 echo "(OK, I'll run with -d after this question.)" >&4
1842 echo "*** Sorry, \$1 not supported yet." >&4
1852 echo "*** Substitution done -- please confirm."
1854 ans=\`echo $n "\$ans$c" | tr '$trnl' ' '\`
1859 echo "*** Error -- try again."
1866 case "\$ans\$xxxm\$nostick" in
1878 : create .config dir to save info across Configure sessions
1879 test -d ../.config || mkdir ../.config
1880 cat >../.config/README <<EOF
1881 This directory created by Configure to save information that should
1882 persist across sessions for $package.
1884 You may safely delete it if you wish.
1887 xversion=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
1889 $define|true|[yY]*) ;;
1890 *) case "$xversion" in
1893 *** WHOA THERE!!! ***
1895 This is an UNSTABLE DEVELOPMENT release.
1896 The version of this $package distribution is $xversion, that is, odd,
1897 (as opposed to even) and that signifies a development release.
1898 If you want a maintenance release, you want an even-numbered version.
1900 Do ***NOT*** install this into production use.
1901 Data corruption and crashes are possible.
1903 It is most seriously suggested that you do not continue any further
1904 unless you want to help in developing and debugging Perl.
1906 If you *still* want to build perl, you can answer 'y' now,
1907 or pass -Dusedevel to Configure.
1910 rp='Do you really want to continue?'
1914 [yY]) echo >&4 "Okay, continuing."
1915 usedevel="$define" ;;
1916 *) echo >&4 "Okay, bye."
1926 case "$versiononly" in
1927 '') versiononly="$define" ;;
1929 case "$installusrbinperl" in
1930 '') installusrbinperl="$undef" ;;
1935 : general instructions
1938 user=`(logname) 2>/dev/null`
1940 '') user=`whoami 2>&1`;;
1942 if $contains "^$user\$" ../.config/instruct >/dev/null 2>&1; then
1945 rp='Would you like to see the instructions?'
1956 This installation shell script will examine your system and ask you questions
1957 to determine how the perl5 package should be installed. If you get
1958 stuck on a question, you may use a ! shell escape to start a subshell or
1959 execute a command. Many of the questions will have default answers in square
1960 brackets; typing carriage return will give you the default.
1962 On some of the questions which ask for file or directory names you are allowed
1963 to use the ~name construct to specify the login directory belonging to "name",
1964 even if you don't have a shell which knows about that. Questions where this is
1965 allowed will be marked "(~name ok)".
1969 dflt='Type carriage return to continue'
1973 The prompter used in this script allows you to use shell variables and
1974 backticks in your answers. You may use $1, $2, etc... to refer to the words
1975 in the default answer, as if the default line was a set of arguments given to a
1976 script shell. This means you may also use $* to repeat the whole default line,
1977 so you do not have to re-type everything to add something to the default.
1979 Everytime there is a substitution, you will have to confirm. If there is an
1980 error (e.g. an unmatched backtick), the default answer will remain unchanged
1981 and you will be prompted again.
1983 If you are in a hurry, you may run 'Configure -d'. This will bypass nearly all
1984 the questions and use the computed defaults (or the previous answers if there
1985 was already a config.sh file). Type 'Configure -h' for a list of options.
1986 You may also start interactively and then answer '& -d' at any prompt to turn
1987 on the non-interactive behaviour for the remainder of the execution.
1993 Much effort has been expended to ensure that this shell script will run on any
1994 Unix system. If despite that it blows up on yours, your best bet is to edit
1995 Configure and run it again. If you can't run Configure for some reason,
1996 you'll have to generate a config.sh file by hand. Whatever problems you
1997 have, let me (perlbug@perl.org) know how I blew it.
1999 This installation script affects things in two ways:
2001 1) it may do direct variable substitutions on some of the files included
2003 2) it builds a config.h file for inclusion in C programs. You may edit
2004 any of these files as the need arises after running this script.
2006 If you make a mistake on a question, there is no easy way to back up to it
2007 currently. The easiest thing to do is to edit config.sh and rerun all the SH
2008 files. Configure will offer to let you do this before it runs the SH files.
2011 dflt='Type carriage return to continue'
2013 case "$firsttime" in
2014 true) echo $user >>../.config/instruct;;
2018 : find out where common programs are
2020 echo "Locating common programs..." >&4
2033 if test -d \$dir/\$thing; then
2039 for thisthing in \$dir/\$thing; do
2040 : just loop through to pick last item
2042 if test -f \$thisthing; then
2045 elif test "X$_exe" != X -a -f \$thisthing$_exe; then
2048 elif test -f \$dir/\$thing.exe; then
2049 if test -n "$DJGPP"; then
2050 echo \$dir/\$thing.exe
2052 : on Eunice apparently
2105 pth=`echo $PATH | sed -e "s/$p_/ /g"`
2106 pth="$pth /lib /usr/lib"
2107 for file in $loclist; do
2111 if test -f "$xxx"; then
2114 echo "WARNING: no $xxx -- ignoring your setting for $file." >&4
2115 xxx=`./loc $file $file $pth`
2118 '') xxx=`./loc $file $file $pth`;;
2119 *) xxx=`./loc $xxx $xxx $pth`;;
2121 eval $file=$xxx$_exe
2125 echo $file is in $xxx.
2128 echo $file is in $xxx.
2131 echo "I don't know where '$file' is, and my life depends on it." >&4
2132 echo "Go find a public domain implementation or fix your PATH setting!" >&4
2138 echo "Don't worry if any of the following aren't found..."
2140 for file in $trylist; do
2144 if test -f "$xxx"; then
2147 echo "WARNING: no $xxx -- ignoring your setting for $file." >&4
2148 xxx=`./loc $file $file $pth`
2151 '') xxx=`./loc $file $file $pth`;;
2152 *) xxx=`./loc $xxx $xxx $pth`;;
2154 eval $file=$xxx$_exe
2158 echo $file is in $xxx.
2161 echo $file is in $xxx.
2164 echo "I don't see $file out there, $say."
2171 echo "Substituting grep for egrep."
2178 echo "Substituting cp for ln."
2187 echo "I can't find make or gmake, and my life depends on it." >&4
2188 echo "Go find a public domain implementation or fix your PATH setting!" >&4
2196 *) # We can't have osname yet.
2197 if test -f "/system/gnu_library/bin/ar.pm"; then # Stratus VOS
2198 # Assume that gmake, if found, is definitely GNU make
2199 # and prefer it over the system make.
2200 echo "Substituting gmake for make."
2208 echo "Hopefully test is built into your sh."
2211 if `sh -c "PATH= test true" >/dev/null 2>&1`; then
2212 echo "Using the test built into your sh."
2220 echo "Hopefully echo is built into your sh."
2225 echo "Checking compatibility between $echo and builtin echo (if any)..." >&4
2226 $echo $n "hi there$c" >foo1
2227 echo $n "hi there$c" >foo2
2228 if cmp foo1 foo2 >/dev/null 2>&1; then
2229 echo "They are compatible. In fact, they may be identical."
2236 They are not compatible! You are probably running ksh on a non-USG system.
2237 I'll have to use $echo instead of the builtin, since Bourne shell doesn't
2238 have echo built in and we may have to run some Bourne shell scripts. That
2239 means I'll have to use '$n$c' to suppress newlines now. Life is ridiculous.
2242 $echo $n "The star should be here-->$c"
2252 cat <<'EOSC' >>checkcc
2257 int main(int argc, char *argv[]) {
2261 if $cc -o try $ccflags $ldflags try.c; then
2264 echo "Uh-oh, the C compiler '$cc' doesn't seem to be working." >&4
2270 case "`$cc -v -c try.c 2>&1`" in
2273 if $test X"$trygcc" = Xyes; then
2274 if gcc -o try -c try.c; then
2276 echo "You seem to have a working gcc, though." >&4
2277 rp="Would you like to use it?"
2279 if $test -f myread; then
2282 if $test -f UU/myread; then
2285 echo "Cannot find myread, sorry. Aborting." >&2
2290 [yY]*) cc=gcc; ccname=gcc; ccflags=''; despair=no ;;
2294 if $test X"$despair" = Xyes; then
2296 You need to find a working C compiler.
2297 Either (purchase and) install the C compiler supplied by your OS vendor,
2298 or for a free C compiler try http://gcc.gnu.org/
2299 I cannot continue any further, aborting.
2309 : determine whether symbolic links are supported
2312 if $ln -s blurfl sym > /dev/null 2>&1 ; then
2313 echo "Symbolic links are supported." >&4
2316 echo "Symbolic links are NOT supported." >&4
2321 : determine whether symbolic links are supported
2325 echo "Checking how to test for symbolic links..." >&4
2327 if $test "X$issymlink" = X; then
2329 '') sh -c "PATH= test -h sym" >/dev/null 2>&1 ;;
2330 *) $newsh -c "PATH= test -h sym" >/dev/null 2>&1 ;;
2332 if test $? = 0; then
2335 echo "Your builtin 'test -h' may be broken." >&4
2338 *) pth=`echo $PATH | sed -e "s/$p_/ /g"`
2341 if test -f "$p/$test"; then
2350 echo "Trying external '$test -h'." >&4
2351 issymlink="$test -h"
2352 if $test ! -h sym >/dev/null 2>&1; then
2353 echo "External '$test -h' is broken, too." >&4
2361 if $test "X$issymlink" = X; then
2362 if $test -L sym 2>/dev/null; then
2363 issymlink="$test -L"
2364 echo "The builtin '$test -L' worked." >&4
2367 if $test "X$issymlink" != X; then
2368 echo "You can test for symbolic links with '$issymlink'." >&4
2370 echo "I do not know how you can test for symbolic links." >&4
2374 *) echo "No symbolic links, so not testing for their testing..." >&4
2380 case "$mksymlinks" in
2383 ''|'.') echo "Cannot create symlinks in the original directory." >&4
2386 *) case "$lns:$issymlink" in
2387 *"ln -s:"*"test -"?)
2388 echo "Creating the symbolic links..." >&4
2389 echo "(First creating the subdirectories...)" >&4
2391 awk '{print $1}' $src/MANIFEST | grep / | sed 's:/[^/]*$::' | sort -u | while true; do
2393 test -z "$directory" && break
2397 if test ! -d t/base; then
2398 echo "Failed to create the subdirectories. Aborting." >&4
2401 echo "(Then creating the symlinks...)" >&4
2402 awk '{print $1}' $src/MANIFEST | while true; do
2404 test -z "$filename" && break
2405 if test -f $filename; then
2406 if $issymlink $filename; then
2410 if test -f $filename; then
2411 echo "$filename already exists, not symlinking."
2413 ln -s $src/$filename $filename
2417 if test ! -f t/base/lex.t; then
2418 echo "Failed to create the symlinks (t/base/lex.t missing). Aborting." >&4
2423 *) echo "(I cannot figure out how to do symbolic links, ignoring mksymlinks)." >&4
2432 case "$usecrosscompile" in
2434 $echo "Cross-compiling..."
2437 *-*-gcc) # A cross-compiling gcc, probably.
2438 targetarch=`$echo $cc|$sed 's/-gcc$//'`
2440 # leave out ld, choosing it is more complex
2442 ranlib=$targetarch-ranlib
2443 $echo 'extern int foo;' > try.c
2444 set X `$cc -v -E try.c 2>&1 | $awk '/^#include </,/^End of search /'|$grep '/include'`
2446 if $test $# -gt 0; then
2448 incpth="`$echo $incpth|$sed 's/^ //'`"
2449 echo "Guessing incpth '$incpth'." >&4
2451 j="`$echo $i|$sed 's,/include$,/lib,'`"
2452 if $test -d $j; then
2456 libpth="`$echo $libpth|$sed 's/^ //'`"
2457 echo "Guessing libpth '$libpth'." >&4
2462 case "$targetarch" in
2463 '') echo "Targetarch not defined." >&4; croak=y ;;
2464 *) echo "Using targetarch $targetarch." >&4 ;;
2467 '') echo "Incpth not defined." >&4; croak=y ;;
2468 *) echo "Using incpth '$incpth'." >&4 ;;
2471 '') echo "Libpth not defined." >&4; croak=y ;;
2472 *) echo "Using libpth '$libpth'." >&4 ;;
2475 '') for i in $incpth; do
2476 if $test -f $i/errno.h -a -f $i/stdio.h -a -f $i/time.h; then
2478 echo "Guessing usrinc $usrinc." >&4
2483 '') echo "Usrinc not defined." >&4; croak=y ;;
2486 *) echo "Using usrinc $usrinc." >&4 ;;
2488 case "$targethost" in
2489 '') echo "Targethost not defined." >&4; croak=y ;;
2490 *) echo "Using targethost $targethost." >&4
2495 y) echo "Cannot continue, aborting." >&4; exit 1 ;;
2498 /*) run=$src/Cross/run
2499 targetmkdir=$src/Cross/mkdir
2501 from=$src/Cross/from
2503 *) pwd=`$test -f ../Configure & cd ..; pwd`
2505 targetmkdir=$pwd/Cross/mkdir
2507 from=$pwd/Cross/from
2510 case "$targetrun" in
2511 '') targetrun=ssh ;;
2516 case "$targetfrom" in
2517 '') targetfrom=scp ;;
2521 from=$from-$targetfrom
2522 case "$targetdir" in
2524 echo "Guessing targetdir $targetdir." >&4
2527 case "$targetuser" in
2529 echo "Guessing targetuser $targetuser." >&4
2532 case "$targetfrom" in
2536 case "$targetrun" in
2548 '') cwd=$targetdir ;;
2552 if $test ! -f \$exe.xok; then
2556 $targetrun -l $targetuser $targethost "cd \$cwd && ./\$exe \$@"
2559 *) echo "Unknown targetrun '$targetrun'" >&4
2563 case "$targetmkdir" in
2565 cat >$targetmkdir <<EOF
2567 $targetrun -l $targetuser $targethost "mkdir -p \$@"
2569 $chmod a+rx $targetmkdir
2571 *) echo "Unknown targetmkdir '$targetmkdir'" >&4
2583 $targetmkdir \`dirname \$f\`
2584 $targetto $q \$f $targetuser@$targethost:\$f || exit 1
2587 $targetmkdir $targetdir/\`dirname \$f\`
2588 $targetto $q \$f $targetuser@$targethost:$targetdir/\$f || exit 1
2601 $mkdir -p $targetdir/\`dirname \$f\`
2602 $cp \$f $targetdir/\$f || exit 1
2605 $targetmkdir $targetdir/\`dirname \$f\`
2606 $cp \$f $targetdir/\$f || exit 1
2613 *) echo "Unknown targetto '$targetto'" >&4
2617 case "$targetfrom" in
2624 $targetfrom $q $targetuser@$targethost:$targetdir/\$f . || exit 1
2629 cp) cat >$from <<EOF
2634 cp $targetdir/\$f . || exit 1
2639 *) echo "Unknown targetfrom '$targetfrom'" >&4
2643 if $test ! -f $run; then
2644 echo "Target 'run' script '$run' not found." >&4
2648 if $test ! -f $to; then
2649 echo "Target 'to' script '$to' not found." >&4
2653 if $test ! -f $from; then
2654 echo "Target 'from' script '$from' not found." >&4
2658 if $test ! -f $run -o ! -f $to -o ! -f $from; then
2662 Using '$run' for remote execution,
2663 and '$from' and '$to'
2664 for remote file transfer.
2670 usecrosscompile='undef'
2675 : see whether [:lower:] and [:upper:] are supported character classes
2677 case "`echo AbyZ | $tr '[:lower:]' '[:upper:]' 2>/dev/null`" in
2679 echo "Good, your tr supports [:lower:] and [:upper:] to convert case." >&4
2683 *) # There is a discontinuity in EBCDIC between 'I' and 'J'
2684 # (0xc9 and 0xd1), therefore that is a nice testing point.
2685 if test "X$up" = X -o "X$low" = X; then
2686 case "`echo IJ | $tr '[I-J]' '[i-j]' 2>/dev/null`" in
2692 if test "X$up" = X -o "X$low" = X; then
2693 case "`echo IJ | $tr I-J i-j 2>/dev/null`" in
2699 if test "X$up" = X -o "X$low" = X; then
2700 case "`echo IJ | od -x 2>/dev/null`" in
2702 echo "Hey, this might be EBCDIC." >&4
2703 if test "X$up" = X -o "X$low" = X; then
2704 case "`echo IJ | $tr '[A-IJ-RS-Z]' '[a-ij-rs-z]' 2>/dev/null`" in
2705 ij) up='[A-IJ-RS-Z]'
2710 if test "X$up" = X -o "X$low" = X; then
2711 case "`echo IJ | $tr A-IJ-RS-Z a-ij-rs-z 2>/dev/null`" in
2721 case "`echo IJ | $tr \"$up\" \"$low\" 2>/dev/null`" in
2723 echo "Using $up and $low to convert case." >&4
2726 echo "I don't know how to translate letters from upper to lower case." >&4
2727 echo "Your tr is not acting any way I know of." >&4
2731 : set up the translation script tr, must be called with ./tr of course
2735 '[A-Z][a-z]') exec $tr '$up' '$low';;
2736 '[a-z][A-Z]') exec $tr '$low' '$up';;
2743 : Try to determine whether config.sh was made on this system
2744 case "$config_sh" in
2746 myuname=`$uname -a 2>/dev/null`
2747 $test -z "$myuname" && myuname=`hostname 2>/dev/null`
2748 # tr '[A-Z]' '[a-z]' would not work in EBCDIC
2749 # because the A-Z/a-z are not consecutive.
2750 myuname=`echo $myuname | $sed -e 's/^[^=]*=//' -e 's/\///g' | \
2751 ./tr '[A-Z]' '[a-z]' | $tr $trnl ' '`
2752 newmyuname="$myuname"
2754 case "$knowitall" in
2756 if test -f ../config.sh; then
2757 if $contains myuname= ../config.sh >/dev/null 2>&1; then
2758 eval "`grep myuname= ../config.sh`"
2760 if test "X$myuname" = "X$newmyuname"; then
2768 : Get old answers from old config file if Configure was run on the
2769 : same system, otherwise use the hints.
2772 if test -f config.sh; then
2774 rp="I see a config.sh file. Shall I use it to set the defaults?"
2777 n*|N*) echo "OK, I'll ignore it."
2778 mv config.sh config.sh.old
2779 myuname="$newmyuname"
2781 *) echo "Fetching default answers from your old config.sh file..." >&4
2789 : Older versions did not always set $sh. Catch re-use of such
2799 if test ! -f config.sh; then
2802 First time through, eh? I have some defaults handy for some systems
2803 that need some extra help getting the Configure answers right:
2806 (cd $src/hints; ls -C *.sh) | $sed 's/\.sh/ /g' >&4
2808 : Half the following guesses are probably wrong... If you have better
2809 : tests or hints, please send them to perlbug@perl.org
2810 : The metaconfig authors would also appreciate a copy...
2811 $test -f /irix && osname=irix
2812 $test -f /xenix && osname=sco_xenix
2813 $test -f /dynix && osname=dynix
2814 $test -f /dnix && osname=dnix
2815 $test -f /lynx.os && osname=lynxos
2816 $test -f /unicos && osname=unicos && osvers=`$uname -r`
2817 $test -f /unicosmk && osname=unicosmk && osvers=`$uname -r`
2818 $test -f /unicosmk.ar && osname=unicosmk && osvers=`$uname -r`
2819 $test -f /bin/mips && /bin/mips && osname=mips
2820 $test -d /NextApps && set X `hostinfo | grep 'NeXT Mach.*:' | \
2821 $sed -e 's/://' -e 's/\./_/'` && osname=next && osvers=$4
2822 $test -d /usr/apollo/bin && osname=apollo
2823 $test -f /etc/saf/_sactab && osname=svr4
2824 $test -d /usr/include/minix && osname=minix
2825 $test -f /system/gnu_library/bin/ar.pm && osname=vos
2826 if $test -d /MachTen -o -d /MachTen_Folder; then
2828 if $test -x /sbin/version; then
2829 osvers=`/sbin/version | $awk '{print $2}' |
2830 $sed -e 's/[A-Za-z]$//'`
2831 elif $test -x /usr/etc/version; then
2832 osvers=`/usr/etc/version | $awk '{print $2}' |
2833 $sed -e 's/[A-Za-z]$//'`
2839 $test -f /sys/posix.dll &&
2840 $test -f /usr/bin/what &&
2841 set X `/usr/bin/what /sys/posix.dll` &&
2842 $test "$3" = UWIN &&
2846 if $test -f $uname; then
2854 umips) osname=umips ;;
2857 [23]100) osname=mips ;;
2858 next*) osname=next ;;
2860 tmp=`/bin/uname -X 2>/dev/null|awk '/3\.2v[45]/{ print $(NF) }'`
2861 if $test "$tmp" != "" -a "$3" = "3.2" -a -f '/etc/systemid'; then
2864 elif $test -f /etc/kconfig; then
2866 if test "$lns" = "$ln -s"; then
2868 elif $contains _SYSV3 /usr/include/stdio.h > /dev/null 2>&1 ; then
2870 elif $contains _POSIX_SOURCE /usr/include/stdio.h > /dev/null 2>&1 ; then
2877 if test -n "$DJGPP"; then
2886 tmp=`( (oslevel) 2>/dev/null || echo "not found") 2>&1`
2888 'not found') osvers="$4"."$3" ;;
2889 '<3240'|'<>3240') osvers=3.2.0 ;;
2890 '=3240'|'>3240'|'<3250'|'<>3250') osvers=3.2.4 ;;
2891 '=3250'|'>3250') osvers=3.2.5 ;;
2895 bsd386) osname=bsd386
2898 cygwin*) osname=cygwin
2901 *dc.osx) osname=dcosx
2907 domainos) osname=apollo
2913 dynixptx*) osname=dynixptx
2914 osvers=`echo "$4"|sed 's/^v//'`
2916 freebsd) osname=freebsd
2918 genix) osname=genix ;;
2920 osvers=`echo "$3" | $sed 's,.*\.\([0-9]*\.[0-9]*\),\1,'`
2936 netbsd*) osname=netbsd
2939 news-os) osvers="$3"
2941 4*) osname=newsos4 ;;
2945 next*) osname=next ;;
2946 nonstop-ux) osname=nonstopux ;;
2947 POSIX-BC | posix-bc ) osname=posix-bc
2950 powerux | power_ux | powermax_os | powermaxos | \
2951 powerunix | power_unix) osname=powerux
2957 solaris) osname=solaris
2959 5*) osvers=`echo $3 | $sed 's/^5/2/g'` ;;
2966 osvers=`echo $3 | $sed 's/^5/2/g'` ;;
2970 titanos) osname=titanos
2979 ultrix) osname=ultrix
2982 osf1|mls+) case "$5" in
2985 osvers=`sizer -v | awk '{print $3}' | tr '[A-Z]' '[a-z]' | sed 's/^[xvt]//'`
2988 *) osvers=`echo "$3" | sed 's/^[xvt]//'` ;;
2991 hp*) osname=hp_osf1 ;;
2992 mips) osname=mips_osf1 ;;
2995 unixware) osname=svr5
3003 $2) case "$osname" in
3007 : svr4.x or possibly later
3017 if test -f /stand/boot ; then
3018 eval `grep '^INITPROG=[a-z/0-9]*$' /stand/boot`
3019 if test -n "$INITPROG" -a -f "$INITPROG"; then
3020 isesix=`strings -a $INITPROG|grep 'ESIX SYSTEM V/386 Release 4.0'`
3021 if test -n "$isesix"; then
3029 *) if test -f /etc/systemid; then
3031 set `echo $3 | $sed 's/\./ /g'` $4
3032 if $test -f $src/hints/sco_$1_$2_$3.sh; then
3034 elif $test -f $src/hints/sco_$1_$2.sh; then
3036 elif $test -f $src/hints/sco_$1.sh; then
3041 '') : Still unknown. Probably a generic Sys V.
3050 *) case "$osname" in
3051 '') : Still unknown. Probably a generic BSD.
3059 if test -f /vmunix -a -f $src/hints/news_os.sh; then
3060 (what /vmunix | UU/tr '[A-Z]' '[a-z]') > UU/kernel.what 2>&1
3061 if $contains news-os UU/kernel.what >/dev/null 2>&1; then
3064 $rm -f UU/kernel.what
3065 elif test -d c:/.; then
3072 case "$targetarch" in
3075 osname=`echo $targetarch|sed 's,^[^-]*-,,'`
3080 : Now look for a hint file osname_osvers, unless one has been
3081 : specified already.
3084 file=`echo "${osname}_${osvers}" | $sed -e 's%\.%_%g' -e 's%_$%%'`
3085 : Also try without trailing minor version numbers.
3086 xfile=`echo $file | $sed -e 's%_[^_]*$%%'`
3087 xxfile=`echo $xfile | $sed -e 's%_[^_]*$%%'`
3088 xxxfile=`echo $xxfile | $sed -e 's%_[^_]*$%%'`
3089 xxxxfile=`echo $xxxfile | $sed -e 's%_[^_]*$%%'`
3092 *) case "$osvers" in
3095 *) if $test -f $src/hints/$file.sh ; then
3097 elif $test -f $src/hints/$xfile.sh ; then
3099 elif $test -f $src/hints/$xxfile.sh ; then
3101 elif $test -f $src/hints/$xxxfile.sh ; then
3103 elif $test -f $src/hints/$xxxxfile.sh ; then
3105 elif $test -f "$src/hints/${osname}.sh" ; then
3114 if $test -f Policy.sh ; then
3117 none) dflt="Policy" ;;
3118 *) dflt="Policy $dflt" ;;
3123 dflt=`echo $hintfile | $sed 's/\.sh$//'`
3127 if $test -f Policy.sh ; then
3130 There's also a Policy hint file available, which should make the
3131 site-specific (policy) questions easier to answer.
3138 You may give one or more space-separated answers, or "none" if appropriate.
3139 A well-behaved OS will have no hints, so answering "none" or just "Policy"
3140 is a good thing. DO NOT give a wrong version or a wrong OS.
3144 rp="Which of these apply, if any?"
3147 for file in $tans; do
3148 if $test X$file = XPolicy -a -f Policy.sh; then
3150 $cat Policy.sh >> UU/config.sh
3151 elif $test -f $src/hints/$file.sh; then
3152 . $src/hints/$file.sh
3153 $cat $src/hints/$file.sh >> UU/config.sh
3154 elif $test X"$tans" = X -o X"$tans" = Xnone ; then
3157 : Give one chance to correct a possible typo.
3158 echo "$file.sh does not exist"
3160 rp="hint to use instead?"
3162 for file in $ans; do
3163 if $test -f "$src/hints/$file.sh"; then
3164 . $src/hints/$file.sh
3165 $cat $src/hints/$file.sh >> UU/config.sh
3166 elif $test X$ans = X -o X$ans = Xnone ; then
3169 echo "$file.sh does not exist -- ignored."
3176 : Remember our hint file for later.
3177 if $test -f "$src/hints/$file.sh" ; then
3187 echo "Fetching default answers from $config_sh..." >&4
3191 cp $config_sh config.sh 2>/dev/null
3201 test "$override" && . ./optdef.sh
3203 : Restore computed paths
3204 for file in $loclist $trylist; do
3205 eval $file="\$_$file"
3210 Configure uses the operating system name and version to set some defaults.
3211 The default value is probably right if the name rings a bell. Otherwise,
3212 since spelling matters for me, either accept the default or answer "none"
3219 ''|' '|none) dflt=none ;;
3220 *) dflt=`echo $hintfile | $sed -e 's/\.sh$//' -e 's/_.*$//'` ;;
3223 *) dflt="$osname" ;;
3225 rp="Operating system name?"
3229 *) osname=`echo "$ans" | $sed -e 's/[ ][ ]*/_/g' | ./tr '[A-Z]' '[a-z]'`;;
3235 ''|' '|none) dflt=none ;;
3236 *) dflt=`echo $hintfile | $sed -e 's/\.sh$//' -e 's/^[^_]*//'`
3237 dflt=`echo $dflt | $sed -e 's/^_//' -e 's/_/./g'`
3239 ''|' ') dflt=none ;;
3244 *) dflt="$osvers" ;;
3246 rp="Operating system version?"
3256 : who configured the system
3257 cf_time=`LC_ALL=C; LANGUAGE=C; export LC_ALL; export LANGUAGE; $date 2>&1`
3258 cf_by=`(logname) 2>/dev/null`
3261 cf_by=`(whoami) 2>/dev/null`
3263 "") cf_by=unknown ;;
3267 : set up the script used to warn in case of inconsistency
3274 echo "*** WHOA THERE!!! ***" >&4
3275 echo " The $hint value for \$$var on this machine was \"$was\"!" >&4
3276 rp=" Keep the $hint value?"
3279 y) td=$was; tu=$was;;
3283 : function used to set $1 to $val
3284 setvar='var=$1; eval "was=\$$1"; td=$define; tu=$undef;
3286 $define$undef) . ./whoa; eval "$var=\$td";;
3287 $undef$define) . ./whoa; eval "$var=\$tu";;
3288 *) eval "$var=$val";;
3291 case "$usethreads" in
3292 $define|true|[yY]*) dflt='y';;
3297 Perl can be built to take advantage of threads on some systems.
3298 To do so, Configure can be run with -Dusethreads.
3300 Note that threading is a highly experimental feature, and
3301 some known race conditions still remain. If you choose to try
3302 it, be very sure to not actually deploy it for production
3303 purposes. README.threads has more details, and is required
3304 reading if you enable threads.
3306 If this doesn't make any sense to you, just accept the default '$dflt'.
3308 rp='Build a threading Perl?'
3311 y|Y) val="$define" ;;
3317 case "$usethreads" in
3321 As of 5.5.640, Perl has two different internal threading implementations,
3322 the 5.005 version (5005threads) and an interpreter-based version
3323 (ithreads) that has one interpreter per thread. Both are very
3324 experimental. This arrangement exists to help developers work out
3325 which one is better.
3327 If you're a casual user, you probably don't want interpreter-threads
3328 at this time. But if you do, the 'threads' module allows their use,
3329 and the 'Thread' module offers an interface to both 5005threads and
3330 ithreads (whichever has been configured).
3332 : Default to ithreads unless overridden on command line or with
3335 case "$use5005threads" in
3336 $define|true|[yY]*) dflt='n';;
3338 case "$useithreads" in
3339 $undef|false|[nN]*) dflt='n';;
3341 rp='Use interpreter-based ithreads?'
3344 y|Y) val="$define" ;;
3349 : Now set use5005threads to the opposite value.
3350 case "$useithreads" in
3351 $define) val="$undef" ;;
3358 useithreads="$undef"
3359 use5005threads="$undef"
3363 case "$useithreads$use5005threads" in
3367 You cannot have both the ithreads and the 5.005 threads enabled
3368 at the same time. Disabling the 5.005 threads since they are
3369 much less stable than the ithreads.
3372 use5005threads="$undef"
3376 case "$d_oldpthreads" in
3377 '') : Configure tests would be welcome here. For now, assume undef.
3379 *) val="$d_oldpthreads" ;;
3385 case "$usethreads" in
3386 "$define"|true|[yY]*)
3387 : Look for a hint-file generated 'call-back-unit'. If the
3388 : user has specified that a threading perl is to be built,
3389 : we may need to set or change some other defaults.
3390 if $test -f usethreads.cbu; then
3391 echo "Your platform has some specific hints for threaded builds, using them..."
3395 (Your platform doesn't have any specific hints for threaded builds.
3396 Assuming POSIX threads, then.)
3404 Perl can be built so that multiple Perl interpreters can coexist
3405 within the same Perl executable.
3408 case "$useithreads" in
3411 This multiple interpreter support is required for interpreter-based threads.
3415 *) case "$usemultiplicity" in
3416 $define|true|[yY]*) dflt='y';;
3420 echo "If this doesn't make any sense to you, just accept the default '$dflt'."
3421 rp='Build Perl for multiplicity?'
3424 y|Y) val="$define" ;;
3433 case "$usemorebits" in
3434 "$define"|true|[yY]*)
3435 use64bitint="$define"
3436 uselongdouble="$define"
3437 usemorebits="$define"
3439 *) usemorebits="$undef"
3443 : make some quick guesses about what we are up against
3445 $echo $n "Hmm... $c"
3455 $cat /usr/include/signal.h /usr/include/sys/signal.h >foo 2>/dev/null
3456 if test -f /osf_boot || $contains 'OSF/1' /usr/include/ctype.h >/dev/null 2>&1
3458 echo "Looks kind of like an OSF/1 system, but we'll see..."
3460 elif test `echo abc | $tr a-z A-Z` = Abc ; then
3461 xxx=`./loc addbib blurfl $pth`
3462 if $test -f $xxx; then
3463 echo "Looks kind of like a USG system with BSD features, but we'll see..."
3467 if $contains SIGTSTP foo >/dev/null 2>&1 ; then
3468 echo "Looks kind of like an extended USG system, but we'll see..."
3470 echo "Looks kind of like a USG system, but we'll see..."
3474 elif $contains SIGTSTP foo >/dev/null 2>&1 ; then
3475 echo "Looks kind of like a BSD system, but we'll see..."
3479 echo "Looks kind of like a Version 7 system, but we'll see..."
3482 case "$eunicefix" in
3485 There is, however, a strange, musty smell in the air that reminds me of
3486 something...hmm...yes...I've got it...there's a VMS nearby, or I'm a Blit.
3490 : it so happens the Eunice I know will not run shell scripts in Unix format
3494 echo "Congratulations. You aren't running Eunice."
3498 : Detect OS2. The p_ variable is set above in the Head.U unit.
3499 : Note that this also -- wrongly -- detects e.g. dos-djgpp, which also uses
3500 : semicolon as a patch separator
3505 I have the feeling something is not exactly right, however...don't tell me...
3506 lemme think...does HAL ring a bell?...no, of course, you're only running OS/2!
3507 (Or you may be running DOS with DJGPP.)
3512 if test -f /xenix; then
3513 echo "Actually, this looks more like a XENIX system..."
3518 echo "It's not Xenix..."
3523 if test -f /venix; then
3524 echo "Actually, this looks more like a VENIX system..."
3531 echo "Nor is it Venix..."
3534 chmod +x bsd usg v7 osf1 eunice xenix venix os2
3535 $eunicefix bsd usg v7 osf1 eunice xenix venix os2
3542 rp="Use which C compiler?"
3545 : Look for a hint-file generated 'call-back-unit'. Now that the
3546 : user has specified the compiler, we may need to set or change some
3548 if $test -f cc.cbu; then
3554 echo "Checking for GNU cc in disguise and/or its version number..." >&4
3560 printf("%s\n", __VERSION__);
3562 printf("%s\n", "1");
3568 if $cc -o try $ccflags $ldflags try.c; then
3569 gccversion=`$run ./try`
3570 case "$gccversion" in
3571 '') echo "You are not using GNU cc." ;;
3572 *) echo "You are using GNU cc $gccversion."
3578 echo "*** WHOA THERE!!! ***" >&4
3579 echo " Your C compiler \"$cc\" doesn't seem to be working!" >&4
3580 case "$knowitall" in
3582 echo " You'd better start hunting for one and let me know about it." >&4
3588 case "$gccversion" in
3589 1*) cpp=`./loc gcc-cpp $cpp $pth` ;;
3591 case "$gccversion" in
3592 '') gccosandvers='' ;;
3593 *) gccshortvers=`echo "$gccversion"|sed 's/ .*//'`
3594 gccosandvers=`$cc -v 2>&1|grep '/specs$'|sed "s!.*/[^-/]*-[^-/]*-\([^-/]*\)/$gccshortvers/specs!\1!"`
3596 case "$gccosandvers" in
3597 $osname) gccosandvers='' ;; # linux gccs seem to have no linux osvers, grr
3598 $osname$osvers) ;; # looking good
3599 $osname*) cat <<EOM >&4
3601 *** WHOA THERE!!! ***
3603 Your gcc has not been compiled for the exact release of
3604 your operating system ($gccosandvers versus $osname$osvers).
3606 In general it is a good idea to keep gcc synchronized with
3607 the operating system because otherwise serious problems
3608 may ensue when trying to compile software, like Perl.
3610 I'm trying to be optimistic here, though, and will continue.
3611 If later during the configuration and build icky compilation
3612 problems appear (headerfile conflicts being the most common
3613 manifestation), I suggest reinstalling the gcc to match
3614 your operating system release.
3618 *) gccosandvers='' ;; # failed to parse, better be silent
3627 : decide how portable to be. Allow command line overrides.
3628 case "$d_portable" in
3630 *) d_portable="$define" ;;
3633 : set up shell script to do ~ expansion
3639 echo \$1 | $sed "s|~|\${HOME-\$LOGDIR}|"
3642 if $test -f /bin/csh; then
3643 /bin/csh -f -c "glob \$1"
3648 name=\`$expr x\$1 : '..\([^/]*\)'\`
3649 dir=\`$sed -n -e "/^\${name}:/{s/^[^:]*:[^:]*:[^:]*:[^:]*:[^:]*:\([^:]*\).*"'\$'"/\1/" -e p -e q -e '}' </etc/passwd\`
3650 if $test ! -d "\$dir"; then
3652 echo "\$me: can't locate home directory for: \$name" >&2
3657 echo \$dir/\`$expr x\$1 : '..[^/]*/\(.*\)'\`
3673 : now set up to get a file name
3677 cat <<'EOSC' >>getfile
3693 expr $fn : '.*(\(.*\)).*' | $tr ',' $trnl >getfile.ok
3694 fn=`echo $fn | sed 's/(.*)//'`
3700 loc_file=`expr $fn : '.*:\(.*\)'`
3701 fn=`expr $fn : '\(.*\):.*'`
3709 */*) fullpath=true;;
3718 *e*) exp_file=true;;
3721 *p*) nopath_ok=true;;
3726 *d*) type='Directory';;
3727 *l*) type='Locate';;
3732 Locate) what='File';;
3737 case "$d_portable" in
3745 while test "$type"; do
3750 true) rp="$rp (~name ok)";;
3753 if test -f UU/getfile.ok && \
3754 $contains "^$ans\$" UU/getfile.ok >/dev/null 2>&1
3773 value=`UU/filexp $ans`
3776 if test "$ans" != "$value"; then
3777 echo "(That expands to $value on this system.)"
3791 /*) value="$ansexp" ;;
3792 [a-zA-Z]:/*) value="$ansexp" ;;
3797 echo "I shall only accept a full path name, as in /bin/ls." >&4
3798 echo "Use a ! shell escape if you wish to check pathnames." >&4
3801 echo "Please give a full path name, starting with slash." >&4
3804 echo "Note that using ~name is ok provided it expands well." >&4
3817 for fp in $gfpth; do
3818 if test "X$fp" = X.; then
3823 if test -f "$pf"; then
3825 elif test -r "$pf" || (test -h "$pf") >/dev/null 2>&1
3827 echo "($value is not a plain file, but that's ok.)"
3830 if test X"$type" = X; then
3837 for fp in $gfpth; do
3838 if test "X$fp" = X.; then
3843 direxp="$fp/$ansexp"
3845 if test -d "$direxp"; then
3853 if test -d "$ansexp"; then
3854 echo "(Looking for $loc_file in directory $value.)"
3855 value="$value/$loc_file"
3856 ansexp="$ansexp/$loc_file"
3858 if test -f "$ansexp"; then
3861 case "$nopath_ok" in
3862 true) case "$value" in
3864 *) echo "Assuming $value will be in people's path."
3880 if test "$fastread" = yes; then
3885 rp="$what $value doesn't exist. Use that name anyway?"
3904 test "X$gfpthkeep" != Xy && gfpth=""
3907 : What should the include directory be ?
3909 $echo $n "Hmm... $c"
3913 if $test -f /bin/mips && /bin/mips; then
3914 echo "Looks like a MIPS system..."
3915 $cat >usr.c <<'EOCP'
3916 #ifdef SYSTYPE_BSD43
3920 if cc -E usr.c > usr.out && $contains / usr.out >/dev/null 2>&1; then
3921 dflt='/bsd43/usr/include'
3925 mips_type='System V'
3927 $rm -f usr.c usr.out
3928 echo "and you're compiling with the $mips_type compiler and libraries."
3932 echo "Doesn't look like a MIPS system."
3942 case "$xxx_prompt" in
3945 rp='Where are the include files you want to use?'
3953 : see how we invoke the C preprocessor
3955 echo "Now, how can we feed standard input to your C preprocessor..." >&4
3956 cat <<'EOT' >testcpp.c
3962 if test ! -f cppstdin; then
3963 if test "X$osname" = "Xaix" -a "X$gccversion" = X; then
3964 # AIX cc -E doesn't show the absolute headerfile
3965 # locations but we'll cheat by using the -M flag.
3966 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
3968 echo 'cat >.$$.c; '"$cc"' -E ${1+"$@"} .$$.c; rm .$$.c' >cppstdin
3971 echo "Keeping your $hint cppstdin wrapper."
3974 wrapper=`pwd`/cppstdin
3978 if $test "X$cppstdin" != "X" && \
3979 $cppstdin $cppminus <testcpp.c >testcpp.out 2>&1 && \
3980 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
3982 echo "You used to use $cppstdin $cppminus so we'll use that again."
3984 '') echo "But let's see if we can live without a wrapper..." ;;
3986 if $cpprun $cpplast <testcpp.c >testcpp.out 2>&1 && \
3987 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
3989 echo "(And we'll use $cpprun $cpplast to preprocess directly.)"
3992 echo "(However, $cpprun $cpplast does not work, let's see...)"
4000 echo "Good old $cppstdin $cppminus does not seem to be of any help..."
4007 elif echo 'Maybe "'"$cc"' -E" will work...'; \
4008 $cc -E <testcpp.c >testcpp.out 2>&1; \
4009 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4010 echo "Yup, it does."
4013 elif echo 'Nope...maybe "'"$cc"' -E -" will work...'; \
4014 $cc -E - <testcpp.c >testcpp.out 2>&1; \
4015 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4016 echo "Yup, it does."
4019 elif echo 'Nope...maybe "'"$cc"' -P" will work...'; \
4020 $cc -P <testcpp.c >testcpp.out 2>&1; \
4021 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4022 echo "Yipee, that works!"
4025 elif echo 'Nope...maybe "'"$cc"' -P -" will work...'; \
4026 $cc -P - <testcpp.c >testcpp.out 2>&1; \
4027 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4028 echo "At long last!"
4031 elif echo 'No such luck, maybe "'$cpp'" will work...'; \
4032 $cpp <testcpp.c >testcpp.out 2>&1; \
4033 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4037 elif echo 'Nixed again...maybe "'$cpp' -" will work...'; \
4038 $cpp - <testcpp.c >testcpp.out 2>&1; \
4039 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4040 echo "Hooray, it works! I was beginning to wonder."
4043 elif echo 'Uh-uh. Time to get fancy. Trying a wrapper...'; \
4044 $wrapper <testcpp.c >testcpp.out 2>&1; \
4045 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4051 rp="No dice. I can't find a C preprocessor. Name one:"
4055 $x_cpp <testcpp.c >testcpp.out 2>&1
4056 if $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4057 echo "OK, that will do." >&4
4059 echo "Sorry, I can't get that to work. Go find one and rerun Configure." >&4
4074 echo "Perhaps can we force $cc -E using a wrapper..."
4075 if $wrapper <testcpp.c >testcpp.out 2>&1; \
4076 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
4082 echo "Nope, we'll have to live without it..."
4096 "$wrapper"|'cppstdin') ;;
4097 *) $rm -f $wrapper;;
4099 $rm -f testcpp.c testcpp.out
4101 : Set private lib path
4104 plibpth="$incpath/usr/lib /usr/local/lib /usr/ccs/lib"
4109 '') dlist="$loclibpth $plibpth $glibpth";;
4110 *) dlist="$libpth";;
4113 : Now check and see which directories actually exist, avoiding duplicates
4117 if $test -d $xxx; then
4120 *) libpth="$libpth $xxx";;
4126 Some systems have incompatible or broken versions of libraries. Among
4127 the directories listed in the question below, please remove any you
4128 know not to be holding relevant libraries, and add any that are needed.
4129 Say "none" for none.
4140 rp="Directories to use for library searches?"
4147 : compute shared library extension
4150 if xxx=`./loc libc.sl X $libpth`; $test -f "$xxx"; then
4160 On some systems, shared libraries may be available. Answer 'none' if
4161 you want to suppress searching of shared libraries for the remainder
4162 of this configuration.
4165 rp='What is the file extension used for shared libraries?'
4169 : Define several unixisms.
4170 : Hints files or command line option can be used to override them.
4171 : The convoluted testing is in case hints files set either the old
4174 '') case "$exe_ext" in
4176 *) _exe="$exe_ext" ;;
4181 '') case "$lib_ext" in
4188 '') case "$obj_ext" in
4195 '') case "$path_sep" in
4206 : Which makefile gets called first. This is used by make depend.
4207 case "$firstmakefile" in
4208 '') firstmakefile='makefile';;
4212 $define|true|[yY]*) dflt='y';;
4217 Perl can be built to use the SOCKS proxy protocol library. To do so,
4218 Configure must be run with -Dusesocks. If you use SOCKS you also need
4219 to use the PerlIO abstraction layer, this will be implicitly selected.
4221 If this doesn't make any sense to you, just accept the default '$dflt'.
4223 rp='Build Perl for SOCKS?'
4226 y|Y) val="$define" ;;
4233 $define|true|[yY]*) useperlio="$define";;
4236 : Looking for optional libraries
4238 echo "Checking for optional libraries..." >&4
4243 case "$libswanted" in
4244 '') libswanted='c_s';;
4247 "$define") libswanted="$libswanted socks5 socks5_sh" ;;
4253 for thisdir in $libpth $xlibpth; do
4254 test -d $thisdir && libspath="$libspath $thisdir"
4256 for thislib in $libswanted; do
4257 for thisdir in $libspath; do
4259 if $test ! -f "$xxx" -a "X$ignore_versioned_solibs" = "X"; then
4260 xxx=`ls $thisdir/lib$thislib.$so.[0-9] 2>/dev/null|tail -1`
4261 $test -f "$xxx" && eval $libscheck
4262 $test -f "$xxx" && libstyle=shared
4264 if test ! -f "$xxx"; then
4265 xxx=$thisdir/lib$thislib.$so
4266 $test -f "$xxx" && eval $libscheck
4267 $test -f "$xxx" && libstyle=shared
4269 if test ! -f "$xxx"; then
4270 xxx=$thisdir/lib$thislib$_a
4271 $test -f "$xxx" && eval $libscheck
4272 $test -f "$xxx" && libstyle=static
4274 if test ! -f "$xxx"; then
4275 xxx=$thisdir/$thislib$_a
4276 $test -f "$xxx" && eval $libscheck
4277 $test -f "$xxx" && libstyle=static
4279 if test ! -f "$xxx"; then
4280 xxx=$thisdir/lib${thislib}_s$_a
4281 $test -f "$xxx" && eval $libscheck
4282 $test -f "$xxx" && libstyle=static
4283 $test -f "$xxx" && thislib=${thislib}_s
4285 if test ! -f "$xxx"; then
4286 xxx=$thisdir/Slib$thislib$_a
4287 $test -f "$xxx" && eval $libscheck
4288 $test -f "$xxx" && libstyle=static
4290 if $test -f "$xxx"; then
4292 shared) echo "Found -l$thislib (shared)." ;;
4293 static) echo "Found -l$thislib." ;;
4294 *) echo "Found -l$thislib ($libstyle)." ;;
4298 *) dflt="$dflt -l$thislib"
4299 libsfound="$libsfound $xxx"
4301 libsfiles="$libsfiles $yyy"
4302 yyy=`echo $xxx|$sed -e "s%/$yyy\\$%%"`
4303 case " $libsdirs " in
4305 *) libsdirs="$libsdirs $yyy" ;;
4312 if $test ! -f "$xxx"; then
4313 echo "No -l$thislib."
4324 ' '|'') dflt='none';;
4329 In order to compile $package on your machine, a number of libraries
4330 are usually needed. Include any other special libraries here as well.
4331 Say "none" for none. The default list is almost always right.
4335 rp="What libraries to use?"
4342 : determine optimization, if desired, or use for debug flag also
4344 ' '|$undef) dflt='none';;
4346 *) dflt="$optimize";;
4350 By default, $package compiles with the -O flag to use the optimizer.
4351 Alternately, you might want to use the symbolic debugger, which uses
4352 the -g flag (on traditional Unix systems). Either flag can be
4353 specified here. To use neither flag, specify the word "none".
4356 rp="What optimizer/debugger flag should be used?"
4360 'none') optimize=" ";;
4364 : We will not override a previous value, but we might want to
4365 : augment a hint file
4367 default|recommended)
4368 case "$gccversion" in
4369 1*) dflt='-fpcc-struct-return' ;;
4372 *-g*) dflt="$dflt -DDEBUGGING";;
4374 case "$gccversion" in
4375 2*) if test -d /etc/conf/kconfig.d &&
4376 $contains _POSIX_VERSION $usrinc/sys/unistd.h >/dev/null 2>&1
4382 case "$gccversion" in
4386 echo "Checking if your compiler accepts -fno-strict-aliasing" 2>&1
4387 echo 'int main(void) { return 0; }' > gcctest.c
4388 if $cc -O2 -fno-strict-aliasing -o gcctest gcctest.c; then
4389 echo "Yes, it does." 2>&1
4392 echo "Leaving current flags $ccflags alone." 2>&1
4394 *) dflt="$dflt -fno-strict-aliasing" ;;
4397 echo "Nope, it doesn't, but that's ok." 2>&1
4404 case "$mips_type" in
4405 *BSD*|'') inclwanted="$locincpth $usrinc";;
4406 *) inclwanted="$locincpth $inclwanted $usrinc/bsd";;
4408 for thisincl in $inclwanted; do
4409 if $test -d $thisincl; then
4410 if $test x$thisincl != x$usrinc; then
4412 *" -I$thisincl "*);;
4413 *) dflt="$dflt -I$thisincl ";;
4419 inctest='if $contains $2 $usrinc/$1 >/dev/null 2>&1; then
4421 elif $contains $2 $usrinc/sys/$1 >/dev/null 2>&1; then
4429 *) dflt="$dflt -D$2";;
4433 set signal.h LANGUAGE_C; eval $inctest
4437 ccflags="$ccflags -DSOCKS"
4442 default|recommended) dflt="$ccflags $dflt" ;;
4443 *) dflt="$ccflags";;
4452 Your C compiler may want other flags. For this question you should include
4453 -I/whatever and -DWHATEVER flags and any other flags used by the C compiler,
4454 but you should NOT include libraries or ld flags like -lwhatever. If you
4455 want $package to honor its debug switch, you should include -DDEBUGGING here.
4456 Your C compiler might also need additional flags, such as -D_POSIX_SOURCE.
4458 To use no flags, specify the word "none".
4464 rp="Any additional cc flags?"
4471 : the following weeds options from ccflags that are of no interest to cpp
4473 '') cppflags="$ccflags" ;;
4474 *) cppflags="$cppflags $ccflags" ;;
4476 case "$gccversion" in
4477 1*) cppflags="$cppflags -D__GNUC__"
4479 case "$mips_type" in
4481 *BSD*) cppflags="$cppflags -DSYSTYPE_BSD43";;
4487 echo "Let me guess what the preprocessor flags are..." >&4
4501 *) ftry="$previous $flag";;
4503 if $cppstdin -DLFRULB=bar $cppflags $ftry $cppminus <cpp.c \
4504 >cpp1.out 2>/dev/null && \
4505 $cpprun -DLFRULB=bar $cppflags $ftry $cpplast <cpp.c \
4506 >cpp2.out 2>/dev/null && \
4507 $contains 'foo.*xx.*bar' cpp1.out >/dev/null 2>&1 && \
4508 $contains 'foo.*xx.*bar' cpp2.out >/dev/null 2>&1
4510 cppflags="$cppflags $ftry"
4520 *-*) echo "They appear to be: $cppflags";;
4522 $rm -f cpp.c cpp?.out
4526 : flags used in final linking phase
4528 '') if ./venix; then
4534 *-posix*) dflt="$dflt -posix" ;;
4537 *) dflt="$ldflags";;
4540 : Try to guess additional flags to pick up local libraries.
4541 for thislibdir in $libpth; do
4542 case " $loclibpth " in
4545 *"-L$thislibdir "*) ;;
4546 *) dflt="$dflt -L$thislibdir" ;;
4558 Your C linker may need flags. For this question you should
4559 include -L/whatever and any other flags used by the C linker, but you
4560 should NOT include libraries like -lwhatever.
4562 Make sure you include the appropriate -L/path flags if your C linker
4563 does not normally search all of the directories you specified above,
4566 To use no flags, specify the word "none".
4570 rp="Any additional ld flags (NOT including libraries)?"
4576 rmlist="$rmlist pdp11"
4580 echo "Checking your choice of C compiler and flags for coherency..." >&4
4581 $cat > try.c <<'EOF'
4583 int main() { printf("Ok\n"); exit(0); }
4585 set X $cc -o try $optimize $ccflags $ldflags try.c $libs
4587 $cat >try.msg <<'EOM'
4588 I've tried to compile and run the following simple program:
4591 $cat try.c >> try.msg
4593 $cat >> try.msg <<EOM
4600 and I got the following output:
4604 if $sh -c "$cc -o try $optimize $ccflags $ldflags try.c $libs" >>try.msg 2>&1; then
4605 if $sh -c "$run ./try" >>try.msg 2>&1; then
4609 *) echo 'The program compiled OK, but produced no output.' >> try.msg
4612 cat >> try.msg <<'EOQS'
4613 If $libs contains -lsfio, and sfio is mis-configured, then it
4614 sometimes (apparently) runs and exits with a 0 status, but with no
4615 output! It may have to do with sfio's use of _exit vs. exit.
4618 rp="You have a big problem. Shall I abort Configure"
4625 echo "The program compiled OK, but exited with status $?." >>try.msg
4626 rp="You have a problem. Shall I abort Configure"
4630 echo "I can't compile the test program." >>try.msg
4631 rp="You have a BIG problem. Shall I abort Configure"
4637 case "$knowitall" in
4639 echo "(The supplied flags or libraries might be incorrect.)"
4647 *) echo "Ok. Stopping Configure." >&4
4652 n) echo "OK, that should do.";;
4654 $rm -f try try.* core
4656 : define a shorthand compile call
4660 $cc -o ${mc_file} $optimize $ccflags $ldflags $* ${mc_file}.c $libs > /dev/null 2>&1;'
4661 : define a shorthand compile call for compilations that should be ok.
4665 $cc -o ${mc_file} $optimize $ccflags $ldflags $* ${mc_file}.c $libs;'
4667 : check for lengths of integral types
4671 echo "Checking to see how big your integers are..." >&4
4672 $cat >try.c <<'EOCP'
4676 printf("intsize=%d;\n", (int)sizeof(int));
4677 printf("longsize=%d;\n", (int)sizeof(long));
4678 printf("shortsize=%d;\n", (int)sizeof(short));
4683 if eval $compile_ok && $run ./try > /dev/null; then
4685 echo "Your integers are $intsize bytes long."
4686 echo "Your long integers are $longsize bytes long."
4687 echo "Your short integers are $shortsize bytes long."
4691 Help! I can't compile and run the intsize test program: please enlighten me!
4692 (This is probably a misconfiguration in your system or libraries, and
4693 you really ought to fix it. Still, I'll try anyway.)
4697 rp="What is the size of an integer (in bytes)?"
4701 rp="What is the size of a long integer (in bytes)?"
4705 rp="What is the size of a short integer (in bytes)?"
4713 : check for void type
4715 echo "Checking to see how well your C compiler groks the void type..." >&4
4716 case "$voidflags" in
4718 $cat >try.c <<'EOCP'
4724 extern void moo(); /* function returning void */
4725 void (*goo)(); /* ptr to func returning void */
4727 void *hue; /* generic ptr */
4740 int main() { sub(); }
4742 if $cc $ccflags -c -DTRY=$defvoidused try.c >.out 2>&1 ; then
4743 voidflags=$defvoidused
4744 echo "Good. It appears to support void to the level $package wants.">&4
4745 if $contains warning .out >/dev/null 2>&1; then
4746 echo "However, you might get some warnings that look like this:"
4750 echo "Hmm, your compiler has some difficulty with void. Checking further..." >&4
4751 if $cc $ccflags -c -DTRY=1 try.c >/dev/null 2>&1; then
4752 echo "It supports 1..."
4753 if $cc $ccflags -c -DTRY=3 try.c >/dev/null 2>&1; then
4754 echo "It also supports 2..."
4755 if $cc $ccflags -c -DTRY=7 try.c >/dev/null 2>&1; then
4757 echo "And it supports 4 but not 8 definitely."
4759 echo "It doesn't support 4..."
4760 if $cc $ccflags -c -DTRY=11 try.c >/dev/null 2>&1; then
4762 echo "But it supports 8."
4765 echo "Neither does it support 8."
4769 echo "It does not support 2..."
4770 if $cc $ccflags -c -DTRY=13 try.c >/dev/null 2>&1; then
4772 echo "But it supports 4 and 8."
4774 if $cc $ccflags -c -DTRY=5 try.c >/dev/null 2>&1; then
4776 echo "And it supports 4 but has not heard about 8."
4778 echo "However it supports 8 but not 4."
4783 echo "There is no support at all for void."
4788 case "$voidflags" in
4791 Support flag bits are:
4792 1: basic void declarations.
4793 2: arrays of pointers to functions returning void.
4794 4: operations between pointers to and addresses of void functions.
4795 8: generic void pointers.
4798 rp="Your void support flags add up to what?"
4805 : check for length of pointer
4809 echo "Checking to see how big your pointers are..." >&4
4810 if test "$voidflags" -gt 7; then
4811 echo '#define VOID_PTR char *' > try.c
4813 echo '#define VOID_PTR void *' > try.c
4815 $cat >>try.c <<'EOCP'
4819 printf("%d\n", (int)sizeof(VOID_PTR));
4824 if eval $compile_ok; then
4825 ptrsize=`$run ./try`
4826 echo "Your pointers are $ptrsize bytes long."
4829 echo "(I can't seem to compile the test program. Guessing...)" >&4
4830 rp="What is the size of a pointer (in bytes)?"
4838 : check for long long
4840 echo "Checking to see if you have long long..." >&4
4841 echo 'int main() { long long x = 7; return 0; }' > try.c
4843 if eval $compile; then
4845 echo "You have long long."
4848 echo "You do not have long long."
4854 : check for length of long long
4855 case "${d_longlong}${longlongsize}" in
4858 echo "Checking to see how big your long longs are..." >&4
4859 $cat >try.c <<'EOCP'
4863 printf("%d\n", (int)sizeof(long long));
4868 if eval $compile_ok; then
4869 longlongsize=`$run ./try`
4870 echo "Your long longs are $longlongsize bytes long."
4874 echo "(I can't seem to compile the test program. Guessing...)"
4875 rp="What is the size of a long long (in bytes)?"
4879 if $test "X$longsize" = "X$longlongsize"; then
4880 echo "(That isn't any different from an ordinary long.)"
4886 : determine filename position in cpp output
4888 echo "Computing filename position in cpp output for #include directives..." >&4
4890 vos) testaccess=-e ;;
4893 echo '#include <stdio.h>' > foo.c
4896 $cppstdin $cppflags $cppminus <foo.c 2>/dev/null | \
4897 $grep '^[ ]*#.*stdio\.h' | \
4898 while read cline; do
4901 while $test \$# -gt 0; do
4902 if $test $testaccess \`echo \$1 | $tr -d '"'\`; then
4907 pos=\`expr \$pos + 1\`
4919 *) pos="${fieldn}th";;
4921 echo "Your cpp writes the filename in the $pos field of the line."
4924 vos) cppfilter="tr '\\\\>' '/' |" ;; # path component separator is >
4927 : locate header file
4932 for usrincdir in $usrinc
4934 if test -f \$usrincdir/\$wanted; then
4935 echo "\$usrincdir/\$wanted"
4939 awkprg='{ print \$$fieldn }'
4940 echo "#include <\$wanted>" > foo\$\$.c
4941 $cppstdin $cppminus $cppflags < foo\$\$.c 2>/dev/null | \
4942 $cppfilter $grep "^[ ]*#.*\$wanted" | \
4943 while read cline; do
4944 name=\`echo \$cline | $awk "\$awkprg" | $tr -d '"'\`
4946 *[/\\\\]\$wanted) echo "\$name"; exit 1;;
4947 *[\\\\/]\$wanted) echo "\$name"; exit 1;;
4952 # status = 0: grep returned 0 lines, case statement not executed
4953 # status = 1: headerfile found
4954 # status = 2: while loop executed, no headerfile found
4958 if test \$status -eq 1; then
4965 : define an alternate in-header-list? function
4966 inhdr='echo " "; td=$define; tu=$undef; yyy=$@;
4967 cont=true; xxf="echo \"<\$1> found.\" >&4";
4968 case $# in 2) xxnf="echo \"<\$1> NOT found.\" >&4";;
4969 *) xxnf="echo \"<\$1> NOT found, ...\" >&4";;
4971 case $# in 4) instead=instead;; *) instead="at last";; esac;
4972 while $test "$cont"; do
4974 var=$2; eval "was=\$$2";
4975 if $test "$xxx" && $test -r "$xxx";
4977 eval "case \"\$$var\" in $undef) . ./whoa; esac"; eval "$var=\$td";
4980 eval "case \"\$$var\" in $define) . ./whoa; esac"; eval "$var=\$tu"; fi;
4981 set $yyy; shift; shift; yyy=$@;
4982 case $# in 0) cont="";;
4983 2) xxf="echo \"but I found <\$1> $instead.\" >&4";
4984 xxnf="echo \"and I did not find <\$1> either.\" >&4";;
4985 *) xxf="echo \"but I found <\$1\> instead.\" >&4";
4986 xxnf="echo \"there is no <\$1>, ...\" >&4";;
4990 do set $yyy; var=$2; eval "was=\$$2";
4991 eval "case \"\$$var\" in $define) . ./whoa; esac"; eval "$var=\$tu";
4992 set $yyy; shift; shift; yyy=$@;
4995 : see if inttypes.h is available
4996 : we want a real compile instead of Inhdr because some systems
4997 : have an inttypes.h which includes non-existent headers
5000 #include <inttypes.h>
5002 static int32_t foo32 = 0x12345678;
5006 if eval $compile; then
5007 echo "<inttypes.h> found." >&4
5010 echo "<inttypes.h> NOT found." >&4
5019 echo "Checking to see if you have int64_t..." >&4
5021 #include <sys/types.h>
5022 #$i_inttypes I_INTTYPES
5024 #include <inttypes.h>
5026 int main() { int64_t x = 7; }
5029 if eval $compile; then
5031 echo "You have int64_t."
5034 echo "You do not have int64_t."
5042 echo "Checking which 64-bit integer type we could use..." >&4
5048 val='"unsigned int"'
5053 *) case "$longsize" in
5057 val='"unsigned long"'
5062 *) case "$d_longlong:$longlongsize" in
5067 val='"unsigned long long"'
5072 *) case "$d_int64_t" in
5091 '') echo "Alas, no 64-bit integer types in sight." >&4
5094 *) echo "We could use '$quadtype' for 64-bit integers." >&4
5100 case "$uselonglong" in
5101 "$define"|true|[yY]*)
5104 *** Configure -Duselonglong is deprecated, using -Duse64bitint instead.
5106 use64bitint="$define"
5109 case "$use64bits" in
5110 "$define"|true|[yY]*)
5113 *** Configure -Duse64bits is deprecated, using -Duse64bitint instead.
5115 use64bitint="$define"
5118 case "$use64bitints" in
5119 "$define"|true|[yY]*)
5122 *** There is no Configure -Duse64bitints, using -Duse64bitint instead.
5124 use64bitint="$define"
5127 case "$use64bitsint" in
5128 "$define"|true|[yY]*)
5131 *** There is no Configure -Duse64bitsint, using -Duse64bitint instead.
5133 use64bitint="$define"
5136 case "$uselonglongs" in
5137 "$define"|true|[yY]*)
5140 *** There is no Configure -Duselonglongs, using -Duse64bitint instead.
5142 use64bitint="$define"
5145 case "$use64bitsall" in
5146 "$define"|true|[yY]*)
5149 *** There is no Configure -Duse64bitsall, using -Duse64bitall instead.
5151 use64bitall="$define"
5156 *-DUSE_LONG_LONG*|*-DUSE_64_BIT_INT*|*-DUSE_64_BIT_ALL*) use64bitint="$define";;
5158 case "$use64bitall" in
5159 "$define"|true|[yY]*) use64bitint="$define" ;;
5165 You have natively 64-bit long integers.
5169 *) case "$use64bitint" in
5170 "$define"|true|[yY]*) dflt='y';;
5179 Perl can be built to take advantage of 64-bit integer types
5180 on some systems. To do so, Configure can be run with -Duse64bitint.
5181 Choosing this option will most probably introduce binary incompatibilities.
5183 If this doesn't make any sense to you, just accept the default '$dflt'.
5184 (The default has been chosen based on your configuration.)
5186 rp='Try to use 64-bit integers, if available?'
5189 [yY]*) val="$define" ;;
5197 case "$use64bitall" in
5198 "$define"|true|[yY]*) dflt='y' ;;
5199 *) case "$longsize" in
5207 You may also choose to try maximal 64-bitness. It means using as much
5208 64-bitness as possible on the platform. This in turn means even more
5209 binary incompatibilities. On the other hand, your platform may not
5210 have any more 64-bitness available than what you already have chosen.
5212 If this doesn't make any sense to you, just accept the default '$dflt'.
5213 (The default has been chosen based on your configuration.)
5215 rp='Try to use maximal 64-bit support, if available?'
5218 [yY]*) val="$define" ;;
5223 case "$use64bitall" in
5225 case "$use64bitint" in
5229 Since you have chosen a maximally 64-bit build, I'm also turning on
5230 the use of 64-bit integers.
5232 use64bitint="$define" ;;
5237 case "$use64bitall" in
5238 "$define"|true|[yY]*)
5242 *** You have chosen a maximally 64-bit build, but your pointers
5243 *** are only 4 bytes wide, disabling maximal 64-bitness.
5246 use64bitall="$undef"
5247 case "$use64bitint" in
5248 "$define"|true|[yY]*) ;;
5251 *** Downgrading from maximal 64-bitness to using 64-bit integers.
5254 use64bitint="$define"
5262 case "$use64bitint" in
5263 "$define"|true|[yY]*)
5264 : Look for a hint-file generated 'call-back-unit'. If the
5265 : user has specified that a 64-bit perl is to be built,
5266 : we may need to set or change some other defaults.
5267 if $test -f use64bitint.cbu; then
5268 echo "Your platform has some specific hints for 64-bit integers, using them..."
5272 4) case "$archname64" in
5273 '') archname64=64int ;;
5280 case "$use64bitall" in
5281 "$define"|true|[yY]*)
5282 : Look for a hint-file generated 'call-back-unit'. If the
5283 : user has specified that a maximally 64-bit perl is to be built,
5284 : we may need to set or change some other defaults.
5285 if $test -f use64bitall.cbu; then
5286 echo "Your platform has some specific hints for 64-bit builds, using them..."
5290 4) case "$archname64" in
5291 ''|64int) archname64=64all ;;
5299 echo "Checking for GNU C Library..." >&4
5312 if eval $compile_ok && $run ./try; then
5314 echo "You are using the GNU C Library"
5317 echo "You are not using the GNU C Library"
5323 : see if nm is to be used to determine whether a symbol is defined or not
5327 case "$d_gnulibc" in
5330 echo "nm probably won't work on the GNU C Library." >&4
5336 if $test "$osname" = aix -a ! -f /lib/syscalls.exp; then
5338 echo "Whoops! This is an AIX system without /lib/syscalls.exp!" >&4
5339 echo "'nm' won't be sufficient on this sytem." >&4
5345 '') dflt=`$egrep 'inlibc|csym' $rsrc/Configure | wc -l 2>/dev/null`
5346 if $test $dflt -gt 20; then
5356 true|$define) dflt=y;;
5363 I can use $nm to extract the symbols from your C libraries. This
5364 is a time consuming task which may generate huge output on the disk (up
5365 to 3 megabytes) but that should make the symbols extraction faster. The
5366 alternative is to skip the 'nm' extraction part and to compile a small
5367 test program instead to determine whether each symbol is present. If
5368 you have a fast C compiler and/or if your 'nm' output cannot be parsed,
5369 this may be the best solution.
5371 You probably shouldn't let me use 'nm' if you are using the GNU C Library.
5374 rp="Shall I use $nm to extract C symbols from the libraries?"
5377 [Nn]*) usenm=false;;
5386 : nm options which may be necessary
5388 '') if $test -f /mach_boot; then
5390 elif $test -d /usr/ccs/lib; then
5391 nm_opt='-p' # Solaris (and SunOS?)
5392 elif $test -f /dgux; then
5394 elif $test -f /lib64/rld; then
5395 nm_opt='-p' # 64-bit Irix
5401 : nm options which may be necessary for shared libraries but illegal
5402 : for archive libraries. Thank you, Linux.
5403 case "$nm_so_opt" in
5404 '') case "$myuname" in
5406 if $nm --help | $grep 'dynamic' > /dev/null 2>&1; then
5407 nm_so_opt='--dynamic'
5416 : get list of predefined functions in a handy place
5421 *-lc_s*) libc=`./loc libc_s$_a $libc $libpth`
5427 *) for thislib in $libs; do
5430 : Handle C library specially below.
5433 thislib=`echo $thislib | $sed -e 's/^-l//'`
5434 if try=`./loc lib$thislib.$so.'*' X $libpth`; $test -f "$try"; then
5436 elif try=`./loc lib$thislib.$so X $libpth`; $test -f "$try"; then
5438 elif try=`./loc lib$thislib$_a X $libpth`; $test -f "$try"; then
5440 elif try=`./loc $thislib$_a X $libpth`; $test -f "$try"; then
5442 elif try=`./loc lib$thislib X $libpth`; $test -f "$try"; then
5444 elif try=`./loc $thislib X $libpth`; $test -f "$try"; then
5446 elif try=`./loc Slib$thislib$_a X $xlibpth`; $test -f "$try"; then
5451 libnames="$libnames $try"
5453 *) libnames="$libnames $thislib" ;;
5462 for xxx in $libpth; do
5463 $test -r $1 || set $xxx/libc.$so
5464 : The messy sed command sorts on library version numbers.
5466 set `echo blurfl; echo $xxx/libc.$so.[0-9]* | \
5467 tr ' ' $trnl | egrep -v '\.[A-Za-z]*$' | $sed -e '
5469 s/[0-9][0-9]*/0000&/g
5470 s/0*\([0-9][0-9][0-9][0-9][0-9]\)/\1/g
5473 $sort | $sed -e 's/^.* //'`
5476 $test -r $1 || set /usr/ccs/lib/libc.$so
5477 $test -r $1 || set /lib/libsys_s$_a
5483 if $test -r "$1"; then
5484 echo "Your (shared) C library seems to be in $1."
5486 elif $test -r /lib/libc && $test -r /lib/clib; then
5487 echo "Your C library seems to be in both /lib/clib and /lib/libc."
5489 libc='/lib/clib /lib/libc'
5490 if $test -r /lib/syslib; then
5491 echo "(Your math library is in /lib/syslib.)"
5492 libc="$libc /lib/syslib"
5494 elif $test -r "$libc" || (test -h "$libc") >/dev/null 2>&1; then
5495 echo "Your C library seems to be in $libc, as you said before."
5496 elif $test -r $incpath/usr/lib/libc$_a; then
5497 libc=$incpath/usr/lib/libc$_a;
5498 echo "Your C library seems to be in $libc. That's fine."
5499 elif $test -r /lib/libc$_a; then
5501 echo "Your C library seems to be in $libc. You're normal."
5503 if tans=`./loc libc$_a blurfl/dyick $libpth`; $test -r "$tans"; then
5505 elif tans=`./loc libc blurfl/dyick $libpth`; $test -r "$tans"; then
5506 libnames="$libnames "`./loc clib blurfl/dyick $libpth`
5507 elif tans=`./loc clib blurfl/dyick $libpth`; $test -r "$tans"; then
5509 elif tans=`./loc Slibc$_a blurfl/dyick $xlibpth`; $test -r "$tans"; then
5511 elif tans=`./loc Mlibc$_a blurfl/dyick $xlibpth`; $test -r "$tans"; then
5514 tans=`./loc Llibc$_a blurfl/dyick $xlibpth`
5516 if $test -r "$tans"; then
5517 echo "Your C library seems to be in $tans, of all places."
5523 if $test $xxx = apollo -o -r "$libc" || (test -h "$libc") >/dev/null 2>&1; then
5527 If the guess above is wrong (which it might be if you're using a strange
5528 compiler, or your machine supports multiple models), you can override it here.
5533 echo $libpth | $tr ' ' $trnl | $sort | $uniq > libpath
5535 I can't seem to find your C library. I've looked in the following places:
5538 $sed 's/^/ /' libpath
5541 None of these seems to contain your C library. I need to get its name...
5546 rp='Where is your C library?'
5551 echo $libc $libnames | $tr ' ' $trnl | $sort | $uniq > libnames
5552 set X `cat libnames`
5555 case $# in 1) xxx=file; esac
5556 echo "Extracting names from the following $xxx for later perusal:" >&4
5558 $sed 's/^/ /' libnames >&4
5560 $echo $n "This may take a while...$c" >&4
5564 *$so*) $nm $nm_so_opt $nm_opt $file 2>/dev/null;;
5565 *) $nm $nm_opt $file 2>/dev/null;;
5570 $grep fprintf libc.tmp > libc.ptf
5571 xscan='eval "<libc.ptf $com >libc.list"; $echo $n ".$c" >&4'
5572 xrun='eval "<libc.tmp $com >libc.list"; echo "done" >&4'
5574 if com="$sed -n -e 's/__IO//' -e 's/^.* $xxx *_[_.]*//p' -e 's/^.* $xxx *//p'";\
5576 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5578 elif com="$sed -n -e 's/^__*//' -e 's/^\([a-zA-Z_0-9$]*\).*xtern.*/\1/p'";\
5580 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5582 elif com="$sed -n -e '/|UNDEF/d' -e '/FUNC..GL/s/^.*|__*//p'";\
5584 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5586 elif com="$sed -n -e 's/^.* D __*//p' -e 's/^.* D //p'";\
5588 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5590 elif com="$sed -n -e 's/^_//' -e 's/^\([a-zA-Z_0-9]*\).*xtern.*text.*/\1/p'";\
5592 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5594 elif com="$sed -n -e 's/^.*|FUNC |GLOB .*|//p'";\
5596 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5598 elif com="$grep '|' | $sed -n -e '/|COMMON/d' -e '/|DATA/d' \
5599 -e '/ file/d' -e 's/^\([^ ]*\).*/\1/p'";\
5601 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5603 elif com="$sed -n -e 's/^.*|FUNC |GLOB .*|//p' -e 's/^.*|FUNC |WEAK .*|//p'";\
5605 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5607 elif com="$sed -n -e 's/^__//' -e '/|Undef/d' -e '/|Proc/s/ .*//p'";\
5609 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5611 elif com="$sed -n -e 's/^.*|Proc .*|Text *| *//p'";\
5613 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5615 elif com="$sed -n -e '/Def. Text/s/.* \([^ ]*\)\$/\1/p'";\
5617 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5619 elif com="$sed -n -e 's/^[-0-9a-f ]*_\(.*\)=.*/\1/p'";\
5621 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5623 elif com="$sed -n -e 's/.*\.text n\ \ \ \.//p'";\
5625 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5627 elif com="sed -n -e 's/^__.*//' -e 's/[ ]*D[ ]*[0-9]*.*//p'";\
5629 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5632 $nm -p $* 2>/dev/null >libc.tmp
5633 $grep fprintf libc.tmp > libc.ptf
5634 if com="$sed -n -e 's/^.* [ADTSIW] *_[_.]*//p' -e 's/^.* [ADTSIW] //p'";\
5635 eval $xscan; $contains '^fprintf$' libc.list >/dev/null 2>&1
5641 echo "$nm didn't seem to work right. Trying $ar instead..." >&4
5643 if $ar t $libc > libc.tmp && $contains '^fprintf$' libc.tmp >/dev/null 2>&1; then
5644 for thisname in $libnames $libc; do
5645 $ar t $thisname >>libc.tmp
5647 $sed -e "s/\\$_o\$//" < libc.tmp > libc.list
5649 elif test "X$osname" = "Xos2" && $ar tv $libc > libc.tmp; then
5650 # Repeat libc to extract forwarders to DLL entries too
5651 for thisname in $libnames $libc; do
5652 $ar tv $thisname >>libc.tmp
5653 # Revision 50 of EMX has bug in $ar.
5654 # it will not extract forwarders to DLL entries
5655 # Use emximp which will extract exactly them.
5656 emximp -o tmp.imp $thisname \
5658 $sed -e 's/^\([_a-zA-Z0-9]*\) .*$/\1/p' \
5659 < tmp.imp >>libc.tmp
5662 $sed -e "s/\\$_o\$//" -e 's/^ \+//' < libc.tmp > libc.list
5665 echo "$ar didn't seem to work right." >&4
5666 echo "Maybe this is a Cray...trying bld instead..." >&4
5667 if bld t $libc | $sed -e 's/.*\///' -e "s/\\$_o:.*\$//" > libc.list
5669 for thisname in $libnames; do
5671 $sed -e 's/.*\///' -e "s/\\$_o:.*\$//" >>libc.list
5672 $ar t $thisname >>libc.tmp
5676 echo "That didn't work either. Giving up." >&4
5683 if $test -f /lib/syscalls.exp; then
5685 echo "Also extracting names from /lib/syscalls.exp for good ole AIX..." >&4
5686 $sed -n 's/^\([^ ]*\)[ ]*syscall[0-9]*[ ]*$/\1/p' /lib/syscalls.exp >>libc.list
5690 $rm -f libnames libpath
5692 : is a C symbol defined?
5695 -v) tf=libc.tmp; tc=""; tdc="";;
5696 -a) tf=libc.tmp; tc="[0]"; tdc="[]";;
5697 *) tlook="^$1\$"; tf=libc.list; tc="()"; tdc="()";;
5700 case "$reuseval-$4" in
5702 true-*) tx=no; eval "tval=\$$4"; case "$tval" in "") tx=yes;; esac;;
5708 if $contains $tlook $tf >/dev/null 2>&1;
5713 echo "int main() { extern short $1$tdc; printf(\"%hd\", $1$tc); }" > t.c;
5714 if $cc -o t $optimize $ccflags $ldflags t.c $libs >/dev/null 2>&1;
5722 $define) tval=true;;
5728 : define an is-in-libc? function
5729 inlibc='echo " "; td=$define; tu=$undef;
5730 sym=$1; var=$2; eval "was=\$$2";
5732 case "$reuseval$was" in
5742 echo "$sym() found." >&4;
5743 case "$was" in $undef) . ./whoa; esac; eval "$var=\$td";;
5745 echo "$sym() NOT found." >&4;
5746 case "$was" in $define) . ./whoa; esac; eval "$var=\$tu";;
5750 $define) echo "$sym() found." >&4;;
5751 *) echo "$sym() NOT found." >&4;;
5755 : see if sqrtl exists
5759 : check for length of double
5761 case "$doublesize" in
5763 echo "Checking to see how big your double precision numbers are..." >&4
5764 $cat >try.c <<'EOCP'
5768 printf("%d\n", (int)sizeof(double));
5773 if eval $compile_ok; then
5774 doublesize=`$run ./try`
5775 echo "Your double is $doublesize bytes long."
5778 echo "(I can't seem to compile the test program. Guessing...)"
5779 rp="What is the size of a double precision number (in bytes)?"
5787 : check for long doubles
5789 echo "Checking to see if you have long double..." >&4
5790 echo 'int main() { long double x = 7.0; }' > try.c
5792 if eval $compile; then
5794 echo "You have long double."
5797 echo "You do not have long double."
5803 : check for length of long double
5804 case "${d_longdbl}${longdblsize}" in
5807 echo "Checking to see how big your long doubles are..." >&4
5808 $cat >try.c <<'EOCP'
5812 printf("%d\n", sizeof(long double));
5817 if eval $compile; then
5818 longdblsize=`$run ./try`
5819 echo "Your long doubles are $longdblsize bytes long."
5823 echo "(I can't seem to compile the test program. Guessing...)" >&4
5824 rp="What is the size of a long double (in bytes)?"
5828 if $test "X$doublesize" = "X$longdblsize"; then
5829 echo "(That isn't any different from an ordinary double.)"
5837 if $test X"$d_longdbl" = X"$define"; then
5839 echo "Checking how to print long doubles..." >&4
5841 if $test X"$sPRIfldbl" = X -a X"$doublesize" = X"$longdblsize"; then
5842 $cat >try.c <<'EOCP'
5843 #include <sys/types.h>
5847 printf("%.3f\n", d);
5851 if eval $compile; then
5855 sPRIfldbl='"f"'; sPRIgldbl='"g"'; sPRIeldbl='"e"';
5856 sPRIFUldbl='"F"'; sPRIGUldbl='"G"'; sPRIEUldbl='"E"';
5857 echo "We will use %f."
5863 if $test X"$sPRIfldbl" = X; then
5864 $cat >try.c <<'EOCP'
5865 #include <sys/types.h>
5868 long double d = 123.456;
5869 printf("%.3Lf\n", d);
5873 if eval $compile; then
5877 sPRIfldbl='"Lf"'; sPRIgldbl='"Lg"'; sPRIeldbl='"Le"';
5878 sPRIFUldbl='"LF"'; sPRIGUldbl='"LG"'; sPRIEUldbl='"LE"';
5879 echo "We will use %Lf."
5885 if $test X"$sPRIfldbl" = X; then
5886 $cat >try.c <<'EOCP'
5887 #include <sys/types.h>
5890 long double d = 123.456;
5891 printf("%.3llf\n", d);
5895 if eval $compile; then
5899 sPRIfldbl='"llf"'; sPRIgldbl='"llg"'; sPRIeldbl='"lle"';
5900 sPRIFUldbl='"llF"'; sPRIGUldbl='"llG"'; sPRIEUldbl='"llE"';
5901 echo "We will use %llf."
5907 if $test X"$sPRIfldbl" = X; then
5908 $cat >try.c <<'EOCP'
5909 #include <sys/types.h>
5912 long double d = 123.456;
5913 printf("%.3lf\n", d);
5917 if eval $compile; then
5921 sPRIfldbl='"lf"'; sPRIgldbl='"lg"'; sPRIeldbl='"le"';
5922 sPRIFUldbl='"lF"'; sPRIGUldbl='"lG"'; sPRIEUldbl='"lE"';
5923 echo "We will use %lf."
5929 if $test X"$sPRIfldbl" = X; then
5930 echo "Cannot figure out how to print long doubles." >&4
5932 sSCNfldbl=$sPRIfldbl # expect consistency
5939 case "$sPRIfldbl" in
5940 '') d_PRIfldbl="$undef"; d_PRIgldbl="$undef"; d_PRIeldbl="$undef";
5941 d_PRIFUldbl="$undef"; d_PRIGUldbl="$undef"; d_PRIEUldbl="$undef";
5942 d_SCNfldbl="$undef";
5944 *) d_PRIfldbl="$define"; d_PRIgldbl="$define"; d_PRIeldbl="$define";
5945 d_PRIFUldbl="$define"; d_PRIGUldbl="$define"; d_PRIEUldbl="$define";
5946 d_SCNfldbl="$define";
5950 : see if modfl exists
5954 d_modfl_pow32_bug="$undef"
5956 case "$d_longdbl$d_modfl" in
5959 Checking to see whether your modfl() is okay for large values...
5965 long double nv = 4294967303.15;
5971 printf(" %"$sPRIfldbl" %"$sPRIfldbl" %"$sPRIfldbl"\n", nv, v, w);
5975 case "$osname:$gccversion" in
5976 aix:) saveccflags="$ccflags"
5977 ccflags="$ccflags -qlongdouble" ;; # to avoid core dump
5980 if eval $compile; then
5983 *" 4294967303.150000 1.150000 4294967302.000000")
5984 echo >&4 "Your modfl() is broken for large values."
5985 d_modfl_pow32_bug="$define"
5987 glibc) echo >&4 "You should upgrade your glibc to at least 2.2.2 to get a fixed modfl()."
5991 *" 4294967303.150000 0.150000 4294967303.000000")
5992 echo >&4 "Your modfl() seems okay for large values."
5994 *) echo >&4 "I don't understand your modfl() at all."
5998 $rm -f try.* try core core.try.*
6000 echo "I cannot figure out whether your modfl() is okay, assuming it isn't."
6003 case "$osname:$gccversion" in
6004 aix:) ccflags="$saveccflags" ;; # restore
6010 *-DUSE_LONG_DOUBLE*|*-DUSE_MORE_BITS*) uselongdouble="$define" ;;
6013 case "$uselongdouble" in
6014 $define|true|[yY]*) dflt='y';;
6019 Perl can be built to take advantage of long doubles which
6020 (if available) may give more accuracy and range for floating point numbers.
6022 If this doesn't make any sense to you, just accept the default '$dflt'.
6024 rp='Try to use long doubles if available?'
6027 y|Y) val="$define" ;;
6033 case "$uselongdouble" in
6034 true|[yY]*) uselongdouble="$define" ;;
6037 case "$uselongdouble" in
6039 : Look for a hint-file generated 'call-back-unit'. If the
6040 : user has specified that long doubles should be used,
6041 : we may need to set or change some other defaults.
6042 if $test -f uselongdouble.cbu; then
6043 echo "Your platform has some specific hints for long doubles, using them..."
6044 . ./uselongdouble.cbu
6047 (Your platform doesn't have any specific hints for long doubles.)
6054 case "$uselongdouble:$d_sqrtl:$d_modfl" in
6055 $define:$define:$define)
6058 $define:$define:$undef)
6059 message="I could not find modfl"
6061 $define:$undef:$define)
6062 message="I could not find sqrtl"
6064 $define:$undef:$undef)
6065 message="I found neither sqrtl nor modfl"
6069 if $test "$message" != X; then
6072 *** You requested the use of long doubles but you do not seem to have
6073 *** the mathematic functions for long doubles.
6075 *** I'm disabling the use of long doubles.
6079 uselongdouble=$undef
6082 case "$useperlio" in
6083 $define|true|[yY]*|'') dflt='y';;
6088 Previous version of $package used the standard IO mechanisms as
6089 defined in <stdio.h>. Versions 5.003_02 and later of $package allow
6090 alternate IO mechanisms via the PerlIO abstraction layer, but the
6091 stdio mechanism is still available if needed. The abstraction layer
6092 can use AT&T's sfio (if you already have sfio installed) or regular stdio.
6093 Using PerlIO with sfio may cause problems with some extension modules.
6095 If this doesn't make any sense to you, just accept the default '$dflt'.
6097 rp='Use the PerlIO abstraction layer?'
6104 echo "Ok, doing things the stdio way."
6113 case "$useperlio" in
6114 $define|true|[yY]*) ;;
6117 You are using the SOCKS proxy protocol library which means that you
6118 should also use the PerlIO layer. You may be headed for trouble.
6127 : determine the architecture name
6129 if xxx=`./loc arch blurfl $pth`; $test -f "$xxx"; then
6130 tarch=`arch`"-$osname"
6131 elif xxx=`./loc uname blurfl $pth`; $test -f "$xxx" ; then
6132 if uname -m > tmparch 2>&1 ; then
6133 tarch=`$sed -e 's/ *$//' -e 's/ /_/g' \
6134 -e 's/$/'"-$osname/" tmparch`
6142 case "$myarchname" in
6145 echo "(Your architecture name used to be $myarchname.)"
6149 case "$targetarch" in
6151 *) archname=`echo $targetarch|sed 's,^[^-]*-,,'` ;;
6156 *) dflt="$archname";;
6158 rp='What is your architecture name'
6161 case "$usethreads" in
6163 echo "Threads selected." >&4
6165 *-thread*) echo "...and architecture name already has -thread." >&4
6167 *) archname="$archname-thread"
6168 echo "...setting architecture name to $archname." >&4
6173 case "$usemultiplicity" in
6175 echo "Multiplicity selected." >&4
6177 *-multi*) echo "...and architecture name already has -multi." >&4
6179 *) archname="$archname-multi"
6180 echo "...setting architecture name to $archname." >&4
6185 case "$use64bitint$use64bitall" in
6187 case "$archname64" in
6189 echo "This architecture is naturally 64-bit, not changing architecture name." >&4
6192 case "$use64bitint" in
6193 "$define") echo "64 bit integers selected." >&4 ;;
6195 case "$use64bitall" in
6196 "$define") echo "Maximal 64 bitness selected." >&4 ;;
6199 *-$archname64*) echo "...and architecture name already has $archname64." >&4
6201 *) archname="$archname-$archname64"
6202 echo "...setting architecture name to $archname." >&4
6208 case "$uselongdouble" in
6210 echo "Long doubles selected." >&4
6211 case "$longdblsize" in
6213 echo "...but long doubles are equal to doubles, not changing architecture name." >&4
6217 *-ld*) echo "...and architecture name already has -ld." >&4
6219 *) archname="$archname-ld"
6220 echo "...setting architecture name to $archname." >&4
6227 case "$useperlio" in
6229 echo "Perlio selected." >&4
6232 echo "Perlio not selected, using stdio." >&4
6234 *-stdio*) echo "...and architecture name already has -stdio." >&4
6236 *) archname="$archname-stdio"
6237 echo "...setting architecture name to $archname." >&4
6243 : determine root of directory hierarchy where package will be installed.
6246 dflt=`./loc . /usr/local /usr/local /local /opt /usr`
6254 By default, $package will be installed in $dflt/bin, manual pages
6255 under $dflt/man, etc..., i.e. with $dflt as prefix for all
6256 installation directories. Typically this is something like /usr/local.
6257 If you wish to have binaries under /usr/bin but other parts of the
6258 installation under /usr/local, that's ok: you will be prompted
6259 separately for each of the installation directories, the prefix being
6260 only used to set the defaults.
6264 rp='Installation prefix to use?'
6272 *) oldprefix="$prefix";;
6281 *) afsroot=$afsroot ;;
6287 $define|true) afs=true ;;
6288 $undef|false) afs=false ;;
6289 *) if test -d $afsroot; then
6297 echo "AFS may be running... I'll be extra cautious then..." >&4
6299 echo "AFS does not seem to be running..." >&4
6302 : determine installation prefix for where package is to be installed.
6306 Since you are running AFS, I need to distinguish the directory in which
6307 files will reside from the directory in which they are installed (and from
6308 which they are presumably copied to the former directory by occult means).
6311 case "$installprefix" in
6312 '') dflt=`echo $prefix | sed 's#^/afs/#/afs/.#'`;;
6313 *) dflt="$installprefix";;
6318 In some special cases, particularly when building $package for distribution,
6319 it is convenient to distinguish between the directory in which files should
6320 be installed from the directory ($prefix) in which they
6321 will eventually reside. For most users, these two directories are the same.
6324 case "$installprefix" in
6326 *) dflt=$installprefix;;
6330 rp='What installation prefix should I use for installing files?'
6332 installprefix="$ans"
6333 installprefixexp="$ansexp"
6335 : set the prefixit variable, to compute a suitable default value
6336 prefixit='case "$3" in
6338 case "$oldprefix" in
6339 "") eval "$1=\"\$$2\"";;
6346 ""|" ") eval "$1=\"\$$2\"";;
6352 eval "tp=\"$oldprefix-\$$2-\""; eval "tp=\"$tp\"";
6354 --|/*--|\~*--) eval "$1=\"$prefix/$3\"";;
6355 /*-$oldprefix/*|\~*-$oldprefix/*)
6356 eval "$1=\`echo \$$2 | sed \"s,^$oldprefix,$prefix,\"\`";;
6357 *) eval "$1=\"\$$2\"";;
6361 : get the patchlevel
6363 echo "Getting the current patchlevel..." >&4
6364 if $test -r $rsrc/patchlevel.h;then
6365 revision=`awk '/define[ ]+PERL_REVISION/ {print $3}' $rsrc/patchlevel.h`
6366 patchlevel=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
6367 subversion=`awk '/define[ ]+PERL_SUBVERSION/ {print $3}' $rsrc/patchlevel.h`
6368 api_revision=`awk '/define[ ]+PERL_API_REVISION/ {print $3}' $rsrc/patchlevel.h`
6369 api_version=`awk '/define[ ]+PERL_API_VERSION/ {print $3}' $rsrc/patchlevel.h`
6370 api_subversion=`awk '/define[ ]+PERL_API_SUBVERSION/ {print $3}' $rsrc/patchlevel.h`
6371 perl_patchlevel=`grep ',"DEVEL[0-9][0-9]*"' $rsrc/patchlevel.h|sed 's/[^0-9]//g'`
6380 $echo "(You do not have patchlevel.h. Eek.)"
6382 if $test -r $rsrc/.patch ; then
6383 if $test "`cat $rsrc/.patch`" -gt "$perl_patchlevel" ; then
6384 perl_patchlevel=`cat $rsrc/.patch`
6387 : Define a handy string here to avoid duplication in myconfig.SH and configpm.
6388 version_patchlevel_string="version $patchlevel subversion $subversion"
6389 case "$perl_patchlevel" in
6391 *) version_patchlevel_string="$version_patchlevel_string patch $perl_patchlevel" ;;
6394 $echo "(You have $package $version_patchlevel_string.)"
6398 : XXX Should be a Configure test for double-dots in filenames.
6399 version=`echo $revision $patchlevel $subversion | \
6400 $awk '{ printf "%d_%d_%d\n", $1, $2, $3 }'`
6401 api_versionstring=`echo $api_revision $api_version $api_subversion | \
6402 $awk '{ printf "%d_%d_%d\n", $1, $2, $3 }'`
6405 version=`echo $revision $patchlevel $subversion | \
6406 $awk '{ printf "%d.%d.%d\n", $1, $2, $3 }'`
6407 api_versionstring=`echo $api_revision $api_version $api_subversion | \
6408 $awk '{ printf "%d.%d.%d\n", $1, $2, $3 }'`
6411 : Special case the 5.005_xx maintenance series, which used 5.005
6412 : without any subversion label as a subdirectory in $sitelib
6413 if test "${api_revision}${api_version}${api_subversion}" = "550"; then
6414 api_versionstring='5.005'
6417 : determine installation style
6418 : For now, try to deduce it from prefix unless it is already set.
6419 : Reproduce behavior of 5.005 and earlier, maybe drop that in 5.7.
6420 case "$installstyle" in
6421 '') case "$prefix" in
6422 *perl*) dflt='lib';;
6423 *) dflt='lib/perl5' ;;
6426 *) dflt="$installstyle" ;;
6428 : Probably not worth prompting for this since we prompt for all
6429 : the directories individually, and the prompt would be too long and
6433 : determine where private library files go
6434 : Usual default is /usr/local/lib/perl5/$version.
6435 : Also allow things like /opt/perl/lib/$version, since
6436 : /opt/perl/lib/perl5... would be redundant.
6437 : The default "style" setting is made in installstyle.U
6438 case "$installstyle" in
6439 *lib/perl5*) set dflt privlib lib/$package/$version ;;
6440 *) set dflt privlib lib/$version ;;
6445 There are some auxiliary files for $package that need to be put into a
6446 private library directory that is accessible by everyone.
6450 rp='Pathname where the private library files will reside?'
6453 privlibexp="$ansexp"
6454 : Change installation prefix, if necessary.
6455 if $test X"$prefix" != X"$installprefix"; then
6456 installprivlib=`echo $privlibexp | sed "s#^$prefix#$installprefix#"`
6458 installprivlib="$privlibexp"
6461 : set the prefixup variable, to restore leading tilda escape
6462 prefixup='case "$prefixexp" in
6464 *) eval "$1=\`echo \$$1 | sed \"s,^$prefixexp,$prefix,\"\`";;
6467 : determine where public architecture dependent libraries go
6470 : privlib default is /usr/local/lib/$package/$version
6471 : archlib default is /usr/local/lib/$package/$version/$archname
6472 : privlib may have an optional trailing /share.
6473 tdflt=`echo $privlib | $sed 's,/share$,,'`
6474 tdflt=$tdflt/$archname
6483 $spackage contains architecture-dependent library files. If you are
6484 sharing libraries in a heterogeneous environment, you might store
6485 these files in a separate location. Otherwise, you can just include
6486 them with the rest of the public library files.
6490 rp='Where do you want to put the public architecture-dependent libraries?'
6493 archlibexp="$ansexp"
6494 if $test X"$archlib" = X"$privlib"; then
6499 : Change installation prefix, if necessary.
6500 if $test X"$prefix" != X"$installprefix"; then
6501 installarchlib=`echo $archlibexp | sed "s#^$prefix#$installprefix#"`
6503 installarchlib="$archlibexp"
6507 : Binary compatibility with 5.005 is not possible for builds
6508 : with advanced features
6509 case "$usethreads$usemultiplicity" in
6511 bincompat5005="$undef"
6512 d_bincompat5005="$undef"
6516 This version of Perl can be compiled for binary compatibility with 5.005.
6517 If you decide to do so, you will be able to continue using most of the
6518 extensions that were compiled for Perl 5.005.
6521 case "$bincompat5005$d_bincompat5005" in
6522 *"$undef"*) dflt=n ;;
6525 rp='Binary compatibility with Perl 5.005?'
6528 y*) val="$define" ;;
6533 case "$d_bincompat5005" in
6535 bincompat5005="$define"
6537 *) bincompat5005="$undef"
6538 d_bincompat5005="$undef"
6545 : see if setuid scripts can be secure
6548 Some kernels have a bug that prevents setuid #! scripts from being
6549 secure. Some sites have disabled setuid #! scripts because of this.
6551 First let's decide if your kernel supports secure setuid #! scripts.
6552 (If setuid #! scripts would be secure but have been disabled anyway,
6553 don't say that they are secure if asked.)
6558 if $test -d /dev/fd; then
6559 echo "#!$ls" >reflect
6560 chmod +x,u+s reflect
6561 ./reflect >flect 2>&1
6562 if $contains "/dev/fd" flect >/dev/null; then
6563 echo "Congratulations, your kernel has secure setuid scripts!" >&4
6567 If you are not sure if they are secure, I can check but I'll need a
6568 username and password different from the one you are using right now.
6569 If you don't have such a username or don't want me to test, simply
6573 rp='Other username to test security of setuid scripts with?'
6578 case "$d_suidsafe" in
6579 '') echo "I'll assume setuid scripts are *not* secure." >&4
6582 echo "Well, the $hint value is *not* secure." >&4
6584 *) echo "Well, the $hint value *is* secure." >&4
6589 $rm -f reflect flect
6590 echo "#!$ls" >reflect
6591 chmod +x,u+s reflect
6594 echo '"su" will (probably) prompt you for '"$ans's password."
6595 su $ans -c './reflect >flect'
6596 if $contains "/dev/fd" flect >/dev/null; then
6597 echo "Okay, it looks like setuid scripts are secure." >&4
6600 echo "I don't think setuid scripts are secure." >&4
6605 rp='Does your kernel have *secure* setuid scripts?'
6608 [yY]*) val="$define";;
6613 echo "I don't think setuid scripts are secure (no /dev/fd directory)." >&4
6614 echo "(That's for file descriptors, not floppy disks.)"
6620 $rm -f reflect flect
6622 : now see if they want to do setuid emulation
6625 case "$d_suidsafe" in
6628 echo "No need to emulate SUID scripts since they are secure here." >&4
6632 Some systems have disabled setuid scripts, especially systems where
6633 setuid scripts cannot be secure. On systems where setuid scripts have
6634 been disabled, the setuid/setgid bits on scripts are currently
6635 useless. It is possible for $package to detect those bits and emulate
6636 setuid/setgid in a secure fashion. This emulation will only work if
6637 setuid scripts have been disabled in your kernel.
6641 "$define") dflt=y ;;
6644 rp="Do you want to do setuid/setgid emulation?"
6647 [yY]*) val="$define";;
6655 : see if this is a malloc.h system
6656 set malloc.h i_malloc
6659 : see if stdlib is available
6660 set stdlib.h i_stdlib
6663 : determine which malloc to compile in
6665 case "$usemymalloc" in
6666 [yY]*|true|$define) dflt='y' ;;
6667 [nN]*|false|$undef) dflt='n' ;;
6668 *) case "$ptrsize" in
6674 rp="Do you wish to attempt to use the malloc that comes with $package?"
6680 mallocsrc='malloc.c'
6681 mallocobj="malloc$_o"
6682 d_mymalloc="$define"
6685 : Remove malloc from list of libraries to use
6686 echo "Removing unneeded -lmalloc from library list" >&4
6687 set `echo X $libs | $sed -e 's/-lmalloc / /' -e 's/-lmalloc$//'`
6690 echo "libs = $libs" >&4
6702 : compute the return types of malloc and free
6704 $cat >malloc.c <<END
6708 #include <sys/types.h>
6722 case "$malloctype" in
6724 if $cc $ccflags -c -DTRY_MALLOC malloc.c >/dev/null 2>&1; then
6731 echo "Your system wants malloc to return '$malloctype', it would seem." >&4
6735 if $cc $ccflags -c -DTRY_FREE malloc.c >/dev/null 2>&1; then
6742 echo "Your system uses $freetype free(), it would seem." >&4
6746 After $package is installed, you may wish to install various
6747 add-on modules and utilities. Typically, these add-ons will
6748 be installed under $prefix with the rest
6749 of this package. However, you may wish to install such add-ons
6750 elsewhere under a different prefix.
6752 If you do not wish to put everything under a single prefix, that's
6753 ok. You will be prompted for the individual locations; this siteprefix
6754 is only used to suggest the defaults.
6756 The default should be fine for most people.
6760 rp='Installation prefix to use for add-on modules and utilities?'
6761 : XXX Here might be another good place for an installstyle setting.
6762 case "$siteprefix" in
6764 *) dflt=$siteprefix ;;
6767 : XXX Prefixit unit does not yet support siteprefix and vendorprefix
6769 case "$siteprefix" in
6773 *) oldsiteprefix="$prefix";;
6778 siteprefixexp="$ansexp"
6780 : determine where site specific libraries go.
6781 : Usual default is /usr/local/lib/perl5/site_perl/$version
6782 : The default "style" setting is made in installstyle.U
6783 : XXX No longer works with Prefixit stuff.
6784 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
6786 '') case "$installstyle" in
6787 *lib/perl5*) dflt=$siteprefix/lib/$package/site_$prog/$version ;;
6788 *) dflt=$siteprefix/lib/site_$prog/$version ;;
6796 The installation process will create a directory for
6797 site-specific extensions and modules. Most users find it convenient
6798 to place all site-specific files in this directory rather than in the
6799 main distribution directory.
6803 rp='Pathname for the site-specific library files?'
6806 sitelibexp="$ansexp"
6807 sitelib_stem=`echo "$sitelibexp" | sed "s,/$version$,,"`
6808 : Change installation prefix, if necessary.
6809 if $test X"$prefix" != X"$installprefix"; then
6810 installsitelib=`echo $sitelibexp | $sed "s#^$prefix#$installprefix#"`
6812 installsitelib="$sitelibexp"
6815 : determine where site specific architecture-dependent libraries go.
6816 : sitelib default is /usr/local/lib/perl5/site_perl/$version
6817 : sitearch default is /usr/local/lib/perl5/site_perl/$version/$archname
6818 : sitelib may have an optional trailing /share.
6820 '') dflt=`echo $sitelib | $sed 's,/share$,,'`
6821 dflt="$dflt/$archname"
6826 set sitearch sitearch none
6830 The installation process will also create a directory for
6831 architecture-dependent site-specific extensions and modules.
6835 rp='Pathname for the site-specific architecture-dependent library files?'
6838 sitearchexp="$ansexp"
6839 : Change installation prefix, if necessary.
6840 if $test X"$prefix" != X"$installprefix"; then
6841 installsitearch=`echo $sitearchexp | sed "s#^$prefix#$installprefix#"`
6843 installsitearch="$sitearchexp"
6848 The installation process will also create a directory for
6849 vendor-supplied add-ons. Vendors who supply perl with their system
6850 may find it convenient to place all vendor-supplied files in this
6851 directory rather than in the main distribution directory. This will
6852 ease upgrades between binary-compatible maintenance versions of perl.
6854 Of course you may also use these directories in whatever way you see
6855 fit. For example, you might use them to access modules shared over a
6856 company-wide network.
6858 The default answer should be fine for most people.
6859 This causes further questions about vendor add-ons to be skipped
6860 and no vendor-specific directories will be configured for perl.
6863 rp='Do you want to configure vendor-specific add-on directories?'
6864 case "$usevendorprefix" in
6865 define|true|[yY]*) dflt=y ;;
6866 *) : User may have set vendorprefix directly on Configure command line.
6867 case "$vendorprefix" in
6876 rp='Installation prefix to use for vendor-supplied add-ons?'
6877 case "$vendorprefix" in
6879 *) dflt=$vendorprefix ;;
6882 : XXX Prefixit unit does not yet support siteprefix and vendorprefix
6884 case "$vendorprefix" in
6888 *) oldvendorprefix="$prefix";;
6892 usevendorprefix="$define"
6894 vendorprefixexp="$ansexp"
6896 *) usevendorprefix="$undef"
6902 case "$vendorprefix" in
6903 '') d_vendorlib="$undef"
6907 *) d_vendorlib="$define"
6908 : determine where vendor-supplied modules go.
6909 : Usual default is /usr/local/lib/perl5/vendor_perl/$version
6910 case "$vendorlib" in
6912 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
6913 case "$installstyle" in
6914 *lib/perl5*) dflt=$vendorprefix/lib/$package/vendor_$prog/$version ;;
6915 *) dflt=$vendorprefix/lib/vendor_$prog/$version ;;
6918 *) dflt="$vendorlib"
6922 rp='Pathname for the vendor-supplied library files?'
6925 vendorlibexp="$ansexp"
6928 vendorlib_stem=`echo "$vendorlibexp" | sed "s,/$version$,,"`
6929 : Change installation prefix, if necessary.
6930 if $test X"$prefix" != X"$installprefix"; then
6931 installvendorlib=`echo $vendorlibexp | $sed "s#^$prefix#$installprefix#"`
6933 installvendorlib="$vendorlibexp"
6936 case "$vendorprefix" in
6937 '') d_vendorarch="$undef"
6941 *) d_vendorarch="$define"
6942 : determine where vendor-supplied architecture-dependent libraries go.
6943 : vendorlib default is /usr/local/lib/perl5/vendor_perl/$version
6944 : vendorarch default is /usr/local/lib/perl5/vendor_perl/$version/$archname
6945 : vendorlib may have an optional trailing /share.
6946 case "$vendorarch" in
6947 '') dflt=`echo $vendorlib | $sed 's,/share$,,'`
6948 dflt="$dflt/$archname"
6950 *) dflt="$vendorarch" ;;
6953 rp='Pathname for vendor-supplied architecture-dependent files?'
6956 vendorarchexp="$ansexp"
6959 : Change installation prefix, if necessary.
6960 if $test X"$prefix" != X"$installprefix"; then
6961 installvendorarch=`echo $vendorarchexp | sed "s#^$prefix#$installprefix#"`
6963 installvendorarch="$vendorarchexp"
6966 : Final catch-all directories to search
6969 Lastly, you can have perl look in other directories for extensions and
6970 modules in addition to those already specified.
6971 These directories will be searched after
6975 test X"$vendorlib" != "X" && echo ' ' $vendorlib
6976 test X"$vendorarch" != "X" && echo ' ' $vendorarch
6978 case "$otherlibdirs" in
6979 ''|' ') dflt='none' ;;
6980 *) dflt="$otherlibdirs" ;;
6983 Enter a colon-separated set of extra paths to include in perl's @INC
6984 search path, or enter 'none' for no extra paths.
6988 rp='Colon-separated list of additional directories for perl to search?'
6991 ' '|''|none) otherlibdirs=' ' ;;
6992 *) otherlibdirs="$ans" ;;
6994 case "$otherlibdirs" in
6998 set d_perl_otherlibdirs
7001 : Cruising for prototypes
7003 echo "Checking out function prototypes..." >&4
7004 $cat >prototype.c <<'EOCP'
7005 int main(int argc, char *argv[]) {
7008 if $cc $ccflags -c prototype.c >prototype.out 2>&1 ; then
7009 echo "Your C compiler appears to support function prototypes."
7012 echo "Your C compiler doesn't seem to understand function prototypes."
7019 case "$prototype" in
7021 *) ansi2knr='ansi2knr'
7026 This version of $package can only be compiled by a compiler that
7027 understands function prototypes. Unfortunately, your C compiler
7029 doesn't seem to understand them. Sorry about that.
7031 If GNU cc is available for your system, perhaps you could try that instead.
7033 Eventually, we hope to support building Perl with pre-ANSI compilers.
7034 If you would like to help in that effort, please contact <perlbug@perl.org>.
7036 Aborting Configure now.
7042 : determine where public executables go
7047 rp='Pathname where the public executables will reside?'
7049 if $test "X$ansexp" != "X$binexp"; then
7054 : Change installation prefix, if necessary.
7055 : XXX Bug? -- ignores Configure -Dinstallprefix setting.
7056 if $test X"$prefix" != X"$installprefix"; then
7057 installbin=`echo $binexp | sed "s#^$prefix#$installprefix#"`
7059 installbin="$binexp"
7068 Perl can be built with extra modules or bundles of modules which
7069 will be fetched from the CPAN and installed alongside Perl.
7071 Notice that you will need access to the CPAN; either via the Internet,
7072 or a local copy, for example a CD-ROM or a local CPAN mirror. (You will
7073 be asked later to configure the CPAN.pm module which will in turn do
7074 the installation of the rest of the extra modules or bundles.)
7076 Notice also that if the modules require any external software such as
7077 libraries and headers (the libz library and the zlib.h header for the
7078 Compress::Zlib module, for example) you MUST have any such software
7079 already installed, this configuration process will NOT install such
7082 If this doesn't make any sense to you, just accept the default '$dflt'.
7084 rp='Install any extra modules (y or n)?'
7090 Please list any extra modules or bundles to be installed from CPAN,
7091 with spaces between the names. The names can be in any format the
7092 'install' command of CPAN.pm will understand. (Answer 'none',
7093 without the quotes, to install no extra modules or bundles.)
7103 $rm -f ../extras.lst
7105 *) echo "(Saving the list of extras for later...)"
7106 echo "$extras" > ../extras.lst
7114 : Find perl5.005 or later.
7115 echo "Looking for a previously installed perl5.005 or later... "
7117 '') for tdir in `echo "$binexp$path_sep$PATH" | $sed "s/$path_sep/ /g"`; do
7118 : Check if this perl is recent and can load a simple module
7119 if $test -x $tdir/perl$exe_ext && $tdir/perl -Mless -e 'use 5.005;' >/dev/null 2>&1; then
7122 elif $test -x $tdir/perl5$exe_ext && $tdir/perl5 -Mless -e 'use 5.005;' >/dev/null 2>&1; then
7132 '') echo "None found. That's ok.";;
7133 *) echo "Using $perl5." ;;
7136 : Determine list of previous versions to include in @INC
7137 $cat > getverlist <<EOPL
7140 \$api_versionstring = "$api_versionstring";
7141 \$version = "$version";
7142 \$stem = "$sitelib_stem";
7143 \$archname = "$archname";
7145 $cat >> getverlist <<'EOPL'
7146 # Can't have leading @ because metaconfig interprets it as a command!
7147 ;@inc_version_list=();
7148 # XXX Redo to do opendir/readdir?
7151 ;@candidates = glob("5.*");
7157 # XXX ToDo: These comparisons must be reworked when two-digit
7158 # subversions come along, so that 5.7.10 compares as greater than
7159 # 5.7.3! By that time, hope that 5.6.x is sufficiently
7160 # widespread that we can use the built-in version vectors rather
7161 # than reinventing them here. For 5.6.0, however, we must
7162 # assume this script will likely be run by 5.005_0x. --AD 1/2000.
7163 foreach $d (@candidates) {
7164 if ($d lt $version) {
7165 if ($d ge $api_versionstring) {
7166 unshift(@inc_version_list, grep { -d } "$d/$archname", $d);
7168 elsif ($d ge "5.005") {
7169 unshift(@inc_version_list, grep { -d } $d);
7173 # Skip newer version. I.e. don't look in
7174 # 5.7.0 if we're installing 5.6.1.
7178 if (@inc_version_list) {
7179 print join(' ', @inc_version_list);
7182 # Blank space to preserve value for next Configure run.
7187 case "$inc_version_list" in
7188 '') if test -x "$perl5$exe_ext"; then
7189 dflt=`$perl5 getverlist`
7194 $undef) dflt='none' ;;
7195 *) eval dflt=\"$inc_version_list\" ;;
7198 ''|' ') dflt=none ;;
7201 5.005) case "$bincompat5005" in
7202 $define|true|[yY]*) ;;
7209 In order to ease the process of upgrading, this version of perl
7210 can be configured to use modules built and installed with earlier
7211 versions of perl that were installed under $prefix. Specify here
7212 the list of earlier versions that this version of perl should check.
7213 If Configure detected no earlier versions of perl installed under
7214 $prefix, then the list will be empty. Answer 'none' to tell perl
7215 to not search earlier versions.
7217 The default should almost always be sensible, so if you're not sure,
7218 just accept the default.
7221 rp='List of earlier versions to include in @INC?'
7224 [Nn]one|''|' ') inc_version_list=' ' ;;
7225 *) inc_version_list="$ans" ;;
7227 case "$inc_version_list" in
7229 inc_version_list_init='0';;
7230 *) inc_version_list_init=`echo $inc_version_list |
7231 $sed -e 's/^/"/' -e 's/ /","/g' -e 's/$/",0/'`
7236 : determine whether to install perl also as /usr/bin/perl
7239 if $test -d /usr/bin -a "X$installbin" != X/usr/bin; then
7241 Many scripts expect perl to be installed as /usr/bin/perl.
7242 I can install the perl you are about to compile also as /usr/bin/perl
7243 (in addition to $installbin/perl).
7245 case "$installusrbinperl" in
7246 "$undef"|[nN]*) dflt='n';;
7249 rp="Do you want to install perl as /usr/bin/perl?"
7252 [yY]*) val="$define";;
7258 set installusrbinperl
7261 : see if dld is available
7265 : see if dlopen exists
7272 : determine which dynamic loading, if any, to compile in
7274 dldir="ext/DynaLoader"
7287 $define) dflt='y' ;;
7290 $define) dflt='y' ;;
7292 : Does a dl_xxx.xs file exist for this operating system
7293 $test -f $rsrc/$dldir/dl_${osname}.xs && dflt='y'
7296 rp="Do you wish to use dynamic loading?"
7303 if $test -f $rsrc/$dldir/dl_${osname}.xs ; then
7304 dflt="$dldir/dl_${osname}.xs"
7305 elif $test "$d_dlopen" = "$define" ; then
7306 dflt="$dldir/dl_dlopen.xs"
7307 elif $test "$i_dld" = "$define" ; then
7308 dflt="$dldir/dl_dld.xs"
7313 *) dflt="$dldir/$dlsrc"
7316 echo "The following dynamic loading files are available:"
7317 : Can not go over to $dldir because getfile has path hard-coded in.
7318 tdir=`pwd`; cd "$rsrc"; $ls -C $dldir/dl*.xs; cd "$tdir"
7319 rp="Source file to use for dynamic loading"
7325 dlsrc=`echo $ans | $sed -e 's%.*/\([^/]*\)$%\1%'`
7329 Some systems may require passing special flags to $cc -c to
7330 compile modules that will be used to create a shared library.
7331 To use no flags, say "none".
7334 case "$cccdlflags" in
7335 '') case "$gccversion" in
7336 '') case "$osname" in
7338 next) dflt='none' ;;
7339 irix*) dflt='-KPIC' ;;
7340 svr4*|esix*|solaris|nonstopux) dflt='-KPIC' ;;
7341 sunos) dflt='-pic' ;;
7345 *) case "$osname" in
7346 darwin) dflt='none' ;;
7347 svr4*|esix*|solaris|nonstopux) dflt='-fPIC' ;;
7352 *) dflt="$cccdlflags" ;;
7354 rp="Any special flags to pass to $cc -c to compile shared library modules?"
7357 none) cccdlflags=' ' ;;
7358 *) cccdlflags="$ans" ;;
7363 Some systems use ld to create libraries that can be dynamically loaded,
7364 while other systems (such as those using ELF) use $cc.
7368 '') $cat >try.c <<'EOM'
7369 /* Test for whether ELF binaries are produced */
7374 int i = open("a.out",O_RDONLY);
7377 if(read(i,b,4)==4 && b[0]==127 && b[1]=='E' && b[2]=='L' && b[3]=='F')
7378 exit(0); /* succeed (yes, it's ELF) */
7383 if $cc $ccflags $ldflags try.c >/dev/null 2>&1 && $run ./a.out; then
7385 You appear to have ELF support. I'll use $cc to build dynamic libraries.
7389 echo "I'll use ld to build dynamic libraries."
7398 rp="What command should be used to create dynamic libraries?"
7404 Some systems may require passing special flags to $ld to create a
7405 library that can be dynamically loaded. If your ld flags include
7406 -L/other/path options to locate libraries outside your loader's normal
7407 search path, you may need to specify those -L options here as well. To
7408 use no flags, say "none".
7411 case "$lddlflags" in
7412 '') case "$osname" in
7413 beos) dflt='-nostart' ;;
7415 case "$gccversion" in
7416 '') dflt="$dflt +vnocompatwarnings" ;;
7419 linux|irix*) dflt='-shared' ;;
7420 next) dflt='none' ;;
7421 solaris) dflt='-G' ;;
7422 sunos) dflt='-assert nodefinitions' ;;
7423 svr4*|esix*|nonstopux) dflt="-G $ldflags" ;;
7427 *) dflt="$lddlflags" ;;
7430 : Try to guess additional flags to pick up local libraries.
7431 : Be careful not to append to a plain 'none'
7435 for thisflag in $ldflags; do
7440 *) dflt="$dflt $thisflag" ;;
7447 ''|' ') dflt='none' ;;
7450 rp="Any special flags to pass to $ld to create a dynamically loaded library?"
7453 none) lddlflags=' ' ;;
7454 *) lddlflags="$ans" ;;
7459 Some systems may require passing special flags to $cc to indicate that
7460 the resulting executable will use dynamic linking. To use no flags,
7464 case "$ccdlflags" in
7465 '') case "$osname" in
7466 hpux) dflt='-Wl,-E' ;;
7467 linux) dflt='-rdynamic' ;;
7468 next) dflt='none' ;;
7469 sunos) dflt='none' ;;
7473 *) dflt="$ccdlflags" ;;
7475 rp="Any special flags to pass to $cc to use dynamic linking?"
7478 none) ccdlflags=' ' ;;
7479 *) ccdlflags="$ans" ;;
7493 # No dynamic loading being used, so don't bother even to prompt.
7496 *) case "$useshrplib" in
7497 '') case "$osname" in
7498 svr4*|nonstopux|dgux|dynixptx|esix|powerux|beos|cygwin*)
7500 also='Building a shared libperl is required for dynamic loading to work on your system.'
7505 also='Building a shared libperl is needed for MAB support.'
7523 The perl executable is normally obtained by linking perlmain.c with
7524 libperl${_a}, any static extensions (usually just DynaLoader), and
7525 any other libraries needed on this system (such as -lm, etc.). Since
7526 your system supports dynamic loading, it is probably possible to build
7527 a shared libperl.$so. If you will have more than one executable linked
7528 to libperl.$so, this will significantly reduce the size of each
7529 executable, but it may have a noticeable affect on performance. The
7530 default is probably sensible for your system.
7534 rp="Build a shared libperl.$so (y/n)"
7538 useshrplib='true' ;;
7539 *) useshrplib='false' ;;
7544 case "$useshrplib" in
7548 # Figure out a good name for libperl.so. Since it gets stored in
7549 # a version-specific architecture-dependent library, the version
7550 # number isn't really that important, except for making cc/ld happy.
7552 # A name such as libperl.so.3.1
7553 majmin="libperl.$so.$patchlevel.$subversion"
7554 # A name such as libperl.so.301
7555 majonly=`echo $patchlevel $subversion |
7556 $awk '{printf "%d%02d", $1, $2}'`
7557 majonly=libperl.$so.$majonly
7558 # I'd prefer to keep the os-specific stuff here to a minimum, and
7559 # rely on figuring it out from the naming of libc.
7560 case "${osname}${osvers}" in
7563 # XXX How handle the --version stuff for MAB?
7565 linux*) # ld won't link with a bare -lperl otherwise.
7568 cygwin*) # ld links against an importlib
7569 dflt=libperl$lib_ext
7571 *) # Try to guess based on whether libc has major.minor.
7573 *libc.$so.[0-9]*.[0-9]*) dflt=$majmin ;;
7574 *libc.$so.[0-9]*) dflt=$majonly ;;
7575 *) dflt=libperl.$so ;;
7585 I need to select a good name for the shared libperl. If your system uses
7586 library names with major and minor numbers, then you might want something
7587 like $majmin. Alternatively, if your system uses a single version
7588 number for shared libraries, then you might want to use $majonly.
7589 Or, your system might be quite happy with a simple libperl.$so.
7591 Since the shared libperl will get installed into a version-specific
7592 architecture-dependent directory, the version number of the shared perl
7593 library probably isn't important, so the default should be o.k.
7596 rp='What name do you want to give to the shared libperl?'
7599 echo "Ok, I'll use $libperl"
7602 libperl="libperl${_a}"
7606 # Detect old use of shrpdir via undocumented Configure -Dshrpdir
7610 WARNING: Use of the shrpdir variable for the installation location of
7611 the shared $libperl is not supported. It was never documented and
7612 will not work in this version. Let me (perlbug@perl.org)
7613 know of any problems this may cause.
7619 But your current setting of $shrpdir is
7620 the default anyway, so it's harmless.
7625 Further, your current attempted setting of $shrpdir
7626 conflicts with the value of $archlibexp/CORE
7627 that installperl will use.
7634 # How will the perl executable find the installed shared $libperl?
7635 # Add $xxx to ccdlflags.
7636 # If we can't figure out a command-line option, use $shrpenv to
7637 # set env LD_RUN_PATH. The main perl makefile uses this.
7638 shrpdir=$archlibexp/CORE
7641 if "$useshrplib"; then
7644 # We'll set it in Makefile.SH...
7650 xxx="-Wl,-R$shrpdir"
7652 bsdos|linux|irix*|dec_osf)
7653 xxx="-Wl,-rpath,$shrpdir"
7656 # next doesn't like the default...
7659 # beos doesn't like the default, either.
7662 # hpux doesn't like the default, either.
7663 tmp_shrpenv="env LDOPTS=\"+s +b${shrpdir}\""
7666 tmp_shrpenv="env LD_RUN_PATH=$shrpdir"
7672 # Only add $xxx if it isn't already in ccdlflags.
7673 case " $ccdlflags " in
7675 *) ccdlflags="$ccdlflags $xxx"
7678 Adding $xxx to the flags
7679 passed to $ld so that the perl executable will find the
7680 installed shared $libperl.
7688 # Fix ccdlflags in AIX for building external extensions.
7689 # (For building Perl itself bare -bE:perl.exp is needed,
7690 # Makefile.SH takes care of this.)
7692 aix) ccdlflags="$ccdlflags -bE:$installarchlib/CORE/perl.exp" ;;
7694 # Respect a hint or command-line value.
7696 '') shrpenv="$tmp_shrpenv" ;;
7698 case "$ldlibpthname" in
7699 '') ldlibpthname=LD_LIBRARY_PATH ;;
7700 none) ldlibpthname='' ;;
7703 : determine where manual pages are on this system
7707 syspath='/usr/share/man/man1 /usr/man/man1'
7708 syspath="$syspath /usr/man/mann /usr/man/manl /usr/man/local/man1"
7709 syspath="$syspath /usr/man/u_man/man1"
7710 syspath="$syspath /usr/catman/u_man/man1 /usr/man/l_man/man1"
7711 syspath="$syspath /usr/local/man/u_man/man1 /usr/local/man/l_man/man1"
7712 syspath="$syspath /usr/man/man.L /local/man/man1 /usr/local/man/man1"
7713 sysman=`./loc . /usr/man/man1 $syspath`
7716 if $test -d "$sysman"; then
7717 echo "System manual is in $sysman." >&4
7719 echo "Could not find manual pages in source form." >&4
7722 : determine where manual pages go
7723 set man1dir man1dir none
7727 $spackage has manual pages available in source form.
7731 echo "However, you don't have nroff, so they're probably useless to you."
7733 '') man1dir="none";;
7736 echo "If you don't want the manual sources installed, answer 'none'."
7741 lookpath="$prefixexp/share/man/man1"
7742 lookpath="$lookpath $prefixexp/man/man1 $prefixexp/man/l_man/man1"
7743 lookpath="$lookpath $prefixexp/man/p_man/man1"
7744 lookpath="$lookpath $prefixexp/man/u_man/man1"
7745 lookpath="$lookpath $prefixexp/man/man.1"
7747 */?_man*) dflt=`./loc . $prefixexp/l_man/man1 $lookpath` ;;
7748 *) dflt=`./loc . $prefixexp/man/man1 $lookpath` ;;
7758 rp="Where do the main $spackage manual pages (source) go?"
7760 if $test "X$man1direxp" != "X$ansexp"; then
7764 man1direxp="$ansexp"
7770 : Change installation prefix, if necessary.
7771 if $test X"$prefix" != X"$installprefix"; then
7772 installman1dir=`echo $man1direxp | $sed "s#^$prefix#$installprefix#"`
7774 installman1dir="$man1direxp"
7777 : What suffix to use on installed man pages
7784 rp="What suffix should be used for the main $spackage man pages?"
7786 '') case "$man1dir" in
7800 *) dflt="$man1ext";;
7807 : see if we can have long filenames
7809 first=123456789abcdef
7811 if (echo hi >$first) 2>/dev/null; then
7812 if $test -f 123456789abcde; then
7813 echo 'You cannot have filenames longer than 14 characters. Sigh.' >&4
7816 echo 'You can have filenames longer than 14 characters.'>&4
7821 You can't have filenames longer than 14 chars.
7822 You can't even think about them!
7828 $rm -rf 123456789abcde*
7830 : determine where library module manual pages go
7831 set man3dir man3dir none
7835 $spackage has manual pages for many of the library modules.
7841 However, you don't have nroff, so they're probably useless to you.
7844 '') man3dir="none";;
7848 case "$d_flexfnam" in
7851 However, your system can't handle the long file names like File::Basename.3.
7854 '') man3dir="none";;
7858 echo "If you don't want the manual sources installed, answer 'none'."
7859 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
7861 '') dflt=`echo "$man1dir" | $sed -e 's/man1/man3/g' -e 's/man\.1/man\.3/g'`
7862 if $test -d "$privlib/man/man3"; then
7865 WARNING: Previous versions of perl installed man3 pages into
7866 $privlib/man/man3. This version will suggest a
7867 new default of $dflt.
7871 rp='Do you wish to preserve the old behavior?(y/n)'
7874 y*) dflt="$privlib/man/man3" ;;
7879 *) dflt="$man3dir" ;;
7886 rp="Where do the $package library man pages (source) go?"
7889 man3direxp="$ansexp"
7895 : Change installation prefix, if necessary.
7896 if $test X"$prefix" != X"$installprefix"; then
7897 installman3dir=`echo $man3direxp | $sed "s#^$prefix#$installprefix#"`
7899 installman3dir="$man3direxp"
7902 : What suffix to use on installed man pages
7908 rp="What suffix should be used for the $package library man pages?"
7910 '') case "$man3dir" in
7924 *) dflt="$man3ext";;
7931 : see if we have to deal with yellow pages, now NIS.
7932 if $test -d /usr/etc/yp || $test -d /etc/yp || $test -d /usr/lib/yp; then
7933 if $test -f /usr/etc/nibindd; then
7935 echo "I'm fairly confident you're on a NeXT."
7937 rp='Do you get the hosts file via NetInfo?'
7946 y*) hostcat='nidump hosts .';;
7947 *) case "$hostcat" in
7948 nidump*) hostcat='';;
7958 '') if $contains '^\+' /etc/passwd >/dev/null 2>&1; then
7966 rp='Are you getting the hosts file via yellow pages?'
7969 y*) hostcat='ypcat hosts';;
7970 *) hostcat='cat /etc/hosts';;
7976 '') test -f /etc/hosts && hostcat='cat /etc/hosts';;
7979 '') test -f /etc/group && groupcat='cat /etc/group';;
7982 '') test -f /etc/passwd && passcat='cat /etc/passwd';;
7985 : now get the host name
7987 echo "Figuring out host name..." >&4
7988 case "$myhostname" in
7990 echo 'Maybe "hostname" will work...'
7991 if tans=`sh -c hostname 2>&1` ; then
7999 if $test "$cont"; then
8001 echo 'Oh, dear. Maybe "/etc/systemid" is the key...'
8002 if tans=`cat /etc/systemid 2>&1` ; then
8004 phostname='cat /etc/systemid'
8005 echo "Whadyaknow. Xenix always was a bit strange..."
8008 elif $test -r /etc/systemid; then
8009 echo "(What is a non-Xenix system doing with /etc/systemid?)"
8012 if $test "$cont"; then
8013 echo 'No, maybe "uuname -l" will work...'
8014 if tans=`sh -c 'uuname -l' 2>&1` ; then
8016 phostname='uuname -l'
8018 echo 'Strange. Maybe "uname -n" will work...'
8019 if tans=`sh -c 'uname -n' 2>&1` ; then
8021 phostname='uname -n'
8023 echo 'Oh well, maybe I can mine it out of whoami.h...'
8024 if tans=`sh -c $contains' sysname $usrinc/whoami.h' 2>&1` ; then
8025 myhostname=`echo "$tans" | $sed 's/^.*"\(.*\)"/\1/'`
8026 phostname="sed -n -e '"'/sysname/s/^.*\"\\(.*\\)\"/\1/{'"' -e p -e q -e '}' <$usrinc/whoami.h"
8028 case "$myhostname" in
8029 '') echo "Does this machine have an identity crisis or something?"
8032 echo "Well, you said $myhostname before..."
8033 phostname='echo $myhostname';;
8039 case "$myhostname" in
8040 '') myhostname=noname ;;
8042 : you do not want to know about this
8047 if $test "$myhostname" ; then
8049 rp='Your host name appears to be "'$myhostname'".'" Right?"
8057 : bad guess or no guess
8058 while $test "X$myhostname" = X ; do
8060 rp="Please type the (one word) name of your host:"
8065 : translate upper to lower if necessary
8066 case "$myhostname" in
8068 echo "(Normalizing case in your host name)"
8069 myhostname=`echo $myhostname | ./tr '[A-Z]' '[a-z]'`
8073 case "$myhostname" in
8075 dflt=`expr "X$myhostname" : "X[^.]*\(\..*\)"`
8076 myhostname=`expr "X$myhostname" : "X\([^.]*\)\."`
8077 echo "(Trimming domain name from host name--host name is now $myhostname)"
8079 *) case "$mydomain" in
8082 test "X$hostcat" = "Xypcat hosts" &&
8083 ypmatch "$myhostname" hosts 2>/dev/null |\
8084 $sed -e 's/[ ]*#.*//; s/$/ /' > hosts && \
8087 test "X$hostcat" != "X" &&
8088 $hostcat | $sed -n -e "s/[ ]*#.*//; s/\$/ /
8089 /[ ]$myhostname[ . ]/p" > hosts
8092 if $test -f hosts; then
8093 $test x`$awk "/[0-9].*[ ]$myhostname$tmp_re/ { sum++ }
8094 END { print sum }" hosts` = x1 || tmp_re="[ ]"
8095 dflt=.`$awk "/[0-9].*[ ]$myhostname$tmp_re/ {for(i=2; i<=NF;i++) print \\\$i}" \
8096 hosts | $sort | $uniq | \
8097 $sed -n -e "s/$myhostname\.\([-a-zA-Z0-9_.]\)/\1/p"`
8098 case `$echo X$dflt` in
8099 X*\ *) echo "(Several hosts in the database matched hostname)"
8102 X.) echo "(You do not have fully-qualified names in the hosts database)"
8106 echo "(I cannot locate a hosts database anywhere)"
8111 tans=`./loc resolv.conf X /etc /usr/etc`
8112 if $test -f "$tans"; then
8113 echo "(Attempting domain name extraction from $tans)"
8114 dflt=.`$sed -n -e 's/ / /g' \
8115 -e 's/^search *\([^ ]*\).*/\1/p' $tans \
8116 | ./tr '[A-Z]' '[a-z]' 2>/dev/null`
8118 .) dflt=.`$sed -n -e 's/ / /g' \
8119 -e 's/^domain *\([^ ]*\).*/\1/p' $tans \
8120 | ./tr '[A-Z]' '[a-z]' 2>/dev/null`
8127 .) echo "(No help from resolv.conf either -- attempting clever guess)"
8128 dflt=.`sh -c domainname 2>/dev/null`
8131 .nis.*|.yp.*|.main.*) dflt=`echo $dflt | $sed -e 's/^\.[^.]*//'`;;
8135 case "$dflt$osname" in
8136 .os390) echo "(Attempting domain name extraction from //'SYS1.TCPPARMS(TCPDATA)')"
8137 dflt=.`awk '/^DOMAINORIGIN/ {print $2}' "//'SYS1.TCPPARMS(TCPDATA)'" 2>/dev/null`
8141 .) echo "(Lost all hope -- silly guess then)"
8147 *) dflt="$mydomain";;
8151 rp="What is your domain name?"
8161 : translate upper to lower if necessary
8164 echo "(Normalizing case in your domain name)"
8165 mydomain=`echo $mydomain | ./tr '[A-Z]' '[a-z]'`
8169 : a little sanity check here
8170 case "$phostname" in
8173 case `$phostname | ./tr '[A-Z]' '[a-z]'` in
8174 $myhostname$mydomain|$myhostname) ;;
8176 case "$phostname" in
8178 echo "(That doesn't agree with your whoami.h file, by the way.)"
8181 echo "(That doesn't agree with your $phostname command, by the way.)"
8191 I need to get your e-mail address in Internet format if possible, i.e.
8192 something like user@host.domain. Please answer accurately since I have
8193 no easy means to double check it. The default value provided below
8194 is most probably close to reality but may not be valid from outside
8195 your organization...
8199 while test "$cont"; do
8201 '') dflt="$cf_by@$myhostname$mydomain";;
8202 *) dflt="$cf_email";;
8204 rp='What is your e-mail address?'
8210 rp='Address does not look like an Internet one. Use it anyway?'
8226 If you or somebody else will be maintaining perl at your site, please
8227 fill in the correct e-mail address here so that they may be contacted
8228 if necessary. Currently, the "perlbug" program included with perl
8229 will send mail to this address in addition to perlbug@perl.org. You may
8230 enter "none" for no administrator.
8233 case "$perladmin" in
8234 '') dflt="$cf_email";;
8235 *) dflt="$perladmin";;
8237 rp='Perl administrator e-mail address'
8241 : determine whether to only install version-specific parts.
8244 Do you want to install only the version-specific parts of the perl
8245 distribution? Usually you do *not* want to do this.
8247 case "$versiononly" in
8248 "$define"|[Yy]*|true) dflt='y' ;;
8251 rp="Do you want to install only the version-specific parts of perl?"
8254 [yY]*) val="$define";;
8260 : figure out how to guarantee perl startup
8261 case "$startperl" in
8263 case "$sharpbang" in
8267 I can use the #! construct to start perl on your system. This will
8268 make startup of perl scripts faster, but may cause problems if you
8269 want to share those scripts and perl is not in a standard place
8270 ($binexp/perl) on all your platforms. The alternative is to force
8271 a shell by starting the script with a single ':' character.
8274 case "$versiononly" in
8275 "$define") dflt="$binexp/perl$version";;
8276 *) dflt="$binexp/perl";;
8278 rp='What shall I put after the #! to start up perl ("none" to not use #!)?'
8281 none) startperl=": # use perl";;
8282 *) startperl="#!$ans"
8283 if $test 30 -lt `echo "$ans" | wc -c`; then
8286 WARNING: Some systems limit the #! command to 32 characters.
8287 If you experience difficulty running Perl scripts with #!, try
8288 installing Perl in a directory with a shorter pathname.
8294 *) startperl=": # use perl"
8299 echo "I'll use $startperl to start perl scripts."
8301 : figure best path for perl in scripts
8304 case "$versiononly" in
8305 "$define") perlpath="$binexp/perl$version";;
8306 *) perlpath="$binexp/perl";;
8308 case "$startperl" in
8313 I will use the "eval 'exec'" idiom to start Perl on your system.
8314 I can use the full path of your Perl binary for this purpose, but
8315 doing so may cause problems if you want to share those scripts and
8316 Perl is not always in a standard place ($binexp/perl).
8320 rp="What path shall I use in \"eval 'exec'\"?"
8327 case "$startperl" in
8329 *) echo "I'll use $perlpath in \"eval 'exec'\"" ;;
8332 : determine where public executable scripts go
8333 set scriptdir scriptdir
8335 case "$scriptdir" in
8338 : guess some guesses
8339 $test -d /usr/share/scripts && dflt=/usr/share/scripts
8340 $test -d /usr/share/bin && dflt=/usr/share/bin
8341 $test -d /usr/local/script && dflt=/usr/local/script
8342 $test -d /usr/local/scripts && dflt=/usr/local/scripts
8343 $test -d $prefixexp/script && dflt=$prefixexp/script
8347 *) dflt="$scriptdir"
8352 Some installations have a separate directory just for executable scripts so
8353 that they can mount it across multiple architectures but keep the scripts in
8354 one spot. You might, for example, have a subdirectory of /usr/share for this.
8355 Or you might just lump your scripts in with all your other executables.
8359 rp='Where do you keep publicly executable scripts?'
8361 if $test "X$ansexp" != "X$scriptdirexp"; then
8365 scriptdirexp="$ansexp"
8366 : Change installation prefix, if necessary.
8367 if $test X"$prefix" != X"$installprefix"; then
8368 installscript=`echo $scriptdirexp | sed "s#^$prefix#$installprefix#"`
8370 installscript="$scriptdirexp"
8373 : determine where add-on public executables go
8375 '') dflt=$siteprefix/bin ;;
8379 rp='Pathname where the add-on public executables should be installed?'
8382 sitebinexp="$ansexp"
8383 : Change installation prefix, if necessary.
8384 if $test X"$prefix" != X"$installprefix"; then
8385 installsitebin=`echo $sitebinexp | sed "s#^$prefix#$installprefix#"`
8387 installsitebin="$sitebinexp"
8390 : define an is-a-typedef? function
8391 typedef='type=$1; var=$2; def=$3; shift; shift; shift; inclist=$@;
8393 "") inclist="sys/types.h";;
8395 eval "varval=\$$var";
8399 for inc in $inclist; do
8400 echo "#include <$inc>" >>temp.c;
8402 echo "#ifdef $type" >> temp.c;
8403 echo "printf(\"We have $type\");" >> temp.c;
8404 echo "#endif" >> temp.c;
8405 $cppstdin $cppflags $cppminus < temp.c >temp.E 2>/dev/null;
8406 if $contains $type temp.E >/dev/null 2>&1; then
8412 *) eval "$var=\$varval";;
8415 : define an is-a-typedef? function that prompts if the type is not available.
8416 typedef_ask='type=$1; var=$2; def=$3; shift; shift; shift; inclist=$@;
8418 "") inclist="sys/types.h";;
8420 eval "varval=\$$var";
8424 for inc in $inclist; do
8425 echo "#include <$inc>" >>temp.c;
8427 echo "#ifdef $type" >> temp.c;
8428 echo "printf(\"We have $type\");" >> temp.c;
8429 echo "#endif" >> temp.c;
8430 $cppstdin $cppflags $cppminus < temp.c >temp.E 2>/dev/null;
8432 echo "$rp" | $sed -e "s/What is/Looking for/" -e "s/?/./";
8433 if $contains $type temp.E >/dev/null 2>&1; then
8434 echo "$type found." >&4;
8437 echo "$type NOT found." >&4;
8443 *) eval "$var=\$varval";;
8446 : see what type lseek is declared as in the kernel
8447 rp="What is the type used for lseek's offset on this system?"
8448 set off_t lseektype long stdio.h sys/types.h
8452 echo "Checking to see how big your file offsets are..." >&4
8454 #include <sys/types.h>
8458 printf("%d\n", (int)sizeof($lseektype));
8463 if eval $compile_ok; then
8464 lseeksize=`$run ./try`
8465 echo "Your file offsets are $lseeksize bytes long."
8469 echo "(I can't seem to compile the test program. Guessing...)"
8470 rp="What is the size of your file offsets (in bytes)?"
8476 : see what type file positions are declared as in the library
8477 rp="What is the type for file position used by fsetpos()?"
8478 set fpos_t fpostype long stdio.h sys/types.h
8483 *_t) zzz="$fpostype" ;;
8486 echo "Checking the size of $zzz..." >&4
8488 #include <sys/types.h>
8491 printf("%d\n", (int)sizeof($fpostype));
8496 if eval $compile_ok; then
8500 echo "(I can't execute the test program--guessing $fpossize.)" >&4
8503 echo "Your $zzz is $fpossize bytes long."
8509 echo "(I can't compile the test program. Guessing...)" >&4
8510 rp="What is the size of your file positions (in bytes)?"
8517 # Backward compatibility (uselfs is deprecated).
8519 "$define"|true|[yY]*)
8522 *** Configure -Duselfs is deprecated, using -Duselargefiles instead.
8524 uselargefiles="$define"
8528 case "$lseeksize:$fpossize" in
8531 You can have files larger than 2 gigabytes.
8534 *) case "$uselargefiles" in
8535 "$undef"|false|[nN]*) dflt='n' ;;
8540 Perl can be built to understand large files (files larger than 2 gigabytes)
8541 on some systems. To do so, Configure can be run with -Duselargefiles.
8543 If this doesn't make any sense to you, just accept the default '$dflt'.
8545 rp='Try to understand large files, if available?'
8548 y|Y) val="$define" ;;
8555 case "$uselargefiles" in
8557 : Look for a hint-file generated 'call-back-unit'. If the
8558 : user has specified that a large files perl is to be built,
8559 : we may need to set or change some other defaults.
8560 if $test -f uselargefiles.cbu; then
8561 echo "Your platform has some specific hints for large file builds, using them..."
8562 . ./uselargefiles.cbu
8564 echo "Rechecking to see how big your file offsets are..." >&4
8566 #include <sys/types.h>
8570 printf("%d\n", (int)sizeof($lseektype));
8575 if eval $compile_ok; then
8576 lseeksize=`$run ./try`
8577 $echo "Your file offsets are now $lseeksize bytes long."
8581 echo "(I can't seem to compile the test program. Guessing...)"
8582 rp="What is the size of your file offsets (in bytes)?"
8587 *_t) zzz="$fpostype" ;;
8590 $echo $n "Rechecking the size of $zzz...$c" >&4
8592 #include <sys/types.h>
8595 printf("%d\n", (int)sizeof($fpostype));
8600 if eval $compile_ok; then
8605 echo "(I can't execute the test program--guessing $fpossize.)" >&4
8608 echo " $fpossize bytes." >&4
8614 echo "(I can't compile the test program. Guessing...)" >&4
8615 rp="What is the size of your file positions (in bytes)?"
8624 case "$vendorprefix" in
8625 '') d_vendorbin="$undef"
8629 *) d_vendorbin="$define"
8630 : determine where vendor-supplied executables go.
8631 case "$vendorbin" in
8632 '') dflt=$vendorprefix/bin ;;
8633 *) dflt="$vendorbin" ;;
8636 rp='Pathname for the vendor-supplied executables directory?'
8639 vendorbinexp="$ansexp"
8642 : Change installation prefix, if necessary.
8643 if $test X"$prefix" != X"$installprefix"; then
8644 installvendorbin=`echo $vendorbinexp | $sed "s#^$prefix#$installprefix#"`
8646 installvendorbin="$vendorbinexp"
8649 : see if qgcvt exists
8653 : Check how to convert floats to strings.
8655 echo "Checking for an efficient way to convert floats to strings."
8657 case "$uselongdouble" in
8658 "$define") echo "#define USE_LONG_DOUBLE" >>try.c ;;
8660 case "$d_longdbl" in
8661 "$define") echo "#define HAS_LONG_DOUBLE" >>try.c ;;
8663 case "$d_PRIgldbl" in
8664 "$define") echo "#define HAS_PRIgldbl" >>try.c ;;
8668 #define Gconvert(x,n,t,b) gconvert((x),(n),(t),(b))
8669 char *myname = "gconvert";
8672 #define Gconvert(x,n,t,b) gcvt((x),(n),(b))
8673 char *myname = "gcvt";
8676 #define Gconvert(x,n,t,b) qgcvt((x),(n),(b))
8677 char *myname = "qgcvt";
8678 #define DOUBLETYPE long double
8681 #if defined(USE_LONG_DOUBLE) && defined(HAS_LONG_DOUBLE) && defined(HAS_PRIgldbl)
8682 #define Gconvert(x,n,t,b) sprintf((b),"%.*"$sPRIgldbl,(n),(x))
8684 #define Gconvert(x,n,t,b) sprintf((b),"%.*g",(n),(x))
8686 char *myname = "sprintf";
8690 #if defined(USE_LONG_DOUBLE) && defined(HAS_LONG_DOUBLE)
8691 #define DOUBLETYPE long double
8693 #define DOUBLETYPE double
8699 #define I_STDLIB $i_stdlib
8705 checkit(expect, got)
8709 if (strcmp(expect, got)) {
8710 printf("%s oddity: Expected %s, got %s\n",
8711 myname, expect, got);
8721 /* This must be 1st test on (which?) platform */
8722 /* Alan Burlison <AlanBurlsin@unn.unisys.com> */
8723 Gconvert((DOUBLETYPE)0.1, 8, 0, buf);
8724 checkit("0.1", buf);
8726 Gconvert((DOUBLETYPE)1.0, 8, 0, buf);
8729 Gconvert((DOUBLETYPE)1.1, 8, 0, buf);
8730 checkit("1.1", buf);
8732 Gconvert((DOUBLETYPE)1.01, 8, 0, buf);
8733 checkit("1.01", buf);
8735 Gconvert((DOUBLETYPE)1.001, 8, 0, buf);
8736 checkit("1.001", buf);
8738 Gconvert((DOUBLETYPE)1.0001, 8, 0, buf);
8739 checkit("1.0001", buf);
8741 Gconvert((DOUBLETYPE)1.00001, 8, 0, buf);
8742 checkit("1.00001", buf);
8744 Gconvert((DOUBLETYPE)1.000001, 8, 0, buf);
8745 checkit("1.000001", buf);
8747 Gconvert((DOUBLETYPE)0.0, 8, 0, buf);
8750 Gconvert((DOUBLETYPE)-1.0, 8, 0, buf);
8753 /* Some Linux gcvt's give 1.e+5 here. */
8754 Gconvert((DOUBLETYPE)100000.0, 8, 0, buf);
8755 checkit("100000", buf);
8757 /* Some Linux gcvt's give -1.e+5 here. */
8758 Gconvert((DOUBLETYPE)-100000.0, 8, 0, buf);
8759 checkit("-100000", buf);
8761 Gconvert((DOUBLETYPE)123.456, 8, 0, buf);
8762 checkit("123.456", buf);
8764 /* Testing of 1e+129 in bigintpm.t must not get extra '.' here. */
8765 Gconvert((DOUBLETYPE)1e30, 8, 0, buf);
8766 if (strlen(buf) > 5)
8767 checkit("1e+030", buf); /* for Microsoft */
8769 checkit("1e+30", buf);
8774 case "$d_Gconvert" in
8775 gconvert*) xxx_list='gconvert gcvt sprintf' ;;
8776 gcvt*) xxx_list='gcvt gconvert sprintf' ;;
8777 sprintf*) xxx_list='sprintf gconvert gcvt' ;;
8778 *) xxx_list='gconvert gcvt sprintf' ;;
8781 case "$d_longdbl$uselongdouble$d_PRIgldbl" in
8782 "$define$define$define")
8783 # for long doubles prefer first qgcvt, then sprintf
8784 xxx_list="`echo $xxx_list|sed s/sprintf//`"
8785 xxx_list="sprintf $xxx_list"
8787 "$define") xxx_list="qgcvt $xxx_list" ;;
8792 for xxx_convert in $xxx_list; do
8793 echo "Trying $xxx_convert..."
8795 set try -DTRY_$xxx_convert
8796 if eval $compile; then
8797 echo "$xxx_convert() found." >&4
8799 echo "I'll use $xxx_convert to convert floats into a string." >&4
8802 echo "...But $xxx_convert didn't work as I expected."
8805 echo "$xxx_convert NOT found." >&4
8809 case "$xxx_convert" in
8810 gconvert) d_Gconvert='gconvert((x),(n),(t),(b))' ;;
8811 gcvt) d_Gconvert='gcvt((x),(n),(b))' ;;
8812 qgcvt) d_Gconvert='qgcvt((x),(n),(b))' ;;
8813 *) case "$uselongdouble$d_longdbl$d_PRIgldbl" in
8814 "$define$define$define")
8815 d_Gconvert="sprintf((b),\"%.*\"$sPRIgldbl,(n),(x))" ;;
8816 *) d_Gconvert='sprintf((b),"%.*g",(n),(x))' ;;
8821 : see if _fwalk exists
8825 : Initialize h_fcntl
8828 : Initialize h_sysfile
8831 : access call always available on UNIX
8835 : locate the flags for 'access()'
8839 $cat >access.c <<'EOCP'
8840 #include <sys/types.h>
8845 #include <sys/file.h>
8854 : check sys/file.h first, no particular reason here
8855 if $test `./findhdr sys/file.h` && \
8856 $cc -o access $cppflags -DI_SYS_FILE access.c >/dev/null 2>&1 ; then
8858 echo "<sys/file.h> defines the *_OK access constants." >&4
8859 elif $test `./findhdr fcntl.h` && \
8860 $cc -o access $cppflags -DI_FCNTL access.c >/dev/null 2>&1 ; then
8862 echo "<fcntl.h> defines the *_OK access constants." >&4
8863 elif $test `./findhdr unistd.h` && \
8864 $cc -o access $cppflags -DI_UNISTD access.c >/dev/null 2>&1 ; then
8865 echo "<unistd.h> defines the *_OK access constants." >&4
8867 echo "I can't find the four *_OK access constants--I'll use mine." >&4
8873 : see if accessx exists
8874 set accessx d_accessx
8877 : see if alarm exists
8881 : see if atolf exists
8885 : see if atoll exists
8889 : Look for GNU-cc style attribute checking
8891 echo "Checking whether your compiler can handle __attribute__ ..." >&4
8892 $cat >attrib.c <<'EOCP'
8894 void croak (char* pat,...) __attribute__((format(printf,1,2),noreturn));
8896 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
8897 if $contains 'warning' attrib.out >/dev/null 2>&1; then
8898 echo "Your C compiler doesn't fully support __attribute__."
8901 echo "Your C compiler supports __attribute__."
8905 echo "Your C compiler doesn't seem to understand __attribute__ at all."
8912 : see if bcmp exists
8916 : see if bcopy exists
8920 : see if this is a unistd.h system
8921 set unistd.h i_unistd
8924 : see if getpgrp exists
8925 set getpgrp d_getpgrp
8928 case "$d_getpgrp" in
8931 echo "Checking to see which flavor of getpgrp is in use..."
8934 #include <sys/types.h>
8936 # include <unistd.h>
8940 if (getuid() == 0) {
8941 printf("(I see you are running Configure as super-user...)\n");
8945 if (getpgrp(1) == 0)
8954 if $cc -o try -DTRY_BSD_PGRP $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
8955 echo "You have to use getpgrp(pid) instead of getpgrp()." >&4
8957 elif $cc -o try $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
8958 echo "You have to use getpgrp() instead of getpgrp(pid)." >&4
8961 echo "I can't seem to compile and run the test program."
8963 xxx="a USG one, i.e. you use getpgrp()."
8965 # SVR4 systems can appear rather BSD-ish.
8968 xxx="a BSD one, i.e. you use getpgrp(pid)."
8972 xxx="probably a USG one, i.e. you use getpgrp()."
8977 echo "Assuming your getpgrp is $xxx" >&4
8986 : see if setpgrp exists
8987 set setpgrp d_setpgrp
8990 case "$d_setpgrp" in
8993 echo "Checking to see which flavor of setpgrp is in use..."
8996 #include <sys/types.h>
8998 # include <unistd.h>
9002 if (getuid() == 0) {
9003 printf("(I see you are running Configure as super-user...)\n");
9007 if (-1 == setpgrp(1, 1))
9010 if (setpgrp() != -1)
9016 if $cc -o try -DTRY_BSD_PGRP $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
9017 echo 'You have to use setpgrp(pid,pgrp) instead of setpgrp().' >&4
9019 elif $cc -o try $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
9020 echo 'You have to use setpgrp() instead of setpgrp(pid,pgrp).' >&4
9023 echo "(I can't seem to compile and run the test program.)"
9025 xxx="a USG one, i.e. you use setpgrp()."
9027 # SVR4 systems can appear rather BSD-ish.
9030 xxx="a BSD one, i.e. you use setpgrp(pid,pgrp)."
9034 xxx="probably a USG one, i.e. you use setpgrp()."
9039 echo "Assuming your setpgrp is $xxx" >&4
9047 : see if bzero exists
9051 : see if signal is declared as pointer to function returning int or void
9053 xxx=`./findhdr signal.h`
9054 $test "$xxx" && $cppstdin $cppminus $cppflags < $xxx >$$.tmp 2>/dev/null
9055 if $contains 'int.*\*[ ]*signal' $$.tmp >/dev/null 2>&1 ; then
9056 echo "You have int (*signal())() instead of void." >&4
9058 elif $contains 'void.*\*[ ]*signal' $$.tmp >/dev/null 2>&1 ; then
9059 echo "You have void (*signal())()." >&4
9061 elif $contains 'extern[ ]*[(\*]*signal' $$.tmp >/dev/null 2>&1 ; then
9062 echo "You have int (*signal())() instead of void." >&4
9064 elif $contains 'void.*\*.*sig' $$.tmp >/dev/null 2>&1 ; then
9065 echo "You have void (*signal())()." >&4
9068 case "$d_voidsig" in
9070 echo "I can't determine whether signal handler returns void or int..." >&4
9072 rp="What type does your signal handler return?"
9079 echo "As you already told me, signal handler returns void." >&4
9082 *) echo "As you already told me, signal handler returns int." >&4
9089 case "$d_voidsig" in
9090 "$define") signal_t="void";;
9095 : check for ability to cast large floats to 32-bit ints.
9097 echo 'Checking whether your C compiler can cast large floats to int32.' >&4
9098 if $test "$intsize" -ge 4; then
9105 #include <sys/types.h>
9107 $signal_t blech(s) int s; { exit(3); }
9114 signal(SIGFPE, blech);
9116 /* Don't let compiler optimize the test away. Store the number
9117 in a writable string for gcc to pass to sscanf under HP/UX.
9119 sprintf(str, "2147483647");
9120 sscanf(str, "%lf", &f); /* f = (double) 0x7fffffff; */
9124 /* x86 processors will probably give 0x8000 0000, which is a
9125 sign change. We don't want that. We want to mimic SPARC
9126 behavior here, which is to preserve the sign and give
9129 if (i32 != ($xxx) f)
9135 if eval $compile_ok; then
9139 echo "(I can't seem to compile the test program--assuming it can't)"
9147 echo "Nope, it can't."
9154 : check for ability to cast negative floats to unsigned
9156 echo 'Checking whether your C compiler can cast negative float to unsigned.' >&4
9159 #include <sys/types.h>
9161 $signal_t blech(s) int s; { exit(7); }
9162 $signal_t blech_in_list(s) int s; { exit(4); }
9163 unsigned long dummy_long(p) unsigned long p; { return p; }
9164 unsigned int dummy_int(p) unsigned int p; { return p; }
9165 unsigned short dummy_short(p) unsigned short p; { return p; }
9169 unsigned long along;
9171 unsigned short ashort;
9175 /* Frustrate gcc-2.7.2's optimizer which failed this test with
9176 a direct f = -123. assignment. gcc-2.8.0 reportedly
9177 optimized the whole file away
9179 /* Store the number in a writable string for gcc to pass to
9182 sprintf(str, "-123");
9183 sscanf(str, "%lf", &f); /* f = -123.; */
9185 signal(SIGFPE, blech);
9186 along = (unsigned long)f;
9187 aint = (unsigned int)f;
9188 ashort = (unsigned short)f;
9189 if (along != (unsigned long)-123)
9191 if (aint != (unsigned int)-123)
9193 if (ashort != (unsigned short)-123)
9195 sprintf(str, "1073741824.");
9196 sscanf(str, "%lf", &f); /* f = (double)0x40000000; */
9199 along = (unsigned long)f;
9200 if (along != 0x80000000)
9204 along = (unsigned long)f;
9205 if (along != 0x7fffffff)
9209 along = (unsigned long)f;
9210 if (along != 0x80000001)
9214 signal(SIGFPE, blech_in_list);
9215 sprintf(str, "123.");
9216 sscanf(str, "%lf", &f); /* f = 123.; */
9217 along = dummy_long((unsigned long)f);
9218 aint = dummy_int((unsigned int)f);
9219 ashort = dummy_short((unsigned short)f);
9220 if (along != (unsigned long)123)
9222 if (aint != (unsigned int)123)
9224 if (ashort != (unsigned short)123)
9231 if eval $compile_ok; then
9235 echo "(I can't seem to compile the test program--assuming it can't)"
9238 case "$castflags" in
9243 echo "Nope, it can't."
9250 : see if vprintf exists
9252 if set vprintf val -f d_vprintf; eval $csym; $val; then
9253 echo 'vprintf() found.' >&4
9256 #include <varargs.h>
9258 int main() { xxx("foo"); }
9267 exit((unsigned long)vsprintf(buf,"%s",args) > 10L);
9271 if eval $compile && $run ./try; then
9272 echo "Your vsprintf() returns (int)." >&4
9275 echo "Your vsprintf() returns (char*)." >&4
9279 echo 'vprintf() NOT found.' >&4
9290 : see if chown exists
9294 : see if chroot exists
9298 : see if chsize exists
9302 : see if class exists
9306 hasstruct='varname=$1; struct=$2; shift; shift;
9307 while $test $# -ge 2; do
9309 $define) echo "#include <$2>";;
9313 echo "int main () { struct $struct foo; }" >> try.c;
9315 if eval $compile; then
9324 : see if sys/types.h has to be included
9325 set sys/types.h i_systypes
9328 hasfield='varname=$1; struct=$2; field=$3; shift; shift; shift;
9329 while $test $# -ge 2; do
9331 $define) echo "#include <$2>";;
9335 echo "int main () { struct $struct foo; char* bar; bar = (char*)foo.$field; }" >> try.c;
9337 if eval $compile; then
9348 : see whether socket exists
9350 $echo $n "Hmm... $c" >&4
9351 if set socket val -f d_socket; eval $csym; $val; then
9352 echo "Looks like you have Berkeley networking support." >&4
9354 if set setsockopt val -f; eval $csym; $val; then
9357 echo "...but it uses the old BSD 4.1c interface, rather than 4.2." >&4
9361 if $contains socklib libc.list >/dev/null 2>&1; then
9362 echo "Looks like you have Berkeley networking support." >&4
9364 : we will have to assume that it supports the 4.2 BSD interface
9367 echo "You don't have Berkeley networking in libc$_a..." >&4
9368 if test "X$d_socket" = "X$define"; then
9369 echo "...but you seem to believe that you have sockets." >&4
9371 for net in net socket
9373 if test -f /usr/lib/lib$net$_a; then
9374 ( ($nm $nm_opt /usr/lib/lib$net$_a | eval $nm_extract) || \
9375 $ar t /usr/lib/lib$net$_a) 2>/dev/null >> libc.list
9376 if $contains socket libc.list >/dev/null 2>&1; then
9381 echo "...but the Wollongong group seems to have hacked it in." >&4
9382 sockethdr="-I/usr/netinclude"
9385 echo "Found Berkeley sockets interface in lib$net." >&4
9386 if $contains setsockopt libc.list >/dev/null 2>&1; then
9389 echo "...using the old BSD 4.1c interface, rather than 4.2." >&4
9396 if test "X$d_socket" != "X$define"; then
9397 echo "or anywhere else I see." >&4
9405 : see if socketpair exists
9406 set socketpair d_sockpair
9411 echo "Checking the availability of certain socket constants..." >&4
9412 for ENUM in MSG_CTRUNC MSG_DONTROUTE MSG_OOB MSG_PEEK MSG_PROXY SCM_RIGHTS; do
9413 enum=`$echo $ENUM|./tr '[A-Z]' '[a-z]'`
9415 #include <sys/types.h>
9416 #include <sys/socket.h>
9422 set try; if eval $compile; then
9425 set d_${enum}; eval $setvar
9429 : see if this is a sys/uio.h system
9430 set sys/uio.h i_sysuio
9435 echo "Checking to see if your system supports struct cmsghdr..." >&4
9436 set d_cmsghdr_s cmsghdr $i_systypes sys/types.h $d_socket sys/socket.h $i_sysuio sys/uio.h
9438 case "$d_cmsghdr_s" in
9439 "$define") echo "Yes, it does." ;;
9440 *) echo "No, it doesn't." ;;
9444 : check for const keyword
9446 echo 'Checking to see if your C compiler knows about "const"...' >&4
9447 $cat >const.c <<'EOCP'
9448 typedef struct spug { int drokk; } spug;
9455 if $cc -c $ccflags const.c >/dev/null 2>&1 ; then
9457 echo "Yup, it does."
9460 echo "Nope, it doesn't."
9465 : see if crypt exists
9470 $define) cryptlib='' ;;
9471 *) if set crypt val -f d_crypt; eval $csym; $val; then
9472 echo 'crypt() found.' >&4
9476 cryptlib=`./loc Slibcrypt$_a "" $xlibpth`
9477 if $test -z "$cryptlib"; then
9478 cryptlib=`./loc Mlibcrypt$_a "" $xlibpth`
9482 if $test -z "$cryptlib"; then
9483 cryptlib=`./loc Llibcrypt$_a "" $xlibpth`
9487 if $test -z "$cryptlib"; then
9488 cryptlib=`./loc libcrypt$_a "" $libpth`
9492 if $test -z "$cryptlib"; then
9493 echo 'crypt() NOT found.' >&4
9504 : get csh whereabouts
9506 'csh') val="$undef" ;;
9511 : Respect a hint or command line value for full_csh.
9513 '') full_csh=$csh ;;
9516 : see if cuserid exists
9517 set cuserid d_cuserid
9520 : see if this is a limits.h system
9521 set limits.h i_limits
9524 : see if this is a float.h system
9528 : See if number of significant digits in a double precision number is known
9530 $cat >dbl_dig.c <<EOM
9540 printf("Contains DBL_DIG");
9543 $cppstdin $cppflags $cppminus < dbl_dig.c >dbl_dig.E 2>/dev/null
9544 if $contains 'DBL_DIG' dbl_dig.E >/dev/null 2>&1; then
9545 echo "DBL_DIG found." >&4
9548 echo "DBL_DIG NOT found." >&4
9555 hasproto='varname=$1; func=$2; shift; shift;
9556 while $test $# -ge 2; do
9558 $define) echo "#include <$2>";;
9562 $cppstdin $cppflags $cppminus < try.c > tryout.c 2>/dev/null;
9563 if $contains "$func.*(" tryout.c >/dev/null 2>&1; then
9564 echo "$func() prototype found.";
9567 echo "$func() prototype NOT found.";
9572 $rm -f try.c tryout.c'
9574 : see if dbm.h is available
9575 : see if dbmclose exists
9576 set dbmclose d_dbmclose
9579 case "$d_dbmclose" in
9589 *) set rpcsvc/dbm.h i_rpcsvcdbm
9594 *) echo "We won't be including <dbm.h>"
9604 : see if prototype for dbminit is available
9606 set d_dbminitproto dbminit $i_dbm dbm.h
9609 : see if difftime exists
9610 set difftime d_difftime
9613 : see if this is a dirent system
9615 if xinc=`./findhdr dirent.h`; $test "$xinc"; then
9617 echo "<dirent.h> found." >&4
9620 if xinc=`./findhdr sys/dir.h`; $test "$xinc"; then
9621 echo "<sys/dir.h> found." >&4
9624 xinc=`./findhdr sys/ndir.h`
9626 echo "<dirent.h> NOT found." >&4
9631 : Look for type of directory structure.
9633 $cppstdin $cppflags $cppminus < "$xinc" > try.c
9635 case "$direntrytype" in
9638 $define) guess1='struct dirent' ;;
9639 *) guess1='struct direct' ;;
9642 *) guess1="$direntrytype"
9647 'struct dirent') guess2='struct direct' ;;
9648 *) guess2='struct dirent' ;;
9651 if $contains "$guess1" try.c >/dev/null 2>&1; then
9652 direntrytype="$guess1"
9653 echo "Your directory entries are $direntrytype." >&4
9654 elif $contains "$guess2" try.c >/dev/null 2>&1; then
9655 direntrytype="$guess2"
9656 echo "Your directory entries seem to be $direntrytype." >&4
9658 echo "I don't recognize your system's directory entries." >&4
9659 rp="What type is used for directory entries on this system?"
9667 : see if the directory entry stores field length
9669 $cppstdin $cppflags $cppminus < "$xinc" > try.c
9670 if $contains 'd_namlen' try.c >/dev/null 2>&1; then
9671 echo "Good, your directory entry keeps length information in d_namlen." >&4
9674 echo "Your directory entry does not know about the d_namlen field." >&4
9681 : see if this is an sysdir system
9682 set sys/dir.h i_sysdir
9685 : see if this is an sysndir system
9686 set sys/ndir.h i_sysndir
9693 #$i_dirent I_DIRENT /**/
9694 #$i_sysdir I_SYS_DIR /**/
9695 #$i_sysndir I_SYS_NDIR /**/
9696 #$i_systypes I_SYS_TYPES /**/
9697 #if defined(I_SYS_TYPES)
9698 #include <sys/types.h>
9700 #if defined(I_DIRENT)
9702 #if defined(NeXT) && defined(I_SYS_DIR) /* NeXT needs dirent + sys/dir.h */
9703 #include <sys/dir.h>
9707 #include <sys/ndir.h>
9711 #include <ndir.h> /* may be wrong in the future */
9713 #include <sys/dir.h>
9719 DIR *dirp = opendir(".");
9720 if (dirfd(dirp) >= 0)
9727 if eval $compile; then
9731 $define) echo "dirfd() found." >&4 ;;
9732 *) echo "dirfd() NOT found." >&4 ;;
9738 : see if dlerror exists
9741 set dlerror d_dlerror
9745 : see if dlfcn is available
9753 On a few systems, the dynamically loaded modules that perl generates and uses
9754 will need a different extension than shared libs. The default will probably
9762 rp='What is the extension of dynamically loaded modules'
9771 : Check if dlsym need a leading underscore
9777 echo "Checking whether your dlsym() needs a leading underscore ..." >&4
9778 $cat >dyna.c <<'EOM'
9787 #include <dlfcn.h> /* the dynamic linker include file for SunOS/Solaris */
9789 #include <sys/types.h>
9803 int mode = RTLD_LAZY ;
9805 handle = dlopen("./dyna.$dlext", mode) ;
9806 if (handle == NULL) {
9811 symbol = dlsym(handle, "fred") ;
9812 if (symbol == NULL) {
9813 /* try putting a leading underscore */
9814 symbol = dlsym(handle, "_fred") ;
9815 if (symbol == NULL) {
9828 : Call the object file tmp-dyna.o in case dlext=o.
9829 if $cc $ccflags $cccdlflags -c dyna.c > /dev/null 2>&1 &&
9830 mv dyna${_o} tmp-dyna${_o} > /dev/null 2>&1 &&
9831 $ld -o dyna.$dlext $ldflags $lddlflags tmp-dyna${_o} > /dev/null 2>&1 &&
9832 $cc -o fred $ccflags $ldflags $cccdlflags $ccdlflags fred.c $libs > /dev/null 2>&1 && $to dyna.$dlext; then
9835 1) echo "Test program failed using dlopen." >&4
9836 echo "Perhaps you should not use dynamic loading." >&4;;
9837 2) echo "Test program failed using dlsym." >&4
9838 echo "Perhaps you should not use dynamic loading." >&4;;
9839 3) echo "dlsym needs a leading underscore" >&4
9841 4) echo "dlsym doesn't need a leading underscore." >&4;;
9844 echo "I can't compile and run the test program." >&4
9845 echo "I'm guessing that dlsym doesn't need a leading underscore." >&4
9850 $rm -f fred fred.* dyna.$dlext dyna.* tmp-dyna.*
9855 : see if prototype for drand48 is available
9857 set d_drand48proto drand48 $i_stdlib stdlib.h $i_unistd unistd.h
9860 : see if dup2 exists
9864 : see if eaccess exists
9865 set eaccess d_eaccess
9868 : see if endgrent exists
9869 set endgrent d_endgrent
9872 : see if endhostent exists
9873 set endhostent d_endhent
9876 : see if endnetent exists
9877 set endnetent d_endnent
9880 : see if endprotoent exists
9881 set endprotoent d_endpent
9884 : see if endpwent exists
9885 set endpwent d_endpwent
9888 : see if endservent exists
9889 set endservent d_endsent
9892 : Locate the flags for 'open()'
9894 $cat >try.c <<'EOCP'
9895 #include <sys/types.h>
9900 #include <sys/file.h>
9911 : check sys/file.h first to get FREAD on Sun
9912 if $test `./findhdr sys/file.h` && \
9913 set try -DI_SYS_FILE && eval $compile; then
9915 echo "<sys/file.h> defines the O_* constants..." >&4
9917 echo "and you have the 3 argument form of open()." >&4
9920 echo "but not the 3 argument form of open(). Oh, well." >&4
9923 elif $test `./findhdr fcntl.h` && \
9924 set try -DI_FCNTL && eval $compile; then
9926 echo "<fcntl.h> defines the O_* constants..." >&4
9928 echo "and you have the 3 argument form of open()." >&4
9931 echo "but not the 3 argument form of open(). Oh, well." >&4
9936 echo "I can't find the O_* constant definitions! You got problems." >&4
9942 : see which of string.h or strings.h is needed
9944 strings=`./findhdr string.h`
9945 if $test "$strings" && $test -r "$strings"; then
9946 echo "Using <string.h> instead of <strings.h>." >&4
9950 strings=`./findhdr strings.h`
9951 if $test "$strings" && $test -r "$strings"; then
9952 echo "Using <strings.h> instead of <string.h>." >&4
9954 echo "No string header found -- You'll surely have problems." >&4
9960 "$undef") strings=`./findhdr strings.h`;;
9961 *) strings=`./findhdr string.h`;;
9964 : see if this is a sys/file.h system
9969 : do we need to include sys/file.h ?
9975 echo "We'll be including <sys/file.h>." >&4
9978 echo "We won't be including <sys/file.h>." >&4
9988 : see if fcntl.h is there
9993 : see if we can include fcntl.h
9999 echo "We'll be including <fcntl.h>." >&4
10002 if $h_sysfile; then
10003 echo "We don't need to include <fcntl.h> if we include <sys/file.h>." >&4
10005 echo "We won't be including <fcntl.h>." >&4
10017 : check for non-blocking I/O stuff
10018 case "$h_sysfile" in
10019 true) echo "#include <sys/file.h>" > head.c;;
10022 true) echo "#include <fcntl.h>" > head.c;;
10023 *) echo "#include <sys/fcntl.h>" > head.c;;
10028 echo "Figuring out the flag used by open() for non-blocking I/O..." >&4
10029 case "$o_nonblock" in
10031 $cat head.c > try.c
10032 $cat >>try.c <<EOCP
10034 #include <stdlib.h>
10041 printf("O_NONBLOCK\n");
10045 printf("O_NDELAY\n");
10049 printf("FNDELAY\n");
10056 if eval $compile_ok; then
10057 o_nonblock=`$run ./try`
10058 case "$o_nonblock" in
10059 '') echo "I can't figure it out, assuming O_NONBLOCK will do.";;
10060 *) echo "Seems like we can use $o_nonblock.";;
10063 echo "(I can't compile the test program; pray O_NONBLOCK is right!)"
10066 *) echo "Using $hint value $o_nonblock.";;
10068 $rm -f try try.* .out core
10071 echo "Let's see what value errno gets from read() on a $o_nonblock file..." >&4
10074 $cat head.c > try.c
10075 $cat >>try.c <<EOCP
10077 #include <sys/types.h>
10078 #include <signal.h>
10080 #include <stdlib.h>
10085 #define MY_O_NONBLOCK $o_nonblock
10086 #ifndef errno /* XXX need better Configure test */
10089 #$i_unistd I_UNISTD
10091 #include <unistd.h>
10093 #$i_string I_STRING
10095 #include <string.h>
10097 #include <strings.h>
10099 $signal_t blech(x) int x; { exit(3); }
10101 $cat >> try.c <<'EOCP'
10109 pipe(pd); /* Down: child -> parent */
10110 pipe(pu); /* Up: parent -> child */
10113 close(pd[1]); /* Parent reads from pd[0] */
10114 close(pu[0]); /* Parent writes (blocking) to pu[1] */
10116 if (-1 == fcntl(pd[0], F_SETFL, MY_O_NONBLOCK))
10121 signal(SIGALRM, blech);
10123 if ((ret = read(pd[0], buf, 1)) > 0) /* Nothing to read! */
10125 sprintf(string, "%d\n", ret);
10126 write(2, string, strlen(string));
10129 if (errno == EAGAIN) {
10130 printf("EAGAIN\n");
10135 if (errno == EWOULDBLOCK)
10136 printf("EWOULDBLOCK\n");
10139 write(pu[1], buf, 1); /* Unblocks child, tell it to close our pipe */
10140 sleep(2); /* Give it time to close our pipe */
10142 ret = read(pd[0], buf, 1); /* Should read EOF */
10144 sprintf(string, "%d\n", ret);
10145 write(4, string, strlen(string));
10149 close(pd[0]); /* We write to pd[1] */
10150 close(pu[1]); /* We read from pu[0] */
10151 read(pu[0], buf, 1); /* Wait for parent to signal us we may continue */
10152 close(pd[1]); /* Pipe pd is now fully closed! */
10153 exit(0); /* Bye bye, thank you for playing! */
10157 if eval $compile_ok; then
10158 echo "$startsh" >mtry
10159 echo "$run ./try >try.out 2>try.ret 4>try.err || exit 4" >>mtry
10161 ./mtry >/dev/null 2>&1
10163 0) eagain=`$cat try.out`;;
10164 1) echo "Could not perform non-blocking setting!";;
10165 2) echo "I did a successful read() for something that was not there!";;
10166 3) echo "Hmm... non-blocking I/O does not seem to be working!";;
10167 4) echo "Could not find F_SETFL!";;
10168 *) echo "Something terribly wrong happened during testing.";;
10170 rd_nodata=`$cat try.ret`
10171 echo "A read() system call with no data present returns $rd_nodata."
10172 case "$rd_nodata" in
10175 echo "(That's peculiar, fixing that to be -1.)"
10181 echo "Forcing errno EAGAIN on read() with no data available."
10185 echo "Your read() sets errno to $eagain when no data is available."
10188 status=`$cat try.err`
10190 0) echo "And it correctly returns 0 to signal EOF.";;
10191 -1) echo "But it also returns -1 to signal EOF, so be careful!";;
10192 *) echo "However, your read() returns '$status' on EOF??";;
10195 if test "$status" = "$rd_nodata"; then
10196 echo "WARNING: you can't distinguish between EOF and no data!"
10200 echo "I can't compile the test program--assuming errno EAGAIN will do."
10207 echo "Using $hint value $eagain."
10208 echo "Your read() returns $rd_nodata when no data is present."
10209 case "$d_eofnblk" in
10210 "$define") echo "And you can see EOF because read() returns 0.";;
10211 "$undef") echo "But you can't see EOF status from read() returned value.";;
10213 echo "(Assuming you can't see EOF status from read anyway.)"
10219 $rm -f try try.* .out core head.c mtry
10221 : see if fchdir exists
10222 set fchdir d_fchdir
10225 : see if fchmod exists
10226 set fchmod d_fchmod
10229 : see if fchown exists
10230 set fchown d_fchown
10233 : see if this is an fcntl system
10238 : See if fcntl-based locking works.
10240 #include <stdlib.h>
10241 #include <unistd.h>
10243 #include <signal.h>
10244 $signal_t blech(x) int x; { exit(3); }
10246 #if defined(F_SETLK) && defined(F_SETLKW)
10247 struct flock flock;
10249 fd = open("try.c", O_RDONLY);
10250 flock.l_type = F_RDLCK;
10251 flock.l_whence = SEEK_SET;
10252 flock.l_start = flock.l_len = 0;
10253 signal(SIGALRM, blech);
10255 retval = fcntl(fd, F_SETLK, &flock);
10257 (retval < 0 ? exit(2) : exit(0));
10263 echo "Checking if fcntl-based file locking works... "
10267 if eval $compile_ok; then
10268 if $run ./try; then
10269 echo "Yes, it seems to work."
10272 echo "Nope, it didn't work."
10277 *** I had to forcibly timeout from fcntl(..., F_SETLK, ...).
10278 *** This is (almost) impossible.
10279 *** If your NFS lock daemons are not feeling well, something like
10280 *** this may happen, please investigate. Cannot continue, aborting.
10288 echo "I'm unable to compile the test program, so I'll assume not."
10293 echo "Nope, since you don't even have fcntl()."
10296 set d_fcntl_can_lock
10301 : see if sys/select.h has to be included
10302 set sys/select.h i_sysselct
10305 : see if we should include time.h, sys/time.h, or both
10307 if test "X$timeincl" = X; then
10308 echo "Testing to see if we should include <time.h>, <sys/time.h> or both." >&4
10309 $echo $n "I'm now running the test program...$c"
10310 $cat >try.c <<'EOCP'
10311 #include <sys/types.h>
10316 #ifdef SYSTIMEKERNEL
10319 #include <sys/time.h>
10322 #include <sys/select.h>
10328 struct timeval bar;
10331 struct timezone tzp;
10333 if (foo.tm_sec == foo.tm_sec)
10336 if (bar.tv_sec == bar.tv_sec)
10343 for s_timezone in '-DS_TIMEZONE' ''; do
10345 for s_timeval in '-DS_TIMEVAL' ''; do
10346 for i_systimek in '' '-DSYSTIMEKERNEL'; do
10347 for i_time in '' '-DI_TIME'; do
10348 for i_systime in '-DI_SYSTIME' ''; do
10351 set try $i_time $i_systime $i_systimek $sysselect $s_timeval $s_timezone
10352 if eval $compile; then
10353 set X $i_time $i_systime $i_systimek $sysselect $s_timeval
10357 $echo $n "Succeeded with $flags$c"
10369 *SYSTIMEKERNEL*) i_systimek="$define"
10370 timeincl=`./findhdr sys/time.h`
10371 echo "We'll include <sys/time.h> with KERNEL defined." >&4;;
10372 *) i_systimek="$undef";;
10375 *I_TIME*) i_time="$define"
10376 timeincl=`./findhdr time.h`" $timeincl"
10377 echo "We'll include <time.h>." >&4;;
10378 *) i_time="$undef";;
10381 *I_SYSTIME*) i_systime="$define"
10382 timeincl=`./findhdr sys/time.h`" $timeincl"
10383 echo "We'll include <sys/time.h>." >&4;;
10384 *) i_systime="$undef";;
10389 : check for fd_set items
10392 Checking to see how well your C compiler handles fd_set and friends ...
10395 #$i_systime I_SYS_TIME
10396 #$i_sysselct I_SYS_SELECT
10397 #$d_socket HAS_SOCKET
10398 #include <sys/types.h>
10400 #include <sys/socket.h> /* Might include <sys/bsdtypes.h> */
10403 #include <sys/time.h>
10405 #ifdef I_SYS_SELECT
10406 #include <sys/select.h>
10415 #if defined(FD_SET) && defined(FD_CLR) && defined(FD_ISSET) && defined(FD_ZERO)
10423 if eval $compile; then
10424 d_fds_bits="$define"
10426 echo "Well, your system knows about the normal fd_set typedef..." >&4
10427 if $run ./try; then
10428 echo "and you have the normal fd_set macros (just as I'd expect)." >&4
10429 d_fd_macros="$define"
10432 but not the normal fd_set macros! Gaaack! I'll have to cover for you.
10434 d_fd_macros="$undef"
10438 Hmm, your compiler has some difficulty with fd_set. Checking further...
10441 if eval $compile; then
10442 d_fds_bits="$undef"
10444 echo "Well, your system has some sort of fd_set available..." >&4
10445 if $run ./try; then
10446 echo "and you have the normal fd_set macros." >&4
10447 d_fd_macros="$define"
10450 but not the normal fd_set macros! Gross! More work for me...
10452 d_fd_macros="$undef"
10455 echo "Well, you got zip. That's OK, I can roll my own fd_set stuff." >&4
10457 d_fds_bits="$undef"
10458 d_fd_macros="$undef"
10463 : see if fgetpos exists
10464 set fgetpos d_fgetpos
10467 : see if finite exists
10468 set finite d_finite
10471 : see if finitel exists
10472 set finitel d_finitel
10475 : see if flock exists
10479 : see if prototype for flock is available
10481 set d_flockproto flock $i_sysfile sys/file.h
10484 : see if fork exists
10488 : see if fp_class exists
10489 set fp_class d_fp_class
10492 : see if pathconf exists
10493 set pathconf d_pathconf
10496 : see if fpathconf exists
10497 set fpathconf d_fpathconf
10500 : see if fpclass exists
10501 set fpclass d_fpclass
10504 : see if fpclassify exists
10505 set fpclassify d_fpclassify
10508 : see if fpclassl exists
10509 set fpclassl d_fpclassl
10513 : check for fpos64_t
10515 echo "Checking to see if you have fpos64_t..." >&4
10518 int main() { fpos64_t x = 7; }
10521 if eval $compile; then
10523 echo "You have fpos64_t."
10526 echo "You do not have fpos64_t."
10527 case "$fpossize" in
10528 8) echo "(Your fpos_t is 64 bits, so you could use that.)" ;;
10535 : see if frexpl exists
10536 set frexpl d_frexpl
10539 : see if this is a sys/param system
10540 set sys/param.h i_sysparam
10543 : see if this is a sys/mount.h system
10544 set sys/mount.h i_sysmount
10549 echo "Checking to see if your system supports struct fs_data..." >&4
10550 set d_fs_data_s fs_data $i_systypes sys/types.h $i_sysparam sys/param.h $i_sysmount sys/mount.h
10552 case "$d_fs_data_s" in
10553 "$define") echo "Yes, it does." ;;
10554 *) echo "No, it doesn't." ;;
10557 : see if fseeko exists
10558 set fseeko d_fseeko
10560 case "$longsize" in
10561 8) echo "(Your long is 64 bits, so you could use fseek.)" ;;
10564 : see if fsetpos exists
10565 set fsetpos d_fsetpos
10569 : see if fstatfs exists
10570 set fstatfs d_fstatfs
10574 : see if statvfs exists
10575 set statvfs d_statvfs
10578 : see if fstatvfs exists
10579 set fstatvfs d_fstatvfs
10583 : see if fsync exists
10587 : see if ftello exists
10588 set ftello d_ftello
10590 case "$longsize" in
10591 8) echo "(Your long is 64 bits, so you could use ftell.)" ;;
10594 : see if getcwd exists
10595 set getcwd d_getcwd
10598 : see if getespwnam exists
10599 set getespwnam d_getespwnam
10603 : see if getfsstat exists
10604 set getfsstat d_getfsstat
10607 : see if getgrent exists
10608 set getgrent d_getgrent
10611 : see if gethostbyaddr exists
10612 set gethostbyaddr d_gethbyaddr
10615 : see if gethostbyname exists
10616 set gethostbyname d_gethbyname
10619 : see if gethostent exists
10620 set gethostent d_gethent
10623 : see how we will look up host name
10626 if set gethostname val -f d_gethname; eval $csym; $val; then
10627 echo 'gethostname() found.' >&4
10628 d_gethname="$define"
10631 if set uname val -f d_uname; eval $csym; $val; then
10634 uname() was found, but you're running xenix, and older versions of xenix
10635 have a broken uname(). If you don't really know whether your xenix is old
10636 enough to have a broken system call, use the default answer.
10641 "$define") dflt=n;;
10643 rp='Is your uname() broken?'
10646 n*) d_uname="$define"; call=uname;;
10649 echo 'uname() found.' >&4
10656 case "$d_gethname" in
10657 '') d_gethname="$undef";;
10660 '') d_uname="$undef";;
10662 case "$d_uname$d_gethname" in
10667 Every now and then someone has a $call() that lies about the hostname
10668 but can't be fixed for political or economic reasons. If you wish, I can
10669 pretend $call() isn't there and maybe compute hostname at run-time
10670 thanks to the '$phostname' command.
10673 rp="Shall I ignore $call() from now on?"
10676 y*) d_uname="$undef" d_gethname="$undef"; $echo $n "Okay...$c";;
10679 case "$phostname" in
10680 '') aphostname='';;
10681 *) case "$aphostname" in
10683 *) set X $phostname
10687 file=`./loc $file $file $pth`
10688 aphostname=`echo $file $*`
10693 case "$d_uname$d_gethname" in
10696 case "$phostname" in
10698 echo "There will be no way for $package to get your hostname." >&4;;
10700 echo "I'll use 'popen("'"'$aphostname'", "r")'"' to get your hostname." >&4
10704 case "$d_phostname" in
10705 '') d_phostname="$undef";;
10708 : see if this is a netdb.h system
10709 set netdb.h i_netdb
10712 : see if prototypes for various gethostxxx netdb.h functions are available
10714 set d_gethostprotos gethostent $i_netdb netdb.h
10717 : see if getitimer exists
10718 set getitimer d_getitimer
10721 : see if getlogin exists
10722 set getlogin d_getlogin
10725 : see if getmnt exists
10726 set getmnt d_getmnt
10729 : see if getmntent exists
10730 set getmntent d_getmntent
10733 : see if getnetbyaddr exists
10734 set getnetbyaddr d_getnbyaddr
10737 : see if getnetbyname exists
10738 set getnetbyname d_getnbyname
10741 : see if getnetent exists
10742 set getnetent d_getnent
10745 : see if prototypes for various getnetxxx netdb.h functions are available
10747 set d_getnetprotos getnetent $i_netdb netdb.h
10750 : see if getpagesize exists
10751 set getpagesize d_getpagsz
10755 : see if getprotobyname exists
10756 set getprotobyname d_getpbyname
10759 : see if getprotobynumber exists
10760 set getprotobynumber d_getpbynumber
10763 : see if getprotoent exists
10764 set getprotoent d_getpent
10767 : see if getpgid exists
10768 set getpgid d_getpgid
10771 : see if getpgrp2 exists
10772 set getpgrp2 d_getpgrp2
10775 : see if getppid exists
10776 set getppid d_getppid
10779 : see if getpriority exists
10780 set getpriority d_getprior
10783 : see if prototypes for various getprotoxxx netdb.h functions are available
10785 set d_getprotoprotos getprotoent $i_netdb netdb.h
10788 : see if getprpwnam exists
10789 set getprpwnam d_getprpwnam
10792 : see if getpwent exists
10793 set getpwent d_getpwent
10797 : see if getservbyname exists
10798 set getservbyname d_getsbyname
10801 : see if getservbyport exists
10802 set getservbyport d_getsbyport
10805 : see if getservent exists
10806 set getservent d_getsent
10809 : see if prototypes for various getservxxx netdb.h functions are available
10811 set d_getservprotos getservent $i_netdb netdb.h
10814 : see if getspnam exists
10815 set getspnam d_getspnam
10818 : see if gettimeofday or ftime exists
10819 set gettimeofday d_gettimeod
10821 case "$d_gettimeod" in
10827 val="$undef"; set d_ftime; eval $setvar
10830 case "$d_gettimeod$d_ftime" in
10833 echo 'No ftime() nor gettimeofday() -- timing may be less accurate.' >&4
10837 : see if this is an grp system
10843 xxx=`./findhdr grp.h`
10844 $cppstdin $cppflags $cppminus < $xxx >$$.h
10846 if $contains 'gr_passwd' $$.h >/dev/null 2>&1; then
10858 set d_grpasswd; eval $setvar
10862 : see if hasmntopt exists
10863 set hasmntopt d_hasmntopt
10866 : see if this is a netinet/in.h or sys/in.h system
10867 set netinet/in.h i_niin sys/in.h i_sysin
10870 : see if arpa/inet.h has to be included
10871 set arpa/inet.h i_arpainet
10874 : see if htonl --and friends-- exists
10879 : Maybe they are macros.
10882 $cat >htonl.c <<EOM
10884 #include <sys/types.h>
10885 #$i_niin I_NETINET_IN
10887 #$i_arpainet I_ARPA_INET
10888 #ifdef I_NETINET_IN
10889 #include <netinet/in.h>
10892 #include <sys/in.h>
10895 #include <arpa/inet.h>
10898 printf("Defined as a macro.");
10901 $cppstdin $cppflags $cppminus < htonl.c >htonl.E 2>/dev/null
10902 if $contains 'Defined as a macro' htonl.E >/dev/null 2>&1; then
10904 echo "But it seems to be defined as a macro." >&4
10914 if set index val -f; eval $csym; $val; then
10915 if set strchr val -f d_strchr; eval $csym; $val; then
10916 if $contains strchr "$strings" >/dev/null 2>&1 ; then
10919 echo "strchr() found." >&4
10923 echo "index() found." >&4
10928 echo "index() found." >&4
10931 if set strchr val -f d_strchr; eval $csym; $val; then
10934 echo "strchr() found." >&4
10936 echo "No index() or strchr() found!" >&4
10941 set d_strchr; eval $setvar
10943 set d_index; eval $setvar
10945 : check whether inet_aton exists
10946 set inet_aton d_inetaton
10951 $cat >isascii.c <<'EOCP'
10963 if eval $compile; then
10964 echo "isascii() found." >&4
10967 echo "isascii() NOT found." >&4
10974 : see if isfinite exists
10975 set isfinite d_isfinite
10978 : see if isinf exists
10982 : see if isnan exists
10986 : see if isnanl exists
10987 set isnanl d_isnanl
10990 : see if killpg exists
10991 set killpg d_killpg
10994 : see if lchown exists
10996 $cat > try.c <<'EOCP'
10997 /* System header to define __stub macros and hopefully few prototypes,
10998 which can conflict with char lchown(); below. */
10999 #include <assert.h>
11000 /* Override any gcc2 internal prototype to avoid an error. */
11001 /* We use char because int might match the return type of a gcc2
11002 builtin and then its argument prototype would still apply. */
11005 /* The GNU C library defines this for functions which it implements
11006 to always fail with ENOSYS. Some functions are actually named
11007 something starting with __ and the normal name is an alias. */
11008 #if defined (__stub_lchown) || defined (__stub___lchown)
11016 if eval $compile; then
11017 $echo "lchown() found." >&4
11020 $echo "lchown() NOT found." >&4
11026 : See if number of significant digits in a double precision number is known
11028 $cat >ldbl_dig.c <<EOM
11029 #$i_limits I_LIMITS
11032 #include <limits.h>
11038 printf("Contains LDBL_DIG");
11041 $cppstdin $cppflags $cppminus < ldbl_dig.c >ldbl_dig.E 2>/dev/null
11042 if $contains 'LDBL_DIG' ldbl_dig.E >/dev/null 2>&1; then
11043 echo "LDBL_DIG found." >&4
11046 echo "LDBL_DIG NOT found." >&4
11053 : see if link exists
11057 : see if localeconv exists
11058 set localeconv d_locconv
11061 : see if lockf exists
11065 : see if prototype for lseek is available
11067 set d_lseekproto lseek $i_systypes sys/types.h $i_unistd unistd.h
11070 : see if lstat exists
11074 : see if madvise exists
11075 set madvise d_madvise
11078 : see if mblen exists
11082 : see if mbstowcs exists
11083 set mbstowcs d_mbstowcs
11086 : see if mbtowc exists
11087 set mbtowc d_mbtowc
11090 : see if memchr exists
11091 set memchr d_memchr
11094 : see if memcmp exists
11095 set memcmp d_memcmp
11098 : see if memcpy exists
11099 set memcpy d_memcpy
11102 : see if memmove exists
11103 set memmove d_memmove
11106 : see if memset exists
11107 set memset d_memset
11110 : see if mkdir exists
11114 : see if mkdtemp exists
11115 set mkdtemp d_mkdtemp
11118 : see if mkfifo exists
11119 set mkfifo d_mkfifo
11122 : see if mkstemp exists
11123 set mkstemp d_mkstemp
11126 : see if mkstemps exists
11127 set mkstemps d_mkstemps
11130 : see if mktime exists
11131 set mktime d_mktime
11134 : see if this is a sys/mman.h system
11135 set sys/mman.h i_sysmman
11138 : see if mmap exists
11141 : see what shmat returns
11142 : default to something harmless
11144 case "$i_sysmman$d_mmap" in
11146 $cat >mmap.c <<'END'
11147 #include <sys/mman.h>
11150 if $cc $ccflags -c mmap.c >/dev/null 2>&1; then
11155 echo "and it returns ($mmaptype)." >&4
11161 : see if mprotect exists
11162 set mprotect d_mprotect
11165 : see if msgctl exists
11166 set msgctl d_msgctl
11169 : see if msgget exists
11170 set msgget d_msgget
11173 : see if msgsnd exists
11174 set msgsnd d_msgsnd
11177 : see if msgrcv exists
11178 set msgrcv d_msgrcv
11181 : see how much of the 'msg*(2)' library is present.
11184 case "$d_msgctl$d_msgget$d_msgsnd$d_msgrcv" in
11185 *"$undef"*) h_msg=false;;
11189 case "`ipcs 2>&1`" in
11190 "SVID messages"*"not configured"*)
11191 echo "Your $osname does not have the msg*(2) configured." >&4
11194 set msgctl d_msgctl
11196 set msgget d_msgget
11198 set msgsnd d_msgsnd
11200 set msgrcv d_msgrcv
11206 : we could also check for sys/ipc.h ...
11207 if $h_msg && $test `./findhdr sys/msg.h`; then
11208 echo "You have the full msg*(2) library." >&4
11211 echo "You don't have the full msg*(2) library." >&4
11219 echo "Checking to see if your system supports struct msghdr..." >&4
11220 set d_msghdr_s msghdr $i_systypes sys/types.h $d_socket sys/socket.h $i_sysuio sys/uio.h
11222 case "$d_msghdr_s" in
11223 "$define") echo "Yes, it does." ;;
11224 *) echo "No, it doesn't." ;;
11228 : see if msync exists
11232 : see if munmap exists
11233 set munmap d_munmap
11236 : see if nice exists
11240 : see if this is a langinfo.h system
11241 set langinfo.h i_langinfo
11244 : see if nl_langinfo exists
11245 set nl_langinfo d_nl_langinfo
11248 : check for length of character
11250 case "$charsize" in
11252 echo "Checking to see how big your characters are (hey, you never know)..." >&4
11253 $cat >try.c <<'EOCP'
11257 printf("%d\n", (int)sizeof(char));
11262 if eval $compile_ok; then
11266 echo "(I can't seem to compile the test program. Guessing...)"
11273 rp="What is the size of a character (in bytes)?"
11278 : check for volatile keyword
11280 echo 'Checking to see if your C compiler knows about "volatile"...' >&4
11281 $cat >try.c <<'EOCP'
11284 typedef struct _goo_struct goo_struct;
11285 goo_struct * volatile goo = ((goo_struct *)0);
11286 struct _goo_struct {
11291 typedef unsigned short foo_t;
11292 char *volatile foo;
11294 volatile foo_t blech;
11298 if $cc -c $ccflags try.c >/dev/null 2>&1 ; then
11300 echo "Yup, it does."
11303 echo "Nope, it doesn't."
11311 $echo "Choosing the C types to be used for Perl's internal types..." >&4
11313 case "$use64bitint:$d_quad:$quadtype" in
11316 uvtype="$uquadtype"
11321 uvtype="unsigned long"
11327 case "$uselongdouble:$d_longdbl" in
11329 nvtype="long double"
11330 nvsize=$longdblsize
11337 $echo "(IV will be "$ivtype", $ivsize bytes)"
11338 $echo "(UV will be "$uvtype", $uvsize bytes)"
11339 $echo "(NV will be "$nvtype", $nvsize bytes)"
11342 #$i_inttypes I_INTTYPES
11344 #include <inttypes.h>
11349 int8_t i = INT8_MAX;
11350 uint8_t u = UINT8_MAX;
11351 printf("int8_t\n");
11354 int16_t i = INT16_MAX;
11355 uint16_t i = UINT16_MAX;
11356 printf("int16_t\n");
11359 int32_t i = INT32_MAX;
11360 uint32_t u = UINT32_MAX;
11361 printf("int32_t\n");
11367 '') case "$charsize" in
11369 u8type="unsigned char"
11378 if eval $compile; then
11379 case "`$run ./try`" in
11380 int8_t) i8type=int8_t
11390 '') if $test $charsize -ge 1; then
11392 u8type="unsigned char"
11400 '') case "$shortsize" in
11402 u16type="unsigned short"
11410 '') set try -DINT16
11411 if eval $compile; then
11412 case "`$run ./try`" in
11424 '') if $test $shortsize -ge 2; then
11426 u16type="unsigned short"
11434 '') case "$longsize" in
11436 u32type="unsigned long"
11440 *) case "$intsize" in
11442 u32type="unsigned int"
11452 '') set try -DINT32
11453 if eval $compile; then
11454 case "`$run ./try`" in
11466 '') if $test $intsize -ge 4; then
11468 u32type="unsigned int"
11476 '') case "$d_quad:$quadtype" in
11478 i64type="$quadtype"
11479 u64type="$uquadtype"
11487 $echo "Checking how many bits of your UVs your NVs can preserve..." >&4
11488 : volatile so that the compiler has to store it out to memory.
11489 if test X"$d_volatile" = X"$define"; then
11494 #include <sys/types.h>
11495 #include <signal.h>
11497 $volatile int bletched = 0;
11498 $signal_t blech(s) int s; { bletched = 1; }
11503 int n = 8 * $uvsize;
11506 signal(SIGFPE, blech);
11509 for (i = 0; i < n; i++) {
11510 u = u << 1 | ($uvtype)1;
11512 if (($uvtype)d != u)
11516 d = ($nvtype)(u - 1);
11517 if (($uvtype)d != (u - 1))
11525 printf("%d\n", ((i == n) ? -n : i));
11531 d_nv_preserves_uv="$undef"
11532 if eval $compile; then
11533 d_nv_preserves_uv_bits="`$run ./try`"
11535 case "$d_nv_preserves_uv_bits" in
11537 d_nv_preserves_uv_bits=`expr 0 - $d_nv_preserves_uv_bits`
11538 $echo "Your NVs can preserve all $d_nv_preserves_uv_bits bits of your UVs." 2>&1
11539 d_nv_preserves_uv="$define"
11541 [1-9]*) $echo "Your NVs can preserve only $d_nv_preserves_uv_bits bits of your UVs." 2>&1
11542 d_nv_preserves_uv="$undef" ;;
11543 *) $echo "Can't figure out how many bits your NVs preserve." 2>&1
11544 d_nv_preserves_uv_bits="$undef" ;;
11550 : check for off64_t
11552 echo "Checking to see if you have off64_t..." >&4
11554 #include <sys/types.h>
11555 #include <unistd.h>
11556 int main() { off64_t x = 7; }
11559 if eval $compile; then
11561 echo "You have off64_t."
11564 echo "You do not have off64_t."
11565 case "$lseeksize" in
11566 8) echo "(Your off_t is 64 bits, so you could use that.)" ;;
11573 : see if POSIX threads are available
11574 set pthread.h i_pthread
11580 : how to create joinable pthreads
11581 if test "X$usethreads" = "X$define" -a "X$i_pthread" = "X$define"; then
11583 echo "Checking what constant to use for creating joinable pthreads..." >&4
11584 $cat >try.c <<'EOCP'
11585 #include <pthread.h>
11587 int detachstate = JOINABLE;
11590 set try -DJOINABLE=PTHREAD_CREATE_JOINABLE
11591 if eval $compile; then
11592 echo "You seem to use PTHREAD_CREATE_JOINABLE." >&4
11593 val="$undef" # Yes, undef.
11594 set d_old_pthread_create_joinable
11597 set old_pthread_create_joinable
11600 set try -DJOINABLE=PTHREAD_CREATE_UNDETACHED
11601 if eval $compile; then
11602 echo "You seem to use PTHREAD_CREATE_UNDETACHED." >&4
11604 set d_old_pthread_create_joinable
11606 val=PTHREAD_CREATE_UNDETACHED
11607 set old_pthread_create_joinable
11610 set try -DJOINABLE=__UNDETACHED
11611 if eval $compile; then
11612 echo "You seem to use __UNDETACHED." >&4
11614 set d_old_pthread_create_joinable
11617 set old_pthread_create_joinable
11620 echo "Egads, nothing obvious found. Guessing that you use 0." >&4
11622 set d_old_pthread_create_joinable
11625 set old_pthread_create_joinable
11632 d_old_pthread_create_joinable="$undef"
11633 old_pthread_create_joinable=""
11636 : see if pause exists
11640 : see if pipe exists
11644 : see if poll exists
11648 : see if readlink exists
11649 set readlink d_readlink
11655 case "$d_readlink" in
11657 if $issymlink /proc/self/exe ; then
11658 $ls -l /proc/self/exe > reflect
11659 if $contains /`basename $ls` reflect >/dev/null 2>&1; then
11660 echo "You have Linux-like /proc/self/exe."
11661 procselfexe='"/proc/self/exe"'
11665 if $issymlink /proc/curproc/file ; then
11666 $ls -l /proc/curproc/file > reflect
11667 if $contains /`basename $ls` reflect >/dev/null 2>&1; then
11668 echo "You have BSD-like /proc/curproc/file."
11669 procselfexe='"/proc/curproc/file"'
11679 : see if pthread_atfork exists
11680 set pthread_atfork d_pthread_atfork
11684 : see whether the various POSIXish _yields exist
11686 #include <pthread.h>
11692 #ifdef PTHREAD_YIELD
11695 #ifdef PTHREAD_YIELD_NULL
11696 pthread_yield(NULL);
11702 : see if sched_yield exists
11703 set try -DSCHED_YIELD
11704 if eval $compile; then
11706 sched_yield='sched_yield()'
11710 case "$usethreads" in
11713 $define) echo 'sched_yield() found.' >&4 ;;
11714 *) echo 'sched_yield() NOT found.' >&4 ;;
11720 : see if pthread_yield exists
11721 set try -DPTHREAD_YIELD
11722 if eval $compile; then
11724 case "$sched_yield" in
11725 '') sched_yield='pthread_yield()' ;;
11728 set try -DPTHREAD_YIELD_NULL
11729 if eval $compile; then
11731 case "$sched_yield" in
11732 '') sched_yield='pthread_yield(NULL)' ;;
11738 case "$usethreads" in
11741 $define) echo 'pthread_yield() found.' >&4 ;;
11742 *) echo 'pthread_yield() NOT found.' >&4 ;;
11746 set d_pthread_yield
11749 case "$sched_yield" in
11750 '') sched_yield=undef ;;
11755 : see if this is a pwd.h system
11761 xxx=`./findhdr pwd.h`
11762 $cppstdin $cppflags $cppminus < $xxx >$$.h
11764 if $contains 'pw_quota' $$.h >/dev/null 2>&1; then
11772 if $contains 'pw_age' $$.h >/dev/null 2>&1; then
11780 if $contains 'pw_change' $$.h >/dev/null 2>&1; then
11788 if $contains 'pw_class' $$.h >/dev/null 2>&1; then
11796 if $contains 'pw_expire' $$.h >/dev/null 2>&1; then
11804 if $contains 'pw_comment' $$.h >/dev/null 2>&1; then
11812 if $contains 'pw_gecos' $$.h >/dev/null 2>&1; then
11820 if $contains 'pw_passwd' $$.h >/dev/null 2>&1; then
11832 set d_pwquota; eval $setvar
11833 set d_pwage; eval $setvar
11834 set d_pwchange; eval $setvar
11835 set d_pwclass; eval $setvar
11836 set d_pwexpire; eval $setvar
11837 set d_pwcomment; eval $setvar
11838 set d_pwgecos; eval $setvar
11839 set d_pwpasswd; eval $setvar
11843 : see if readdir and friends exist
11844 set readdir d_readdir
11846 set seekdir d_seekdir
11848 set telldir d_telldir
11850 set rewinddir d_rewinddir
11853 : see if readv exists
11857 : see if recvmsg exists
11858 set recvmsg d_recvmsg
11861 : see if rename exists
11862 set rename d_rename
11865 : see if rmdir exists
11869 : see if memory.h is available.
11874 : See if it conflicts with string.h
11880 $cppstdin $cppflags $cppminus < $strings > mem.h
11881 if $contains 'memcpy' mem.h >/dev/null 2>&1; then
11883 echo "We won't be including <memory.h>."
11893 : can bcopy handle overlapping blocks?
11896 case "$d_memmove" in
11897 "$define") echo "I'll use memmove() instead of bcopy() for overlapping copies." ;;
11898 *) case "$d_bcopy" in
11900 echo "Checking to see if bcopy() can do overlapping copies..." >&4
11902 #$i_memory I_MEMORY
11903 #$i_stdlib I_STDLIB
11904 #$i_string I_STRING
11905 #$i_unistd I_UNISTD
11907 $cat >>try.c <<'EOCP'
11910 # include <memory.h>
11913 # include <stdlib.h>
11916 # include <string.h>
11918 # include <strings.h>
11921 # include <unistd.h> /* Needed for NetBSD */
11925 char buf[128], abc[128];
11931 /* Copy "abcde..." string to char abc[] so that gcc doesn't
11932 try to store the string in read-only memory. */
11933 bcopy("abcdefghijklmnopqrstuvwxyz0123456789", abc, 36);
11935 for (align = 7; align >= 0; align--) {
11936 for (len = 36; len; len--) {
11938 bcopy(abc, b, len);
11939 for (off = 1; off <= len; off++) {
11940 bcopy(b, b+off, len);
11941 bcopy(b+off, b, len);
11942 if (bcmp(b, abc, len))
11951 if eval $compile_ok; then
11952 if ./try 2>/dev/null; then
11953 echo "Yes, it can."
11956 echo "It can't, sorry."
11959 echo "(I can't compile the test program, so we'll assume not...)"
11963 $rm -f try.* try core
11969 : can memcpy handle overlapping blocks?
11972 case "$d_memmove" in
11973 "$define") echo "I'll use memmove() instead of memcpy() for overlapping copies." ;;
11974 *) case "$d_memcpy" in
11976 echo "Checking to see if memcpy() can do overlapping copies..." >&4
11978 #$i_memory I_MEMORY
11979 #$i_stdlib I_STDLIB
11980 #$i_string I_STRING
11981 #$i_unistd I_UNISTD
11983 $cat >>try.c <<'EOCP'
11986 # include <memory.h>
11989 # include <stdlib.h>
11992 # include <string.h>
11994 # include <strings.h>
11997 # include <unistd.h> /* Needed for NetBSD */
12001 char buf[128], abc[128];
12007 /* Copy "abcde..." string to char abc[] so that gcc doesn't
12008 try to store the string in read-only memory. */
12009 memcpy(abc, "abcdefghijklmnopqrstuvwxyz0123456789", 36);
12011 for (align = 7; align >= 0; align--) {
12012 for (len = 36; len; len--) {
12014 memcpy(b, abc, len);
12015 for (off = 1; off <= len; off++) {
12016 memcpy(b+off, b, len);
12017 memcpy(b, b+off, len);
12018 if (memcmp(b, abc, len))
12027 if eval $compile_ok; then
12028 if ./try 2>/dev/null; then
12029 echo "Yes, it can."
12032 echo "It can't, sorry."
12035 echo "(I can't compile the test program, so we'll assume not...)"
12039 $rm -f try.* try core
12045 : can memcmp be trusted to compare relative magnitude?
12047 case "$d_memcmp" in
12050 echo "Checking if your memcmp() can compare relative magnitude..." >&4
12052 #$i_memory I_MEMORY
12053 #$i_stdlib I_STDLIB
12054 #$i_string I_STRING
12055 #$i_unistd I_UNISTD
12057 $cat >>try.c <<'EOCP'
12060 # include <memory.h>
12063 # include <stdlib.h>
12066 # include <string.h>
12068 # include <strings.h>
12071 # include <unistd.h> /* Needed for NetBSD */
12077 if ((a < b) && memcmp(&a, &b, 1) < 0)
12083 if eval $compile_ok; then
12084 if $run ./try 2>/dev/null; then
12085 echo "Yes, it can."
12088 echo "No, it can't (it uses signed chars)."
12091 echo "(I can't compile the test program, so we'll assume not...)"
12095 $rm -f try.* try core
12099 : see if prototype for sbrk is available
12101 set d_sbrkproto sbrk $i_unistd unistd.h
12104 : see if select exists
12105 set select d_select
12108 : see if semctl exists
12109 set semctl d_semctl
12112 : see if semget exists
12113 set semget d_semget
12116 : see if semop exists
12120 : see how much of the 'sem*(2)' library is present.
12123 case "$d_semctl$d_semget$d_semop" in
12124 *"$undef"*) h_sem=false;;
12128 case "`ipcs 2>&1`" in
12129 "SVID messages"*"not configured"*)
12130 echo "Your $osname does not have the sem*(2) configured." >&4
12133 set semctl d_semctl
12135 set semget d_semget
12143 : we could also check for sys/ipc.h ...
12144 if $h_sem && $test `./findhdr sys/sem.h`; then
12145 echo "You have the full sem*(2) library." >&4
12148 echo "You don't have the full sem*(2) library." >&4
12154 : see whether sys/sem.h defines union semun
12156 $cat > try.c <<'END'
12157 #include <sys/types.h>
12158 #include <sys/ipc.h>
12159 #include <sys/sem.h>
12160 int main () { union semun semun; semun.buf = 0; }
12163 if eval $compile; then
12164 echo "You have union semun in <sys/sem.h>." >&4
12167 echo "You do not have union semun in <sys/sem.h>." >&4
12170 $rm -f try try.c try.h
12174 : see how to do semctl IPC_STAT
12177 : see whether semctl IPC_STAT can use union semun
12182 # define S_IRUSR S_IREAD
12183 # define S_IWUSR S_IWRITE
12184 # define S_IXUSR S_IEXEC
12186 # define S_IRUSR 0400
12187 # define S_IWUSR 0200
12188 # define S_IXUSR 0100
12190 # define S_IRGRP (S_IRUSR>>3)
12191 # define S_IWGRP (S_IWUSR>>3)
12192 # define S_IXGRP (S_IXUSR>>3)
12193 # define S_IROTH (S_IRUSR>>6)
12194 # define S_IWOTH (S_IWUSR>>6)
12195 # define S_IXOTH (S_IXUSR>>6)
12198 # define S_IRWXU (S_IRUSR|S_IWUSR|S_IXUSR)
12199 # define S_IRWXG (S_IRGRP|S_IWGRP|S_IXGRP)
12200 # define S_IRWXO (S_IROTH|S_IWOTH|S_IXOTH)
12205 #include <sys/types.h>
12206 #include <sys/ipc.h>
12207 #include <sys/sem.h>
12208 #include <sys/stat.h>
12215 #$d_union_semun HAS_UNION_SEMUN
12218 #ifndef HAS_UNION_SEMUN
12221 struct semid_ds *buf;
12222 unsigned short *array;
12228 #if defined(IPC_PRIVATE) && defined(S_IRWXU) && defined(S_IRWXG) && defined(S_IRWXO) && defined(IPC_CREAT)
12229 sem = semget(IPC_PRIVATE, 1, S_IRWXU|S_IRWXG|S_IRWXO|IPC_CREAT);
12231 struct semid_ds argbuf;
12234 st = semctl(sem, 0, IPC_STAT, arg);
12238 # endif /* IPC_STAT */
12239 printf("semctl IPC_STAT failed: errno = %d\n", errno);
12241 if (semctl(sem, 0, IPC_RMID, arg) != 0)
12242 # endif /* IPC_RMID */
12243 printf("semctl IPC_RMID failed: errno = %d\n", errno);
12245 #endif /* IPC_PRIVATE && ... */
12246 printf("semget failed: errno = %d\n", errno);
12252 if eval $compile; then
12255 semun) val="$define" ;;
12261 case "$d_semctl_semun" in
12263 echo "You can use union semun for semctl IPC_STAT." >&4
12266 *) echo "You cannot use union semun for semctl IPC_STAT." >&4
12271 : see whether semctl IPC_STAT can use struct semid_ds pointer
12272 $cat > try.c <<'END'
12273 #include <sys/types.h>
12274 #include <sys/ipc.h>
12275 #include <sys/sem.h>
12276 #include <sys/stat.h>
12284 struct semid_ds arg;
12287 #if defined(IPC_PRIVATE) && defined(S_IRWXU) && defined(S_IRWXG) && defined(S_IRWXO) && defined(IPC_CREAT)
12288 sem = semget(IPC_PRIVATE, 1, S_IRWXU|S_IRWXG|S_IRWXO|IPC_CREAT);
12291 st = semctl(sem, 0, IPC_STAT, &arg);
12293 printf("semid_ds\n");
12295 # endif /* IPC_STAT */
12296 printf("semctl IPC_STAT failed: errno = %d\n", errno);
12298 if (semctl(sem, 0, IPC_RMID, &arg) != 0)
12299 # endif /* IPC_RMID */
12300 printf("semctl IPC_RMID failed: errno = %d\n", errno);
12302 #endif /* IPC_PRIVATE && ... */
12303 printf("semget failed: errno = %d\n", errno);
12310 if eval $compile; then
12313 semid_ds) val="$define" ;;
12317 set d_semctl_semid_ds
12319 case "$d_semctl_semid_ds" in
12321 echo "You can $also use struct semid_ds* for semctl IPC_STAT." >&4
12323 *) echo "You cannot use struct semid_ds* for semctl IPC_STAT." >&4
12330 # We do not have the full sem*(2) library, so assume we can not
12336 set d_semctl_semid_ds
12341 : see if sendmsg exists
12342 set sendmsg d_sendmsg
12345 : see if setegid exists
12346 set setegid d_setegid
12349 : see if seteuid exists
12350 set seteuid d_seteuid
12353 : see if setgrent exists
12354 set setgrent d_setgrent
12357 : see if sethostent exists
12358 set sethostent d_sethent
12361 : see if setitimer exists
12362 set setitimer d_setitimer
12365 : see if setlinebuf exists
12366 set setlinebuf d_setlinebuf
12369 : see if setlocale exists
12370 set setlocale d_setlocale
12373 : see if setnetent exists
12374 set setnetent d_setnent
12377 : see if setprotoent exists
12378 set setprotoent d_setpent
12381 : see if setpgid exists
12382 set setpgid d_setpgid
12385 : see if setpgrp2 exists
12386 set setpgrp2 d_setpgrp2
12389 : see if setpriority exists
12390 set setpriority d_setprior
12393 : see if setproctitle exists
12394 set setproctitle d_setproctitle
12397 : see if setpwent exists
12398 set setpwent d_setpwent
12401 : see if setregid exists
12402 set setregid d_setregid
12404 set setresgid d_setresgid
12407 : see if setreuid exists
12408 set setreuid d_setreuid
12410 set setresuid d_setresuid
12413 : see if setrgid exists
12414 set setrgid d_setrgid
12417 : see if setruid exists
12418 set setruid d_setruid
12421 : see if setservent exists
12422 set setservent d_setsent
12425 : see if setsid exists
12426 set setsid d_setsid
12429 : see if setvbuf exists
12430 set setvbuf d_setvbuf
12433 : see if sfio.h is available
12438 : see if sfio library is available
12449 : Ok, but do we want to use it.
12453 true|$define|[yY]*) dflt='y';;
12456 echo "$package can use the sfio library, but it is experimental."
12457 case "$useperlio" in
12459 echo "For sfio also the PerlIO abstraction layer is needed."
12460 echo "Earlier you said you wouldn't want that."
12463 rp="You seem to have sfio available, do you want to try using it?"
12466 y|Y) echo "Ok, turning on both sfio and PerlIO, then."
12467 useperlio="$define"
12470 *) echo "Ok, avoiding sfio this time. I'll use stdio instead."
12475 *) case "$usesfio" in
12476 true|$define|[yY]*)
12477 echo "Sorry, cannot find sfio on this machine." >&4
12478 echo "Ignoring your setting of usesfio=$usesfio." >&4
12487 $define) usesfio='true';;
12488 *) usesfio='false';;
12492 *) : Remove sfio from list of libraries to use
12495 echo "Removing unneeded -lsfio from library list" >&4
12496 set `echo X $libs | $sed -e 's/-lsfio / /' -e 's/-lsfio$//'`
12499 echo "libs = $libs" >&4
12506 : see if shmctl exists
12507 set shmctl d_shmctl
12510 : see if shmget exists
12511 set shmget d_shmget
12514 : see if shmat exists
12517 : see what shmat returns
12520 $cat >shmat.c <<'END'
12521 #include <sys/shm.h>
12524 if $cc $ccflags -c shmat.c >/dev/null 2>&1; then
12529 echo "and it returns ($shmattype)." >&4
12530 : see if a prototype for shmat is available
12531 xxx=`./findhdr sys/shm.h`
12532 $cppstdin $cppflags $cppminus < $xxx > shmat.c 2>/dev/null
12533 if $contains 'shmat.*(' shmat.c >/dev/null 2>&1; then
12544 set d_shmatprototype
12547 : see if shmdt exists
12551 : see how much of the 'shm*(2)' library is present.
12554 case "$d_shmctl$d_shmget$d_shmat$d_shmdt" in
12555 *"$undef"*) h_shm=false;;
12559 case "`ipcs 2>&1`" in
12560 "SVID shared memory"*"not configured"*)
12561 echo "Your $osname does not have the shm*(2) configured." >&4
12564 set shmctl d_shmctl
12566 set shmget d_shmget
12576 : we could also check for sys/ipc.h ...
12577 if $h_shm && $test `./findhdr sys/shm.h`; then
12578 echo "You have the full shm*(2) library." >&4
12581 echo "You don't have the full shm*(2) library." >&4
12588 : see if we have sigaction
12589 if set sigaction val -f d_sigaction; eval $csym; $val; then
12590 echo 'sigaction() found.' >&4
12591 $cat > try.c <<'EOP'
12593 #include <sys/types.h>
12594 #include <signal.h>
12597 struct sigaction act, oact;
12599 oact.sa_handler = 0;
12600 /* so that act and oact are used */
12601 exit(act.sa_flags == 0 && oact.sa_handler == 0);
12605 if eval $compile_ok; then
12608 echo "But you don't seem to have a useable struct sigaction." >&4
12612 echo 'sigaction NOT found.' >&4
12615 set d_sigaction; eval $setvar
12616 $rm -f try try$_o try.c
12618 : see if sigprocmask exists
12619 set sigprocmask d_sigprocmask
12622 : see if sigsetjmp exists
12624 case "$d_sigsetjmp" in
12626 $cat >try.c <<'EOP'
12627 #include <setjmp.h>
12632 if (sigsetjmp(env,1))
12635 siglongjmp(env, 1);
12640 if eval $compile; then
12641 if $run ./try >/dev/null 2>&1; then
12642 echo "POSIX sigsetjmp found." >&4
12646 Uh-Oh! You have POSIX sigsetjmp and siglongjmp, but they do not work properly!!
12652 echo "sigsetjmp not found." >&4
12656 *) val="$d_sigsetjmp"
12657 case "$d_sigsetjmp" in
12658 $define) echo "POSIX sigsetjmp found." >&4;;
12659 $undef) echo "sigsetjmp not found." >&4;;
12667 : see if sockatmark exists
12668 set sockatmark d_sockatmark
12671 : see if prototype for sockatmark is available
12673 set d_sockatmarkproto sockatmark $d_socket sys/socket.h
12676 : see if socks5_init exists
12677 set socks5_init d_socks5_init
12680 : see if prototype for setresgid is available
12682 set d_sresgproto setresgid $i_unistd unistd.h
12685 : see if prototype for setresuid is available
12687 set d_sresuproto setresuid $i_unistd unistd.h
12690 : see if sys/stat.h is available
12691 set sys/stat.h i_sysstat
12695 : see if stat knows about block sizes
12697 echo "Checking to see if your struct stat has st_blocks field..." >&4
12698 set d_statblks stat st_blocks $i_sysstat sys/stat.h
12702 : see if this is a sys/vfs.h system
12703 set sys/vfs.h i_sysvfs
12707 : see if this is a sys/statfs.h system
12708 set sys/statfs.h i_sysstatfs
12713 echo "Checking to see if your system supports struct statfs..." >&4
12714 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
12716 case "$d_statfs_s" in
12717 "$define") echo "Yes, it does." ;;
12718 *) echo "No, it doesn't." ;;
12723 : see if struct statfs knows about f_flags
12724 case "$d_statfs_s" in
12727 echo "Checking to see if your struct statfs has f_flags field..." >&4
12728 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
12732 set d_statfs_f_flags
12736 case "$d_statfs_f_flags" in
12737 "$define") echo "Yes, it does." ;;
12738 *) echo "No, it doesn't." ;;
12741 : see if _ptr and _cnt from stdio act std
12744 if $contains '_lbfsize' `./findhdr stdio.h` >/dev/null 2>&1 ; then
12745 echo "(Looks like you have stdio.h from BSD.)"
12746 case "$stdio_ptr" in
12747 '') stdio_ptr='((fp)->_p)'
12750 *) ptr_lval=$d_stdio_ptr_lval;;
12752 case "$stdio_cnt" in
12753 '') stdio_cnt='((fp)->_r)'
12756 *) cnt_lval=$d_stdio_cnt_lval;;
12758 case "$stdio_base" in
12759 '') stdio_base='((fp)->_ub._base ? (fp)->_ub._base : (fp)->_bf._base)';;
12761 case "$stdio_bufsiz" in
12762 '') stdio_bufsiz='((fp)->_ub._base ? (fp)->_ub._size : (fp)->_bf._size)';;
12764 elif $contains '_IO_fpos_t' `./findhdr stdio.h` `./findhdr libio.h` >/dev/null 2>&1 ; then
12765 echo "(Looks like you have stdio.h from Linux.)"
12766 case "$stdio_ptr" in
12767 '') stdio_ptr='((fp)->_IO_read_ptr)'
12770 *) ptr_lval=$d_stdio_ptr_lval;;
12772 case "$stdio_cnt" in
12773 '') stdio_cnt='((fp)->_IO_read_end - (fp)->_IO_read_ptr)'
12776 *) cnt_lval=$d_stdio_cnt_lval;;
12778 case "$stdio_base" in
12779 '') stdio_base='((fp)->_IO_read_base)';;
12781 case "$stdio_bufsiz" in
12782 '') stdio_bufsiz='((fp)->_IO_read_end - (fp)->_IO_read_base)';;
12785 case "$stdio_ptr" in
12786 '') stdio_ptr='((fp)->_ptr)'
12789 *) ptr_lval=$d_stdio_ptr_lval;;
12791 case "$stdio_cnt" in
12792 '') stdio_cnt='((fp)->_cnt)'
12795 *) cnt_lval=$d_stdio_cnt_lval;;
12797 case "$stdio_base" in
12798 '') stdio_base='((fp)->_base)';;
12800 case "$stdio_bufsiz" in
12801 '') stdio_bufsiz='((fp)->_cnt + (fp)->_ptr - (fp)->_base)';;
12805 : test whether _ptr and _cnt really work
12806 echo "Checking how std your stdio is..." >&4
12809 #define FILE_ptr(fp) $stdio_ptr
12810 #define FILE_cnt(fp) $stdio_cnt
12812 FILE *fp = fopen("try.c", "r");
12815 18 <= FILE_cnt(fp) &&
12816 strncmp(FILE_ptr(fp), "include <stdio.h>\n", 18) == 0
12824 if eval $compile && $to try.c; then
12825 if $run ./try; then
12826 echo "Your stdio acts pretty std."
12829 echo "Your stdio isn't very std."
12832 echo "Your stdio doesn't appear very std."
12838 : Can _ptr be used as an lvalue?
12839 case "$d_stdstdio$ptr_lval" in
12840 $define$define) val=$define ;;
12843 set d_stdio_ptr_lval
12846 : Can _cnt be used as an lvalue?
12847 case "$d_stdstdio$cnt_lval" in
12848 $define$define) val=$define ;;
12851 set d_stdio_cnt_lval
12855 : test whether setting _ptr sets _cnt as a side effect
12856 d_stdio_ptr_lval_sets_cnt="$undef"
12857 d_stdio_ptr_lval_nochange_cnt="$undef"
12858 case "$d_stdio_ptr_lval$d_stdstdio" in
12860 echo "Checking to see what happens if we set the stdio ptr..." >&4
12863 /* Can we scream? */
12864 /* Eat dust sed :-) */
12865 /* In the buffer space, no one can hear you scream. */
12866 #define FILE_ptr(fp) $stdio_ptr
12867 #define FILE_cnt(fp) $stdio_cnt
12868 #include <sys/types.h>
12870 FILE *fp = fopen("try.c", "r");
12875 puts("Fail even to read");
12878 c = getc(fp); /* Read away the first # */
12880 puts("Fail even to read");
12884 18 <= FILE_cnt(fp) &&
12885 strncmp(FILE_ptr(fp), "include <stdio.h>\n", 18) == 0
12887 puts("Fail even to read");
12890 ptr = (char*) FILE_ptr(fp);
12891 cnt = (size_t)FILE_cnt(fp);
12893 FILE_ptr(fp) += 42;
12895 if ((char*)FILE_ptr(fp) != (ptr + 42)) {
12896 printf("Fail ptr check %p != %p", FILE_ptr(fp), (ptr + 42));
12899 if (FILE_cnt(fp) <= 20) {
12900 printf ("Fail (<20 chars to test)");
12903 if (strncmp(FILE_ptr(fp), "Eat dust sed :-) */\n", 20) != 0) {
12904 puts("Fail compare");
12907 if (cnt == FILE_cnt(fp)) {
12908 puts("Pass_unchanged");
12911 if (FILE_cnt(fp) == (cnt - 42)) {
12912 puts("Pass_changed");
12915 printf("Fail count was %d now %d\n", cnt, FILE_cnt(fp));
12921 if eval $compile && $to try.c; then
12922 case `$run ./try` in
12924 echo "Increasing ptr in your stdio decreases cnt by the same amount. Good." >&4
12925 d_stdio_ptr_lval_sets_cnt="$define" ;;
12927 echo "Increasing ptr in your stdio leaves cnt unchanged. Good." >&4
12928 d_stdio_ptr_lval_nochange_cnt="$define" ;;
12930 echo "Increasing ptr in your stdio didn't do exactly what I expected. We'll not be doing that then." >&4 ;;
12932 echo "It appears attempting to set ptr in your stdio is a bad plan." >&4 ;;
12935 echo "It seems we can't set ptr in your stdio. Nevermind." >&4
12941 : see if _base is also standard
12943 case "$d_stdstdio" in
12947 #define FILE_base(fp) $stdio_base
12948 #define FILE_bufsiz(fp) $stdio_bufsiz
12950 FILE *fp = fopen("try.c", "r");
12953 19 <= FILE_bufsiz(fp) &&
12954 strncmp(FILE_base(fp), "#include <stdio.h>\n", 19) == 0
12961 if eval $compile && $to try.c; then
12962 if $run ./try; then
12963 echo "And its _base field acts std."
12966 echo "But its _base field isn't std."
12969 echo "However, it seems to be lacking the _base field."
12978 Checking how to access stdio streams by file descriptor number...
12980 case "$stdio_stream_array" in
12981 '') $cat >try.c <<EOCP
12984 if (&STDIO_STREAM_ARRAY[fileno(stdin)] == stdin)
12988 for s in _iob __iob __sF
12990 set try -DSTDIO_STREAM_ARRAY=$s
12991 if eval $compile; then
12992 case "`$run ./try`" in
12993 yes) stdio_stream_array=$s; break ;;
12997 $rm -f try.* try$exe_ext
12999 case "$stdio_stream_array" in
13001 I can't figure out how to access stdio streams by file descriptor number.
13003 d_stdio_stream_array="$undef"
13006 You can access stdio streams by file descriptor number by the $stdio_stream_array array.
13008 d_stdio_stream_array="$define"
13012 : see if strcoll exists
13013 set strcoll d_strcoll
13016 : check for structure copying
13018 echo "Checking to see if your C compiler can copy structs..." >&4
13019 $cat >try.c <<'EOCP'
13029 if $cc -c try.c >/dev/null 2>&1 ; then
13031 echo "Yup, it can."
13034 echo "Nope, it can't."
13040 : see if strerror and/or sys_errlist[] exist
13042 if test "X$d_strerror" = X -o "X$d_syserrlst" = X; then
13043 if set strerror val -f d_strerror; eval $csym; $val; then
13044 echo 'strerror() found.' >&4
13045 d_strerror="$define"
13046 d_strerrm='strerror(e)'
13047 if set sys_errlist val -a d_syserrlst; eval $csym; $val; then
13048 echo "(You also have sys_errlist[], so we could roll our own strerror.)"
13049 d_syserrlst="$define"
13051 echo "(Since you don't have sys_errlist[], sterror() is welcome.)"
13052 d_syserrlst="$undef"
13054 elif xxx=`./findhdr string.h`; test "$xxx" || xxx=`./findhdr strings.h`; \
13055 $contains '#[ ]*define.*strerror' "$xxx" >/dev/null 2>&1; then
13056 echo 'strerror() found in string header.' >&4
13057 d_strerror="$define"
13058 d_strerrm='strerror(e)'
13059 if set sys_errlist val -a d_syserrlst; eval $csym; $val; then
13060 echo "(Most probably, strerror() uses sys_errlist[] for descriptions.)"
13061 d_syserrlst="$define"
13063 echo "(You don't appear to have any sys_errlist[], how can this be?)"
13064 d_syserrlst="$undef"
13066 elif set sys_errlist val -a d_syserrlst; eval $csym; $val; then
13067 echo "strerror() not found, but you have sys_errlist[] so we'll use that." >&4
13068 d_strerror="$undef"
13069 d_syserrlst="$define"
13070 d_strerrm='((e)<0||(e)>=sys_nerr?"unknown":sys_errlist[e])'
13072 echo 'strerror() and sys_errlist[] NOT found.' >&4
13073 d_strerror="$undef"
13074 d_syserrlst="$undef"
13075 d_strerrm='"unknown"'
13079 : see if strftime exists
13080 set strftime d_strftime
13083 : see if strtod exists
13084 set strtod d_strtod
13087 : see if strtol exists
13088 set strtol d_strtol
13091 : see if strtold exists
13092 set strtold d_strtold
13095 : see if strtoll exists
13096 set strtoll d_strtoll
13099 case "$d_longlong-$d_strtoll" in
13102 Checking whether your strtoll() works okay...
13104 $cat >try.c <<'EOCP'
13107 #define strtoll __strtoll
13110 #define strtoll _strtoll
13113 extern long long int strtoll(char *s, char **, int);
13114 static int bad = 0;
13115 int check(char *s, long long ell, int een) {
13118 gll = strtoll(s, 0, 10);
13119 if (!((gll == ell) && (errno == een)))
13123 check(" 1", 1LL, 0);
13124 check(" 0", 0LL, 0);
13125 check("-1", -1LL, 0);
13126 check("-9223372036854775808", -9223372036854775808LL, 0);
13127 check("-9223372036854775808", -9223372036854775808LL, 0);
13128 check(" 9223372036854775807", 9223372036854775807LL, 0);
13129 check("-9223372036854775808", -9223372036854775808LL, 0);
13130 check(" 9223372036854775808", 9223372036854775807LL, ERANGE);
13131 check("-9223372036854775809", -9223372036854775808LL, ERANGE);
13137 if eval $compile; then
13140 ok) echo "Your strtoll() seems to be working okay." ;;
13142 Your strtoll() doesn't seem to be working okay.
13148 echo "(I can't seem to compile the test program--assuming it doesn't)"
13154 : see if strtoq exists
13155 set strtoq d_strtoq
13158 : see if strtoul exists
13159 set strtoul d_strtoul
13162 case "$d_strtoul" in
13165 Checking whether your strtoul() works okay...
13167 $cat >try.c <<'EOCP'
13170 extern unsigned long int strtoul(char *s, char **, int);
13171 static int bad = 0;
13172 void check(char *s, unsigned long eul, int een) {
13175 gul = strtoul(s, 0, 10);
13176 if (!((gul == eul) && (errno == een)))
13180 check(" 1", 1L, 0);
13181 check(" 0", 0L, 0);
13183 case "$longsize" in
13185 $cat >>try.c <<'EOCP'
13186 check("18446744073709551615", 18446744073709551615UL, 0);
13187 check("18446744073709551616", 18446744073709551615UL, ERANGE);
13188 #if 0 /* strtoul() for /^-/ strings is undefined. */
13189 check("-1", 18446744073709551615UL, 0);
13190 check("-18446744073709551614", 2, 0);
13191 check("-18446744073709551615", 1, 0);
13192 check("-18446744073709551616", 18446744073709551615UL, ERANGE);
13193 check("-18446744073709551617", 18446744073709551615UL, ERANGE);
13198 $cat >>try.c <<'EOCP'
13199 check("4294967295", 4294967295UL, 0);
13200 check("4294967296", 4294967295UL, ERANGE);
13201 #if 0 /* strtoul() for /^-/ strings is undefined. */
13202 check("-1", 4294967295UL, 0);
13203 check("-4294967294", 2, 0);
13204 check("-4294967295", 1, 0);
13205 check("-4294967296", 4294967295UL, ERANGE);
13206 check("-4294967297", 4294967295UL, ERANGE);
13211 : Should we write these tests to be more portable by sprintf-ing
13212 : ~0 and then manipulating that char string as input for strtol?
13215 $cat >>try.c <<'EOCP'
13222 if eval $compile; then
13223 case "`$run ./try`" in
13224 ok) echo "Your strtoul() seems to be working okay." ;;
13226 Your strtoul() doesn't seem to be working okay.
13235 : see if strtoull exists
13236 set strtoull d_strtoull
13239 case "$d_longlong-$d_strtoull" in
13242 Checking whether your strtoull() works okay...
13244 $cat >try.c <<'EOCP'
13247 #define strtoull __strtoull
13250 extern unsigned long long int strtoull(char *s, char **, int);
13251 static int bad = 0;
13252 int check(char *s, long long eull, int een) {
13255 gull = strtoull(s, 0, 10);
13256 if (!((gull == eull) && (errno == een)))
13260 check(" 1", 1LL, 0);
13261 check(" 0", 0LL, 0);
13262 check("18446744073709551615", 18446744073709551615ULL, 0);
13263 check("18446744073709551616", 18446744073709551615ULL, ERANGE);
13264 #if 0 /* strtoull() for /^-/ strings is undefined. */
13265 check("-1", 18446744073709551615ULL, 0);
13266 check("-18446744073709551614", 2LL, 0);
13267 check("-18446744073709551615", 1LL, 0);
13268 check("-18446744073709551616", 18446744073709551615ULL, ERANGE);
13269 check("-18446744073709551617", 18446744073709551615ULL, ERANGE);
13276 if eval $compile; then
13277 case "`$run ./try`" in
13278 ok) echo "Your strtoull() seems to be working okay." ;;
13280 Your strtoull() doesn't seem to be working okay.
13282 d_strtoull="$undef"
13289 : see if strtouq exists
13290 set strtouq d_strtouq
13293 case "$d_strtouq" in
13296 Checking whether your strtouq() works okay...
13298 $cat >try.c <<'EOCP'
13301 extern unsigned long long int strtouq(char *s, char **, int);
13302 static int bad = 0;
13303 void check(char *s, unsigned long long eull, int een) {
13304 unsigned long long gull;
13306 gull = strtouq(s, 0, 10);
13307 if (!((gull == eull) && (errno == een)))
13311 check(" 1", 1LL, 0);
13312 check(" 0", 0LL, 0);
13313 check("18446744073709551615", 18446744073709551615ULL, 0);
13314 check("18446744073709551616", 18446744073709551615ULL, ERANGE);
13315 #if 0 /* strtouq() for /^-/ strings is undefined. */
13316 check("-1", 18446744073709551615ULL, 0);
13317 check("-18446744073709551614", 2LL, 0);
13318 check("-18446744073709551615", 1LL, 0);
13319 check("-18446744073709551616", 18446744073709551615ULL, ERANGE);
13320 check("-18446744073709551617", 18446744073709551615ULL, ERANGE);
13328 if eval $compile; then
13329 case "`$run ./try`" in
13330 ok) echo "Your strtouq() seems to be working okay." ;;
13332 Your strtouq() doesn't seem to be working okay.
13341 : see if strxfrm exists
13342 set strxfrm d_strxfrm
13345 : see if symlink exists
13346 set symlink d_symlink
13349 : see if syscall exists
13350 set syscall d_syscall
13353 : see if prototype for syscall is available
13355 set d_syscallproto syscall $i_unistd unistd.h
13358 : see if sysconf exists
13359 set sysconf d_sysconf
13362 : see if system exists
13363 set system d_system
13366 : see if tcgetpgrp exists
13367 set tcgetpgrp d_tcgetpgrp
13370 : see if tcsetpgrp exists
13371 set tcsetpgrp d_tcsetpgrp
13374 : see if prototype for telldir is available
13376 set d_telldirproto telldir $i_systypes sys/types.h $i_dirent dirent.h
13379 : see if this is a sys/times.h system
13380 set sys/times.h i_systimes
13383 : see if times exists
13385 if set times val -f d_times; eval $csym; $val; then
13386 echo 'times() found.' >&4
13389 case "$i_systimes" in
13390 "$define") inc='sys/times.h';;
13392 rp="What is the type returned by times() on this system?"
13393 set clock_t clocktype long stdio.h sys/types.h $inc
13396 echo 'times() NOT found, hope that will do.' >&4
13401 : see if truncate exists
13402 set truncate d_truncate
13405 : see if tzname[] exists
13407 if set tzname val -a d_tzname; eval $csym; $val; then
13409 echo 'tzname[] found.' >&4
13412 echo 'tzname[] NOT found.' >&4
13418 next|rhapsody|darwin) multiarch="$define" ;;
13420 case "$multiarch" in
13421 ''|[nN]*) multiarch="$undef" ;;
13424 : check for ordering of bytes in a long
13426 case "$usecrosscompile$multiarch" in
13429 You seem to be either cross-compiling or doing a multiarchitecture build,
13430 skipping the byteorder check.
13436 case "$byteorder" in
13439 In the following, larger digits indicate more significance. A big-endian
13440 machine like a Pyramid or a Motorola 680?0 chip will come out to 4321. A
13441 little-endian machine like a Vax or an Intel 80?86 chip would be 1234. Other
13442 machines may have weird orders like 3412. A Cray will report 87654321,
13443 an Alpha will report 12345678. If the test program works the default is
13445 I'm now running the test program...
13447 $cat >try.c <<'EOCP'
13454 char c[sizeof(long)];
13457 if (sizeof(long) > 4)
13458 u.l = (0x08070605L << 32) | 0x04030201L;
13461 for (i = 0; i < sizeof(long); i++)
13462 printf("%c", u.c[i]+'0');
13469 if eval $compile && ./try > /dev/null; then
13472 [1-4][1-4][1-4][1-4]|12345678|87654321)
13473 echo "(The test program ran ok.)"
13474 echo "byteorder=$dflt"
13477 ????|????????) echo "(The test program ran ok.)" ;;
13478 *) echo "(The test program didn't run right for some reason.)" ;;
13483 (I can't seem to compile the test program. Guessing big-endian...)
13486 case "$xxx_prompt" in
13488 rp="What is the order of bytes in a long?"
13504 Checking to see whether you can access character data unalignedly...
13506 case "$d_u32align" in
13507 '') $cat >try.c <<EOCP
13509 #define U32 $u32type
13510 #define BYTEORDER 0x$byteorder
13512 #include <signal.h>
13514 $signal_t bletch(s) int s; { exit(4); }
13517 #if BYTEORDER == 0x1234 || BYTEORDER == 0x4321
13522 if (sizeof(U32) != 4) {
13523 printf("sizeof(U32) is not 4, but %d\n", sizeof(U32));
13530 signal(SIGBUS, bletch);
13542 for (i = 0; i < 4; i++) {
13543 up = (U32*)(buf + i);
13544 if (! ((*up == 1 << (8*i)) || /* big-endian */
13545 (*up == 1 << (8*(3-i))) /* little-endian */
13549 printf("read failed (%x)\n", *up);
13555 for (i = 0; i < 4; i++) {
13556 up = (U32*)(buf + i);
13558 if (*up != 0xBeef) {
13559 printf("write failed (%x)\n", *up);
13573 if eval $compile_ok; then
13574 echo "(Testing for character data alignment may crash the test. That's okay.)" >&4
13575 $run ./try 2>&1 >/dev/null
13578 You can access character data pretty unalignedly.
13580 d_u32align="$undef"
13583 It seems that you must access character data in an aligned manner.
13585 d_u32align="$define"
13589 rp='Can you access character data at unaligned addresses?'
13593 [yY]*) d_u32align="$undef" ;;
13594 *) d_u32align="$define" ;;
13597 $rm -f core core.try.* try.core
13601 : see if ualarm exists
13602 set ualarm d_ualarm
13605 : see if umask exists
13609 : see if unordered exists
13610 set unordered d_unordered
13613 : see if usleep exists
13614 set usleep d_usleep
13617 : see if prototype for usleep is available
13619 set d_usleepproto usleep $i_unistd unistd.h
13622 : see if ustat exists
13626 : backward compatibility for d_hvfork
13627 if test X$d_hvfork != X; then
13628 d_vfork="$d_hvfork"
13631 : see if there is a vfork
13636 : Ok, but do we want to use it. vfork is reportedly unreliable in
13637 : perl on Solaris 2.x, and probably elsewhere.
13641 case "$usevfork" in
13647 Perl can only use a vfork() that doesn't suffer from strict
13648 restrictions on calling functions or modifying global data in
13649 the child. For example, glibc-2.1 contains such a vfork()
13650 that is unsuitable. If your system provides a proper fork()
13651 call, chances are that you do NOT want perl to use vfork().
13654 rp="Do you still want to use vfork()?"
13659 echo "Ok, we won't use vfork()."
13668 $define) usevfork='true';;
13669 *) usevfork='false';;
13672 : see if closedir exists
13673 set closedir d_closedir
13676 case "$d_closedir" in
13679 echo "Checking whether closedir() returns a status..." >&4
13681 #$i_dirent I_DIRENT /**/
13682 #$i_sysdir I_SYS_DIR /**/
13683 #$i_sysndir I_SYS_NDIR /**/
13684 #$i_systypes I_SYS_TYPES /**/
13686 #if defined(I_SYS_TYPES)
13687 #include <sys/types.h>
13689 #if defined(I_DIRENT)
13690 #include <dirent.h>
13691 #if defined(NeXT) && defined(I_SYS_DIR) /* NeXT needs dirent + sys/dir.h */
13692 #include <sys/dir.h>
13696 #include <sys/ndir.h>
13700 #include <ndir.h> /* may be wrong in the future */
13702 #include <sys/dir.h>
13707 int main() { return closedir(opendir(".")); }
13710 if eval $compile_ok; then
13711 if $run ./try > /dev/null 2>&1 ; then
13712 echo "Yes, it does."
13715 echo "No, it doesn't."
13719 echo "(I can't seem to compile the test program--assuming it doesn't)"
13727 set d_void_closedir
13730 : see if there is a wait4
13734 : see if waitpid exists
13735 set waitpid d_waitpid
13738 : see if wcstombs exists
13739 set wcstombs d_wcstombs
13742 : see if wctomb exists
13743 set wctomb d_wctomb
13746 : see if writev exists
13747 set writev d_writev
13750 : preserve RCS keywords in files with variable substitution, grrr
13755 Revision='$Revision'
13757 : check for alignment requirements
13759 case "$usecrosscompile$multiarch" in
13762 You seem to be either cross-compiling or doing a multiarchitecture build,
13763 skipping the memory alignment check.
13766 case "$alignbytes" in
13767 '') alignbytes=8 ;;
13771 case "$alignbytes" in
13772 '') echo "Checking alignment constraints..." >&4
13773 if $test "X$uselongdouble" = Xdefine -a "X$d_longdbl" = Xdefine; then
13774 $cat >try.c <<'EOCP'
13775 typedef long double NV;
13778 $cat >try.c <<'EOCP'
13782 $cat >>try.c <<'EOCP'
13790 printf("%d\n", (int)((char *)&try_algn.bar - (char *)&try_algn.foo));
13795 if eval $compile_ok; then
13799 echo "(I can't seem to compile the test program...)"
13802 *) dflt="$alignbytes"
13805 rp="Doubles must be aligned on a how-many-byte boundary?"
13813 : set the base revision
13816 : how do we catenate cpp tokens here?
13818 echo "Checking to see how your cpp does stuff like catenate tokens..." >&4
13819 $cat >cpp_stuff.c <<'EOCP'
13820 #define RCAT(a,b)a/**/b
13821 #define ACAT(a,b)a ## b
13825 $cppstdin $cppflags $cppminus <cpp_stuff.c >cpp_stuff.out 2>&1
13826 if $contains 'Circus' cpp_stuff.out >/dev/null 2>&1; then
13827 echo "Oh! Smells like ANSI's been here." >&4
13828 echo "We can catify or stringify, separately or together!"
13830 elif $contains 'Reiser' cpp_stuff.out >/dev/null 2>&1; then
13831 echo "Ah, yes! The good old days!" >&4
13832 echo "However, in the good old days we don't know how to stringify and"
13833 echo "catify at the same time."
13837 Hmm, I don't seem to be able to catenate tokens with your cpp. You're going
13838 to have to edit the values of CAT[2-5] in config.h...
13840 cpp_stuff="/* Help! How do we handle cpp_stuff? */*/"
13844 : see if this is a db.h system
13850 : Check db version.
13852 echo "Checking Berkeley DB version ..." >&4
13858 #include <sys/types.h>
13861 int main(int argc, char *argv[])
13863 #ifdef DB_VERSION_MAJOR /* DB version >= 2 */
13864 int Major, Minor, Patch ;
13865 unsigned long Version ;
13866 (void)db_version(&Major, &Minor, &Patch) ;
13868 printf("%d %d %d %d %d %d\n",
13869 DB_VERSION_MAJOR, DB_VERSION_MINOR, DB_VERSION_PATCH,
13870 Major, Minor, Patch);
13873 printf("You have Berkeley DB Version 2 or greater.\n");
13875 printf("db.h is from Berkeley DB Version %d.%d.%d\n",
13876 DB_VERSION_MAJOR, DB_VERSION_MINOR, DB_VERSION_PATCH);
13877 printf("libdb is from Berkeley DB Version %d.%d.%d\n",
13878 Major, Minor, Patch) ;
13880 /* check that db.h & libdb are compatible */
13881 if (DB_VERSION_MAJOR != Major || DB_VERSION_MINOR != Minor || DB_VERSION_PATCH != Patch) {
13882 printf("db.h and libdb are incompatible.\n") ;
13886 printf("db.h and libdb are compatible.\n") ;
13888 Version = DB_VERSION_MAJOR * 1000000 + DB_VERSION_MINOR * 1000
13889 + DB_VERSION_PATCH ;
13891 /* needs to be >= 2.3.4 */
13892 if (Version < 2003004) {
13893 /* if (DB_VERSION_MAJOR == 2 && DB_VERSION_MINOR == 0 && DB_VERSION_PATCH < 5) { */
13894 printf("Perl needs Berkeley DB 2.3.4 or greater.\n") ;
13900 #if defined(_DB_H_) && defined(BTREEMAGIC) && defined(HASHMAGIC)
13905 printf("You have Berkeley DB Version 1.\n");
13906 exit(0); /* DB version < 2: the coast is clear. */
13908 exit(1); /* <db.h> not Berkeley DB? */
13914 if eval $compile_ok && $run ./try; then
13915 echo 'Looks OK.' >&4
13917 db_version_major=$1
13918 db_version_minor=$2
13919 db_version_patch=$3
13921 echo "I can't use Berkeley DB with your <db.h>. I'll disable Berkeley DB." >&4
13925 : Remove db from list of libraries to use
13926 echo "Removing unusable -ldb from library list" >&4
13927 set `echo X $libs | $sed -e 's/-ldb / /' -e 's/-ldb$//'`
13930 echo "libs = $libs" >&4
13940 : Check the return type needed for hash
13942 echo "Checking return type needed for hash for Berkeley DB ..." >&4
13948 #include <sys/types.h>
13951 #ifndef DB_VERSION_MAJOR
13952 u_int32_t hash_cb (ptr, size)
13960 info.hash = hash_cb;
13964 if $cc $ccflags -c try.c >try.out 2>&1 ; then
13965 if $contains warning try.out >>/dev/null 2>&1 ; then
13968 db_hashtype='u_int32_t'
13971 : XXX Maybe we should just give up here.
13972 db_hashtype=u_int32_t
13974 echo "Help: I can't seem to compile the db test program." >&4
13975 echo "Something's wrong, but I'll assume you use $db_hashtype." >&4
13978 echo "Your version of Berkeley DB uses $db_hashtype for hash."
13980 *) db_hashtype=u_int32_t
13985 : Check the return type needed for prefix
13987 echo "Checking return type needed for prefix for Berkeley DB ..." >&4
13993 #include <sys/types.h>
13996 #ifndef DB_VERSION_MAJOR
13997 size_t prefix_cb (key1, key2)
14005 info.prefix = prefix_cb;
14009 if $cc $ccflags -c try.c >try.out 2>&1 ; then
14010 if $contains warning try.out >>/dev/null 2>&1 ; then
14011 db_prefixtype='int'
14013 db_prefixtype='size_t'
14016 db_prefixtype='size_t'
14017 : XXX Maybe we should just give up here.
14019 echo "Help: I can't seem to compile the db test program." >&4
14020 echo "Something's wrong, but I'll assume you use $db_prefixtype." >&4
14023 echo "Your version of Berkeley DB uses $db_prefixtype for prefix."
14025 *) db_prefixtype='size_t'
14030 : How can we generate normalized random numbers ?
14032 echo "Looking for a random number function..." >&4
14033 case "$randfunc" in
14035 if set drand48 val -f; eval $csym; $val; then
14037 echo "Good, found drand48()." >&4
14038 elif set random val -f; eval $csym; $val; then
14040 echo "OK, found random()." >&4
14043 echo "Yick, looks like I have to use rand()." >&4
14054 *-Dmy_rand=*|*-Dmy_srand=*)
14055 echo "Removing obsolete -Dmy_rand, -Dmy_srand, and -Drandbits from ccflags." >&4
14056 ccflags="`echo $ccflags | sed -e 's/-Dmy_rand=random/ /'`"
14057 ccflags="`echo $ccflags | sed -e 's/-Dmy_srand=srandom/ /'`"
14058 ccflags="`echo $ccflags | sed -e 's/-Drandbits=[0-9][0-9]*/ /'`"
14062 while $test "$cont"; do
14063 rp="Use which function to generate random numbers?"
14065 if $test "$ans" = "$dflt"; then
14071 if set $ans val -f; eval $csym; $val; then
14075 rp="I cannot find function $ans. Use that name anyway?"
14084 case "$randfunc" in
14086 drand01="drand48()"
14092 case "$randbits" in
14094 echo "Checking to see how many bits your $randfunc() function produces..." >&4
14096 #$i_unistd I_UNISTD
14097 #$i_stdlib I_STDLIB
14100 # include <unistd.h>
14103 # include <stdlib.h>
14108 register unsigned long tmp;
14109 register unsigned long max = 0L;
14111 for (i = 1000; i; i--) {
14112 tmp = (unsigned long) $randfunc();
14113 if (tmp > max) max = tmp;
14115 for (i = 0; max; i++)
14121 if eval $compile_ok; then
14125 echo "(I can't seem to compile the test program...)"
14132 rp="How many bits does your $randfunc() function produce?"
14136 drand01="($randfunc() / (double) ((unsigned long)1 << $randbits))"
14137 seedfunc="s$randfunc"
14138 randseedtype=unsigned
14142 rp="How many bits does your $randfunc() function produce?"
14145 seedfunc="s$randfunc"
14146 drand01="($randfunc() / (double) ((unsigned long)1 << $randbits))"
14147 if set $seedfunc val -f; eval $csym; $val; then
14148 echo "(Using $seedfunc() to seed random generator)"
14150 echo "(Warning: no $seedfunc() to seed random generator)"
14153 randseedtype=unsigned
14161 echo "Determining whether or not we are on an EBCDIC system..." >&4
14162 $cat >try.c <<'EOM'
14165 if ('M'==0xd4) return 0;
14172 if eval $compile_ok; then
14173 if $run ./try; then
14174 echo "You seem to speak EBCDIC." >&4
14177 echo "Nope, no EBCDIC, probably ASCII or some ISO Latin. Or UTF-8." >&4
14180 echo "I'm unable to compile the test program." >&4
14181 echo "I'll assume ASCII or some ISO Latin. Or UTF8." >&4
14189 Checking how to flush all pending stdio output...
14191 # I only know how to find the first 32 possibly open files on SunOS.
14192 # See also hints/sunos_4_1.sh and util.c --AD
14194 sunos) $echo '#define PERL_FFLUSH_ALL_FOPEN_MAX 32' > try.c ;;
14196 $cat >>try.c <<EOCP
14198 #$i_unistd I_UNISTD
14200 # include <unistd.h>
14202 #$d_sysconf HAS_SYSCONF
14203 #$d_stdio_stream_array HAS_STDIO_STREAM_ARRAY
14204 #ifdef HAS_STDIO_STREAM_ARRAY
14205 # define STDIO_STREAM_ARRAY $stdio_stream_array
14210 p = fopen("try.out", "w");
14214 # ifdef TRY_FPRINTF
14218 #ifdef TRY_FFLUSH_NULL
14221 #ifdef TRY_FFLUSH_ALL
14223 long open_max = -1;
14224 # ifdef PERL_FFLUSH_ALL_FOPEN_MAX
14225 open_max = PERL_FFLUSH_ALL_FOPEN_MAX;
14227 # if defined(HAS_SYSCONF) && defined(_SC_OPEN_MAX)
14228 open_max = sysconf(_SC_OPEN_MAX);
14231 open_max = FOPEN_MAX;
14234 open_max = OPEN_MAX;
14243 # ifdef HAS_STDIO_STREAM_ARRAY
14244 if (open_max > 0) {
14246 for (i = 0; i < open_max; i++)
14247 if (STDIO_STREAM_ARRAY[i]._file >= 0 &&
14248 STDIO_STREAM_ARRAY[i]._file < open_max &&
14249 STDIO_STREAM_ARRAY[i]._flag)
14250 fflush(&STDIO_STREAM_ARRAY[i]);
14258 : first we have to find out how _not_ to flush
14260 if $test "X$fflushNULL" = X -o "X$fflushall" = X; then
14262 set try -DTRY_FPUTC
14263 if eval $compile; then
14264 $run ./try 2>/dev/null
14267 if $test ! -s try.out -a "X$code" = X42; then
14273 set try -DTRY_FPRINTF
14274 if eval $compile; then
14275 $run ./try 2>/dev/null
14278 if $test ! -s try.out -a "X$code" = X42; then
14279 output=-DTRY_FPRINTF
14285 : check for fflush NULL behaviour
14286 case "$fflushNULL" in
14287 '') set try -DTRY_FFLUSH_NULL $output
14288 if eval $compile; then
14289 $run ./try 2>/dev/null
14292 if $test -s try.out -a "X$code" = X42; then
14293 fflushNULL="`$cat try.out`"
14295 if $test "X$code" != X42; then
14297 (If this test failed, don't worry, we'll try another method shortly.)
14302 $rm -f core try.core core.try.*
14303 case "$fflushNULL" in
14305 Your fflush(NULL) works okay for output streams.
14306 Let's see if it clobbers input pipes...
14308 # As of mid-March 2000 all versions of Solaris appear to have a stdio
14309 # bug that improperly flushes the input end of pipes. So we avoid the
14310 # autoflush on fork/system/exec support for now. :-(
14311 $cat >tryp.c <<EOCP
14314 main(int argc, char **argv)
14320 while ((i = getc(stdin)) != -1
14321 && (*bp++ = i) != '\n'
14322 && bp < &buf[1024])
14325 fprintf(stdout, "%s", buf);
14333 fflushNULL="$define"
14335 if eval $compile; then
14337 $cat tryp.c | $run ./tryp 2>/dev/null > tryp.out
14338 if cmp tryp.c tryp.out >/dev/null 2>&1; then
14340 fflush(NULL) seems to behave okay with input streams.
14342 fflushNULL="$define"
14345 Ouch, fflush(NULL) clobbers input pipes! We will not use it.
14347 fflushNULL="$undef"
14350 $rm -f core tryp.c tryp.core core.tryp.*
14353 Your fflush(NULL) isn't working (contrary to ANSI C).
14355 fflushNULL="$undef"
14358 Cannot figure out whether your fflush(NULL) works or not.
14359 I'm assuming it doesn't (contrary to ANSI C).
14361 fflushNULL="$undef"
14365 $define|true|[yY]*)
14366 fflushNULL="$define"
14369 fflushNULL="$undef"
14372 : check explicit looping only if NULL did not work, and if the pipe
14373 : bug does not show up on an explicit flush too
14374 case "$fflushNULL" in
14376 $cat >tryp.c <<EOCP
14379 main(int argc, char **argv)
14385 while ((i = getc(stdin)) != -1
14386 && (*bp++ = i) != '\n'
14387 && bp < &buf[1024])
14390 fprintf(stdout, "%s", buf);
14399 if eval $compile; then
14401 $cat tryp.c | $run ./tryp 2>/dev/null > tryp.out
14402 if cmp tryp.c tryp.out >/dev/null 2>&1; then
14404 Good, at least fflush(stdin) seems to behave okay when stdin is a pipe.
14406 : now check for fflushall behaviour
14407 case "$fflushall" in
14408 '') set try -DTRY_FFLUSH_ALL $output
14409 if eval $compile; then
14411 (Now testing the other method--but note that this also may fail.)
14413 $run ./try 2>/dev/null
14416 if $test -s try.out -a "X$code" = X42; then
14417 fflushall="`$cat try.out`"
14420 $rm -f core try.core core.try.*
14421 case "$fflushall" in
14423 Whew. Flushing explicitly all the stdio streams works.
14425 fflushall="$define"
14428 Sigh. Flushing explicitly all the stdio streams doesn't work.
14433 Cannot figure out whether flushing stdio streams explicitly works or not.
14434 I'm assuming it doesn't.
14440 "$define"|true|[yY]*)
14441 fflushall="$define"
14449 All is futile. Even fflush(stdin) clobbers input pipes!
14456 $rm -f core tryp.c tryp.core core.tryp.*
14458 *) fflushall="$undef"
14462 case "$fflushNULL$fflushall" in
14465 OK, I give up. I cannot figure out how to flush pending stdio output.
14466 We won't be flushing handles at all before fork/exec/popen.
14470 $rm -f try.* try$exe_ext
14472 : Store the full pathname to the ar program for use in the C program
14473 : Respect a hint or command line value for full_ar.
14478 : Store the full pathname to the sed program for use in the C program
14481 : see what type gids are declared as in the kernel
14483 echo "Looking for the type for group ids returned by getgid()."
14484 set gid_t gidtype xxx stdio.h sys/types.h
14488 xxx=`./findhdr sys/user.h`
14489 set `grep 'groups\[NGROUPS\];' "$xxx" 2>/dev/null` unsigned short
14491 unsigned) dflt="$1 $2" ;;
14495 *) dflt="$gidtype";;
14498 gid_t) echo "gid_t found." ;;
14499 *) rp="What is the type for group ids returned by getgid()?"
14507 *_t) zzz="$gidtype" ;;
14510 echo "Checking the size of $zzz..." >&4
14512 #include <sys/types.h>
14515 printf("%d\n", (int)sizeof($gidtype));
14520 if eval $compile_ok; then
14524 echo "(I can't execute the test program--guessing $gidsize.)" >&4
14527 echo "Your $zzz is $gidsize bytes long."
14532 echo "(I can't compile the test program--guessing $gidsize.)" >&4
14538 *_t) zzz="$gidtype" ;;
14541 echo "Checking the sign of $zzz..." >&4
14543 #include <sys/types.h>
14554 if eval $compile; then
14558 echo "(I can't execute the test program--guessing unsigned.)" >&4
14562 1) echo "Your $zzz is unsigned." ;;
14563 -1) echo "Your $zzz is signed." ;;
14569 echo "(I can't compile the test program--guessing unsigned.)" >&4
14575 if $test X"$quadtype" != X; then
14577 echo "Checking how to print 64-bit integers..." >&4
14579 if $test X"$sPRId64" = X -a X"$quadtype" = Xint; then
14580 $cat >try.c <<'EOCP'
14581 #include <sys/types.h>
14584 int q = 12345678901;
14585 printf("%ld\n", q);
14589 if eval $compile; then
14593 sPRId64='"d"'; sPRIi64='"i"'; sPRIu64='"u"';
14594 sPRIo64='"o"'; sPRIx64='"x"'; sPRIXU64='"X"';
14595 echo "We will use %d."
14601 if $test X"$sPRId64" = X -a X"$quadtype" = Xlong; then
14602 $cat >try.c <<'EOCP'
14603 #include <sys/types.h>
14606 long q = 12345678901;
14607 printf("%ld\n", q);
14611 if eval $compile; then
14615 sPRId64='"ld"'; sPRIi64='"li"'; sPRIu64='"lu"';
14616 sPRIo64='"lo"'; sPRIx64='"lx"'; sPRIXU64='"lX"';
14617 echo "We will use %ld."
14623 if $test X"$sPRId64" = X -a X"$i_inttypes" = X"$define" -a X"$quadtype" = Xint64_t; then
14624 $cat >try.c <<'EOCP'
14625 #include <sys/types.h>
14626 #include <inttypes.h>
14629 int64_t q = 12345678901;
14630 printf("%" PRId64 "\n", q);
14634 if eval $compile; then
14638 sPRId64=PRId64; sPRIi64=PRIi64; sPRIu64=PRIu64;
14639 sPRIo64=PRIo64; sPRIx64=PRIx64; sPRIXU64=PRIXU64;
14640 echo "We will use the C9X style."
14646 if $test X"$sPRId64" = X -a X"$quadtype" != X; then
14648 #include <sys/types.h>
14651 $quadtype q = 12345678901;
14652 printf("%Ld\n", q);
14656 if eval $compile; then
14660 sPRId64='"Ld"'; sPRIi64='"Li"'; sPRIu64='"Lu"';
14661 sPRIo64='"Lo"'; sPRIx64='"Lx"'; sPRIXU64='"LX"';
14662 echo "We will use %Ld."
14668 if $test X"$sPRId64" = X -a X"$quadtype" = X"long long"; then
14669 $cat >try.c <<'EOCP'
14670 #include <sys/types.h>
14673 long long q = 12345678901LL; /* AIX cc requires the LL suffix. */
14674 printf("%lld\n", q);
14678 if eval $compile; then
14682 sPRId64='"lld"'; sPRIi64='"lli"'; sPRIu64='"llu"';
14683 sPRIo64='"llo"'; sPRIx64='"llx"'; sPRIXU64='"llX"';
14684 echo "We will use the %lld style."
14690 if $test X"$sPRId64" = X -a X"$quadtype" != X; then
14692 #include <sys/types.h>
14695 $quadtype q = 12345678901;
14696 printf("%qd\n", q);
14700 if eval $compile; then
14704 sPRId64='"qd"'; sPRIi64='"qi"'; sPRIu64='"qu"';
14705 sPRIo64='"qo"'; sPRIx64='"qx"'; sPRIXU64='"qX"';
14706 echo "We will use %qd."
14712 if $test X"$sPRId64" = X; then
14713 echo "Cannot figure out how to print 64-bit integers." >&4
14721 '') d_PRId64="$undef"; d_PRIi64="$undef"; d_PRIu64="$undef";
14722 d_PRIo64="$undef"; d_PRIx64="$undef"; d_PRIXU64="$undef";
14724 *) d_PRId64="$define"; d_PRIi64="$define"; d_PRIu64="$define";
14725 d_PRIo64="$define"; d_PRIx64="$define"; d_PRIXU64="$define";
14731 $echo "Checking the format strings to be used for Perl's internal types..." >&4
14733 if $test X"$ivsize" = X8; then
14734 ivdformat="$sPRId64"
14735 uvuformat="$sPRIu64"
14736 uvoformat="$sPRIo64"
14737 uvxformat="$sPRIx64"
14738 uvXUformat="$sPRIXU64"
14740 if $test X"$ivsize" = X"$longsize"; then
14747 if $test X"$ivsize" = X"$intsize"; then
14755 if $test X"$ivsize" = X"$shortsize"; then
14766 if $test X"$uselongdouble" = X"$define" -a X"$d_longdbl" = X"$define" -a X"$d_PRIgldbl" = X"$define"; then
14767 nveformat="$sPRIeldbl"
14768 nvfformat="$sPRIfldbl"
14769 nvgformat="$sPRIgldbl"
14770 nvEUformat="$sPRIEUldbl"
14771 nvFUformat="$sPRIFUldbl"
14772 nvGUformat="$sPRIGUldbl"
14782 case "$ivdformat" in
14783 '') echo "$0: Fatal: failed to find format strings, cannot continue." >&4
14790 $echo "Checking the format string to be used for gids..." >&4
14793 -1) if $test X"$gidsize" = X"$ivsize"; then
14794 gidformat="$ivdformat"
14796 if $test X"$gidsize" = X"$longsize"; then
14799 if $test X"$gidsize" = X"$intsize"; then
14802 if $test X"$gidsize" = X"$shortsize"; then
14809 *) if $test X"$gidsize" = X"$uvsize"; then
14810 gidformat="$uvuformat"
14812 if $test X"$gidsize" = X"$longsize"; then
14815 if $test X"$gidsize" = X"$intsize"; then
14818 if $test X"$gidsize" = X"$shortsize"; then
14827 : see if getgroups exists
14828 set getgroups d_getgrps
14831 : see if setgroups exists
14832 set setgroups d_setgrps
14836 : Find type of 2nd arg to 'getgroups()' and 'setgroups()'
14838 case "$d_getgrps$d_setgrps" in
14840 case "$groupstype" in
14841 '') dflt="$gidtype" ;;
14842 *) dflt="$groupstype" ;;
14845 What type of pointer is the second argument to getgroups() and setgroups()?
14846 Usually this is the same as group ids, $gidtype, but not always.
14849 rp='What type pointer is the second argument to getgroups() and setgroups()?'
14853 *) groupstype="$gidtype";;
14857 echo "Checking if your $make program sets \$(MAKE)..." >&4
14858 case "$make_set_make" in
14860 $sed 's/^X //' > testmake.mak << 'EOF'
14862 X @echo 'maketemp="$(MAKE)"'
14864 case "`$make -f testmake.mak 2>/dev/null`" in
14865 *maketemp=*) make_set_make='#' ;;
14866 *) make_set_make="MAKE=$make" ;;
14868 $rm -f testmake.mak
14871 case "$make_set_make" in
14872 '#') echo "Yup, it does.";;
14873 *) echo "Nope, it doesn't.";;
14876 : see what type is used for mode_t
14877 rp="What is the type used for file modes for system calls (e.g. fchmod())?"
14878 set mode_t modetype int stdio.h sys/types.h
14881 : see if stdarg is available
14883 if $test `./findhdr stdarg.h`; then
14884 echo "<stdarg.h> found." >&4
14887 echo "<stdarg.h> NOT found." >&4
14891 : see if varags is available
14893 if $test `./findhdr varargs.h`; then
14894 echo "<varargs.h> found." >&4
14896 echo "<varargs.h> NOT found, but that's ok (I hope)." >&4
14899 : set up the varargs testing programs
14900 $cat > varargs.c <<EOP
14902 #include <stdarg.h>
14905 #include <varargs.h>
14909 int f(char *p, ...)
14923 p = va_arg(ap, char *);
14928 $cat > varargs <<EOP
14930 if $cc -c $ccflags -D\$1 varargs.c >/dev/null 2>&1; then
14939 : now check which varargs header should be included
14944 if `./varargs I_STDARG`; then
14946 elif `./varargs I_VARARGS`; then
14951 if `./varargs I_VARARGS`; then
14958 echo "I could not find the definition for va_dcl... You have problems..." >&4
14959 val="$undef"; set i_stdarg; eval $setvar
14960 val="$undef"; set i_varargs; eval $setvar
14965 case "$i_varhdr" in
14967 val="$define"; set i_stdarg; eval $setvar
14968 val="$undef"; set i_varargs; eval $setvar
14971 val="$undef"; set i_stdarg; eval $setvar
14972 val="$define"; set i_varargs; eval $setvar
14975 echo "We'll include <$i_varhdr> to get va_dcl definition." >&4;;
14979 : see if we need va_copy
14981 case "$i_stdarg" in
14984 #include <stdarg.h>
14986 #$i_stdlib I_STDLIB
14988 #include <stdlib.h>
14990 #include <signal.h>
14993 ivfprintf(FILE *f, const char *fmt, va_list *valp)
14995 return vfprintf(f, fmt, *valp);
14999 myvfprintf(FILE *f, const char *fmt, va_list val)
15001 return ivfprintf(f, fmt, &val);
15005 myprintf(char *fmt, ...)
15008 va_start(val, fmt);
15009 return myvfprintf(stdout, fmt, val);
15013 main(int ac, char **av)
15015 signal(SIGSEGV, exit);
15017 myprintf("%s%cs all right, then\n", "that", '\'');
15022 if eval $compile && $run ./try 2>&1 >/dev/null; then
15023 case "`$run ./try`" in
15024 "that's all right, then")
15030 yes) echo "It seems that you don't need va_copy()." >&4
15031 need_va_copy="$undef"
15033 *) echo "It seems that va_copy() or similar will be needed." >&4
15034 need_va_copy="$define"
15037 $rm -f try.* core core.* *.core *.core.*
15039 *) echo "You don't have <stdarg.h>, not checking for va_copy()." >&4
15043 : define a fucntion to check prototypes
15044 $cat > protochk <<EOSH
15047 optimize="$optimize"
15049 prototype="$prototype"
15054 $cat >> protochk <<'EOSH'
15059 while test $# -ge 2; do
15061 $define) echo "#include <$2>" >> try.c ;;
15062 literal) echo "$2" >> try.c ;;
15066 test "$prototype" = "$define" && echo '#define CAN_PROTOTYPE' >> try.c
15067 cat >> try.c <<'EOCP'
15068 #ifdef CAN_PROTOTYPE
15069 #define _(args) args
15074 echo "$foo" >> try.c
15075 echo 'int no_real_function_has_this_name _((void)) { return 0; }' >> try.c
15076 $cc $optimize $ccflags -c try.c > /dev/null 2>&1
15082 $eunicefix protochk
15084 : see what type is used for size_t
15085 rp="What is the type used for the length parameter for string functions?"
15086 set size_t sizetype 'unsigned int' stdio.h sys/types.h
15089 : check for type of arguments to gethostbyaddr.
15090 if test "X$netdb_host_type" = X -o "X$netdb_hlen_type" = X; then
15091 case "$d_gethbyaddr" in
15095 Checking to see what type of arguments are accepted by gethostbyaddr().
15097 hdrs="$define sys/types.h
15098 $d_socket sys/socket.h
15099 $i_niin netinet/in.h
15101 $i_unistd unistd.h"
15102 : The first arg can 'char *' or 'void *'
15103 : The second arg is some of integral type
15104 for xxx in in_addr_t 'const void *' 'const char *' 'void *' 'char *'; do
15105 for yyy in size_t long int; do
15106 case "$netdb_host_type" in
15107 '') try="extern struct hostent *gethostbyaddr($xxx, $yyy, int);"
15108 if ./protochk "$try" $hdrs; then
15109 echo "Your system accepts $xxx for the first arg."
15110 echo "...and $yyy for the second arg."
15111 netdb_host_type="$xxx"
15112 netdb_hlen_type="$yyy"
15118 : In case none of those worked, prompt the user.
15119 case "$netdb_host_type" in
15120 '') rp='What is the type for the 1st argument to gethostbyaddr?'
15123 netdb_host_type=$ans
15124 rp='What is the type for the 2nd argument to gethostbyaddr?'
15127 netdb_hlen_type=$ans
15131 *) : no gethostbyaddr, so pick harmless defaults
15132 netdb_host_type='char *'
15133 netdb_hlen_type="$sizetype"
15136 # Remove the "const" if needed. -- but then we'll have a
15138 # netdb_host_type=`echo "$netdb_host_type" | sed 's/^const //'`
15141 : check for type of argument to gethostbyname.
15142 if test "X$netdb_name_type" = X ; then
15143 case "$d_gethbyname" in
15147 Checking to see what type of argument is accepted by gethostbyname().
15149 hdrs="$define sys/types.h
15150 $d_socket sys/socket.h
15151 $i_niin netinet/in.h
15153 $i_unistd unistd.h"
15154 for xxx in "const char *" "char *"; do
15155 case "$netdb_name_type" in
15156 '') try="extern struct hostent *gethostbyname($xxx);"
15157 if ./protochk "$try" $hdrs; then
15158 echo "Your system accepts $xxx."
15159 netdb_name_type="$xxx"
15164 : In case none of those worked, prompt the user.
15165 case "$netdb_name_type" in
15166 '') rp='What is the type for the 1st argument to gethostbyname?'
15169 netdb_name_type=$ans
15173 *) : no gethostbyname, so pick harmless default
15174 netdb_name_type='char *'
15179 : check for type of 1st argument to getnetbyaddr.
15180 if test "X$netdb_net_type" = X ; then
15181 case "$d_getnbyaddr" in
15185 Checking to see what type of 1st argument is accepted by getnetbyaddr().
15187 hdrs="$define sys/types.h
15188 $d_socket sys/socket.h
15189 $i_niin netinet/in.h
15191 $i_unistd unistd.h"
15192 for xxx in in_addr_t "unsigned long" long "unsigned int" int; do
15193 case "$netdb_net_type" in
15194 '') try="extern struct netent *getnetbyaddr($xxx, int);"
15195 if ./protochk "$try" $hdrs; then
15196 echo "Your system accepts $xxx."
15197 netdb_net_type="$xxx"
15202 : In case none of those worked, prompt the user.
15203 case "$netdb_net_type" in
15204 '') rp='What is the type for the 1st argument to getnetbyaddr?'
15207 netdb_net_type=$ans
15211 *) : no getnetbyaddr, so pick harmless default
15212 netdb_net_type='long'
15216 : locate the preferred pager for this system
15222 [a-zA-Z]:/*) dflt=$pg;;
15226 [a-zA-Z]:/*) dflt=$more;;
15230 [a-zA-Z]:/*) dflt=$less;;
15233 '') dflt=/usr/ucb/more;;
15240 rp='What pager is used on your system?'
15244 : see what type pids are declared as in the kernel
15245 rp="What is the type of process ids on this system?"
15246 set pid_t pidtype int stdio.h sys/types.h
15249 : Find earliest binary compatible site_perl subdirectory perl can use.
15250 case "$bincompat5005" in
15251 "$define") xs_apiversion='5.005' ;;
15252 *) xs_apiversion=$version ;; # The current site_perl version.
15254 : Find earliest pure perl site_perl subdirectory perl can use.
15255 : The versioned directories started at 5.005.
15256 pm_apiversion='5.005'
15258 : see if ar generates random libraries by itself
15260 echo "Checking how to generate random libraries on your machine..." >&4
15261 echo 'int bar1() { return bar2(); }' > bar1.c
15262 echo 'int bar2() { return 2; }' > bar2.c
15263 $cat > foo.c <<'EOP'
15264 int main() { printf("%d\n", bar1()); exit(0); }
15266 $cc $ccflags -c bar1.c >/dev/null 2>&1
15267 $cc $ccflags -c bar2.c >/dev/null 2>&1
15268 $cc $ccflags -c foo.c >/dev/null 2>&1
15269 $ar rc bar$_a bar2$_o bar1$_o >/dev/null 2>&1
15270 if $cc -o foobar $ccflags $ldflags foo$_o bar$_a $libs > /dev/null 2>&1 &&
15271 $run ./foobar >/dev/null 2>&1; then
15272 echo "$ar appears to generate random libraries itself."
15275 elif $ar ts bar$_a >/dev/null 2>&1 &&
15276 $cc -o foobar $ccflags $ldflags foo$_o bar$_a $libs > /dev/null 2>&1 &&
15277 $run ./foobar >/dev/null 2>&1; then
15278 echo "a table of contents needs to be added with '$ar ts'."
15285 ranlib=`./loc ranlib X /usr/bin /bin /usr/local/bin`
15286 $test -f $ranlib || ranlib=''
15289 if $test -n "$ranlib"; then
15290 echo "your system has '$ranlib'; we'll use that."
15293 echo "your system doesn't seem to support random libraries"
15294 echo "so we'll use lorder and tsort to order the libraries."
15301 : check for type of arguments to select.
15302 case "$selecttype" in
15303 '') case "$d_select" in
15307 Checking to see what type of arguments are accepted by select().
15309 hdrs="$define sys/types.h
15310 $i_systime sys/time.h
15311 $i_sysselct sys/select.h
15312 $d_socket sys/socket.h"
15313 : The first arg can be int, unsigned, or size_t
15314 : The last arg may or may not be 'const'
15316 : void pointer has been seen but using that
15317 : breaks the selectminbits test
15318 for xxx in 'fd_set *' 'int *'; do
15319 for nfd in 'int' 'size_t' 'unsigned long' 'unsigned' ; do
15320 for tmo in 'struct timeval *' 'const struct timeval *'; do
15322 '') try="extern select _(($nfd, $xxx, $xxx, $xxx, $tmo));"
15323 if ./protochk "$try" $hdrs; then
15324 echo "Your system accepts $xxx."
15333 '') rp='What is the type for the 2nd, 3rd, and 4th arguments to select?'
15334 case "$d_fd_set" in
15335 $define) dflt="fd_set *" ;;
15344 *) : no select, so pick a harmless default
15351 : check for the select 'width'
15352 case "$selectminbits" in
15353 '') case "$d_select" in
15357 Checking to see on how many bits at a time your select() operates...
15360 #include <sys/types.h>
15362 #$i_systime I_SYS_TIME
15363 #$i_systimek I_SYS_TIME_KERNEL
15368 # ifdef I_SYS_TIME_KERNEL
15371 # include <sys/time.h>
15372 # ifdef I_SYS_TIME_KERNEL
15376 #$i_sysselct I_SYS_SELECT
15377 #ifdef I_SYS_SELECT
15378 #include <sys/select.h>
15380 #$d_socket HAS_SOCKET
15382 # include <sys/socket.h> /* Might include <sys/bsdtypes.h> */
15386 #define S sizeof(*(b))
15388 #define NBYTES (S * 8 > MINBITS ? S : MINBITS/8)
15389 #define NBITS (NBYTES * 8)
15398 fp = fopen("try.c", "r");
15404 b = ($selecttype)s;
15405 for (i = 0; i < NBITS; i++)
15409 select(fd + 1, b, 0, 0, &t);
15410 for (i = NBITS - 1; i > fd && FD_ISSET(i, b); i--);
15411 printf("%d\n", i + 1);
15416 if eval $compile_ok; then
15417 selectminbits=`$run ./try`
15418 case "$selectminbits" in
15420 Cannot figure out on how many bits at a time your select() operates.
15421 I'll play safe and guess it is 32 bits.
15427 *) bits="$selectminbits bits" ;;
15429 echo "Your select() operates on $bits at a time." >&4
15431 rp='What is the minimum number of bits your select() operates on?'
15432 case "$byteorder" in
15433 1234|12345678) dflt=32 ;;
15438 selectminbits="$val"
15442 *) : no select, so pick a harmless default
15449 : Trace out the files included by signal.h, then look for SIGxxx names.
15450 : Remove SIGARRAYSIZE used by HPUX.
15451 : Remove SIGSTKSIZE used by Linux.
15452 : Remove SIGSTKSZ used by Posix.
15453 : Remove SIGTYP void lines used by OS2.
15454 : Some cpps, like os390, dont give the file name anywhere
15455 if [ "X$fieldn" = X ]; then
15456 : Just make some guesses. We check them later.
15457 xxx='/usr/include/signal.h /usr/include/sys/signal.h'
15459 xxx=`echo '#include <signal.h>' |
15460 $cppstdin $cppminus $cppflags 2>/dev/null |
15461 $grep '^[ ]*#.*include' |
15462 $awk "{print \\$$fieldn}" | $sed 's!"!!g' | $sed 's!\\\\\\\\!/!g' | $sort | $uniq`
15464 : Check this list of files to be sure we have parsed the cpp output ok.
15465 : This will also avoid potentially non-existent files, such
15468 for xx in $xxx /dev/null ; do
15469 $test -f "$xx" && xxxfiles="$xxxfiles $xx"
15471 : If we have found no files, at least try signal.h
15472 case "$xxxfiles" in
15473 '') xxxfiles=`./findhdr signal.h` ;;
15476 $1 ~ /^#define$/ && $2 ~ /^SIG[A-Z0-9]*$/ && $2 !~ /SIGARRAYSIZE/ && $2 !~ /SIGSTKSIZE/ && $2 !~ /SIGSTKSZ/ && $3 !~ /void/ {
15477 print substr($2, 4, 20)
15479 $1 == "#" && $2 ~ /^define$/ && $3 ~ /^SIG[A-Z0-9]*$/ && $3 !~ /SIGARRAYSIZE/ && $4 !~ /void/ {
15480 print substr($3, 4, 20)
15482 : Append some common names just in case the awk scan failed.
15483 xxx="$xxx ABRT ALRM BUS CANCEL CHLD CLD CONT DIL EMT FPE"
15484 xxx="$xxx FREEZE HUP ILL INT IO IOT KILL LOST LWP PHONE"
15485 xxx="$xxx PIPE POLL PROF PWR QUIT RTMAX RTMIN SEGV STKFLT STOP"
15486 xxx="$xxx SYS TERM THAW TRAP TSTP TTIN TTOU URG USR1 USR2"
15487 xxx="$xxx USR3 USR4 VTALRM WAITING WINCH WIND WINDOW XCPU XFSZ"
15489 : generate a few handy files for later
15490 $cat > signal.c <<'EOCP'
15491 #include <sys/types.h>
15492 #include <signal.h>
15496 /* Strange style to avoid deeply-nested #if/#else/#endif */
15499 # define NSIG (_NSIG)
15505 # define NSIG (SIGMAX+1)
15511 # define NSIG (SIG_MAX+1)
15517 # define NSIG (MAXSIG+1)
15523 # define NSIG (MAX_SIG+1)
15528 # ifdef SIGARRAYSIZE
15529 # define NSIG (SIGARRAYSIZE+1) /* Not sure of the +1 */
15535 # define NSIG (_sys_nsig) /* Solaris 2.5 */
15539 /* Default to some arbitrary number that's big enough to get most
15540 of the common signals.
15546 printf("NSIG %d\n", NSIG);
15552 echo $xxx | $tr ' ' $trnl | $sort | $uniq | $awk '
15554 printf "#ifdef SIG"; printf $1; printf "\n"
15555 printf "printf(\""; printf $1; printf " %%d\\n\",SIG";
15556 printf $1; printf ");\n"
15560 printf "#endif /* JUST_NSIG */\n";
15561 printf "exit(0);\n}\n";
15564 $cat >signal.awk <<'EOP'
15565 BEGIN { ndups = 0 }
15566 $1 ~ /^NSIG$/ { nsig = $2 }
15567 ($1 !~ /^NSIG$/) && (NF == 2) {
15568 if ($2 > maxsig) { maxsig = $2 }
15569 if (sig_name[$2]) {
15570 dup_name[ndups] = $1
15571 dup_num[ndups] = $2
15583 printf("NSIG %d\n", nsig);
15584 for (n = 1; n < nsig; n++) {
15586 printf("%s %d\n", sig_name[n], sig_num[n])
15589 printf("NUM%d %d\n", n, n)
15592 for (n = 0; n < ndups; n++) {
15593 printf("%s %d\n", dup_name[n], dup_num[n])
15597 $cat >signal_cmd <<EOS
15599 if $test -s signal.lst; then
15600 echo "Using your existing signal.lst file"
15605 $cat >>signal_cmd <<'EOS'
15608 if eval $compile_ok; then
15609 $run ./signal$_exe | $sort -n +1 | $uniq | $awk -f signal.awk >signal.lst
15611 echo "(I can't seem be able to compile the whole test program)" >&4
15612 echo "(I'll try it in little pieces.)" >&4
15613 set signal -DJUST_NSIG
15614 if eval $compile_ok; then
15615 $run ./signal$_exe > signal.nsg
15618 echo "I can't seem to figure out how many signals you have." >&4
15619 echo "Guessing 50." >&4
15620 echo 'NSIG 50' > signal.nsg
15622 : Now look at all the signal names, one at a time.
15623 for xx in `echo $xxx | $tr ' ' $trnl | $sort | $uniq`; do
15624 $cat > signal.c <<EOCP
15625 #include <sys/types.h>
15626 #include <signal.h>
15629 printf("$xx %d\n", SIG${xx});
15634 if eval $compile; then
15635 echo "SIG${xx} found."
15636 $run ./signal$_exe >> signal.ls1
15638 echo "SIG${xx} NOT found."
15641 if $test -s signal.ls1; then
15642 $cat signal.nsg signal.ls1 |
15643 $sort -n +1 | $uniq | $awk -f signal.awk >signal.lst
15647 if $test -s signal.lst; then
15650 echo "(AAK! I can't compile the test programs -- Guessing)" >&4
15651 echo 'kill -l' >signal
15652 set X `csh -f <signal`
15656 0) set HUP INT QUIT ILL TRAP ABRT EMT FPE KILL BUS SEGV SYS PIPE ALRM TERM;;
15658 echo $@ | $tr ' ' $trnl | \
15659 $awk '{ printf "%s %d\n", $1, ++s; }
15660 END { printf "NSIG %d\n", ++s }' >signal.lst
15662 $rm -f signal.c signal$_exe signal$_o signal.nsg signal.ls1
15664 chmod a+x signal_cmd
15665 $eunicefix signal_cmd
15667 : generate list of signal names
15669 case "$sig_name_init" in
15671 *) case "$sig_num_init" in
15672 ''|*,*) doinit=yes ;;
15677 echo "Generating a list of signal names and numbers..." >&4
15679 sig_count=`$awk '/^NSIG/ { printf "%d", $2 }' signal.lst`
15680 sig_name=`$awk 'BEGIN { printf "ZERO " }
15681 !/^NSIG/ { printf "%s ", $1 }' signal.lst`
15682 sig_num=`$awk 'BEGIN { printf "0 " }
15683 !/^NSIG/ { printf "%d ", $2 }' signal.lst`
15684 sig_name_init=`$awk 'BEGIN { printf "\"ZERO\", " }
15685 !/^NSIG/ { printf "\"%s\", ", $1 }
15686 END { printf "0\n" }' signal.lst`
15687 sig_num_init=`$awk 'BEGIN { printf "0, " }
15688 !/^NSIG/ { printf "%d, ", $2}
15689 END { printf "0\n"}' signal.lst`
15692 echo "The following $sig_count signals are available:"
15694 echo $sig_name | $awk \
15695 'BEGIN { linelen = 0 }
15697 for (i = 1; i <= NF; i++) {
15698 name = "SIG" $i " "
15699 linelen = linelen + length(name)
15700 if (linelen > 70) {
15702 linelen = length(name)
15708 sig_size=`echo $sig_name | awk '{print NF}'`
15709 $rm -f signal signal.c signal.awk signal.lst signal_cmd
15712 case "$sizetype" in
15713 *_t) zzz="$sizetype" ;;
15714 *) zzz="filesize" ;;
15716 echo "Checking the size of $zzz..." >&4
15718 #include <sys/types.h>
15721 printf("%d\n", (int)sizeof($sizetype));
15726 if eval $compile_ok; then
15730 echo "(I can't execute the test program--guessing $sizesize.)" >&4
15733 echo "Your $zzz size is $sizesize bytes."
15738 echo "(I can't compile the test program--guessing $sizesize.)" >&4
15742 : check for socklen_t
15744 echo "Checking to see if you have socklen_t..." >&4
15746 #include <sys/types.h>
15747 #$d_socket HAS_SOCKET
15749 #include <sys/socket.h>
15751 int main() { socklen_t x = 16; }
15754 if eval $compile; then
15756 echo "You have socklen_t."
15759 echo "You do not have socklen_t."
15760 case "$sizetype" in
15761 size_t) echo "(You do have size_t, that might work. Some people are happy with just an int.)" ;;
15768 : see if this is a socks.h system
15769 set socks.h i_socks
15772 : check for type of the size argument to socket calls
15773 case "$d_socket" in
15777 Checking to see what type is the last argument of accept().
15780 case "$d_socklen_t" in
15781 "$define") yyy="$yyy socklen_t"
15783 yyy="$yyy $sizetype int long unsigned"
15784 for xxx in $yyy; do
15785 case "$socksizetype" in
15786 '') try="extern int accept(int, struct sockaddr *, $xxx *);"
15787 case "$usesocks" in
15789 if ./protochk "$try" $i_systypes sys/types.h $d_socket sys/socket.h literal '#define INCLUDE_PROTOTYPES' $i_socks socks.h.; then
15790 echo "Your system accepts '$xxx *' for the last argument of accept()."
15791 socksizetype="$xxx"
15794 *) if ./protochk "$try" $i_systypes sys/types.h $d_socket sys/socket.h; then
15795 echo "Your system accepts '$xxx *' for the last argument of accept()."
15796 socksizetype="$xxx"
15803 : In case none of those worked, prompt the user.
15804 case "$socksizetype" in
15805 '') rp='What is the type for socket address structure sizes?'
15812 *) : no sockets, so pick relatively harmless default
15817 : see what type is used for signed size_t
15818 set ssize_t ssizetype int stdio.h sys/types.h
15823 #include <sys/types.h>
15824 #define Size_t $sizetype
15825 #define SSize_t $dflt
15828 if (sizeof(Size_t) == sizeof(SSize_t))
15830 else if (sizeof(Size_t) == sizeof(int))
15839 if eval $compile_ok && $run ./try > /dev/null; then
15840 ssizetype=`$run ./try`
15841 echo "I'll be using $ssizetype for functions returning a byte count." >&4
15844 Help! I can't compile and run the ssize_t test program: please enlighten me!
15845 (This is probably a misconfiguration in your system or libraries, and
15846 you really ought to fix it. Still, I'll try anyway.)
15848 I need a type that is the same size as $sizetype, but is guaranteed to
15849 be signed. Common values are ssize_t, int and long.
15852 rp="What signed type is the same size as $sizetype?"
15858 : see what type of char stdio uses.
15860 echo '#include <stdio.h>' | $cppstdin $cppminus > stdioh
15861 if $contains 'unsigned.*char.*_ptr;' stdioh >/dev/null 2>&1 ; then
15862 echo "Your stdio uses unsigned chars." >&4
15863 stdchar="unsigned char"
15865 echo "Your stdio uses signed chars." >&4
15872 : see if time exists
15874 if test "X$d_time" = X -o X"$timetype" = X; then
15875 if set time val -f d_time; eval $csym; $val; then
15876 echo 'time() found.' >&4
15878 rp="What is the type returned by time() on this system?"
15879 set time_t timetype long stdio.h sys/types.h
15882 echo 'time() not found, hope that will do.' >&4
15890 : see what type uids are declared as in the kernel
15892 echo "Looking for the type for user ids returned by getuid()."
15893 set uid_t uidtype xxx stdio.h sys/types.h
15897 xxx=`./findhdr sys/user.h`
15898 set `grep '_ruid;' "$xxx" 2>/dev/null` unsigned short
15900 unsigned) dflt="$1 $2" ;;
15904 *) dflt="$uidtype";;
15907 uid_t) echo "uid_t found." ;;
15908 *) rp="What is the type for user ids returned by getuid()?"
15916 *_t) zzz="$uidtype" ;;
15919 echo "Checking the size of $zzz..." >&4
15921 #include <sys/types.h>
15924 printf("%d\n", (int)sizeof($uidtype));
15929 if eval $compile_ok; then
15933 echo "(I can't execute the test program--guessing $uidsize.)" >&4
15936 echo "Your $zzz is $uidsize bytes long."
15941 echo "(I can't compile the test program--guessing $uidsize.)" >&4
15946 *_t) zzz="$uidtype" ;;
15949 echo "Checking the sign of $zzz..." >&4
15951 #include <sys/types.h>
15962 if eval $compile; then
15966 echo "(I can't execute the test program--guessing unsigned.)" >&4
15970 1) echo "Your $zzz is unsigned." ;;
15971 -1) echo "Your $zzz is signed." ;;
15977 echo "(I can't compile the test program--guessing unsigned.)" >&4
15983 $echo "Checking the format string to be used for uids..." >&4
15986 -1) if $test X"$uidsize" = X"$ivsize"; then
15987 uidformat="$ivdformat"
15989 if $test X"$uidsize" = X"$longsize"; then
15992 if $test X"$uidsize" = X"$intsize"; then
15995 if $test X"$uidsize" = X"$shortsize"; then
16002 *) if $test X"$uidsize" = X"$uvsize"; then
16003 uidformat="$uvuformat"
16005 if $test X"$uidsize" = X"$longsize"; then
16008 if $test X"$uidsize" = X"$intsize"; then
16011 if $test X"$uidsize" = X"$shortsize"; then
16020 : determine compiler compiler
16029 if $test -f "$byacc$_exe"; then
16031 comp="byacc or $comp"
16033 if $test -f "$bison$_exe"; then
16034 comp="$comp or bison -y"
16036 rp="Which compiler compiler ($comp) shall I use?"
16045 echo "(Adding -y option to bison to get yacc-compatible behaviour.)"
16051 : see if this is a fp.h system
16055 : see if this is a fp_class.h system
16056 set fp_class.h i_fp_class
16059 : see if this is a ieeefp.h system
16060 case "$i_ieeefp" in
16061 '' ) set ieeefp.h i_ieeefp
16066 : see if this is a libutil.h system
16067 set libutil.h i_libutil
16070 : see if locale.h is available
16071 set locale.h i_locale
16074 : see if mach cthreads are available
16075 if test "X$usethreads" = "X$define"; then
16076 set mach/cthreads.h i_machcthr
16079 i_machcthr="$undef"
16084 : see if this is a math.h system
16088 : see if this is a mntent.h system
16089 set mntent.h i_mntent
16092 : see if ndbm.h is available
16098 # Some Linux distributions such as RedHat 7.1 put the
16099 # ndbm.h header in /usr/include/gdbm/ndbm.h.
16100 if $test -f /usr/include/gdbm/ndbm.h; then
16101 echo '<gdbm/ndbm.h> found.'
16102 ccflags="$ccflags -I/usr/include/gdbm"
16103 cppflags="$cppflags -I/usr/include/gdbm"
16111 : see if dbm_open exists
16112 set dbm_open d_dbm_open
16114 case "$d_dbm_open" in
16117 echo "We won't be including <ndbm.h>"
16126 : see if net/errno.h is available
16128 set net/errno.h val
16131 : Unfortunately, it causes problems on some systems. Arrgh.
16134 cat > try.c <<'EOM'
16137 #include <net/errno.h>
16143 if $cc $ccflags -c try.c >/dev/null 2>&1; then
16144 echo "We'll be including <net/errno.h>." >&4
16146 echo "We won't be including <net/errno.h>." >&4
16155 : see if netinet/tcp.h is available
16156 set netinet/tcp.h i_netinettcp
16159 : see if this is a poll.h system
16163 : see if this is a prot.h system
16168 $echo "Guessing which symbols your C compiler and preprocessor define..." >&4
16169 $cat <<'EOSH' > Cppsym.know
16170 a29k ABI64 aegis AES_SOURCE AIX AIX32 AIX370
16171 AIX41 AIX42 AIX43 AIX_SOURCE aixpc ALL_SOURCE
16172 alliant alpha am29000 AM29000 AMD64 amiga AMIGAOS AMIX
16173 ansi ANSI_C_SOURCE apollo ardent ARM32 atarist att386 att3b
16174 BeOS BIG_ENDIAN BIT_MSF bsd BSD bsd43 bsd4_2 bsd4_3 BSD4_3 bsd4_4
16175 BSD_4_3 BSD_4_4 BSD_NET2 BSD_TIME BSD_TYPES BSDCOMPAT bsdi
16176 bull c cadmus clipper CMU COFF COMPILER_VERSION
16177 concurrent convex cpu cray CRAY CRAYMPP ctix CX_UX
16178 CYGWIN DGUX DGUX_SOURCE DJGPP dmert DOLPHIN DPX2 DSO
16179 Dynix DynixPTX ELF encore EPI EXTENSIONS FAVOR_BSD
16180 FILE_OFFSET_BITS FreeBSD GCC_NEW_VARARGS gcos gcx gimpel
16182 GNU_SOURCE GNUC GNUC_MINOR GNU_LIBRARY GO32 gould GOULD_PN
16183 H3050R H3050RX hbullx20 hcx host_mips
16184 hp200 hp300 hp700 HP700 hp800 hp9000
16185 hp9000s200 hp9000s300 hp9000s400 hp9000s500
16186 hp9000s700 hp9000s800 hp9k8 hp_osf hppa hpux HPUX_SOURCE
16187 i186 i286 i386 i486 i586 i686 i8086 i80960 i860 I960
16188 IA64 iAPX286 ibm ibm032 ibmesa IBMR2 ibmrt ILP32 ILP64
16189 INLINE_INTRINSICS INTRINSICS INT64 interdata is68k ksr1
16190 LANGUAGE_C LARGE_FILE_API LARGEFILE64_SOURCE
16191 LARGEFILE_SOURCE LFS64_LARGEFILE LFS_LARGEFILE
16192 Linux LITTLE_ENDIAN LONG64 LONG_DOUBLE LONG_LONG
16193 LONGDOUBLE LONGLONG LP64 luna luna88k Lynx
16194 M68000 m68k m88100 m88k M88KBCS_TARGET M_COFF
16195 M_I186 M_I286 M_I386 M_I8086 M_I86 M_I86SM M_SYS3
16196 M_SYS5 M_SYSIII M_SYSV M_UNIX M_XENIX MACH machine MachTen
16197 MATH_HAS_NO_SIDE_EFFECTS
16198 mc300 mc500 mc68000 mc68010 mc68020 mc68030 mc68040
16199 mc68060 mc68k mc68k32 mc700 mc88000 mc88100 merlin
16200 mert MiNT mips MIPS_FPSET MIPS_ISA MIPS_SIM MIPS_SZINT
16201 MIPS_SZLONG MIPS_SZPTR MIPSEB MIPSEL MODERN_C motorola
16202 mpeix MSDOS MTXINU MULTIMAX mvs MVS n16 ncl_el ncl_mr
16203 NetBSD news1500 news1700 news1800 news1900 news3700
16204 news700 news800 news900 NeXT NLS nonstopux ns16000 ns32000
16205 ns32016 ns32332 ns32k nsc32000
16206 OCS88 OEMVS OpenBSD os OS2 OS390 osf OSF1 OSF_SOURCE
16207 pa_risc PA_RISC1_1 PA_RISC2_0 PARAGON parisc
16208 pc532 pdp11 PGC PIC plexus PORTAR posix
16209 POSIX1B_SOURCE POSIX2_SOURCE POSIX4_SOURCE
16210 POSIX_C_SOURCE POSIX_SOURCE POWER
16211 PROTOTYPES PWB pyr QNX R3000 REENTRANT RES Rhapsody RISC6000
16212 riscix riscos RT S390 SA110 scs SCO sequent sgi SGI_SOURCE SH3 sinix
16213 SIZE_INT SIZE_LONG SIZE_PTR SOCKET_SOURCE SOCKETS_SOURCE
16214 sony sony_news sonyrisc sparc sparclite spectrum
16215 stardent stdc STDC_EXT stratos sun sun3 sun386
16216 Sun386i svr3 svr4 SVR4_2 SVR4_SOURCE svr5
16217 SX system SYSTYPE_BSD SYSTYPE_BSD43 SYSTYPE_BSD44
16218 SYSTYPE_SVR4 SYSTYPE_SVR5 SYSTYPE_SYSV SYSV SYSV3 SYSV4 SYSV5
16219 sysV68 sysV88 Tek4132 Tek4300 titan
16220 TM3200 TM5400 TM5600
16221 tower tower32 tower32_200 tower32_600 tower32_700
16222 tower32_800 tower32_850 tss
16223 u370 u3b u3b2 u3b20 u3b200 u3b20d u3b5
16224 ultrix UMAXV UnicomPBB UnicomPBD UNICOS UNICOSMK
16225 unix UNIX95 UNIX99 unixpc unos
16226 USE_BSD USE_FILE_OFFSET64 USE_GNU USE_ISOC9X USE_LARGEFILE USE_LARGEFILE64
16227 USE_MISC USE_POSIX USE_POSIX199309 USE_POSIX199506 USE_POSIX2
16228 USE_REENTRANT USE_SVID USE_UNIX98 USE_XOPEN USE_XOPEN_EXTENDED
16230 Utek UTek UTS UWIN uxpm uxps vax venix VMESA vms xenix Xenix286
16231 XOPEN_SOURCE XOPEN_SOURCE_EXTENDED XPG2 XPG2_EXTENDED
16232 XPG3 XPG3_EXTENDED XPG4 XPG4_EXTENDED
16235 # Maybe put other stuff here too.
16236 cat <<EOSH >>Cppsym.know
16239 ./tr '[a-z]' '[A-Z]' < Cppsym.know > Cppsym.a
16240 ./tr '[A-Z]' '[a-z]' < Cppsym.know > Cppsym.b
16241 $cat Cppsym.know > Cppsym.c
16242 $cat Cppsym.a Cppsym.b Cppsym.c | $tr ' ' $trnl | $sort | $uniq > Cppsym.know
16243 $rm -f Cppsym.a Cppsym.b Cppsym.c
16244 cat <<EOSH > Cppsym
16246 if $test \$# -gt 0; then
16247 echo \$* | $tr " " "$trnl" | ./Cppsym.try > Cppsym.got
16248 if $test -s Cppsym.got; then
16255 $tr " " "$trnl" | ./Cppsym.try
16261 cat <<EOSH > Cppsym.try
16263 cat <<'EOCP' > try.c
16269 cat <<'EOSH' >> Cppsym.try
16271 printf "#ifdef %s\n#if %s+0\nprintf(\"%s=%%ld\\n\", (long)%s);\n#else\nprintf(\"%s\\n\");\n#endif\n#endif\n", $1, $1, $1, $1, $1
16272 printf "#ifdef _%s\n#if _%s+0\nprintf(\"_%s=%%ld\\n\", (long)_%s);\n#else\nprintf(\"_%s\\n\");\n#endif\n#endif\n", $1, $1, $1, $1, $1
16273 printf "#ifdef __%s\n#if __%s+0\nprintf(\"__%s=%%ld\\n\", (long)__%s);\n#else\nprintf(\"__%s\\n\");\n#endif\n#endif\n", $1, $1, $1, $1, $1
16274 printf "#ifdef __%s__\n#if __%s__+0\nprintf(\"__%s__=%%ld\\n\", (long)__%s__);\n#else\nprintf(\"__%s__\\n\");\n#endif\n#endif\n", $1, $1, $1, $1, $1
16276 echo 'return 0;}' >> try.c
16278 cat <<EOSH >> Cppsym.try
16280 case "$osname-$gccversion" in
16281 irix-) ccflags="\$ccflags -woff 1178" ;;
16282 os2-*) ccflags="\$ccflags -Zlinker /PM:VIO" ;;
16284 $cc -o try $optimize \$ccflags $ldflags try.c $libs && $run ./try
16286 chmod +x Cppsym.try
16287 $eunicefix Cppsym.try
16288 ./Cppsym < Cppsym.know > Cppsym.true
16289 : now check the C compiler for additional symbols
16290 postprocess_cc_v=''
16292 aix) postprocess_cc_v="|$tr , ' '" ;;
16299 for i in \`$cc -v -c tmp.c 2>&1 $postprocess_cc_v\`
16302 -D*) echo "\$i" | $sed 's/^-D//';;
16303 -A*) $test "$gccversion" && echo "\$i" | $sed 's/^-A\(.*\)(\(.*\))/\1=\2/';;
16308 postprocess_cc_v=''
16311 ./ccsym > ccsym1.raw
16312 if $test -s ccsym1.raw; then
16313 $sort ccsym1.raw | $uniq >ccsym.raw
16315 mv ccsym1.raw ccsym.raw
16318 $awk '/\=/ { print $0; next }
16319 { print $0"=1" }' ccsym.raw >ccsym.list
16320 $awk '/\=/ { print $0; next }
16321 { print $0"=1" }' Cppsym.true >ccsym.true
16322 $comm -13 ccsym.true ccsym.list >ccsym.own
16323 $comm -12 ccsym.true ccsym.list >ccsym.com
16324 $comm -23 ccsym.true ccsym.list >ccsym.cpp
16326 if $test -z ccsym.raw; then
16327 echo "Your C compiler doesn't seem to define any symbols!" >&4
16329 echo "However, your C preprocessor defines the following symbols:"
16332 cppsymbols=`$cat Cppsym.true`
16333 cppsymbols=`echo $cppsymbols`
16334 cppccsymbols="$cppsymbols"
16336 if $test -s ccsym.com; then
16337 echo "Your C compiler and pre-processor define these symbols:"
16338 $sed -e 's/\(..*\)=.*/\1/' ccsym.com
16341 cppccsymbols=`$cat ccsym.com`
16342 cppccsymbols=`echo $cppccsymbols`
16343 $test "$silent" || sleep 1
16345 if $test -s ccsym.cpp; then
16346 $test "$also" && echo " "
16347 echo "Your C pre-processor ${also}defines the following symbols:"
16348 $sed -e 's/\(..*\)=.*/\1/' ccsym.cpp
16350 cppsymbols=`$cat ccsym.cpp`
16351 cppsymbols=`echo $cppsymbols`
16352 $test "$silent" || sleep 1
16354 if $test -s ccsym.own; then
16355 $test "$also" && echo " "
16356 echo "Your C compiler ${also}defines the following cpp symbols:"
16357 $sed -e 's/\(..*\)=1/\1/' ccsym.own
16358 $sed -e 's/\(..*\)=.*/\1/' ccsym.own | $uniq >>Cppsym.true
16359 ccsymbols=`$cat ccsym.own`
16360 ccsymbols=`echo $ccsymbols`
16361 $test "$silent" || sleep 1
16365 : see if this is a termio system
16369 if $test `./findhdr termios.h`; then
16370 set tcsetattr i_termios
16376 "$define") echo "You have POSIX termios.h... good!" >&4;;
16377 *) if ./Cppsym pyr; then
16378 case "`/bin/universe`" in
16379 ucb) if $test `./findhdr sgtty.h`; then
16381 echo "<sgtty.h> found." >&4
16383 echo "System is pyramid with BSD universe."
16384 echo "<sgtty.h> not found--you could have problems." >&4
16386 *) if $test `./findhdr termio.h`; then
16388 echo "<termio.h> found." >&4
16390 echo "System is pyramid with USG universe."
16391 echo "<termio.h> not found--you could have problems." >&4
16395 if $test `./findhdr termio.h`; then
16396 echo "<termio.h> found." >&4
16398 elif $test `./findhdr sgtty.h`; then
16399 echo "<sgtty.h> found." >&4
16402 echo "Neither <termio.h> nor <sgtty.h> found--you could have problems." >&4
16405 if $test `./findhdr sgtty.h`; then
16406 echo "<sgtty.h> found." >&4
16408 elif $test `./findhdr termio.h`; then
16409 echo "<termio.h> found." >&4
16412 echo "Neither <sgtty.h> nor <termio.h> found--you could have problems." >&4
16416 set i_termio; eval $setvar
16417 val=$val2; set i_sgtty; eval $setvar
16418 val=$val3; set i_termios; eval $setvar
16420 : see if this is a shadow.h system
16421 set shadow.h i_shadow
16424 : see if stddef is available
16425 set stddef.h i_stddef
16428 : see if this is a sunmath.h system
16429 set sunmath.h i_sunmath
16432 : see if sys/access.h is available
16433 set sys/access.h i_sysaccess
16436 : see if ioctl defs are in sgtty, termio, sys/filio or sys/ioctl
16437 set sys/filio.h i_sysfilio
16440 if $test `./findhdr sys/ioctl.h`; then
16442 echo '<sys/ioctl.h> found.' >&4
16445 if $test $i_sysfilio = "$define"; then
16446 echo '<sys/ioctl.h> NOT found.' >&4
16448 $test $i_sgtty = "$define" && xxx="sgtty.h"
16449 $test $i_termio = "$define" && xxx="termio.h"
16450 $test $i_termios = "$define" && xxx="termios.h"
16451 echo "No <sys/ioctl.h> found, assuming ioctl args are defined in <$xxx>." >&4
16457 : see if socket ioctl defs are in sys/sockio.h
16459 xxx=`./findhdr sys/sockio.h`
16460 if $test "$xxx"; then
16461 if $contains SIOCATMARK $xxx >/dev/null 2>&1; then
16463 echo "You have socket ioctls defined in <sys/sockio.h>." >&4
16466 echo "No socket ioctls found in <sys/sockio.h>." >&4
16471 <sys/sockio.h> not found, assuming socket ioctls are in <sys/ioctl.h>.
16478 : see if this is a syslog.h system
16479 set syslog.h i_syslog
16483 : see if this is a sys/mode.h system
16484 set sys/mode.h i_sysmode
16487 : see if sys/resource.h has to be included
16488 set sys/resource.h i_sysresrc
16491 : see if sys/security.h is available
16492 set sys/security.h i_syssecrt
16495 : see if this is a sys/statvfs.h system
16496 set sys/statvfs.h i_sysstatvfs
16499 : see if this is a sys/un.h system
16500 set sys/un.h i_sysun
16504 : see if this is a sys/utsname.h system
16505 set sys/utsname.h i_sysutsname
16508 : see if this is a syswait system
16509 set sys/wait.h i_syswait
16512 : see if this is a ustat.h system
16513 set ustat.h i_ustat
16516 : see if this is an utime system
16517 set utime.h i_utime
16520 : see if this is a values.h system
16521 set values.h i_values
16524 : see if this is a vfork system
16527 set vfork.h i_vfork
16535 : see if gdbm.h is available
16540 : see if gdbm_open exists
16541 set gdbm_open d_gdbm_open
16543 case "$d_gdbm_open" in
16546 echo "We won't be including <gdbm.h>"
16556 echo "Looking for extensions..." >&4
16557 : If we are using the old config.sh, known_extensions may contain
16558 : old or inaccurate or duplicate values.
16559 known_extensions=''
16560 nonxs_extensions=''
16561 : We do not use find because it might not be available.
16562 : We do not just use MANIFEST because the user may have dropped
16563 : some additional extensions into the source tree and expect them
16566 : Function to recursively find available extensions, ignoring DynaLoader
16567 : NOTE: recursion limit of 10 to prevent runaway in case of symlink madness
16571 DynaLoader|dynaload) ;;
16573 if $test -f $xxx/$xxx.xs; then
16574 known_extensions="$known_extensions $1$xxx";
16575 elif $test -f $xxx/Makefile.PL; then
16576 nonxs_extensions="$nonxs_extensions $1$xxx";
16578 if $test -d $xxx -a $# -lt 10; then
16581 eval $find_extensions;
16593 eval $find_extensions
16594 # Special case: Add in threads/shared since it is not picked up by the
16595 # recursive find above (and adding in general recursive finding breaks
16596 # SDBM_File/sdbm). A.D. 10/25/2001.
16597 known_extensions="$known_extensions threads/shared"
16598 set X $nonxs_extensions
16600 nonxs_extensions="$*"
16601 set X $known_extensions
16603 known_extensions="$*"
16606 : Now see which are supported on this system.
16608 for xxx in $known_extensions ; do
16612 $define) avail_ext="$avail_ext $xxx" ;;
16615 GDBM_File|gdbm_fil)
16617 $define) avail_ext="$avail_ext $xxx" ;;
16620 I18N/Langinfo|i18n_lan)
16621 case "$i_langinfo$d_nl_langinfo" in
16622 $define$define) avail_ext="$avail_ext $xxx" ;;
16625 NDBM_File|ndbm_fil)
16628 case "$osname-$use64bitint" in
16629 cygwin-*|hpux-define)
16631 *-lndbm*) avail_ext="$avail_ext $xxx" ;;
16634 *) avail_ext="$avail_ext $xxx" ;;
16639 ODBM_File|odbm_fil)
16640 case "${i_dbm}${i_rpcsvcdbm}" in
16642 case "$osname-$use64bitint" in
16643 cygwin-*|hpux-define)
16645 *-ldbm*) avail_ext="$avail_ext $xxx" ;;
16648 *) avail_ext="$avail_ext $xxx" ;;
16654 case "$useposix" in
16655 true|define|y) avail_ext="$avail_ext $xxx" ;;
16659 case "$useopcode" in
16660 true|define|y) avail_ext="$avail_ext $xxx" ;;
16664 case "$d_socket" in
16667 beos) ;; # not unless BONE
16668 *) avail_ext="$avail_ext $xxx" ;;
16673 Sys/Syslog|sys/syslog)
16674 : XXX syslog requires socket
16675 case "$d_socket" in
16676 true|$define|y) avail_ext="$avail_ext $xxx" ;;
16680 case "$usethreads" in
16682 case "$useithreads" in
16683 $undef|false|[nN]*) avail_ext="$avail_ext $xxx" ;;
16687 threads|threads/shared)
16688 case "$usethreads" in
16690 case "$useithreads" in
16691 $define|true|[yY]*) avail_ext="$avail_ext $xxx" ;;
16696 : XXX Do we need a useipcsysv variable here
16697 case "${d_msg}${d_sem}${d_shm}" in
16698 *"${define}"*) avail_ext="$avail_ext $xxx" ;;
16701 *) avail_ext="$avail_ext $xxx"
16710 : Now see which nonxs extensions are supported on this system.
16711 : For now assume all are.
16713 for xxx in $nonxs_extensions ; do
16715 *) nonxs_ext="$nonxs_ext $xxx"
16727 A number of extensions are supplied with $package. You may choose to
16728 compile these extensions for dynamic loading (the default), compile
16729 them into the $package executable (static loading), or not include
16730 them at all. Answer "none" to include no extensions.
16731 Note that DynaLoader is always built and need not be mentioned here.
16734 case "$dynamic_ext" in
16735 '') dflt="$avail_ext" ;;
16736 *) dflt="$dynamic_ext"
16737 # Perhaps we are reusing an old out-of-date config.sh.
16740 if test X"$dynamic_ext" != X"$avail_ext"; then
16742 NOTICE: Your previous config.sh list may be incorrect.
16743 The extensions now available to you are
16745 but the default list from your previous config.sh is
16757 rp="What extensions do you wish to load dynamically?"
16760 none) dynamic_ext=' ' ;;
16761 *) dynamic_ext="$ans" ;;
16764 case "$static_ext" in
16766 : Exclude those already listed in dynamic linking
16768 for xxx in $avail_ext; do
16769 case " $dynamic_ext " in
16771 *) dflt="$dflt $xxx" ;;
16778 *) dflt="$static_ext"
16785 rp="What extensions do you wish to load statically?"
16788 none) static_ext=' ' ;;
16789 *) static_ext="$ans" ;;
16794 A number of extensions are supplied with $package. Answer "none"
16795 to include no extensions.
16796 Note that DynaLoader is always built and need not be mentioned here.
16799 case "$static_ext" in
16800 '') dflt="$avail_ext" ;;
16801 *) dflt="$static_ext"
16802 # Perhaps we are reusing an old out-of-date config.sh.
16805 if test X"$static_ext" != X"$avail_ext"; then
16807 NOTICE: Your previous config.sh list may be incorrect.
16808 The extensions now available to you are
16810 but the default list from your previous config.sh is
16819 : Exclude those that are not xs extensions
16823 rp="What extensions do you wish to include?"
16826 none) static_ext=' ' ;;
16827 *) static_ext="$ans" ;;
16832 set X $dynamic_ext $static_ext $nonxs_ext
16836 : Remove libraries needed only for extensions
16837 : The appropriate ext/Foo/Makefile.PL will add them back in, if necessary.
16838 : The exception is SunOS 4.x, which needs them.
16839 case "${osname}X${osvers}" in
16843 *) case "$usedl" in
16844 $define|true|[yY]*)
16845 set X `echo " $libs " | sed -e 's@ -lndbm @ @' -e 's@ -lgdbm @ @' -e 's@ -ldbm @ @' -e 's@ -ldb @ @'`
16849 *) perllibs="$libs"
16855 : Remove build directory name from cppstdin so it can be used from
16856 : either the present location or the final installed location.
16858 : Get out of the UU directory to get correct path name.
16860 case "$cppstdin" in
16862 echo "Stripping down cppstdin path name"
16868 : end of configuration questions
16870 echo "End of configuration questions."
16873 : back to where it started
16874 if test -d ../UU; then
16878 : configuration may be patched via a 'config.arch' file
16879 if $test -f config.arch; then
16880 echo "I see a config.arch file, loading it."
16884 : configuration may be patched via a 'config.over' file
16885 if $test -f config.over; then
16888 rp='I see a config.over file. Do you wish to load it?'
16891 n*) echo "OK, I'll ignore it.";;
16893 echo "Configuration override changes have been loaded."
16898 : in case they want portability, strip down executable paths
16899 case "$d_portable" in
16902 echo "Stripping down executable paths..." >&4
16903 for file in $loclist $trylist; do
16905 eval $file=`basename $temp`
16910 : create config.sh file
16912 echo "Creating config.sh..." >&4
16913 $spitshell <<EOT >config.sh
16916 # This file was produced by running the Configure script. It holds all the
16917 # definitions figured out by Configure. Should you modify one of these values,
16918 # do not forget to propagate your changes by running "Configure -der". You may
16919 # instead choose to run each of the .SH files by yourself, or "Configure -S".
16922 # Package name : $package
16923 # Source directory : $src
16924 # Configuration time: $cf_time
16925 # Configured by : $cf_by
16926 # Target system : $myuname
16936 Revision='$Revision'
16944 alignbytes='$alignbytes'
16945 ansi2knr='$ansi2knr'
16946 aphostname='$aphostname'
16947 api_revision='$api_revision'
16948 api_subversion='$api_subversion'
16949 api_version='$api_version'
16950 api_versionstring='$api_versionstring'
16953 archlibexp='$archlibexp'
16954 archname64='$archname64'
16955 archname='$archname'
16956 archobjs='$archobjs'
16961 bincompat5005='$bincompat5005'
16965 byteorder='$byteorder'
16967 castflags='$castflags'
16970 cccdlflags='$cccdlflags'
16971 ccdlflags='$ccdlflags'
16973 ccflags_uselargefiles='$ccflags_uselargefiles'
16975 ccsymbols='$ccsymbols'
16976 ccversion='$ccversion'
16978 cf_email='$cf_email'
16980 charsize='$charsize'
16984 clocktype='$clocktype'
16986 compress='$compress'
16987 contains='$contains'
16991 cpp_stuff='$cpp_stuff'
16992 cppccsymbols='$cppccsymbols'
16993 cppflags='$cppflags'
16995 cppminus='$cppminus'
16997 cppstdin='$cppstdin'
16998 cppsymbols='$cppsymbols'
16999 cryptlib='$cryptlib'
17001 d_Gconvert='$d_Gconvert'
17002 d_PRIEUldbl='$d_PRIEUldbl'
17003 d_PRIFUldbl='$d_PRIFUldbl'
17004 d_PRIGUldbl='$d_PRIGUldbl'
17005 d_PRIXU64='$d_PRIXU64'
17006 d_PRId64='$d_PRId64'
17007 d_PRIeldbl='$d_PRIeldbl'
17008 d_PRIfldbl='$d_PRIfldbl'
17009 d_PRIgldbl='$d_PRIgldbl'
17010 d_PRIi64='$d_PRIi64'
17011 d_PRIo64='$d_PRIo64'
17012 d_PRIu64='$d_PRIu64'
17013 d_PRIx64='$d_PRIx64'
17014 d_SCNfldbl='$d_SCNfldbl'
17015 d__fwalk='$d__fwalk'
17016 d_access='$d_access'
17017 d_accessx='$d_accessx'
17019 d_archlib='$d_archlib'
17022 d_attribut='$d_attribut'
17025 d_bincompat5005='$d_bincompat5005'
17027 d_bsdgetpgrp='$d_bsdgetpgrp'
17028 d_bsdsetpgrp='$d_bsdsetpgrp'
17030 d_casti32='$d_casti32'
17031 d_castneg='$d_castneg'
17032 d_charvspr='$d_charvspr'
17034 d_chroot='$d_chroot'
17035 d_chsize='$d_chsize'
17037 d_closedir='$d_closedir'
17038 d_cmsghdr_s='$d_cmsghdr_s'
17042 d_cuserid='$d_cuserid'
17043 d_dbl_dig='$d_dbl_dig'
17044 d_dbminitproto='$d_dbminitproto'
17045 d_difftime='$d_difftime'
17047 d_dirnamlen='$d_dirnamlen'
17048 d_dlerror='$d_dlerror'
17049 d_dlopen='$d_dlopen'
17050 d_dlsymun='$d_dlsymun'
17051 d_dosuid='$d_dosuid'
17052 d_drand48proto='$d_drand48proto'
17054 d_eaccess='$d_eaccess'
17055 d_endgrent='$d_endgrent'
17056 d_endhent='$d_endhent'
17057 d_endnent='$d_endnent'
17058 d_endpent='$d_endpent'
17059 d_endpwent='$d_endpwent'
17060 d_endsent='$d_endsent'
17061 d_eofnblk='$d_eofnblk'
17062 d_eunice='$d_eunice'
17063 d_fchdir='$d_fchdir'
17064 d_fchmod='$d_fchmod'
17065 d_fchown='$d_fchown'
17067 d_fcntl_can_lock='$d_fcntl_can_lock'
17068 d_fd_macros='$d_fd_macros'
17069 d_fd_set='$d_fd_set'
17070 d_fds_bits='$d_fds_bits'
17071 d_fgetpos='$d_fgetpos'
17072 d_finite='$d_finite'
17073 d_finitel='$d_finitel'
17074 d_flexfnam='$d_flexfnam'
17076 d_flockproto='$d_flockproto'
17078 d_fp_class='$d_fp_class'
17079 d_fpathconf='$d_fpathconf'
17080 d_fpclass='$d_fpclass'
17081 d_fpclassify='$d_fpclassify'
17082 d_fpclassl='$d_fpclassl'
17083 d_fpos64_t='$d_fpos64_t'
17084 d_frexpl='$d_frexpl'
17085 d_fs_data_s='$d_fs_data_s'
17086 d_fseeko='$d_fseeko'
17087 d_fsetpos='$d_fsetpos'
17088 d_fstatfs='$d_fstatfs'
17089 d_fstatvfs='$d_fstatvfs'
17091 d_ftello='$d_ftello'
17093 d_getcwd='$d_getcwd'
17094 d_getespwnam='$d_getespwnam'
17095 d_getfsstat='$d_getfsstat'
17096 d_getgrent='$d_getgrent'
17097 d_getgrps='$d_getgrps'
17098 d_gethbyaddr='$d_gethbyaddr'
17099 d_gethbyname='$d_gethbyname'
17100 d_gethent='$d_gethent'
17101 d_gethname='$d_gethname'
17102 d_gethostprotos='$d_gethostprotos'
17103 d_getitimer='$d_getitimer'
17104 d_getlogin='$d_getlogin'
17105 d_getmnt='$d_getmnt'
17106 d_getmntent='$d_getmntent'
17107 d_getnbyaddr='$d_getnbyaddr'
17108 d_getnbyname='$d_getnbyname'
17109 d_getnent='$d_getnent'
17110 d_getnetprotos='$d_getnetprotos'
17111 d_getpagsz='$d_getpagsz'
17112 d_getpbyname='$d_getpbyname'
17113 d_getpbynumber='$d_getpbynumber'
17114 d_getpent='$d_getpent'
17115 d_getpgid='$d_getpgid'
17116 d_getpgrp2='$d_getpgrp2'
17117 d_getpgrp='$d_getpgrp'
17118 d_getppid='$d_getppid'
17119 d_getprior='$d_getprior'
17120 d_getprotoprotos='$d_getprotoprotos'
17121 d_getprpwnam='$d_getprpwnam'
17122 d_getpwent='$d_getpwent'
17123 d_getsbyname='$d_getsbyname'
17124 d_getsbyport='$d_getsbyport'
17125 d_getsent='$d_getsent'
17126 d_getservprotos='$d_getservprotos'
17127 d_getspnam='$d_getspnam'
17128 d_gettimeod='$d_gettimeod'
17129 d_gnulibc='$d_gnulibc'
17130 d_grpasswd='$d_grpasswd'
17131 d_hasmntopt='$d_hasmntopt'
17134 d_inetaton='$d_inetaton'
17135 d_int64_t='$d_int64_t'
17136 d_isascii='$d_isascii'
17137 d_isfinite='$d_isfinite'
17140 d_isnanl='$d_isnanl'
17141 d_killpg='$d_killpg'
17142 d_lchown='$d_lchown'
17143 d_ldbl_dig='$d_ldbl_dig'
17145 d_locconv='$d_locconv'
17147 d_longdbl='$d_longdbl'
17148 d_longlong='$d_longlong'
17149 d_lseekproto='$d_lseekproto'
17151 d_madvise='$d_madvise'
17153 d_mbstowcs='$d_mbstowcs'
17154 d_mbtowc='$d_mbtowc'
17155 d_memchr='$d_memchr'
17156 d_memcmp='$d_memcmp'
17157 d_memcpy='$d_memcpy'
17158 d_memmove='$d_memmove'
17159 d_memset='$d_memset'
17161 d_mkdtemp='$d_mkdtemp'
17162 d_mkfifo='$d_mkfifo'
17163 d_mkstemp='$d_mkstemp'
17164 d_mkstemps='$d_mkstemps'
17165 d_mktime='$d_mktime'
17168 d_modfl_pow32_bug='$d_modfl_pow32_bug'
17169 d_mprotect='$d_mprotect'
17171 d_msg_ctrunc='$d_msg_ctrunc'
17172 d_msg_dontroute='$d_msg_dontroute'
17173 d_msg_oob='$d_msg_oob'
17174 d_msg_peek='$d_msg_peek'
17175 d_msg_proxy='$d_msg_proxy'
17176 d_msgctl='$d_msgctl'
17177 d_msgget='$d_msgget'
17178 d_msghdr_s='$d_msghdr_s'
17179 d_msgrcv='$d_msgrcv'
17180 d_msgsnd='$d_msgsnd'
17182 d_munmap='$d_munmap'
17183 d_mymalloc='$d_mymalloc'
17185 d_nl_langinfo='$d_nl_langinfo'
17186 d_nv_preserves_uv='$d_nv_preserves_uv'
17187 d_nv_preserves_uv_bits='$d_nv_preserves_uv_bits'
17188 d_off64_t='$d_off64_t'
17189 d_old_pthread_create_joinable='$d_old_pthread_create_joinable'
17190 d_oldpthreads='$d_oldpthreads'
17191 d_oldsock='$d_oldsock'
17193 d_pathconf='$d_pathconf'
17195 d_perl_otherlibdirs='$d_perl_otherlibdirs'
17196 d_phostname='$d_phostname'
17199 d_portable='$d_portable'
17200 d_procselfexe='$d_procselfexe'
17201 d_pthread_atfork='$d_pthread_atfork'
17202 d_pthread_yield='$d_pthread_yield'
17204 d_pwchange='$d_pwchange'
17205 d_pwclass='$d_pwclass'
17206 d_pwcomment='$d_pwcomment'
17207 d_pwexpire='$d_pwexpire'
17208 d_pwgecos='$d_pwgecos'
17209 d_pwpasswd='$d_pwpasswd'
17210 d_pwquota='$d_pwquota'
17213 d_readdir='$d_readdir'
17214 d_readlink='$d_readlink'
17216 d_recvmsg='$d_recvmsg'
17217 d_rename='$d_rename'
17218 d_rewinddir='$d_rewinddir'
17220 d_safebcpy='$d_safebcpy'
17221 d_safemcpy='$d_safemcpy'
17222 d_sanemcmp='$d_sanemcmp'
17223 d_sbrkproto='$d_sbrkproto'
17224 d_sched_yield='$d_sched_yield'
17225 d_scm_rights='$d_scm_rights'
17226 d_seekdir='$d_seekdir'
17227 d_select='$d_select'
17229 d_semctl='$d_semctl'
17230 d_semctl_semid_ds='$d_semctl_semid_ds'
17231 d_semctl_semun='$d_semctl_semun'
17232 d_semget='$d_semget'
17234 d_sendmsg='$d_sendmsg'
17235 d_setegid='$d_setegid'
17236 d_seteuid='$d_seteuid'
17237 d_setgrent='$d_setgrent'
17238 d_setgrps='$d_setgrps'
17239 d_sethent='$d_sethent'
17240 d_setitimer='$d_setitimer'
17241 d_setlinebuf='$d_setlinebuf'
17242 d_setlocale='$d_setlocale'
17243 d_setnent='$d_setnent'
17244 d_setpent='$d_setpent'
17245 d_setpgid='$d_setpgid'
17246 d_setpgrp2='$d_setpgrp2'
17247 d_setpgrp='$d_setpgrp'
17248 d_setprior='$d_setprior'
17249 d_setproctitle='$d_setproctitle'
17250 d_setpwent='$d_setpwent'
17251 d_setregid='$d_setregid'
17252 d_setresgid='$d_setresgid'
17253 d_setresuid='$d_setresuid'
17254 d_setreuid='$d_setreuid'
17255 d_setrgid='$d_setrgid'
17256 d_setruid='$d_setruid'
17257 d_setsent='$d_setsent'
17258 d_setsid='$d_setsid'
17259 d_setvbuf='$d_setvbuf'
17263 d_shmatprototype='$d_shmatprototype'
17264 d_shmctl='$d_shmctl'
17266 d_shmget='$d_shmget'
17267 d_sigaction='$d_sigaction'
17268 d_sigprocmask='$d_sigprocmask'
17269 d_sigsetjmp='$d_sigsetjmp'
17270 d_sockatmark='$d_sockatmark'
17271 d_sockatmarkproto='$d_sockatmarkproto'
17272 d_socket='$d_socket'
17273 d_socklen_t='$d_socklen_t'
17274 d_sockpair='$d_sockpair'
17275 d_socks5_init='$d_socks5_init'
17277 d_sresgproto='$d_sresgproto'
17278 d_sresuproto='$d_sresuproto'
17279 d_statblks='$d_statblks'
17280 d_statfs_f_flags='$d_statfs_f_flags'
17281 d_statfs_s='$d_statfs_s'
17282 d_statvfs='$d_statvfs'
17283 d_stdio_cnt_lval='$d_stdio_cnt_lval'
17284 d_stdio_ptr_lval='$d_stdio_ptr_lval'
17285 d_stdio_ptr_lval_nochange_cnt='$d_stdio_ptr_lval_nochange_cnt'
17286 d_stdio_ptr_lval_sets_cnt='$d_stdio_ptr_lval_sets_cnt'
17287 d_stdio_stream_array='$d_stdio_stream_array'
17288 d_stdiobase='$d_stdiobase'
17289 d_stdstdio='$d_stdstdio'
17290 d_strchr='$d_strchr'
17291 d_strcoll='$d_strcoll'
17292 d_strctcpy='$d_strctcpy'
17293 d_strerrm='$d_strerrm'
17294 d_strerror='$d_strerror'
17295 d_strftime='$d_strftime'
17296 d_strtod='$d_strtod'
17297 d_strtol='$d_strtol'
17298 d_strtold='$d_strtold'
17299 d_strtoll='$d_strtoll'
17300 d_strtoq='$d_strtoq'
17301 d_strtoul='$d_strtoul'
17302 d_strtoull='$d_strtoull'
17303 d_strtouq='$d_strtouq'
17304 d_strxfrm='$d_strxfrm'
17305 d_suidsafe='$d_suidsafe'
17306 d_symlink='$d_symlink'
17307 d_syscall='$d_syscall'
17308 d_syscallproto='$d_syscallproto'
17309 d_sysconf='$d_sysconf'
17310 d_sysernlst='$d_sysernlst'
17311 d_syserrlst='$d_syserrlst'
17312 d_system='$d_system'
17313 d_tcgetpgrp='$d_tcgetpgrp'
17314 d_tcsetpgrp='$d_tcsetpgrp'
17315 d_telldir='$d_telldir'
17316 d_telldirproto='$d_telldirproto'
17319 d_truncate='$d_truncate'
17320 d_tzname='$d_tzname'
17321 d_u32align='$d_u32align'
17322 d_ualarm='$d_ualarm'
17325 d_union_semun='$d_union_semun'
17326 d_unordered='$d_unordered'
17327 d_usleep='$d_usleep'
17328 d_usleepproto='$d_usleepproto'
17330 d_vendorarch='$d_vendorarch'
17331 d_vendorbin='$d_vendorbin'
17332 d_vendorlib='$d_vendorlib'
17334 d_void_closedir='$d_void_closedir'
17335 d_voidsig='$d_voidsig'
17336 d_voidtty='$d_voidtty'
17337 d_volatile='$d_volatile'
17338 d_vprintf='$d_vprintf'
17340 d_waitpid='$d_waitpid'
17341 d_wcstombs='$d_wcstombs'
17342 d_wctomb='$d_wctomb'
17343 d_writev='$d_writev'
17346 db_hashtype='$db_hashtype'
17347 db_prefixtype='$db_prefixtype'
17348 db_version_major='$db_version_major'
17349 db_version_minor='$db_version_minor'
17350 db_version_patch='$db_version_patch'
17351 defvoidused='$defvoidused'
17352 direntrytype='$direntrytype'
17355 doublesize='$doublesize'
17357 dynamic_ext='$dynamic_ext'
17363 eunicefix='$eunicefix'
17366 extensions='$extensions'
17368 fflushNULL='$fflushNULL'
17369 fflushall='$fflushall'
17371 firstmakefile='$firstmakefile'
17373 fpossize='$fpossize'
17374 fpostype='$fpostype'
17375 freetype='$freetype'
17378 full_csh='$full_csh'
17379 full_sed='$full_sed'
17380 gccosandvers='$gccosandvers'
17381 gccversion='$gccversion'
17382 gidformat='$gidformat'
17389 groupcat='$groupcat'
17390 groupstype='$groupstype'
17393 h_sysfile='$h_sysfile'
17404 i_arpainet='$i_arpainet'
17405 i_bsdioctl='$i_bsdioctl'
17408 i_dirent='$i_dirent'
17414 i_fp_class='$i_fp_class'
17417 i_ieeefp='$i_ieeefp'
17418 i_inttypes='$i_inttypes'
17419 i_langinfo='$i_langinfo'
17420 i_libutil='$i_libutil'
17421 i_limits='$i_limits'
17422 i_locale='$i_locale'
17423 i_machcthr='$i_machcthr'
17424 i_malloc='$i_malloc'
17426 i_memory='$i_memory'
17427 i_mntent='$i_mntent'
17430 i_neterrno='$i_neterrno'
17431 i_netinettcp='$i_netinettcp'
17435 i_pthread='$i_pthread'
17437 i_rpcsvcdbm='$i_rpcsvcdbm'
17440 i_shadow='$i_shadow'
17442 i_stdarg='$i_stdarg'
17443 i_stddef='$i_stddef'
17444 i_stdlib='$i_stdlib'
17445 i_string='$i_string'
17446 i_sunmath='$i_sunmath'
17447 i_sysaccess='$i_sysaccess'
17448 i_sysdir='$i_sysdir'
17449 i_sysfile='$i_sysfile'
17450 i_sysfilio='$i_sysfilio'
17452 i_sysioctl='$i_sysioctl'
17453 i_syslog='$i_syslog'
17454 i_sysmman='$i_sysmman'
17455 i_sysmode='$i_sysmode'
17456 i_sysmount='$i_sysmount'
17457 i_sysndir='$i_sysndir'
17458 i_sysparam='$i_sysparam'
17459 i_sysresrc='$i_sysresrc'
17460 i_syssecrt='$i_syssecrt'
17461 i_sysselct='$i_sysselct'
17462 i_syssockio='$i_syssockio'
17463 i_sysstat='$i_sysstat'
17464 i_sysstatfs='$i_sysstatfs'
17465 i_sysstatvfs='$i_sysstatvfs'
17466 i_systime='$i_systime'
17467 i_systimek='$i_systimek'
17468 i_systimes='$i_systimes'
17469 i_systypes='$i_systypes'
17470 i_sysuio='$i_sysuio'
17472 i_sysutsname='$i_sysutsname'
17473 i_sysvfs='$i_sysvfs'
17474 i_syswait='$i_syswait'
17475 i_termio='$i_termio'
17476 i_termios='$i_termios'
17478 i_unistd='$i_unistd'
17481 i_values='$i_values'
17482 i_varargs='$i_varargs'
17483 i_varhdr='$i_varhdr'
17485 ignore_versioned_solibs='$ignore_versioned_solibs'
17486 inc_version_list='$inc_version_list'
17487 inc_version_list_init='$inc_version_list_init'
17490 installarchlib='$installarchlib'
17491 installbin='$installbin'
17492 installman1dir='$installman1dir'
17493 installman3dir='$installman3dir'
17494 installprefix='$installprefix'
17495 installprefixexp='$installprefixexp'
17496 installprivlib='$installprivlib'
17497 installscript='$installscript'
17498 installsitearch='$installsitearch'
17499 installsitebin='$installsitebin'
17500 installsitelib='$installsitelib'
17501 installstyle='$installstyle'
17502 installusrbinperl='$installusrbinperl'
17503 installvendorarch='$installvendorarch'
17504 installvendorbin='$installvendorbin'
17505 installvendorlib='$installvendorlib'
17507 issymlink='$issymlink'
17508 ivdformat='$ivdformat'
17511 known_extensions='$known_extensions'
17514 lddlflags='$lddlflags'
17516 ldflags_uselargefiles='$ldflags_uselargefiles'
17517 ldlibpthname='$ldlibpthname'
17524 libsdirs='$libsdirs'
17525 libsfiles='$libsfiles'
17526 libsfound='$libsfound'
17527 libspath='$libspath'
17528 libswanted='$libswanted'
17529 libswanted_uselargefiles='$libswanted_uselargefiles'
17535 locincpth='$locincpth'
17536 loclibpth='$loclibpth'
17537 longdblsize='$longdblsize'
17538 longlongsize='$longlongsize'
17539 longsize='$longsize'
17543 lseeksize='$lseeksize'
17544 lseektype='$lseektype'
17548 make_set_make='$make_set_make'
17549 mallocobj='$mallocobj'
17550 mallocsrc='$mallocsrc'
17551 malloctype='$malloctype'
17553 man1direxp='$man1direxp'
17556 man3direxp='$man3direxp'
17558 mips_type='$mips_type'
17560 mmaptype='$mmaptype'
17561 modetype='$modetype'
17563 multiarch='$multiarch'
17565 myarchname='$myarchname'
17566 mydomain='$mydomain'
17567 myhostname='$myhostname'
17570 need_va_copy='$need_va_copy'
17571 netdb_hlen_type='$netdb_hlen_type'
17572 netdb_host_type='$netdb_host_type'
17573 netdb_name_type='$netdb_name_type'
17574 netdb_net_type='$netdb_net_type'
17577 nm_so_opt='$nm_so_opt'
17578 nonxs_ext='$nonxs_ext'
17580 nvEUformat='$nvEUformat'
17581 nvFUformat='$nvFUformat'
17582 nvGUformat='$nvGUformat'
17583 nveformat='$nveformat'
17584 nvfformat='$nvfformat'
17585 nvgformat='$nvgformat'
17588 o_nonblock='$o_nonblock'
17590 old_pthread_create_joinable='$old_pthread_create_joinable'
17591 optimize='$optimize'
17592 orderlib='$orderlib'
17595 otherlibdirs='$otherlibdirs'
17599 patchlevel='$patchlevel'
17600 path_sep='$path_sep'
17603 perl_patchlevel='$perl_patchlevel'
17604 perladmin='$perladmin'
17605 perllibs='$perllibs'
17606 perlpath='$perlpath'
17608 phostname='$phostname'
17611 pm_apiversion='$pm_apiversion'
17615 prefixexp='$prefixexp'
17617 privlibexp='$privlibexp'
17618 procselfexe='$procselfexe'
17619 prototype='$prototype'
17621 quadkind='$quadkind'
17622 quadtype='$quadtype'
17623 randbits='$randbits'
17624 randfunc='$randfunc'
17625 randseedtype='$randseedtype'
17627 rd_nodata='$rd_nodata'
17628 revision='$revision'
17633 sPRIEUldbl='$sPRIEUldbl'
17634 sPRIFUldbl='$sPRIFUldbl'
17635 sPRIGUldbl='$sPRIGUldbl'
17636 sPRIXU64='$sPRIXU64'
17638 sPRIeldbl='$sPRIeldbl'
17639 sPRIfldbl='$sPRIfldbl'
17640 sPRIgldbl='$sPRIgldbl'
17645 sSCNfldbl='$sSCNfldbl'
17646 sched_yield='$sched_yield'
17647 scriptdir='$scriptdir'
17648 scriptdirexp='$scriptdirexp'
17650 seedfunc='$seedfunc'
17651 selectminbits='$selectminbits'
17652 selecttype='$selecttype'
17653 sendmail='$sendmail'
17656 sharpbang='$sharpbang'
17657 shmattype='$shmattype'
17658 shortsize='$shortsize'
17661 sig_count='$sig_count'
17662 sig_name='$sig_name'
17663 sig_name_init='$sig_name_init'
17665 sig_num_init='$sig_num_init'
17666 sig_size='$sig_size'
17667 signal_t='$signal_t'
17668 sitearch='$sitearch'
17669 sitearchexp='$sitearchexp'
17671 sitebinexp='$sitebinexp'
17673 sitelib_stem='$sitelib_stem'
17674 sitelibexp='$sitelibexp'
17675 siteprefix='$siteprefix'
17676 siteprefixexp='$siteprefixexp'
17677 sizesize='$sizesize'
17678 sizetype='$sizetype'
17682 sockethdr='$sockethdr'
17683 socketlib='$socketlib'
17684 socksizetype='$socksizetype'
17686 spackage='$spackage'
17687 spitshell='$spitshell'
17689 ssizetype='$ssizetype'
17690 startperl='$startperl'
17692 static_ext='$static_ext'
17694 stdio_base='$stdio_base'
17695 stdio_bufsiz='$stdio_bufsiz'
17696 stdio_cnt='$stdio_cnt'
17697 stdio_filbuf='$stdio_filbuf'
17698 stdio_ptr='$stdio_ptr'
17699 stdio_stream_array='$stdio_stream_array'
17702 subversion='$subversion'
17706 targetarch='$targetarch'
17710 timeincl='$timeincl'
17711 timetype='$timetype'
17725 uidformat='$uidformat'
17731 uquadtype='$uquadtype'
17732 use5005threads='$use5005threads'
17733 use64bitall='$use64bitall'
17734 use64bitint='$use64bitint'
17735 usecrosscompile='$usecrosscompile'
17737 useithreads='$useithreads'
17738 uselargefiles='$uselargefiles'
17739 uselongdouble='$uselongdouble'
17740 usemorebits='$usemorebits'
17741 usemultiplicity='$usemultiplicity'
17742 usemymalloc='$usemymalloc'
17744 useopcode='$useopcode'
17745 useperlio='$useperlio'
17746 useposix='$useposix'
17747 usereentrant='$usereentrant'
17749 useshrplib='$useshrplib'
17750 usesocks='$usesocks'
17751 usethreads='$usethreads'
17752 usevendorprefix='$usevendorprefix'
17753 usevfork='$usevfork'
17756 uvXUformat='$uvXUformat'
17757 uvoformat='$uvoformat'
17760 uvuformat='$uvuformat'
17761 uvxformat='$uvxformat'
17762 vendorarch='$vendorarch'
17763 vendorarchexp='$vendorarchexp'
17764 vendorbin='$vendorbin'
17765 vendorbinexp='$vendorbinexp'
17766 vendorlib='$vendorlib'
17767 vendorlib_stem='$vendorlib_stem'
17768 vendorlibexp='$vendorlibexp'
17769 vendorprefix='$vendorprefix'
17770 vendorprefixexp='$vendorprefixexp'
17772 version_patchlevel_string='$version_patchlevel_string'
17773 versiononly='$versiononly'
17775 voidflags='$voidflags'
17777 xs_apiversion='$xs_apiversion'
17779 yaccflags='$yaccflags'
17784 : Add in command line options if available
17785 $test -f UU/cmdline.opt && $cat UU/cmdline.opt >> config.sh
17787 : add special variables
17788 $test -f $src/patchlevel.h && \
17789 awk '/^#define[ ]+PERL_/ {printf "%s=%s\n",$2,$3}' $src/patchlevel.h >>config.sh
17790 echo "PERL_PATCHLEVEL=$perl_patchlevel" >>config.sh
17791 echo "PERL_CONFIG_SH=true" >>config.sh
17793 : propagate old symbols
17794 if $test -f UU/config.sh; then
17795 <UU/config.sh $sort | $uniq >UU/oldconfig.sh
17796 sed -n 's/^\([a-zA-Z_0-9]*\)=.*/\1/p' config.sh config.sh UU/oldconfig.sh |\
17797 $sort | $uniq -u >UU/oldsyms
17798 set X `cat UU/oldsyms`
17804 Hmm...You had some extra variables I don't know about...I'll try to keep 'em...
17806 echo "# Variables propagated from previous config.sh file." >>config.sh
17807 for sym in `cat UU/oldsyms`; do
17808 echo " Propagating $hint variable "'$'"$sym..."
17809 eval 'tmp="$'"${sym}"'"'
17811 sed -e "s/'/'\"'\"'/g" -e "s/^/$sym='/" -e "s/$/'/" >>config.sh
17817 : Finish up by extracting the .SH files
17821 echo "Extraction done."
17831 If you'd like to make any changes to the config.sh file before I begin
17832 to configure things, do it as a shell escape now (e.g. !vi config.sh).
17835 rp="Press return or use a shell escape to edit config.sh:"
17840 *) : in case they cannot read
17841 sh 1>&4 -c "$ans";;
17846 : if this fails, just run all the .SH files by hand
17855 if $contains '^depend:' [Mm]akefile >/dev/null 2>&1; then
17862 Now you need to generate make dependencies by running "$make depend".
17863 You might prefer to run it in background: "$make depend > makedepend.out &"
17864 It can take a while, so you might not want to run it right now.
17869 rp="Run $make depend now?"
17873 $make depend && echo "Now you must run '$make'."
17876 echo "You must run '$make depend' then '$make'."
17879 elif test -f [Mm]akefile; then
17881 echo "Now you must run a $make."
17883 echo "Configure done."
17886 if $test -f Policy.sh; then
17889 If you compile $package on a different machine or from a different object
17890 directory, copy the Policy.sh file from this object directory to the
17891 new one before you run Configure -- this will help you with most of
17892 the policy defaults.
17896 if $test -f config.msg; then
17897 echo "Hmm. I also noted the following information while running:"
17899 $cat config.msg >&4
17902 $rm -f kit*isdone ark*isdone