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 Tue Feb 29 19:47:23 EET 2000 [metaconfig 3.0 PL70]
24 # (with additional metaconfig patches by perlbug@perl.com)
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...
43 true || cat /tmp/c1$$ /tmp/c2$$
44 true || exec sh $0 $argv:q
46 (exit $?0) || cat /tmp/c2$$
47 (exit $?0) || exec sh $0 $argv:q
48 rm -f /tmp/c1$$ /tmp/c2$$
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
73 paths='/bin /usr/bin /usr/local/bin /usr/ucb /usr/local /usr/lbin'
74 paths="$paths /opt/bin /opt/local/bin /opt/local /opt/lbin"
75 paths="$paths /usr/5bin /etc /usr/gnu/bin /usr/new /usr/new/bin /usr/nbin"
76 paths="$paths /opt/gnu/bin /opt/new /opt/new/bin /opt/nbin"
77 paths="$paths /sys5.3/bin /sys5.3/usr/bin /bsd4.3/bin /bsd4.3/usr/ucb"
78 paths="$paths /bsd4.3/usr/bin /usr/bsd /bsd43/bin /usr/ccs/bin"
79 paths="$paths /etc /usr/lib /usr/ucblib /lib /usr/ccs/lib"
80 paths="$paths /sbin /usr/sbin /usr/libexec"
86 *) test -d $p && PATH=$PATH$p_$p ;;
93 : shall we be using ksh?
99 if (PATH=.; alias -x) >/dev/null 2>&1; then
102 if test -f /hp-ux -a -f /bin/ksh; then
103 needksh='to avoid sh bug in "here document" expansion'
105 if test -d /usr/lpp -a -f /usr/bin/bsh -a -f /usr/bin/uname; then
106 if test X`/usr/bin/uname -v` = X4; then
107 avoidksh="to avoid AIX 4's /bin/sh"
111 if test -f /osf_boot -a -f /usr/sbin/setld; then
112 if test X`/usr/bin/uname -s` = XOSF1; then
113 avoidksh="to avoid Digital UNIX' ksh"
115 unset BIN_SH # if this is 'xpg4' sh will start up ksh
118 case "$inksh/$needksh" in
125 case "$inksh/$avoidksh" in
131 case "$inksh/$needksh-$avoidksh-" in
134 (I see you are using the Korn shell. Some ksh's blow up on $me,
135 mainly on older exotic systems. If yours does, try the Bourne shell instead.)
141 echo "(Feeding myself to $newsh $reason.)"
143 Configure|*/Configure) exec $newsh $0 "$@";;
144 *) exec $newsh Configure "$@";;
149 : if needed set CDPATH to a harmless value that is not chatty
150 : avoid bash 2.02 problems with empty CDPATH.
154 *bash*) CDPATH='.' ;;
159 : Configure runs within the UU subdirectory
160 test -d UU || mkdir UU
455 d_old_pthread_create_joinable=''
456 old_pthread_create_joinable=''
696 inc_version_list_init=''
714 ignore_versioned_solibs=''
879 d_stdio_stream_array=''
880 stdio_stream_array=''
926 smallmach='pdp11 i8086 z8000 i80286 iAPX286'
929 : We must find out about Eunice early
931 if test -f /etc/unixtovms; then
932 eunicefix=/etc/unixtovms
934 if test -f /etc/unixtovms.exe; then
935 eunicefix=/etc/unixtovms.exe
939 : set useposix=false in your hint file to disable the POSIX extension.
941 : set useopcode=false in your hint file to disable the Opcode extension.
943 : Trailing extension. Override this in a hint file, if needed.
945 : Extra object files, if any, needed on this platform.
947 : Possible local include directories to search.
948 : Set locincpth to "" in a hint file to defeat local include searches.
949 locincpth="/usr/local/include /opt/local/include /usr/gnu/include"
950 locincpth="$locincpth /opt/gnu/include /usr/GNU/include /opt/GNU/include"
952 : no include file wanted by default
956 : change the next line if compiling for Xenix/286 on Xenix/386
957 xlibpth='/usr/lib/386 /lib/386'
958 : Possible local library directories to search.
959 loclibpth="/usr/local/lib /opt/local/lib /usr/gnu/lib"
960 loclibpth="$loclibpth /opt/gnu/lib /usr/GNU/lib /opt/GNU/lib"
962 : general looking path for locating libraries
963 glibpth="/usr/lib/large /lib /usr/lib $xlibpth"
964 glibpth="$glibpth /lib/large /usr/lib/small /lib/small"
965 glibpth="$glibpth /usr/ccs/lib /usr/ucblib /usr/local/lib"
966 test -f /usr/shlib/libc.so && glibpth="/usr/shlib $glibpth"
967 test -f /shlib/libc.so && glibpth="/shlib $glibpth"
969 : Private path used by Configure to find libraries. Its value
970 : is prepended to libpth. This variable takes care of special
971 : machines, like the mips. Usually, it should be empty.
974 : default library list
976 : some systems want to use only the non-versioned libso:s
977 ignore_versioned_solibs=''
978 : set usemultiplicity on the Configure command line to enable multiplicity.
979 : set usesocks on the Configure command line to enable socks.
980 : set usethreads on the Configure command line to enable threads.
981 : full support for void wanted by default
984 : List of libraries we want.
985 : If anyone needs -lnet, put it in a hint file.
986 libswanted='sfio socket bind inet nsl nm ndbm gdbm dbm db malloc dl'
987 libswanted="$libswanted dld ld sun m c cposix posix"
988 libswanted="$libswanted ndir dir crypt sec"
989 libswanted="$libswanted ucb bsd BSD PW x iconv"
990 : We probably want to search /usr/shlib before most other libraries.
991 : This is only used by the lib/ExtUtils/MakeMaker.pm routine extliblist.
992 glibpth=`echo " $glibpth " | sed -e 's! /usr/shlib ! !'`
993 glibpth="/usr/shlib $glibpth"
994 : Do not use vfork unless overridden by a hint file.
997 : Find the basic shell for Bourne shell scripts
1001 *bsd*|sys5*) xxx="/$SYSTYPE/bin/sh";;
1004 if test -f "$xxx"; then
1007 : Build up a list and do a single loop so we can 'break' out.
1008 pth=`echo $PATH | sed -e "s/$p_/ /g"`
1009 for xxx in sh bash ksh pdksh ash; do
1011 try="$try ${p}/${xxx}"
1015 if test -f "$xxx"; then
1018 elif test -f "$xxx.exe"; then
1029 $me: Fatal Error: I can't find a Bourne Shell anywhere.
1031 Usually it's in /bin/sh. How did you even get this far?
1032 Please contact me (Perl Maintainers) at perlbug@perl.com and
1033 we'll try to straighten this all out.
1039 : see if sh knows # comments
1040 if `$sh -c '#' >/dev/null 2>&1`; then
1044 test -f $xcat || xcat=/usr/bin/cat
1049 if test -s today; then
1052 echo "#! $xcat" > try
1056 if test -s today; then
1064 echo "Your $sh doesn't grok # comments--I will strip them later on."
1067 echo "exec grep -v '^[ ]*#'" >spitshell
1069 $eunicefix spitshell
1070 spitshell=`pwd`/spitshell
1072 echo "I presume that if # doesn't work, #! won't work either!"
1077 : figure out how to guarantee sh startup
1079 '') startsh=${sharpbang}${sh} ;;
1091 : echo "Yup, it does."
1093 echo "Hmm... '$startsh' does not guarantee sh startup..."
1094 echo "You may have to fix up the shell scripts to make sure $sh runs them."
1099 : Save command line options in file UU/cmdline.opt for later use in
1100 : generating config.sh.
1101 cat > cmdline.opt <<EOSH
1102 # Configure command line arguments.
1109 cat >>cmdline.opt <<EOSH
1110 config_arg$argn='$arg'
1112 argn=`expr $argn + 1`
1115 : produce awk script to parse command line options
1116 cat >options.awk <<'EOF'
1118 optstr = "A:dD:eEf:hKOrsSU:V"; # getopt-style specification
1120 len = length(optstr);
1121 for (i = 1; i <= len; i++) {
1122 c = substr(optstr, i, 1);
1123 if (i < len) a = substr(optstr, i + 1, 1); else a = "";
1134 if (substr(str, 1, 1) != "-") {
1135 printf("'%s'\n", str);
1139 for (i = 2; i <= len; i++) {
1140 c = substr(str, i, 1);
1142 printf("-%s\n", substr(str, i));
1148 printf("'%s'\n", substr(str, i + 1));
1161 : process the command line options
1162 set X `for arg in "$@"; do echo "X$arg"; done |
1163 sed -e s/X// | awk -f options.awk`
1168 : set up default values
1178 rm -f optdef.sh posthint.sh
1179 cat >optdef.sh <<EOS
1185 while test $# -gt 0; do
1187 -d) shift; fastread=yes;;
1188 -e) shift; alldone=cont;;
1192 if test -r "$1"; then
1195 echo "$me: cannot read config file $1." >&2
1200 -h) shift; error=true;;
1201 -r) shift; reuseval=true;;
1202 -s) shift; silent=true; realsilent=true;;
1203 -E) shift; alldone=exit;;
1204 -K) shift; knowitall=true;;
1205 -O) shift; override=true;;
1206 -S) shift; silent=true; extractsh=true;;
1211 echo "$me: use '-U symbol=', not '-D symbol='." >&2
1212 echo "$me: ignoring -D $1" >&2
1215 sed -e "s/'/'\"'\"'/g" -e "s/=\(.*\)/='\1'/" >> optdef.sh;;
1216 *) echo "$1='define'" >> optdef.sh;;
1223 *=) echo "$1" >> optdef.sh;;
1225 echo "$me: use '-D symbol=val', not '-U symbol=val'." >&2
1226 echo "$me: ignoring -U $1" >&2
1228 *) echo "$1='undef'" >> optdef.sh;;
1239 *=*) zzz=`echo $yyy|sed 's!=.*!!'`
1243 zzz=" "`echo $yyy|sed 's!^[^=]*=!!'`
1244 yyy=`echo $yyy|sed 's!=.*!!'` ;;
1250 *:*) xxx=`echo $yyy|sed 's!:.*!!'`
1251 yyy=`echo $yyy|sed 's!^[^:]*:!!'`
1252 zzz=`echo $yyy|sed 's!^[^=]*=!!'`
1253 yyy=`echo $yyy|sed 's!=.*!!'` ;;
1254 *) xxx=`echo $yyy|sed 's!:.*!!'`
1255 yyy=`echo $yyy|sed 's!^[^:]*:!!'` ;;
1261 echo "$yyy=\"\${$yyy}$zzz\"" >> posthint.sh ;;
1263 echo "$yyy=''" >> posthint.sh ;;
1268 echo "$yyy='$zzz'" >> posthint.sh ;;
1270 echo "eval \"$yyy=$zzz\"" >> posthint.sh ;;
1272 echo "$yyy=\"$zzz\${$yyy}\"" >> posthint.sh ;;
1277 echo "$yyy=$zzz" >> posthint.sh ;;
1278 *) echo "$me: unknown -A command '$xxx', ignoring -A $1" >&2 ;;
1282 -V) echo "$me generated by metaconfig 3.0 PL70." >&2
1285 -*) echo "$me: unknown option $1" >&2; shift; error=true;;
1293 Usage: $me [-dehrsEKOSV] [-f config.sh] [-D symbol] [-D symbol=value]
1294 [-U symbol] [-U symbol=] [-A command:symbol...]
1295 -d : use defaults for all answers.
1296 -e : go on without questioning past the production of config.sh.
1297 -f : specify an alternate default configuration file.
1298 -h : print this help message and exit (with an error status).
1299 -r : reuse C symbols value if possible (skips costly nm extraction).
1300 -s : silent mode, only echoes questions and essential information.
1301 -D : define symbol to have some value:
1302 -D symbol symbol gets the value 'define'
1303 -D symbol=value symbol gets the value 'value'
1304 -E : stop at the end of questions, after having produced config.sh.
1305 -K : do not use unless you know what you are doing.
1306 -O : let -D and -U override definitions from loaded configuration file.
1307 -S : perform variable substitutions on all .SH files (can mix with -f)
1308 -U : undefine symbol:
1309 -U symbol symbol gets the value 'undef'
1310 -U symbol= symbol gets completely empty
1311 -A : manipulate symbol after the platform specific hints have been applied:
1312 -A symbol=value append " "value to symbol
1313 -A append:symbol=value append value to symbol
1314 -A define:symbol=value define symbol to have value
1315 -A clear:symbol define symbol to be ''
1316 -A define:symbol define symbol to be 'define'
1317 -A eval:symbol=value define symbol to be eval of value
1318 -A prepend:symbol=value prepend value to symbol
1319 -A undef:symbol define symbol to be 'undef'
1320 -A undef:symbol= define symbol to be ''
1321 -V : print version number and exit (with a zero status).
1328 case "$fastread$alldone" in
1331 if test ! -t 0; then
1332 echo "Say 'sh Configure', not 'sh <Configure'"
1340 true) exec 1>/dev/null;;
1343 : run the defines and the undefines, if any, but leave the file out there...
1346 : create the posthint manipulation script and leave the file out there...
1351 first=`echo $package | sed -e 's/^\(.\).*/\1/'`
1352 last=`echo $package | sed -e 's/^.\(.*\)/\1/'`
1353 case "`echo AbyZ | tr '[:lower:]' '[:upper:]' 2>/dev/null`" in
1354 ABYZ) spackage=`echo $first | tr '[:lower:]' '[:upper:]'`$last;;
1355 *) spackage=`echo $first | tr '[a-z]' '[A-Z]'`$last;;
1358 : Some greps do not return status, grrr.
1359 echo "grimblepritz" >grimble
1360 if grep blurfldyick grimble >/dev/null 2>&1 ; then
1362 elif grep grimblepritz grimble >/dev/null 2>&1 ; then
1368 : the following should work in any shell
1372 echo "AGH! Grep doesn't return a status. Attempting remedial action."
1373 cat >contains <<'EOSS'
1374 grep "$1" "$2" >.greptmp && cat .greptmp && test -s .greptmp
1379 : Find the path to the source tree
1382 */*) src=`echo $0 | sed -e 's%/[^/][^/]*$%%'`
1385 *) src=`cd ../$src && pwd` ;;
1398 if test -f $rsrc/Configure && \
1399 $contains "^package=$package$" $rsrc/Configure >/dev/null 2>&1
1401 : found it, so we are ok.
1404 for src in . .. ../.. ../../.. ../../../..; do
1405 if test -f ../$src/Configure && \
1406 $contains "^package=$package$" ../$src/Configure >/dev/null 2>&1
1417 Sorry, I can't seem to locate the source dir for $package. Please start
1418 Configure with an explicit path -- i.e. /some/path/Configure.
1426 echo "Sources for $package found in \"$src\"." >&4
1430 : script used to extract .SH files with variable substitutions
1431 cat >extract <<'EOS'
1433 echo "Doing variable substitutions on .SH files..."
1434 if test -f $src/MANIFEST; then
1435 set x `awk '{print $1}' <$src/MANIFEST | grep '\.SH$'`
1437 echo "(Looking for .SH files under the source directory.)"
1438 set x `(cd $src; find . -name "*.SH" -print)`
1442 0) set x `(cd $src; echo *.SH)`; shift;;
1444 if test ! -f $src/$1; then
1450 while test $name; do
1451 if test ! -d "$name"; then
1452 create="$name $create";
1453 name=`echo $name | sed -e "s|^[^/]*$||"`;
1454 name=`echo $name | sed -e "s|\(.*\)/.*|\1|"`;
1459 for file in $create; do
1468 dir=`expr X$file : 'X\(.*\)/'`
1469 file=`expr X$file : 'X.*/\(.*\)'`
1470 (cd $dir && . ./$file)
1480 dir=`expr X$file : 'X\(.*\)/'`
1481 file=`expr X$file : 'X.*/\(.*\)'`
1482 (set x $dir; shift; eval $mkdir_p)
1492 if test -f $src/config_h.SH; then
1493 if test ! -f config.h; then
1494 : oops, they left it out of MANIFEST, probably, so do it anyway.
1500 : extract files and exit if asked to do so
1501 case "$extractsh" in
1503 case "$realsilent" in
1507 case "$config_sh" in
1508 '') config_sh='config.sh';;
1511 echo "Fetching answers from $config_sh..."
1514 test "$override" && . ./optdef.sh
1523 : Eunice requires " " instead of "", can you believe it
1526 echo "Beginning of configuration questions for $package."
1528 trap 'echo " "; test -d ../UU && rm -rf X $rmlist; exit 1' 1 2 3 15
1530 : first determine how to suppress newline on echo command
1532 echo "Checking echo to see how to suppress newlines..."
1533 (echo "hi there\c" ; echo " ") >.echotmp
1534 if $contains c .echotmp >/dev/null 2>&1 ; then
1545 echo $n "The star should be here-->$c"
1549 : Now test for existence of everything in MANIFEST
1551 if test -f $rsrc/MANIFEST; then
1552 echo "First let's make sure your kit is complete. Checking..." >&4
1553 awk '$1 !~ /PACK[A-Z]+/ {print $1}' $rsrc/MANIFEST | split -50
1556 for filelist in x??; do
1557 (cd $rsrc; ls `cat $tmppwd/$filelist` >/dev/null 2>>$tmppwd/missing)
1559 if test -s missing; then
1563 THIS PACKAGE SEEMS TO BE INCOMPLETE.
1565 You have the option of continuing the configuration process, despite the
1566 distinct possibility that your kit is damaged, by typing 'y'es. If you
1567 do, don't blame me if something goes wrong. I advise you to type 'n'o
1568 and contact the author (perlbug@perl.com).
1571 echo $n "Continue? [n] $c" >&4
1575 echo "Continuing..." >&4
1579 echo "ABORTING..." >&4
1584 echo "Looks good..."
1587 echo "There is no MANIFEST file. I hope your kit is complete !"
1592 : Find the appropriate value for a newline for tr
1593 if test -n "$DJGPP"; then
1596 if test X"$trnl" = X; then
1597 case "`echo foo|tr '\n' x 2>/dev/null`" in
1601 if test X"$trnl" = X; then
1602 case "`echo foo|tr '\012' x 2>/dev/null`" in
1603 foox) trnl='\012' ;;
1606 if test X"$trnl" = X; then
1609 $me: Fatal Error: cannot figure out how to translate newlines with 'tr'.
1615 : compute the number of columns on the terminal for proper question formatting
1620 : set up the echo used in my read
1621 myecho="case \"\$xxxm\" in
1622 '') echo $n \"\$rp $c\" >&4;;
1624 '') echo $n \"[\$xxxm] $c\";;
1626 if test \`echo \"\$rp [\$xxxm] \" | wc -c\` -ge $COLUMNS; then
1628 echo $n \"[\$xxxm] $c\" >&4
1630 echo $n \"\$rp [\$xxxm] $c\" >&4
1636 : now set up to do reads with possible shell escape and default assignment
1642 case "\$fastread" in
1643 yes) case "\$dflt" in
1646 case "\$silent-\$rp" in
1651 *) case "\$silent" in
1652 true) case "\$rp" in
1657 while expr "X\$ans" : "X!" >/dev/null; do
1661 aok=''; eval "ans=\\"\$answ\\"" && aok=y
1669 set x \`expr "X\$ans" : "X!\(.*\)\$"\`
1678 set x \`expr "X\$ans" : "X&\(.*\)\$"\`
1683 echo "(OK, I'll run with -d after this question.)" >&4
1686 echo "*** Sorry, \$1 not supported yet." >&4
1696 echo "*** Substitution done -- please confirm."
1698 ans=\`echo $n "\$ans$c" | tr '$trnl' ' '\`
1703 echo "*** Error -- try again."
1710 case "\$ans\$xxxm\$nostick" in
1722 : create .config dir to save info across Configure sessions
1723 test -d ../.config || mkdir ../.config
1724 cat >../.config/README <<EOF
1725 This directory created by Configure to save information that should
1726 persist across sessions for $package.
1728 You may safely delete it if you wish.
1731 : general instructions
1734 user=`(logname) 2>/dev/null`
1736 '') user=`whoami 2>&1`;;
1738 if $contains "^$user\$" ../.config/instruct >/dev/null 2>&1; then
1741 rp='Would you like to see the instructions?'
1752 This installation shell script will examine your system and ask you questions
1753 to determine how the perl5 package should be installed. If you get
1754 stuck on a question, you may use a ! shell escape to start a subshell or
1755 execute a command. Many of the questions will have default answers in square
1756 brackets; typing carriage return will give you the default.
1758 On some of the questions which ask for file or directory names you are allowed
1759 to use the ~name construct to specify the login directory belonging to "name",
1760 even if you don't have a shell which knows about that. Questions where this is
1761 allowed will be marked "(~name ok)".
1765 dflt='Type carriage return to continue'
1769 The prompter used in this script allows you to use shell variables and
1770 backticks in your answers. You may use $1, $2, etc... to refer to the words
1771 in the default answer, as if the default line was a set of arguments given to a
1772 script shell. This means you may also use $* to repeat the whole default line,
1773 so you do not have to re-type everything to add something to the default.
1775 Everytime there is a substitution, you will have to confirm. If there is an
1776 error (e.g. an unmatched backtick), the default answer will remain unchanged
1777 and you will be prompted again.
1779 If you are in a hurry, you may run 'Configure -d'. This will bypass nearly all
1780 the questions and use the computed defaults (or the previous answers if there
1781 was already a config.sh file). Type 'Configure -h' for a list of options.
1782 You may also start interactively and then answer '& -d' at any prompt to turn
1783 on the non-interactive behaviour for the remainder of the execution.
1789 Much effort has been expended to ensure that this shell script will run on any
1790 Unix system. If despite that it blows up on yours, your best bet is to edit
1791 Configure and run it again. If you can't run Configure for some reason,
1792 you'll have to generate a config.sh file by hand. Whatever problems you
1793 have, let me (perlbug@perl.com) know how I blew it.
1795 This installation script affects things in two ways:
1797 1) it may do direct variable substitutions on some of the files included
1799 2) it builds a config.h file for inclusion in C programs. You may edit
1800 any of these files as the need arises after running this script.
1802 If you make a mistake on a question, there is no easy way to back up to it
1803 currently. The easiest thing to do is to edit config.sh and rerun all the SH
1804 files. Configure will offer to let you do this before it runs the SH files.
1807 dflt='Type carriage return to continue'
1809 case "$firsttime" in
1810 true) echo $user >>../.config/instruct;;
1814 : find out where common programs are
1816 echo "Locating common programs..." >&4
1829 if test -d \$dir/\$thing; then
1835 for thisthing in \$dir/\$thing; do
1836 : just loop through to pick last item
1838 if test -f \$thisthing; then
1841 elif test -f \$dir/\$thing.exe; then
1842 if test -n "$DJGPP"; then
1843 echo \$dir/\$thing.exe
1845 : on Eunice apparently
1895 pth=`echo $PATH | sed -e "s/$p_/ /g"`
1896 pth="$pth /lib /usr/lib"
1897 for file in $loclist; do
1901 if test -f "$xxx"; then
1904 echo "WARNING: no $xxx -- ignoring your setting for $file." >&4
1905 xxx=`./loc $file $file $pth`
1908 '') xxx=`./loc $file $file $pth`;;
1909 *) xxx=`./loc $xxx $xxx $pth`;;
1915 echo $file is in $xxx.
1918 echo $file is in $xxx.
1921 echo "I don't know where '$file' is, and my life depends on it." >&4
1922 echo "Go find a public domain implementation or fix your PATH setting!" >&4
1928 echo "Don't worry if any of the following aren't found..."
1930 for file in $trylist; do
1934 if test -f "$xxx"; then
1937 echo "WARNING: no $xxx -- ignoring your setting for $file." >&4
1938 xxx=`./loc $file $file $pth`
1941 '') xxx=`./loc $file $file $pth`;;
1942 *) xxx=`./loc $xxx $xxx $pth`;;
1948 echo $file is in $xxx.
1951 echo $file is in $xxx.
1954 echo "I don't see $file out there, $say."
1961 echo "Substituting grep for egrep."
1967 echo "Substituting cp for ln."
1973 echo "Hopefully test is built into your sh."
1976 if `sh -c "PATH= test true" >/dev/null 2>&1`; then
1977 echo "Using the test built into your sh."
1985 echo "Hopefully echo is built into your sh."
1990 echo "Checking compatibility between $echo and builtin echo (if any)..." >&4
1991 $echo $n "hi there$c" >foo1
1992 echo $n "hi there$c" >foo2
1993 if cmp foo1 foo2 >/dev/null 2>&1; then
1994 echo "They are compatible. In fact, they may be identical."
2001 They are not compatible! You are probably running ksh on a non-USG system.
2002 I'll have to use $echo instead of the builtin, since Bourne shell doesn't
2003 have echo built in and we may have to run some Bourne shell scripts. That
2004 means I'll have to use '$n$c' to suppress newlines now. Life is ridiculous.
2007 $echo $n "The star should be here-->$c"
2014 : determine whether symbolic links are supported
2017 if $ln -s blurfl sym > /dev/null 2>&1 ; then
2018 echo "Symbolic links are supported." >&4
2021 echo "Symbolic links are NOT supported." >&4
2026 : see whether [:lower:] and [:upper:] are supported character classes
2028 case "`echo AbyZ | $tr '[:lower:]' '[:upper:]' 2>/dev/null`" in
2030 echo "Good, your tr supports [:lower:] and [:upper:] to convert case." >&4
2034 *) # There is a discontinuity in EBCDIC between 'I' and 'J'
2035 # (0xc9 and 0xd1), therefore that is a nice testing point.
2036 if test "X$up" = X -o "X$low" = X; then
2037 case "`echo IJ | $tr '[I-J]' '[i-j]' 2>/dev/null`" in
2043 if test "X$up" = X -o "X$low" = X; then
2044 case "`echo IJ | $tr I-J i-j 2>/dev/null`" in
2050 if test "X$up" = X -o "X$low" = X; then
2051 case "`echo IJ | od -x 2>/dev/null`" in
2053 echo "Hey, this might be EBCDIC." >&4
2054 if test "X$up" = X -o "X$low" = X; then
2055 case "`echo IJ | $tr '[A-IJ-RS-Z]' '[a-ij-rs-z]' 2>/dev/null`" in
2056 ij) up='[A-IJ-RS-Z]'
2061 if test "X$up" = X -o "X$low" = X; then
2062 case "`echo IJ | $tr A-IJ-RS-Z a-ij-rs-z 2>/dev/null`" in
2072 case "`echo IJ | $tr \"$up\" \"$low\" 2>/dev/null`" in
2074 echo "Using $up and $low to convert case." >&4
2077 echo "I don't know how to translate letters from upper to lower case." >&4
2078 echo "Your tr is not acting any way I know of." >&4
2082 : set up the translation script tr, must be called with ./tr of course
2086 '[A-Z][a-z]') exec $tr '$up' '$low';;
2087 '[a-z][A-Z]') exec $tr '$low' '$up';;
2094 : Try to determine whether config.sh was made on this system
2095 case "$config_sh" in
2097 myuname=`$uname -a 2>/dev/null`
2098 $test -z "$myuname" && myuname=`hostname 2>/dev/null`
2099 # tr '[A-Z]' '[a-z]' would not work in EBCDIC
2100 # because the A-Z/a-z are not consecutive.
2101 myuname=`echo $myuname | $sed -e 's/^[^=]*=//' -e 's/\///g' | \
2102 ./tr '[A-Z]' '[a-z]' | $tr $trnl ' '`
2103 newmyuname="$myuname"
2105 case "$knowitall" in
2107 if test -f ../config.sh; then
2108 if $contains myuname= ../config.sh >/dev/null 2>&1; then
2109 eval "`grep myuname= ../config.sh`"
2111 if test "X$myuname" = "X$newmyuname"; then
2119 : Get old answers from old config file if Configure was run on the
2120 : same system, otherwise use the hints.
2123 if test -f config.sh; then
2125 rp="I see a config.sh file. Shall I use it to set the defaults?"
2128 n*|N*) echo "OK, I'll ignore it."; mv config.sh config.sh.old;;
2129 *) echo "Fetching default answers from your old config.sh file..." >&4
2137 : Older versions did not always set $sh. Catch re-use of such
2146 if test ! -f config.sh; then
2149 First time through, eh? I have some defaults handy for some systems
2150 that need some extra help getting the Configure answers right:
2153 (cd $src/hints; ls -C *.sh) | $sed 's/\.sh/ /g' >&4
2155 : Half the following guesses are probably wrong... If you have better
2156 : tests or hints, please send them to perlbug@perl.com
2157 : The metaconfig authors would also appreciate a copy...
2158 $test -f /irix && osname=irix
2159 $test -f /xenix && osname=sco_xenix
2160 $test -f /dynix && osname=dynix
2161 $test -f /dnix && osname=dnix
2162 $test -f /lynx.os && osname=lynxos
2163 $test -f /unicos && osname=unicos && osvers=`$uname -r`
2164 $test -f /unicosmk && osname=unicosmk && osvers=`$uname -r`
2165 $test -f /unicosmk.ar && osname=unicosmk && osvers=`$uname -r`
2166 $test -f /bin/mips && /bin/mips && osname=mips
2167 $test -d /NextApps && set X `hostinfo | grep 'NeXT Mach.*:' | \
2168 $sed -e 's/://' -e 's/\./_/'` && osname=next && osvers=$4
2169 $test -d /usr/apollo/bin && osname=apollo
2170 $test -f /etc/saf/_sactab && osname=svr4
2171 $test -d /usr/include/minix && osname=minix
2172 if $test -d /MachTen -o -d /MachTen_Folder; then
2174 if $test -x /sbin/version; then
2175 osvers=`/sbin/version | $awk '{print $2}' |
2176 $sed -e 's/[A-Za-z]$//'`
2177 elif $test -x /usr/etc/version; then
2178 osvers=`/usr/etc/version | $awk '{print $2}' |
2179 $sed -e 's/[A-Za-z]$//'`
2185 $test -f /sys/posix.dll &&
2186 $test -f /usr/bin/what &&
2187 set X `/usr/bin/what /sys/posix.dll` &&
2188 $test "$3" = UWIN &&
2192 if $test -f $uname; then
2200 umips) osname=umips ;;
2203 [23]100) osname=mips ;;
2204 next*) osname=next ;;
2206 tmp=`/bin/uname -X 2>/dev/null|awk '/3\.2v[45]/{ print $(NF) }'`
2207 if $test "$tmp" != "" -a "$3" = "3.2" -a -f '/etc/systemid'; then
2210 elif $test -f /etc/kconfig; then
2212 if test "$lns" = "$ln -s"; then
2214 elif $contains _SYSV3 /usr/include/stdio.h > /dev/null 2>&1 ; then
2216 elif $contains _POSIX_SOURCE /usr/include/stdio.h > /dev/null 2>&1 ; then
2223 if test -n "$DJGPP"; then
2232 tmp=`( (oslevel) 2>/dev/null || echo "not found") 2>&1`
2234 'not found') osvers="$4"."$3" ;;
2235 '<3240'|'<>3240') osvers=3.2.0 ;;
2236 '=3240'|'>3240'|'<3250'|'<>3250') osvers=3.2.4 ;;
2237 '=3250'|'>3250') osvers=3.2.5 ;;
2241 bsd386) osname=bsd386
2244 cygwin*) osname=cygwin
2247 *dc.osx) osname=dcosx
2253 domainos) osname=apollo
2259 dynixptx*) osname=dynixptx
2260 osvers=`echo "$4"|sed 's/^v//'`
2262 freebsd) osname=freebsd
2264 genix) osname=genix ;;
2266 osvers=`echo "$3" | $sed 's,.*\.\([0-9]*\.[0-9]*\),\1,'`
2282 netbsd*) osname=netbsd
2285 news-os) osvers="$3"
2287 4*) osname=newsos4 ;;
2291 next*) osname=next ;;
2292 POSIX-BC | posix-bc ) osname=posix-bc
2295 powerux | power_ux | powermax_os | powermaxos | \
2296 powerunix | power_unix) osname=powerux
2302 solaris) osname=solaris
2304 5*) osvers=`echo $3 | $sed 's/^5/2/g'` ;;
2311 osvers=`echo $3 | $sed 's/^5/2/g'` ;;
2315 titanos) osname=titanos
2324 ultrix) osname=ultrix
2327 osf1|mls+) case "$5" in
2330 osvers=`echo "$3" | sed 's/^[xvt]//'`
2332 hp*) osname=hp_osf1 ;;
2333 mips) osname=mips_osf1 ;;
2336 unixware) osname=svr5
2342 $2) case "$osname" in
2346 : svr4.x or possibly later
2356 if test -f /stand/boot ; then
2357 eval `grep '^INITPROG=[a-z/0-9]*$' /stand/boot`
2358 if test -n "$INITPROG" -a -f "$INITPROG"; then
2359 isesix=`strings -a $INITPROG|grep 'ESIX SYSTEM V/386 Release 4.0'`
2360 if test -n "$isesix"; then
2368 *) if test -f /etc/systemid; then
2370 set `echo $3 | $sed 's/\./ /g'` $4
2371 if $test -f $src/hints/sco_$1_$2_$3.sh; then
2373 elif $test -f $src/hints/sco_$1_$2.sh; then
2375 elif $test -f $src/hints/sco_$1.sh; then
2380 '') : Still unknown. Probably a generic Sys V.
2389 *) case "$osname" in
2390 '') : Still unknown. Probably a generic BSD.
2398 if test -f /vmunix -a -f $src/hints/news_os.sh; then
2399 (what /vmunix | UU/tr '[A-Z]' '[a-z]') > UU/kernel.what 2>&1
2400 if $contains news-os UU/kernel.what >/dev/null 2>&1; then
2403 $rm -f UU/kernel.what
2404 elif test -d c:/.; then
2411 : Now look for a hint file osname_osvers, unless one has been
2412 : specified already.
2415 file=`echo "${osname}_${osvers}" | $sed -e 's%\.%_%g' -e 's%_$%%'`
2416 : Also try without trailing minor version numbers.
2417 xfile=`echo $file | $sed -e 's%_[^_]*$%%'`
2418 xxfile=`echo $xfile | $sed -e 's%_[^_]*$%%'`
2419 xxxfile=`echo $xxfile | $sed -e 's%_[^_]*$%%'`
2420 xxxxfile=`echo $xxxfile | $sed -e 's%_[^_]*$%%'`
2423 *) case "$osvers" in
2426 *) if $test -f $src/hints/$file.sh ; then
2428 elif $test -f $src/hints/$xfile.sh ; then
2430 elif $test -f $src/hints/$xxfile.sh ; then
2432 elif $test -f $src/hints/$xxxfile.sh ; then
2434 elif $test -f $src/hints/$xxxxfile.sh ; then
2436 elif $test -f "$src/hints/${osname}.sh" ; then
2445 if $test -f Policy.sh ; then
2448 none) dflt="Policy" ;;
2449 *) dflt="Policy $dflt" ;;
2454 dflt=`echo $hintfile | $sed 's/\.sh$//'`
2458 if $test -f Policy.sh ; then
2461 There's also a Policy hint file available, which should make the
2462 site-specific (policy) questions easier to answer.
2469 You may give one or more space-separated answers, or "none" if appropriate.
2470 A well-behaved OS will have no hints, so answering "none" or just "Policy"
2471 is a good thing. DO NOT give a wrong version or a wrong OS.
2475 rp="Which of these apply, if any?"
2478 for file in $tans; do
2479 if $test X$file = XPolicy -a -f Policy.sh; then
2481 $cat Policy.sh >> UU/config.sh
2482 elif $test -f $src/hints/$file.sh; then
2483 . $src/hints/$file.sh
2484 $cat $src/hints/$file.sh >> UU/config.sh
2485 elif $test X$tans = X -o X$tans = Xnone ; then
2488 : Give one chance to correct a possible typo.
2489 echo "$file.sh does not exist"
2491 rp="hint to use instead?"
2493 for file in $ans; do
2494 if $test -f "$src/hints/$file.sh"; then
2495 . $src/hints/$file.sh
2496 $cat $src/hints/$file.sh >> UU/config.sh
2497 elif $test X$ans = X -o X$ans = Xnone ; then
2500 echo "$file.sh does not exist -- ignored."
2507 : Remember our hint file for later.
2508 if $test -f "$src/hints/$file.sh" ; then
2518 echo "Fetching default answers from $config_sh..." >&4
2522 cp $config_sh config.sh 2>/dev/null
2532 test "$override" && . ./optdef.sh
2533 myuname="$newmyuname"
2535 : Restore computed paths
2536 for file in $loclist $trylist; do
2537 eval $file="\$_$file"
2542 Configure uses the operating system name and version to set some defaults.
2543 The default value is probably right if the name rings a bell. Otherwise,
2544 since spelling matters for me, either accept the default or answer "none"
2551 ''|' '|none) dflt=none ;;
2552 *) dflt=`echo $hintfile | $sed -e 's/\.sh$//' -e 's/_.*$//'` ;;
2555 *) dflt="$osname" ;;
2557 rp="Operating system name?"
2561 *) osname=`echo "$ans" | $sed -e 's/[ ][ ]*/_/g' | ./tr '[A-Z]' '[a-z]'`;;
2567 ''|' '|none) dflt=none ;;
2568 *) dflt=`echo $hintfile | $sed -e 's/\.sh$//' -e 's/^[^_]*//'`
2569 dflt=`echo $dflt | $sed -e 's/^_//' -e 's/_/./g'`
2571 ''|' ') dflt=none ;;
2576 *) dflt="$osvers" ;;
2578 rp="Operating system version?"
2588 : who configured the system
2589 cf_time=`LC_ALL=C; LANGUAGE=C; export LC_ALL; export LANGUAGE; $date 2>&1`
2590 cf_by=`(logname) 2>/dev/null`
2593 cf_by=`(whoami) 2>/dev/null`
2595 "") cf_by=unknown ;;
2599 : set up the script used to warn in case of inconsistency
2606 echo "*** WHOA THERE!!! ***" >&4
2607 echo " The $hint value for \$$var on this machine was \"$was\"!" >&4
2608 rp=" Keep the $hint value?"
2611 y) td=$was; tu=$was;;
2615 : function used to set $1 to $val
2616 setvar='var=$1; eval "was=\$$1"; td=$define; tu=$undef;
2618 $define$undef) . ./whoa; eval "$var=\$td";;
2619 $undef$define) . ./whoa; eval "$var=\$tu";;
2620 *) eval "$var=$val";;
2623 case "$usethreads" in
2624 $define|true|[yY]*) dflt='y';;
2629 Perl can be built to take advantage of threads on some systems.
2630 To do so, Configure can be run with -Dusethreads.
2632 Note that threading is a highly experimental feature, and
2633 some known race conditions still remain. If you choose to try
2634 it, be very sure to not actually deploy it for production
2635 purposes. README.threads has more details, and is required
2636 reading if you enable threads.
2638 If this doesn't make any sense to you, just accept the default '$dflt'.
2640 rp='Build a threading Perl?'
2643 y|Y) val="$define" ;;
2649 case "$usethreads" in
2653 As of 5.5.640, Perl has two different internal threading implementations,
2654 the 5.005 version (5005threads) and an interpreter-based version
2655 (ithreads) that has one interpreter per thread. Both are very
2656 experimental. This arrangement exists to help developers work out
2657 which one is better.
2659 If you're a casual user, you probably don't want interpreter-threads
2660 at this time. There doesn't yet exist a way to create threads from
2661 within Perl in this model, i.e., "use Thread;" will NOT work.
2663 : Default to ithreads unless overridden on command line or with
2666 case "$use5005threads" in
2667 $define|true|[yY]*) dflt='n';;
2669 case "$useithreads" in
2670 $undef|false|[nN]*) dflt='n';;
2672 rp='Use interpreter-based ithreads?'
2675 y|Y) val="$define" ;;
2680 : Now set use5005threads to the opposite value.
2681 case "$useithreads" in
2682 $define) val="$undef" ;;
2689 useithreads="$undef"
2690 use5005threads="$undef"
2694 case "$d_oldpthreads" in
2695 '') : Configure tests would be welcome here. For now, assume undef.
2697 *) val="$d_oldpthreads" ;;
2703 case "$usethreads" in
2704 "$define"|true|[yY]*)
2705 : Look for a hint-file generated 'call-back-unit'. If the
2706 : user has specified that a threading perl is to be built,
2707 : we may need to set or change some other defaults.
2708 if $test -f usethreads.cbu; then
2709 echo "Your platform has some specific hints for threaded builds, using them..."
2713 (Your platform doesn't have any specific hints for threaded builds.
2714 Assuming POSIX threads, then.)
2722 Perl can be built so that multiple Perl interpreters can coexist
2723 within the same Perl executable.
2726 case "$useithreads" in
2729 This multiple interpreter support is required for interpreter-based threads.
2733 *) case "$usemultiplicity" in
2734 $define|true|[yY]*) dflt='y';;
2738 echo "If this doesn't make any sense to you, just accept the default '$dflt'."
2739 rp='Build Perl for multiplicity?'
2742 y|Y) val="$define" ;;
2750 : determine where manual pages are on this system
2754 syspath='/usr/man/man1 /usr/man/mann /usr/man/manl /usr/man/local/man1'
2755 syspath="$syspath /usr/man/u_man/man1 /usr/share/man/man1"
2756 syspath="$syspath /usr/catman/u_man/man1 /usr/man/l_man/man1"
2757 syspath="$syspath /usr/local/man/u_man/man1 /usr/local/man/l_man/man1"
2758 syspath="$syspath /usr/man/man.L /local/man/man1 /usr/local/man/man1"
2759 sysman=`./loc . /usr/man/man1 $syspath`
2762 if $test -d "$sysman"; then
2763 echo "System manual is in $sysman." >&4
2765 echo "Could not find manual pages in source form." >&4
2768 : see what memory models we can support
2771 $cat >pdp11.c <<'EOP'
2780 ( cc -o pdp11 pdp11.c ) >/dev/null 2>&1
2781 if $test -f pdp11 && ./pdp11 2>/dev/null; then
2782 dflt='unsplit split'
2784 tans=`./loc . X /lib/small /lib/large /usr/lib/small /usr/lib/large /lib/medium /usr/lib/medium /lib/huge`
2787 *) if $test -d /lib/small || $test -d /usr/lib/small; then
2792 if $test -d /lib/medium || $test -d /usr/lib/medium; then
2795 if $test -d /lib/large || $test -d /usr/lib/large; then
2798 if $test -d /lib/huge || $test -d /usr/lib/huge; then
2807 Some systems have different model sizes. On most systems they are called
2808 small, medium, large, and huge. On the PDP11 they are called unsplit and
2809 split. If your system doesn't support different memory models, say "none".
2810 If you wish to force everything to one memory model, say "none" here and
2811 put the appropriate flags later when it asks you for other cc and ld flags.
2812 Venix systems may wish to put "none" and let the compiler figure things out.
2813 (In the following question multiple model names should be space separated.)
2815 The default for most systems is "none".
2818 rp="Which memory models are supported?"
2833 '') if $contains '\-i' $sysman/ld.1 >/dev/null 2>&1 || \
2834 $contains '\-i' $sysman/cc.1 >/dev/null 2>&1; then
2841 rp="What flag indicates separate I and D space?"
2849 *large*|*small*|*medium*|*huge*)
2856 rp="What flag indicates large model?"
2866 *huge*) case "$huge" in
2870 rp="What flag indicates huge model?"
2880 *medium*) case "$medium" in
2884 rp="What flag indicates medium model?"
2891 *) medium="$large";;
2894 *small*) case "$small" in
2898 rp="What flag indicates small model?"
2909 echo "Unrecognized memory models--you may have to edit Makefile.SH" >&4
2912 $rm -f pdp11.* pdp11
2914 : make some quick guesses about what we are up against
2916 $echo $n "Hmm... $c"
2926 $cat /usr/include/signal.h /usr/include/sys/signal.h >foo 2>/dev/null
2927 if test -f /osf_boot || $contains 'OSF/1' /usr/include/ctype.h >/dev/null 2>&1
2929 echo "Looks kind of like an OSF/1 system, but we'll see..."
2931 elif test `echo abc | tr a-z A-Z` = Abc ; then
2932 xxx=`./loc addbib blurfl $pth`
2933 if $test -f $xxx; then
2934 echo "Looks kind of like a USG system with BSD features, but we'll see..."
2938 if $contains SIGTSTP foo >/dev/null 2>&1 ; then
2939 echo "Looks kind of like an extended USG system, but we'll see..."
2941 echo "Looks kind of like a USG system, but we'll see..."
2945 elif $contains SIGTSTP foo >/dev/null 2>&1 ; then
2946 echo "Looks kind of like a BSD system, but we'll see..."
2950 echo "Looks kind of like a Version 7 system, but we'll see..."
2953 case "$eunicefix" in
2956 There is, however, a strange, musty smell in the air that reminds me of
2957 something...hmm...yes...I've got it...there's a VMS nearby, or I'm a Blit.
2961 : it so happens the Eunice I know will not run shell scripts in Unix format
2965 echo "Congratulations. You aren't running Eunice."
2969 : Detect OS2. The p_ variable is set above in the Head.U unit.
2974 I have the feeling something is not exactly right, however...don't tell me...
2975 lemme think...does HAL ring a bell?...no, of course, you're only running OS/2!
2980 if test -f /xenix; then
2981 echo "Actually, this looks more like a XENIX system..."
2986 echo "It's not Xenix..."
2991 if test -f /venix; then
2992 echo "Actually, this looks more like a VENIX system..."
2999 echo "Nor is it Venix..."
3002 chmod +x bsd usg v7 osf1 eunice xenix venix os2
3003 $eunicefix bsd usg v7 osf1 eunice xenix venix os2
3006 : see if we need a special compiler
3014 *) if $contains '\-M' $sysman/cc.1 >/dev/null 2>&1 ; then
3015 if $contains '\-M' $sysman/cpp.1 >/dev/null 2>&1; then
3029 On some older systems the default C compiler will not resolve multiple global
3030 references that happen to have the same name. On some such systems the "Mcc"
3031 command may be used to force these to be resolved. On other systems a "cc -M"
3032 command is required. (Note that the -M flag on other systems indicates a
3033 memory model to use!) If you have the Gnu C compiler, you might wish to use
3039 rp="Use which C compiler?"
3047 rp="Use which C compiler?"
3051 : Look for a hint-file generated 'call-back-unit'. Now that the
3052 : user has specified the compiler, we may need to set or change some
3054 if $test -f cc.cbu; then
3058 echo "Checking for GNU cc in disguise and/or its version number..." >&4
3059 $cat >gccvers.c <<EOM
3064 printf("%s\n", __VERSION__);
3066 printf("%s\n", "1");
3072 if $cc $ldflags -o gccvers gccvers.c; then
3073 gccversion=`./gccvers`
3074 case "$gccversion" in
3075 '') echo "You are not using GNU cc." ;;
3076 *) echo "You are using GNU cc $gccversion."
3081 echo "*** WHOA THERE!!! ***" >&4
3082 echo " Your C compiler \"$cc\" doesn't seem to be working!" >&4
3083 case "$knowitall" in
3085 echo " You'd better start hunting for one and let me know about it." >&4
3091 case "$gccversion" in
3092 1*) cpp=`./loc gcc-cpp $cpp $pth` ;;
3095 : decide how portable to be. Allow command line overrides.
3096 case "$d_portable" in
3098 *) d_portable="$define" ;;
3101 : set up shell script to do ~ expansion
3107 echo \$1 | $sed "s|~|\${HOME-\$LOGDIR}|"
3110 if $test -f /bin/csh; then
3111 /bin/csh -f -c "glob \$1"
3116 name=\`$expr x\$1 : '..\([^/]*\)'\`
3117 dir=\`$sed -n -e "/^\${name}:/{s/^[^:]*:[^:]*:[^:]*:[^:]*:[^:]*:\([^:]*\).*"'\$'"/\1/" -e p -e q -e '}' </etc/passwd\`
3118 if $test ! -d "\$dir"; then
3120 echo "\$me: can't locate home directory for: \$name" >&2
3125 echo \$dir/\`$expr x\$1 : '..[^/]*/\(.*\)'\`
3141 : now set up to get a file name
3145 cat <<'EOSC' >>getfile
3161 expr $fn : '.*(\(.*\)).*' | tr ',' $trnl >getfile.ok
3162 fn=`echo $fn | sed 's/(.*)//'`
3168 loc_file=`expr $fn : '.*:\(.*\)'`
3169 fn=`expr $fn : '\(.*\):.*'`
3177 */*) fullpath=true;;
3186 *e*) exp_file=true;;
3189 *p*) nopath_ok=true;;
3194 *d*) type='Directory';;
3195 *l*) type='Locate';;
3200 Locate) what='File';;
3205 case "$d_portable" in
3213 while test "$type"; do
3218 true) rp="$rp (~name ok)";;
3221 if test -f UU/getfile.ok && \
3222 $contains "^$ans\$" UU/getfile.ok >/dev/null 2>&1
3241 value=`UU/filexp $ans`
3244 if test "$ans" != "$value"; then
3245 echo "(That expands to $value on this system.)"
3259 /*) value="$ansexp" ;;
3264 echo "I shall only accept a full path name, as in /bin/ls." >&4
3265 echo "Use a ! shell escape if you wish to check pathnames." >&4
3268 echo "Please give a full path name, starting with slash." >&4
3271 echo "Note that using ~name is ok provided it expands well." >&4
3284 for fp in $gfpth; do
3285 if test "X$fp" = X.; then
3290 if test -f "$pf"; then
3292 elif test -r "$pf" || (test -h "$pf") >/dev/null 2>&1
3294 echo "($value is not a plain file, but that's ok.)"
3297 if test X"$type" = X; then
3304 for fp in $gfpth; do
3305 if test "X$fp" = X.; then
3310 if test -d "$pf"; then
3318 if test -d "$ansexp"; then
3319 echo "(Looking for $loc_file in directory $value.)"
3320 value="$value/$loc_file"
3321 ansexp="$ansexp/$loc_file"
3323 if test -f "$ansexp"; then
3326 case "$nopath_ok" in
3327 true) case "$value" in
3329 *) echo "Assuming $value will be in people's path."
3345 if test "$fastread" = yes; then
3350 rp="$what $value doesn't exist. Use that name anyway?"
3369 test "X$gfpthkeep" != Xy && gfpth=""
3372 : What should the include directory be ?
3374 $echo $n "Hmm... $c"
3378 if $test -f /bin/mips && /bin/mips; then
3379 echo "Looks like a MIPS system..."
3380 $cat >usr.c <<'EOCP'
3381 #ifdef SYSTYPE_BSD43
3385 if $cc -E usr.c > usr.out && $contains / usr.out >/dev/null 2>&1; then
3386 dflt='/bsd43/usr/include'
3390 mips_type='System V'
3392 $rm -f usr.c usr.out
3393 echo "and you're compiling with the $mips_type compiler and libraries."
3397 echo "Doesn't look like a MIPS system."
3407 case "$xxx_prompt" in
3410 rp='Where are the include files you want to use?'
3418 : see how we invoke the C preprocessor
3420 echo "Now, how can we feed standard input to your C preprocessor..." >&4
3421 cat <<'EOT' >testcpp.c
3427 if test ! -f cppstdin; then
3428 if test "X$osname" = "Xaix" -a "X$gccversion" = X; then
3429 # AIX cc -E doesn't show the absolute headerfile
3430 # locations but we'll cheat by using the -M flag.
3431 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
3433 echo 'cat >.$$.c; '"$cc"' -E ${1+"$@"} .$$.c; rm .$$.c' >cppstdin
3436 echo "Keeping your $hint cppstdin wrapper."
3439 wrapper=`pwd`/cppstdin
3443 if $test "X$cppstdin" != "X" && \
3444 $cppstdin $cppminus <testcpp.c >testcpp.out 2>&1 && \
3445 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
3447 echo "You used to use $cppstdin $cppminus so we'll use that again."
3449 '') echo "But let's see if we can live without a wrapper..." ;;
3451 if $cpprun $cpplast <testcpp.c >testcpp.out 2>&1 && \
3452 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
3454 echo "(And we'll use $cpprun $cpplast to preprocess directly.)"
3457 echo "(However, $cpprun $cpplast does not work, let's see...)"
3465 echo "Good old $cppstdin $cppminus does not seem to be of any help..."
3472 elif echo 'Maybe "'"$cc"' -E" will work...'; \
3473 $cc -E <testcpp.c >testcpp.out 2>&1; \
3474 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3475 echo "Yup, it does."
3478 elif echo 'Nope...maybe "'"$cc"' -E -" will work...'; \
3479 $cc -E - <testcpp.c >testcpp.out 2>&1; \
3480 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3481 echo "Yup, it does."
3484 elif echo 'Nope...maybe "'"$cc"' -P" will work...'; \
3485 $cc -P <testcpp.c >testcpp.out 2>&1; \
3486 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3487 echo "Yipee, that works!"
3490 elif echo 'Nope...maybe "'"$cc"' -P -" will work...'; \
3491 $cc -P - <testcpp.c >testcpp.out 2>&1; \
3492 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3493 echo "At long last!"
3496 elif echo 'No such luck, maybe "'$cpp'" will work...'; \
3497 $cpp <testcpp.c >testcpp.out 2>&1; \
3498 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3502 elif echo 'Nixed again...maybe "'$cpp' -" will work...'; \
3503 $cpp - <testcpp.c >testcpp.out 2>&1; \
3504 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3505 echo "Hooray, it works! I was beginning to wonder."
3508 elif echo 'Uh-uh. Time to get fancy. Trying a wrapper...'; \
3509 $wrapper <testcpp.c >testcpp.out 2>&1; \
3510 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3516 rp="No dice. I can't find a C preprocessor. Name one:"
3520 $x_cpp <testcpp.c >testcpp.out 2>&1
3521 if $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3522 echo "OK, that will do." >&4
3524 echo "Sorry, I can't get that to work. Go find one and rerun Configure." >&4
3539 echo "Perhaps can we force $cc -E using a wrapper..."
3540 if $wrapper <testcpp.c >testcpp.out 2>&1; \
3541 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
3547 echo "Nope, we'll have to live without it..."
3561 "$wrapper"|'cppstdin') ;;
3562 *) $rm -f $wrapper;;
3564 $rm -f testcpp.c testcpp.out
3566 : Set private lib path
3569 plibpth="$incpath/usr/lib /usr/local/lib /usr/ccs/lib"
3574 '') dlist="$loclibpth $plibpth $glibpth";;
3575 *) dlist="$libpth";;
3578 : Now check and see which directories actually exist, avoiding duplicates
3582 if $test -d $xxx; then
3585 *) libpth="$libpth $xxx";;
3591 Some systems have incompatible or broken versions of libraries. Among
3592 the directories listed in the question below, please remove any you
3593 know not to be holding relevant libraries, and add any that are needed.
3594 Say "none" for none.
3605 rp="Directories to use for library searches?"
3612 : compute shared library extension
3615 if xxx=`./loc libc.sl X $libpth`; $test -f "$xxx"; then
3625 On some systems, shared libraries may be available. Answer 'none' if
3626 you want to suppress searching of shared libraries for the remainder
3627 of this configuration.
3630 rp='What is the file extension used for shared libraries?'
3634 : Define several unixisms.
3635 : Hints files or command line option can be used to override them.
3636 : The convoluted testing is in case hints files set either the old
3639 '') case "$exe_ext" in
3641 *) _exe="$exe_ext" ;;
3646 '') case "$lib_ext" in
3653 '') case "$obj_ext" in
3660 '') case "$path_sep" in
3671 : Which makefile gets called first. This is used by make depend.
3672 case "$firstmakefile" in
3673 '') firstmakefile='makefile';;
3677 $define|true|[yY]*) dflt='y';;
3682 Perl can be built to use the SOCKS proxy protocol library. To do so,
3683 Configure must be run with -Dusesocks.
3685 If this doesn't make any sense to you, just accept the default '$dflt'.
3687 rp='Build Perl for SOCKS?'
3690 y|Y) val="$define" ;;
3696 : Looking for optional libraries
3698 echo "Checking for optional libraries..." >&4
3703 case "$libswanted" in
3704 '') libswanted='c_s';;
3708 libswanted="$libswanted socks5 socks5_sh"
3715 for thisdir in $libpth $xlibpth; do
3716 test -d $thisdir && libspath="$libspath $thisdir"
3718 for thislib in $libswanted; do
3719 for thisdir in $libspath; do
3721 if $test ! -f "$xxx" -a "X$ignore_versioned_solibs" = "X"; then
3722 xxx=`ls $thisdir/lib$thislib.$so.[0-9] 2>/dev/null|tail -1`
3723 $test -f "$xxx" && eval $libscheck
3724 $test -f "$xxx" && libstyle=shared
3726 if test ! -f "$xxx"; then
3727 xxx=$thisdir/lib$thislib.$so
3728 $test -f "$xxx" && eval $libscheck
3729 $test -f "$xxx" && libstyle=shared
3731 if test ! -f "$xxx"; then
3732 xxx=$thisdir/lib$thislib$_a
3733 $test -f "$xxx" && eval $libscheck
3734 $test -f "$xxx" && libstyle=static
3736 if test ! -f "$xxx"; then
3737 xxx=$thisdir/$thislib$_a
3738 $test -f "$xxx" && eval $libscheck
3739 $test -f "$xxx" && libstyle=static
3741 if test ! -f "$xxx"; then
3742 xxx=$thisdir/lib${thislib}_s$_a
3743 $test -f "$xxx" && eval $libscheck
3744 $test -f "$xxx" && libstyle=static
3745 $test -f "$xxx" && thislib=${thislib}_s
3747 if test ! -f "$xxx"; then
3748 xxx=$thisdir/Slib$thislib$_a
3749 $test -f "$xxx" && eval $libscheck
3750 $test -f "$xxx" && libstyle=static
3752 if $test -f "$xxx"; then
3754 shared) echo "Found -l$thislib (shared)." ;;
3755 static) echo "Found -l$thislib." ;;
3756 *) echo "Found -l$thislib ($libstyle)." ;;
3760 *) dflt="$dflt -l$thislib"
3761 libsfound="$libsfound $xxx"
3763 libsfiles="$libsfiles $yyy"
3764 yyy=`echo $xxx|$sed -e "s%/$yyy\\$%%"`
3765 case " $libsdirs " in
3767 *) libsdirs="$libsdirs $yyy" ;;
3774 if $test ! -f "$xxx"; then
3775 echo "No -l$thislib."
3786 ' '|'') dflt='none';;
3791 In order to compile $package on your machine, a number of libraries
3792 are usually needed. Include any other special libraries here as well.
3793 Say "none" for none. The default list is almost always right.
3797 rp="What libraries to use?"
3804 : determine optimization, if desired, or use for debug flag also
3806 ' '|$undef) dflt='none';;
3808 *) dflt="$optimize";;
3812 By default, $package compiles with the -O flag to use the optimizer.
3813 Alternately, you might want to use the symbolic debugger, which uses
3814 the -g flag (on traditional Unix systems). Either flag can be
3815 specified here. To use neither flag, specify the word "none".
3818 rp="What optimizer/debugger flag should be used?"
3822 'none') optimize=" ";;
3826 : We will not override a previous value, but we might want to
3827 : augment a hint file
3829 default|recommended)
3830 case "$gccversion" in
3831 1*) dflt='-fpcc-struct-return' ;;
3834 *-g*) dflt="$dflt -DDEBUGGING";;
3836 case "$gccversion" in
3837 2*) if test -d /etc/conf/kconfig.d &&
3838 $contains _POSIX_VERSION $usrinc/sys/unistd.h >/dev/null 2>&1
3844 case "$gccversion" in
3848 echo "Checking if your compiler accepts -fno-strict-aliasing" 2>&1
3849 echo 'int main(void) { return 0; }' > gcctest.c
3850 if $cc -O2 -fno-strict-aliasing -o gcctest gcctest.c; then
3851 echo "Yes, it does." 2>&1
3854 echo "Leaving current flags $ccflags alone." 2>&1
3856 *) dflt="$dflt -fno-strict-aliasing" ;;
3859 echo "Nope, it doesn't, but that's ok." 2>&1
3866 case "$mips_type" in
3867 *BSD*|'') inclwanted="$locincpth $usrinc";;
3868 *) inclwanted="$locincpth $inclwanted $usrinc/bsd";;
3870 for thisincl in $inclwanted; do
3871 if $test -d $thisincl; then
3872 if $test x$thisincl != x$usrinc; then
3875 *) dflt="$dflt -I$thisincl";;
3881 inctest='if $contains $2 $usrinc/$1 >/dev/null 2>&1; then
3883 elif $contains $2 $usrinc/sys/$1 >/dev/null 2>&1; then
3891 *) dflt="$dflt -D$2";;
3895 set signal.h LANGUAGE_C; eval $inctest
3899 ccflags="$ccflags -DSOCKS"
3904 default|recommended) dflt="$ccflags $dflt" ;;
3905 *) dflt="$ccflags";;
3913 Your C compiler may want other flags. For this question you should include
3914 -I/whatever and -DWHATEVER flags and any other flags used by the C compiler,
3915 but you should NOT include libraries or ld flags like -lwhatever. If you
3916 want $package to honor its debug switch, you should include -DDEBUGGING here.
3917 Your C compiler might also need additional flags, such as -D_POSIX_SOURCE.
3919 To use no flags, specify the word "none".
3925 rp="Any additional cc flags?"
3932 : the following weeds options from ccflags that are of no interest to cpp
3934 case "$gccversion" in
3935 1*) cppflags="$cppflags -D__GNUC__"
3937 case "$mips_type" in
3939 *BSD*) cppflags="$cppflags -DSYSTYPE_BSD43";;
3945 echo "Let me guess what the preprocessor flags are..." >&4
3959 *) ftry="$previous $flag";;
3961 if $cppstdin -DLFRULB=bar $cppflags $ftry $cppminus <cpp.c \
3962 >cpp1.out 2>/dev/null && \
3963 $cpprun -DLFRULB=bar $cppflags $ftry $cpplast <cpp.c \
3964 >cpp2.out 2>/dev/null && \
3965 $contains 'foo.*xx.*bar' cpp1.out >/dev/null 2>&1 && \
3966 $contains 'foo.*xx.*bar' cpp2.out >/dev/null 2>&1
3968 cppflags="$cppflags $ftry"
3978 *-*) echo "They appear to be: $cppflags";;
3980 $rm -f cpp.c cpp?.out
3984 : flags used in final linking phase
3986 '') if ./venix; then
3992 *-posix*) dflt="$dflt -posix" ;;
3995 *) dflt="$ldflags";;
3998 : Try to guess additional flags to pick up local libraries.
3999 for thislibdir in $libpth; do
4000 case " $loclibpth " in
4003 *"-L$thislibdir "*) ;;
4004 *) dflt="$dflt -L$thislibdir" ;;
4016 Your C linker may need flags. For this question you should
4017 include -L/whatever and any other flags used by the C linker, but you
4018 should NOT include libraries like -lwhatever.
4020 Make sure you include the appropriate -L/path flags if your C linker
4021 does not normally search all of the directories you specified above,
4024 To use no flags, specify the word "none".
4028 rp="Any additional ld flags (NOT including libraries)?"
4034 rmlist="$rmlist pdp11"
4038 echo "Checking your choice of C compiler and flags for coherency..." >&4
4039 $cat > try.c <<'EOF'
4041 int main() { printf("Ok\n"); exit(0); }
4043 set X $cc $optimize $ccflags -o try $ldflags try.c $libs
4045 $cat >try.msg <<'EOM'
4046 I've tried to compile and run the following simple program:
4049 $cat try.c >> try.msg
4051 $cat >> try.msg <<EOM
4058 and I got the following output:
4062 if sh -c "$cc $optimize $ccflags -o try $ldflags try.c $libs" >>try.msg 2>&1; then
4063 if sh -c './try' >>try.msg 2>&1; then
4067 *) echo 'The program compiled OK, but produced no output.' >> try.msg
4070 cat >> try.msg <<'EOQS'
4071 If $libs contains -lsfio, and sfio is mis-configured, then it
4072 sometimes (apparently) runs and exits with a 0 status, but with no
4073 output! It may have to do with sfio's use of _exit vs. exit.
4076 rp="You have a big problem. Shall I abort Configure"
4083 echo "The program compiled OK, but exited with status $?." >>try.msg
4084 rp="You have a problem. Shall I abort Configure"
4088 echo "I can't compile the test program." >>try.msg
4089 rp="You have a BIG problem. Shall I abort Configure"
4095 case "$knowitall" in
4097 echo "(The supplied flags or libraries might be incorrect.)"
4105 *) echo "Ok. Stopping Configure." >&4
4110 n) echo "OK, that should do.";;
4112 $rm -f try try.* core
4114 : define an is-a-typedef? function
4115 typedef='type=$1; var=$2; def=$3; shift; shift; shift; inclist=$@;
4117 "") inclist="sys/types.h";;
4119 eval "varval=\$$var";
4123 for inc in $inclist; do
4124 echo "#include <$inc>" >>temp.c;
4126 echo "#ifdef $type" >> temp.c;
4127 echo "printf(\"We have $type\");" >> temp.c;
4128 echo "#endif" >> temp.c;
4129 $cppstdin $cppflags $cppminus < temp.c >temp.E 2>/dev/null;
4130 if $contains $type temp.E >/dev/null 2>&1; then
4136 *) eval "$var=\$varval";;
4139 : define an is-a-typedef? function that prompts if the type is not available.
4140 typedef_ask='type=$1; var=$2; def=$3; shift; shift; shift; inclist=$@;
4142 "") inclist="sys/types.h";;
4144 eval "varval=\$$var";
4148 for inc in $inclist; do
4149 echo "#include <$inc>" >>temp.c;
4151 echo "#ifdef $type" >> temp.c;
4152 echo "printf(\"We have $type\");" >> temp.c;
4153 echo "#endif" >> temp.c;
4154 $cppstdin $cppflags $cppminus < temp.c >temp.E 2>/dev/null;
4156 echo "$rp" | $sed -e "s/What is/Looking for/" -e "s/?/./";
4157 if $contains $type temp.E >/dev/null 2>&1; then
4158 echo "$type found." >&4;
4161 echo "$type NOT found." >&4;
4167 *) eval "$var=\$varval";;
4170 : define a shorthand compile call
4174 $cc $optimize $ccflags $ldflags -o ${mc_file} $* ${mc_file}.c $libs > /dev/null 2>&1;'
4175 : define a shorthand compile call for compilations that should be ok.
4179 $cc $optimize $ccflags $ldflags -o ${mc_file} $* ${mc_file}.c $libs;'
4181 : check for lengths of integral types
4185 echo "Checking to see how big your integers are..." >&4
4186 $cat >intsize.c <<'EOCP'
4190 printf("intsize=%d;\n", (int)sizeof(int));
4191 printf("longsize=%d;\n", (int)sizeof(long));
4192 printf("shortsize=%d;\n", (int)sizeof(short));
4197 if eval $compile_ok && ./intsize > /dev/null; then
4199 echo "Your integers are $intsize bytes long."
4200 echo "Your long integers are $longsize bytes long."
4201 echo "Your short integers are $shortsize bytes long."
4205 Help! I can't compile and run the intsize test program: please enlighten me!
4206 (This is probably a misconfiguration in your system or libraries, and
4207 you really ought to fix it. Still, I'll try anyway.)
4211 rp="What is the size of an integer (in bytes)?"
4215 rp="What is the size of a long integer (in bytes)?"
4219 rp="What is the size of a short integer (in bytes)?"
4225 $rm -f intsize intsize.*
4227 : see what type lseek is declared as in the kernel
4228 rp="What is the type used for lseek's offset on this system?"
4229 set off_t lseektype long stdio.h sys/types.h
4233 echo "Checking to see how big your file offsets are..." >&4
4235 #include <sys/types.h>
4239 printf("%d\n", (int)sizeof($lseektype));
4244 if eval $compile_ok; then
4246 echo "Your file offsets are $lseeksize bytes long."
4250 echo "(I can't seem to compile the test program. Guessing...)"
4251 rp="What is the size of your file offsets (in bytes)?"
4257 : see what type file positions are declared as in the library
4258 rp="What is the type for file position used by fsetpos()?"
4259 set fpos_t fpostype long stdio.h sys/types.h
4264 *_t) zzz="$fpostype" ;;
4267 echo "Checking the size of $zzz..." >&4
4269 #include <sys/types.h>
4272 printf("%d\n", (int)sizeof($fpostype));
4277 if eval $compile_ok; then
4281 echo "(I can't execute the test program--guessing $fpossize.)" >&4
4284 echo "Your $zzz is $fpossize bytes long."
4290 echo "(I can't compile the test program. Guessing...)" >&4
4291 rp="What is the size of your file positions (in bytes)?"
4298 # Backward compatibility (uselfs is deprecated).
4300 "$define"|true|[yY]*)
4303 *** Configure -Duselfs is deprecated, using -Duselargefiles instead.
4305 uselargefiles="$define"
4309 case "$lseeksize:$fpossize" in
4312 You can have files larger than 2 gigabytes.
4315 *) case "$uselargefiles" in
4316 "$undef"|false|[nN]*) dflt='n' ;;
4321 Perl can be built to understand large files (files larger than 2 gigabytes)
4322 on some systems. To do so, Configure can be run with -Duselargefiles.
4324 If this doesn't make any sense to you, just accept the default '$dflt'.
4326 rp='Try to understand large files, if available?'
4329 y|Y) val="$define" ;;
4336 case "$uselargefiles" in
4338 : Look for a hint-file generated 'call-back-unit'. If the
4339 : user has specified that a large files perl is to be built,
4340 : we may need to set or change some other defaults.
4341 if $test -f uselfs.cbu; then
4342 echo "Your platform has some specific hints for large file builds, using them..."
4345 echo "Rechecking to see how big your file offsets are..." >&4
4347 #include <sys/types.h>
4351 printf("%d\n", (int)sizeof($lseektype));
4356 if eval $compile_ok; then
4358 $echo "Your file offsets are now $lseeksize bytes long."
4362 echo "(I can't seem to compile the test program. Guessing...)"
4363 rp="What is the size of your file offsets (in bytes)?"
4368 *_t) zzz="$fpostype" ;;
4371 $echo $n "Rechecking the size of $zzz...$c" >&4
4373 #include <sys/types.h>
4376 printf("%d\n", (int)sizeof($fpostype));
4381 if eval $compile_ok; then
4386 echo "(I can't execute the test program--guessing $fpossize.)" >&4
4389 echo " $fpossize bytes." >&4
4395 echo "(I can't compile the test program. Guessing...)" >&4
4396 rp="What is the size of your file positions (in bytes)?"
4406 case "$usemorebits" in
4407 "$define"|true|[yY]*)
4408 use64bitint="$define"
4409 uselongdouble="$define"
4410 usemorebits="$define"
4412 *) usemorebits="$undef"
4417 # Backward compatibility (uselonglong is deprecated).
4418 case "$uselonglong" in
4419 "$define"|true|[yY]*)
4422 *** Configure -Duselonglong is deprecated, using -Duse64bitint instead.
4424 use64bitint="$define"
4427 # Backward compatibility (use64bits is deprecated).
4428 case "$use64bits" in
4429 "$define"|true|[yY]*)
4432 *** Configure -Duse64bits is deprecated, using -Duse64bitint instead.
4434 use64bitint="$define"
4437 # Thinko compatibilities.
4438 case "$use64bitints" in
4439 "$define"|true|[yY]*)
4442 *** There is no Configure -Duse64bitints, using -Duse64bitint instead.
4444 use64bitint="$define"
4447 case "$use64bitsall" in
4448 "$define"|true|[yY]*)
4451 *** There is no Configure -Duse64bitsall, using -Duse64bitall instead.
4453 use64bitall="$define"
4458 *-DUSE_LONG_LONG*|*-DUSE_64_BIT_INT*|*-DUSE_64_BIT_ALL*) use64bitint="$define";;
4460 case "$use64bitall" in
4461 "$define"|true|[yY]*) use64bitint="$define" ;;
4467 You have natively 64-bit long integers.
4471 *) case "$use64bitint" in
4472 "$define"|true|[yY]*) dflt='y';;
4477 Perl can be built to take advantage of 64-bit integer types
4478 on some systems. To do so, Configure can be run with -Duse64bitint.
4479 Choosing this option will most probably introduce binary incompatibilities.
4481 If this doesn't make any sense to you, just accept the default '$dflt'.
4483 rp='Try to use 64-bit integers, if available?'
4486 [yY]*) val="$define" ;;
4496 You may also choose to try maximal 64-bitness. It means using as much
4497 64-bitness as possible on the platform. This in turn means even more
4498 binary incompatibilities. On the other hand, your platform may not
4499 have any more 64-bitness available than what you already have chosen.
4501 If this doesn't make any sense to you, just accept the default '$dflt'.
4503 rp='Try to use maximal 64-bit support, if available?'
4504 case "$use64bitall" in
4505 "$define"|true|[yY]*) dflt='y' ;;
4506 *) case "$longsize" in
4514 [yY]*) val="$define" ;;
4519 case "$use64bitall" in
4521 case "$use64bitint" in
4525 Since you have chosen a maximally 64-bit build, I'm also turning on
4526 the use of 64-bit integers.
4528 use64bitint="$define" ;;
4533 case "$use64bitint" in
4534 "$define"|true|[yY]*)
4535 : Look for a hint-file generated 'call-back-unit'. If the
4536 : user has specified that a 64-bit perl is to be built,
4537 : we may need to set or change some other defaults.
4538 if $test -f use64bitint.cbu; then
4539 echo "Your platform has some specific hints for 64-bit integers, using them..."
4543 4) case "$archname64" in
4544 '') archname64=64int ;;
4551 case "$use64bitall" in
4552 "$define"|true|[yY]*)
4553 : Look for a hint-file generated 'call-back-unit'. If the
4554 : user has specified that a maximally 64-bit perl is to be built,
4555 : we may need to set or change some other defaults.
4556 if $test -f use64bitall.cbu; then
4557 echo "Your platform has some specific hints for 64-bit builds, using them..."
4561 4) case "$archname64" in
4562 ''|64int) archname64=64all ;;
4569 : determine the architecture name
4571 if xxx=`./loc arch blurfl $pth`; $test -f "$xxx"; then
4572 tarch=`arch`"-$osname"
4573 elif xxx=`./loc uname blurfl $pth`; $test -f "$xxx" ; then
4574 if uname -m > tmparch 2>&1 ; then
4575 tarch=`$sed -e 's/ *$//' -e 's/ /_/g' \
4576 -e 's/$/'"-$osname/" tmparch`
4584 case "$myarchname" in
4587 echo "(Your architecture name used to be $myarchname.)"
4594 *) dflt="$archname";;
4596 rp='What is your architecture name'
4599 case "$usethreads" in
4601 echo "Threads selected." >&4
4603 *-thread*) echo "...and architecture name already has -thread." >&4
4605 *) archname="$archname-thread"
4606 echo "...setting architecture name to $archname." >&4
4611 case "$usemultiplicity" in
4613 echo "Multiplicity selected." >&4
4615 *-multi*) echo "...and architecture name already has -multi." >&4
4617 *) archname="$archname-multi"
4618 echo "...setting architecture name to $archname." >&4
4623 case "$use64bitint" in
4625 case "$archname64" in
4630 *-$archname64*) echo "...and architecture name already has $archname64." >&4
4632 *) archname="$archname-$archname64"
4633 echo "...setting architecture name to $archname." >&4
4640 : determine root of directory hierarchy where package will be installed.
4643 dflt=`./loc . /usr/local /usr/local /local /opt /usr`
4651 By default, $package will be installed in $dflt/bin, manual pages
4652 under $dflt/man, etc..., i.e. with $dflt as prefix for all
4653 installation directories. Typically this is something like /usr/local.
4654 If you wish to have binaries under /usr/bin but other parts of the
4655 installation under /usr/local, that's ok: you will be prompted
4656 separately for each of the installation directories, the prefix being
4657 only used to set the defaults.
4661 rp='Installation prefix to use?'
4669 *) oldprefix="$prefix";;
4679 $define|true) afs=true ;;
4680 $undef|false) afs=false ;;
4681 *) if test -d /afs; then
4689 echo "AFS may be running... I'll be extra cautious then..." >&4
4691 echo "AFS does not seem to be running..." >&4
4694 : determine installation prefix for where package is to be installed.
4698 Since you are running AFS, I need to distinguish the directory in which
4699 files will reside from the directory in which they are installed (and from
4700 which they are presumably copied to the former directory by occult means).
4703 case "$installprefix" in
4704 '') dflt=`echo $prefix | sed 's#^/afs/#/afs/.#'`;;
4705 *) dflt="$installprefix";;
4710 In some special cases, particularly when building $package for distribution,
4711 it is convenient to distinguish between the directory in which files should
4712 be installed from the directory ($prefix) in which they
4713 will eventually reside. For most users, these two directories are the same.
4716 case "$installprefix" in
4718 *) dflt=$installprefix;;
4722 rp='What installation prefix should I use for installing files?'
4724 installprefix="$ans"
4725 installprefixexp="$ansexp"
4727 : set the prefixit variable, to compute a suitable default value
4728 prefixit='case "$3" in
4730 case "$oldprefix" in
4731 "") eval "$1=\"\$$2\"";;
4738 ""|" ") eval "$1=\"\$$2\"";;
4744 eval "tp=\"$oldprefix-\$$2-\""; eval "tp=\"$tp\"";
4746 --|/*--|\~*--) eval "$1=\"$prefix/$3\"";;
4747 /*-$oldprefix/*|\~*-$oldprefix/*)
4748 eval "$1=\`echo \$$2 | sed \"s,^$oldprefix,$prefix,\"\`";;
4749 *) eval "$1=\"\$$2\"";;
4754 : get the patchlevel
4756 echo "Getting the current patchlevel..." >&4
4757 if $test -r $rsrc/patchlevel.h;then
4758 revision=`awk '/define[ ]+PERL_REVISION/ {print $3}' $rsrc/patchlevel.h`
4759 patchlevel=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
4760 subversion=`awk '/define[ ]+PERL_SUBVERSION/ {print $3}' $rsrc/patchlevel.h`
4761 api_revision=`awk '/define[ ]+PERL_API_REVISION/ {print $3}' $rsrc/patchlevel.h`
4762 api_version=`awk '/define[ ]+PERL_API_VERSION/ {print $3}' $rsrc/patchlevel.h`
4763 api_subversion=`awk '/define[ ]+PERL_API_SUBVERSION/ {print $3}' $rsrc/patchlevel.h`
4772 $echo $n "(You have $package revision $revision" $c
4773 $echo $n " patchlevel $patchlevel" $c
4774 test 0 -eq "$subversion" || $echo $n " subversion $subversion" $c
4778 : XXX Should be a Configure test for double-dots in filenames.
4779 version=`echo $revision $patchlevel $subversion | \
4780 $awk '{ printf "%d_%d_%d\n", $1, $2, $3 }'`
4781 api_versionstring=`echo $api_revision $api_version $api_subversion | \
4782 $awk '{ printf "%d_%d_%d\n", $1, $2, $3 }'`
4785 version=`echo $revision $patchlevel $subversion | \
4786 $awk '{ printf "%d.%d.%d\n", $1, $2, $3 }'`
4787 api_versionstring=`echo $api_revision $api_version $api_subversion | \
4788 $awk '{ printf "%d.%d.%d\n", $1, $2, $3 }'`
4791 : Special case the 5.005_xx maintenance series, which used 5.005
4792 : without any subversion label as a subdirectory in $sitelib
4793 if test "${api_revision}${api_version}${api_subversion}" = "550"; then
4794 api_versionstring='5.005'
4797 : determine installation style
4798 : For now, try to deduce it from prefix unless it is already set.
4799 : Reproduce behavior of 5.005 and earlier, maybe drop that in 5.7.
4800 case "$installstyle" in
4801 '') case "$prefix" in
4802 *perl*) dflt='lib';;
4803 *) dflt='lib/perl5' ;;
4806 *) dflt='lib/perl5' ;;
4808 : Probably not worth prompting for this since we prompt for all
4809 : the directories individually, and the prompt would be too long and
4813 : determine where private library files go
4814 : Usual default is /usr/local/lib/perl5/$version.
4815 : Also allow things like /opt/perl/lib/$version, since
4816 : /opt/perl/lib/perl5... would be redundant.
4817 : The default "style" setting is made in installstyle.U
4818 case "$installstyle" in
4819 *lib/perl5*) set dflt privlib lib/$package/$version ;;
4820 *) set dflt privlib lib/$version ;;
4825 There are some auxiliary files for $package that need to be put into a
4826 private library directory that is accessible by everyone.
4830 rp='Pathname where the private library files will reside?'
4833 privlibexp="$ansexp"
4834 : Change installation prefix, if necessary.
4835 if $test X"$prefix" != X"$installprefix"; then
4836 installprivlib=`echo $privlibexp | sed "s#^$prefix#$installprefix#"`
4838 installprivlib="$privlibexp"
4841 : set the prefixup variable, to restore leading tilda escape
4842 prefixup='case "$prefixexp" in
4844 *) eval "$1=\`echo \$$1 | sed \"s,^$prefixexp,$prefix,\"\`";;
4847 : determine where public architecture dependent libraries go
4850 : privlib default is /usr/local/lib/$package/$version
4851 : archlib default is /usr/local/lib/$package/$version/$archname
4852 : privlib may have an optional trailing /share.
4853 tdflt=`echo $privlib | $sed 's,/share$,,'`
4854 tdflt=$tdflt/$archname
4863 $spackage contains architecture-dependent library files. If you are
4864 sharing libraries in a heterogeneous environment, you might store
4865 these files in a separate location. Otherwise, you can just include
4866 them with the rest of the public library files.
4870 rp='Where do you want to put the public architecture-dependent libraries?'
4873 archlibexp="$ansexp"
4874 if $test X"$archlib" = X"$privlib"; then
4879 : Change installation prefix, if necessary.
4880 if $test X"$prefix" != X"$installprefix"; then
4881 installarchlib=`echo $archlibexp | sed "s#^$prefix#$installprefix#"`
4883 installarchlib="$archlibexp"
4887 : Binary compatibility with 5.005 is not possible for builds
4888 : with advanced features
4889 case "$usethreads$usemultiplicity" in
4891 bincompat5005="$undef"
4892 d_bincompat5005="$undef"
4896 Perl 5.006 can be compiled for binary compatibility with 5.005.
4897 If you decide to do so, you will be able to continue using most
4898 of the extensions that were compiled for Perl 5.005.
4901 case "$bincompat5005$d_bincompat5005" in
4902 *"$undef"*) dflt=n ;;
4905 rp='Binary compatibility with Perl 5.005?'
4908 y*) val="$define" ;;
4913 case "$d_bincompat5005" in
4915 bincompat5005="$define"
4917 *) bincompat5005="$undef"
4918 d_bincompat5005="$undef"
4925 : see if setuid scripts can be secure
4928 Some kernels have a bug that prevents setuid #! scripts from being
4929 secure. Some sites have disabled setuid #! scripts because of this.
4931 First let's decide if your kernel supports secure setuid #! scripts.
4932 (If setuid #! scripts would be secure but have been disabled anyway,
4933 don't say that they are secure if asked.)
4938 if $test -d /dev/fd; then
4939 echo "#!$ls" >reflect
4940 chmod +x,u+s reflect
4941 ./reflect >flect 2>&1
4942 if $contains "/dev/fd" flect >/dev/null; then
4943 echo "Congratulations, your kernel has secure setuid scripts!" >&4
4947 If you are not sure if they are secure, I can check but I'll need a
4948 username and password different from the one you are using right now.
4949 If you don't have such a username or don't want me to test, simply
4953 rp='Other username to test security of setuid scripts with?'
4958 case "$d_suidsafe" in
4959 '') echo "I'll assume setuid scripts are *not* secure." >&4
4962 echo "Well, the $hint value is *not* secure." >&4
4964 *) echo "Well, the $hint value *is* secure." >&4
4969 $rm -f reflect flect
4970 echo "#!$ls" >reflect
4971 chmod +x,u+s reflect
4974 echo '"su" will (probably) prompt you for '"$ans's password."
4975 su $ans -c './reflect >flect'
4976 if $contains "/dev/fd" flect >/dev/null; then
4977 echo "Okay, it looks like setuid scripts are secure." >&4
4980 echo "I don't think setuid scripts are secure." >&4
4985 rp='Does your kernel have *secure* setuid scripts?'
4988 [yY]*) val="$define";;
4993 echo "I don't think setuid scripts are secure (no /dev/fd directory)." >&4
4994 echo "(That's for file descriptors, not floppy disks.)"
5000 $rm -f reflect flect
5002 : now see if they want to do setuid emulation
5005 case "$d_suidsafe" in
5008 echo "No need to emulate SUID scripts since they are secure here." >& 4
5012 Some systems have disabled setuid scripts, especially systems where
5013 setuid scripts cannot be secure. On systems where setuid scripts have
5014 been disabled, the setuid/setgid bits on scripts are currently
5015 useless. It is possible for $package to detect those bits and emulate
5016 setuid/setgid in a secure fashion. This emulation will only work if
5017 setuid scripts have been disabled in your kernel.
5021 "$define") dflt=y ;;
5024 rp="Do you want to do setuid/setgid emulation?"
5027 [yY]*) val="$define";;
5035 : determine filename position in cpp output
5037 echo "Computing filename position in cpp output for #include directives..." >&4
5038 echo '#include <stdio.h>' > foo.c
5041 $cppstdin $cppflags $cppminus <foo.c 2>/dev/null | \
5042 $grep '^[ ]*#.*stdio\.h' | \
5043 while read cline; do
5046 while $test \$# -gt 0; do
5047 if $test -r \`echo \$1 | $tr -d '"'\`; then
5052 pos=\`expr \$pos + 1\`
5064 *) pos="${fieldn}th";;
5066 echo "Your cpp writes the filename in the $pos field of the line."
5068 : locate header file
5073 for usrincdir in $usrinc
5075 if test -f \$usrincdir/\$wanted; then
5076 echo "\$usrincdir/\$wanted"
5080 awkprg='{ print \$$fieldn }'
5081 echo "#include <\$wanted>" > foo\$\$.c
5082 $cppstdin $cppminus $cppflags < foo\$\$.c 2>/dev/null | \
5083 $grep "^[ ]*#.*\$wanted" | \
5084 while read cline; do
5085 name=\`echo \$cline | $awk "\$awkprg" | $tr -d '"'\`
5087 *[/\\\\]\$wanted) echo "\$name"; exit 1;;
5088 *[\\\\/]\$wanted) echo "\$name"; exit 1;;
5093 # status = 0: grep returned 0 lines, case statement not executed
5094 # status = 1: headerfile found
5095 # status = 2: while loop executed, no headerfile found
5099 if test \$status -eq 1; then
5106 : define an alternate in-header-list? function
5107 inhdr='echo " "; td=$define; tu=$undef; yyy=$@;
5108 cont=true; xxf="echo \"<\$1> found.\" >&4";
5109 case $# in 2) xxnf="echo \"<\$1> NOT found.\" >&4";;
5110 *) xxnf="echo \"<\$1> NOT found, ...\" >&4";;
5112 case $# in 4) instead=instead;; *) instead="at last";; esac;
5113 while $test "$cont"; do
5115 var=$2; eval "was=\$$2";
5116 if $test "$xxx" && $test -r "$xxx";
5118 eval "case \"\$$var\" in $undef) . ./whoa; esac"; eval "$var=\$td";
5121 eval "case \"\$$var\" in $define) . ./whoa; esac"; eval "$var=\$tu"; fi;
5122 set $yyy; shift; shift; yyy=$@;
5123 case $# in 0) cont="";;
5124 2) xxf="echo \"but I found <\$1> $instead.\" >&4";
5125 xxnf="echo \"and I did not find <\$1> either.\" >&4";;
5126 *) xxf="echo \"but I found <\$1\> instead.\" >&4";
5127 xxnf="echo \"there is no <\$1>, ...\" >&4";;
5131 do set $yyy; var=$2; eval "was=\$$2";
5132 eval "case \"\$$var\" in $define) . ./whoa; esac"; eval "$var=\$tu";
5133 set $yyy; shift; shift; yyy=$@;
5136 : see if this is a malloc.h system
5137 set malloc.h i_malloc
5140 : see if stdlib is available
5141 set stdlib.h i_stdlib
5144 : determine which malloc to compile in
5146 case "$usemymalloc" in
5147 ''|[yY]*|true|$define) dflt='y' ;;
5150 rp="Do you wish to attempt to use the malloc that comes with $package?"
5156 mallocsrc='malloc.c'
5157 mallocobj="malloc$_o"
5158 d_mymalloc="$define"
5161 : Remove malloc from list of libraries to use
5162 echo "Removing unneeded -lmalloc from library list" >&4
5163 set `echo X $libs | $sed -e 's/-lmalloc / /' -e 's/-lmalloc$//'`
5166 echo "libs = $libs" >&4
5178 : compute the return types of malloc and free
5180 $cat >malloc.c <<END
5184 #include <sys/types.h>
5198 case "$malloctype" in
5200 if $cc $ccflags -c -DTRY_MALLOC malloc.c >/dev/null 2>&1; then
5207 echo "Your system wants malloc to return '$malloctype', it would seem." >&4
5211 if $cc $ccflags -c -DTRY_FREE malloc.c >/dev/null 2>&1; then
5218 echo "Your system uses $freetype free(), it would seem." >&4
5222 The installation process will also create a directory for
5223 vendor-supplied add-ons. Vendors who supply perl with their system
5224 may find it convenient to place all vendor-supplied files in this
5225 directory rather than in the main distribution directory. This will
5226 ease upgrades between binary-compatible maintenance versions of perl.
5228 Of course you may also use these directories in whatever way you see
5229 fit. For example, you might use them to access modules shared over a
5230 company-wide network.
5232 The default answer should be fine for most people.
5233 This causes further questions about vendor add-ons to be skipped
5234 and no vendor-specific directories will be configured for perl.
5237 rp='Do you want to configure vendor-specific add-on directories?'
5238 case "$usevendorprefix" in
5239 define|true|[yY]*) dflt=y ;;
5240 *) : User may have set vendorprefix directly on Configure command line.
5241 case "$vendorprefix" in
5250 rp='Installation prefix to use for vendor-supplied add-ons?'
5251 case "$vendorprefix" in
5253 *) dflt=$vendorprefix ;;
5256 : XXX Prefixit unit does not yet support siteprefix and vendorprefix
5258 case "$vendorprefix" in
5262 *) oldvendorprefix="$prefix";;
5266 usevendorprefix="$define"
5268 vendorprefixexp="$ansexp"
5270 *) usevendorprefix="$undef"
5276 case "$vendorprefix" in
5277 '') d_vendorlib="$undef"
5281 *) d_vendorlib="$define"
5282 : determine where vendor-supplied modules go.
5283 : Usual default is /usr/local/lib/perl5/vendor_perl/$version
5284 case "$vendorlib" in
5286 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
5287 case "$installstyle" in
5288 *lib/perl5*) dflt=$vendorprefix/lib/$package/vendor_$prog/$version ;;
5289 *) dflt=$vendorprefix/lib/vendor_$prog/$version ;;
5292 *) dflt="$vendorlib"
5296 rp='Pathname for the vendor-supplied library files?'
5299 vendorlibexp="$ansexp"
5302 : Change installation prefix, if necessary.
5303 if $test X"$prefix" != X"$installprefix"; then
5304 installvendorlib=`echo $vendorlibexp | $sed "s#^$prefix#$installprefix#"`
5306 installvendorlib="$vendorlibexp"
5309 : Cruising for prototypes
5311 echo "Checking out function prototypes..." >&4
5312 $cat >prototype.c <<'EOCP'
5313 int main(int argc, char *argv[]) {
5316 if $cc $ccflags -c prototype.c >prototype.out 2>&1 ; then
5317 echo "Your C compiler appears to support function prototypes."
5320 echo "Your C compiler doesn't seem to understand function prototypes."
5327 case "$prototype" in
5329 *) ansi2knr='ansi2knr'
5334 This version of $package can only be compiled by a compiler that
5335 understands function prototypes. Unfortunately, your C compiler
5337 doesn't seem to understand them. Sorry about that.
5339 If GNU cc is available for your system, perhaps you could try that instead.
5341 Eventually, we hope to support building Perl with pre-ANSI compilers.
5342 If you would like to help in that effort, please contact <perlbug@perl.org>.
5344 Aborting Configure now.
5350 : determine where public executables go
5355 rp='Pathname where the public executables will reside?'
5357 if $test "X$ansexp" != "X$binexp"; then
5362 : Change installation prefix, if necessary.
5363 : XXX Bug? -- ignores Configure -Dinstallprefix setting.
5364 if $test X"$prefix" != X"$installprefix"; then
5365 installbin=`echo $binexp | sed "s#^$prefix#$installprefix#"`
5367 installbin="$binexp"
5370 : Find perl5.005 or later.
5371 echo "Looking for a previously installed perl5.005 or later... "
5373 '') for tdir in `echo "$binexp:$PATH" | $sed "s/$path_sep/ /g"`; do
5374 : Check if this perl is recent and can load a simple module
5375 if $test -x $tdir/perl && $tdir/perl -Mless -e 'use 5.005;' >/dev/null 2>&1; then
5378 elif $test -x $tdir/perl5 && $tdir/perl5 -Mless -e 'use 5.005;' >/dev/null 2>&1; then
5388 '') echo "None found. That's ok.";;
5389 *) echo "Using $perl5." ;;
5394 After $package is installed, you may wish to install various
5395 add-on modules and utilities. Typically, these add-ons will
5396 be installed under $prefix with the rest
5397 of this package. However, you may wish to install such add-ons
5398 elsewhere under a different prefix.
5400 If you do not wish to put everything under a single prefix, that's
5401 ok. You will be prompted for the individual locations; this siteprefix
5402 is only used to suggest the defaults.
5404 The default should be fine for most people.
5408 rp='Installation prefix to use for add-on modules and utilities?'
5409 : XXX Here might be another good place for an installstyle setting.
5410 case "$siteprefix" in
5412 *) dflt=$siteprefix ;;
5415 : XXX Prefixit unit does not yet support siteprefix and vendorprefix
5417 case "$siteprefix" in
5421 *) oldsiteprefix="$prefix";;
5426 siteprefixexp="$ansexp"
5428 : determine where site specific libraries go.
5429 : Usual default is /usr/local/lib/perl5/site_perl/$version
5430 : The default "style" setting is made in installstyle.U
5431 : XXX No longer works with Prefixit stuff.
5432 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
5434 '') case "$installstyle" in
5435 *lib/perl5*) dflt=$siteprefix/lib/$package/site_$prog/$version ;;
5436 *) dflt=$siteprefix/lib/site_$prog/$version ;;
5444 The installation process will create a directory for
5445 site-specific extensions and modules. Most users find it convenient
5446 to place all site-specific files in this directory rather than in the
5447 main distribution directory.
5451 rp='Pathname for the site-specific library files?'
5454 sitelibexp="$ansexp"
5455 : Change installation prefix, if necessary.
5456 if $test X"$prefix" != X"$installprefix"; then
5457 installsitelib=`echo $sitelibexp | $sed "s#^$prefix#$installprefix#"`
5459 installsitelib="$sitelibexp"
5462 : Determine list of previous versions to include in @INC
5463 $cat > getverlist <<EOPL
5466 \$api_versionstring = "$api_versionstring";
5467 \$version = "$version";
5468 \$sitelib = "$sitelib";
5469 \$archname = "$archname";
5471 $cat >> getverlist <<'EOPL'
5472 # Can't have leading @ because metaconfig interprets it as a command!
5473 ;@inc_version_list=();
5474 $stem=dirname($sitelib);
5475 # XXX Redo to do opendir/readdir?
5478 ;@candidates = glob("5.*");
5484 # XXX ToDo: These comparisons must be reworked when two-digit
5485 # subversions come along, so that 5.7.10 compares as greater than
5486 # 5.7.3! By that time, hope that 5.6.x is sufficiently
5487 # widespread that we can use the built-in version vectors rather
5488 # than reinventing them here. For 5.6.0, however, we must
5489 # assume this script will likely be run by 5.005_0x. --AD 1/2000.
5490 foreach $d (@candidates) {
5491 if ($d lt $version) {
5492 if ($d ge $api_versionstring) {
5493 unshift(@inc_version_list, "$d/$archname", $d);
5495 elsif ($d ge "5.005") {
5496 unshift(@inc_version_list, $d);
5500 # Skip newer version. I.e. don't look in
5501 # 5.7.0 if we're installing 5.6.1.
5505 if (@inc_version_list) {
5506 print join(' ', @inc_version_list);
5509 # Blank space to preserve value for next Configure run.
5514 case "$inc_version_list" in
5515 '') if test -x "$perl5"; then
5516 dflt=`$perl5 getverlist`
5521 $undef) dflt='none' ;;
5522 *) dflt="$inc_version_list" ;;
5525 ''|' ') dflt=none ;;
5529 In order to ease the process of upgrading, this version of perl
5530 can be configured to use modules built and installed with earlier
5531 versions of perl that were installed under $prefix. Specify here
5532 the list of earlier versions that this version of perl should check.
5533 If Configure detected no earlier versions of perl installed under
5534 $prefix, then the list will be empty. Answer 'none' to tell perl
5535 to not search earlier versions.
5537 The default should almost always be sensible, so if you're not sure,
5538 just accept the default.
5541 rp='List of earlier versions to include in @INC?'
5544 [Nn]one|''|' ') inc_version_list=' ' ;;
5545 *) inc_version_list="$ans" ;;
5547 case "$inc_version_list" in
5549 inc_version_list_init='0';;
5550 *) inc_version_list_init=`echo $inc_version_list |
5551 $sed -e 's/^/"/' -e 's/ /","/g' -e 's/$/",0/'`
5556 : determine whether to install perl also as /usr/bin/perl
5559 if $test -d /usr/bin -a "X$installbin" != X/usr/bin; then
5561 Many scripts expect to perl to be installed as /usr/bin/perl.
5562 I can install the perl you are about to compile also as /usr/bin/perl
5563 (in addition to $installbin/perl).
5565 case "$installusrbinperl" in
5566 "$undef"|[nN]*) dflt='n';;
5569 rp="Do you want to install perl as /usr/bin/perl?"
5572 [yY]*) val="$define";;
5578 set installusrbinperl
5582 echo "Checking for GNU C Library..." >&4
5583 cat >gnulibc.c <<EOM
5595 if eval $compile_ok && ./gnulibc; then
5597 echo "You are using the GNU C Library"
5600 echo "You are not using the GNU C Library"
5606 : see if nm is to be used to determine whether a symbol is defined or not
5610 case "$d_gnulibc" in
5613 echo "nm probably won't work on the GNU C Library." >&4
5619 if $test "$osname" = aix -a ! -f /lib/syscalls.exp; then
5621 echo "Whoops! This is an AIX system without /lib/syscalls.exp!" >&4
5622 echo "'nm' won't be sufficient on this sytem." >&4
5628 '') dflt=`$egrep 'inlibc|csym' $rsrc/Configure | wc -l 2>/dev/null`
5629 if $test $dflt -gt 20; then
5639 true|$define) dflt=y;;
5646 I can use $nm to extract the symbols from your C libraries. This
5647 is a time consuming task which may generate huge output on the disk (up
5648 to 3 megabytes) but that should make the symbols extraction faster. The
5649 alternative is to skip the 'nm' extraction part and to compile a small
5650 test program instead to determine whether each symbol is present. If
5651 you have a fast C compiler and/or if your 'nm' output cannot be parsed,
5652 this may be the best solution.
5654 You probably shouldn't let me use 'nm' if you are using the GNU C Library.
5657 rp="Shall I use $nm to extract C symbols from the libraries?"
5660 [Nn]*) usenm=false;;
5669 : nm options which may be necessary
5671 '') if $test -f /mach_boot; then
5673 elif $test -d /usr/ccs/lib; then
5674 nm_opt='-p' # Solaris (and SunOS?)
5675 elif $test -f /dgux; then
5677 elif $test -f /lib64/rld; then
5678 nm_opt='-p' # 64-bit Irix
5684 : nm options which may be necessary for shared libraries but illegal
5685 : for archive libraries. Thank you, Linux.
5686 case "$nm_so_opt" in
5687 '') case "$myuname" in
5689 if $nm --help | $grep 'dynamic' > /dev/null 2>&1; then
5690 nm_so_opt='--dynamic'
5699 : get list of predefined functions in a handy place
5704 *-lc_s*) libc=`./loc libc_s$_a $libc $libpth`
5711 *) for thislib in $libs; do
5714 : Handle C library specially below.
5717 thislib=`echo $thislib | $sed -e 's/^-l//'`
5718 if try=`./loc lib$thislib.$so.'*' X $libpth`; $test -f "$try"; then
5720 elif try=`./loc lib$thislib.$so X $libpth`; $test -f "$try"; then
5722 elif try=`./loc lib$thislib$_a X $libpth`; $test -f "$try"; then
5724 elif try=`./loc $thislib$_a X $libpth`; $test -f "$try"; then
5726 elif try=`./loc lib$thislib X $libpth`; $test -f "$try"; then
5728 elif try=`./loc $thislib X $libpth`; $test -f "$try"; then
5730 elif try=`./loc Slib$thislib$_a X $xlibpth`; $test -f "$try"; then
5735 libnames="$libnames $try"
5737 *) libnames="$libnames $thislib" ;;
5746 for xxx in $libpth; do
5747 $test -r $1 || set $xxx/libc.$so
5748 : The messy sed command sorts on library version numbers.
5750 set `echo blurfl; echo $xxx/libc.$so.[0-9]* | \
5751 tr ' ' $trnl | egrep -v '\.[A-Za-z]*$' | $sed -e '
5753 s/[0-9][0-9]*/0000&/g
5754 s/0*\([0-9][0-9][0-9][0-9][0-9]\)/\1/g
5757 sort | $sed -e 's/^.* //'`
5760 $test -r $1 || set /usr/ccs/lib/libc.$so
5761 $test -r $1 || set /lib/libsys_s$_a
5767 if $test -r "$1"; then
5768 echo "Your (shared) C library seems to be in $1."
5770 elif $test -r /lib/libc && $test -r /lib/clib; then
5771 echo "Your C library seems to be in both /lib/clib and /lib/libc."
5773 libc='/lib/clib /lib/libc'
5774 if $test -r /lib/syslib; then
5775 echo "(Your math library is in /lib/syslib.)"
5776 libc="$libc /lib/syslib"
5778 elif $test -r "$libc" || (test -h "$libc") >/dev/null 2>&1; then
5779 echo "Your C library seems to be in $libc, as you said before."
5780 elif $test -r $incpath/usr/lib/libc$_a; then
5781 libc=$incpath/usr/lib/libc$_a;
5782 echo "Your C library seems to be in $libc. That's fine."
5783 elif $test -r /lib/libc$_a; then
5785 echo "Your C library seems to be in $libc. You're normal."
5787 if tans=`./loc libc$_a blurfl/dyick $libpth`; $test -r "$tans"; then
5789 elif tans=`./loc libc blurfl/dyick $libpth`; $test -r "$tans"; then
5790 libnames="$libnames "`./loc clib blurfl/dyick $libpth`
5791 elif tans=`./loc clib blurfl/dyick $libpth`; $test -r "$tans"; then
5793 elif tans=`./loc Slibc$_a blurfl/dyick $xlibpth`; $test -r "$tans"; then
5795 elif tans=`./loc Mlibc$_a blurfl/dyick $xlibpth`; $test -r "$tans"; then
5798 tans=`./loc Llibc$_a blurfl/dyick $xlibpth`
5800 if $test -r "$tans"; then
5801 echo "Your C library seems to be in $tans, of all places."
5807 if $test $xxx = apollo -o -r "$libc" || (test -h "$libc") >/dev/null 2>&1; then
5811 If the guess above is wrong (which it might be if you're using a strange
5812 compiler, or your machine supports multiple models), you can override it here.
5817 echo $libpth | tr ' ' $trnl | sort | uniq > libpath
5819 I can't seem to find your C library. I've looked in the following places:
5822 $sed 's/^/ /' libpath
5825 None of these seems to contain your C library. I need to get its name...
5830 rp='Where is your C library?'
5835 echo $libc $libnames | tr ' ' $trnl | sort | uniq > libnames
5836 set X `cat libnames`
5839 case $# in 1) xxx=file; esac
5840 echo "Extracting names from the following $xxx for later perusal:" >&4
5842 $sed 's/^/ /' libnames >&4
5844 $echo $n "This may take a while...$c" >&4
5848 *$so*) $nm $nm_so_opt $nm_opt $file 2>/dev/null;;
5849 *) $nm $nm_opt $file 2>/dev/null;;
5854 $grep fprintf libc.tmp > libc.ptf
5855 xscan='eval "<libc.ptf $com >libc.list"; $echo $n ".$c" >&4'
5856 xrun='eval "<libc.tmp $com >libc.list"; echo "done" >&4'
5858 if com="$sed -n -e 's/__IO//' -e 's/^.* $xxx *_[_.]*//p' -e 's/^.* $xxx *//p'";\
5860 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5862 elif com="$sed -n -e 's/^__*//' -e 's/^\([a-zA-Z_0-9$]*\).*xtern.*/\1/p'";\
5864 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5866 elif com="$sed -n -e '/|UNDEF/d' -e '/FUNC..GL/s/^.*|__*//p'";\
5868 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5870 elif com="$sed -n -e 's/^.* D __*//p' -e 's/^.* D //p'";\
5872 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5874 elif com="$sed -n -e 's/^_//' -e 's/^\([a-zA-Z_0-9]*\).*xtern.*text.*/\1/p'";\
5876 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5878 elif com="$sed -n -e 's/^.*|FUNC |GLOB .*|//p'";\
5880 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5882 elif com="$grep '|' | $sed -n -e '/|COMMON/d' -e '/|DATA/d' \
5883 -e '/ file/d' -e 's/^\([^ ]*\).*/\1/p'";\
5885 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5887 elif com="$sed -n -e 's/^.*|FUNC |GLOB .*|//p' -e 's/^.*|FUNC |WEAK .*|//p'";\
5889 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5891 elif com="$sed -n -e 's/^__//' -e '/|Undef/d' -e '/|Proc/s/ .*//p'";\
5893 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5895 elif com="$sed -n -e 's/^.*|Proc .*|Text *| *//p'";\
5897 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5899 elif com="$sed -n -e '/Def. Text/s/.* \([^ ]*\)\$/\1/p'";\
5901 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5903 elif com="$sed -n -e 's/^[-0-9a-f ]*_\(.*\)=.*/\1/p'";\
5905 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5907 elif com="$sed -n -e 's/.*\.text n\ \ \ \.//p'";\
5909 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5911 elif com="sed -n -e 's/^__.*//' -e 's/[ ]*D[ ]*[0-9]*.*//p'";\
5913 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5916 $nm -p $* 2>/dev/null >libc.tmp
5917 $grep fprintf libc.tmp > libc.ptf
5918 if com="$sed -n -e 's/^.* [ADTSIW] *_[_.]*//p' -e 's/^.* [ADTSIW] //p'";\
5919 eval $xscan; $contains '^fprintf$' libc.list >/dev/null 2>&1
5925 echo "$nm didn't seem to work right. Trying $ar instead..." >&4
5927 if $ar t $libc > libc.tmp && $contains '^fprintf$' libc.tmp >/dev/null 2>&1; then
5928 for thisname in $libnames $libc; do
5929 $ar t $thisname >>libc.tmp
5931 $sed -e "s/\\$_o\$//" < libc.tmp > libc.list
5933 elif test "X$osname" = "Xos2" && $ar tv $libc > libc.tmp; then
5934 # Repeat libc to extract forwarders to DLL entries too
5935 for thisname in $libnames $libc; do
5936 $ar tv $thisname >>libc.tmp
5937 # Revision 50 of EMX has bug in $ar.
5938 # it will not extract forwarders to DLL entries
5939 # Use emximp which will extract exactly them.
5940 emximp -o tmp.imp $thisname \
5942 $sed -e 's/^\([_a-zA-Z0-9]*\) .*$/\1/p' \
5943 < tmp.imp >>libc.tmp
5946 $sed -e "s/\\$_o\$//" -e 's/^ \+//' < libc.tmp > libc.list
5949 echo "$ar didn't seem to work right." >&4
5950 echo "Maybe this is a Cray...trying bld instead..." >&4
5951 if bld t $libc | $sed -e 's/.*\///' -e "s/\\$_o:.*\$//" > libc.list
5953 for thisname in $libnames; do
5955 $sed -e 's/.*\///' -e "s/\\$_o:.*\$//" >>libc.list
5956 $ar t $thisname >>libc.tmp
5960 echo "That didn't work either. Giving up." >&4
5967 if $test -f /lib/syscalls.exp; then
5969 echo "Also extracting names from /lib/syscalls.exp for good ole AIX..." >&4
5970 $sed -n 's/^\([^ ]*\)[ ]*syscall[0-9]*$/\1/p' /lib/syscalls.exp >>libc.list
5974 $rm -f libnames libpath
5976 : see if dld is available
5980 : is a C symbol defined?
5983 -v) tf=libc.tmp; tc=""; tdc="";;
5984 -a) tf=libc.tmp; tc="[0]"; tdc="[]";;
5985 *) tlook="^$1\$"; tf=libc.list; tc="()"; tdc="()";;
5988 case "$reuseval-$4" in
5990 true-*) tx=no; eval "tval=\$$4"; case "$tval" in "") tx=yes;; esac;;
5996 if $contains $tlook $tf >/dev/null 2>&1;
6001 echo "int main() { extern short $1$tdc; printf(\"%hd\", $1$tc); }" > t.c;
6002 if $cc $optimize $ccflags $ldflags -o t t.c $libs >/dev/null 2>&1;
6010 $define) tval=true;;
6016 : define an is-in-libc? function
6017 inlibc='echo " "; td=$define; tu=$undef;
6018 sym=$1; var=$2; eval "was=\$$2";
6020 case "$reuseval$was" in
6030 echo "$sym() found." >&4;
6031 case "$was" in $undef) . ./whoa; esac; eval "$var=\$td";;
6033 echo "$sym() NOT found." >&4;
6034 case "$was" in $define) . ./whoa; esac; eval "$var=\$tu";;
6038 $define) echo "$sym() found." >&4;;
6039 *) echo "$sym() NOT found." >&4;;
6043 : see if dlopen exists
6050 : determine which dynamic loading, if any, to compile in
6052 dldir="ext/DynaLoader"
6065 $define) dflt='y' ;;
6068 $define) dflt='y' ;;
6070 : Does a dl_xxx.xs file exist for this operating system
6071 $test -f $rsrc/$dldir/dl_${osname}.xs && dflt='y'
6074 rp="Do you wish to use dynamic loading?"
6081 if $test -f $rsrc/$dldir/dl_${osname}.xs ; then
6082 dflt="$dldir/dl_${osname}.xs"
6083 elif $test "$d_dlopen" = "$define" ; then
6084 dflt="$dldir/dl_dlopen.xs"
6085 elif $test "$i_dld" = "$define" ; then
6086 dflt="$dldir/dl_dld.xs"
6091 *) dflt="$dldir/$dlsrc"
6094 echo "The following dynamic loading files are available:"
6095 : Can not go over to $dldir because getfile has path hard-coded in.
6096 tdir=`pwd`; cd $rsrc; $ls -C $dldir/dl*.xs; cd $tdir
6097 rp="Source file to use for dynamic loading"
6103 dlsrc=`echo $ans | $sed -e 's%.*/\([^/]*\)$%\1%'`
6107 Some systems may require passing special flags to $cc -c to
6108 compile modules that will be used to create a shared library.
6109 To use no flags, say "none".
6112 case "$cccdlflags" in
6113 '') case "$gccversion" in
6114 '') case "$osname" in
6116 next) dflt='none' ;;
6117 irix*) dflt='-KPIC' ;;
6118 svr4*|esix*|solaris) dflt='-KPIC' ;;
6119 sunos) dflt='-pic' ;;
6123 *) case "$osname" in
6124 svr4*|esix*|solaris) dflt='-fPIC' ;;
6129 *) dflt="$cccdlflags" ;;
6131 rp="Any special flags to pass to $cc -c to compile shared library modules?"
6134 none) cccdlflags=' ' ;;
6135 *) cccdlflags="$ans" ;;
6140 Some systems use ld to create libraries that can be dynamically loaded,
6141 while other systems (such as those using ELF) use $cc.
6145 '') $cat >try.c <<'EOM'
6146 /* Test for whether ELF binaries are produced */
6151 int i = open("a.out",O_RDONLY);
6154 if(read(i,b,4)==4 && b[0]==127 && b[1]=='E' && b[2]=='L' && b[3]=='F')
6155 exit(0); /* succeed (yes, it's ELF) */
6160 if $cc $ccflags try.c >/dev/null 2>&1 && ./a.out; then
6162 You appear to have ELF support. I'll use $cc to build dynamic libraries.
6166 echo "I'll use ld to build dynamic libraries."
6175 rp="What command should be used to create dynamic libraries?"
6181 Some systems may require passing special flags to $ld to create a
6182 library that can be dynamically loaded. If your ld flags include
6183 -L/other/path options to locate libraries outside your loader's normal
6184 search path, you may need to specify those -L options here as well. To
6185 use no flags, say "none".
6188 case "$lddlflags" in
6189 '') case "$osname" in
6190 beos) dflt='-nostart' ;;
6192 case "$gccversion" in
6193 '') dflt="$dflt +vnocompatwarnings" ;;
6196 linux|irix*) dflt='-shared' ;;
6197 next) dflt='none' ;;
6198 solaris) dflt='-G' ;;
6199 sunos) dflt='-assert nodefinitions' ;;
6200 svr4*|esix*) dflt="-G $ldflags" ;;
6204 *) dflt="$lddlflags" ;;
6207 : Try to guess additional flags to pick up local libraries.
6208 : Be careful not to append to a plain 'none'
6212 for thisflag in $ldflags; do
6217 *) dflt="$dflt $thisflag" ;;
6224 ''|' ') dflt='none' ;;
6227 rp="Any special flags to pass to $ld to create a dynamically loaded library?"
6230 none) lddlflags=' ' ;;
6231 *) lddlflags="$ans" ;;
6236 Some systems may require passing special flags to $cc to indicate that
6237 the resulting executable will use dynamic linking. To use no flags,
6241 case "$ccdlflags" in
6242 '') case "$osname" in
6243 hpux) dflt='-Wl,-E' ;;
6244 linux) dflt='-rdynamic' ;;
6245 next) dflt='none' ;;
6246 sunos) dflt='none' ;;
6250 *) dflt="$ccdlflags" ;;
6252 rp="Any special flags to pass to $cc to use dynamic linking?"
6255 none) ccdlflags=' ' ;;
6256 *) ccdlflags="$ans" ;;
6270 # No dynamic loading being used, so don't bother even to prompt.
6273 *) case "$useshrplib" in
6274 '') case "$osname" in
6275 svr4*|dgux|dynixptx|esix|powerux|beos|cygwin*)
6277 also='Building a shared libperl is required for dynamic loading to work on your system.'
6282 also='Building a shared libperl is needed for MAB support.'
6300 The perl executable is normally obtained by linking perlmain.c with
6301 libperl${_a}, any static extensions (usually just DynaLoader), and
6302 any other libraries needed on this system (such as -lm, etc.). Since
6303 your system supports dynamic loading, it is probably possible to build
6304 a shared libperl.$so. If you will have more than one executable linked
6305 to libperl.$so, this will significantly reduce the size of each
6306 executable, but it may have a noticeable affect on performance. The
6307 default is probably sensible for your system.
6311 rp="Build a shared libperl.$so (y/n)"
6315 useshrplib='true' ;;
6316 *) useshrplib='false' ;;
6321 case "$useshrplib" in
6325 # Figure out a good name for libperl.so. Since it gets stored in
6326 # a version-specific architecture-dependent library, the version
6327 # number isn't really that important, except for making cc/ld happy.
6329 # A name such as libperl.so.3.1
6330 majmin="libperl.$so.$patchlevel.$subversion"
6331 # A name such as libperl.so.301
6332 majonly=`echo $patchlevel $subversion |
6333 $awk '{printf "%d%02d", $1, $2}'`
6334 majonly=libperl.$so.$majonly
6335 # I'd prefer to keep the os-specific stuff here to a minimum, and
6336 # rely on figuring it out from the naming of libc.
6337 case "${osname}${osvers}" in
6340 # XXX How handle the --version stuff for MAB?
6342 linux*) # ld won't link with a bare -lperl otherwise.
6345 cygwin*) # include version
6346 dflt=`echo libperl$version | sed -e 's/\./_/g'`$lib_ext
6348 *) # Try to guess based on whether libc has major.minor.
6350 *libc.$so.[0-9]*.[0-9]*) dflt=$majmin ;;
6351 *libc.$so.[0-9]*) dflt=$majonly ;;
6352 *) dflt=libperl.$so ;;
6362 I need to select a good name for the shared libperl. If your system uses
6363 library names with major and minor numbers, then you might want something
6364 like $majmin. Alternatively, if your system uses a single version
6365 number for shared libraries, then you might want to use $majonly.
6366 Or, your system might be quite happy with a simple libperl.$so.
6368 Since the shared libperl will get installed into a version-specific
6369 architecture-dependent directory, the version number of the shared perl
6370 library probably isn't important, so the default should be o.k.
6373 rp='What name do you want to give to the shared libperl?'
6376 echo "Ok, I'll use $libperl"
6379 libperl="libperl${_a}"
6383 # Detect old use of shrpdir via undocumented Configure -Dshrpdir
6387 WARNING: Use of the shrpdir variable for the installation location of
6388 the shared $libperl is not supported. It was never documented and
6389 will not work in this version. Let me (perlbug@perl.com)
6390 know of any problems this may cause.
6396 But your current setting of $shrpdir is
6397 the default anyway, so it's harmless.
6402 Further, your current attempted setting of $shrpdir
6403 conflicts with the value of $archlibexp/CORE
6404 that installperl will use.
6411 # How will the perl executable find the installed shared $libperl?
6412 # Add $xxx to ccdlflags.
6413 # If we can't figure out a command-line option, use $shrpenv to
6414 # set env LD_RUN_PATH. The main perl makefile uses this.
6415 shrpdir=$archlibexp/CORE
6418 if "$useshrplib"; then
6421 # We'll set it in Makefile.SH...
6427 xxx="-Wl,-R$shrpdir"
6429 linux|irix*|dec_osf)
6430 xxx="-Wl,-rpath,$shrpdir"
6433 # next doesn't like the default...
6436 # beos doesn't like the default, either.
6439 # hpux doesn't like the default, either.
6440 tmp_shrpenv="env LDOPTS=\"+s +b${shrpdir}\""
6443 tmp_shrpenv="env LD_RUN_PATH=$shrpdir"
6449 # Only add $xxx if it isn't already in ccdlflags.
6450 case " $ccdlflags " in
6452 *) ccdlflags="$ccdlflags $xxx"
6455 Adding $xxx to the flags
6456 passed to $ld so that the perl executable will find the
6457 installed shared $libperl.
6465 # Fix ccdlflags in AIX for building external extensions.
6466 # (For building Perl itself bare -bE:perl.exp is needed,
6467 # Makefile.SH takes care of this.)
6469 aix) ccdlflags="$ccdlflags -bE:$installarchlib/CORE/perl.exp" ;;
6471 # Respect a hint or command-line value.
6473 '') shrpenv="$tmp_shrpenv" ;;
6475 case "$ldlibpthname" in
6476 '') ldlibpthname=LD_LIBRARY_PATH ;;
6477 none) ldlibpthname='' ;;
6480 : determine where manual pages go
6481 set man1dir man1dir none
6485 $spackage has manual pages available in source form.
6489 echo "However, you don't have nroff, so they're probably useless to you."
6491 '') man1dir="none";;
6494 echo "If you don't want the manual sources installed, answer 'none'."
6499 lookpath="$prefixexp/man/man1 $prefixexp/man/l_man/man1"
6500 lookpath="$lookpath $prefixexp/man/p_man/man1"
6501 lookpath="$lookpath $prefixexp/man/u_man/man1"
6502 lookpath="$lookpath $prefixexp/man/man.1"
6504 */?_man*) dflt=`./loc . $prefixexp/l_man/man1 $lookpath` ;;
6505 *) dflt=`./loc . $prefixexp/man/man1 $lookpath` ;;
6515 rp="Where do the main $spackage manual pages (source) go?"
6517 if $test "X$man1direxp" != "X$ansexp"; then
6521 man1direxp="$ansexp"
6527 : Change installation prefix, if necessary.
6528 if $test X"$prefix" != X"$installprefix"; then
6529 installman1dir=`echo $man1direxp | $sed "s#^$prefix#$installprefix#"`
6531 installman1dir="$man1direxp"
6534 : What suffix to use on installed man pages
6541 rp="What suffix should be used for the main $spackage man pages?"
6543 '') case "$man1dir" in
6557 *) dflt="$man1ext";;
6564 : see if we can have long filenames
6566 rmlist="$rmlist /tmp/cf$$"
6567 $test -d /tmp/cf$$ || mkdir /tmp/cf$$
6568 first=123456789abcdef
6569 second=/tmp/cf$$/$first
6570 $rm -f $first $second
6571 if (echo hi >$first) 2>/dev/null; then
6572 if $test -f 123456789abcde; then
6573 echo 'You cannot have filenames longer than 14 characters. Sigh.' >&4
6576 if (echo hi >$second) 2>/dev/null; then
6577 if $test -f /tmp/cf$$/123456789abcde; then
6579 That's peculiar... You can have filenames longer than 14 characters, but only
6580 on some of the filesystems. Maybe you are using NFS. Anyway, to avoid problems
6581 I shall consider your system cannot support long filenames at all.
6585 echo 'You can have filenames longer than 14 characters.' >&4
6590 How confusing! Some of your filesystems are sane enough to allow filenames
6591 longer than 14 characters but some others like /tmp can't even think about them.
6592 So, for now on, I shall assume your kernel does not allow them at all.
6599 You can't have filenames longer than 14 chars. You can't even think about them!
6605 $rm -rf /tmp/cf$$ 123456789abcde*
6607 : determine where library module manual pages go
6608 set man3dir man3dir none
6612 $spackage has manual pages for many of the library modules.
6618 However, you don't have nroff, so they're probably useless to you.
6621 '') man3dir="none";;
6625 case "$d_flexfnam" in
6628 However, your system can't handle the long file names like File::Basename.3.
6631 '') man3dir="none";;
6635 echo "If you don't want the manual sources installed, answer 'none'."
6636 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
6638 '') dflt=`echo $man1dir | $sed -e 's/man1/man3/g' -e 's/man\.1/man\.3/g'`
6639 if $test -d "$privlib/man/man3"; then
6642 WARNING: Previous versions of perl installed man3 pages into
6643 $privlib/man/man3. This version will suggest a
6644 new default of $dflt.
6648 rp='Do you wish to preserve the old behavior?(y/n)'
6651 y*) dflt="$privlib/man/man3" ;;
6657 *) dflt="$man3dir" ;;
6661 rp="Where do the $package library man pages (source) go?"
6664 man3direxp="$ansexp"
6670 : Change installation prefix, if necessary.
6671 if $test X"$prefix" != X"$installprefix"; then
6672 installman3dir=`echo $man3direxp | $sed "s#^$prefix#$installprefix#"`
6674 installman3dir="$man3direxp"
6677 : What suffix to use on installed man pages
6683 rp="What suffix should be used for the $package library man pages?"
6685 '') case "$man3dir" in
6699 *) dflt="$man3ext";;
6706 : see if we have to deal with yellow pages, now NIS.
6707 if $test -d /usr/etc/yp || $test -d /etc/yp; then
6708 if $test -f /usr/etc/nibindd; then
6710 echo "I'm fairly confident you're on a NeXT."
6712 rp='Do you get the hosts file via NetInfo?'
6721 y*) hostcat='nidump hosts .';;
6722 *) case "$hostcat" in
6723 nidump*) hostcat='';;
6733 '') if $contains '^\+' /etc/passwd >/dev/null 2>&1; then
6741 rp='Are you getting the hosts file via yellow pages?'
6744 y*) hostcat='ypcat hosts';;
6745 *) hostcat='cat /etc/hosts';;
6751 '') test -f /etc/hosts && hostcat='cat /etc/hosts';;
6754 '') test -f /etc/group && groupcat='cat /etc/group';;
6757 '') test -f /etc/passwd && passcat='cat /etc/passwd';;
6760 : now get the host name
6762 echo "Figuring out host name..." >&4
6763 case "$myhostname" in
6765 echo 'Maybe "hostname" will work...'
6766 if tans=`sh -c hostname 2>&1` ; then
6774 if $test "$cont"; then
6776 echo 'Oh, dear. Maybe "/etc/systemid" is the key...'
6777 if tans=`cat /etc/systemid 2>&1` ; then
6779 phostname='cat /etc/systemid'
6780 echo "Whadyaknow. Xenix always was a bit strange..."
6783 elif $test -r /etc/systemid; then
6784 echo "(What is a non-Xenix system doing with /etc/systemid?)"
6787 if $test "$cont"; then
6788 echo 'No, maybe "uuname -l" will work...'
6789 if tans=`sh -c 'uuname -l' 2>&1` ; then
6791 phostname='uuname -l'
6793 echo 'Strange. Maybe "uname -n" will work...'
6794 if tans=`sh -c 'uname -n' 2>&1` ; then
6796 phostname='uname -n'
6798 echo 'Oh well, maybe I can mine it out of whoami.h...'
6799 if tans=`sh -c $contains' sysname $usrinc/whoami.h' 2>&1` ; then
6800 myhostname=`echo "$tans" | $sed 's/^.*"\(.*\)"/\1/'`
6801 phostname="sed -n -e '"'/sysname/s/^.*\"\\(.*\\)\"/\1/{'"' -e p -e q -e '}' <$usrinc/whoami.h"
6803 case "$myhostname" in
6804 '') echo "Does this machine have an identity crisis or something?"
6807 echo "Well, you said $myhostname before..."
6808 phostname='echo $myhostname';;
6814 : you do not want to know about this
6819 if $test "$myhostname" ; then
6821 rp='Your host name appears to be "'$myhostname'".'" Right?"
6829 : bad guess or no guess
6830 while $test "X$myhostname" = X ; do
6832 rp="Please type the (one word) name of your host:"
6837 : translate upper to lower if necessary
6838 case "$myhostname" in
6840 echo "(Normalizing case in your host name)"
6841 myhostname=`echo $myhostname | ./tr '[A-Z]' '[a-z]'`
6845 case "$myhostname" in
6847 dflt=`expr "X$myhostname" : "X[^.]*\(\..*\)"`
6848 myhostname=`expr "X$myhostname" : "X\([^.]*\)\."`
6849 echo "(Trimming domain name from host name--host name is now $myhostname)"
6851 *) case "$mydomain" in
6854 test "X$hostcat" = "Xypcat hosts" &&
6855 ypmatch "$myhostname" hosts 2>/dev/null |\
6856 $sed -e 's/[ ]*#.*//; s/$/ /' > hosts && \
6859 test "X$hostcat" != "X" &&
6860 $hostcat | $sed -n -e "s/[ ]*#.*//; s/\$/ /
6861 /[ ]$myhostname[ . ]/p" > hosts
6864 $test x`$awk "/[0-9].*[ ]$myhostname$tmp_re/ { sum++ }
6865 END { print sum }" hosts` = x1 || tmp_re="[ ]"
6866 dflt=.`$awk "/[0-9].*[ ]$myhostname$tmp_re/ {for(i=2; i<=NF;i++) print \\\$i}" \
6867 hosts | $sort | $uniq | \
6868 $sed -n -e "s/$myhostname\.\([-a-zA-Z0-9_.]\)/\1/p"`
6869 case `$echo X$dflt` in
6870 X*\ *) echo "(Several hosts in /etc/hosts matched hostname)"
6873 X.) echo "(You do not have fully-qualified names in /etc/hosts)"
6878 tans=`./loc resolv.conf X /etc /usr/etc`
6879 if $test -f "$tans"; then
6880 echo "(Attempting domain name extraction from $tans)"
6881 dflt=.`$sed -n -e 's/ / /g' \
6882 -e 's/^search *\([^ ]*\).*/\1/p' $tans \
6883 | ./tr '[A-Z]' '[a-z]' 2>/dev/null`
6885 .) dflt=.`$sed -n -e 's/ / /g' \
6886 -e 's/^domain *\([^ ]*\).*/\1/p' $tans \
6887 | ./tr '[A-Z]' '[a-z]' 2>/dev/null`
6894 .) echo "(No help from resolv.conf either -- attempting clever guess)"
6895 dflt=.`sh -c domainname 2>/dev/null`
6898 .nis.*|.yp.*|.main.*) dflt=`echo $dflt | $sed -e 's/^\.[^.]*//'`;;
6903 .) echo "(Lost all hope -- silly guess then)"
6909 *) dflt="$mydomain";;
6913 rp="What is your domain name?"
6923 : translate upper to lower if necessary
6926 echo "(Normalizing case in your domain name)"
6927 mydomain=`echo $mydomain | ./tr '[A-Z]' '[a-z]'`
6931 : a little sanity check here
6932 case "$phostname" in
6935 case `$phostname | ./tr '[A-Z]' '[a-z]'` in
6936 $myhostname$mydomain|$myhostname) ;;
6938 case "$phostname" in
6940 echo "(That doesn't agree with your whoami.h file, by the way.)"
6943 echo "(That doesn't agree with your $phostname command, by the way.)"
6953 I need to get your e-mail address in Internet format if possible, i.e.
6954 something like user@host.domain. Please answer accurately since I have
6955 no easy means to double check it. The default value provided below
6956 is most probably close to reality but may not be valid from outside
6957 your organization...
6961 while test "$cont"; do
6963 '') dflt="$cf_by@$myhostname$mydomain";;
6964 *) dflt="$cf_email";;
6966 rp='What is your e-mail address?'
6972 rp='Address does not look like an Internet one. Use it anyway?'
6988 If you or somebody else will be maintaining perl at your site, please
6989 fill in the correct e-mail address here so that they may be contacted
6990 if necessary. Currently, the "perlbug" program included with perl
6991 will send mail to this address in addition to perlbug@perl.com. You may
6992 enter "none" for no administrator.
6995 case "$perladmin" in
6996 '') dflt="$cf_email";;
6997 *) dflt="$perladmin";;
6999 rp='Perl administrator e-mail address'
7003 : figure out how to guarantee perl startup
7004 case "$startperl" in
7006 case "$sharpbang" in
7010 I can use the #! construct to start perl on your system. This will
7011 make startup of perl scripts faster, but may cause problems if you
7012 want to share those scripts and perl is not in a standard place
7013 ($binexp/perl) on all your platforms. The alternative is to force
7014 a shell by starting the script with a single ':' character.
7018 rp='What shall I put after the #! to start up perl ("none" to not use #!)?'
7021 none) startperl=": # use perl";;
7022 *) startperl="#!$ans"
7023 if $test 30 -lt `echo "$ans" | wc -c`; then
7026 WARNING: Some systems limit the #! command to 32 characters.
7027 If you experience difficulty running Perl scripts with #!, try
7028 installing Perl in a directory with a shorter pathname.
7034 *) startperl=": # use perl"
7039 echo "I'll use $startperl to start perl scripts."
7041 : figure best path for perl in scripts
7044 perlpath="$binexp/perl"
7045 case "$startperl" in
7050 I will use the "eval 'exec'" idiom to start Perl on your system.
7051 I can use the full path of your Perl binary for this purpose, but
7052 doing so may cause problems if you want to share those scripts and
7053 Perl is not always in a standard place ($binexp/perl).
7057 rp="What path shall I use in \"eval 'exec'\"?"
7064 case "$startperl" in
7066 *) echo "I'll use $perlpath in \"eval 'exec'\"" ;;
7069 : determine where public executable scripts go
7070 set scriptdir scriptdir
7072 case "$scriptdir" in
7075 : guess some guesses
7076 $test -d /usr/share/scripts && dflt=/usr/share/scripts
7077 $test -d /usr/share/bin && dflt=/usr/share/bin
7078 $test -d /usr/local/script && dflt=/usr/local/script
7079 $test -d /usr/local/scripts && dflt=/usr/local/scripts
7080 $test -d $prefixexp/script && dflt=$prefixexp/script
7084 *) dflt="$scriptdir"
7089 Some installations have a separate directory just for executable scripts so
7090 that they can mount it across multiple architectures but keep the scripts in
7091 one spot. You might, for example, have a subdirectory of /usr/share for this.
7092 Or you might just lump your scripts in with all your other executables.
7096 rp='Where do you keep publicly executable scripts?'
7098 if $test "X$ansexp" != "X$scriptdirexp"; then
7102 scriptdirexp="$ansexp"
7103 : Change installation prefix, if necessary.
7104 if $test X"$prefix" != X"$installprefix"; then
7105 installscript=`echo $scriptdirexp | sed "s#^$prefix#$installprefix#"`
7107 installscript="$scriptdirexp"
7110 : determine where site specific architecture-dependent libraries go.
7111 : sitelib default is /usr/local/lib/perl5/site_perl/$version
7112 : sitearch default is /usr/local/lib/perl5/site_perl/$version/$archname
7113 : sitelib may have an optional trailing /share.
7115 '') dflt=`echo $sitelib | $sed 's,/share$,,'`
7116 dflt="$dflt/$archname"
7121 set sitearch sitearch none
7125 The installation process will also create a directory for
7126 architecture-dependent site-specific extensions and modules.
7130 rp='Pathname for the site-specific architecture-dependent library files?'
7133 sitearchexp="$ansexp"
7134 : Change installation prefix, if necessary.
7135 if $test X"$prefix" != X"$installprefix"; then
7136 installsitearch=`echo $sitearchexp | sed "s#^$prefix#$installprefix#"`
7138 installsitearch="$sitearchexp"
7141 : determine where add-on public executables go
7143 '') dflt=$siteprefix/bin ;;
7147 rp='Pathname where the add-on public executables should be installed?'
7150 sitebinexp="$ansexp"
7151 : Change installation prefix, if necessary.
7152 if $test X"$prefix" != X"$installprefix"; then
7153 installsitebin=`echo $sitebinexp | sed "s#^$prefix#$installprefix#"`
7155 installsitebin="$sitebinexp"
7158 : see if sqrtl exists
7163 *-DUSE_LONG_DOUBLE*|*-DUSE_MORE_BITS*) uselongdouble="$define" ;;
7166 case "$uselongdouble" in
7167 $define|true|[yY]*) dflt='y';;
7172 Perl can be built to take advantage of long doubles which
7173 (if available) may give more accuracy and range for floating point numbers.
7175 If this doesn't make any sense to you, just accept the default '$dflt'.
7177 rp='Try to use long doubles if available?'
7180 y|Y) val="$define" ;;
7186 case "$uselongdouble" in
7187 true|[yY]*) uselongdouble="$define" ;;
7190 case "$uselongdouble" in
7192 : Look for a hint-file generated 'call-back-unit'. If the
7193 : user has specified that long doubles should be used,
7194 : we may need to set or change some other defaults.
7195 if $test -f uselongdouble.cbu; then
7196 echo "Your platform has some specific hints for long doubles, using them..."
7197 . ./uselongdouble.cbu
7200 (Your platform doesn't have any specific hints for long doubles.)
7206 case "$uselongdouble:$d_sqrtl" in
7210 *** You requested the use of long doubles but you do not seem to have
7211 *** the mathematic functions for long doubles. I'm disabling the use
7212 *** of long doubles.
7215 uselongdouble=$undef
7219 case "$useperlio" in
7220 $define|true|[yY]*) dflt='y';;
7225 Previous version of $package used the standard IO mechanisms as defined
7226 in <stdio.h>. Versions 5.003_02 and later of perl allow alternate IO
7227 mechanisms via a "PerlIO" abstraction, but the stdio mechanism is still
7228 the default. This abstraction layer can use AT&T's sfio (if you already
7229 have sfio installed) or regular stdio. Using PerlIO with sfio may cause
7230 problems with some extension modules. Using PerlIO with stdio is safe,
7231 but it is slower than plain stdio and therefore is not the default.
7233 If this doesn't make any sense to you, just accept the default '$dflt'.
7235 rp='Use the experimental PerlIO abstraction layer?'
7242 echo "Ok, doing things the stdio way"
7249 case "$vendorprefix" in
7250 '') d_vendorbin="$undef"
7254 *) d_vendorbin="$define"
7255 : determine where vendor-supplied executables go.
7256 case "$vendorbin" in
7257 '') dflt=$vendorprefix/bin ;;
7258 *) dflt="$vendorbin" ;;
7261 rp='Pathname for the vendor-supplied executables directory?'
7264 vendorbinexp="$ansexp"
7267 : Change installation prefix, if necessary.
7268 if $test X"$prefix" != X"$installprefix"; then
7269 installvendorbin=`echo $vendorbinexp | $sed "s#^$prefix#$installprefix#"`
7271 installvendorbin="$vendorbinexp"
7274 : see if qgcvt exists
7278 : check for length of double
7280 case "$doublesize" in
7282 echo "Checking to see how big your double precision numbers are..." >&4
7283 $cat >try.c <<'EOCP'
7287 printf("%d\n", (int)sizeof(double));
7292 if eval $compile_ok; then
7294 echo "Your double is $doublesize bytes long."
7297 echo "(I can't seem to compile the test program. Guessing...)"
7298 rp="What is the size of a double precision number (in bytes)?"
7306 : check for long doubles
7308 echo "Checking to see if you have long double..." >&4
7309 echo 'int main() { long double x = 7.0; }' > try.c
7311 if eval $compile; then
7313 echo "You have long double."
7316 echo "You do not have long double."
7322 : check for length of long double
7323 case "${d_longdbl}${longdblsize}" in
7326 echo "Checking to see how big your long doubles are..." >&4
7327 $cat >try.c <<'EOCP'
7331 printf("%d\n", sizeof(long double));
7336 if eval $compile; then
7337 longdblsize=`./try$exe_ext`
7338 echo "Your long doubles are $longdblsize bytes long."
7342 echo "(I can't seem to compile the test program. Guessing...)" >&4
7343 rp="What is the size of a long double (in bytes)?"
7347 if $test "X$doublesize" = "X$longdblsize"; then
7348 echo "(That isn't any different from an ordinary double.)"
7356 if $test X"$d_longdbl" = X"$define"; then
7358 echo "Checking how to print long doubles..." >&4
7360 if $test X"$sPRIfldbl" = X -a X"$doublesize" = X"$longdblsize"; then
7361 $cat >try.c <<'EOCP'
7362 #include <sys/types.h>
7366 printf("%.3f\n", d);
7370 if eval $compile; then
7374 sPRIfldbl='"f"'; sPRIgldbl='"g"'; sPRIeldbl='"e"';
7375 sPRIFldbl='"F"'; sPRIGldbl='"G"'; sPRIEldbl='"E"';
7376 echo "We will use %f."
7382 if $test X"$sPRIfldbl" = X; then
7383 $cat >try.c <<'EOCP'
7384 #include <sys/types.h>
7387 long double d = 123.456;
7388 printf("%.3llf\n", d);
7392 if eval $compile; then
7396 sPRIfldbl='"llf"'; sPRIgldbl='"llg"'; sPRIeldbl='"lle"';
7397 sPRIFldbl='"llF"'; sPRIGldbl='"llG"'; sPRIEldbl='"llE"';
7398 echo "We will use %llf."
7404 if $test X"$sPRIfldbl" = X; then
7405 $cat >try.c <<'EOCP'
7406 #include <sys/types.h>
7409 long double d = 123.456;
7410 printf("%.3Lf\n", d);
7414 if eval $compile; then
7418 sPRIfldbl='"Lf"'; sPRIgldbl='"Lg"'; sPRIeldbl='"Le"';
7419 sPRIFldbl='"LF"'; sPRIGldbl='"LG"'; sPRIEldbl='"LE"';
7420 echo "We will use %Lf."
7426 if $test X"$sPRIfldbl" = X; then
7427 $cat >try.c <<'EOCP'
7428 #include <sys/types.h>
7431 long double d = 123.456;
7432 printf("%.3lf\n", d);
7436 if eval $compile; then
7440 sPRIfldbl='"lf"'; sPRIgldbl='"lg"'; sPRIeldbl='"le"';
7441 sPRIFldbl='"lF"'; sPRIGldbl='"lG"'; sPRIEldbl='"lE"';
7442 echo "We will use %lf."
7448 if $test X"$sPRIfldbl" = X; then
7449 echo "Cannot figure out how to print long doubles." >&4
7456 case "$sPRIfldbl" in
7457 '') d_PRIfldbl="$undef"; d_PRIgldbl="$undef"; d_PRIeldbl="$undef";
7458 d_PRIFldbl="$undef"; d_PRIGldbl="$undef"; d_PRIEldbl="$undef";
7460 *) d_PRIfldbl="$define"; d_PRIgldbl="$define"; d_PRIeldbl="$define";
7461 d_PRIFldbl="$define"; d_PRIGldbl="$define"; d_PRIEldbl="$define";
7465 : Check how to convert floats to strings.
7466 if test "X$d_Gconvert" = X; then
7468 echo "Checking for an efficient way to convert floats to strings."
7470 case "$uselongdouble" in
7471 "$define") echo "#define USE_LONG_DOUBLE" >>try.c ;;
7473 case "$d_longdbl" in
7474 "$define") echo "#define HAS_LONG_DOUBLE" >>try.c ;;
7476 case "$d_PRIgldbl" in
7477 "$define") echo "#define HAS_PRIgldbl" >>try.c ;;
7481 #define Gconvert(x,n,t,b) gconvert((x),(n),(t),(b))
7482 char *myname = "gconvert";
7485 #define Gconvert(x,n,t,b) gcvt((x),(n),(b))
7486 char *myname = "gcvt";
7489 #define Gconvert(x,n,t,b) qgcvt((x),(n),(b))
7490 char *myname = "qgcvt";
7491 #define DOUBLETYPE long double
7494 #if defined(USE_LONG_DOUBLE) && defined(HAS_LONG_DOUBLE) && defined(HAS_PRIgldbl)
7495 #define Gconvert(x,n,t,b) sprintf((b),"%.*"$sPRIgldbl,(n),(x))
7497 #define Gconvert(x,n,t,b) sprintf((b),"%.*g",(n),(x))
7499 char *myname = "sprintf";
7503 #if defined(USE_LONG_DOUBLE) && defined(HAS_LONG_DOUBLE)
7504 #define DOUBLETYPE long double
7506 #define DOUBLETYPE double
7512 #define I_STDLIB $i_stdlib
7518 checkit(expect, got)
7522 if (strcmp(expect, got)) {
7523 printf("%s oddity: Expected %s, got %s\n",
7524 myname, expect, got);
7534 /* This must be 1st test on (which?) platform */
7535 /* Alan Burlison <AlanBurlsin@unn.unisys.com> */
7536 Gconvert((DOUBLETYPE)0.1, 8, 0, buf);
7537 checkit("0.1", buf);
7539 Gconvert((DOUBLETYPE)1.0, 8, 0, buf);
7542 Gconvert((DOUBLETYPE)1.1, 8, 0, buf);
7543 checkit("1.1", buf);
7545 Gconvert((DOUBLETYPE)1.01, 8, 0, buf);
7546 checkit("1.01", buf);
7548 Gconvert((DOUBLETYPE)1.001, 8, 0, buf);
7549 checkit("1.001", buf);
7551 Gconvert((DOUBLETYPE)1.0001, 8, 0, buf);
7552 checkit("1.0001", buf);
7554 Gconvert((DOUBLETYPE)1.00001, 8, 0, buf);
7555 checkit("1.00001", buf);
7557 Gconvert((DOUBLETYPE)1.000001, 8, 0, buf);
7558 checkit("1.000001", buf);
7560 Gconvert((DOUBLETYPE)0.0, 8, 0, buf);
7563 Gconvert((DOUBLETYPE)-1.0, 8, 0, buf);
7566 /* Some Linux gcvt's give 1.e+5 here. */
7567 Gconvert((DOUBLETYPE)100000.0, 8, 0, buf);
7568 checkit("100000", buf);
7570 /* Some Linux gcvt's give -1.e+5 here. */
7571 Gconvert((DOUBLETYPE)-100000.0, 8, 0, buf);
7572 checkit("-100000", buf);
7577 case "$d_Gconvert" in
7578 gconvert*) xxx_list='gconvert gcvt sprintf' ;;
7579 gcvt*) xxx_list='gcvt gconvert sprintf' ;;
7580 sprintf*) xxx_list='sprintf gconvert gcvt' ;;
7581 *) xxx_list='gconvert gcvt sprintf' ;;
7584 case "$d_longdbl$uselongdouble$d_qgcvt" in
7585 "$define$define$define") xxx_list="`echo $xxx_list|sed 's/gcvt/qgcvt gcvt/'`" ;;
7588 for xxx_convert in $xxx_list; do
7589 echo "Trying $xxx_convert..."
7591 set try -DTRY_$xxx_convert
7592 if eval $compile; then
7593 echo "$xxx_convert() found." >&4
7595 echo "I'll use $xxx_convert to convert floats into a string." >&4
7598 echo "...But $xxx_convert didn't work as I expected."
7601 echo "$xxx_convert NOT found." >&4
7605 case "$xxx_convert" in
7606 gconvert) d_Gconvert='gconvert((x),(n),(t),(b))' ;;
7607 gcvt) d_Gconvert='gcvt((x),(n),(b))' ;;
7608 qgcvt) d_Gconvert='qgcvt((x),(n),(b))' ;;
7609 *) case "$uselongdouble$d_longdbl$d_PRIgldbl" in
7610 "$define$define$define")
7611 d_Gconvert="sprintf((b),\"%.*$sPRIgldbl\",(n),(x))" ;;
7612 *) d_Gconvert='sprintf((b),"%.*g",(n),(x))' ;;
7618 : Initialize h_fcntl
7621 : Initialize h_sysfile
7624 : access call always available on UNIX
7628 : locate the flags for 'access()'
7632 $cat >access.c <<'EOCP'
7633 #include <sys/types.h>
7638 #include <sys/file.h>
7647 : check sys/file.h first, no particular reason here
7648 if $test `./findhdr sys/file.h` && \
7649 $cc $cppflags -DI_SYS_FILE -o access access.c >/dev/null 2>&1 ; then
7651 echo "<sys/file.h> defines the *_OK access constants." >&4
7652 elif $test `./findhdr fcntl.h` && \
7653 $cc $cppflags -DI_FCNTL -o access access.c >/dev/null 2>&1 ; then
7655 echo "<fcntl.h> defines the *_OK access constants." >&4
7656 elif $test `./findhdr unistd.h` && \
7657 $cc $cppflags -DI_UNISTD -o access access.c >/dev/null 2>&1 ; then
7658 echo "<unistd.h> defines the *_OK access constants." >&4
7660 echo "I can't find the four *_OK access constants--I'll use mine." >&4
7666 : see if accessx exists
7667 set accessx d_accessx
7670 : see if alarm exists
7674 : see if atolf exists
7678 : see if atoll exists
7682 : Look for GNU-cc style attribute checking
7684 echo "Checking whether your compiler can handle __attribute__ ..." >&4
7685 $cat >attrib.c <<'EOCP'
7687 void croak (char* pat,...) __attribute__((format(printf,1,2),noreturn));
7689 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
7690 if $contains 'warning' attrib.out >/dev/null 2>&1; then
7691 echo "Your C compiler doesn't fully support __attribute__."
7694 echo "Your C compiler supports __attribute__."
7698 echo "Your C compiler doesn't seem to understand __attribute__ at all."
7705 : see if bcmp exists
7709 : see if bcopy exists
7713 : see if this is a unistd.h system
7714 set unistd.h i_unistd
7717 : see if getpgrp exists
7718 set getpgrp d_getpgrp
7721 case "$d_getpgrp" in
7724 echo "Checking to see which flavor of getpgrp is in use..."
7727 #include <sys/types.h>
7729 # include <unistd.h>
7733 if (getuid() == 0) {
7734 printf("(I see you are running Configure as super-user...)\n");
7738 if (getpgrp(1) == 0)
7747 if $cc -DTRY_BSD_PGRP $ccflags $ldflags -o set set.c $libs >/dev/null 2>&1 && ./set; then
7748 echo "You have to use getpgrp(pid) instead of getpgrp()." >&4
7750 elif $cc $ccflags $ldflags -o set set.c $libs >/dev/null 2>&1 && ./set; then
7751 echo "You have to use getpgrp() instead of getpgrp(pid)." >&4
7754 echo "I can't seem to compile and run the test program."
7756 xxx="a USG one, i.e. you use getpgrp()."
7758 # SVR4 systems can appear rather BSD-ish.
7761 xxx="a BSD one, i.e. you use getpgrp(pid)."
7765 xxx="probably a USG one, i.e. you use getpgrp()."
7770 echo "Assuming your getpgrp is $xxx" >&4
7779 : see if setpgrp exists
7780 set setpgrp d_setpgrp
7783 case "$d_setpgrp" in
7786 echo "Checking to see which flavor of setpgrp is in use..."
7789 #include <sys/types.h>
7791 # include <unistd.h>
7795 if (getuid() == 0) {
7796 printf("(I see you are running Configure as super-user...)\n");
7800 if (-1 == setpgrp(1, 1))
7803 if (setpgrp() != -1)
7809 if $cc -DTRY_BSD_PGRP $ccflags $ldflags -o set set.c $libs >/dev/null 2>&1 && ./set; then
7810 echo 'You have to use setpgrp(pid,pgrp) instead of setpgrp().' >&4
7812 elif $cc $ccflags $ldflags -o set set.c $libs >/dev/null 2>&1 && ./set; then
7813 echo 'You have to use setpgrp() instead of setpgrp(pid,pgrp).' >&4
7816 echo "(I can't seem to compile and run the test program.)"
7818 xxx="a USG one, i.e. you use setpgrp()."
7820 # SVR4 systems can appear rather BSD-ish.
7823 xxx="a BSD one, i.e. you use setpgrp(pid,pgrp)."
7827 xxx="probably a USG one, i.e. you use setpgrp()."
7832 echo "Assuming your setpgrp is $xxx" >&4
7840 : see if bzero exists
7844 : see if signal is declared as pointer to function returning int or void
7846 xxx=`./findhdr signal.h`
7847 $test "$xxx" && $cppstdin $cppminus $cppflags < $xxx >$$.tmp 2>/dev/null
7848 if $contains 'int.*\*[ ]*signal' $$.tmp >/dev/null 2>&1 ; then
7849 echo "You have int (*signal())() instead of void." >&4
7851 elif $contains 'void.*\*[ ]*signal' $$.tmp >/dev/null 2>&1 ; then
7852 echo "You have void (*signal())()." >&4
7854 elif $contains 'extern[ ]*[(\*]*signal' $$.tmp >/dev/null 2>&1 ; then
7855 echo "You have int (*signal())() instead of void." >&4
7857 elif $contains 'void.*\*.*sig' $$.tmp >/dev/null 2>&1 ; then
7858 echo "You have void (*signal())()." >&4
7861 case "$d_voidsig" in
7863 echo "I can't determine whether signal handler returns void or int..." >&4
7865 rp="What type does your signal handler return?"
7872 echo "As you already told me, signal handler returns void." >&4
7875 *) echo "As you already told me, signal handler returns int." >&4
7882 case "$d_voidsig" in
7883 "$define") signal_t="void";;
7888 : check for ability to cast large floats to 32-bit ints.
7890 echo 'Checking whether your C compiler can cast large floats to int32.' >&4
7891 if $test "$intsize" -ge 4; then
7898 #include <sys/types.h>
7900 $signal_t blech(s) int s; { exit(3); }
7907 signal(SIGFPE, blech);
7909 /* Don't let compiler optimize the test away. Store the number
7910 in a writable string for gcc to pass to sscanf under HP/UX.
7912 sprintf(str, "2147483647");
7913 sscanf(str, "%lf", &f); /* f = (double) 0x7fffffff; */
7917 /* x86 processors will probably give 0x8000 0000, which is a
7918 sign change. We don't want that. We want to mimic SPARC
7919 behavior here, which is to preserve the sign and give
7922 if (i32 != ($xxx) f)
7928 if eval $compile_ok; then
7932 echo "(I can't seem to compile the test program--assuming it can't)"
7940 echo "Nope, it can't."
7947 : check for ability to cast negative floats to unsigned
7949 echo 'Checking whether your C compiler can cast negative float to unsigned.' >&4
7952 #include <sys/types.h>
7954 $signal_t blech(s) int s; { exit(7); }
7955 $signal_t blech_in_list(s) int s; { exit(4); }
7956 unsigned long dummy_long(p) unsigned long p; { return p; }
7957 unsigned int dummy_int(p) unsigned int p; { return p; }
7958 unsigned short dummy_short(p) unsigned short p; { return p; }
7962 unsigned long along;
7964 unsigned short ashort;
7968 /* Frustrate gcc-2.7.2's optimizer which failed this test with
7969 a direct f = -123. assignment. gcc-2.8.0 reportedly
7970 optimized the whole file away
7972 /* Store the number in a writable string for gcc to pass to
7975 sprintf(str, "-123");
7976 sscanf(str, "%lf", &f); /* f = -123.; */
7978 signal(SIGFPE, blech);
7979 along = (unsigned long)f;
7980 aint = (unsigned int)f;
7981 ashort = (unsigned short)f;
7982 if (along != (unsigned long)-123)
7984 if (aint != (unsigned int)-123)
7986 if (ashort != (unsigned short)-123)
7988 sprintf(str, "1073741824.");
7989 sscanf(str, "%lf", &f); /* f = (double)0x40000000; */
7992 along = (unsigned long)f;
7993 if (along != 0x80000000)
7997 along = (unsigned long)f;
7998 if (along != 0x7fffffff)
8002 along = (unsigned long)f;
8003 if (along != 0x80000001)
8007 signal(SIGFPE, blech_in_list);
8008 sprintf(str, "123.");
8009 sscanf(str, "%lf", &f); /* f = 123.; */
8010 along = dummy_long((unsigned long)f);
8011 aint = dummy_int((unsigned int)f);
8012 ashort = dummy_short((unsigned short)f);
8013 if (along != (unsigned long)123)
8015 if (aint != (unsigned int)123)
8017 if (ashort != (unsigned short)123)
8024 if eval $compile_ok; then
8028 echo "(I can't seem to compile the test program--assuming it can't)"
8031 case "$castflags" in
8036 echo "Nope, it can't."
8043 : see if vprintf exists
8045 if set vprintf val -f d_vprintf; eval $csym; $val; then
8046 echo 'vprintf() found.' >&4
8048 $cat >vprintf.c <<'EOF'
8049 #include <varargs.h>
8051 int main() { xxx("foo"); }
8060 exit((unsigned long)vsprintf(buf,"%s",args) > 10L);
8064 if eval $compile && ./vprintf; then
8065 echo "Your vsprintf() returns (int)." >&4
8068 echo "Your vsprintf() returns (char*)." >&4
8072 echo 'vprintf() NOT found.' >&4
8082 : see if chown exists
8086 : see if chroot exists
8090 : see if chsize exists
8094 : check for const keyword
8096 echo 'Checking to see if your C compiler knows about "const"...' >&4
8097 $cat >const.c <<'EOCP'
8098 typedef struct spug { int drokk; } spug;
8105 if $cc -c $ccflags const.c >/dev/null 2>&1 ; then
8107 echo "Yup, it does."
8110 echo "Nope, it doesn't."
8115 : see if crypt exists
8117 if set crypt val -f d_crypt; eval $csym; $val; then
8118 echo 'crypt() found.' >&4
8122 cryptlib=`./loc Slibcrypt$_a "" $xlibpth`
8123 if $test -z "$cryptlib"; then
8124 cryptlib=`./loc Mlibcrypt$_a "" $xlibpth`
8128 if $test -z "$cryptlib"; then
8129 cryptlib=`./loc Llibcrypt$_a "" $xlibpth`
8133 if $test -z "$cryptlib"; then
8134 cryptlib=`./loc libcrypt$_a "" $libpth`
8138 if $test -z "$cryptlib"; then
8139 echo 'crypt() NOT found.' >&4
8148 : get csh whereabouts
8150 'csh') val="$undef" ;;
8155 : Respect a hint or command line value for full_csh.
8157 '') full_csh=$csh ;;
8160 : see if cuserid exists
8161 set cuserid d_cuserid
8164 : see if this is a limits.h system
8165 set limits.h i_limits
8168 : see if this is a float.h system
8172 : See if number of significant digits in a double precision number is known
8174 $cat >dbl_dig.c <<EOM
8184 printf("Contains DBL_DIG");
8187 $cppstdin $cppflags $cppminus < dbl_dig.c >dbl_dig.E 2>/dev/null
8188 if $contains 'DBL_DIG' dbl_dig.E >/dev/null 2>&1; then
8189 echo "DBL_DIG found." >&4
8192 echo "DBL_DIG NOT found." >&4
8199 : see if difftime exists
8200 set difftime d_difftime
8203 : see if this is a dirent system
8205 if xinc=`./findhdr dirent.h`; $test "$xinc"; then
8207 echo "<dirent.h> found." >&4
8210 if xinc=`./findhdr sys/dir.h`; $test "$xinc"; then
8211 echo "<sys/dir.h> found." >&4
8214 xinc=`./findhdr sys/ndir.h`
8216 echo "<dirent.h> NOT found." >&4
8221 : Look for type of directory structure.
8223 $cppstdin $cppflags $cppminus < "$xinc" > try.c
8225 case "$direntrytype" in
8228 $define) guess1='struct dirent' ;;
8229 *) guess1='struct direct' ;;
8232 *) guess1="$direntrytype"
8237 'struct dirent') guess2='struct direct' ;;
8238 *) guess2='struct dirent' ;;
8241 if $contains "$guess1" try.c >/dev/null 2>&1; then
8242 direntrytype="$guess1"
8243 echo "Your directory entries are $direntrytype." >&4
8244 elif $contains "$guess2" try.c >/dev/null 2>&1; then
8245 direntrytype="$guess2"
8246 echo "Your directory entries seem to be $direntrytype." >&4
8248 echo "I don't recognize your system's directory entries." >&4
8249 rp="What type is used for directory entries on this system?"
8257 : see if the directory entry stores field length
8259 $cppstdin $cppflags $cppminus < "$xinc" > try.c
8260 if $contains 'd_namlen' try.c >/dev/null 2>&1; then
8261 echo "Good, your directory entry keeps length information in d_namlen." >&4
8264 echo "Your directory entry does not know about the d_namlen field." >&4
8271 : see if dlerror exists
8274 set dlerror d_dlerror
8278 : see if dlfcn is available
8286 On a few systems, the dynamically loaded modules that perl generates and uses
8287 will need a different extension than shared libs. The default will probably
8295 rp='What is the extension of dynamically loaded modules'
8304 : Check if dlsym need a leading underscore
8310 echo "Checking whether your dlsym() needs a leading underscore ..." >&4
8311 $cat >dyna.c <<'EOM'
8320 #include <dlfcn.h> /* the dynamic linker include file for Sunos/Solaris */
8322 #include <sys/types.h>
8336 int mode = RTLD_LAZY ;
8338 handle = dlopen("./dyna.$dlext", mode) ;
8339 if (handle == NULL) {
8344 symbol = dlsym(handle, "fred") ;
8345 if (symbol == NULL) {
8346 /* try putting a leading underscore */
8347 symbol = dlsym(handle, "_fred") ;
8348 if (symbol == NULL) {
8361 : Call the object file tmp-dyna.o in case dlext=o.
8362 if $cc $ccflags $cccdlflags -c dyna.c > /dev/null 2>&1 &&
8363 mv dyna${_o} tmp-dyna${_o} > /dev/null 2>&1 &&
8364 $ld $lddlflags -o dyna.$dlext tmp-dyna${_o} > /dev/null 2>&1 &&
8365 $cc $ccflags -o fred $ldflags $cccdlflags $ccdlflags fred.c $libs > /dev/null 2>&1; then
8368 1) echo "Test program failed using dlopen." >&4
8369 echo "Perhaps you should not use dynamic loading." >&4;;
8370 2) echo "Test program failed using dlsym." >&4
8371 echo "Perhaps you should not use dynamic loading." >&4;;
8372 3) echo "dlsym needs a leading underscore" >&4
8374 4) echo "dlsym doesn't need a leading underscore." >&4;;
8377 echo "I can't compile and run the test program." >&4
8378 echo "I'm guessing that dlsym doesn't need a leading underscore." >&4
8383 $rm -f fred fred.? dyna.$dlext dyna.? tmp-dyna.?
8388 hasproto='varname=$1; func=$2; shift; shift;
8389 while $test $# -ge 2; do
8391 $define) echo "#include <$2>";;
8395 $cppstdin $cppflags $cppminus < try.c > tryout.c 2>/dev/null;
8396 if $contains "$func.*(" tryout.c >/dev/null 2>&1; then
8397 echo "$func() prototype found.";
8400 echo "$func() prototype NOT found.";
8405 $rm -f try.c tryout.c'
8407 : see if prototype for drand48 is available
8409 set d_drand48proto drand48 $i_stdlib stdlib.h $i_unistd unistd.h
8412 : see if dup2 exists
8416 : see if eaccess exists
8417 set eaccess d_eaccess
8420 : see if endgrent exists
8421 set endgrent d_endgrent
8424 : see if endhostent exists
8425 set endhostent d_endhent
8428 : see if endnetent exists
8429 set endnetent d_endnent
8432 : see if endprotoent exists
8433 set endprotoent d_endpent
8436 : see if endpwent exists
8437 set endpwent d_endpwent
8440 : see if endservent exists
8441 set endservent d_endsent
8444 : see if endspent exists
8445 set endspent d_endspent
8448 : Locate the flags for 'open()'
8450 $cat >open3.c <<'EOCP'
8451 #include <sys/types.h>
8456 #include <sys/file.h>
8467 : check sys/file.h first to get FREAD on Sun
8468 if $test `./findhdr sys/file.h` && \
8469 set open3 -DI_SYS_FILE && eval $compile; then
8471 echo "<sys/file.h> defines the O_* constants..." >&4
8473 echo "and you have the 3 argument form of open()." >&4
8476 echo "but not the 3 argument form of open(). Oh, well." >&4
8479 elif $test `./findhdr fcntl.h` && \
8480 set open3 -DI_FCNTL && eval $compile; then
8482 echo "<fcntl.h> defines the O_* constants..." >&4
8484 echo "and you have the 3 argument form of open()." >&4
8487 echo "but not the 3 argument form of open(). Oh, well." >&4
8492 echo "I can't find the O_* constant definitions! You got problems." >&4
8498 : see which of string.h or strings.h is needed
8500 strings=`./findhdr string.h`
8501 if $test "$strings" && $test -r "$strings"; then
8502 echo "Using <string.h> instead of <strings.h>." >&4
8506 strings=`./findhdr strings.h`
8507 if $test "$strings" && $test -r "$strings"; then
8508 echo "Using <strings.h> instead of <string.h>." >&4
8510 echo "No string header found -- You'll surely have problems." >&4
8516 "$undef") strings=`./findhdr strings.h`;;
8517 *) strings=`./findhdr string.h`;;
8520 : check for non-blocking I/O stuff
8521 case "$h_sysfile" in
8522 true) echo "#include <sys/file.h>" > head.c;;
8525 true) echo "#include <fcntl.h>" > head.c;;
8526 *) echo "#include <sys/fcntl.h>" > head.c;;
8531 echo "Figuring out the flag used by open() for non-blocking I/O..." >&4
8532 case "$o_nonblock" in
8535 $cat >>try.c <<'EOCP'
8539 printf("O_NONBLOCK\n");
8543 printf("O_NDELAY\n");
8547 printf("FNDELAY\n");
8554 if eval $compile_ok; then
8556 case "$o_nonblock" in
8557 '') echo "I can't figure it out, assuming O_NONBLOCK will do.";;
8558 *) echo "Seems like we can use $o_nonblock.";;
8561 echo "(I can't compile the test program; pray O_NONBLOCK is right!)"
8564 *) echo "Using $hint value $o_nonblock.";;
8566 $rm -f try try.* .out core
8569 echo "Let's see what value errno gets from read() on a $o_nonblock file..." >&4
8575 #include <sys/types.h>
8578 #define MY_O_NONBLOCK $o_nonblock
8579 #ifndef errno /* XXX need better Configure test */
8589 #include <strings.h>
8591 $signal_t blech(x) int x; { exit(3); }
8593 $cat >> try.c <<'EOCP'
8601 pipe(pd); /* Down: child -> parent */
8602 pipe(pu); /* Up: parent -> child */
8605 close(pd[1]); /* Parent reads from pd[0] */
8606 close(pu[0]); /* Parent writes (blocking) to pu[1] */
8607 if (-1 == fcntl(pd[0], F_SETFL, MY_O_NONBLOCK))
8609 signal(SIGALRM, blech);
8611 if ((ret = read(pd[0], buf, 1)) > 0) /* Nothing to read! */
8613 sprintf(string, "%d\n", ret);
8614 write(2, string, strlen(string));
8617 if (errno == EAGAIN) {
8623 if (errno == EWOULDBLOCK)
8624 printf("EWOULDBLOCK\n");
8627 write(pu[1], buf, 1); /* Unblocks child, tell it to close our pipe */
8628 sleep(2); /* Give it time to close our pipe */
8630 ret = read(pd[0], buf, 1); /* Should read EOF */
8632 sprintf(string, "%d\n", ret);
8633 write(3, string, strlen(string));
8637 close(pd[0]); /* We write to pd[1] */
8638 close(pu[1]); /* We read from pu[0] */
8639 read(pu[0], buf, 1); /* Wait for parent to signal us we may continue */
8640 close(pd[1]); /* Pipe pd is now fully closed! */
8641 exit(0); /* Bye bye, thank you for playing! */
8645 if eval $compile_ok; then
8646 echo "$startsh" >mtry
8647 echo "./try >try.out 2>try.ret 3>try.err || exit 4" >>mtry
8649 ./mtry >/dev/null 2>&1
8651 0) eagain=`$cat try.out`;;
8652 1) echo "Could not perform non-blocking setting!";;
8653 2) echo "I did a successful read() for something that was not there!";;
8654 3) echo "Hmm... non-blocking I/O does not seem to be working!";;
8655 *) echo "Something terribly wrong happened during testing.";;
8657 rd_nodata=`$cat try.ret`
8658 echo "A read() system call with no data present returns $rd_nodata."
8659 case "$rd_nodata" in
8662 echo "(That's peculiar, fixing that to be -1.)"
8668 echo "Forcing errno EAGAIN on read() with no data available."
8672 echo "Your read() sets errno to $eagain when no data is available."
8675 status=`$cat try.err`
8677 0) echo "And it correctly returns 0 to signal EOF.";;
8678 -1) echo "But it also returns -1 to signal EOF, so be careful!";;
8679 *) echo "However, your read() returns '$status' on EOF??";;
8682 if test "$status" = "$rd_nodata"; then
8683 echo "WARNING: you can't distinguish between EOF and no data!"
8687 echo "I can't compile the test program--assuming errno EAGAIN will do."
8694 echo "Using $hint value $eagain."
8695 echo "Your read() returns $rd_nodata when no data is present."
8696 case "$d_eofnblk" in
8697 "$define") echo "And you can see EOF because read() returns 0.";;
8698 "$undef") echo "But you can't see EOF status from read() returned value.";;
8700 echo "(Assuming you can't see EOF status from read anyway.)"
8706 $rm -f try try.* .out core head.c mtry
8708 : see if fchmod exists
8712 : see if fchown exists
8716 : see if this is an fcntl system
8720 hasfield='varname=$1; struct=$2; field=$3; shift; shift; shift;
8721 while $test $# -ge 2; do
8723 $define) echo "#include <$2>";;
8727 echo "int main () { struct $struct foo; char* bar; bar = (char*)foo.$field; }" >> try.c;
8729 if eval $compile; then
8740 : see whether socket exists
8742 $echo $n "Hmm... $c" >&4
8743 if set socket val -f d_socket; eval $csym; $val; then
8744 echo "Looks like you have Berkeley networking support." >&4
8746 if set setsockopt val -f; eval $csym; $val; then
8749 echo "...but it uses the old BSD 4.1c interface, rather than 4.2." >&4
8753 if $contains socklib libc.list >/dev/null 2>&1; then
8754 echo "Looks like you have Berkeley networking support." >&4
8756 : we will have to assume that it supports the 4.2 BSD interface
8759 echo "You don't have Berkeley networking in libc$_a..." >&4
8760 if test "X$d_socket" = "X$define"; then
8761 echo "...but you seem to believe that you have sockets." >&4
8763 for net in net socket
8765 if test -f /usr/lib/lib$net$_a; then
8766 ( ($nm $nm_opt /usr/lib/lib$net$_a | eval $nm_extract) || \
8767 $ar t /usr/lib/lib$net$_a) 2>/dev/null >> libc.list
8768 if $contains socket libc.list >/dev/null 2>&1; then
8773 echo "...but the Wollongong group seems to have hacked it in." >&4
8774 sockethdr="-I/usr/netinclude"
8777 echo "Found Berkeley sockets interface in lib$net." >& 4
8778 if $contains setsockopt libc.list >/dev/null 2>&1; then
8781 echo "...using the old BSD 4.1c interface, rather than 4.2." >&4
8788 if test "X$d_socket" != "X$define"; then
8789 echo "or anywhere else I see." >&4
8797 : see if socketpair exists
8798 set socketpair d_sockpair
8803 echo "Checking the availability of certain socket constants..." >& 4
8804 for ENUM in MSG_CTRUNC MSG_DONTROUTE MSG_OOB MSG_PEEK MSG_PROXY SCM_RIGHTS; do
8805 enum=`$echo $ENUM|./tr '[A-Z]' '[a-z]'`
8807 #include <sys/types.h>
8808 #include <sys/socket.h>
8814 set try; if eval $compile; then
8817 set d_${enum}; eval $setvar
8821 : see if sys/select.h has to be included
8822 set sys/select.h i_sysselct
8825 : see if we should include time.h, sys/time.h, or both
8827 if test "X$timeincl" = X; then
8828 echo "Testing to see if we should include <time.h>, <sys/time.h> or both." >&4
8829 $echo $n "I'm now running the test program...$c"
8830 $cat >try.c <<'EOCP'
8831 #include <sys/types.h>
8836 #ifdef SYSTIMEKERNEL
8839 #include <sys/time.h>
8842 #include <sys/select.h>
8851 struct timezone tzp;
8853 if (foo.tm_sec == foo.tm_sec)
8856 if (bar.tv_sec == bar.tv_sec)
8863 for s_timezone in '-DS_TIMEZONE' ''; do
8865 for s_timeval in '-DS_TIMEVAL' ''; do
8866 for i_systimek in '' '-DSYSTIMEKERNEL'; do
8867 for i_time in '' '-DI_TIME'; do
8868 for i_systime in '-DI_SYSTIME' ''; do
8871 set try $i_time $i_systime $i_systimek $sysselect $s_timeval $s_timezone
8872 if eval $compile; then
8873 set X $i_time $i_systime $i_systimek $sysselect $s_timeval
8877 $echo $n "Succeeded with $flags$c"
8889 *SYSTIMEKERNEL*) i_systimek="$define"
8890 timeincl=`./findhdr sys/time.h`
8891 echo "We'll include <sys/time.h> with KERNEL defined." >&4;;
8892 *) i_systimek="$undef";;
8895 *I_TIME*) i_time="$define"
8896 timeincl=`./findhdr time.h`" $timeincl"
8897 echo "We'll include <time.h>." >&4;;
8898 *) i_time="$undef";;
8901 *I_SYSTIME*) i_systime="$define"
8902 timeincl=`./findhdr sys/time.h`" $timeincl"
8903 echo "We'll include <sys/time.h>." >&4;;
8904 *) i_systime="$undef";;
8909 : check for fd_set items
8912 Checking to see how well your C compiler handles fd_set and friends ...
8914 $cat >fd_set.c <<EOCP
8915 #$i_systime I_SYS_TIME
8916 #$i_sysselct I_SYS_SELECT
8917 #$d_socket HAS_SOCKET
8918 #include <sys/types.h>
8920 #include <sys/socket.h> /* Might include <sys/bsdtypes.h> */
8923 #include <sys/time.h>
8926 #include <sys/select.h>
8935 #if defined(FD_SET) && defined(FD_CLR) && defined(FD_ISSET) && defined(FD_ZERO)
8942 set fd_set -DTRYBITS
8943 if eval $compile; then
8944 d_fds_bits="$define"
8946 echo "Well, your system knows about the normal fd_set typedef..." >&4
8948 echo "and you have the normal fd_set macros (just as I'd expect)." >&4
8949 d_fd_macros="$define"
8952 but not the normal fd_set macros! Gaaack! I'll have to cover for you.
8954 d_fd_macros="$undef"
8958 Hmm, your compiler has some difficulty with fd_set. Checking further...
8961 if eval $compile; then
8964 echo "Well, your system has some sort of fd_set available..." >&4
8966 echo "and you have the normal fd_set macros." >&4
8967 d_fd_macros="$define"
8970 but not the normal fd_set macros! Gross! More work for me...
8972 d_fd_macros="$undef"
8975 echo "Well, you got zip. That's OK, I can roll my own fd_set stuff." >&4
8978 d_fd_macros="$undef"
8983 : see if fgetpos exists
8984 set fgetpos d_fgetpos
8987 : see if flock exists
8991 : see if fork exists
8995 : see if pathconf exists
8996 set pathconf d_pathconf
8999 : see if fpathconf exists
9000 set fpathconf d_fpathconf
9004 : check for fpos64_t
9006 echo "Checking to see if you have fpos64_t..." >&4
9009 int main() { fpos64_t x = 7; }
9012 if eval $compile; then
9014 echo "You have fpos64_t."
9017 echo "You do not have fpos64_t."
9019 8) echo "(Your fpos_t is 64 bits, so you could use that.)" ;;
9026 hasstruct='varname=$1; struct=$2; shift; shift;
9027 while $test $# -ge 2; do
9029 $define) echo "#include <$2>";;
9033 echo "int main () { struct $struct foo; }" >> try.c;
9035 if eval $compile; then
9044 : see if this is a sys/param system
9045 set sys/param.h i_sysparam
9048 : see if this is a sys/mount.h system
9049 set sys/mount.h i_sysmount
9052 : see if sys/types.h has to be included
9053 set sys/types.h i_systypes
9058 echo "Checking to see if your system supports struct fs_data..." >&4
9059 set d_fs_data_s fs_data $i_systypes sys/types.h $i_sysparam sys/param.h $i_sysmount sys/mount.h
9061 case "$d_fs_data_s" in
9062 "$define") echo "Yes, it does." ;;
9063 *) echo "No, it doesn't." ;;
9066 : see if fseeko exists
9070 8) echo "(Your long is 64 bits, so you could use fseek.)" ;;
9073 : see if fsetpos exists
9074 set fsetpos d_fsetpos
9078 : see if fstatfs exists
9079 set fstatfs d_fstatfs
9083 : see if statvfs exists
9084 set statvfs d_statvfs
9087 : see if fstatvfs exists
9088 set fstatvfs d_fstatvfs
9092 : see if ftello exists
9096 8) echo "(Your long is 64 bits, so you could use ftell.)" ;;
9099 : see if getcwd exists
9104 : see if getfsstat exists
9105 set getfsstat d_getfsstat
9108 : see if getgrent exists
9109 set getgrent d_getgrent
9112 : see if gethostbyaddr exists
9113 set gethostbyaddr d_gethbyaddr
9116 : see if gethostbyname exists
9117 set gethostbyname d_gethbyname
9120 : see if gethostent exists
9121 set gethostent d_gethent
9124 : see how we will look up host name
9127 if set gethostname val -f d_gethname; eval $csym; $val; then
9128 echo 'gethostname() found.' >&4
9129 d_gethname="$define"
9132 if set uname val -f d_uname; eval $csym; $val; then
9135 uname() was found, but you're running xenix, and older versions of xenix
9136 have a broken uname(). If you don't really know whether your xenix is old
9137 enough to have a broken system call, use the default answer.
9144 rp='Is your uname() broken?'
9147 n*) d_uname="$define"; call=uname;;
9150 echo 'uname() found.' >&4
9157 case "$d_gethname" in
9158 '') d_gethname="$undef";;
9161 '') d_uname="$undef";;
9163 case "$d_uname$d_gethname" in
9168 Every now and then someone has a $call() that lies about the hostname
9169 but can't be fixed for political or economic reasons. If you wish, I can
9170 pretend $call() isn't there and maybe compute hostname at run-time
9171 thanks to the '$phostname' command.
9174 rp="Shall I ignore $call() from now on?"
9177 y*) d_uname="$undef" d_gethname="$undef"; $echo $n "Okay...$c";;
9180 case "$phostname" in
9182 *) case "$aphostname" in
9188 file=`./loc $file $file $pth`
9189 aphostname=`echo $file $*`
9194 case "$d_uname$d_gethname" in
9197 case "$phostname" in
9199 echo "There will be no way for $package to get your hostname." >&4;;
9201 echo "I'll use 'popen("'"'$aphostname'", "r")'"' to get your hostname." >&4
9205 case "$d_phostname" in
9206 '') d_phostname="$undef";;
9209 : see if this is a netdb.h system
9213 : see if prototypes for various gethostxxx netdb.h functions are available
9215 set d_gethostprotos gethostent $i_netdb netdb.h
9218 : see if getlogin exists
9219 set getlogin d_getlogin
9222 : see if getmnt exists
9226 : see if getmntent exists
9227 set getmntent d_getmntent
9230 : see if getnetbyaddr exists
9231 set getnetbyaddr d_getnbyaddr
9234 : see if getnetbyname exists
9235 set getnetbyname d_getnbyname
9238 : see if getnetent exists
9239 set getnetent d_getnent
9242 : see if prototypes for various getnetxxx netdb.h functions are available
9244 set d_getnetprotos getnetent $i_netdb netdb.h
9248 : see if getprotobyname exists
9249 set getprotobyname d_getpbyname
9252 : see if getprotobynumber exists
9253 set getprotobynumber d_getpbynumber
9256 : see if getprotoent exists
9257 set getprotoent d_getpent
9260 : see if getpgid exists
9261 set getpgid d_getpgid
9264 : see if getpgrp2 exists
9265 set getpgrp2 d_getpgrp2
9268 : see if getppid exists
9269 set getppid d_getppid
9272 : see if getpriority exists
9273 set getpriority d_getprior
9276 : see if prototypes for various getprotoxxx netdb.h functions are available
9278 set d_getprotoprotos getprotoent $i_netdb netdb.h
9281 : see if getpwent exists
9282 set getpwent d_getpwent
9286 : see if getservbyname exists
9287 set getservbyname d_getsbyname
9290 : see if getservbyport exists
9291 set getservbyport d_getsbyport
9294 : see if getservent exists
9295 set getservent d_getsent
9298 : see if prototypes for various getservxxx netdb.h functions are available
9300 set d_getservprotos getservent $i_netdb netdb.h
9303 : see if getspent exists
9304 set getspent d_getspent
9307 : see if getspnam exists
9308 set getspnam d_getspnam
9311 : see if gettimeofday or ftime exists
9312 set gettimeofday d_gettimeod
9314 case "$d_gettimeod" in
9320 val="$undef"; set d_ftime; eval $setvar
9323 case "$d_gettimeod$d_ftime" in
9326 echo 'No ftime() nor gettimeofday() -- timing may be less accurate.' >&4
9330 : see if this is an grp system
9336 xxx=`./findhdr grp.h`
9337 $cppstdin $cppflags $cppminus < $xxx >$$.h
9339 if $contains 'gr_passwd' $$.h >/dev/null 2>&1; then
9351 set d_grpasswd; eval $setvar
9355 : see if hasmntopt exists
9356 set hasmntopt d_hasmntopt
9359 : see if this is a netinet/in.h or sys/in.h system
9360 set netinet/in.h i_niin sys/in.h i_sysin
9363 : see if arpa/inet.h has to be included
9364 set arpa/inet.h i_arpainet
9367 : see if htonl --and friends-- exists
9372 : Maybe they are macros.
9377 #include <sys/types.h>
9378 #$i_niin I_NETINET_IN
9380 #$i_arpainet I_ARPA_INET
9382 #include <netinet/in.h>
9388 #include <arpa/inet.h>
9391 printf("Defined as a macro.");
9394 $cppstdin $cppflags $cppminus < htonl.c >htonl.E 2>/dev/null
9395 if $contains 'Defined as a macro' htonl.E >/dev/null 2>&1; then
9397 echo "But it seems to be defined as a macro." >&4
9405 : see if iconv exists
9411 if set index val -f; eval $csym; $val; then
9412 if set strchr val -f d_strchr; eval $csym; $val; then
9413 if $contains strchr "$strings" >/dev/null 2>&1 ; then
9416 echo "strchr() found." >&4
9420 echo "index() found." >&4
9425 echo "index() found." >&4
9428 if set strchr val -f d_strchr; eval $csym; $val; then
9431 echo "strchr() found." >&4
9433 echo "No index() or strchr() found!" >&4
9438 set d_strchr; eval $setvar
9440 set d_index; eval $setvar
9442 : check whether inet_aton exists
9443 set inet_aton d_inetaton
9446 : see if inttypes.h is available
9447 : we want a real compile instead of Inhdr because some systems
9448 : have an inttypes.h which includes non-existent headers
9451 #include <inttypes.h>
9453 static int32_t foo32 = 0x12345678;
9457 if eval $compile; then
9458 echo "<inttypes.h> found." >&4
9461 echo "<inttypes.h> NOT found." >&4
9470 echo "Checking to see if you have int64_t..." >&4
9472 #include <sys/types.h>
9473 #$i_inttypes I_INTTYPES
9475 #include <inttypes.h>
9477 int main() { int64_t x = 7; }
9480 if eval $compile; then
9482 echo "You have int64_t."
9485 echo "You do not have int64_t."
9493 $cat >isascii.c <<'EOCP'
9505 if eval $compile; then
9506 echo "isascii() found." >&4
9509 echo "isascii() NOT found." >&4
9516 : see if killpg exists
9520 : see if lchown exists
9522 $cat > try.c <<'EOCP'
9523 /* System header to define __stub macros and hopefully few prototypes,
9524 which can conflict with char lchown(); below. */
9526 /* Override any gcc2 internal prototype to avoid an error. */
9527 /* We use char because int might match the return type of a gcc2
9528 builtin and then its argument prototype would still apply. */
9531 /* The GNU C library defines this for functions which it implements
9532 to always fail with ENOSYS. Some functions are actually named
9533 something starting with __ and the normal name is an alias. */
9534 #if defined (__stub_lchown) || defined (__stub___lchown)
9542 if eval $compile; then
9543 $echo "lchown() found." >&4
9546 $echo "lchown() NOT found." >&4
9552 : See if number of significant digits in a double precision number is known
9554 $cat >ldbl_dig.c <<EOM
9564 printf("Contains LDBL_DIG");
9567 $cppstdin $cppflags $cppminus < ldbl_dig.c >ldbl_dig.E 2>/dev/null
9568 if $contains 'LDBL_DIG' ldbl_dig.E >/dev/null 2>&1; then
9569 echo "LDBL_DIG found." >&4
9572 echo "LDBL_DIG NOT found." >&4
9579 : see if link exists
9583 : see if localeconv exists
9584 set localeconv d_locconv
9587 : see if lockf exists
9591 : check for long long
9593 echo "Checking to see if you have long long..." >&4
9594 echo 'int main() { long long x = 7; return 0; }' > try.c
9596 if eval $compile; then
9598 echo "You have have long long."
9601 echo "You do not have long long."
9607 : check for length of long long
9608 case "${d_longlong}${longlongsize}" in
9611 echo "Checking to see how big your long longs are..." >&4
9612 $cat >try.c <<'EOCP'
9616 printf("%d\n", (int)sizeof(long long));
9621 if eval $compile_ok; then
9622 longlongsize=`./try$exe_ext`
9623 echo "Your long longs are $longlongsize bytes long."
9627 echo "(I can't seem to compile the test program. Guessing...)"
9628 rp="What is the size of a long long (in bytes)?"
9632 if $test "X$longsize" = "X$longlongsize"; then
9633 echo "(That isn't any different from an ordinary long.)"
9639 : see if prototype for lseek is available
9641 set d_lseekproto lseek $i_systypes sys/types.h $i_unistd unistd.h
9644 : see if lstat exists
9648 : see if madvise exists
9649 set madvise d_madvise
9652 : see if mblen exists
9656 : see if mbstowcs exists
9657 set mbstowcs d_mbstowcs
9660 : see if mbtowc exists
9664 : see if memchr exists
9668 : see if memcmp exists
9672 : see if memcpy exists
9676 : see if memmove exists
9677 set memmove d_memmove
9680 : see if memset exists
9684 : see if mkdir exists
9688 : see if mkdtemp exists
9689 set mkdtemp d_mkdtemp
9692 : see if mkfifo exists
9696 : see if mkstemp exists
9697 set mkstemp d_mkstemp
9700 : see if mkstemps exists
9701 set mkstemps d_mkstemps
9704 : see if mktime exists
9708 : see if this is a sys/mman.h system
9709 set sys/mman.h i_sysmman
9712 : see if mmap exists
9715 : see what shmat returns
9716 : default to something harmless
9718 case "$i_sysmman$d_mmap" in
9720 $cat >mmap.c <<'END'
9721 #include <sys/mman.h>
9724 if $cc $ccflags -c mmap.c >/dev/null 2>&1; then
9729 echo "and it returns ($mmaptype)." >&4
9735 : see if mprotect exists
9736 set mprotect d_mprotect
9739 : see if msgctl exists
9743 : see if msgget exists
9747 : see if msgsnd exists
9751 : see if msgrcv exists
9755 : see how much of the 'msg*(2)' library is present.
9758 case "$d_msgctl$d_msgget$d_msgsnd$d_msgrcv" in
9759 *"$undef"*) h_msg=false;;
9763 case "`ipcs 2>&1`" in
9764 "SVID messages"*"not configured"*)
9765 echo "Your $osname does not have the msg*(2) configured." >&4
9780 : we could also check for sys/ipc.h ...
9781 if $h_msg && $test `./findhdr sys/msg.h`; then
9782 echo "You have the full msg*(2) library." >&4
9785 echo "You don't have the full msg*(2) library." >&4
9791 : see if msync exists
9795 : see if munmap exists
9799 : see if nice exists
9805 echo "Checking which 64-bit integer type we could use..." >&4
9811 val='"unsigned int"'
9816 *) case "$longsize" in
9820 val='"unsigned long"'
9825 *) case "$d_longlong:$longlongsize" in
9830 val='"unsigned long long"'
9835 *) case "$d_int64_t" in
9854 '') echo "Alas, no 64-bit integer types in sight." >&4
9857 *) if test X"$use64bitint" = Xdefine -o X"$longsize" = X8; then
9862 echo "We $verb use '$quadtype' for 64-bit integers." >&4
9867 : check for length of character
9871 echo "Checking to see how big your characters are (hey, you never know)..." >&4
9872 $cat >try.c <<'EOCP'
9876 printf("%d\n", (int)sizeof(char));
9881 if eval $compile_ok; then
9885 echo "(I can't seem to compile the test program. Guessing...)"
9892 rp="What is the size of a character (in bytes)?"
9899 $echo "Choosing the C types to be used for Perl's internal types..." >&4
9901 case "$use64bitint:$d_quad:$quadtype" in
9909 uvtype="unsigned long"
9915 case "$uselongdouble:$d_longdbl" in
9917 nvtype="long double"
9925 $echo "(IV will be "$ivtype", $ivsize bytes)"
9926 $echo "(UV will be "$uvtype", $uvsize bytes)"
9927 $echo "(NV will be "$nvtype", $nvsize bytes)"
9930 #$i_inttypes I_INTTYPES
9932 #include <inttypes.h>
9937 int8_t i = INT8_MAX;
9938 uint8_t u = UINT8_MAX;
9942 int16_t i = INT16_MAX;
9943 uint16_t i = UINT16_MAX;
9944 printf("int16_t\n");
9947 int32_t i = INT32_MAX;
9948 uint32_t u = UINT32_MAX;
9949 printf("int32_t\n");
9955 '') case "$charsize" in
9957 u8type="unsigned char"
9966 if eval $compile; then
9967 case "`./try$exe_ext`" in
9968 int8_t) i8type=int8_t
9978 '') if $test $charsize -ge 1; then
9980 u8type="unsigned char"
9988 '') case "$shortsize" in
9990 u16type="unsigned short"
9999 if eval $compile; then
10000 case "`./try$exe_ext`" in
10012 '') if $test $shortsize -ge 2; then
10014 u16type="unsigned short"
10022 '') case "$longsize" in
10024 u32type="unsigned long"
10028 *) case "$intsize" in
10030 u32type="unsigned int"
10040 '') set try -DINT32
10041 if eval $compile; then
10042 case "`./try$exe_ext`" in
10054 '') if $test $intsize -ge 4; then
10056 u32type="unsigned int"
10064 '') case "$d_quad:$quadtype" in
10066 i64type="$quadtype"
10067 u64type="$uquadtype"
10075 $echo "Checking whether your NVs can preserve your UVs..." >&4
10079 $uvtype k = ($uvtype)~0, l;
10085 printf("preserve\n");
10090 if eval $compile; then
10091 case "`./try$exe_ext`" in
10092 preserve) d_nv_preserves_uv="$define" ;;
10095 case "$d_nv_preserves_uv" in
10096 $define) $echo "Yes, they can." 2>&1 ;;
10097 *) $echo "No, they can't." 2>&1
10098 d_nv_preserves_uv="$undef"
10105 : check for off64_t
10107 echo "Checking to see if you have off64_t..." >&4
10109 #include <sys/types.h>
10110 #include <unistd.h>
10111 int main() { off64_t x = 7; }
10114 if eval $compile; then
10116 echo "You have off64_t."
10119 echo "You do not have off64_t."
10120 case "$lseeksize" in
10121 8) echo "(Your off_t is 64 bits, so you could use that.)" ;;
10128 : see if POSIX threads are available
10129 set pthread.h i_pthread
10135 : how to create joinable pthreads
10136 if test "X$usethreads" = "X$define" -a "X$i_pthread" = "X$define"; then
10138 echo "Checking what constant to use for creating joinable pthreads..." >&4
10139 $cat >try.c <<'EOCP'
10140 #include <pthread.h>
10142 int detachstate = JOINABLE;
10145 set try -DJOINABLE=PTHREAD_CREATE_JOINABLE
10146 if eval $compile; then
10147 echo "You seem to use PTHREAD_CREATE_JOINABLE." >&4
10148 val="$undef" # Yes, undef.
10149 set d_old_pthread_create_joinable
10152 set old_pthread_create_joinable
10155 set try -DJOINABLE=PTHREAD_CREATE_UNDETACHED
10156 if eval $compile; then
10157 echo "You seem to use PTHREAD_CREATE_UNDETACHED." >&4
10159 set d_old_pthread_create_joinable
10161 val=PTHREAD_CREATE_UNDETACHED
10162 set old_pthread_create_joinable
10165 set try -DJOINABLE=__UNDETACHED
10166 if eval $compile; then
10167 echo "You seem to use __UNDETACHED." >&4
10169 set d_old_pthread_create_joinable
10172 set old_pthread_create_joinable
10175 echo "Egads, nothing obvious found. Guessing that you use 0." >&4
10177 set d_old_pthread_create_joinable
10180 set old_pthread_create_joinable
10187 d_old_pthread_create_joinable="$undef"
10188 old_pthread_create_joinable=""
10191 : see if pause exists
10195 : see if pipe exists
10199 : see if poll exists
10204 : see whether the various POSIXish _yields exist
10206 #include <pthread.h>
10212 #ifdef PTHREAD_YIELD
10215 #ifdef PTHREAD_YIELD_NULL
10216 pthread_yield(NULL);
10222 : see if sched_yield exists
10223 set try -DSCHED_YIELD
10224 if eval $compile; then
10226 sched_yield='sched_yield()'
10230 case "$usethreads" in
10233 $define) echo 'sched_yield() found.' >&4 ;;
10234 *) echo 'sched_yield() NOT found.' >&4 ;;
10240 : see if pthread_yield exists
10241 set try -DPTHREAD_YIELD
10242 if eval $compile; then
10244 case "$sched_yield" in
10245 '') sched_yield='pthread_yield()' ;;
10248 set try -DPTHREAD_YIELD_NULL
10249 if eval $compile; then
10251 case "$sched_yield" in
10252 '') sched_yield='pthread_yield(NULL)' ;;
10258 case "$usethreads" in
10261 $define) echo 'pthread_yield() found.' >&4 ;;
10262 *) echo 'pthread_yield() NOT found.' >&4 ;;
10266 set d_pthread_yield
10269 case "$sched_yield" in
10270 '') sched_yield=undef ;;
10275 : see if this is a pwd.h system
10281 xxx=`./findhdr pwd.h`
10282 $cppstdin $cppflags $cppminus < $xxx >$$.h
10284 if $contains 'pw_quota' $$.h >/dev/null 2>&1; then
10292 if $contains 'pw_age' $$.h >/dev/null 2>&1; then
10300 if $contains 'pw_change' $$.h >/dev/null 2>&1; then
10308 if $contains 'pw_class' $$.h >/dev/null 2>&1; then
10316 if $contains 'pw_expire' $$.h >/dev/null 2>&1; then
10324 if $contains 'pw_comment' $$.h >/dev/null 2>&1; then
10332 if $contains 'pw_gecos' $$.h >/dev/null 2>&1; then
10340 if $contains 'pw_passwd' $$.h >/dev/null 2>&1; then
10352 set d_pwquota; eval $setvar
10353 set d_pwage; eval $setvar
10354 set d_pwchange; eval $setvar
10355 set d_pwclass; eval $setvar
10356 set d_pwexpire; eval $setvar
10357 set d_pwcomment; eval $setvar
10358 set d_pwgecos; eval $setvar
10359 set d_pwpasswd; eval $setvar
10363 : see if readdir and friends exist
10364 set readdir d_readdir
10366 set seekdir d_seekdir
10368 set telldir d_telldir
10370 set rewinddir d_rewinddir
10373 : see if readlink exists
10374 set readlink d_readlink
10377 : see if rename exists
10378 set rename d_rename
10381 : see if rmdir exists
10385 : see if memory.h is available.
10390 : See if it conflicts with string.h
10396 $cppstdin $cppflags $cppminus < $strings > mem.h
10397 if $contains 'memcpy' mem.h >/dev/null 2>&1; then
10399 echo "We won't be including <memory.h>."
10409 : can bcopy handle overlapping blocks?
10414 echo "Checking to see if your bcopy() can do overlapping copies..." >&4
10416 #$i_memory I_MEMORY
10417 #$i_stdlib I_STDLIB
10418 #$i_string I_STRING
10419 #$i_unistd I_UNISTD
10421 $cat >>try.c <<'EOCP'
10424 # include <memory.h>
10427 # include <stdlib.h>
10430 # include <string.h>
10432 # include <strings.h>
10435 # include <unistd.h> /* Needed for NetBSD */
10439 char buf[128], abc[128];
10445 bcopy("abcdefghijklmnopqrstuvwxyz0123456789", abc, 36);
10447 for (align = 7; align >= 0; align--) {
10448 for (len = 36; len; len--) {
10450 bcopy(abc, b, len);
10451 for (off = 1; off <= len; off++) {
10452 bcopy(b, b+off, len);
10453 bcopy(b+off, b, len);
10454 if (bcmp(b, abc, len))
10463 if eval $compile_ok; then
10464 if ./try 2>/dev/null; then
10465 echo "Yes, it can."
10468 echo "It can't, sorry."
10469 case "$d_memmove" in
10470 "$define") echo "But that's Ok since you have memmove()." ;;
10474 echo "(I can't compile the test program, so we'll assume not...)"
10475 case "$d_memmove" in
10476 "$define") echo "But that's Ok since you have memmove()." ;;
10481 $rm -f try.* try core
10485 : can memcpy handle overlapping blocks?
10487 case "$d_memcpy" in
10490 echo "Checking to see if your memcpy() can do overlapping copies..." >&4
10492 #$i_memory I_MEMORY
10493 #$i_stdlib I_STDLIB
10494 #$i_string I_STRING
10495 #$i_unistd I_UNISTD
10497 $cat >>try.c <<'EOCP'
10500 # include <memory.h>
10503 # include <stdlib.h>
10506 # include <string.h>
10508 # include <strings.h>
10511 # include <unistd.h> /* Needed for NetBSD */
10515 char buf[128], abc[128];
10521 /* Copy "abcde..." string to char abc[] so that gcc doesn't
10522 try to store the string in read-only memory. */
10523 memcpy(abc, "abcdefghijklmnopqrstuvwxyz0123456789", 36);
10525 for (align = 7; align >= 0; align--) {
10526 for (len = 36; len; len--) {
10528 memcpy(b, abc, len);
10529 for (off = 1; off <= len; off++) {
10530 memcpy(b+off, b, len);
10531 memcpy(b, b+off, len);
10532 if (memcmp(b, abc, len))
10541 if eval $compile_ok; then
10542 if ./try 2>/dev/null; then
10543 echo "Yes, it can."
10546 echo "It can't, sorry."
10547 case "$d_memmove" in
10548 "$define") echo "But that's Ok since you have memmove()." ;;
10552 echo "(I can't compile the test program, so we'll assume not...)"
10553 case "$d_memmove" in
10554 "$define") echo "But that's Ok since you have memmove()." ;;
10559 $rm -f try.* try core
10563 : can memcmp be trusted to compare relative magnitude?
10565 case "$d_memcmp" in
10568 echo "Checking if your memcmp() can compare relative magnitude..." >&4
10570 #$i_memory I_MEMORY
10571 #$i_stdlib I_STDLIB
10572 #$i_string I_STRING
10573 #$i_unistd I_UNISTD
10575 $cat >>try.c <<'EOCP'
10578 # include <memory.h>
10581 # include <stdlib.h>
10584 # include <string.h>
10586 # include <strings.h>
10589 # include <unistd.h> /* Needed for NetBSD */
10595 if ((a < b) && memcmp(&a, &b, 1) < 0)
10601 if eval $compile_ok; then
10602 if ./try 2>/dev/null; then
10603 echo "Yes, it can."
10606 echo "No, it can't (it uses signed chars)."
10609 echo "(I can't compile the test program, so we'll assume not...)"
10613 $rm -f try.* try core
10617 : see if select exists
10618 set select d_select
10621 : see if semctl exists
10622 set semctl d_semctl
10625 : see if semget exists
10626 set semget d_semget
10629 : see if semop exists
10633 : see how much of the 'sem*(2)' library is present.
10636 case "$d_semctl$d_semget$d_semop" in
10637 *"$undef"*) h_sem=false;;
10641 case "`ipcs 2>&1`" in
10642 "SVID messages"*"not configured"*)
10643 echo "Your $osname does not have the sem*(2) configured." >&4
10646 set semctl d_semctl
10648 set semget d_semget
10656 : we could also check for sys/ipc.h ...
10657 if $h_sem && $test `./findhdr sys/sem.h`; then
10658 echo "You have the full sem*(2) library." >&4
10661 echo "You don't have the full sem*(2) library." >&4
10667 : see whether sys/sem.h defines union semun
10669 $cat > try.c <<'END'
10670 #include <sys/types.h>
10671 #include <sys/ipc.h>
10672 #include <sys/sem.h>
10673 int main () { union semun semun; semun.buf = 0; }
10676 if eval $compile; then
10677 echo "You have union semun in <sys/sem.h>." >&4
10680 echo "You do not have union semun in <sys/sem.h>." >&4
10683 $rm -f try try.c try.h
10687 : see how to do semctl IPC_STAT
10690 : see whether semctl IPC_STAT can use union semun
10695 # define S_IRUSR S_IREAD
10696 # define S_IWUSR S_IWRITE
10697 # define S_IXUSR S_IEXEC
10699 # define S_IRUSR 0400
10700 # define S_IWUSR 0200
10701 # define S_IXUSR 0100
10703 # define S_IRGRP (S_IRUSR>>3)
10704 # define S_IWGRP (S_IWUSR>>3)
10705 # define S_IXGRP (S_IXUSR>>3)
10706 # define S_IROTH (S_IRUSR>>6)
10707 # define S_IWOTH (S_IWUSR>>6)
10708 # define S_IXOTH (S_IXUSR>>6)
10711 # define S_IRWXU (S_IRUSR|S_IWUSR|S_IXUSR)
10712 # define S_IRWXG (S_IRGRP|S_IWGRP|S_IXGRP)
10713 # define S_IRWXO (S_IROTH|S_IWOTH|S_IXOTH)
10718 #include <sys/types.h>
10719 #include <sys/ipc.h>
10720 #include <sys/sem.h>
10721 #include <sys/stat.h>
10728 #$d_union_semun HAS_UNION_SEMUN
10731 #ifndef HAS_UNION_SEMUN
10734 struct semid_ds *buf;
10735 unsigned short *array;
10741 #if defined(IPC_PRIVATE) && defined(S_IRWXU) && defined(S_IRWXG) && defined(S_IRWXO) && defined(IPC_CREAT)
10742 sem = semget(IPC_PRIVATE, 1, S_IRWXU|S_IRWXG|S_IRWXO|IPC_CREAT);
10744 struct semid_ds argbuf;
10747 st = semctl(sem, 0, IPC_STAT, arg);
10751 # endif /* IPC_STAT */
10752 printf("semctl IPC_STAT failed: errno = %d\n", errno);
10754 if (semctl(sem, 0, IPC_RMID, arg) != 0)
10755 # endif /* IPC_RMID */
10756 printf("semctl IPC_RMID failed: errno = %d\n", errno);
10758 #endif /* IPC_PRIVATE && ... */
10759 printf("semget failed: errno = %d\n", errno);
10765 if eval $compile; then
10768 semun) val="$define" ;;
10774 case "$d_semctl_semun" in
10776 echo "You can use union semun for semctl IPC_STAT." >&4
10779 *) echo "You cannot use union semun for semctl IPC_STAT." >&4
10784 : see whether semctl IPC_STAT can use struct semid_ds pointer
10785 $cat > try.c <<'END'
10786 #include <sys/types.h>
10787 #include <sys/ipc.h>
10788 #include <sys/sem.h>
10789 #include <sys/stat.h>
10797 struct semid_ds arg;
10800 #if defined(IPC_PRIVATE) && defined(S_IRWXU) && defined(S_IRWXG) && defined(S_IRWXO) && defined(IPC_CREAT)
10801 sem = semget(IPC_PRIVATE, 1, S_IRWXU|S_IRWXG|S_IRWXO|IPC_CREAT);
10804 st = semctl(sem, 0, IPC_STAT, &arg);
10806 printf("semid_ds\n");
10808 # endif /* IPC_STAT */
10809 printf("semctl IPC_STAT failed: errno = %d\n", errno);
10811 if (semctl(sem, 0, IPC_RMID, &arg) != 0)
10812 # endif /* IPC_RMID */
10813 printf("semctl IPC_RMID failed: errno = %d\n", errno);
10815 #endif /* IPC_PRIVATE && ... */
10816 printf("semget failed: errno = %d\n", errno);
10823 if eval $compile; then
10826 semid_ds) val="$define" ;;
10830 set d_semctl_semid_ds
10832 case "$d_semctl_semid_ds" in
10834 echo "You can $also use struct semid_ds* for semctl IPC_STAT." >&4
10836 *) echo "You cannot use struct semid_ds* for semctl IPC_STAT." >&4
10843 # We do not have the full sem*(2) library, so assume we can not
10849 set d_semctl_semid_ds
10854 : see if setegid exists
10855 set setegid d_setegid
10858 : see if seteuid exists
10859 set seteuid d_seteuid
10862 : see if setgrent exists
10863 set setgrent d_setgrent
10866 : see if sethostent exists
10867 set sethostent d_sethent
10870 : see if setlinebuf exists
10871 set setlinebuf d_setlinebuf
10874 : see if setlocale exists
10875 set setlocale d_setlocale
10878 : see if setnetent exists
10879 set setnetent d_setnent
10882 : see if setprotoent exists
10883 set setprotoent d_setpent
10886 : see if setpgid exists
10887 set setpgid d_setpgid
10890 : see if setpgrp2 exists
10891 set setpgrp2 d_setpgrp2
10894 : see if setpriority exists
10895 set setpriority d_setprior
10898 : see if setpwent exists
10899 set setpwent d_setpwent
10902 : see if setregid exists
10903 set setregid d_setregid
10905 set setresgid d_setresgid
10908 : see if setreuid exists
10909 set setreuid d_setreuid
10911 set setresuid d_setresuid
10914 : see if setrgid exists
10915 set setrgid d_setrgid
10918 : see if setruid exists
10919 set setruid d_setruid
10922 : see if setservent exists
10923 set setservent d_setsent
10926 : see if setsid exists
10927 set setsid d_setsid
10930 : see if setspent exists
10931 set setspent d_setspent
10934 : see if setvbuf exists
10935 set setvbuf d_setvbuf
10938 : see if sfio.h is available
10943 : see if sfio library is available
10954 : Ok, but do we want to use it.
10958 true|$define|[yY]*) dflt='y';;
10961 echo "$package can use the sfio library, but it is experimental."
10962 rp="You seem to have sfio available, do you want to try using it?"
10966 *) echo "Ok, avoiding sfio this time. I'll use stdio instead."
10968 : Remove sfio from list of libraries to use
10969 set `echo X $libs | $sed -e 's/-lsfio / /' -e 's/-lsfio$//'`
10972 echo "libs = $libs" >&4
10976 *) case "$usesfio" in
10977 true|$define|[yY]*)
10978 echo "Sorry, cannot find sfio on this machine" >&4
10979 echo "Ignoring your setting of usesfio=$usesfio" >&4
10987 $define) usesfio='true';;
10988 *) usesfio='false';;
10991 : see if shmctl exists
10992 set shmctl d_shmctl
10995 : see if shmget exists
10996 set shmget d_shmget
10999 : see if shmat exists
11002 : see what shmat returns
11005 $cat >shmat.c <<'END'
11006 #include <sys/shm.h>
11009 if $cc $ccflags -c shmat.c >/dev/null 2>&1; then
11014 echo "and it returns ($shmattype)." >&4
11015 : see if a prototype for shmat is available
11016 xxx=`./findhdr sys/shm.h`
11017 $cppstdin $cppflags $cppminus < $xxx > shmat.c 2>/dev/null
11018 if $contains 'shmat.*(' shmat.c >/dev/null 2>&1; then
11029 set d_shmatprototype
11032 : see if shmdt exists
11036 : see how much of the 'shm*(2)' library is present.
11039 case "$d_shmctl$d_shmget$d_shmat$d_shmdt" in
11040 *"$undef"*) h_shm=false;;
11044 case "`ipcs 2>&1`" in
11045 "SVID shared memory"*"not configured"*)
11046 echo "Your $osname does not have the shm*(2) configured." >&4
11049 set shmctl d_shmctl
11051 set shmget d_shmget
11061 : we could also check for sys/ipc.h ...
11062 if $h_shm && $test `./findhdr sys/shm.h`; then
11063 echo "You have the full shm*(2) library." >&4
11066 echo "You don't have the full shm*(2) library." >&4
11073 : see if we have sigaction
11074 if set sigaction val -f d_sigaction; eval $csym; $val; then
11075 echo 'sigaction() found.' >&4
11076 $cat > try.c <<'EOP'
11078 #include <sys/types.h>
11079 #include <signal.h>
11082 struct sigaction act, oact;
11084 oact.sa_handler = 0;
11085 /* so that act and oact are used */
11086 exit(act.sa_flags == 0 && oact.sa_handler == 0);
11090 if eval $compile_ok; then
11093 echo "But you don't seem to have a useable struct sigaction." >&4
11097 echo 'sigaction NOT found.' >&4
11100 set d_sigaction; eval $setvar
11101 $rm -f try try$_o try.c
11103 : see if sigsetjmp exists
11105 case "$d_sigsetjmp" in
11107 $cat >try.c <<'EOP'
11108 #include <setjmp.h>
11113 if (sigsetjmp(env,1))
11116 siglongjmp(env, 1);
11121 if eval $compile; then
11122 if ./try >/dev/null 2>&1; then
11123 echo "POSIX sigsetjmp found." >&4
11127 Uh-Oh! You have POSIX sigsetjmp and siglongjmp, but they do not work properly!!
11133 echo "sigsetjmp not found." >&4
11137 *) val="$d_sigsetjmp"
11138 case "$d_sigsetjmp" in
11139 $define) echo "POSIX sigsetjmp found." >&4;;
11140 $undef) echo "sigsetjmp not found." >&4;;
11148 : see if sys/stat.h is available
11149 set sys/stat.h i_sysstat
11153 : see if stat knows about block sizes
11155 echo "Checking to see if your struct stat has st_blocks field..." >&4
11156 set d_statblks stat st_blocks $i_sysstat sys/stat.h
11160 : see if this is a sys/vfs.h system
11161 set sys/vfs.h i_sysvfs
11165 : see if this is a sys/statfs.h system
11166 set sys/statfs.h i_sysstatfs
11171 echo "Checking to see if your system supports struct statfs..." >&4
11172 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
11174 case "$d_statfs_s" in
11175 "$define") echo "Yes, it does." ;;
11176 *) echo "No, it doesn't." ;;
11181 : see if struct statfs knows about f_flags
11182 case "$d_statfs_s" in
11185 echo "Checking to see if your struct statfs has f_flags field..." >&4
11186 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
11190 set d_statfs_f_flags
11194 case "$d_statfs_f_flags" in
11195 "$define") echo "Yes, it does." ;;
11196 *) echo "No, it doesn't." ;;
11199 : see if _ptr and _cnt from stdio act std
11201 if $contains '_IO_fpos_t' `./findhdr stdio.h` `./findhdr libio.h` >/dev/null 2>&1 ; then
11202 echo "(Looks like you have stdio.h from Linux.)"
11203 case "$stdio_ptr" in
11204 '') stdio_ptr='((fp)->_IO_read_ptr)'
11207 *) ptr_lval=$d_stdio_ptr_lval;;
11209 case "$stdio_cnt" in
11210 '') stdio_cnt='((fp)->_IO_read_end - (fp)->_IO_read_ptr)'
11213 *) cnt_lval=$d_stdio_cnt_lval;;
11215 case "$stdio_base" in
11216 '') stdio_base='((fp)->_IO_read_base)';;
11218 case "$stdio_bufsiz" in
11219 '') stdio_bufsiz='((fp)->_IO_read_end - (fp)->_IO_read_base)';;
11222 case "$stdio_ptr" in
11223 '') stdio_ptr='((fp)->_ptr)'
11226 *) ptr_lval=$d_stdio_ptr_lval;;
11228 case "$stdio_cnt" in
11229 '') stdio_cnt='((fp)->_cnt)'
11232 *) cnt_lval=$d_stdio_cnt_lval;;
11234 case "$stdio_base" in
11235 '') stdio_base='((fp)->_base)';;
11237 case "$stdio_bufsiz" in
11238 '') stdio_bufsiz='((fp)->_cnt + (fp)->_ptr - (fp)->_base)';;
11241 : test whether _ptr and _cnt really work
11242 echo "Checking how std your stdio is..." >&4
11245 #define FILE_ptr(fp) $stdio_ptr
11246 #define FILE_cnt(fp) $stdio_cnt
11248 FILE *fp = fopen("try.c", "r");
11251 18 <= FILE_cnt(fp) &&
11252 strncmp(FILE_ptr(fp), "include <stdio.h>\n", 18) == 0
11260 if eval $compile; then
11262 echo "Your stdio acts pretty std."
11265 echo "Your stdio isn't very std."
11268 echo "Your stdio doesn't appear very std."
11274 : Can _ptr be used as an lvalue?
11275 case "$d_stdstdio$ptr_lval" in
11276 $define$define) val=$define ;;
11279 set d_stdio_ptr_lval
11282 : Can _cnt be used as an lvalue?
11283 case "$d_stdstdio$cnt_lval" in
11284 $define$define) val=$define ;;
11287 set d_stdio_cnt_lval
11290 : see if _base is also standard
11292 case "$d_stdstdio" in
11296 #define FILE_base(fp) $stdio_base
11297 #define FILE_bufsiz(fp) $stdio_bufsiz
11299 FILE *fp = fopen("try.c", "r");
11302 19 <= FILE_bufsiz(fp) &&
11303 strncmp(FILE_base(fp), "#include <stdio.h>\n", 19) == 0
11310 if eval $compile; then
11312 echo "And its _base field acts std."
11315 echo "But its _base field isn't std."
11318 echo "However, it seems to be lacking the _base field."
11327 Checking how to access stdio streams by file descriptor number...
11329 case "$stdio_stream_array" in
11330 '') $cat >try.c <<EOCP
11333 if (&STDIO_STREAM_ARRAY[fileno(stdin)] == stdin)
11337 for s in _iob __iob __sF
11339 set try -DSTDIO_STREAM_ARRAY=$s
11340 if eval $compile; then
11341 case "`./try$exe_ext`" in
11342 yes) stdio_stream_array=$s; break ;;
11346 $rm -f try.* try$exe_ext
11348 case "$stdio_stream_array" in
11350 I can't figure out how to access stdio streams by file descriptor number.
11352 d_stdio_stream_array="$undef"
11355 You can access stdio streams by file descriptor number by the $stdio_stream_array array.
11357 d_stdio_stream_array="$define"
11361 : see if strcoll exists
11362 set strcoll d_strcoll
11365 : check for structure copying
11367 echo "Checking to see if your C compiler can copy structs..." >&4
11368 $cat >try.c <<'EOCP'
11378 if $cc -c try.c >/dev/null 2>&1 ; then
11380 echo "Yup, it can."
11383 echo "Nope, it can't."
11389 : see if strerror and/or sys_errlist[] exist
11391 if test "X$d_strerror" = X -o "X$d_syserrlst" = X; then
11392 if set strerror val -f d_strerror; eval $csym; $val; then
11393 echo 'strerror() found.' >&4
11394 d_strerror="$define"
11395 d_strerrm='strerror(e)'
11396 if set sys_errlist val -a d_syserrlst; eval $csym; $val; then
11397 echo "(You also have sys_errlist[], so we could roll our own strerror.)"
11398 d_syserrlst="$define"
11400 echo "(Since you don't have sys_errlist[], sterror() is welcome.)"
11401 d_syserrlst="$undef"
11403 elif xxx=`./findhdr string.h`; test "$xxx" || xxx=`./findhdr strings.h`; \
11404 $contains '#[ ]*define.*strerror' "$xxx" >/dev/null 2>&1; then
11405 echo 'strerror() found in string header.' >&4
11406 d_strerror="$define"
11407 d_strerrm='strerror(e)'
11408 if set sys_errlist val -a d_syserrlst; eval $csym; $val; then
11409 echo "(Most probably, strerror() uses sys_errlist[] for descriptions.)"
11410 d_syserrlst="$define"
11412 echo "(You don't appear to have any sys_errlist[], how can this be?)"
11413 d_syserrlst="$undef"
11415 elif set sys_errlist val -a d_syserrlst; eval $csym; $val; then
11416 echo "strerror() not found, but you have sys_errlist[] so we'll use that." >&4
11417 d_strerror="$undef"
11418 d_syserrlst="$define"
11419 d_strerrm='((e)<0||(e)>=sys_nerr?"unknown":sys_errlist[e])'
11421 echo 'strerror() and sys_errlist[] NOT found.' >&4
11422 d_strerror="$undef"
11423 d_syserrlst="$undef"
11424 d_strerrm='"unknown"'
11428 : see if strtod exists
11429 set strtod d_strtod
11432 : see if strtol exists
11433 set strtol d_strtol
11436 : see if strtold exists
11437 set strtold d_strtold
11440 : see if strtoll exists
11441 set strtoll d_strtoll
11444 : see if strtoul exists
11445 set strtoul d_strtoul
11448 : see if strtoull exists
11449 set strtoull d_strtoull
11452 : see if strtouq exists
11453 set strtouq d_strtouq
11456 : see if strxfrm exists
11457 set strxfrm d_strxfrm
11460 : see if symlink exists
11461 set symlink d_symlink
11464 : see if syscall exists
11465 set syscall d_syscall
11468 : see if sysconf exists
11469 set sysconf d_sysconf
11472 : see if system exists
11473 set system d_system
11476 : see if tcgetpgrp exists
11477 set tcgetpgrp d_tcgetpgrp
11480 : see if tcsetpgrp exists
11481 set tcsetpgrp d_tcsetpgrp
11484 : see if prototype for telldir is available
11486 set d_telldirproto telldir $i_systypes sys/types.h $i_dirent dirent.h
11489 : see if this is a sys/times.h system
11490 set sys/times.h i_systimes
11493 : see if times exists
11495 if set times val -f d_times; eval $csym; $val; then
11496 echo 'times() found.' >&4
11499 case "$i_systimes" in
11500 "$define") inc='sys/times.h';;
11502 rp="What is the type returned by times() on this system?"
11503 set clock_t clocktype long stdio.h sys/types.h $inc
11506 echo 'times() NOT found, hope that will do.' >&4
11511 : see if truncate exists
11512 set truncate d_truncate
11515 : see if tzname[] exists
11517 if set tzname val -a d_tzname; eval $csym; $val; then
11519 echo 'tzname[] found.' >&4
11522 echo 'tzname[] NOT found.' >&4
11527 : see if umask exists
11531 : see if ustat exists
11535 : backward compatibility for d_hvfork
11536 if test X$d_hvfork != X; then
11537 d_vfork="$d_hvfork"
11540 : see if there is a vfork
11545 : Ok, but do we want to use it. vfork is reportedly unreliable in
11546 : perl on Solaris 2.x, and probably elsewhere.
11550 case "$usevfork" in
11556 Perl can only use a vfork() that doesn't suffer from strict
11557 restrictions on calling functions or modifying global data in
11558 the child. For example, glibc-2.1 contains such a vfork()
11559 that is unsuitable. If your system provides a proper fork()
11560 call, chances are that you do NOT want perl to use vfork().
11563 rp="Do you still want to use vfork()?"
11568 echo "Ok, we won't use vfork()."
11577 $define) usevfork='true';;
11578 *) usevfork='false';;
11581 : see if this is an sysdir system
11582 set sys/dir.h i_sysdir
11585 : see if this is an sysndir system
11586 set sys/ndir.h i_sysndir
11589 : see if closedir exists
11590 set closedir d_closedir
11593 case "$d_closedir" in
11596 echo "Checking whether closedir() returns a status..." >&4
11597 cat > closedir.c <<EOM
11598 #$i_dirent I_DIRENT /**/
11599 #$i_sysdir I_SYS_DIR /**/
11600 #$i_sysndir I_SYS_NDIR /**/
11601 #$i_systypes I_SYS_TYPES /**/
11603 #if defined(I_SYS_TYPES)
11604 #include <sys/types.h>
11606 #if defined(I_DIRENT)
11607 #include <dirent.h>
11608 #if defined(NeXT) && defined(I_SYS_DIR) /* NeXT needs dirent + sys/dir.h */
11609 #include <sys/dir.h>
11613 #include <sys/ndir.h>
11617 #include <ndir.h> /* may be wrong in the future */
11619 #include <sys/dir.h>
11624 int main() { return closedir(opendir(".")); }
11627 if eval $compile_ok; then
11628 if ./closedir > /dev/null 2>&1 ; then
11629 echo "Yes, it does."
11632 echo "No, it doesn't."
11636 echo "(I can't seem to compile the test program--assuming it doesn't)"
11644 set d_void_closedir
11647 : check for volatile keyword
11649 echo 'Checking to see if your C compiler knows about "volatile"...' >&4
11650 $cat >try.c <<'EOCP'
11653 typedef struct _goo_struct goo_struct;
11654 goo_struct * volatile goo = ((goo_struct *)0);
11655 struct _goo_struct {
11660 typedef unsigned short foo_t;
11661 char *volatile foo;
11663 volatile foo_t blech;
11667 if $cc -c $ccflags try.c >/dev/null 2>&1 ; then
11669 echo "Yup, it does."
11672 echo "Nope, it doesn't."
11678 : see if there is a wait4
11682 : see if waitpid exists
11683 set waitpid d_waitpid
11686 : see if wcstombs exists
11687 set wcstombs d_wcstombs
11690 : see if wctomb exists
11691 set wctomb d_wctomb
11694 : preserve RCS keywords in files with variable substitution, grrr
11699 Revision='$Revision'
11701 case "$crosscompile" in
11702 ''|[nN]*) crosscompile="$undef" ;;
11706 next|rhapsody|darwin) multiarch="$define" ;;
11708 case "$multiarch" in
11709 ''|[nN]*) multiarch="$undef" ;;
11712 : check for alignment requirements
11714 case "$crosscompile$multiarch" in
11717 You seem to be either cross-compiling or doing a multiarchitecture build,
11718 skipping the memory alignment check.
11721 case "$alignbytes" in
11722 '') alignbytes=8 ;;
11726 case "$alignbytes" in
11727 '') echo "Checking alignment constraints..." >&4
11728 if $test "X$uselongdouble" = Xdefine -a "X$d_longdbl" = Xdefine; then
11729 $cat >try.c <<'EOCP'
11730 typedef long double NV;
11733 $cat >try.c <<'EOCP'
11737 $cat >>try.c <<'EOCP'
11745 printf("%d\n", (int)((char *)&try_algn.bar - (char *)&try_algn.foo));
11750 if eval $compile_ok; then
11754 echo "(I can't seem to compile the test program...)"
11757 *) dflt="$alignbytes"
11760 rp="Doubles must be aligned on a how-many-byte boundary?"
11768 : set the base revision
11771 : check for ordering of bytes in a long
11773 case "$crosscompile$multiarch" in
11776 You seem to be either cross-compiling or doing a multiarchitecture build,
11777 skipping the byteorder check.
11783 case "$byteorder" in
11786 In the following, larger digits indicate more significance. A big-endian
11787 machine like a Pyramid or a Motorola 680?0 chip will come out to 4321. A
11788 little-endian machine like a Vax or an Intel 80?86 chip would be 1234. Other
11789 machines may have weird orders like 3412. A Cray will report 87654321,
11790 an Alpha will report 12345678. If the test program works the default is
11792 I'm now running the test program...
11794 $cat >try.c <<'EOCP'
11801 char c[sizeof(long)];
11804 if (sizeof(long) > 4)
11805 u.l = (0x08070605L << 32) | 0x04030201L;
11808 for (i = 0; i < sizeof(long); i++)
11809 printf("%c", u.c[i]+'0');
11816 if eval $compile && ./try > /dev/null; then
11819 [1-4][1-4][1-4][1-4]|12345678|87654321)
11820 echo "(The test program ran ok.)"
11821 echo "byteorder=$dflt"
11824 ????|????????) echo "(The test program ran ok.)" ;;
11825 *) echo "(The test program didn't run right for some reason.)" ;;
11830 (I can't seem to compile the test program. Guessing big-endian...)
11833 case "$xxx_prompt" in
11835 rp="What is the order of bytes in a long?"
11849 : how do we catenate cpp tokens here?
11851 echo "Checking to see how your cpp does stuff like catenate tokens..." >&4
11852 $cat >cpp_stuff.c <<'EOCP'
11853 #define RCAT(a,b)a/**/b
11854 #define ACAT(a,b)a ## b
11858 $cppstdin $cppflags $cppminus <cpp_stuff.c >cpp_stuff.out 2>&1
11859 if $contains 'Circus' cpp_stuff.out >/dev/null 2>&1; then
11860 echo "Oh! Smells like ANSI's been here." >&4
11861 echo "We can catify or stringify, separately or together!"
11863 elif $contains 'Reiser' cpp_stuff.out >/dev/null 2>&1; then
11864 echo "Ah, yes! The good old days!" >&4
11865 echo "However, in the good old days we don't know how to stringify and"
11866 echo "catify at the same time."
11870 Hmm, I don't seem to be able to catenate tokens with your cpp. You're going
11871 to have to edit the values of CAT[2-5] in config.h...
11873 cpp_stuff="/* Help! How do we handle cpp_stuff? */*/"
11877 : see if this is a db.h system
11883 : Check db version.
11885 echo "Checking Berkeley DB version ..." >&4
11891 #include <sys/types.h>
11896 #ifdef DB_VERSION_MAJOR /* DB version >= 2 */
11897 int Major, Minor, Patch ;
11898 unsigned long Version ;
11899 (void)db_version(&Major, &Minor, &Patch) ;
11900 printf("You have Berkeley DB Version 2 or greater\n");
11902 printf("db.h is from Berkeley DB Version %d.%d.%d\n",
11903 DB_VERSION_MAJOR, DB_VERSION_MINOR, DB_VERSION_PATCH);
11904 printf("libdb is from Berkeley DB Version %d.%d.%d\n",
11905 Major, Minor, Patch) ;
11907 /* check that db.h & libdb are compatible */
11908 if (DB_VERSION_MAJOR != Major || DB_VERSION_MINOR != Minor || DB_VERSION_PATCH != Patch) {
11909 printf("db.h and libdb are incompatible\n") ;
11913 printf("db.h and libdb are compatible\n") ;
11915 Version = DB_VERSION_MAJOR * 1000000 + DB_VERSION_MINOR * 1000
11916 + DB_VERSION_PATCH ;
11918 /* needs to be >= 2.3.4 */
11919 if (Version < 2003004) {
11920 /* if (DB_VERSION_MAJOR == 2 && DB_VERSION_MINOR == 0 && DB_VERSION_PATCH < 5) { */
11921 printf("but Perl needs Berkeley DB 2.3.4 or greater\n") ;
11927 #if defined(_DB_H_) && defined(BTREEMAGIC) && defined(HASHMAGIC)
11928 printf("You have Berkeley DB Version 1\n");
11929 exit(0); /* DB version < 2: the coast is clear. */
11931 exit(1); /* <db.h> not Berkeley DB? */
11937 if eval $compile_ok && ./try; then
11938 echo 'Looks OK.' >&4
11940 echo "I can't use Berkeley DB with your <db.h>. I'll disable Berkeley DB." >&4
11944 : Remove db from list of libraries to use
11945 echo "Removing unusable -ldb from library list" >&4
11946 set `echo X $libs | $sed -e 's/-ldb / /' -e 's/-ldb$//'`
11949 echo "libs = $libs" >&4
11959 : Check the return type needed for hash
11961 echo "Checking return type needed for hash for Berkeley DB ..." >&4
11967 #include <sys/types.h>
11970 #ifndef DB_VERSION_MAJOR
11971 u_int32_t hash_cb (ptr, size)
11979 info.hash = hash_cb;
11983 if $cc $ccflags -c try.c >try.out 2>&1 ; then
11984 if $contains warning try.out >>/dev/null 2>&1 ; then
11987 db_hashtype='u_int32_t'
11990 : XXX Maybe we should just give up here.
11991 db_hashtype=u_int32_t
11993 echo "Help: I can't seem to compile the db test program." >&4
11994 echo "Something's wrong, but I'll assume you use $db_hashtype." >&4
11997 echo "Your version of Berkeley DB uses $db_hashtype for hash."
11999 *) db_hashtype=u_int32_t
12004 : Check the return type needed for prefix
12006 echo "Checking return type needed for prefix for Berkeley DB ..." >&4
12012 #include <sys/types.h>
12015 #ifndef DB_VERSION_MAJOR
12016 size_t prefix_cb (key1, key2)
12024 info.prefix = prefix_cb;
12028 if $cc $ccflags -c try.c >try.out 2>&1 ; then
12029 if $contains warning try.out >>/dev/null 2>&1 ; then
12030 db_prefixtype='int'
12032 db_prefixtype='size_t'
12035 db_prefixtype='size_t'
12036 : XXX Maybe we should just give up here.
12038 echo "Help: I can't seem to compile the db test program." >&4
12039 echo "Something's wrong, but I'll assume you use $db_prefixtype." >&4
12042 echo "Your version of Berkeley DB uses $db_prefixtype for prefix."
12044 *) db_prefixtype='size_t'
12048 : check for void type
12050 echo "Checking to see how well your C compiler groks the void type..." >&4
12051 case "$voidflags" in
12053 $cat >try.c <<'EOCP'
12059 extern void moo(); /* function returning void */
12060 void (*goo)(); /* ptr to func returning void */
12062 void *hue; /* generic ptr */
12075 int main() { sub(); }
12077 if $cc $ccflags -c -DTRY=$defvoidused try.c >.out 2>&1 ; then
12078 voidflags=$defvoidused
12079 echo "Good. It appears to support void to the level $package wants.">&4
12080 if $contains warning .out >/dev/null 2>&1; then
12081 echo "However, you might get some warnings that look like this:"
12085 echo "Hmm, your compiler has some difficulty with void. Checking further..." >&4
12086 if $cc $ccflags -c -DTRY=1 try.c >/dev/null 2>&1; then
12087 echo "It supports 1..."
12088 if $cc $ccflags -c -DTRY=3 try.c >/dev/null 2>&1; then
12089 echo "It also supports 2..."
12090 if $cc $ccflags -c -DTRY=7 try.c >/dev/null 2>&1; then
12092 echo "And it supports 4 but not 8 definitely."
12094 echo "It doesn't support 4..."
12095 if $cc $ccflags -c -DTRY=11 try.c >/dev/null 2>&1; then
12097 echo "But it supports 8."
12100 echo "Neither does it support 8."
12104 echo "It does not support 2..."
12105 if $cc $ccflags -c -DTRY=13 try.c >/dev/null 2>&1; then
12107 echo "But it supports 4 and 8."
12109 if $cc $ccflags -c -DTRY=5 try.c >/dev/null 2>&1; then
12111 echo "And it supports 4 but has not heard about 8."
12113 echo "However it supports 8 but not 4."
12118 echo "There is no support at all for void."
12123 case "$voidflags" in
12125 *) $cat >&4 <<'EOM'
12126 Support flag bits are:
12127 1: basic void declarations.
12128 2: arrays of pointers to functions returning void.
12129 4: operations between pointers to and addresses of void functions.
12130 8: generic void pointers.
12133 rp="Your void support flags add up to what?"
12141 : How can we generate normalized random numbers ?
12143 echo "Looking for a random number function..." >&4
12144 case "$randfunc" in
12146 if set drand48 val -f; eval $csym; $val; then
12148 echo "Good, found drand48()." >&4
12149 elif set random val -f; eval $csym; $val; then
12151 echo "OK, found random()." >&4
12154 echo "Yick, looks like I have to use rand()." >&4
12165 *-Dmy_rand=*|*-Dmy_srand=*)
12166 echo "Removing obsolete -Dmy_rand, -Dmy_srand, and -Drandbits from ccflags." >&4
12167 ccflags="`echo $ccflags | sed -e 's/-Dmy_rand=random/ /'`"
12168 ccflags="`echo $ccflags | sed -e 's/-Dmy_srand=srandom/ /'`"
12169 ccflags="`echo $ccflags | sed -e 's/-Drandbits=[0-9][0-9]*/ /'`"
12173 while $test "$cont"; do
12174 rp="Use which function to generate random numbers?"
12176 if $test "$ans" = "$dflt"; then
12182 if set $ans val -f; eval $csym; $val; then
12186 rp="I cannot find function $ans. Use that name anyway?"
12195 case "$randfunc" in
12197 drand01="drand48()"
12203 case "$randbits" in
12205 echo "Checking to see how many bits your $randfunc() function produces..." >&4
12207 #$i_unistd I_UNISTD
12208 #$i_stdlib I_STDLIB
12211 # include <unistd.h>
12214 # include <stdlib.h>
12219 register unsigned long tmp;
12220 register unsigned long max = 0L;
12222 for (i = 1000; i; i--) {
12223 tmp = (unsigned long) $randfunc();
12224 if (tmp > max) max = tmp;
12226 for (i = 0; max; i++)
12232 if eval $compile_ok; then
12236 echo "(I can't seem to compile the test program...)"
12243 rp="How many bits does your $randfunc() function produce?"
12247 drand01="($randfunc() / (double) ((unsigned long)1 << $randbits))"
12248 seedfunc="s$randfunc"
12249 randseedtype=unsigned
12253 rp="How many bits does your $randfunc() function produce?"
12256 seedfunc="s$randfunc"
12257 drand01="($randfunc() / (double) ((unsigned long)1 << $randbits))"
12258 if set $seedfunc val -f; eval $csym; $val; then
12259 echo "(Using $seedfunc() to seed random generator)"
12261 echo "(Warning: no $seedfunc() to seed random generator)"
12264 randseedtype=unsigned
12272 echo "Determining whether or not we are on an EBCDIC system..." >&4
12273 $cat >tebcdic.c <<'EOM'
12276 if ('M'==0xd4) return 0;
12283 if eval $compile_ok; then
12285 echo "You have EBCDIC." >&4
12288 echo "Nope, no EBCDIC, probably ASCII or some ISO Latin." >&4
12291 echo "I'm unable to compile the test program." >&4
12292 echo "I'll assume ASCII or some ISO Latin." >&4
12294 $rm -f tebcdic.c tebcdic
12300 Checking how to flush all pending stdio output...
12302 # I only know how to find the first 32 possibly open files on SunOS.
12303 # See also hints/sunos_4_1.sh and util.c --AD
12305 sunos) $echo '#define PERL_FFLUSH_ALL_FOPEN_MAX 32' > try.c ;;
12307 $cat >>try.c <<EOCP
12309 #$i_unistd I_UNISTD
12311 # include <unistd.h>
12313 #$d_sysconf HAS_SYSCONF
12314 #$d_stdio_stream_array HAS_STDIO_STREAM_ARRAY
12315 #ifdef HAS_STDIO_STREAM_ARRAY
12316 # define STDIO_STREAM_ARRAY $stdio_stream_array
12319 FILE* p = fopen("try.out", "w");
12323 # ifdef TRY_FPRINTF
12327 #ifdef TRY_FFLUSH_NULL
12330 #ifdef TRY_FFLUSH_ALL
12332 long open_max = -1;
12333 # ifdef PERL_FFLUSH_ALL_FOPEN_MAX
12334 open_max = PERL_FFLUSH_ALL_FOPEN_MAX;
12336 # if defined(HAS_SYSCONF) && defined(_SC_OPEN_MAX)
12337 open_max = sysconf(_SC_OPEN_MAX);
12340 open_max = FOPEN_MAX;
12343 open_max = OPEN_MAX;
12352 # ifdef HAS_STDIO_STREAM_ARRAY
12353 if (open_max > 0) {
12355 for (i = 0; i < open_max; i++)
12356 if (STDIO_STREAM_ARRAY[i]._file >= 0 &&
12357 STDIO_STREAM_ARRAY[i]._file < open_max &&
12358 STDIO_STREAM_ARRAY[i]._flag)
12359 fflush(&STDIO_STREAM_ARRAY[i]);
12367 : first we have to find out how _not_ to flush
12368 if $test "X$fflushNULL" = X -o "X$fflushall" = X; then
12370 set try -DTRY_FPUTC
12371 if eval $compile; then
12373 ./try$exe_ext 2>/dev/null
12374 if $test ! -s try.out -a "X$?" = X42; then
12380 set try -DTRY_FPRINTF
12382 if eval $compile; then
12384 ./try$exe_ext 2>/dev/null
12385 if $test ! -s try.out -a "X$?" = X42; then
12386 output=-DTRY_FPRINTF
12392 : check for fflush NULL behaviour
12393 case "$fflushNULL" in
12394 '') set try -DTRY_FFLUSH_NULL $output
12395 if eval $compile; then
12397 ./try$exe_ext 2>/dev/null
12399 if $test -s try.out -a "X$code" = X42; then
12400 fflushNULL="`$cat try.out`"
12402 if $test "X$code" != X42; then
12404 (If this test failed, don't worry, we'll try another method shortly.)
12409 $rm -f core try.core core.try.*
12410 case "$fflushNULL" in
12412 Your fflush(NULL) works okay.
12414 fflushNULL="$define"
12417 Your fflush(NULL) isn't working (contrary to ANSI C).
12419 fflushNULL="$undef"
12422 Cannot figure out whether your fflush(NULL) works or not.
12423 I'm assuming it doesn't (contrary to ANSI C).
12425 fflushNULL="$undef"
12429 $define|true|[yY]*)
12430 fflushNULL="$define"
12433 fflushNULL="$undef"
12436 : check explicit looping only if NULL did not work
12437 case "$fflushNULL" in
12439 : check for fflush all behaviour
12440 case "$fflushall" in
12441 '') set try -DTRY_FFLUSH_ALL $output
12442 if eval $compile; then
12444 (Now testing the other method--but note that also this may fail.)
12447 ./try$exe_ext 2>/dev/null
12448 if $test -s try.out -a "X$?" = X42; then
12449 fflushall="`$cat try.out`"
12452 $rm -f core try.core core.try.*
12453 case "$fflushall" in
12455 Whew. Flushing explicitly all the stdio streams works.
12457 fflushall="$define"
12460 Sigh. Flushing explicitly all the stdio streams doesn't work.
12465 Cannot figure out whether flushing stdio streams explicitly works or not.
12466 I'm assuming it doesn't.
12472 "$define"|true|[yY]*)
12473 fflushall="$define"
12480 *) fflushall="$undef"
12483 case "$fflushNULL$fflushall" in
12486 I cannot figure out how to flush pending stdio output.
12490 $rm -f try.* try$exe_ext
12492 : Store the full pathname to the ar program for use in the C program
12493 : Respect a hint or command line value for full_ar.
12498 : Store the full pathname to the sed program for use in the C program
12501 : see what type gids are declared as in the kernel
12503 echo "Looking for the type for group ids returned by getgid()."
12504 set gid_t gidtype xxx stdio.h sys/types.h
12508 xxx=`./findhdr sys/user.h`
12509 set `grep 'groups\[NGROUPS\];' "$xxx" 2>/dev/null` unsigned short
12511 unsigned) dflt="$1 $2" ;;
12515 *) dflt="$gidtype";;
12518 gid_t) echo "gid_t found." ;;
12519 *) rp="What is the type for group ids returned by getgid()?"
12527 *_t) zzz="$gidtype" ;;
12530 echo "Checking the size of $zzz..." >&4
12532 #include <sys/types.h>
12535 printf("%d\n", (int)sizeof($gidtype));
12540 if eval $compile_ok; then
12544 echo "(I can't execute the test program--guessing $gidsize.)" >&4
12547 echo "Your $zzz is $gidsize bytes long."
12552 echo "(I can't compile the test program--guessing $gidsize.)" >&4
12558 *_t) zzz="$gidtype" ;;
12561 echo "Checking the sign of $zzz..." >&4
12563 #include <sys/types.h>
12574 if eval $compile; then
12578 echo "(I can't execute the test program--guessing unsigned.)" >&4
12582 1) echo "Your $zzz is unsigned." ;;
12583 -1) echo "Your $zzz is signed." ;;
12589 echo "(I can't compile the test program--guessing unsigned.)" >&4
12595 if $test X"$quadtype" != X; then
12597 echo "Checking how to print 64-bit integers..." >&4
12599 if $test X"$sPRId64" = X -a X"$quadtype" = Xint; then
12600 $cat >try.c <<'EOCP'
12601 #include <sys/types.h>
12604 int q = 12345678901;
12605 printf("%ld\n", q);
12609 if eval $compile; then
12610 yyy=`./try$exe_ext`
12613 sPRId64='"d"'; sPRIi64='"i"'; sPRIu64='"u"';
12614 sPRIo64='"o"'; sPRIx64='"x"'; sPRIX64='"X"';
12615 echo "We will use %d."
12621 if $test X"$sPRId64" = X -a X"$quadtype" = Xlong; then
12622 $cat >try.c <<'EOCP'
12623 #include <sys/types.h>
12626 long q = 12345678901;
12627 printf("%ld\n", q);
12631 if eval $compile; then
12632 yyy=`./try$exe_ext`
12635 sPRId64='"ld"'; sPRIi64='"li"'; sPRIu64='"lu"';
12636 sPRIo64='"lo"'; sPRIx64='"lx"'; sPRIX64='"lX"';
12637 echo "We will use %ld."
12643 if $test X"$sPRId64" = X -a X"$i_inttypes" = X"$define" -a X"$quadtype" = Xint64_t; then
12644 $cat >try.c <<'EOCP'
12645 #include <sys/types.h>
12646 #include <inttypes.h>
12649 int64_t q = 12345678901;
12650 printf("%" PRId64 "\n", q);
12654 if eval $compile; then
12655 yyy=`./try$exe_ext`
12658 sPRId64=PRId64; sPRIi64=PRIi64; sPRIu64=PRIu64;
12659 sPRIo64=PRIo64; sPRIx64=PRIx64; sPRIX64=PRIX64;
12660 echo "We will use the C9X style."
12666 if $test X"$sPRId64" = X -a X"$quadtype" = X"long long"; then
12667 $cat >try.c <<'EOCP'
12668 #include <sys/types.h>
12671 long long q = 12345678901LL; /* AIX cc requires the LL prefix. */
12672 printf("%lld\n", q);
12676 if eval $compile; then
12677 yyy=`./try$exe_ext`
12680 sPRId64='"lld"'; sPRIi64='"lli"'; sPRIu64='"llu"';
12681 sPRIo64='"llo"'; sPRIx64='"llx"'; sPRIX64='"llX"';
12682 echo "We will use the %lld style."
12688 if $test X"$sPRId64" = X -a X"$quadtype" != X; then
12690 #include <sys/types.h>
12693 $quadtype q = 12345678901;
12694 printf("%Ld\n", q);
12698 if eval $compile; then
12699 yyy=`./try$exe_ext`
12702 sPRId64='"Ld"'; sPRIi64='"Li"'; sPRIu64='"Lu"';
12703 sPRIo64='"Lo"'; sPRIx64='"Lx"'; sPRIX64='"LX"';
12704 echo "We will use %Ld."
12710 if $test X"$sPRId64" = X -a X"$quadtype" != X; then
12712 #include <sys/types.h>
12715 $quadtype q = 12345678901;
12716 printf("%qd\n", q);
12720 if eval $compile; then
12721 yyy=`./try$exe_ext`
12724 sPRId64='"qd"'; sPRIi64='"qi"'; sPRIu64='"qu"';
12725 sPRIo64='"qo"'; sPRIx64='"qx"'; sPRIX64='"qX"';
12726 echo "We will use %qd."
12732 if $test X"$sPRId64" = X; then
12733 echo "Cannot figure out how to print 64-bit integers." >&4
12741 '') d_PRId64="$undef"; d_PRIi64="$undef"; d_PRIu64="$undef";
12742 d_PRIo64="$undef"; d_PRIx64="$undef"; d_PRIX64="$undef";
12744 *) d_PRId64="$define"; d_PRIi64="$define"; d_PRIu64="$define";
12745 d_PRIo64="$define"; d_PRIx64="$define"; d_PRIX64="$define";
12751 $echo "Checking the format strings to be used for Perl's internal types..." >&4
12753 if $test X"$ivsize" = X8; then
12754 ivdformat="$sPRId64"
12755 uvuformat="$sPRIu64"
12756 uvoformat="$sPRIo64"
12757 uvxformat="$sPRIx64"
12759 if $test X"$ivsize" = X"$longsize"; then
12765 if $test X"$ivsize" = X"$intsize"; then
12772 if $test X"$ivsize" = X"$shortsize"; then
12782 case "$ivdformat" in
12783 '') echo "$0: Fatal: failed to find format strings, cannot continue." >& 4
12790 $echo "Checking the format string to be used for gids..." >&4
12793 -1) if $test X"$gidsize" = X"$ivsize"; then
12794 gidformat="$ivdformat"
12796 if $test X"$gidsize" = X"$longsize"; then
12799 if $test X"$gidsize" = X"$intsize"; then
12802 if $test X"$gidsize" = X"$shortsize"; then
12809 *) if $test X"$gidsize" = X"$uvsize"; then
12810 gidformat="$uvuformat"
12812 if $test X"$gidsize" = X"$longsize"; then
12815 if $test X"$gidsize" = X"$intsize"; then
12818 if $test X"$gidsize" = X"$shortsize"; then
12827 : see if getgroups exists
12828 set getgroups d_getgrps
12831 : see if setgroups exists
12832 set setgroups d_setgrps
12836 : Find type of 2nd arg to 'getgroups()' and 'setgroups()'
12838 case "$d_getgrps$d_setgrps" in
12840 case "$groupstype" in
12841 '') dflt="$gidtype" ;;
12842 *) dflt="$groupstype" ;;
12845 What type of pointer is the second argument to getgroups() and setgroups()?
12846 Usually this is the same as group ids, $gidtype, but not always.
12849 rp='What type pointer is the second argument to getgroups() and setgroups()?'
12853 *) groupstype="$gidtype";;
12857 echo "Checking if your $make program sets \$(MAKE)..." >&4
12858 case "$make_set_make" in
12860 $sed 's/^X //' > testmake.mak << 'EOF'
12862 X @echo 'maketemp="$(MAKE)"'
12864 case "`$make -f testmake.mak 2>/dev/null`" in
12865 *maketemp=*) make_set_make='#' ;;
12866 *) make_set_make="MAKE=$make" ;;
12868 $rm -f testmake.mak
12871 case "$make_set_make" in
12872 '#') echo "Yup, it does.";;
12873 *) echo "Nope, it doesn't.";;
12876 : see what type is used for mode_t
12877 rp="What is the type used for file modes for system calls (e.g. fchmod())?"
12878 set mode_t modetype int stdio.h sys/types.h
12881 : define a fucntion to check prototypes
12882 $cat > protochk <<EOSH
12885 optimize="$optimize"
12887 prototype="$prototype"
12892 $cat >> protochk <<'EOSH'
12897 while test $# -ge 2; do
12899 $define) echo "#include <$2>" >> try.c ;;
12900 literal) echo "$2" >> try.c ;;
12904 test "$prototype" = "$define" && echo '#define CAN_PROTOTYPE' >> try.c
12905 cat >> try.c <<'EOCP'
12906 #ifdef CAN_PROTOTYPE
12907 #define _(args) args
12912 echo "$foo" >> try.c
12913 echo 'int no_real_function_has_this_name _((void)) { return 0; }' >> try.c
12914 $cc $optimize $ccflags -c try.c > /dev/null 2>&1
12920 $eunicefix protochk
12922 : see what type is used for size_t
12923 rp="What is the type used for the length parameter for string functions?"
12924 set size_t sizetype 'unsigned int' stdio.h sys/types.h
12927 : check for type of arguments to gethostbyaddr.
12928 if test "X$netdb_host_type" = X -o "X$netdb_hlen_type" = X; then
12929 case "$d_gethbyaddr" in
12933 Checking to see what type of arguments are accepted by gethostbyaddr().
12935 hdrs="$define sys/types.h
12936 $d_socket sys/socket.h
12937 $i_niin netinet/in.h
12939 $i_unistd unistd.h"
12940 : The first arg can 'char *' or 'void *'
12941 : The second arg is some of integral type
12942 for xxx in in_addr_t 'const void *' 'const char *' 'void *' 'char *'; do
12943 for yyy in size_t long int; do
12944 case "$netdb_host_type" in
12945 '') try="extern struct hostent *gethostbyaddr($xxx, $yyy, int);"
12946 if ./protochk "$try" $hdrs; then
12947 echo "Your system accepts $xxx for the first arg."
12948 echo "...and $yyy for the second arg."
12949 netdb_host_type="$xxx"
12950 netdb_hlen_type="$yyy"
12956 : In case none of those worked, prompt the user.
12957 case "$netdb_host_type" in
12958 '') rp='What is the type for the 1st argument to gethostbyaddr?'
12961 netdb_host_type=$ans
12962 rp='What is the type for the 2nd argument to gethostbyaddr?'
12965 netdb_hlen_type=$ans
12969 *) : no gethostbyaddr, so pick harmless defaults
12970 netdb_host_type='char *'
12971 netdb_hlen_type="$sizetype"
12974 # Remove the "const" if needed. -- but then we'll have a
12976 # netdb_host_type=`echo "$netdb_host_type" | sed 's/^const //'`
12979 : check for type of argument to gethostbyname.
12980 if test "X$netdb_name_type" = X ; then
12981 case "$d_gethbyname" in
12985 Checking to see what type of argument is accepted by gethostbyname().
12987 hdrs="$define sys/types.h
12988 $d_socket sys/socket.h
12989 $i_niin netinet/in.h
12991 $i_unistd unistd.h"
12992 for xxx in "const char *" "char *"; do
12993 case "$netdb_name_type" in
12994 '') try="extern struct hostent *gethostbyname($xxx);"
12995 if ./protochk "$try" $hdrs; then
12996 echo "Your system accepts $xxx."
12997 netdb_name_type="$xxx"
13002 : In case none of those worked, prompt the user.
13003 case "$netdb_name_type" in
13004 '') rp='What is the type for the 1st argument to gethostbyname?'
13007 netdb_name_type=$ans
13011 *) : no gethostbyname, so pick harmless default
13012 netdb_name_type='char *'
13017 : check for type of 1st argument to getnetbyaddr.
13018 if test "X$netdb_net_type" = X ; then
13019 case "$d_getnbyaddr" in
13023 Checking to see what type of 1st argument is accepted by getnetbyaddr().
13025 hdrs="$define sys/types.h
13026 $d_socket sys/socket.h
13027 $i_niin netinet/in.h
13029 $i_unistd unistd.h"
13030 for xxx in in_addr_t "unsigned long" long "unsigned int" int; do
13031 case "$netdb_net_type" in
13032 '') try="extern struct netent *getnetbyaddr($xxx, int);"
13033 if ./protochk "$try" $hdrs; then
13034 echo "Your system accepts $xxx."
13035 netdb_net_type="$xxx"
13040 : In case none of those worked, prompt the user.
13041 case "$netdb_net_type" in
13042 '') rp='What is the type for the 1st argument to getnetbyaddr?'
13045 netdb_net_type=$ans
13049 *) : no getnetbyaddr, so pick harmless default
13050 netdb_net_type='long'
13054 : locate the preferred pager for this system
13068 '') dflt=/usr/ucb/more;;
13075 rp='What pager is used on your system?'
13079 : see what type pids are declared as in the kernel
13080 rp="What is the type of process ids on this system?"
13081 set pid_t pidtype int stdio.h sys/types.h
13084 : Find earliest binary compatible site_perl subdirectory perl can use.
13085 case "$bincompat5005" in
13086 "$define") xs_apiversion='5.005' ;;
13087 *) xs_apiversion=$version ;; # The current site_perl version.
13089 : Find earliest pure perl site_perl subdirectory perl can use.
13090 : The versioned directories started at 5.005.
13091 pm_apiversion='5.005'
13093 : check for length of pointer
13097 echo "Checking to see how big your pointers are..." >&4
13098 if test "$voidflags" -gt 7; then
13099 echo '#define VOID_PTR char *' > try.c
13101 echo '#define VOID_PTR void *' > try.c
13103 $cat >>try.c <<'EOCP'
13107 printf("%d\n", (int)sizeof(VOID_PTR));
13112 if eval $compile_ok; then
13114 echo "Your pointers are $ptrsize bytes long."
13117 echo "(I can't seem to compile the test program. Guessing...)" >&4
13118 rp="What is the size of a pointer (in bytes)?"
13126 : see if ar generates random libraries by itself
13128 echo "Checking how to generate random libraries on your machine..." >&4
13129 echo 'int bar1() { return bar2(); }' > bar1.c
13130 echo 'int bar2() { return 2; }' > bar2.c
13131 $cat > foo.c <<'EOP'
13132 int main() { printf("%d\n", bar1()); exit(0); }
13134 $cc $ccflags -c bar1.c >/dev/null 2>&1
13135 $cc $ccflags -c bar2.c >/dev/null 2>&1
13136 $cc $ccflags -c foo.c >/dev/null 2>&1
13137 $ar rc bar$_a bar2$_o bar1$_o >/dev/null 2>&1
13138 if $cc $ccflags $ldflags -o foobar foo$_o bar$_a $libs > /dev/null 2>&1 &&
13139 ./foobar >/dev/null 2>&1; then
13140 echo "$ar appears to generate random libraries itself."
13143 elif $ar ts bar$_a >/dev/null 2>&1 &&
13144 $cc $ccflags $ldflags -o foobar foo$_o bar$_a $libs > /dev/null 2>&1 &&
13145 ./foobar >/dev/null 2>&1; then
13146 echo "a table of contents needs to be added with '$ar ts'."
13153 ranlib=`./loc ranlib X /usr/bin /bin /usr/local/bin`
13154 $test -f $ranlib || ranlib=''
13157 if $test -n "$ranlib"; then
13158 echo "your system has '$ranlib'; we'll use that."
13161 echo "your system doesn't seem to support random libraries"
13162 echo "so we'll use lorder and tsort to order the libraries."
13169 : check for type of arguments to select.
13170 case "$selecttype" in
13171 '') case "$d_select" in
13175 Checking to see what type of arguments are accepted by select().
13177 hdrs="$define sys/types.h
13178 $i_systime sys/time.h
13179 $i_sysselct sys/select.h
13180 $d_socket sys/socket.h"
13181 : The first arg can be int, unsigned, or size_t
13182 : The last arg may or may not be 'const'
13184 : void pointer has been seen but using that
13185 : breaks the selectminbits test
13186 for xxx in 'fd_set *' 'int *'; do
13187 for nfd in 'int' 'size_t' 'unsigned long' 'unsigned' ; do
13188 for tmo in 'struct timeval *' 'const struct timeval *'; do
13190 '') try="extern select _(($nfd, $xxx, $xxx, $xxx, $tmo));"
13191 if ./protochk "$try" $hdrs; then
13192 echo "Your system accepts $xxx."
13201 '') rp='What is the type for the 2nd, 3rd, and 4th arguments to select?'
13202 case "$d_fd_set" in
13203 $define) dflt="fd_set *" ;;
13212 *) : no select, so pick a harmless default
13219 : check for the select 'width'
13220 case "$selectminbits" in
13221 '') case "$d_select" in
13225 Checking to see on how many bits at a time your select() operates...
13228 #include <sys/types.h>
13230 #$i_systime I_SYS_TIME
13231 #$i_systimek I_SYS_TIME_KERNEL
13236 # ifdef I_SYS_TIME_KERNEL
13239 # include <sys/time.h>
13240 # ifdef I_SYS_TIME_KERNEL
13244 #$i_sysselct I_SYS_SELECT
13245 #ifdef I_SYS_SELECT
13246 #include <sys/select.h>
13248 #$d_socket HAS_SOCKET
13250 # include <sys/socket.h> /* Might include <sys/bsdtypes.h> */
13254 #define S sizeof(*(b))
13256 #define NBYTES (S * 8 > MINBITS ? S : MINBITS/8)
13257 #define NBITS (NBYTES * 8)
13266 fp = fopen("try.c", "r");
13272 b = ($selecttype)s;
13273 for (i = 0; i < NBITS; i++)
13277 select(fd + 1, b, 0, 0, &t);
13278 for (i = NBITS - 1; i > fd && FD_ISSET(i, b); i--);
13279 printf("%d\n", i + 1);
13284 if eval $compile_ok; then
13285 selectminbits=`./try`
13286 case "$selectminbits" in
13288 Cannot figure out on how many bits at a time your select() operates.
13289 I'll play safe and guess it is 32 bits.
13295 *) bits="$selectminbits bits" ;;
13297 echo "Your select() operates on $bits at a time." >&4
13299 rp='What is the minimum number of bits your select() operates on?'
13300 case "$byteorder" in
13301 1234|12345678) dflt=32 ;;
13306 selectminbits="$val"
13310 *) : no select, so pick a harmless default
13317 : Trace out the files included by signal.h, then look for SIGxxx names.
13318 : Remove SIGARRAYSIZE used by HPUX.
13319 : Remove SIGSTKSIZE used by Linux.
13320 : Remove SIGSTKSZ used by Posix.
13321 : Remove SIGTYP void lines used by OS2.
13322 : Some cpps, like os390, dont give the file name anywhere
13323 if [ "X$fieldn" = X ]; then
13324 : Just make some guesses. We check them later.
13325 xxx='/usr/include/signal.h /usr/include/sys/signal.h'
13327 xxx=`echo '#include <signal.h>' |
13328 $cppstdin $cppminus $cppflags 2>/dev/null |
13329 $grep '^[ ]*#.*include' |
13330 $awk "{print \\$$fieldn}" | $sed 's!"!!g' | $sort | $uniq`
13332 : Check this list of files to be sure we have parsed the cpp output ok.
13333 : This will also avoid potentially non-existent files, such
13336 for xx in $xxx /dev/null ; do
13337 $test -f "$xx" && xxxfiles="$xxxfiles $xx"
13339 : If we have found no files, at least try signal.h
13340 case "$xxxfiles" in
13341 '') xxxfiles=`./findhdr signal.h` ;;
13344 $1 ~ /^#define$/ && $2 ~ /^SIG[A-Z0-9]*$/ && $2 !~ /SIGARRAYSIZE/ && $2 !~ /SIGSTKSIZE/ && $2 !~ /SIGSTKSZ/ && $3 !~ /void/ {
13345 print substr($2, 4, 20)
13347 $1 == "#" && $2 ~ /^define$/ && $3 ~ /^SIG[A-Z0-9]*$/ && $3 !~ /SIGARRAYSIZE/ && $4 !~ /void/ {
13348 print substr($3, 4, 20)
13350 : Append some common names just in case the awk scan failed.
13351 xxx="$xxx ABRT ALRM BUS CANCEL CHLD CLD CONT DIL EMT FPE"
13352 xxx="$xxx FREEZE HUP ILL INT IO IOT KILL LOST LWP PHONE"
13353 xxx="$xxx PIPE POLL PROF PWR QUIT RTMAX RTMIN SEGV STKFLT STOP"
13354 xxx="$xxx SYS TERM THAW TRAP TSTP TTIN TTOU URG USR1 USR2"
13355 xxx="$xxx USR3 USR4 VTALRM WAITING WINCH WIND WINDOW XCPU XFSZ"
13357 : generate a few handy files for later
13358 $cat > signal.c <<'EOCP'
13359 #include <sys/types.h>
13360 #include <signal.h>
13364 /* Strange style to avoid deeply-nested #if/#else/#endif */
13367 # define NSIG (_NSIG)
13373 # define NSIG (SIGMAX+1)
13379 # define NSIG (SIG_MAX+1)
13385 # define NSIG (MAXSIG+1)
13391 # define NSIG (MAX_SIG+1)
13396 # ifdef SIGARRAYSIZE
13397 # define NSIG (SIGARRAYSIZE+1) /* Not sure of the +1 */
13403 # define NSIG (_sys_nsig) /* Solaris 2.5 */
13407 /* Default to some arbitrary number that's big enough to get most
13408 of the common signals.
13414 printf("NSIG %d\n", NSIG);
13420 echo $xxx | $tr ' ' $trnl | $sort | $uniq | $awk '
13422 printf "#ifdef SIG"; printf $1; printf "\n"
13423 printf "printf(\""; printf $1; printf " %%d\\n\",SIG";
13424 printf $1; printf ");\n"
13428 printf "#endif /* JUST_NSIG */\n";
13429 printf "exit(0);\n}\n";
13432 $cat >signal.awk <<'EOP'
13433 BEGIN { ndups = 0 }
13434 $1 ~ /^NSIG$/ { nsig = $2 }
13435 ($1 !~ /^NSIG$/) && (NF == 2) {
13436 if ($2 > maxsig) { maxsig = $2 }
13437 if (sig_name[$2]) {
13438 dup_name[ndups] = $1
13439 dup_num[ndups] = $2
13451 printf("NSIG %d\n", nsig);
13452 for (n = 1; n < nsig; n++) {
13454 printf("%s %d\n", sig_name[n], sig_num[n])
13457 printf("NUM%d %d\n", n, n)
13460 for (n = 0; n < ndups; n++) {
13461 printf("%s %d\n", dup_name[n], dup_num[n])
13465 $cat >signal_cmd <<EOS
13467 if $test -s signal.lst; then
13468 echo "Using your existing signal.lst file"
13473 $cat >>signal_cmd <<'EOS'
13476 if eval $compile_ok; then
13477 ./signal$_exe | $sort -n +1 | $uniq | $awk -f signal.awk >signal.lst
13479 echo "(I can't seem be able to compile the whole test program)" >&4
13480 echo "(I'll try it in little pieces.)" >&4
13481 set signal -DJUST_NSIG
13482 if eval $compile_ok; then
13483 ./signal$_exe > signal.nsg
13486 echo "I can't seem to figure out how many signals you have." >&4
13487 echo "Guessing 50." >&4
13488 echo 'NSIG 50' > signal.nsg
13490 : Now look at all the signal names, one at a time.
13491 for xx in `echo $xxx | $tr ' ' $trnl | $sort | $uniq`; do
13492 $cat > signal.c <<EOCP
13493 #include <sys/types.h>
13494 #include <signal.h>
13497 printf("$xx %d\n", SIG${xx});
13502 if eval $compile; then
13503 echo "SIG${xx} found."
13504 ./signal$_exe >> signal.ls1
13506 echo "SIG${xx} NOT found."
13509 if $test -s signal.ls1; then
13510 $cat signal.nsg signal.ls1 |
13511 $sort -n +1 | $uniq | $awk -f signal.awk >signal.lst
13515 if $test -s signal.lst; then
13518 echo "(AAK! I can't compile the test programs -- Guessing)" >&4
13519 echo 'kill -l' >signal
13520 set X `csh -f <signal`
13524 0) set HUP INT QUIT ILL TRAP ABRT EMT FPE KILL BUS SEGV SYS PIPE ALRM TERM;;
13526 echo $@ | $tr ' ' $trnl | \
13527 $awk '{ printf "%s %d\n", $1, ++s; }
13528 END { printf "NSIG %d\n", ++s }' >signal.lst
13530 $rm -f signal.c signal$_exe signal$_o signal.nsg signal.ls1
13532 chmod a+x signal_cmd
13533 $eunicefix signal_cmd
13535 : generate list of signal names
13537 case "$sig_name_init" in
13539 *) case "$sig_num_init" in
13540 ''|*,*) doinit=yes ;;
13545 echo "Generating a list of signal names and numbers..." >&4
13547 sig_count=`$awk '/^NSIG/ { printf "%d", $2 }' signal.lst`
13548 sig_name=`$awk 'BEGIN { printf "ZERO " }
13549 !/^NSIG/ { printf "%s ", $1 }' signal.lst`
13550 sig_num=`$awk 'BEGIN { printf "0 " }
13551 !/^NSIG/ { printf "%d ", $2 }' signal.lst`
13552 sig_name_init=`$awk 'BEGIN { printf "\"ZERO\", " }
13553 !/^NSIG/ { printf "\"%s\", ", $1 }
13554 END { printf "0\n" }' signal.lst`
13555 sig_num_init=`$awk 'BEGIN { printf "0, " }
13556 !/^NSIG/ { printf "%d, ", $2}
13557 END { printf "0\n"}' signal.lst`
13560 echo "The following $sig_count signals are available:"
13562 echo $sig_name | $awk \
13563 'BEGIN { linelen = 0 }
13565 for (i = 1; i <= NF; i++) {
13566 name = "SIG" $i " "
13567 linelen = linelen + length(name)
13568 if (linelen > 70) {
13570 linelen = length(name)
13576 $rm -f signal signal.c signal.awk signal.lst signal_cmd
13578 : check for socklen_t
13580 echo "Checking to see if you have socklen_t..." >&4
13582 #include <sys/types.h>
13583 #$d_socket HAS_SOCKET
13585 #include <sys/socket.h>
13587 int main() { socklen_t x = 16; }
13590 if eval $compile; then
13592 echo "You have socklen_t."
13595 echo "You do not have socklen_t."
13596 case "$sizetype" in
13597 size_t) echo "(You do have size_t, that might work.)" ;;
13604 : check for type of the size argument to socket calls
13605 case "$d_socket" in
13609 Checking to see what type is the last argument of accept().
13611 hdrs="$define sys/types.h $d_socket sys/socket.h"
13613 case "$d_socklen_t" in
13614 "$define") yyy="$yyy socklen_t"
13616 yyy="$yyy $sizetype int long"
13617 for xxx in $yyy; do
13618 case "$socksizetype" in
13619 '') try="extern int accept(int, struct sockaddr *, $xxx *);"
13620 if ./protochk "$try" $hdrs; then
13621 echo "Your system accepts '$xxx *' for the last argument of accept()."
13622 socksizetype="$xxx"
13627 : In case none of those worked, prompt the user.
13628 case "$socksizetype" in
13629 '') rp='What is the type for socket address structure sizes?'
13636 *) : no sockets, so pick relatively harmless defaults
13637 socksizetype='char *'
13641 : see what type is used for signed size_t
13642 set ssize_t ssizetype int stdio.h sys/types.h
13645 $cat > ssize.c <<EOM
13647 #include <sys/types.h>
13648 #define Size_t $sizetype
13649 #define SSize_t $dflt
13652 if (sizeof(Size_t) == sizeof(SSize_t))
13654 else if (sizeof(Size_t) == sizeof(int))
13663 if eval $compile_ok && ./ssize > /dev/null; then
13664 ssizetype=`./ssize`
13665 echo "I'll be using $ssizetype for functions returning a byte count." >&4
13668 Help! I can't compile and run the ssize_t test program: please enlighten me!
13669 (This is probably a misconfiguration in your system or libraries, and
13670 you really ought to fix it. Still, I'll try anyway.)
13672 I need a type that is the same size as $sizetype, but is guaranteed to
13673 be signed. Common values are ssize_t, int and long.
13676 rp="What signed type is the same size as $sizetype?"
13680 $rm -f ssize ssize.*
13682 : see what type of char stdio uses.
13684 if $contains 'unsigned.*char.*_ptr;' `./findhdr stdio.h` >/dev/null 2>&1 ; then
13685 echo "Your stdio uses unsigned chars." >&4
13686 stdchar="unsigned char"
13688 echo "Your stdio uses signed chars." >&4
13692 : see if time exists
13694 if test "X$d_time" = X -o X"$timetype" = X; then
13695 if set time val -f d_time; eval $csym; $val; then
13696 echo 'time() found.' >&4
13698 rp="What is the type returned by time() on this system?"
13699 set time_t timetype long stdio.h sys/types.h
13702 echo 'time() not found, hope that will do.' >&4
13710 : see what type uids are declared as in the kernel
13712 echo "Looking for the type for user ids returned by getuid()."
13713 set uid_t uidtype xxx stdio.h sys/types.h
13717 xxx=`./findhdr sys/user.h`
13718 set `grep '_ruid;' "$xxx" 2>/dev/null` unsigned short
13720 unsigned) dflt="$1 $2" ;;
13724 *) dflt="$uidtype";;
13727 uid_t) echo "uid_t found." ;;
13728 *) rp="What is the type for user ids returned by getuid()?"
13736 *_t) zzz="$uidtype" ;;
13739 echo "Checking the size of $zzz..." >&4
13741 #include <sys/types.h>
13744 printf("%d\n", (int)sizeof($uidtype));
13749 if eval $compile_ok; then
13753 echo "(I can't execute the test program--guessing $uidsize.)" >&4
13756 echo "Your $zzz is $uidsize bytes long."
13761 echo "(I can't compile the test program--guessing $uidsize.)" >&4
13766 *_t) zzz="$uidtype" ;;
13769 echo "Checking the sign of $zzz..." >&4
13771 #include <sys/types.h>
13782 if eval $compile; then
13786 echo "(I can't execute the test program--guessing unsigned.)" >&4
13790 1) echo "Your $zzz is unsigned." ;;
13791 -1) echo "Your $zzz is signed." ;;
13797 echo "(I can't compile the test program--guessing unsigned.)" >&4
13803 $echo "Checking the format string to be used for uids..." >&4
13806 -1) if $test X"$uidsize" = X"$ivsize"; then
13807 uidformat="$ivdformat"
13809 if $test X"$uidsize" = X"$longsize"; then
13812 if $test X"$uidsize" = X"$intsize"; then
13815 if $test X"$uidsize" = X"$shortsize"; then
13822 *) if $test X"$uidsize" = X"$uvsize"; then
13823 uidformat="$uvuformat"
13825 if $test X"$uidsize" = X"$longsize"; then
13828 if $test X"$uidsize" = X"$intsize"; then
13831 if $test X"$uidsize" = X"$shortsize"; then
13840 : see if dbm.h is available
13841 : see if dbmclose exists
13842 set dbmclose d_dbmclose
13845 case "$d_dbmclose" in
13855 *) set rpcsvc/dbm.h i_rpcsvcdbm
13860 *) echo "We won't be including <dbm.h>"
13870 : see if this is a sys/file.h system
13875 : do we need to include sys/file.h ?
13879 if $h_sysfile; then
13881 echo "We'll be including <sys/file.h>." >&4
13884 echo "We won't be including <sys/file.h>." >&4
13894 : see if fcntl.h is there
13899 : see if we can include fcntl.h
13905 echo "We'll be including <fcntl.h>." >&4
13908 if $h_sysfile; then
13909 echo "We don't need to include <fcntl.h> if we include <sys/file.h>." >&4
13911 echo "We won't be including <fcntl.h>." >&4
13923 : see if this is a iconv.h system
13924 set iconv.h i_iconv
13927 : see if locale.h is available
13928 set locale.h i_locale
13931 : see if mach cthreads are available
13932 if test "X$usethreads" = "X$define"; then
13933 set mach/cthreads.h i_machcthr
13936 i_machcthr="$undef"
13941 : see if this is a math.h system
13945 : see if this is a mntent.h system
13946 set mntent.h i_mntent
13949 : see if ndbm.h is available
13954 : see if dbm_open exists
13955 set dbm_open d_dbm_open
13957 case "$d_dbm_open" in
13960 echo "We won't be including <ndbm.h>"
13969 : see if net/errno.h is available
13971 set net/errno.h val
13974 : Unfortunately, it causes problems on some systems. Arrgh.
13977 cat > try.c <<'EOM'
13980 #include <net/errno.h>
13986 if $cc $ccflags -c try.c >/dev/null 2>&1; then
13987 echo "We'll be including <net/errno.h>." >&4
13989 echo "We won't be including <net/errno.h>." >&4
13998 : see if netinet/tcp.h is available
13999 set netinet/tcp.h i_netinettcp
14002 : see if this is a poll.h system
14007 $echo "Guessing which symbols your C compiler and preprocessor define..." >&4
14008 $cat <<'EOSH' > Cppsym.know
14009 a29k ABI64 aegis AES_SOURCE AIX AIX32 AIX370
14010 AIX41 AIX42 AIX43 AIX_SOURCE aixpc ALL_SOURCE
14011 alliant alpha am29000 AM29000 amiga AMIGAOS AMIX
14012 ansi ANSI_C_SOURCE apollo ardent atarist att386 att3b BeOS
14013 BIG_ENDIAN BIT_MSF bsd BSD bsd43 bsd4_2 bsd4_3 BSD4_3 bsd4_4
14014 BSD_4_3 BSD_4_4 BSD_NET2 BSD_TIME BSD_TYPES BSDCOMPAT bsdi
14015 bull c cadmus clipper CMU COFF COMPILER_VERSION
14016 concurrent convex cpu cray CRAY CRAYMPP ctix CX_UX
14017 CYGWIN DGUX DGUX_SOURCE DJGPP dmert DOLPHIN DPX2 DSO
14018 Dynix DynixPTX ELF encore EPI EXTENSIONS FILE_OFFSET_BITS
14019 FreeBSD GCC_NEW_VARARGS gcos gcx gimpel
14020 GNU_SOURCE GNUC GNUC_MINOR GO32 gould GOULD_PN
14021 H3050R H3050RX hbullx20 hcx host_mips
14022 hp200 hp300 hp700 HP700 hp800 hp9000
14023 hp9000s200 hp9000s300 hp9000s400 hp9000s500
14024 hp9000s700 hp9000s800 hp9k8 hp_osf hppa hpux HPUX_SOURCE
14025 i186 i286 i386 i486 i586 i686 i8086 i80960 i860 I960
14026 iAPX286 ibm ibm032 ibmesa IBMR2 ibmrt ILP32 ILP64
14027 INLINE_INTRINSICS INTRINSICS INT64 interdata is68k ksr1
14028 LANGUAGE_C LARGE_FILE_API LARGEFILE64_SOURCE
14029 LARGEFILE_SOURCE LFS64_LARGEFILE LFS_LARGEFILE
14030 Linux LITTLE_ENDIAN LONG64 LONG_DOUBLE LONG_LONG
14031 LONGDOUBLE LONGLONG LP64 luna luna88k Lynx
14032 M68000 m68k m88100 m88k M88KBCS_TARGET M_COFF
14033 M_I186 M_I286 M_I386 M_I8086 M_I86 M_I86SM M_SYS3
14034 M_SYS5 M_SYSIII M_SYSV M_UNIX M_XENIX MACH machine MachTen
14035 MATH_HAS_NO_SIDE_EFFECTS
14036 mc300 mc500 mc68000 mc68010 mc68020 mc68030 mc68040
14037 mc68060 mc68k mc68k32 mc700 mc88000 mc88100 merlin
14038 mert MiNT mips MIPS_FPSET MIPS_ISA MIPS_SIM MIPS_SZINT
14039 MIPS_SZLONG MIPS_SZPTR MIPSEB MIPSEL MODERN_C motorola
14040 mpeix MSDOS MTXINU MULTIMAX mvs MVS n16 ncl_el ncl_mr
14041 NetBSD news1500 news1700 news1800 news1900 news3700
14042 news700 news800 news900 NeXT NLS ns16000 ns32000
14043 ns32016 ns32332 ns32k nsc32000
14044 OCS88 OEMVS OpenBSD os OS2 OS390 osf OSF1 OSF_SOURCE
14045 pa_risc PA_RISC1_1 PA_RISC2_0 PARAGON parisc
14046 pc532 pdp11 PGC PIC plexus PORTAR posix
14047 POSIX1B_SOURCE POSIX2_SOURCE POSIX4_SOURCE
14048 POSIX_C_SOURCE POSIX_SOURCE POWER
14049 PROTOTYPES PWB pyr QNX R3000 REENTRANT RES Rhapsody RISC6000
14050 riscix riscos RT scs SCO sequent sgi SGI_SOURCE sinix
14051 SIZE_INT SIZE_LONG SIZE_PTR SOCKET_SOURCE SOCKETS_SOURCE
14052 sony sony_news sonyrisc sparc sparclite spectrum
14053 stardent stdc STDC_EXT stratos sun sun3 sun386
14054 Sun386i svr3 svr4 SVR4_2 SVR4_SOURCE svr5
14055 SX system SYSTYPE_BSD SYSTYPE_BSD43 SYSTYPE_BSD44
14056 SYSTYPE_SVR4 SYSTYPE_SVR5 SYSTYPE_SYSV SYSV SYSV3 SYSV4 SYSV5
14057 sysV68 sysV88 Tek4132 Tek4300 titan
14058 tower tower32 tower32_200 tower32_600 tower32_700
14059 tower32_800 tower32_850 tss
14060 u370 u3b u3b2 u3b20 u3b200 u3b20d u3b5
14061 ultrix UMAXV UnicomPBB UnicomPBD UNICOS UNICOSMK
14062 unix UNIX95 UNIX99 unixpc unos USGr4 USGr4_2
14063 Utek UTek UTS UWIN uxpm uxps vax venix VMESA vms xenix Xenix286
14064 XOPEN_SOURCE XOPEN_SOURCE_EXTENDED XPG2 XPG2_EXTENDED
14065 XPG3 XPG3_EXTENDED XPG4 XPG4_EXTENDED
14068 # Maybe put other stuff here too.
14069 cat <<EOSH >>Cppsym.know
14072 ./tr '[a-z]' '[A-Z]' < Cppsym.know > Cppsym.a
14073 ./tr '[A-Z]' '[a-z]' < Cppsym.know > Cppsym.b
14074 $cat Cppsym.a Cppsym.b | $tr ' ' $trnl | sort | uniq > Cppsym.know
14075 $rm -f Cppsym.a Cppsym.b
14076 cat <<EOSH > Cppsym
14078 if $test \$# -gt 0; then
14079 echo \$* | $tr " " "$trnl" | ./Cppsym.try > Cppsym.got
14080 if $test -s Cppsym.got; then
14087 $tr " " "$trnl" | ./Cppsym.try
14093 cat <<EOSH > Cppsym.try
14095 cat <<'EOCP' > try.c
14101 cat <<'EOSH' >> Cppsym.try
14103 printf "#ifdef %s\n#if %s+0\nprintf(\"%s=%%ld\\n\", %s);\n#else\nprintf(\"%s\\n\");\n#endif\n#endif\n", $1, $1, $1, $1, $1
14104 printf "#ifdef _%s\n#if _%s+0\nprintf(\"_%s=%%ld\\n\", _%s);\n#else\nprintf(\"_%s\\n\");\n#endif\n#endif\n", $1, $1, $1, $1, $1
14105 printf "#ifdef __%s\n#if __%s+0\nprintf(\"__%s=%%ld\\n\", __%s);\n#else\nprintf(\"__%s\\n\");\n#endif\n#endif\n", $1, $1, $1, $1, $1
14106 printf "#ifdef __%s__\n#if __%s__+0\nprintf(\"__%s__=%%ld\\n\", __%s__);\n#else\nprintf(\"__%s__\\n\");\n#endif\n#endif\n", $1, $1, $1, $1, $1
14110 cat <<EOSH >> Cppsym.try
14112 case "$osname-$gccversion" in
14113 irix-) ccflags="\$ccflags -woff 1178" ;;
14115 $cc $optimize \$ccflags $ldflags -o try try.c $libs && ./try$exe_ext
14117 chmod +x Cppsym.try
14118 $eunicefix Cppsym.try
14119 ./Cppsym < Cppsym.know > Cppsym.true
14120 : now check the C compiler for additional symbols
14121 postprocess_cc_v=''
14123 aix) postprocess_cc_v="|$tr , ' '" ;;
14130 for i in \`$cc -v -c tmp.c 2>&1 $postprocess_cc_v\`
14133 -D*) echo "\$i" | $sed 's/^-D//';;
14134 -A*) $test "$gccversion" && echo "\$i" | $sed 's/^-A\(.*\)(\(.*\))/\1=\2/';;
14139 postprocess_cc_v=''
14142 ./ccsym > ccsym1.raw
14143 if $test -s ccsym1.raw; then
14144 $sort ccsym1.raw | $uniq >ccsym.raw
14146 mv ccsym1.raw ccsym.raw
14149 $awk '/\=/ { print $0; next }
14150 { print $0"=1" }' ccsym.raw >ccsym.list
14151 $awk '/\=/ { print $0; next }
14152 { print $0"=1" }' Cppsym.true >ccsym.true
14153 $comm -13 ccsym.true ccsym.list >ccsym.own
14154 $comm -12 ccsym.true ccsym.list >ccsym.com
14155 $comm -23 ccsym.true ccsym.list >ccsym.cpp
14157 if $test -z ccsym.raw; then
14158 echo "Your C compiler doesn't seem to define any symbols!" >&4
14160 echo "However, your C preprocessor defines the following symbols:"
14163 cppsymbols=`$cat Cppsym.true`
14164 cppsymbols=`echo $cppsymbols`
14165 cppccsymbols="$cppsymbols"
14167 if $test -s ccsym.com; then
14168 echo "Your C compiler and pre-processor define these symbols:"
14169 $sed -e 's/\(.*\)=.*/\1/' ccsym.com
14172 cppccsymbols=`$cat ccsym.com`
14173 cppccsymbols=`echo $cppccsymbols`
14174 $test "$silent" || sleep 1
14176 if $test -s ccsym.cpp; then
14177 $test "$also" && echo " "
14178 echo "Your C pre-processor ${also}defines the following symbols:"
14179 $sed -e 's/\(.*\)=.*/\1/' ccsym.cpp
14181 cppsymbols=`$cat ccsym.cpp`
14182 cppsymbols=`echo $cppsymbols`
14183 $test "$silent" || sleep 1
14185 if $test -s ccsym.own; then
14186 $test "$also" && echo " "
14187 echo "Your C compiler ${also}defines the following cpp symbols:"
14188 $sed -e 's/\(.*\)=1/\1/' ccsym.own
14189 $sed -e 's/\(.*\)=.*/\1/' ccsym.own | $uniq >>Cppsym.true
14190 ccsymbols=`$cat ccsym.own`
14191 ccsymbols=`echo $ccsymbols`
14192 $test "$silent" || sleep 1
14197 : see if this is a termio system
14201 if $test `./findhdr termios.h`; then
14202 set tcsetattr i_termios
14208 "$define") echo "You have POSIX termios.h... good!" >&4;;
14209 *) if ./Cppsym pyr; then
14210 case "`/bin/universe`" in
14211 ucb) if $test `./findhdr sgtty.h`; then
14213 echo "<sgtty.h> found." >&4
14215 echo "System is pyramid with BSD universe."
14216 echo "<sgtty.h> not found--you could have problems." >&4
14218 *) if $test `./findhdr termio.h`; then
14220 echo "<termio.h> found." >&4
14222 echo "System is pyramid with USG universe."
14223 echo "<termio.h> not found--you could have problems." >&4
14227 if $test `./findhdr termio.h`; then
14228 echo "<termio.h> found." >&4
14230 elif $test `./findhdr sgtty.h`; then
14231 echo "<sgtty.h> found." >&4
14234 echo "Neither <termio.h> nor <sgtty.h> found--you could have problems." >&4
14237 if $test `./findhdr sgtty.h`; then
14238 echo "<sgtty.h> found." >&4
14240 elif $test `./findhdr termio.h`; then
14241 echo "<termio.h> found." >&4
14244 echo "Neither <sgtty.h> nor <termio.h> found--you could have problems." >&4
14248 set i_termio; eval $setvar
14249 val=$val2; set i_sgtty; eval $setvar
14250 val=$val3; set i_termios; eval $setvar
14252 : see if this is a shadow.h system
14253 set shadow.h i_shadow
14256 : see if this is a socks.h system
14257 set socks.h i_socks
14260 : see if stdarg is available
14262 if $test `./findhdr stdarg.h`; then
14263 echo "<stdarg.h> found." >&4
14266 echo "<stdarg.h> NOT found." >&4
14270 : see if varags is available
14272 if $test `./findhdr varargs.h`; then
14273 echo "<varargs.h> found." >&4
14275 echo "<varargs.h> NOT found, but that's ok (I hope)." >&4
14278 : set up the varargs testing programs
14279 $cat > varargs.c <<EOP
14281 #include <stdarg.h>
14284 #include <varargs.h>
14288 int f(char *p, ...)
14302 p = va_arg(ap, char *);
14307 $cat > varargs <<EOP
14309 if $cc -c $ccflags -D\$1 varargs.c >/dev/null 2>&1; then
14318 : now check which varargs header should be included
14323 if `./varargs I_STDARG`; then
14325 elif `./varargs I_VARARGS`; then
14330 if `./varargs I_VARARGS`; then
14337 echo "I could not find the definition for va_dcl... You have problems..." >&4
14338 val="$undef"; set i_stdarg; eval $setvar
14339 val="$undef"; set i_varargs; eval $setvar
14344 case "$i_varhdr" in
14346 val="$define"; set i_stdarg; eval $setvar
14347 val="$undef"; set i_varargs; eval $setvar
14350 val="$undef"; set i_stdarg; eval $setvar
14351 val="$define"; set i_varargs; eval $setvar
14354 echo "We'll include <$i_varhdr> to get va_dcl definition." >&4;;
14358 : see if stddef is available
14359 set stddef.h i_stddef
14362 : see if sys/access.h is available
14363 set sys/access.h i_sysaccess
14366 : see if ioctl defs are in sgtty, termio, sys/filio or sys/ioctl
14367 set sys/filio.h i_sysfilio
14370 if $test `./findhdr sys/ioctl.h`; then
14372 echo '<sys/ioctl.h> found.' >&4
14375 if $test $i_sysfilio = "$define"; then
14376 echo '<sys/ioctl.h> NOT found.' >&4
14378 $test $i_sgtty = "$define" && xxx="sgtty.h"
14379 $test $i_termio = "$define" && xxx="termio.h"
14380 $test $i_termios = "$define" && xxx="termios.h"
14381 echo "No <sys/ioctl.h> found, assuming ioctl args are defined in <$xxx>." >&4
14388 : see if this is a syslog.h system
14389 set syslog.h i_syslog
14393 : see if this is a sys/mode.h system
14394 set sys/mode.h i_sysmode
14397 : see if sys/resource.h has to be included
14398 set sys/resource.h i_sysresrc
14401 : see if sys/security.h is available
14402 set sys/security.h i_syssecrt
14405 : see if this is a sys/statvfs.h system
14406 set sys/statvfs.h i_sysstatvfs
14409 : see if this is a sys/uio.h system
14410 set sys/uio.h i_sysuio
14413 : see if this is a sys/un.h system
14414 set sys/un.h i_sysun
14418 : see if this is a sys/utsname.h system
14419 set sys/utsname.h i_sysutsname
14422 : see if this is a syswait system
14423 set sys/wait.h i_syswait
14426 : see if this is a ustat.h system
14427 set ustat.h i_ustat
14430 : see if this is an utime system
14431 set utime.h i_utime
14434 : see if this is a values.h system
14435 set values.h i_values
14438 : see if this is a vfork system
14441 set vfork.h i_vfork
14449 : see if gdbm.h is available
14454 : see if gdbm_open exists
14455 set gdbm_open d_gdbm_open
14457 case "$d_gdbm_open" in
14460 echo "We won't be including <gdbm.h>"
14470 echo "Looking for extensions..." >&4
14471 : If we are using the old config.sh, known_extensions may contain
14472 : old or inaccurate or duplicate values.
14473 known_extensions=''
14474 nonxs_extensions=''
14475 : We do not use find because it might not be available.
14476 : We do not just use MANIFEST because the user may have dropped
14477 : some additional extensions into the source tree and expect them
14480 : Function to recursively find available extensions, ignoring DynaLoader
14481 : NOTE: recursion limit of 10 to prevent runaway in case of symlink madness
14485 DynaLoader|dynaload) ;;
14487 if $test -f $xxx/$xxx.xs; then
14488 known_extensions="$known_extensions $1$xxx";
14489 elif $test -f $xxx/Makefile.PL; then
14490 nonxs_extensions="$nonxs_extensions $1$xxx";
14492 if $test -d $xxx -a $# -lt 10; then
14495 eval $find_extensions;
14507 eval $find_extensions
14508 set X $nonxs_extensions
14510 nonxs_extensions="$*"
14511 set X $known_extensions
14513 known_extensions="$*"
14516 : Now see which are supported on this system.
14518 for xxx in $known_extensions ; do
14522 $define) avail_ext="$avail_ext $xxx" ;;
14525 GDBM_File|gdbm_fil)
14527 $define) avail_ext="$avail_ext $xxx" ;;
14530 NDBM_File|ndbm_fil)
14533 case "$osname-$use64bitint" in
14536 *-lndbm*) avail_ext="$avail_ext $xxx" ;;
14539 *) avail_ext="$avail_ext $xxx" ;;
14544 ODBM_File|odbm_fil)
14545 case "${i_dbm}${i_rpcsvcdbm}" in
14547 case "$osname-$use64bitint" in
14550 *-ldbm*) avail_ext="$avail_ext $xxx" ;;
14553 *) avail_ext="$avail_ext $xxx" ;;
14559 case "$useposix" in
14560 true|define|y) avail_ext="$avail_ext $xxx" ;;
14564 case "$useopcode" in
14565 true|define|y) avail_ext="$avail_ext $xxx" ;;
14569 case "$d_socket" in
14570 true|$define|y) avail_ext="$avail_ext $xxx" ;;
14574 case "$usethreads" in
14575 true|$define|y) avail_ext="$avail_ext $xxx" ;;
14579 : XXX Do we need a useipcsysv variable here
14580 case "${d_msg}${d_sem}${d_shm}" in
14581 *"${define}"*) avail_ext="$avail_ext $xxx" ;;
14584 *) avail_ext="$avail_ext $xxx"
14593 : Now see which nonxs extensions are supported on this system.
14594 : For now assume all are.
14596 for xxx in $nonxs_extensions ; do
14598 *) nonxs_ext="$nonxs_ext $xxx"
14610 A number of extensions are supplied with $package. You may choose to
14611 compile these extensions for dynamic loading (the default), compile
14612 them into the $package executable (static loading), or not include
14613 them at all. Answer "none" to include no extensions.
14614 Note that DynaLoader is always built and need not be mentioned here.
14617 case "$dynamic_ext" in
14618 '') dflt="$avail_ext" ;;
14619 *) dflt="$dynamic_ext"
14620 # Perhaps we are reusing an old out-of-date config.sh.
14623 if test X"$dynamic_ext" != X"$avail_ext"; then
14625 NOTICE: Your previous config.sh list may be incorrect.
14626 The extensions now available to you are
14628 but the default list from your previous config.sh is
14640 rp="What extensions do you wish to load dynamically?"
14643 none) dynamic_ext=' ' ;;
14644 *) dynamic_ext="$ans" ;;
14647 case "$static_ext" in
14649 : Exclude those already listed in dynamic linking
14651 for xxx in $avail_ext; do
14652 case " $dynamic_ext " in
14654 *) dflt="$dflt $xxx" ;;
14661 *) dflt="$static_ext"
14668 rp="What extensions do you wish to load statically?"
14671 none) static_ext=' ' ;;
14672 *) static_ext="$ans" ;;
14677 A number of extensions are supplied with $package. Answer "none"
14678 to include no extensions.
14679 Note that DynaLoader is always built and need not be mentioned here.
14682 case "$static_ext" in
14683 '') dflt="$avail_ext" ;;
14684 *) dflt="$static_ext"
14685 # Perhaps we are reusing an old out-of-date config.sh.
14688 if test X"$static_ext" != X"$avail_ext"; then
14690 NOTICE: Your previous config.sh list may be incorrect.
14691 The extensions now available to you are
14693 but the default list from your previous config.sh is
14702 : Exclude those that are not xs extensions
14706 rp="What extensions do you wish to include?"
14709 none) static_ext=' ' ;;
14710 *) static_ext="$ans" ;;
14715 set X $dynamic_ext $static_ext $nonxs_ext
14719 : Remove build directory name from cppstdin so it can be used from
14720 : either the present location or the final installed location.
14722 : Get out of the UU directory to get correct path name.
14724 case "$cppstdin" in
14726 echo "Stripping down cppstdin path name"
14732 : end of configuration questions
14734 echo "End of configuration questions."
14737 : back to where it started
14738 if test -d ../UU; then
14742 : configuration may be patched via a 'config.over' file
14743 if $test -f config.over; then
14746 rp='I see a config.over file. Do you wish to load it?'
14749 n*) echo "OK, I'll ignore it.";;
14751 echo "Configuration override changes have been loaded."
14756 : in case they want portability, strip down executable paths
14757 case "$d_portable" in
14760 echo "Stripping down executable paths..." >&4
14761 for file in $loclist $trylist; do
14763 eval $file=`basename $temp`
14768 : create config.sh file
14770 echo "Creating config.sh..." >&4
14771 $spitshell <<EOT >config.sh
14774 # This file was produced by running the Configure script. It holds all the
14775 # definitions figured out by Configure. Should you modify one of these values,
14776 # do not forget to propagate your changes by running "Configure -der". You may
14777 # instead choose to run each of the .SH files by yourself, or "Configure -S".
14780 # Package name : $package
14781 # Source directory : $src
14782 # Configuration time: $cf_time
14783 # Configured by : $cf_by
14784 # Target system : $myuname
14794 Revision='$Revision'
14801 alignbytes='$alignbytes'
14802 ansi2knr='$ansi2knr'
14803 aphostname='$aphostname'
14804 api_revision='$api_revision'
14805 api_subversion='$api_subversion'
14806 api_version='$api_version'
14807 api_versionstring='$api_versionstring'
14810 archlibexp='$archlibexp'
14811 archname64='$archname64'
14812 archname='$archname'
14813 archobjs='$archobjs'
14818 bincompat5005='$bincompat5005'
14822 byteorder='$byteorder'
14824 castflags='$castflags'
14827 cccdlflags='$cccdlflags'
14828 ccdlflags='$ccdlflags'
14830 ccsymbols='$ccsymbols'
14832 cf_email='$cf_email'
14834 charsize='$charsize'
14838 clocktype='$clocktype'
14840 compress='$compress'
14841 contains='$contains'
14845 cpp_stuff='$cpp_stuff'
14846 cppccsymbols='$cppccsymbols'
14847 cppflags='$cppflags'
14849 cppminus='$cppminus'
14851 cppstdin='$cppstdin'
14852 cppsymbols='$cppsymbols'
14853 crosscompile='$crosscompile'
14854 cryptlib='$cryptlib'
14856 d_Gconvert='$d_Gconvert'
14857 d_PRIEldbl='$d_PRIEldbl'
14858 d_PRIFldbl='$d_PRIFldbl'
14859 d_PRIGldbl='$d_PRIGldbl'
14860 d_PRIX64='$d_PRIX64'
14861 d_PRId64='$d_PRId64'
14862 d_PRIeldbl='$d_PRIeldbl'
14863 d_PRIfldbl='$d_PRIfldbl'
14864 d_PRIgldbl='$d_PRIgldbl'
14865 d_PRIi64='$d_PRIi64'
14866 d_PRIo64='$d_PRIo64'
14867 d_PRIu64='$d_PRIu64'
14868 d_PRIx64='$d_PRIx64'
14869 d_access='$d_access'
14870 d_accessx='$d_accessx'
14872 d_archlib='$d_archlib'
14875 d_attribut='$d_attribut'
14878 d_bincompat5005='$d_bincompat5005'
14880 d_bsdgetpgrp='$d_bsdgetpgrp'
14881 d_bsdsetpgrp='$d_bsdsetpgrp'
14883 d_casti32='$d_casti32'
14884 d_castneg='$d_castneg'
14885 d_charvspr='$d_charvspr'
14887 d_chroot='$d_chroot'
14888 d_chsize='$d_chsize'
14889 d_closedir='$d_closedir'
14893 d_cuserid='$d_cuserid'
14894 d_dbl_dig='$d_dbl_dig'
14895 d_difftime='$d_difftime'
14896 d_dirnamlen='$d_dirnamlen'
14897 d_dlerror='$d_dlerror'
14898 d_dlopen='$d_dlopen'
14899 d_dlsymun='$d_dlsymun'
14900 d_dosuid='$d_dosuid'
14901 d_drand48proto='$d_drand48proto'
14903 d_eaccess='$d_eaccess'
14904 d_endgrent='$d_endgrent'
14905 d_endhent='$d_endhent'
14906 d_endnent='$d_endnent'
14907 d_endpent='$d_endpent'
14908 d_endpwent='$d_endpwent'
14909 d_endsent='$d_endsent'
14910 d_endspent='$d_endspent'
14911 d_eofnblk='$d_eofnblk'
14912 d_eunice='$d_eunice'
14913 d_fchmod='$d_fchmod'
14914 d_fchown='$d_fchown'
14916 d_fd_macros='$d_fd_macros'
14917 d_fd_set='$d_fd_set'
14918 d_fds_bits='$d_fds_bits'
14919 d_fgetpos='$d_fgetpos'
14920 d_flexfnam='$d_flexfnam'
14923 d_fpathconf='$d_fpathconf'
14924 d_fpos64_t='$d_fpos64_t'
14925 d_fs_data_s='$d_fs_data_s'
14926 d_fseeko='$d_fseeko'
14927 d_fsetpos='$d_fsetpos'
14928 d_fstatfs='$d_fstatfs'
14929 d_fstatvfs='$d_fstatvfs'
14930 d_ftello='$d_ftello'
14932 d_getcwd='$d_getcwd'
14933 d_getfsstat='$d_getfsstat'
14934 d_getgrent='$d_getgrent'
14935 d_getgrps='$d_getgrps'
14936 d_gethbyaddr='$d_gethbyaddr'
14937 d_gethbyname='$d_gethbyname'
14938 d_gethent='$d_gethent'
14939 d_gethname='$d_gethname'
14940 d_gethostprotos='$d_gethostprotos'
14941 d_getlogin='$d_getlogin'
14942 d_getmnt='$d_getmnt'
14943 d_getmntent='$d_getmntent'
14944 d_getnbyaddr='$d_getnbyaddr'
14945 d_getnbyname='$d_getnbyname'
14946 d_getnent='$d_getnent'
14947 d_getnetprotos='$d_getnetprotos'
14948 d_getpbyname='$d_getpbyname'
14949 d_getpbynumber='$d_getpbynumber'
14950 d_getpent='$d_getpent'
14951 d_getpgid='$d_getpgid'
14952 d_getpgrp2='$d_getpgrp2'
14953 d_getpgrp='$d_getpgrp'
14954 d_getppid='$d_getppid'
14955 d_getprior='$d_getprior'
14956 d_getprotoprotos='$d_getprotoprotos'
14957 d_getpwent='$d_getpwent'
14958 d_getsbyname='$d_getsbyname'
14959 d_getsbyport='$d_getsbyport'
14960 d_getsent='$d_getsent'
14961 d_getservprotos='$d_getservprotos'
14962 d_getspent='$d_getspent'
14963 d_getspnam='$d_getspnam'
14964 d_gettimeod='$d_gettimeod'
14965 d_gnulibc='$d_gnulibc'
14966 d_grpasswd='$d_grpasswd'
14967 d_hasmntopt='$d_hasmntopt'
14971 d_inetaton='$d_inetaton'
14972 d_int64_t='$d_int64_t'
14973 d_isascii='$d_isascii'
14974 d_killpg='$d_killpg'
14975 d_lchown='$d_lchown'
14976 d_ldbl_dig='$d_ldbl_dig'
14978 d_locconv='$d_locconv'
14980 d_longdbl='$d_longdbl'
14981 d_longlong='$d_longlong'
14982 d_lseekproto='$d_lseekproto'
14984 d_madvise='$d_madvise'
14986 d_mbstowcs='$d_mbstowcs'
14987 d_mbtowc='$d_mbtowc'
14988 d_memchr='$d_memchr'
14989 d_memcmp='$d_memcmp'
14990 d_memcpy='$d_memcpy'
14991 d_memmove='$d_memmove'
14992 d_memset='$d_memset'
14994 d_mkdtemp='$d_mkdtemp'
14995 d_mkfifo='$d_mkfifo'
14996 d_mkstemp='$d_mkstemp'
14997 d_mkstemps='$d_mkstemps'
14998 d_mktime='$d_mktime'
15000 d_mprotect='$d_mprotect'
15002 d_msg_ctrunc='$d_msg_ctrunc'
15003 d_msg_dontroute='$d_msg_dontroute'
15004 d_msg_oob='$d_msg_oob'
15005 d_msg_peek='$d_msg_peek'
15006 d_msg_proxy='$d_msg_proxy'
15007 d_msgctl='$d_msgctl'
15008 d_msgget='$d_msgget'
15009 d_msgrcv='$d_msgrcv'
15010 d_msgsnd='$d_msgsnd'
15012 d_munmap='$d_munmap'
15013 d_mymalloc='$d_mymalloc'
15015 d_nv_preserves_uv='$d_nv_preserves_uv'
15016 d_off64_t='$d_off64_t'
15017 d_old_pthread_create_joinable='$d_old_pthread_create_joinable'
15018 d_oldpthreads='$d_oldpthreads'
15019 d_oldsock='$d_oldsock'
15021 d_pathconf='$d_pathconf'
15023 d_phostname='$d_phostname'
15026 d_portable='$d_portable'
15027 d_pthread_yield='$d_pthread_yield'
15029 d_pwchange='$d_pwchange'
15030 d_pwclass='$d_pwclass'
15031 d_pwcomment='$d_pwcomment'
15032 d_pwexpire='$d_pwexpire'
15033 d_pwgecos='$d_pwgecos'
15034 d_pwpasswd='$d_pwpasswd'
15035 d_pwquota='$d_pwquota'
15038 d_readdir='$d_readdir'
15039 d_readlink='$d_readlink'
15040 d_rename='$d_rename'
15041 d_rewinddir='$d_rewinddir'
15043 d_safebcpy='$d_safebcpy'
15044 d_safemcpy='$d_safemcpy'
15045 d_sanemcmp='$d_sanemcmp'
15046 d_sched_yield='$d_sched_yield'
15047 d_scm_rights='$d_scm_rights'
15048 d_seekdir='$d_seekdir'
15049 d_select='$d_select'
15051 d_semctl='$d_semctl'
15052 d_semctl_semid_ds='$d_semctl_semid_ds'
15053 d_semctl_semun='$d_semctl_semun'
15054 d_semget='$d_semget'
15056 d_setegid='$d_setegid'
15057 d_seteuid='$d_seteuid'
15058 d_setgrent='$d_setgrent'
15059 d_setgrps='$d_setgrps'
15060 d_sethent='$d_sethent'
15061 d_setlinebuf='$d_setlinebuf'
15062 d_setlocale='$d_setlocale'
15063 d_setnent='$d_setnent'
15064 d_setpent='$d_setpent'
15065 d_setpgid='$d_setpgid'
15066 d_setpgrp2='$d_setpgrp2'
15067 d_setpgrp='$d_setpgrp'
15068 d_setprior='$d_setprior'
15069 d_setpwent='$d_setpwent'
15070 d_setregid='$d_setregid'
15071 d_setresgid='$d_setresgid'
15072 d_setresuid='$d_setresuid'
15073 d_setreuid='$d_setreuid'
15074 d_setrgid='$d_setrgid'
15075 d_setruid='$d_setruid'
15076 d_setsent='$d_setsent'
15077 d_setsid='$d_setsid'
15078 d_setspent='$d_setspent'
15079 d_setvbuf='$d_setvbuf'
15083 d_shmatprototype='$d_shmatprototype'
15084 d_shmctl='$d_shmctl'
15086 d_shmget='$d_shmget'
15087 d_sigaction='$d_sigaction'
15088 d_sigsetjmp='$d_sigsetjmp'
15089 d_socket='$d_socket'
15090 d_socklen_t='$d_socklen_t'
15091 d_sockpair='$d_sockpair'
15093 d_statblks='$d_statblks'
15094 d_statfs_f_flags='$d_statfs_f_flags'
15095 d_statfs_s='$d_statfs_s'
15096 d_statvfs='$d_statvfs'
15097 d_stdio_cnt_lval='$d_stdio_cnt_lval'
15098 d_stdio_ptr_lval='$d_stdio_ptr_lval'
15099 d_stdio_stream_array='$d_stdio_stream_array'
15100 d_stdiobase='$d_stdiobase'
15101 d_stdstdio='$d_stdstdio'
15102 d_strchr='$d_strchr'
15103 d_strcoll='$d_strcoll'
15104 d_strctcpy='$d_strctcpy'
15105 d_strerrm='$d_strerrm'
15106 d_strerror='$d_strerror'
15107 d_strtod='$d_strtod'
15108 d_strtol='$d_strtol'
15109 d_strtold='$d_strtold'
15110 d_strtoll='$d_strtoll'
15111 d_strtoul='$d_strtoul'
15112 d_strtoull='$d_strtoull'
15113 d_strtouq='$d_strtouq'
15114 d_strxfrm='$d_strxfrm'
15115 d_suidsafe='$d_suidsafe'
15116 d_symlink='$d_symlink'
15117 d_syscall='$d_syscall'
15118 d_sysconf='$d_sysconf'
15119 d_sysernlst='$d_sysernlst'
15120 d_syserrlst='$d_syserrlst'
15121 d_system='$d_system'
15122 d_tcgetpgrp='$d_tcgetpgrp'
15123 d_tcsetpgrp='$d_tcsetpgrp'
15124 d_telldir='$d_telldir'
15125 d_telldirproto='$d_telldirproto'
15128 d_truncate='$d_truncate'
15129 d_tzname='$d_tzname'
15132 d_union_semun='$d_union_semun'
15134 d_vendorbin='$d_vendorbin'
15135 d_vendorlib='$d_vendorlib'
15137 d_void_closedir='$d_void_closedir'
15138 d_voidsig='$d_voidsig'
15139 d_voidtty='$d_voidtty'
15140 d_volatile='$d_volatile'
15141 d_vprintf='$d_vprintf'
15143 d_waitpid='$d_waitpid'
15144 d_wcstombs='$d_wcstombs'
15145 d_wctomb='$d_wctomb'
15148 db_hashtype='$db_hashtype'
15149 db_prefixtype='$db_prefixtype'
15150 defvoidused='$defvoidused'
15151 direntrytype='$direntrytype'
15154 doublesize='$doublesize'
15156 dynamic_ext='$dynamic_ext'
15162 eunicefix='$eunicefix'
15165 extensions='$extensions'
15166 fflushNULL='$fflushNULL'
15167 fflushall='$fflushall'
15169 firstmakefile='$firstmakefile'
15171 fpossize='$fpossize'
15172 fpostype='$fpostype'
15173 freetype='$freetype'
15175 full_csh='$full_csh'
15176 full_sed='$full_sed'
15177 gccversion='$gccversion'
15178 gidformat='$gidformat'
15184 groupcat='$groupcat'
15185 groupstype='$groupstype'
15188 h_sysfile='$h_sysfile'
15200 i_arpainet='$i_arpainet'
15201 i_bsdioctl='$i_bsdioctl'
15204 i_dirent='$i_dirent'
15212 i_inttypes='$i_inttypes'
15213 i_limits='$i_limits'
15214 i_locale='$i_locale'
15215 i_machcthr='$i_machcthr'
15216 i_malloc='$i_malloc'
15218 i_memory='$i_memory'
15219 i_mntent='$i_mntent'
15222 i_neterrno='$i_neterrno'
15223 i_netinettcp='$i_netinettcp'
15226 i_pthread='$i_pthread'
15228 i_rpcsvcdbm='$i_rpcsvcdbm'
15231 i_shadow='$i_shadow'
15233 i_stdarg='$i_stdarg'
15234 i_stddef='$i_stddef'
15235 i_stdlib='$i_stdlib'
15236 i_string='$i_string'
15237 i_sysaccess='$i_sysaccess'
15238 i_sysdir='$i_sysdir'
15239 i_sysfile='$i_sysfile'
15240 i_sysfilio='$i_sysfilio'
15242 i_sysioctl='$i_sysioctl'
15243 i_syslog='$i_syslog'
15244 i_sysmman='$i_sysmman'
15245 i_sysmode='$i_sysmode'
15246 i_sysmount='$i_sysmount'
15247 i_sysndir='$i_sysndir'
15248 i_sysparam='$i_sysparam'
15249 i_sysresrc='$i_sysresrc'
15250 i_syssecrt='$i_syssecrt'
15251 i_sysselct='$i_sysselct'
15252 i_syssockio='$i_syssockio'
15253 i_sysstat='$i_sysstat'
15254 i_sysstatfs='$i_sysstatfs'
15255 i_sysstatvfs='$i_sysstatvfs'
15256 i_systime='$i_systime'
15257 i_systimek='$i_systimek'
15258 i_systimes='$i_systimes'
15259 i_systypes='$i_systypes'
15260 i_sysuio='$i_sysuio'
15262 i_sysutsname='$i_sysutsname'
15263 i_sysvfs='$i_sysvfs'
15264 i_syswait='$i_syswait'
15265 i_termio='$i_termio'
15266 i_termios='$i_termios'
15268 i_unistd='$i_unistd'
15271 i_values='$i_values'
15272 i_varargs='$i_varargs'
15273 i_varhdr='$i_varhdr'
15275 ignore_versioned_solibs='$ignore_versioned_solibs'
15276 inc_version_list='$inc_version_list'
15277 inc_version_list_init='$inc_version_list_init'
15280 installarchlib='$installarchlib'
15281 installbin='$installbin'
15282 installman1dir='$installman1dir'
15283 installman3dir='$installman3dir'
15284 installprefix='$installprefix'
15285 installprefixexp='$installprefixexp'
15286 installprivlib='$installprivlib'
15287 installscript='$installscript'
15288 installsitearch='$installsitearch'
15289 installsitebin='$installsitebin'
15290 installsitelib='$installsitelib'
15291 installstyle='$installstyle'
15292 installusrbinperl='$installusrbinperl'
15293 installvendorbin='$installvendorbin'
15294 installvendorlib='$installvendorlib'
15296 ivdformat='$ivdformat'
15299 known_extensions='$known_extensions'
15303 lddlflags='$lddlflags'
15305 ldlibpthname='$ldlibpthname'
15312 libsdirs='$libsdirs'
15313 libsfiles='$libsfiles'
15314 libsfound='$libsfound'
15315 libspath='$libspath'
15316 libswanted='$libswanted'
15322 locincpth='$locincpth'
15323 loclibpth='$loclibpth'
15324 longdblsize='$longdblsize'
15325 longlongsize='$longlongsize'
15326 longsize='$longsize'
15330 lseeksize='$lseeksize'
15331 lseektype='$lseektype'
15335 make_set_make='$make_set_make'
15336 mallocobj='$mallocobj'
15337 mallocsrc='$mallocsrc'
15338 malloctype='$malloctype'
15340 man1direxp='$man1direxp'
15343 man3direxp='$man3direxp'
15346 mips_type='$mips_type'
15348 mmaptype='$mmaptype'
15350 modetype='$modetype'
15352 multiarch='$multiarch'
15354 myarchname='$myarchname'
15355 mydomain='$mydomain'
15356 myhostname='$myhostname'
15359 netdb_hlen_type='$netdb_hlen_type'
15360 netdb_host_type='$netdb_host_type'
15361 netdb_name_type='$netdb_name_type'
15362 netdb_net_type='$netdb_net_type'
15365 nm_so_opt='$nm_so_opt'
15366 nonxs_ext='$nonxs_ext'
15370 o_nonblock='$o_nonblock'
15372 old_pthread_create_joinable='$old_pthread_create_joinable'
15373 optimize='$optimize'
15374 orderlib='$orderlib'
15380 patchlevel='$patchlevel'
15381 path_sep='$path_sep'
15384 perladmin='$perladmin'
15385 perlpath='$perlpath'
15387 phostname='$phostname'
15390 pm_apiversion='$pm_apiversion'
15394 prefixexp='$prefixexp'
15396 privlibexp='$privlibexp'
15397 prototype='$prototype'
15399 quadkind='$quadkind'
15400 quadtype='$quadtype'
15401 randbits='$randbits'
15402 randfunc='$randfunc'
15403 randseedtype='$randseedtype'
15405 rd_nodata='$rd_nodata'
15406 revision='$revision'
15410 sPRIEldbl='$sPRIEldbl'
15411 sPRIFldbl='$sPRIFldbl'
15412 sPRIGldbl='$sPRIGldbl'
15415 sPRIeldbl='$sPRIeldbl'
15416 sPRIfldbl='$sPRIfldbl'
15417 sPRIgldbl='$sPRIgldbl'
15422 sched_yield='$sched_yield'
15423 scriptdir='$scriptdir'
15424 scriptdirexp='$scriptdirexp'
15426 seedfunc='$seedfunc'
15427 selectminbits='$selectminbits'
15428 selecttype='$selecttype'
15429 sendmail='$sendmail'
15432 sharpbang='$sharpbang'
15433 shmattype='$shmattype'
15434 shortsize='$shortsize'
15437 sig_count='$sig_count'
15438 sig_name='$sig_name'
15439 sig_name_init='$sig_name_init'
15441 sig_num_init='$sig_num_init'
15442 signal_t='$signal_t'
15443 sitearch='$sitearch'
15444 sitearchexp='$sitearchexp'
15446 sitebinexp='$sitebinexp'
15448 sitelibexp='$sitelibexp'
15449 siteprefix='$siteprefix'
15450 siteprefixexp='$siteprefixexp'
15451 sizetype='$sizetype'
15456 sockethdr='$sockethdr'
15457 socketlib='$socketlib'
15458 socksizetype='$socksizetype'
15460 spackage='$spackage'
15461 spitshell='$spitshell'
15464 ssizetype='$ssizetype'
15465 startperl='$startperl'
15467 static_ext='$static_ext'
15469 stdio_base='$stdio_base'
15470 stdio_bufsiz='$stdio_bufsiz'
15471 stdio_cnt='$stdio_cnt'
15472 stdio_filbuf='$stdio_filbuf'
15473 stdio_ptr='$stdio_ptr'
15474 stdio_stream_array='$stdio_stream_array'
15477 subversion='$subversion'
15484 timeincl='$timeincl'
15485 timetype='$timetype'
15498 uidformat='$uidformat'
15504 uquadtype='$uquadtype'
15505 use5005threads='$use5005threads'
15506 use64bitall='$use64bitall'
15507 use64bitint='$use64bitint'
15509 useithreads='$useithreads'
15510 uselargefiles='$uselargefiles'
15511 uselongdouble='$uselongdouble'
15512 usemorebits='$usemorebits'
15513 usemultiplicity='$usemultiplicity'
15514 usemymalloc='$usemymalloc'
15516 useopcode='$useopcode'
15517 useperlio='$useperlio'
15518 useposix='$useposix'
15520 useshrplib='$useshrplib'
15521 usesocks='$usesocks'
15522 usethreads='$usethreads'
15523 usevendorprefix='$usevendorprefix'
15524 usevfork='$usevfork'
15527 uvoformat='$uvoformat'
15530 uvuformat='$uvuformat'
15531 uvxformat='$uvxformat'
15532 vendorbin='$vendorbin'
15533 vendorbinexp='$vendorbinexp'
15534 vendorlib='$vendorlib'
15535 vendorlibexp='$vendorlibexp'
15536 vendorprefix='$vendorprefix'
15537 vendorprefixexp='$vendorprefixexp'
15540 voidflags='$voidflags'
15542 xs_apiversion='$xs_apiversion'
15547 : Add in command line options if available
15548 $test -f UU/cmdline.opt && $cat UU/cmdline.opt >> config.sh
15550 : add special variables
15551 $test -f $src/patchlevel.h && \
15552 awk '/^#define[ ]+PERL_/ {printf "%s=%s\n",$2,$3}' $src/patchlevel.h >>config.sh
15553 echo "CONFIGDOTSH=true" >>config.sh
15555 : propagate old symbols
15556 if $test -f UU/config.sh; then
15557 <UU/config.sh sort | uniq >UU/oldconfig.sh
15558 sed -n 's/^\([a-zA-Z_0-9]*\)=.*/\1/p' config.sh config.sh UU/oldconfig.sh |\
15559 sort | uniq -u >UU/oldsyms
15560 set X `cat UU/oldsyms`
15566 Hmm...You had some extra variables I don't know about...I'll try to keep 'em...
15568 echo "# Variables propagated from previous config.sh file." >>config.sh
15569 for sym in `cat UU/oldsyms`; do
15570 echo " Propagating $hint variable "'$'"$sym..."
15571 eval 'tmp="$'"${sym}"'"'
15573 sed -e "s/'/'\"'\"'/g" -e "s/^/$sym='/" -e "s/$/'/" >>config.sh
15579 : Finish up by extracting the .SH files
15593 If you'd like to make any changes to the config.sh file before I begin
15594 to configure things, do it as a shell escape now (e.g. !vi config.sh).
15597 rp="Press return or use a shell escape to edit config.sh:"
15602 *) : in case they cannot read
15603 sh 1>&4 -c "$ans";;
15608 : if this fails, just run all the .SH files by hand
15615 if $contains '^depend:' [Mm]akefile >/dev/null 2>&1; then
15622 Now you need to generate make dependencies by running "$make depend".
15623 You might prefer to run it in background: "$make depend > makedepend.out &"
15624 It can take a while, so you might not want to run it right now.
15629 rp="Run $make depend now?"
15633 $make depend && echo "Now you must run a $make."
15636 echo "You must run '$make depend' then '$make'."
15639 elif test -f [Mm]akefile; then
15641 echo "Now you must run a $make."
15646 if $test -f Policy.sh; then
15649 If you compile $package on a different machine or from a different object
15650 directory, copy the Policy.sh file from this object directory to the
15651 new one before you run Configure -- this will help you with most of
15652 the policy defaults.
15656 if $test -f config.msg; then
15657 echo "Hmm. I also noted the following information while running:"
15659 $cat config.msg >&4
15662 $rm -f kit*isdone ark*isdone