3 # If these # comments don't work, trim them. Don't worry about any other
4 # shell scripts, Configure will trim # comments from them for you.
6 # (If you are trying to port this package to a machine without sh,
7 # I would suggest you have a look at the prototypical config_h.SH file
8 # and edit it to reflect your system. Some packages may include samples
9 # of config.h for certain machines, so you might look for one of those.)
11 # Yes, you may rip this off to use in other distribution packages. This
12 # script belongs to the public domain and cannot be copyrighted.
14 # (Note: this Configure script was generated automatically. Rather than
15 # working with this copy of Configure, you may wish to get metaconfig.
16 # The dist-3.0 package (which contains metaconfig) was posted in
17 # comp.sources.misc and is available on CPAN under authors/id/RAM so
18 # you may fetch it yourself from your nearest archive site.)
21 # $Id: Head.U,v 3.0.1.9 1997/02/28 15:02:09 ram Exp $
23 # Generated on Fri Sep 8 23:42:12 EET DST 2000 [metaconfig 3.0 PL70]
24 # (with additional metaconfig patches by perlbug@perl.org)
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
460 d_old_pthread_create_joinable=''
461 old_pthread_create_joinable=''
708 inc_version_list_init=''
726 ignore_versioned_solibs=''
784 d_perl_otherlibdirs=''
801 d_nv_preserves_uv_bits=''
899 d_stdio_stream_array=''
900 stdio_stream_array=''
910 ccflags_uselargefiles=''
911 ldflags_uselargefiles=''
912 libswanted_uselargefiles=''
954 smallmach='pdp11 i8086 z8000 i80286 iAPX286'
957 : We must find out about Eunice early
959 if test -f /etc/unixtovms; then
960 eunicefix=/etc/unixtovms
962 if test -f /etc/unixtovms.exe; then
963 eunicefix=/etc/unixtovms.exe
969 : set useposix=false in your hint file to disable the POSIX extension.
971 : set useopcode=false in your hint file to disable the Opcode extension.
973 : Trailing extension. Override this in a hint file, if needed.
975 : Extra object files, if any, needed on this platform.
978 : Possible local include directories to search.
979 : Set locincpth to "" in a hint file to defeat local include searches.
980 locincpth="/usr/local/include /opt/local/include /usr/gnu/include"
981 locincpth="$locincpth /opt/gnu/include /usr/GNU/include /opt/GNU/include"
983 : no include file wanted by default
987 : change the next line if compiling for Xenix/286 on Xenix/386
988 xlibpth='/usr/lib/386 /lib/386'
989 : Possible local library directories to search.
990 loclibpth="/usr/local/lib /opt/local/lib /usr/gnu/lib"
991 loclibpth="$loclibpth /opt/gnu/lib /usr/GNU/lib /opt/GNU/lib"
993 : general looking path for locating libraries
994 glibpth="/lib /usr/lib $xlibpth"
995 glibpth="$glibpth /usr/ccs/lib /usr/ucblib /usr/local/lib"
996 test -f /usr/shlib/libc.so && glibpth="/usr/shlib $glibpth"
997 test -f /shlib/libc.so && glibpth="/shlib $glibpth"
999 : Private path used by Configure to find libraries. Its value
1000 : is prepended to libpth. This variable takes care of special
1001 : machines, like the mips. Usually, it should be empty.
1004 : default library list
1006 : some systems want to use only the non-versioned libso:s
1007 ignore_versioned_solibs=''
1009 ccflags_uselargefiles=''
1010 ldflags_uselargefiles=''
1011 libswanted_uselargefiles=''
1012 : set usemultiplicity on the Configure command line to enable multiplicity.
1013 : set usesocks on the Configure command line to enable socks.
1014 : set usethreads on the Configure command line to enable threads.
1015 : full support for void wanted by default
1018 : List of libraries we want.
1019 : If anyone needs -lnet, put it in a hint file.
1020 libswanted='sfio socket bind inet nsl nm ndbm gdbm dbm db malloc dl'
1021 libswanted="$libswanted dld ld sun m c cposix posix"
1022 libswanted="$libswanted ndir dir crypt sec"
1023 libswanted="$libswanted ucb bsd BSD PW x iconv util"
1024 : We probably want to search /usr/shlib before most other libraries.
1025 : This is only used by the lib/ExtUtils/MakeMaker.pm routine extliblist.
1026 glibpth=`echo " $glibpth " | sed -e 's! /usr/shlib ! !'`
1027 glibpth="/usr/shlib $glibpth"
1028 : Do not use vfork unless overridden by a hint file.
1031 : Find the basic shell for Bourne shell scripts
1035 *bsd*|sys5*) xxx="/$SYSTYPE/bin/sh";;
1038 if test -f "$xxx"; then
1041 : Build up a list and do a single loop so we can 'break' out.
1042 pth=`echo $PATH | sed -e "s/$p_/ /g"`
1043 for xxx in sh bash ksh pdksh ash; do
1045 try="$try ${p}/${xxx}"
1049 if test -f "$xxx"; then
1052 elif test -f "$xxx.exe"; then
1063 $me: Fatal Error: I can't find a Bourne Shell anywhere.
1065 Usually it's in /bin/sh. How did you even get this far?
1066 Please contact me (Perl Maintainers) at perlbug@perl.org and
1067 we'll try to straighten this all out.
1073 : see if sh knows # comments
1074 if `$sh -c '#' >/dev/null 2>&1`; then
1078 test -f $xcat || xcat=/usr/bin/cat
1083 if test -s today; then
1086 echo "#! $xcat" > try
1090 if test -s today; then
1098 echo "Your $sh doesn't grok # comments--I will strip them later on."
1101 echo "exec grep -v '^[ ]*#'" >spitshell
1103 $eunicefix spitshell
1104 spitshell=`pwd`/spitshell
1106 echo "I presume that if # doesn't work, #! won't work either!"
1111 : figure out how to guarantee sh startup
1113 '') startsh=${sharpbang}${sh} ;;
1125 : echo "Yup, it does."
1127 echo "Hmm... '$startsh' does not guarantee sh startup..."
1128 echo "You may have to fix up the shell scripts to make sure $sh runs them."
1133 : Save command line options in file UU/cmdline.opt for later use in
1134 : generating config.sh.
1135 cat > cmdline.opt <<EOSH
1136 # Configure command line arguments.
1143 cat >>cmdline.opt <<EOSH
1144 config_arg$argn='$arg'
1146 argn=`expr $argn + 1`
1149 : produce awk script to parse command line options
1150 cat >options.awk <<'EOF'
1152 optstr = "A:dD:eEf:hKOrsSU:V"; # getopt-style specification
1154 len = length(optstr);
1155 for (i = 1; i <= len; i++) {
1156 c = substr(optstr, i, 1);
1157 if (i < len) a = substr(optstr, i + 1, 1); else a = "";
1168 if (substr(str, 1, 1) != "-") {
1169 printf("'%s'\n", str);
1173 for (i = 2; i <= len; i++) {
1174 c = substr(str, i, 1);
1176 printf("-%s\n", substr(str, i));
1182 printf("'%s'\n", substr(str, i + 1));
1195 : process the command line options
1196 set X `for arg in "$@"; do echo "X$arg"; done |
1197 sed -e s/X// | awk -f options.awk`
1202 : set up default values
1212 rm -f optdef.sh posthint.sh
1213 cat >optdef.sh <<EOS
1219 while test $# -gt 0; do
1221 -d) shift; fastread=yes;;
1222 -e) shift; alldone=cont;;
1226 if test -r "$1"; then
1229 echo "$me: cannot read config file $1." >&2
1234 -h) shift; error=true;;
1235 -r) shift; reuseval=true;;
1236 -s) shift; silent=true; realsilent=true;;
1237 -E) shift; alldone=exit;;
1238 -K) shift; knowitall=true;;
1239 -O) shift; override=true;;
1240 -S) shift; silent=true; extractsh=true;;
1245 echo "$me: use '-U symbol=', not '-D symbol='." >&2
1246 echo "$me: ignoring -D $1" >&2
1249 sed -e "s/'/'\"'\"'/g" -e "s/=\(.*\)/='\1'/" >> optdef.sh;;
1250 *) echo "$1='define'" >> optdef.sh;;
1257 *=) echo "$1" >> optdef.sh;;
1259 echo "$me: use '-D symbol=val', not '-U symbol=val'." >&2
1260 echo "$me: ignoring -U $1" >&2
1262 *) echo "$1='undef'" >> optdef.sh;;
1273 *=*) zzz=`echo $yyy|sed 's!=.*!!'`
1277 zzz=" "`echo $yyy|sed 's!^[^=]*=!!'`
1278 yyy=`echo $yyy|sed 's!=.*!!'` ;;
1284 *:*) xxx=`echo $yyy|sed 's!:.*!!'`
1285 yyy=`echo $yyy|sed 's!^[^:]*:!!'`
1286 zzz=`echo $yyy|sed 's!^[^=]*=!!'`
1287 yyy=`echo $yyy|sed 's!=.*!!'` ;;
1288 *) xxx=`echo $yyy|sed 's!:.*!!'`
1289 yyy=`echo $yyy|sed 's!^[^:]*:!!'` ;;
1295 echo "$yyy=\"\${$yyy}$zzz\"" >> posthint.sh ;;
1297 echo "$yyy=''" >> posthint.sh ;;
1302 echo "$yyy='$zzz'" >> posthint.sh ;;
1304 echo "eval \"$yyy=$zzz\"" >> posthint.sh ;;
1306 echo "$yyy=\"$zzz\${$yyy}\"" >> posthint.sh ;;
1311 echo "$yyy=$zzz" >> posthint.sh ;;
1312 *) echo "$me: unknown -A command '$xxx', ignoring -A $1" >&2 ;;
1316 -V) echo "$me generated by metaconfig 3.0 PL70." >&2
1319 -*) echo "$me: unknown option $1" >&2; shift; error=true;;
1327 Usage: $me [-dehrsEKOSV] [-f config.sh] [-D symbol] [-D symbol=value]
1328 [-U symbol] [-U symbol=] [-A command:symbol...]
1329 -d : use defaults for all answers.
1330 -e : go on without questioning past the production of config.sh.
1331 -f : specify an alternate default configuration file.
1332 -h : print this help message and exit (with an error status).
1333 -r : reuse C symbols value if possible (skips costly nm extraction).
1334 -s : silent mode, only echoes questions and essential information.
1335 -D : define symbol to have some value:
1336 -D symbol symbol gets the value 'define'
1337 -D symbol=value symbol gets the value 'value'
1338 -E : stop at the end of questions, after having produced config.sh.
1339 -K : do not use unless you know what you are doing.
1340 -O : let -D and -U override definitions from loaded configuration file.
1341 -S : perform variable substitutions on all .SH files (can mix with -f)
1342 -U : undefine symbol:
1343 -U symbol symbol gets the value 'undef'
1344 -U symbol= symbol gets completely empty
1345 -A : manipulate symbol after the platform specific hints have been applied:
1346 -A symbol=value append " "value to symbol
1347 -A append:symbol=value append value to symbol
1348 -A define:symbol=value define symbol to have value
1349 -A clear:symbol define symbol to be ''
1350 -A define:symbol define symbol to be 'define'
1351 -A eval:symbol=value define symbol to be eval of value
1352 -A prepend:symbol=value prepend value to symbol
1353 -A undef:symbol define symbol to be 'undef'
1354 -A undef:symbol= define symbol to be ''
1355 -V : print version number and exit (with a zero status).
1362 case "$fastread$alldone" in
1365 case "$extractsh" in
1368 if test ! -t 0; then
1369 echo "Say 'sh Configure', not 'sh <Configure'"
1379 true) exec 1>/dev/null;;
1382 : run the defines and the undefines, if any, but leave the file out there...
1385 : create the posthint manipulation script and leave the file out there...
1390 first=`echo $package | sed -e 's/^\(.\).*/\1/'`
1391 last=`echo $package | sed -e 's/^.\(.*\)/\1/'`
1392 case "`echo AbyZ | tr '[:lower:]' '[:upper:]' 2>/dev/null`" in
1393 ABYZ) spackage=`echo $first | tr '[:lower:]' '[:upper:]'`$last;;
1394 *) spackage=`echo $first | tr '[a-z]' '[A-Z]'`$last;;
1397 : Some greps do not return status, grrr.
1398 echo "grimblepritz" >grimble
1399 if grep blurfldyick grimble >/dev/null 2>&1 ; then
1401 elif grep grimblepritz grimble >/dev/null 2>&1 ; then
1407 : the following should work in any shell
1411 echo "AGH! Grep doesn't return a status. Attempting remedial action."
1412 cat >contains <<'EOSS'
1413 grep "$1" "$2" >.greptmp && cat .greptmp && test -s .greptmp
1418 : Find the path to the source tree
1421 */*) src=`echo $0 | sed -e 's%/[^/][^/]*$%%'`
1424 *) src=`cd ../$src && pwd` ;;
1437 if test -f $rsrc/Configure && \
1438 $contains "^package=$package$" $rsrc/Configure >/dev/null 2>&1
1440 : found it, so we are ok.
1443 for src in . .. ../.. ../../.. ../../../..; do
1444 if test -f ../$src/Configure && \
1445 $contains "^package=$package$" ../$src/Configure >/dev/null 2>&1
1456 Sorry, I can't seem to locate the source dir for $package. Please start
1457 Configure with an explicit path -- i.e. /some/path/Configure.
1465 echo "Sources for $package found in \"$src\"." >&4
1469 : script used to extract .SH files with variable substitutions
1470 cat >extract <<'EOS'
1472 echo "Doing variable substitutions on .SH files..."
1473 if test -f $src/MANIFEST; then
1474 set x `awk '{print $1}' <$src/MANIFEST | grep '\.SH$'`
1476 echo "(Looking for .SH files under the source directory.)"
1477 set x `(cd $src; find . -name "*.SH" -print)`
1481 0) set x `(cd $src; echo *.SH)`; shift;;
1483 if test ! -f $src/$1; then
1489 while test $name; do
1490 if test ! -d "$name"; then
1491 create="$name $create";
1492 name=`echo $name | sed -e "s|^[^/]*$||"`;
1493 name=`echo $name | sed -e "s|\(.*\)/.*|\1|"`;
1498 for file in $create; do
1507 dir=`expr X$file : 'X\(.*\)/'`
1508 file=`expr X$file : 'X.*/\(.*\)'`
1509 (cd $dir && . ./$file)
1519 dir=`expr X$file : 'X\(.*\)/'`
1520 file=`expr X$file : 'X.*/\(.*\)'`
1521 (set x $dir; shift; eval $mkdir_p)
1531 if test -f $src/config_h.SH; then
1532 if test ! -f config.h; then
1533 : oops, they left it out of MANIFEST, probably, so do it anyway.
1539 : extract files and exit if asked to do so
1540 case "$extractsh" in
1542 case "$realsilent" in
1546 case "$config_sh" in
1547 '') config_sh='config.sh';;
1550 echo "Fetching answers from $config_sh..."
1553 test "$override" && . ./optdef.sh
1562 : Eunice requires " " instead of "", can you believe it
1565 echo "Beginning of configuration questions for $package."
1567 trap 'echo " "; test -d ../UU && rm -rf X $rmlist; exit 1' 1 2 3 15
1569 : first determine how to suppress newline on echo command
1571 echo "Checking echo to see how to suppress newlines..."
1572 (echo "hi there\c" ; echo " ") >.echotmp
1573 if $contains c .echotmp >/dev/null 2>&1 ; then
1584 echo $n "The star should be here-->$c"
1588 : Now test for existence of everything in MANIFEST
1590 if test -f $rsrc/MANIFEST; then
1591 echo "First let's make sure your kit is complete. Checking..." >&4
1592 awk '$1 !~ /PACK[A-Z]+/ {print $1}' $rsrc/MANIFEST | split -50
1595 for filelist in x??; do
1596 (cd $rsrc; ls `cat $tmppwd/$filelist` >/dev/null 2>>$tmppwd/missing)
1598 if test -s missing; then
1602 THIS PACKAGE SEEMS TO BE INCOMPLETE.
1604 You have the option of continuing the configuration process, despite the
1605 distinct possibility that your kit is damaged, by typing 'y'es. If you
1606 do, don't blame me if something goes wrong. I advise you to type 'n'o
1607 and contact the author (perlbug@perl.org).
1610 echo $n "Continue? [n] $c" >&4
1614 echo "Continuing..." >&4
1618 echo "ABORTING..." >&4
1623 echo "Looks good..."
1626 echo "There is no MANIFEST file. I hope your kit is complete !"
1631 : Find the appropriate value for a newline for tr
1632 if test -n "$DJGPP"; then
1635 if test X"$trnl" = X; then
1636 case "`echo foo|tr '\n' x 2>/dev/null`" in
1640 if test X"$trnl" = X; then
1641 case "`echo foo|tr '\012' x 2>/dev/null`" in
1642 foox) trnl='\012' ;;
1645 if test X"$trnl" = X; then
1648 $me: Fatal Error: cannot figure out how to translate newlines with 'tr'.
1654 : compute the number of columns on the terminal for proper question formatting
1659 : set up the echo used in my read
1660 myecho="case \"\$xxxm\" in
1661 '') echo $n \"\$rp $c\" >&4;;
1663 '') echo $n \"[\$xxxm] $c\";;
1665 if test \`echo \"\$rp [\$xxxm] \" | wc -c\` -ge $COLUMNS; then
1667 echo $n \"[\$xxxm] $c\" >&4
1669 echo $n \"\$rp [\$xxxm] $c\" >&4
1675 : now set up to do reads with possible shell escape and default assignment
1681 case "\$fastread" in
1682 yes) case "\$dflt" in
1685 case "\$silent-\$rp" in
1690 *) case "\$silent" in
1691 true) case "\$rp" in
1696 while expr "X\$ans" : "X!" >/dev/null; do
1700 aok=''; eval "ans=\\"\$answ\\"" && aok=y
1708 set x \`expr "X\$ans" : "X!\(.*\)\$"\`
1717 set x \`expr "X\$ans" : "X&\(.*\)\$"\`
1722 echo "(OK, I'll run with -d after this question.)" >&4
1725 echo "*** Sorry, \$1 not supported yet." >&4
1735 echo "*** Substitution done -- please confirm."
1737 ans=\`echo $n "\$ans$c" | tr '$trnl' ' '\`
1742 echo "*** Error -- try again."
1749 case "\$ans\$xxxm\$nostick" in
1761 : create .config dir to save info across Configure sessions
1762 test -d ../.config || mkdir ../.config
1763 cat >../.config/README <<EOF
1764 This directory created by Configure to save information that should
1765 persist across sessions for $package.
1767 You may safely delete it if you wish.
1770 xversion=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
1772 $define|true|[yY]*) ;;
1773 *) case "$xversion" in
1776 *** WHOA THERE!!! ***
1778 This is an UNSTABLE DEVELOPMENT release.
1779 The version of this $package distribution is $xversion, that is, odd,
1780 (as opposed to even) and that signifies a development release.
1781 If you want a maintenance release, you want an even-numbered version.
1783 Do ***NOT*** install this into production use.
1784 Data corruption and crashes are possible.
1786 It is most seriously suggested that you do not continue any further
1787 unless you want to help in developing and debugging Perl.
1790 rp='Do you really want to continue?'
1794 [yY]) echo >&4 "Okay, continuing." ;;
1795 *) echo >&4 "Okay, bye."
1804 : general instructions
1807 user=`(logname) 2>/dev/null`
1809 '') user=`whoami 2>&1`;;
1811 if $contains "^$user\$" ../.config/instruct >/dev/null 2>&1; then
1814 rp='Would you like to see the instructions?'
1825 This installation shell script will examine your system and ask you questions
1826 to determine how the perl5 package should be installed. If you get
1827 stuck on a question, you may use a ! shell escape to start a subshell or
1828 execute a command. Many of the questions will have default answers in square
1829 brackets; typing carriage return will give you the default.
1831 On some of the questions which ask for file or directory names you are allowed
1832 to use the ~name construct to specify the login directory belonging to "name",
1833 even if you don't have a shell which knows about that. Questions where this is
1834 allowed will be marked "(~name ok)".
1838 dflt='Type carriage return to continue'
1842 The prompter used in this script allows you to use shell variables and
1843 backticks in your answers. You may use $1, $2, etc... to refer to the words
1844 in the default answer, as if the default line was a set of arguments given to a
1845 script shell. This means you may also use $* to repeat the whole default line,
1846 so you do not have to re-type everything to add something to the default.
1848 Everytime there is a substitution, you will have to confirm. If there is an
1849 error (e.g. an unmatched backtick), the default answer will remain unchanged
1850 and you will be prompted again.
1852 If you are in a hurry, you may run 'Configure -d'. This will bypass nearly all
1853 the questions and use the computed defaults (or the previous answers if there
1854 was already a config.sh file). Type 'Configure -h' for a list of options.
1855 You may also start interactively and then answer '& -d' at any prompt to turn
1856 on the non-interactive behaviour for the remainder of the execution.
1862 Much effort has been expended to ensure that this shell script will run on any
1863 Unix system. If despite that it blows up on yours, your best bet is to edit
1864 Configure and run it again. If you can't run Configure for some reason,
1865 you'll have to generate a config.sh file by hand. Whatever problems you
1866 have, let me (perlbug@perl.org) know how I blew it.
1868 This installation script affects things in two ways:
1870 1) it may do direct variable substitutions on some of the files included
1872 2) it builds a config.h file for inclusion in C programs. You may edit
1873 any of these files as the need arises after running this script.
1875 If you make a mistake on a question, there is no easy way to back up to it
1876 currently. The easiest thing to do is to edit config.sh and rerun all the SH
1877 files. Configure will offer to let you do this before it runs the SH files.
1880 dflt='Type carriage return to continue'
1882 case "$firsttime" in
1883 true) echo $user >>../.config/instruct;;
1887 : find out where common programs are
1889 echo "Locating common programs..." >&4
1902 if test -d \$dir/\$thing; then
1908 for thisthing in \$dir/\$thing; do
1909 : just loop through to pick last item
1911 if test -f \$thisthing; then
1914 elif test -f \$dir/\$thing.exe; then
1915 if test -n "$DJGPP"; then
1916 echo \$dir/\$thing.exe
1918 : on Eunice apparently
1968 pth=`echo $PATH | sed -e "s/$p_/ /g"`
1969 pth="$pth /lib /usr/lib"
1970 for file in $loclist; do
1974 if test -f "$xxx"; then
1977 echo "WARNING: no $xxx -- ignoring your setting for $file." >&4
1978 xxx=`./loc $file $file $pth`
1981 '') xxx=`./loc $file $file $pth`;;
1982 *) xxx=`./loc $xxx $xxx $pth`;;
1988 echo $file is in $xxx.
1991 echo $file is in $xxx.
1994 echo "I don't know where '$file' is, and my life depends on it." >&4
1995 echo "Go find a public domain implementation or fix your PATH setting!" >&4
2001 echo "Don't worry if any of the following aren't found..."
2003 for file in $trylist; do
2007 if test -f "$xxx"; then
2010 echo "WARNING: no $xxx -- ignoring your setting for $file." >&4
2011 xxx=`./loc $file $file $pth`
2014 '') xxx=`./loc $file $file $pth`;;
2015 *) xxx=`./loc $xxx $xxx $pth`;;
2021 echo $file is in $xxx.
2024 echo $file is in $xxx.
2027 echo "I don't see $file out there, $say."
2034 echo "Substituting grep for egrep."
2040 echo "Substituting cp for ln."
2046 echo "Hopefully test is built into your sh."
2049 if `sh -c "PATH= test true" >/dev/null 2>&1`; then
2050 echo "Using the test built into your sh."
2058 echo "Hopefully echo is built into your sh."
2063 echo "Checking compatibility between $echo and builtin echo (if any)..." >&4
2064 $echo $n "hi there$c" >foo1
2065 echo $n "hi there$c" >foo2
2066 if cmp foo1 foo2 >/dev/null 2>&1; then
2067 echo "They are compatible. In fact, they may be identical."
2074 They are not compatible! You are probably running ksh on a non-USG system.
2075 I'll have to use $echo instead of the builtin, since Bourne shell doesn't
2076 have echo built in and we may have to run some Bourne shell scripts. That
2077 means I'll have to use '$n$c' to suppress newlines now. Life is ridiculous.
2080 $echo $n "The star should be here-->$c"
2090 cat <<'EOSC' >>checkcc
2095 int main(int argc, char *argv[]) {
2099 if $cc -o try try.c; then
2102 echo "Uh-oh, the C compiler '$cc' doesn't seem to be working." >&4
2108 case "`$cc -v -c try.c 2>&1`" in
2111 if $test X"$trygcc" = Xyes; then
2112 if gcc -o try -c try.c; then
2114 echo "You seem to have a working gcc, though." >&4
2115 rp="Would you like to use it?"
2117 if $test -f myread; then
2120 if $test -f UU/myread; then
2123 echo "Cannot find myread, sorry. Aborting." >&2
2128 [yY]*) cc=gcc; ccname=gcc; ccflags=''; despair=no ;;
2132 if $test X"$despair" = Xyes; then
2133 echo "You need to find a working C compiler." >&4
2134 echo "I cannot continue any further, aborting." >&4
2143 : determine whether symbolic links are supported
2146 if $ln -s blurfl sym > /dev/null 2>&1 ; then
2147 echo "Symbolic links are supported." >&4
2150 echo "Symbolic links are NOT supported." >&4
2155 : see whether [:lower:] and [:upper:] are supported character classes
2157 case "`echo AbyZ | $tr '[:lower:]' '[:upper:]' 2>/dev/null`" in
2159 echo "Good, your tr supports [:lower:] and [:upper:] to convert case." >&4
2163 *) # There is a discontinuity in EBCDIC between 'I' and 'J'
2164 # (0xc9 and 0xd1), therefore that is a nice testing point.
2165 if test "X$up" = X -o "X$low" = X; then
2166 case "`echo IJ | $tr '[I-J]' '[i-j]' 2>/dev/null`" in
2172 if test "X$up" = X -o "X$low" = X; then
2173 case "`echo IJ | $tr I-J i-j 2>/dev/null`" in
2179 if test "X$up" = X -o "X$low" = X; then
2180 case "`echo IJ | od -x 2>/dev/null`" in
2182 echo "Hey, this might be EBCDIC." >&4
2183 if test "X$up" = X -o "X$low" = X; then
2184 case "`echo IJ | $tr '[A-IJ-RS-Z]' '[a-ij-rs-z]' 2>/dev/null`" in
2185 ij) up='[A-IJ-RS-Z]'
2190 if test "X$up" = X -o "X$low" = X; then
2191 case "`echo IJ | $tr A-IJ-RS-Z a-ij-rs-z 2>/dev/null`" in
2201 case "`echo IJ | $tr \"$up\" \"$low\" 2>/dev/null`" in
2203 echo "Using $up and $low to convert case." >&4
2206 echo "I don't know how to translate letters from upper to lower case." >&4
2207 echo "Your tr is not acting any way I know of." >&4
2211 : set up the translation script tr, must be called with ./tr of course
2215 '[A-Z][a-z]') exec $tr '$up' '$low';;
2216 '[a-z][A-Z]') exec $tr '$low' '$up';;
2223 : Try to determine whether config.sh was made on this system
2224 case "$config_sh" in
2226 myuname=`$uname -a 2>/dev/null`
2227 $test -z "$myuname" && myuname=`hostname 2>/dev/null`
2228 # tr '[A-Z]' '[a-z]' would not work in EBCDIC
2229 # because the A-Z/a-z are not consecutive.
2230 myuname=`echo $myuname | $sed -e 's/^[^=]*=//' -e 's/\///g' | \
2231 ./tr '[A-Z]' '[a-z]' | $tr $trnl ' '`
2232 newmyuname="$myuname"
2234 case "$knowitall" in
2236 if test -f ../config.sh; then
2237 if $contains myuname= ../config.sh >/dev/null 2>&1; then
2238 eval "`grep myuname= ../config.sh`"
2240 if test "X$myuname" = "X$newmyuname"; then
2248 : Get old answers from old config file if Configure was run on the
2249 : same system, otherwise use the hints.
2252 if test -f config.sh; then
2254 rp="I see a config.sh file. Shall I use it to set the defaults?"
2257 n*|N*) echo "OK, I'll ignore it."; mv config.sh config.sh.old;;
2258 *) echo "Fetching default answers from your old config.sh file..." >&4
2266 : Older versions did not always set $sh. Catch re-use of such
2276 if test ! -f config.sh; then
2279 First time through, eh? I have some defaults handy for some systems
2280 that need some extra help getting the Configure answers right:
2283 (cd $src/hints; ls -C *.sh) | $sed 's/\.sh/ /g' >&4
2285 : Half the following guesses are probably wrong... If you have better
2286 : tests or hints, please send them to perlbug@perl.org
2287 : The metaconfig authors would also appreciate a copy...
2288 $test -f /irix && osname=irix
2289 $test -f /xenix && osname=sco_xenix
2290 $test -f /dynix && osname=dynix
2291 $test -f /dnix && osname=dnix
2292 $test -f /lynx.os && osname=lynxos
2293 $test -f /unicos && osname=unicos && osvers=`$uname -r`
2294 $test -f /unicosmk && osname=unicosmk && osvers=`$uname -r`
2295 $test -f /unicosmk.ar && osname=unicosmk && osvers=`$uname -r`
2296 $test -f /bin/mips && /bin/mips && osname=mips
2297 $test -d /NextApps && set X `hostinfo | grep 'NeXT Mach.*:' | \
2298 $sed -e 's/://' -e 's/\./_/'` && osname=next && osvers=$4
2299 $test -d /usr/apollo/bin && osname=apollo
2300 $test -f /etc/saf/_sactab && osname=svr4
2301 $test -d /usr/include/minix && osname=minix
2302 if $test -d /MachTen -o -d /MachTen_Folder; then
2304 if $test -x /sbin/version; then
2305 osvers=`/sbin/version | $awk '{print $2}' |
2306 $sed -e 's/[A-Za-z]$//'`
2307 elif $test -x /usr/etc/version; then
2308 osvers=`/usr/etc/version | $awk '{print $2}' |
2309 $sed -e 's/[A-Za-z]$//'`
2315 $test -f /sys/posix.dll &&
2316 $test -f /usr/bin/what &&
2317 set X `/usr/bin/what /sys/posix.dll` &&
2318 $test "$3" = UWIN &&
2322 if $test -f $uname; then
2330 umips) osname=umips ;;
2333 [23]100) osname=mips ;;
2334 next*) osname=next ;;
2336 tmp=`/bin/uname -X 2>/dev/null|awk '/3\.2v[45]/{ print $(NF) }'`
2337 if $test "$tmp" != "" -a "$3" = "3.2" -a -f '/etc/systemid'; then
2340 elif $test -f /etc/kconfig; then
2342 if test "$lns" = "$ln -s"; then
2344 elif $contains _SYSV3 /usr/include/stdio.h > /dev/null 2>&1 ; then
2346 elif $contains _POSIX_SOURCE /usr/include/stdio.h > /dev/null 2>&1 ; then
2353 if test -n "$DJGPP"; then
2362 tmp=`( (oslevel) 2>/dev/null || echo "not found") 2>&1`
2364 'not found') osvers="$4"."$3" ;;
2365 '<3240'|'<>3240') osvers=3.2.0 ;;
2366 '=3240'|'>3240'|'<3250'|'<>3250') osvers=3.2.4 ;;
2367 '=3250'|'>3250') osvers=3.2.5 ;;
2371 bsd386) osname=bsd386
2374 cygwin*) osname=cygwin
2377 *dc.osx) osname=dcosx
2383 domainos) osname=apollo
2389 dynixptx*) osname=dynixptx
2390 osvers=`echo "$4"|sed 's/^v//'`
2392 freebsd) osname=freebsd
2394 genix) osname=genix ;;
2396 osvers=`echo "$3" | $sed 's,.*\.\([0-9]*\.[0-9]*\),\1,'`
2412 netbsd*) osname=netbsd
2415 news-os) osvers="$3"
2417 4*) osname=newsos4 ;;
2421 next*) osname=next ;;
2422 POSIX-BC | posix-bc ) osname=posix-bc
2425 powerux | power_ux | powermax_os | powermaxos | \
2426 powerunix | power_unix) osname=powerux
2432 solaris) osname=solaris
2434 5*) osvers=`echo $3 | $sed 's/^5/2/g'` ;;
2441 osvers=`echo $3 | $sed 's/^5/2/g'` ;;
2445 titanos) osname=titanos
2454 ultrix) osname=ultrix
2457 osf1|mls+) case "$5" in
2460 osvers=`sizer -v | awk '{print $3}' | tr '[A-Z]' '[a-z]' | sed 's/^[xvt]//'`
2463 *) osvers=`echo "$3" | sed 's/^[xvt]//'` ;;
2466 hp*) osname=hp_osf1 ;;
2467 mips) osname=mips_osf1 ;;
2470 unixware) osname=svr5
2476 $2) case "$osname" in
2480 : svr4.x or possibly later
2490 if test -f /stand/boot ; then
2491 eval `grep '^INITPROG=[a-z/0-9]*$' /stand/boot`
2492 if test -n "$INITPROG" -a -f "$INITPROG"; then
2493 isesix=`strings -a $INITPROG|grep 'ESIX SYSTEM V/386 Release 4.0'`
2494 if test -n "$isesix"; then
2502 *) if test -f /etc/systemid; then
2504 set `echo $3 | $sed 's/\./ /g'` $4
2505 if $test -f $src/hints/sco_$1_$2_$3.sh; then
2507 elif $test -f $src/hints/sco_$1_$2.sh; then
2509 elif $test -f $src/hints/sco_$1.sh; then
2514 '') : Still unknown. Probably a generic Sys V.
2523 *) case "$osname" in
2524 '') : Still unknown. Probably a generic BSD.
2532 if test -f /vmunix -a -f $src/hints/news_os.sh; then
2533 (what /vmunix | UU/tr '[A-Z]' '[a-z]') > UU/kernel.what 2>&1
2534 if $contains news-os UU/kernel.what >/dev/null 2>&1; then
2537 $rm -f UU/kernel.what
2538 elif test -d c:/.; then
2545 : Now look for a hint file osname_osvers, unless one has been
2546 : specified already.
2549 file=`echo "${osname}_${osvers}" | $sed -e 's%\.%_%g' -e 's%_$%%'`
2550 : Also try without trailing minor version numbers.
2551 xfile=`echo $file | $sed -e 's%_[^_]*$%%'`
2552 xxfile=`echo $xfile | $sed -e 's%_[^_]*$%%'`
2553 xxxfile=`echo $xxfile | $sed -e 's%_[^_]*$%%'`
2554 xxxxfile=`echo $xxxfile | $sed -e 's%_[^_]*$%%'`
2557 *) case "$osvers" in
2560 *) if $test -f $src/hints/$file.sh ; then
2562 elif $test -f $src/hints/$xfile.sh ; then
2564 elif $test -f $src/hints/$xxfile.sh ; then
2566 elif $test -f $src/hints/$xxxfile.sh ; then
2568 elif $test -f $src/hints/$xxxxfile.sh ; then
2570 elif $test -f "$src/hints/${osname}.sh" ; then
2579 if $test -f Policy.sh ; then
2582 none) dflt="Policy" ;;
2583 *) dflt="Policy $dflt" ;;
2588 dflt=`echo $hintfile | $sed 's/\.sh$//'`
2592 if $test -f Policy.sh ; then
2595 There's also a Policy hint file available, which should make the
2596 site-specific (policy) questions easier to answer.
2603 You may give one or more space-separated answers, or "none" if appropriate.
2604 A well-behaved OS will have no hints, so answering "none" or just "Policy"
2605 is a good thing. DO NOT give a wrong version or a wrong OS.
2609 rp="Which of these apply, if any?"
2612 for file in $tans; do
2613 if $test X$file = XPolicy -a -f Policy.sh; then
2615 $cat Policy.sh >> UU/config.sh
2616 elif $test -f $src/hints/$file.sh; then
2617 . $src/hints/$file.sh
2618 $cat $src/hints/$file.sh >> UU/config.sh
2619 elif $test X$tans = X -o X$tans = Xnone ; then
2622 : Give one chance to correct a possible typo.
2623 echo "$file.sh does not exist"
2625 rp="hint to use instead?"
2627 for file in $ans; do
2628 if $test -f "$src/hints/$file.sh"; then
2629 . $src/hints/$file.sh
2630 $cat $src/hints/$file.sh >> UU/config.sh
2631 elif $test X$ans = X -o X$ans = Xnone ; then
2634 echo "$file.sh does not exist -- ignored."
2641 : Remember our hint file for later.
2642 if $test -f "$src/hints/$file.sh" ; then
2652 echo "Fetching default answers from $config_sh..." >&4
2656 cp $config_sh config.sh 2>/dev/null
2666 test "$override" && . ./optdef.sh
2667 myuname="$newmyuname"
2669 : Restore computed paths
2670 for file in $loclist $trylist; do
2671 eval $file="\$_$file"
2676 Configure uses the operating system name and version to set some defaults.
2677 The default value is probably right if the name rings a bell. Otherwise,
2678 since spelling matters for me, either accept the default or answer "none"
2685 ''|' '|none) dflt=none ;;
2686 *) dflt=`echo $hintfile | $sed -e 's/\.sh$//' -e 's/_.*$//'` ;;
2689 *) dflt="$osname" ;;
2691 rp="Operating system name?"
2695 *) osname=`echo "$ans" | $sed -e 's/[ ][ ]*/_/g' | ./tr '[A-Z]' '[a-z]'`;;
2701 ''|' '|none) dflt=none ;;
2702 *) dflt=`echo $hintfile | $sed -e 's/\.sh$//' -e 's/^[^_]*//'`
2703 dflt=`echo $dflt | $sed -e 's/^_//' -e 's/_/./g'`
2705 ''|' ') dflt=none ;;
2710 *) dflt="$osvers" ;;
2712 rp="Operating system version?"
2722 : who configured the system
2723 cf_time=`LC_ALL=C; LANGUAGE=C; export LC_ALL; export LANGUAGE; $date 2>&1`
2724 cf_by=`(logname) 2>/dev/null`
2727 cf_by=`(whoami) 2>/dev/null`
2729 "") cf_by=unknown ;;
2733 : set up the script used to warn in case of inconsistency
2740 echo "*** WHOA THERE!!! ***" >&4
2741 echo " The $hint value for \$$var on this machine was \"$was\"!" >&4
2742 rp=" Keep the $hint value?"
2745 y) td=$was; tu=$was;;
2749 : function used to set $1 to $val
2750 setvar='var=$1; eval "was=\$$1"; td=$define; tu=$undef;
2752 $define$undef) . ./whoa; eval "$var=\$td";;
2753 $undef$define) . ./whoa; eval "$var=\$tu";;
2754 *) eval "$var=$val";;
2757 case "$usethreads" in
2758 $define|true|[yY]*) dflt='y';;
2763 Perl can be built to take advantage of threads on some systems.
2764 To do so, Configure can be run with -Dusethreads.
2766 Note that threading is a highly experimental feature, and
2767 some known race conditions still remain. If you choose to try
2768 it, be very sure to not actually deploy it for production
2769 purposes. README.threads has more details, and is required
2770 reading if you enable threads.
2772 If this doesn't make any sense to you, just accept the default '$dflt'.
2774 rp='Build a threading Perl?'
2777 y|Y) val="$define" ;;
2783 case "$usethreads" in
2787 As of 5.5.640, Perl has two different internal threading implementations,
2788 the 5.005 version (5005threads) and an interpreter-based version
2789 (ithreads) that has one interpreter per thread. Both are very
2790 experimental. This arrangement exists to help developers work out
2791 which one is better.
2793 If you're a casual user, you probably don't want interpreter-threads
2794 at this time. There doesn't yet exist a way to create threads from
2795 within Perl in this model, i.e., "use Thread;" will NOT work.
2797 : Default to ithreads unless overridden on command line or with
2800 case "$use5005threads" in
2801 $define|true|[yY]*) dflt='n';;
2803 case "$useithreads" in
2804 $undef|false|[nN]*) dflt='n';;
2806 rp='Use interpreter-based ithreads?'
2809 y|Y) val="$define" ;;
2814 : Now set use5005threads to the opposite value.
2815 case "$useithreads" in
2816 $define) val="$undef" ;;
2823 useithreads="$undef"
2824 use5005threads="$undef"
2828 case "$d_oldpthreads" in
2829 '') : Configure tests would be welcome here. For now, assume undef.
2831 *) val="$d_oldpthreads" ;;
2837 case "$usethreads" in
2838 "$define"|true|[yY]*)
2839 : Look for a hint-file generated 'call-back-unit'. If the
2840 : user has specified that a threading perl is to be built,
2841 : we may need to set or change some other defaults.
2842 if $test -f usethreads.cbu; then
2843 echo "Your platform has some specific hints for threaded builds, using them..."
2847 (Your platform doesn't have any specific hints for threaded builds.
2848 Assuming POSIX threads, then.)
2856 Perl can be built so that multiple Perl interpreters can coexist
2857 within the same Perl executable.
2860 case "$useithreads" in
2863 This multiple interpreter support is required for interpreter-based threads.
2867 *) case "$usemultiplicity" in
2868 $define|true|[yY]*) dflt='y';;
2872 echo "If this doesn't make any sense to you, just accept the default '$dflt'."
2873 rp='Build Perl for multiplicity?'
2876 y|Y) val="$define" ;;
2884 : make some quick guesses about what we are up against
2886 $echo $n "Hmm... $c"
2896 $cat /usr/include/signal.h /usr/include/sys/signal.h >foo 2>/dev/null
2897 if test -f /osf_boot || $contains 'OSF/1' /usr/include/ctype.h >/dev/null 2>&1
2899 echo "Looks kind of like an OSF/1 system, but we'll see..."
2901 elif test `echo abc | tr a-z A-Z` = Abc ; then
2902 xxx=`./loc addbib blurfl $pth`
2903 if $test -f $xxx; then
2904 echo "Looks kind of like a USG system with BSD features, but we'll see..."
2908 if $contains SIGTSTP foo >/dev/null 2>&1 ; then
2909 echo "Looks kind of like an extended USG system, but we'll see..."
2911 echo "Looks kind of like a USG system, but we'll see..."
2915 elif $contains SIGTSTP foo >/dev/null 2>&1 ; then
2916 echo "Looks kind of like a BSD system, but we'll see..."
2920 echo "Looks kind of like a Version 7 system, but we'll see..."
2923 case "$eunicefix" in
2926 There is, however, a strange, musty smell in the air that reminds me of
2927 something...hmm...yes...I've got it...there's a VMS nearby, or I'm a Blit.
2931 : it so happens the Eunice I know will not run shell scripts in Unix format
2935 echo "Congratulations. You aren't running Eunice."
2939 : Detect OS2. The p_ variable is set above in the Head.U unit.
2940 : Note that this also -- wrongly -- detects e.g. dos-djgpp, which also uses
2941 : semicolon as a patch separator
2946 I have the feeling something is not exactly right, however...don't tell me...
2947 lemme think...does HAL ring a bell?...no, of course, you're only running OS/2!
2948 (Or you may be running DOS with DJGPP.)
2953 if test -f /xenix; then
2954 echo "Actually, this looks more like a XENIX system..."
2959 echo "It's not Xenix..."
2964 if test -f /venix; then
2965 echo "Actually, this looks more like a VENIX system..."
2972 echo "Nor is it Venix..."
2975 chmod +x bsd usg v7 osf1 eunice xenix venix os2
2976 $eunicefix bsd usg v7 osf1 eunice xenix venix os2
2983 rp="Use which C compiler?"
2986 : Look for a hint-file generated 'call-back-unit'. Now that the
2987 : user has specified the compiler, we may need to set or change some
2989 if $test -f cc.cbu; then
2995 echo "Checking for GNU cc in disguise and/or its version number..." >&4
2996 $cat >gccvers.c <<EOM
3001 printf("%s\n", __VERSION__);
3003 printf("%s\n", "1");
3009 if $cc $ldflags -o gccvers gccvers.c; then
3010 gccversion=`./gccvers`
3011 case "$gccversion" in
3012 '') echo "You are not using GNU cc." ;;
3013 *) echo "You are using GNU cc $gccversion."
3019 echo "*** WHOA THERE!!! ***" >&4
3020 echo " Your C compiler \"$cc\" doesn't seem to be working!" >&4
3021 case "$knowitall" in
3023 echo " You'd better start hunting for one and let me know about it." >&4
3029 case "$gccversion" in
3030 1*) cpp=`./loc gcc-cpp $cpp $pth` ;;
3032 case "$gccversion" in
3033 '') gccosandvers='' ;;
3034 *) gccshortvers=`echo "$gccversion"|sed 's/ .*//'`
3035 gccosandvers=`$cc -v 2>&1|grep '/specs$'|sed "s!.*/[^-/]*-[^-/]*-\([^-/]*\)/$gccshortvers/specs!\1!"`
3037 case "$gccosandvers" in
3038 $osname) gccosandvers='' ;; # linux gccs seem to have no linux osvers, grr
3039 $osname$osvers) ;; # looking good
3040 $osname*) cat <<EOM >&4
3042 *** WHOA THERE!!! ***
3044 Your gcc has not been compiled for the exact release of
3045 your operating system ($gccosandvers versus $osname$osvers).
3047 In general it is a good idea to keep gcc synchronized with
3048 the operating system because otherwise serious problems
3049 may ensue when trying to compile software, like Perl.
3051 I'm trying to be optimistic here, though, and will continue.
3052 If later during the configuration and build icky compilation
3053 problems appear (headerfile conflicts being the most common
3054 manifestation), I suggest reinstalling the gcc to match
3055 your operating system release.
3059 *) gccosandvers='' ;; # failed to parse, better be silent
3067 : see how we invoke the C preprocessor
3069 echo "Now, how can we feed standard input to your C preprocessor..." >&4
3070 cat <<'EOT' >testcpp.c
3076 if test ! -f cppstdin; then
3077 if test "X$osname" = "Xaix" -a "X$gccversion" = X; then
3078 # AIX cc -E doesn't show the absolute headerfile
3079 # locations but we'll cheat by using the -M flag.
3080 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
3082 echo 'cat >.$$.c; '"$cc"' -E ${1+"$@"} .$$.c; rm .$$.c' >cppstdin
3085 echo "Keeping your $hint cppstdin wrapper."
3088 wrapper=`pwd`/cppstdin
3092 if $test "X$cppstdin" != "X" && \
3093 $cppstdin $cppminus <testcpp.c >testcpp.out 2>&1 && \
3094 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
3096 echo "You used to use $cppstdin $cppminus so we'll use that again."
3098 '') echo "But let's see if we can live without a wrapper..." ;;
3100 if $cpprun $cpplast <testcpp.c >testcpp.out 2>&1 && \
3101 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
3103 echo "(And we'll use $cpprun $cpplast to preprocess directly.)"
3106 echo "(However, $cpprun $cpplast does not work, let's see...)"
3114 echo "Good old $cppstdin $cppminus does not seem to be of any help..."
3121 elif echo 'Maybe "'"$cc"' -E" will work...'; \
3122 $cc -E <testcpp.c >testcpp.out 2>&1; \
3123 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3124 echo "Yup, it does."
3127 elif echo 'Nope...maybe "'"$cc"' -E -" will work...'; \
3128 $cc -E - <testcpp.c >testcpp.out 2>&1; \
3129 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3130 echo "Yup, it does."
3133 elif echo 'Nope...maybe "'"$cc"' -P" will work...'; \
3134 $cc -P <testcpp.c >testcpp.out 2>&1; \
3135 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3136 echo "Yipee, that works!"
3139 elif echo 'Nope...maybe "'"$cc"' -P -" will work...'; \
3140 $cc -P - <testcpp.c >testcpp.out 2>&1; \
3141 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3142 echo "At long last!"
3145 elif echo 'No such luck, maybe "'$cpp'" will work...'; \
3146 $cpp <testcpp.c >testcpp.out 2>&1; \
3147 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3151 elif echo 'Nixed again...maybe "'$cpp' -" will work...'; \
3152 $cpp - <testcpp.c >testcpp.out 2>&1; \
3153 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3154 echo "Hooray, it works! I was beginning to wonder."
3157 elif echo 'Uh-uh. Time to get fancy. Trying a wrapper...'; \
3158 $wrapper <testcpp.c >testcpp.out 2>&1; \
3159 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3165 rp="No dice. I can't find a C preprocessor. Name one:"
3169 $x_cpp <testcpp.c >testcpp.out 2>&1
3170 if $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3171 echo "OK, that will do." >&4
3173 echo "Sorry, I can't get that to work. Go find one and rerun Configure." >&4
3188 echo "Perhaps can we force $cc -E using a wrapper..."
3189 if $wrapper <testcpp.c >testcpp.out 2>&1; \
3190 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
3196 echo "Nope, we'll have to live without it..."
3210 "$wrapper"|'cppstdin') ;;
3211 *) $rm -f $wrapper;;
3213 $rm -f testcpp.c testcpp.out
3215 : decide how portable to be. Allow command line overrides.
3216 case "$d_portable" in
3218 *) d_portable="$define" ;;
3221 : set up shell script to do ~ expansion
3227 echo \$1 | $sed "s|~|\${HOME-\$LOGDIR}|"
3230 if $test -f /bin/csh; then
3231 /bin/csh -f -c "glob \$1"
3236 name=\`$expr x\$1 : '..\([^/]*\)'\`
3237 dir=\`$sed -n -e "/^\${name}:/{s/^[^:]*:[^:]*:[^:]*:[^:]*:[^:]*:\([^:]*\).*"'\$'"/\1/" -e p -e q -e '}' </etc/passwd\`
3238 if $test ! -d "\$dir"; then
3240 echo "\$me: can't locate home directory for: \$name" >&2
3245 echo \$dir/\`$expr x\$1 : '..[^/]*/\(.*\)'\`
3261 : now set up to get a file name
3265 cat <<'EOSC' >>getfile
3281 expr $fn : '.*(\(.*\)).*' | tr ',' $trnl >getfile.ok
3282 fn=`echo $fn | sed 's/(.*)//'`
3288 loc_file=`expr $fn : '.*:\(.*\)'`
3289 fn=`expr $fn : '\(.*\):.*'`
3297 */*) fullpath=true;;
3306 *e*) exp_file=true;;
3309 *p*) nopath_ok=true;;
3314 *d*) type='Directory';;
3315 *l*) type='Locate';;
3320 Locate) what='File';;
3325 case "$d_portable" in
3333 while test "$type"; do
3338 true) rp="$rp (~name ok)";;
3341 if test -f UU/getfile.ok && \
3342 $contains "^$ans\$" UU/getfile.ok >/dev/null 2>&1
3361 value=`UU/filexp $ans`
3364 if test "$ans" != "$value"; then
3365 echo "(That expands to $value on this system.)"
3379 /*) value="$ansexp" ;;
3380 [a-zA-Z]:/*) value="$ansexp" ;;
3385 echo "I shall only accept a full path name, as in /bin/ls." >&4
3386 echo "Use a ! shell escape if you wish to check pathnames." >&4
3389 echo "Please give a full path name, starting with slash." >&4
3392 echo "Note that using ~name is ok provided it expands well." >&4
3405 for fp in $gfpth; do
3406 if test "X$fp" = X.; then
3411 if test -f "$pf"; then
3413 elif test -r "$pf" || (test -h "$pf") >/dev/null 2>&1
3415 echo "($value is not a plain file, but that's ok.)"
3418 if test X"$type" = X; then
3425 for fp in $gfpth; do
3426 if test "X$fp" = X.; then
3431 direxp="$fp/$ansexp"
3433 if test -d "$direxp"; then
3441 if test -d "$ansexp"; then
3442 echo "(Looking for $loc_file in directory $value.)"
3443 value="$value/$loc_file"
3444 ansexp="$ansexp/$loc_file"
3446 if test -f "$ansexp"; then
3449 case "$nopath_ok" in
3450 true) case "$value" in
3452 *) echo "Assuming $value will be in people's path."
3468 if test "$fastread" = yes; then
3473 rp="$what $value doesn't exist. Use that name anyway?"
3492 test "X$gfpthkeep" != Xy && gfpth=""
3495 : What should the include directory be ?
3497 $echo $n "Hmm... $c"
3501 if $test -f /bin/mips && /bin/mips; then
3502 echo "Looks like a MIPS system..."
3503 $cat >usr.c <<'EOCP'
3504 #ifdef SYSTYPE_BSD43
3508 if cc -E usr.c > usr.out && $contains / usr.out >/dev/null 2>&1; then
3509 dflt='/bsd43/usr/include'
3513 mips_type='System V'
3515 $rm -f usr.c usr.out
3516 echo "and you're compiling with the $mips_type compiler and libraries."
3520 echo "Doesn't look like a MIPS system."
3530 case "$xxx_prompt" in
3533 rp='Where are the include files you want to use?'
3541 : Set private lib path
3544 plibpth="$incpath/usr/lib /usr/local/lib /usr/ccs/lib"
3549 '') dlist="$loclibpth $plibpth $glibpth";;
3550 *) dlist="$libpth";;
3553 : Now check and see which directories actually exist, avoiding duplicates
3557 if $test -d $xxx; then
3560 *) libpth="$libpth $xxx";;
3566 Some systems have incompatible or broken versions of libraries. Among
3567 the directories listed in the question below, please remove any you
3568 know not to be holding relevant libraries, and add any that are needed.
3569 Say "none" for none.
3580 rp="Directories to use for library searches?"
3587 : compute shared library extension
3590 if xxx=`./loc libc.sl X $libpth`; $test -f "$xxx"; then
3600 On some systems, shared libraries may be available. Answer 'none' if
3601 you want to suppress searching of shared libraries for the remainder
3602 of this configuration.
3605 rp='What is the file extension used for shared libraries?'
3609 : Define several unixisms.
3610 : Hints files or command line option can be used to override them.
3611 : The convoluted testing is in case hints files set either the old
3614 '') case "$exe_ext" in
3616 *) _exe="$exe_ext" ;;
3621 '') case "$lib_ext" in
3628 '') case "$obj_ext" in
3635 '') case "$path_sep" in
3646 : Which makefile gets called first. This is used by make depend.
3647 case "$firstmakefile" in
3648 '') firstmakefile='makefile';;
3652 $define|true|[yY]*) dflt='y';;
3657 Perl can be built to use the SOCKS proxy protocol library. To do so,
3658 Configure must be run with -Dusesocks.
3660 If this doesn't make any sense to you, just accept the default '$dflt'.
3662 rp='Build Perl for SOCKS?'
3665 y|Y) val="$define" ;;
3671 : Looking for optional libraries
3673 echo "Checking for optional libraries..." >&4
3678 case "$libswanted" in
3679 '') libswanted='c_s';;
3682 "$define") libswanted="$libswanted socks5 socks5_sh" ;;
3688 for thisdir in $libpth $xlibpth; do
3689 test -d $thisdir && libspath="$libspath $thisdir"
3691 for thislib in $libswanted; do
3692 for thisdir in $libspath; do
3694 if $test ! -f "$xxx" -a "X$ignore_versioned_solibs" = "X"; then
3695 xxx=`ls $thisdir/lib$thislib.$so.[0-9] 2>/dev/null|tail -1`
3696 $test -f "$xxx" && eval $libscheck
3697 $test -f "$xxx" && libstyle=shared
3699 if test ! -f "$xxx"; then
3700 xxx=$thisdir/lib$thislib.$so
3701 $test -f "$xxx" && eval $libscheck
3702 $test -f "$xxx" && libstyle=shared
3704 if test ! -f "$xxx"; then
3705 xxx=$thisdir/lib$thislib$_a
3706 $test -f "$xxx" && eval $libscheck
3707 $test -f "$xxx" && libstyle=static
3709 if test ! -f "$xxx"; then
3710 xxx=$thisdir/$thislib$_a
3711 $test -f "$xxx" && eval $libscheck
3712 $test -f "$xxx" && libstyle=static
3714 if test ! -f "$xxx"; then
3715 xxx=$thisdir/lib${thislib}_s$_a
3716 $test -f "$xxx" && eval $libscheck
3717 $test -f "$xxx" && libstyle=static
3718 $test -f "$xxx" && thislib=${thislib}_s
3720 if test ! -f "$xxx"; then
3721 xxx=$thisdir/Slib$thislib$_a
3722 $test -f "$xxx" && eval $libscheck
3723 $test -f "$xxx" && libstyle=static
3725 if $test -f "$xxx"; then
3727 shared) echo "Found -l$thislib (shared)." ;;
3728 static) echo "Found -l$thislib." ;;
3729 *) echo "Found -l$thislib ($libstyle)." ;;
3733 *) dflt="$dflt -l$thislib"
3734 libsfound="$libsfound $xxx"
3736 libsfiles="$libsfiles $yyy"
3737 yyy=`echo $xxx|$sed -e "s%/$yyy\\$%%"`
3738 case " $libsdirs " in
3740 *) libsdirs="$libsdirs $yyy" ;;
3747 if $test ! -f "$xxx"; then
3748 echo "No -l$thislib."
3759 ' '|'') dflt='none';;
3764 In order to compile $package on your machine, a number of libraries
3765 are usually needed. Include any other special libraries here as well.
3766 Say "none" for none. The default list is almost always right.
3770 rp="What libraries to use?"
3777 : determine optimization, if desired, or use for debug flag also
3779 ' '|$undef) dflt='none';;
3781 *) dflt="$optimize";;
3785 By default, $package compiles with the -O flag to use the optimizer.
3786 Alternately, you might want to use the symbolic debugger, which uses
3787 the -g flag (on traditional Unix systems). Either flag can be
3788 specified here. To use neither flag, specify the word "none".
3791 rp="What optimizer/debugger flag should be used?"
3795 'none') optimize=" ";;
3799 : We will not override a previous value, but we might want to
3800 : augment a hint file
3802 default|recommended)
3803 case "$gccversion" in
3804 1*) dflt='-fpcc-struct-return' ;;
3807 *-g*) dflt="$dflt -DDEBUGGING";;
3809 case "$gccversion" in
3810 2*) if test -d /etc/conf/kconfig.d &&
3811 $contains _POSIX_VERSION $usrinc/sys/unistd.h >/dev/null 2>&1
3817 case "$gccversion" in
3821 echo "Checking if your compiler accepts -fno-strict-aliasing" 2>&1
3822 echo 'int main(void) { return 0; }' > gcctest.c
3823 if $cc -O2 -fno-strict-aliasing -o gcctest gcctest.c; then
3824 echo "Yes, it does." 2>&1
3827 echo "Leaving current flags $ccflags alone." 2>&1
3829 *) dflt="$dflt -fno-strict-aliasing" ;;
3832 echo "Nope, it doesn't, but that's ok." 2>&1
3839 case "$mips_type" in
3840 *BSD*|'') inclwanted="$locincpth $usrinc";;
3841 *) inclwanted="$locincpth $inclwanted $usrinc/bsd";;
3843 for thisincl in $inclwanted; do
3844 if $test -d $thisincl; then
3845 if $test x$thisincl != x$usrinc; then
3847 *" -I$thisincl "*);;
3848 *) dflt="$dflt -I$thisincl ";;
3854 inctest='if $contains $2 $usrinc/$1 >/dev/null 2>&1; then
3856 elif $contains $2 $usrinc/sys/$1 >/dev/null 2>&1; then
3864 *) dflt="$dflt -D$2";;
3868 set signal.h LANGUAGE_C; eval $inctest
3872 ccflags="$ccflags -DSOCKS"
3877 default|recommended) dflt="$ccflags $dflt" ;;
3878 *) dflt="$ccflags";;
3887 Your C compiler may want other flags. For this question you should include
3888 -I/whatever and -DWHATEVER flags and any other flags used by the C compiler,
3889 but you should NOT include libraries or ld flags like -lwhatever. If you
3890 want $package to honor its debug switch, you should include -DDEBUGGING here.
3891 Your C compiler might also need additional flags, such as -D_POSIX_SOURCE.
3893 To use no flags, specify the word "none".
3899 rp="Any additional cc flags?"
3906 : the following weeds options from ccflags that are of no interest to cpp
3908 case "$gccversion" in
3909 1*) cppflags="$cppflags -D__GNUC__"
3911 case "$mips_type" in
3913 *BSD*) cppflags="$cppflags -DSYSTYPE_BSD43";;
3919 echo "Let me guess what the preprocessor flags are..." >&4
3933 *) ftry="$previous $flag";;
3935 if $cppstdin -DLFRULB=bar $cppflags $ftry $cppminus <cpp.c \
3936 >cpp1.out 2>/dev/null && \
3937 $cpprun -DLFRULB=bar $cppflags $ftry $cpplast <cpp.c \
3938 >cpp2.out 2>/dev/null && \
3939 $contains 'foo.*xx.*bar' cpp1.out >/dev/null 2>&1 && \
3940 $contains 'foo.*xx.*bar' cpp2.out >/dev/null 2>&1
3942 cppflags="$cppflags $ftry"
3952 *-*) echo "They appear to be: $cppflags";;
3954 $rm -f cpp.c cpp?.out
3958 : flags used in final linking phase
3960 '') if ./venix; then
3966 *-posix*) dflt="$dflt -posix" ;;
3969 *) dflt="$ldflags";;
3972 : Try to guess additional flags to pick up local libraries.
3973 for thislibdir in $libpth; do
3974 case " $loclibpth " in
3977 *"-L$thislibdir "*) ;;
3978 *) dflt="$dflt -L$thislibdir" ;;
3990 Your C linker may need flags. For this question you should
3991 include -L/whatever and any other flags used by the C linker, but you
3992 should NOT include libraries like -lwhatever.
3994 Make sure you include the appropriate -L/path flags if your C linker
3995 does not normally search all of the directories you specified above,
3998 To use no flags, specify the word "none".
4002 rp="Any additional ld flags (NOT including libraries)?"
4008 rmlist="$rmlist pdp11"
4012 echo "Checking your choice of C compiler and flags for coherency..." >&4
4013 $cat > try.c <<'EOF'
4015 int main() { printf("Ok\n"); exit(0); }
4017 set X $cc $optimize $ccflags -o try $ldflags try.c $libs
4019 $cat >try.msg <<'EOM'
4020 I've tried to compile and run the following simple program:
4023 $cat try.c >> try.msg
4025 $cat >> try.msg <<EOM
4032 and I got the following output:
4036 if sh -c "$cc $optimize $ccflags -o try $ldflags try.c $libs" >>try.msg 2>&1; then
4037 if sh -c './try' >>try.msg 2>&1; then
4041 *) echo 'The program compiled OK, but produced no output.' >> try.msg
4044 cat >> try.msg <<'EOQS'
4045 If $libs contains -lsfio, and sfio is mis-configured, then it
4046 sometimes (apparently) runs and exits with a 0 status, but with no
4047 output! It may have to do with sfio's use of _exit vs. exit.
4050 rp="You have a big problem. Shall I abort Configure"
4057 echo "The program compiled OK, but exited with status $?." >>try.msg
4058 rp="You have a problem. Shall I abort Configure"
4062 echo "I can't compile the test program." >>try.msg
4063 rp="You have a BIG problem. Shall I abort Configure"
4069 case "$knowitall" in
4071 echo "(The supplied flags or libraries might be incorrect.)"
4079 *) echo "Ok. Stopping Configure." >&4
4084 n) echo "OK, that should do.";;
4086 $rm -f try try.* core
4088 : define an is-a-typedef? function
4089 typedef='type=$1; var=$2; def=$3; shift; shift; shift; inclist=$@;
4091 "") inclist="sys/types.h";;
4093 eval "varval=\$$var";
4097 for inc in $inclist; do
4098 echo "#include <$inc>" >>temp.c;
4100 echo "#ifdef $type" >> temp.c;
4101 echo "printf(\"We have $type\");" >> temp.c;
4102 echo "#endif" >> temp.c;
4103 $cppstdin $cppflags $cppminus < temp.c >temp.E 2>/dev/null;
4104 if $contains $type temp.E >/dev/null 2>&1; then
4110 *) eval "$var=\$varval";;
4113 : define an is-a-typedef? function that prompts if the type is not available.
4114 typedef_ask='type=$1; var=$2; def=$3; shift; shift; shift; inclist=$@;
4116 "") inclist="sys/types.h";;
4118 eval "varval=\$$var";
4122 for inc in $inclist; do
4123 echo "#include <$inc>" >>temp.c;
4125 echo "#ifdef $type" >> temp.c;
4126 echo "printf(\"We have $type\");" >> temp.c;
4127 echo "#endif" >> temp.c;
4128 $cppstdin $cppflags $cppminus < temp.c >temp.E 2>/dev/null;
4130 echo "$rp" | $sed -e "s/What is/Looking for/" -e "s/?/./";
4131 if $contains $type temp.E >/dev/null 2>&1; then
4132 echo "$type found." >&4;
4135 echo "$type NOT found." >&4;
4141 *) eval "$var=\$varval";;
4144 : define a shorthand compile call
4148 $cc $optimize $ccflags $ldflags -o ${mc_file} $* ${mc_file}.c $libs > /dev/null 2>&1;'
4149 : define a shorthand compile call for compilations that should be ok.
4153 $cc $optimize $ccflags $ldflags -o ${mc_file} $* ${mc_file}.c $libs;'
4155 : check for lengths of integral types
4159 echo "Checking to see how big your integers are..." >&4
4160 $cat >intsize.c <<'EOCP'
4164 printf("intsize=%d;\n", (int)sizeof(int));
4165 printf("longsize=%d;\n", (int)sizeof(long));
4166 printf("shortsize=%d;\n", (int)sizeof(short));
4171 if eval $compile_ok && ./intsize > /dev/null; then
4173 echo "Your integers are $intsize bytes long."
4174 echo "Your long integers are $longsize bytes long."
4175 echo "Your short integers are $shortsize bytes long."
4179 Help! I can't compile and run the intsize test program: please enlighten me!
4180 (This is probably a misconfiguration in your system or libraries, and
4181 you really ought to fix it. Still, I'll try anyway.)
4185 rp="What is the size of an integer (in bytes)?"
4189 rp="What is the size of a long integer (in bytes)?"
4193 rp="What is the size of a short integer (in bytes)?"
4199 $rm -f intsize intsize.*
4201 : see what type lseek is declared as in the kernel
4202 rp="What is the type used for lseek's offset on this system?"
4203 set off_t lseektype long stdio.h sys/types.h
4207 echo "Checking to see how big your file offsets are..." >&4
4209 #include <sys/types.h>
4213 printf("%d\n", (int)sizeof($lseektype));
4218 if eval $compile_ok; then
4220 echo "Your file offsets are $lseeksize bytes long."
4224 echo "(I can't seem to compile the test program. Guessing...)"
4225 rp="What is the size of your file offsets (in bytes)?"
4231 : see what type file positions are declared as in the library
4232 rp="What is the type for file position used by fsetpos()?"
4233 set fpos_t fpostype long stdio.h sys/types.h
4238 *_t) zzz="$fpostype" ;;
4241 echo "Checking the size of $zzz..." >&4
4243 #include <sys/types.h>
4246 printf("%d\n", (int)sizeof($fpostype));
4251 if eval $compile_ok; then
4255 echo "(I can't execute the test program--guessing $fpossize.)" >&4
4258 echo "Your $zzz is $fpossize bytes long."
4264 echo "(I can't compile the test program. Guessing...)" >&4
4265 rp="What is the size of your file positions (in bytes)?"
4272 # Backward compatibility (uselfs is deprecated).
4274 "$define"|true|[yY]*)
4277 *** Configure -Duselfs is deprecated, using -Duselargefiles instead.
4279 uselargefiles="$define"
4283 case "$lseeksize:$fpossize" in
4286 You can have files larger than 2 gigabytes.
4289 *) case "$uselargefiles" in
4290 "$undef"|false|[nN]*) dflt='n' ;;
4295 Perl can be built to understand large files (files larger than 2 gigabytes)
4296 on some systems. To do so, Configure can be run with -Duselargefiles.
4298 If this doesn't make any sense to you, just accept the default '$dflt'.
4300 rp='Try to understand large files, if available?'
4303 y|Y) val="$define" ;;
4310 case "$uselargefiles" in
4312 : Look for a hint-file generated 'call-back-unit'. If the
4313 : user has specified that a large files perl is to be built,
4314 : we may need to set or change some other defaults.
4315 if $test -f uselargefiles.cbu; then
4316 echo "Your platform has some specific hints for large file builds, using them..."
4317 . ./uselargefiles.cbu
4319 echo "Rechecking to see how big your file offsets are..." >&4
4321 #include <sys/types.h>
4325 printf("%d\n", (int)sizeof($lseektype));
4330 if eval $compile_ok; then
4332 $echo "Your file offsets are now $lseeksize bytes long."
4336 echo "(I can't seem to compile the test program. Guessing...)"
4337 rp="What is the size of your file offsets (in bytes)?"
4342 *_t) zzz="$fpostype" ;;
4345 $echo $n "Rechecking the size of $zzz...$c" >&4
4347 #include <sys/types.h>
4350 printf("%d\n", (int)sizeof($fpostype));
4355 if eval $compile_ok; then
4360 echo "(I can't execute the test program--guessing $fpossize.)" >&4
4363 echo " $fpossize bytes." >&4
4369 echo "(I can't compile the test program. Guessing...)" >&4
4370 rp="What is the size of your file positions (in bytes)?"
4380 case "$usemorebits" in
4381 "$define"|true|[yY]*)
4382 use64bitint="$define"
4383 uselongdouble="$define"
4384 usemorebits="$define"
4386 *) usemorebits="$undef"
4391 case "$uselonglong" in
4392 "$define"|true|[yY]*)
4395 *** Configure -Duselonglong is deprecated, using -Duse64bitint instead.
4397 use64bitint="$define"
4400 case "$use64bits" in
4401 "$define"|true|[yY]*)
4404 *** Configure -Duse64bits is deprecated, using -Duse64bitint instead.
4406 use64bitint="$define"
4409 case "$use64bitints" in
4410 "$define"|true|[yY]*)
4413 *** There is no Configure -Duse64bitints, using -Duse64bitint instead.
4415 use64bitint="$define"
4418 case "$use64bitsint" in
4419 "$define"|true|[yY]*)
4422 *** There is no Configure -Duse64bitsint, using -Duse64bitint instead.
4424 use64bitint="$define"
4427 case "$uselonglongs" in
4428 "$define"|true|[yY]*)
4431 *** There is no Configure -Duselonglongs, using -Duse64bitint instead.
4433 use64bitint="$define"
4436 case "$use64bitsall" in
4437 "$define"|true|[yY]*)
4440 *** There is no Configure -Duse64bitsall, using -Duse64bitall instead.
4442 use64bitall="$define"
4447 *-DUSE_LONG_LONG*|*-DUSE_64_BIT_INT*|*-DUSE_64_BIT_ALL*) use64bitint="$define";;
4449 case "$use64bitall" in
4450 "$define"|true|[yY]*) use64bitint="$define" ;;
4456 You have natively 64-bit long integers.
4460 *) case "$use64bitint" in
4461 "$define"|true|[yY]*) dflt='y';;
4466 Perl can be built to take advantage of 64-bit integer types
4467 on some systems. To do so, Configure can be run with -Duse64bitint.
4468 Choosing this option will most probably introduce binary incompatibilities.
4470 If this doesn't make any sense to you, just accept the default '$dflt'.
4472 rp='Try to use 64-bit integers, if available?'
4475 [yY]*) val="$define" ;;
4483 case "$use64bitall" in
4484 "$define"|true|[yY]*) dflt='y' ;;
4485 *) case "$longsize" in
4493 You may also choose to try maximal 64-bitness. It means using as much
4494 64-bitness as possible on the platform. This in turn means even more
4495 binary incompatibilities. On the other hand, your platform may not
4496 have any more 64-bitness available than what you already have chosen.
4498 If this doesn't make any sense to you, just accept the default '$dflt'.
4500 rp='Try to use maximal 64-bit support, if available?'
4503 [yY]*) val="$define" ;;
4508 case "$use64bitall" in
4510 case "$use64bitint" in
4514 Since you have chosen a maximally 64-bit build, I'm also turning on
4515 the use of 64-bit integers.
4517 use64bitint="$define" ;;
4522 case "$use64bitint" in
4523 "$define"|true|[yY]*)
4524 : Look for a hint-file generated 'call-back-unit'. If the
4525 : user has specified that a 64-bit perl is to be built,
4526 : we may need to set or change some other defaults.
4527 if $test -f use64bitint.cbu; then
4528 echo "Your platform has some specific hints for 64-bit integers, using them..."
4532 4) case "$archname64" in
4533 '') archname64=64int ;;
4540 case "$use64bitall" in
4541 "$define"|true|[yY]*)
4542 : Look for a hint-file generated 'call-back-unit'. If the
4543 : user has specified that a maximally 64-bit perl is to be built,
4544 : we may need to set or change some other defaults.
4545 if $test -f use64bitall.cbu; then
4546 echo "Your platform has some specific hints for 64-bit builds, using them..."
4550 4) case "$archname64" in
4551 ''|64int) archname64=64all ;;
4559 echo "Checking for GNU C Library..." >&4
4560 cat >gnulibc.c <<EOM
4572 if eval $compile_ok && ./gnulibc; then
4574 echo "You are using the GNU C Library"
4577 echo "You are not using the GNU C Library"
4583 : see if nm is to be used to determine whether a symbol is defined or not
4587 case "$d_gnulibc" in
4590 echo "nm probably won't work on the GNU C Library." >&4
4596 if $test "$osname" = aix -a ! -f /lib/syscalls.exp; then
4598 echo "Whoops! This is an AIX system without /lib/syscalls.exp!" >&4
4599 echo "'nm' won't be sufficient on this sytem." >&4
4605 '') dflt=`$egrep 'inlibc|csym' $rsrc/Configure | wc -l 2>/dev/null`
4606 if $test $dflt -gt 20; then
4616 true|$define) dflt=y;;
4623 I can use $nm to extract the symbols from your C libraries. This
4624 is a time consuming task which may generate huge output on the disk (up
4625 to 3 megabytes) but that should make the symbols extraction faster. The
4626 alternative is to skip the 'nm' extraction part and to compile a small
4627 test program instead to determine whether each symbol is present. If
4628 you have a fast C compiler and/or if your 'nm' output cannot be parsed,
4629 this may be the best solution.
4631 You probably shouldn't let me use 'nm' if you are using the GNU C Library.
4634 rp="Shall I use $nm to extract C symbols from the libraries?"
4637 [Nn]*) usenm=false;;
4646 : nm options which may be necessary
4648 '') if $test -f /mach_boot; then
4650 elif $test -d /usr/ccs/lib; then
4651 nm_opt='-p' # Solaris (and SunOS?)
4652 elif $test -f /dgux; then
4654 elif $test -f /lib64/rld; then
4655 nm_opt='-p' # 64-bit Irix
4661 : nm options which may be necessary for shared libraries but illegal
4662 : for archive libraries. Thank you, Linux.
4663 case "$nm_so_opt" in
4664 '') case "$myuname" in
4666 if $nm --help | $grep 'dynamic' > /dev/null 2>&1; then
4667 nm_so_opt='--dynamic'
4676 : get list of predefined functions in a handy place
4681 *-lc_s*) libc=`./loc libc_s$_a $libc $libpth`
4688 *) for thislib in $libs; do
4691 : Handle C library specially below.
4694 thislib=`echo $thislib | $sed -e 's/^-l//'`
4695 if try=`./loc lib$thislib.$so.'*' X $libpth`; $test -f "$try"; then
4697 elif try=`./loc lib$thislib.$so X $libpth`; $test -f "$try"; then
4699 elif try=`./loc lib$thislib$_a X $libpth`; $test -f "$try"; then
4701 elif try=`./loc $thislib$_a X $libpth`; $test -f "$try"; then
4703 elif try=`./loc lib$thislib X $libpth`; $test -f "$try"; then
4705 elif try=`./loc $thislib X $libpth`; $test -f "$try"; then
4707 elif try=`./loc Slib$thislib$_a X $xlibpth`; $test -f "$try"; then
4712 libnames="$libnames $try"
4714 *) libnames="$libnames $thislib" ;;
4723 for xxx in $libpth; do
4724 $test -r $1 || set $xxx/libc.$so
4725 : The messy sed command sorts on library version numbers.
4727 set `echo blurfl; echo $xxx/libc.$so.[0-9]* | \
4728 tr ' ' $trnl | egrep -v '\.[A-Za-z]*$' | $sed -e '
4730 s/[0-9][0-9]*/0000&/g
4731 s/0*\([0-9][0-9][0-9][0-9][0-9]\)/\1/g
4734 sort | $sed -e 's/^.* //'`
4737 $test -r $1 || set /usr/ccs/lib/libc.$so
4738 $test -r $1 || set /lib/libsys_s$_a
4744 if $test -r "$1"; then
4745 echo "Your (shared) C library seems to be in $1."
4747 elif $test -r /lib/libc && $test -r /lib/clib; then
4748 echo "Your C library seems to be in both /lib/clib and /lib/libc."
4750 libc='/lib/clib /lib/libc'
4751 if $test -r /lib/syslib; then
4752 echo "(Your math library is in /lib/syslib.)"
4753 libc="$libc /lib/syslib"
4755 elif $test -r "$libc" || (test -h "$libc") >/dev/null 2>&1; then
4756 echo "Your C library seems to be in $libc, as you said before."
4757 elif $test -r $incpath/usr/lib/libc$_a; then
4758 libc=$incpath/usr/lib/libc$_a;
4759 echo "Your C library seems to be in $libc. That's fine."
4760 elif $test -r /lib/libc$_a; then
4762 echo "Your C library seems to be in $libc. You're normal."
4764 if tans=`./loc libc$_a blurfl/dyick $libpth`; $test -r "$tans"; then
4766 elif tans=`./loc libc blurfl/dyick $libpth`; $test -r "$tans"; then
4767 libnames="$libnames "`./loc clib blurfl/dyick $libpth`
4768 elif tans=`./loc clib blurfl/dyick $libpth`; $test -r "$tans"; then
4770 elif tans=`./loc Slibc$_a blurfl/dyick $xlibpth`; $test -r "$tans"; then
4772 elif tans=`./loc Mlibc$_a blurfl/dyick $xlibpth`; $test -r "$tans"; then
4775 tans=`./loc Llibc$_a blurfl/dyick $xlibpth`
4777 if $test -r "$tans"; then
4778 echo "Your C library seems to be in $tans, of all places."
4784 if $test $xxx = apollo -o -r "$libc" || (test -h "$libc") >/dev/null 2>&1; then
4788 If the guess above is wrong (which it might be if you're using a strange
4789 compiler, or your machine supports multiple models), you can override it here.
4794 echo $libpth | tr ' ' $trnl | sort | uniq > libpath
4796 I can't seem to find your C library. I've looked in the following places:
4799 $sed 's/^/ /' libpath
4802 None of these seems to contain your C library. I need to get its name...
4807 rp='Where is your C library?'
4812 echo $libc $libnames | tr ' ' $trnl | sort | uniq > libnames
4813 set X `cat libnames`
4816 case $# in 1) xxx=file; esac
4817 echo "Extracting names from the following $xxx for later perusal:" >&4
4819 $sed 's/^/ /' libnames >&4
4821 $echo $n "This may take a while...$c" >&4
4825 *$so*) $nm $nm_so_opt $nm_opt $file 2>/dev/null;;
4826 *) $nm $nm_opt $file 2>/dev/null;;
4831 $grep fprintf libc.tmp > libc.ptf
4832 xscan='eval "<libc.ptf $com >libc.list"; $echo $n ".$c" >&4'
4833 xrun='eval "<libc.tmp $com >libc.list"; echo "done" >&4'
4835 if com="$sed -n -e 's/__IO//' -e 's/^.* $xxx *_[_.]*//p' -e 's/^.* $xxx *//p'";\
4837 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
4839 elif com="$sed -n -e 's/^__*//' -e 's/^\([a-zA-Z_0-9$]*\).*xtern.*/\1/p'";\
4841 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
4843 elif com="$sed -n -e '/|UNDEF/d' -e '/FUNC..GL/s/^.*|__*//p'";\
4845 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
4847 elif com="$sed -n -e 's/^.* D __*//p' -e 's/^.* D //p'";\
4849 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
4851 elif com="$sed -n -e 's/^_//' -e 's/^\([a-zA-Z_0-9]*\).*xtern.*text.*/\1/p'";\
4853 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
4855 elif com="$sed -n -e 's/^.*|FUNC |GLOB .*|//p'";\
4857 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
4859 elif com="$grep '|' | $sed -n -e '/|COMMON/d' -e '/|DATA/d' \
4860 -e '/ file/d' -e 's/^\([^ ]*\).*/\1/p'";\
4862 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
4864 elif com="$sed -n -e 's/^.*|FUNC |GLOB .*|//p' -e 's/^.*|FUNC |WEAK .*|//p'";\
4866 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
4868 elif com="$sed -n -e 's/^__//' -e '/|Undef/d' -e '/|Proc/s/ .*//p'";\
4870 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
4872 elif com="$sed -n -e 's/^.*|Proc .*|Text *| *//p'";\
4874 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
4876 elif com="$sed -n -e '/Def. Text/s/.* \([^ ]*\)\$/\1/p'";\
4878 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
4880 elif com="$sed -n -e 's/^[-0-9a-f ]*_\(.*\)=.*/\1/p'";\
4882 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
4884 elif com="$sed -n -e 's/.*\.text n\ \ \ \.//p'";\
4886 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
4888 elif com="sed -n -e 's/^__.*//' -e 's/[ ]*D[ ]*[0-9]*.*//p'";\
4890 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
4893 $nm -p $* 2>/dev/null >libc.tmp
4894 $grep fprintf libc.tmp > libc.ptf
4895 if com="$sed -n -e 's/^.* [ADTSIW] *_[_.]*//p' -e 's/^.* [ADTSIW] //p'";\
4896 eval $xscan; $contains '^fprintf$' libc.list >/dev/null 2>&1
4902 echo "$nm didn't seem to work right. Trying $ar instead..." >&4
4904 if $ar t $libc > libc.tmp && $contains '^fprintf$' libc.tmp >/dev/null 2>&1; then
4905 for thisname in $libnames $libc; do
4906 $ar t $thisname >>libc.tmp
4908 $sed -e "s/\\$_o\$//" < libc.tmp > libc.list
4910 elif test "X$osname" = "Xos2" && $ar tv $libc > libc.tmp; then
4911 # Repeat libc to extract forwarders to DLL entries too
4912 for thisname in $libnames $libc; do
4913 $ar tv $thisname >>libc.tmp
4914 # Revision 50 of EMX has bug in $ar.
4915 # it will not extract forwarders to DLL entries
4916 # Use emximp which will extract exactly them.
4917 emximp -o tmp.imp $thisname \
4919 $sed -e 's/^\([_a-zA-Z0-9]*\) .*$/\1/p' \
4920 < tmp.imp >>libc.tmp
4923 $sed -e "s/\\$_o\$//" -e 's/^ \+//' < libc.tmp > libc.list
4926 echo "$ar didn't seem to work right." >&4
4927 echo "Maybe this is a Cray...trying bld instead..." >&4
4928 if bld t $libc | $sed -e 's/.*\///' -e "s/\\$_o:.*\$//" > libc.list
4930 for thisname in $libnames; do
4932 $sed -e 's/.*\///' -e "s/\\$_o:.*\$//" >>libc.list
4933 $ar t $thisname >>libc.tmp
4937 echo "That didn't work either. Giving up." >&4
4944 if $test -f /lib/syscalls.exp; then
4946 echo "Also extracting names from /lib/syscalls.exp for good ole AIX..." >&4
4947 $sed -n 's/^\([^ ]*\)[ ]*syscall[0-9]*$/\1/p' /lib/syscalls.exp >>libc.list
4951 $rm -f libnames libpath
4953 : is a C symbol defined?
4956 -v) tf=libc.tmp; tc=""; tdc="";;
4957 -a) tf=libc.tmp; tc="[0]"; tdc="[]";;
4958 *) tlook="^$1\$"; tf=libc.list; tc="()"; tdc="()";;
4961 case "$reuseval-$4" in
4963 true-*) tx=no; eval "tval=\$$4"; case "$tval" in "") tx=yes;; esac;;
4969 if $contains $tlook $tf >/dev/null 2>&1;
4974 echo "int main() { extern short $1$tdc; printf(\"%hd\", $1$tc); }" > t.c;
4975 if $cc $optimize $ccflags $ldflags -o t t.c $libs >/dev/null 2>&1;
4983 $define) tval=true;;
4989 : define an is-in-libc? function
4990 inlibc='echo " "; td=$define; tu=$undef;
4991 sym=$1; var=$2; eval "was=\$$2";
4993 case "$reuseval$was" in
5003 echo "$sym() found." >&4;
5004 case "$was" in $undef) . ./whoa; esac; eval "$var=\$td";;
5006 echo "$sym() NOT found." >&4;
5007 case "$was" in $define) . ./whoa; esac; eval "$var=\$tu";;
5011 $define) echo "$sym() found." >&4;;
5012 *) echo "$sym() NOT found." >&4;;
5016 : see if sqrtl exists
5021 *-DUSE_LONG_DOUBLE*|*-DUSE_MORE_BITS*) uselongdouble="$define" ;;
5024 case "$uselongdouble" in
5025 $define|true|[yY]*) dflt='y';;
5030 Perl can be built to take advantage of long doubles which
5031 (if available) may give more accuracy and range for floating point numbers.
5033 If this doesn't make any sense to you, just accept the default '$dflt'.
5035 rp='Try to use long doubles if available?'
5038 y|Y) val="$define" ;;
5044 case "$uselongdouble" in
5045 true|[yY]*) uselongdouble="$define" ;;
5048 case "$uselongdouble" in
5050 : Look for a hint-file generated 'call-back-unit'. If the
5051 : user has specified that long doubles should be used,
5052 : we may need to set or change some other defaults.
5053 if $test -f uselongdouble.cbu; then
5054 echo "Your platform has some specific hints for long doubles, using them..."
5055 . ./uselongdouble.cbu
5058 (Your platform doesn't have any specific hints for long doubles.)
5064 case "$uselongdouble:$d_sqrtl" in
5068 *** You requested the use of long doubles but you do not seem to have
5069 *** the mathematic functions for long doubles. I'm disabling the use
5070 *** of long doubles.
5073 uselongdouble=$undef
5077 : check for length of double
5079 case "$doublesize" in
5081 echo "Checking to see how big your double precision numbers are..." >&4
5082 $cat >try.c <<'EOCP'
5086 printf("%d\n", (int)sizeof(double));
5091 if eval $compile_ok; then
5093 echo "Your double is $doublesize bytes long."
5096 echo "(I can't seem to compile the test program. Guessing...)"
5097 rp="What is the size of a double precision number (in bytes)?"
5105 : check for long doubles
5107 echo "Checking to see if you have long double..." >&4
5108 echo 'int main() { long double x = 7.0; }' > try.c
5110 if eval $compile; then
5112 echo "You have long double."
5115 echo "You do not have long double."
5121 : check for length of long double
5122 case "${d_longdbl}${longdblsize}" in
5125 echo "Checking to see how big your long doubles are..." >&4
5126 $cat >try.c <<'EOCP'
5130 printf("%d\n", sizeof(long double));
5135 if eval $compile; then
5136 longdblsize=`./try$exe_ext`
5137 echo "Your long doubles are $longdblsize bytes long."
5141 echo "(I can't seem to compile the test program. Guessing...)" >&4
5142 rp="What is the size of a long double (in bytes)?"
5146 if $test "X$doublesize" = "X$longdblsize"; then
5147 echo "(That isn't any different from an ordinary double.)"
5153 : determine the architecture name
5155 if xxx=`./loc arch blurfl $pth`; $test -f "$xxx"; then
5156 tarch=`arch`"-$osname"
5157 elif xxx=`./loc uname blurfl $pth`; $test -f "$xxx" ; then
5158 if uname -m > tmparch 2>&1 ; then
5159 tarch=`$sed -e 's/ *$//' -e 's/ /_/g' \
5160 -e 's/$/'"-$osname/" tmparch`
5168 case "$myarchname" in
5171 echo "(Your architecture name used to be $myarchname.)"
5178 *) dflt="$archname";;
5180 rp='What is your architecture name'
5183 case "$usethreads" in
5185 echo "Threads selected." >&4
5187 *-thread*) echo "...and architecture name already has -thread." >&4
5189 *) archname="$archname-thread"
5190 echo "...setting architecture name to $archname." >&4
5195 case "$usemultiplicity" in
5197 echo "Multiplicity selected." >&4
5199 *-multi*) echo "...and architecture name already has -multi." >&4
5201 *) archname="$archname-multi"
5202 echo "...setting architecture name to $archname." >&4
5207 case "$use64bitint$use64bitall" in
5209 case "$archname64" in
5211 echo "This architecture is naturally 64-bit, not changing architecture name." >&4
5214 case "$use64bitint" in
5215 "$define") echo "64 bit integers selected." >&4 ;;
5217 case "$use64bitall" in
5218 "$define") echo "Maximal 64 bitness selected." >&4 ;;
5221 *-$archname64*) echo "...and architecture name already has $archname64." >&4
5223 *) archname="$archname-$archname64"
5224 echo "...setting architecture name to $archname." >&4
5230 case "$uselongdouble" in
5232 echo "Long doubles selected." >&4
5233 case "$longdblsize" in
5235 "...but long doubles are equal to doubles, not changing architecture name." >&4
5239 *-ld*) echo "...and architecture name already has -ld." >&4
5241 *) archname="$archname-ld"
5242 echo "...setting architecture name to $archname." >&4
5250 : determine root of directory hierarchy where package will be installed.
5253 dflt=`./loc . /usr/local /usr/local /local /opt /usr`
5261 By default, $package will be installed in $dflt/bin, manual pages
5262 under $dflt/man, etc..., i.e. with $dflt as prefix for all
5263 installation directories. Typically this is something like /usr/local.
5264 If you wish to have binaries under /usr/bin but other parts of the
5265 installation under /usr/local, that's ok: you will be prompted
5266 separately for each of the installation directories, the prefix being
5267 only used to set the defaults.
5271 rp='Installation prefix to use?'
5279 *) oldprefix="$prefix";;
5289 $define|true) afs=true ;;
5290 $undef|false) afs=false ;;
5291 *) if test -d /afs; then
5299 echo "AFS may be running... I'll be extra cautious then..." >&4
5301 echo "AFS does not seem to be running..." >&4
5304 : determine installation prefix for where package is to be installed.
5308 Since you are running AFS, I need to distinguish the directory in which
5309 files will reside from the directory in which they are installed (and from
5310 which they are presumably copied to the former directory by occult means).
5313 case "$installprefix" in
5314 '') dflt=`echo $prefix | sed 's#^/afs/#/afs/.#'`;;
5315 *) dflt="$installprefix";;
5320 In some special cases, particularly when building $package for distribution,
5321 it is convenient to distinguish between the directory in which files should
5322 be installed from the directory ($prefix) in which they
5323 will eventually reside. For most users, these two directories are the same.
5326 case "$installprefix" in
5328 *) dflt=$installprefix;;
5332 rp='What installation prefix should I use for installing files?'
5334 installprefix="$ans"
5335 installprefixexp="$ansexp"
5337 : set the prefixit variable, to compute a suitable default value
5338 prefixit='case "$3" in
5340 case "$oldprefix" in
5341 "") eval "$1=\"\$$2\"";;
5348 ""|" ") eval "$1=\"\$$2\"";;
5354 eval "tp=\"$oldprefix-\$$2-\""; eval "tp=\"$tp\"";
5356 --|/*--|\~*--) eval "$1=\"$prefix/$3\"";;
5357 /*-$oldprefix/*|\~*-$oldprefix/*)
5358 eval "$1=\`echo \$$2 | sed \"s,^$oldprefix,$prefix,\"\`";;
5359 *) eval "$1=\"\$$2\"";;
5364 : get the patchlevel
5366 echo "Getting the current patchlevel..." >&4
5367 if $test -r $rsrc/patchlevel.h;then
5368 revision=`awk '/define[ ]+PERL_REVISION/ {print $3}' $rsrc/patchlevel.h`
5369 patchlevel=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
5370 subversion=`awk '/define[ ]+PERL_SUBVERSION/ {print $3}' $rsrc/patchlevel.h`
5371 api_revision=`awk '/define[ ]+PERL_API_REVISION/ {print $3}' $rsrc/patchlevel.h`
5372 api_version=`awk '/define[ ]+PERL_API_VERSION/ {print $3}' $rsrc/patchlevel.h`
5373 api_subversion=`awk '/define[ ]+PERL_API_SUBVERSION/ {print $3}' $rsrc/patchlevel.h`
5382 $echo "(You have $package version $patchlevel subversion $subversion.)"
5385 : XXX Should be a Configure test for double-dots in filenames.
5386 version=`echo $revision $patchlevel $subversion | \
5387 $awk '{ printf "%d_%d_%d\n", $1, $2, $3 }'`
5388 api_versionstring=`echo $api_revision $api_version $api_subversion | \
5389 $awk '{ printf "%d_%d_%d\n", $1, $2, $3 }'`
5392 version=`echo $revision $patchlevel $subversion | \
5393 $awk '{ printf "%d.%d.%d\n", $1, $2, $3 }'`
5394 api_versionstring=`echo $api_revision $api_version $api_subversion | \
5395 $awk '{ printf "%d.%d.%d\n", $1, $2, $3 }'`
5398 : Special case the 5.005_xx maintenance series, which used 5.005
5399 : without any subversion label as a subdirectory in $sitelib
5400 if test "${api_revision}${api_version}${api_subversion}" = "550"; then
5401 api_versionstring='5.005'
5404 : determine installation style
5405 : For now, try to deduce it from prefix unless it is already set.
5406 : Reproduce behavior of 5.005 and earlier, maybe drop that in 5.7.
5407 case "$installstyle" in
5408 '') case "$prefix" in
5409 *perl*) dflt='lib';;
5410 *) dflt='lib/perl5' ;;
5413 *) dflt="$installstyle" ;;
5415 : Probably not worth prompting for this since we prompt for all
5416 : the directories individually, and the prompt would be too long and
5420 : determine where private library files go
5421 : Usual default is /usr/local/lib/perl5/$version.
5422 : Also allow things like /opt/perl/lib/$version, since
5423 : /opt/perl/lib/perl5... would be redundant.
5424 : The default "style" setting is made in installstyle.U
5425 case "$installstyle" in
5426 *lib/perl5*) set dflt privlib lib/$package/$version ;;
5427 *) set dflt privlib lib/$version ;;
5432 There are some auxiliary files for $package that need to be put into a
5433 private library directory that is accessible by everyone.
5437 rp='Pathname where the private library files will reside?'
5440 privlibexp="$ansexp"
5441 : Change installation prefix, if necessary.
5442 if $test X"$prefix" != X"$installprefix"; then
5443 installprivlib=`echo $privlibexp | sed "s#^$prefix#$installprefix#"`
5445 installprivlib="$privlibexp"
5448 : set the prefixup variable, to restore leading tilda escape
5449 prefixup='case "$prefixexp" in
5451 *) eval "$1=\`echo \$$1 | sed \"s,^$prefixexp,$prefix,\"\`";;
5454 : determine where public architecture dependent libraries go
5457 : privlib default is /usr/local/lib/$package/$version
5458 : archlib default is /usr/local/lib/$package/$version/$archname
5459 : privlib may have an optional trailing /share.
5460 tdflt=`echo $privlib | $sed 's,/share$,,'`
5461 tdflt=$tdflt/$archname
5470 $spackage contains architecture-dependent library files. If you are
5471 sharing libraries in a heterogeneous environment, you might store
5472 these files in a separate location. Otherwise, you can just include
5473 them with the rest of the public library files.
5477 rp='Where do you want to put the public architecture-dependent libraries?'
5480 archlibexp="$ansexp"
5481 if $test X"$archlib" = X"$privlib"; then
5486 : Change installation prefix, if necessary.
5487 if $test X"$prefix" != X"$installprefix"; then
5488 installarchlib=`echo $archlibexp | sed "s#^$prefix#$installprefix#"`
5490 installarchlib="$archlibexp"
5494 : Binary compatibility with 5.005 is not possible for builds
5495 : with advanced features
5496 case "$usethreads$usemultiplicity" in
5498 bincompat5005="$undef"
5499 d_bincompat5005="$undef"
5503 This version of Perl can be compiled for binary compatibility with 5.005.
5504 If you decide to do so, you will be able to continue using most of the
5505 extensions that were compiled for Perl 5.005.
5508 case "$bincompat5005$d_bincompat5005" in
5509 *"$undef"*) dflt=n ;;
5512 rp='Binary compatibility with Perl 5.005?'
5515 y*) val="$define" ;;
5520 case "$d_bincompat5005" in
5522 bincompat5005="$define"
5524 *) bincompat5005="$undef"
5525 d_bincompat5005="$undef"
5532 : see if setuid scripts can be secure
5535 Some kernels have a bug that prevents setuid #! scripts from being
5536 secure. Some sites have disabled setuid #! scripts because of this.
5538 First let's decide if your kernel supports secure setuid #! scripts.
5539 (If setuid #! scripts would be secure but have been disabled anyway,
5540 don't say that they are secure if asked.)
5545 if $test -d /dev/fd; then
5546 echo "#!$ls" >reflect
5547 chmod +x,u+s reflect
5548 ./reflect >flect 2>&1
5549 if $contains "/dev/fd" flect >/dev/null; then
5550 echo "Congratulations, your kernel has secure setuid scripts!" >&4
5554 If you are not sure if they are secure, I can check but I'll need a
5555 username and password different from the one you are using right now.
5556 If you don't have such a username or don't want me to test, simply
5560 rp='Other username to test security of setuid scripts with?'
5565 case "$d_suidsafe" in
5566 '') echo "I'll assume setuid scripts are *not* secure." >&4
5569 echo "Well, the $hint value is *not* secure." >&4
5571 *) echo "Well, the $hint value *is* secure." >&4
5576 $rm -f reflect flect
5577 echo "#!$ls" >reflect
5578 chmod +x,u+s reflect
5581 echo '"su" will (probably) prompt you for '"$ans's password."
5582 su $ans -c './reflect >flect'
5583 if $contains "/dev/fd" flect >/dev/null; then
5584 echo "Okay, it looks like setuid scripts are secure." >&4
5587 echo "I don't think setuid scripts are secure." >&4
5592 rp='Does your kernel have *secure* setuid scripts?'
5595 [yY]*) val="$define";;
5600 echo "I don't think setuid scripts are secure (no /dev/fd directory)." >&4
5601 echo "(That's for file descriptors, not floppy disks.)"
5607 $rm -f reflect flect
5609 : now see if they want to do setuid emulation
5612 case "$d_suidsafe" in
5615 echo "No need to emulate SUID scripts since they are secure here." >& 4
5619 Some systems have disabled setuid scripts, especially systems where
5620 setuid scripts cannot be secure. On systems where setuid scripts have
5621 been disabled, the setuid/setgid bits on scripts are currently
5622 useless. It is possible for $package to detect those bits and emulate
5623 setuid/setgid in a secure fashion. This emulation will only work if
5624 setuid scripts have been disabled in your kernel.
5628 "$define") dflt=y ;;
5631 rp="Do you want to do setuid/setgid emulation?"
5634 [yY]*) val="$define";;
5642 : determine filename position in cpp output
5644 echo "Computing filename position in cpp output for #include directives..." >&4
5645 echo '#include <stdio.h>' > foo.c
5648 $cppstdin $cppflags $cppminus <foo.c 2>/dev/null | \
5649 $grep '^[ ]*#.*stdio\.h' | \
5650 while read cline; do
5653 while $test \$# -gt 0; do
5654 if $test -r \`echo \$1 | $tr -d '"'\`; then
5659 pos=\`expr \$pos + 1\`
5671 *) pos="${fieldn}th";;
5673 echo "Your cpp writes the filename in the $pos field of the line."
5675 : locate header file
5680 for usrincdir in $usrinc
5682 if test -f \$usrincdir/\$wanted; then
5683 echo "\$usrincdir/\$wanted"
5687 awkprg='{ print \$$fieldn }'
5688 echo "#include <\$wanted>" > foo\$\$.c
5689 $cppstdin $cppminus $cppflags < foo\$\$.c 2>/dev/null | \
5690 $grep "^[ ]*#.*\$wanted" | \
5691 while read cline; do
5692 name=\`echo \$cline | $awk "\$awkprg" | $tr -d '"'\`
5694 *[/\\\\]\$wanted) echo "\$name"; exit 1;;
5695 *[\\\\/]\$wanted) echo "\$name"; exit 1;;
5700 # status = 0: grep returned 0 lines, case statement not executed
5701 # status = 1: headerfile found
5702 # status = 2: while loop executed, no headerfile found
5706 if test \$status -eq 1; then
5713 : define an alternate in-header-list? function
5714 inhdr='echo " "; td=$define; tu=$undef; yyy=$@;
5715 cont=true; xxf="echo \"<\$1> found.\" >&4";
5716 case $# in 2) xxnf="echo \"<\$1> NOT found.\" >&4";;
5717 *) xxnf="echo \"<\$1> NOT found, ...\" >&4";;
5719 case $# in 4) instead=instead;; *) instead="at last";; esac;
5720 while $test "$cont"; do
5722 var=$2; eval "was=\$$2";
5723 if $test "$xxx" && $test -r "$xxx";
5725 eval "case \"\$$var\" in $undef) . ./whoa; esac"; eval "$var=\$td";
5728 eval "case \"\$$var\" in $define) . ./whoa; esac"; eval "$var=\$tu"; fi;
5729 set $yyy; shift; shift; yyy=$@;
5730 case $# in 0) cont="";;
5731 2) xxf="echo \"but I found <\$1> $instead.\" >&4";
5732 xxnf="echo \"and I did not find <\$1> either.\" >&4";;
5733 *) xxf="echo \"but I found <\$1\> instead.\" >&4";
5734 xxnf="echo \"there is no <\$1>, ...\" >&4";;
5738 do set $yyy; var=$2; eval "was=\$$2";
5739 eval "case \"\$$var\" in $define) . ./whoa; esac"; eval "$var=\$tu";
5740 set $yyy; shift; shift; yyy=$@;
5743 : see if this is a malloc.h system
5744 set malloc.h i_malloc
5747 : see if stdlib is available
5748 set stdlib.h i_stdlib
5751 : determine which malloc to compile in
5753 case "$usemymalloc" in
5754 ''|[yY]*|true|$define) dflt='y' ;;
5757 rp="Do you wish to attempt to use the malloc that comes with $package?"
5763 mallocsrc='malloc.c'
5764 mallocobj="malloc$_o"
5765 d_mymalloc="$define"
5768 : Remove malloc from list of libraries to use
5769 echo "Removing unneeded -lmalloc from library list" >&4
5770 set `echo X $libs | $sed -e 's/-lmalloc / /' -e 's/-lmalloc$//'`
5773 echo "libs = $libs" >&4
5785 : compute the return types of malloc and free
5787 $cat >malloc.c <<END
5791 #include <sys/types.h>
5805 case "$malloctype" in
5807 if $cc $ccflags -c -DTRY_MALLOC malloc.c >/dev/null 2>&1; then
5814 echo "Your system wants malloc to return '$malloctype', it would seem." >&4
5818 if $cc $ccflags -c -DTRY_FREE malloc.c >/dev/null 2>&1; then
5825 echo "Your system uses $freetype free(), it would seem." >&4
5829 After $package is installed, you may wish to install various
5830 add-on modules and utilities. Typically, these add-ons will
5831 be installed under $prefix with the rest
5832 of this package. However, you may wish to install such add-ons
5833 elsewhere under a different prefix.
5835 If you do not wish to put everything under a single prefix, that's
5836 ok. You will be prompted for the individual locations; this siteprefix
5837 is only used to suggest the defaults.
5839 The default should be fine for most people.
5843 rp='Installation prefix to use for add-on modules and utilities?'
5844 : XXX Here might be another good place for an installstyle setting.
5845 case "$siteprefix" in
5847 *) dflt=$siteprefix ;;
5850 : XXX Prefixit unit does not yet support siteprefix and vendorprefix
5852 case "$siteprefix" in
5856 *) oldsiteprefix="$prefix";;
5861 siteprefixexp="$ansexp"
5863 : determine where site specific libraries go.
5864 : Usual default is /usr/local/lib/perl5/site_perl/$version
5865 : The default "style" setting is made in installstyle.U
5866 : XXX No longer works with Prefixit stuff.
5867 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
5869 '') case "$installstyle" in
5870 *lib/perl5*) dflt=$siteprefix/lib/$package/site_$prog/$version ;;
5871 *) dflt=$siteprefix/lib/site_$prog/$version ;;
5879 The installation process will create a directory for
5880 site-specific extensions and modules. Most users find it convenient
5881 to place all site-specific files in this directory rather than in the
5882 main distribution directory.
5886 rp='Pathname for the site-specific library files?'
5889 sitelibexp="$ansexp"
5890 sitelib_stem=`echo "$sitelibexp" | sed "s,/$version$,,"`
5891 : Change installation prefix, if necessary.
5892 if $test X"$prefix" != X"$installprefix"; then
5893 installsitelib=`echo $sitelibexp | $sed "s#^$prefix#$installprefix#"`
5895 installsitelib="$sitelibexp"
5898 : determine where site specific architecture-dependent libraries go.
5899 : sitelib default is /usr/local/lib/perl5/site_perl/$version
5900 : sitearch default is /usr/local/lib/perl5/site_perl/$version/$archname
5901 : sitelib may have an optional trailing /share.
5903 '') dflt=`echo $sitelib | $sed 's,/share$,,'`
5904 dflt="$dflt/$archname"
5909 set sitearch sitearch none
5913 The installation process will also create a directory for
5914 architecture-dependent site-specific extensions and modules.
5918 rp='Pathname for the site-specific architecture-dependent library files?'
5921 sitearchexp="$ansexp"
5922 : Change installation prefix, if necessary.
5923 if $test X"$prefix" != X"$installprefix"; then
5924 installsitearch=`echo $sitearchexp | sed "s#^$prefix#$installprefix#"`
5926 installsitearch="$sitearchexp"
5931 The installation process will also create a directory for
5932 vendor-supplied add-ons. Vendors who supply perl with their system
5933 may find it convenient to place all vendor-supplied files in this
5934 directory rather than in the main distribution directory. This will
5935 ease upgrades between binary-compatible maintenance versions of perl.
5937 Of course you may also use these directories in whatever way you see
5938 fit. For example, you might use them to access modules shared over a
5939 company-wide network.
5941 The default answer should be fine for most people.
5942 This causes further questions about vendor add-ons to be skipped
5943 and no vendor-specific directories will be configured for perl.
5946 rp='Do you want to configure vendor-specific add-on directories?'
5947 case "$usevendorprefix" in
5948 define|true|[yY]*) dflt=y ;;
5949 *) : User may have set vendorprefix directly on Configure command line.
5950 case "$vendorprefix" in
5959 rp='Installation prefix to use for vendor-supplied add-ons?'
5960 case "$vendorprefix" in
5962 *) dflt=$vendorprefix ;;
5965 : XXX Prefixit unit does not yet support siteprefix and vendorprefix
5967 case "$vendorprefix" in
5971 *) oldvendorprefix="$prefix";;
5975 usevendorprefix="$define"
5977 vendorprefixexp="$ansexp"
5979 *) usevendorprefix="$undef"
5985 case "$vendorprefix" in
5986 '') d_vendorlib="$undef"
5990 *) d_vendorlib="$define"
5991 : determine where vendor-supplied modules go.
5992 : Usual default is /usr/local/lib/perl5/vendor_perl/$version
5993 case "$vendorlib" in
5995 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
5996 case "$installstyle" in
5997 *lib/perl5*) dflt=$vendorprefix/lib/$package/vendor_$prog/$version ;;
5998 *) dflt=$vendorprefix/lib/vendor_$prog/$version ;;
6001 *) dflt="$vendorlib"
6005 rp='Pathname for the vendor-supplied library files?'
6008 vendorlibexp="$ansexp"
6011 vendorlib_stem=`echo "$vendorlibexp" | sed "s,/$version$,,"`
6012 : Change installation prefix, if necessary.
6013 if $test X"$prefix" != X"$installprefix"; then
6014 installvendorlib=`echo $vendorlibexp | $sed "s#^$prefix#$installprefix#"`
6016 installvendorlib="$vendorlibexp"
6019 case "$vendorprefix" in
6020 '') d_vendorarch="$undef"
6024 *) d_vendorarch="$define"
6025 : determine where vendor-supplied architecture-dependent libraries go.
6026 : vendorlib default is /usr/local/lib/perl5/vendor_perl/$version
6027 : vendorarch default is /usr/local/lib/perl5/vendor_perl/$version/$archname
6028 : vendorlib may have an optional trailing /share.
6029 case "$vendorarch" in
6030 '') dflt=`echo $vendorlib | $sed 's,/share$,,'`
6031 dflt="$dflt/$archname"
6033 *) dflt="$vendorarch" ;;
6036 rp='Pathname for vendor-supplied architecture-dependent files?'
6039 vendorarchexp="$ansexp"
6042 : Change installation prefix, if necessary.
6043 if $test X"$prefix" != X"$installprefix"; then
6044 installvendorarch=`echo $vendorarchexp | sed "s#^$prefix#$installprefix#"`
6046 installvendorarch="$vendorarchexp"
6049 : Final catch-all directories to search
6052 Lastly, you can have perl look in other directories for extensions and
6053 modules in addition to those already specified.
6054 These directories will be searched after
6058 test X"$vendorlib" != "X" && echo ' ' $vendorlib
6059 test X"$vendorarch" != "X" && echo ' ' $vendorarch
6061 case "$otherlibdirs" in
6062 ''|' ') dflt='none' ;;
6063 *) dflt="$otherlibdirs" ;;
6066 Enter a colon-separated set of extra paths to include in perl's @INC
6067 search path, or enter 'none' for no extra paths.
6071 rp='Colon-separated list of additional directories for perl to search?'
6074 ' '|''|none) otherlibdirs=' ' ;;
6075 *) otherlibdirs="$ans" ;;
6077 case "$otherlibdirs" in
6081 set d_perl_otherlibdirs
6084 : Cruising for prototypes
6086 echo "Checking out function prototypes..." >&4
6087 $cat >prototype.c <<'EOCP'
6088 int main(int argc, char *argv[]) {
6091 if $cc $ccflags -c prototype.c >prototype.out 2>&1 ; then
6092 echo "Your C compiler appears to support function prototypes."
6095 echo "Your C compiler doesn't seem to understand function prototypes."
6102 case "$prototype" in
6104 *) ansi2knr='ansi2knr'
6109 This version of $package can only be compiled by a compiler that
6110 understands function prototypes. Unfortunately, your C compiler
6112 doesn't seem to understand them. Sorry about that.
6114 If GNU cc is available for your system, perhaps you could try that instead.
6116 Eventually, we hope to support building Perl with pre-ANSI compilers.
6117 If you would like to help in that effort, please contact <perlbug@perl.org>.
6119 Aborting Configure now.
6125 : determine where public executables go
6130 rp='Pathname where the public executables will reside?'
6132 if $test "X$ansexp" != "X$binexp"; then
6137 : Change installation prefix, if necessary.
6138 : XXX Bug? -- ignores Configure -Dinstallprefix setting.
6139 if $test X"$prefix" != X"$installprefix"; then
6140 installbin=`echo $binexp | sed "s#^$prefix#$installprefix#"`
6142 installbin="$binexp"
6145 : Find perl5.005 or later.
6146 echo "Looking for a previously installed perl5.005 or later... "
6148 '') for tdir in `echo "$binexp:$PATH" | $sed "s/$path_sep/ /g"`; do
6149 : Check if this perl is recent and can load a simple module
6150 if $test -x $tdir/perl && $tdir/perl -Mless -e 'use 5.005;' >/dev/null 2>&1; then
6153 elif $test -x $tdir/perl5 && $tdir/perl5 -Mless -e 'use 5.005;' >/dev/null 2>&1; then
6163 '') echo "None found. That's ok.";;
6164 *) echo "Using $perl5." ;;
6167 : Determine list of previous versions to include in @INC
6168 $cat > getverlist <<EOPL
6171 \$api_versionstring = "$api_versionstring";
6172 \$version = "$version";
6173 \$stem = "$sitelib_stem";
6174 \$archname = "$archname";
6176 $cat >> getverlist <<'EOPL'
6177 # Can't have leading @ because metaconfig interprets it as a command!
6178 ;@inc_version_list=();
6179 # XXX Redo to do opendir/readdir?
6182 ;@candidates = glob("5.*");
6188 # XXX ToDo: These comparisons must be reworked when two-digit
6189 # subversions come along, so that 5.7.10 compares as greater than
6190 # 5.7.3! By that time, hope that 5.6.x is sufficiently
6191 # widespread that we can use the built-in version vectors rather
6192 # than reinventing them here. For 5.6.0, however, we must
6193 # assume this script will likely be run by 5.005_0x. --AD 1/2000.
6194 foreach $d (@candidates) {
6195 if ($d lt $version) {
6196 if ($d ge $api_versionstring) {
6197 unshift(@inc_version_list, grep { -d } "$d/$archname", $d);
6199 elsif ($d ge "5.005") {
6200 unshift(@inc_version_list, grep { -d } $d);
6204 # Skip newer version. I.e. don't look in
6205 # 5.7.0 if we're installing 5.6.1.
6209 if (@inc_version_list) {
6210 print join(' ', @inc_version_list);
6213 # Blank space to preserve value for next Configure run.
6218 case "$inc_version_list" in
6219 '') if test -x "$perl5"; then
6220 dflt=`$perl5 getverlist`
6225 $undef) dflt='none' ;;
6226 *) dflt="$inc_version_list" ;;
6229 ''|' ') dflt=none ;;
6232 5.005) case "$bincompat5005" in
6233 $define|true|[yY]*) ;;
6240 In order to ease the process of upgrading, this version of perl
6241 can be configured to use modules built and installed with earlier
6242 versions of perl that were installed under $prefix. Specify here
6243 the list of earlier versions that this version of perl should check.
6244 If Configure detected no earlier versions of perl installed under
6245 $prefix, then the list will be empty. Answer 'none' to tell perl
6246 to not search earlier versions.
6248 The default should almost always be sensible, so if you're not sure,
6249 just accept the default.
6252 rp='List of earlier versions to include in @INC?'
6255 [Nn]one|''|' ') inc_version_list=' ' ;;
6256 *) inc_version_list="$ans" ;;
6258 case "$inc_version_list" in
6260 inc_version_list_init='0';;
6261 *) inc_version_list_init=`echo $inc_version_list |
6262 $sed -e 's/^/"/' -e 's/ /","/g' -e 's/$/",0/'`
6267 : determine whether to install perl also as /usr/bin/perl
6270 if $test -d /usr/bin -a "X$installbin" != X/usr/bin; then
6272 Many scripts expect perl to be installed as /usr/bin/perl.
6273 I can install the perl you are about to compile also as /usr/bin/perl
6274 (in addition to $installbin/perl).
6276 case "$installusrbinperl" in
6277 "$undef"|[nN]*) dflt='n';;
6280 rp="Do you want to install perl as /usr/bin/perl?"
6283 [yY]*) val="$define";;
6289 set installusrbinperl
6292 : see if dld is available
6296 : see if dlopen exists
6303 : determine which dynamic loading, if any, to compile in
6305 dldir="ext/DynaLoader"
6318 $define) dflt='y' ;;
6321 $define) dflt='y' ;;
6323 : Does a dl_xxx.xs file exist for this operating system
6324 $test -f $rsrc/$dldir/dl_${osname}.xs && dflt='y'
6327 rp="Do you wish to use dynamic loading?"
6334 if $test -f $rsrc/$dldir/dl_${osname}.xs ; then
6335 dflt="$dldir/dl_${osname}.xs"
6336 elif $test "$d_dlopen" = "$define" ; then
6337 dflt="$dldir/dl_dlopen.xs"
6338 elif $test "$i_dld" = "$define" ; then
6339 dflt="$dldir/dl_dld.xs"
6344 *) dflt="$dldir/$dlsrc"
6347 echo "The following dynamic loading files are available:"
6348 : Can not go over to $dldir because getfile has path hard-coded in.
6349 tdir=`pwd`; cd $rsrc; $ls -C $dldir/dl*.xs; cd $tdir
6350 rp="Source file to use for dynamic loading"
6356 dlsrc=`echo $ans | $sed -e 's%.*/\([^/]*\)$%\1%'`
6360 Some systems may require passing special flags to $cc -c to
6361 compile modules that will be used to create a shared library.
6362 To use no flags, say "none".
6365 case "$cccdlflags" in
6366 '') case "$gccversion" in
6367 '') case "$osname" in
6369 next) dflt='none' ;;
6370 irix*) dflt='-KPIC' ;;
6371 svr4*|esix*|solaris) dflt='-KPIC' ;;
6372 sunos) dflt='-pic' ;;
6376 *) case "$osname" in
6377 svr4*|esix*|solaris) dflt='-fPIC' ;;
6382 *) dflt="$cccdlflags" ;;
6384 rp="Any special flags to pass to $cc -c to compile shared library modules?"
6387 none) cccdlflags=' ' ;;
6388 *) cccdlflags="$ans" ;;
6393 Some systems use ld to create libraries that can be dynamically loaded,
6394 while other systems (such as those using ELF) use $cc.
6398 '') $cat >try.c <<'EOM'
6399 /* Test for whether ELF binaries are produced */
6404 int i = open("a.out",O_RDONLY);
6407 if(read(i,b,4)==4 && b[0]==127 && b[1]=='E' && b[2]=='L' && b[3]=='F')
6408 exit(0); /* succeed (yes, it's ELF) */
6413 if $cc $ccflags try.c >/dev/null 2>&1 && ./a.out; then
6415 You appear to have ELF support. I'll use $cc to build dynamic libraries.
6419 echo "I'll use ld to build dynamic libraries."
6428 rp="What command should be used to create dynamic libraries?"
6434 Some systems may require passing special flags to $ld to create a
6435 library that can be dynamically loaded. If your ld flags include
6436 -L/other/path options to locate libraries outside your loader's normal
6437 search path, you may need to specify those -L options here as well. To
6438 use no flags, say "none".
6441 case "$lddlflags" in
6442 '') case "$osname" in
6443 beos) dflt='-nostart' ;;
6445 case "$gccversion" in
6446 '') dflt="$dflt +vnocompatwarnings" ;;
6449 linux|irix*) dflt='-shared' ;;
6450 next) dflt='none' ;;
6451 solaris) dflt='-G' ;;
6452 sunos) dflt='-assert nodefinitions' ;;
6453 svr4*|esix*) dflt="-G $ldflags" ;;
6457 *) dflt="$lddlflags" ;;
6460 : Try to guess additional flags to pick up local libraries.
6461 : Be careful not to append to a plain 'none'
6465 for thisflag in $ldflags; do
6470 *) dflt="$dflt $thisflag" ;;
6477 ''|' ') dflt='none' ;;
6480 rp="Any special flags to pass to $ld to create a dynamically loaded library?"
6483 none) lddlflags=' ' ;;
6484 *) lddlflags="$ans" ;;
6489 Some systems may require passing special flags to $cc to indicate that
6490 the resulting executable will use dynamic linking. To use no flags,
6494 case "$ccdlflags" in
6495 '') case "$osname" in
6496 hpux) dflt='-Wl,-E' ;;
6497 linux) dflt='-rdynamic' ;;
6498 next) dflt='none' ;;
6499 sunos) dflt='none' ;;
6503 *) dflt="$ccdlflags" ;;
6505 rp="Any special flags to pass to $cc to use dynamic linking?"
6508 none) ccdlflags=' ' ;;
6509 *) ccdlflags="$ans" ;;
6523 # No dynamic loading being used, so don't bother even to prompt.
6526 *) case "$useshrplib" in
6527 '') case "$osname" in
6528 svr4*|dgux|dynixptx|esix|powerux|beos|cygwin*)
6530 also='Building a shared libperl is required for dynamic loading to work on your system.'
6535 also='Building a shared libperl is needed for MAB support.'
6553 The perl executable is normally obtained by linking perlmain.c with
6554 libperl${_a}, any static extensions (usually just DynaLoader), and
6555 any other libraries needed on this system (such as -lm, etc.). Since
6556 your system supports dynamic loading, it is probably possible to build
6557 a shared libperl.$so. If you will have more than one executable linked
6558 to libperl.$so, this will significantly reduce the size of each
6559 executable, but it may have a noticeable affect on performance. The
6560 default is probably sensible for your system.
6564 rp="Build a shared libperl.$so (y/n)"
6568 useshrplib='true' ;;
6569 *) useshrplib='false' ;;
6574 case "$useshrplib" in
6578 # Figure out a good name for libperl.so. Since it gets stored in
6579 # a version-specific architecture-dependent library, the version
6580 # number isn't really that important, except for making cc/ld happy.
6582 # A name such as libperl.so.3.1
6583 majmin="libperl.$so.$patchlevel.$subversion"
6584 # A name such as libperl.so.301
6585 majonly=`echo $patchlevel $subversion |
6586 $awk '{printf "%d%02d", $1, $2}'`
6587 majonly=libperl.$so.$majonly
6588 # I'd prefer to keep the os-specific stuff here to a minimum, and
6589 # rely on figuring it out from the naming of libc.
6590 case "${osname}${osvers}" in
6593 # XXX How handle the --version stuff for MAB?
6595 linux*) # ld won't link with a bare -lperl otherwise.
6598 cygwin*) # include version
6599 dflt=`echo libperl$version | sed -e 's/\./_/g'`$lib_ext
6601 *) # Try to guess based on whether libc has major.minor.
6603 *libc.$so.[0-9]*.[0-9]*) dflt=$majmin ;;
6604 *libc.$so.[0-9]*) dflt=$majonly ;;
6605 *) dflt=libperl.$so ;;
6615 I need to select a good name for the shared libperl. If your system uses
6616 library names with major and minor numbers, then you might want something
6617 like $majmin. Alternatively, if your system uses a single version
6618 number for shared libraries, then you might want to use $majonly.
6619 Or, your system might be quite happy with a simple libperl.$so.
6621 Since the shared libperl will get installed into a version-specific
6622 architecture-dependent directory, the version number of the shared perl
6623 library probably isn't important, so the default should be o.k.
6626 rp='What name do you want to give to the shared libperl?'
6629 echo "Ok, I'll use $libperl"
6632 libperl="libperl${_a}"
6636 # Detect old use of shrpdir via undocumented Configure -Dshrpdir
6640 WARNING: Use of the shrpdir variable for the installation location of
6641 the shared $libperl is not supported. It was never documented and
6642 will not work in this version. Let me (perlbug@perl.org)
6643 know of any problems this may cause.
6649 But your current setting of $shrpdir is
6650 the default anyway, so it's harmless.
6655 Further, your current attempted setting of $shrpdir
6656 conflicts with the value of $archlibexp/CORE
6657 that installperl will use.
6664 # How will the perl executable find the installed shared $libperl?
6665 # Add $xxx to ccdlflags.
6666 # If we can't figure out a command-line option, use $shrpenv to
6667 # set env LD_RUN_PATH. The main perl makefile uses this.
6668 shrpdir=$archlibexp/CORE
6671 if "$useshrplib"; then
6674 # We'll set it in Makefile.SH...
6680 xxx="-Wl,-R$shrpdir"
6682 linux|irix*|dec_osf)
6683 xxx="-Wl,-rpath,$shrpdir"
6686 # next doesn't like the default...
6689 # beos doesn't like the default, either.
6692 # hpux doesn't like the default, either.
6693 tmp_shrpenv="env LDOPTS=\"+s +b${shrpdir}\""
6696 tmp_shrpenv="env LD_RUN_PATH=$shrpdir"
6702 # Only add $xxx if it isn't already in ccdlflags.
6703 case " $ccdlflags " in
6705 *) ccdlflags="$ccdlflags $xxx"
6708 Adding $xxx to the flags
6709 passed to $ld so that the perl executable will find the
6710 installed shared $libperl.
6718 # Fix ccdlflags in AIX for building external extensions.
6719 # (For building Perl itself bare -bE:perl.exp is needed,
6720 # Makefile.SH takes care of this.)
6722 aix) ccdlflags="$ccdlflags -bE:$installarchlib/CORE/perl.exp" ;;
6724 # Respect a hint or command-line value.
6726 '') shrpenv="$tmp_shrpenv" ;;
6728 case "$ldlibpthname" in
6729 '') ldlibpthname=LD_LIBRARY_PATH ;;
6730 none) ldlibpthname='' ;;
6733 : determine where manual pages are on this system
6737 syspath='/usr/man/man1 /usr/man/mann /usr/man/manl /usr/man/local/man1'
6738 syspath="$syspath /usr/man/u_man/man1 /usr/share/man/man1"
6739 syspath="$syspath /usr/catman/u_man/man1 /usr/man/l_man/man1"
6740 syspath="$syspath /usr/local/man/u_man/man1 /usr/local/man/l_man/man1"
6741 syspath="$syspath /usr/man/man.L /local/man/man1 /usr/local/man/man1"
6742 sysman=`./loc . /usr/man/man1 $syspath`
6745 if $test -d "$sysman"; then
6746 echo "System manual is in $sysman." >&4
6748 echo "Could not find manual pages in source form." >&4
6751 : determine where manual pages go
6752 set man1dir man1dir none
6756 $spackage has manual pages available in source form.
6760 echo "However, you don't have nroff, so they're probably useless to you."
6762 '') man1dir="none";;
6765 echo "If you don't want the manual sources installed, answer 'none'."
6770 lookpath="$prefixexp/man/man1 $prefixexp/man/l_man/man1"
6771 lookpath="$lookpath $prefixexp/man/p_man/man1"
6772 lookpath="$lookpath $prefixexp/man/u_man/man1"
6773 lookpath="$lookpath $prefixexp/man/man.1"
6775 */?_man*) dflt=`./loc . $prefixexp/l_man/man1 $lookpath` ;;
6776 *) dflt=`./loc . $prefixexp/man/man1 $lookpath` ;;
6786 rp="Where do the main $spackage manual pages (source) go?"
6788 if $test "X$man1direxp" != "X$ansexp"; then
6792 man1direxp="$ansexp"
6798 : Change installation prefix, if necessary.
6799 if $test X"$prefix" != X"$installprefix"; then
6800 installman1dir=`echo $man1direxp | $sed "s#^$prefix#$installprefix#"`
6802 installman1dir="$man1direxp"
6805 : What suffix to use on installed man pages
6812 rp="What suffix should be used for the main $spackage man pages?"
6814 '') case "$man1dir" in
6828 *) dflt="$man1ext";;
6835 : see if we can have long filenames
6837 first=123456789abcdef
6839 if (echo hi >$first) 2>/dev/null; then
6840 if $test -f 123456789abcde; then
6841 echo 'You cannot have filenames longer than 14 characters. Sigh.' >&4
6844 echo 'You can have filenames longer than 14 characters.'>&4
6849 You can't have filenames longer than 14 chars.
6850 You can't even think about them!
6856 $rm -rf 123456789abcde*
6858 : determine where library module manual pages go
6859 set man3dir man3dir none
6863 $spackage has manual pages for many of the library modules.
6869 However, you don't have nroff, so they're probably useless to you.
6872 '') man3dir="none";;
6876 case "$d_flexfnam" in
6879 However, your system can't handle the long file names like File::Basename.3.
6882 '') man3dir="none";;
6886 echo "If you don't want the manual sources installed, answer 'none'."
6887 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
6889 '') dflt=`echo "$man1dir" | $sed -e 's/man1/man3/g' -e 's/man\.1/man\.3/g'`
6890 if $test -d "$privlib/man/man3"; then
6893 WARNING: Previous versions of perl installed man3 pages into
6894 $privlib/man/man3. This version will suggest a
6895 new default of $dflt.
6899 rp='Do you wish to preserve the old behavior?(y/n)'
6902 y*) dflt="$privlib/man/man3" ;;
6907 *) dflt="$man3dir" ;;
6914 rp="Where do the $package library man pages (source) go?"
6917 man3direxp="$ansexp"
6923 : Change installation prefix, if necessary.
6924 if $test X"$prefix" != X"$installprefix"; then
6925 installman3dir=`echo $man3direxp | $sed "s#^$prefix#$installprefix#"`
6927 installman3dir="$man3direxp"
6930 : What suffix to use on installed man pages
6936 rp="What suffix should be used for the $package library man pages?"
6938 '') case "$man3dir" in
6952 *) dflt="$man3ext";;
6959 : see if we have to deal with yellow pages, now NIS.
6960 if $test -d /usr/etc/yp || $test -d /etc/yp; then
6961 if $test -f /usr/etc/nibindd; then
6963 echo "I'm fairly confident you're on a NeXT."
6965 rp='Do you get the hosts file via NetInfo?'
6974 y*) hostcat='nidump hosts .';;
6975 *) case "$hostcat" in
6976 nidump*) hostcat='';;
6986 '') if $contains '^\+' /etc/passwd >/dev/null 2>&1; then
6994 rp='Are you getting the hosts file via yellow pages?'
6997 y*) hostcat='ypcat hosts';;
6998 *) hostcat='cat /etc/hosts';;
7004 '') test -f /etc/hosts && hostcat='cat /etc/hosts';;
7007 '') test -f /etc/group && groupcat='cat /etc/group';;
7010 '') test -f /etc/passwd && passcat='cat /etc/passwd';;
7013 : now get the host name
7015 echo "Figuring out host name..." >&4
7016 case "$myhostname" in
7018 echo 'Maybe "hostname" will work...'
7019 if tans=`sh -c hostname 2>&1` ; then
7027 if $test "$cont"; then
7029 echo 'Oh, dear. Maybe "/etc/systemid" is the key...'
7030 if tans=`cat /etc/systemid 2>&1` ; then
7032 phostname='cat /etc/systemid'
7033 echo "Whadyaknow. Xenix always was a bit strange..."
7036 elif $test -r /etc/systemid; then
7037 echo "(What is a non-Xenix system doing with /etc/systemid?)"
7040 if $test "$cont"; then
7041 echo 'No, maybe "uuname -l" will work...'
7042 if tans=`sh -c 'uuname -l' 2>&1` ; then
7044 phostname='uuname -l'
7046 echo 'Strange. Maybe "uname -n" will work...'
7047 if tans=`sh -c 'uname -n' 2>&1` ; then
7049 phostname='uname -n'
7051 echo 'Oh well, maybe I can mine it out of whoami.h...'
7052 if tans=`sh -c $contains' sysname $usrinc/whoami.h' 2>&1` ; then
7053 myhostname=`echo "$tans" | $sed 's/^.*"\(.*\)"/\1/'`
7054 phostname="sed -n -e '"'/sysname/s/^.*\"\\(.*\\)\"/\1/{'"' -e p -e q -e '}' <$usrinc/whoami.h"
7056 case "$myhostname" in
7057 '') echo "Does this machine have an identity crisis or something?"
7060 echo "Well, you said $myhostname before..."
7061 phostname='echo $myhostname';;
7067 : you do not want to know about this
7072 if $test "$myhostname" ; then
7074 rp='Your host name appears to be "'$myhostname'".'" Right?"
7082 : bad guess or no guess
7083 while $test "X$myhostname" = X ; do
7085 rp="Please type the (one word) name of your host:"
7090 : translate upper to lower if necessary
7091 case "$myhostname" in
7093 echo "(Normalizing case in your host name)"
7094 myhostname=`echo $myhostname | ./tr '[A-Z]' '[a-z]'`
7098 case "$myhostname" in
7100 dflt=`expr "X$myhostname" : "X[^.]*\(\..*\)"`
7101 myhostname=`expr "X$myhostname" : "X\([^.]*\)\."`
7102 echo "(Trimming domain name from host name--host name is now $myhostname)"
7104 *) case "$mydomain" in
7107 test "X$hostcat" = "Xypcat hosts" &&
7108 ypmatch "$myhostname" hosts 2>/dev/null |\
7109 $sed -e 's/[ ]*#.*//; s/$/ /' > hosts && \
7112 test "X$hostcat" != "X" &&
7113 $hostcat | $sed -n -e "s/[ ]*#.*//; s/\$/ /
7114 /[ ]$myhostname[ . ]/p" > hosts
7117 $test x`$awk "/[0-9].*[ ]$myhostname$tmp_re/ { sum++ }
7118 END { print sum }" hosts` = x1 || tmp_re="[ ]"
7119 dflt=.`$awk "/[0-9].*[ ]$myhostname$tmp_re/ {for(i=2; i<=NF;i++) print \\\$i}" \
7120 hosts | $sort | $uniq | \
7121 $sed -n -e "s/$myhostname\.\([-a-zA-Z0-9_.]\)/\1/p"`
7122 case `$echo X$dflt` in
7123 X*\ *) echo "(Several hosts in /etc/hosts matched hostname)"
7126 X.) echo "(You do not have fully-qualified names in /etc/hosts)"
7131 tans=`./loc resolv.conf X /etc /usr/etc`
7132 if $test -f "$tans"; then
7133 echo "(Attempting domain name extraction from $tans)"
7134 dflt=.`$sed -n -e 's/ / /g' \
7135 -e 's/^search *\([^ ]*\).*/\1/p' $tans \
7136 | ./tr '[A-Z]' '[a-z]' 2>/dev/null`
7138 .) dflt=.`$sed -n -e 's/ / /g' \
7139 -e 's/^domain *\([^ ]*\).*/\1/p' $tans \
7140 | ./tr '[A-Z]' '[a-z]' 2>/dev/null`
7147 .) echo "(No help from resolv.conf either -- attempting clever guess)"
7148 dflt=.`sh -c domainname 2>/dev/null`
7151 .nis.*|.yp.*|.main.*) dflt=`echo $dflt | $sed -e 's/^\.[^.]*//'`;;
7156 .) echo "(Lost all hope -- silly guess then)"
7162 *) dflt="$mydomain";;
7166 rp="What is your domain name?"
7176 : translate upper to lower if necessary
7179 echo "(Normalizing case in your domain name)"
7180 mydomain=`echo $mydomain | ./tr '[A-Z]' '[a-z]'`
7184 : a little sanity check here
7185 case "$phostname" in
7188 case `$phostname | ./tr '[A-Z]' '[a-z]'` in
7189 $myhostname$mydomain|$myhostname) ;;
7191 case "$phostname" in
7193 echo "(That doesn't agree with your whoami.h file, by the way.)"
7196 echo "(That doesn't agree with your $phostname command, by the way.)"
7206 I need to get your e-mail address in Internet format if possible, i.e.
7207 something like user@host.domain. Please answer accurately since I have
7208 no easy means to double check it. The default value provided below
7209 is most probably close to reality but may not be valid from outside
7210 your organization...
7214 while test "$cont"; do
7216 '') dflt="$cf_by@$myhostname$mydomain";;
7217 *) dflt="$cf_email";;
7219 rp='What is your e-mail address?'
7225 rp='Address does not look like an Internet one. Use it anyway?'
7241 If you or somebody else will be maintaining perl at your site, please
7242 fill in the correct e-mail address here so that they may be contacted
7243 if necessary. Currently, the "perlbug" program included with perl
7244 will send mail to this address in addition to perlbug@perl.org. You may
7245 enter "none" for no administrator.
7248 case "$perladmin" in
7249 '') dflt="$cf_email";;
7250 *) dflt="$perladmin";;
7252 rp='Perl administrator e-mail address'
7256 : figure out how to guarantee perl startup
7257 case "$startperl" in
7259 case "$sharpbang" in
7263 I can use the #! construct to start perl on your system. This will
7264 make startup of perl scripts faster, but may cause problems if you
7265 want to share those scripts and perl is not in a standard place
7266 ($binexp/perl) on all your platforms. The alternative is to force
7267 a shell by starting the script with a single ':' character.
7271 rp='What shall I put after the #! to start up perl ("none" to not use #!)?'
7274 none) startperl=": # use perl";;
7275 *) startperl="#!$ans"
7276 if $test 30 -lt `echo "$ans" | wc -c`; then
7279 WARNING: Some systems limit the #! command to 32 characters.
7280 If you experience difficulty running Perl scripts with #!, try
7281 installing Perl in a directory with a shorter pathname.
7287 *) startperl=": # use perl"
7292 echo "I'll use $startperl to start perl scripts."
7294 : figure best path for perl in scripts
7297 perlpath="$binexp/perl"
7298 case "$startperl" in
7303 I will use the "eval 'exec'" idiom to start Perl on your system.
7304 I can use the full path of your Perl binary for this purpose, but
7305 doing so may cause problems if you want to share those scripts and
7306 Perl is not always in a standard place ($binexp/perl).
7310 rp="What path shall I use in \"eval 'exec'\"?"
7317 case "$startperl" in
7319 *) echo "I'll use $perlpath in \"eval 'exec'\"" ;;
7322 : determine where public executable scripts go
7323 set scriptdir scriptdir
7325 case "$scriptdir" in
7328 : guess some guesses
7329 $test -d /usr/share/scripts && dflt=/usr/share/scripts
7330 $test -d /usr/share/bin && dflt=/usr/share/bin
7331 $test -d /usr/local/script && dflt=/usr/local/script
7332 $test -d /usr/local/scripts && dflt=/usr/local/scripts
7333 $test -d $prefixexp/script && dflt=$prefixexp/script
7337 *) dflt="$scriptdir"
7342 Some installations have a separate directory just for executable scripts so
7343 that they can mount it across multiple architectures but keep the scripts in
7344 one spot. You might, for example, have a subdirectory of /usr/share for this.
7345 Or you might just lump your scripts in with all your other executables.
7349 rp='Where do you keep publicly executable scripts?'
7351 if $test "X$ansexp" != "X$scriptdirexp"; then
7355 scriptdirexp="$ansexp"
7356 : Change installation prefix, if necessary.
7357 if $test X"$prefix" != X"$installprefix"; then
7358 installscript=`echo $scriptdirexp | sed "s#^$prefix#$installprefix#"`
7360 installscript="$scriptdirexp"
7363 : determine where add-on public executables go
7365 '') dflt=$siteprefix/bin ;;
7369 rp='Pathname where the add-on public executables should be installed?'
7372 sitebinexp="$ansexp"
7373 : Change installation prefix, if necessary.
7374 if $test X"$prefix" != X"$installprefix"; then
7375 installsitebin=`echo $sitebinexp | sed "s#^$prefix#$installprefix#"`
7377 installsitebin="$sitebinexp"
7380 case "$useperlio" in
7381 $define|true|[yY]*) dflt='y';;
7386 Previous version of $package used the standard IO mechanisms as defined
7387 in <stdio.h>. Versions 5.003_02 and later of perl allow alternate IO
7388 mechanisms via a "PerlIO" abstraction, but the stdio mechanism is still
7389 the default. This abstraction layer can use AT&T's sfio (if you already
7390 have sfio installed) or regular stdio. Using PerlIO with sfio may cause
7391 problems with some extension modules. Using PerlIO with stdio is safe,
7392 but it is slower than plain stdio and therefore is not the default.
7394 If this doesn't make any sense to you, just accept the default '$dflt'.
7396 rp='Use the experimental PerlIO abstraction layer?'
7403 echo "Ok, doing things the stdio way"
7410 case "$vendorprefix" in
7411 '') d_vendorbin="$undef"
7415 *) d_vendorbin="$define"
7416 : determine where vendor-supplied executables go.
7417 case "$vendorbin" in
7418 '') dflt=$vendorprefix/bin ;;
7419 *) dflt="$vendorbin" ;;
7422 rp='Pathname for the vendor-supplied executables directory?'
7425 vendorbinexp="$ansexp"
7428 : Change installation prefix, if necessary.
7429 if $test X"$prefix" != X"$installprefix"; then
7430 installvendorbin=`echo $vendorbinexp | $sed "s#^$prefix#$installprefix#"`
7432 installvendorbin="$vendorbinexp"
7435 : see if qgcvt exists
7441 if $test X"$d_longdbl" = X"$define"; then
7443 echo "Checking how to print long doubles..." >&4
7445 if $test X"$sPRIfldbl" = X -a X"$doublesize" = X"$longdblsize"; then
7446 $cat >try.c <<'EOCP'
7447 #include <sys/types.h>
7451 printf("%.3f\n", d);
7455 if eval $compile; then
7459 sPRIfldbl='"f"'; sPRIgldbl='"g"'; sPRIeldbl='"e"';
7460 sPRIFUldbl='"F"'; sPRIGUldbl='"G"'; sPRIEUldbl='"E"';
7461 echo "We will use %f."
7467 if $test X"$sPRIfldbl" = X; then
7468 $cat >try.c <<'EOCP'
7469 #include <sys/types.h>
7472 long double d = 123.456;
7473 printf("%.3llf\n", d);
7477 if eval $compile; then
7481 sPRIfldbl='"llf"'; sPRIgldbl='"llg"'; sPRIeldbl='"lle"';
7482 sPRIFUldbl='"llF"'; sPRIGUldbl='"llG"'; sPRIEUldbl='"llE"';
7483 echo "We will use %llf."
7489 if $test X"$sPRIfldbl" = X; then
7490 $cat >try.c <<'EOCP'
7491 #include <sys/types.h>
7494 long double d = 123.456;
7495 printf("%.3Lf\n", d);
7499 if eval $compile; then
7503 sPRIfldbl='"Lf"'; sPRIgldbl='"Lg"'; sPRIeldbl='"Le"';
7504 sPRIFUldbl='"LF"'; sPRIGUldbl='"LG"'; sPRIEUldbl='"LE"';
7505 echo "We will use %Lf."
7511 if $test X"$sPRIfldbl" = X; then
7512 $cat >try.c <<'EOCP'
7513 #include <sys/types.h>
7516 long double d = 123.456;
7517 printf("%.3lf\n", d);
7521 if eval $compile; then
7525 sPRIfldbl='"lf"'; sPRIgldbl='"lg"'; sPRIeldbl='"le"';
7526 sPRIFUldbl='"lF"'; sPRIGUldbl='"lG"'; sPRIEUldbl='"lE"';
7527 echo "We will use %lf."
7533 if $test X"$sPRIfldbl" = X; then
7534 echo "Cannot figure out how to print long doubles." >&4
7536 sSCNfldbl=$sPRIfldbl # expect consistency
7543 case "$sPRIfldbl" in
7544 '') d_PRIfldbl="$undef"; d_PRIgldbl="$undef"; d_PRIeldbl="$undef";
7545 d_PRIFUldbl="$undef"; d_PRIGUldbl="$undef"; d_PRIEUldbl="$undef";
7546 d_SCNfldbl="$undef";
7548 *) d_PRIfldbl="$define"; d_PRIgldbl="$define"; d_PRIeldbl="$define";
7549 d_PRIFUldbl="$define"; d_PRIGUldbl="$define"; d_PRIEUldbl="$define";
7550 d_SCNfldbl="$define";
7554 : Check how to convert floats to strings.
7556 echo "Checking for an efficient way to convert floats to strings."
7558 case "$uselongdouble" in
7559 "$define") echo "#define USE_LONG_DOUBLE" >>try.c ;;
7561 case "$d_longdbl" in
7562 "$define") echo "#define HAS_LONG_DOUBLE" >>try.c ;;
7564 case "$d_PRIgldbl" in
7565 "$define") echo "#define HAS_PRIgldbl" >>try.c ;;
7569 #define Gconvert(x,n,t,b) gconvert((x),(n),(t),(b))
7570 char *myname = "gconvert";
7573 #define Gconvert(x,n,t,b) gcvt((x),(n),(b))
7574 char *myname = "gcvt";
7577 #define Gconvert(x,n,t,b) qgcvt((x),(n),(b))
7578 char *myname = "qgcvt";
7579 #define DOUBLETYPE long double
7582 #if defined(USE_LONG_DOUBLE) && defined(HAS_LONG_DOUBLE) && defined(HAS_PRIgldbl)
7583 #define Gconvert(x,n,t,b) sprintf((b),"%.*"$sPRIgldbl,(n),(x))
7585 #define Gconvert(x,n,t,b) sprintf((b),"%.*g",(n),(x))
7587 char *myname = "sprintf";
7591 #if defined(USE_LONG_DOUBLE) && defined(HAS_LONG_DOUBLE)
7592 #define DOUBLETYPE long double
7594 #define DOUBLETYPE double
7600 #define I_STDLIB $i_stdlib
7606 checkit(expect, got)
7610 if (strcmp(expect, got)) {
7611 printf("%s oddity: Expected %s, got %s\n",
7612 myname, expect, got);
7622 /* This must be 1st test on (which?) platform */
7623 /* Alan Burlison <AlanBurlsin@unn.unisys.com> */
7624 Gconvert((DOUBLETYPE)0.1, 8, 0, buf);
7625 checkit("0.1", buf);
7627 Gconvert((DOUBLETYPE)1.0, 8, 0, buf);
7630 Gconvert((DOUBLETYPE)1.1, 8, 0, buf);
7631 checkit("1.1", buf);
7633 Gconvert((DOUBLETYPE)1.01, 8, 0, buf);
7634 checkit("1.01", buf);
7636 Gconvert((DOUBLETYPE)1.001, 8, 0, buf);
7637 checkit("1.001", buf);
7639 Gconvert((DOUBLETYPE)1.0001, 8, 0, buf);
7640 checkit("1.0001", buf);
7642 Gconvert((DOUBLETYPE)1.00001, 8, 0, buf);
7643 checkit("1.00001", buf);
7645 Gconvert((DOUBLETYPE)1.000001, 8, 0, buf);
7646 checkit("1.000001", buf);
7648 Gconvert((DOUBLETYPE)0.0, 8, 0, buf);
7651 Gconvert((DOUBLETYPE)-1.0, 8, 0, buf);
7654 /* Some Linux gcvt's give 1.e+5 here. */
7655 Gconvert((DOUBLETYPE)100000.0, 8, 0, buf);
7656 checkit("100000", buf);
7658 /* Some Linux gcvt's give -1.e+5 here. */
7659 Gconvert((DOUBLETYPE)-100000.0, 8, 0, buf);
7660 checkit("-100000", buf);
7662 Gconvert((DOUBLETYPE)123.456, 8, 0, buf);
7663 checkit("123.456", buf);
7668 case "$d_Gconvert" in
7669 gconvert*) xxx_list='gconvert gcvt sprintf' ;;
7670 gcvt*) xxx_list='gcvt gconvert sprintf' ;;
7671 sprintf*) xxx_list='sprintf gconvert gcvt' ;;
7672 *) xxx_list='gconvert gcvt sprintf' ;;
7675 case "$d_longdbl$uselongdouble$d_PRIgldbl" in
7676 "$define$define$define")
7677 # for long doubles prefer first qgcvt, then sprintf
7678 xxx_list="`echo $xxx_list|sed s/sprintf//`"
7679 xxx_list="sprintf $xxx_list"
7681 "$define") xxx_list="qgcvt $xxx_list" ;;
7686 for xxx_convert in $xxx_list; do
7687 echo "Trying $xxx_convert..."
7689 set try -DTRY_$xxx_convert
7690 if eval $compile; then
7691 echo "$xxx_convert() found." >&4
7693 echo "I'll use $xxx_convert to convert floats into a string." >&4
7696 echo "...But $xxx_convert didn't work as I expected."
7699 echo "$xxx_convert NOT found." >&4
7703 case "$xxx_convert" in
7704 gconvert) d_Gconvert='gconvert((x),(n),(t),(b))' ;;
7705 gcvt) d_Gconvert='gcvt((x),(n),(b))' ;;
7706 qgcvt) d_Gconvert='qgcvt((x),(n),(b))' ;;
7707 *) case "$uselongdouble$d_longdbl$d_PRIgldbl" in
7708 "$define$define$define")
7709 d_Gconvert="sprintf((b),\"%.*\"$sPRIgldbl,(n),(x))" ;;
7710 *) d_Gconvert='sprintf((b),"%.*g",(n),(x))' ;;
7715 : Initialize h_fcntl
7718 : Initialize h_sysfile
7721 : access call always available on UNIX
7725 : locate the flags for 'access()'
7729 $cat >access.c <<'EOCP'
7730 #include <sys/types.h>
7735 #include <sys/file.h>
7744 : check sys/file.h first, no particular reason here
7745 if $test `./findhdr sys/file.h` && \
7746 $cc $cppflags -DI_SYS_FILE -o access access.c >/dev/null 2>&1 ; then
7748 echo "<sys/file.h> defines the *_OK access constants." >&4
7749 elif $test `./findhdr fcntl.h` && \
7750 $cc $cppflags -DI_FCNTL -o access access.c >/dev/null 2>&1 ; then
7752 echo "<fcntl.h> defines the *_OK access constants." >&4
7753 elif $test `./findhdr unistd.h` && \
7754 $cc $cppflags -DI_UNISTD -o access access.c >/dev/null 2>&1 ; then
7755 echo "<unistd.h> defines the *_OK access constants." >&4
7757 echo "I can't find the four *_OK access constants--I'll use mine." >&4
7763 : see if accessx exists
7764 set accessx d_accessx
7767 : see if alarm exists
7771 : see if atolf exists
7775 : see if atoll exists
7779 : Look for GNU-cc style attribute checking
7781 echo "Checking whether your compiler can handle __attribute__ ..." >&4
7782 $cat >attrib.c <<'EOCP'
7784 void croak (char* pat,...) __attribute__((format(printf,1,2),noreturn));
7786 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
7787 if $contains 'warning' attrib.out >/dev/null 2>&1; then
7788 echo "Your C compiler doesn't fully support __attribute__."
7791 echo "Your C compiler supports __attribute__."
7795 echo "Your C compiler doesn't seem to understand __attribute__ at all."
7802 : see if bcmp exists
7806 : see if bcopy exists
7810 : see if this is a unistd.h system
7811 set unistd.h i_unistd
7814 : see if getpgrp exists
7815 set getpgrp d_getpgrp
7818 case "$d_getpgrp" in
7821 echo "Checking to see which flavor of getpgrp is in use..."
7824 #include <sys/types.h>
7826 # include <unistd.h>
7830 if (getuid() == 0) {
7831 printf("(I see you are running Configure as super-user...)\n");
7835 if (getpgrp(1) == 0)
7844 if $cc -DTRY_BSD_PGRP $ccflags $ldflags -o set set.c $libs >/dev/null 2>&1 && ./set; then
7845 echo "You have to use getpgrp(pid) instead of getpgrp()." >&4
7847 elif $cc $ccflags $ldflags -o set set.c $libs >/dev/null 2>&1 && ./set; then
7848 echo "You have to use getpgrp() instead of getpgrp(pid)." >&4
7851 echo "I can't seem to compile and run the test program."
7853 xxx="a USG one, i.e. you use getpgrp()."
7855 # SVR4 systems can appear rather BSD-ish.
7858 xxx="a BSD one, i.e. you use getpgrp(pid)."
7862 xxx="probably a USG one, i.e. you use getpgrp()."
7867 echo "Assuming your getpgrp is $xxx" >&4
7876 : see if setpgrp exists
7877 set setpgrp d_setpgrp
7880 case "$d_setpgrp" in
7883 echo "Checking to see which flavor of setpgrp is in use..."
7886 #include <sys/types.h>
7888 # include <unistd.h>
7892 if (getuid() == 0) {
7893 printf("(I see you are running Configure as super-user...)\n");
7897 if (-1 == setpgrp(1, 1))
7900 if (setpgrp() != -1)
7906 if $cc -DTRY_BSD_PGRP $ccflags $ldflags -o set set.c $libs >/dev/null 2>&1 && ./set; then
7907 echo 'You have to use setpgrp(pid,pgrp) instead of setpgrp().' >&4
7909 elif $cc $ccflags $ldflags -o set set.c $libs >/dev/null 2>&1 && ./set; then
7910 echo 'You have to use setpgrp() instead of setpgrp(pid,pgrp).' >&4
7913 echo "(I can't seem to compile and run the test program.)"
7915 xxx="a USG one, i.e. you use setpgrp()."
7917 # SVR4 systems can appear rather BSD-ish.
7920 xxx="a BSD one, i.e. you use setpgrp(pid,pgrp)."
7924 xxx="probably a USG one, i.e. you use setpgrp()."
7929 echo "Assuming your setpgrp is $xxx" >&4
7937 : see if bzero exists
7941 : see if signal is declared as pointer to function returning int or void
7943 xxx=`./findhdr signal.h`
7944 $test "$xxx" && $cppstdin $cppminus $cppflags < $xxx >$$.tmp 2>/dev/null
7945 if $contains 'int.*\*[ ]*signal' $$.tmp >/dev/null 2>&1 ; then
7946 echo "You have int (*signal())() instead of void." >&4
7948 elif $contains 'void.*\*[ ]*signal' $$.tmp >/dev/null 2>&1 ; then
7949 echo "You have void (*signal())()." >&4
7951 elif $contains 'extern[ ]*[(\*]*signal' $$.tmp >/dev/null 2>&1 ; then
7952 echo "You have int (*signal())() instead of void." >&4
7954 elif $contains 'void.*\*.*sig' $$.tmp >/dev/null 2>&1 ; then
7955 echo "You have void (*signal())()." >&4
7958 case "$d_voidsig" in
7960 echo "I can't determine whether signal handler returns void or int..." >&4
7962 rp="What type does your signal handler return?"
7969 echo "As you already told me, signal handler returns void." >&4
7972 *) echo "As you already told me, signal handler returns int." >&4
7979 case "$d_voidsig" in
7980 "$define") signal_t="void";;
7985 : check for ability to cast large floats to 32-bit ints.
7987 echo 'Checking whether your C compiler can cast large floats to int32.' >&4
7988 if $test "$intsize" -ge 4; then
7995 #include <sys/types.h>
7997 $signal_t blech(s) int s; { exit(3); }
8004 signal(SIGFPE, blech);
8006 /* Don't let compiler optimize the test away. Store the number
8007 in a writable string for gcc to pass to sscanf under HP/UX.
8009 sprintf(str, "2147483647");
8010 sscanf(str, "%lf", &f); /* f = (double) 0x7fffffff; */
8014 /* x86 processors will probably give 0x8000 0000, which is a
8015 sign change. We don't want that. We want to mimic SPARC
8016 behavior here, which is to preserve the sign and give
8019 if (i32 != ($xxx) f)
8025 if eval $compile_ok; then
8029 echo "(I can't seem to compile the test program--assuming it can't)"
8037 echo "Nope, it can't."
8044 : check for ability to cast negative floats to unsigned
8046 echo 'Checking whether your C compiler can cast negative float to unsigned.' >&4
8049 #include <sys/types.h>
8051 $signal_t blech(s) int s; { exit(7); }
8052 $signal_t blech_in_list(s) int s; { exit(4); }
8053 unsigned long dummy_long(p) unsigned long p; { return p; }
8054 unsigned int dummy_int(p) unsigned int p; { return p; }
8055 unsigned short dummy_short(p) unsigned short p; { return p; }
8059 unsigned long along;
8061 unsigned short ashort;
8065 /* Frustrate gcc-2.7.2's optimizer which failed this test with
8066 a direct f = -123. assignment. gcc-2.8.0 reportedly
8067 optimized the whole file away
8069 /* Store the number in a writable string for gcc to pass to
8072 sprintf(str, "-123");
8073 sscanf(str, "%lf", &f); /* f = -123.; */
8075 signal(SIGFPE, blech);
8076 along = (unsigned long)f;
8077 aint = (unsigned int)f;
8078 ashort = (unsigned short)f;
8079 if (along != (unsigned long)-123)
8081 if (aint != (unsigned int)-123)
8083 if (ashort != (unsigned short)-123)
8085 sprintf(str, "1073741824.");
8086 sscanf(str, "%lf", &f); /* f = (double)0x40000000; */
8089 along = (unsigned long)f;
8090 if (along != 0x80000000)
8094 along = (unsigned long)f;
8095 if (along != 0x7fffffff)
8099 along = (unsigned long)f;
8100 if (along != 0x80000001)
8104 signal(SIGFPE, blech_in_list);
8105 sprintf(str, "123.");
8106 sscanf(str, "%lf", &f); /* f = 123.; */
8107 along = dummy_long((unsigned long)f);
8108 aint = dummy_int((unsigned int)f);
8109 ashort = dummy_short((unsigned short)f);
8110 if (along != (unsigned long)123)
8112 if (aint != (unsigned int)123)
8114 if (ashort != (unsigned short)123)
8121 if eval $compile_ok; then
8125 echo "(I can't seem to compile the test program--assuming it can't)"
8128 case "$castflags" in
8133 echo "Nope, it can't."
8140 : see if vprintf exists
8142 if set vprintf val -f d_vprintf; eval $csym; $val; then
8143 echo 'vprintf() found.' >&4
8145 $cat >vprintf.c <<'EOF'
8146 #include <varargs.h>
8148 int main() { xxx("foo"); }
8157 exit((unsigned long)vsprintf(buf,"%s",args) > 10L);
8161 if eval $compile && ./vprintf; then
8162 echo "Your vsprintf() returns (int)." >&4
8165 echo "Your vsprintf() returns (char*)." >&4
8169 echo 'vprintf() NOT found.' >&4
8179 : see if chown exists
8183 : see if chroot exists
8187 : see if chsize exists
8191 : check for const keyword
8193 echo 'Checking to see if your C compiler knows about "const"...' >&4
8194 $cat >const.c <<'EOCP'
8195 typedef struct spug { int drokk; } spug;
8202 if $cc -c $ccflags const.c >/dev/null 2>&1 ; then
8204 echo "Yup, it does."
8207 echo "Nope, it doesn't."
8212 : see if crypt exists
8214 if set crypt val -f d_crypt; eval $csym; $val; then
8215 echo 'crypt() found.' >&4
8219 cryptlib=`./loc Slibcrypt$_a "" $xlibpth`
8220 if $test -z "$cryptlib"; then
8221 cryptlib=`./loc Mlibcrypt$_a "" $xlibpth`
8225 if $test -z "$cryptlib"; then
8226 cryptlib=`./loc Llibcrypt$_a "" $xlibpth`
8230 if $test -z "$cryptlib"; then
8231 cryptlib=`./loc libcrypt$_a "" $libpth`
8235 if $test -z "$cryptlib"; then
8236 echo 'crypt() NOT found.' >&4
8245 : get csh whereabouts
8247 'csh') val="$undef" ;;
8252 : Respect a hint or command line value for full_csh.
8254 '') full_csh=$csh ;;
8257 : see if cuserid exists
8258 set cuserid d_cuserid
8261 : see if this is a limits.h system
8262 set limits.h i_limits
8265 : see if this is a float.h system
8269 : See if number of significant digits in a double precision number is known
8271 $cat >dbl_dig.c <<EOM
8281 printf("Contains DBL_DIG");
8284 $cppstdin $cppflags $cppminus < dbl_dig.c >dbl_dig.E 2>/dev/null
8285 if $contains 'DBL_DIG' dbl_dig.E >/dev/null 2>&1; then
8286 echo "DBL_DIG found." >&4
8289 echo "DBL_DIG NOT found." >&4
8296 : see if difftime exists
8297 set difftime d_difftime
8300 : see if this is a dirent system
8302 if xinc=`./findhdr dirent.h`; $test "$xinc"; then
8304 echo "<dirent.h> found." >&4
8307 if xinc=`./findhdr sys/dir.h`; $test "$xinc"; then
8308 echo "<sys/dir.h> found." >&4
8311 xinc=`./findhdr sys/ndir.h`
8313 echo "<dirent.h> NOT found." >&4
8318 : Look for type of directory structure.
8320 $cppstdin $cppflags $cppminus < "$xinc" > try.c
8322 case "$direntrytype" in
8325 $define) guess1='struct dirent' ;;
8326 *) guess1='struct direct' ;;
8329 *) guess1="$direntrytype"
8334 'struct dirent') guess2='struct direct' ;;
8335 *) guess2='struct dirent' ;;
8338 if $contains "$guess1" try.c >/dev/null 2>&1; then
8339 direntrytype="$guess1"
8340 echo "Your directory entries are $direntrytype." >&4
8341 elif $contains "$guess2" try.c >/dev/null 2>&1; then
8342 direntrytype="$guess2"
8343 echo "Your directory entries seem to be $direntrytype." >&4
8345 echo "I don't recognize your system's directory entries." >&4
8346 rp="What type is used for directory entries on this system?"
8354 : see if the directory entry stores field length
8356 $cppstdin $cppflags $cppminus < "$xinc" > try.c
8357 if $contains 'd_namlen' try.c >/dev/null 2>&1; then
8358 echo "Good, your directory entry keeps length information in d_namlen." >&4
8361 echo "Your directory entry does not know about the d_namlen field." >&4
8368 : see if dlerror exists
8371 set dlerror d_dlerror
8375 : see if dlfcn is available
8383 On a few systems, the dynamically loaded modules that perl generates and uses
8384 will need a different extension than shared libs. The default will probably
8392 rp='What is the extension of dynamically loaded modules'
8401 : Check if dlsym need a leading underscore
8407 echo "Checking whether your dlsym() needs a leading underscore ..." >&4
8408 $cat >dyna.c <<'EOM'
8417 #include <dlfcn.h> /* the dynamic linker include file for Sunos/Solaris */
8419 #include <sys/types.h>
8433 int mode = RTLD_LAZY ;
8435 handle = dlopen("./dyna.$dlext", mode) ;
8436 if (handle == NULL) {
8441 symbol = dlsym(handle, "fred") ;
8442 if (symbol == NULL) {
8443 /* try putting a leading underscore */
8444 symbol = dlsym(handle, "_fred") ;
8445 if (symbol == NULL) {
8458 : Call the object file tmp-dyna.o in case dlext=o.
8459 if $cc $ccflags $cccdlflags -c dyna.c > /dev/null 2>&1 &&
8460 mv dyna${_o} tmp-dyna${_o} > /dev/null 2>&1 &&
8461 $ld $lddlflags -o dyna.$dlext tmp-dyna${_o} > /dev/null 2>&1 &&
8462 $cc $ccflags -o fred $ldflags $cccdlflags $ccdlflags fred.c $libs > /dev/null 2>&1; then
8465 1) echo "Test program failed using dlopen." >&4
8466 echo "Perhaps you should not use dynamic loading." >&4;;
8467 2) echo "Test program failed using dlsym." >&4
8468 echo "Perhaps you should not use dynamic loading." >&4;;
8469 3) echo "dlsym needs a leading underscore" >&4
8471 4) echo "dlsym doesn't need a leading underscore." >&4;;
8474 echo "I can't compile and run the test program." >&4
8475 echo "I'm guessing that dlsym doesn't need a leading underscore." >&4
8480 $rm -f fred fred.? dyna.$dlext dyna.? tmp-dyna.?
8485 hasproto='varname=$1; func=$2; shift; shift;
8486 while $test $# -ge 2; do
8488 $define) echo "#include <$2>";;
8492 $cppstdin $cppflags $cppminus < try.c > tryout.c 2>/dev/null;
8493 if $contains "$func.*(" tryout.c >/dev/null 2>&1; then
8494 echo "$func() prototype found.";
8497 echo "$func() prototype NOT found.";
8502 $rm -f try.c tryout.c'
8504 : see if prototype for drand48 is available
8506 set d_drand48proto drand48 $i_stdlib stdlib.h $i_unistd unistd.h
8509 : see if dup2 exists
8513 : see if eaccess exists
8514 set eaccess d_eaccess
8517 : see if endgrent exists
8518 set endgrent d_endgrent
8521 : see if endhostent exists
8522 set endhostent d_endhent
8525 : see if endnetent exists
8526 set endnetent d_endnent
8529 : see if endprotoent exists
8530 set endprotoent d_endpent
8533 : see if endpwent exists
8534 set endpwent d_endpwent
8537 : see if endservent exists
8538 set endservent d_endsent
8541 : Locate the flags for 'open()'
8543 $cat >open3.c <<'EOCP'
8544 #include <sys/types.h>
8549 #include <sys/file.h>
8560 : check sys/file.h first to get FREAD on Sun
8561 if $test `./findhdr sys/file.h` && \
8562 set open3 -DI_SYS_FILE && eval $compile; then
8564 echo "<sys/file.h> defines the O_* constants..." >&4
8566 echo "and you have the 3 argument form of open()." >&4
8569 echo "but not the 3 argument form of open(). Oh, well." >&4
8572 elif $test `./findhdr fcntl.h` && \
8573 set open3 -DI_FCNTL && eval $compile; then
8575 echo "<fcntl.h> defines the O_* constants..." >&4
8577 echo "and you have the 3 argument form of open()." >&4
8580 echo "but not the 3 argument form of open(). Oh, well." >&4
8585 echo "I can't find the O_* constant definitions! You got problems." >&4
8591 : see which of string.h or strings.h is needed
8593 strings=`./findhdr string.h`
8594 if $test "$strings" && $test -r "$strings"; then
8595 echo "Using <string.h> instead of <strings.h>." >&4
8599 strings=`./findhdr strings.h`
8600 if $test "$strings" && $test -r "$strings"; then
8601 echo "Using <strings.h> instead of <string.h>." >&4
8603 echo "No string header found -- You'll surely have problems." >&4
8609 "$undef") strings=`./findhdr strings.h`;;
8610 *) strings=`./findhdr string.h`;;
8613 : check for non-blocking I/O stuff
8614 case "$h_sysfile" in
8615 true) echo "#include <sys/file.h>" > head.c;;
8618 true) echo "#include <fcntl.h>" > head.c;;
8619 *) echo "#include <sys/fcntl.h>" > head.c;;
8624 echo "Figuring out the flag used by open() for non-blocking I/O..." >&4
8625 case "$o_nonblock" in
8628 $cat >>try.c <<'EOCP'
8632 printf("O_NONBLOCK\n");
8636 printf("O_NDELAY\n");
8640 printf("FNDELAY\n");
8647 if eval $compile_ok; then
8649 case "$o_nonblock" in
8650 '') echo "I can't figure it out, assuming O_NONBLOCK will do.";;
8651 *) echo "Seems like we can use $o_nonblock.";;
8654 echo "(I can't compile the test program; pray O_NONBLOCK is right!)"
8657 *) echo "Using $hint value $o_nonblock.";;
8659 $rm -f try try.* .out core
8662 echo "Let's see what value errno gets from read() on a $o_nonblock file..." >&4
8668 #include <sys/types.h>
8671 #define MY_O_NONBLOCK $o_nonblock
8672 #ifndef errno /* XXX need better Configure test */
8683 #include <strings.h>
8685 $signal_t blech(x) int x; { exit(3); }
8687 $cat >> try.c <<'EOCP'
8695 pipe(pd); /* Down: child -> parent */
8696 pipe(pu); /* Up: parent -> child */
8699 close(pd[1]); /* Parent reads from pd[0] */
8700 close(pu[0]); /* Parent writes (blocking) to pu[1] */
8701 if (-1 == fcntl(pd[0], F_SETFL, MY_O_NONBLOCK))
8703 signal(SIGALRM, blech);
8705 if ((ret = read(pd[0], buf, 1)) > 0) /* Nothing to read! */
8707 sprintf(string, "%d\n", ret);
8708 write(2, string, strlen(string));
8711 if (errno == EAGAIN) {
8717 if (errno == EWOULDBLOCK)
8718 printf("EWOULDBLOCK\n");
8721 write(pu[1], buf, 1); /* Unblocks child, tell it to close our pipe */
8722 sleep(2); /* Give it time to close our pipe */
8724 ret = read(pd[0], buf, 1); /* Should read EOF */
8726 sprintf(string, "%d\n", ret);
8727 write(3, string, strlen(string));
8731 close(pd[0]); /* We write to pd[1] */
8732 close(pu[1]); /* We read from pu[0] */
8733 read(pu[0], buf, 1); /* Wait for parent to signal us we may continue */
8734 close(pd[1]); /* Pipe pd is now fully closed! */
8735 exit(0); /* Bye bye, thank you for playing! */
8739 if eval $compile_ok; then
8740 echo "$startsh" >mtry
8741 echo "./try >try.out 2>try.ret 3>try.err || exit 4" >>mtry
8743 ./mtry >/dev/null 2>&1
8745 0) eagain=`$cat try.out`;;
8746 1) echo "Could not perform non-blocking setting!";;
8747 2) echo "I did a successful read() for something that was not there!";;
8748 3) echo "Hmm... non-blocking I/O does not seem to be working!";;
8749 *) echo "Something terribly wrong happened during testing.";;
8751 rd_nodata=`$cat try.ret`
8752 echo "A read() system call with no data present returns $rd_nodata."
8753 case "$rd_nodata" in
8756 echo "(That's peculiar, fixing that to be -1.)"
8762 echo "Forcing errno EAGAIN on read() with no data available."
8766 echo "Your read() sets errno to $eagain when no data is available."
8769 status=`$cat try.err`
8771 0) echo "And it correctly returns 0 to signal EOF.";;
8772 -1) echo "But it also returns -1 to signal EOF, so be careful!";;
8773 *) echo "However, your read() returns '$status' on EOF??";;
8776 if test "$status" = "$rd_nodata"; then
8777 echo "WARNING: you can't distinguish between EOF and no data!"
8781 echo "I can't compile the test program--assuming errno EAGAIN will do."
8788 echo "Using $hint value $eagain."
8789 echo "Your read() returns $rd_nodata when no data is present."
8790 case "$d_eofnblk" in
8791 "$define") echo "And you can see EOF because read() returns 0.";;
8792 "$undef") echo "But you can't see EOF status from read() returned value.";;
8794 echo "(Assuming you can't see EOF status from read anyway.)"
8800 $rm -f try try.* .out core head.c mtry
8802 : see if fchmod exists
8806 : see if fchown exists
8810 : see if this is an fcntl system
8814 hasfield='varname=$1; struct=$2; field=$3; shift; shift; shift;
8815 while $test $# -ge 2; do
8817 $define) echo "#include <$2>";;
8821 echo "int main () { struct $struct foo; char* bar; bar = (char*)foo.$field; }" >> try.c;
8823 if eval $compile; then
8834 : see whether socket exists
8836 $echo $n "Hmm... $c" >&4
8837 if set socket val -f d_socket; eval $csym; $val; then
8838 echo "Looks like you have Berkeley networking support." >&4
8840 if set setsockopt val -f; eval $csym; $val; then
8843 echo "...but it uses the old BSD 4.1c interface, rather than 4.2." >&4
8847 if $contains socklib libc.list >/dev/null 2>&1; then
8848 echo "Looks like you have Berkeley networking support." >&4
8850 : we will have to assume that it supports the 4.2 BSD interface
8853 echo "You don't have Berkeley networking in libc$_a..." >&4
8854 if test "X$d_socket" = "X$define"; then
8855 echo "...but you seem to believe that you have sockets." >&4
8857 for net in net socket
8859 if test -f /usr/lib/lib$net$_a; then
8860 ( ($nm $nm_opt /usr/lib/lib$net$_a | eval $nm_extract) || \
8861 $ar t /usr/lib/lib$net$_a) 2>/dev/null >> libc.list
8862 if $contains socket libc.list >/dev/null 2>&1; then
8867 echo "...but the Wollongong group seems to have hacked it in." >&4
8868 sockethdr="-I/usr/netinclude"
8871 echo "Found Berkeley sockets interface in lib$net." >& 4
8872 if $contains setsockopt libc.list >/dev/null 2>&1; then
8875 echo "...using the old BSD 4.1c interface, rather than 4.2." >&4
8882 if test "X$d_socket" != "X$define"; then
8883 echo "or anywhere else I see." >&4
8891 : see if socketpair exists
8892 set socketpair d_sockpair
8897 echo "Checking the availability of certain socket constants..." >& 4
8898 for ENUM in MSG_CTRUNC MSG_DONTROUTE MSG_OOB MSG_PEEK MSG_PROXY SCM_RIGHTS; do
8899 enum=`$echo $ENUM|./tr '[A-Z]' '[a-z]'`
8901 #include <sys/types.h>
8902 #include <sys/socket.h>
8908 set try; if eval $compile; then
8911 set d_${enum}; eval $setvar
8915 : see if sys/select.h has to be included
8916 set sys/select.h i_sysselct
8919 : see if we should include time.h, sys/time.h, or both
8921 if test "X$timeincl" = X; then
8922 echo "Testing to see if we should include <time.h>, <sys/time.h> or both." >&4
8923 $echo $n "I'm now running the test program...$c"
8924 $cat >try.c <<'EOCP'
8925 #include <sys/types.h>
8930 #ifdef SYSTIMEKERNEL
8933 #include <sys/time.h>
8936 #include <sys/select.h>
8945 struct timezone tzp;
8947 if (foo.tm_sec == foo.tm_sec)
8950 if (bar.tv_sec == bar.tv_sec)
8957 for s_timezone in '-DS_TIMEZONE' ''; do
8959 for s_timeval in '-DS_TIMEVAL' ''; do
8960 for i_systimek in '' '-DSYSTIMEKERNEL'; do
8961 for i_time in '' '-DI_TIME'; do
8962 for i_systime in '-DI_SYSTIME' ''; do
8965 set try $i_time $i_systime $i_systimek $sysselect $s_timeval $s_timezone
8966 if eval $compile; then
8967 set X $i_time $i_systime $i_systimek $sysselect $s_timeval
8971 $echo $n "Succeeded with $flags$c"
8983 *SYSTIMEKERNEL*) i_systimek="$define"
8984 timeincl=`./findhdr sys/time.h`
8985 echo "We'll include <sys/time.h> with KERNEL defined." >&4;;
8986 *) i_systimek="$undef";;
8989 *I_TIME*) i_time="$define"
8990 timeincl=`./findhdr time.h`" $timeincl"
8991 echo "We'll include <time.h>." >&4;;
8992 *) i_time="$undef";;
8995 *I_SYSTIME*) i_systime="$define"
8996 timeincl=`./findhdr sys/time.h`" $timeincl"
8997 echo "We'll include <sys/time.h>." >&4;;
8998 *) i_systime="$undef";;
9003 : check for fd_set items
9006 Checking to see how well your C compiler handles fd_set and friends ...
9008 $cat >fd_set.c <<EOCP
9009 #$i_systime I_SYS_TIME
9010 #$i_sysselct I_SYS_SELECT
9011 #$d_socket HAS_SOCKET
9012 #include <sys/types.h>
9014 #include <sys/socket.h> /* Might include <sys/bsdtypes.h> */
9017 #include <sys/time.h>
9020 #include <sys/select.h>
9029 #if defined(FD_SET) && defined(FD_CLR) && defined(FD_ISSET) && defined(FD_ZERO)
9036 set fd_set -DTRYBITS
9037 if eval $compile; then
9038 d_fds_bits="$define"
9040 echo "Well, your system knows about the normal fd_set typedef..." >&4
9042 echo "and you have the normal fd_set macros (just as I'd expect)." >&4
9043 d_fd_macros="$define"
9046 but not the normal fd_set macros! Gaaack! I'll have to cover for you.
9048 d_fd_macros="$undef"
9052 Hmm, your compiler has some difficulty with fd_set. Checking further...
9055 if eval $compile; then
9058 echo "Well, your system has some sort of fd_set available..." >&4
9060 echo "and you have the normal fd_set macros." >&4
9061 d_fd_macros="$define"
9064 but not the normal fd_set macros! Gross! More work for me...
9066 d_fd_macros="$undef"
9069 echo "Well, you got zip. That's OK, I can roll my own fd_set stuff." >&4
9072 d_fd_macros="$undef"
9077 : see if fgetpos exists
9078 set fgetpos d_fgetpos
9081 : see if flock exists
9085 : see if fork exists
9089 : see if pathconf exists
9090 set pathconf d_pathconf
9093 : see if fpathconf exists
9094 set fpathconf d_fpathconf
9098 : check for fpos64_t
9100 echo "Checking to see if you have fpos64_t..." >&4
9103 int main() { fpos64_t x = 7; }
9106 if eval $compile; then
9108 echo "You have fpos64_t."
9111 echo "You do not have fpos64_t."
9113 8) echo "(Your fpos_t is 64 bits, so you could use that.)" ;;
9120 : see if frexpl exists
9124 hasstruct='varname=$1; struct=$2; shift; shift;
9125 while $test $# -ge 2; do
9127 $define) echo "#include <$2>";;
9131 echo "int main () { struct $struct foo; }" >> try.c;
9133 if eval $compile; then
9142 : see if this is a sys/param system
9143 set sys/param.h i_sysparam
9146 : see if this is a sys/mount.h system
9147 set sys/mount.h i_sysmount
9150 : see if sys/types.h has to be included
9151 set sys/types.h i_systypes
9156 echo "Checking to see if your system supports struct fs_data..." >&4
9157 set d_fs_data_s fs_data $i_systypes sys/types.h $i_sysparam sys/param.h $i_sysmount sys/mount.h
9159 case "$d_fs_data_s" in
9160 "$define") echo "Yes, it does." ;;
9161 *) echo "No, it doesn't." ;;
9164 : see if fseeko exists
9168 8) echo "(Your long is 64 bits, so you could use fseek.)" ;;
9171 : see if fsetpos exists
9172 set fsetpos d_fsetpos
9176 : see if fstatfs exists
9177 set fstatfs d_fstatfs
9181 : see if statvfs exists
9182 set statvfs d_statvfs
9185 : see if fstatvfs exists
9186 set fstatvfs d_fstatvfs
9190 : see if ftello exists
9194 8) echo "(Your long is 64 bits, so you could use ftell.)" ;;
9197 : see if getcwd exists
9201 : see if getespwnam exists
9202 set getespwnam d_getespwnam
9206 : see if getfsstat exists
9207 set getfsstat d_getfsstat
9210 : see if getgrent exists
9211 set getgrent d_getgrent
9214 : see if gethostbyaddr exists
9215 set gethostbyaddr d_gethbyaddr
9218 : see if gethostbyname exists
9219 set gethostbyname d_gethbyname
9222 : see if gethostent exists
9223 set gethostent d_gethent
9226 : see how we will look up host name
9229 if set gethostname val -f d_gethname; eval $csym; $val; then
9230 echo 'gethostname() found.' >&4
9231 d_gethname="$define"
9234 if set uname val -f d_uname; eval $csym; $val; then
9237 uname() was found, but you're running xenix, and older versions of xenix
9238 have a broken uname(). If you don't really know whether your xenix is old
9239 enough to have a broken system call, use the default answer.
9246 rp='Is your uname() broken?'
9249 n*) d_uname="$define"; call=uname;;
9252 echo 'uname() found.' >&4
9259 case "$d_gethname" in
9260 '') d_gethname="$undef";;
9263 '') d_uname="$undef";;
9265 case "$d_uname$d_gethname" in
9270 Every now and then someone has a $call() that lies about the hostname
9271 but can't be fixed for political or economic reasons. If you wish, I can
9272 pretend $call() isn't there and maybe compute hostname at run-time
9273 thanks to the '$phostname' command.
9276 rp="Shall I ignore $call() from now on?"
9279 y*) d_uname="$undef" d_gethname="$undef"; $echo $n "Okay...$c";;
9282 case "$phostname" in
9284 *) case "$aphostname" in
9290 file=`./loc $file $file $pth`
9291 aphostname=`echo $file $*`
9296 case "$d_uname$d_gethname" in
9299 case "$phostname" in
9301 echo "There will be no way for $package to get your hostname." >&4;;
9303 echo "I'll use 'popen("'"'$aphostname'", "r")'"' to get your hostname." >&4
9307 case "$d_phostname" in
9308 '') d_phostname="$undef";;
9311 : see if this is a netdb.h system
9315 : see if prototypes for various gethostxxx netdb.h functions are available
9317 set d_gethostprotos gethostent $i_netdb netdb.h
9320 : see if getlogin exists
9321 set getlogin d_getlogin
9324 : see if getmnt exists
9328 : see if getmntent exists
9329 set getmntent d_getmntent
9332 : see if getnetbyaddr exists
9333 set getnetbyaddr d_getnbyaddr
9336 : see if getnetbyname exists
9337 set getnetbyname d_getnbyname
9340 : see if getnetent exists
9341 set getnetent d_getnent
9344 : see if prototypes for various getnetxxx netdb.h functions are available
9346 set d_getnetprotos getnetent $i_netdb netdb.h
9350 : see if getprotobyname exists
9351 set getprotobyname d_getpbyname
9354 : see if getprotobynumber exists
9355 set getprotobynumber d_getpbynumber
9358 : see if getprotoent exists
9359 set getprotoent d_getpent
9362 : see if getpgid exists
9363 set getpgid d_getpgid
9366 : see if getpgrp2 exists
9367 set getpgrp2 d_getpgrp2
9370 : see if getppid exists
9371 set getppid d_getppid
9374 : see if getpriority exists
9375 set getpriority d_getprior
9378 : see if prototypes for various getprotoxxx netdb.h functions are available
9380 set d_getprotoprotos getprotoent $i_netdb netdb.h
9383 : see if getprpwnam exists
9384 set getprpwnam d_getprpwnam
9387 : see if getpwent exists
9388 set getpwent d_getpwent
9392 : see if getservbyname exists
9393 set getservbyname d_getsbyname
9396 : see if getservbyport exists
9397 set getservbyport d_getsbyport
9400 : see if getservent exists
9401 set getservent d_getsent
9404 : see if prototypes for various getservxxx netdb.h functions are available
9406 set d_getservprotos getservent $i_netdb netdb.h
9409 : see if getspnam exists
9410 set getspnam d_getspnam
9413 : see if gettimeofday or ftime exists
9414 set gettimeofday d_gettimeod
9416 case "$d_gettimeod" in
9422 val="$undef"; set d_ftime; eval $setvar
9425 case "$d_gettimeod$d_ftime" in
9428 echo 'No ftime() nor gettimeofday() -- timing may be less accurate.' >&4
9432 : see if this is an grp system
9438 xxx=`./findhdr grp.h`
9439 $cppstdin $cppflags $cppminus < $xxx >$$.h
9441 if $contains 'gr_passwd' $$.h >/dev/null 2>&1; then
9453 set d_grpasswd; eval $setvar
9457 : see if hasmntopt exists
9458 set hasmntopt d_hasmntopt
9461 : see if this is a netinet/in.h or sys/in.h system
9462 set netinet/in.h i_niin sys/in.h i_sysin
9465 : see if arpa/inet.h has to be included
9466 set arpa/inet.h i_arpainet
9469 : see if htonl --and friends-- exists
9474 : Maybe they are macros.
9479 #include <sys/types.h>
9480 #$i_niin I_NETINET_IN
9482 #$i_arpainet I_ARPA_INET
9484 #include <netinet/in.h>
9490 #include <arpa/inet.h>
9493 printf("Defined as a macro.");
9496 $cppstdin $cppflags $cppminus < htonl.c >htonl.E 2>/dev/null
9497 if $contains 'Defined as a macro' htonl.E >/dev/null 2>&1; then
9499 echo "But it seems to be defined as a macro." >&4
9507 : see if iconv exists
9513 if set index val -f; eval $csym; $val; then
9514 if set strchr val -f d_strchr; eval $csym; $val; then
9515 if $contains strchr "$strings" >/dev/null 2>&1 ; then
9518 echo "strchr() found." >&4
9522 echo "index() found." >&4
9527 echo "index() found." >&4
9530 if set strchr val -f d_strchr; eval $csym; $val; then
9533 echo "strchr() found." >&4
9535 echo "No index() or strchr() found!" >&4
9540 set d_strchr; eval $setvar
9542 set d_index; eval $setvar
9544 : check whether inet_aton exists
9545 set inet_aton d_inetaton
9548 : see if inttypes.h is available
9549 : we want a real compile instead of Inhdr because some systems
9550 : have an inttypes.h which includes non-existent headers
9553 #include <inttypes.h>
9555 static int32_t foo32 = 0x12345678;
9559 if eval $compile; then
9560 echo "<inttypes.h> found." >&4
9563 echo "<inttypes.h> NOT found." >&4
9572 echo "Checking to see if you have int64_t..." >&4
9574 #include <sys/types.h>
9575 #$i_inttypes I_INTTYPES
9577 #include <inttypes.h>
9579 int main() { int64_t x = 7; }
9582 if eval $compile; then
9584 echo "You have int64_t."
9587 echo "You do not have int64_t."
9595 $cat >isascii.c <<'EOCP'
9607 if eval $compile; then
9608 echo "isascii() found." >&4
9611 echo "isascii() NOT found." >&4
9618 : see if isnan exists
9622 : see if isnanl exists
9626 : see if killpg exists
9630 : see if lchown exists
9632 $cat > try.c <<'EOCP'
9633 /* System header to define __stub macros and hopefully few prototypes,
9634 which can conflict with char lchown(); below. */
9636 /* Override any gcc2 internal prototype to avoid an error. */
9637 /* We use char because int might match the return type of a gcc2
9638 builtin and then its argument prototype would still apply. */
9641 /* The GNU C library defines this for functions which it implements
9642 to always fail with ENOSYS. Some functions are actually named
9643 something starting with __ and the normal name is an alias. */
9644 #if defined (__stub_lchown) || defined (__stub___lchown)
9652 if eval $compile; then
9653 $echo "lchown() found." >&4
9656 $echo "lchown() NOT found." >&4
9662 : See if number of significant digits in a double precision number is known
9664 $cat >ldbl_dig.c <<EOM
9674 printf("Contains LDBL_DIG");
9677 $cppstdin $cppflags $cppminus < ldbl_dig.c >ldbl_dig.E 2>/dev/null
9678 if $contains 'LDBL_DIG' ldbl_dig.E >/dev/null 2>&1; then
9679 echo "LDBL_DIG found." >&4
9682 echo "LDBL_DIG NOT found." >&4
9689 : see if link exists
9693 : see if localeconv exists
9694 set localeconv d_locconv
9697 : see if lockf exists
9701 : check for long long
9703 echo "Checking to see if you have long long..." >&4
9704 echo 'int main() { long long x = 7; return 0; }' > try.c
9706 if eval $compile; then
9708 echo "You have long long."
9711 echo "You do not have long long."
9717 : check for length of long long
9718 case "${d_longlong}${longlongsize}" in
9721 echo "Checking to see how big your long longs are..." >&4
9722 $cat >try.c <<'EOCP'
9726 printf("%d\n", (int)sizeof(long long));
9731 if eval $compile_ok; then
9732 longlongsize=`./try$exe_ext`
9733 echo "Your long longs are $longlongsize bytes long."
9737 echo "(I can't seem to compile the test program. Guessing...)"
9738 rp="What is the size of a long long (in bytes)?"
9742 if $test "X$longsize" = "X$longlongsize"; then
9743 echo "(That isn't any different from an ordinary long.)"
9749 : see if prototype for lseek is available
9751 set d_lseekproto lseek $i_systypes sys/types.h $i_unistd unistd.h
9754 : see if lstat exists
9758 : see if madvise exists
9759 set madvise d_madvise
9762 : see if mblen exists
9766 : see if mbstowcs exists
9767 set mbstowcs d_mbstowcs
9770 : see if mbtowc exists
9774 : see if memchr exists
9778 : see if memcmp exists
9782 : see if memcpy exists
9786 : see if memmove exists
9787 set memmove d_memmove
9790 : see if memset exists
9794 : see if mkdir exists
9798 : see if mkdtemp exists
9799 set mkdtemp d_mkdtemp
9802 : see if mkfifo exists
9806 : see if mkstemp exists
9807 set mkstemp d_mkstemp
9810 : see if mkstemps exists
9811 set mkstemps d_mkstemps
9814 : see if mktime exists
9818 : see if this is a sys/mman.h system
9819 set sys/mman.h i_sysmman
9822 : see if mmap exists
9825 : see what shmat returns
9826 : default to something harmless
9828 case "$i_sysmman$d_mmap" in
9830 $cat >mmap.c <<'END'
9831 #include <sys/mman.h>
9834 if $cc $ccflags -c mmap.c >/dev/null 2>&1; then
9839 echo "and it returns ($mmaptype)." >&4
9845 : see if modfl exists
9849 : see if mprotect exists
9850 set mprotect d_mprotect
9853 : see if msgctl exists
9857 : see if msgget exists
9861 : see if msgsnd exists
9865 : see if msgrcv exists
9869 : see how much of the 'msg*(2)' library is present.
9872 case "$d_msgctl$d_msgget$d_msgsnd$d_msgrcv" in
9873 *"$undef"*) h_msg=false;;
9877 case "`ipcs 2>&1`" in
9878 "SVID messages"*"not configured"*)
9879 echo "Your $osname does not have the msg*(2) configured." >&4
9894 : we could also check for sys/ipc.h ...
9895 if $h_msg && $test `./findhdr sys/msg.h`; then
9896 echo "You have the full msg*(2) library." >&4
9899 echo "You don't have the full msg*(2) library." >&4
9905 : see if msync exists
9909 : see if munmap exists
9913 : see if nice exists
9919 echo "Checking which 64-bit integer type we could use..." >&4
9925 val='"unsigned int"'
9930 *) case "$longsize" in
9934 val='"unsigned long"'
9939 *) case "$d_longlong:$longlongsize" in
9944 val='"unsigned long long"'
9949 *) case "$d_int64_t" in
9968 '') echo "Alas, no 64-bit integer types in sight." >&4
9971 *) if test X"$use64bitint" = Xdefine -o X"$longsize" = X8; then
9976 echo "We $verb use '$quadtype' for 64-bit integers." >&4
9981 : check for length of character
9985 echo "Checking to see how big your characters are (hey, you never know)..." >&4
9986 $cat >try.c <<'EOCP'
9990 printf("%d\n", (int)sizeof(char));
9995 if eval $compile_ok; then
9999 echo "(I can't seem to compile the test program. Guessing...)"
10006 rp="What is the size of a character (in bytes)?"
10013 $echo "Choosing the C types to be used for Perl's internal types..." >&4
10015 case "$use64bitint:$d_quad:$quadtype" in
10018 uvtype="$uquadtype"
10023 uvtype="unsigned long"
10029 case "$uselongdouble:$d_longdbl" in
10031 nvtype="long double"
10032 nvsize=$longdblsize
10039 $echo "(IV will be "$ivtype", $ivsize bytes)"
10040 $echo "(UV will be "$uvtype", $uvsize bytes)"
10041 $echo "(NV will be "$nvtype", $nvsize bytes)"
10044 #$i_inttypes I_INTTYPES
10046 #include <inttypes.h>
10051 int8_t i = INT8_MAX;
10052 uint8_t u = UINT8_MAX;
10053 printf("int8_t\n");
10056 int16_t i = INT16_MAX;
10057 uint16_t i = UINT16_MAX;
10058 printf("int16_t\n");
10061 int32_t i = INT32_MAX;
10062 uint32_t u = UINT32_MAX;
10063 printf("int32_t\n");
10069 '') case "$charsize" in
10071 u8type="unsigned char"
10080 if eval $compile; then
10081 case "`./try$exe_ext`" in
10082 int8_t) i8type=int8_t
10092 '') if $test $charsize -ge 1; then
10094 u8type="unsigned char"
10102 '') case "$shortsize" in
10104 u16type="unsigned short"
10112 '') set try -DINT16
10113 if eval $compile; then
10114 case "`./try$exe_ext`" in
10126 '') if $test $shortsize -ge 2; then
10128 u16type="unsigned short"
10136 '') case "$longsize" in
10138 u32type="unsigned long"
10142 *) case "$intsize" in
10144 u32type="unsigned int"
10154 '') set try -DINT32
10155 if eval $compile; then
10156 case "`./try$exe_ext`" in
10168 '') if $test $intsize -ge 4; then
10170 u32type="unsigned int"
10178 '') case "$d_quad:$quadtype" in
10180 i64type="$quadtype"
10181 u64type="$uquadtype"
10189 $echo "Checking whether your NVs can preserve your UVs..." >&4
10193 $uvtype k = ($uvtype)~0, l;
10199 printf("preserve\n");
10204 if eval $compile; then
10205 case "`./try$exe_ext`" in
10206 preserve) d_nv_preserves_uv="$define" ;;
10209 case "$d_nv_preserves_uv" in
10210 $define) $echo "Yes, they can." 2>&1 ;;
10211 *) $echo "No, they can't." 2>&1
10212 d_nv_preserves_uv="$undef"
10218 case "$d_nv_preserves_uv" in
10219 "$define") d_nv_preserves_uv_bits=`expr $uvsize \* 8` ;;
10220 *) $echo "Checking how many bits of your UVs your NVs can preserve..." >&4
10225 int n = 8 * $uvsize;
10227 for (i = 0; i < n; i++) {
10228 u = u << 1 | ($uvtype)1;
10229 if (($uvtype)($nvtype)u != u)
10237 if eval $compile; then
10238 d_nv_preserves_uv_bits="`./try$exe_ext`"
10240 case "$d_nv_preserves_uv_bits" in
10241 [1-9]*) $echo "Your NVs can preserve $d_nv_preserves_uv_bits bits of your UVs." 2>&1 ;;
10242 *) $echo "Can't figure out how many bits your NVs preserve." 2>&1
10243 d_nv_preserves_uv_bits="$undef"
10251 : check for off64_t
10253 echo "Checking to see if you have off64_t..." >&4
10255 #include <sys/types.h>
10256 #include <unistd.h>
10257 int main() { off64_t x = 7; }
10260 if eval $compile; then
10262 echo "You have off64_t."
10265 echo "You do not have off64_t."
10266 case "$lseeksize" in
10267 8) echo "(Your off_t is 64 bits, so you could use that.)" ;;
10274 : see if POSIX threads are available
10275 set pthread.h i_pthread
10281 : how to create joinable pthreads
10282 if test "X$usethreads" = "X$define" -a "X$i_pthread" = "X$define"; then
10284 echo "Checking what constant to use for creating joinable pthreads..." >&4
10285 $cat >try.c <<'EOCP'
10286 #include <pthread.h>
10288 int detachstate = JOINABLE;
10291 set try -DJOINABLE=PTHREAD_CREATE_JOINABLE
10292 if eval $compile; then
10293 echo "You seem to use PTHREAD_CREATE_JOINABLE." >&4
10294 val="$undef" # Yes, undef.
10295 set d_old_pthread_create_joinable
10298 set old_pthread_create_joinable
10301 set try -DJOINABLE=PTHREAD_CREATE_UNDETACHED
10302 if eval $compile; then
10303 echo "You seem to use PTHREAD_CREATE_UNDETACHED." >&4
10305 set d_old_pthread_create_joinable
10307 val=PTHREAD_CREATE_UNDETACHED
10308 set old_pthread_create_joinable
10311 set try -DJOINABLE=__UNDETACHED
10312 if eval $compile; then
10313 echo "You seem to use __UNDETACHED." >&4
10315 set d_old_pthread_create_joinable
10318 set old_pthread_create_joinable
10321 echo "Egads, nothing obvious found. Guessing that you use 0." >&4
10323 set d_old_pthread_create_joinable
10326 set old_pthread_create_joinable
10333 d_old_pthread_create_joinable="$undef"
10334 old_pthread_create_joinable=""
10337 : see if pause exists
10341 : see if pipe exists
10345 : see if poll exists
10350 : see whether the various POSIXish _yields exist
10352 #include <pthread.h>
10358 #ifdef PTHREAD_YIELD
10361 #ifdef PTHREAD_YIELD_NULL
10362 pthread_yield(NULL);
10368 : see if sched_yield exists
10369 set try -DSCHED_YIELD
10370 if eval $compile; then
10372 sched_yield='sched_yield()'
10376 case "$usethreads" in
10379 $define) echo 'sched_yield() found.' >&4 ;;
10380 *) echo 'sched_yield() NOT found.' >&4 ;;
10386 : see if pthread_yield exists
10387 set try -DPTHREAD_YIELD
10388 if eval $compile; then
10390 case "$sched_yield" in
10391 '') sched_yield='pthread_yield()' ;;
10394 set try -DPTHREAD_YIELD_NULL
10395 if eval $compile; then
10397 case "$sched_yield" in
10398 '') sched_yield='pthread_yield(NULL)' ;;
10404 case "$usethreads" in
10407 $define) echo 'pthread_yield() found.' >&4 ;;
10408 *) echo 'pthread_yield() NOT found.' >&4 ;;
10412 set d_pthread_yield
10415 case "$sched_yield" in
10416 '') sched_yield=undef ;;
10421 : see if this is a pwd.h system
10427 xxx=`./findhdr pwd.h`
10428 $cppstdin $cppflags $cppminus < $xxx >$$.h
10430 if $contains 'pw_quota' $$.h >/dev/null 2>&1; then
10438 if $contains 'pw_age' $$.h >/dev/null 2>&1; then
10446 if $contains 'pw_change' $$.h >/dev/null 2>&1; then
10454 if $contains 'pw_class' $$.h >/dev/null 2>&1; then
10462 if $contains 'pw_expire' $$.h >/dev/null 2>&1; then
10470 if $contains 'pw_comment' $$.h >/dev/null 2>&1; then
10478 if $contains 'pw_gecos' $$.h >/dev/null 2>&1; then
10486 if $contains 'pw_passwd' $$.h >/dev/null 2>&1; then
10498 set d_pwquota; eval $setvar
10499 set d_pwage; eval $setvar
10500 set d_pwchange; eval $setvar
10501 set d_pwclass; eval $setvar
10502 set d_pwexpire; eval $setvar
10503 set d_pwcomment; eval $setvar
10504 set d_pwgecos; eval $setvar
10505 set d_pwpasswd; eval $setvar
10509 : see if readdir and friends exist
10510 set readdir d_readdir
10512 set seekdir d_seekdir
10514 set telldir d_telldir
10516 set rewinddir d_rewinddir
10519 : see if readlink exists
10520 set readlink d_readlink
10523 : see if rename exists
10524 set rename d_rename
10527 : see if rmdir exists
10531 : see if memory.h is available.
10536 : See if it conflicts with string.h
10542 $cppstdin $cppflags $cppminus < $strings > mem.h
10543 if $contains 'memcpy' mem.h >/dev/null 2>&1; then
10545 echo "We won't be including <memory.h>."
10555 : can bcopy handle overlapping blocks?
10560 echo "Checking to see if your bcopy() can do overlapping copies..." >&4
10562 #$i_memory I_MEMORY
10563 #$i_stdlib I_STDLIB
10564 #$i_string I_STRING
10565 #$i_unistd I_UNISTD
10567 $cat >>try.c <<'EOCP'
10570 # include <memory.h>
10573 # include <stdlib.h>
10576 # include <string.h>
10578 # include <strings.h>
10581 # include <unistd.h> /* Needed for NetBSD */
10585 char buf[128], abc[128];
10591 bcopy("abcdefghijklmnopqrstuvwxyz0123456789", abc, 36);
10593 for (align = 7; align >= 0; align--) {
10594 for (len = 36; len; len--) {
10596 bcopy(abc, b, len);
10597 for (off = 1; off <= len; off++) {
10598 bcopy(b, b+off, len);
10599 bcopy(b+off, b, len);
10600 if (bcmp(b, abc, len))
10609 if eval $compile_ok; then
10610 if ./try 2>/dev/null; then
10611 echo "Yes, it can."
10614 echo "It can't, sorry."
10615 case "$d_memmove" in
10616 "$define") echo "But that's Ok since you have memmove()." ;;
10620 echo "(I can't compile the test program, so we'll assume not...)"
10621 case "$d_memmove" in
10622 "$define") echo "But that's Ok since you have memmove()." ;;
10627 $rm -f try.* try core
10631 : can memcpy handle overlapping blocks?
10633 case "$d_memcpy" in
10636 echo "Checking to see if your memcpy() can do overlapping copies..." >&4
10638 #$i_memory I_MEMORY
10639 #$i_stdlib I_STDLIB
10640 #$i_string I_STRING
10641 #$i_unistd I_UNISTD
10643 $cat >>try.c <<'EOCP'
10646 # include <memory.h>
10649 # include <stdlib.h>
10652 # include <string.h>
10654 # include <strings.h>
10657 # include <unistd.h> /* Needed for NetBSD */
10661 char buf[128], abc[128];
10667 /* Copy "abcde..." string to char abc[] so that gcc doesn't
10668 try to store the string in read-only memory. */
10669 memcpy(abc, "abcdefghijklmnopqrstuvwxyz0123456789", 36);
10671 for (align = 7; align >= 0; align--) {
10672 for (len = 36; len; len--) {
10674 memcpy(b, abc, len);
10675 for (off = 1; off <= len; off++) {
10676 memcpy(b+off, b, len);
10677 memcpy(b, b+off, len);
10678 if (memcmp(b, abc, len))
10687 if eval $compile_ok; then
10688 if ./try 2>/dev/null; then
10689 echo "Yes, it can."
10692 echo "It can't, sorry."
10693 case "$d_memmove" in
10694 "$define") echo "But that's Ok since you have memmove()." ;;
10698 echo "(I can't compile the test program, so we'll assume not...)"
10699 case "$d_memmove" in
10700 "$define") echo "But that's Ok since you have memmove()." ;;
10705 $rm -f try.* try core
10709 : can memcmp be trusted to compare relative magnitude?
10711 case "$d_memcmp" in
10714 echo "Checking if your memcmp() can compare relative magnitude..." >&4
10716 #$i_memory I_MEMORY
10717 #$i_stdlib I_STDLIB
10718 #$i_string I_STRING
10719 #$i_unistd I_UNISTD
10721 $cat >>try.c <<'EOCP'
10724 # include <memory.h>
10727 # include <stdlib.h>
10730 # include <string.h>
10732 # include <strings.h>
10735 # include <unistd.h> /* Needed for NetBSD */
10741 if ((a < b) && memcmp(&a, &b, 1) < 0)
10747 if eval $compile_ok; then
10748 if ./try 2>/dev/null; then
10749 echo "Yes, it can."
10752 echo "No, it can't (it uses signed chars)."
10755 echo "(I can't compile the test program, so we'll assume not...)"
10759 $rm -f try.* try core
10763 : see if select exists
10764 set select d_select
10767 : see if semctl exists
10768 set semctl d_semctl
10771 : see if semget exists
10772 set semget d_semget
10775 : see if semop exists
10779 : see how much of the 'sem*(2)' library is present.
10782 case "$d_semctl$d_semget$d_semop" in
10783 *"$undef"*) h_sem=false;;
10787 case "`ipcs 2>&1`" in
10788 "SVID messages"*"not configured"*)
10789 echo "Your $osname does not have the sem*(2) configured." >&4
10792 set semctl d_semctl
10794 set semget d_semget
10802 : we could also check for sys/ipc.h ...
10803 if $h_sem && $test `./findhdr sys/sem.h`; then
10804 echo "You have the full sem*(2) library." >&4
10807 echo "You don't have the full sem*(2) library." >&4
10813 : see whether sys/sem.h defines union semun
10815 $cat > try.c <<'END'
10816 #include <sys/types.h>
10817 #include <sys/ipc.h>
10818 #include <sys/sem.h>
10819 int main () { union semun semun; semun.buf = 0; }
10822 if eval $compile; then
10823 echo "You have union semun in <sys/sem.h>." >&4
10826 echo "You do not have union semun in <sys/sem.h>." >&4
10829 $rm -f try try.c try.h
10833 : see how to do semctl IPC_STAT
10836 : see whether semctl IPC_STAT can use union semun
10841 # define S_IRUSR S_IREAD
10842 # define S_IWUSR S_IWRITE
10843 # define S_IXUSR S_IEXEC
10845 # define S_IRUSR 0400
10846 # define S_IWUSR 0200
10847 # define S_IXUSR 0100
10849 # define S_IRGRP (S_IRUSR>>3)
10850 # define S_IWGRP (S_IWUSR>>3)
10851 # define S_IXGRP (S_IXUSR>>3)
10852 # define S_IROTH (S_IRUSR>>6)
10853 # define S_IWOTH (S_IWUSR>>6)
10854 # define S_IXOTH (S_IXUSR>>6)
10857 # define S_IRWXU (S_IRUSR|S_IWUSR|S_IXUSR)
10858 # define S_IRWXG (S_IRGRP|S_IWGRP|S_IXGRP)
10859 # define S_IRWXO (S_IROTH|S_IWOTH|S_IXOTH)
10864 #include <sys/types.h>
10865 #include <sys/ipc.h>
10866 #include <sys/sem.h>
10867 #include <sys/stat.h>
10874 #$d_union_semun HAS_UNION_SEMUN
10877 #ifndef HAS_UNION_SEMUN
10880 struct semid_ds *buf;
10881 unsigned short *array;
10887 #if defined(IPC_PRIVATE) && defined(S_IRWXU) && defined(S_IRWXG) && defined(S_IRWXO) && defined(IPC_CREAT)
10888 sem = semget(IPC_PRIVATE, 1, S_IRWXU|S_IRWXG|S_IRWXO|IPC_CREAT);
10890 struct semid_ds argbuf;
10893 st = semctl(sem, 0, IPC_STAT, arg);
10897 # endif /* IPC_STAT */
10898 printf("semctl IPC_STAT failed: errno = %d\n", errno);
10900 if (semctl(sem, 0, IPC_RMID, arg) != 0)
10901 # endif /* IPC_RMID */
10902 printf("semctl IPC_RMID failed: errno = %d\n", errno);
10904 #endif /* IPC_PRIVATE && ... */
10905 printf("semget failed: errno = %d\n", errno);
10911 if eval $compile; then
10914 semun) val="$define" ;;
10920 case "$d_semctl_semun" in
10922 echo "You can use union semun for semctl IPC_STAT." >&4
10925 *) echo "You cannot use union semun for semctl IPC_STAT." >&4
10930 : see whether semctl IPC_STAT can use struct semid_ds pointer
10931 $cat > try.c <<'END'
10932 #include <sys/types.h>
10933 #include <sys/ipc.h>
10934 #include <sys/sem.h>
10935 #include <sys/stat.h>
10943 struct semid_ds arg;
10946 #if defined(IPC_PRIVATE) && defined(S_IRWXU) && defined(S_IRWXG) && defined(S_IRWXO) && defined(IPC_CREAT)
10947 sem = semget(IPC_PRIVATE, 1, S_IRWXU|S_IRWXG|S_IRWXO|IPC_CREAT);
10950 st = semctl(sem, 0, IPC_STAT, &arg);
10952 printf("semid_ds\n");
10954 # endif /* IPC_STAT */
10955 printf("semctl IPC_STAT failed: errno = %d\n", errno);
10957 if (semctl(sem, 0, IPC_RMID, &arg) != 0)
10958 # endif /* IPC_RMID */
10959 printf("semctl IPC_RMID failed: errno = %d\n", errno);
10961 #endif /* IPC_PRIVATE && ... */
10962 printf("semget failed: errno = %d\n", errno);
10969 if eval $compile; then
10972 semid_ds) val="$define" ;;
10976 set d_semctl_semid_ds
10978 case "$d_semctl_semid_ds" in
10980 echo "You can $also use struct semid_ds* for semctl IPC_STAT." >&4
10982 *) echo "You cannot use struct semid_ds* for semctl IPC_STAT." >&4
10989 # We do not have the full sem*(2) library, so assume we can not
10995 set d_semctl_semid_ds
11000 : see if setegid exists
11001 set setegid d_setegid
11004 : see if seteuid exists
11005 set seteuid d_seteuid
11008 : see if setgrent exists
11009 set setgrent d_setgrent
11012 : see if sethostent exists
11013 set sethostent d_sethent
11016 : see if setlinebuf exists
11017 set setlinebuf d_setlinebuf
11020 : see if setlocale exists
11021 set setlocale d_setlocale
11024 : see if setnetent exists
11025 set setnetent d_setnent
11028 : see if setprotoent exists
11029 set setprotoent d_setpent
11032 : see if setpgid exists
11033 set setpgid d_setpgid
11036 : see if setpgrp2 exists
11037 set setpgrp2 d_setpgrp2
11040 : see if setpriority exists
11041 set setpriority d_setprior
11044 : see if setproctitle exists
11045 set setproctitle d_setproctitle
11048 : see if setpwent exists
11049 set setpwent d_setpwent
11052 : see if setregid exists
11053 set setregid d_setregid
11055 set setresgid d_setresgid
11058 : see if setreuid exists
11059 set setreuid d_setreuid
11061 set setresuid d_setresuid
11064 : see if setrgid exists
11065 set setrgid d_setrgid
11068 : see if setruid exists
11069 set setruid d_setruid
11072 : see if setservent exists
11073 set setservent d_setsent
11076 : see if setsid exists
11077 set setsid d_setsid
11080 : see if setvbuf exists
11081 set setvbuf d_setvbuf
11084 : see if sfio.h is available
11089 : see if sfio library is available
11100 : Ok, but do we want to use it.
11104 true|$define|[yY]*) dflt='y';;
11107 echo "$package can use the sfio library, but it is experimental."
11108 case "$useperlio" in
11110 echo "For sfio also the PerlIO abstraction layer is needed."
11111 echo "Earlier you said you wouldn't want that."
11114 rp="You seem to have sfio available, do you want to try using it?"
11117 y|Y) echo "Ok, turning on both sfio and PerlIO, then."
11118 useperlio="$define"
11121 *) echo "Ok, avoiding sfio this time. I'll use stdio instead."
11123 : Remove sfio from list of libraries to use
11124 set `echo X $libs | $sed -e 's/-lsfio / /' -e 's/-lsfio$//'`
11127 echo "libs = $libs" >&4
11131 *) case "$usesfio" in
11132 true|$define|[yY]*)
11133 echo "Sorry, cannot find sfio on this machine." >&4
11134 echo "Ignoring your setting of usesfio=$usesfio." >&4
11143 $define) usesfio='true';;
11144 *) usesfio='false';;
11147 : see if shmctl exists
11148 set shmctl d_shmctl
11151 : see if shmget exists
11152 set shmget d_shmget
11155 : see if shmat exists
11158 : see what shmat returns
11161 $cat >shmat.c <<'END'
11162 #include <sys/shm.h>
11165 if $cc $ccflags -c shmat.c >/dev/null 2>&1; then
11170 echo "and it returns ($shmattype)." >&4
11171 : see if a prototype for shmat is available
11172 xxx=`./findhdr sys/shm.h`
11173 $cppstdin $cppflags $cppminus < $xxx > shmat.c 2>/dev/null
11174 if $contains 'shmat.*(' shmat.c >/dev/null 2>&1; then
11185 set d_shmatprototype
11188 : see if shmdt exists
11192 : see how much of the 'shm*(2)' library is present.
11195 case "$d_shmctl$d_shmget$d_shmat$d_shmdt" in
11196 *"$undef"*) h_shm=false;;
11200 case "`ipcs 2>&1`" in
11201 "SVID shared memory"*"not configured"*)
11202 echo "Your $osname does not have the shm*(2) configured." >&4
11205 set shmctl d_shmctl
11207 set shmget d_shmget
11217 : we could also check for sys/ipc.h ...
11218 if $h_shm && $test `./findhdr sys/shm.h`; then
11219 echo "You have the full shm*(2) library." >&4
11222 echo "You don't have the full shm*(2) library." >&4
11229 : see if we have sigaction
11230 if set sigaction val -f d_sigaction; eval $csym; $val; then
11231 echo 'sigaction() found.' >&4
11232 $cat > try.c <<'EOP'
11234 #include <sys/types.h>
11235 #include <signal.h>
11238 struct sigaction act, oact;
11240 oact.sa_handler = 0;
11241 /* so that act and oact are used */
11242 exit(act.sa_flags == 0 && oact.sa_handler == 0);
11246 if eval $compile_ok; then
11249 echo "But you don't seem to have a useable struct sigaction." >&4
11253 echo 'sigaction NOT found.' >&4
11256 set d_sigaction; eval $setvar
11257 $rm -f try try$_o try.c
11259 : see if sigsetjmp exists
11261 case "$d_sigsetjmp" in
11263 $cat >try.c <<'EOP'
11264 #include <setjmp.h>
11269 if (sigsetjmp(env,1))
11272 siglongjmp(env, 1);
11277 if eval $compile; then
11278 if ./try >/dev/null 2>&1; then
11279 echo "POSIX sigsetjmp found." >&4
11283 Uh-Oh! You have POSIX sigsetjmp and siglongjmp, but they do not work properly!!
11289 echo "sigsetjmp not found." >&4
11293 *) val="$d_sigsetjmp"
11294 case "$d_sigsetjmp" in
11295 $define) echo "POSIX sigsetjmp found." >&4;;
11296 $undef) echo "sigsetjmp not found." >&4;;
11304 : see if socks5_init exists
11305 set socks5_init d_socks5_init
11308 : see if sys/stat.h is available
11309 set sys/stat.h i_sysstat
11313 : see if stat knows about block sizes
11315 echo "Checking to see if your struct stat has st_blocks field..." >&4
11316 set d_statblks stat st_blocks $i_sysstat sys/stat.h
11320 : see if this is a sys/vfs.h system
11321 set sys/vfs.h i_sysvfs
11325 : see if this is a sys/statfs.h system
11326 set sys/statfs.h i_sysstatfs
11331 echo "Checking to see if your system supports struct statfs..." >&4
11332 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
11334 case "$d_statfs_s" in
11335 "$define") echo "Yes, it does." ;;
11336 *) echo "No, it doesn't." ;;
11341 : see if struct statfs knows about f_flags
11342 case "$d_statfs_s" in
11345 echo "Checking to see if your struct statfs has f_flags field..." >&4
11346 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
11350 set d_statfs_f_flags
11354 case "$d_statfs_f_flags" in
11355 "$define") echo "Yes, it does." ;;
11356 *) echo "No, it doesn't." ;;
11359 : see if _ptr and _cnt from stdio act std
11361 if $contains '_IO_fpos_t' `./findhdr stdio.h` `./findhdr libio.h` >/dev/null 2>&1 ; then
11362 echo "(Looks like you have stdio.h from Linux.)"
11363 case "$stdio_ptr" in
11364 '') stdio_ptr='((fp)->_IO_read_ptr)'
11367 *) ptr_lval=$d_stdio_ptr_lval;;
11369 case "$stdio_cnt" in
11370 '') stdio_cnt='((fp)->_IO_read_end - (fp)->_IO_read_ptr)'
11373 *) cnt_lval=$d_stdio_cnt_lval;;
11375 case "$stdio_base" in
11376 '') stdio_base='((fp)->_IO_read_base)';;
11378 case "$stdio_bufsiz" in
11379 '') stdio_bufsiz='((fp)->_IO_read_end - (fp)->_IO_read_base)';;
11382 case "$stdio_ptr" in
11383 '') stdio_ptr='((fp)->_ptr)'
11386 *) ptr_lval=$d_stdio_ptr_lval;;
11388 case "$stdio_cnt" in
11389 '') stdio_cnt='((fp)->_cnt)'
11392 *) cnt_lval=$d_stdio_cnt_lval;;
11394 case "$stdio_base" in
11395 '') stdio_base='((fp)->_base)';;
11397 case "$stdio_bufsiz" in
11398 '') stdio_bufsiz='((fp)->_cnt + (fp)->_ptr - (fp)->_base)';;
11401 : test whether _ptr and _cnt really work
11402 echo "Checking how std your stdio is..." >&4
11405 #define FILE_ptr(fp) $stdio_ptr
11406 #define FILE_cnt(fp) $stdio_cnt
11408 FILE *fp = fopen("try.c", "r");
11411 18 <= FILE_cnt(fp) &&
11412 strncmp(FILE_ptr(fp), "include <stdio.h>\n", 18) == 0
11420 if eval $compile; then
11422 echo "Your stdio acts pretty std."
11425 echo "Your stdio isn't very std."
11428 echo "Your stdio doesn't appear very std."
11434 : Can _ptr be used as an lvalue?
11435 case "$d_stdstdio$ptr_lval" in
11436 $define$define) val=$define ;;
11439 set d_stdio_ptr_lval
11442 : Can _cnt be used as an lvalue?
11443 case "$d_stdstdio$cnt_lval" in
11444 $define$define) val=$define ;;
11447 set d_stdio_cnt_lval
11450 : see if _base is also standard
11452 case "$d_stdstdio" in
11456 #define FILE_base(fp) $stdio_base
11457 #define FILE_bufsiz(fp) $stdio_bufsiz
11459 FILE *fp = fopen("try.c", "r");
11462 19 <= FILE_bufsiz(fp) &&
11463 strncmp(FILE_base(fp), "#include <stdio.h>\n", 19) == 0
11470 if eval $compile; then
11472 echo "And its _base field acts std."
11475 echo "But its _base field isn't std."
11478 echo "However, it seems to be lacking the _base field."
11487 Checking how to access stdio streams by file descriptor number...
11489 case "$stdio_stream_array" in
11490 '') $cat >try.c <<EOCP
11493 if (&STDIO_STREAM_ARRAY[fileno(stdin)] == stdin)
11497 for s in _iob __iob __sF
11499 set try -DSTDIO_STREAM_ARRAY=$s
11500 if eval $compile; then
11501 case "`./try$exe_ext`" in
11502 yes) stdio_stream_array=$s; break ;;
11506 $rm -f try.* try$exe_ext
11508 case "$stdio_stream_array" in
11510 I can't figure out how to access stdio streams by file descriptor number.
11512 d_stdio_stream_array="$undef"
11515 You can access stdio streams by file descriptor number by the $stdio_stream_array array.
11517 d_stdio_stream_array="$define"
11521 : see if strcoll exists
11522 set strcoll d_strcoll
11525 : check for structure copying
11527 echo "Checking to see if your C compiler can copy structs..." >&4
11528 $cat >try.c <<'EOCP'
11538 if $cc -c try.c >/dev/null 2>&1 ; then
11540 echo "Yup, it can."
11543 echo "Nope, it can't."
11549 : see if strerror and/or sys_errlist[] exist
11551 if test "X$d_strerror" = X -o "X$d_syserrlst" = X; then
11552 if set strerror val -f d_strerror; eval $csym; $val; then
11553 echo 'strerror() found.' >&4
11554 d_strerror="$define"
11555 d_strerrm='strerror(e)'
11556 if set sys_errlist val -a d_syserrlst; eval $csym; $val; then
11557 echo "(You also have sys_errlist[], so we could roll our own strerror.)"
11558 d_syserrlst="$define"
11560 echo "(Since you don't have sys_errlist[], sterror() is welcome.)"
11561 d_syserrlst="$undef"
11563 elif xxx=`./findhdr string.h`; test "$xxx" || xxx=`./findhdr strings.h`; \
11564 $contains '#[ ]*define.*strerror' "$xxx" >/dev/null 2>&1; then
11565 echo 'strerror() found in string header.' >&4
11566 d_strerror="$define"
11567 d_strerrm='strerror(e)'
11568 if set sys_errlist val -a d_syserrlst; eval $csym; $val; then
11569 echo "(Most probably, strerror() uses sys_errlist[] for descriptions.)"
11570 d_syserrlst="$define"
11572 echo "(You don't appear to have any sys_errlist[], how can this be?)"
11573 d_syserrlst="$undef"
11575 elif set sys_errlist val -a d_syserrlst; eval $csym; $val; then
11576 echo "strerror() not found, but you have sys_errlist[] so we'll use that." >&4
11577 d_strerror="$undef"
11578 d_syserrlst="$define"
11579 d_strerrm='((e)<0||(e)>=sys_nerr?"unknown":sys_errlist[e])'
11581 echo 'strerror() and sys_errlist[] NOT found.' >&4
11582 d_strerror="$undef"
11583 d_syserrlst="$undef"
11584 d_strerrm='"unknown"'
11588 : see if strtod exists
11589 set strtod d_strtod
11592 : see if strtol exists
11593 set strtol d_strtol
11596 : see if strtold exists
11597 set strtold d_strtold
11600 : see if strtoll exists
11601 set strtoll d_strtoll
11604 case "$d_longlong-$d_strtoll" in
11607 Checking whether your strtoll() works okay...
11609 $cat >try.c <<'EOCP'
11612 #define strtoll __strtoll
11615 extern long long int strtoll(char *s, char **, int);
11616 static int bad = 0;
11617 int check(char *s, long long ell, int een) {
11620 gll = strtoll(s, 0, 10);
11621 if (!((gll == ell) && (errno == een)))
11625 check(" 1", 1LL, 0);
11626 check(" 0", 0LL, 0);
11627 check("-1", -1LL, 0);
11628 check("-9223372036854775808", -9223372036854775808LL, 0);
11629 check("-9223372036854775808", -9223372036854775808LL, 0);
11630 check(" 9223372036854775807", 9223372036854775807LL, 0);
11631 check("-9223372036854775808", -9223372036854775808LL, 0);
11632 check(" 9223372036854775808", 9223372036854775807LL, ERANGE);
11633 check("-9223372036854775809", -9223372036854775808LL, ERANGE);
11639 if eval $compile; then
11641 ok) echo "Your strtoll() seems to be working okay." ;;
11643 Your strtoll() doesn't seem to be working okay.
11652 : see if strtoul exists
11653 set strtoul d_strtoul
11656 : see if strtoull exists
11657 set strtoull d_strtoull
11660 case "$d_longlong-$d_strtoull" in
11663 Checking whether your strtoull() works okay...
11665 $cat >try.c <<'EOCP'
11668 #define strtoull __strtoull
11671 extern unsigned long long int strtoull(char *s, char **, int);
11672 static int bad = 0;
11673 int check(char *s, long long eull, int een) {
11676 gull = strtoull(s, 0, 10);
11677 if (!((gull == eull) && (errno == een)))
11681 check(" 1", 1LL, 0);
11682 check(" 0", 0LL, 0);
11683 check("18446744073709551615", 18446744073709551615ULL, 0);
11684 check("18446744073709551616", 18446744073709551615ULL, ERANGE);
11690 if eval $compile; then
11692 ok) echo "Your strtoull() seems to be working okay." ;;
11694 Your strtoull() doesn't seem to be working okay.
11696 d_strtoull="$undef"
11703 : see if strtouq exists
11704 set strtouq d_strtouq
11707 : see if strxfrm exists
11708 set strxfrm d_strxfrm
11711 : see if symlink exists
11712 set symlink d_symlink
11715 : see if syscall exists
11716 set syscall d_syscall
11719 : see if sysconf exists
11720 set sysconf d_sysconf
11723 : see if system exists
11724 set system d_system
11727 : see if tcgetpgrp exists
11728 set tcgetpgrp d_tcgetpgrp
11731 : see if tcsetpgrp exists
11732 set tcsetpgrp d_tcsetpgrp
11735 : see if prototype for telldir is available
11737 set d_telldirproto telldir $i_systypes sys/types.h $i_dirent dirent.h
11740 : see if this is a sys/times.h system
11741 set sys/times.h i_systimes
11744 : see if times exists
11746 if set times val -f d_times; eval $csym; $val; then
11747 echo 'times() found.' >&4
11750 case "$i_systimes" in
11751 "$define") inc='sys/times.h';;
11753 rp="What is the type returned by times() on this system?"
11754 set clock_t clocktype long stdio.h sys/types.h $inc
11757 echo 'times() NOT found, hope that will do.' >&4
11762 : see if truncate exists
11763 set truncate d_truncate
11766 : see if tzname[] exists
11768 if set tzname val -a d_tzname; eval $csym; $val; then
11770 echo 'tzname[] found.' >&4
11773 echo 'tzname[] NOT found.' >&4
11778 : see if umask exists
11782 : see if ustat exists
11786 : backward compatibility for d_hvfork
11787 if test X$d_hvfork != X; then
11788 d_vfork="$d_hvfork"
11791 : see if there is a vfork
11796 : Ok, but do we want to use it. vfork is reportedly unreliable in
11797 : perl on Solaris 2.x, and probably elsewhere.
11801 case "$usevfork" in
11807 Perl can only use a vfork() that doesn't suffer from strict
11808 restrictions on calling functions or modifying global data in
11809 the child. For example, glibc-2.1 contains such a vfork()
11810 that is unsuitable. If your system provides a proper fork()
11811 call, chances are that you do NOT want perl to use vfork().
11814 rp="Do you still want to use vfork()?"
11819 echo "Ok, we won't use vfork()."
11828 $define) usevfork='true';;
11829 *) usevfork='false';;
11832 : see if this is an sysdir system
11833 set sys/dir.h i_sysdir
11836 : see if this is an sysndir system
11837 set sys/ndir.h i_sysndir
11840 : see if closedir exists
11841 set closedir d_closedir
11844 case "$d_closedir" in
11847 echo "Checking whether closedir() returns a status..." >&4
11848 cat > closedir.c <<EOM
11849 #$i_dirent I_DIRENT /**/
11850 #$i_sysdir I_SYS_DIR /**/
11851 #$i_sysndir I_SYS_NDIR /**/
11852 #$i_systypes I_SYS_TYPES /**/
11854 #if defined(I_SYS_TYPES)
11855 #include <sys/types.h>
11857 #if defined(I_DIRENT)
11858 #include <dirent.h>
11859 #if defined(NeXT) && defined(I_SYS_DIR) /* NeXT needs dirent + sys/dir.h */
11860 #include <sys/dir.h>
11864 #include <sys/ndir.h>
11868 #include <ndir.h> /* may be wrong in the future */
11870 #include <sys/dir.h>
11875 int main() { return closedir(opendir(".")); }
11878 if eval $compile_ok; then
11879 if ./closedir > /dev/null 2>&1 ; then
11880 echo "Yes, it does."
11883 echo "No, it doesn't."
11887 echo "(I can't seem to compile the test program--assuming it doesn't)"
11895 set d_void_closedir
11898 : check for volatile keyword
11900 echo 'Checking to see if your C compiler knows about "volatile"...' >&4
11901 $cat >try.c <<'EOCP'
11904 typedef struct _goo_struct goo_struct;
11905 goo_struct * volatile goo = ((goo_struct *)0);
11906 struct _goo_struct {
11911 typedef unsigned short foo_t;
11912 char *volatile foo;
11914 volatile foo_t blech;
11918 if $cc -c $ccflags try.c >/dev/null 2>&1 ; then
11920 echo "Yup, it does."
11923 echo "Nope, it doesn't."
11929 : see if there is a wait4
11933 : see if waitpid exists
11934 set waitpid d_waitpid
11937 : see if wcstombs exists
11938 set wcstombs d_wcstombs
11941 : see if wctomb exists
11942 set wctomb d_wctomb
11945 : preserve RCS keywords in files with variable substitution, grrr
11950 Revision='$Revision'
11952 case "$crosscompile" in
11953 ''|[nN]*) crosscompile="$undef" ;;
11957 next|rhapsody|darwin) multiarch="$define" ;;
11959 case "$multiarch" in
11960 ''|[nN]*) multiarch="$undef" ;;
11963 : check for alignment requirements
11965 case "$crosscompile$multiarch" in
11968 You seem to be either cross-compiling or doing a multiarchitecture build,
11969 skipping the memory alignment check.
11972 case "$alignbytes" in
11973 '') alignbytes=8 ;;
11977 case "$alignbytes" in
11978 '') echo "Checking alignment constraints..." >&4
11979 if $test "X$uselongdouble" = Xdefine -a "X$d_longdbl" = Xdefine; then
11980 $cat >try.c <<'EOCP'
11981 typedef long double NV;
11984 $cat >try.c <<'EOCP'
11988 $cat >>try.c <<'EOCP'
11996 printf("%d\n", (int)((char *)&try_algn.bar - (char *)&try_algn.foo));
12001 if eval $compile_ok; then
12005 echo "(I can't seem to compile the test program...)"
12008 *) dflt="$alignbytes"
12011 rp="Doubles must be aligned on a how-many-byte boundary?"
12019 : set the base revision
12022 : check for ordering of bytes in a long
12024 case "$crosscompile$multiarch" in
12027 You seem to be either cross-compiling or doing a multiarchitecture build,
12028 skipping the byteorder check.
12034 case "$byteorder" in
12037 In the following, larger digits indicate more significance. A big-endian
12038 machine like a Pyramid or a Motorola 680?0 chip will come out to 4321. A
12039 little-endian machine like a Vax or an Intel 80?86 chip would be 1234. Other
12040 machines may have weird orders like 3412. A Cray will report 87654321,
12041 an Alpha will report 12345678. If the test program works the default is
12043 I'm now running the test program...
12045 $cat >try.c <<'EOCP'
12052 char c[sizeof(long)];
12055 if (sizeof(long) > 4)
12056 u.l = (0x08070605L << 32) | 0x04030201L;
12059 for (i = 0; i < sizeof(long); i++)
12060 printf("%c", u.c[i]+'0');
12067 if eval $compile && ./try > /dev/null; then
12070 [1-4][1-4][1-4][1-4]|12345678|87654321)
12071 echo "(The test program ran ok.)"
12072 echo "byteorder=$dflt"
12075 ????|????????) echo "(The test program ran ok.)" ;;
12076 *) echo "(The test program didn't run right for some reason.)" ;;
12081 (I can't seem to compile the test program. Guessing big-endian...)
12084 case "$xxx_prompt" in
12086 rp="What is the order of bytes in a long?"
12100 : how do we catenate cpp tokens here?
12102 echo "Checking to see how your cpp does stuff like catenate tokens..." >&4
12103 $cat >cpp_stuff.c <<'EOCP'
12104 #define RCAT(a,b)a/**/b
12105 #define ACAT(a,b)a ## b
12109 $cppstdin $cppflags $cppminus <cpp_stuff.c >cpp_stuff.out 2>&1
12110 if $contains 'Circus' cpp_stuff.out >/dev/null 2>&1; then
12111 echo "Oh! Smells like ANSI's been here." >&4
12112 echo "We can catify or stringify, separately or together!"
12114 elif $contains 'Reiser' cpp_stuff.out >/dev/null 2>&1; then
12115 echo "Ah, yes! The good old days!" >&4
12116 echo "However, in the good old days we don't know how to stringify and"
12117 echo "catify at the same time."
12121 Hmm, I don't seem to be able to catenate tokens with your cpp. You're going
12122 to have to edit the values of CAT[2-5] in config.h...
12124 cpp_stuff="/* Help! How do we handle cpp_stuff? */*/"
12128 : see if this is a db.h system
12134 : Check db version.
12136 echo "Checking Berkeley DB version ..." >&4
12142 #include <sys/types.h>
12147 #ifdef DB_VERSION_MAJOR /* DB version >= 2 */
12148 int Major, Minor, Patch ;
12149 unsigned long Version ;
12150 (void)db_version(&Major, &Minor, &Patch) ;
12151 printf("You have Berkeley DB Version 2 or greater\n");
12153 printf("db.h is from Berkeley DB Version %d.%d.%d\n",
12154 DB_VERSION_MAJOR, DB_VERSION_MINOR, DB_VERSION_PATCH);
12155 printf("libdb is from Berkeley DB Version %d.%d.%d\n",
12156 Major, Minor, Patch) ;
12158 /* check that db.h & libdb are compatible */
12159 if (DB_VERSION_MAJOR != Major || DB_VERSION_MINOR != Minor || DB_VERSION_PATCH != Patch) {
12160 printf("db.h and libdb are incompatible\n") ;
12164 printf("db.h and libdb are compatible\n") ;
12166 Version = DB_VERSION_MAJOR * 1000000 + DB_VERSION_MINOR * 1000
12167 + DB_VERSION_PATCH ;
12169 /* needs to be >= 2.3.4 */
12170 if (Version < 2003004) {
12171 /* if (DB_VERSION_MAJOR == 2 && DB_VERSION_MINOR == 0 && DB_VERSION_PATCH < 5) { */
12172 printf("but Perl needs Berkeley DB 2.3.4 or greater\n") ;
12178 #if defined(_DB_H_) && defined(BTREEMAGIC) && defined(HASHMAGIC)
12179 printf("You have Berkeley DB Version 1\n");
12180 exit(0); /* DB version < 2: the coast is clear. */
12182 exit(1); /* <db.h> not Berkeley DB? */
12188 if eval $compile_ok && ./try; then
12189 echo 'Looks OK.' >&4
12191 echo "I can't use Berkeley DB with your <db.h>. I'll disable Berkeley DB." >&4
12195 : Remove db from list of libraries to use
12196 echo "Removing unusable -ldb from library list" >&4
12197 set `echo X $libs | $sed -e 's/-ldb / /' -e 's/-ldb$//'`
12200 echo "libs = $libs" >&4
12210 : Check the return type needed for hash
12212 echo "Checking return type needed for hash for Berkeley DB ..." >&4
12218 #include <sys/types.h>
12221 #ifndef DB_VERSION_MAJOR
12222 u_int32_t hash_cb (ptr, size)
12230 info.hash = hash_cb;
12234 if $cc $ccflags -c try.c >try.out 2>&1 ; then
12235 if $contains warning try.out >>/dev/null 2>&1 ; then
12238 db_hashtype='u_int32_t'
12241 : XXX Maybe we should just give up here.
12242 db_hashtype=u_int32_t
12244 echo "Help: I can't seem to compile the db test program." >&4
12245 echo "Something's wrong, but I'll assume you use $db_hashtype." >&4
12248 echo "Your version of Berkeley DB uses $db_hashtype for hash."
12250 *) db_hashtype=u_int32_t
12255 : Check the return type needed for prefix
12257 echo "Checking return type needed for prefix for Berkeley DB ..." >&4
12263 #include <sys/types.h>
12266 #ifndef DB_VERSION_MAJOR
12267 size_t prefix_cb (key1, key2)
12275 info.prefix = prefix_cb;
12279 if $cc $ccflags -c try.c >try.out 2>&1 ; then
12280 if $contains warning try.out >>/dev/null 2>&1 ; then
12281 db_prefixtype='int'
12283 db_prefixtype='size_t'
12286 db_prefixtype='size_t'
12287 : XXX Maybe we should just give up here.
12289 echo "Help: I can't seem to compile the db test program." >&4
12290 echo "Something's wrong, but I'll assume you use $db_prefixtype." >&4
12293 echo "Your version of Berkeley DB uses $db_prefixtype for prefix."
12295 *) db_prefixtype='size_t'
12299 : check for void type
12301 echo "Checking to see how well your C compiler groks the void type..." >&4
12302 case "$voidflags" in
12304 $cat >try.c <<'EOCP'
12310 extern void moo(); /* function returning void */
12311 void (*goo)(); /* ptr to func returning void */
12313 void *hue; /* generic ptr */
12326 int main() { sub(); }
12328 if $cc $ccflags -c -DTRY=$defvoidused try.c >.out 2>&1 ; then
12329 voidflags=$defvoidused
12330 echo "Good. It appears to support void to the level $package wants.">&4
12331 if $contains warning .out >/dev/null 2>&1; then
12332 echo "However, you might get some warnings that look like this:"
12336 echo "Hmm, your compiler has some difficulty with void. Checking further..." >&4
12337 if $cc $ccflags -c -DTRY=1 try.c >/dev/null 2>&1; then
12338 echo "It supports 1..."
12339 if $cc $ccflags -c -DTRY=3 try.c >/dev/null 2>&1; then
12340 echo "It also supports 2..."
12341 if $cc $ccflags -c -DTRY=7 try.c >/dev/null 2>&1; then
12343 echo "And it supports 4 but not 8 definitely."
12345 echo "It doesn't support 4..."
12346 if $cc $ccflags -c -DTRY=11 try.c >/dev/null 2>&1; then
12348 echo "But it supports 8."
12351 echo "Neither does it support 8."
12355 echo "It does not support 2..."
12356 if $cc $ccflags -c -DTRY=13 try.c >/dev/null 2>&1; then
12358 echo "But it supports 4 and 8."
12360 if $cc $ccflags -c -DTRY=5 try.c >/dev/null 2>&1; then
12362 echo "And it supports 4 but has not heard about 8."
12364 echo "However it supports 8 but not 4."
12369 echo "There is no support at all for void."
12374 case "$voidflags" in
12376 *) $cat >&4 <<'EOM'
12377 Support flag bits are:
12378 1: basic void declarations.
12379 2: arrays of pointers to functions returning void.
12380 4: operations between pointers to and addresses of void functions.
12381 8: generic void pointers.
12384 rp="Your void support flags add up to what?"
12392 : How can we generate normalized random numbers ?
12394 echo "Looking for a random number function..." >&4
12395 case "$randfunc" in
12397 if set drand48 val -f; eval $csym; $val; then
12399 echo "Good, found drand48()." >&4
12400 elif set random val -f; eval $csym; $val; then
12402 echo "OK, found random()." >&4
12405 echo "Yick, looks like I have to use rand()." >&4
12416 *-Dmy_rand=*|*-Dmy_srand=*)
12417 echo "Removing obsolete -Dmy_rand, -Dmy_srand, and -Drandbits from ccflags." >&4
12418 ccflags="`echo $ccflags | sed -e 's/-Dmy_rand=random/ /'`"
12419 ccflags="`echo $ccflags | sed -e 's/-Dmy_srand=srandom/ /'`"
12420 ccflags="`echo $ccflags | sed -e 's/-Drandbits=[0-9][0-9]*/ /'`"
12424 while $test "$cont"; do
12425 rp="Use which function to generate random numbers?"
12427 if $test "$ans" = "$dflt"; then
12433 if set $ans val -f; eval $csym; $val; then
12437 rp="I cannot find function $ans. Use that name anyway?"
12446 case "$randfunc" in
12448 drand01="drand48()"
12454 case "$randbits" in
12456 echo "Checking to see how many bits your $randfunc() function produces..." >&4
12458 #$i_unistd I_UNISTD
12459 #$i_stdlib I_STDLIB
12462 # include <unistd.h>
12465 # include <stdlib.h>
12470 register unsigned long tmp;
12471 register unsigned long max = 0L;
12473 for (i = 1000; i; i--) {
12474 tmp = (unsigned long) $randfunc();
12475 if (tmp > max) max = tmp;
12477 for (i = 0; max; i++)
12483 if eval $compile_ok; then
12487 echo "(I can't seem to compile the test program...)"
12494 rp="How many bits does your $randfunc() function produce?"
12498 drand01="($randfunc() / (double) ((unsigned long)1 << $randbits))"
12499 seedfunc="s$randfunc"
12500 randseedtype=unsigned
12504 rp="How many bits does your $randfunc() function produce?"
12507 seedfunc="s$randfunc"
12508 drand01="($randfunc() / (double) ((unsigned long)1 << $randbits))"
12509 if set $seedfunc val -f; eval $csym; $val; then
12510 echo "(Using $seedfunc() to seed random generator)"
12512 echo "(Warning: no $seedfunc() to seed random generator)"
12515 randseedtype=unsigned
12523 echo "Determining whether or not we are on an EBCDIC system..." >&4
12524 $cat >tebcdic.c <<'EOM'
12527 if ('M'==0xd4) return 0;
12534 if eval $compile_ok; then
12536 echo "You seem to speak EBCDIC." >&4
12539 echo "Nope, no EBCDIC, probably ASCII or some ISO Latin. Or UTF8." >&4
12542 echo "I'm unable to compile the test program." >&4
12543 echo "I'll assume ASCII or some ISO Latin. Or UTF8." >&4
12545 $rm -f tebcdic.c tebcdic
12551 Checking how to flush all pending stdio output...
12553 # I only know how to find the first 32 possibly open files on SunOS.
12554 # See also hints/sunos_4_1.sh and util.c --AD
12556 sunos) $echo '#define PERL_FFLUSH_ALL_FOPEN_MAX 32' > try.c ;;
12558 $cat >>try.c <<EOCP
12560 #$i_unistd I_UNISTD
12562 # include <unistd.h>
12564 #$d_sysconf HAS_SYSCONF
12565 #$d_stdio_stream_array HAS_STDIO_STREAM_ARRAY
12566 #ifdef HAS_STDIO_STREAM_ARRAY
12567 # define STDIO_STREAM_ARRAY $stdio_stream_array
12570 FILE* p = fopen("try.out", "w");
12574 # ifdef TRY_FPRINTF
12578 #ifdef TRY_FFLUSH_NULL
12581 #ifdef TRY_FFLUSH_ALL
12583 long open_max = -1;
12584 # ifdef PERL_FFLUSH_ALL_FOPEN_MAX
12585 open_max = PERL_FFLUSH_ALL_FOPEN_MAX;
12587 # if defined(HAS_SYSCONF) && defined(_SC_OPEN_MAX)
12588 open_max = sysconf(_SC_OPEN_MAX);
12591 open_max = FOPEN_MAX;
12594 open_max = OPEN_MAX;
12603 # ifdef HAS_STDIO_STREAM_ARRAY
12604 if (open_max > 0) {
12606 for (i = 0; i < open_max; i++)
12607 if (STDIO_STREAM_ARRAY[i]._file >= 0 &&
12608 STDIO_STREAM_ARRAY[i]._file < open_max &&
12609 STDIO_STREAM_ARRAY[i]._flag)
12610 fflush(&STDIO_STREAM_ARRAY[i]);
12618 : first we have to find out how _not_ to flush
12619 if $test "X$fflushNULL" = X -o "X$fflushall" = X; then
12621 set try -DTRY_FPUTC
12622 if eval $compile; then
12624 ./try$exe_ext 2>/dev/null
12625 if $test ! -s try.out -a "X$?" = X42; then
12631 set try -DTRY_FPRINTF
12633 if eval $compile; then
12635 ./try$exe_ext 2>/dev/null
12636 if $test ! -s try.out -a "X$?" = X42; then
12637 output=-DTRY_FPRINTF
12643 : check for fflush NULL behaviour
12644 case "$fflushNULL" in
12645 '') set try -DTRY_FFLUSH_NULL $output
12646 if eval $compile; then
12648 ./try$exe_ext 2>/dev/null
12650 if $test -s try.out -a "X$code" = X42; then
12651 fflushNULL="`$cat try.out`"
12653 if $test "X$code" != X42; then
12655 (If this test failed, don't worry, we'll try another method shortly.)
12660 $rm -f core try.core core.try.*
12661 case "$fflushNULL" in
12663 Your fflush(NULL) works okay for output streams.
12664 Let's see if it clobbers input pipes...
12666 # As of mid-March 2000 all versions of Solaris appear to have a stdio
12667 # bug that improperly flushes the input end of pipes. So we avoid the
12668 # autoflush on fork/system/exec support for now. :-(
12669 $cat >tryp.c <<EOCP
12672 main(int argc, char **argv)
12678 while ((i = getc(stdin)) != -1
12679 && (*bp++ = i) != '\n'
12680 && bp < &buf[1024])
12683 fprintf(stdout, "%s", buf);
12691 fflushNULL="$define"
12693 if eval $compile; then
12695 $cat tryp.c | ./tryp$exe_ext 2>/dev/null > tryp.out
12696 if cmp tryp.c tryp.out >/dev/null 2>&1; then
12698 fflush(NULL) seems to behave okay with input streams.
12700 fflushNULL="$define"
12703 Ouch, fflush(NULL) clobbers input pipes! We will not use it.
12705 fflushNULL="$undef"
12708 $rm -f core tryp.c tryp.core core.tryp.*
12711 Your fflush(NULL) isn't working (contrary to ANSI C).
12713 fflushNULL="$undef"
12716 Cannot figure out whether your fflush(NULL) works or not.
12717 I'm assuming it doesn't (contrary to ANSI C).
12719 fflushNULL="$undef"
12723 $define|true|[yY]*)
12724 fflushNULL="$define"
12727 fflushNULL="$undef"
12730 : check explicit looping only if NULL did not work, and if the pipe
12731 : bug does not show up on an explicit flush too
12732 case "$fflushNULL" in
12734 $cat >tryp.c <<EOCP
12737 main(int argc, char **argv)
12743 while ((i = getc(stdin)) != -1
12744 && (*bp++ = i) != '\n'
12745 && bp < &buf[1024])
12748 fprintf(stdout, "%s", buf);
12757 if eval $compile; then
12759 $cat tryp.c | ./tryp$exe_ext 2>/dev/null > tryp.out
12760 if cmp tryp.c tryp.out >/dev/null 2>&1; then
12762 Good, at least fflush(stdin) seems to behave okay when stdin is a pipe.
12764 : now check for fflushall behaviour
12765 case "$fflushall" in
12766 '') set try -DTRY_FFLUSH_ALL $output
12767 if eval $compile; then
12769 (Now testing the other method--but note that this also may fail.)
12772 ./try$exe_ext 2>/dev/null
12773 if $test -s try.out -a "X$?" = X42; then
12774 fflushall="`$cat try.out`"
12777 $rm -f core try.core core.try.*
12778 case "$fflushall" in
12780 Whew. Flushing explicitly all the stdio streams works.
12782 fflushall="$define"
12785 Sigh. Flushing explicitly all the stdio streams doesn't work.
12790 Cannot figure out whether flushing stdio streams explicitly works or not.
12791 I'm assuming it doesn't.
12797 "$define"|true|[yY]*)
12798 fflushall="$define"
12806 All is futile. Even fflush(stdin) clobbers input pipes!
12813 $rm -f core tryp.c tryp.core core.tryp.*
12815 *) fflushall="$undef"
12819 case "$fflushNULL$fflushall" in
12822 OK, I give up. I cannot figure out how to flush pending stdio output.
12823 We won't be flushing handles at all before fork/exec/popen.
12827 $rm -f try.* try$exe_ext
12829 : Store the full pathname to the ar program for use in the C program
12830 : Respect a hint or command line value for full_ar.
12835 : Store the full pathname to the sed program for use in the C program
12838 : see what type gids are declared as in the kernel
12840 echo "Looking for the type for group ids returned by getgid()."
12841 set gid_t gidtype xxx stdio.h sys/types.h
12845 xxx=`./findhdr sys/user.h`
12846 set `grep 'groups\[NGROUPS\];' "$xxx" 2>/dev/null` unsigned short
12848 unsigned) dflt="$1 $2" ;;
12852 *) dflt="$gidtype";;
12855 gid_t) echo "gid_t found." ;;
12856 *) rp="What is the type for group ids returned by getgid()?"
12864 *_t) zzz="$gidtype" ;;
12867 echo "Checking the size of $zzz..." >&4
12869 #include <sys/types.h>
12872 printf("%d\n", (int)sizeof($gidtype));
12877 if eval $compile_ok; then
12881 echo "(I can't execute the test program--guessing $gidsize.)" >&4
12884 echo "Your $zzz is $gidsize bytes long."
12889 echo "(I can't compile the test program--guessing $gidsize.)" >&4
12895 *_t) zzz="$gidtype" ;;
12898 echo "Checking the sign of $zzz..." >&4
12900 #include <sys/types.h>
12911 if eval $compile; then
12915 echo "(I can't execute the test program--guessing unsigned.)" >&4
12919 1) echo "Your $zzz is unsigned." ;;
12920 -1) echo "Your $zzz is signed." ;;
12926 echo "(I can't compile the test program--guessing unsigned.)" >&4
12932 if $test X"$quadtype" != X; then
12934 echo "Checking how to print 64-bit integers..." >&4
12936 if $test X"$sPRId64" = X -a X"$quadtype" = Xint; then
12937 $cat >try.c <<'EOCP'
12938 #include <sys/types.h>
12941 int q = 12345678901;
12942 printf("%ld\n", q);
12946 if eval $compile; then
12947 yyy=`./try$exe_ext`
12950 sPRId64='"d"'; sPRIi64='"i"'; sPRIu64='"u"';
12951 sPRIo64='"o"'; sPRIx64='"x"'; sPRIXU64='"X"';
12952 echo "We will use %d."
12958 if $test X"$sPRId64" = X -a X"$quadtype" = Xlong; then
12959 $cat >try.c <<'EOCP'
12960 #include <sys/types.h>
12963 long q = 12345678901;
12964 printf("%ld\n", q);
12968 if eval $compile; then
12969 yyy=`./try$exe_ext`
12972 sPRId64='"ld"'; sPRIi64='"li"'; sPRIu64='"lu"';
12973 sPRIo64='"lo"'; sPRIx64='"lx"'; sPRIXU64='"lX"';
12974 echo "We will use %ld."
12980 if $test X"$sPRId64" = X -a X"$i_inttypes" = X"$define" -a X"$quadtype" = Xint64_t; then
12981 $cat >try.c <<'EOCP'
12982 #include <sys/types.h>
12983 #include <inttypes.h>
12986 int64_t q = 12345678901;
12987 printf("%" PRId64 "\n", q);
12991 if eval $compile; then
12992 yyy=`./try$exe_ext`
12995 sPRId64=PRId64; sPRIi64=PRIi64; sPRIu64=PRIu64;
12996 sPRIo64=PRIo64; sPRIx64=PRIx64; sPRIXU64=PRIXU64;
12997 echo "We will use the C9X style."
13003 if $test X"$sPRId64" = X -a X"$quadtype" = X"long long"; then
13004 $cat >try.c <<'EOCP'
13005 #include <sys/types.h>
13008 long long q = 12345678901LL; /* AIX cc requires the LL suffix. */
13009 printf("%lld\n", q);
13013 if eval $compile; then
13014 yyy=`./try$exe_ext`
13017 sPRId64='"lld"'; sPRIi64='"lli"'; sPRIu64='"llu"';
13018 sPRIo64='"llo"'; sPRIx64='"llx"'; sPRIXU64='"llX"';
13019 echo "We will use the %lld style."
13025 if $test X"$sPRId64" = X -a X"$quadtype" != X; then
13027 #include <sys/types.h>
13030 $quadtype q = 12345678901;
13031 printf("%Ld\n", q);
13035 if eval $compile; then
13036 yyy=`./try$exe_ext`
13039 sPRId64='"Ld"'; sPRIi64='"Li"'; sPRIu64='"Lu"';
13040 sPRIo64='"Lo"'; sPRIx64='"Lx"'; sPRIXU64='"LX"';
13041 echo "We will use %Ld."
13047 if $test X"$sPRId64" = X -a X"$quadtype" != X; then
13049 #include <sys/types.h>
13052 $quadtype q = 12345678901;
13053 printf("%qd\n", q);
13057 if eval $compile; then
13058 yyy=`./try$exe_ext`
13061 sPRId64='"qd"'; sPRIi64='"qi"'; sPRIu64='"qu"';
13062 sPRIo64='"qo"'; sPRIx64='"qx"'; sPRIXU64='"qX"';
13063 echo "We will use %qd."
13069 if $test X"$sPRId64" = X; then
13070 echo "Cannot figure out how to print 64-bit integers." >&4
13078 '') d_PRId64="$undef"; d_PRIi64="$undef"; d_PRIu64="$undef";
13079 d_PRIo64="$undef"; d_PRIx64="$undef"; d_PRIXU64="$undef";
13081 *) d_PRId64="$define"; d_PRIi64="$define"; d_PRIu64="$define";
13082 d_PRIo64="$define"; d_PRIx64="$define"; d_PRIXU64="$define";
13088 $echo "Checking the format strings to be used for Perl's internal types..." >&4
13090 if $test X"$ivsize" = X8; then
13091 ivdformat="$sPRId64"
13092 uvuformat="$sPRIu64"
13093 uvoformat="$sPRIo64"
13094 uvxformat="$sPRIx64"
13095 uvXUformat="$sPRIXU64"
13097 if $test X"$ivsize" = X"$longsize"; then
13104 if $test X"$ivsize" = X"$intsize"; then
13112 if $test X"$ivsize" = X"$shortsize"; then
13123 if $test X"$uselongdouble" = X"$define" -a X"$d_longdbl" = X"$define" -a X"$d_PRIgldbl" = X"$define"; then
13124 nveformat="$sPRIeldbl"
13125 nvfformat="$sPRIfldbl"
13126 nvgformat="$sPRIgldbl"
13127 nvEUformat="$sPRIEUldbl"
13128 nvFUformat="$sPRIFUldbl"
13129 nvGUformat="$sPRIGUldbl"
13139 case "$ivdformat" in
13140 '') echo "$0: Fatal: failed to find format strings, cannot continue." >& 4
13147 $echo "Checking the format string to be used for gids..." >&4
13150 -1) if $test X"$gidsize" = X"$ivsize"; then
13151 gidformat="$ivdformat"
13153 if $test X"$gidsize" = X"$longsize"; then
13156 if $test X"$gidsize" = X"$intsize"; then
13159 if $test X"$gidsize" = X"$shortsize"; then
13166 *) if $test X"$gidsize" = X"$uvsize"; then
13167 gidformat="$uvuformat"
13169 if $test X"$gidsize" = X"$longsize"; then
13172 if $test X"$gidsize" = X"$intsize"; then
13175 if $test X"$gidsize" = X"$shortsize"; then
13184 : see if getgroups exists
13185 set getgroups d_getgrps
13188 : see if setgroups exists
13189 set setgroups d_setgrps
13193 : Find type of 2nd arg to 'getgroups()' and 'setgroups()'
13195 case "$d_getgrps$d_setgrps" in
13197 case "$groupstype" in
13198 '') dflt="$gidtype" ;;
13199 *) dflt="$groupstype" ;;
13202 What type of pointer is the second argument to getgroups() and setgroups()?
13203 Usually this is the same as group ids, $gidtype, but not always.
13206 rp='What type pointer is the second argument to getgroups() and setgroups()?'
13210 *) groupstype="$gidtype";;
13214 echo "Checking if your $make program sets \$(MAKE)..." >&4
13215 case "$make_set_make" in
13217 $sed 's/^X //' > testmake.mak << 'EOF'
13219 X @echo 'maketemp="$(MAKE)"'
13221 case "`$make -f testmake.mak 2>/dev/null`" in
13222 *maketemp=*) make_set_make='#' ;;
13223 *) make_set_make="MAKE=$make" ;;
13225 $rm -f testmake.mak
13228 case "$make_set_make" in
13229 '#') echo "Yup, it does.";;
13230 *) echo "Nope, it doesn't.";;
13233 : see what type is used for mode_t
13234 rp="What is the type used for file modes for system calls (e.g. fchmod())?"
13235 set mode_t modetype int stdio.h sys/types.h
13238 : define a fucntion to check prototypes
13239 $cat > protochk <<EOSH
13242 optimize="$optimize"
13244 prototype="$prototype"
13249 $cat >> protochk <<'EOSH'
13254 while test $# -ge 2; do
13256 $define) echo "#include <$2>" >> try.c ;;
13257 literal) echo "$2" >> try.c ;;
13261 test "$prototype" = "$define" && echo '#define CAN_PROTOTYPE' >> try.c
13262 cat >> try.c <<'EOCP'
13263 #ifdef CAN_PROTOTYPE
13264 #define _(args) args
13269 echo "$foo" >> try.c
13270 echo 'int no_real_function_has_this_name _((void)) { return 0; }' >> try.c
13271 $cc $optimize $ccflags -c try.c > /dev/null 2>&1
13277 $eunicefix protochk
13279 : see what type is used for size_t
13280 rp="What is the type used for the length parameter for string functions?"
13281 set size_t sizetype 'unsigned int' stdio.h sys/types.h
13284 : check for type of arguments to gethostbyaddr.
13285 if test "X$netdb_host_type" = X -o "X$netdb_hlen_type" = X; then
13286 case "$d_gethbyaddr" in
13290 Checking to see what type of arguments are accepted by gethostbyaddr().
13292 hdrs="$define sys/types.h
13293 $d_socket sys/socket.h
13294 $i_niin netinet/in.h
13296 $i_unistd unistd.h"
13297 : The first arg can 'char *' or 'void *'
13298 : The second arg is some of integral type
13299 for xxx in in_addr_t 'const void *' 'const char *' 'void *' 'char *'; do
13300 for yyy in size_t long int; do
13301 case "$netdb_host_type" in
13302 '') try="extern struct hostent *gethostbyaddr($xxx, $yyy, int);"
13303 if ./protochk "$try" $hdrs; then
13304 echo "Your system accepts $xxx for the first arg."
13305 echo "...and $yyy for the second arg."
13306 netdb_host_type="$xxx"
13307 netdb_hlen_type="$yyy"
13313 : In case none of those worked, prompt the user.
13314 case "$netdb_host_type" in
13315 '') rp='What is the type for the 1st argument to gethostbyaddr?'
13318 netdb_host_type=$ans
13319 rp='What is the type for the 2nd argument to gethostbyaddr?'
13322 netdb_hlen_type=$ans
13326 *) : no gethostbyaddr, so pick harmless defaults
13327 netdb_host_type='char *'
13328 netdb_hlen_type="$sizetype"
13331 # Remove the "const" if needed. -- but then we'll have a
13333 # netdb_host_type=`echo "$netdb_host_type" | sed 's/^const //'`
13336 : check for type of argument to gethostbyname.
13337 if test "X$netdb_name_type" = X ; then
13338 case "$d_gethbyname" in
13342 Checking to see what type of argument is accepted by gethostbyname().
13344 hdrs="$define sys/types.h
13345 $d_socket sys/socket.h
13346 $i_niin netinet/in.h
13348 $i_unistd unistd.h"
13349 for xxx in "const char *" "char *"; do
13350 case "$netdb_name_type" in
13351 '') try="extern struct hostent *gethostbyname($xxx);"
13352 if ./protochk "$try" $hdrs; then
13353 echo "Your system accepts $xxx."
13354 netdb_name_type="$xxx"
13359 : In case none of those worked, prompt the user.
13360 case "$netdb_name_type" in
13361 '') rp='What is the type for the 1st argument to gethostbyname?'
13364 netdb_name_type=$ans
13368 *) : no gethostbyname, so pick harmless default
13369 netdb_name_type='char *'
13374 : check for type of 1st argument to getnetbyaddr.
13375 if test "X$netdb_net_type" = X ; then
13376 case "$d_getnbyaddr" in
13380 Checking to see what type of 1st argument is accepted by getnetbyaddr().
13382 hdrs="$define sys/types.h
13383 $d_socket sys/socket.h
13384 $i_niin netinet/in.h
13386 $i_unistd unistd.h"
13387 for xxx in in_addr_t "unsigned long" long "unsigned int" int; do
13388 case "$netdb_net_type" in
13389 '') try="extern struct netent *getnetbyaddr($xxx, int);"
13390 if ./protochk "$try" $hdrs; then
13391 echo "Your system accepts $xxx."
13392 netdb_net_type="$xxx"
13397 : In case none of those worked, prompt the user.
13398 case "$netdb_net_type" in
13399 '') rp='What is the type for the 1st argument to getnetbyaddr?'
13402 netdb_net_type=$ans
13406 *) : no getnetbyaddr, so pick harmless default
13407 netdb_net_type='long'
13411 : locate the preferred pager for this system
13417 [a-zA-Z]:/*) dflt=$pg;;
13421 [a-zA-Z]:/*) dflt=$more;;
13425 [a-zA-Z]:/*) dflt=$less;;
13428 '') dflt=/usr/ucb/more;;
13435 rp='What pager is used on your system?'
13439 : see what type pids are declared as in the kernel
13440 rp="What is the type of process ids on this system?"
13441 set pid_t pidtype int stdio.h sys/types.h
13444 : Find earliest binary compatible site_perl subdirectory perl can use.
13445 case "$bincompat5005" in
13446 "$define") xs_apiversion='5.005' ;;
13447 *) xs_apiversion=$version ;; # The current site_perl version.
13449 : Find earliest pure perl site_perl subdirectory perl can use.
13450 : The versioned directories started at 5.005.
13451 pm_apiversion='5.005'
13453 : check for length of pointer
13457 echo "Checking to see how big your pointers are..." >&4
13458 if test "$voidflags" -gt 7; then
13459 echo '#define VOID_PTR char *' > try.c
13461 echo '#define VOID_PTR void *' > try.c
13463 $cat >>try.c <<'EOCP'
13467 printf("%d\n", (int)sizeof(VOID_PTR));
13472 if eval $compile_ok; then
13474 echo "Your pointers are $ptrsize bytes long."
13477 echo "(I can't seem to compile the test program. Guessing...)" >&4
13478 rp="What is the size of a pointer (in bytes)?"
13486 : see if ar generates random libraries by itself
13488 echo "Checking how to generate random libraries on your machine..." >&4
13489 echo 'int bar1() { return bar2(); }' > bar1.c
13490 echo 'int bar2() { return 2; }' > bar2.c
13491 $cat > foo.c <<'EOP'
13492 int main() { printf("%d\n", bar1()); exit(0); }
13494 $cc $ccflags -c bar1.c >/dev/null 2>&1
13495 $cc $ccflags -c bar2.c >/dev/null 2>&1
13496 $cc $ccflags -c foo.c >/dev/null 2>&1
13497 $ar rc bar$_a bar2$_o bar1$_o >/dev/null 2>&1
13498 if $cc $ccflags $ldflags -o foobar foo$_o bar$_a $libs > /dev/null 2>&1 &&
13499 ./foobar >/dev/null 2>&1; then
13500 echo "$ar appears to generate random libraries itself."
13503 elif $ar ts bar$_a >/dev/null 2>&1 &&
13504 $cc $ccflags $ldflags -o foobar foo$_o bar$_a $libs > /dev/null 2>&1 &&
13505 ./foobar >/dev/null 2>&1; then
13506 echo "a table of contents needs to be added with '$ar ts'."
13513 ranlib=`./loc ranlib X /usr/bin /bin /usr/local/bin`
13514 $test -f $ranlib || ranlib=''
13517 if $test -n "$ranlib"; then
13518 echo "your system has '$ranlib'; we'll use that."
13521 echo "your system doesn't seem to support random libraries"
13522 echo "so we'll use lorder and tsort to order the libraries."
13529 : check for type of arguments to select.
13530 case "$selecttype" in
13531 '') case "$d_select" in
13535 Checking to see what type of arguments are accepted by select().
13537 hdrs="$define sys/types.h
13538 $i_systime sys/time.h
13539 $i_sysselct sys/select.h
13540 $d_socket sys/socket.h"
13541 : The first arg can be int, unsigned, or size_t
13542 : The last arg may or may not be 'const'
13544 : void pointer has been seen but using that
13545 : breaks the selectminbits test
13546 for xxx in 'fd_set *' 'int *'; do
13547 for nfd in 'int' 'size_t' 'unsigned long' 'unsigned' ; do
13548 for tmo in 'struct timeval *' 'const struct timeval *'; do
13550 '') try="extern select _(($nfd, $xxx, $xxx, $xxx, $tmo));"
13551 if ./protochk "$try" $hdrs; then
13552 echo "Your system accepts $xxx."
13561 '') rp='What is the type for the 2nd, 3rd, and 4th arguments to select?'
13562 case "$d_fd_set" in
13563 $define) dflt="fd_set *" ;;
13572 *) : no select, so pick a harmless default
13579 : check for the select 'width'
13580 case "$selectminbits" in
13581 '') case "$d_select" in
13585 Checking to see on how many bits at a time your select() operates...
13588 #include <sys/types.h>
13590 #$i_systime I_SYS_TIME
13591 #$i_systimek I_SYS_TIME_KERNEL
13596 # ifdef I_SYS_TIME_KERNEL
13599 # include <sys/time.h>
13600 # ifdef I_SYS_TIME_KERNEL
13604 #$i_sysselct I_SYS_SELECT
13605 #ifdef I_SYS_SELECT
13606 #include <sys/select.h>
13608 #$d_socket HAS_SOCKET
13610 # include <sys/socket.h> /* Might include <sys/bsdtypes.h> */
13614 #define S sizeof(*(b))
13616 #define NBYTES (S * 8 > MINBITS ? S : MINBITS/8)
13617 #define NBITS (NBYTES * 8)
13626 fp = fopen("try.c", "r");
13632 b = ($selecttype)s;
13633 for (i = 0; i < NBITS; i++)
13637 select(fd + 1, b, 0, 0, &t);
13638 for (i = NBITS - 1; i > fd && FD_ISSET(i, b); i--);
13639 printf("%d\n", i + 1);
13644 if eval $compile_ok; then
13645 selectminbits=`./try`
13646 case "$selectminbits" in
13648 Cannot figure out on how many bits at a time your select() operates.
13649 I'll play safe and guess it is 32 bits.
13655 *) bits="$selectminbits bits" ;;
13657 echo "Your select() operates on $bits at a time." >&4
13659 rp='What is the minimum number of bits your select() operates on?'
13660 case "$byteorder" in
13661 1234|12345678) dflt=32 ;;
13666 selectminbits="$val"
13670 *) : no select, so pick a harmless default
13677 : Trace out the files included by signal.h, then look for SIGxxx names.
13678 : Remove SIGARRAYSIZE used by HPUX.
13679 : Remove SIGSTKSIZE used by Linux.
13680 : Remove SIGSTKSZ used by Posix.
13681 : Remove SIGTYP void lines used by OS2.
13682 : Some cpps, like os390, dont give the file name anywhere
13683 if [ "X$fieldn" = X ]; then
13684 : Just make some guesses. We check them later.
13685 xxx='/usr/include/signal.h /usr/include/sys/signal.h'
13687 xxx=`echo '#include <signal.h>' |
13688 $cppstdin $cppminus $cppflags 2>/dev/null |
13689 $grep '^[ ]*#.*include' |
13690 $awk "{print \\$$fieldn}" | $sed 's!"!!g' | $sort | $uniq`
13692 : Check this list of files to be sure we have parsed the cpp output ok.
13693 : This will also avoid potentially non-existent files, such
13696 for xx in $xxx /dev/null ; do
13697 $test -f "$xx" && xxxfiles="$xxxfiles $xx"
13699 : If we have found no files, at least try signal.h
13700 case "$xxxfiles" in
13701 '') xxxfiles=`./findhdr signal.h` ;;
13704 $1 ~ /^#define$/ && $2 ~ /^SIG[A-Z0-9]*$/ && $2 !~ /SIGARRAYSIZE/ && $2 !~ /SIGSTKSIZE/ && $2 !~ /SIGSTKSZ/ && $3 !~ /void/ {
13705 print substr($2, 4, 20)
13707 $1 == "#" && $2 ~ /^define$/ && $3 ~ /^SIG[A-Z0-9]*$/ && $3 !~ /SIGARRAYSIZE/ && $4 !~ /void/ {
13708 print substr($3, 4, 20)
13710 : Append some common names just in case the awk scan failed.
13711 xxx="$xxx ABRT ALRM BUS CANCEL CHLD CLD CONT DIL EMT FPE"
13712 xxx="$xxx FREEZE HUP ILL INT IO IOT KILL LOST LWP PHONE"
13713 xxx="$xxx PIPE POLL PROF PWR QUIT RTMAX RTMIN SEGV STKFLT STOP"
13714 xxx="$xxx SYS TERM THAW TRAP TSTP TTIN TTOU URG USR1 USR2"
13715 xxx="$xxx USR3 USR4 VTALRM WAITING WINCH WIND WINDOW XCPU XFSZ"
13717 : generate a few handy files for later
13718 $cat > signal.c <<'EOCP'
13719 #include <sys/types.h>
13720 #include <signal.h>
13724 /* Strange style to avoid deeply-nested #if/#else/#endif */
13727 # define NSIG (_NSIG)
13733 # define NSIG (SIGMAX+1)
13739 # define NSIG (SIG_MAX+1)
13745 # define NSIG (MAXSIG+1)
13751 # define NSIG (MAX_SIG+1)
13756 # ifdef SIGARRAYSIZE
13757 # define NSIG (SIGARRAYSIZE+1) /* Not sure of the +1 */
13763 # define NSIG (_sys_nsig) /* Solaris 2.5 */
13767 /* Default to some arbitrary number that's big enough to get most
13768 of the common signals.
13774 printf("NSIG %d\n", NSIG);
13780 echo $xxx | $tr ' ' $trnl | $sort | $uniq | $awk '
13782 printf "#ifdef SIG"; printf $1; printf "\n"
13783 printf "printf(\""; printf $1; printf " %%d\\n\",SIG";
13784 printf $1; printf ");\n"
13788 printf "#endif /* JUST_NSIG */\n";
13789 printf "exit(0);\n}\n";
13792 $cat >signal.awk <<'EOP'
13793 BEGIN { ndups = 0 }
13794 $1 ~ /^NSIG$/ { nsig = $2 }
13795 ($1 !~ /^NSIG$/) && (NF == 2) {
13796 if ($2 > maxsig) { maxsig = $2 }
13797 if (sig_name[$2]) {
13798 dup_name[ndups] = $1
13799 dup_num[ndups] = $2
13811 printf("NSIG %d\n", nsig);
13812 for (n = 1; n < nsig; n++) {
13814 printf("%s %d\n", sig_name[n], sig_num[n])
13817 printf("NUM%d %d\n", n, n)
13820 for (n = 0; n < ndups; n++) {
13821 printf("%s %d\n", dup_name[n], dup_num[n])
13825 $cat >signal_cmd <<EOS
13827 if $test -s signal.lst; then
13828 echo "Using your existing signal.lst file"
13833 $cat >>signal_cmd <<'EOS'
13836 if eval $compile_ok; then
13837 ./signal$_exe | $sort -n +1 | $uniq | $awk -f signal.awk >signal.lst
13839 echo "(I can't seem be able to compile the whole test program)" >&4
13840 echo "(I'll try it in little pieces.)" >&4
13841 set signal -DJUST_NSIG
13842 if eval $compile_ok; then
13843 ./signal$_exe > signal.nsg
13846 echo "I can't seem to figure out how many signals you have." >&4
13847 echo "Guessing 50." >&4
13848 echo 'NSIG 50' > signal.nsg
13850 : Now look at all the signal names, one at a time.
13851 for xx in `echo $xxx | $tr ' ' $trnl | $sort | $uniq`; do
13852 $cat > signal.c <<EOCP
13853 #include <sys/types.h>
13854 #include <signal.h>
13857 printf("$xx %d\n", SIG${xx});
13862 if eval $compile; then
13863 echo "SIG${xx} found."
13864 ./signal$_exe >> signal.ls1
13866 echo "SIG${xx} NOT found."
13869 if $test -s signal.ls1; then
13870 $cat signal.nsg signal.ls1 |
13871 $sort -n +1 | $uniq | $awk -f signal.awk >signal.lst
13875 if $test -s signal.lst; then
13878 echo "(AAK! I can't compile the test programs -- Guessing)" >&4
13879 echo 'kill -l' >signal
13880 set X `csh -f <signal`
13884 0) set HUP INT QUIT ILL TRAP ABRT EMT FPE KILL BUS SEGV SYS PIPE ALRM TERM;;
13886 echo $@ | $tr ' ' $trnl | \
13887 $awk '{ printf "%s %d\n", $1, ++s; }
13888 END { printf "NSIG %d\n", ++s }' >signal.lst
13890 $rm -f signal.c signal$_exe signal$_o signal.nsg signal.ls1
13892 chmod a+x signal_cmd
13893 $eunicefix signal_cmd
13895 : generate list of signal names
13897 case "$sig_name_init" in
13899 *) case "$sig_num_init" in
13900 ''|*,*) doinit=yes ;;
13905 echo "Generating a list of signal names and numbers..." >&4
13907 sig_count=`$awk '/^NSIG/ { printf "%d", $2 }' signal.lst`
13908 sig_name=`$awk 'BEGIN { printf "ZERO " }
13909 !/^NSIG/ { printf "%s ", $1 }' signal.lst`
13910 sig_num=`$awk 'BEGIN { printf "0 " }
13911 !/^NSIG/ { printf "%d ", $2 }' signal.lst`
13912 sig_name_init=`$awk 'BEGIN { printf "\"ZERO\", " }
13913 !/^NSIG/ { printf "\"%s\", ", $1 }
13914 END { printf "0\n" }' signal.lst`
13915 sig_num_init=`$awk 'BEGIN { printf "0, " }
13916 !/^NSIG/ { printf "%d, ", $2}
13917 END { printf "0\n"}' signal.lst`
13920 echo "The following $sig_count signals are available:"
13922 echo $sig_name | $awk \
13923 'BEGIN { linelen = 0 }
13925 for (i = 1; i <= NF; i++) {
13926 name = "SIG" $i " "
13927 linelen = linelen + length(name)
13928 if (linelen > 70) {
13930 linelen = length(name)
13936 $rm -f signal signal.c signal.awk signal.lst signal_cmd
13939 case "$sizetype" in
13940 *_t) zzz="$sizetype" ;;
13941 *) zzz="filesize" ;;
13943 echo "Checking the size of $zzz..." >&4
13945 #include <sys/types.h>
13948 printf("%d\n", (int)sizeof($sizetype));
13953 if eval $compile_ok; then
13957 echo "(I can't execute the test program--guessing $sizesize.)" >&4
13960 echo "Your $zzz size is $sizesize bytes."
13965 echo "(I can't compile the test program--guessing $sizesize.)" >&4
13969 : check for socklen_t
13971 echo "Checking to see if you have socklen_t..." >&4
13973 #include <sys/types.h>
13974 #$d_socket HAS_SOCKET
13976 #include <sys/socket.h>
13978 int main() { socklen_t x = 16; }
13981 if eval $compile; then
13983 echo "You have socklen_t."
13986 echo "You do not have socklen_t."
13987 case "$sizetype" in
13988 size_t) echo "(You do have size_t, that might work. Some people are happy with just an int.)" ;;
13995 : check for type of the size argument to socket calls
13996 case "$d_socket" in
14000 Checking to see what type is the last argument of accept().
14002 hdrs="$define sys/types.h $d_socket sys/socket.h"
14004 case "$d_socklen_t" in
14005 "$define") yyy="$yyy socklen_t"
14007 yyy="$yyy $sizetype int long unsigned"
14008 for xxx in $yyy; do
14009 case "$socksizetype" in
14010 '') try="extern int accept(int, struct sockaddr *, $xxx *);"
14011 if ./protochk "$try" $hdrs; then
14012 echo "Your system accepts '$xxx *' for the last argument of accept()."
14013 socksizetype="$xxx"
14018 : In case none of those worked, prompt the user.
14019 case "$socksizetype" in
14020 '') rp='What is the type for socket address structure sizes?'
14027 *) : no sockets, so pick relatively harmless default
14032 : see what type is used for signed size_t
14033 set ssize_t ssizetype int stdio.h sys/types.h
14036 $cat > ssize.c <<EOM
14038 #include <sys/types.h>
14039 #define Size_t $sizetype
14040 #define SSize_t $dflt
14043 if (sizeof(Size_t) == sizeof(SSize_t))
14045 else if (sizeof(Size_t) == sizeof(int))
14054 if eval $compile_ok && ./ssize > /dev/null; then
14055 ssizetype=`./ssize`
14056 echo "I'll be using $ssizetype for functions returning a byte count." >&4
14059 Help! I can't compile and run the ssize_t test program: please enlighten me!
14060 (This is probably a misconfiguration in your system or libraries, and
14061 you really ought to fix it. Still, I'll try anyway.)
14063 I need a type that is the same size as $sizetype, but is guaranteed to
14064 be signed. Common values are ssize_t, int and long.
14067 rp="What signed type is the same size as $sizetype?"
14071 $rm -f ssize ssize.*
14073 : see what type of char stdio uses.
14075 if $contains 'unsigned.*char.*_ptr;' `./findhdr stdio.h` >/dev/null 2>&1 ; then
14076 echo "Your stdio uses unsigned chars." >&4
14077 stdchar="unsigned char"
14079 echo "Your stdio uses signed chars." >&4
14083 : see if time exists
14085 if test "X$d_time" = X -o X"$timetype" = X; then
14086 if set time val -f d_time; eval $csym; $val; then
14087 echo 'time() found.' >&4
14089 rp="What is the type returned by time() on this system?"
14090 set time_t timetype long stdio.h sys/types.h
14093 echo 'time() not found, hope that will do.' >&4
14101 : see what type uids are declared as in the kernel
14103 echo "Looking for the type for user ids returned by getuid()."
14104 set uid_t uidtype xxx stdio.h sys/types.h
14108 xxx=`./findhdr sys/user.h`
14109 set `grep '_ruid;' "$xxx" 2>/dev/null` unsigned short
14111 unsigned) dflt="$1 $2" ;;
14115 *) dflt="$uidtype";;
14118 uid_t) echo "uid_t found." ;;
14119 *) rp="What is the type for user ids returned by getuid()?"
14127 *_t) zzz="$uidtype" ;;
14130 echo "Checking the size of $zzz..." >&4
14132 #include <sys/types.h>
14135 printf("%d\n", (int)sizeof($uidtype));
14140 if eval $compile_ok; then
14144 echo "(I can't execute the test program--guessing $uidsize.)" >&4
14147 echo "Your $zzz is $uidsize bytes long."
14152 echo "(I can't compile the test program--guessing $uidsize.)" >&4
14157 *_t) zzz="$uidtype" ;;
14160 echo "Checking the sign of $zzz..." >&4
14162 #include <sys/types.h>
14173 if eval $compile; then
14177 echo "(I can't execute the test program--guessing unsigned.)" >&4
14181 1) echo "Your $zzz is unsigned." ;;
14182 -1) echo "Your $zzz is signed." ;;
14188 echo "(I can't compile the test program--guessing unsigned.)" >&4
14194 $echo "Checking the format string to be used for uids..." >&4
14197 -1) if $test X"$uidsize" = X"$ivsize"; then
14198 uidformat="$ivdformat"
14200 if $test X"$uidsize" = X"$longsize"; then
14203 if $test X"$uidsize" = X"$intsize"; then
14206 if $test X"$uidsize" = X"$shortsize"; then
14213 *) if $test X"$uidsize" = X"$uvsize"; then
14214 uidformat="$uvuformat"
14216 if $test X"$uidsize" = X"$longsize"; then
14219 if $test X"$uidsize" = X"$intsize"; then
14222 if $test X"$uidsize" = X"$shortsize"; then
14231 : see if dbm.h is available
14232 : see if dbmclose exists
14233 set dbmclose d_dbmclose
14236 case "$d_dbmclose" in
14246 *) set rpcsvc/dbm.h i_rpcsvcdbm
14251 *) echo "We won't be including <dbm.h>"
14261 : see if this is a sys/file.h system
14266 : do we need to include sys/file.h ?
14270 if $h_sysfile; then
14272 echo "We'll be including <sys/file.h>." >&4
14275 echo "We won't be including <sys/file.h>." >&4
14285 : see if fcntl.h is there
14290 : see if we can include fcntl.h
14296 echo "We'll be including <fcntl.h>." >&4
14299 if $h_sysfile; then
14300 echo "We don't need to include <fcntl.h> if we include <sys/file.h>." >&4
14302 echo "We won't be including <fcntl.h>." >&4
14314 : see if this is a iconv.h system
14315 set iconv.h i_iconv
14318 : see if this is a ieeefp.h system
14319 set ieeefp.h i_ieeefp
14322 : see if this is a libutil.h system
14323 set libutil.h i_libutil
14326 : see if locale.h is available
14327 set locale.h i_locale
14330 : see if mach cthreads are available
14331 if test "X$usethreads" = "X$define"; then
14332 set mach/cthreads.h i_machcthr
14335 i_machcthr="$undef"
14340 : see if this is a math.h system
14344 : see if this is a mntent.h system
14345 set mntent.h i_mntent
14348 : see if ndbm.h is available
14353 : see if dbm_open exists
14354 set dbm_open d_dbm_open
14356 case "$d_dbm_open" in
14359 echo "We won't be including <ndbm.h>"
14368 : see if net/errno.h is available
14370 set net/errno.h val
14373 : Unfortunately, it causes problems on some systems. Arrgh.
14376 cat > try.c <<'EOM'
14379 #include <net/errno.h>
14385 if $cc $ccflags -c try.c >/dev/null 2>&1; then
14386 echo "We'll be including <net/errno.h>." >&4
14388 echo "We won't be including <net/errno.h>." >&4
14397 : see if netinet/tcp.h is available
14398 set netinet/tcp.h i_netinettcp
14401 : see if this is a poll.h system
14405 : see if this is a prot.h system
14410 $echo "Guessing which symbols your C compiler and preprocessor define..." >&4
14411 $cat <<'EOSH' > Cppsym.know
14412 a29k ABI64 aegis AES_SOURCE AIX AIX32 AIX370
14413 AIX41 AIX42 AIX43 AIX_SOURCE aixpc ALL_SOURCE
14414 alliant alpha am29000 AM29000 amiga AMIGAOS AMIX
14415 ansi ANSI_C_SOURCE apollo ardent atarist att386 att3b BeOS
14416 BIG_ENDIAN BIT_MSF bsd BSD bsd43 bsd4_2 bsd4_3 BSD4_3 bsd4_4
14417 BSD_4_3 BSD_4_4 BSD_NET2 BSD_TIME BSD_TYPES BSDCOMPAT bsdi
14418 bull c cadmus clipper CMU COFF COMPILER_VERSION
14419 concurrent convex cpu cray CRAY CRAYMPP ctix CX_UX
14420 CYGWIN DGUX DGUX_SOURCE DJGPP dmert DOLPHIN DPX2 DSO
14421 Dynix DynixPTX ELF encore EPI EXTENSIONS FILE_OFFSET_BITS
14422 FreeBSD GCC_NEW_VARARGS gcos gcx gimpel
14423 GNU_SOURCE GNUC GNUC_MINOR GO32 gould GOULD_PN
14424 H3050R H3050RX hbullx20 hcx host_mips
14425 hp200 hp300 hp700 HP700 hp800 hp9000
14426 hp9000s200 hp9000s300 hp9000s400 hp9000s500
14427 hp9000s700 hp9000s800 hp9k8 hp_osf hppa hpux HPUX_SOURCE
14428 i186 i286 i386 i486 i586 i686 i8086 i80960 i860 I960
14429 iAPX286 ibm ibm032 ibmesa IBMR2 ibmrt ILP32 ILP64
14430 INLINE_INTRINSICS INTRINSICS INT64 interdata is68k ksr1
14431 LANGUAGE_C LARGE_FILE_API LARGEFILE64_SOURCE
14432 LARGEFILE_SOURCE LFS64_LARGEFILE LFS_LARGEFILE
14433 Linux LITTLE_ENDIAN LONG64 LONG_DOUBLE LONG_LONG
14434 LONGDOUBLE LONGLONG LP64 luna luna88k Lynx
14435 M68000 m68k m88100 m88k M88KBCS_TARGET M_COFF
14436 M_I186 M_I286 M_I386 M_I8086 M_I86 M_I86SM M_SYS3
14437 M_SYS5 M_SYSIII M_SYSV M_UNIX M_XENIX MACH machine MachTen
14438 MATH_HAS_NO_SIDE_EFFECTS
14439 mc300 mc500 mc68000 mc68010 mc68020 mc68030 mc68040
14440 mc68060 mc68k mc68k32 mc700 mc88000 mc88100 merlin
14441 mert MiNT mips MIPS_FPSET MIPS_ISA MIPS_SIM MIPS_SZINT
14442 MIPS_SZLONG MIPS_SZPTR MIPSEB MIPSEL MODERN_C motorola
14443 mpeix MSDOS MTXINU MULTIMAX mvs MVS n16 ncl_el ncl_mr
14444 NetBSD news1500 news1700 news1800 news1900 news3700
14445 news700 news800 news900 NeXT NLS ns16000 ns32000
14446 ns32016 ns32332 ns32k nsc32000
14447 OCS88 OEMVS OpenBSD os OS2 OS390 osf OSF1 OSF_SOURCE
14448 pa_risc PA_RISC1_1 PA_RISC2_0 PARAGON parisc
14449 pc532 pdp11 PGC PIC plexus PORTAR posix
14450 POSIX1B_SOURCE POSIX2_SOURCE POSIX4_SOURCE
14451 POSIX_C_SOURCE POSIX_SOURCE POWER
14452 PROTOTYPES PWB pyr QNX R3000 REENTRANT RES Rhapsody RISC6000
14453 riscix riscos RT scs SCO sequent sgi SGI_SOURCE sinix
14454 SIZE_INT SIZE_LONG SIZE_PTR SOCKET_SOURCE SOCKETS_SOURCE
14455 sony sony_news sonyrisc sparc sparclite spectrum
14456 stardent stdc STDC_EXT stratos sun sun3 sun386
14457 Sun386i svr3 svr4 SVR4_2 SVR4_SOURCE svr5
14458 SX system SYSTYPE_BSD SYSTYPE_BSD43 SYSTYPE_BSD44
14459 SYSTYPE_SVR4 SYSTYPE_SVR5 SYSTYPE_SYSV SYSV SYSV3 SYSV4 SYSV5
14460 sysV68 sysV88 Tek4132 Tek4300 titan
14461 tower tower32 tower32_200 tower32_600 tower32_700
14462 tower32_800 tower32_850 tss
14463 u370 u3b u3b2 u3b20 u3b200 u3b20d u3b5
14464 ultrix UMAXV UnicomPBB UnicomPBD UNICOS UNICOSMK
14465 unix UNIX95 UNIX99 unixpc unos USGr4 USGr4_2
14466 Utek UTek UTS UWIN uxpm uxps vax venix VMESA vms xenix Xenix286
14467 XOPEN_SOURCE XOPEN_SOURCE_EXTENDED XPG2 XPG2_EXTENDED
14468 XPG3 XPG3_EXTENDED XPG4 XPG4_EXTENDED
14471 # Maybe put other stuff here too.
14472 cat <<EOSH >>Cppsym.know
14475 ./tr '[a-z]' '[A-Z]' < Cppsym.know > Cppsym.a
14476 ./tr '[A-Z]' '[a-z]' < Cppsym.know > Cppsym.b
14477 $cat Cppsym.know > Cppsym.c
14478 $cat Cppsym.a Cppsym.b Cppsym.c | $tr ' ' $trnl | sort | uniq > Cppsym.know
14479 $rm -f Cppsym.a Cppsym.b Cppsym.c
14480 cat <<EOSH > Cppsym
14482 if $test \$# -gt 0; then
14483 echo \$* | $tr " " "$trnl" | ./Cppsym.try > Cppsym.got
14484 if $test -s Cppsym.got; then
14491 $tr " " "$trnl" | ./Cppsym.try
14497 cat <<EOSH > Cppsym.try
14499 cat <<'EOCP' > try.c
14505 cat <<'EOSH' >> Cppsym.try
14507 printf "#ifdef %s\n#if %s+0\nprintf(\"%s=%%ld\\n\", %s);\n#else\nprintf(\"%s\\n\");\n#endif\n#endif\n", $1, $1, $1, $1, $1
14508 printf "#ifdef _%s\n#if _%s+0\nprintf(\"_%s=%%ld\\n\", _%s);\n#else\nprintf(\"_%s\\n\");\n#endif\n#endif\n", $1, $1, $1, $1, $1
14509 printf "#ifdef __%s\n#if __%s+0\nprintf(\"__%s=%%ld\\n\", __%s);\n#else\nprintf(\"__%s\\n\");\n#endif\n#endif\n", $1, $1, $1, $1, $1
14510 printf "#ifdef __%s__\n#if __%s__+0\nprintf(\"__%s__=%%ld\\n\", __%s__);\n#else\nprintf(\"__%s__\\n\");\n#endif\n#endif\n", $1, $1, $1, $1, $1
14514 cat <<EOSH >> Cppsym.try
14516 case "$osname-$gccversion" in
14517 irix-) ccflags="\$ccflags -woff 1178" ;;
14518 os2-*) ccflags="\$ccflags -Zlinker /PM:VIO" ;;
14520 $cc $optimize \$ccflags $ldflags -o try try.c $libs && ./try$exe_ext
14522 chmod +x Cppsym.try
14523 $eunicefix Cppsym.try
14524 ./Cppsym < Cppsym.know > Cppsym.true
14525 : now check the C compiler for additional symbols
14526 postprocess_cc_v=''
14528 aix) postprocess_cc_v="|$tr , ' '" ;;
14535 for i in \`$cc -v -c tmp.c 2>&1 $postprocess_cc_v\`
14538 -D*) echo "\$i" | $sed 's/^-D//';;
14539 -A*) $test "$gccversion" && echo "\$i" | $sed 's/^-A\(.*\)(\(.*\))/\1=\2/';;
14544 postprocess_cc_v=''
14547 ./ccsym > ccsym1.raw
14548 if $test -s ccsym1.raw; then
14549 $sort ccsym1.raw | $uniq >ccsym.raw
14551 mv ccsym1.raw ccsym.raw
14554 $awk '/\=/ { print $0; next }
14555 { print $0"=1" }' ccsym.raw >ccsym.list
14556 $awk '/\=/ { print $0; next }
14557 { print $0"=1" }' Cppsym.true >ccsym.true
14558 $comm -13 ccsym.true ccsym.list >ccsym.own
14559 $comm -12 ccsym.true ccsym.list >ccsym.com
14560 $comm -23 ccsym.true ccsym.list >ccsym.cpp
14562 if $test -z ccsym.raw; then
14563 echo "Your C compiler doesn't seem to define any symbols!" >&4
14565 echo "However, your C preprocessor defines the following symbols:"
14568 cppsymbols=`$cat Cppsym.true`
14569 cppsymbols=`echo $cppsymbols`
14570 cppccsymbols="$cppsymbols"
14572 if $test -s ccsym.com; then
14573 echo "Your C compiler and pre-processor define these symbols:"
14574 $sed -e 's/\(..*\)=.*/\1/' ccsym.com
14577 cppccsymbols=`$cat ccsym.com`
14578 cppccsymbols=`echo $cppccsymbols`
14579 $test "$silent" || sleep 1
14581 if $test -s ccsym.cpp; then
14582 $test "$also" && echo " "
14583 echo "Your C pre-processor ${also}defines the following symbols:"
14584 $sed -e 's/\(..*\)=.*/\1/' ccsym.cpp
14586 cppsymbols=`$cat ccsym.cpp`
14587 cppsymbols=`echo $cppsymbols`
14588 $test "$silent" || sleep 1
14590 if $test -s ccsym.own; then
14591 $test "$also" && echo " "
14592 echo "Your C compiler ${also}defines the following cpp symbols:"
14593 $sed -e 's/\(..*\)=1/\1/' ccsym.own
14594 $sed -e 's/\(..*\)=.*/\1/' ccsym.own | $uniq >>Cppsym.true
14595 ccsymbols=`$cat ccsym.own`
14596 ccsymbols=`echo $ccsymbols`
14597 $test "$silent" || sleep 1
14600 $rm -f ccsym* Cppsym.*
14602 : see if this is a termio system
14606 if $test `./findhdr termios.h`; then
14607 set tcsetattr i_termios
14613 "$define") echo "You have POSIX termios.h... good!" >&4;;
14614 *) if ./Cppsym pyr; then
14615 case "`/bin/universe`" in
14616 ucb) if $test `./findhdr sgtty.h`; then
14618 echo "<sgtty.h> found." >&4
14620 echo "System is pyramid with BSD universe."
14621 echo "<sgtty.h> not found--you could have problems." >&4
14623 *) if $test `./findhdr termio.h`; then
14625 echo "<termio.h> found." >&4
14627 echo "System is pyramid with USG universe."
14628 echo "<termio.h> not found--you could have problems." >&4
14632 if $test `./findhdr termio.h`; then
14633 echo "<termio.h> found." >&4
14635 elif $test `./findhdr sgtty.h`; then
14636 echo "<sgtty.h> found." >&4
14639 echo "Neither <termio.h> nor <sgtty.h> found--you could have problems." >&4
14642 if $test `./findhdr sgtty.h`; then
14643 echo "<sgtty.h> found." >&4
14645 elif $test `./findhdr termio.h`; then
14646 echo "<termio.h> found." >&4
14649 echo "Neither <sgtty.h> nor <termio.h> found--you could have problems." >&4
14653 set i_termio; eval $setvar
14654 val=$val2; set i_sgtty; eval $setvar
14655 val=$val3; set i_termios; eval $setvar
14657 : see if this is a shadow.h system
14658 set shadow.h i_shadow
14661 : see if this is a socks.h system
14662 set socks.h i_socks
14665 : see if stdarg is available
14667 if $test `./findhdr stdarg.h`; then
14668 echo "<stdarg.h> found." >&4
14671 echo "<stdarg.h> NOT found." >&4
14675 : see if varags is available
14677 if $test `./findhdr varargs.h`; then
14678 echo "<varargs.h> found." >&4
14680 echo "<varargs.h> NOT found, but that's ok (I hope)." >&4
14683 : set up the varargs testing programs
14684 $cat > varargs.c <<EOP
14686 #include <stdarg.h>
14689 #include <varargs.h>
14693 int f(char *p, ...)
14707 p = va_arg(ap, char *);
14712 $cat > varargs <<EOP
14714 if $cc -c $ccflags -D\$1 varargs.c >/dev/null 2>&1; then
14723 : now check which varargs header should be included
14728 if `./varargs I_STDARG`; then
14730 elif `./varargs I_VARARGS`; then
14735 if `./varargs I_VARARGS`; then
14742 echo "I could not find the definition for va_dcl... You have problems..." >&4
14743 val="$undef"; set i_stdarg; eval $setvar
14744 val="$undef"; set i_varargs; eval $setvar
14749 case "$i_varhdr" in
14751 val="$define"; set i_stdarg; eval $setvar
14752 val="$undef"; set i_varargs; eval $setvar
14755 val="$undef"; set i_stdarg; eval $setvar
14756 val="$define"; set i_varargs; eval $setvar
14759 echo "We'll include <$i_varhdr> to get va_dcl definition." >&4;;
14763 : see if stddef is available
14764 set stddef.h i_stddef
14767 : see if this is a sunmath.h system
14768 set sunmath.h i_sunmath
14771 : see if sys/access.h is available
14772 set sys/access.h i_sysaccess
14775 : see if ioctl defs are in sgtty, termio, sys/filio or sys/ioctl
14776 set sys/filio.h i_sysfilio
14779 if $test `./findhdr sys/ioctl.h`; then
14781 echo '<sys/ioctl.h> found.' >&4
14784 if $test $i_sysfilio = "$define"; then
14785 echo '<sys/ioctl.h> NOT found.' >&4
14787 $test $i_sgtty = "$define" && xxx="sgtty.h"
14788 $test $i_termio = "$define" && xxx="termio.h"
14789 $test $i_termios = "$define" && xxx="termios.h"
14790 echo "No <sys/ioctl.h> found, assuming ioctl args are defined in <$xxx>." >&4
14797 : see if this is a syslog.h system
14798 set syslog.h i_syslog
14802 : see if this is a sys/mode.h system
14803 set sys/mode.h i_sysmode
14806 : see if sys/resource.h has to be included
14807 set sys/resource.h i_sysresrc
14810 : see if sys/security.h is available
14811 set sys/security.h i_syssecrt
14814 : see if this is a sys/statvfs.h system
14815 set sys/statvfs.h i_sysstatvfs
14818 : see if this is a sys/uio.h system
14819 set sys/uio.h i_sysuio
14822 : see if this is a sys/un.h system
14823 set sys/un.h i_sysun
14827 : see if this is a sys/utsname.h system
14828 set sys/utsname.h i_sysutsname
14831 : see if this is a syswait system
14832 set sys/wait.h i_syswait
14835 : see if this is a ustat.h system
14836 set ustat.h i_ustat
14839 : see if this is an utime system
14840 set utime.h i_utime
14843 : see if this is a values.h system
14844 set values.h i_values
14847 : see if this is a vfork system
14850 set vfork.h i_vfork
14858 : see if gdbm.h is available
14863 : see if gdbm_open exists
14864 set gdbm_open d_gdbm_open
14866 case "$d_gdbm_open" in
14869 echo "We won't be including <gdbm.h>"
14879 echo "Looking for extensions..." >&4
14880 : If we are using the old config.sh, known_extensions may contain
14881 : old or inaccurate or duplicate values.
14882 known_extensions=''
14883 nonxs_extensions=''
14884 : We do not use find because it might not be available.
14885 : We do not just use MANIFEST because the user may have dropped
14886 : some additional extensions into the source tree and expect them
14889 : Function to recursively find available extensions, ignoring DynaLoader
14890 : NOTE: recursion limit of 10 to prevent runaway in case of symlink madness
14894 DynaLoader|dynaload) ;;
14896 if $test -f $xxx/$xxx.xs; then
14897 known_extensions="$known_extensions $1$xxx";
14898 elif $test -f $xxx/Makefile.PL; then
14899 nonxs_extensions="$nonxs_extensions $1$xxx";
14901 if $test -d $xxx -a $# -lt 10; then
14904 eval $find_extensions;
14916 eval $find_extensions
14917 set X $nonxs_extensions
14919 nonxs_extensions="$*"
14920 set X $known_extensions
14922 known_extensions="$*"
14925 : Now see which are supported on this system.
14927 for xxx in $known_extensions ; do
14931 $define) avail_ext="$avail_ext $xxx" ;;
14934 GDBM_File|gdbm_fil)
14936 $define) avail_ext="$avail_ext $xxx" ;;
14939 NDBM_File|ndbm_fil)
14942 case "$osname-$use64bitint" in
14945 *-lndbm*) avail_ext="$avail_ext $xxx" ;;
14948 *) avail_ext="$avail_ext $xxx" ;;
14953 ODBM_File|odbm_fil)
14954 case "${i_dbm}${i_rpcsvcdbm}" in
14956 case "$osname-$use64bitint" in
14959 *-ldbm*) avail_ext="$avail_ext $xxx" ;;
14962 *) avail_ext="$avail_ext $xxx" ;;
14968 case "$useposix" in
14969 true|define|y) avail_ext="$avail_ext $xxx" ;;
14973 case "$useopcode" in
14974 true|define|y) avail_ext="$avail_ext $xxx" ;;
14978 case "$d_socket" in
14979 true|$define|y) avail_ext="$avail_ext $xxx" ;;
14982 Sys/Syslog|sys/syslog)
14983 : XXX syslog requires socket
14984 case "$d_socket" in
14985 true|$define|y) avail_ext="$avail_ext $xxx" ;;
14989 case "$usethreads" in
14990 true|$define|y) avail_ext="$avail_ext $xxx" ;;
14994 : XXX Do we need a useipcsysv variable here
14995 case "${d_msg}${d_sem}${d_shm}" in
14996 *"${define}"*) avail_ext="$avail_ext $xxx" ;;
14999 *) avail_ext="$avail_ext $xxx"
15008 : Now see which nonxs extensions are supported on this system.
15009 : For now assume all are.
15011 for xxx in $nonxs_extensions ; do
15013 *) nonxs_ext="$nonxs_ext $xxx"
15025 A number of extensions are supplied with $package. You may choose to
15026 compile these extensions for dynamic loading (the default), compile
15027 them into the $package executable (static loading), or not include
15028 them at all. Answer "none" to include no extensions.
15029 Note that DynaLoader is always built and need not be mentioned here.
15032 case "$dynamic_ext" in
15033 '') dflt="$avail_ext" ;;
15034 *) dflt="$dynamic_ext"
15035 # Perhaps we are reusing an old out-of-date config.sh.
15038 if test X"$dynamic_ext" != X"$avail_ext"; then
15040 NOTICE: Your previous config.sh list may be incorrect.
15041 The extensions now available to you are
15043 but the default list from your previous config.sh is
15055 rp="What extensions do you wish to load dynamically?"
15058 none) dynamic_ext=' ' ;;
15059 *) dynamic_ext="$ans" ;;
15062 case "$static_ext" in
15064 : Exclude those already listed in dynamic linking
15066 for xxx in $avail_ext; do
15067 case " $dynamic_ext " in
15069 *) dflt="$dflt $xxx" ;;
15076 *) dflt="$static_ext"
15083 rp="What extensions do you wish to load statically?"
15086 none) static_ext=' ' ;;
15087 *) static_ext="$ans" ;;
15092 A number of extensions are supplied with $package. Answer "none"
15093 to include no extensions.
15094 Note that DynaLoader is always built and need not be mentioned here.
15097 case "$static_ext" in
15098 '') dflt="$avail_ext" ;;
15099 *) dflt="$static_ext"
15100 # Perhaps we are reusing an old out-of-date config.sh.
15103 if test X"$static_ext" != X"$avail_ext"; then
15105 NOTICE: Your previous config.sh list may be incorrect.
15106 The extensions now available to you are
15108 but the default list from your previous config.sh is
15117 : Exclude those that are not xs extensions
15121 rp="What extensions do you wish to include?"
15124 none) static_ext=' ' ;;
15125 *) static_ext="$ans" ;;
15130 set X $dynamic_ext $static_ext $nonxs_ext
15134 : Remove build directory name from cppstdin so it can be used from
15135 : either the present location or the final installed location.
15137 : Get out of the UU directory to get correct path name.
15139 case "$cppstdin" in
15141 echo "Stripping down cppstdin path name"
15147 : end of configuration questions
15149 echo "End of configuration questions."
15152 : back to where it started
15153 if test -d ../UU; then
15157 : configuration may be patched via a 'config.over' file
15158 if $test -f config.over; then
15161 rp='I see a config.over file. Do you wish to load it?'
15164 n*) echo "OK, I'll ignore it.";;
15166 echo "Configuration override changes have been loaded."
15171 : in case they want portability, strip down executable paths
15172 case "$d_portable" in
15175 echo "Stripping down executable paths..." >&4
15176 for file in $loclist $trylist; do
15178 eval $file=`basename $temp`
15183 : create config.sh file
15185 echo "Creating config.sh..." >&4
15186 $spitshell <<EOT >config.sh
15189 # This file was produced by running the Configure script. It holds all the
15190 # definitions figured out by Configure. Should you modify one of these values,
15191 # do not forget to propagate your changes by running "Configure -der". You may
15192 # instead choose to run each of the .SH files by yourself, or "Configure -S".
15195 # Package name : $package
15196 # Source directory : $src
15197 # Configuration time: $cf_time
15198 # Configured by : $cf_by
15199 # Target system : $myuname
15209 Revision='$Revision'
15216 alignbytes='$alignbytes'
15217 ansi2knr='$ansi2knr'
15218 aphostname='$aphostname'
15219 api_revision='$api_revision'
15220 api_subversion='$api_subversion'
15221 api_version='$api_version'
15222 api_versionstring='$api_versionstring'
15225 archlibexp='$archlibexp'
15226 archname64='$archname64'
15227 archname='$archname'
15228 archobjs='$archobjs'
15233 bincompat5005='$bincompat5005'
15237 byteorder='$byteorder'
15239 castflags='$castflags'
15242 cccdlflags='$cccdlflags'
15243 ccdlflags='$ccdlflags'
15245 ccflags_uselargefiles='$ccflags_uselargefiles'
15247 ccsymbols='$ccsymbols'
15248 ccversion='$ccversion'
15250 cf_email='$cf_email'
15252 charsize='$charsize'
15256 clocktype='$clocktype'
15258 compress='$compress'
15259 contains='$contains'
15263 cpp_stuff='$cpp_stuff'
15264 cppccsymbols='$cppccsymbols'
15265 cppflags='$cppflags'
15267 cppminus='$cppminus'
15269 cppstdin='$cppstdin'
15270 cppsymbols='$cppsymbols'
15271 crosscompile='$crosscompile'
15272 cryptlib='$cryptlib'
15274 d_Gconvert='$d_Gconvert'
15275 d_PRIEUldbl='$d_PRIEUldbl'
15276 d_PRIFUldbl='$d_PRIFUldbl'
15277 d_PRIGUldbl='$d_PRIGUldbl'
15278 d_PRIXU64='$d_PRIXU64'
15279 d_PRId64='$d_PRId64'
15280 d_PRIeldbl='$d_PRIeldbl'
15281 d_PRIfldbl='$d_PRIfldbl'
15282 d_PRIgldbl='$d_PRIgldbl'
15283 d_PRIi64='$d_PRIi64'
15284 d_PRIo64='$d_PRIo64'
15285 d_PRIu64='$d_PRIu64'
15286 d_PRIx64='$d_PRIx64'
15287 d_SCNfldbl='$d_SCNfldbl'
15288 d_access='$d_access'
15289 d_accessx='$d_accessx'
15291 d_archlib='$d_archlib'
15294 d_attribut='$d_attribut'
15297 d_bincompat5005='$d_bincompat5005'
15299 d_bsdgetpgrp='$d_bsdgetpgrp'
15300 d_bsdsetpgrp='$d_bsdsetpgrp'
15302 d_casti32='$d_casti32'
15303 d_castneg='$d_castneg'
15304 d_charvspr='$d_charvspr'
15306 d_chroot='$d_chroot'
15307 d_chsize='$d_chsize'
15308 d_closedir='$d_closedir'
15312 d_cuserid='$d_cuserid'
15313 d_dbl_dig='$d_dbl_dig'
15314 d_difftime='$d_difftime'
15315 d_dirnamlen='$d_dirnamlen'
15316 d_dlerror='$d_dlerror'
15317 d_dlopen='$d_dlopen'
15318 d_dlsymun='$d_dlsymun'
15319 d_dosuid='$d_dosuid'
15320 d_drand48proto='$d_drand48proto'
15322 d_eaccess='$d_eaccess'
15323 d_endgrent='$d_endgrent'
15324 d_endhent='$d_endhent'
15325 d_endnent='$d_endnent'
15326 d_endpent='$d_endpent'
15327 d_endpwent='$d_endpwent'
15328 d_endsent='$d_endsent'
15329 d_eofnblk='$d_eofnblk'
15330 d_eunice='$d_eunice'
15331 d_fchmod='$d_fchmod'
15332 d_fchown='$d_fchown'
15334 d_fd_macros='$d_fd_macros'
15335 d_fd_set='$d_fd_set'
15336 d_fds_bits='$d_fds_bits'
15337 d_fgetpos='$d_fgetpos'
15338 d_flexfnam='$d_flexfnam'
15341 d_fpathconf='$d_fpathconf'
15342 d_fpos64_t='$d_fpos64_t'
15343 d_frexpl='$d_frexpl'
15344 d_fs_data_s='$d_fs_data_s'
15345 d_fseeko='$d_fseeko'
15346 d_fsetpos='$d_fsetpos'
15347 d_fstatfs='$d_fstatfs'
15348 d_fstatvfs='$d_fstatvfs'
15349 d_ftello='$d_ftello'
15351 d_getcwd='$d_getcwd'
15352 d_getespwnam='$d_getespwnam'
15353 d_getfsstat='$d_getfsstat'
15354 d_getgrent='$d_getgrent'
15355 d_getgrps='$d_getgrps'
15356 d_gethbyaddr='$d_gethbyaddr'
15357 d_gethbyname='$d_gethbyname'
15358 d_gethent='$d_gethent'
15359 d_gethname='$d_gethname'
15360 d_gethostprotos='$d_gethostprotos'
15361 d_getlogin='$d_getlogin'
15362 d_getmnt='$d_getmnt'
15363 d_getmntent='$d_getmntent'
15364 d_getnbyaddr='$d_getnbyaddr'
15365 d_getnbyname='$d_getnbyname'
15366 d_getnent='$d_getnent'
15367 d_getnetprotos='$d_getnetprotos'
15368 d_getpbyname='$d_getpbyname'
15369 d_getpbynumber='$d_getpbynumber'
15370 d_getpent='$d_getpent'
15371 d_getpgid='$d_getpgid'
15372 d_getpgrp2='$d_getpgrp2'
15373 d_getpgrp='$d_getpgrp'
15374 d_getppid='$d_getppid'
15375 d_getprior='$d_getprior'
15376 d_getprotoprotos='$d_getprotoprotos'
15377 d_getprpwnam='$d_getprpwnam'
15378 d_getpwent='$d_getpwent'
15379 d_getsbyname='$d_getsbyname'
15380 d_getsbyport='$d_getsbyport'
15381 d_getsent='$d_getsent'
15382 d_getservprotos='$d_getservprotos'
15383 d_getspnam='$d_getspnam'
15384 d_gettimeod='$d_gettimeod'
15385 d_gnulibc='$d_gnulibc'
15386 d_grpasswd='$d_grpasswd'
15387 d_hasmntopt='$d_hasmntopt'
15391 d_inetaton='$d_inetaton'
15392 d_int64_t='$d_int64_t'
15393 d_isascii='$d_isascii'
15395 d_isnanl='$d_isnanl'
15396 d_killpg='$d_killpg'
15397 d_lchown='$d_lchown'
15398 d_ldbl_dig='$d_ldbl_dig'
15400 d_locconv='$d_locconv'
15402 d_longdbl='$d_longdbl'
15403 d_longlong='$d_longlong'
15404 d_lseekproto='$d_lseekproto'
15406 d_madvise='$d_madvise'
15408 d_mbstowcs='$d_mbstowcs'
15409 d_mbtowc='$d_mbtowc'
15410 d_memchr='$d_memchr'
15411 d_memcmp='$d_memcmp'
15412 d_memcpy='$d_memcpy'
15413 d_memmove='$d_memmove'
15414 d_memset='$d_memset'
15416 d_mkdtemp='$d_mkdtemp'
15417 d_mkfifo='$d_mkfifo'
15418 d_mkstemp='$d_mkstemp'
15419 d_mkstemps='$d_mkstemps'
15420 d_mktime='$d_mktime'
15423 d_mprotect='$d_mprotect'
15425 d_msg_ctrunc='$d_msg_ctrunc'
15426 d_msg_dontroute='$d_msg_dontroute'
15427 d_msg_oob='$d_msg_oob'
15428 d_msg_peek='$d_msg_peek'
15429 d_msg_proxy='$d_msg_proxy'
15430 d_msgctl='$d_msgctl'
15431 d_msgget='$d_msgget'
15432 d_msgrcv='$d_msgrcv'
15433 d_msgsnd='$d_msgsnd'
15435 d_munmap='$d_munmap'
15436 d_mymalloc='$d_mymalloc'
15438 d_nv_preserves_uv='$d_nv_preserves_uv'
15439 d_nv_preserves_uv_bits='$d_nv_preserves_uv_bits'
15440 d_off64_t='$d_off64_t'
15441 d_old_pthread_create_joinable='$d_old_pthread_create_joinable'
15442 d_oldpthreads='$d_oldpthreads'
15443 d_oldsock='$d_oldsock'
15445 d_pathconf='$d_pathconf'
15447 d_perl_otherlibdirs='$d_perl_otherlibdirs'
15448 d_phostname='$d_phostname'
15451 d_portable='$d_portable'
15452 d_pthread_yield='$d_pthread_yield'
15454 d_pwchange='$d_pwchange'
15455 d_pwclass='$d_pwclass'
15456 d_pwcomment='$d_pwcomment'
15457 d_pwexpire='$d_pwexpire'
15458 d_pwgecos='$d_pwgecos'
15459 d_pwpasswd='$d_pwpasswd'
15460 d_pwquota='$d_pwquota'
15463 d_readdir='$d_readdir'
15464 d_readlink='$d_readlink'
15465 d_rename='$d_rename'
15466 d_rewinddir='$d_rewinddir'
15468 d_safebcpy='$d_safebcpy'
15469 d_safemcpy='$d_safemcpy'
15470 d_sanemcmp='$d_sanemcmp'
15471 d_sched_yield='$d_sched_yield'
15472 d_scm_rights='$d_scm_rights'
15473 d_seekdir='$d_seekdir'
15474 d_select='$d_select'
15476 d_semctl='$d_semctl'
15477 d_semctl_semid_ds='$d_semctl_semid_ds'
15478 d_semctl_semun='$d_semctl_semun'
15479 d_semget='$d_semget'
15481 d_setegid='$d_setegid'
15482 d_seteuid='$d_seteuid'
15483 d_setgrent='$d_setgrent'
15484 d_setgrps='$d_setgrps'
15485 d_sethent='$d_sethent'
15486 d_setlinebuf='$d_setlinebuf'
15487 d_setlocale='$d_setlocale'
15488 d_setnent='$d_setnent'
15489 d_setpent='$d_setpent'
15490 d_setpgid='$d_setpgid'
15491 d_setpgrp2='$d_setpgrp2'
15492 d_setpgrp='$d_setpgrp'
15493 d_setprior='$d_setprior'
15494 d_setproctitle='$d_setproctitle'
15495 d_setpwent='$d_setpwent'
15496 d_setregid='$d_setregid'
15497 d_setresgid='$d_setresgid'
15498 d_setresuid='$d_setresuid'
15499 d_setreuid='$d_setreuid'
15500 d_setrgid='$d_setrgid'
15501 d_setruid='$d_setruid'
15502 d_setsent='$d_setsent'
15503 d_setsid='$d_setsid'
15504 d_setvbuf='$d_setvbuf'
15508 d_shmatprototype='$d_shmatprototype'
15509 d_shmctl='$d_shmctl'
15511 d_shmget='$d_shmget'
15512 d_sigaction='$d_sigaction'
15513 d_sigsetjmp='$d_sigsetjmp'
15514 d_socket='$d_socket'
15515 d_socklen_t='$d_socklen_t'
15516 d_sockpair='$d_sockpair'
15517 d_socks5_init='$d_socks5_init'
15519 d_statblks='$d_statblks'
15520 d_statfs_f_flags='$d_statfs_f_flags'
15521 d_statfs_s='$d_statfs_s'
15522 d_statvfs='$d_statvfs'
15523 d_stdio_cnt_lval='$d_stdio_cnt_lval'
15524 d_stdio_ptr_lval='$d_stdio_ptr_lval'
15525 d_stdio_stream_array='$d_stdio_stream_array'
15526 d_stdiobase='$d_stdiobase'
15527 d_stdstdio='$d_stdstdio'
15528 d_strchr='$d_strchr'
15529 d_strcoll='$d_strcoll'
15530 d_strctcpy='$d_strctcpy'
15531 d_strerrm='$d_strerrm'
15532 d_strerror='$d_strerror'
15533 d_strtod='$d_strtod'
15534 d_strtol='$d_strtol'
15535 d_strtold='$d_strtold'
15536 d_strtoll='$d_strtoll'
15537 d_strtoul='$d_strtoul'
15538 d_strtoull='$d_strtoull'
15539 d_strtouq='$d_strtouq'
15540 d_strxfrm='$d_strxfrm'
15541 d_suidsafe='$d_suidsafe'
15542 d_symlink='$d_symlink'
15543 d_syscall='$d_syscall'
15544 d_sysconf='$d_sysconf'
15545 d_sysernlst='$d_sysernlst'
15546 d_syserrlst='$d_syserrlst'
15547 d_system='$d_system'
15548 d_tcgetpgrp='$d_tcgetpgrp'
15549 d_tcsetpgrp='$d_tcsetpgrp'
15550 d_telldir='$d_telldir'
15551 d_telldirproto='$d_telldirproto'
15554 d_truncate='$d_truncate'
15555 d_tzname='$d_tzname'
15558 d_union_semun='$d_union_semun'
15560 d_vendorarch='$d_vendorarch'
15561 d_vendorbin='$d_vendorbin'
15562 d_vendorlib='$d_vendorlib'
15564 d_void_closedir='$d_void_closedir'
15565 d_voidsig='$d_voidsig'
15566 d_voidtty='$d_voidtty'
15567 d_volatile='$d_volatile'
15568 d_vprintf='$d_vprintf'
15570 d_waitpid='$d_waitpid'
15571 d_wcstombs='$d_wcstombs'
15572 d_wctomb='$d_wctomb'
15575 db_hashtype='$db_hashtype'
15576 db_prefixtype='$db_prefixtype'
15577 defvoidused='$defvoidused'
15578 direntrytype='$direntrytype'
15581 doublesize='$doublesize'
15583 dynamic_ext='$dynamic_ext'
15589 eunicefix='$eunicefix'
15592 extensions='$extensions'
15593 fflushNULL='$fflushNULL'
15594 fflushall='$fflushall'
15596 firstmakefile='$firstmakefile'
15598 fpossize='$fpossize'
15599 fpostype='$fpostype'
15600 freetype='$freetype'
15602 full_csh='$full_csh'
15603 full_sed='$full_sed'
15604 gccosandvers='$gccosandvers'
15605 gccversion='$gccversion'
15606 gidformat='$gidformat'
15612 groupcat='$groupcat'
15613 groupstype='$groupstype'
15616 h_sysfile='$h_sysfile'
15627 i_arpainet='$i_arpainet'
15628 i_bsdioctl='$i_bsdioctl'
15631 i_dirent='$i_dirent'
15639 i_ieeefp='$i_ieeefp'
15640 i_inttypes='$i_inttypes'
15641 i_libutil='$i_libutil'
15642 i_limits='$i_limits'
15643 i_locale='$i_locale'
15644 i_machcthr='$i_machcthr'
15645 i_malloc='$i_malloc'
15647 i_memory='$i_memory'
15648 i_mntent='$i_mntent'
15651 i_neterrno='$i_neterrno'
15652 i_netinettcp='$i_netinettcp'
15656 i_pthread='$i_pthread'
15658 i_rpcsvcdbm='$i_rpcsvcdbm'
15661 i_shadow='$i_shadow'
15663 i_stdarg='$i_stdarg'
15664 i_stddef='$i_stddef'
15665 i_stdlib='$i_stdlib'
15666 i_string='$i_string'
15667 i_sunmath='$i_sunmath'
15668 i_sysaccess='$i_sysaccess'
15669 i_sysdir='$i_sysdir'
15670 i_sysfile='$i_sysfile'
15671 i_sysfilio='$i_sysfilio'
15673 i_sysioctl='$i_sysioctl'
15674 i_syslog='$i_syslog'
15675 i_sysmman='$i_sysmman'
15676 i_sysmode='$i_sysmode'
15677 i_sysmount='$i_sysmount'
15678 i_sysndir='$i_sysndir'
15679 i_sysparam='$i_sysparam'
15680 i_sysresrc='$i_sysresrc'
15681 i_syssecrt='$i_syssecrt'
15682 i_sysselct='$i_sysselct'
15683 i_syssockio='$i_syssockio'
15684 i_sysstat='$i_sysstat'
15685 i_sysstatfs='$i_sysstatfs'
15686 i_sysstatvfs='$i_sysstatvfs'
15687 i_systime='$i_systime'
15688 i_systimek='$i_systimek'
15689 i_systimes='$i_systimes'
15690 i_systypes='$i_systypes'
15691 i_sysuio='$i_sysuio'
15693 i_sysutsname='$i_sysutsname'
15694 i_sysvfs='$i_sysvfs'
15695 i_syswait='$i_syswait'
15696 i_termio='$i_termio'
15697 i_termios='$i_termios'
15699 i_unistd='$i_unistd'
15702 i_values='$i_values'
15703 i_varargs='$i_varargs'
15704 i_varhdr='$i_varhdr'
15706 ignore_versioned_solibs='$ignore_versioned_solibs'
15707 inc_version_list='$inc_version_list'
15708 inc_version_list_init='$inc_version_list_init'
15711 installarchlib='$installarchlib'
15712 installbin='$installbin'
15713 installman1dir='$installman1dir'
15714 installman3dir='$installman3dir'
15715 installprefix='$installprefix'
15716 installprefixexp='$installprefixexp'
15717 installprivlib='$installprivlib'
15718 installscript='$installscript'
15719 installsitearch='$installsitearch'
15720 installsitebin='$installsitebin'
15721 installsitelib='$installsitelib'
15722 installstyle='$installstyle'
15723 installusrbinperl='$installusrbinperl'
15724 installvendorarch='$installvendorarch'
15725 installvendorbin='$installvendorbin'
15726 installvendorlib='$installvendorlib'
15728 ivdformat='$ivdformat'
15731 known_extensions='$known_extensions'
15734 lddlflags='$lddlflags'
15736 ldflags_uselargefiles='$ldflags_uselargefiles'
15737 ldlibpthname='$ldlibpthname'
15744 libsdirs='$libsdirs'
15745 libsfiles='$libsfiles'
15746 libsfound='$libsfound'
15747 libspath='$libspath'
15748 libswanted='$libswanted'
15749 libswanted_uselargefiles='$libswanted_uselargefiles'
15755 locincpth='$locincpth'
15756 loclibpth='$loclibpth'
15757 longdblsize='$longdblsize'
15758 longlongsize='$longlongsize'
15759 longsize='$longsize'
15763 lseeksize='$lseeksize'
15764 lseektype='$lseektype'
15768 make_set_make='$make_set_make'
15769 mallocobj='$mallocobj'
15770 mallocsrc='$mallocsrc'
15771 malloctype='$malloctype'
15773 man1direxp='$man1direxp'
15776 man3direxp='$man3direxp'
15778 mips_type='$mips_type'
15780 mmaptype='$mmaptype'
15781 modetype='$modetype'
15783 multiarch='$multiarch'
15785 myarchname='$myarchname'
15786 mydomain='$mydomain'
15787 myhostname='$myhostname'
15790 netdb_hlen_type='$netdb_hlen_type'
15791 netdb_host_type='$netdb_host_type'
15792 netdb_name_type='$netdb_name_type'
15793 netdb_net_type='$netdb_net_type'
15796 nm_so_opt='$nm_so_opt'
15797 nonxs_ext='$nonxs_ext'
15799 nvEUformat='$nvEUformat'
15800 nvFUformat='$nvFUformat'
15801 nvGUformat='$nvGUformat'
15802 nveformat='$nveformat'
15803 nvfformat='$nvfformat'
15804 nvgformat='$nvgformat'
15807 o_nonblock='$o_nonblock'
15809 old_pthread_create_joinable='$old_pthread_create_joinable'
15810 optimize='$optimize'
15811 orderlib='$orderlib'
15814 otherlibdirs='$otherlibdirs'
15818 patchlevel='$patchlevel'
15819 path_sep='$path_sep'
15822 perladmin='$perladmin'
15823 perlpath='$perlpath'
15825 phostname='$phostname'
15828 pm_apiversion='$pm_apiversion'
15832 prefixexp='$prefixexp'
15834 privlibexp='$privlibexp'
15835 prototype='$prototype'
15837 quadkind='$quadkind'
15838 quadtype='$quadtype'
15839 randbits='$randbits'
15840 randfunc='$randfunc'
15841 randseedtype='$randseedtype'
15843 rd_nodata='$rd_nodata'
15844 revision='$revision'
15848 sPRIEUldbl='$sPRIEUldbl'
15849 sPRIFUldbl='$sPRIFUldbl'
15850 sPRIGUldbl='$sPRIGUldbl'
15851 sPRIXU64='$sPRIXU64'
15853 sPRIeldbl='$sPRIeldbl'
15854 sPRIfldbl='$sPRIfldbl'
15855 sPRIgldbl='$sPRIgldbl'
15860 sSCNfldbl='$sSCNfldbl'
15861 sched_yield='$sched_yield'
15862 scriptdir='$scriptdir'
15863 scriptdirexp='$scriptdirexp'
15865 seedfunc='$seedfunc'
15866 selectminbits='$selectminbits'
15867 selecttype='$selecttype'
15868 sendmail='$sendmail'
15871 sharpbang='$sharpbang'
15872 shmattype='$shmattype'
15873 shortsize='$shortsize'
15876 sig_count='$sig_count'
15877 sig_name='$sig_name'
15878 sig_name_init='$sig_name_init'
15880 sig_num_init='$sig_num_init'
15881 signal_t='$signal_t'
15882 sitearch='$sitearch'
15883 sitearchexp='$sitearchexp'
15885 sitebinexp='$sitebinexp'
15887 sitelib_stem='$sitelib_stem'
15888 sitelibexp='$sitelibexp'
15889 siteprefix='$siteprefix'
15890 siteprefixexp='$siteprefixexp'
15891 sizesize='$sizesize'
15892 sizetype='$sizetype'
15896 sockethdr='$sockethdr'
15897 socketlib='$socketlib'
15898 socksizetype='$socksizetype'
15900 spackage='$spackage'
15901 spitshell='$spitshell'
15903 ssizetype='$ssizetype'
15904 startperl='$startperl'
15906 static_ext='$static_ext'
15908 stdio_base='$stdio_base'
15909 stdio_bufsiz='$stdio_bufsiz'
15910 stdio_cnt='$stdio_cnt'
15911 stdio_filbuf='$stdio_filbuf'
15912 stdio_ptr='$stdio_ptr'
15913 stdio_stream_array='$stdio_stream_array'
15916 subversion='$subversion'
15923 timeincl='$timeincl'
15924 timetype='$timetype'
15937 uidformat='$uidformat'
15943 uquadtype='$uquadtype'
15944 use5005threads='$use5005threads'
15945 use64bitall='$use64bitall'
15946 use64bitint='$use64bitint'
15948 useithreads='$useithreads'
15949 uselargefiles='$uselargefiles'
15950 uselongdouble='$uselongdouble'
15951 usemorebits='$usemorebits'
15952 usemultiplicity='$usemultiplicity'
15953 usemymalloc='$usemymalloc'
15955 useopcode='$useopcode'
15956 useperlio='$useperlio'
15957 useposix='$useposix'
15959 useshrplib='$useshrplib'
15960 usesocks='$usesocks'
15961 usethreads='$usethreads'
15962 usevendorprefix='$usevendorprefix'
15963 usevfork='$usevfork'
15966 uvXUformat='$uvXUformat'
15967 uvoformat='$uvoformat'
15970 uvuformat='$uvuformat'
15971 uvxformat='$uvxformat'
15972 vendorarch='$vendorarch'
15973 vendorarchexp='$vendorarchexp'
15974 vendorbin='$vendorbin'
15975 vendorbinexp='$vendorbinexp'
15976 vendorlib='$vendorlib'
15977 vendorlib_stem='$vendorlib_stem'
15978 vendorlibexp='$vendorlibexp'
15979 vendorprefix='$vendorprefix'
15980 vendorprefixexp='$vendorprefixexp'
15983 voidflags='$voidflags'
15985 xs_apiversion='$xs_apiversion'
15990 : Add in command line options if available
15991 $test -f UU/cmdline.opt && $cat UU/cmdline.opt >> config.sh
15993 : add special variables
15994 $test -f $src/patchlevel.h && \
15995 awk '/^#define[ ]+PERL_/ {printf "%s=%s\n",$2,$3}' $src/patchlevel.h >>config.sh
15996 echo "CONFIGDOTSH=true" >>config.sh
15998 : propagate old symbols
15999 if $test -f UU/config.sh; then
16000 <UU/config.sh sort | uniq >UU/oldconfig.sh
16001 sed -n 's/^\([a-zA-Z_0-9]*\)=.*/\1/p' config.sh config.sh UU/oldconfig.sh |\
16002 sort | uniq -u >UU/oldsyms
16003 set X `cat UU/oldsyms`
16009 Hmm...You had some extra variables I don't know about...I'll try to keep 'em...
16011 echo "# Variables propagated from previous config.sh file." >>config.sh
16012 for sym in `cat UU/oldsyms`; do
16013 echo " Propagating $hint variable "'$'"$sym..."
16014 eval 'tmp="$'"${sym}"'"'
16016 sed -e "s/'/'\"'\"'/g" -e "s/^/$sym='/" -e "s/$/'/" >>config.sh
16022 : Finish up by extracting the .SH files
16036 If you'd like to make any changes to the config.sh file before I begin
16037 to configure things, do it as a shell escape now (e.g. !vi config.sh).
16040 rp="Press return or use a shell escape to edit config.sh:"
16045 *) : in case they cannot read
16046 sh 1>&4 -c "$ans";;
16051 : if this fails, just run all the .SH files by hand
16058 if $contains '^depend:' [Mm]akefile >/dev/null 2>&1; then
16065 Now you need to generate make dependencies by running "$make depend".
16066 You might prefer to run it in background: "$make depend > makedepend.out &"
16067 It can take a while, so you might not want to run it right now.
16072 rp="Run $make depend now?"
16076 $make depend && echo "Now you must run '$make'."
16079 echo "You must run '$make depend' then '$make'."
16082 elif test -f [Mm]akefile; then
16084 echo "Now you must run a $make."
16089 if $test -f Policy.sh; then
16092 If you compile $package on a different machine or from a different object
16093 directory, copy the Policy.sh file from this object directory to the
16094 new one before you run Configure -- this will help you with most of
16095 the policy defaults.
16099 if $test -f config.msg; then
16100 echo "Hmm. I also noted the following information while running:"
16102 $cat config.msg >&4
16105 $rm -f kit*isdone ark*isdone