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 Sat Feb 26 00:48:15 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
454 d_old_pthread_create_joinable=''
455 old_pthread_create_joinable=''
694 inc_version_list_init=''
712 ignore_versioned_solibs=''
877 d_stdio_stream_array=''
878 stdio_stream_array=''
924 smallmach='pdp11 i8086 z8000 i80286 iAPX286'
927 : We must find out about Eunice early
929 if test -f /etc/unixtovms; then
930 eunicefix=/etc/unixtovms
932 if test -f /etc/unixtovms.exe; then
933 eunicefix=/etc/unixtovms.exe
937 : set useposix=false in your hint file to disable the POSIX extension.
939 : set useopcode=false in your hint file to disable the Opcode extension.
941 : Trailing extension. Override this in a hint file, if needed.
943 : Extra object files, if any, needed on this platform.
945 : Possible local include directories to search.
946 : Set locincpth to "" in a hint file to defeat local include searches.
947 locincpth="/usr/local/include /opt/local/include /usr/gnu/include"
948 locincpth="$locincpth /opt/gnu/include /usr/GNU/include /opt/GNU/include"
950 : no include file wanted by default
954 : change the next line if compiling for Xenix/286 on Xenix/386
955 xlibpth='/usr/lib/386 /lib/386'
956 : Possible local library directories to search.
957 loclibpth="/usr/local/lib /opt/local/lib /usr/gnu/lib"
958 loclibpth="$loclibpth /opt/gnu/lib /usr/GNU/lib /opt/GNU/lib"
960 : general looking path for locating libraries
961 glibpth="/usr/lib/large /lib /usr/lib $xlibpth"
962 glibpth="$glibpth /lib/large /usr/lib/small /lib/small"
963 glibpth="$glibpth /usr/ccs/lib /usr/ucblib /usr/local/lib"
964 test -f /usr/shlib/libc.so && glibpth="/usr/shlib $glibpth"
965 test -f /shlib/libc.so && glibpth="/shlib $glibpth"
967 : Private path used by Configure to find libraries. Its value
968 : is prepended to libpth. This variable takes care of special
969 : machines, like the mips. Usually, it should be empty.
972 : default library list
974 : some systems want to use only the non-versioned libso:s
975 ignore_versioned_solibs=''
976 : set usemultiplicity on the Configure command line to enable multiplicity.
977 : set usesocks on the Configure command line to enable socks.
978 : set usethreads on the Configure command line to enable threads.
979 : full support for void wanted by default
982 : List of libraries we want.
983 : If anyone needs -lnet, put it in a hint file.
984 libswanted='sfio socket inet nsl nm ndbm gdbm dbm db malloc dl'
985 libswanted="$libswanted dld ld sun m c cposix posix"
986 libswanted="$libswanted ndir dir crypt sec"
987 libswanted="$libswanted ucb bsd BSD PW x"
988 : We probably want to search /usr/shlib before most other libraries.
989 : This is only used by the lib/ExtUtils/MakeMaker.pm routine extliblist.
990 glibpth=`echo " $glibpth " | sed -e 's! /usr/shlib ! !'`
991 glibpth="/usr/shlib $glibpth"
992 : Do not use vfork unless overridden by a hint file.
995 : Find the basic shell for Bourne shell scripts
999 *bsd*|sys5*) xxx="/$SYSTYPE/bin/sh";;
1002 if test -f "$xxx"; then
1005 : Build up a list and do a single loop so we can 'break' out.
1006 pth=`echo $PATH | sed -e "s/$p_/ /g"`
1007 for xxx in sh bash ksh pdksh ash; do
1009 try="$try ${p}/${xxx}"
1013 if test -f "$xxx"; then
1016 elif test -f "$xxx.exe"; then
1027 $me: Fatal Error: I can't find a Bourne Shell anywhere.
1029 Usually it's in /bin/sh. How did you even get this far?
1030 Please contact me (Perl Maintainers) at perlbug@perl.com and
1031 we'll try to straighten this all out.
1037 : see if sh knows # comments
1038 if `$sh -c '#' >/dev/null 2>&1`; then
1042 test -f $xcat || xcat=/usr/bin/cat
1047 if test -s today; then
1050 echo "#! $xcat" > try
1054 if test -s today; then
1062 echo "Your $sh doesn't grok # comments--I will strip them later on."
1065 echo "exec grep -v '^[ ]*#'" >spitshell
1067 $eunicefix spitshell
1068 spitshell=`pwd`/spitshell
1070 echo "I presume that if # doesn't work, #! won't work either!"
1075 : figure out how to guarantee sh startup
1077 '') startsh=${sharpbang}${sh} ;;
1089 : echo "Yup, it does."
1091 echo "Hmm... '$startsh' does not guarantee sh startup..."
1092 echo "You may have to fix up the shell scripts to make sure $sh runs them."
1097 : Save command line options in file UU/cmdline.opt for later use in
1098 : generating config.sh.
1099 cat > cmdline.opt <<EOSH
1100 # Configure command line arguments.
1107 cat >>cmdline.opt <<EOSH
1108 config_arg$argn='$arg'
1110 argn=`expr $argn + 1`
1113 : produce awk script to parse command line options
1114 cat >options.awk <<'EOF'
1116 optstr = "A:dD:eEf:hKOrsSU:V"; # getopt-style specification
1118 len = length(optstr);
1119 for (i = 1; i <= len; i++) {
1120 c = substr(optstr, i, 1);
1121 if (i < len) a = substr(optstr, i + 1, 1); else a = "";
1132 if (substr(str, 1, 1) != "-") {
1133 printf("'%s'\n", str);
1137 for (i = 2; i <= len; i++) {
1138 c = substr(str, i, 1);
1140 printf("-%s\n", substr(str, i));
1146 printf("'%s'\n", substr(str, i + 1));
1159 : process the command line options
1160 set X `for arg in "$@"; do echo "X$arg"; done |
1161 sed -e s/X// | awk -f options.awk`
1166 : set up default values
1176 rm -f optdef.sh posthint.sh
1177 cat >optdef.sh <<EOS
1183 while test $# -gt 0; do
1185 -d) shift; fastread=yes;;
1186 -e) shift; alldone=cont;;
1190 if test -r "$1"; then
1193 echo "$me: cannot read config file $1." >&2
1198 -h) shift; error=true;;
1199 -r) shift; reuseval=true;;
1200 -s) shift; silent=true; realsilent=true;;
1201 -E) shift; alldone=exit;;
1202 -K) shift; knowitall=true;;
1203 -O) shift; override=true;;
1204 -S) shift; silent=true; extractsh=true;;
1209 echo "$me: use '-U symbol=', not '-D symbol='." >&2
1210 echo "$me: ignoring -D $1" >&2
1213 sed -e "s/'/'\"'\"'/g" -e "s/=\(.*\)/='\1'/" >> optdef.sh;;
1214 *) echo "$1='define'" >> optdef.sh;;
1221 *=) echo "$1" >> optdef.sh;;
1223 echo "$me: use '-D symbol=val', not '-U symbol=val'." >&2
1224 echo "$me: ignoring -U $1" >&2
1226 *) echo "$1='undef'" >> optdef.sh;;
1237 *=*) zzz=`echo $yyy|sed 's!=.*!!'`
1241 zzz=" "`echo $yyy|sed 's!^[^=]*=!!'`
1242 yyy=`echo $yyy|sed 's!=.*!!'` ;;
1248 *:*) xxx=`echo $yyy|sed 's!:.*!!'`
1249 yyy=`echo $yyy|sed 's!^[^:]*:!!'`
1250 zzz=`echo $yyy|sed 's!^[^=]*=!!'`
1251 yyy=`echo $yyy|sed 's!=.*!!'` ;;
1252 *) xxx=`echo $yyy|sed 's!:.*!!'`
1253 yyy=`echo $yyy|sed 's!^[^:]*:!!'` ;;
1259 echo "$yyy=\"\${$yyy}$zzz\"" >> posthint.sh ;;
1261 echo "$yyy=''" >> posthint.sh ;;
1266 echo "$yyy='$zzz'" >> posthint.sh ;;
1268 echo "eval \"$yyy=$zzz\"" >> posthint.sh ;;
1270 echo "$yyy=\"$zzz\${$yyy}\"" >> posthint.sh ;;
1275 echo "$yyy=$zzz" >> posthint.sh ;;
1276 *) echo "$me: unknown -A command '$xxx', ignoring -A $1" >&2 ;;
1280 -V) echo "$me generated by metaconfig 3.0 PL70." >&2
1283 -*) echo "$me: unknown option $1" >&2; shift; error=true;;
1291 Usage: $me [-dehrsEKOSV] [-f config.sh] [-D symbol] [-D symbol=value]
1292 [-U symbol] [-U symbol=] [-A command:symbol...]
1293 -d : use defaults for all answers.
1294 -e : go on without questioning past the production of config.sh.
1295 -f : specify an alternate default configuration file.
1296 -h : print this help message and exit (with an error status).
1297 -r : reuse C symbols value if possible (skips costly nm extraction).
1298 -s : silent mode, only echoes questions and essential information.
1299 -D : define symbol to have some value:
1300 -D symbol symbol gets the value 'define'
1301 -D symbol=value symbol gets the value 'value'
1302 -E : stop at the end of questions, after having produced config.sh.
1303 -K : do not use unless you know what you are doing.
1304 -O : let -D and -U override definitions from loaded configuration file.
1305 -S : perform variable substitutions on all .SH files (can mix with -f)
1306 -U : undefine symbol:
1307 -U symbol symbol gets the value 'undef'
1308 -U symbol= symbol gets completely empty
1309 -A : manipulate symbol after the platform specific hints have been applied:
1310 -A symbol=value append " "value to symbol
1311 -A append:symbol=value append value to symbol
1312 -A define:symbol=value define symbol to have value
1313 -A clear:symbol define symbol to be ''
1314 -A define:symbol define symbol to be 'define'
1315 -A eval:symbol=value define symbol to be eval of value
1316 -A prepend:symbol=value prepend value to symbol
1317 -A undef:symbol define symbol to be 'undef'
1318 -A undef:symbol= define symbol to be ''
1319 -V : print version number and exit (with a zero status).
1326 case "$fastread$alldone" in
1329 if test ! -t 0; then
1330 echo "Say 'sh Configure', not 'sh <Configure'"
1338 true) exec 1>/dev/null;;
1341 : run the defines and the undefines, if any, but leave the file out there...
1344 : create the posthint manipulation script and leave the file out there...
1349 first=`echo $package | sed -e 's/^\(.\).*/\1/'`
1350 last=`echo $package | sed -e 's/^.\(.*\)/\1/'`
1351 case "`echo AbyZ | tr '[:lower:]' '[:upper:]' 2>/dev/null`" in
1352 ABYZ) spackage=`echo $first | tr '[:lower:]' '[:upper:]'`$last;;
1353 *) spackage=`echo $first | tr '[a-z]' '[A-Z]'`$last;;
1356 : Some greps do not return status, grrr.
1357 echo "grimblepritz" >grimble
1358 if grep blurfldyick grimble >/dev/null 2>&1 ; then
1360 elif grep grimblepritz grimble >/dev/null 2>&1 ; then
1366 : the following should work in any shell
1370 echo "AGH! Grep doesn't return a status. Attempting remedial action."
1371 cat >contains <<'EOSS'
1372 grep "$1" "$2" >.greptmp && cat .greptmp && test -s .greptmp
1377 : Find the path to the source tree
1380 */*) src=`echo $0 | sed -e 's%/[^/][^/]*$%%'`
1383 *) src=`cd ../$src && pwd` ;;
1396 if test -f $rsrc/Configure && \
1397 $contains "^package=$package$" $rsrc/Configure >/dev/null 2>&1
1399 : found it, so we are ok.
1402 for src in . .. ../.. ../../.. ../../../..; do
1403 if test -f ../$src/Configure && \
1404 $contains "^package=$package$" ../$src/Configure >/dev/null 2>&1
1415 Sorry, I can't seem to locate the source dir for $package. Please start
1416 Configure with an explicit path -- i.e. /some/path/Configure.
1424 echo "Sources for $package found in \"$src\"." >&4
1428 : script used to extract .SH files with variable substitutions
1429 cat >extract <<'EOS'
1431 echo "Doing variable substitutions on .SH files..."
1432 if test -f $src/MANIFEST; then
1433 set x `awk '{print $1}' <$src/MANIFEST | grep '\.SH$'`
1435 echo "(Looking for .SH files under the source directory.)"
1436 set x `(cd $src; find . -name "*.SH" -print)`
1440 0) set x `(cd $src; echo *.SH)`; shift;;
1442 if test ! -f $src/$1; then
1448 while test $name; do
1449 if test ! -d "$name"; then
1450 create="$name $create";
1451 name=`echo $name | sed -e "s|^[^/]*$||"`;
1452 name=`echo $name | sed -e "s|\(.*\)/.*|\1|"`;
1457 for file in $create; do
1466 dir=`expr X$file : 'X\(.*\)/'`
1467 file=`expr X$file : 'X.*/\(.*\)'`
1468 (cd $dir && . ./$file)
1478 dir=`expr X$file : 'X\(.*\)/'`
1479 file=`expr X$file : 'X.*/\(.*\)'`
1480 (set x $dir; shift; eval $mkdir_p)
1490 if test -f $src/config_h.SH; then
1491 if test ! -f config.h; then
1492 : oops, they left it out of MANIFEST, probably, so do it anyway.
1498 : extract files and exit if asked to do so
1499 case "$extractsh" in
1501 case "$realsilent" in
1505 case "$config_sh" in
1506 '') config_sh='config.sh';;
1509 echo "Fetching answers from $config_sh..."
1512 test "$override" && . ./optdef.sh
1521 : Eunice requires " " instead of "", can you believe it
1524 echo "Beginning of configuration questions for $package."
1526 trap 'echo " "; test -d ../UU && rm -rf X $rmlist; exit 1' 1 2 3 15
1528 : first determine how to suppress newline on echo command
1530 echo "Checking echo to see how to suppress newlines..."
1531 (echo "hi there\c" ; echo " ") >.echotmp
1532 if $contains c .echotmp >/dev/null 2>&1 ; then
1543 echo $n "The star should be here-->$c"
1547 : Now test for existence of everything in MANIFEST
1549 if test -f $rsrc/MANIFEST; then
1550 echo "First let's make sure your kit is complete. Checking..." >&4
1551 awk '$1 !~ /PACK[A-Z]+/ {print $1}' $rsrc/MANIFEST | split -50
1554 for filelist in x??; do
1555 (cd $rsrc; ls `cat $tmppwd/$filelist` >/dev/null 2>>$tmppwd/missing)
1557 if test -s missing; then
1561 THIS PACKAGE SEEMS TO BE INCOMPLETE.
1563 You have the option of continuing the configuration process, despite the
1564 distinct possibility that your kit is damaged, by typing 'y'es. If you
1565 do, don't blame me if something goes wrong. I advise you to type 'n'o
1566 and contact the author (perlbug@perl.com).
1569 echo $n "Continue? [n] $c" >&4
1573 echo "Continuing..." >&4
1577 echo "ABORTING..." >&4
1582 echo "Looks good..."
1585 echo "There is no MANIFEST file. I hope your kit is complete !"
1590 : Find the appropriate value for a newline for tr
1591 if test -n "$DJGPP"; then
1594 if test X"$trnl" = X; then
1595 case "`echo foo|tr '\n' x 2>/dev/null`" in
1599 if test X"$trnl" = X; then
1600 case "`echo foo|tr '\012' x 2>/dev/null`" in
1601 foox) trnl='\012' ;;
1604 if test X"$trnl" = X; then
1607 $me: Fatal Error: cannot figure out how to translate newlines with 'tr'.
1613 : compute the number of columns on the terminal for proper question formatting
1618 : set up the echo used in my read
1619 myecho="case \"\$xxxm\" in
1620 '') echo $n \"\$rp $c\" >&4;;
1622 '') echo $n \"[\$xxxm] $c\";;
1624 if test \`echo \"\$rp [\$xxxm] \" | wc -c\` -ge $COLUMNS; then
1626 echo $n \"[\$xxxm] $c\" >&4
1628 echo $n \"\$rp [\$xxxm] $c\" >&4
1634 : now set up to do reads with possible shell escape and default assignment
1640 case "\$fastread" in
1641 yes) case "\$dflt" in
1644 case "\$silent-\$rp" in
1649 *) case "\$silent" in
1650 true) case "\$rp" in
1655 while expr "X\$ans" : "X!" >/dev/null; do
1659 aok=''; eval "ans=\\"\$answ\\"" && aok=y
1667 set x \`expr "X\$ans" : "X!\(.*\)\$"\`
1676 set x \`expr "X\$ans" : "X&\(.*\)\$"\`
1681 echo "(OK, I'll run with -d after this question.)" >&4
1684 echo "*** Sorry, \$1 not supported yet." >&4
1694 echo "*** Substitution done -- please confirm."
1696 ans=\`echo $n "\$ans$c" | tr '$trnl' ' '\`
1701 echo "*** Error -- try again."
1708 case "\$ans\$xxxm\$nostick" in
1720 : create .config dir to save info across Configure sessions
1721 test -d ../.config || mkdir ../.config
1722 cat >../.config/README <<EOF
1723 This directory created by Configure to save information that should
1724 persist across sessions for $package.
1726 You may safely delete it if you wish.
1729 : general instructions
1732 user=`(logname) 2>/dev/null`
1734 '') user=`whoami 2>&1`;;
1736 if $contains "^$user\$" ../.config/instruct >/dev/null 2>&1; then
1739 rp='Would you like to see the instructions?'
1750 This installation shell script will examine your system and ask you questions
1751 to determine how the perl5 package should be installed. If you get
1752 stuck on a question, you may use a ! shell escape to start a subshell or
1753 execute a command. Many of the questions will have default answers in square
1754 brackets; typing carriage return will give you the default.
1756 On some of the questions which ask for file or directory names you are allowed
1757 to use the ~name construct to specify the login directory belonging to "name",
1758 even if you don't have a shell which knows about that. Questions where this is
1759 allowed will be marked "(~name ok)".
1763 dflt='Type carriage return to continue'
1767 The prompter used in this script allows you to use shell variables and
1768 backticks in your answers. You may use $1, $2, etc... to refer to the words
1769 in the default answer, as if the default line was a set of arguments given to a
1770 script shell. This means you may also use $* to repeat the whole default line,
1771 so you do not have to re-type everything to add something to the default.
1773 Everytime there is a substitution, you will have to confirm. If there is an
1774 error (e.g. an unmatched backtick), the default answer will remain unchanged
1775 and you will be prompted again.
1777 If you are in a hurry, you may run 'Configure -d'. This will bypass nearly all
1778 the questions and use the computed defaults (or the previous answers if there
1779 was already a config.sh file). Type 'Configure -h' for a list of options.
1780 You may also start interactively and then answer '& -d' at any prompt to turn
1781 on the non-interactive behaviour for the remainder of the execution.
1787 Much effort has been expended to ensure that this shell script will run on any
1788 Unix system. If despite that it blows up on yours, your best bet is to edit
1789 Configure and run it again. If you can't run Configure for some reason,
1790 you'll have to generate a config.sh file by hand. Whatever problems you
1791 have, let me (perlbug@perl.com) know how I blew it.
1793 This installation script affects things in two ways:
1795 1) it may do direct variable substitutions on some of the files included
1797 2) it builds a config.h file for inclusion in C programs. You may edit
1798 any of these files as the need arises after running this script.
1800 If you make a mistake on a question, there is no easy way to back up to it
1801 currently. The easiest thing to do is to edit config.sh and rerun all the SH
1802 files. Configure will offer to let you do this before it runs the SH files.
1805 dflt='Type carriage return to continue'
1807 case "$firsttime" in
1808 true) echo $user >>../.config/instruct;;
1812 : find out where common programs are
1814 echo "Locating common programs..." >&4
1827 if test -d \$dir/\$thing; then
1833 for thisthing in \$dir/\$thing; do
1834 : just loop through to pick last item
1836 if test -f \$thisthing; then
1839 elif test -f \$dir/\$thing.exe; then
1840 if test -n "$DJGPP"; then
1841 echo \$dir/\$thing.exe
1843 : on Eunice apparently
1893 pth=`echo $PATH | sed -e "s/$p_/ /g"`
1894 pth="$pth /lib /usr/lib"
1895 for file in $loclist; do
1899 if test -f "$xxx"; then
1902 echo "WARNING: no $xxx -- ignoring your setting for $file." >&4
1903 xxx=`./loc $file $file $pth`
1906 '') xxx=`./loc $file $file $pth`;;
1907 *) xxx=`./loc $xxx $xxx $pth`;;
1913 echo $file is in $xxx.
1916 echo $file is in $xxx.
1919 echo "I don't know where '$file' is, and my life depends on it." >&4
1920 echo "Go find a public domain implementation or fix your PATH setting!" >&4
1926 echo "Don't worry if any of the following aren't found..."
1928 for file in $trylist; do
1932 if test -f "$xxx"; then
1935 echo "WARNING: no $xxx -- ignoring your setting for $file." >&4
1936 xxx=`./loc $file $file $pth`
1939 '') xxx=`./loc $file $file $pth`;;
1940 *) xxx=`./loc $xxx $xxx $pth`;;
1946 echo $file is in $xxx.
1949 echo $file is in $xxx.
1952 echo "I don't see $file out there, $say."
1959 echo "Substituting grep for egrep."
1965 echo "Substituting cp for ln."
1971 echo "Hopefully test is built into your sh."
1974 if `sh -c "PATH= test true" >/dev/null 2>&1`; then
1975 echo "Using the test built into your sh."
1983 echo "Hopefully echo is built into your sh."
1988 echo "Checking compatibility between $echo and builtin echo (if any)..." >&4
1989 $echo $n "hi there$c" >foo1
1990 echo $n "hi there$c" >foo2
1991 if cmp foo1 foo2 >/dev/null 2>&1; then
1992 echo "They are compatible. In fact, they may be identical."
1999 They are not compatible! You are probably running ksh on a non-USG system.
2000 I'll have to use $echo instead of the builtin, since Bourne shell doesn't
2001 have echo built in and we may have to run some Bourne shell scripts. That
2002 means I'll have to use '$n$c' to suppress newlines now. Life is ridiculous.
2005 $echo $n "The star should be here-->$c"
2012 : determine whether symbolic links are supported
2015 if $ln -s blurfl sym > /dev/null 2>&1 ; then
2016 echo "Symbolic links are supported." >&4
2019 echo "Symbolic links are NOT supported." >&4
2024 : see whether [:lower:] and [:upper:] are supported character classes
2026 case "`echo AbyZ | $tr '[:lower:]' '[:upper:]' 2>/dev/null`" in
2028 echo "Good, your tr supports [:lower:] and [:upper:] to convert case." >&4
2032 *) # There is a discontinuity in EBCDIC between 'I' and 'J'
2033 # (0xc9 and 0xd1), therefore that is a nice testing point.
2034 if test "X$up" = X -o "X$low" = X; then
2035 case "`echo IJ | $tr '[I-J]' '[i-j]' 2>/dev/null`" in
2041 if test "X$up" = X -o "X$low" = X; then
2042 case "`echo IJ | $tr I-J i-j 2>/dev/null`" in
2048 if test "X$up" = X -o "X$low" = X; then
2049 case "`echo IJ | od -x 2>/dev/null`" in
2051 echo "Hey, this might be EBCDIC." >&4
2052 if test "X$up" = X -o "X$low" = X; then
2053 case "`echo IJ | $tr '[A-IJ-RS-Z]' '[a-ij-rs-z]' 2>/dev/null`" in
2054 ij) up='[A-IJ-RS-Z]'
2059 if test "X$up" = X -o "X$low" = X; then
2060 case "`echo IJ | $tr A-IJ-RS-Z a-ij-rs-z 2>/dev/null`" in
2070 case "`echo IJ | $tr \"$up\" \"$low\" 2>/dev/null`" in
2072 echo "Using $up and $low to convert case." >&4
2075 echo "I don't know how to translate letters from upper to lower case." >&4
2076 echo "Your tr is not acting any way I know of." >&4
2080 : set up the translation script tr, must be called with ./tr of course
2084 '[A-Z][a-z]') exec $tr '$up' '$low';;
2085 '[a-z][A-Z]') exec $tr '$low' '$up';;
2092 : Try to determine whether config.sh was made on this system
2093 case "$config_sh" in
2095 myuname=`$uname -a 2>/dev/null`
2096 $test -z "$myuname" && myuname=`hostname 2>/dev/null`
2097 # tr '[A-Z]' '[a-z]' would not work in EBCDIC
2098 # because the A-Z/a-z are not consecutive.
2099 myuname=`echo $myuname | $sed -e 's/^[^=]*=//' -e 's/\///g' | \
2100 ./tr '[A-Z]' '[a-z]' | $tr $trnl ' '`
2101 newmyuname="$myuname"
2103 case "$knowitall" in
2105 if test -f ../config.sh; then
2106 if $contains myuname= ../config.sh >/dev/null 2>&1; then
2107 eval "`grep myuname= ../config.sh`"
2109 if test "X$myuname" = "X$newmyuname"; then
2117 : Get old answers from old config file if Configure was run on the
2118 : same system, otherwise use the hints.
2121 if test -f config.sh; then
2123 rp="I see a config.sh file. Shall I use it to set the defaults?"
2126 n*|N*) echo "OK, I'll ignore it."; mv config.sh config.sh.old;;
2127 *) echo "Fetching default answers from your old config.sh file..." >&4
2135 : Older versions did not always set $sh. Catch re-use of such
2144 if test ! -f config.sh; then
2147 First time through, eh? I have some defaults handy for some systems
2148 that need some extra help getting the Configure answers right:
2151 (cd $src/hints; ls -C *.sh) | $sed 's/\.sh/ /g' >&4
2153 : Half the following guesses are probably wrong... If you have better
2154 : tests or hints, please send them to perlbug@perl.com
2155 : The metaconfig authors would also appreciate a copy...
2156 $test -f /irix && osname=irix
2157 $test -f /xenix && osname=sco_xenix
2158 $test -f /dynix && osname=dynix
2159 $test -f /dnix && osname=dnix
2160 $test -f /lynx.os && osname=lynxos
2161 $test -f /unicos && osname=unicos && osvers=`$uname -r`
2162 $test -f /unicosmk && osname=unicosmk && osvers=`$uname -r`
2163 $test -f /unicosmk.ar && osname=unicosmk && osvers=`$uname -r`
2164 $test -f /bin/mips && /bin/mips && osname=mips
2165 $test -d /NextApps && set X `hostinfo | grep 'NeXT Mach.*:' | \
2166 $sed -e 's/://' -e 's/\./_/'` && osname=next && osvers=$4
2167 $test -d /usr/apollo/bin && osname=apollo
2168 $test -f /etc/saf/_sactab && osname=svr4
2169 $test -d /usr/include/minix && osname=minix
2170 if $test -d /MachTen -o -d /MachTen_Folder; then
2172 if $test -x /sbin/version; then
2173 osvers=`/sbin/version | $awk '{print $2}' |
2174 $sed -e 's/[A-Za-z]$//'`
2175 elif $test -x /usr/etc/version; then
2176 osvers=`/usr/etc/version | $awk '{print $2}' |
2177 $sed -e 's/[A-Za-z]$//'`
2183 $test -f /sys/posix.dll &&
2184 $test -f /usr/bin/what &&
2185 set X `/usr/bin/what /sys/posix.dll` &&
2186 $test "$3" = UWIN &&
2190 if $test -f $uname; then
2198 umips) osname=umips ;;
2201 [23]100) osname=mips ;;
2202 next*) osname=next ;;
2204 tmp=`/bin/uname -X 2>/dev/null|awk '/3\.2v[45]/{ print $(NF) }'`
2205 if $test "$tmp" != "" -a "$3" = "3.2" -a -f '/etc/systemid'; then
2208 elif $test -f /etc/kconfig; then
2210 if test "$lns" = "$ln -s"; then
2212 elif $contains _SYSV3 /usr/include/stdio.h > /dev/null 2>&1 ; then
2214 elif $contains _POSIX_SOURCE /usr/include/stdio.h > /dev/null 2>&1 ; then
2221 if test -n "$DJGPP"; then
2230 tmp=`( (oslevel) 2>/dev/null || echo "not found") 2>&1`
2232 'not found') osvers="$4"."$3" ;;
2233 '<3240'|'<>3240') osvers=3.2.0 ;;
2234 '=3240'|'>3240'|'<3250'|'<>3250') osvers=3.2.4 ;;
2235 '=3250'|'>3250') osvers=3.2.5 ;;
2239 bsd386) osname=bsd386
2242 cygwin*) osname=cygwin
2245 *dc.osx) osname=dcosx
2251 domainos) osname=apollo
2257 dynixptx*) osname=dynixptx
2258 osvers=`echo "$4"|sed 's/^v//'`
2260 freebsd) osname=freebsd
2262 genix) osname=genix ;;
2264 osvers=`echo "$3" | $sed 's,.*\.\([0-9]*\.[0-9]*\),\1,'`
2280 netbsd*) osname=netbsd
2283 news-os) osvers="$3"
2285 4*) osname=newsos4 ;;
2289 next*) osname=next ;;
2290 POSIX-BC | posix-bc ) osname=posix-bc
2293 powerux | power_ux | powermax_os | powermaxos | \
2294 powerunix | power_unix) osname=powerux
2300 solaris) osname=solaris
2302 5*) osvers=`echo $3 | $sed 's/^5/2/g'` ;;
2309 osvers=`echo $3 | $sed 's/^5/2/g'` ;;
2313 titanos) osname=titanos
2322 ultrix) osname=ultrix
2325 osf1|mls+) case "$5" in
2328 osvers=`echo "$3" | sed 's/^[xvt]//'`
2330 hp*) osname=hp_osf1 ;;
2331 mips) osname=mips_osf1 ;;
2334 unixware) osname=svr5
2340 $2) case "$osname" in
2344 : svr4.x or possibly later
2354 if test -f /stand/boot ; then
2355 eval `grep '^INITPROG=[a-z/0-9]*$' /stand/boot`
2356 if test -n "$INITPROG" -a -f "$INITPROG"; then
2357 isesix=`strings -a $INITPROG|grep 'ESIX SYSTEM V/386 Release 4.0'`
2358 if test -n "$isesix"; then
2366 *) if test -f /etc/systemid; then
2368 set `echo $3 | $sed 's/\./ /g'` $4
2369 if $test -f $src/hints/sco_$1_$2_$3.sh; then
2371 elif $test -f $src/hints/sco_$1_$2.sh; then
2373 elif $test -f $src/hints/sco_$1.sh; then
2378 '') : Still unknown. Probably a generic Sys V.
2387 *) case "$osname" in
2388 '') : Still unknown. Probably a generic BSD.
2396 if test -f /vmunix -a -f $src/hints/news_os.sh; then
2397 (what /vmunix | UU/tr '[A-Z]' '[a-z]') > UU/kernel.what 2>&1
2398 if $contains news-os UU/kernel.what >/dev/null 2>&1; then
2401 $rm -f UU/kernel.what
2402 elif test -d c:/.; then
2409 : Now look for a hint file osname_osvers, unless one has been
2410 : specified already.
2413 file=`echo "${osname}_${osvers}" | $sed -e 's%\.%_%g' -e 's%_$%%'`
2414 : Also try without trailing minor version numbers.
2415 xfile=`echo $file | $sed -e 's%_[^_]*$%%'`
2416 xxfile=`echo $xfile | $sed -e 's%_[^_]*$%%'`
2417 xxxfile=`echo $xxfile | $sed -e 's%_[^_]*$%%'`
2418 xxxxfile=`echo $xxxfile | $sed -e 's%_[^_]*$%%'`
2421 *) case "$osvers" in
2424 *) if $test -f $src/hints/$file.sh ; then
2426 elif $test -f $src/hints/$xfile.sh ; then
2428 elif $test -f $src/hints/$xxfile.sh ; then
2430 elif $test -f $src/hints/$xxxfile.sh ; then
2432 elif $test -f $src/hints/$xxxxfile.sh ; then
2434 elif $test -f "$src/hints/${osname}.sh" ; then
2443 if $test -f Policy.sh ; then
2446 none) dflt="Policy" ;;
2447 *) dflt="Policy $dflt" ;;
2452 dflt=`echo $hintfile | $sed 's/\.sh$//'`
2456 if $test -f Policy.sh ; then
2459 There's also a Policy hint file available, which should make the
2460 site-specific (policy) questions easier to answer.
2467 You may give one or more space-separated answers, or "none" if appropriate.
2468 A well-behaved OS will have no hints, so answering "none" or just "Policy"
2469 is a good thing. DO NOT give a wrong version or a wrong OS.
2473 rp="Which of these apply, if any?"
2476 for file in $tans; do
2477 if $test X$file = XPolicy -a -f Policy.sh; then
2479 $cat Policy.sh >> UU/config.sh
2480 elif $test -f $src/hints/$file.sh; then
2481 . $src/hints/$file.sh
2482 $cat $src/hints/$file.sh >> UU/config.sh
2483 elif $test X$tans = X -o X$tans = Xnone ; then
2486 : Give one chance to correct a possible typo.
2487 echo "$file.sh does not exist"
2489 rp="hint to use instead?"
2491 for file in $ans; do
2492 if $test -f "$src/hints/$file.sh"; then
2493 . $src/hints/$file.sh
2494 $cat $src/hints/$file.sh >> UU/config.sh
2495 elif $test X$ans = X -o X$ans = Xnone ; then
2498 echo "$file.sh does not exist -- ignored."
2505 : Remember our hint file for later.
2506 if $test -f "$src/hints/$file.sh" ; then
2516 echo "Fetching default answers from $config_sh..." >&4
2520 cp $config_sh config.sh 2>/dev/null
2530 test "$override" && . ./optdef.sh
2531 myuname="$newmyuname"
2533 : Restore computed paths
2534 for file in $loclist $trylist; do
2535 eval $file="\$_$file"
2540 Configure uses the operating system name and version to set some defaults.
2541 The default value is probably right if the name rings a bell. Otherwise,
2542 since spelling matters for me, either accept the default or answer "none"
2549 ''|' '|none) dflt=none ;;
2550 *) dflt=`echo $hintfile | $sed -e 's/\.sh$//' -e 's/_.*$//'` ;;
2553 *) dflt="$osname" ;;
2555 rp="Operating system name?"
2559 *) osname=`echo "$ans" | $sed -e 's/[ ][ ]*/_/g' | ./tr '[A-Z]' '[a-z]'`;;
2565 ''|' '|none) dflt=none ;;
2566 *) dflt=`echo $hintfile | $sed -e 's/\.sh$//' -e 's/^[^_]*//'`
2567 dflt=`echo $dflt | $sed -e 's/^_//' -e 's/_/./g'`
2569 ''|' ') dflt=none ;;
2574 *) dflt="$osvers" ;;
2576 rp="Operating system version?"
2586 : who configured the system
2587 cf_time=`LC_ALL=C; LANGUAGE=C; export LC_ALL; export LANGUAGE; $date 2>&1`
2588 cf_by=`(logname) 2>/dev/null`
2591 cf_by=`(whoami) 2>/dev/null`
2593 "") cf_by=unknown ;;
2597 : set up the script used to warn in case of inconsistency
2604 echo "*** WHOA THERE!!! ***" >&4
2605 echo " The $hint value for \$$var on this machine was \"$was\"!" >&4
2606 rp=" Keep the $hint value?"
2609 y) td=$was; tu=$was;;
2613 : function used to set $1 to $val
2614 setvar='var=$1; eval "was=\$$1"; td=$define; tu=$undef;
2616 $define$undef) . ./whoa; eval "$var=\$td";;
2617 $undef$define) . ./whoa; eval "$var=\$tu";;
2618 *) eval "$var=$val";;
2621 case "$usethreads" in
2622 $define|true|[yY]*) dflt='y';;
2627 Perl can be built to take advantage of threads on some systems.
2628 To do so, Configure can be run with -Dusethreads.
2630 Note that threading is a highly experimental feature, and
2631 some known race conditions still remain. If you choose to try
2632 it, be very sure to not actually deploy it for production
2633 purposes. README.threads has more details, and is required
2634 reading if you enable threads.
2636 If this doesn't make any sense to you, just accept the default '$dflt'.
2638 rp='Build a threading Perl?'
2641 y|Y) val="$define" ;;
2647 case "$usethreads" in
2651 As of 5.5.640, Perl has two different internal threading implementations,
2652 the 5.005 version (5005threads) and an interpreter-based version
2653 (ithreads) that has one interpreter per thread. Both are very
2654 experimental. This arrangement exists to help developers work out
2655 which one is better.
2657 If you're a casual user, you probably don't want interpreter-threads
2658 at this time. There doesn't yet exist a way to create threads from
2659 within Perl in this model, i.e., "use Thread;" will NOT work.
2661 : Default to ithreads unless overridden on command line or with
2664 case "$use5005threads" in
2665 $define|true|[yY]*) dflt='n';;
2667 case "$useithreads" in
2668 $undef|false|[nN]*) dflt='n';;
2670 rp='Use interpreter-based ithreads?'
2673 y|Y) val="$define" ;;
2678 : Now set use5005threads to the opposite value.
2679 case "$useithreads" in
2680 $define) val="$undef" ;;
2687 useithreads="$undef"
2688 use5005threads="$undef"
2692 case "$d_oldpthreads" in
2693 '') : Configure tests would be welcome here. For now, assume undef.
2695 *) val="$d_oldpthreads" ;;
2701 case "$usethreads" in
2702 "$define"|true|[yY]*)
2703 : Look for a hint-file generated 'call-back-unit'. If the
2704 : user has specified that a threading perl is to be built,
2705 : we may need to set or change some other defaults.
2706 if $test -f usethreads.cbu; then
2707 echo "Your platform has some specific hints for threaded builds, using them..."
2711 (Your platform doesn't have any specific hints for threaded builds.
2712 Assuming POSIX threads, then.)
2720 Perl can be built so that multiple Perl interpreters can coexist
2721 within the same Perl executable.
2724 case "$useithreads" in
2727 This multiple interpreter support is required for interpreter-based threads.
2731 *) case "$usemultiplicity" in
2732 $define|true|[yY]*) dflt='y';;
2736 echo "If this doesn't make any sense to you, just accept the default '$dflt'."
2737 rp='Build Perl for multiplicity?'
2740 y|Y) val="$define" ;;
2748 : determine where manual pages are on this system
2752 syspath='/usr/man/man1 /usr/man/mann /usr/man/manl /usr/man/local/man1'
2753 syspath="$syspath /usr/man/u_man/man1 /usr/share/man/man1"
2754 syspath="$syspath /usr/catman/u_man/man1 /usr/man/l_man/man1"
2755 syspath="$syspath /usr/local/man/u_man/man1 /usr/local/man/l_man/man1"
2756 syspath="$syspath /usr/man/man.L /local/man/man1 /usr/local/man/man1"
2757 sysman=`./loc . /usr/man/man1 $syspath`
2760 if $test -d "$sysman"; then
2761 echo "System manual is in $sysman." >&4
2763 echo "Could not find manual pages in source form." >&4
2766 : see what memory models we can support
2769 $cat >pdp11.c <<'EOP'
2778 ( cc -o pdp11 pdp11.c ) >/dev/null 2>&1
2779 if $test -f pdp11 && ./pdp11 2>/dev/null; then
2780 dflt='unsplit split'
2782 tans=`./loc . X /lib/small /lib/large /usr/lib/small /usr/lib/large /lib/medium /usr/lib/medium /lib/huge`
2785 *) if $test -d /lib/small || $test -d /usr/lib/small; then
2790 if $test -d /lib/medium || $test -d /usr/lib/medium; then
2793 if $test -d /lib/large || $test -d /usr/lib/large; then
2796 if $test -d /lib/huge || $test -d /usr/lib/huge; then
2805 Some systems have different model sizes. On most systems they are called
2806 small, medium, large, and huge. On the PDP11 they are called unsplit and
2807 split. If your system doesn't support different memory models, say "none".
2808 If you wish to force everything to one memory model, say "none" here and
2809 put the appropriate flags later when it asks you for other cc and ld flags.
2810 Venix systems may wish to put "none" and let the compiler figure things out.
2811 (In the following question multiple model names should be space separated.)
2813 The default for most systems is "none".
2816 rp="Which memory models are supported?"
2831 '') if $contains '\-i' $sysman/ld.1 >/dev/null 2>&1 || \
2832 $contains '\-i' $sysman/cc.1 >/dev/null 2>&1; then
2839 rp="What flag indicates separate I and D space?"
2847 *large*|*small*|*medium*|*huge*)
2854 rp="What flag indicates large model?"
2864 *huge*) case "$huge" in
2868 rp="What flag indicates huge model?"
2878 *medium*) case "$medium" in
2882 rp="What flag indicates medium model?"
2889 *) medium="$large";;
2892 *small*) case "$small" in
2896 rp="What flag indicates small model?"
2907 echo "Unrecognized memory models--you may have to edit Makefile.SH" >&4
2910 $rm -f pdp11.* pdp11
2912 : make some quick guesses about what we are up against
2914 $echo $n "Hmm... $c"
2924 $cat /usr/include/signal.h /usr/include/sys/signal.h >foo 2>/dev/null
2925 if test -f /osf_boot || $contains 'OSF/1' /usr/include/ctype.h >/dev/null 2>&1
2927 echo "Looks kind of like an OSF/1 system, but we'll see..."
2929 elif test `echo abc | tr a-z A-Z` = Abc ; then
2930 xxx=`./loc addbib blurfl $pth`
2931 if $test -f $xxx; then
2932 echo "Looks kind of like a USG system with BSD features, but we'll see..."
2936 if $contains SIGTSTP foo >/dev/null 2>&1 ; then
2937 echo "Looks kind of like an extended USG system, but we'll see..."
2939 echo "Looks kind of like a USG system, but we'll see..."
2943 elif $contains SIGTSTP foo >/dev/null 2>&1 ; then
2944 echo "Looks kind of like a BSD system, but we'll see..."
2948 echo "Looks kind of like a Version 7 system, but we'll see..."
2951 case "$eunicefix" in
2954 There is, however, a strange, musty smell in the air that reminds me of
2955 something...hmm...yes...I've got it...there's a VMS nearby, or I'm a Blit.
2959 : it so happens the Eunice I know will not run shell scripts in Unix format
2963 echo "Congratulations. You aren't running Eunice."
2967 : Detect OS2. The p_ variable is set above in the Head.U unit.
2972 I have the feeling something is not exactly right, however...don't tell me...
2973 lemme think...does HAL ring a bell?...no, of course, you're only running OS/2!
2978 if test -f /xenix; then
2979 echo "Actually, this looks more like a XENIX system..."
2984 echo "It's not Xenix..."
2989 if test -f /venix; then
2990 echo "Actually, this looks more like a VENIX system..."
2997 echo "Nor is it Venix..."
3000 chmod +x bsd usg v7 osf1 eunice xenix venix os2
3001 $eunicefix bsd usg v7 osf1 eunice xenix venix os2
3004 : see if we need a special compiler
3012 *) if $contains '\-M' $sysman/cc.1 >/dev/null 2>&1 ; then
3013 if $contains '\-M' $sysman/cpp.1 >/dev/null 2>&1; then
3027 On some older systems the default C compiler will not resolve multiple global
3028 references that happen to have the same name. On some such systems the "Mcc"
3029 command may be used to force these to be resolved. On other systems a "cc -M"
3030 command is required. (Note that the -M flag on other systems indicates a
3031 memory model to use!) If you have the Gnu C compiler, you might wish to use
3037 rp="Use which C compiler?"
3045 rp="Use which C compiler?"
3049 : Look for a hint-file generated 'call-back-unit'. Now that the
3050 : user has specified the compiler, we may need to set or change some
3052 if $test -f cc.cbu; then
3056 echo "Checking for GNU cc in disguise and/or its version number..." >&4
3057 $cat >gccvers.c <<EOM
3062 printf("%s\n", __VERSION__);
3064 printf("%s\n", "1");
3070 if $cc $ldflags -o gccvers gccvers.c; then
3071 gccversion=`./gccvers`
3072 case "$gccversion" in
3073 '') echo "You are not using GNU cc." ;;
3074 *) echo "You are using GNU cc $gccversion."
3079 echo "*** WHOA THERE!!! ***" >&4
3080 echo " Your C compiler \"$cc\" doesn't seem to be working!" >&4
3081 case "$knowitall" in
3083 echo " You'd better start hunting for one and let me know about it." >&4
3089 case "$gccversion" in
3090 1*) cpp=`./loc gcc-cpp $cpp $pth` ;;
3093 : decide how portable to be. Allow command line overrides.
3094 case "$d_portable" in
3096 *) d_portable="$define" ;;
3099 : set up shell script to do ~ expansion
3105 echo \$1 | $sed "s|~|\${HOME-\$LOGDIR}|"
3108 if $test -f /bin/csh; then
3109 /bin/csh -f -c "glob \$1"
3114 name=\`$expr x\$1 : '..\([^/]*\)'\`
3115 dir=\`$sed -n -e "/^\${name}:/{s/^[^:]*:[^:]*:[^:]*:[^:]*:[^:]*:\([^:]*\).*"'\$'"/\1/" -e p -e q -e '}' </etc/passwd\`
3116 if $test ! -d "\$dir"; then
3118 echo "\$me: can't locate home directory for: \$name" >&2
3123 echo \$dir/\`$expr x\$1 : '..[^/]*/\(.*\)'\`
3139 : now set up to get a file name
3143 cat <<'EOSC' >>getfile
3159 expr $fn : '.*(\(.*\)).*' | tr ',' $trnl >getfile.ok
3160 fn=`echo $fn | sed 's/(.*)//'`
3166 loc_file=`expr $fn : '.*:\(.*\)'`
3167 fn=`expr $fn : '\(.*\):.*'`
3175 */*) fullpath=true;;
3184 *e*) exp_file=true;;
3187 *p*) nopath_ok=true;;
3192 *d*) type='Directory';;
3193 *l*) type='Locate';;
3198 Locate) what='File';;
3203 case "$d_portable" in
3211 while test "$type"; do
3216 true) rp="$rp (~name ok)";;
3219 if test -f UU/getfile.ok && \
3220 $contains "^$ans\$" UU/getfile.ok >/dev/null 2>&1
3239 value=`UU/filexp $ans`
3242 if test "$ans" != "$value"; then
3243 echo "(That expands to $value on this system.)"
3257 /*) value="$ansexp" ;;
3262 echo "I shall only accept a full path name, as in /bin/ls." >&4
3263 echo "Use a ! shell escape if you wish to check pathnames." >&4
3266 echo "Please give a full path name, starting with slash." >&4
3269 echo "Note that using ~name is ok provided it expands well." >&4
3282 for fp in $gfpth; do
3283 if test "X$fp" = X.; then
3288 if test -f "$pf"; then
3290 elif test -r "$pf" || (test -h "$pf") >/dev/null 2>&1
3292 echo "($value is not a plain file, but that's ok.)"
3295 if test X"$type" = X; then
3302 for fp in $gfpth; do
3303 if test "X$fp" = X.; then
3308 if test -d "$pf"; then
3316 if test -d "$ansexp"; then
3317 echo "(Looking for $loc_file in directory $value.)"
3318 value="$value/$loc_file"
3319 ansexp="$ansexp/$loc_file"
3321 if test -f "$ansexp"; then
3324 case "$nopath_ok" in
3325 true) case "$value" in
3327 *) echo "Assuming $value will be in people's path."
3343 if test "$fastread" = yes; then
3348 rp="$what $value doesn't exist. Use that name anyway?"
3367 test "X$gfpthkeep" != Xy && gfpth=""
3370 : What should the include directory be ?
3372 $echo $n "Hmm... $c"
3376 if $test -f /bin/mips && /bin/mips; then
3377 echo "Looks like a MIPS system..."
3378 $cat >usr.c <<'EOCP'
3379 #ifdef SYSTYPE_BSD43
3383 if $cc -E usr.c > usr.out && $contains / usr.out >/dev/null 2>&1; then
3384 dflt='/bsd43/usr/include'
3388 mips_type='System V'
3390 $rm -f usr.c usr.out
3391 echo "and you're compiling with the $mips_type compiler and libraries."
3395 echo "Doesn't look like a MIPS system."
3405 case "$xxx_prompt" in
3408 rp='Where are the include files you want to use?'
3416 : see how we invoke the C preprocessor
3418 echo "Now, how can we feed standard input to your C preprocessor..." >&4
3419 cat <<'EOT' >testcpp.c
3425 if test ! -f cppstdin; then
3426 if test "X$osname" = "Xaix" -a "X$gccversion" = X; then
3427 # AIX cc -E doesn't show the absolute headerfile
3428 # locations but we'll cheat by using the -M flag.
3429 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
3431 echo 'cat >.$$.c; '"$cc"' -E ${1+"$@"} .$$.c; rm .$$.c' >cppstdin
3434 echo "Keeping your $hint cppstdin wrapper."
3437 wrapper=`pwd`/cppstdin
3441 if $test "X$cppstdin" != "X" && \
3442 $cppstdin $cppminus <testcpp.c >testcpp.out 2>&1 && \
3443 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
3445 echo "You used to use $cppstdin $cppminus so we'll use that again."
3447 '') echo "But let's see if we can live without a wrapper..." ;;
3449 if $cpprun $cpplast <testcpp.c >testcpp.out 2>&1 && \
3450 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
3452 echo "(And we'll use $cpprun $cpplast to preprocess directly.)"
3455 echo "(However, $cpprun $cpplast does not work, let's see...)"
3463 echo "Good old $cppstdin $cppminus does not seem to be of any help..."
3470 elif echo 'Maybe "'"$cc"' -E" will work...'; \
3471 $cc -E <testcpp.c >testcpp.out 2>&1; \
3472 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3473 echo "Yup, it does."
3476 elif echo 'Nope...maybe "'"$cc"' -E -" will work...'; \
3477 $cc -E - <testcpp.c >testcpp.out 2>&1; \
3478 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3479 echo "Yup, it does."
3482 elif echo 'Nope...maybe "'"$cc"' -P" will work...'; \
3483 $cc -P <testcpp.c >testcpp.out 2>&1; \
3484 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3485 echo "Yipee, that works!"
3488 elif echo 'Nope...maybe "'"$cc"' -P -" will work...'; \
3489 $cc -P - <testcpp.c >testcpp.out 2>&1; \
3490 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3491 echo "At long last!"
3494 elif echo 'No such luck, maybe "'$cpp'" will work...'; \
3495 $cpp <testcpp.c >testcpp.out 2>&1; \
3496 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3500 elif echo 'Nixed again...maybe "'$cpp' -" will work...'; \
3501 $cpp - <testcpp.c >testcpp.out 2>&1; \
3502 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3503 echo "Hooray, it works! I was beginning to wonder."
3506 elif echo 'Uh-uh. Time to get fancy. Trying a wrapper...'; \
3507 $wrapper <testcpp.c >testcpp.out 2>&1; \
3508 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3514 rp="No dice. I can't find a C preprocessor. Name one:"
3518 $x_cpp <testcpp.c >testcpp.out 2>&1
3519 if $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3520 echo "OK, that will do." >&4
3522 echo "Sorry, I can't get that to work. Go find one and rerun Configure." >&4
3537 echo "Perhaps can we force $cc -E using a wrapper..."
3538 if $wrapper <testcpp.c >testcpp.out 2>&1; \
3539 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
3545 echo "Nope, we'll have to live without it..."
3559 "$wrapper"|'cppstdin') ;;
3560 *) $rm -f $wrapper;;
3562 $rm -f testcpp.c testcpp.out
3564 : Set private lib path
3567 plibpth="$incpath/usr/lib /usr/local/lib /usr/ccs/lib"
3572 '') dlist="$loclibpth $plibpth $glibpth";;
3573 *) dlist="$libpth";;
3576 : Now check and see which directories actually exist, avoiding duplicates
3580 if $test -d $xxx; then
3583 *) libpth="$libpth $xxx";;
3589 Some systems have incompatible or broken versions of libraries. Among
3590 the directories listed in the question below, please remove any you
3591 know not to be holding relevant libraries, and add any that are needed.
3592 Say "none" for none.
3603 rp="Directories to use for library searches?"
3610 : compute shared library extension
3613 if xxx=`./loc libc.sl X $libpth`; $test -f "$xxx"; then
3623 On some systems, shared libraries may be available. Answer 'none' if
3624 you want to suppress searching of shared libraries for the remainder
3625 of this configuration.
3628 rp='What is the file extension used for shared libraries?'
3632 : Define several unixisms.
3633 : Hints files or command line option can be used to override them.
3634 : The convoluted testing is in case hints files set either the old
3637 '') case "$exe_ext" in
3639 *) _exe="$exe_ext" ;;
3644 '') case "$lib_ext" in
3651 '') case "$obj_ext" in
3658 '') case "$path_sep" in
3669 : Which makefile gets called first. This is used by make depend.
3670 case "$firstmakefile" in
3671 '') firstmakefile='makefile';;
3675 $define|true|[yY]*) dflt='y';;
3680 Perl can be built to use the SOCKS proxy protocol library. To do so,
3681 Configure must be run with -Dusesocks.
3683 If this doesn't make any sense to you, just accept the default '$dflt'.
3685 rp='Build Perl for SOCKS?'
3688 y|Y) val="$define" ;;
3694 : Looking for optional libraries
3696 echo "Checking for optional libraries..." >&4
3701 case "$libswanted" in
3702 '') libswanted='c_s';;
3706 libswanted="$libswanted socks5 socks5_sh"
3713 for thisdir in $libpth $xlibpth; do
3714 test -d $thisdir && libspath="$libspath $thisdir"
3716 for thislib in $libswanted; do
3717 for thisdir in $libspath; do
3719 if $test ! -f "$xxx" -a "X$ignore_versioned_solibs" = "X"; then
3720 xxx=`ls $thisdir/lib$thislib.$so.[0-9] 2>/dev/null|tail -1`
3721 $test -f "$xxx" && eval $libscheck
3722 $test -f "$xxx" && libstyle=shared
3724 if test ! -f "$xxx"; then
3725 xxx=$thisdir/lib$thislib.$so
3726 $test -f "$xxx" && eval $libscheck
3727 $test -f "$xxx" && libstyle=shared
3729 if test ! -f "$xxx"; then
3730 xxx=$thisdir/lib$thislib$_a
3731 $test -f "$xxx" && eval $libscheck
3732 $test -f "$xxx" && libstyle=static
3734 if test ! -f "$xxx"; then
3735 xxx=$thisdir/$thislib$_a
3736 $test -f "$xxx" && eval $libscheck
3737 $test -f "$xxx" && libstyle=static
3739 if test ! -f "$xxx"; then
3740 xxx=$thisdir/lib${thislib}_s$_a
3741 $test -f "$xxx" && eval $libscheck
3742 $test -f "$xxx" && libstyle=static
3744 if test ! -f "$xxx"; then
3745 xxx=$thisdir/Slib$thislib$_a
3746 $test -f "$xxx" && eval $libscheck
3747 $test -f "$xxx" && libstyle=static
3749 if $test -f "$xxx"; then
3751 shared) echo "Found -l$thislib (shared)." ;;
3752 static) echo "Found -l$thislib." ;;
3753 *) echo "Found -l$thislib ($libstyle)." ;;
3757 *) dflt="$dflt -l$thislib"
3758 libsfound="$libsfound $xxx"
3760 libsfiles="$libsfiles $yyy"
3761 yyy=`echo $xxx|$sed -e "s%/$yyy\\$%%"`
3762 case " $libsdirs " in
3764 *) libsdirs="$libsdirs $yyy" ;;
3771 if $test ! -f "$xxx"; then
3772 echo "No -l$thislib."
3783 ' '|'') dflt='none';;
3788 In order to compile $package on your machine, a number of libraries
3789 are usually needed. Include any other special libraries here as well.
3790 Say "none" for none. The default list is almost always right.
3794 rp="What libraries to use?"
3801 : determine optimization, if desired, or use for debug flag also
3803 ' '|$undef) dflt='none';;
3805 *) dflt="$optimize";;
3809 By default, $package compiles with the -O flag to use the optimizer.
3810 Alternately, you might want to use the symbolic debugger, which uses
3811 the -g flag (on traditional Unix systems). Either flag can be
3812 specified here. To use neither flag, specify the word "none".
3815 rp="What optimizer/debugger flag should be used?"
3819 'none') optimize=" ";;
3823 : We will not override a previous value, but we might want to
3824 : augment a hint file
3826 default|recommended)
3827 case "$gccversion" in
3828 1*) dflt='-fpcc-struct-return' ;;
3831 *-g*) dflt="$dflt -DDEBUGGING";;
3833 case "$gccversion" in
3834 2*) if test -d /etc/conf/kconfig.d &&
3835 $contains _POSIX_VERSION $usrinc/sys/unistd.h >/dev/null 2>&1
3841 case "$gccversion" in
3845 echo "Checking if your compiler accepts -fno-strict-aliasing" 2>&1
3846 echo 'int main(void) { return 0; }' > gcctest.c
3847 if $cc -O2 -fno-strict-aliasing -o gcctest gcctest.c; then
3848 echo "Yes, it does." 2>&1
3851 echo "Leaving current flags $ccflags alone." 2>&1
3853 *) dflt="$dflt -fno-strict-aliasing" ;;
3856 echo "Nope, it doesn't, but that's ok." 2>&1
3863 case "$mips_type" in
3864 *BSD*|'') inclwanted="$locincpth $usrinc";;
3865 *) inclwanted="$locincpth $inclwanted $usrinc/bsd";;
3867 for thisincl in $inclwanted; do
3868 if $test -d $thisincl; then
3869 if $test x$thisincl != x$usrinc; then
3872 *) dflt="$dflt -I$thisincl";;
3878 inctest='if $contains $2 $usrinc/$1 >/dev/null 2>&1; then
3880 elif $contains $2 $usrinc/sys/$1 >/dev/null 2>&1; then
3888 *) dflt="$dflt -D$2";;
3892 set signal.h LANGUAGE_C; eval $inctest
3896 ccflags="$ccflags -DSOCKS"
3901 default|recommended) dflt="$ccflags $dflt" ;;
3902 *) dflt="$ccflags";;
3910 Your C compiler may want other flags. For this question you should include
3911 -I/whatever and -DWHATEVER flags and any other flags used by the C compiler,
3912 but you should NOT include libraries or ld flags like -lwhatever. If you
3913 want $package to honor its debug switch, you should include -DDEBUGGING here.
3914 Your C compiler might also need additional flags, such as -D_POSIX_SOURCE.
3916 To use no flags, specify the word "none".
3922 rp="Any additional cc flags?"
3929 : the following weeds options from ccflags that are of no interest to cpp
3931 case "$gccversion" in
3932 1*) cppflags="$cppflags -D__GNUC__"
3934 case "$mips_type" in
3936 *BSD*) cppflags="$cppflags -DSYSTYPE_BSD43";;
3942 echo "Let me guess what the preprocessor flags are..." >&4
3956 *) ftry="$previous $flag";;
3958 if $cppstdin -DLFRULB=bar $cppflags $ftry $cppminus <cpp.c \
3959 >cpp1.out 2>/dev/null && \
3960 $cpprun -DLFRULB=bar $cppflags $ftry $cpplast <cpp.c \
3961 >cpp2.out 2>/dev/null && \
3962 $contains 'foo.*xx.*bar' cpp1.out >/dev/null 2>&1 && \
3963 $contains 'foo.*xx.*bar' cpp2.out >/dev/null 2>&1
3965 cppflags="$cppflags $ftry"
3975 *-*) echo "They appear to be: $cppflags";;
3977 $rm -f cpp.c cpp?.out
3981 : flags used in final linking phase
3983 '') if ./venix; then
3989 *-posix*) dflt="$dflt -posix" ;;
3992 *) dflt="$ldflags";;
3995 : Try to guess additional flags to pick up local libraries.
3996 for thislibdir in $libpth; do
3997 case " $loclibpth " in
4000 *"-L$thislibdir "*) ;;
4001 *) dflt="$dflt -L$thislibdir" ;;
4013 Your C linker may need flags. For this question you should
4014 include -L/whatever and any other flags used by the C linker, but you
4015 should NOT include libraries like -lwhatever.
4017 Make sure you include the appropriate -L/path flags if your C linker
4018 does not normally search all of the directories you specified above,
4021 To use no flags, specify the word "none".
4025 rp="Any additional ld flags (NOT including libraries)?"
4031 rmlist="$rmlist pdp11"
4035 echo "Checking your choice of C compiler and flags for coherency..." >&4
4036 $cat > try.c <<'EOF'
4038 int main() { printf("Ok\n"); exit(0); }
4040 set X $cc $optimize $ccflags -o try $ldflags try.c $libs
4042 $cat >try.msg <<'EOM'
4043 I've tried to compile and run the following simple program:
4046 $cat try.c >> try.msg
4048 $cat >> try.msg <<EOM
4055 and I got the following output:
4059 if sh -c "$cc $optimize $ccflags -o try $ldflags try.c $libs" >>try.msg 2>&1; then
4060 if sh -c './try' >>try.msg 2>&1; then
4064 *) echo 'The program compiled OK, but produced no output.' >> try.msg
4067 cat >> try.msg <<'EOQS'
4068 If $libs contains -lsfio, and sfio is mis-configured, then it
4069 sometimes (apparently) runs and exits with a 0 status, but with no
4070 output! It may have to do with sfio's use of _exit vs. exit.
4073 rp="You have a big problem. Shall I abort Configure"
4080 echo "The program compiled OK, but exited with status $?." >>try.msg
4081 rp="You have a problem. Shall I abort Configure"
4085 echo "I can't compile the test program." >>try.msg
4086 rp="You have a BIG problem. Shall I abort Configure"
4092 case "$knowitall" in
4094 echo "(The supplied flags or libraries might be incorrect.)"
4102 *) echo "Ok. Stopping Configure." >&4
4107 n) echo "OK, that should do.";;
4109 $rm -f try try.* core
4111 : define an is-a-typedef? function
4112 typedef='type=$1; var=$2; def=$3; shift; shift; shift; inclist=$@;
4114 "") inclist="sys/types.h";;
4116 eval "varval=\$$var";
4120 for inc in $inclist; do
4121 echo "#include <$inc>" >>temp.c;
4123 echo "#ifdef $type" >> temp.c;
4124 echo "printf(\"We have $type\");" >> temp.c;
4125 echo "#endif" >> temp.c;
4126 $cppstdin $cppflags $cppminus < temp.c >temp.E 2>/dev/null;
4127 if $contains $type temp.E >/dev/null 2>&1; then
4133 *) eval "$var=\$varval";;
4136 : define an is-a-typedef? function that prompts if the type is not available.
4137 typedef_ask='type=$1; var=$2; def=$3; shift; shift; shift; inclist=$@;
4139 "") inclist="sys/types.h";;
4141 eval "varval=\$$var";
4145 for inc in $inclist; do
4146 echo "#include <$inc>" >>temp.c;
4148 echo "#ifdef $type" >> temp.c;
4149 echo "printf(\"We have $type\");" >> temp.c;
4150 echo "#endif" >> temp.c;
4151 $cppstdin $cppflags $cppminus < temp.c >temp.E 2>/dev/null;
4153 echo "$rp" | $sed -e "s/What is/Looking for/" -e "s/?/./";
4154 if $contains $type temp.E >/dev/null 2>&1; then
4155 echo "$type found." >&4;
4158 echo "$type NOT found." >&4;
4164 *) eval "$var=\$varval";;
4167 : define a shorthand compile call
4171 $cc $optimize $ccflags $ldflags -o ${mc_file} $* ${mc_file}.c $libs > /dev/null 2>&1;'
4172 : define a shorthand compile call for compilations that should be ok.
4176 $cc $optimize $ccflags $ldflags -o ${mc_file} $* ${mc_file}.c $libs;'
4178 : check for lengths of integral types
4182 echo "Checking to see how big your integers are..." >&4
4183 $cat >intsize.c <<'EOCP'
4187 printf("intsize=%d;\n", (int)sizeof(int));
4188 printf("longsize=%d;\n", (int)sizeof(long));
4189 printf("shortsize=%d;\n", (int)sizeof(short));
4194 if eval $compile_ok && ./intsize > /dev/null; then
4196 echo "Your integers are $intsize bytes long."
4197 echo "Your long integers are $longsize bytes long."
4198 echo "Your short integers are $shortsize bytes long."
4202 Help! I can't compile and run the intsize test program: please enlighten me!
4203 (This is probably a misconfiguration in your system or libraries, and
4204 you really ought to fix it. Still, I'll try anyway.)
4208 rp="What is the size of an integer (in bytes)?"
4212 rp="What is the size of a long integer (in bytes)?"
4216 rp="What is the size of a short integer (in bytes)?"
4222 $rm -f intsize intsize.*
4224 : see what type lseek is declared as in the kernel
4225 rp="What is the type used for lseek's offset on this system?"
4226 set off_t lseektype long stdio.h sys/types.h
4230 echo "Checking to see how big your file offsets are..." >&4
4232 #include <sys/types.h>
4236 printf("%d\n", (int)sizeof($lseektype));
4241 if eval $compile_ok; then
4243 echo "Your file offsets are $lseeksize bytes long."
4247 echo "(I can't seem to compile the test program. Guessing...)"
4248 rp="What is the size of your file offsets (in bytes)?"
4254 : see what type file positions are declared as in the library
4255 rp="What is the type for file position used by fsetpos()?"
4256 set fpos_t fpostype long stdio.h sys/types.h
4261 *_t) zzz="$fpostype" ;;
4264 echo "Checking the size of $zzz..." >&4
4266 #include <sys/types.h>
4269 printf("%d\n", (int)sizeof($fpostype));
4274 if eval $compile_ok; then
4278 echo "(I can't execute the test program--guessing $fpossize.)" >&4
4281 echo "Your $zzz is $fpossize bytes long."
4287 echo "(I can't compile the test program. Guessing...)" >&4
4288 rp="What is the size of your file positions (in bytes)?"
4295 case "$lseeksize:$fpossize" in
4298 You can have files larger than 2 gigabytes.
4301 *) case "$uselargefiles" in
4302 "$undef"|false|[nN]*) dflt='n' ;;
4307 Perl can be built to understand large files (files larger than 2 gigabytes)
4308 on some systems. To do so, Configure can be run with -Duselargefiles.
4310 If this doesn't make any sense to you, just accept the default '$dflt'.
4312 rp='Try to understand large files, if available?'
4315 y|Y) val="$define" ;;
4322 case "$uselargefiles" in
4324 : Look for a hint-file generated 'call-back-unit'. If the
4325 : user has specified that a large files perl is to be built,
4326 : we may need to set or change some other defaults.
4327 if $test -f uselfs.cbu; then
4328 echo "Your platform has some specific hints for large file builds, using them..."
4331 echo "Rechecking to see how big your file offsets are..." >&4
4333 #include <sys/types.h>
4337 printf("%d\n", (int)sizeof($lseektype));
4342 if eval $compile_ok; then
4344 $echo "Your file offsets are now $lseeksize bytes long."
4348 echo "(I can't seem to compile the test program. Guessing...)"
4349 rp="What is the size of your file offsets (in bytes)?"
4354 *_t) zzz="$fpostype" ;;
4357 $echo $n "Rechecking the size of $zzz...$c" >&4
4359 #include <sys/types.h>
4362 printf("%d\n", (int)sizeof($fpostype));
4367 if eval $compile_ok; then
4372 echo "(I can't execute the test program--guessing $fpossize.)" >&4
4375 echo " $fpossize bytes." >&4
4381 echo "(I can't compile the test program. Guessing...)" >&4
4382 rp="What is the size of your file positions (in bytes)?"
4392 case "$usemorebits" in
4393 "$define"|true|[yY]*)
4395 uselongdouble="$define"
4396 usemorebits="$define"
4398 *) usemorebits="$undef"
4403 # Backward compatibility (uselonglong is deprecated).
4404 case "$uselonglong" in
4405 "$define"|true|[yY]*)
4408 *** Configure -Duselonglong is deprecated, using the -Duse64bits instead.
4415 *-DUSE_LONG_LONG*|*-DUSE_64_BITS*|*-DUSE_FULL_64_BITS*) use64bits="$define";;
4417 case "$usefull64bits" in
4418 "$define"|true|[yY]*) use64bits="$define" ;;
4424 You have natively 64-bit long integers.
4428 *) case "$use64bits" in
4429 "$define"|true|[yY]*) dflt='y';;
4434 Perl can be built to take advantage of 64-bit integer types
4435 on some systems. To do so, Configure can be run with -Duse64bits.
4436 Choosing this option will most probably introduce binary incompatibilities.
4438 If this doesn't make any sense to you, just accept the default '$dflt'.
4440 rp='Try to use 64-bit integers, if available?'
4443 [yY]*) val="$define" ;;
4451 case "$usefull64bits" in
4452 "$define"|true|[yY]*) val="$define" ;;
4453 *) case "$use64bits" in
4454 "$define") case "$longsize" in
4458 Since you chose 64-bitness you may want to try maximal 64-bitness.
4459 What you have chosen is minimal 64-bitness which means just enough
4460 to get 64-bit integers. The maximal means using as much 64-bitness
4461 as is possible on the platform. This in turn means even more binary
4462 incompatibilities. On the other hand, your platform may not have
4463 any more maximal 64-bitness than what you already have chosen.
4465 If this doesn't make any sense to you, just accept the default '$dflt'.
4467 rp='Try to use full 64-bit support, if available?'
4470 [yY]*) val="$define" ;;
4485 case "$use64bits" in
4486 "$define"|true|[yY]*)
4487 : Look for a hint-file generated 'call-back-unit'. If the
4488 : user has specified that a 64-bit perl is to be built,
4489 : we may need to set or change some other defaults.
4490 if $test -f use64bits.cbu; then
4491 echo "Your platform has some specific hints for 64-bit builds, using them..."
4495 4) case "$ccflags" in
4497 *) ccflags="$ccflags -DUSE_64_BITS";;
4499 case "$archname64" in
4500 '') archname64=64 ;;
4507 case "$usefull64bits" in
4508 "$define"|true|[yY]*)
4509 : Look for a hint-file generated 'call-back-unit'. If the
4510 : user has specified that a full 64-bit perl is to be built,
4511 : we may need to set or change some other defaults.
4512 if $test -f usefull64bits.cbu; then
4513 echo "Your platform has some specific hints for full 64-bit builds, using them..."
4514 . ./usefull64bits.cbu
4517 4) case "$ccflags" in
4518 *-DUSE_FULL_64_BITS*) ;;
4519 *) ccflags="$ccflags -DUSE_FULL_64_BITS";;
4521 case "$archname64" in
4522 ''|64) archname64=full64 ;;
4529 : determine the architecture name
4531 if xxx=`./loc arch blurfl $pth`; $test -f "$xxx"; then
4532 tarch=`arch`"-$osname"
4533 elif xxx=`./loc uname blurfl $pth`; $test -f "$xxx" ; then
4534 if uname -m > tmparch 2>&1 ; then
4535 tarch=`$sed -e 's/ *$//' -e 's/ /_/g' \
4536 -e 's/$/'"-$osname/" tmparch`
4544 case "$myarchname" in
4547 echo "(Your architecture name used to be $myarchname.)"
4554 *) dflt="$archname";;
4556 rp='What is your architecture name'
4559 case "$usethreads" in
4561 echo "Threads selected." >&4
4563 *-thread*) echo "...and architecture name already has -thread." >&4
4565 *) archname="$archname-thread"
4566 echo "...setting architecture name to $archname." >&4
4571 case "$usemultiplicity" in
4573 echo "Multiplicity selected." >&4
4575 *-multi*) echo "...and architecture name already has -multi." >&4
4577 *) archname="$archname-multi"
4578 echo "...setting architecture name to $archname." >&4
4583 case "$use64bits" in
4585 case "$archname64" in
4590 *-$archname64*) echo "...and architecture name already has $archname64." >&4
4592 *) archname="$archname-$archname64"
4593 echo "...setting architecture name to $archname." >&4
4600 : determine root of directory hierarchy where package will be installed.
4603 dflt=`./loc . /usr/local /usr/local /local /opt /usr`
4611 By default, $package will be installed in $dflt/bin, manual pages
4612 under $dflt/man, etc..., i.e. with $dflt as prefix for all
4613 installation directories. Typically this is something like /usr/local.
4614 If you wish to have binaries under /usr/bin but other parts of the
4615 installation under /usr/local, that's ok: you will be prompted
4616 separately for each of the installation directories, the prefix being
4617 only used to set the defaults.
4621 rp='Installation prefix to use?'
4629 *) oldprefix="$prefix";;
4639 $define|true) afs=true ;;
4640 $undef|false) afs=false ;;
4641 *) if test -d /afs; then
4649 echo "AFS may be running... I'll be extra cautious then..." >&4
4651 echo "AFS does not seem to be running..." >&4
4654 : determine installation prefix for where package is to be installed.
4658 Since you are running AFS, I need to distinguish the directory in which
4659 files will reside from the directory in which they are installed (and from
4660 which they are presumably copied to the former directory by occult means).
4663 case "$installprefix" in
4664 '') dflt=`echo $prefix | sed 's#^/afs/#/afs/.#'`;;
4665 *) dflt="$installprefix";;
4670 In some special cases, particularly when building $package for distribution,
4671 it is convenient to distinguish between the directory in which files should
4672 be installed from the directory ($prefix) in which they
4673 will eventually reside. For most users, these two directories are the same.
4676 case "$installprefix" in
4678 *) dflt=$installprefix;;
4682 rp='What installation prefix should I use for installing files?'
4684 installprefix="$ans"
4685 installprefixexp="$ansexp"
4687 : set the prefixit variable, to compute a suitable default value
4688 prefixit='case "$3" in
4690 case "$oldprefix" in
4691 "") eval "$1=\"\$$2\"";;
4698 ""|" ") eval "$1=\"\$$2\"";;
4704 eval "tp=\"$oldprefix-\$$2-\""; eval "tp=\"$tp\"";
4706 --|/*--|\~*--) eval "$1=\"$prefix/$3\"";;
4707 /*-$oldprefix/*|\~*-$oldprefix/*)
4708 eval "$1=\`echo \$$2 | sed \"s,^$oldprefix,$prefix,\"\`";;
4709 *) eval "$1=\"\$$2\"";;
4714 : get the patchlevel
4716 echo "Getting the current patchlevel..." >&4
4717 if $test -r $rsrc/patchlevel.h;then
4718 revision=`awk '/define[ ]+PERL_REVISION/ {print $3}' $rsrc/patchlevel.h`
4719 patchlevel=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
4720 subversion=`awk '/define[ ]+PERL_SUBVERSION/ {print $3}' $rsrc/patchlevel.h`
4721 api_revision=`awk '/define[ ]+PERL_API_REVISION/ {print $3}' $rsrc/patchlevel.h`
4722 api_version=`awk '/define[ ]+PERL_API_VERSION/ {print $3}' $rsrc/patchlevel.h`
4723 api_subversion=`awk '/define[ ]+PERL_API_SUBVERSION/ {print $3}' $rsrc/patchlevel.h`
4732 $echo $n "(You have $package revision $revision" $c
4733 $echo $n " patchlevel $patchlevel" $c
4734 test 0 -eq "$subversion" || $echo $n " subversion $subversion" $c
4738 : XXX Should be a Configure test for double-dots in filenames.
4739 version=`echo $revision $patchlevel $subversion | \
4740 $awk '{ printf "%d_%d_%d\n", $1, $2, $3 }'`
4741 api_versionstring=`echo $api_revision $api_version $api_subversion | \
4742 $awk '{ printf "%d_%d_%d\n", $1, $2, $3 }'`
4745 version=`echo $revision $patchlevel $subversion | \
4746 $awk '{ printf "%d.%d.%d\n", $1, $2, $3 }'`
4747 api_versionstring=`echo $api_revision $api_version $api_subversion | \
4748 $awk '{ printf "%d.%d.%d\n", $1, $2, $3 }'`
4751 : Special case the 5.005_xx maintenance series, which used 5.005
4752 : without any subversion label as a subdirectory in $sitelib
4753 if test "${api_revision}${api_version}${api_subversion}" = "550"; then
4754 api_versionstring='5.005'
4757 : determine installation style
4758 : For now, try to deduce it from prefix unless it is already set.
4759 : Reproduce behavior of 5.005 and earlier, maybe drop that in 5.7.
4760 case "$installstyle" in
4761 '') case "$prefix" in
4762 *perl*) dflt='lib';;
4763 *) dflt='lib/perl5' ;;
4766 *) dflt='lib/perl5' ;;
4768 : Probably not worth prompting for this since we prompt for all
4769 : the directories individually, and the prompt would be too long and
4773 : determine where private library files go
4774 : Usual default is /usr/local/lib/perl5/$version.
4775 : Also allow things like /opt/perl/lib/$version, since
4776 : /opt/perl/lib/perl5... would be redundant.
4777 : The default "style" setting is made in installstyle.U
4778 case "$installstyle" in
4779 *lib/perl5*) set dflt privlib lib/$package/$version ;;
4780 *) set dflt privlib lib/$version ;;
4785 There are some auxiliary files for $package that need to be put into a
4786 private library directory that is accessible by everyone.
4790 rp='Pathname where the private library files will reside?'
4793 privlibexp="$ansexp"
4794 : Change installation prefix, if necessary.
4795 if $test X"$prefix" != X"$installprefix"; then
4796 installprivlib=`echo $privlibexp | sed "s#^$prefix#$installprefix#"`
4798 installprivlib="$privlibexp"
4801 : set the prefixup variable, to restore leading tilda escape
4802 prefixup='case "$prefixexp" in
4804 *) eval "$1=\`echo \$$1 | sed \"s,^$prefixexp,$prefix,\"\`";;
4807 : determine where public architecture dependent libraries go
4810 : privlib default is /usr/local/lib/$package/$version
4811 : archlib default is /usr/local/lib/$package/$version/$archname
4812 : privlib may have an optional trailing /share.
4813 tdflt=`echo $privlib | $sed 's,/share$,,'`
4814 tdflt=$tdflt/$archname
4823 $spackage contains architecture-dependent library files. If you are
4824 sharing libraries in a heterogeneous environment, you might store
4825 these files in a separate location. Otherwise, you can just include
4826 them with the rest of the public library files.
4830 rp='Where do you want to put the public architecture-dependent libraries?'
4833 archlibexp="$ansexp"
4834 if $test X"$archlib" = X"$privlib"; then
4839 : Change installation prefix, if necessary.
4840 if $test X"$prefix" != X"$installprefix"; then
4841 installarchlib=`echo $archlibexp | sed "s#^$prefix#$installprefix#"`
4843 installarchlib="$archlibexp"
4847 : Binary compatibility with 5.005 is not possible for builds
4848 : with advanced features
4849 case "$usethreads$usemultiplicity" in
4851 bincompat5005="$undef"
4852 d_bincompat5005="$undef"
4856 Perl 5.006 can be compiled for binary compatibility with 5.005.
4857 If you decide to do so, you will be able to continue using most
4858 of the extensions that were compiled for Perl 5.005.
4861 case "$bincompat5005$d_bincompat5005" in
4862 *"$undef"*) dflt=n ;;
4865 rp='Binary compatibility with Perl 5.005?'
4868 y*) val="$define" ;;
4873 case "$d_bincompat5005" in
4875 bincompat5005="$define"
4877 *) bincompat5005="$undef"
4878 d_bincompat5005="$undef"
4885 : see if setuid scripts can be secure
4888 Some kernels have a bug that prevents setuid #! scripts from being
4889 secure. Some sites have disabled setuid #! scripts because of this.
4891 First let's decide if your kernel supports secure setuid #! scripts.
4892 (If setuid #! scripts would be secure but have been disabled anyway,
4893 don't say that they are secure if asked.)
4898 if $test -d /dev/fd; then
4899 echo "#!$ls" >reflect
4900 chmod +x,u+s reflect
4901 ./reflect >flect 2>&1
4902 if $contains "/dev/fd" flect >/dev/null; then
4903 echo "Congratulations, your kernel has secure setuid scripts!" >&4
4907 If you are not sure if they are secure, I can check but I'll need a
4908 username and password different from the one you are using right now.
4909 If you don't have such a username or don't want me to test, simply
4913 rp='Other username to test security of setuid scripts with?'
4918 case "$d_suidsafe" in
4919 '') echo "I'll assume setuid scripts are *not* secure." >&4
4922 echo "Well, the $hint value is *not* secure." >&4
4924 *) echo "Well, the $hint value *is* secure." >&4
4929 $rm -f reflect flect
4930 echo "#!$ls" >reflect
4931 chmod +x,u+s reflect
4934 echo '"su" will (probably) prompt you for '"$ans's password."
4935 su $ans -c './reflect >flect'
4936 if $contains "/dev/fd" flect >/dev/null; then
4937 echo "Okay, it looks like setuid scripts are secure." >&4
4940 echo "I don't think setuid scripts are secure." >&4
4945 rp='Does your kernel have *secure* setuid scripts?'
4948 [yY]*) val="$define";;
4953 echo "I don't think setuid scripts are secure (no /dev/fd directory)." >&4
4954 echo "(That's for file descriptors, not floppy disks.)"
4960 $rm -f reflect flect
4962 : now see if they want to do setuid emulation
4965 case "$d_suidsafe" in
4968 echo "No need to emulate SUID scripts since they are secure here." >& 4
4972 Some systems have disabled setuid scripts, especially systems where
4973 setuid scripts cannot be secure. On systems where setuid scripts have
4974 been disabled, the setuid/setgid bits on scripts are currently
4975 useless. It is possible for $package to detect those bits and emulate
4976 setuid/setgid in a secure fashion. This emulation will only work if
4977 setuid scripts have been disabled in your kernel.
4981 "$define") dflt=y ;;
4984 rp="Do you want to do setuid/setgid emulation?"
4987 [yY]*) val="$define";;
4995 : determine filename position in cpp output
4997 echo "Computing filename position in cpp output for #include directives..." >&4
4998 echo '#include <stdio.h>' > foo.c
5001 $cppstdin $cppflags $cppminus <foo.c 2>/dev/null | \
5002 $grep '^[ ]*#.*stdio\.h' | \
5003 while read cline; do
5006 while $test \$# -gt 0; do
5007 if $test -r \`echo \$1 | $tr -d '"'\`; then
5012 pos=\`expr \$pos + 1\`
5024 *) pos="${fieldn}th";;
5026 echo "Your cpp writes the filename in the $pos field of the line."
5028 : locate header file
5033 for usrincdir in $usrinc
5035 if test -f \$usrincdir/\$wanted; then
5036 echo "\$usrincdir/\$wanted"
5040 awkprg='{ print \$$fieldn }'
5041 echo "#include <\$wanted>" > foo\$\$.c
5042 $cppstdin $cppminus $cppflags < foo\$\$.c 2>/dev/null | \
5043 $grep "^[ ]*#.*\$wanted" | \
5044 while read cline; do
5045 name=\`echo \$cline | $awk "\$awkprg" | $tr -d '"'\`
5047 *[/\\\\]\$wanted) echo "\$name"; exit 1;;
5048 *[\\\\/]\$wanted) echo "\$name"; exit 1;;
5053 # status = 0: grep returned 0 lines, case statement not executed
5054 # status = 1: headerfile found
5055 # status = 2: while loop executed, no headerfile found
5059 if test \$status -eq 1; then
5066 : define an alternate in-header-list? function
5067 inhdr='echo " "; td=$define; tu=$undef; yyy=$@;
5068 cont=true; xxf="echo \"<\$1> found.\" >&4";
5069 case $# in 2) xxnf="echo \"<\$1> NOT found.\" >&4";;
5070 *) xxnf="echo \"<\$1> NOT found, ...\" >&4";;
5072 case $# in 4) instead=instead;; *) instead="at last";; esac;
5073 while $test "$cont"; do
5075 var=$2; eval "was=\$$2";
5076 if $test "$xxx" && $test -r "$xxx";
5078 eval "case \"\$$var\" in $undef) . ./whoa; esac"; eval "$var=\$td";
5081 eval "case \"\$$var\" in $define) . ./whoa; esac"; eval "$var=\$tu"; fi;
5082 set $yyy; shift; shift; yyy=$@;
5083 case $# in 0) cont="";;
5084 2) xxf="echo \"but I found <\$1> $instead.\" >&4";
5085 xxnf="echo \"and I did not find <\$1> either.\" >&4";;
5086 *) xxf="echo \"but I found <\$1\> instead.\" >&4";
5087 xxnf="echo \"there is no <\$1>, ...\" >&4";;
5091 do set $yyy; var=$2; eval "was=\$$2";
5092 eval "case \"\$$var\" in $define) . ./whoa; esac"; eval "$var=\$tu";
5093 set $yyy; shift; shift; yyy=$@;
5096 : see if this is a malloc.h system
5097 set malloc.h i_malloc
5100 : see if stdlib is available
5101 set stdlib.h i_stdlib
5104 : determine which malloc to compile in
5106 case "$usemymalloc" in
5107 ''|[yY]*|true|$define) dflt='y' ;;
5110 rp="Do you wish to attempt to use the malloc that comes with $package?"
5116 mallocsrc='malloc.c'
5117 mallocobj="malloc$_o"
5118 d_mymalloc="$define"
5121 : Remove malloc from list of libraries to use
5122 echo "Removing unneeded -lmalloc from library list" >&4
5123 set `echo X $libs | $sed -e 's/-lmalloc / /' -e 's/-lmalloc$//'`
5126 echo "libs = $libs" >&4
5138 : compute the return types of malloc and free
5140 $cat >malloc.c <<END
5144 #include <sys/types.h>
5158 case "$malloctype" in
5160 if $cc $ccflags -c -DTRY_MALLOC malloc.c >/dev/null 2>&1; then
5167 echo "Your system wants malloc to return '$malloctype', it would seem." >&4
5171 if $cc $ccflags -c -DTRY_FREE malloc.c >/dev/null 2>&1; then
5178 echo "Your system uses $freetype free(), it would seem." >&4
5182 The installation process will also create a directory for
5183 vendor-supplied add-ons. Vendors who supply perl with their system
5184 may find it convenient to place all vendor-supplied files in this
5185 directory rather than in the main distribution directory. This will
5186 ease upgrades between binary-compatible maintenance versions of perl.
5188 Of course you may also use these directories in whatever way you see
5189 fit. For example, you might use them to access modules shared over a
5190 company-wide network.
5192 The default answer should be fine for most people.
5193 This causes further questions about vendor add-ons to be skipped
5194 and no vendor-specific directories will be configured for perl.
5197 rp='Do you want to configure vendor-specific add-on directories?'
5198 case "$usevendorprefix" in
5199 define|true|[yY]*) dflt=y ;;
5200 *) : User may have set vendorprefix directly on Configure command line.
5201 case "$vendorprefix" in
5210 rp='Installation prefix to use for vendor-supplied add-ons?'
5211 case "$vendorprefix" in
5213 *) dflt=$vendorprefix ;;
5216 : XXX Prefixit unit does not yet support siteprefix and vendorprefix
5218 case "$vendorprefix" in
5222 *) oldvendorprefix="$prefix";;
5226 usevendorprefix="$define"
5228 vendorprefixexp="$ansexp"
5230 *) usevendorprefix="$undef"
5236 case "$vendorprefix" in
5237 '') d_vendorlib="$undef"
5241 *) d_vendorlib="$define"
5242 : determine where vendor-supplied modules go.
5243 : Usual default is /usr/local/lib/perl5/vendor_perl/$version
5244 case "$vendorlib" in
5246 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
5247 case "$installstyle" in
5248 *lib/perl5*) dflt=$vendorprefix/lib/$package/vendor_$prog/$version ;;
5249 *) dflt=$vendorprefix/lib/vendor_$prog/$version ;;
5252 *) dflt="$vendorlib"
5256 rp='Pathname for the vendor-supplied library files?'
5259 vendorlibexp="$ansexp"
5262 : Change installation prefix, if necessary.
5263 if $test X"$prefix" != X"$installprefix"; then
5264 installvendorlib=`echo $vendorlibexp | $sed "s#^$prefix#$installprefix#"`
5266 installvendorlib="$vendorlibexp"
5269 : Cruising for prototypes
5271 echo "Checking out function prototypes..." >&4
5272 $cat >prototype.c <<'EOCP'
5273 int main(int argc, char *argv[]) {
5276 if $cc $ccflags -c prototype.c >prototype.out 2>&1 ; then
5277 echo "Your C compiler appears to support function prototypes."
5280 echo "Your C compiler doesn't seem to understand function prototypes."
5287 case "$prototype" in
5289 *) ansi2knr='ansi2knr'
5294 This version of $package can only be compiled by a compiler that
5295 understands function prototypes. Unfortunately, your C compiler
5297 doesn't seem to understand them. Sorry about that.
5299 If GNU cc is available for your system, perhaps you could try that instead.
5301 Eventually, we hope to support building Perl with pre-ANSI compilers.
5302 If you would like to help in that effort, please contact <perlbug@perl.org>.
5304 Aborting Configure now.
5310 : determine where public executables go
5315 rp='Pathname where the public executables will reside?'
5317 if $test "X$ansexp" != "X$binexp"; then
5322 : Change installation prefix, if necessary.
5323 : XXX Bug? -- ignores Configure -Dinstallprefix setting.
5324 if $test X"$prefix" != X"$installprefix"; then
5325 installbin=`echo $binexp | sed "s#^$prefix#$installprefix#"`
5327 installbin="$binexp"
5330 : Find perl5.005 or later.
5331 echo "Looking for a previously installed perl5.005 or later... "
5333 '') for tdir in `echo "$binexp:$PATH" | $sed "s/$path_sep/ /g"`; do
5334 : Check if this perl is recent and can load a simple module
5335 if $test -x $tdir/perl && $tdir/perl -Mless -e 'use 5.005;' >/dev/null 2>&1; then
5338 elif $test -x $tdir/perl5 && $tdir/perl5 -Mless -e 'use 5.005;' >/dev/null 2>&1; then
5348 '') echo "None found. That's ok.";;
5349 *) echo "Using $perl5." ;;
5354 After $package is installed, you may wish to install various
5355 add-on modules and utilities. Typically, these add-ons will
5356 be installed under $prefix with the rest
5357 of this package. However, you may wish to install such add-ons
5358 elsewhere under a different prefix.
5360 If you do not wish to put everything under a single prefix, that's
5361 ok. You will be prompted for the individual locations; this siteprefix
5362 is only used to suggest the defaults.
5364 The default should be fine for most people.
5368 rp='Installation prefix to use for add-on modules and utilities?'
5369 : XXX Here might be another good place for an installstyle setting.
5370 case "$siteprefix" in
5372 *) dflt=$siteprefix ;;
5375 : XXX Prefixit unit does not yet support siteprefix and vendorprefix
5377 case "$siteprefix" in
5381 *) oldsiteprefix="$prefix";;
5386 siteprefixexp="$ansexp"
5388 : determine where site specific libraries go.
5389 : Usual default is /usr/local/lib/perl5/site_perl/$version
5390 : The default "style" setting is made in installstyle.U
5391 : XXX No longer works with Prefixit stuff.
5392 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
5394 '') case "$installstyle" in
5395 *lib/perl5*) dflt=$siteprefix/lib/$package/site_$prog/$version ;;
5396 *) dflt=$siteprefix/lib/site_$prog/$version ;;
5404 The installation process will create a directory for
5405 site-specific extensions and modules. Most users find it convenient
5406 to place all site-specific files in this directory rather than in the
5407 main distribution directory.
5411 rp='Pathname for the site-specific library files?'
5414 sitelibexp="$ansexp"
5415 : Change installation prefix, if necessary.
5416 if $test X"$prefix" != X"$installprefix"; then
5417 installsitelib=`echo $sitelibexp | $sed "s#^$prefix#$installprefix#"`
5419 installsitelib="$sitelibexp"
5422 : Determine list of previous versions to include in @INC
5423 $cat > getverlist <<EOPL
5426 \$api_versionstring = "$api_versionstring";
5427 \$version = "$version";
5428 \$sitelib = "$sitelib";
5429 \$archname = "$archname";
5431 $cat >> getverlist <<'EOPL'
5432 # Can't have leading @ because metaconfig interprets it as a command!
5433 ;@inc_version_list=();
5434 $stem=dirname($sitelib);
5435 # XXX Redo to do opendir/readdir?
5438 ;@candidates = glob("5.*");
5444 # XXX ToDo: These comparisons must be reworked when two-digit
5445 # subversions come along, so that 5.7.10 compares as greater than
5446 # 5.7.3! By that time, hope that 5.6.x is sufficiently
5447 # widespread that we can use the built-in version vectors rather
5448 # than reinventing them here. For 5.6.0, however, we must
5449 # assume this script will likely be run by 5.005_0x. --AD 1/2000.
5450 foreach $d (@candidates) {
5451 if ($d lt $version) {
5452 if ($d ge $api_versionstring) {
5453 unshift(@inc_version_list, "$d/$archname", $d);
5455 elsif ($d ge "5.005") {
5456 unshift(@inc_version_list, $d);
5460 # Skip newer version. I.e. don't look in
5461 # 5.7.0 if we're installing 5.6.1.
5465 if (@inc_version_list) {
5466 print join(' ', @inc_version_list);
5469 # Blank space to preserve value for next Configure run.
5474 case "$inc_version_list" in
5475 '') if test -x "$perl5"; then
5476 dflt=`$perl5 getverlist`
5481 $undef) dflt='none' ;;
5482 *) dflt="$inc_version_list" ;;
5485 ''|' ') dflt=none ;;
5489 In order to ease the process of upgrading, this version of perl
5490 can be configured to use modules built and installed with earlier
5491 versions of perl that were installed under $prefix. Specify here
5492 the list of earlier versions that this version of perl should check.
5493 If Configure detected no earlier versions of perl installed under
5494 $prefix, then the list will be empty. Answer 'none' to tell perl
5495 to not search earlier versions.
5497 The default should almost always be sensible, so if you're not sure,
5498 just accept the default.
5501 rp='List of earlier versions to include in @INC?'
5504 [Nn]one|''|' ') inc_version_list=' ' ;;
5505 *) inc_version_list="$ans" ;;
5507 case "$inc_version_list" in
5509 inc_version_list_init='0';;
5510 *) inc_version_list_init=`echo $inc_version_list |
5511 $sed -e 's/^/"/' -e 's/ /","/g' -e 's/$/",0/'`
5516 : determine whether to install perl also as /usr/bin/perl
5519 if $test -d /usr/bin -a "X$installbin" != X/usr/bin; then
5521 Many scripts expect to perl to be installed as /usr/bin/perl.
5522 I can install the perl you are about to compile also as /usr/bin/perl
5523 (in addition to $installbin/perl).
5525 case "$installusrbinperl" in
5526 "$undef"|[nN]*) dflt='n';;
5529 rp="Do you want to install perl as /usr/bin/perl?"
5532 [yY]*) val="$define";;
5538 set installusrbinperl
5542 echo "Checking for GNU C Library..." >&4
5543 cat >gnulibc.c <<EOM
5555 if eval $compile_ok && ./gnulibc; then
5557 echo "You are using the GNU C Library"
5560 echo "You are not using the GNU C Library"
5566 : see if nm is to be used to determine whether a symbol is defined or not
5570 case "$d_gnulibc" in
5573 echo "nm probably won't work on the GNU C Library." >&4
5579 if $test "$osname" = aix -a ! -f /lib/syscalls.exp; then
5581 echo "Whoops! This is an AIX system without /lib/syscalls.exp!" >&4
5582 echo "'nm' won't be sufficient on this sytem." >&4
5588 '') dflt=`$egrep 'inlibc|csym' $rsrc/Configure | wc -l 2>/dev/null`
5589 if $test $dflt -gt 20; then
5599 true|$define) dflt=y;;
5606 I can use $nm to extract the symbols from your C libraries. This
5607 is a time consuming task which may generate huge output on the disk (up
5608 to 3 megabytes) but that should make the symbols extraction faster. The
5609 alternative is to skip the 'nm' extraction part and to compile a small
5610 test program instead to determine whether each symbol is present. If
5611 you have a fast C compiler and/or if your 'nm' output cannot be parsed,
5612 this may be the best solution.
5614 You probably shouldn't let me use 'nm' if you are using the GNU C Library.
5617 rp="Shall I use $nm to extract C symbols from the libraries?"
5620 [Nn]*) usenm=false;;
5629 : nm options which may be necessary
5631 '') if $test -f /mach_boot; then
5633 elif $test -d /usr/ccs/lib; then
5634 nm_opt='-p' # Solaris (and SunOS?)
5635 elif $test -f /dgux; then
5637 elif $test -f /lib64/rld; then
5638 nm_opt='-p' # 64-bit Irix
5644 : nm options which may be necessary for shared libraries but illegal
5645 : for archive libraries. Thank you, Linux.
5646 case "$nm_so_opt" in
5647 '') case "$myuname" in
5649 if $nm --help | $grep 'dynamic' > /dev/null 2>&1; then
5650 nm_so_opt='--dynamic'
5659 : get list of predefined functions in a handy place
5664 *-lc_s*) libc=`./loc libc_s$_a $libc $libpth`
5671 *) for thislib in $libs; do
5674 : Handle C library specially below.
5677 thislib=`echo $thislib | $sed -e 's/^-l//'`
5678 if try=`./loc lib$thislib.$so.'*' X $libpth`; $test -f "$try"; then
5680 elif try=`./loc lib$thislib.$so X $libpth`; $test -f "$try"; then
5682 elif try=`./loc lib$thislib$_a X $libpth`; $test -f "$try"; then
5684 elif try=`./loc $thislib$_a X $libpth`; $test -f "$try"; then
5686 elif try=`./loc lib$thislib X $libpth`; $test -f "$try"; then
5688 elif try=`./loc $thislib X $libpth`; $test -f "$try"; then
5690 elif try=`./loc Slib$thislib$_a X $xlibpth`; $test -f "$try"; then
5695 libnames="$libnames $try"
5697 *) libnames="$libnames $thislib" ;;
5706 for xxx in $libpth; do
5707 $test -r $1 || set $xxx/libc.$so
5708 : The messy sed command sorts on library version numbers.
5710 set `echo blurfl; echo $xxx/libc.$so.[0-9]* | \
5711 tr ' ' $trnl | egrep -v '\.[A-Za-z]*$' | $sed -e '
5713 s/[0-9][0-9]*/0000&/g
5714 s/0*\([0-9][0-9][0-9][0-9][0-9]\)/\1/g
5717 sort | $sed -e 's/^.* //'`
5720 $test -r $1 || set /usr/ccs/lib/libc.$so
5721 $test -r $1 || set /lib/libsys_s$_a
5727 if $test -r "$1"; then
5728 echo "Your (shared) C library seems to be in $1."
5730 elif $test -r /lib/libc && $test -r /lib/clib; then
5731 echo "Your C library seems to be in both /lib/clib and /lib/libc."
5733 libc='/lib/clib /lib/libc'
5734 if $test -r /lib/syslib; then
5735 echo "(Your math library is in /lib/syslib.)"
5736 libc="$libc /lib/syslib"
5738 elif $test -r "$libc" || (test -h "$libc") >/dev/null 2>&1; then
5739 echo "Your C library seems to be in $libc, as you said before."
5740 elif $test -r $incpath/usr/lib/libc$_a; then
5741 libc=$incpath/usr/lib/libc$_a;
5742 echo "Your C library seems to be in $libc. That's fine."
5743 elif $test -r /lib/libc$_a; then
5745 echo "Your C library seems to be in $libc. You're normal."
5747 if tans=`./loc libc$_a blurfl/dyick $libpth`; $test -r "$tans"; then
5749 elif tans=`./loc libc blurfl/dyick $libpth`; $test -r "$tans"; then
5750 libnames="$libnames "`./loc clib blurfl/dyick $libpth`
5751 elif tans=`./loc clib blurfl/dyick $libpth`; $test -r "$tans"; then
5753 elif tans=`./loc Slibc$_a blurfl/dyick $xlibpth`; $test -r "$tans"; then
5755 elif tans=`./loc Mlibc$_a blurfl/dyick $xlibpth`; $test -r "$tans"; then
5758 tans=`./loc Llibc$_a blurfl/dyick $xlibpth`
5760 if $test -r "$tans"; then
5761 echo "Your C library seems to be in $tans, of all places."
5767 if $test $xxx = apollo -o -r "$libc" || (test -h "$libc") >/dev/null 2>&1; then
5771 If the guess above is wrong (which it might be if you're using a strange
5772 compiler, or your machine supports multiple models), you can override it here.
5777 echo $libpth | tr ' ' $trnl | sort | uniq > libpath
5779 I can't seem to find your C library. I've looked in the following places:
5782 $sed 's/^/ /' libpath
5785 None of these seems to contain your C library. I need to get its name...
5790 rp='Where is your C library?'
5795 echo $libc $libnames | tr ' ' $trnl | sort | uniq > libnames
5796 set X `cat libnames`
5799 case $# in 1) xxx=file; esac
5800 echo "Extracting names from the following $xxx for later perusal:" >&4
5802 $sed 's/^/ /' libnames >&4
5804 $echo $n "This may take a while...$c" >&4
5808 *$so*) $nm $nm_so_opt $nm_opt $file 2>/dev/null;;
5809 *) $nm $nm_opt $file 2>/dev/null;;
5814 $grep fprintf libc.tmp > libc.ptf
5815 xscan='eval "<libc.ptf $com >libc.list"; $echo $n ".$c" >&4'
5816 xrun='eval "<libc.tmp $com >libc.list"; echo "done" >&4'
5818 if com="$sed -n -e 's/__IO//' -e 's/^.* $xxx *_[_.]*//p' -e 's/^.* $xxx *//p'";\
5820 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5822 elif com="$sed -n -e 's/^__*//' -e 's/^\([a-zA-Z_0-9$]*\).*xtern.*/\1/p'";\
5824 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5826 elif com="$sed -n -e '/|UNDEF/d' -e '/FUNC..GL/s/^.*|__*//p'";\
5828 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5830 elif com="$sed -n -e 's/^.* D __*//p' -e 's/^.* D //p'";\
5832 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5834 elif com="$sed -n -e 's/^_//' -e 's/^\([a-zA-Z_0-9]*\).*xtern.*text.*/\1/p'";\
5836 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5838 elif com="$sed -n -e 's/^.*|FUNC |GLOB .*|//p'";\
5840 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5842 elif com="$grep '|' | $sed -n -e '/|COMMON/d' -e '/|DATA/d' \
5843 -e '/ file/d' -e 's/^\([^ ]*\).*/\1/p'";\
5845 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5847 elif com="$sed -n -e 's/^.*|FUNC |GLOB .*|//p' -e 's/^.*|FUNC |WEAK .*|//p'";\
5849 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5851 elif com="$sed -n -e 's/^__//' -e '/|Undef/d' -e '/|Proc/s/ .*//p'";\
5853 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5855 elif com="$sed -n -e 's/^.*|Proc .*|Text *| *//p'";\
5857 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5859 elif com="$sed -n -e '/Def. Text/s/.* \([^ ]*\)\$/\1/p'";\
5861 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5863 elif com="$sed -n -e 's/^[-0-9a-f ]*_\(.*\)=.*/\1/p'";\
5865 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5867 elif com="$sed -n -e 's/.*\.text n\ \ \ \.//p'";\
5869 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5871 elif com="sed -n -e 's/^__.*//' -e 's/[ ]*D[ ]*[0-9]*.*//p'";\
5873 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5876 $nm -p $* 2>/dev/null >libc.tmp
5877 $grep fprintf libc.tmp > libc.ptf
5878 if com="$sed -n -e 's/^.* [ADTSIW] *_[_.]*//p' -e 's/^.* [ADTSIW] //p'";\
5879 eval $xscan; $contains '^fprintf$' libc.list >/dev/null 2>&1
5885 echo "$nm didn't seem to work right. Trying $ar instead..." >&4
5887 if $ar t $libc > libc.tmp && $contains '^fprintf$' libc.tmp >/dev/null 2>&1; then
5888 for thisname in $libnames $libc; do
5889 $ar t $thisname >>libc.tmp
5891 $sed -e "s/\\$_o\$//" < libc.tmp > libc.list
5893 elif test "X$osname" = "Xos2" && $ar tv $libc > libc.tmp; then
5894 # Repeat libc to extract forwarders to DLL entries too
5895 for thisname in $libnames $libc; do
5896 $ar tv $thisname >>libc.tmp
5897 # Revision 50 of EMX has bug in $ar.
5898 # it will not extract forwarders to DLL entries
5899 # Use emximp which will extract exactly them.
5900 emximp -o tmp.imp $thisname \
5902 $sed -e 's/^\([_a-zA-Z0-9]*\) .*$/\1/p' \
5903 < tmp.imp >>libc.tmp
5906 $sed -e "s/\\$_o\$//" -e 's/^ \+//' < libc.tmp > libc.list
5909 echo "$ar didn't seem to work right." >&4
5910 echo "Maybe this is a Cray...trying bld instead..." >&4
5911 if bld t $libc | $sed -e 's/.*\///' -e "s/\\$_o:.*\$//" > libc.list
5913 for thisname in $libnames; do
5915 $sed -e 's/.*\///' -e "s/\\$_o:.*\$//" >>libc.list
5916 $ar t $thisname >>libc.tmp
5920 echo "That didn't work either. Giving up." >&4
5927 if $test -f /lib/syscalls.exp; then
5929 echo "Also extracting names from /lib/syscalls.exp for good ole AIX..." >&4
5930 $sed -n 's/^\([^ ]*\)[ ]*syscall[0-9]*$/\1/p' /lib/syscalls.exp >>libc.list
5934 $rm -f libnames libpath
5936 : see if dld is available
5940 : is a C symbol defined?
5943 -v) tf=libc.tmp; tc=""; tdc="";;
5944 -a) tf=libc.tmp; tc="[0]"; tdc="[]";;
5945 *) tlook="^$1\$"; tf=libc.list; tc="()"; tdc="()";;
5948 case "$reuseval-$4" in
5950 true-*) tx=no; eval "tval=\$$4"; case "$tval" in "") tx=yes;; esac;;
5956 if $contains $tlook $tf >/dev/null 2>&1;
5961 echo "int main() { extern short $1$tdc; printf(\"%hd\", $1$tc); }" > t.c;
5962 if $cc $optimize $ccflags $ldflags -o t t.c $libs >/dev/null 2>&1;
5970 $define) tval=true;;
5976 : define an is-in-libc? function
5977 inlibc='echo " "; td=$define; tu=$undef;
5978 sym=$1; var=$2; eval "was=\$$2";
5980 case "$reuseval$was" in
5990 echo "$sym() found." >&4;
5991 case "$was" in $undef) . ./whoa; esac; eval "$var=\$td";;
5993 echo "$sym() NOT found." >&4;
5994 case "$was" in $define) . ./whoa; esac; eval "$var=\$tu";;
5998 $define) echo "$sym() found." >&4;;
5999 *) echo "$sym() NOT found." >&4;;
6003 : see if dlopen exists
6010 : determine which dynamic loading, if any, to compile in
6012 dldir="ext/DynaLoader"
6025 $define) dflt='y' ;;
6028 $define) dflt='y' ;;
6030 : Does a dl_xxx.xs file exist for this operating system
6031 $test -f $rsrc/$dldir/dl_${osname}.xs && dflt='y'
6034 rp="Do you wish to use dynamic loading?"
6041 if $test -f $rsrc/$dldir/dl_${osname}.xs ; then
6042 dflt="$dldir/dl_${osname}.xs"
6043 elif $test "$d_dlopen" = "$define" ; then
6044 dflt="$dldir/dl_dlopen.xs"
6045 elif $test "$i_dld" = "$define" ; then
6046 dflt="$dldir/dl_dld.xs"
6051 *) dflt="$dldir/$dlsrc"
6054 echo "The following dynamic loading files are available:"
6055 : Can not go over to $dldir because getfile has path hard-coded in.
6056 tdir=`pwd`; cd $rsrc; $ls -C $dldir/dl*.xs; cd $tdir
6057 rp="Source file to use for dynamic loading"
6063 dlsrc=`echo $ans | $sed -e 's%.*/\([^/]*\)$%\1%'`
6067 Some systems may require passing special flags to $cc -c to
6068 compile modules that will be used to create a shared library.
6069 To use no flags, say "none".
6072 case "$cccdlflags" in
6073 '') case "$gccversion" in
6074 '') case "$osname" in
6076 next) dflt='none' ;;
6077 irix*) dflt='-KPIC' ;;
6078 svr4*|esix*|solaris) dflt='-KPIC' ;;
6079 sunos) dflt='-pic' ;;
6083 *) case "$osname" in
6084 svr4*|esix*|solaris) dflt='-fPIC' ;;
6089 *) dflt="$cccdlflags" ;;
6091 rp="Any special flags to pass to $cc -c to compile shared library modules?"
6094 none) cccdlflags=' ' ;;
6095 *) cccdlflags="$ans" ;;
6100 Some systems use ld to create libraries that can be dynamically loaded,
6101 while other systems (such as those using ELF) use $cc.
6105 '') $cat >try.c <<'EOM'
6106 /* Test for whether ELF binaries are produced */
6111 int i = open("a.out",O_RDONLY);
6114 if(read(i,b,4)==4 && b[0]==127 && b[1]=='E' && b[2]=='L' && b[3]=='F')
6115 exit(0); /* succeed (yes, it's ELF) */
6120 if $cc $ccflags try.c >/dev/null 2>&1 && ./a.out; then
6122 You appear to have ELF support. I'll use $cc to build dynamic libraries.
6126 echo "I'll use ld to build dynamic libraries."
6135 rp="What command should be used to create dynamic libraries?"
6141 Some systems may require passing special flags to $ld to create a
6142 library that can be dynamically loaded. If your ld flags include
6143 -L/other/path options to locate libraries outside your loader's normal
6144 search path, you may need to specify those -L options here as well. To
6145 use no flags, say "none".
6148 case "$lddlflags" in
6149 '') case "$osname" in
6150 beos) dflt='-nostart' ;;
6151 hpux) dflt='-b +vnocompatwarnings' ;;
6152 linux|irix*) dflt='-shared' ;;
6153 next) dflt='none' ;;
6154 solaris) dflt='-G' ;;
6155 sunos) dflt='-assert nodefinitions' ;;
6156 svr4*|esix*) dflt="-G $ldflags" ;;
6160 *) dflt="$lddlflags" ;;
6163 : Try to guess additional flags to pick up local libraries.
6164 : Be careful not to append to a plain 'none'
6168 for thisflag in $ldflags; do
6173 *) dflt="$dflt $thisflag" ;;
6180 ''|' ') dflt='none' ;;
6183 rp="Any special flags to pass to $ld to create a dynamically loaded library?"
6186 none) lddlflags=' ' ;;
6187 *) lddlflags="$ans" ;;
6192 Some systems may require passing special flags to $cc to indicate that
6193 the resulting executable will use dynamic linking. To use no flags,
6197 case "$ccdlflags" in
6198 '') case "$osname" in
6199 hpux) dflt='-Wl,-E' ;;
6200 linux) dflt='-rdynamic' ;;
6201 next) dflt='none' ;;
6202 sunos) dflt='none' ;;
6206 *) dflt="$ccdlflags" ;;
6208 rp="Any special flags to pass to $cc to use dynamic linking?"
6211 none) ccdlflags=' ' ;;
6212 *) ccdlflags="$ans" ;;
6226 # No dynamic loading being used, so don't bother even to prompt.
6229 *) case "$useshrplib" in
6230 '') case "$osname" in
6231 svr4*|dgux|dynixptx|esix|powerux|beos|cygwin*)
6233 also='Building a shared libperl is required for dynamic loading to work on your system.'
6238 also='Building a shared libperl is needed for MAB support.'
6256 The perl executable is normally obtained by linking perlmain.c with
6257 libperl${_a}, any static extensions (usually just DynaLoader), and
6258 any other libraries needed on this system (such as -lm, etc.). Since
6259 your system supports dynamic loading, it is probably possible to build
6260 a shared libperl.$so. If you will have more than one executable linked
6261 to libperl.$so, this will significantly reduce the size of each
6262 executable, but it may have a noticeable affect on performance. The
6263 default is probably sensible for your system.
6267 rp="Build a shared libperl.$so (y/n)"
6271 useshrplib='true' ;;
6272 *) useshrplib='false' ;;
6277 case "$useshrplib" in
6281 # Figure out a good name for libperl.so. Since it gets stored in
6282 # a version-specific architecture-dependent library, the version
6283 # number isn't really that important, except for making cc/ld happy.
6285 # A name such as libperl.so.3.1
6286 majmin="libperl.$so.$patchlevel.$subversion"
6287 # A name such as libperl.so.301
6288 majonly=`echo $patchlevel $subversion |
6289 $awk '{printf "%d%02d", $1, $2}'`
6290 majonly=libperl.$so.$majonly
6291 # I'd prefer to keep the os-specific stuff here to a minimum, and
6292 # rely on figuring it out from the naming of libc.
6293 case "${osname}${osvers}" in
6296 # XXX How handle the --version stuff for MAB?
6298 linux*) # ld won't link with a bare -lperl otherwise.
6301 cygwin*) # include version
6302 dflt=`echo libperl$version | sed -e 's/\./_/g'`$lib_ext
6304 *) # Try to guess based on whether libc has major.minor.
6306 *libc.$so.[0-9]*.[0-9]*) dflt=$majmin ;;
6307 *libc.$so.[0-9]*) dflt=$majonly ;;
6308 *) dflt=libperl.$so ;;
6318 I need to select a good name for the shared libperl. If your system uses
6319 library names with major and minor numbers, then you might want something
6320 like $majmin. Alternatively, if your system uses a single version
6321 number for shared libraries, then you might want to use $majonly.
6322 Or, your system might be quite happy with a simple libperl.$so.
6324 Since the shared libperl will get installed into a version-specific
6325 architecture-dependent directory, the version number of the shared perl
6326 library probably isn't important, so the default should be o.k.
6329 rp='What name do you want to give to the shared libperl?'
6332 echo "Ok, I'll use $libperl"
6335 libperl="libperl${_a}"
6339 # Detect old use of shrpdir via undocumented Configure -Dshrpdir
6343 WARNING: Use of the shrpdir variable for the installation location of
6344 the shared $libperl is not supported. It was never documented and
6345 will not work in this version. Let me (perlbug@perl.com)
6346 know of any problems this may cause.
6352 But your current setting of $shrpdir is
6353 the default anyway, so it's harmless.
6358 Further, your current attempted setting of $shrpdir
6359 conflicts with the value of $archlibexp/CORE
6360 that installperl will use.
6367 # How will the perl executable find the installed shared $libperl?
6368 # Add $xxx to ccdlflags.
6369 # If we can't figure out a command-line option, use $shrpenv to
6370 # set env LD_RUN_PATH. The main perl makefile uses this.
6371 shrpdir=$archlibexp/CORE
6374 if "$useshrplib"; then
6377 # We'll set it in Makefile.SH...
6383 xxx="-Wl,-R$shrpdir"
6385 linux|irix*|dec_osf)
6386 xxx="-Wl,-rpath,$shrpdir"
6389 # next doesn't like the default...
6392 # beos doesn't like the default, either.
6395 # hpux doesn't like the default, either.
6396 tmp_shrpenv="env LDOPTS=\"+s +b${shrpdir}\""
6399 tmp_shrpenv="env LD_RUN_PATH=$shrpdir"
6405 # Only add $xxx if it isn't already in ccdlflags.
6406 case " $ccdlflags " in
6408 *) ccdlflags="$ccdlflags $xxx"
6411 Adding $xxx to the flags
6412 passed to $ld so that the perl executable will find the
6413 installed shared $libperl.
6421 # Fix ccdlflags in AIX for building external extensions.
6422 # (For building Perl itself bare -bE:perl.exp is needed,
6423 # Makefile.SH takes care of this.)
6425 aix) ccdlflags="$ccdlflags -bE:$installarchlib/CORE/perl.exp" ;;
6427 # Respect a hint or command-line value.
6429 '') shrpenv="$tmp_shrpenv" ;;
6431 case "$ldlibpthname" in
6432 '') ldlibpthname=LD_LIBRARY_PATH ;;
6433 none) ldlibpthname='' ;;
6436 : determine where manual pages go
6437 set man1dir man1dir none
6441 $spackage has manual pages available in source form.
6445 echo "However, you don't have nroff, so they're probably useless to you."
6447 '') man1dir="none";;
6450 echo "If you don't want the manual sources installed, answer 'none'."
6455 lookpath="$prefixexp/man/man1 $prefixexp/man/l_man/man1"
6456 lookpath="$lookpath $prefixexp/man/p_man/man1"
6457 lookpath="$lookpath $prefixexp/man/u_man/man1"
6458 lookpath="$lookpath $prefixexp/man/man.1"
6460 */?_man*) dflt=`./loc . $prefixexp/l_man/man1 $lookpath` ;;
6461 *) dflt=`./loc . $prefixexp/man/man1 $lookpath` ;;
6471 rp="Where do the main $spackage manual pages (source) go?"
6473 if $test "X$man1direxp" != "X$ansexp"; then
6477 man1direxp="$ansexp"
6483 : Change installation prefix, if necessary.
6484 if $test X"$prefix" != X"$installprefix"; then
6485 installman1dir=`echo $man1direxp | $sed "s#^$prefix#$installprefix#"`
6487 installman1dir="$man1direxp"
6490 : What suffix to use on installed man pages
6497 rp="What suffix should be used for the main $spackage man pages?"
6499 '') case "$man1dir" in
6513 *) dflt="$man1ext";;
6520 : see if we can have long filenames
6522 rmlist="$rmlist /tmp/cf$$"
6523 $test -d /tmp/cf$$ || mkdir /tmp/cf$$
6524 first=123456789abcdef
6525 second=/tmp/cf$$/$first
6526 $rm -f $first $second
6527 if (echo hi >$first) 2>/dev/null; then
6528 if $test -f 123456789abcde; then
6529 echo 'You cannot have filenames longer than 14 characters. Sigh.' >&4
6532 if (echo hi >$second) 2>/dev/null; then
6533 if $test -f /tmp/cf$$/123456789abcde; then
6535 That's peculiar... You can have filenames longer than 14 characters, but only
6536 on some of the filesystems. Maybe you are using NFS. Anyway, to avoid problems
6537 I shall consider your system cannot support long filenames at all.
6541 echo 'You can have filenames longer than 14 characters.' >&4
6546 How confusing! Some of your filesystems are sane enough to allow filenames
6547 longer than 14 characters but some others like /tmp can't even think about them.
6548 So, for now on, I shall assume your kernel does not allow them at all.
6555 You can't have filenames longer than 14 chars. You can't even think about them!
6561 $rm -rf /tmp/cf$$ 123456789abcde*
6563 : determine where library module manual pages go
6564 set man3dir man3dir none
6568 $spackage has manual pages for many of the library modules.
6574 However, you don't have nroff, so they're probably useless to you.
6577 '') man3dir="none";;
6581 case "$d_flexfnam" in
6584 However, your system can't handle the long file names like File::Basename.3.
6587 '') man3dir="none";;
6591 echo "If you don't want the manual sources installed, answer 'none'."
6592 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
6594 '') dflt=`echo $man1dir | $sed -e 's/man1/man3/g' -e 's/man\.1/man\.3/g'`
6595 if $test -d "$privlib/man/man3"; then
6598 WARNING: Previous versions of perl installed man3 pages into
6599 $privlib/man/man3. This version will suggest a
6600 new default of $dflt.
6604 rp='Do you wish to preserve the old behavior?(y/n)'
6607 y*) dflt="$privlib/man/man3" ;;
6613 *) dflt="$man3dir" ;;
6617 rp="Where do the $package library man pages (source) go?"
6620 man3direxp="$ansexp"
6626 : Change installation prefix, if necessary.
6627 if $test X"$prefix" != X"$installprefix"; then
6628 installman3dir=`echo $man3direxp | $sed "s#^$prefix#$installprefix#"`
6630 installman3dir="$man3direxp"
6633 : What suffix to use on installed man pages
6639 rp="What suffix should be used for the $package library man pages?"
6641 '') case "$man3dir" in
6655 *) dflt="$man3ext";;
6662 : see if we have to deal with yellow pages, now NIS.
6663 if $test -d /usr/etc/yp || $test -d /etc/yp; then
6664 if $test -f /usr/etc/nibindd; then
6666 echo "I'm fairly confident you're on a NeXT."
6668 rp='Do you get the hosts file via NetInfo?'
6677 y*) hostcat='nidump hosts .';;
6678 *) case "$hostcat" in
6679 nidump*) hostcat='';;
6689 '') if $contains '^\+' /etc/passwd >/dev/null 2>&1; then
6697 rp='Are you getting the hosts file via yellow pages?'
6700 y*) hostcat='ypcat hosts';;
6701 *) hostcat='cat /etc/hosts';;
6707 '') test -f /etc/hosts && hostcat='cat /etc/hosts';;
6710 '') test -f /etc/group && groupcat='cat /etc/group';;
6713 '') test -f /etc/passwd && passcat='cat /etc/passwd';;
6716 : now get the host name
6718 echo "Figuring out host name..." >&4
6719 case "$myhostname" in
6721 echo 'Maybe "hostname" will work...'
6722 if tans=`sh -c hostname 2>&1` ; then
6730 if $test "$cont"; then
6732 echo 'Oh, dear. Maybe "/etc/systemid" is the key...'
6733 if tans=`cat /etc/systemid 2>&1` ; then
6735 phostname='cat /etc/systemid'
6736 echo "Whadyaknow. Xenix always was a bit strange..."
6739 elif $test -r /etc/systemid; then
6740 echo "(What is a non-Xenix system doing with /etc/systemid?)"
6743 if $test "$cont"; then
6744 echo 'No, maybe "uuname -l" will work...'
6745 if tans=`sh -c 'uuname -l' 2>&1` ; then
6747 phostname='uuname -l'
6749 echo 'Strange. Maybe "uname -n" will work...'
6750 if tans=`sh -c 'uname -n' 2>&1` ; then
6752 phostname='uname -n'
6754 echo 'Oh well, maybe I can mine it out of whoami.h...'
6755 if tans=`sh -c $contains' sysname $usrinc/whoami.h' 2>&1` ; then
6756 myhostname=`echo "$tans" | $sed 's/^.*"\(.*\)"/\1/'`
6757 phostname="sed -n -e '"'/sysname/s/^.*\"\\(.*\\)\"/\1/{'"' -e p -e q -e '}' <$usrinc/whoami.h"
6759 case "$myhostname" in
6760 '') echo "Does this machine have an identity crisis or something?"
6763 echo "Well, you said $myhostname before..."
6764 phostname='echo $myhostname';;
6770 : you do not want to know about this
6775 if $test "$myhostname" ; then
6777 rp='Your host name appears to be "'$myhostname'".'" Right?"
6785 : bad guess or no guess
6786 while $test "X$myhostname" = X ; do
6788 rp="Please type the (one word) name of your host:"
6793 : translate upper to lower if necessary
6794 case "$myhostname" in
6796 echo "(Normalizing case in your host name)"
6797 myhostname=`echo $myhostname | ./tr '[A-Z]' '[a-z]'`
6801 case "$myhostname" in
6803 dflt=`expr "X$myhostname" : "X[^.]*\(\..*\)"`
6804 myhostname=`expr "X$myhostname" : "X\([^.]*\)\."`
6805 echo "(Trimming domain name from host name--host name is now $myhostname)"
6807 *) case "$mydomain" in
6810 test "X$hostcat" = "Xypcat hosts" &&
6811 ypmatch "$myhostname" hosts 2>/dev/null |\
6812 $sed -e 's/[ ]*#.*//; s/$/ /' > hosts && \
6815 test "X$hostcat" != "X" &&
6816 $hostcat | $sed -n -e "s/[ ]*#.*//; s/\$/ /
6817 /[ ]$myhostname[ . ]/p" > hosts
6820 $test x`$awk "/[0-9].*[ ]$myhostname$tmp_re/ { sum++ }
6821 END { print sum }" hosts` = x1 || tmp_re="[ ]"
6822 dflt=.`$awk "/[0-9].*[ ]$myhostname$tmp_re/ {for(i=2; i<=NF;i++) print \\\$i}" \
6823 hosts | $sort | $uniq | \
6824 $sed -n -e "s/$myhostname\.\([-a-zA-Z0-9_.]\)/\1/p"`
6825 case `$echo X$dflt` in
6826 X*\ *) echo "(Several hosts in /etc/hosts matched hostname)"
6829 X.) echo "(You do not have fully-qualified names in /etc/hosts)"
6834 tans=`./loc resolv.conf X /etc /usr/etc`
6835 if $test -f "$tans"; then
6836 echo "(Attempting domain name extraction from $tans)"
6837 dflt=.`$sed -n -e 's/ / /g' \
6838 -e 's/^search *\([^ ]*\).*/\1/p' $tans \
6839 | ./tr '[A-Z]' '[a-z]' 2>/dev/null`
6841 .) dflt=.`$sed -n -e 's/ / /g' \
6842 -e 's/^domain *\([^ ]*\).*/\1/p' $tans \
6843 | ./tr '[A-Z]' '[a-z]' 2>/dev/null`
6850 .) echo "(No help from resolv.conf either -- attempting clever guess)"
6851 dflt=.`sh -c domainname 2>/dev/null`
6854 .nis.*|.yp.*|.main.*) dflt=`echo $dflt | $sed -e 's/^\.[^.]*//'`;;
6859 .) echo "(Lost all hope -- silly guess then)"
6865 *) dflt="$mydomain";;
6869 rp="What is your domain name?"
6879 : translate upper to lower if necessary
6882 echo "(Normalizing case in your domain name)"
6883 mydomain=`echo $mydomain | ./tr '[A-Z]' '[a-z]'`
6887 : a little sanity check here
6888 case "$phostname" in
6891 case `$phostname | ./tr '[A-Z]' '[a-z]'` in
6892 $myhostname$mydomain|$myhostname) ;;
6894 case "$phostname" in
6896 echo "(That doesn't agree with your whoami.h file, by the way.)"
6899 echo "(That doesn't agree with your $phostname command, by the way.)"
6909 I need to get your e-mail address in Internet format if possible, i.e.
6910 something like user@host.domain. Please answer accurately since I have
6911 no easy means to double check it. The default value provided below
6912 is most probably close to reality but may not be valid from outside
6913 your organization...
6917 while test "$cont"; do
6919 '') dflt="$cf_by@$myhostname$mydomain";;
6920 *) dflt="$cf_email";;
6922 rp='What is your e-mail address?'
6928 rp='Address does not look like an Internet one. Use it anyway?'
6944 If you or somebody else will be maintaining perl at your site, please
6945 fill in the correct e-mail address here so that they may be contacted
6946 if necessary. Currently, the "perlbug" program included with perl
6947 will send mail to this address in addition to perlbug@perl.com. You may
6948 enter "none" for no administrator.
6951 case "$perladmin" in
6952 '') dflt="$cf_email";;
6953 *) dflt="$perladmin";;
6955 rp='Perl administrator e-mail address'
6959 : figure out how to guarantee perl startup
6960 case "$startperl" in
6962 case "$sharpbang" in
6966 I can use the #! construct to start perl on your system. This will
6967 make startup of perl scripts faster, but may cause problems if you
6968 want to share those scripts and perl is not in a standard place
6969 ($binexp/perl) on all your platforms. The alternative is to force
6970 a shell by starting the script with a single ':' character.
6974 rp='What shall I put after the #! to start up perl ("none" to not use #!)?'
6977 none) startperl=": # use perl";;
6978 *) startperl="#!$ans"
6979 if $test 30 -lt `echo "$ans" | wc -c`; then
6982 WARNING: Some systems limit the #! command to 32 characters.
6983 If you experience difficulty running Perl scripts with #!, try
6984 installing Perl in a directory with a shorter pathname.
6990 *) startperl=": # use perl"
6995 echo "I'll use $startperl to start perl scripts."
6997 : figure best path for perl in scripts
7000 perlpath="$binexp/perl"
7001 case "$startperl" in
7006 I will use the "eval 'exec'" idiom to start Perl on your system.
7007 I can use the full path of your Perl binary for this purpose, but
7008 doing so may cause problems if you want to share those scripts and
7009 Perl is not always in a standard place ($binexp/perl).
7013 rp="What path shall I use in \"eval 'exec'\"?"
7020 case "$startperl" in
7022 *) echo "I'll use $perlpath in \"eval 'exec'\"" ;;
7025 : determine where public executable scripts go
7026 set scriptdir scriptdir
7028 case "$scriptdir" in
7031 : guess some guesses
7032 $test -d /usr/share/scripts && dflt=/usr/share/scripts
7033 $test -d /usr/share/bin && dflt=/usr/share/bin
7034 $test -d /usr/local/script && dflt=/usr/local/script
7035 $test -d /usr/local/scripts && dflt=/usr/local/scripts
7036 $test -d $prefixexp/script && dflt=$prefixexp/script
7040 *) dflt="$scriptdir"
7045 Some installations have a separate directory just for executable scripts so
7046 that they can mount it across multiple architectures but keep the scripts in
7047 one spot. You might, for example, have a subdirectory of /usr/share for this.
7048 Or you might just lump your scripts in with all your other executables.
7052 rp='Where do you keep publicly executable scripts?'
7054 if $test "X$ansexp" != "X$scriptdirexp"; then
7058 scriptdirexp="$ansexp"
7059 : Change installation prefix, if necessary.
7060 if $test X"$prefix" != X"$installprefix"; then
7061 installscript=`echo $scriptdirexp | sed "s#^$prefix#$installprefix#"`
7063 installscript="$scriptdirexp"
7066 : determine where site specific architecture-dependent libraries go.
7067 : sitelib default is /usr/local/lib/perl5/site_perl/$version
7068 : sitearch default is /usr/local/lib/perl5/site_perl/$version/$archname
7069 : sitelib may have an optional trailing /share.
7071 '') dflt=`echo $sitelib | $sed 's,/share$,,'`
7072 dflt="$dflt/$archname"
7077 set sitearch sitearch none
7081 The installation process will also create a directory for
7082 architecture-dependent site-specific extensions and modules.
7086 rp='Pathname for the site-specific architecture-dependent library files?'
7089 sitearchexp="$ansexp"
7090 : Change installation prefix, if necessary.
7091 if $test X"$prefix" != X"$installprefix"; then
7092 installsitearch=`echo $sitearchexp | sed "s#^$prefix#$installprefix#"`
7094 installsitearch="$sitearchexp"
7097 : determine where add-on public executables go
7099 '') dflt=$siteprefix/bin ;;
7103 rp='Pathname where the add-on public executables should be installed?'
7106 sitebinexp="$ansexp"
7107 : Change installation prefix, if necessary.
7108 if $test X"$prefix" != X"$installprefix"; then
7109 installsitebin=`echo $sitebinexp | sed "s#^$prefix#$installprefix#"`
7111 installsitebin="$sitebinexp"
7114 : see if sqrtl exists
7119 *-DUSE_LONG_DOUBLE*|*-DUSE_MORE_BITS*) uselongdouble="$define" ;;
7122 case "$uselongdouble" in
7123 $define|true|[yY]*) dflt='y';;
7128 Perl can be built to take advantage of long doubles which
7129 (if available) may give more accuracy and range for floating point numbers.
7131 If this doesn't make any sense to you, just accept the default '$dflt'.
7133 rp='Try to use long doubles if available?'
7136 y|Y) val="$define" ;;
7142 case "$uselongdouble" in
7143 true|[yY]*) uselongdouble="$define" ;;
7146 case "$uselongdouble" in
7148 : Look for a hint-file generated 'call-back-unit'. If the
7149 : user has specified that long doubles should be used,
7150 : we may need to set or change some other defaults.
7151 if $test -f uselongdouble.cbu; then
7152 echo "Your platform has some specific hints for long doubles, using them..."
7153 . ./uselongdouble.cbu
7156 (Your platform doesn't have any specific hints for long doubles.)
7162 case "$uselongdouble:$d_sqrtl" in
7166 You requested the use of long doubles but you do not seem to have
7167 the mathematic functions for long doubles. I'm disabling the use
7170 uselongdouble=$undef
7174 case "$useperlio" in
7175 $define|true|[yY]*) dflt='y';;
7180 Previous version of $package used the standard IO mechanisms as defined
7181 in <stdio.h>. Versions 5.003_02 and later of perl allow alternate IO
7182 mechanisms via a "PerlIO" abstraction, but the stdio mechanism is still
7183 the default. This abstraction layer can use AT&T's sfio (if you already
7184 have sfio installed) or regular stdio. Using PerlIO with sfio may cause
7185 problems with some extension modules. Using PerlIO with stdio is safe,
7186 but it is slower than plain stdio and therefore is not the default.
7188 If this doesn't make any sense to you, just accept the default '$dflt'.
7190 rp='Use the experimental PerlIO abstraction layer?'
7197 echo "Ok, doing things the stdio way"
7204 case "$vendorprefix" in
7205 '') d_vendorbin="$undef"
7209 *) d_vendorbin="$define"
7210 : determine where vendor-supplied executables go.
7211 case "$vendorbin" in
7212 '') dflt=$vendorprefix/bin ;;
7213 *) dflt="$vendorbin" ;;
7216 rp='Pathname for the vendor-supplied executables directory?'
7219 vendorbinexp="$ansexp"
7222 : Change installation prefix, if necessary.
7223 if $test X"$prefix" != X"$installprefix"; then
7224 installvendorbin=`echo $vendorbinexp | $sed "s#^$prefix#$installprefix#"`
7226 installvendorbin="$vendorbinexp"
7229 : check for length of double
7231 case "$doublesize" in
7233 echo "Checking to see how big your double precision numbers are..." >&4
7234 $cat >try.c <<'EOCP'
7238 printf("%d\n", (int)sizeof(double));
7243 if eval $compile_ok; then
7245 echo "Your double is $doublesize bytes long."
7248 echo "(I can't seem to compile the test program. Guessing...)"
7249 rp="What is the size of a double precision number (in bytes)?"
7257 : check for long doubles
7259 echo "Checking to see if you have long double..." >&4
7260 echo 'int main() { long double x = 7.0; }' > try.c
7262 if eval $compile; then
7264 echo "You have long double."
7267 echo "You do not have long double."
7273 : check for length of long double
7274 case "${d_longdbl}${longdblsize}" in
7277 echo "Checking to see how big your long doubles are..." >&4
7278 $cat >try.c <<'EOCP'
7282 printf("%d\n", sizeof(long double));
7287 if eval $compile; then
7288 longdblsize=`./try$exe_ext`
7289 echo "Your long doubles are $longdblsize bytes long."
7293 echo "(I can't seem to compile the test program. Guessing...)" >&4
7294 rp="What is the size of a long double (in bytes)?"
7298 if $test "X$doublesize" = "X$longdblsize"; then
7299 echo "(That isn't any different from an ordinary double.)"
7305 : Check how to convert floats to strings.
7306 if test "X$d_Gconvert" = X; then
7308 echo "Checking for an efficient way to convert floats to strings."
7311 #define Gconvert(x,n,t,b) gconvert((x),(n),(t),(b))
7312 char *myname = "gconvert";
7315 #define Gconvert(x,n,t,b) gcvt((x),(n),(b))
7316 char *myname = "gcvt";
7319 #define Gconvert(x,n,t,b) qgcvt((x),(n),(b))
7320 char *myname = "qgcvt";
7321 #define DOUBLETYPE long double
7324 #define Gconvert(x,n,t,b) sprintf((b),"%.*g",(n),(x))
7325 char *myname = "sprintf";
7329 #define DOUBLETYPE double
7334 #define I_STDLIB $i_stdlib
7340 checkit(expect, got)
7344 if (strcmp(expect, got)) {
7345 printf("%s oddity: Expected %s, got %s\n",
7346 myname, expect, got);
7356 /* This must be 1st test on (which?) platform */
7357 /* Alan Burlison <AlanBurlsin@unn.unisys.com> */
7358 Gconvert((DOUBLETYPE)0.1, 8, 0, buf);
7359 checkit("0.1", buf);
7361 Gconvert((DOUBLETYPE)1.0, 8, 0, buf);
7364 Gconvert((DOUBLETYPE)0.0, 8, 0, buf);
7367 Gconvert((DOUBLETYPE)-1.0, 8, 0, buf);
7370 /* Some Linux gcvt's give 1.e+5 here. */
7371 Gconvert((DOUBLETYPE)100000.0, 8, 0, buf);
7372 checkit("100000", buf);
7374 /* Some Linux gcvt's give -1.e+5 here. */
7375 Gconvert((DOUBLETYPE)-100000.0, 8, 0, buf);
7376 checkit("-100000", buf);
7381 case "$d_Gconvert" in
7382 gconvert*) xxx_list='gconvert gcvt sprintf' ;;
7383 gcvt*) xxx_list='gcvt gconvert sprintf' ;;
7384 sprintf*) xxx_list='sprintf gconvert gcvt' ;;
7385 *) xxx_list='gconvert gcvt sprintf' ;;
7388 case "$d_longdbl$uselongdouble" in
7389 definedefine) xxx_list="`echo $xxx_list|sed 's/gcvt/qgcvt gcvt/'`" ;;
7392 for xxx_convert in $xxx_list; do
7393 echo "Trying $xxx_convert..."
7395 set try -DTRY_$xxx_convert
7396 if eval $compile; then
7397 echo "$xxx_convert() found." >&4
7399 echo "I'll use $xxx_convert to convert floats into a string." >&4
7402 echo "...But $xxx_convert didn't work as I expected."
7405 echo "$xxx_convert NOT found." >&4
7409 case "$xxx_convert" in
7410 gconvert) d_Gconvert='gconvert((x),(n),(t),(b))' ;;
7411 gcvt) d_Gconvert='gcvt((x),(n),(b))' ;;
7412 qgcvt) d_Gconvert='qgcvt((x),(n),(b))' ;;
7413 *) d_Gconvert='sprintf((b),"%.*g",(n),(x))' ;;
7419 if $test X"$d_longdbl" = X"$define"; then
7421 echo "Checking how to print long doubles..." >&4
7423 if $test X"$sPRIfldbl" = X -a X"$doublesize" = X"$longdblsize"; then
7424 $cat >try.c <<'EOCP'
7425 #include <sys/types.h>
7429 printf("%.3f\n", d);
7433 if eval $compile; then
7437 sPRIfldbl='"f"'; sPRIgldbl='"g"'; sPRIeldbl='"e"';
7438 sPRIFldbl='"F"'; sPRIGldbl='"G"'; sPRIEldbl='"E"';
7439 echo "We will use %f."
7445 if $test X"$sPRIfldbl" = X; then
7446 $cat >try.c <<'EOCP'
7447 #include <sys/types.h>
7450 long double d = 123.456;
7451 printf("%.3llf\n", d);
7455 if eval $compile; then
7459 sPRIfldbl='"llf"'; sPRIgldbl='"llg"'; sPRIeldbl='"lle"';
7460 sPRIFldbl='"llF"'; sPRIGldbl='"llG"'; sPRIEldbl='"llE"';
7461 echo "We will use %llf."
7467 if $test X"$sPRIfldbl" = X; then
7468 $cat >try.c <<'EOCP'
7469 #include <sys/types.h>
7472 long double d = 123.456;
7473 printf("%.3Lf\n", d);
7477 if eval $compile; then
7481 sPRIfldbl='"Lf"'; sPRIgldbl='"Lg"'; sPRIeldbl='"Le"';
7482 sPRIFldbl='"LF"'; sPRIGldbl='"LG"'; sPRIEldbl='"LE"';
7483 echo "We will use %Lf."
7489 if $test X"$sPRIfldbl" = X; then
7490 $cat >try.c <<'EOCP'
7491 #include <sys/types.h>
7494 long double d = 123.456;
7495 printf("%.3lf\n", d);
7499 if eval $compile; then
7503 sPRIfldbl='"lf"'; sPRIgldbl='"lg"'; sPRIeldbl='"le"';
7504 sPRIFldbl='"lF"'; sPRIGldbl='"lG"'; sPRIEldbl='"lE"';
7505 echo "We will use %lf."
7511 if $test X"$sPRIfldbl" = X; then
7512 echo "Cannot figure out how to print long doubles." >&4
7519 case "$sPRIfldbl" in
7520 '') d_PRIfldbl="$undef"; d_PRIgldbl="$undef"; d_PRIeldbl="$undef";
7521 d_PRIFldbl="$undef"; d_PRIGldbl="$undef"; d_PRIEldbl="$undef";
7523 *) d_PRIfldbl="$define"; d_PRIgldbl="$define"; d_PRIeldbl="$define";
7524 d_PRIFldbl="$define"; d_PRIGldbl="$define"; d_PRIEldbl="$define";
7528 : Initialize h_fcntl
7531 : Initialize h_sysfile
7534 : access call always available on UNIX
7538 : locate the flags for 'access()'
7542 $cat >access.c <<'EOCP'
7543 #include <sys/types.h>
7548 #include <sys/file.h>
7557 : check sys/file.h first, no particular reason here
7558 if $test `./findhdr sys/file.h` && \
7559 $cc $cppflags -DI_SYS_FILE -o access access.c >/dev/null 2>&1 ; then
7561 echo "<sys/file.h> defines the *_OK access constants." >&4
7562 elif $test `./findhdr fcntl.h` && \
7563 $cc $cppflags -DI_FCNTL -o access access.c >/dev/null 2>&1 ; then
7565 echo "<fcntl.h> defines the *_OK access constants." >&4
7566 elif $test `./findhdr unistd.h` && \
7567 $cc $cppflags -DI_UNISTD -o access access.c >/dev/null 2>&1 ; then
7568 echo "<unistd.h> defines the *_OK access constants." >&4
7570 echo "I can't find the four *_OK access constants--I'll use mine." >&4
7576 : see if accessx exists
7577 set accessx d_accessx
7580 : see if alarm exists
7584 : see if atolf exists
7588 : see if atoll exists
7592 : Look for GNU-cc style attribute checking
7594 echo "Checking whether your compiler can handle __attribute__ ..." >&4
7595 $cat >attrib.c <<'EOCP'
7597 void croak (char* pat,...) __attribute__((format(printf,1,2),noreturn));
7599 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
7600 if $contains 'warning' attrib.out >/dev/null 2>&1; then
7601 echo "Your C compiler doesn't fully support __attribute__."
7604 echo "Your C compiler supports __attribute__."
7608 echo "Your C compiler doesn't seem to understand __attribute__ at all."
7615 : see if bcmp exists
7619 : see if bcopy exists
7623 : see if this is a unistd.h system
7624 set unistd.h i_unistd
7627 : see if getpgrp exists
7628 set getpgrp d_getpgrp
7631 case "$d_getpgrp" in
7634 echo "Checking to see which flavor of getpgrp is in use..."
7637 #include <sys/types.h>
7639 # include <unistd.h>
7643 if (getuid() == 0) {
7644 printf("(I see you are running Configure as super-user...)\n");
7648 if (getpgrp(1) == 0)
7657 if $cc -DTRY_BSD_PGRP $ccflags $ldflags -o set set.c $libs >/dev/null 2>&1 && ./set; then
7658 echo "You have to use getpgrp(pid) instead of getpgrp()." >&4
7660 elif $cc $ccflags $ldflags -o set set.c $libs >/dev/null 2>&1 && ./set; then
7661 echo "You have to use getpgrp() instead of getpgrp(pid)." >&4
7664 echo "I can't seem to compile and run the test program."
7666 xxx="a USG one, i.e. you use getpgrp()."
7668 # SVR4 systems can appear rather BSD-ish.
7671 xxx="a BSD one, i.e. you use getpgrp(pid)."
7675 xxx="probably a USG one, i.e. you use getpgrp()."
7680 echo "Assuming your getpgrp is $xxx" >&4
7689 : see if setpgrp exists
7690 set setpgrp d_setpgrp
7693 case "$d_setpgrp" in
7696 echo "Checking to see which flavor of setpgrp is in use..."
7699 #include <sys/types.h>
7701 # include <unistd.h>
7705 if (getuid() == 0) {
7706 printf("(I see you are running Configure as super-user...)\n");
7710 if (-1 == setpgrp(1, 1))
7713 if (setpgrp() != -1)
7719 if $cc -DTRY_BSD_PGRP $ccflags $ldflags -o set set.c $libs >/dev/null 2>&1 && ./set; then
7720 echo 'You have to use setpgrp(pid,pgrp) instead of setpgrp().' >&4
7722 elif $cc $ccflags $ldflags -o set set.c $libs >/dev/null 2>&1 && ./set; then
7723 echo 'You have to use setpgrp() instead of setpgrp(pid,pgrp).' >&4
7726 echo "(I can't seem to compile and run the test program.)"
7728 xxx="a USG one, i.e. you use setpgrp()."
7730 # SVR4 systems can appear rather BSD-ish.
7733 xxx="a BSD one, i.e. you use setpgrp(pid,pgrp)."
7737 xxx="probably a USG one, i.e. you use setpgrp()."
7742 echo "Assuming your setpgrp is $xxx" >&4
7750 : see if bzero exists
7754 : see if signal is declared as pointer to function returning int or void
7756 xxx=`./findhdr signal.h`
7757 $test "$xxx" && $cppstdin $cppminus $cppflags < $xxx >$$.tmp 2>/dev/null
7758 if $contains 'int.*\*[ ]*signal' $$.tmp >/dev/null 2>&1 ; then
7759 echo "You have int (*signal())() instead of void." >&4
7761 elif $contains 'void.*\*[ ]*signal' $$.tmp >/dev/null 2>&1 ; then
7762 echo "You have void (*signal())()." >&4
7764 elif $contains 'extern[ ]*[(\*]*signal' $$.tmp >/dev/null 2>&1 ; then
7765 echo "You have int (*signal())() instead of void." >&4
7767 elif $contains 'void.*\*.*sig' $$.tmp >/dev/null 2>&1 ; then
7768 echo "You have void (*signal())()." >&4
7771 case "$d_voidsig" in
7773 echo "I can't determine whether signal handler returns void or int..." >&4
7775 rp="What type does your signal handler return?"
7782 echo "As you already told me, signal handler returns void." >&4
7785 *) echo "As you already told me, signal handler returns int." >&4
7792 case "$d_voidsig" in
7793 "$define") signal_t="void";;
7798 : check for ability to cast large floats to 32-bit ints.
7800 echo 'Checking whether your C compiler can cast large floats to int32.' >&4
7801 if $test "$intsize" -ge 4; then
7808 #include <sys/types.h>
7810 $signal_t blech(s) int s; { exit(3); }
7817 signal(SIGFPE, blech);
7819 /* Don't let compiler optimize the test away. Store the number
7820 in a writable string for gcc to pass to sscanf under HP/UX.
7822 sprintf(str, "2147483647");
7823 sscanf(str, "%lf", &f); /* f = (double) 0x7fffffff; */
7827 /* x86 processors will probably give 0x8000 0000, which is a
7828 sign change. We don't want that. We want to mimic SPARC
7829 behavior here, which is to preserve the sign and give
7832 if (i32 != ($xxx) f)
7838 if eval $compile_ok; then
7842 echo "(I can't seem to compile the test program--assuming it can't)"
7850 echo "Nope, it can't."
7857 : check for ability to cast negative floats to unsigned
7859 echo 'Checking whether your C compiler can cast negative float to unsigned.' >&4
7862 #include <sys/types.h>
7864 $signal_t blech(s) int s; { exit(7); }
7865 $signal_t blech_in_list(s) int s; { exit(4); }
7866 unsigned long dummy_long(p) unsigned long p; { return p; }
7867 unsigned int dummy_int(p) unsigned int p; { return p; }
7868 unsigned short dummy_short(p) unsigned short p; { return p; }
7872 unsigned long along;
7874 unsigned short ashort;
7878 /* Frustrate gcc-2.7.2's optimizer which failed this test with
7879 a direct f = -123. assignment. gcc-2.8.0 reportedly
7880 optimized the whole file away
7882 /* Store the number in a writable string for gcc to pass to
7885 sprintf(str, "-123");
7886 sscanf(str, "%lf", &f); /* f = -123.; */
7888 signal(SIGFPE, blech);
7889 along = (unsigned long)f;
7890 aint = (unsigned int)f;
7891 ashort = (unsigned short)f;
7892 if (along != (unsigned long)-123)
7894 if (aint != (unsigned int)-123)
7896 if (ashort != (unsigned short)-123)
7898 sprintf(str, "1073741824.");
7899 sscanf(str, "%lf", &f); /* f = (double)0x40000000; */
7902 along = (unsigned long)f;
7903 if (along != 0x80000000)
7907 along = (unsigned long)f;
7908 if (along != 0x7fffffff)
7912 along = (unsigned long)f;
7913 if (along != 0x80000001)
7917 signal(SIGFPE, blech_in_list);
7918 sprintf(str, "123.");
7919 sscanf(str, "%lf", &f); /* f = 123.; */
7920 along = dummy_long((unsigned long)f);
7921 aint = dummy_int((unsigned int)f);
7922 ashort = dummy_short((unsigned short)f);
7923 if (along != (unsigned long)123)
7925 if (aint != (unsigned int)123)
7927 if (ashort != (unsigned short)123)
7934 if eval $compile_ok; then
7938 echo "(I can't seem to compile the test program--assuming it can't)"
7941 case "$castflags" in
7946 echo "Nope, it can't."
7953 : see if vprintf exists
7955 if set vprintf val -f d_vprintf; eval $csym; $val; then
7956 echo 'vprintf() found.' >&4
7958 $cat >vprintf.c <<'EOF'
7959 #include <varargs.h>
7961 int main() { xxx("foo"); }
7970 exit((unsigned long)vsprintf(buf,"%s",args) > 10L);
7974 if eval $compile && ./vprintf; then
7975 echo "Your vsprintf() returns (int)." >&4
7978 echo "Your vsprintf() returns (char*)." >&4
7982 echo 'vprintf() NOT found.' >&4
7992 : see if chown exists
7996 : see if chroot exists
8000 : see if chsize exists
8004 : check for const keyword
8006 echo 'Checking to see if your C compiler knows about "const"...' >&4
8007 $cat >const.c <<'EOCP'
8008 typedef struct spug { int drokk; } spug;
8015 if $cc -c $ccflags const.c >/dev/null 2>&1 ; then
8017 echo "Yup, it does."
8020 echo "Nope, it doesn't."
8025 : see if crypt exists
8027 if set crypt val -f d_crypt; eval $csym; $val; then
8028 echo 'crypt() found.' >&4
8032 cryptlib=`./loc Slibcrypt$_a "" $xlibpth`
8033 if $test -z "$cryptlib"; then
8034 cryptlib=`./loc Mlibcrypt$_a "" $xlibpth`
8038 if $test -z "$cryptlib"; then
8039 cryptlib=`./loc Llibcrypt$_a "" $xlibpth`
8043 if $test -z "$cryptlib"; then
8044 cryptlib=`./loc libcrypt$_a "" $libpth`
8048 if $test -z "$cryptlib"; then
8049 echo 'crypt() NOT found.' >&4
8058 : get csh whereabouts
8060 'csh') val="$undef" ;;
8065 : Respect a hint or command line value for full_csh.
8067 '') full_csh=$csh ;;
8070 : see if cuserid exists
8071 set cuserid d_cuserid
8074 : see if this is a limits.h system
8075 set limits.h i_limits
8078 : see if this is a float.h system
8082 : See if number of significant digits in a double precision number is known
8084 $cat >dbl_dig.c <<EOM
8094 printf("Contains DBL_DIG");
8097 $cppstdin $cppflags $cppminus < dbl_dig.c >dbl_dig.E 2>/dev/null
8098 if $contains 'DBL_DIG' dbl_dig.E >/dev/null 2>&1; then
8099 echo "DBL_DIG found." >&4
8102 echo "DBL_DIG NOT found." >&4
8109 : see if difftime exists
8110 set difftime d_difftime
8113 : see if this is a dirent system
8115 if xinc=`./findhdr dirent.h`; $test "$xinc"; then
8117 echo "<dirent.h> found." >&4
8120 if xinc=`./findhdr sys/dir.h`; $test "$xinc"; then
8121 echo "<sys/dir.h> found." >&4
8124 xinc=`./findhdr sys/ndir.h`
8126 echo "<dirent.h> NOT found." >&4
8131 : Look for type of directory structure.
8133 $cppstdin $cppflags $cppminus < "$xinc" > try.c
8135 case "$direntrytype" in
8138 $define) guess1='struct dirent' ;;
8139 *) guess1='struct direct' ;;
8142 *) guess1="$direntrytype"
8147 'struct dirent') guess2='struct direct' ;;
8148 *) guess2='struct dirent' ;;
8151 if $contains "$guess1" try.c >/dev/null 2>&1; then
8152 direntrytype="$guess1"
8153 echo "Your directory entries are $direntrytype." >&4
8154 elif $contains "$guess2" try.c >/dev/null 2>&1; then
8155 direntrytype="$guess2"
8156 echo "Your directory entries seem to be $direntrytype." >&4
8158 echo "I don't recognize your system's directory entries." >&4
8159 rp="What type is used for directory entries on this system?"
8167 : see if the directory entry stores field length
8169 $cppstdin $cppflags $cppminus < "$xinc" > try.c
8170 if $contains 'd_namlen' try.c >/dev/null 2>&1; then
8171 echo "Good, your directory entry keeps length information in d_namlen." >&4
8174 echo "Your directory entry does not know about the d_namlen field." >&4
8181 : see if dlerror exists
8184 set dlerror d_dlerror
8188 : see if dlfcn is available
8196 On a few systems, the dynamically loaded modules that perl generates and uses
8197 will need a different extension than shared libs. The default will probably
8205 rp='What is the extension of dynamically loaded modules'
8214 : Check if dlsym need a leading underscore
8220 echo "Checking whether your dlsym() needs a leading underscore ..." >&4
8221 $cat >dyna.c <<'EOM'
8230 #include <dlfcn.h> /* the dynamic linker include file for Sunos/Solaris */
8232 #include <sys/types.h>
8246 int mode = RTLD_LAZY ;
8248 handle = dlopen("./dyna.$dlext", mode) ;
8249 if (handle == NULL) {
8254 symbol = dlsym(handle, "fred") ;
8255 if (symbol == NULL) {
8256 /* try putting a leading underscore */
8257 symbol = dlsym(handle, "_fred") ;
8258 if (symbol == NULL) {
8271 : Call the object file tmp-dyna.o in case dlext=o.
8272 if $cc $ccflags $cccdlflags -c dyna.c > /dev/null 2>&1 &&
8273 mv dyna${_o} tmp-dyna${_o} > /dev/null 2>&1 &&
8274 $ld $lddlflags -o dyna.$dlext tmp-dyna${_o} > /dev/null 2>&1 &&
8275 $cc $ccflags -o fred $ldflags $cccdlflags $ccdlflags fred.c $libs > /dev/null 2>&1; then
8278 1) echo "Test program failed using dlopen." >&4
8279 echo "Perhaps you should not use dynamic loading." >&4;;
8280 2) echo "Test program failed using dlsym." >&4
8281 echo "Perhaps you should not use dynamic loading." >&4;;
8282 3) echo "dlsym needs a leading underscore" >&4
8284 4) echo "dlsym doesn't need a leading underscore." >&4;;
8287 echo "I can't compile and run the test program." >&4
8288 echo "I'm guessing that dlsym doesn't need a leading underscore." >&4
8293 $rm -f fred fred.? dyna.$dlext dyna.? tmp-dyna.?
8298 hasproto='varname=$1; func=$2; shift; shift;
8299 while $test $# -ge 2; do
8301 $define) echo "#include <$2>";;
8305 $cppstdin $cppflags $cppminus < try.c > tryout.c 2>/dev/null;
8306 if $contains "$func.*(" tryout.c >/dev/null 2>&1; then
8307 echo "$func() prototype found.";
8310 echo "$func() prototype NOT found.";
8315 $rm -f try.c tryout.c'
8317 : see if prototype for drand48 is available
8319 set d_drand48proto drand48 $i_stdlib stdlib.h $i_unistd unistd.h
8322 : see if dup2 exists
8326 : see if eaccess exists
8327 set eaccess d_eaccess
8330 : see if endgrent exists
8331 set endgrent d_endgrent
8334 : see if endhostent exists
8335 set endhostent d_endhent
8338 : see if endnetent exists
8339 set endnetent d_endnent
8342 : see if endprotoent exists
8343 set endprotoent d_endpent
8346 : see if endpwent exists
8347 set endpwent d_endpwent
8350 : see if endservent exists
8351 set endservent d_endsent
8354 : see if endspent exists
8355 set endspent d_endspent
8358 : Locate the flags for 'open()'
8360 $cat >open3.c <<'EOCP'
8361 #include <sys/types.h>
8366 #include <sys/file.h>
8377 : check sys/file.h first to get FREAD on Sun
8378 if $test `./findhdr sys/file.h` && \
8379 set open3 -DI_SYS_FILE && eval $compile; then
8381 echo "<sys/file.h> defines the O_* constants..." >&4
8383 echo "and you have the 3 argument form of open()." >&4
8386 echo "but not the 3 argument form of open(). Oh, well." >&4
8389 elif $test `./findhdr fcntl.h` && \
8390 set open3 -DI_FCNTL && eval $compile; then
8392 echo "<fcntl.h> defines the O_* constants..." >&4
8394 echo "and you have the 3 argument form of open()." >&4
8397 echo "but not the 3 argument form of open(). Oh, well." >&4
8402 echo "I can't find the O_* constant definitions! You got problems." >&4
8408 : see which of string.h or strings.h is needed
8410 strings=`./findhdr string.h`
8411 if $test "$strings" && $test -r "$strings"; then
8412 echo "Using <string.h> instead of <strings.h>." >&4
8416 strings=`./findhdr strings.h`
8417 if $test "$strings" && $test -r "$strings"; then
8418 echo "Using <strings.h> instead of <string.h>." >&4
8420 echo "No string header found -- You'll surely have problems." >&4
8426 "$undef") strings=`./findhdr strings.h`;;
8427 *) strings=`./findhdr string.h`;;
8430 : check for non-blocking I/O stuff
8431 case "$h_sysfile" in
8432 true) echo "#include <sys/file.h>" > head.c;;
8435 true) echo "#include <fcntl.h>" > head.c;;
8436 *) echo "#include <sys/fcntl.h>" > head.c;;
8441 echo "Figuring out the flag used by open() for non-blocking I/O..." >&4
8442 case "$o_nonblock" in
8445 $cat >>try.c <<'EOCP'
8449 printf("O_NONBLOCK\n");
8453 printf("O_NDELAY\n");
8457 printf("FNDELAY\n");
8464 if eval $compile_ok; then
8466 case "$o_nonblock" in
8467 '') echo "I can't figure it out, assuming O_NONBLOCK will do.";;
8468 *) echo "Seems like we can use $o_nonblock.";;
8471 echo "(I can't compile the test program; pray O_NONBLOCK is right!)"
8474 *) echo "Using $hint value $o_nonblock.";;
8476 $rm -f try try.* .out core
8479 echo "Let's see what value errno gets from read() on a $o_nonblock file..." >&4
8485 #include <sys/types.h>
8488 #define MY_O_NONBLOCK $o_nonblock
8489 #ifndef errno /* XXX need better Configure test */
8499 #include <strings.h>
8501 $signal_t blech(x) int x; { exit(3); }
8503 $cat >> try.c <<'EOCP'
8511 pipe(pd); /* Down: child -> parent */
8512 pipe(pu); /* Up: parent -> child */
8515 close(pd[1]); /* Parent reads from pd[0] */
8516 close(pu[0]); /* Parent writes (blocking) to pu[1] */
8517 if (-1 == fcntl(pd[0], F_SETFL, MY_O_NONBLOCK))
8519 signal(SIGALRM, blech);
8521 if ((ret = read(pd[0], buf, 1)) > 0) /* Nothing to read! */
8523 sprintf(string, "%d\n", ret);
8524 write(2, string, strlen(string));
8527 if (errno == EAGAIN) {
8533 if (errno == EWOULDBLOCK)
8534 printf("EWOULDBLOCK\n");
8537 write(pu[1], buf, 1); /* Unblocks child, tell it to close our pipe */
8538 sleep(2); /* Give it time to close our pipe */
8540 ret = read(pd[0], buf, 1); /* Should read EOF */
8542 sprintf(string, "%d\n", ret);
8543 write(3, string, strlen(string));
8547 close(pd[0]); /* We write to pd[1] */
8548 close(pu[1]); /* We read from pu[0] */
8549 read(pu[0], buf, 1); /* Wait for parent to signal us we may continue */
8550 close(pd[1]); /* Pipe pd is now fully closed! */
8551 exit(0); /* Bye bye, thank you for playing! */
8555 if eval $compile_ok; then
8556 echo "$startsh" >mtry
8557 echo "./try >try.out 2>try.ret 3>try.err || exit 4" >>mtry
8559 ./mtry >/dev/null 2>&1
8561 0) eagain=`$cat try.out`;;
8562 1) echo "Could not perform non-blocking setting!";;
8563 2) echo "I did a successful read() for something that was not there!";;
8564 3) echo "Hmm... non-blocking I/O does not seem to be working!";;
8565 *) echo "Something terribly wrong happened during testing.";;
8567 rd_nodata=`$cat try.ret`
8568 echo "A read() system call with no data present returns $rd_nodata."
8569 case "$rd_nodata" in
8572 echo "(That's peculiar, fixing that to be -1.)"
8578 echo "Forcing errno EAGAIN on read() with no data available."
8582 echo "Your read() sets errno to $eagain when no data is available."
8585 status=`$cat try.err`
8587 0) echo "And it correctly returns 0 to signal EOF.";;
8588 -1) echo "But it also returns -1 to signal EOF, so be careful!";;
8589 *) echo "However, your read() returns '$status' on EOF??";;
8592 if test "$status" = "$rd_nodata"; then
8593 echo "WARNING: you can't distinguish between EOF and no data!"
8597 echo "I can't compile the test program--assuming errno EAGAIN will do."
8604 echo "Using $hint value $eagain."
8605 echo "Your read() returns $rd_nodata when no data is present."
8606 case "$d_eofnblk" in
8607 "$define") echo "And you can see EOF because read() returns 0.";;
8608 "$undef") echo "But you can't see EOF status from read() returned value.";;
8610 echo "(Assuming you can't see EOF status from read anyway.)"
8616 $rm -f try try.* .out core head.c mtry
8618 : see if fchmod exists
8622 : see if fchown exists
8626 : see if this is an fcntl system
8630 hasfield='varname=$1; struct=$2; field=$3; shift; shift; shift;
8631 while $test $# -ge 2; do
8633 $define) echo "#include <$2>";;
8637 echo "int main () { struct $struct foo; char* bar; bar = (char*)foo.$field; }" >> try.c;
8639 if eval $compile; then
8650 : see whether socket exists
8652 $echo $n "Hmm... $c" >&4
8653 if set socket val -f d_socket; eval $csym; $val; then
8654 echo "Looks like you have Berkeley networking support." >&4
8656 if set setsockopt val -f; eval $csym; $val; then
8659 echo "...but it uses the old BSD 4.1c interface, rather than 4.2." >&4
8663 if $contains socklib libc.list >/dev/null 2>&1; then
8664 echo "Looks like you have Berkeley networking support." >&4
8666 : we will have to assume that it supports the 4.2 BSD interface
8669 echo "You don't have Berkeley networking in libc$_a..." >&4
8670 if test "X$d_socket" = "X$define"; then
8671 echo "...but you seem to believe that you have sockets." >&4
8673 for net in net socket
8675 if test -f /usr/lib/lib$net$_a; then
8676 ( ($nm $nm_opt /usr/lib/lib$net$_a | eval $nm_extract) || \
8677 $ar t /usr/lib/lib$net$_a) 2>/dev/null >> libc.list
8678 if $contains socket libc.list >/dev/null 2>&1; then
8683 echo "...but the Wollongong group seems to have hacked it in." >&4
8684 sockethdr="-I/usr/netinclude"
8687 echo "Found Berkeley sockets interface in lib$net." >& 4
8688 if $contains setsockopt libc.list >/dev/null 2>&1; then
8691 echo "...using the old BSD 4.1c interface, rather than 4.2." >&4
8698 if test "X$d_socket" != "X$define"; then
8699 echo "or anywhere else I see." >&4
8707 : see if socketpair exists
8708 set socketpair d_sockpair
8713 echo "Checking the availability of certain socket constants..." >& 4
8714 for ENUM in MSG_CTRUNC MSG_DONTROUTE MSG_OOB MSG_PEEK MSG_PROXY SCM_RIGHTS; do
8715 enum=`$echo $ENUM|./tr '[A-Z]' '[a-z]'`
8717 #include <sys/types.h>
8718 #include <sys/socket.h>
8724 set try; if eval $compile; then
8727 set d_${enum}; eval $setvar
8731 : see if sys/select.h has to be included
8732 set sys/select.h i_sysselct
8735 : see if we should include time.h, sys/time.h, or both
8737 if test "X$timeincl" = X; then
8738 echo "Testing to see if we should include <time.h>, <sys/time.h> or both." >&4
8739 $echo $n "I'm now running the test program...$c"
8740 $cat >try.c <<'EOCP'
8741 #include <sys/types.h>
8746 #ifdef SYSTIMEKERNEL
8749 #include <sys/time.h>
8752 #include <sys/select.h>
8761 struct timezone tzp;
8763 if (foo.tm_sec == foo.tm_sec)
8766 if (bar.tv_sec == bar.tv_sec)
8773 for s_timezone in '-DS_TIMEZONE' ''; do
8775 for s_timeval in '-DS_TIMEVAL' ''; do
8776 for i_systimek in '' '-DSYSTIMEKERNEL'; do
8777 for i_time in '' '-DI_TIME'; do
8778 for i_systime in '-DI_SYSTIME' ''; do
8781 set try $i_time $i_systime $i_systimek $sysselect $s_timeval $s_timezone
8782 if eval $compile; then
8783 set X $i_time $i_systime $i_systimek $sysselect $s_timeval
8787 $echo $n "Succeeded with $flags$c"
8799 *SYSTIMEKERNEL*) i_systimek="$define"
8800 timeincl=`./findhdr sys/time.h`
8801 echo "We'll include <sys/time.h> with KERNEL defined." >&4;;
8802 *) i_systimek="$undef";;
8805 *I_TIME*) i_time="$define"
8806 timeincl=`./findhdr time.h`" $timeincl"
8807 echo "We'll include <time.h>." >&4;;
8808 *) i_time="$undef";;
8811 *I_SYSTIME*) i_systime="$define"
8812 timeincl=`./findhdr sys/time.h`" $timeincl"
8813 echo "We'll include <sys/time.h>." >&4;;
8814 *) i_systime="$undef";;
8819 : check for fd_set items
8822 Checking to see how well your C compiler handles fd_set and friends ...
8824 $cat >fd_set.c <<EOCP
8825 #$i_systime I_SYS_TIME
8826 #$i_sysselct I_SYS_SELECT
8827 #$d_socket HAS_SOCKET
8828 #include <sys/types.h>
8830 #include <sys/socket.h> /* Might include <sys/bsdtypes.h> */
8833 #include <sys/time.h>
8836 #include <sys/select.h>
8845 #if defined(FD_SET) && defined(FD_CLR) && defined(FD_ISSET) && defined(FD_ZERO)
8852 set fd_set -DTRYBITS
8853 if eval $compile; then
8854 d_fds_bits="$define"
8856 echo "Well, your system knows about the normal fd_set typedef..." >&4
8858 echo "and you have the normal fd_set macros (just as I'd expect)." >&4
8859 d_fd_macros="$define"
8862 but not the normal fd_set macros! Gaaack! I'll have to cover for you.
8864 d_fd_macros="$undef"
8868 Hmm, your compiler has some difficulty with fd_set. Checking further...
8871 if eval $compile; then
8874 echo "Well, your system has some sort of fd_set available..." >&4
8876 echo "and you have the normal fd_set macros." >&4
8877 d_fd_macros="$define"
8880 but not the normal fd_set macros! Gross! More work for me...
8882 d_fd_macros="$undef"
8885 echo "Well, you got zip. That's OK, I can roll my own fd_set stuff." >&4
8888 d_fd_macros="$undef"
8893 : see if fgetpos exists
8894 set fgetpos d_fgetpos
8897 : see if flock exists
8901 : see if fork exists
8905 : see if pathconf exists
8906 set pathconf d_pathconf
8909 : see if fpathconf exists
8910 set fpathconf d_fpathconf
8914 : check for fpos64_t
8916 echo "Checking to see if you have fpos64_t..." >&4
8919 int main() { fpos64_t x = 7; }
8922 if eval $compile; then
8924 echo "You have fpos64_t."
8927 echo "You do not have fpos64_t."
8929 8) echo "(Your fpos_t is 64 bits, so you could use that.)" ;;
8936 hasstruct='varname=$1; struct=$2; shift; shift;
8937 while $test $# -ge 2; do
8939 $define) echo "#include <$2>";;
8943 echo "int main () { struct $struct foo; }" >> try.c;
8945 if eval $compile; then
8954 : see if this is a sys/param system
8955 set sys/param.h i_sysparam
8958 : see if this is a sys/mount.h system
8959 set sys/mount.h i_sysmount
8962 : see if sys/types.h has to be included
8963 set sys/types.h i_systypes
8968 echo "Checking to see if your system supports struct fs_data..." >&4
8969 set d_fs_data_s fs_data $i_systypes sys/types.h $i_sysparam sys/param.h $i_sysmount sys/mount.h
8971 case "$d_fs_data_s" in
8972 "$define") echo "Yes, it does." ;;
8973 *) echo "No, it doesn't." ;;
8976 : see if fseeko exists
8980 8) echo "(Your long is 64 bits, so you could use fseek.)" ;;
8983 : see if fsetpos exists
8984 set fsetpos d_fsetpos
8988 : see if fstatfs exists
8989 set fstatfs d_fstatfs
8993 : see if statvfs exists
8994 set statvfs d_statvfs
8997 : see if fstatvfs exists
8998 set fstatvfs d_fstatvfs
9002 : see if ftello exists
9006 8) echo "(Your long is 64 bits, so you could use ftell.)" ;;
9009 : see if getcwd exists
9014 : see if getfsstat exists
9015 set getfsstat d_getfsstat
9018 : see if getgrent exists
9019 set getgrent d_getgrent
9022 : see if gethostbyaddr exists
9023 set gethostbyaddr d_gethbyaddr
9026 : see if gethostbyname exists
9027 set gethostbyname d_gethbyname
9030 : see if gethostent exists
9031 set gethostent d_gethent
9034 : see how we will look up host name
9037 if set gethostname val -f d_gethname; eval $csym; $val; then
9038 echo 'gethostname() found.' >&4
9039 d_gethname="$define"
9042 if set uname val -f d_uname; eval $csym; $val; then
9045 uname() was found, but you're running xenix, and older versions of xenix
9046 have a broken uname(). If you don't really know whether your xenix is old
9047 enough to have a broken system call, use the default answer.
9054 rp='Is your uname() broken?'
9057 n*) d_uname="$define"; call=uname;;
9060 echo 'uname() found.' >&4
9067 case "$d_gethname" in
9068 '') d_gethname="$undef";;
9071 '') d_uname="$undef";;
9073 case "$d_uname$d_gethname" in
9078 Every now and then someone has a $call() that lies about the hostname
9079 but can't be fixed for political or economic reasons. If you wish, I can
9080 pretend $call() isn't there and maybe compute hostname at run-time
9081 thanks to the '$phostname' command.
9084 rp="Shall I ignore $call() from now on?"
9087 y*) d_uname="$undef" d_gethname="$undef"; $echo $n "Okay...$c";;
9090 case "$phostname" in
9092 *) case "$aphostname" in
9098 file=`./loc $file $file $pth`
9099 aphostname=`echo $file $*`
9104 case "$d_uname$d_gethname" in
9107 case "$phostname" in
9109 echo "There will be no way for $package to get your hostname." >&4;;
9111 echo "I'll use 'popen("'"'$aphostname'", "r")'"' to get your hostname." >&4
9115 case "$d_phostname" in
9116 '') d_phostname="$undef";;
9119 : see if this is a netdb.h system
9123 : see if prototypes for various gethostxxx netdb.h functions are available
9125 set d_gethostprotos gethostent $i_netdb netdb.h
9128 : see if getlogin exists
9129 set getlogin d_getlogin
9132 : see if getmnt exists
9136 : see if getmntent exists
9137 set getmntent d_getmntent
9140 : see if getnetbyaddr exists
9141 set getnetbyaddr d_getnbyaddr
9144 : see if getnetbyname exists
9145 set getnetbyname d_getnbyname
9148 : see if getnetent exists
9149 set getnetent d_getnent
9152 : see if prototypes for various getnetxxx netdb.h functions are available
9154 set d_getnetprotos getnetent $i_netdb netdb.h
9158 : see if getprotobyname exists
9159 set getprotobyname d_getpbyname
9162 : see if getprotobynumber exists
9163 set getprotobynumber d_getpbynumber
9166 : see if getprotoent exists
9167 set getprotoent d_getpent
9170 : see if getpgid exists
9171 set getpgid d_getpgid
9174 : see if getpgrp2 exists
9175 set getpgrp2 d_getpgrp2
9178 : see if getppid exists
9179 set getppid d_getppid
9182 : see if getpriority exists
9183 set getpriority d_getprior
9186 : see if prototypes for various getprotoxxx netdb.h functions are available
9188 set d_getprotoprotos getprotoent $i_netdb netdb.h
9191 : see if getpwent exists
9192 set getpwent d_getpwent
9196 : see if getservbyname exists
9197 set getservbyname d_getsbyname
9200 : see if getservbyport exists
9201 set getservbyport d_getsbyport
9204 : see if getservent exists
9205 set getservent d_getsent
9208 : see if prototypes for various getservxxx netdb.h functions are available
9210 set d_getservprotos getservent $i_netdb netdb.h
9213 : see if getspent exists
9214 set getspent d_getspent
9217 : see if getspnam exists
9218 set getspnam d_getspnam
9221 : see if gettimeofday or ftime exists
9222 set gettimeofday d_gettimeod
9224 case "$d_gettimeod" in
9230 val="$undef"; set d_ftime; eval $setvar
9233 case "$d_gettimeod$d_ftime" in
9236 echo 'No ftime() nor gettimeofday() -- timing may be less accurate.' >&4
9240 : see if this is an grp system
9246 xxx=`./findhdr grp.h`
9247 $cppstdin $cppflags $cppminus < $xxx >$$.h
9249 if $contains 'gr_passwd' $$.h >/dev/null 2>&1; then
9261 set d_grpasswd; eval $setvar
9265 : see if hasmntopt exists
9266 set hasmntopt d_hasmntopt
9269 : see if this is a netinet/in.h or sys/in.h system
9270 set netinet/in.h i_niin sys/in.h i_sysin
9273 : see if arpa/inet.h has to be included
9274 set arpa/inet.h i_arpainet
9277 : see if htonl --and friends-- exists
9282 : Maybe they are macros.
9287 #include <sys/types.h>
9288 #$i_niin I_NETINET_IN
9290 #$i_arpainet I_ARPA_INET
9292 #include <netinet/in.h>
9298 #include <arpa/inet.h>
9301 printf("Defined as a macro.");
9304 $cppstdin $cppflags $cppminus < htonl.c >htonl.E 2>/dev/null
9305 if $contains 'Defined as a macro' htonl.E >/dev/null 2>&1; then
9307 echo "But it seems to be defined as a macro." >&4
9315 : see if iconv exists
9321 if set index val -f; eval $csym; $val; then
9322 if set strchr val -f d_strchr; eval $csym; $val; then
9323 if $contains strchr "$strings" >/dev/null 2>&1 ; then
9326 echo "strchr() found." >&4
9330 echo "index() found." >&4
9335 echo "index() found." >&4
9338 if set strchr val -f d_strchr; eval $csym; $val; then
9341 echo "strchr() found." >&4
9343 echo "No index() or strchr() found!" >&4
9348 set d_strchr; eval $setvar
9350 set d_index; eval $setvar
9352 : check whether inet_aton exists
9353 set inet_aton d_inetaton
9356 : see if inttypes.h is available
9357 : we want a real compile instead of Inhdr because some systems
9358 : have an inttypes.h which includes non-existent headers
9361 #include <inttypes.h>
9363 static int32_t foo32 = 0x12345678;
9367 if eval $compile; then
9368 echo "<inttypes.h> found." >&4
9371 echo "<inttypes.h> NOT found." >&4
9380 echo "Checking to see if you have int64_t..." >&4
9382 #include <sys/types.h>
9383 #$i_inttypes I_INTTYPES
9385 #include <inttypes.h>
9387 int main() { int64_t x = 7; }
9390 if eval $compile; then
9392 echo "You have int64_t."
9395 echo "You do not have int64_t."
9403 $cat >isascii.c <<'EOCP'
9415 if eval $compile; then
9416 echo "isascii() found." >&4
9419 echo "isascii() NOT found." >&4
9426 : see if killpg exists
9430 : see if lchown exists
9432 $cat > try.c <<'EOCP'
9433 /* System header to define __stub macros and hopefully few prototypes,
9434 which can conflict with char lchown(); below. */
9436 /* Override any gcc2 internal prototype to avoid an error. */
9437 /* We use char because int might match the return type of a gcc2
9438 builtin and then its argument prototype would still apply. */
9441 /* The GNU C library defines this for functions which it implements
9442 to always fail with ENOSYS. Some functions are actually named
9443 something starting with __ and the normal name is an alias. */
9444 #if defined (__stub_lchown) || defined (__stub___lchown)
9452 if eval $compile; then
9453 $echo "lchown() found." >&4
9456 $echo "lchown() NOT found." >&4
9462 : See if number of significant digits in a double precision number is known
9464 $cat >ldbl_dig.c <<EOM
9474 printf("Contains LDBL_DIG");
9477 $cppstdin $cppflags $cppminus < ldbl_dig.c >ldbl_dig.E 2>/dev/null
9478 if $contains 'LDBL_DIG' ldbl_dig.E >/dev/null 2>&1; then
9479 echo "LDBL_DIG found." >&4
9482 echo "LDBL_DIG NOT found." >&4
9489 : see if link exists
9493 : see if localeconv exists
9494 set localeconv d_locconv
9497 : see if lockf exists
9501 : check for long long
9503 echo "Checking to see if you have long long..." >&4
9504 echo 'int main() { long long x = 7; return 0; }' > try.c
9506 if eval $compile; then
9508 echo "You have have long long."
9511 echo "You do not have long long."
9517 : check for length of long long
9518 case "${d_longlong}${longlongsize}" in
9521 echo "Checking to see how big your long longs are..." >&4
9522 $cat >try.c <<'EOCP'
9526 printf("%d\n", (int)sizeof(long long));
9531 if eval $compile_ok; then
9532 longlongsize=`./try$exe_ext`
9533 echo "Your long longs are $longlongsize bytes long."
9537 echo "(I can't seem to compile the test program. Guessing...)"
9538 rp="What is the size of a long long (in bytes)?"
9542 if $test "X$longsize" = "X$longlongsize"; then
9543 echo "(That isn't any different from an ordinary long.)"
9549 : see if prototype for lseek is available
9551 set d_lseekproto lseek $i_systypes sys/types.h $i_unistd unistd.h
9554 : see if lstat exists
9558 : see if mblen exists
9562 : see if mbstowcs exists
9563 set mbstowcs d_mbstowcs
9566 : see if mbtowc exists
9570 : see if memchr exists
9574 : see if memcmp exists
9578 : see if memcpy exists
9582 : see if memmove exists
9583 set memmove d_memmove
9586 : see if memset exists
9590 : see if mkdir exists
9594 : see if mkdtemp exists
9595 set mkdtemp d_mkdtemp
9598 : see if mkfifo exists
9602 : see if mkstemp exists
9603 set mkstemp d_mkstemp
9606 : see if mkstemps exists
9607 set mkstemps d_mkstemps
9610 : see if mktime exists
9614 : see if this is a sys/mman.h system
9615 set sys/mman.h i_sysmman
9618 : see if mmap exists
9621 : see what shmat returns
9622 : default to something harmless
9624 case "$i_sysmman$d_mmap" in
9626 $cat >mmap.c <<'END'
9627 #include <sys/mman.h>
9630 if $cc $ccflags -c mmap.c >/dev/null 2>&1; then
9635 echo "and it returns ($mmaptype)." >&4
9641 : see if mprotect exists
9642 set mprotect d_mprotect
9645 : see if msgctl exists
9649 : see if msgget exists
9653 : see if msgsnd exists
9657 : see if msgrcv exists
9661 : see how much of the 'msg*(2)' library is present.
9664 case "$d_msgctl$d_msgget$d_msgsnd$d_msgrcv" in
9665 *"$undef"*) h_msg=false;;
9669 case "`ipcs 2>&1`" in
9670 "SVID messages"*"not configured"*)
9671 echo "Your $osname does not have the msg*(2) configured." >&4
9686 : we could also check for sys/ipc.h ...
9687 if $h_msg && $test `./findhdr sys/msg.h`; then
9688 echo "You have the full msg*(2) library." >&4
9691 echo "You don't have the full msg*(2) library." >&4
9697 : see if msync exists
9701 : see if munmap exists
9705 : see if nice exists
9711 echo "Checking which 64-bit integer type we could use..." >&4
9717 val='"unsigned int"'
9722 *) case "$longsize" in
9726 val='"unsigned long"'
9731 *) case "$d_longlong:$longlongsize" in
9736 val='"unsigned long long"'
9741 *) case "$d_int64_t" in
9760 '') echo "Alas, no 64-bit integer types in sight." >&4
9763 *) if test X"$use64bits" = Xdefine -o X"$longsize" = X8; then
9768 echo "We $verb use '$quadtype' for 64-bit integers." >&4
9773 : check for length of character
9777 echo "Checking to see how big your characters are (hey, you never know)..." >&4
9778 $cat >try.c <<'EOCP'
9782 printf("%d\n", (int)sizeof(char));
9787 if eval $compile_ok; then
9791 echo "(I can't seem to compile the test program. Guessing...)"
9798 rp="What is the size of a character (in bytes)?"
9805 $echo "Choosing the C types to be used for Perl's internal types..." >&4
9807 case "$use64bits:$d_quad:$quadtype" in
9815 uvtype="unsigned long"
9821 case "$uselongdouble:$d_longdbl" in
9823 nvtype="long double"
9831 $echo "(IV will be "$ivtype", $ivsize bytes)"
9832 $echo "(UV will be "$uvtype", $uvsize bytes)"
9833 $echo "(NV will be "$nvtype", $nvsize bytes)"
9836 #$i_inttypes I_INTTYPES
9838 #include <inttypes.h>
9843 int8_t i = INT8_MAX;
9844 uint8_t u = UINT8_MAX;
9848 int16_t i = INT16_MAX;
9849 uint16_t i = UINT16_MAX;
9850 printf("int16_t\n");
9853 int32_t i = INT32_MAX;
9854 uint32_t u = UINT32_MAX;
9855 printf("int32_t\n");
9861 '') case "$charsize" in
9863 u8type="unsigned char"
9872 if eval $compile; then
9873 case "`./try$exe_ext`" in
9874 int8_t) i8type=int8_t
9884 '') if $test $charsize -ge 1; then
9886 u8type="unsigned char"
9894 '') case "$shortsize" in
9896 u16type="unsigned short"
9905 if eval $compile; then
9906 case "`./try$exe_ext`" in
9918 '') if $test $shortsize -ge 2; then
9920 u16type="unsigned short"
9928 '') case "$longsize" in
9930 u32type="unsigned long"
9934 *) case "$intsize" in
9936 u32type="unsigned int"
9947 if eval $compile; then
9948 case "`./try$exe_ext`" in
9960 '') if $test $intsize -ge 4; then
9962 u32type="unsigned int"
9970 '') case "$d_quad:$quadtype" in
9973 u64type="$uquadtype"
9981 $echo "Checking whether your NVs can preserve your UVs..." >&4
9985 $uvtype k = ($uvtype)~0, l;
9991 printf("preserve\n");
9996 if eval $compile; then
9997 case "`./try$exe_ext`" in
9998 preserve) d_nv_preserves_uv="$define" ;;
10001 case "$d_nv_preserves_uv" in
10002 $define) $echo "Yes, they can." 2>&1 ;;
10003 *) $echo "No, they can't." 2>&1
10004 d_nv_preserves_uv="$undef"
10011 : check for off64_t
10013 echo "Checking to see if you have off64_t..." >&4
10015 #include <sys/types.h>
10016 #include <unistd.h>
10017 int main() { off64_t x = 7; }
10020 if eval $compile; then
10022 echo "You have off64_t."
10025 echo "You do not have off64_t."
10026 case "$lseeksize" in
10027 8) echo "(Your off_t is 64 bits, so you could use that.)" ;;
10034 : see if POSIX threads are available
10035 set pthread.h i_pthread
10041 : how to create joinable pthreads
10042 if test "X$usethreads" = "X$define" -a "X$i_pthread" = "X$define"; then
10044 echo "Checking what constant to use for creating joinable pthreads..." >&4
10045 $cat >try.c <<'EOCP'
10046 #include <pthread.h>
10048 int detachstate = JOINABLE;
10051 set try -DJOINABLE=PTHREAD_CREATE_JOINABLE
10052 if eval $compile; then
10053 echo "You seem to use PTHREAD_CREATE_JOINABLE." >&4
10054 val="$undef" # Yes, undef.
10055 set d_old_pthread_create_joinable
10058 set old_pthread_create_joinable
10061 set try -DJOINABLE=PTHREAD_CREATE_UNDETACHED
10062 if eval $compile; then
10063 echo "You seem to use PTHREAD_CREATE_UNDETACHED." >&4
10065 set d_old_pthread_create_joinable
10067 val=PTHREAD_CREATE_UNDETACHED
10068 set old_pthread_create_joinable
10071 set try -DJOINABLE=__UNDETACHED
10072 if eval $compile; then
10073 echo "You seem to use __UNDETACHED." >&4
10075 set d_old_pthread_create_joinable
10078 set old_pthread_create_joinable
10081 echo "Egads, nothing obvious found. Guessing that you use 0." >&4
10083 set d_old_pthread_create_joinable
10086 set old_pthread_create_joinable
10093 d_old_pthread_create_joinable="$undef"
10094 old_pthread_create_joinable=""
10097 : see if pause exists
10101 : see if pipe exists
10105 : see if poll exists
10110 : see whether the various POSIXish _yields exist
10112 #include <pthread.h>
10118 #ifdef PTHREAD_YIELD
10121 #ifdef PTHREAD_YIELD_NULL
10122 pthread_yield(NULL);
10128 : see if sched_yield exists
10129 set try -DSCHED_YIELD
10130 if eval $compile; then
10132 sched_yield='sched_yield()'
10136 case "$usethreads" in
10139 $define) echo 'sched_yield() found.' >&4 ;;
10140 *) echo 'sched_yield() NOT found.' >&4 ;;
10146 : see if pthread_yield exists
10147 set try -DPTHREAD_YIELD
10148 if eval $compile; then
10150 case "$sched_yield" in
10151 '') sched_yield='pthread_yield()' ;;
10154 set try -DPTHREAD_YIELD_NULL
10155 if eval $compile; then
10157 case "$sched_yield" in
10158 '') sched_yield='pthread_yield(NULL)' ;;
10164 case "$usethreads" in
10167 $define) echo 'pthread_yield() found.' >&4 ;;
10168 *) echo 'pthread_yield() NOT found.' >&4 ;;
10172 set d_pthread_yield
10175 case "$sched_yield" in
10176 '') sched_yield=undef ;;
10181 : see if this is a pwd.h system
10187 xxx=`./findhdr pwd.h`
10188 $cppstdin $cppflags $cppminus < $xxx >$$.h
10190 if $contains 'pw_quota' $$.h >/dev/null 2>&1; then
10198 if $contains 'pw_age' $$.h >/dev/null 2>&1; then
10206 if $contains 'pw_change' $$.h >/dev/null 2>&1; then
10214 if $contains 'pw_class' $$.h >/dev/null 2>&1; then
10222 if $contains 'pw_expire' $$.h >/dev/null 2>&1; then
10230 if $contains 'pw_comment' $$.h >/dev/null 2>&1; then
10238 if $contains 'pw_gecos' $$.h >/dev/null 2>&1; then
10246 if $contains 'pw_passwd' $$.h >/dev/null 2>&1; then
10258 set d_pwquota; eval $setvar
10259 set d_pwage; eval $setvar
10260 set d_pwchange; eval $setvar
10261 set d_pwclass; eval $setvar
10262 set d_pwexpire; eval $setvar
10263 set d_pwcomment; eval $setvar
10264 set d_pwgecos; eval $setvar
10265 set d_pwpasswd; eval $setvar
10269 : see if readdir and friends exist
10270 set readdir d_readdir
10272 set seekdir d_seekdir
10274 set telldir d_telldir
10276 set rewinddir d_rewinddir
10279 : see if readlink exists
10280 set readlink d_readlink
10283 : see if rename exists
10284 set rename d_rename
10287 : see if rmdir exists
10291 : see if memory.h is available.
10296 : See if it conflicts with string.h
10302 $cppstdin $cppflags $cppminus < $strings > mem.h
10303 if $contains 'memcpy' mem.h >/dev/null 2>&1; then
10305 echo "We won't be including <memory.h>."
10315 : can bcopy handle overlapping blocks?
10320 echo "Checking to see if your bcopy() can do overlapping copies..." >&4
10322 #$i_memory I_MEMORY
10323 #$i_stdlib I_STDLIB
10324 #$i_string I_STRING
10325 #$i_unistd I_UNISTD
10327 $cat >>try.c <<'EOCP'
10330 # include <memory.h>
10333 # include <stdlib.h>
10336 # include <string.h>
10338 # include <strings.h>
10341 # include <unistd.h> /* Needed for NetBSD */
10345 char buf[128], abc[128];
10351 bcopy("abcdefghijklmnopqrstuvwxyz0123456789", abc, 36);
10353 for (align = 7; align >= 0; align--) {
10354 for (len = 36; len; len--) {
10356 bcopy(abc, b, len);
10357 for (off = 1; off <= len; off++) {
10358 bcopy(b, b+off, len);
10359 bcopy(b+off, b, len);
10360 if (bcmp(b, abc, len))
10369 if eval $compile_ok; then
10370 if ./try 2>/dev/null; then
10371 echo "Yes, it can."
10374 echo "It can't, sorry."
10375 case "$d_memmove" in
10376 "$define") echo "But that's Ok since you have memmove()." ;;
10380 echo "(I can't compile the test program, so we'll assume not...)"
10381 case "$d_memmove" in
10382 "$define") echo "But that's Ok since you have memmove()." ;;
10387 $rm -f try.* try core
10391 : can memcpy handle overlapping blocks?
10393 case "$d_memcpy" in
10396 echo "Checking to see if your memcpy() can do overlapping copies..." >&4
10398 #$i_memory I_MEMORY
10399 #$i_stdlib I_STDLIB
10400 #$i_string I_STRING
10401 #$i_unistd I_UNISTD
10403 $cat >>try.c <<'EOCP'
10406 # include <memory.h>
10409 # include <stdlib.h>
10412 # include <string.h>
10414 # include <strings.h>
10417 # include <unistd.h> /* Needed for NetBSD */
10421 char buf[128], abc[128];
10427 /* Copy "abcde..." string to char abc[] so that gcc doesn't
10428 try to store the string in read-only memory. */
10429 memcpy(abc, "abcdefghijklmnopqrstuvwxyz0123456789", 36);
10431 for (align = 7; align >= 0; align--) {
10432 for (len = 36; len; len--) {
10434 memcpy(b, abc, len);
10435 for (off = 1; off <= len; off++) {
10436 memcpy(b+off, b, len);
10437 memcpy(b, b+off, len);
10438 if (memcmp(b, abc, len))
10447 if eval $compile_ok; then
10448 if ./try 2>/dev/null; then
10449 echo "Yes, it can."
10452 echo "It can't, sorry."
10453 case "$d_memmove" in
10454 "$define") echo "But that's Ok since you have memmove()." ;;
10458 echo "(I can't compile the test program, so we'll assume not...)"
10459 case "$d_memmove" in
10460 "$define") echo "But that's Ok since you have memmove()." ;;
10465 $rm -f try.* try core
10469 : can memcmp be trusted to compare relative magnitude?
10471 case "$d_memcmp" in
10474 echo "Checking if your memcmp() can compare relative magnitude..." >&4
10476 #$i_memory I_MEMORY
10477 #$i_stdlib I_STDLIB
10478 #$i_string I_STRING
10479 #$i_unistd I_UNISTD
10481 $cat >>try.c <<'EOCP'
10484 # include <memory.h>
10487 # include <stdlib.h>
10490 # include <string.h>
10492 # include <strings.h>
10495 # include <unistd.h> /* Needed for NetBSD */
10501 if ((a < b) && memcmp(&a, &b, 1) < 0)
10507 if eval $compile_ok; then
10508 if ./try 2>/dev/null; then
10509 echo "Yes, it can."
10512 echo "No, it can't (it uses signed chars)."
10515 echo "(I can't compile the test program, so we'll assume not...)"
10519 $rm -f try.* try core
10523 : see if select exists
10524 set select d_select
10527 : see if semctl exists
10528 set semctl d_semctl
10531 : see if semget exists
10532 set semget d_semget
10535 : see if semop exists
10539 : see how much of the 'sem*(2)' library is present.
10542 case "$d_semctl$d_semget$d_semop" in
10543 *"$undef"*) h_sem=false;;
10547 case "`ipcs 2>&1`" in
10548 "SVID messages"*"not configured"*)
10549 echo "Your $osname does not have the sem*(2) configured." >&4
10552 set semctl d_semctl
10554 set semget d_semget
10562 : we could also check for sys/ipc.h ...
10563 if $h_sem && $test `./findhdr sys/sem.h`; then
10564 echo "You have the full sem*(2) library." >&4
10567 echo "You don't have the full sem*(2) library." >&4
10573 : see whether sys/sem.h defines union semun
10575 $cat > try.c <<'END'
10576 #include <sys/types.h>
10577 #include <sys/ipc.h>
10578 #include <sys/sem.h>
10579 int main () { union semun semun; semun.buf = 0; }
10582 if eval $compile; then
10583 echo "You have union semun in <sys/sem.h>." >&4
10586 echo "You do not have union semun in <sys/sem.h>." >&4
10589 $rm -f try try.c try.h
10593 : see how to do semctl IPC_STAT
10596 : see whether semctl IPC_STAT can use union semun
10601 # define S_IRUSR S_IREAD
10602 # define S_IWUSR S_IWRITE
10603 # define S_IXUSR S_IEXEC
10605 # define S_IRUSR 0400
10606 # define S_IWUSR 0200
10607 # define S_IXUSR 0100
10609 # define S_IRGRP (S_IRUSR>>3)
10610 # define S_IWGRP (S_IWUSR>>3)
10611 # define S_IXGRP (S_IXUSR>>3)
10612 # define S_IROTH (S_IRUSR>>6)
10613 # define S_IWOTH (S_IWUSR>>6)
10614 # define S_IXOTH (S_IXUSR>>6)
10617 # define S_IRWXU (S_IRUSR|S_IWUSR|S_IXUSR)
10618 # define S_IRWXG (S_IRGRP|S_IWGRP|S_IXGRP)
10619 # define S_IRWXO (S_IROTH|S_IWOTH|S_IXOTH)
10624 #include <sys/types.h>
10625 #include <sys/ipc.h>
10626 #include <sys/sem.h>
10627 #include <sys/stat.h>
10634 #$d_union_semun HAS_UNION_SEMUN
10637 #ifndef HAS_UNION_SEMUN
10640 struct semid_ds *buf;
10641 unsigned short *array;
10647 #if defined(IPC_PRIVATE) && defined(S_IRWXU) && defined(S_IRWXG) && defined(S_IRWXO) && defined(IPC_CREAT)
10648 sem = semget(IPC_PRIVATE, 1, S_IRWXU|S_IRWXG|S_IRWXO|IPC_CREAT);
10650 struct semid_ds argbuf;
10653 st = semctl(sem, 0, IPC_STAT, arg);
10657 # endif /* IPC_STAT */
10658 printf("semctl IPC_STAT failed: errno = %d\n", errno);
10660 if (semctl(sem, 0, IPC_RMID, arg) != 0)
10661 # endif /* IPC_RMID */
10662 printf("semctl IPC_RMID failed: errno = %d\n", errno);
10664 #endif /* IPC_PRIVATE && ... */
10665 printf("semget failed: errno = %d\n", errno);
10671 if eval $compile; then
10674 semun) val="$define" ;;
10680 case "$d_semctl_semun" in
10682 echo "You can use union semun for semctl IPC_STAT." >&4
10685 *) echo "You cannot use union semun for semctl IPC_STAT." >&4
10690 : see whether semctl IPC_STAT can use struct semid_ds pointer
10691 $cat > try.c <<'END'
10692 #include <sys/types.h>
10693 #include <sys/ipc.h>
10694 #include <sys/sem.h>
10695 #include <sys/stat.h>
10703 struct semid_ds arg;
10706 #if defined(IPC_PRIVATE) && defined(S_IRWXU) && defined(S_IRWXG) && defined(S_IRWXO) && defined(IPC_CREAT)
10707 sem = semget(IPC_PRIVATE, 1, S_IRWXU|S_IRWXG|S_IRWXO|IPC_CREAT);
10710 st = semctl(sem, 0, IPC_STAT, &arg);
10712 printf("semid_ds\n");
10714 # endif /* IPC_STAT */
10715 printf("semctl IPC_STAT failed: errno = %d\n", errno);
10717 if (semctl(sem, 0, IPC_RMID, &arg) != 0)
10718 # endif /* IPC_RMID */
10719 printf("semctl IPC_RMID failed: errno = %d\n", errno);
10721 #endif /* IPC_PRIVATE && ... */
10722 printf("semget failed: errno = %d\n", errno);
10729 if eval $compile; then
10732 semid_ds) val="$define" ;;
10736 set d_semctl_semid_ds
10738 case "$d_semctl_semid_ds" in
10740 echo "You can $also use struct semid_ds* for semctl IPC_STAT." >&4
10742 *) echo "You cannot use struct semid_ds* for semctl IPC_STAT." >&4
10749 # We do not have the full sem*(2) library, so assume we can not
10755 set d_semctl_semid_ds
10760 : see if setegid exists
10761 set setegid d_setegid
10764 : see if seteuid exists
10765 set seteuid d_seteuid
10768 : see if setgrent exists
10769 set setgrent d_setgrent
10772 : see if sethostent exists
10773 set sethostent d_sethent
10776 : see if setlinebuf exists
10777 set setlinebuf d_setlinebuf
10780 : see if setlocale exists
10781 set setlocale d_setlocale
10784 : see if setnetent exists
10785 set setnetent d_setnent
10788 : see if setprotoent exists
10789 set setprotoent d_setpent
10792 : see if setpgid exists
10793 set setpgid d_setpgid
10796 : see if setpgrp2 exists
10797 set setpgrp2 d_setpgrp2
10800 : see if setpriority exists
10801 set setpriority d_setprior
10804 : see if setpwent exists
10805 set setpwent d_setpwent
10808 : see if setregid exists
10809 set setregid d_setregid
10811 set setresgid d_setresgid
10814 : see if setreuid exists
10815 set setreuid d_setreuid
10817 set setresuid d_setresuid
10820 : see if setrgid exists
10821 set setrgid d_setrgid
10824 : see if setruid exists
10825 set setruid d_setruid
10828 : see if setservent exists
10829 set setservent d_setsent
10832 : see if setsid exists
10833 set setsid d_setsid
10836 : see if setspent exists
10837 set setspent d_setspent
10840 : see if setvbuf exists
10841 set setvbuf d_setvbuf
10844 : see if sfio.h is available
10849 : see if sfio library is available
10860 : Ok, but do we want to use it.
10864 true|$define|[yY]*) dflt='y';;
10867 echo "$package can use the sfio library, but it is experimental."
10868 rp="You seem to have sfio available, do you want to try using it?"
10872 *) echo "Ok, avoiding sfio this time. I'll use stdio instead."
10874 : Remove sfio from list of libraries to use
10875 set `echo X $libs | $sed -e 's/-lsfio / /' -e 's/-lsfio$//'`
10878 echo "libs = $libs" >&4
10882 *) case "$usesfio" in
10883 true|$define|[yY]*)
10884 echo "Sorry, cannot find sfio on this machine" >&4
10885 echo "Ignoring your setting of usesfio=$usesfio" >&4
10893 $define) usesfio='true';;
10894 *) usesfio='false';;
10897 : see if shmctl exists
10898 set shmctl d_shmctl
10901 : see if shmget exists
10902 set shmget d_shmget
10905 : see if shmat exists
10908 : see what shmat returns
10911 $cat >shmat.c <<'END'
10912 #include <sys/shm.h>
10915 if $cc $ccflags -c shmat.c >/dev/null 2>&1; then
10920 echo "and it returns ($shmattype)." >&4
10921 : see if a prototype for shmat is available
10922 xxx=`./findhdr sys/shm.h`
10923 $cppstdin $cppflags $cppminus < $xxx > shmat.c 2>/dev/null
10924 if $contains 'shmat.*(' shmat.c >/dev/null 2>&1; then
10935 set d_shmatprototype
10938 : see if shmdt exists
10942 : see how much of the 'shm*(2)' library is present.
10945 case "$d_shmctl$d_shmget$d_shmat$d_shmdt" in
10946 *"$undef"*) h_shm=false;;
10950 case "`ipcs 2>&1`" in
10951 "SVID shared memory"*"not configured"*)
10952 echo "Your $osname does not have the shm*(2) configured." >&4
10955 set shmctl d_shmctl
10957 set shmget d_shmget
10967 : we could also check for sys/ipc.h ...
10968 if $h_shm && $test `./findhdr sys/shm.h`; then
10969 echo "You have the full shm*(2) library." >&4
10972 echo "You don't have the full shm*(2) library." >&4
10979 : see if we have sigaction
10980 if set sigaction val -f d_sigaction; eval $csym; $val; then
10981 echo 'sigaction() found.' >&4
10982 $cat > try.c <<'EOP'
10984 #include <sys/types.h>
10985 #include <signal.h>
10988 struct sigaction act, oact;
10990 oact.sa_handler = 0;
10991 /* so that act and oact are used */
10992 exit(act.sa_flags == 0 && oact.sa_handler == 0);
10996 if eval $compile_ok; then
10999 echo "But you don't seem to have a useable struct sigaction." >&4
11003 echo 'sigaction NOT found.' >&4
11006 set d_sigaction; eval $setvar
11007 $rm -f try try$_o try.c
11009 : see if sigsetjmp exists
11011 case "$d_sigsetjmp" in
11013 $cat >try.c <<'EOP'
11014 #include <setjmp.h>
11019 if (sigsetjmp(env,1))
11022 siglongjmp(env, 1);
11027 if eval $compile; then
11028 if ./try >/dev/null 2>&1; then
11029 echo "POSIX sigsetjmp found." >&4
11033 Uh-Oh! You have POSIX sigsetjmp and siglongjmp, but they do not work properly!!
11039 echo "sigsetjmp not found." >&4
11043 *) val="$d_sigsetjmp"
11044 case "$d_sigsetjmp" in
11045 $define) echo "POSIX sigsetjmp found." >&4;;
11046 $undef) echo "sigsetjmp not found." >&4;;
11054 : see if sys/stat.h is available
11055 set sys/stat.h i_sysstat
11059 : see if stat knows about block sizes
11061 echo "Checking to see if your struct stat has st_blocks field..." >&4
11062 set d_statblks stat st_blocks $i_sysstat sys/stat.h
11066 : see if this is a sys/vfs.h system
11067 set sys/vfs.h i_sysvfs
11071 : see if this is a sys/statfs.h system
11072 set sys/statfs.h i_sysstatfs
11077 echo "Checking to see if your system supports struct statfs..." >&4
11078 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
11080 case "$d_statfs_s" in
11081 "$define") echo "Yes, it does." ;;
11082 *) echo "No, it doesn't." ;;
11087 : see if struct statfs knows about f_flags
11088 case "$d_statfs_s" in
11091 echo "Checking to see if your struct statfs has f_flags field..." >&4
11092 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
11096 set d_statfs_f_flags
11100 case "$d_statfs_f_flags" in
11101 "$define") echo "Yes, it does." ;;
11102 *) echo "No, it doesn't." ;;
11105 : see if _ptr and _cnt from stdio act std
11107 if $contains '_IO_fpos_t' `./findhdr stdio.h` `./findhdr libio.h` >/dev/null 2>&1 ; then
11108 echo "(Looks like you have stdio.h from Linux.)"
11109 case "$stdio_ptr" in
11110 '') stdio_ptr='((fp)->_IO_read_ptr)'
11113 *) ptr_lval=$d_stdio_ptr_lval;;
11115 case "$stdio_cnt" in
11116 '') stdio_cnt='((fp)->_IO_read_end - (fp)->_IO_read_ptr)'
11119 *) cnt_lval=$d_stdio_cnt_lval;;
11121 case "$stdio_base" in
11122 '') stdio_base='((fp)->_IO_read_base)';;
11124 case "$stdio_bufsiz" in
11125 '') stdio_bufsiz='((fp)->_IO_read_end - (fp)->_IO_read_base)';;
11128 case "$stdio_ptr" in
11129 '') stdio_ptr='((fp)->_ptr)'
11132 *) ptr_lval=$d_stdio_ptr_lval;;
11134 case "$stdio_cnt" in
11135 '') stdio_cnt='((fp)->_cnt)'
11138 *) cnt_lval=$d_stdio_cnt_lval;;
11140 case "$stdio_base" in
11141 '') stdio_base='((fp)->_base)';;
11143 case "$stdio_bufsiz" in
11144 '') stdio_bufsiz='((fp)->_cnt + (fp)->_ptr - (fp)->_base)';;
11147 : test whether _ptr and _cnt really work
11148 echo "Checking how std your stdio is..." >&4
11151 #define FILE_ptr(fp) $stdio_ptr
11152 #define FILE_cnt(fp) $stdio_cnt
11154 FILE *fp = fopen("try.c", "r");
11157 18 <= FILE_cnt(fp) &&
11158 strncmp(FILE_ptr(fp), "include <stdio.h>\n", 18) == 0
11166 if eval $compile; then
11168 echo "Your stdio acts pretty std."
11171 echo "Your stdio isn't very std."
11174 echo "Your stdio doesn't appear very std."
11180 : Can _ptr be used as an lvalue?
11181 case "$d_stdstdio$ptr_lval" in
11182 $define$define) val=$define ;;
11185 set d_stdio_ptr_lval
11188 : Can _cnt be used as an lvalue?
11189 case "$d_stdstdio$cnt_lval" in
11190 $define$define) val=$define ;;
11193 set d_stdio_cnt_lval
11196 : see if _base is also standard
11198 case "$d_stdstdio" in
11202 #define FILE_base(fp) $stdio_base
11203 #define FILE_bufsiz(fp) $stdio_bufsiz
11205 FILE *fp = fopen("try.c", "r");
11208 19 <= FILE_bufsiz(fp) &&
11209 strncmp(FILE_base(fp), "#include <stdio.h>\n", 19) == 0
11216 if eval $compile; then
11218 echo "And its _base field acts std."
11221 echo "But its _base field isn't std."
11224 echo "However, it seems to be lacking the _base field."
11233 Checking how to access stdio streams by file descriptor number...
11235 case "$stdio_stream_array" in
11236 '') $cat >try.c <<EOCP
11239 if (&STDIO_STREAM_ARRAY[fileno(stdin)] == stdin)
11243 for s in _iob __iob __sF
11245 set try -DSTDIO_STREAM_ARRAY=$s
11246 if eval $compile; then
11247 case "`./try$exe_ext`" in
11248 yes) stdio_stream_array=$s; break ;;
11252 $rm -f try.* try$exe_ext
11254 case "$stdio_stream_array" in
11256 I can't figure out how to access stdio streams by file descriptor number.
11258 d_stdio_stream_array="$undef"
11261 You can access stdio streams by file descriptor number by the $stdio_stream_array array.
11263 d_stdio_stream_array="$define"
11267 : see if strcoll exists
11268 set strcoll d_strcoll
11271 : check for structure copying
11273 echo "Checking to see if your C compiler can copy structs..." >&4
11274 $cat >try.c <<'EOCP'
11284 if $cc -c try.c >/dev/null 2>&1 ; then
11286 echo "Yup, it can."
11289 echo "Nope, it can't."
11295 : see if strerror and/or sys_errlist[] exist
11297 if test "X$d_strerror" = X -o "X$d_syserrlst" = X; then
11298 if set strerror val -f d_strerror; eval $csym; $val; then
11299 echo 'strerror() found.' >&4
11300 d_strerror="$define"
11301 d_strerrm='strerror(e)'
11302 if set sys_errlist val -a d_syserrlst; eval $csym; $val; then
11303 echo "(You also have sys_errlist[], so we could roll our own strerror.)"
11304 d_syserrlst="$define"
11306 echo "(Since you don't have sys_errlist[], sterror() is welcome.)"
11307 d_syserrlst="$undef"
11309 elif xxx=`./findhdr string.h`; test "$xxx" || xxx=`./findhdr strings.h`; \
11310 $contains '#[ ]*define.*strerror' "$xxx" >/dev/null 2>&1; then
11311 echo 'strerror() found in string header.' >&4
11312 d_strerror="$define"
11313 d_strerrm='strerror(e)'
11314 if set sys_errlist val -a d_syserrlst; eval $csym; $val; then
11315 echo "(Most probably, strerror() uses sys_errlist[] for descriptions.)"
11316 d_syserrlst="$define"
11318 echo "(You don't appear to have any sys_errlist[], how can this be?)"
11319 d_syserrlst="$undef"
11321 elif set sys_errlist val -a d_syserrlst; eval $csym; $val; then
11322 echo "strerror() not found, but you have sys_errlist[] so we'll use that." >&4
11323 d_strerror="$undef"
11324 d_syserrlst="$define"
11325 d_strerrm='((e)<0||(e)>=sys_nerr?"unknown":sys_errlist[e])'
11327 echo 'strerror() and sys_errlist[] NOT found.' >&4
11328 d_strerror="$undef"
11329 d_syserrlst="$undef"
11330 d_strerrm='"unknown"'
11334 : see if strtod exists
11335 set strtod d_strtod
11338 : see if strtol exists
11339 set strtol d_strtol
11342 : see if strtold exists
11343 set strtold d_strtold
11346 : see if strtoll exists
11347 set strtoll d_strtoll
11350 : see if strtoul exists
11351 set strtoul d_strtoul
11354 : see if strtoull exists
11355 set strtoull d_strtoull
11358 : see if strtouq exists
11359 set strtouq d_strtouq
11362 : see if strxfrm exists
11363 set strxfrm d_strxfrm
11366 : see if symlink exists
11367 set symlink d_symlink
11370 : see if syscall exists
11371 set syscall d_syscall
11374 : see if sysconf exists
11375 set sysconf d_sysconf
11378 : see if system exists
11379 set system d_system
11382 : see if tcgetpgrp exists
11383 set tcgetpgrp d_tcgetpgrp
11386 : see if tcsetpgrp exists
11387 set tcsetpgrp d_tcsetpgrp
11390 : see if prototype for telldir is available
11392 set d_telldirproto telldir $i_systypes sys/types.h $i_dirent dirent.h
11395 : see if this is a sys/times.h system
11396 set sys/times.h i_systimes
11399 : see if times exists
11401 if set times val -f d_times; eval $csym; $val; then
11402 echo 'times() found.' >&4
11405 case "$i_systimes" in
11406 "$define") inc='sys/times.h';;
11408 rp="What is the type returned by times() on this system?"
11409 set clock_t clocktype long stdio.h sys/types.h $inc
11412 echo 'times() NOT found, hope that will do.' >&4
11417 : see if truncate exists
11418 set truncate d_truncate
11421 : see if tzname[] exists
11423 if set tzname val -a d_tzname; eval $csym; $val; then
11425 echo 'tzname[] found.' >&4
11428 echo 'tzname[] NOT found.' >&4
11433 : see if umask exists
11437 : see if ustat exists
11441 : backward compatibility for d_hvfork
11442 if test X$d_hvfork != X; then
11443 d_vfork="$d_hvfork"
11446 : see if there is a vfork
11451 : Ok, but do we want to use it. vfork is reportedly unreliable in
11452 : perl on Solaris 2.x, and probably elsewhere.
11456 case "$usevfork" in
11462 Perl can only use a vfork() that doesn't suffer from strict
11463 restrictions on calling functions or modifying global data in
11464 the child. For example, glibc-2.1 contains such a vfork()
11465 that is unsuitable. If your system provides a proper fork()
11466 call, chances are that you do NOT want perl to use vfork().
11469 rp="Do you still want to use vfork()?"
11474 echo "Ok, we won't use vfork()."
11483 $define) usevfork='true';;
11484 *) usevfork='false';;
11487 : see if this is an sysdir system
11488 set sys/dir.h i_sysdir
11491 : see if this is an sysndir system
11492 set sys/ndir.h i_sysndir
11495 : see if closedir exists
11496 set closedir d_closedir
11499 case "$d_closedir" in
11502 echo "Checking whether closedir() returns a status..." >&4
11503 cat > closedir.c <<EOM
11504 #$i_dirent I_DIRENT /**/
11505 #$i_sysdir I_SYS_DIR /**/
11506 #$i_sysndir I_SYS_NDIR /**/
11507 #$i_systypes I_SYS_TYPES /**/
11509 #if defined(I_SYS_TYPES)
11510 #include <sys/types.h>
11512 #if defined(I_DIRENT)
11513 #include <dirent.h>
11514 #if defined(NeXT) && defined(I_SYS_DIR) /* NeXT needs dirent + sys/dir.h */
11515 #include <sys/dir.h>
11519 #include <sys/ndir.h>
11523 #include <ndir.h> /* may be wrong in the future */
11525 #include <sys/dir.h>
11530 int main() { return closedir(opendir(".")); }
11533 if eval $compile_ok; then
11534 if ./closedir > /dev/null 2>&1 ; then
11535 echo "Yes, it does."
11538 echo "No, it doesn't."
11542 echo "(I can't seem to compile the test program--assuming it doesn't)"
11550 set d_void_closedir
11553 : check for volatile keyword
11555 echo 'Checking to see if your C compiler knows about "volatile"...' >&4
11556 $cat >try.c <<'EOCP'
11559 typedef struct _goo_struct goo_struct;
11560 goo_struct * volatile goo = ((goo_struct *)0);
11561 struct _goo_struct {
11566 typedef unsigned short foo_t;
11567 char *volatile foo;
11569 volatile foo_t blech;
11573 if $cc -c $ccflags try.c >/dev/null 2>&1 ; then
11575 echo "Yup, it does."
11578 echo "Nope, it doesn't."
11584 : see if there is a wait4
11588 : see if waitpid exists
11589 set waitpid d_waitpid
11592 : see if wcstombs exists
11593 set wcstombs d_wcstombs
11596 : see if wctomb exists
11597 set wctomb d_wctomb
11600 : preserve RCS keywords in files with variable substitution, grrr
11605 Revision='$Revision'
11607 case "$crosscompile" in
11608 ''|[nN]*) crosscompile="$undef" ;;
11612 next|rhapsody) multiarch="$define" ;;
11614 case "$multiarch" in
11615 ''|[nN]*) multiarch="$undef" ;;
11618 : check for alignment requirements
11620 case "$crosscompile$multiarch" in
11623 You seem to be either cross-compiling or doing a multiarchitecture build,
11624 skipping the memory alignment check.
11627 case "$alignbytes" in
11628 '') alignbytes=8 ;;
11632 case "$alignbytes" in
11633 '') echo "Checking alignment constraints..." >&4
11634 if $test "X$uselongdouble" = Xdefine -a "X$d_longdbl" = Xdefine; then
11635 $cat >try.c <<'EOCP'
11636 typedef long double NV;
11639 $cat >try.c <<'EOCP'
11643 $cat >>try.c <<'EOCP'
11651 printf("%d\n", (int)((char *)&try_algn.bar - (char *)&try_algn.foo));
11656 if eval $compile_ok; then
11660 echo "(I can't seem to compile the test program...)"
11663 *) dflt="$alignbytes"
11666 rp="Doubles must be aligned on a how-many-byte boundary?"
11674 : set the base revision
11677 : check for ordering of bytes in a long
11679 case "$crosscompile$multiarch" in
11682 You seem to be either cross-compiling or doing a multiarchitecture build,
11683 skipping the byteorder check.
11689 case "$byteorder" in
11692 In the following, larger digits indicate more significance. A big-endian
11693 machine like a Pyramid or a Motorola 680?0 chip will come out to 4321. A
11694 little-endian machine like a Vax or an Intel 80?86 chip would be 1234. Other
11695 machines may have weird orders like 3412. A Cray will report 87654321,
11696 an Alpha will report 12345678. If the test program works the default is
11698 I'm now running the test program...
11700 $cat >try.c <<'EOCP'
11707 char c[sizeof(long)];
11710 if (sizeof(long) > 4)
11711 u.l = (0x08070605L << 32) | 0x04030201L;
11714 for (i = 0; i < sizeof(long); i++)
11715 printf("%c", u.c[i]+'0');
11722 if eval $compile && ./try > /dev/null; then
11725 [1-4][1-4][1-4][1-4]|12345678|87654321)
11726 echo "(The test program ran ok.)"
11727 echo "byteorder=$dflt"
11730 ????|????????) echo "(The test program ran ok.)" ;;
11731 *) echo "(The test program didn't run right for some reason.)" ;;
11736 (I can't seem to compile the test program. Guessing big-endian...)
11739 case "$xxx_prompt" in
11741 rp="What is the order of bytes in a long?"
11755 : how do we catenate cpp tokens here?
11757 echo "Checking to see how your cpp does stuff like catenate tokens..." >&4
11758 $cat >cpp_stuff.c <<'EOCP'
11759 #define RCAT(a,b)a/**/b
11760 #define ACAT(a,b)a ## b
11764 $cppstdin $cppflags $cppminus <cpp_stuff.c >cpp_stuff.out 2>&1
11765 if $contains 'Circus' cpp_stuff.out >/dev/null 2>&1; then
11766 echo "Oh! Smells like ANSI's been here." >&4
11767 echo "We can catify or stringify, separately or together!"
11769 elif $contains 'Reiser' cpp_stuff.out >/dev/null 2>&1; then
11770 echo "Ah, yes! The good old days!" >&4
11771 echo "However, in the good old days we don't know how to stringify and"
11772 echo "catify at the same time."
11776 Hmm, I don't seem to be able to catenate tokens with your cpp. You're going
11777 to have to edit the values of CAT[2-5] in config.h...
11779 cpp_stuff="/* Help! How do we handle cpp_stuff? */*/"
11783 : see if this is a db.h system
11789 : Check db version.
11791 echo "Checking Berkeley DB version ..." >&4
11797 #include <sys/types.h>
11802 #ifdef DB_VERSION_MAJOR /* DB version >= 2 */
11803 int Major, Minor, Patch ;
11804 unsigned long Version ;
11805 (void)db_version(&Major, &Minor, &Patch) ;
11806 printf("You have Berkeley DB Version 2 or greater\n");
11808 printf("db.h is from Berkeley DB Version %d.%d.%d\n",
11809 DB_VERSION_MAJOR, DB_VERSION_MINOR, DB_VERSION_PATCH);
11810 printf("libdb is from Berkeley DB Version %d.%d.%d\n",
11811 Major, Minor, Patch) ;
11813 /* check that db.h & libdb are compatible */
11814 if (DB_VERSION_MAJOR != Major || DB_VERSION_MINOR != Minor || DB_VERSION_PATCH != Patch) {
11815 printf("db.h and libdb are incompatible\n") ;
11819 printf("db.h and libdb are compatible\n") ;
11821 Version = DB_VERSION_MAJOR * 1000000 + DB_VERSION_MINOR * 1000
11822 + DB_VERSION_PATCH ;
11824 /* needs to be >= 2.3.4 */
11825 if (Version < 2003004) {
11826 /* if (DB_VERSION_MAJOR == 2 && DB_VERSION_MINOR == 0 && DB_VERSION_PATCH < 5) { */
11827 printf("but Perl needs Berkeley DB 2.3.4 or greater\n") ;
11833 #if defined(_DB_H_) && defined(BTREEMAGIC) && defined(HASHMAGIC)
11834 printf("You have Berkeley DB Version 1\n");
11835 exit(0); /* DB version < 2: the coast is clear. */
11837 exit(1); /* <db.h> not Berkeley DB? */
11843 if eval $compile_ok && ./try; then
11844 echo 'Looks OK.' >&4
11846 echo "I can't use Berkeley DB with your <db.h>. I'll disable Berkeley DB." >&4
11850 : Remove db from list of libraries to use
11851 echo "Removing unusable -ldb from library list" >&4
11852 set `echo X $libs | $sed -e 's/-ldb / /' -e 's/-ldb$//'`
11855 echo "libs = $libs" >&4
11865 : Check the return type needed for hash
11867 echo "Checking return type needed for hash for Berkeley DB ..." >&4
11873 #include <sys/types.h>
11876 #ifndef DB_VERSION_MAJOR
11877 u_int32_t hash_cb (ptr, size)
11885 info.hash = hash_cb;
11889 if $cc $ccflags -c try.c >try.out 2>&1 ; then
11890 if $contains warning try.out >>/dev/null 2>&1 ; then
11893 db_hashtype='u_int32_t'
11896 : XXX Maybe we should just give up here.
11897 db_hashtype=u_int32_t
11899 echo "Help: I can't seem to compile the db test program." >&4
11900 echo "Something's wrong, but I'll assume you use $db_hashtype." >&4
11903 echo "Your version of Berkeley DB uses $db_hashtype for hash."
11905 *) db_hashtype=u_int32_t
11910 : Check the return type needed for prefix
11912 echo "Checking return type needed for prefix for Berkeley DB ..." >&4
11918 #include <sys/types.h>
11921 #ifndef DB_VERSION_MAJOR
11922 size_t prefix_cb (key1, key2)
11930 info.prefix = prefix_cb;
11934 if $cc $ccflags -c try.c >try.out 2>&1 ; then
11935 if $contains warning try.out >>/dev/null 2>&1 ; then
11936 db_prefixtype='int'
11938 db_prefixtype='size_t'
11941 db_prefixtype='size_t'
11942 : XXX Maybe we should just give up here.
11944 echo "Help: I can't seem to compile the db test program." >&4
11945 echo "Something's wrong, but I'll assume you use $db_prefixtype." >&4
11948 echo "Your version of Berkeley DB uses $db_prefixtype for prefix."
11950 *) db_prefixtype='size_t'
11954 : check for void type
11956 echo "Checking to see how well your C compiler groks the void type..." >&4
11957 case "$voidflags" in
11959 $cat >try.c <<'EOCP'
11965 extern void moo(); /* function returning void */
11966 void (*goo)(); /* ptr to func returning void */
11968 void *hue; /* generic ptr */
11981 int main() { sub(); }
11983 if $cc $ccflags -c -DTRY=$defvoidused try.c >.out 2>&1 ; then
11984 voidflags=$defvoidused
11985 echo "Good. It appears to support void to the level $package wants.">&4
11986 if $contains warning .out >/dev/null 2>&1; then
11987 echo "However, you might get some warnings that look like this:"
11991 echo "Hmm, your compiler has some difficulty with void. Checking further..." >&4
11992 if $cc $ccflags -c -DTRY=1 try.c >/dev/null 2>&1; then
11993 echo "It supports 1..."
11994 if $cc $ccflags -c -DTRY=3 try.c >/dev/null 2>&1; then
11995 echo "It also supports 2..."
11996 if $cc $ccflags -c -DTRY=7 try.c >/dev/null 2>&1; then
11998 echo "And it supports 4 but not 8 definitely."
12000 echo "It doesn't support 4..."
12001 if $cc $ccflags -c -DTRY=11 try.c >/dev/null 2>&1; then
12003 echo "But it supports 8."
12006 echo "Neither does it support 8."
12010 echo "It does not support 2..."
12011 if $cc $ccflags -c -DTRY=13 try.c >/dev/null 2>&1; then
12013 echo "But it supports 4 and 8."
12015 if $cc $ccflags -c -DTRY=5 try.c >/dev/null 2>&1; then
12017 echo "And it supports 4 but has not heard about 8."
12019 echo "However it supports 8 but not 4."
12024 echo "There is no support at all for void."
12029 case "$voidflags" in
12031 *) $cat >&4 <<'EOM'
12032 Support flag bits are:
12033 1: basic void declarations.
12034 2: arrays of pointers to functions returning void.
12035 4: operations between pointers to and addresses of void functions.
12036 8: generic void pointers.
12039 rp="Your void support flags add up to what?"
12047 : How can we generate normalized random numbers ?
12049 echo "Looking for a random number function..." >&4
12050 case "$randfunc" in
12052 if set drand48 val -f; eval $csym; $val; then
12054 echo "Good, found drand48()." >&4
12055 elif set random val -f; eval $csym; $val; then
12057 echo "OK, found random()." >&4
12060 echo "Yick, looks like I have to use rand()." >&4
12071 *-Dmy_rand=*|*-Dmy_srand=*)
12072 echo "Removing obsolete -Dmy_rand, -Dmy_srand, and -Drandbits from ccflags." >&4
12073 ccflags="`echo $ccflags | sed -e 's/-Dmy_rand=random/ /'`"
12074 ccflags="`echo $ccflags | sed -e 's/-Dmy_srand=srandom/ /'`"
12075 ccflags="`echo $ccflags | sed -e 's/-Drandbits=[0-9][0-9]*/ /'`"
12079 while $test "$cont"; do
12080 rp="Use which function to generate random numbers?"
12082 if $test "$ans" = "$dflt"; then
12088 if set $ans val -f; eval $csym; $val; then
12092 rp="I cannot find function $ans. Use that name anyway?"
12101 case "$randfunc" in
12103 drand01="drand48()"
12109 case "$randbits" in
12111 echo "Checking to see how many bits your $randfunc() function produces..." >&4
12113 #$i_unistd I_UNISTD
12114 #$i_stdlib I_STDLIB
12117 # include <unistd.h>
12120 # include <stdlib.h>
12125 register unsigned long tmp;
12126 register unsigned long max = 0L;
12128 for (i = 1000; i; i--) {
12129 tmp = (unsigned long) $randfunc();
12130 if (tmp > max) max = tmp;
12132 for (i = 0; max; i++)
12138 if eval $compile_ok; then
12142 echo "(I can't seem to compile the test program...)"
12149 rp="How many bits does your $randfunc() function produce?"
12153 drand01="($randfunc() / (double) ((unsigned long)1 << $randbits))"
12154 seedfunc="s$randfunc"
12155 randseedtype=unsigned
12159 rp="How many bits does your $randfunc() function produce?"
12162 seedfunc="s$randfunc"
12163 drand01="($randfunc() / (double) ((unsigned long)1 << $randbits))"
12164 if set $seedfunc val -f; eval $csym; $val; then
12165 echo "(Using $seedfunc() to seed random generator)"
12167 echo "(Warning: no $seedfunc() to seed random generator)"
12170 randseedtype=unsigned
12178 echo "Determining whether or not we are on an EBCDIC system..." >&4
12179 $cat >tebcdic.c <<'EOM'
12182 if ('M'==0xd4) return 0;
12189 if eval $compile_ok; then
12191 echo "You have EBCDIC." >&4
12194 echo "Nope, no EBCDIC, probably ASCII or some ISO Latin." >&4
12197 echo "I'm unable to compile the test program." >&4
12198 echo "I'll assume ASCII or some ISO Latin." >&4
12200 $rm -f tebcdic.c tebcdic
12206 Checking how to flush all pending stdio output...
12208 # I only know how to find the first 32 possibly open files on SunOS.
12209 # See also hints/sunos_4_1.sh and util.c --AD
12211 sunos) $echo '#define PERL_FFLUSH_ALL_FOPEN_MAX 32' > try.c ;;
12213 $cat >>try.c <<EOCP
12215 #$i_unistd I_UNISTD
12217 # include <unistd.h>
12219 #$d_sysconf HAS_SYSCONF
12220 #$d_stdio_stream_array HAS_STDIO_STREAM_ARRAY
12221 #ifdef HAS_STDIO_STREAM_ARRAY
12222 # define STDIO_STREAM_ARRAY $stdio_stream_array
12225 FILE* p = fopen("try.out", "w");
12229 # ifdef TRY_FPRINTF
12233 #ifdef TRY_FFLUSH_NULL
12236 #ifdef TRY_FFLUSH_ALL
12238 long open_max = -1;
12239 # ifdef PERL_FFLUSH_ALL_FOPEN_MAX
12240 open_max = PERL_FFLUSH_ALL_FOPEN_MAX;
12242 # if defined(HAS_SYSCONF) && defined(_SC_OPEN_MAX)
12243 open_max = sysconf(_SC_OPEN_MAX);
12246 open_max = FOPEN_MAX;
12249 open_max = OPEN_MAX;
12258 # ifdef HAS_STDIO_STREAM_ARRAY
12259 if (open_max > 0) {
12261 for (i = 0; i < open_max; i++)
12262 if (STDIO_STREAM_ARRAY[i]._file >= 0 &&
12263 STDIO_STREAM_ARRAY[i]._file < open_max &&
12264 STDIO_STREAM_ARRAY[i]._flag)
12265 fflush(&STDIO_STREAM_ARRAY[i]);
12273 : first we have to find out how _not_ to flush
12274 if $test "X$fflushNULL" = X -o "X$fflushall" = X; then
12276 set try -DTRY_FPUTC
12277 if eval $compile; then
12279 ./try$exe_ext 2>/dev/null
12280 if $test ! -s try.out -a "X$?" = X42; then
12286 set try -DTRY_FPRINTF
12288 if eval $compile; then
12290 ./try$exe_ext 2>/dev/null
12291 if $test ! -s try.out -a "X$?" = X42; then
12292 output=-DTRY_FPRINTF
12298 : check for fflush NULL behaviour
12299 case "$fflushNULL" in
12300 '') set try -DTRY_FFLUSH_NULL $output
12301 if eval $compile; then
12303 ./try$exe_ext 2>/dev/null
12305 if $test -s try.out -a "X$code" = X42; then
12306 fflushNULL="`$cat try.out`"
12308 if $test "X$code" != X42; then
12310 (If this test failed, don't worry, we'll try another method shortly.)
12315 $rm -f core try.core core.try.*
12316 case "$fflushNULL" in
12318 Your fflush(NULL) works okay.
12320 fflushNULL="$define"
12323 Your fflush(NULL) isn't working (contrary to ANSI C).
12325 fflushNULL="$undef"
12328 Cannot figure out whether your fflush(NULL) works or not.
12329 I'm assuming it doesn't (contrary to ANSI C).
12331 fflushNULL="$undef"
12335 $define|true|[yY]*)
12336 fflushNULL="$define"
12339 fflushNULL="$undef"
12342 : check explicit looping only if NULL did not work
12343 case "$fflushNULL" in
12345 : check for fflush all behaviour
12346 case "$fflushall" in
12347 '') set try -DTRY_FFLUSH_ALL $output
12348 if eval $compile; then
12350 (Now testing the other method--but note that also this may fail.)
12353 ./try$exe_ext 2>/dev/null
12354 if $test -s try.out -a "X$?" = X42; then
12355 fflushall="`$cat try.out`"
12358 $rm -f core try.core core.try.*
12359 case "$fflushall" in
12361 Whew. Flushing explicitly all the stdio streams works.
12363 fflushall="$define"
12366 Sigh. Flushing explicitly all the stdio streams doesn't work.
12371 Cannot figure out whether flushing stdio streams explicitly works or not.
12372 I'm assuming it doesn't.
12378 "$define"|true|[yY]*)
12379 fflushall="$define"
12386 *) fflushall="$undef"
12389 case "$fflushNULL$fflushall" in
12392 I cannot figure out how to flush pending stdio output.
12396 $rm -f try.* try$exe_ext
12398 : Store the full pathname to the ar program for use in the C program
12399 : Respect a hint or command line value for full_ar.
12404 : Store the full pathname to the sed program for use in the C program
12407 : see what type gids are declared as in the kernel
12409 echo "Looking for the type for group ids returned by getgid()."
12410 set gid_t gidtype xxx stdio.h sys/types.h
12414 xxx=`./findhdr sys/user.h`
12415 set `grep 'groups\[NGROUPS\];' "$xxx" 2>/dev/null` unsigned short
12417 unsigned) dflt="$1 $2" ;;
12421 *) dflt="$gidtype";;
12424 gid_t) echo "gid_t found." ;;
12425 *) rp="What is the type for group ids returned by getgid()?"
12433 *_t) zzz="$gidtype" ;;
12436 echo "Checking the size of $zzz..." >&4
12438 #include <sys/types.h>
12441 printf("%d\n", (int)sizeof($gidtype));
12446 if eval $compile_ok; then
12450 echo "(I can't execute the test program--guessing $gidsize.)" >&4
12453 echo "Your $zzz is $gidsize bytes long."
12458 echo "(I can't compile the test program--guessing $gidsize.)" >&4
12464 *_t) zzz="$gidtype" ;;
12467 echo "Checking the sign of $zzz..." >&4
12469 #include <sys/types.h>
12480 if eval $compile; then
12484 echo "(I can't execute the test program--guessing unsigned.)" >&4
12488 1) echo "Your $zzz is unsigned." ;;
12489 -1) echo "Your $zzz is signed." ;;
12495 echo "(I can't compile the test program--guessing unsigned.)" >&4
12501 if $test X"$quadtype" != X; then
12503 echo "Checking how to print 64-bit integers..." >&4
12505 if $test X"$sPRId64" = X -a X"$quadtype" = Xint; then
12506 $cat >try.c <<'EOCP'
12507 #include <sys/types.h>
12510 int q = 12345678901;
12511 printf("%ld\n", q);
12515 if eval $compile; then
12516 yyy=`./try$exe_ext`
12519 sPRId64='"d"'; sPRIi64='"i"'; sPRIu64='"u"';
12520 sPRIo64='"o"'; sPRIx64='"x"'; sPRIX64='"X"';
12521 echo "We will use %d."
12527 if $test X"$sPRId64" = X -a X"$quadtype" = Xlong; then
12528 $cat >try.c <<'EOCP'
12529 #include <sys/types.h>
12532 long q = 12345678901;
12533 printf("%ld\n", q);
12537 if eval $compile; then
12538 yyy=`./try$exe_ext`
12541 sPRId64='"ld"'; sPRIi64='"li"'; sPRIu64='"lu"';
12542 sPRIo64='"lo"'; sPRIx64='"lx"'; sPRIX64='"lX"';
12543 echo "We will use %ld."
12549 if $test X"$sPRId64" = X -a X"$i_inttypes" = X"$define" -a X"$quadtype" = Xint64_t; then
12550 $cat >try.c <<'EOCP'
12551 #include <sys/types.h>
12552 #include <inttypes.h>
12555 int64_t q = 12345678901;
12556 printf("%" PRId64 "\n", q);
12560 if eval $compile; then
12561 yyy=`./try$exe_ext`
12564 sPRId64=PRId64; sPRIi64=PRIi64; sPRIu64=PRIu64;
12565 sPRIo64=PRIo64; sPRIx64=PRIx64; sPRIX64=PRIX64;
12566 echo "We will use the C9X style."
12572 if $test X"$sPRId64" = X -a X"$quadtype" = X"long long"; then
12573 $cat >try.c <<'EOCP'
12574 #include <sys/types.h>
12577 long long q = 12345678901LL; /* AIX cc requires the LL prefix. */
12578 printf("%lld\n", q);
12582 if eval $compile; then
12583 yyy=`./try$exe_ext`
12586 sPRId64='"lld"'; sPRIi64='"lli"'; sPRIu64='"llu"';
12587 sPRIo64='"llo"'; sPRIx64='"llx"'; sPRIX64='"llX"';
12588 echo "We will use the %lld style."
12594 if $test X"$sPRId64" = X -a X"$quadtype" != X; then
12596 #include <sys/types.h>
12599 $quadtype q = 12345678901;
12600 printf("%Ld\n", q);
12604 if eval $compile; then
12605 yyy=`./try$exe_ext`
12608 sPRId64='"Ld"'; sPRIi64='"Li"'; sPRIu64='"Lu"';
12609 sPRIo64='"Lo"'; sPRIx64='"Lx"'; sPRIX64='"LX"';
12610 echo "We will use %Ld."
12616 if $test X"$sPRId64" = X -a X"$quadtype" != X; then
12618 #include <sys/types.h>
12621 $quadtype q = 12345678901;
12622 printf("%qd\n", q);
12626 if eval $compile; then
12627 yyy=`./try$exe_ext`
12630 sPRId64='"qd"'; sPRIi64='"qi"'; sPRIu64='"qu"';
12631 sPRIo64='"qo"'; sPRIx64='"qx"'; sPRIX64='"qX"';
12632 echo "We will use %qd."
12638 if $test X"$sPRId64" = X; then
12639 echo "Cannot figure out how to print 64-bit integers." >&4
12647 '') d_PRId64="$undef"; d_PRIi64="$undef"; d_PRIu64="$undef";
12648 d_PRIo64="$undef"; d_PRIx64="$undef"; d_PRIX64="$undef";
12650 *) d_PRId64="$define"; d_PRIi64="$define"; d_PRIu64="$define";
12651 d_PRIo64="$define"; d_PRIx64="$define"; d_PRIX64="$define";
12657 $echo "Checking the format strings to be used for Perl's internal types..." >&4
12659 if $test X"$ivsize" = X8; then
12660 ivdformat="$sPRId64"
12661 uvuformat="$sPRIu64"
12662 uvoformat="$sPRIo64"
12663 uvxformat="$sPRIx64"
12665 if $test X"$ivsize" = X"$longsize"; then
12671 if $test X"$ivsize" = X"$intsize"; then
12678 if $test X"$ivsize" = X"$shortsize"; then
12688 case "$ivdformat" in
12689 '') echo "$0: Fatal: failed to find format strings, cannot continue." >& 4
12696 $echo "Checking the format string to be used for gids..." >&4
12699 -1) if $test X"$gidsize" = X"$ivsize"; then
12700 gidformat="$ivdformat"
12702 if $test X"$gidsize" = X"$longsize"; then
12705 if $test X"$gidsize" = X"$intsize"; then
12708 if $test X"$gidsize" = X"$shortsize"; then
12715 *) if $test X"$gidsize" = X"$uvsize"; then
12716 gidformat="$uvuformat"
12718 if $test X"$gidsize" = X"$longsize"; then
12721 if $test X"$gidsize" = X"$intsize"; then
12724 if $test X"$gidsize" = X"$shortsize"; then
12733 : see if getgroups exists
12734 set getgroups d_getgrps
12737 : see if setgroups exists
12738 set setgroups d_setgrps
12742 : Find type of 2nd arg to 'getgroups()' and 'setgroups()'
12744 case "$d_getgrps$d_setgrps" in
12746 case "$groupstype" in
12747 '') dflt="$gidtype" ;;
12748 *) dflt="$groupstype" ;;
12751 What type of pointer is the second argument to getgroups() and setgroups()?
12752 Usually this is the same as group ids, $gidtype, but not always.
12755 rp='What type pointer is the second argument to getgroups() and setgroups()?'
12759 *) groupstype="$gidtype";;
12763 echo "Checking if your $make program sets \$(MAKE)..." >&4
12764 case "$make_set_make" in
12766 $sed 's/^X //' > testmake.mak << 'EOF'
12768 X @echo 'maketemp="$(MAKE)"'
12770 case "`$make -f testmake.mak 2>/dev/null`" in
12771 *maketemp=*) make_set_make='#' ;;
12772 *) make_set_make="MAKE=$make" ;;
12774 $rm -f testmake.mak
12777 case "$make_set_make" in
12778 '#') echo "Yup, it does.";;
12779 *) echo "Nope, it doesn't.";;
12782 : see what type is used for mode_t
12783 rp="What is the type used for file modes for system calls (e.g. fchmod())?"
12784 set mode_t modetype int stdio.h sys/types.h
12787 : define a fucntion to check prototypes
12788 $cat > protochk <<EOSH
12791 optimize="$optimize"
12793 prototype="$prototype"
12798 $cat >> protochk <<'EOSH'
12803 while test $# -ge 2; do
12805 $define) echo "#include <$2>" >> try.c ;;
12806 literal) echo "$2" >> try.c ;;
12810 test "$prototype" = "$define" && echo '#define CAN_PROTOTYPE' >> try.c
12811 cat >> try.c <<'EOCP'
12812 #ifdef CAN_PROTOTYPE
12813 #define _(args) args
12818 echo "$foo" >> try.c
12819 echo 'int no_real_function_has_this_name _((void)) { return 0; }' >> try.c
12820 $cc $optimize $ccflags -c try.c > /dev/null 2>&1
12826 $eunicefix protochk
12828 : see what type is used for size_t
12829 rp="What is the type used for the length parameter for string functions?"
12830 set size_t sizetype 'unsigned int' stdio.h sys/types.h
12833 : check for type of arguments to gethostbyaddr.
12834 if test "X$netdb_host_type" = X -o "X$netdb_hlen_type" = X; then
12835 case "$d_gethbyaddr" in
12839 Checking to see what type of arguments are accepted by gethostbyaddr().
12841 hdrs="$define sys/types.h
12842 $d_socket sys/socket.h
12843 $i_niin netinet/in.h
12845 $i_unistd unistd.h"
12846 : The first arg can 'char *' or 'void *'
12847 : The second arg is some of integral type
12848 for xxx in in_addr_t 'const void *' 'const char *' 'void *' 'char *'; do
12849 for yyy in size_t long int; do
12850 case "$netdb_host_type" in
12851 '') try="extern struct hostent *gethostbyaddr($xxx, $yyy, int);"
12852 if ./protochk "$try" $hdrs; then
12853 echo "Your system accepts $xxx for the first arg."
12854 echo "...and $yyy for the second arg."
12855 netdb_host_type="$xxx"
12856 netdb_hlen_type="$yyy"
12862 : In case none of those worked, prompt the user.
12863 case "$netdb_host_type" in
12864 '') rp='What is the type for the 1st argument to gethostbyaddr?'
12867 netdb_host_type=$ans
12868 rp='What is the type for the 2nd argument to gethostbyaddr?'
12871 netdb_hlen_type=$ans
12875 *) : no gethostbyaddr, so pick harmless defaults
12876 netdb_host_type='char *'
12877 netdb_hlen_type="$sizetype"
12880 # Remove the "const" if needed. -- but then we'll have a
12882 # netdb_host_type=`echo "$netdb_host_type" | sed 's/^const //'`
12885 : check for type of argument to gethostbyname.
12886 if test "X$netdb_name_type" = X ; then
12887 case "$d_gethbyname" in
12891 Checking to see what type of argument is accepted by gethostbyname().
12893 hdrs="$define sys/types.h
12894 $d_socket sys/socket.h
12895 $i_niin netinet/in.h
12897 $i_unistd unistd.h"
12898 for xxx in "const char *" "char *"; do
12899 case "$netdb_name_type" in
12900 '') try="extern struct hostent *gethostbyname($xxx);"
12901 if ./protochk "$try" $hdrs; then
12902 echo "Your system accepts $xxx."
12903 netdb_name_type="$xxx"
12908 : In case none of those worked, prompt the user.
12909 case "$netdb_name_type" in
12910 '') rp='What is the type for the 1st argument to gethostbyname?'
12913 netdb_name_type=$ans
12917 *) : no gethostbyname, so pick harmless default
12918 netdb_name_type='char *'
12923 : check for type of 1st argument to getnetbyaddr.
12924 if test "X$netdb_net_type" = X ; then
12925 case "$d_getnbyaddr" in
12929 Checking to see what type of 1st argument is accepted by getnetbyaddr().
12931 hdrs="$define sys/types.h
12932 $d_socket sys/socket.h
12933 $i_niin netinet/in.h
12935 $i_unistd unistd.h"
12936 for xxx in in_addr_t "unsigned long" long "unsigned int" int; do
12937 case "$netdb_net_type" in
12938 '') try="extern struct netent *getnetbyaddr($xxx, int);"
12939 if ./protochk "$try" $hdrs; then
12940 echo "Your system accepts $xxx."
12941 netdb_net_type="$xxx"
12946 : In case none of those worked, prompt the user.
12947 case "$netdb_net_type" in
12948 '') rp='What is the type for the 1st argument to getnetbyaddr?'
12951 netdb_net_type=$ans
12955 *) : no getnetbyaddr, so pick harmless default
12956 netdb_net_type='long'
12960 : locate the preferred pager for this system
12974 '') dflt=/usr/ucb/more;;
12981 rp='What pager is used on your system?'
12985 : see what type pids are declared as in the kernel
12986 rp="What is the type of process ids on this system?"
12987 set pid_t pidtype int stdio.h sys/types.h
12990 : Find earliest binary compatible site_perl subdirectory perl can use.
12991 case "$bincompat5005" in
12992 "$define") xs_apiversion='5.005' ;;
12993 *) xs_apiversion=$version ;; # The current site_perl version.
12995 : Find earliest pure perl site_perl subdirectory perl can use.
12996 : The versioned directories started at 5.005.
12997 pm_apiversion='5.005'
12999 : check for length of pointer
13003 echo "Checking to see how big your pointers are..." >&4
13004 if test "$voidflags" -gt 7; then
13005 echo '#define VOID_PTR char *' > try.c
13007 echo '#define VOID_PTR void *' > try.c
13009 $cat >>try.c <<'EOCP'
13013 printf("%d\n", (int)sizeof(VOID_PTR));
13018 if eval $compile_ok; then
13020 echo "Your pointers are $ptrsize bytes long."
13023 echo "(I can't seem to compile the test program. Guessing...)" >&4
13024 rp="What is the size of a pointer (in bytes)?"
13032 : see if ar generates random libraries by itself
13034 echo "Checking how to generate random libraries on your machine..." >&4
13035 echo 'int bar1() { return bar2(); }' > bar1.c
13036 echo 'int bar2() { return 2; }' > bar2.c
13037 $cat > foo.c <<'EOP'
13038 int main() { printf("%d\n", bar1()); exit(0); }
13040 $cc $ccflags -c bar1.c >/dev/null 2>&1
13041 $cc $ccflags -c bar2.c >/dev/null 2>&1
13042 $cc $ccflags -c foo.c >/dev/null 2>&1
13043 $ar rc bar$_a bar2$_o bar1$_o >/dev/null 2>&1
13044 if $cc $ccflags $ldflags -o foobar foo$_o bar$_a $libs > /dev/null 2>&1 &&
13045 ./foobar >/dev/null 2>&1; then
13046 echo "$ar appears to generate random libraries itself."
13049 elif $ar ts bar$_a >/dev/null 2>&1 &&
13050 $cc $ccflags $ldflags -o foobar foo$_o bar$_a $libs > /dev/null 2>&1 &&
13051 ./foobar >/dev/null 2>&1; then
13052 echo "a table of contents needs to be added with '$ar ts'."
13059 ranlib=`./loc ranlib X /usr/bin /bin /usr/local/bin`
13060 $test -f $ranlib || ranlib=''
13063 if $test -n "$ranlib"; then
13064 echo "your system has '$ranlib'; we'll use that."
13067 echo "your system doesn't seem to support random libraries"
13068 echo "so we'll use lorder and tsort to order the libraries."
13075 : check for type of arguments to select.
13076 case "$selecttype" in
13077 '') case "$d_select" in
13081 Checking to see what type of arguments are accepted by select().
13083 hdrs="$define sys/types.h
13084 $i_systime sys/time.h
13085 $i_sysselct sys/select.h
13086 $d_socket sys/socket.h"
13087 : The first arg can be int, unsigned, or size_t
13088 : The last arg may or may not be 'const'
13090 : void pointer has been seen but using that
13091 : breaks the selectminbits test
13092 for xxx in 'fd_set *' 'int *'; do
13093 for nfd in 'int' 'size_t' 'unsigned long' 'unsigned' ; do
13094 for tmo in 'struct timeval *' 'const struct timeval *'; do
13096 '') try="extern select _(($nfd, $xxx, $xxx, $xxx, $tmo));"
13097 if ./protochk "$try" $hdrs; then
13098 echo "Your system accepts $xxx."
13107 '') rp='What is the type for the 2nd, 3rd, and 4th arguments to select?'
13108 case "$d_fd_set" in
13109 $define) dflt="fd_set *" ;;
13118 *) : no select, so pick a harmless default
13125 : check for the select 'width'
13126 case "$selectminbits" in
13127 '') case "$d_select" in
13131 Checking to see on how many bits at a time your select() operates...
13134 #include <sys/types.h>
13136 #$i_systime I_SYS_TIME
13137 #$i_systimek I_SYS_TIME_KERNEL
13142 # ifdef I_SYS_TIME_KERNEL
13145 # include <sys/time.h>
13146 # ifdef I_SYS_TIME_KERNEL
13150 #$i_sysselct I_SYS_SELECT
13151 #ifdef I_SYS_SELECT
13152 #include <sys/select.h>
13154 #$d_socket HAS_SOCKET
13156 # include <sys/socket.h> /* Might include <sys/bsdtypes.h> */
13160 #define S sizeof(*(b))
13162 #define NBYTES (S * 8 > MINBITS ? S : MINBITS/8)
13163 #define NBITS (NBYTES * 8)
13172 fp = fopen("try.c", "r");
13178 b = ($selecttype)s;
13179 for (i = 0; i < NBITS; i++)
13183 select(fd + 1, b, 0, 0, &t);
13184 for (i = NBITS - 1; i > fd && FD_ISSET(i, b); i--);
13185 printf("%d\n", i + 1);
13190 if eval $compile_ok; then
13191 selectminbits=`./try`
13192 case "$selectminbits" in
13194 Cannot figure out on how many bits at a time your select() operates.
13195 I'll play safe and guess it is 32 bits.
13201 *) bits="$selectminbits bits" ;;
13203 echo "Your select() operates on $bits at a time." >&4
13205 rp='What is the minimum number of bits your select() operates on?'
13206 case "$byteorder" in
13207 1234|12345678) dflt=32 ;;
13212 selectminbits="$val"
13216 *) : no select, so pick a harmless default
13223 : Trace out the files included by signal.h, then look for SIGxxx names.
13224 : Remove SIGARRAYSIZE used by HPUX.
13225 : Remove SIGSTKSIZE used by Linux.
13226 : Remove SIGSTKSZ used by Posix.
13227 : Remove SIGTYP void lines used by OS2.
13228 : Some cpps, like os390, dont give the file name anywhere
13229 if [ "X$fieldn" = X ]; then
13230 : Just make some guesses. We check them later.
13231 xxx='/usr/include/signal.h /usr/include/sys/signal.h'
13233 xxx=`echo '#include <signal.h>' |
13234 $cppstdin $cppminus $cppflags 2>/dev/null |
13235 $grep '^[ ]*#.*include' |
13236 $awk "{print \\$$fieldn}" | $sed 's!"!!g' | $sort | $uniq`
13238 : Check this list of files to be sure we have parsed the cpp output ok.
13239 : This will also avoid potentially non-existent files, such
13242 for xx in $xxx /dev/null ; do
13243 $test -f "$xx" && xxxfiles="$xxxfiles $xx"
13245 : If we have found no files, at least try signal.h
13246 case "$xxxfiles" in
13247 '') xxxfiles=`./findhdr signal.h` ;;
13250 $1 ~ /^#define$/ && $2 ~ /^SIG[A-Z0-9]*$/ && $2 !~ /SIGARRAYSIZE/ && $2 !~ /SIGSTKSIZE/ && $2 !~ /SIGSTKSZ/ && $3 !~ /void/ {
13251 print substr($2, 4, 20)
13253 $1 == "#" && $2 ~ /^define$/ && $3 ~ /^SIG[A-Z0-9]*$/ && $3 !~ /SIGARRAYSIZE/ && $4 !~ /void/ {
13254 print substr($3, 4, 20)
13256 : Append some common names just in case the awk scan failed.
13257 xxx="$xxx ABRT ALRM BUS CANCEL CHLD CLD CONT DIL EMT FPE"
13258 xxx="$xxx FREEZE HUP ILL INT IO IOT KILL LOST LWP PHONE"
13259 xxx="$xxx PIPE POLL PROF PWR QUIT RTMAX RTMIN SEGV STKFLT STOP"
13260 xxx="$xxx SYS TERM THAW TRAP TSTP TTIN TTOU URG USR1 USR2"
13261 xxx="$xxx USR3 USR4 VTALRM WAITING WINCH WIND WINDOW XCPU XFSZ"
13263 : generate a few handy files for later
13264 $cat > signal.c <<'EOCP'
13265 #include <sys/types.h>
13266 #include <signal.h>
13270 /* Strange style to avoid deeply-nested #if/#else/#endif */
13273 # define NSIG (_NSIG)
13279 # define NSIG (SIGMAX+1)
13285 # define NSIG (SIG_MAX+1)
13291 # define NSIG (MAXSIG+1)
13297 # define NSIG (MAX_SIG+1)
13302 # ifdef SIGARRAYSIZE
13303 # define NSIG (SIGARRAYSIZE+1) /* Not sure of the +1 */
13309 # define NSIG (_sys_nsig) /* Solaris 2.5 */
13313 /* Default to some arbitrary number that's big enough to get most
13314 of the common signals.
13320 printf("NSIG %d\n", NSIG);
13326 echo $xxx | $tr ' ' $trnl | $sort | $uniq | $awk '
13328 printf "#ifdef SIG"; printf $1; printf "\n"
13329 printf "printf(\""; printf $1; printf " %%d\\n\",SIG";
13330 printf $1; printf ");\n"
13334 printf "#endif /* JUST_NSIG */\n";
13335 printf "exit(0);\n}\n";
13338 $cat >signal.awk <<'EOP'
13339 BEGIN { ndups = 0 }
13340 $1 ~ /^NSIG$/ { nsig = $2 }
13341 ($1 !~ /^NSIG$/) && (NF == 2) {
13342 if ($2 > maxsig) { maxsig = $2 }
13343 if (sig_name[$2]) {
13344 dup_name[ndups] = $1
13345 dup_num[ndups] = $2
13357 printf("NSIG %d\n", nsig);
13358 for (n = 1; n < nsig; n++) {
13360 printf("%s %d\n", sig_name[n], sig_num[n])
13363 printf("NUM%d %d\n", n, n)
13366 for (n = 0; n < ndups; n++) {
13367 printf("%s %d\n", dup_name[n], dup_num[n])
13371 $cat >signal_cmd <<EOS
13373 if $test -s signal.lst; then
13374 echo "Using your existing signal.lst file"
13379 $cat >>signal_cmd <<'EOS'
13382 if eval $compile_ok; then
13383 ./signal$_exe | $sort -n +1 | $uniq | $awk -f signal.awk >signal.lst
13385 echo "(I can't seem be able to compile the whole test program)" >&4
13386 echo "(I'll try it in little pieces.)" >&4
13387 set signal -DJUST_NSIG
13388 if eval $compile_ok; then
13389 ./signal$_exe > signal.nsg
13392 echo "I can't seem to figure out how many signals you have." >&4
13393 echo "Guessing 50." >&4
13394 echo 'NSIG 50' > signal.nsg
13396 : Now look at all the signal names, one at a time.
13397 for xx in `echo $xxx | $tr ' ' $trnl | $sort | $uniq`; do
13398 $cat > signal.c <<EOCP
13399 #include <sys/types.h>
13400 #include <signal.h>
13403 printf("$xx %d\n", SIG${xx});
13408 if eval $compile; then
13409 echo "SIG${xx} found."
13410 ./signal$_exe >> signal.ls1
13412 echo "SIG${xx} NOT found."
13415 if $test -s signal.ls1; then
13416 $cat signal.nsg signal.ls1 |
13417 $sort -n +1 | $uniq | $awk -f signal.awk >signal.lst
13421 if $test -s signal.lst; then
13424 echo "(AAK! I can't compile the test programs -- Guessing)" >&4
13425 echo 'kill -l' >signal
13426 set X `csh -f <signal`
13430 0) set HUP INT QUIT ILL TRAP ABRT EMT FPE KILL BUS SEGV SYS PIPE ALRM TERM;;
13432 echo $@ | $tr ' ' $trnl | \
13433 $awk '{ printf "%s %d\n", $1, ++s; }
13434 END { printf "NSIG %d\n", ++s }' >signal.lst
13436 $rm -f signal.c signal$_exe signal$_o signal.nsg signal.ls1
13438 chmod a+x signal_cmd
13439 $eunicefix signal_cmd
13441 : generate list of signal names
13443 case "$sig_name_init" in
13445 *) case "$sig_num_init" in
13446 ''|*,*) doinit=yes ;;
13451 echo "Generating a list of signal names and numbers..." >&4
13453 sig_count=`$awk '/^NSIG/ { printf "%d", $2 }' signal.lst`
13454 sig_name=`$awk 'BEGIN { printf "ZERO " }
13455 !/^NSIG/ { printf "%s ", $1 }' signal.lst`
13456 sig_num=`$awk 'BEGIN { printf "0 " }
13457 !/^NSIG/ { printf "%d ", $2 }' signal.lst`
13458 sig_name_init=`$awk 'BEGIN { printf "\"ZERO\", " }
13459 !/^NSIG/ { printf "\"%s\", ", $1 }
13460 END { printf "0\n" }' signal.lst`
13461 sig_num_init=`$awk 'BEGIN { printf "0, " }
13462 !/^NSIG/ { printf "%d, ", $2}
13463 END { printf "0\n"}' signal.lst`
13466 echo "The following $sig_count signals are available:"
13468 echo $sig_name | $awk \
13469 'BEGIN { linelen = 0 }
13471 for (i = 1; i <= NF; i++) {
13472 name = "SIG" $i " "
13473 linelen = linelen + length(name)
13474 if (linelen > 70) {
13476 linelen = length(name)
13482 $rm -f signal signal.c signal.awk signal.lst signal_cmd
13484 : check for socklen_t
13486 echo "Checking to see if you have socklen_t..." >&4
13488 #include <sys/types.h>
13489 #$d_socket HAS_SOCKET
13491 #include <sys/socket.h>
13493 int main() { socklen_t x = 16; }
13496 if eval $compile; then
13498 echo "You have socklen_t."
13501 echo "You do not have socklen_t."
13502 case "$sizetype" in
13503 size_t) echo "(You do have size_t, that might work.)" ;;
13510 : check for type of the size argument to socket calls
13511 case "$d_socket" in
13515 Checking to see what type is the last argument of accept().
13517 hdrs="$define sys/types.h $d_socket sys/socket.h"
13519 case "$d_socklen_t" in
13520 "$define") yyy="$yyy socklen_t"
13522 yyy="$yyy $sizetype int long"
13523 for xxx in $yyy; do
13524 case "$socksizetype" in
13525 '') try="extern int accept(int, struct sockaddr *, $xxx *);"
13526 if ./protochk "$try" $hdrs; then
13527 echo "Your system accepts '$xxx *' for the last argument of accept()."
13528 socksizetype="$xxx *"
13533 : In case none of those worked, prompt the user.
13534 case "$socksizetype" in
13535 '') rp='What is the type for the last argument to accept()?'
13542 *) : no gethostbyaddr, so pick relatively harmless defaults
13543 socksizetype='char *'
13547 : see what type is used for signed size_t
13548 set ssize_t ssizetype int stdio.h sys/types.h
13551 $cat > ssize.c <<EOM
13553 #include <sys/types.h>
13554 #define Size_t $sizetype
13555 #define SSize_t $dflt
13558 if (sizeof(Size_t) == sizeof(SSize_t))
13560 else if (sizeof(Size_t) == sizeof(int))
13569 if eval $compile_ok && ./ssize > /dev/null; then
13570 ssizetype=`./ssize`
13571 echo "I'll be using $ssizetype for functions returning a byte count." >&4
13574 Help! I can't compile and run the ssize_t test program: please enlighten me!
13575 (This is probably a misconfiguration in your system or libraries, and
13576 you really ought to fix it. Still, I'll try anyway.)
13578 I need a type that is the same size as $sizetype, but is guaranteed to
13579 be signed. Common values are ssize_t, int and long.
13582 rp="What signed type is the same size as $sizetype?"
13586 $rm -f ssize ssize.*
13588 : see what type of char stdio uses.
13590 if $contains 'unsigned.*char.*_ptr;' `./findhdr stdio.h` >/dev/null 2>&1 ; then
13591 echo "Your stdio uses unsigned chars." >&4
13592 stdchar="unsigned char"
13594 echo "Your stdio uses signed chars." >&4
13598 : see if time exists
13600 if test "X$d_time" = X -o X"$timetype" = X; then
13601 if set time val -f d_time; eval $csym; $val; then
13602 echo 'time() found.' >&4
13604 rp="What is the type returned by time() on this system?"
13605 set time_t timetype long stdio.h sys/types.h
13608 echo 'time() not found, hope that will do.' >&4
13616 : see what type uids are declared as in the kernel
13618 echo "Looking for the type for user ids returned by getuid()."
13619 set uid_t uidtype xxx stdio.h sys/types.h
13623 xxx=`./findhdr sys/user.h`
13624 set `grep '_ruid;' "$xxx" 2>/dev/null` unsigned short
13626 unsigned) dflt="$1 $2" ;;
13630 *) dflt="$uidtype";;
13633 uid_t) echo "uid_t found." ;;
13634 *) rp="What is the type for user ids returned by getuid()?"
13642 *_t) zzz="$uidtype" ;;
13645 echo "Checking the size of $zzz..." >&4
13647 #include <sys/types.h>
13650 printf("%d\n", (int)sizeof($uidtype));
13655 if eval $compile_ok; then
13659 echo "(I can't execute the test program--guessing $uidsize.)" >&4
13662 echo "Your $zzz is $uidsize bytes long."
13667 echo "(I can't compile the test program--guessing $uidsize.)" >&4
13672 *_t) zzz="$uidtype" ;;
13675 echo "Checking the sign of $zzz..." >&4
13677 #include <sys/types.h>
13688 if eval $compile; then
13692 echo "(I can't execute the test program--guessing unsigned.)" >&4
13696 1) echo "Your $zzz is unsigned." ;;
13697 -1) echo "Your $zzz is signed." ;;
13703 echo "(I can't compile the test program--guessing unsigned.)" >&4
13709 $echo "Checking the format string to be used for uids..." >&4
13712 -1) if $test X"$uidsize" = X"$ivsize"; then
13713 uidformat="$ivdformat"
13715 if $test X"$uidsize" = X"$longsize"; then
13718 if $test X"$uidsize" = X"$intsize"; then
13721 if $test X"$uidsize" = X"$shortsize"; then
13728 *) if $test X"$uidsize" = X"$uvsize"; then
13729 uidformat="$uvuformat"
13731 if $test X"$uidsize" = X"$longsize"; then
13734 if $test X"$uidsize" = X"$intsize"; then
13737 if $test X"$uidsize" = X"$shortsize"; then
13746 : see if dbm.h is available
13747 : see if dbmclose exists
13748 set dbmclose d_dbmclose
13751 case "$d_dbmclose" in
13761 *) set rpcsvc/dbm.h i_rpcsvcdbm
13766 *) echo "We won't be including <dbm.h>"
13776 : see if this is a sys/file.h system
13781 : do we need to include sys/file.h ?
13785 if $h_sysfile; then
13787 echo "We'll be including <sys/file.h>." >&4
13790 echo "We won't be including <sys/file.h>." >&4
13800 : see if fcntl.h is there
13805 : see if we can include fcntl.h
13811 echo "We'll be including <fcntl.h>." >&4
13814 if $h_sysfile; then
13815 echo "We don't need to include <fcntl.h> if we include <sys/file.h>." >&4
13817 echo "We won't be including <fcntl.h>." >&4
13829 : see if this is a iconv.h system
13830 set iconv.h i_iconv
13833 : see if locale.h is available
13834 set locale.h i_locale
13837 : see if mach cthreads are available
13838 if test "X$usethreads" = "X$define"; then
13839 set mach/cthreads.h i_machcthr
13842 i_machcthr="$undef"
13847 : see if this is a math.h system
13851 : see if this is a mntent.h system
13852 set mntent.h i_mntent
13855 : see if ndbm.h is available
13860 : see if dbm_open exists
13861 set dbm_open d_dbm_open
13863 case "$d_dbm_open" in
13866 echo "We won't be including <ndbm.h>"
13875 : see if net/errno.h is available
13877 set net/errno.h val
13880 : Unfortunately, it causes problems on some systems. Arrgh.
13883 cat > try.c <<'EOM'
13886 #include <net/errno.h>
13892 if $cc $ccflags -c try.c >/dev/null 2>&1; then
13893 echo "We'll be including <net/errno.h>." >&4
13895 echo "We won't be including <net/errno.h>." >&4
13904 : see if netinet/tcp.h is available
13905 set netinet/tcp.h i_netinettcp
13908 : see if this is a poll.h system
13913 $echo "Guessing which symbols your C compiler and preprocessor define..." >&4
13914 $cat <<'EOSH' > Cppsym.know
13915 a29k ABI64 aegis AES_SOURCE AIX AIX32 AIX370
13916 AIX41 AIX42 AIX43 AIX_SOURCE aixpc ALL_SOURCE
13917 alliant alpha am29000 AM29000 amiga AMIGAOS AMIX
13918 ansi ANSI_C_SOURCE apollo ardent atarist att386 att3b BeOS
13919 BIG_ENDIAN BIT_MSF bsd BSD bsd43 bsd4_2 bsd4_3 BSD4_3 bsd4_4
13920 BSD_4_3 BSD_4_4 BSD_NET2 BSD_TIME BSD_TYPES BSDCOMPAT bsdi
13921 bull c cadmus clipper CMU COFF COMPILER_VERSION
13922 concurrent convex cpu cray CRAY CRAYMPP ctix CX_UX
13923 CYGWIN DGUX DGUX_SOURCE DJGPP dmert DOLPHIN DPX2 DSO
13924 Dynix DynixPTX ELF encore EPI EXTENSIONS FILE_OFFSET_BITS
13925 FreeBSD GCC_NEW_VARARGS gcos gcx gimpel
13926 GNU_SOURCE GNUC GNUC_MINOR GO32 gould GOULD_PN
13927 H3050R H3050RX hbullx20 hcx host_mips
13928 hp200 hp300 hp700 HP700 hp800 hp9000
13929 hp9000s200 hp9000s300 hp9000s400 hp9000s500
13930 hp9000s700 hp9000s800 hp9k8 hp_osf hppa hpux HPUX_SOURCE
13931 i186 i286 i386 i486 i586 i686 i8086 i80960 i860 I960
13932 iAPX286 ibm ibm032 ibmesa IBMR2 ibmrt ILP32 ILP64
13933 INLINE_INTRINSICS INTRINSICS INT64 interdata is68k ksr1
13934 LANGUAGE_C LARGE_FILE_API LARGEFILE64_SOURCE
13935 LARGEFILE_SOURCE LFS64_LARGEFILE LFS_LARGEFILE
13936 Linux LITTLE_ENDIAN LONG64 LONG_DOUBLE LONG_LONG
13937 LONGDOUBLE LONGLONG LP64 luna luna88k Lynx
13938 M68000 m68k m88100 m88k M88KBCS_TARGET M_COFF
13939 M_I186 M_I286 M_I386 M_I8086 M_I86 M_I86SM M_SYS3
13940 M_SYS5 M_SYSIII M_SYSV M_UNIX M_XENIX MACH machine MachTen
13941 MATH_HAS_NO_SIDE_EFFECTS
13942 mc300 mc500 mc68000 mc68010 mc68020 mc68030 mc68040
13943 mc68060 mc68k mc68k32 mc700 mc88000 mc88100 merlin
13944 mert MiNT mips MIPS_FPSET MIPS_ISA MIPS_SIM MIPS_SZINT
13945 MIPS_SZLONG MIPS_SZPTR MIPSEB MIPSEL MODERN_C motorola
13946 mpeix MSDOS MTXINU MULTIMAX mvs MVS n16 ncl_el ncl_mr
13947 NetBSD news1500 news1700 news1800 news1900 news3700
13948 news700 news800 news900 NeXT NLS ns16000 ns32000
13949 ns32016 ns32332 ns32k nsc32000
13950 OCS88 OEMVS OpenBSD os OS2 OS390 osf OSF1 OSF_SOURCE
13951 pa_risc PA_RISC1_1 PA_RISC2_0 PARAGON parisc
13952 pc532 pdp11 PGC PIC plexus PORTAR posix
13953 POSIX1B_SOURCE POSIX2_SOURCE POSIX4_SOURCE
13954 POSIX_C_SOURCE POSIX_SOURCE POWER
13955 PROTOTYPES PWB pyr QNX R3000 REENTRANT RES Rhapsody RISC6000
13956 riscix riscos RT scs SCO sequent sgi SGI_SOURCE sinix
13957 SIZE_INT SIZE_LONG SIZE_PTR SOCKET_SOURCE SOCKETS_SOURCE
13958 sony sony_news sonyrisc sparc sparclite spectrum
13959 stardent stdc STDC_EXT stratos sun sun3 sun386
13960 Sun386i svr3 svr4 SVR4_2 SVR4_SOURCE svr5
13961 SX system SYSTYPE_BSD SYSTYPE_BSD43 SYSTYPE_BSD44
13962 SYSTYPE_SVR4 SYSTYPE_SVR5 SYSTYPE_SYSV SYSV SYSV3 SYSV4 SYSV5
13963 sysV68 sysV88 Tek4132 Tek4300 titan
13964 tower tower32 tower32_200 tower32_600 tower32_700
13965 tower32_800 tower32_850 tss
13966 u370 u3b u3b2 u3b20 u3b200 u3b20d u3b5
13967 ultrix UMAXV UnicomPBB UnicomPBD UNICOS UNICOSMK
13968 unix UNIX95 UNIX99 unixpc unos USGr4 USGr4_2
13969 Utek UTek UTS UWIN uxpm uxps vax venix VMESA vms xenix Xenix286
13970 XOPEN_SOURCE XOPEN_SOURCE_EXTENDED XPG2 XPG2_EXTENDED
13971 XPG3 XPG3_EXTENDED XPG4 XPG4_EXTENDED
13974 # Maybe put other stuff here too.
13975 cat <<EOSH >>Cppsym.know
13978 ./tr '[a-z]' '[A-Z]' < Cppsym.know > Cppsym.a
13979 ./tr '[A-Z]' '[a-z]' < Cppsym.know > Cppsym.b
13980 $cat Cppsym.a Cppsym.b | $tr ' ' $trnl | sort | uniq > Cppsym.know
13981 $rm -f Cppsym.a Cppsym.b
13982 cat <<EOSH > Cppsym
13984 if $test \$# -gt 0; then
13985 echo \$* | $tr " " "$trnl" | ./Cppsym.try > Cppsym.got
13986 if $test -s Cppsym.got; then
13993 $tr " " "$trnl" | ./Cppsym.try
13999 cat <<EOSH > Cppsym.try
14001 cat <<'EOCP' > try.c
14007 cat <<'EOSH' >> Cppsym.try
14009 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
14010 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
14011 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
14012 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
14016 cat <<EOSH >> Cppsym.try
14018 optimize="$optimize"
14023 $cc $optimize $ccflags $ldflags -o try try.c $libs && ./try$exe_ext
14025 chmod +x Cppsym.try
14026 $eunicefix Cppsym.try
14027 ./Cppsym < Cppsym.know > Cppsym.true
14028 : now check the C compiler for additional symbols
14029 postprocess_cc_v=''
14031 aix) postprocess_cc_v="|$tr , ' '" ;;
14038 for i in \`$cc -v -c tmp.c 2>&1 $postprocess_cc_v\`
14041 -D*) echo "\$i" | $sed 's/^-D//';;
14042 -A*) $test "$gccversion" && echo "\$i" | $sed 's/^-A\(.*\)(\(.*\))/\1=\2/';;
14047 postprocess_cc_v=''
14050 ./ccsym > ccsym1.raw
14051 if $test -s ccsym1.raw; then
14052 $sort ccsym1.raw | $uniq >ccsym.raw
14054 mv ccsym1.raw ccsym.raw
14057 $awk '/\=/ { print $0; next }
14058 { print $0"=1" }' ccsym.raw >ccsym.list
14059 $awk '/\=/ { print $0; next }
14060 { print $0"=1" }' Cppsym.true >ccsym.true
14061 $comm -13 ccsym.true ccsym.list >ccsym.own
14062 $comm -12 ccsym.true ccsym.list >ccsym.com
14063 $comm -23 ccsym.true ccsym.list >ccsym.cpp
14065 if $test -z ccsym.raw; then
14066 echo "Your C compiler doesn't seem to define any symbols!" >&4
14068 echo "However, your C preprocessor defines the following symbols:"
14071 cppsymbols=`$cat Cppsym.true`
14072 cppsymbols=`echo $cppsymbols`
14073 cppccsymbols="$cppsymbols"
14075 if $test -s ccsym.com; then
14076 echo "Your C compiler and pre-processor define these symbols:"
14077 $sed -e 's/\(.*\)=.*/\1/' ccsym.com
14080 cppccsymbols=`$cat ccsym.com`
14081 cppccsymbols=`echo $cppccsymbols`
14082 $test "$silent" || sleep 1
14084 if $test -s ccsym.cpp; then
14085 $test "$also" && echo " "
14086 echo "Your C pre-processor ${also}defines the following symbols:"
14087 $sed -e 's/\(.*\)=.*/\1/' ccsym.cpp
14089 cppsymbols=`$cat ccsym.cpp`
14090 cppsymbols=`echo $cppsymbols`
14091 $test "$silent" || sleep 1
14093 if $test -s ccsym.own; then
14094 $test "$also" && echo " "
14095 echo "Your C compiler ${also}defines the following cpp symbols:"
14096 $sed -e 's/\(.*\)=1/\1/' ccsym.own
14097 $sed -e 's/\(.*\)=.*/\1/' ccsym.own | $uniq >>Cppsym.true
14098 ccsymbols=`$cat ccsym.own`
14099 ccsymbols=`echo $ccsymbols`
14100 $test "$silent" || sleep 1
14105 : see if this is a termio system
14109 if $test `./findhdr termios.h`; then
14110 set tcsetattr i_termios
14116 "$define") echo "You have POSIX termios.h... good!" >&4;;
14117 *) if ./Cppsym pyr; then
14118 case "`/bin/universe`" in
14119 ucb) if $test `./findhdr sgtty.h`; then
14121 echo "<sgtty.h> found." >&4
14123 echo "System is pyramid with BSD universe."
14124 echo "<sgtty.h> not found--you could have problems." >&4
14126 *) if $test `./findhdr termio.h`; then
14128 echo "<termio.h> found." >&4
14130 echo "System is pyramid with USG universe."
14131 echo "<termio.h> not found--you could have problems." >&4
14135 if $test `./findhdr termio.h`; then
14136 echo "<termio.h> found." >&4
14138 elif $test `./findhdr sgtty.h`; then
14139 echo "<sgtty.h> found." >&4
14142 echo "Neither <termio.h> nor <sgtty.h> found--you could have problems." >&4
14145 if $test `./findhdr sgtty.h`; then
14146 echo "<sgtty.h> found." >&4
14148 elif $test `./findhdr termio.h`; then
14149 echo "<termio.h> found." >&4
14152 echo "Neither <sgtty.h> nor <termio.h> found--you could have problems." >&4
14156 set i_termio; eval $setvar
14157 val=$val2; set i_sgtty; eval $setvar
14158 val=$val3; set i_termios; eval $setvar
14160 : see if this is a shadow.h system
14161 set shadow.h i_shadow
14164 : see if this is a socks.h system
14165 set socks.h i_socks
14168 : see if stdarg is available
14170 if $test `./findhdr stdarg.h`; then
14171 echo "<stdarg.h> found." >&4
14174 echo "<stdarg.h> NOT found." >&4
14178 : see if varags is available
14180 if $test `./findhdr varargs.h`; then
14181 echo "<varargs.h> found." >&4
14183 echo "<varargs.h> NOT found, but that's ok (I hope)." >&4
14186 : set up the varargs testing programs
14187 $cat > varargs.c <<EOP
14189 #include <stdarg.h>
14192 #include <varargs.h>
14196 int f(char *p, ...)
14210 p = va_arg(ap, char *);
14215 $cat > varargs <<EOP
14217 if $cc -c $ccflags -D\$1 varargs.c >/dev/null 2>&1; then
14226 : now check which varargs header should be included
14231 if `./varargs I_STDARG`; then
14233 elif `./varargs I_VARARGS`; then
14238 if `./varargs I_VARARGS`; then
14245 echo "I could not find the definition for va_dcl... You have problems..." >&4
14246 val="$undef"; set i_stdarg; eval $setvar
14247 val="$undef"; set i_varargs; eval $setvar
14252 case "$i_varhdr" in
14254 val="$define"; set i_stdarg; eval $setvar
14255 val="$undef"; set i_varargs; eval $setvar
14258 val="$undef"; set i_stdarg; eval $setvar
14259 val="$define"; set i_varargs; eval $setvar
14262 echo "We'll include <$i_varhdr> to get va_dcl definition." >&4;;
14266 : see if stddef is available
14267 set stddef.h i_stddef
14270 : see if sys/access.h is available
14271 set sys/access.h i_sysaccess
14274 : see if ioctl defs are in sgtty, termio, sys/filio or sys/ioctl
14275 set sys/filio.h i_sysfilio
14278 if $test `./findhdr sys/ioctl.h`; then
14280 echo '<sys/ioctl.h> found.' >&4
14283 if $test $i_sysfilio = "$define"; then
14284 echo '<sys/ioctl.h> NOT found.' >&4
14286 $test $i_sgtty = "$define" && xxx="sgtty.h"
14287 $test $i_termio = "$define" && xxx="termio.h"
14288 $test $i_termios = "$define" && xxx="termios.h"
14289 echo "No <sys/ioctl.h> found, assuming ioctl args are defined in <$xxx>." >&4
14296 : see if this is a syslog.h system
14297 set syslog.h i_syslog
14301 : see if this is a sys/mode.h system
14302 set sys/mode.h i_sysmode
14305 : see if sys/resource.h has to be included
14306 set sys/resource.h i_sysresrc
14309 : see if sys/security.h is available
14310 set sys/security.h i_syssecrt
14313 : see if this is a sys/statvfs.h system
14314 set sys/statvfs.h i_sysstatvfs
14317 : see if this is a sys/uio.h system
14318 set sys/uio.h i_sysuio
14321 : see if this is a sys/un.h system
14322 set sys/un.h i_sysun
14326 : see if this is a sys/utsname.h system
14327 set sys/utsname.h i_sysutsname
14330 : see if this is a syswait system
14331 set sys/wait.h i_syswait
14334 : see if this is a ustat.h system
14335 set ustat.h i_ustat
14338 : see if this is an utime system
14339 set utime.h i_utime
14342 : see if this is a values.h system
14343 set values.h i_values
14346 : see if this is a vfork system
14349 set vfork.h i_vfork
14357 : see if gdbm.h is available
14362 : see if gdbm_open exists
14363 set gdbm_open d_gdbm_open
14365 case "$d_gdbm_open" in
14368 echo "We won't be including <gdbm.h>"
14378 echo "Looking for extensions..." >&4
14379 : If we are using the old config.sh, known_extensions may contain
14380 : old or inaccurate or duplicate values.
14381 known_extensions=''
14382 nonxs_extensions=''
14383 : We do not use find because it might not be available.
14384 : We do not just use MANIFEST because the user may have dropped
14385 : some additional extensions into the source tree and expect them
14388 : Function to recursively find available extensions, ignoring DynaLoader
14389 : NOTE: recursion limit of 10 to prevent runaway in case of symlink madness
14393 DynaLoader|dynaload) ;;
14395 if $test -f $xxx/$xxx.xs; then
14396 known_extensions="$known_extensions $1$xxx";
14397 elif $test -f $xxx/Makefile.PL; then
14398 nonxs_extensions="$nonxs_extensions $1$xxx";
14400 if $test -d $xxx -a $# -lt 10; then
14403 eval $find_extensions;
14415 eval $find_extensions
14416 set X $nonxs_extensions
14418 nonxs_extensions="$*"
14419 set X $known_extensions
14421 known_extensions="$*"
14424 : Now see which are supported on this system.
14426 for xxx in $known_extensions ; do
14430 $define) avail_ext="$avail_ext $xxx" ;;
14433 GDBM_File|gdbm_fil)
14435 $define) avail_ext="$avail_ext $xxx" ;;
14438 NDBM_File|ndbm_fil)
14441 case "$osname-$use64bits" in
14444 *-lndbm*) avail_ext="$avail_ext $xxx" ;;
14447 *) avail_ext="$avail_ext $xxx" ;;
14452 ODBM_File|odbm_fil)
14453 case "${i_dbm}${i_rpcsvcdbm}" in
14455 case "$osname-$use64bits" in
14458 *-ldbm*) avail_ext="$avail_ext $xxx" ;;
14461 *) avail_ext="$avail_ext $xxx" ;;
14467 case "$useposix" in
14468 true|define|y) avail_ext="$avail_ext $xxx" ;;
14472 case "$useopcode" in
14473 true|define|y) avail_ext="$avail_ext $xxx" ;;
14477 case "$d_socket" in
14478 true|$define|y) avail_ext="$avail_ext $xxx" ;;
14482 case "$usethreads" in
14483 true|$define|y) avail_ext="$avail_ext $xxx" ;;
14487 : XXX Do we need a useipcsysv variable here
14488 case "${d_msg}${d_sem}${d_shm}" in
14489 *"${define}"*) avail_ext="$avail_ext $xxx" ;;
14492 *) avail_ext="$avail_ext $xxx"
14501 : Now see which nonxs extensions are supported on this system.
14502 : For now assume all are.
14504 for xxx in $nonxs_extensions ; do
14506 *) nonxs_ext="$nonxs_ext $xxx"
14518 A number of extensions are supplied with $package. You may choose to
14519 compile these extensions for dynamic loading (the default), compile
14520 them into the $package executable (static loading), or not include
14521 them at all. Answer "none" to include no extensions.
14522 Note that DynaLoader is always built and need not be mentioned here.
14525 case "$dynamic_ext" in
14526 '') dflt="$avail_ext" ;;
14527 *) dflt="$dynamic_ext"
14528 # Perhaps we are reusing an old out-of-date config.sh.
14531 if test X"$dynamic_ext" != X"$avail_ext"; then
14533 NOTICE: Your previous config.sh list may be incorrect.
14534 The extensions now available to you are
14536 but the default list from your previous config.sh is
14548 rp="What extensions do you wish to load dynamically?"
14551 none) dynamic_ext=' ' ;;
14552 *) dynamic_ext="$ans" ;;
14555 case "$static_ext" in
14557 : Exclude those already listed in dynamic linking
14559 for xxx in $avail_ext; do
14560 case " $dynamic_ext " in
14562 *) dflt="$dflt $xxx" ;;
14569 *) dflt="$static_ext"
14576 rp="What extensions do you wish to load statically?"
14579 none) static_ext=' ' ;;
14580 *) static_ext="$ans" ;;
14585 A number of extensions are supplied with $package. Answer "none"
14586 to include no extensions.
14587 Note that DynaLoader is always built and need not be mentioned here.
14590 case "$static_ext" in
14591 '') dflt="$avail_ext" ;;
14592 *) dflt="$static_ext"
14593 # Perhaps we are reusing an old out-of-date config.sh.
14596 if test X"$static_ext" != X"$avail_ext"; then
14598 NOTICE: Your previous config.sh list may be incorrect.
14599 The extensions now available to you are
14601 but the default list from your previous config.sh is
14610 : Exclude those that are not xs extensions
14614 rp="What extensions do you wish to include?"
14617 none) static_ext=' ' ;;
14618 *) static_ext="$ans" ;;
14623 set X $dynamic_ext $static_ext $nonxs_ext
14627 : Remove build directory name from cppstdin so it can be used from
14628 : either the present location or the final installed location.
14630 : Get out of the UU directory to get correct path name.
14632 case "$cppstdin" in
14634 echo "Stripping down cppstdin path name"
14640 : end of configuration questions
14642 echo "End of configuration questions."
14645 : back to where it started
14646 if test -d ../UU; then
14650 : configuration may be patched via a 'config.over' file
14651 if $test -f config.over; then
14654 rp='I see a config.over file. Do you wish to load it?'
14657 n*) echo "OK, I'll ignore it.";;
14659 echo "Configuration override changes have been loaded."
14664 : in case they want portability, strip down executable paths
14665 case "$d_portable" in
14668 echo "Stripping down executable paths..." >&4
14669 for file in $loclist $trylist; do
14671 eval $file=`basename $temp`
14676 : create config.sh file
14678 echo "Creating config.sh..." >&4
14679 $spitshell <<EOT >config.sh
14682 # This file was produced by running the Configure script. It holds all the
14683 # definitions figured out by Configure. Should you modify one of these values,
14684 # do not forget to propagate your changes by running "Configure -der". You may
14685 # instead choose to run each of the .SH files by yourself, or "Configure -S".
14688 # Package name : $package
14689 # Source directory : $src
14690 # Configuration time: $cf_time
14691 # Configured by : $cf_by
14692 # Target system : $myuname
14702 Revision='$Revision'
14709 alignbytes='$alignbytes'
14710 ansi2knr='$ansi2knr'
14711 aphostname='$aphostname'
14712 api_revision='$api_revision'
14713 api_subversion='$api_subversion'
14714 api_version='$api_version'
14715 api_versionstring='$api_versionstring'
14718 archlibexp='$archlibexp'
14719 archname64='$archname64'
14720 archname='$archname'
14721 archobjs='$archobjs'
14726 bincompat5005='$bincompat5005'
14730 byteorder='$byteorder'
14732 castflags='$castflags'
14735 cccdlflags='$cccdlflags'
14736 ccdlflags='$ccdlflags'
14738 ccsymbols='$ccsymbols'
14740 cf_email='$cf_email'
14742 charsize='$charsize'
14746 clocktype='$clocktype'
14748 compress='$compress'
14749 contains='$contains'
14753 cpp_stuff='$cpp_stuff'
14754 cppccsymbols='$cppccsymbols'
14755 cppflags='$cppflags'
14757 cppminus='$cppminus'
14759 cppstdin='$cppstdin'
14760 cppsymbols='$cppsymbols'
14761 crosscompile='$crosscompile'
14762 cryptlib='$cryptlib'
14764 d_Gconvert='$d_Gconvert'
14765 d_PRIEldbl='$d_PRIEldbl'
14766 d_PRIFldbl='$d_PRIFldbl'
14767 d_PRIGldbl='$d_PRIGldbl'
14768 d_PRIX64='$d_PRIX64'
14769 d_PRId64='$d_PRId64'
14770 d_PRIeldbl='$d_PRIeldbl'
14771 d_PRIfldbl='$d_PRIfldbl'
14772 d_PRIgldbl='$d_PRIgldbl'
14773 d_PRIi64='$d_PRIi64'
14774 d_PRIo64='$d_PRIo64'
14775 d_PRIu64='$d_PRIu64'
14776 d_PRIx64='$d_PRIx64'
14777 d_access='$d_access'
14778 d_accessx='$d_accessx'
14780 d_archlib='$d_archlib'
14783 d_attribut='$d_attribut'
14786 d_bincompat5005='$d_bincompat5005'
14788 d_bsdgetpgrp='$d_bsdgetpgrp'
14789 d_bsdsetpgrp='$d_bsdsetpgrp'
14791 d_casti32='$d_casti32'
14792 d_castneg='$d_castneg'
14793 d_charvspr='$d_charvspr'
14795 d_chroot='$d_chroot'
14796 d_chsize='$d_chsize'
14797 d_closedir='$d_closedir'
14801 d_cuserid='$d_cuserid'
14802 d_dbl_dig='$d_dbl_dig'
14803 d_difftime='$d_difftime'
14804 d_dirnamlen='$d_dirnamlen'
14805 d_dlerror='$d_dlerror'
14806 d_dlopen='$d_dlopen'
14807 d_dlsymun='$d_dlsymun'
14808 d_dosuid='$d_dosuid'
14809 d_drand48proto='$d_drand48proto'
14811 d_eaccess='$d_eaccess'
14812 d_endgrent='$d_endgrent'
14813 d_endhent='$d_endhent'
14814 d_endnent='$d_endnent'
14815 d_endpent='$d_endpent'
14816 d_endpwent='$d_endpwent'
14817 d_endsent='$d_endsent'
14818 d_endspent='$d_endspent'
14819 d_eofnblk='$d_eofnblk'
14820 d_eunice='$d_eunice'
14821 d_fchmod='$d_fchmod'
14822 d_fchown='$d_fchown'
14824 d_fd_macros='$d_fd_macros'
14825 d_fd_set='$d_fd_set'
14826 d_fds_bits='$d_fds_bits'
14827 d_fgetpos='$d_fgetpos'
14828 d_flexfnam='$d_flexfnam'
14831 d_fpathconf='$d_fpathconf'
14832 d_fpos64_t='$d_fpos64_t'
14833 d_fs_data_s='$d_fs_data_s'
14834 d_fseeko='$d_fseeko'
14835 d_fsetpos='$d_fsetpos'
14836 d_fstatfs='$d_fstatfs'
14837 d_fstatvfs='$d_fstatvfs'
14838 d_ftello='$d_ftello'
14840 d_getcwd='$d_getcwd'
14841 d_getfsstat='$d_getfsstat'
14842 d_getgrent='$d_getgrent'
14843 d_getgrps='$d_getgrps'
14844 d_gethbyaddr='$d_gethbyaddr'
14845 d_gethbyname='$d_gethbyname'
14846 d_gethent='$d_gethent'
14847 d_gethname='$d_gethname'
14848 d_gethostprotos='$d_gethostprotos'
14849 d_getlogin='$d_getlogin'
14850 d_getmnt='$d_getmnt'
14851 d_getmntent='$d_getmntent'
14852 d_getnbyaddr='$d_getnbyaddr'
14853 d_getnbyname='$d_getnbyname'
14854 d_getnent='$d_getnent'
14855 d_getnetprotos='$d_getnetprotos'
14856 d_getpbyname='$d_getpbyname'
14857 d_getpbynumber='$d_getpbynumber'
14858 d_getpent='$d_getpent'
14859 d_getpgid='$d_getpgid'
14860 d_getpgrp2='$d_getpgrp2'
14861 d_getpgrp='$d_getpgrp'
14862 d_getppid='$d_getppid'
14863 d_getprior='$d_getprior'
14864 d_getprotoprotos='$d_getprotoprotos'
14865 d_getpwent='$d_getpwent'
14866 d_getsbyname='$d_getsbyname'
14867 d_getsbyport='$d_getsbyport'
14868 d_getsent='$d_getsent'
14869 d_getservprotos='$d_getservprotos'
14870 d_getspent='$d_getspent'
14871 d_getspnam='$d_getspnam'
14872 d_gettimeod='$d_gettimeod'
14873 d_gnulibc='$d_gnulibc'
14874 d_grpasswd='$d_grpasswd'
14875 d_hasmntopt='$d_hasmntopt'
14879 d_inetaton='$d_inetaton'
14880 d_int64_t='$d_int64_t'
14881 d_isascii='$d_isascii'
14882 d_killpg='$d_killpg'
14883 d_lchown='$d_lchown'
14884 d_ldbl_dig='$d_ldbl_dig'
14886 d_locconv='$d_locconv'
14888 d_longdbl='$d_longdbl'
14889 d_longlong='$d_longlong'
14890 d_lseekproto='$d_lseekproto'
14893 d_mbstowcs='$d_mbstowcs'
14894 d_mbtowc='$d_mbtowc'
14895 d_memchr='$d_memchr'
14896 d_memcmp='$d_memcmp'
14897 d_memcpy='$d_memcpy'
14898 d_memmove='$d_memmove'
14899 d_memset='$d_memset'
14901 d_mkdtemp='$d_mkdtemp'
14902 d_mkfifo='$d_mkfifo'
14903 d_mkstemp='$d_mkstemp'
14904 d_mkstemps='$d_mkstemps'
14905 d_mktime='$d_mktime'
14907 d_mprotect='$d_mprotect'
14909 d_msg_ctrunc='$d_msg_ctrunc'
14910 d_msg_dontroute='$d_msg_dontroute'
14911 d_msg_oob='$d_msg_oob'
14912 d_msg_peek='$d_msg_peek'
14913 d_msg_proxy='$d_msg_proxy'
14914 d_msgctl='$d_msgctl'
14915 d_msgget='$d_msgget'
14916 d_msgrcv='$d_msgrcv'
14917 d_msgsnd='$d_msgsnd'
14919 d_munmap='$d_munmap'
14920 d_mymalloc='$d_mymalloc'
14922 d_nv_preserves_uv='$d_nv_preserves_uv'
14923 d_off64_t='$d_off64_t'
14924 d_old_pthread_create_joinable='$d_old_pthread_create_joinable'
14925 d_oldpthreads='$d_oldpthreads'
14926 d_oldsock='$d_oldsock'
14928 d_pathconf='$d_pathconf'
14930 d_phostname='$d_phostname'
14933 d_portable='$d_portable'
14934 d_pthread_yield='$d_pthread_yield'
14936 d_pwchange='$d_pwchange'
14937 d_pwclass='$d_pwclass'
14938 d_pwcomment='$d_pwcomment'
14939 d_pwexpire='$d_pwexpire'
14940 d_pwgecos='$d_pwgecos'
14941 d_pwpasswd='$d_pwpasswd'
14942 d_pwquota='$d_pwquota'
14944 d_readdir='$d_readdir'
14945 d_readlink='$d_readlink'
14946 d_rename='$d_rename'
14947 d_rewinddir='$d_rewinddir'
14949 d_safebcpy='$d_safebcpy'
14950 d_safemcpy='$d_safemcpy'
14951 d_sanemcmp='$d_sanemcmp'
14952 d_sched_yield='$d_sched_yield'
14953 d_scm_rights='$d_scm_rights'
14954 d_seekdir='$d_seekdir'
14955 d_select='$d_select'
14957 d_semctl='$d_semctl'
14958 d_semctl_semid_ds='$d_semctl_semid_ds'
14959 d_semctl_semun='$d_semctl_semun'
14960 d_semget='$d_semget'
14962 d_setegid='$d_setegid'
14963 d_seteuid='$d_seteuid'
14964 d_setgrent='$d_setgrent'
14965 d_setgrps='$d_setgrps'
14966 d_sethent='$d_sethent'
14967 d_setlinebuf='$d_setlinebuf'
14968 d_setlocale='$d_setlocale'
14969 d_setnent='$d_setnent'
14970 d_setpent='$d_setpent'
14971 d_setpgid='$d_setpgid'
14972 d_setpgrp2='$d_setpgrp2'
14973 d_setpgrp='$d_setpgrp'
14974 d_setprior='$d_setprior'
14975 d_setpwent='$d_setpwent'
14976 d_setregid='$d_setregid'
14977 d_setresgid='$d_setresgid'
14978 d_setresuid='$d_setresuid'
14979 d_setreuid='$d_setreuid'
14980 d_setrgid='$d_setrgid'
14981 d_setruid='$d_setruid'
14982 d_setsent='$d_setsent'
14983 d_setsid='$d_setsid'
14984 d_setspent='$d_setspent'
14985 d_setvbuf='$d_setvbuf'
14989 d_shmatprototype='$d_shmatprototype'
14990 d_shmctl='$d_shmctl'
14992 d_shmget='$d_shmget'
14993 d_sigaction='$d_sigaction'
14994 d_sigsetjmp='$d_sigsetjmp'
14995 d_socket='$d_socket'
14996 d_socklen_t='$d_socklen_t'
14997 d_sockpair='$d_sockpair'
14999 d_statblks='$d_statblks'
15000 d_statfs_f_flags='$d_statfs_f_flags'
15001 d_statfs_s='$d_statfs_s'
15002 d_statvfs='$d_statvfs'
15003 d_stdio_cnt_lval='$d_stdio_cnt_lval'
15004 d_stdio_ptr_lval='$d_stdio_ptr_lval'
15005 d_stdio_stream_array='$d_stdio_stream_array'
15006 d_stdiobase='$d_stdiobase'
15007 d_stdstdio='$d_stdstdio'
15008 d_strchr='$d_strchr'
15009 d_strcoll='$d_strcoll'
15010 d_strctcpy='$d_strctcpy'
15011 d_strerrm='$d_strerrm'
15012 d_strerror='$d_strerror'
15013 d_strtod='$d_strtod'
15014 d_strtol='$d_strtol'
15015 d_strtold='$d_strtold'
15016 d_strtoll='$d_strtoll'
15017 d_strtoul='$d_strtoul'
15018 d_strtoull='$d_strtoull'
15019 d_strtouq='$d_strtouq'
15020 d_strxfrm='$d_strxfrm'
15021 d_suidsafe='$d_suidsafe'
15022 d_symlink='$d_symlink'
15023 d_syscall='$d_syscall'
15024 d_sysconf='$d_sysconf'
15025 d_sysernlst='$d_sysernlst'
15026 d_syserrlst='$d_syserrlst'
15027 d_system='$d_system'
15028 d_tcgetpgrp='$d_tcgetpgrp'
15029 d_tcsetpgrp='$d_tcsetpgrp'
15030 d_telldir='$d_telldir'
15031 d_telldirproto='$d_telldirproto'
15034 d_truncate='$d_truncate'
15035 d_tzname='$d_tzname'
15038 d_union_semun='$d_union_semun'
15040 d_vendorbin='$d_vendorbin'
15041 d_vendorlib='$d_vendorlib'
15043 d_void_closedir='$d_void_closedir'
15044 d_voidsig='$d_voidsig'
15045 d_voidtty='$d_voidtty'
15046 d_volatile='$d_volatile'
15047 d_vprintf='$d_vprintf'
15049 d_waitpid='$d_waitpid'
15050 d_wcstombs='$d_wcstombs'
15051 d_wctomb='$d_wctomb'
15054 db_hashtype='$db_hashtype'
15055 db_prefixtype='$db_prefixtype'
15056 defvoidused='$defvoidused'
15057 direntrytype='$direntrytype'
15060 doublesize='$doublesize'
15062 dynamic_ext='$dynamic_ext'
15068 eunicefix='$eunicefix'
15071 extensions='$extensions'
15072 fflushNULL='$fflushNULL'
15073 fflushall='$fflushall'
15075 firstmakefile='$firstmakefile'
15077 fpossize='$fpossize'
15078 fpostype='$fpostype'
15079 freetype='$freetype'
15081 full_csh='$full_csh'
15082 full_sed='$full_sed'
15083 gccversion='$gccversion'
15084 gidformat='$gidformat'
15090 groupcat='$groupcat'
15091 groupstype='$groupstype'
15094 h_sysfile='$h_sysfile'
15106 i_arpainet='$i_arpainet'
15107 i_bsdioctl='$i_bsdioctl'
15110 i_dirent='$i_dirent'
15118 i_inttypes='$i_inttypes'
15119 i_limits='$i_limits'
15120 i_locale='$i_locale'
15121 i_machcthr='$i_machcthr'
15122 i_malloc='$i_malloc'
15124 i_memory='$i_memory'
15125 i_mntent='$i_mntent'
15128 i_neterrno='$i_neterrno'
15129 i_netinettcp='$i_netinettcp'
15132 i_pthread='$i_pthread'
15134 i_rpcsvcdbm='$i_rpcsvcdbm'
15137 i_shadow='$i_shadow'
15139 i_stdarg='$i_stdarg'
15140 i_stddef='$i_stddef'
15141 i_stdlib='$i_stdlib'
15142 i_string='$i_string'
15143 i_sysaccess='$i_sysaccess'
15144 i_sysdir='$i_sysdir'
15145 i_sysfile='$i_sysfile'
15146 i_sysfilio='$i_sysfilio'
15148 i_sysioctl='$i_sysioctl'
15149 i_syslog='$i_syslog'
15150 i_sysmman='$i_sysmman'
15151 i_sysmode='$i_sysmode'
15152 i_sysmount='$i_sysmount'
15153 i_sysndir='$i_sysndir'
15154 i_sysparam='$i_sysparam'
15155 i_sysresrc='$i_sysresrc'
15156 i_syssecrt='$i_syssecrt'
15157 i_sysselct='$i_sysselct'
15158 i_syssockio='$i_syssockio'
15159 i_sysstat='$i_sysstat'
15160 i_sysstatfs='$i_sysstatfs'
15161 i_sysstatvfs='$i_sysstatvfs'
15162 i_systime='$i_systime'
15163 i_systimek='$i_systimek'
15164 i_systimes='$i_systimes'
15165 i_systypes='$i_systypes'
15166 i_sysuio='$i_sysuio'
15168 i_sysutsname='$i_sysutsname'
15169 i_sysvfs='$i_sysvfs'
15170 i_syswait='$i_syswait'
15171 i_termio='$i_termio'
15172 i_termios='$i_termios'
15174 i_unistd='$i_unistd'
15177 i_values='$i_values'
15178 i_varargs='$i_varargs'
15179 i_varhdr='$i_varhdr'
15181 ignore_versioned_solibs='$ignore_versioned_solibs'
15182 inc_version_list='$inc_version_list'
15183 inc_version_list_init='$inc_version_list_init'
15186 installarchlib='$installarchlib'
15187 installbin='$installbin'
15188 installman1dir='$installman1dir'
15189 installman3dir='$installman3dir'
15190 installprefix='$installprefix'
15191 installprefixexp='$installprefixexp'
15192 installprivlib='$installprivlib'
15193 installscript='$installscript'
15194 installsitearch='$installsitearch'
15195 installsitebin='$installsitebin'
15196 installsitelib='$installsitelib'
15197 installstyle='$installstyle'
15198 installusrbinperl='$installusrbinperl'
15199 installvendorbin='$installvendorbin'
15200 installvendorlib='$installvendorlib'
15202 ivdformat='$ivdformat'
15205 known_extensions='$known_extensions'
15209 lddlflags='$lddlflags'
15211 ldlibpthname='$ldlibpthname'
15218 libsdirs='$libsdirs'
15219 libsfiles='$libsfiles'
15220 libsfound='$libsfound'
15221 libspath='$libspath'
15222 libswanted='$libswanted'
15228 locincpth='$locincpth'
15229 loclibpth='$loclibpth'
15230 longdblsize='$longdblsize'
15231 longlongsize='$longlongsize'
15232 longsize='$longsize'
15236 lseeksize='$lseeksize'
15237 lseektype='$lseektype'
15241 make_set_make='$make_set_make'
15242 mallocobj='$mallocobj'
15243 mallocsrc='$mallocsrc'
15244 malloctype='$malloctype'
15246 man1direxp='$man1direxp'
15249 man3direxp='$man3direxp'
15252 mips_type='$mips_type'
15254 mmaptype='$mmaptype'
15256 modetype='$modetype'
15258 multiarch='$multiarch'
15260 myarchname='$myarchname'
15261 mydomain='$mydomain'
15262 myhostname='$myhostname'
15265 netdb_hlen_type='$netdb_hlen_type'
15266 netdb_host_type='$netdb_host_type'
15267 netdb_name_type='$netdb_name_type'
15268 netdb_net_type='$netdb_net_type'
15271 nm_so_opt='$nm_so_opt'
15272 nonxs_ext='$nonxs_ext'
15276 o_nonblock='$o_nonblock'
15278 old_pthread_create_joinable='$old_pthread_create_joinable'
15279 optimize='$optimize'
15280 orderlib='$orderlib'
15286 patchlevel='$patchlevel'
15287 path_sep='$path_sep'
15290 perladmin='$perladmin'
15291 perlpath='$perlpath'
15293 phostname='$phostname'
15296 pm_apiversion='$pm_apiversion'
15300 prefixexp='$prefixexp'
15302 privlibexp='$privlibexp'
15303 prototype='$prototype'
15305 quadkind='$quadkind'
15306 quadtype='$quadtype'
15307 randbits='$randbits'
15308 randfunc='$randfunc'
15309 randseedtype='$randseedtype'
15311 rd_nodata='$rd_nodata'
15312 revision='$revision'
15316 sPRIEldbl='$sPRIEldbl'
15317 sPRIFldbl='$sPRIFldbl'
15318 sPRIGldbl='$sPRIGldbl'
15321 sPRIeldbl='$sPRIeldbl'
15322 sPRIfldbl='$sPRIfldbl'
15323 sPRIgldbl='$sPRIgldbl'
15328 sched_yield='$sched_yield'
15329 scriptdir='$scriptdir'
15330 scriptdirexp='$scriptdirexp'
15332 seedfunc='$seedfunc'
15333 selectminbits='$selectminbits'
15334 selecttype='$selecttype'
15335 sendmail='$sendmail'
15338 sharpbang='$sharpbang'
15339 shmattype='$shmattype'
15340 shortsize='$shortsize'
15343 sig_count='$sig_count'
15344 sig_name='$sig_name'
15345 sig_name_init='$sig_name_init'
15347 sig_num_init='$sig_num_init'
15348 signal_t='$signal_t'
15349 sitearch='$sitearch'
15350 sitearchexp='$sitearchexp'
15352 sitebinexp='$sitebinexp'
15354 sitelibexp='$sitelibexp'
15355 siteprefix='$siteprefix'
15356 siteprefixexp='$siteprefixexp'
15357 sizetype='$sizetype'
15362 sockethdr='$sockethdr'
15363 socketlib='$socketlib'
15364 socksizetype='$socksizetype'
15366 spackage='$spackage'
15367 spitshell='$spitshell'
15370 ssizetype='$ssizetype'
15371 startperl='$startperl'
15373 static_ext='$static_ext'
15375 stdio_base='$stdio_base'
15376 stdio_bufsiz='$stdio_bufsiz'
15377 stdio_cnt='$stdio_cnt'
15378 stdio_filbuf='$stdio_filbuf'
15379 stdio_ptr='$stdio_ptr'
15380 stdio_stream_array='$stdio_stream_array'
15383 subversion='$subversion'
15390 timeincl='$timeincl'
15391 timetype='$timetype'
15404 uidformat='$uidformat'
15410 uquadtype='$uquadtype'
15411 use5005threads='$use5005threads'
15412 use64bits='$use64bits'
15414 usefull64bits='$usefull64bits'
15415 useithreads='$useithreads'
15416 uselargefiles='$uselargefiles'
15417 uselongdouble='$uselongdouble'
15418 usemorebits='$usemorebits'
15419 usemultiplicity='$usemultiplicity'
15420 usemymalloc='$usemymalloc'
15422 useopcode='$useopcode'
15423 useperlio='$useperlio'
15424 useposix='$useposix'
15426 useshrplib='$useshrplib'
15427 usesocks='$usesocks'
15428 usethreads='$usethreads'
15429 usevendorprefix='$usevendorprefix'
15430 usevfork='$usevfork'
15433 uvoformat='$uvoformat'
15436 uvuformat='$uvuformat'
15437 uvxformat='$uvxformat'
15438 vendorbin='$vendorbin'
15439 vendorbinexp='$vendorbinexp'
15440 vendorlib='$vendorlib'
15441 vendorlibexp='$vendorlibexp'
15442 vendorprefix='$vendorprefix'
15443 vendorprefixexp='$vendorprefixexp'
15446 voidflags='$voidflags'
15448 xs_apiversion='$xs_apiversion'
15453 : Add in command line options if available
15454 $test -f UU/cmdline.opt && $cat UU/cmdline.opt >> config.sh
15456 : add special variables
15457 $test -f $src/patchlevel.h && \
15458 awk '/^#define[ ]+PERL_/ {printf "%s=%s\n",$2,$3}' $src/patchlevel.h >>config.sh
15459 echo "CONFIGDOTSH=true" >>config.sh
15461 : propagate old symbols
15462 if $test -f UU/config.sh; then
15463 <UU/config.sh sort | uniq >UU/oldconfig.sh
15464 sed -n 's/^\([a-zA-Z_0-9]*\)=.*/\1/p' config.sh config.sh UU/oldconfig.sh |\
15465 sort | uniq -u >UU/oldsyms
15466 set X `cat UU/oldsyms`
15472 Hmm...You had some extra variables I don't know about...I'll try to keep 'em...
15474 echo "# Variables propagated from previous config.sh file." >>config.sh
15475 for sym in `cat UU/oldsyms`; do
15476 echo " Propagating $hint variable "'$'"$sym..."
15477 eval 'tmp="$'"${sym}"'"'
15479 sed -e "s/'/'\"'\"'/g" -e "s/^/$sym='/" -e "s/$/'/" >>config.sh
15485 : Finish up by extracting the .SH files
15499 If you'd like to make any changes to the config.sh file before I begin
15500 to configure things, do it as a shell escape now (e.g. !vi config.sh).
15503 rp="Press return or use a shell escape to edit config.sh:"
15508 *) : in case they cannot read
15509 sh 1>&4 -c "$ans";;
15514 : if this fails, just run all the .SH files by hand
15521 if $contains '^depend:' [Mm]akefile >/dev/null 2>&1; then
15528 Now you need to generate make dependencies by running "$make depend".
15529 You might prefer to run it in background: "$make depend > makedepend.out &"
15530 It can take a while, so you might not want to run it right now.
15535 rp="Run $make depend now?"
15539 $make depend && echo "Now you must run a $make."
15542 echo "You must run '$make depend' then '$make'."
15545 elif test -f [Mm]akefile; then
15547 echo "Now you must run a $make."
15552 if $test -f Policy.sh; then
15555 If you compile $package on a different machine or from a different object
15556 directory, copy the Policy.sh file from this object directory to the
15557 new one before you run Configure -- this will help you with most of
15558 the policy defaults.
15562 if $test -f config.msg; then
15563 echo "Hmm. I also noted the following information while running:"
15565 $cat config.msg >&4
15568 $rm -f kit*isdone ark*isdone