3 # If these # comments don't work, trim them. Don't worry about any other
4 # shell scripts, Configure will trim # comments from them for you.
6 # (If you are trying to port this package to a machine without sh,
7 # I would suggest you have a look at the prototypical config_h.SH file
8 # and edit it to reflect your system. Some packages may include samples
9 # of config.h for certain machines, so you might look for one of those.)
11 # Yes, you may rip this off to use in other distribution packages. This
12 # script belongs to the public domain and cannot be copyrighted.
14 # (Note: this Configure script was generated automatically. Rather than
15 # working with this copy of Configure, you may wish to get metaconfig.
16 # The dist-3.0 package (which contains metaconfig) was posted in
17 # comp.sources.misc and is available on CPAN under authors/id/RAM so
18 # you may fetch it yourself from your nearest archive site.)
21 # $Id: Head.U,v 3.0.1.9 1997/02/28 15:02:09 ram Exp $
23 # Generated on Fri Feb 25 07:45:17 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
453 d_old_pthread_create_joinable=''
454 old_pthread_create_joinable=''
693 inc_version_list_init=''
711 ignore_versioned_solibs=''
875 d_stdio_stream_array=''
876 stdio_stream_array=''
922 smallmach='pdp11 i8086 z8000 i80286 iAPX286'
925 : We must find out about Eunice early
927 if test -f /etc/unixtovms; then
928 eunicefix=/etc/unixtovms
930 if test -f /etc/unixtovms.exe; then
931 eunicefix=/etc/unixtovms.exe
935 : set useposix=false in your hint file to disable the POSIX extension.
937 : set useopcode=false in your hint file to disable the Opcode extension.
939 : Trailing extension. Override this in a hint file, if needed.
941 : Extra object files, if any, needed on this platform.
943 : Possible local include directories to search.
944 : Set locincpth to "" in a hint file to defeat local include searches.
945 locincpth="/usr/local/include /opt/local/include /usr/gnu/include"
946 locincpth="$locincpth /opt/gnu/include /usr/GNU/include /opt/GNU/include"
948 : no include file wanted by default
952 : change the next line if compiling for Xenix/286 on Xenix/386
953 xlibpth='/usr/lib/386 /lib/386'
954 : Possible local library directories to search.
955 loclibpth="/usr/local/lib /opt/local/lib /usr/gnu/lib"
956 loclibpth="$loclibpth /opt/gnu/lib /usr/GNU/lib /opt/GNU/lib"
958 : general looking path for locating libraries
959 glibpth="/usr/lib/large /lib /usr/lib $xlibpth"
960 glibpth="$glibpth /lib/large /usr/lib/small /lib/small"
961 glibpth="$glibpth /usr/ccs/lib /usr/ucblib /usr/local/lib"
962 test -f /usr/shlib/libc.so && glibpth="/usr/shlib $glibpth"
963 test -f /shlib/libc.so && glibpth="/shlib $glibpth"
965 : Private path used by Configure to find libraries. Its value
966 : is prepended to libpth. This variable takes care of special
967 : machines, like the mips. Usually, it should be empty.
970 : default library list
972 : some systems want to use only the non-versioned libso:s
973 ignore_versioned_solibs=''
974 : set usemultiplicity on the Configure command line to enable multiplicity.
975 : set usesocks on the Configure command line to enable socks.
976 : set usethreads on the Configure command line to enable threads.
977 : full support for void wanted by default
980 : List of libraries we want.
981 : If anyone needs -lnet, put it in a hint file.
982 libswanted='sfio socket inet nsl nm ndbm gdbm dbm db malloc dl'
983 libswanted="$libswanted dld ld sun m c cposix posix"
984 libswanted="$libswanted ndir dir crypt sec"
985 libswanted="$libswanted ucb bsd BSD PW x"
986 : We probably want to search /usr/shlib before most other libraries.
987 : This is only used by the lib/ExtUtils/MakeMaker.pm routine extliblist.
988 glibpth=`echo " $glibpth " | sed -e 's! /usr/shlib ! !'`
989 glibpth="/usr/shlib $glibpth"
990 : Do not use vfork unless overridden by a hint file.
993 : Find the basic shell for Bourne shell scripts
997 *bsd*|sys5*) xxx="/$SYSTYPE/bin/sh";;
1000 if test -f "$xxx"; then
1003 : Build up a list and do a single loop so we can 'break' out.
1004 pth=`echo $PATH | sed -e "s/$p_/ /g"`
1005 for xxx in sh bash ksh pdksh ash; do
1007 try="$try ${p}/${xxx}"
1011 if test -f "$xxx"; then
1014 elif test -f "$xxx.exe"; then
1025 $me: Fatal Error: I can't find a Bourne Shell anywhere.
1027 Usually it's in /bin/sh. How did you even get this far?
1028 Please contact me (Perl Maintainers) at perlbug@perl.com and
1029 we'll try to straighten this all out.
1035 : see if sh knows # comments
1036 if `$sh -c '#' >/dev/null 2>&1`; then
1040 test -f $xcat || xcat=/usr/bin/cat
1045 if test -s today; then
1048 echo "#! $xcat" > try
1052 if test -s today; then
1060 echo "Your $sh doesn't grok # comments--I will strip them later on."
1063 echo "exec grep -v '^[ ]*#'" >spitshell
1065 $eunicefix spitshell
1066 spitshell=`pwd`/spitshell
1068 echo "I presume that if # doesn't work, #! won't work either!"
1073 : figure out how to guarantee sh startup
1075 '') startsh=${sharpbang}${sh} ;;
1087 : echo "Yup, it does."
1089 echo "Hmm... '$startsh' does not guarantee sh startup..."
1090 echo "You may have to fix up the shell scripts to make sure $sh runs them."
1095 : Save command line options in file UU/cmdline.opt for later use in
1096 : generating config.sh.
1097 cat > cmdline.opt <<EOSH
1098 # Configure command line arguments.
1105 cat >>cmdline.opt <<EOSH
1106 config_arg$argn='$arg'
1108 argn=`expr $argn + 1`
1111 : produce awk script to parse command line options
1112 cat >options.awk <<'EOF'
1114 optstr = "A:dD:eEf:hKOrsSU:V"; # getopt-style specification
1116 len = length(optstr);
1117 for (i = 1; i <= len; i++) {
1118 c = substr(optstr, i, 1);
1119 if (i < len) a = substr(optstr, i + 1, 1); else a = "";
1130 if (substr(str, 1, 1) != "-") {
1131 printf("'%s'\n", str);
1135 for (i = 2; i <= len; i++) {
1136 c = substr(str, i, 1);
1138 printf("-%s\n", substr(str, i));
1144 printf("'%s'\n", substr(str, i + 1));
1157 : process the command line options
1158 set X `for arg in "$@"; do echo "X$arg"; done |
1159 sed -e s/X// | awk -f options.awk`
1164 : set up default values
1174 rm -f optdef.sh posthint.sh
1175 cat >optdef.sh <<EOS
1181 while test $# -gt 0; do
1183 -d) shift; fastread=yes;;
1184 -e) shift; alldone=cont;;
1188 if test -r "$1"; then
1191 echo "$me: cannot read config file $1." >&2
1196 -h) shift; error=true;;
1197 -r) shift; reuseval=true;;
1198 -s) shift; silent=true; realsilent=true;;
1199 -E) shift; alldone=exit;;
1200 -K) shift; knowitall=true;;
1201 -O) shift; override=true;;
1202 -S) shift; silent=true; extractsh=true;;
1207 echo "$me: use '-U symbol=', not '-D symbol='." >&2
1208 echo "$me: ignoring -D $1" >&2
1211 sed -e "s/'/'\"'\"'/g" -e "s/=\(.*\)/='\1'/" >> optdef.sh;;
1212 *) echo "$1='define'" >> optdef.sh;;
1219 *=) echo "$1" >> optdef.sh;;
1221 echo "$me: use '-D symbol=val', not '-U symbol=val'." >&2
1222 echo "$me: ignoring -U $1" >&2
1224 *) echo "$1='undef'" >> optdef.sh;;
1235 *=*) zzz=`echo $yyy|sed 's!=.*!!'`
1239 zzz=" "`echo $yyy|sed 's!^[^=]*=!!'`
1240 yyy=`echo $yyy|sed 's!=.*!!'` ;;
1246 *:*) xxx=`echo $yyy|sed 's!:.*!!'`
1247 yyy=`echo $yyy|sed 's!^[^:]*:!!'`
1248 zzz=`echo $yyy|sed 's!^[^=]*=!!'`
1249 yyy=`echo $yyy|sed 's!=.*!!'` ;;
1250 *) xxx=`echo $yyy|sed 's!:.*!!'`
1251 yyy=`echo $yyy|sed 's!^[^:]*:!!'` ;;
1257 echo "$yyy=\"\${$yyy}$zzz\"" >> posthint.sh ;;
1259 echo "$yyy=''" >> posthint.sh ;;
1264 echo "$yyy='$zzz'" >> posthint.sh ;;
1266 echo "eval \"$yyy=$zzz\"" >> posthint.sh ;;
1268 echo "$yyy=\"$zzz\${$yyy}\"" >> posthint.sh ;;
1273 echo "$yyy=$zzz" >> posthint.sh ;;
1274 *) echo "$me: unknown -A command '$xxx', ignoring -A $1" >&2 ;;
1278 -V) echo "$me generated by metaconfig 3.0 PL70." >&2
1281 -*) echo "$me: unknown option $1" >&2; shift; error=true;;
1289 Usage: $me [-dehrsEKOSV] [-f config.sh] [-D symbol] [-D symbol=value]
1290 [-U symbol] [-U symbol=] [-A command:symbol...]
1291 -d : use defaults for all answers.
1292 -e : go on without questioning past the production of config.sh.
1293 -f : specify an alternate default configuration file.
1294 -h : print this help message and exit (with an error status).
1295 -r : reuse C symbols value if possible (skips costly nm extraction).
1296 -s : silent mode, only echoes questions and essential information.
1297 -D : define symbol to have some value:
1298 -D symbol symbol gets the value 'define'
1299 -D symbol=value symbol gets the value 'value'
1300 -E : stop at the end of questions, after having produced config.sh.
1301 -K : do not use unless you know what you are doing.
1302 -O : let -D and -U override definitions from loaded configuration file.
1303 -S : perform variable substitutions on all .SH files (can mix with -f)
1304 -U : undefine symbol:
1305 -U symbol symbol gets the value 'undef'
1306 -U symbol= symbol gets completely empty
1307 -A : manipulate symbol after the platform specific hints have been applied:
1308 -A symbol=value append " "value to symbol
1309 -A append:symbol=value append value to symbol
1310 -A define:symbol=value define symbol to have value
1311 -A clear:symbol define symbol to be ''
1312 -A define:symbol define symbol to be 'define'
1313 -A eval:symbol=value define symbol to be eval of value
1314 -A prepend:symbol=value prepend value to symbol
1315 -A undef:symbol define symbol to be 'undef'
1316 -A undef:symbol= define symbol to be ''
1317 -V : print version number and exit (with a zero status).
1324 case "$fastread$alldone" in
1327 if test ! -t 0; then
1328 echo "Say 'sh Configure', not 'sh <Configure'"
1336 true) exec 1>/dev/null;;
1339 : run the defines and the undefines, if any, but leave the file out there...
1342 : create the posthint manipulation script and leave the file out there...
1347 first=`echo $package | sed -e 's/^\(.\).*/\1/'`
1348 last=`echo $package | sed -e 's/^.\(.*\)/\1/'`
1349 case "`echo AbyZ | tr '[:lower:]' '[:upper:]' 2>/dev/null`" in
1350 ABYZ) spackage=`echo $first | tr '[:lower:]' '[:upper:]'`$last;;
1351 *) spackage=`echo $first | tr '[a-z]' '[A-Z]'`$last;;
1354 : Some greps do not return status, grrr.
1355 echo "grimblepritz" >grimble
1356 if grep blurfldyick grimble >/dev/null 2>&1 ; then
1358 elif grep grimblepritz grimble >/dev/null 2>&1 ; then
1364 : the following should work in any shell
1368 echo "AGH! Grep doesn't return a status. Attempting remedial action."
1369 cat >contains <<'EOSS'
1370 grep "$1" "$2" >.greptmp && cat .greptmp && test -s .greptmp
1375 : Find the path to the source tree
1378 */*) src=`echo $0 | sed -e 's%/[^/][^/]*$%%'`
1381 *) src=`cd ../$src && pwd` ;;
1394 if test -f $rsrc/Configure && \
1395 $contains "^package=$package$" $rsrc/Configure >/dev/null 2>&1
1397 : found it, so we are ok.
1400 for src in . .. ../.. ../../.. ../../../..; do
1401 if test -f ../$src/Configure && \
1402 $contains "^package=$package$" ../$src/Configure >/dev/null 2>&1
1413 Sorry, I can't seem to locate the source dir for $package. Please start
1414 Configure with an explicit path -- i.e. /some/path/Configure.
1422 echo "Sources for $package found in \"$src\"." >&4
1426 : script used to extract .SH files with variable substitutions
1427 cat >extract <<'EOS'
1429 echo "Doing variable substitutions on .SH files..."
1430 if test -f $src/MANIFEST; then
1431 set x `awk '{print $1}' <$src/MANIFEST | grep '\.SH$'`
1433 echo "(Looking for .SH files under the source directory.)"
1434 set x `(cd $src; find . -name "*.SH" -print)`
1438 0) set x `(cd $src; echo *.SH)`; shift;;
1440 if test ! -f $src/$1; then
1446 while test $name; do
1447 if test ! -d "$name"; then
1448 create="$name $create";
1449 name=`echo $name | sed -e "s|^[^/]*$||"`;
1450 name=`echo $name | sed -e "s|\(.*\)/.*|\1|"`;
1455 for file in $create; do
1464 dir=`expr X$file : 'X\(.*\)/'`
1465 file=`expr X$file : 'X.*/\(.*\)'`
1466 (cd $dir && . ./$file)
1476 dir=`expr X$file : 'X\(.*\)/'`
1477 file=`expr X$file : 'X.*/\(.*\)'`
1478 (set x $dir; shift; eval $mkdir_p)
1488 if test -f $src/config_h.SH; then
1489 if test ! -f config.h; then
1490 : oops, they left it out of MANIFEST, probably, so do it anyway.
1496 : extract files and exit if asked to do so
1497 case "$extractsh" in
1499 case "$realsilent" in
1503 case "$config_sh" in
1504 '') config_sh='config.sh';;
1507 echo "Fetching answers from $config_sh..."
1510 test "$override" && . ./optdef.sh
1519 : Eunice requires " " instead of "", can you believe it
1522 echo "Beginning of configuration questions for $package."
1524 trap 'echo " "; test -d ../UU && rm -rf X $rmlist; exit 1' 1 2 3 15
1526 : first determine how to suppress newline on echo command
1528 echo "Checking echo to see how to suppress newlines..."
1529 (echo "hi there\c" ; echo " ") >.echotmp
1530 if $contains c .echotmp >/dev/null 2>&1 ; then
1541 echo $n "The star should be here-->$c"
1545 : Now test for existence of everything in MANIFEST
1547 if test -f $rsrc/MANIFEST; then
1548 echo "First let's make sure your kit is complete. Checking..." >&4
1549 awk '$1 !~ /PACK[A-Z]+/ {print $1}' $rsrc/MANIFEST | split -50
1552 for filelist in x??; do
1553 (cd $rsrc; ls `cat $tmppwd/$filelist` >/dev/null 2>>$tmppwd/missing)
1555 if test -s missing; then
1559 THIS PACKAGE SEEMS TO BE INCOMPLETE.
1561 You have the option of continuing the configuration process, despite the
1562 distinct possibility that your kit is damaged, by typing 'y'es. If you
1563 do, don't blame me if something goes wrong. I advise you to type 'n'o
1564 and contact the author (perlbug@perl.com).
1567 echo $n "Continue? [n] $c" >&4
1571 echo "Continuing..." >&4
1575 echo "ABORTING..." >&4
1580 echo "Looks good..."
1583 echo "There is no MANIFEST file. I hope your kit is complete !"
1588 : Find the appropriate value for a newline for tr
1589 if test -n "$DJGPP"; then
1592 if test X"$trnl" = X; then
1593 case "`echo foo|tr '\n' x 2>/dev/null`" in
1597 if test X"$trnl" = X; then
1598 case "`echo foo|tr '\012' x 2>/dev/null`" in
1599 foox) trnl='\012' ;;
1602 if test X"$trnl" = X; then
1605 $me: Fatal Error: cannot figure out how to translate newlines with 'tr'.
1611 : compute the number of columns on the terminal for proper question formatting
1616 : set up the echo used in my read
1617 myecho="case \"\$xxxm\" in
1618 '') echo $n \"\$rp $c\" >&4;;
1620 '') echo $n \"[\$xxxm] $c\";;
1622 if test \`echo \"\$rp [\$xxxm] \" | wc -c\` -ge $COLUMNS; then
1624 echo $n \"[\$xxxm] $c\" >&4
1626 echo $n \"\$rp [\$xxxm] $c\" >&4
1632 : now set up to do reads with possible shell escape and default assignment
1638 case "\$fastread" in
1639 yes) case "\$dflt" in
1642 case "\$silent-\$rp" in
1647 *) case "\$silent" in
1648 true) case "\$rp" in
1653 while expr "X\$ans" : "X!" >/dev/null; do
1657 aok=''; eval "ans=\\"\$answ\\"" && aok=y
1665 set x \`expr "X\$ans" : "X!\(.*\)\$"\`
1674 set x \`expr "X\$ans" : "X&\(.*\)\$"\`
1679 echo "(OK, I'll run with -d after this question.)" >&4
1682 echo "*** Sorry, \$1 not supported yet." >&4
1692 echo "*** Substitution done -- please confirm."
1694 ans=\`echo $n "\$ans$c" | tr '$trnl' ' '\`
1699 echo "*** Error -- try again."
1706 case "\$ans\$xxxm\$nostick" in
1718 : create .config dir to save info across Configure sessions
1719 test -d ../.config || mkdir ../.config
1720 cat >../.config/README <<EOF
1721 This directory created by Configure to save information that should
1722 persist across sessions for $package.
1724 You may safely delete it if you wish.
1727 : general instructions
1730 user=`(logname) 2>/dev/null`
1732 '') user=`whoami 2>&1`;;
1734 if $contains "^$user\$" ../.config/instruct >/dev/null 2>&1; then
1737 rp='Would you like to see the instructions?'
1748 This installation shell script will examine your system and ask you questions
1749 to determine how the perl5 package should be installed. If you get
1750 stuck on a question, you may use a ! shell escape to start a subshell or
1751 execute a command. Many of the questions will have default answers in square
1752 brackets; typing carriage return will give you the default.
1754 On some of the questions which ask for file or directory names you are allowed
1755 to use the ~name construct to specify the login directory belonging to "name",
1756 even if you don't have a shell which knows about that. Questions where this is
1757 allowed will be marked "(~name ok)".
1761 dflt='Type carriage return to continue'
1765 The prompter used in this script allows you to use shell variables and
1766 backticks in your answers. You may use $1, $2, etc... to refer to the words
1767 in the default answer, as if the default line was a set of arguments given to a
1768 script shell. This means you may also use $* to repeat the whole default line,
1769 so you do not have to re-type everything to add something to the default.
1771 Everytime there is a substitution, you will have to confirm. If there is an
1772 error (e.g. an unmatched backtick), the default answer will remain unchanged
1773 and you will be prompted again.
1775 If you are in a hurry, you may run 'Configure -d'. This will bypass nearly all
1776 the questions and use the computed defaults (or the previous answers if there
1777 was already a config.sh file). Type 'Configure -h' for a list of options.
1778 You may also start interactively and then answer '& -d' at any prompt to turn
1779 on the non-interactive behaviour for the remainder of the execution.
1785 Much effort has been expended to ensure that this shell script will run on any
1786 Unix system. If despite that it blows up on yours, your best bet is to edit
1787 Configure and run it again. If you can't run Configure for some reason,
1788 you'll have to generate a config.sh file by hand. Whatever problems you
1789 have, let me (perlbug@perl.com) know how I blew it.
1791 This installation script affects things in two ways:
1793 1) it may do direct variable substitutions on some of the files included
1795 2) it builds a config.h file for inclusion in C programs. You may edit
1796 any of these files as the need arises after running this script.
1798 If you make a mistake on a question, there is no easy way to back up to it
1799 currently. The easiest thing to do is to edit config.sh and rerun all the SH
1800 files. Configure will offer to let you do this before it runs the SH files.
1803 dflt='Type carriage return to continue'
1805 case "$firsttime" in
1806 true) echo $user >>../.config/instruct;;
1810 : find out where common programs are
1812 echo "Locating common programs..." >&4
1825 if test -d \$dir/\$thing; then
1831 for thisthing in \$dir/\$thing; do
1832 : just loop through to pick last item
1834 if test -f \$thisthing; then
1837 elif test -f \$dir/\$thing.exe; then
1838 if test -n "$DJGPP"; then
1839 echo \$dir/\$thing.exe
1841 : on Eunice apparently
1891 pth=`echo $PATH | sed -e "s/$p_/ /g"`
1892 pth="$pth /lib /usr/lib"
1893 for file in $loclist; do
1897 if test -f "$xxx"; then
1900 echo "WARNING: no $xxx -- ignoring your setting for $file." >&4
1901 xxx=`./loc $file $file $pth`
1904 '') xxx=`./loc $file $file $pth`;;
1905 *) xxx=`./loc $xxx $xxx $pth`;;
1911 echo $file is in $xxx.
1914 echo $file is in $xxx.
1917 echo "I don't know where '$file' is, and my life depends on it." >&4
1918 echo "Go find a public domain implementation or fix your PATH setting!" >&4
1924 echo "Don't worry if any of the following aren't found..."
1926 for file in $trylist; do
1930 if test -f "$xxx"; then
1933 echo "WARNING: no $xxx -- ignoring your setting for $file." >&4
1934 xxx=`./loc $file $file $pth`
1937 '') xxx=`./loc $file $file $pth`;;
1938 *) xxx=`./loc $xxx $xxx $pth`;;
1944 echo $file is in $xxx.
1947 echo $file is in $xxx.
1950 echo "I don't see $file out there, $say."
1957 echo "Substituting grep for egrep."
1963 echo "Substituting cp for ln."
1969 echo "Hopefully test is built into your sh."
1972 if `sh -c "PATH= test true" >/dev/null 2>&1`; then
1973 echo "Using the test built into your sh."
1981 echo "Hopefully echo is built into your sh."
1986 echo "Checking compatibility between $echo and builtin echo (if any)..." >&4
1987 $echo $n "hi there$c" >foo1
1988 echo $n "hi there$c" >foo2
1989 if cmp foo1 foo2 >/dev/null 2>&1; then
1990 echo "They are compatible. In fact, they may be identical."
1997 They are not compatible! You are probably running ksh on a non-USG system.
1998 I'll have to use $echo instead of the builtin, since Bourne shell doesn't
1999 have echo built in and we may have to run some Bourne shell scripts. That
2000 means I'll have to use '$n$c' to suppress newlines now. Life is ridiculous.
2003 $echo $n "The star should be here-->$c"
2010 : determine whether symbolic links are supported
2013 if $ln -s blurfl sym > /dev/null 2>&1 ; then
2014 echo "Symbolic links are supported." >&4
2017 echo "Symbolic links are NOT supported." >&4
2022 : see whether [:lower:] and [:upper:] are supported character classes
2024 case "`echo AbyZ | $tr '[:lower:]' '[:upper:]' 2>/dev/null`" in
2026 echo "Good, your tr supports [:lower:] and [:upper:] to convert case." >&4
2030 *) # There is a discontinuity in EBCDIC between 'I' and 'J'
2031 # (0xc9 and 0xd1), therefore that is a nice testing point.
2032 if test "X$up" = X -o "X$low" = X; then
2033 case "`echo IJ | $tr '[I-J]' '[i-j]' 2>/dev/null`" in
2039 if test "X$up" = X -o "X$low" = X; then
2040 case "`echo IJ | $tr I-J i-j 2>/dev/null`" in
2046 if test "X$up" = X -o "X$low" = X; then
2047 case "`echo IJ | od -x 2>/dev/null`" in
2049 echo "Hey, this might be EBCDIC." >&4
2050 if test "X$up" = X -o "X$low" = X; then
2051 case "`echo IJ | $tr '[A-IJ-RS-Z]' '[a-ij-rs-z]' 2>/dev/null`" in
2052 ij) up='[A-IJ-RS-Z]'
2057 if test "X$up" = X -o "X$low" = X; then
2058 case "`echo IJ | $tr A-IJ-RS-Z a-ij-rs-z 2>/dev/null`" in
2068 case "`echo IJ | $tr \"$up\" \"$low\" 2>/dev/null`" in
2070 echo "Using $up and $low to convert case." >&4
2073 echo "I don't know how to translate letters from upper to lower case." >&4
2074 echo "Your tr is not acting any way I know of." >&4
2078 : set up the translation script tr, must be called with ./tr of course
2082 '[A-Z][a-z]') exec $tr '$up' '$low';;
2083 '[a-z][A-Z]') exec $tr '$low' '$up';;
2090 : Try to determine whether config.sh was made on this system
2091 case "$config_sh" in
2093 myuname=`$uname -a 2>/dev/null`
2094 $test -z "$myuname" && myuname=`hostname 2>/dev/null`
2095 # tr '[A-Z]' '[a-z]' would not work in EBCDIC
2096 # because the A-Z/a-z are not consecutive.
2097 myuname=`echo $myuname | $sed -e 's/^[^=]*=//' -e 's/\///g' | \
2098 ./tr '[A-Z]' '[a-z]' | $tr $trnl ' '`
2099 newmyuname="$myuname"
2101 case "$knowitall" in
2103 if test -f ../config.sh; then
2104 if $contains myuname= ../config.sh >/dev/null 2>&1; then
2105 eval "`grep myuname= ../config.sh`"
2107 if test "X$myuname" = "X$newmyuname"; then
2115 : Get old answers from old config file if Configure was run on the
2116 : same system, otherwise use the hints.
2119 if test -f config.sh; then
2121 rp="I see a config.sh file. Shall I use it to set the defaults?"
2124 n*|N*) echo "OK, I'll ignore it."; mv config.sh config.sh.old;;
2125 *) echo "Fetching default answers from your old config.sh file..." >&4
2133 : Older versions did not always set $sh. Catch re-use of such
2142 if test ! -f config.sh; then
2145 First time through, eh? I have some defaults handy for some systems
2146 that need some extra help getting the Configure answers right:
2149 (cd $src/hints; ls -C *.sh) | $sed 's/\.sh/ /g' >&4
2151 : Half the following guesses are probably wrong... If you have better
2152 : tests or hints, please send them to perlbug@perl.com
2153 : The metaconfig authors would also appreciate a copy...
2154 $test -f /irix && osname=irix
2155 $test -f /xenix && osname=sco_xenix
2156 $test -f /dynix && osname=dynix
2157 $test -f /dnix && osname=dnix
2158 $test -f /lynx.os && osname=lynxos
2159 $test -f /unicos && osname=unicos && osvers=`$uname -r`
2160 $test -f /unicosmk && osname=unicosmk && osvers=`$uname -r`
2161 $test -f /unicosmk.ar && osname=unicosmk && osvers=`$uname -r`
2162 $test -f /bin/mips && /bin/mips && osname=mips
2163 $test -d /NextApps && set X `hostinfo | grep 'NeXT Mach.*:' | \
2164 $sed -e 's/://' -e 's/\./_/'` && osname=next && osvers=$4
2165 $test -d /usr/apollo/bin && osname=apollo
2166 $test -f /etc/saf/_sactab && osname=svr4
2167 $test -d /usr/include/minix && osname=minix
2168 if $test -d /MachTen -o -d /MachTen_Folder; then
2170 if $test -x /sbin/version; then
2171 osvers=`/sbin/version | $awk '{print $2}' |
2172 $sed -e 's/[A-Za-z]$//'`
2173 elif $test -x /usr/etc/version; then
2174 osvers=`/usr/etc/version | $awk '{print $2}' |
2175 $sed -e 's/[A-Za-z]$//'`
2181 $test -f /sys/posix.dll &&
2182 $test -f /usr/bin/what &&
2183 set X `/usr/bin/what /sys/posix.dll` &&
2184 $test "$3" = UWIN &&
2188 if $test -f $uname; then
2196 umips) osname=umips ;;
2199 [23]100) osname=mips ;;
2200 next*) osname=next ;;
2202 tmp=`/bin/uname -X 2>/dev/null|awk '/3\.2v[45]/{ print $(NF) }'`
2203 if $test "$tmp" != "" -a "$3" = "3.2" -a -f '/etc/systemid'; then
2206 elif $test -f /etc/kconfig; then
2208 if test "$lns" = "$ln -s"; then
2210 elif $contains _SYSV3 /usr/include/stdio.h > /dev/null 2>&1 ; then
2212 elif $contains _POSIX_SOURCE /usr/include/stdio.h > /dev/null 2>&1 ; then
2219 if test -n "$DJGPP"; then
2228 tmp=`( (oslevel) 2>/dev/null || echo "not found") 2>&1`
2230 'not found') osvers="$4"."$3" ;;
2231 '<3240'|'<>3240') osvers=3.2.0 ;;
2232 '=3240'|'>3240'|'<3250'|'<>3250') osvers=3.2.4 ;;
2233 '=3250'|'>3250') osvers=3.2.5 ;;
2237 bsd386) osname=bsd386
2240 cygwin*) osname=cygwin
2243 *dc.osx) osname=dcosx
2249 domainos) osname=apollo
2255 dynixptx*) osname=dynixptx
2256 osvers=`echo "$4"|sed 's/^v//'`
2258 freebsd) osname=freebsd
2260 genix) osname=genix ;;
2262 osvers=`echo "$3" | $sed 's,.*\.\([0-9]*\.[0-9]*\),\1,'`
2278 netbsd*) osname=netbsd
2281 news-os) osvers="$3"
2283 4*) osname=newsos4 ;;
2287 next*) osname=next ;;
2288 POSIX-BC | posix-bc ) osname=posix-bc
2291 powerux | power_ux | powermax_os | powermaxos | \
2292 powerunix | power_unix) osname=powerux
2298 solaris) osname=solaris
2300 5*) osvers=`echo $3 | $sed 's/^5/2/g'` ;;
2307 osvers=`echo $3 | $sed 's/^5/2/g'` ;;
2311 titanos) osname=titanos
2320 ultrix) osname=ultrix
2323 osf1|mls+) case "$5" in
2326 osvers=`echo "$3" | sed 's/^[xvt]//'`
2328 hp*) osname=hp_osf1 ;;
2329 mips) osname=mips_osf1 ;;
2332 unixware) osname=svr5
2338 $2) case "$osname" in
2342 : svr4.x or possibly later
2352 if test -f /stand/boot ; then
2353 eval `grep '^INITPROG=[a-z/0-9]*$' /stand/boot`
2354 if test -n "$INITPROG" -a -f "$INITPROG"; then
2355 isesix=`strings -a $INITPROG|grep 'ESIX SYSTEM V/386 Release 4.0'`
2356 if test -n "$isesix"; then
2364 *) if test -f /etc/systemid; then
2366 set `echo $3 | $sed 's/\./ /g'` $4
2367 if $test -f $src/hints/sco_$1_$2_$3.sh; then
2369 elif $test -f $src/hints/sco_$1_$2.sh; then
2371 elif $test -f $src/hints/sco_$1.sh; then
2376 '') : Still unknown. Probably a generic Sys V.
2385 *) case "$osname" in
2386 '') : Still unknown. Probably a generic BSD.
2394 if test -f /vmunix -a -f $src/hints/news_os.sh; then
2395 (what /vmunix | UU/tr '[A-Z]' '[a-z]') > UU/kernel.what 2>&1
2396 if $contains news-os UU/kernel.what >/dev/null 2>&1; then
2399 $rm -f UU/kernel.what
2400 elif test -d c:/.; then
2407 : Now look for a hint file osname_osvers, unless one has been
2408 : specified already.
2411 file=`echo "${osname}_${osvers}" | $sed -e 's%\.%_%g' -e 's%_$%%'`
2412 : Also try without trailing minor version numbers.
2413 xfile=`echo $file | $sed -e 's%_[^_]*$%%'`
2414 xxfile=`echo $xfile | $sed -e 's%_[^_]*$%%'`
2415 xxxfile=`echo $xxfile | $sed -e 's%_[^_]*$%%'`
2416 xxxxfile=`echo $xxxfile | $sed -e 's%_[^_]*$%%'`
2419 *) case "$osvers" in
2422 *) if $test -f $src/hints/$file.sh ; then
2424 elif $test -f $src/hints/$xfile.sh ; then
2426 elif $test -f $src/hints/$xxfile.sh ; then
2428 elif $test -f $src/hints/$xxxfile.sh ; then
2430 elif $test -f $src/hints/$xxxxfile.sh ; then
2432 elif $test -f "$src/hints/${osname}.sh" ; then
2441 if $test -f Policy.sh ; then
2444 none) dflt="Policy" ;;
2445 *) dflt="Policy $dflt" ;;
2450 dflt=`echo $hintfile | $sed 's/\.sh$//'`
2454 if $test -f Policy.sh ; then
2457 There's also a Policy hint file available, which should make the
2458 site-specific (policy) questions easier to answer.
2465 You may give one or more space-separated answers, or "none" if appropriate.
2466 A well-behaved OS will have no hints, so answering "none" or just "Policy"
2467 is a good thing. DO NOT give a wrong version or a wrong OS.
2471 rp="Which of these apply, if any?"
2474 for file in $tans; do
2475 if $test X$file = XPolicy -a -f Policy.sh; then
2477 $cat Policy.sh >> UU/config.sh
2478 elif $test -f $src/hints/$file.sh; then
2479 . $src/hints/$file.sh
2480 $cat $src/hints/$file.sh >> UU/config.sh
2481 elif $test X$tans = X -o X$tans = Xnone ; then
2484 : Give one chance to correct a possible typo.
2485 echo "$file.sh does not exist"
2487 rp="hint to use instead?"
2489 for file in $ans; do
2490 if $test -f "$src/hints/$file.sh"; then
2491 . $src/hints/$file.sh
2492 $cat $src/hints/$file.sh >> UU/config.sh
2493 elif $test X$ans = X -o X$ans = Xnone ; then
2496 echo "$file.sh does not exist -- ignored."
2503 : Remember our hint file for later.
2504 if $test -f "$src/hints/$file.sh" ; then
2514 echo "Fetching default answers from $config_sh..." >&4
2518 cp $config_sh config.sh 2>/dev/null
2528 test "$override" && . ./optdef.sh
2529 myuname="$newmyuname"
2531 : Restore computed paths
2532 for file in $loclist $trylist; do
2533 eval $file="\$_$file"
2538 Configure uses the operating system name and version to set some defaults.
2539 The default value is probably right if the name rings a bell. Otherwise,
2540 since spelling matters for me, either accept the default or answer "none"
2547 ''|' '|none) dflt=none ;;
2548 *) dflt=`echo $hintfile | $sed -e 's/\.sh$//' -e 's/_.*$//'` ;;
2551 *) dflt="$osname" ;;
2553 rp="Operating system name?"
2557 *) osname=`echo "$ans" | $sed -e 's/[ ][ ]*/_/g' | ./tr '[A-Z]' '[a-z]'`;;
2563 ''|' '|none) dflt=none ;;
2564 *) dflt=`echo $hintfile | $sed -e 's/\.sh$//' -e 's/^[^_]*//'`
2565 dflt=`echo $dflt | $sed -e 's/^_//' -e 's/_/./g'`
2567 ''|' ') dflt=none ;;
2572 *) dflt="$osvers" ;;
2574 rp="Operating system version?"
2584 : who configured the system
2585 cf_time=`LC_ALL=C; LANGUAGE=C; export LC_ALL; export LANGUAGE; $date 2>&1`
2586 cf_by=`(logname) 2>/dev/null`
2589 cf_by=`(whoami) 2>/dev/null`
2591 "") cf_by=unknown ;;
2595 : set up the script used to warn in case of inconsistency
2602 echo "*** WHOA THERE!!! ***" >&4
2603 echo " The $hint value for \$$var on this machine was \"$was\"!" >&4
2604 rp=" Keep the $hint value?"
2607 y) td=$was; tu=$was;;
2611 : function used to set $1 to $val
2612 setvar='var=$1; eval "was=\$$1"; td=$define; tu=$undef;
2614 $define$undef) . ./whoa; eval "$var=\$td";;
2615 $undef$define) . ./whoa; eval "$var=\$tu";;
2616 *) eval "$var=$val";;
2619 case "$usethreads" in
2620 $define|true|[yY]*) dflt='y';;
2625 Perl can be built to take advantage of threads on some systems.
2626 To do so, Configure can be run with -Dusethreads.
2628 Note that threading is a highly experimental feature, and
2629 some known race conditions still remain. If you choose to try
2630 it, be very sure to not actually deploy it for production
2631 purposes. README.threads has more details, and is required
2632 reading if you enable threads.
2634 If this doesn't make any sense to you, just accept the default '$dflt'.
2636 rp='Build a threading Perl?'
2639 y|Y) val="$define" ;;
2645 case "$usethreads" in
2649 As of 5.5.640, Perl has two different internal threading implementations,
2650 the 5.005 version (5005threads) and an interpreter-based version
2651 (ithreads) that has one interpreter per thread. Both are very
2652 experimental. This arrangement exists to help developers work out
2653 which one is better.
2655 If you're a casual user, you probably don't want interpreter-threads
2656 at this time. There doesn't yet exist a way to create threads from
2657 within Perl in this model, i.e., "use Thread;" will NOT work.
2659 : Default to ithreads unless overridden on command line or with
2662 case "$use5005threads" in
2663 $define|true|[yY]*) dflt='n';;
2665 case "$useithreads" in
2666 $undef|false|[nN]*) dflt='n';;
2668 rp='Use interpreter-based ithreads?'
2671 y|Y) val="$define" ;;
2676 : Now set use5005threads to the opposite value.
2677 case "$useithreads" in
2678 $define) val="$undef" ;;
2685 useithreads="$undef"
2686 use5005threads="$undef"
2690 case "$d_oldpthreads" in
2691 '') : Configure tests would be welcome here. For now, assume undef.
2693 *) val="$d_oldpthreads" ;;
2699 case "$usethreads" in
2700 "$define"|true|[yY]*)
2701 : Look for a hint-file generated 'call-back-unit'. If the
2702 : user has specified that a threading perl is to be built,
2703 : we may need to set or change some other defaults.
2704 if $test -f usethreads.cbu; then
2705 echo "Your platform has some specific hints for threaded builds, using them..."
2709 (Your platform doesn't have any specific hints for threaded builds.
2710 Assuming POSIX threads, then.)
2718 Perl can be built so that multiple Perl interpreters can coexist
2719 within the same Perl executable.
2722 case "$useithreads" in
2725 This multiple interpreter support is required for interpreter-based threads.
2729 *) case "$usemultiplicity" in
2730 $define|true|[yY]*) dflt='y';;
2734 echo "If this doesn't make any sense to you, just accept the default '$dflt'."
2735 rp='Build Perl for multiplicity?'
2738 y|Y) val="$define" ;;
2746 : determine where manual pages are on this system
2750 syspath='/usr/man/man1 /usr/man/mann /usr/man/manl /usr/man/local/man1'
2751 syspath="$syspath /usr/man/u_man/man1 /usr/share/man/man1"
2752 syspath="$syspath /usr/catman/u_man/man1 /usr/man/l_man/man1"
2753 syspath="$syspath /usr/local/man/u_man/man1 /usr/local/man/l_man/man1"
2754 syspath="$syspath /usr/man/man.L /local/man/man1 /usr/local/man/man1"
2755 sysman=`./loc . /usr/man/man1 $syspath`
2758 if $test -d "$sysman"; then
2759 echo "System manual is in $sysman." >&4
2761 echo "Could not find manual pages in source form." >&4
2764 : see what memory models we can support
2767 $cat >pdp11.c <<'EOP'
2776 ( cc -o pdp11 pdp11.c ) >/dev/null 2>&1
2777 if $test -f pdp11 && ./pdp11 2>/dev/null; then
2778 dflt='unsplit split'
2780 tans=`./loc . X /lib/small /lib/large /usr/lib/small /usr/lib/large /lib/medium /usr/lib/medium /lib/huge`
2783 *) if $test -d /lib/small || $test -d /usr/lib/small; then
2788 if $test -d /lib/medium || $test -d /usr/lib/medium; then
2791 if $test -d /lib/large || $test -d /usr/lib/large; then
2794 if $test -d /lib/huge || $test -d /usr/lib/huge; then
2803 Some systems have different model sizes. On most systems they are called
2804 small, medium, large, and huge. On the PDP11 they are called unsplit and
2805 split. If your system doesn't support different memory models, say "none".
2806 If you wish to force everything to one memory model, say "none" here and
2807 put the appropriate flags later when it asks you for other cc and ld flags.
2808 Venix systems may wish to put "none" and let the compiler figure things out.
2809 (In the following question multiple model names should be space separated.)
2811 The default for most systems is "none".
2814 rp="Which memory models are supported?"
2829 '') if $contains '\-i' $sysman/ld.1 >/dev/null 2>&1 || \
2830 $contains '\-i' $sysman/cc.1 >/dev/null 2>&1; then
2837 rp="What flag indicates separate I and D space?"
2845 *large*|*small*|*medium*|*huge*)
2852 rp="What flag indicates large model?"
2862 *huge*) case "$huge" in
2866 rp="What flag indicates huge model?"
2876 *medium*) case "$medium" in
2880 rp="What flag indicates medium model?"
2887 *) medium="$large";;
2890 *small*) case "$small" in
2894 rp="What flag indicates small model?"
2905 echo "Unrecognized memory models--you may have to edit Makefile.SH" >&4
2908 $rm -f pdp11.* pdp11
2910 : make some quick guesses about what we are up against
2912 $echo $n "Hmm... $c"
2922 $cat /usr/include/signal.h /usr/include/sys/signal.h >foo 2>/dev/null
2923 if test -f /osf_boot || $contains 'OSF/1' /usr/include/ctype.h >/dev/null 2>&1
2925 echo "Looks kind of like an OSF/1 system, but we'll see..."
2927 elif test `echo abc | tr a-z A-Z` = Abc ; then
2928 xxx=`./loc addbib blurfl $pth`
2929 if $test -f $xxx; then
2930 echo "Looks kind of like a USG system with BSD features, but we'll see..."
2934 if $contains SIGTSTP foo >/dev/null 2>&1 ; then
2935 echo "Looks kind of like an extended USG system, but we'll see..."
2937 echo "Looks kind of like a USG system, but we'll see..."
2941 elif $contains SIGTSTP foo >/dev/null 2>&1 ; then
2942 echo "Looks kind of like a BSD system, but we'll see..."
2946 echo "Looks kind of like a Version 7 system, but we'll see..."
2949 case "$eunicefix" in
2952 There is, however, a strange, musty smell in the air that reminds me of
2953 something...hmm...yes...I've got it...there's a VMS nearby, or I'm a Blit.
2957 : it so happens the Eunice I know will not run shell scripts in Unix format
2961 echo "Congratulations. You aren't running Eunice."
2965 : Detect OS2. The p_ variable is set above in the Head.U unit.
2970 I have the feeling something is not exactly right, however...don't tell me...
2971 lemme think...does HAL ring a bell?...no, of course, you're only running OS/2!
2976 if test -f /xenix; then
2977 echo "Actually, this looks more like a XENIX system..."
2982 echo "It's not Xenix..."
2987 if test -f /venix; then
2988 echo "Actually, this looks more like a VENIX system..."
2995 echo "Nor is it Venix..."
2998 chmod +x bsd usg v7 osf1 eunice xenix venix os2
2999 $eunicefix bsd usg v7 osf1 eunice xenix venix os2
3002 : see if we need a special compiler
3010 *) if $contains '\-M' $sysman/cc.1 >/dev/null 2>&1 ; then
3011 if $contains '\-M' $sysman/cpp.1 >/dev/null 2>&1; then
3025 On some older systems the default C compiler will not resolve multiple global
3026 references that happen to have the same name. On some such systems the "Mcc"
3027 command may be used to force these to be resolved. On other systems a "cc -M"
3028 command is required. (Note that the -M flag on other systems indicates a
3029 memory model to use!) If you have the Gnu C compiler, you might wish to use
3035 rp="Use which C compiler?"
3043 rp="Use which C compiler?"
3047 : Look for a hint-file generated 'call-back-unit'. Now that the
3048 : user has specified the compiler, we may need to set or change some
3050 if $test -f cc.cbu; then
3054 echo "Checking for GNU cc in disguise and/or its version number..." >&4
3055 $cat >gccvers.c <<EOM
3060 printf("%s\n", __VERSION__);
3062 printf("%s\n", "1");
3068 if $cc $ldflags -o gccvers gccvers.c; then
3069 gccversion=`./gccvers`
3070 case "$gccversion" in
3071 '') echo "You are not using GNU cc." ;;
3072 *) echo "You are using GNU cc $gccversion."
3077 echo "*** WHOA THERE!!! ***" >&4
3078 echo " Your C compiler \"$cc\" doesn't seem to be working!" >&4
3079 case "$knowitall" in
3081 echo " You'd better start hunting for one and let me know about it." >&4
3087 case "$gccversion" in
3088 1*) cpp=`./loc gcc-cpp $cpp $pth` ;;
3091 : decide how portable to be. Allow command line overrides.
3092 case "$d_portable" in
3094 *) d_portable="$define" ;;
3097 : set up shell script to do ~ expansion
3103 echo \$1 | $sed "s|~|\${HOME-\$LOGDIR}|"
3106 if $test -f /bin/csh; then
3107 /bin/csh -f -c "glob \$1"
3112 name=\`$expr x\$1 : '..\([^/]*\)'\`
3113 dir=\`$sed -n -e "/^\${name}:/{s/^[^:]*:[^:]*:[^:]*:[^:]*:[^:]*:\([^:]*\).*"'\$'"/\1/" -e p -e q -e '}' </etc/passwd\`
3114 if $test ! -d "\$dir"; then
3116 echo "\$me: can't locate home directory for: \$name" >&2
3121 echo \$dir/\`$expr x\$1 : '..[^/]*/\(.*\)'\`
3137 : now set up to get a file name
3141 cat <<'EOSC' >>getfile
3157 expr $fn : '.*(\(.*\)).*' | tr ',' $trnl >getfile.ok
3158 fn=`echo $fn | sed 's/(.*)//'`
3164 loc_file=`expr $fn : '.*:\(.*\)'`
3165 fn=`expr $fn : '\(.*\):.*'`
3173 */*) fullpath=true;;
3182 *e*) exp_file=true;;
3185 *p*) nopath_ok=true;;
3190 *d*) type='Directory';;
3191 *l*) type='Locate';;
3196 Locate) what='File';;
3201 case "$d_portable" in
3209 while test "$type"; do
3214 true) rp="$rp (~name ok)";;
3217 if test -f UU/getfile.ok && \
3218 $contains "^$ans\$" UU/getfile.ok >/dev/null 2>&1
3237 value=`UU/filexp $ans`
3240 if test "$ans" != "$value"; then
3241 echo "(That expands to $value on this system.)"
3255 /*) value="$ansexp" ;;
3260 echo "I shall only accept a full path name, as in /bin/ls." >&4
3261 echo "Use a ! shell escape if you wish to check pathnames." >&4
3264 echo "Please give a full path name, starting with slash." >&4
3267 echo "Note that using ~name is ok provided it expands well." >&4
3280 for fp in $gfpth; do
3281 if test "X$fp" = X.; then
3286 if test -f "$pf"; then
3288 elif test -r "$pf" || (test -h "$pf") >/dev/null 2>&1
3290 echo "($value is not a plain file, but that's ok.)"
3293 if test X"$type" = X; then
3300 for fp in $gfpth; do
3301 if test "X$fp" = X.; then
3306 if test -d "$pf"; then
3314 if test -d "$ansexp"; then
3315 echo "(Looking for $loc_file in directory $value.)"
3316 value="$value/$loc_file"
3317 ansexp="$ansexp/$loc_file"
3319 if test -f "$ansexp"; then
3322 case "$nopath_ok" in
3323 true) case "$value" in
3325 *) echo "Assuming $value will be in people's path."
3341 if test "$fastread" = yes; then
3346 rp="$what $value doesn't exist. Use that name anyway?"
3365 test "X$gfpthkeep" != Xy && gfpth=""
3368 : What should the include directory be ?
3370 $echo $n "Hmm... $c"
3374 if $test -f /bin/mips && /bin/mips; then
3375 echo "Looks like a MIPS system..."
3376 $cat >usr.c <<'EOCP'
3377 #ifdef SYSTYPE_BSD43
3381 if $cc -E usr.c > usr.out && $contains / usr.out >/dev/null 2>&1; then
3382 dflt='/bsd43/usr/include'
3386 mips_type='System V'
3388 $rm -f usr.c usr.out
3389 echo "and you're compiling with the $mips_type compiler and libraries."
3393 echo "Doesn't look like a MIPS system."
3403 case "$xxx_prompt" in
3406 rp='Where are the include files you want to use?'
3414 : see how we invoke the C preprocessor
3416 echo "Now, how can we feed standard input to your C preprocessor..." >&4
3417 cat <<'EOT' >testcpp.c
3423 if test ! -f cppstdin; then
3424 if test "X$osname" = "Xaix" -a "X$gccversion" = X; then
3425 # AIX cc -E doesn't show the absolute headerfile
3426 # locations but we'll cheat by using the -M flag.
3427 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
3429 echo 'cat >.$$.c; '"$cc"' -E ${1+"$@"} .$$.c; rm .$$.c' >cppstdin
3432 echo "Keeping your $hint cppstdin wrapper."
3435 wrapper=`pwd`/cppstdin
3439 if $test "X$cppstdin" != "X" && \
3440 $cppstdin $cppminus <testcpp.c >testcpp.out 2>&1 && \
3441 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
3443 echo "You used to use $cppstdin $cppminus so we'll use that again."
3445 '') echo "But let's see if we can live without a wrapper..." ;;
3447 if $cpprun $cpplast <testcpp.c >testcpp.out 2>&1 && \
3448 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
3450 echo "(And we'll use $cpprun $cpplast to preprocess directly.)"
3453 echo "(However, $cpprun $cpplast does not work, let's see...)"
3461 echo "Good old $cppstdin $cppminus does not seem to be of any help..."
3468 elif echo 'Maybe "'"$cc"' -E" will work...'; \
3469 $cc -E <testcpp.c >testcpp.out 2>&1; \
3470 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3471 echo "Yup, it does."
3474 elif echo 'Nope...maybe "'"$cc"' -E -" will work...'; \
3475 $cc -E - <testcpp.c >testcpp.out 2>&1; \
3476 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3477 echo "Yup, it does."
3480 elif echo 'Nope...maybe "'"$cc"' -P" will work...'; \
3481 $cc -P <testcpp.c >testcpp.out 2>&1; \
3482 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3483 echo "Yipee, that works!"
3486 elif echo 'Nope...maybe "'"$cc"' -P -" will work...'; \
3487 $cc -P - <testcpp.c >testcpp.out 2>&1; \
3488 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3489 echo "At long last!"
3492 elif echo 'No such luck, maybe "'$cpp'" will work...'; \
3493 $cpp <testcpp.c >testcpp.out 2>&1; \
3494 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3498 elif echo 'Nixed again...maybe "'$cpp' -" will work...'; \
3499 $cpp - <testcpp.c >testcpp.out 2>&1; \
3500 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3501 echo "Hooray, it works! I was beginning to wonder."
3504 elif echo 'Uh-uh. Time to get fancy. Trying a wrapper...'; \
3505 $wrapper <testcpp.c >testcpp.out 2>&1; \
3506 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3512 rp="No dice. I can't find a C preprocessor. Name one:"
3516 $x_cpp <testcpp.c >testcpp.out 2>&1
3517 if $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3518 echo "OK, that will do." >&4
3520 echo "Sorry, I can't get that to work. Go find one and rerun Configure." >&4
3535 echo "Perhaps can we force $cc -E using a wrapper..."
3536 if $wrapper <testcpp.c >testcpp.out 2>&1; \
3537 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
3543 echo "Nope, we'll have to live without it..."
3557 "$wrapper"|'cppstdin') ;;
3558 *) $rm -f $wrapper;;
3560 $rm -f testcpp.c testcpp.out
3562 : Set private lib path
3565 plibpth="$incpath/usr/lib /usr/local/lib /usr/ccs/lib"
3570 '') dlist="$loclibpth $plibpth $glibpth";;
3571 *) dlist="$libpth";;
3574 : Now check and see which directories actually exist, avoiding duplicates
3578 if $test -d $xxx; then
3581 *) libpth="$libpth $xxx";;
3587 Some systems have incompatible or broken versions of libraries. Among
3588 the directories listed in the question below, please remove any you
3589 know not to be holding relevant libraries, and add any that are needed.
3590 Say "none" for none.
3601 rp="Directories to use for library searches?"
3608 : compute shared library extension
3611 if xxx=`./loc libc.sl X $libpth`; $test -f "$xxx"; then
3621 On some systems, shared libraries may be available. Answer 'none' if
3622 you want to suppress searching of shared libraries for the remainder
3623 of this configuration.
3626 rp='What is the file extension used for shared libraries?'
3630 : Define several unixisms.
3631 : Hints files or command line option can be used to override them.
3632 : The convoluted testing is in case hints files set either the old
3635 '') case "$exe_ext" in
3637 *) _exe="$exe_ext" ;;
3642 '') case "$lib_ext" in
3649 '') case "$obj_ext" in
3656 '') case "$path_sep" in
3667 : Which makefile gets called first. This is used by make depend.
3668 case "$firstmakefile" in
3669 '') firstmakefile='makefile';;
3673 $define|true|[yY]*) dflt='y';;
3678 Perl can be built to use the SOCKS proxy protocol library. To do so,
3679 Configure must be run with -Dusesocks.
3681 If this doesn't make any sense to you, just accept the default '$dflt'.
3683 rp='Build Perl for SOCKS?'
3686 y|Y) val="$define" ;;
3692 : Looking for optional libraries
3694 echo "Checking for optional libraries..." >&4
3699 case "$libswanted" in
3700 '') libswanted='c_s';;
3704 libswanted="$libswanted socks5 socks5_sh"
3711 for thisdir in $libpth $xlibpth; do
3712 test -d $thisdir && libspath="$libspath $thisdir"
3714 for thislib in $libswanted; do
3715 for thisdir in $libspath; do
3717 if $test ! -f "$xxx" -a "X$ignore_versioned_solibs" = "X"; then
3718 xxx=`ls $thisdir/lib$thislib.$so.[0-9] 2>/dev/null|tail -1`
3719 $test -f "$xxx" && eval $libscheck
3720 $test -f "$xxx" && libstyle=shared
3722 if test ! -f "$xxx"; then
3723 xxx=$thisdir/lib$thislib.$so
3724 $test -f "$xxx" && eval $libscheck
3725 $test -f "$xxx" && libstyle=shared
3727 if test ! -f "$xxx"; then
3728 xxx=$thisdir/lib$thislib$_a
3729 $test -f "$xxx" && eval $libscheck
3730 $test -f "$xxx" && libstyle=static
3732 if test ! -f "$xxx"; then
3733 xxx=$thisdir/$thislib$_a
3734 $test -f "$xxx" && eval $libscheck
3735 $test -f "$xxx" && libstyle=static
3737 if test ! -f "$xxx"; then
3738 xxx=$thisdir/lib${thislib}_s$_a
3739 $test -f "$xxx" && eval $libscheck
3740 $test -f "$xxx" && libstyle=static
3742 if test ! -f "$xxx"; then
3743 xxx=$thisdir/Slib$thislib$_a
3744 $test -f "$xxx" && eval $libscheck
3745 $test -f "$xxx" && libstyle=static
3747 if $test -f "$xxx"; then
3749 shared) echo "Found -l$thislib (shared)." ;;
3750 static) echo "Found -l$thislib." ;;
3751 *) echo "Found -l$thislib ($libstyle)." ;;
3755 *) dflt="$dflt -l$thislib"
3756 libsfound="$libsfound $xxx"
3758 libsfiles="$libsfiles $yyy"
3759 yyy=`echo $xxx|$sed -e "s%/$yyy\\$%%"`
3760 case " $libsdirs " in
3762 *) libsdirs="$libsdirs $yyy" ;;
3769 if $test ! -f "$xxx"; then
3770 echo "No -l$thislib."
3781 ' '|'') dflt='none';;
3786 In order to compile $package on your machine, a number of libraries
3787 are usually needed. Include any other special libraries here as well.
3788 Say "none" for none. The default list is almost always right.
3792 rp="What libraries to use?"
3799 : determine optimization, if desired, or use for debug flag also
3801 ' '|$undef) dflt='none';;
3803 *) dflt="$optimize";;
3807 By default, $package compiles with the -O flag to use the optimizer.
3808 Alternately, you might want to use the symbolic debugger, which uses
3809 the -g flag (on traditional Unix systems). Either flag can be
3810 specified here. To use neither flag, specify the word "none".
3813 rp="What optimizer/debugger flag should be used?"
3817 'none') optimize=" ";;
3821 : We will not override a previous value, but we might want to
3822 : augment a hint file
3824 default|recommended)
3825 case "$gccversion" in
3826 1*) dflt='-fpcc-struct-return' ;;
3829 *-g*) dflt="$dflt -DDEBUGGING";;
3831 case "$gccversion" in
3832 2*) if test -d /etc/conf/kconfig.d &&
3833 $contains _POSIX_VERSION $usrinc/sys/unistd.h >/dev/null 2>&1
3839 case "$gccversion" in
3843 echo "Checking if your compiler accepts -fno-strict-aliasing" 2>&1
3844 echo 'int main(void) { return 0; }' > gcctest.c
3845 if $cc -O2 -fno-strict-aliasing -o gcctest gcctest.c; then
3846 echo "Yes, it does." 2>&1
3849 echo "Leaving current flags $ccflags alone." 2>&1
3851 *) dflt="$dflt -fno-strict-aliasing" ;;
3854 echo "Nope, it doesn't, but that's ok." 2>&1
3861 case "$mips_type" in
3862 *BSD*|'') inclwanted="$locincpth $usrinc";;
3863 *) inclwanted="$locincpth $inclwanted $usrinc/bsd";;
3865 for thisincl in $inclwanted; do
3866 if $test -d $thisincl; then
3867 if $test x$thisincl != x$usrinc; then
3870 *) dflt="$dflt -I$thisincl";;
3876 inctest='if $contains $2 $usrinc/$1 >/dev/null 2>&1; then
3878 elif $contains $2 $usrinc/sys/$1 >/dev/null 2>&1; then
3886 *) dflt="$dflt -D$2";;
3890 set signal.h LANGUAGE_C; eval $inctest
3894 ccflags="$ccflags -DSOCKS"
3899 default|recommended) dflt="$ccflags $dflt" ;;
3900 *) dflt="$ccflags";;
3908 Your C compiler may want other flags. For this question you should include
3909 -I/whatever and -DWHATEVER flags and any other flags used by the C compiler,
3910 but you should NOT include libraries or ld flags like -lwhatever. If you
3911 want $package to honor its debug switch, you should include -DDEBUGGING here.
3912 Your C compiler might also need additional flags, such as -D_POSIX_SOURCE.
3914 To use no flags, specify the word "none".
3920 rp="Any additional cc flags?"
3927 : the following weeds options from ccflags that are of no interest to cpp
3929 case "$gccversion" in
3930 1*) cppflags="$cppflags -D__GNUC__"
3932 case "$mips_type" in
3934 *BSD*) cppflags="$cppflags -DSYSTYPE_BSD43";;
3940 echo "Let me guess what the preprocessor flags are..." >&4
3954 *) ftry="$previous $flag";;
3956 if $cppstdin -DLFRULB=bar $cppflags $ftry $cppminus <cpp.c \
3957 >cpp1.out 2>/dev/null && \
3958 $cpprun -DLFRULB=bar $cppflags $ftry $cpplast <cpp.c \
3959 >cpp2.out 2>/dev/null && \
3960 $contains 'foo.*xx.*bar' cpp1.out >/dev/null 2>&1 && \
3961 $contains 'foo.*xx.*bar' cpp2.out >/dev/null 2>&1
3963 cppflags="$cppflags $ftry"
3973 *-*) echo "They appear to be: $cppflags";;
3975 $rm -f cpp.c cpp?.out
3979 : flags used in final linking phase
3981 '') if ./venix; then
3987 *-posix*) dflt="$dflt -posix" ;;
3990 *) dflt="$ldflags";;
3993 : Try to guess additional flags to pick up local libraries.
3994 for thislibdir in $libpth; do
3995 case " $loclibpth " in
3998 *"-L$thislibdir "*) ;;
3999 *) dflt="$dflt -L$thislibdir" ;;
4011 Your C linker may need flags. For this question you should
4012 include -L/whatever and any other flags used by the C linker, but you
4013 should NOT include libraries like -lwhatever.
4015 Make sure you include the appropriate -L/path flags if your C linker
4016 does not normally search all of the directories you specified above,
4019 To use no flags, specify the word "none".
4023 rp="Any additional ld flags (NOT including libraries)?"
4029 rmlist="$rmlist pdp11"
4033 echo "Checking your choice of C compiler and flags for coherency..." >&4
4034 $cat > try.c <<'EOF'
4036 int main() { printf("Ok\n"); exit(0); }
4038 set X $cc $optimize $ccflags -o try $ldflags try.c $libs
4040 $cat >try.msg <<'EOM'
4041 I've tried to compile and run the following simple program:
4044 $cat try.c >> try.msg
4046 $cat >> try.msg <<EOM
4053 and I got the following output:
4057 if sh -c "$cc $optimize $ccflags -o try $ldflags try.c $libs" >>try.msg 2>&1; then
4058 if sh -c './try' >>try.msg 2>&1; then
4062 *) echo 'The program compiled OK, but produced no output.' >> try.msg
4065 cat >> try.msg <<'EOQS'
4066 If $libs contains -lsfio, and sfio is mis-configured, then it
4067 sometimes (apparently) runs and exits with a 0 status, but with no
4068 output! It may have to do with sfio's use of _exit vs. exit.
4071 rp="You have a big problem. Shall I abort Configure"
4078 echo "The program compiled OK, but exited with status $?." >>try.msg
4079 rp="You have a problem. Shall I abort Configure"
4083 echo "I can't compile the test program." >>try.msg
4084 rp="You have a BIG problem. Shall I abort Configure"
4090 case "$knowitall" in
4092 echo "(The supplied flags or libraries might be incorrect.)"
4100 *) echo "Ok. Stopping Configure." >&4
4105 n) echo "OK, that should do.";;
4107 $rm -f try try.* core
4109 : define an is-a-typedef? function
4110 typedef='type=$1; var=$2; def=$3; shift; shift; shift; inclist=$@;
4112 "") inclist="sys/types.h";;
4114 eval "varval=\$$var";
4118 for inc in $inclist; do
4119 echo "#include <$inc>" >>temp.c;
4121 echo "#ifdef $type" >> temp.c;
4122 echo "printf(\"We have $type\");" >> temp.c;
4123 echo "#endif" >> temp.c;
4124 $cppstdin $cppflags $cppminus < temp.c >temp.E 2>/dev/null;
4125 if $contains $type temp.E >/dev/null 2>&1; then
4131 *) eval "$var=\$varval";;
4134 : define an is-a-typedef? function that prompts if the type is not available.
4135 typedef_ask='type=$1; var=$2; def=$3; shift; shift; shift; inclist=$@;
4137 "") inclist="sys/types.h";;
4139 eval "varval=\$$var";
4143 for inc in $inclist; do
4144 echo "#include <$inc>" >>temp.c;
4146 echo "#ifdef $type" >> temp.c;
4147 echo "printf(\"We have $type\");" >> temp.c;
4148 echo "#endif" >> temp.c;
4149 $cppstdin $cppflags $cppminus < temp.c >temp.E 2>/dev/null;
4151 echo "$rp" | $sed -e "s/What is/Looking for/" -e "s/?/./";
4152 if $contains $type temp.E >/dev/null 2>&1; then
4153 echo "$type found." >&4;
4156 echo "$type NOT found." >&4;
4162 *) eval "$var=\$varval";;
4165 : define a shorthand compile call
4169 $cc $optimize $ccflags $ldflags -o ${mc_file} $* ${mc_file}.c $libs > /dev/null 2>&1;'
4170 : define a shorthand compile call for compilations that should be ok.
4174 $cc $optimize $ccflags $ldflags -o ${mc_file} $* ${mc_file}.c $libs;'
4176 : check for lengths of integral types
4180 echo "Checking to see how big your integers are..." >&4
4181 $cat >intsize.c <<'EOCP'
4185 printf("intsize=%d;\n", (int)sizeof(int));
4186 printf("longsize=%d;\n", (int)sizeof(long));
4187 printf("shortsize=%d;\n", (int)sizeof(short));
4192 if eval $compile_ok && ./intsize > /dev/null; then
4194 echo "Your integers are $intsize bytes long."
4195 echo "Your long integers are $longsize bytes long."
4196 echo "Your short integers are $shortsize bytes long."
4200 Help! I can't compile and run the intsize test program: please enlighten me!
4201 (This is probably a misconfiguration in your system or libraries, and
4202 you really ought to fix it. Still, I'll try anyway.)
4206 rp="What is the size of an integer (in bytes)?"
4210 rp="What is the size of a long integer (in bytes)?"
4214 rp="What is the size of a short integer (in bytes)?"
4220 $rm -f intsize intsize.*
4222 : see what type lseek is declared as in the kernel
4223 rp="What is the type used for lseek's offset on this system?"
4224 set off_t lseektype long stdio.h sys/types.h
4228 echo "Checking to see how big your file offsets are..." >&4
4230 #include <sys/types.h>
4234 printf("%d\n", (int)sizeof($lseektype));
4239 if eval $compile_ok; then
4241 echo "Your file offsets are $lseeksize bytes long."
4245 echo "(I can't seem to compile the test program. Guessing...)"
4246 rp="What is the size of your file offsets (in bytes)?"
4252 : see what type file positions are declared as in the library
4253 rp="What is the type for file position used by fsetpos()?"
4254 set fpos_t fpostype long stdio.h sys/types.h
4259 *_t) zzz="$fpostype" ;;
4262 echo "Checking the size of $zzz..." >&4
4264 #include <sys/types.h>
4267 printf("%d\n", (int)sizeof($fpostype));
4272 if eval $compile_ok; then
4276 echo "(I can't execute the test program--guessing $fpossize.)" >&4
4279 echo "Your $zzz is bytes long." >&4
4285 echo "(I can't compile the test program. Guessing...)" >&4
4286 rp="What is the size of your file positions (in bytes)?"
4293 case "$lseeksize:$fpossize" in
4296 You can have files larger than 2 gigabytes.
4299 *) case "$uselargefiles" in
4300 "$undef"|false|[nN]*) dflt='n' ;;
4305 Perl can be built to understand large files (files larger than 2 gigabytes)
4306 on some systems. To do so, Configure can be run with -Duselargefiles.
4308 If this doesn't make any sense to you, just accept the default '$dflt'.
4310 rp='Try to understand large files, if available?'
4313 y|Y) val="$define" ;;
4320 case "$uselargefiles" in
4322 : Look for a hint-file generated 'call-back-unit'. If the
4323 : user has specified that a large files perl is to be built,
4324 : we may need to set or change some other defaults.
4325 if $test -f uselfs.cbu; then
4326 echo "Your platform has some specific hints for large file builds, using them..."
4329 echo "Rechecking to see how big your file offsets are..." >&4
4331 #include <sys/types.h>
4335 printf("%d\n", (int)sizeof($lseektype));
4340 if eval $compile_ok; then
4342 $echo "Your file offsets are now $lseeksize bytes long."
4346 echo "(I can't seem to compile the test program. Guessing...)"
4347 rp="What is the size of your file offsets (in bytes)?"
4352 *_t) zzz="$fpostype" ;;
4355 $echo $n "Rechecking the size of $zzz...$c" >&4
4357 #include <sys/types.h>
4360 printf("%d\n", (int)sizeof($fpostype));
4365 if eval $compile_ok; then
4370 echo "(I can't execute the test program--guessing $fpossize.)" >&4
4373 echo " $fpossize bytes." >&4
4379 echo "(I can't compile the test program. Guessing...)" >&4
4380 rp="What is the size of your file positions (in bytes)?"
4390 case "$usemorebits" in
4391 "$define"|true|[yY]*)
4393 uselongdouble="$define"
4394 usemorebits="$define"
4396 *) usemorebits="$undef"
4401 # Backward compatibility (uselonglong is deprecated).
4402 case "$uselonglong" in
4403 "$define"|true|[yY]*)
4406 *** Configure -Duselonglong is deprecated, using the -Duse64bits instead.
4413 *-DUSE_LONG_LONG*|*-DUSE_64_BITS*|*-DUSE_FULL_64_BITS*) use64bits="$define";;
4415 case "$usefull64bits" in
4416 "$define"|true|[yY]*) use64bits="$define" ;;
4422 You have natively 64-bit long integers.
4426 *) case "$use64bits" in
4427 "$define"|true|[yY]*) dflt='y';;
4432 Perl can be built to take advantage of 64-bit integer types
4433 on some systems. To do so, Configure can be run with -Duse64bits.
4434 Choosing this option will most probably introduce binary incompatibilities.
4436 If this doesn't make any sense to you, just accept the default '$dflt'.
4438 rp='Try to use 64-bit integers, if available?'
4441 [yY]*) val="$define" ;;
4449 case "$usefull64bits" in
4450 "$define"|true|[yY]*) val="$define" ;;
4451 *) case "$use64bits" in
4452 "$define") case "$longsize" in
4456 Since you chose 64-bitness you may want to try maximal 64-bitness.
4457 What you have chosen is minimal 64-bitness which means just enough
4458 to get 64-bit integers. The maximal means using as much 64-bitness
4459 as is possible on the platform. This in turn means even more binary
4460 incompatibilities. On the other hand, your platform may not have
4461 any more maximal 64-bitness than what you already have chosen.
4463 If this doesn't make any sense to you, just accept the default '$dflt'.
4465 rp='Try to use full 64-bit support, if available?'
4468 [yY]*) val="$define" ;;
4483 case "$use64bits" in
4484 "$define"|true|[yY]*)
4485 : Look for a hint-file generated 'call-back-unit'. If the
4486 : user has specified that a 64-bit perl is to be built,
4487 : we may need to set or change some other defaults.
4488 if $test -f use64bits.cbu; then
4489 echo "Your platform has some specific hints for 64-bit builds, using them..."
4493 4) case "$ccflags" in
4495 *) ccflags="$ccflags -DUSE_64_BITS";;
4497 case "$archname64" in
4498 '') archname64=64 ;;
4505 case "$usefull64bits" in
4506 "$define"|true|[yY]*)
4507 : Look for a hint-file generated 'call-back-unit'. If the
4508 : user has specified that a full 64-bit perl is to be built,
4509 : we may need to set or change some other defaults.
4510 if $test -f usefull64bits.cbu; then
4511 echo "Your platform has some specific hints for full 64-bit builds, using them..."
4512 . ./usefull64bits.cbu
4515 4) case "$ccflags" in
4516 *-DUSE_FULL_64_BITS*) ;;
4517 *) ccflags="$ccflags -DUSE_FULL_64_BITS";;
4519 case "$archname64" in
4520 ''|64) archname64=full64 ;;
4527 : determine the architecture name
4529 if xxx=`./loc arch blurfl $pth`; $test -f "$xxx"; then
4530 tarch=`arch`"-$osname"
4531 elif xxx=`./loc uname blurfl $pth`; $test -f "$xxx" ; then
4532 if uname -m > tmparch 2>&1 ; then
4533 tarch=`$sed -e 's/ *$//' -e 's/ /_/g' \
4534 -e 's/$/'"-$osname/" tmparch`
4542 case "$myarchname" in
4545 echo "(Your architecture name used to be $myarchname.)"
4552 *) dflt="$archname";;
4554 rp='What is your architecture name'
4557 case "$usethreads" in
4559 echo "Threads selected." >&4
4561 *-thread*) echo "...and architecture name already has -thread." >&4
4563 *) archname="$archname-thread"
4564 echo "...setting architecture name to $archname." >&4
4569 case "$usemultiplicity" in
4571 echo "Multiplicity selected." >&4
4573 *-multi*) echo "...and architecture name already has -multi." >&4
4575 *) archname="$archname-multi"
4576 echo "...setting architecture name to $archname." >&4
4581 case "$use64bits" in
4583 case "$archname64" in
4588 *-$archname64*) echo "...and architecture name already has $archname64." >&4
4590 *) archname="$archname-$archname64"
4591 echo "...setting architecture name to $archname." >&4
4598 : determine root of directory hierarchy where package will be installed.
4601 dflt=`./loc . /usr/local /usr/local /local /opt /usr`
4609 By default, $package will be installed in $dflt/bin, manual pages
4610 under $dflt/man, etc..., i.e. with $dflt as prefix for all
4611 installation directories. Typically this is something like /usr/local.
4612 If you wish to have binaries under /usr/bin but other parts of the
4613 installation under /usr/local, that's ok: you will be prompted
4614 separately for each of the installation directories, the prefix being
4615 only used to set the defaults.
4619 rp='Installation prefix to use?'
4627 *) oldprefix="$prefix";;
4637 $define|true) afs=true ;;
4638 $undef|false) afs=false ;;
4639 *) if test -d /afs; then
4647 echo "AFS may be running... I'll be extra cautious then..." >&4
4649 echo "AFS does not seem to be running..." >&4
4652 : determine installation prefix for where package is to be installed.
4656 Since you are running AFS, I need to distinguish the directory in which
4657 files will reside from the directory in which they are installed (and from
4658 which they are presumably copied to the former directory by occult means).
4661 case "$installprefix" in
4662 '') dflt=`echo $prefix | sed 's#^/afs/#/afs/.#'`;;
4663 *) dflt="$installprefix";;
4668 In some special cases, particularly when building $package for distribution,
4669 it is convenient to distinguish between the directory in which files should
4670 be installed from the directory ($prefix) in which they
4671 will eventually reside. For most users, these two directories are the same.
4674 case "$installprefix" in
4676 *) dflt=$installprefix;;
4680 rp='What installation prefix should I use for installing files?'
4682 installprefix="$ans"
4683 installprefixexp="$ansexp"
4685 : set the prefixit variable, to compute a suitable default value
4686 prefixit='case "$3" in
4688 case "$oldprefix" in
4689 "") eval "$1=\"\$$2\"";;
4696 ""|" ") eval "$1=\"\$$2\"";;
4702 eval "tp=\"$oldprefix-\$$2-\""; eval "tp=\"$tp\"";
4704 --|/*--|\~*--) eval "$1=\"$prefix/$3\"";;
4705 /*-$oldprefix/*|\~*-$oldprefix/*)
4706 eval "$1=\`echo \$$2 | sed \"s,^$oldprefix,$prefix,\"\`";;
4707 *) eval "$1=\"\$$2\"";;
4712 : get the patchlevel
4714 echo "Getting the current patchlevel..." >&4
4715 if $test -r $rsrc/patchlevel.h;then
4716 revision=`awk '/define[ ]+PERL_REVISION/ {print $3}' $rsrc/patchlevel.h`
4717 patchlevel=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
4718 subversion=`awk '/define[ ]+PERL_SUBVERSION/ {print $3}' $rsrc/patchlevel.h`
4719 api_revision=`awk '/define[ ]+PERL_API_REVISION/ {print $3}' $rsrc/patchlevel.h`
4720 api_version=`awk '/define[ ]+PERL_API_VERSION/ {print $3}' $rsrc/patchlevel.h`
4721 api_subversion=`awk '/define[ ]+PERL_API_SUBVERSION/ {print $3}' $rsrc/patchlevel.h`
4730 $echo $n "(You have $package revision $revision" $c
4731 $echo $n " patchlevel $patchlevel" $c
4732 test 0 -eq "$subversion" || $echo $n " subversion $subversion" $c
4736 : XXX Should be a Configure test for double-dots in filenames.
4737 version=`echo $revision $patchlevel $subversion | \
4738 $awk '{ printf "%d_%d_%d\n", $1, $2, $3 }'`
4739 api_versionstring=`echo $api_revision $api_version $api_subversion | \
4740 $awk '{ printf "%d_%d_%d\n", $1, $2, $3 }'`
4743 version=`echo $revision $patchlevel $subversion | \
4744 $awk '{ printf "%d.%d.%d\n", $1, $2, $3 }'`
4745 api_versionstring=`echo $api_revision $api_version $api_subversion | \
4746 $awk '{ printf "%d.%d.%d\n", $1, $2, $3 }'`
4749 : Special case the 5.005_xx maintenance series, which used 5.005
4750 : without any subversion label as a subdirectory in $sitelib
4751 if test "${api_revision}${api_version}${api_subversion}" = "550"; then
4752 api_versionstring='5.005'
4755 : determine installation style
4756 : For now, try to deduce it from prefix unless it is already set.
4757 : Reproduce behavior of 5.005 and earlier, maybe drop that in 5.7.
4758 case "$installstyle" in
4759 '') case "$prefix" in
4760 *perl*) dflt='lib';;
4761 *) dflt='lib/perl5' ;;
4764 *) dflt='lib/perl5' ;;
4766 : Probably not worth prompting for this since we prompt for all
4767 : the directories individually, and the prompt would be too long and
4771 : determine where private library files go
4772 : Usual default is /usr/local/lib/perl5/$version.
4773 : Also allow things like /opt/perl/lib/$version, since
4774 : /opt/perl/lib/perl5... would be redundant.
4775 : The default "style" setting is made in installstyle.U
4776 case "$installstyle" in
4777 *lib/perl5*) set dflt privlib lib/$package/$version ;;
4778 *) set dflt privlib lib/$version ;;
4783 There are some auxiliary files for $package that need to be put into a
4784 private library directory that is accessible by everyone.
4788 rp='Pathname where the private library files will reside?'
4791 privlibexp="$ansexp"
4792 : Change installation prefix, if necessary.
4793 if $test X"$prefix" != X"$installprefix"; then
4794 installprivlib=`echo $privlibexp | sed "s#^$prefix#$installprefix#"`
4796 installprivlib="$privlibexp"
4799 : set the prefixup variable, to restore leading tilda escape
4800 prefixup='case "$prefixexp" in
4802 *) eval "$1=\`echo \$$1 | sed \"s,^$prefixexp,$prefix,\"\`";;
4805 : determine where public architecture dependent libraries go
4808 : privlib default is /usr/local/lib/$package/$version
4809 : archlib default is /usr/local/lib/$package/$version/$archname
4810 : privlib may have an optional trailing /share.
4811 tdflt=`echo $privlib | $sed 's,/share$,,'`
4812 tdflt=$tdflt/$archname
4821 $spackage contains architecture-dependent library files. If you are
4822 sharing libraries in a heterogeneous environment, you might store
4823 these files in a separate location. Otherwise, you can just include
4824 them with the rest of the public library files.
4828 rp='Where do you want to put the public architecture-dependent libraries?'
4831 archlibexp="$ansexp"
4832 if $test X"$archlib" = X"$privlib"; then
4837 : Change installation prefix, if necessary.
4838 if $test X"$prefix" != X"$installprefix"; then
4839 installarchlib=`echo $archlibexp | sed "s#^$prefix#$installprefix#"`
4841 installarchlib="$archlibexp"
4845 : Binary compatibility with 5.005 is not possible for builds
4846 : with advanced features
4847 case "$usethreads$usemultiplicity" in
4849 bincompat5005="$undef"
4850 d_bincompat5005="$undef"
4854 Perl 5.006 can be compiled for binary compatibility with 5.005.
4855 If you decide to do so, you will be able to continue using most
4856 of the extensions that were compiled for Perl 5.005.
4859 case "$bincompat5005$d_bincompat5005" in
4860 *"$undef"*) dflt=n ;;
4863 rp='Binary compatibility with Perl 5.005?'
4866 y*) val="$define" ;;
4871 case "$d_bincompat5005" in
4873 bincompat5005="$define"
4875 *) bincompat5005="$undef"
4876 d_bincompat5005="$undef"
4883 : see if setuid scripts can be secure
4886 Some kernels have a bug that prevents setuid #! scripts from being
4887 secure. Some sites have disabled setuid #! scripts because of this.
4889 First let's decide if your kernel supports secure setuid #! scripts.
4890 (If setuid #! scripts would be secure but have been disabled anyway,
4891 don't say that they are secure if asked.)
4896 if $test -d /dev/fd; then
4897 echo "#!$ls" >reflect
4898 chmod +x,u+s reflect
4899 ./reflect >flect 2>&1
4900 if $contains "/dev/fd" flect >/dev/null; then
4901 echo "Congratulations, your kernel has secure setuid scripts!" >&4
4905 If you are not sure if they are secure, I can check but I'll need a
4906 username and password different from the one you are using right now.
4907 If you don't have such a username or don't want me to test, simply
4911 rp='Other username to test security of setuid scripts with?'
4916 case "$d_suidsafe" in
4917 '') echo "I'll assume setuid scripts are *not* secure." >&4
4920 echo "Well, the $hint value is *not* secure." >&4
4922 *) echo "Well, the $hint value *is* secure." >&4
4927 $rm -f reflect flect
4928 echo "#!$ls" >reflect
4929 chmod +x,u+s reflect
4932 echo '"su" will (probably) prompt you for '"$ans's password."
4933 su $ans -c './reflect >flect'
4934 if $contains "/dev/fd" flect >/dev/null; then
4935 echo "Okay, it looks like setuid scripts are secure." >&4
4938 echo "I don't think setuid scripts are secure." >&4
4943 rp='Does your kernel have *secure* setuid scripts?'
4946 [yY]*) val="$define";;
4951 echo "I don't think setuid scripts are secure (no /dev/fd directory)." >&4
4952 echo "(That's for file descriptors, not floppy disks.)"
4958 $rm -f reflect flect
4960 : now see if they want to do setuid emulation
4963 case "$d_suidsafe" in
4966 echo "No need to emulate SUID scripts since they are secure here." >& 4
4970 Some systems have disabled setuid scripts, especially systems where
4971 setuid scripts cannot be secure. On systems where setuid scripts have
4972 been disabled, the setuid/setgid bits on scripts are currently
4973 useless. It is possible for $package to detect those bits and emulate
4974 setuid/setgid in a secure fashion. This emulation will only work if
4975 setuid scripts have been disabled in your kernel.
4979 "$define") dflt=y ;;
4982 rp="Do you want to do setuid/setgid emulation?"
4985 [yY]*) val="$define";;
4993 : determine filename position in cpp output
4995 echo "Computing filename position in cpp output for #include directives..." >&4
4996 echo '#include <stdio.h>' > foo.c
4999 $cppstdin $cppflags $cppminus <foo.c 2>/dev/null | \
5000 $grep '^[ ]*#.*stdio\.h' | \
5001 while read cline; do
5004 while $test \$# -gt 0; do
5005 if $test -r \`echo \$1 | $tr -d '"'\`; then
5010 pos=\`expr \$pos + 1\`
5022 *) pos="${fieldn}th";;
5024 echo "Your cpp writes the filename in the $pos field of the line."
5026 : locate header file
5031 for usrincdir in $usrinc
5033 if test -f \$usrincdir/\$wanted; then
5034 echo "\$usrincdir/\$wanted"
5038 awkprg='{ print \$$fieldn }'
5039 echo "#include <\$wanted>" > foo\$\$.c
5040 $cppstdin $cppminus $cppflags < foo\$\$.c 2>/dev/null | \
5041 $grep "^[ ]*#.*\$wanted" | \
5042 while read cline; do
5043 name=\`echo \$cline | $awk "\$awkprg" | $tr -d '"'\`
5045 *[/\\\\]\$wanted) echo "\$name"; exit 1;;
5046 *[\\\\/]\$wanted) echo "\$name"; exit 1;;
5051 # status = 0: grep returned 0 lines, case statement not executed
5052 # status = 1: headerfile found
5053 # status = 2: while loop executed, no headerfile found
5057 if test \$status -eq 1; then
5064 : define an alternate in-header-list? function
5065 inhdr='echo " "; td=$define; tu=$undef; yyy=$@;
5066 cont=true; xxf="echo \"<\$1> found.\" >&4";
5067 case $# in 2) xxnf="echo \"<\$1> NOT found.\" >&4";;
5068 *) xxnf="echo \"<\$1> NOT found, ...\" >&4";;
5070 case $# in 4) instead=instead;; *) instead="at last";; esac;
5071 while $test "$cont"; do
5073 var=$2; eval "was=\$$2";
5074 if $test "$xxx" && $test -r "$xxx";
5076 eval "case \"\$$var\" in $undef) . ./whoa; esac"; eval "$var=\$td";
5079 eval "case \"\$$var\" in $define) . ./whoa; esac"; eval "$var=\$tu"; fi;
5080 set $yyy; shift; shift; yyy=$@;
5081 case $# in 0) cont="";;
5082 2) xxf="echo \"but I found <\$1> $instead.\" >&4";
5083 xxnf="echo \"and I did not find <\$1> either.\" >&4";;
5084 *) xxf="echo \"but I found <\$1\> instead.\" >&4";
5085 xxnf="echo \"there is no <\$1>, ...\" >&4";;
5089 do set $yyy; var=$2; eval "was=\$$2";
5090 eval "case \"\$$var\" in $define) . ./whoa; esac"; eval "$var=\$tu";
5091 set $yyy; shift; shift; yyy=$@;
5094 : see if this is a malloc.h system
5095 set malloc.h i_malloc
5098 : see if stdlib is available
5099 set stdlib.h i_stdlib
5102 : determine which malloc to compile in
5104 case "$usemymalloc" in
5105 ''|[yY]*|true|$define) dflt='y' ;;
5108 rp="Do you wish to attempt to use the malloc that comes with $package?"
5114 mallocsrc='malloc.c'
5115 mallocobj="malloc$_o"
5116 d_mymalloc="$define"
5119 : Remove malloc from list of libraries to use
5120 echo "Removing unneeded -lmalloc from library list" >&4
5121 set `echo X $libs | $sed -e 's/-lmalloc / /' -e 's/-lmalloc$//'`
5124 echo "libs = $libs" >&4
5136 : compute the return types of malloc and free
5138 $cat >malloc.c <<END
5142 #include <sys/types.h>
5156 case "$malloctype" in
5158 if $cc $ccflags -c -DTRY_MALLOC malloc.c >/dev/null 2>&1; then
5165 echo "Your system wants malloc to return '$malloctype', it would seem." >&4
5169 if $cc $ccflags -c -DTRY_FREE malloc.c >/dev/null 2>&1; then
5176 echo "Your system uses $freetype free(), it would seem." >&4
5180 The installation process will also create a directory for
5181 vendor-supplied add-ons. Vendors who supply perl with their system
5182 may find it convenient to place all vendor-supplied files in this
5183 directory rather than in the main distribution directory. This will
5184 ease upgrades between binary-compatible maintenance versions of perl.
5186 Of course you may also use these directories in whatever way you see
5187 fit. For example, you might use them to access modules shared over a
5188 company-wide network.
5190 The default answer should be fine for most people.
5191 This causes further questions about vendor add-ons to be skipped
5192 and no vendor-specific directories will be configured for perl.
5195 rp='Do you want to configure vendor-specific add-on directories?'
5196 case "$usevendorprefix" in
5197 define|true|[yY]*) dflt=y ;;
5198 *) : User may have set vendorprefix directly on Configure command line.
5199 case "$vendorprefix" in
5208 rp='Installation prefix to use for vendor-supplied add-ons?'
5209 case "$vendorprefix" in
5211 *) dflt=$vendorprefix ;;
5214 : XXX Prefixit unit does not yet support siteprefix and vendorprefix
5216 case "$vendorprefix" in
5220 *) oldvendorprefix="$prefix";;
5224 usevendorprefix="$define"
5226 vendorprefixexp="$ansexp"
5228 *) usevendorprefix="$undef"
5234 case "$vendorprefix" in
5235 '') d_vendorlib="$undef"
5239 *) d_vendorlib="$define"
5240 : determine where vendor-supplied modules go.
5241 : Usual default is /usr/local/lib/perl5/vendor_perl/$version
5242 case "$vendorlib" in
5244 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
5245 case "$installstyle" in
5246 *lib/perl5*) dflt=$vendorprefix/lib/$package/vendor_$prog/$version ;;
5247 *) dflt=$vendorprefix/lib/vendor_$prog/$version ;;
5250 *) dflt="$vendorlib"
5254 rp='Pathname for the vendor-supplied library files?'
5257 vendorlibexp="$ansexp"
5260 : Change installation prefix, if necessary.
5261 if $test X"$prefix" != X"$installprefix"; then
5262 installvendorlib=`echo $vendorlibexp | $sed "s#^$prefix#$installprefix#"`
5264 installvendorlib="$vendorlibexp"
5267 : Cruising for prototypes
5269 echo "Checking out function prototypes..." >&4
5270 $cat >prototype.c <<'EOCP'
5271 int main(int argc, char *argv[]) {
5274 if $cc $ccflags -c prototype.c >prototype.out 2>&1 ; then
5275 echo "Your C compiler appears to support function prototypes."
5278 echo "Your C compiler doesn't seem to understand function prototypes."
5285 case "$prototype" in
5287 *) ansi2knr='ansi2knr'
5292 This version of $package can only be compiled by a compiler that
5293 understands function prototypes. Unfortunately, your C compiler
5295 doesn't seem to understand them. Sorry about that.
5297 If GNU cc is available for your system, perhaps you could try that instead.
5299 Eventually, we hope to support building Perl with pre-ANSI compilers.
5300 If you would like to help in that effort, please contact <perlbug@perl.org>.
5302 Aborting Configure now.
5308 : determine where public executables go
5313 rp='Pathname where the public executables will reside?'
5315 if $test "X$ansexp" != "X$binexp"; then
5320 : Change installation prefix, if necessary.
5321 : XXX Bug? -- ignores Configure -Dinstallprefix setting.
5322 if $test X"$prefix" != X"$installprefix"; then
5323 installbin=`echo $binexp | sed "s#^$prefix#$installprefix#"`
5325 installbin="$binexp"
5328 : Find perl5.005 or later.
5329 echo "Looking for a previously installed perl5.005 or later... "
5331 '') for tdir in `echo "$binexp:$PATH" | $sed "s/$path_sep/ /g"`; do
5332 : Check if this perl is recent and can load a simple module
5333 if $test -x $tdir/perl && $tdir/perl -Mless -e 'use 5.005;' >/dev/null 2>&1; then
5336 elif $test -x $tdir/perl5 && $tdir/perl5 -Mless -e 'use 5.005;' >/dev/null 2>&1; then
5346 '') echo "None found. That's ok.";;
5347 *) echo "Using $perl5." ;;
5352 After $package is installed, you may wish to install various
5353 add-on modules and utilities. Typically, these add-ons will
5354 be installed under $prefix with the rest
5355 of this package. However, you may wish to install such add-ons
5356 elsewhere under a different prefix.
5358 If you do not wish to put everything under a single prefix, that's
5359 ok. You will be prompted for the individual locations; this siteprefix
5360 is only used to suggest the defaults.
5362 The default should be fine for most people.
5366 rp='Installation prefix to use for add-on modules and utilities?'
5367 : XXX Here might be another good place for an installstyle setting.
5368 case "$siteprefix" in
5370 *) dflt=$siteprefix ;;
5373 : XXX Prefixit unit does not yet support siteprefix and vendorprefix
5375 case "$siteprefix" in
5379 *) oldsiteprefix="$prefix";;
5384 siteprefixexp="$ansexp"
5386 : determine where site specific libraries go.
5387 : Usual default is /usr/local/lib/perl5/site_perl/$version
5388 : The default "style" setting is made in installstyle.U
5389 : XXX No longer works with Prefixit stuff.
5390 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
5392 '') case "$installstyle" in
5393 *lib/perl5*) dflt=$siteprefix/lib/$package/site_$prog/$version ;;
5394 *) dflt=$siteprefix/lib/site_$prog/$version ;;
5402 The installation process will create a directory for
5403 site-specific extensions and modules. Most users find it convenient
5404 to place all site-specific files in this directory rather than in the
5405 main distribution directory.
5409 rp='Pathname for the site-specific library files?'
5412 sitelibexp="$ansexp"
5413 : Change installation prefix, if necessary.
5414 if $test X"$prefix" != X"$installprefix"; then
5415 installsitelib=`echo $sitelibexp | $sed "s#^$prefix#$installprefix#"`
5417 installsitelib="$sitelibexp"
5420 : Determine list of previous versions to include in @INC
5421 $cat > getverlist <<EOPL
5424 \$api_versionstring = "$api_versionstring";
5425 \$version = "$version";
5426 \$sitelib = "$sitelib";
5427 \$archname = "$archname";
5429 $cat >> getverlist <<'EOPL'
5430 # Can't have leading @ because metaconfig interprets it as a command!
5431 ;@inc_version_list=();
5432 $stem=dirname($sitelib);
5433 # XXX Redo to do opendir/readdir?
5436 ;@candidates = glob("5.*");
5442 # XXX ToDo: These comparisons must be reworked when two-digit
5443 # subversions come along, so that 5.7.10 compares as greater than
5444 # 5.7.3! By that time, hope that 5.6.x is sufficiently
5445 # widespread that we can use the built-in version vectors rather
5446 # than reinventing them here. For 5.6.0, however, we must
5447 # assume this script will likely be run by 5.005_0x. --AD 1/2000.
5448 foreach $d (@candidates) {
5449 if ($d lt $version) {
5450 if ($d ge $api_versionstring) {
5451 unshift(@inc_version_list, "$d/$archname", $d);
5453 elsif ($d ge "5.005") {
5454 unshift(@inc_version_list, $d);
5458 # Skip newer version. I.e. don't look in
5459 # 5.7.0 if we're installing 5.6.1.
5463 if (@inc_version_list) {
5464 print join(' ', @inc_version_list);
5467 # Blank space to preserve value for next Configure run.
5472 case "$inc_version_list" in
5473 '') if test -x "$perl5"; then
5474 dflt=`$perl5 getverlist`
5479 $undef) dflt='none' ;;
5480 *) dflt="$inc_version_list" ;;
5483 ''|' ') dflt=none ;;
5487 In order to ease the process of upgrading, this version of perl
5488 can be configured to use modules built and installed with earlier
5489 versions of perl that were installed under $prefix. Specify here
5490 the list of earlier versions that this version of perl should check.
5491 If Configure detected no earlier versions of perl installed under
5492 $prefix, then the list will be empty. Answer 'none' to tell perl
5493 to not search earlier versions.
5495 The default should almost always be sensible, so if you're not sure,
5496 just accept the default.
5499 rp='List of earlier versions to include in @INC?'
5502 [Nn]one|''|' ') inc_version_list=' ' ;;
5503 *) inc_version_list="$ans" ;;
5505 case "$inc_version_list" in
5507 inc_version_list_init='0';;
5508 *) inc_version_list_init=`echo $inc_version_list |
5509 $sed -e 's/^/"/' -e 's/ /","/g' -e 's/$/",0/'`
5514 : determine whether to install perl also as /usr/bin/perl
5517 if $test -d /usr/bin -a "X$installbin" != X/usr/bin; then
5519 Many scripts expect to perl to be installed as /usr/bin/perl.
5520 I can install the perl you are about to compile also as /usr/bin/perl
5521 (in addition to $installbin/perl).
5523 case "$installusrbinperl" in
5524 "$undef"|[nN]*) dflt='n';;
5527 rp="Do you want to install perl as /usr/bin/perl?"
5530 [yY]*) val="$define";;
5536 set installusrbinperl
5540 echo "Checking for GNU C Library..." >&4
5541 cat >gnulibc.c <<EOM
5553 if eval $compile_ok && ./gnulibc; then
5555 echo "You are using the GNU C Library"
5558 echo "You are not using the GNU C Library"
5564 : see if nm is to be used to determine whether a symbol is defined or not
5568 case "$d_gnulibc" in
5571 echo "nm probably won't work on the GNU C Library." >&4
5577 if $test "$osname" = aix -a ! -f /lib/syscalls.exp; then
5579 echo "Whoops! This is an AIX system without /lib/syscalls.exp!" >&4
5580 echo "'nm' won't be sufficient on this sytem." >&4
5586 '') dflt=`$egrep 'inlibc|csym' $rsrc/Configure | wc -l 2>/dev/null`
5587 if $test $dflt -gt 20; then
5597 true|$define) dflt=y;;
5604 I can use $nm to extract the symbols from your C libraries. This
5605 is a time consuming task which may generate huge output on the disk (up
5606 to 3 megabytes) but that should make the symbols extraction faster. The
5607 alternative is to skip the 'nm' extraction part and to compile a small
5608 test program instead to determine whether each symbol is present. If
5609 you have a fast C compiler and/or if your 'nm' output cannot be parsed,
5610 this may be the best solution.
5612 You probably shouldn't let me use 'nm' if you are using the GNU C Library.
5615 rp="Shall I use $nm to extract C symbols from the libraries?"
5618 [Nn]*) usenm=false;;
5627 : nm options which may be necessary
5629 '') if $test -f /mach_boot; then
5631 elif $test -d /usr/ccs/lib; then
5632 nm_opt='-p' # Solaris (and SunOS?)
5633 elif $test -f /dgux; then
5635 elif $test -f /lib64/rld; then
5636 nm_opt='-p' # 64-bit Irix
5642 : nm options which may be necessary for shared libraries but illegal
5643 : for archive libraries. Thank you, Linux.
5644 case "$nm_so_opt" in
5645 '') case "$myuname" in
5647 if $nm --help | $grep 'dynamic' > /dev/null 2>&1; then
5648 nm_so_opt='--dynamic'
5657 : get list of predefined functions in a handy place
5662 *-lc_s*) libc=`./loc libc_s$_a $libc $libpth`
5669 *) for thislib in $libs; do
5672 : Handle C library specially below.
5675 thislib=`echo $thislib | $sed -e 's/^-l//'`
5676 if try=`./loc lib$thislib.$so.'*' X $libpth`; $test -f "$try"; then
5678 elif try=`./loc lib$thislib.$so X $libpth`; $test -f "$try"; then
5680 elif try=`./loc lib$thislib$_a X $libpth`; $test -f "$try"; then
5682 elif try=`./loc $thislib$_a X $libpth`; $test -f "$try"; then
5684 elif try=`./loc lib$thislib X $libpth`; $test -f "$try"; then
5686 elif try=`./loc $thislib X $libpth`; $test -f "$try"; then
5688 elif try=`./loc Slib$thislib$_a X $xlibpth`; $test -f "$try"; then
5693 libnames="$libnames $try"
5695 *) libnames="$libnames $thislib" ;;
5704 for xxx in $libpth; do
5705 $test -r $1 || set $xxx/libc.$so
5706 : The messy sed command sorts on library version numbers.
5708 set `echo blurfl; echo $xxx/libc.$so.[0-9]* | \
5709 tr ' ' $trnl | egrep -v '\.[A-Za-z]*$' | $sed -e '
5711 s/[0-9][0-9]*/0000&/g
5712 s/0*\([0-9][0-9][0-9][0-9][0-9]\)/\1/g
5715 sort | $sed -e 's/^.* //'`
5718 $test -r $1 || set /usr/ccs/lib/libc.$so
5719 $test -r $1 || set /lib/libsys_s$_a
5725 if $test -r "$1"; then
5726 echo "Your (shared) C library seems to be in $1."
5728 elif $test -r /lib/libc && $test -r /lib/clib; then
5729 echo "Your C library seems to be in both /lib/clib and /lib/libc."
5731 libc='/lib/clib /lib/libc'
5732 if $test -r /lib/syslib; then
5733 echo "(Your math library is in /lib/syslib.)"
5734 libc="$libc /lib/syslib"
5736 elif $test -r "$libc" || (test -h "$libc") >/dev/null 2>&1; then
5737 echo "Your C library seems to be in $libc, as you said before."
5738 elif $test -r $incpath/usr/lib/libc$_a; then
5739 libc=$incpath/usr/lib/libc$_a;
5740 echo "Your C library seems to be in $libc. That's fine."
5741 elif $test -r /lib/libc$_a; then
5743 echo "Your C library seems to be in $libc. You're normal."
5745 if tans=`./loc libc$_a blurfl/dyick $libpth`; $test -r "$tans"; then
5747 elif tans=`./loc libc blurfl/dyick $libpth`; $test -r "$tans"; then
5748 libnames="$libnames "`./loc clib blurfl/dyick $libpth`
5749 elif tans=`./loc clib blurfl/dyick $libpth`; $test -r "$tans"; then
5751 elif tans=`./loc Slibc$_a blurfl/dyick $xlibpth`; $test -r "$tans"; then
5753 elif tans=`./loc Mlibc$_a blurfl/dyick $xlibpth`; $test -r "$tans"; then
5756 tans=`./loc Llibc$_a blurfl/dyick $xlibpth`
5758 if $test -r "$tans"; then
5759 echo "Your C library seems to be in $tans, of all places."
5765 if $test $xxx = apollo -o -r "$libc" || (test -h "$libc") >/dev/null 2>&1; then
5769 If the guess above is wrong (which it might be if you're using a strange
5770 compiler, or your machine supports multiple models), you can override it here.
5775 echo $libpth | tr ' ' $trnl | sort | uniq > libpath
5777 I can't seem to find your C library. I've looked in the following places:
5780 $sed 's/^/ /' libpath
5783 None of these seems to contain your C library. I need to get its name...
5788 rp='Where is your C library?'
5793 echo $libc $libnames | tr ' ' $trnl | sort | uniq > libnames
5794 set X `cat libnames`
5797 case $# in 1) xxx=file; esac
5798 echo "Extracting names from the following $xxx for later perusal:" >&4
5800 $sed 's/^/ /' libnames >&4
5802 $echo $n "This may take a while...$c" >&4
5806 *$so*) $nm $nm_so_opt $nm_opt $file 2>/dev/null;;
5807 *) $nm $nm_opt $file 2>/dev/null;;
5812 $grep fprintf libc.tmp > libc.ptf
5813 xscan='eval "<libc.ptf $com >libc.list"; $echo $n ".$c" >&4'
5814 xrun='eval "<libc.tmp $com >libc.list"; echo "done" >&4'
5816 if com="$sed -n -e 's/__IO//' -e 's/^.* $xxx *_[_.]*//p' -e 's/^.* $xxx *//p'";\
5818 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5820 elif com="$sed -n -e 's/^__*//' -e 's/^\([a-zA-Z_0-9$]*\).*xtern.*/\1/p'";\
5822 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5824 elif com="$sed -n -e '/|UNDEF/d' -e '/FUNC..GL/s/^.*|__*//p'";\
5826 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5828 elif com="$sed -n -e 's/^.* D __*//p' -e 's/^.* D //p'";\
5830 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5832 elif com="$sed -n -e 's/^_//' -e 's/^\([a-zA-Z_0-9]*\).*xtern.*text.*/\1/p'";\
5834 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5836 elif com="$sed -n -e 's/^.*|FUNC |GLOB .*|//p'";\
5838 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5840 elif com="$grep '|' | $sed -n -e '/|COMMON/d' -e '/|DATA/d' \
5841 -e '/ file/d' -e 's/^\([^ ]*\).*/\1/p'";\
5843 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5845 elif com="$sed -n -e 's/^.*|FUNC |GLOB .*|//p' -e 's/^.*|FUNC |WEAK .*|//p'";\
5847 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5849 elif com="$sed -n -e 's/^__//' -e '/|Undef/d' -e '/|Proc/s/ .*//p'";\
5851 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5853 elif com="$sed -n -e 's/^.*|Proc .*|Text *| *//p'";\
5855 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5857 elif com="$sed -n -e '/Def. Text/s/.* \([^ ]*\)\$/\1/p'";\
5859 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5861 elif com="$sed -n -e 's/^[-0-9a-f ]*_\(.*\)=.*/\1/p'";\
5863 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5865 elif com="$sed -n -e 's/.*\.text n\ \ \ \.//p'";\
5867 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5869 elif com="sed -n -e 's/^__.*//' -e 's/[ ]*D[ ]*[0-9]*.*//p'";\
5871 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5874 $nm -p $* 2>/dev/null >libc.tmp
5875 $grep fprintf libc.tmp > libc.ptf
5876 if com="$sed -n -e 's/^.* [ADTSIW] *_[_.]*//p' -e 's/^.* [ADTSIW] //p'";\
5877 eval $xscan; $contains '^fprintf$' libc.list >/dev/null 2>&1
5883 echo "$nm didn't seem to work right. Trying $ar instead..." >&4
5885 if $ar t $libc > libc.tmp && $contains '^fprintf$' libc.tmp >/dev/null 2>&1; then
5886 for thisname in $libnames $libc; do
5887 $ar t $thisname >>libc.tmp
5889 $sed -e "s/\\$_o\$//" < libc.tmp > libc.list
5891 elif test "X$osname" = "Xos2" && $ar tv $libc > libc.tmp; then
5892 # Repeat libc to extract forwarders to DLL entries too
5893 for thisname in $libnames $libc; do
5894 $ar tv $thisname >>libc.tmp
5895 # Revision 50 of EMX has bug in $ar.
5896 # it will not extract forwarders to DLL entries
5897 # Use emximp which will extract exactly them.
5898 emximp -o tmp.imp $thisname \
5900 $sed -e 's/^\([_a-zA-Z0-9]*\) .*$/\1/p' \
5901 < tmp.imp >>libc.tmp
5904 $sed -e "s/\\$_o\$//" -e 's/^ \+//' < libc.tmp > libc.list
5907 echo "$ar didn't seem to work right." >&4
5908 echo "Maybe this is a Cray...trying bld instead..." >&4
5909 if bld t $libc | $sed -e 's/.*\///' -e "s/\\$_o:.*\$//" > libc.list
5911 for thisname in $libnames; do
5913 $sed -e 's/.*\///' -e "s/\\$_o:.*\$//" >>libc.list
5914 $ar t $thisname >>libc.tmp
5918 echo "That didn't work either. Giving up." >&4
5925 if $test -f /lib/syscalls.exp; then
5927 echo "Also extracting names from /lib/syscalls.exp for good ole AIX..." >&4
5928 $sed -n 's/^\([^ ]*\)[ ]*syscall[0-9]*$/\1/p' /lib/syscalls.exp >>libc.list
5932 $rm -f libnames libpath
5934 : see if dld is available
5938 : is a C symbol defined?
5941 -v) tf=libc.tmp; tc=""; tdc="";;
5942 -a) tf=libc.tmp; tc="[0]"; tdc="[]";;
5943 *) tlook="^$1\$"; tf=libc.list; tc="()"; tdc="()";;
5946 case "$reuseval-$4" in
5948 true-*) tx=no; eval "tval=\$$4"; case "$tval" in "") tx=yes;; esac;;
5954 if $contains $tlook $tf >/dev/null 2>&1;
5959 echo "int main() { extern short $1$tdc; printf(\"%hd\", $1$tc); }" > t.c;
5960 if $cc $optimize $ccflags $ldflags -o t t.c $libs >/dev/null 2>&1;
5968 $define) tval=true;;
5974 : define an is-in-libc? function
5975 inlibc='echo " "; td=$define; tu=$undef;
5976 sym=$1; var=$2; eval "was=\$$2";
5978 case "$reuseval$was" in
5988 echo "$sym() found." >&4;
5989 case "$was" in $undef) . ./whoa; esac; eval "$var=\$td";;
5991 echo "$sym() NOT found." >&4;
5992 case "$was" in $define) . ./whoa; esac; eval "$var=\$tu";;
5996 $define) echo "$sym() found." >&4;;
5997 *) echo "$sym() NOT found." >&4;;
6001 : see if dlopen exists
6008 : determine which dynamic loading, if any, to compile in
6010 dldir="ext/DynaLoader"
6023 $define) dflt='y' ;;
6026 $define) dflt='y' ;;
6028 : Does a dl_xxx.xs file exist for this operating system
6029 $test -f $rsrc/$dldir/dl_${osname}.xs && dflt='y'
6032 rp="Do you wish to use dynamic loading?"
6039 if $test -f $rsrc/$dldir/dl_${osname}.xs ; then
6040 dflt="$dldir/dl_${osname}.xs"
6041 elif $test "$d_dlopen" = "$define" ; then
6042 dflt="$dldir/dl_dlopen.xs"
6043 elif $test "$i_dld" = "$define" ; then
6044 dflt="$dldir/dl_dld.xs"
6049 *) dflt="$dldir/$dlsrc"
6052 echo "The following dynamic loading files are available:"
6053 : Can not go over to $dldir because getfile has path hard-coded in.
6054 tdir=`pwd`; cd $rsrc; $ls -C $dldir/dl*.xs; cd $tdir
6055 rp="Source file to use for dynamic loading"
6061 dlsrc=`echo $ans | $sed -e 's%.*/\([^/]*\)$%\1%'`
6065 Some systems may require passing special flags to $cc -c to
6066 compile modules that will be used to create a shared library.
6067 To use no flags, say "none".
6070 case "$cccdlflags" in
6071 '') case "$gccversion" in
6072 '') case "$osname" in
6074 next) dflt='none' ;;
6075 irix*) dflt='-KPIC' ;;
6076 svr4*|esix*|solaris) dflt='-KPIC' ;;
6077 sunos) dflt='-pic' ;;
6081 *) case "$osname" in
6082 svr4*|esix*|solaris) dflt='-fPIC' ;;
6087 *) dflt="$cccdlflags" ;;
6089 rp="Any special flags to pass to $cc -c to compile shared library modules?"
6092 none) cccdlflags=' ' ;;
6093 *) cccdlflags="$ans" ;;
6098 Some systems use ld to create libraries that can be dynamically loaded,
6099 while other systems (such as those using ELF) use $cc.
6103 '') $cat >try.c <<'EOM'
6104 /* Test for whether ELF binaries are produced */
6109 int i = open("a.out",O_RDONLY);
6112 if(read(i,b,4)==4 && b[0]==127 && b[1]=='E' && b[2]=='L' && b[3]=='F')
6113 exit(0); /* succeed (yes, it's ELF) */
6118 if $cc $ccflags try.c >/dev/null 2>&1 && ./a.out; then
6120 You appear to have ELF support. I'll use $cc to build dynamic libraries.
6124 echo "I'll use ld to build dynamic libraries."
6133 rp="What command should be used to create dynamic libraries?"
6139 Some systems may require passing special flags to $ld to create a
6140 library that can be dynamically loaded. If your ld flags include
6141 -L/other/path options to locate libraries outside your loader's normal
6142 search path, you may need to specify those -L options here as well. To
6143 use no flags, say "none".
6146 case "$lddlflags" in
6147 '') case "$osname" in
6148 beos) dflt='-nostart' ;;
6149 hpux) dflt='-b +vnocompatwarnings' ;;
6150 linux|irix*) dflt='-shared' ;;
6151 next) dflt='none' ;;
6152 solaris) dflt='-G' ;;
6153 sunos) dflt='-assert nodefinitions' ;;
6154 svr4*|esix*) dflt="-G $ldflags" ;;
6158 *) dflt="$lddlflags" ;;
6161 : Try to guess additional flags to pick up local libraries.
6162 : Be careful not to append to a plain 'none'
6166 for thisflag in $ldflags; do
6171 *) dflt="$dflt $thisflag" ;;
6178 ''|' ') dflt='none' ;;
6181 rp="Any special flags to pass to $ld to create a dynamically loaded library?"
6184 none) lddlflags=' ' ;;
6185 *) lddlflags="$ans" ;;
6190 Some systems may require passing special flags to $cc to indicate that
6191 the resulting executable will use dynamic linking. To use no flags,
6195 case "$ccdlflags" in
6196 '') case "$osname" in
6197 hpux) dflt='-Wl,-E' ;;
6198 linux) dflt='-rdynamic' ;;
6199 next) dflt='none' ;;
6200 sunos) dflt='none' ;;
6204 *) dflt="$ccdlflags" ;;
6206 rp="Any special flags to pass to $cc to use dynamic linking?"
6209 none) ccdlflags=' ' ;;
6210 *) ccdlflags="$ans" ;;
6224 # No dynamic loading being used, so don't bother even to prompt.
6227 *) case "$useshrplib" in
6228 '') case "$osname" in
6229 svr4*|dgux|dynixptx|esix|powerux|beos|cygwin*)
6231 also='Building a shared libperl is required for dynamic loading to work on your system.'
6236 also='Building a shared libperl is needed for MAB support.'
6254 The perl executable is normally obtained by linking perlmain.c with
6255 libperl${_a}, any static extensions (usually just DynaLoader), and
6256 any other libraries needed on this system (such as -lm, etc.). Since
6257 your system supports dynamic loading, it is probably possible to build
6258 a shared libperl.$so. If you will have more than one executable linked
6259 to libperl.$so, this will significantly reduce the size of each
6260 executable, but it may have a noticeable affect on performance. The
6261 default is probably sensible for your system.
6265 rp="Build a shared libperl.$so (y/n)"
6269 useshrplib='true' ;;
6270 *) useshrplib='false' ;;
6275 case "$useshrplib" in
6279 # Figure out a good name for libperl.so. Since it gets stored in
6280 # a version-specific architecture-dependent library, the version
6281 # number isn't really that important, except for making cc/ld happy.
6283 # A name such as libperl.so.3.1
6284 majmin="libperl.$so.$patchlevel.$subversion"
6285 # A name such as libperl.so.301
6286 majonly=`echo $patchlevel $subversion |
6287 $awk '{printf "%d%02d", $1, $2}'`
6288 majonly=libperl.$so.$majonly
6289 # I'd prefer to keep the os-specific stuff here to a minimum, and
6290 # rely on figuring it out from the naming of libc.
6291 case "${osname}${osvers}" in
6294 # XXX How handle the --version stuff for MAB?
6296 linux*) # ld won't link with a bare -lperl otherwise.
6299 cygwin*) # include version
6300 dflt=`echo libperl$version | sed -e 's/\./_/g'`$lib_ext
6302 *) # Try to guess based on whether libc has major.minor.
6304 *libc.$so.[0-9]*.[0-9]*) dflt=$majmin ;;
6305 *libc.$so.[0-9]*) dflt=$majonly ;;
6306 *) dflt=libperl.$so ;;
6316 I need to select a good name for the shared libperl. If your system uses
6317 library names with major and minor numbers, then you might want something
6318 like $majmin. Alternatively, if your system uses a single version
6319 number for shared libraries, then you might want to use $majonly.
6320 Or, your system might be quite happy with a simple libperl.$so.
6322 Since the shared libperl will get installed into a version-specific
6323 architecture-dependent directory, the version number of the shared perl
6324 library probably isn't important, so the default should be o.k.
6327 rp='What name do you want to give to the shared libperl?'
6330 echo "Ok, I'll use $libperl"
6333 libperl="libperl${_a}"
6337 # Detect old use of shrpdir via undocumented Configure -Dshrpdir
6341 WARNING: Use of the shrpdir variable for the installation location of
6342 the shared $libperl is not supported. It was never documented and
6343 will not work in this version. Let me (perlbug@perl.com)
6344 know of any problems this may cause.
6350 But your current setting of $shrpdir is
6351 the default anyway, so it's harmless.
6356 Further, your current attempted setting of $shrpdir
6357 conflicts with the value of $archlibexp/CORE
6358 that installperl will use.
6365 # How will the perl executable find the installed shared $libperl?
6366 # Add $xxx to ccdlflags.
6367 # If we can't figure out a command-line option, use $shrpenv to
6368 # set env LD_RUN_PATH. The main perl makefile uses this.
6369 shrpdir=$archlibexp/CORE
6372 if "$useshrplib"; then
6375 # We'll set it in Makefile.SH...
6381 xxx="-Wl,-R$shrpdir"
6383 linux|irix*|dec_osf)
6384 xxx="-Wl,-rpath,$shrpdir"
6387 # next doesn't like the default...
6390 # beos doesn't like the default, either.
6393 # hpux doesn't like the default, either.
6394 tmp_shrpenv="env LDOPTS=\"+s +b${shrpdir}\""
6397 tmp_shrpenv="env LD_RUN_PATH=$shrpdir"
6403 # Only add $xxx if it isn't already in ccdlflags.
6404 case " $ccdlflags " in
6406 *) ccdlflags="$ccdlflags $xxx"
6409 Adding $xxx to the flags
6410 passed to $ld so that the perl executable will find the
6411 installed shared $libperl.
6419 # Fix ccdlflags in AIX for building external extensions.
6420 # (For building Perl itself bare -bE:perl.exp is needed,
6421 # Makefile.SH takes care of this.)
6423 aix) ccdlflags="$ccdlflags -bE:$installarchlib/CORE/perl.exp" ;;
6425 # Respect a hint or command-line value.
6427 '') shrpenv="$tmp_shrpenv" ;;
6429 case "$ldlibpthname" in
6430 '') ldlibpthname=LD_LIBRARY_PATH ;;
6431 none) ldlibpthname='' ;;
6434 : determine where manual pages go
6435 set man1dir man1dir none
6439 $spackage has manual pages available in source form.
6443 echo "However, you don't have nroff, so they're probably useless to you."
6445 '') man1dir="none";;
6448 echo "If you don't want the manual sources installed, answer 'none'."
6453 lookpath="$prefixexp/man/man1 $prefixexp/man/l_man/man1"
6454 lookpath="$lookpath $prefixexp/man/p_man/man1"
6455 lookpath="$lookpath $prefixexp/man/u_man/man1"
6456 lookpath="$lookpath $prefixexp/man/man.1"
6458 */?_man*) dflt=`./loc . $prefixexp/l_man/man1 $lookpath` ;;
6459 *) dflt=`./loc . $prefixexp/man/man1 $lookpath` ;;
6469 rp="Where do the main $spackage manual pages (source) go?"
6471 if $test "X$man1direxp" != "X$ansexp"; then
6475 man1direxp="$ansexp"
6481 : Change installation prefix, if necessary.
6482 if $test X"$prefix" != X"$installprefix"; then
6483 installman1dir=`echo $man1direxp | $sed "s#^$prefix#$installprefix#"`
6485 installman1dir="$man1direxp"
6488 : What suffix to use on installed man pages
6495 rp="What suffix should be used for the main $spackage man pages?"
6497 '') case "$man1dir" in
6511 *) dflt="$man1ext";;
6518 : see if we can have long filenames
6520 rmlist="$rmlist /tmp/cf$$"
6521 $test -d /tmp/cf$$ || mkdir /tmp/cf$$
6522 first=123456789abcdef
6523 second=/tmp/cf$$/$first
6524 $rm -f $first $second
6525 if (echo hi >$first) 2>/dev/null; then
6526 if $test -f 123456789abcde; then
6527 echo 'You cannot have filenames longer than 14 characters. Sigh.' >&4
6530 if (echo hi >$second) 2>/dev/null; then
6531 if $test -f /tmp/cf$$/123456789abcde; then
6533 That's peculiar... You can have filenames longer than 14 characters, but only
6534 on some of the filesystems. Maybe you are using NFS. Anyway, to avoid problems
6535 I shall consider your system cannot support long filenames at all.
6539 echo 'You can have filenames longer than 14 characters.' >&4
6544 How confusing! Some of your filesystems are sane enough to allow filenames
6545 longer than 14 characters but some others like /tmp can't even think about them.
6546 So, for now on, I shall assume your kernel does not allow them at all.
6553 You can't have filenames longer than 14 chars. You can't even think about them!
6559 $rm -rf /tmp/cf$$ 123456789abcde*
6561 : determine where library module manual pages go
6562 set man3dir man3dir none
6566 $spackage has manual pages for many of the library modules.
6572 However, you don't have nroff, so they're probably useless to you.
6575 '') man3dir="none";;
6579 case "$d_flexfnam" in
6582 However, your system can't handle the long file names like File::Basename.3.
6585 '') man3dir="none";;
6589 echo "If you don't want the manual sources installed, answer 'none'."
6590 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
6592 '') dflt=`echo $man1dir | $sed -e 's/man1/man3/g' -e 's/man\.1/man\.3/g'`
6593 if $test -d "$privlib/man/man3"; then
6596 WARNING: Previous versions of perl installed man3 pages into
6597 $privlib/man/man3. This version will suggest a
6598 new default of $dflt.
6602 rp='Do you wish to preserve the old behavior?(y/n)'
6605 y*) dflt="$privlib/man/man3" ;;
6611 *) dflt="$man3dir" ;;
6615 rp="Where do the $package library man pages (source) go?"
6618 man3direxp="$ansexp"
6624 : Change installation prefix, if necessary.
6625 if $test X"$prefix" != X"$installprefix"; then
6626 installman3dir=`echo $man3direxp | $sed "s#^$prefix#$installprefix#"`
6628 installman3dir="$man3direxp"
6631 : What suffix to use on installed man pages
6637 rp="What suffix should be used for the $package library man pages?"
6639 '') case "$man3dir" in
6653 *) dflt="$man3ext";;
6660 : see if we have to deal with yellow pages, now NIS.
6661 if $test -d /usr/etc/yp || $test -d /etc/yp; then
6662 if $test -f /usr/etc/nibindd; then
6664 echo "I'm fairly confident you're on a NeXT."
6666 rp='Do you get the hosts file via NetInfo?'
6675 y*) hostcat='nidump hosts .';;
6676 *) case "$hostcat" in
6677 nidump*) hostcat='';;
6687 '') if $contains '^\+' /etc/passwd >/dev/null 2>&1; then
6695 rp='Are you getting the hosts file via yellow pages?'
6698 y*) hostcat='ypcat hosts';;
6699 *) hostcat='cat /etc/hosts';;
6705 '') test -f /etc/hosts && hostcat='cat /etc/hosts';;
6708 '') test -f /etc/group && groupcat='cat /etc/group';;
6711 '') test -f /etc/passwd && passcat='cat /etc/passwd';;
6714 : now get the host name
6716 echo "Figuring out host name..." >&4
6717 case "$myhostname" in
6719 echo 'Maybe "hostname" will work...'
6720 if tans=`sh -c hostname 2>&1` ; then
6728 if $test "$cont"; then
6730 echo 'Oh, dear. Maybe "/etc/systemid" is the key...'
6731 if tans=`cat /etc/systemid 2>&1` ; then
6733 phostname='cat /etc/systemid'
6734 echo "Whadyaknow. Xenix always was a bit strange..."
6737 elif $test -r /etc/systemid; then
6738 echo "(What is a non-Xenix system doing with /etc/systemid?)"
6741 if $test "$cont"; then
6742 echo 'No, maybe "uuname -l" will work...'
6743 if tans=`sh -c 'uuname -l' 2>&1` ; then
6745 phostname='uuname -l'
6747 echo 'Strange. Maybe "uname -n" will work...'
6748 if tans=`sh -c 'uname -n' 2>&1` ; then
6750 phostname='uname -n'
6752 echo 'Oh well, maybe I can mine it out of whoami.h...'
6753 if tans=`sh -c $contains' sysname $usrinc/whoami.h' 2>&1` ; then
6754 myhostname=`echo "$tans" | $sed 's/^.*"\(.*\)"/\1/'`
6755 phostname="sed -n -e '"'/sysname/s/^.*\"\\(.*\\)\"/\1/{'"' -e p -e q -e '}' <$usrinc/whoami.h"
6757 case "$myhostname" in
6758 '') echo "Does this machine have an identity crisis or something?"
6761 echo "Well, you said $myhostname before..."
6762 phostname='echo $myhostname';;
6768 : you do not want to know about this
6773 if $test "$myhostname" ; then
6775 rp='Your host name appears to be "'$myhostname'".'" Right?"
6783 : bad guess or no guess
6784 while $test "X$myhostname" = X ; do
6786 rp="Please type the (one word) name of your host:"
6791 : translate upper to lower if necessary
6792 case "$myhostname" in
6794 echo "(Normalizing case in your host name)"
6795 myhostname=`echo $myhostname | ./tr '[A-Z]' '[a-z]'`
6799 case "$myhostname" in
6801 dflt=`expr "X$myhostname" : "X[^.]*\(\..*\)"`
6802 myhostname=`expr "X$myhostname" : "X\([^.]*\)\."`
6803 echo "(Trimming domain name from host name--host name is now $myhostname)"
6805 *) case "$mydomain" in
6808 test "X$hostcat" = "Xypcat hosts" &&
6809 ypmatch "$myhostname" hosts 2>/dev/null |\
6810 $sed -e 's/[ ]*#.*//; s/$/ /' > hosts && \
6813 test "X$hostcat" != "X" &&
6814 $hostcat | $sed -n -e "s/[ ]*#.*//; s/\$/ /
6815 /[ ]$myhostname[ . ]/p" > hosts
6818 $test x`$awk "/[0-9].*[ ]$myhostname$tmp_re/ { sum++ }
6819 END { print sum }" hosts` = x1 || tmp_re="[ ]"
6820 dflt=.`$awk "/[0-9].*[ ]$myhostname$tmp_re/ {for(i=2; i<=NF;i++) print \\\$i}" \
6821 hosts | $sort | $uniq | \
6822 $sed -n -e "s/$myhostname\.\([-a-zA-Z0-9_.]\)/\1/p"`
6823 case `$echo X$dflt` in
6824 X*\ *) echo "(Several hosts in /etc/hosts matched hostname)"
6827 X.) echo "(You do not have fully-qualified names in /etc/hosts)"
6832 tans=`./loc resolv.conf X /etc /usr/etc`
6833 if $test -f "$tans"; then
6834 echo "(Attempting domain name extraction from $tans)"
6835 dflt=.`$sed -n -e 's/ / /g' \
6836 -e 's/^search *\([^ ]*\).*/\1/p' $tans \
6837 | ./tr '[A-Z]' '[a-z]' 2>/dev/null`
6839 .) dflt=.`$sed -n -e 's/ / /g' \
6840 -e 's/^domain *\([^ ]*\).*/\1/p' $tans \
6841 | ./tr '[A-Z]' '[a-z]' 2>/dev/null`
6848 .) echo "(No help from resolv.conf either -- attempting clever guess)"
6849 dflt=.`sh -c domainname 2>/dev/null`
6852 .nis.*|.yp.*|.main.*) dflt=`echo $dflt | $sed -e 's/^\.[^.]*//'`;;
6857 .) echo "(Lost all hope -- silly guess then)"
6863 *) dflt="$mydomain";;
6867 rp="What is your domain name?"
6877 : translate upper to lower if necessary
6880 echo "(Normalizing case in your domain name)"
6881 mydomain=`echo $mydomain | ./tr '[A-Z]' '[a-z]'`
6885 : a little sanity check here
6886 case "$phostname" in
6889 case `$phostname | ./tr '[A-Z]' '[a-z]'` in
6890 $myhostname$mydomain|$myhostname) ;;
6892 case "$phostname" in
6894 echo "(That doesn't agree with your whoami.h file, by the way.)"
6897 echo "(That doesn't agree with your $phostname command, by the way.)"
6907 I need to get your e-mail address in Internet format if possible, i.e.
6908 something like user@host.domain. Please answer accurately since I have
6909 no easy means to double check it. The default value provided below
6910 is most probably close to reality but may not be valid from outside
6911 your organization...
6915 while test "$cont"; do
6917 '') dflt="$cf_by@$myhostname$mydomain";;
6918 *) dflt="$cf_email";;
6920 rp='What is your e-mail address?'
6926 rp='Address does not look like an Internet one. Use it anyway?'
6942 If you or somebody else will be maintaining perl at your site, please
6943 fill in the correct e-mail address here so that they may be contacted
6944 if necessary. Currently, the "perlbug" program included with perl
6945 will send mail to this address in addition to perlbug@perl.com. You may
6946 enter "none" for no administrator.
6949 case "$perladmin" in
6950 '') dflt="$cf_email";;
6951 *) dflt="$perladmin";;
6953 rp='Perl administrator e-mail address'
6957 : figure out how to guarantee perl startup
6958 case "$startperl" in
6960 case "$sharpbang" in
6964 I can use the #! construct to start perl on your system. This will
6965 make startup of perl scripts faster, but may cause problems if you
6966 want to share those scripts and perl is not in a standard place
6967 ($binexp/perl) on all your platforms. The alternative is to force
6968 a shell by starting the script with a single ':' character.
6972 rp='What shall I put after the #! to start up perl ("none" to not use #!)?'
6975 none) startperl=": # use perl";;
6976 *) startperl="#!$ans"
6977 if $test 30 -lt `echo "$ans" | wc -c`; then
6980 WARNING: Some systems limit the #! command to 32 characters.
6981 If you experience difficulty running Perl scripts with #!, try
6982 installing Perl in a directory with a shorter pathname.
6988 *) startperl=": # use perl"
6993 echo "I'll use $startperl to start perl scripts."
6995 : figure best path for perl in scripts
6998 perlpath="$binexp/perl"
6999 case "$startperl" in
7004 I will use the "eval 'exec'" idiom to start Perl on your system.
7005 I can use the full path of your Perl binary for this purpose, but
7006 doing so may cause problems if you want to share those scripts and
7007 Perl is not always in a standard place ($binexp/perl).
7011 rp="What path shall I use in \"eval 'exec'\"?"
7018 case "$startperl" in
7020 *) echo "I'll use $perlpath in \"eval 'exec'\"" ;;
7023 : determine where public executable scripts go
7024 set scriptdir scriptdir
7026 case "$scriptdir" in
7029 : guess some guesses
7030 $test -d /usr/share/scripts && dflt=/usr/share/scripts
7031 $test -d /usr/share/bin && dflt=/usr/share/bin
7032 $test -d /usr/local/script && dflt=/usr/local/script
7033 $test -d /usr/local/scripts && dflt=/usr/local/scripts
7034 $test -d $prefixexp/script && dflt=$prefixexp/script
7038 *) dflt="$scriptdir"
7043 Some installations have a separate directory just for executable scripts so
7044 that they can mount it across multiple architectures but keep the scripts in
7045 one spot. You might, for example, have a subdirectory of /usr/share for this.
7046 Or you might just lump your scripts in with all your other executables.
7050 rp='Where do you keep publicly executable scripts?'
7052 if $test "X$ansexp" != "X$scriptdirexp"; then
7056 scriptdirexp="$ansexp"
7057 : Change installation prefix, if necessary.
7058 if $test X"$prefix" != X"$installprefix"; then
7059 installscript=`echo $scriptdirexp | sed "s#^$prefix#$installprefix#"`
7061 installscript="$scriptdirexp"
7064 : determine where site specific architecture-dependent libraries go.
7065 : sitelib default is /usr/local/lib/perl5/site_perl/$version
7066 : sitearch default is /usr/local/lib/perl5/site_perl/$version/$archname
7067 : sitelib may have an optional trailing /share.
7069 '') dflt=`echo $sitelib | $sed 's,/share$,,'`
7070 dflt="$dflt/$archname"
7075 set sitearch sitearch none
7079 The installation process will also create a directory for
7080 architecture-dependent site-specific extensions and modules.
7084 rp='Pathname for the site-specific architecture-dependent library files?'
7087 sitearchexp="$ansexp"
7088 : Change installation prefix, if necessary.
7089 if $test X"$prefix" != X"$installprefix"; then
7090 installsitearch=`echo $sitearchexp | sed "s#^$prefix#$installprefix#"`
7092 installsitearch="$sitearchexp"
7095 : determine where add-on public executables go
7097 '') dflt=$siteprefix/bin ;;
7101 rp='Pathname where the add-on public executables should be installed?'
7104 sitebinexp="$ansexp"
7105 : Change installation prefix, if necessary.
7106 if $test X"$prefix" != X"$installprefix"; then
7107 installsitebin=`echo $sitebinexp | sed "s#^$prefix#$installprefix#"`
7109 installsitebin="$sitebinexp"
7112 : see if sqrtl exists
7117 *-DUSE_LONG_DOUBLE*|*-DUSE_MORE_BITS*) uselongdouble="$define" ;;
7120 case "$uselongdouble" in
7121 $define|true|[yY]*) dflt='y';;
7126 Perl can be built to take advantage of long doubles which
7127 (if available) may give more accuracy and range for floating point numbers.
7129 If this doesn't make any sense to you, just accept the default '$dflt'.
7131 rp='Try to use long doubles if available?'
7134 y|Y) val="$define" ;;
7140 case "$uselongdouble" in
7141 true|[yY]*) uselongdouble="$define" ;;
7144 case "$uselongdouble" in
7146 : Look for a hint-file generated 'call-back-unit'. If the
7147 : user has specified that long doubles should be used,
7148 : we may need to set or change some other defaults.
7149 if $test -f uselongdouble.cbu; then
7150 echo "Your platform has some specific hints for long doubles, using them..."
7151 . ./uselongdouble.cbu
7154 (Your platform doesn't have any specific hints for long doubles.)
7160 case "$uselongdouble:$d_sqrtl" in
7164 You requested the use of long doubles but you do not seem to have
7165 the mathematic functions for long doubles. I'm disabling the use
7168 uselongdouble=$undef
7172 case "$useperlio" in
7173 $define|true|[yY]*) dflt='y';;
7178 Previous version of $package used the standard IO mechanisms as defined
7179 in <stdio.h>. Versions 5.003_02 and later of perl allow alternate IO
7180 mechanisms via a "PerlIO" abstraction, but the stdio mechanism is still
7181 the default. This abstraction layer can use AT&T's sfio (if you already
7182 have sfio installed) or regular stdio. Using PerlIO with sfio may cause
7183 problems with some extension modules. Using PerlIO with stdio is safe,
7184 but it is slower than plain stdio and therefore is not the default.
7186 If this doesn't make any sense to you, just accept the default '$dflt'.
7188 rp='Use the experimental PerlIO abstraction layer?'
7195 echo "Ok, doing things the stdio way"
7202 case "$vendorprefix" in
7203 '') d_vendorbin="$undef"
7207 *) d_vendorbin="$define"
7208 : determine where vendor-supplied executables go.
7209 case "$vendorbin" in
7210 '') dflt=$vendorprefix/bin ;;
7211 *) dflt="$vendorbin" ;;
7214 rp='Pathname for the vendor-supplied executables directory?'
7217 vendorbinexp="$ansexp"
7220 : Change installation prefix, if necessary.
7221 if $test X"$prefix" != X"$installprefix"; then
7222 installvendorbin=`echo $vendorbinexp | $sed "s#^$prefix#$installprefix#"`
7224 installvendorbin="$vendorbinexp"
7227 : check for length of double
7229 case "$doublesize" in
7231 echo "Checking to see how big your double precision numbers are..." >&4
7232 $cat >try.c <<'EOCP'
7236 printf("%d\n", (int)sizeof(double));
7241 if eval $compile_ok; then
7243 echo "Your double is $doublesize bytes long."
7246 echo "(I can't seem to compile the test program. Guessing...)"
7247 rp="What is the size of a double precision number (in bytes)?"
7255 : check for long doubles
7257 echo "Checking to see if you have long double..." >&4
7258 echo 'int main() { long double x = 7.0; }' > try.c
7260 if eval $compile; then
7262 echo "You have long double."
7265 echo "You do not have long double."
7271 : check for length of long double
7272 case "${d_longdbl}${longdblsize}" in
7275 echo "Checking to see how big your long doubles are..." >&4
7276 $cat >try.c <<'EOCP'
7280 printf("%d\n", sizeof(long double));
7285 if eval $compile; then
7286 longdblsize=`./try$exe_ext`
7287 echo "Your long doubles are $longdblsize bytes long."
7291 echo "(I can't seem to compile the test program. Guessing...)" >&4
7292 rp="What is the size of a long double (in bytes)?"
7296 if $test "X$doublesize" = "X$longdblsize"; then
7297 echo "(That isn't any different from an ordinary double.)"
7303 : Check how to convert floats to strings.
7304 if test "X$d_Gconvert" = X; then
7306 echo "Checking for an efficient way to convert floats to strings."
7309 #define Gconvert(x,n,t,b) gconvert((x),(n),(t),(b))
7310 char *myname = "gconvert";
7313 #define Gconvert(x,n,t,b) gcvt((x),(n),(b))
7314 char *myname = "gcvt";
7317 #define Gconvert(x,n,t,b) qgcvt((x),(n),(b))
7318 char *myname = "qgcvt";
7319 #define DOUBLETYPE long double
7322 #define Gconvert(x,n,t,b) sprintf((b),"%.*g",(n),(x))
7323 char *myname = "sprintf";
7327 #define DOUBLETYPE double
7332 #define I_STDLIB $i_stdlib
7338 checkit(expect, got)
7342 if (strcmp(expect, got)) {
7343 printf("%s oddity: Expected %s, got %s\n",
7344 myname, expect, got);
7354 /* This must be 1st test on (which?) platform */
7355 /* Alan Burlison <AlanBurlsin@unn.unisys.com> */
7356 Gconvert((DOUBLETYPE)0.1, 8, 0, buf);
7357 checkit("0.1", buf);
7359 Gconvert((DOUBLETYPE)1.0, 8, 0, buf);
7362 Gconvert((DOUBLETYPE)0.0, 8, 0, buf);
7365 Gconvert((DOUBLETYPE)-1.0, 8, 0, buf);
7368 /* Some Linux gcvt's give 1.e+5 here. */
7369 Gconvert((DOUBLETYPE)100000.0, 8, 0, buf);
7370 checkit("100000", buf);
7372 /* Some Linux gcvt's give -1.e+5 here. */
7373 Gconvert((DOUBLETYPE)-100000.0, 8, 0, buf);
7374 checkit("-100000", buf);
7379 case "$d_Gconvert" in
7380 gconvert*) xxx_list='gconvert gcvt sprintf' ;;
7381 gcvt*) xxx_list='gcvt gconvert sprintf' ;;
7382 sprintf*) xxx_list='sprintf gconvert gcvt' ;;
7383 *) xxx_list='gconvert gcvt sprintf' ;;
7386 case "$d_longdbl$uselongdouble" in
7387 definedefine) xxx_list="`echo $xxx_list|sed 's/gcvt/qgcvt gcvt/'`" ;;
7390 for xxx_convert in $xxx_list; do
7391 echo "Trying $xxx_convert..."
7393 set try -DTRY_$xxx_convert
7394 if eval $compile; then
7395 echo "$xxx_convert() found." >&4
7397 echo "I'll use $xxx_convert to convert floats into a string." >&4
7400 echo "...But $xxx_convert didn't work as I expected."
7403 echo "$xxx_convert NOT found." >&4
7407 case "$xxx_convert" in
7408 gconvert) d_Gconvert='gconvert((x),(n),(t),(b))' ;;
7409 gcvt) d_Gconvert='gcvt((x),(n),(b))' ;;
7410 qgcvt) d_Gconvert='qgcvt((x),(n),(b))' ;;
7411 *) d_Gconvert='sprintf((b),"%.*g",(n),(x))' ;;
7417 if $test X"$d_longdbl" = X"$define"; then
7419 echo "Checking how to print long doubles..." >&4
7421 if $test X"$sPRIfldbl" = X -a X"$doublesize" = X"$longdblsize"; then
7422 $cat >try.c <<'EOCP'
7423 #include <sys/types.h>
7427 printf("%.3f\n", d);
7431 if eval $compile; then
7435 sPRIfldbl='"f"'; sPRIgldbl='"g"'; sPRIeldbl='"e"';
7436 sPRIFldbl='"F"'; sPRIGldbl='"G"'; sPRIEldbl='"E"';
7437 echo "We will use %f."
7443 if $test X"$sPRIfldbl" = X; then
7444 $cat >try.c <<'EOCP'
7445 #include <sys/types.h>
7448 long double d = 123.456;
7449 printf("%.3llf\n", d);
7453 if eval $compile; then
7457 sPRIfldbl='"llf"'; sPRIgldbl='"llg"'; sPRIeldbl='"lle"';
7458 sPRIFldbl='"llF"'; sPRIGldbl='"llG"'; sPRIEldbl='"llE"';
7459 echo "We will use %llf."
7465 if $test X"$sPRIfldbl" = X; then
7466 $cat >try.c <<'EOCP'
7467 #include <sys/types.h>
7470 long double d = 123.456;
7471 printf("%.3Lf\n", d);
7475 if eval $compile; then
7479 sPRIfldbl='"Lf"'; sPRIgldbl='"Lg"'; sPRIeldbl='"Le"';
7480 sPRIFldbl='"LF"'; sPRIGldbl='"LG"'; sPRIEldbl='"LE"';
7481 echo "We will use %Lf."
7487 if $test X"$sPRIfldbl" = X; then
7488 $cat >try.c <<'EOCP'
7489 #include <sys/types.h>
7492 long double d = 123.456;
7493 printf("%.3lf\n", d);
7497 if eval $compile; then
7501 sPRIfldbl='"lf"'; sPRIgldbl='"lg"'; sPRIeldbl='"le"';
7502 sPRIFldbl='"lF"'; sPRIGldbl='"lG"'; sPRIEldbl='"lE"';
7503 echo "We will use %lf."
7509 if $test X"$sPRIfldbl" = X; then
7510 echo "Cannot figure out how to print long doubles." >&4
7517 case "$sPRIfldbl" in
7518 '') d_PRIfldbl="$undef"; d_PRIgldbl="$undef"; d_PRIeldbl="$undef";
7519 d_PRIFldbl="$undef"; d_PRIGldbl="$undef"; d_PRIEldbl="$undef";
7521 *) d_PRIfldbl="$define"; d_PRIgldbl="$define"; d_PRIeldbl="$define";
7522 d_PRIFldbl="$define"; d_PRIGldbl="$define"; d_PRIEldbl="$define";
7526 : Initialize h_fcntl
7529 : Initialize h_sysfile
7532 : access call always available on UNIX
7536 : locate the flags for 'access()'
7540 $cat >access.c <<'EOCP'
7541 #include <sys/types.h>
7546 #include <sys/file.h>
7555 : check sys/file.h first, no particular reason here
7556 if $test `./findhdr sys/file.h` && \
7557 $cc $cppflags -DI_SYS_FILE -o access access.c >/dev/null 2>&1 ; then
7559 echo "<sys/file.h> defines the *_OK access constants." >&4
7560 elif $test `./findhdr fcntl.h` && \
7561 $cc $cppflags -DI_FCNTL -o access access.c >/dev/null 2>&1 ; then
7563 echo "<fcntl.h> defines the *_OK access constants." >&4
7564 elif $test `./findhdr unistd.h` && \
7565 $cc $cppflags -DI_UNISTD -o access access.c >/dev/null 2>&1 ; then
7566 echo "<unistd.h> defines the *_OK access constants." >&4
7568 echo "I can't find the four *_OK access constants--I'll use mine." >&4
7574 : see if accessx exists
7575 set accessx d_accessx
7578 : see if alarm exists
7582 : see if atolf exists
7586 : see if atoll exists
7590 : Look for GNU-cc style attribute checking
7592 echo "Checking whether your compiler can handle __attribute__ ..." >&4
7593 $cat >attrib.c <<'EOCP'
7595 void croak (char* pat,...) __attribute__((format(printf,1,2),noreturn));
7597 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
7598 if $contains 'warning' attrib.out >/dev/null 2>&1; then
7599 echo "Your C compiler doesn't fully support __attribute__."
7602 echo "Your C compiler supports __attribute__."
7606 echo "Your C compiler doesn't seem to understand __attribute__ at all."
7613 : see if bcmp exists
7617 : see if bcopy exists
7621 : see if this is a unistd.h system
7622 set unistd.h i_unistd
7625 : see if getpgrp exists
7626 set getpgrp d_getpgrp
7629 case "$d_getpgrp" in
7632 echo "Checking to see which flavor of getpgrp is in use..."
7635 #include <sys/types.h>
7637 # include <unistd.h>
7641 if (getuid() == 0) {
7642 printf("(I see you are running Configure as super-user...)\n");
7646 if (getpgrp(1) == 0)
7655 if $cc -DTRY_BSD_PGRP $ccflags $ldflags -o set set.c $libs >/dev/null 2>&1 && ./set; then
7656 echo "You have to use getpgrp(pid) instead of getpgrp()." >&4
7658 elif $cc $ccflags $ldflags -o set set.c $libs >/dev/null 2>&1 && ./set; then
7659 echo "You have to use getpgrp() instead of getpgrp(pid)." >&4
7662 echo "I can't seem to compile and run the test program."
7664 xxx="a USG one, i.e. you use getpgrp()."
7666 # SVR4 systems can appear rather BSD-ish.
7669 xxx="a BSD one, i.e. you use getpgrp(pid)."
7673 xxx="probably a USG one, i.e. you use getpgrp()."
7678 echo "Assuming your getpgrp is $xxx" >&4
7687 : see if setpgrp exists
7688 set setpgrp d_setpgrp
7691 case "$d_setpgrp" in
7694 echo "Checking to see which flavor of setpgrp is in use..."
7697 #include <sys/types.h>
7699 # include <unistd.h>
7703 if (getuid() == 0) {
7704 printf("(I see you are running Configure as super-user...)\n");
7708 if (-1 == setpgrp(1, 1))
7711 if (setpgrp() != -1)
7717 if $cc -DTRY_BSD_PGRP $ccflags $ldflags -o set set.c $libs >/dev/null 2>&1 && ./set; then
7718 echo 'You have to use setpgrp(pid,pgrp) instead of setpgrp().' >&4
7720 elif $cc $ccflags $ldflags -o set set.c $libs >/dev/null 2>&1 && ./set; then
7721 echo 'You have to use setpgrp() instead of setpgrp(pid,pgrp).' >&4
7724 echo "(I can't seem to compile and run the test program.)"
7726 xxx="a USG one, i.e. you use setpgrp()."
7728 # SVR4 systems can appear rather BSD-ish.
7731 xxx="a BSD one, i.e. you use setpgrp(pid,pgrp)."
7735 xxx="probably a USG one, i.e. you use setpgrp()."
7740 echo "Assuming your setpgrp is $xxx" >&4
7748 : see if bzero exists
7752 : see if signal is declared as pointer to function returning int or void
7754 xxx=`./findhdr signal.h`
7755 $test "$xxx" && $cppstdin $cppminus $cppflags < $xxx >$$.tmp 2>/dev/null
7756 if $contains 'int.*\*[ ]*signal' $$.tmp >/dev/null 2>&1 ; then
7757 echo "You have int (*signal())() instead of void." >&4
7759 elif $contains 'void.*\*[ ]*signal' $$.tmp >/dev/null 2>&1 ; then
7760 echo "You have void (*signal())()." >&4
7762 elif $contains 'extern[ ]*[(\*]*signal' $$.tmp >/dev/null 2>&1 ; then
7763 echo "You have int (*signal())() instead of void." >&4
7765 elif $contains 'void.*\*.*sig' $$.tmp >/dev/null 2>&1 ; then
7766 echo "You have void (*signal())()." >&4
7769 case "$d_voidsig" in
7771 echo "I can't determine whether signal handler returns void or int..." >&4
7773 rp="What type does your signal handler return?"
7780 echo "As you already told me, signal handler returns void." >&4
7783 *) echo "As you already told me, signal handler returns int." >&4
7790 case "$d_voidsig" in
7791 "$define") signal_t="void";;
7796 : check for ability to cast large floats to 32-bit ints.
7798 echo 'Checking whether your C compiler can cast large floats to int32.' >&4
7799 if $test "$intsize" -ge 4; then
7806 #include <sys/types.h>
7808 $signal_t blech(s) int s; { exit(3); }
7815 signal(SIGFPE, blech);
7817 /* Don't let compiler optimize the test away. Store the number
7818 in a writable string for gcc to pass to sscanf under HP/UX.
7820 sprintf(str, "2147483647");
7821 sscanf(str, "%lf", &f); /* f = (double) 0x7fffffff; */
7825 /* x86 processors will probably give 0x8000 0000, which is a
7826 sign change. We don't want that. We want to mimic SPARC
7827 behavior here, which is to preserve the sign and give
7830 if (i32 != ($xxx) f)
7836 if eval $compile_ok; then
7840 echo "(I can't seem to compile the test program--assuming it can't)"
7848 echo "Nope, it can't."
7855 : check for ability to cast negative floats to unsigned
7857 echo 'Checking whether your C compiler can cast negative float to unsigned.' >&4
7860 #include <sys/types.h>
7862 $signal_t blech(s) int s; { exit(7); }
7863 $signal_t blech_in_list(s) int s; { exit(4); }
7864 unsigned long dummy_long(p) unsigned long p; { return p; }
7865 unsigned int dummy_int(p) unsigned int p; { return p; }
7866 unsigned short dummy_short(p) unsigned short p; { return p; }
7870 unsigned long along;
7872 unsigned short ashort;
7876 /* Frustrate gcc-2.7.2's optimizer which failed this test with
7877 a direct f = -123. assignment. gcc-2.8.0 reportedly
7878 optimized the whole file away
7880 /* Store the number in a writable string for gcc to pass to
7883 sprintf(str, "-123");
7884 sscanf(str, "%lf", &f); /* f = -123.; */
7886 signal(SIGFPE, blech);
7887 along = (unsigned long)f;
7888 aint = (unsigned int)f;
7889 ashort = (unsigned short)f;
7890 if (along != (unsigned long)-123)
7892 if (aint != (unsigned int)-123)
7894 if (ashort != (unsigned short)-123)
7896 sprintf(str, "1073741824.");
7897 sscanf(str, "%lf", &f); /* f = (double)0x40000000; */
7900 along = (unsigned long)f;
7901 if (along != 0x80000000)
7905 along = (unsigned long)f;
7906 if (along != 0x7fffffff)
7910 along = (unsigned long)f;
7911 if (along != 0x80000001)
7915 signal(SIGFPE, blech_in_list);
7916 sprintf(str, "123.");
7917 sscanf(str, "%lf", &f); /* f = 123.; */
7918 along = dummy_long((unsigned long)f);
7919 aint = dummy_int((unsigned int)f);
7920 ashort = dummy_short((unsigned short)f);
7921 if (along != (unsigned long)123)
7923 if (aint != (unsigned int)123)
7925 if (ashort != (unsigned short)123)
7932 if eval $compile_ok; then
7936 echo "(I can't seem to compile the test program--assuming it can't)"
7939 case "$castflags" in
7944 echo "Nope, it can't."
7951 : see if vprintf exists
7953 if set vprintf val -f d_vprintf; eval $csym; $val; then
7954 echo 'vprintf() found.' >&4
7956 $cat >vprintf.c <<'EOF'
7957 #include <varargs.h>
7959 int main() { xxx("foo"); }
7968 exit((unsigned long)vsprintf(buf,"%s",args) > 10L);
7972 if eval $compile && ./vprintf; then
7973 echo "Your vsprintf() returns (int)." >&4
7976 echo "Your vsprintf() returns (char*)." >&4
7980 echo 'vprintf() NOT found.' >&4
7990 : see if chown exists
7994 : see if chroot exists
7998 : see if chsize exists
8002 : check for const keyword
8004 echo 'Checking to see if your C compiler knows about "const"...' >&4
8005 $cat >const.c <<'EOCP'
8006 typedef struct spug { int drokk; } spug;
8013 if $cc -c $ccflags const.c >/dev/null 2>&1 ; then
8015 echo "Yup, it does."
8018 echo "Nope, it doesn't."
8023 : see if crypt exists
8025 if set crypt val -f d_crypt; eval $csym; $val; then
8026 echo 'crypt() found.' >&4
8030 cryptlib=`./loc Slibcrypt$_a "" $xlibpth`
8031 if $test -z "$cryptlib"; then
8032 cryptlib=`./loc Mlibcrypt$_a "" $xlibpth`
8036 if $test -z "$cryptlib"; then
8037 cryptlib=`./loc Llibcrypt$_a "" $xlibpth`
8041 if $test -z "$cryptlib"; then
8042 cryptlib=`./loc libcrypt$_a "" $libpth`
8046 if $test -z "$cryptlib"; then
8047 echo 'crypt() NOT found.' >&4
8056 : get csh whereabouts
8058 'csh') val="$undef" ;;
8063 : Respect a hint or command line value for full_csh.
8065 '') full_csh=$csh ;;
8068 : see if cuserid exists
8069 set cuserid d_cuserid
8072 : see if this is a limits.h system
8073 set limits.h i_limits
8076 : see if this is a float.h system
8080 : See if number of significant digits in a double precision number is known
8082 $cat >dbl_dig.c <<EOM
8092 printf("Contains DBL_DIG");
8095 $cppstdin $cppflags $cppminus < dbl_dig.c >dbl_dig.E 2>/dev/null
8096 if $contains 'DBL_DIG' dbl_dig.E >/dev/null 2>&1; then
8097 echo "DBL_DIG found." >&4
8100 echo "DBL_DIG NOT found." >&4
8107 : see if difftime exists
8108 set difftime d_difftime
8111 : see if this is a dirent system
8113 if xinc=`./findhdr dirent.h`; $test "$xinc"; then
8115 echo "<dirent.h> found." >&4
8118 if xinc=`./findhdr sys/dir.h`; $test "$xinc"; then
8119 echo "<sys/dir.h> found." >&4
8122 xinc=`./findhdr sys/ndir.h`
8124 echo "<dirent.h> NOT found." >&4
8129 : Look for type of directory structure.
8131 $cppstdin $cppflags $cppminus < "$xinc" > try.c
8133 case "$direntrytype" in
8136 $define) guess1='struct dirent' ;;
8137 *) guess1='struct direct' ;;
8140 *) guess1="$direntrytype"
8145 'struct dirent') guess2='struct direct' ;;
8146 *) guess2='struct dirent' ;;
8149 if $contains "$guess1" try.c >/dev/null 2>&1; then
8150 direntrytype="$guess1"
8151 echo "Your directory entries are $direntrytype." >&4
8152 elif $contains "$guess2" try.c >/dev/null 2>&1; then
8153 direntrytype="$guess2"
8154 echo "Your directory entries seem to be $direntrytype." >&4
8156 echo "I don't recognize your system's directory entries." >&4
8157 rp="What type is used for directory entries on this system?"
8165 : see if the directory entry stores field length
8167 $cppstdin $cppflags $cppminus < "$xinc" > try.c
8168 if $contains 'd_namlen' try.c >/dev/null 2>&1; then
8169 echo "Good, your directory entry keeps length information in d_namlen." >&4
8172 echo "Your directory entry does not know about the d_namlen field." >&4
8179 : see if dlerror exists
8182 set dlerror d_dlerror
8186 : see if dlfcn is available
8194 On a few systems, the dynamically loaded modules that perl generates and uses
8195 will need a different extension than shared libs. The default will probably
8203 rp='What is the extension of dynamically loaded modules'
8212 : Check if dlsym need a leading underscore
8218 echo "Checking whether your dlsym() needs a leading underscore ..." >&4
8219 $cat >dyna.c <<'EOM'
8228 #include <dlfcn.h> /* the dynamic linker include file for Sunos/Solaris */
8230 #include <sys/types.h>
8244 int mode = RTLD_LAZY ;
8246 handle = dlopen("./dyna.$dlext", mode) ;
8247 if (handle == NULL) {
8252 symbol = dlsym(handle, "fred") ;
8253 if (symbol == NULL) {
8254 /* try putting a leading underscore */
8255 symbol = dlsym(handle, "_fred") ;
8256 if (symbol == NULL) {
8269 : Call the object file tmp-dyna.o in case dlext=o.
8270 if $cc $ccflags $cccdlflags -c dyna.c > /dev/null 2>&1 &&
8271 mv dyna${_o} tmp-dyna${_o} > /dev/null 2>&1 &&
8272 $ld $lddlflags -o dyna.$dlext tmp-dyna${_o} > /dev/null 2>&1 &&
8273 $cc $ccflags -o fred $ldflags $cccdlflags $ccdlflags fred.c $libs > /dev/null 2>&1; then
8276 1) echo "Test program failed using dlopen." >&4
8277 echo "Perhaps you should not use dynamic loading." >&4;;
8278 2) echo "Test program failed using dlsym." >&4
8279 echo "Perhaps you should not use dynamic loading." >&4;;
8280 3) echo "dlsym needs a leading underscore" >&4
8282 4) echo "dlsym doesn't need a leading underscore." >&4;;
8285 echo "I can't compile and run the test program." >&4
8286 echo "I'm guessing that dlsym doesn't need a leading underscore." >&4
8291 $rm -f fred fred.? dyna.$dlext dyna.? tmp-dyna.?
8296 hasproto='varname=$1; func=$2; shift; shift;
8297 while $test $# -ge 2; do
8299 $define) echo "#include <$2>";;
8303 $cppstdin $cppflags $cppminus < try.c > tryout.c 2>/dev/null;
8304 if $contains "$func.*(" tryout.c >/dev/null 2>&1; then
8305 echo "$func() prototype found.";
8308 echo "$func() prototype NOT found.";
8313 $rm -f try.c tryout.c'
8315 : see if prototype for drand48 is available
8317 set d_drand48proto drand48 $i_stdlib stdlib.h $i_unistd unistd.h
8320 : see if dup2 exists
8324 : see if eaccess exists
8325 set eaccess d_eaccess
8328 : see if endgrent exists
8329 set endgrent d_endgrent
8332 : see if endhostent exists
8333 set endhostent d_endhent
8336 : see if endnetent exists
8337 set endnetent d_endnent
8340 : see if endprotoent exists
8341 set endprotoent d_endpent
8344 : see if endpwent exists
8345 set endpwent d_endpwent
8348 : see if endservent exists
8349 set endservent d_endsent
8352 : see if endspent exists
8353 set endspent d_endspent
8356 : Locate the flags for 'open()'
8358 $cat >open3.c <<'EOCP'
8359 #include <sys/types.h>
8364 #include <sys/file.h>
8375 : check sys/file.h first to get FREAD on Sun
8376 if $test `./findhdr sys/file.h` && \
8377 set open3 -DI_SYS_FILE && eval $compile; then
8379 echo "<sys/file.h> defines the O_* constants..." >&4
8381 echo "and you have the 3 argument form of open()." >&4
8384 echo "but not the 3 argument form of open(). Oh, well." >&4
8387 elif $test `./findhdr fcntl.h` && \
8388 set open3 -DI_FCNTL && eval $compile; then
8390 echo "<fcntl.h> defines the O_* constants..." >&4
8392 echo "and you have the 3 argument form of open()." >&4
8395 echo "but not the 3 argument form of open(). Oh, well." >&4
8400 echo "I can't find the O_* constant definitions! You got problems." >&4
8406 : see which of string.h or strings.h is needed
8408 strings=`./findhdr string.h`
8409 if $test "$strings" && $test -r "$strings"; then
8410 echo "Using <string.h> instead of <strings.h>." >&4
8414 strings=`./findhdr strings.h`
8415 if $test "$strings" && $test -r "$strings"; then
8416 echo "Using <strings.h> instead of <string.h>." >&4
8418 echo "No string header found -- You'll surely have problems." >&4
8424 "$undef") strings=`./findhdr strings.h`;;
8425 *) strings=`./findhdr string.h`;;
8428 : check for non-blocking I/O stuff
8429 case "$h_sysfile" in
8430 true) echo "#include <sys/file.h>" > head.c;;
8433 true) echo "#include <fcntl.h>" > head.c;;
8434 *) echo "#include <sys/fcntl.h>" > head.c;;
8439 echo "Figuring out the flag used by open() for non-blocking I/O..." >&4
8440 case "$o_nonblock" in
8443 $cat >>try.c <<'EOCP'
8447 printf("O_NONBLOCK\n");
8451 printf("O_NDELAY\n");
8455 printf("FNDELAY\n");
8462 if eval $compile_ok; then
8464 case "$o_nonblock" in
8465 '') echo "I can't figure it out, assuming O_NONBLOCK will do.";;
8466 *) echo "Seems like we can use $o_nonblock.";;
8469 echo "(I can't compile the test program; pray O_NONBLOCK is right!)"
8472 *) echo "Using $hint value $o_nonblock.";;
8474 $rm -f try try.* .out core
8477 echo "Let's see what value errno gets from read() on a $o_nonblock file..." >&4
8483 #include <sys/types.h>
8486 #define MY_O_NONBLOCK $o_nonblock
8487 #ifndef errno /* XXX need better Configure test */
8497 #include <strings.h>
8499 $signal_t blech(x) int x; { exit(3); }
8501 $cat >> try.c <<'EOCP'
8509 pipe(pd); /* Down: child -> parent */
8510 pipe(pu); /* Up: parent -> child */
8513 close(pd[1]); /* Parent reads from pd[0] */
8514 close(pu[0]); /* Parent writes (blocking) to pu[1] */
8515 if (-1 == fcntl(pd[0], F_SETFL, MY_O_NONBLOCK))
8517 signal(SIGALRM, blech);
8519 if ((ret = read(pd[0], buf, 1)) > 0) /* Nothing to read! */
8521 sprintf(string, "%d\n", ret);
8522 write(2, string, strlen(string));
8525 if (errno == EAGAIN) {
8531 if (errno == EWOULDBLOCK)
8532 printf("EWOULDBLOCK\n");
8535 write(pu[1], buf, 1); /* Unblocks child, tell it to close our pipe */
8536 sleep(2); /* Give it time to close our pipe */
8538 ret = read(pd[0], buf, 1); /* Should read EOF */
8540 sprintf(string, "%d\n", ret);
8541 write(3, string, strlen(string));
8545 close(pd[0]); /* We write to pd[1] */
8546 close(pu[1]); /* We read from pu[0] */
8547 read(pu[0], buf, 1); /* Wait for parent to signal us we may continue */
8548 close(pd[1]); /* Pipe pd is now fully closed! */
8549 exit(0); /* Bye bye, thank you for playing! */
8553 if eval $compile_ok; then
8554 echo "$startsh" >mtry
8555 echo "./try >try.out 2>try.ret 3>try.err || exit 4" >>mtry
8557 ./mtry >/dev/null 2>&1
8559 0) eagain=`$cat try.out`;;
8560 1) echo "Could not perform non-blocking setting!";;
8561 2) echo "I did a successful read() for something that was not there!";;
8562 3) echo "Hmm... non-blocking I/O does not seem to be working!";;
8563 *) echo "Something terribly wrong happened during testing.";;
8565 rd_nodata=`$cat try.ret`
8566 echo "A read() system call with no data present returns $rd_nodata."
8567 case "$rd_nodata" in
8570 echo "(That's peculiar, fixing that to be -1.)"
8576 echo "Forcing errno EAGAIN on read() with no data available."
8580 echo "Your read() sets errno to $eagain when no data is available."
8583 status=`$cat try.err`
8585 0) echo "And it correctly returns 0 to signal EOF.";;
8586 -1) echo "But it also returns -1 to signal EOF, so be careful!";;
8587 *) echo "However, your read() returns '$status' on EOF??";;
8590 if test "$status" = "$rd_nodata"; then
8591 echo "WARNING: you can't distinguish between EOF and no data!"
8595 echo "I can't compile the test program--assuming errno EAGAIN will do."
8602 echo "Using $hint value $eagain."
8603 echo "Your read() returns $rd_nodata when no data is present."
8604 case "$d_eofnblk" in
8605 "$define") echo "And you can see EOF because read() returns 0.";;
8606 "$undef") echo "But you can't see EOF status from read() returned value.";;
8608 echo "(Assuming you can't see EOF status from read anyway.)"
8614 $rm -f try try.* .out core head.c mtry
8616 : see if fchmod exists
8620 : see if fchown exists
8624 : see if this is an fcntl system
8628 hasfield='varname=$1; struct=$2; field=$3; shift; shift; shift;
8629 while $test $# -ge 2; do
8631 $define) echo "#include <$2>";;
8635 echo "int main () { struct $struct foo; char* bar; bar = (char*)foo.$field; }" >> try.c;
8637 if eval $compile; then
8648 : see whether socket exists
8650 $echo $n "Hmm... $c" >&4
8651 if set socket val -f d_socket; eval $csym; $val; then
8652 echo "Looks like you have Berkeley networking support." >&4
8654 if set setsockopt val -f; eval $csym; $val; then
8657 echo "...but it uses the old BSD 4.1c interface, rather than 4.2." >&4
8661 if $contains socklib libc.list >/dev/null 2>&1; then
8662 echo "Looks like you have Berkeley networking support." >&4
8664 : we will have to assume that it supports the 4.2 BSD interface
8667 echo "You don't have Berkeley networking in libc$_a..." >&4
8668 if test "X$d_socket" = "X$define"; then
8669 echo "...but you seem to believe that you have sockets." >&4
8671 for net in net socket
8673 if test -f /usr/lib/lib$net$_a; then
8674 ( ($nm $nm_opt /usr/lib/lib$net$_a | eval $nm_extract) || \
8675 $ar t /usr/lib/lib$net$_a) 2>/dev/null >> libc.list
8676 if $contains socket libc.list >/dev/null 2>&1; then
8681 echo "...but the Wollongong group seems to have hacked it in." >&4
8682 sockethdr="-I/usr/netinclude"
8685 echo "Found Berkeley sockets interface in lib$net." >& 4
8686 if $contains setsockopt libc.list >/dev/null 2>&1; then
8689 echo "...using the old BSD 4.1c interface, rather than 4.2." >&4
8696 if test "X$d_socket" != "X$define"; then
8697 echo "or anywhere else I see." >&4
8705 : see if socketpair exists
8706 set socketpair d_sockpair
8711 echo "Checking the availability of certain socket constants..." >& 4
8712 for ENUM in MSG_CTRUNC MSG_DONTROUTE MSG_OOB MSG_PEEK MSG_PROXY SCM_RIGHTS; do
8713 enum=`$echo $ENUM|./tr '[A-Z]' '[a-z]'`
8715 #include <sys/types.h>
8716 #include <sys/socket.h>
8722 set try; if eval $compile; then
8725 set d_${enum}; eval $setvar
8729 : see if sys/select.h has to be included
8730 set sys/select.h i_sysselct
8733 : see if we should include time.h, sys/time.h, or both
8735 if test "X$timeincl" = X; then
8736 echo "Testing to see if we should include <time.h>, <sys/time.h> or both." >&4
8737 $echo $n "I'm now running the test program...$c"
8738 $cat >try.c <<'EOCP'
8739 #include <sys/types.h>
8744 #ifdef SYSTIMEKERNEL
8747 #include <sys/time.h>
8750 #include <sys/select.h>
8759 struct timezone tzp;
8761 if (foo.tm_sec == foo.tm_sec)
8764 if (bar.tv_sec == bar.tv_sec)
8771 for s_timezone in '-DS_TIMEZONE' ''; do
8773 for s_timeval in '-DS_TIMEVAL' ''; do
8774 for i_systimek in '' '-DSYSTIMEKERNEL'; do
8775 for i_time in '' '-DI_TIME'; do
8776 for i_systime in '-DI_SYSTIME' ''; do
8779 set try $i_time $i_systime $i_systimek $sysselect $s_timeval $s_timezone
8780 if eval $compile; then
8781 set X $i_time $i_systime $i_systimek $sysselect $s_timeval
8785 $echo $n "Succeeded with $flags$c"
8797 *SYSTIMEKERNEL*) i_systimek="$define"
8798 timeincl=`./findhdr sys/time.h`
8799 echo "We'll include <sys/time.h> with KERNEL defined." >&4;;
8800 *) i_systimek="$undef";;
8803 *I_TIME*) i_time="$define"
8804 timeincl=`./findhdr time.h`" $timeincl"
8805 echo "We'll include <time.h>." >&4;;
8806 *) i_time="$undef";;
8809 *I_SYSTIME*) i_systime="$define"
8810 timeincl=`./findhdr sys/time.h`" $timeincl"
8811 echo "We'll include <sys/time.h>." >&4;;
8812 *) i_systime="$undef";;
8817 : check for fd_set items
8820 Checking to see how well your C compiler handles fd_set and friends ...
8822 $cat >fd_set.c <<EOCP
8823 #$i_systime I_SYS_TIME
8824 #$i_sysselct I_SYS_SELECT
8825 #$d_socket HAS_SOCKET
8826 #include <sys/types.h>
8828 #include <sys/socket.h> /* Might include <sys/bsdtypes.h> */
8831 #include <sys/time.h>
8834 #include <sys/select.h>
8843 #if defined(FD_SET) && defined(FD_CLR) && defined(FD_ISSET) && defined(FD_ZERO)
8850 set fd_set -DTRYBITS
8851 if eval $compile; then
8852 d_fds_bits="$define"
8854 echo "Well, your system knows about the normal fd_set typedef..." >&4
8856 echo "and you have the normal fd_set macros (just as I'd expect)." >&4
8857 d_fd_macros="$define"
8860 but not the normal fd_set macros! Gaaack! I'll have to cover for you.
8862 d_fd_macros="$undef"
8866 Hmm, your compiler has some difficulty with fd_set. Checking further...
8869 if eval $compile; then
8872 echo "Well, your system has some sort of fd_set available..." >&4
8874 echo "and you have the normal fd_set macros." >&4
8875 d_fd_macros="$define"
8878 but not the normal fd_set macros! Gross! More work for me...
8880 d_fd_macros="$undef"
8883 echo "Well, you got zip. That's OK, I can roll my own fd_set stuff." >&4
8886 d_fd_macros="$undef"
8891 : see if fgetpos exists
8892 set fgetpos d_fgetpos
8895 : see if flock exists
8899 : see if fork exists
8903 : see if pathconf exists
8904 set pathconf d_pathconf
8907 : see if fpathconf exists
8908 set fpathconf d_fpathconf
8912 : check for fpos64_t
8914 echo "Checking to see if you have fpos64_t..." >&4
8917 int main() { fpos64_t x = 7; }
8920 if eval $compile; then
8922 echo "You have fpos64_t."
8925 echo "You do not have fpos64_t."
8927 8) echo "(Your fpos_t is 64 bits, so you could use that.)" ;;
8934 hasstruct='varname=$1; struct=$2; shift; shift;
8935 while $test $# -ge 2; do
8937 $define) echo "#include <$2>";;
8941 echo "int main () { struct $struct foo; }" >> try.c;
8943 if eval $compile; then
8952 : see if this is a sys/param system
8953 set sys/param.h i_sysparam
8956 : see if this is a sys/mount.h system
8957 set sys/mount.h i_sysmount
8960 : see if sys/types.h has to be included
8961 set sys/types.h i_systypes
8966 echo "Checking to see if your system supports struct fs_data..." >&4
8967 set d_fs_data_s fs_data $i_systypes sys/types.h $i_sysparam sys/param.h $i_sysmount sys/mount.h
8969 case "$d_fs_data_s" in
8970 "$define") echo "Yes, it does." ;;
8971 *) echo "No, it doesn't." ;;
8974 : see if fseeko exists
8978 8) echo "(Your long is 64 bits, so you could use fseek.)" ;;
8981 : see if fsetpos exists
8982 set fsetpos d_fsetpos
8986 : see if fstatfs exists
8987 set fstatfs d_fstatfs
8991 : see if statvfs exists
8992 set statvfs d_statvfs
8995 : see if fstatvfs exists
8996 set fstatvfs d_fstatvfs
9000 : see if ftello exists
9004 8) echo "(Your long is 64 bits, so you could use ftell.)" ;;
9007 : see if getcwd exists
9011 : see if getgrent exists
9012 set getgrent d_getgrent
9015 : see if gethostbyaddr exists
9016 set gethostbyaddr d_gethbyaddr
9019 : see if gethostbyname exists
9020 set gethostbyname d_gethbyname
9023 : see if gethostent exists
9024 set gethostent d_gethent
9027 : see how we will look up host name
9030 if set gethostname val -f d_gethname; eval $csym; $val; then
9031 echo 'gethostname() found.' >&4
9032 d_gethname="$define"
9035 if set uname val -f d_uname; eval $csym; $val; then
9038 uname() was found, but you're running xenix, and older versions of xenix
9039 have a broken uname(). If you don't really know whether your xenix is old
9040 enough to have a broken system call, use the default answer.
9047 rp='Is your uname() broken?'
9050 n*) d_uname="$define"; call=uname;;
9053 echo 'uname() found.' >&4
9060 case "$d_gethname" in
9061 '') d_gethname="$undef";;
9064 '') d_uname="$undef";;
9066 case "$d_uname$d_gethname" in
9071 Every now and then someone has a $call() that lies about the hostname
9072 but can't be fixed for political or economic reasons. If you wish, I can
9073 pretend $call() isn't there and maybe compute hostname at run-time
9074 thanks to the '$phostname' command.
9077 rp="Shall I ignore $call() from now on?"
9080 y*) d_uname="$undef" d_gethname="$undef"; $echo $n "Okay...$c";;
9083 case "$phostname" in
9085 *) case "$aphostname" in
9091 file=`./loc $file $file $pth`
9092 aphostname=`echo $file $*`
9097 case "$d_uname$d_gethname" in
9100 case "$phostname" in
9102 echo "There will be no way for $package to get your hostname." >&4;;
9104 echo "I'll use 'popen("'"'$aphostname'", "r")'"' to get your hostname." >&4
9108 case "$d_phostname" in
9109 '') d_phostname="$undef";;
9112 : see if this is a netdb.h system
9116 : see if prototypes for various gethostxxx netdb.h functions are available
9118 set d_gethostprotos gethostent $i_netdb netdb.h
9121 : see if getlogin exists
9122 set getlogin d_getlogin
9125 : see if getmnt exists
9129 : see if getmntent exists
9130 set getmntent d_getmntent
9133 : see if getnetbyaddr exists
9134 set getnetbyaddr d_getnbyaddr
9137 : see if getnetbyname exists
9138 set getnetbyname d_getnbyname
9141 : see if getnetent exists
9142 set getnetent d_getnent
9145 : see if prototypes for various getnetxxx netdb.h functions are available
9147 set d_getnetprotos getnetent $i_netdb netdb.h
9151 : see if getprotobyname exists
9152 set getprotobyname d_getpbyname
9155 : see if getprotobynumber exists
9156 set getprotobynumber d_getpbynumber
9159 : see if getprotoent exists
9160 set getprotoent d_getpent
9163 : see if getpgid exists
9164 set getpgid d_getpgid
9167 : see if getpgrp2 exists
9168 set getpgrp2 d_getpgrp2
9171 : see if getppid exists
9172 set getppid d_getppid
9175 : see if getpriority exists
9176 set getpriority d_getprior
9179 : see if prototypes for various getprotoxxx netdb.h functions are available
9181 set d_getprotoprotos getprotoent $i_netdb netdb.h
9184 : see if getpwent exists
9185 set getpwent d_getpwent
9189 : see if getservbyname exists
9190 set getservbyname d_getsbyname
9193 : see if getservbyport exists
9194 set getservbyport d_getsbyport
9197 : see if getservent exists
9198 set getservent d_getsent
9201 : see if prototypes for various getservxxx netdb.h functions are available
9203 set d_getservprotos getservent $i_netdb netdb.h
9206 : see if getspent exists
9207 set getspent d_getspent
9210 : see if getspnam exists
9211 set getspnam d_getspnam
9214 : see if gettimeofday or ftime exists
9215 set gettimeofday d_gettimeod
9217 case "$d_gettimeod" in
9223 val="$undef"; set d_ftime; eval $setvar
9226 case "$d_gettimeod$d_ftime" in
9229 echo 'No ftime() nor gettimeofday() -- timing may be less accurate.' >&4
9233 : see if this is an grp system
9239 xxx=`./findhdr grp.h`
9240 $cppstdin $cppflags $cppminus < $xxx >$$.h
9242 if $contains 'gr_passwd' $$.h >/dev/null 2>&1; then
9254 set d_grpasswd; eval $setvar
9258 : see if hasmntopt exists
9259 set hasmntopt d_hasmntopt
9262 : see if this is a netinet/in.h or sys/in.h system
9263 set netinet/in.h i_niin sys/in.h i_sysin
9266 : see if arpa/inet.h has to be included
9267 set arpa/inet.h i_arpainet
9270 : see if htonl --and friends-- exists
9275 : Maybe they are macros.
9280 #include <sys/types.h>
9281 #$i_niin I_NETINET_IN
9283 #$i_arpainet I_ARPA_INET
9285 #include <netinet/in.h>
9291 #include <arpa/inet.h>
9294 printf("Defined as a macro.");
9297 $cppstdin $cppflags $cppminus < htonl.c >htonl.E 2>/dev/null
9298 if $contains 'Defined as a macro' htonl.E >/dev/null 2>&1; then
9300 echo "But it seems to be defined as a macro." >&4
9308 : see if iconv exists
9314 if set index val -f; eval $csym; $val; then
9315 if set strchr val -f d_strchr; eval $csym; $val; then
9316 if $contains strchr "$strings" >/dev/null 2>&1 ; then
9319 echo "strchr() found." >&4
9323 echo "index() found." >&4
9328 echo "index() found." >&4
9331 if set strchr val -f d_strchr; eval $csym; $val; then
9334 echo "strchr() found." >&4
9336 echo "No index() or strchr() found!" >&4
9341 set d_strchr; eval $setvar
9343 set d_index; eval $setvar
9345 : check whether inet_aton exists
9346 set inet_aton d_inetaton
9349 : see if inttypes.h is available
9350 : we want a real compile instead of Inhdr because some systems
9351 : have an inttypes.h which includes non-existent headers
9354 #include <inttypes.h>
9356 static int32_t foo32 = 0x12345678;
9360 if eval $compile; then
9361 echo "<inttypes.h> found." >&4
9364 echo "<inttypes.h> NOT found." >&4
9373 echo "Checking to see if you have int64_t..." >&4
9375 #include <sys/types.h>
9376 #$i_inttypes I_INTTYPES
9378 #include <inttypes.h>
9380 int main() { int64_t x = 7; }
9383 if eval $compile; then
9385 echo "You have int64_t."
9388 echo "You do not have int64_t."
9396 $cat >isascii.c <<'EOCP'
9408 if eval $compile; then
9409 echo "isascii() found." >&4
9412 echo "isascii() NOT found." >&4
9419 : see if killpg exists
9423 : see if lchown exists
9425 $cat > try.c <<'EOCP'
9426 /* System header to define __stub macros and hopefully few prototypes,
9427 which can conflict with char lchown(); below. */
9429 /* Override any gcc2 internal prototype to avoid an error. */
9430 /* We use char because int might match the return type of a gcc2
9431 builtin and then its argument prototype would still apply. */
9434 /* The GNU C library defines this for functions which it implements
9435 to always fail with ENOSYS. Some functions are actually named
9436 something starting with __ and the normal name is an alias. */
9437 #if defined (__stub_lchown) || defined (__stub___lchown)
9445 if eval $compile; then
9446 $echo "lchown() found." >&4
9449 $echo "lchown() NOT found." >&4
9455 : See if number of significant digits in a double precision number is known
9457 $cat >ldbl_dig.c <<EOM
9467 printf("Contains LDBL_DIG");
9470 $cppstdin $cppflags $cppminus < ldbl_dig.c >ldbl_dig.E 2>/dev/null
9471 if $contains 'LDBL_DIG' ldbl_dig.E >/dev/null 2>&1; then
9472 echo "LDBL_DIG found." >&4
9475 echo "LDBL_DIG NOT found." >&4
9482 : see if link exists
9486 : see if localeconv exists
9487 set localeconv d_locconv
9490 : see if lockf exists
9494 : check for long long
9496 echo "Checking to see if you have long long..." >&4
9497 echo 'int main() { long long x = 7; return 0; }' > try.c
9499 if eval $compile; then
9501 echo "You have have long long."
9504 echo "You do not have long long."
9510 : check for length of long long
9511 case "${d_longlong}${longlongsize}" in
9514 echo "Checking to see how big your long longs are..." >&4
9515 $cat >try.c <<'EOCP'
9519 printf("%d\n", (int)sizeof(long long));
9524 if eval $compile_ok; then
9525 longlongsize=`./try$exe_ext`
9526 echo "Your long longs are $longlongsize bytes long."
9530 echo "(I can't seem to compile the test program. Guessing...)"
9531 rp="What is the size of a long long (in bytes)?"
9535 if $test "X$longsize" = "X$longlongsize"; then
9536 echo "(That isn't any different from an ordinary long.)"
9542 : see if prototype for lseek is available
9544 set d_lseekproto lseek $i_systypes sys/types.h $i_unistd unistd.h
9547 : see if lstat exists
9551 : see if mblen exists
9555 : see if mbstowcs exists
9556 set mbstowcs d_mbstowcs
9559 : see if mbtowc exists
9563 : see if memchr exists
9567 : see if memcmp exists
9571 : see if memcpy exists
9575 : see if memmove exists
9576 set memmove d_memmove
9579 : see if memset exists
9583 : see if mkdir exists
9587 : see if mkdtemp exists
9588 set mkdtemp d_mkdtemp
9591 : see if mkfifo exists
9595 : see if mkstemp exists
9596 set mkstemp d_mkstemp
9599 : see if mkstemps exists
9600 set mkstemps d_mkstemps
9603 : see if mktime exists
9607 : see if this is a sys/mman.h system
9608 set sys/mman.h i_sysmman
9611 : see if mmap exists
9614 : see what shmat returns
9615 : default to something harmless
9617 case "$i_sysmman$d_mmap" in
9619 $cat >mmap.c <<'END'
9620 #include <sys/mman.h>
9623 if $cc $ccflags -c mmap.c >/dev/null 2>&1; then
9628 echo "and it returns ($mmaptype)." >&4
9634 : see if mprotect exists
9635 set mprotect d_mprotect
9638 : see if msgctl exists
9642 : see if msgget exists
9646 : see if msgsnd exists
9650 : see if msgrcv exists
9654 : see how much of the 'msg*(2)' library is present.
9657 case "$d_msgctl$d_msgget$d_msgsnd$d_msgrcv" in
9658 *"$undef"*) h_msg=false;;
9662 case "`ipcs 2>&1`" in
9663 "SVID messages"*"not configured"*)
9664 echo "Your $osname does not have the msg*(2) configured." >&4
9679 : we could also check for sys/ipc.h ...
9680 if $h_msg && $test `./findhdr sys/msg.h`; then
9681 echo "You have the full msg*(2) library." >&4
9684 echo "You don't have the full msg*(2) library." >&4
9690 : see if msync exists
9694 : see if munmap exists
9698 : see if nice exists
9704 echo "Checking which 64-bit integer type we could use..." >&4
9710 val='"unsigned int"'
9715 *) case "$longsize" in
9719 val='"unsigned long"'
9724 *) case "$d_longlong:$longlongsize" in
9729 val='"unsigned long long"'
9734 *) case "$d_int64_t" in
9753 '') echo "Alas, no 64-bit integer types in sight." >&4
9756 *) if test X"$use64bits" = Xdefine -o X"$longsize" = X8; then
9761 echo "We $verb use '$quadtype' for 64-bit integers." >&4
9766 : check for length of character
9770 echo "Checking to see how big your characters are (hey, you never know)..." >&4
9771 $cat >try.c <<'EOCP'
9775 printf("%d\n", (int)sizeof(char));
9780 if eval $compile_ok; then
9784 echo "(I can't seem to compile the test program. Guessing...)"
9791 rp="What is the size of a character (in bytes)?"
9798 $echo "Choosing the C types to be used for Perl's internal types..." >&4
9800 case "$use64bits:$d_quad:$quadtype" in
9808 uvtype="unsigned long"
9814 case "$uselongdouble:$d_longdbl" in
9816 nvtype="long double"
9824 $echo "(IV will be "$ivtype", $ivsize bytes)"
9825 $echo "(UV will be "$uvtype", $uvsize bytes)"
9826 $echo "(NV will be "$nvtype", $nvsize bytes)"
9829 #$i_inttypes I_INTTYPES
9831 #include <inttypes.h>
9836 int8_t i = INT8_MAX;
9837 uint8_t u = UINT8_MAX;
9841 int16_t i = INT16_MAX;
9842 uint16_t i = UINT16_MAX;
9843 printf("int16_t\n");
9846 int32_t i = INT32_MAX;
9847 uint32_t u = UINT32_MAX;
9848 printf("int32_t\n");
9854 '') case "$charsize" in
9856 u8type="unsigned char"
9865 if eval $compile; then
9866 case "`./try$exe_ext`" in
9867 int8_t) i8type=int8_t
9877 '') if $test $charsize -ge 1; then
9879 u8type="unsigned char"
9887 '') case "$shortsize" in
9889 u16type="unsigned short"
9898 if eval $compile; then
9899 case "`./try$exe_ext`" in
9911 '') if $test $shortsize -ge 2; then
9913 u16type="unsigned short"
9921 '') case "$longsize" in
9923 u32type="unsigned long"
9927 *) case "$intsize" in
9929 u32type="unsigned int"
9940 if eval $compile; then
9941 case "`./try$exe_ext`" in
9953 '') if $test $intsize -ge 4; then
9955 u32type="unsigned int"
9963 '') case "$d_quad:$quadtype" in
9966 u64type="$uquadtype"
9974 $echo "Checking whether your NVs can preserve your UVs..." >&4
9978 $uvtype k = ($uvtype)~0, l;
9984 printf("preserve\n");
9989 if eval $compile; then
9990 case "`./try$exe_ext`" in
9991 preserve) d_nv_preserves_uv="$define" ;;
9994 case "$d_nv_preserves_uv" in
9995 $define) $echo "Yes, they can." 2>&1 ;;
9996 *) $echo "No, they can't." 2>&1
9997 d_nv_preserves_uv="$undef"
10004 : check for off64_t
10006 echo "Checking to see if you have off64_t..." >&4
10008 #include <sys/types.h>
10009 #include <unistd.h>
10010 int main() { off64_t x = 7; }
10013 if eval $compile; then
10015 echo "You have off64_t."
10018 echo "You do not have off64_t."
10019 case "$lseeksize" in
10020 8) echo "(Your off_t is 64 bits, so you could use that.)" ;;
10027 : see if POSIX threads are available
10028 set pthread.h i_pthread
10034 : how to create joinable pthreads
10035 if test "X$usethreads" = "X$define" -a "X$i_pthread" = "X$define"; then
10037 echo "Checking what constant to use for creating joinable pthreads..." >&4
10038 $cat >try.c <<'EOCP'
10039 #include <pthread.h>
10041 int detachstate = JOINABLE;
10044 set try -DJOINABLE=PTHREAD_CREATE_JOINABLE
10045 if eval $compile; then
10046 echo "You seem to use PTHREAD_CREATE_JOINABLE." >&4
10047 val="$undef" # Yes, undef.
10048 set d_old_pthread_create_joinable
10051 set old_pthread_create_joinable
10054 set try -DJOINABLE=PTHREAD_CREATE_UNDETACHED
10055 if eval $compile; then
10056 echo "You seem to use PTHREAD_CREATE_UNDETACHED." >&4
10058 set d_old_pthread_create_joinable
10060 val=PTHREAD_CREATE_UNDETACHED
10061 set old_pthread_create_joinable
10064 set try -DJOINABLE=__UNDETACHED
10065 if eval $compile; then
10066 echo "You seem to use __UNDETACHED." >&4
10068 set d_old_pthread_create_joinable
10071 set old_pthread_create_joinable
10074 echo "Egads, nothing obvious found. Guessing that you use 0." >&4
10076 set d_old_pthread_create_joinable
10079 set old_pthread_create_joinable
10086 d_old_pthread_create_joinable="$undef"
10087 old_pthread_create_joinable=""
10090 : see if pause exists
10094 : see if pipe exists
10098 : see if poll exists
10103 : see whether the various POSIXish _yields exist
10105 #include <pthread.h>
10111 #ifdef PTHREAD_YIELD
10114 #ifdef PTHREAD_YIELD_NULL
10115 pthread_yield(NULL);
10121 : see if sched_yield exists
10122 set try -DSCHED_YIELD
10123 if eval $compile; then
10125 sched_yield='sched_yield()'
10129 case "$usethreads" in
10132 $define) echo 'sched_yield() found.' >&4 ;;
10133 *) echo 'sched_yield() NOT found.' >&4 ;;
10139 : see if pthread_yield exists
10140 set try -DPTHREAD_YIELD
10141 if eval $compile; then
10143 case "$sched_yield" in
10144 '') sched_yield='pthread_yield()' ;;
10147 set try -DPTHREAD_YIELD_NULL
10148 if eval $compile; then
10150 case "$sched_yield" in
10151 '') sched_yield='pthread_yield(NULL)' ;;
10157 case "$usethreads" in
10160 $define) echo 'pthread_yield() found.' >&4 ;;
10161 *) echo 'pthread_yield() NOT found.' >&4 ;;
10165 set d_pthread_yield
10168 case "$sched_yield" in
10169 '') sched_yield=undef ;;
10174 : see if this is a pwd.h system
10180 xxx=`./findhdr pwd.h`
10181 $cppstdin $cppflags $cppminus < $xxx >$$.h
10183 if $contains 'pw_quota' $$.h >/dev/null 2>&1; then
10191 if $contains 'pw_age' $$.h >/dev/null 2>&1; then
10199 if $contains 'pw_change' $$.h >/dev/null 2>&1; then
10207 if $contains 'pw_class' $$.h >/dev/null 2>&1; then
10215 if $contains 'pw_expire' $$.h >/dev/null 2>&1; then
10223 if $contains 'pw_comment' $$.h >/dev/null 2>&1; then
10231 if $contains 'pw_gecos' $$.h >/dev/null 2>&1; then
10239 if $contains 'pw_passwd' $$.h >/dev/null 2>&1; then
10251 set d_pwquota; eval $setvar
10252 set d_pwage; eval $setvar
10253 set d_pwchange; eval $setvar
10254 set d_pwclass; eval $setvar
10255 set d_pwexpire; eval $setvar
10256 set d_pwcomment; eval $setvar
10257 set d_pwgecos; eval $setvar
10258 set d_pwpasswd; eval $setvar
10262 : see if readdir and friends exist
10263 set readdir d_readdir
10265 set seekdir d_seekdir
10267 set telldir d_telldir
10269 set rewinddir d_rewinddir
10272 : see if readlink exists
10273 set readlink d_readlink
10276 : see if rename exists
10277 set rename d_rename
10280 : see if rmdir exists
10284 : see if memory.h is available.
10289 : See if it conflicts with string.h
10295 $cppstdin $cppflags $cppminus < $strings > mem.h
10296 if $contains 'memcpy' mem.h >/dev/null 2>&1; then
10298 echo "We won't be including <memory.h>."
10308 : can bcopy handle overlapping blocks?
10313 echo "Checking to see if your bcopy() can do overlapping copies..." >&4
10315 #$i_memory I_MEMORY
10316 #$i_stdlib I_STDLIB
10317 #$i_string I_STRING
10318 #$i_unistd I_UNISTD
10320 $cat >>try.c <<'EOCP'
10323 # include <memory.h>
10326 # include <stdlib.h>
10329 # include <string.h>
10331 # include <strings.h>
10334 # include <unistd.h> /* Needed for NetBSD */
10338 char buf[128], abc[128];
10344 bcopy("abcdefghijklmnopqrstuvwxyz0123456789", abc, 36);
10346 for (align = 7; align >= 0; align--) {
10347 for (len = 36; len; len--) {
10349 bcopy(abc, b, len);
10350 for (off = 1; off <= len; off++) {
10351 bcopy(b, b+off, len);
10352 bcopy(b+off, b, len);
10353 if (bcmp(b, abc, len))
10362 if eval $compile_ok; then
10363 if ./try 2>/dev/null; then
10364 echo "Yes, it can."
10367 echo "It can't, sorry."
10368 case "$d_memmove" in
10369 "$define") echo "But that's Ok since you have memmove()." ;;
10373 echo "(I can't compile the test program, so we'll assume not...)"
10374 case "$d_memmove" in
10375 "$define") echo "But that's Ok since you have memmove()." ;;
10380 $rm -f try.* try core
10384 : can memcpy handle overlapping blocks?
10386 case "$d_memcpy" in
10389 echo "Checking to see if your memcpy() can do overlapping copies..." >&4
10391 #$i_memory I_MEMORY
10392 #$i_stdlib I_STDLIB
10393 #$i_string I_STRING
10394 #$i_unistd I_UNISTD
10396 $cat >>try.c <<'EOCP'
10399 # include <memory.h>
10402 # include <stdlib.h>
10405 # include <string.h>
10407 # include <strings.h>
10410 # include <unistd.h> /* Needed for NetBSD */
10414 char buf[128], abc[128];
10420 /* Copy "abcde..." string to char abc[] so that gcc doesn't
10421 try to store the string in read-only memory. */
10422 memcpy(abc, "abcdefghijklmnopqrstuvwxyz0123456789", 36);
10424 for (align = 7; align >= 0; align--) {
10425 for (len = 36; len; len--) {
10427 memcpy(b, abc, len);
10428 for (off = 1; off <= len; off++) {
10429 memcpy(b+off, b, len);
10430 memcpy(b, b+off, len);
10431 if (memcmp(b, abc, len))
10440 if eval $compile_ok; then
10441 if ./try 2>/dev/null; then
10442 echo "Yes, it can."
10445 echo "It can't, sorry."
10446 case "$d_memmove" in
10447 "$define") echo "But that's Ok since you have memmove()." ;;
10451 echo "(I can't compile the test program, so we'll assume not...)"
10452 case "$d_memmove" in
10453 "$define") echo "But that's Ok since you have memmove()." ;;
10458 $rm -f try.* try core
10462 : can memcmp be trusted to compare relative magnitude?
10464 case "$d_memcmp" in
10467 echo "Checking if your memcmp() can compare relative magnitude..." >&4
10469 #$i_memory I_MEMORY
10470 #$i_stdlib I_STDLIB
10471 #$i_string I_STRING
10472 #$i_unistd I_UNISTD
10474 $cat >>try.c <<'EOCP'
10477 # include <memory.h>
10480 # include <stdlib.h>
10483 # include <string.h>
10485 # include <strings.h>
10488 # include <unistd.h> /* Needed for NetBSD */
10494 if ((a < b) && memcmp(&a, &b, 1) < 0)
10500 if eval $compile_ok; then
10501 if ./try 2>/dev/null; then
10502 echo "Yes, it can."
10505 echo "No, it can't (it uses signed chars)."
10508 echo "(I can't compile the test program, so we'll assume not...)"
10512 $rm -f try.* try core
10516 : see if select exists
10517 set select d_select
10520 : see if semctl exists
10521 set semctl d_semctl
10524 : see if semget exists
10525 set semget d_semget
10528 : see if semop exists
10532 : see how much of the 'sem*(2)' library is present.
10535 case "$d_semctl$d_semget$d_semop" in
10536 *"$undef"*) h_sem=false;;
10540 case "`ipcs 2>&1`" in
10541 "SVID messages"*"not configured"*)
10542 echo "Your $osname does not have the sem*(2) configured." >&4
10545 set semctl d_semctl
10547 set semget d_semget
10555 : we could also check for sys/ipc.h ...
10556 if $h_sem && $test `./findhdr sys/sem.h`; then
10557 echo "You have the full sem*(2) library." >&4
10560 echo "You don't have the full sem*(2) library." >&4
10566 : see whether sys/sem.h defines union semun
10568 $cat > try.c <<'END'
10569 #include <sys/types.h>
10570 #include <sys/ipc.h>
10571 #include <sys/sem.h>
10572 int main () { union semun semun; semun.buf = 0; }
10575 if eval $compile; then
10576 echo "You have union semun in <sys/sem.h>." >&4
10579 echo "You do not have union semun in <sys/sem.h>." >&4
10582 $rm -f try try.c try.h
10586 : see how to do semctl IPC_STAT
10589 : see whether semctl IPC_STAT can use union semun
10594 # define S_IRUSR S_IREAD
10595 # define S_IWUSR S_IWRITE
10596 # define S_IXUSR S_IEXEC
10598 # define S_IRUSR 0400
10599 # define S_IWUSR 0200
10600 # define S_IXUSR 0100
10602 # define S_IRGRP (S_IRUSR>>3)
10603 # define S_IWGRP (S_IWUSR>>3)
10604 # define S_IXGRP (S_IXUSR>>3)
10605 # define S_IROTH (S_IRUSR>>6)
10606 # define S_IWOTH (S_IWUSR>>6)
10607 # define S_IXOTH (S_IXUSR>>6)
10610 # define S_IRWXU (S_IRUSR|S_IWUSR|S_IXUSR)
10611 # define S_IRWXG (S_IRGRP|S_IWGRP|S_IXGRP)
10612 # define S_IRWXO (S_IROTH|S_IWOTH|S_IXOTH)
10617 #include <sys/types.h>
10618 #include <sys/ipc.h>
10619 #include <sys/sem.h>
10620 #include <sys/stat.h>
10627 #$d_union_semun HAS_UNION_SEMUN
10630 #ifndef HAS_UNION_SEMUN
10633 struct semid_ds *buf;
10634 unsigned short *array;
10640 #if defined(IPC_PRIVATE) && defined(S_IRWXU) && defined(S_IRWXG) && defined(S_IRWXO) && defined(IPC_CREAT)
10641 sem = semget(IPC_PRIVATE, 1, S_IRWXU|S_IRWXG|S_IRWXO|IPC_CREAT);
10643 struct semid_ds argbuf;
10646 st = semctl(sem, 0, IPC_STAT, arg);
10650 # endif /* IPC_STAT */
10651 printf("semctl IPC_STAT failed: errno = %d\n", errno);
10653 if (semctl(sem, 0, IPC_RMID, arg) != 0)
10654 # endif /* IPC_RMID */
10655 printf("semctl IPC_RMID failed: errno = %d\n", errno);
10657 #endif /* IPC_PRIVATE && ... */
10658 printf("semget failed: errno = %d\n", errno);
10664 if eval $compile; then
10667 semun) val="$define" ;;
10673 case "$d_semctl_semun" in
10675 echo "You can use union semun for semctl IPC_STAT." >&4
10678 *) echo "You cannot use union semun for semctl IPC_STAT." >&4
10683 : see whether semctl IPC_STAT can use struct semid_ds pointer
10684 $cat > try.c <<'END'
10685 #include <sys/types.h>
10686 #include <sys/ipc.h>
10687 #include <sys/sem.h>
10688 #include <sys/stat.h>
10696 struct semid_ds arg;
10699 #if defined(IPC_PRIVATE) && defined(S_IRWXU) && defined(S_IRWXG) && defined(S_IRWXO) && defined(IPC_CREAT)
10700 sem = semget(IPC_PRIVATE, 1, S_IRWXU|S_IRWXG|S_IRWXO|IPC_CREAT);
10703 st = semctl(sem, 0, IPC_STAT, &arg);
10705 printf("semid_ds\n");
10707 # endif /* IPC_STAT */
10708 printf("semctl IPC_STAT failed: errno = %d\n", errno);
10710 if (semctl(sem, 0, IPC_RMID, &arg) != 0)
10711 # endif /* IPC_RMID */
10712 printf("semctl IPC_RMID failed: errno = %d\n", errno);
10714 #endif /* IPC_PRIVATE && ... */
10715 printf("semget failed: errno = %d\n", errno);
10722 if eval $compile; then
10725 semid_ds) val="$define" ;;
10729 set d_semctl_semid_ds
10731 case "$d_semctl_semid_ds" in
10733 echo "You can $also use struct semid_ds* for semctl IPC_STAT." >&4
10735 *) echo "You cannot use struct semid_ds* for semctl IPC_STAT." >&4
10742 # We do not have the full sem*(2) library, so assume we can not
10748 set d_semctl_semid_ds
10753 : see if setegid exists
10754 set setegid d_setegid
10757 : see if seteuid exists
10758 set seteuid d_seteuid
10761 : see if setgrent exists
10762 set setgrent d_setgrent
10765 : see if sethostent exists
10766 set sethostent d_sethent
10769 : see if setlinebuf exists
10770 set setlinebuf d_setlinebuf
10773 : see if setlocale exists
10774 set setlocale d_setlocale
10777 : see if setnetent exists
10778 set setnetent d_setnent
10781 : see if setprotoent exists
10782 set setprotoent d_setpent
10785 : see if setpgid exists
10786 set setpgid d_setpgid
10789 : see if setpgrp2 exists
10790 set setpgrp2 d_setpgrp2
10793 : see if setpriority exists
10794 set setpriority d_setprior
10797 : see if setpwent exists
10798 set setpwent d_setpwent
10801 : see if setregid exists
10802 set setregid d_setregid
10804 set setresgid d_setresgid
10807 : see if setreuid exists
10808 set setreuid d_setreuid
10810 set setresuid d_setresuid
10813 : see if setrgid exists
10814 set setrgid d_setrgid
10817 : see if setruid exists
10818 set setruid d_setruid
10821 : see if setservent exists
10822 set setservent d_setsent
10825 : see if setsid exists
10826 set setsid d_setsid
10829 : see if setspent exists
10830 set setspent d_setspent
10833 : see if setvbuf exists
10834 set setvbuf d_setvbuf
10837 : see if sfio.h is available
10842 : see if sfio library is available
10853 : Ok, but do we want to use it.
10857 true|$define|[yY]*) dflt='y';;
10860 echo "$package can use the sfio library, but it is experimental."
10861 rp="You seem to have sfio available, do you want to try using it?"
10865 *) echo "Ok, avoiding sfio this time. I'll use stdio instead."
10867 : Remove sfio from list of libraries to use
10868 set `echo X $libs | $sed -e 's/-lsfio / /' -e 's/-lsfio$//'`
10871 echo "libs = $libs" >&4
10875 *) case "$usesfio" in
10876 true|$define|[yY]*)
10877 echo "Sorry, cannot find sfio on this machine" >&4
10878 echo "Ignoring your setting of usesfio=$usesfio" >&4
10886 $define) usesfio='true';;
10887 *) usesfio='false';;
10890 : see if shmctl exists
10891 set shmctl d_shmctl
10894 : see if shmget exists
10895 set shmget d_shmget
10898 : see if shmat exists
10901 : see what shmat returns
10904 $cat >shmat.c <<'END'
10905 #include <sys/shm.h>
10908 if $cc $ccflags -c shmat.c >/dev/null 2>&1; then
10913 echo "and it returns ($shmattype)." >&4
10914 : see if a prototype for shmat is available
10915 xxx=`./findhdr sys/shm.h`
10916 $cppstdin $cppflags $cppminus < $xxx > shmat.c 2>/dev/null
10917 if $contains 'shmat.*(' shmat.c >/dev/null 2>&1; then
10928 set d_shmatprototype
10931 : see if shmdt exists
10935 : see how much of the 'shm*(2)' library is present.
10938 case "$d_shmctl$d_shmget$d_shmat$d_shmdt" in
10939 *"$undef"*) h_shm=false;;
10943 case "`ipcs 2>&1`" in
10944 "SVID shared memory"*"not configured"*)
10945 echo "Your $osname does not have the shm*(2) configured." >&4
10948 set shmctl d_shmctl
10950 set shmget d_shmget
10960 : we could also check for sys/ipc.h ...
10961 if $h_shm && $test `./findhdr sys/shm.h`; then
10962 echo "You have the full shm*(2) library." >&4
10965 echo "You don't have the full shm*(2) library." >&4
10972 : see if we have sigaction
10973 if set sigaction val -f d_sigaction; eval $csym; $val; then
10974 echo 'sigaction() found.' >&4
10975 $cat > try.c <<'EOP'
10977 #include <sys/types.h>
10978 #include <signal.h>
10981 struct sigaction act, oact;
10983 oact.sa_handler = 0;
10984 /* so that act and oact are used */
10985 exit(act.sa_flags == 0 && oact.sa_handler == 0);
10989 if eval $compile_ok; then
10992 echo "But you don't seem to have a useable struct sigaction." >&4
10996 echo 'sigaction NOT found.' >&4
10999 set d_sigaction; eval $setvar
11000 $rm -f try try$_o try.c
11002 : see if sigsetjmp exists
11004 case "$d_sigsetjmp" in
11006 $cat >try.c <<'EOP'
11007 #include <setjmp.h>
11012 if (sigsetjmp(env,1))
11015 siglongjmp(env, 1);
11020 if eval $compile; then
11021 if ./try >/dev/null 2>&1; then
11022 echo "POSIX sigsetjmp found." >&4
11026 Uh-Oh! You have POSIX sigsetjmp and siglongjmp, but they do not work properly!!
11032 echo "sigsetjmp not found." >&4
11036 *) val="$d_sigsetjmp"
11037 case "$d_sigsetjmp" in
11038 $define) echo "POSIX sigsetjmp found." >&4;;
11039 $undef) echo "sigsetjmp not found." >&4;;
11047 : see what type is used for size_t
11048 rp="What is the type used for the length parameter for string functions?"
11049 set size_t sizetype 'unsigned int' stdio.h sys/types.h
11052 : check for socklen_t
11054 echo "Checking to see if you have socklen_t..." >&4
11056 #include <sys/types.h>
11057 #$d_socket HAS_SOCKET
11059 #include <sys/socket.h>
11061 int main() { socklen_t x = 16; }
11064 if eval $compile; then
11066 echo "You have socklen_t."
11069 echo "You do not have socklen_t."
11070 case "$sizetype" in
11071 size_t) echo "(You do have size_t, that might work.)" ;;
11078 : see if sys/stat.h is available
11079 set sys/stat.h i_sysstat
11083 : see if stat knows about block sizes
11085 echo "Checking to see if your struct stat has st_blocks field..." >&4
11086 set d_statblks stat st_blocks $i_sysstat sys/stat.h
11090 : see if this is a sys/vfs.h system
11091 set sys/vfs.h i_sysvfs
11095 : see if this is a sys/statfs.h system
11096 set sys/statfs.h i_sysstatfs
11101 echo "Checking to see if your system supports struct statfs..." >&4
11102 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
11104 case "$d_statfs_s" in
11105 "$define") echo "Yes, it does." ;;
11106 *) echo "No, it doesn't." ;;
11111 : see if struct statfs knows about f_flags
11112 case "$d_statfs_s" in
11115 echo "Checking to see if your struct statfs has f_flags field..." >&4
11116 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
11120 set d_statfs_f_flags
11124 case "$d_statfs_f_flags" in
11125 "$define") echo "Yes, it does." ;;
11126 *) echo "No, it doesn't." ;;
11129 : see if _ptr and _cnt from stdio act std
11131 if $contains '_IO_fpos_t' `./findhdr stdio.h` `./findhdr libio.h` >/dev/null 2>&1 ; then
11132 echo "(Looks like you have stdio.h from Linux.)"
11133 case "$stdio_ptr" in
11134 '') stdio_ptr='((fp)->_IO_read_ptr)'
11137 *) ptr_lval=$d_stdio_ptr_lval;;
11139 case "$stdio_cnt" in
11140 '') stdio_cnt='((fp)->_IO_read_end - (fp)->_IO_read_ptr)'
11143 *) cnt_lval=$d_stdio_cnt_lval;;
11145 case "$stdio_base" in
11146 '') stdio_base='((fp)->_IO_read_base)';;
11148 case "$stdio_bufsiz" in
11149 '') stdio_bufsiz='((fp)->_IO_read_end - (fp)->_IO_read_base)';;
11152 case "$stdio_ptr" in
11153 '') stdio_ptr='((fp)->_ptr)'
11156 *) ptr_lval=$d_stdio_ptr_lval;;
11158 case "$stdio_cnt" in
11159 '') stdio_cnt='((fp)->_cnt)'
11162 *) cnt_lval=$d_stdio_cnt_lval;;
11164 case "$stdio_base" in
11165 '') stdio_base='((fp)->_base)';;
11167 case "$stdio_bufsiz" in
11168 '') stdio_bufsiz='((fp)->_cnt + (fp)->_ptr - (fp)->_base)';;
11171 : test whether _ptr and _cnt really work
11172 echo "Checking how std your stdio is..." >&4
11175 #define FILE_ptr(fp) $stdio_ptr
11176 #define FILE_cnt(fp) $stdio_cnt
11178 FILE *fp = fopen("try.c", "r");
11181 18 <= FILE_cnt(fp) &&
11182 strncmp(FILE_ptr(fp), "include <stdio.h>\n", 18) == 0
11190 if eval $compile; then
11192 echo "Your stdio acts pretty std."
11195 echo "Your stdio isn't very std."
11198 echo "Your stdio doesn't appear very std."
11204 : Can _ptr be used as an lvalue?
11205 case "$d_stdstdio$ptr_lval" in
11206 $define$define) val=$define ;;
11209 set d_stdio_ptr_lval
11212 : Can _cnt be used as an lvalue?
11213 case "$d_stdstdio$cnt_lval" in
11214 $define$define) val=$define ;;
11217 set d_stdio_cnt_lval
11220 : see if _base is also standard
11222 case "$d_stdstdio" in
11226 #define FILE_base(fp) $stdio_base
11227 #define FILE_bufsiz(fp) $stdio_bufsiz
11229 FILE *fp = fopen("try.c", "r");
11232 19 <= FILE_bufsiz(fp) &&
11233 strncmp(FILE_base(fp), "#include <stdio.h>\n", 19) == 0
11240 if eval $compile; then
11242 echo "And its _base field acts std."
11245 echo "But its _base field isn't std."
11248 echo "However, it seems to be lacking the _base field."
11257 Checking how to access stdio streams by file descriptor number...
11259 case "$stdio_stream_array" in
11260 '') $cat >try.c <<EOCP
11263 if (&STDIO_STREAM_ARRAY[fileno(stdin)] == stdin)
11267 for s in _iob __iob __sF
11269 set try -DSTDIO_STREAM_ARRAY=$s
11270 if eval $compile; then
11271 case "`./try$exe_ext`" in
11272 yes) stdio_stream_array=$s; break ;;
11276 $rm -f try.* try$exe_ext
11278 case "$stdio_stream_array" in
11280 I can't figure out how to access stdio streams by file descriptor number.
11282 d_stdio_stream_array="$undef"
11285 You can access stdio streams by file descriptor number by the $stdio_stream_array array.
11287 d_stdio_stream_array="$define"
11291 : see if strcoll exists
11292 set strcoll d_strcoll
11295 : check for structure copying
11297 echo "Checking to see if your C compiler can copy structs..." >&4
11298 $cat >try.c <<'EOCP'
11308 if $cc -c try.c >/dev/null 2>&1 ; then
11310 echo "Yup, it can."
11313 echo "Nope, it can't."
11319 : see if strerror and/or sys_errlist[] exist
11321 if test "X$d_strerror" = X -o "X$d_syserrlst" = X; then
11322 if set strerror val -f d_strerror; eval $csym; $val; then
11323 echo 'strerror() found.' >&4
11324 d_strerror="$define"
11325 d_strerrm='strerror(e)'
11326 if set sys_errlist val -a d_syserrlst; eval $csym; $val; then
11327 echo "(You also have sys_errlist[], so we could roll our own strerror.)"
11328 d_syserrlst="$define"
11330 echo "(Since you don't have sys_errlist[], sterror() is welcome.)"
11331 d_syserrlst="$undef"
11333 elif xxx=`./findhdr string.h`; test "$xxx" || xxx=`./findhdr strings.h`; \
11334 $contains '#[ ]*define.*strerror' "$xxx" >/dev/null 2>&1; then
11335 echo 'strerror() found in string header.' >&4
11336 d_strerror="$define"
11337 d_strerrm='strerror(e)'
11338 if set sys_errlist val -a d_syserrlst; eval $csym; $val; then
11339 echo "(Most probably, strerror() uses sys_errlist[] for descriptions.)"
11340 d_syserrlst="$define"
11342 echo "(You don't appear to have any sys_errlist[], how can this be?)"
11343 d_syserrlst="$undef"
11345 elif set sys_errlist val -a d_syserrlst; eval $csym; $val; then
11346 echo "strerror() not found, but you have sys_errlist[] so we'll use that." >&4
11347 d_strerror="$undef"
11348 d_syserrlst="$define"
11349 d_strerrm='((e)<0||(e)>=sys_nerr?"unknown":sys_errlist[e])'
11351 echo 'strerror() and sys_errlist[] NOT found.' >&4
11352 d_strerror="$undef"
11353 d_syserrlst="$undef"
11354 d_strerrm='"unknown"'
11358 : see if strtod exists
11359 set strtod d_strtod
11362 : see if strtol exists
11363 set strtol d_strtol
11366 : see if strtold exists
11367 set strtold d_strtold
11370 : see if strtoll exists
11371 set strtoll d_strtoll
11374 : see if strtoul exists
11375 set strtoul d_strtoul
11378 : see if strtoull exists
11379 set strtoull d_strtoull
11382 : see if strtouq exists
11383 set strtouq d_strtouq
11386 : see if strxfrm exists
11387 set strxfrm d_strxfrm
11390 : see if symlink exists
11391 set symlink d_symlink
11394 : see if syscall exists
11395 set syscall d_syscall
11398 : see if sysconf exists
11399 set sysconf d_sysconf
11402 : see if system exists
11403 set system d_system
11406 : see if tcgetpgrp exists
11407 set tcgetpgrp d_tcgetpgrp
11410 : see if tcsetpgrp exists
11411 set tcsetpgrp d_tcsetpgrp
11414 : see if prototype for telldir is available
11416 set d_telldirproto telldir $i_systypes sys/types.h $i_dirent dirent.h
11419 : see if this is a sys/times.h system
11420 set sys/times.h i_systimes
11423 : see if times exists
11425 if set times val -f d_times; eval $csym; $val; then
11426 echo 'times() found.' >&4
11429 case "$i_systimes" in
11430 "$define") inc='sys/times.h';;
11432 rp="What is the type returned by times() on this system?"
11433 set clock_t clocktype long stdio.h sys/types.h $inc
11436 echo 'times() NOT found, hope that will do.' >&4
11441 : see if truncate exists
11442 set truncate d_truncate
11445 : see if tzname[] exists
11447 if set tzname val -a d_tzname; eval $csym; $val; then
11449 echo 'tzname[] found.' >&4
11452 echo 'tzname[] NOT found.' >&4
11457 : see if umask exists
11461 : see if ustat exists
11465 : backward compatibility for d_hvfork
11466 if test X$d_hvfork != X; then
11467 d_vfork="$d_hvfork"
11470 : see if there is a vfork
11475 : Ok, but do we want to use it. vfork is reportedly unreliable in
11476 : perl on Solaris 2.x, and probably elsewhere.
11480 case "$usevfork" in
11486 Perl can only use a vfork() that doesn't suffer from strict
11487 restrictions on calling functions or modifying global data in
11488 the child. For example, glibc-2.1 contains such a vfork()
11489 that is unsuitable. If your system provides a proper fork()
11490 call, chances are that you do NOT want perl to use vfork().
11493 rp="Do you still want to use vfork()?"
11498 echo "Ok, we won't use vfork()."
11507 $define) usevfork='true';;
11508 *) usevfork='false';;
11511 : see if this is an sysdir system
11512 set sys/dir.h i_sysdir
11515 : see if this is an sysndir system
11516 set sys/ndir.h i_sysndir
11519 : see if closedir exists
11520 set closedir d_closedir
11523 case "$d_closedir" in
11526 echo "Checking whether closedir() returns a status..." >&4
11527 cat > closedir.c <<EOM
11528 #$i_dirent I_DIRENT /**/
11529 #$i_sysdir I_SYS_DIR /**/
11530 #$i_sysndir I_SYS_NDIR /**/
11531 #$i_systypes I_SYS_TYPES /**/
11533 #if defined(I_SYS_TYPES)
11534 #include <sys/types.h>
11536 #if defined(I_DIRENT)
11537 #include <dirent.h>
11538 #if defined(NeXT) && defined(I_SYS_DIR) /* NeXT needs dirent + sys/dir.h */
11539 #include <sys/dir.h>
11543 #include <sys/ndir.h>
11547 #include <ndir.h> /* may be wrong in the future */
11549 #include <sys/dir.h>
11554 int main() { return closedir(opendir(".")); }
11557 if eval $compile_ok; then
11558 if ./closedir > /dev/null 2>&1 ; then
11559 echo "Yes, it does."
11562 echo "No, it doesn't."
11566 echo "(I can't seem to compile the test program--assuming it doesn't)"
11574 set d_void_closedir
11577 : check for volatile keyword
11579 echo 'Checking to see if your C compiler knows about "volatile"...' >&4
11580 $cat >try.c <<'EOCP'
11583 typedef struct _goo_struct goo_struct;
11584 goo_struct * volatile goo = ((goo_struct *)0);
11585 struct _goo_struct {
11590 typedef unsigned short foo_t;
11591 char *volatile foo;
11593 volatile foo_t blech;
11597 if $cc -c $ccflags try.c >/dev/null 2>&1 ; then
11599 echo "Yup, it does."
11602 echo "Nope, it doesn't."
11608 : see if there is a wait4
11612 : see if waitpid exists
11613 set waitpid d_waitpid
11616 : see if wcstombs exists
11617 set wcstombs d_wcstombs
11620 : see if wctomb exists
11621 set wctomb d_wctomb
11624 : preserve RCS keywords in files with variable substitution, grrr
11629 Revision='$Revision'
11631 case "$crosscompile" in
11632 ''|[nN]*) crosscompile="$undef" ;;
11636 next|rhapsody) multiarch="$define" ;;
11638 case "$multiarch" in
11639 ''|[nN]*) multiarch="$undef" ;;
11642 : check for alignment requirements
11644 case "$crosscompile$multiarch" in
11647 You seem to be either cross-compiling or doing a multiarchitecture build,
11648 skipping the memory alignment check.
11651 case "$alignbytes" in
11652 '') alignbytes=8 ;;
11656 case "$alignbytes" in
11657 '') echo "Checking alignment constraints..." >&4
11658 if $test "X$uselongdouble" = Xdefine -a "X$d_longdbl" = Xdefine; then
11659 $cat >try.c <<'EOCP'
11660 typedef long double NV;
11663 $cat >try.c <<'EOCP'
11667 $cat >>try.c <<'EOCP'
11675 printf("%d\n", (int)((char *)&try_algn.bar - (char *)&try_algn.foo));
11680 if eval $compile_ok; then
11684 echo "(I can't seem to compile the test program...)"
11687 *) dflt="$alignbytes"
11690 rp="Doubles must be aligned on a how-many-byte boundary?"
11698 : set the base revision
11701 : check for ordering of bytes in a long
11703 case "$crosscompile$multiarch" in
11706 You seem to be either cross-compiling or doing a multiarchitecture build,
11707 skipping the byteorder check.
11713 case "$byteorder" in
11716 In the following, larger digits indicate more significance. A big-endian
11717 machine like a Pyramid or a Motorola 680?0 chip will come out to 4321. A
11718 little-endian machine like a Vax or an Intel 80?86 chip would be 1234. Other
11719 machines may have weird orders like 3412. A Cray will report 87654321,
11720 an Alpha will report 12345678. If the test program works the default is
11722 I'm now running the test program...
11724 $cat >try.c <<'EOCP'
11731 char c[sizeof(long)];
11734 if (sizeof(long) > 4)
11735 u.l = (0x08070605L << 32) | 0x04030201L;
11738 for (i = 0; i < sizeof(long); i++)
11739 printf("%c", u.c[i]+'0');
11746 if eval $compile && ./try > /dev/null; then
11749 [1-4][1-4][1-4][1-4]|12345678|87654321)
11750 echo "(The test program ran ok.)"
11751 echo "byteorder=$dflt"
11754 ????|????????) echo "(The test program ran ok.)" ;;
11755 *) echo "(The test program didn't run right for some reason.)" ;;
11760 (I can't seem to compile the test program. Guessing big-endian...)
11763 case "$xxx_prompt" in
11765 rp="What is the order of bytes in a long?"
11779 : how do we catenate cpp tokens here?
11781 echo "Checking to see how your cpp does stuff like catenate tokens..." >&4
11782 $cat >cpp_stuff.c <<'EOCP'
11783 #define RCAT(a,b)a/**/b
11784 #define ACAT(a,b)a ## b
11788 $cppstdin $cppflags $cppminus <cpp_stuff.c >cpp_stuff.out 2>&1
11789 if $contains 'Circus' cpp_stuff.out >/dev/null 2>&1; then
11790 echo "Oh! Smells like ANSI's been here." >&4
11791 echo "We can catify or stringify, separately or together!"
11793 elif $contains 'Reiser' cpp_stuff.out >/dev/null 2>&1; then
11794 echo "Ah, yes! The good old days!" >&4
11795 echo "However, in the good old days we don't know how to stringify and"
11796 echo "catify at the same time."
11800 Hmm, I don't seem to be able to catenate tokens with your cpp. You're going
11801 to have to edit the values of CAT[2-5] in config.h...
11803 cpp_stuff="/* Help! How do we handle cpp_stuff? */*/"
11807 : see if this is a db.h system
11813 : Check db version.
11815 echo "Checking Berkeley DB version ..." >&4
11821 #include <sys/types.h>
11826 #ifdef DB_VERSION_MAJOR /* DB version >= 2 */
11827 int Major, Minor, Patch ;
11828 unsigned long Version ;
11829 (void)db_version(&Major, &Minor, &Patch) ;
11830 printf("You have Berkeley DB Version 2 or greater\n");
11832 printf("db.h is from Berkeley DB Version %d.%d.%d\n",
11833 DB_VERSION_MAJOR, DB_VERSION_MINOR, DB_VERSION_PATCH);
11834 printf("libdb is from Berkeley DB Version %d.%d.%d\n",
11835 Major, Minor, Patch) ;
11837 /* check that db.h & libdb are compatible */
11838 if (DB_VERSION_MAJOR != Major || DB_VERSION_MINOR != Minor || DB_VERSION_PATCH != Patch) {
11839 printf("db.h and libdb are incompatible\n") ;
11843 printf("db.h and libdb are compatible\n") ;
11845 Version = DB_VERSION_MAJOR * 1000000 + DB_VERSION_MINOR * 1000
11846 + DB_VERSION_PATCH ;
11848 /* needs to be >= 2.3.4 */
11849 if (Version < 2003004) {
11850 /* if (DB_VERSION_MAJOR == 2 && DB_VERSION_MINOR == 0 && DB_VERSION_PATCH < 5) { */
11851 printf("but Perl needs Berkeley DB 2.3.4 or greater\n") ;
11857 #if defined(_DB_H_) && defined(BTREEMAGIC) && defined(HASHMAGIC)
11858 printf("You have Berkeley DB Version 1\n");
11859 exit(0); /* DB version < 2: the coast is clear. */
11861 exit(1); /* <db.h> not Berkeley DB? */
11867 if eval $compile_ok && ./try; then
11868 echo 'Looks OK.' >&4
11870 echo "I can't use Berkeley DB with your <db.h>. I'll disable Berkeley DB." >&4
11874 : Remove db from list of libraries to use
11875 echo "Removing unusable -ldb from library list" >&4
11876 set `echo X $libs | $sed -e 's/-ldb / /' -e 's/-ldb$//'`
11879 echo "libs = $libs" >&4
11889 : Check the return type needed for hash
11891 echo "Checking return type needed for hash for Berkeley DB ..." >&4
11897 #include <sys/types.h>
11900 #ifndef DB_VERSION_MAJOR
11901 u_int32_t hash_cb (ptr, size)
11909 info.hash = hash_cb;
11913 if $cc $ccflags -c try.c >try.out 2>&1 ; then
11914 if $contains warning try.out >>/dev/null 2>&1 ; then
11917 db_hashtype='u_int32_t'
11920 : XXX Maybe we should just give up here.
11921 db_hashtype=u_int32_t
11923 echo "Help: I can't seem to compile the db test program." >&4
11924 echo "Something's wrong, but I'll assume you use $db_hashtype." >&4
11927 echo "Your version of Berkeley DB uses $db_hashtype for hash."
11929 *) db_hashtype=u_int32_t
11934 : Check the return type needed for prefix
11936 echo "Checking return type needed for prefix for Berkeley DB ..." >&4
11942 #include <sys/types.h>
11945 #ifndef DB_VERSION_MAJOR
11946 size_t prefix_cb (key1, key2)
11954 info.prefix = prefix_cb;
11958 if $cc $ccflags -c try.c >try.out 2>&1 ; then
11959 if $contains warning try.out >>/dev/null 2>&1 ; then
11960 db_prefixtype='int'
11962 db_prefixtype='size_t'
11965 db_prefixtype='size_t'
11966 : XXX Maybe we should just give up here.
11968 echo "Help: I can't seem to compile the db test program." >&4
11969 echo "Something's wrong, but I'll assume you use $db_prefixtype." >&4
11972 echo "Your version of Berkeley DB uses $db_prefixtype for prefix."
11974 *) db_prefixtype='size_t'
11978 : check for void type
11980 echo "Checking to see how well your C compiler groks the void type..." >&4
11981 case "$voidflags" in
11983 $cat >try.c <<'EOCP'
11989 extern void moo(); /* function returning void */
11990 void (*goo)(); /* ptr to func returning void */
11992 void *hue; /* generic ptr */
12005 int main() { sub(); }
12007 if $cc $ccflags -c -DTRY=$defvoidused try.c >.out 2>&1 ; then
12008 voidflags=$defvoidused
12009 echo "Good. It appears to support void to the level $package wants.">&4
12010 if $contains warning .out >/dev/null 2>&1; then
12011 echo "However, you might get some warnings that look like this:"
12015 echo "Hmm, your compiler has some difficulty with void. Checking further..." >&4
12016 if $cc $ccflags -c -DTRY=1 try.c >/dev/null 2>&1; then
12017 echo "It supports 1..."
12018 if $cc $ccflags -c -DTRY=3 try.c >/dev/null 2>&1; then
12019 echo "It also supports 2..."
12020 if $cc $ccflags -c -DTRY=7 try.c >/dev/null 2>&1; then
12022 echo "And it supports 4 but not 8 definitely."
12024 echo "It doesn't support 4..."
12025 if $cc $ccflags -c -DTRY=11 try.c >/dev/null 2>&1; then
12027 echo "But it supports 8."
12030 echo "Neither does it support 8."
12034 echo "It does not support 2..."
12035 if $cc $ccflags -c -DTRY=13 try.c >/dev/null 2>&1; then
12037 echo "But it supports 4 and 8."
12039 if $cc $ccflags -c -DTRY=5 try.c >/dev/null 2>&1; then
12041 echo "And it supports 4 but has not heard about 8."
12043 echo "However it supports 8 but not 4."
12048 echo "There is no support at all for void."
12053 case "$voidflags" in
12055 *) $cat >&4 <<'EOM'
12056 Support flag bits are:
12057 1: basic void declarations.
12058 2: arrays of pointers to functions returning void.
12059 4: operations between pointers to and addresses of void functions.
12060 8: generic void pointers.
12063 rp="Your void support flags add up to what?"
12071 : How can we generate normalized random numbers ?
12073 echo "Looking for a random number function..." >&4
12074 case "$randfunc" in
12076 if set drand48 val -f; eval $csym; $val; then
12078 echo "Good, found drand48()." >&4
12079 elif set random val -f; eval $csym; $val; then
12081 echo "OK, found random()." >&4
12084 echo "Yick, looks like I have to use rand()." >&4
12095 *-Dmy_rand=*|*-Dmy_srand=*)
12096 echo "Removing obsolete -Dmy_rand, -Dmy_srand, and -Drandbits from ccflags." >&4
12097 ccflags="`echo $ccflags | sed -e 's/-Dmy_rand=random/ /'`"
12098 ccflags="`echo $ccflags | sed -e 's/-Dmy_srand=srandom/ /'`"
12099 ccflags="`echo $ccflags | sed -e 's/-Drandbits=[0-9][0-9]*/ /'`"
12103 while $test "$cont"; do
12104 rp="Use which function to generate random numbers?"
12106 if $test "$ans" = "$dflt"; then
12112 if set $ans val -f; eval $csym; $val; then
12116 rp="I cannot find function $ans. Use that name anyway?"
12125 case "$randfunc" in
12127 drand01="drand48()"
12133 case "$randbits" in
12135 echo "Checking to see how many bits your $randfunc() function produces..." >&4
12137 #$i_unistd I_UNISTD
12138 #$i_stdlib I_STDLIB
12141 # include <unistd.h>
12144 # include <stdlib.h>
12149 register unsigned long tmp;
12150 register unsigned long max = 0L;
12152 for (i = 1000; i; i--) {
12153 tmp = (unsigned long) $randfunc();
12154 if (tmp > max) max = tmp;
12156 for (i = 0; max; i++)
12162 if eval $compile_ok; then
12166 echo "(I can't seem to compile the test program...)"
12173 rp="How many bits does your $randfunc() function produce?"
12177 drand01="($randfunc() / (double) ((unsigned long)1 << $randbits))"
12178 seedfunc="s$randfunc"
12179 randseedtype=unsigned
12183 rp="How many bits does your $randfunc() function produce?"
12186 seedfunc="s$randfunc"
12187 drand01="($randfunc() / (double) ((unsigned long)1 << $randbits))"
12188 if set $seedfunc val -f; eval $csym; $val; then
12189 echo "(Using $seedfunc() to seed random generator)"
12191 echo "(Warning: no $seedfunc() to seed random generator)"
12194 randseedtype=unsigned
12202 echo "Determining whether or not we are on an EBCDIC system..." >&4
12203 $cat >tebcdic.c <<'EOM'
12206 if ('M'==0xd4) return 0;
12213 if eval $compile_ok; then
12215 echo "You have EBCDIC." >&4
12218 echo "Nope, no EBCDIC, probably ASCII or some ISO Latin." >&4
12221 echo "I'm unable to compile the test program." >&4
12222 echo "I'll assume ASCII or some ISO Latin." >&4
12224 $rm -f tebcdic.c tebcdic
12230 Checking how to flush all pending stdio output...
12232 # I only know how to find the first 32 possibly open files on SunOS.
12233 # See also hints/sunos_4_1.sh and util.c --AD
12235 sunos) $echo '#define PERL_FFLUSH_ALL_FOPEN_MAX 32' > try.c ;;
12237 $cat >>try.c <<EOCP
12239 #$i_unistd I_UNISTD
12241 # include <unistd.h>
12243 #$d_sysconf HAS_SYSCONF
12244 #$d_stdio_stream_array HAS_STDIO_STREAM_ARRAY
12245 #ifdef HAS_STDIO_STREAM_ARRAY
12246 # define STDIO_STREAM_ARRAY $stdio_stream_array
12249 FILE* p = fopen("try.out", "w");
12253 # ifdef TRY_FPRINTF
12257 #ifdef TRY_FFLUSH_NULL
12260 #ifdef TRY_FFLUSH_ALL
12262 long open_max = -1;
12263 # ifdef PERL_FFLUSH_ALL_FOPEN_MAX
12264 open_max = PERL_FFLUSH_ALL_FOPEN_MAX;
12266 # if defined(HAS_SYSCONF) && defined(_SC_OPEN_MAX)
12267 open_max = sysconf(_SC_OPEN_MAX);
12270 open_max = FOPEN_MAX;
12273 open_max = OPEN_MAX;
12282 # ifdef HAS_STDIO_STREAM_ARRAY
12283 if (open_max > 0) {
12285 for (i = 0; i < open_max; i++)
12286 if (STDIO_STREAM_ARRAY[i]._file >= 0 &&
12287 STDIO_STREAM_ARRAY[i]._file < open_max &&
12288 STDIO_STREAM_ARRAY[i]._flag)
12289 fflush(&STDIO_STREAM_ARRAY[i]);
12297 : first we have to find out how _not_ to flush
12298 if $test "X$fflushNULL" = X -o "X$fflushall" = X; then
12300 set try -DTRY_FPUTC
12301 if eval $compile; then
12303 ./try$exe_ext 2>/dev/null
12304 if $test ! -s try.out -a "X$?" = X42; then
12310 set try -DTRY_FPRINTF
12312 if eval $compile; then
12314 ./try$exe_ext 2>/dev/null
12315 if $test ! -s try.out -a "X$?" = X42; then
12316 output=-DTRY_FPRINTF
12322 : check for fflush NULL behaviour
12323 case "$fflushNULL" in
12324 '') set try -DTRY_FFLUSH_NULL $output
12325 if eval $compile; then
12327 ./try$exe_ext 2>/dev/null
12329 if $test -s try.out -a "X$code" = X42; then
12330 fflushNULL="`$cat try.out`"
12332 if $test "X$code" != X42; then
12334 (If this test failed, don't worry, we'll try another method shortly.)
12339 $rm -f core try.core core.try.*
12340 case "$fflushNULL" in
12342 Your fflush(NULL) works okay.
12344 fflushNULL="$define"
12347 Your fflush(NULL) isn't working (contrary to ANSI C).
12349 fflushNULL="$undef"
12352 Cannot figure out whether your fflush(NULL) works or not.
12353 I'm assuming it doesn't (contrary to ANSI C).
12355 fflushNULL="$undef"
12359 $define|true|[yY]*)
12360 fflushNULL="$define"
12363 fflushNULL="$undef"
12366 : check explicit looping only if NULL did not work
12367 case "$fflushNULL" in
12369 : check for fflush all behaviour
12370 case "$fflushall" in
12371 '') set try -DTRY_FFLUSH_ALL $output
12372 if eval $compile; then
12374 (Now testing the other method--but note that also this may fail.)
12377 ./try$exe_ext 2>/dev/null
12378 if $test -s try.out -a "X$?" = X42; then
12379 fflushall="`$cat try.out`"
12382 $rm -f core try.core core.try.*
12383 case "$fflushall" in
12385 Whew. Flushing explicitly all the stdio streams works.
12387 fflushall="$define"
12390 Sigh. Flushing explicitly all the stdio streams doesn't work.
12395 Cannot figure out whether flushing stdio streams explicitly works or not.
12396 I'm assuming it doesn't.
12402 "$define"|true|[yY]*)
12403 fflushall="$define"
12410 *) fflushall="$undef"
12413 case "$fflushNULL$fflushall" in
12416 I cannot figure out how to flush pending stdio output.
12420 $rm -f try.* try$exe_ext
12422 : Store the full pathname to the ar program for use in the C program
12423 : Respect a hint or command line value for full_ar.
12428 : Store the full pathname to the sed program for use in the C program
12431 : see what type gids are declared as in the kernel
12433 echo "Looking for the type for group ids returned by getgid()."
12434 set gid_t gidtype xxx stdio.h sys/types.h
12438 xxx=`./findhdr sys/user.h`
12439 set `grep 'groups\[NGROUPS\];' "$xxx" 2>/dev/null` unsigned short
12441 unsigned) dflt="$1 $2" ;;
12445 *) dflt="$gidtype";;
12448 gid_t) echo "gid_t found." ;;
12449 *) rp="What is the type for group ids returned by getgid()?"
12457 *_t) zzz="$gidtype" ;;
12460 echo "Checking the size of $zzz..." >&4
12462 #include <sys/types.h>
12465 printf("%d\n", (int)sizeof($gidtype));
12470 if eval $compile_ok; then
12474 echo "(I can't execute the test program--guessing $gidsize.)" >&4
12477 echo "Your $zzz is $gidsize bytes long."
12482 echo "(I can't compile the test program--guessing $gidsize.)" >&4
12488 *_t) zzz="$gidtype" ;;
12491 echo "Checking the sign of $zzz..." >&4
12493 #include <sys/types.h>
12504 if eval $compile; then
12508 echo "(I can't execute the test program--guessing unsigned.)" >&4
12512 1) echo "Your $zzz is unsigned." ;;
12513 -1) echo "Your $zzz is signed." ;;
12519 echo "(I can't compile the test program--guessing unsigned.)" >&4
12525 if $test X"$quadtype" != X; then
12527 echo "Checking how to print 64-bit integers..." >&4
12529 if $test X"$sPRId64" = X -a X"$quadtype" = Xint; then
12530 $cat >try.c <<'EOCP'
12531 #include <sys/types.h>
12534 int q = 12345678901;
12535 printf("%ld\n", q);
12539 if eval $compile; then
12540 yyy=`./try$exe_ext`
12543 sPRId64='"d"'; sPRIi64='"i"'; sPRIu64='"u"';
12544 sPRIo64='"o"'; sPRIx64='"x"'; sPRIX64='"X"';
12545 echo "We will use %d."
12551 if $test X"$sPRId64" = X -a X"$quadtype" = Xlong; then
12552 $cat >try.c <<'EOCP'
12553 #include <sys/types.h>
12556 long q = 12345678901;
12557 printf("%ld\n", q);
12561 if eval $compile; then
12562 yyy=`./try$exe_ext`
12565 sPRId64='"ld"'; sPRIi64='"li"'; sPRIu64='"lu"';
12566 sPRIo64='"lo"'; sPRIx64='"lx"'; sPRIX64='"lX"';
12567 echo "We will use %ld."
12573 if $test X"$sPRId64" = X -a X"$i_inttypes" = X"$define" -a X"$quadtype" = Xint64_t; then
12574 $cat >try.c <<'EOCP'
12575 #include <sys/types.h>
12576 #include <inttypes.h>
12579 int64_t q = 12345678901;
12580 printf("%" PRId64 "\n", q);
12584 if eval $compile; then
12585 yyy=`./try$exe_ext`
12588 sPRId64=PRId64; sPRIi64=PRIi64; sPRIu64=PRIu64;
12589 sPRIo64=PRIo64; sPRIx64=PRIx64; sPRIX64=PRIX64;
12590 echo "We will use the C9X style."
12596 if $test X"$sPRId64" = X -a X"$quadtype" = X"long long"; then
12597 $cat >try.c <<'EOCP'
12598 #include <sys/types.h>
12601 long long q = 12345678901LL; /* AIX cc requires the LL prefix. */
12602 printf("%lld\n", q);
12606 if eval $compile; then
12607 yyy=`./try$exe_ext`
12610 sPRId64='"lld"'; sPRIi64='"lli"'; sPRIu64='"llu"';
12611 sPRIo64='"llo"'; sPRIx64='"llx"'; sPRIX64='"llX"';
12612 echo "We will use the %lld style."
12618 if $test X"$sPRId64" = X -a X"$quadtype" != X; then
12620 #include <sys/types.h>
12623 $quadtype q = 12345678901;
12624 printf("%Ld\n", q);
12628 if eval $compile; then
12629 yyy=`./try$exe_ext`
12632 sPRId64='"Ld"'; sPRIi64='"Li"'; sPRIu64='"Lu"';
12633 sPRIo64='"Lo"'; sPRIx64='"Lx"'; sPRIX64='"LX"';
12634 echo "We will use %Ld."
12640 if $test X"$sPRId64" = X -a X"$quadtype" != X; then
12642 #include <sys/types.h>
12645 $quadtype q = 12345678901;
12646 printf("%qd\n", q);
12650 if eval $compile; then
12651 yyy=`./try$exe_ext`
12654 sPRId64='"qd"'; sPRIi64='"qi"'; sPRIu64='"qu"';
12655 sPRIo64='"qo"'; sPRIx64='"qx"'; sPRIX64='"qX"';
12656 echo "We will use %qd."
12662 if $test X"$sPRId64" = X; then
12663 echo "Cannot figure out how to print 64-bit integers." >&4
12671 '') d_PRId64="$undef"; d_PRIi64="$undef"; d_PRIu64="$undef";
12672 d_PRIo64="$undef"; d_PRIx64="$undef"; d_PRIX64="$undef";
12674 *) d_PRId64="$define"; d_PRIi64="$define"; d_PRIu64="$define";
12675 d_PRIo64="$define"; d_PRIx64="$define"; d_PRIX64="$define";
12681 $echo "Checking the format strings to be used for Perl's internal types..." >&4
12683 if $test X"$ivsize" = X8; then
12684 ivdformat="$sPRId64"
12685 uvuformat="$sPRIu64"
12686 uvoformat="$sPRIo64"
12687 uvxformat="$sPRIx64"
12689 if $test X"$ivsize" = X"$longsize"; then
12695 if $test X"$ivsize" = X"$intsize"; then
12702 if $test X"$ivsize" = X"$shortsize"; then
12712 case "$ivdformat" in
12713 '') echo "$0: Fatal: failed to find format strings, cannot continue." >& 4
12720 $echo "Checking the format string to be used for gids..." >&4
12723 -1) if $test X"$gidsize" = X"$ivsize"; then
12724 gidformat="$ivdformat"
12726 if $test X"$gidsize" = X"$longsize"; then
12729 if $test X"$gidsize" = X"$intsize"; then
12732 if $test X"$gidsize" = X"$shortsize"; then
12739 *) if $test X"$gidsize" = X"$uvsize"; then
12740 gidformat="$uvuformat"
12742 if $test X"$gidsize" = X"$longsize"; then
12745 if $test X"$gidsize" = X"$intsize"; then
12748 if $test X"$gidsize" = X"$shortsize"; then
12757 : see if getgroups exists
12758 set getgroups d_getgrps
12761 : see if setgroups exists
12762 set setgroups d_setgrps
12766 : Find type of 2nd arg to 'getgroups()' and 'setgroups()'
12768 case "$d_getgrps$d_setgrps" in
12770 case "$groupstype" in
12771 '') dflt="$gidtype" ;;
12772 *) dflt="$groupstype" ;;
12775 What type of pointer is the second argument to getgroups() and setgroups()?
12776 Usually this is the same as group ids, $gidtype, but not always.
12779 rp='What type pointer is the second argument to getgroups() and setgroups()?'
12783 *) groupstype="$gidtype";;
12787 echo "Checking if your $make program sets \$(MAKE)..." >&4
12788 case "$make_set_make" in
12790 $sed 's/^X //' > testmake.mak << 'EOF'
12792 X @echo 'maketemp="$(MAKE)"'
12794 case "`$make -f testmake.mak 2>/dev/null`" in
12795 *maketemp=*) make_set_make='#' ;;
12796 *) make_set_make="MAKE=$make" ;;
12798 $rm -f testmake.mak
12801 case "$make_set_make" in
12802 '#') echo "Yup, it does.";;
12803 *) echo "Nope, it doesn't.";;
12806 : see what type is used for mode_t
12807 rp="What is the type used for file modes for system calls (e.g. fchmod())?"
12808 set mode_t modetype int stdio.h sys/types.h
12811 : define a fucntion to check prototypes
12812 $cat > protochk <<EOSH
12815 optimize="$optimize"
12817 prototype="$prototype"
12822 $cat >> protochk <<'EOSH'
12827 while test $# -ge 2; do
12829 $define) echo "#include <$2>" >> try.c ;;
12830 literal) echo "$2" >> try.c ;;
12834 test "$prototype" = "$define" && echo '#define CAN_PROTOTYPE' >> try.c
12835 cat >> try.c <<'EOCP'
12836 #ifdef CAN_PROTOTYPE
12837 #define _(args) args
12842 echo "$foo" >> try.c
12843 echo 'int no_real_function_has_this_name _((void)) { return 0; }' >> try.c
12844 $cc $optimize $ccflags -c try.c > /dev/null 2>&1
12850 $eunicefix protochk
12852 : check for type of arguments to gethostbyaddr.
12853 if test "X$netdb_host_type" = X -o "X$netdb_hlen_type" = X; then
12854 case "$d_gethbyaddr" in
12858 Checking to see what type of arguments are accepted by gethostbyaddr().
12860 hdrs="$define sys/types.h
12861 $d_socket sys/socket.h
12862 $i_niin netinet/in.h
12864 $i_unistd unistd.h"
12865 : The first arg can 'char *' or 'void *'
12866 : The second arg is some of integral type
12867 for xxx in in_addr_t 'const void *' 'const char *' 'void *' 'char *'; do
12868 for yyy in size_t long int; do
12869 case "$netdb_host_type" in
12870 '') try="extern struct hostent *gethostbyaddr($xxx, $yyy, int);"
12871 if ./protochk "$try" $hdrs; then
12872 echo "Your system accepts $xxx for the first arg."
12873 echo "...and $yyy for the second arg."
12874 netdb_host_type="$xxx"
12875 netdb_hlen_type="$yyy"
12881 : In case none of those worked, prompt the user.
12882 case "$netdb_host_type" in
12883 '') rp='What is the type for the 1st argument to gethostbyaddr?'
12886 netdb_host_type=$ans
12887 rp='What is the type for the 2nd argument to gethostbyaddr?'
12890 netdb_hlen_type=$ans
12894 *) : no gethostbyaddr, so pick harmless defaults
12895 netdb_host_type='char *'
12896 netdb_hlen_type="$sizetype"
12899 # Remove the "const" if needed. -- but then we'll have a
12901 # netdb_host_type=`echo "$netdb_host_type" | sed 's/^const //'`
12904 : check for type of argument to gethostbyname.
12905 if test "X$netdb_name_type" = X ; then
12906 case "$d_gethbyname" in
12910 Checking to see what type of argument is accepted by gethostbyname().
12912 hdrs="$define sys/types.h
12913 $d_socket sys/socket.h
12914 $i_niin netinet/in.h
12916 $i_unistd unistd.h"
12917 for xxx in "const char *" "char *"; do
12918 case "$netdb_name_type" in
12919 '') try="extern struct hostent *gethostbyname($xxx);"
12920 if ./protochk "$try" $hdrs; then
12921 echo "Your system accepts $xxx."
12922 netdb_name_type="$xxx"
12927 : In case none of those worked, prompt the user.
12928 case "$netdb_name_type" in
12929 '') rp='What is the type for the 1st argument to gethostbyname?'
12932 netdb_name_type=$ans
12936 *) : no gethostbyname, so pick harmless default
12937 netdb_name_type='char *'
12942 : check for type of 1st argument to getnetbyaddr.
12943 if test "X$netdb_net_type" = X ; then
12944 case "$d_getnbyaddr" in
12948 Checking to see what type of 1st argument is accepted by getnetbyaddr().
12950 hdrs="$define sys/types.h
12951 $d_socket sys/socket.h
12952 $i_niin netinet/in.h
12954 $i_unistd unistd.h"
12955 for xxx in in_addr_t "unsigned long" long "unsigned int" int; do
12956 case "$netdb_net_type" in
12957 '') try="extern struct netent *getnetbyaddr($xxx, int);"
12958 if ./protochk "$try" $hdrs; then
12959 echo "Your system accepts $xxx."
12960 netdb_net_type="$xxx"
12965 : In case none of those worked, prompt the user.
12966 case "$netdb_net_type" in
12967 '') rp='What is the type for the 1st argument to getnetbyaddr?'
12970 netdb_net_type=$ans
12974 *) : no getnetbyaddr, so pick harmless default
12975 netdb_net_type='long'
12979 : locate the preferred pager for this system
12993 '') dflt=/usr/ucb/more;;
13000 rp='What pager is used on your system?'
13004 : see what type pids are declared as in the kernel
13005 rp="What is the type of process ids on this system?"
13006 set pid_t pidtype int stdio.h sys/types.h
13009 : Find earliest binary compatible site_perl subdirectory perl can use.
13010 case "$bincompat5005" in
13011 "$define") xs_apiversion='5.005' ;;
13012 *) xs_apiversion=$version ;; # The current site_perl version.
13014 : Find earliest pure perl site_perl subdirectory perl can use.
13015 : The versioned directories started at 5.005.
13016 pm_apiversion='5.005'
13018 : check for length of pointer
13022 echo "Checking to see how big your pointers are..." >&4
13023 if test "$voidflags" -gt 7; then
13024 echo '#define VOID_PTR char *' > try.c
13026 echo '#define VOID_PTR void *' > try.c
13028 $cat >>try.c <<'EOCP'
13032 printf("%d\n", (int)sizeof(VOID_PTR));
13037 if eval $compile_ok; then
13039 echo "Your pointers are $ptrsize bytes long."
13042 echo "(I can't seem to compile the test program. Guessing...)" >&4
13043 rp="What is the size of a pointer (in bytes)?"
13051 : see if ar generates random libraries by itself
13053 echo "Checking how to generate random libraries on your machine..." >&4
13054 echo 'int bar1() { return bar2(); }' > bar1.c
13055 echo 'int bar2() { return 2; }' > bar2.c
13056 $cat > foo.c <<'EOP'
13057 int main() { printf("%d\n", bar1()); exit(0); }
13059 $cc $ccflags -c bar1.c >/dev/null 2>&1
13060 $cc $ccflags -c bar2.c >/dev/null 2>&1
13061 $cc $ccflags -c foo.c >/dev/null 2>&1
13062 $ar rc bar$_a bar2$_o bar1$_o >/dev/null 2>&1
13063 if $cc $ccflags $ldflags -o foobar foo$_o bar$_a $libs > /dev/null 2>&1 &&
13064 ./foobar >/dev/null 2>&1; then
13065 echo "$ar appears to generate random libraries itself."
13068 elif $ar ts bar$_a >/dev/null 2>&1 &&
13069 $cc $ccflags $ldflags -o foobar foo$_o bar$_a $libs > /dev/null 2>&1 &&
13070 ./foobar >/dev/null 2>&1; then
13071 echo "a table of contents needs to be added with '$ar ts'."
13078 ranlib=`./loc ranlib X /usr/bin /bin /usr/local/bin`
13079 $test -f $ranlib || ranlib=''
13082 if $test -n "$ranlib"; then
13083 echo "your system has '$ranlib'; we'll use that."
13086 echo "your system doesn't seem to support random libraries"
13087 echo "so we'll use lorder and tsort to order the libraries."
13094 : check for type of arguments to select.
13095 case "$selecttype" in
13096 '') case "$d_select" in
13100 Checking to see what type of arguments are accepted by select().
13102 hdrs="$define sys/types.h
13103 $i_systime sys/time.h
13104 $i_sysselct sys/select.h
13105 $d_socket sys/socket.h"
13106 : The first arg can be int, unsigned, or size_t
13107 : The last arg may or may not be 'const'
13109 : void pointer has been seen but using that
13110 : breaks the selectminbits test
13111 for xxx in 'fd_set *' 'int *'; do
13112 for nfd in 'int' 'size_t' 'unsigned long' 'unsigned' ; do
13113 for tmo in 'struct timeval *' 'const struct timeval *'; do
13115 '') try="extern select _(($nfd, $xxx, $xxx, $xxx, $tmo));"
13116 if ./protochk "$try" $hdrs; then
13117 echo "Your system accepts $xxx."
13126 '') rp='What is the type for the 2nd, 3rd, and 4th arguments to select?'
13127 case "$d_fd_set" in
13128 $define) dflt="fd_set *" ;;
13137 *) : no select, so pick a harmless default
13144 : check for the select 'width'
13145 case "$selectminbits" in
13146 '') case "$d_select" in
13150 Checking to see on how many bits at a time your select() operates...
13153 #include <sys/types.h>
13155 #$i_systime I_SYS_TIME
13156 #$i_systimek I_SYS_TIME_KERNEL
13161 # ifdef I_SYS_TIME_KERNEL
13164 # include <sys/time.h>
13165 # ifdef I_SYS_TIME_KERNEL
13169 #$i_sysselct I_SYS_SELECT
13170 #ifdef I_SYS_SELECT
13171 #include <sys/select.h>
13173 #$d_socket HAS_SOCKET
13175 # include <sys/socket.h> /* Might include <sys/bsdtypes.h> */
13179 #define S sizeof(*(b))
13181 #define NBYTES (S * 8 > MINBITS ? S : MINBITS/8)
13182 #define NBITS (NBYTES * 8)
13191 fp = fopen("try.c", "r");
13197 b = ($selecttype)s;
13198 for (i = 0; i < NBITS; i++)
13202 select(fd + 1, b, 0, 0, &t);
13203 for (i = NBITS - 1; i > fd && FD_ISSET(i, b); i--);
13204 printf("%d\n", i + 1);
13209 if eval $compile_ok; then
13210 selectminbits=`./try`
13211 case "$selectminbits" in
13213 Cannot figure out on how many bits at a time your select() operates.
13214 I'll play safe and guess it is 32 bits.
13220 *) bits="$selectminbits bits" ;;
13222 echo "Your select() operates on $bits at a time." >&4
13224 rp='What is the minimum number of bits your select() operates on?'
13225 case "$byteorder" in
13226 1234|12345678) dflt=32 ;;
13231 selectminbits="$val"
13235 *) : no select, so pick a harmless default
13242 : Trace out the files included by signal.h, then look for SIGxxx names.
13243 : Remove SIGARRAYSIZE used by HPUX.
13244 : Remove SIGSTKSIZE used by Linux.
13245 : Remove SIGSTKSZ used by Posix.
13246 : Remove SIGTYP void lines used by OS2.
13247 : Some cpps, like os390, dont give the file name anywhere
13248 if [ "X$fieldn" = X ]; then
13249 : Just make some guesses. We check them later.
13250 xxx='/usr/include/signal.h /usr/include/sys/signal.h'
13252 xxx=`echo '#include <signal.h>' |
13253 $cppstdin $cppminus $cppflags 2>/dev/null |
13254 $grep '^[ ]*#.*include' |
13255 $awk "{print \\$$fieldn}" | $sed 's!"!!g' | $sort | $uniq`
13257 : Check this list of files to be sure we have parsed the cpp output ok.
13258 : This will also avoid potentially non-existent files, such
13261 for xx in $xxx /dev/null ; do
13262 $test -f "$xx" && xxxfiles="$xxxfiles $xx"
13264 : If we have found no files, at least try signal.h
13265 case "$xxxfiles" in
13266 '') xxxfiles=`./findhdr signal.h` ;;
13269 $1 ~ /^#define$/ && $2 ~ /^SIG[A-Z0-9]*$/ && $2 !~ /SIGARRAYSIZE/ && $2 !~ /SIGSTKSIZE/ && $2 !~ /SIGSTKSZ/ && $3 !~ /void/ {
13270 print substr($2, 4, 20)
13272 $1 == "#" && $2 ~ /^define$/ && $3 ~ /^SIG[A-Z0-9]*$/ && $3 !~ /SIGARRAYSIZE/ && $4 !~ /void/ {
13273 print substr($3, 4, 20)
13275 : Append some common names just in case the awk scan failed.
13276 xxx="$xxx ABRT ALRM BUS CANCEL CHLD CLD CONT DIL EMT FPE"
13277 xxx="$xxx FREEZE HUP ILL INT IO IOT KILL LOST LWP PHONE"
13278 xxx="$xxx PIPE POLL PROF PWR QUIT RTMAX RTMIN SEGV STKFLT STOP"
13279 xxx="$xxx SYS TERM THAW TRAP TSTP TTIN TTOU URG USR1 USR2"
13280 xxx="$xxx USR3 USR4 VTALRM WAITING WINCH WIND WINDOW XCPU XFSZ"
13282 : generate a few handy files for later
13283 $cat > signal.c <<'EOCP'
13284 #include <sys/types.h>
13285 #include <signal.h>
13289 /* Strange style to avoid deeply-nested #if/#else/#endif */
13292 # define NSIG (_NSIG)
13298 # define NSIG (SIGMAX+1)
13304 # define NSIG (SIG_MAX+1)
13310 # define NSIG (MAXSIG+1)
13316 # define NSIG (MAX_SIG+1)
13321 # ifdef SIGARRAYSIZE
13322 # define NSIG (SIGARRAYSIZE+1) /* Not sure of the +1 */
13328 # define NSIG (_sys_nsig) /* Solaris 2.5 */
13332 /* Default to some arbitrary number that's big enough to get most
13333 of the common signals.
13339 printf("NSIG %d\n", NSIG);
13345 echo $xxx | $tr ' ' $trnl | $sort | $uniq | $awk '
13347 printf "#ifdef SIG"; printf $1; printf "\n"
13348 printf "printf(\""; printf $1; printf " %%d\\n\",SIG";
13349 printf $1; printf ");\n"
13353 printf "#endif /* JUST_NSIG */\n";
13354 printf "exit(0);\n}\n";
13357 $cat >signal.awk <<'EOP'
13358 BEGIN { ndups = 0 }
13359 $1 ~ /^NSIG$/ { nsig = $2 }
13360 ($1 !~ /^NSIG$/) && (NF == 2) {
13361 if ($2 > maxsig) { maxsig = $2 }
13362 if (sig_name[$2]) {
13363 dup_name[ndups] = $1
13364 dup_num[ndups] = $2
13376 printf("NSIG %d\n", nsig);
13377 for (n = 1; n < nsig; n++) {
13379 printf("%s %d\n", sig_name[n], sig_num[n])
13382 printf("NUM%d %d\n", n, n)
13385 for (n = 0; n < ndups; n++) {
13386 printf("%s %d\n", dup_name[n], dup_num[n])
13390 $cat >signal_cmd <<EOS
13392 if $test -s signal.lst; then
13393 echo "Using your existing signal.lst file"
13398 $cat >>signal_cmd <<'EOS'
13401 if eval $compile_ok; then
13402 ./signal$_exe | $sort -n +1 | $uniq | $awk -f signal.awk >signal.lst
13404 echo "(I can't seem be able to compile the whole test program)" >&4
13405 echo "(I'll try it in little pieces.)" >&4
13406 set signal -DJUST_NSIG
13407 if eval $compile_ok; then
13408 ./signal$_exe > signal.nsg
13411 echo "I can't seem to figure out how many signals you have." >&4
13412 echo "Guessing 50." >&4
13413 echo 'NSIG 50' > signal.nsg
13415 : Now look at all the signal names, one at a time.
13416 for xx in `echo $xxx | $tr ' ' $trnl | $sort | $uniq`; do
13417 $cat > signal.c <<EOCP
13418 #include <sys/types.h>
13419 #include <signal.h>
13422 printf("$xx %d\n", SIG${xx});
13427 if eval $compile; then
13428 echo "SIG${xx} found."
13429 ./signal$_exe >> signal.ls1
13431 echo "SIG${xx} NOT found."
13434 if $test -s signal.ls1; then
13435 $cat signal.nsg signal.ls1 |
13436 $sort -n +1 | $uniq | $awk -f signal.awk >signal.lst
13440 if $test -s signal.lst; then
13443 echo "(AAK! I can't compile the test programs -- Guessing)" >&4
13444 echo 'kill -l' >signal
13445 set X `csh -f <signal`
13449 0) set HUP INT QUIT ILL TRAP ABRT EMT FPE KILL BUS SEGV SYS PIPE ALRM TERM;;
13451 echo $@ | $tr ' ' $trnl | \
13452 $awk '{ printf "%s %d\n", $1, ++s; }
13453 END { printf "NSIG %d\n", ++s }' >signal.lst
13455 $rm -f signal.c signal$_exe signal$_o signal.nsg signal.ls1
13457 chmod a+x signal_cmd
13458 $eunicefix signal_cmd
13460 : generate list of signal names
13462 case "$sig_name_init" in
13464 *) case "$sig_num_init" in
13465 ''|*,*) doinit=yes ;;
13470 echo "Generating a list of signal names and numbers..." >&4
13472 sig_count=`$awk '/^NSIG/ { printf "%d", $2 }' signal.lst`
13473 sig_name=`$awk 'BEGIN { printf "ZERO " }
13474 !/^NSIG/ { printf "%s ", $1 }' signal.lst`
13475 sig_num=`$awk 'BEGIN { printf "0 " }
13476 !/^NSIG/ { printf "%d ", $2 }' signal.lst`
13477 sig_name_init=`$awk 'BEGIN { printf "\"ZERO\", " }
13478 !/^NSIG/ { printf "\"%s\", ", $1 }
13479 END { printf "0\n" }' signal.lst`
13480 sig_num_init=`$awk 'BEGIN { printf "0, " }
13481 !/^NSIG/ { printf "%d, ", $2}
13482 END { printf "0\n"}' signal.lst`
13485 echo "The following $sig_count signals are available:"
13487 echo $sig_name | $awk \
13488 'BEGIN { linelen = 0 }
13490 for (i = 1; i <= NF; i++) {
13491 name = "SIG" $i " "
13492 linelen = linelen + length(name)
13493 if (linelen > 70) {
13495 linelen = length(name)
13501 $rm -f signal signal.c signal.awk signal.lst signal_cmd
13503 : see what type is used for signed size_t
13504 set ssize_t ssizetype int stdio.h sys/types.h
13507 $cat > ssize.c <<EOM
13509 #include <sys/types.h>
13510 #define Size_t $sizetype
13511 #define SSize_t $dflt
13514 if (sizeof(Size_t) == sizeof(SSize_t))
13516 else if (sizeof(Size_t) == sizeof(int))
13525 if eval $compile_ok && ./ssize > /dev/null; then
13526 ssizetype=`./ssize`
13527 echo "I'll be using $ssizetype for functions returning a byte count." >&4
13530 Help! I can't compile and run the ssize_t test program: please enlighten me!
13531 (This is probably a misconfiguration in your system or libraries, and
13532 you really ought to fix it. Still, I'll try anyway.)
13534 I need a type that is the same size as $sizetype, but is guaranteed to
13535 be signed. Common values are ssize_t, int and long.
13538 rp="What signed type is the same size as $sizetype?"
13542 $rm -f ssize ssize.*
13544 : see what type of char stdio uses.
13546 if $contains 'unsigned.*char.*_ptr;' `./findhdr stdio.h` >/dev/null 2>&1 ; then
13547 echo "Your stdio uses unsigned chars." >&4
13548 stdchar="unsigned char"
13550 echo "Your stdio uses signed chars." >&4
13554 : see if time exists
13556 if test "X$d_time" = X -o X"$timetype" = X; then
13557 if set time val -f d_time; eval $csym; $val; then
13558 echo 'time() found.' >&4
13560 rp="What is the type returned by time() on this system?"
13561 set time_t timetype long stdio.h sys/types.h
13564 echo 'time() not found, hope that will do.' >&4
13572 : see what type uids are declared as in the kernel
13574 echo "Looking for the type for user ids returned by getuid()."
13575 set uid_t uidtype xxx stdio.h sys/types.h
13579 xxx=`./findhdr sys/user.h`
13580 set `grep '_ruid;' "$xxx" 2>/dev/null` unsigned short
13582 unsigned) dflt="$1 $2" ;;
13586 *) dflt="$uidtype";;
13589 uid_t) echo "uid_t found." ;;
13590 *) rp="What is the type for user ids returned by getuid()?"
13598 *_t) zzz="$uidtype" ;;
13601 echo "Checking the size of $zzz..." >&4
13603 #include <sys/types.h>
13606 printf("%d\n", (int)sizeof($uidtype));
13611 if eval $compile_ok; then
13615 echo "(I can't execute the test program--guessing $uidsize.)" >&4
13618 echo "Your $zzz is $uidsize bytes long."
13623 echo "(I can't compile the test program--guessing $uidsize.)" >&4
13628 *_t) zzz="$uidtype" ;;
13631 echo "Checking the sign of $zzz..." >&4
13633 #include <sys/types.h>
13644 if eval $compile; then
13648 echo "(I can't execute the test program--guessing unsigned.)" >&4
13652 1) echo "Your $zzz is unsigned." ;;
13653 -1) echo "Your $zzz is signed." ;;
13659 echo "(I can't compile the test program--guessing unsigned.)" >&4
13665 $echo "Checking the format string to be used for uids..." >&4
13668 -1) if $test X"$uidsize" = X"$ivsize"; then
13669 uidformat="$ivdformat"
13671 if $test X"$uidsize" = X"$longsize"; then
13674 if $test X"$uidsize" = X"$intsize"; then
13677 if $test X"$uidsize" = X"$shortsize"; then
13684 *) if $test X"$uidsize" = X"$uvsize"; then
13685 uidformat="$uvuformat"
13687 if $test X"$uidsize" = X"$longsize"; then
13690 if $test X"$uidsize" = X"$intsize"; then
13693 if $test X"$uidsize" = X"$shortsize"; then
13702 : see if dbm.h is available
13703 : see if dbmclose exists
13704 set dbmclose d_dbmclose
13707 case "$d_dbmclose" in
13717 *) set rpcsvc/dbm.h i_rpcsvcdbm
13722 *) echo "We won't be including <dbm.h>"
13732 : see if this is a sys/file.h system
13737 : do we need to include sys/file.h ?
13741 if $h_sysfile; then
13743 echo "We'll be including <sys/file.h>." >&4
13746 echo "We won't be including <sys/file.h>." >&4
13756 : see if fcntl.h is there
13761 : see if we can include fcntl.h
13767 echo "We'll be including <fcntl.h>." >&4
13770 if $h_sysfile; then
13771 echo "We don't need to include <fcntl.h> if we include <sys/file.h>." >&4
13773 echo "We won't be including <fcntl.h>." >&4
13785 : see if this is a iconv.h system
13786 set iconv.h i_iconv
13789 : see if locale.h is available
13790 set locale.h i_locale
13793 : see if mach cthreads are available
13794 if test "X$usethreads" = "X$define"; then
13795 set mach/cthreads.h i_machcthr
13798 i_machcthr="$undef"
13803 : see if this is a math.h system
13807 : see if this is a mntent.h system
13808 set mntent.h i_mntent
13811 : see if ndbm.h is available
13816 : see if dbm_open exists
13817 set dbm_open d_dbm_open
13819 case "$d_dbm_open" in
13822 echo "We won't be including <ndbm.h>"
13831 : see if net/errno.h is available
13833 set net/errno.h val
13836 : Unfortunately, it causes problems on some systems. Arrgh.
13839 cat > try.c <<'EOM'
13842 #include <net/errno.h>
13848 if $cc $ccflags -c try.c >/dev/null 2>&1; then
13849 echo "We'll be including <net/errno.h>." >&4
13851 echo "We won't be including <net/errno.h>." >&4
13860 : see if netinet/tcp.h is available
13861 set netinet/tcp.h i_netinettcp
13864 : see if this is a poll.h system
13869 $echo "Guessing which symbols your C compiler and preprocessor define..." >&4
13870 $cat <<'EOSH' > Cppsym.know
13871 a29k ABI64 aegis AES_SOURCE AIX AIX32 AIX370
13872 AIX41 AIX42 AIX43 AIX_SOURCE aixpc ALL_SOURCE
13873 alliant alpha am29000 AM29000 amiga AMIGAOS AMIX
13874 ansi ANSI_C_SOURCE apollo ardent atarist att386 att3b BeOS
13875 BIG_ENDIAN BIT_MSF bsd BSD bsd43 bsd4_2 bsd4_3 BSD4_3 bsd4_4
13876 BSD_4_3 BSD_4_4 BSD_NET2 BSD_TIME BSD_TYPES BSDCOMPAT bsdi
13877 bull c cadmus clipper CMU COFF COMPILER_VERSION
13878 concurrent convex cpu cray CRAY CRAYMPP ctix CX_UX
13879 CYGWIN DGUX DGUX_SOURCE DJGPP dmert DOLPHIN DPX2 DSO
13880 Dynix DynixPTX ELF encore EPI EXTENSIONS FILE_OFFSET_BITS
13881 FreeBSD GCC_NEW_VARARGS gcos gcx gimpel
13882 GNU_SOURCE GNUC GNUC_MINOR GO32 gould GOULD_PN
13883 H3050R H3050RX hbullx20 hcx host_mips
13884 hp200 hp300 hp700 HP700 hp800 hp9000
13885 hp9000s200 hp9000s300 hp9000s400 hp9000s500
13886 hp9000s700 hp9000s800 hp9k8 hp_osf hppa hpux HPUX_SOURCE
13887 i186 i286 i386 i486 i586 i686 i8086 i80960 i860 I960
13888 iAPX286 ibm ibm032 ibmesa IBMR2 ibmrt ILP32 ILP64
13889 INLINE_INTRINSICS INTRINSICS INT64 interdata is68k ksr1
13890 LANGUAGE_C LARGE_FILE_API LARGEFILE64_SOURCE
13891 LARGEFILE_SOURCE LFS64_LARGEFILE LFS_LARGEFILE
13892 Linux LITTLE_ENDIAN LONG64 LONG_DOUBLE LONG_LONG
13893 LONGDOUBLE LONGLONG LP64 luna luna88k Lynx
13894 M68000 m68k m88100 m88k M88KBCS_TARGET M_COFF
13895 M_I186 M_I286 M_I386 M_I8086 M_I86 M_I86SM M_SYS3
13896 M_SYS5 M_SYSIII M_SYSV M_UNIX M_XENIX MACH machine MachTen
13897 MATH_HAS_NO_SIDE_EFFECTS
13898 mc300 mc500 mc68000 mc68010 mc68020 mc68030 mc68040
13899 mc68060 mc68k mc68k32 mc700 mc88000 mc88100 merlin
13900 mert MiNT mips MIPS_FPSET MIPS_ISA MIPS_SIM MIPS_SZINT
13901 MIPS_SZLONG MIPS_SZPTR MIPSEB MIPSEL MODERN_C motorola
13902 mpeix MSDOS MTXINU MULTIMAX mvs MVS n16 ncl_el ncl_mr
13903 NetBSD news1500 news1700 news1800 news1900 news3700
13904 news700 news800 news900 NeXT NLS ns16000 ns32000
13905 ns32016 ns32332 ns32k nsc32000
13906 OCS88 OEMVS OpenBSD os OS2 OS390 osf OSF1 OSF_SOURCE
13907 pa_risc PA_RISC1_1 PA_RISC2_0 PARAGON parisc
13908 pc532 pdp11 PGC PIC plexus PORTAR posix
13909 POSIX1B_SOURCE POSIX2_SOURCE POSIX4_SOURCE
13910 POSIX_C_SOURCE POSIX_SOURCE POWER
13911 PROTOTYPES PWB pyr QNX R3000 REENTRANT RES Rhapsody RISC6000
13912 riscix riscos RT scs SCO sequent sgi SGI_SOURCE sinix
13913 SIZE_INT SIZE_LONG SIZE_PTR SOCKET_SOURCE SOCKETS_SOURCE
13914 sony sony_news sonyrisc sparc sparclite spectrum
13915 stardent stdc STDC_EXT stratos sun sun3 sun386
13916 Sun386i svr3 svr4 SVR4_2 SVR4_SOURCE svr5
13917 SX system SYSTYPE_BSD SYSTYPE_BSD43 SYSTYPE_BSD44
13918 SYSTYPE_SVR4 SYSTYPE_SVR5 SYSTYPE_SYSV SYSV SYSV3 SYSV4 SYSV5
13919 sysV68 sysV88 Tek4132 Tek4300 titan
13920 tower tower32 tower32_200 tower32_600 tower32_700
13921 tower32_800 tower32_850 tss
13922 u370 u3b u3b2 u3b20 u3b200 u3b20d u3b5
13923 ultrix UMAXV UnicomPBB UnicomPBD UNICOS UNICOSMK
13924 unix UNIX95 UNIX99 unixpc unos USGr4 USGr4_2
13925 Utek UTek UTS UWIN uxpm uxps vax venix VMESA vms xenix Xenix286
13926 XOPEN_SOURCE XOPEN_SOURCE_EXTENDED XPG2 XPG2_EXTENDED
13927 XPG3 XPG3_EXTENDED XPG4 XPG4_EXTENDED
13930 # Maybe put other stuff here too.
13931 cat <<EOSH >>Cppsym.know
13934 ./tr '[a-z]' '[A-Z]' < Cppsym.know > Cppsym.a
13935 ./tr '[A-Z]' '[a-z]' < Cppsym.know > Cppsym.b
13936 $cat Cppsym.a Cppsym.b | $tr ' ' $trnl | sort | uniq > Cppsym.know
13937 $rm -f Cppsym.a Cppsym.b
13938 cat <<EOSH > Cppsym
13940 if $test \$# -gt 0; then
13941 echo \$* | $tr " " "$trnl" | ./Cppsym.try > Cppsym.got
13942 if $test -s Cppsym.got; then
13949 $tr " " "$trnl" | ./Cppsym.try
13955 cat <<EOSH > Cppsym.try
13957 cat <<'EOCP' > try.c
13963 cat <<'EOSH' >> Cppsym.try
13965 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
13966 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
13967 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
13968 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
13972 cat <<EOSH >> Cppsym.try
13974 optimize="$optimize"
13979 $cc $optimize $ccflags $ldflags -o try try.c $libs && ./try$exe_ext
13981 chmod +x Cppsym.try
13982 $eunicefix Cppsym.try
13983 ./Cppsym < Cppsym.know > Cppsym.true
13984 : now check the C compiler for additional symbols
13985 postprocess_cc_v=''
13987 aix) postprocess_cc_v="|$tr , ' '" ;;
13994 for i in \`$cc -v -c tmp.c 2>&1 $postprocess_cc_v\`
13997 -D*) echo "\$i" | $sed 's/^-D//';;
13998 -A*) $test "$gccversion" && echo "\$i" | $sed 's/^-A\(.*\)(\(.*\))/\1=\2/';;
14003 postprocess_cc_v=''
14006 ./ccsym > ccsym1.raw
14007 if $test -s ccsym1.raw; then
14008 $sort ccsym1.raw | $uniq >ccsym.raw
14010 mv ccsym1.raw ccsym.raw
14013 $awk '/\=/ { print $0; next }
14014 { print $0"=1" }' ccsym.raw >ccsym.list
14015 $awk '/\=/ { print $0; next }
14016 { print $0"=1" }' Cppsym.true >ccsym.true
14017 $comm -13 ccsym.true ccsym.list >ccsym.own
14018 $comm -12 ccsym.true ccsym.list >ccsym.com
14019 $comm -23 ccsym.true ccsym.list >ccsym.cpp
14021 if $test -z ccsym.raw; then
14022 echo "Your C compiler doesn't seem to define any symbols!" >&4
14024 echo "However, your C preprocessor defines the following symbols:"
14027 cppsymbols=`$cat Cppsym.true`
14028 cppsymbols=`echo $cppsymbols`
14029 cppccsymbols="$cppsymbols"
14031 if $test -s ccsym.com; then
14032 echo "Your C compiler and pre-processor define these symbols:"
14033 $sed -e 's/\(.*\)=.*/\1/' ccsym.com
14036 cppccsymbols=`$cat ccsym.com`
14037 cppccsymbols=`echo $cppccsymbols`
14038 $test "$silent" || sleep 1
14040 if $test -s ccsym.cpp; then
14041 $test "$also" && echo " "
14042 echo "Your C pre-processor ${also}defines the following symbols:"
14043 $sed -e 's/\(.*\)=.*/\1/' ccsym.cpp
14045 cppsymbols=`$cat ccsym.cpp`
14046 cppsymbols=`echo $cppsymbols`
14047 $test "$silent" || sleep 1
14049 if $test -s ccsym.own; then
14050 $test "$also" && echo " "
14051 echo "Your C compiler ${also}defines the following cpp symbols:"
14052 $sed -e 's/\(.*\)=1/\1/' ccsym.own
14053 $sed -e 's/\(.*\)=.*/\1/' ccsym.own | $uniq >>Cppsym.true
14054 ccsymbols=`$cat ccsym.own`
14055 ccsymbols=`echo $ccsymbols`
14056 $test "$silent" || sleep 1
14061 : see if this is a termio system
14065 if $test `./findhdr termios.h`; then
14066 set tcsetattr i_termios
14072 "$define") echo "You have POSIX termios.h... good!" >&4;;
14073 *) if ./Cppsym pyr; then
14074 case "`/bin/universe`" in
14075 ucb) if $test `./findhdr sgtty.h`; then
14077 echo "<sgtty.h> found." >&4
14079 echo "System is pyramid with BSD universe."
14080 echo "<sgtty.h> not found--you could have problems." >&4
14082 *) if $test `./findhdr termio.h`; then
14084 echo "<termio.h> found." >&4
14086 echo "System is pyramid with USG universe."
14087 echo "<termio.h> not found--you could have problems." >&4
14091 if $test `./findhdr termio.h`; then
14092 echo "<termio.h> found." >&4
14094 elif $test `./findhdr sgtty.h`; then
14095 echo "<sgtty.h> found." >&4
14098 echo "Neither <termio.h> nor <sgtty.h> found--you could have problems." >&4
14101 if $test `./findhdr sgtty.h`; then
14102 echo "<sgtty.h> found." >&4
14104 elif $test `./findhdr termio.h`; then
14105 echo "<termio.h> found." >&4
14108 echo "Neither <sgtty.h> nor <termio.h> found--you could have problems." >&4
14112 set i_termio; eval $setvar
14113 val=$val2; set i_sgtty; eval $setvar
14114 val=$val3; set i_termios; eval $setvar
14116 : see if this is a shadow.h system
14117 set shadow.h i_shadow
14120 : see if this is a socks.h system
14121 set socks.h i_socks
14124 : see if stdarg is available
14126 if $test `./findhdr stdarg.h`; then
14127 echo "<stdarg.h> found." >&4
14130 echo "<stdarg.h> NOT found." >&4
14134 : see if varags is available
14136 if $test `./findhdr varargs.h`; then
14137 echo "<varargs.h> found." >&4
14139 echo "<varargs.h> NOT found, but that's ok (I hope)." >&4
14142 : set up the varargs testing programs
14143 $cat > varargs.c <<EOP
14145 #include <stdarg.h>
14148 #include <varargs.h>
14152 int f(char *p, ...)
14166 p = va_arg(ap, char *);
14171 $cat > varargs <<EOP
14173 if $cc -c $ccflags -D\$1 varargs.c >/dev/null 2>&1; then
14182 : now check which varargs header should be included
14187 if `./varargs I_STDARG`; then
14189 elif `./varargs I_VARARGS`; then
14194 if `./varargs I_VARARGS`; then
14201 echo "I could not find the definition for va_dcl... You have problems..." >&4
14202 val="$undef"; set i_stdarg; eval $setvar
14203 val="$undef"; set i_varargs; eval $setvar
14208 case "$i_varhdr" in
14210 val="$define"; set i_stdarg; eval $setvar
14211 val="$undef"; set i_varargs; eval $setvar
14214 val="$undef"; set i_stdarg; eval $setvar
14215 val="$define"; set i_varargs; eval $setvar
14218 echo "We'll include <$i_varhdr> to get va_dcl definition." >&4;;
14222 : see if stddef is available
14223 set stddef.h i_stddef
14226 : see if sys/access.h is available
14227 set sys/access.h i_sysaccess
14230 : see if ioctl defs are in sgtty, termio, sys/filio or sys/ioctl
14231 set sys/filio.h i_sysfilio
14234 if $test `./findhdr sys/ioctl.h`; then
14236 echo '<sys/ioctl.h> found.' >&4
14239 if $test $i_sysfilio = "$define"; then
14240 echo '<sys/ioctl.h> NOT found.' >&4
14242 $test $i_sgtty = "$define" && xxx="sgtty.h"
14243 $test $i_termio = "$define" && xxx="termio.h"
14244 $test $i_termios = "$define" && xxx="termios.h"
14245 echo "No <sys/ioctl.h> found, assuming ioctl args are defined in <$xxx>." >&4
14252 : see if this is a syslog.h system
14253 set syslog.h i_syslog
14257 : see if this is a sys/mode.h system
14258 set sys/mode.h i_sysmode
14261 : see if sys/resource.h has to be included
14262 set sys/resource.h i_sysresrc
14265 : see if sys/security.h is available
14266 set sys/security.h i_syssecrt
14269 : see if this is a sys/statvfs.h system
14270 set sys/statvfs.h i_sysstatvfs
14273 : see if this is a sys/uio.h system
14274 set sys/uio.h i_sysuio
14277 : see if this is a sys/un.h system
14278 set sys/un.h i_sysun
14282 : see if this is a sys/utsname.h system
14283 set sys/utsname.h i_sysutsname
14286 : see if this is a syswait system
14287 set sys/wait.h i_syswait
14290 : see if this is a ustat.h system
14291 set ustat.h i_ustat
14294 : see if this is an utime system
14295 set utime.h i_utime
14298 : see if this is a values.h system
14299 set values.h i_values
14302 : see if this is a vfork system
14305 set vfork.h i_vfork
14313 : see if gdbm.h is available
14318 : see if gdbm_open exists
14319 set gdbm_open d_gdbm_open
14321 case "$d_gdbm_open" in
14324 echo "We won't be including <gdbm.h>"
14334 echo "Looking for extensions..." >&4
14335 : If we are using the old config.sh, known_extensions may contain
14336 : old or inaccurate or duplicate values.
14337 known_extensions=''
14338 nonxs_extensions=''
14339 : We do not use find because it might not be available.
14340 : We do not just use MANIFEST because the user may have dropped
14341 : some additional extensions into the source tree and expect them
14344 : Function to recursively find available extensions, ignoring DynaLoader
14345 : NOTE: recursion limit of 10 to prevent runaway in case of symlink madness
14349 DynaLoader|dynaload) ;;
14351 if $test -f $xxx/$xxx.xs; then
14352 known_extensions="$known_extensions $1$xxx";
14353 elif $test -f $xxx/Makefile.PL; then
14354 nonxs_extensions="$nonxs_extensions $1$xxx";
14356 if $test -d $xxx -a $# -lt 10; then
14359 eval $find_extensions;
14371 eval $find_extensions
14372 set X $nonxs_extensions
14374 nonxs_extensions="$*"
14375 set X $known_extensions
14377 known_extensions="$*"
14380 : Now see which are supported on this system.
14382 for xxx in $known_extensions ; do
14386 $define) avail_ext="$avail_ext $xxx" ;;
14389 GDBM_File|gdbm_fil)
14391 $define) avail_ext="$avail_ext $xxx" ;;
14394 NDBM_File|ndbm_fil)
14397 case "$osname-$use64bits" in
14400 *-lndbm*) avail_ext="$avail_ext $xxx" ;;
14403 *) avail_ext="$avail_ext $xxx" ;;
14408 ODBM_File|odbm_fil)
14409 case "${i_dbm}${i_rpcsvcdbm}" in
14411 case "$osname-$use64bits" in
14414 *-ldbm*) avail_ext="$avail_ext $xxx" ;;
14417 *) avail_ext="$avail_ext $xxx" ;;
14423 case "$useposix" in
14424 true|define|y) avail_ext="$avail_ext $xxx" ;;
14428 case "$useopcode" in
14429 true|define|y) avail_ext="$avail_ext $xxx" ;;
14433 case "$d_socket" in
14434 true|$define|y) avail_ext="$avail_ext $xxx" ;;
14438 case "$usethreads" in
14439 true|$define|y) avail_ext="$avail_ext $xxx" ;;
14443 : XXX Do we need a useipcsysv variable here
14444 case "${d_msg}${d_sem}${d_shm}" in
14445 *"${define}"*) avail_ext="$avail_ext $xxx" ;;
14448 *) avail_ext="$avail_ext $xxx"
14457 : Now see which nonxs extensions are supported on this system.
14458 : For now assume all are.
14460 for xxx in $nonxs_extensions ; do
14462 *) nonxs_ext="$nonxs_ext $xxx"
14474 A number of extensions are supplied with $package. You may choose to
14475 compile these extensions for dynamic loading (the default), compile
14476 them into the $package executable (static loading), or not include
14477 them at all. Answer "none" to include no extensions.
14478 Note that DynaLoader is always built and need not be mentioned here.
14481 case "$dynamic_ext" in
14482 '') dflt="$avail_ext" ;;
14483 *) dflt="$dynamic_ext"
14484 # Perhaps we are reusing an old out-of-date config.sh.
14487 if test X"$dynamic_ext" != X"$avail_ext"; then
14489 NOTICE: Your previous config.sh list may be incorrect.
14490 The extensions now available to you are
14492 but the default list from your previous config.sh is
14504 rp="What extensions do you wish to load dynamically?"
14507 none) dynamic_ext=' ' ;;
14508 *) dynamic_ext="$ans" ;;
14511 case "$static_ext" in
14513 : Exclude those already listed in dynamic linking
14515 for xxx in $avail_ext; do
14516 case " $dynamic_ext " in
14518 *) dflt="$dflt $xxx" ;;
14525 *) dflt="$static_ext"
14532 rp="What extensions do you wish to load statically?"
14535 none) static_ext=' ' ;;
14536 *) static_ext="$ans" ;;
14541 A number of extensions are supplied with $package. Answer "none"
14542 to include no extensions.
14543 Note that DynaLoader is always built and need not be mentioned here.
14546 case "$static_ext" in
14547 '') dflt="$avail_ext" ;;
14548 *) dflt="$static_ext"
14549 # Perhaps we are reusing an old out-of-date config.sh.
14552 if test X"$static_ext" != X"$avail_ext"; then
14554 NOTICE: Your previous config.sh list may be incorrect.
14555 The extensions now available to you are
14557 but the default list from your previous config.sh is
14566 : Exclude those that are not xs extensions
14570 rp="What extensions do you wish to include?"
14573 none) static_ext=' ' ;;
14574 *) static_ext="$ans" ;;
14579 set X $dynamic_ext $static_ext $nonxs_ext
14583 : Remove build directory name from cppstdin so it can be used from
14584 : either the present location or the final installed location.
14586 : Get out of the UU directory to get correct path name.
14588 case "$cppstdin" in
14590 echo "Stripping down cppstdin path name"
14596 : end of configuration questions
14598 echo "End of configuration questions."
14601 : back to where it started
14602 if test -d ../UU; then
14606 : configuration may be patched via a 'config.over' file
14607 if $test -f config.over; then
14610 rp='I see a config.over file. Do you wish to load it?'
14613 n*) echo "OK, I'll ignore it.";;
14615 echo "Configuration override changes have been loaded."
14620 : in case they want portability, strip down executable paths
14621 case "$d_portable" in
14624 echo "Stripping down executable paths..." >&4
14625 for file in $loclist $trylist; do
14627 eval $file=`basename $temp`
14632 : create config.sh file
14634 echo "Creating config.sh..." >&4
14635 $spitshell <<EOT >config.sh
14638 # This file was produced by running the Configure script. It holds all the
14639 # definitions figured out by Configure. Should you modify one of these values,
14640 # do not forget to propagate your changes by running "Configure -der". You may
14641 # instead choose to run each of the .SH files by yourself, or "Configure -S".
14644 # Package name : $package
14645 # Source directory : $src
14646 # Configuration time: $cf_time
14647 # Configured by : $cf_by
14648 # Target system : $myuname
14658 Revision='$Revision'
14665 alignbytes='$alignbytes'
14666 ansi2knr='$ansi2knr'
14667 aphostname='$aphostname'
14668 api_revision='$api_revision'
14669 api_subversion='$api_subversion'
14670 api_version='$api_version'
14671 api_versionstring='$api_versionstring'
14674 archlibexp='$archlibexp'
14675 archname64='$archname64'
14676 archname='$archname'
14677 archobjs='$archobjs'
14682 bincompat5005='$bincompat5005'
14686 byteorder='$byteorder'
14688 castflags='$castflags'
14691 cccdlflags='$cccdlflags'
14692 ccdlflags='$ccdlflags'
14694 ccsymbols='$ccsymbols'
14696 cf_email='$cf_email'
14698 charsize='$charsize'
14702 clocktype='$clocktype'
14704 compress='$compress'
14705 contains='$contains'
14709 cpp_stuff='$cpp_stuff'
14710 cppccsymbols='$cppccsymbols'
14711 cppflags='$cppflags'
14713 cppminus='$cppminus'
14715 cppstdin='$cppstdin'
14716 cppsymbols='$cppsymbols'
14717 crosscompile='$crosscompile'
14718 cryptlib='$cryptlib'
14720 d_Gconvert='$d_Gconvert'
14721 d_PRIEldbl='$d_PRIEldbl'
14722 d_PRIFldbl='$d_PRIFldbl'
14723 d_PRIGldbl='$d_PRIGldbl'
14724 d_PRIX64='$d_PRIX64'
14725 d_PRId64='$d_PRId64'
14726 d_PRIeldbl='$d_PRIeldbl'
14727 d_PRIfldbl='$d_PRIfldbl'
14728 d_PRIgldbl='$d_PRIgldbl'
14729 d_PRIi64='$d_PRIi64'
14730 d_PRIo64='$d_PRIo64'
14731 d_PRIu64='$d_PRIu64'
14732 d_PRIx64='$d_PRIx64'
14733 d_access='$d_access'
14734 d_accessx='$d_accessx'
14736 d_archlib='$d_archlib'
14739 d_attribut='$d_attribut'
14742 d_bincompat5005='$d_bincompat5005'
14744 d_bsdgetpgrp='$d_bsdgetpgrp'
14745 d_bsdsetpgrp='$d_bsdsetpgrp'
14747 d_casti32='$d_casti32'
14748 d_castneg='$d_castneg'
14749 d_charvspr='$d_charvspr'
14751 d_chroot='$d_chroot'
14752 d_chsize='$d_chsize'
14753 d_closedir='$d_closedir'
14757 d_cuserid='$d_cuserid'
14758 d_dbl_dig='$d_dbl_dig'
14759 d_difftime='$d_difftime'
14760 d_dirnamlen='$d_dirnamlen'
14761 d_dlerror='$d_dlerror'
14762 d_dlopen='$d_dlopen'
14763 d_dlsymun='$d_dlsymun'
14764 d_dosuid='$d_dosuid'
14765 d_drand48proto='$d_drand48proto'
14767 d_eaccess='$d_eaccess'
14768 d_endgrent='$d_endgrent'
14769 d_endhent='$d_endhent'
14770 d_endnent='$d_endnent'
14771 d_endpent='$d_endpent'
14772 d_endpwent='$d_endpwent'
14773 d_endsent='$d_endsent'
14774 d_endspent='$d_endspent'
14775 d_eofnblk='$d_eofnblk'
14776 d_eunice='$d_eunice'
14777 d_fchmod='$d_fchmod'
14778 d_fchown='$d_fchown'
14780 d_fd_macros='$d_fd_macros'
14781 d_fd_set='$d_fd_set'
14782 d_fds_bits='$d_fds_bits'
14783 d_fgetpos='$d_fgetpos'
14784 d_flexfnam='$d_flexfnam'
14787 d_fpathconf='$d_fpathconf'
14788 d_fpos64_t='$d_fpos64_t'
14789 d_fs_data_s='$d_fs_data_s'
14790 d_fseeko='$d_fseeko'
14791 d_fsetpos='$d_fsetpos'
14792 d_fstatfs='$d_fstatfs'
14793 d_fstatvfs='$d_fstatvfs'
14794 d_ftello='$d_ftello'
14796 d_getcwd='$d_getcwd'
14797 d_getgrent='$d_getgrent'
14798 d_getgrps='$d_getgrps'
14799 d_gethbyaddr='$d_gethbyaddr'
14800 d_gethbyname='$d_gethbyname'
14801 d_gethent='$d_gethent'
14802 d_gethname='$d_gethname'
14803 d_gethostprotos='$d_gethostprotos'
14804 d_getlogin='$d_getlogin'
14805 d_getmnt='$d_getmnt'
14806 d_getmntent='$d_getmntent'
14807 d_getnbyaddr='$d_getnbyaddr'
14808 d_getnbyname='$d_getnbyname'
14809 d_getnent='$d_getnent'
14810 d_getnetprotos='$d_getnetprotos'
14811 d_getpbyname='$d_getpbyname'
14812 d_getpbynumber='$d_getpbynumber'
14813 d_getpent='$d_getpent'
14814 d_getpgid='$d_getpgid'
14815 d_getpgrp2='$d_getpgrp2'
14816 d_getpgrp='$d_getpgrp'
14817 d_getppid='$d_getppid'
14818 d_getprior='$d_getprior'
14819 d_getprotoprotos='$d_getprotoprotos'
14820 d_getpwent='$d_getpwent'
14821 d_getsbyname='$d_getsbyname'
14822 d_getsbyport='$d_getsbyport'
14823 d_getsent='$d_getsent'
14824 d_getservprotos='$d_getservprotos'
14825 d_getspent='$d_getspent'
14826 d_getspnam='$d_getspnam'
14827 d_gettimeod='$d_gettimeod'
14828 d_gnulibc='$d_gnulibc'
14829 d_grpasswd='$d_grpasswd'
14830 d_hasmntopt='$d_hasmntopt'
14834 d_inetaton='$d_inetaton'
14835 d_int64_t='$d_int64_t'
14836 d_isascii='$d_isascii'
14837 d_killpg='$d_killpg'
14838 d_lchown='$d_lchown'
14839 d_ldbl_dig='$d_ldbl_dig'
14841 d_locconv='$d_locconv'
14843 d_longdbl='$d_longdbl'
14844 d_longlong='$d_longlong'
14845 d_lseekproto='$d_lseekproto'
14848 d_mbstowcs='$d_mbstowcs'
14849 d_mbtowc='$d_mbtowc'
14850 d_memchr='$d_memchr'
14851 d_memcmp='$d_memcmp'
14852 d_memcpy='$d_memcpy'
14853 d_memmove='$d_memmove'
14854 d_memset='$d_memset'
14856 d_mkdtemp='$d_mkdtemp'
14857 d_mkfifo='$d_mkfifo'
14858 d_mkstemp='$d_mkstemp'
14859 d_mkstemps='$d_mkstemps'
14860 d_mktime='$d_mktime'
14862 d_mprotect='$d_mprotect'
14864 d_msg_ctrunc='$d_msg_ctrunc'
14865 d_msg_dontroute='$d_msg_dontroute'
14866 d_msg_oob='$d_msg_oob'
14867 d_msg_peek='$d_msg_peek'
14868 d_msg_proxy='$d_msg_proxy'
14869 d_msgctl='$d_msgctl'
14870 d_msgget='$d_msgget'
14871 d_msgrcv='$d_msgrcv'
14872 d_msgsnd='$d_msgsnd'
14874 d_munmap='$d_munmap'
14875 d_mymalloc='$d_mymalloc'
14877 d_nv_preserves_uv='$d_nv_preserves_uv'
14878 d_off64_t='$d_off64_t'
14879 d_old_pthread_create_joinable='$d_old_pthread_create_joinable'
14880 d_oldpthreads='$d_oldpthreads'
14881 d_oldsock='$d_oldsock'
14883 d_pathconf='$d_pathconf'
14885 d_phostname='$d_phostname'
14888 d_portable='$d_portable'
14889 d_pthread_yield='$d_pthread_yield'
14891 d_pwchange='$d_pwchange'
14892 d_pwclass='$d_pwclass'
14893 d_pwcomment='$d_pwcomment'
14894 d_pwexpire='$d_pwexpire'
14895 d_pwgecos='$d_pwgecos'
14896 d_pwpasswd='$d_pwpasswd'
14897 d_pwquota='$d_pwquota'
14899 d_readdir='$d_readdir'
14900 d_readlink='$d_readlink'
14901 d_rename='$d_rename'
14902 d_rewinddir='$d_rewinddir'
14904 d_safebcpy='$d_safebcpy'
14905 d_safemcpy='$d_safemcpy'
14906 d_sanemcmp='$d_sanemcmp'
14907 d_sched_yield='$d_sched_yield'
14908 d_scm_rights='$d_scm_rights'
14909 d_seekdir='$d_seekdir'
14910 d_select='$d_select'
14912 d_semctl='$d_semctl'
14913 d_semctl_semid_ds='$d_semctl_semid_ds'
14914 d_semctl_semun='$d_semctl_semun'
14915 d_semget='$d_semget'
14917 d_setegid='$d_setegid'
14918 d_seteuid='$d_seteuid'
14919 d_setgrent='$d_setgrent'
14920 d_setgrps='$d_setgrps'
14921 d_sethent='$d_sethent'
14922 d_setlinebuf='$d_setlinebuf'
14923 d_setlocale='$d_setlocale'
14924 d_setnent='$d_setnent'
14925 d_setpent='$d_setpent'
14926 d_setpgid='$d_setpgid'
14927 d_setpgrp2='$d_setpgrp2'
14928 d_setpgrp='$d_setpgrp'
14929 d_setprior='$d_setprior'
14930 d_setpwent='$d_setpwent'
14931 d_setregid='$d_setregid'
14932 d_setresgid='$d_setresgid'
14933 d_setresuid='$d_setresuid'
14934 d_setreuid='$d_setreuid'
14935 d_setrgid='$d_setrgid'
14936 d_setruid='$d_setruid'
14937 d_setsent='$d_setsent'
14938 d_setsid='$d_setsid'
14939 d_setspent='$d_setspent'
14940 d_setvbuf='$d_setvbuf'
14944 d_shmatprototype='$d_shmatprototype'
14945 d_shmctl='$d_shmctl'
14947 d_shmget='$d_shmget'
14948 d_sigaction='$d_sigaction'
14949 d_sigsetjmp='$d_sigsetjmp'
14950 d_socket='$d_socket'
14951 d_socklen_t='$d_socklen_t'
14952 d_sockpair='$d_sockpair'
14954 d_statblks='$d_statblks'
14955 d_statfs_f_flags='$d_statfs_f_flags'
14956 d_statfs_s='$d_statfs_s'
14957 d_statvfs='$d_statvfs'
14958 d_stdio_cnt_lval='$d_stdio_cnt_lval'
14959 d_stdio_ptr_lval='$d_stdio_ptr_lval'
14960 d_stdio_stream_array='$d_stdio_stream_array'
14961 d_stdiobase='$d_stdiobase'
14962 d_stdstdio='$d_stdstdio'
14963 d_strchr='$d_strchr'
14964 d_strcoll='$d_strcoll'
14965 d_strctcpy='$d_strctcpy'
14966 d_strerrm='$d_strerrm'
14967 d_strerror='$d_strerror'
14968 d_strtod='$d_strtod'
14969 d_strtol='$d_strtol'
14970 d_strtold='$d_strtold'
14971 d_strtoll='$d_strtoll'
14972 d_strtoul='$d_strtoul'
14973 d_strtoull='$d_strtoull'
14974 d_strtouq='$d_strtouq'
14975 d_strxfrm='$d_strxfrm'
14976 d_suidsafe='$d_suidsafe'
14977 d_symlink='$d_symlink'
14978 d_syscall='$d_syscall'
14979 d_sysconf='$d_sysconf'
14980 d_sysernlst='$d_sysernlst'
14981 d_syserrlst='$d_syserrlst'
14982 d_system='$d_system'
14983 d_tcgetpgrp='$d_tcgetpgrp'
14984 d_tcsetpgrp='$d_tcsetpgrp'
14985 d_telldir='$d_telldir'
14986 d_telldirproto='$d_telldirproto'
14989 d_truncate='$d_truncate'
14990 d_tzname='$d_tzname'
14993 d_union_semun='$d_union_semun'
14995 d_vendorbin='$d_vendorbin'
14996 d_vendorlib='$d_vendorlib'
14998 d_void_closedir='$d_void_closedir'
14999 d_voidsig='$d_voidsig'
15000 d_voidtty='$d_voidtty'
15001 d_volatile='$d_volatile'
15002 d_vprintf='$d_vprintf'
15004 d_waitpid='$d_waitpid'
15005 d_wcstombs='$d_wcstombs'
15006 d_wctomb='$d_wctomb'
15009 db_hashtype='$db_hashtype'
15010 db_prefixtype='$db_prefixtype'
15011 defvoidused='$defvoidused'
15012 direntrytype='$direntrytype'
15015 doublesize='$doublesize'
15017 dynamic_ext='$dynamic_ext'
15023 eunicefix='$eunicefix'
15026 extensions='$extensions'
15027 fflushNULL='$fflushNULL'
15028 fflushall='$fflushall'
15030 firstmakefile='$firstmakefile'
15032 fpossize='$fpossize'
15033 fpostype='$fpostype'
15034 freetype='$freetype'
15036 full_csh='$full_csh'
15037 full_sed='$full_sed'
15038 gccversion='$gccversion'
15039 gidformat='$gidformat'
15045 groupcat='$groupcat'
15046 groupstype='$groupstype'
15049 h_sysfile='$h_sysfile'
15061 i_arpainet='$i_arpainet'
15062 i_bsdioctl='$i_bsdioctl'
15065 i_dirent='$i_dirent'
15073 i_inttypes='$i_inttypes'
15074 i_limits='$i_limits'
15075 i_locale='$i_locale'
15076 i_machcthr='$i_machcthr'
15077 i_malloc='$i_malloc'
15079 i_memory='$i_memory'
15080 i_mntent='$i_mntent'
15083 i_neterrno='$i_neterrno'
15084 i_netinettcp='$i_netinettcp'
15087 i_pthread='$i_pthread'
15089 i_rpcsvcdbm='$i_rpcsvcdbm'
15092 i_shadow='$i_shadow'
15094 i_stdarg='$i_stdarg'
15095 i_stddef='$i_stddef'
15096 i_stdlib='$i_stdlib'
15097 i_string='$i_string'
15098 i_sysaccess='$i_sysaccess'
15099 i_sysdir='$i_sysdir'
15100 i_sysfile='$i_sysfile'
15101 i_sysfilio='$i_sysfilio'
15103 i_sysioctl='$i_sysioctl'
15104 i_syslog='$i_syslog'
15105 i_sysmman='$i_sysmman'
15106 i_sysmode='$i_sysmode'
15107 i_sysmount='$i_sysmount'
15108 i_sysndir='$i_sysndir'
15109 i_sysparam='$i_sysparam'
15110 i_sysresrc='$i_sysresrc'
15111 i_syssecrt='$i_syssecrt'
15112 i_sysselct='$i_sysselct'
15113 i_syssockio='$i_syssockio'
15114 i_sysstat='$i_sysstat'
15115 i_sysstatfs='$i_sysstatfs'
15116 i_sysstatvfs='$i_sysstatvfs'
15117 i_systime='$i_systime'
15118 i_systimek='$i_systimek'
15119 i_systimes='$i_systimes'
15120 i_systypes='$i_systypes'
15121 i_sysuio='$i_sysuio'
15123 i_sysutsname='$i_sysutsname'
15124 i_sysvfs='$i_sysvfs'
15125 i_syswait='$i_syswait'
15126 i_termio='$i_termio'
15127 i_termios='$i_termios'
15129 i_unistd='$i_unistd'
15132 i_values='$i_values'
15133 i_varargs='$i_varargs'
15134 i_varhdr='$i_varhdr'
15136 ignore_versioned_solibs='$ignore_versioned_solibs'
15137 inc_version_list='$inc_version_list'
15138 inc_version_list_init='$inc_version_list_init'
15141 installarchlib='$installarchlib'
15142 installbin='$installbin'
15143 installman1dir='$installman1dir'
15144 installman3dir='$installman3dir'
15145 installprefix='$installprefix'
15146 installprefixexp='$installprefixexp'
15147 installprivlib='$installprivlib'
15148 installscript='$installscript'
15149 installsitearch='$installsitearch'
15150 installsitebin='$installsitebin'
15151 installsitelib='$installsitelib'
15152 installstyle='$installstyle'
15153 installusrbinperl='$installusrbinperl'
15154 installvendorbin='$installvendorbin'
15155 installvendorlib='$installvendorlib'
15157 ivdformat='$ivdformat'
15160 known_extensions='$known_extensions'
15164 lddlflags='$lddlflags'
15166 ldlibpthname='$ldlibpthname'
15173 libsdirs='$libsdirs'
15174 libsfiles='$libsfiles'
15175 libsfound='$libsfound'
15176 libspath='$libspath'
15177 libswanted='$libswanted'
15183 locincpth='$locincpth'
15184 loclibpth='$loclibpth'
15185 longdblsize='$longdblsize'
15186 longlongsize='$longlongsize'
15187 longsize='$longsize'
15191 lseeksize='$lseeksize'
15192 lseektype='$lseektype'
15196 make_set_make='$make_set_make'
15197 mallocobj='$mallocobj'
15198 mallocsrc='$mallocsrc'
15199 malloctype='$malloctype'
15201 man1direxp='$man1direxp'
15204 man3direxp='$man3direxp'
15207 mips_type='$mips_type'
15209 mmaptype='$mmaptype'
15211 modetype='$modetype'
15213 multiarch='$multiarch'
15215 myarchname='$myarchname'
15216 mydomain='$mydomain'
15217 myhostname='$myhostname'
15220 netdb_hlen_type='$netdb_hlen_type'
15221 netdb_host_type='$netdb_host_type'
15222 netdb_name_type='$netdb_name_type'
15223 netdb_net_type='$netdb_net_type'
15226 nm_so_opt='$nm_so_opt'
15227 nonxs_ext='$nonxs_ext'
15231 o_nonblock='$o_nonblock'
15233 old_pthread_create_joinable='$old_pthread_create_joinable'
15234 optimize='$optimize'
15235 orderlib='$orderlib'
15241 patchlevel='$patchlevel'
15242 path_sep='$path_sep'
15245 perladmin='$perladmin'
15246 perlpath='$perlpath'
15248 phostname='$phostname'
15251 pm_apiversion='$pm_apiversion'
15255 prefixexp='$prefixexp'
15257 privlibexp='$privlibexp'
15258 prototype='$prototype'
15260 quadkind='$quadkind'
15261 quadtype='$quadtype'
15262 randbits='$randbits'
15263 randfunc='$randfunc'
15264 randseedtype='$randseedtype'
15266 rd_nodata='$rd_nodata'
15267 revision='$revision'
15271 sPRIEldbl='$sPRIEldbl'
15272 sPRIFldbl='$sPRIFldbl'
15273 sPRIGldbl='$sPRIGldbl'
15276 sPRIeldbl='$sPRIeldbl'
15277 sPRIfldbl='$sPRIfldbl'
15278 sPRIgldbl='$sPRIgldbl'
15283 sched_yield='$sched_yield'
15284 scriptdir='$scriptdir'
15285 scriptdirexp='$scriptdirexp'
15287 seedfunc='$seedfunc'
15288 selectminbits='$selectminbits'
15289 selecttype='$selecttype'
15290 sendmail='$sendmail'
15293 sharpbang='$sharpbang'
15294 shmattype='$shmattype'
15295 shortsize='$shortsize'
15298 sig_count='$sig_count'
15299 sig_name='$sig_name'
15300 sig_name_init='$sig_name_init'
15302 sig_num_init='$sig_num_init'
15303 signal_t='$signal_t'
15304 sitearch='$sitearch'
15305 sitearchexp='$sitearchexp'
15307 sitebinexp='$sitebinexp'
15309 sitelibexp='$sitelibexp'
15310 siteprefix='$siteprefix'
15311 siteprefixexp='$siteprefixexp'
15312 sizetype='$sizetype'
15317 sockethdr='$sockethdr'
15318 socketlib='$socketlib'
15320 spackage='$spackage'
15321 spitshell='$spitshell'
15324 ssizetype='$ssizetype'
15325 startperl='$startperl'
15327 static_ext='$static_ext'
15329 stdio_base='$stdio_base'
15330 stdio_bufsiz='$stdio_bufsiz'
15331 stdio_cnt='$stdio_cnt'
15332 stdio_filbuf='$stdio_filbuf'
15333 stdio_ptr='$stdio_ptr'
15334 stdio_stream_array='$stdio_stream_array'
15337 subversion='$subversion'
15344 timeincl='$timeincl'
15345 timetype='$timetype'
15358 uidformat='$uidformat'
15364 uquadtype='$uquadtype'
15365 use5005threads='$use5005threads'
15366 use64bits='$use64bits'
15368 usefull64bits='$usefull64bits'
15369 useithreads='$useithreads'
15370 uselargefiles='$uselargefiles'
15371 uselongdouble='$uselongdouble'
15372 usemorebits='$usemorebits'
15373 usemultiplicity='$usemultiplicity'
15374 usemymalloc='$usemymalloc'
15376 useopcode='$useopcode'
15377 useperlio='$useperlio'
15378 useposix='$useposix'
15380 useshrplib='$useshrplib'
15381 usesocks='$usesocks'
15382 usethreads='$usethreads'
15383 usevendorprefix='$usevendorprefix'
15384 usevfork='$usevfork'
15387 uvoformat='$uvoformat'
15390 uvuformat='$uvuformat'
15391 uvxformat='$uvxformat'
15392 vendorbin='$vendorbin'
15393 vendorbinexp='$vendorbinexp'
15394 vendorlib='$vendorlib'
15395 vendorlibexp='$vendorlibexp'
15396 vendorprefix='$vendorprefix'
15397 vendorprefixexp='$vendorprefixexp'
15400 voidflags='$voidflags'
15402 xs_apiversion='$xs_apiversion'
15407 : Add in command line options if available
15408 $test -f UU/cmdline.opt && $cat UU/cmdline.opt >> config.sh
15410 : add special variables
15411 $test -f $src/patchlevel.h && \
15412 awk '/^#define[ ]+PERL_/ {printf "%s=%s\n",$2,$3}' $src/patchlevel.h >>config.sh
15413 echo "CONFIGDOTSH=true" >>config.sh
15415 : propagate old symbols
15416 if $test -f UU/config.sh; then
15417 <UU/config.sh sort | uniq >UU/oldconfig.sh
15418 sed -n 's/^\([a-zA-Z_0-9]*\)=.*/\1/p' config.sh config.sh UU/oldconfig.sh |\
15419 sort | uniq -u >UU/oldsyms
15420 set X `cat UU/oldsyms`
15426 Hmm...You had some extra variables I don't know about...I'll try to keep 'em...
15428 echo "# Variables propagated from previous config.sh file." >>config.sh
15429 for sym in `cat UU/oldsyms`; do
15430 echo " Propagating $hint variable "'$'"$sym..."
15431 eval 'tmp="$'"${sym}"'"'
15433 sed -e "s/'/'\"'\"'/g" -e "s/^/$sym='/" -e "s/$/'/" >>config.sh
15439 : Finish up by extracting the .SH files
15453 If you'd like to make any changes to the config.sh file before I begin
15454 to configure things, do it as a shell escape now (e.g. !vi config.sh).
15457 rp="Press return or use a shell escape to edit config.sh:"
15462 *) : in case they cannot read
15463 sh 1>&4 -c "$ans";;
15468 : if this fails, just run all the .SH files by hand
15475 if $contains '^depend:' [Mm]akefile >/dev/null 2>&1; then
15482 Now you need to generate make dependencies by running "$make depend".
15483 You might prefer to run it in background: "$make depend > makedepend.out &"
15484 It can take a while, so you might not want to run it right now.
15489 rp="Run $make depend now?"
15493 $make depend && echo "Now you must run a $make."
15496 echo "You must run '$make depend' then '$make'."
15499 elif test -f [Mm]akefile; then
15501 echo "Now you must run a $make."
15506 if $test -f Policy.sh; then
15509 If you compile $package on a different machine or from a different object
15510 directory, copy the Policy.sh file from this object directory to the
15511 new one before you run Configure -- this will help you with most of
15512 the policy defaults.
15516 if $test -f config.msg; then
15517 echo "Hmm. I also noted the following information while running:"
15519 $cat config.msg >&4
15522 $rm -f kit*isdone ark*isdone