3 # If these # comments don't work, trim them. Don't worry about any other
4 # shell scripts, Configure will trim # comments from them for you.
6 # (If you are trying to port this package to a machine without sh,
7 # I would suggest you have a look at the prototypical config_h.SH file
8 # and edit it to reflect your system. Some packages may include samples
9 # of config.h for certain machines, so you might look for one of those.)
11 # Yes, you may rip this off to use in other distribution packages. This
12 # script belongs to the public domain and cannot be copyrighted.
14 # (Note: this Configure script was generated automatically. Rather than
15 # working with this copy of Configure, you may wish to get metaconfig.
16 # The dist-3.0 package (which contains metaconfig) was posted in
17 # comp.sources.misc and is available on CPAN under authors/id/RAM so
18 # you may fetch it yourself from your nearest archive site.)
21 # $Id: Head.U,v 3.0.1.9 1997/02/28 15:02:09 ram Exp $
23 # Generated on Mon Jan 31 22:19:42 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
440 d_old_pthread_create_joinable=''
441 old_pthread_create_joinable=''
674 inc_version_list_init=''
694 ignore_versioned_solibs=''
852 d_stdio_stream_array=''
853 stdio_stream_array=''
897 smallmach='pdp11 i8086 z8000 i80286 iAPX286'
900 : We must find out about Eunice early
902 if test -f /etc/unixtovms; then
903 eunicefix=/etc/unixtovms
905 if test -f /etc/unixtovms.exe; then
906 eunicefix=/etc/unixtovms.exe
910 : set useposix=false in your hint file to disable the POSIX extension.
912 : set useopcode=false in your hint file to disable the Opcode extension.
914 : Trailing extension. Override this in a hint file, if needed.
916 : Extra object files, if any, needed on this platform.
918 : Possible local include directories to search.
919 : Set locincpth to "" in a hint file to defeat local include searches.
920 locincpth="/usr/local/include /opt/local/include /usr/gnu/include"
921 locincpth="$locincpth /opt/gnu/include /usr/GNU/include /opt/GNU/include"
923 : no include file wanted by default
927 : change the next line if compiling for Xenix/286 on Xenix/386
928 xlibpth='/usr/lib/386 /lib/386'
930 : Possible local library directories to search.
931 loclibpth="/usr/local/lib /opt/local/lib /usr/gnu/lib"
932 loclibpth="$loclibpth /opt/gnu/lib /usr/GNU/lib /opt/GNU/lib"
934 : general looking path for locating libraries
935 glibpth="/shlib /usr/shlib /lib/pa1.1 /usr/lib/large"
936 glibpth="$glibpth /lib /usr/lib $xlibpth"
937 glibpth="$glibpth /lib/large /usr/lib/small /lib/small"
938 glibpth="$glibpth /usr/ccs/lib /usr/ucblib /usr/local/lib"
940 : Private path used by Configure to find libraries. Its value
941 : is prepended to libpth. This variable takes care of special
942 : machines, like the mips. Usually, it should be empty.
945 : default library list
947 : some systems want to use only the non-versioned libso:s
948 ignore_versioned_solibs=''
949 : set usemultiplicity on the Configure command line to enable multiplicity.
950 : set usesocks on the Configure command line to enable socks.
951 : set usethreads on the Configure command line to enable threads.
952 : full support for void wanted by default
955 : List of libraries we want.
956 : If anyone needs -lnet, put it in a hint file.
957 libswanted='sfio socket inet nsl nm ndbm gdbm dbm db malloc dl'
958 libswanted="$libswanted dld ld sun m c cposix posix"
959 libswanted="$libswanted ndir dir crypt sec"
960 libswanted="$libswanted ucb bsd BSD PW x"
961 : We probably want to search /usr/shlib before most other libraries.
962 : This is only used by the lib/ExtUtils/MakeMaker.pm routine extliblist.
963 glibpth=`echo " $glibpth " | sed -e 's! /usr/shlib ! !'`
964 glibpth="/usr/shlib $glibpth"
965 : Do not use vfork unless overridden by a hint file.
968 : Find the basic shell for Bourne shell scripts
972 *bsd*|sys5*) xxx="/$SYSTYPE/bin/sh";;
975 if test -f "$xxx"; then
978 : Build up a list and do a single loop so we can 'break' out.
979 pth=`echo $PATH | sed -e "s/$p_/ /g"`
980 for xxx in sh bash ksh pdksh ash; do
982 try="$try ${p}/${xxx}"
986 if test -f "$xxx"; then
989 elif test -f "$xxx.exe"; then
1000 $me: Fatal Error: I can't find a Bourne Shell anywhere.
1002 Usually it's in /bin/sh. How did you even get this far?
1003 Please contact me (Perl Maintainers) at perlbug@perl.com and
1004 we'll try to straighten this all out.
1010 : see if sh knows # comments
1011 if `$sh -c '#' >/dev/null 2>&1`; then
1015 test -f $xcat || xcat=/usr/bin/cat
1020 if test -s today; then
1023 echo "#! $xcat" > try
1027 if test -s today; then
1035 echo "Your $sh doesn't grok # comments--I will strip them later on."
1038 echo "exec grep -v '^[ ]*#'" >spitshell
1040 $eunicefix spitshell
1041 spitshell=`pwd`/spitshell
1043 echo "I presume that if # doesn't work, #! won't work either!"
1048 : figure out how to guarantee sh startup
1050 '') startsh=${sharpbang}${sh} ;;
1062 : echo "Yup, it does."
1064 echo "Hmm... '$startsh' does not guarantee sh startup..."
1065 echo "You may have to fix up the shell scripts to make sure $sh runs them."
1070 : Save command line options in file UU/cmdline.opt for later use in
1071 : generating config.sh.
1072 cat > cmdline.opt <<EOSH
1073 # Configure command line arguments.
1080 cat >>cmdline.opt <<EOSH
1081 config_arg$argn='$arg'
1083 argn=`expr $argn + 1`
1086 : produce awk script to parse command line options
1087 cat >options.awk <<'EOF'
1089 optstr = "A:dD:eEf:hKOrsSU:V"; # getopt-style specification
1091 len = length(optstr);
1092 for (i = 1; i <= len; i++) {
1093 c = substr(optstr, i, 1);
1094 if (i < len) a = substr(optstr, i + 1, 1); else a = "";
1105 if (substr(str, 1, 1) != "-") {
1106 printf("'%s'\n", str);
1110 for (i = 2; i <= len; i++) {
1111 c = substr(str, i, 1);
1113 printf("-%s\n", substr(str, i));
1119 printf("'%s'\n", substr(str, i + 1));
1132 : process the command line options
1133 set X `for arg in "$@"; do echo "X$arg"; done |
1134 sed -e s/X// | awk -f options.awk`
1139 : set up default values
1149 rm -f optdef.sh posthint.sh
1150 cat >optdef.sh <<EOS
1156 while test $# -gt 0; do
1158 -d) shift; fastread=yes;;
1159 -e) shift; alldone=cont;;
1163 if test -r "$1"; then
1166 echo "$me: cannot read config file $1." >&2
1171 -h) shift; error=true;;
1172 -r) shift; reuseval=true;;
1173 -s) shift; silent=true; realsilent=true;;
1174 -E) shift; alldone=exit;;
1175 -K) shift; knowitall=true;;
1176 -O) shift; override=true;;
1177 -S) shift; silent=true; extractsh=true;;
1182 echo "$me: use '-U symbol=', not '-D symbol='." >&2
1183 echo "$me: ignoring -D $1" >&2
1186 sed -e "s/'/'\"'\"'/g" -e "s/=\(.*\)/='\1'/" >> optdef.sh;;
1187 *) echo "$1='define'" >> optdef.sh;;
1194 *=) echo "$1" >> optdef.sh;;
1196 echo "$me: use '-D symbol=val', not '-U symbol=val'." >&2
1197 echo "$me: ignoring -U $1" >&2
1199 *) echo "$1='undef'" >> optdef.sh;;
1210 *=*) zzz=`echo $yyy|sed 's!=.*!!'`
1214 zzz=" "`echo $yyy|sed 's!^[^=]*=!!'`
1215 yyy=`echo $yyy|sed 's!=.*!!'` ;;
1221 *:*) xxx=`echo $yyy|sed 's!:.*!!'`
1222 yyy=`echo $yyy|sed 's!^[^:]*:!!'`
1223 zzz=`echo $yyy|sed 's!^[^=]*=!!'`
1224 yyy=`echo $yyy|sed 's!=.*!!'` ;;
1225 *) xxx=`echo $yyy|sed 's!:.*!!'`
1226 yyy=`echo $yyy|sed 's!^[^:]*:!!'` ;;
1232 echo "$yyy=\"\${$yyy}$zzz\"" >> posthint.sh ;;
1234 echo "$yyy=''" >> posthint.sh ;;
1239 echo "$yyy='$zzz'" >> posthint.sh ;;
1241 echo "eval \"$yyy=$zzz\"" >> posthint.sh ;;
1243 echo "$yyy=\"$zzz\${$yyy}\"" >> posthint.sh ;;
1248 echo "$yyy=$zzz" >> posthint.sh ;;
1249 *) echo "$me: unknown -A command '$xxx', ignoring -A $1" >&2 ;;
1252 -V) echo "$me generated by metaconfig 3.0 PL70." >&2
1255 -*) echo "$me: unknown option $1" >&2; shift; error=true;;
1263 Usage: $me [-dehrsEKOSV] [-f config.sh] [-D symbol] [-D symbol=value]
1264 [-U symbol] [-U symbol=] [-A command:symbol...]
1265 -d : use defaults for all answers.
1266 -e : go on without questioning past the production of config.sh.
1267 -f : specify an alternate default configuration file.
1268 -h : print this help message and exit (with an error status).
1269 -r : reuse C symbols value if possible (skips costly nm extraction).
1270 -s : silent mode, only echoes questions and essential information.
1271 -D : define symbol to have some value:
1272 -D symbol symbol gets the value 'define'
1273 -D symbol=value symbol gets the value 'value'
1274 -E : stop at the end of questions, after having produced config.sh.
1275 -K : do not use unless you know what you are doing.
1276 -O : let -D and -U override definitions from loaded configuration file.
1277 -S : perform variable substitutions on all .SH files (can mix with -f)
1278 -U : undefine symbol:
1279 -U symbol symbol gets the value 'undef'
1280 -U symbol= symbol gets completely empty
1281 -A : manipulate symbol after the platform specific hints have been applied:
1282 -A symbol=value append " "value to symbol
1283 -A append:symbol=value append value to symbol
1284 -A define:symbol=value define symbol to have value
1285 -A clear:symbol define symbol to be ''
1286 -A define:symbol define symbol to be 'define'
1287 -A eval:symbol=value define symbol to be eval of value
1288 -A prepend:symbol=value prepend value to symbol
1289 -A undef:symbol define symbol to be 'undef'
1290 -A undef:symbol= define symbol to be ''
1291 -V : print version number and exit (with a zero status).
1298 case "$fastread$alldone" in
1301 if test ! -t 0; then
1302 echo "Say 'sh Configure', not 'sh <Configure'"
1310 true) exec 1>/dev/null;;
1313 : run the defines and the undefines, if any, but leave the file out there...
1316 : create the posthint manipulation script and leave the file out there...
1321 first=`echo $package | sed -e 's/^\(.\).*/\1/'`
1322 last=`echo $package | sed -e 's/^.\(.*\)/\1/'`
1323 case "`echo AbyZ | tr '[:lower:]' '[:upper:]' 2>/dev/null`" in
1324 ABYZ) spackage=`echo $first | tr '[:lower:]' '[:upper:]'`$last;;
1325 *) spackage=`echo $first | tr '[a-z]' '[A-Z]'`$last;;
1328 : Some greps do not return status, grrr.
1329 echo "grimblepritz" >grimble
1330 if grep blurfldyick grimble >/dev/null 2>&1 ; then
1332 elif grep grimblepritz grimble >/dev/null 2>&1 ; then
1338 : the following should work in any shell
1342 echo "AGH! Grep doesn't return a status. Attempting remedial action."
1343 cat >contains <<'EOSS'
1344 grep "$1" "$2" >.greptmp && cat .greptmp && test -s .greptmp
1349 : Find the path to the source tree
1352 */*) src=`echo $0 | sed -e 's%/[^/][^/]*$%%'`
1355 *) src=`cd ../$src && pwd` ;;
1368 if test -f $rsrc/Configure && \
1369 $contains "^package=$package$" $rsrc/Configure >/dev/null 2>&1
1371 : found it, so we are ok.
1374 for src in . .. ../.. ../../.. ../../../..; do
1375 if test -f ../$src/Configure && \
1376 $contains "^package=$package$" ../$src/Configure >/dev/null 2>&1
1387 Sorry, I can't seem to locate the source dir for $package. Please start
1388 Configure with an explicit path -- i.e. /some/path/Configure.
1396 echo "Sources for $package found in \"$src\"." >&4
1400 : script used to extract .SH files with variable substitutions
1401 cat >extract <<'EOS'
1403 echo "Doing variable substitutions on .SH files..."
1404 if test -f $src/MANIFEST; then
1405 set x `awk '{print $1}' <$src/MANIFEST | grep '\.SH$'`
1407 echo "(Looking for .SH files under the source directory.)"
1408 set x `(cd $src; find . -name "*.SH" -print)`
1412 0) set x `(cd $src; echo *.SH)`; shift;;
1414 if test ! -f $src/$1; then
1420 while test $name; do
1421 if test ! -d "$name"; then
1422 create="$name $create";
1423 name=`echo $name | sed -e "s|^[^/]*$||"`;
1424 name=`echo $name | sed -e "s|\(.*\)/.*|\1|"`;
1429 for file in $create; do
1438 dir=`expr X$file : 'X\(.*\)/'`
1439 file=`expr X$file : 'X.*/\(.*\)'`
1440 (cd $dir && . ./$file)
1450 dir=`expr X$file : 'X\(.*\)/'`
1451 file=`expr X$file : 'X.*/\(.*\)'`
1452 (set x $dir; shift; eval $mkdir_p)
1462 if test -f $src/config_h.SH; then
1463 if test ! -f config.h; then
1464 : oops, they left it out of MANIFEST, probably, so do it anyway.
1470 : extract files and exit if asked to do so
1471 case "$extractsh" in
1473 case "$realsilent" in
1477 case "$config_sh" in
1478 '') config_sh='config.sh';;
1481 echo "Fetching answers from $config_sh..."
1484 test "$override" && . ./optdef.sh
1493 : Eunice requires " " instead of "", can you believe it
1496 echo "Beginning of configuration questions for $package."
1498 trap 'echo " "; test -d ../UU && rm -rf X $rmlist; exit 1' 1 2 3 15
1500 : first determine how to suppress newline on echo command
1502 echo "Checking echo to see how to suppress newlines..."
1503 (echo "hi there\c" ; echo " ") >.echotmp
1504 if $contains c .echotmp >/dev/null 2>&1 ; then
1515 echo $n "The star should be here-->$c"
1519 : Now test for existence of everything in MANIFEST
1521 if test -f $rsrc/MANIFEST; then
1522 echo "First let's make sure your kit is complete. Checking..." >&4
1523 awk '$1 !~ /PACK[A-Z]+/ {print $1}' $rsrc/MANIFEST | split -50
1526 for filelist in x??; do
1527 (cd $rsrc; ls `cat $tmppwd/$filelist` >/dev/null 2>>$tmppwd/missing)
1529 if test -s missing; then
1533 THIS PACKAGE SEEMS TO BE INCOMPLETE.
1535 You have the option of continuing the configuration process, despite the
1536 distinct possibility that your kit is damaged, by typing 'y'es. If you
1537 do, don't blame me if something goes wrong. I advise you to type 'n'o
1538 and contact the author (perlbug@perl.com).
1541 echo $n "Continue? [n] $c" >&4
1545 echo "Continuing..." >&4
1549 echo "ABORTING..." >&4
1554 echo "Looks good..."
1557 echo "There is no MANIFEST file. I hope your kit is complete !"
1562 : Find the appropriate value for a newline for tr
1563 if test -n "$DJGPP"; then
1566 if test X"$trnl" = X; then
1567 case "`echo foo|tr '\n' x 2>/dev/null`" in
1571 if test X"$trnl" = X; then
1572 case "`echo foo|tr '\012' x 2>/dev/null`" in
1573 foox) trnl='\012' ;;
1576 if test X"$trnl" = X; then
1579 $me: Fatal Error: cannot figure out how to translate newlines with 'tr'.
1585 : compute the number of columns on the terminal for proper question formatting
1590 : set up the echo used in my read
1591 myecho="case \"\$xxxm\" in
1592 '') echo $n \"\$rp $c\" >&4;;
1594 '') echo $n \"[\$xxxm] $c\";;
1596 if test \`echo \"\$rp [\$xxxm] \" | wc -c\` -ge $COLUMNS; then
1598 echo $n \"[\$xxxm] $c\" >&4
1600 echo $n \"\$rp [\$xxxm] $c\" >&4
1606 : now set up to do reads with possible shell escape and default assignment
1612 case "\$fastread" in
1613 yes) case "\$dflt" in
1616 case "\$silent-\$rp" in
1621 *) case "\$silent" in
1622 true) case "\$rp" in
1627 while expr "X\$ans" : "X!" >/dev/null; do
1631 aok=''; eval "ans=\\"\$answ\\"" && aok=y
1639 set x \`expr "X\$ans" : "X!\(.*\)\$"\`
1648 set x \`expr "X\$ans" : "X&\(.*\)\$"\`
1653 echo "(OK, I'll run with -d after this question.)" >&4
1656 echo "*** Sorry, \$1 not supported yet." >&4
1666 echo "*** Substitution done -- please confirm."
1668 ans=\`echo $n "\$ans$c" | tr '$trnl' ' '\`
1673 echo "*** Error -- try again."
1680 case "\$ans\$xxxm\$nostick" in
1692 : create .config dir to save info across Configure sessions
1693 test -d ../.config || mkdir ../.config
1694 cat >../.config/README <<EOF
1695 This directory created by Configure to save information that should
1696 persist across sessions for $package.
1698 You may safely delete it if you wish.
1701 : general instructions
1704 user=`(logname) 2>/dev/null`
1706 '') user=`whoami 2>&1`;;
1708 if $contains "^$user\$" ../.config/instruct >/dev/null 2>&1; then
1711 rp='Would you like to see the instructions?'
1722 This installation shell script will examine your system and ask you questions
1723 to determine how the perl5 package should be installed. If you get
1724 stuck on a question, you may use a ! shell escape to start a subshell or
1725 execute a command. Many of the questions will have default answers in square
1726 brackets; typing carriage return will give you the default.
1728 On some of the questions which ask for file or directory names you are allowed
1729 to use the ~name construct to specify the login directory belonging to "name",
1730 even if you don't have a shell which knows about that. Questions where this is
1731 allowed will be marked "(~name ok)".
1735 dflt='Type carriage return to continue'
1739 The prompter used in this script allows you to use shell variables and
1740 backticks in your answers. You may use $1, $2, etc... to refer to the words
1741 in the default answer, as if the default line was a set of arguments given to a
1742 script shell. This means you may also use $* to repeat the whole default line,
1743 so you do not have to re-type everything to add something to the default.
1745 Everytime there is a substitution, you will have to confirm. If there is an
1746 error (e.g. an unmatched backtick), the default answer will remain unchanged
1747 and you will be prompted again.
1749 If you are in a hurry, you may run 'Configure -d'. This will bypass nearly all
1750 the questions and use the computed defaults (or the previous answers if there
1751 was already a config.sh file). Type 'Configure -h' for a list of options.
1752 You may also start interactively and then answer '& -d' at any prompt to turn
1753 on the non-interactive behaviour for the remainder of the execution.
1759 Much effort has been expended to ensure that this shell script will run on any
1760 Unix system. If despite that it blows up on yours, your best bet is to edit
1761 Configure and run it again. If you can't run Configure for some reason,
1762 you'll have to generate a config.sh file by hand. Whatever problems you
1763 have, let me (perlbug@perl.com) know how I blew it.
1765 This installation script affects things in two ways:
1767 1) it may do direct variable substitutions on some of the files included
1769 2) it builds a config.h file for inclusion in C programs. You may edit
1770 any of these files as the need arises after running this script.
1772 If you make a mistake on a question, there is no easy way to back up to it
1773 currently. The easiest thing to do is to edit config.sh and rerun all the SH
1774 files. Configure will offer to let you do this before it runs the SH files.
1777 dflt='Type carriage return to continue'
1779 case "$firsttime" in
1780 true) echo $user >>../.config/instruct;;
1784 : find out where common programs are
1786 echo "Locating common programs..." >&4
1799 if test -d \$dir/\$thing; then
1805 for thisthing in \$dir/\$thing; do
1806 : just loop through to pick last item
1808 if test -f \$thisthing; then
1811 elif test -f \$dir/\$thing.exe; then
1812 if test -n "$DJGPP"; then
1813 echo \$dir/\$thing.exe
1815 : on Eunice apparently
1866 pth=`echo $PATH | sed -e "s/$p_/ /g"`
1867 pth="$pth /lib /usr/lib"
1868 for file in $loclist; do
1872 if test -f "$xxx"; then
1875 echo "WARNING: no $xxx -- ignoring your setting for $file." >&4
1876 xxx=`./loc $file $file $pth`
1879 '') xxx=`./loc $file $file $pth`;;
1880 *) xxx=`./loc $xxx $xxx $pth`;;
1886 echo $file is in $xxx.
1889 echo $file is in $xxx.
1892 echo "I don't know where '$file' is, and my life depends on it." >&4
1893 echo "Go find a public domain implementation or fix your PATH setting!" >&4
1899 echo "Don't worry if any of the following aren't found..."
1901 for file in $trylist; do
1905 if test -f "$xxx"; then
1908 echo "WARNING: no $xxx -- ignoring your setting for $file." >&4
1909 xxx=`./loc $file $file $pth`
1912 '') xxx=`./loc $file $file $pth`;;
1913 *) xxx=`./loc $xxx $xxx $pth`;;
1919 echo $file is in $xxx.
1922 echo $file is in $xxx.
1925 echo "I don't see $file out there, $say."
1932 echo "Substituting grep for egrep."
1938 echo "Substituting cp for ln."
1944 echo "Hopefully test is built into your sh."
1947 if `sh -c "PATH= test true" >/dev/null 2>&1`; then
1948 echo "Using the test built into your sh."
1956 echo "Hopefully echo is built into your sh."
1961 echo "Checking compatibility between $echo and builtin echo (if any)..." >&4
1962 $echo $n "hi there$c" >foo1
1963 echo $n "hi there$c" >foo2
1964 if cmp foo1 foo2 >/dev/null 2>&1; then
1965 echo "They are compatible. In fact, they may be identical."
1972 They are not compatible! You are probably running ksh on a non-USG system.
1973 I'll have to use $echo instead of the builtin, since Bourne shell doesn't
1974 have echo built in and we may have to run some Bourne shell scripts. That
1975 means I'll have to use '$n$c' to suppress newlines now. Life is ridiculous.
1978 $echo $n "The star should be here-->$c"
1985 : determine whether symbolic links are supported
1988 if $ln -s blurfl sym > /dev/null 2>&1 ; then
1989 echo "Symbolic links are supported." >&4
1992 echo "Symbolic links are NOT supported." >&4
1997 : see whether [:lower:] and [:upper:] are supported character classes
1999 case "`echo AbyZ | $tr '[:lower:]' '[:upper:]' 2>/dev/null`" in
2001 echo "Good, your tr supports [:lower:] and [:upper:] to convert case." >&4
2005 *) # There is a discontinuity in EBCDIC between 'I' and 'J'
2006 # (0xc9 and 0xd1), therefore that is a nice testing point.
2007 if test "X$up" = X -o "X$low" = X; then
2008 case "`echo IJ | $tr '[I-J]' '[i-j]' 2>/dev/null`" in
2014 if test "X$up" = X -o "X$low" = X; then
2015 case "`echo IJ | $tr I-J i-j 2>/dev/null`" in
2021 if test "X$up" = X -o "X$low" = X; then
2022 case "`echo IJ | od -x 2>/dev/null`" in
2024 echo "Hey, this might be EBCDIC." >&4
2025 if test "X$up" = X -o "X$low" = X; then
2026 case "`echo IJ | $tr '[A-IJ-RS-Z]' '[a-ij-rs-z]' 2>/dev/null`" in
2027 ij) up='[A-IJ-RS-Z]'
2032 if test "X$up" = X -o "X$low" = X; then
2033 case "`echo IJ | $tr A-IJ-RS-Z a-ij-rs-z 2>/dev/null`" in
2043 case "`echo IJ | $tr \"$up\" \"$low\" 2>/dev/null`" in
2045 echo "Using $up and $low to convert case." >&4
2048 echo "I don't know how to translate letters from upper to lower case." >&4
2049 echo "Your tr is not acting any way I know of." >&4
2053 : set up the translation script tr, must be called with ./tr of course
2057 '[A-Z][a-z]') exec $tr '$up' '$low';;
2058 '[a-z][A-Z]') exec $tr '$low' '$up';;
2065 : Try to determine whether config.sh was made on this system
2066 case "$config_sh" in
2068 myuname=`$uname -a 2>/dev/null`
2069 $test -z "$myuname" && myuname=`hostname 2>/dev/null`
2070 # tr '[A-Z]' '[a-z]' would not work in EBCDIC
2071 # because the A-Z/a-z are not consecutive.
2072 myuname=`echo $myuname | $sed -e 's/^[^=]*=//' -e 's/\///g' | \
2073 ./tr '[A-Z]' '[a-z]' | $tr $trnl ' '`
2074 newmyuname="$myuname"
2076 case "$knowitall" in
2078 if test -f ../config.sh; then
2079 if $contains myuname= ../config.sh >/dev/null 2>&1; then
2080 eval "`grep myuname= ../config.sh`"
2082 if test "X$myuname" = "X$newmyuname"; then
2090 : Get old answers from old config file if Configure was run on the
2091 : same system, otherwise use the hints.
2094 if test -f config.sh; then
2096 rp="I see a config.sh file. Shall I use it to set the defaults?"
2099 n*|N*) echo "OK, I'll ignore it."; mv config.sh config.sh.old;;
2100 *) echo "Fetching default answers from your old config.sh file..." >&4
2108 : Older versions did not always set $sh. Catch re-use of such
2117 if test ! -f config.sh; then
2120 First time through, eh? I have some defaults handy for some systems
2121 that need some extra help getting the Configure answers right:
2124 (cd $src/hints; ls -C *.sh) | $sed 's/\.sh/ /g' >&4
2126 : Half the following guesses are probably wrong... If you have better
2127 : tests or hints, please send them to perlbug@perl.com
2128 : The metaconfig authors would also appreciate a copy...
2129 $test -f /irix && osname=irix
2130 $test -f /xenix && osname=sco_xenix
2131 $test -f /dynix && osname=dynix
2132 $test -f /dnix && osname=dnix
2133 $test -f /lynx.os && osname=lynxos
2134 $test -f /unicos && osname=unicos && osvers=`$uname -r`
2135 $test -f /unicosmk && osname=unicosmk && osvers=`$uname -r`
2136 $test -f /unicosmk.ar && osname=unicosmk && osvers=`$uname -r`
2137 $test -f /bin/mips && /bin/mips && osname=mips
2138 $test -d /NextApps && set X `hostinfo | grep 'NeXT Mach.*:' | \
2139 $sed -e 's/://' -e 's/\./_/'` && osname=next && osvers=$4
2140 $test -d /usr/apollo/bin && osname=apollo
2141 $test -f /etc/saf/_sactab && osname=svr4
2142 $test -d /usr/include/minix && osname=minix
2143 if $test -d /MachTen -o -d /MachTen_Folder; then
2145 if $test -x /sbin/version; then
2146 osvers=`/sbin/version | $awk '{print $2}' |
2147 $sed -e 's/[A-Za-z]$//'`
2148 elif $test -x /usr/etc/version; then
2149 osvers=`/usr/etc/version | $awk '{print $2}' |
2150 $sed -e 's/[A-Za-z]$//'`
2156 $test -f /sys/posix.dll &&
2157 $test -f /usr/bin/what &&
2158 set X `/usr/bin/what /sys/posix.dll` &&
2159 $test "$3" = UWIN &&
2163 if $test -f $uname; then
2171 umips) osname=umips ;;
2174 [23]100) osname=mips ;;
2175 next*) osname=next ;;
2177 tmp=`/bin/uname -X 2>/dev/null|awk '/3\.2v[45]/{ print $(NF) }'`
2178 if $test "$tmp" != "" -a "$3" = "3.2" -a -f '/etc/systemid'; then
2181 elif $test -f /etc/kconfig; then
2183 if test "$lns" = "$ln -s"; then
2185 elif $contains _SYSV3 /usr/include/stdio.h > /dev/null 2>&1 ; then
2187 elif $contains _POSIX_SOURCE /usr/include/stdio.h > /dev/null 2>&1 ; then
2194 if test -n "$DJGPP"; then
2203 tmp=`( (oslevel) 2>/dev/null || echo "not found") 2>&1`
2205 'not found') osvers="$4"."$3" ;;
2206 '<3240'|'<>3240') osvers=3.2.0 ;;
2207 '=3240'|'>3240'|'<3250'|'<>3250') osvers=3.2.4 ;;
2208 '=3250'|'>3250') osvers=3.2.5 ;;
2212 bsd386) osname=bsd386
2215 cygwin*) osname=cygwin
2218 *dc.osx) osname=dcosx
2224 domainos) osname=apollo
2230 dynixptx*) osname=dynixptx
2231 osvers=`echo "$4"|sed 's/^v//'`
2233 freebsd) osname=freebsd
2235 genix) osname=genix ;;
2237 osvers=`echo "$3" | $sed 's,.*\.\([0-9]*\.[0-9]*\),\1,'`
2253 netbsd*) osname=netbsd
2256 news-os) osvers="$3"
2258 4*) osname=newsos4 ;;
2262 next*) osname=next ;;
2263 POSIX-BC | posix-bc ) osname=posix-bc
2266 powerux | power_ux | powermax_os | powermaxos | \
2267 powerunix | power_unix) osname=powerux
2273 solaris) osname=solaris
2275 5*) osvers=`echo $3 | $sed 's/^5/2/g'` ;;
2282 osvers=`echo $3 | $sed 's/^5/2/g'` ;;
2286 titanos) osname=titanos
2295 ultrix) osname=ultrix
2298 osf1|mls+) case "$5" in
2301 osvers=`echo "$3" | sed 's/^[xvt]//'`
2303 hp*) osname=hp_osf1 ;;
2304 mips) osname=mips_osf1 ;;
2307 unixware) osname=svr5
2313 $2) case "$osname" in
2317 : svr4.x or possibly later
2327 if test -f /stand/boot ; then
2328 eval `grep '^INITPROG=[a-z/0-9]*$' /stand/boot`
2329 if test -n "$INITPROG" -a -f "$INITPROG"; then
2330 isesix=`strings -a $INITPROG|grep 'ESIX SYSTEM V/386 Release 4.0'`
2331 if test -n "$isesix"; then
2339 *) if test -f /etc/systemid; then
2341 set `echo $3 | $sed 's/\./ /g'` $4
2342 if $test -f $src/hints/sco_$1_$2_$3.sh; then
2344 elif $test -f $src/hints/sco_$1_$2.sh; then
2346 elif $test -f $src/hints/sco_$1.sh; then
2351 '') : Still unknown. Probably a generic Sys V.
2360 *) case "$osname" in
2361 '') : Still unknown. Probably a generic BSD.
2369 if test -f /vmunix -a -f $src/hints/news_os.sh; then
2370 (what /vmunix | UU/tr '[A-Z]' '[a-z]') > UU/kernel.what 2>&1
2371 if $contains news-os UU/kernel.what >/dev/null 2>&1; then
2374 $rm -f UU/kernel.what
2375 elif test -d c:/.; then
2382 : Now look for a hint file osname_osvers, unless one has been
2383 : specified already.
2386 file=`echo "${osname}_${osvers}" | $sed -e 's@\.@_@g' -e 's@_$@@'`
2387 : Also try without trailing minor version numbers.
2388 xfile=`echo $file | $sed -e 's@_[^_]*$@@'`
2389 xxfile=`echo $xfile | $sed -e 's@_[^_]*$@@'`
2390 xxxfile=`echo $xxfile | $sed -e 's@_[^_]*$@@'`
2391 xxxxfile=`echo $xxxfile | $sed -e 's@_[^_]*$@@'`
2394 *) case "$osvers" in
2397 *) if $test -f $src/hints/$file.sh ; then
2399 elif $test -f $src/hints/$xfile.sh ; then
2401 elif $test -f $src/hints/$xxfile.sh ; then
2403 elif $test -f $src/hints/$xxxfile.sh ; then
2405 elif $test -f $src/hints/$xxxxfile.sh ; then
2407 elif $test -f "$src/hints/${osname}.sh" ; then
2416 if $test -f Policy.sh ; then
2419 none) dflt="Policy" ;;
2420 *) dflt="Policy $dflt" ;;
2425 dflt=`echo $hintfile | $sed 's/\.sh$//'`
2429 if $test -f Policy.sh ; then
2432 There's also a Policy hint file available, which should make the
2433 site-specific (policy) questions easier to answer.
2440 You may give one or more space-separated answers, or "none" if appropriate.
2441 A well-behaved OS will have no hints, so answering "none" or just "Policy"
2442 is a good thing. DO NOT give a wrong version or a wrong OS.
2446 rp="Which of these apply, if any?"
2449 for file in $tans; do
2450 if $test X$file = XPolicy -a -f Policy.sh; then
2452 $cat Policy.sh >> UU/config.sh
2453 elif $test -f $src/hints/$file.sh; then
2454 . $src/hints/$file.sh
2455 $cat $src/hints/$file.sh >> UU/config.sh
2456 elif $test X$tans = X -o X$tans = Xnone ; then
2459 : Give one chance to correct a possible typo.
2460 echo "$file.sh does not exist"
2462 rp="hint to use instead?"
2464 for file in $ans; do
2465 if $test -f "$src/hints/$file.sh"; then
2466 . $src/hints/$file.sh
2467 $cat $src/hints/$file.sh >> UU/config.sh
2468 elif $test X$ans = X -o X$ans = Xnone ; then
2471 echo "$file.sh does not exist -- ignored."
2478 : Remember our hint file for later.
2479 if $test -f "$src/hints/$file.sh" ; then
2489 echo "Fetching default answers from $config_sh..." >&4
2493 cp $config_sh config.sh 2>/dev/null
2503 test "$override" && . ./optdef.sh
2504 myuname="$newmyuname"
2506 : Restore computed paths
2507 for file in $loclist $trylist; do
2508 eval $file="\$_$file"
2513 Configure uses the operating system name and version to set some defaults.
2514 The default value is probably right if the name rings a bell. Otherwise,
2515 since spelling matters for me, either accept the default or answer "none"
2522 ''|' '|none) dflt=none ;;
2523 *) dflt=`echo $hintfile | $sed -e 's/\.sh$//' -e 's/_.*$//'` ;;
2526 *) dflt="$osname" ;;
2528 rp="Operating system name?"
2532 *) osname=`echo "$ans" | $sed -e 's/[ ][ ]*/_/g' | ./tr '[A-Z]' '[a-z]'`;;
2538 ''|' '|none) dflt=none ;;
2539 *) dflt=`echo $hintfile | $sed -e 's/\.sh$//' -e 's/^[^_]*//'`
2540 dflt=`echo $dflt | $sed -e 's/^_//' -e 's/_/./g'`
2542 ''|' ') dflt=none ;;
2547 *) dflt="$osvers" ;;
2549 rp="Operating system version?"
2559 : who configured the system
2560 cf_time=`LC_ALL=C; LANGUAGE=C; export LC_ALL; export LANGUAGE; $date 2>&1`
2561 cf_by=`(logname) 2>/dev/null`
2564 cf_by=`(whoami) 2>/dev/null`
2566 "") cf_by=unknown ;;
2570 : set up the script used to warn in case of inconsistency
2577 echo "*** WHOA THERE!!! ***" >&4
2578 echo " The $hint value for \$$var on this machine was \"$was\"!" >&4
2579 rp=" Keep the $hint value?"
2582 y) td=$was; tu=$was;;
2586 : function used to set $1 to $val
2587 setvar='var=$1; eval "was=\$$1"; td=$define; tu=$undef;
2589 $define$undef) . ./whoa; eval "$var=\$td";;
2590 $undef$define) . ./whoa; eval "$var=\$tu";;
2591 *) eval "$var=$val";;
2596 Perl can be built to take advantage of threads, on some systems.
2597 To do so, Configure must be run with -Dusethreads.
2599 Note that threading is a highly experimental feature, and
2600 some known race conditions still remain. If you choose to try
2601 it, be very sure to not actually deploy it for production
2602 purposes. README.threads has more details, and is required
2603 reading if you enable threads.
2605 case "$usethreads" in
2606 $define|true|[yY]*) dflt='y';;
2609 rp='Build a threading Perl?'
2612 y|Y) val="$define" ;;
2618 case "$usethreads" in
2622 As of 5.5.640, Perl has two different internal threading implementations,
2623 the 5.005 version (5005threads) and an interpreter-based version
2624 (ithreads) that has one interpreter per thread. Both are very
2625 experimental. This arrangement exists to help developers work out
2626 which one is better.
2628 : Default to ithreads unless overridden on command line or with
2631 case "$use5005threads" in
2632 $define|true|[yY]*) dflt='n';;
2634 case "$useithreads" in
2635 $undef|false|[nN]*) dflt='n';;
2637 rp='Use interpreter-based ithreads?'
2640 y|Y) val="$define" ;;
2645 : Now set use5005threads to the opposite value.
2646 case "$useithreads" in
2647 $define) val="$undef" ;;
2654 useithreads="$undef"
2655 use5005threads="$undef"
2659 case "$d_oldpthreads" in
2660 '') : Configure tests would be welcome here. For now, assume undef.
2662 *) val="$d_oldpthreads" ;;
2668 case "$usethreads" in
2669 "$define"|true|[yY]*)
2670 : Look for a hint-file generated 'call-back-unit'. If the
2671 : user has specified that a threading perl is to be built,
2672 : we may need to set or change some other defaults.
2673 if $test -f usethreads.cbu; then
2674 echo "Your platform has some specific hints for threaded builds, using them..."
2678 (Your platform doesn't have any specific hints for threaded builds.
2679 Assuming POSIX threads, then.)
2687 Perl can be built so that multiple Perl interpreters can coexist
2688 within the same Perl executable.
2691 case "$useithreads" in
2694 This multiple interpreter support is required for interpreter-based threads.
2699 echo 'Normally you do not need this and you should answer no.'
2700 case "$usemultiplicity" in
2701 $define|true|[yY]*) dflt='y';;
2704 rp='Build Perl for multiplicity?'
2707 y|Y) val="$define" ;;
2715 : determine where manual pages are on this system
2719 syspath='/usr/man/man1 /usr/man/mann /usr/man/manl /usr/man/local/man1'
2720 syspath="$syspath /usr/man/u_man/man1 /usr/share/man/man1"
2721 syspath="$syspath /usr/catman/u_man/man1 /usr/man/l_man/man1"
2722 syspath="$syspath /usr/local/man/u_man/man1 /usr/local/man/l_man/man1"
2723 syspath="$syspath /usr/man/man.L /local/man/man1 /usr/local/man/man1"
2724 sysman=`./loc . /usr/man/man1 $syspath`
2727 if $test -d "$sysman"; then
2728 echo "System manual is in $sysman." >&4
2730 echo "Could not find manual pages in source form." >&4
2733 : see what memory models we can support
2736 $cat >pdp11.c <<'EOP'
2745 ( cc -o pdp11 pdp11.c ) >/dev/null 2>&1
2746 if $test -f pdp11 && ./pdp11 2>/dev/null; then
2747 dflt='unsplit split'
2749 tans=`./loc . X /lib/small /lib/large /usr/lib/small /usr/lib/large /lib/medium /usr/lib/medium /lib/huge`
2752 *) if $test -d /lib/small || $test -d /usr/lib/small; then
2757 if $test -d /lib/medium || $test -d /usr/lib/medium; then
2760 if $test -d /lib/large || $test -d /usr/lib/large; then
2763 if $test -d /lib/huge || $test -d /usr/lib/huge; then
2772 Some systems have different model sizes. On most systems they are called
2773 small, medium, large, and huge. On the PDP11 they are called unsplit and
2774 split. If your system doesn't support different memory models, say "none".
2775 If you wish to force everything to one memory model, say "none" here and
2776 put the appropriate flags later when it asks you for other cc and ld flags.
2777 Venix systems may wish to put "none" and let the compiler figure things out.
2778 (In the following question multiple model names should be space separated.)
2780 The default for most systems is "none".
2783 rp="Which memory models are supported?"
2798 '') if $contains '\-i' $sysman/ld.1 >/dev/null 2>&1 || \
2799 $contains '\-i' $sysman/cc.1 >/dev/null 2>&1; then
2806 rp="What flag indicates separate I and D space?"
2814 *large*|*small*|*medium*|*huge*)
2821 rp="What flag indicates large model?"
2831 *huge*) case "$huge" in
2835 rp="What flag indicates huge model?"
2845 *medium*) case "$medium" in
2849 rp="What flag indicates medium model?"
2856 *) medium="$large";;
2859 *small*) case "$small" in
2863 rp="What flag indicates small model?"
2874 echo "Unrecognized memory models--you may have to edit Makefile.SH" >&4
2877 $rm -f pdp11.* pdp11
2879 : make some quick guesses about what we are up against
2881 $echo $n "Hmm... $c"
2891 $cat /usr/include/signal.h /usr/include/sys/signal.h >foo 2>/dev/null
2892 if test -f /osf_boot || $contains 'OSF/1' /usr/include/ctype.h >/dev/null 2>&1
2894 echo "Looks kind of like an OSF/1 system, but we'll see..."
2896 elif test `echo abc | tr a-z A-Z` = Abc ; then
2897 xxx=`./loc addbib blurfl $pth`
2898 if $test -f $xxx; then
2899 echo "Looks kind of like a USG system with BSD features, but we'll see..."
2903 if $contains SIGTSTP foo >/dev/null 2>&1 ; then
2904 echo "Looks kind of like an extended USG system, but we'll see..."
2906 echo "Looks kind of like a USG system, but we'll see..."
2910 elif $contains SIGTSTP foo >/dev/null 2>&1 ; then
2911 echo "Looks kind of like a BSD system, but we'll see..."
2915 echo "Looks kind of like a Version 7 system, but we'll see..."
2918 case "$eunicefix" in
2921 There is, however, a strange, musty smell in the air that reminds me of
2922 something...hmm...yes...I've got it...there's a VMS nearby, or I'm a Blit.
2926 : it so happens the Eunice I know will not run shell scripts in Unix format
2930 echo "Congratulations. You aren't running Eunice."
2934 : Detect OS2. The p_ variable is set above in the Head.U unit.
2939 I have the feeling something is not exactly right, however...don't tell me...
2940 lemme think...does HAL ring a bell?...no, of course, you're only running OS/2!
2945 if test -f /xenix; then
2946 echo "Actually, this looks more like a XENIX system..."
2951 echo "It's not Xenix..."
2956 if test -f /venix; then
2957 echo "Actually, this looks more like a VENIX system..."
2964 echo "Nor is it Venix..."
2967 chmod +x bsd usg v7 osf1 eunice xenix venix os2
2968 $eunicefix bsd usg v7 osf1 eunice xenix venix os2
2971 : see if we need a special compiler
2979 *) if $contains '\-M' $sysman/cc.1 >/dev/null 2>&1 ; then
2980 if $contains '\-M' $sysman/cpp.1 >/dev/null 2>&1; then
2994 On some older systems the default C compiler will not resolve multiple global
2995 references that happen to have the same name. On some such systems the "Mcc"
2996 command may be used to force these to be resolved. On other systems a "cc -M"
2997 command is required. (Note that the -M flag on other systems indicates a
2998 memory model to use!) If you have the Gnu C compiler, you might wish to use
3004 rp="Use which C compiler?"
3012 rp="Use which C compiler?"
3016 : Look for a hint-file generated 'call-back-unit'. Now that the
3017 : user has specified the compiler, we may need to set or change some
3019 if $test -f cc.cbu; then
3023 echo "Checking for GNU cc in disguise and/or its version number..." >&4
3024 $cat >gccvers.c <<EOM
3029 printf("%s\n", __VERSION__);
3031 printf("%s\n", "1");
3037 if $cc -o gccvers gccvers.c; then
3038 gccversion=`./gccvers`
3039 case "$gccversion" in
3040 '') echo "You are not using GNU cc." ;;
3041 *) echo "You are using GNU cc $gccversion."
3046 echo "*** WHOA THERE!!! ***" >&4
3047 echo " Your C compiler \"$cc\" doesn't seem to be working!" >&4
3048 case "$knowitall" in
3050 echo " You'd better start hunting for one and let me know about it." >&4
3056 case "$gccversion" in
3057 1*) cpp=`./loc gcc-cpp $cpp $pth` ;;
3060 : decide how portable to be. Allow command line overrides.
3061 case "$d_portable" in
3063 *) d_portable="$define" ;;
3066 : set up shell script to do ~ expansion
3072 echo \$1 | $sed "s|~|\${HOME-\$LOGDIR}|"
3075 if $test -f /bin/csh; then
3076 /bin/csh -f -c "glob \$1"
3081 name=\`$expr x\$1 : '..\([^/]*\)'\`
3082 dir=\`$sed -n -e "/^\${name}:/{s/^[^:]*:[^:]*:[^:]*:[^:]*:[^:]*:\([^:]*\).*"'\$'"/\1/" -e p -e q -e '}' </etc/passwd\`
3083 if $test ! -d "\$dir"; then
3085 echo "\$me: can't locate home directory for: \$name" >&2
3090 echo \$dir/\`$expr x\$1 : '..[^/]*/\(.*\)'\`
3106 : now set up to get a file name
3110 cat <<'EOSC' >>getfile
3126 expr $fn : '.*(\(.*\)).*' | tr ',' $trnl >getfile.ok
3127 fn=`echo $fn | sed 's/(.*)//'`
3133 loc_file=`expr $fn : '.*:\(.*\)'`
3134 fn=`expr $fn : '\(.*\):.*'`
3142 */*) fullpath=true;;
3151 *e*) exp_file=true;;
3154 *p*) nopath_ok=true;;
3159 *d*) type='Directory';;
3160 *l*) type='Locate';;
3165 Locate) what='File';;
3170 case "$d_portable" in
3178 while test "$type"; do
3183 true) rp="$rp (~name ok)";;
3186 if test -f UU/getfile.ok && \
3187 $contains "^$ans\$" UU/getfile.ok >/dev/null 2>&1
3206 value=`UU/filexp $ans`
3209 if test "$ans" != "$value"; then
3210 echo "(That expands to $value on this system.)"
3224 /*) value="$ansexp" ;;
3229 echo "I shall only accept a full path name, as in /bin/ls." >&4
3230 echo "Use a ! shell escape if you wish to check pathnames." >&4
3233 echo "Please give a full path name, starting with slash." >&4
3236 echo "Note that using ~name is ok provided it expands well." >&4
3249 for fp in $gfpth; do
3250 if test "X$fp" = X.; then
3255 if test -f "$pf"; then
3257 elif test -r "$pf" || (test -h "$pf") >/dev/null 2>&1
3259 echo "($value is not a plain file, but that's ok.)"
3262 if test X"$type" = X; then
3269 for fp in $gfpth; do
3270 if test "X$fp" = X.; then
3275 if test -d "$pf"; then
3283 if test -d "$ansexp"; then
3284 echo "(Looking for $loc_file in directory $value.)"
3285 value="$value/$loc_file"
3286 ansexp="$ansexp/$loc_file"
3288 if test -f "$ansexp"; then
3291 case "$nopath_ok" in
3292 true) case "$value" in
3294 *) echo "Assuming $value will be in people's path."
3310 if test "$fastread" = yes; then
3315 rp="$what $value doesn't exist. Use that name anyway?"
3334 test "X$gfpthkeep" != Xy && gfpth=""
3337 : What should the include directory be ?
3339 $echo $n "Hmm... $c"
3343 if $test -f /bin/mips && /bin/mips; then
3344 echo "Looks like a MIPS system..."
3345 $cat >usr.c <<'EOCP'
3346 #ifdef SYSTYPE_BSD43
3350 if $cc -E usr.c > usr.out && $contains / usr.out >/dev/null 2>&1; then
3351 dflt='/bsd43/usr/include'
3355 mips_type='System V'
3357 $rm -f usr.c usr.out
3358 echo "and you're compiling with the $mips_type compiler and libraries."
3362 echo "Doesn't look like a MIPS system."
3372 case "$xxx_prompt" in
3375 rp='Where are the include files you want to use?'
3383 : see how we invoke the C preprocessor
3385 echo "Now, how can we feed standard input to your C preprocessor..." >&4
3386 cat <<'EOT' >testcpp.c
3392 if test ! -f cppstdin; then
3393 if test "X$osname" = "Xaix" -a "X$gccversion" = X; then
3394 # AIX cc -E doesn't show the absolute headerfile
3395 # locations but we'll cheat by using the -M flag.
3396 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
3398 echo 'cat >.$$.c; '"$cc"' -E ${1+"$@"} .$$.c; rm .$$.c' >cppstdin
3401 echo "Keeping your $hint cppstdin wrapper."
3404 wrapper=`pwd`/cppstdin
3408 if $test "X$cppstdin" != "X" && \
3409 $cppstdin $cppminus <testcpp.c >testcpp.out 2>&1 && \
3410 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
3412 echo "You used to use $cppstdin $cppminus so we'll use that again."
3414 '') echo "But let's see if we can live without a wrapper..." ;;
3416 if $cpprun $cpplast <testcpp.c >testcpp.out 2>&1 && \
3417 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
3419 echo "(And we'll use $cpprun $cpplast to preprocess directly.)"
3422 echo "(However, $cpprun $cpplast does not work, let's see...)"
3430 echo "Good old $cppstdin $cppminus does not seem to be of any help..."
3437 elif echo 'Maybe "'"$cc"' -E" will work...'; \
3438 $cc -E <testcpp.c >testcpp.out 2>&1; \
3439 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3440 echo "Yup, it does."
3443 elif echo 'Nope...maybe "'"$cc"' -E -" will work...'; \
3444 $cc -E - <testcpp.c >testcpp.out 2>&1; \
3445 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3446 echo "Yup, it does."
3449 elif echo 'Nope...maybe "'"$cc"' -P" will work...'; \
3450 $cc -P <testcpp.c >testcpp.out 2>&1; \
3451 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3452 echo "Yipee, that works!"
3455 elif echo 'Nope...maybe "'"$cc"' -P -" will work...'; \
3456 $cc -P - <testcpp.c >testcpp.out 2>&1; \
3457 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3458 echo "At long last!"
3461 elif echo 'No such luck, maybe "'$cpp'" will work...'; \
3462 $cpp <testcpp.c >testcpp.out 2>&1; \
3463 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3467 elif echo 'Nixed again...maybe "'$cpp' -" will work...'; \
3468 $cpp - <testcpp.c >testcpp.out 2>&1; \
3469 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3470 echo "Hooray, it works! I was beginning to wonder."
3473 elif echo 'Uh-uh. Time to get fancy. Trying a wrapper...'; \
3474 $wrapper <testcpp.c >testcpp.out 2>&1; \
3475 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3481 rp="No dice. I can't find a C preprocessor. Name one:"
3485 $x_cpp <testcpp.c >testcpp.out 2>&1
3486 if $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3487 echo "OK, that will do." >&4
3489 echo "Sorry, I can't get that to work. Go find one and rerun Configure." >&4
3504 echo "Perhaps can we force $cc -E using a wrapper..."
3505 if $wrapper <testcpp.c >testcpp.out 2>&1; \
3506 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
3512 echo "Nope, we'll have to live without it..."
3526 "$wrapper"|'cppstdin') ;;
3527 *) $rm -f $wrapper;;
3529 $rm -f testcpp.c testcpp.out
3531 : Set private lib path
3534 plibpth="$incpath/usr/lib /usr/local/lib /usr/ccs/lib"
3539 '') dlist="$loclibpth $plibpth $glibpth";;
3540 *) dlist="$libpth";;
3543 : Now check and see which directories actually exist, avoiding duplicates
3547 if $test -d $xxx; then
3550 *) libpth="$libpth $xxx";;
3556 Some systems have incompatible or broken versions of libraries. Among
3557 the directories listed in the question below, please remove any you
3558 know not to be holding relevant libraries, and add any that are needed.
3559 Say "none" for none.
3570 rp="Directories to use for library searches?"
3577 : compute shared library extension
3580 if xxx=`./loc libc.sl X $libpth`; $test -f "$xxx"; then
3590 On some systems, shared libraries may be available. Answer 'none' if
3591 you want to suppress searching of shared libraries for the remainder
3592 of this configuration.
3595 rp='What is the file extension used for shared libraries?'
3599 : Define several unixisms.
3600 : Hints files or command line option can be used to override them.
3601 : The convoluted testing is in case hints files set either the old
3604 '') case "$exe_ext" in
3606 *) _exe="$exe_ext" ;;
3611 '') case "$lib_ext" in
3618 '') case "$obj_ext" in
3625 '') case "$path_sep" in
3636 : Which makefile gets called first. This is used by make depend.
3637 case "$firstmakefile" in
3638 '') firstmakefile='makefile';;
3643 Perl can be built to use the SOCKS proxy protocol library. To do so,
3644 Configure must be run with -Dusesocks.
3646 Normally you do not need this and you should answer no.
3650 $define|true|[yY]*) dflt='y';;
3653 rp='Build Perl for SOCKS?'
3656 y|Y) val="$define" ;;
3662 : Looking for optional libraries
3664 echo "Checking for optional libraries..." >&4
3669 case "$libswanted" in
3670 '') libswanted='c_s';;
3674 libswanted="$libswanted socks5 socks5_sh"
3677 for thislib in $libswanted; do
3680 if xxx=`./loc lib$thislib.$so.[0-9]'*' X $libpth`; $test -f "$xxx"; then
3681 if $test -a "X$ignore_versioned_solibs" = "X"; then
3686 elif xxx=`./loc lib$thislib.$so X $libpth` ; $test -f "$xxx"; then
3688 elif xxx=`./loc lib$thislib$_a X $libpth`; $test -f "$xxx"; then
3690 elif xxx=`./loc $thislib$_a X $libpth`; $test -f "$xxx"; then
3692 elif xxx=`./loc lib${thislib}_s$_a X $libpth`; $test -f "$xxx"; then
3694 libname=${thislib}_s
3695 elif xxx=`./loc Slib$thislib$_a X $xlibpth`; $test -f "$xxx"; then
3698 if $test -f "$xxx"; then
3699 if test X"$osname" = Xhpux -a -f /lib/pa20_64/libc.sl; then
3700 case "`file $xxx`" in
3702 *) xxx=/non/64/bit/$xxx ;;
3706 if $test -f "$xxx"; then
3708 shared) echo "Found -l$libname (shared)." ;;
3709 static) echo "Found -l$libname." ;;
3710 *) echo "Found -l$libname ($libstyle)." ;;
3714 *) dflt="$dflt -l$libname";;
3717 echo "No -l$thislib."
3728 ' '|'') dflt='none';;
3733 In order to compile $package on your machine, a number of libraries
3734 are usually needed. Include any other special libraries here as well.
3735 Say "none" for none. The default list is almost always right.
3739 rp="What libraries to use?"
3746 : determine optimization, if desired, or use for debug flag also
3748 ' '|$undef) dflt='none';;
3750 *) dflt="$optimize";;
3754 By default, $package compiles with the -O flag to use the optimizer.
3755 Alternately, you might want to use the symbolic debugger, which uses
3756 the -g flag (on traditional Unix systems). Either flag can be
3757 specified here. To use neither flag, specify the word "none".
3760 rp="What optimizer/debugger flag should be used?"
3764 'none') optimize=" ";;
3768 : We will not override a previous value, but we might want to
3769 : augment a hint file
3771 default|recommended)
3772 case "$gccversion" in
3773 1*) dflt='-fpcc-struct-return' ;;
3776 *-g*) dflt="$dflt -DDEBUGGING";;
3778 case "$gccversion" in
3779 2*) if test -d /etc/conf/kconfig.d &&
3780 $contains _POSIX_VERSION $usrinc/sys/unistd.h >/dev/null 2>&1
3786 case "$gccversion" in
3790 echo "Checking if your compiler accepts -fno-strict-aliasing" 2>&1
3791 echo 'int main(void) { return 0; }' > gcctest.c
3792 if $cc -O2 -fno-strict-aliasing -o gcctest gcctest.c; then
3793 echo "Yes, it does." 2>&1
3796 echo "Leaving current flags $ccflags alone." 2>&1
3798 *) dflt="$dflt -fno-strict-aliasing" ;;
3801 echo "Nope, it doesn't, but that's ok." 2>&1
3808 case "$mips_type" in
3809 *BSD*|'') inclwanted="$locincpth $usrinc";;
3810 *) inclwanted="$locincpth $inclwanted $usrinc/bsd";;
3812 for thisincl in $inclwanted; do
3813 if $test -d $thisincl; then
3814 if $test x$thisincl != x$usrinc; then
3817 *) dflt="$dflt -I$thisincl";;
3823 inctest='if $contains $2 $usrinc/$1 >/dev/null 2>&1; then
3825 elif $contains $2 $usrinc/sys/$1 >/dev/null 2>&1; then
3833 *) dflt="$dflt -D$2";;
3837 set signal.h LANGUAGE_C; eval $inctest
3841 ccflags="$ccflags -DSOCKS"
3846 default|recommended) dflt="$ccflags $dflt" ;;
3847 *) dflt="$ccflags";;
3855 Your C compiler may want other flags. For this question you should include
3856 -I/whatever and -DWHATEVER flags and any other flags used by the C compiler,
3857 but you should NOT include libraries or ld flags like -lwhatever. If you
3858 want $package to honor its debug switch, you should include -DDEBUGGING here.
3859 Your C compiler might also need additional flags, such as -D_POSIX_SOURCE.
3861 To use no flags, specify the word "none".
3867 rp="Any additional cc flags?"
3874 : the following weeds options from ccflags that are of no interest to cpp
3876 case "$gccversion" in
3877 1*) cppflags="$cppflags -D__GNUC__"
3879 case "$mips_type" in
3881 *BSD*) cppflags="$cppflags -DSYSTYPE_BSD43";;
3887 echo "Let me guess what the preprocessor flags are..." >&4
3901 *) ftry="$previous $flag";;
3903 if $cppstdin -DLFRULB=bar $cppflags $ftry $cppminus <cpp.c \
3904 >cpp1.out 2>/dev/null && \
3905 $cpprun -DLFRULB=bar $cppflags $ftry $cpplast <cpp.c \
3906 >cpp2.out 2>/dev/null && \
3907 $contains 'foo.*xx.*bar' cpp1.out >/dev/null 2>&1 && \
3908 $contains 'foo.*xx.*bar' cpp2.out >/dev/null 2>&1
3910 cppflags="$cppflags $ftry"
3920 *-*) echo "They appear to be: $cppflags";;
3922 $rm -f cpp.c cpp?.out
3926 : flags used in final linking phase
3928 '') if ./venix; then
3934 *-posix*) dflt="$dflt -posix" ;;
3937 *) dflt="$ldflags";;
3940 : Try to guess additional flags to pick up local libraries.
3941 for thislibdir in $libpth; do
3942 case " $loclibpth " in
3945 *"-L$thislibdir "*) ;;
3946 *) dflt="$dflt -L$thislibdir" ;;
3958 Your C linker may need flags. For this question you should
3959 include -L/whatever and any other flags used by the C linker, but you
3960 should NOT include libraries like -lwhatever.
3962 Make sure you include the appropriate -L/path flags if your C linker
3963 does not normally search all of the directories you specified above,
3966 To use no flags, specify the word "none".
3970 rp="Any additional ld flags (NOT including libraries)?"
3976 rmlist="$rmlist pdp11"
3980 echo "Checking your choice of C compiler and flags for coherency..." >&4
3981 $cat > try.c <<'EOF'
3983 int main() { printf("Ok\n"); exit(0); }
3985 set X $cc $optimize $ccflags -o try $ldflags try.c $libs
3987 $cat >try.msg <<'EOM'
3988 I've tried to compile and run the following simple program:
3991 $cat try.c >> try.msg
3993 $cat >> try.msg <<EOM
4000 and I got the following output:
4004 if sh -c "$cc $optimize $ccflags -o try $ldflags try.c $libs" >>try.msg 2>&1; then
4005 if sh -c './try' >>try.msg 2>&1; then
4009 *) echo 'The program compiled OK, but produced no output.' >> try.msg
4012 cat >> try.msg <<'EOQS'
4013 If $libs contains -lsfio, and sfio is mis-configured, then it
4014 sometimes (apparently) runs and exits with a 0 status, but with no
4015 output! It may have to do with sfio's use of _exit vs. exit.
4018 rp="You have a big problem. Shall I abort Configure"
4025 echo "The program compiled OK, but exited with status $?." >>try.msg
4026 rp="You have a problem. Shall I abort Configure"
4030 echo "I can't compile the test program." >>try.msg
4031 rp="You have a BIG problem. Shall I abort Configure"
4037 case "$knowitall" in
4039 echo "(The supplied flags or libraries might be incorrect.)"
4047 *) echo "Ok. Stopping Configure." >&4
4052 n) echo "OK, that should do.";;
4054 $rm -f try try.* core
4056 : define an is-a-typedef? function
4057 typedef='type=$1; var=$2; def=$3; shift; shift; shift; inclist=$@;
4059 "") inclist="sys/types.h";;
4061 eval "varval=\$$var";
4065 for inc in $inclist; do
4066 echo "#include <$inc>" >>temp.c;
4068 echo "#ifdef $type" >> temp.c;
4069 echo "printf(\"We have $type\");" >> temp.c;
4070 echo "#endif" >> temp.c;
4071 $cppstdin $cppflags $cppminus < temp.c >temp.E 2>/dev/null;
4072 if $contains $type temp.E >/dev/null 2>&1; then
4078 *) eval "$var=\$varval";;
4081 : define an is-a-typedef? function that prompts if the type is not available.
4082 typedef_ask='type=$1; var=$2; def=$3; shift; shift; shift; inclist=$@;
4084 "") inclist="sys/types.h";;
4086 eval "varval=\$$var";
4090 for inc in $inclist; do
4091 echo "#include <$inc>" >>temp.c;
4093 echo "#ifdef $type" >> temp.c;
4094 echo "printf(\"We have $type\");" >> temp.c;
4095 echo "#endif" >> temp.c;
4096 $cppstdin $cppflags $cppminus < temp.c >temp.E 2>/dev/null;
4098 echo "$rp" | $sed -e "s/What is/Looking for/" -e "s/?/./";
4099 if $contains $type temp.E >/dev/null 2>&1; then
4100 echo "$type found." >&4;
4103 echo "$type NOT found." >&4;
4109 *) eval "$var=\$varval";;
4112 : define a shorthand compile call
4116 $cc $optimize $ccflags $ldflags -o ${mc_file} $* ${mc_file}.c $libs > /dev/null 2>&1;'
4117 : define a shorthand compile call for compilations that should be ok.
4121 $cc $optimize $ccflags $ldflags -o ${mc_file} $* ${mc_file}.c $libs;'
4123 : check for lengths of integral types
4127 echo "Checking to see how big your integers are..." >&4
4128 $cat >intsize.c <<'EOCP'
4132 printf("intsize=%d;\n", (int)sizeof(int));
4133 printf("longsize=%d;\n", (int)sizeof(long));
4134 printf("shortsize=%d;\n", (int)sizeof(short));
4139 if eval $compile_ok && ./intsize > /dev/null; then
4141 echo "Your integers are $intsize bytes long."
4142 echo "Your long integers are $longsize bytes long."
4143 echo "Your short integers are $shortsize bytes long."
4147 Help! I can't compile and run the intsize test program: please enlighten me!
4148 (This is probably a misconfiguration in your system or libraries, and
4149 you really ought to fix it. Still, I'll try anyway.)
4153 rp="What is the size of an integer (in bytes)?"
4157 rp="What is the size of a long integer (in bytes)?"
4161 rp="What is the size of a short integer (in bytes)?"
4167 $rm -f intsize intsize.*
4169 : see what type lseek is declared as in the kernel
4170 rp="What is the type used for lseek's offset on this system?"
4171 set off_t lseektype long stdio.h sys/types.h
4175 $echo $n "Checking to see how big your file offsets are...$c" >&4
4177 #include <sys/types.h>
4181 printf("%d\n", (int)sizeof($lseektype));
4186 if eval $compile_ok; then
4188 $echo " $lseeksize bytes." >&4
4192 echo "(I can't seem to compile the test program. Guessing...)"
4193 rp="What is the size of your file offsets (in bytes)?"
4199 : see what type file positions are declared as in the library
4200 rp="What is the type for file position used by fsetpos()?"
4201 set fpos_t fpostype long stdio.h sys/types.h
4206 *_t) zzz="$fpostype" ;;
4209 $echo $n "Checking the size of $zzz...$c" >&4
4211 #include <sys/types.h>
4214 printf("%d\n", (int)sizeof($fpostype));
4219 if eval $compile_ok; then
4224 echo "(I can't execute the test program--guessing $fpossize.)" >&4
4227 echo " $fpossize bytes."
4233 echo "(I can't compile the test program. Guessing...)" >&4
4234 rp="What is the size of your file positions (in bytes)?"
4241 case "$lseeksize:$fpossize" in
4244 You can have files larger than 2 gigabytes.
4249 Perl can be built to understand large files (files larger than 2 gigabytes)
4250 on some systems. To do so, Configure must be run with -Duselargefiles.
4252 If this doesn't make any sense to you, just accept the default 'y'.
4254 case "$uselargefiles" in
4255 "$undef"|false|[nN]*) dflt='n' ;;
4258 rp='Try to understand large files, if available?'
4261 y|Y) val="$define" ;;
4268 case "$uselargefiles" in
4270 : Look for a hint-file generated 'call-back-unit'. If the
4271 : user has specified that a large files perl is to be built,
4272 : we may need to set or change some other defaults.
4273 if $test -f uselfs.cbu; then
4274 echo "Your platform has some specific hints for large file builds, using them..."
4277 $echo $n "Rechecking to see how big your file offsets are...$c" >&4
4279 #include <sys/types.h>
4283 printf("%d\n", (int)sizeof($lseektype));
4288 if eval $compile_ok; then
4290 $echo " $lseeksize bytes." >&4
4294 echo "(I can't seem to compile the test program. Guessing...)"
4295 rp="What is the size of your file offsets (in bytes)?"
4300 *_t) zzz="$fpostype" ;;
4303 $echo $n "Rechecking the size of $zzz...$c" >&4
4305 #include <sys/types.h>
4308 printf("%d\n", (int)sizeof($fpostype));
4313 if eval $compile_ok; then
4318 echo "(I can't execute the test program--guessing $fpossize.)" >&4
4321 echo " $fpossize bytes."
4327 echo "(I can't compile the test program. Guessing...)" >&4
4328 rp="What is the size of your file positions (in bytes)?"
4338 case "$usemorebits" in
4339 "$define"|true|[yY]*)
4341 uselongdouble="$define"
4342 usemorebits="$define"
4344 *) usemorebits="$undef"
4349 case "$intsize:$longsize" in
4352 You have natively 64-bit integers.
4357 Perl can be built to take advantage of 64-bit integer types
4358 on some systems. To do so, Configure must be run with -Duse64bits.
4360 If this doesn't make any sense to you, just accept the default.
4362 case "$use64bits" in
4363 $define|true|[yY]*) dflt='y';;
4366 rp='Try to use 64-bit integers, if available?'
4369 y|Y) val="$define" ;;
4377 case "$archname64" in
4378 '') archname64='' ;; # not a typo
4381 case "$use64bits" in
4382 "$define"|true|[yY]*)
4383 : Look for a hint-file generated 'call-back-unit'. If the
4384 : user has specified that a 64-bit perl is to be built,
4385 : we may need to set or change some other defaults.
4386 if $test -f use64bits.cbu; then
4387 echo "Your platform has some specific hints for 64-bit builds, using them..."
4391 (Your platform doesn't have any specific hints for 64-bit builds.)
4393 case "$intsize:$longsize" in
4395 (This is probably okay, as your system is a natively 64-bit system.)
4399 case "$gccversion" in
4401 *) case "$ccflags" in
4402 *-DUSE_LONG_LONG*) ;;
4404 But since you seem to be using gcc, I will now add -DUSE_LONG_LONG
4405 to the compilation flags.
4407 ccflags="$ccflags -DUSE_LONG_LONG"
4416 : determine the architecture name
4418 if xxx=`./loc arch blurfl $pth`; $test -f "$xxx"; then
4419 tarch=`arch`"-$osname"
4420 elif xxx=`./loc uname blurfl $pth`; $test -f "$xxx" ; then
4421 if uname -m > tmparch 2>&1 ; then
4422 tarch=`$sed -e 's/ *$//' -e 's/ /_/g' \
4423 -e 's/$/'"-$osname/" tmparch`
4431 case "$myarchname" in
4434 echo "(Your architecture name used to be $myarchname.)"
4441 *) dflt="$archname";;
4443 rp='What is your architecture name'
4446 case "$usethreads" in
4448 echo "Threads selected." >&4
4450 *-thread*) echo "...and architecture name already has -thread." >&4
4452 *) archname="$archname-thread"
4453 echo "...setting architecture name to $archname." >&4
4458 case "$usemultiplicity" in
4460 echo "Multiplicity selected." >&4
4462 *-multi*) echo "...and architecture name already has -multi." >&4
4464 *) archname="$archname-multi"
4465 echo "...setting architecture name to $archname." >&4
4470 case "$use64bits" in
4472 case "$archname64" in
4477 *-$archname64*) echo "...and architecture name already has $archname64." >&4
4479 *) archname="$archname-$archname64"
4480 echo "...setting architecture name to $archname." >&4
4487 : determine root of directory hierarchy where package will be installed.
4490 dflt=`./loc . /usr/local /usr/local /local /opt /usr`
4498 By default, $package will be installed in $dflt/bin, manual pages
4499 under $dflt/man, etc..., i.e. with $dflt as prefix for all
4500 installation directories. Typically this is something like /usr/local.
4501 If you wish to have binaries under /usr/bin but other parts of the
4502 installation under /usr/local, that's ok: you will be prompted
4503 separately for each of the installation directories, the prefix being
4504 only used to set the defaults.
4508 rp='Installation prefix to use?'
4516 *) oldprefix="$prefix";;
4526 $define|true) afs=true ;;
4527 $undef|false) afs=false ;;
4528 *) if test -d /afs; then
4536 echo "AFS may be running... I'll be extra cautious then..." >&4
4538 echo "AFS does not seem to be running..." >&4
4541 : determine installation prefix for where package is to be installed.
4545 Since you are running AFS, I need to distinguish the directory in which
4546 files will reside from the directory in which they are installed (and from
4547 which they are presumably copied to the former directory by occult means).
4550 case "$installprefix" in
4551 '') dflt=`echo $prefix | sed 's#^/afs/#/afs/.#'`;;
4552 *) dflt="$installprefix";;
4557 In some special cases, particularly when building $package for distribution,
4558 it is convenient to distinguish between the directory in which files should
4559 be installed from the directory ($prefix) in which they
4560 will eventually reside. For most users, these two directories are the same.
4563 case "$installprefix" in
4565 *) dflt=$installprefix;;
4569 rp='What installation prefix should I use for installing files?'
4571 installprefix="$ans"
4572 installprefixexp="$ansexp"
4574 : set the prefixit variable, to compute a suitable default value
4575 prefixit='case "$3" in
4577 case "$oldprefix" in
4578 "") eval "$1=\"\$$2\"";;
4585 ""|" ") eval "$1=\"\$$2\"";;
4591 eval "tp=\"$oldprefix-\$$2-\""; eval "tp=\"$tp\"";
4593 --|/*--|\~*--) eval "$1=\"$prefix/$3\"";;
4594 /*-$oldprefix/*|\~*-$oldprefix/*)
4595 eval "$1=\`echo \$$2 | sed \"s,^$oldprefix,$prefix,\"\`";;
4596 *) eval "$1=\"\$$2\"";;
4600 : set the base revision
4604 : get the patchlevel
4606 echo "Getting the current patchlevel..." >&4
4607 if $test -r $rsrc/patchlevel.h;then
4608 patchlevel=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
4609 subversion=`awk '/define[ ]+PERL_SUBVERSION/ {print $3}' $rsrc/patchlevel.h`
4610 api_revision=`awk '/define[ ]+PERL_API_REVISION/ {print $3}' $rsrc/patchlevel.h`
4611 api_version=`awk '/define[ ]+PERL_API_VERSION/ {print $3}' $rsrc/patchlevel.h`
4612 api_subversion=`awk '/define[ ]+PERL_API_SUBVERSION/ {print $3}' $rsrc/patchlevel.h`
4620 $echo $n "(You have $package" $c
4623 *) $echo $n " $baserev" $c ;;
4625 $echo $n " patchlevel $patchlevel" $c
4626 test 0 -eq "$subversion" || $echo $n " subversion $subversion" $c
4629 dos|cygwin|vms|win32)
4630 : XXX Should be a Configure test for double-dots in filenames.
4631 version=`echo $baserev $patchlevel $subversion | \
4632 $awk '{ printf "%d_%d_%d\n", $1, $2, $3 }'`
4633 api_versionstring=`echo $api_revision $api_version $api_subversion | \
4634 $awk '{ printf "%d_%d_%d\n", $1, $2, $3 }'`
4637 version=`echo $baserev $patchlevel $subversion | \
4638 $awk '{ printf "%d.%d.%d\n", $1, $2, $3 }'`
4639 api_versionstring=`echo $api_revision $api_version $api_subversion | \
4640 $awk '{ printf "%d.%d.%d\n", $1, $2, $3 }'`
4643 : Special case the 5.005_xx maintenance series, which used 5.005
4644 : without any subversion label as a subdirectory in $sitelib
4645 if test "${api_revision}${api_version}${api_subversion}" = "550"; then
4646 api_versionstring='5.005'
4649 : determine installation style
4650 : For now, try to deduce it from prefix unless it is already set.
4651 : Reproduce behavior of 5.005 and earlier, maybe drop that in 5.7.
4652 case "$installstyle" in
4653 '') case "$prefix" in
4654 *perl*) dflt='lib';;
4655 *) dflt='lib/perl5' ;;
4658 *) dflt='lib/perl5' ;;
4660 : Probably not worth prompting for this since we prompt for all
4661 : the directories individually, and the prompt would be too long and
4665 : determine where private library files go
4666 : Usual default is /usr/local/lib/perl5/$version.
4667 : Also allow things like /opt/perl/lib/$version, since
4668 : /opt/perl/lib/perl5... would be redundant.
4669 : The default "style" setting is made in installstyle.U
4670 case "$installstyle" in
4671 *lib/perl5*) set dflt privlib lib/$package/$version ;;
4672 *) set dflt privlib lib/$version ;;
4677 There are some auxiliary files for $package that need to be put into a
4678 private library directory that is accessible by everyone.
4682 rp='Pathname where the private library files will reside?'
4685 privlibexp="$ansexp"
4686 : Change installation prefix, if necessary.
4687 if $test X"$prefix" != X"$installprefix"; then
4688 installprivlib=`echo $privlibexp | sed "s#^$prefix#$installprefix#"`
4690 installprivlib="$privlibexp"
4693 : set the prefixup variable, to restore leading tilda escape
4694 prefixup='case "$prefixexp" in
4696 *) eval "$1=\`echo \$$1 | sed \"s,^$prefixexp,$prefix,\"\`";;
4699 : determine where public architecture dependent libraries go
4702 : privlib default is /usr/local/lib/$package/$version
4703 : archlib default is /usr/local/lib/$package/$version/$archname
4704 : privlib may have an optional trailing /share.
4705 tdflt=`echo $privlib | $sed 's,/share$,,'`
4706 tdflt=$tdflt/$archname
4715 $spackage contains architecture-dependent library files. If you are
4716 sharing libraries in a heterogeneous environment, you might store
4717 these files in a separate location. Otherwise, you can just include
4718 them with the rest of the public library files.
4722 rp='Where do you want to put the public architecture-dependent libraries?'
4725 archlibexp="$ansexp"
4726 if $test X"$archlib" = X"$privlib"; then
4731 : Change installation prefix, if necessary.
4732 if $test X"$prefix" != X"$installprefix"; then
4733 installarchlib=`echo $archlibexp | sed "s#^$prefix#$installprefix#"`
4735 installarchlib="$archlibexp"
4739 : Binary compatibility with 5.005 is not possible for builds
4740 : with advanced features
4741 case "$usethreads$usemultiplicity" in
4743 bincompat5005="$undef"
4744 d_bincompat5005="$undef"
4748 Perl 5.006 can be compiled for binary compatibility with 5.005.
4749 If you decide to do so, you will be able to continue using most
4750 of the extensions that were compiled for Perl 5.005.
4753 case "$bincompat5005$d_bincompat5005" in
4754 *"$undef"*) dflt=n ;;
4757 rp='Binary compatibility with Perl 5.005?'
4760 y*) val="$define" ;;
4765 case "$d_bincompat5005" in
4767 bincompat5005="$define"
4769 *) bincompat5005="$undef"
4770 d_bincompat5005="$undef"
4777 : see if setuid scripts can be secure
4780 Some kernels have a bug that prevents setuid #! scripts from being
4781 secure. Some sites have disabled setuid #! scripts because of this.
4783 First let's decide if your kernel supports secure setuid #! scripts.
4784 (If setuid #! scripts would be secure but have been disabled anyway,
4785 don't say that they are secure if asked.)
4790 if $test -d /dev/fd; then
4791 echo "#!$ls" >reflect
4792 chmod +x,u+s reflect
4793 ./reflect >flect 2>&1
4794 if $contains "/dev/fd" flect >/dev/null; then
4795 echo "Congratulations, your kernel has secure setuid scripts!" >&4
4799 If you are not sure if they are secure, I can check but I'll need a
4800 username and password different from the one you are using right now.
4801 If you don't have such a username or don't want me to test, simply
4805 rp='Other username to test security of setuid scripts with?'
4810 case "$d_suidsafe" in
4811 '') echo "I'll assume setuid scripts are *not* secure." >&4
4814 echo "Well, the $hint value is *not* secure." >&4
4816 *) echo "Well, the $hint value *is* secure." >&4
4821 $rm -f reflect flect
4822 echo "#!$ls" >reflect
4823 chmod +x,u+s reflect
4826 echo '"su" will (probably) prompt you for '"$ans's password."
4827 su $ans -c './reflect >flect'
4828 if $contains "/dev/fd" flect >/dev/null; then
4829 echo "Okay, it looks like setuid scripts are secure." >&4
4832 echo "I don't think setuid scripts are secure." >&4
4837 rp='Does your kernel have *secure* setuid scripts?'
4840 [yY]*) val="$define";;
4845 echo "I don't think setuid scripts are secure (no /dev/fd directory)." >&4
4846 echo "(That's for file descriptors, not floppy disks.)"
4852 $rm -f reflect flect
4854 : now see if they want to do setuid emulation
4857 case "$d_suidsafe" in
4860 echo "No need to emulate SUID scripts since they are secure here." >& 4
4864 Some systems have disabled setuid scripts, especially systems where
4865 setuid scripts cannot be secure. On systems where setuid scripts have
4866 been disabled, the setuid/setgid bits on scripts are currently
4867 useless. It is possible for $package to detect those bits and emulate
4868 setuid/setgid in a secure fashion. This emulation will only work if
4869 setuid scripts have been disabled in your kernel.
4873 "$define") dflt=y ;;
4876 rp="Do you want to do setuid/setgid emulation?"
4879 [yY]*) val="$define";;
4887 : determine filename position in cpp output
4889 echo "Computing filename position in cpp output for #include directives..." >&4
4890 echo '#include <stdio.h>' > foo.c
4893 $cppstdin $cppflags $cppminus <foo.c 2>/dev/null | \
4894 $grep '^[ ]*#.*stdio\.h' | \
4895 while read cline; do
4898 while $test \$# -gt 0; do
4899 if $test -r \`echo \$1 | $tr -d '"'\`; then
4904 pos=\`expr \$pos + 1\`
4916 *) pos="${fieldn}th";;
4918 echo "Your cpp writes the filename in the $pos field of the line."
4920 : locate header file
4925 for usrincdir in $usrinc
4927 if test -f \$usrincdir/\$wanted; then
4928 echo "\$usrincdir/\$wanted"
4932 awkprg='{ print \$$fieldn }'
4933 echo "#include <\$wanted>" > foo\$\$.c
4934 $cppstdin $cppminus $cppflags < foo\$\$.c 2>/dev/null | \
4935 $grep "^[ ]*#.*\$wanted" | \
4936 while read cline; do
4937 name=\`echo \$cline | $awk "\$awkprg" | $tr -d '"'\`
4939 *[/\\\\]\$wanted) echo "\$name"; exit 1;;
4940 *[\\\\/]\$wanted) echo "\$name"; exit 1;;
4945 # status = 0: grep returned 0 lines, case statement not executed
4946 # status = 1: headerfile found
4947 # status = 2: while loop executed, no headerfile found
4951 if test \$status -eq 1; then
4958 : define an alternate in-header-list? function
4959 inhdr='echo " "; td=$define; tu=$undef; yyy=$@;
4960 cont=true; xxf="echo \"<\$1> found.\" >&4";
4961 case $# in 2) xxnf="echo \"<\$1> NOT found.\" >&4";;
4962 *) xxnf="echo \"<\$1> NOT found, ...\" >&4";;
4964 case $# in 4) instead=instead;; *) instead="at last";; esac;
4965 while $test "$cont"; do
4967 var=$2; eval "was=\$$2";
4968 if $test "$xxx" && $test -r "$xxx";
4970 eval "case \"\$$var\" in $undef) . ./whoa; esac"; eval "$var=\$td";
4973 eval "case \"\$$var\" in $define) . ./whoa; esac"; eval "$var=\$tu"; fi;
4974 set $yyy; shift; shift; yyy=$@;
4975 case $# in 0) cont="";;
4976 2) xxf="echo \"but I found <\$1> $instead.\" >&4";
4977 xxnf="echo \"and I did not find <\$1> either.\" >&4";;
4978 *) xxf="echo \"but I found <\$1\> instead.\" >&4";
4979 xxnf="echo \"there is no <\$1>, ...\" >&4";;
4983 do set $yyy; var=$2; eval "was=\$$2";
4984 eval "case \"\$$var\" in $define) . ./whoa; esac"; eval "$var=\$tu";
4985 set $yyy; shift; shift; yyy=$@;
4988 : see if this is a malloc.h system
4989 set malloc.h i_malloc
4992 : see if stdlib is available
4993 set stdlib.h i_stdlib
4996 : determine which malloc to compile in
4998 case "$usemymalloc" in
4999 ''|[yY]*|true|$define) dflt='y' ;;
5002 rp="Do you wish to attempt to use the malloc that comes with $package?"
5008 mallocsrc='malloc.c'
5009 mallocobj="malloc$_o"
5010 d_mymalloc="$define"
5013 : Remove malloc from list of libraries to use
5014 echo "Removing unneeded -lmalloc from library list" >&4
5015 set `echo X $libs | $sed -e 's/-lmalloc / /' -e 's/-lmalloc$//'`
5018 echo "libs = $libs" >&4
5030 : compute the return types of malloc and free
5032 $cat >malloc.c <<END
5036 #include <sys/types.h>
5050 case "$malloctype" in
5052 if $cc $ccflags -c -DTRY_MALLOC malloc.c >/dev/null 2>&1; then
5059 echo "Your system wants malloc to return '$malloctype', it would seem." >&4
5063 if $cc $ccflags -c -DTRY_FREE malloc.c >/dev/null 2>&1; then
5070 echo "Your system uses $freetype free(), it would seem." >&4
5074 The installation process will also create a directory for
5075 vendor-supplied add-ons. Vendors who supply perl with their system
5076 may find it convenient to place all vendor-supplied files in this
5077 directory rather than in the main distribution directory. This will
5078 ease upgrades between binary-compatible maintenance versions of perl.
5080 Of course you may also use these directories in whatever way you see
5081 fit. For example, you might use them to access modules shared over a
5082 company-wide network.
5084 The default answer should be fine for most people.
5085 This causes further questions about vendor add-ons to be skipped
5086 and no vendor-specific directories will be configured for perl.
5089 rp='Do you want to configure vendor-specific add-on directories?'
5090 case "$usevendorprefix" in
5091 define|true|[yY]*) dflt=y ;;
5097 rp='Installation prefix to use for vendor-supplied add-ons?'
5098 case "$vendorprefix" in
5100 *) dflt=$vendorprefix ;;
5104 case "$vendorprefix" in
5108 *) oldvendorprefix="$prefix";;
5112 usevendorprefix="$define"
5114 vendorprefixexp="$ansexp"
5116 *) usevendorprefix="$undef"
5122 case "$vendorprefix" in
5123 '') d_vendorlib="$undef"
5127 *) d_vendorlib="$define"
5128 : determine where vendor-supplied modules go.
5129 : Usual default is /usr/local/lib/perl5/vendor_perl/$version
5130 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
5131 case "$installstyle" in
5132 *lib/perl5*) dflt=$vendorprefix/lib/$package/vendor_$prog/$version ;;
5133 *) dflt=$vendorprefix/lib/vendor_$prog/$version ;;
5136 rp='Pathname for the vendor-supplied library files?'
5139 vendorlibexp="$ansexp"
5140 : Change installation prefix, if necessary.
5141 if $test X"$prefix" != X"$installprefix"; then
5142 installvendorlib=`echo $vendorlibexp | $sed "s#^$prefix#$installprefix#"`
5144 installvendorlib="$vendorlibexp"
5149 : Cruising for prototypes
5151 echo "Checking out function prototypes..." >&4
5152 $cat >prototype.c <<'EOCP'
5153 int main(int argc, char *argv[]) {
5156 if $cc $ccflags -c prototype.c >prototype.out 2>&1 ; then
5157 echo "Your C compiler appears to support function prototypes."
5160 echo "Your C compiler doesn't seem to understand function prototypes."
5167 case "$prototype" in
5169 *) ansi2knr='ansi2knr'
5174 This version of $package can only be compiled by a compiler that
5175 understands function prototypes. Unfortunately, your C compiler
5177 doesn't seem to understand them. Sorry about that.
5179 If GNU cc is available for your system, perhaps you could try that instead.
5181 Eventually, we hope to support building Perl with pre-ANSI compilers.
5182 If you would like to help in that effort, please contact <perlbug@perl.org>.
5184 Aborting Configure now.
5190 : determine where public executables go
5195 rp='Pathname where the public executables will reside?'
5197 if $test "X$ansexp" != "X$binexp"; then
5202 : Change installation prefix, if necessary.
5203 : XXX Bug? -- ignores Configure -Dinstallprefix setting.
5204 if $test X"$prefix" != X"$installprefix"; then
5205 installbin=`echo $binexp | sed "s#^$prefix#$installprefix#"`
5207 installbin="$binexp"
5212 After $package is installed, you may wish to install various
5213 add-on modules and utilities. Typically, these add-ons will
5214 be installed under $prefix with the rest
5215 of this package. However, you may wish to install such add-ons
5216 elsewhere under a different prefix.
5218 If you do not wish to put everything under a single prefix, that's
5219 ok. You will be prompted for the individual locations; this siteprefix
5220 is only used to suggest the defaults.
5222 The default should be fine for most people.
5226 rp='Installation prefix to use for add-on modules and utilities?'
5227 : XXX Here might be another good place for an installstyle setting.
5228 case "$siteprefix" in
5230 *) dflt=$siteprefix ;;
5234 case "$siteprefix" in
5239 *) oldsiteprefix="$prefix";;
5244 siteprefixexp="$ansexp"
5246 : determine where site specific libraries go.
5247 : Usual default is /usr/local/lib/perl5/site_perl/$version
5248 : The default "style" setting is made in installstyle.U
5249 : XXX No longer works with Prefixit stuff.
5250 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
5251 case "$installstyle" in
5252 *lib/perl5*) dflt=$siteprefix/lib/$package/site_$prog/$version ;;
5253 *) dflt=$siteprefix/lib/site_$prog/$version ;;
5257 The installation process will create a directory for
5258 site-specific extensions and modules. Most users find it convenient
5259 to place all site-specific files in this directory rather than in the
5260 main distribution directory.
5264 rp='Pathname for the site-specific library files?'
5267 sitelibexp="$ansexp"
5268 : Change installation prefix, if necessary.
5269 if $test X"$prefix" != X"$installprefix"; then
5270 installsitelib=`echo $sitelibexp | sed "s#^$prefix#$installprefix#"`
5272 installsitelib="$sitelibexp"
5275 : Determine list of previous versions to include in @INC
5276 $cat > getverlist <<EOPL
5279 \$api_versionstring = "$api_versionstring";
5280 \$version = "$version";
5281 \$sitelib = "$sitelib";
5282 \$archname = "$archname";
5284 $cat >> getverlist <<'EOPL'
5285 # Can't have leading @ because metaconfig interprets it as a command!
5286 ;@inc_version_list=();
5287 $stem=dirname($sitelib);
5288 # Redo to do opendir/readdir?
5291 ;@candidates = glob("5.*");
5297 # XXX ToDo: These comparisons must be reworked when two-digit
5298 # subversions come along, so that 5.7.10 compares as greater than
5299 # 5.7.3! By that time, hope that 5.6.x is sufficiently
5300 # widespread that we can use the built-in version vectors rather
5301 # than reinventing them here. For 5.6.0, however, we must
5302 # assume this script will likely be run by 5.005_0x. --AD 1/2000.
5303 foreach $d (@candidates) {
5304 if ($d lt $version) {
5305 if ($d ge $api_versionstring) {
5306 unshift(@inc_version_list, "$d/$archname", $d);
5308 elsif ($d ge "5.005") {
5309 unshift(@inc_version_list, $d);
5313 # Skip newer version. I.e. don't look in
5314 # 5.7.0 if we're installing 5.6.1.
5318 if (@inc_version_list) {
5319 print join(' ', @inc_version_list);
5322 # Blank space to preserve value for next Configure run.
5327 case "$inc_version_list" in
5328 '') if test -x $perl; then
5329 dflt=`$perl getverlist`
5334 $undef) dflt='none' ;;
5335 *) dflt="$inc_version_list" ;;
5339 In order to ease the process of upgrading, this version of perl
5340 can be configured to use modules built and installed with earlier
5341 versions of perl that were installed under $prefix. Specify here
5342 the list of earlier versions that this version of perl should check.
5343 If Configure detected no earlier versions of perl installed under
5344 $prefix, then the list will be empty. Answer 'none' to tell perl
5345 to not search earlier versions.
5347 The default should almost always be sensible, so if you're not sure,
5348 just accept the default.
5351 rp='List of earlier versions to include in @INC?'
5354 [Nn]one) inc_version_list=' ' ;;
5355 *) inc_version_list="$ans" ;;
5357 case "$inc_version_list" in
5359 inc_version_list_init='""';;
5360 *) inc_version_list_init=`echo $inc_version_list |
5361 $sed -e 's/^/"/' -e 's/ /","/g' -e 's/$/"/'`
5366 : determine whether to install perl also as /usr/bin/perl
5369 if $test -d /usr/bin -a "X$installbin" != X/usr/bin; then
5371 Many scripts expect to perl to be installed as /usr/bin/perl.
5372 I can install the perl you are about to compile also as /usr/bin/perl
5373 (in addition to $installbin/perl).
5375 case "$installusrbinperl" in
5376 "$undef"|[nN]*) dflt='n';;
5379 rp="Do you want to install perl as /usr/bin/perl?"
5382 [yY]*) val="$define";;
5388 set installusrbinperl
5392 echo "Checking for GNU C Library..." >&4
5393 cat >gnulibc.c <<EOM
5405 if eval $compile_ok && ./gnulibc; then
5407 echo "You are using the GNU C Library"
5410 echo "You are not using the GNU C Library"
5416 : see if nm is to be used to determine whether a symbol is defined or not
5420 case "$d_gnulibc" in
5423 echo "nm probably won't work on the GNU C Library." >&4
5429 if $test "$osname" = aix -a ! -f /lib/syscalls.exp; then
5431 echo "Whoops! This is an AIX system without /lib/syscalls.exp!" >&4
5432 echo "'nm' won't be sufficient on this sytem." >&4
5438 '') dflt=`$egrep 'inlibc|csym' $rsrc/Configure | wc -l 2>/dev/null`
5439 if $test $dflt -gt 20; then
5449 true|$define) dflt=y;;
5456 I can use $nm to extract the symbols from your C libraries. This
5457 is a time consuming task which may generate huge output on the disk (up
5458 to 3 megabytes) but that should make the symbols extraction faster. The
5459 alternative is to skip the 'nm' extraction part and to compile a small
5460 test program instead to determine whether each symbol is present. If
5461 you have a fast C compiler and/or if your 'nm' output cannot be parsed,
5462 this may be the best solution.
5464 You probably shouldn't let me use 'nm' if you are using the GNU C Library.
5467 rp="Shall I use $nm to extract C symbols from the libraries?"
5470 [Nn]*) usenm=false;;
5479 : nm options which may be necessary
5481 '') if $test -f /mach_boot; then
5483 elif $test -d /usr/ccs/lib; then
5484 nm_opt='-p' # Solaris (and SunOS?)
5485 elif $test -f /dgux; then
5487 elif $test -f /lib64/rld; then
5488 nm_opt='-p' # 64-bit Irix
5494 : nm options which may be necessary for shared libraries but illegal
5495 : for archive libraries. Thank you, Linux.
5496 case "$nm_so_opt" in
5497 '') case "$myuname" in
5499 if $nm --help | $grep 'dynamic' > /dev/null 2>&1; then
5500 nm_so_opt='--dynamic'
5509 : get list of predefined functions in a handy place
5514 *-lc_s*) libc=`./loc libc_s$_a $libc $libpth`
5521 *) for thislib in $libs; do
5524 : Handle C library specially below.
5527 thislib=`echo $thislib | $sed -e 's/^-l//'`
5528 if try=`./loc lib$thislib.$so.'*' X $libpth`; $test -f "$try"; then
5530 elif try=`./loc lib$thislib.$so X $libpth`; $test -f "$try"; then
5532 elif try=`./loc lib$thislib$_a X $libpth`; $test -f "$try"; then
5534 elif try=`./loc $thislib$_a X $libpth`; $test -f "$try"; then
5536 elif try=`./loc lib$thislib X $libpth`; $test -f "$try"; then
5538 elif try=`./loc $thislib X $libpth`; $test -f "$try"; then
5540 elif try=`./loc Slib$thislib$_a X $xlibpth`; $test -f "$try"; then
5545 libnames="$libnames $try"
5547 *) libnames="$libnames $thislib" ;;
5556 for xxx in $libpth; do
5557 $test -r $1 || set $xxx/libc.$so
5558 : The messy sed command sorts on library version numbers.
5560 set `echo blurfl; echo $xxx/libc.$so.[0-9]* | \
5561 tr ' ' $trnl | egrep -v '\.[A-Za-z]*$' | $sed -e '
5563 s/[0-9][0-9]*/0000&/g
5564 s/0*\([0-9][0-9][0-9][0-9][0-9]\)/\1/g
5567 sort | $sed -e 's/^.* //'`
5570 $test -r $1 || set /usr/ccs/lib/libc.$so
5571 $test -r $1 || set /lib/libsys_s$_a
5577 if $test -r "$1"; then
5578 echo "Your (shared) C library seems to be in $1."
5580 elif $test -r /lib/libc && $test -r /lib/clib; then
5581 echo "Your C library seems to be in both /lib/clib and /lib/libc."
5583 libc='/lib/clib /lib/libc'
5584 if $test -r /lib/syslib; then
5585 echo "(Your math library is in /lib/syslib.)"
5586 libc="$libc /lib/syslib"
5588 elif $test -r "$libc" || (test -h "$libc") >/dev/null 2>&1; then
5589 echo "Your C library seems to be in $libc, as you said before."
5590 elif $test -r $incpath/usr/lib/libc$_a; then
5591 libc=$incpath/usr/lib/libc$_a;
5592 echo "Your C library seems to be in $libc. That's fine."
5593 elif $test -r /lib/libc$_a; then
5595 echo "Your C library seems to be in $libc. You're normal."
5597 if tans=`./loc libc$_a blurfl/dyick $libpth`; $test -r "$tans"; then
5599 elif tans=`./loc libc blurfl/dyick $libpth`; $test -r "$tans"; then
5600 libnames="$libnames "`./loc clib blurfl/dyick $libpth`
5601 elif tans=`./loc clib blurfl/dyick $libpth`; $test -r "$tans"; then
5603 elif tans=`./loc Slibc$_a blurfl/dyick $xlibpth`; $test -r "$tans"; then
5605 elif tans=`./loc Mlibc$_a blurfl/dyick $xlibpth`; $test -r "$tans"; then
5608 tans=`./loc Llibc$_a blurfl/dyick $xlibpth`
5610 if $test -r "$tans"; then
5611 echo "Your C library seems to be in $tans, of all places."
5617 if $test $xxx = apollo -o -r "$libc" || (test -h "$libc") >/dev/null 2>&1; then
5621 If the guess above is wrong (which it might be if you're using a strange
5622 compiler, or your machine supports multiple models), you can override it here.
5627 echo $libpth | tr ' ' $trnl | sort | uniq > libpath
5629 I can't seem to find your C library. I've looked in the following places:
5632 $sed 's/^/ /' libpath
5635 None of these seems to contain your C library. I need to get its name...
5640 rp='Where is your C library?'
5645 echo $libc $libnames | tr ' ' $trnl | sort | uniq > libnames
5646 set X `cat libnames`
5649 case $# in 1) xxx=file; esac
5650 echo "Extracting names from the following $xxx for later perusal:" >&4
5652 $sed 's/^/ /' libnames >&4
5654 $echo $n "This may take a while...$c" >&4
5658 *$so*) $nm $nm_so_opt $nm_opt $file 2>/dev/null;;
5659 *) $nm $nm_opt $file 2>/dev/null;;
5664 $grep fprintf libc.tmp > libc.ptf
5665 xscan='eval "<libc.ptf $com >libc.list"; $echo $n ".$c" >&4'
5666 xrun='eval "<libc.tmp $com >libc.list"; echo "done" >&4'
5668 if com="$sed -n -e 's/__IO//' -e 's/^.* $xxx *_[_.]*//p' -e 's/^.* $xxx *//p'";\
5670 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5672 elif com="$sed -n -e 's/^__*//' -e 's/^\([a-zA-Z_0-9$]*\).*xtern.*/\1/p'";\
5674 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5676 elif com="$sed -n -e '/|UNDEF/d' -e '/FUNC..GL/s/^.*|__*//p'";\
5678 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5680 elif com="$sed -n -e 's/^.* D __*//p' -e 's/^.* D //p'";\
5682 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5684 elif com="$sed -n -e 's/^_//' -e 's/^\([a-zA-Z_0-9]*\).*xtern.*text.*/\1/p'";\
5686 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5688 elif com="$sed -n -e 's/^.*|FUNC |GLOB .*|//p'";\
5690 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5692 elif com="$grep '|' | $sed -n -e '/|COMMON/d' -e '/|DATA/d' \
5693 -e '/ file/d' -e 's/^\([^ ]*\).*/\1/p'";\
5695 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5697 elif com="$sed -n -e 's/^.*|FUNC |GLOB .*|//p' -e 's/^.*|FUNC |WEAK .*|//p'";\
5699 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5701 elif com="$sed -n -e 's/^__//' -e '/|Undef/d' -e '/|Proc/s/ .*//p'";\
5703 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5705 elif com="$sed -n -e 's/^.*|Proc .*|Text *| *//p'";\
5707 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5709 elif com="$sed -n -e '/Def. Text/s/.* \([^ ]*\)\$/\1/p'";\
5711 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5713 elif com="$sed -n -e 's/^[-0-9a-f ]*_\(.*\)=.*/\1/p'";\
5715 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5717 elif com="$sed -n -e 's/.*\.text n\ \ \ \.//p'";\
5719 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5721 elif com="sed -n -e 's/^__.*//' -e 's/[ ]*D[ ]*[0-9]*.*//p'";\
5723 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5726 $nm -p $* 2>/dev/null >libc.tmp
5727 $grep fprintf libc.tmp > libc.ptf
5728 if com="$sed -n -e 's/^.* [ADTSIW] *_[_.]*//p' -e 's/^.* [ADTSIW] //p'";\
5729 eval $xscan; $contains '^fprintf$' libc.list >/dev/null 2>&1
5735 echo "$nm didn't seem to work right. Trying $ar instead..." >&4
5737 if $ar t $libc > libc.tmp && $contains '^fprintf$' libc.tmp >/dev/null 2>&1; then
5738 for thisname in $libnames $libc; do
5739 $ar t $thisname >>libc.tmp
5741 $sed -e "s/\\$_o\$//" < libc.tmp > libc.list
5743 elif test "X$osname" = "Xos2" && $ar tv $libc > libc.tmp; then
5744 # Repeat libc to extract forwarders to DLL entries too
5745 for thisname in $libnames $libc; do
5746 $ar tv $thisname >>libc.tmp
5747 # Revision 50 of EMX has bug in $ar.
5748 # it will not extract forwarders to DLL entries
5749 # Use emximp which will extract exactly them.
5750 emximp -o tmp.imp $thisname \
5752 $sed -e 's/^\([_a-zA-Z0-9]*\) .*$/\1/p' \
5753 < tmp.imp >>libc.tmp
5756 $sed -e "s/\\$_o\$//" -e 's/^ \+//' < libc.tmp > libc.list
5759 echo "$ar didn't seem to work right." >&4
5760 echo "Maybe this is a Cray...trying bld instead..." >&4
5761 if bld t $libc | $sed -e 's/.*\///' -e "s/\\$_o:.*\$//" > libc.list
5763 for thisname in $libnames; do
5765 $sed -e 's/.*\///' -e "s/\\$_o:.*\$//" >>libc.list
5766 $ar t $thisname >>libc.tmp
5770 echo "That didn't work either. Giving up." >&4
5777 if $test -f /lib/syscalls.exp; then
5779 echo "Also extracting names from /lib/syscalls.exp for good ole AIX..." >&4
5780 $sed -n 's/^\([^ ]*\)[ ]*syscall[0-9]*$/\1/p' /lib/syscalls.exp >>libc.list
5784 $rm -f libnames libpath
5786 : see if dld is available
5790 : is a C symbol defined?
5793 -v) tf=libc.tmp; tc=""; tdc="";;
5794 -a) tf=libc.tmp; tc="[0]"; tdc="[]";;
5795 *) tlook="^$1\$"; tf=libc.list; tc="()"; tdc="()";;
5798 case "$reuseval-$4" in
5800 true-*) tx=no; eval "tval=\$$4"; case "$tval" in "") tx=yes;; esac;;
5806 if $contains $tlook $tf >/dev/null 2>&1;
5811 echo "int main() { extern short $1$tdc; printf(\"%hd\", $1$tc); }" > t.c;
5812 if $cc $optimize $ccflags $ldflags -o t t.c $libs >/dev/null 2>&1;
5820 $define) tval=true;;
5826 : define an is-in-libc? function
5827 inlibc='echo " "; td=$define; tu=$undef;
5828 sym=$1; var=$2; eval "was=\$$2";
5830 case "$reuseval$was" in
5840 echo "$sym() found." >&4;
5841 case "$was" in $undef) . ./whoa; esac; eval "$var=\$td";;
5843 echo "$sym() NOT found." >&4;
5844 case "$was" in $define) . ./whoa; esac; eval "$var=\$tu";;
5848 $define) echo "$sym() found." >&4;;
5849 *) echo "$sym() NOT found." >&4;;
5853 : see if dlopen exists
5860 : determine which dynamic loading, if any, to compile in
5862 dldir="ext/DynaLoader"
5875 $define) dflt='y' ;;
5878 $define) dflt='y' ;;
5880 : Does a dl_xxx.xs file exist for this operating system
5881 $test -f $rsrc/$dldir/dl_${osname}.xs && dflt='y'
5884 rp="Do you wish to use dynamic loading?"
5891 if $test -f $rsrc/$dldir/dl_${osname}.xs ; then
5892 dflt="$dldir/dl_${osname}.xs"
5893 elif $test "$d_dlopen" = "$define" ; then
5894 dflt="$dldir/dl_dlopen.xs"
5895 elif $test "$i_dld" = "$define" ; then
5896 dflt="$dldir/dl_dld.xs"
5901 *) dflt="$dldir/$dlsrc"
5904 echo "The following dynamic loading files are available:"
5905 : Can not go over to $dldir because getfile has path hard-coded in.
5906 tdir=`pwd`; cd $rsrc; $ls -C $dldir/dl*.xs; cd $tdir
5907 rp="Source file to use for dynamic loading"
5913 dlsrc=`echo $ans | $sed -e 's@.*/\([^/]*\)$@\1@'`
5917 Some systems may require passing special flags to $cc -c to
5918 compile modules that will be used to create a shared library.
5919 To use no flags, say "none".
5922 case "$cccdlflags" in
5923 '') case "$gccversion" in
5924 '') case "$osname" in
5926 next) dflt='none' ;;
5927 irix*) dflt='-KPIC' ;;
5928 svr4*|esix*|solaris) dflt='-KPIC' ;;
5929 sunos) dflt='-pic' ;;
5933 *) case "$osname" in
5934 svr4*|esix*|solaris) dflt='-fPIC' ;;
5939 *) dflt="$cccdlflags" ;;
5941 rp="Any special flags to pass to $cc -c to compile shared library modules?"
5944 none) cccdlflags=' ' ;;
5945 *) cccdlflags="$ans" ;;
5950 Some systems use ld to create libraries that can be dynamically loaded,
5951 while other systems (such as those using ELF) use $cc.
5955 '') $cat >try.c <<'EOM'
5956 /* Test for whether ELF binaries are produced */
5961 int i = open("a.out",O_RDONLY);
5964 if(read(i,b,4)==4 && b[0]==127 && b[1]=='E' && b[2]=='L' && b[3]=='F')
5965 exit(0); /* succeed (yes, it's ELF) */
5970 if $cc $ccflags try.c >/dev/null 2>&1 && ./a.out; then
5972 You appear to have ELF support. I'll use $cc to build dynamic libraries.
5976 echo "I'll use ld to build dynamic libraries."
5985 rp="What command should be used to create dynamic libraries?"
5991 Some systems may require passing special flags to $ld to create a
5992 library that can be dynamically loaded. If your ld flags include
5993 -L/other/path options to locate libraries outside your loader's normal
5994 search path, you may need to specify those -L options here as well. To
5995 use no flags, say "none".
5998 case "$lddlflags" in
5999 '') case "$osname" in
6000 beos) dflt='-nostart' ;;
6002 linux|irix*) dflt='-shared' ;;
6003 next) dflt='none' ;;
6004 solaris) dflt='-G' ;;
6005 sunos) dflt='-assert nodefinitions' ;;
6006 svr4*|esix*) dflt="-G $ldflags" ;;
6010 *) dflt="$lddlflags" ;;
6013 : Try to guess additional flags to pick up local libraries.
6014 : Be careful not to append to a plain 'none'
6018 for thisflag in $ldflags; do
6023 *) dflt="$dflt $thisflag" ;;
6030 ''|' ') dflt='none' ;;
6033 rp="Any special flags to pass to $ld to create a dynamically loaded library?"
6036 none) lddlflags=' ' ;;
6037 *) lddlflags="$ans" ;;
6042 Some systems may require passing special flags to $cc to indicate that
6043 the resulting executable will use dynamic linking. To use no flags,
6047 case "$ccdlflags" in
6048 '') case "$osname" in
6049 hpux) dflt='-Wl,-E' ;;
6050 linux) dflt='-rdynamic' ;;
6051 next) dflt='none' ;;
6052 sunos) dflt='none' ;;
6056 *) dflt="$ccdlflags" ;;
6058 rp="Any special flags to pass to $cc to use dynamic linking?"
6061 none) ccdlflags=' ' ;;
6062 *) ccdlflags="$ans" ;;
6076 # No dynamic loading being used, so don't bother even to prompt.
6079 *) case "$useshrplib" in
6080 '') case "$osname" in
6081 svr4*|dgux|dynixptx|esix|powerux|beos|cygwin*)
6083 also='Building a shared libperl is required for dynamic loading to work on your system.'
6088 also='Building a shared libperl is needed for MAB support.'
6106 The perl executable is normally obtained by linking perlmain.c with
6107 libperl${_a}, any static extensions (usually just DynaLoader), and
6108 any other libraries needed on this system (such as -lm, etc.). Since
6109 your system supports dynamic loading, it is probably possible to build
6110 a shared libperl.$so. If you will have more than one executable linked
6111 to libperl.$so, this will significantly reduce the size of each
6112 executable, but it may have a noticeable affect on performance. The
6113 default is probably sensible for your system.
6117 rp="Build a shared libperl.$so (y/n)"
6121 useshrplib='true' ;;
6122 *) useshrplib='false' ;;
6127 case "$useshrplib" in
6131 # Figure out a good name for libperl.so. Since it gets stored in
6132 # a version-specific architecture-dependent library, the version
6133 # number isn't really that important, except for making cc/ld happy.
6135 # A name such as libperl.so.3.1
6136 majmin="libperl.$so.$patchlevel.$subversion"
6137 # A name such as libperl.so.301
6138 majonly=`echo $patchlevel $subversion |
6139 $awk '{printf "%d%02d", $1, $2}'`
6140 majonly=libperl.$so.$majonly
6141 # I'd prefer to keep the os-specific stuff here to a minimum, and
6142 # rely on figuring it out from the naming of libc.
6143 case "${osname}${osvers}" in
6146 # XXX How handle the --version stuff for MAB?
6148 linux*) # ld won't link with a bare -lperl otherwise.
6151 cygwin*) # include version
6152 dflt=`echo libperl$version | sed -e 's/\./_/g'`$lib_ext
6154 *) # Try to guess based on whether libc has major.minor.
6156 *libc.$so.[0-9]*.[0-9]*) dflt=$majmin ;;
6157 *libc.$so.[0-9]*) dflt=$majonly ;;
6158 *) dflt=libperl.$so ;;
6168 I need to select a good name for the shared libperl. If your system uses
6169 library names with major and minor numbers, then you might want something
6170 like $majmin. Alternatively, if your system uses a single version
6171 number for shared libraries, then you might want to use $majonly.
6172 Or, your system might be quite happy with a simple libperl.$so.
6174 Since the shared libperl will get installed into a version-specific
6175 architecture-dependent directory, the version number of the shared perl
6176 library probably isn't important, so the default should be o.k.
6179 rp='What name do you want to give to the shared libperl?'
6182 echo "Ok, I'll use $libperl"
6185 libperl="libperl${_a}"
6189 # Detect old use of shrpdir via undocumented Configure -Dshrpdir
6193 WARNING: Use of the shrpdir variable for the installation location of
6194 the shared $libperl is not supported. It was never documented and
6195 will not work in this version. Let me (perlbug@perl.com)
6196 know of any problems this may cause.
6202 But your current setting of $shrpdir is
6203 the default anyway, so it's harmless.
6208 Further, your current attempted setting of $shrpdir
6209 conflicts with the value of $archlibexp/CORE
6210 that installperl will use.
6217 # How will the perl executable find the installed shared $libperl?
6218 # Add $xxx to ccdlflags.
6219 # If we can't figure out a command-line option, use $shrpenv to
6220 # set env LD_RUN_PATH. The main perl makefile uses this.
6221 shrpdir=$archlibexp/CORE
6224 if "$useshrplib"; then
6227 # We'll set it in Makefile.SH...
6233 xxx="-Wl,-R$shrpdir"
6235 linux|irix*|dec_osf)
6236 xxx="-Wl,-rpath,$shrpdir"
6239 # next doesn't like the default...
6242 # beos doesn't like the default, either.
6245 # hpux doesn't like the default, either.
6246 tmp_shrpenv="env LDOPTS=\"+s +b${shrpdir}\""
6249 tmp_shrpenv="env LD_RUN_PATH=$shrpdir"
6255 # Only add $xxx if it isn't already in ccdlflags.
6256 case " $ccdlflags " in
6258 *) ccdlflags="$ccdlflags $xxx"
6261 Adding $xxx to the flags
6262 passed to $ld so that the perl executable will find the
6263 installed shared $libperl.
6271 # Fix ccdlflags in AIX for building external extensions.
6272 # (For building Perl itself bare -bE:perl.exp is needed,
6273 # Makefile.SH takes care of this.)
6275 aix) ccdlflags="$ccdlflags -bE:$installarchlib/CORE/perl.exp" ;;
6277 # Respect a hint or command-line value.
6279 '') shrpenv="$tmp_shrpenv" ;;
6281 case "$ldlibpthname" in
6282 '') ldlibpthname=LD_LIBRARY_PATH ;;
6283 none) ldlibpthname='' ;;
6286 : determine where manual pages go
6287 set man1dir man1dir none
6291 $spackage has manual pages available in source form.
6295 echo "However, you don't have nroff, so they're probably useless to you."
6297 '') man1dir="none";;
6300 echo "If you don't want the manual sources installed, answer 'none'."
6305 lookpath="$prefixexp/man/man1 $prefixexp/man/l_man/man1"
6306 lookpath="$lookpath $prefixexp/man/p_man/man1"
6307 lookpath="$lookpath $prefixexp/man/u_man/man1"
6308 lookpath="$lookpath $prefixexp/man/man.1"
6310 */?_man*) dflt=`./loc . $prefixexp/l_man/man1 $lookpath` ;;
6311 *) dflt=`./loc . $prefixexp/man/man1 $lookpath` ;;
6321 rp="Where do the main $spackage manual pages (source) go?"
6323 if $test "X$man1direxp" != "X$ansexp"; then
6327 man1direxp="$ansexp"
6333 : Change installation prefix, if necessary.
6334 if $test X"$prefix" != X"$installprefix"; then
6335 installman1dir=`echo $man1direxp | $sed "s#^$prefix#$installprefix#"`
6337 installman1dir="$man1direxp"
6340 : What suffix to use on installed man pages
6347 rp="What suffix should be used for the main $spackage man pages?"
6349 '') case "$man1dir" in
6363 *) dflt="$man1ext";;
6370 : see if we can have long filenames
6372 rmlist="$rmlist /tmp/cf$$"
6373 $test -d /tmp/cf$$ || mkdir /tmp/cf$$
6374 first=123456789abcdef
6375 second=/tmp/cf$$/$first
6376 $rm -f $first $second
6377 if (echo hi >$first) 2>/dev/null; then
6378 if $test -f 123456789abcde; then
6379 echo 'You cannot have filenames longer than 14 characters. Sigh.' >&4
6382 if (echo hi >$second) 2>/dev/null; then
6383 if $test -f /tmp/cf$$/123456789abcde; then
6385 That's peculiar... You can have filenames longer than 14 characters, but only
6386 on some of the filesystems. Maybe you are using NFS. Anyway, to avoid problems
6387 I shall consider your system cannot support long filenames at all.
6391 echo 'You can have filenames longer than 14 characters.' >&4
6396 How confusing! Some of your filesystems are sane enough to allow filenames
6397 longer than 14 characters but some others like /tmp can't even think about them.
6398 So, for now on, I shall assume your kernel does not allow them at all.
6405 You can't have filenames longer than 14 chars. You can't even think about them!
6411 $rm -rf /tmp/cf$$ 123456789abcde*
6413 : determine where library module manual pages go
6414 set man3dir man3dir none
6418 $spackage has manual pages for many of the library modules.
6424 However, you don't have nroff, so they're probably useless to you.
6427 '') man3dir="none";;
6431 case "$d_flexfnam" in
6434 However, your system can't handle the long file names like File::Basename.3.
6437 '') man3dir="none";;
6441 echo "If you don't want the manual sources installed, answer 'none'."
6442 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
6444 '') dflt=`echo $man1dir | $sed -e 's/man1/man3/g' -e 's/man\.1/man\.3/g'`
6445 if $test -d "$privlib/man/man3"; then
6448 WARNING: Previous versions of perl installed man3 pages into
6449 $privlib/man/man3. This version will suggest a
6450 new default of $dflt.
6454 rp='Do you wish to preserve the old behavior?(y/n)'
6457 y*) dflt="$privlib/man/man3" ;;
6463 *) dflt="$man3dir" ;;
6467 rp="Where do the $package library man pages (source) go?"
6470 man3direxp="$ansexp"
6476 : Change installation prefix, if necessary.
6477 if $test X"$prefix" != X"$installprefix"; then
6478 installman3dir=`echo $man3direxp | $sed "s#^$prefix#$installprefix#"`
6480 installman3dir="$man3direxp"
6483 : What suffix to use on installed man pages
6489 rp="What suffix should be used for the $package library man pages?"
6491 '') case "$man3dir" in
6505 *) dflt="$man3ext";;
6512 : see if we have to deal with yellow pages, now NIS.
6513 if $test -d /usr/etc/yp || $test -d /etc/yp; then
6514 if $test -f /usr/etc/nibindd; then
6516 echo "I'm fairly confident you're on a NeXT."
6518 rp='Do you get the hosts file via NetInfo?'
6527 y*) hostcat='nidump hosts .';;
6528 *) case "$hostcat" in
6529 nidump*) hostcat='';;
6539 '') if $contains '^\+' /etc/passwd >/dev/null 2>&1; then
6547 rp='Are you getting the hosts file via yellow pages?'
6550 y*) hostcat='ypcat hosts';;
6551 *) hostcat='cat /etc/hosts';;
6557 '') test -f /etc/hosts && hostcat='cat /etc/hosts';;
6560 '') test -f /etc/group && groupcat='cat /etc/group';;
6563 '') test -f /etc/passwd && passcat='cat /etc/passwd';;
6566 : now get the host name
6568 echo "Figuring out host name..." >&4
6569 case "$myhostname" in
6571 echo 'Maybe "hostname" will work...'
6572 if tans=`sh -c hostname 2>&1` ; then
6580 if $test "$cont"; then
6582 echo 'Oh, dear. Maybe "/etc/systemid" is the key...'
6583 if tans=`cat /etc/systemid 2>&1` ; then
6585 phostname='cat /etc/systemid'
6586 echo "Whadyaknow. Xenix always was a bit strange..."
6589 elif $test -r /etc/systemid; then
6590 echo "(What is a non-Xenix system doing with /etc/systemid?)"
6593 if $test "$cont"; then
6594 echo 'No, maybe "uuname -l" will work...'
6595 if tans=`sh -c 'uuname -l' 2>&1` ; then
6597 phostname='uuname -l'
6599 echo 'Strange. Maybe "uname -n" will work...'
6600 if tans=`sh -c 'uname -n' 2>&1` ; then
6602 phostname='uname -n'
6604 echo 'Oh well, maybe I can mine it out of whoami.h...'
6605 if tans=`sh -c $contains' sysname $usrinc/whoami.h' 2>&1` ; then
6606 myhostname=`echo "$tans" | $sed 's/^.*"\(.*\)"/\1/'`
6607 phostname="sed -n -e '"'/sysname/s/^.*\"\\(.*\\)\"/\1/{'"' -e p -e q -e '}' <$usrinc/whoami.h"
6609 case "$myhostname" in
6610 '') echo "Does this machine have an identity crisis or something?"
6613 echo "Well, you said $myhostname before..."
6614 phostname='echo $myhostname';;
6620 : you do not want to know about this
6625 if $test "$myhostname" ; then
6627 rp='Your host name appears to be "'$myhostname'".'" Right?"
6635 : bad guess or no guess
6636 while $test "X$myhostname" = X ; do
6638 rp="Please type the (one word) name of your host:"
6643 : translate upper to lower if necessary
6644 case "$myhostname" in
6646 echo "(Normalizing case in your host name)"
6647 myhostname=`echo $myhostname | ./tr '[A-Z]' '[a-z]'`
6651 case "$myhostname" in
6653 dflt=`expr "X$myhostname" : "X[^.]*\(\..*\)"`
6654 myhostname=`expr "X$myhostname" : "X\([^.]*\)\."`
6655 echo "(Trimming domain name from host name--host name is now $myhostname)"
6657 *) case "$mydomain" in
6660 test "X$hostcat" = "Xypcat hosts" &&
6661 ypmatch "$myhostname" hosts 2>/dev/null |\
6662 $sed -e 's/[ ]*#.*//; s/$/ /' > hosts && \
6665 test "X$hostcat" != "X" &&
6666 $hostcat | $sed -n -e "s/[ ]*#.*//; s/\$/ /
6667 /[ ]$myhostname[ . ]/p" > hosts
6670 $test x`$awk "/[0-9].*[ ]$myhostname$tmp_re/ { sum++ }
6671 END { print sum }" hosts` = x1 || tmp_re="[ ]"
6672 dflt=.`$awk "/[0-9].*[ ]$myhostname$tmp_re/ {for(i=2; i<=NF;i++) print \\\$i}" \
6673 hosts | $sort | $uniq | \
6674 $sed -n -e "s/$myhostname\.\([-a-zA-Z0-9_.]\)/\1/p"`
6675 case `$echo X$dflt` in
6676 X*\ *) echo "(Several hosts in /etc/hosts matched hostname)"
6679 X.) echo "(You do not have fully-qualified names in /etc/hosts)"
6684 tans=`./loc resolv.conf X /etc /usr/etc`
6685 if $test -f "$tans"; then
6686 echo "(Attempting domain name extraction from $tans)"
6687 dflt=.`$sed -n -e 's/ / /g' \
6688 -e 's/^search *\([^ ]*\).*/\1/p' $tans \
6689 | ./tr '[A-Z]' '[a-z]' 2>/dev/null`
6691 .) dflt=.`$sed -n -e 's/ / /g' \
6692 -e 's/^domain *\([^ ]*\).*/\1/p' $tans \
6693 | ./tr '[A-Z]' '[a-z]' 2>/dev/null`
6700 .) echo "(No help from resolv.conf either -- attempting clever guess)"
6701 dflt=.`sh -c domainname 2>/dev/null`
6704 .nis.*|.yp.*|.main.*) dflt=`echo $dflt | $sed -e 's/^\.[^.]*//'`;;
6709 .) echo "(Lost all hope -- silly guess then)"
6715 *) dflt="$mydomain";;
6719 rp="What is your domain name?"
6729 : translate upper to lower if necessary
6732 echo "(Normalizing case in your domain name)"
6733 mydomain=`echo $mydomain | ./tr '[A-Z]' '[a-z]'`
6737 : a little sanity check here
6738 case "$phostname" in
6741 case `$phostname | ./tr '[A-Z]' '[a-z]'` in
6742 $myhostname$mydomain|$myhostname) ;;
6744 case "$phostname" in
6746 echo "(That doesn't agree with your whoami.h file, by the way.)"
6749 echo "(That doesn't agree with your $phostname command, by the way.)"
6759 I need to get your e-mail address in Internet format if possible, i.e.
6760 something like user@host.domain. Please answer accurately since I have
6761 no easy means to double check it. The default value provided below
6762 is most probably close to reality but may not be valid from outside
6763 your organization...
6767 while test "$cont"; do
6769 '') dflt="$cf_by@$myhostname$mydomain";;
6770 *) dflt="$cf_email";;
6772 rp='What is your e-mail address?'
6778 rp='Address does not look like an Internet one. Use it anyway?'
6794 If you or somebody else will be maintaining perl at your site, please
6795 fill in the correct e-mail address here so that they may be contacted
6796 if necessary. Currently, the "perlbug" program included with perl
6797 will send mail to this address in addition to perlbug@perl.com. You may
6798 enter "none" for no administrator.
6801 case "$perladmin" in
6802 '') dflt="$cf_email";;
6803 *) dflt="$perladmin";;
6805 rp='Perl administrator e-mail address'
6809 : figure out how to guarantee perl startup
6810 case "$startperl" in
6812 case "$sharpbang" in
6816 I can use the #! construct to start perl on your system. This will
6817 make startup of perl scripts faster, but may cause problems if you
6818 want to share those scripts and perl is not in a standard place
6819 ($binexp/perl) on all your platforms. The alternative is to force
6820 a shell by starting the script with a single ':' character.
6824 rp='What shall I put after the #! to start up perl ("none" to not use #!)?'
6827 none) startperl=": # use perl";;
6828 *) startperl="#!$ans"
6829 if $test 30 -lt `echo "$ans" | wc -c`; then
6832 WARNING: Some systems limit the #! command to 32 characters.
6833 If you experience difficulty running Perl scripts with #!, try
6834 installing Perl in a directory with a shorter pathname.
6840 *) startperl=": # use perl"
6845 echo "I'll use $startperl to start perl scripts."
6847 : figure best path for perl in scripts
6850 perlpath="$binexp/perl"
6851 case "$startperl" in
6856 I will use the "eval 'exec'" idiom to start Perl on your system.
6857 I can use the full path of your Perl binary for this purpose, but
6858 doing so may cause problems if you want to share those scripts and
6859 Perl is not always in a standard place ($binexp/perl).
6863 rp="What path shall I use in \"eval 'exec'\"?"
6870 case "$startperl" in
6872 *) echo "I'll use $perlpath in \"eval 'exec'\"" ;;
6875 : determine where public executable scripts go
6876 set scriptdir scriptdir
6878 case "$scriptdir" in
6881 : guess some guesses
6882 $test -d /usr/share/scripts && dflt=/usr/share/scripts
6883 $test -d /usr/share/bin && dflt=/usr/share/bin
6884 $test -d /usr/local/script && dflt=/usr/local/script
6885 $test -d /usr/local/scripts && dflt=/usr/local/scripts
6886 $test -d $prefixexp/script && dflt=$prefixexp/script
6890 *) dflt="$scriptdir"
6895 Some installations have a separate directory just for executable scripts so
6896 that they can mount it across multiple architectures but keep the scripts in
6897 one spot. You might, for example, have a subdirectory of /usr/share for this.
6898 Or you might just lump your scripts in with all your other executables.
6902 rp='Where do you keep publicly executable scripts?'
6904 if $test "X$ansexp" != "X$scriptdirexp"; then
6908 scriptdirexp="$ansexp"
6909 : Change installation prefix, if necessary.
6910 if $test X"$prefix" != X"$installprefix"; then
6911 installscript=`echo $scriptdirexp | sed "s#^$prefix#$installprefix#"`
6913 installscript="$scriptdirexp"
6916 : determine where site specific architecture-dependent libraries go.
6917 : sitelib default is /usr/local/lib/perl5/site_perl/$version
6918 : sitearch default is /usr/local/lib/perl5/site_perl/$version/$archname
6919 : sitelib may have an optional trailing /share.
6920 tdflt=`echo $sitelib | $sed 's,/share$,,'`
6921 tdflt="$tdflt/$archname"
6922 set sitearch sitearch none
6925 '') dflt="$tdflt" ;;
6926 *) dflt="$sitearch" ;;
6930 The installation process will also create a directory for
6931 architecture-dependent site-specific extensions and modules.
6935 rp='Pathname for the site-specific architecture-dependent library files?'
6938 sitearchexp="$ansexp"
6939 : Change installation prefix, if necessary.
6940 if $test X"$prefix" != X"$installprefix"; then
6941 installsitearch=`echo $sitearchexp | sed "s#^$prefix#$installprefix#"`
6943 installsitearch="$sitearchexp"
6946 : determine where add-on public executables go
6948 '') dflt=$siteprefix/bin ;;
6952 rp='Pathname where the add-on public executables should be installed?'
6955 sitebinexp="$ansexp"
6956 : Change installation prefix, if necessary.
6957 if $test X"$prefix" != X"$installprefix"; then
6958 installsitebin=`echo $sitebinexp | sed "s#^$prefix#$installprefix#"`
6960 installsitebin="$sitebinexp"
6965 Perl can be built to take advantage of long doubles which
6966 (if available) may give more accuracy and range for floating point numbers.
6968 If this doesn't make any sense to you, just accept the default 'n'.
6972 *-DUSE_LONG_DOUBLE*|*-DUSE_MORE_BITS*) uselongdouble="$define" ;;
6975 case "$uselongdouble" in
6976 $define|true|[yY]*) dflt='y';;
6979 rp='Try to use long doubles if available?'
6982 y|Y) val="$define" ;;
6988 case "$uselongdouble" in
6989 true|[yY]*) uselongdouble="$define" ;;
6992 case "$uselongdouble" in
6994 : Look for a hint-file generated 'call-back-unit'. If the
6995 : user has specified that long doubles should be used,
6996 : we may need to set or change some other defaults.
6997 if $test -f uselongdouble.cbu; then
6998 echo "Your platform has some specific hints for long doubles, using them..."
6999 . ./uselongdouble.cbu
7002 (Your platform doesn't have any specific hints for long doubles.)
7010 Perl can be built to take advantage of long longs which
7011 (if available) may give more range for integer numbers.
7013 If this doesn't make any sense to you, just accept the default 'n'.
7017 *-DUSE_LONG_LONG*) uselonglong="$define" ;;
7020 case "$uselonglong" in
7021 $define|true|[yY]*) dflt='y';;
7024 rp='Try to use long longs if available?'
7027 y|Y) val="$define" ;;
7033 case "$uselonglong" in
7034 true|[yY]*) uselonglong="$define" ;;
7037 case "$uselonglong" in
7039 : Look for a hint-file generated 'call-back-unit'. If the
7040 : user has specified that long longs should be used,
7041 : we may need to set or change some other defaults.
7042 if $test -f uselonglong.cbu; then
7043 echo "Your platform has some specific hints for long longs, using them..."
7047 (Your platform doesn't have any specific hints for long longs.)
7055 Previous version of $package used the standard IO mechanisms as defined
7056 in <stdio.h>. Versions 5.003_02 and later of perl allow alternate IO
7057 mechanisms via a "PerlIO" abstraction, but the stdio mechanism is still
7058 the default. This abstraction layer can use AT&T's sfio (if you already
7059 have sfio installed) or regular stdio. Using PerlIO with sfio may cause
7060 problems with some extension modules. Using PerlIO with stdio is safe,
7061 but it is slower than plain stdio and therefore is not the default.
7063 If this doesn't make any sense to you, just accept the default 'n'.
7065 case "$useperlio" in
7066 $define|true|[yY]*) dflt='y';;
7069 rp='Use the experimental PerlIO abstraction layer?'
7076 echo "Ok, doing things the stdio way"
7083 case "$vendorprefix" in
7084 '') d_vendorbin="$undef"
7088 *) d_vendorbin="$define"
7089 : determine where vendor-supplied executables go.
7090 dflt=$vendorprefix/bin
7092 rp='Pathname for the vendor-supplied executables directory?'
7095 vendorbinexp="$ansexp"
7096 : Change installation prefix, if necessary.
7097 if $test X"$prefix" != X"$installprefix"; then
7098 installvendorbin=`echo $vendorbinexp | $sed "s#^$prefix#$installprefix#"`
7100 installvendorbin="$vendorbinexp"
7105 : check for length of double
7107 case "$doublesize" in
7109 $echo $n "Checking to see how big your double precision numbers are...$c" >&4
7110 $cat >try.c <<'EOCP'
7114 printf("%d\n", (int)sizeof(double));
7119 if eval $compile_ok; then
7121 $echo " $doublesize bytes." >&4
7124 echo "(I can't seem to compile the test program. Guessing...)"
7125 rp="What is the size of a double precision number (in bytes)?"
7133 : check for long doubles
7135 $echo $n "Checking to see if your system supports long double..." $c >&4
7136 echo 'int main() { long double x = 7.0; }' > try.c
7138 if eval $compile; then
7140 echo " Yes, it does." >&4
7143 echo " No, it doesn't." >&4
7149 : check for length of long double
7150 case "${d_longdbl}${longdblsize}" in
7153 $echo $n "Checking to see how big your long doubles are..." $c >&4
7154 $cat >try.c <<'EOCP'
7158 printf("%d\n", sizeof(long double));
7163 if eval $compile; then
7164 longdblsize=`./try$exe_ext`
7165 $echo " $longdblsize bytes." >&4
7169 echo "(I can't seem to compile the test program. Guessing...)" >&4
7170 rp="What is the size of a long double (in bytes)?"
7174 if $test "X$doublesize" = "X$longdblsize"; then
7175 echo "(That isn't any different from an ordinary double.)"
7181 : Check how to convert floats to strings.
7182 if test "X$d_Gconvert" = X; then
7184 echo "Checking for an efficient way to convert floats to strings."
7187 #define Gconvert(x,n,t,b) gconvert((x),(n),(t),(b))
7188 char *myname = "gconvert";
7191 #define Gconvert(x,n,t,b) gcvt((x),(n),(b))
7192 char *myname = "gcvt";
7195 #define Gconvert(x,n,t,b) qgcvt((x),(n),(b))
7196 char *myname = "qgcvt";
7197 #define DOUBLETYPE long double
7200 #define Gconvert(x,n,t,b) sprintf((b),"%.*g",(n),(x))
7201 char *myname = "sprintf";
7205 #define DOUBLETYPE double
7210 #define I_STDLIB $i_stdlib
7216 checkit(expect, got)
7220 if (strcmp(expect, got)) {
7221 printf("%s oddity: Expected %s, got %s\n",
7222 myname, expect, got);
7232 /* This must be 1st test on (which?) platform */
7233 /* Alan Burlison <AlanBurlsin@unn.unisys.com> */
7234 Gconvert((DOUBLETYPE)0.1, 8, 0, buf);
7235 checkit("0.1", buf);
7237 Gconvert((DOUBLETYPE)1.0, 8, 0, buf);
7240 Gconvert((DOUBLETYPE)0.0, 8, 0, buf);
7243 Gconvert((DOUBLETYPE)-1.0, 8, 0, buf);
7246 /* Some Linux gcvt's give 1.e+5 here. */
7247 Gconvert((DOUBLETYPE)100000.0, 8, 0, buf);
7248 checkit("100000", buf);
7250 /* Some Linux gcvt's give -1.e+5 here. */
7251 Gconvert((DOUBLETYPE)-100000.0, 8, 0, buf);
7252 checkit("-100000", buf);
7257 case "$d_Gconvert" in
7258 gconvert*) xxx_list='gconvert gcvt sprintf' ;;
7259 gcvt*) xxx_list='gcvt gconvert sprintf' ;;
7260 sprintf*) xxx_list='sprintf gconvert gcvt' ;;
7261 *) xxx_list='gconvert gcvt sprintf' ;;
7264 case "$d_longdbl$uselongdouble" in
7265 definedefine) xxx_list="`echo $xxx_list|sed 's/gcvt/qgcvt gcvt/'`" ;;
7268 for xxx_convert in $xxx_list; do
7269 echo "Trying $xxx_convert..."
7271 set try -DTRY_$xxx_convert
7272 if eval $compile; then
7273 echo "$xxx_convert() found." >&4
7275 echo "I'll use $xxx_convert to convert floats into a string." >&4
7278 echo "...But $xxx_convert didn't work as I expected."
7281 echo "$xxx_convert NOT found." >&4
7285 case "$xxx_convert" in
7286 gconvert) d_Gconvert='gconvert((x),(n),(t),(b))' ;;
7287 gcvt) d_Gconvert='gcvt((x),(n),(b))' ;;
7288 qgcvt) d_Gconvert='qgcvt((x),(n),(b))' ;;
7289 *) d_Gconvert='sprintf((b),"%.*g",(n),(x))' ;;
7295 if $test X"$d_longdbl" = X"$define"; then
7297 echo "Checking how to print long doubles..." >&4
7299 if $test X"$sPRIfldbl" = X -a X"$doublesize" = X"$longdblsize"; then
7300 $cat >try.c <<'EOCP'
7301 #include <sys/types.h>
7305 printf("%.3f\n", d);
7309 if eval $compile; then
7313 sPRIfldbl='"f"'; sPRIgldbl='"g"'; sPRIeldbl='"e"';
7314 sPRIFldbl='"F"'; sPRIGldbl='"G"'; sPRIEldbl='"E"';
7315 echo "We will use %f."
7321 if $test X"$sPRIfldbl" = X; then
7322 $cat >try.c <<'EOCP'
7323 #include <sys/types.h>
7326 long double d = 123.456;
7327 printf("%.3llf\n", d);
7331 if eval $compile; then
7335 sPRIfldbl='"llf"'; sPRIgldbl='"llg"'; sPRIeldbl='"lle"';
7336 sPRIFldbl='"llF"'; sPRIGldbl='"llG"'; sPRIEldbl='"llE"';
7337 echo "We will use %llf."
7343 if $test X"$sPRIfldbl" = X; then
7344 $cat >try.c <<'EOCP'
7345 #include <sys/types.h>
7348 long double d = 123.456;
7349 printf("%.3Lf\n", d);
7353 if eval $compile; then
7357 sPRIfldbl='"Lf"'; sPRIgldbl='"Lg"'; sPRIeldbl='"Le"';
7358 sPRIFldbl='"LF"'; sPRIGldbl='"LG"'; sPRIEldbl='"LE"';
7359 echo "We will use %Lf."
7365 if $test X"$sPRIfldbl" = X; then
7366 $cat >try.c <<'EOCP'
7367 #include <sys/types.h>
7370 long double d = 123.456;
7371 printf("%.3lf\n", d);
7375 if eval $compile; then
7379 sPRIfldbl='"lf"'; sPRIgldbl='"lg"'; sPRIeldbl='"le"';
7380 sPRIFldbl='"lF"'; sPRIGldbl='"lG"'; sPRIEldbl='"lE"';
7381 echo "We will use %lf."
7387 if $test X"$sPRIfldbl" = X; then
7388 echo "Cannot figure out how to print long doubles." >&4
7395 case "$sPRIfldbl" in
7396 '') d_PRIfldbl="$undef"; d_PRIgldbl="$undef"; d_PRIeldbl="$undef";
7397 d_PRIFldbl="$undef"; d_PRIGldbl="$undef"; d_PRIEldbl="$undef";
7399 *) d_PRIfldbl="$define"; d_PRIgldbl="$define"; d_PRIeldbl="$define";
7400 d_PRIFldbl="$define"; d_PRIGldbl="$define"; d_PRIEldbl="$define";
7404 : Initialize h_fcntl
7407 : Initialize h_sysfile
7410 : access call always available on UNIX
7414 : locate the flags for 'access()'
7418 $cat >access.c <<'EOCP'
7419 #include <sys/types.h>
7424 #include <sys/file.h>
7433 : check sys/file.h first, no particular reason here
7434 if $test `./findhdr sys/file.h` && \
7435 $cc $cppflags -DI_SYS_FILE -o access access.c >/dev/null 2>&1 ; then
7437 echo "<sys/file.h> defines the *_OK access constants." >&4
7438 elif $test `./findhdr fcntl.h` && \
7439 $cc $cppflags -DI_FCNTL -o access access.c >/dev/null 2>&1 ; then
7441 echo "<fcntl.h> defines the *_OK access constants." >&4
7442 elif $test `./findhdr unistd.h` && \
7443 $cc $cppflags -DI_UNISTD -o access access.c >/dev/null 2>&1 ; then
7444 echo "<unistd.h> defines the *_OK access constants." >&4
7446 echo "I can't find the four *_OK access constants--I'll use mine." >&4
7452 : see if accessx exists
7453 set accessx d_accessx
7456 : see if alarm exists
7460 : see if atolf exists
7464 : see if atoll exists
7468 : Look for GNU-cc style attribute checking
7470 echo "Checking whether your compiler can handle __attribute__ ..." >&4
7471 $cat >attrib.c <<'EOCP'
7473 void croak (char* pat,...) __attribute__((format(printf,1,2),noreturn));
7475 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
7476 if $contains 'warning' attrib.out >/dev/null 2>&1; then
7477 echo "Your C compiler doesn't fully support __attribute__."
7480 echo "Your C compiler supports __attribute__."
7484 echo "Your C compiler doesn't seem to understand __attribute__ at all."
7491 : see if bcmp exists
7495 : see if bcopy exists
7499 : see if this is a unistd.h system
7500 set unistd.h i_unistd
7503 : see if getpgrp exists
7504 set getpgrp d_getpgrp
7507 case "$d_getpgrp" in
7510 echo "Checking to see which flavor of getpgrp is in use..."
7513 #include <sys/types.h>
7515 # include <unistd.h>
7519 if (getuid() == 0) {
7520 printf("(I see you are running Configure as super-user...)\n");
7524 if (getpgrp(1) == 0)
7533 if $cc -DTRY_BSD_PGRP $ccflags $ldflags -o set set.c $libs >/dev/null 2>&1 && ./set; then
7534 echo "You have to use getpgrp(pid) instead of getpgrp()." >&4
7536 elif $cc $ccflags $ldflags -o set set.c $libs >/dev/null 2>&1 && ./set; then
7537 echo "You have to use getpgrp() instead of getpgrp(pid)." >&4
7540 echo "I can't seem to compile and run the test program."
7542 xxx="a USG one, i.e. you use getpgrp()."
7544 # SVR4 systems can appear rather BSD-ish.
7547 xxx="a BSD one, i.e. you use getpgrp(pid)."
7551 xxx="probably a USG one, i.e. you use getpgrp()."
7556 echo "Assuming your getpgrp is $xxx" >&4
7565 : see if setpgrp exists
7566 set setpgrp d_setpgrp
7569 case "$d_setpgrp" in
7572 echo "Checking to see which flavor of setpgrp is in use..."
7575 #include <sys/types.h>
7577 # include <unistd.h>
7581 if (getuid() == 0) {
7582 printf("(I see you are running Configure as super-user...)\n");
7586 if (-1 == setpgrp(1, 1))
7589 if (setpgrp() != -1)
7595 if $cc -DTRY_BSD_PGRP $ccflags $ldflags -o set set.c $libs >/dev/null 2>&1 && ./set; then
7596 echo 'You have to use setpgrp(pid,pgrp) instead of setpgrp().' >&4
7598 elif $cc $ccflags $ldflags -o set set.c $libs >/dev/null 2>&1 && ./set; then
7599 echo 'You have to use setpgrp() instead of setpgrp(pid,pgrp).' >&4
7602 echo "(I can't seem to compile and run the test program.)"
7604 xxx="a USG one, i.e. you use setpgrp()."
7606 # SVR4 systems can appear rather BSD-ish.
7609 xxx="a BSD one, i.e. you use setpgrp(pid,pgrp)."
7613 xxx="probably a USG one, i.e. you use setpgrp()."
7618 echo "Assuming your setpgrp is $xxx" >&4
7626 : see if bzero exists
7630 : see if signal is declared as pointer to function returning int or void
7632 xxx=`./findhdr signal.h`
7633 $test "$xxx" && $cppstdin $cppminus $cppflags < $xxx >$$.tmp 2>/dev/null
7634 if $contains 'int.*\*[ ]*signal' $$.tmp >/dev/null 2>&1 ; then
7635 echo "You have int (*signal())() instead of void." >&4
7637 elif $contains 'void.*\*[ ]*signal' $$.tmp >/dev/null 2>&1 ; then
7638 echo "You have void (*signal())()." >&4
7640 elif $contains 'extern[ ]*[(\*]*signal' $$.tmp >/dev/null 2>&1 ; then
7641 echo "You have int (*signal())() instead of void." >&4
7643 elif $contains 'void.*\*.*sig' $$.tmp >/dev/null 2>&1 ; then
7644 echo "You have void (*signal())()." >&4
7647 case "$d_voidsig" in
7649 echo "I can't determine whether signal handler returns void or int..." >&4
7651 rp="What type does your signal handler return?"
7658 echo "As you already told me, signal handler returns void." >&4
7661 *) echo "As you already told me, signal handler returns int." >&4
7668 case "$d_voidsig" in
7669 "$define") signal_t="void";;
7674 : check for ability to cast large floats to 32-bit ints.
7676 echo 'Checking whether your C compiler can cast large floats to int32.' >&4
7677 if $test "$intsize" -ge 4; then
7684 #include <sys/types.h>
7686 $signal_t blech(s) int s; { exit(3); }
7693 signal(SIGFPE, blech);
7695 /* Don't let compiler optimize the test away. Store the number
7696 in a writable string for gcc to pass to sscanf under HP/UX.
7698 sprintf(str, "2147483647");
7699 sscanf(str, "%lf", &f); /* f = (double) 0x7fffffff; */
7703 /* x86 processors will probably give 0x8000 0000, which is a
7704 sign change. We don't want that. We want to mimic SPARC
7705 behavior here, which is to preserve the sign and give
7708 if (i32 != ($xxx) f)
7714 if eval $compile_ok; then
7718 echo "(I can't seem to compile the test program--assuming it can't)"
7726 echo "Nope, it can't."
7733 : check for ability to cast negative floats to unsigned
7735 echo 'Checking whether your C compiler can cast negative float to unsigned.' >&4
7738 #include <sys/types.h>
7740 $signal_t blech(s) int s; { exit(7); }
7741 $signal_t blech_in_list(s) int s; { exit(4); }
7742 unsigned long dummy_long(p) unsigned long p; { return p; }
7743 unsigned int dummy_int(p) unsigned int p; { return p; }
7744 unsigned short dummy_short(p) unsigned short p; { return p; }
7748 unsigned long along;
7750 unsigned short ashort;
7754 /* Frustrate gcc-2.7.2's optimizer which failed this test with
7755 a direct f = -123. assignment. gcc-2.8.0 reportedly
7756 optimized the whole file away
7758 /* Store the number in a writable string for gcc to pass to
7761 sprintf(str, "-123");
7762 sscanf(str, "%lf", &f); /* f = -123.; */
7764 signal(SIGFPE, blech);
7765 along = (unsigned long)f;
7766 aint = (unsigned int)f;
7767 ashort = (unsigned short)f;
7768 if (along != (unsigned long)-123)
7770 if (aint != (unsigned int)-123)
7772 if (ashort != (unsigned short)-123)
7774 sprintf(str, "1073741824.");
7775 sscanf(str, "%lf", &f); /* f = (double)0x40000000; */
7778 along = (unsigned long)f;
7779 if (along != 0x80000000)
7783 along = (unsigned long)f;
7784 if (along != 0x7fffffff)
7788 along = (unsigned long)f;
7789 if (along != 0x80000001)
7793 signal(SIGFPE, blech_in_list);
7794 sprintf(str, "123.");
7795 sscanf(str, "%lf", &f); /* f = 123.; */
7796 along = dummy_long((unsigned long)f);
7797 aint = dummy_int((unsigned int)f);
7798 ashort = dummy_short((unsigned short)f);
7799 if (along != (unsigned long)123)
7801 if (aint != (unsigned int)123)
7803 if (ashort != (unsigned short)123)
7810 if eval $compile_ok; then
7814 echo "(I can't seem to compile the test program--assuming it can't)"
7817 case "$castflags" in
7822 echo "Nope, it can't."
7829 : see if vprintf exists
7831 if set vprintf val -f d_vprintf; eval $csym; $val; then
7832 echo 'vprintf() found.' >&4
7834 $cat >vprintf.c <<'EOF'
7835 #include <varargs.h>
7837 int main() { xxx("foo"); }
7846 exit((unsigned long)vsprintf(buf,"%s",args) > 10L);
7850 if eval $compile && ./vprintf; then
7851 echo "Your vsprintf() returns (int)." >&4
7854 echo "Your vsprintf() returns (char*)." >&4
7858 echo 'vprintf() NOT found.' >&4
7868 : see if chown exists
7872 : see if chroot exists
7876 : see if chsize exists
7880 : check for const keyword
7882 echo 'Checking to see if your C compiler knows about "const"...' >&4
7883 $cat >const.c <<'EOCP'
7884 typedef struct spug { int drokk; } spug;
7891 if $cc -c $ccflags const.c >/dev/null 2>&1 ; then
7893 echo "Yup, it does."
7896 echo "Nope, it doesn't."
7901 : see if crypt exists
7903 if set crypt val -f d_crypt; eval $csym; $val; then
7904 echo 'crypt() found.' >&4
7908 cryptlib=`./loc Slibcrypt$_a "" $xlibpth`
7909 if $test -z "$cryptlib"; then
7910 cryptlib=`./loc Mlibcrypt$_a "" $xlibpth`
7914 if $test -z "$cryptlib"; then
7915 cryptlib=`./loc Llibcrypt$_a "" $xlibpth`
7919 if $test -z "$cryptlib"; then
7920 cryptlib=`./loc libcrypt$_a "" $libpth`
7924 if $test -z "$cryptlib"; then
7925 echo 'crypt() NOT found.' >&4
7934 : get csh whereabouts
7936 'csh') val="$undef" ;;
7941 : Respect a hint or command line value for full_csh.
7943 '') full_csh=$csh ;;
7946 : see if cuserid exists
7947 set cuserid d_cuserid
7950 : see if this is a limits.h system
7951 set limits.h i_limits
7954 : see if this is a float.h system
7958 : See if number of significant digits in a double precision number is known
7960 $cat >dbl_dig.c <<EOM
7970 printf("Contains DBL_DIG");
7973 $cppstdin $cppflags $cppminus < dbl_dig.c >dbl_dig.E 2>/dev/null
7974 if $contains 'DBL_DIG' dbl_dig.E >/dev/null 2>&1; then
7975 echo "DBL_DIG found." >&4
7978 echo "DBL_DIG NOT found." >&4
7985 : see if difftime exists
7986 set difftime d_difftime
7989 : see if this is a dirent system
7991 if xinc=`./findhdr dirent.h`; $test "$xinc"; then
7993 echo "<dirent.h> found." >&4
7996 if xinc=`./findhdr sys/dir.h`; $test "$xinc"; then
7997 echo "<sys/dir.h> found." >&4
8000 xinc=`./findhdr sys/ndir.h`
8002 echo "<dirent.h> NOT found." >&4
8007 : Look for type of directory structure.
8009 $cppstdin $cppflags $cppminus < "$xinc" > try.c
8011 case "$direntrytype" in
8014 $define) guess1='struct dirent' ;;
8015 *) guess1='struct direct' ;;
8018 *) guess1="$direntrytype"
8023 'struct dirent') guess2='struct direct' ;;
8024 *) guess2='struct dirent' ;;
8027 if $contains "$guess1" try.c >/dev/null 2>&1; then
8028 direntrytype="$guess1"
8029 echo "Your directory entries are $direntrytype." >&4
8030 elif $contains "$guess2" try.c >/dev/null 2>&1; then
8031 direntrytype="$guess2"
8032 echo "Your directory entries seem to be $direntrytype." >&4
8034 echo "I don't recognize your system's directory entries." >&4
8035 rp="What type is used for directory entries on this system?"
8043 : see if the directory entry stores field length
8045 $cppstdin $cppflags $cppminus < "$xinc" > try.c
8046 if $contains 'd_namlen' try.c >/dev/null 2>&1; then
8047 echo "Good, your directory entry keeps length information in d_namlen." >&4
8050 echo "Your directory entry does not know about the d_namlen field." >&4
8057 : see if dlerror exists
8060 set dlerror d_dlerror
8064 : see if dlfcn is available
8072 On a few systems, the dynamically loaded modules that perl generates and uses
8073 will need a different extension than shared libs. The default will probably
8081 rp='What is the extension of dynamically loaded modules'
8090 : Check if dlsym need a leading underscore
8096 echo "Checking whether your dlsym() needs a leading underscore ..." >&4
8097 $cat >dyna.c <<'EOM'
8106 #include <dlfcn.h> /* the dynamic linker include file for Sunos/Solaris */
8108 #include <sys/types.h>
8122 int mode = RTLD_LAZY ;
8124 handle = dlopen("./dyna.$dlext", mode) ;
8125 if (handle == NULL) {
8130 symbol = dlsym(handle, "fred") ;
8131 if (symbol == NULL) {
8132 /* try putting a leading underscore */
8133 symbol = dlsym(handle, "_fred") ;
8134 if (symbol == NULL) {
8147 : Call the object file tmp-dyna.o in case dlext=o.
8148 if $cc $ccflags $cccdlflags -c dyna.c > /dev/null 2>&1 &&
8149 mv dyna${_o} tmp-dyna${_o} > /dev/null 2>&1 &&
8150 $ld $lddlflags -o dyna.$dlext tmp-dyna${_o} > /dev/null 2>&1 &&
8151 $cc $ccflags -o fred $ldflags $cccdlflags $ccdlflags fred.c $libs > /dev/null 2>&1; then
8154 1) echo "Test program failed using dlopen." >&4
8155 echo "Perhaps you should not use dynamic loading." >&4;;
8156 2) echo "Test program failed using dlsym." >&4
8157 echo "Perhaps you should not use dynamic loading." >&4;;
8158 3) echo "dlsym needs a leading underscore" >&4
8160 4) echo "dlsym doesn't need a leading underscore." >&4;;
8163 echo "I can't compile and run the test program." >&4
8164 echo "I'm guessing that dlsym doesn't need a leading underscore." >&4
8169 $rm -f fred fred.? dyna.$dlext dyna.? tmp-dyna.?
8174 hasproto='varname=$1; func=$2; shift; shift;
8175 while $test $# -ge 2; do
8177 $define) echo "#include <$2>";;
8181 $cppstdin $cppflags $cppminus < try.c > tryout.c 2>/dev/null;
8182 if $contains "$func.*(" tryout.c >/dev/null 2>&1; then
8183 echo "$func() prototype found.";
8186 echo "$func() prototype NOT found.";
8191 $rm -f try.c tryout.c'
8193 : see if prototype for drand48 is available
8195 set d_drand48proto drand48 $i_stdlib stdlib.h $i_unistd unistd.h
8198 : see if dup2 exists
8202 : see if eaccess exists
8203 set eaccess d_eaccess
8206 : see if endgrent exists
8207 set endgrent d_endgrent
8210 : see if endhostent exists
8211 set endhostent d_endhent
8214 : see if endnetent exists
8215 set endnetent d_endnent
8218 : see if endprotoent exists
8219 set endprotoent d_endpent
8222 : see if endpwent exists
8223 set endpwent d_endpwent
8226 : see if endservent exists
8227 set endservent d_endsent
8230 : see if endspent exists
8231 set endspent d_endspent
8234 : Locate the flags for 'open()'
8236 $cat >open3.c <<'EOCP'
8237 #include <sys/types.h>
8242 #include <sys/file.h>
8253 : check sys/file.h first to get FREAD on Sun
8254 if $test `./findhdr sys/file.h` && \
8255 set open3 -DI_SYS_FILE && eval $compile; then
8257 echo "<sys/file.h> defines the O_* constants..." >&4
8259 echo "and you have the 3 argument form of open()." >&4
8262 echo "but not the 3 argument form of open(). Oh, well." >&4
8265 elif $test `./findhdr fcntl.h` && \
8266 set open3 -DI_FCNTL && eval $compile; then
8268 echo "<fcntl.h> defines the O_* constants..." >&4
8270 echo "and you have the 3 argument form of open()." >&4
8273 echo "but not the 3 argument form of open(). Oh, well." >&4
8278 echo "I can't find the O_* constant definitions! You got problems." >&4
8284 : see which of string.h or strings.h is needed
8286 strings=`./findhdr string.h`
8287 if $test "$strings" && $test -r "$strings"; then
8288 echo "Using <string.h> instead of <strings.h>." >&4
8292 strings=`./findhdr strings.h`
8293 if $test "$strings" && $test -r "$strings"; then
8294 echo "Using <strings.h> instead of <string.h>." >&4
8296 echo "No string header found -- You'll surely have problems." >&4
8302 "$undef") strings=`./findhdr strings.h`;;
8303 *) strings=`./findhdr string.h`;;
8306 : check for non-blocking I/O stuff
8307 case "$h_sysfile" in
8308 true) echo "#include <sys/file.h>" > head.c;;
8311 true) echo "#include <fcntl.h>" > head.c;;
8312 *) echo "#include <sys/fcntl.h>" > head.c;;
8317 echo "Figuring out the flag used by open() for non-blocking I/O..." >&4
8318 case "$o_nonblock" in
8321 $cat >>try.c <<'EOCP'
8325 printf("O_NONBLOCK\n");
8329 printf("O_NDELAY\n");
8333 printf("FNDELAY\n");
8340 if eval $compile_ok; then
8342 case "$o_nonblock" in
8343 '') echo "I can't figure it out, assuming O_NONBLOCK will do.";;
8344 *) echo "Seems like we can use $o_nonblock.";;
8347 echo "(I can't compile the test program; pray O_NONBLOCK is right!)"
8350 *) echo "Using $hint value $o_nonblock.";;
8352 $rm -f try try.* .out core
8355 echo "Let's see what value errno gets from read() on a $o_nonblock file..." >&4
8361 #include <sys/types.h>
8364 #define MY_O_NONBLOCK $o_nonblock
8365 #ifndef errno /* XXX need better Configure test */
8375 #include <strings.h>
8377 $signal_t blech(x) int x; { exit(3); }
8379 $cat >> try.c <<'EOCP'
8387 pipe(pd); /* Down: child -> parent */
8388 pipe(pu); /* Up: parent -> child */
8391 close(pd[1]); /* Parent reads from pd[0] */
8392 close(pu[0]); /* Parent writes (blocking) to pu[1] */
8393 if (-1 == fcntl(pd[0], F_SETFL, MY_O_NONBLOCK))
8395 signal(SIGALRM, blech);
8397 if ((ret = read(pd[0], buf, 1)) > 0) /* Nothing to read! */
8399 sprintf(string, "%d\n", ret);
8400 write(2, string, strlen(string));
8403 if (errno == EAGAIN) {
8409 if (errno == EWOULDBLOCK)
8410 printf("EWOULDBLOCK\n");
8413 write(pu[1], buf, 1); /* Unblocks child, tell it to close our pipe */
8414 sleep(2); /* Give it time to close our pipe */
8416 ret = read(pd[0], buf, 1); /* Should read EOF */
8418 sprintf(string, "%d\n", ret);
8419 write(3, string, strlen(string));
8423 close(pd[0]); /* We write to pd[1] */
8424 close(pu[1]); /* We read from pu[0] */
8425 read(pu[0], buf, 1); /* Wait for parent to signal us we may continue */
8426 close(pd[1]); /* Pipe pd is now fully closed! */
8427 exit(0); /* Bye bye, thank you for playing! */
8431 if eval $compile_ok; then
8432 echo "$startsh" >mtry
8433 echo "./try >try.out 2>try.ret 3>try.err || exit 4" >>mtry
8435 ./mtry >/dev/null 2>&1
8437 0) eagain=`$cat try.out`;;
8438 1) echo "Could not perform non-blocking setting!";;
8439 2) echo "I did a successful read() for something that was not there!";;
8440 3) echo "Hmm... non-blocking I/O does not seem to be working!";;
8441 *) echo "Something terribly wrong happened during testing.";;
8443 rd_nodata=`$cat try.ret`
8444 echo "A read() system call with no data present returns $rd_nodata."
8445 case "$rd_nodata" in
8448 echo "(That's peculiar, fixing that to be -1.)"
8454 echo "Forcing errno EAGAIN on read() with no data available."
8458 echo "Your read() sets errno to $eagain when no data is available."
8461 status=`$cat try.err`
8463 0) echo "And it correctly returns 0 to signal EOF.";;
8464 -1) echo "But it also returns -1 to signal EOF, so be careful!";;
8465 *) echo "However, your read() returns '$status' on EOF??";;
8468 if test "$status" = "$rd_nodata"; then
8469 echo "WARNING: you can't distinguish between EOF and no data!"
8473 echo "I can't compile the test program--assuming errno EAGAIN will do."
8480 echo "Using $hint value $eagain."
8481 echo "Your read() returns $rd_nodata when no data is present."
8482 case "$d_eofnblk" in
8483 "$define") echo "And you can see EOF because read() returns 0.";;
8484 "$undef") echo "But you can't see EOF status from read() returned value.";;
8486 echo "(Assuming you can't see EOF status from read anyway.)"
8492 $rm -f try try.* .out core head.c mtry
8494 : see if fchmod exists
8498 : see if fchown exists
8502 : see if this is an fcntl system
8506 hasfield='varname=$1; struct=$2; field=$3; shift; shift; shift;
8507 while $test $# -ge 2; do
8509 $define) echo "#include <$2>";;
8513 echo "int main () { struct $struct foo; char* bar; bar = (char*)foo.$field; }" >> try.c;
8515 if eval $compile; then
8526 : see whether socket exists
8528 $echo $n "Hmm... $c" >&4
8529 if set socket val -f d_socket; eval $csym; $val; then
8530 echo "Looks like you have Berkeley networking support." >&4
8532 if set setsockopt val -f; eval $csym; $val; then
8535 echo "...but it uses the old BSD 4.1c interface, rather than 4.2." >&4
8539 if $contains socklib libc.list >/dev/null 2>&1; then
8540 echo "Looks like you have Berkeley networking support." >&4
8542 : we will have to assume that it supports the 4.2 BSD interface
8545 echo "You don't have Berkeley networking in libc$_a..." >&4
8546 if test "X$d_socket" = "X$define"; then
8547 echo "...but you seem to believe that you have sockets." >&4
8549 for net in net socket
8551 if test -f /usr/lib/lib$net$_a; then
8552 ( ($nm $nm_opt /usr/lib/lib$net$_a | eval $nm_extract) || \
8553 $ar t /usr/lib/lib$net$_a) 2>/dev/null >> libc.list
8554 if $contains socket libc.list >/dev/null 2>&1; then
8559 echo "...but the Wollongong group seems to have hacked it in." >&4
8560 sockethdr="-I/usr/netinclude"
8563 echo "Found Berkeley sockets interface in lib$net." >& 4
8564 if $contains setsockopt libc.list >/dev/null 2>&1; then
8567 echo "...using the old BSD 4.1c interface, rather than 4.2." >&4
8574 if test "X$d_socket" != "X$define"; then
8575 echo "or anywhere else I see." >&4
8583 : see if socketpair exists
8584 set socketpair d_sockpair
8589 echo "Checking the availability of certain socket constants..." >& 4
8590 for ENUM in MSG_CTRUNC MSG_DONTROUTE MSG_OOB MSG_PEEK MSG_PROXY SCM_RIGHTS; do
8591 enum=`$echo $ENUM|./tr '[A-Z]' '[a-z]'`
8593 #include <sys/types.h>
8594 #include <sys/socket.h>
8600 set try; if eval $compile; then
8603 set d_${enum}; eval $setvar
8607 : see if sys/select.h has to be included
8608 set sys/select.h i_sysselct
8611 : see if we should include time.h, sys/time.h, or both
8613 if test "X$timeincl" = X; then
8614 echo "Testing to see if we should include <time.h>, <sys/time.h> or both." >&4
8615 $echo $n "I'm now running the test program...$c"
8616 $cat >try.c <<'EOCP'
8617 #include <sys/types.h>
8622 #ifdef SYSTIMEKERNEL
8625 #include <sys/time.h>
8628 #include <sys/select.h>
8637 struct timezone tzp;
8639 if (foo.tm_sec == foo.tm_sec)
8642 if (bar.tv_sec == bar.tv_sec)
8649 for s_timezone in '-DS_TIMEZONE' ''; do
8651 for s_timeval in '-DS_TIMEVAL' ''; do
8652 for i_systimek in '' '-DSYSTIMEKERNEL'; do
8653 for i_time in '' '-DI_TIME'; do
8654 for i_systime in '-DI_SYSTIME' ''; do
8657 set try $i_time $i_systime $i_systimek $sysselect $s_timeval $s_timezone
8658 if eval $compile; then
8659 set X $i_time $i_systime $i_systimek $sysselect $s_timeval
8663 $echo $n "Succeeded with $flags$c"
8675 *SYSTIMEKERNEL*) i_systimek="$define"
8676 timeincl=`./findhdr sys/time.h`
8677 echo "We'll include <sys/time.h> with KERNEL defined." >&4;;
8678 *) i_systimek="$undef";;
8681 *I_TIME*) i_time="$define"
8682 timeincl=`./findhdr time.h`" $timeincl"
8683 echo "We'll include <time.h>." >&4;;
8684 *) i_time="$undef";;
8687 *I_SYSTIME*) i_systime="$define"
8688 timeincl=`./findhdr sys/time.h`" $timeincl"
8689 echo "We'll include <sys/time.h>." >&4;;
8690 *) i_systime="$undef";;
8695 : check for fd_set items
8698 Checking to see how well your C compiler handles fd_set and friends ...
8700 $cat >fd_set.c <<EOCP
8701 #$i_systime I_SYS_TIME
8702 #$i_sysselct I_SYS_SELECT
8703 #$d_socket HAS_SOCKET
8704 #include <sys/types.h>
8706 #include <sys/socket.h> /* Might include <sys/bsdtypes.h> */
8709 #include <sys/time.h>
8712 #include <sys/select.h>
8721 #if defined(FD_SET) && defined(FD_CLR) && defined(FD_ISSET) && defined(FD_ZERO)
8728 set fd_set -DTRYBITS
8729 if eval $compile; then
8730 d_fds_bits="$define"
8732 echo "Well, your system knows about the normal fd_set typedef..." >&4
8734 echo "and you have the normal fd_set macros (just as I'd expect)." >&4
8735 d_fd_macros="$define"
8738 but not the normal fd_set macros! Gaaack! I'll have to cover for you.
8740 d_fd_macros="$undef"
8744 Hmm, your compiler has some difficulty with fd_set. Checking further...
8747 if eval $compile; then
8750 echo "Well, your system has some sort of fd_set available..." >&4
8752 echo "and you have the normal fd_set macros." >&4
8753 d_fd_macros="$define"
8756 but not the normal fd_set macros! Gross! More work for me...
8758 d_fd_macros="$undef"
8761 echo "Well, you got zip. That's OK, I can roll my own fd_set stuff." >&4
8764 d_fd_macros="$undef"
8769 : see if fgetpos exists
8770 set fgetpos d_fgetpos
8773 : see if flock exists
8777 : see if fork exists
8781 : see if pathconf exists
8782 set pathconf d_pathconf
8785 : see if fpathconf exists
8786 set fpathconf d_fpathconf
8792 echo "Checking to see if your system supports off64_t..." >&4
8794 #include <sys/types.h>
8796 int main() { off64_t x = 7; }'
8799 if eval $compile; then
8801 echo "Yes, it does."
8804 echo "No, it doesn't."
8805 case "$lseeksize" in
8806 8) echo "(Your off_t is 64 bits, so you could use that.)" ;;
8813 : check for fpos64_t
8815 echo "Checking to see if your system supports fpos64_t..." >&4
8817 #include <sys/stdio.h>
8818 int main() { fpos64_t x x = 7; }'
8821 if eval $compile; then
8823 echo "Yes, it does."
8826 echo "No, it doesn't."
8828 8) echo "(Your fpos_t is 64 bits, so you could use that.)" ;;
8835 hasstruct='varname=$1; struct=$2; shift; shift;
8836 while $test $# -ge 2; do
8838 $define) echo "#include <$2>";;
8842 echo "int main () { struct $struct foo; }" >> try.c;
8844 if eval $compile; then
8853 : see if this is a sys/param system
8854 set sys/param.h i_sysparam
8857 : see if this is a sys/mount.h system
8858 set sys/mount.h i_sysmount
8861 : see if sys/types.h has to be included
8862 set sys/types.h i_systypes
8867 echo "Checking to see if your system supports struct fs_data..." >&4
8868 set d_fs_data_s fs_data $i_systypes sys/types.h $i_sysparam sys/param.h $i_sysmount sys/mount.h
8870 case "$d_fs_data_s" in
8871 "$define") echo "Yes, it does." ;;
8872 *) echo "No, it doesn't." ;;
8875 : see if fseeko exists
8879 8) echo "(Your long is 64 bits, so in a pinch you could use fseek.)" ;;
8882 : see if fsetpos exists
8883 set fsetpos d_fsetpos
8887 : see if fstatfs exists
8888 set fstatfs d_fstatfs
8892 : see if statvfs exists
8893 set statvfs d_statvfs
8896 : see if fstatvfs exists
8897 set fstatvfs d_fstatvfs
8901 : see if ftello exists
8905 8) echo "(Your long is 64 bits, so in a pinch you could use ftell.)" ;;
8908 : see if getgrent exists
8909 set getgrent d_getgrent
8912 : see if gethostbyaddr exists
8913 set gethostbyaddr d_gethbyaddr
8916 : see if gethostbyname exists
8917 set gethostbyname d_gethbyname
8920 : see if gethostent exists
8921 set gethostent d_gethent
8924 : see how we will look up host name
8927 if set gethostname val -f d_gethname; eval $csym; $val; then
8928 echo 'gethostname() found.' >&4
8929 d_gethname="$define"
8932 if set uname val -f d_uname; eval $csym; $val; then
8935 uname() was found, but you're running xenix, and older versions of xenix
8936 have a broken uname(). If you don't really know whether your xenix is old
8937 enough to have a broken system call, use the default answer.
8944 rp='Is your uname() broken?'
8947 n*) d_uname="$define"; call=uname;;
8950 echo 'uname() found.' >&4
8957 case "$d_gethname" in
8958 '') d_gethname="$undef";;
8961 '') d_uname="$undef";;
8963 case "$d_uname$d_gethname" in
8968 Every now and then someone has a $call() that lies about the hostname
8969 but can't be fixed for political or economic reasons. If you wish, I can
8970 pretend $call() isn't there and maybe compute hostname at run-time
8971 thanks to the '$phostname' command.
8974 rp="Shall I ignore $call() from now on?"
8977 y*) d_uname="$undef" d_gethname="$undef"; $echo $n "Okay...$c";;
8980 case "$phostname" in
8982 *) case "$aphostname" in
8988 file=`./loc $file $file $pth`
8989 aphostname=`echo $file $*`
8994 case "$d_uname$d_gethname" in
8997 case "$phostname" in
8999 echo "There will be no way for $package to get your hostname." >&4;;
9001 echo "I'll use 'popen("'"'$aphostname'", "r")'"' to get your hostname." >&4
9005 case "$d_phostname" in
9006 '') d_phostname="$undef";;
9009 : see if this is a netdb.h system
9013 : see if prototypes for various gethostxxx netdb.h functions are available
9015 set d_gethostprotos gethostent $i_netdb netdb.h
9018 : see if getlogin exists
9019 set getlogin d_getlogin
9022 : see if getmnt exists
9026 : see if getmntent exists
9027 set getmntent d_getmntent
9030 : see if getnetbyaddr exists
9031 set getnetbyaddr d_getnbyaddr
9034 : see if getnetbyname exists
9035 set getnetbyname d_getnbyname
9038 : see if getnetent exists
9039 set getnetent d_getnent
9042 : see if prototypes for various getnetxxx netdb.h functions are available
9044 set d_getnetprotos getnetent $i_netdb netdb.h
9048 : see if getprotobyname exists
9049 set getprotobyname d_getpbyname
9052 : see if getprotobynumber exists
9053 set getprotobynumber d_getpbynumber
9056 : see if getprotoent exists
9057 set getprotoent d_getpent
9060 : see if getpgid exists
9061 set getpgid d_getpgid
9064 : see if getpgrp2 exists
9065 set getpgrp2 d_getpgrp2
9068 : see if getppid exists
9069 set getppid d_getppid
9072 : see if getpriority exists
9073 set getpriority d_getprior
9076 : see if prototypes for various getprotoxxx netdb.h functions are available
9078 set d_getprotoprotos getprotoent $i_netdb netdb.h
9081 : see if getpwent exists
9082 set getpwent d_getpwent
9086 : see if getservbyname exists
9087 set getservbyname d_getsbyname
9090 : see if getservbyport exists
9091 set getservbyport d_getsbyport
9094 : see if getservent exists
9095 set getservent d_getsent
9098 : see if prototypes for various getservxxx netdb.h functions are available
9100 set d_getservprotos getservent $i_netdb netdb.h
9103 : see if getspent exists
9104 set getspent d_getspent
9107 : see if getspnam exists
9108 set getspnam d_getspnam
9111 : see if gettimeofday or ftime exists
9112 set gettimeofday d_gettimeod
9114 case "$d_gettimeod" in
9120 val="$undef"; set d_ftime; eval $setvar
9123 case "$d_gettimeod$d_ftime" in
9126 echo 'No ftime() nor gettimeofday() -- timing may be less accurate.' >&4
9130 : see if this is an grp system
9136 xxx=`./findhdr grp.h`
9137 $cppstdin $cppflags $cppminus < $xxx >$$.h
9139 if $contains 'gr_passwd' $$.h >/dev/null 2>&1; then
9151 set d_grpasswd; eval $setvar
9155 : see if hasmntopt exists
9156 set hasmntopt d_hasmntopt
9159 : see if this is a netinet/in.h or sys/in.h system
9160 set netinet/in.h i_niin sys/in.h i_sysin
9163 : see if arpa/inet.h has to be included
9164 set arpa/inet.h i_arpainet
9167 : see if htonl --and friends-- exists
9172 : Maybe they are macros.
9177 #include <sys/types.h>
9178 #$i_niin I_NETINET_IN
9180 #$i_arpainet I_ARPA_INET
9182 #include <netinet/in.h>
9188 #include <arpa/inet.h>
9191 printf("Defined as a macro.");
9194 $cppstdin $cppflags $cppminus < htonl.c >htonl.E 2>/dev/null
9195 if $contains 'Defined as a macro' htonl.E >/dev/null 2>&1; then
9197 echo "But it seems to be defined as a macro." >&4
9207 if set index val -f; eval $csym; $val; then
9208 if set strchr val -f d_strchr; eval $csym; $val; then
9209 if $contains strchr "$strings" >/dev/null 2>&1 ; then
9212 echo "strchr() found." >&4
9216 echo "index() found." >&4
9221 echo "index() found." >&4
9224 if set strchr val -f d_strchr; eval $csym; $val; then
9227 echo "strchr() found." >&4
9229 echo "No index() or strchr() found!" >&4
9234 set d_strchr; eval $setvar
9236 set d_index; eval $setvar
9238 : check whether inet_aton exists
9239 set inet_aton d_inetaton
9244 $cat >isascii.c <<'EOCP'
9256 if eval $compile; then
9257 echo "isascii() found." >&4
9260 echo "isascii() NOT found." >&4
9267 : see if killpg exists
9271 : see if lchown exists
9273 $cat > try.c <<'EOCP'
9274 /* System header to define __stub macros and hopefully few prototypes,
9275 which can conflict with char lchown(); below. */
9277 /* Override any gcc2 internal prototype to avoid an error. */
9278 /* We use char because int might match the return type of a gcc2
9279 builtin and then its argument prototype would still apply. */
9282 /* The GNU C library defines this for functions which it implements
9283 to always fail with ENOSYS. Some functions are actually named
9284 something starting with __ and the normal name is an alias. */
9285 #if defined (__stub_lchown) || defined (__stub___lchown)
9293 if eval $compile; then
9294 $echo "lchown() found." >&4
9297 $echo "lchown() NOT found." >&4
9303 : See if number of significant digits in a double precision number is known
9305 $cat >ldbl_dig.c <<EOM
9315 printf("Contains LDBL_DIG");
9318 $cppstdin $cppflags $cppminus < ldbl_dig.c >ldbl_dig.E 2>/dev/null
9319 if $contains 'LDBL_DIG' ldbl_dig.E >/dev/null 2>&1; then
9320 echo "LDBL_DIG found." >&4
9323 echo "LDBL_DIG NOT found." >&4
9330 : see if link exists
9334 : see if localeconv exists
9335 set localeconv d_locconv
9338 : see if lockf exists
9342 : check for long long
9344 $echo $n "Checking to see if your system supports long long..." $c >&4
9345 echo 'int main() { long long x = 7; return 0; }' > try.c
9347 if eval $compile; then
9349 echo " Yes, it does." >&4
9352 echo " No, it doesn't." >&4
9358 : check for length of long long
9359 case "${d_longlong}${longlongsize}" in
9362 $echo $n "Checking to see how big your long longs are..." $c >&4
9363 $cat >try.c <<'EOCP'
9367 printf("%d\n", (int)sizeof(long long));
9372 if eval $compile_ok; then
9373 longlongsize=`./try$exe_ext`
9374 $echo " $longlongsize bytes." >&4
9378 echo "(I can't seem to compile the test program. Guessing...)"
9379 rp="What is the size of a long long (in bytes)?"
9383 if $test "X$longsize" = "X$longlongsize"; then
9384 echo "(That isn't any different from an ordinary long.)"
9390 : see if lstat exists
9394 : see if mblen exists
9398 : see if mbstowcs exists
9399 set mbstowcs d_mbstowcs
9402 : see if mbtowc exists
9406 : see if memchr exists
9410 : see if memcmp exists
9414 : see if memcpy exists
9418 : see if memmove exists
9419 set memmove d_memmove
9422 : see if memset exists
9426 : see if mkdir exists
9430 : see if mkfifo exists
9434 : see if mktime exists
9438 : see if msgctl exists
9442 : see if msgget exists
9446 : see if msgsnd exists
9450 : see if msgrcv exists
9454 : see how much of the 'msg*(2)' library is present.
9457 case "$d_msgctl$d_msgget$d_msgsnd$d_msgrcv" in
9458 *"$undef"*) h_msg=false;;
9462 case "`ipcs 2>&1`" in
9463 "SVID messages"*"not configured"*)
9464 echo "Your $osname does not have the msg*(2) configured." >&4
9479 : we could also check for sys/ipc.h ...
9480 if $h_msg && $test `./findhdr sys/msg.h`; then
9481 echo "You have the full msg*(2) library." >&4
9484 echo "You don't have the full msg*(2) library." >&4
9490 : see if nice exists
9494 : see if inttypes.h is available
9495 : we want a real compile instead of Inhdr because some systems
9496 : have an inttypes.h which includes non-existent headers
9499 #include <inttypes.h>
9501 static int32_t foo32 = 0x12345678;
9505 if eval $compile; then
9506 echo "<inttypes.h> found." >&4
9509 echo "<inttypes.h> NOT found." >&4
9518 $echo $n "Checking to see if your system supports int64_t...$c" >&4
9520 #include <sys/types.h>
9521 #$i_inttypes I_INTTYPES
9523 #include <inttypes.h>
9525 int main() { int64_t x = 7; }
9528 if eval $compile; then
9530 echo " Yes, it does." >&4
9533 echo " No, it doesn't." >&4
9541 echo "Checking which 64-bit integer type we could use..." >&4
9547 val='"unsigned int"'
9552 *) case "$longsize" in
9556 val='"unsigned long"'
9561 *) case "$uselonglong:$d_longlong:$longlongsize" in
9566 val='"unsigned long long"'
9571 *) case "$d_int64t" in
9590 '') case "$uselonglong:$d_longlong:$longlongsize" in
9592 echo "(You would have 'long long', but you are not using it.)" >&4 ;;
9593 *) echo "Alas, no 64-bit integer types in sight." >&4 ;;
9597 *) if test X"$use64bits" = Xdefine -o X"$longsize" = X8; then
9602 echo "We $verb use '$quadtype' for 64-bit integers." >&4
9607 : check for length of character
9611 echo "Checking to see how big your characters are (hey, you never know)..." >&4
9612 $cat >try.c <<'EOCP'
9616 printf("%d\n", (int)sizeof(char));
9621 if eval $compile_ok; then
9625 echo "(I can't seem to compile the test program. Guessing...)"
9632 rp="What is the size of a character (in bytes)?"
9639 $echo "Choosing the C types to be used for Perl's internal types..." >&4
9641 case "$use64bits:$d_quad:$quadtype" in
9649 uvtype="unsigned long"
9655 case "$uselongdouble:$d_longdbl" in
9657 nvtype="long double"
9665 $echo "(IV will be "$ivtype", $ivsize bytes)"
9666 $echo "(UV will be "$uvtype", $uvsize bytes)"
9667 $echo "(NV will be "$nvtype", $nvsize bytes)"
9670 #$i_inttypes I_INTTYPES
9672 #include <inttypes.h>
9677 int8_t i = INT8_MAX;
9678 uint8_t u = UINT8_MAX;
9682 int16_t i = INT16_MAX;
9683 uint16_t i = UINT16_MAX;
9684 printf("int16_t\n");
9687 int32_t i = INT32_MAX;
9688 uint32_t u = UINT32_MAX;
9689 printf("int32_t\n");
9695 '') case "$charsize" in
9697 u8type="unsigned char"
9706 if eval $compile; then
9707 case "`./try$exe_ext`" in
9708 int8_t) i8type=int8_t
9718 '') if $test $charsize -ge 1; then
9720 u8type="unsigned char"
9728 '') case "$shortsize" in
9730 u16type="unsigned short"
9739 if eval $compile; then
9740 case "`./try$exe_ext`" in
9752 '') if $test $shortsize -ge 2; then
9754 u16type="unsigned short"
9762 '') case "$longsize" in
9764 u32type="unsigned long"
9768 *) case "$intsize" in
9770 u32type="unsigned int"
9781 if eval $compile; then
9782 case "`./try$exe_ext`" in
9794 '') if $test $intsize -ge 4; then
9796 u32type="unsigned int"
9804 '') case "$d_quad:$quadtype" in
9807 u64type="$uquadtype"
9815 $echo "Checking whether your NVs can preserve your UVs..." >&4
9819 $uvtype k = ($uvtype)~0, l;
9825 printf("preserve\n");
9830 if eval $compile; then
9831 case "`./try$exe_ext`" in
9832 preserve) d_nv_preserves_uv="$define" ;;
9835 case "$d_nv_preserves_uv" in
9836 $define) $echo "Yes, they can." 2>&1 ;;
9837 *) $echo "No, they can't." 2>&1
9838 d_nv_preserves_uv="$undef"
9844 : see if POSIX threads are available
9845 set pthread.h i_pthread
9851 : how to create joinable pthreads
9852 if test "X$usethreads" = "X$define" -a "X$i_pthread" = "X$define"; then
9854 echo "Checking what constant to use for creating joinable pthreads..." >&4
9855 $cat >try.c <<'EOCP'
9856 #include <pthread.h>
9858 int detachstate = JOINABLE;
9861 set try -DJOINABLE=PTHREAD_CREATE_JOINABLE
9862 if eval $compile; then
9863 echo "You seem to use PTHREAD_CREATE_JOINABLE." >&4
9864 val="$undef" # Yes, undef.
9865 set d_old_pthread_create_joinable
9868 set old_pthread_create_joinable
9871 set try -DJOINABLE=PTHREAD_CREATE_UNDETACHED
9872 if eval $compile; then
9873 echo "You seem to use PTHREAD_CREATE_UNDETACHED." >&4
9875 set d_old_pthread_create_joinable
9877 val=PTHREAD_CREATE_UNDETACHED
9878 set old_pthread_create_joinable
9881 set try -DJOINABLE=__UNDETACHED
9882 if eval $compile; then
9883 echo "You seem to use __UNDETACHED." >&4
9885 set d_old_pthread_create_joinable
9888 set old_pthread_create_joinable
9891 echo "Egads, nothing obvious found. Guessing that you use 0." >&4
9893 set d_old_pthread_create_joinable
9896 set old_pthread_create_joinable
9903 d_old_pthread_create_joinable="$undef"
9904 old_pthread_create_joinable=""
9907 : see if pause exists
9911 : see if pipe exists
9915 : see if poll exists
9920 : see whether the various POSIXish _yields exist
9922 #include <pthread.h>
9928 #ifdef PTHREAD_YIELD
9931 #ifdef PTHREAD_YIELD_NULL
9932 pthread_yield(NULL);
9938 : see if sched_yield exists
9939 set try -DSCHED_YIELD
9940 if eval $compile; then
9942 sched_yield='sched_yield()'
9946 case "$usethreads" in
9949 $define) echo 'sched_yield() found.' >&4 ;;
9950 *) echo 'sched_yield() NOT found.' >&4 ;;
9956 : see if pthread_yield exists
9957 set try -DPTHREAD_YIELD
9958 if eval $compile; then
9960 case "$sched_yield" in
9961 '') sched_yield='pthread_yield()' ;;
9964 set try -DPTHREAD_YIELD_NULL
9965 if eval $compile; then
9967 case "$sched_yield" in
9968 '') sched_yield='pthread_yield(NULL)' ;;
9974 case "$usethreads" in
9977 $define) echo 'pthread_yield() found.' >&4 ;;
9978 *) echo 'pthread_yield() NOT found.' >&4 ;;
9985 case "$sched_yield" in
9986 '') sched_yield=undef ;;
9991 : see if this is a pwd.h system
9997 xxx=`./findhdr pwd.h`
9998 $cppstdin $cppflags $cppminus < $xxx >$$.h
10000 if $contains 'pw_quota' $$.h >/dev/null 2>&1; then
10008 if $contains 'pw_age' $$.h >/dev/null 2>&1; then
10016 if $contains 'pw_change' $$.h >/dev/null 2>&1; then
10024 if $contains 'pw_class' $$.h >/dev/null 2>&1; then
10032 if $contains 'pw_expire' $$.h >/dev/null 2>&1; then
10040 if $contains 'pw_comment' $$.h >/dev/null 2>&1; then
10048 if $contains 'pw_gecos' $$.h >/dev/null 2>&1; then
10056 if $contains 'pw_passwd' $$.h >/dev/null 2>&1; then
10068 set d_pwquota; eval $setvar
10069 set d_pwage; eval $setvar
10070 set d_pwchange; eval $setvar
10071 set d_pwclass; eval $setvar
10072 set d_pwexpire; eval $setvar
10073 set d_pwcomment; eval $setvar
10074 set d_pwgecos; eval $setvar
10075 set d_pwpasswd; eval $setvar
10079 : see if readdir and friends exist
10080 set readdir d_readdir
10082 set seekdir d_seekdir
10084 set telldir d_telldir
10086 set rewinddir d_rewinddir
10089 : see if readlink exists
10090 set readlink d_readlink
10093 : see if rename exists
10094 set rename d_rename
10097 : see if rmdir exists
10101 : see if memory.h is available.
10106 : See if it conflicts with string.h
10112 $cppstdin $cppflags $cppminus < $strings > mem.h
10113 if $contains 'memcpy' mem.h >/dev/null 2>&1; then
10115 echo "We won't be including <memory.h>."
10125 : can bcopy handle overlapping blocks?
10130 echo "Checking to see if your bcopy() can do overlapping copies..." >&4
10132 #$i_memory I_MEMORY
10133 #$i_stdlib I_STDLIB
10134 #$i_string I_STRING
10135 #$i_unistd I_UNISTD
10137 $cat >>try.c <<'EOCP'
10140 # include <memory.h>
10143 # include <stdlib.h>
10146 # include <string.h>
10148 # include <strings.h>
10151 # include <unistd.h> /* Needed for NetBSD */
10155 char buf[128], abc[128];
10161 bcopy("abcdefghijklmnopqrstuvwxyz0123456789", abc, 36);
10163 for (align = 7; align >= 0; align--) {
10164 for (len = 36; len; len--) {
10166 bcopy(abc, b, len);
10167 for (off = 1; off <= len; off++) {
10168 bcopy(b, b+off, len);
10169 bcopy(b+off, b, len);
10170 if (bcmp(b, abc, len))
10179 if eval $compile_ok; then
10180 if ./try 2>/dev/null; then
10181 echo "Yes, it can."
10184 echo "It can't, sorry."
10185 case "$d_memmove" in
10186 "$define") echo "But that's Ok since you have memmove()." ;;
10190 echo "(I can't compile the test program, so we'll assume not...)"
10191 case "$d_memmove" in
10192 "$define") echo "But that's Ok since you have memmove()." ;;
10197 $rm -f try.* try core
10201 : can memcpy handle overlapping blocks?
10203 case "$d_memcpy" in
10206 echo "Checking to see if your memcpy() can do overlapping copies..." >&4
10208 #$i_memory I_MEMORY
10209 #$i_stdlib I_STDLIB
10210 #$i_string I_STRING
10211 #$i_unistd I_UNISTD
10213 $cat >>try.c <<'EOCP'
10216 # include <memory.h>
10219 # include <stdlib.h>
10222 # include <string.h>
10224 # include <strings.h>
10227 # include <unistd.h> /* Needed for NetBSD */
10231 char buf[128], abc[128];
10237 /* Copy "abcde..." string to char abc[] so that gcc doesn't
10238 try to store the string in read-only memory. */
10239 memcpy(abc, "abcdefghijklmnopqrstuvwxyz0123456789", 36);
10241 for (align = 7; align >= 0; align--) {
10242 for (len = 36; len; len--) {
10244 memcpy(b, abc, len);
10245 for (off = 1; off <= len; off++) {
10246 memcpy(b+off, b, len);
10247 memcpy(b, b+off, len);
10248 if (memcmp(b, abc, len))
10257 if eval $compile_ok; then
10258 if ./try 2>/dev/null; then
10259 echo "Yes, it can."
10262 echo "It can't, sorry."
10263 case "$d_memmove" in
10264 "$define") echo "But that's Ok since you have memmove()." ;;
10268 echo "(I can't compile the test program, so we'll assume not...)"
10269 case "$d_memmove" in
10270 "$define") echo "But that's Ok since you have memmove()." ;;
10275 $rm -f try.* try core
10279 : can memcmp be trusted to compare relative magnitude?
10281 case "$d_memcmp" in
10284 echo "Checking if your memcmp() can compare relative magnitude..." >&4
10286 #$i_memory I_MEMORY
10287 #$i_stdlib I_STDLIB
10288 #$i_string I_STRING
10289 #$i_unistd I_UNISTD
10291 $cat >>try.c <<'EOCP'
10294 # include <memory.h>
10297 # include <stdlib.h>
10300 # include <string.h>
10302 # include <strings.h>
10305 # include <unistd.h> /* Needed for NetBSD */
10311 if ((a < b) && memcmp(&a, &b, 1) < 0)
10317 if eval $compile_ok; then
10318 if ./try 2>/dev/null; then
10319 echo "Yes, it can."
10322 echo "No, it can't (it uses signed chars)."
10325 echo "(I can't compile the test program, so we'll assume not...)"
10329 $rm -f try.* try core
10333 : see if select exists
10334 set select d_select
10337 : see if semctl exists
10338 set semctl d_semctl
10341 : see if semget exists
10342 set semget d_semget
10345 : see if semop exists
10349 : see how much of the 'sem*(2)' library is present.
10352 case "$d_semctl$d_semget$d_semop" in
10353 *"$undef"*) h_sem=false;;
10357 case "`ipcs 2>&1`" in
10358 "SVID messages"*"not configured"*)
10359 echo "Your $osname does not have the sem*(2) configured." >&4
10362 set semctl d_semctl
10364 set semget d_semget
10372 : we could also check for sys/ipc.h ...
10373 if $h_sem && $test `./findhdr sys/sem.h`; then
10374 echo "You have the full sem*(2) library." >&4
10377 echo "You don't have the full sem*(2) library." >&4
10383 : see whether sys/sem.h defines union semun
10385 $cat > try.c <<'END'
10386 #include <sys/types.h>
10387 #include <sys/ipc.h>
10388 #include <sys/sem.h>
10389 int main () { union semun semun; semun.buf = 0; }
10392 if eval $compile; then
10393 echo "You have union semun in <sys/sem.h>." >&4
10396 echo "You do not have union semun in <sys/sem.h>." >&4
10399 $rm -f try try.c try.h
10403 : see how to do semctl IPC_STAT
10406 : see whether semctl IPC_STAT can use union semun
10411 # define S_IRUSR S_IREAD
10412 # define S_IWUSR S_IWRITE
10413 # define S_IXUSR S_IEXEC
10415 # define S_IRUSR 0400
10416 # define S_IWUSR 0200
10417 # define S_IXUSR 0100
10419 # define S_IRGRP (S_IRUSR>>3)
10420 # define S_IWGRP (S_IWUSR>>3)
10421 # define S_IXGRP (S_IXUSR>>3)
10422 # define S_IROTH (S_IRUSR>>6)
10423 # define S_IWOTH (S_IWUSR>>6)
10424 # define S_IXOTH (S_IXUSR>>6)
10427 # define S_IRWXU (S_IRUSR|S_IWUSR|S_IXUSR)
10428 # define S_IRWXG (S_IRGRP|S_IWGRP|S_IXGRP)
10429 # define S_IRWXO (S_IROTH|S_IWOTH|S_IXOTH)
10434 #include <sys/types.h>
10435 #include <sys/ipc.h>
10436 #include <sys/sem.h>
10437 #include <sys/stat.h>
10444 #$d_union_semun HAS_UNION_SEMUN
10447 #ifndef HAS_UNION_SEMUN
10450 struct semid_ds *buf;
10451 unsigned short *array;
10457 #if defined(IPC_PRIVATE) && defined(S_IRWXU) && defined(S_IRWXG) && defined(S_IRWXO) && defined(IPC_CREAT)
10458 sem = semget(IPC_PRIVATE, 1, S_IRWXU|S_IRWXG|S_IRWXO|IPC_CREAT);
10460 struct semid_ds argbuf;
10463 st = semctl(sem, 0, IPC_STAT, arg);
10467 # endif /* IPC_STAT */
10468 printf("semctl IPC_STAT failed: errno = %d\n", errno);
10470 if (semctl(sem, 0, IPC_RMID, arg) != 0)
10471 # endif /* IPC_RMID */
10472 printf("semctl IPC_RMID failed: errno = %d\n", errno);
10474 #endif /* IPC_PRIVATE && ... */
10475 printf("semget failed: errno = %d\n", errno);
10481 if eval $compile; then
10484 semun) val="$define" ;;
10490 case "$d_semctl_semun" in
10492 echo "You can use union semun for semctl IPC_STAT." >&4
10495 *) echo "You cannot use union semun for semctl IPC_STAT." >&4
10500 : see whether semctl IPC_STAT can use struct semid_ds pointer
10501 $cat > try.c <<'END'
10502 #include <sys/types.h>
10503 #include <sys/ipc.h>
10504 #include <sys/sem.h>
10505 #include <sys/stat.h>
10513 struct semid_ds arg;
10516 #if defined(IPC_PRIVATE) && defined(S_IRWXU) && defined(S_IRWXG) && defined(S_IRWXO) && defined(IPC_CREAT)
10517 sem = semget(IPC_PRIVATE, 1, S_IRWXU|S_IRWXG|S_IRWXO|IPC_CREAT);
10520 st = semctl(sem, 0, IPC_STAT, &arg);
10522 printf("semid_ds\n");
10524 # endif /* IPC_STAT */
10525 printf("semctl IPC_STAT failed: errno = %d\n", errno);
10527 if (semctl(sem, 0, IPC_RMID, &arg) != 0)
10528 # endif /* IPC_RMID */
10529 printf("semctl IPC_RMID failed: errno = %d\n", errno);
10531 #endif /* IPC_PRIVATE && ... */
10532 printf("semget failed: errno = %d\n", errno);
10539 if eval $compile; then
10542 semid_ds) val="$define" ;;
10546 set d_semctl_semid_ds
10548 case "$d_semctl_semid_ds" in
10550 echo "You can $also use struct semid_ds* for semctl IPC_STAT." >&4
10552 *) echo "You cannot use struct semid_ds* for semctl IPC_STAT." >&4
10559 # We do not have the full sem*(2) library, so assume we can not
10565 set d_semctl_semid_ds
10570 : see if setegid exists
10571 set setegid d_setegid
10574 : see if seteuid exists
10575 set seteuid d_seteuid
10578 : see if setgrent exists
10579 set setgrent d_setgrent
10582 : see if sethostent exists
10583 set sethostent d_sethent
10586 : see if setlinebuf exists
10587 set setlinebuf d_setlinebuf
10590 : see if setlocale exists
10591 set setlocale d_setlocale
10594 : see if setnetent exists
10595 set setnetent d_setnent
10598 : see if setprotoent exists
10599 set setprotoent d_setpent
10602 : see if setpgid exists
10603 set setpgid d_setpgid
10606 : see if setpgrp2 exists
10607 set setpgrp2 d_setpgrp2
10610 : see if setpriority exists
10611 set setpriority d_setprior
10614 : see if setpwent exists
10615 set setpwent d_setpwent
10618 : see if setregid exists
10619 set setregid d_setregid
10621 set setresgid d_setresgid
10624 : see if setreuid exists
10625 set setreuid d_setreuid
10627 set setresuid d_setresuid
10630 : see if setrgid exists
10631 set setrgid d_setrgid
10634 : see if setruid exists
10635 set setruid d_setruid
10638 : see if setservent exists
10639 set setservent d_setsent
10642 : see if setsid exists
10643 set setsid d_setsid
10646 : see if setspent exists
10647 set setspent d_setspent
10650 : see if setvbuf exists
10651 set setvbuf d_setvbuf
10654 : see if sfio.h is available
10659 : see if sfio library is available
10670 : Ok, but do we want to use it.
10674 true|$define|[yY]*) dflt='y';;
10677 echo "$package can use the sfio library, but it is experimental."
10678 rp="You seem to have sfio available, do you want to try using it?"
10682 *) echo "Ok, avoiding sfio this time. I'll use stdio instead."
10684 : Remove sfio from list of libraries to use
10685 set `echo X $libs | $sed -e 's/-lsfio / /' -e 's/-lsfio$//'`
10688 echo "libs = $libs" >&4
10692 *) case "$usesfio" in
10693 true|$define|[yY]*)
10694 echo "Sorry, cannot find sfio on this machine" >&4
10695 echo "Ignoring your setting of usesfio=$usesfio" >&4
10703 $define) usesfio='true';;
10704 *) usesfio='false';;
10707 : see if shmctl exists
10708 set shmctl d_shmctl
10711 : see if shmget exists
10712 set shmget d_shmget
10715 : see if shmat exists
10718 : see what shmat returns
10721 $cat >shmat.c <<'END'
10722 #include <sys/shm.h>
10725 if $cc $ccflags -c shmat.c >/dev/null 2>&1; then
10730 echo "and it returns ($shmattype)." >&4
10731 : see if a prototype for shmat is available
10732 xxx=`./findhdr sys/shm.h`
10733 $cppstdin $cppflags $cppminus < $xxx > shmat.c 2>/dev/null
10734 if $contains 'shmat.*(' shmat.c >/dev/null 2>&1; then
10745 set d_shmatprototype
10748 : see if shmdt exists
10752 : see how much of the 'shm*(2)' library is present.
10755 case "$d_shmctl$d_shmget$d_shmat$d_shmdt" in
10756 *"$undef"*) h_shm=false;;
10760 case "`ipcs 2>&1`" in
10761 "SVID shared memory"*"not configured"*)
10762 echo "Your $osname does not have the shm*(2) configured." >&4
10765 set shmctl d_shmctl
10767 set shmget d_shmget
10777 : we could also check for sys/ipc.h ...
10778 if $h_shm && $test `./findhdr sys/shm.h`; then
10779 echo "You have the full shm*(2) library." >&4
10782 echo "You don't have the full shm*(2) library." >&4
10789 : see if we have sigaction
10790 if set sigaction val -f d_sigaction; eval $csym; $val; then
10791 echo 'sigaction() found.' >&4
10792 $cat > try.c <<'EOP'
10794 #include <sys/types.h>
10795 #include <signal.h>
10798 struct sigaction act, oact;
10800 oact.sa_handler = 0;
10801 /* so that act and oact are used */
10802 exit(act.sa_flags == 0 && oact.sa_handler == 0);
10806 if eval $compile_ok; then
10809 echo "But you don't seem to have a useable struct sigaction." >&4
10813 echo 'sigaction NOT found.' >&4
10816 set d_sigaction; eval $setvar
10817 $rm -f try try$_o try.c
10819 : see if sigsetjmp exists
10821 case "$d_sigsetjmp" in
10823 $cat >try.c <<'EOP'
10824 #include <setjmp.h>
10829 if (sigsetjmp(env,1))
10832 siglongjmp(env, 1);
10837 if eval $compile; then
10838 if ./try >/dev/null 2>&1; then
10839 echo "POSIX sigsetjmp found." >&4
10843 Uh-Oh! You have POSIX sigsetjmp and siglongjmp, but they do not work properly!!
10849 echo "sigsetjmp not found." >&4
10853 *) val="$d_sigsetjmp"
10854 case "$d_sigsetjmp" in
10855 $define) echo "POSIX sigsetjmp found." >&4;;
10856 $undef) echo "sigsetjmp not found." >&4;;
10864 : see if sqrtl exists
10868 : see if sys/stat.h is available
10869 set sys/stat.h i_sysstat
10873 : see if stat knows about block sizes
10875 echo "Checking to see if your struct stat has st_blocks field..." >&4
10876 set d_statblks stat st_blocks $i_sysstat sys/stat.h
10880 : see if this is a sys/vfs.h system
10881 set sys/vfs.h i_sysvfs
10885 : see if this is a sys/statfs.h system
10886 set sys/statfs.h i_sysstatfs
10891 echo "Checking to see if your system supports struct statfs..." >&4
10892 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
10894 case "$d_statfs_s" in
10895 "$define") echo "Yes, it does." ;;
10896 *) echo "No, it doesn't." ;;
10901 : see if struct statfs knows about f_flags
10902 case "$d_statfs_s" in
10905 echo "Checking to see if your struct statfs has f_flags field..." >&4
10906 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
10910 set d_statfs_f_flags
10914 case "$d_statfs_f_flags" in
10915 "$define") echo "Yes, it does." ;;
10916 *) echo "No, it doesn't." ;;
10919 : see if _ptr and _cnt from stdio act std
10921 if $contains '_IO_fpos_t' `./findhdr stdio.h` `./findhdr libio.h` >/dev/null 2>&1 ; then
10922 echo "(Looks like you have stdio.h from Linux.)"
10923 case "$stdio_ptr" in
10924 '') stdio_ptr='((fp)->_IO_read_ptr)'
10927 *) ptr_lval=$d_stdio_ptr_lval;;
10929 case "$stdio_cnt" in
10930 '') stdio_cnt='((fp)->_IO_read_end - (fp)->_IO_read_ptr)'
10933 *) cnt_lval=$d_stdio_cnt_lval;;
10935 case "$stdio_base" in
10936 '') stdio_base='((fp)->_IO_read_base)';;
10938 case "$stdio_bufsiz" in
10939 '') stdio_bufsiz='((fp)->_IO_read_end - (fp)->_IO_read_base)';;
10942 case "$stdio_ptr" in
10943 '') stdio_ptr='((fp)->_ptr)'
10946 *) ptr_lval=$d_stdio_ptr_lval;;
10948 case "$stdio_cnt" in
10949 '') stdio_cnt='((fp)->_cnt)'
10952 *) cnt_lval=$d_stdio_cnt_lval;;
10954 case "$stdio_base" in
10955 '') stdio_base='((fp)->_base)';;
10957 case "$stdio_bufsiz" in
10958 '') stdio_bufsiz='((fp)->_cnt + (fp)->_ptr - (fp)->_base)';;
10961 : test whether _ptr and _cnt really work
10962 echo "Checking how std your stdio is..." >&4
10965 #define FILE_ptr(fp) $stdio_ptr
10966 #define FILE_cnt(fp) $stdio_cnt
10968 FILE *fp = fopen("try.c", "r");
10971 18 <= FILE_cnt(fp) &&
10972 strncmp(FILE_ptr(fp), "include <stdio.h>\n", 18) == 0
10980 if eval $compile; then
10982 echo "Your stdio acts pretty std."
10985 echo "Your stdio isn't very std."
10988 echo "Your stdio doesn't appear very std."
10994 : Can _ptr be used as an lvalue?
10995 case "$d_stdstdio$ptr_lval" in
10996 $define$define) val=$define ;;
10999 set d_stdio_ptr_lval
11002 : Can _cnt be used as an lvalue?
11003 case "$d_stdstdio$cnt_lval" in
11004 $define$define) val=$define ;;
11007 set d_stdio_cnt_lval
11010 : see if _base is also standard
11012 case "$d_stdstdio" in
11016 #define FILE_base(fp) $stdio_base
11017 #define FILE_bufsiz(fp) $stdio_bufsiz
11019 FILE *fp = fopen("try.c", "r");
11022 19 <= FILE_bufsiz(fp) &&
11023 strncmp(FILE_base(fp), "#include <stdio.h>\n", 19) == 0
11030 if eval $compile; then
11032 echo "And its _base field acts std."
11035 echo "But its _base field isn't std."
11038 echo "However, it seems to be lacking the _base field."
11047 Checking how to access stdio streams by file descriptor number...
11049 case "$stdio_stream_array" in
11050 '') $cat >try.c <<EOCP
11053 if (&STDIO_STREAM_ARRAY[fileno(stdin)] == stdin)
11057 for s in _iob __iob __sF
11059 set try -DSTDIO_STREAM_ARRAY=$s
11060 if eval $compile; then
11061 case "`./try$exe_ext`" in
11062 yes) stdio_stream_array=$s; break ;;
11066 $rm -f try.* try$exe_ext
11068 case "$stdio_stream_array" in
11070 I can't figure out how to access stdio streams by file descriptor number.
11072 d_stdio_stream_array="$undef"
11075 You can access stdio streams by file descriptor number by the $stdio_stream_array array.
11077 d_stdio_stream_array="$define"
11081 : see if strcoll exists
11082 set strcoll d_strcoll
11085 : check for structure copying
11087 echo "Checking to see if your C compiler can copy structs..." >&4
11088 $cat >try.c <<'EOCP'
11098 if $cc -c try.c >/dev/null 2>&1 ; then
11100 echo "Yup, it can."
11103 echo "Nope, it can't."
11109 : see if strerror and/or sys_errlist[] exist
11111 if test "X$d_strerror" = X -o "X$d_syserrlst" = X; then
11112 if set strerror val -f d_strerror; eval $csym; $val; then
11113 echo 'strerror() found.' >&4
11114 d_strerror="$define"
11115 d_strerrm='strerror(e)'
11116 if set sys_errlist val -a d_syserrlst; eval $csym; $val; then
11117 echo "(You also have sys_errlist[], so we could roll our own strerror.)"
11118 d_syserrlst="$define"
11120 echo "(Since you don't have sys_errlist[], sterror() is welcome.)"
11121 d_syserrlst="$undef"
11123 elif xxx=`./findhdr string.h`; test "$xxx" || xxx=`./findhdr strings.h`; \
11124 $contains '#[ ]*define.*strerror' "$xxx" >/dev/null 2>&1; then
11125 echo 'strerror() found in string header.' >&4
11126 d_strerror="$define"
11127 d_strerrm='strerror(e)'
11128 if set sys_errlist val -a d_syserrlst; eval $csym; $val; then
11129 echo "(Most probably, strerror() uses sys_errlist[] for descriptions.)"
11130 d_syserrlst="$define"
11132 echo "(You don't appear to have any sys_errlist[], how can this be?)"
11133 d_syserrlst="$undef"
11135 elif set sys_errlist val -a d_syserrlst; eval $csym; $val; then
11136 echo "strerror() not found, but you have sys_errlist[] so we'll use that." >&4
11137 d_strerror="$undef"
11138 d_syserrlst="$define"
11139 d_strerrm='((e)<0||(e)>=sys_nerr?"unknown":sys_errlist[e])'
11141 echo 'strerror() and sys_errlist[] NOT found.' >&4
11142 d_strerror="$undef"
11143 d_syserrlst="$undef"
11144 d_strerrm='"unknown"'
11148 : see if strtod exists
11149 set strtod d_strtod
11152 : see if strtol exists
11153 set strtol d_strtol
11156 : see if strtold exists
11157 set strtold d_strtold
11160 : see if strtoll exists
11161 set strtoll d_strtoll
11164 : see if strtoul exists
11165 set strtoul d_strtoul
11168 : see if strtoull exists
11169 set strtoull d_strtoull
11172 : see if strtouq exists
11173 set strtouq d_strtouq
11176 : see if strxfrm exists
11177 set strxfrm d_strxfrm
11180 : see if symlink exists
11181 set symlink d_symlink
11184 : see if syscall exists
11185 set syscall d_syscall
11188 : see if sysconf exists
11189 set sysconf d_sysconf
11192 : see if system exists
11193 set system d_system
11196 : see if tcgetpgrp exists
11197 set tcgetpgrp d_tcgetpgrp
11200 : see if tcsetpgrp exists
11201 set tcsetpgrp d_tcsetpgrp
11204 : see if prototype for telldir is available
11206 set d_telldirproto telldir $i_systypes sys/types.h $i_dirent dirent.h
11209 : see if this is a sys/times.h system
11210 set sys/times.h i_systimes
11213 : see if times exists
11215 if set times val -f d_times; eval $csym; $val; then
11216 echo 'times() found.' >&4
11219 case "$i_systimes" in
11220 "$define") inc='sys/times.h';;
11222 rp="What is the type returned by times() on this system?"
11223 set clock_t clocktype long stdio.h sys/types.h $inc
11226 echo 'times() NOT found, hope that will do.' >&4
11231 : see if truncate exists
11232 set truncate d_truncate
11235 : see if tzname[] exists
11237 if set tzname val -a d_tzname; eval $csym; $val; then
11239 echo 'tzname[] found.' >&4
11242 echo 'tzname[] NOT found.' >&4
11247 : see if umask exists
11251 : see if ustat exists
11255 : backward compatibility for d_hvfork
11256 if test X$d_hvfork != X; then
11257 d_vfork="$d_hvfork"
11260 : see if there is a vfork
11265 : Ok, but do we want to use it. vfork is reportedly unreliable in
11266 : perl on Solaris 2.x, and probably elsewhere.
11270 case "$usevfork" in
11276 Perl can only use a vfork() that doesn't suffer from strict
11277 restrictions on calling functions or modifying global data in
11278 the child. For example, glibc-2.1 contains such a vfork()
11279 that is unsuitable. If your system provides a proper fork()
11280 call, chances are that you do NOT want perl to use vfork().
11283 rp="Do you still want to use vfork()?"
11288 echo "Ok, we won't use vfork()."
11297 $define) usevfork='true';;
11298 *) usevfork='false';;
11301 : see if this is an sysdir system
11302 set sys/dir.h i_sysdir
11305 : see if this is an sysndir system
11306 set sys/ndir.h i_sysndir
11309 : see if closedir exists
11310 set closedir d_closedir
11313 case "$d_closedir" in
11316 echo "Checking whether closedir() returns a status..." >&4
11317 cat > closedir.c <<EOM
11318 #$i_dirent I_DIRENT /**/
11319 #$i_sysdir I_SYS_DIR /**/
11320 #$i_sysndir I_SYS_NDIR /**/
11321 #$i_systypes I_SYS_TYPES /**/
11323 #if defined(I_SYS_TYPES)
11324 #include <sys/types.h>
11326 #if defined(I_DIRENT)
11327 #include <dirent.h>
11328 #if defined(NeXT) && defined(I_SYS_DIR) /* NeXT needs dirent + sys/dir.h */
11329 #include <sys/dir.h>
11333 #include <sys/ndir.h>
11337 #include <ndir.h> /* may be wrong in the future */
11339 #include <sys/dir.h>
11344 int main() { return closedir(opendir(".")); }
11347 if eval $compile_ok; then
11348 if ./closedir > /dev/null 2>&1 ; then
11349 echo "Yes, it does."
11352 echo "No, it doesn't."
11356 echo "(I can't seem to compile the test program--assuming it doesn't)"
11364 set d_void_closedir
11367 : check for volatile keyword
11369 echo 'Checking to see if your C compiler knows about "volatile"...' >&4
11370 $cat >try.c <<'EOCP'
11373 typedef struct _goo_struct goo_struct;
11374 goo_struct * volatile goo = ((goo_struct *)0);
11375 struct _goo_struct {
11380 typedef unsigned short foo_t;
11381 char *volatile foo;
11383 volatile foo_t blech;
11387 if $cc -c $ccflags try.c >/dev/null 2>&1 ; then
11389 echo "Yup, it does."
11392 echo "Nope, it doesn't."
11398 : see if there is a wait4
11402 : see if waitpid exists
11403 set waitpid d_waitpid
11406 : see if wcstombs exists
11407 set wcstombs d_wcstombs
11410 : see if wctomb exists
11411 set wctomb d_wctomb
11414 : preserve RCS keywords in files with variable substitution, grrr
11419 Revision='$Revision'
11421 case "$crosscompile" in
11422 ''|[nN]*) crosscompile="$undef" ;;
11426 next|rhapsody) multiarch="$define" ;;
11428 case "$multiarch" in
11429 ''|[nN]*) multiarch="$undef" ;;
11432 : check for alignment requirements
11434 case "$crosscompile$multiarch" in
11437 You seem to be either cross-compiling or doing a multiarchitecture build,
11438 skipping the memory alignment check.
11441 case "$alignbytes" in
11442 '') alignbytes=8 ;;
11446 case "$alignbytes" in
11447 '') echo "Checking alignment constraints..." >&4
11448 $cat >try.c <<'EOCP'
11456 printf("%d\n", (int)((char *)&try_algn.bar - (char *)&try_algn.foo));
11461 if eval $compile_ok; then
11465 echo "(I can't seem to compile the test program...)"
11468 *) dflt="$alignbytes"
11471 rp="Doubles must be aligned on a how-many-byte boundary?"
11479 : check for ordering of bytes in a long
11481 case "$crosscompile$multiarch" in
11484 You seem to be either cross-compiling or doing a multiarchitecture build,
11485 skipping the byteorder check.
11491 case "$byteorder" in
11494 In the following, larger digits indicate more significance. A big-endian
11495 machine like a Pyramid or a Motorola 680?0 chip will come out to 4321. A
11496 little-endian machine like a Vax or an Intel 80?86 chip would be 1234. Other
11497 machines may have weird orders like 3412. A Cray will report 87654321,
11498 an Alpha will report 12345678. If the test program works the default is
11500 I'm now running the test program...
11502 $cat >try.c <<'EOCP'
11509 char c[sizeof(long)];
11512 if (sizeof(long) > 4)
11513 u.l = (0x08070605L << 32) | 0x04030201L;
11516 for (i = 0; i < sizeof(long); i++)
11517 printf("%c", u.c[i]+'0');
11524 if eval $compile && ./try > /dev/null; then
11527 [1-4][1-4][1-4][1-4]|12345678|87654321)
11528 echo "(The test program ran ok.)"
11529 echo "byteorder=$dflt"
11532 ????|????????) echo "(The test program ran ok.)" ;;
11533 *) echo "(The test program didn't run right for some reason.)" ;;
11538 (I can't seem to compile the test program. Guessing big-endian...)
11541 case "$xxx_prompt" in
11543 rp="What is the order of bytes in a long?"
11557 : how do we catenate cpp tokens here?
11559 echo "Checking to see how your cpp does stuff like catenate tokens..." >&4
11560 $cat >cpp_stuff.c <<'EOCP'
11561 #define RCAT(a,b)a/**/b
11562 #define ACAT(a,b)a ## b
11566 $cppstdin $cppflags $cppminus <cpp_stuff.c >cpp_stuff.out 2>&1
11567 if $contains 'Circus' cpp_stuff.out >/dev/null 2>&1; then
11568 echo "Oh! Smells like ANSI's been here." >&4
11569 echo "We can catify or stringify, separately or together!"
11571 elif $contains 'Reiser' cpp_stuff.out >/dev/null 2>&1; then
11572 echo "Ah, yes! The good old days!" >&4
11573 echo "However, in the good old days we don't know how to stringify and"
11574 echo "catify at the same time."
11578 Hmm, I don't seem to be able to catenate tokens with your cpp. You're going
11579 to have to edit the values of CAT[2-5] in config.h...
11581 cpp_stuff="/* Help! How do we handle cpp_stuff? */*/"
11585 : see if this is a db.h system
11591 : Check db version.
11593 echo "Checking Berkeley DB version ..." >&4
11599 #include <sys/types.h>
11604 #ifdef DB_VERSION_MAJOR /* DB version >= 2 */
11605 int Major, Minor, Patch ;
11606 unsigned long Version ;
11607 (void)db_version(&Major, &Minor, &Patch) ;
11608 printf("You have Berkeley DB Version 2 or greater\n");
11610 printf("db.h is from Berkeley DB Version %d.%d.%d\n",
11611 DB_VERSION_MAJOR, DB_VERSION_MINOR, DB_VERSION_PATCH);
11612 printf("libdb is from Berkeley DB Version %d.%d.%d\n",
11613 Major, Minor, Patch) ;
11615 /* check that db.h & libdb are compatible */
11616 if (DB_VERSION_MAJOR != Major || DB_VERSION_MINOR != Minor || DB_VERSION_PATCH != Patch) {
11617 printf("db.h and libdb are incompatible\n") ;
11621 printf("db.h and libdb are compatible\n") ;
11623 Version = DB_VERSION_MAJOR * 1000000 + DB_VERSION_MINOR * 1000
11624 + DB_VERSION_PATCH ;
11626 /* needs to be >= 2.3.4 */
11627 if (Version < 2003004) {
11628 /* if (DB_VERSION_MAJOR == 2 && DB_VERSION_MINOR == 0 && DB_VERSION_PATCH < 5) { */
11629 printf("but Perl needs Berkeley DB 2.3.4 or greater\n") ;
11635 #if defined(_DB_H_) && defined(BTREEMAGIC) && defined(HASHMAGIC)
11636 printf("You have Berkeley DB Version 1\n");
11637 exit(0); /* DB version < 2: the coast is clear. */
11639 exit(1); /* <db.h> not Berkeley DB? */
11645 if eval $compile_ok && ./try; then
11646 echo 'Looks OK.' >&4
11648 echo "I can't use Berkeley DB with your <db.h>. I'll disable Berkeley DB." >&4
11652 : Remove db from list of libraries to use
11653 echo "Removing unusable -ldb from library list" >&4
11654 set `echo X $libs | $sed -e 's/-ldb / /' -e 's/-ldb$//'`
11657 echo "libs = $libs" >&4
11667 : Check the return type needed for hash
11669 echo "Checking return type needed for hash for Berkeley DB ..." >&4
11675 #include <sys/types.h>
11678 #ifndef DB_VERSION_MAJOR
11679 u_int32_t hash_cb (ptr, size)
11687 info.hash = hash_cb;
11691 if $cc $ccflags -c try.c >try.out 2>&1 ; then
11692 if $contains warning try.out >>/dev/null 2>&1 ; then
11695 db_hashtype='u_int32_t'
11698 : XXX Maybe we should just give up here.
11699 db_hashtype=u_int32_t
11701 echo "Help: I can't seem to compile the db test program." >&4
11702 echo "Something's wrong, but I'll assume you use $db_hashtype." >&4
11705 echo "Your version of Berkeley DB uses $db_hashtype for hash."
11707 *) db_hashtype=u_int32_t
11712 : Check the return type needed for prefix
11714 echo "Checking return type needed for prefix for Berkeley DB ..." >&4
11720 #include <sys/types.h>
11723 #ifndef DB_VERSION_MAJOR
11724 size_t prefix_cb (key1, key2)
11732 info.prefix = prefix_cb;
11736 if $cc $ccflags -c try.c >try.out 2>&1 ; then
11737 if $contains warning try.out >>/dev/null 2>&1 ; then
11738 db_prefixtype='int'
11740 db_prefixtype='size_t'
11743 db_prefixtype='size_t'
11744 : XXX Maybe we should just give up here.
11746 echo "Help: I can't seem to compile the db test program." >&4
11747 echo "Something's wrong, but I'll assume you use $db_prefixtype." >&4
11750 echo "Your version of Berkeley DB uses $db_prefixtype for prefix."
11752 *) db_prefixtype='size_t'
11756 : check for void type
11758 echo "Checking to see how well your C compiler groks the void type..." >&4
11759 case "$voidflags" in
11761 $cat >try.c <<'EOCP'
11767 extern void moo(); /* function returning void */
11768 void (*goo)(); /* ptr to func returning void */
11770 void *hue; /* generic ptr */
11783 int main() { sub(); }
11785 if $cc $ccflags -c -DTRY=$defvoidused try.c >.out 2>&1 ; then
11786 voidflags=$defvoidused
11787 echo "Good. It appears to support void to the level $package wants.">&4
11788 if $contains warning .out >/dev/null 2>&1; then
11789 echo "However, you might get some warnings that look like this:"
11793 echo "Hmm, your compiler has some difficulty with void. Checking further..." >&4
11794 if $cc $ccflags -c -DTRY=1 try.c >/dev/null 2>&1; then
11795 echo "It supports 1..."
11796 if $cc $ccflags -c -DTRY=3 try.c >/dev/null 2>&1; then
11797 echo "It also supports 2..."
11798 if $cc $ccflags -c -DTRY=7 try.c >/dev/null 2>&1; then
11800 echo "And it supports 4 but not 8 definitely."
11802 echo "It doesn't support 4..."
11803 if $cc $ccflags -c -DTRY=11 try.c >/dev/null 2>&1; then
11805 echo "But it supports 8."
11808 echo "Neither does it support 8."
11812 echo "It does not support 2..."
11813 if $cc $ccflags -c -DTRY=13 try.c >/dev/null 2>&1; then
11815 echo "But it supports 4 and 8."
11817 if $cc $ccflags -c -DTRY=5 try.c >/dev/null 2>&1; then
11819 echo "And it supports 4 but has not heard about 8."
11821 echo "However it supports 8 but not 4."
11826 echo "There is no support at all for void."
11831 case "$voidflags" in
11833 *) $cat >&4 <<'EOM'
11834 Support flag bits are:
11835 1: basic void declarations.
11836 2: arrays of pointers to functions returning void.
11837 4: operations between pointers to and addresses of void functions.
11838 8: generic void pointers.
11841 rp="Your void support flags add up to what?"
11849 : How can we generate normalized random numbers ?
11851 echo "Looking for a random number function..." >&4
11852 case "$randfunc" in
11854 if set drand48 val -f; eval $csym; $val; then
11856 echo "Good, found drand48()." >&4
11857 elif set random val -f; eval $csym; $val; then
11859 echo "OK, found random()." >&4
11862 echo "Yick, looks like I have to use rand()." >&4
11873 *-Dmy_rand=*|*-Dmy_srand=*)
11874 echo "Removing obsolete -Dmy_rand, -Dmy_srand, and -Drandbits from ccflags." >&4
11875 ccflags="`echo $ccflags | sed -e 's/-Dmy_rand=random/ /'`"
11876 ccflags="`echo $ccflags | sed -e 's/-Dmy_srand=srandom/ /'`"
11877 ccflags="`echo $ccflags | sed -e 's/-Drandbits=[0-9][0-9]*/ /'`"
11881 while $test "$cont"; do
11882 rp="Use which function to generate random numbers?"
11884 if $test "$ans" = "$dflt"; then
11890 if set $ans val -f; eval $csym; $val; then
11894 rp="I cannot find function $ans. Use that name anyway?"
11903 case "$randfunc" in
11905 drand01="drand48()"
11911 case "$randbits" in
11913 echo "Checking to see how many bits your $randfunc() function produces..." >&4
11915 #$i_unistd I_UNISTD
11916 #$i_stdlib I_STDLIB
11919 # include <unistd.h>
11922 # include <stdlib.h>
11927 register unsigned long tmp;
11928 register unsigned long max = 0L;
11930 for (i = 1000; i; i--) {
11931 tmp = (unsigned long) $randfunc();
11932 if (tmp > max) max = tmp;
11934 for (i = 0; max; i++)
11940 if eval $compile_ok; then
11944 echo "(I can't seem to compile the test program...)"
11951 rp="How many bits does your $randfunc() function produce?"
11955 drand01="($randfunc() / (double) ((unsigned long)1 << $randbits))"
11956 seedfunc="s$randfunc"
11957 randseedtype=unsigned
11961 rp="How many bits does your $randfunc() function produce?"
11964 seedfunc="s$randfunc"
11965 drand01="($randfunc() / (double) ((unsigned long)1 << $randbits))"
11966 if set $seedfunc val -f; eval $csym; $val; then
11967 echo "(Using $seedfunc() to seed random generator)"
11969 echo "(Warning: no $seedfunc() to seed random generator)"
11972 randseedtype=unsigned
11980 echo "Determining whether or not we are on an EBCDIC system..." >&4
11981 $cat >tebcdic.c <<'EOM'
11984 if ('M'==0xd4) return 0;
11991 if eval $compile_ok; then
11993 echo "You have EBCDIC." >&4
11996 echo "Nope, no EBCDIC, probably ASCII or some ISO Latin." >&4
11999 echo "I'm unable to compile the test program." >&4
12000 echo "I'll assume ASCII or some ISO Latin." >&4
12002 $rm -f tebcdic.c tebcdic
12008 Checking how to flush all pending stdio output...
12010 # I only know how to find the first 32 possibly open files on SunOS.
12011 # See also hints/sunos_4_1.sh and util.c --AD
12013 sunos) $echo '#define PERL_FFLUSH_ALL_FOPEN_MAX 32' > try.c ;;
12015 $cat >>try.c <<EOCP
12017 #$i_unistd I_UNISTD
12019 # include <unistd.h>
12021 #$d_sysconf HAS_SYSCONF
12022 #$d_stdio_stream_array HAS_STDIO_STREAM_ARRAY
12023 #ifdef HAS_STDIO_STREAM_ARRAY
12024 # define STDIO_STREAM_ARRAY $stdio_stream_array
12027 FILE* p = fopen("try.out", "w");
12031 # ifdef TRY_FPRINTF
12035 #ifdef TRY_FFLUSH_NULL
12038 #ifdef TRY_FFLUSH_ALL
12040 long open_max = -1;
12041 # ifdef PERL_FFLUSH_ALL_FOPEN_MAX
12042 open_max = PERL_FFLUSH_ALL_FOPEN_MAX;
12044 # if defined(HAS_SYSCONF) && defined(_SC_OPEN_MAX)
12045 open_max = sysconf(_SC_OPEN_MAX);
12048 open_max = FOPEN_MAX;
12051 open_max = OPEN_MAX;
12060 # ifdef HAS_STDIO_STREAM_ARRAY
12061 if (open_max > 0) {
12063 for (i = 0; i < open_max; i++)
12064 if (STDIO_STREAM_ARRAY[i]._file >= 0 &&
12065 STDIO_STREAM_ARRAY[i]._file < open_max &&
12066 STDIO_STREAM_ARRAY[i]._flag)
12067 fflush(&STDIO_STREAM_ARRAY[i]);
12075 : first we have to find out how _not_ to flush
12076 if $test "X$fflushNULL" = X -o "X$fflushall" = X; then
12078 set try -DTRY_FPUTC
12079 if eval $compile; then
12081 ./try$exe_ext 2>/dev/null
12082 if $test ! -s try.out -a "X$?" = X42; then
12088 set try -DTRY_FPRINTF
12090 if eval $compile; then
12092 ./try$exe_ext 2>/dev/null
12093 if $test ! -s try.out -a "X$?" = X42; then
12094 output=-DTRY_FPRINTF
12100 : check for fflush NULL behaviour
12101 case "$fflushNULL" in
12102 '') set try -DTRY_FFLUSH_NULL $output
12103 if eval $compile; then
12105 ./try$exe_ext 2>/dev/null
12107 if $test -s try.out -a "X$code" = X42; then
12108 fflushNULL="`$cat try.out`"
12110 if $test "X$code" != X42; then
12112 (If this test failed, don't worry, we'll try another method shortly.)
12117 $rm -f core try.core core.try.*
12118 case "$fflushNULL" in
12120 Your fflush(NULL) works okay.
12122 fflushNULL="$define"
12125 Your fflush(NULL) isn't working (contrary to ANSI C).
12127 fflushNULL="$undef"
12130 Cannot figure out whether your fflush(NULL) works or not.
12131 I'm assuming it doesn't (contrary to ANSI C).
12133 fflushNULL="$undef"
12137 $define|true|[yY]*)
12138 fflushNULL="$define"
12141 fflushNULL="$undef"
12144 : check explicit looping only if NULL did not work
12145 case "$fflushNULL" in
12147 : check for fflush all behaviour
12148 case "$fflushall" in
12149 '') set try -DTRY_FFLUSH_ALL $output
12150 if eval $compile; then
12152 (Now testing the other method--but note that also this may fail.)
12155 ./try$exe_ext 2>/dev/null
12156 if $test -s try.out -a "X$?" = X42; then
12157 fflushall="`$cat try.out`"
12160 $rm -f core try.core core.try.*
12161 case "$fflushall" in
12163 Whew. Flushing explicitly all the stdio streams works.
12165 fflushall="$define"
12168 Sigh. Flushing explicitly all the stdio streams doesn't work.
12173 Cannot figure out whether flushing stdio streams explicitly works or not.
12174 I'm assuming it doesn't.
12180 "$define"|true|[yY]*)
12181 fflushall="$define"
12188 *) fflushall="$undef"
12191 case "$fflushNULL$fflushall" in
12194 I cannot figure out how to flush pending stdio output.
12198 $rm -f try.* try$exe_ext
12200 : Store the full pathname to the ar program for use in the C program
12201 : Respect a hint or command line value for full_ar.
12206 : Store the full pathname to the sed program for use in the C program
12209 : see what type gids are declared as in the kernel
12211 echo "Looking for the type for group ids returned by getgid()."
12212 set gid_t gidtype xxx stdio.h sys/types.h
12216 xxx=`./findhdr sys/user.h`
12217 set `grep 'groups\[NGROUPS\];' "$xxx" 2>/dev/null` unsigned short
12219 unsigned) dflt="$1 $2" ;;
12223 *) dflt="$gidtype";;
12226 gid_t) echo "gid_t found." ;;
12227 *) rp="What is the type for group ids returned by getgid()?"
12235 *_t) zzz="$gidtype" ;;
12238 echo "Checking the size of $zzz..." >&4
12240 #include <sys/types.h>
12243 printf("%d\n", (int)sizeof($gidtype));
12248 if eval $compile_ok; then
12252 echo "(I can't execute the test program--guessing $gidsize.)" >&4
12255 echo "Your $zzz size is $gidsize bytes."
12260 echo "(I can't compile the test program--guessing $gidsize.)" >&4
12266 *_t) zzz="$gidtype" ;;
12269 echo "Checking the sign of $zzz..." >&4
12271 #include <sys/types.h>
12282 if eval $compile; then
12286 echo "(I can't execute the test program--guessing unsigned.)" >&4
12290 1) echo "Your $zzz is unsigned." ;;
12291 -1) echo "Your $zzz is signed." ;;
12297 echo "(I can't compile the test program--guessing unsigned.)" >&4
12303 if $test X"$quadtype" != X; then
12305 echo "Checking how to print 64-bit integers..." >&4
12307 if $test X"$sPRId64" = X -a X"$quadtype" = Xint; then
12308 $cat >try.c <<'EOCP'
12309 #include <sys/types.h>
12312 int q = 12345678901;
12313 printf("%ld\n", q);
12317 if eval $compile; then
12318 yyy=`./try$exe_ext`
12321 sPRId64='"d"'; sPRIi64='"i"'; sPRIu64='"u"';
12322 sPRIo64='"o"'; sPRIx64='"x"'; sPRIX64='"X"';
12323 echo "We will use %d."
12329 if $test X"$sPRId64" = X -a X"$quadtype" = Xlong; then
12330 $cat >try.c <<'EOCP'
12331 #include <sys/types.h>
12334 long q = 12345678901;
12335 printf("%ld\n", q);
12339 if eval $compile; then
12340 yyy=`./try$exe_ext`
12343 sPRId64='"ld"'; sPRIi64='"li"'; sPRIu64='"lu"';
12344 sPRIo64='"lo"'; sPRIx64='"lx"'; sPRIX64='"lX"';
12345 echo "We will use %ld."
12351 if $test X"$sPRId64" = X -a X"$i_inttypes" = X"$define" -a X"$quadtype" = Xint64_t; then
12352 $cat >try.c <<'EOCP'
12353 #include <sys/types.h>
12354 #include <inttypes.h>
12357 int64_t q = 12345678901;
12358 printf("%" PRId64 "\n", q);
12362 if eval $compile; then
12363 yyy=`./try$exe_ext`
12366 sPRId64=PRId64; sPRIi64=PRIi64; sPRIu64=PRIu64;
12367 sPRIo64=PRIo64; sPRIx64=PRIx64; sPRIX64=PRIX64;
12368 echo "We will use the C9X style."
12374 if $test X"$sPRId64" = X -a X"$quadtype" = X"long long"; then
12375 $cat >try.c <<'EOCP'
12376 #include <sys/types.h>
12379 long long q = 12345678901LL; /* AIX cc requires the LL prefix. */
12380 printf("%lld\n", q);
12384 if eval $compile; then
12385 yyy=`./try$exe_ext`
12388 sPRId64='"lld"'; sPRIi64='"lli"'; sPRIu64='"llu"';
12389 sPRIo64='"llo"'; sPRIx64='"llx"'; sPRIX64='"llX"';
12390 echo "We will use the %lld style."
12396 if $test X"$sPRId64" = X -a X"$quadtype" != X; then
12398 #include <sys/types.h>
12401 $quadtype q = 12345678901;
12402 printf("%Ld\n", q);
12406 if eval $compile; then
12407 yyy=`./try$exe_ext`
12410 sPRId64='"Ld"'; sPRIi64='"Li"'; sPRIu64='"Lu"';
12411 sPRIo64='"Lo"'; sPRIx64='"Lx"'; sPRIX64='"LX"';
12412 echo "We will use %Ld."
12418 if $test X"$sPRId64" = X -a X"$quadtype" != X; then
12420 #include <sys/types.h>
12423 $quadtype q = 12345678901;
12424 printf("%qd\n", q);
12428 if eval $compile; then
12429 yyy=`./try$exe_ext`
12432 sPRId64='"qd"'; sPRIi64='"qi"'; sPRIu64='"qu"';
12433 sPRIo64='"qo"'; sPRIx64='"qx"'; sPRIX64='"qX"';
12434 echo "We will use %qd."
12440 if $test X"$sPRId64" = X; then
12441 echo "Cannot figure out how to print 64-bit integers." >&4
12449 '') d_PRId64="$undef"; d_PRIi64="$undef"; d_PRIu64="$undef";
12450 d_PRIo64="$undef"; d_PRIx64="$undef"; d_PRIX64="$undef";
12452 *) d_PRId64="$define"; d_PRIi64="$define"; d_PRIu64="$define";
12453 d_PRIo64="$define"; d_PRIx64="$define"; d_PRIX64="$define";
12459 $echo "Checking the format strings to be used for Perl's internal types..." >&4
12461 if $test X"$ivsize" = X8; then
12462 ivdformat="$sPRId64"
12463 uvuformat="$sPRIu64"
12464 uvoformat="$sPRIo64"
12465 uvxformat="$sPRIx64"
12467 if $test X"$ivsize" = X"$longsize"; then
12473 if $test X"$ivsize" = X"$intsize"; then
12480 if $test X"$ivsize" = X"$shortsize"; then
12490 case "$ivdformat" in
12491 '') echo "$0: Fatal: failed to find format strings, cannot continue." >& 4
12498 $echo "Checking the format string to be used for gids..." >&4
12501 -1) if $test X"$gidsize" = X"$ivsize"; then
12502 gidformat="$ivdformat"
12504 if $test X"$gidsize" = X"$longsize"; then
12507 if $test X"$gidsize" = X"$intsize"; then
12510 if $test X"$gidsize" = X"$shortsize"; then
12517 *) if $test X"$gidsize" = X"$uvsize"; then
12518 gidformat="$uvuformat"
12520 if $test X"$gidsize" = X"$longsize"; then
12523 if $test X"$gidsize" = X"$intsize"; then
12526 if $test X"$gidsize" = X"$shortsize"; then
12535 : see if getgroups exists
12536 set getgroups d_getgrps
12539 : see if setgroups exists
12540 set setgroups d_setgrps
12544 : Find type of 2nd arg to 'getgroups()' and 'setgroups()'
12546 case "$d_getgrps$d_setgrps" in
12548 case "$groupstype" in
12549 '') dflt="$gidtype" ;;
12550 *) dflt="$groupstype" ;;
12553 What type of pointer is the second argument to getgroups() and setgroups()?
12554 Usually this is the same as group ids, $gidtype, but not always.
12557 rp='What type pointer is the second argument to getgroups() and setgroups()?'
12561 *) groupstype="$gidtype";;
12565 echo "Checking if your $make program sets \$(MAKE)..." >&4
12566 case "$make_set_make" in
12568 $sed 's/^X //' > testmake.mak << 'EOF'
12570 X @echo 'maketemp="$(MAKE)"'
12572 case "`$make -f testmake.mak 2>/dev/null`" in
12573 *maketemp=*) make_set_make='#' ;;
12574 *) make_set_make="MAKE=$make" ;;
12576 $rm -f testmake.mak
12579 case "$make_set_make" in
12580 '#') echo "Yup, it does.";;
12581 *) echo "Nope, it doesn't.";;
12584 : see what type is used for mode_t
12585 rp="What is the type used for file modes for system calls (e.g. fchmod())?"
12586 set mode_t modetype int stdio.h sys/types.h
12589 : define a fucntion to check prototypes
12590 $cat > protochk <<EOSH
12593 optimize="$optimize"
12595 prototype="$prototype"
12600 $cat >> protochk <<'EOSH'
12605 while test $# -ge 2; do
12607 $define) echo "#include <$2>" >> try.c ;;
12608 literal) echo "$2" >> try.c ;;
12612 test "$prototype" = "$define" && echo '#define CAN_PROTOTYPE' >> try.c
12613 cat >> try.c <<'EOCP'
12614 #ifdef CAN_PROTOTYPE
12615 #define _(args) args
12620 echo "$foo" >> try.c
12621 echo 'int no_real_function_has_this_name _((void)) { return 0; }' >> try.c
12622 $cc $optimize $ccflags -c try.c > /dev/null 2>&1
12628 $eunicefix protochk
12630 : see what type is used for size_t
12631 rp="What is the type used for the length parameter for string functions?"
12632 set size_t sizetype 'unsigned int' stdio.h sys/types.h
12635 : check for type of arguments to gethostbyaddr.
12636 if test "X$netdb_host_type" = X -o "X$netdb_hlen_type" = X; then
12637 case "$d_gethbyaddr" in
12641 Checking to see what type of arguments are accepted by gethostbyaddr().
12643 hdrs="$define sys/types.h
12644 $d_socket sys/socket.h
12645 $i_niin netinet/in.h
12647 $i_unistd unistd.h"
12648 : The first arg can 'char *' or 'void *'
12649 : The second arg is some of integral type
12650 for xxx in in_addr_t 'const void *' 'const char *' 'void *' 'char *'; do
12651 for yyy in size_t long int; do
12652 case "$netdb_host_type" in
12653 '') try="extern struct hostent *gethostbyaddr($xxx, $yyy, int);"
12654 if ./protochk "$try" $hdrs; then
12655 echo "Your system accepts $xxx for the first arg."
12656 echo "...and $yyy for the second arg."
12657 netdb_host_type="$xxx"
12658 netdb_hlen_type="$yyy"
12664 : In case none of those worked, prompt the user.
12665 case "$netdb_host_type" in
12666 '') rp='What is the type for the 1st argument to gethostbyaddr?'
12669 netdb_host_type=$ans
12670 rp='What is the type for the 2nd argument to gethostbyaddr?'
12673 netdb_hlen_type=$ans
12677 *) : no gethostbyaddr, so pick harmless defaults
12678 netdb_host_type='char *'
12679 netdb_hlen_type="$sizetype"
12682 # Remove the "const" if needed. -- but then we'll have a
12684 # netdb_host_type=`echo "$netdb_host_type" | sed 's/^const //'`
12687 : check for type of argument to gethostbyname.
12688 if test "X$netdb_name_type" = X ; then
12689 case "$d_gethbyname" in
12693 Checking to see what type of argument is accepted by gethostbyname().
12695 hdrs="$define sys/types.h
12696 $d_socket sys/socket.h
12697 $i_niin netinet/in.h
12699 $i_unistd unistd.h"
12700 for xxx in "const char *" "char *"; do
12701 case "$netdb_name_type" in
12702 '') try="extern struct hostent *gethostbyname($xxx);"
12703 if ./protochk "$try" $hdrs; then
12704 echo "Your system accepts $xxx."
12705 netdb_name_type="$xxx"
12710 : In case none of those worked, prompt the user.
12711 case "$netdb_name_type" in
12712 '') rp='What is the type for the 1st argument to gethostbyname?'
12715 netdb_name_type=$ans
12719 *) : no gethostbyname, so pick harmless default
12720 netdb_name_type='char *'
12725 : check for type of 1st argument to getnetbyaddr.
12726 if test "X$netdb_net_type" = X ; then
12727 case "$d_getnbyaddr" in
12731 Checking to see what type of 1st argument is accepted by getnetbyaddr().
12733 hdrs="$define sys/types.h
12734 $d_socket sys/socket.h
12735 $i_niin netinet/in.h
12737 $i_unistd unistd.h"
12738 for xxx in in_addr_t "unsigned long" long "unsigned int" int; do
12739 case "$netdb_net_type" in
12740 '') try="extern struct netent *getnetbyaddr($xxx, int);"
12741 if ./protochk "$try" $hdrs; then
12742 echo "Your system accepts $xxx."
12743 netdb_net_type="$xxx"
12748 : In case none of those worked, prompt the user.
12749 case "$netdb_net_type" in
12750 '') rp='What is the type for the 1st argument to getnetbyaddr?'
12753 netdb_net_type=$ans
12757 *) : no getnetbyaddr, so pick harmless default
12758 netdb_net_type='long'
12762 : locate the preferred pager for this system
12776 '') dflt=/usr/ucb/more;;
12783 rp='What pager is used on your system?'
12787 : see what type pids are declared as in the kernel
12788 rp="What is the type of process ids on this system?"
12789 set pid_t pidtype int stdio.h sys/types.h
12792 : check for length of pointer
12796 $echo $n "Checking to see how big your pointers are...$c" >&4
12797 if test "$voidflags" -gt 7; then
12798 echo '#define VOID_PTR char *' > try.c
12800 echo '#define VOID_PTR void *' > try.c
12802 $cat >>try.c <<'EOCP'
12806 printf("%d\n", (int)sizeof(VOID_PTR));
12811 if eval $compile_ok; then
12813 $echo " $ptrsize bytes." >&4
12816 echo "(I can't seem to compile the test program. Guessing...)" >&4
12817 rp="What is the size of a pointer (in bytes)?"
12825 : see if ar generates random libraries by itself
12827 echo "Checking how to generate random libraries on your machine..." >&4
12828 echo 'int bar1() { return bar2(); }' > bar1.c
12829 echo 'int bar2() { return 2; }' > bar2.c
12830 $cat > foo.c <<'EOP'
12831 int main() { printf("%d\n", bar1()); exit(0); }
12833 $cc $ccflags -c bar1.c >/dev/null 2>&1
12834 $cc $ccflags -c bar2.c >/dev/null 2>&1
12835 $cc $ccflags -c foo.c >/dev/null 2>&1
12836 $ar rc bar$_a bar2$_o bar1$_o >/dev/null 2>&1
12837 if $cc $ccflags $ldflags -o foobar foo$_o bar$_a $libs > /dev/null 2>&1 &&
12838 ./foobar >/dev/null 2>&1; then
12839 echo "$ar appears to generate random libraries itself."
12842 elif $ar ts bar$_a >/dev/null 2>&1 &&
12843 $cc $ccflags $ldflags -o foobar foo$_o bar$_a $libs > /dev/null 2>&1 &&
12844 ./foobar >/dev/null 2>&1; then
12845 echo "a table of contents needs to be added with '$ar ts'."
12852 ranlib=`./loc ranlib X /usr/bin /bin /usr/local/bin`
12853 $test -f $ranlib || ranlib=''
12856 if $test -n "$ranlib"; then
12857 echo "your system has '$ranlib'; we'll use that."
12860 echo "your system doesn't seem to support random libraries"
12861 echo "so we'll use lorder and tsort to order the libraries."
12868 : check for type of arguments to select.
12869 case "$selecttype" in
12870 '') case "$d_select" in
12874 Checking to see what type of arguments are accepted by select().
12876 hdrs="$define sys/types.h
12877 $i_systime sys/time.h
12878 $i_sysselct sys/select.h
12879 $d_socket sys/socket.h"
12880 : The first arg can be int, unsigned, or size_t
12881 : The last arg may or may not be 'const'
12883 : void pointer has been seen but using that
12884 : breaks the selectminbits test
12885 for xxx in 'fd_set *' 'int *'; do
12886 for nfd in 'int' 'size_t' 'unsigned long' 'unsigned' ; do
12887 for tmo in 'struct timeval *' 'const struct timeval *'; do
12889 '') try="extern select _(($nfd, $xxx, $xxx, $xxx, $tmo));"
12890 if ./protochk "$try" $hdrs; then
12891 echo "Your system accepts $xxx."
12900 '') rp='What is the type for the 2nd, 3rd, and 4th arguments to select?'
12901 case "$d_fd_set" in
12902 $define) dflt="fd_set *" ;;
12911 *) : no select, so pick a harmless default
12918 : check for the select 'width'
12919 case "$selectminbits" in
12920 '') case "$d_select" in
12924 Checking to see on how many bits at a time your select() operates...
12927 #include <sys/types.h>
12929 #$i_systime I_SYS_TIME
12930 #$i_systimek I_SYS_TIME_KERNEL
12935 # ifdef I_SYS_TIME_KERNEL
12938 # include <sys/time.h>
12939 # ifdef I_SYS_TIME_KERNEL
12943 #$i_sysselct I_SYS_SELECT
12944 #ifdef I_SYS_SELECT
12945 #include <sys/select.h>
12947 #$d_socket HAS_SOCKET
12949 # include <sys/socket.h> /* Might include <sys/bsdtypes.h> */
12953 #define S sizeof(*(b))
12955 #define NBYTES (S * 8 > MINBITS ? S : MINBITS/8)
12956 #define NBITS (NBYTES * 8)
12965 fp = fopen("try.c", "r");
12971 b = ($selecttype)s;
12972 for (i = 0; i < NBITS; i++)
12976 select(fd + 1, b, 0, 0, &t);
12977 for (i = NBITS - 1; i > fd && FD_ISSET(i, b); i--);
12978 printf("%d\n", i + 1);
12983 if eval $compile_ok; then
12984 selectminbits=`./try`
12985 case "$selectminbits" in
12987 Cannot figure out on how many bits at a time your select() operates.
12988 I'll play safe and guess it is 32 bits.
12994 *) bits="$selectminbits bits" ;;
12996 echo "Your select() operates on $bits at a time." >&4
12998 rp='What is the minimum number of bits your select() operates on?'
12999 case "$byteorder" in
13000 1234|12345678) dflt=32 ;;
13005 selectminbits="$val"
13009 *) : no select, so pick a harmless default
13016 : Trace out the files included by signal.h, then look for SIGxxx names.
13017 : Remove SIGARRAYSIZE used by HPUX.
13018 : Remove SIGSTKSIZE used by Linux.
13019 : Remove SIGSTKSZ used by Posix.
13020 : Remove SIGTYP void lines used by OS2.
13021 : Some cpps, like os390, dont give the file name anywhere
13022 if [ "X$fieldn" = X ]; then
13023 : Just make some guesses. We check them later.
13024 xxx='/usr/include/signal.h /usr/include/sys/signal.h'
13026 xxx=`echo '#include <signal.h>' |
13027 $cppstdin $cppminus $cppflags 2>/dev/null |
13028 $grep '^[ ]*#.*include' |
13029 $awk "{print \\$$fieldn}" | $sed 's!"!!g' | $sort | $uniq`
13031 : Check this list of files to be sure we have parsed the cpp output ok.
13032 : This will also avoid potentially non-existent files, such
13035 for xx in $xxx /dev/null ; do
13036 $test -f "$xx" && xxxfiles="$xxxfiles $xx"
13038 : If we have found no files, at least try signal.h
13039 case "$xxxfiles" in
13040 '') xxxfiles=`./findhdr signal.h` ;;
13043 $1 ~ /^#define$/ && $2 ~ /^SIG[A-Z0-9]*$/ && $2 !~ /SIGARRAYSIZE/ && $2 !~ /SIGSTKSIZE/ && $2 !~ /SIGSTKSZ/ && $3 !~ /void/ {
13044 print substr($2, 4, 20)
13046 $1 == "#" && $2 ~ /^define$/ && $3 ~ /^SIG[A-Z0-9]*$/ && $3 !~ /SIGARRAYSIZE/ && $4 !~ /void/ {
13047 print substr($3, 4, 20)
13049 : Append some common names just in case the awk scan failed.
13050 xxx="$xxx ABRT ALRM BUS CANCEL CHLD CLD CONT DIL EMT FPE"
13051 xxx="$xxx FREEZE HUP ILL INT IO IOT KILL LOST LWP PHONE"
13052 xxx="$xxx PIPE POLL PROF PWR QUIT RTMAX RTMIN SEGV STKFLT STOP"
13053 xxx="$xxx SYS TERM THAW TRAP TSTP TTIN TTOU URG USR1 USR2"
13054 xxx="$xxx USR3 USR4 VTALRM WAITING WINCH WIND WINDOW XCPU XFSZ"
13056 : generate a few handy files for later
13057 $cat > signal.c <<'EOCP'
13058 #include <sys/types.h>
13059 #include <signal.h>
13063 /* Strange style to avoid deeply-nested #if/#else/#endif */
13066 # define NSIG (_NSIG)
13072 # define NSIG (SIGMAX+1)
13078 # define NSIG (SIG_MAX+1)
13084 # define NSIG (MAXSIG+1)
13090 # define NSIG (MAX_SIG+1)
13095 # ifdef SIGARRAYSIZE
13096 # define NSIG (SIGARRAYSIZE+1) /* Not sure of the +1 */
13102 # define NSIG (_sys_nsig) /* Solaris 2.5 */
13106 /* Default to some arbitrary number that's big enough to get most
13107 of the common signals.
13113 printf("NSIG %d\n", NSIG);
13119 echo $xxx | $tr ' ' $trnl | $sort | $uniq | $awk '
13121 printf "#ifdef SIG"; printf $1; printf "\n"
13122 printf "printf(\""; printf $1; printf " %%d\\n\",SIG";
13123 printf $1; printf ");\n"
13127 printf "#endif /* JUST_NSIG */\n";
13128 printf "exit(0);\n}\n";
13131 $cat >signal.awk <<'EOP'
13132 BEGIN { ndups = 0 }
13133 $1 ~ /^NSIG$/ { nsig = $2 }
13134 ($1 !~ /^NSIG$/) && (NF == 2) {
13135 if ($2 > maxsig) { maxsig = $2 }
13136 if (sig_name[$2]) {
13137 dup_name[ndups] = $1
13138 dup_num[ndups] = $2
13150 printf("NSIG %d\n", nsig);
13151 for (n = 1; n < nsig; n++) {
13153 printf("%s %d\n", sig_name[n], sig_num[n])
13156 printf("NUM%d %d\n", n, n)
13159 for (n = 0; n < ndups; n++) {
13160 printf("%s %d\n", dup_name[n], dup_num[n])
13164 $cat >signal_cmd <<EOS
13166 if $test -s signal.lst; then
13167 echo "Using your existing signal.lst file"
13172 $cat >>signal_cmd <<'EOS'
13175 if eval $compile_ok; then
13176 ./signal$_exe | $sort -n +1 | $uniq | $awk -f signal.awk >signal.lst
13178 echo "(I can't seem be able to compile the whole test program)" >&4
13179 echo "(I'll try it in little pieces.)" >&4
13180 set signal -DJUST_NSIG
13181 if eval $compile_ok; then
13182 ./signal$_exe > signal.nsg
13185 echo "I can't seem to figure out how many signals you have." >&4
13186 echo "Guessing 50." >&4
13187 echo 'NSIG 50' > signal.nsg
13189 : Now look at all the signal names, one at a time.
13190 for xx in `echo $xxx | $tr ' ' $trnl | $sort | $uniq`; do
13191 $cat > signal.c <<EOCP
13192 #include <sys/types.h>
13193 #include <signal.h>
13196 printf("$xx %d\n", SIG${xx});
13201 if eval $compile; then
13202 echo "SIG${xx} found."
13203 ./signal$_exe >> signal.ls1
13205 echo "SIG${xx} NOT found."
13208 if $test -s signal.ls1; then
13209 $cat signal.nsg signal.ls1 |
13210 $sort -n +1 | $uniq | $awk -f signal.awk >signal.lst
13214 if $test -s signal.lst; then
13217 echo "(AAK! I can't compile the test programs -- Guessing)" >&4
13218 echo 'kill -l' >signal
13219 set X `csh -f <signal`
13223 0) set HUP INT QUIT ILL TRAP ABRT EMT FPE KILL BUS SEGV SYS PIPE ALRM TERM;;
13225 echo $@ | $tr ' ' $trnl | \
13226 $awk '{ printf "%s %d\n", $1, ++s; }
13227 END { printf "NSIG %d\n", ++s }' >signal.lst
13229 $rm -f signal.c signal$_exe signal$_o signal.nsg signal.ls1
13231 chmod a+x signal_cmd
13232 $eunicefix signal_cmd
13234 : generate list of signal names
13236 case "$sig_name_init" in
13238 *) case "$sig_num_init" in
13239 ''|*,*) doinit=yes ;;
13244 echo "Generating a list of signal names and numbers..." >&4
13246 sig_count=`$awk '/^NSIG/ { printf "%d", $2 }' signal.lst`
13247 sig_name=`$awk 'BEGIN { printf "ZERO " }
13248 !/^NSIG/ { printf "%s ", $1 }' signal.lst`
13249 sig_num=`$awk 'BEGIN { printf "0 " }
13250 !/^NSIG/ { printf "%d ", $2 }' signal.lst`
13251 sig_name_init=`$awk 'BEGIN { printf "\"ZERO\", " }
13252 !/^NSIG/ { printf "\"%s\", ", $1 }
13253 END { printf "0\n" }' signal.lst`
13254 sig_num_init=`$awk 'BEGIN { printf "0, " }
13255 !/^NSIG/ { printf "%d, ", $2}
13256 END { printf "0\n"}' signal.lst`
13259 echo "The following $sig_count signals are available:"
13261 echo $sig_name | $awk \
13262 'BEGIN { linelen = 0 }
13264 for (i = 1; i <= NF; i++) {
13265 name = "SIG" $i " "
13266 linelen = linelen + length(name)
13267 if (linelen > 70) {
13269 linelen = length(name)
13275 $rm -f signal signal.c signal.awk signal.lst signal_cmd
13277 : see what type is used for signed size_t
13278 set ssize_t ssizetype int stdio.h sys/types.h
13281 $cat > ssize.c <<EOM
13283 #include <sys/types.h>
13284 #define Size_t $sizetype
13285 #define SSize_t $dflt
13288 if (sizeof(Size_t) == sizeof(SSize_t))
13290 else if (sizeof(Size_t) == sizeof(int))
13299 if eval $compile_ok && ./ssize > /dev/null; then
13300 ssizetype=`./ssize`
13301 echo "I'll be using $ssizetype for functions returning a byte count." >&4
13304 Help! I can't compile and run the ssize_t test program: please enlighten me!
13305 (This is probably a misconfiguration in your system or libraries, and
13306 you really ought to fix it. Still, I'll try anyway.)
13308 I need a type that is the same size as $sizetype, but is guaranteed to
13309 be signed. Common values are ssize_t, int and long.
13312 rp="What signed type is the same size as $sizetype?"
13316 $rm -f ssize ssize.*
13318 : see what type of char stdio uses.
13320 if $contains 'unsigned.*char.*_ptr;' `./findhdr stdio.h` >/dev/null 2>&1 ; then
13321 echo "Your stdio uses unsigned chars." >&4
13322 stdchar="unsigned char"
13324 echo "Your stdio uses signed chars." >&4
13328 : see if time exists
13330 if test "X$d_time" = X -o X"$timetype" = X; then
13331 if set time val -f d_time; eval $csym; $val; then
13332 echo 'time() found.' >&4
13334 rp="What is the type returned by time() on this system?"
13335 set time_t timetype long stdio.h sys/types.h
13338 echo 'time() not found, hope that will do.' >&4
13346 : see what type uids are declared as in the kernel
13348 echo "Looking for the type for user ids returned by getuid()."
13349 set uid_t uidtype xxx stdio.h sys/types.h
13353 xxx=`./findhdr sys/user.h`
13354 set `grep '_ruid;' "$xxx" 2>/dev/null` unsigned short
13356 unsigned) dflt="$1 $2" ;;
13360 *) dflt="$uidtype";;
13363 uid_t) echo "uid_t found." ;;
13364 *) rp="What is the type for user ids returned by getuid()?"
13372 *_t) zzz="$uidtype" ;;
13375 echo "Checking the size of $zzz..." >&4
13377 #include <sys/types.h>
13380 printf("%d\n", (int)sizeof($uidtype));
13385 if eval $compile_ok; then
13389 echo "(I can't execute the test program--guessing $uidsize.)" >&4
13392 echo "Your $zzz size is $uidsize bytes."
13397 echo "(I can't compile the test program--guessing $uidsize.)" >&4
13402 *_t) zzz="$uidtype" ;;
13405 echo "Checking the sign of $zzz..." >&4
13407 #include <sys/types.h>
13418 if eval $compile; then
13422 echo "(I can't execute the test program--guessing unsigned.)" >&4
13426 1) echo "Your $zzz is unsigned." ;;
13427 -1) echo "Your $zzz is signed." ;;
13433 echo "(I can't compile the test program--guessing unsigned.)" >&4
13439 $echo "Checking the format string to be used for uids..." >&4
13442 -1) if $test X"$uidsize" = X"$ivsize"; then
13443 uidformat="$ivdformat"
13445 if $test X"$uidsize" = X"$longsize"; then
13448 if $test X"$uidsize" = X"$intsize"; then
13451 if $test X"$uidsize" = X"$shortsize"; then
13458 *) if $test X"$uidsize" = X"$uvsize"; then
13459 uidformat="$uvuformat"
13461 if $test X"$uidsize" = X"$longsize"; then
13464 if $test X"$uidsize" = X"$intsize"; then
13467 if $test X"$uidsize" = X"$shortsize"; then
13476 : see if dbm.h is available
13477 : see if dbmclose exists
13478 set dbmclose d_dbmclose
13481 case "$d_dbmclose" in
13491 *) set rpcsvc/dbm.h i_rpcsvcdbm
13496 *) echo "We won't be including <dbm.h>"
13506 : see if this is a sys/file.h system
13511 : do we need to include sys/file.h ?
13515 if $h_sysfile; then
13517 echo "We'll be including <sys/file.h>." >&4
13520 echo "We won't be including <sys/file.h>." >&4
13530 : see if fcntl.h is there
13535 : see if we can include fcntl.h
13541 echo "We'll be including <fcntl.h>." >&4
13544 if $h_sysfile; then
13545 echo "We don't need to include <fcntl.h> if we include <sys/file.h>." >&4
13547 echo "We won't be including <fcntl.h>." >&4
13559 : see if locale.h is available
13560 set locale.h i_locale
13563 : see if mach cthreads are available
13564 if test "X$usethreads" = "X$define"; then
13565 set mach/cthreads.h i_machcthr
13568 i_machcthr="$undef"
13573 : see if this is a math.h system
13577 : see if this is a mntent.h system
13578 set mntent.h i_mntent
13581 : see if ndbm.h is available
13586 : see if dbm_open exists
13587 set dbm_open d_dbm_open
13589 case "$d_dbm_open" in
13592 echo "We won't be including <ndbm.h>"
13601 : see if net/errno.h is available
13603 set net/errno.h val
13606 : Unfortunately, it causes problems on some systems. Arrgh.
13609 cat > try.c <<'EOM'
13612 #include <net/errno.h>
13618 if $cc $ccflags -c try.c >/dev/null 2>&1; then
13619 echo "We'll be including <net/errno.h>." >&4
13621 echo "We won't be including <net/errno.h>." >&4
13630 : see if netinet/tcp.h is available
13631 set netinet/tcp.h i_netinettcp
13634 : see if this is a poll.h system
13639 $echo "Guessing which symbols your C compiler and preprocessor define..." >&4
13640 $cat <<'EOSH' > Cppsym.know
13641 a29k ABI64 aegis AES_SOURCE AIX AIX32 AIX370
13642 AIX41 AIX42 AIX43 AIX_SOURCE aixpc ALL_SOURCE
13643 alliant alpha am29000 AM29000 amiga AMIGAOS AMIX
13644 ansi ANSI_C_SOURCE apollo ardent atarist att386 att3b BeOS
13645 BIG_ENDIAN BIT_MSF bsd BSD bsd43 bsd4_2 bsd4_3 BSD4_3 bsd4_4
13646 BSD_4_3 BSD_4_4 BSD_NET2 BSD_TIME BSD_TYPES BSDCOMPAT bsdi
13647 bull c cadmus clipper CMU COFF COMPILER_VERSION
13648 concurrent convex cpu cray CRAY CRAYMPP ctix CX_UX
13649 CYGWIN DGUX DGUX_SOURCE DJGPP dmert DOLPHIN DPX2 DSO
13650 Dynix DynixPTX ELF encore EPI EXTENSIONS FILE_OFFSET_BITS
13651 FreeBSD GCC_NEW_VARARGS gcos gcx gimpel
13652 GNU_SOURCE GNUC GNUC_MINOR GO32 gould GOULD_PN
13653 H3050R H3050RX hbullx20 hcx host_mips
13654 hp200 hp300 hp700 HP700 hp800 hp9000
13655 hp9000s200 hp9000s300 hp9000s400 hp9000s500
13656 hp9000s700 hp9000s800 hp9k8 hp_osf hppa hpux HPUX_SOURCE
13657 i186 i286 i386 i486 i586 i686 i8086 i80960 i860 I960
13658 iAPX286 ibm ibm032 ibmesa IBMR2 ibmrt ILP32 ILP64
13659 INLINE_INTRINSICS INTRINSICS INT64 interdata is68k ksr1
13660 LANGUAGE_C LARGE_FILE_API LARGEFILE64_SOURCE
13661 LARGEFILE_SOURCE LFS64_LARGEFILE LFS_LARGEFILE
13662 Linux LITTLE_ENDIAN LONG64 LONG_DOUBLE LONG_LONG
13663 LONGDOUBLE LONGLONG LP64 luna luna88k Lynx
13664 M68000 m68k m88100 m88k M88KBCS_TARGET M_COFF
13665 M_I186 M_I286 M_I386 M_I8086 M_I86 M_I86SM M_SYS3
13666 M_SYS5 M_SYSIII M_SYSV M_UNIX M_XENIX MACH machine MachTen
13667 MATH_HAS_NO_SIDE_EFFECTS
13668 mc300 mc500 mc68000 mc68010 mc68020 mc68030 mc68040
13669 mc68060 mc68k mc68k32 mc700 mc88000 mc88100 merlin
13670 mert MiNT mips MIPS_FPSET MIPS_ISA MIPS_SIM MIPS_SZINT
13671 MIPS_SZLONG MIPS_SZPTR MIPSEB MIPSEL MODERN_C motorola
13672 mpeix MSDOS MTXINU MULTIMAX mvs MVS n16 ncl_el ncl_mr
13673 NetBSD news1500 news1700 news1800 news1900 news3700
13674 news700 news800 news900 NeXT NLS ns16000 ns32000
13675 ns32016 ns32332 ns32k nsc32000
13676 OCS88 OEMVS OpenBSD os OS2 OS390 osf OSF1 OSF_SOURCE
13677 pa_risc PA_RISC1_1 PA_RISC2_0 PARAGON parisc
13678 pc532 pdp11 PGC PIC plexus PORTAR posix
13679 POSIX1B_SOURCE POSIX2_SOURCE POSIX4_SOURCE
13680 POSIX_C_SOURCE POSIX_SOURCE POWER
13681 PROTOTYPES PWB pyr QNX R3000 REENTRANT RES Rhapsody RISC6000
13682 riscix riscos RT scs SCO sequent sgi SGI_SOURCE sinix
13683 SIZE_INT SIZE_LONG SIZE_PTR SOCKET_SOURCE SOCKETS_SOURCE
13684 sony sony_news sonyrisc sparc sparclite spectrum
13685 stardent stdc STDC_EXT stratos sun sun3 sun386
13686 Sun386i svr3 svr4 SVR4_2 SVR4_SOURCE svr5
13687 SX system SYSTYPE_BSD SYSTYPE_BSD43 SYSTYPE_BSD44
13688 SYSTYPE_SVR4 SYSTYPE_SVR5 SYSTYPE_SYSV SYSV SYSV3 SYSV4 SYSV5
13689 sysV68 sysV88 Tek4132 Tek4300 titan
13690 tower tower32 tower32_200 tower32_600 tower32_700
13691 tower32_800 tower32_850 tss
13692 u370 u3b u3b2 u3b20 u3b200 u3b20d u3b5
13693 ultrix UMAXV UnicomPBB UnicomPBD UNICOS UNICOSMK
13694 unix UNIX95 UNIX99 unixpc unos USGr4 USGr4_2
13695 Utek UTek UTS UWIN uxpm uxps vax venix VMESA vms xenix Xenix286
13696 XOPEN_SOURCE XOPEN_SOURCE_EXTENDED XPG2 XPG2_EXTENDED
13697 XPG3 XPG3_EXTENDED XPG4 XPG4_EXTENDED
13700 # Maybe put other stuff here too.
13701 cat <<EOSH >>Cppsym.know
13704 ./tr '[a-z]' '[A-Z]' < Cppsym.know > Cppsym.a
13705 ./tr '[A-Z]' '[a-z]' < Cppsym.know > Cppsym.b
13706 $cat Cppsym.a Cppsym.b | $tr ' ' $trnl | sort | uniq > Cppsym.know
13707 $rm -f Cppsym.a Cppsym.b
13708 cat <<EOSH > Cppsym
13710 if $test \$# -gt 0; then
13711 echo \$* | $tr " " "$trnl" | ./Cppsym.try > Cppsym.got
13713 $tr " " "$trnl" | ./Cppsym.try > Cppsym.got
13715 $test -s Cppsym.got && exit 0
13720 cat <<EOSH > Cppsym.try
13721 cat <<'EOCP' > try.c
13727 cat <<'EOSH' >> Cppsym.try
13729 printf "#ifdef %s\nprintf(\"%s\\n\");\n#endif\n", $1, $1
13730 printf "#ifdef _%s\nprintf(\"_%s\\n\");\n#endif\n", $1, $1
13731 printf "#ifdef __%s\nprintf(\"__%s\\n\");\n#endif\n", $1, $1
13732 printf "#ifdef __%s__\nprintf(\"__%s__\\n\");\n#endif\n", $1, $1 }' \
13736 cat <<'EOSH' >> Cppsym.try
13738 eval $compile_ok && ./try$exe_ext
13740 chmod +x Cppsym.try
13741 $eunicefix Cppsym.try
13742 ./Cppsym < Cppsym.know > Cppsym.true
13743 : now check the C compiler for additional symbols
13744 postprocess_cc_v=''
13746 aix) postprocess_cc_v="|$tr , ' '" ;;
13753 for i in \`$cc -v -c tmp.c 2>&1 $postprocess_cc_v\`
13756 -D*) echo "\$i" | $sed 's/^-D//';;
13757 -A*) $test "$gccversion" && echo "\$i" | $sed 's/^-A\(.*\)(\(.*\))/\1=\2/';;
13762 postprocess_cc_v=''
13765 ./ccsym > ccsym1.raw
13766 if $test -s ccsym1.raw; then
13767 $sort ccsym1.raw | $uniq >ccsym.raw
13769 mv ccsym1.raw ccsym.raw
13772 $awk '/\=/ { print $0; next }
13773 { print $0"=1" }' ccsym.raw >ccsym.list
13774 $awk '{ print $0"=1" }' Cppsym.true >ccsym.true
13775 $comm -13 ccsym.true ccsym.list >ccsym.own
13776 $comm -12 ccsym.true ccsym.list >ccsym.com
13777 $comm -23 ccsym.true ccsym.list >ccsym.cpp
13779 if $test -z ccsym.raw; then
13780 echo "Your C compiler doesn't seem to define any symbols!" >&4
13782 echo "However, your C preprocessor defines the following symbols:"
13785 cppsymbols=`$cat Cppsym.true`
13786 cppsymbols=`echo $cppsymbols`
13787 cppccsymbols="$cppsymbols"
13789 if $test -s ccsym.com; then
13790 echo "Your C compiler and pre-processor define these symbols:"
13791 $sed -e 's/\(.*\)=.*/\1/' ccsym.com
13794 cppccsymbols=`$cat ccsym.com`
13795 cppccsymbols=`echo $cppccsymbols`
13796 $test "$silent" || sleep 1
13798 if $test -s ccsym.cpp; then
13799 $test "$also" && echo " "
13800 echo "Your C pre-processor ${also}defines the following symbols:"
13801 $sed -e 's/\(.*\)=.*/\1/' ccsym.cpp
13803 cppsymbols=`$cat ccsym.cpp`
13804 cppsymbols=`echo $cppsymbols`
13805 $test "$silent" || sleep 1
13807 if $test -s ccsym.own; then
13808 $test "$also" && echo " "
13809 echo "Your C compiler ${also}defines the following cpp symbols:"
13810 $sed -e 's/\(.*\)=1/\1/' ccsym.own
13811 $sed -e 's/\(.*\)=.*/\1/' ccsym.own | $uniq >>Cppsym.true
13812 ccsymbols=`$cat ccsym.own`
13813 ccsymbols=`echo $ccsymbols`
13814 $test "$silent" || sleep 1
13819 : see if this is a termio system
13823 if $test `./findhdr termios.h`; then
13824 set tcsetattr i_termios
13830 "$define") echo "You have POSIX termios.h... good!" >&4;;
13831 *) if ./Cppsym pyr; then
13832 case "`/bin/universe`" in
13833 ucb) if $test `./findhdr sgtty.h`; then
13835 echo "<sgtty.h> found." >&4
13837 echo "System is pyramid with BSD universe."
13838 echo "<sgtty.h> not found--you could have problems." >&4
13840 *) if $test `./findhdr termio.h`; then
13842 echo "<termio.h> found." >&4
13844 echo "System is pyramid with USG universe."
13845 echo "<termio.h> not found--you could have problems." >&4
13849 if $test `./findhdr termio.h`; then
13850 echo "<termio.h> found." >&4
13852 elif $test `./findhdr sgtty.h`; then
13853 echo "<sgtty.h> found." >&4
13856 echo "Neither <termio.h> nor <sgtty.h> found--you could have problems." >&4
13859 if $test `./findhdr sgtty.h`; then
13860 echo "<sgtty.h> found." >&4
13862 elif $test `./findhdr termio.h`; then
13863 echo "<termio.h> found." >&4
13866 echo "Neither <sgtty.h> nor <termio.h> found--you could have problems." >&4
13870 set i_termio; eval $setvar
13871 val=$val2; set i_sgtty; eval $setvar
13872 val=$val3; set i_termios; eval $setvar
13874 : see if this is a shadow.h system
13875 set shadow.h i_shadow
13878 : see if this is a socks.h system
13879 set socks.h i_socks
13882 : see if stdarg is available
13884 if $test `./findhdr stdarg.h`; then
13885 echo "<stdarg.h> found." >&4
13888 echo "<stdarg.h> NOT found." >&4
13892 : see if varags is available
13894 if $test `./findhdr varargs.h`; then
13895 echo "<varargs.h> found." >&4
13897 echo "<varargs.h> NOT found, but that's ok (I hope)." >&4
13900 : set up the varargs testing programs
13901 $cat > varargs.c <<EOP
13903 #include <stdarg.h>
13906 #include <varargs.h>
13910 int f(char *p, ...)
13924 p = va_arg(ap, char *);
13929 $cat > varargs <<EOP
13931 if $cc -c $ccflags -D\$1 varargs.c >/dev/null 2>&1; then
13940 : now check which varargs header should be included
13945 if `./varargs I_STDARG`; then
13947 elif `./varargs I_VARARGS`; then
13952 if `./varargs I_VARARGS`; then
13959 echo "I could not find the definition for va_dcl... You have problems..." >&4
13960 val="$undef"; set i_stdarg; eval $setvar
13961 val="$undef"; set i_varargs; eval $setvar
13966 case "$i_varhdr" in
13968 val="$define"; set i_stdarg; eval $setvar
13969 val="$undef"; set i_varargs; eval $setvar
13972 val="$undef"; set i_stdarg; eval $setvar
13973 val="$define"; set i_varargs; eval $setvar
13976 echo "We'll include <$i_varhdr> to get va_dcl definition." >&4;;
13980 : see if stddef is available
13981 set stddef.h i_stddef
13984 : see if sys/access.h is available
13985 set sys/access.h i_sysaccess
13988 : see if ioctl defs are in sgtty, termio, sys/filio or sys/ioctl
13989 set sys/filio.h i_sysfilio
13992 if $test `./findhdr sys/ioctl.h`; then
13994 echo '<sys/ioctl.h> found.' >&4
13997 if $test $i_sysfilio = "$define"; then
13998 echo '<sys/ioctl.h> NOT found.' >&4
14000 $test $i_sgtty = "$define" && xxx="sgtty.h"
14001 $test $i_termio = "$define" && xxx="termio.h"
14002 $test $i_termios = "$define" && xxx="termios.h"
14003 echo "No <sys/ioctl.h> found, assuming ioctl args are defined in <$xxx>." >&4
14009 : see if sys/resource.h has to be included
14010 set sys/resource.h i_sysresrc
14013 : see if sys/security.h is available
14014 set sys/security.h i_syssecrt
14017 : see if this is a sys/statvfs.h system
14018 set sys/statvfs.h i_sysstatvfs
14021 : see if this is a sys/uio.h system
14022 set sys/uio.h i_sysuio
14025 : see if this is a sys/un.h system
14026 set sys/un.h i_sysun
14029 : see if this is a syswait system
14030 set sys/wait.h i_syswait
14033 : see if this is a ustat.h system
14034 set ustat.h i_ustat
14037 : see if this is an utime system
14038 set utime.h i_utime
14041 : see if this is a values.h system
14042 set values.h i_values
14045 : see if this is a vfork system
14048 set vfork.h i_vfork
14056 : see if gdbm.h is available
14061 : see if gdbm_open exists
14062 set gdbm_open d_gdbm_open
14064 case "$d_gdbm_open" in
14067 echo "We won't be including <gdbm.h>"
14077 echo "Looking for extensions..." >&4
14078 : If we are using the old config.sh, known_extensions may contain
14079 : old or inaccurate or duplicate values.
14080 known_extensions=''
14081 nonxs_extensions=''
14082 : We do not use find because it might not be available.
14083 : We do not just use MANIFEST because the user may have dropped
14084 : some additional extensions into the source tree and expect them
14087 : Function to recursively find available extensions, ignoring DynaLoader
14088 : NOTE: recursion limit of 10 to prevent runaway in case of symlink madness
14092 DynaLoader|dynaload) ;;
14094 if $test -f $xxx/$xxx.xs; then
14095 known_extensions="$known_extensions $1$xxx";
14096 elif $test -f $xxx/Makefile.PL; then
14097 nonxs_extensions="$nonxs_extensions $1$xxx";
14099 if $test -d $xxx -a $# -lt 10; then
14102 eval $find_extensions;
14114 eval $find_extensions
14115 set X $nonxs_extensions
14117 nonxs_extensions="$*"
14118 set X $known_extensions
14120 known_extensions="$*"
14123 : Now see which are supported on this system.
14125 for xxx in $known_extensions ; do
14129 $define) avail_ext="$avail_ext $xxx" ;;
14132 GDBM_File|gdbm_fil)
14134 $define) avail_ext="$avail_ext $xxx" ;;
14137 NDBM_File|ndbm_fil)
14139 $define) avail_ext="$avail_ext $xxx" ;;
14142 ODBM_File|odbm_fil)
14143 case "${i_dbm}${i_rpcsvcdbm}" in
14144 *"${define}"*) avail_ext="$avail_ext $xxx" ;;
14148 case "$useposix" in
14149 true|define|y) avail_ext="$avail_ext $xxx" ;;
14153 case "$useopcode" in
14154 true|define|y) avail_ext="$avail_ext $xxx" ;;
14158 case "$d_socket" in
14159 true|$define|y) avail_ext="$avail_ext $xxx" ;;
14163 case "$usethreads" in
14164 true|$define|y) avail_ext="$avail_ext $xxx" ;;
14168 : XXX Do we need a useipcsysv variable here
14169 case "${d_msg}${d_sem}${d_shm}" in
14170 *"${define}"*) avail_ext="$avail_ext $xxx" ;;
14173 *) avail_ext="$avail_ext $xxx"
14182 : Now see which nonxs extensions are supported on this system.
14183 : For now assume all are.
14185 for xxx in $nonxs_extensions ; do
14187 *) nonxs_ext="$nonxs_ext $xxx"
14199 A number of extensions are supplied with $package. You may choose to
14200 compile these extensions for dynamic loading (the default), compile
14201 them into the $package executable (static loading), or not include
14202 them at all. Answer "none" to include no extensions.
14203 Note that DynaLoader is always built and need not be mentioned here.
14206 case "$dynamic_ext" in
14207 '') dflt="$avail_ext" ;;
14208 *) dflt="$dynamic_ext"
14209 # Perhaps we are reusing an old out-of-date config.sh.
14212 if test X"$dynamic_ext" != X"$avail_ext"; then
14214 NOTICE: Your previous config.sh list may be incorrect.
14215 The extensions now available to you are
14217 but the default list from your previous config.sh is
14229 rp="What extensions do you wish to load dynamically?"
14232 none) dynamic_ext=' ' ;;
14233 *) dynamic_ext="$ans" ;;
14236 case "$static_ext" in
14238 : Exclude those already listed in dynamic linking
14240 for xxx in $avail_ext; do
14241 case " $dynamic_ext " in
14243 *) dflt="$dflt $xxx" ;;
14250 *) dflt="$static_ext"
14257 rp="What extensions do you wish to load statically?"
14260 none) static_ext=' ' ;;
14261 *) static_ext="$ans" ;;
14266 A number of extensions are supplied with $package. Answer "none"
14267 to include no extensions.
14268 Note that DynaLoader is always built and need not be mentioned here.
14271 case "$static_ext" in
14272 '') dflt="$avail_ext" ;;
14273 *) dflt="$static_ext"
14274 # Perhaps we are reusing an old out-of-date config.sh.
14277 if test X"$static_ext" != X"$avail_ext"; then
14279 NOTICE: Your previous config.sh list may be incorrect.
14280 The extensions now available to you are
14282 but the default list from your previous config.sh is
14291 : Exclude those that are not xs extensions
14295 rp="What extensions do you wish to include?"
14298 none) static_ext=' ' ;;
14299 *) static_ext="$ans" ;;
14304 set X $dynamic_ext $static_ext $nonxs_ext
14308 : Remove build directory name from cppstdin so it can be used from
14309 : either the present location or the final installed location.
14311 : Get out of the UU directory to get correct path name.
14313 case "$cppstdin" in
14315 echo "Stripping down cppstdin path name"
14321 : end of configuration questions
14323 echo "End of configuration questions."
14326 : back to where it started
14327 if test -d ../UU; then
14331 : configuration may be patched via a 'config.over' file
14332 if $test -f config.over; then
14335 rp='I see a config.over file. Do you wish to load it?'
14338 n*) echo "OK, I'll ignore it.";;
14340 echo "Configuration override changes have been loaded."
14345 : in case they want portability, strip down executable paths
14346 case "$d_portable" in
14349 echo "Stripping down executable paths..." >&4
14350 for file in $loclist $trylist; do
14352 eval $file=`basename $temp`
14357 : create config.sh file
14359 echo "Creating config.sh..." >&4
14360 $spitshell <<EOT >config.sh
14363 # This file was produced by running the Configure script. It holds all the
14364 # definitions figured out by Configure. Should you modify one of these values,
14365 # do not forget to propagate your changes by running "Configure -der". You may
14366 # instead choose to run each of the .SH files by yourself, or "Configure -S".
14369 # Package name : $package
14370 # Source directory : $src
14371 # Configuration time: $cf_time
14372 # Configured by : $cf_by
14373 # Target system : $myuname
14383 Revision='$Revision'
14390 alignbytes='$alignbytes'
14391 ansi2knr='$ansi2knr'
14392 aphostname='$aphostname'
14393 api_revision='$api_revision'
14394 api_subversion='$api_subversion'
14395 api_version='$api_version'
14396 api_versionstring='$api_versionstring'
14399 archlibexp='$archlibexp'
14400 archname64='$archname64'
14401 archname='$archname'
14402 archobjs='$archobjs'
14407 bincompat5005='$bincompat5005'
14411 byteorder='$byteorder'
14413 castflags='$castflags'
14416 cccdlflags='$cccdlflags'
14417 ccdlflags='$ccdlflags'
14419 ccsymbols='$ccsymbols'
14421 cf_email='$cf_email'
14423 charsize='$charsize'
14427 clocktype='$clocktype'
14429 compress='$compress'
14430 contains='$contains'
14434 cpp_stuff='$cpp_stuff'
14435 cppccsymbols='$cppccsymbols'
14436 cppflags='$cppflags'
14438 cppminus='$cppminus'
14440 cppstdin='$cppstdin'
14441 cppsymbols='$cppsymbols'
14442 crosscompile='$crosscompile'
14443 cryptlib='$cryptlib'
14445 d_Gconvert='$d_Gconvert'
14446 d_PRIEldbl='$d_PRIEldbl'
14447 d_PRIFldbl='$d_PRIFldbl'
14448 d_PRIGldbl='$d_PRIGldbl'
14449 d_PRIX64='$d_PRIX64'
14450 d_PRId64='$d_PRId64'
14451 d_PRIeldbl='$d_PRIeldbl'
14452 d_PRIfldbl='$d_PRIfldbl'
14453 d_PRIgldbl='$d_PRIgldbl'
14454 d_PRIi64='$d_PRIi64'
14455 d_PRIo64='$d_PRIo64'
14456 d_PRIu64='$d_PRIu64'
14457 d_PRIx64='$d_PRIx64'
14458 d_access='$d_access'
14459 d_accessx='$d_accessx'
14461 d_archlib='$d_archlib'
14464 d_attribut='$d_attribut'
14467 d_bincompat5005='$d_bincompat5005'
14469 d_bsdgetpgrp='$d_bsdgetpgrp'
14470 d_bsdsetpgrp='$d_bsdsetpgrp'
14472 d_casti32='$d_casti32'
14473 d_castneg='$d_castneg'
14474 d_charvspr='$d_charvspr'
14476 d_chroot='$d_chroot'
14477 d_chsize='$d_chsize'
14478 d_closedir='$d_closedir'
14482 d_cuserid='$d_cuserid'
14483 d_dbl_dig='$d_dbl_dig'
14484 d_difftime='$d_difftime'
14485 d_dirnamlen='$d_dirnamlen'
14486 d_dlerror='$d_dlerror'
14487 d_dlopen='$d_dlopen'
14488 d_dlsymun='$d_dlsymun'
14489 d_dosuid='$d_dosuid'
14490 d_drand48proto='$d_drand48proto'
14492 d_eaccess='$d_eaccess'
14493 d_endgrent='$d_endgrent'
14494 d_endhent='$d_endhent'
14495 d_endnent='$d_endnent'
14496 d_endpent='$d_endpent'
14497 d_endpwent='$d_endpwent'
14498 d_endsent='$d_endsent'
14499 d_endspent='$d_endspent'
14500 d_eofnblk='$d_eofnblk'
14501 d_eunice='$d_eunice'
14502 d_fchmod='$d_fchmod'
14503 d_fchown='$d_fchown'
14505 d_fd_macros='$d_fd_macros'
14506 d_fd_set='$d_fd_set'
14507 d_fds_bits='$d_fds_bits'
14508 d_fgetpos='$d_fgetpos'
14509 d_flexfnam='$d_flexfnam'
14512 d_fpathconf='$d_fpathconf'
14513 d_fpos64_t='$d_fpos64_t'
14514 d_fs_data_s='$d_fs_data_s'
14515 d_fseeko='$d_fseeko'
14516 d_fsetpos='$d_fsetpos'
14517 d_fstatfs='$d_fstatfs'
14518 d_fstatvfs='$d_fstatvfs'
14519 d_ftello='$d_ftello'
14521 d_getgrent='$d_getgrent'
14522 d_getgrps='$d_getgrps'
14523 d_gethbyaddr='$d_gethbyaddr'
14524 d_gethbyname='$d_gethbyname'
14525 d_gethent='$d_gethent'
14526 d_gethname='$d_gethname'
14527 d_gethostprotos='$d_gethostprotos'
14528 d_getlogin='$d_getlogin'
14529 d_getmnt='$d_getmnt'
14530 d_getmntent='$d_getmntent'
14531 d_getnbyaddr='$d_getnbyaddr'
14532 d_getnbyname='$d_getnbyname'
14533 d_getnent='$d_getnent'
14534 d_getnetprotos='$d_getnetprotos'
14535 d_getpbyname='$d_getpbyname'
14536 d_getpbynumber='$d_getpbynumber'
14537 d_getpent='$d_getpent'
14538 d_getpgid='$d_getpgid'
14539 d_getpgrp2='$d_getpgrp2'
14540 d_getpgrp='$d_getpgrp'
14541 d_getppid='$d_getppid'
14542 d_getprior='$d_getprior'
14543 d_getprotoprotos='$d_getprotoprotos'
14544 d_getpwent='$d_getpwent'
14545 d_getsbyname='$d_getsbyname'
14546 d_getsbyport='$d_getsbyport'
14547 d_getsent='$d_getsent'
14548 d_getservprotos='$d_getservprotos'
14549 d_getspent='$d_getspent'
14550 d_getspnam='$d_getspnam'
14551 d_gettimeod='$d_gettimeod'
14552 d_gnulibc='$d_gnulibc'
14553 d_grpasswd='$d_grpasswd'
14554 d_hasmntopt='$d_hasmntopt'
14557 d_inetaton='$d_inetaton'
14558 d_int64t='$d_int64t'
14559 d_isascii='$d_isascii'
14560 d_killpg='$d_killpg'
14561 d_lchown='$d_lchown'
14562 d_ldbl_dig='$d_ldbl_dig'
14564 d_locconv='$d_locconv'
14566 d_longdbl='$d_longdbl'
14567 d_longlong='$d_longlong'
14570 d_mbstowcs='$d_mbstowcs'
14571 d_mbtowc='$d_mbtowc'
14572 d_memchr='$d_memchr'
14573 d_memcmp='$d_memcmp'
14574 d_memcpy='$d_memcpy'
14575 d_memmove='$d_memmove'
14576 d_memset='$d_memset'
14578 d_mkfifo='$d_mkfifo'
14579 d_mktime='$d_mktime'
14581 d_msg_ctrunc='$d_msg_ctrunc'
14582 d_msg_dontroute='$d_msg_dontroute'
14583 d_msg_oob='$d_msg_oob'
14584 d_msg_peek='$d_msg_peek'
14585 d_msg_proxy='$d_msg_proxy'
14586 d_msgctl='$d_msgctl'
14587 d_msgget='$d_msgget'
14588 d_msgrcv='$d_msgrcv'
14589 d_msgsnd='$d_msgsnd'
14590 d_mymalloc='$d_mymalloc'
14592 d_nv_preserves_uv='$d_nv_preserves_uv'
14593 d_off64_t='$d_off64_t'
14594 d_old_pthread_create_joinable='$d_old_pthread_create_joinable'
14595 d_oldpthreads='$d_oldpthreads'
14596 d_oldsock='$d_oldsock'
14598 d_pathconf='$d_pathconf'
14600 d_phostname='$d_phostname'
14603 d_portable='$d_portable'
14604 d_pthread_yield='$d_pthread_yield'
14606 d_pwchange='$d_pwchange'
14607 d_pwclass='$d_pwclass'
14608 d_pwcomment='$d_pwcomment'
14609 d_pwexpire='$d_pwexpire'
14610 d_pwgecos='$d_pwgecos'
14611 d_pwpasswd='$d_pwpasswd'
14612 d_pwquota='$d_pwquota'
14614 d_readdir='$d_readdir'
14615 d_readlink='$d_readlink'
14616 d_rename='$d_rename'
14617 d_rewinddir='$d_rewinddir'
14619 d_safebcpy='$d_safebcpy'
14620 d_safemcpy='$d_safemcpy'
14621 d_sanemcmp='$d_sanemcmp'
14622 d_sched_yield='$d_sched_yield'
14623 d_scm_rights='$d_scm_rights'
14624 d_seekdir='$d_seekdir'
14625 d_select='$d_select'
14627 d_semctl='$d_semctl'
14628 d_semctl_semid_ds='$d_semctl_semid_ds'
14629 d_semctl_semun='$d_semctl_semun'
14630 d_semget='$d_semget'
14632 d_setegid='$d_setegid'
14633 d_seteuid='$d_seteuid'
14634 d_setgrent='$d_setgrent'
14635 d_setgrps='$d_setgrps'
14636 d_sethent='$d_sethent'
14637 d_setlinebuf='$d_setlinebuf'
14638 d_setlocale='$d_setlocale'
14639 d_setnent='$d_setnent'
14640 d_setpent='$d_setpent'
14641 d_setpgid='$d_setpgid'
14642 d_setpgrp2='$d_setpgrp2'
14643 d_setpgrp='$d_setpgrp'
14644 d_setprior='$d_setprior'
14645 d_setpwent='$d_setpwent'
14646 d_setregid='$d_setregid'
14647 d_setresgid='$d_setresgid'
14648 d_setresuid='$d_setresuid'
14649 d_setreuid='$d_setreuid'
14650 d_setrgid='$d_setrgid'
14651 d_setruid='$d_setruid'
14652 d_setsent='$d_setsent'
14653 d_setsid='$d_setsid'
14654 d_setspent='$d_setspent'
14655 d_setvbuf='$d_setvbuf'
14659 d_shmatprototype='$d_shmatprototype'
14660 d_shmctl='$d_shmctl'
14662 d_shmget='$d_shmget'
14663 d_sigaction='$d_sigaction'
14664 d_sigsetjmp='$d_sigsetjmp'
14665 d_socket='$d_socket'
14666 d_sockpair='$d_sockpair'
14668 d_statblks='$d_statblks'
14669 d_statfs_f_flags='$d_statfs_f_flags'
14670 d_statfs_s='$d_statfs_s'
14671 d_statvfs='$d_statvfs'
14672 d_stdio_cnt_lval='$d_stdio_cnt_lval'
14673 d_stdio_ptr_lval='$d_stdio_ptr_lval'
14674 d_stdio_stream_array='$d_stdio_stream_array'
14675 d_stdiobase='$d_stdiobase'
14676 d_stdstdio='$d_stdstdio'
14677 d_strchr='$d_strchr'
14678 d_strcoll='$d_strcoll'
14679 d_strctcpy='$d_strctcpy'
14680 d_strerrm='$d_strerrm'
14681 d_strerror='$d_strerror'
14682 d_strtod='$d_strtod'
14683 d_strtol='$d_strtol'
14684 d_strtold='$d_strtold'
14685 d_strtoll='$d_strtoll'
14686 d_strtoul='$d_strtoul'
14687 d_strtoull='$d_strtoull'
14688 d_strtouq='$d_strtouq'
14689 d_strxfrm='$d_strxfrm'
14690 d_suidsafe='$d_suidsafe'
14691 d_symlink='$d_symlink'
14692 d_syscall='$d_syscall'
14693 d_sysconf='$d_sysconf'
14694 d_sysernlst='$d_sysernlst'
14695 d_syserrlst='$d_syserrlst'
14696 d_system='$d_system'
14697 d_tcgetpgrp='$d_tcgetpgrp'
14698 d_tcsetpgrp='$d_tcsetpgrp'
14699 d_telldir='$d_telldir'
14700 d_telldirproto='$d_telldirproto'
14703 d_truncate='$d_truncate'
14704 d_tzname='$d_tzname'
14707 d_union_semun='$d_union_semun'
14709 d_vendorbin='$d_vendorbin'
14710 d_vendorlib='$d_vendorlib'
14712 d_void_closedir='$d_void_closedir'
14713 d_voidsig='$d_voidsig'
14714 d_voidtty='$d_voidtty'
14715 d_volatile='$d_volatile'
14716 d_vprintf='$d_vprintf'
14718 d_waitpid='$d_waitpid'
14719 d_wcstombs='$d_wcstombs'
14720 d_wctomb='$d_wctomb'
14723 db_hashtype='$db_hashtype'
14724 db_prefixtype='$db_prefixtype'
14725 defvoidused='$defvoidused'
14726 direntrytype='$direntrytype'
14729 doublesize='$doublesize'
14731 dynamic_ext='$dynamic_ext'
14737 eunicefix='$eunicefix'
14740 extensions='$extensions'
14741 fflushNULL='$fflushNULL'
14742 fflushall='$fflushall'
14744 firstmakefile='$firstmakefile'
14746 fpossize='$fpossize'
14747 fpostype='$fpostype'
14748 freetype='$freetype'
14750 full_csh='$full_csh'
14751 full_sed='$full_sed'
14752 gccversion='$gccversion'
14753 gidformat='$gidformat'
14759 groupcat='$groupcat'
14760 groupstype='$groupstype'
14763 h_sysfile='$h_sysfile'
14775 i_arpainet='$i_arpainet'
14776 i_bsdioctl='$i_bsdioctl'
14779 i_dirent='$i_dirent'
14786 i_inttypes='$i_inttypes'
14787 i_limits='$i_limits'
14788 i_locale='$i_locale'
14789 i_machcthr='$i_machcthr'
14790 i_malloc='$i_malloc'
14792 i_memory='$i_memory'
14793 i_mntent='$i_mntent'
14796 i_neterrno='$i_neterrno'
14797 i_netinettcp='$i_netinettcp'
14800 i_pthread='$i_pthread'
14802 i_rpcsvcdbm='$i_rpcsvcdbm'
14805 i_shadow='$i_shadow'
14807 i_stdarg='$i_stdarg'
14808 i_stddef='$i_stddef'
14809 i_stdlib='$i_stdlib'
14810 i_string='$i_string'
14811 i_sysaccess='$i_sysaccess'
14812 i_sysdir='$i_sysdir'
14813 i_sysfile='$i_sysfile'
14814 i_sysfilio='$i_sysfilio'
14816 i_sysioctl='$i_sysioctl'
14817 i_sysmount='$i_sysmount'
14818 i_sysndir='$i_sysndir'
14819 i_sysparam='$i_sysparam'
14820 i_sysresrc='$i_sysresrc'
14821 i_syssecrt='$i_syssecrt'
14822 i_sysselct='$i_sysselct'
14823 i_syssockio='$i_syssockio'
14824 i_sysstat='$i_sysstat'
14825 i_sysstatfs='$i_sysstatfs'
14826 i_sysstatvfs='$i_sysstatvfs'
14827 i_systime='$i_systime'
14828 i_systimek='$i_systimek'
14829 i_systimes='$i_systimes'
14830 i_systypes='$i_systypes'
14831 i_sysuio='$i_sysuio'
14833 i_sysvfs='$i_sysvfs'
14834 i_syswait='$i_syswait'
14835 i_termio='$i_termio'
14836 i_termios='$i_termios'
14838 i_unistd='$i_unistd'
14841 i_values='$i_values'
14842 i_varargs='$i_varargs'
14843 i_varhdr='$i_varhdr'
14845 ignore_versioned_solibs='$ignore_versioned_solibs'
14846 inc_version_list='$inc_version_list'
14847 inc_version_list_init='$inc_version_list_init'
14850 installarchlib='$installarchlib'
14851 installbin='$installbin'
14852 installman1dir='$installman1dir'
14853 installman3dir='$installman3dir'
14854 installprefix='$installprefix'
14855 installprefixexp='$installprefixexp'
14856 installprivlib='$installprivlib'
14857 installscript='$installscript'
14858 installsitearch='$installsitearch'
14859 installsitebin='$installsitebin'
14860 installsitelib='$installsitelib'
14861 installstyle='$installstyle'
14862 installusrbinperl='$installusrbinperl'
14863 installvendorbin='$installvendorbin'
14864 installvendorlib='$installvendorlib'
14866 ivdformat='$ivdformat'
14869 known_extensions='$known_extensions'
14873 lddlflags='$lddlflags'
14875 ldlibpthname='$ldlibpthname'
14882 libswanted='$libswanted'
14888 locincpth='$locincpth'
14889 loclibpth='$loclibpth'
14890 longdblsize='$longdblsize'
14891 longlongsize='$longlongsize'
14892 longsize='$longsize'
14896 lseeksize='$lseeksize'
14897 lseektype='$lseektype'
14901 make_set_make='$make_set_make'
14902 mallocobj='$mallocobj'
14903 mallocsrc='$mallocsrc'
14904 malloctype='$malloctype'
14906 man1direxp='$man1direxp'
14909 man3direxp='$man3direxp'
14912 mips_type='$mips_type'
14915 modetype='$modetype'
14917 multiarch='$multiarch'
14919 myarchname='$myarchname'
14920 mydomain='$mydomain'
14921 myhostname='$myhostname'
14924 netdb_hlen_type='$netdb_hlen_type'
14925 netdb_host_type='$netdb_host_type'
14926 netdb_name_type='$netdb_name_type'
14927 netdb_net_type='$netdb_net_type'
14930 nm_so_opt='$nm_so_opt'
14931 nonxs_ext='$nonxs_ext'
14935 o_nonblock='$o_nonblock'
14937 old_pthread_create_joinable='$old_pthread_create_joinable'
14938 optimize='$optimize'
14939 orderlib='$orderlib'
14945 patchlevel='$patchlevel'
14946 path_sep='$path_sep'
14948 perladmin='$perladmin'
14949 perlpath='$perlpath'
14951 phostname='$phostname'
14957 prefixexp='$prefixexp'
14959 privlibexp='$privlibexp'
14960 prototype='$prototype'
14962 quadkind='$quadkind'
14963 quadtype='$quadtype'
14964 randbits='$randbits'
14965 randfunc='$randfunc'
14966 randseedtype='$randseedtype'
14968 rd_nodata='$rd_nodata'
14972 sPRIEldbl='$sPRIEldbl'
14973 sPRIFldbl='$sPRIFldbl'
14974 sPRIGldbl='$sPRIGldbl'
14977 sPRIeldbl='$sPRIeldbl'
14978 sPRIfldbl='$sPRIfldbl'
14979 sPRIgldbl='$sPRIgldbl'
14984 sched_yield='$sched_yield'
14985 scriptdir='$scriptdir'
14986 scriptdirexp='$scriptdirexp'
14988 seedfunc='$seedfunc'
14989 selectminbits='$selectminbits'
14990 selecttype='$selecttype'
14991 sendmail='$sendmail'
14994 sharpbang='$sharpbang'
14995 shmattype='$shmattype'
14996 shortsize='$shortsize'
14999 sig_count='$sig_count'
15000 sig_name='$sig_name'
15001 sig_name_init='$sig_name_init'
15003 sig_num_init='$sig_num_init'
15004 signal_t='$signal_t'
15005 sitearch='$sitearch'
15006 sitearchexp='$sitearchexp'
15008 sitebinexp='$sitebinexp'
15010 sitelibexp='$sitelibexp'
15011 siteprefix='$siteprefix'
15012 siteprefixexp='$siteprefixexp'
15013 sizetype='$sizetype'
15018 sockethdr='$sockethdr'
15019 socketlib='$socketlib'
15021 spackage='$spackage'
15022 spitshell='$spitshell'
15025 ssizetype='$ssizetype'
15026 startperl='$startperl'
15028 static_ext='$static_ext'
15030 stdio_base='$stdio_base'
15031 stdio_bufsiz='$stdio_bufsiz'
15032 stdio_cnt='$stdio_cnt'
15033 stdio_filbuf='$stdio_filbuf'
15034 stdio_ptr='$stdio_ptr'
15035 stdio_stream_array='$stdio_stream_array'
15038 subversion='$subversion'
15045 timeincl='$timeincl'
15046 timetype='$timetype'
15059 uidformat='$uidformat'
15065 uquadtype='$uquadtype'
15066 use5005threads='$use5005threads'
15067 use64bits='$use64bits'
15069 useithreads='$useithreads'
15070 uselargefiles='$uselargefiles'
15071 uselongdouble='$uselongdouble'
15072 uselonglong='$uselonglong'
15073 usemorebits='$usemorebits'
15074 usemultiplicity='$usemultiplicity'
15075 usemymalloc='$usemymalloc'
15077 useopcode='$useopcode'
15078 useperlio='$useperlio'
15079 useposix='$useposix'
15081 useshrplib='$useshrplib'
15082 usesocks='$usesocks'
15083 usethreads='$usethreads'
15084 usevendorprefix='$usevendorprefix'
15085 usevfork='$usevfork'
15088 uvoformat='$uvoformat'
15091 uvuformat='$uvuformat'
15092 uvxformat='$uvxformat'
15093 vendorbin='$vendorbin'
15094 vendorbinexp='$vendorbinexp'
15095 vendorlib='$vendorlib'
15096 vendorlibexp='$vendorlibexp'
15097 vendorprefix='$vendorprefix'
15098 vendorprefixexp='$vendorprefixexp'
15101 voidflags='$voidflags'
15107 : Add in command line options if available
15108 $test -f UU/cmdline.opt && $cat UU/cmdline.opt >> config.sh
15110 : add special variables
15111 $test -f $src/patchlevel.h && \
15112 awk '/^#define[ ]+PERL_/ {printf "%s=%s\n",$2,$3}' $src/patchlevel.h >>config.sh
15113 echo "CONFIGDOTSH=true" >>config.sh
15115 : propagate old symbols
15116 if $test -f UU/config.sh; then
15117 <UU/config.sh sort | uniq >UU/oldconfig.sh
15118 sed -n 's/^\([a-zA-Z_0-9]*\)=.*/\1/p' config.sh config.sh UU/oldconfig.sh |\
15119 sort | uniq -u >UU/oldsyms
15120 set X `cat UU/oldsyms`
15126 Hmm...You had some extra variables I don't know about...I'll try to keep 'em...
15128 echo "# Variables propagated from previous config.sh file." >>config.sh
15129 for sym in `cat UU/oldsyms`; do
15130 echo " Propagating $hint variable "'$'"$sym..."
15131 eval 'tmp="$'"${sym}"'"'
15133 sed -e "s/'/'\"'\"'/g" -e "s/^/$sym='/" -e "s/$/'/" >>config.sh
15139 : Finish up by extracting the .SH files
15153 If you'd like to make any changes to the config.sh file before I begin
15154 to configure things, do it as a shell escape now (e.g. !vi config.sh).
15157 rp="Press return or use a shell escape to edit config.sh:"
15162 *) : in case they cannot read
15163 sh 1>&4 -c "$ans";;
15168 : if this fails, just run all the .SH files by hand
15175 if $contains '^depend:' [Mm]akefile >/dev/null 2>&1; then
15182 Now you need to generate make dependencies by running "$make depend".
15183 You might prefer to run it in background: "$make depend > makedepend.out &"
15184 It can take a while, so you might not want to run it right now.
15189 rp="Run $make depend now?"
15193 $make depend && echo "Now you must run a $make."
15196 echo "You must run '$make depend' then '$make'."
15199 elif test -f [Mm]akefile; then
15201 echo "Now you must run a $make."
15206 if $test -f Policy.sh; then
15209 If you compile $package on a different machine or from a different object
15210 directory, copy the Policy.sh file from this object directory to the
15211 new one before you run Configure -- this will help you with most of
15212 the policy defaults.
15216 if $test -f config.msg; then
15217 echo "Hmm. I also noted the following information while running:"
15219 $cat config.msg >&4
15222 $rm -f kit*isdone ark*isdone