3 # If these # comments don't work, trim them. Don't worry about any other
4 # shell scripts, Configure will trim # comments from them for you.
6 # (If you are trying to port this package to a machine without sh,
7 # I would suggest you have a look at the prototypical config_h.SH file
8 # and edit it to reflect your system. Some packages may include samples
9 # of config.h for certain machines, so you might look for one of those.)
11 # Yes, you may rip this off to use in other distribution packages. This
12 # script belongs to the public domain and cannot be copyrighted.
14 # (Note: this Configure script was generated automatically. Rather than
15 # working with this copy of Configure, you may wish to get metaconfig.
16 # The dist-3.0 package (which contains metaconfig) was posted in
17 # comp.sources.misc and is available on CPAN under authors/id/RAM so
18 # you may fetch it yourself from your nearest archive site.)
21 # $Id: Head.U,v 3.0.1.9 1997/02/28 15:02:09 ram Exp $
23 # Generated on Fri Feb 4 21:57:24 EET 2000 [metaconfig 3.0 PL70]
24 # (with additional metaconfig patches by perlbug@perl.com)
29 SCO csh still thinks true is false. Write to SCO today and tell them that next
30 year Configure ought to "rm /bin/csh" unless they fix their blasted shell. :-)
32 (Actually, Configure ought to just patch csh in place. Hmm. Hmmmmm. All
33 we'd have to do is go in and swap the && and || tokens, wherever they are.)
35 [End of diatribe. We now return you to your regularly scheduled programming...]
39 OOPS! You naughty creature! You didn't run Configure with sh!
40 I will attempt to remedy the situation by running sh for you...
43 true || cat /tmp/c1$$ /tmp/c2$$
44 true || exec sh $0 $argv:q
46 (exit $?0) || cat /tmp/c2$$
47 (exit $?0) || exec sh $0 $argv:q
48 rm -f /tmp/c1$$ /tmp/c2$$
50 : compute my invocation name
54 me=`echo $0 | sed -e 's!.*/\(.*\)!\1!' 2>/dev/null`
59 : Proper separator for the PATH environment variable
61 : On OS/2 this directory should exist if this is not floppy only system :-]
62 if test -d c:/. ; then
63 if test -n "$OS2_SHELL"; then
65 PATH=`cmd /c "echo %PATH%" | tr '\\\\' / `
66 OS2_SHELL=`cmd /c "echo %OS2_SHELL%" | tr '\\\\' / | tr '[A-Z]' '[a-z]'`
67 elif test -n "$DJGPP"; then
73 paths='/bin /usr/bin /usr/local/bin /usr/ucb /usr/local /usr/lbin'
74 paths="$paths /opt/bin /opt/local/bin /opt/local /opt/lbin"
75 paths="$paths /usr/5bin /etc /usr/gnu/bin /usr/new /usr/new/bin /usr/nbin"
76 paths="$paths /opt/gnu/bin /opt/new /opt/new/bin /opt/nbin"
77 paths="$paths /sys5.3/bin /sys5.3/usr/bin /bsd4.3/bin /bsd4.3/usr/ucb"
78 paths="$paths /bsd4.3/usr/bin /usr/bsd /bsd43/bin /usr/ccs/bin"
79 paths="$paths /etc /usr/lib /usr/ucblib /lib /usr/ccs/lib"
80 paths="$paths /sbin /usr/sbin /usr/libexec"
86 *) test -d $p && PATH=$PATH$p_$p ;;
93 : shall we be using ksh?
99 if (PATH=.; alias -x) >/dev/null 2>&1; then
102 if test -f /hp-ux -a -f /bin/ksh; then
103 needksh='to avoid sh bug in "here document" expansion'
105 if test -d /usr/lpp -a -f /usr/bin/bsh -a -f /usr/bin/uname; then
106 if test X`/usr/bin/uname -v` = X4; then
107 avoidksh="to avoid AIX 4's /bin/sh"
111 if test -f /osf_boot -a -f /usr/sbin/setld; then
112 if test X`/usr/bin/uname -s` = XOSF1; then
113 avoidksh="to avoid Digital UNIX' ksh"
115 unset BIN_SH # if this is 'xpg4' sh will start up ksh
118 case "$inksh/$needksh" in
125 case "$inksh/$avoidksh" in
131 case "$inksh/$needksh-$avoidksh-" in
134 (I see you are using the Korn shell. Some ksh's blow up on $me,
135 mainly on older exotic systems. If yours does, try the Bourne shell instead.)
141 echo "(Feeding myself to $newsh $reason.)"
143 Configure|*/Configure) exec $newsh $0 "$@";;
144 *) exec $newsh Configure "$@";;
149 : if needed set CDPATH to a harmless value that is not chatty
150 : avoid bash 2.02 problems with empty CDPATH.
154 *bash*) CDPATH='.' ;;
159 : Configure runs within the UU subdirectory
160 test -d UU || mkdir UU
441 d_old_pthread_create_joinable=''
442 old_pthread_create_joinable=''
676 inc_version_list_init=''
696 ignore_versioned_solibs=''
857 d_stdio_stream_array=''
858 stdio_stream_array=''
902 smallmach='pdp11 i8086 z8000 i80286 iAPX286'
905 : We must find out about Eunice early
907 if test -f /etc/unixtovms; then
908 eunicefix=/etc/unixtovms
910 if test -f /etc/unixtovms.exe; then
911 eunicefix=/etc/unixtovms.exe
915 : set useposix=false in your hint file to disable the POSIX extension.
917 : set useopcode=false in your hint file to disable the Opcode extension.
919 : Trailing extension. Override this in a hint file, if needed.
921 : Extra object files, if any, needed on this platform.
923 : Possible local include directories to search.
924 : Set locincpth to "" in a hint file to defeat local include searches.
925 locincpth="/usr/local/include /opt/local/include /usr/gnu/include"
926 locincpth="$locincpth /opt/gnu/include /usr/GNU/include /opt/GNU/include"
928 : no include file wanted by default
932 : change the next line if compiling for Xenix/286 on Xenix/386
933 xlibpth='/usr/lib/386 /lib/386'
935 : Possible local library directories to search.
936 loclibpth="/usr/local/lib /opt/local/lib /usr/gnu/lib"
937 loclibpth="$loclibpth /opt/gnu/lib /usr/GNU/lib /opt/GNU/lib"
939 : general looking path for locating libraries
940 glibpth="/shlib /usr/shlib /lib/pa1.1 /usr/lib/large"
941 glibpth="$glibpth /lib /usr/lib $xlibpth"
942 glibpth="$glibpth /lib/large /usr/lib/small /lib/small"
943 glibpth="$glibpth /usr/ccs/lib /usr/ucblib /usr/local/lib"
945 : Private path used by Configure to find libraries. Its value
946 : is prepended to libpth. This variable takes care of special
947 : machines, like the mips. Usually, it should be empty.
950 : default library list
952 : some systems want to use only the non-versioned libso:s
953 ignore_versioned_solibs=''
954 : set usemultiplicity on the Configure command line to enable multiplicity.
955 : set usesocks on the Configure command line to enable socks.
956 : set usethreads on the Configure command line to enable threads.
957 : full support for void wanted by default
960 : List of libraries we want.
961 : If anyone needs -lnet, put it in a hint file.
962 libswanted='sfio socket inet nsl nm ndbm gdbm dbm db malloc dl'
963 libswanted="$libswanted dld ld sun m c cposix posix"
964 libswanted="$libswanted ndir dir crypt sec"
965 libswanted="$libswanted ucb bsd BSD PW x"
966 : We probably want to search /usr/shlib before most other libraries.
967 : This is only used by the lib/ExtUtils/MakeMaker.pm routine extliblist.
968 glibpth=`echo " $glibpth " | sed -e 's! /usr/shlib ! !'`
969 glibpth="/usr/shlib $glibpth"
970 : Do not use vfork unless overridden by a hint file.
973 : Find the basic shell for Bourne shell scripts
977 *bsd*|sys5*) xxx="/$SYSTYPE/bin/sh";;
980 if test -f "$xxx"; then
983 : Build up a list and do a single loop so we can 'break' out.
984 pth=`echo $PATH | sed -e "s/$p_/ /g"`
985 for xxx in sh bash ksh pdksh ash; do
987 try="$try ${p}/${xxx}"
991 if test -f "$xxx"; then
994 elif test -f "$xxx.exe"; then
1005 $me: Fatal Error: I can't find a Bourne Shell anywhere.
1007 Usually it's in /bin/sh. How did you even get this far?
1008 Please contact me (Perl Maintainers) at perlbug@perl.com and
1009 we'll try to straighten this all out.
1015 : see if sh knows # comments
1016 if `$sh -c '#' >/dev/null 2>&1`; then
1020 test -f $xcat || xcat=/usr/bin/cat
1025 if test -s today; then
1028 echo "#! $xcat" > try
1032 if test -s today; then
1040 echo "Your $sh doesn't grok # comments--I will strip them later on."
1043 echo "exec grep -v '^[ ]*#'" >spitshell
1045 $eunicefix spitshell
1046 spitshell=`pwd`/spitshell
1048 echo "I presume that if # doesn't work, #! won't work either!"
1053 : figure out how to guarantee sh startup
1055 '') startsh=${sharpbang}${sh} ;;
1067 : echo "Yup, it does."
1069 echo "Hmm... '$startsh' does not guarantee sh startup..."
1070 echo "You may have to fix up the shell scripts to make sure $sh runs them."
1075 : Save command line options in file UU/cmdline.opt for later use in
1076 : generating config.sh.
1077 cat > cmdline.opt <<EOSH
1078 # Configure command line arguments.
1085 cat >>cmdline.opt <<EOSH
1086 config_arg$argn='$arg'
1088 argn=`expr $argn + 1`
1091 : produce awk script to parse command line options
1092 cat >options.awk <<'EOF'
1094 optstr = "A:dD:eEf:hKOrsSU:V"; # getopt-style specification
1096 len = length(optstr);
1097 for (i = 1; i <= len; i++) {
1098 c = substr(optstr, i, 1);
1099 if (i < len) a = substr(optstr, i + 1, 1); else a = "";
1110 if (substr(str, 1, 1) != "-") {
1111 printf("'%s'\n", str);
1115 for (i = 2; i <= len; i++) {
1116 c = substr(str, i, 1);
1118 printf("-%s\n", substr(str, i));
1124 printf("'%s'\n", substr(str, i + 1));
1137 : process the command line options
1138 set X `for arg in "$@"; do echo "X$arg"; done |
1139 sed -e s/X// | awk -f options.awk`
1144 : set up default values
1154 rm -f optdef.sh posthint.sh
1155 cat >optdef.sh <<EOS
1161 while test $# -gt 0; do
1163 -d) shift; fastread=yes;;
1164 -e) shift; alldone=cont;;
1168 if test -r "$1"; then
1171 echo "$me: cannot read config file $1." >&2
1176 -h) shift; error=true;;
1177 -r) shift; reuseval=true;;
1178 -s) shift; silent=true; realsilent=true;;
1179 -E) shift; alldone=exit;;
1180 -K) shift; knowitall=true;;
1181 -O) shift; override=true;;
1182 -S) shift; silent=true; extractsh=true;;
1187 echo "$me: use '-U symbol=', not '-D symbol='." >&2
1188 echo "$me: ignoring -D $1" >&2
1191 sed -e "s/'/'\"'\"'/g" -e "s/=\(.*\)/='\1'/" >> optdef.sh;;
1192 *) echo "$1='define'" >> optdef.sh;;
1199 *=) echo "$1" >> optdef.sh;;
1201 echo "$me: use '-D symbol=val', not '-U symbol=val'." >&2
1202 echo "$me: ignoring -U $1" >&2
1204 *) echo "$1='undef'" >> optdef.sh;;
1215 *=*) zzz=`echo $yyy|sed 's!=.*!!'`
1219 zzz=" "`echo $yyy|sed 's!^[^=]*=!!'`
1220 yyy=`echo $yyy|sed 's!=.*!!'` ;;
1226 *:*) xxx=`echo $yyy|sed 's!:.*!!'`
1227 yyy=`echo $yyy|sed 's!^[^:]*:!!'`
1228 zzz=`echo $yyy|sed 's!^[^=]*=!!'`
1229 yyy=`echo $yyy|sed 's!=.*!!'` ;;
1230 *) xxx=`echo $yyy|sed 's!:.*!!'`
1231 yyy=`echo $yyy|sed 's!^[^:]*:!!'` ;;
1237 echo "$yyy=\"\${$yyy}$zzz\"" >> posthint.sh ;;
1239 echo "$yyy=''" >> posthint.sh ;;
1244 echo "$yyy='$zzz'" >> posthint.sh ;;
1246 echo "eval \"$yyy=$zzz\"" >> posthint.sh ;;
1248 echo "$yyy=\"$zzz\${$yyy}\"" >> posthint.sh ;;
1253 echo "$yyy=$zzz" >> posthint.sh ;;
1254 *) echo "$me: unknown -A command '$xxx', ignoring -A $1" >&2 ;;
1257 -V) echo "$me generated by metaconfig 3.0 PL70." >&2
1260 -*) echo "$me: unknown option $1" >&2; shift; error=true;;
1268 Usage: $me [-dehrsEKOSV] [-f config.sh] [-D symbol] [-D symbol=value]
1269 [-U symbol] [-U symbol=] [-A command:symbol...]
1270 -d : use defaults for all answers.
1271 -e : go on without questioning past the production of config.sh.
1272 -f : specify an alternate default configuration file.
1273 -h : print this help message and exit (with an error status).
1274 -r : reuse C symbols value if possible (skips costly nm extraction).
1275 -s : silent mode, only echoes questions and essential information.
1276 -D : define symbol to have some value:
1277 -D symbol symbol gets the value 'define'
1278 -D symbol=value symbol gets the value 'value'
1279 -E : stop at the end of questions, after having produced config.sh.
1280 -K : do not use unless you know what you are doing.
1281 -O : let -D and -U override definitions from loaded configuration file.
1282 -S : perform variable substitutions on all .SH files (can mix with -f)
1283 -U : undefine symbol:
1284 -U symbol symbol gets the value 'undef'
1285 -U symbol= symbol gets completely empty
1286 -A : manipulate symbol after the platform specific hints have been applied:
1287 -A symbol=value append " "value to symbol
1288 -A append:symbol=value append value to symbol
1289 -A define:symbol=value define symbol to have value
1290 -A clear:symbol define symbol to be ''
1291 -A define:symbol define symbol to be 'define'
1292 -A eval:symbol=value define symbol to be eval of value
1293 -A prepend:symbol=value prepend value to symbol
1294 -A undef:symbol define symbol to be 'undef'
1295 -A undef:symbol= define symbol to be ''
1296 -V : print version number and exit (with a zero status).
1303 case "$fastread$alldone" in
1306 if test ! -t 0; then
1307 echo "Say 'sh Configure', not 'sh <Configure'"
1315 true) exec 1>/dev/null;;
1318 : run the defines and the undefines, if any, but leave the file out there...
1321 : create the posthint manipulation script and leave the file out there...
1326 first=`echo $package | sed -e 's/^\(.\).*/\1/'`
1327 last=`echo $package | sed -e 's/^.\(.*\)/\1/'`
1328 case "`echo AbyZ | tr '[:lower:]' '[:upper:]' 2>/dev/null`" in
1329 ABYZ) spackage=`echo $first | tr '[:lower:]' '[:upper:]'`$last;;
1330 *) spackage=`echo $first | tr '[a-z]' '[A-Z]'`$last;;
1333 : Some greps do not return status, grrr.
1334 echo "grimblepritz" >grimble
1335 if grep blurfldyick grimble >/dev/null 2>&1 ; then
1337 elif grep grimblepritz grimble >/dev/null 2>&1 ; then
1343 : the following should work in any shell
1347 echo "AGH! Grep doesn't return a status. Attempting remedial action."
1348 cat >contains <<'EOSS'
1349 grep "$1" "$2" >.greptmp && cat .greptmp && test -s .greptmp
1354 : Find the path to the source tree
1357 */*) src=`echo $0 | sed -e 's%/[^/][^/]*$%%'`
1360 *) src=`cd ../$src && pwd` ;;
1373 if test -f $rsrc/Configure && \
1374 $contains "^package=$package$" $rsrc/Configure >/dev/null 2>&1
1376 : found it, so we are ok.
1379 for src in . .. ../.. ../../.. ../../../..; do
1380 if test -f ../$src/Configure && \
1381 $contains "^package=$package$" ../$src/Configure >/dev/null 2>&1
1392 Sorry, I can't seem to locate the source dir for $package. Please start
1393 Configure with an explicit path -- i.e. /some/path/Configure.
1401 echo "Sources for $package found in \"$src\"." >&4
1405 : script used to extract .SH files with variable substitutions
1406 cat >extract <<'EOS'
1408 echo "Doing variable substitutions on .SH files..."
1409 if test -f $src/MANIFEST; then
1410 set x `awk '{print $1}' <$src/MANIFEST | grep '\.SH$'`
1412 echo "(Looking for .SH files under the source directory.)"
1413 set x `(cd $src; find . -name "*.SH" -print)`
1417 0) set x `(cd $src; echo *.SH)`; shift;;
1419 if test ! -f $src/$1; then
1425 while test $name; do
1426 if test ! -d "$name"; then
1427 create="$name $create";
1428 name=`echo $name | sed -e "s|^[^/]*$||"`;
1429 name=`echo $name | sed -e "s|\(.*\)/.*|\1|"`;
1434 for file in $create; do
1443 dir=`expr X$file : 'X\(.*\)/'`
1444 file=`expr X$file : 'X.*/\(.*\)'`
1445 (cd $dir && . ./$file)
1455 dir=`expr X$file : 'X\(.*\)/'`
1456 file=`expr X$file : 'X.*/\(.*\)'`
1457 (set x $dir; shift; eval $mkdir_p)
1467 if test -f $src/config_h.SH; then
1468 if test ! -f config.h; then
1469 : oops, they left it out of MANIFEST, probably, so do it anyway.
1475 : extract files and exit if asked to do so
1476 case "$extractsh" in
1478 case "$realsilent" in
1482 case "$config_sh" in
1483 '') config_sh='config.sh';;
1486 echo "Fetching answers from $config_sh..."
1489 test "$override" && . ./optdef.sh
1498 : Eunice requires " " instead of "", can you believe it
1501 echo "Beginning of configuration questions for $package."
1503 trap 'echo " "; test -d ../UU && rm -rf X $rmlist; exit 1' 1 2 3 15
1505 : first determine how to suppress newline on echo command
1507 echo "Checking echo to see how to suppress newlines..."
1508 (echo "hi there\c" ; echo " ") >.echotmp
1509 if $contains c .echotmp >/dev/null 2>&1 ; then
1520 echo $n "The star should be here-->$c"
1524 : Now test for existence of everything in MANIFEST
1526 if test -f $rsrc/MANIFEST; then
1527 echo "First let's make sure your kit is complete. Checking..." >&4
1528 awk '$1 !~ /PACK[A-Z]+/ {print $1}' $rsrc/MANIFEST | split -50
1531 for filelist in x??; do
1532 (cd $rsrc; ls `cat $tmppwd/$filelist` >/dev/null 2>>$tmppwd/missing)
1534 if test -s missing; then
1538 THIS PACKAGE SEEMS TO BE INCOMPLETE.
1540 You have the option of continuing the configuration process, despite the
1541 distinct possibility that your kit is damaged, by typing 'y'es. If you
1542 do, don't blame me if something goes wrong. I advise you to type 'n'o
1543 and contact the author (perlbug@perl.com).
1546 echo $n "Continue? [n] $c" >&4
1550 echo "Continuing..." >&4
1554 echo "ABORTING..." >&4
1559 echo "Looks good..."
1562 echo "There is no MANIFEST file. I hope your kit is complete !"
1567 : Find the appropriate value for a newline for tr
1568 if test -n "$DJGPP"; then
1571 if test X"$trnl" = X; then
1572 case "`echo foo|tr '\n' x 2>/dev/null`" in
1576 if test X"$trnl" = X; then
1577 case "`echo foo|tr '\012' x 2>/dev/null`" in
1578 foox) trnl='\012' ;;
1581 if test X"$trnl" = X; then
1584 $me: Fatal Error: cannot figure out how to translate newlines with 'tr'.
1590 : compute the number of columns on the terminal for proper question formatting
1595 : set up the echo used in my read
1596 myecho="case \"\$xxxm\" in
1597 '') echo $n \"\$rp $c\" >&4;;
1599 '') echo $n \"[\$xxxm] $c\";;
1601 if test \`echo \"\$rp [\$xxxm] \" | wc -c\` -ge $COLUMNS; then
1603 echo $n \"[\$xxxm] $c\" >&4
1605 echo $n \"\$rp [\$xxxm] $c\" >&4
1611 : now set up to do reads with possible shell escape and default assignment
1617 case "\$fastread" in
1618 yes) case "\$dflt" in
1621 case "\$silent-\$rp" in
1626 *) case "\$silent" in
1627 true) case "\$rp" in
1632 while expr "X\$ans" : "X!" >/dev/null; do
1636 aok=''; eval "ans=\\"\$answ\\"" && aok=y
1644 set x \`expr "X\$ans" : "X!\(.*\)\$"\`
1653 set x \`expr "X\$ans" : "X&\(.*\)\$"\`
1658 echo "(OK, I'll run with -d after this question.)" >&4
1661 echo "*** Sorry, \$1 not supported yet." >&4
1671 echo "*** Substitution done -- please confirm."
1673 ans=\`echo $n "\$ans$c" | tr '$trnl' ' '\`
1678 echo "*** Error -- try again."
1685 case "\$ans\$xxxm\$nostick" in
1697 : create .config dir to save info across Configure sessions
1698 test -d ../.config || mkdir ../.config
1699 cat >../.config/README <<EOF
1700 This directory created by Configure to save information that should
1701 persist across sessions for $package.
1703 You may safely delete it if you wish.
1706 : general instructions
1709 user=`(logname) 2>/dev/null`
1711 '') user=`whoami 2>&1`;;
1713 if $contains "^$user\$" ../.config/instruct >/dev/null 2>&1; then
1716 rp='Would you like to see the instructions?'
1727 This installation shell script will examine your system and ask you questions
1728 to determine how the perl5 package should be installed. If you get
1729 stuck on a question, you may use a ! shell escape to start a subshell or
1730 execute a command. Many of the questions will have default answers in square
1731 brackets; typing carriage return will give you the default.
1733 On some of the questions which ask for file or directory names you are allowed
1734 to use the ~name construct to specify the login directory belonging to "name",
1735 even if you don't have a shell which knows about that. Questions where this is
1736 allowed will be marked "(~name ok)".
1740 dflt='Type carriage return to continue'
1744 The prompter used in this script allows you to use shell variables and
1745 backticks in your answers. You may use $1, $2, etc... to refer to the words
1746 in the default answer, as if the default line was a set of arguments given to a
1747 script shell. This means you may also use $* to repeat the whole default line,
1748 so you do not have to re-type everything to add something to the default.
1750 Everytime there is a substitution, you will have to confirm. If there is an
1751 error (e.g. an unmatched backtick), the default answer will remain unchanged
1752 and you will be prompted again.
1754 If you are in a hurry, you may run 'Configure -d'. This will bypass nearly all
1755 the questions and use the computed defaults (or the previous answers if there
1756 was already a config.sh file). Type 'Configure -h' for a list of options.
1757 You may also start interactively and then answer '& -d' at any prompt to turn
1758 on the non-interactive behaviour for the remainder of the execution.
1764 Much effort has been expended to ensure that this shell script will run on any
1765 Unix system. If despite that it blows up on yours, your best bet is to edit
1766 Configure and run it again. If you can't run Configure for some reason,
1767 you'll have to generate a config.sh file by hand. Whatever problems you
1768 have, let me (perlbug@perl.com) know how I blew it.
1770 This installation script affects things in two ways:
1772 1) it may do direct variable substitutions on some of the files included
1774 2) it builds a config.h file for inclusion in C programs. You may edit
1775 any of these files as the need arises after running this script.
1777 If you make a mistake on a question, there is no easy way to back up to it
1778 currently. The easiest thing to do is to edit config.sh and rerun all the SH
1779 files. Configure will offer to let you do this before it runs the SH files.
1782 dflt='Type carriage return to continue'
1784 case "$firsttime" in
1785 true) echo $user >>../.config/instruct;;
1789 : find out where common programs are
1791 echo "Locating common programs..." >&4
1804 if test -d \$dir/\$thing; then
1810 for thisthing in \$dir/\$thing; do
1811 : just loop through to pick last item
1813 if test -f \$thisthing; then
1816 elif test -f \$dir/\$thing.exe; then
1817 if test -n "$DJGPP"; then
1818 echo \$dir/\$thing.exe
1820 : on Eunice apparently
1871 pth=`echo $PATH | sed -e "s/$p_/ /g"`
1872 pth="$pth /lib /usr/lib"
1873 for file in $loclist; do
1877 if test -f "$xxx"; then
1880 echo "WARNING: no $xxx -- ignoring your setting for $file." >&4
1881 xxx=`./loc $file $file $pth`
1884 '') xxx=`./loc $file $file $pth`;;
1885 *) xxx=`./loc $xxx $xxx $pth`;;
1891 echo $file is in $xxx.
1894 echo $file is in $xxx.
1897 echo "I don't know where '$file' is, and my life depends on it." >&4
1898 echo "Go find a public domain implementation or fix your PATH setting!" >&4
1904 echo "Don't worry if any of the following aren't found..."
1906 for file in $trylist; do
1910 if test -f "$xxx"; then
1913 echo "WARNING: no $xxx -- ignoring your setting for $file." >&4
1914 xxx=`./loc $file $file $pth`
1917 '') xxx=`./loc $file $file $pth`;;
1918 *) xxx=`./loc $xxx $xxx $pth`;;
1924 echo $file is in $xxx.
1927 echo $file is in $xxx.
1930 echo "I don't see $file out there, $say."
1937 echo "Substituting grep for egrep."
1943 echo "Substituting cp for ln."
1949 echo "Hopefully test is built into your sh."
1952 if `sh -c "PATH= test true" >/dev/null 2>&1`; then
1953 echo "Using the test built into your sh."
1961 echo "Hopefully echo is built into your sh."
1966 echo "Checking compatibility between $echo and builtin echo (if any)..." >&4
1967 $echo $n "hi there$c" >foo1
1968 echo $n "hi there$c" >foo2
1969 if cmp foo1 foo2 >/dev/null 2>&1; then
1970 echo "They are compatible. In fact, they may be identical."
1977 They are not compatible! You are probably running ksh on a non-USG system.
1978 I'll have to use $echo instead of the builtin, since Bourne shell doesn't
1979 have echo built in and we may have to run some Bourne shell scripts. That
1980 means I'll have to use '$n$c' to suppress newlines now. Life is ridiculous.
1983 $echo $n "The star should be here-->$c"
1990 : determine whether symbolic links are supported
1993 if $ln -s blurfl sym > /dev/null 2>&1 ; then
1994 echo "Symbolic links are supported." >&4
1997 echo "Symbolic links are NOT supported." >&4
2002 : see whether [:lower:] and [:upper:] are supported character classes
2004 case "`echo AbyZ | $tr '[:lower:]' '[:upper:]' 2>/dev/null`" in
2006 echo "Good, your tr supports [:lower:] and [:upper:] to convert case." >&4
2010 *) # There is a discontinuity in EBCDIC between 'I' and 'J'
2011 # (0xc9 and 0xd1), therefore that is a nice testing point.
2012 if test "X$up" = X -o "X$low" = X; then
2013 case "`echo IJ | $tr '[I-J]' '[i-j]' 2>/dev/null`" in
2019 if test "X$up" = X -o "X$low" = X; then
2020 case "`echo IJ | $tr I-J i-j 2>/dev/null`" in
2026 if test "X$up" = X -o "X$low" = X; then
2027 case "`echo IJ | od -x 2>/dev/null`" in
2029 echo "Hey, this might be EBCDIC." >&4
2030 if test "X$up" = X -o "X$low" = X; then
2031 case "`echo IJ | $tr '[A-IJ-RS-Z]' '[a-ij-rs-z]' 2>/dev/null`" in
2032 ij) up='[A-IJ-RS-Z]'
2037 if test "X$up" = X -o "X$low" = X; then
2038 case "`echo IJ | $tr A-IJ-RS-Z a-ij-rs-z 2>/dev/null`" in
2048 case "`echo IJ | $tr \"$up\" \"$low\" 2>/dev/null`" in
2050 echo "Using $up and $low to convert case." >&4
2053 echo "I don't know how to translate letters from upper to lower case." >&4
2054 echo "Your tr is not acting any way I know of." >&4
2058 : set up the translation script tr, must be called with ./tr of course
2062 '[A-Z][a-z]') exec $tr '$up' '$low';;
2063 '[a-z][A-Z]') exec $tr '$low' '$up';;
2070 : Try to determine whether config.sh was made on this system
2071 case "$config_sh" in
2073 myuname=`$uname -a 2>/dev/null`
2074 $test -z "$myuname" && myuname=`hostname 2>/dev/null`
2075 # tr '[A-Z]' '[a-z]' would not work in EBCDIC
2076 # because the A-Z/a-z are not consecutive.
2077 myuname=`echo $myuname | $sed -e 's/^[^=]*=//' -e 's/\///g' | \
2078 ./tr '[A-Z]' '[a-z]' | $tr $trnl ' '`
2079 newmyuname="$myuname"
2081 case "$knowitall" in
2083 if test -f ../config.sh; then
2084 if $contains myuname= ../config.sh >/dev/null 2>&1; then
2085 eval "`grep myuname= ../config.sh`"
2087 if test "X$myuname" = "X$newmyuname"; then
2095 : Get old answers from old config file if Configure was run on the
2096 : same system, otherwise use the hints.
2099 if test -f config.sh; then
2101 rp="I see a config.sh file. Shall I use it to set the defaults?"
2104 n*|N*) echo "OK, I'll ignore it."; mv config.sh config.sh.old;;
2105 *) echo "Fetching default answers from your old config.sh file..." >&4
2113 : Older versions did not always set $sh. Catch re-use of such
2122 if test ! -f config.sh; then
2125 First time through, eh? I have some defaults handy for some systems
2126 that need some extra help getting the Configure answers right:
2129 (cd $src/hints; ls -C *.sh) | $sed 's/\.sh/ /g' >&4
2131 : Half the following guesses are probably wrong... If you have better
2132 : tests or hints, please send them to perlbug@perl.com
2133 : The metaconfig authors would also appreciate a copy...
2134 $test -f /irix && osname=irix
2135 $test -f /xenix && osname=sco_xenix
2136 $test -f /dynix && osname=dynix
2137 $test -f /dnix && osname=dnix
2138 $test -f /lynx.os && osname=lynxos
2139 $test -f /unicos && osname=unicos && osvers=`$uname -r`
2140 $test -f /unicosmk && osname=unicosmk && osvers=`$uname -r`
2141 $test -f /unicosmk.ar && osname=unicosmk && osvers=`$uname -r`
2142 $test -f /bin/mips && /bin/mips && osname=mips
2143 $test -d /NextApps && set X `hostinfo | grep 'NeXT Mach.*:' | \
2144 $sed -e 's/://' -e 's/\./_/'` && osname=next && osvers=$4
2145 $test -d /usr/apollo/bin && osname=apollo
2146 $test -f /etc/saf/_sactab && osname=svr4
2147 $test -d /usr/include/minix && osname=minix
2148 if $test -d /MachTen -o -d /MachTen_Folder; then
2150 if $test -x /sbin/version; then
2151 osvers=`/sbin/version | $awk '{print $2}' |
2152 $sed -e 's/[A-Za-z]$//'`
2153 elif $test -x /usr/etc/version; then
2154 osvers=`/usr/etc/version | $awk '{print $2}' |
2155 $sed -e 's/[A-Za-z]$//'`
2161 $test -f /sys/posix.dll &&
2162 $test -f /usr/bin/what &&
2163 set X `/usr/bin/what /sys/posix.dll` &&
2164 $test "$3" = UWIN &&
2168 if $test -f $uname; then
2176 umips) osname=umips ;;
2179 [23]100) osname=mips ;;
2180 next*) osname=next ;;
2182 tmp=`/bin/uname -X 2>/dev/null|awk '/3\.2v[45]/{ print $(NF) }'`
2183 if $test "$tmp" != "" -a "$3" = "3.2" -a -f '/etc/systemid'; then
2186 elif $test -f /etc/kconfig; then
2188 if test "$lns" = "$ln -s"; then
2190 elif $contains _SYSV3 /usr/include/stdio.h > /dev/null 2>&1 ; then
2192 elif $contains _POSIX_SOURCE /usr/include/stdio.h > /dev/null 2>&1 ; then
2199 if test -n "$DJGPP"; then
2208 tmp=`( (oslevel) 2>/dev/null || echo "not found") 2>&1`
2210 'not found') osvers="$4"."$3" ;;
2211 '<3240'|'<>3240') osvers=3.2.0 ;;
2212 '=3240'|'>3240'|'<3250'|'<>3250') osvers=3.2.4 ;;
2213 '=3250'|'>3250') osvers=3.2.5 ;;
2217 bsd386) osname=bsd386
2220 cygwin*) osname=cygwin
2223 *dc.osx) osname=dcosx
2229 domainos) osname=apollo
2235 dynixptx*) osname=dynixptx
2236 osvers=`echo "$4"|sed 's/^v//'`
2238 freebsd) osname=freebsd
2240 genix) osname=genix ;;
2242 osvers=`echo "$3" | $sed 's,.*\.\([0-9]*\.[0-9]*\),\1,'`
2258 netbsd*) osname=netbsd
2261 news-os) osvers="$3"
2263 4*) osname=newsos4 ;;
2267 next*) osname=next ;;
2268 POSIX-BC | posix-bc ) osname=posix-bc
2271 powerux | power_ux | powermax_os | powermaxos | \
2272 powerunix | power_unix) osname=powerux
2278 solaris) osname=solaris
2280 5*) osvers=`echo $3 | $sed 's/^5/2/g'` ;;
2287 osvers=`echo $3 | $sed 's/^5/2/g'` ;;
2291 titanos) osname=titanos
2300 ultrix) osname=ultrix
2303 osf1|mls+) case "$5" in
2306 osvers=`echo "$3" | sed 's/^[xvt]//'`
2308 hp*) osname=hp_osf1 ;;
2309 mips) osname=mips_osf1 ;;
2312 unixware) osname=svr5
2318 $2) case "$osname" in
2322 : svr4.x or possibly later
2332 if test -f /stand/boot ; then
2333 eval `grep '^INITPROG=[a-z/0-9]*$' /stand/boot`
2334 if test -n "$INITPROG" -a -f "$INITPROG"; then
2335 isesix=`strings -a $INITPROG|grep 'ESIX SYSTEM V/386 Release 4.0'`
2336 if test -n "$isesix"; then
2344 *) if test -f /etc/systemid; then
2346 set `echo $3 | $sed 's/\./ /g'` $4
2347 if $test -f $src/hints/sco_$1_$2_$3.sh; then
2349 elif $test -f $src/hints/sco_$1_$2.sh; then
2351 elif $test -f $src/hints/sco_$1.sh; then
2356 '') : Still unknown. Probably a generic Sys V.
2365 *) case "$osname" in
2366 '') : Still unknown. Probably a generic BSD.
2374 if test -f /vmunix -a -f $src/hints/news_os.sh; then
2375 (what /vmunix | UU/tr '[A-Z]' '[a-z]') > UU/kernel.what 2>&1
2376 if $contains news-os UU/kernel.what >/dev/null 2>&1; then
2379 $rm -f UU/kernel.what
2380 elif test -d c:/.; then
2387 : Now look for a hint file osname_osvers, unless one has been
2388 : specified already.
2391 file=`echo "${osname}_${osvers}" | $sed -e 's@\.@_@g' -e 's@_$@@'`
2392 : Also try without trailing minor version numbers.
2393 xfile=`echo $file | $sed -e 's@_[^_]*$@@'`
2394 xxfile=`echo $xfile | $sed -e 's@_[^_]*$@@'`
2395 xxxfile=`echo $xxfile | $sed -e 's@_[^_]*$@@'`
2396 xxxxfile=`echo $xxxfile | $sed -e 's@_[^_]*$@@'`
2399 *) case "$osvers" in
2402 *) if $test -f $src/hints/$file.sh ; then
2404 elif $test -f $src/hints/$xfile.sh ; then
2406 elif $test -f $src/hints/$xxfile.sh ; then
2408 elif $test -f $src/hints/$xxxfile.sh ; then
2410 elif $test -f $src/hints/$xxxxfile.sh ; then
2412 elif $test -f "$src/hints/${osname}.sh" ; then
2421 if $test -f Policy.sh ; then
2424 none) dflt="Policy" ;;
2425 *) dflt="Policy $dflt" ;;
2430 dflt=`echo $hintfile | $sed 's/\.sh$//'`
2434 if $test -f Policy.sh ; then
2437 There's also a Policy hint file available, which should make the
2438 site-specific (policy) questions easier to answer.
2445 You may give one or more space-separated answers, or "none" if appropriate.
2446 A well-behaved OS will have no hints, so answering "none" or just "Policy"
2447 is a good thing. DO NOT give a wrong version or a wrong OS.
2451 rp="Which of these apply, if any?"
2454 for file in $tans; do
2455 if $test X$file = XPolicy -a -f Policy.sh; then
2457 $cat Policy.sh >> UU/config.sh
2458 elif $test -f $src/hints/$file.sh; then
2459 . $src/hints/$file.sh
2460 $cat $src/hints/$file.sh >> UU/config.sh
2461 elif $test X$tans = X -o X$tans = Xnone ; then
2464 : Give one chance to correct a possible typo.
2465 echo "$file.sh does not exist"
2467 rp="hint to use instead?"
2469 for file in $ans; do
2470 if $test -f "$src/hints/$file.sh"; then
2471 . $src/hints/$file.sh
2472 $cat $src/hints/$file.sh >> UU/config.sh
2473 elif $test X$ans = X -o X$ans = Xnone ; then
2476 echo "$file.sh does not exist -- ignored."
2483 : Remember our hint file for later.
2484 if $test -f "$src/hints/$file.sh" ; then
2494 echo "Fetching default answers from $config_sh..." >&4
2498 cp $config_sh config.sh 2>/dev/null
2508 test "$override" && . ./optdef.sh
2509 myuname="$newmyuname"
2511 : Restore computed paths
2512 for file in $loclist $trylist; do
2513 eval $file="\$_$file"
2518 Configure uses the operating system name and version to set some defaults.
2519 The default value is probably right if the name rings a bell. Otherwise,
2520 since spelling matters for me, either accept the default or answer "none"
2527 ''|' '|none) dflt=none ;;
2528 *) dflt=`echo $hintfile | $sed -e 's/\.sh$//' -e 's/_.*$//'` ;;
2531 *) dflt="$osname" ;;
2533 rp="Operating system name?"
2537 *) osname=`echo "$ans" | $sed -e 's/[ ][ ]*/_/g' | ./tr '[A-Z]' '[a-z]'`;;
2543 ''|' '|none) dflt=none ;;
2544 *) dflt=`echo $hintfile | $sed -e 's/\.sh$//' -e 's/^[^_]*//'`
2545 dflt=`echo $dflt | $sed -e 's/^_//' -e 's/_/./g'`
2547 ''|' ') dflt=none ;;
2552 *) dflt="$osvers" ;;
2554 rp="Operating system version?"
2564 : who configured the system
2565 cf_time=`LC_ALL=C; LANGUAGE=C; export LC_ALL; export LANGUAGE; $date 2>&1`
2566 cf_by=`(logname) 2>/dev/null`
2569 cf_by=`(whoami) 2>/dev/null`
2571 "") cf_by=unknown ;;
2575 : set up the script used to warn in case of inconsistency
2582 echo "*** WHOA THERE!!! ***" >&4
2583 echo " The $hint value for \$$var on this machine was \"$was\"!" >&4
2584 rp=" Keep the $hint value?"
2587 y) td=$was; tu=$was;;
2591 : function used to set $1 to $val
2592 setvar='var=$1; eval "was=\$$1"; td=$define; tu=$undef;
2594 $define$undef) . ./whoa; eval "$var=\$td";;
2595 $undef$define) . ./whoa; eval "$var=\$tu";;
2596 *) eval "$var=$val";;
2601 Perl can be built to take advantage of threads on some systems.
2602 To do so, Configure must be run with -Dusethreads.
2604 Note that threading is a highly experimental feature, and
2605 some known race conditions still remain. If you choose to try
2606 it, be very sure to not actually deploy it for production
2607 purposes. README.threads has more details, and is required
2608 reading if you enable threads.
2610 case "$usethreads" in
2611 $define|true|[yY]*) dflt='y';;
2614 rp='Build a threading Perl?'
2617 y|Y) val="$define" ;;
2623 case "$usethreads" in
2627 As of 5.5.640, Perl has two different internal threading implementations,
2628 the 5.005 version (5005threads) and an interpreter-based version
2629 (ithreads) that has one interpreter per thread. Both are very
2630 experimental. This arrangement exists to help developers work out
2631 which one is better.
2633 If you're a casual user, you probably don't want interpreter-threads
2634 at this time. There doesn't yet exist a way to create threads from
2635 within Perl in this model, i.e., "use Thread;" will NOT work.
2637 : Default to ithreads unless overridden on command line or with
2640 case "$use5005threads" in
2641 $define|true|[yY]*) dflt='n';;
2643 case "$useithreads" in
2644 $undef|false|[nN]*) dflt='n';;
2646 rp='Use interpreter-based ithreads?'
2649 y|Y) val="$define" ;;
2654 : Now set use5005threads to the opposite value.
2655 case "$useithreads" in
2656 $define) val="$undef" ;;
2663 useithreads="$undef"
2664 use5005threads="$undef"
2668 case "$d_oldpthreads" in
2669 '') : Configure tests would be welcome here. For now, assume undef.
2671 *) val="$d_oldpthreads" ;;
2677 case "$usethreads" in
2678 "$define"|true|[yY]*)
2679 : Look for a hint-file generated 'call-back-unit'. If the
2680 : user has specified that a threading perl is to be built,
2681 : we may need to set or change some other defaults.
2682 if $test -f usethreads.cbu; then
2683 echo "Your platform has some specific hints for threaded builds, using them..."
2687 (Your platform doesn't have any specific hints for threaded builds.
2688 Assuming POSIX threads, then.)
2696 Perl can be built so that multiple Perl interpreters can coexist
2697 within the same Perl executable.
2700 case "$useithreads" in
2703 This multiple interpreter support is required for interpreter-based threads.
2708 echo 'Normally you do not need this and you should answer no.'
2709 case "$usemultiplicity" in
2710 $define|true|[yY]*) dflt='y';;
2713 rp='Build Perl for multiplicity?'
2716 y|Y) val="$define" ;;
2724 : determine where manual pages are on this system
2728 syspath='/usr/man/man1 /usr/man/mann /usr/man/manl /usr/man/local/man1'
2729 syspath="$syspath /usr/man/u_man/man1 /usr/share/man/man1"
2730 syspath="$syspath /usr/catman/u_man/man1 /usr/man/l_man/man1"
2731 syspath="$syspath /usr/local/man/u_man/man1 /usr/local/man/l_man/man1"
2732 syspath="$syspath /usr/man/man.L /local/man/man1 /usr/local/man/man1"
2733 sysman=`./loc . /usr/man/man1 $syspath`
2736 if $test -d "$sysman"; then
2737 echo "System manual is in $sysman." >&4
2739 echo "Could not find manual pages in source form." >&4
2742 : see what memory models we can support
2745 $cat >pdp11.c <<'EOP'
2754 ( cc -o pdp11 pdp11.c ) >/dev/null 2>&1
2755 if $test -f pdp11 && ./pdp11 2>/dev/null; then
2756 dflt='unsplit split'
2758 tans=`./loc . X /lib/small /lib/large /usr/lib/small /usr/lib/large /lib/medium /usr/lib/medium /lib/huge`
2761 *) if $test -d /lib/small || $test -d /usr/lib/small; then
2766 if $test -d /lib/medium || $test -d /usr/lib/medium; then
2769 if $test -d /lib/large || $test -d /usr/lib/large; then
2772 if $test -d /lib/huge || $test -d /usr/lib/huge; then
2781 Some systems have different model sizes. On most systems they are called
2782 small, medium, large, and huge. On the PDP11 they are called unsplit and
2783 split. If your system doesn't support different memory models, say "none".
2784 If you wish to force everything to one memory model, say "none" here and
2785 put the appropriate flags later when it asks you for other cc and ld flags.
2786 Venix systems may wish to put "none" and let the compiler figure things out.
2787 (In the following question multiple model names should be space separated.)
2789 The default for most systems is "none".
2792 rp="Which memory models are supported?"
2807 '') if $contains '\-i' $sysman/ld.1 >/dev/null 2>&1 || \
2808 $contains '\-i' $sysman/cc.1 >/dev/null 2>&1; then
2815 rp="What flag indicates separate I and D space?"
2823 *large*|*small*|*medium*|*huge*)
2830 rp="What flag indicates large model?"
2840 *huge*) case "$huge" in
2844 rp="What flag indicates huge model?"
2854 *medium*) case "$medium" in
2858 rp="What flag indicates medium model?"
2865 *) medium="$large";;
2868 *small*) case "$small" in
2872 rp="What flag indicates small model?"
2883 echo "Unrecognized memory models--you may have to edit Makefile.SH" >&4
2886 $rm -f pdp11.* pdp11
2888 : make some quick guesses about what we are up against
2890 $echo $n "Hmm... $c"
2900 $cat /usr/include/signal.h /usr/include/sys/signal.h >foo 2>/dev/null
2901 if test -f /osf_boot || $contains 'OSF/1' /usr/include/ctype.h >/dev/null 2>&1
2903 echo "Looks kind of like an OSF/1 system, but we'll see..."
2905 elif test `echo abc | tr a-z A-Z` = Abc ; then
2906 xxx=`./loc addbib blurfl $pth`
2907 if $test -f $xxx; then
2908 echo "Looks kind of like a USG system with BSD features, but we'll see..."
2912 if $contains SIGTSTP foo >/dev/null 2>&1 ; then
2913 echo "Looks kind of like an extended USG system, but we'll see..."
2915 echo "Looks kind of like a USG system, but we'll see..."
2919 elif $contains SIGTSTP foo >/dev/null 2>&1 ; then
2920 echo "Looks kind of like a BSD system, but we'll see..."
2924 echo "Looks kind of like a Version 7 system, but we'll see..."
2927 case "$eunicefix" in
2930 There is, however, a strange, musty smell in the air that reminds me of
2931 something...hmm...yes...I've got it...there's a VMS nearby, or I'm a Blit.
2935 : it so happens the Eunice I know will not run shell scripts in Unix format
2939 echo "Congratulations. You aren't running Eunice."
2943 : Detect OS2. The p_ variable is set above in the Head.U unit.
2948 I have the feeling something is not exactly right, however...don't tell me...
2949 lemme think...does HAL ring a bell?...no, of course, you're only running OS/2!
2954 if test -f /xenix; then
2955 echo "Actually, this looks more like a XENIX system..."
2960 echo "It's not Xenix..."
2965 if test -f /venix; then
2966 echo "Actually, this looks more like a VENIX system..."
2973 echo "Nor is it Venix..."
2976 chmod +x bsd usg v7 osf1 eunice xenix venix os2
2977 $eunicefix bsd usg v7 osf1 eunice xenix venix os2
2980 : see if we need a special compiler
2988 *) if $contains '\-M' $sysman/cc.1 >/dev/null 2>&1 ; then
2989 if $contains '\-M' $sysman/cpp.1 >/dev/null 2>&1; then
3003 On some older systems the default C compiler will not resolve multiple global
3004 references that happen to have the same name. On some such systems the "Mcc"
3005 command may be used to force these to be resolved. On other systems a "cc -M"
3006 command is required. (Note that the -M flag on other systems indicates a
3007 memory model to use!) If you have the Gnu C compiler, you might wish to use
3013 rp="Use which C compiler?"
3021 rp="Use which C compiler?"
3025 : Look for a hint-file generated 'call-back-unit'. Now that the
3026 : user has specified the compiler, we may need to set or change some
3028 if $test -f cc.cbu; then
3032 echo "Checking for GNU cc in disguise and/or its version number..." >&4
3033 $cat >gccvers.c <<EOM
3038 printf("%s\n", __VERSION__);
3040 printf("%s\n", "1");
3046 if $cc -o gccvers gccvers.c; then
3047 gccversion=`./gccvers`
3048 case "$gccversion" in
3049 '') echo "You are not using GNU cc." ;;
3050 *) echo "You are using GNU cc $gccversion."
3055 echo "*** WHOA THERE!!! ***" >&4
3056 echo " Your C compiler \"$cc\" doesn't seem to be working!" >&4
3057 case "$knowitall" in
3059 echo " You'd better start hunting for one and let me know about it." >&4
3065 case "$gccversion" in
3066 1*) cpp=`./loc gcc-cpp $cpp $pth` ;;
3069 : decide how portable to be. Allow command line overrides.
3070 case "$d_portable" in
3072 *) d_portable="$define" ;;
3075 : set up shell script to do ~ expansion
3081 echo \$1 | $sed "s|~|\${HOME-\$LOGDIR}|"
3084 if $test -f /bin/csh; then
3085 /bin/csh -f -c "glob \$1"
3090 name=\`$expr x\$1 : '..\([^/]*\)'\`
3091 dir=\`$sed -n -e "/^\${name}:/{s/^[^:]*:[^:]*:[^:]*:[^:]*:[^:]*:\([^:]*\).*"'\$'"/\1/" -e p -e q -e '}' </etc/passwd\`
3092 if $test ! -d "\$dir"; then
3094 echo "\$me: can't locate home directory for: \$name" >&2
3099 echo \$dir/\`$expr x\$1 : '..[^/]*/\(.*\)'\`
3115 : now set up to get a file name
3119 cat <<'EOSC' >>getfile
3135 expr $fn : '.*(\(.*\)).*' | tr ',' $trnl >getfile.ok
3136 fn=`echo $fn | sed 's/(.*)//'`
3142 loc_file=`expr $fn : '.*:\(.*\)'`
3143 fn=`expr $fn : '\(.*\):.*'`
3151 */*) fullpath=true;;
3160 *e*) exp_file=true;;
3163 *p*) nopath_ok=true;;
3168 *d*) type='Directory';;
3169 *l*) type='Locate';;
3174 Locate) what='File';;
3179 case "$d_portable" in
3187 while test "$type"; do
3192 true) rp="$rp (~name ok)";;
3195 if test -f UU/getfile.ok && \
3196 $contains "^$ans\$" UU/getfile.ok >/dev/null 2>&1
3215 value=`UU/filexp $ans`
3218 if test "$ans" != "$value"; then
3219 echo "(That expands to $value on this system.)"
3233 /*) value="$ansexp" ;;
3238 echo "I shall only accept a full path name, as in /bin/ls." >&4
3239 echo "Use a ! shell escape if you wish to check pathnames." >&4
3242 echo "Please give a full path name, starting with slash." >&4
3245 echo "Note that using ~name is ok provided it expands well." >&4
3258 for fp in $gfpth; do
3259 if test "X$fp" = X.; then
3264 if test -f "$pf"; then
3266 elif test -r "$pf" || (test -h "$pf") >/dev/null 2>&1
3268 echo "($value is not a plain file, but that's ok.)"
3271 if test X"$type" = X; then
3278 for fp in $gfpth; do
3279 if test "X$fp" = X.; then
3284 if test -d "$pf"; then
3292 if test -d "$ansexp"; then
3293 echo "(Looking for $loc_file in directory $value.)"
3294 value="$value/$loc_file"
3295 ansexp="$ansexp/$loc_file"
3297 if test -f "$ansexp"; then
3300 case "$nopath_ok" in
3301 true) case "$value" in
3303 *) echo "Assuming $value will be in people's path."
3319 if test "$fastread" = yes; then
3324 rp="$what $value doesn't exist. Use that name anyway?"
3343 test "X$gfpthkeep" != Xy && gfpth=""
3346 : What should the include directory be ?
3348 $echo $n "Hmm... $c"
3352 if $test -f /bin/mips && /bin/mips; then
3353 echo "Looks like a MIPS system..."
3354 $cat >usr.c <<'EOCP'
3355 #ifdef SYSTYPE_BSD43
3359 if $cc -E usr.c > usr.out && $contains / usr.out >/dev/null 2>&1; then
3360 dflt='/bsd43/usr/include'
3364 mips_type='System V'
3366 $rm -f usr.c usr.out
3367 echo "and you're compiling with the $mips_type compiler and libraries."
3371 echo "Doesn't look like a MIPS system."
3381 case "$xxx_prompt" in
3384 rp='Where are the include files you want to use?'
3392 : see how we invoke the C preprocessor
3394 echo "Now, how can we feed standard input to your C preprocessor..." >&4
3395 cat <<'EOT' >testcpp.c
3401 if test ! -f cppstdin; then
3402 if test "X$osname" = "Xaix" -a "X$gccversion" = X; then
3403 # AIX cc -E doesn't show the absolute headerfile
3404 # locations but we'll cheat by using the -M flag.
3405 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
3407 echo 'cat >.$$.c; '"$cc"' -E ${1+"$@"} .$$.c; rm .$$.c' >cppstdin
3410 echo "Keeping your $hint cppstdin wrapper."
3413 wrapper=`pwd`/cppstdin
3417 if $test "X$cppstdin" != "X" && \
3418 $cppstdin $cppminus <testcpp.c >testcpp.out 2>&1 && \
3419 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
3421 echo "You used to use $cppstdin $cppminus so we'll use that again."
3423 '') echo "But let's see if we can live without a wrapper..." ;;
3425 if $cpprun $cpplast <testcpp.c >testcpp.out 2>&1 && \
3426 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
3428 echo "(And we'll use $cpprun $cpplast to preprocess directly.)"
3431 echo "(However, $cpprun $cpplast does not work, let's see...)"
3439 echo "Good old $cppstdin $cppminus does not seem to be of any help..."
3446 elif echo 'Maybe "'"$cc"' -E" will work...'; \
3447 $cc -E <testcpp.c >testcpp.out 2>&1; \
3448 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3449 echo "Yup, it does."
3452 elif echo 'Nope...maybe "'"$cc"' -E -" will work...'; \
3453 $cc -E - <testcpp.c >testcpp.out 2>&1; \
3454 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3455 echo "Yup, it does."
3458 elif echo 'Nope...maybe "'"$cc"' -P" will work...'; \
3459 $cc -P <testcpp.c >testcpp.out 2>&1; \
3460 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3461 echo "Yipee, that works!"
3464 elif echo 'Nope...maybe "'"$cc"' -P -" will work...'; \
3465 $cc -P - <testcpp.c >testcpp.out 2>&1; \
3466 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3467 echo "At long last!"
3470 elif echo 'No such luck, maybe "'$cpp'" will work...'; \
3471 $cpp <testcpp.c >testcpp.out 2>&1; \
3472 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3476 elif echo 'Nixed again...maybe "'$cpp' -" will work...'; \
3477 $cpp - <testcpp.c >testcpp.out 2>&1; \
3478 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3479 echo "Hooray, it works! I was beginning to wonder."
3482 elif echo 'Uh-uh. Time to get fancy. Trying a wrapper...'; \
3483 $wrapper <testcpp.c >testcpp.out 2>&1; \
3484 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3490 rp="No dice. I can't find a C preprocessor. Name one:"
3494 $x_cpp <testcpp.c >testcpp.out 2>&1
3495 if $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3496 echo "OK, that will do." >&4
3498 echo "Sorry, I can't get that to work. Go find one and rerun Configure." >&4
3513 echo "Perhaps can we force $cc -E using a wrapper..."
3514 if $wrapper <testcpp.c >testcpp.out 2>&1; \
3515 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
3521 echo "Nope, we'll have to live without it..."
3535 "$wrapper"|'cppstdin') ;;
3536 *) $rm -f $wrapper;;
3538 $rm -f testcpp.c testcpp.out
3540 : Set private lib path
3543 plibpth="$incpath/usr/lib /usr/local/lib /usr/ccs/lib"
3548 '') dlist="$loclibpth $plibpth $glibpth";;
3549 *) dlist="$libpth";;
3552 : Now check and see which directories actually exist, avoiding duplicates
3556 if $test -d $xxx; then
3559 *) libpth="$libpth $xxx";;
3565 Some systems have incompatible or broken versions of libraries. Among
3566 the directories listed in the question below, please remove any you
3567 know not to be holding relevant libraries, and add any that are needed.
3568 Say "none" for none.
3579 rp="Directories to use for library searches?"
3586 : compute shared library extension
3589 if xxx=`./loc libc.sl X $libpth`; $test -f "$xxx"; then
3599 On some systems, shared libraries may be available. Answer 'none' if
3600 you want to suppress searching of shared libraries for the remainder
3601 of this configuration.
3604 rp='What is the file extension used for shared libraries?'
3608 : Define several unixisms.
3609 : Hints files or command line option can be used to override them.
3610 : The convoluted testing is in case hints files set either the old
3613 '') case "$exe_ext" in
3615 *) _exe="$exe_ext" ;;
3620 '') case "$lib_ext" in
3627 '') case "$obj_ext" in
3634 '') case "$path_sep" in
3645 : Which makefile gets called first. This is used by make depend.
3646 case "$firstmakefile" in
3647 '') firstmakefile='makefile';;
3652 Perl can be built to use the SOCKS proxy protocol library. To do so,
3653 Configure must be run with -Dusesocks.
3655 Normally you do not need this and you should answer no.
3659 $define|true|[yY]*) dflt='y';;
3662 rp='Build Perl for SOCKS?'
3665 y|Y) val="$define" ;;
3671 : Looking for optional libraries
3673 echo "Checking for optional libraries..." >&4
3678 case "$libswanted" in
3679 '') libswanted='c_s';;
3683 libswanted="$libswanted socks5 socks5_sh"
3686 for thislib in $libswanted; do
3689 if xxx=`./loc lib$thislib.$so.[0-9]'*' X $libpth`;
3690 $test -f "$xxx" -a "X$ignore_versioned_solibs" = "X"; then
3692 elif xxx=`./loc lib$thislib.$so X $libpth` ; $test -f "$xxx"; then
3694 elif xxx=`./loc lib$thislib$_a X $libpth`; $test -f "$xxx"; then
3696 elif xxx=`./loc $thislib$_a X $libpth`; $test -f "$xxx"; then
3698 elif xxx=`./loc lib${thislib}_s$_a X $libpth`; $test -f "$xxx"; then
3700 libname=${thislib}_s
3701 elif xxx=`./loc Slib$thislib$_a X $xlibpth`; $test -f "$xxx"; then
3704 if $test -f "$xxx"; then
3707 if $test -f "$xxx"; then
3709 shared) echo "Found -l$libname (shared)." ;;
3710 static) echo "Found -l$libname." ;;
3711 *) echo "Found -l$libname ($libstyle)." ;;
3715 *) dflt="$dflt -l$libname"
3716 libsfound="$libsfound $xxx"
3718 libsfiles="$libsfiles $yyy"
3719 yyy=`echo $xxx|sed "s@/$yyy\\$@@"`
3720 case " $libsdirs " in
3722 *) libsdirs="$libsdirs $yyy" ;;
3727 echo "No -l$thislib."
3738 ' '|'') dflt='none';;
3743 In order to compile $package on your machine, a number of libraries
3744 are usually needed. Include any other special libraries here as well.
3745 Say "none" for none. The default list is almost always right.
3749 rp="What libraries to use?"
3756 : determine optimization, if desired, or use for debug flag also
3758 ' '|$undef) dflt='none';;
3760 *) dflt="$optimize";;
3764 By default, $package compiles with the -O flag to use the optimizer.
3765 Alternately, you might want to use the symbolic debugger, which uses
3766 the -g flag (on traditional Unix systems). Either flag can be
3767 specified here. To use neither flag, specify the word "none".
3770 rp="What optimizer/debugger flag should be used?"
3774 'none') optimize=" ";;
3778 : We will not override a previous value, but we might want to
3779 : augment a hint file
3781 default|recommended)
3782 case "$gccversion" in
3783 1*) dflt='-fpcc-struct-return' ;;
3786 *-g*) dflt="$dflt -DDEBUGGING";;
3788 case "$gccversion" in
3789 2*) if test -d /etc/conf/kconfig.d &&
3790 $contains _POSIX_VERSION $usrinc/sys/unistd.h >/dev/null 2>&1
3796 case "$gccversion" in
3800 echo "Checking if your compiler accepts -fno-strict-aliasing" 2>&1
3801 echo 'int main(void) { return 0; }' > gcctest.c
3802 if $cc -O2 -fno-strict-aliasing -o gcctest gcctest.c; then
3803 echo "Yes, it does." 2>&1
3806 echo "Leaving current flags $ccflags alone." 2>&1
3808 *) dflt="$dflt -fno-strict-aliasing" ;;
3811 echo "Nope, it doesn't, but that's ok." 2>&1
3818 case "$mips_type" in
3819 *BSD*|'') inclwanted="$locincpth $usrinc";;
3820 *) inclwanted="$locincpth $inclwanted $usrinc/bsd";;
3822 for thisincl in $inclwanted; do
3823 if $test -d $thisincl; then
3824 if $test x$thisincl != x$usrinc; then
3827 *) dflt="$dflt -I$thisincl";;
3833 inctest='if $contains $2 $usrinc/$1 >/dev/null 2>&1; then
3835 elif $contains $2 $usrinc/sys/$1 >/dev/null 2>&1; then
3843 *) dflt="$dflt -D$2";;
3847 set signal.h LANGUAGE_C; eval $inctest
3851 ccflags="$ccflags -DSOCKS"
3856 default|recommended) dflt="$ccflags $dflt" ;;
3857 *) dflt="$ccflags";;
3865 Your C compiler may want other flags. For this question you should include
3866 -I/whatever and -DWHATEVER flags and any other flags used by the C compiler,
3867 but you should NOT include libraries or ld flags like -lwhatever. If you
3868 want $package to honor its debug switch, you should include -DDEBUGGING here.
3869 Your C compiler might also need additional flags, such as -D_POSIX_SOURCE.
3871 To use no flags, specify the word "none".
3877 rp="Any additional cc flags?"
3884 : the following weeds options from ccflags that are of no interest to cpp
3886 case "$gccversion" in
3887 1*) cppflags="$cppflags -D__GNUC__"
3889 case "$mips_type" in
3891 *BSD*) cppflags="$cppflags -DSYSTYPE_BSD43";;
3897 echo "Let me guess what the preprocessor flags are..." >&4
3911 *) ftry="$previous $flag";;
3913 if $cppstdin -DLFRULB=bar $cppflags $ftry $cppminus <cpp.c \
3914 >cpp1.out 2>/dev/null && \
3915 $cpprun -DLFRULB=bar $cppflags $ftry $cpplast <cpp.c \
3916 >cpp2.out 2>/dev/null && \
3917 $contains 'foo.*xx.*bar' cpp1.out >/dev/null 2>&1 && \
3918 $contains 'foo.*xx.*bar' cpp2.out >/dev/null 2>&1
3920 cppflags="$cppflags $ftry"
3930 *-*) echo "They appear to be: $cppflags";;
3932 $rm -f cpp.c cpp?.out
3936 : flags used in final linking phase
3938 '') if ./venix; then
3944 *-posix*) dflt="$dflt -posix" ;;
3947 *) dflt="$ldflags";;
3950 : Try to guess additional flags to pick up local libraries.
3951 for thislibdir in $libpth; do
3952 case " $loclibpth " in
3955 *"-L$thislibdir "*) ;;
3956 *) dflt="$dflt -L$thislibdir" ;;
3968 Your C linker may need flags. For this question you should
3969 include -L/whatever and any other flags used by the C linker, but you
3970 should NOT include libraries like -lwhatever.
3972 Make sure you include the appropriate -L/path flags if your C linker
3973 does not normally search all of the directories you specified above,
3976 To use no flags, specify the word "none".
3980 rp="Any additional ld flags (NOT including libraries)?"
3986 rmlist="$rmlist pdp11"
3990 echo "Checking your choice of C compiler and flags for coherency..." >&4
3991 $cat > try.c <<'EOF'
3993 int main() { printf("Ok\n"); exit(0); }
3995 set X $cc $optimize $ccflags -o try $ldflags try.c $libs
3997 $cat >try.msg <<'EOM'
3998 I've tried to compile and run the following simple program:
4001 $cat try.c >> try.msg
4003 $cat >> try.msg <<EOM
4010 and I got the following output:
4014 if sh -c "$cc $optimize $ccflags -o try $ldflags try.c $libs" >>try.msg 2>&1; then
4015 if sh -c './try' >>try.msg 2>&1; then
4019 *) echo 'The program compiled OK, but produced no output.' >> try.msg
4022 cat >> try.msg <<'EOQS'
4023 If $libs contains -lsfio, and sfio is mis-configured, then it
4024 sometimes (apparently) runs and exits with a 0 status, but with no
4025 output! It may have to do with sfio's use of _exit vs. exit.
4028 rp="You have a big problem. Shall I abort Configure"
4035 echo "The program compiled OK, but exited with status $?." >>try.msg
4036 rp="You have a problem. Shall I abort Configure"
4040 echo "I can't compile the test program." >>try.msg
4041 rp="You have a BIG problem. Shall I abort Configure"
4047 case "$knowitall" in
4049 echo "(The supplied flags or libraries might be incorrect.)"
4057 *) echo "Ok. Stopping Configure." >&4
4062 n) echo "OK, that should do.";;
4064 $rm -f try try.* core
4066 : define an is-a-typedef? function
4067 typedef='type=$1; var=$2; def=$3; shift; shift; shift; inclist=$@;
4069 "") inclist="sys/types.h";;
4071 eval "varval=\$$var";
4075 for inc in $inclist; do
4076 echo "#include <$inc>" >>temp.c;
4078 echo "#ifdef $type" >> temp.c;
4079 echo "printf(\"We have $type\");" >> temp.c;
4080 echo "#endif" >> temp.c;
4081 $cppstdin $cppflags $cppminus < temp.c >temp.E 2>/dev/null;
4082 if $contains $type temp.E >/dev/null 2>&1; then
4088 *) eval "$var=\$varval";;
4091 : define an is-a-typedef? function that prompts if the type is not available.
4092 typedef_ask='type=$1; var=$2; def=$3; shift; shift; shift; inclist=$@;
4094 "") inclist="sys/types.h";;
4096 eval "varval=\$$var";
4100 for inc in $inclist; do
4101 echo "#include <$inc>" >>temp.c;
4103 echo "#ifdef $type" >> temp.c;
4104 echo "printf(\"We have $type\");" >> temp.c;
4105 echo "#endif" >> temp.c;
4106 $cppstdin $cppflags $cppminus < temp.c >temp.E 2>/dev/null;
4108 echo "$rp" | $sed -e "s/What is/Looking for/" -e "s/?/./";
4109 if $contains $type temp.E >/dev/null 2>&1; then
4110 echo "$type found." >&4;
4113 echo "$type NOT found." >&4;
4119 *) eval "$var=\$varval";;
4122 : define a shorthand compile call
4126 $cc $optimize $ccflags $ldflags -o ${mc_file} $* ${mc_file}.c $libs > /dev/null 2>&1;'
4127 : define a shorthand compile call for compilations that should be ok.
4131 $cc $optimize $ccflags $ldflags -o ${mc_file} $* ${mc_file}.c $libs;'
4133 : check for lengths of integral types
4137 echo "Checking to see how big your integers are..." >&4
4138 $cat >intsize.c <<'EOCP'
4142 printf("intsize=%d;\n", (int)sizeof(int));
4143 printf("longsize=%d;\n", (int)sizeof(long));
4144 printf("shortsize=%d;\n", (int)sizeof(short));
4149 if eval $compile_ok && ./intsize > /dev/null; then
4151 echo "Your integers are $intsize bytes long."
4152 echo "Your long integers are $longsize bytes long."
4153 echo "Your short integers are $shortsize bytes long."
4157 Help! I can't compile and run the intsize test program: please enlighten me!
4158 (This is probably a misconfiguration in your system or libraries, and
4159 you really ought to fix it. Still, I'll try anyway.)
4163 rp="What is the size of an integer (in bytes)?"
4167 rp="What is the size of a long integer (in bytes)?"
4171 rp="What is the size of a short integer (in bytes)?"
4177 $rm -f intsize intsize.*
4179 : see what type lseek is declared as in the kernel
4180 rp="What is the type used for lseek's offset on this system?"
4181 set off_t lseektype long stdio.h sys/types.h
4185 $echo $n "Checking to see how big your file offsets are...$c" >&4
4187 #include <sys/types.h>
4191 printf("%d\n", (int)sizeof($lseektype));
4196 if eval $compile_ok; then
4198 $echo " $lseeksize bytes." >&4
4202 echo "(I can't seem to compile the test program. Guessing...)"
4203 rp="What is the size of your file offsets (in bytes)?"
4209 : see what type file positions are declared as in the library
4210 rp="What is the type for file position used by fsetpos()?"
4211 set fpos_t fpostype long stdio.h sys/types.h
4216 *_t) zzz="$fpostype" ;;
4219 $echo $n "Checking the size of $zzz...$c" >&4
4221 #include <sys/types.h>
4224 printf("%d\n", (int)sizeof($fpostype));
4229 if eval $compile_ok; then
4234 echo "(I can't execute the test program--guessing $fpossize.)" >&4
4237 echo " $fpossize bytes."
4243 echo "(I can't compile the test program. Guessing...)" >&4
4244 rp="What is the size of your file positions (in bytes)?"
4251 case "$lseeksize:$fpossize" in
4254 You can have files larger than 2 gigabytes.
4259 Perl can be built to understand large files (files larger than 2 gigabytes)
4260 on some systems. To do so, Configure must be run with -Duselargefiles.
4262 If this doesn't make any sense to you, just accept the default 'y'.
4264 case "$uselargefiles" in
4265 "$undef"|false|[nN]*) dflt='n' ;;
4268 rp='Try to understand large files, if available?'
4271 y|Y) val="$define" ;;
4278 case "$uselargefiles" in
4280 : Look for a hint-file generated 'call-back-unit'. If the
4281 : user has specified that a large files perl is to be built,
4282 : we may need to set or change some other defaults.
4283 if $test -f uselfs.cbu; then
4284 echo "Your platform has some specific hints for large file builds, using them..."
4287 $echo $n "Rechecking to see how big your file offsets are...$c" >&4
4289 #include <sys/types.h>
4293 printf("%d\n", (int)sizeof($lseektype));
4298 if eval $compile_ok; then
4300 $echo " $lseeksize bytes." >&4
4304 echo "(I can't seem to compile the test program. Guessing...)"
4305 rp="What is the size of your file offsets (in bytes)?"
4310 *_t) zzz="$fpostype" ;;
4313 $echo $n "Rechecking the size of $zzz...$c" >&4
4315 #include <sys/types.h>
4318 printf("%d\n", (int)sizeof($fpostype));
4323 if eval $compile_ok; then
4328 echo "(I can't execute the test program--guessing $fpossize.)" >&4
4331 echo " $fpossize bytes."
4337 echo "(I can't compile the test program. Guessing...)" >&4
4338 rp="What is the size of your file positions (in bytes)?"
4348 case "$usemorebits" in
4349 "$define"|true|[yY]*)
4351 uselongdouble="$define"
4352 usemorebits="$define"
4354 *) usemorebits="$undef"
4359 case "$intsize:$longsize" in
4362 You have natively 64-bit integers.
4367 Perl can be built to take advantage of 64-bit integer types
4368 on some systems. To do so, Configure must be run with -Duse64bits.
4370 If this doesn't make any sense to you, just accept the default.
4372 case "$use64bits" in
4373 $define|true|[yY]*) dflt='y';;
4376 rp='Try to use 64-bit integers, if available?'
4379 y|Y) val="$define" ;;
4387 case "$archname64" in
4388 '') archname64='' ;; # not a typo
4391 case "$use64bits" in
4392 "$define"|true|[yY]*)
4393 : Look for a hint-file generated 'call-back-unit'. If the
4394 : user has specified that a 64-bit perl is to be built,
4395 : we may need to set or change some other defaults.
4396 if $test -f use64bits.cbu; then
4397 echo "Your platform has some specific hints for 64-bit builds, using them..."
4401 (Your platform doesn't have any specific hints for 64-bit builds.)
4403 case "$intsize:$longsize" in
4405 (This is probably okay, as your system is a natively 64-bit system.)
4409 case "$gccversion" in
4411 *) case "$ccflags" in
4412 *-DUSE_LONG_LONG*) ;;
4414 But since you seem to be using gcc, I will now add -DUSE_LONG_LONG
4415 to the compilation flags.
4417 ccflags="$ccflags -DUSE_LONG_LONG"
4426 : determine the architecture name
4428 if xxx=`./loc arch blurfl $pth`; $test -f "$xxx"; then
4429 tarch=`arch`"-$osname"
4430 elif xxx=`./loc uname blurfl $pth`; $test -f "$xxx" ; then
4431 if uname -m > tmparch 2>&1 ; then
4432 tarch=`$sed -e 's/ *$//' -e 's/ /_/g' \
4433 -e 's/$/'"-$osname/" tmparch`
4441 case "$myarchname" in
4444 echo "(Your architecture name used to be $myarchname.)"
4451 *) dflt="$archname";;
4453 rp='What is your architecture name'
4456 case "$usethreads" in
4458 echo "Threads selected." >&4
4460 *-thread*) echo "...and architecture name already has -thread." >&4
4462 *) archname="$archname-thread"
4463 echo "...setting architecture name to $archname." >&4
4468 case "$usemultiplicity" in
4470 echo "Multiplicity selected." >&4
4472 *-multi*) echo "...and architecture name already has -multi." >&4
4474 *) archname="$archname-multi"
4475 echo "...setting architecture name to $archname." >&4
4480 case "$use64bits" in
4482 case "$archname64" in
4487 *-$archname64*) echo "...and architecture name already has $archname64." >&4
4489 *) archname="$archname-$archname64"
4490 echo "...setting architecture name to $archname." >&4
4497 : determine root of directory hierarchy where package will be installed.
4500 dflt=`./loc . /usr/local /usr/local /local /opt /usr`
4508 By default, $package will be installed in $dflt/bin, manual pages
4509 under $dflt/man, etc..., i.e. with $dflt as prefix for all
4510 installation directories. Typically this is something like /usr/local.
4511 If you wish to have binaries under /usr/bin but other parts of the
4512 installation under /usr/local, that's ok: you will be prompted
4513 separately for each of the installation directories, the prefix being
4514 only used to set the defaults.
4518 rp='Installation prefix to use?'
4526 *) oldprefix="$prefix";;
4536 $define|true) afs=true ;;
4537 $undef|false) afs=false ;;
4538 *) if test -d /afs; then
4546 echo "AFS may be running... I'll be extra cautious then..." >&4
4548 echo "AFS does not seem to be running..." >&4
4551 : determine installation prefix for where package is to be installed.
4555 Since you are running AFS, I need to distinguish the directory in which
4556 files will reside from the directory in which they are installed (and from
4557 which they are presumably copied to the former directory by occult means).
4560 case "$installprefix" in
4561 '') dflt=`echo $prefix | sed 's#^/afs/#/afs/.#'`;;
4562 *) dflt="$installprefix";;
4567 In some special cases, particularly when building $package for distribution,
4568 it is convenient to distinguish between the directory in which files should
4569 be installed from the directory ($prefix) in which they
4570 will eventually reside. For most users, these two directories are the same.
4573 case "$installprefix" in
4575 *) dflt=$installprefix;;
4579 rp='What installation prefix should I use for installing files?'
4581 installprefix="$ans"
4582 installprefixexp="$ansexp"
4584 : set the prefixit variable, to compute a suitable default value
4585 prefixit='case "$3" in
4587 case "$oldprefix" in
4588 "") eval "$1=\"\$$2\"";;
4595 ""|" ") eval "$1=\"\$$2\"";;
4601 eval "tp=\"$oldprefix-\$$2-\""; eval "tp=\"$tp\"";
4603 --|/*--|\~*--) eval "$1=\"$prefix/$3\"";;
4604 /*-$oldprefix/*|\~*-$oldprefix/*)
4605 eval "$1=\`echo \$$2 | sed \"s,^$oldprefix,$prefix,\"\`";;
4606 *) eval "$1=\"\$$2\"";;
4610 : set the base revision
4614 : get the patchlevel
4616 echo "Getting the current patchlevel..." >&4
4617 if $test -r $rsrc/patchlevel.h;then
4618 patchlevel=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
4619 subversion=`awk '/define[ ]+PERL_SUBVERSION/ {print $3}' $rsrc/patchlevel.h`
4620 api_revision=`awk '/define[ ]+PERL_API_REVISION/ {print $3}' $rsrc/patchlevel.h`
4621 api_version=`awk '/define[ ]+PERL_API_VERSION/ {print $3}' $rsrc/patchlevel.h`
4622 api_subversion=`awk '/define[ ]+PERL_API_SUBVERSION/ {print $3}' $rsrc/patchlevel.h`
4630 $echo $n "(You have $package" $c
4633 *) $echo $n " $baserev" $c ;;
4635 $echo $n " patchlevel $patchlevel" $c
4636 test 0 -eq "$subversion" || $echo $n " subversion $subversion" $c
4640 : XXX Should be a Configure test for double-dots in filenames.
4641 version=`echo $baserev $patchlevel $subversion | \
4642 $awk '{ printf "%d_%d_%d\n", $1, $2, $3 }'`
4643 api_versionstring=`echo $api_revision $api_version $api_subversion | \
4644 $awk '{ printf "%d_%d_%d\n", $1, $2, $3 }'`
4647 version=`echo $baserev $patchlevel $subversion | \
4648 $awk '{ printf "%d.%d.%d\n", $1, $2, $3 }'`
4649 api_versionstring=`echo $api_revision $api_version $api_subversion | \
4650 $awk '{ printf "%d.%d.%d\n", $1, $2, $3 }'`
4653 : Special case the 5.005_xx maintenance series, which used 5.005
4654 : without any subversion label as a subdirectory in $sitelib
4655 if test "${api_revision}${api_version}${api_subversion}" = "550"; then
4656 api_versionstring='5.005'
4659 : determine installation style
4660 : For now, try to deduce it from prefix unless it is already set.
4661 : Reproduce behavior of 5.005 and earlier, maybe drop that in 5.7.
4662 case "$installstyle" in
4663 '') case "$prefix" in
4664 *perl*) dflt='lib';;
4665 *) dflt='lib/perl5' ;;
4668 *) dflt='lib/perl5' ;;
4670 : Probably not worth prompting for this since we prompt for all
4671 : the directories individually, and the prompt would be too long and
4675 : determine where private library files go
4676 : Usual default is /usr/local/lib/perl5/$version.
4677 : Also allow things like /opt/perl/lib/$version, since
4678 : /opt/perl/lib/perl5... would be redundant.
4679 : The default "style" setting is made in installstyle.U
4680 case "$installstyle" in
4681 *lib/perl5*) set dflt privlib lib/$package/$version ;;
4682 *) set dflt privlib lib/$version ;;
4687 There are some auxiliary files for $package that need to be put into a
4688 private library directory that is accessible by everyone.
4692 rp='Pathname where the private library files will reside?'
4695 privlibexp="$ansexp"
4696 : Change installation prefix, if necessary.
4697 if $test X"$prefix" != X"$installprefix"; then
4698 installprivlib=`echo $privlibexp | sed "s#^$prefix#$installprefix#"`
4700 installprivlib="$privlibexp"
4703 : set the prefixup variable, to restore leading tilda escape
4704 prefixup='case "$prefixexp" in
4706 *) eval "$1=\`echo \$$1 | sed \"s,^$prefixexp,$prefix,\"\`";;
4709 : determine where public architecture dependent libraries go
4712 : privlib default is /usr/local/lib/$package/$version
4713 : archlib default is /usr/local/lib/$package/$version/$archname
4714 : privlib may have an optional trailing /share.
4715 tdflt=`echo $privlib | $sed 's,/share$,,'`
4716 tdflt=$tdflt/$archname
4725 $spackage contains architecture-dependent library files. If you are
4726 sharing libraries in a heterogeneous environment, you might store
4727 these files in a separate location. Otherwise, you can just include
4728 them with the rest of the public library files.
4732 rp='Where do you want to put the public architecture-dependent libraries?'
4735 archlibexp="$ansexp"
4736 if $test X"$archlib" = X"$privlib"; then
4741 : Change installation prefix, if necessary.
4742 if $test X"$prefix" != X"$installprefix"; then
4743 installarchlib=`echo $archlibexp | sed "s#^$prefix#$installprefix#"`
4745 installarchlib="$archlibexp"
4749 : Binary compatibility with 5.005 is not possible for builds
4750 : with advanced features
4751 case "$usethreads$usemultiplicity" in
4753 bincompat5005="$undef"
4754 d_bincompat5005="$undef"
4758 Perl 5.006 can be compiled for binary compatibility with 5.005.
4759 If you decide to do so, you will be able to continue using most
4760 of the extensions that were compiled for Perl 5.005.
4763 case "$bincompat5005$d_bincompat5005" in
4764 *"$undef"*) dflt=n ;;
4767 rp='Binary compatibility with Perl 5.005?'
4770 y*) val="$define" ;;
4775 case "$d_bincompat5005" in
4777 bincompat5005="$define"
4779 *) bincompat5005="$undef"
4780 d_bincompat5005="$undef"
4787 : see if setuid scripts can be secure
4790 Some kernels have a bug that prevents setuid #! scripts from being
4791 secure. Some sites have disabled setuid #! scripts because of this.
4793 First let's decide if your kernel supports secure setuid #! scripts.
4794 (If setuid #! scripts would be secure but have been disabled anyway,
4795 don't say that they are secure if asked.)
4800 if $test -d /dev/fd; then
4801 echo "#!$ls" >reflect
4802 chmod +x,u+s reflect
4803 ./reflect >flect 2>&1
4804 if $contains "/dev/fd" flect >/dev/null; then
4805 echo "Congratulations, your kernel has secure setuid scripts!" >&4
4809 If you are not sure if they are secure, I can check but I'll need a
4810 username and password different from the one you are using right now.
4811 If you don't have such a username or don't want me to test, simply
4815 rp='Other username to test security of setuid scripts with?'
4820 case "$d_suidsafe" in
4821 '') echo "I'll assume setuid scripts are *not* secure." >&4
4824 echo "Well, the $hint value is *not* secure." >&4
4826 *) echo "Well, the $hint value *is* secure." >&4
4831 $rm -f reflect flect
4832 echo "#!$ls" >reflect
4833 chmod +x,u+s reflect
4836 echo '"su" will (probably) prompt you for '"$ans's password."
4837 su $ans -c './reflect >flect'
4838 if $contains "/dev/fd" flect >/dev/null; then
4839 echo "Okay, it looks like setuid scripts are secure." >&4
4842 echo "I don't think setuid scripts are secure." >&4
4847 rp='Does your kernel have *secure* setuid scripts?'
4850 [yY]*) val="$define";;
4855 echo "I don't think setuid scripts are secure (no /dev/fd directory)." >&4
4856 echo "(That's for file descriptors, not floppy disks.)"
4862 $rm -f reflect flect
4864 : now see if they want to do setuid emulation
4867 case "$d_suidsafe" in
4870 echo "No need to emulate SUID scripts since they are secure here." >& 4
4874 Some systems have disabled setuid scripts, especially systems where
4875 setuid scripts cannot be secure. On systems where setuid scripts have
4876 been disabled, the setuid/setgid bits on scripts are currently
4877 useless. It is possible for $package to detect those bits and emulate
4878 setuid/setgid in a secure fashion. This emulation will only work if
4879 setuid scripts have been disabled in your kernel.
4883 "$define") dflt=y ;;
4886 rp="Do you want to do setuid/setgid emulation?"
4889 [yY]*) val="$define";;
4897 : determine filename position in cpp output
4899 echo "Computing filename position in cpp output for #include directives..." >&4
4900 echo '#include <stdio.h>' > foo.c
4903 $cppstdin $cppflags $cppminus <foo.c 2>/dev/null | \
4904 $grep '^[ ]*#.*stdio\.h' | \
4905 while read cline; do
4908 while $test \$# -gt 0; do
4909 if $test -r \`echo \$1 | $tr -d '"'\`; then
4914 pos=\`expr \$pos + 1\`
4926 *) pos="${fieldn}th";;
4928 echo "Your cpp writes the filename in the $pos field of the line."
4930 : locate header file
4935 for usrincdir in $usrinc
4937 if test -f \$usrincdir/\$wanted; then
4938 echo "\$usrincdir/\$wanted"
4942 awkprg='{ print \$$fieldn }'
4943 echo "#include <\$wanted>" > foo\$\$.c
4944 $cppstdin $cppminus $cppflags < foo\$\$.c 2>/dev/null | \
4945 $grep "^[ ]*#.*\$wanted" | \
4946 while read cline; do
4947 name=\`echo \$cline | $awk "\$awkprg" | $tr -d '"'\`
4949 *[/\\\\]\$wanted) echo "\$name"; exit 1;;
4950 *[\\\\/]\$wanted) echo "\$name"; exit 1;;
4955 # status = 0: grep returned 0 lines, case statement not executed
4956 # status = 1: headerfile found
4957 # status = 2: while loop executed, no headerfile found
4961 if test \$status -eq 1; then
4968 : define an alternate in-header-list? function
4969 inhdr='echo " "; td=$define; tu=$undef; yyy=$@;
4970 cont=true; xxf="echo \"<\$1> found.\" >&4";
4971 case $# in 2) xxnf="echo \"<\$1> NOT found.\" >&4";;
4972 *) xxnf="echo \"<\$1> NOT found, ...\" >&4";;
4974 case $# in 4) instead=instead;; *) instead="at last";; esac;
4975 while $test "$cont"; do
4977 var=$2; eval "was=\$$2";
4978 if $test "$xxx" && $test -r "$xxx";
4980 eval "case \"\$$var\" in $undef) . ./whoa; esac"; eval "$var=\$td";
4983 eval "case \"\$$var\" in $define) . ./whoa; esac"; eval "$var=\$tu"; fi;
4984 set $yyy; shift; shift; yyy=$@;
4985 case $# in 0) cont="";;
4986 2) xxf="echo \"but I found <\$1> $instead.\" >&4";
4987 xxnf="echo \"and I did not find <\$1> either.\" >&4";;
4988 *) xxf="echo \"but I found <\$1\> instead.\" >&4";
4989 xxnf="echo \"there is no <\$1>, ...\" >&4";;
4993 do set $yyy; var=$2; eval "was=\$$2";
4994 eval "case \"\$$var\" in $define) . ./whoa; esac"; eval "$var=\$tu";
4995 set $yyy; shift; shift; yyy=$@;
4998 : see if this is a malloc.h system
4999 set malloc.h i_malloc
5002 : see if stdlib is available
5003 set stdlib.h i_stdlib
5006 : determine which malloc to compile in
5008 case "$usemymalloc" in
5009 ''|[yY]*|true|$define) dflt='y' ;;
5012 rp="Do you wish to attempt to use the malloc that comes with $package?"
5018 mallocsrc='malloc.c'
5019 mallocobj="malloc$_o"
5020 d_mymalloc="$define"
5023 : Remove malloc from list of libraries to use
5024 echo "Removing unneeded -lmalloc from library list" >&4
5025 set `echo X $libs | $sed -e 's/-lmalloc / /' -e 's/-lmalloc$//'`
5028 echo "libs = $libs" >&4
5040 : compute the return types of malloc and free
5042 $cat >malloc.c <<END
5046 #include <sys/types.h>
5060 case "$malloctype" in
5062 if $cc $ccflags -c -DTRY_MALLOC malloc.c >/dev/null 2>&1; then
5069 echo "Your system wants malloc to return '$malloctype', it would seem." >&4
5073 if $cc $ccflags -c -DTRY_FREE malloc.c >/dev/null 2>&1; then
5080 echo "Your system uses $freetype free(), it would seem." >&4
5084 The installation process will also create a directory for
5085 vendor-supplied add-ons. Vendors who supply perl with their system
5086 may find it convenient to place all vendor-supplied files in this
5087 directory rather than in the main distribution directory. This will
5088 ease upgrades between binary-compatible maintenance versions of perl.
5090 Of course you may also use these directories in whatever way you see
5091 fit. For example, you might use them to access modules shared over a
5092 company-wide network.
5094 The default answer should be fine for most people.
5095 This causes further questions about vendor add-ons to be skipped
5096 and no vendor-specific directories will be configured for perl.
5099 rp='Do you want to configure vendor-specific add-on directories?'
5100 case "$usevendorprefix" in
5101 define|true|[yY]*) dflt=y ;;
5107 rp='Installation prefix to use for vendor-supplied add-ons?'
5108 case "$vendorprefix" in
5110 *) dflt=$vendorprefix ;;
5114 case "$vendorprefix" in
5118 *) oldvendorprefix="$prefix";;
5122 usevendorprefix="$define"
5124 vendorprefixexp="$ansexp"
5126 *) usevendorprefix="$undef"
5132 case "$vendorprefix" in
5133 '') d_vendorlib="$undef"
5137 *) d_vendorlib="$define"
5138 : determine where vendor-supplied modules go.
5139 : Usual default is /usr/local/lib/perl5/vendor_perl/$version
5140 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
5141 case "$installstyle" in
5142 *lib/perl5*) dflt=$vendorprefix/lib/$package/vendor_$prog/$version ;;
5143 *) dflt=$vendorprefix/lib/vendor_$prog/$version ;;
5146 rp='Pathname for the vendor-supplied library files?'
5149 vendorlibexp="$ansexp"
5150 : Change installation prefix, if necessary.
5151 if $test X"$prefix" != X"$installprefix"; then
5152 installvendorlib=`echo $vendorlibexp | $sed "s#^$prefix#$installprefix#"`
5154 installvendorlib="$vendorlibexp"
5159 : Cruising for prototypes
5161 echo "Checking out function prototypes..." >&4
5162 $cat >prototype.c <<'EOCP'
5163 int main(int argc, char *argv[]) {
5166 if $cc $ccflags -c prototype.c >prototype.out 2>&1 ; then
5167 echo "Your C compiler appears to support function prototypes."
5170 echo "Your C compiler doesn't seem to understand function prototypes."
5177 case "$prototype" in
5179 *) ansi2knr='ansi2knr'
5184 This version of $package can only be compiled by a compiler that
5185 understands function prototypes. Unfortunately, your C compiler
5187 doesn't seem to understand them. Sorry about that.
5189 If GNU cc is available for your system, perhaps you could try that instead.
5191 Eventually, we hope to support building Perl with pre-ANSI compilers.
5192 If you would like to help in that effort, please contact <perlbug@perl.org>.
5194 Aborting Configure now.
5200 : determine where public executables go
5205 rp='Pathname where the public executables will reside?'
5207 if $test "X$ansexp" != "X$binexp"; then
5212 : Change installation prefix, if necessary.
5213 : XXX Bug? -- ignores Configure -Dinstallprefix setting.
5214 if $test X"$prefix" != X"$installprefix"; then
5215 installbin=`echo $binexp | sed "s#^$prefix#$installprefix#"`
5217 installbin="$binexp"
5222 After $package is installed, you may wish to install various
5223 add-on modules and utilities. Typically, these add-ons will
5224 be installed under $prefix with the rest
5225 of this package. However, you may wish to install such add-ons
5226 elsewhere under a different prefix.
5228 If you do not wish to put everything under a single prefix, that's
5229 ok. You will be prompted for the individual locations; this siteprefix
5230 is only used to suggest the defaults.
5232 The default should be fine for most people.
5236 rp='Installation prefix to use for add-on modules and utilities?'
5237 : XXX Here might be another good place for an installstyle setting.
5238 case "$siteprefix" in
5240 *) dflt=$siteprefix ;;
5244 case "$siteprefix" in
5249 *) oldsiteprefix="$prefix";;
5254 siteprefixexp="$ansexp"
5256 : determine where site specific libraries go.
5257 : Usual default is /usr/local/lib/perl5/site_perl/$version
5258 : The default "style" setting is made in installstyle.U
5259 : XXX No longer works with Prefixit stuff.
5260 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
5261 case "$installstyle" in
5262 *lib/perl5*) dflt=$siteprefix/lib/$package/site_$prog/$version ;;
5263 *) dflt=$siteprefix/lib/site_$prog/$version ;;
5267 The installation process will create a directory for
5268 site-specific extensions and modules. Most users find it convenient
5269 to place all site-specific files in this directory rather than in the
5270 main distribution directory.
5274 rp='Pathname for the site-specific library files?'
5277 sitelibexp="$ansexp"
5278 : Change installation prefix, if necessary.
5279 if $test X"$prefix" != X"$installprefix"; then
5280 installsitelib=`echo $sitelibexp | sed "s#^$prefix#$installprefix#"`
5282 installsitelib="$sitelibexp"
5285 : Determine list of previous versions to include in @INC
5286 $cat > getverlist <<EOPL
5289 \$api_versionstring = "$api_versionstring";
5290 \$version = "$version";
5291 \$sitelib = "$sitelib";
5292 \$archname = "$archname";
5294 $cat >> getverlist <<'EOPL'
5295 # Can't have leading @ because metaconfig interprets it as a command!
5296 ;@inc_version_list=();
5297 $stem=dirname($sitelib);
5298 # Redo to do opendir/readdir?
5301 ;@candidates = glob("5.*");
5307 # XXX ToDo: These comparisons must be reworked when two-digit
5308 # subversions come along, so that 5.7.10 compares as greater than
5309 # 5.7.3! By that time, hope that 5.6.x is sufficiently
5310 # widespread that we can use the built-in version vectors rather
5311 # than reinventing them here. For 5.6.0, however, we must
5312 # assume this script will likely be run by 5.005_0x. --AD 1/2000.
5313 foreach $d (@candidates) {
5314 if ($d lt $version) {
5315 if ($d ge $api_versionstring) {
5316 unshift(@inc_version_list, "$d/$archname", $d);
5318 elsif ($d ge "5.005") {
5319 unshift(@inc_version_list, $d);
5323 # Skip newer version. I.e. don't look in
5324 # 5.7.0 if we're installing 5.6.1.
5328 if (@inc_version_list) {
5329 print join(' ', @inc_version_list);
5332 # Blank space to preserve value for next Configure run.
5337 case "$inc_version_list" in
5338 '') if test -x $perl; then
5339 dflt=`$perl getverlist`
5344 $undef) dflt='none' ;;
5345 *) dflt="$inc_version_list" ;;
5349 In order to ease the process of upgrading, this version of perl
5350 can be configured to use modules built and installed with earlier
5351 versions of perl that were installed under $prefix. Specify here
5352 the list of earlier versions that this version of perl should check.
5353 If Configure detected no earlier versions of perl installed under
5354 $prefix, then the list will be empty. Answer 'none' to tell perl
5355 to not search earlier versions.
5357 The default should almost always be sensible, so if you're not sure,
5358 just accept the default.
5361 rp='List of earlier versions to include in @INC?'
5364 [Nn]one) inc_version_list=' ' ;;
5365 *) inc_version_list="$ans" ;;
5367 case "$inc_version_list" in
5369 inc_version_list_init='0';;
5370 *) inc_version_list_init=`echo $inc_version_list |
5371 $sed -e 's/^/"/' -e 's/ /","/g' -e 's/$/",0/'`
5376 : determine whether to install perl also as /usr/bin/perl
5379 if $test -d /usr/bin -a "X$installbin" != X/usr/bin; then
5381 Many scripts expect to perl to be installed as /usr/bin/perl.
5382 I can install the perl you are about to compile also as /usr/bin/perl
5383 (in addition to $installbin/perl).
5385 case "$installusrbinperl" in
5386 "$undef"|[nN]*) dflt='n';;
5389 rp="Do you want to install perl as /usr/bin/perl?"
5392 [yY]*) val="$define";;
5398 set installusrbinperl
5402 echo "Checking for GNU C Library..." >&4
5403 cat >gnulibc.c <<EOM
5415 if eval $compile_ok && ./gnulibc; then
5417 echo "You are using the GNU C Library"
5420 echo "You are not using the GNU C Library"
5426 : see if nm is to be used to determine whether a symbol is defined or not
5430 case "$d_gnulibc" in
5433 echo "nm probably won't work on the GNU C Library." >&4
5439 if $test "$osname" = aix -a ! -f /lib/syscalls.exp; then
5441 echo "Whoops! This is an AIX system without /lib/syscalls.exp!" >&4
5442 echo "'nm' won't be sufficient on this sytem." >&4
5448 '') dflt=`$egrep 'inlibc|csym' $rsrc/Configure | wc -l 2>/dev/null`
5449 if $test $dflt -gt 20; then
5459 true|$define) dflt=y;;
5466 I can use $nm to extract the symbols from your C libraries. This
5467 is a time consuming task which may generate huge output on the disk (up
5468 to 3 megabytes) but that should make the symbols extraction faster. The
5469 alternative is to skip the 'nm' extraction part and to compile a small
5470 test program instead to determine whether each symbol is present. If
5471 you have a fast C compiler and/or if your 'nm' output cannot be parsed,
5472 this may be the best solution.
5474 You probably shouldn't let me use 'nm' if you are using the GNU C Library.
5477 rp="Shall I use $nm to extract C symbols from the libraries?"
5480 [Nn]*) usenm=false;;
5489 : nm options which may be necessary
5491 '') if $test -f /mach_boot; then
5493 elif $test -d /usr/ccs/lib; then
5494 nm_opt='-p' # Solaris (and SunOS?)
5495 elif $test -f /dgux; then
5497 elif $test -f /lib64/rld; then
5498 nm_opt='-p' # 64-bit Irix
5504 : nm options which may be necessary for shared libraries but illegal
5505 : for archive libraries. Thank you, Linux.
5506 case "$nm_so_opt" in
5507 '') case "$myuname" in
5509 if $nm --help | $grep 'dynamic' > /dev/null 2>&1; then
5510 nm_so_opt='--dynamic'
5519 : get list of predefined functions in a handy place
5524 *-lc_s*) libc=`./loc libc_s$_a $libc $libpth`
5531 *) for thislib in $libs; do
5534 : Handle C library specially below.
5537 thislib=`echo $thislib | $sed -e 's/^-l//'`
5538 if try=`./loc lib$thislib.$so.'*' X $libpth`; $test -f "$try"; then
5540 elif try=`./loc lib$thislib.$so X $libpth`; $test -f "$try"; then
5542 elif try=`./loc lib$thislib$_a X $libpth`; $test -f "$try"; then
5544 elif try=`./loc $thislib$_a X $libpth`; $test -f "$try"; then
5546 elif try=`./loc lib$thislib X $libpth`; $test -f "$try"; then
5548 elif try=`./loc $thislib X $libpth`; $test -f "$try"; then
5550 elif try=`./loc Slib$thislib$_a X $xlibpth`; $test -f "$try"; then
5555 libnames="$libnames $try"
5557 *) libnames="$libnames $thislib" ;;
5566 for xxx in $libpth; do
5567 $test -r $1 || set $xxx/libc.$so
5568 : The messy sed command sorts on library version numbers.
5570 set `echo blurfl; echo $xxx/libc.$so.[0-9]* | \
5571 tr ' ' $trnl | egrep -v '\.[A-Za-z]*$' | $sed -e '
5573 s/[0-9][0-9]*/0000&/g
5574 s/0*\([0-9][0-9][0-9][0-9][0-9]\)/\1/g
5577 sort | $sed -e 's/^.* //'`
5580 $test -r $1 || set /usr/ccs/lib/libc.$so
5581 $test -r $1 || set /lib/libsys_s$_a
5587 if $test -r "$1"; then
5588 echo "Your (shared) C library seems to be in $1."
5590 elif $test -r /lib/libc && $test -r /lib/clib; then
5591 echo "Your C library seems to be in both /lib/clib and /lib/libc."
5593 libc='/lib/clib /lib/libc'
5594 if $test -r /lib/syslib; then
5595 echo "(Your math library is in /lib/syslib.)"
5596 libc="$libc /lib/syslib"
5598 elif $test -r "$libc" || (test -h "$libc") >/dev/null 2>&1; then
5599 echo "Your C library seems to be in $libc, as you said before."
5600 elif $test -r $incpath/usr/lib/libc$_a; then
5601 libc=$incpath/usr/lib/libc$_a;
5602 echo "Your C library seems to be in $libc. That's fine."
5603 elif $test -r /lib/libc$_a; then
5605 echo "Your C library seems to be in $libc. You're normal."
5607 if tans=`./loc libc$_a blurfl/dyick $libpth`; $test -r "$tans"; then
5609 elif tans=`./loc libc blurfl/dyick $libpth`; $test -r "$tans"; then
5610 libnames="$libnames "`./loc clib blurfl/dyick $libpth`
5611 elif tans=`./loc clib blurfl/dyick $libpth`; $test -r "$tans"; then
5613 elif tans=`./loc Slibc$_a blurfl/dyick $xlibpth`; $test -r "$tans"; then
5615 elif tans=`./loc Mlibc$_a blurfl/dyick $xlibpth`; $test -r "$tans"; then
5618 tans=`./loc Llibc$_a blurfl/dyick $xlibpth`
5620 if $test -r "$tans"; then
5621 echo "Your C library seems to be in $tans, of all places."
5627 if $test $xxx = apollo -o -r "$libc" || (test -h "$libc") >/dev/null 2>&1; then
5631 If the guess above is wrong (which it might be if you're using a strange
5632 compiler, or your machine supports multiple models), you can override it here.
5637 echo $libpth | tr ' ' $trnl | sort | uniq > libpath
5639 I can't seem to find your C library. I've looked in the following places:
5642 $sed 's/^/ /' libpath
5645 None of these seems to contain your C library. I need to get its name...
5650 rp='Where is your C library?'
5655 echo $libc $libnames | tr ' ' $trnl | sort | uniq > libnames
5656 set X `cat libnames`
5659 case $# in 1) xxx=file; esac
5660 echo "Extracting names from the following $xxx for later perusal:" >&4
5662 $sed 's/^/ /' libnames >&4
5664 $echo $n "This may take a while...$c" >&4
5668 *$so*) $nm $nm_so_opt $nm_opt $file 2>/dev/null;;
5669 *) $nm $nm_opt $file 2>/dev/null;;
5674 $grep fprintf libc.tmp > libc.ptf
5675 xscan='eval "<libc.ptf $com >libc.list"; $echo $n ".$c" >&4'
5676 xrun='eval "<libc.tmp $com >libc.list"; echo "done" >&4'
5678 if com="$sed -n -e 's/__IO//' -e 's/^.* $xxx *_[_.]*//p' -e 's/^.* $xxx *//p'";\
5680 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5682 elif com="$sed -n -e 's/^__*//' -e 's/^\([a-zA-Z_0-9$]*\).*xtern.*/\1/p'";\
5684 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5686 elif com="$sed -n -e '/|UNDEF/d' -e '/FUNC..GL/s/^.*|__*//p'";\
5688 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5690 elif com="$sed -n -e 's/^.* D __*//p' -e 's/^.* D //p'";\
5692 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5694 elif com="$sed -n -e 's/^_//' -e 's/^\([a-zA-Z_0-9]*\).*xtern.*text.*/\1/p'";\
5696 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5698 elif com="$sed -n -e 's/^.*|FUNC |GLOB .*|//p'";\
5700 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5702 elif com="$grep '|' | $sed -n -e '/|COMMON/d' -e '/|DATA/d' \
5703 -e '/ file/d' -e 's/^\([^ ]*\).*/\1/p'";\
5705 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5707 elif com="$sed -n -e 's/^.*|FUNC |GLOB .*|//p' -e 's/^.*|FUNC |WEAK .*|//p'";\
5709 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5711 elif com="$sed -n -e 's/^__//' -e '/|Undef/d' -e '/|Proc/s/ .*//p'";\
5713 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5715 elif com="$sed -n -e 's/^.*|Proc .*|Text *| *//p'";\
5717 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5719 elif com="$sed -n -e '/Def. Text/s/.* \([^ ]*\)\$/\1/p'";\
5721 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5723 elif com="$sed -n -e 's/^[-0-9a-f ]*_\(.*\)=.*/\1/p'";\
5725 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5727 elif com="$sed -n -e 's/.*\.text n\ \ \ \.//p'";\
5729 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5731 elif com="sed -n -e 's/^__.*//' -e 's/[ ]*D[ ]*[0-9]*.*//p'";\
5733 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5736 $nm -p $* 2>/dev/null >libc.tmp
5737 $grep fprintf libc.tmp > libc.ptf
5738 if com="$sed -n -e 's/^.* [ADTSIW] *_[_.]*//p' -e 's/^.* [ADTSIW] //p'";\
5739 eval $xscan; $contains '^fprintf$' libc.list >/dev/null 2>&1
5745 echo "$nm didn't seem to work right. Trying $ar instead..." >&4
5747 if $ar t $libc > libc.tmp && $contains '^fprintf$' libc.tmp >/dev/null 2>&1; then
5748 for thisname in $libnames $libc; do
5749 $ar t $thisname >>libc.tmp
5751 $sed -e "s/\\$_o\$//" < libc.tmp > libc.list
5753 elif test "X$osname" = "Xos2" && $ar tv $libc > libc.tmp; then
5754 # Repeat libc to extract forwarders to DLL entries too
5755 for thisname in $libnames $libc; do
5756 $ar tv $thisname >>libc.tmp
5757 # Revision 50 of EMX has bug in $ar.
5758 # it will not extract forwarders to DLL entries
5759 # Use emximp which will extract exactly them.
5760 emximp -o tmp.imp $thisname \
5762 $sed -e 's/^\([_a-zA-Z0-9]*\) .*$/\1/p' \
5763 < tmp.imp >>libc.tmp
5766 $sed -e "s/\\$_o\$//" -e 's/^ \+//' < libc.tmp > libc.list
5769 echo "$ar didn't seem to work right." >&4
5770 echo "Maybe this is a Cray...trying bld instead..." >&4
5771 if bld t $libc | $sed -e 's/.*\///' -e "s/\\$_o:.*\$//" > libc.list
5773 for thisname in $libnames; do
5775 $sed -e 's/.*\///' -e "s/\\$_o:.*\$//" >>libc.list
5776 $ar t $thisname >>libc.tmp
5780 echo "That didn't work either. Giving up." >&4
5787 if $test -f /lib/syscalls.exp; then
5789 echo "Also extracting names from /lib/syscalls.exp for good ole AIX..." >&4
5790 $sed -n 's/^\([^ ]*\)[ ]*syscall[0-9]*$/\1/p' /lib/syscalls.exp >>libc.list
5794 $rm -f libnames libpath
5796 : see if dld is available
5800 : is a C symbol defined?
5803 -v) tf=libc.tmp; tc=""; tdc="";;
5804 -a) tf=libc.tmp; tc="[0]"; tdc="[]";;
5805 *) tlook="^$1\$"; tf=libc.list; tc="()"; tdc="()";;
5808 case "$reuseval-$4" in
5810 true-*) tx=no; eval "tval=\$$4"; case "$tval" in "") tx=yes;; esac;;
5816 if $contains $tlook $tf >/dev/null 2>&1;
5821 echo "int main() { extern short $1$tdc; printf(\"%hd\", $1$tc); }" > t.c;
5822 if $cc $optimize $ccflags $ldflags -o t t.c $libs >/dev/null 2>&1;
5830 $define) tval=true;;
5836 : define an is-in-libc? function
5837 inlibc='echo " "; td=$define; tu=$undef;
5838 sym=$1; var=$2; eval "was=\$$2";
5840 case "$reuseval$was" in
5850 echo "$sym() found." >&4;
5851 case "$was" in $undef) . ./whoa; esac; eval "$var=\$td";;
5853 echo "$sym() NOT found." >&4;
5854 case "$was" in $define) . ./whoa; esac; eval "$var=\$tu";;
5858 $define) echo "$sym() found." >&4;;
5859 *) echo "$sym() NOT found." >&4;;
5863 : see if dlopen exists
5870 : determine which dynamic loading, if any, to compile in
5872 dldir="ext/DynaLoader"
5885 $define) dflt='y' ;;
5888 $define) dflt='y' ;;
5890 : Does a dl_xxx.xs file exist for this operating system
5891 $test -f $rsrc/$dldir/dl_${osname}.xs && dflt='y'
5894 rp="Do you wish to use dynamic loading?"
5901 if $test -f $rsrc/$dldir/dl_${osname}.xs ; then
5902 dflt="$dldir/dl_${osname}.xs"
5903 elif $test "$d_dlopen" = "$define" ; then
5904 dflt="$dldir/dl_dlopen.xs"
5905 elif $test "$i_dld" = "$define" ; then
5906 dflt="$dldir/dl_dld.xs"
5911 *) dflt="$dldir/$dlsrc"
5914 echo "The following dynamic loading files are available:"
5915 : Can not go over to $dldir because getfile has path hard-coded in.
5916 tdir=`pwd`; cd $rsrc; $ls -C $dldir/dl*.xs; cd $tdir
5917 rp="Source file to use for dynamic loading"
5923 dlsrc=`echo $ans | $sed -e 's@.*/\([^/]*\)$@\1@'`
5927 Some systems may require passing special flags to $cc -c to
5928 compile modules that will be used to create a shared library.
5929 To use no flags, say "none".
5932 case "$cccdlflags" in
5933 '') case "$gccversion" in
5934 '') case "$osname" in
5936 next) dflt='none' ;;
5937 irix*) dflt='-KPIC' ;;
5938 svr4*|esix*|solaris) dflt='-KPIC' ;;
5939 sunos) dflt='-pic' ;;
5943 *) case "$osname" in
5944 svr4*|esix*|solaris) dflt='-fPIC' ;;
5949 *) dflt="$cccdlflags" ;;
5951 rp="Any special flags to pass to $cc -c to compile shared library modules?"
5954 none) cccdlflags=' ' ;;
5955 *) cccdlflags="$ans" ;;
5960 Some systems use ld to create libraries that can be dynamically loaded,
5961 while other systems (such as those using ELF) use $cc.
5965 '') $cat >try.c <<'EOM'
5966 /* Test for whether ELF binaries are produced */
5971 int i = open("a.out",O_RDONLY);
5974 if(read(i,b,4)==4 && b[0]==127 && b[1]=='E' && b[2]=='L' && b[3]=='F')
5975 exit(0); /* succeed (yes, it's ELF) */
5980 if $cc $ccflags try.c >/dev/null 2>&1 && ./a.out; then
5982 You appear to have ELF support. I'll use $cc to build dynamic libraries.
5986 echo "I'll use ld to build dynamic libraries."
5995 rp="What command should be used to create dynamic libraries?"
6001 Some systems may require passing special flags to $ld to create a
6002 library that can be dynamically loaded. If your ld flags include
6003 -L/other/path options to locate libraries outside your loader's normal
6004 search path, you may need to specify those -L options here as well. To
6005 use no flags, say "none".
6008 case "$lddlflags" in
6009 '') case "$osname" in
6010 beos) dflt='-nostart' ;;
6012 linux|irix*) dflt='-shared' ;;
6013 next) dflt='none' ;;
6014 solaris) dflt='-G' ;;
6015 sunos) dflt='-assert nodefinitions' ;;
6016 svr4*|esix*) dflt="-G $ldflags" ;;
6020 *) dflt="$lddlflags" ;;
6023 : Try to guess additional flags to pick up local libraries.
6024 : Be careful not to append to a plain 'none'
6028 for thisflag in $ldflags; do
6033 *) dflt="$dflt $thisflag" ;;
6040 ''|' ') dflt='none' ;;
6043 rp="Any special flags to pass to $ld to create a dynamically loaded library?"
6046 none) lddlflags=' ' ;;
6047 *) lddlflags="$ans" ;;
6052 Some systems may require passing special flags to $cc to indicate that
6053 the resulting executable will use dynamic linking. To use no flags,
6057 case "$ccdlflags" in
6058 '') case "$osname" in
6059 hpux) dflt='-Wl,-E' ;;
6060 linux) dflt='-rdynamic' ;;
6061 next) dflt='none' ;;
6062 sunos) dflt='none' ;;
6066 *) dflt="$ccdlflags" ;;
6068 rp="Any special flags to pass to $cc to use dynamic linking?"
6071 none) ccdlflags=' ' ;;
6072 *) ccdlflags="$ans" ;;
6086 # No dynamic loading being used, so don't bother even to prompt.
6089 *) case "$useshrplib" in
6090 '') case "$osname" in
6091 svr4*|dgux|dynixptx|esix|powerux|beos|cygwin*)
6093 also='Building a shared libperl is required for dynamic loading to work on your system.'
6098 also='Building a shared libperl is needed for MAB support.'
6116 The perl executable is normally obtained by linking perlmain.c with
6117 libperl${_a}, any static extensions (usually just DynaLoader), and
6118 any other libraries needed on this system (such as -lm, etc.). Since
6119 your system supports dynamic loading, it is probably possible to build
6120 a shared libperl.$so. If you will have more than one executable linked
6121 to libperl.$so, this will significantly reduce the size of each
6122 executable, but it may have a noticeable affect on performance. The
6123 default is probably sensible for your system.
6127 rp="Build a shared libperl.$so (y/n)"
6131 useshrplib='true' ;;
6132 *) useshrplib='false' ;;
6137 case "$useshrplib" in
6141 # Figure out a good name for libperl.so. Since it gets stored in
6142 # a version-specific architecture-dependent library, the version
6143 # number isn't really that important, except for making cc/ld happy.
6145 # A name such as libperl.so.3.1
6146 majmin="libperl.$so.$patchlevel.$subversion"
6147 # A name such as libperl.so.301
6148 majonly=`echo $patchlevel $subversion |
6149 $awk '{printf "%d%02d", $1, $2}'`
6150 majonly=libperl.$so.$majonly
6151 # I'd prefer to keep the os-specific stuff here to a minimum, and
6152 # rely on figuring it out from the naming of libc.
6153 case "${osname}${osvers}" in
6156 # XXX How handle the --version stuff for MAB?
6158 linux*) # ld won't link with a bare -lperl otherwise.
6161 cygwin*) # include version
6162 dflt=`echo libperl$version | sed -e 's/\./_/g'`$lib_ext
6164 *) # Try to guess based on whether libc has major.minor.
6166 *libc.$so.[0-9]*.[0-9]*) dflt=$majmin ;;
6167 *libc.$so.[0-9]*) dflt=$majonly ;;
6168 *) dflt=libperl.$so ;;
6178 I need to select a good name for the shared libperl. If your system uses
6179 library names with major and minor numbers, then you might want something
6180 like $majmin. Alternatively, if your system uses a single version
6181 number for shared libraries, then you might want to use $majonly.
6182 Or, your system might be quite happy with a simple libperl.$so.
6184 Since the shared libperl will get installed into a version-specific
6185 architecture-dependent directory, the version number of the shared perl
6186 library probably isn't important, so the default should be o.k.
6189 rp='What name do you want to give to the shared libperl?'
6192 echo "Ok, I'll use $libperl"
6195 libperl="libperl${_a}"
6199 # Detect old use of shrpdir via undocumented Configure -Dshrpdir
6203 WARNING: Use of the shrpdir variable for the installation location of
6204 the shared $libperl is not supported. It was never documented and
6205 will not work in this version. Let me (perlbug@perl.com)
6206 know of any problems this may cause.
6212 But your current setting of $shrpdir is
6213 the default anyway, so it's harmless.
6218 Further, your current attempted setting of $shrpdir
6219 conflicts with the value of $archlibexp/CORE
6220 that installperl will use.
6227 # How will the perl executable find the installed shared $libperl?
6228 # Add $xxx to ccdlflags.
6229 # If we can't figure out a command-line option, use $shrpenv to
6230 # set env LD_RUN_PATH. The main perl makefile uses this.
6231 shrpdir=$archlibexp/CORE
6234 if "$useshrplib"; then
6237 # We'll set it in Makefile.SH...
6243 xxx="-Wl,-R$shrpdir"
6245 linux|irix*|dec_osf)
6246 xxx="-Wl,-rpath,$shrpdir"
6249 # next doesn't like the default...
6252 # beos doesn't like the default, either.
6255 # hpux doesn't like the default, either.
6256 tmp_shrpenv="env LDOPTS=\"+s +b${shrpdir}\""
6259 tmp_shrpenv="env LD_RUN_PATH=$shrpdir"
6265 # Only add $xxx if it isn't already in ccdlflags.
6266 case " $ccdlflags " in
6268 *) ccdlflags="$ccdlflags $xxx"
6271 Adding $xxx to the flags
6272 passed to $ld so that the perl executable will find the
6273 installed shared $libperl.
6281 # Fix ccdlflags in AIX for building external extensions.
6282 # (For building Perl itself bare -bE:perl.exp is needed,
6283 # Makefile.SH takes care of this.)
6285 aix) ccdlflags="$ccdlflags -bE:$installarchlib/CORE/perl.exp" ;;
6287 # Respect a hint or command-line value.
6289 '') shrpenv="$tmp_shrpenv" ;;
6291 case "$ldlibpthname" in
6292 '') ldlibpthname=LD_LIBRARY_PATH ;;
6293 none) ldlibpthname='' ;;
6296 : determine where manual pages go
6297 set man1dir man1dir none
6301 $spackage has manual pages available in source form.
6305 echo "However, you don't have nroff, so they're probably useless to you."
6307 '') man1dir="none";;
6310 echo "If you don't want the manual sources installed, answer 'none'."
6315 lookpath="$prefixexp/man/man1 $prefixexp/man/l_man/man1"
6316 lookpath="$lookpath $prefixexp/man/p_man/man1"
6317 lookpath="$lookpath $prefixexp/man/u_man/man1"
6318 lookpath="$lookpath $prefixexp/man/man.1"
6320 */?_man*) dflt=`./loc . $prefixexp/l_man/man1 $lookpath` ;;
6321 *) dflt=`./loc . $prefixexp/man/man1 $lookpath` ;;
6331 rp="Where do the main $spackage manual pages (source) go?"
6333 if $test "X$man1direxp" != "X$ansexp"; then
6337 man1direxp="$ansexp"
6343 : Change installation prefix, if necessary.
6344 if $test X"$prefix" != X"$installprefix"; then
6345 installman1dir=`echo $man1direxp | $sed "s#^$prefix#$installprefix#"`
6347 installman1dir="$man1direxp"
6350 : What suffix to use on installed man pages
6357 rp="What suffix should be used for the main $spackage man pages?"
6359 '') case "$man1dir" in
6373 *) dflt="$man1ext";;
6380 : see if we can have long filenames
6382 rmlist="$rmlist /tmp/cf$$"
6383 $test -d /tmp/cf$$ || mkdir /tmp/cf$$
6384 first=123456789abcdef
6385 second=/tmp/cf$$/$first
6386 $rm -f $first $second
6387 if (echo hi >$first) 2>/dev/null; then
6388 if $test -f 123456789abcde; then
6389 echo 'You cannot have filenames longer than 14 characters. Sigh.' >&4
6392 if (echo hi >$second) 2>/dev/null; then
6393 if $test -f /tmp/cf$$/123456789abcde; then
6395 That's peculiar... You can have filenames longer than 14 characters, but only
6396 on some of the filesystems. Maybe you are using NFS. Anyway, to avoid problems
6397 I shall consider your system cannot support long filenames at all.
6401 echo 'You can have filenames longer than 14 characters.' >&4
6406 How confusing! Some of your filesystems are sane enough to allow filenames
6407 longer than 14 characters but some others like /tmp can't even think about them.
6408 So, for now on, I shall assume your kernel does not allow them at all.
6415 You can't have filenames longer than 14 chars. You can't even think about them!
6421 $rm -rf /tmp/cf$$ 123456789abcde*
6423 : determine where library module manual pages go
6424 set man3dir man3dir none
6428 $spackage has manual pages for many of the library modules.
6434 However, you don't have nroff, so they're probably useless to you.
6437 '') man3dir="none";;
6441 case "$d_flexfnam" in
6444 However, your system can't handle the long file names like File::Basename.3.
6447 '') man3dir="none";;
6451 echo "If you don't want the manual sources installed, answer 'none'."
6452 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
6454 '') dflt=`echo $man1dir | $sed -e 's/man1/man3/g' -e 's/man\.1/man\.3/g'`
6455 if $test -d "$privlib/man/man3"; then
6458 WARNING: Previous versions of perl installed man3 pages into
6459 $privlib/man/man3. This version will suggest a
6460 new default of $dflt.
6464 rp='Do you wish to preserve the old behavior?(y/n)'
6467 y*) dflt="$privlib/man/man3" ;;
6473 *) dflt="$man3dir" ;;
6477 rp="Where do the $package library man pages (source) go?"
6480 man3direxp="$ansexp"
6486 : Change installation prefix, if necessary.
6487 if $test X"$prefix" != X"$installprefix"; then
6488 installman3dir=`echo $man3direxp | $sed "s#^$prefix#$installprefix#"`
6490 installman3dir="$man3direxp"
6493 : What suffix to use on installed man pages
6499 rp="What suffix should be used for the $package library man pages?"
6501 '') case "$man3dir" in
6515 *) dflt="$man3ext";;
6522 : see if we have to deal with yellow pages, now NIS.
6523 if $test -d /usr/etc/yp || $test -d /etc/yp; then
6524 if $test -f /usr/etc/nibindd; then
6526 echo "I'm fairly confident you're on a NeXT."
6528 rp='Do you get the hosts file via NetInfo?'
6537 y*) hostcat='nidump hosts .';;
6538 *) case "$hostcat" in
6539 nidump*) hostcat='';;
6549 '') if $contains '^\+' /etc/passwd >/dev/null 2>&1; then
6557 rp='Are you getting the hosts file via yellow pages?'
6560 y*) hostcat='ypcat hosts';;
6561 *) hostcat='cat /etc/hosts';;
6567 '') test -f /etc/hosts && hostcat='cat /etc/hosts';;
6570 '') test -f /etc/group && groupcat='cat /etc/group';;
6573 '') test -f /etc/passwd && passcat='cat /etc/passwd';;
6576 : now get the host name
6578 echo "Figuring out host name..." >&4
6579 case "$myhostname" in
6581 echo 'Maybe "hostname" will work...'
6582 if tans=`sh -c hostname 2>&1` ; then
6590 if $test "$cont"; then
6592 echo 'Oh, dear. Maybe "/etc/systemid" is the key...'
6593 if tans=`cat /etc/systemid 2>&1` ; then
6595 phostname='cat /etc/systemid'
6596 echo "Whadyaknow. Xenix always was a bit strange..."
6599 elif $test -r /etc/systemid; then
6600 echo "(What is a non-Xenix system doing with /etc/systemid?)"
6603 if $test "$cont"; then
6604 echo 'No, maybe "uuname -l" will work...'
6605 if tans=`sh -c 'uuname -l' 2>&1` ; then
6607 phostname='uuname -l'
6609 echo 'Strange. Maybe "uname -n" will work...'
6610 if tans=`sh -c 'uname -n' 2>&1` ; then
6612 phostname='uname -n'
6614 echo 'Oh well, maybe I can mine it out of whoami.h...'
6615 if tans=`sh -c $contains' sysname $usrinc/whoami.h' 2>&1` ; then
6616 myhostname=`echo "$tans" | $sed 's/^.*"\(.*\)"/\1/'`
6617 phostname="sed -n -e '"'/sysname/s/^.*\"\\(.*\\)\"/\1/{'"' -e p -e q -e '}' <$usrinc/whoami.h"
6619 case "$myhostname" in
6620 '') echo "Does this machine have an identity crisis or something?"
6623 echo "Well, you said $myhostname before..."
6624 phostname='echo $myhostname';;
6630 : you do not want to know about this
6635 if $test "$myhostname" ; then
6637 rp='Your host name appears to be "'$myhostname'".'" Right?"
6645 : bad guess or no guess
6646 while $test "X$myhostname" = X ; do
6648 rp="Please type the (one word) name of your host:"
6653 : translate upper to lower if necessary
6654 case "$myhostname" in
6656 echo "(Normalizing case in your host name)"
6657 myhostname=`echo $myhostname | ./tr '[A-Z]' '[a-z]'`
6661 case "$myhostname" in
6663 dflt=`expr "X$myhostname" : "X[^.]*\(\..*\)"`
6664 myhostname=`expr "X$myhostname" : "X\([^.]*\)\."`
6665 echo "(Trimming domain name from host name--host name is now $myhostname)"
6667 *) case "$mydomain" in
6670 test "X$hostcat" = "Xypcat hosts" &&
6671 ypmatch "$myhostname" hosts 2>/dev/null |\
6672 $sed -e 's/[ ]*#.*//; s/$/ /' > hosts && \
6675 test "X$hostcat" != "X" &&
6676 $hostcat | $sed -n -e "s/[ ]*#.*//; s/\$/ /
6677 /[ ]$myhostname[ . ]/p" > hosts
6680 $test x`$awk "/[0-9].*[ ]$myhostname$tmp_re/ { sum++ }
6681 END { print sum }" hosts` = x1 || tmp_re="[ ]"
6682 dflt=.`$awk "/[0-9].*[ ]$myhostname$tmp_re/ {for(i=2; i<=NF;i++) print \\\$i}" \
6683 hosts | $sort | $uniq | \
6684 $sed -n -e "s/$myhostname\.\([-a-zA-Z0-9_.]\)/\1/p"`
6685 case `$echo X$dflt` in
6686 X*\ *) echo "(Several hosts in /etc/hosts matched hostname)"
6689 X.) echo "(You do not have fully-qualified names in /etc/hosts)"
6694 tans=`./loc resolv.conf X /etc /usr/etc`
6695 if $test -f "$tans"; then
6696 echo "(Attempting domain name extraction from $tans)"
6697 dflt=.`$sed -n -e 's/ / /g' \
6698 -e 's/^search *\([^ ]*\).*/\1/p' $tans \
6699 | ./tr '[A-Z]' '[a-z]' 2>/dev/null`
6701 .) dflt=.`$sed -n -e 's/ / /g' \
6702 -e 's/^domain *\([^ ]*\).*/\1/p' $tans \
6703 | ./tr '[A-Z]' '[a-z]' 2>/dev/null`
6710 .) echo "(No help from resolv.conf either -- attempting clever guess)"
6711 dflt=.`sh -c domainname 2>/dev/null`
6714 .nis.*|.yp.*|.main.*) dflt=`echo $dflt | $sed -e 's/^\.[^.]*//'`;;
6719 .) echo "(Lost all hope -- silly guess then)"
6725 *) dflt="$mydomain";;
6729 rp="What is your domain name?"
6739 : translate upper to lower if necessary
6742 echo "(Normalizing case in your domain name)"
6743 mydomain=`echo $mydomain | ./tr '[A-Z]' '[a-z]'`
6747 : a little sanity check here
6748 case "$phostname" in
6751 case `$phostname | ./tr '[A-Z]' '[a-z]'` in
6752 $myhostname$mydomain|$myhostname) ;;
6754 case "$phostname" in
6756 echo "(That doesn't agree with your whoami.h file, by the way.)"
6759 echo "(That doesn't agree with your $phostname command, by the way.)"
6769 I need to get your e-mail address in Internet format if possible, i.e.
6770 something like user@host.domain. Please answer accurately since I have
6771 no easy means to double check it. The default value provided below
6772 is most probably close to reality but may not be valid from outside
6773 your organization...
6777 while test "$cont"; do
6779 '') dflt="$cf_by@$myhostname$mydomain";;
6780 *) dflt="$cf_email";;
6782 rp='What is your e-mail address?'
6788 rp='Address does not look like an Internet one. Use it anyway?'
6804 If you or somebody else will be maintaining perl at your site, please
6805 fill in the correct e-mail address here so that they may be contacted
6806 if necessary. Currently, the "perlbug" program included with perl
6807 will send mail to this address in addition to perlbug@perl.com. You may
6808 enter "none" for no administrator.
6811 case "$perladmin" in
6812 '') dflt="$cf_email";;
6813 *) dflt="$perladmin";;
6815 rp='Perl administrator e-mail address'
6819 : figure out how to guarantee perl startup
6820 case "$startperl" in
6822 case "$sharpbang" in
6826 I can use the #! construct to start perl on your system. This will
6827 make startup of perl scripts faster, but may cause problems if you
6828 want to share those scripts and perl is not in a standard place
6829 ($binexp/perl) on all your platforms. The alternative is to force
6830 a shell by starting the script with a single ':' character.
6834 rp='What shall I put after the #! to start up perl ("none" to not use #!)?'
6837 none) startperl=": # use perl";;
6838 *) startperl="#!$ans"
6839 if $test 30 -lt `echo "$ans" | wc -c`; then
6842 WARNING: Some systems limit the #! command to 32 characters.
6843 If you experience difficulty running Perl scripts with #!, try
6844 installing Perl in a directory with a shorter pathname.
6850 *) startperl=": # use perl"
6855 echo "I'll use $startperl to start perl scripts."
6857 : figure best path for perl in scripts
6860 perlpath="$binexp/perl"
6861 case "$startperl" in
6866 I will use the "eval 'exec'" idiom to start Perl on your system.
6867 I can use the full path of your Perl binary for this purpose, but
6868 doing so may cause problems if you want to share those scripts and
6869 Perl is not always in a standard place ($binexp/perl).
6873 rp="What path shall I use in \"eval 'exec'\"?"
6880 case "$startperl" in
6882 *) echo "I'll use $perlpath in \"eval 'exec'\"" ;;
6885 : determine where public executable scripts go
6886 set scriptdir scriptdir
6888 case "$scriptdir" in
6891 : guess some guesses
6892 $test -d /usr/share/scripts && dflt=/usr/share/scripts
6893 $test -d /usr/share/bin && dflt=/usr/share/bin
6894 $test -d /usr/local/script && dflt=/usr/local/script
6895 $test -d /usr/local/scripts && dflt=/usr/local/scripts
6896 $test -d $prefixexp/script && dflt=$prefixexp/script
6900 *) dflt="$scriptdir"
6905 Some installations have a separate directory just for executable scripts so
6906 that they can mount it across multiple architectures but keep the scripts in
6907 one spot. You might, for example, have a subdirectory of /usr/share for this.
6908 Or you might just lump your scripts in with all your other executables.
6912 rp='Where do you keep publicly executable scripts?'
6914 if $test "X$ansexp" != "X$scriptdirexp"; then
6918 scriptdirexp="$ansexp"
6919 : Change installation prefix, if necessary.
6920 if $test X"$prefix" != X"$installprefix"; then
6921 installscript=`echo $scriptdirexp | sed "s#^$prefix#$installprefix#"`
6923 installscript="$scriptdirexp"
6926 : determine where site specific architecture-dependent libraries go.
6927 : sitelib default is /usr/local/lib/perl5/site_perl/$version
6928 : sitearch default is /usr/local/lib/perl5/site_perl/$version/$archname
6929 : sitelib may have an optional trailing /share.
6930 tdflt=`echo $sitelib | $sed 's,/share$,,'`
6931 tdflt="$tdflt/$archname"
6932 set sitearch sitearch none
6935 '') dflt="$tdflt" ;;
6936 *) dflt="$sitearch" ;;
6940 The installation process will also create a directory for
6941 architecture-dependent site-specific extensions and modules.
6945 rp='Pathname for the site-specific architecture-dependent library files?'
6948 sitearchexp="$ansexp"
6949 : Change installation prefix, if necessary.
6950 if $test X"$prefix" != X"$installprefix"; then
6951 installsitearch=`echo $sitearchexp | sed "s#^$prefix#$installprefix#"`
6953 installsitearch="$sitearchexp"
6956 : determine where add-on public executables go
6958 '') dflt=$siteprefix/bin ;;
6962 rp='Pathname where the add-on public executables should be installed?'
6965 sitebinexp="$ansexp"
6966 : Change installation prefix, if necessary.
6967 if $test X"$prefix" != X"$installprefix"; then
6968 installsitebin=`echo $sitebinexp | sed "s#^$prefix#$installprefix#"`
6970 installsitebin="$sitebinexp"
6973 : see if sqrtl exists
6979 Perl can be built to take advantage of long doubles which
6980 (if available) may give more accuracy and range for floating point numbers.
6982 If this doesn't make any sense to you, just accept the default 'n'.
6986 *-DUSE_LONG_DOUBLE*|*-DUSE_MORE_BITS*) uselongdouble="$define" ;;
6989 case "$uselongdouble" in
6990 $define|true|[yY]*) dflt='y';;
6993 rp='Try to use long doubles if available?'
6996 y|Y) val="$define" ;;
7002 case "$uselongdouble" in
7003 true|[yY]*) uselongdouble="$define" ;;
7006 case "$uselongdouble" in
7008 : Look for a hint-file generated 'call-back-unit'. If the
7009 : user has specified that long doubles should be used,
7010 : we may need to set or change some other defaults.
7011 if $test -f uselongdouble.cbu; then
7012 echo "Your platform has some specific hints for long doubles, using them..."
7013 . ./uselongdouble.cbu
7016 (Your platform doesn't have any specific hints for long doubles.)
7022 case "$uselongdouble:$d_sqrtl" in
7026 You requested the use of long doubles but you do not seem to have
7027 the mathematic functions for long doubles. I'm disabling the use
7030 uselongdouble=$undef
7036 Perl can be built to take advantage of long longs which
7037 (if available) may give more range for integer numbers.
7039 If this doesn't make any sense to you, just accept the default 'n'.
7043 *-DUSE_LONG_LONG*) uselonglong="$define" ;;
7046 case "$uselonglong" in
7049 rp='Try to use long longs if available?'
7052 y|Y) val="$define" ;;
7058 case "$uselonglong" in
7059 true|[yY]*) uselonglong="$define" ;;
7062 case "$uselonglong" in
7064 : Look for a hint-file generated 'call-back-unit'. If the
7065 : user has specified that long longs should be used,
7066 : we may need to set or change some other defaults.
7067 if $test -f uselonglong.cbu; then
7068 echo "Your platform has some specific hints for long longs, using them..."
7072 (Your platform doesn't have any specific hints for long longs.)
7080 Previous version of $package used the standard IO mechanisms as defined
7081 in <stdio.h>. Versions 5.003_02 and later of perl allow alternate IO
7082 mechanisms via a "PerlIO" abstraction, but the stdio mechanism is still
7083 the default. This abstraction layer can use AT&T's sfio (if you already
7084 have sfio installed) or regular stdio. Using PerlIO with sfio may cause
7085 problems with some extension modules. Using PerlIO with stdio is safe,
7086 but it is slower than plain stdio and therefore is not the default.
7088 If this doesn't make any sense to you, just accept the default 'n'.
7090 case "$useperlio" in
7091 $define|true|[yY]*) dflt='y';;
7094 rp='Use the experimental PerlIO abstraction layer?'
7101 echo "Ok, doing things the stdio way"
7108 case "$vendorprefix" in
7109 '') d_vendorbin="$undef"
7113 *) d_vendorbin="$define"
7114 : determine where vendor-supplied executables go.
7115 dflt=$vendorprefix/bin
7117 rp='Pathname for the vendor-supplied executables directory?'
7120 vendorbinexp="$ansexp"
7121 : Change installation prefix, if necessary.
7122 if $test X"$prefix" != X"$installprefix"; then
7123 installvendorbin=`echo $vendorbinexp | $sed "s#^$prefix#$installprefix#"`
7125 installvendorbin="$vendorbinexp"
7130 : check for length of double
7132 case "$doublesize" in
7134 $echo $n "Checking to see how big your double precision numbers are...$c" >&4
7135 $cat >try.c <<'EOCP'
7139 printf("%d\n", (int)sizeof(double));
7144 if eval $compile_ok; then
7146 $echo " $doublesize bytes." >&4
7149 echo "(I can't seem to compile the test program. Guessing...)"
7150 rp="What is the size of a double precision number (in bytes)?"
7158 : check for long doubles
7160 $echo $n "Checking to see if your system supports long double..." $c >&4
7161 echo 'int main() { long double x = 7.0; }' > try.c
7163 if eval $compile; then
7165 echo " Yes, it does." >&4
7168 echo " No, it doesn't." >&4
7174 : check for length of long double
7175 case "${d_longdbl}${longdblsize}" in
7178 $echo $n "Checking to see how big your long doubles are..." $c >&4
7179 $cat >try.c <<'EOCP'
7183 printf("%d\n", sizeof(long double));
7188 if eval $compile; then
7189 longdblsize=`./try$exe_ext`
7190 $echo " $longdblsize bytes." >&4
7194 echo "(I can't seem to compile the test program. Guessing...)" >&4
7195 rp="What is the size of a long double (in bytes)?"
7199 if $test "X$doublesize" = "X$longdblsize"; then
7200 echo "(That isn't any different from an ordinary double.)"
7206 : Check how to convert floats to strings.
7207 if test "X$d_Gconvert" = X; then
7209 echo "Checking for an efficient way to convert floats to strings."
7212 #define Gconvert(x,n,t,b) gconvert((x),(n),(t),(b))
7213 char *myname = "gconvert";
7216 #define Gconvert(x,n,t,b) gcvt((x),(n),(b))
7217 char *myname = "gcvt";
7220 #define Gconvert(x,n,t,b) qgcvt((x),(n),(b))
7221 char *myname = "qgcvt";
7222 #define DOUBLETYPE long double
7225 #define Gconvert(x,n,t,b) sprintf((b),"%.*g",(n),(x))
7226 char *myname = "sprintf";
7230 #define DOUBLETYPE double
7235 #define I_STDLIB $i_stdlib
7241 checkit(expect, got)
7245 if (strcmp(expect, got)) {
7246 printf("%s oddity: Expected %s, got %s\n",
7247 myname, expect, got);
7257 /* This must be 1st test on (which?) platform */
7258 /* Alan Burlison <AlanBurlsin@unn.unisys.com> */
7259 Gconvert((DOUBLETYPE)0.1, 8, 0, buf);
7260 checkit("0.1", buf);
7262 Gconvert((DOUBLETYPE)1.0, 8, 0, buf);
7265 Gconvert((DOUBLETYPE)0.0, 8, 0, buf);
7268 Gconvert((DOUBLETYPE)-1.0, 8, 0, buf);
7271 /* Some Linux gcvt's give 1.e+5 here. */
7272 Gconvert((DOUBLETYPE)100000.0, 8, 0, buf);
7273 checkit("100000", buf);
7275 /* Some Linux gcvt's give -1.e+5 here. */
7276 Gconvert((DOUBLETYPE)-100000.0, 8, 0, buf);
7277 checkit("-100000", buf);
7282 case "$d_Gconvert" in
7283 gconvert*) xxx_list='gconvert gcvt sprintf' ;;
7284 gcvt*) xxx_list='gcvt gconvert sprintf' ;;
7285 sprintf*) xxx_list='sprintf gconvert gcvt' ;;
7286 *) xxx_list='gconvert gcvt sprintf' ;;
7289 case "$d_longdbl$uselongdouble" in
7290 definedefine) xxx_list="`echo $xxx_list|sed 's/gcvt/qgcvt gcvt/'`" ;;
7293 for xxx_convert in $xxx_list; do
7294 echo "Trying $xxx_convert..."
7296 set try -DTRY_$xxx_convert
7297 if eval $compile; then
7298 echo "$xxx_convert() found." >&4
7300 echo "I'll use $xxx_convert to convert floats into a string." >&4
7303 echo "...But $xxx_convert didn't work as I expected."
7306 echo "$xxx_convert NOT found." >&4
7310 case "$xxx_convert" in
7311 gconvert) d_Gconvert='gconvert((x),(n),(t),(b))' ;;
7312 gcvt) d_Gconvert='gcvt((x),(n),(b))' ;;
7313 qgcvt) d_Gconvert='qgcvt((x),(n),(b))' ;;
7314 *) d_Gconvert='sprintf((b),"%.*g",(n),(x))' ;;
7320 if $test X"$d_longdbl" = X"$define"; then
7322 echo "Checking how to print long doubles..." >&4
7324 if $test X"$sPRIfldbl" = X -a X"$doublesize" = X"$longdblsize"; then
7325 $cat >try.c <<'EOCP'
7326 #include <sys/types.h>
7330 printf("%.3f\n", d);
7334 if eval $compile; then
7338 sPRIfldbl='"f"'; sPRIgldbl='"g"'; sPRIeldbl='"e"';
7339 sPRIFldbl='"F"'; sPRIGldbl='"G"'; sPRIEldbl='"E"';
7340 echo "We will use %f."
7346 if $test X"$sPRIfldbl" = X; then
7347 $cat >try.c <<'EOCP'
7348 #include <sys/types.h>
7351 long double d = 123.456;
7352 printf("%.3llf\n", d);
7356 if eval $compile; then
7360 sPRIfldbl='"llf"'; sPRIgldbl='"llg"'; sPRIeldbl='"lle"';
7361 sPRIFldbl='"llF"'; sPRIGldbl='"llG"'; sPRIEldbl='"llE"';
7362 echo "We will use %llf."
7368 if $test X"$sPRIfldbl" = X; then
7369 $cat >try.c <<'EOCP'
7370 #include <sys/types.h>
7373 long double d = 123.456;
7374 printf("%.3Lf\n", d);
7378 if eval $compile; then
7382 sPRIfldbl='"Lf"'; sPRIgldbl='"Lg"'; sPRIeldbl='"Le"';
7383 sPRIFldbl='"LF"'; sPRIGldbl='"LG"'; sPRIEldbl='"LE"';
7384 echo "We will use %Lf."
7390 if $test X"$sPRIfldbl" = X; then
7391 $cat >try.c <<'EOCP'
7392 #include <sys/types.h>
7395 long double d = 123.456;
7396 printf("%.3lf\n", d);
7400 if eval $compile; then
7404 sPRIfldbl='"lf"'; sPRIgldbl='"lg"'; sPRIeldbl='"le"';
7405 sPRIFldbl='"lF"'; sPRIGldbl='"lG"'; sPRIEldbl='"lE"';
7406 echo "We will use %lf."
7412 if $test X"$sPRIfldbl" = X; then
7413 echo "Cannot figure out how to print long doubles." >&4
7420 case "$sPRIfldbl" in
7421 '') d_PRIfldbl="$undef"; d_PRIgldbl="$undef"; d_PRIeldbl="$undef";
7422 d_PRIFldbl="$undef"; d_PRIGldbl="$undef"; d_PRIEldbl="$undef";
7424 *) d_PRIfldbl="$define"; d_PRIgldbl="$define"; d_PRIeldbl="$define";
7425 d_PRIFldbl="$define"; d_PRIGldbl="$define"; d_PRIEldbl="$define";
7429 : Initialize h_fcntl
7432 : Initialize h_sysfile
7435 : access call always available on UNIX
7439 : locate the flags for 'access()'
7443 $cat >access.c <<'EOCP'
7444 #include <sys/types.h>
7449 #include <sys/file.h>
7458 : check sys/file.h first, no particular reason here
7459 if $test `./findhdr sys/file.h` && \
7460 $cc $cppflags -DI_SYS_FILE -o access access.c >/dev/null 2>&1 ; then
7462 echo "<sys/file.h> defines the *_OK access constants." >&4
7463 elif $test `./findhdr fcntl.h` && \
7464 $cc $cppflags -DI_FCNTL -o access access.c >/dev/null 2>&1 ; then
7466 echo "<fcntl.h> defines the *_OK access constants." >&4
7467 elif $test `./findhdr unistd.h` && \
7468 $cc $cppflags -DI_UNISTD -o access access.c >/dev/null 2>&1 ; then
7469 echo "<unistd.h> defines the *_OK access constants." >&4
7471 echo "I can't find the four *_OK access constants--I'll use mine." >&4
7477 : see if accessx exists
7478 set accessx d_accessx
7481 : see if alarm exists
7485 : see if atolf exists
7489 : see if atoll exists
7493 : Look for GNU-cc style attribute checking
7495 echo "Checking whether your compiler can handle __attribute__ ..." >&4
7496 $cat >attrib.c <<'EOCP'
7498 void croak (char* pat,...) __attribute__((format(printf,1,2),noreturn));
7500 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
7501 if $contains 'warning' attrib.out >/dev/null 2>&1; then
7502 echo "Your C compiler doesn't fully support __attribute__."
7505 echo "Your C compiler supports __attribute__."
7509 echo "Your C compiler doesn't seem to understand __attribute__ at all."
7516 : see if bcmp exists
7520 : see if bcopy exists
7524 : see if this is a unistd.h system
7525 set unistd.h i_unistd
7528 : see if getpgrp exists
7529 set getpgrp d_getpgrp
7532 case "$d_getpgrp" in
7535 echo "Checking to see which flavor of getpgrp is in use..."
7538 #include <sys/types.h>
7540 # include <unistd.h>
7544 if (getuid() == 0) {
7545 printf("(I see you are running Configure as super-user...)\n");
7549 if (getpgrp(1) == 0)
7558 if $cc -DTRY_BSD_PGRP $ccflags $ldflags -o set set.c $libs >/dev/null 2>&1 && ./set; then
7559 echo "You have to use getpgrp(pid) instead of getpgrp()." >&4
7561 elif $cc $ccflags $ldflags -o set set.c $libs >/dev/null 2>&1 && ./set; then
7562 echo "You have to use getpgrp() instead of getpgrp(pid)." >&4
7565 echo "I can't seem to compile and run the test program."
7567 xxx="a USG one, i.e. you use getpgrp()."
7569 # SVR4 systems can appear rather BSD-ish.
7572 xxx="a BSD one, i.e. you use getpgrp(pid)."
7576 xxx="probably a USG one, i.e. you use getpgrp()."
7581 echo "Assuming your getpgrp is $xxx" >&4
7590 : see if setpgrp exists
7591 set setpgrp d_setpgrp
7594 case "$d_setpgrp" in
7597 echo "Checking to see which flavor of setpgrp is in use..."
7600 #include <sys/types.h>
7602 # include <unistd.h>
7606 if (getuid() == 0) {
7607 printf("(I see you are running Configure as super-user...)\n");
7611 if (-1 == setpgrp(1, 1))
7614 if (setpgrp() != -1)
7620 if $cc -DTRY_BSD_PGRP $ccflags $ldflags -o set set.c $libs >/dev/null 2>&1 && ./set; then
7621 echo 'You have to use setpgrp(pid,pgrp) instead of setpgrp().' >&4
7623 elif $cc $ccflags $ldflags -o set set.c $libs >/dev/null 2>&1 && ./set; then
7624 echo 'You have to use setpgrp() instead of setpgrp(pid,pgrp).' >&4
7627 echo "(I can't seem to compile and run the test program.)"
7629 xxx="a USG one, i.e. you use setpgrp()."
7631 # SVR4 systems can appear rather BSD-ish.
7634 xxx="a BSD one, i.e. you use setpgrp(pid,pgrp)."
7638 xxx="probably a USG one, i.e. you use setpgrp()."
7643 echo "Assuming your setpgrp is $xxx" >&4
7651 : see if bzero exists
7655 : see if signal is declared as pointer to function returning int or void
7657 xxx=`./findhdr signal.h`
7658 $test "$xxx" && $cppstdin $cppminus $cppflags < $xxx >$$.tmp 2>/dev/null
7659 if $contains 'int.*\*[ ]*signal' $$.tmp >/dev/null 2>&1 ; then
7660 echo "You have int (*signal())() instead of void." >&4
7662 elif $contains 'void.*\*[ ]*signal' $$.tmp >/dev/null 2>&1 ; then
7663 echo "You have void (*signal())()." >&4
7665 elif $contains 'extern[ ]*[(\*]*signal' $$.tmp >/dev/null 2>&1 ; then
7666 echo "You have int (*signal())() instead of void." >&4
7668 elif $contains 'void.*\*.*sig' $$.tmp >/dev/null 2>&1 ; then
7669 echo "You have void (*signal())()." >&4
7672 case "$d_voidsig" in
7674 echo "I can't determine whether signal handler returns void or int..." >&4
7676 rp="What type does your signal handler return?"
7683 echo "As you already told me, signal handler returns void." >&4
7686 *) echo "As you already told me, signal handler returns int." >&4
7693 case "$d_voidsig" in
7694 "$define") signal_t="void";;
7699 : check for ability to cast large floats to 32-bit ints.
7701 echo 'Checking whether your C compiler can cast large floats to int32.' >&4
7702 if $test "$intsize" -ge 4; then
7709 #include <sys/types.h>
7711 $signal_t blech(s) int s; { exit(3); }
7718 signal(SIGFPE, blech);
7720 /* Don't let compiler optimize the test away. Store the number
7721 in a writable string for gcc to pass to sscanf under HP/UX.
7723 sprintf(str, "2147483647");
7724 sscanf(str, "%lf", &f); /* f = (double) 0x7fffffff; */
7728 /* x86 processors will probably give 0x8000 0000, which is a
7729 sign change. We don't want that. We want to mimic SPARC
7730 behavior here, which is to preserve the sign and give
7733 if (i32 != ($xxx) f)
7739 if eval $compile_ok; then
7743 echo "(I can't seem to compile the test program--assuming it can't)"
7751 echo "Nope, it can't."
7758 : check for ability to cast negative floats to unsigned
7760 echo 'Checking whether your C compiler can cast negative float to unsigned.' >&4
7763 #include <sys/types.h>
7765 $signal_t blech(s) int s; { exit(7); }
7766 $signal_t blech_in_list(s) int s; { exit(4); }
7767 unsigned long dummy_long(p) unsigned long p; { return p; }
7768 unsigned int dummy_int(p) unsigned int p; { return p; }
7769 unsigned short dummy_short(p) unsigned short p; { return p; }
7773 unsigned long along;
7775 unsigned short ashort;
7779 /* Frustrate gcc-2.7.2's optimizer which failed this test with
7780 a direct f = -123. assignment. gcc-2.8.0 reportedly
7781 optimized the whole file away
7783 /* Store the number in a writable string for gcc to pass to
7786 sprintf(str, "-123");
7787 sscanf(str, "%lf", &f); /* f = -123.; */
7789 signal(SIGFPE, blech);
7790 along = (unsigned long)f;
7791 aint = (unsigned int)f;
7792 ashort = (unsigned short)f;
7793 if (along != (unsigned long)-123)
7795 if (aint != (unsigned int)-123)
7797 if (ashort != (unsigned short)-123)
7799 sprintf(str, "1073741824.");
7800 sscanf(str, "%lf", &f); /* f = (double)0x40000000; */
7803 along = (unsigned long)f;
7804 if (along != 0x80000000)
7808 along = (unsigned long)f;
7809 if (along != 0x7fffffff)
7813 along = (unsigned long)f;
7814 if (along != 0x80000001)
7818 signal(SIGFPE, blech_in_list);
7819 sprintf(str, "123.");
7820 sscanf(str, "%lf", &f); /* f = 123.; */
7821 along = dummy_long((unsigned long)f);
7822 aint = dummy_int((unsigned int)f);
7823 ashort = dummy_short((unsigned short)f);
7824 if (along != (unsigned long)123)
7826 if (aint != (unsigned int)123)
7828 if (ashort != (unsigned short)123)
7835 if eval $compile_ok; then
7839 echo "(I can't seem to compile the test program--assuming it can't)"
7842 case "$castflags" in
7847 echo "Nope, it can't."
7854 : see if vprintf exists
7856 if set vprintf val -f d_vprintf; eval $csym; $val; then
7857 echo 'vprintf() found.' >&4
7859 $cat >vprintf.c <<'EOF'
7860 #include <varargs.h>
7862 int main() { xxx("foo"); }
7871 exit((unsigned long)vsprintf(buf,"%s",args) > 10L);
7875 if eval $compile && ./vprintf; then
7876 echo "Your vsprintf() returns (int)." >&4
7879 echo "Your vsprintf() returns (char*)." >&4
7883 echo 'vprintf() NOT found.' >&4
7893 : see if chown exists
7897 : see if chroot exists
7901 : see if chsize exists
7905 : check for const keyword
7907 echo 'Checking to see if your C compiler knows about "const"...' >&4
7908 $cat >const.c <<'EOCP'
7909 typedef struct spug { int drokk; } spug;
7916 if $cc -c $ccflags const.c >/dev/null 2>&1 ; then
7918 echo "Yup, it does."
7921 echo "Nope, it doesn't."
7926 : see if crypt exists
7928 if set crypt val -f d_crypt; eval $csym; $val; then
7929 echo 'crypt() found.' >&4
7933 cryptlib=`./loc Slibcrypt$_a "" $xlibpth`
7934 if $test -z "$cryptlib"; then
7935 cryptlib=`./loc Mlibcrypt$_a "" $xlibpth`
7939 if $test -z "$cryptlib"; then
7940 cryptlib=`./loc Llibcrypt$_a "" $xlibpth`
7944 if $test -z "$cryptlib"; then
7945 cryptlib=`./loc libcrypt$_a "" $libpth`
7949 if $test -z "$cryptlib"; then
7950 echo 'crypt() NOT found.' >&4
7959 : get csh whereabouts
7961 'csh') val="$undef" ;;
7966 : Respect a hint or command line value for full_csh.
7968 '') full_csh=$csh ;;
7971 : see if cuserid exists
7972 set cuserid d_cuserid
7975 : see if this is a limits.h system
7976 set limits.h i_limits
7979 : see if this is a float.h system
7983 : See if number of significant digits in a double precision number is known
7985 $cat >dbl_dig.c <<EOM
7995 printf("Contains DBL_DIG");
7998 $cppstdin $cppflags $cppminus < dbl_dig.c >dbl_dig.E 2>/dev/null
7999 if $contains 'DBL_DIG' dbl_dig.E >/dev/null 2>&1; then
8000 echo "DBL_DIG found." >&4
8003 echo "DBL_DIG NOT found." >&4
8010 : see if difftime exists
8011 set difftime d_difftime
8014 : see if this is a dirent system
8016 if xinc=`./findhdr dirent.h`; $test "$xinc"; then
8018 echo "<dirent.h> found." >&4
8021 if xinc=`./findhdr sys/dir.h`; $test "$xinc"; then
8022 echo "<sys/dir.h> found." >&4
8025 xinc=`./findhdr sys/ndir.h`
8027 echo "<dirent.h> NOT found." >&4
8032 : Look for type of directory structure.
8034 $cppstdin $cppflags $cppminus < "$xinc" > try.c
8036 case "$direntrytype" in
8039 $define) guess1='struct dirent' ;;
8040 *) guess1='struct direct' ;;
8043 *) guess1="$direntrytype"
8048 'struct dirent') guess2='struct direct' ;;
8049 *) guess2='struct dirent' ;;
8052 if $contains "$guess1" try.c >/dev/null 2>&1; then
8053 direntrytype="$guess1"
8054 echo "Your directory entries are $direntrytype." >&4
8055 elif $contains "$guess2" try.c >/dev/null 2>&1; then
8056 direntrytype="$guess2"
8057 echo "Your directory entries seem to be $direntrytype." >&4
8059 echo "I don't recognize your system's directory entries." >&4
8060 rp="What type is used for directory entries on this system?"
8068 : see if the directory entry stores field length
8070 $cppstdin $cppflags $cppminus < "$xinc" > try.c
8071 if $contains 'd_namlen' try.c >/dev/null 2>&1; then
8072 echo "Good, your directory entry keeps length information in d_namlen." >&4
8075 echo "Your directory entry does not know about the d_namlen field." >&4
8082 : see if dlerror exists
8085 set dlerror d_dlerror
8089 : see if dlfcn is available
8097 On a few systems, the dynamically loaded modules that perl generates and uses
8098 will need a different extension than shared libs. The default will probably
8106 rp='What is the extension of dynamically loaded modules'
8115 : Check if dlsym need a leading underscore
8121 echo "Checking whether your dlsym() needs a leading underscore ..." >&4
8122 $cat >dyna.c <<'EOM'
8131 #include <dlfcn.h> /* the dynamic linker include file for Sunos/Solaris */
8133 #include <sys/types.h>
8147 int mode = RTLD_LAZY ;
8149 handle = dlopen("./dyna.$dlext", mode) ;
8150 if (handle == NULL) {
8155 symbol = dlsym(handle, "fred") ;
8156 if (symbol == NULL) {
8157 /* try putting a leading underscore */
8158 symbol = dlsym(handle, "_fred") ;
8159 if (symbol == NULL) {
8172 : Call the object file tmp-dyna.o in case dlext=o.
8173 if $cc $ccflags $cccdlflags -c dyna.c > /dev/null 2>&1 &&
8174 mv dyna${_o} tmp-dyna${_o} > /dev/null 2>&1 &&
8175 $ld $lddlflags -o dyna.$dlext tmp-dyna${_o} > /dev/null 2>&1 &&
8176 $cc $ccflags -o fred $ldflags $cccdlflags $ccdlflags fred.c $libs > /dev/null 2>&1; then
8179 1) echo "Test program failed using dlopen." >&4
8180 echo "Perhaps you should not use dynamic loading." >&4;;
8181 2) echo "Test program failed using dlsym." >&4
8182 echo "Perhaps you should not use dynamic loading." >&4;;
8183 3) echo "dlsym needs a leading underscore" >&4
8185 4) echo "dlsym doesn't need a leading underscore." >&4;;
8188 echo "I can't compile and run the test program." >&4
8189 echo "I'm guessing that dlsym doesn't need a leading underscore." >&4
8194 $rm -f fred fred.? dyna.$dlext dyna.? tmp-dyna.?
8199 hasproto='varname=$1; func=$2; shift; shift;
8200 while $test $# -ge 2; do
8202 $define) echo "#include <$2>";;
8206 $cppstdin $cppflags $cppminus < try.c > tryout.c 2>/dev/null;
8207 if $contains "$func.*(" tryout.c >/dev/null 2>&1; then
8208 echo "$func() prototype found.";
8211 echo "$func() prototype NOT found.";
8216 $rm -f try.c tryout.c'
8218 : see if prototype for drand48 is available
8220 set d_drand48proto drand48 $i_stdlib stdlib.h $i_unistd unistd.h
8223 : see if dup2 exists
8227 : see if eaccess exists
8228 set eaccess d_eaccess
8231 : see if endgrent exists
8232 set endgrent d_endgrent
8235 : see if endhostent exists
8236 set endhostent d_endhent
8239 : see if endnetent exists
8240 set endnetent d_endnent
8243 : see if endprotoent exists
8244 set endprotoent d_endpent
8247 : see if endpwent exists
8248 set endpwent d_endpwent
8251 : see if endservent exists
8252 set endservent d_endsent
8255 : see if endspent exists
8256 set endspent d_endspent
8259 : Locate the flags for 'open()'
8261 $cat >open3.c <<'EOCP'
8262 #include <sys/types.h>
8267 #include <sys/file.h>
8278 : check sys/file.h first to get FREAD on Sun
8279 if $test `./findhdr sys/file.h` && \
8280 set open3 -DI_SYS_FILE && eval $compile; then
8282 echo "<sys/file.h> defines the O_* constants..." >&4
8284 echo "and you have the 3 argument form of open()." >&4
8287 echo "but not the 3 argument form of open(). Oh, well." >&4
8290 elif $test `./findhdr fcntl.h` && \
8291 set open3 -DI_FCNTL && eval $compile; then
8293 echo "<fcntl.h> defines the O_* constants..." >&4
8295 echo "and you have the 3 argument form of open()." >&4
8298 echo "but not the 3 argument form of open(). Oh, well." >&4
8303 echo "I can't find the O_* constant definitions! You got problems." >&4
8309 : see which of string.h or strings.h is needed
8311 strings=`./findhdr string.h`
8312 if $test "$strings" && $test -r "$strings"; then
8313 echo "Using <string.h> instead of <strings.h>." >&4
8317 strings=`./findhdr strings.h`
8318 if $test "$strings" && $test -r "$strings"; then
8319 echo "Using <strings.h> instead of <string.h>." >&4
8321 echo "No string header found -- You'll surely have problems." >&4
8327 "$undef") strings=`./findhdr strings.h`;;
8328 *) strings=`./findhdr string.h`;;
8331 : check for non-blocking I/O stuff
8332 case "$h_sysfile" in
8333 true) echo "#include <sys/file.h>" > head.c;;
8336 true) echo "#include <fcntl.h>" > head.c;;
8337 *) echo "#include <sys/fcntl.h>" > head.c;;
8342 echo "Figuring out the flag used by open() for non-blocking I/O..." >&4
8343 case "$o_nonblock" in
8346 $cat >>try.c <<'EOCP'
8350 printf("O_NONBLOCK\n");
8354 printf("O_NDELAY\n");
8358 printf("FNDELAY\n");
8365 if eval $compile_ok; then
8367 case "$o_nonblock" in
8368 '') echo "I can't figure it out, assuming O_NONBLOCK will do.";;
8369 *) echo "Seems like we can use $o_nonblock.";;
8372 echo "(I can't compile the test program; pray O_NONBLOCK is right!)"
8375 *) echo "Using $hint value $o_nonblock.";;
8377 $rm -f try try.* .out core
8380 echo "Let's see what value errno gets from read() on a $o_nonblock file..." >&4
8386 #include <sys/types.h>
8389 #define MY_O_NONBLOCK $o_nonblock
8390 #ifndef errno /* XXX need better Configure test */
8400 #include <strings.h>
8402 $signal_t blech(x) int x; { exit(3); }
8404 $cat >> try.c <<'EOCP'
8412 pipe(pd); /* Down: child -> parent */
8413 pipe(pu); /* Up: parent -> child */
8416 close(pd[1]); /* Parent reads from pd[0] */
8417 close(pu[0]); /* Parent writes (blocking) to pu[1] */
8418 if (-1 == fcntl(pd[0], F_SETFL, MY_O_NONBLOCK))
8420 signal(SIGALRM, blech);
8422 if ((ret = read(pd[0], buf, 1)) > 0) /* Nothing to read! */
8424 sprintf(string, "%d\n", ret);
8425 write(2, string, strlen(string));
8428 if (errno == EAGAIN) {
8434 if (errno == EWOULDBLOCK)
8435 printf("EWOULDBLOCK\n");
8438 write(pu[1], buf, 1); /* Unblocks child, tell it to close our pipe */
8439 sleep(2); /* Give it time to close our pipe */
8441 ret = read(pd[0], buf, 1); /* Should read EOF */
8443 sprintf(string, "%d\n", ret);
8444 write(3, string, strlen(string));
8448 close(pd[0]); /* We write to pd[1] */
8449 close(pu[1]); /* We read from pu[0] */
8450 read(pu[0], buf, 1); /* Wait for parent to signal us we may continue */
8451 close(pd[1]); /* Pipe pd is now fully closed! */
8452 exit(0); /* Bye bye, thank you for playing! */
8456 if eval $compile_ok; then
8457 echo "$startsh" >mtry
8458 echo "./try >try.out 2>try.ret 3>try.err || exit 4" >>mtry
8460 ./mtry >/dev/null 2>&1
8462 0) eagain=`$cat try.out`;;
8463 1) echo "Could not perform non-blocking setting!";;
8464 2) echo "I did a successful read() for something that was not there!";;
8465 3) echo "Hmm... non-blocking I/O does not seem to be working!";;
8466 *) echo "Something terribly wrong happened during testing.";;
8468 rd_nodata=`$cat try.ret`
8469 echo "A read() system call with no data present returns $rd_nodata."
8470 case "$rd_nodata" in
8473 echo "(That's peculiar, fixing that to be -1.)"
8479 echo "Forcing errno EAGAIN on read() with no data available."
8483 echo "Your read() sets errno to $eagain when no data is available."
8486 status=`$cat try.err`
8488 0) echo "And it correctly returns 0 to signal EOF.";;
8489 -1) echo "But it also returns -1 to signal EOF, so be careful!";;
8490 *) echo "However, your read() returns '$status' on EOF??";;
8493 if test "$status" = "$rd_nodata"; then
8494 echo "WARNING: you can't distinguish between EOF and no data!"
8498 echo "I can't compile the test program--assuming errno EAGAIN will do."
8505 echo "Using $hint value $eagain."
8506 echo "Your read() returns $rd_nodata when no data is present."
8507 case "$d_eofnblk" in
8508 "$define") echo "And you can see EOF because read() returns 0.";;
8509 "$undef") echo "But you can't see EOF status from read() returned value.";;
8511 echo "(Assuming you can't see EOF status from read anyway.)"
8517 $rm -f try try.* .out core head.c mtry
8519 : see if fchmod exists
8523 : see if fchown exists
8527 : see if this is an fcntl system
8531 hasfield='varname=$1; struct=$2; field=$3; shift; shift; shift;
8532 while $test $# -ge 2; do
8534 $define) echo "#include <$2>";;
8538 echo "int main () { struct $struct foo; char* bar; bar = (char*)foo.$field; }" >> try.c;
8540 if eval $compile; then
8551 : see whether socket exists
8553 $echo $n "Hmm... $c" >&4
8554 if set socket val -f d_socket; eval $csym; $val; then
8555 echo "Looks like you have Berkeley networking support." >&4
8557 if set setsockopt val -f; eval $csym; $val; then
8560 echo "...but it uses the old BSD 4.1c interface, rather than 4.2." >&4
8564 if $contains socklib libc.list >/dev/null 2>&1; then
8565 echo "Looks like you have Berkeley networking support." >&4
8567 : we will have to assume that it supports the 4.2 BSD interface
8570 echo "You don't have Berkeley networking in libc$_a..." >&4
8571 if test "X$d_socket" = "X$define"; then
8572 echo "...but you seem to believe that you have sockets." >&4
8574 for net in net socket
8576 if test -f /usr/lib/lib$net$_a; then
8577 ( ($nm $nm_opt /usr/lib/lib$net$_a | eval $nm_extract) || \
8578 $ar t /usr/lib/lib$net$_a) 2>/dev/null >> libc.list
8579 if $contains socket libc.list >/dev/null 2>&1; then
8584 echo "...but the Wollongong group seems to have hacked it in." >&4
8585 sockethdr="-I/usr/netinclude"
8588 echo "Found Berkeley sockets interface in lib$net." >& 4
8589 if $contains setsockopt libc.list >/dev/null 2>&1; then
8592 echo "...using the old BSD 4.1c interface, rather than 4.2." >&4
8599 if test "X$d_socket" != "X$define"; then
8600 echo "or anywhere else I see." >&4
8608 : see if socketpair exists
8609 set socketpair d_sockpair
8614 echo "Checking the availability of certain socket constants..." >& 4
8615 for ENUM in MSG_CTRUNC MSG_DONTROUTE MSG_OOB MSG_PEEK MSG_PROXY SCM_RIGHTS; do
8616 enum=`$echo $ENUM|./tr '[A-Z]' '[a-z]'`
8618 #include <sys/types.h>
8619 #include <sys/socket.h>
8625 set try; if eval $compile; then
8628 set d_${enum}; eval $setvar
8632 : see if sys/select.h has to be included
8633 set sys/select.h i_sysselct
8636 : see if we should include time.h, sys/time.h, or both
8638 if test "X$timeincl" = X; then
8639 echo "Testing to see if we should include <time.h>, <sys/time.h> or both." >&4
8640 $echo $n "I'm now running the test program...$c"
8641 $cat >try.c <<'EOCP'
8642 #include <sys/types.h>
8647 #ifdef SYSTIMEKERNEL
8650 #include <sys/time.h>
8653 #include <sys/select.h>
8662 struct timezone tzp;
8664 if (foo.tm_sec == foo.tm_sec)
8667 if (bar.tv_sec == bar.tv_sec)
8674 for s_timezone in '-DS_TIMEZONE' ''; do
8676 for s_timeval in '-DS_TIMEVAL' ''; do
8677 for i_systimek in '' '-DSYSTIMEKERNEL'; do
8678 for i_time in '' '-DI_TIME'; do
8679 for i_systime in '-DI_SYSTIME' ''; do
8682 set try $i_time $i_systime $i_systimek $sysselect $s_timeval $s_timezone
8683 if eval $compile; then
8684 set X $i_time $i_systime $i_systimek $sysselect $s_timeval
8688 $echo $n "Succeeded with $flags$c"
8700 *SYSTIMEKERNEL*) i_systimek="$define"
8701 timeincl=`./findhdr sys/time.h`
8702 echo "We'll include <sys/time.h> with KERNEL defined." >&4;;
8703 *) i_systimek="$undef";;
8706 *I_TIME*) i_time="$define"
8707 timeincl=`./findhdr time.h`" $timeincl"
8708 echo "We'll include <time.h>." >&4;;
8709 *) i_time="$undef";;
8712 *I_SYSTIME*) i_systime="$define"
8713 timeincl=`./findhdr sys/time.h`" $timeincl"
8714 echo "We'll include <sys/time.h>." >&4;;
8715 *) i_systime="$undef";;
8720 : check for fd_set items
8723 Checking to see how well your C compiler handles fd_set and friends ...
8725 $cat >fd_set.c <<EOCP
8726 #$i_systime I_SYS_TIME
8727 #$i_sysselct I_SYS_SELECT
8728 #$d_socket HAS_SOCKET
8729 #include <sys/types.h>
8731 #include <sys/socket.h> /* Might include <sys/bsdtypes.h> */
8734 #include <sys/time.h>
8737 #include <sys/select.h>
8746 #if defined(FD_SET) && defined(FD_CLR) && defined(FD_ISSET) && defined(FD_ZERO)
8753 set fd_set -DTRYBITS
8754 if eval $compile; then
8755 d_fds_bits="$define"
8757 echo "Well, your system knows about the normal fd_set typedef..." >&4
8759 echo "and you have the normal fd_set macros (just as I'd expect)." >&4
8760 d_fd_macros="$define"
8763 but not the normal fd_set macros! Gaaack! I'll have to cover for you.
8765 d_fd_macros="$undef"
8769 Hmm, your compiler has some difficulty with fd_set. Checking further...
8772 if eval $compile; then
8775 echo "Well, your system has some sort of fd_set available..." >&4
8777 echo "and you have the normal fd_set macros." >&4
8778 d_fd_macros="$define"
8781 but not the normal fd_set macros! Gross! More work for me...
8783 d_fd_macros="$undef"
8786 echo "Well, you got zip. That's OK, I can roll my own fd_set stuff." >&4
8789 d_fd_macros="$undef"
8794 : see if fgetpos exists
8795 set fgetpos d_fgetpos
8798 : see if flock exists
8802 : see if fork exists
8806 : see if pathconf exists
8807 set pathconf d_pathconf
8810 : see if fpathconf exists
8811 set fpathconf d_fpathconf
8817 echo "Checking to see if your system supports off64_t..." >&4
8819 #include <sys/types.h>
8821 int main() { off64_t x = 7; }'
8824 if eval $compile; then
8826 echo "Yes, it does."
8829 echo "No, it doesn't."
8830 case "$lseeksize" in
8831 8) echo "(Your off_t is 64 bits, so you could use that.)" ;;
8838 : check for fpos64_t
8840 echo "Checking to see if your system supports fpos64_t..." >&4
8842 #include <sys/stdio.h>
8843 int main() { fpos64_t x x = 7; }'
8846 if eval $compile; then
8848 echo "Yes, it does."
8851 echo "No, it doesn't."
8853 8) echo "(Your fpos_t is 64 bits, so you could use that.)" ;;
8860 hasstruct='varname=$1; struct=$2; shift; shift;
8861 while $test $# -ge 2; do
8863 $define) echo "#include <$2>";;
8867 echo "int main () { struct $struct foo; }" >> try.c;
8869 if eval $compile; then
8878 : see if this is a sys/param system
8879 set sys/param.h i_sysparam
8882 : see if this is a sys/mount.h system
8883 set sys/mount.h i_sysmount
8886 : see if sys/types.h has to be included
8887 set sys/types.h i_systypes
8892 echo "Checking to see if your system supports struct fs_data..." >&4
8893 set d_fs_data_s fs_data $i_systypes sys/types.h $i_sysparam sys/param.h $i_sysmount sys/mount.h
8895 case "$d_fs_data_s" in
8896 "$define") echo "Yes, it does." ;;
8897 *) echo "No, it doesn't." ;;
8900 : see if fseeko exists
8904 8) echo "(Your long is 64 bits, so you could use fseek.)" ;;
8907 : see if fsetpos exists
8908 set fsetpos d_fsetpos
8912 : see if fstatfs exists
8913 set fstatfs d_fstatfs
8917 : see if statvfs exists
8918 set statvfs d_statvfs
8921 : see if fstatvfs exists
8922 set fstatvfs d_fstatvfs
8926 : see if ftello exists
8930 8) echo "(Your long is 64 bits, so you could use ftell.)" ;;
8933 : see if getgrent exists
8934 set getgrent d_getgrent
8937 : see if gethostbyaddr exists
8938 set gethostbyaddr d_gethbyaddr
8941 : see if gethostbyname exists
8942 set gethostbyname d_gethbyname
8945 : see if gethostent exists
8946 set gethostent d_gethent
8949 : see how we will look up host name
8952 if set gethostname val -f d_gethname; eval $csym; $val; then
8953 echo 'gethostname() found.' >&4
8954 d_gethname="$define"
8957 if set uname val -f d_uname; eval $csym; $val; then
8960 uname() was found, but you're running xenix, and older versions of xenix
8961 have a broken uname(). If you don't really know whether your xenix is old
8962 enough to have a broken system call, use the default answer.
8969 rp='Is your uname() broken?'
8972 n*) d_uname="$define"; call=uname;;
8975 echo 'uname() found.' >&4
8982 case "$d_gethname" in
8983 '') d_gethname="$undef";;
8986 '') d_uname="$undef";;
8988 case "$d_uname$d_gethname" in
8993 Every now and then someone has a $call() that lies about the hostname
8994 but can't be fixed for political or economic reasons. If you wish, I can
8995 pretend $call() isn't there and maybe compute hostname at run-time
8996 thanks to the '$phostname' command.
8999 rp="Shall I ignore $call() from now on?"
9002 y*) d_uname="$undef" d_gethname="$undef"; $echo $n "Okay...$c";;
9005 case "$phostname" in
9007 *) case "$aphostname" in
9013 file=`./loc $file $file $pth`
9014 aphostname=`echo $file $*`
9019 case "$d_uname$d_gethname" in
9022 case "$phostname" in
9024 echo "There will be no way for $package to get your hostname." >&4;;
9026 echo "I'll use 'popen("'"'$aphostname'", "r")'"' to get your hostname." >&4
9030 case "$d_phostname" in
9031 '') d_phostname="$undef";;
9034 : see if this is a netdb.h system
9038 : see if prototypes for various gethostxxx netdb.h functions are available
9040 set d_gethostprotos gethostent $i_netdb netdb.h
9043 : see if getlogin exists
9044 set getlogin d_getlogin
9047 : see if getmnt exists
9051 : see if getmntent exists
9052 set getmntent d_getmntent
9055 : see if getnetbyaddr exists
9056 set getnetbyaddr d_getnbyaddr
9059 : see if getnetbyname exists
9060 set getnetbyname d_getnbyname
9063 : see if getnetent exists
9064 set getnetent d_getnent
9067 : see if prototypes for various getnetxxx netdb.h functions are available
9069 set d_getnetprotos getnetent $i_netdb netdb.h
9073 : see if getprotobyname exists
9074 set getprotobyname d_getpbyname
9077 : see if getprotobynumber exists
9078 set getprotobynumber d_getpbynumber
9081 : see if getprotoent exists
9082 set getprotoent d_getpent
9085 : see if getpgid exists
9086 set getpgid d_getpgid
9089 : see if getpgrp2 exists
9090 set getpgrp2 d_getpgrp2
9093 : see if getppid exists
9094 set getppid d_getppid
9097 : see if getpriority exists
9098 set getpriority d_getprior
9101 : see if prototypes for various getprotoxxx netdb.h functions are available
9103 set d_getprotoprotos getprotoent $i_netdb netdb.h
9106 : see if getpwent exists
9107 set getpwent d_getpwent
9111 : see if getservbyname exists
9112 set getservbyname d_getsbyname
9115 : see if getservbyport exists
9116 set getservbyport d_getsbyport
9119 : see if getservent exists
9120 set getservent d_getsent
9123 : see if prototypes for various getservxxx netdb.h functions are available
9125 set d_getservprotos getservent $i_netdb netdb.h
9128 : see if getspent exists
9129 set getspent d_getspent
9132 : see if getspnam exists
9133 set getspnam d_getspnam
9136 : see if gettimeofday or ftime exists
9137 set gettimeofday d_gettimeod
9139 case "$d_gettimeod" in
9145 val="$undef"; set d_ftime; eval $setvar
9148 case "$d_gettimeod$d_ftime" in
9151 echo 'No ftime() nor gettimeofday() -- timing may be less accurate.' >&4
9155 : see if this is an grp system
9161 xxx=`./findhdr grp.h`
9162 $cppstdin $cppflags $cppminus < $xxx >$$.h
9164 if $contains 'gr_passwd' $$.h >/dev/null 2>&1; then
9176 set d_grpasswd; eval $setvar
9180 : see if hasmntopt exists
9181 set hasmntopt d_hasmntopt
9184 : see if this is a netinet/in.h or sys/in.h system
9185 set netinet/in.h i_niin sys/in.h i_sysin
9188 : see if arpa/inet.h has to be included
9189 set arpa/inet.h i_arpainet
9192 : see if htonl --and friends-- exists
9197 : Maybe they are macros.
9202 #include <sys/types.h>
9203 #$i_niin I_NETINET_IN
9205 #$i_arpainet I_ARPA_INET
9207 #include <netinet/in.h>
9213 #include <arpa/inet.h>
9216 printf("Defined as a macro.");
9219 $cppstdin $cppflags $cppminus < htonl.c >htonl.E 2>/dev/null
9220 if $contains 'Defined as a macro' htonl.E >/dev/null 2>&1; then
9222 echo "But it seems to be defined as a macro." >&4
9230 : see if iconv exists
9236 if set index val -f; eval $csym; $val; then
9237 if set strchr val -f d_strchr; eval $csym; $val; then
9238 if $contains strchr "$strings" >/dev/null 2>&1 ; then
9241 echo "strchr() found." >&4
9245 echo "index() found." >&4
9250 echo "index() found." >&4
9253 if set strchr val -f d_strchr; eval $csym; $val; then
9256 echo "strchr() found." >&4
9258 echo "No index() or strchr() found!" >&4
9263 set d_strchr; eval $setvar
9265 set d_index; eval $setvar
9267 : check whether inet_aton exists
9268 set inet_aton d_inetaton
9273 $cat >isascii.c <<'EOCP'
9285 if eval $compile; then
9286 echo "isascii() found." >&4
9289 echo "isascii() NOT found." >&4
9296 : see if killpg exists
9300 : see if lchown exists
9302 $cat > try.c <<'EOCP'
9303 /* System header to define __stub macros and hopefully few prototypes,
9304 which can conflict with char lchown(); below. */
9306 /* Override any gcc2 internal prototype to avoid an error. */
9307 /* We use char because int might match the return type of a gcc2
9308 builtin and then its argument prototype would still apply. */
9311 /* The GNU C library defines this for functions which it implements
9312 to always fail with ENOSYS. Some functions are actually named
9313 something starting with __ and the normal name is an alias. */
9314 #if defined (__stub_lchown) || defined (__stub___lchown)
9322 if eval $compile; then
9323 $echo "lchown() found." >&4
9326 $echo "lchown() NOT found." >&4
9332 : See if number of significant digits in a double precision number is known
9334 $cat >ldbl_dig.c <<EOM
9344 printf("Contains LDBL_DIG");
9347 $cppstdin $cppflags $cppminus < ldbl_dig.c >ldbl_dig.E 2>/dev/null
9348 if $contains 'LDBL_DIG' ldbl_dig.E >/dev/null 2>&1; then
9349 echo "LDBL_DIG found." >&4
9352 echo "LDBL_DIG NOT found." >&4
9359 : see if link exists
9363 : see if localeconv exists
9364 set localeconv d_locconv
9367 : see if lockf exists
9371 : check for long long
9373 $echo $n "Checking to see if your system supports long long..." $c >&4
9374 echo 'int main() { long long x = 7; return 0; }' > try.c
9376 if eval $compile; then
9378 echo " Yes, it does." >&4
9381 echo " No, it doesn't." >&4
9387 : check for length of long long
9388 case "${d_longlong}${longlongsize}" in
9391 $echo $n "Checking to see how big your long longs are..." $c >&4
9392 $cat >try.c <<'EOCP'
9396 printf("%d\n", (int)sizeof(long long));
9401 if eval $compile_ok; then
9402 longlongsize=`./try$exe_ext`
9403 $echo " $longlongsize bytes." >&4
9407 echo "(I can't seem to compile the test program. Guessing...)"
9408 rp="What is the size of a long long (in bytes)?"
9412 if $test "X$longsize" = "X$longlongsize"; then
9413 echo "(That isn't any different from an ordinary long.)"
9419 : see if lstat exists
9423 : see if mblen exists
9427 : see if mbstowcs exists
9428 set mbstowcs d_mbstowcs
9431 : see if mbtowc exists
9435 : see if memchr exists
9439 : see if memcmp exists
9443 : see if memcpy exists
9447 : see if memmove exists
9448 set memmove d_memmove
9451 : see if memset exists
9455 : see if mkdir exists
9459 : see if mkfifo exists
9463 : see if mktime exists
9467 : see if msgctl exists
9471 : see if msgget exists
9475 : see if msgsnd exists
9479 : see if msgrcv exists
9483 : see how much of the 'msg*(2)' library is present.
9486 case "$d_msgctl$d_msgget$d_msgsnd$d_msgrcv" in
9487 *"$undef"*) h_msg=false;;
9491 case "`ipcs 2>&1`" in
9492 "SVID messages"*"not configured"*)
9493 echo "Your $osname does not have the msg*(2) configured." >&4
9508 : we could also check for sys/ipc.h ...
9509 if $h_msg && $test `./findhdr sys/msg.h`; then
9510 echo "You have the full msg*(2) library." >&4
9513 echo "You don't have the full msg*(2) library." >&4
9519 : see if nice exists
9523 : see if inttypes.h is available
9524 : we want a real compile instead of Inhdr because some systems
9525 : have an inttypes.h which includes non-existent headers
9528 #include <inttypes.h>
9530 static int32_t foo32 = 0x12345678;
9534 if eval $compile; then
9535 echo "<inttypes.h> found." >&4
9538 echo "<inttypes.h> NOT found." >&4
9547 $echo $n "Checking to see if your system supports int64_t...$c" >&4
9549 #include <sys/types.h>
9550 #$i_inttypes I_INTTYPES
9552 #include <inttypes.h>
9554 int main() { int64_t x = 7; }
9557 if eval $compile; then
9559 echo " Yes, it does." >&4
9562 echo " No, it doesn't." >&4
9570 echo "Checking which 64-bit integer type we could use..." >&4
9576 val='"unsigned int"'
9581 *) case "$longsize" in
9585 val='"unsigned long"'
9590 *) case "$d_longlong:$longlongsize" in
9595 val='"unsigned long long"'
9600 *) case "$d_int64t" in
9619 '') case "$uselonglong:$d_longlong:$longlongsize" in
9621 echo "(You would have 'long long', but you are not using it.)" >&4 ;;
9622 *) echo "Alas, no 64-bit integer types in sight." >&4 ;;
9626 *) if test X"$use64bits" = Xdefine -o X"$longsize" = X8; then
9631 echo "We $verb use '$quadtype' for 64-bit integers." >&4
9636 : check for length of character
9640 echo "Checking to see how big your characters are (hey, you never know)..." >&4
9641 $cat >try.c <<'EOCP'
9645 printf("%d\n", (int)sizeof(char));
9650 if eval $compile_ok; then
9654 echo "(I can't seem to compile the test program. Guessing...)"
9661 rp="What is the size of a character (in bytes)?"
9668 $echo "Choosing the C types to be used for Perl's internal types..." >&4
9670 case "$use64bits:$d_quad:$quadtype" in
9678 uvtype="unsigned long"
9684 case "$uselongdouble:$d_longdbl" in
9686 nvtype="long double"
9694 $echo "(IV will be "$ivtype", $ivsize bytes)"
9695 $echo "(UV will be "$uvtype", $uvsize bytes)"
9696 $echo "(NV will be "$nvtype", $nvsize bytes)"
9699 #$i_inttypes I_INTTYPES
9701 #include <inttypes.h>
9706 int8_t i = INT8_MAX;
9707 uint8_t u = UINT8_MAX;
9711 int16_t i = INT16_MAX;
9712 uint16_t i = UINT16_MAX;
9713 printf("int16_t\n");
9716 int32_t i = INT32_MAX;
9717 uint32_t u = UINT32_MAX;
9718 printf("int32_t\n");
9724 '') case "$charsize" in
9726 u8type="unsigned char"
9735 if eval $compile; then
9736 case "`./try$exe_ext`" in
9737 int8_t) i8type=int8_t
9747 '') if $test $charsize -ge 1; then
9749 u8type="unsigned char"
9757 '') case "$shortsize" in
9759 u16type="unsigned short"
9768 if eval $compile; then
9769 case "`./try$exe_ext`" in
9781 '') if $test $shortsize -ge 2; then
9783 u16type="unsigned short"
9791 '') case "$longsize" in
9793 u32type="unsigned long"
9797 *) case "$intsize" in
9799 u32type="unsigned int"
9810 if eval $compile; then
9811 case "`./try$exe_ext`" in
9823 '') if $test $intsize -ge 4; then
9825 u32type="unsigned int"
9833 '') case "$d_quad:$quadtype" in
9836 u64type="$uquadtype"
9844 $echo "Checking whether your NVs can preserve your UVs..." >&4
9848 $uvtype k = ($uvtype)~0, l;
9854 printf("preserve\n");
9859 if eval $compile; then
9860 case "`./try$exe_ext`" in
9861 preserve) d_nv_preserves_uv="$define" ;;
9864 case "$d_nv_preserves_uv" in
9865 $define) $echo "Yes, they can." 2>&1 ;;
9866 *) $echo "No, they can't." 2>&1
9867 d_nv_preserves_uv="$undef"
9873 : see if POSIX threads are available
9874 set pthread.h i_pthread
9880 : how to create joinable pthreads
9881 if test "X$usethreads" = "X$define" -a "X$i_pthread" = "X$define"; then
9883 echo "Checking what constant to use for creating joinable pthreads..." >&4
9884 $cat >try.c <<'EOCP'
9885 #include <pthread.h>
9887 int detachstate = JOINABLE;
9890 set try -DJOINABLE=PTHREAD_CREATE_JOINABLE
9891 if eval $compile; then
9892 echo "You seem to use PTHREAD_CREATE_JOINABLE." >&4
9893 val="$undef" # Yes, undef.
9894 set d_old_pthread_create_joinable
9897 set old_pthread_create_joinable
9900 set try -DJOINABLE=PTHREAD_CREATE_UNDETACHED
9901 if eval $compile; then
9902 echo "You seem to use PTHREAD_CREATE_UNDETACHED." >&4
9904 set d_old_pthread_create_joinable
9906 val=PTHREAD_CREATE_UNDETACHED
9907 set old_pthread_create_joinable
9910 set try -DJOINABLE=__UNDETACHED
9911 if eval $compile; then
9912 echo "You seem to use __UNDETACHED." >&4
9914 set d_old_pthread_create_joinable
9917 set old_pthread_create_joinable
9920 echo "Egads, nothing obvious found. Guessing that you use 0." >&4
9922 set d_old_pthread_create_joinable
9925 set old_pthread_create_joinable
9932 d_old_pthread_create_joinable="$undef"
9933 old_pthread_create_joinable=""
9936 : see if pause exists
9940 : see if pipe exists
9944 : see if poll exists
9949 : see whether the various POSIXish _yields exist
9951 #include <pthread.h>
9957 #ifdef PTHREAD_YIELD
9960 #ifdef PTHREAD_YIELD_NULL
9961 pthread_yield(NULL);
9967 : see if sched_yield exists
9968 set try -DSCHED_YIELD
9969 if eval $compile; then
9971 sched_yield='sched_yield()'
9975 case "$usethreads" in
9978 $define) echo 'sched_yield() found.' >&4 ;;
9979 *) echo 'sched_yield() NOT found.' >&4 ;;
9985 : see if pthread_yield exists
9986 set try -DPTHREAD_YIELD
9987 if eval $compile; then
9989 case "$sched_yield" in
9990 '') sched_yield='pthread_yield()' ;;
9993 set try -DPTHREAD_YIELD_NULL
9994 if eval $compile; then
9996 case "$sched_yield" in
9997 '') sched_yield='pthread_yield(NULL)' ;;
10003 case "$usethreads" in
10006 $define) echo 'pthread_yield() found.' >&4 ;;
10007 *) echo 'pthread_yield() NOT found.' >&4 ;;
10011 set d_pthread_yield
10014 case "$sched_yield" in
10015 '') sched_yield=undef ;;
10020 : see if this is a pwd.h system
10026 xxx=`./findhdr pwd.h`
10027 $cppstdin $cppflags $cppminus < $xxx >$$.h
10029 if $contains 'pw_quota' $$.h >/dev/null 2>&1; then
10037 if $contains 'pw_age' $$.h >/dev/null 2>&1; then
10045 if $contains 'pw_change' $$.h >/dev/null 2>&1; then
10053 if $contains 'pw_class' $$.h >/dev/null 2>&1; then
10061 if $contains 'pw_expire' $$.h >/dev/null 2>&1; then
10069 if $contains 'pw_comment' $$.h >/dev/null 2>&1; then
10077 if $contains 'pw_gecos' $$.h >/dev/null 2>&1; then
10085 if $contains 'pw_passwd' $$.h >/dev/null 2>&1; then
10097 set d_pwquota; eval $setvar
10098 set d_pwage; eval $setvar
10099 set d_pwchange; eval $setvar
10100 set d_pwclass; eval $setvar
10101 set d_pwexpire; eval $setvar
10102 set d_pwcomment; eval $setvar
10103 set d_pwgecos; eval $setvar
10104 set d_pwpasswd; eval $setvar
10108 : see if readdir and friends exist
10109 set readdir d_readdir
10111 set seekdir d_seekdir
10113 set telldir d_telldir
10115 set rewinddir d_rewinddir
10118 : see if readlink exists
10119 set readlink d_readlink
10122 : see if rename exists
10123 set rename d_rename
10126 : see if rmdir exists
10130 : see if memory.h is available.
10135 : See if it conflicts with string.h
10141 $cppstdin $cppflags $cppminus < $strings > mem.h
10142 if $contains 'memcpy' mem.h >/dev/null 2>&1; then
10144 echo "We won't be including <memory.h>."
10154 : can bcopy handle overlapping blocks?
10159 echo "Checking to see if your bcopy() can do overlapping copies..." >&4
10161 #$i_memory I_MEMORY
10162 #$i_stdlib I_STDLIB
10163 #$i_string I_STRING
10164 #$i_unistd I_UNISTD
10166 $cat >>try.c <<'EOCP'
10169 # include <memory.h>
10172 # include <stdlib.h>
10175 # include <string.h>
10177 # include <strings.h>
10180 # include <unistd.h> /* Needed for NetBSD */
10184 char buf[128], abc[128];
10190 bcopy("abcdefghijklmnopqrstuvwxyz0123456789", abc, 36);
10192 for (align = 7; align >= 0; align--) {
10193 for (len = 36; len; len--) {
10195 bcopy(abc, b, len);
10196 for (off = 1; off <= len; off++) {
10197 bcopy(b, b+off, len);
10198 bcopy(b+off, b, len);
10199 if (bcmp(b, abc, len))
10208 if eval $compile_ok; then
10209 if ./try 2>/dev/null; then
10210 echo "Yes, it can."
10213 echo "It can't, sorry."
10214 case "$d_memmove" in
10215 "$define") echo "But that's Ok since you have memmove()." ;;
10219 echo "(I can't compile the test program, so we'll assume not...)"
10220 case "$d_memmove" in
10221 "$define") echo "But that's Ok since you have memmove()." ;;
10226 $rm -f try.* try core
10230 : can memcpy handle overlapping blocks?
10232 case "$d_memcpy" in
10235 echo "Checking to see if your memcpy() can do overlapping copies..." >&4
10237 #$i_memory I_MEMORY
10238 #$i_stdlib I_STDLIB
10239 #$i_string I_STRING
10240 #$i_unistd I_UNISTD
10242 $cat >>try.c <<'EOCP'
10245 # include <memory.h>
10248 # include <stdlib.h>
10251 # include <string.h>
10253 # include <strings.h>
10256 # include <unistd.h> /* Needed for NetBSD */
10260 char buf[128], abc[128];
10266 /* Copy "abcde..." string to char abc[] so that gcc doesn't
10267 try to store the string in read-only memory. */
10268 memcpy(abc, "abcdefghijklmnopqrstuvwxyz0123456789", 36);
10270 for (align = 7; align >= 0; align--) {
10271 for (len = 36; len; len--) {
10273 memcpy(b, abc, len);
10274 for (off = 1; off <= len; off++) {
10275 memcpy(b+off, b, len);
10276 memcpy(b, b+off, len);
10277 if (memcmp(b, abc, len))
10286 if eval $compile_ok; then
10287 if ./try 2>/dev/null; then
10288 echo "Yes, it can."
10291 echo "It can't, sorry."
10292 case "$d_memmove" in
10293 "$define") echo "But that's Ok since you have memmove()." ;;
10297 echo "(I can't compile the test program, so we'll assume not...)"
10298 case "$d_memmove" in
10299 "$define") echo "But that's Ok since you have memmove()." ;;
10304 $rm -f try.* try core
10308 : can memcmp be trusted to compare relative magnitude?
10310 case "$d_memcmp" in
10313 echo "Checking if your memcmp() can compare relative magnitude..." >&4
10315 #$i_memory I_MEMORY
10316 #$i_stdlib I_STDLIB
10317 #$i_string I_STRING
10318 #$i_unistd I_UNISTD
10320 $cat >>try.c <<'EOCP'
10323 # include <memory.h>
10326 # include <stdlib.h>
10329 # include <string.h>
10331 # include <strings.h>
10334 # include <unistd.h> /* Needed for NetBSD */
10340 if ((a < b) && memcmp(&a, &b, 1) < 0)
10346 if eval $compile_ok; then
10347 if ./try 2>/dev/null; then
10348 echo "Yes, it can."
10351 echo "No, it can't (it uses signed chars)."
10354 echo "(I can't compile the test program, so we'll assume not...)"
10358 $rm -f try.* try core
10362 : see if select exists
10363 set select d_select
10366 : see if semctl exists
10367 set semctl d_semctl
10370 : see if semget exists
10371 set semget d_semget
10374 : see if semop exists
10378 : see how much of the 'sem*(2)' library is present.
10381 case "$d_semctl$d_semget$d_semop" in
10382 *"$undef"*) h_sem=false;;
10386 case "`ipcs 2>&1`" in
10387 "SVID messages"*"not configured"*)
10388 echo "Your $osname does not have the sem*(2) configured." >&4
10391 set semctl d_semctl
10393 set semget d_semget
10401 : we could also check for sys/ipc.h ...
10402 if $h_sem && $test `./findhdr sys/sem.h`; then
10403 echo "You have the full sem*(2) library." >&4
10406 echo "You don't have the full sem*(2) library." >&4
10412 : see whether sys/sem.h defines union semun
10414 $cat > try.c <<'END'
10415 #include <sys/types.h>
10416 #include <sys/ipc.h>
10417 #include <sys/sem.h>
10418 int main () { union semun semun; semun.buf = 0; }
10421 if eval $compile; then
10422 echo "You have union semun in <sys/sem.h>." >&4
10425 echo "You do not have union semun in <sys/sem.h>." >&4
10428 $rm -f try try.c try.h
10432 : see how to do semctl IPC_STAT
10435 : see whether semctl IPC_STAT can use union semun
10440 # define S_IRUSR S_IREAD
10441 # define S_IWUSR S_IWRITE
10442 # define S_IXUSR S_IEXEC
10444 # define S_IRUSR 0400
10445 # define S_IWUSR 0200
10446 # define S_IXUSR 0100
10448 # define S_IRGRP (S_IRUSR>>3)
10449 # define S_IWGRP (S_IWUSR>>3)
10450 # define S_IXGRP (S_IXUSR>>3)
10451 # define S_IROTH (S_IRUSR>>6)
10452 # define S_IWOTH (S_IWUSR>>6)
10453 # define S_IXOTH (S_IXUSR>>6)
10456 # define S_IRWXU (S_IRUSR|S_IWUSR|S_IXUSR)
10457 # define S_IRWXG (S_IRGRP|S_IWGRP|S_IXGRP)
10458 # define S_IRWXO (S_IROTH|S_IWOTH|S_IXOTH)
10463 #include <sys/types.h>
10464 #include <sys/ipc.h>
10465 #include <sys/sem.h>
10466 #include <sys/stat.h>
10473 #$d_union_semun HAS_UNION_SEMUN
10476 #ifndef HAS_UNION_SEMUN
10479 struct semid_ds *buf;
10480 unsigned short *array;
10486 #if defined(IPC_PRIVATE) && defined(S_IRWXU) && defined(S_IRWXG) && defined(S_IRWXO) && defined(IPC_CREAT)
10487 sem = semget(IPC_PRIVATE, 1, S_IRWXU|S_IRWXG|S_IRWXO|IPC_CREAT);
10489 struct semid_ds argbuf;
10492 st = semctl(sem, 0, IPC_STAT, arg);
10496 # endif /* IPC_STAT */
10497 printf("semctl IPC_STAT failed: errno = %d\n", errno);
10499 if (semctl(sem, 0, IPC_RMID, arg) != 0)
10500 # endif /* IPC_RMID */
10501 printf("semctl IPC_RMID failed: errno = %d\n", errno);
10503 #endif /* IPC_PRIVATE && ... */
10504 printf("semget failed: errno = %d\n", errno);
10510 if eval $compile; then
10513 semun) val="$define" ;;
10519 case "$d_semctl_semun" in
10521 echo "You can use union semun for semctl IPC_STAT." >&4
10524 *) echo "You cannot use union semun for semctl IPC_STAT." >&4
10529 : see whether semctl IPC_STAT can use struct semid_ds pointer
10530 $cat > try.c <<'END'
10531 #include <sys/types.h>
10532 #include <sys/ipc.h>
10533 #include <sys/sem.h>
10534 #include <sys/stat.h>
10542 struct semid_ds arg;
10545 #if defined(IPC_PRIVATE) && defined(S_IRWXU) && defined(S_IRWXG) && defined(S_IRWXO) && defined(IPC_CREAT)
10546 sem = semget(IPC_PRIVATE, 1, S_IRWXU|S_IRWXG|S_IRWXO|IPC_CREAT);
10549 st = semctl(sem, 0, IPC_STAT, &arg);
10551 printf("semid_ds\n");
10553 # endif /* IPC_STAT */
10554 printf("semctl IPC_STAT failed: errno = %d\n", errno);
10556 if (semctl(sem, 0, IPC_RMID, &arg) != 0)
10557 # endif /* IPC_RMID */
10558 printf("semctl IPC_RMID failed: errno = %d\n", errno);
10560 #endif /* IPC_PRIVATE && ... */
10561 printf("semget failed: errno = %d\n", errno);
10568 if eval $compile; then
10571 semid_ds) val="$define" ;;
10575 set d_semctl_semid_ds
10577 case "$d_semctl_semid_ds" in
10579 echo "You can $also use struct semid_ds* for semctl IPC_STAT." >&4
10581 *) echo "You cannot use struct semid_ds* for semctl IPC_STAT." >&4
10588 # We do not have the full sem*(2) library, so assume we can not
10594 set d_semctl_semid_ds
10599 : see if setegid exists
10600 set setegid d_setegid
10603 : see if seteuid exists
10604 set seteuid d_seteuid
10607 : see if setgrent exists
10608 set setgrent d_setgrent
10611 : see if sethostent exists
10612 set sethostent d_sethent
10615 : see if setlinebuf exists
10616 set setlinebuf d_setlinebuf
10619 : see if setlocale exists
10620 set setlocale d_setlocale
10623 : see if setnetent exists
10624 set setnetent d_setnent
10627 : see if setprotoent exists
10628 set setprotoent d_setpent
10631 : see if setpgid exists
10632 set setpgid d_setpgid
10635 : see if setpgrp2 exists
10636 set setpgrp2 d_setpgrp2
10639 : see if setpriority exists
10640 set setpriority d_setprior
10643 : see if setpwent exists
10644 set setpwent d_setpwent
10647 : see if setregid exists
10648 set setregid d_setregid
10650 set setresgid d_setresgid
10653 : see if setreuid exists
10654 set setreuid d_setreuid
10656 set setresuid d_setresuid
10659 : see if setrgid exists
10660 set setrgid d_setrgid
10663 : see if setruid exists
10664 set setruid d_setruid
10667 : see if setservent exists
10668 set setservent d_setsent
10671 : see if setsid exists
10672 set setsid d_setsid
10675 : see if setspent exists
10676 set setspent d_setspent
10679 : see if setvbuf exists
10680 set setvbuf d_setvbuf
10683 : see if sfio.h is available
10688 : see if sfio library is available
10699 : Ok, but do we want to use it.
10703 true|$define|[yY]*) dflt='y';;
10706 echo "$package can use the sfio library, but it is experimental."
10707 rp="You seem to have sfio available, do you want to try using it?"
10711 *) echo "Ok, avoiding sfio this time. I'll use stdio instead."
10713 : Remove sfio from list of libraries to use
10714 set `echo X $libs | $sed -e 's/-lsfio / /' -e 's/-lsfio$//'`
10717 echo "libs = $libs" >&4
10721 *) case "$usesfio" in
10722 true|$define|[yY]*)
10723 echo "Sorry, cannot find sfio on this machine" >&4
10724 echo "Ignoring your setting of usesfio=$usesfio" >&4
10732 $define) usesfio='true';;
10733 *) usesfio='false';;
10736 : see if shmctl exists
10737 set shmctl d_shmctl
10740 : see if shmget exists
10741 set shmget d_shmget
10744 : see if shmat exists
10747 : see what shmat returns
10750 $cat >shmat.c <<'END'
10751 #include <sys/shm.h>
10754 if $cc $ccflags -c shmat.c >/dev/null 2>&1; then
10759 echo "and it returns ($shmattype)." >&4
10760 : see if a prototype for shmat is available
10761 xxx=`./findhdr sys/shm.h`
10762 $cppstdin $cppflags $cppminus < $xxx > shmat.c 2>/dev/null
10763 if $contains 'shmat.*(' shmat.c >/dev/null 2>&1; then
10774 set d_shmatprototype
10777 : see if shmdt exists
10781 : see how much of the 'shm*(2)' library is present.
10784 case "$d_shmctl$d_shmget$d_shmat$d_shmdt" in
10785 *"$undef"*) h_shm=false;;
10789 case "`ipcs 2>&1`" in
10790 "SVID shared memory"*"not configured"*)
10791 echo "Your $osname does not have the shm*(2) configured." >&4
10794 set shmctl d_shmctl
10796 set shmget d_shmget
10806 : we could also check for sys/ipc.h ...
10807 if $h_shm && $test `./findhdr sys/shm.h`; then
10808 echo "You have the full shm*(2) library." >&4
10811 echo "You don't have the full shm*(2) library." >&4
10818 : see if we have sigaction
10819 if set sigaction val -f d_sigaction; eval $csym; $val; then
10820 echo 'sigaction() found.' >&4
10821 $cat > try.c <<'EOP'
10823 #include <sys/types.h>
10824 #include <signal.h>
10827 struct sigaction act, oact;
10829 oact.sa_handler = 0;
10830 /* so that act and oact are used */
10831 exit(act.sa_flags == 0 && oact.sa_handler == 0);
10835 if eval $compile_ok; then
10838 echo "But you don't seem to have a useable struct sigaction." >&4
10842 echo 'sigaction NOT found.' >&4
10845 set d_sigaction; eval $setvar
10846 $rm -f try try$_o try.c
10848 : see if sigsetjmp exists
10850 case "$d_sigsetjmp" in
10852 $cat >try.c <<'EOP'
10853 #include <setjmp.h>
10858 if (sigsetjmp(env,1))
10861 siglongjmp(env, 1);
10866 if eval $compile; then
10867 if ./try >/dev/null 2>&1; then
10868 echo "POSIX sigsetjmp found." >&4
10872 Uh-Oh! You have POSIX sigsetjmp and siglongjmp, but they do not work properly!!
10878 echo "sigsetjmp not found." >&4
10882 *) val="$d_sigsetjmp"
10883 case "$d_sigsetjmp" in
10884 $define) echo "POSIX sigsetjmp found." >&4;;
10885 $undef) echo "sigsetjmp not found." >&4;;
10893 : see if sys/stat.h is available
10894 set sys/stat.h i_sysstat
10898 : see if stat knows about block sizes
10900 echo "Checking to see if your struct stat has st_blocks field..." >&4
10901 set d_statblks stat st_blocks $i_sysstat sys/stat.h
10905 : see if this is a sys/vfs.h system
10906 set sys/vfs.h i_sysvfs
10910 : see if this is a sys/statfs.h system
10911 set sys/statfs.h i_sysstatfs
10916 echo "Checking to see if your system supports struct statfs..." >&4
10917 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
10919 case "$d_statfs_s" in
10920 "$define") echo "Yes, it does." ;;
10921 *) echo "No, it doesn't." ;;
10926 : see if struct statfs knows about f_flags
10927 case "$d_statfs_s" in
10930 echo "Checking to see if your struct statfs has f_flags field..." >&4
10931 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
10935 set d_statfs_f_flags
10939 case "$d_statfs_f_flags" in
10940 "$define") echo "Yes, it does." ;;
10941 *) echo "No, it doesn't." ;;
10944 : see if _ptr and _cnt from stdio act std
10946 if $contains '_IO_fpos_t' `./findhdr stdio.h` `./findhdr libio.h` >/dev/null 2>&1 ; then
10947 echo "(Looks like you have stdio.h from Linux.)"
10948 case "$stdio_ptr" in
10949 '') stdio_ptr='((fp)->_IO_read_ptr)'
10952 *) ptr_lval=$d_stdio_ptr_lval;;
10954 case "$stdio_cnt" in
10955 '') stdio_cnt='((fp)->_IO_read_end - (fp)->_IO_read_ptr)'
10958 *) cnt_lval=$d_stdio_cnt_lval;;
10960 case "$stdio_base" in
10961 '') stdio_base='((fp)->_IO_read_base)';;
10963 case "$stdio_bufsiz" in
10964 '') stdio_bufsiz='((fp)->_IO_read_end - (fp)->_IO_read_base)';;
10967 case "$stdio_ptr" in
10968 '') stdio_ptr='((fp)->_ptr)'
10971 *) ptr_lval=$d_stdio_ptr_lval;;
10973 case "$stdio_cnt" in
10974 '') stdio_cnt='((fp)->_cnt)'
10977 *) cnt_lval=$d_stdio_cnt_lval;;
10979 case "$stdio_base" in
10980 '') stdio_base='((fp)->_base)';;
10982 case "$stdio_bufsiz" in
10983 '') stdio_bufsiz='((fp)->_cnt + (fp)->_ptr - (fp)->_base)';;
10986 : test whether _ptr and _cnt really work
10987 echo "Checking how std your stdio is..." >&4
10990 #define FILE_ptr(fp) $stdio_ptr
10991 #define FILE_cnt(fp) $stdio_cnt
10993 FILE *fp = fopen("try.c", "r");
10996 18 <= FILE_cnt(fp) &&
10997 strncmp(FILE_ptr(fp), "include <stdio.h>\n", 18) == 0
11005 if eval $compile; then
11007 echo "Your stdio acts pretty std."
11010 echo "Your stdio isn't very std."
11013 echo "Your stdio doesn't appear very std."
11019 : Can _ptr be used as an lvalue?
11020 case "$d_stdstdio$ptr_lval" in
11021 $define$define) val=$define ;;
11024 set d_stdio_ptr_lval
11027 : Can _cnt be used as an lvalue?
11028 case "$d_stdstdio$cnt_lval" in
11029 $define$define) val=$define ;;
11032 set d_stdio_cnt_lval
11035 : see if _base is also standard
11037 case "$d_stdstdio" in
11041 #define FILE_base(fp) $stdio_base
11042 #define FILE_bufsiz(fp) $stdio_bufsiz
11044 FILE *fp = fopen("try.c", "r");
11047 19 <= FILE_bufsiz(fp) &&
11048 strncmp(FILE_base(fp), "#include <stdio.h>\n", 19) == 0
11055 if eval $compile; then
11057 echo "And its _base field acts std."
11060 echo "But its _base field isn't std."
11063 echo "However, it seems to be lacking the _base field."
11072 Checking how to access stdio streams by file descriptor number...
11074 case "$stdio_stream_array" in
11075 '') $cat >try.c <<EOCP
11078 if (&STDIO_STREAM_ARRAY[fileno(stdin)] == stdin)
11082 for s in _iob __iob __sF
11084 set try -DSTDIO_STREAM_ARRAY=$s
11085 if eval $compile; then
11086 case "`./try$exe_ext`" in
11087 yes) stdio_stream_array=$s; break ;;
11091 $rm -f try.* try$exe_ext
11093 case "$stdio_stream_array" in
11095 I can't figure out how to access stdio streams by file descriptor number.
11097 d_stdio_stream_array="$undef"
11100 You can access stdio streams by file descriptor number by the $stdio_stream_array array.
11102 d_stdio_stream_array="$define"
11106 : see if strcoll exists
11107 set strcoll d_strcoll
11110 : check for structure copying
11112 echo "Checking to see if your C compiler can copy structs..." >&4
11113 $cat >try.c <<'EOCP'
11123 if $cc -c try.c >/dev/null 2>&1 ; then
11125 echo "Yup, it can."
11128 echo "Nope, it can't."
11134 : see if strerror and/or sys_errlist[] exist
11136 if test "X$d_strerror" = X -o "X$d_syserrlst" = X; then
11137 if set strerror val -f d_strerror; eval $csym; $val; then
11138 echo 'strerror() found.' >&4
11139 d_strerror="$define"
11140 d_strerrm='strerror(e)'
11141 if set sys_errlist val -a d_syserrlst; eval $csym; $val; then
11142 echo "(You also have sys_errlist[], so we could roll our own strerror.)"
11143 d_syserrlst="$define"
11145 echo "(Since you don't have sys_errlist[], sterror() is welcome.)"
11146 d_syserrlst="$undef"
11148 elif xxx=`./findhdr string.h`; test "$xxx" || xxx=`./findhdr strings.h`; \
11149 $contains '#[ ]*define.*strerror' "$xxx" >/dev/null 2>&1; then
11150 echo 'strerror() found in string header.' >&4
11151 d_strerror="$define"
11152 d_strerrm='strerror(e)'
11153 if set sys_errlist val -a d_syserrlst; eval $csym; $val; then
11154 echo "(Most probably, strerror() uses sys_errlist[] for descriptions.)"
11155 d_syserrlst="$define"
11157 echo "(You don't appear to have any sys_errlist[], how can this be?)"
11158 d_syserrlst="$undef"
11160 elif set sys_errlist val -a d_syserrlst; eval $csym; $val; then
11161 echo "strerror() not found, but you have sys_errlist[] so we'll use that." >&4
11162 d_strerror="$undef"
11163 d_syserrlst="$define"
11164 d_strerrm='((e)<0||(e)>=sys_nerr?"unknown":sys_errlist[e])'
11166 echo 'strerror() and sys_errlist[] NOT found.' >&4
11167 d_strerror="$undef"
11168 d_syserrlst="$undef"
11169 d_strerrm='"unknown"'
11173 : see if strtod exists
11174 set strtod d_strtod
11177 : see if strtol exists
11178 set strtol d_strtol
11181 : see if strtold exists
11182 set strtold d_strtold
11185 : see if strtoll exists
11186 set strtoll d_strtoll
11189 : see if strtoul exists
11190 set strtoul d_strtoul
11193 : see if strtoull exists
11194 set strtoull d_strtoull
11197 : see if strtouq exists
11198 set strtouq d_strtouq
11201 : see if strxfrm exists
11202 set strxfrm d_strxfrm
11205 : see if symlink exists
11206 set symlink d_symlink
11209 : see if syscall exists
11210 set syscall d_syscall
11213 : see if sysconf exists
11214 set sysconf d_sysconf
11217 : see if system exists
11218 set system d_system
11221 : see if tcgetpgrp exists
11222 set tcgetpgrp d_tcgetpgrp
11225 : see if tcsetpgrp exists
11226 set tcsetpgrp d_tcsetpgrp
11229 : see if prototype for telldir is available
11231 set d_telldirproto telldir $i_systypes sys/types.h $i_dirent dirent.h
11234 : see if this is a sys/times.h system
11235 set sys/times.h i_systimes
11238 : see if times exists
11240 if set times val -f d_times; eval $csym; $val; then
11241 echo 'times() found.' >&4
11244 case "$i_systimes" in
11245 "$define") inc='sys/times.h';;
11247 rp="What is the type returned by times() on this system?"
11248 set clock_t clocktype long stdio.h sys/types.h $inc
11251 echo 'times() NOT found, hope that will do.' >&4
11256 : see if truncate exists
11257 set truncate d_truncate
11260 : see if tzname[] exists
11262 if set tzname val -a d_tzname; eval $csym; $val; then
11264 echo 'tzname[] found.' >&4
11267 echo 'tzname[] NOT found.' >&4
11272 : see if umask exists
11276 : see if ustat exists
11280 : backward compatibility for d_hvfork
11281 if test X$d_hvfork != X; then
11282 d_vfork="$d_hvfork"
11285 : see if there is a vfork
11290 : Ok, but do we want to use it. vfork is reportedly unreliable in
11291 : perl on Solaris 2.x, and probably elsewhere.
11295 case "$usevfork" in
11301 Perl can only use a vfork() that doesn't suffer from strict
11302 restrictions on calling functions or modifying global data in
11303 the child. For example, glibc-2.1 contains such a vfork()
11304 that is unsuitable. If your system provides a proper fork()
11305 call, chances are that you do NOT want perl to use vfork().
11308 rp="Do you still want to use vfork()?"
11313 echo "Ok, we won't use vfork()."
11322 $define) usevfork='true';;
11323 *) usevfork='false';;
11326 : see if this is an sysdir system
11327 set sys/dir.h i_sysdir
11330 : see if this is an sysndir system
11331 set sys/ndir.h i_sysndir
11334 : see if closedir exists
11335 set closedir d_closedir
11338 case "$d_closedir" in
11341 echo "Checking whether closedir() returns a status..." >&4
11342 cat > closedir.c <<EOM
11343 #$i_dirent I_DIRENT /**/
11344 #$i_sysdir I_SYS_DIR /**/
11345 #$i_sysndir I_SYS_NDIR /**/
11346 #$i_systypes I_SYS_TYPES /**/
11348 #if defined(I_SYS_TYPES)
11349 #include <sys/types.h>
11351 #if defined(I_DIRENT)
11352 #include <dirent.h>
11353 #if defined(NeXT) && defined(I_SYS_DIR) /* NeXT needs dirent + sys/dir.h */
11354 #include <sys/dir.h>
11358 #include <sys/ndir.h>
11362 #include <ndir.h> /* may be wrong in the future */
11364 #include <sys/dir.h>
11369 int main() { return closedir(opendir(".")); }
11372 if eval $compile_ok; then
11373 if ./closedir > /dev/null 2>&1 ; then
11374 echo "Yes, it does."
11377 echo "No, it doesn't."
11381 echo "(I can't seem to compile the test program--assuming it doesn't)"
11389 set d_void_closedir
11392 : check for volatile keyword
11394 echo 'Checking to see if your C compiler knows about "volatile"...' >&4
11395 $cat >try.c <<'EOCP'
11398 typedef struct _goo_struct goo_struct;
11399 goo_struct * volatile goo = ((goo_struct *)0);
11400 struct _goo_struct {
11405 typedef unsigned short foo_t;
11406 char *volatile foo;
11408 volatile foo_t blech;
11412 if $cc -c $ccflags try.c >/dev/null 2>&1 ; then
11414 echo "Yup, it does."
11417 echo "Nope, it doesn't."
11423 : see if there is a wait4
11427 : see if waitpid exists
11428 set waitpid d_waitpid
11431 : see if wcstombs exists
11432 set wcstombs d_wcstombs
11435 : see if wctomb exists
11436 set wctomb d_wctomb
11439 : preserve RCS keywords in files with variable substitution, grrr
11444 Revision='$Revision'
11446 case "$crosscompile" in
11447 ''|[nN]*) crosscompile="$undef" ;;
11451 next|rhapsody) multiarch="$define" ;;
11453 case "$multiarch" in
11454 ''|[nN]*) multiarch="$undef" ;;
11457 : check for alignment requirements
11459 case "$crosscompile$multiarch" in
11462 You seem to be either cross-compiling or doing a multiarchitecture build,
11463 skipping the memory alignment check.
11466 case "$alignbytes" in
11467 '') alignbytes=8 ;;
11471 case "$alignbytes" in
11472 '') echo "Checking alignment constraints..." >&4
11473 $cat >try.c <<'EOCP'
11481 printf("%d\n", (int)((char *)&try_algn.bar - (char *)&try_algn.foo));
11486 if eval $compile_ok; then
11490 echo "(I can't seem to compile the test program...)"
11493 *) dflt="$alignbytes"
11496 rp="Doubles must be aligned on a how-many-byte boundary?"
11504 : check for ordering of bytes in a long
11506 case "$crosscompile$multiarch" in
11509 You seem to be either cross-compiling or doing a multiarchitecture build,
11510 skipping the byteorder check.
11516 case "$byteorder" in
11519 In the following, larger digits indicate more significance. A big-endian
11520 machine like a Pyramid or a Motorola 680?0 chip will come out to 4321. A
11521 little-endian machine like a Vax or an Intel 80?86 chip would be 1234. Other
11522 machines may have weird orders like 3412. A Cray will report 87654321,
11523 an Alpha will report 12345678. If the test program works the default is
11525 I'm now running the test program...
11527 $cat >try.c <<'EOCP'
11534 char c[sizeof(long)];
11537 if (sizeof(long) > 4)
11538 u.l = (0x08070605L << 32) | 0x04030201L;
11541 for (i = 0; i < sizeof(long); i++)
11542 printf("%c", u.c[i]+'0');
11549 if eval $compile && ./try > /dev/null; then
11552 [1-4][1-4][1-4][1-4]|12345678|87654321)
11553 echo "(The test program ran ok.)"
11554 echo "byteorder=$dflt"
11557 ????|????????) echo "(The test program ran ok.)" ;;
11558 *) echo "(The test program didn't run right for some reason.)" ;;
11563 (I can't seem to compile the test program. Guessing big-endian...)
11566 case "$xxx_prompt" in
11568 rp="What is the order of bytes in a long?"
11582 : how do we catenate cpp tokens here?
11584 echo "Checking to see how your cpp does stuff like catenate tokens..." >&4
11585 $cat >cpp_stuff.c <<'EOCP'
11586 #define RCAT(a,b)a/**/b
11587 #define ACAT(a,b)a ## b
11591 $cppstdin $cppflags $cppminus <cpp_stuff.c >cpp_stuff.out 2>&1
11592 if $contains 'Circus' cpp_stuff.out >/dev/null 2>&1; then
11593 echo "Oh! Smells like ANSI's been here." >&4
11594 echo "We can catify or stringify, separately or together!"
11596 elif $contains 'Reiser' cpp_stuff.out >/dev/null 2>&1; then
11597 echo "Ah, yes! The good old days!" >&4
11598 echo "However, in the good old days we don't know how to stringify and"
11599 echo "catify at the same time."
11603 Hmm, I don't seem to be able to catenate tokens with your cpp. You're going
11604 to have to edit the values of CAT[2-5] in config.h...
11606 cpp_stuff="/* Help! How do we handle cpp_stuff? */*/"
11610 : see if this is a db.h system
11616 : Check db version.
11618 echo "Checking Berkeley DB version ..." >&4
11624 #include <sys/types.h>
11629 #ifdef DB_VERSION_MAJOR /* DB version >= 2 */
11630 int Major, Minor, Patch ;
11631 unsigned long Version ;
11632 (void)db_version(&Major, &Minor, &Patch) ;
11633 printf("You have Berkeley DB Version 2 or greater\n");
11635 printf("db.h is from Berkeley DB Version %d.%d.%d\n",
11636 DB_VERSION_MAJOR, DB_VERSION_MINOR, DB_VERSION_PATCH);
11637 printf("libdb is from Berkeley DB Version %d.%d.%d\n",
11638 Major, Minor, Patch) ;
11640 /* check that db.h & libdb are compatible */
11641 if (DB_VERSION_MAJOR != Major || DB_VERSION_MINOR != Minor || DB_VERSION_PATCH != Patch) {
11642 printf("db.h and libdb are incompatible\n") ;
11646 printf("db.h and libdb are compatible\n") ;
11648 Version = DB_VERSION_MAJOR * 1000000 + DB_VERSION_MINOR * 1000
11649 + DB_VERSION_PATCH ;
11651 /* needs to be >= 2.3.4 */
11652 if (Version < 2003004) {
11653 /* if (DB_VERSION_MAJOR == 2 && DB_VERSION_MINOR == 0 && DB_VERSION_PATCH < 5) { */
11654 printf("but Perl needs Berkeley DB 2.3.4 or greater\n") ;
11660 #if defined(_DB_H_) && defined(BTREEMAGIC) && defined(HASHMAGIC)
11661 printf("You have Berkeley DB Version 1\n");
11662 exit(0); /* DB version < 2: the coast is clear. */
11664 exit(1); /* <db.h> not Berkeley DB? */
11670 if eval $compile_ok && ./try; then
11671 echo 'Looks OK.' >&4
11673 echo "I can't use Berkeley DB with your <db.h>. I'll disable Berkeley DB." >&4
11677 : Remove db from list of libraries to use
11678 echo "Removing unusable -ldb from library list" >&4
11679 set `echo X $libs | $sed -e 's/-ldb / /' -e 's/-ldb$//'`
11682 echo "libs = $libs" >&4
11692 : Check the return type needed for hash
11694 echo "Checking return type needed for hash for Berkeley DB ..." >&4
11700 #include <sys/types.h>
11703 #ifndef DB_VERSION_MAJOR
11704 u_int32_t hash_cb (ptr, size)
11712 info.hash = hash_cb;
11716 if $cc $ccflags -c try.c >try.out 2>&1 ; then
11717 if $contains warning try.out >>/dev/null 2>&1 ; then
11720 db_hashtype='u_int32_t'
11723 : XXX Maybe we should just give up here.
11724 db_hashtype=u_int32_t
11726 echo "Help: I can't seem to compile the db test program." >&4
11727 echo "Something's wrong, but I'll assume you use $db_hashtype." >&4
11730 echo "Your version of Berkeley DB uses $db_hashtype for hash."
11732 *) db_hashtype=u_int32_t
11737 : Check the return type needed for prefix
11739 echo "Checking return type needed for prefix for Berkeley DB ..." >&4
11745 #include <sys/types.h>
11748 #ifndef DB_VERSION_MAJOR
11749 size_t prefix_cb (key1, key2)
11757 info.prefix = prefix_cb;
11761 if $cc $ccflags -c try.c >try.out 2>&1 ; then
11762 if $contains warning try.out >>/dev/null 2>&1 ; then
11763 db_prefixtype='int'
11765 db_prefixtype='size_t'
11768 db_prefixtype='size_t'
11769 : XXX Maybe we should just give up here.
11771 echo "Help: I can't seem to compile the db test program." >&4
11772 echo "Something's wrong, but I'll assume you use $db_prefixtype." >&4
11775 echo "Your version of Berkeley DB uses $db_prefixtype for prefix."
11777 *) db_prefixtype='size_t'
11781 : check for void type
11783 echo "Checking to see how well your C compiler groks the void type..." >&4
11784 case "$voidflags" in
11786 $cat >try.c <<'EOCP'
11792 extern void moo(); /* function returning void */
11793 void (*goo)(); /* ptr to func returning void */
11795 void *hue; /* generic ptr */
11808 int main() { sub(); }
11810 if $cc $ccflags -c -DTRY=$defvoidused try.c >.out 2>&1 ; then
11811 voidflags=$defvoidused
11812 echo "Good. It appears to support void to the level $package wants.">&4
11813 if $contains warning .out >/dev/null 2>&1; then
11814 echo "However, you might get some warnings that look like this:"
11818 echo "Hmm, your compiler has some difficulty with void. Checking further..." >&4
11819 if $cc $ccflags -c -DTRY=1 try.c >/dev/null 2>&1; then
11820 echo "It supports 1..."
11821 if $cc $ccflags -c -DTRY=3 try.c >/dev/null 2>&1; then
11822 echo "It also supports 2..."
11823 if $cc $ccflags -c -DTRY=7 try.c >/dev/null 2>&1; then
11825 echo "And it supports 4 but not 8 definitely."
11827 echo "It doesn't support 4..."
11828 if $cc $ccflags -c -DTRY=11 try.c >/dev/null 2>&1; then
11830 echo "But it supports 8."
11833 echo "Neither does it support 8."
11837 echo "It does not support 2..."
11838 if $cc $ccflags -c -DTRY=13 try.c >/dev/null 2>&1; then
11840 echo "But it supports 4 and 8."
11842 if $cc $ccflags -c -DTRY=5 try.c >/dev/null 2>&1; then
11844 echo "And it supports 4 but has not heard about 8."
11846 echo "However it supports 8 but not 4."
11851 echo "There is no support at all for void."
11856 case "$voidflags" in
11858 *) $cat >&4 <<'EOM'
11859 Support flag bits are:
11860 1: basic void declarations.
11861 2: arrays of pointers to functions returning void.
11862 4: operations between pointers to and addresses of void functions.
11863 8: generic void pointers.
11866 rp="Your void support flags add up to what?"
11874 : How can we generate normalized random numbers ?
11876 echo "Looking for a random number function..." >&4
11877 case "$randfunc" in
11879 if set drand48 val -f; eval $csym; $val; then
11881 echo "Good, found drand48()." >&4
11882 elif set random val -f; eval $csym; $val; then
11884 echo "OK, found random()." >&4
11887 echo "Yick, looks like I have to use rand()." >&4
11898 *-Dmy_rand=*|*-Dmy_srand=*)
11899 echo "Removing obsolete -Dmy_rand, -Dmy_srand, and -Drandbits from ccflags." >&4
11900 ccflags="`echo $ccflags | sed -e 's/-Dmy_rand=random/ /'`"
11901 ccflags="`echo $ccflags | sed -e 's/-Dmy_srand=srandom/ /'`"
11902 ccflags="`echo $ccflags | sed -e 's/-Drandbits=[0-9][0-9]*/ /'`"
11906 while $test "$cont"; do
11907 rp="Use which function to generate random numbers?"
11909 if $test "$ans" = "$dflt"; then
11915 if set $ans val -f; eval $csym; $val; then
11919 rp="I cannot find function $ans. Use that name anyway?"
11928 case "$randfunc" in
11930 drand01="drand48()"
11936 case "$randbits" in
11938 echo "Checking to see how many bits your $randfunc() function produces..." >&4
11940 #$i_unistd I_UNISTD
11941 #$i_stdlib I_STDLIB
11944 # include <unistd.h>
11947 # include <stdlib.h>
11952 register unsigned long tmp;
11953 register unsigned long max = 0L;
11955 for (i = 1000; i; i--) {
11956 tmp = (unsigned long) $randfunc();
11957 if (tmp > max) max = tmp;
11959 for (i = 0; max; i++)
11965 if eval $compile_ok; then
11969 echo "(I can't seem to compile the test program...)"
11976 rp="How many bits does your $randfunc() function produce?"
11980 drand01="($randfunc() / (double) ((unsigned long)1 << $randbits))"
11981 seedfunc="s$randfunc"
11982 randseedtype=unsigned
11986 rp="How many bits does your $randfunc() function produce?"
11989 seedfunc="s$randfunc"
11990 drand01="($randfunc() / (double) ((unsigned long)1 << $randbits))"
11991 if set $seedfunc val -f; eval $csym; $val; then
11992 echo "(Using $seedfunc() to seed random generator)"
11994 echo "(Warning: no $seedfunc() to seed random generator)"
11997 randseedtype=unsigned
12005 echo "Determining whether or not we are on an EBCDIC system..." >&4
12006 $cat >tebcdic.c <<'EOM'
12009 if ('M'==0xd4) return 0;
12016 if eval $compile_ok; then
12018 echo "You have EBCDIC." >&4
12021 echo "Nope, no EBCDIC, probably ASCII or some ISO Latin." >&4
12024 echo "I'm unable to compile the test program." >&4
12025 echo "I'll assume ASCII or some ISO Latin." >&4
12027 $rm -f tebcdic.c tebcdic
12033 Checking how to flush all pending stdio output...
12035 # I only know how to find the first 32 possibly open files on SunOS.
12036 # See also hints/sunos_4_1.sh and util.c --AD
12038 sunos) $echo '#define PERL_FFLUSH_ALL_FOPEN_MAX 32' > try.c ;;
12040 $cat >>try.c <<EOCP
12042 #$i_unistd I_UNISTD
12044 # include <unistd.h>
12046 #$d_sysconf HAS_SYSCONF
12047 #$d_stdio_stream_array HAS_STDIO_STREAM_ARRAY
12048 #ifdef HAS_STDIO_STREAM_ARRAY
12049 # define STDIO_STREAM_ARRAY $stdio_stream_array
12052 FILE* p = fopen("try.out", "w");
12056 # ifdef TRY_FPRINTF
12060 #ifdef TRY_FFLUSH_NULL
12063 #ifdef TRY_FFLUSH_ALL
12065 long open_max = -1;
12066 # ifdef PERL_FFLUSH_ALL_FOPEN_MAX
12067 open_max = PERL_FFLUSH_ALL_FOPEN_MAX;
12069 # if defined(HAS_SYSCONF) && defined(_SC_OPEN_MAX)
12070 open_max = sysconf(_SC_OPEN_MAX);
12073 open_max = FOPEN_MAX;
12076 open_max = OPEN_MAX;
12085 # ifdef HAS_STDIO_STREAM_ARRAY
12086 if (open_max > 0) {
12088 for (i = 0; i < open_max; i++)
12089 if (STDIO_STREAM_ARRAY[i]._file >= 0 &&
12090 STDIO_STREAM_ARRAY[i]._file < open_max &&
12091 STDIO_STREAM_ARRAY[i]._flag)
12092 fflush(&STDIO_STREAM_ARRAY[i]);
12100 : first we have to find out how _not_ to flush
12101 if $test "X$fflushNULL" = X -o "X$fflushall" = X; then
12103 set try -DTRY_FPUTC
12104 if eval $compile; then
12106 ./try$exe_ext 2>/dev/null
12107 if $test ! -s try.out -a "X$?" = X42; then
12113 set try -DTRY_FPRINTF
12115 if eval $compile; then
12117 ./try$exe_ext 2>/dev/null
12118 if $test ! -s try.out -a "X$?" = X42; then
12119 output=-DTRY_FPRINTF
12125 : check for fflush NULL behaviour
12126 case "$fflushNULL" in
12127 '') set try -DTRY_FFLUSH_NULL $output
12128 if eval $compile; then
12130 ./try$exe_ext 2>/dev/null
12132 if $test -s try.out -a "X$code" = X42; then
12133 fflushNULL="`$cat try.out`"
12135 if $test "X$code" != X42; then
12137 (If this test failed, don't worry, we'll try another method shortly.)
12142 $rm -f core try.core core.try.*
12143 case "$fflushNULL" in
12145 Your fflush(NULL) works okay.
12147 fflushNULL="$define"
12150 Your fflush(NULL) isn't working (contrary to ANSI C).
12152 fflushNULL="$undef"
12155 Cannot figure out whether your fflush(NULL) works or not.
12156 I'm assuming it doesn't (contrary to ANSI C).
12158 fflushNULL="$undef"
12162 $define|true|[yY]*)
12163 fflushNULL="$define"
12166 fflushNULL="$undef"
12169 : check explicit looping only if NULL did not work
12170 case "$fflushNULL" in
12172 : check for fflush all behaviour
12173 case "$fflushall" in
12174 '') set try -DTRY_FFLUSH_ALL $output
12175 if eval $compile; then
12177 (Now testing the other method--but note that also this may fail.)
12180 ./try$exe_ext 2>/dev/null
12181 if $test -s try.out -a "X$?" = X42; then
12182 fflushall="`$cat try.out`"
12185 $rm -f core try.core core.try.*
12186 case "$fflushall" in
12188 Whew. Flushing explicitly all the stdio streams works.
12190 fflushall="$define"
12193 Sigh. Flushing explicitly all the stdio streams doesn't work.
12198 Cannot figure out whether flushing stdio streams explicitly works or not.
12199 I'm assuming it doesn't.
12205 "$define"|true|[yY]*)
12206 fflushall="$define"
12213 *) fflushall="$undef"
12216 case "$fflushNULL$fflushall" in
12219 I cannot figure out how to flush pending stdio output.
12223 $rm -f try.* try$exe_ext
12225 : Store the full pathname to the ar program for use in the C program
12226 : Respect a hint or command line value for full_ar.
12231 : Store the full pathname to the sed program for use in the C program
12234 : see what type gids are declared as in the kernel
12236 echo "Looking for the type for group ids returned by getgid()."
12237 set gid_t gidtype xxx stdio.h sys/types.h
12241 xxx=`./findhdr sys/user.h`
12242 set `grep 'groups\[NGROUPS\];' "$xxx" 2>/dev/null` unsigned short
12244 unsigned) dflt="$1 $2" ;;
12248 *) dflt="$gidtype";;
12251 gid_t) echo "gid_t found." ;;
12252 *) rp="What is the type for group ids returned by getgid()?"
12260 *_t) zzz="$gidtype" ;;
12263 echo "Checking the size of $zzz..." >&4
12265 #include <sys/types.h>
12268 printf("%d\n", (int)sizeof($gidtype));
12273 if eval $compile_ok; then
12277 echo "(I can't execute the test program--guessing $gidsize.)" >&4
12280 echo "Your $zzz size is $gidsize bytes."
12285 echo "(I can't compile the test program--guessing $gidsize.)" >&4
12291 *_t) zzz="$gidtype" ;;
12294 echo "Checking the sign of $zzz..." >&4
12296 #include <sys/types.h>
12307 if eval $compile; then
12311 echo "(I can't execute the test program--guessing unsigned.)" >&4
12315 1) echo "Your $zzz is unsigned." ;;
12316 -1) echo "Your $zzz is signed." ;;
12322 echo "(I can't compile the test program--guessing unsigned.)" >&4
12328 if $test X"$quadtype" != X; then
12330 echo "Checking how to print 64-bit integers..." >&4
12332 if $test X"$sPRId64" = X -a X"$quadtype" = Xint; then
12333 $cat >try.c <<'EOCP'
12334 #include <sys/types.h>
12337 int q = 12345678901;
12338 printf("%ld\n", q);
12342 if eval $compile; then
12343 yyy=`./try$exe_ext`
12346 sPRId64='"d"'; sPRIi64='"i"'; sPRIu64='"u"';
12347 sPRIo64='"o"'; sPRIx64='"x"'; sPRIX64='"X"';
12348 echo "We will use %d."
12354 if $test X"$sPRId64" = X -a X"$quadtype" = Xlong; then
12355 $cat >try.c <<'EOCP'
12356 #include <sys/types.h>
12359 long q = 12345678901;
12360 printf("%ld\n", q);
12364 if eval $compile; then
12365 yyy=`./try$exe_ext`
12368 sPRId64='"ld"'; sPRIi64='"li"'; sPRIu64='"lu"';
12369 sPRIo64='"lo"'; sPRIx64='"lx"'; sPRIX64='"lX"';
12370 echo "We will use %ld."
12376 if $test X"$sPRId64" = X -a X"$i_inttypes" = X"$define" -a X"$quadtype" = Xint64_t; then
12377 $cat >try.c <<'EOCP'
12378 #include <sys/types.h>
12379 #include <inttypes.h>
12382 int64_t q = 12345678901;
12383 printf("%" PRId64 "\n", q);
12387 if eval $compile; then
12388 yyy=`./try$exe_ext`
12391 sPRId64=PRId64; sPRIi64=PRIi64; sPRIu64=PRIu64;
12392 sPRIo64=PRIo64; sPRIx64=PRIx64; sPRIX64=PRIX64;
12393 echo "We will use the C9X style."
12399 if $test X"$sPRId64" = X -a X"$quadtype" = X"long long"; then
12400 $cat >try.c <<'EOCP'
12401 #include <sys/types.h>
12404 long long q = 12345678901LL; /* AIX cc requires the LL prefix. */
12405 printf("%lld\n", q);
12409 if eval $compile; then
12410 yyy=`./try$exe_ext`
12413 sPRId64='"lld"'; sPRIi64='"lli"'; sPRIu64='"llu"';
12414 sPRIo64='"llo"'; sPRIx64='"llx"'; sPRIX64='"llX"';
12415 echo "We will use the %lld style."
12421 if $test X"$sPRId64" = X -a X"$quadtype" != X; then
12423 #include <sys/types.h>
12426 $quadtype q = 12345678901;
12427 printf("%Ld\n", q);
12431 if eval $compile; then
12432 yyy=`./try$exe_ext`
12435 sPRId64='"Ld"'; sPRIi64='"Li"'; sPRIu64='"Lu"';
12436 sPRIo64='"Lo"'; sPRIx64='"Lx"'; sPRIX64='"LX"';
12437 echo "We will use %Ld."
12443 if $test X"$sPRId64" = X -a X"$quadtype" != X; then
12445 #include <sys/types.h>
12448 $quadtype q = 12345678901;
12449 printf("%qd\n", q);
12453 if eval $compile; then
12454 yyy=`./try$exe_ext`
12457 sPRId64='"qd"'; sPRIi64='"qi"'; sPRIu64='"qu"';
12458 sPRIo64='"qo"'; sPRIx64='"qx"'; sPRIX64='"qX"';
12459 echo "We will use %qd."
12465 if $test X"$sPRId64" = X; then
12466 echo "Cannot figure out how to print 64-bit integers." >&4
12474 '') d_PRId64="$undef"; d_PRIi64="$undef"; d_PRIu64="$undef";
12475 d_PRIo64="$undef"; d_PRIx64="$undef"; d_PRIX64="$undef";
12477 *) d_PRId64="$define"; d_PRIi64="$define"; d_PRIu64="$define";
12478 d_PRIo64="$define"; d_PRIx64="$define"; d_PRIX64="$define";
12484 $echo "Checking the format strings to be used for Perl's internal types..." >&4
12486 if $test X"$ivsize" = X8; then
12487 ivdformat="$sPRId64"
12488 uvuformat="$sPRIu64"
12489 uvoformat="$sPRIo64"
12490 uvxformat="$sPRIx64"
12492 if $test X"$ivsize" = X"$longsize"; then
12498 if $test X"$ivsize" = X"$intsize"; then
12505 if $test X"$ivsize" = X"$shortsize"; then
12515 case "$ivdformat" in
12516 '') echo "$0: Fatal: failed to find format strings, cannot continue." >& 4
12523 $echo "Checking the format string to be used for gids..." >&4
12526 -1) if $test X"$gidsize" = X"$ivsize"; then
12527 gidformat="$ivdformat"
12529 if $test X"$gidsize" = X"$longsize"; then
12532 if $test X"$gidsize" = X"$intsize"; then
12535 if $test X"$gidsize" = X"$shortsize"; then
12542 *) if $test X"$gidsize" = X"$uvsize"; then
12543 gidformat="$uvuformat"
12545 if $test X"$gidsize" = X"$longsize"; then
12548 if $test X"$gidsize" = X"$intsize"; then
12551 if $test X"$gidsize" = X"$shortsize"; then
12560 : see if getgroups exists
12561 set getgroups d_getgrps
12564 : see if setgroups exists
12565 set setgroups d_setgrps
12569 : Find type of 2nd arg to 'getgroups()' and 'setgroups()'
12571 case "$d_getgrps$d_setgrps" in
12573 case "$groupstype" in
12574 '') dflt="$gidtype" ;;
12575 *) dflt="$groupstype" ;;
12578 What type of pointer is the second argument to getgroups() and setgroups()?
12579 Usually this is the same as group ids, $gidtype, but not always.
12582 rp='What type pointer is the second argument to getgroups() and setgroups()?'
12586 *) groupstype="$gidtype";;
12590 echo "Checking if your $make program sets \$(MAKE)..." >&4
12591 case "$make_set_make" in
12593 $sed 's/^X //' > testmake.mak << 'EOF'
12595 X @echo 'maketemp="$(MAKE)"'
12597 case "`$make -f testmake.mak 2>/dev/null`" in
12598 *maketemp=*) make_set_make='#' ;;
12599 *) make_set_make="MAKE=$make" ;;
12601 $rm -f testmake.mak
12604 case "$make_set_make" in
12605 '#') echo "Yup, it does.";;
12606 *) echo "Nope, it doesn't.";;
12609 : see what type is used for mode_t
12610 rp="What is the type used for file modes for system calls (e.g. fchmod())?"
12611 set mode_t modetype int stdio.h sys/types.h
12614 : define a fucntion to check prototypes
12615 $cat > protochk <<EOSH
12618 optimize="$optimize"
12620 prototype="$prototype"
12625 $cat >> protochk <<'EOSH'
12630 while test $# -ge 2; do
12632 $define) echo "#include <$2>" >> try.c ;;
12633 literal) echo "$2" >> try.c ;;
12637 test "$prototype" = "$define" && echo '#define CAN_PROTOTYPE' >> try.c
12638 cat >> try.c <<'EOCP'
12639 #ifdef CAN_PROTOTYPE
12640 #define _(args) args
12645 echo "$foo" >> try.c
12646 echo 'int no_real_function_has_this_name _((void)) { return 0; }' >> try.c
12647 $cc $optimize $ccflags -c try.c > /dev/null 2>&1
12653 $eunicefix protochk
12655 : see what type is used for size_t
12656 rp="What is the type used for the length parameter for string functions?"
12657 set size_t sizetype 'unsigned int' stdio.h sys/types.h
12660 : check for type of arguments to gethostbyaddr.
12661 if test "X$netdb_host_type" = X -o "X$netdb_hlen_type" = X; then
12662 case "$d_gethbyaddr" in
12666 Checking to see what type of arguments are accepted by gethostbyaddr().
12668 hdrs="$define sys/types.h
12669 $d_socket sys/socket.h
12670 $i_niin netinet/in.h
12672 $i_unistd unistd.h"
12673 : The first arg can 'char *' or 'void *'
12674 : The second arg is some of integral type
12675 for xxx in in_addr_t 'const void *' 'const char *' 'void *' 'char *'; do
12676 for yyy in size_t long int; do
12677 case "$netdb_host_type" in
12678 '') try="extern struct hostent *gethostbyaddr($xxx, $yyy, int);"
12679 if ./protochk "$try" $hdrs; then
12680 echo "Your system accepts $xxx for the first arg."
12681 echo "...and $yyy for the second arg."
12682 netdb_host_type="$xxx"
12683 netdb_hlen_type="$yyy"
12689 : In case none of those worked, prompt the user.
12690 case "$netdb_host_type" in
12691 '') rp='What is the type for the 1st argument to gethostbyaddr?'
12694 netdb_host_type=$ans
12695 rp='What is the type for the 2nd argument to gethostbyaddr?'
12698 netdb_hlen_type=$ans
12702 *) : no gethostbyaddr, so pick harmless defaults
12703 netdb_host_type='char *'
12704 netdb_hlen_type="$sizetype"
12707 # Remove the "const" if needed. -- but then we'll have a
12709 # netdb_host_type=`echo "$netdb_host_type" | sed 's/^const //'`
12712 : check for type of argument to gethostbyname.
12713 if test "X$netdb_name_type" = X ; then
12714 case "$d_gethbyname" in
12718 Checking to see what type of argument is accepted by gethostbyname().
12720 hdrs="$define sys/types.h
12721 $d_socket sys/socket.h
12722 $i_niin netinet/in.h
12724 $i_unistd unistd.h"
12725 for xxx in "const char *" "char *"; do
12726 case "$netdb_name_type" in
12727 '') try="extern struct hostent *gethostbyname($xxx);"
12728 if ./protochk "$try" $hdrs; then
12729 echo "Your system accepts $xxx."
12730 netdb_name_type="$xxx"
12735 : In case none of those worked, prompt the user.
12736 case "$netdb_name_type" in
12737 '') rp='What is the type for the 1st argument to gethostbyname?'
12740 netdb_name_type=$ans
12744 *) : no gethostbyname, so pick harmless default
12745 netdb_name_type='char *'
12750 : check for type of 1st argument to getnetbyaddr.
12751 if test "X$netdb_net_type" = X ; then
12752 case "$d_getnbyaddr" in
12756 Checking to see what type of 1st argument is accepted by getnetbyaddr().
12758 hdrs="$define sys/types.h
12759 $d_socket sys/socket.h
12760 $i_niin netinet/in.h
12762 $i_unistd unistd.h"
12763 for xxx in in_addr_t "unsigned long" long "unsigned int" int; do
12764 case "$netdb_net_type" in
12765 '') try="extern struct netent *getnetbyaddr($xxx, int);"
12766 if ./protochk "$try" $hdrs; then
12767 echo "Your system accepts $xxx."
12768 netdb_net_type="$xxx"
12773 : In case none of those worked, prompt the user.
12774 case "$netdb_net_type" in
12775 '') rp='What is the type for the 1st argument to getnetbyaddr?'
12778 netdb_net_type=$ans
12782 *) : no getnetbyaddr, so pick harmless default
12783 netdb_net_type='long'
12787 : locate the preferred pager for this system
12801 '') dflt=/usr/ucb/more;;
12808 rp='What pager is used on your system?'
12812 : see what type pids are declared as in the kernel
12813 rp="What is the type of process ids on this system?"
12814 set pid_t pidtype int stdio.h sys/types.h
12817 : check for length of pointer
12821 $echo $n "Checking to see how big your pointers are...$c" >&4
12822 if test "$voidflags" -gt 7; then
12823 echo '#define VOID_PTR char *' > try.c
12825 echo '#define VOID_PTR void *' > try.c
12827 $cat >>try.c <<'EOCP'
12831 printf("%d\n", (int)sizeof(VOID_PTR));
12836 if eval $compile_ok; then
12838 $echo " $ptrsize bytes." >&4
12841 echo "(I can't seem to compile the test program. Guessing...)" >&4
12842 rp="What is the size of a pointer (in bytes)?"
12850 : see if ar generates random libraries by itself
12852 echo "Checking how to generate random libraries on your machine..." >&4
12853 echo 'int bar1() { return bar2(); }' > bar1.c
12854 echo 'int bar2() { return 2; }' > bar2.c
12855 $cat > foo.c <<'EOP'
12856 int main() { printf("%d\n", bar1()); exit(0); }
12858 $cc $ccflags -c bar1.c >/dev/null 2>&1
12859 $cc $ccflags -c bar2.c >/dev/null 2>&1
12860 $cc $ccflags -c foo.c >/dev/null 2>&1
12861 $ar rc bar$_a bar2$_o bar1$_o >/dev/null 2>&1
12862 if $cc $ccflags $ldflags -o foobar foo$_o bar$_a $libs > /dev/null 2>&1 &&
12863 ./foobar >/dev/null 2>&1; then
12864 echo "$ar appears to generate random libraries itself."
12867 elif $ar ts bar$_a >/dev/null 2>&1 &&
12868 $cc $ccflags $ldflags -o foobar foo$_o bar$_a $libs > /dev/null 2>&1 &&
12869 ./foobar >/dev/null 2>&1; then
12870 echo "a table of contents needs to be added with '$ar ts'."
12877 ranlib=`./loc ranlib X /usr/bin /bin /usr/local/bin`
12878 $test -f $ranlib || ranlib=''
12881 if $test -n "$ranlib"; then
12882 echo "your system has '$ranlib'; we'll use that."
12885 echo "your system doesn't seem to support random libraries"
12886 echo "so we'll use lorder and tsort to order the libraries."
12893 : check for type of arguments to select.
12894 case "$selecttype" in
12895 '') case "$d_select" in
12899 Checking to see what type of arguments are accepted by select().
12901 hdrs="$define sys/types.h
12902 $i_systime sys/time.h
12903 $i_sysselct sys/select.h
12904 $d_socket sys/socket.h"
12905 : The first arg can be int, unsigned, or size_t
12906 : The last arg may or may not be 'const'
12908 : void pointer has been seen but using that
12909 : breaks the selectminbits test
12910 for xxx in 'fd_set *' 'int *'; do
12911 for nfd in 'int' 'size_t' 'unsigned long' 'unsigned' ; do
12912 for tmo in 'struct timeval *' 'const struct timeval *'; do
12914 '') try="extern select _(($nfd, $xxx, $xxx, $xxx, $tmo));"
12915 if ./protochk "$try" $hdrs; then
12916 echo "Your system accepts $xxx."
12925 '') rp='What is the type for the 2nd, 3rd, and 4th arguments to select?'
12926 case "$d_fd_set" in
12927 $define) dflt="fd_set *" ;;
12936 *) : no select, so pick a harmless default
12943 : check for the select 'width'
12944 case "$selectminbits" in
12945 '') case "$d_select" in
12949 Checking to see on how many bits at a time your select() operates...
12952 #include <sys/types.h>
12954 #$i_systime I_SYS_TIME
12955 #$i_systimek I_SYS_TIME_KERNEL
12960 # ifdef I_SYS_TIME_KERNEL
12963 # include <sys/time.h>
12964 # ifdef I_SYS_TIME_KERNEL
12968 #$i_sysselct I_SYS_SELECT
12969 #ifdef I_SYS_SELECT
12970 #include <sys/select.h>
12972 #$d_socket HAS_SOCKET
12974 # include <sys/socket.h> /* Might include <sys/bsdtypes.h> */
12978 #define S sizeof(*(b))
12980 #define NBYTES (S * 8 > MINBITS ? S : MINBITS/8)
12981 #define NBITS (NBYTES * 8)
12990 fp = fopen("try.c", "r");
12996 b = ($selecttype)s;
12997 for (i = 0; i < NBITS; i++)
13001 select(fd + 1, b, 0, 0, &t);
13002 for (i = NBITS - 1; i > fd && FD_ISSET(i, b); i--);
13003 printf("%d\n", i + 1);
13008 if eval $compile_ok; then
13009 selectminbits=`./try`
13010 case "$selectminbits" in
13012 Cannot figure out on how many bits at a time your select() operates.
13013 I'll play safe and guess it is 32 bits.
13019 *) bits="$selectminbits bits" ;;
13021 echo "Your select() operates on $bits at a time." >&4
13023 rp='What is the minimum number of bits your select() operates on?'
13024 case "$byteorder" in
13025 1234|12345678) dflt=32 ;;
13030 selectminbits="$val"
13034 *) : no select, so pick a harmless default
13041 : Trace out the files included by signal.h, then look for SIGxxx names.
13042 : Remove SIGARRAYSIZE used by HPUX.
13043 : Remove SIGSTKSIZE used by Linux.
13044 : Remove SIGSTKSZ used by Posix.
13045 : Remove SIGTYP void lines used by OS2.
13046 : Some cpps, like os390, dont give the file name anywhere
13047 if [ "X$fieldn" = X ]; then
13048 : Just make some guesses. We check them later.
13049 xxx='/usr/include/signal.h /usr/include/sys/signal.h'
13051 xxx=`echo '#include <signal.h>' |
13052 $cppstdin $cppminus $cppflags 2>/dev/null |
13053 $grep '^[ ]*#.*include' |
13054 $awk "{print \\$$fieldn}" | $sed 's!"!!g' | $sort | $uniq`
13056 : Check this list of files to be sure we have parsed the cpp output ok.
13057 : This will also avoid potentially non-existent files, such
13060 for xx in $xxx /dev/null ; do
13061 $test -f "$xx" && xxxfiles="$xxxfiles $xx"
13063 : If we have found no files, at least try signal.h
13064 case "$xxxfiles" in
13065 '') xxxfiles=`./findhdr signal.h` ;;
13068 $1 ~ /^#define$/ && $2 ~ /^SIG[A-Z0-9]*$/ && $2 !~ /SIGARRAYSIZE/ && $2 !~ /SIGSTKSIZE/ && $2 !~ /SIGSTKSZ/ && $3 !~ /void/ {
13069 print substr($2, 4, 20)
13071 $1 == "#" && $2 ~ /^define$/ && $3 ~ /^SIG[A-Z0-9]*$/ && $3 !~ /SIGARRAYSIZE/ && $4 !~ /void/ {
13072 print substr($3, 4, 20)
13074 : Append some common names just in case the awk scan failed.
13075 xxx="$xxx ABRT ALRM BUS CANCEL CHLD CLD CONT DIL EMT FPE"
13076 xxx="$xxx FREEZE HUP ILL INT IO IOT KILL LOST LWP PHONE"
13077 xxx="$xxx PIPE POLL PROF PWR QUIT RTMAX RTMIN SEGV STKFLT STOP"
13078 xxx="$xxx SYS TERM THAW TRAP TSTP TTIN TTOU URG USR1 USR2"
13079 xxx="$xxx USR3 USR4 VTALRM WAITING WINCH WIND WINDOW XCPU XFSZ"
13081 : generate a few handy files for later
13082 $cat > signal.c <<'EOCP'
13083 #include <sys/types.h>
13084 #include <signal.h>
13088 /* Strange style to avoid deeply-nested #if/#else/#endif */
13091 # define NSIG (_NSIG)
13097 # define NSIG (SIGMAX+1)
13103 # define NSIG (SIG_MAX+1)
13109 # define NSIG (MAXSIG+1)
13115 # define NSIG (MAX_SIG+1)
13120 # ifdef SIGARRAYSIZE
13121 # define NSIG (SIGARRAYSIZE+1) /* Not sure of the +1 */
13127 # define NSIG (_sys_nsig) /* Solaris 2.5 */
13131 /* Default to some arbitrary number that's big enough to get most
13132 of the common signals.
13138 printf("NSIG %d\n", NSIG);
13144 echo $xxx | $tr ' ' $trnl | $sort | $uniq | $awk '
13146 printf "#ifdef SIG"; printf $1; printf "\n"
13147 printf "printf(\""; printf $1; printf " %%d\\n\",SIG";
13148 printf $1; printf ");\n"
13152 printf "#endif /* JUST_NSIG */\n";
13153 printf "exit(0);\n}\n";
13156 $cat >signal.awk <<'EOP'
13157 BEGIN { ndups = 0 }
13158 $1 ~ /^NSIG$/ { nsig = $2 }
13159 ($1 !~ /^NSIG$/) && (NF == 2) {
13160 if ($2 > maxsig) { maxsig = $2 }
13161 if (sig_name[$2]) {
13162 dup_name[ndups] = $1
13163 dup_num[ndups] = $2
13175 printf("NSIG %d\n", nsig);
13176 for (n = 1; n < nsig; n++) {
13178 printf("%s %d\n", sig_name[n], sig_num[n])
13181 printf("NUM%d %d\n", n, n)
13184 for (n = 0; n < ndups; n++) {
13185 printf("%s %d\n", dup_name[n], dup_num[n])
13189 $cat >signal_cmd <<EOS
13191 if $test -s signal.lst; then
13192 echo "Using your existing signal.lst file"
13197 $cat >>signal_cmd <<'EOS'
13200 if eval $compile_ok; then
13201 ./signal$_exe | $sort -n +1 | $uniq | $awk -f signal.awk >signal.lst
13203 echo "(I can't seem be able to compile the whole test program)" >&4
13204 echo "(I'll try it in little pieces.)" >&4
13205 set signal -DJUST_NSIG
13206 if eval $compile_ok; then
13207 ./signal$_exe > signal.nsg
13210 echo "I can't seem to figure out how many signals you have." >&4
13211 echo "Guessing 50." >&4
13212 echo 'NSIG 50' > signal.nsg
13214 : Now look at all the signal names, one at a time.
13215 for xx in `echo $xxx | $tr ' ' $trnl | $sort | $uniq`; do
13216 $cat > signal.c <<EOCP
13217 #include <sys/types.h>
13218 #include <signal.h>
13221 printf("$xx %d\n", SIG${xx});
13226 if eval $compile; then
13227 echo "SIG${xx} found."
13228 ./signal$_exe >> signal.ls1
13230 echo "SIG${xx} NOT found."
13233 if $test -s signal.ls1; then
13234 $cat signal.nsg signal.ls1 |
13235 $sort -n +1 | $uniq | $awk -f signal.awk >signal.lst
13239 if $test -s signal.lst; then
13242 echo "(AAK! I can't compile the test programs -- Guessing)" >&4
13243 echo 'kill -l' >signal
13244 set X `csh -f <signal`
13248 0) set HUP INT QUIT ILL TRAP ABRT EMT FPE KILL BUS SEGV SYS PIPE ALRM TERM;;
13250 echo $@ | $tr ' ' $trnl | \
13251 $awk '{ printf "%s %d\n", $1, ++s; }
13252 END { printf "NSIG %d\n", ++s }' >signal.lst
13254 $rm -f signal.c signal$_exe signal$_o signal.nsg signal.ls1
13256 chmod a+x signal_cmd
13257 $eunicefix signal_cmd
13259 : generate list of signal names
13261 case "$sig_name_init" in
13263 *) case "$sig_num_init" in
13264 ''|*,*) doinit=yes ;;
13269 echo "Generating a list of signal names and numbers..." >&4
13271 sig_count=`$awk '/^NSIG/ { printf "%d", $2 }' signal.lst`
13272 sig_name=`$awk 'BEGIN { printf "ZERO " }
13273 !/^NSIG/ { printf "%s ", $1 }' signal.lst`
13274 sig_num=`$awk 'BEGIN { printf "0 " }
13275 !/^NSIG/ { printf "%d ", $2 }' signal.lst`
13276 sig_name_init=`$awk 'BEGIN { printf "\"ZERO\", " }
13277 !/^NSIG/ { printf "\"%s\", ", $1 }
13278 END { printf "0\n" }' signal.lst`
13279 sig_num_init=`$awk 'BEGIN { printf "0, " }
13280 !/^NSIG/ { printf "%d, ", $2}
13281 END { printf "0\n"}' signal.lst`
13284 echo "The following $sig_count signals are available:"
13286 echo $sig_name | $awk \
13287 'BEGIN { linelen = 0 }
13289 for (i = 1; i <= NF; i++) {
13290 name = "SIG" $i " "
13291 linelen = linelen + length(name)
13292 if (linelen > 70) {
13294 linelen = length(name)
13300 $rm -f signal signal.c signal.awk signal.lst signal_cmd
13302 : see what type is used for signed size_t
13303 set ssize_t ssizetype int stdio.h sys/types.h
13306 $cat > ssize.c <<EOM
13308 #include <sys/types.h>
13309 #define Size_t $sizetype
13310 #define SSize_t $dflt
13313 if (sizeof(Size_t) == sizeof(SSize_t))
13315 else if (sizeof(Size_t) == sizeof(int))
13324 if eval $compile_ok && ./ssize > /dev/null; then
13325 ssizetype=`./ssize`
13326 echo "I'll be using $ssizetype for functions returning a byte count." >&4
13329 Help! I can't compile and run the ssize_t test program: please enlighten me!
13330 (This is probably a misconfiguration in your system or libraries, and
13331 you really ought to fix it. Still, I'll try anyway.)
13333 I need a type that is the same size as $sizetype, but is guaranteed to
13334 be signed. Common values are ssize_t, int and long.
13337 rp="What signed type is the same size as $sizetype?"
13341 $rm -f ssize ssize.*
13343 : see what type of char stdio uses.
13345 if $contains 'unsigned.*char.*_ptr;' `./findhdr stdio.h` >/dev/null 2>&1 ; then
13346 echo "Your stdio uses unsigned chars." >&4
13347 stdchar="unsigned char"
13349 echo "Your stdio uses signed chars." >&4
13353 : see if time exists
13355 if test "X$d_time" = X -o X"$timetype" = X; then
13356 if set time val -f d_time; eval $csym; $val; then
13357 echo 'time() found.' >&4
13359 rp="What is the type returned by time() on this system?"
13360 set time_t timetype long stdio.h sys/types.h
13363 echo 'time() not found, hope that will do.' >&4
13371 : see what type uids are declared as in the kernel
13373 echo "Looking for the type for user ids returned by getuid()."
13374 set uid_t uidtype xxx stdio.h sys/types.h
13378 xxx=`./findhdr sys/user.h`
13379 set `grep '_ruid;' "$xxx" 2>/dev/null` unsigned short
13381 unsigned) dflt="$1 $2" ;;
13385 *) dflt="$uidtype";;
13388 uid_t) echo "uid_t found." ;;
13389 *) rp="What is the type for user ids returned by getuid()?"
13397 *_t) zzz="$uidtype" ;;
13400 echo "Checking the size of $zzz..." >&4
13402 #include <sys/types.h>
13405 printf("%d\n", (int)sizeof($uidtype));
13410 if eval $compile_ok; then
13414 echo "(I can't execute the test program--guessing $uidsize.)" >&4
13417 echo "Your $zzz size is $uidsize bytes."
13422 echo "(I can't compile the test program--guessing $uidsize.)" >&4
13427 *_t) zzz="$uidtype" ;;
13430 echo "Checking the sign of $zzz..." >&4
13432 #include <sys/types.h>
13443 if eval $compile; then
13447 echo "(I can't execute the test program--guessing unsigned.)" >&4
13451 1) echo "Your $zzz is unsigned." ;;
13452 -1) echo "Your $zzz is signed." ;;
13458 echo "(I can't compile the test program--guessing unsigned.)" >&4
13464 $echo "Checking the format string to be used for uids..." >&4
13467 -1) if $test X"$uidsize" = X"$ivsize"; then
13468 uidformat="$ivdformat"
13470 if $test X"$uidsize" = X"$longsize"; then
13473 if $test X"$uidsize" = X"$intsize"; then
13476 if $test X"$uidsize" = X"$shortsize"; then
13483 *) if $test X"$uidsize" = X"$uvsize"; then
13484 uidformat="$uvuformat"
13486 if $test X"$uidsize" = X"$longsize"; then
13489 if $test X"$uidsize" = X"$intsize"; then
13492 if $test X"$uidsize" = X"$shortsize"; then
13501 : see if dbm.h is available
13502 : see if dbmclose exists
13503 set dbmclose d_dbmclose
13506 case "$d_dbmclose" in
13516 *) set rpcsvc/dbm.h i_rpcsvcdbm
13521 *) echo "We won't be including <dbm.h>"
13531 : see if this is a sys/file.h system
13536 : do we need to include sys/file.h ?
13540 if $h_sysfile; then
13542 echo "We'll be including <sys/file.h>." >&4
13545 echo "We won't be including <sys/file.h>." >&4
13555 : see if fcntl.h is there
13560 : see if we can include fcntl.h
13566 echo "We'll be including <fcntl.h>." >&4
13569 if $h_sysfile; then
13570 echo "We don't need to include <fcntl.h> if we include <sys/file.h>." >&4
13572 echo "We won't be including <fcntl.h>." >&4
13584 : see if this is a iconv.h system
13585 set iconv.h i_iconv
13588 : see if locale.h is available
13589 set locale.h i_locale
13592 : see if mach cthreads are available
13593 if test "X$usethreads" = "X$define"; then
13594 set mach/cthreads.h i_machcthr
13597 i_machcthr="$undef"
13602 : see if this is a math.h system
13606 : see if this is a mntent.h system
13607 set mntent.h i_mntent
13610 : see if ndbm.h is available
13615 : see if dbm_open exists
13616 set dbm_open d_dbm_open
13618 case "$d_dbm_open" in
13621 echo "We won't be including <ndbm.h>"
13630 : see if net/errno.h is available
13632 set net/errno.h val
13635 : Unfortunately, it causes problems on some systems. Arrgh.
13638 cat > try.c <<'EOM'
13641 #include <net/errno.h>
13647 if $cc $ccflags -c try.c >/dev/null 2>&1; then
13648 echo "We'll be including <net/errno.h>." >&4
13650 echo "We won't be including <net/errno.h>." >&4
13659 : see if netinet/tcp.h is available
13660 set netinet/tcp.h i_netinettcp
13663 : see if this is a poll.h system
13668 $echo "Guessing which symbols your C compiler and preprocessor define..." >&4
13669 $cat <<'EOSH' > Cppsym.know
13670 a29k ABI64 aegis AES_SOURCE AIX AIX32 AIX370
13671 AIX41 AIX42 AIX43 AIX_SOURCE aixpc ALL_SOURCE
13672 alliant alpha am29000 AM29000 amiga AMIGAOS AMIX
13673 ansi ANSI_C_SOURCE apollo ardent atarist att386 att3b BeOS
13674 BIG_ENDIAN BIT_MSF bsd BSD bsd43 bsd4_2 bsd4_3 BSD4_3 bsd4_4
13675 BSD_4_3 BSD_4_4 BSD_NET2 BSD_TIME BSD_TYPES BSDCOMPAT bsdi
13676 bull c cadmus clipper CMU COFF COMPILER_VERSION
13677 concurrent convex cpu cray CRAY CRAYMPP ctix CX_UX
13678 CYGWIN DGUX DGUX_SOURCE DJGPP dmert DOLPHIN DPX2 DSO
13679 Dynix DynixPTX ELF encore EPI EXTENSIONS FILE_OFFSET_BITS
13680 FreeBSD GCC_NEW_VARARGS gcos gcx gimpel
13681 GNU_SOURCE GNUC GNUC_MINOR GO32 gould GOULD_PN
13682 H3050R H3050RX hbullx20 hcx host_mips
13683 hp200 hp300 hp700 HP700 hp800 hp9000
13684 hp9000s200 hp9000s300 hp9000s400 hp9000s500
13685 hp9000s700 hp9000s800 hp9k8 hp_osf hppa hpux HPUX_SOURCE
13686 i186 i286 i386 i486 i586 i686 i8086 i80960 i860 I960
13687 iAPX286 ibm ibm032 ibmesa IBMR2 ibmrt ILP32 ILP64
13688 INLINE_INTRINSICS INTRINSICS INT64 interdata is68k ksr1
13689 LANGUAGE_C LARGE_FILE_API LARGEFILE64_SOURCE
13690 LARGEFILE_SOURCE LFS64_LARGEFILE LFS_LARGEFILE
13691 Linux LITTLE_ENDIAN LONG64 LONG_DOUBLE LONG_LONG
13692 LONGDOUBLE LONGLONG LP64 luna luna88k Lynx
13693 M68000 m68k m88100 m88k M88KBCS_TARGET M_COFF
13694 M_I186 M_I286 M_I386 M_I8086 M_I86 M_I86SM M_SYS3
13695 M_SYS5 M_SYSIII M_SYSV M_UNIX M_XENIX MACH machine MachTen
13696 MATH_HAS_NO_SIDE_EFFECTS
13697 mc300 mc500 mc68000 mc68010 mc68020 mc68030 mc68040
13698 mc68060 mc68k mc68k32 mc700 mc88000 mc88100 merlin
13699 mert MiNT mips MIPS_FPSET MIPS_ISA MIPS_SIM MIPS_SZINT
13700 MIPS_SZLONG MIPS_SZPTR MIPSEB MIPSEL MODERN_C motorola
13701 mpeix MSDOS MTXINU MULTIMAX mvs MVS n16 ncl_el ncl_mr
13702 NetBSD news1500 news1700 news1800 news1900 news3700
13703 news700 news800 news900 NeXT NLS ns16000 ns32000
13704 ns32016 ns32332 ns32k nsc32000
13705 OCS88 OEMVS OpenBSD os OS2 OS390 osf OSF1 OSF_SOURCE
13706 pa_risc PA_RISC1_1 PA_RISC2_0 PARAGON parisc
13707 pc532 pdp11 PGC PIC plexus PORTAR posix
13708 POSIX1B_SOURCE POSIX2_SOURCE POSIX4_SOURCE
13709 POSIX_C_SOURCE POSIX_SOURCE POWER
13710 PROTOTYPES PWB pyr QNX R3000 REENTRANT RES Rhapsody RISC6000
13711 riscix riscos RT scs SCO sequent sgi SGI_SOURCE sinix
13712 SIZE_INT SIZE_LONG SIZE_PTR SOCKET_SOURCE SOCKETS_SOURCE
13713 sony sony_news sonyrisc sparc sparclite spectrum
13714 stardent stdc STDC_EXT stratos sun sun3 sun386
13715 Sun386i svr3 svr4 SVR4_2 SVR4_SOURCE svr5
13716 SX system SYSTYPE_BSD SYSTYPE_BSD43 SYSTYPE_BSD44
13717 SYSTYPE_SVR4 SYSTYPE_SVR5 SYSTYPE_SYSV SYSV SYSV3 SYSV4 SYSV5
13718 sysV68 sysV88 Tek4132 Tek4300 titan
13719 tower tower32 tower32_200 tower32_600 tower32_700
13720 tower32_800 tower32_850 tss
13721 u370 u3b u3b2 u3b20 u3b200 u3b20d u3b5
13722 ultrix UMAXV UnicomPBB UnicomPBD UNICOS UNICOSMK
13723 unix UNIX95 UNIX99 unixpc unos USGr4 USGr4_2
13724 Utek UTek UTS UWIN uxpm uxps vax venix VMESA vms xenix Xenix286
13725 XOPEN_SOURCE XOPEN_SOURCE_EXTENDED XPG2 XPG2_EXTENDED
13726 XPG3 XPG3_EXTENDED XPG4 XPG4_EXTENDED
13729 # Maybe put other stuff here too.
13730 cat <<EOSH >>Cppsym.know
13733 ./tr '[a-z]' '[A-Z]' < Cppsym.know > Cppsym.a
13734 ./tr '[A-Z]' '[a-z]' < Cppsym.know > Cppsym.b
13735 $cat Cppsym.a Cppsym.b | $tr ' ' $trnl | sort | uniq > Cppsym.know
13736 $rm -f Cppsym.a Cppsym.b
13737 cat <<EOSH > Cppsym
13739 if $test \$# -gt 0; then
13740 echo \$* | $tr " " "$trnl" | ./Cppsym.try > Cppsym.got
13741 if $test -s Cppsym.got; then
13748 $tr " " "$trnl" | ./Cppsym.try
13754 cat <<EOSH > Cppsym.try
13756 cat <<'EOCP' > try.c
13762 cat <<'EOSH' >> Cppsym.try
13764 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
13765 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
13766 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
13767 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
13771 cat <<EOSH >> Cppsym.try
13773 optimize="$optimize"
13778 $cc $optimize $ccflags $ldflags -o try$exe_ext try.c $libs && ./try$exe_ext
13780 chmod +x Cppsym.try
13781 $eunicefix Cppsym.try
13782 ./Cppsym < Cppsym.know > Cppsym.true
13783 : now check the C compiler for additional symbols
13784 postprocess_cc_v=''
13786 aix) postprocess_cc_v="|$tr , ' '" ;;
13793 for i in \`$cc -v -c tmp.c 2>&1 $postprocess_cc_v\`
13796 -D*) echo "\$i" | $sed 's/^-D//';;
13797 -A*) $test "$gccversion" && echo "\$i" | $sed 's/^-A\(.*\)(\(.*\))/\1=\2/';;
13802 postprocess_cc_v=''
13805 ./ccsym > ccsym1.raw
13806 if $test -s ccsym1.raw; then
13807 $sort ccsym1.raw | $uniq >ccsym.raw
13809 mv ccsym1.raw ccsym.raw
13812 $awk '/\=/ { print $0; next }
13813 { print $0"=1" }' ccsym.raw >ccsym.list
13814 $awk '/\=/ { print $0; next }
13815 { print $0"=1" }' Cppsym.true >ccsym.true
13816 $comm -13 ccsym.true ccsym.list >ccsym.own
13817 $comm -12 ccsym.true ccsym.list >ccsym.com
13818 $comm -23 ccsym.true ccsym.list >ccsym.cpp
13820 if $test -z ccsym.raw; then
13821 echo "Your C compiler doesn't seem to define any symbols!" >&4
13823 echo "However, your C preprocessor defines the following symbols:"
13826 cppsymbols=`$cat Cppsym.true`
13827 cppsymbols=`echo $cppsymbols`
13828 cppccsymbols="$cppsymbols"
13830 if $test -s ccsym.com; then
13831 echo "Your C compiler and pre-processor define these symbols:"
13832 $sed -e 's/\(.*\)=.*/\1/' ccsym.com
13835 cppccsymbols=`$cat ccsym.com`
13836 cppccsymbols=`echo $cppccsymbols`
13837 $test "$silent" || sleep 1
13839 if $test -s ccsym.cpp; then
13840 $test "$also" && echo " "
13841 echo "Your C pre-processor ${also}defines the following symbols:"
13842 $sed -e 's/\(.*\)=.*/\1/' ccsym.cpp
13844 cppsymbols=`$cat ccsym.cpp`
13845 cppsymbols=`echo $cppsymbols`
13846 $test "$silent" || sleep 1
13848 if $test -s ccsym.own; then
13849 $test "$also" && echo " "
13850 echo "Your C compiler ${also}defines the following cpp symbols:"
13851 $sed -e 's/\(.*\)=1/\1/' ccsym.own
13852 $sed -e 's/\(.*\)=.*/\1/' ccsym.own | $uniq >>Cppsym.true
13853 ccsymbols=`$cat ccsym.own`
13854 ccsymbols=`echo $ccsymbols`
13855 $test "$silent" || sleep 1
13860 : see if this is a termio system
13864 if $test `./findhdr termios.h`; then
13865 set tcsetattr i_termios
13871 "$define") echo "You have POSIX termios.h... good!" >&4;;
13872 *) if ./Cppsym pyr; then
13873 case "`/bin/universe`" in
13874 ucb) if $test `./findhdr sgtty.h`; then
13876 echo "<sgtty.h> found." >&4
13878 echo "System is pyramid with BSD universe."
13879 echo "<sgtty.h> not found--you could have problems." >&4
13881 *) if $test `./findhdr termio.h`; then
13883 echo "<termio.h> found." >&4
13885 echo "System is pyramid with USG universe."
13886 echo "<termio.h> not found--you could have problems." >&4
13890 if $test `./findhdr termio.h`; then
13891 echo "<termio.h> found." >&4
13893 elif $test `./findhdr sgtty.h`; then
13894 echo "<sgtty.h> found." >&4
13897 echo "Neither <termio.h> nor <sgtty.h> found--you could have problems." >&4
13900 if $test `./findhdr sgtty.h`; then
13901 echo "<sgtty.h> found." >&4
13903 elif $test `./findhdr termio.h`; then
13904 echo "<termio.h> found." >&4
13907 echo "Neither <sgtty.h> nor <termio.h> found--you could have problems." >&4
13911 set i_termio; eval $setvar
13912 val=$val2; set i_sgtty; eval $setvar
13913 val=$val3; set i_termios; eval $setvar
13915 : see if this is a shadow.h system
13916 set shadow.h i_shadow
13919 : see if this is a socks.h system
13920 set socks.h i_socks
13923 : see if stdarg is available
13925 if $test `./findhdr stdarg.h`; then
13926 echo "<stdarg.h> found." >&4
13929 echo "<stdarg.h> NOT found." >&4
13933 : see if varags is available
13935 if $test `./findhdr varargs.h`; then
13936 echo "<varargs.h> found." >&4
13938 echo "<varargs.h> NOT found, but that's ok (I hope)." >&4
13941 : set up the varargs testing programs
13942 $cat > varargs.c <<EOP
13944 #include <stdarg.h>
13947 #include <varargs.h>
13951 int f(char *p, ...)
13965 p = va_arg(ap, char *);
13970 $cat > varargs <<EOP
13972 if $cc -c $ccflags -D\$1 varargs.c >/dev/null 2>&1; then
13981 : now check which varargs header should be included
13986 if `./varargs I_STDARG`; then
13988 elif `./varargs I_VARARGS`; then
13993 if `./varargs I_VARARGS`; then
14000 echo "I could not find the definition for va_dcl... You have problems..." >&4
14001 val="$undef"; set i_stdarg; eval $setvar
14002 val="$undef"; set i_varargs; eval $setvar
14007 case "$i_varhdr" in
14009 val="$define"; set i_stdarg; eval $setvar
14010 val="$undef"; set i_varargs; eval $setvar
14013 val="$undef"; set i_stdarg; eval $setvar
14014 val="$define"; set i_varargs; eval $setvar
14017 echo "We'll include <$i_varhdr> to get va_dcl definition." >&4;;
14021 : see if stddef is available
14022 set stddef.h i_stddef
14025 : see if sys/access.h is available
14026 set sys/access.h i_sysaccess
14029 : see if ioctl defs are in sgtty, termio, sys/filio or sys/ioctl
14030 set sys/filio.h i_sysfilio
14033 if $test `./findhdr sys/ioctl.h`; then
14035 echo '<sys/ioctl.h> found.' >&4
14038 if $test $i_sysfilio = "$define"; then
14039 echo '<sys/ioctl.h> NOT found.' >&4
14041 $test $i_sgtty = "$define" && xxx="sgtty.h"
14042 $test $i_termio = "$define" && xxx="termio.h"
14043 $test $i_termios = "$define" && xxx="termios.h"
14044 echo "No <sys/ioctl.h> found, assuming ioctl args are defined in <$xxx>." >&4
14050 : see if sys/resource.h has to be included
14051 set sys/resource.h i_sysresrc
14054 : see if sys/security.h is available
14055 set sys/security.h i_syssecrt
14058 : see if this is a sys/statvfs.h system
14059 set sys/statvfs.h i_sysstatvfs
14062 : see if this is a sys/uio.h system
14063 set sys/uio.h i_sysuio
14066 : see if this is a sys/un.h system
14067 set sys/un.h i_sysun
14070 : see if this is a syswait system
14071 set sys/wait.h i_syswait
14074 : see if this is a ustat.h system
14075 set ustat.h i_ustat
14078 : see if this is an utime system
14079 set utime.h i_utime
14082 : see if this is a values.h system
14083 set values.h i_values
14086 : see if this is a vfork system
14089 set vfork.h i_vfork
14097 : see if gdbm.h is available
14102 : see if gdbm_open exists
14103 set gdbm_open d_gdbm_open
14105 case "$d_gdbm_open" in
14108 echo "We won't be including <gdbm.h>"
14118 echo "Looking for extensions..." >&4
14119 : If we are using the old config.sh, known_extensions may contain
14120 : old or inaccurate or duplicate values.
14121 known_extensions=''
14122 nonxs_extensions=''
14123 : We do not use find because it might not be available.
14124 : We do not just use MANIFEST because the user may have dropped
14125 : some additional extensions into the source tree and expect them
14128 : Function to recursively find available extensions, ignoring DynaLoader
14129 : NOTE: recursion limit of 10 to prevent runaway in case of symlink madness
14133 DynaLoader|dynaload) ;;
14135 if $test -f $xxx/$xxx.xs; then
14136 known_extensions="$known_extensions $1$xxx";
14137 elif $test -f $xxx/Makefile.PL; then
14138 nonxs_extensions="$nonxs_extensions $1$xxx";
14140 if $test -d $xxx -a $# -lt 10; then
14143 eval $find_extensions;
14155 eval $find_extensions
14156 set X $nonxs_extensions
14158 nonxs_extensions="$*"
14159 set X $known_extensions
14161 known_extensions="$*"
14164 : Now see which are supported on this system.
14166 for xxx in $known_extensions ; do
14170 $define) avail_ext="$avail_ext $xxx" ;;
14173 GDBM_File|gdbm_fil)
14175 $define) avail_ext="$avail_ext $xxx" ;;
14178 NDBM_File|ndbm_fil)
14180 $define) avail_ext="$avail_ext $xxx" ;;
14183 ODBM_File|odbm_fil)
14184 case "${i_dbm}${i_rpcsvcdbm}" in
14185 *"${define}"*) avail_ext="$avail_ext $xxx" ;;
14189 case "$useposix" in
14190 true|define|y) avail_ext="$avail_ext $xxx" ;;
14194 case "$useopcode" in
14195 true|define|y) avail_ext="$avail_ext $xxx" ;;
14199 case "$d_socket" in
14200 true|$define|y) avail_ext="$avail_ext $xxx" ;;
14204 case "$usethreads" in
14205 true|$define|y) avail_ext="$avail_ext $xxx" ;;
14209 : XXX Do we need a useipcsysv variable here
14210 case "${d_msg}${d_sem}${d_shm}" in
14211 *"${define}"*) avail_ext="$avail_ext $xxx" ;;
14214 *) avail_ext="$avail_ext $xxx"
14223 : Now see which nonxs extensions are supported on this system.
14224 : For now assume all are.
14226 for xxx in $nonxs_extensions ; do
14228 *) nonxs_ext="$nonxs_ext $xxx"
14240 A number of extensions are supplied with $package. You may choose to
14241 compile these extensions for dynamic loading (the default), compile
14242 them into the $package executable (static loading), or not include
14243 them at all. Answer "none" to include no extensions.
14244 Note that DynaLoader is always built and need not be mentioned here.
14247 case "$dynamic_ext" in
14248 '') dflt="$avail_ext" ;;
14249 *) dflt="$dynamic_ext"
14250 # Perhaps we are reusing an old out-of-date config.sh.
14253 if test X"$dynamic_ext" != X"$avail_ext"; then
14255 NOTICE: Your previous config.sh list may be incorrect.
14256 The extensions now available to you are
14258 but the default list from your previous config.sh is
14270 rp="What extensions do you wish to load dynamically?"
14273 none) dynamic_ext=' ' ;;
14274 *) dynamic_ext="$ans" ;;
14277 case "$static_ext" in
14279 : Exclude those already listed in dynamic linking
14281 for xxx in $avail_ext; do
14282 case " $dynamic_ext " in
14284 *) dflt="$dflt $xxx" ;;
14291 *) dflt="$static_ext"
14298 rp="What extensions do you wish to load statically?"
14301 none) static_ext=' ' ;;
14302 *) static_ext="$ans" ;;
14307 A number of extensions are supplied with $package. Answer "none"
14308 to include no extensions.
14309 Note that DynaLoader is always built and need not be mentioned here.
14312 case "$static_ext" in
14313 '') dflt="$avail_ext" ;;
14314 *) dflt="$static_ext"
14315 # Perhaps we are reusing an old out-of-date config.sh.
14318 if test X"$static_ext" != X"$avail_ext"; then
14320 NOTICE: Your previous config.sh list may be incorrect.
14321 The extensions now available to you are
14323 but the default list from your previous config.sh is
14332 : Exclude those that are not xs extensions
14336 rp="What extensions do you wish to include?"
14339 none) static_ext=' ' ;;
14340 *) static_ext="$ans" ;;
14345 set X $dynamic_ext $static_ext $nonxs_ext
14349 : Remove build directory name from cppstdin so it can be used from
14350 : either the present location or the final installed location.
14352 : Get out of the UU directory to get correct path name.
14354 case "$cppstdin" in
14356 echo "Stripping down cppstdin path name"
14362 : end of configuration questions
14364 echo "End of configuration questions."
14367 : back to where it started
14368 if test -d ../UU; then
14372 : configuration may be patched via a 'config.over' file
14373 if $test -f config.over; then
14376 rp='I see a config.over file. Do you wish to load it?'
14379 n*) echo "OK, I'll ignore it.";;
14381 echo "Configuration override changes have been loaded."
14386 : in case they want portability, strip down executable paths
14387 case "$d_portable" in
14390 echo "Stripping down executable paths..." >&4
14391 for file in $loclist $trylist; do
14393 eval $file=`basename $temp`
14398 : create config.sh file
14400 echo "Creating config.sh..." >&4
14401 $spitshell <<EOT >config.sh
14404 # This file was produced by running the Configure script. It holds all the
14405 # definitions figured out by Configure. Should you modify one of these values,
14406 # do not forget to propagate your changes by running "Configure -der". You may
14407 # instead choose to run each of the .SH files by yourself, or "Configure -S".
14410 # Package name : $package
14411 # Source directory : $src
14412 # Configuration time: $cf_time
14413 # Configured by : $cf_by
14414 # Target system : $myuname
14424 Revision='$Revision'
14431 alignbytes='$alignbytes'
14432 ansi2knr='$ansi2knr'
14433 aphostname='$aphostname'
14434 api_revision='$api_revision'
14435 api_subversion='$api_subversion'
14436 api_version='$api_version'
14437 api_versionstring='$api_versionstring'
14440 archlibexp='$archlibexp'
14441 archname64='$archname64'
14442 archname='$archname'
14443 archobjs='$archobjs'
14448 bincompat5005='$bincompat5005'
14452 byteorder='$byteorder'
14454 castflags='$castflags'
14457 cccdlflags='$cccdlflags'
14458 ccdlflags='$ccdlflags'
14460 ccsymbols='$ccsymbols'
14462 cf_email='$cf_email'
14464 charsize='$charsize'
14468 clocktype='$clocktype'
14470 compress='$compress'
14471 contains='$contains'
14475 cpp_stuff='$cpp_stuff'
14476 cppccsymbols='$cppccsymbols'
14477 cppflags='$cppflags'
14479 cppminus='$cppminus'
14481 cppstdin='$cppstdin'
14482 cppsymbols='$cppsymbols'
14483 crosscompile='$crosscompile'
14484 cryptlib='$cryptlib'
14486 d_Gconvert='$d_Gconvert'
14487 d_PRIEldbl='$d_PRIEldbl'
14488 d_PRIFldbl='$d_PRIFldbl'
14489 d_PRIGldbl='$d_PRIGldbl'
14490 d_PRIX64='$d_PRIX64'
14491 d_PRId64='$d_PRId64'
14492 d_PRIeldbl='$d_PRIeldbl'
14493 d_PRIfldbl='$d_PRIfldbl'
14494 d_PRIgldbl='$d_PRIgldbl'
14495 d_PRIi64='$d_PRIi64'
14496 d_PRIo64='$d_PRIo64'
14497 d_PRIu64='$d_PRIu64'
14498 d_PRIx64='$d_PRIx64'
14499 d_access='$d_access'
14500 d_accessx='$d_accessx'
14502 d_archlib='$d_archlib'
14505 d_attribut='$d_attribut'
14508 d_bincompat5005='$d_bincompat5005'
14510 d_bsdgetpgrp='$d_bsdgetpgrp'
14511 d_bsdsetpgrp='$d_bsdsetpgrp'
14513 d_casti32='$d_casti32'
14514 d_castneg='$d_castneg'
14515 d_charvspr='$d_charvspr'
14517 d_chroot='$d_chroot'
14518 d_chsize='$d_chsize'
14519 d_closedir='$d_closedir'
14523 d_cuserid='$d_cuserid'
14524 d_dbl_dig='$d_dbl_dig'
14525 d_difftime='$d_difftime'
14526 d_dirnamlen='$d_dirnamlen'
14527 d_dlerror='$d_dlerror'
14528 d_dlopen='$d_dlopen'
14529 d_dlsymun='$d_dlsymun'
14530 d_dosuid='$d_dosuid'
14531 d_drand48proto='$d_drand48proto'
14533 d_eaccess='$d_eaccess'
14534 d_endgrent='$d_endgrent'
14535 d_endhent='$d_endhent'
14536 d_endnent='$d_endnent'
14537 d_endpent='$d_endpent'
14538 d_endpwent='$d_endpwent'
14539 d_endsent='$d_endsent'
14540 d_endspent='$d_endspent'
14541 d_eofnblk='$d_eofnblk'
14542 d_eunice='$d_eunice'
14543 d_fchmod='$d_fchmod'
14544 d_fchown='$d_fchown'
14546 d_fd_macros='$d_fd_macros'
14547 d_fd_set='$d_fd_set'
14548 d_fds_bits='$d_fds_bits'
14549 d_fgetpos='$d_fgetpos'
14550 d_flexfnam='$d_flexfnam'
14553 d_fpathconf='$d_fpathconf'
14554 d_fpos64_t='$d_fpos64_t'
14555 d_fs_data_s='$d_fs_data_s'
14556 d_fseeko='$d_fseeko'
14557 d_fsetpos='$d_fsetpos'
14558 d_fstatfs='$d_fstatfs'
14559 d_fstatvfs='$d_fstatvfs'
14560 d_ftello='$d_ftello'
14562 d_getgrent='$d_getgrent'
14563 d_getgrps='$d_getgrps'
14564 d_gethbyaddr='$d_gethbyaddr'
14565 d_gethbyname='$d_gethbyname'
14566 d_gethent='$d_gethent'
14567 d_gethname='$d_gethname'
14568 d_gethostprotos='$d_gethostprotos'
14569 d_getlogin='$d_getlogin'
14570 d_getmnt='$d_getmnt'
14571 d_getmntent='$d_getmntent'
14572 d_getnbyaddr='$d_getnbyaddr'
14573 d_getnbyname='$d_getnbyname'
14574 d_getnent='$d_getnent'
14575 d_getnetprotos='$d_getnetprotos'
14576 d_getpbyname='$d_getpbyname'
14577 d_getpbynumber='$d_getpbynumber'
14578 d_getpent='$d_getpent'
14579 d_getpgid='$d_getpgid'
14580 d_getpgrp2='$d_getpgrp2'
14581 d_getpgrp='$d_getpgrp'
14582 d_getppid='$d_getppid'
14583 d_getprior='$d_getprior'
14584 d_getprotoprotos='$d_getprotoprotos'
14585 d_getpwent='$d_getpwent'
14586 d_getsbyname='$d_getsbyname'
14587 d_getsbyport='$d_getsbyport'
14588 d_getsent='$d_getsent'
14589 d_getservprotos='$d_getservprotos'
14590 d_getspent='$d_getspent'
14591 d_getspnam='$d_getspnam'
14592 d_gettimeod='$d_gettimeod'
14593 d_gnulibc='$d_gnulibc'
14594 d_grpasswd='$d_grpasswd'
14595 d_hasmntopt='$d_hasmntopt'
14599 d_inetaton='$d_inetaton'
14600 d_int64t='$d_int64t'
14601 d_isascii='$d_isascii'
14602 d_killpg='$d_killpg'
14603 d_lchown='$d_lchown'
14604 d_ldbl_dig='$d_ldbl_dig'
14606 d_locconv='$d_locconv'
14608 d_longdbl='$d_longdbl'
14609 d_longlong='$d_longlong'
14612 d_mbstowcs='$d_mbstowcs'
14613 d_mbtowc='$d_mbtowc'
14614 d_memchr='$d_memchr'
14615 d_memcmp='$d_memcmp'
14616 d_memcpy='$d_memcpy'
14617 d_memmove='$d_memmove'
14618 d_memset='$d_memset'
14620 d_mkfifo='$d_mkfifo'
14621 d_mktime='$d_mktime'
14623 d_msg_ctrunc='$d_msg_ctrunc'
14624 d_msg_dontroute='$d_msg_dontroute'
14625 d_msg_oob='$d_msg_oob'
14626 d_msg_peek='$d_msg_peek'
14627 d_msg_proxy='$d_msg_proxy'
14628 d_msgctl='$d_msgctl'
14629 d_msgget='$d_msgget'
14630 d_msgrcv='$d_msgrcv'
14631 d_msgsnd='$d_msgsnd'
14632 d_mymalloc='$d_mymalloc'
14634 d_nv_preserves_uv='$d_nv_preserves_uv'
14635 d_off64_t='$d_off64_t'
14636 d_old_pthread_create_joinable='$d_old_pthread_create_joinable'
14637 d_oldpthreads='$d_oldpthreads'
14638 d_oldsock='$d_oldsock'
14640 d_pathconf='$d_pathconf'
14642 d_phostname='$d_phostname'
14645 d_portable='$d_portable'
14646 d_pthread_yield='$d_pthread_yield'
14648 d_pwchange='$d_pwchange'
14649 d_pwclass='$d_pwclass'
14650 d_pwcomment='$d_pwcomment'
14651 d_pwexpire='$d_pwexpire'
14652 d_pwgecos='$d_pwgecos'
14653 d_pwpasswd='$d_pwpasswd'
14654 d_pwquota='$d_pwquota'
14656 d_readdir='$d_readdir'
14657 d_readlink='$d_readlink'
14658 d_rename='$d_rename'
14659 d_rewinddir='$d_rewinddir'
14661 d_safebcpy='$d_safebcpy'
14662 d_safemcpy='$d_safemcpy'
14663 d_sanemcmp='$d_sanemcmp'
14664 d_sched_yield='$d_sched_yield'
14665 d_scm_rights='$d_scm_rights'
14666 d_seekdir='$d_seekdir'
14667 d_select='$d_select'
14669 d_semctl='$d_semctl'
14670 d_semctl_semid_ds='$d_semctl_semid_ds'
14671 d_semctl_semun='$d_semctl_semun'
14672 d_semget='$d_semget'
14674 d_setegid='$d_setegid'
14675 d_seteuid='$d_seteuid'
14676 d_setgrent='$d_setgrent'
14677 d_setgrps='$d_setgrps'
14678 d_sethent='$d_sethent'
14679 d_setlinebuf='$d_setlinebuf'
14680 d_setlocale='$d_setlocale'
14681 d_setnent='$d_setnent'
14682 d_setpent='$d_setpent'
14683 d_setpgid='$d_setpgid'
14684 d_setpgrp2='$d_setpgrp2'
14685 d_setpgrp='$d_setpgrp'
14686 d_setprior='$d_setprior'
14687 d_setpwent='$d_setpwent'
14688 d_setregid='$d_setregid'
14689 d_setresgid='$d_setresgid'
14690 d_setresuid='$d_setresuid'
14691 d_setreuid='$d_setreuid'
14692 d_setrgid='$d_setrgid'
14693 d_setruid='$d_setruid'
14694 d_setsent='$d_setsent'
14695 d_setsid='$d_setsid'
14696 d_setspent='$d_setspent'
14697 d_setvbuf='$d_setvbuf'
14701 d_shmatprototype='$d_shmatprototype'
14702 d_shmctl='$d_shmctl'
14704 d_shmget='$d_shmget'
14705 d_sigaction='$d_sigaction'
14706 d_sigsetjmp='$d_sigsetjmp'
14707 d_socket='$d_socket'
14708 d_sockpair='$d_sockpair'
14710 d_statblks='$d_statblks'
14711 d_statfs_f_flags='$d_statfs_f_flags'
14712 d_statfs_s='$d_statfs_s'
14713 d_statvfs='$d_statvfs'
14714 d_stdio_cnt_lval='$d_stdio_cnt_lval'
14715 d_stdio_ptr_lval='$d_stdio_ptr_lval'
14716 d_stdio_stream_array='$d_stdio_stream_array'
14717 d_stdiobase='$d_stdiobase'
14718 d_stdstdio='$d_stdstdio'
14719 d_strchr='$d_strchr'
14720 d_strcoll='$d_strcoll'
14721 d_strctcpy='$d_strctcpy'
14722 d_strerrm='$d_strerrm'
14723 d_strerror='$d_strerror'
14724 d_strtod='$d_strtod'
14725 d_strtol='$d_strtol'
14726 d_strtold='$d_strtold'
14727 d_strtoll='$d_strtoll'
14728 d_strtoul='$d_strtoul'
14729 d_strtoull='$d_strtoull'
14730 d_strtouq='$d_strtouq'
14731 d_strxfrm='$d_strxfrm'
14732 d_suidsafe='$d_suidsafe'
14733 d_symlink='$d_symlink'
14734 d_syscall='$d_syscall'
14735 d_sysconf='$d_sysconf'
14736 d_sysernlst='$d_sysernlst'
14737 d_syserrlst='$d_syserrlst'
14738 d_system='$d_system'
14739 d_tcgetpgrp='$d_tcgetpgrp'
14740 d_tcsetpgrp='$d_tcsetpgrp'
14741 d_telldir='$d_telldir'
14742 d_telldirproto='$d_telldirproto'
14745 d_truncate='$d_truncate'
14746 d_tzname='$d_tzname'
14749 d_union_semun='$d_union_semun'
14751 d_vendorbin='$d_vendorbin'
14752 d_vendorlib='$d_vendorlib'
14754 d_void_closedir='$d_void_closedir'
14755 d_voidsig='$d_voidsig'
14756 d_voidtty='$d_voidtty'
14757 d_volatile='$d_volatile'
14758 d_vprintf='$d_vprintf'
14760 d_waitpid='$d_waitpid'
14761 d_wcstombs='$d_wcstombs'
14762 d_wctomb='$d_wctomb'
14765 db_hashtype='$db_hashtype'
14766 db_prefixtype='$db_prefixtype'
14767 defvoidused='$defvoidused'
14768 direntrytype='$direntrytype'
14771 doublesize='$doublesize'
14773 dynamic_ext='$dynamic_ext'
14779 eunicefix='$eunicefix'
14782 extensions='$extensions'
14783 fflushNULL='$fflushNULL'
14784 fflushall='$fflushall'
14786 firstmakefile='$firstmakefile'
14788 fpossize='$fpossize'
14789 fpostype='$fpostype'
14790 freetype='$freetype'
14792 full_csh='$full_csh'
14793 full_sed='$full_sed'
14794 gccversion='$gccversion'
14795 gidformat='$gidformat'
14801 groupcat='$groupcat'
14802 groupstype='$groupstype'
14805 h_sysfile='$h_sysfile'
14817 i_arpainet='$i_arpainet'
14818 i_bsdioctl='$i_bsdioctl'
14821 i_dirent='$i_dirent'
14829 i_inttypes='$i_inttypes'
14830 i_limits='$i_limits'
14831 i_locale='$i_locale'
14832 i_machcthr='$i_machcthr'
14833 i_malloc='$i_malloc'
14835 i_memory='$i_memory'
14836 i_mntent='$i_mntent'
14839 i_neterrno='$i_neterrno'
14840 i_netinettcp='$i_netinettcp'
14843 i_pthread='$i_pthread'
14845 i_rpcsvcdbm='$i_rpcsvcdbm'
14848 i_shadow='$i_shadow'
14850 i_stdarg='$i_stdarg'
14851 i_stddef='$i_stddef'
14852 i_stdlib='$i_stdlib'
14853 i_string='$i_string'
14854 i_sysaccess='$i_sysaccess'
14855 i_sysdir='$i_sysdir'
14856 i_sysfile='$i_sysfile'
14857 i_sysfilio='$i_sysfilio'
14859 i_sysioctl='$i_sysioctl'
14860 i_sysmount='$i_sysmount'
14861 i_sysndir='$i_sysndir'
14862 i_sysparam='$i_sysparam'
14863 i_sysresrc='$i_sysresrc'
14864 i_syssecrt='$i_syssecrt'
14865 i_sysselct='$i_sysselct'
14866 i_syssockio='$i_syssockio'
14867 i_sysstat='$i_sysstat'
14868 i_sysstatfs='$i_sysstatfs'
14869 i_sysstatvfs='$i_sysstatvfs'
14870 i_systime='$i_systime'
14871 i_systimek='$i_systimek'
14872 i_systimes='$i_systimes'
14873 i_systypes='$i_systypes'
14874 i_sysuio='$i_sysuio'
14876 i_sysvfs='$i_sysvfs'
14877 i_syswait='$i_syswait'
14878 i_termio='$i_termio'
14879 i_termios='$i_termios'
14881 i_unistd='$i_unistd'
14884 i_values='$i_values'
14885 i_varargs='$i_varargs'
14886 i_varhdr='$i_varhdr'
14888 ignore_versioned_solibs='$ignore_versioned_solibs'
14889 inc_version_list='$inc_version_list'
14890 inc_version_list_init='$inc_version_list_init'
14893 installarchlib='$installarchlib'
14894 installbin='$installbin'
14895 installman1dir='$installman1dir'
14896 installman3dir='$installman3dir'
14897 installprefix='$installprefix'
14898 installprefixexp='$installprefixexp'
14899 installprivlib='$installprivlib'
14900 installscript='$installscript'
14901 installsitearch='$installsitearch'
14902 installsitebin='$installsitebin'
14903 installsitelib='$installsitelib'
14904 installstyle='$installstyle'
14905 installusrbinperl='$installusrbinperl'
14906 installvendorbin='$installvendorbin'
14907 installvendorlib='$installvendorlib'
14909 ivdformat='$ivdformat'
14912 known_extensions='$known_extensions'
14916 lddlflags='$lddlflags'
14918 ldlibpthname='$ldlibpthname'
14925 libsdirs='$libsdirs'
14926 libsfiles='$libsfiles'
14927 libsfound='$libsfound'
14928 libswanted='$libswanted'
14934 locincpth='$locincpth'
14935 loclibpth='$loclibpth'
14936 longdblsize='$longdblsize'
14937 longlongsize='$longlongsize'
14938 longsize='$longsize'
14942 lseeksize='$lseeksize'
14943 lseektype='$lseektype'
14947 make_set_make='$make_set_make'
14948 mallocobj='$mallocobj'
14949 mallocsrc='$mallocsrc'
14950 malloctype='$malloctype'
14952 man1direxp='$man1direxp'
14955 man3direxp='$man3direxp'
14958 mips_type='$mips_type'
14961 modetype='$modetype'
14963 multiarch='$multiarch'
14965 myarchname='$myarchname'
14966 mydomain='$mydomain'
14967 myhostname='$myhostname'
14970 netdb_hlen_type='$netdb_hlen_type'
14971 netdb_host_type='$netdb_host_type'
14972 netdb_name_type='$netdb_name_type'
14973 netdb_net_type='$netdb_net_type'
14976 nm_so_opt='$nm_so_opt'
14977 nonxs_ext='$nonxs_ext'
14981 o_nonblock='$o_nonblock'
14983 old_pthread_create_joinable='$old_pthread_create_joinable'
14984 optimize='$optimize'
14985 orderlib='$orderlib'
14991 patchlevel='$patchlevel'
14992 path_sep='$path_sep'
14994 perladmin='$perladmin'
14995 perlpath='$perlpath'
14997 phostname='$phostname'
15003 prefixexp='$prefixexp'
15005 privlibexp='$privlibexp'
15006 prototype='$prototype'
15008 quadkind='$quadkind'
15009 quadtype='$quadtype'
15010 randbits='$randbits'
15011 randfunc='$randfunc'
15012 randseedtype='$randseedtype'
15014 rd_nodata='$rd_nodata'
15018 sPRIEldbl='$sPRIEldbl'
15019 sPRIFldbl='$sPRIFldbl'
15020 sPRIGldbl='$sPRIGldbl'
15023 sPRIeldbl='$sPRIeldbl'
15024 sPRIfldbl='$sPRIfldbl'
15025 sPRIgldbl='$sPRIgldbl'
15030 sched_yield='$sched_yield'
15031 scriptdir='$scriptdir'
15032 scriptdirexp='$scriptdirexp'
15034 seedfunc='$seedfunc'
15035 selectminbits='$selectminbits'
15036 selecttype='$selecttype'
15037 sendmail='$sendmail'
15040 sharpbang='$sharpbang'
15041 shmattype='$shmattype'
15042 shortsize='$shortsize'
15045 sig_count='$sig_count'
15046 sig_name='$sig_name'
15047 sig_name_init='$sig_name_init'
15049 sig_num_init='$sig_num_init'
15050 signal_t='$signal_t'
15051 sitearch='$sitearch'
15052 sitearchexp='$sitearchexp'
15054 sitebinexp='$sitebinexp'
15056 sitelibexp='$sitelibexp'
15057 siteprefix='$siteprefix'
15058 siteprefixexp='$siteprefixexp'
15059 sizetype='$sizetype'
15064 sockethdr='$sockethdr'
15065 socketlib='$socketlib'
15067 spackage='$spackage'
15068 spitshell='$spitshell'
15071 ssizetype='$ssizetype'
15072 startperl='$startperl'
15074 static_ext='$static_ext'
15076 stdio_base='$stdio_base'
15077 stdio_bufsiz='$stdio_bufsiz'
15078 stdio_cnt='$stdio_cnt'
15079 stdio_filbuf='$stdio_filbuf'
15080 stdio_ptr='$stdio_ptr'
15081 stdio_stream_array='$stdio_stream_array'
15084 subversion='$subversion'
15091 timeincl='$timeincl'
15092 timetype='$timetype'
15105 uidformat='$uidformat'
15111 uquadtype='$uquadtype'
15112 use5005threads='$use5005threads'
15113 use64bits='$use64bits'
15115 useithreads='$useithreads'
15116 uselargefiles='$uselargefiles'
15117 uselongdouble='$uselongdouble'
15118 uselonglong='$uselonglong'
15119 usemorebits='$usemorebits'
15120 usemultiplicity='$usemultiplicity'
15121 usemymalloc='$usemymalloc'
15123 useopcode='$useopcode'
15124 useperlio='$useperlio'
15125 useposix='$useposix'
15127 useshrplib='$useshrplib'
15128 usesocks='$usesocks'
15129 usethreads='$usethreads'
15130 usevendorprefix='$usevendorprefix'
15131 usevfork='$usevfork'
15134 uvoformat='$uvoformat'
15137 uvuformat='$uvuformat'
15138 uvxformat='$uvxformat'
15139 vendorbin='$vendorbin'
15140 vendorbinexp='$vendorbinexp'
15141 vendorlib='$vendorlib'
15142 vendorlibexp='$vendorlibexp'
15143 vendorprefix='$vendorprefix'
15144 vendorprefixexp='$vendorprefixexp'
15147 voidflags='$voidflags'
15153 : Add in command line options if available
15154 $test -f UU/cmdline.opt && $cat UU/cmdline.opt >> config.sh
15156 : add special variables
15157 $test -f $src/patchlevel.h && \
15158 awk '/^#define[ ]+PERL_/ {printf "%s=%s\n",$2,$3}' $src/patchlevel.h >>config.sh
15159 echo "CONFIGDOTSH=true" >>config.sh
15161 : propagate old symbols
15162 if $test -f UU/config.sh; then
15163 <UU/config.sh sort | uniq >UU/oldconfig.sh
15164 sed -n 's/^\([a-zA-Z_0-9]*\)=.*/\1/p' config.sh config.sh UU/oldconfig.sh |\
15165 sort | uniq -u >UU/oldsyms
15166 set X `cat UU/oldsyms`
15172 Hmm...You had some extra variables I don't know about...I'll try to keep 'em...
15174 echo "# Variables propagated from previous config.sh file." >>config.sh
15175 for sym in `cat UU/oldsyms`; do
15176 echo " Propagating $hint variable "'$'"$sym..."
15177 eval 'tmp="$'"${sym}"'"'
15179 sed -e "s/'/'\"'\"'/g" -e "s/^/$sym='/" -e "s/$/'/" >>config.sh
15185 : Finish up by extracting the .SH files
15199 If you'd like to make any changes to the config.sh file before I begin
15200 to configure things, do it as a shell escape now (e.g. !vi config.sh).
15203 rp="Press return or use a shell escape to edit config.sh:"
15208 *) : in case they cannot read
15209 sh 1>&4 -c "$ans";;
15214 : if this fails, just run all the .SH files by hand
15221 if $contains '^depend:' [Mm]akefile >/dev/null 2>&1; then
15228 Now you need to generate make dependencies by running "$make depend".
15229 You might prefer to run it in background: "$make depend > makedepend.out &"
15230 It can take a while, so you might not want to run it right now.
15235 rp="Run $make depend now?"
15239 $make depend && echo "Now you must run a $make."
15242 echo "You must run '$make depend' then '$make'."
15245 elif test -f [Mm]akefile; then
15247 echo "Now you must run a $make."
15252 if $test -f Policy.sh; then
15255 If you compile $package on a different machine or from a different object
15256 directory, copy the Policy.sh file from this object directory to the
15257 new one before you run Configure -- this will help you with most of
15258 the policy defaults.
15262 if $test -f config.msg; then
15263 echo "Hmm. I also noted the following information while running:"
15265 $cat config.msg >&4
15268 $rm -f kit*isdone ark*isdone