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 Mon Apr 24 23:59:43 EET DST 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
459 d_old_pthread_create_joinable=''
460 old_pthread_create_joinable=''
702 inc_version_list_init=''
720 ignore_versioned_solibs=''
887 d_stdio_stream_array=''
888 stdio_stream_array=''
939 smallmach='pdp11 i8086 z8000 i80286 iAPX286'
942 : We must find out about Eunice early
944 if test -f /etc/unixtovms; then
945 eunicefix=/etc/unixtovms
947 if test -f /etc/unixtovms.exe; then
948 eunicefix=/etc/unixtovms.exe
952 : set useposix=false in your hint file to disable the POSIX extension.
954 : set useopcode=false in your hint file to disable the Opcode extension.
956 : Trailing extension. Override this in a hint file, if needed.
958 : Extra object files, if any, needed on this platform.
960 : Possible local include directories to search.
961 : Set locincpth to "" in a hint file to defeat local include searches.
962 locincpth="/usr/local/include /opt/local/include /usr/gnu/include"
963 locincpth="$locincpth /opt/gnu/include /usr/GNU/include /opt/GNU/include"
965 : no include file wanted by default
969 : change the next line if compiling for Xenix/286 on Xenix/386
970 xlibpth='/usr/lib/386 /lib/386'
971 : Possible local library directories to search.
972 loclibpth="/usr/local/lib /opt/local/lib /usr/gnu/lib"
973 loclibpth="$loclibpth /opt/gnu/lib /usr/GNU/lib /opt/GNU/lib"
975 : general looking path for locating libraries
976 glibpth="/usr/lib/large /lib /usr/lib $xlibpth"
977 glibpth="$glibpth /lib/large /usr/lib/small /lib/small"
978 glibpth="$glibpth /usr/ccs/lib /usr/ucblib /usr/local/lib"
979 test -f /usr/shlib/libc.so && glibpth="/usr/shlib $glibpth"
980 test -f /shlib/libc.so && glibpth="/shlib $glibpth"
982 : Private path used by Configure to find libraries. Its value
983 : is prepended to libpth. This variable takes care of special
984 : machines, like the mips. Usually, it should be empty.
987 : default library list
989 : some systems want to use only the non-versioned libso:s
990 ignore_versioned_solibs=''
991 : set usemultiplicity on the Configure command line to enable multiplicity.
992 : set usesocks on the Configure command line to enable socks.
993 : set usethreads on the Configure command line to enable threads.
994 : full support for void wanted by default
997 : List of libraries we want.
998 : If anyone needs -lnet, put it in a hint file.
999 libswanted='sfio socket bind inet nsl nm ndbm gdbm dbm db malloc dl'
1000 libswanted="$libswanted dld ld sun m c cposix posix"
1001 libswanted="$libswanted ndir dir crypt sec"
1002 libswanted="$libswanted ucb bsd BSD PW x iconv"
1003 : We probably want to search /usr/shlib before most other libraries.
1004 : This is only used by the lib/ExtUtils/MakeMaker.pm routine extliblist.
1005 glibpth=`echo " $glibpth " | sed -e 's! /usr/shlib ! !'`
1006 glibpth="/usr/shlib $glibpth"
1007 : Do not use vfork unless overridden by a hint file.
1010 : Find the basic shell for Bourne shell scripts
1014 *bsd*|sys5*) xxx="/$SYSTYPE/bin/sh";;
1017 if test -f "$xxx"; then
1020 : Build up a list and do a single loop so we can 'break' out.
1021 pth=`echo $PATH | sed -e "s/$p_/ /g"`
1022 for xxx in sh bash ksh pdksh ash; do
1024 try="$try ${p}/${xxx}"
1028 if test -f "$xxx"; then
1031 elif test -f "$xxx.exe"; then
1042 $me: Fatal Error: I can't find a Bourne Shell anywhere.
1044 Usually it's in /bin/sh. How did you even get this far?
1045 Please contact me (Perl Maintainers) at perlbug@perl.com and
1046 we'll try to straighten this all out.
1052 : see if sh knows # comments
1053 if `$sh -c '#' >/dev/null 2>&1`; then
1057 test -f $xcat || xcat=/usr/bin/cat
1062 if test -s today; then
1065 echo "#! $xcat" > try
1069 if test -s today; then
1077 echo "Your $sh doesn't grok # comments--I will strip them later on."
1080 echo "exec grep -v '^[ ]*#'" >spitshell
1082 $eunicefix spitshell
1083 spitshell=`pwd`/spitshell
1085 echo "I presume that if # doesn't work, #! won't work either!"
1090 : figure out how to guarantee sh startup
1092 '') startsh=${sharpbang}${sh} ;;
1104 : echo "Yup, it does."
1106 echo "Hmm... '$startsh' does not guarantee sh startup..."
1107 echo "You may have to fix up the shell scripts to make sure $sh runs them."
1112 : Save command line options in file UU/cmdline.opt for later use in
1113 : generating config.sh.
1114 cat > cmdline.opt <<EOSH
1115 # Configure command line arguments.
1122 cat >>cmdline.opt <<EOSH
1123 config_arg$argn='$arg'
1125 argn=`expr $argn + 1`
1128 : produce awk script to parse command line options
1129 cat >options.awk <<'EOF'
1131 optstr = "A:dD:eEf:hKOrsSU:V"; # getopt-style specification
1133 len = length(optstr);
1134 for (i = 1; i <= len; i++) {
1135 c = substr(optstr, i, 1);
1136 if (i < len) a = substr(optstr, i + 1, 1); else a = "";
1147 if (substr(str, 1, 1) != "-") {
1148 printf("'%s'\n", str);
1152 for (i = 2; i <= len; i++) {
1153 c = substr(str, i, 1);
1155 printf("-%s\n", substr(str, i));
1161 printf("'%s'\n", substr(str, i + 1));
1174 : process the command line options
1175 set X `for arg in "$@"; do echo "X$arg"; done |
1176 sed -e s/X// | awk -f options.awk`
1181 : set up default values
1191 rm -f optdef.sh posthint.sh
1192 cat >optdef.sh <<EOS
1198 while test $# -gt 0; do
1200 -d) shift; fastread=yes;;
1201 -e) shift; alldone=cont;;
1205 if test -r "$1"; then
1208 echo "$me: cannot read config file $1." >&2
1213 -h) shift; error=true;;
1214 -r) shift; reuseval=true;;
1215 -s) shift; silent=true; realsilent=true;;
1216 -E) shift; alldone=exit;;
1217 -K) shift; knowitall=true;;
1218 -O) shift; override=true;;
1219 -S) shift; silent=true; extractsh=true;;
1224 echo "$me: use '-U symbol=', not '-D symbol='." >&2
1225 echo "$me: ignoring -D $1" >&2
1228 sed -e "s/'/'\"'\"'/g" -e "s/=\(.*\)/='\1'/" >> optdef.sh;;
1229 *) echo "$1='define'" >> optdef.sh;;
1236 *=) echo "$1" >> optdef.sh;;
1238 echo "$me: use '-D symbol=val', not '-U symbol=val'." >&2
1239 echo "$me: ignoring -U $1" >&2
1241 *) echo "$1='undef'" >> optdef.sh;;
1252 *=*) zzz=`echo $yyy|sed 's!=.*!!'`
1256 zzz=" "`echo $yyy|sed 's!^[^=]*=!!'`
1257 yyy=`echo $yyy|sed 's!=.*!!'` ;;
1263 *:*) xxx=`echo $yyy|sed 's!:.*!!'`
1264 yyy=`echo $yyy|sed 's!^[^:]*:!!'`
1265 zzz=`echo $yyy|sed 's!^[^=]*=!!'`
1266 yyy=`echo $yyy|sed 's!=.*!!'` ;;
1267 *) xxx=`echo $yyy|sed 's!:.*!!'`
1268 yyy=`echo $yyy|sed 's!^[^:]*:!!'` ;;
1274 echo "$yyy=\"\${$yyy}$zzz\"" >> posthint.sh ;;
1276 echo "$yyy=''" >> posthint.sh ;;
1281 echo "$yyy='$zzz'" >> posthint.sh ;;
1283 echo "eval \"$yyy=$zzz\"" >> posthint.sh ;;
1285 echo "$yyy=\"$zzz\${$yyy}\"" >> posthint.sh ;;
1290 echo "$yyy=$zzz" >> posthint.sh ;;
1291 *) echo "$me: unknown -A command '$xxx', ignoring -A $1" >&2 ;;
1295 -V) echo "$me generated by metaconfig 3.0 PL70." >&2
1298 -*) echo "$me: unknown option $1" >&2; shift; error=true;;
1306 Usage: $me [-dehrsEKOSV] [-f config.sh] [-D symbol] [-D symbol=value]
1307 [-U symbol] [-U symbol=] [-A command:symbol...]
1308 -d : use defaults for all answers.
1309 -e : go on without questioning past the production of config.sh.
1310 -f : specify an alternate default configuration file.
1311 -h : print this help message and exit (with an error status).
1312 -r : reuse C symbols value if possible (skips costly nm extraction).
1313 -s : silent mode, only echoes questions and essential information.
1314 -D : define symbol to have some value:
1315 -D symbol symbol gets the value 'define'
1316 -D symbol=value symbol gets the value 'value'
1317 -E : stop at the end of questions, after having produced config.sh.
1318 -K : do not use unless you know what you are doing.
1319 -O : let -D and -U override definitions from loaded configuration file.
1320 -S : perform variable substitutions on all .SH files (can mix with -f)
1321 -U : undefine symbol:
1322 -U symbol symbol gets the value 'undef'
1323 -U symbol= symbol gets completely empty
1324 -A : manipulate symbol after the platform specific hints have been applied:
1325 -A symbol=value append " "value to symbol
1326 -A append:symbol=value append value to symbol
1327 -A define:symbol=value define symbol to have value
1328 -A clear:symbol define symbol to be ''
1329 -A define:symbol define symbol to be 'define'
1330 -A eval:symbol=value define symbol to be eval of value
1331 -A prepend:symbol=value prepend value to symbol
1332 -A undef:symbol define symbol to be 'undef'
1333 -A undef:symbol= define symbol to be ''
1334 -V : print version number and exit (with a zero status).
1341 case "$fastread$alldone" in
1344 if test ! -t 0; then
1345 echo "Say 'sh Configure', not 'sh <Configure'"
1353 true) exec 1>/dev/null;;
1356 : run the defines and the undefines, if any, but leave the file out there...
1359 : create the posthint manipulation script and leave the file out there...
1364 first=`echo $package | sed -e 's/^\(.\).*/\1/'`
1365 last=`echo $package | sed -e 's/^.\(.*\)/\1/'`
1366 case "`echo AbyZ | tr '[:lower:]' '[:upper:]' 2>/dev/null`" in
1367 ABYZ) spackage=`echo $first | tr '[:lower:]' '[:upper:]'`$last;;
1368 *) spackage=`echo $first | tr '[a-z]' '[A-Z]'`$last;;
1371 : Some greps do not return status, grrr.
1372 echo "grimblepritz" >grimble
1373 if grep blurfldyick grimble >/dev/null 2>&1 ; then
1375 elif grep grimblepritz grimble >/dev/null 2>&1 ; then
1381 : the following should work in any shell
1385 echo "AGH! Grep doesn't return a status. Attempting remedial action."
1386 cat >contains <<'EOSS'
1387 grep "$1" "$2" >.greptmp && cat .greptmp && test -s .greptmp
1392 : Find the path to the source tree
1395 */*) src=`echo $0 | sed -e 's%/[^/][^/]*$%%'`
1398 *) src=`cd ../$src && pwd` ;;
1411 if test -f $rsrc/Configure && \
1412 $contains "^package=$package$" $rsrc/Configure >/dev/null 2>&1
1414 : found it, so we are ok.
1417 for src in . .. ../.. ../../.. ../../../..; do
1418 if test -f ../$src/Configure && \
1419 $contains "^package=$package$" ../$src/Configure >/dev/null 2>&1
1430 Sorry, I can't seem to locate the source dir for $package. Please start
1431 Configure with an explicit path -- i.e. /some/path/Configure.
1439 echo "Sources for $package found in \"$src\"." >&4
1443 : script used to extract .SH files with variable substitutions
1444 cat >extract <<'EOS'
1446 echo "Doing variable substitutions on .SH files..."
1447 if test -f $src/MANIFEST; then
1448 set x `awk '{print $1}' <$src/MANIFEST | grep '\.SH$'`
1450 echo "(Looking for .SH files under the source directory.)"
1451 set x `(cd $src; find . -name "*.SH" -print)`
1455 0) set x `(cd $src; echo *.SH)`; shift;;
1457 if test ! -f $src/$1; then
1463 while test $name; do
1464 if test ! -d "$name"; then
1465 create="$name $create";
1466 name=`echo $name | sed -e "s|^[^/]*$||"`;
1467 name=`echo $name | sed -e "s|\(.*\)/.*|\1|"`;
1472 for file in $create; do
1481 dir=`expr X$file : 'X\(.*\)/'`
1482 file=`expr X$file : 'X.*/\(.*\)'`
1483 (cd $dir && . ./$file)
1493 dir=`expr X$file : 'X\(.*\)/'`
1494 file=`expr X$file : 'X.*/\(.*\)'`
1495 (set x $dir; shift; eval $mkdir_p)
1505 if test -f $src/config_h.SH; then
1506 if test ! -f config.h; then
1507 : oops, they left it out of MANIFEST, probably, so do it anyway.
1513 : extract files and exit if asked to do so
1514 case "$extractsh" in
1516 case "$realsilent" in
1520 case "$config_sh" in
1521 '') config_sh='config.sh';;
1524 echo "Fetching answers from $config_sh..."
1527 test "$override" && . ./optdef.sh
1536 : Eunice requires " " instead of "", can you believe it
1539 echo "Beginning of configuration questions for $package."
1541 trap 'echo " "; test -d ../UU && rm -rf X $rmlist; exit 1' 1 2 3 15
1543 : first determine how to suppress newline on echo command
1545 echo "Checking echo to see how to suppress newlines..."
1546 (echo "hi there\c" ; echo " ") >.echotmp
1547 if $contains c .echotmp >/dev/null 2>&1 ; then
1558 echo $n "The star should be here-->$c"
1562 : Now test for existence of everything in MANIFEST
1564 if test -f $rsrc/MANIFEST; then
1565 echo "First let's make sure your kit is complete. Checking..." >&4
1566 awk '$1 !~ /PACK[A-Z]+/ {print $1}' $rsrc/MANIFEST | split -50
1569 for filelist in x??; do
1570 (cd $rsrc; ls `cat $tmppwd/$filelist` >/dev/null 2>>$tmppwd/missing)
1572 if test -s missing; then
1576 THIS PACKAGE SEEMS TO BE INCOMPLETE.
1578 You have the option of continuing the configuration process, despite the
1579 distinct possibility that your kit is damaged, by typing 'y'es. If you
1580 do, don't blame me if something goes wrong. I advise you to type 'n'o
1581 and contact the author (perlbug@perl.com).
1584 echo $n "Continue? [n] $c" >&4
1588 echo "Continuing..." >&4
1592 echo "ABORTING..." >&4
1597 echo "Looks good..."
1600 echo "There is no MANIFEST file. I hope your kit is complete !"
1605 : Find the appropriate value for a newline for tr
1606 if test -n "$DJGPP"; then
1609 if test X"$trnl" = X; then
1610 case "`echo foo|tr '\n' x 2>/dev/null`" in
1614 if test X"$trnl" = X; then
1615 case "`echo foo|tr '\012' x 2>/dev/null`" in
1616 foox) trnl='\012' ;;
1619 if test X"$trnl" = X; then
1622 $me: Fatal Error: cannot figure out how to translate newlines with 'tr'.
1628 : compute the number of columns on the terminal for proper question formatting
1633 : set up the echo used in my read
1634 myecho="case \"\$xxxm\" in
1635 '') echo $n \"\$rp $c\" >&4;;
1637 '') echo $n \"[\$xxxm] $c\";;
1639 if test \`echo \"\$rp [\$xxxm] \" | wc -c\` -ge $COLUMNS; then
1641 echo $n \"[\$xxxm] $c\" >&4
1643 echo $n \"\$rp [\$xxxm] $c\" >&4
1649 : now set up to do reads with possible shell escape and default assignment
1655 case "\$fastread" in
1656 yes) case "\$dflt" in
1659 case "\$silent-\$rp" in
1664 *) case "\$silent" in
1665 true) case "\$rp" in
1670 while expr "X\$ans" : "X!" >/dev/null; do
1674 aok=''; eval "ans=\\"\$answ\\"" && aok=y
1682 set x \`expr "X\$ans" : "X!\(.*\)\$"\`
1691 set x \`expr "X\$ans" : "X&\(.*\)\$"\`
1696 echo "(OK, I'll run with -d after this question.)" >&4
1699 echo "*** Sorry, \$1 not supported yet." >&4
1709 echo "*** Substitution done -- please confirm."
1711 ans=\`echo $n "\$ans$c" | tr '$trnl' ' '\`
1716 echo "*** Error -- try again."
1723 case "\$ans\$xxxm\$nostick" in
1735 : create .config dir to save info across Configure sessions
1736 test -d ../.config || mkdir ../.config
1737 cat >../.config/README <<EOF
1738 This directory created by Configure to save information that should
1739 persist across sessions for $package.
1741 You may safely delete it if you wish.
1744 : general instructions
1747 user=`(logname) 2>/dev/null`
1749 '') user=`whoami 2>&1`;;
1751 if $contains "^$user\$" ../.config/instruct >/dev/null 2>&1; then
1754 rp='Would you like to see the instructions?'
1765 This installation shell script will examine your system and ask you questions
1766 to determine how the perl5 package should be installed. If you get
1767 stuck on a question, you may use a ! shell escape to start a subshell or
1768 execute a command. Many of the questions will have default answers in square
1769 brackets; typing carriage return will give you the default.
1771 On some of the questions which ask for file or directory names you are allowed
1772 to use the ~name construct to specify the login directory belonging to "name",
1773 even if you don't have a shell which knows about that. Questions where this is
1774 allowed will be marked "(~name ok)".
1778 dflt='Type carriage return to continue'
1782 The prompter used in this script allows you to use shell variables and
1783 backticks in your answers. You may use $1, $2, etc... to refer to the words
1784 in the default answer, as if the default line was a set of arguments given to a
1785 script shell. This means you may also use $* to repeat the whole default line,
1786 so you do not have to re-type everything to add something to the default.
1788 Everytime there is a substitution, you will have to confirm. If there is an
1789 error (e.g. an unmatched backtick), the default answer will remain unchanged
1790 and you will be prompted again.
1792 If you are in a hurry, you may run 'Configure -d'. This will bypass nearly all
1793 the questions and use the computed defaults (or the previous answers if there
1794 was already a config.sh file). Type 'Configure -h' for a list of options.
1795 You may also start interactively and then answer '& -d' at any prompt to turn
1796 on the non-interactive behaviour for the remainder of the execution.
1802 Much effort has been expended to ensure that this shell script will run on any
1803 Unix system. If despite that it blows up on yours, your best bet is to edit
1804 Configure and run it again. If you can't run Configure for some reason,
1805 you'll have to generate a config.sh file by hand. Whatever problems you
1806 have, let me (perlbug@perl.com) know how I blew it.
1808 This installation script affects things in two ways:
1810 1) it may do direct variable substitutions on some of the files included
1812 2) it builds a config.h file for inclusion in C programs. You may edit
1813 any of these files as the need arises after running this script.
1815 If you make a mistake on a question, there is no easy way to back up to it
1816 currently. The easiest thing to do is to edit config.sh and rerun all the SH
1817 files. Configure will offer to let you do this before it runs the SH files.
1820 dflt='Type carriage return to continue'
1822 case "$firsttime" in
1823 true) echo $user >>../.config/instruct;;
1827 : find out where common programs are
1829 echo "Locating common programs..." >&4
1842 if test -d \$dir/\$thing; then
1848 for thisthing in \$dir/\$thing; do
1849 : just loop through to pick last item
1851 if test -f \$thisthing; then
1854 elif test -f \$dir/\$thing.exe; then
1855 if test -n "$DJGPP"; then
1856 echo \$dir/\$thing.exe
1858 : on Eunice apparently
1908 pth=`echo $PATH | sed -e "s/$p_/ /g"`
1909 pth="$pth /lib /usr/lib"
1910 for file in $loclist; do
1914 if test -f "$xxx"; then
1917 echo "WARNING: no $xxx -- ignoring your setting for $file." >&4
1918 xxx=`./loc $file $file $pth`
1921 '') xxx=`./loc $file $file $pth`;;
1922 *) xxx=`./loc $xxx $xxx $pth`;;
1928 echo $file is in $xxx.
1931 echo $file is in $xxx.
1934 echo "I don't know where '$file' is, and my life depends on it." >&4
1935 echo "Go find a public domain implementation or fix your PATH setting!" >&4
1941 echo "Don't worry if any of the following aren't found..."
1943 for file in $trylist; do
1947 if test -f "$xxx"; then
1950 echo "WARNING: no $xxx -- ignoring your setting for $file." >&4
1951 xxx=`./loc $file $file $pth`
1954 '') xxx=`./loc $file $file $pth`;;
1955 *) xxx=`./loc $xxx $xxx $pth`;;
1961 echo $file is in $xxx.
1964 echo $file is in $xxx.
1967 echo "I don't see $file out there, $say."
1974 echo "Substituting grep for egrep."
1980 echo "Substituting cp for ln."
1986 echo "Hopefully test is built into your sh."
1989 if `sh -c "PATH= test true" >/dev/null 2>&1`; then
1990 echo "Using the test built into your sh."
1998 echo "Hopefully echo is built into your sh."
2003 echo "Checking compatibility between $echo and builtin echo (if any)..." >&4
2004 $echo $n "hi there$c" >foo1
2005 echo $n "hi there$c" >foo2
2006 if cmp foo1 foo2 >/dev/null 2>&1; then
2007 echo "They are compatible. In fact, they may be identical."
2014 They are not compatible! You are probably running ksh on a non-USG system.
2015 I'll have to use $echo instead of the builtin, since Bourne shell doesn't
2016 have echo built in and we may have to run some Bourne shell scripts. That
2017 means I'll have to use '$n$c' to suppress newlines now. Life is ridiculous.
2020 $echo $n "The star should be here-->$c"
2027 : determine whether symbolic links are supported
2030 if $ln -s blurfl sym > /dev/null 2>&1 ; then
2031 echo "Symbolic links are supported." >&4
2034 echo "Symbolic links are NOT supported." >&4
2039 : see whether [:lower:] and [:upper:] are supported character classes
2041 case "`echo AbyZ | $tr '[:lower:]' '[:upper:]' 2>/dev/null`" in
2043 echo "Good, your tr supports [:lower:] and [:upper:] to convert case." >&4
2047 *) # There is a discontinuity in EBCDIC between 'I' and 'J'
2048 # (0xc9 and 0xd1), therefore that is a nice testing point.
2049 if test "X$up" = X -o "X$low" = X; then
2050 case "`echo IJ | $tr '[I-J]' '[i-j]' 2>/dev/null`" in
2056 if test "X$up" = X -o "X$low" = X; then
2057 case "`echo IJ | $tr I-J i-j 2>/dev/null`" in
2063 if test "X$up" = X -o "X$low" = X; then
2064 case "`echo IJ | od -x 2>/dev/null`" in
2066 echo "Hey, this might be EBCDIC." >&4
2067 if test "X$up" = X -o "X$low" = X; then
2068 case "`echo IJ | $tr '[A-IJ-RS-Z]' '[a-ij-rs-z]' 2>/dev/null`" in
2069 ij) up='[A-IJ-RS-Z]'
2074 if test "X$up" = X -o "X$low" = X; then
2075 case "`echo IJ | $tr A-IJ-RS-Z a-ij-rs-z 2>/dev/null`" in
2085 case "`echo IJ | $tr \"$up\" \"$low\" 2>/dev/null`" in
2087 echo "Using $up and $low to convert case." >&4
2090 echo "I don't know how to translate letters from upper to lower case." >&4
2091 echo "Your tr is not acting any way I know of." >&4
2095 : set up the translation script tr, must be called with ./tr of course
2099 '[A-Z][a-z]') exec $tr '$up' '$low';;
2100 '[a-z][A-Z]') exec $tr '$low' '$up';;
2107 : Try to determine whether config.sh was made on this system
2108 case "$config_sh" in
2110 myuname=`$uname -a 2>/dev/null`
2111 $test -z "$myuname" && myuname=`hostname 2>/dev/null`
2112 # tr '[A-Z]' '[a-z]' would not work in EBCDIC
2113 # because the A-Z/a-z are not consecutive.
2114 myuname=`echo $myuname | $sed -e 's/^[^=]*=//' -e 's/\///g' | \
2115 ./tr '[A-Z]' '[a-z]' | $tr $trnl ' '`
2116 newmyuname="$myuname"
2118 case "$knowitall" in
2120 if test -f ../config.sh; then
2121 if $contains myuname= ../config.sh >/dev/null 2>&1; then
2122 eval "`grep myuname= ../config.sh`"
2124 if test "X$myuname" = "X$newmyuname"; then
2132 : Get old answers from old config file if Configure was run on the
2133 : same system, otherwise use the hints.
2136 if test -f config.sh; then
2138 rp="I see a config.sh file. Shall I use it to set the defaults?"
2141 n*|N*) echo "OK, I'll ignore it."; mv config.sh config.sh.old;;
2142 *) echo "Fetching default answers from your old config.sh file..." >&4
2150 : Older versions did not always set $sh. Catch re-use of such
2159 if test ! -f config.sh; then
2162 First time through, eh? I have some defaults handy for some systems
2163 that need some extra help getting the Configure answers right:
2166 (cd $src/hints; ls -C *.sh) | $sed 's/\.sh/ /g' >&4
2168 : Half the following guesses are probably wrong... If you have better
2169 : tests or hints, please send them to perlbug@perl.com
2170 : The metaconfig authors would also appreciate a copy...
2171 $test -f /irix && osname=irix
2172 $test -f /xenix && osname=sco_xenix
2173 $test -f /dynix && osname=dynix
2174 $test -f /dnix && osname=dnix
2175 $test -f /lynx.os && osname=lynxos
2176 $test -f /unicos && osname=unicos && osvers=`$uname -r`
2177 $test -f /unicosmk && osname=unicosmk && osvers=`$uname -r`
2178 $test -f /unicosmk.ar && osname=unicosmk && osvers=`$uname -r`
2179 $test -f /bin/mips && /bin/mips && osname=mips
2180 $test -d /NextApps && set X `hostinfo | grep 'NeXT Mach.*:' | \
2181 $sed -e 's/://' -e 's/\./_/'` && osname=next && osvers=$4
2182 $test -d /usr/apollo/bin && osname=apollo
2183 $test -f /etc/saf/_sactab && osname=svr4
2184 $test -d /usr/include/minix && osname=minix
2185 if $test -d /MachTen -o -d /MachTen_Folder; then
2187 if $test -x /sbin/version; then
2188 osvers=`/sbin/version | $awk '{print $2}' |
2189 $sed -e 's/[A-Za-z]$//'`
2190 elif $test -x /usr/etc/version; then
2191 osvers=`/usr/etc/version | $awk '{print $2}' |
2192 $sed -e 's/[A-Za-z]$//'`
2198 $test -f /sys/posix.dll &&
2199 $test -f /usr/bin/what &&
2200 set X `/usr/bin/what /sys/posix.dll` &&
2201 $test "$3" = UWIN &&
2205 if $test -f $uname; then
2213 umips) osname=umips ;;
2216 [23]100) osname=mips ;;
2217 next*) osname=next ;;
2219 tmp=`/bin/uname -X 2>/dev/null|awk '/3\.2v[45]/{ print $(NF) }'`
2220 if $test "$tmp" != "" -a "$3" = "3.2" -a -f '/etc/systemid'; then
2223 elif $test -f /etc/kconfig; then
2225 if test "$lns" = "$ln -s"; then
2227 elif $contains _SYSV3 /usr/include/stdio.h > /dev/null 2>&1 ; then
2229 elif $contains _POSIX_SOURCE /usr/include/stdio.h > /dev/null 2>&1 ; then
2236 if test -n "$DJGPP"; then
2245 tmp=`( (oslevel) 2>/dev/null || echo "not found") 2>&1`
2247 'not found') osvers="$4"."$3" ;;
2248 '<3240'|'<>3240') osvers=3.2.0 ;;
2249 '=3240'|'>3240'|'<3250'|'<>3250') osvers=3.2.4 ;;
2250 '=3250'|'>3250') osvers=3.2.5 ;;
2254 bsd386) osname=bsd386
2257 cygwin*) osname=cygwin
2260 *dc.osx) osname=dcosx
2266 domainos) osname=apollo
2272 dynixptx*) osname=dynixptx
2273 osvers=`echo "$4"|sed 's/^v//'`
2275 freebsd) osname=freebsd
2277 genix) osname=genix ;;
2279 osvers=`echo "$3" | $sed 's,.*\.\([0-9]*\.[0-9]*\),\1,'`
2295 netbsd*) osname=netbsd
2298 news-os) osvers="$3"
2300 4*) osname=newsos4 ;;
2304 next*) osname=next ;;
2305 POSIX-BC | posix-bc ) osname=posix-bc
2308 powerux | power_ux | powermax_os | powermaxos | \
2309 powerunix | power_unix) osname=powerux
2315 solaris) osname=solaris
2317 5*) osvers=`echo $3 | $sed 's/^5/2/g'` ;;
2324 osvers=`echo $3 | $sed 's/^5/2/g'` ;;
2328 titanos) osname=titanos
2337 ultrix) osname=ultrix
2340 osf1|mls+) case "$5" in
2343 osvers=`echo "$3" | sed 's/^[xvt]//'`
2345 hp*) osname=hp_osf1 ;;
2346 mips) osname=mips_osf1 ;;
2349 unixware) osname=svr5
2355 $2) case "$osname" in
2359 : svr4.x or possibly later
2369 if test -f /stand/boot ; then
2370 eval `grep '^INITPROG=[a-z/0-9]*$' /stand/boot`
2371 if test -n "$INITPROG" -a -f "$INITPROG"; then
2372 isesix=`strings -a $INITPROG|grep 'ESIX SYSTEM V/386 Release 4.0'`
2373 if test -n "$isesix"; then
2381 *) if test -f /etc/systemid; then
2383 set `echo $3 | $sed 's/\./ /g'` $4
2384 if $test -f $src/hints/sco_$1_$2_$3.sh; then
2386 elif $test -f $src/hints/sco_$1_$2.sh; then
2388 elif $test -f $src/hints/sco_$1.sh; then
2393 '') : Still unknown. Probably a generic Sys V.
2402 *) case "$osname" in
2403 '') : Still unknown. Probably a generic BSD.
2411 if test -f /vmunix -a -f $src/hints/news_os.sh; then
2412 (what /vmunix | UU/tr '[A-Z]' '[a-z]') > UU/kernel.what 2>&1
2413 if $contains news-os UU/kernel.what >/dev/null 2>&1; then
2416 $rm -f UU/kernel.what
2417 elif test -d c:/.; then
2424 : Now look for a hint file osname_osvers, unless one has been
2425 : specified already.
2428 file=`echo "${osname}_${osvers}" | $sed -e 's%\.%_%g' -e 's%_$%%'`
2429 : Also try without trailing minor version numbers.
2430 xfile=`echo $file | $sed -e 's%_[^_]*$%%'`
2431 xxfile=`echo $xfile | $sed -e 's%_[^_]*$%%'`
2432 xxxfile=`echo $xxfile | $sed -e 's%_[^_]*$%%'`
2433 xxxxfile=`echo $xxxfile | $sed -e 's%_[^_]*$%%'`
2436 *) case "$osvers" in
2439 *) if $test -f $src/hints/$file.sh ; then
2441 elif $test -f $src/hints/$xfile.sh ; then
2443 elif $test -f $src/hints/$xxfile.sh ; then
2445 elif $test -f $src/hints/$xxxfile.sh ; then
2447 elif $test -f $src/hints/$xxxxfile.sh ; then
2449 elif $test -f "$src/hints/${osname}.sh" ; then
2458 if $test -f Policy.sh ; then
2461 none) dflt="Policy" ;;
2462 *) dflt="Policy $dflt" ;;
2467 dflt=`echo $hintfile | $sed 's/\.sh$//'`
2471 if $test -f Policy.sh ; then
2474 There's also a Policy hint file available, which should make the
2475 site-specific (policy) questions easier to answer.
2482 You may give one or more space-separated answers, or "none" if appropriate.
2483 A well-behaved OS will have no hints, so answering "none" or just "Policy"
2484 is a good thing. DO NOT give a wrong version or a wrong OS.
2488 rp="Which of these apply, if any?"
2491 for file in $tans; do
2492 if $test X$file = XPolicy -a -f Policy.sh; then
2494 $cat Policy.sh >> UU/config.sh
2495 elif $test -f $src/hints/$file.sh; then
2496 . $src/hints/$file.sh
2497 $cat $src/hints/$file.sh >> UU/config.sh
2498 elif $test X$tans = X -o X$tans = Xnone ; then
2501 : Give one chance to correct a possible typo.
2502 echo "$file.sh does not exist"
2504 rp="hint to use instead?"
2506 for file in $ans; do
2507 if $test -f "$src/hints/$file.sh"; then
2508 . $src/hints/$file.sh
2509 $cat $src/hints/$file.sh >> UU/config.sh
2510 elif $test X$ans = X -o X$ans = Xnone ; then
2513 echo "$file.sh does not exist -- ignored."
2520 : Remember our hint file for later.
2521 if $test -f "$src/hints/$file.sh" ; then
2531 echo "Fetching default answers from $config_sh..." >&4
2535 cp $config_sh config.sh 2>/dev/null
2545 test "$override" && . ./optdef.sh
2546 myuname="$newmyuname"
2548 : Restore computed paths
2549 for file in $loclist $trylist; do
2550 eval $file="\$_$file"
2555 Configure uses the operating system name and version to set some defaults.
2556 The default value is probably right if the name rings a bell. Otherwise,
2557 since spelling matters for me, either accept the default or answer "none"
2564 ''|' '|none) dflt=none ;;
2565 *) dflt=`echo $hintfile | $sed -e 's/\.sh$//' -e 's/_.*$//'` ;;
2568 *) dflt="$osname" ;;
2570 rp="Operating system name?"
2574 *) osname=`echo "$ans" | $sed -e 's/[ ][ ]*/_/g' | ./tr '[A-Z]' '[a-z]'`;;
2580 ''|' '|none) dflt=none ;;
2581 *) dflt=`echo $hintfile | $sed -e 's/\.sh$//' -e 's/^[^_]*//'`
2582 dflt=`echo $dflt | $sed -e 's/^_//' -e 's/_/./g'`
2584 ''|' ') dflt=none ;;
2589 *) dflt="$osvers" ;;
2591 rp="Operating system version?"
2601 : who configured the system
2602 cf_time=`LC_ALL=C; LANGUAGE=C; export LC_ALL; export LANGUAGE; $date 2>&1`
2603 cf_by=`(logname) 2>/dev/null`
2606 cf_by=`(whoami) 2>/dev/null`
2608 "") cf_by=unknown ;;
2612 : set up the script used to warn in case of inconsistency
2619 echo "*** WHOA THERE!!! ***" >&4
2620 echo " The $hint value for \$$var on this machine was \"$was\"!" >&4
2621 rp=" Keep the $hint value?"
2624 y) td=$was; tu=$was;;
2628 : function used to set $1 to $val
2629 setvar='var=$1; eval "was=\$$1"; td=$define; tu=$undef;
2631 $define$undef) . ./whoa; eval "$var=\$td";;
2632 $undef$define) . ./whoa; eval "$var=\$tu";;
2633 *) eval "$var=$val";;
2636 case "$usethreads" in
2637 $define|true|[yY]*) dflt='y';;
2642 Perl can be built to take advantage of threads on some systems.
2643 To do so, Configure can be run with -Dusethreads.
2645 Note that threading is a highly experimental feature, and
2646 some known race conditions still remain. If you choose to try
2647 it, be very sure to not actually deploy it for production
2648 purposes. README.threads has more details, and is required
2649 reading if you enable threads.
2651 If this doesn't make any sense to you, just accept the default '$dflt'.
2653 rp='Build a threading Perl?'
2656 y|Y) val="$define" ;;
2662 case "$usethreads" in
2666 As of 5.5.640, Perl has two different internal threading implementations,
2667 the 5.005 version (5005threads) and an interpreter-based version
2668 (ithreads) that has one interpreter per thread. Both are very
2669 experimental. This arrangement exists to help developers work out
2670 which one is better.
2672 If you're a casual user, you probably don't want interpreter-threads
2673 at this time. There doesn't yet exist a way to create threads from
2674 within Perl in this model, i.e., "use Thread;" will NOT work.
2676 : Default to ithreads unless overridden on command line or with
2679 case "$use5005threads" in
2680 $define|true|[yY]*) dflt='n';;
2682 case "$useithreads" in
2683 $undef|false|[nN]*) dflt='n';;
2685 rp='Use interpreter-based ithreads?'
2688 y|Y) val="$define" ;;
2693 : Now set use5005threads to the opposite value.
2694 case "$useithreads" in
2695 $define) val="$undef" ;;
2702 useithreads="$undef"
2703 use5005threads="$undef"
2707 case "$d_oldpthreads" in
2708 '') : Configure tests would be welcome here. For now, assume undef.
2710 *) val="$d_oldpthreads" ;;
2716 case "$usethreads" in
2717 "$define"|true|[yY]*)
2718 : Look for a hint-file generated 'call-back-unit'. If the
2719 : user has specified that a threading perl is to be built,
2720 : we may need to set or change some other defaults.
2721 if $test -f usethreads.cbu; then
2722 echo "Your platform has some specific hints for threaded builds, using them..."
2726 (Your platform doesn't have any specific hints for threaded builds.
2727 Assuming POSIX threads, then.)
2735 Perl can be built so that multiple Perl interpreters can coexist
2736 within the same Perl executable.
2739 case "$useithreads" in
2742 This multiple interpreter support is required for interpreter-based threads.
2746 *) case "$usemultiplicity" in
2747 $define|true|[yY]*) dflt='y';;
2751 echo "If this doesn't make any sense to you, just accept the default '$dflt'."
2752 rp='Build Perl for multiplicity?'
2755 y|Y) val="$define" ;;
2763 : determine where manual pages are on this system
2767 syspath='/usr/man/man1 /usr/man/mann /usr/man/manl /usr/man/local/man1'
2768 syspath="$syspath /usr/man/u_man/man1 /usr/share/man/man1"
2769 syspath="$syspath /usr/catman/u_man/man1 /usr/man/l_man/man1"
2770 syspath="$syspath /usr/local/man/u_man/man1 /usr/local/man/l_man/man1"
2771 syspath="$syspath /usr/man/man.L /local/man/man1 /usr/local/man/man1"
2772 sysman=`./loc . /usr/man/man1 $syspath`
2775 if $test -d "$sysman"; then
2776 echo "System manual is in $sysman." >&4
2778 echo "Could not find manual pages in source form." >&4
2781 : see what memory models we can support
2784 $cat >pdp11.c <<'EOP'
2793 ( cc -o pdp11 pdp11.c ) >/dev/null 2>&1
2794 if $test -f pdp11 && ./pdp11 2>/dev/null; then
2795 dflt='unsplit split'
2797 tans=`./loc . X /lib/small /lib/large /usr/lib/small /usr/lib/large /lib/medium /usr/lib/medium /lib/huge`
2800 *) if $test -d /lib/small || $test -d /usr/lib/small; then
2805 if $test -d /lib/medium || $test -d /usr/lib/medium; then
2808 if $test -d /lib/large || $test -d /usr/lib/large; then
2811 if $test -d /lib/huge || $test -d /usr/lib/huge; then
2820 Some systems have different model sizes. On most systems they are called
2821 small, medium, large, and huge. On the PDP11 they are called unsplit and
2822 split. If your system doesn't support different memory models, say "none".
2823 If you wish to force everything to one memory model, say "none" here and
2824 put the appropriate flags later when it asks you for other cc and ld flags.
2825 Venix systems may wish to put "none" and let the compiler figure things out.
2826 (In the following question multiple model names should be space separated.)
2828 The default for most systems is "none".
2831 rp="Which memory models are supported?"
2846 '') if $contains '\-i' $sysman/ld.1 >/dev/null 2>&1 || \
2847 $contains '\-i' $sysman/cc.1 >/dev/null 2>&1; then
2854 rp="What flag indicates separate I and D space?"
2862 *large*|*small*|*medium*|*huge*)
2869 rp="What flag indicates large model?"
2879 *huge*) case "$huge" in
2883 rp="What flag indicates huge model?"
2893 *medium*) case "$medium" in
2897 rp="What flag indicates medium model?"
2904 *) medium="$large";;
2907 *small*) case "$small" in
2911 rp="What flag indicates small model?"
2922 echo "Unrecognized memory models--you may have to edit Makefile.SH" >&4
2925 $rm -f pdp11.* pdp11
2927 : make some quick guesses about what we are up against
2929 $echo $n "Hmm... $c"
2939 $cat /usr/include/signal.h /usr/include/sys/signal.h >foo 2>/dev/null
2940 if test -f /osf_boot || $contains 'OSF/1' /usr/include/ctype.h >/dev/null 2>&1
2942 echo "Looks kind of like an OSF/1 system, but we'll see..."
2944 elif test `echo abc | tr a-z A-Z` = Abc ; then
2945 xxx=`./loc addbib blurfl $pth`
2946 if $test -f $xxx; then
2947 echo "Looks kind of like a USG system with BSD features, but we'll see..."
2951 if $contains SIGTSTP foo >/dev/null 2>&1 ; then
2952 echo "Looks kind of like an extended USG system, but we'll see..."
2954 echo "Looks kind of like a USG system, but we'll see..."
2958 elif $contains SIGTSTP foo >/dev/null 2>&1 ; then
2959 echo "Looks kind of like a BSD system, but we'll see..."
2963 echo "Looks kind of like a Version 7 system, but we'll see..."
2966 case "$eunicefix" in
2969 There is, however, a strange, musty smell in the air that reminds me of
2970 something...hmm...yes...I've got it...there's a VMS nearby, or I'm a Blit.
2974 : it so happens the Eunice I know will not run shell scripts in Unix format
2978 echo "Congratulations. You aren't running Eunice."
2982 : Detect OS2. The p_ variable is set above in the Head.U unit.
2987 I have the feeling something is not exactly right, however...don't tell me...
2988 lemme think...does HAL ring a bell?...no, of course, you're only running OS/2!
2993 if test -f /xenix; then
2994 echo "Actually, this looks more like a XENIX system..."
2999 echo "It's not Xenix..."
3004 if test -f /venix; then
3005 echo "Actually, this looks more like a VENIX system..."
3012 echo "Nor is it Venix..."
3015 chmod +x bsd usg v7 osf1 eunice xenix venix os2
3016 $eunicefix bsd usg v7 osf1 eunice xenix venix os2
3019 : see if we need a special compiler
3027 *) if $contains '\-M' $sysman/cc.1 >/dev/null 2>&1 ; then
3028 if $contains '\-M' $sysman/cpp.1 >/dev/null 2>&1; then
3042 On some older systems the default C compiler will not resolve multiple global
3043 references that happen to have the same name. On some such systems the "Mcc"
3044 command may be used to force these to be resolved. On other systems a "cc -M"
3045 command is required. (Note that the -M flag on other systems indicates a
3046 memory model to use!) If you have the Gnu C compiler, you might wish to use
3052 rp="Use which C compiler?"
3060 rp="Use which C compiler?"
3064 : Look for a hint-file generated 'call-back-unit'. Now that the
3065 : user has specified the compiler, we may need to set or change some
3067 if $test -f cc.cbu; then
3071 echo "Checking for GNU cc in disguise and/or its version number..." >&4
3072 $cat >gccvers.c <<EOM
3077 printf("%s\n", __VERSION__);
3079 printf("%s\n", "1");
3085 if $cc $ldflags -o gccvers gccvers.c; then
3086 gccversion=`./gccvers`
3087 case "$gccversion" in
3088 '') echo "You are not using GNU cc." ;;
3089 *) echo "You are using GNU cc $gccversion."
3094 echo "*** WHOA THERE!!! ***" >&4
3095 echo " Your C compiler \"$cc\" doesn't seem to be working!" >&4
3096 case "$knowitall" in
3098 echo " You'd better start hunting for one and let me know about it." >&4
3104 case "$gccversion" in
3105 1*) cpp=`./loc gcc-cpp $cpp $pth` ;;
3108 : decide how portable to be. Allow command line overrides.
3109 case "$d_portable" in
3111 *) d_portable="$define" ;;
3114 : set up shell script to do ~ expansion
3120 echo \$1 | $sed "s|~|\${HOME-\$LOGDIR}|"
3123 if $test -f /bin/csh; then
3124 /bin/csh -f -c "glob \$1"
3129 name=\`$expr x\$1 : '..\([^/]*\)'\`
3130 dir=\`$sed -n -e "/^\${name}:/{s/^[^:]*:[^:]*:[^:]*:[^:]*:[^:]*:\([^:]*\).*"'\$'"/\1/" -e p -e q -e '}' </etc/passwd\`
3131 if $test ! -d "\$dir"; then
3133 echo "\$me: can't locate home directory for: \$name" >&2
3138 echo \$dir/\`$expr x\$1 : '..[^/]*/\(.*\)'\`
3154 : now set up to get a file name
3158 cat <<'EOSC' >>getfile
3174 expr $fn : '.*(\(.*\)).*' | tr ',' $trnl >getfile.ok
3175 fn=`echo $fn | sed 's/(.*)//'`
3181 loc_file=`expr $fn : '.*:\(.*\)'`
3182 fn=`expr $fn : '\(.*\):.*'`
3190 */*) fullpath=true;;
3199 *e*) exp_file=true;;
3202 *p*) nopath_ok=true;;
3207 *d*) type='Directory';;
3208 *l*) type='Locate';;
3213 Locate) what='File';;
3218 case "$d_portable" in
3226 while test "$type"; do
3231 true) rp="$rp (~name ok)";;
3234 if test -f UU/getfile.ok && \
3235 $contains "^$ans\$" UU/getfile.ok >/dev/null 2>&1
3254 value=`UU/filexp $ans`
3257 if test "$ans" != "$value"; then
3258 echo "(That expands to $value on this system.)"
3272 /*) value="$ansexp" ;;
3277 echo "I shall only accept a full path name, as in /bin/ls." >&4
3278 echo "Use a ! shell escape if you wish to check pathnames." >&4
3281 echo "Please give a full path name, starting with slash." >&4
3284 echo "Note that using ~name is ok provided it expands well." >&4
3297 for fp in $gfpth; do
3298 if test "X$fp" = X.; then
3303 if test -f "$pf"; then
3305 elif test -r "$pf" || (test -h "$pf") >/dev/null 2>&1
3307 echo "($value is not a plain file, but that's ok.)"
3310 if test X"$type" = X; then
3317 for fp in $gfpth; do
3318 if test "X$fp" = X.; then
3323 direxp="$fp/$ansexp"
3325 if test -d "$direxp"; then
3333 if test -d "$ansexp"; then
3334 echo "(Looking for $loc_file in directory $value.)"
3335 value="$value/$loc_file"
3336 ansexp="$ansexp/$loc_file"
3338 if test -f "$ansexp"; then
3341 case "$nopath_ok" in
3342 true) case "$value" in
3344 *) echo "Assuming $value will be in people's path."
3360 if test "$fastread" = yes; then
3365 rp="$what $value doesn't exist. Use that name anyway?"
3384 test "X$gfpthkeep" != Xy && gfpth=""
3387 : What should the include directory be ?
3389 $echo $n "Hmm... $c"
3393 if $test -f /bin/mips && /bin/mips; then
3394 echo "Looks like a MIPS system..."
3395 $cat >usr.c <<'EOCP'
3396 #ifdef SYSTYPE_BSD43
3400 if $cc -E usr.c > usr.out && $contains / usr.out >/dev/null 2>&1; then
3401 dflt='/bsd43/usr/include'
3405 mips_type='System V'
3407 $rm -f usr.c usr.out
3408 echo "and you're compiling with the $mips_type compiler and libraries."
3412 echo "Doesn't look like a MIPS system."
3422 case "$xxx_prompt" in
3425 rp='Where are the include files you want to use?'
3433 : see how we invoke the C preprocessor
3435 echo "Now, how can we feed standard input to your C preprocessor..." >&4
3436 cat <<'EOT' >testcpp.c
3442 if test ! -f cppstdin; then
3443 if test "X$osname" = "Xaix" -a "X$gccversion" = X; then
3444 # AIX cc -E doesn't show the absolute headerfile
3445 # locations but we'll cheat by using the -M flag.
3446 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
3448 echo 'cat >.$$.c; '"$cc"' -E ${1+"$@"} .$$.c; rm .$$.c' >cppstdin
3451 echo "Keeping your $hint cppstdin wrapper."
3454 wrapper=`pwd`/cppstdin
3458 if $test "X$cppstdin" != "X" && \
3459 $cppstdin $cppminus <testcpp.c >testcpp.out 2>&1 && \
3460 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
3462 echo "You used to use $cppstdin $cppminus so we'll use that again."
3464 '') echo "But let's see if we can live without a wrapper..." ;;
3466 if $cpprun $cpplast <testcpp.c >testcpp.out 2>&1 && \
3467 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
3469 echo "(And we'll use $cpprun $cpplast to preprocess directly.)"
3472 echo "(However, $cpprun $cpplast does not work, let's see...)"
3480 echo "Good old $cppstdin $cppminus does not seem to be of any help..."
3487 elif echo 'Maybe "'"$cc"' -E" will work...'; \
3488 $cc -E <testcpp.c >testcpp.out 2>&1; \
3489 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3490 echo "Yup, it does."
3493 elif echo 'Nope...maybe "'"$cc"' -E -" will work...'; \
3494 $cc -E - <testcpp.c >testcpp.out 2>&1; \
3495 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3496 echo "Yup, it does."
3499 elif echo 'Nope...maybe "'"$cc"' -P" will work...'; \
3500 $cc -P <testcpp.c >testcpp.out 2>&1; \
3501 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3502 echo "Yipee, that works!"
3505 elif echo 'Nope...maybe "'"$cc"' -P -" will work...'; \
3506 $cc -P - <testcpp.c >testcpp.out 2>&1; \
3507 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3508 echo "At long last!"
3511 elif echo 'No such luck, maybe "'$cpp'" will work...'; \
3512 $cpp <testcpp.c >testcpp.out 2>&1; \
3513 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3517 elif echo 'Nixed again...maybe "'$cpp' -" will work...'; \
3518 $cpp - <testcpp.c >testcpp.out 2>&1; \
3519 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3520 echo "Hooray, it works! I was beginning to wonder."
3523 elif echo 'Uh-uh. Time to get fancy. Trying a wrapper...'; \
3524 $wrapper <testcpp.c >testcpp.out 2>&1; \
3525 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3531 rp="No dice. I can't find a C preprocessor. Name one:"
3535 $x_cpp <testcpp.c >testcpp.out 2>&1
3536 if $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3537 echo "OK, that will do." >&4
3539 echo "Sorry, I can't get that to work. Go find one and rerun Configure." >&4
3554 echo "Perhaps can we force $cc -E using a wrapper..."
3555 if $wrapper <testcpp.c >testcpp.out 2>&1; \
3556 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
3562 echo "Nope, we'll have to live without it..."
3576 "$wrapper"|'cppstdin') ;;
3577 *) $rm -f $wrapper;;
3579 $rm -f testcpp.c testcpp.out
3581 : Set private lib path
3584 plibpth="$incpath/usr/lib /usr/local/lib /usr/ccs/lib"
3589 '') dlist="$loclibpth $plibpth $glibpth";;
3590 *) dlist="$libpth";;
3593 : Now check and see which directories actually exist, avoiding duplicates
3597 if $test -d $xxx; then
3600 *) libpth="$libpth $xxx";;
3606 Some systems have incompatible or broken versions of libraries. Among
3607 the directories listed in the question below, please remove any you
3608 know not to be holding relevant libraries, and add any that are needed.
3609 Say "none" for none.
3620 rp="Directories to use for library searches?"
3627 : compute shared library extension
3630 if xxx=`./loc libc.sl X $libpth`; $test -f "$xxx"; then
3640 On some systems, shared libraries may be available. Answer 'none' if
3641 you want to suppress searching of shared libraries for the remainder
3642 of this configuration.
3645 rp='What is the file extension used for shared libraries?'
3649 : Define several unixisms.
3650 : Hints files or command line option can be used to override them.
3651 : The convoluted testing is in case hints files set either the old
3654 '') case "$exe_ext" in
3656 *) _exe="$exe_ext" ;;
3661 '') case "$lib_ext" in
3668 '') case "$obj_ext" in
3675 '') case "$path_sep" in
3686 : Which makefile gets called first. This is used by make depend.
3687 case "$firstmakefile" in
3688 '') firstmakefile='makefile';;
3692 $define|true|[yY]*) dflt='y';;
3697 Perl can be built to use the SOCKS proxy protocol library. To do so,
3698 Configure must be run with -Dusesocks.
3700 If this doesn't make any sense to you, just accept the default '$dflt'.
3702 rp='Build Perl for SOCKS?'
3705 y|Y) val="$define" ;;
3711 : Looking for optional libraries
3713 echo "Checking for optional libraries..." >&4
3718 case "$libswanted" in
3719 '') libswanted='c_s';;
3722 "$define") libswanted="$libswanted socks5 socks5_sh" ;;
3728 for thisdir in $libpth $xlibpth; do
3729 test -d $thisdir && libspath="$libspath $thisdir"
3731 for thislib in $libswanted; do
3732 for thisdir in $libspath; do
3734 if $test ! -f "$xxx" -a "X$ignore_versioned_solibs" = "X"; then
3735 xxx=`ls $thisdir/lib$thislib.$so.[0-9] 2>/dev/null|tail -1`
3736 $test -f "$xxx" && eval $libscheck
3737 $test -f "$xxx" && libstyle=shared
3739 if test ! -f "$xxx"; then
3740 xxx=$thisdir/lib$thislib.$so
3741 $test -f "$xxx" && eval $libscheck
3742 $test -f "$xxx" && libstyle=shared
3744 if test ! -f "$xxx"; then
3745 xxx=$thisdir/lib$thislib$_a
3746 $test -f "$xxx" && eval $libscheck
3747 $test -f "$xxx" && libstyle=static
3749 if test ! -f "$xxx"; then
3750 xxx=$thisdir/$thislib$_a
3751 $test -f "$xxx" && eval $libscheck
3752 $test -f "$xxx" && libstyle=static
3754 if test ! -f "$xxx"; then
3755 xxx=$thisdir/lib${thislib}_s$_a
3756 $test -f "$xxx" && eval $libscheck
3757 $test -f "$xxx" && libstyle=static
3758 $test -f "$xxx" && thislib=${thislib}_s
3760 if test ! -f "$xxx"; then
3761 xxx=$thisdir/Slib$thislib$_a
3762 $test -f "$xxx" && eval $libscheck
3763 $test -f "$xxx" && libstyle=static
3765 if $test -f "$xxx"; then
3767 shared) echo "Found -l$thislib (shared)." ;;
3768 static) echo "Found -l$thislib." ;;
3769 *) echo "Found -l$thislib ($libstyle)." ;;
3773 *) dflt="$dflt -l$thislib"
3774 libsfound="$libsfound $xxx"
3776 libsfiles="$libsfiles $yyy"
3777 yyy=`echo $xxx|$sed -e "s%/$yyy\\$%%"`
3778 case " $libsdirs " in
3780 *) libsdirs="$libsdirs $yyy" ;;
3787 if $test ! -f "$xxx"; then
3788 echo "No -l$thislib."
3799 ' '|'') dflt='none';;
3804 In order to compile $package on your machine, a number of libraries
3805 are usually needed. Include any other special libraries here as well.
3806 Say "none" for none. The default list is almost always right.
3810 rp="What libraries to use?"
3817 : determine optimization, if desired, or use for debug flag also
3819 ' '|$undef) dflt='none';;
3821 *) dflt="$optimize";;
3825 By default, $package compiles with the -O flag to use the optimizer.
3826 Alternately, you might want to use the symbolic debugger, which uses
3827 the -g flag (on traditional Unix systems). Either flag can be
3828 specified here. To use neither flag, specify the word "none".
3831 rp="What optimizer/debugger flag should be used?"
3835 'none') optimize=" ";;
3839 : We will not override a previous value, but we might want to
3840 : augment a hint file
3842 default|recommended)
3843 case "$gccversion" in
3844 1*) dflt='-fpcc-struct-return' ;;
3847 *-g*) dflt="$dflt -DDEBUGGING";;
3849 case "$gccversion" in
3850 2*) if test -d /etc/conf/kconfig.d &&
3851 $contains _POSIX_VERSION $usrinc/sys/unistd.h >/dev/null 2>&1
3857 case "$gccversion" in
3861 echo "Checking if your compiler accepts -fno-strict-aliasing" 2>&1
3862 echo 'int main(void) { return 0; }' > gcctest.c
3863 if $cc -O2 -fno-strict-aliasing -o gcctest gcctest.c; then
3864 echo "Yes, it does." 2>&1
3867 echo "Leaving current flags $ccflags alone." 2>&1
3869 *) dflt="$dflt -fno-strict-aliasing" ;;
3872 echo "Nope, it doesn't, but that's ok." 2>&1
3879 case "$mips_type" in
3880 *BSD*|'') inclwanted="$locincpth $usrinc";;
3881 *) inclwanted="$locincpth $inclwanted $usrinc/bsd";;
3883 for thisincl in $inclwanted; do
3884 if $test -d $thisincl; then
3885 if $test x$thisincl != x$usrinc; then
3888 *) dflt="$dflt -I$thisincl";;
3894 inctest='if $contains $2 $usrinc/$1 >/dev/null 2>&1; then
3896 elif $contains $2 $usrinc/sys/$1 >/dev/null 2>&1; then
3904 *) dflt="$dflt -D$2";;
3908 set signal.h LANGUAGE_C; eval $inctest
3912 ccflags="$ccflags -DSOCKS"
3917 default|recommended) dflt="$ccflags $dflt" ;;
3918 *) dflt="$ccflags";;
3926 Your C compiler may want other flags. For this question you should include
3927 -I/whatever and -DWHATEVER flags and any other flags used by the C compiler,
3928 but you should NOT include libraries or ld flags like -lwhatever. If you
3929 want $package to honor its debug switch, you should include -DDEBUGGING here.
3930 Your C compiler might also need additional flags, such as -D_POSIX_SOURCE.
3932 To use no flags, specify the word "none".
3938 rp="Any additional cc flags?"
3945 : the following weeds options from ccflags that are of no interest to cpp
3947 case "$gccversion" in
3948 1*) cppflags="$cppflags -D__GNUC__"
3950 case "$mips_type" in
3952 *BSD*) cppflags="$cppflags -DSYSTYPE_BSD43";;
3958 echo "Let me guess what the preprocessor flags are..." >&4
3972 *) ftry="$previous $flag";;
3974 if $cppstdin -DLFRULB=bar $cppflags $ftry $cppminus <cpp.c \
3975 >cpp1.out 2>/dev/null && \
3976 $cpprun -DLFRULB=bar $cppflags $ftry $cpplast <cpp.c \
3977 >cpp2.out 2>/dev/null && \
3978 $contains 'foo.*xx.*bar' cpp1.out >/dev/null 2>&1 && \
3979 $contains 'foo.*xx.*bar' cpp2.out >/dev/null 2>&1
3981 cppflags="$cppflags $ftry"
3991 *-*) echo "They appear to be: $cppflags";;
3993 $rm -f cpp.c cpp?.out
3997 : flags used in final linking phase
3999 '') if ./venix; then
4005 *-posix*) dflt="$dflt -posix" ;;
4008 *) dflt="$ldflags";;
4011 : Try to guess additional flags to pick up local libraries.
4012 for thislibdir in $libpth; do
4013 case " $loclibpth " in
4016 *"-L$thislibdir "*) ;;
4017 *) dflt="$dflt -L$thislibdir" ;;
4029 Your C linker may need flags. For this question you should
4030 include -L/whatever and any other flags used by the C linker, but you
4031 should NOT include libraries like -lwhatever.
4033 Make sure you include the appropriate -L/path flags if your C linker
4034 does not normally search all of the directories you specified above,
4037 To use no flags, specify the word "none".
4041 rp="Any additional ld flags (NOT including libraries)?"
4047 rmlist="$rmlist pdp11"
4051 echo "Checking your choice of C compiler and flags for coherency..." >&4
4052 $cat > try.c <<'EOF'
4054 int main() { printf("Ok\n"); exit(0); }
4056 set X $cc $optimize $ccflags -o try $ldflags try.c $libs
4058 $cat >try.msg <<'EOM'
4059 I've tried to compile and run the following simple program:
4062 $cat try.c >> try.msg
4064 $cat >> try.msg <<EOM
4071 and I got the following output:
4075 if sh -c "$cc $optimize $ccflags -o try $ldflags try.c $libs" >>try.msg 2>&1; then
4076 if sh -c './try' >>try.msg 2>&1; then
4080 *) echo 'The program compiled OK, but produced no output.' >> try.msg
4083 cat >> try.msg <<'EOQS'
4084 If $libs contains -lsfio, and sfio is mis-configured, then it
4085 sometimes (apparently) runs and exits with a 0 status, but with no
4086 output! It may have to do with sfio's use of _exit vs. exit.
4089 rp="You have a big problem. Shall I abort Configure"
4096 echo "The program compiled OK, but exited with status $?." >>try.msg
4097 rp="You have a problem. Shall I abort Configure"
4101 echo "I can't compile the test program." >>try.msg
4102 rp="You have a BIG problem. Shall I abort Configure"
4108 case "$knowitall" in
4110 echo "(The supplied flags or libraries might be incorrect.)"
4118 *) echo "Ok. Stopping Configure." >&4
4123 n) echo "OK, that should do.";;
4125 $rm -f try try.* core
4127 : define an is-a-typedef? function
4128 typedef='type=$1; var=$2; def=$3; shift; shift; shift; inclist=$@;
4130 "") inclist="sys/types.h";;
4132 eval "varval=\$$var";
4136 for inc in $inclist; do
4137 echo "#include <$inc>" >>temp.c;
4139 echo "#ifdef $type" >> temp.c;
4140 echo "printf(\"We have $type\");" >> temp.c;
4141 echo "#endif" >> temp.c;
4142 $cppstdin $cppflags $cppminus < temp.c >temp.E 2>/dev/null;
4143 if $contains $type temp.E >/dev/null 2>&1; then
4149 *) eval "$var=\$varval";;
4152 : define an is-a-typedef? function that prompts if the type is not available.
4153 typedef_ask='type=$1; var=$2; def=$3; shift; shift; shift; inclist=$@;
4155 "") inclist="sys/types.h";;
4157 eval "varval=\$$var";
4161 for inc in $inclist; do
4162 echo "#include <$inc>" >>temp.c;
4164 echo "#ifdef $type" >> temp.c;
4165 echo "printf(\"We have $type\");" >> temp.c;
4166 echo "#endif" >> temp.c;
4167 $cppstdin $cppflags $cppminus < temp.c >temp.E 2>/dev/null;
4169 echo "$rp" | $sed -e "s/What is/Looking for/" -e "s/?/./";
4170 if $contains $type temp.E >/dev/null 2>&1; then
4171 echo "$type found." >&4;
4174 echo "$type NOT found." >&4;
4180 *) eval "$var=\$varval";;
4183 : define a shorthand compile call
4187 $cc $optimize $ccflags $ldflags -o ${mc_file} $* ${mc_file}.c $libs > /dev/null 2>&1;'
4188 : define a shorthand compile call for compilations that should be ok.
4192 $cc $optimize $ccflags $ldflags -o ${mc_file} $* ${mc_file}.c $libs;'
4194 : check for lengths of integral types
4198 echo "Checking to see how big your integers are..." >&4
4199 $cat >intsize.c <<'EOCP'
4203 printf("intsize=%d;\n", (int)sizeof(int));
4204 printf("longsize=%d;\n", (int)sizeof(long));
4205 printf("shortsize=%d;\n", (int)sizeof(short));
4210 if eval $compile_ok && ./intsize > /dev/null; then
4212 echo "Your integers are $intsize bytes long."
4213 echo "Your long integers are $longsize bytes long."
4214 echo "Your short integers are $shortsize bytes long."
4218 Help! I can't compile and run the intsize test program: please enlighten me!
4219 (This is probably a misconfiguration in your system or libraries, and
4220 you really ought to fix it. Still, I'll try anyway.)
4224 rp="What is the size of an integer (in bytes)?"
4228 rp="What is the size of a long integer (in bytes)?"
4232 rp="What is the size of a short integer (in bytes)?"
4238 $rm -f intsize intsize.*
4240 : see what type lseek is declared as in the kernel
4241 rp="What is the type used for lseek's offset on this system?"
4242 set off_t lseektype long stdio.h sys/types.h
4246 echo "Checking to see how big your file offsets are..." >&4
4248 #include <sys/types.h>
4252 printf("%d\n", (int)sizeof($lseektype));
4257 if eval $compile_ok; then
4259 echo "Your file offsets are $lseeksize bytes long."
4263 echo "(I can't seem to compile the test program. Guessing...)"
4264 rp="What is the size of your file offsets (in bytes)?"
4270 : see what type file positions are declared as in the library
4271 rp="What is the type for file position used by fsetpos()?"
4272 set fpos_t fpostype long stdio.h sys/types.h
4277 *_t) zzz="$fpostype" ;;
4280 echo "Checking the size of $zzz..." >&4
4282 #include <sys/types.h>
4285 printf("%d\n", (int)sizeof($fpostype));
4290 if eval $compile_ok; then
4294 echo "(I can't execute the test program--guessing $fpossize.)" >&4
4297 echo "Your $zzz is $fpossize bytes long."
4303 echo "(I can't compile the test program. Guessing...)" >&4
4304 rp="What is the size of your file positions (in bytes)?"
4311 # Backward compatibility (uselfs is deprecated).
4313 "$define"|true|[yY]*)
4316 *** Configure -Duselfs is deprecated, using -Duselargefiles instead.
4318 uselargefiles="$define"
4322 case "$lseeksize:$fpossize" in
4325 You can have files larger than 2 gigabytes.
4328 *) case "$uselargefiles" in
4329 "$undef"|false|[nN]*) dflt='n' ;;
4334 Perl can be built to understand large files (files larger than 2 gigabytes)
4335 on some systems. To do so, Configure can be run with -Duselargefiles.
4337 If this doesn't make any sense to you, just accept the default '$dflt'.
4339 rp='Try to understand large files, if available?'
4342 y|Y) val="$define" ;;
4349 case "$uselargefiles" in
4351 : Look for a hint-file generated 'call-back-unit'. If the
4352 : user has specified that a large files perl is to be built,
4353 : we may need to set or change some other defaults.
4354 if $test -f uselargefiles.cbu; then
4355 echo "Your platform has some specific hints for large file builds, using them..."
4356 . ./uselargefiles.cbu
4358 echo "Rechecking to see how big your file offsets are..." >&4
4360 #include <sys/types.h>
4364 printf("%d\n", (int)sizeof($lseektype));
4369 if eval $compile_ok; then
4371 $echo "Your file offsets are now $lseeksize bytes long."
4375 echo "(I can't seem to compile the test program. Guessing...)"
4376 rp="What is the size of your file offsets (in bytes)?"
4381 *_t) zzz="$fpostype" ;;
4384 $echo $n "Rechecking the size of $zzz...$c" >&4
4386 #include <sys/types.h>
4389 printf("%d\n", (int)sizeof($fpostype));
4394 if eval $compile_ok; then
4399 echo "(I can't execute the test program--guessing $fpossize.)" >&4
4402 echo " $fpossize bytes." >&4
4408 echo "(I can't compile the test program. Guessing...)" >&4
4409 rp="What is the size of your file positions (in bytes)?"
4419 case "$usemorebits" in
4420 "$define"|true|[yY]*)
4421 use64bitint="$define"
4422 uselongdouble="$define"
4423 usemorebits="$define"
4425 *) usemorebits="$undef"
4430 case "$uselonglong" in
4431 "$define"|true|[yY]*)
4434 *** Configure -Duselonglong is deprecated, using -Duse64bitint instead.
4436 use64bitint="$define"
4439 case "$use64bits" in
4440 "$define"|true|[yY]*)
4443 *** Configure -Duse64bits is deprecated, using -Duse64bitint instead.
4445 use64bitint="$define"
4448 case "$use64bitints" in
4449 "$define"|true|[yY]*)
4452 *** There is no Configure -Duse64bitints, using -Duse64bitint instead.
4454 use64bitint="$define"
4457 case "$use64bitsint" in
4458 "$define"|true|[yY]*)
4461 *** There is no Configure -Duse64bitsint, using -Duse64bitint instead.
4463 use64bitint="$define"
4466 case "$uselonglongs" in
4467 "$define"|true|[yY]*)
4470 *** There is no Configure -Duselonglongs, using -Duse64bitint instead.
4472 use64bitint="$define"
4475 case "$use64bitsall" in
4476 "$define"|true|[yY]*)
4479 *** There is no Configure -Duse64bitsall, using -Duse64bitall instead.
4481 use64bitall="$define"
4486 *-DUSE_LONG_LONG*|*-DUSE_64_BIT_INT*|*-DUSE_64_BIT_ALL*) use64bitint="$define";;
4488 case "$use64bitall" in
4489 "$define"|true|[yY]*) use64bitint="$define" ;;
4495 You have natively 64-bit long integers.
4499 *) case "$use64bitint" in
4500 "$define"|true|[yY]*) dflt='y';;
4505 Perl can be built to take advantage of 64-bit integer types
4506 on some systems. To do so, Configure can be run with -Duse64bitint.
4507 Choosing this option will most probably introduce binary incompatibilities.
4509 If this doesn't make any sense to you, just accept the default '$dflt'.
4511 rp='Try to use 64-bit integers, if available?'
4514 [yY]*) val="$define" ;;
4522 case "$use64bitall" in
4523 "$define"|true|[yY]*) dflt='y' ;;
4524 *) case "$longsize" in
4532 You may also choose to try maximal 64-bitness. It means using as much
4533 64-bitness as possible on the platform. This in turn means even more
4534 binary incompatibilities. On the other hand, your platform may not
4535 have any more 64-bitness available than what you already have chosen.
4537 If this doesn't make any sense to you, just accept the default '$dflt'.
4539 rp='Try to use maximal 64-bit support, if available?'
4542 [yY]*) val="$define" ;;
4547 case "$use64bitall" in
4549 case "$use64bitint" in
4553 Since you have chosen a maximally 64-bit build, I'm also turning on
4554 the use of 64-bit integers.
4556 use64bitint="$define" ;;
4561 case "$use64bitint" in
4562 "$define"|true|[yY]*)
4563 : Look for a hint-file generated 'call-back-unit'. If the
4564 : user has specified that a 64-bit perl is to be built,
4565 : we may need to set or change some other defaults.
4566 if $test -f use64bitint.cbu; then
4567 echo "Your platform has some specific hints for 64-bit integers, using them..."
4571 4) case "$archname64" in
4572 '') archname64=64int ;;
4579 case "$use64bitall" in
4580 "$define"|true|[yY]*)
4581 : Look for a hint-file generated 'call-back-unit'. If the
4582 : user has specified that a maximally 64-bit perl is to be built,
4583 : we may need to set or change some other defaults.
4584 if $test -f use64bitall.cbu; then
4585 echo "Your platform has some specific hints for 64-bit builds, using them..."
4589 4) case "$archname64" in
4590 ''|64int) archname64=64all ;;
4597 : determine the architecture name
4599 if xxx=`./loc arch blurfl $pth`; $test -f "$xxx"; then
4600 tarch=`arch`"-$osname"
4601 elif xxx=`./loc uname blurfl $pth`; $test -f "$xxx" ; then
4602 if uname -m > tmparch 2>&1 ; then
4603 tarch=`$sed -e 's/ *$//' -e 's/ /_/g' \
4604 -e 's/$/'"-$osname/" tmparch`
4612 case "$myarchname" in
4615 echo "(Your architecture name used to be $myarchname.)"
4622 *) dflt="$archname";;
4624 rp='What is your architecture name'
4627 case "$usethreads" in
4629 echo "Threads selected." >&4
4631 *-thread*) echo "...and architecture name already has -thread." >&4
4633 *) archname="$archname-thread"
4634 echo "...setting architecture name to $archname." >&4
4639 case "$usemultiplicity" in
4641 echo "Multiplicity selected." >&4
4643 *-multi*) echo "...and architecture name already has -multi." >&4
4645 *) archname="$archname-multi"
4646 echo "...setting architecture name to $archname." >&4
4651 case "$use64bitint" in
4653 case "$archname64" in
4658 *-$archname64*) echo "...and architecture name already has $archname64." >&4
4660 *) archname="$archname-$archname64"
4661 echo "...setting architecture name to $archname." >&4
4668 : determine root of directory hierarchy where package will be installed.
4671 dflt=`./loc . /usr/local /usr/local /local /opt /usr`
4679 By default, $package will be installed in $dflt/bin, manual pages
4680 under $dflt/man, etc..., i.e. with $dflt as prefix for all
4681 installation directories. Typically this is something like /usr/local.
4682 If you wish to have binaries under /usr/bin but other parts of the
4683 installation under /usr/local, that's ok: you will be prompted
4684 separately for each of the installation directories, the prefix being
4685 only used to set the defaults.
4689 rp='Installation prefix to use?'
4697 *) oldprefix="$prefix";;
4707 $define|true) afs=true ;;
4708 $undef|false) afs=false ;;
4709 *) if test -d /afs; then
4717 echo "AFS may be running... I'll be extra cautious then..." >&4
4719 echo "AFS does not seem to be running..." >&4
4722 : determine installation prefix for where package is to be installed.
4726 Since you are running AFS, I need to distinguish the directory in which
4727 files will reside from the directory in which they are installed (and from
4728 which they are presumably copied to the former directory by occult means).
4731 case "$installprefix" in
4732 '') dflt=`echo $prefix | sed 's#^/afs/#/afs/.#'`;;
4733 *) dflt="$installprefix";;
4738 In some special cases, particularly when building $package for distribution,
4739 it is convenient to distinguish between the directory in which files should
4740 be installed from the directory ($prefix) in which they
4741 will eventually reside. For most users, these two directories are the same.
4744 case "$installprefix" in
4746 *) dflt=$installprefix;;
4750 rp='What installation prefix should I use for installing files?'
4752 installprefix="$ans"
4753 installprefixexp="$ansexp"
4755 : set the prefixit variable, to compute a suitable default value
4756 prefixit='case "$3" in
4758 case "$oldprefix" in
4759 "") eval "$1=\"\$$2\"";;
4766 ""|" ") eval "$1=\"\$$2\"";;
4772 eval "tp=\"$oldprefix-\$$2-\""; eval "tp=\"$tp\"";
4774 --|/*--|\~*--) eval "$1=\"$prefix/$3\"";;
4775 /*-$oldprefix/*|\~*-$oldprefix/*)
4776 eval "$1=\`echo \$$2 | sed \"s,^$oldprefix,$prefix,\"\`";;
4777 *) eval "$1=\"\$$2\"";;
4782 : get the patchlevel
4784 echo "Getting the current patchlevel..." >&4
4785 if $test -r $rsrc/patchlevel.h;then
4786 revision=`awk '/define[ ]+PERL_REVISION/ {print $3}' $rsrc/patchlevel.h`
4787 patchlevel=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
4788 subversion=`awk '/define[ ]+PERL_SUBVERSION/ {print $3}' $rsrc/patchlevel.h`
4789 api_revision=`awk '/define[ ]+PERL_API_REVISION/ {print $3}' $rsrc/patchlevel.h`
4790 api_version=`awk '/define[ ]+PERL_API_VERSION/ {print $3}' $rsrc/patchlevel.h`
4791 api_subversion=`awk '/define[ ]+PERL_API_SUBVERSION/ {print $3}' $rsrc/patchlevel.h`
4800 $echo $n "(You have $package revision $revision" $c
4801 $echo $n " patchlevel $patchlevel" $c
4802 test 0 -eq "$subversion" || $echo $n " subversion $subversion" $c
4806 : XXX Should be a Configure test for double-dots in filenames.
4807 version=`echo $revision $patchlevel $subversion | \
4808 $awk '{ printf "%d_%d_%d\n", $1, $2, $3 }'`
4809 api_versionstring=`echo $api_revision $api_version $api_subversion | \
4810 $awk '{ printf "%d_%d_%d\n", $1, $2, $3 }'`
4813 version=`echo $revision $patchlevel $subversion | \
4814 $awk '{ printf "%d.%d.%d\n", $1, $2, $3 }'`
4815 api_versionstring=`echo $api_revision $api_version $api_subversion | \
4816 $awk '{ printf "%d.%d.%d\n", $1, $2, $3 }'`
4819 : Special case the 5.005_xx maintenance series, which used 5.005
4820 : without any subversion label as a subdirectory in $sitelib
4821 if test "${api_revision}${api_version}${api_subversion}" = "550"; then
4822 api_versionstring='5.005'
4825 : determine installation style
4826 : For now, try to deduce it from prefix unless it is already set.
4827 : Reproduce behavior of 5.005 and earlier, maybe drop that in 5.7.
4828 case "$installstyle" in
4829 '') case "$prefix" in
4830 *perl*) dflt='lib';;
4831 *) dflt='lib/perl5' ;;
4834 *) dflt="$installstyle" ;;
4836 : Probably not worth prompting for this since we prompt for all
4837 : the directories individually, and the prompt would be too long and
4841 : determine where private library files go
4842 : Usual default is /usr/local/lib/perl5/$version.
4843 : Also allow things like /opt/perl/lib/$version, since
4844 : /opt/perl/lib/perl5... would be redundant.
4845 : The default "style" setting is made in installstyle.U
4846 case "$installstyle" in
4847 *lib/perl5*) set dflt privlib lib/$package/$version ;;
4848 *) set dflt privlib lib/$version ;;
4853 There are some auxiliary files for $package that need to be put into a
4854 private library directory that is accessible by everyone.
4858 rp='Pathname where the private library files will reside?'
4861 privlibexp="$ansexp"
4862 : Change installation prefix, if necessary.
4863 if $test X"$prefix" != X"$installprefix"; then
4864 installprivlib=`echo $privlibexp | sed "s#^$prefix#$installprefix#"`
4866 installprivlib="$privlibexp"
4869 : set the prefixup variable, to restore leading tilda escape
4870 prefixup='case "$prefixexp" in
4872 *) eval "$1=\`echo \$$1 | sed \"s,^$prefixexp,$prefix,\"\`";;
4875 : determine where public architecture dependent libraries go
4878 : privlib default is /usr/local/lib/$package/$version
4879 : archlib default is /usr/local/lib/$package/$version/$archname
4880 : privlib may have an optional trailing /share.
4881 tdflt=`echo $privlib | $sed 's,/share$,,'`
4882 tdflt=$tdflt/$archname
4891 $spackage contains architecture-dependent library files. If you are
4892 sharing libraries in a heterogeneous environment, you might store
4893 these files in a separate location. Otherwise, you can just include
4894 them with the rest of the public library files.
4898 rp='Where do you want to put the public architecture-dependent libraries?'
4901 archlibexp="$ansexp"
4902 if $test X"$archlib" = X"$privlib"; then
4907 : Change installation prefix, if necessary.
4908 if $test X"$prefix" != X"$installprefix"; then
4909 installarchlib=`echo $archlibexp | sed "s#^$prefix#$installprefix#"`
4911 installarchlib="$archlibexp"
4915 : Binary compatibility with 5.005 is not possible for builds
4916 : with advanced features
4917 case "$usethreads$usemultiplicity" in
4919 bincompat5005="$undef"
4920 d_bincompat5005="$undef"
4924 This version of Perl can be compiled for binary compatibility with 5.005.
4925 If you decide to do so, you will be able to continue using most of the
4926 extensions that were compiled for Perl 5.005.
4929 case "$bincompat5005$d_bincompat5005" in
4930 *"$undef"*) dflt=n ;;
4933 rp='Binary compatibility with Perl 5.005?'
4936 y*) val="$define" ;;
4941 case "$d_bincompat5005" in
4943 bincompat5005="$define"
4945 *) bincompat5005="$undef"
4946 d_bincompat5005="$undef"
4953 : see if setuid scripts can be secure
4956 Some kernels have a bug that prevents setuid #! scripts from being
4957 secure. Some sites have disabled setuid #! scripts because of this.
4959 First let's decide if your kernel supports secure setuid #! scripts.
4960 (If setuid #! scripts would be secure but have been disabled anyway,
4961 don't say that they are secure if asked.)
4966 if $test -d /dev/fd; then
4967 echo "#!$ls" >reflect
4968 chmod +x,u+s reflect
4969 ./reflect >flect 2>&1
4970 if $contains "/dev/fd" flect >/dev/null; then
4971 echo "Congratulations, your kernel has secure setuid scripts!" >&4
4975 If you are not sure if they are secure, I can check but I'll need a
4976 username and password different from the one you are using right now.
4977 If you don't have such a username or don't want me to test, simply
4981 rp='Other username to test security of setuid scripts with?'
4986 case "$d_suidsafe" in
4987 '') echo "I'll assume setuid scripts are *not* secure." >&4
4990 echo "Well, the $hint value is *not* secure." >&4
4992 *) echo "Well, the $hint value *is* secure." >&4
4997 $rm -f reflect flect
4998 echo "#!$ls" >reflect
4999 chmod +x,u+s reflect
5002 echo '"su" will (probably) prompt you for '"$ans's password."
5003 su $ans -c './reflect >flect'
5004 if $contains "/dev/fd" flect >/dev/null; then
5005 echo "Okay, it looks like setuid scripts are secure." >&4
5008 echo "I don't think setuid scripts are secure." >&4
5013 rp='Does your kernel have *secure* setuid scripts?'
5016 [yY]*) val="$define";;
5021 echo "I don't think setuid scripts are secure (no /dev/fd directory)." >&4
5022 echo "(That's for file descriptors, not floppy disks.)"
5028 $rm -f reflect flect
5030 : now see if they want to do setuid emulation
5033 case "$d_suidsafe" in
5036 echo "No need to emulate SUID scripts since they are secure here." >& 4
5040 Some systems have disabled setuid scripts, especially systems where
5041 setuid scripts cannot be secure. On systems where setuid scripts have
5042 been disabled, the setuid/setgid bits on scripts are currently
5043 useless. It is possible for $package to detect those bits and emulate
5044 setuid/setgid in a secure fashion. This emulation will only work if
5045 setuid scripts have been disabled in your kernel.
5049 "$define") dflt=y ;;
5052 rp="Do you want to do setuid/setgid emulation?"
5055 [yY]*) val="$define";;
5063 : determine filename position in cpp output
5065 echo "Computing filename position in cpp output for #include directives..." >&4
5066 echo '#include <stdio.h>' > foo.c
5069 $cppstdin $cppflags $cppminus <foo.c 2>/dev/null | \
5070 $grep '^[ ]*#.*stdio\.h' | \
5071 while read cline; do
5074 while $test \$# -gt 0; do
5075 if $test -r \`echo \$1 | $tr -d '"'\`; then
5080 pos=\`expr \$pos + 1\`
5092 *) pos="${fieldn}th";;
5094 echo "Your cpp writes the filename in the $pos field of the line."
5096 : locate header file
5101 for usrincdir in $usrinc
5103 if test -f \$usrincdir/\$wanted; then
5104 echo "\$usrincdir/\$wanted"
5108 awkprg='{ print \$$fieldn }'
5109 echo "#include <\$wanted>" > foo\$\$.c
5110 $cppstdin $cppminus $cppflags < foo\$\$.c 2>/dev/null | \
5111 $grep "^[ ]*#.*\$wanted" | \
5112 while read cline; do
5113 name=\`echo \$cline | $awk "\$awkprg" | $tr -d '"'\`
5115 *[/\\\\]\$wanted) echo "\$name"; exit 1;;
5116 *[\\\\/]\$wanted) echo "\$name"; exit 1;;
5121 # status = 0: grep returned 0 lines, case statement not executed
5122 # status = 1: headerfile found
5123 # status = 2: while loop executed, no headerfile found
5127 if test \$status -eq 1; then
5134 : define an alternate in-header-list? function
5135 inhdr='echo " "; td=$define; tu=$undef; yyy=$@;
5136 cont=true; xxf="echo \"<\$1> found.\" >&4";
5137 case $# in 2) xxnf="echo \"<\$1> NOT found.\" >&4";;
5138 *) xxnf="echo \"<\$1> NOT found, ...\" >&4";;
5140 case $# in 4) instead=instead;; *) instead="at last";; esac;
5141 while $test "$cont"; do
5143 var=$2; eval "was=\$$2";
5144 if $test "$xxx" && $test -r "$xxx";
5146 eval "case \"\$$var\" in $undef) . ./whoa; esac"; eval "$var=\$td";
5149 eval "case \"\$$var\" in $define) . ./whoa; esac"; eval "$var=\$tu"; fi;
5150 set $yyy; shift; shift; yyy=$@;
5151 case $# in 0) cont="";;
5152 2) xxf="echo \"but I found <\$1> $instead.\" >&4";
5153 xxnf="echo \"and I did not find <\$1> either.\" >&4";;
5154 *) xxf="echo \"but I found <\$1\> instead.\" >&4";
5155 xxnf="echo \"there is no <\$1>, ...\" >&4";;
5159 do set $yyy; var=$2; eval "was=\$$2";
5160 eval "case \"\$$var\" in $define) . ./whoa; esac"; eval "$var=\$tu";
5161 set $yyy; shift; shift; yyy=$@;
5164 : see if this is a malloc.h system
5165 set malloc.h i_malloc
5168 : see if stdlib is available
5169 set stdlib.h i_stdlib
5172 : determine which malloc to compile in
5174 case "$usemymalloc" in
5175 ''|[yY]*|true|$define) dflt='y' ;;
5178 rp="Do you wish to attempt to use the malloc that comes with $package?"
5184 mallocsrc='malloc.c'
5185 mallocobj="malloc$_o"
5186 d_mymalloc="$define"
5189 : Remove malloc from list of libraries to use
5190 echo "Removing unneeded -lmalloc from library list" >&4
5191 set `echo X $libs | $sed -e 's/-lmalloc / /' -e 's/-lmalloc$//'`
5194 echo "libs = $libs" >&4
5206 : compute the return types of malloc and free
5208 $cat >malloc.c <<END
5212 #include <sys/types.h>
5226 case "$malloctype" in
5228 if $cc $ccflags -c -DTRY_MALLOC malloc.c >/dev/null 2>&1; then
5235 echo "Your system wants malloc to return '$malloctype', it would seem." >&4
5239 if $cc $ccflags -c -DTRY_FREE malloc.c >/dev/null 2>&1; then
5246 echo "Your system uses $freetype free(), it would seem." >&4
5250 The installation process will also create a directory for
5251 vendor-supplied add-ons. Vendors who supply perl with their system
5252 may find it convenient to place all vendor-supplied files in this
5253 directory rather than in the main distribution directory. This will
5254 ease upgrades between binary-compatible maintenance versions of perl.
5256 Of course you may also use these directories in whatever way you see
5257 fit. For example, you might use them to access modules shared over a
5258 company-wide network.
5260 The default answer should be fine for most people.
5261 This causes further questions about vendor add-ons to be skipped
5262 and no vendor-specific directories will be configured for perl.
5265 rp='Do you want to configure vendor-specific add-on directories?'
5266 case "$usevendorprefix" in
5267 define|true|[yY]*) dflt=y ;;
5268 *) : User may have set vendorprefix directly on Configure command line.
5269 case "$vendorprefix" in
5278 rp='Installation prefix to use for vendor-supplied add-ons?'
5279 case "$vendorprefix" in
5281 *) dflt=$vendorprefix ;;
5284 : XXX Prefixit unit does not yet support siteprefix and vendorprefix
5286 case "$vendorprefix" in
5290 *) oldvendorprefix="$prefix";;
5294 usevendorprefix="$define"
5296 vendorprefixexp="$ansexp"
5298 *) usevendorprefix="$undef"
5304 case "$vendorprefix" in
5305 '') d_vendorlib="$undef"
5309 *) d_vendorlib="$define"
5310 : determine where vendor-supplied modules go.
5311 : Usual default is /usr/local/lib/perl5/vendor_perl/$version
5312 case "$vendorlib" in
5314 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
5315 case "$installstyle" in
5316 *lib/perl5*) dflt=$vendorprefix/lib/$package/vendor_$prog/$version ;;
5317 *) dflt=$vendorprefix/lib/vendor_$prog/$version ;;
5320 *) dflt="$vendorlib"
5324 rp='Pathname for the vendor-supplied library files?'
5327 vendorlibexp="$ansexp"
5330 vendorlib_stem=`echo "$vendorlibexp" | sed "s,/$version$,,"`
5331 : Change installation prefix, if necessary.
5332 if $test X"$prefix" != X"$installprefix"; then
5333 installvendorlib=`echo $vendorlibexp | $sed "s#^$prefix#$installprefix#"`
5335 installvendorlib="$vendorlibexp"
5338 case "$vendorprefix" in
5339 '') d_vendorarch="$undef"
5343 *) d_vendorarch="$define"
5344 : determine where vendor-supplied architecture-dependent libraries go.
5345 : vendorlib default is /usr/local/lib/perl5/vendor_perl/$version
5346 : vendorarch default is /usr/local/lib/perl5/vendor_perl/$version/$archname
5347 : vendorlib may have an optional trailing /share.
5348 case "$vendorarch" in
5349 '') dflt=`echo $vendorlib | $sed 's,/share$,,'`
5350 dflt="$dflt/$archname"
5352 *) dflt="$vendorarch" ;;
5355 rp='Pathname for vendor-supplied architecture-dependent files?'
5358 vendorarchexp="$ansexp"
5361 : Change installation prefix, if necessary.
5362 if $test X"$prefix" != X"$installprefix"; then
5363 installvendorarch=`echo $vendorarchexp | sed "s#^$prefix#$installprefix#"`
5365 installvendorarch="$vendorarchexp"
5368 : Cruising for prototypes
5370 echo "Checking out function prototypes..." >&4
5371 $cat >prototype.c <<'EOCP'
5372 int main(int argc, char *argv[]) {
5375 if $cc $ccflags -c prototype.c >prototype.out 2>&1 ; then
5376 echo "Your C compiler appears to support function prototypes."
5379 echo "Your C compiler doesn't seem to understand function prototypes."
5386 case "$prototype" in
5388 *) ansi2knr='ansi2knr'
5393 This version of $package can only be compiled by a compiler that
5394 understands function prototypes. Unfortunately, your C compiler
5396 doesn't seem to understand them. Sorry about that.
5398 If GNU cc is available for your system, perhaps you could try that instead.
5400 Eventually, we hope to support building Perl with pre-ANSI compilers.
5401 If you would like to help in that effort, please contact <perlbug@perl.org>.
5403 Aborting Configure now.
5409 : determine where public executables go
5414 rp='Pathname where the public executables will reside?'
5416 if $test "X$ansexp" != "X$binexp"; then
5421 : Change installation prefix, if necessary.
5422 : XXX Bug? -- ignores Configure -Dinstallprefix setting.
5423 if $test X"$prefix" != X"$installprefix"; then
5424 installbin=`echo $binexp | sed "s#^$prefix#$installprefix#"`
5426 installbin="$binexp"
5429 : Find perl5.005 or later.
5430 echo "Looking for a previously installed perl5.005 or later... "
5432 '') for tdir in `echo "$binexp:$PATH" | $sed "s/$path_sep/ /g"`; do
5433 : Check if this perl is recent and can load a simple module
5434 if $test -x $tdir/perl && $tdir/perl -Mless -e 'use 5.005;' >/dev/null 2>&1; then
5437 elif $test -x $tdir/perl5 && $tdir/perl5 -Mless -e 'use 5.005;' >/dev/null 2>&1; then
5447 '') echo "None found. That's ok.";;
5448 *) echo "Using $perl5." ;;
5453 After $package is installed, you may wish to install various
5454 add-on modules and utilities. Typically, these add-ons will
5455 be installed under $prefix with the rest
5456 of this package. However, you may wish to install such add-ons
5457 elsewhere under a different prefix.
5459 If you do not wish to put everything under a single prefix, that's
5460 ok. You will be prompted for the individual locations; this siteprefix
5461 is only used to suggest the defaults.
5463 The default should be fine for most people.
5467 rp='Installation prefix to use for add-on modules and utilities?'
5468 : XXX Here might be another good place for an installstyle setting.
5469 case "$siteprefix" in
5471 *) dflt=$siteprefix ;;
5474 : XXX Prefixit unit does not yet support siteprefix and vendorprefix
5476 case "$siteprefix" in
5480 *) oldsiteprefix="$prefix";;
5485 siteprefixexp="$ansexp"
5487 : determine where site specific libraries go.
5488 : Usual default is /usr/local/lib/perl5/site_perl/$version
5489 : The default "style" setting is made in installstyle.U
5490 : XXX No longer works with Prefixit stuff.
5491 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
5493 '') case "$installstyle" in
5494 *lib/perl5*) dflt=$siteprefix/lib/$package/site_$prog/$version ;;
5495 *) dflt=$siteprefix/lib/site_$prog/$version ;;
5503 The installation process will create a directory for
5504 site-specific extensions and modules. Most users find it convenient
5505 to place all site-specific files in this directory rather than in the
5506 main distribution directory.
5510 rp='Pathname for the site-specific library files?'
5513 sitelibexp="$ansexp"
5514 sitelib_stem=`echo "$sitelibexp" | sed "s,/$version$,,"`
5515 : Change installation prefix, if necessary.
5516 if $test X"$prefix" != X"$installprefix"; then
5517 installsitelib=`echo $sitelibexp | $sed "s#^$prefix#$installprefix#"`
5519 installsitelib="$sitelibexp"
5522 : Determine list of previous versions to include in @INC
5523 $cat > getverlist <<EOPL
5526 \$api_versionstring = "$api_versionstring";
5527 \$version = "$version";
5528 \$stem = "$sitelib_stem";
5529 \$archname = "$archname";
5531 $cat >> getverlist <<'EOPL'
5532 # Can't have leading @ because metaconfig interprets it as a command!
5533 ;@inc_version_list=();
5534 # XXX Redo to do opendir/readdir?
5537 ;@candidates = glob("5.*");
5543 # XXX ToDo: These comparisons must be reworked when two-digit
5544 # subversions come along, so that 5.7.10 compares as greater than
5545 # 5.7.3! By that time, hope that 5.6.x is sufficiently
5546 # widespread that we can use the built-in version vectors rather
5547 # than reinventing them here. For 5.6.0, however, we must
5548 # assume this script will likely be run by 5.005_0x. --AD 1/2000.
5549 foreach $d (@candidates) {
5550 if ($d lt $version) {
5551 if ($d ge $api_versionstring) {
5552 unshift(@inc_version_list, grep { -d } "$d/$archname", $d);
5554 elsif ($d ge "5.005") {
5555 unshift(@inc_version_list, grep { -d } $d);
5559 # Skip newer version. I.e. don't look in
5560 # 5.7.0 if we're installing 5.6.1.
5564 if (@inc_version_list) {
5565 print join(' ', @inc_version_list);
5568 # Blank space to preserve value for next Configure run.
5573 case "$inc_version_list" in
5574 '') if test -x "$perl5"; then
5575 dflt=`$perl5 getverlist`
5580 $undef) dflt='none' ;;
5581 *) dflt="$inc_version_list" ;;
5584 ''|' ') dflt=none ;;
5588 In order to ease the process of upgrading, this version of perl
5589 can be configured to use modules built and installed with earlier
5590 versions of perl that were installed under $prefix. Specify here
5591 the list of earlier versions that this version of perl should check.
5592 If Configure detected no earlier versions of perl installed under
5593 $prefix, then the list will be empty. Answer 'none' to tell perl
5594 to not search earlier versions.
5596 The default should almost always be sensible, so if you're not sure,
5597 just accept the default.
5600 rp='List of earlier versions to include in @INC?'
5603 [Nn]one|''|' ') inc_version_list=' ' ;;
5604 *) inc_version_list="$ans" ;;
5606 case "$inc_version_list" in
5608 inc_version_list_init='0';;
5609 *) inc_version_list_init=`echo $inc_version_list |
5610 $sed -e 's/^/"/' -e 's/ /","/g' -e 's/$/",0/'`
5615 : determine whether to install perl also as /usr/bin/perl
5618 if $test -d /usr/bin -a "X$installbin" != X/usr/bin; then
5620 Many scripts expect perl to be installed as /usr/bin/perl.
5621 I can install the perl you are about to compile also as /usr/bin/perl
5622 (in addition to $installbin/perl).
5624 case "$installusrbinperl" in
5625 "$undef"|[nN]*) dflt='n';;
5628 rp="Do you want to install perl as /usr/bin/perl?"
5631 [yY]*) val="$define";;
5637 set installusrbinperl
5641 echo "Checking for GNU C Library..." >&4
5642 cat >gnulibc.c <<EOM
5654 if eval $compile_ok && ./gnulibc; then
5656 echo "You are using the GNU C Library"
5659 echo "You are not using the GNU C Library"
5665 : see if nm is to be used to determine whether a symbol is defined or not
5669 case "$d_gnulibc" in
5672 echo "nm probably won't work on the GNU C Library." >&4
5678 if $test "$osname" = aix -a ! -f /lib/syscalls.exp; then
5680 echo "Whoops! This is an AIX system without /lib/syscalls.exp!" >&4
5681 echo "'nm' won't be sufficient on this sytem." >&4
5687 '') dflt=`$egrep 'inlibc|csym' $rsrc/Configure | wc -l 2>/dev/null`
5688 if $test $dflt -gt 20; then
5698 true|$define) dflt=y;;
5705 I can use $nm to extract the symbols from your C libraries. This
5706 is a time consuming task which may generate huge output on the disk (up
5707 to 3 megabytes) but that should make the symbols extraction faster. The
5708 alternative is to skip the 'nm' extraction part and to compile a small
5709 test program instead to determine whether each symbol is present. If
5710 you have a fast C compiler and/or if your 'nm' output cannot be parsed,
5711 this may be the best solution.
5713 You probably shouldn't let me use 'nm' if you are using the GNU C Library.
5716 rp="Shall I use $nm to extract C symbols from the libraries?"
5719 [Nn]*) usenm=false;;
5728 : nm options which may be necessary
5730 '') if $test -f /mach_boot; then
5732 elif $test -d /usr/ccs/lib; then
5733 nm_opt='-p' # Solaris (and SunOS?)
5734 elif $test -f /dgux; then
5736 elif $test -f /lib64/rld; then
5737 nm_opt='-p' # 64-bit Irix
5743 : nm options which may be necessary for shared libraries but illegal
5744 : for archive libraries. Thank you, Linux.
5745 case "$nm_so_opt" in
5746 '') case "$myuname" in
5748 if $nm --help | $grep 'dynamic' > /dev/null 2>&1; then
5749 nm_so_opt='--dynamic'
5758 : get list of predefined functions in a handy place
5763 *-lc_s*) libc=`./loc libc_s$_a $libc $libpth`
5770 *) for thislib in $libs; do
5773 : Handle C library specially below.
5776 thislib=`echo $thislib | $sed -e 's/^-l//'`
5777 if try=`./loc lib$thislib.$so.'*' X $libpth`; $test -f "$try"; then
5779 elif try=`./loc lib$thislib.$so X $libpth`; $test -f "$try"; then
5781 elif try=`./loc lib$thislib$_a X $libpth`; $test -f "$try"; then
5783 elif try=`./loc $thislib$_a X $libpth`; $test -f "$try"; then
5785 elif try=`./loc lib$thislib X $libpth`; $test -f "$try"; then
5787 elif try=`./loc $thislib X $libpth`; $test -f "$try"; then
5789 elif try=`./loc Slib$thislib$_a X $xlibpth`; $test -f "$try"; then
5794 libnames="$libnames $try"
5796 *) libnames="$libnames $thislib" ;;
5805 for xxx in $libpth; do
5806 $test -r $1 || set $xxx/libc.$so
5807 : The messy sed command sorts on library version numbers.
5809 set `echo blurfl; echo $xxx/libc.$so.[0-9]* | \
5810 tr ' ' $trnl | egrep -v '\.[A-Za-z]*$' | $sed -e '
5812 s/[0-9][0-9]*/0000&/g
5813 s/0*\([0-9][0-9][0-9][0-9][0-9]\)/\1/g
5816 sort | $sed -e 's/^.* //'`
5819 $test -r $1 || set /usr/ccs/lib/libc.$so
5820 $test -r $1 || set /lib/libsys_s$_a
5826 if $test -r "$1"; then
5827 echo "Your (shared) C library seems to be in $1."
5829 elif $test -r /lib/libc && $test -r /lib/clib; then
5830 echo "Your C library seems to be in both /lib/clib and /lib/libc."
5832 libc='/lib/clib /lib/libc'
5833 if $test -r /lib/syslib; then
5834 echo "(Your math library is in /lib/syslib.)"
5835 libc="$libc /lib/syslib"
5837 elif $test -r "$libc" || (test -h "$libc") >/dev/null 2>&1; then
5838 echo "Your C library seems to be in $libc, as you said before."
5839 elif $test -r $incpath/usr/lib/libc$_a; then
5840 libc=$incpath/usr/lib/libc$_a;
5841 echo "Your C library seems to be in $libc. That's fine."
5842 elif $test -r /lib/libc$_a; then
5844 echo "Your C library seems to be in $libc. You're normal."
5846 if tans=`./loc libc$_a blurfl/dyick $libpth`; $test -r "$tans"; then
5848 elif tans=`./loc libc blurfl/dyick $libpth`; $test -r "$tans"; then
5849 libnames="$libnames "`./loc clib blurfl/dyick $libpth`
5850 elif tans=`./loc clib blurfl/dyick $libpth`; $test -r "$tans"; then
5852 elif tans=`./loc Slibc$_a blurfl/dyick $xlibpth`; $test -r "$tans"; then
5854 elif tans=`./loc Mlibc$_a blurfl/dyick $xlibpth`; $test -r "$tans"; then
5857 tans=`./loc Llibc$_a blurfl/dyick $xlibpth`
5859 if $test -r "$tans"; then
5860 echo "Your C library seems to be in $tans, of all places."
5866 if $test $xxx = apollo -o -r "$libc" || (test -h "$libc") >/dev/null 2>&1; then
5870 If the guess above is wrong (which it might be if you're using a strange
5871 compiler, or your machine supports multiple models), you can override it here.
5876 echo $libpth | tr ' ' $trnl | sort | uniq > libpath
5878 I can't seem to find your C library. I've looked in the following places:
5881 $sed 's/^/ /' libpath
5884 None of these seems to contain your C library. I need to get its name...
5889 rp='Where is your C library?'
5894 echo $libc $libnames | tr ' ' $trnl | sort | uniq > libnames
5895 set X `cat libnames`
5898 case $# in 1) xxx=file; esac
5899 echo "Extracting names from the following $xxx for later perusal:" >&4
5901 $sed 's/^/ /' libnames >&4
5903 $echo $n "This may take a while...$c" >&4
5907 *$so*) $nm $nm_so_opt $nm_opt $file 2>/dev/null;;
5908 *) $nm $nm_opt $file 2>/dev/null;;
5913 $grep fprintf libc.tmp > libc.ptf
5914 xscan='eval "<libc.ptf $com >libc.list"; $echo $n ".$c" >&4'
5915 xrun='eval "<libc.tmp $com >libc.list"; echo "done" >&4'
5917 if com="$sed -n -e 's/__IO//' -e 's/^.* $xxx *_[_.]*//p' -e 's/^.* $xxx *//p'";\
5919 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5921 elif com="$sed -n -e 's/^__*//' -e 's/^\([a-zA-Z_0-9$]*\).*xtern.*/\1/p'";\
5923 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5925 elif com="$sed -n -e '/|UNDEF/d' -e '/FUNC..GL/s/^.*|__*//p'";\
5927 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5929 elif com="$sed -n -e 's/^.* D __*//p' -e 's/^.* D //p'";\
5931 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5933 elif com="$sed -n -e 's/^_//' -e 's/^\([a-zA-Z_0-9]*\).*xtern.*text.*/\1/p'";\
5935 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5937 elif com="$sed -n -e 's/^.*|FUNC |GLOB .*|//p'";\
5939 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5941 elif com="$grep '|' | $sed -n -e '/|COMMON/d' -e '/|DATA/d' \
5942 -e '/ file/d' -e 's/^\([^ ]*\).*/\1/p'";\
5944 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5946 elif com="$sed -n -e 's/^.*|FUNC |GLOB .*|//p' -e 's/^.*|FUNC |WEAK .*|//p'";\
5948 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5950 elif com="$sed -n -e 's/^__//' -e '/|Undef/d' -e '/|Proc/s/ .*//p'";\
5952 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5954 elif com="$sed -n -e 's/^.*|Proc .*|Text *| *//p'";\
5956 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5958 elif com="$sed -n -e '/Def. Text/s/.* \([^ ]*\)\$/\1/p'";\
5960 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5962 elif com="$sed -n -e 's/^[-0-9a-f ]*_\(.*\)=.*/\1/p'";\
5964 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5966 elif com="$sed -n -e 's/.*\.text n\ \ \ \.//p'";\
5968 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5970 elif com="sed -n -e 's/^__.*//' -e 's/[ ]*D[ ]*[0-9]*.*//p'";\
5972 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5975 $nm -p $* 2>/dev/null >libc.tmp
5976 $grep fprintf libc.tmp > libc.ptf
5977 if com="$sed -n -e 's/^.* [ADTSIW] *_[_.]*//p' -e 's/^.* [ADTSIW] //p'";\
5978 eval $xscan; $contains '^fprintf$' libc.list >/dev/null 2>&1
5984 echo "$nm didn't seem to work right. Trying $ar instead..." >&4
5986 if $ar t $libc > libc.tmp && $contains '^fprintf$' libc.tmp >/dev/null 2>&1; then
5987 for thisname in $libnames $libc; do
5988 $ar t $thisname >>libc.tmp
5990 $sed -e "s/\\$_o\$//" < libc.tmp > libc.list
5992 elif test "X$osname" = "Xos2" && $ar tv $libc > libc.tmp; then
5993 # Repeat libc to extract forwarders to DLL entries too
5994 for thisname in $libnames $libc; do
5995 $ar tv $thisname >>libc.tmp
5996 # Revision 50 of EMX has bug in $ar.
5997 # it will not extract forwarders to DLL entries
5998 # Use emximp which will extract exactly them.
5999 emximp -o tmp.imp $thisname \
6001 $sed -e 's/^\([_a-zA-Z0-9]*\) .*$/\1/p' \
6002 < tmp.imp >>libc.tmp
6005 $sed -e "s/\\$_o\$//" -e 's/^ \+//' < libc.tmp > libc.list
6008 echo "$ar didn't seem to work right." >&4
6009 echo "Maybe this is a Cray...trying bld instead..." >&4
6010 if bld t $libc | $sed -e 's/.*\///' -e "s/\\$_o:.*\$//" > libc.list
6012 for thisname in $libnames; do
6014 $sed -e 's/.*\///' -e "s/\\$_o:.*\$//" >>libc.list
6015 $ar t $thisname >>libc.tmp
6019 echo "That didn't work either. Giving up." >&4
6026 if $test -f /lib/syscalls.exp; then
6028 echo "Also extracting names from /lib/syscalls.exp for good ole AIX..." >&4
6029 $sed -n 's/^\([^ ]*\)[ ]*syscall[0-9]*$/\1/p' /lib/syscalls.exp >>libc.list
6033 $rm -f libnames libpath
6035 : see if dld is available
6039 : is a C symbol defined?
6042 -v) tf=libc.tmp; tc=""; tdc="";;
6043 -a) tf=libc.tmp; tc="[0]"; tdc="[]";;
6044 *) tlook="^$1\$"; tf=libc.list; tc="()"; tdc="()";;
6047 case "$reuseval-$4" in
6049 true-*) tx=no; eval "tval=\$$4"; case "$tval" in "") tx=yes;; esac;;
6055 if $contains $tlook $tf >/dev/null 2>&1;
6060 echo "int main() { extern short $1$tdc; printf(\"%hd\", $1$tc); }" > t.c;
6061 if $cc $optimize $ccflags $ldflags -o t t.c $libs >/dev/null 2>&1;
6069 $define) tval=true;;
6075 : define an is-in-libc? function
6076 inlibc='echo " "; td=$define; tu=$undef;
6077 sym=$1; var=$2; eval "was=\$$2";
6079 case "$reuseval$was" in
6089 echo "$sym() found." >&4;
6090 case "$was" in $undef) . ./whoa; esac; eval "$var=\$td";;
6092 echo "$sym() NOT found." >&4;
6093 case "$was" in $define) . ./whoa; esac; eval "$var=\$tu";;
6097 $define) echo "$sym() found." >&4;;
6098 *) echo "$sym() NOT found." >&4;;
6102 : see if dlopen exists
6109 : determine which dynamic loading, if any, to compile in
6111 dldir="ext/DynaLoader"
6124 $define) dflt='y' ;;
6127 $define) dflt='y' ;;
6129 : Does a dl_xxx.xs file exist for this operating system
6130 $test -f $rsrc/$dldir/dl_${osname}.xs && dflt='y'
6133 rp="Do you wish to use dynamic loading?"
6140 if $test -f $rsrc/$dldir/dl_${osname}.xs ; then
6141 dflt="$dldir/dl_${osname}.xs"
6142 elif $test "$d_dlopen" = "$define" ; then
6143 dflt="$dldir/dl_dlopen.xs"
6144 elif $test "$i_dld" = "$define" ; then
6145 dflt="$dldir/dl_dld.xs"
6150 *) dflt="$dldir/$dlsrc"
6153 echo "The following dynamic loading files are available:"
6154 : Can not go over to $dldir because getfile has path hard-coded in.
6155 tdir=`pwd`; cd $rsrc; $ls -C $dldir/dl*.xs; cd $tdir
6156 rp="Source file to use for dynamic loading"
6162 dlsrc=`echo $ans | $sed -e 's%.*/\([^/]*\)$%\1%'`
6166 Some systems may require passing special flags to $cc -c to
6167 compile modules that will be used to create a shared library.
6168 To use no flags, say "none".
6171 case "$cccdlflags" in
6172 '') case "$gccversion" in
6173 '') case "$osname" in
6175 next) dflt='none' ;;
6176 irix*) dflt='-KPIC' ;;
6177 svr4*|esix*|solaris) dflt='-KPIC' ;;
6178 sunos) dflt='-pic' ;;
6182 *) case "$osname" in
6183 svr4*|esix*|solaris) dflt='-fPIC' ;;
6188 *) dflt="$cccdlflags" ;;
6190 rp="Any special flags to pass to $cc -c to compile shared library modules?"
6193 none) cccdlflags=' ' ;;
6194 *) cccdlflags="$ans" ;;
6199 Some systems use ld to create libraries that can be dynamically loaded,
6200 while other systems (such as those using ELF) use $cc.
6204 '') $cat >try.c <<'EOM'
6205 /* Test for whether ELF binaries are produced */
6210 int i = open("a.out",O_RDONLY);
6213 if(read(i,b,4)==4 && b[0]==127 && b[1]=='E' && b[2]=='L' && b[3]=='F')
6214 exit(0); /* succeed (yes, it's ELF) */
6219 if $cc $ccflags try.c >/dev/null 2>&1 && ./a.out; then
6221 You appear to have ELF support. I'll use $cc to build dynamic libraries.
6225 echo "I'll use ld to build dynamic libraries."
6234 rp="What command should be used to create dynamic libraries?"
6240 Some systems may require passing special flags to $ld to create a
6241 library that can be dynamically loaded. If your ld flags include
6242 -L/other/path options to locate libraries outside your loader's normal
6243 search path, you may need to specify those -L options here as well. To
6244 use no flags, say "none".
6247 case "$lddlflags" in
6248 '') case "$osname" in
6249 beos) dflt='-nostart' ;;
6251 case "$gccversion" in
6252 '') dflt="$dflt +vnocompatwarnings" ;;
6255 linux|irix*) dflt='-shared' ;;
6256 next) dflt='none' ;;
6257 solaris) dflt='-G' ;;
6258 sunos) dflt='-assert nodefinitions' ;;
6259 svr4*|esix*) dflt="-G $ldflags" ;;
6263 *) dflt="$lddlflags" ;;
6266 : Try to guess additional flags to pick up local libraries.
6267 : Be careful not to append to a plain 'none'
6271 for thisflag in $ldflags; do
6276 *) dflt="$dflt $thisflag" ;;
6283 ''|' ') dflt='none' ;;
6286 rp="Any special flags to pass to $ld to create a dynamically loaded library?"
6289 none) lddlflags=' ' ;;
6290 *) lddlflags="$ans" ;;
6295 Some systems may require passing special flags to $cc to indicate that
6296 the resulting executable will use dynamic linking. To use no flags,
6300 case "$ccdlflags" in
6301 '') case "$osname" in
6302 hpux) dflt='-Wl,-E' ;;
6303 linux) dflt='-rdynamic' ;;
6304 next) dflt='none' ;;
6305 sunos) dflt='none' ;;
6309 *) dflt="$ccdlflags" ;;
6311 rp="Any special flags to pass to $cc to use dynamic linking?"
6314 none) ccdlflags=' ' ;;
6315 *) ccdlflags="$ans" ;;
6329 # No dynamic loading being used, so don't bother even to prompt.
6332 *) case "$useshrplib" in
6333 '') case "$osname" in
6334 svr4*|dgux|dynixptx|esix|powerux|beos|cygwin*)
6336 also='Building a shared libperl is required for dynamic loading to work on your system.'
6341 also='Building a shared libperl is needed for MAB support.'
6359 The perl executable is normally obtained by linking perlmain.c with
6360 libperl${_a}, any static extensions (usually just DynaLoader), and
6361 any other libraries needed on this system (such as -lm, etc.). Since
6362 your system supports dynamic loading, it is probably possible to build
6363 a shared libperl.$so. If you will have more than one executable linked
6364 to libperl.$so, this will significantly reduce the size of each
6365 executable, but it may have a noticeable affect on performance. The
6366 default is probably sensible for your system.
6370 rp="Build a shared libperl.$so (y/n)"
6374 useshrplib='true' ;;
6375 *) useshrplib='false' ;;
6380 case "$useshrplib" in
6384 # Figure out a good name for libperl.so. Since it gets stored in
6385 # a version-specific architecture-dependent library, the version
6386 # number isn't really that important, except for making cc/ld happy.
6388 # A name such as libperl.so.3.1
6389 majmin="libperl.$so.$patchlevel.$subversion"
6390 # A name such as libperl.so.301
6391 majonly=`echo $patchlevel $subversion |
6392 $awk '{printf "%d%02d", $1, $2}'`
6393 majonly=libperl.$so.$majonly
6394 # I'd prefer to keep the os-specific stuff here to a minimum, and
6395 # rely on figuring it out from the naming of libc.
6396 case "${osname}${osvers}" in
6399 # XXX How handle the --version stuff for MAB?
6401 linux*) # ld won't link with a bare -lperl otherwise.
6404 cygwin*) # include version
6405 dflt=`echo libperl$version | sed -e 's/\./_/g'`$lib_ext
6407 *) # Try to guess based on whether libc has major.minor.
6409 *libc.$so.[0-9]*.[0-9]*) dflt=$majmin ;;
6410 *libc.$so.[0-9]*) dflt=$majonly ;;
6411 *) dflt=libperl.$so ;;
6421 I need to select a good name for the shared libperl. If your system uses
6422 library names with major and minor numbers, then you might want something
6423 like $majmin. Alternatively, if your system uses a single version
6424 number for shared libraries, then you might want to use $majonly.
6425 Or, your system might be quite happy with a simple libperl.$so.
6427 Since the shared libperl will get installed into a version-specific
6428 architecture-dependent directory, the version number of the shared perl
6429 library probably isn't important, so the default should be o.k.
6432 rp='What name do you want to give to the shared libperl?'
6435 echo "Ok, I'll use $libperl"
6438 libperl="libperl${_a}"
6442 # Detect old use of shrpdir via undocumented Configure -Dshrpdir
6446 WARNING: Use of the shrpdir variable for the installation location of
6447 the shared $libperl is not supported. It was never documented and
6448 will not work in this version. Let me (perlbug@perl.com)
6449 know of any problems this may cause.
6455 But your current setting of $shrpdir is
6456 the default anyway, so it's harmless.
6461 Further, your current attempted setting of $shrpdir
6462 conflicts with the value of $archlibexp/CORE
6463 that installperl will use.
6470 # How will the perl executable find the installed shared $libperl?
6471 # Add $xxx to ccdlflags.
6472 # If we can't figure out a command-line option, use $shrpenv to
6473 # set env LD_RUN_PATH. The main perl makefile uses this.
6474 shrpdir=$archlibexp/CORE
6477 if "$useshrplib"; then
6480 # We'll set it in Makefile.SH...
6486 xxx="-Wl,-R$shrpdir"
6488 linux|irix*|dec_osf)
6489 xxx="-Wl,-rpath,$shrpdir"
6492 # next doesn't like the default...
6495 # beos doesn't like the default, either.
6498 # hpux doesn't like the default, either.
6499 tmp_shrpenv="env LDOPTS=\"+s +b${shrpdir}\""
6502 tmp_shrpenv="env LD_RUN_PATH=$shrpdir"
6508 # Only add $xxx if it isn't already in ccdlflags.
6509 case " $ccdlflags " in
6511 *) ccdlflags="$ccdlflags $xxx"
6514 Adding $xxx to the flags
6515 passed to $ld so that the perl executable will find the
6516 installed shared $libperl.
6524 # Fix ccdlflags in AIX for building external extensions.
6525 # (For building Perl itself bare -bE:perl.exp is needed,
6526 # Makefile.SH takes care of this.)
6528 aix) ccdlflags="$ccdlflags -bE:$installarchlib/CORE/perl.exp" ;;
6530 # Respect a hint or command-line value.
6532 '') shrpenv="$tmp_shrpenv" ;;
6534 case "$ldlibpthname" in
6535 '') ldlibpthname=LD_LIBRARY_PATH ;;
6536 none) ldlibpthname='' ;;
6539 : determine where manual pages go
6540 set man1dir man1dir none
6544 $spackage has manual pages available in source form.
6548 echo "However, you don't have nroff, so they're probably useless to you."
6550 '') man1dir="none";;
6553 echo "If you don't want the manual sources installed, answer 'none'."
6558 lookpath="$prefixexp/man/man1 $prefixexp/man/l_man/man1"
6559 lookpath="$lookpath $prefixexp/man/p_man/man1"
6560 lookpath="$lookpath $prefixexp/man/u_man/man1"
6561 lookpath="$lookpath $prefixexp/man/man.1"
6563 */?_man*) dflt=`./loc . $prefixexp/l_man/man1 $lookpath` ;;
6564 *) dflt=`./loc . $prefixexp/man/man1 $lookpath` ;;
6574 rp="Where do the main $spackage manual pages (source) go?"
6576 if $test "X$man1direxp" != "X$ansexp"; then
6580 man1direxp="$ansexp"
6586 : Change installation prefix, if necessary.
6587 if $test X"$prefix" != X"$installprefix"; then
6588 installman1dir=`echo $man1direxp | $sed "s#^$prefix#$installprefix#"`
6590 installman1dir="$man1direxp"
6593 : What suffix to use on installed man pages
6600 rp="What suffix should be used for the main $spackage man pages?"
6602 '') case "$man1dir" in
6616 *) dflt="$man1ext";;
6623 : see if we can have long filenames
6625 first=123456789abcdef
6627 if (echo hi >$first) 2>/dev/null; then
6628 if $test -f 123456789abcde; then
6629 echo 'You cannot have filenames longer than 14 characters. Sigh.' >&4
6632 echo 'You can have filenames longer than 14 characters.'>&4
6637 You can't have filenames longer than 14 chars.
6638 You can't even think about them!
6644 $rm -rf 123456789abcde*
6646 : determine where library module manual pages go
6647 set man3dir man3dir none
6651 $spackage has manual pages for many of the library modules.
6657 However, you don't have nroff, so they're probably useless to you.
6660 '') man3dir="none";;
6664 case "$d_flexfnam" in
6667 However, your system can't handle the long file names like File::Basename.3.
6670 '') man3dir="none";;
6674 echo "If you don't want the manual sources installed, answer 'none'."
6675 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
6677 '') dflt=`echo "$man1dir" | $sed -e 's/man1/man3/g' -e 's/man\.1/man\.3/g'`
6678 if $test -d "$privlib/man/man3"; then
6681 WARNING: Previous versions of perl installed man3 pages into
6682 $privlib/man/man3. This version will suggest a
6683 new default of $dflt.
6687 rp='Do you wish to preserve the old behavior?(y/n)'
6690 y*) dflt="$privlib/man/man3" ;;
6695 *) dflt="$man3dir" ;;
6702 rp="Where do the $package library man pages (source) go?"
6705 man3direxp="$ansexp"
6711 : Change installation prefix, if necessary.
6712 if $test X"$prefix" != X"$installprefix"; then
6713 installman3dir=`echo $man3direxp | $sed "s#^$prefix#$installprefix#"`
6715 installman3dir="$man3direxp"
6718 : What suffix to use on installed man pages
6724 rp="What suffix should be used for the $package library man pages?"
6726 '') case "$man3dir" in
6740 *) dflt="$man3ext";;
6747 : see if we have to deal with yellow pages, now NIS.
6748 if $test -d /usr/etc/yp || $test -d /etc/yp; then
6749 if $test -f /usr/etc/nibindd; then
6751 echo "I'm fairly confident you're on a NeXT."
6753 rp='Do you get the hosts file via NetInfo?'
6762 y*) hostcat='nidump hosts .';;
6763 *) case "$hostcat" in
6764 nidump*) hostcat='';;
6774 '') if $contains '^\+' /etc/passwd >/dev/null 2>&1; then
6782 rp='Are you getting the hosts file via yellow pages?'
6785 y*) hostcat='ypcat hosts';;
6786 *) hostcat='cat /etc/hosts';;
6792 '') test -f /etc/hosts && hostcat='cat /etc/hosts';;
6795 '') test -f /etc/group && groupcat='cat /etc/group';;
6798 '') test -f /etc/passwd && passcat='cat /etc/passwd';;
6801 : now get the host name
6803 echo "Figuring out host name..." >&4
6804 case "$myhostname" in
6806 echo 'Maybe "hostname" will work...'
6807 if tans=`sh -c hostname 2>&1` ; then
6815 if $test "$cont"; then
6817 echo 'Oh, dear. Maybe "/etc/systemid" is the key...'
6818 if tans=`cat /etc/systemid 2>&1` ; then
6820 phostname='cat /etc/systemid'
6821 echo "Whadyaknow. Xenix always was a bit strange..."
6824 elif $test -r /etc/systemid; then
6825 echo "(What is a non-Xenix system doing with /etc/systemid?)"
6828 if $test "$cont"; then
6829 echo 'No, maybe "uuname -l" will work...'
6830 if tans=`sh -c 'uuname -l' 2>&1` ; then
6832 phostname='uuname -l'
6834 echo 'Strange. Maybe "uname -n" will work...'
6835 if tans=`sh -c 'uname -n' 2>&1` ; then
6837 phostname='uname -n'
6839 echo 'Oh well, maybe I can mine it out of whoami.h...'
6840 if tans=`sh -c $contains' sysname $usrinc/whoami.h' 2>&1` ; then
6841 myhostname=`echo "$tans" | $sed 's/^.*"\(.*\)"/\1/'`
6842 phostname="sed -n -e '"'/sysname/s/^.*\"\\(.*\\)\"/\1/{'"' -e p -e q -e '}' <$usrinc/whoami.h"
6844 case "$myhostname" in
6845 '') echo "Does this machine have an identity crisis or something?"
6848 echo "Well, you said $myhostname before..."
6849 phostname='echo $myhostname';;
6855 : you do not want to know about this
6860 if $test "$myhostname" ; then
6862 rp='Your host name appears to be "'$myhostname'".'" Right?"
6870 : bad guess or no guess
6871 while $test "X$myhostname" = X ; do
6873 rp="Please type the (one word) name of your host:"
6878 : translate upper to lower if necessary
6879 case "$myhostname" in
6881 echo "(Normalizing case in your host name)"
6882 myhostname=`echo $myhostname | ./tr '[A-Z]' '[a-z]'`
6886 case "$myhostname" in
6888 dflt=`expr "X$myhostname" : "X[^.]*\(\..*\)"`
6889 myhostname=`expr "X$myhostname" : "X\([^.]*\)\."`
6890 echo "(Trimming domain name from host name--host name is now $myhostname)"
6892 *) case "$mydomain" in
6895 test "X$hostcat" = "Xypcat hosts" &&
6896 ypmatch "$myhostname" hosts 2>/dev/null |\
6897 $sed -e 's/[ ]*#.*//; s/$/ /' > hosts && \
6900 test "X$hostcat" != "X" &&
6901 $hostcat | $sed -n -e "s/[ ]*#.*//; s/\$/ /
6902 /[ ]$myhostname[ . ]/p" > hosts
6905 $test x`$awk "/[0-9].*[ ]$myhostname$tmp_re/ { sum++ }
6906 END { print sum }" hosts` = x1 || tmp_re="[ ]"
6907 dflt=.`$awk "/[0-9].*[ ]$myhostname$tmp_re/ {for(i=2; i<=NF;i++) print \\\$i}" \
6908 hosts | $sort | $uniq | \
6909 $sed -n -e "s/$myhostname\.\([-a-zA-Z0-9_.]\)/\1/p"`
6910 case `$echo X$dflt` in
6911 X*\ *) echo "(Several hosts in /etc/hosts matched hostname)"
6914 X.) echo "(You do not have fully-qualified names in /etc/hosts)"
6919 tans=`./loc resolv.conf X /etc /usr/etc`
6920 if $test -f "$tans"; then
6921 echo "(Attempting domain name extraction from $tans)"
6922 dflt=.`$sed -n -e 's/ / /g' \
6923 -e 's/^search *\([^ ]*\).*/\1/p' $tans \
6924 | ./tr '[A-Z]' '[a-z]' 2>/dev/null`
6926 .) dflt=.`$sed -n -e 's/ / /g' \
6927 -e 's/^domain *\([^ ]*\).*/\1/p' $tans \
6928 | ./tr '[A-Z]' '[a-z]' 2>/dev/null`
6935 .) echo "(No help from resolv.conf either -- attempting clever guess)"
6936 dflt=.`sh -c domainname 2>/dev/null`
6939 .nis.*|.yp.*|.main.*) dflt=`echo $dflt | $sed -e 's/^\.[^.]*//'`;;
6944 .) echo "(Lost all hope -- silly guess then)"
6950 *) dflt="$mydomain";;
6954 rp="What is your domain name?"
6964 : translate upper to lower if necessary
6967 echo "(Normalizing case in your domain name)"
6968 mydomain=`echo $mydomain | ./tr '[A-Z]' '[a-z]'`
6972 : a little sanity check here
6973 case "$phostname" in
6976 case `$phostname | ./tr '[A-Z]' '[a-z]'` in
6977 $myhostname$mydomain|$myhostname) ;;
6979 case "$phostname" in
6981 echo "(That doesn't agree with your whoami.h file, by the way.)"
6984 echo "(That doesn't agree with your $phostname command, by the way.)"
6994 I need to get your e-mail address in Internet format if possible, i.e.
6995 something like user@host.domain. Please answer accurately since I have
6996 no easy means to double check it. The default value provided below
6997 is most probably close to reality but may not be valid from outside
6998 your organization...
7002 while test "$cont"; do
7004 '') dflt="$cf_by@$myhostname$mydomain";;
7005 *) dflt="$cf_email";;
7007 rp='What is your e-mail address?'
7013 rp='Address does not look like an Internet one. Use it anyway?'
7029 If you or somebody else will be maintaining perl at your site, please
7030 fill in the correct e-mail address here so that they may be contacted
7031 if necessary. Currently, the "perlbug" program included with perl
7032 will send mail to this address in addition to perlbug@perl.com. You may
7033 enter "none" for no administrator.
7036 case "$perladmin" in
7037 '') dflt="$cf_email";;
7038 *) dflt="$perladmin";;
7040 rp='Perl administrator e-mail address'
7044 : figure out how to guarantee perl startup
7045 case "$startperl" in
7047 case "$sharpbang" in
7051 I can use the #! construct to start perl on your system. This will
7052 make startup of perl scripts faster, but may cause problems if you
7053 want to share those scripts and perl is not in a standard place
7054 ($binexp/perl) on all your platforms. The alternative is to force
7055 a shell by starting the script with a single ':' character.
7059 rp='What shall I put after the #! to start up perl ("none" to not use #!)?'
7062 none) startperl=": # use perl";;
7063 *) startperl="#!$ans"
7064 if $test 30 -lt `echo "$ans" | wc -c`; then
7067 WARNING: Some systems limit the #! command to 32 characters.
7068 If you experience difficulty running Perl scripts with #!, try
7069 installing Perl in a directory with a shorter pathname.
7075 *) startperl=": # use perl"
7080 echo "I'll use $startperl to start perl scripts."
7082 : figure best path for perl in scripts
7085 perlpath="$binexp/perl"
7086 case "$startperl" in
7091 I will use the "eval 'exec'" idiom to start Perl on your system.
7092 I can use the full path of your Perl binary for this purpose, but
7093 doing so may cause problems if you want to share those scripts and
7094 Perl is not always in a standard place ($binexp/perl).
7098 rp="What path shall I use in \"eval 'exec'\"?"
7105 case "$startperl" in
7107 *) echo "I'll use $perlpath in \"eval 'exec'\"" ;;
7110 : determine where public executable scripts go
7111 set scriptdir scriptdir
7113 case "$scriptdir" in
7116 : guess some guesses
7117 $test -d /usr/share/scripts && dflt=/usr/share/scripts
7118 $test -d /usr/share/bin && dflt=/usr/share/bin
7119 $test -d /usr/local/script && dflt=/usr/local/script
7120 $test -d /usr/local/scripts && dflt=/usr/local/scripts
7121 $test -d $prefixexp/script && dflt=$prefixexp/script
7125 *) dflt="$scriptdir"
7130 Some installations have a separate directory just for executable scripts so
7131 that they can mount it across multiple architectures but keep the scripts in
7132 one spot. You might, for example, have a subdirectory of /usr/share for this.
7133 Or you might just lump your scripts in with all your other executables.
7137 rp='Where do you keep publicly executable scripts?'
7139 if $test "X$ansexp" != "X$scriptdirexp"; then
7143 scriptdirexp="$ansexp"
7144 : Change installation prefix, if necessary.
7145 if $test X"$prefix" != X"$installprefix"; then
7146 installscript=`echo $scriptdirexp | sed "s#^$prefix#$installprefix#"`
7148 installscript="$scriptdirexp"
7151 : determine where site specific architecture-dependent libraries go.
7152 : sitelib default is /usr/local/lib/perl5/site_perl/$version
7153 : sitearch default is /usr/local/lib/perl5/site_perl/$version/$archname
7154 : sitelib may have an optional trailing /share.
7156 '') dflt=`echo $sitelib | $sed 's,/share$,,'`
7157 dflt="$dflt/$archname"
7162 set sitearch sitearch none
7166 The installation process will also create a directory for
7167 architecture-dependent site-specific extensions and modules.
7171 rp='Pathname for the site-specific architecture-dependent library files?'
7174 sitearchexp="$ansexp"
7175 : Change installation prefix, if necessary.
7176 if $test X"$prefix" != X"$installprefix"; then
7177 installsitearch=`echo $sitearchexp | sed "s#^$prefix#$installprefix#"`
7179 installsitearch="$sitearchexp"
7182 : determine where add-on public executables go
7184 '') dflt=$siteprefix/bin ;;
7188 rp='Pathname where the add-on public executables should be installed?'
7191 sitebinexp="$ansexp"
7192 : Change installation prefix, if necessary.
7193 if $test X"$prefix" != X"$installprefix"; then
7194 installsitebin=`echo $sitebinexp | sed "s#^$prefix#$installprefix#"`
7196 installsitebin="$sitebinexp"
7199 : see if sqrtl exists
7204 *-DUSE_LONG_DOUBLE*|*-DUSE_MORE_BITS*) uselongdouble="$define" ;;
7207 case "$uselongdouble" in
7208 $define|true|[yY]*) dflt='y';;
7213 Perl can be built to take advantage of long doubles which
7214 (if available) may give more accuracy and range for floating point numbers.
7216 If this doesn't make any sense to you, just accept the default '$dflt'.
7218 rp='Try to use long doubles if available?'
7221 y|Y) val="$define" ;;
7227 case "$uselongdouble" in
7228 true|[yY]*) uselongdouble="$define" ;;
7231 case "$uselongdouble" in
7233 : Look for a hint-file generated 'call-back-unit'. If the
7234 : user has specified that long doubles should be used,
7235 : we may need to set or change some other defaults.
7236 if $test -f uselongdouble.cbu; then
7237 echo "Your platform has some specific hints for long doubles, using them..."
7238 . ./uselongdouble.cbu
7241 (Your platform doesn't have any specific hints for long doubles.)
7247 case "$uselongdouble:$d_sqrtl" in
7251 *** You requested the use of long doubles but you do not seem to have
7252 *** the mathematic functions for long doubles. I'm disabling the use
7253 *** of long doubles.
7256 uselongdouble=$undef
7260 case "$useperlio" in
7261 $define|true|[yY]*) dflt='y';;
7266 Previous version of $package used the standard IO mechanisms as defined
7267 in <stdio.h>. Versions 5.003_02 and later of perl allow alternate IO
7268 mechanisms via a "PerlIO" abstraction, but the stdio mechanism is still
7269 the default. This abstraction layer can use AT&T's sfio (if you already
7270 have sfio installed) or regular stdio. Using PerlIO with sfio may cause
7271 problems with some extension modules. Using PerlIO with stdio is safe,
7272 but it is slower than plain stdio and therefore is not the default.
7274 If this doesn't make any sense to you, just accept the default '$dflt'.
7276 rp='Use the experimental PerlIO abstraction layer?'
7283 echo "Ok, doing things the stdio way"
7290 case "$vendorprefix" in
7291 '') d_vendorbin="$undef"
7295 *) d_vendorbin="$define"
7296 : determine where vendor-supplied executables go.
7297 case "$vendorbin" in
7298 '') dflt=$vendorprefix/bin ;;
7299 *) dflt="$vendorbin" ;;
7302 rp='Pathname for the vendor-supplied executables directory?'
7305 vendorbinexp="$ansexp"
7308 : Change installation prefix, if necessary.
7309 if $test X"$prefix" != X"$installprefix"; then
7310 installvendorbin=`echo $vendorbinexp | $sed "s#^$prefix#$installprefix#"`
7312 installvendorbin="$vendorbinexp"
7315 : see if qgcvt exists
7319 : check for length of double
7321 case "$doublesize" in
7323 echo "Checking to see how big your double precision numbers are..." >&4
7324 $cat >try.c <<'EOCP'
7328 printf("%d\n", (int)sizeof(double));
7333 if eval $compile_ok; then
7335 echo "Your double is $doublesize bytes long."
7338 echo "(I can't seem to compile the test program. Guessing...)"
7339 rp="What is the size of a double precision number (in bytes)?"
7347 : check for long doubles
7349 echo "Checking to see if you have long double..." >&4
7350 echo 'int main() { long double x = 7.0; }' > try.c
7352 if eval $compile; then
7354 echo "You have long double."
7357 echo "You do not have long double."
7363 : check for length of long double
7364 case "${d_longdbl}${longdblsize}" in
7367 echo "Checking to see how big your long doubles are..." >&4
7368 $cat >try.c <<'EOCP'
7372 printf("%d\n", sizeof(long double));
7377 if eval $compile; then
7378 longdblsize=`./try$exe_ext`
7379 echo "Your long doubles are $longdblsize bytes long."
7383 echo "(I can't seem to compile the test program. Guessing...)" >&4
7384 rp="What is the size of a long double (in bytes)?"
7388 if $test "X$doublesize" = "X$longdblsize"; then
7389 echo "(That isn't any different from an ordinary double.)"
7397 if $test X"$d_longdbl" = X"$define"; then
7399 echo "Checking how to print long doubles..." >&4
7401 if $test X"$sPRIfldbl" = X -a X"$doublesize" = X"$longdblsize"; then
7402 $cat >try.c <<'EOCP'
7403 #include <sys/types.h>
7407 printf("%.3f\n", d);
7411 if eval $compile; then
7415 sPRIfldbl='"f"'; sPRIgldbl='"g"'; sPRIeldbl='"e"';
7416 sPRIFldbl='"F"'; sPRIGldbl='"G"'; sPRIEldbl='"E"';
7417 echo "We will use %f."
7423 if $test X"$sPRIfldbl" = X; then
7424 $cat >try.c <<'EOCP'
7425 #include <sys/types.h>
7428 long double d = 123.456;
7429 printf("%.3llf\n", d);
7433 if eval $compile; then
7437 sPRIfldbl='"llf"'; sPRIgldbl='"llg"'; sPRIeldbl='"lle"';
7438 sPRIFldbl='"llF"'; sPRIGldbl='"llG"'; sPRIEldbl='"llE"';
7439 echo "We will use %llf."
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("%.3Lf\n", d);
7455 if eval $compile; then
7459 sPRIfldbl='"Lf"'; sPRIgldbl='"Lg"'; sPRIeldbl='"Le"';
7460 sPRIFldbl='"LF"'; sPRIGldbl='"LG"'; sPRIEldbl='"LE"';
7461 echo "We will use %Lf."
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 echo "Cannot figure out how to print long doubles." >&4
7497 case "$sPRIfldbl" in
7498 '') d_PRIfldbl="$undef"; d_PRIgldbl="$undef"; d_PRIeldbl="$undef";
7499 d_PRIFldbl="$undef"; d_PRIGldbl="$undef"; d_PRIEldbl="$undef";
7501 *) d_PRIfldbl="$define"; d_PRIgldbl="$define"; d_PRIeldbl="$define";
7502 d_PRIFldbl="$define"; d_PRIGldbl="$define"; d_PRIEldbl="$define";
7506 : Check how to convert floats to strings.
7507 if test "X$d_Gconvert" = X; then
7509 echo "Checking for an efficient way to convert floats to strings."
7511 case "$uselongdouble" in
7512 "$define") echo "#define USE_LONG_DOUBLE" >>try.c ;;
7514 case "$d_longdbl" in
7515 "$define") echo "#define HAS_LONG_DOUBLE" >>try.c ;;
7517 case "$d_PRIgldbl" in
7518 "$define") echo "#define HAS_PRIgldbl" >>try.c ;;
7522 #define Gconvert(x,n,t,b) gconvert((x),(n),(t),(b))
7523 char *myname = "gconvert";
7526 #define Gconvert(x,n,t,b) gcvt((x),(n),(b))
7527 char *myname = "gcvt";
7530 #define Gconvert(x,n,t,b) qgcvt((x),(n),(b))
7531 char *myname = "qgcvt";
7532 #define DOUBLETYPE long double
7535 #if defined(USE_LONG_DOUBLE) && defined(HAS_LONG_DOUBLE) && defined(HAS_PRIgldbl)
7536 #define Gconvert(x,n,t,b) sprintf((b),"%.*"$sPRIgldbl,(n),(x))
7538 #define Gconvert(x,n,t,b) sprintf((b),"%.*g",(n),(x))
7540 char *myname = "sprintf";
7544 #if defined(USE_LONG_DOUBLE) && defined(HAS_LONG_DOUBLE)
7545 #define DOUBLETYPE long double
7547 #define DOUBLETYPE double
7553 #define I_STDLIB $i_stdlib
7559 checkit(expect, got)
7563 if (strcmp(expect, got)) {
7564 printf("%s oddity: Expected %s, got %s\n",
7565 myname, expect, got);
7575 /* This must be 1st test on (which?) platform */
7576 /* Alan Burlison <AlanBurlsin@unn.unisys.com> */
7577 Gconvert((DOUBLETYPE)0.1, 8, 0, buf);
7578 checkit("0.1", buf);
7580 Gconvert((DOUBLETYPE)1.0, 8, 0, buf);
7583 Gconvert((DOUBLETYPE)1.1, 8, 0, buf);
7584 checkit("1.1", buf);
7586 Gconvert((DOUBLETYPE)1.01, 8, 0, buf);
7587 checkit("1.01", buf);
7589 Gconvert((DOUBLETYPE)1.001, 8, 0, buf);
7590 checkit("1.001", buf);
7592 Gconvert((DOUBLETYPE)1.0001, 8, 0, buf);
7593 checkit("1.0001", buf);
7595 Gconvert((DOUBLETYPE)1.00001, 8, 0, buf);
7596 checkit("1.00001", buf);
7598 Gconvert((DOUBLETYPE)1.000001, 8, 0, buf);
7599 checkit("1.000001", buf);
7601 Gconvert((DOUBLETYPE)0.0, 8, 0, buf);
7604 Gconvert((DOUBLETYPE)-1.0, 8, 0, buf);
7607 /* Some Linux gcvt's give 1.e+5 here. */
7608 Gconvert((DOUBLETYPE)100000.0, 8, 0, buf);
7609 checkit("100000", buf);
7611 /* Some Linux gcvt's give -1.e+5 here. */
7612 Gconvert((DOUBLETYPE)-100000.0, 8, 0, buf);
7613 checkit("-100000", buf);
7618 case "$d_Gconvert" in
7619 gconvert*) xxx_list='gconvert gcvt sprintf' ;;
7620 gcvt*) xxx_list='gcvt gconvert sprintf' ;;
7621 sprintf*) xxx_list='sprintf gconvert gcvt' ;;
7622 *) xxx_list='gconvert gcvt sprintf' ;;
7625 case "$d_longdbl$uselongdouble$d_qgcvt" in
7626 "$define$define$define") xxx_list="`echo $xxx_list|sed 's/gcvt/qgcvt gcvt/'`" ;;
7629 for xxx_convert in $xxx_list; do
7630 echo "Trying $xxx_convert..."
7632 set try -DTRY_$xxx_convert
7633 if eval $compile; then
7634 echo "$xxx_convert() found." >&4
7636 echo "I'll use $xxx_convert to convert floats into a string." >&4
7639 echo "...But $xxx_convert didn't work as I expected."
7642 echo "$xxx_convert NOT found." >&4
7646 case "$xxx_convert" in
7647 gconvert) d_Gconvert='gconvert((x),(n),(t),(b))' ;;
7648 gcvt) d_Gconvert='gcvt((x),(n),(b))' ;;
7649 qgcvt) d_Gconvert='qgcvt((x),(n),(b))' ;;
7650 *) case "$uselongdouble$d_longdbl$d_PRIgldbl" in
7651 "$define$define$define")
7652 d_Gconvert="sprintf((b),\"%.*$sPRIgldbl\",(n),(x))" ;;
7653 *) d_Gconvert='sprintf((b),"%.*g",(n),(x))' ;;
7659 : Initialize h_fcntl
7662 : Initialize h_sysfile
7665 : access call always available on UNIX
7669 : locate the flags for 'access()'
7673 $cat >access.c <<'EOCP'
7674 #include <sys/types.h>
7679 #include <sys/file.h>
7688 : check sys/file.h first, no particular reason here
7689 if $test `./findhdr sys/file.h` && \
7690 $cc $cppflags -DI_SYS_FILE -o access access.c >/dev/null 2>&1 ; then
7692 echo "<sys/file.h> defines the *_OK access constants." >&4
7693 elif $test `./findhdr fcntl.h` && \
7694 $cc $cppflags -DI_FCNTL -o access access.c >/dev/null 2>&1 ; then
7696 echo "<fcntl.h> defines the *_OK access constants." >&4
7697 elif $test `./findhdr unistd.h` && \
7698 $cc $cppflags -DI_UNISTD -o access access.c >/dev/null 2>&1 ; then
7699 echo "<unistd.h> defines the *_OK access constants." >&4
7701 echo "I can't find the four *_OK access constants--I'll use mine." >&4
7707 : see if accessx exists
7708 set accessx d_accessx
7711 : see if alarm exists
7715 : see if atolf exists
7719 : see if atoll exists
7723 : Look for GNU-cc style attribute checking
7725 echo "Checking whether your compiler can handle __attribute__ ..." >&4
7726 $cat >attrib.c <<'EOCP'
7728 void croak (char* pat,...) __attribute__((format(printf,1,2),noreturn));
7730 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
7731 if $contains 'warning' attrib.out >/dev/null 2>&1; then
7732 echo "Your C compiler doesn't fully support __attribute__."
7735 echo "Your C compiler supports __attribute__."
7739 echo "Your C compiler doesn't seem to understand __attribute__ at all."
7746 : see if bcmp exists
7750 : see if bcopy exists
7754 : see if this is a unistd.h system
7755 set unistd.h i_unistd
7758 : see if getpgrp exists
7759 set getpgrp d_getpgrp
7762 case "$d_getpgrp" in
7765 echo "Checking to see which flavor of getpgrp is in use..."
7768 #include <sys/types.h>
7770 # include <unistd.h>
7774 if (getuid() == 0) {
7775 printf("(I see you are running Configure as super-user...)\n");
7779 if (getpgrp(1) == 0)
7788 if $cc -DTRY_BSD_PGRP $ccflags $ldflags -o set set.c $libs >/dev/null 2>&1 && ./set; then
7789 echo "You have to use getpgrp(pid) instead of getpgrp()." >&4
7791 elif $cc $ccflags $ldflags -o set set.c $libs >/dev/null 2>&1 && ./set; then
7792 echo "You have to use getpgrp() instead of getpgrp(pid)." >&4
7795 echo "I can't seem to compile and run the test program."
7797 xxx="a USG one, i.e. you use getpgrp()."
7799 # SVR4 systems can appear rather BSD-ish.
7802 xxx="a BSD one, i.e. you use getpgrp(pid)."
7806 xxx="probably a USG one, i.e. you use getpgrp()."
7811 echo "Assuming your getpgrp is $xxx" >&4
7820 : see if setpgrp exists
7821 set setpgrp d_setpgrp
7824 case "$d_setpgrp" in
7827 echo "Checking to see which flavor of setpgrp is in use..."
7830 #include <sys/types.h>
7832 # include <unistd.h>
7836 if (getuid() == 0) {
7837 printf("(I see you are running Configure as super-user...)\n");
7841 if (-1 == setpgrp(1, 1))
7844 if (setpgrp() != -1)
7850 if $cc -DTRY_BSD_PGRP $ccflags $ldflags -o set set.c $libs >/dev/null 2>&1 && ./set; then
7851 echo 'You have to use setpgrp(pid,pgrp) instead of setpgrp().' >&4
7853 elif $cc $ccflags $ldflags -o set set.c $libs >/dev/null 2>&1 && ./set; then
7854 echo 'You have to use setpgrp() instead of setpgrp(pid,pgrp).' >&4
7857 echo "(I can't seem to compile and run the test program.)"
7859 xxx="a USG one, i.e. you use setpgrp()."
7861 # SVR4 systems can appear rather BSD-ish.
7864 xxx="a BSD one, i.e. you use setpgrp(pid,pgrp)."
7868 xxx="probably a USG one, i.e. you use setpgrp()."
7873 echo "Assuming your setpgrp is $xxx" >&4
7881 : see if bzero exists
7885 : see if signal is declared as pointer to function returning int or void
7887 xxx=`./findhdr signal.h`
7888 $test "$xxx" && $cppstdin $cppminus $cppflags < $xxx >$$.tmp 2>/dev/null
7889 if $contains 'int.*\*[ ]*signal' $$.tmp >/dev/null 2>&1 ; then
7890 echo "You have int (*signal())() instead of void." >&4
7892 elif $contains 'void.*\*[ ]*signal' $$.tmp >/dev/null 2>&1 ; then
7893 echo "You have void (*signal())()." >&4
7895 elif $contains 'extern[ ]*[(\*]*signal' $$.tmp >/dev/null 2>&1 ; then
7896 echo "You have int (*signal())() instead of void." >&4
7898 elif $contains 'void.*\*.*sig' $$.tmp >/dev/null 2>&1 ; then
7899 echo "You have void (*signal())()." >&4
7902 case "$d_voidsig" in
7904 echo "I can't determine whether signal handler returns void or int..." >&4
7906 rp="What type does your signal handler return?"
7913 echo "As you already told me, signal handler returns void." >&4
7916 *) echo "As you already told me, signal handler returns int." >&4
7923 case "$d_voidsig" in
7924 "$define") signal_t="void";;
7929 : check for ability to cast large floats to 32-bit ints.
7931 echo 'Checking whether your C compiler can cast large floats to int32.' >&4
7932 if $test "$intsize" -ge 4; then
7939 #include <sys/types.h>
7941 $signal_t blech(s) int s; { exit(3); }
7948 signal(SIGFPE, blech);
7950 /* Don't let compiler optimize the test away. Store the number
7951 in a writable string for gcc to pass to sscanf under HP/UX.
7953 sprintf(str, "2147483647");
7954 sscanf(str, "%lf", &f); /* f = (double) 0x7fffffff; */
7958 /* x86 processors will probably give 0x8000 0000, which is a
7959 sign change. We don't want that. We want to mimic SPARC
7960 behavior here, which is to preserve the sign and give
7963 if (i32 != ($xxx) f)
7969 if eval $compile_ok; then
7973 echo "(I can't seem to compile the test program--assuming it can't)"
7981 echo "Nope, it can't."
7988 : check for ability to cast negative floats to unsigned
7990 echo 'Checking whether your C compiler can cast negative float to unsigned.' >&4
7993 #include <sys/types.h>
7995 $signal_t blech(s) int s; { exit(7); }
7996 $signal_t blech_in_list(s) int s; { exit(4); }
7997 unsigned long dummy_long(p) unsigned long p; { return p; }
7998 unsigned int dummy_int(p) unsigned int p; { return p; }
7999 unsigned short dummy_short(p) unsigned short p; { return p; }
8003 unsigned long along;
8005 unsigned short ashort;
8009 /* Frustrate gcc-2.7.2's optimizer which failed this test with
8010 a direct f = -123. assignment. gcc-2.8.0 reportedly
8011 optimized the whole file away
8013 /* Store the number in a writable string for gcc to pass to
8016 sprintf(str, "-123");
8017 sscanf(str, "%lf", &f); /* f = -123.; */
8019 signal(SIGFPE, blech);
8020 along = (unsigned long)f;
8021 aint = (unsigned int)f;
8022 ashort = (unsigned short)f;
8023 if (along != (unsigned long)-123)
8025 if (aint != (unsigned int)-123)
8027 if (ashort != (unsigned short)-123)
8029 sprintf(str, "1073741824.");
8030 sscanf(str, "%lf", &f); /* f = (double)0x40000000; */
8033 along = (unsigned long)f;
8034 if (along != 0x80000000)
8038 along = (unsigned long)f;
8039 if (along != 0x7fffffff)
8043 along = (unsigned long)f;
8044 if (along != 0x80000001)
8048 signal(SIGFPE, blech_in_list);
8049 sprintf(str, "123.");
8050 sscanf(str, "%lf", &f); /* f = 123.; */
8051 along = dummy_long((unsigned long)f);
8052 aint = dummy_int((unsigned int)f);
8053 ashort = dummy_short((unsigned short)f);
8054 if (along != (unsigned long)123)
8056 if (aint != (unsigned int)123)
8058 if (ashort != (unsigned short)123)
8065 if eval $compile_ok; then
8069 echo "(I can't seem to compile the test program--assuming it can't)"
8072 case "$castflags" in
8077 echo "Nope, it can't."
8084 : see if vprintf exists
8086 if set vprintf val -f d_vprintf; eval $csym; $val; then
8087 echo 'vprintf() found.' >&4
8089 $cat >vprintf.c <<'EOF'
8090 #include <varargs.h>
8092 int main() { xxx("foo"); }
8101 exit((unsigned long)vsprintf(buf,"%s",args) > 10L);
8105 if eval $compile && ./vprintf; then
8106 echo "Your vsprintf() returns (int)." >&4
8109 echo "Your vsprintf() returns (char*)." >&4
8113 echo 'vprintf() NOT found.' >&4
8123 : see if chown exists
8127 : see if chroot exists
8131 : see if chsize exists
8135 : check for const keyword
8137 echo 'Checking to see if your C compiler knows about "const"...' >&4
8138 $cat >const.c <<'EOCP'
8139 typedef struct spug { int drokk; } spug;
8146 if $cc -c $ccflags const.c >/dev/null 2>&1 ; then
8148 echo "Yup, it does."
8151 echo "Nope, it doesn't."
8156 : see if crypt exists
8158 if set crypt val -f d_crypt; eval $csym; $val; then
8159 echo 'crypt() found.' >&4
8163 cryptlib=`./loc Slibcrypt$_a "" $xlibpth`
8164 if $test -z "$cryptlib"; then
8165 cryptlib=`./loc Mlibcrypt$_a "" $xlibpth`
8169 if $test -z "$cryptlib"; then
8170 cryptlib=`./loc Llibcrypt$_a "" $xlibpth`
8174 if $test -z "$cryptlib"; then
8175 cryptlib=`./loc libcrypt$_a "" $libpth`
8179 if $test -z "$cryptlib"; then
8180 echo 'crypt() NOT found.' >&4
8189 : get csh whereabouts
8191 'csh') val="$undef" ;;
8196 : Respect a hint or command line value for full_csh.
8198 '') full_csh=$csh ;;
8201 : see if cuserid exists
8202 set cuserid d_cuserid
8205 : see if this is a limits.h system
8206 set limits.h i_limits
8209 : see if this is a float.h system
8213 : See if number of significant digits in a double precision number is known
8215 $cat >dbl_dig.c <<EOM
8225 printf("Contains DBL_DIG");
8228 $cppstdin $cppflags $cppminus < dbl_dig.c >dbl_dig.E 2>/dev/null
8229 if $contains 'DBL_DIG' dbl_dig.E >/dev/null 2>&1; then
8230 echo "DBL_DIG found." >&4
8233 echo "DBL_DIG NOT found." >&4
8240 : see if difftime exists
8241 set difftime d_difftime
8244 : see if this is a dirent system
8246 if xinc=`./findhdr dirent.h`; $test "$xinc"; then
8248 echo "<dirent.h> found." >&4
8251 if xinc=`./findhdr sys/dir.h`; $test "$xinc"; then
8252 echo "<sys/dir.h> found." >&4
8255 xinc=`./findhdr sys/ndir.h`
8257 echo "<dirent.h> NOT found." >&4
8262 : Look for type of directory structure.
8264 $cppstdin $cppflags $cppminus < "$xinc" > try.c
8266 case "$direntrytype" in
8269 $define) guess1='struct dirent' ;;
8270 *) guess1='struct direct' ;;
8273 *) guess1="$direntrytype"
8278 'struct dirent') guess2='struct direct' ;;
8279 *) guess2='struct dirent' ;;
8282 if $contains "$guess1" try.c >/dev/null 2>&1; then
8283 direntrytype="$guess1"
8284 echo "Your directory entries are $direntrytype." >&4
8285 elif $contains "$guess2" try.c >/dev/null 2>&1; then
8286 direntrytype="$guess2"
8287 echo "Your directory entries seem to be $direntrytype." >&4
8289 echo "I don't recognize your system's directory entries." >&4
8290 rp="What type is used for directory entries on this system?"
8298 : see if the directory entry stores field length
8300 $cppstdin $cppflags $cppminus < "$xinc" > try.c
8301 if $contains 'd_namlen' try.c >/dev/null 2>&1; then
8302 echo "Good, your directory entry keeps length information in d_namlen." >&4
8305 echo "Your directory entry does not know about the d_namlen field." >&4
8312 : see if dlerror exists
8315 set dlerror d_dlerror
8319 : see if dlfcn is available
8327 On a few systems, the dynamically loaded modules that perl generates and uses
8328 will need a different extension than shared libs. The default will probably
8336 rp='What is the extension of dynamically loaded modules'
8345 : Check if dlsym need a leading underscore
8351 echo "Checking whether your dlsym() needs a leading underscore ..." >&4
8352 $cat >dyna.c <<'EOM'
8361 #include <dlfcn.h> /* the dynamic linker include file for Sunos/Solaris */
8363 #include <sys/types.h>
8377 int mode = RTLD_LAZY ;
8379 handle = dlopen("./dyna.$dlext", mode) ;
8380 if (handle == NULL) {
8385 symbol = dlsym(handle, "fred") ;
8386 if (symbol == NULL) {
8387 /* try putting a leading underscore */
8388 symbol = dlsym(handle, "_fred") ;
8389 if (symbol == NULL) {
8402 : Call the object file tmp-dyna.o in case dlext=o.
8403 if $cc $ccflags $cccdlflags -c dyna.c > /dev/null 2>&1 &&
8404 mv dyna${_o} tmp-dyna${_o} > /dev/null 2>&1 &&
8405 $ld $lddlflags -o dyna.$dlext tmp-dyna${_o} > /dev/null 2>&1 &&
8406 $cc $ccflags -o fred $ldflags $cccdlflags $ccdlflags fred.c $libs > /dev/null 2>&1; then
8409 1) echo "Test program failed using dlopen." >&4
8410 echo "Perhaps you should not use dynamic loading." >&4;;
8411 2) echo "Test program failed using dlsym." >&4
8412 echo "Perhaps you should not use dynamic loading." >&4;;
8413 3) echo "dlsym needs a leading underscore" >&4
8415 4) echo "dlsym doesn't need a leading underscore." >&4;;
8418 echo "I can't compile and run the test program." >&4
8419 echo "I'm guessing that dlsym doesn't need a leading underscore." >&4
8424 $rm -f fred fred.? dyna.$dlext dyna.? tmp-dyna.?
8429 hasproto='varname=$1; func=$2; shift; shift;
8430 while $test $# -ge 2; do
8432 $define) echo "#include <$2>";;
8436 $cppstdin $cppflags $cppminus < try.c > tryout.c 2>/dev/null;
8437 if $contains "$func.*(" tryout.c >/dev/null 2>&1; then
8438 echo "$func() prototype found.";
8441 echo "$func() prototype NOT found.";
8446 $rm -f try.c tryout.c'
8448 : see if prototype for drand48 is available
8450 set d_drand48proto drand48 $i_stdlib stdlib.h $i_unistd unistd.h
8453 : see if dup2 exists
8457 : see if eaccess exists
8458 set eaccess d_eaccess
8461 : see if endgrent exists
8462 set endgrent d_endgrent
8465 : see if endhostent exists
8466 set endhostent d_endhent
8469 : see if endnetent exists
8470 set endnetent d_endnent
8473 : see if endprotoent exists
8474 set endprotoent d_endpent
8477 : see if endpwent exists
8478 set endpwent d_endpwent
8481 : see if endservent exists
8482 set endservent d_endsent
8485 : see if endspent exists
8486 set endspent d_endspent
8489 : Locate the flags for 'open()'
8491 $cat >open3.c <<'EOCP'
8492 #include <sys/types.h>
8497 #include <sys/file.h>
8508 : check sys/file.h first to get FREAD on Sun
8509 if $test `./findhdr sys/file.h` && \
8510 set open3 -DI_SYS_FILE && eval $compile; then
8512 echo "<sys/file.h> defines the O_* constants..." >&4
8514 echo "and you have the 3 argument form of open()." >&4
8517 echo "but not the 3 argument form of open(). Oh, well." >&4
8520 elif $test `./findhdr fcntl.h` && \
8521 set open3 -DI_FCNTL && eval $compile; then
8523 echo "<fcntl.h> defines the O_* constants..." >&4
8525 echo "and you have the 3 argument form of open()." >&4
8528 echo "but not the 3 argument form of open(). Oh, well." >&4
8533 echo "I can't find the O_* constant definitions! You got problems." >&4
8539 : see which of string.h or strings.h is needed
8541 strings=`./findhdr string.h`
8542 if $test "$strings" && $test -r "$strings"; then
8543 echo "Using <string.h> instead of <strings.h>." >&4
8547 strings=`./findhdr strings.h`
8548 if $test "$strings" && $test -r "$strings"; then
8549 echo "Using <strings.h> instead of <string.h>." >&4
8551 echo "No string header found -- You'll surely have problems." >&4
8557 "$undef") strings=`./findhdr strings.h`;;
8558 *) strings=`./findhdr string.h`;;
8561 : check for non-blocking I/O stuff
8562 case "$h_sysfile" in
8563 true) echo "#include <sys/file.h>" > head.c;;
8566 true) echo "#include <fcntl.h>" > head.c;;
8567 *) echo "#include <sys/fcntl.h>" > head.c;;
8572 echo "Figuring out the flag used by open() for non-blocking I/O..." >&4
8573 case "$o_nonblock" in
8576 $cat >>try.c <<'EOCP'
8580 printf("O_NONBLOCK\n");
8584 printf("O_NDELAY\n");
8588 printf("FNDELAY\n");
8595 if eval $compile_ok; then
8597 case "$o_nonblock" in
8598 '') echo "I can't figure it out, assuming O_NONBLOCK will do.";;
8599 *) echo "Seems like we can use $o_nonblock.";;
8602 echo "(I can't compile the test program; pray O_NONBLOCK is right!)"
8605 *) echo "Using $hint value $o_nonblock.";;
8607 $rm -f try try.* .out core
8610 echo "Let's see what value errno gets from read() on a $o_nonblock file..." >&4
8616 #include <sys/types.h>
8619 #define MY_O_NONBLOCK $o_nonblock
8620 #ifndef errno /* XXX need better Configure test */
8631 #include <strings.h>
8633 $signal_t blech(x) int x; { exit(3); }
8635 $cat >> try.c <<'EOCP'
8643 pipe(pd); /* Down: child -> parent */
8644 pipe(pu); /* Up: parent -> child */
8647 close(pd[1]); /* Parent reads from pd[0] */
8648 close(pu[0]); /* Parent writes (blocking) to pu[1] */
8649 if (-1 == fcntl(pd[0], F_SETFL, MY_O_NONBLOCK))
8651 signal(SIGALRM, blech);
8653 if ((ret = read(pd[0], buf, 1)) > 0) /* Nothing to read! */
8655 sprintf(string, "%d\n", ret);
8656 write(2, string, strlen(string));
8659 if (errno == EAGAIN) {
8665 if (errno == EWOULDBLOCK)
8666 printf("EWOULDBLOCK\n");
8669 write(pu[1], buf, 1); /* Unblocks child, tell it to close our pipe */
8670 sleep(2); /* Give it time to close our pipe */
8672 ret = read(pd[0], buf, 1); /* Should read EOF */
8674 sprintf(string, "%d\n", ret);
8675 write(3, string, strlen(string));
8679 close(pd[0]); /* We write to pd[1] */
8680 close(pu[1]); /* We read from pu[0] */
8681 read(pu[0], buf, 1); /* Wait for parent to signal us we may continue */
8682 close(pd[1]); /* Pipe pd is now fully closed! */
8683 exit(0); /* Bye bye, thank you for playing! */
8687 if eval $compile_ok; then
8688 echo "$startsh" >mtry
8689 echo "./try >try.out 2>try.ret 3>try.err || exit 4" >>mtry
8691 ./mtry >/dev/null 2>&1
8693 0) eagain=`$cat try.out`;;
8694 1) echo "Could not perform non-blocking setting!";;
8695 2) echo "I did a successful read() for something that was not there!";;
8696 3) echo "Hmm... non-blocking I/O does not seem to be working!";;
8697 *) echo "Something terribly wrong happened during testing.";;
8699 rd_nodata=`$cat try.ret`
8700 echo "A read() system call with no data present returns $rd_nodata."
8701 case "$rd_nodata" in
8704 echo "(That's peculiar, fixing that to be -1.)"
8710 echo "Forcing errno EAGAIN on read() with no data available."
8714 echo "Your read() sets errno to $eagain when no data is available."
8717 status=`$cat try.err`
8719 0) echo "And it correctly returns 0 to signal EOF.";;
8720 -1) echo "But it also returns -1 to signal EOF, so be careful!";;
8721 *) echo "However, your read() returns '$status' on EOF??";;
8724 if test "$status" = "$rd_nodata"; then
8725 echo "WARNING: you can't distinguish between EOF and no data!"
8729 echo "I can't compile the test program--assuming errno EAGAIN will do."
8736 echo "Using $hint value $eagain."
8737 echo "Your read() returns $rd_nodata when no data is present."
8738 case "$d_eofnblk" in
8739 "$define") echo "And you can see EOF because read() returns 0.";;
8740 "$undef") echo "But you can't see EOF status from read() returned value.";;
8742 echo "(Assuming you can't see EOF status from read anyway.)"
8748 $rm -f try try.* .out core head.c mtry
8750 : see if fchmod exists
8754 : see if fchown exists
8758 : see if this is an fcntl system
8762 hasfield='varname=$1; struct=$2; field=$3; shift; shift; shift;
8763 while $test $# -ge 2; do
8765 $define) echo "#include <$2>";;
8769 echo "int main () { struct $struct foo; char* bar; bar = (char*)foo.$field; }" >> try.c;
8771 if eval $compile; then
8782 : see whether socket exists
8784 $echo $n "Hmm... $c" >&4
8785 if set socket val -f d_socket; eval $csym; $val; then
8786 echo "Looks like you have Berkeley networking support." >&4
8788 if set setsockopt val -f; eval $csym; $val; then
8791 echo "...but it uses the old BSD 4.1c interface, rather than 4.2." >&4
8795 if $contains socklib libc.list >/dev/null 2>&1; then
8796 echo "Looks like you have Berkeley networking support." >&4
8798 : we will have to assume that it supports the 4.2 BSD interface
8801 echo "You don't have Berkeley networking in libc$_a..." >&4
8802 if test "X$d_socket" = "X$define"; then
8803 echo "...but you seem to believe that you have sockets." >&4
8805 for net in net socket
8807 if test -f /usr/lib/lib$net$_a; then
8808 ( ($nm $nm_opt /usr/lib/lib$net$_a | eval $nm_extract) || \
8809 $ar t /usr/lib/lib$net$_a) 2>/dev/null >> libc.list
8810 if $contains socket libc.list >/dev/null 2>&1; then
8815 echo "...but the Wollongong group seems to have hacked it in." >&4
8816 sockethdr="-I/usr/netinclude"
8819 echo "Found Berkeley sockets interface in lib$net." >& 4
8820 if $contains setsockopt libc.list >/dev/null 2>&1; then
8823 echo "...using the old BSD 4.1c interface, rather than 4.2." >&4
8830 if test "X$d_socket" != "X$define"; then
8831 echo "or anywhere else I see." >&4
8839 : see if socketpair exists
8840 set socketpair d_sockpair
8845 echo "Checking the availability of certain socket constants..." >& 4
8846 for ENUM in MSG_CTRUNC MSG_DONTROUTE MSG_OOB MSG_PEEK MSG_PROXY SCM_RIGHTS; do
8847 enum=`$echo $ENUM|./tr '[A-Z]' '[a-z]'`
8849 #include <sys/types.h>
8850 #include <sys/socket.h>
8856 set try; if eval $compile; then
8859 set d_${enum}; eval $setvar
8863 : see if sys/select.h has to be included
8864 set sys/select.h i_sysselct
8867 : see if we should include time.h, sys/time.h, or both
8869 if test "X$timeincl" = X; then
8870 echo "Testing to see if we should include <time.h>, <sys/time.h> or both." >&4
8871 $echo $n "I'm now running the test program...$c"
8872 $cat >try.c <<'EOCP'
8873 #include <sys/types.h>
8878 #ifdef SYSTIMEKERNEL
8881 #include <sys/time.h>
8884 #include <sys/select.h>
8893 struct timezone tzp;
8895 if (foo.tm_sec == foo.tm_sec)
8898 if (bar.tv_sec == bar.tv_sec)
8905 for s_timezone in '-DS_TIMEZONE' ''; do
8907 for s_timeval in '-DS_TIMEVAL' ''; do
8908 for i_systimek in '' '-DSYSTIMEKERNEL'; do
8909 for i_time in '' '-DI_TIME'; do
8910 for i_systime in '-DI_SYSTIME' ''; do
8913 set try $i_time $i_systime $i_systimek $sysselect $s_timeval $s_timezone
8914 if eval $compile; then
8915 set X $i_time $i_systime $i_systimek $sysselect $s_timeval
8919 $echo $n "Succeeded with $flags$c"
8931 *SYSTIMEKERNEL*) i_systimek="$define"
8932 timeincl=`./findhdr sys/time.h`
8933 echo "We'll include <sys/time.h> with KERNEL defined." >&4;;
8934 *) i_systimek="$undef";;
8937 *I_TIME*) i_time="$define"
8938 timeincl=`./findhdr time.h`" $timeincl"
8939 echo "We'll include <time.h>." >&4;;
8940 *) i_time="$undef";;
8943 *I_SYSTIME*) i_systime="$define"
8944 timeincl=`./findhdr sys/time.h`" $timeincl"
8945 echo "We'll include <sys/time.h>." >&4;;
8946 *) i_systime="$undef";;
8951 : check for fd_set items
8954 Checking to see how well your C compiler handles fd_set and friends ...
8956 $cat >fd_set.c <<EOCP
8957 #$i_systime I_SYS_TIME
8958 #$i_sysselct I_SYS_SELECT
8959 #$d_socket HAS_SOCKET
8960 #include <sys/types.h>
8962 #include <sys/socket.h> /* Might include <sys/bsdtypes.h> */
8965 #include <sys/time.h>
8968 #include <sys/select.h>
8977 #if defined(FD_SET) && defined(FD_CLR) && defined(FD_ISSET) && defined(FD_ZERO)
8984 set fd_set -DTRYBITS
8985 if eval $compile; then
8986 d_fds_bits="$define"
8988 echo "Well, your system knows about the normal fd_set typedef..." >&4
8990 echo "and you have the normal fd_set macros (just as I'd expect)." >&4
8991 d_fd_macros="$define"
8994 but not the normal fd_set macros! Gaaack! I'll have to cover for you.
8996 d_fd_macros="$undef"
9000 Hmm, your compiler has some difficulty with fd_set. Checking further...
9003 if eval $compile; then
9006 echo "Well, your system has some sort of fd_set available..." >&4
9008 echo "and you have the normal fd_set macros." >&4
9009 d_fd_macros="$define"
9012 but not the normal fd_set macros! Gross! More work for me...
9014 d_fd_macros="$undef"
9017 echo "Well, you got zip. That's OK, I can roll my own fd_set stuff." >&4
9020 d_fd_macros="$undef"
9025 : see if fgetpos exists
9026 set fgetpos d_fgetpos
9029 : see if flock exists
9033 : see if fork exists
9037 : see if pathconf exists
9038 set pathconf d_pathconf
9041 : see if fpathconf exists
9042 set fpathconf d_fpathconf
9046 : check for fpos64_t
9048 echo "Checking to see if you have fpos64_t..." >&4
9051 int main() { fpos64_t x = 7; }
9054 if eval $compile; then
9056 echo "You have fpos64_t."
9059 echo "You do not have fpos64_t."
9061 8) echo "(Your fpos_t is 64 bits, so you could use that.)" ;;
9068 : see if frexpl exists
9072 hasstruct='varname=$1; struct=$2; shift; shift;
9073 while $test $# -ge 2; do
9075 $define) echo "#include <$2>";;
9079 echo "int main () { struct $struct foo; }" >> try.c;
9081 if eval $compile; then
9090 : see if this is a sys/param system
9091 set sys/param.h i_sysparam
9094 : see if this is a sys/mount.h system
9095 set sys/mount.h i_sysmount
9098 : see if sys/types.h has to be included
9099 set sys/types.h i_systypes
9104 echo "Checking to see if your system supports struct fs_data..." >&4
9105 set d_fs_data_s fs_data $i_systypes sys/types.h $i_sysparam sys/param.h $i_sysmount sys/mount.h
9107 case "$d_fs_data_s" in
9108 "$define") echo "Yes, it does." ;;
9109 *) echo "No, it doesn't." ;;
9112 : see if fseeko exists
9116 8) echo "(Your long is 64 bits, so you could use fseek.)" ;;
9119 : see if fsetpos exists
9120 set fsetpos d_fsetpos
9124 : see if fstatfs exists
9125 set fstatfs d_fstatfs
9129 : see if statvfs exists
9130 set statvfs d_statvfs
9133 : see if fstatvfs exists
9134 set fstatvfs d_fstatvfs
9138 : see if ftello exists
9142 8) echo "(Your long is 64 bits, so you could use ftell.)" ;;
9145 : see if getcwd exists
9150 : see if getfsstat exists
9151 set getfsstat d_getfsstat
9154 : see if getgrent exists
9155 set getgrent d_getgrent
9158 : see if gethostbyaddr exists
9159 set gethostbyaddr d_gethbyaddr
9162 : see if gethostbyname exists
9163 set gethostbyname d_gethbyname
9166 : see if gethostent exists
9167 set gethostent d_gethent
9170 : see how we will look up host name
9173 if set gethostname val -f d_gethname; eval $csym; $val; then
9174 echo 'gethostname() found.' >&4
9175 d_gethname="$define"
9178 if set uname val -f d_uname; eval $csym; $val; then
9181 uname() was found, but you're running xenix, and older versions of xenix
9182 have a broken uname(). If you don't really know whether your xenix is old
9183 enough to have a broken system call, use the default answer.
9190 rp='Is your uname() broken?'
9193 n*) d_uname="$define"; call=uname;;
9196 echo 'uname() found.' >&4
9203 case "$d_gethname" in
9204 '') d_gethname="$undef";;
9207 '') d_uname="$undef";;
9209 case "$d_uname$d_gethname" in
9214 Every now and then someone has a $call() that lies about the hostname
9215 but can't be fixed for political or economic reasons. If you wish, I can
9216 pretend $call() isn't there and maybe compute hostname at run-time
9217 thanks to the '$phostname' command.
9220 rp="Shall I ignore $call() from now on?"
9223 y*) d_uname="$undef" d_gethname="$undef"; $echo $n "Okay...$c";;
9226 case "$phostname" in
9228 *) case "$aphostname" in
9234 file=`./loc $file $file $pth`
9235 aphostname=`echo $file $*`
9240 case "$d_uname$d_gethname" in
9243 case "$phostname" in
9245 echo "There will be no way for $package to get your hostname." >&4;;
9247 echo "I'll use 'popen("'"'$aphostname'", "r")'"' to get your hostname." >&4
9251 case "$d_phostname" in
9252 '') d_phostname="$undef";;
9255 : see if this is a netdb.h system
9259 : see if prototypes for various gethostxxx netdb.h functions are available
9261 set d_gethostprotos gethostent $i_netdb netdb.h
9264 : see if getlogin exists
9265 set getlogin d_getlogin
9268 : see if getmnt exists
9272 : see if getmntent exists
9273 set getmntent d_getmntent
9276 : see if getnetbyaddr exists
9277 set getnetbyaddr d_getnbyaddr
9280 : see if getnetbyname exists
9281 set getnetbyname d_getnbyname
9284 : see if getnetent exists
9285 set getnetent d_getnent
9288 : see if prototypes for various getnetxxx netdb.h functions are available
9290 set d_getnetprotos getnetent $i_netdb netdb.h
9294 : see if getprotobyname exists
9295 set getprotobyname d_getpbyname
9298 : see if getprotobynumber exists
9299 set getprotobynumber d_getpbynumber
9302 : see if getprotoent exists
9303 set getprotoent d_getpent
9306 : see if getpgid exists
9307 set getpgid d_getpgid
9310 : see if getpgrp2 exists
9311 set getpgrp2 d_getpgrp2
9314 : see if getppid exists
9315 set getppid d_getppid
9318 : see if getpriority exists
9319 set getpriority d_getprior
9322 : see if prototypes for various getprotoxxx netdb.h functions are available
9324 set d_getprotoprotos getprotoent $i_netdb netdb.h
9327 : see if getpwent exists
9328 set getpwent d_getpwent
9332 : see if getservbyname exists
9333 set getservbyname d_getsbyname
9336 : see if getservbyport exists
9337 set getservbyport d_getsbyport
9340 : see if getservent exists
9341 set getservent d_getsent
9344 : see if prototypes for various getservxxx netdb.h functions are available
9346 set d_getservprotos getservent $i_netdb netdb.h
9349 : see if getspent exists
9350 set getspent d_getspent
9353 : see if getspnam exists
9354 set getspnam d_getspnam
9357 : see if gettimeofday or ftime exists
9358 set gettimeofday d_gettimeod
9360 case "$d_gettimeod" in
9366 val="$undef"; set d_ftime; eval $setvar
9369 case "$d_gettimeod$d_ftime" in
9372 echo 'No ftime() nor gettimeofday() -- timing may be less accurate.' >&4
9376 : see if this is an grp system
9382 xxx=`./findhdr grp.h`
9383 $cppstdin $cppflags $cppminus < $xxx >$$.h
9385 if $contains 'gr_passwd' $$.h >/dev/null 2>&1; then
9397 set d_grpasswd; eval $setvar
9401 : see if hasmntopt exists
9402 set hasmntopt d_hasmntopt
9405 : see if this is a netinet/in.h or sys/in.h system
9406 set netinet/in.h i_niin sys/in.h i_sysin
9409 : see if arpa/inet.h has to be included
9410 set arpa/inet.h i_arpainet
9413 : see if htonl --and friends-- exists
9418 : Maybe they are macros.
9423 #include <sys/types.h>
9424 #$i_niin I_NETINET_IN
9426 #$i_arpainet I_ARPA_INET
9428 #include <netinet/in.h>
9434 #include <arpa/inet.h>
9437 printf("Defined as a macro.");
9440 $cppstdin $cppflags $cppminus < htonl.c >htonl.E 2>/dev/null
9441 if $contains 'Defined as a macro' htonl.E >/dev/null 2>&1; then
9443 echo "But it seems to be defined as a macro." >&4
9451 : see if iconv exists
9457 if set index val -f; eval $csym; $val; then
9458 if set strchr val -f d_strchr; eval $csym; $val; then
9459 if $contains strchr "$strings" >/dev/null 2>&1 ; then
9462 echo "strchr() found." >&4
9466 echo "index() found." >&4
9471 echo "index() found." >&4
9474 if set strchr val -f d_strchr; eval $csym; $val; then
9477 echo "strchr() found." >&4
9479 echo "No index() or strchr() found!" >&4
9484 set d_strchr; eval $setvar
9486 set d_index; eval $setvar
9488 : check whether inet_aton exists
9489 set inet_aton d_inetaton
9492 : see if inttypes.h is available
9493 : we want a real compile instead of Inhdr because some systems
9494 : have an inttypes.h which includes non-existent headers
9497 #include <inttypes.h>
9499 static int32_t foo32 = 0x12345678;
9503 if eval $compile; then
9504 echo "<inttypes.h> found." >&4
9507 echo "<inttypes.h> NOT found." >&4
9516 echo "Checking to see if you have int64_t..." >&4
9518 #include <sys/types.h>
9519 #$i_inttypes I_INTTYPES
9521 #include <inttypes.h>
9523 int main() { int64_t x = 7; }
9526 if eval $compile; then
9528 echo "You have int64_t."
9531 echo "You do not have int64_t."
9539 $cat >isascii.c <<'EOCP'
9551 if eval $compile; then
9552 echo "isascii() found." >&4
9555 echo "isascii() NOT found." >&4
9562 : see if isnan exists
9566 : see if isnanl exists
9570 : see if killpg exists
9574 : see if lchown exists
9576 $cat > try.c <<'EOCP'
9577 /* System header to define __stub macros and hopefully few prototypes,
9578 which can conflict with char lchown(); below. */
9580 /* Override any gcc2 internal prototype to avoid an error. */
9581 /* We use char because int might match the return type of a gcc2
9582 builtin and then its argument prototype would still apply. */
9585 /* The GNU C library defines this for functions which it implements
9586 to always fail with ENOSYS. Some functions are actually named
9587 something starting with __ and the normal name is an alias. */
9588 #if defined (__stub_lchown) || defined (__stub___lchown)
9596 if eval $compile; then
9597 $echo "lchown() found." >&4
9600 $echo "lchown() NOT found." >&4
9606 : See if number of significant digits in a double precision number is known
9608 $cat >ldbl_dig.c <<EOM
9618 printf("Contains LDBL_DIG");
9621 $cppstdin $cppflags $cppminus < ldbl_dig.c >ldbl_dig.E 2>/dev/null
9622 if $contains 'LDBL_DIG' ldbl_dig.E >/dev/null 2>&1; then
9623 echo "LDBL_DIG found." >&4
9626 echo "LDBL_DIG NOT found." >&4
9633 : see if link exists
9637 : see if localeconv exists
9638 set localeconv d_locconv
9641 : see if lockf exists
9645 : check for long long
9647 echo "Checking to see if you have long long..." >&4
9648 echo 'int main() { long long x = 7; return 0; }' > try.c
9650 if eval $compile; then
9652 echo "You have have long long."
9655 echo "You do not have long long."
9661 : check for length of long long
9662 case "${d_longlong}${longlongsize}" in
9665 echo "Checking to see how big your long longs are..." >&4
9666 $cat >try.c <<'EOCP'
9670 printf("%d\n", (int)sizeof(long long));
9675 if eval $compile_ok; then
9676 longlongsize=`./try$exe_ext`
9677 echo "Your long longs are $longlongsize bytes long."
9681 echo "(I can't seem to compile the test program. Guessing...)"
9682 rp="What is the size of a long long (in bytes)?"
9686 if $test "X$longsize" = "X$longlongsize"; then
9687 echo "(That isn't any different from an ordinary long.)"
9693 : see if prototype for lseek is available
9695 set d_lseekproto lseek $i_systypes sys/types.h $i_unistd unistd.h
9698 : see if lstat exists
9702 : see if madvise exists
9703 set madvise d_madvise
9706 : see if mblen exists
9710 : see if mbstowcs exists
9711 set mbstowcs d_mbstowcs
9714 : see if mbtowc exists
9718 : see if memchr exists
9722 : see if memcmp exists
9726 : see if memcpy exists
9730 : see if memmove exists
9731 set memmove d_memmove
9734 : see if memset exists
9738 : see if mkdir exists
9742 : see if mkdtemp exists
9743 set mkdtemp d_mkdtemp
9746 : see if mkfifo exists
9750 : see if mkstemp exists
9751 set mkstemp d_mkstemp
9754 : see if mkstemps exists
9755 set mkstemps d_mkstemps
9758 : see if mktime exists
9762 : see if this is a sys/mman.h system
9763 set sys/mman.h i_sysmman
9766 : see if mmap exists
9769 : see what shmat returns
9770 : default to something harmless
9772 case "$i_sysmman$d_mmap" in
9774 $cat >mmap.c <<'END'
9775 #include <sys/mman.h>
9778 if $cc $ccflags -c mmap.c >/dev/null 2>&1; then
9783 echo "and it returns ($mmaptype)." >&4
9789 : see if modfl exists
9793 : see if mprotect exists
9794 set mprotect d_mprotect
9797 : see if msgctl exists
9801 : see if msgget exists
9805 : see if msgsnd exists
9809 : see if msgrcv exists
9813 : see how much of the 'msg*(2)' library is present.
9816 case "$d_msgctl$d_msgget$d_msgsnd$d_msgrcv" in
9817 *"$undef"*) h_msg=false;;
9821 case "`ipcs 2>&1`" in
9822 "SVID messages"*"not configured"*)
9823 echo "Your $osname does not have the msg*(2) configured." >&4
9838 : we could also check for sys/ipc.h ...
9839 if $h_msg && $test `./findhdr sys/msg.h`; then
9840 echo "You have the full msg*(2) library." >&4
9843 echo "You don't have the full msg*(2) library." >&4
9849 : see if msync exists
9853 : see if munmap exists
9857 : see if nice exists
9863 echo "Checking which 64-bit integer type we could use..." >&4
9869 val='"unsigned int"'
9874 *) case "$longsize" in
9878 val='"unsigned long"'
9883 *) case "$d_longlong:$longlongsize" in
9888 val='"unsigned long long"'
9893 *) case "$d_int64_t" in
9912 '') echo "Alas, no 64-bit integer types in sight." >&4
9915 *) if test X"$use64bitint" = Xdefine -o X"$longsize" = X8; then
9920 echo "We $verb use '$quadtype' for 64-bit integers." >&4
9925 : check for length of character
9929 echo "Checking to see how big your characters are (hey, you never know)..." >&4
9930 $cat >try.c <<'EOCP'
9934 printf("%d\n", (int)sizeof(char));
9939 if eval $compile_ok; then
9943 echo "(I can't seem to compile the test program. Guessing...)"
9950 rp="What is the size of a character (in bytes)?"
9957 $echo "Choosing the C types to be used for Perl's internal types..." >&4
9959 case "$use64bitint:$d_quad:$quadtype" in
9967 uvtype="unsigned long"
9973 case "$uselongdouble:$d_longdbl" in
9975 nvtype="long double"
9983 $echo "(IV will be "$ivtype", $ivsize bytes)"
9984 $echo "(UV will be "$uvtype", $uvsize bytes)"
9985 $echo "(NV will be "$nvtype", $nvsize bytes)"
9988 #$i_inttypes I_INTTYPES
9990 #include <inttypes.h>
9995 int8_t i = INT8_MAX;
9996 uint8_t u = UINT8_MAX;
10000 int16_t i = INT16_MAX;
10001 uint16_t i = UINT16_MAX;
10002 printf("int16_t\n");
10005 int32_t i = INT32_MAX;
10006 uint32_t u = UINT32_MAX;
10007 printf("int32_t\n");
10013 '') case "$charsize" in
10015 u8type="unsigned char"
10024 if eval $compile; then
10025 case "`./try$exe_ext`" in
10026 int8_t) i8type=int8_t
10036 '') if $test $charsize -ge 1; then
10038 u8type="unsigned char"
10046 '') case "$shortsize" in
10048 u16type="unsigned short"
10056 '') set try -DINT16
10057 if eval $compile; then
10058 case "`./try$exe_ext`" in
10070 '') if $test $shortsize -ge 2; then
10072 u16type="unsigned short"
10080 '') case "$longsize" in
10082 u32type="unsigned long"
10086 *) case "$intsize" in
10088 u32type="unsigned int"
10098 '') set try -DINT32
10099 if eval $compile; then
10100 case "`./try$exe_ext`" in
10112 '') if $test $intsize -ge 4; then
10114 u32type="unsigned int"
10122 '') case "$d_quad:$quadtype" in
10124 i64type="$quadtype"
10125 u64type="$uquadtype"
10133 $echo "Checking whether your NVs can preserve your UVs..." >&4
10137 $uvtype k = ($uvtype)~0, l;
10143 printf("preserve\n");
10148 if eval $compile; then
10149 case "`./try$exe_ext`" in
10150 preserve) d_nv_preserves_uv="$define" ;;
10153 case "$d_nv_preserves_uv" in
10154 $define) $echo "Yes, they can." 2>&1 ;;
10155 *) $echo "No, they can't." 2>&1
10156 d_nv_preserves_uv="$undef"
10163 : check for off64_t
10165 echo "Checking to see if you have off64_t..." >&4
10167 #include <sys/types.h>
10168 #include <unistd.h>
10169 int main() { off64_t x = 7; }
10172 if eval $compile; then
10174 echo "You have off64_t."
10177 echo "You do not have off64_t."
10178 case "$lseeksize" in
10179 8) echo "(Your off_t is 64 bits, so you could use that.)" ;;
10186 : see if POSIX threads are available
10187 set pthread.h i_pthread
10193 : how to create joinable pthreads
10194 if test "X$usethreads" = "X$define" -a "X$i_pthread" = "X$define"; then
10196 echo "Checking what constant to use for creating joinable pthreads..." >&4
10197 $cat >try.c <<'EOCP'
10198 #include <pthread.h>
10200 int detachstate = JOINABLE;
10203 set try -DJOINABLE=PTHREAD_CREATE_JOINABLE
10204 if eval $compile; then
10205 echo "You seem to use PTHREAD_CREATE_JOINABLE." >&4
10206 val="$undef" # Yes, undef.
10207 set d_old_pthread_create_joinable
10210 set old_pthread_create_joinable
10213 set try -DJOINABLE=PTHREAD_CREATE_UNDETACHED
10214 if eval $compile; then
10215 echo "You seem to use PTHREAD_CREATE_UNDETACHED." >&4
10217 set d_old_pthread_create_joinable
10219 val=PTHREAD_CREATE_UNDETACHED
10220 set old_pthread_create_joinable
10223 set try -DJOINABLE=__UNDETACHED
10224 if eval $compile; then
10225 echo "You seem to use __UNDETACHED." >&4
10227 set d_old_pthread_create_joinable
10230 set old_pthread_create_joinable
10233 echo "Egads, nothing obvious found. Guessing that you use 0." >&4
10235 set d_old_pthread_create_joinable
10238 set old_pthread_create_joinable
10245 d_old_pthread_create_joinable="$undef"
10246 old_pthread_create_joinable=""
10249 : see if pause exists
10253 : see if pipe exists
10257 : see if poll exists
10262 : see whether the various POSIXish _yields exist
10264 #include <pthread.h>
10270 #ifdef PTHREAD_YIELD
10273 #ifdef PTHREAD_YIELD_NULL
10274 pthread_yield(NULL);
10280 : see if sched_yield exists
10281 set try -DSCHED_YIELD
10282 if eval $compile; then
10284 sched_yield='sched_yield()'
10288 case "$usethreads" in
10291 $define) echo 'sched_yield() found.' >&4 ;;
10292 *) echo 'sched_yield() NOT found.' >&4 ;;
10298 : see if pthread_yield exists
10299 set try -DPTHREAD_YIELD
10300 if eval $compile; then
10302 case "$sched_yield" in
10303 '') sched_yield='pthread_yield()' ;;
10306 set try -DPTHREAD_YIELD_NULL
10307 if eval $compile; then
10309 case "$sched_yield" in
10310 '') sched_yield='pthread_yield(NULL)' ;;
10316 case "$usethreads" in
10319 $define) echo 'pthread_yield() found.' >&4 ;;
10320 *) echo 'pthread_yield() NOT found.' >&4 ;;
10324 set d_pthread_yield
10327 case "$sched_yield" in
10328 '') sched_yield=undef ;;
10333 : see if this is a pwd.h system
10339 xxx=`./findhdr pwd.h`
10340 $cppstdin $cppflags $cppminus < $xxx >$$.h
10342 if $contains 'pw_quota' $$.h >/dev/null 2>&1; then
10350 if $contains 'pw_age' $$.h >/dev/null 2>&1; then
10358 if $contains 'pw_change' $$.h >/dev/null 2>&1; then
10366 if $contains 'pw_class' $$.h >/dev/null 2>&1; then
10374 if $contains 'pw_expire' $$.h >/dev/null 2>&1; then
10382 if $contains 'pw_comment' $$.h >/dev/null 2>&1; then
10390 if $contains 'pw_gecos' $$.h >/dev/null 2>&1; then
10398 if $contains 'pw_passwd' $$.h >/dev/null 2>&1; then
10410 set d_pwquota; eval $setvar
10411 set d_pwage; eval $setvar
10412 set d_pwchange; eval $setvar
10413 set d_pwclass; eval $setvar
10414 set d_pwexpire; eval $setvar
10415 set d_pwcomment; eval $setvar
10416 set d_pwgecos; eval $setvar
10417 set d_pwpasswd; eval $setvar
10421 : see if readdir and friends exist
10422 set readdir d_readdir
10424 set seekdir d_seekdir
10426 set telldir d_telldir
10428 set rewinddir d_rewinddir
10431 : see if readlink exists
10432 set readlink d_readlink
10435 : see if rename exists
10436 set rename d_rename
10439 : see if rmdir exists
10443 : see if memory.h is available.
10448 : See if it conflicts with string.h
10454 $cppstdin $cppflags $cppminus < $strings > mem.h
10455 if $contains 'memcpy' mem.h >/dev/null 2>&1; then
10457 echo "We won't be including <memory.h>."
10467 : can bcopy handle overlapping blocks?
10472 echo "Checking to see if your bcopy() can do overlapping copies..." >&4
10474 #$i_memory I_MEMORY
10475 #$i_stdlib I_STDLIB
10476 #$i_string I_STRING
10477 #$i_unistd I_UNISTD
10479 $cat >>try.c <<'EOCP'
10482 # include <memory.h>
10485 # include <stdlib.h>
10488 # include <string.h>
10490 # include <strings.h>
10493 # include <unistd.h> /* Needed for NetBSD */
10497 char buf[128], abc[128];
10503 bcopy("abcdefghijklmnopqrstuvwxyz0123456789", abc, 36);
10505 for (align = 7; align >= 0; align--) {
10506 for (len = 36; len; len--) {
10508 bcopy(abc, b, len);
10509 for (off = 1; off <= len; off++) {
10510 bcopy(b, b+off, len);
10511 bcopy(b+off, b, len);
10512 if (bcmp(b, abc, len))
10521 if eval $compile_ok; then
10522 if ./try 2>/dev/null; then
10523 echo "Yes, it can."
10526 echo "It can't, sorry."
10527 case "$d_memmove" in
10528 "$define") echo "But that's Ok since you have memmove()." ;;
10532 echo "(I can't compile the test program, so we'll assume not...)"
10533 case "$d_memmove" in
10534 "$define") echo "But that's Ok since you have memmove()." ;;
10539 $rm -f try.* try core
10543 : can memcpy handle overlapping blocks?
10545 case "$d_memcpy" in
10548 echo "Checking to see if your memcpy() can do overlapping copies..." >&4
10550 #$i_memory I_MEMORY
10551 #$i_stdlib I_STDLIB
10552 #$i_string I_STRING
10553 #$i_unistd I_UNISTD
10555 $cat >>try.c <<'EOCP'
10558 # include <memory.h>
10561 # include <stdlib.h>
10564 # include <string.h>
10566 # include <strings.h>
10569 # include <unistd.h> /* Needed for NetBSD */
10573 char buf[128], abc[128];
10579 /* Copy "abcde..." string to char abc[] so that gcc doesn't
10580 try to store the string in read-only memory. */
10581 memcpy(abc, "abcdefghijklmnopqrstuvwxyz0123456789", 36);
10583 for (align = 7; align >= 0; align--) {
10584 for (len = 36; len; len--) {
10586 memcpy(b, abc, len);
10587 for (off = 1; off <= len; off++) {
10588 memcpy(b+off, b, len);
10589 memcpy(b, b+off, len);
10590 if (memcmp(b, abc, len))
10599 if eval $compile_ok; then
10600 if ./try 2>/dev/null; then
10601 echo "Yes, it can."
10604 echo "It can't, sorry."
10605 case "$d_memmove" in
10606 "$define") echo "But that's Ok since you have memmove()." ;;
10610 echo "(I can't compile the test program, so we'll assume not...)"
10611 case "$d_memmove" in
10612 "$define") echo "But that's Ok since you have memmove()." ;;
10617 $rm -f try.* try core
10621 : can memcmp be trusted to compare relative magnitude?
10623 case "$d_memcmp" in
10626 echo "Checking if your memcmp() can compare relative magnitude..." >&4
10628 #$i_memory I_MEMORY
10629 #$i_stdlib I_STDLIB
10630 #$i_string I_STRING
10631 #$i_unistd I_UNISTD
10633 $cat >>try.c <<'EOCP'
10636 # include <memory.h>
10639 # include <stdlib.h>
10642 # include <string.h>
10644 # include <strings.h>
10647 # include <unistd.h> /* Needed for NetBSD */
10653 if ((a < b) && memcmp(&a, &b, 1) < 0)
10659 if eval $compile_ok; then
10660 if ./try 2>/dev/null; then
10661 echo "Yes, it can."
10664 echo "No, it can't (it uses signed chars)."
10667 echo "(I can't compile the test program, so we'll assume not...)"
10671 $rm -f try.* try core
10675 : see if select exists
10676 set select d_select
10679 : see if semctl exists
10680 set semctl d_semctl
10683 : see if semget exists
10684 set semget d_semget
10687 : see if semop exists
10691 : see how much of the 'sem*(2)' library is present.
10694 case "$d_semctl$d_semget$d_semop" in
10695 *"$undef"*) h_sem=false;;
10699 case "`ipcs 2>&1`" in
10700 "SVID messages"*"not configured"*)
10701 echo "Your $osname does not have the sem*(2) configured." >&4
10704 set semctl d_semctl
10706 set semget d_semget
10714 : we could also check for sys/ipc.h ...
10715 if $h_sem && $test `./findhdr sys/sem.h`; then
10716 echo "You have the full sem*(2) library." >&4
10719 echo "You don't have the full sem*(2) library." >&4
10725 : see whether sys/sem.h defines union semun
10727 $cat > try.c <<'END'
10728 #include <sys/types.h>
10729 #include <sys/ipc.h>
10730 #include <sys/sem.h>
10731 int main () { union semun semun; semun.buf = 0; }
10734 if eval $compile; then
10735 echo "You have union semun in <sys/sem.h>." >&4
10738 echo "You do not have union semun in <sys/sem.h>." >&4
10741 $rm -f try try.c try.h
10745 : see how to do semctl IPC_STAT
10748 : see whether semctl IPC_STAT can use union semun
10753 # define S_IRUSR S_IREAD
10754 # define S_IWUSR S_IWRITE
10755 # define S_IXUSR S_IEXEC
10757 # define S_IRUSR 0400
10758 # define S_IWUSR 0200
10759 # define S_IXUSR 0100
10761 # define S_IRGRP (S_IRUSR>>3)
10762 # define S_IWGRP (S_IWUSR>>3)
10763 # define S_IXGRP (S_IXUSR>>3)
10764 # define S_IROTH (S_IRUSR>>6)
10765 # define S_IWOTH (S_IWUSR>>6)
10766 # define S_IXOTH (S_IXUSR>>6)
10769 # define S_IRWXU (S_IRUSR|S_IWUSR|S_IXUSR)
10770 # define S_IRWXG (S_IRGRP|S_IWGRP|S_IXGRP)
10771 # define S_IRWXO (S_IROTH|S_IWOTH|S_IXOTH)
10776 #include <sys/types.h>
10777 #include <sys/ipc.h>
10778 #include <sys/sem.h>
10779 #include <sys/stat.h>
10786 #$d_union_semun HAS_UNION_SEMUN
10789 #ifndef HAS_UNION_SEMUN
10792 struct semid_ds *buf;
10793 unsigned short *array;
10799 #if defined(IPC_PRIVATE) && defined(S_IRWXU) && defined(S_IRWXG) && defined(S_IRWXO) && defined(IPC_CREAT)
10800 sem = semget(IPC_PRIVATE, 1, S_IRWXU|S_IRWXG|S_IRWXO|IPC_CREAT);
10802 struct semid_ds argbuf;
10805 st = semctl(sem, 0, IPC_STAT, arg);
10809 # endif /* IPC_STAT */
10810 printf("semctl IPC_STAT failed: errno = %d\n", errno);
10812 if (semctl(sem, 0, IPC_RMID, arg) != 0)
10813 # endif /* IPC_RMID */
10814 printf("semctl IPC_RMID failed: errno = %d\n", errno);
10816 #endif /* IPC_PRIVATE && ... */
10817 printf("semget failed: errno = %d\n", errno);
10823 if eval $compile; then
10826 semun) val="$define" ;;
10832 case "$d_semctl_semun" in
10834 echo "You can use union semun for semctl IPC_STAT." >&4
10837 *) echo "You cannot use union semun for semctl IPC_STAT." >&4
10842 : see whether semctl IPC_STAT can use struct semid_ds pointer
10843 $cat > try.c <<'END'
10844 #include <sys/types.h>
10845 #include <sys/ipc.h>
10846 #include <sys/sem.h>
10847 #include <sys/stat.h>
10855 struct semid_ds arg;
10858 #if defined(IPC_PRIVATE) && defined(S_IRWXU) && defined(S_IRWXG) && defined(S_IRWXO) && defined(IPC_CREAT)
10859 sem = semget(IPC_PRIVATE, 1, S_IRWXU|S_IRWXG|S_IRWXO|IPC_CREAT);
10862 st = semctl(sem, 0, IPC_STAT, &arg);
10864 printf("semid_ds\n");
10866 # endif /* IPC_STAT */
10867 printf("semctl IPC_STAT failed: errno = %d\n", errno);
10869 if (semctl(sem, 0, IPC_RMID, &arg) != 0)
10870 # endif /* IPC_RMID */
10871 printf("semctl IPC_RMID failed: errno = %d\n", errno);
10873 #endif /* IPC_PRIVATE && ... */
10874 printf("semget failed: errno = %d\n", errno);
10881 if eval $compile; then
10884 semid_ds) val="$define" ;;
10888 set d_semctl_semid_ds
10890 case "$d_semctl_semid_ds" in
10892 echo "You can $also use struct semid_ds* for semctl IPC_STAT." >&4
10894 *) echo "You cannot use struct semid_ds* for semctl IPC_STAT." >&4
10901 # We do not have the full sem*(2) library, so assume we can not
10907 set d_semctl_semid_ds
10912 : see if setegid exists
10913 set setegid d_setegid
10916 : see if seteuid exists
10917 set seteuid d_seteuid
10920 : see if setgrent exists
10921 set setgrent d_setgrent
10924 : see if sethostent exists
10925 set sethostent d_sethent
10928 : see if setlinebuf exists
10929 set setlinebuf d_setlinebuf
10932 : see if setlocale exists
10933 set setlocale d_setlocale
10936 : see if setnetent exists
10937 set setnetent d_setnent
10940 : see if setprotoent exists
10941 set setprotoent d_setpent
10944 : see if setpgid exists
10945 set setpgid d_setpgid
10948 : see if setpgrp2 exists
10949 set setpgrp2 d_setpgrp2
10952 : see if setpriority exists
10953 set setpriority d_setprior
10956 : see if setpwent exists
10957 set setpwent d_setpwent
10960 : see if setregid exists
10961 set setregid d_setregid
10963 set setresgid d_setresgid
10966 : see if setreuid exists
10967 set setreuid d_setreuid
10969 set setresuid d_setresuid
10972 : see if setrgid exists
10973 set setrgid d_setrgid
10976 : see if setruid exists
10977 set setruid d_setruid
10980 : see if setservent exists
10981 set setservent d_setsent
10984 : see if setsid exists
10985 set setsid d_setsid
10988 : see if setspent exists
10989 set setspent d_setspent
10992 : see if setvbuf exists
10993 set setvbuf d_setvbuf
10996 : see if sfio.h is available
11001 : see if sfio library is available
11012 : Ok, but do we want to use it.
11016 true|$define|[yY]*) dflt='y';;
11019 echo "$package can use the sfio library, but it is experimental."
11020 rp="You seem to have sfio available, do you want to try using it?"
11024 *) echo "Ok, avoiding sfio this time. I'll use stdio instead."
11026 : Remove sfio from list of libraries to use
11027 set `echo X $libs | $sed -e 's/-lsfio / /' -e 's/-lsfio$//'`
11030 echo "libs = $libs" >&4
11034 *) case "$usesfio" in
11035 true|$define|[yY]*)
11036 echo "Sorry, cannot find sfio on this machine" >&4
11037 echo "Ignoring your setting of usesfio=$usesfio" >&4
11045 $define) usesfio='true';;
11046 *) usesfio='false';;
11049 : see if shmctl exists
11050 set shmctl d_shmctl
11053 : see if shmget exists
11054 set shmget d_shmget
11057 : see if shmat exists
11060 : see what shmat returns
11063 $cat >shmat.c <<'END'
11064 #include <sys/shm.h>
11067 if $cc $ccflags -c shmat.c >/dev/null 2>&1; then
11072 echo "and it returns ($shmattype)." >&4
11073 : see if a prototype for shmat is available
11074 xxx=`./findhdr sys/shm.h`
11075 $cppstdin $cppflags $cppminus < $xxx > shmat.c 2>/dev/null
11076 if $contains 'shmat.*(' shmat.c >/dev/null 2>&1; then
11087 set d_shmatprototype
11090 : see if shmdt exists
11094 : see how much of the 'shm*(2)' library is present.
11097 case "$d_shmctl$d_shmget$d_shmat$d_shmdt" in
11098 *"$undef"*) h_shm=false;;
11102 case "`ipcs 2>&1`" in
11103 "SVID shared memory"*"not configured"*)
11104 echo "Your $osname does not have the shm*(2) configured." >&4
11107 set shmctl d_shmctl
11109 set shmget d_shmget
11119 : we could also check for sys/ipc.h ...
11120 if $h_shm && $test `./findhdr sys/shm.h`; then
11121 echo "You have the full shm*(2) library." >&4
11124 echo "You don't have the full shm*(2) library." >&4
11131 : see if we have sigaction
11132 if set sigaction val -f d_sigaction; eval $csym; $val; then
11133 echo 'sigaction() found.' >&4
11134 $cat > try.c <<'EOP'
11136 #include <sys/types.h>
11137 #include <signal.h>
11140 struct sigaction act, oact;
11142 oact.sa_handler = 0;
11143 /* so that act and oact are used */
11144 exit(act.sa_flags == 0 && oact.sa_handler == 0);
11148 if eval $compile_ok; then
11151 echo "But you don't seem to have a useable struct sigaction." >&4
11155 echo 'sigaction NOT found.' >&4
11158 set d_sigaction; eval $setvar
11159 $rm -f try try$_o try.c
11161 : see if sigsetjmp exists
11163 case "$d_sigsetjmp" in
11165 $cat >try.c <<'EOP'
11166 #include <setjmp.h>
11171 if (sigsetjmp(env,1))
11174 siglongjmp(env, 1);
11179 if eval $compile; then
11180 if ./try >/dev/null 2>&1; then
11181 echo "POSIX sigsetjmp found." >&4
11185 Uh-Oh! You have POSIX sigsetjmp and siglongjmp, but they do not work properly!!
11191 echo "sigsetjmp not found." >&4
11195 *) val="$d_sigsetjmp"
11196 case "$d_sigsetjmp" in
11197 $define) echo "POSIX sigsetjmp found." >&4;;
11198 $undef) echo "sigsetjmp not found." >&4;;
11206 : see if sys/stat.h is available
11207 set sys/stat.h i_sysstat
11211 : see if stat knows about block sizes
11213 echo "Checking to see if your struct stat has st_blocks field..." >&4
11214 set d_statblks stat st_blocks $i_sysstat sys/stat.h
11218 : see if this is a sys/vfs.h system
11219 set sys/vfs.h i_sysvfs
11223 : see if this is a sys/statfs.h system
11224 set sys/statfs.h i_sysstatfs
11229 echo "Checking to see if your system supports struct statfs..." >&4
11230 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
11232 case "$d_statfs_s" in
11233 "$define") echo "Yes, it does." ;;
11234 *) echo "No, it doesn't." ;;
11239 : see if struct statfs knows about f_flags
11240 case "$d_statfs_s" in
11243 echo "Checking to see if your struct statfs has f_flags field..." >&4
11244 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
11248 set d_statfs_f_flags
11252 case "$d_statfs_f_flags" in
11253 "$define") echo "Yes, it does." ;;
11254 *) echo "No, it doesn't." ;;
11257 : see if _ptr and _cnt from stdio act std
11259 if $contains '_IO_fpos_t' `./findhdr stdio.h` `./findhdr libio.h` >/dev/null 2>&1 ; then
11260 echo "(Looks like you have stdio.h from Linux.)"
11261 case "$stdio_ptr" in
11262 '') stdio_ptr='((fp)->_IO_read_ptr)'
11265 *) ptr_lval=$d_stdio_ptr_lval;;
11267 case "$stdio_cnt" in
11268 '') stdio_cnt='((fp)->_IO_read_end - (fp)->_IO_read_ptr)'
11271 *) cnt_lval=$d_stdio_cnt_lval;;
11273 case "$stdio_base" in
11274 '') stdio_base='((fp)->_IO_read_base)';;
11276 case "$stdio_bufsiz" in
11277 '') stdio_bufsiz='((fp)->_IO_read_end - (fp)->_IO_read_base)';;
11280 case "$stdio_ptr" in
11281 '') stdio_ptr='((fp)->_ptr)'
11284 *) ptr_lval=$d_stdio_ptr_lval;;
11286 case "$stdio_cnt" in
11287 '') stdio_cnt='((fp)->_cnt)'
11290 *) cnt_lval=$d_stdio_cnt_lval;;
11292 case "$stdio_base" in
11293 '') stdio_base='((fp)->_base)';;
11295 case "$stdio_bufsiz" in
11296 '') stdio_bufsiz='((fp)->_cnt + (fp)->_ptr - (fp)->_base)';;
11299 : test whether _ptr and _cnt really work
11300 echo "Checking how std your stdio is..." >&4
11303 #define FILE_ptr(fp) $stdio_ptr
11304 #define FILE_cnt(fp) $stdio_cnt
11306 FILE *fp = fopen("try.c", "r");
11309 18 <= FILE_cnt(fp) &&
11310 strncmp(FILE_ptr(fp), "include <stdio.h>\n", 18) == 0
11318 if eval $compile; then
11320 echo "Your stdio acts pretty std."
11323 echo "Your stdio isn't very std."
11326 echo "Your stdio doesn't appear very std."
11332 : Can _ptr be used as an lvalue?
11333 case "$d_stdstdio$ptr_lval" in
11334 $define$define) val=$define ;;
11337 set d_stdio_ptr_lval
11340 : Can _cnt be used as an lvalue?
11341 case "$d_stdstdio$cnt_lval" in
11342 $define$define) val=$define ;;
11345 set d_stdio_cnt_lval
11348 : see if _base is also standard
11350 case "$d_stdstdio" in
11354 #define FILE_base(fp) $stdio_base
11355 #define FILE_bufsiz(fp) $stdio_bufsiz
11357 FILE *fp = fopen("try.c", "r");
11360 19 <= FILE_bufsiz(fp) &&
11361 strncmp(FILE_base(fp), "#include <stdio.h>\n", 19) == 0
11368 if eval $compile; then
11370 echo "And its _base field acts std."
11373 echo "But its _base field isn't std."
11376 echo "However, it seems to be lacking the _base field."
11385 Checking how to access stdio streams by file descriptor number...
11387 case "$stdio_stream_array" in
11388 '') $cat >try.c <<EOCP
11391 if (&STDIO_STREAM_ARRAY[fileno(stdin)] == stdin)
11395 for s in _iob __iob __sF
11397 set try -DSTDIO_STREAM_ARRAY=$s
11398 if eval $compile; then
11399 case "`./try$exe_ext`" in
11400 yes) stdio_stream_array=$s; break ;;
11404 $rm -f try.* try$exe_ext
11406 case "$stdio_stream_array" in
11408 I can't figure out how to access stdio streams by file descriptor number.
11410 d_stdio_stream_array="$undef"
11413 You can access stdio streams by file descriptor number by the $stdio_stream_array array.
11415 d_stdio_stream_array="$define"
11419 : see if strcoll exists
11420 set strcoll d_strcoll
11423 : check for structure copying
11425 echo "Checking to see if your C compiler can copy structs..." >&4
11426 $cat >try.c <<'EOCP'
11436 if $cc -c try.c >/dev/null 2>&1 ; then
11438 echo "Yup, it can."
11441 echo "Nope, it can't."
11447 : see if strerror and/or sys_errlist[] exist
11449 if test "X$d_strerror" = X -o "X$d_syserrlst" = X; then
11450 if set strerror val -f d_strerror; eval $csym; $val; then
11451 echo 'strerror() found.' >&4
11452 d_strerror="$define"
11453 d_strerrm='strerror(e)'
11454 if set sys_errlist val -a d_syserrlst; eval $csym; $val; then
11455 echo "(You also have sys_errlist[], so we could roll our own strerror.)"
11456 d_syserrlst="$define"
11458 echo "(Since you don't have sys_errlist[], sterror() is welcome.)"
11459 d_syserrlst="$undef"
11461 elif xxx=`./findhdr string.h`; test "$xxx" || xxx=`./findhdr strings.h`; \
11462 $contains '#[ ]*define.*strerror' "$xxx" >/dev/null 2>&1; then
11463 echo 'strerror() found in string header.' >&4
11464 d_strerror="$define"
11465 d_strerrm='strerror(e)'
11466 if set sys_errlist val -a d_syserrlst; eval $csym; $val; then
11467 echo "(Most probably, strerror() uses sys_errlist[] for descriptions.)"
11468 d_syserrlst="$define"
11470 echo "(You don't appear to have any sys_errlist[], how can this be?)"
11471 d_syserrlst="$undef"
11473 elif set sys_errlist val -a d_syserrlst; eval $csym; $val; then
11474 echo "strerror() not found, but you have sys_errlist[] so we'll use that." >&4
11475 d_strerror="$undef"
11476 d_syserrlst="$define"
11477 d_strerrm='((e)<0||(e)>=sys_nerr?"unknown":sys_errlist[e])'
11479 echo 'strerror() and sys_errlist[] NOT found.' >&4
11480 d_strerror="$undef"
11481 d_syserrlst="$undef"
11482 d_strerrm='"unknown"'
11486 : see if strtod exists
11487 set strtod d_strtod
11490 : see if strtol exists
11491 set strtol d_strtol
11494 : see if strtold exists
11495 set strtold d_strtold
11498 : see if strtoll exists
11499 set strtoll d_strtoll
11502 case "$d_longlong-$d_strtoll" in
11505 Checking whether your strtoll() works okay...
11507 $cat >try.c <<'EOCP'
11510 #define strtoll __strtoll
11513 extern long long int strtoll(char *s, char **, int);
11514 static int bad = 0;
11515 int check(char *s, long long ell, int een) {
11518 gll = strtoll(s, 0, 10);
11519 if (!((gll == ell) && (errno == een)))
11523 check(" 1", 1LL, 0);
11524 check(" 0", 0LL, 0);
11525 check("-1", -1LL, 0);
11526 check("-9223372036854775808", -9223372036854775808LL, 0);
11527 check("-9223372036854775808", -9223372036854775808LL, 0);
11528 check(" 9223372036854775807", 9223372036854775807LL, 0);
11529 check("-9223372036854775808", -9223372036854775808LL, 0);
11530 check(" 9223372036854775808", 9223372036854775807LL, ERANGE);
11531 check("-9223372036854775809", -9223372036854775808LL, ERANGE);
11537 if eval $compile; then
11539 ok) echo "Your strtoll() seems to be working okay." ;;
11541 Your strtoll() doesn't seem to be working okay.
11550 : see if strtoul exists
11551 set strtoul d_strtoul
11554 : see if strtoull exists
11555 set strtoull d_strtoull
11558 case "$d_longlong-$d_strtoull" in
11561 Checking whether your strtoull() works okay...
11563 $cat >try.c <<'EOCP'
11566 #define strtoull __strtoull
11569 extern unsigned long long int strtoull(char *s, char **, int);
11570 static int bad = 0;
11571 int check(char *s, long long eull, int een) {
11574 gull = strtoull(s, 0, 10);
11575 if (!((gull == eull) && (errno == een)))
11579 check(" 1", 1LL, 0);
11580 check(" 0", 0LL, 0);
11581 check("18446744073709551615", 18446744073709551615ULL, 0);
11582 check("18446744073709551616", 18446744073709551615ULL, ERANGE);
11588 if eval $compile; then
11590 ok) echo "Your strtoull() seems to be working okay." ;;
11592 Your strtoull() doesn't seem to be working okay.
11594 d_strtoull="$undef"
11601 : see if strtouq exists
11602 set strtouq d_strtouq
11605 : see if strxfrm exists
11606 set strxfrm d_strxfrm
11609 : see if symlink exists
11610 set symlink d_symlink
11613 : see if syscall exists
11614 set syscall d_syscall
11617 : see if sysconf exists
11618 set sysconf d_sysconf
11621 : see if system exists
11622 set system d_system
11625 : see if tcgetpgrp exists
11626 set tcgetpgrp d_tcgetpgrp
11629 : see if tcsetpgrp exists
11630 set tcsetpgrp d_tcsetpgrp
11633 : see if prototype for telldir is available
11635 set d_telldirproto telldir $i_systypes sys/types.h $i_dirent dirent.h
11638 : see if this is a sys/times.h system
11639 set sys/times.h i_systimes
11642 : see if times exists
11644 if set times val -f d_times; eval $csym; $val; then
11645 echo 'times() found.' >&4
11648 case "$i_systimes" in
11649 "$define") inc='sys/times.h';;
11651 rp="What is the type returned by times() on this system?"
11652 set clock_t clocktype long stdio.h sys/types.h $inc
11655 echo 'times() NOT found, hope that will do.' >&4
11660 : see if truncate exists
11661 set truncate d_truncate
11664 : see if tzname[] exists
11666 if set tzname val -a d_tzname; eval $csym; $val; then
11668 echo 'tzname[] found.' >&4
11671 echo 'tzname[] NOT found.' >&4
11676 : see if umask exists
11680 : see if ustat exists
11684 : backward compatibility for d_hvfork
11685 if test X$d_hvfork != X; then
11686 d_vfork="$d_hvfork"
11689 : see if there is a vfork
11694 : Ok, but do we want to use it. vfork is reportedly unreliable in
11695 : perl on Solaris 2.x, and probably elsewhere.
11699 case "$usevfork" in
11705 Perl can only use a vfork() that doesn't suffer from strict
11706 restrictions on calling functions or modifying global data in
11707 the child. For example, glibc-2.1 contains such a vfork()
11708 that is unsuitable. If your system provides a proper fork()
11709 call, chances are that you do NOT want perl to use vfork().
11712 rp="Do you still want to use vfork()?"
11717 echo "Ok, we won't use vfork()."
11726 $define) usevfork='true';;
11727 *) usevfork='false';;
11730 : see if this is an sysdir system
11731 set sys/dir.h i_sysdir
11734 : see if this is an sysndir system
11735 set sys/ndir.h i_sysndir
11738 : see if closedir exists
11739 set closedir d_closedir
11742 case "$d_closedir" in
11745 echo "Checking whether closedir() returns a status..." >&4
11746 cat > closedir.c <<EOM
11747 #$i_dirent I_DIRENT /**/
11748 #$i_sysdir I_SYS_DIR /**/
11749 #$i_sysndir I_SYS_NDIR /**/
11750 #$i_systypes I_SYS_TYPES /**/
11752 #if defined(I_SYS_TYPES)
11753 #include <sys/types.h>
11755 #if defined(I_DIRENT)
11756 #include <dirent.h>
11757 #if defined(NeXT) && defined(I_SYS_DIR) /* NeXT needs dirent + sys/dir.h */
11758 #include <sys/dir.h>
11762 #include <sys/ndir.h>
11766 #include <ndir.h> /* may be wrong in the future */
11768 #include <sys/dir.h>
11773 int main() { return closedir(opendir(".")); }
11776 if eval $compile_ok; then
11777 if ./closedir > /dev/null 2>&1 ; then
11778 echo "Yes, it does."
11781 echo "No, it doesn't."
11785 echo "(I can't seem to compile the test program--assuming it doesn't)"
11793 set d_void_closedir
11796 : check for volatile keyword
11798 echo 'Checking to see if your C compiler knows about "volatile"...' >&4
11799 $cat >try.c <<'EOCP'
11802 typedef struct _goo_struct goo_struct;
11803 goo_struct * volatile goo = ((goo_struct *)0);
11804 struct _goo_struct {
11809 typedef unsigned short foo_t;
11810 char *volatile foo;
11812 volatile foo_t blech;
11816 if $cc -c $ccflags try.c >/dev/null 2>&1 ; then
11818 echo "Yup, it does."
11821 echo "Nope, it doesn't."
11827 : see if there is a wait4
11831 : see if waitpid exists
11832 set waitpid d_waitpid
11835 : see if wcstombs exists
11836 set wcstombs d_wcstombs
11839 : see if wctomb exists
11840 set wctomb d_wctomb
11843 : preserve RCS keywords in files with variable substitution, grrr
11848 Revision='$Revision'
11850 case "$crosscompile" in
11851 ''|[nN]*) crosscompile="$undef" ;;
11855 next|rhapsody|darwin) multiarch="$define" ;;
11857 case "$multiarch" in
11858 ''|[nN]*) multiarch="$undef" ;;
11861 : check for alignment requirements
11863 case "$crosscompile$multiarch" in
11866 You seem to be either cross-compiling or doing a multiarchitecture build,
11867 skipping the memory alignment check.
11870 case "$alignbytes" in
11871 '') alignbytes=8 ;;
11875 case "$alignbytes" in
11876 '') echo "Checking alignment constraints..." >&4
11877 if $test "X$uselongdouble" = Xdefine -a "X$d_longdbl" = Xdefine; then
11878 $cat >try.c <<'EOCP'
11879 typedef long double NV;
11882 $cat >try.c <<'EOCP'
11886 $cat >>try.c <<'EOCP'
11894 printf("%d\n", (int)((char *)&try_algn.bar - (char *)&try_algn.foo));
11899 if eval $compile_ok; then
11903 echo "(I can't seem to compile the test program...)"
11906 *) dflt="$alignbytes"
11909 rp="Doubles must be aligned on a how-many-byte boundary?"
11917 : set the base revision
11920 : check for ordering of bytes in a long
11922 case "$crosscompile$multiarch" in
11925 You seem to be either cross-compiling or doing a multiarchitecture build,
11926 skipping the byteorder check.
11932 case "$byteorder" in
11935 In the following, larger digits indicate more significance. A big-endian
11936 machine like a Pyramid or a Motorola 680?0 chip will come out to 4321. A
11937 little-endian machine like a Vax or an Intel 80?86 chip would be 1234. Other
11938 machines may have weird orders like 3412. A Cray will report 87654321,
11939 an Alpha will report 12345678. If the test program works the default is
11941 I'm now running the test program...
11943 $cat >try.c <<'EOCP'
11950 char c[sizeof(long)];
11953 if (sizeof(long) > 4)
11954 u.l = (0x08070605L << 32) | 0x04030201L;
11957 for (i = 0; i < sizeof(long); i++)
11958 printf("%c", u.c[i]+'0');
11965 if eval $compile && ./try > /dev/null; then
11968 [1-4][1-4][1-4][1-4]|12345678|87654321)
11969 echo "(The test program ran ok.)"
11970 echo "byteorder=$dflt"
11973 ????|????????) echo "(The test program ran ok.)" ;;
11974 *) echo "(The test program didn't run right for some reason.)" ;;
11979 (I can't seem to compile the test program. Guessing big-endian...)
11982 case "$xxx_prompt" in
11984 rp="What is the order of bytes in a long?"
11998 : how do we catenate cpp tokens here?
12000 echo "Checking to see how your cpp does stuff like catenate tokens..." >&4
12001 $cat >cpp_stuff.c <<'EOCP'
12002 #define RCAT(a,b)a/**/b
12003 #define ACAT(a,b)a ## b
12007 $cppstdin $cppflags $cppminus <cpp_stuff.c >cpp_stuff.out 2>&1
12008 if $contains 'Circus' cpp_stuff.out >/dev/null 2>&1; then
12009 echo "Oh! Smells like ANSI's been here." >&4
12010 echo "We can catify or stringify, separately or together!"
12012 elif $contains 'Reiser' cpp_stuff.out >/dev/null 2>&1; then
12013 echo "Ah, yes! The good old days!" >&4
12014 echo "However, in the good old days we don't know how to stringify and"
12015 echo "catify at the same time."
12019 Hmm, I don't seem to be able to catenate tokens with your cpp. You're going
12020 to have to edit the values of CAT[2-5] in config.h...
12022 cpp_stuff="/* Help! How do we handle cpp_stuff? */*/"
12026 : see if this is a db.h system
12032 : Check db version.
12034 echo "Checking Berkeley DB version ..." >&4
12040 #include <sys/types.h>
12045 #ifdef DB_VERSION_MAJOR /* DB version >= 2 */
12046 int Major, Minor, Patch ;
12047 unsigned long Version ;
12048 (void)db_version(&Major, &Minor, &Patch) ;
12049 printf("You have Berkeley DB Version 2 or greater\n");
12051 printf("db.h is from Berkeley DB Version %d.%d.%d\n",
12052 DB_VERSION_MAJOR, DB_VERSION_MINOR, DB_VERSION_PATCH);
12053 printf("libdb is from Berkeley DB Version %d.%d.%d\n",
12054 Major, Minor, Patch) ;
12056 /* check that db.h & libdb are compatible */
12057 if (DB_VERSION_MAJOR != Major || DB_VERSION_MINOR != Minor || DB_VERSION_PATCH != Patch) {
12058 printf("db.h and libdb are incompatible\n") ;
12062 printf("db.h and libdb are compatible\n") ;
12064 Version = DB_VERSION_MAJOR * 1000000 + DB_VERSION_MINOR * 1000
12065 + DB_VERSION_PATCH ;
12067 /* needs to be >= 2.3.4 */
12068 if (Version < 2003004) {
12069 /* if (DB_VERSION_MAJOR == 2 && DB_VERSION_MINOR == 0 && DB_VERSION_PATCH < 5) { */
12070 printf("but Perl needs Berkeley DB 2.3.4 or greater\n") ;
12076 #if defined(_DB_H_) && defined(BTREEMAGIC) && defined(HASHMAGIC)
12077 printf("You have Berkeley DB Version 1\n");
12078 exit(0); /* DB version < 2: the coast is clear. */
12080 exit(1); /* <db.h> not Berkeley DB? */
12086 if eval $compile_ok && ./try; then
12087 echo 'Looks OK.' >&4
12089 echo "I can't use Berkeley DB with your <db.h>. I'll disable Berkeley DB." >&4
12093 : Remove db from list of libraries to use
12094 echo "Removing unusable -ldb from library list" >&4
12095 set `echo X $libs | $sed -e 's/-ldb / /' -e 's/-ldb$//'`
12098 echo "libs = $libs" >&4
12108 : Check the return type needed for hash
12110 echo "Checking return type needed for hash for Berkeley DB ..." >&4
12116 #include <sys/types.h>
12119 #ifndef DB_VERSION_MAJOR
12120 u_int32_t hash_cb (ptr, size)
12128 info.hash = hash_cb;
12132 if $cc $ccflags -c try.c >try.out 2>&1 ; then
12133 if $contains warning try.out >>/dev/null 2>&1 ; then
12136 db_hashtype='u_int32_t'
12139 : XXX Maybe we should just give up here.
12140 db_hashtype=u_int32_t
12142 echo "Help: I can't seem to compile the db test program." >&4
12143 echo "Something's wrong, but I'll assume you use $db_hashtype." >&4
12146 echo "Your version of Berkeley DB uses $db_hashtype for hash."
12148 *) db_hashtype=u_int32_t
12153 : Check the return type needed for prefix
12155 echo "Checking return type needed for prefix for Berkeley DB ..." >&4
12161 #include <sys/types.h>
12164 #ifndef DB_VERSION_MAJOR
12165 size_t prefix_cb (key1, key2)
12173 info.prefix = prefix_cb;
12177 if $cc $ccflags -c try.c >try.out 2>&1 ; then
12178 if $contains warning try.out >>/dev/null 2>&1 ; then
12179 db_prefixtype='int'
12181 db_prefixtype='size_t'
12184 db_prefixtype='size_t'
12185 : XXX Maybe we should just give up here.
12187 echo "Help: I can't seem to compile the db test program." >&4
12188 echo "Something's wrong, but I'll assume you use $db_prefixtype." >&4
12191 echo "Your version of Berkeley DB uses $db_prefixtype for prefix."
12193 *) db_prefixtype='size_t'
12197 : check for void type
12199 echo "Checking to see how well your C compiler groks the void type..." >&4
12200 case "$voidflags" in
12202 $cat >try.c <<'EOCP'
12208 extern void moo(); /* function returning void */
12209 void (*goo)(); /* ptr to func returning void */
12211 void *hue; /* generic ptr */
12224 int main() { sub(); }
12226 if $cc $ccflags -c -DTRY=$defvoidused try.c >.out 2>&1 ; then
12227 voidflags=$defvoidused
12228 echo "Good. It appears to support void to the level $package wants.">&4
12229 if $contains warning .out >/dev/null 2>&1; then
12230 echo "However, you might get some warnings that look like this:"
12234 echo "Hmm, your compiler has some difficulty with void. Checking further..." >&4
12235 if $cc $ccflags -c -DTRY=1 try.c >/dev/null 2>&1; then
12236 echo "It supports 1..."
12237 if $cc $ccflags -c -DTRY=3 try.c >/dev/null 2>&1; then
12238 echo "It also supports 2..."
12239 if $cc $ccflags -c -DTRY=7 try.c >/dev/null 2>&1; then
12241 echo "And it supports 4 but not 8 definitely."
12243 echo "It doesn't support 4..."
12244 if $cc $ccflags -c -DTRY=11 try.c >/dev/null 2>&1; then
12246 echo "But it supports 8."
12249 echo "Neither does it support 8."
12253 echo "It does not support 2..."
12254 if $cc $ccflags -c -DTRY=13 try.c >/dev/null 2>&1; then
12256 echo "But it supports 4 and 8."
12258 if $cc $ccflags -c -DTRY=5 try.c >/dev/null 2>&1; then
12260 echo "And it supports 4 but has not heard about 8."
12262 echo "However it supports 8 but not 4."
12267 echo "There is no support at all for void."
12272 case "$voidflags" in
12274 *) $cat >&4 <<'EOM'
12275 Support flag bits are:
12276 1: basic void declarations.
12277 2: arrays of pointers to functions returning void.
12278 4: operations between pointers to and addresses of void functions.
12279 8: generic void pointers.
12282 rp="Your void support flags add up to what?"
12290 : How can we generate normalized random numbers ?
12292 echo "Looking for a random number function..." >&4
12293 case "$randfunc" in
12295 if set drand48 val -f; eval $csym; $val; then
12297 echo "Good, found drand48()." >&4
12298 elif set random val -f; eval $csym; $val; then
12300 echo "OK, found random()." >&4
12303 echo "Yick, looks like I have to use rand()." >&4
12314 *-Dmy_rand=*|*-Dmy_srand=*)
12315 echo "Removing obsolete -Dmy_rand, -Dmy_srand, and -Drandbits from ccflags." >&4
12316 ccflags="`echo $ccflags | sed -e 's/-Dmy_rand=random/ /'`"
12317 ccflags="`echo $ccflags | sed -e 's/-Dmy_srand=srandom/ /'`"
12318 ccflags="`echo $ccflags | sed -e 's/-Drandbits=[0-9][0-9]*/ /'`"
12322 while $test "$cont"; do
12323 rp="Use which function to generate random numbers?"
12325 if $test "$ans" = "$dflt"; then
12331 if set $ans val -f; eval $csym; $val; then
12335 rp="I cannot find function $ans. Use that name anyway?"
12344 case "$randfunc" in
12346 drand01="drand48()"
12352 case "$randbits" in
12354 echo "Checking to see how many bits your $randfunc() function produces..." >&4
12356 #$i_unistd I_UNISTD
12357 #$i_stdlib I_STDLIB
12360 # include <unistd.h>
12363 # include <stdlib.h>
12368 register unsigned long tmp;
12369 register unsigned long max = 0L;
12371 for (i = 1000; i; i--) {
12372 tmp = (unsigned long) $randfunc();
12373 if (tmp > max) max = tmp;
12375 for (i = 0; max; i++)
12381 if eval $compile_ok; then
12385 echo "(I can't seem to compile the test program...)"
12392 rp="How many bits does your $randfunc() function produce?"
12396 drand01="($randfunc() / (double) ((unsigned long)1 << $randbits))"
12397 seedfunc="s$randfunc"
12398 randseedtype=unsigned
12402 rp="How many bits does your $randfunc() function produce?"
12405 seedfunc="s$randfunc"
12406 drand01="($randfunc() / (double) ((unsigned long)1 << $randbits))"
12407 if set $seedfunc val -f; eval $csym; $val; then
12408 echo "(Using $seedfunc() to seed random generator)"
12410 echo "(Warning: no $seedfunc() to seed random generator)"
12413 randseedtype=unsigned
12421 echo "Determining whether or not we are on an EBCDIC system..." >&4
12422 $cat >tebcdic.c <<'EOM'
12425 if ('M'==0xd4) return 0;
12432 if eval $compile_ok; then
12434 echo "You have EBCDIC." >&4
12437 echo "Nope, no EBCDIC, probably ASCII or some ISO Latin." >&4
12440 echo "I'm unable to compile the test program." >&4
12441 echo "I'll assume ASCII or some ISO Latin." >&4
12443 $rm -f tebcdic.c tebcdic
12449 Checking how to flush all pending stdio output...
12451 # I only know how to find the first 32 possibly open files on SunOS.
12452 # See also hints/sunos_4_1.sh and util.c --AD
12454 sunos) $echo '#define PERL_FFLUSH_ALL_FOPEN_MAX 32' > try.c ;;
12456 $cat >>try.c <<EOCP
12458 #$i_unistd I_UNISTD
12460 # include <unistd.h>
12462 #$d_sysconf HAS_SYSCONF
12463 #$d_stdio_stream_array HAS_STDIO_STREAM_ARRAY
12464 #ifdef HAS_STDIO_STREAM_ARRAY
12465 # define STDIO_STREAM_ARRAY $stdio_stream_array
12468 FILE* p = fopen("try.out", "w");
12472 # ifdef TRY_FPRINTF
12476 #ifdef TRY_FFLUSH_NULL
12479 #ifdef TRY_FFLUSH_ALL
12481 long open_max = -1;
12482 # ifdef PERL_FFLUSH_ALL_FOPEN_MAX
12483 open_max = PERL_FFLUSH_ALL_FOPEN_MAX;
12485 # if defined(HAS_SYSCONF) && defined(_SC_OPEN_MAX)
12486 open_max = sysconf(_SC_OPEN_MAX);
12489 open_max = FOPEN_MAX;
12492 open_max = OPEN_MAX;
12501 # ifdef HAS_STDIO_STREAM_ARRAY
12502 if (open_max > 0) {
12504 for (i = 0; i < open_max; i++)
12505 if (STDIO_STREAM_ARRAY[i]._file >= 0 &&
12506 STDIO_STREAM_ARRAY[i]._file < open_max &&
12507 STDIO_STREAM_ARRAY[i]._flag)
12508 fflush(&STDIO_STREAM_ARRAY[i]);
12516 : first we have to find out how _not_ to flush
12517 if $test "X$fflushNULL" = X -o "X$fflushall" = X; then
12519 set try -DTRY_FPUTC
12520 if eval $compile; then
12522 ./try$exe_ext 2>/dev/null
12523 if $test ! -s try.out -a "X$?" = X42; then
12529 set try -DTRY_FPRINTF
12531 if eval $compile; then
12533 ./try$exe_ext 2>/dev/null
12534 if $test ! -s try.out -a "X$?" = X42; then
12535 output=-DTRY_FPRINTF
12541 : check for fflush NULL behaviour
12542 case "$fflushNULL" in
12543 '') set try -DTRY_FFLUSH_NULL $output
12544 if eval $compile; then
12546 ./try$exe_ext 2>/dev/null
12548 if $test -s try.out -a "X$code" = X42; then
12549 fflushNULL="`$cat try.out`"
12551 if $test "X$code" != X42; then
12553 (If this test failed, don't worry, we'll try another method shortly.)
12558 $rm -f core try.core core.try.*
12559 case "$fflushNULL" in
12561 Your fflush(NULL) works okay for output streams.
12562 Let's see if it clobbers input pipes...
12564 # As of mid-March 2000 all versions of Solaris appear to have a stdio
12565 # bug that improperly flushes the input end of pipes. So we avoid the
12566 # autoflush on fork/system/exec support for now. :-(
12567 $cat >tryp.c <<EOCP
12570 main(int argc, char **argv)
12576 while ((i = getc(stdin)) != -1
12577 && (*bp++ = i) != '\n'
12578 && bp < &buf[1024])
12581 fprintf(stdout, "%s", buf);
12589 fflushNULL="$define"
12591 if eval $compile; then
12593 $cat tryp.c | ./tryp$exe_ext 2>/dev/null > tryp.out
12594 if cmp tryp.c tryp.out >/dev/null 2>&1; then
12596 fflush(NULL) seems to behave okay with input streams.
12598 fflushNULL="$define"
12601 Ouch, fflush(NULL) clobbers input pipes! We will not use it.
12603 fflushNULL="$undef"
12606 $rm -f core tryp.c tryp.core core.tryp.*
12609 Your fflush(NULL) isn't working (contrary to ANSI C).
12611 fflushNULL="$undef"
12614 Cannot figure out whether your fflush(NULL) works or not.
12615 I'm assuming it doesn't (contrary to ANSI C).
12617 fflushNULL="$undef"
12621 $define|true|[yY]*)
12622 fflushNULL="$define"
12625 fflushNULL="$undef"
12628 : check explicit looping only if NULL did not work, and if the pipe
12629 : bug does not show up on an explicit flush too
12630 case "$fflushNULL" in
12632 $cat >tryp.c <<EOCP
12635 main(int argc, char **argv)
12641 while ((i = getc(stdin)) != -1
12642 && (*bp++ = i) != '\n'
12643 && bp < &buf[1024])
12646 fprintf(stdout, "%s", buf);
12655 if eval $compile; then
12657 $cat tryp.c | ./tryp$exe_ext 2>/dev/null > tryp.out
12658 if cmp tryp.c tryp.out >/dev/null 2>&1; then
12660 Good, at least fflush(stdin) seems to behave okay when stdin is a pipe.
12662 : now check for fflushall behaviour
12663 case "$fflushall" in
12664 '') set try -DTRY_FFLUSH_ALL $output
12665 if eval $compile; then
12667 (Now testing the other method--but note that this also may fail.)
12670 ./try$exe_ext 2>/dev/null
12671 if $test -s try.out -a "X$?" = X42; then
12672 fflushall="`$cat try.out`"
12675 $rm -f core try.core core.try.*
12676 case "$fflushall" in
12678 Whew. Flushing explicitly all the stdio streams works.
12680 fflushall="$define"
12683 Sigh. Flushing explicitly all the stdio streams doesn't work.
12688 Cannot figure out whether flushing stdio streams explicitly works or not.
12689 I'm assuming it doesn't.
12695 "$define"|true|[yY]*)
12696 fflushall="$define"
12704 All is futile. Even fflush(stdin) clobbers input pipes!
12711 $rm -f core tryp.c tryp.core core.tryp.*
12713 *) fflushall="$undef"
12717 case "$fflushNULL$fflushall" in
12720 OK, I give up. I cannot figure out how to flush pending stdio output.
12721 We won't be flushing handles at all before fork/exec/popen.
12725 $rm -f try.* try$exe_ext
12727 : Store the full pathname to the ar program for use in the C program
12728 : Respect a hint or command line value for full_ar.
12733 : Store the full pathname to the sed program for use in the C program
12736 : see what type gids are declared as in the kernel
12738 echo "Looking for the type for group ids returned by getgid()."
12739 set gid_t gidtype xxx stdio.h sys/types.h
12743 xxx=`./findhdr sys/user.h`
12744 set `grep 'groups\[NGROUPS\];' "$xxx" 2>/dev/null` unsigned short
12746 unsigned) dflt="$1 $2" ;;
12750 *) dflt="$gidtype";;
12753 gid_t) echo "gid_t found." ;;
12754 *) rp="What is the type for group ids returned by getgid()?"
12762 *_t) zzz="$gidtype" ;;
12765 echo "Checking the size of $zzz..." >&4
12767 #include <sys/types.h>
12770 printf("%d\n", (int)sizeof($gidtype));
12775 if eval $compile_ok; then
12779 echo "(I can't execute the test program--guessing $gidsize.)" >&4
12782 echo "Your $zzz is $gidsize bytes long."
12787 echo "(I can't compile the test program--guessing $gidsize.)" >&4
12793 *_t) zzz="$gidtype" ;;
12796 echo "Checking the sign of $zzz..." >&4
12798 #include <sys/types.h>
12809 if eval $compile; then
12813 echo "(I can't execute the test program--guessing unsigned.)" >&4
12817 1) echo "Your $zzz is unsigned." ;;
12818 -1) echo "Your $zzz is signed." ;;
12824 echo "(I can't compile the test program--guessing unsigned.)" >&4
12830 if $test X"$quadtype" != X; then
12832 echo "Checking how to print 64-bit integers..." >&4
12834 if $test X"$sPRId64" = X -a X"$quadtype" = Xint; then
12835 $cat >try.c <<'EOCP'
12836 #include <sys/types.h>
12839 int q = 12345678901;
12840 printf("%ld\n", q);
12844 if eval $compile; then
12845 yyy=`./try$exe_ext`
12848 sPRId64='"d"'; sPRIi64='"i"'; sPRIu64='"u"';
12849 sPRIo64='"o"'; sPRIx64='"x"'; sPRIX64='"X"';
12850 echo "We will use %d."
12856 if $test X"$sPRId64" = X -a X"$quadtype" = Xlong; then
12857 $cat >try.c <<'EOCP'
12858 #include <sys/types.h>
12861 long q = 12345678901;
12862 printf("%ld\n", q);
12866 if eval $compile; then
12867 yyy=`./try$exe_ext`
12870 sPRId64='"ld"'; sPRIi64='"li"'; sPRIu64='"lu"';
12871 sPRIo64='"lo"'; sPRIx64='"lx"'; sPRIX64='"lX"';
12872 echo "We will use %ld."
12878 if $test X"$sPRId64" = X -a X"$i_inttypes" = X"$define" -a X"$quadtype" = Xint64_t; then
12879 $cat >try.c <<'EOCP'
12880 #include <sys/types.h>
12881 #include <inttypes.h>
12884 int64_t q = 12345678901;
12885 printf("%" PRId64 "\n", q);
12889 if eval $compile; then
12890 yyy=`./try$exe_ext`
12893 sPRId64=PRId64; sPRIi64=PRIi64; sPRIu64=PRIu64;
12894 sPRIo64=PRIo64; sPRIx64=PRIx64; sPRIX64=PRIX64;
12895 echo "We will use the C9X style."
12901 if $test X"$sPRId64" = X -a X"$quadtype" = X"long long"; then
12902 $cat >try.c <<'EOCP'
12903 #include <sys/types.h>
12906 long long q = 12345678901LL; /* AIX cc requires the LL prefix. */
12907 printf("%lld\n", q);
12911 if eval $compile; then
12912 yyy=`./try$exe_ext`
12915 sPRId64='"lld"'; sPRIi64='"lli"'; sPRIu64='"llu"';
12916 sPRIo64='"llo"'; sPRIx64='"llx"'; sPRIX64='"llX"';
12917 echo "We will use the %lld style."
12923 if $test X"$sPRId64" = X -a X"$quadtype" != X; then
12925 #include <sys/types.h>
12928 $quadtype q = 12345678901;
12929 printf("%Ld\n", q);
12933 if eval $compile; then
12934 yyy=`./try$exe_ext`
12937 sPRId64='"Ld"'; sPRIi64='"Li"'; sPRIu64='"Lu"';
12938 sPRIo64='"Lo"'; sPRIx64='"Lx"'; sPRIX64='"LX"';
12939 echo "We will use %Ld."
12945 if $test X"$sPRId64" = X -a X"$quadtype" != X; then
12947 #include <sys/types.h>
12950 $quadtype q = 12345678901;
12951 printf("%qd\n", q);
12955 if eval $compile; then
12956 yyy=`./try$exe_ext`
12959 sPRId64='"qd"'; sPRIi64='"qi"'; sPRIu64='"qu"';
12960 sPRIo64='"qo"'; sPRIx64='"qx"'; sPRIX64='"qX"';
12961 echo "We will use %qd."
12967 if $test X"$sPRId64" = X; then
12968 echo "Cannot figure out how to print 64-bit integers." >&4
12976 '') d_PRId64="$undef"; d_PRIi64="$undef"; d_PRIu64="$undef";
12977 d_PRIo64="$undef"; d_PRIx64="$undef"; d_PRIX64="$undef";
12979 *) d_PRId64="$define"; d_PRIi64="$define"; d_PRIu64="$define";
12980 d_PRIo64="$define"; d_PRIx64="$define"; d_PRIX64="$define";
12986 $echo "Checking the format strings to be used for Perl's internal types..." >&4
12988 if $test X"$ivsize" = X8; then
12989 ivdformat="$sPRId64"
12990 uvuformat="$sPRIu64"
12991 uvoformat="$sPRIo64"
12992 uvxformat="$sPRIx64"
12994 if $test X"$ivsize" = X"$longsize"; then
13000 if $test X"$ivsize" = X"$intsize"; then
13007 if $test X"$ivsize" = X"$shortsize"; then
13017 case "$ivdformat" in
13018 '') echo "$0: Fatal: failed to find format strings, cannot continue." >& 4
13025 $echo "Checking the format string to be used for gids..." >&4
13028 -1) if $test X"$gidsize" = X"$ivsize"; then
13029 gidformat="$ivdformat"
13031 if $test X"$gidsize" = X"$longsize"; then
13034 if $test X"$gidsize" = X"$intsize"; then
13037 if $test X"$gidsize" = X"$shortsize"; then
13044 *) if $test X"$gidsize" = X"$uvsize"; then
13045 gidformat="$uvuformat"
13047 if $test X"$gidsize" = X"$longsize"; then
13050 if $test X"$gidsize" = X"$intsize"; then
13053 if $test X"$gidsize" = X"$shortsize"; then
13062 : see if getgroups exists
13063 set getgroups d_getgrps
13066 : see if setgroups exists
13067 set setgroups d_setgrps
13071 : Find type of 2nd arg to 'getgroups()' and 'setgroups()'
13073 case "$d_getgrps$d_setgrps" in
13075 case "$groupstype" in
13076 '') dflt="$gidtype" ;;
13077 *) dflt="$groupstype" ;;
13080 What type of pointer is the second argument to getgroups() and setgroups()?
13081 Usually this is the same as group ids, $gidtype, but not always.
13084 rp='What type pointer is the second argument to getgroups() and setgroups()?'
13088 *) groupstype="$gidtype";;
13092 echo "Checking if your $make program sets \$(MAKE)..." >&4
13093 case "$make_set_make" in
13095 $sed 's/^X //' > testmake.mak << 'EOF'
13097 X @echo 'maketemp="$(MAKE)"'
13099 case "`$make -f testmake.mak 2>/dev/null`" in
13100 *maketemp=*) make_set_make='#' ;;
13101 *) make_set_make="MAKE=$make" ;;
13103 $rm -f testmake.mak
13106 case "$make_set_make" in
13107 '#') echo "Yup, it does.";;
13108 *) echo "Nope, it doesn't.";;
13111 : see what type is used for mode_t
13112 rp="What is the type used for file modes for system calls (e.g. fchmod())?"
13113 set mode_t modetype int stdio.h sys/types.h
13116 : define a fucntion to check prototypes
13117 $cat > protochk <<EOSH
13120 optimize="$optimize"
13122 prototype="$prototype"
13127 $cat >> protochk <<'EOSH'
13132 while test $# -ge 2; do
13134 $define) echo "#include <$2>" >> try.c ;;
13135 literal) echo "$2" >> try.c ;;
13139 test "$prototype" = "$define" && echo '#define CAN_PROTOTYPE' >> try.c
13140 cat >> try.c <<'EOCP'
13141 #ifdef CAN_PROTOTYPE
13142 #define _(args) args
13147 echo "$foo" >> try.c
13148 echo 'int no_real_function_has_this_name _((void)) { return 0; }' >> try.c
13149 $cc $optimize $ccflags -c try.c > /dev/null 2>&1
13155 $eunicefix protochk
13157 : see what type is used for size_t
13158 rp="What is the type used for the length parameter for string functions?"
13159 set size_t sizetype 'unsigned int' stdio.h sys/types.h
13162 : check for type of arguments to gethostbyaddr.
13163 if test "X$netdb_host_type" = X -o "X$netdb_hlen_type" = X; then
13164 case "$d_gethbyaddr" in
13168 Checking to see what type of arguments are accepted by gethostbyaddr().
13170 hdrs="$define sys/types.h
13171 $d_socket sys/socket.h
13172 $i_niin netinet/in.h
13174 $i_unistd unistd.h"
13175 : The first arg can 'char *' or 'void *'
13176 : The second arg is some of integral type
13177 for xxx in in_addr_t 'const void *' 'const char *' 'void *' 'char *'; do
13178 for yyy in size_t long int; do
13179 case "$netdb_host_type" in
13180 '') try="extern struct hostent *gethostbyaddr($xxx, $yyy, int);"
13181 if ./protochk "$try" $hdrs; then
13182 echo "Your system accepts $xxx for the first arg."
13183 echo "...and $yyy for the second arg."
13184 netdb_host_type="$xxx"
13185 netdb_hlen_type="$yyy"
13191 : In case none of those worked, prompt the user.
13192 case "$netdb_host_type" in
13193 '') rp='What is the type for the 1st argument to gethostbyaddr?'
13196 netdb_host_type=$ans
13197 rp='What is the type for the 2nd argument to gethostbyaddr?'
13200 netdb_hlen_type=$ans
13204 *) : no gethostbyaddr, so pick harmless defaults
13205 netdb_host_type='char *'
13206 netdb_hlen_type="$sizetype"
13209 # Remove the "const" if needed. -- but then we'll have a
13211 # netdb_host_type=`echo "$netdb_host_type" | sed 's/^const //'`
13214 : check for type of argument to gethostbyname.
13215 if test "X$netdb_name_type" = X ; then
13216 case "$d_gethbyname" in
13220 Checking to see what type of argument is accepted by gethostbyname().
13222 hdrs="$define sys/types.h
13223 $d_socket sys/socket.h
13224 $i_niin netinet/in.h
13226 $i_unistd unistd.h"
13227 for xxx in "const char *" "char *"; do
13228 case "$netdb_name_type" in
13229 '') try="extern struct hostent *gethostbyname($xxx);"
13230 if ./protochk "$try" $hdrs; then
13231 echo "Your system accepts $xxx."
13232 netdb_name_type="$xxx"
13237 : In case none of those worked, prompt the user.
13238 case "$netdb_name_type" in
13239 '') rp='What is the type for the 1st argument to gethostbyname?'
13242 netdb_name_type=$ans
13246 *) : no gethostbyname, so pick harmless default
13247 netdb_name_type='char *'
13252 : check for type of 1st argument to getnetbyaddr.
13253 if test "X$netdb_net_type" = X ; then
13254 case "$d_getnbyaddr" in
13258 Checking to see what type of 1st argument is accepted by getnetbyaddr().
13260 hdrs="$define sys/types.h
13261 $d_socket sys/socket.h
13262 $i_niin netinet/in.h
13264 $i_unistd unistd.h"
13265 for xxx in in_addr_t "unsigned long" long "unsigned int" int; do
13266 case "$netdb_net_type" in
13267 '') try="extern struct netent *getnetbyaddr($xxx, int);"
13268 if ./protochk "$try" $hdrs; then
13269 echo "Your system accepts $xxx."
13270 netdb_net_type="$xxx"
13275 : In case none of those worked, prompt the user.
13276 case "$netdb_net_type" in
13277 '') rp='What is the type for the 1st argument to getnetbyaddr?'
13280 netdb_net_type=$ans
13284 *) : no getnetbyaddr, so pick harmless default
13285 netdb_net_type='long'
13289 : locate the preferred pager for this system
13303 '') dflt=/usr/ucb/more;;
13310 rp='What pager is used on your system?'
13314 : see what type pids are declared as in the kernel
13315 rp="What is the type of process ids on this system?"
13316 set pid_t pidtype int stdio.h sys/types.h
13319 : Find earliest binary compatible site_perl subdirectory perl can use.
13320 case "$bincompat5005" in
13321 "$define") xs_apiversion='5.005' ;;
13322 *) xs_apiversion=$version ;; # The current site_perl version.
13324 : Find earliest pure perl site_perl subdirectory perl can use.
13325 : The versioned directories started at 5.005.
13326 pm_apiversion='5.005'
13328 : check for length of pointer
13332 echo "Checking to see how big your pointers are..." >&4
13333 if test "$voidflags" -gt 7; then
13334 echo '#define VOID_PTR char *' > try.c
13336 echo '#define VOID_PTR void *' > try.c
13338 $cat >>try.c <<'EOCP'
13342 printf("%d\n", (int)sizeof(VOID_PTR));
13347 if eval $compile_ok; then
13349 echo "Your pointers are $ptrsize bytes long."
13352 echo "(I can't seem to compile the test program. Guessing...)" >&4
13353 rp="What is the size of a pointer (in bytes)?"
13361 : see if ar generates random libraries by itself
13363 echo "Checking how to generate random libraries on your machine..." >&4
13364 echo 'int bar1() { return bar2(); }' > bar1.c
13365 echo 'int bar2() { return 2; }' > bar2.c
13366 $cat > foo.c <<'EOP'
13367 int main() { printf("%d\n", bar1()); exit(0); }
13369 $cc $ccflags -c bar1.c >/dev/null 2>&1
13370 $cc $ccflags -c bar2.c >/dev/null 2>&1
13371 $cc $ccflags -c foo.c >/dev/null 2>&1
13372 $ar rc bar$_a bar2$_o bar1$_o >/dev/null 2>&1
13373 if $cc $ccflags $ldflags -o foobar foo$_o bar$_a $libs > /dev/null 2>&1 &&
13374 ./foobar >/dev/null 2>&1; then
13375 echo "$ar appears to generate random libraries itself."
13378 elif $ar ts bar$_a >/dev/null 2>&1 &&
13379 $cc $ccflags $ldflags -o foobar foo$_o bar$_a $libs > /dev/null 2>&1 &&
13380 ./foobar >/dev/null 2>&1; then
13381 echo "a table of contents needs to be added with '$ar ts'."
13388 ranlib=`./loc ranlib X /usr/bin /bin /usr/local/bin`
13389 $test -f $ranlib || ranlib=''
13392 if $test -n "$ranlib"; then
13393 echo "your system has '$ranlib'; we'll use that."
13396 echo "your system doesn't seem to support random libraries"
13397 echo "so we'll use lorder and tsort to order the libraries."
13404 : check for type of arguments to select.
13405 case "$selecttype" in
13406 '') case "$d_select" in
13410 Checking to see what type of arguments are accepted by select().
13412 hdrs="$define sys/types.h
13413 $i_systime sys/time.h
13414 $i_sysselct sys/select.h
13415 $d_socket sys/socket.h"
13416 : The first arg can be int, unsigned, or size_t
13417 : The last arg may or may not be 'const'
13419 : void pointer has been seen but using that
13420 : breaks the selectminbits test
13421 for xxx in 'fd_set *' 'int *'; do
13422 for nfd in 'int' 'size_t' 'unsigned long' 'unsigned' ; do
13423 for tmo in 'struct timeval *' 'const struct timeval *'; do
13425 '') try="extern select _(($nfd, $xxx, $xxx, $xxx, $tmo));"
13426 if ./protochk "$try" $hdrs; then
13427 echo "Your system accepts $xxx."
13436 '') rp='What is the type for the 2nd, 3rd, and 4th arguments to select?'
13437 case "$d_fd_set" in
13438 $define) dflt="fd_set *" ;;
13447 *) : no select, so pick a harmless default
13454 : check for the select 'width'
13455 case "$selectminbits" in
13456 '') case "$d_select" in
13460 Checking to see on how many bits at a time your select() operates...
13463 #include <sys/types.h>
13465 #$i_systime I_SYS_TIME
13466 #$i_systimek I_SYS_TIME_KERNEL
13471 # ifdef I_SYS_TIME_KERNEL
13474 # include <sys/time.h>
13475 # ifdef I_SYS_TIME_KERNEL
13479 #$i_sysselct I_SYS_SELECT
13480 #ifdef I_SYS_SELECT
13481 #include <sys/select.h>
13483 #$d_socket HAS_SOCKET
13485 # include <sys/socket.h> /* Might include <sys/bsdtypes.h> */
13489 #define S sizeof(*(b))
13491 #define NBYTES (S * 8 > MINBITS ? S : MINBITS/8)
13492 #define NBITS (NBYTES * 8)
13501 fp = fopen("try.c", "r");
13507 b = ($selecttype)s;
13508 for (i = 0; i < NBITS; i++)
13512 select(fd + 1, b, 0, 0, &t);
13513 for (i = NBITS - 1; i > fd && FD_ISSET(i, b); i--);
13514 printf("%d\n", i + 1);
13519 if eval $compile_ok; then
13520 selectminbits=`./try`
13521 case "$selectminbits" in
13523 Cannot figure out on how many bits at a time your select() operates.
13524 I'll play safe and guess it is 32 bits.
13530 *) bits="$selectminbits bits" ;;
13532 echo "Your select() operates on $bits at a time." >&4
13534 rp='What is the minimum number of bits your select() operates on?'
13535 case "$byteorder" in
13536 1234|12345678) dflt=32 ;;
13541 selectminbits="$val"
13545 *) : no select, so pick a harmless default
13552 : Trace out the files included by signal.h, then look for SIGxxx names.
13553 : Remove SIGARRAYSIZE used by HPUX.
13554 : Remove SIGSTKSIZE used by Linux.
13555 : Remove SIGSTKSZ used by Posix.
13556 : Remove SIGTYP void lines used by OS2.
13557 : Some cpps, like os390, dont give the file name anywhere
13558 if [ "X$fieldn" = X ]; then
13559 : Just make some guesses. We check them later.
13560 xxx='/usr/include/signal.h /usr/include/sys/signal.h'
13562 xxx=`echo '#include <signal.h>' |
13563 $cppstdin $cppminus $cppflags 2>/dev/null |
13564 $grep '^[ ]*#.*include' |
13565 $awk "{print \\$$fieldn}" | $sed 's!"!!g' | $sort | $uniq`
13567 : Check this list of files to be sure we have parsed the cpp output ok.
13568 : This will also avoid potentially non-existent files, such
13571 for xx in $xxx /dev/null ; do
13572 $test -f "$xx" && xxxfiles="$xxxfiles $xx"
13574 : If we have found no files, at least try signal.h
13575 case "$xxxfiles" in
13576 '') xxxfiles=`./findhdr signal.h` ;;
13579 $1 ~ /^#define$/ && $2 ~ /^SIG[A-Z0-9]*$/ && $2 !~ /SIGARRAYSIZE/ && $2 !~ /SIGSTKSIZE/ && $2 !~ /SIGSTKSZ/ && $3 !~ /void/ {
13580 print substr($2, 4, 20)
13582 $1 == "#" && $2 ~ /^define$/ && $3 ~ /^SIG[A-Z0-9]*$/ && $3 !~ /SIGARRAYSIZE/ && $4 !~ /void/ {
13583 print substr($3, 4, 20)
13585 : Append some common names just in case the awk scan failed.
13586 xxx="$xxx ABRT ALRM BUS CANCEL CHLD CLD CONT DIL EMT FPE"
13587 xxx="$xxx FREEZE HUP ILL INT IO IOT KILL LOST LWP PHONE"
13588 xxx="$xxx PIPE POLL PROF PWR QUIT RTMAX RTMIN SEGV STKFLT STOP"
13589 xxx="$xxx SYS TERM THAW TRAP TSTP TTIN TTOU URG USR1 USR2"
13590 xxx="$xxx USR3 USR4 VTALRM WAITING WINCH WIND WINDOW XCPU XFSZ"
13592 : generate a few handy files for later
13593 $cat > signal.c <<'EOCP'
13594 #include <sys/types.h>
13595 #include <signal.h>
13599 /* Strange style to avoid deeply-nested #if/#else/#endif */
13602 # define NSIG (_NSIG)
13608 # define NSIG (SIGMAX+1)
13614 # define NSIG (SIG_MAX+1)
13620 # define NSIG (MAXSIG+1)
13626 # define NSIG (MAX_SIG+1)
13631 # ifdef SIGARRAYSIZE
13632 # define NSIG (SIGARRAYSIZE+1) /* Not sure of the +1 */
13638 # define NSIG (_sys_nsig) /* Solaris 2.5 */
13642 /* Default to some arbitrary number that's big enough to get most
13643 of the common signals.
13649 printf("NSIG %d\n", NSIG);
13655 echo $xxx | $tr ' ' $trnl | $sort | $uniq | $awk '
13657 printf "#ifdef SIG"; printf $1; printf "\n"
13658 printf "printf(\""; printf $1; printf " %%d\\n\",SIG";
13659 printf $1; printf ");\n"
13663 printf "#endif /* JUST_NSIG */\n";
13664 printf "exit(0);\n}\n";
13667 $cat >signal.awk <<'EOP'
13668 BEGIN { ndups = 0 }
13669 $1 ~ /^NSIG$/ { nsig = $2 }
13670 ($1 !~ /^NSIG$/) && (NF == 2) {
13671 if ($2 > maxsig) { maxsig = $2 }
13672 if (sig_name[$2]) {
13673 dup_name[ndups] = $1
13674 dup_num[ndups] = $2
13686 printf("NSIG %d\n", nsig);
13687 for (n = 1; n < nsig; n++) {
13689 printf("%s %d\n", sig_name[n], sig_num[n])
13692 printf("NUM%d %d\n", n, n)
13695 for (n = 0; n < ndups; n++) {
13696 printf("%s %d\n", dup_name[n], dup_num[n])
13700 $cat >signal_cmd <<EOS
13702 if $test -s signal.lst; then
13703 echo "Using your existing signal.lst file"
13708 $cat >>signal_cmd <<'EOS'
13711 if eval $compile_ok; then
13712 ./signal$_exe | $sort -n +1 | $uniq | $awk -f signal.awk >signal.lst
13714 echo "(I can't seem be able to compile the whole test program)" >&4
13715 echo "(I'll try it in little pieces.)" >&4
13716 set signal -DJUST_NSIG
13717 if eval $compile_ok; then
13718 ./signal$_exe > signal.nsg
13721 echo "I can't seem to figure out how many signals you have." >&4
13722 echo "Guessing 50." >&4
13723 echo 'NSIG 50' > signal.nsg
13725 : Now look at all the signal names, one at a time.
13726 for xx in `echo $xxx | $tr ' ' $trnl | $sort | $uniq`; do
13727 $cat > signal.c <<EOCP
13728 #include <sys/types.h>
13729 #include <signal.h>
13732 printf("$xx %d\n", SIG${xx});
13737 if eval $compile; then
13738 echo "SIG${xx} found."
13739 ./signal$_exe >> signal.ls1
13741 echo "SIG${xx} NOT found."
13744 if $test -s signal.ls1; then
13745 $cat signal.nsg signal.ls1 |
13746 $sort -n +1 | $uniq | $awk -f signal.awk >signal.lst
13750 if $test -s signal.lst; then
13753 echo "(AAK! I can't compile the test programs -- Guessing)" >&4
13754 echo 'kill -l' >signal
13755 set X `csh -f <signal`
13759 0) set HUP INT QUIT ILL TRAP ABRT EMT FPE KILL BUS SEGV SYS PIPE ALRM TERM;;
13761 echo $@ | $tr ' ' $trnl | \
13762 $awk '{ printf "%s %d\n", $1, ++s; }
13763 END { printf "NSIG %d\n", ++s }' >signal.lst
13765 $rm -f signal.c signal$_exe signal$_o signal.nsg signal.ls1
13767 chmod a+x signal_cmd
13768 $eunicefix signal_cmd
13770 : generate list of signal names
13772 case "$sig_name_init" in
13774 *) case "$sig_num_init" in
13775 ''|*,*) doinit=yes ;;
13780 echo "Generating a list of signal names and numbers..." >&4
13782 sig_count=`$awk '/^NSIG/ { printf "%d", $2 }' signal.lst`
13783 sig_name=`$awk 'BEGIN { printf "ZERO " }
13784 !/^NSIG/ { printf "%s ", $1 }' signal.lst`
13785 sig_num=`$awk 'BEGIN { printf "0 " }
13786 !/^NSIG/ { printf "%d ", $2 }' signal.lst`
13787 sig_name_init=`$awk 'BEGIN { printf "\"ZERO\", " }
13788 !/^NSIG/ { printf "\"%s\", ", $1 }
13789 END { printf "0\n" }' signal.lst`
13790 sig_num_init=`$awk 'BEGIN { printf "0, " }
13791 !/^NSIG/ { printf "%d, ", $2}
13792 END { printf "0\n"}' signal.lst`
13795 echo "The following $sig_count signals are available:"
13797 echo $sig_name | $awk \
13798 'BEGIN { linelen = 0 }
13800 for (i = 1; i <= NF; i++) {
13801 name = "SIG" $i " "
13802 linelen = linelen + length(name)
13803 if (linelen > 70) {
13805 linelen = length(name)
13811 $rm -f signal signal.c signal.awk signal.lst signal_cmd
13814 case "$sizetype" in
13815 *_t) zzz="$sizetype" ;;
13816 *) zzz="filesize" ;;
13818 echo "Checking the size of $zzz..." >&4
13820 #include <sys/types.h>
13823 printf("%d\n", (int)sizeof($sizetype));
13828 if eval $compile_ok; then
13832 echo "(I can't execute the test program--guessing $sizesize.)" >&4
13835 echo "Your $zzz size is $sizesize bytes."
13840 echo "(I can't compile the test program--guessing $sizesize.)" >&4
13844 : check for socklen_t
13846 echo "Checking to see if you have socklen_t..." >&4
13848 #include <sys/types.h>
13849 #$d_socket HAS_SOCKET
13851 #include <sys/socket.h>
13853 int main() { socklen_t x = 16; }
13856 if eval $compile; then
13858 echo "You have socklen_t."
13861 echo "You do not have socklen_t."
13862 case "$sizetype" in
13863 size_t) echo "(You do have size_t, that might work. Some people are happy with just an int.)" ;;
13870 : check for type of the size argument to socket calls
13871 case "$d_socket" in
13875 Checking to see what type is the last argument of accept().
13877 hdrs="$define sys/types.h $d_socket sys/socket.h"
13879 case "$d_socklen_t" in
13880 "$define") yyy="$yyy socklen_t"
13882 yyy="$yyy $sizetype int long unsigned"
13883 for xxx in $yyy; do
13884 case "$socksizetype" in
13885 '') try="extern int accept(int, struct sockaddr *, $xxx *);"
13886 if ./protochk "$try" $hdrs; then
13887 echo "Your system accepts '$xxx *' for the last argument of accept()."
13888 socksizetype="$xxx"
13893 : In case none of those worked, prompt the user.
13894 case "$socksizetype" in
13895 '') rp='What is the type for socket address structure sizes?'
13902 *) : no sockets, so pick relatively harmless default
13907 : see what type is used for signed size_t
13908 set ssize_t ssizetype int stdio.h sys/types.h
13911 $cat > ssize.c <<EOM
13913 #include <sys/types.h>
13914 #define Size_t $sizetype
13915 #define SSize_t $dflt
13918 if (sizeof(Size_t) == sizeof(SSize_t))
13920 else if (sizeof(Size_t) == sizeof(int))
13929 if eval $compile_ok && ./ssize > /dev/null; then
13930 ssizetype=`./ssize`
13931 echo "I'll be using $ssizetype for functions returning a byte count." >&4
13934 Help! I can't compile and run the ssize_t test program: please enlighten me!
13935 (This is probably a misconfiguration in your system or libraries, and
13936 you really ought to fix it. Still, I'll try anyway.)
13938 I need a type that is the same size as $sizetype, but is guaranteed to
13939 be signed. Common values are ssize_t, int and long.
13942 rp="What signed type is the same size as $sizetype?"
13946 $rm -f ssize ssize.*
13948 : see what type of char stdio uses.
13950 if $contains 'unsigned.*char.*_ptr;' `./findhdr stdio.h` >/dev/null 2>&1 ; then
13951 echo "Your stdio uses unsigned chars." >&4
13952 stdchar="unsigned char"
13954 echo "Your stdio uses signed chars." >&4
13958 : see if time exists
13960 if test "X$d_time" = X -o X"$timetype" = X; then
13961 if set time val -f d_time; eval $csym; $val; then
13962 echo 'time() found.' >&4
13964 rp="What is the type returned by time() on this system?"
13965 set time_t timetype long stdio.h sys/types.h
13968 echo 'time() not found, hope that will do.' >&4
13976 : see what type uids are declared as in the kernel
13978 echo "Looking for the type for user ids returned by getuid()."
13979 set uid_t uidtype xxx stdio.h sys/types.h
13983 xxx=`./findhdr sys/user.h`
13984 set `grep '_ruid;' "$xxx" 2>/dev/null` unsigned short
13986 unsigned) dflt="$1 $2" ;;
13990 *) dflt="$uidtype";;
13993 uid_t) echo "uid_t found." ;;
13994 *) rp="What is the type for user ids returned by getuid()?"
14002 *_t) zzz="$uidtype" ;;
14005 echo "Checking the size of $zzz..." >&4
14007 #include <sys/types.h>
14010 printf("%d\n", (int)sizeof($uidtype));
14015 if eval $compile_ok; then
14019 echo "(I can't execute the test program--guessing $uidsize.)" >&4
14022 echo "Your $zzz is $uidsize bytes long."
14027 echo "(I can't compile the test program--guessing $uidsize.)" >&4
14032 *_t) zzz="$uidtype" ;;
14035 echo "Checking the sign of $zzz..." >&4
14037 #include <sys/types.h>
14048 if eval $compile; then
14052 echo "(I can't execute the test program--guessing unsigned.)" >&4
14056 1) echo "Your $zzz is unsigned." ;;
14057 -1) echo "Your $zzz is signed." ;;
14063 echo "(I can't compile the test program--guessing unsigned.)" >&4
14069 $echo "Checking the format string to be used for uids..." >&4
14072 -1) if $test X"$uidsize" = X"$ivsize"; then
14073 uidformat="$ivdformat"
14075 if $test X"$uidsize" = X"$longsize"; then
14078 if $test X"$uidsize" = X"$intsize"; then
14081 if $test X"$uidsize" = X"$shortsize"; then
14088 *) if $test X"$uidsize" = X"$uvsize"; then
14089 uidformat="$uvuformat"
14091 if $test X"$uidsize" = X"$longsize"; then
14094 if $test X"$uidsize" = X"$intsize"; then
14097 if $test X"$uidsize" = X"$shortsize"; then
14106 : see if dbm.h is available
14107 : see if dbmclose exists
14108 set dbmclose d_dbmclose
14111 case "$d_dbmclose" in
14121 *) set rpcsvc/dbm.h i_rpcsvcdbm
14126 *) echo "We won't be including <dbm.h>"
14136 : see if this is a sys/file.h system
14141 : do we need to include sys/file.h ?
14145 if $h_sysfile; then
14147 echo "We'll be including <sys/file.h>." >&4
14150 echo "We won't be including <sys/file.h>." >&4
14160 : see if fcntl.h is there
14165 : see if we can include fcntl.h
14171 echo "We'll be including <fcntl.h>." >&4
14174 if $h_sysfile; then
14175 echo "We don't need to include <fcntl.h> if we include <sys/file.h>." >&4
14177 echo "We won't be including <fcntl.h>." >&4
14189 : see if this is a iconv.h system
14190 set iconv.h i_iconv
14193 : see if this is a ieeefp.h system
14194 set ieeefp.h i_ieeefp
14197 : see if locale.h is available
14198 set locale.h i_locale
14201 : see if mach cthreads are available
14202 if test "X$usethreads" = "X$define"; then
14203 set mach/cthreads.h i_machcthr
14206 i_machcthr="$undef"
14211 : see if this is a math.h system
14215 : see if this is a mntent.h system
14216 set mntent.h i_mntent
14219 : see if ndbm.h is available
14224 : see if dbm_open exists
14225 set dbm_open d_dbm_open
14227 case "$d_dbm_open" in
14230 echo "We won't be including <ndbm.h>"
14239 : see if net/errno.h is available
14241 set net/errno.h val
14244 : Unfortunately, it causes problems on some systems. Arrgh.
14247 cat > try.c <<'EOM'
14250 #include <net/errno.h>
14256 if $cc $ccflags -c try.c >/dev/null 2>&1; then
14257 echo "We'll be including <net/errno.h>." >&4
14259 echo "We won't be including <net/errno.h>." >&4
14268 : see if netinet/tcp.h is available
14269 set netinet/tcp.h i_netinettcp
14272 : see if this is a poll.h system
14277 $echo "Guessing which symbols your C compiler and preprocessor define..." >&4
14278 $cat <<'EOSH' > Cppsym.know
14279 a29k ABI64 aegis AES_SOURCE AIX AIX32 AIX370
14280 AIX41 AIX42 AIX43 AIX_SOURCE aixpc ALL_SOURCE
14281 alliant alpha am29000 AM29000 amiga AMIGAOS AMIX
14282 ansi ANSI_C_SOURCE apollo ardent atarist att386 att3b BeOS
14283 BIG_ENDIAN BIT_MSF bsd BSD bsd43 bsd4_2 bsd4_3 BSD4_3 bsd4_4
14284 BSD_4_3 BSD_4_4 BSD_NET2 BSD_TIME BSD_TYPES BSDCOMPAT bsdi
14285 bull c cadmus clipper CMU COFF COMPILER_VERSION
14286 concurrent convex cpu cray CRAY CRAYMPP ctix CX_UX
14287 CYGWIN DGUX DGUX_SOURCE DJGPP dmert DOLPHIN DPX2 DSO
14288 Dynix DynixPTX ELF encore EPI EXTENSIONS FILE_OFFSET_BITS
14289 FreeBSD GCC_NEW_VARARGS gcos gcx gimpel
14290 GNU_SOURCE GNUC GNUC_MINOR GO32 gould GOULD_PN
14291 H3050R H3050RX hbullx20 hcx host_mips
14292 hp200 hp300 hp700 HP700 hp800 hp9000
14293 hp9000s200 hp9000s300 hp9000s400 hp9000s500
14294 hp9000s700 hp9000s800 hp9k8 hp_osf hppa hpux HPUX_SOURCE
14295 i186 i286 i386 i486 i586 i686 i8086 i80960 i860 I960
14296 iAPX286 ibm ibm032 ibmesa IBMR2 ibmrt ILP32 ILP64
14297 INLINE_INTRINSICS INTRINSICS INT64 interdata is68k ksr1
14298 LANGUAGE_C LARGE_FILE_API LARGEFILE64_SOURCE
14299 LARGEFILE_SOURCE LFS64_LARGEFILE LFS_LARGEFILE
14300 Linux LITTLE_ENDIAN LONG64 LONG_DOUBLE LONG_LONG
14301 LONGDOUBLE LONGLONG LP64 luna luna88k Lynx
14302 M68000 m68k m88100 m88k M88KBCS_TARGET M_COFF
14303 M_I186 M_I286 M_I386 M_I8086 M_I86 M_I86SM M_SYS3
14304 M_SYS5 M_SYSIII M_SYSV M_UNIX M_XENIX MACH machine MachTen
14305 MATH_HAS_NO_SIDE_EFFECTS
14306 mc300 mc500 mc68000 mc68010 mc68020 mc68030 mc68040
14307 mc68060 mc68k mc68k32 mc700 mc88000 mc88100 merlin
14308 mert MiNT mips MIPS_FPSET MIPS_ISA MIPS_SIM MIPS_SZINT
14309 MIPS_SZLONG MIPS_SZPTR MIPSEB MIPSEL MODERN_C motorola
14310 mpeix MSDOS MTXINU MULTIMAX mvs MVS n16 ncl_el ncl_mr
14311 NetBSD news1500 news1700 news1800 news1900 news3700
14312 news700 news800 news900 NeXT NLS ns16000 ns32000
14313 ns32016 ns32332 ns32k nsc32000
14314 OCS88 OEMVS OpenBSD os OS2 OS390 osf OSF1 OSF_SOURCE
14315 pa_risc PA_RISC1_1 PA_RISC2_0 PARAGON parisc
14316 pc532 pdp11 PGC PIC plexus PORTAR posix
14317 POSIX1B_SOURCE POSIX2_SOURCE POSIX4_SOURCE
14318 POSIX_C_SOURCE POSIX_SOURCE POWER
14319 PROTOTYPES PWB pyr QNX R3000 REENTRANT RES Rhapsody RISC6000
14320 riscix riscos RT scs SCO sequent sgi SGI_SOURCE sinix
14321 SIZE_INT SIZE_LONG SIZE_PTR SOCKET_SOURCE SOCKETS_SOURCE
14322 sony sony_news sonyrisc sparc sparclite spectrum
14323 stardent stdc STDC_EXT stratos sun sun3 sun386
14324 Sun386i svr3 svr4 SVR4_2 SVR4_SOURCE svr5
14325 SX system SYSTYPE_BSD SYSTYPE_BSD43 SYSTYPE_BSD44
14326 SYSTYPE_SVR4 SYSTYPE_SVR5 SYSTYPE_SYSV SYSV SYSV3 SYSV4 SYSV5
14327 sysV68 sysV88 Tek4132 Tek4300 titan
14328 tower tower32 tower32_200 tower32_600 tower32_700
14329 tower32_800 tower32_850 tss
14330 u370 u3b u3b2 u3b20 u3b200 u3b20d u3b5
14331 ultrix UMAXV UnicomPBB UnicomPBD UNICOS UNICOSMK
14332 unix UNIX95 UNIX99 unixpc unos USGr4 USGr4_2
14333 Utek UTek UTS UWIN uxpm uxps vax venix VMESA vms xenix Xenix286
14334 XOPEN_SOURCE XOPEN_SOURCE_EXTENDED XPG2 XPG2_EXTENDED
14335 XPG3 XPG3_EXTENDED XPG4 XPG4_EXTENDED
14338 # Maybe put other stuff here too.
14339 cat <<EOSH >>Cppsym.know
14342 ./tr '[a-z]' '[A-Z]' < Cppsym.know > Cppsym.a
14343 ./tr '[A-Z]' '[a-z]' < Cppsym.know > Cppsym.b
14344 $cat Cppsym.a Cppsym.b | $tr ' ' $trnl | sort | uniq > Cppsym.know
14345 $rm -f Cppsym.a Cppsym.b
14346 cat <<EOSH > Cppsym
14348 if $test \$# -gt 0; then
14349 echo \$* | $tr " " "$trnl" | ./Cppsym.try > Cppsym.got
14350 if $test -s Cppsym.got; then
14357 $tr " " "$trnl" | ./Cppsym.try
14363 cat <<EOSH > Cppsym.try
14365 cat <<'EOCP' > try.c
14371 cat <<'EOSH' >> Cppsym.try
14373 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
14374 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
14375 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
14376 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
14380 cat <<EOSH >> Cppsym.try
14382 case "$osname-$gccversion" in
14383 irix-) ccflags="\$ccflags -woff 1178" ;;
14385 $cc $optimize \$ccflags $ldflags -o try try.c $libs && ./try$exe_ext
14387 chmod +x Cppsym.try
14388 $eunicefix Cppsym.try
14389 ./Cppsym < Cppsym.know > Cppsym.true
14390 : now check the C compiler for additional symbols
14391 postprocess_cc_v=''
14393 aix) postprocess_cc_v="|$tr , ' '" ;;
14400 for i in \`$cc -v -c tmp.c 2>&1 $postprocess_cc_v\`
14403 -D*) echo "\$i" | $sed 's/^-D//';;
14404 -A*) $test "$gccversion" && echo "\$i" | $sed 's/^-A\(.*\)(\(.*\))/\1=\2/';;
14409 postprocess_cc_v=''
14412 ./ccsym > ccsym1.raw
14413 if $test -s ccsym1.raw; then
14414 $sort ccsym1.raw | $uniq >ccsym.raw
14416 mv ccsym1.raw ccsym.raw
14419 $awk '/\=/ { print $0; next }
14420 { print $0"=1" }' ccsym.raw >ccsym.list
14421 $awk '/\=/ { print $0; next }
14422 { print $0"=1" }' Cppsym.true >ccsym.true
14423 $comm -13 ccsym.true ccsym.list >ccsym.own
14424 $comm -12 ccsym.true ccsym.list >ccsym.com
14425 $comm -23 ccsym.true ccsym.list >ccsym.cpp
14427 if $test -z ccsym.raw; then
14428 echo "Your C compiler doesn't seem to define any symbols!" >&4
14430 echo "However, your C preprocessor defines the following symbols:"
14433 cppsymbols=`$cat Cppsym.true`
14434 cppsymbols=`echo $cppsymbols`
14435 cppccsymbols="$cppsymbols"
14437 if $test -s ccsym.com; then
14438 echo "Your C compiler and pre-processor define these symbols:"
14439 $sed -e 's/\(.*\)=.*/\1/' ccsym.com
14442 cppccsymbols=`$cat ccsym.com`
14443 cppccsymbols=`echo $cppccsymbols`
14444 $test "$silent" || sleep 1
14446 if $test -s ccsym.cpp; then
14447 $test "$also" && echo " "
14448 echo "Your C pre-processor ${also}defines the following symbols:"
14449 $sed -e 's/\(.*\)=.*/\1/' ccsym.cpp
14451 cppsymbols=`$cat ccsym.cpp`
14452 cppsymbols=`echo $cppsymbols`
14453 $test "$silent" || sleep 1
14455 if $test -s ccsym.own; then
14456 $test "$also" && echo " "
14457 echo "Your C compiler ${also}defines the following cpp symbols:"
14458 $sed -e 's/\(.*\)=1/\1/' ccsym.own
14459 $sed -e 's/\(.*\)=.*/\1/' ccsym.own | $uniq >>Cppsym.true
14460 ccsymbols=`$cat ccsym.own`
14461 ccsymbols=`echo $ccsymbols`
14462 $test "$silent" || sleep 1
14467 : see if this is a termio system
14471 if $test `./findhdr termios.h`; then
14472 set tcsetattr i_termios
14478 "$define") echo "You have POSIX termios.h... good!" >&4;;
14479 *) if ./Cppsym pyr; then
14480 case "`/bin/universe`" in
14481 ucb) if $test `./findhdr sgtty.h`; then
14483 echo "<sgtty.h> found." >&4
14485 echo "System is pyramid with BSD universe."
14486 echo "<sgtty.h> not found--you could have problems." >&4
14488 *) if $test `./findhdr termio.h`; then
14490 echo "<termio.h> found." >&4
14492 echo "System is pyramid with USG universe."
14493 echo "<termio.h> not found--you could have problems." >&4
14497 if $test `./findhdr termio.h`; then
14498 echo "<termio.h> found." >&4
14500 elif $test `./findhdr sgtty.h`; then
14501 echo "<sgtty.h> found." >&4
14504 echo "Neither <termio.h> nor <sgtty.h> found--you could have problems." >&4
14507 if $test `./findhdr sgtty.h`; then
14508 echo "<sgtty.h> found." >&4
14510 elif $test `./findhdr termio.h`; then
14511 echo "<termio.h> found." >&4
14514 echo "Neither <sgtty.h> nor <termio.h> found--you could have problems." >&4
14518 set i_termio; eval $setvar
14519 val=$val2; set i_sgtty; eval $setvar
14520 val=$val3; set i_termios; eval $setvar
14522 : see if this is a shadow.h system
14523 set shadow.h i_shadow
14526 : see if this is a socks.h system
14527 set socks.h i_socks
14530 : see if stdarg is available
14532 if $test `./findhdr stdarg.h`; then
14533 echo "<stdarg.h> found." >&4
14536 echo "<stdarg.h> NOT found." >&4
14540 : see if varags is available
14542 if $test `./findhdr varargs.h`; then
14543 echo "<varargs.h> found." >&4
14545 echo "<varargs.h> NOT found, but that's ok (I hope)." >&4
14548 : set up the varargs testing programs
14549 $cat > varargs.c <<EOP
14551 #include <stdarg.h>
14554 #include <varargs.h>
14558 int f(char *p, ...)
14572 p = va_arg(ap, char *);
14577 $cat > varargs <<EOP
14579 if $cc -c $ccflags -D\$1 varargs.c >/dev/null 2>&1; then
14588 : now check which varargs header should be included
14593 if `./varargs I_STDARG`; then
14595 elif `./varargs I_VARARGS`; then
14600 if `./varargs I_VARARGS`; then
14607 echo "I could not find the definition for va_dcl... You have problems..." >&4
14608 val="$undef"; set i_stdarg; eval $setvar
14609 val="$undef"; set i_varargs; eval $setvar
14614 case "$i_varhdr" in
14616 val="$define"; set i_stdarg; eval $setvar
14617 val="$undef"; set i_varargs; eval $setvar
14620 val="$undef"; set i_stdarg; eval $setvar
14621 val="$define"; set i_varargs; eval $setvar
14624 echo "We'll include <$i_varhdr> to get va_dcl definition." >&4;;
14628 : see if stddef is available
14629 set stddef.h i_stddef
14632 : see if this is a sunmath.h system
14633 set sunmath.h i_sunmath
14636 : see if sys/access.h is available
14637 set sys/access.h i_sysaccess
14640 : see if ioctl defs are in sgtty, termio, sys/filio or sys/ioctl
14641 set sys/filio.h i_sysfilio
14644 if $test `./findhdr sys/ioctl.h`; then
14646 echo '<sys/ioctl.h> found.' >&4
14649 if $test $i_sysfilio = "$define"; then
14650 echo '<sys/ioctl.h> NOT found.' >&4
14652 $test $i_sgtty = "$define" && xxx="sgtty.h"
14653 $test $i_termio = "$define" && xxx="termio.h"
14654 $test $i_termios = "$define" && xxx="termios.h"
14655 echo "No <sys/ioctl.h> found, assuming ioctl args are defined in <$xxx>." >&4
14662 : see if this is a syslog.h system
14663 set syslog.h i_syslog
14667 : see if this is a sys/mode.h system
14668 set sys/mode.h i_sysmode
14671 : see if sys/resource.h has to be included
14672 set sys/resource.h i_sysresrc
14675 : see if sys/security.h is available
14676 set sys/security.h i_syssecrt
14679 : see if this is a sys/statvfs.h system
14680 set sys/statvfs.h i_sysstatvfs
14683 : see if this is a sys/uio.h system
14684 set sys/uio.h i_sysuio
14687 : see if this is a sys/un.h system
14688 set sys/un.h i_sysun
14692 : see if this is a sys/utsname.h system
14693 set sys/utsname.h i_sysutsname
14696 : see if this is a syswait system
14697 set sys/wait.h i_syswait
14700 : see if this is a ustat.h system
14701 set ustat.h i_ustat
14704 : see if this is an utime system
14705 set utime.h i_utime
14708 : see if this is a values.h system
14709 set values.h i_values
14712 : see if this is a vfork system
14715 set vfork.h i_vfork
14723 : see if gdbm.h is available
14728 : see if gdbm_open exists
14729 set gdbm_open d_gdbm_open
14731 case "$d_gdbm_open" in
14734 echo "We won't be including <gdbm.h>"
14744 echo "Looking for extensions..." >&4
14745 : If we are using the old config.sh, known_extensions may contain
14746 : old or inaccurate or duplicate values.
14747 known_extensions=''
14748 nonxs_extensions=''
14749 : We do not use find because it might not be available.
14750 : We do not just use MANIFEST because the user may have dropped
14751 : some additional extensions into the source tree and expect them
14754 : Function to recursively find available extensions, ignoring DynaLoader
14755 : NOTE: recursion limit of 10 to prevent runaway in case of symlink madness
14759 DynaLoader|dynaload) ;;
14761 if $test -f $xxx/$xxx.xs; then
14762 known_extensions="$known_extensions $1$xxx";
14763 elif $test -f $xxx/Makefile.PL; then
14764 nonxs_extensions="$nonxs_extensions $1$xxx";
14766 if $test -d $xxx -a $# -lt 10; then
14769 eval $find_extensions;
14781 eval $find_extensions
14782 set X $nonxs_extensions
14784 nonxs_extensions="$*"
14785 set X $known_extensions
14787 known_extensions="$*"
14790 : Now see which are supported on this system.
14792 for xxx in $known_extensions ; do
14796 $define) avail_ext="$avail_ext $xxx" ;;
14799 GDBM_File|gdbm_fil)
14801 $define) avail_ext="$avail_ext $xxx" ;;
14804 NDBM_File|ndbm_fil)
14807 case "$osname-$use64bitint" in
14810 *-lndbm*) avail_ext="$avail_ext $xxx" ;;
14813 *) avail_ext="$avail_ext $xxx" ;;
14818 ODBM_File|odbm_fil)
14819 case "${i_dbm}${i_rpcsvcdbm}" in
14821 case "$osname-$use64bitint" in
14824 *-ldbm*) avail_ext="$avail_ext $xxx" ;;
14827 *) avail_ext="$avail_ext $xxx" ;;
14833 case "$useposix" in
14834 true|define|y) avail_ext="$avail_ext $xxx" ;;
14838 case "$useopcode" in
14839 true|define|y) avail_ext="$avail_ext $xxx" ;;
14843 case "$d_socket" in
14844 true|$define|y) avail_ext="$avail_ext $xxx" ;;
14848 case "$usethreads" in
14849 true|$define|y) avail_ext="$avail_ext $xxx" ;;
14853 : XXX Do we need a useipcsysv variable here
14854 case "${d_msg}${d_sem}${d_shm}" in
14855 *"${define}"*) avail_ext="$avail_ext $xxx" ;;
14858 *) avail_ext="$avail_ext $xxx"
14867 : Now see which nonxs extensions are supported on this system.
14868 : For now assume all are.
14870 for xxx in $nonxs_extensions ; do
14872 *) nonxs_ext="$nonxs_ext $xxx"
14884 A number of extensions are supplied with $package. You may choose to
14885 compile these extensions for dynamic loading (the default), compile
14886 them into the $package executable (static loading), or not include
14887 them at all. Answer "none" to include no extensions.
14888 Note that DynaLoader is always built and need not be mentioned here.
14891 case "$dynamic_ext" in
14892 '') dflt="$avail_ext" ;;
14893 *) dflt="$dynamic_ext"
14894 # Perhaps we are reusing an old out-of-date config.sh.
14897 if test X"$dynamic_ext" != X"$avail_ext"; then
14899 NOTICE: Your previous config.sh list may be incorrect.
14900 The extensions now available to you are
14902 but the default list from your previous config.sh is
14914 rp="What extensions do you wish to load dynamically?"
14917 none) dynamic_ext=' ' ;;
14918 *) dynamic_ext="$ans" ;;
14921 case "$static_ext" in
14923 : Exclude those already listed in dynamic linking
14925 for xxx in $avail_ext; do
14926 case " $dynamic_ext " in
14928 *) dflt="$dflt $xxx" ;;
14935 *) dflt="$static_ext"
14942 rp="What extensions do you wish to load statically?"
14945 none) static_ext=' ' ;;
14946 *) static_ext="$ans" ;;
14951 A number of extensions are supplied with $package. Answer "none"
14952 to include no extensions.
14953 Note that DynaLoader is always built and need not be mentioned here.
14956 case "$static_ext" in
14957 '') dflt="$avail_ext" ;;
14958 *) dflt="$static_ext"
14959 # Perhaps we are reusing an old out-of-date config.sh.
14962 if test X"$static_ext" != X"$avail_ext"; then
14964 NOTICE: Your previous config.sh list may be incorrect.
14965 The extensions now available to you are
14967 but the default list from your previous config.sh is
14976 : Exclude those that are not xs extensions
14980 rp="What extensions do you wish to include?"
14983 none) static_ext=' ' ;;
14984 *) static_ext="$ans" ;;
14989 set X $dynamic_ext $static_ext $nonxs_ext
14993 : Remove build directory name from cppstdin so it can be used from
14994 : either the present location or the final installed location.
14996 : Get out of the UU directory to get correct path name.
14998 case "$cppstdin" in
15000 echo "Stripping down cppstdin path name"
15006 : end of configuration questions
15008 echo "End of configuration questions."
15011 : back to where it started
15012 if test -d ../UU; then
15016 : configuration may be patched via a 'config.over' file
15017 if $test -f config.over; then
15020 rp='I see a config.over file. Do you wish to load it?'
15023 n*) echo "OK, I'll ignore it.";;
15025 echo "Configuration override changes have been loaded."
15030 : in case they want portability, strip down executable paths
15031 case "$d_portable" in
15034 echo "Stripping down executable paths..." >&4
15035 for file in $loclist $trylist; do
15037 eval $file=`basename $temp`
15042 : create config.sh file
15044 echo "Creating config.sh..." >&4
15045 $spitshell <<EOT >config.sh
15048 # This file was produced by running the Configure script. It holds all the
15049 # definitions figured out by Configure. Should you modify one of these values,
15050 # do not forget to propagate your changes by running "Configure -der". You may
15051 # instead choose to run each of the .SH files by yourself, or "Configure -S".
15054 # Package name : $package
15055 # Source directory : $src
15056 # Configuration time: $cf_time
15057 # Configured by : $cf_by
15058 # Target system : $myuname
15068 Revision='$Revision'
15075 alignbytes='$alignbytes'
15076 ansi2knr='$ansi2knr'
15077 aphostname='$aphostname'
15078 api_revision='$api_revision'
15079 api_subversion='$api_subversion'
15080 api_version='$api_version'
15081 api_versionstring='$api_versionstring'
15084 archlibexp='$archlibexp'
15085 archname64='$archname64'
15086 archname='$archname'
15087 archobjs='$archobjs'
15092 bincompat5005='$bincompat5005'
15096 byteorder='$byteorder'
15098 castflags='$castflags'
15101 cccdlflags='$cccdlflags'
15102 ccdlflags='$ccdlflags'
15104 ccsymbols='$ccsymbols'
15106 cf_email='$cf_email'
15108 charsize='$charsize'
15112 clocktype='$clocktype'
15114 compress='$compress'
15115 contains='$contains'
15119 cpp_stuff='$cpp_stuff'
15120 cppccsymbols='$cppccsymbols'
15121 cppflags='$cppflags'
15123 cppminus='$cppminus'
15125 cppstdin='$cppstdin'
15126 cppsymbols='$cppsymbols'
15127 crosscompile='$crosscompile'
15128 cryptlib='$cryptlib'
15130 d_Gconvert='$d_Gconvert'
15131 d_PRIEldbl='$d_PRIEldbl'
15132 d_PRIFldbl='$d_PRIFldbl'
15133 d_PRIGldbl='$d_PRIGldbl'
15134 d_PRIX64='$d_PRIX64'
15135 d_PRId64='$d_PRId64'
15136 d_PRIeldbl='$d_PRIeldbl'
15137 d_PRIfldbl='$d_PRIfldbl'
15138 d_PRIgldbl='$d_PRIgldbl'
15139 d_PRIi64='$d_PRIi64'
15140 d_PRIo64='$d_PRIo64'
15141 d_PRIu64='$d_PRIu64'
15142 d_PRIx64='$d_PRIx64'
15143 d_access='$d_access'
15144 d_accessx='$d_accessx'
15146 d_archlib='$d_archlib'
15149 d_attribut='$d_attribut'
15152 d_bincompat5005='$d_bincompat5005'
15154 d_bsdgetpgrp='$d_bsdgetpgrp'
15155 d_bsdsetpgrp='$d_bsdsetpgrp'
15157 d_casti32='$d_casti32'
15158 d_castneg='$d_castneg'
15159 d_charvspr='$d_charvspr'
15161 d_chroot='$d_chroot'
15162 d_chsize='$d_chsize'
15163 d_closedir='$d_closedir'
15167 d_cuserid='$d_cuserid'
15168 d_dbl_dig='$d_dbl_dig'
15169 d_difftime='$d_difftime'
15170 d_dirnamlen='$d_dirnamlen'
15171 d_dlerror='$d_dlerror'
15172 d_dlopen='$d_dlopen'
15173 d_dlsymun='$d_dlsymun'
15174 d_dosuid='$d_dosuid'
15175 d_drand48proto='$d_drand48proto'
15177 d_eaccess='$d_eaccess'
15178 d_endgrent='$d_endgrent'
15179 d_endhent='$d_endhent'
15180 d_endnent='$d_endnent'
15181 d_endpent='$d_endpent'
15182 d_endpwent='$d_endpwent'
15183 d_endsent='$d_endsent'
15184 d_endspent='$d_endspent'
15185 d_eofnblk='$d_eofnblk'
15186 d_eunice='$d_eunice'
15187 d_fchmod='$d_fchmod'
15188 d_fchown='$d_fchown'
15190 d_fd_macros='$d_fd_macros'
15191 d_fd_set='$d_fd_set'
15192 d_fds_bits='$d_fds_bits'
15193 d_fgetpos='$d_fgetpos'
15194 d_flexfnam='$d_flexfnam'
15197 d_fpathconf='$d_fpathconf'
15198 d_fpos64_t='$d_fpos64_t'
15199 d_frexpl='$d_frexpl'
15200 d_fs_data_s='$d_fs_data_s'
15201 d_fseeko='$d_fseeko'
15202 d_fsetpos='$d_fsetpos'
15203 d_fstatfs='$d_fstatfs'
15204 d_fstatvfs='$d_fstatvfs'
15205 d_ftello='$d_ftello'
15207 d_getcwd='$d_getcwd'
15208 d_getfsstat='$d_getfsstat'
15209 d_getgrent='$d_getgrent'
15210 d_getgrps='$d_getgrps'
15211 d_gethbyaddr='$d_gethbyaddr'
15212 d_gethbyname='$d_gethbyname'
15213 d_gethent='$d_gethent'
15214 d_gethname='$d_gethname'
15215 d_gethostprotos='$d_gethostprotos'
15216 d_getlogin='$d_getlogin'
15217 d_getmnt='$d_getmnt'
15218 d_getmntent='$d_getmntent'
15219 d_getnbyaddr='$d_getnbyaddr'
15220 d_getnbyname='$d_getnbyname'
15221 d_getnent='$d_getnent'
15222 d_getnetprotos='$d_getnetprotos'
15223 d_getpbyname='$d_getpbyname'
15224 d_getpbynumber='$d_getpbynumber'
15225 d_getpent='$d_getpent'
15226 d_getpgid='$d_getpgid'
15227 d_getpgrp2='$d_getpgrp2'
15228 d_getpgrp='$d_getpgrp'
15229 d_getppid='$d_getppid'
15230 d_getprior='$d_getprior'
15231 d_getprotoprotos='$d_getprotoprotos'
15232 d_getpwent='$d_getpwent'
15233 d_getsbyname='$d_getsbyname'
15234 d_getsbyport='$d_getsbyport'
15235 d_getsent='$d_getsent'
15236 d_getservprotos='$d_getservprotos'
15237 d_getspent='$d_getspent'
15238 d_getspnam='$d_getspnam'
15239 d_gettimeod='$d_gettimeod'
15240 d_gnulibc='$d_gnulibc'
15241 d_grpasswd='$d_grpasswd'
15242 d_hasmntopt='$d_hasmntopt'
15246 d_inetaton='$d_inetaton'
15247 d_int64_t='$d_int64_t'
15248 d_isascii='$d_isascii'
15250 d_isnanl='$d_isnanl'
15251 d_killpg='$d_killpg'
15252 d_lchown='$d_lchown'
15253 d_ldbl_dig='$d_ldbl_dig'
15255 d_locconv='$d_locconv'
15257 d_longdbl='$d_longdbl'
15258 d_longlong='$d_longlong'
15259 d_lseekproto='$d_lseekproto'
15261 d_madvise='$d_madvise'
15263 d_mbstowcs='$d_mbstowcs'
15264 d_mbtowc='$d_mbtowc'
15265 d_memchr='$d_memchr'
15266 d_memcmp='$d_memcmp'
15267 d_memcpy='$d_memcpy'
15268 d_memmove='$d_memmove'
15269 d_memset='$d_memset'
15271 d_mkdtemp='$d_mkdtemp'
15272 d_mkfifo='$d_mkfifo'
15273 d_mkstemp='$d_mkstemp'
15274 d_mkstemps='$d_mkstemps'
15275 d_mktime='$d_mktime'
15278 d_mprotect='$d_mprotect'
15280 d_msg_ctrunc='$d_msg_ctrunc'
15281 d_msg_dontroute='$d_msg_dontroute'
15282 d_msg_oob='$d_msg_oob'
15283 d_msg_peek='$d_msg_peek'
15284 d_msg_proxy='$d_msg_proxy'
15285 d_msgctl='$d_msgctl'
15286 d_msgget='$d_msgget'
15287 d_msgrcv='$d_msgrcv'
15288 d_msgsnd='$d_msgsnd'
15290 d_munmap='$d_munmap'
15291 d_mymalloc='$d_mymalloc'
15293 d_nv_preserves_uv='$d_nv_preserves_uv'
15294 d_off64_t='$d_off64_t'
15295 d_old_pthread_create_joinable='$d_old_pthread_create_joinable'
15296 d_oldpthreads='$d_oldpthreads'
15297 d_oldsock='$d_oldsock'
15299 d_pathconf='$d_pathconf'
15301 d_phostname='$d_phostname'
15304 d_portable='$d_portable'
15305 d_pthread_yield='$d_pthread_yield'
15307 d_pwchange='$d_pwchange'
15308 d_pwclass='$d_pwclass'
15309 d_pwcomment='$d_pwcomment'
15310 d_pwexpire='$d_pwexpire'
15311 d_pwgecos='$d_pwgecos'
15312 d_pwpasswd='$d_pwpasswd'
15313 d_pwquota='$d_pwquota'
15316 d_readdir='$d_readdir'
15317 d_readlink='$d_readlink'
15318 d_rename='$d_rename'
15319 d_rewinddir='$d_rewinddir'
15321 d_safebcpy='$d_safebcpy'
15322 d_safemcpy='$d_safemcpy'
15323 d_sanemcmp='$d_sanemcmp'
15324 d_sched_yield='$d_sched_yield'
15325 d_scm_rights='$d_scm_rights'
15326 d_seekdir='$d_seekdir'
15327 d_select='$d_select'
15329 d_semctl='$d_semctl'
15330 d_semctl_semid_ds='$d_semctl_semid_ds'
15331 d_semctl_semun='$d_semctl_semun'
15332 d_semget='$d_semget'
15334 d_setegid='$d_setegid'
15335 d_seteuid='$d_seteuid'
15336 d_setgrent='$d_setgrent'
15337 d_setgrps='$d_setgrps'
15338 d_sethent='$d_sethent'
15339 d_setlinebuf='$d_setlinebuf'
15340 d_setlocale='$d_setlocale'
15341 d_setnent='$d_setnent'
15342 d_setpent='$d_setpent'
15343 d_setpgid='$d_setpgid'
15344 d_setpgrp2='$d_setpgrp2'
15345 d_setpgrp='$d_setpgrp'
15346 d_setprior='$d_setprior'
15347 d_setpwent='$d_setpwent'
15348 d_setregid='$d_setregid'
15349 d_setresgid='$d_setresgid'
15350 d_setresuid='$d_setresuid'
15351 d_setreuid='$d_setreuid'
15352 d_setrgid='$d_setrgid'
15353 d_setruid='$d_setruid'
15354 d_setsent='$d_setsent'
15355 d_setsid='$d_setsid'
15356 d_setspent='$d_setspent'
15357 d_setvbuf='$d_setvbuf'
15361 d_shmatprototype='$d_shmatprototype'
15362 d_shmctl='$d_shmctl'
15364 d_shmget='$d_shmget'
15365 d_sigaction='$d_sigaction'
15366 d_sigsetjmp='$d_sigsetjmp'
15367 d_socket='$d_socket'
15368 d_socklen_t='$d_socklen_t'
15369 d_sockpair='$d_sockpair'
15371 d_statblks='$d_statblks'
15372 d_statfs_f_flags='$d_statfs_f_flags'
15373 d_statfs_s='$d_statfs_s'
15374 d_statvfs='$d_statvfs'
15375 d_stdio_cnt_lval='$d_stdio_cnt_lval'
15376 d_stdio_ptr_lval='$d_stdio_ptr_lval'
15377 d_stdio_stream_array='$d_stdio_stream_array'
15378 d_stdiobase='$d_stdiobase'
15379 d_stdstdio='$d_stdstdio'
15380 d_strchr='$d_strchr'
15381 d_strcoll='$d_strcoll'
15382 d_strctcpy='$d_strctcpy'
15383 d_strerrm='$d_strerrm'
15384 d_strerror='$d_strerror'
15385 d_strtod='$d_strtod'
15386 d_strtol='$d_strtol'
15387 d_strtold='$d_strtold'
15388 d_strtoll='$d_strtoll'
15389 d_strtoul='$d_strtoul'
15390 d_strtoull='$d_strtoull'
15391 d_strtouq='$d_strtouq'
15392 d_strxfrm='$d_strxfrm'
15393 d_suidsafe='$d_suidsafe'
15394 d_symlink='$d_symlink'
15395 d_syscall='$d_syscall'
15396 d_sysconf='$d_sysconf'
15397 d_sysernlst='$d_sysernlst'
15398 d_syserrlst='$d_syserrlst'
15399 d_system='$d_system'
15400 d_tcgetpgrp='$d_tcgetpgrp'
15401 d_tcsetpgrp='$d_tcsetpgrp'
15402 d_telldir='$d_telldir'
15403 d_telldirproto='$d_telldirproto'
15406 d_truncate='$d_truncate'
15407 d_tzname='$d_tzname'
15410 d_union_semun='$d_union_semun'
15412 d_vendorarch='$d_vendorarch'
15413 d_vendorbin='$d_vendorbin'
15414 d_vendorlib='$d_vendorlib'
15416 d_void_closedir='$d_void_closedir'
15417 d_voidsig='$d_voidsig'
15418 d_voidtty='$d_voidtty'
15419 d_volatile='$d_volatile'
15420 d_vprintf='$d_vprintf'
15422 d_waitpid='$d_waitpid'
15423 d_wcstombs='$d_wcstombs'
15424 d_wctomb='$d_wctomb'
15427 db_hashtype='$db_hashtype'
15428 db_prefixtype='$db_prefixtype'
15429 defvoidused='$defvoidused'
15430 direntrytype='$direntrytype'
15433 doublesize='$doublesize'
15435 dynamic_ext='$dynamic_ext'
15441 eunicefix='$eunicefix'
15444 extensions='$extensions'
15445 fflushNULL='$fflushNULL'
15446 fflushall='$fflushall'
15448 firstmakefile='$firstmakefile'
15450 fpossize='$fpossize'
15451 fpostype='$fpostype'
15452 freetype='$freetype'
15454 full_csh='$full_csh'
15455 full_sed='$full_sed'
15456 gccversion='$gccversion'
15457 gidformat='$gidformat'
15463 groupcat='$groupcat'
15464 groupstype='$groupstype'
15467 h_sysfile='$h_sysfile'
15479 i_arpainet='$i_arpainet'
15480 i_bsdioctl='$i_bsdioctl'
15483 i_dirent='$i_dirent'
15491 i_ieeefp='$i_ieeefp'
15492 i_inttypes='$i_inttypes'
15493 i_limits='$i_limits'
15494 i_locale='$i_locale'
15495 i_machcthr='$i_machcthr'
15496 i_malloc='$i_malloc'
15498 i_memory='$i_memory'
15499 i_mntent='$i_mntent'
15502 i_neterrno='$i_neterrno'
15503 i_netinettcp='$i_netinettcp'
15506 i_pthread='$i_pthread'
15508 i_rpcsvcdbm='$i_rpcsvcdbm'
15511 i_shadow='$i_shadow'
15513 i_stdarg='$i_stdarg'
15514 i_stddef='$i_stddef'
15515 i_stdlib='$i_stdlib'
15516 i_string='$i_string'
15517 i_sunmath='$i_sunmath'
15518 i_sysaccess='$i_sysaccess'
15519 i_sysdir='$i_sysdir'
15520 i_sysfile='$i_sysfile'
15521 i_sysfilio='$i_sysfilio'
15523 i_sysioctl='$i_sysioctl'
15524 i_syslog='$i_syslog'
15525 i_sysmman='$i_sysmman'
15526 i_sysmode='$i_sysmode'
15527 i_sysmount='$i_sysmount'
15528 i_sysndir='$i_sysndir'
15529 i_sysparam='$i_sysparam'
15530 i_sysresrc='$i_sysresrc'
15531 i_syssecrt='$i_syssecrt'
15532 i_sysselct='$i_sysselct'
15533 i_syssockio='$i_syssockio'
15534 i_sysstat='$i_sysstat'
15535 i_sysstatfs='$i_sysstatfs'
15536 i_sysstatvfs='$i_sysstatvfs'
15537 i_systime='$i_systime'
15538 i_systimek='$i_systimek'
15539 i_systimes='$i_systimes'
15540 i_systypes='$i_systypes'
15541 i_sysuio='$i_sysuio'
15543 i_sysutsname='$i_sysutsname'
15544 i_sysvfs='$i_sysvfs'
15545 i_syswait='$i_syswait'
15546 i_termio='$i_termio'
15547 i_termios='$i_termios'
15549 i_unistd='$i_unistd'
15552 i_values='$i_values'
15553 i_varargs='$i_varargs'
15554 i_varhdr='$i_varhdr'
15556 ignore_versioned_solibs='$ignore_versioned_solibs'
15557 inc_version_list='$inc_version_list'
15558 inc_version_list_init='$inc_version_list_init'
15561 installarchlib='$installarchlib'
15562 installbin='$installbin'
15563 installman1dir='$installman1dir'
15564 installman3dir='$installman3dir'
15565 installprefix='$installprefix'
15566 installprefixexp='$installprefixexp'
15567 installprivlib='$installprivlib'
15568 installscript='$installscript'
15569 installsitearch='$installsitearch'
15570 installsitebin='$installsitebin'
15571 installsitelib='$installsitelib'
15572 installstyle='$installstyle'
15573 installusrbinperl='$installusrbinperl'
15574 installvendorarch='$installvendorarch'
15575 installvendorbin='$installvendorbin'
15576 installvendorlib='$installvendorlib'
15578 ivdformat='$ivdformat'
15581 known_extensions='$known_extensions'
15585 lddlflags='$lddlflags'
15587 ldlibpthname='$ldlibpthname'
15594 libsdirs='$libsdirs'
15595 libsfiles='$libsfiles'
15596 libsfound='$libsfound'
15597 libspath='$libspath'
15598 libswanted='$libswanted'
15604 locincpth='$locincpth'
15605 loclibpth='$loclibpth'
15606 longdblsize='$longdblsize'
15607 longlongsize='$longlongsize'
15608 longsize='$longsize'
15612 lseeksize='$lseeksize'
15613 lseektype='$lseektype'
15617 make_set_make='$make_set_make'
15618 mallocobj='$mallocobj'
15619 mallocsrc='$mallocsrc'
15620 malloctype='$malloctype'
15622 man1direxp='$man1direxp'
15625 man3direxp='$man3direxp'
15628 mips_type='$mips_type'
15630 mmaptype='$mmaptype'
15632 modetype='$modetype'
15634 multiarch='$multiarch'
15636 myarchname='$myarchname'
15637 mydomain='$mydomain'
15638 myhostname='$myhostname'
15641 netdb_hlen_type='$netdb_hlen_type'
15642 netdb_host_type='$netdb_host_type'
15643 netdb_name_type='$netdb_name_type'
15644 netdb_net_type='$netdb_net_type'
15647 nm_so_opt='$nm_so_opt'
15648 nonxs_ext='$nonxs_ext'
15652 o_nonblock='$o_nonblock'
15654 old_pthread_create_joinable='$old_pthread_create_joinable'
15655 optimize='$optimize'
15656 orderlib='$orderlib'
15662 patchlevel='$patchlevel'
15663 path_sep='$path_sep'
15666 perladmin='$perladmin'
15667 perlpath='$perlpath'
15669 phostname='$phostname'
15672 pm_apiversion='$pm_apiversion'
15676 prefixexp='$prefixexp'
15678 privlibexp='$privlibexp'
15679 prototype='$prototype'
15681 quadkind='$quadkind'
15682 quadtype='$quadtype'
15683 randbits='$randbits'
15684 randfunc='$randfunc'
15685 randseedtype='$randseedtype'
15687 rd_nodata='$rd_nodata'
15688 revision='$revision'
15692 sPRIEldbl='$sPRIEldbl'
15693 sPRIFldbl='$sPRIFldbl'
15694 sPRIGldbl='$sPRIGldbl'
15697 sPRIeldbl='$sPRIeldbl'
15698 sPRIfldbl='$sPRIfldbl'
15699 sPRIgldbl='$sPRIgldbl'
15704 sched_yield='$sched_yield'
15705 scriptdir='$scriptdir'
15706 scriptdirexp='$scriptdirexp'
15708 seedfunc='$seedfunc'
15709 selectminbits='$selectminbits'
15710 selecttype='$selecttype'
15711 sendmail='$sendmail'
15714 sharpbang='$sharpbang'
15715 shmattype='$shmattype'
15716 shortsize='$shortsize'
15719 sig_count='$sig_count'
15720 sig_name='$sig_name'
15721 sig_name_init='$sig_name_init'
15723 sig_num_init='$sig_num_init'
15724 signal_t='$signal_t'
15725 sitearch='$sitearch'
15726 sitearchexp='$sitearchexp'
15728 sitebinexp='$sitebinexp'
15730 sitelib_stem='$sitelib_stem'
15731 sitelibexp='$sitelibexp'
15732 siteprefix='$siteprefix'
15733 siteprefixexp='$siteprefixexp'
15734 sizesize='$sizesize'
15735 sizetype='$sizetype'
15740 sockethdr='$sockethdr'
15741 socketlib='$socketlib'
15742 socksizetype='$socksizetype'
15744 spackage='$spackage'
15745 spitshell='$spitshell'
15748 ssizetype='$ssizetype'
15749 startperl='$startperl'
15751 static_ext='$static_ext'
15753 stdio_base='$stdio_base'
15754 stdio_bufsiz='$stdio_bufsiz'
15755 stdio_cnt='$stdio_cnt'
15756 stdio_filbuf='$stdio_filbuf'
15757 stdio_ptr='$stdio_ptr'
15758 stdio_stream_array='$stdio_stream_array'
15761 subversion='$subversion'
15768 timeincl='$timeincl'
15769 timetype='$timetype'
15782 uidformat='$uidformat'
15788 uquadtype='$uquadtype'
15789 use5005threads='$use5005threads'
15790 use64bitall='$use64bitall'
15791 use64bitint='$use64bitint'
15793 useithreads='$useithreads'
15794 uselargefiles='$uselargefiles'
15795 uselongdouble='$uselongdouble'
15796 usemorebits='$usemorebits'
15797 usemultiplicity='$usemultiplicity'
15798 usemymalloc='$usemymalloc'
15800 useopcode='$useopcode'
15801 useperlio='$useperlio'
15802 useposix='$useposix'
15804 useshrplib='$useshrplib'
15805 usesocks='$usesocks'
15806 usethreads='$usethreads'
15807 usevendorprefix='$usevendorprefix'
15808 usevfork='$usevfork'
15811 uvoformat='$uvoformat'
15814 uvuformat='$uvuformat'
15815 uvxformat='$uvxformat'
15816 vendorarch='$vendorarch'
15817 vendorarchexp='$vendorarchexp'
15818 vendorbin='$vendorbin'
15819 vendorbinexp='$vendorbinexp'
15820 vendorlib='$vendorlib'
15821 vendorlib_stem='$vendorlib_stem'
15822 vendorlibexp='$vendorlibexp'
15823 vendorprefix='$vendorprefix'
15824 vendorprefixexp='$vendorprefixexp'
15827 voidflags='$voidflags'
15829 xs_apiversion='$xs_apiversion'
15834 : Add in command line options if available
15835 $test -f UU/cmdline.opt && $cat UU/cmdline.opt >> config.sh
15837 : add special variables
15838 $test -f $src/patchlevel.h && \
15839 awk '/^#define[ ]+PERL_/ {printf "%s=%s\n",$2,$3}' $src/patchlevel.h >>config.sh
15840 echo "CONFIGDOTSH=true" >>config.sh
15842 : propagate old symbols
15843 if $test -f UU/config.sh; then
15844 <UU/config.sh sort | uniq >UU/oldconfig.sh
15845 sed -n 's/^\([a-zA-Z_0-9]*\)=.*/\1/p' config.sh config.sh UU/oldconfig.sh |\
15846 sort | uniq -u >UU/oldsyms
15847 set X `cat UU/oldsyms`
15853 Hmm...You had some extra variables I don't know about...I'll try to keep 'em...
15855 echo "# Variables propagated from previous config.sh file." >>config.sh
15856 for sym in `cat UU/oldsyms`; do
15857 echo " Propagating $hint variable "'$'"$sym..."
15858 eval 'tmp="$'"${sym}"'"'
15860 sed -e "s/'/'\"'\"'/g" -e "s/^/$sym='/" -e "s/$/'/" >>config.sh
15866 : Finish up by extracting the .SH files
15880 If you'd like to make any changes to the config.sh file before I begin
15881 to configure things, do it as a shell escape now (e.g. !vi config.sh).
15884 rp="Press return or use a shell escape to edit config.sh:"
15889 *) : in case they cannot read
15890 sh 1>&4 -c "$ans";;
15895 : if this fails, just run all the .SH files by hand
15902 if $contains '^depend:' [Mm]akefile >/dev/null 2>&1; then
15909 Now you need to generate make dependencies by running "$make depend".
15910 You might prefer to run it in background: "$make depend > makedepend.out &"
15911 It can take a while, so you might not want to run it right now.
15916 rp="Run $make depend now?"
15920 $make depend && echo "Now you must run a $make."
15923 echo "You must run '$make depend' then '$make'."
15926 elif test -f [Mm]akefile; then
15928 echo "Now you must run a $make."
15933 if $test -f Policy.sh; then
15936 If you compile $package on a different machine or from a different object
15937 directory, copy the Policy.sh file from this object directory to the
15938 new one before you run Configure -- this will help you with most of
15939 the policy defaults.
15943 if $test -f config.msg; then
15944 echo "Hmm. I also noted the following information while running:"
15946 $cat config.msg >&4
15949 $rm -f kit*isdone ark*isdone