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 Wed Aug 16 02:10:47 EET DST 2000 [metaconfig 3.0 PL70]
24 # (with additional metaconfig patches by perlbug@perl.com)
29 SCO csh still thinks true is false. Write to SCO today and tell them that next
30 year Configure ought to "rm /bin/csh" unless they fix their blasted shell. :-)
32 (Actually, Configure ought to just patch csh in place. Hmm. Hmmmmm. All
33 we'd have to do is go in and swap the && and || tokens, wherever they are.)
35 [End of diatribe. We now return you to your regularly scheduled programming...]
39 OOPS! You naughty creature! You didn't run Configure with sh!
40 I will attempt to remedy the situation by running sh for you...
43 true || cat /tmp/c1$$ /tmp/c2$$
44 true || exec sh $0 $argv:q
46 (exit $?0) || cat /tmp/c2$$
47 (exit $?0) || exec sh $0 $argv:q
48 rm -f /tmp/c1$$ /tmp/c2$$
50 : compute my invocation name
54 me=`echo $0 | sed -e 's!.*/\(.*\)!\1!' 2>/dev/null`
59 : Proper separator for the PATH environment variable
61 : On OS/2 this directory should exist if this is not floppy only system :-]
62 if test -d c:/. ; then
63 if test -n "$OS2_SHELL"; then
65 PATH=`cmd /c "echo %PATH%" | tr '\\\\' / `
66 OS2_SHELL=`cmd /c "echo %OS2_SHELL%" | tr '\\\\' / | tr '[A-Z]' '[a-z]'`
67 elif test -n "$DJGPP"; then
73 paths='/bin /usr/bin /usr/local/bin /usr/ucb /usr/local /usr/lbin'
74 paths="$paths /opt/bin /opt/local/bin /opt/local /opt/lbin"
75 paths="$paths /usr/5bin /etc /usr/gnu/bin /usr/new /usr/new/bin /usr/nbin"
76 paths="$paths /opt/gnu/bin /opt/new /opt/new/bin /opt/nbin"
77 paths="$paths /sys5.3/bin /sys5.3/usr/bin /bsd4.3/bin /bsd4.3/usr/ucb"
78 paths="$paths /bsd4.3/usr/bin /usr/bsd /bsd43/bin /usr/ccs/bin"
79 paths="$paths /etc /usr/lib /usr/ucblib /lib /usr/ccs/lib"
80 paths="$paths /sbin /usr/sbin /usr/libexec"
86 *) test -d $p && PATH=$PATH$p_$p ;;
93 : shall we be using ksh?
99 if (PATH=.; alias -x) >/dev/null 2>&1; then
102 if test -f /hp-ux -a -f /bin/ksh; then
103 needksh='to avoid sh bug in "here document" expansion'
105 if test -d /usr/lpp -a -f /usr/bin/bsh -a -f /usr/bin/uname; then
106 if test X`/usr/bin/uname -v` = X4; then
107 avoidksh="to avoid AIX 4's /bin/sh"
111 if test -f /osf_boot -a -f /usr/sbin/setld; then
112 if test X`/usr/bin/uname -s` = XOSF1; then
113 avoidksh="to avoid Digital UNIX' ksh"
115 unset BIN_SH # if this is 'xpg4' sh will start up ksh
118 case "$inksh/$needksh" in
125 case "$inksh/$avoidksh" in
131 case "$inksh/$needksh-$avoidksh-" in
134 (I see you are using the Korn shell. Some ksh's blow up on $me,
135 mainly on older exotic systems. If yours does, try the Bourne shell instead.)
141 echo "(Feeding myself to $newsh $reason.)"
143 Configure|*/Configure) exec $newsh $0 "$@";;
144 *) exec $newsh Configure "$@";;
149 : if needed set CDPATH to a harmless value that is not chatty
150 : avoid bash 2.02 problems with empty CDPATH.
154 *bash*) CDPATH='.' ;;
159 : Configure runs within the UU subdirectory
160 test -d UU || mkdir UU
458 d_printf_exp_digits=''
459 d_old_pthread_create_joinable=''
460 old_pthread_create_joinable=''
706 inc_version_list_init=''
724 ignore_versioned_solibs=''
786 d_perl_otherlibdirs=''
803 d_nv_preserves_uv_bits=''
894 d_stdio_stream_array=''
895 stdio_stream_array=''
905 ccflags_uselargefiles=''
906 ldflags_uselargefiles=''
907 libswanted_uselargefiles=''
949 smallmach='pdp11 i8086 z8000 i80286 iAPX286'
952 : We must find out about Eunice early
954 if test -f /etc/unixtovms; then
955 eunicefix=/etc/unixtovms
957 if test -f /etc/unixtovms.exe; then
958 eunicefix=/etc/unixtovms.exe
962 : set useposix=false in your hint file to disable the POSIX extension.
964 : set useopcode=false in your hint file to disable the Opcode extension.
966 : Trailing extension. Override this in a hint file, if needed.
968 : Extra object files, if any, needed on this platform.
970 : Possible local include directories to search.
971 : Set locincpth to "" in a hint file to defeat local include searches.
972 locincpth="/usr/local/include /opt/local/include /usr/gnu/include"
973 locincpth="$locincpth /opt/gnu/include /usr/GNU/include /opt/GNU/include"
975 : no include file wanted by default
979 : change the next line if compiling for Xenix/286 on Xenix/386
980 xlibpth='/usr/lib/386 /lib/386'
981 : Possible local library directories to search.
982 loclibpth="/usr/local/lib /opt/local/lib /usr/gnu/lib"
983 loclibpth="$loclibpth /opt/gnu/lib /usr/GNU/lib /opt/GNU/lib"
985 : general looking path for locating libraries
986 glibpth="/usr/lib/large /lib /usr/lib $xlibpth"
987 glibpth="$glibpth /lib/large /usr/lib/small /lib/small"
988 glibpth="$glibpth /usr/ccs/lib /usr/ucblib /usr/local/lib"
989 test -f /usr/shlib/libc.so && glibpth="/usr/shlib $glibpth"
990 test -f /shlib/libc.so && glibpth="/shlib $glibpth"
992 : Private path used by Configure to find libraries. Its value
993 : is prepended to libpth. This variable takes care of special
994 : machines, like the mips. Usually, it should be empty.
997 : default library list
999 : some systems want to use only the non-versioned libso:s
1000 ignore_versioned_solibs=''
1001 ccflags_uselargefiles=''
1002 ldflags_uselargefiles=''
1003 libswanted_uselargefiles=''
1004 : set usemultiplicity on the Configure command line to enable multiplicity.
1005 : set usesocks on the Configure command line to enable socks.
1006 : set usethreads on the Configure command line to enable threads.
1007 : full support for void wanted by default
1010 : List of libraries we want.
1011 : If anyone needs -lnet, put it in a hint file.
1012 libswanted='sfio socket bind inet nsl nm ndbm gdbm dbm db malloc dl'
1013 libswanted="$libswanted dld ld sun m c cposix posix"
1014 libswanted="$libswanted ndir dir crypt sec"
1015 libswanted="$libswanted ucb bsd BSD PW x iconv util"
1016 : We probably want to search /usr/shlib before most other libraries.
1017 : This is only used by the lib/ExtUtils/MakeMaker.pm routine extliblist.
1018 glibpth=`echo " $glibpth " | sed -e 's! /usr/shlib ! !'`
1019 glibpth="/usr/shlib $glibpth"
1020 : Do not use vfork unless overridden by a hint file.
1023 : Find the basic shell for Bourne shell scripts
1027 *bsd*|sys5*) xxx="/$SYSTYPE/bin/sh";;
1030 if test -f "$xxx"; then
1033 : Build up a list and do a single loop so we can 'break' out.
1034 pth=`echo $PATH | sed -e "s/$p_/ /g"`
1035 for xxx in sh bash ksh pdksh ash; do
1037 try="$try ${p}/${xxx}"
1041 if test -f "$xxx"; then
1044 elif test -f "$xxx.exe"; then
1055 $me: Fatal Error: I can't find a Bourne Shell anywhere.
1057 Usually it's in /bin/sh. How did you even get this far?
1058 Please contact me (Perl Maintainers) at perlbug@perl.com and
1059 we'll try to straighten this all out.
1065 : see if sh knows # comments
1066 if `$sh -c '#' >/dev/null 2>&1`; then
1070 test -f $xcat || xcat=/usr/bin/cat
1075 if test -s today; then
1078 echo "#! $xcat" > try
1082 if test -s today; then
1090 echo "Your $sh doesn't grok # comments--I will strip them later on."
1093 echo "exec grep -v '^[ ]*#'" >spitshell
1095 $eunicefix spitshell
1096 spitshell=`pwd`/spitshell
1098 echo "I presume that if # doesn't work, #! won't work either!"
1103 : figure out how to guarantee sh startup
1105 '') startsh=${sharpbang}${sh} ;;
1117 : echo "Yup, it does."
1119 echo "Hmm... '$startsh' does not guarantee sh startup..."
1120 echo "You may have to fix up the shell scripts to make sure $sh runs them."
1125 : Save command line options in file UU/cmdline.opt for later use in
1126 : generating config.sh.
1127 cat > cmdline.opt <<EOSH
1128 # Configure command line arguments.
1135 cat >>cmdline.opt <<EOSH
1136 config_arg$argn='$arg'
1138 argn=`expr $argn + 1`
1141 : produce awk script to parse command line options
1142 cat >options.awk <<'EOF'
1144 optstr = "A:dD:eEf:hKOrsSU:V"; # getopt-style specification
1146 len = length(optstr);
1147 for (i = 1; i <= len; i++) {
1148 c = substr(optstr, i, 1);
1149 if (i < len) a = substr(optstr, i + 1, 1); else a = "";
1160 if (substr(str, 1, 1) != "-") {
1161 printf("'%s'\n", str);
1165 for (i = 2; i <= len; i++) {
1166 c = substr(str, i, 1);
1168 printf("-%s\n", substr(str, i));
1174 printf("'%s'\n", substr(str, i + 1));
1187 : process the command line options
1188 set X `for arg in "$@"; do echo "X$arg"; done |
1189 sed -e s/X// | awk -f options.awk`
1194 : set up default values
1204 rm -f optdef.sh posthint.sh
1205 cat >optdef.sh <<EOS
1211 while test $# -gt 0; do
1213 -d) shift; fastread=yes;;
1214 -e) shift; alldone=cont;;
1218 if test -r "$1"; then
1221 echo "$me: cannot read config file $1." >&2
1226 -h) shift; error=true;;
1227 -r) shift; reuseval=true;;
1228 -s) shift; silent=true; realsilent=true;;
1229 -E) shift; alldone=exit;;
1230 -K) shift; knowitall=true;;
1231 -O) shift; override=true;;
1232 -S) shift; silent=true; extractsh=true;;
1237 echo "$me: use '-U symbol=', not '-D symbol='." >&2
1238 echo "$me: ignoring -D $1" >&2
1241 sed -e "s/'/'\"'\"'/g" -e "s/=\(.*\)/='\1'/" >> optdef.sh;;
1242 *) echo "$1='define'" >> optdef.sh;;
1249 *=) echo "$1" >> optdef.sh;;
1251 echo "$me: use '-D symbol=val', not '-U symbol=val'." >&2
1252 echo "$me: ignoring -U $1" >&2
1254 *) echo "$1='undef'" >> optdef.sh;;
1265 *=*) zzz=`echo $yyy|sed 's!=.*!!'`
1269 zzz=" "`echo $yyy|sed 's!^[^=]*=!!'`
1270 yyy=`echo $yyy|sed 's!=.*!!'` ;;
1276 *:*) xxx=`echo $yyy|sed 's!:.*!!'`
1277 yyy=`echo $yyy|sed 's!^[^:]*:!!'`
1278 zzz=`echo $yyy|sed 's!^[^=]*=!!'`
1279 yyy=`echo $yyy|sed 's!=.*!!'` ;;
1280 *) xxx=`echo $yyy|sed 's!:.*!!'`
1281 yyy=`echo $yyy|sed 's!^[^:]*:!!'` ;;
1287 echo "$yyy=\"\${$yyy}$zzz\"" >> posthint.sh ;;
1289 echo "$yyy=''" >> posthint.sh ;;
1294 echo "$yyy='$zzz'" >> posthint.sh ;;
1296 echo "eval \"$yyy=$zzz\"" >> posthint.sh ;;
1298 echo "$yyy=\"$zzz\${$yyy}\"" >> posthint.sh ;;
1303 echo "$yyy=$zzz" >> posthint.sh ;;
1304 *) echo "$me: unknown -A command '$xxx', ignoring -A $1" >&2 ;;
1308 -V) echo "$me generated by metaconfig 3.0 PL70." >&2
1311 -*) echo "$me: unknown option $1" >&2; shift; error=true;;
1319 Usage: $me [-dehrsEKOSV] [-f config.sh] [-D symbol] [-D symbol=value]
1320 [-U symbol] [-U symbol=] [-A command:symbol...]
1321 -d : use defaults for all answers.
1322 -e : go on without questioning past the production of config.sh.
1323 -f : specify an alternate default configuration file.
1324 -h : print this help message and exit (with an error status).
1325 -r : reuse C symbols value if possible (skips costly nm extraction).
1326 -s : silent mode, only echoes questions and essential information.
1327 -D : define symbol to have some value:
1328 -D symbol symbol gets the value 'define'
1329 -D symbol=value symbol gets the value 'value'
1330 -E : stop at the end of questions, after having produced config.sh.
1331 -K : do not use unless you know what you are doing.
1332 -O : let -D and -U override definitions from loaded configuration file.
1333 -S : perform variable substitutions on all .SH files (can mix with -f)
1334 -U : undefine symbol:
1335 -U symbol symbol gets the value 'undef'
1336 -U symbol= symbol gets completely empty
1337 -A : manipulate symbol after the platform specific hints have been applied:
1338 -A symbol=value append " "value to symbol
1339 -A append:symbol=value append value to symbol
1340 -A define:symbol=value define symbol to have value
1341 -A clear:symbol define symbol to be ''
1342 -A define:symbol define symbol to be 'define'
1343 -A eval:symbol=value define symbol to be eval of value
1344 -A prepend:symbol=value prepend value to symbol
1345 -A undef:symbol define symbol to be 'undef'
1346 -A undef:symbol= define symbol to be ''
1347 -V : print version number and exit (with a zero status).
1354 case "$fastread$alldone" in
1357 case "$extractsh" in
1360 if test ! -t 0; then
1361 echo "Say 'sh Configure', not 'sh <Configure'"
1371 true) exec 1>/dev/null;;
1374 : run the defines and the undefines, if any, but leave the file out there...
1377 : create the posthint manipulation script and leave the file out there...
1382 first=`echo $package | sed -e 's/^\(.\).*/\1/'`
1383 last=`echo $package | sed -e 's/^.\(.*\)/\1/'`
1384 case "`echo AbyZ | tr '[:lower:]' '[:upper:]' 2>/dev/null`" in
1385 ABYZ) spackage=`echo $first | tr '[:lower:]' '[:upper:]'`$last;;
1386 *) spackage=`echo $first | tr '[a-z]' '[A-Z]'`$last;;
1389 : Some greps do not return status, grrr.
1390 echo "grimblepritz" >grimble
1391 if grep blurfldyick grimble >/dev/null 2>&1 ; then
1393 elif grep grimblepritz grimble >/dev/null 2>&1 ; then
1399 : the following should work in any shell
1403 echo "AGH! Grep doesn't return a status. Attempting remedial action."
1404 cat >contains <<'EOSS'
1405 grep "$1" "$2" >.greptmp && cat .greptmp && test -s .greptmp
1410 : Find the path to the source tree
1413 */*) src=`echo $0 | sed -e 's%/[^/][^/]*$%%'`
1416 *) src=`cd ../$src && pwd` ;;
1429 if test -f $rsrc/Configure && \
1430 $contains "^package=$package$" $rsrc/Configure >/dev/null 2>&1
1432 : found it, so we are ok.
1435 for src in . .. ../.. ../../.. ../../../..; do
1436 if test -f ../$src/Configure && \
1437 $contains "^package=$package$" ../$src/Configure >/dev/null 2>&1
1448 Sorry, I can't seem to locate the source dir for $package. Please start
1449 Configure with an explicit path -- i.e. /some/path/Configure.
1457 echo "Sources for $package found in \"$src\"." >&4
1461 : script used to extract .SH files with variable substitutions
1462 cat >extract <<'EOS'
1464 echo "Doing variable substitutions on .SH files..."
1465 if test -f $src/MANIFEST; then
1466 set x `awk '{print $1}' <$src/MANIFEST | grep '\.SH$'`
1468 echo "(Looking for .SH files under the source directory.)"
1469 set x `(cd $src; find . -name "*.SH" -print)`
1473 0) set x `(cd $src; echo *.SH)`; shift;;
1475 if test ! -f $src/$1; then
1481 while test $name; do
1482 if test ! -d "$name"; then
1483 create="$name $create";
1484 name=`echo $name | sed -e "s|^[^/]*$||"`;
1485 name=`echo $name | sed -e "s|\(.*\)/.*|\1|"`;
1490 for file in $create; do
1499 dir=`expr X$file : 'X\(.*\)/'`
1500 file=`expr X$file : 'X.*/\(.*\)'`
1501 (cd $dir && . ./$file)
1511 dir=`expr X$file : 'X\(.*\)/'`
1512 file=`expr X$file : 'X.*/\(.*\)'`
1513 (set x $dir; shift; eval $mkdir_p)
1523 if test -f $src/config_h.SH; then
1524 if test ! -f config.h; then
1525 : oops, they left it out of MANIFEST, probably, so do it anyway.
1531 : extract files and exit if asked to do so
1532 case "$extractsh" in
1534 case "$realsilent" in
1538 case "$config_sh" in
1539 '') config_sh='config.sh';;
1542 echo "Fetching answers from $config_sh..."
1545 test "$override" && . ./optdef.sh
1554 : Eunice requires " " instead of "", can you believe it
1557 echo "Beginning of configuration questions for $package."
1559 trap 'echo " "; test -d ../UU && rm -rf X $rmlist; exit 1' 1 2 3 15
1561 : first determine how to suppress newline on echo command
1563 echo "Checking echo to see how to suppress newlines..."
1564 (echo "hi there\c" ; echo " ") >.echotmp
1565 if $contains c .echotmp >/dev/null 2>&1 ; then
1576 echo $n "The star should be here-->$c"
1580 : Now test for existence of everything in MANIFEST
1582 if test -f $rsrc/MANIFEST; then
1583 echo "First let's make sure your kit is complete. Checking..." >&4
1584 awk '$1 !~ /PACK[A-Z]+/ {print $1}' $rsrc/MANIFEST | split -50
1587 for filelist in x??; do
1588 (cd $rsrc; ls `cat $tmppwd/$filelist` >/dev/null 2>>$tmppwd/missing)
1590 if test -s missing; then
1594 THIS PACKAGE SEEMS TO BE INCOMPLETE.
1596 You have the option of continuing the configuration process, despite the
1597 distinct possibility that your kit is damaged, by typing 'y'es. If you
1598 do, don't blame me if something goes wrong. I advise you to type 'n'o
1599 and contact the author (perlbug@perl.com).
1602 echo $n "Continue? [n] $c" >&4
1606 echo "Continuing..." >&4
1610 echo "ABORTING..." >&4
1615 echo "Looks good..."
1618 echo "There is no MANIFEST file. I hope your kit is complete !"
1623 : Find the appropriate value for a newline for tr
1624 if test -n "$DJGPP"; then
1627 if test X"$trnl" = X; then
1628 case "`echo foo|tr '\n' x 2>/dev/null`" in
1632 if test X"$trnl" = X; then
1633 case "`echo foo|tr '\012' x 2>/dev/null`" in
1634 foox) trnl='\012' ;;
1637 if test X"$trnl" = X; then
1640 $me: Fatal Error: cannot figure out how to translate newlines with 'tr'.
1646 : compute the number of columns on the terminal for proper question formatting
1651 : set up the echo used in my read
1652 myecho="case \"\$xxxm\" in
1653 '') echo $n \"\$rp $c\" >&4;;
1655 '') echo $n \"[\$xxxm] $c\";;
1657 if test \`echo \"\$rp [\$xxxm] \" | wc -c\` -ge $COLUMNS; then
1659 echo $n \"[\$xxxm] $c\" >&4
1661 echo $n \"\$rp [\$xxxm] $c\" >&4
1667 : now set up to do reads with possible shell escape and default assignment
1673 case "\$fastread" in
1674 yes) case "\$dflt" in
1677 case "\$silent-\$rp" in
1682 *) case "\$silent" in
1683 true) case "\$rp" in
1688 while expr "X\$ans" : "X!" >/dev/null; do
1692 aok=''; eval "ans=\\"\$answ\\"" && aok=y
1700 set x \`expr "X\$ans" : "X!\(.*\)\$"\`
1709 set x \`expr "X\$ans" : "X&\(.*\)\$"\`
1714 echo "(OK, I'll run with -d after this question.)" >&4
1717 echo "*** Sorry, \$1 not supported yet." >&4
1727 echo "*** Substitution done -- please confirm."
1729 ans=\`echo $n "\$ans$c" | tr '$trnl' ' '\`
1734 echo "*** Error -- try again."
1741 case "\$ans\$xxxm\$nostick" in
1753 : create .config dir to save info across Configure sessions
1754 test -d ../.config || mkdir ../.config
1755 cat >../.config/README <<EOF
1756 This directory created by Configure to save information that should
1757 persist across sessions for $package.
1759 You may safely delete it if you wish.
1762 xpatchlevel=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
1764 $define|true|[yY]*) ;;
1765 *) case "$xpatchlevel" in
1768 *** WHOA THERE!!! ***
1770 This is an UNSTABLE DEVELOPMENT release.
1771 (The patchlevel, $xpatchlevel, is odd--as opposed to even,
1772 and that signifies a development release. If you want a
1773 maintenance release, you want an even-numbered release.)
1775 Do ***NOT*** install this into production use.
1776 Data corruption and crashes are possible.
1778 It is most seriously suggested that you do not continue any further
1779 unless you want to help in developing and debugging Perl.
1782 rp='Do you really want to continue?'
1786 [yY]) echo >&4 "Okay, continuing." ;;
1787 *) echo >&4 "Okay, bye."
1796 : general instructions
1799 user=`(logname) 2>/dev/null`
1801 '') user=`whoami 2>&1`;;
1803 if $contains "^$user\$" ../.config/instruct >/dev/null 2>&1; then
1806 rp='Would you like to see the instructions?'
1817 This installation shell script will examine your system and ask you questions
1818 to determine how the perl5 package should be installed. If you get
1819 stuck on a question, you may use a ! shell escape to start a subshell or
1820 execute a command. Many of the questions will have default answers in square
1821 brackets; typing carriage return will give you the default.
1823 On some of the questions which ask for file or directory names you are allowed
1824 to use the ~name construct to specify the login directory belonging to "name",
1825 even if you don't have a shell which knows about that. Questions where this is
1826 allowed will be marked "(~name ok)".
1830 dflt='Type carriage return to continue'
1834 The prompter used in this script allows you to use shell variables and
1835 backticks in your answers. You may use $1, $2, etc... to refer to the words
1836 in the default answer, as if the default line was a set of arguments given to a
1837 script shell. This means you may also use $* to repeat the whole default line,
1838 so you do not have to re-type everything to add something to the default.
1840 Everytime there is a substitution, you will have to confirm. If there is an
1841 error (e.g. an unmatched backtick), the default answer will remain unchanged
1842 and you will be prompted again.
1844 If you are in a hurry, you may run 'Configure -d'. This will bypass nearly all
1845 the questions and use the computed defaults (or the previous answers if there
1846 was already a config.sh file). Type 'Configure -h' for a list of options.
1847 You may also start interactively and then answer '& -d' at any prompt to turn
1848 on the non-interactive behaviour for the remainder of the execution.
1854 Much effort has been expended to ensure that this shell script will run on any
1855 Unix system. If despite that it blows up on yours, your best bet is to edit
1856 Configure and run it again. If you can't run Configure for some reason,
1857 you'll have to generate a config.sh file by hand. Whatever problems you
1858 have, let me (perlbug@perl.com) know how I blew it.
1860 This installation script affects things in two ways:
1862 1) it may do direct variable substitutions on some of the files included
1864 2) it builds a config.h file for inclusion in C programs. You may edit
1865 any of these files as the need arises after running this script.
1867 If you make a mistake on a question, there is no easy way to back up to it
1868 currently. The easiest thing to do is to edit config.sh and rerun all the SH
1869 files. Configure will offer to let you do this before it runs the SH files.
1872 dflt='Type carriage return to continue'
1874 case "$firsttime" in
1875 true) echo $user >>../.config/instruct;;
1879 : find out where common programs are
1881 echo "Locating common programs..." >&4
1894 if test -d \$dir/\$thing; then
1900 for thisthing in \$dir/\$thing; do
1901 : just loop through to pick last item
1903 if test -f \$thisthing; then
1906 elif test -f \$dir/\$thing.exe; then
1907 if test -n "$DJGPP"; then
1908 echo \$dir/\$thing.exe
1910 : on Eunice apparently
1960 pth=`echo $PATH | sed -e "s/$p_/ /g"`
1961 pth="$pth /lib /usr/lib"
1962 for file in $loclist; do
1966 if test -f "$xxx"; then
1969 echo "WARNING: no $xxx -- ignoring your setting for $file." >&4
1970 xxx=`./loc $file $file $pth`
1973 '') xxx=`./loc $file $file $pth`;;
1974 *) xxx=`./loc $xxx $xxx $pth`;;
1980 echo $file is in $xxx.
1983 echo $file is in $xxx.
1986 echo "I don't know where '$file' is, and my life depends on it." >&4
1987 echo "Go find a public domain implementation or fix your PATH setting!" >&4
1993 echo "Don't worry if any of the following aren't found..."
1995 for file in $trylist; do
1999 if test -f "$xxx"; then
2002 echo "WARNING: no $xxx -- ignoring your setting for $file." >&4
2003 xxx=`./loc $file $file $pth`
2006 '') xxx=`./loc $file $file $pth`;;
2007 *) xxx=`./loc $xxx $xxx $pth`;;
2013 echo $file is in $xxx.
2016 echo $file is in $xxx.
2019 echo "I don't see $file out there, $say."
2026 echo "Substituting grep for egrep."
2032 echo "Substituting cp for ln."
2038 echo "Hopefully test is built into your sh."
2041 if `sh -c "PATH= test true" >/dev/null 2>&1`; then
2042 echo "Using the test built into your sh."
2050 echo "Hopefully echo is built into your sh."
2055 echo "Checking compatibility between $echo and builtin echo (if any)..." >&4
2056 $echo $n "hi there$c" >foo1
2057 echo $n "hi there$c" >foo2
2058 if cmp foo1 foo2 >/dev/null 2>&1; then
2059 echo "They are compatible. In fact, they may be identical."
2066 They are not compatible! You are probably running ksh on a non-USG system.
2067 I'll have to use $echo instead of the builtin, since Bourne shell doesn't
2068 have echo built in and we may have to run some Bourne shell scripts. That
2069 means I'll have to use '$n$c' to suppress newlines now. Life is ridiculous.
2072 $echo $n "The star should be here-->$c"
2082 cat <<'EOSC' >>checkcc
2087 int main(int argc, char *argv[]) {
2091 if $cc -o try try.c; then
2094 echo "Uh-oh, the C compiler '$cc' doesn't seem to be working." >&4
2100 case "`$cc -v -c try.c 2>&1`" in
2103 if $test X"$trygcc" = Xyes; then
2104 if gcc -o try -c try.c; then
2106 echo "You seem to have a working gcc, though." >&4
2107 rp="Would you like to use it?"
2109 if $test -f myread; then
2112 if $test -f UU/myread; then
2115 echo "Cannot find myread, sorry. Aborting." >&2
2120 [yY]*) cc=gcc; ccflags=''; despair=no ;;
2124 if $test X"$despair" = Xyes; then
2125 echo "You need to find a working C compiler." >&4
2126 echo "I cannot continue any further, aborting." >&4
2135 : determine whether symbolic links are supported
2138 if $ln -s blurfl sym > /dev/null 2>&1 ; then
2139 echo "Symbolic links are supported." >&4
2142 echo "Symbolic links are NOT supported." >&4
2147 : see whether [:lower:] and [:upper:] are supported character classes
2149 case "`echo AbyZ | $tr '[:lower:]' '[:upper:]' 2>/dev/null`" in
2151 echo "Good, your tr supports [:lower:] and [:upper:] to convert case." >&4
2155 *) # There is a discontinuity in EBCDIC between 'I' and 'J'
2156 # (0xc9 and 0xd1), therefore that is a nice testing point.
2157 if test "X$up" = X -o "X$low" = X; then
2158 case "`echo IJ | $tr '[I-J]' '[i-j]' 2>/dev/null`" in
2164 if test "X$up" = X -o "X$low" = X; then
2165 case "`echo IJ | $tr I-J i-j 2>/dev/null`" in
2171 if test "X$up" = X -o "X$low" = X; then
2172 case "`echo IJ | od -x 2>/dev/null`" in
2174 echo "Hey, this might be EBCDIC." >&4
2175 if test "X$up" = X -o "X$low" = X; then
2176 case "`echo IJ | $tr '[A-IJ-RS-Z]' '[a-ij-rs-z]' 2>/dev/null`" in
2177 ij) up='[A-IJ-RS-Z]'
2182 if test "X$up" = X -o "X$low" = X; then
2183 case "`echo IJ | $tr A-IJ-RS-Z a-ij-rs-z 2>/dev/null`" in
2193 case "`echo IJ | $tr \"$up\" \"$low\" 2>/dev/null`" in
2195 echo "Using $up and $low to convert case." >&4
2198 echo "I don't know how to translate letters from upper to lower case." >&4
2199 echo "Your tr is not acting any way I know of." >&4
2203 : set up the translation script tr, must be called with ./tr of course
2207 '[A-Z][a-z]') exec $tr '$up' '$low';;
2208 '[a-z][A-Z]') exec $tr '$low' '$up';;
2215 : Try to determine whether config.sh was made on this system
2216 case "$config_sh" in
2218 myuname=`$uname -a 2>/dev/null`
2219 $test -z "$myuname" && myuname=`hostname 2>/dev/null`
2220 # tr '[A-Z]' '[a-z]' would not work in EBCDIC
2221 # because the A-Z/a-z are not consecutive.
2222 myuname=`echo $myuname | $sed -e 's/^[^=]*=//' -e 's/\///g' | \
2223 ./tr '[A-Z]' '[a-z]' | $tr $trnl ' '`
2224 newmyuname="$myuname"
2226 case "$knowitall" in
2228 if test -f ../config.sh; then
2229 if $contains myuname= ../config.sh >/dev/null 2>&1; then
2230 eval "`grep myuname= ../config.sh`"
2232 if test "X$myuname" = "X$newmyuname"; then
2240 : Get old answers from old config file if Configure was run on the
2241 : same system, otherwise use the hints.
2244 if test -f config.sh; then
2246 rp="I see a config.sh file. Shall I use it to set the defaults?"
2249 n*|N*) echo "OK, I'll ignore it."; mv config.sh config.sh.old;;
2250 *) echo "Fetching default answers from your old config.sh file..." >&4
2258 : Older versions did not always set $sh. Catch re-use of such
2268 if test ! -f config.sh; then
2271 First time through, eh? I have some defaults handy for some systems
2272 that need some extra help getting the Configure answers right:
2275 (cd $src/hints; ls -C *.sh) | $sed 's/\.sh/ /g' >&4
2277 : Half the following guesses are probably wrong... If you have better
2278 : tests or hints, please send them to perlbug@perl.com
2279 : The metaconfig authors would also appreciate a copy...
2280 $test -f /irix && osname=irix
2281 $test -f /xenix && osname=sco_xenix
2282 $test -f /dynix && osname=dynix
2283 $test -f /dnix && osname=dnix
2284 $test -f /lynx.os && osname=lynxos
2285 $test -f /unicos && osname=unicos && osvers=`$uname -r`
2286 $test -f /unicosmk && osname=unicosmk && osvers=`$uname -r`
2287 $test -f /unicosmk.ar && osname=unicosmk && osvers=`$uname -r`
2288 $test -f /bin/mips && /bin/mips && osname=mips
2289 $test -d /NextApps && set X `hostinfo | grep 'NeXT Mach.*:' | \
2290 $sed -e 's/://' -e 's/\./_/'` && osname=next && osvers=$4
2291 $test -d /usr/apollo/bin && osname=apollo
2292 $test -f /etc/saf/_sactab && osname=svr4
2293 $test -d /usr/include/minix && osname=minix
2294 if $test -d /MachTen -o -d /MachTen_Folder; then
2296 if $test -x /sbin/version; then
2297 osvers=`/sbin/version | $awk '{print $2}' |
2298 $sed -e 's/[A-Za-z]$//'`
2299 elif $test -x /usr/etc/version; then
2300 osvers=`/usr/etc/version | $awk '{print $2}' |
2301 $sed -e 's/[A-Za-z]$//'`
2307 $test -f /sys/posix.dll &&
2308 $test -f /usr/bin/what &&
2309 set X `/usr/bin/what /sys/posix.dll` &&
2310 $test "$3" = UWIN &&
2314 if $test -f $uname; then
2322 umips) osname=umips ;;
2325 [23]100) osname=mips ;;
2326 next*) osname=next ;;
2328 tmp=`/bin/uname -X 2>/dev/null|awk '/3\.2v[45]/{ print $(NF) }'`
2329 if $test "$tmp" != "" -a "$3" = "3.2" -a -f '/etc/systemid'; then
2332 elif $test -f /etc/kconfig; then
2334 if test "$lns" = "$ln -s"; then
2336 elif $contains _SYSV3 /usr/include/stdio.h > /dev/null 2>&1 ; then
2338 elif $contains _POSIX_SOURCE /usr/include/stdio.h > /dev/null 2>&1 ; then
2345 if test -n "$DJGPP"; then
2354 tmp=`( (oslevel) 2>/dev/null || echo "not found") 2>&1`
2356 'not found') osvers="$4"."$3" ;;
2357 '<3240'|'<>3240') osvers=3.2.0 ;;
2358 '=3240'|'>3240'|'<3250'|'<>3250') osvers=3.2.4 ;;
2359 '=3250'|'>3250') osvers=3.2.5 ;;
2363 bsd386) osname=bsd386
2366 cygwin*) osname=cygwin
2369 *dc.osx) osname=dcosx
2375 domainos) osname=apollo
2381 dynixptx*) osname=dynixptx
2382 osvers=`echo "$4"|sed 's/^v//'`
2384 freebsd) osname=freebsd
2386 genix) osname=genix ;;
2388 osvers=`echo "$3" | $sed 's,.*\.\([0-9]*\.[0-9]*\),\1,'`
2404 netbsd*) osname=netbsd
2407 news-os) osvers="$3"
2409 4*) osname=newsos4 ;;
2413 next*) osname=next ;;
2414 POSIX-BC | posix-bc ) osname=posix-bc
2417 powerux | power_ux | powermax_os | powermaxos | \
2418 powerunix | power_unix) osname=powerux
2424 solaris) osname=solaris
2426 5*) osvers=`echo $3 | $sed 's/^5/2/g'` ;;
2433 osvers=`echo $3 | $sed 's/^5/2/g'` ;;
2437 titanos) osname=titanos
2446 ultrix) osname=ultrix
2449 osf1|mls+) case "$5" in
2452 osvers=`sizer -v | awk '{print $3}' | tr '[A-Z]' '[a-z]' | sed 's/^[xvt]//'`
2455 *) osvers=`echo "$3" | sed 's/^[xvt]//'` ;;
2458 hp*) osname=hp_osf1 ;;
2459 mips) osname=mips_osf1 ;;
2462 unixware) osname=svr5
2468 $2) case "$osname" in
2472 : svr4.x or possibly later
2482 if test -f /stand/boot ; then
2483 eval `grep '^INITPROG=[a-z/0-9]*$' /stand/boot`
2484 if test -n "$INITPROG" -a -f "$INITPROG"; then
2485 isesix=`strings -a $INITPROG|grep 'ESIX SYSTEM V/386 Release 4.0'`
2486 if test -n "$isesix"; then
2494 *) if test -f /etc/systemid; then
2496 set `echo $3 | $sed 's/\./ /g'` $4
2497 if $test -f $src/hints/sco_$1_$2_$3.sh; then
2499 elif $test -f $src/hints/sco_$1_$2.sh; then
2501 elif $test -f $src/hints/sco_$1.sh; then
2506 '') : Still unknown. Probably a generic Sys V.
2515 *) case "$osname" in
2516 '') : Still unknown. Probably a generic BSD.
2524 if test -f /vmunix -a -f $src/hints/news_os.sh; then
2525 (what /vmunix | UU/tr '[A-Z]' '[a-z]') > UU/kernel.what 2>&1
2526 if $contains news-os UU/kernel.what >/dev/null 2>&1; then
2529 $rm -f UU/kernel.what
2530 elif test -d c:/.; then
2537 : Now look for a hint file osname_osvers, unless one has been
2538 : specified already.
2541 file=`echo "${osname}_${osvers}" | $sed -e 's%\.%_%g' -e 's%_$%%'`
2542 : Also try without trailing minor version numbers.
2543 xfile=`echo $file | $sed -e 's%_[^_]*$%%'`
2544 xxfile=`echo $xfile | $sed -e 's%_[^_]*$%%'`
2545 xxxfile=`echo $xxfile | $sed -e 's%_[^_]*$%%'`
2546 xxxxfile=`echo $xxxfile | $sed -e 's%_[^_]*$%%'`
2549 *) case "$osvers" in
2552 *) if $test -f $src/hints/$file.sh ; then
2554 elif $test -f $src/hints/$xfile.sh ; then
2556 elif $test -f $src/hints/$xxfile.sh ; then
2558 elif $test -f $src/hints/$xxxfile.sh ; then
2560 elif $test -f $src/hints/$xxxxfile.sh ; then
2562 elif $test -f "$src/hints/${osname}.sh" ; then
2571 if $test -f Policy.sh ; then
2574 none) dflt="Policy" ;;
2575 *) dflt="Policy $dflt" ;;
2580 dflt=`echo $hintfile | $sed 's/\.sh$//'`
2584 if $test -f Policy.sh ; then
2587 There's also a Policy hint file available, which should make the
2588 site-specific (policy) questions easier to answer.
2595 You may give one or more space-separated answers, or "none" if appropriate.
2596 A well-behaved OS will have no hints, so answering "none" or just "Policy"
2597 is a good thing. DO NOT give a wrong version or a wrong OS.
2601 rp="Which of these apply, if any?"
2604 for file in $tans; do
2605 if $test X$file = XPolicy -a -f Policy.sh; then
2607 $cat Policy.sh >> UU/config.sh
2608 elif $test -f $src/hints/$file.sh; then
2609 . $src/hints/$file.sh
2610 $cat $src/hints/$file.sh >> UU/config.sh
2611 elif $test X$tans = X -o X$tans = Xnone ; then
2614 : Give one chance to correct a possible typo.
2615 echo "$file.sh does not exist"
2617 rp="hint to use instead?"
2619 for file in $ans; do
2620 if $test -f "$src/hints/$file.sh"; then
2621 . $src/hints/$file.sh
2622 $cat $src/hints/$file.sh >> UU/config.sh
2623 elif $test X$ans = X -o X$ans = Xnone ; then
2626 echo "$file.sh does not exist -- ignored."
2633 : Remember our hint file for later.
2634 if $test -f "$src/hints/$file.sh" ; then
2644 echo "Fetching default answers from $config_sh..." >&4
2648 cp $config_sh config.sh 2>/dev/null
2658 test "$override" && . ./optdef.sh
2659 myuname="$newmyuname"
2661 : Restore computed paths
2662 for file in $loclist $trylist; do
2663 eval $file="\$_$file"
2668 Configure uses the operating system name and version to set some defaults.
2669 The default value is probably right if the name rings a bell. Otherwise,
2670 since spelling matters for me, either accept the default or answer "none"
2677 ''|' '|none) dflt=none ;;
2678 *) dflt=`echo $hintfile | $sed -e 's/\.sh$//' -e 's/_.*$//'` ;;
2681 *) dflt="$osname" ;;
2683 rp="Operating system name?"
2687 *) osname=`echo "$ans" | $sed -e 's/[ ][ ]*/_/g' | ./tr '[A-Z]' '[a-z]'`;;
2693 ''|' '|none) dflt=none ;;
2694 *) dflt=`echo $hintfile | $sed -e 's/\.sh$//' -e 's/^[^_]*//'`
2695 dflt=`echo $dflt | $sed -e 's/^_//' -e 's/_/./g'`
2697 ''|' ') dflt=none ;;
2702 *) dflt="$osvers" ;;
2704 rp="Operating system version?"
2714 : who configured the system
2715 cf_time=`LC_ALL=C; LANGUAGE=C; export LC_ALL; export LANGUAGE; $date 2>&1`
2716 cf_by=`(logname) 2>/dev/null`
2719 cf_by=`(whoami) 2>/dev/null`
2721 "") cf_by=unknown ;;
2725 : set up the script used to warn in case of inconsistency
2732 echo "*** WHOA THERE!!! ***" >&4
2733 echo " The $hint value for \$$var on this machine was \"$was\"!" >&4
2734 rp=" Keep the $hint value?"
2737 y) td=$was; tu=$was;;
2741 : function used to set $1 to $val
2742 setvar='var=$1; eval "was=\$$1"; td=$define; tu=$undef;
2744 $define$undef) . ./whoa; eval "$var=\$td";;
2745 $undef$define) . ./whoa; eval "$var=\$tu";;
2746 *) eval "$var=$val";;
2749 case "$usethreads" in
2750 $define|true|[yY]*) dflt='y';;
2755 Perl can be built to take advantage of threads on some systems.
2756 To do so, Configure can be run with -Dusethreads.
2758 Note that threading is a highly experimental feature, and
2759 some known race conditions still remain. If you choose to try
2760 it, be very sure to not actually deploy it for production
2761 purposes. README.threads has more details, and is required
2762 reading if you enable threads.
2764 If this doesn't make any sense to you, just accept the default '$dflt'.
2766 rp='Build a threading Perl?'
2769 y|Y) val="$define" ;;
2775 case "$usethreads" in
2779 As of 5.5.640, Perl has two different internal threading implementations,
2780 the 5.005 version (5005threads) and an interpreter-based version
2781 (ithreads) that has one interpreter per thread. Both are very
2782 experimental. This arrangement exists to help developers work out
2783 which one is better.
2785 If you're a casual user, you probably don't want interpreter-threads
2786 at this time. There doesn't yet exist a way to create threads from
2787 within Perl in this model, i.e., "use Thread;" will NOT work.
2789 : Default to ithreads unless overridden on command line or with
2792 case "$use5005threads" in
2793 $define|true|[yY]*) dflt='n';;
2795 case "$useithreads" in
2796 $undef|false|[nN]*) dflt='n';;
2798 rp='Use interpreter-based ithreads?'
2801 y|Y) val="$define" ;;
2806 : Now set use5005threads to the opposite value.
2807 case "$useithreads" in
2808 $define) val="$undef" ;;
2815 useithreads="$undef"
2816 use5005threads="$undef"
2820 case "$d_oldpthreads" in
2821 '') : Configure tests would be welcome here. For now, assume undef.
2823 *) val="$d_oldpthreads" ;;
2829 case "$usethreads" in
2830 "$define"|true|[yY]*)
2831 : Look for a hint-file generated 'call-back-unit'. If the
2832 : user has specified that a threading perl is to be built,
2833 : we may need to set or change some other defaults.
2834 if $test -f usethreads.cbu; then
2835 echo "Your platform has some specific hints for threaded builds, using them..."
2839 (Your platform doesn't have any specific hints for threaded builds.
2840 Assuming POSIX threads, then.)
2848 Perl can be built so that multiple Perl interpreters can coexist
2849 within the same Perl executable.
2852 case "$useithreads" in
2855 This multiple interpreter support is required for interpreter-based threads.
2859 *) case "$usemultiplicity" in
2860 $define|true|[yY]*) dflt='y';;
2864 echo "If this doesn't make any sense to you, just accept the default '$dflt'."
2865 rp='Build Perl for multiplicity?'
2868 y|Y) val="$define" ;;
2876 : determine where manual pages are on this system
2880 syspath='/usr/man/man1 /usr/man/mann /usr/man/manl /usr/man/local/man1'
2881 syspath="$syspath /usr/man/u_man/man1 /usr/share/man/man1"
2882 syspath="$syspath /usr/catman/u_man/man1 /usr/man/l_man/man1"
2883 syspath="$syspath /usr/local/man/u_man/man1 /usr/local/man/l_man/man1"
2884 syspath="$syspath /usr/man/man.L /local/man/man1 /usr/local/man/man1"
2885 sysman=`./loc . /usr/man/man1 $syspath`
2888 if $test -d "$sysman"; then
2889 echo "System manual is in $sysman." >&4
2891 echo "Could not find manual pages in source form." >&4
2894 : see what memory models we can support
2897 $cat >pdp11.c <<'EOP'
2907 '') modelcc="$cc" ;;
2910 ( $modelcc -o pdp11 pdp11.c ) >/dev/null 2>&1
2911 if $test -f pdp11 && ./pdp11 2>/dev/null; then
2912 dflt='unsplit split'
2914 tans=`./loc . X /lib/small /lib/large /usr/lib/small /usr/lib/large /lib/medium /usr/lib/medium /lib/huge`
2917 *) if $test -d /lib/small || $test -d /usr/lib/small; then
2922 if $test -d /lib/medium || $test -d /usr/lib/medium; then
2925 if $test -d /lib/large || $test -d /usr/lib/large; then
2928 if $test -d /lib/huge || $test -d /usr/lib/huge; then
2937 Some systems have different model sizes. On most systems they are called
2938 small, medium, large, and huge. On the PDP11 they are called unsplit and
2939 split. If your system doesn't support different memory models, say "none".
2940 If you wish to force everything to one memory model, say "none" here and
2941 put the appropriate flags later when it asks you for other cc and ld flags.
2942 Venix systems may wish to put "none" and let the compiler figure things out.
2943 (In the following question multiple model names should be space separated.)
2945 The default for most systems is "none".
2948 rp="Which memory models are supported?"
2963 '') if $contains '\-i' $sysman/ld.1 >/dev/null 2>&1 || \
2964 $contains '\-i' $sysman/cc.1 >/dev/null 2>&1; then
2971 rp="What flag indicates separate I and D space?"
2979 *large*|*small*|*medium*|*huge*)
2986 rp="What flag indicates large model?"
2996 *huge*) case "$huge" in
3000 rp="What flag indicates huge model?"
3010 *medium*) case "$medium" in
3014 rp="What flag indicates medium model?"
3021 *) medium="$large";;
3024 *small*) case "$small" in
3028 rp="What flag indicates small model?"
3039 echo "Unrecognized memory models--you may have to edit Makefile.SH" >&4
3042 $rm -f pdp11.* pdp11
3044 : make some quick guesses about what we are up against
3046 $echo $n "Hmm... $c"
3056 $cat /usr/include/signal.h /usr/include/sys/signal.h >foo 2>/dev/null
3057 if test -f /osf_boot || $contains 'OSF/1' /usr/include/ctype.h >/dev/null 2>&1
3059 echo "Looks kind of like an OSF/1 system, but we'll see..."
3061 elif test `echo abc | tr a-z A-Z` = Abc ; then
3062 xxx=`./loc addbib blurfl $pth`
3063 if $test -f $xxx; then
3064 echo "Looks kind of like a USG system with BSD features, but we'll see..."
3068 if $contains SIGTSTP foo >/dev/null 2>&1 ; then
3069 echo "Looks kind of like an extended USG system, but we'll see..."
3071 echo "Looks kind of like a USG system, but we'll see..."
3075 elif $contains SIGTSTP foo >/dev/null 2>&1 ; then
3076 echo "Looks kind of like a BSD system, but we'll see..."
3080 echo "Looks kind of like a Version 7 system, but we'll see..."
3083 case "$eunicefix" in
3086 There is, however, a strange, musty smell in the air that reminds me of
3087 something...hmm...yes...I've got it...there's a VMS nearby, or I'm a Blit.
3091 : it so happens the Eunice I know will not run shell scripts in Unix format
3095 echo "Congratulations. You aren't running Eunice."
3099 : Detect OS2. The p_ variable is set above in the Head.U unit.
3104 I have the feeling something is not exactly right, however...don't tell me...
3105 lemme think...does HAL ring a bell?...no, of course, you're only running OS/2!
3110 if test -f /xenix; then
3111 echo "Actually, this looks more like a XENIX system..."
3116 echo "It's not Xenix..."
3121 if test -f /venix; then
3122 echo "Actually, this looks more like a VENIX system..."
3129 echo "Nor is it Venix..."
3132 chmod +x bsd usg v7 osf1 eunice xenix venix os2
3133 $eunicefix bsd usg v7 osf1 eunice xenix venix os2
3136 : see if we need a special compiler
3144 *) if $contains '\-M' $sysman/cc.1 >/dev/null 2>&1 ; then
3145 if $contains '\-M' $sysman/cpp.1 >/dev/null 2>&1; then
3159 On some older systems the default C compiler will not resolve multiple global
3160 references that happen to have the same name. On some such systems the "Mcc"
3161 command may be used to force these to be resolved. On other systems a "cc -M"
3162 command is required. (Note that the -M flag on other systems indicates a
3163 memory model to use!) If you have the Gnu C compiler, you might wish to use
3169 rp="Use which C compiler?"
3177 rp="Use which C compiler?"
3181 : Look for a hint-file generated 'call-back-unit'. Now that the
3182 : user has specified the compiler, we may need to set or change some
3184 if $test -f cc.cbu; then
3190 echo "Checking for GNU cc in disguise and/or its version number..." >&4
3191 $cat >gccvers.c <<EOM
3196 printf("%s\n", __VERSION__);
3198 printf("%s\n", "1");
3204 if $cc $ldflags -o gccvers gccvers.c; then
3205 gccversion=`./gccvers`
3206 case "$gccversion" in
3207 '') echo "You are not using GNU cc." ;;
3208 *) echo "You are using GNU cc $gccversion."
3213 echo "*** WHOA THERE!!! ***" >&4
3214 echo " Your C compiler \"$cc\" doesn't seem to be working!" >&4
3215 case "$knowitall" in
3217 echo " You'd better start hunting for one and let me know about it." >&4
3223 case "$gccversion" in
3224 1*) cpp=`./loc gcc-cpp $cpp $pth` ;;
3226 case "$gccversion" in
3227 '') gccosandvers='' ;;
3228 *) gccshortvers=`echo "$gccversion"|sed 's/ .*//'`
3229 gccosandvers=`$cc -v 2>&1|grep '/specs$'|sed "s!.*/[^-/]*-[^-/]*-\([^-/]*\)/$gccshortvers/specs!\1!"`
3231 case "$gccosandvers" in
3232 $osname) gccosandvers='' ;; # linux gccs seem to have no linux osvers, grr
3233 $osname$osvers) ;; # looking good
3234 $osname*) cat <<EOM >&4
3236 *** WHOA THERE!!! ***
3238 Your gcc has not been compiled for the exact release of
3239 your operating system ($gccosandvers versus $osname$osvers).
3241 In general it is a good idea to keep gcc synchronized with
3242 the operating system because otherwise serious problems
3243 may ensue when trying to compile software, like Perl.
3245 I'm trying to be optimistic here, though, and will continue.
3246 If later during the configuration and build icky compilation
3247 problems appear (headerfile conflicts being the most common
3248 manifestation), I suggest reinstalling the gcc to match
3249 your operating system release.
3253 *) gccosandvers='' ;; # failed to parse, better be silent
3261 : see how we invoke the C preprocessor
3263 echo "Now, how can we feed standard input to your C preprocessor..." >&4
3264 cat <<'EOT' >testcpp.c
3270 if test ! -f cppstdin; then
3271 if test "X$osname" = "Xaix" -a "X$gccversion" = X; then
3272 # AIX cc -E doesn't show the absolute headerfile
3273 # locations but we'll cheat by using the -M flag.
3274 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
3276 echo 'cat >.$$.c; '"$cc"' -E ${1+"$@"} .$$.c; rm .$$.c' >cppstdin
3279 echo "Keeping your $hint cppstdin wrapper."
3282 wrapper=`pwd`/cppstdin
3286 if $test "X$cppstdin" != "X" && \
3287 $cppstdin $cppminus <testcpp.c >testcpp.out 2>&1 && \
3288 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
3290 echo "You used to use $cppstdin $cppminus so we'll use that again."
3292 '') echo "But let's see if we can live without a wrapper..." ;;
3294 if $cpprun $cpplast <testcpp.c >testcpp.out 2>&1 && \
3295 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
3297 echo "(And we'll use $cpprun $cpplast to preprocess directly.)"
3300 echo "(However, $cpprun $cpplast does not work, let's see...)"
3308 echo "Good old $cppstdin $cppminus does not seem to be of any help..."
3315 elif echo 'Maybe "'"$cc"' -E" will work...'; \
3316 $cc -E <testcpp.c >testcpp.out 2>&1; \
3317 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3318 echo "Yup, it does."
3321 elif echo 'Nope...maybe "'"$cc"' -E -" will work...'; \
3322 $cc -E - <testcpp.c >testcpp.out 2>&1; \
3323 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3324 echo "Yup, it does."
3327 elif echo 'Nope...maybe "'"$cc"' -P" will work...'; \
3328 $cc -P <testcpp.c >testcpp.out 2>&1; \
3329 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3330 echo "Yipee, that works!"
3333 elif echo 'Nope...maybe "'"$cc"' -P -" will work...'; \
3334 $cc -P - <testcpp.c >testcpp.out 2>&1; \
3335 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3336 echo "At long last!"
3339 elif echo 'No such luck, maybe "'$cpp'" will work...'; \
3340 $cpp <testcpp.c >testcpp.out 2>&1; \
3341 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3345 elif echo 'Nixed again...maybe "'$cpp' -" will work...'; \
3346 $cpp - <testcpp.c >testcpp.out 2>&1; \
3347 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3348 echo "Hooray, it works! I was beginning to wonder."
3351 elif echo 'Uh-uh. Time to get fancy. Trying a wrapper...'; \
3352 $wrapper <testcpp.c >testcpp.out 2>&1; \
3353 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3359 rp="No dice. I can't find a C preprocessor. Name one:"
3363 $x_cpp <testcpp.c >testcpp.out 2>&1
3364 if $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3365 echo "OK, that will do." >&4
3367 echo "Sorry, I can't get that to work. Go find one and rerun Configure." >&4
3382 echo "Perhaps can we force $cc -E using a wrapper..."
3383 if $wrapper <testcpp.c >testcpp.out 2>&1; \
3384 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
3390 echo "Nope, we'll have to live without it..."
3404 "$wrapper"|'cppstdin') ;;
3405 *) $rm -f $wrapper;;
3407 $rm -f testcpp.c testcpp.out
3409 : decide how portable to be. Allow command line overrides.
3410 case "$d_portable" in
3412 *) d_portable="$define" ;;
3415 : set up shell script to do ~ expansion
3421 echo \$1 | $sed "s|~|\${HOME-\$LOGDIR}|"
3424 if $test -f /bin/csh; then
3425 /bin/csh -f -c "glob \$1"
3430 name=\`$expr x\$1 : '..\([^/]*\)'\`
3431 dir=\`$sed -n -e "/^\${name}:/{s/^[^:]*:[^:]*:[^:]*:[^:]*:[^:]*:\([^:]*\).*"'\$'"/\1/" -e p -e q -e '}' </etc/passwd\`
3432 if $test ! -d "\$dir"; then
3434 echo "\$me: can't locate home directory for: \$name" >&2
3439 echo \$dir/\`$expr x\$1 : '..[^/]*/\(.*\)'\`
3455 : now set up to get a file name
3459 cat <<'EOSC' >>getfile
3475 expr $fn : '.*(\(.*\)).*' | tr ',' $trnl >getfile.ok
3476 fn=`echo $fn | sed 's/(.*)//'`
3482 loc_file=`expr $fn : '.*:\(.*\)'`
3483 fn=`expr $fn : '\(.*\):.*'`
3491 */*) fullpath=true;;
3500 *e*) exp_file=true;;
3503 *p*) nopath_ok=true;;
3508 *d*) type='Directory';;
3509 *l*) type='Locate';;
3514 Locate) what='File';;
3519 case "$d_portable" in
3527 while test "$type"; do
3532 true) rp="$rp (~name ok)";;
3535 if test -f UU/getfile.ok && \
3536 $contains "^$ans\$" UU/getfile.ok >/dev/null 2>&1
3555 value=`UU/filexp $ans`
3558 if test "$ans" != "$value"; then
3559 echo "(That expands to $value on this system.)"
3573 /*) value="$ansexp" ;;
3574 [a-zA-Z]:/*) value="$ansexp" ;;
3579 echo "I shall only accept a full path name, as in /bin/ls." >&4
3580 echo "Use a ! shell escape if you wish to check pathnames." >&4
3583 echo "Please give a full path name, starting with slash." >&4
3586 echo "Note that using ~name is ok provided it expands well." >&4
3599 for fp in $gfpth; do
3600 if test "X$fp" = X.; then
3605 if test -f "$pf"; then
3607 elif test -r "$pf" || (test -h "$pf") >/dev/null 2>&1
3609 echo "($value is not a plain file, but that's ok.)"
3612 if test X"$type" = X; then
3619 for fp in $gfpth; do
3620 if test "X$fp" = X.; then
3625 direxp="$fp/$ansexp"
3627 if test -d "$direxp"; then
3635 if test -d "$ansexp"; then
3636 echo "(Looking for $loc_file in directory $value.)"
3637 value="$value/$loc_file"
3638 ansexp="$ansexp/$loc_file"
3640 if test -f "$ansexp"; then
3643 case "$nopath_ok" in
3644 true) case "$value" in
3646 *) echo "Assuming $value will be in people's path."
3662 if test "$fastread" = yes; then
3667 rp="$what $value doesn't exist. Use that name anyway?"
3686 test "X$gfpthkeep" != Xy && gfpth=""
3689 : What should the include directory be ?
3691 $echo $n "Hmm... $c"
3695 if $test -f /bin/mips && /bin/mips; then
3696 echo "Looks like a MIPS system..."
3697 $cat >usr.c <<'EOCP'
3698 #ifdef SYSTYPE_BSD43
3702 if cc -E usr.c > usr.out && $contains / usr.out >/dev/null 2>&1; then
3703 dflt='/bsd43/usr/include'
3707 mips_type='System V'
3709 $rm -f usr.c usr.out
3710 echo "and you're compiling with the $mips_type compiler and libraries."
3714 echo "Doesn't look like a MIPS system."
3724 case "$xxx_prompt" in
3727 rp='Where are the include files you want to use?'
3735 : Set private lib path
3738 plibpth="$incpath/usr/lib /usr/local/lib /usr/ccs/lib"
3743 '') dlist="$loclibpth $plibpth $glibpth";;
3744 *) dlist="$libpth";;
3747 : Now check and see which directories actually exist, avoiding duplicates
3751 if $test -d $xxx; then
3754 *) libpth="$libpth $xxx";;
3760 Some systems have incompatible or broken versions of libraries. Among
3761 the directories listed in the question below, please remove any you
3762 know not to be holding relevant libraries, and add any that are needed.
3763 Say "none" for none.
3774 rp="Directories to use for library searches?"
3781 : compute shared library extension
3784 if xxx=`./loc libc.sl X $libpth`; $test -f "$xxx"; then
3794 On some systems, shared libraries may be available. Answer 'none' if
3795 you want to suppress searching of shared libraries for the remainder
3796 of this configuration.
3799 rp='What is the file extension used for shared libraries?'
3803 : Define several unixisms.
3804 : Hints files or command line option can be used to override them.
3805 : The convoluted testing is in case hints files set either the old
3808 '') case "$exe_ext" in
3810 *) _exe="$exe_ext" ;;
3815 '') case "$lib_ext" in
3822 '') case "$obj_ext" in
3829 '') case "$path_sep" in
3840 : Which makefile gets called first. This is used by make depend.
3841 case "$firstmakefile" in
3842 '') firstmakefile='makefile';;
3846 $define|true|[yY]*) dflt='y';;
3851 Perl can be built to use the SOCKS proxy protocol library. To do so,
3852 Configure must be run with -Dusesocks.
3854 If this doesn't make any sense to you, just accept the default '$dflt'.
3856 rp='Build Perl for SOCKS?'
3859 y|Y) val="$define" ;;
3865 : Looking for optional libraries
3867 echo "Checking for optional libraries..." >&4
3872 case "$libswanted" in
3873 '') libswanted='c_s';;
3876 "$define") libswanted="$libswanted socks5 socks5_sh" ;;
3882 for thisdir in $libpth $xlibpth; do
3883 test -d $thisdir && libspath="$libspath $thisdir"
3885 for thislib in $libswanted; do
3886 for thisdir in $libspath; do
3888 if $test ! -f "$xxx" -a "X$ignore_versioned_solibs" = "X"; then
3889 xxx=`ls $thisdir/lib$thislib.$so.[0-9] 2>/dev/null|tail -1`
3890 $test -f "$xxx" && eval $libscheck
3891 $test -f "$xxx" && libstyle=shared
3893 if test ! -f "$xxx"; then
3894 xxx=$thisdir/lib$thislib.$so
3895 $test -f "$xxx" && eval $libscheck
3896 $test -f "$xxx" && libstyle=shared
3898 if test ! -f "$xxx"; then
3899 xxx=$thisdir/lib$thislib$_a
3900 $test -f "$xxx" && eval $libscheck
3901 $test -f "$xxx" && libstyle=static
3903 if test ! -f "$xxx"; then
3904 xxx=$thisdir/$thislib$_a
3905 $test -f "$xxx" && eval $libscheck
3906 $test -f "$xxx" && libstyle=static
3908 if test ! -f "$xxx"; then
3909 xxx=$thisdir/lib${thislib}_s$_a
3910 $test -f "$xxx" && eval $libscheck
3911 $test -f "$xxx" && libstyle=static
3912 $test -f "$xxx" && thislib=${thislib}_s
3914 if test ! -f "$xxx"; then
3915 xxx=$thisdir/Slib$thislib$_a
3916 $test -f "$xxx" && eval $libscheck
3917 $test -f "$xxx" && libstyle=static
3919 if $test -f "$xxx"; then
3921 shared) echo "Found -l$thislib (shared)." ;;
3922 static) echo "Found -l$thislib." ;;
3923 *) echo "Found -l$thislib ($libstyle)." ;;
3927 *) dflt="$dflt -l$thislib"
3928 libsfound="$libsfound $xxx"
3930 libsfiles="$libsfiles $yyy"
3931 yyy=`echo $xxx|$sed -e "s%/$yyy\\$%%"`
3932 case " $libsdirs " in
3934 *) libsdirs="$libsdirs $yyy" ;;
3941 if $test ! -f "$xxx"; then
3942 echo "No -l$thislib."
3953 ' '|'') dflt='none';;
3958 In order to compile $package on your machine, a number of libraries
3959 are usually needed. Include any other special libraries here as well.
3960 Say "none" for none. The default list is almost always right.
3964 rp="What libraries to use?"
3971 : determine optimization, if desired, or use for debug flag also
3973 ' '|$undef) dflt='none';;
3975 *) dflt="$optimize";;
3979 By default, $package compiles with the -O flag to use the optimizer.
3980 Alternately, you might want to use the symbolic debugger, which uses
3981 the -g flag (on traditional Unix systems). Either flag can be
3982 specified here. To use neither flag, specify the word "none".
3985 rp="What optimizer/debugger flag should be used?"
3989 'none') optimize=" ";;
3993 : We will not override a previous value, but we might want to
3994 : augment a hint file
3996 default|recommended)
3997 case "$gccversion" in
3998 1*) dflt='-fpcc-struct-return' ;;
4001 *-g*) dflt="$dflt -DDEBUGGING";;
4003 case "$gccversion" in
4004 2*) if test -d /etc/conf/kconfig.d &&
4005 $contains _POSIX_VERSION $usrinc/sys/unistd.h >/dev/null 2>&1
4011 case "$gccversion" in
4015 echo "Checking if your compiler accepts -fno-strict-aliasing" 2>&1
4016 echo 'int main(void) { return 0; }' > gcctest.c
4017 if $cc -O2 -fno-strict-aliasing -o gcctest gcctest.c; then
4018 echo "Yes, it does." 2>&1
4021 echo "Leaving current flags $ccflags alone." 2>&1
4023 *) dflt="$dflt -fno-strict-aliasing" ;;
4026 echo "Nope, it doesn't, but that's ok." 2>&1
4033 case "$mips_type" in
4034 *BSD*|'') inclwanted="$locincpth $usrinc";;
4035 *) inclwanted="$locincpth $inclwanted $usrinc/bsd";;
4037 for thisincl in $inclwanted; do
4038 if $test -d $thisincl; then
4039 if $test x$thisincl != x$usrinc; then
4042 *) dflt="$dflt -I$thisincl";;
4048 inctest='if $contains $2 $usrinc/$1 >/dev/null 2>&1; then
4050 elif $contains $2 $usrinc/sys/$1 >/dev/null 2>&1; then
4058 *) dflt="$dflt -D$2";;
4062 set signal.h LANGUAGE_C; eval $inctest
4066 ccflags="$ccflags -DSOCKS"
4071 default|recommended) dflt="$ccflags $dflt" ;;
4072 *) dflt="$ccflags";;
4080 Your C compiler may want other flags. For this question you should include
4081 -I/whatever and -DWHATEVER flags and any other flags used by the C compiler,
4082 but you should NOT include libraries or ld flags like -lwhatever. If you
4083 want $package to honor its debug switch, you should include -DDEBUGGING here.
4084 Your C compiler might also need additional flags, such as -D_POSIX_SOURCE.
4086 To use no flags, specify the word "none".
4092 rp="Any additional cc flags?"
4099 : the following weeds options from ccflags that are of no interest to cpp
4101 case "$gccversion" in
4102 1*) cppflags="$cppflags -D__GNUC__"
4104 case "$mips_type" in
4106 *BSD*) cppflags="$cppflags -DSYSTYPE_BSD43";;
4112 echo "Let me guess what the preprocessor flags are..." >&4
4126 *) ftry="$previous $flag";;
4128 if $cppstdin -DLFRULB=bar $cppflags $ftry $cppminus <cpp.c \
4129 >cpp1.out 2>/dev/null && \
4130 $cpprun -DLFRULB=bar $cppflags $ftry $cpplast <cpp.c \
4131 >cpp2.out 2>/dev/null && \
4132 $contains 'foo.*xx.*bar' cpp1.out >/dev/null 2>&1 && \
4133 $contains 'foo.*xx.*bar' cpp2.out >/dev/null 2>&1
4135 cppflags="$cppflags $ftry"
4145 *-*) echo "They appear to be: $cppflags";;
4147 $rm -f cpp.c cpp?.out
4151 : flags used in final linking phase
4153 '') if ./venix; then
4159 *-posix*) dflt="$dflt -posix" ;;
4162 *) dflt="$ldflags";;
4165 : Try to guess additional flags to pick up local libraries.
4166 for thislibdir in $libpth; do
4167 case " $loclibpth " in
4170 *"-L$thislibdir "*) ;;
4171 *) dflt="$dflt -L$thislibdir" ;;
4183 Your C linker may need flags. For this question you should
4184 include -L/whatever and any other flags used by the C linker, but you
4185 should NOT include libraries like -lwhatever.
4187 Make sure you include the appropriate -L/path flags if your C linker
4188 does not normally search all of the directories you specified above,
4191 To use no flags, specify the word "none".
4195 rp="Any additional ld flags (NOT including libraries)?"
4201 rmlist="$rmlist pdp11"
4205 echo "Checking your choice of C compiler and flags for coherency..." >&4
4206 $cat > try.c <<'EOF'
4208 int main() { printf("Ok\n"); exit(0); }
4210 set X $cc $optimize $ccflags -o try $ldflags try.c $libs
4212 $cat >try.msg <<'EOM'
4213 I've tried to compile and run the following simple program:
4216 $cat try.c >> try.msg
4218 $cat >> try.msg <<EOM
4225 and I got the following output:
4229 if sh -c "$cc $optimize $ccflags -o try $ldflags try.c $libs" >>try.msg 2>&1; then
4230 if sh -c './try' >>try.msg 2>&1; then
4234 *) echo 'The program compiled OK, but produced no output.' >> try.msg
4237 cat >> try.msg <<'EOQS'
4238 If $libs contains -lsfio, and sfio is mis-configured, then it
4239 sometimes (apparently) runs and exits with a 0 status, but with no
4240 output! It may have to do with sfio's use of _exit vs. exit.
4243 rp="You have a big problem. Shall I abort Configure"
4250 echo "The program compiled OK, but exited with status $?." >>try.msg
4251 rp="You have a problem. Shall I abort Configure"
4255 echo "I can't compile the test program." >>try.msg
4256 rp="You have a BIG problem. Shall I abort Configure"
4262 case "$knowitall" in
4264 echo "(The supplied flags or libraries might be incorrect.)"
4272 *) echo "Ok. Stopping Configure." >&4
4277 n) echo "OK, that should do.";;
4279 $rm -f try try.* core
4281 : define an is-a-typedef? function
4282 typedef='type=$1; var=$2; def=$3; shift; shift; shift; inclist=$@;
4284 "") inclist="sys/types.h";;
4286 eval "varval=\$$var";
4290 for inc in $inclist; do
4291 echo "#include <$inc>" >>temp.c;
4293 echo "#ifdef $type" >> temp.c;
4294 echo "printf(\"We have $type\");" >> temp.c;
4295 echo "#endif" >> temp.c;
4296 $cppstdin $cppflags $cppminus < temp.c >temp.E 2>/dev/null;
4297 if $contains $type temp.E >/dev/null 2>&1; then
4303 *) eval "$var=\$varval";;
4306 : define an is-a-typedef? function that prompts if the type is not available.
4307 typedef_ask='type=$1; var=$2; def=$3; shift; shift; shift; inclist=$@;
4309 "") inclist="sys/types.h";;
4311 eval "varval=\$$var";
4315 for inc in $inclist; do
4316 echo "#include <$inc>" >>temp.c;
4318 echo "#ifdef $type" >> temp.c;
4319 echo "printf(\"We have $type\");" >> temp.c;
4320 echo "#endif" >> temp.c;
4321 $cppstdin $cppflags $cppminus < temp.c >temp.E 2>/dev/null;
4323 echo "$rp" | $sed -e "s/What is/Looking for/" -e "s/?/./";
4324 if $contains $type temp.E >/dev/null 2>&1; then
4325 echo "$type found." >&4;
4328 echo "$type NOT found." >&4;
4334 *) eval "$var=\$varval";;
4337 : define a shorthand compile call
4341 $cc $optimize $ccflags $ldflags -o ${mc_file} $* ${mc_file}.c $libs > /dev/null 2>&1;'
4342 : define a shorthand compile call for compilations that should be ok.
4346 $cc $optimize $ccflags $ldflags -o ${mc_file} $* ${mc_file}.c $libs;'
4348 : check for lengths of integral types
4352 echo "Checking to see how big your integers are..." >&4
4353 $cat >intsize.c <<'EOCP'
4357 printf("intsize=%d;\n", (int)sizeof(int));
4358 printf("longsize=%d;\n", (int)sizeof(long));
4359 printf("shortsize=%d;\n", (int)sizeof(short));
4364 if eval $compile_ok && ./intsize > /dev/null; then
4366 echo "Your integers are $intsize bytes long."
4367 echo "Your long integers are $longsize bytes long."
4368 echo "Your short integers are $shortsize bytes long."
4372 Help! I can't compile and run the intsize test program: please enlighten me!
4373 (This is probably a misconfiguration in your system or libraries, and
4374 you really ought to fix it. Still, I'll try anyway.)
4378 rp="What is the size of an integer (in bytes)?"
4382 rp="What is the size of a long integer (in bytes)?"
4386 rp="What is the size of a short integer (in bytes)?"
4392 $rm -f intsize intsize.*
4394 : see what type lseek is declared as in the kernel
4395 rp="What is the type used for lseek's offset on this system?"
4396 set off_t lseektype long stdio.h sys/types.h
4400 echo "Checking to see how big your file offsets are..." >&4
4402 #include <sys/types.h>
4406 printf("%d\n", (int)sizeof($lseektype));
4411 if eval $compile_ok; then
4413 echo "Your file offsets are $lseeksize bytes long."
4417 echo "(I can't seem to compile the test program. Guessing...)"
4418 rp="What is the size of your file offsets (in bytes)?"
4424 : see what type file positions are declared as in the library
4425 rp="What is the type for file position used by fsetpos()?"
4426 set fpos_t fpostype long stdio.h sys/types.h
4431 *_t) zzz="$fpostype" ;;
4434 echo "Checking the size of $zzz..." >&4
4436 #include <sys/types.h>
4439 printf("%d\n", (int)sizeof($fpostype));
4444 if eval $compile_ok; then
4448 echo "(I can't execute the test program--guessing $fpossize.)" >&4
4451 echo "Your $zzz is $fpossize bytes long."
4457 echo "(I can't compile the test program. Guessing...)" >&4
4458 rp="What is the size of your file positions (in bytes)?"
4465 # Backward compatibility (uselfs is deprecated).
4467 "$define"|true|[yY]*)
4470 *** Configure -Duselfs is deprecated, using -Duselargefiles instead.
4472 uselargefiles="$define"
4476 case "$lseeksize:$fpossize" in
4479 You can have files larger than 2 gigabytes.
4482 *) case "$uselargefiles" in
4483 "$undef"|false|[nN]*) dflt='n' ;;
4488 Perl can be built to understand large files (files larger than 2 gigabytes)
4489 on some systems. To do so, Configure can be run with -Duselargefiles.
4491 If this doesn't make any sense to you, just accept the default '$dflt'.
4493 rp='Try to understand large files, if available?'
4496 y|Y) val="$define" ;;
4503 case "$uselargefiles" in
4505 : Look for a hint-file generated 'call-back-unit'. If the
4506 : user has specified that a large files perl is to be built,
4507 : we may need to set or change some other defaults.
4508 if $test -f uselargefiles.cbu; then
4509 echo "Your platform has some specific hints for large file builds, using them..."
4510 . ./uselargefiles.cbu
4512 echo "Rechecking to see how big your file offsets are..." >&4
4514 #include <sys/types.h>
4518 printf("%d\n", (int)sizeof($lseektype));
4523 if eval $compile_ok; then
4525 $echo "Your file offsets are now $lseeksize bytes long."
4529 echo "(I can't seem to compile the test program. Guessing...)"
4530 rp="What is the size of your file offsets (in bytes)?"
4535 *_t) zzz="$fpostype" ;;
4538 $echo $n "Rechecking the size of $zzz...$c" >&4
4540 #include <sys/types.h>
4543 printf("%d\n", (int)sizeof($fpostype));
4548 if eval $compile_ok; then
4553 echo "(I can't execute the test program--guessing $fpossize.)" >&4
4556 echo " $fpossize bytes." >&4
4562 echo "(I can't compile the test program. Guessing...)" >&4
4563 rp="What is the size of your file positions (in bytes)?"
4573 case "$usemorebits" in
4574 "$define"|true|[yY]*)
4575 use64bitint="$define"
4576 uselongdouble="$define"
4577 usemorebits="$define"
4579 *) usemorebits="$undef"
4584 case "$uselonglong" in
4585 "$define"|true|[yY]*)
4588 *** Configure -Duselonglong is deprecated, using -Duse64bitint instead.
4590 use64bitint="$define"
4593 case "$use64bits" in
4594 "$define"|true|[yY]*)
4597 *** Configure -Duse64bits is deprecated, using -Duse64bitint instead.
4599 use64bitint="$define"
4602 case "$use64bitints" in
4603 "$define"|true|[yY]*)
4606 *** There is no Configure -Duse64bitints, using -Duse64bitint instead.
4608 use64bitint="$define"
4611 case "$use64bitsint" in
4612 "$define"|true|[yY]*)
4615 *** There is no Configure -Duse64bitsint, using -Duse64bitint instead.
4617 use64bitint="$define"
4620 case "$uselonglongs" in
4621 "$define"|true|[yY]*)
4624 *** There is no Configure -Duselonglongs, using -Duse64bitint instead.
4626 use64bitint="$define"
4629 case "$use64bitsall" in
4630 "$define"|true|[yY]*)
4633 *** There is no Configure -Duse64bitsall, using -Duse64bitall instead.
4635 use64bitall="$define"
4640 *-DUSE_LONG_LONG*|*-DUSE_64_BIT_INT*|*-DUSE_64_BIT_ALL*) use64bitint="$define";;
4642 case "$use64bitall" in
4643 "$define"|true|[yY]*) use64bitint="$define" ;;
4649 You have natively 64-bit long integers.
4653 *) case "$use64bitint" in
4654 "$define"|true|[yY]*) dflt='y';;
4659 Perl can be built to take advantage of 64-bit integer types
4660 on some systems. To do so, Configure can be run with -Duse64bitint.
4661 Choosing this option will most probably introduce binary incompatibilities.
4663 If this doesn't make any sense to you, just accept the default '$dflt'.
4665 rp='Try to use 64-bit integers, if available?'
4668 [yY]*) val="$define" ;;
4676 case "$use64bitall" in
4677 "$define"|true|[yY]*) dflt='y' ;;
4678 *) case "$longsize" in
4686 You may also choose to try maximal 64-bitness. It means using as much
4687 64-bitness as possible on the platform. This in turn means even more
4688 binary incompatibilities. On the other hand, your platform may not
4689 have any more 64-bitness available than what you already have chosen.
4691 If this doesn't make any sense to you, just accept the default '$dflt'.
4693 rp='Try to use maximal 64-bit support, if available?'
4696 [yY]*) val="$define" ;;
4701 case "$use64bitall" in
4703 case "$use64bitint" in
4707 Since you have chosen a maximally 64-bit build, I'm also turning on
4708 the use of 64-bit integers.
4710 use64bitint="$define" ;;
4715 case "$use64bitint" in
4716 "$define"|true|[yY]*)
4717 : Look for a hint-file generated 'call-back-unit'. If the
4718 : user has specified that a 64-bit perl is to be built,
4719 : we may need to set or change some other defaults.
4720 if $test -f use64bitint.cbu; then
4721 echo "Your platform has some specific hints for 64-bit integers, using them..."
4725 4) case "$archname64" in
4726 '') archname64=64int ;;
4733 case "$use64bitall" in
4734 "$define"|true|[yY]*)
4735 : Look for a hint-file generated 'call-back-unit'. If the
4736 : user has specified that a maximally 64-bit perl is to be built,
4737 : we may need to set or change some other defaults.
4738 if $test -f use64bitall.cbu; then
4739 echo "Your platform has some specific hints for 64-bit builds, using them..."
4743 4) case "$archname64" in
4744 ''|64int) archname64=64all ;;
4751 : determine the architecture name
4753 if xxx=`./loc arch blurfl $pth`; $test -f "$xxx"; then
4754 tarch=`arch`"-$osname"
4755 elif xxx=`./loc uname blurfl $pth`; $test -f "$xxx" ; then
4756 if uname -m > tmparch 2>&1 ; then
4757 tarch=`$sed -e 's/ *$//' -e 's/ /_/g' \
4758 -e 's/$/'"-$osname/" tmparch`
4766 case "$myarchname" in
4769 echo "(Your architecture name used to be $myarchname.)"
4776 *) dflt="$archname";;
4778 rp='What is your architecture name'
4781 case "$usethreads" in
4783 echo "Threads selected." >&4
4785 *-thread*) echo "...and architecture name already has -thread." >&4
4787 *) archname="$archname-thread"
4788 echo "...setting architecture name to $archname." >&4
4793 case "$usemultiplicity" in
4795 echo "Multiplicity selected." >&4
4797 *-multi*) echo "...and architecture name already has -multi." >&4
4799 *) archname="$archname-multi"
4800 echo "...setting architecture name to $archname." >&4
4805 case "$use64bitint" in
4807 case "$archname64" in
4812 *-$archname64*) echo "...and architecture name already has $archname64." >&4
4814 *) archname="$archname-$archname64"
4815 echo "...setting architecture name to $archname." >&4
4822 : determine root of directory hierarchy where package will be installed.
4825 dflt=`./loc . /usr/local /usr/local /local /opt /usr`
4833 By default, $package will be installed in $dflt/bin, manual pages
4834 under $dflt/man, etc..., i.e. with $dflt as prefix for all
4835 installation directories. Typically this is something like /usr/local.
4836 If you wish to have binaries under /usr/bin but other parts of the
4837 installation under /usr/local, that's ok: you will be prompted
4838 separately for each of the installation directories, the prefix being
4839 only used to set the defaults.
4843 rp='Installation prefix to use?'
4851 *) oldprefix="$prefix";;
4861 $define|true) afs=true ;;
4862 $undef|false) afs=false ;;
4863 *) if test -d /afs; then
4871 echo "AFS may be running... I'll be extra cautious then..." >&4
4873 echo "AFS does not seem to be running..." >&4
4876 : determine installation prefix for where package is to be installed.
4880 Since you are running AFS, I need to distinguish the directory in which
4881 files will reside from the directory in which they are installed (and from
4882 which they are presumably copied to the former directory by occult means).
4885 case "$installprefix" in
4886 '') dflt=`echo $prefix | sed 's#^/afs/#/afs/.#'`;;
4887 *) dflt="$installprefix";;
4892 In some special cases, particularly when building $package for distribution,
4893 it is convenient to distinguish between the directory in which files should
4894 be installed from the directory ($prefix) in which they
4895 will eventually reside. For most users, these two directories are the same.
4898 case "$installprefix" in
4900 *) dflt=$installprefix;;
4904 rp='What installation prefix should I use for installing files?'
4906 installprefix="$ans"
4907 installprefixexp="$ansexp"
4909 : set the prefixit variable, to compute a suitable default value
4910 prefixit='case "$3" in
4912 case "$oldprefix" in
4913 "") eval "$1=\"\$$2\"";;
4920 ""|" ") eval "$1=\"\$$2\"";;
4926 eval "tp=\"$oldprefix-\$$2-\""; eval "tp=\"$tp\"";
4928 --|/*--|\~*--) eval "$1=\"$prefix/$3\"";;
4929 /*-$oldprefix/*|\~*-$oldprefix/*)
4930 eval "$1=\`echo \$$2 | sed \"s,^$oldprefix,$prefix,\"\`";;
4931 *) eval "$1=\"\$$2\"";;
4936 : get the patchlevel
4938 echo "Getting the current patchlevel..." >&4
4939 if $test -r $rsrc/patchlevel.h;then
4940 revision=`awk '/define[ ]+PERL_REVISION/ {print $3}' $rsrc/patchlevel.h`
4941 patchlevel=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
4942 subversion=`awk '/define[ ]+PERL_SUBVERSION/ {print $3}' $rsrc/patchlevel.h`
4943 api_revision=`awk '/define[ ]+PERL_API_REVISION/ {print $3}' $rsrc/patchlevel.h`
4944 api_version=`awk '/define[ ]+PERL_API_VERSION/ {print $3}' $rsrc/patchlevel.h`
4945 api_subversion=`awk '/define[ ]+PERL_API_SUBVERSION/ {print $3}' $rsrc/patchlevel.h`
4954 $echo $n "(You have $package revision $revision" $c
4955 $echo $n " patchlevel $patchlevel" $c
4956 test 0 -eq "$subversion" || $echo $n " subversion $subversion" $c
4960 : XXX Should be a Configure test for double-dots in filenames.
4961 version=`echo $revision $patchlevel $subversion | \
4962 $awk '{ printf "%d_%d_%d\n", $1, $2, $3 }'`
4963 api_versionstring=`echo $api_revision $api_version $api_subversion | \
4964 $awk '{ printf "%d_%d_%d\n", $1, $2, $3 }'`
4967 version=`echo $revision $patchlevel $subversion | \
4968 $awk '{ printf "%d.%d.%d\n", $1, $2, $3 }'`
4969 api_versionstring=`echo $api_revision $api_version $api_subversion | \
4970 $awk '{ printf "%d.%d.%d\n", $1, $2, $3 }'`
4973 : Special case the 5.005_xx maintenance series, which used 5.005
4974 : without any subversion label as a subdirectory in $sitelib
4975 if test "${api_revision}${api_version}${api_subversion}" = "550"; then
4976 api_versionstring='5.005'
4979 : determine installation style
4980 : For now, try to deduce it from prefix unless it is already set.
4981 : Reproduce behavior of 5.005 and earlier, maybe drop that in 5.7.
4982 case "$installstyle" in
4983 '') case "$prefix" in
4984 *perl*) dflt='lib';;
4985 *) dflt='lib/perl5' ;;
4988 *) dflt="$installstyle" ;;
4990 : Probably not worth prompting for this since we prompt for all
4991 : the directories individually, and the prompt would be too long and
4995 : determine where private library files go
4996 : Usual default is /usr/local/lib/perl5/$version.
4997 : Also allow things like /opt/perl/lib/$version, since
4998 : /opt/perl/lib/perl5... would be redundant.
4999 : The default "style" setting is made in installstyle.U
5000 case "$installstyle" in
5001 *lib/perl5*) set dflt privlib lib/$package/$version ;;
5002 *) set dflt privlib lib/$version ;;
5007 There are some auxiliary files for $package that need to be put into a
5008 private library directory that is accessible by everyone.
5012 rp='Pathname where the private library files will reside?'
5015 privlibexp="$ansexp"
5016 : Change installation prefix, if necessary.
5017 if $test X"$prefix" != X"$installprefix"; then
5018 installprivlib=`echo $privlibexp | sed "s#^$prefix#$installprefix#"`
5020 installprivlib="$privlibexp"
5023 : set the prefixup variable, to restore leading tilda escape
5024 prefixup='case "$prefixexp" in
5026 *) eval "$1=\`echo \$$1 | sed \"s,^$prefixexp,$prefix,\"\`";;
5029 : determine where public architecture dependent libraries go
5032 : privlib default is /usr/local/lib/$package/$version
5033 : archlib default is /usr/local/lib/$package/$version/$archname
5034 : privlib may have an optional trailing /share.
5035 tdflt=`echo $privlib | $sed 's,/share$,,'`
5036 tdflt=$tdflt/$archname
5045 $spackage contains architecture-dependent library files. If you are
5046 sharing libraries in a heterogeneous environment, you might store
5047 these files in a separate location. Otherwise, you can just include
5048 them with the rest of the public library files.
5052 rp='Where do you want to put the public architecture-dependent libraries?'
5055 archlibexp="$ansexp"
5056 if $test X"$archlib" = X"$privlib"; then
5061 : Change installation prefix, if necessary.
5062 if $test X"$prefix" != X"$installprefix"; then
5063 installarchlib=`echo $archlibexp | sed "s#^$prefix#$installprefix#"`
5065 installarchlib="$archlibexp"
5069 : Binary compatibility with 5.005 is not possible for builds
5070 : with advanced features
5071 case "$usethreads$usemultiplicity" in
5073 bincompat5005="$undef"
5074 d_bincompat5005="$undef"
5078 This version of Perl can be compiled for binary compatibility with 5.005.
5079 If you decide to do so, you will be able to continue using most of the
5080 extensions that were compiled for Perl 5.005.
5083 case "$bincompat5005$d_bincompat5005" in
5084 *"$undef"*) dflt=n ;;
5087 rp='Binary compatibility with Perl 5.005?'
5090 y*) val="$define" ;;
5095 case "$d_bincompat5005" in
5097 bincompat5005="$define"
5099 *) bincompat5005="$undef"
5100 d_bincompat5005="$undef"
5107 : see if setuid scripts can be secure
5110 Some kernels have a bug that prevents setuid #! scripts from being
5111 secure. Some sites have disabled setuid #! scripts because of this.
5113 First let's decide if your kernel supports secure setuid #! scripts.
5114 (If setuid #! scripts would be secure but have been disabled anyway,
5115 don't say that they are secure if asked.)
5120 if $test -d /dev/fd; then
5121 echo "#!$ls" >reflect
5122 chmod +x,u+s reflect
5123 ./reflect >flect 2>&1
5124 if $contains "/dev/fd" flect >/dev/null; then
5125 echo "Congratulations, your kernel has secure setuid scripts!" >&4
5129 If you are not sure if they are secure, I can check but I'll need a
5130 username and password different from the one you are using right now.
5131 If you don't have such a username or don't want me to test, simply
5135 rp='Other username to test security of setuid scripts with?'
5140 case "$d_suidsafe" in
5141 '') echo "I'll assume setuid scripts are *not* secure." >&4
5144 echo "Well, the $hint value is *not* secure." >&4
5146 *) echo "Well, the $hint value *is* secure." >&4
5151 $rm -f reflect flect
5152 echo "#!$ls" >reflect
5153 chmod +x,u+s reflect
5156 echo '"su" will (probably) prompt you for '"$ans's password."
5157 su $ans -c './reflect >flect'
5158 if $contains "/dev/fd" flect >/dev/null; then
5159 echo "Okay, it looks like setuid scripts are secure." >&4
5162 echo "I don't think setuid scripts are secure." >&4
5167 rp='Does your kernel have *secure* setuid scripts?'
5170 [yY]*) val="$define";;
5175 echo "I don't think setuid scripts are secure (no /dev/fd directory)." >&4
5176 echo "(That's for file descriptors, not floppy disks.)"
5182 $rm -f reflect flect
5184 : now see if they want to do setuid emulation
5187 case "$d_suidsafe" in
5190 echo "No need to emulate SUID scripts since they are secure here." >& 4
5194 Some systems have disabled setuid scripts, especially systems where
5195 setuid scripts cannot be secure. On systems where setuid scripts have
5196 been disabled, the setuid/setgid bits on scripts are currently
5197 useless. It is possible for $package to detect those bits and emulate
5198 setuid/setgid in a secure fashion. This emulation will only work if
5199 setuid scripts have been disabled in your kernel.
5203 "$define") dflt=y ;;
5206 rp="Do you want to do setuid/setgid emulation?"
5209 [yY]*) val="$define";;
5217 : determine filename position in cpp output
5219 echo "Computing filename position in cpp output for #include directives..." >&4
5220 echo '#include <stdio.h>' > foo.c
5223 $cppstdin $cppflags $cppminus <foo.c 2>/dev/null | \
5224 $grep '^[ ]*#.*stdio\.h' | \
5225 while read cline; do
5228 while $test \$# -gt 0; do
5229 if $test -r \`echo \$1 | $tr -d '"'\`; then
5234 pos=\`expr \$pos + 1\`
5246 *) pos="${fieldn}th";;
5248 echo "Your cpp writes the filename in the $pos field of the line."
5250 : locate header file
5255 for usrincdir in $usrinc
5257 if test -f \$usrincdir/\$wanted; then
5258 echo "\$usrincdir/\$wanted"
5262 awkprg='{ print \$$fieldn }'
5263 echo "#include <\$wanted>" > foo\$\$.c
5264 $cppstdin $cppminus $cppflags < foo\$\$.c 2>/dev/null | \
5265 $grep "^[ ]*#.*\$wanted" | \
5266 while read cline; do
5267 name=\`echo \$cline | $awk "\$awkprg" | $tr -d '"'\`
5269 *[/\\\\]\$wanted) echo "\$name"; exit 1;;
5270 *[\\\\/]\$wanted) echo "\$name"; exit 1;;
5275 # status = 0: grep returned 0 lines, case statement not executed
5276 # status = 1: headerfile found
5277 # status = 2: while loop executed, no headerfile found
5281 if test \$status -eq 1; then
5288 : define an alternate in-header-list? function
5289 inhdr='echo " "; td=$define; tu=$undef; yyy=$@;
5290 cont=true; xxf="echo \"<\$1> found.\" >&4";
5291 case $# in 2) xxnf="echo \"<\$1> NOT found.\" >&4";;
5292 *) xxnf="echo \"<\$1> NOT found, ...\" >&4";;
5294 case $# in 4) instead=instead;; *) instead="at last";; esac;
5295 while $test "$cont"; do
5297 var=$2; eval "was=\$$2";
5298 if $test "$xxx" && $test -r "$xxx";
5300 eval "case \"\$$var\" in $undef) . ./whoa; esac"; eval "$var=\$td";
5303 eval "case \"\$$var\" in $define) . ./whoa; esac"; eval "$var=\$tu"; fi;
5304 set $yyy; shift; shift; yyy=$@;
5305 case $# in 0) cont="";;
5306 2) xxf="echo \"but I found <\$1> $instead.\" >&4";
5307 xxnf="echo \"and I did not find <\$1> either.\" >&4";;
5308 *) xxf="echo \"but I found <\$1\> instead.\" >&4";
5309 xxnf="echo \"there is no <\$1>, ...\" >&4";;
5313 do set $yyy; var=$2; eval "was=\$$2";
5314 eval "case \"\$$var\" in $define) . ./whoa; esac"; eval "$var=\$tu";
5315 set $yyy; shift; shift; yyy=$@;
5318 : see if this is a malloc.h system
5319 set malloc.h i_malloc
5322 : see if stdlib is available
5323 set stdlib.h i_stdlib
5326 : determine which malloc to compile in
5328 case "$usemymalloc" in
5329 ''|[yY]*|true|$define) dflt='y' ;;
5332 rp="Do you wish to attempt to use the malloc that comes with $package?"
5338 mallocsrc='malloc.c'
5339 mallocobj="malloc$_o"
5340 d_mymalloc="$define"
5343 : Remove malloc from list of libraries to use
5344 echo "Removing unneeded -lmalloc from library list" >&4
5345 set `echo X $libs | $sed -e 's/-lmalloc / /' -e 's/-lmalloc$//'`
5348 echo "libs = $libs" >&4
5360 : compute the return types of malloc and free
5362 $cat >malloc.c <<END
5366 #include <sys/types.h>
5380 case "$malloctype" in
5382 if $cc $ccflags -c -DTRY_MALLOC malloc.c >/dev/null 2>&1; then
5389 echo "Your system wants malloc to return '$malloctype', it would seem." >&4
5393 if $cc $ccflags -c -DTRY_FREE malloc.c >/dev/null 2>&1; then
5400 echo "Your system uses $freetype free(), it would seem." >&4
5404 After $package is installed, you may wish to install various
5405 add-on modules and utilities. Typically, these add-ons will
5406 be installed under $prefix with the rest
5407 of this package. However, you may wish to install such add-ons
5408 elsewhere under a different prefix.
5410 If you do not wish to put everything under a single prefix, that's
5411 ok. You will be prompted for the individual locations; this siteprefix
5412 is only used to suggest the defaults.
5414 The default should be fine for most people.
5418 rp='Installation prefix to use for add-on modules and utilities?'
5419 : XXX Here might be another good place for an installstyle setting.
5420 case "$siteprefix" in
5422 *) dflt=$siteprefix ;;
5425 : XXX Prefixit unit does not yet support siteprefix and vendorprefix
5427 case "$siteprefix" in
5431 *) oldsiteprefix="$prefix";;
5436 siteprefixexp="$ansexp"
5438 : determine where site specific libraries go.
5439 : Usual default is /usr/local/lib/perl5/site_perl/$version
5440 : The default "style" setting is made in installstyle.U
5441 : XXX No longer works with Prefixit stuff.
5442 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
5444 '') case "$installstyle" in
5445 *lib/perl5*) dflt=$siteprefix/lib/$package/site_$prog/$version ;;
5446 *) dflt=$siteprefix/lib/site_$prog/$version ;;
5454 The installation process will create a directory for
5455 site-specific extensions and modules. Most users find it convenient
5456 to place all site-specific files in this directory rather than in the
5457 main distribution directory.
5461 rp='Pathname for the site-specific library files?'
5464 sitelibexp="$ansexp"
5465 sitelib_stem=`echo "$sitelibexp" | sed "s,/$version$,,"`
5466 : Change installation prefix, if necessary.
5467 if $test X"$prefix" != X"$installprefix"; then
5468 installsitelib=`echo $sitelibexp | $sed "s#^$prefix#$installprefix#"`
5470 installsitelib="$sitelibexp"
5473 : determine where site specific architecture-dependent libraries go.
5474 : sitelib default is /usr/local/lib/perl5/site_perl/$version
5475 : sitearch default is /usr/local/lib/perl5/site_perl/$version/$archname
5476 : sitelib may have an optional trailing /share.
5478 '') dflt=`echo $sitelib | $sed 's,/share$,,'`
5479 dflt="$dflt/$archname"
5484 set sitearch sitearch none
5488 The installation process will also create a directory for
5489 architecture-dependent site-specific extensions and modules.
5493 rp='Pathname for the site-specific architecture-dependent library files?'
5496 sitearchexp="$ansexp"
5497 : Change installation prefix, if necessary.
5498 if $test X"$prefix" != X"$installprefix"; then
5499 installsitearch=`echo $sitearchexp | sed "s#^$prefix#$installprefix#"`
5501 installsitearch="$sitearchexp"
5506 The installation process will also create a directory for
5507 vendor-supplied add-ons. Vendors who supply perl with their system
5508 may find it convenient to place all vendor-supplied files in this
5509 directory rather than in the main distribution directory. This will
5510 ease upgrades between binary-compatible maintenance versions of perl.
5512 Of course you may also use these directories in whatever way you see
5513 fit. For example, you might use them to access modules shared over a
5514 company-wide network.
5516 The default answer should be fine for most people.
5517 This causes further questions about vendor add-ons to be skipped
5518 and no vendor-specific directories will be configured for perl.
5521 rp='Do you want to configure vendor-specific add-on directories?'
5522 case "$usevendorprefix" in
5523 define|true|[yY]*) dflt=y ;;
5524 *) : User may have set vendorprefix directly on Configure command line.
5525 case "$vendorprefix" in
5534 rp='Installation prefix to use for vendor-supplied add-ons?'
5535 case "$vendorprefix" in
5537 *) dflt=$vendorprefix ;;
5540 : XXX Prefixit unit does not yet support siteprefix and vendorprefix
5542 case "$vendorprefix" in
5546 *) oldvendorprefix="$prefix";;
5550 usevendorprefix="$define"
5552 vendorprefixexp="$ansexp"
5554 *) usevendorprefix="$undef"
5560 case "$vendorprefix" in
5561 '') d_vendorlib="$undef"
5565 *) d_vendorlib="$define"
5566 : determine where vendor-supplied modules go.
5567 : Usual default is /usr/local/lib/perl5/vendor_perl/$version
5568 case "$vendorlib" in
5570 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
5571 case "$installstyle" in
5572 *lib/perl5*) dflt=$vendorprefix/lib/$package/vendor_$prog/$version ;;
5573 *) dflt=$vendorprefix/lib/vendor_$prog/$version ;;
5576 *) dflt="$vendorlib"
5580 rp='Pathname for the vendor-supplied library files?'
5583 vendorlibexp="$ansexp"
5586 vendorlib_stem=`echo "$vendorlibexp" | sed "s,/$version$,,"`
5587 : Change installation prefix, if necessary.
5588 if $test X"$prefix" != X"$installprefix"; then
5589 installvendorlib=`echo $vendorlibexp | $sed "s#^$prefix#$installprefix#"`
5591 installvendorlib="$vendorlibexp"
5594 case "$vendorprefix" in
5595 '') d_vendorarch="$undef"
5599 *) d_vendorarch="$define"
5600 : determine where vendor-supplied architecture-dependent libraries go.
5601 : vendorlib default is /usr/local/lib/perl5/vendor_perl/$version
5602 : vendorarch default is /usr/local/lib/perl5/vendor_perl/$version/$archname
5603 : vendorlib may have an optional trailing /share.
5604 case "$vendorarch" in
5605 '') dflt=`echo $vendorlib | $sed 's,/share$,,'`
5606 dflt="$dflt/$archname"
5608 *) dflt="$vendorarch" ;;
5611 rp='Pathname for vendor-supplied architecture-dependent files?'
5614 vendorarchexp="$ansexp"
5617 : Change installation prefix, if necessary.
5618 if $test X"$prefix" != X"$installprefix"; then
5619 installvendorarch=`echo $vendorarchexp | sed "s#^$prefix#$installprefix#"`
5621 installvendorarch="$vendorarchexp"
5624 : Final catch-all directories to search
5627 Lastly, you can have perl look in other directories for extensions and
5628 modules in addition to those already specified.
5629 These directories will be searched after
5633 test X"$vendorlib" != "X" && echo ' ' $vendorlib
5634 test X"$vendorarch" != "X" && echo ' ' $vendorarch
5636 case "$otherlibdirs" in
5637 ''|' ') dflt='none' ;;
5638 *) dflt="$otherlibdirs" ;;
5641 Enter a colon-separated set of extra paths to include in perl's @INC
5642 search path, or enter 'none' for no extra paths.
5646 rp='Colon-separated list of additional directories for perl to search?'
5649 ' '|''|none) otherlibdirs=' ' ;;
5650 *) otherlibdirs="$ans" ;;
5652 case "$otherlibdirs" in
5656 set d_perl_otherlibdirs
5659 : Cruising for prototypes
5661 echo "Checking out function prototypes..." >&4
5662 $cat >prototype.c <<'EOCP'
5663 int main(int argc, char *argv[]) {
5666 if $cc $ccflags -c prototype.c >prototype.out 2>&1 ; then
5667 echo "Your C compiler appears to support function prototypes."
5670 echo "Your C compiler doesn't seem to understand function prototypes."
5677 case "$prototype" in
5679 *) ansi2knr='ansi2knr'
5684 This version of $package can only be compiled by a compiler that
5685 understands function prototypes. Unfortunately, your C compiler
5687 doesn't seem to understand them. Sorry about that.
5689 If GNU cc is available for your system, perhaps you could try that instead.
5691 Eventually, we hope to support building Perl with pre-ANSI compilers.
5692 If you would like to help in that effort, please contact <perlbug@perl.org>.
5694 Aborting Configure now.
5700 : determine where public executables go
5705 rp='Pathname where the public executables will reside?'
5707 if $test "X$ansexp" != "X$binexp"; then
5712 : Change installation prefix, if necessary.
5713 : XXX Bug? -- ignores Configure -Dinstallprefix setting.
5714 if $test X"$prefix" != X"$installprefix"; then
5715 installbin=`echo $binexp | sed "s#^$prefix#$installprefix#"`
5717 installbin="$binexp"
5720 : Find perl5.005 or later.
5721 echo "Looking for a previously installed perl5.005 or later... "
5723 '') for tdir in `echo "$binexp:$PATH" | $sed "s/$path_sep/ /g"`; do
5724 : Check if this perl is recent and can load a simple module
5725 if $test -x $tdir/perl && $tdir/perl -Mless -e 'use 5.005;' >/dev/null 2>&1; then
5728 elif $test -x $tdir/perl5 && $tdir/perl5 -Mless -e 'use 5.005;' >/dev/null 2>&1; then
5738 '') echo "None found. That's ok.";;
5739 *) echo "Using $perl5." ;;
5742 : Determine list of previous versions to include in @INC
5743 $cat > getverlist <<EOPL
5746 \$api_versionstring = "$api_versionstring";
5747 \$version = "$version";
5748 \$stem = "$sitelib_stem";
5749 \$archname = "$archname";
5751 $cat >> getverlist <<'EOPL'
5752 # Can't have leading @ because metaconfig interprets it as a command!
5753 ;@inc_version_list=();
5754 # XXX Redo to do opendir/readdir?
5757 ;@candidates = glob("5.*");
5763 # XXX ToDo: These comparisons must be reworked when two-digit
5764 # subversions come along, so that 5.7.10 compares as greater than
5765 # 5.7.3! By that time, hope that 5.6.x is sufficiently
5766 # widespread that we can use the built-in version vectors rather
5767 # than reinventing them here. For 5.6.0, however, we must
5768 # assume this script will likely be run by 5.005_0x. --AD 1/2000.
5769 foreach $d (@candidates) {
5770 if ($d lt $version) {
5771 if ($d ge $api_versionstring) {
5772 unshift(@inc_version_list, grep { -d } "$d/$archname", $d);
5774 elsif ($d ge "5.005") {
5775 unshift(@inc_version_list, grep { -d } $d);
5779 # Skip newer version. I.e. don't look in
5780 # 5.7.0 if we're installing 5.6.1.
5784 if (@inc_version_list) {
5785 print join(' ', @inc_version_list);
5788 # Blank space to preserve value for next Configure run.
5793 case "$inc_version_list" in
5794 '') if test -x "$perl5"; then
5795 dflt=`$perl5 getverlist`
5800 $undef) dflt='none' ;;
5801 *) dflt="$inc_version_list" ;;
5804 ''|' ') dflt=none ;;
5808 In order to ease the process of upgrading, this version of perl
5809 can be configured to use modules built and installed with earlier
5810 versions of perl that were installed under $prefix. Specify here
5811 the list of earlier versions that this version of perl should check.
5812 If Configure detected no earlier versions of perl installed under
5813 $prefix, then the list will be empty. Answer 'none' to tell perl
5814 to not search earlier versions.
5816 The default should almost always be sensible, so if you're not sure,
5817 just accept the default.
5820 rp='List of earlier versions to include in @INC?'
5823 [Nn]one|''|' ') inc_version_list=' ' ;;
5824 *) inc_version_list="$ans" ;;
5826 case "$inc_version_list" in
5828 inc_version_list_init='0';;
5829 *) inc_version_list_init=`echo $inc_version_list |
5830 $sed -e 's/^/"/' -e 's/ /","/g' -e 's/$/",0/'`
5835 : determine whether to install perl also as /usr/bin/perl
5838 if $test -d /usr/bin -a "X$installbin" != X/usr/bin; then
5840 Many scripts expect perl to be installed as /usr/bin/perl.
5841 I can install the perl you are about to compile also as /usr/bin/perl
5842 (in addition to $installbin/perl).
5844 case "$installusrbinperl" in
5845 "$undef"|[nN]*) dflt='n';;
5848 rp="Do you want to install perl as /usr/bin/perl?"
5851 [yY]*) val="$define";;
5857 set installusrbinperl
5861 echo "Checking for GNU C Library..." >&4
5862 cat >gnulibc.c <<EOM
5874 if eval $compile_ok && ./gnulibc; then
5876 echo "You are using the GNU C Library"
5879 echo "You are not using the GNU C Library"
5885 : see if nm is to be used to determine whether a symbol is defined or not
5889 case "$d_gnulibc" in
5892 echo "nm probably won't work on the GNU C Library." >&4
5898 if $test "$osname" = aix -a ! -f /lib/syscalls.exp; then
5900 echo "Whoops! This is an AIX system without /lib/syscalls.exp!" >&4
5901 echo "'nm' won't be sufficient on this sytem." >&4
5907 '') dflt=`$egrep 'inlibc|csym' $rsrc/Configure | wc -l 2>/dev/null`
5908 if $test $dflt -gt 20; then
5918 true|$define) dflt=y;;
5925 I can use $nm to extract the symbols from your C libraries. This
5926 is a time consuming task which may generate huge output on the disk (up
5927 to 3 megabytes) but that should make the symbols extraction faster. The
5928 alternative is to skip the 'nm' extraction part and to compile a small
5929 test program instead to determine whether each symbol is present. If
5930 you have a fast C compiler and/or if your 'nm' output cannot be parsed,
5931 this may be the best solution.
5933 You probably shouldn't let me use 'nm' if you are using the GNU C Library.
5936 rp="Shall I use $nm to extract C symbols from the libraries?"
5939 [Nn]*) usenm=false;;
5948 : nm options which may be necessary
5950 '') if $test -f /mach_boot; then
5952 elif $test -d /usr/ccs/lib; then
5953 nm_opt='-p' # Solaris (and SunOS?)
5954 elif $test -f /dgux; then
5956 elif $test -f /lib64/rld; then
5957 nm_opt='-p' # 64-bit Irix
5963 : nm options which may be necessary for shared libraries but illegal
5964 : for archive libraries. Thank you, Linux.
5965 case "$nm_so_opt" in
5966 '') case "$myuname" in
5968 if $nm --help | $grep 'dynamic' > /dev/null 2>&1; then
5969 nm_so_opt='--dynamic'
5978 : get list of predefined functions in a handy place
5983 *-lc_s*) libc=`./loc libc_s$_a $libc $libpth`
5990 *) for thislib in $libs; do
5993 : Handle C library specially below.
5996 thislib=`echo $thislib | $sed -e 's/^-l//'`
5997 if try=`./loc lib$thislib.$so.'*' X $libpth`; $test -f "$try"; then
5999 elif try=`./loc lib$thislib.$so X $libpth`; $test -f "$try"; then
6001 elif try=`./loc lib$thislib$_a X $libpth`; $test -f "$try"; then
6003 elif try=`./loc $thislib$_a X $libpth`; $test -f "$try"; then
6005 elif try=`./loc lib$thislib X $libpth`; $test -f "$try"; then
6007 elif try=`./loc $thislib X $libpth`; $test -f "$try"; then
6009 elif try=`./loc Slib$thislib$_a X $xlibpth`; $test -f "$try"; then
6014 libnames="$libnames $try"
6016 *) libnames="$libnames $thislib" ;;
6025 for xxx in $libpth; do
6026 $test -r $1 || set $xxx/libc.$so
6027 : The messy sed command sorts on library version numbers.
6029 set `echo blurfl; echo $xxx/libc.$so.[0-9]* | \
6030 tr ' ' $trnl | egrep -v '\.[A-Za-z]*$' | $sed -e '
6032 s/[0-9][0-9]*/0000&/g
6033 s/0*\([0-9][0-9][0-9][0-9][0-9]\)/\1/g
6036 sort | $sed -e 's/^.* //'`
6039 $test -r $1 || set /usr/ccs/lib/libc.$so
6040 $test -r $1 || set /lib/libsys_s$_a
6046 if $test -r "$1"; then
6047 echo "Your (shared) C library seems to be in $1."
6049 elif $test -r /lib/libc && $test -r /lib/clib; then
6050 echo "Your C library seems to be in both /lib/clib and /lib/libc."
6052 libc='/lib/clib /lib/libc'
6053 if $test -r /lib/syslib; then
6054 echo "(Your math library is in /lib/syslib.)"
6055 libc="$libc /lib/syslib"
6057 elif $test -r "$libc" || (test -h "$libc") >/dev/null 2>&1; then
6058 echo "Your C library seems to be in $libc, as you said before."
6059 elif $test -r $incpath/usr/lib/libc$_a; then
6060 libc=$incpath/usr/lib/libc$_a;
6061 echo "Your C library seems to be in $libc. That's fine."
6062 elif $test -r /lib/libc$_a; then
6064 echo "Your C library seems to be in $libc. You're normal."
6066 if tans=`./loc libc$_a blurfl/dyick $libpth`; $test -r "$tans"; then
6068 elif tans=`./loc libc blurfl/dyick $libpth`; $test -r "$tans"; then
6069 libnames="$libnames "`./loc clib blurfl/dyick $libpth`
6070 elif tans=`./loc clib blurfl/dyick $libpth`; $test -r "$tans"; then
6072 elif tans=`./loc Slibc$_a blurfl/dyick $xlibpth`; $test -r "$tans"; then
6074 elif tans=`./loc Mlibc$_a blurfl/dyick $xlibpth`; $test -r "$tans"; then
6077 tans=`./loc Llibc$_a blurfl/dyick $xlibpth`
6079 if $test -r "$tans"; then
6080 echo "Your C library seems to be in $tans, of all places."
6086 if $test $xxx = apollo -o -r "$libc" || (test -h "$libc") >/dev/null 2>&1; then
6090 If the guess above is wrong (which it might be if you're using a strange
6091 compiler, or your machine supports multiple models), you can override it here.
6096 echo $libpth | tr ' ' $trnl | sort | uniq > libpath
6098 I can't seem to find your C library. I've looked in the following places:
6101 $sed 's/^/ /' libpath
6104 None of these seems to contain your C library. I need to get its name...
6109 rp='Where is your C library?'
6114 echo $libc $libnames | tr ' ' $trnl | sort | uniq > libnames
6115 set X `cat libnames`
6118 case $# in 1) xxx=file; esac
6119 echo "Extracting names from the following $xxx for later perusal:" >&4
6121 $sed 's/^/ /' libnames >&4
6123 $echo $n "This may take a while...$c" >&4
6127 *$so*) $nm $nm_so_opt $nm_opt $file 2>/dev/null;;
6128 *) $nm $nm_opt $file 2>/dev/null;;
6133 $grep fprintf libc.tmp > libc.ptf
6134 xscan='eval "<libc.ptf $com >libc.list"; $echo $n ".$c" >&4'
6135 xrun='eval "<libc.tmp $com >libc.list"; echo "done" >&4'
6137 if com="$sed -n -e 's/__IO//' -e 's/^.* $xxx *_[_.]*//p' -e 's/^.* $xxx *//p'";\
6139 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6141 elif com="$sed -n -e 's/^__*//' -e 's/^\([a-zA-Z_0-9$]*\).*xtern.*/\1/p'";\
6143 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6145 elif com="$sed -n -e '/|UNDEF/d' -e '/FUNC..GL/s/^.*|__*//p'";\
6147 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6149 elif com="$sed -n -e 's/^.* D __*//p' -e 's/^.* D //p'";\
6151 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6153 elif com="$sed -n -e 's/^_//' -e 's/^\([a-zA-Z_0-9]*\).*xtern.*text.*/\1/p'";\
6155 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6157 elif com="$sed -n -e 's/^.*|FUNC |GLOB .*|//p'";\
6159 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6161 elif com="$grep '|' | $sed -n -e '/|COMMON/d' -e '/|DATA/d' \
6162 -e '/ file/d' -e 's/^\([^ ]*\).*/\1/p'";\
6164 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6166 elif com="$sed -n -e 's/^.*|FUNC |GLOB .*|//p' -e 's/^.*|FUNC |WEAK .*|//p'";\
6168 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6170 elif com="$sed -n -e 's/^__//' -e '/|Undef/d' -e '/|Proc/s/ .*//p'";\
6172 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6174 elif com="$sed -n -e 's/^.*|Proc .*|Text *| *//p'";\
6176 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6178 elif com="$sed -n -e '/Def. Text/s/.* \([^ ]*\)\$/\1/p'";\
6180 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6182 elif com="$sed -n -e 's/^[-0-9a-f ]*_\(.*\)=.*/\1/p'";\
6184 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6186 elif com="$sed -n -e 's/.*\.text n\ \ \ \.//p'";\
6188 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6190 elif com="sed -n -e 's/^__.*//' -e 's/[ ]*D[ ]*[0-9]*.*//p'";\
6192 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6195 $nm -p $* 2>/dev/null >libc.tmp
6196 $grep fprintf libc.tmp > libc.ptf
6197 if com="$sed -n -e 's/^.* [ADTSIW] *_[_.]*//p' -e 's/^.* [ADTSIW] //p'";\
6198 eval $xscan; $contains '^fprintf$' libc.list >/dev/null 2>&1
6204 echo "$nm didn't seem to work right. Trying $ar instead..." >&4
6206 if $ar t $libc > libc.tmp && $contains '^fprintf$' libc.tmp >/dev/null 2>&1; then
6207 for thisname in $libnames $libc; do
6208 $ar t $thisname >>libc.tmp
6210 $sed -e "s/\\$_o\$//" < libc.tmp > libc.list
6212 elif test "X$osname" = "Xos2" && $ar tv $libc > libc.tmp; then
6213 # Repeat libc to extract forwarders to DLL entries too
6214 for thisname in $libnames $libc; do
6215 $ar tv $thisname >>libc.tmp
6216 # Revision 50 of EMX has bug in $ar.
6217 # it will not extract forwarders to DLL entries
6218 # Use emximp which will extract exactly them.
6219 emximp -o tmp.imp $thisname \
6221 $sed -e 's/^\([_a-zA-Z0-9]*\) .*$/\1/p' \
6222 < tmp.imp >>libc.tmp
6225 $sed -e "s/\\$_o\$//" -e 's/^ \+//' < libc.tmp > libc.list
6228 echo "$ar didn't seem to work right." >&4
6229 echo "Maybe this is a Cray...trying bld instead..." >&4
6230 if bld t $libc | $sed -e 's/.*\///' -e "s/\\$_o:.*\$//" > libc.list
6232 for thisname in $libnames; do
6234 $sed -e 's/.*\///' -e "s/\\$_o:.*\$//" >>libc.list
6235 $ar t $thisname >>libc.tmp
6239 echo "That didn't work either. Giving up." >&4
6246 if $test -f /lib/syscalls.exp; then
6248 echo "Also extracting names from /lib/syscalls.exp for good ole AIX..." >&4
6249 $sed -n 's/^\([^ ]*\)[ ]*syscall[0-9]*$/\1/p' /lib/syscalls.exp >>libc.list
6253 $rm -f libnames libpath
6255 : see if dld is available
6259 : is a C symbol defined?
6262 -v) tf=libc.tmp; tc=""; tdc="";;
6263 -a) tf=libc.tmp; tc="[0]"; tdc="[]";;
6264 *) tlook="^$1\$"; tf=libc.list; tc="()"; tdc="()";;
6267 case "$reuseval-$4" in
6269 true-*) tx=no; eval "tval=\$$4"; case "$tval" in "") tx=yes;; esac;;
6275 if $contains $tlook $tf >/dev/null 2>&1;
6280 echo "int main() { extern short $1$tdc; printf(\"%hd\", $1$tc); }" > t.c;
6281 if $cc $optimize $ccflags $ldflags -o t t.c $libs >/dev/null 2>&1;
6289 $define) tval=true;;
6295 : define an is-in-libc? function
6296 inlibc='echo " "; td=$define; tu=$undef;
6297 sym=$1; var=$2; eval "was=\$$2";
6299 case "$reuseval$was" in
6309 echo "$sym() found." >&4;
6310 case "$was" in $undef) . ./whoa; esac; eval "$var=\$td";;
6312 echo "$sym() NOT found." >&4;
6313 case "$was" in $define) . ./whoa; esac; eval "$var=\$tu";;
6317 $define) echo "$sym() found." >&4;;
6318 *) echo "$sym() NOT found." >&4;;
6322 : see if dlopen exists
6329 : determine which dynamic loading, if any, to compile in
6331 dldir="ext/DynaLoader"
6344 $define) dflt='y' ;;
6347 $define) dflt='y' ;;
6349 : Does a dl_xxx.xs file exist for this operating system
6350 $test -f $rsrc/$dldir/dl_${osname}.xs && dflt='y'
6353 rp="Do you wish to use dynamic loading?"
6360 if $test -f $rsrc/$dldir/dl_${osname}.xs ; then
6361 dflt="$dldir/dl_${osname}.xs"
6362 elif $test "$d_dlopen" = "$define" ; then
6363 dflt="$dldir/dl_dlopen.xs"
6364 elif $test "$i_dld" = "$define" ; then
6365 dflt="$dldir/dl_dld.xs"
6370 *) dflt="$dldir/$dlsrc"
6373 echo "The following dynamic loading files are available:"
6374 : Can not go over to $dldir because getfile has path hard-coded in.
6375 tdir=`pwd`; cd $rsrc; $ls -C $dldir/dl*.xs; cd $tdir
6376 rp="Source file to use for dynamic loading"
6382 dlsrc=`echo $ans | $sed -e 's%.*/\([^/]*\)$%\1%'`
6386 Some systems may require passing special flags to $cc -c to
6387 compile modules that will be used to create a shared library.
6388 To use no flags, say "none".
6391 case "$cccdlflags" in
6392 '') case "$gccversion" in
6393 '') case "$osname" in
6395 next) dflt='none' ;;
6396 irix*) dflt='-KPIC' ;;
6397 svr4*|esix*|solaris) dflt='-KPIC' ;;
6398 sunos) dflt='-pic' ;;
6402 *) case "$osname" in
6403 svr4*|esix*|solaris) dflt='-fPIC' ;;
6408 *) dflt="$cccdlflags" ;;
6410 rp="Any special flags to pass to $cc -c to compile shared library modules?"
6413 none) cccdlflags=' ' ;;
6414 *) cccdlflags="$ans" ;;
6419 Some systems use ld to create libraries that can be dynamically loaded,
6420 while other systems (such as those using ELF) use $cc.
6424 '') $cat >try.c <<'EOM'
6425 /* Test for whether ELF binaries are produced */
6430 int i = open("a.out",O_RDONLY);
6433 if(read(i,b,4)==4 && b[0]==127 && b[1]=='E' && b[2]=='L' && b[3]=='F')
6434 exit(0); /* succeed (yes, it's ELF) */
6439 if $cc $ccflags try.c >/dev/null 2>&1 && ./a.out; then
6441 You appear to have ELF support. I'll use $cc to build dynamic libraries.
6445 echo "I'll use ld to build dynamic libraries."
6454 rp="What command should be used to create dynamic libraries?"
6460 Some systems may require passing special flags to $ld to create a
6461 library that can be dynamically loaded. If your ld flags include
6462 -L/other/path options to locate libraries outside your loader's normal
6463 search path, you may need to specify those -L options here as well. To
6464 use no flags, say "none".
6467 case "$lddlflags" in
6468 '') case "$osname" in
6469 beos) dflt='-nostart' ;;
6471 case "$gccversion" in
6472 '') dflt="$dflt +vnocompatwarnings" ;;
6475 linux|irix*) dflt='-shared' ;;
6476 next) dflt='none' ;;
6477 solaris) dflt='-G' ;;
6478 sunos) dflt='-assert nodefinitions' ;;
6479 svr4*|esix*) dflt="-G $ldflags" ;;
6483 *) dflt="$lddlflags" ;;
6486 : Try to guess additional flags to pick up local libraries.
6487 : Be careful not to append to a plain 'none'
6491 for thisflag in $ldflags; do
6496 *) dflt="$dflt $thisflag" ;;
6503 ''|' ') dflt='none' ;;
6506 rp="Any special flags to pass to $ld to create a dynamically loaded library?"
6509 none) lddlflags=' ' ;;
6510 *) lddlflags="$ans" ;;
6515 Some systems may require passing special flags to $cc to indicate that
6516 the resulting executable will use dynamic linking. To use no flags,
6520 case "$ccdlflags" in
6521 '') case "$osname" in
6522 hpux) dflt='-Wl,-E' ;;
6523 linux) dflt='-rdynamic' ;;
6524 next) dflt='none' ;;
6525 sunos) dflt='none' ;;
6529 *) dflt="$ccdlflags" ;;
6531 rp="Any special flags to pass to $cc to use dynamic linking?"
6534 none) ccdlflags=' ' ;;
6535 *) ccdlflags="$ans" ;;
6549 # No dynamic loading being used, so don't bother even to prompt.
6552 *) case "$useshrplib" in
6553 '') case "$osname" in
6554 svr4*|dgux|dynixptx|esix|powerux|beos|cygwin*)
6556 also='Building a shared libperl is required for dynamic loading to work on your system.'
6561 also='Building a shared libperl is needed for MAB support.'
6579 The perl executable is normally obtained by linking perlmain.c with
6580 libperl${_a}, any static extensions (usually just DynaLoader), and
6581 any other libraries needed on this system (such as -lm, etc.). Since
6582 your system supports dynamic loading, it is probably possible to build
6583 a shared libperl.$so. If you will have more than one executable linked
6584 to libperl.$so, this will significantly reduce the size of each
6585 executable, but it may have a noticeable affect on performance. The
6586 default is probably sensible for your system.
6590 rp="Build a shared libperl.$so (y/n)"
6594 useshrplib='true' ;;
6595 *) useshrplib='false' ;;
6600 case "$useshrplib" in
6604 # Figure out a good name for libperl.so. Since it gets stored in
6605 # a version-specific architecture-dependent library, the version
6606 # number isn't really that important, except for making cc/ld happy.
6608 # A name such as libperl.so.3.1
6609 majmin="libperl.$so.$patchlevel.$subversion"
6610 # A name such as libperl.so.301
6611 majonly=`echo $patchlevel $subversion |
6612 $awk '{printf "%d%02d", $1, $2}'`
6613 majonly=libperl.$so.$majonly
6614 # I'd prefer to keep the os-specific stuff here to a minimum, and
6615 # rely on figuring it out from the naming of libc.
6616 case "${osname}${osvers}" in
6619 # XXX How handle the --version stuff for MAB?
6621 linux*) # ld won't link with a bare -lperl otherwise.
6624 cygwin*) # include version
6625 dflt=`echo libperl$version | sed -e 's/\./_/g'`$lib_ext
6627 *) # Try to guess based on whether libc has major.minor.
6629 *libc.$so.[0-9]*.[0-9]*) dflt=$majmin ;;
6630 *libc.$so.[0-9]*) dflt=$majonly ;;
6631 *) dflt=libperl.$so ;;
6641 I need to select a good name for the shared libperl. If your system uses
6642 library names with major and minor numbers, then you might want something
6643 like $majmin. Alternatively, if your system uses a single version
6644 number for shared libraries, then you might want to use $majonly.
6645 Or, your system might be quite happy with a simple libperl.$so.
6647 Since the shared libperl will get installed into a version-specific
6648 architecture-dependent directory, the version number of the shared perl
6649 library probably isn't important, so the default should be o.k.
6652 rp='What name do you want to give to the shared libperl?'
6655 echo "Ok, I'll use $libperl"
6658 libperl="libperl${_a}"
6662 # Detect old use of shrpdir via undocumented Configure -Dshrpdir
6666 WARNING: Use of the shrpdir variable for the installation location of
6667 the shared $libperl is not supported. It was never documented and
6668 will not work in this version. Let me (perlbug@perl.com)
6669 know of any problems this may cause.
6675 But your current setting of $shrpdir is
6676 the default anyway, so it's harmless.
6681 Further, your current attempted setting of $shrpdir
6682 conflicts with the value of $archlibexp/CORE
6683 that installperl will use.
6690 # How will the perl executable find the installed shared $libperl?
6691 # Add $xxx to ccdlflags.
6692 # If we can't figure out a command-line option, use $shrpenv to
6693 # set env LD_RUN_PATH. The main perl makefile uses this.
6694 shrpdir=$archlibexp/CORE
6697 if "$useshrplib"; then
6700 # We'll set it in Makefile.SH...
6706 xxx="-Wl,-R$shrpdir"
6708 linux|irix*|dec_osf)
6709 xxx="-Wl,-rpath,$shrpdir"
6712 # next doesn't like the default...
6715 # beos doesn't like the default, either.
6718 # hpux doesn't like the default, either.
6719 tmp_shrpenv="env LDOPTS=\"+s +b${shrpdir}\""
6722 tmp_shrpenv="env LD_RUN_PATH=$shrpdir"
6728 # Only add $xxx if it isn't already in ccdlflags.
6729 case " $ccdlflags " in
6731 *) ccdlflags="$ccdlflags $xxx"
6734 Adding $xxx to the flags
6735 passed to $ld so that the perl executable will find the
6736 installed shared $libperl.
6744 # Fix ccdlflags in AIX for building external extensions.
6745 # (For building Perl itself bare -bE:perl.exp is needed,
6746 # Makefile.SH takes care of this.)
6748 aix) ccdlflags="$ccdlflags -bE:$installarchlib/CORE/perl.exp" ;;
6750 # Respect a hint or command-line value.
6752 '') shrpenv="$tmp_shrpenv" ;;
6754 case "$ldlibpthname" in
6755 '') ldlibpthname=LD_LIBRARY_PATH ;;
6756 none) ldlibpthname='' ;;
6759 : determine where manual pages go
6760 set man1dir man1dir none
6764 $spackage has manual pages available in source form.
6768 echo "However, you don't have nroff, so they're probably useless to you."
6770 '') man1dir="none";;
6773 echo "If you don't want the manual sources installed, answer 'none'."
6778 lookpath="$prefixexp/man/man1 $prefixexp/man/l_man/man1"
6779 lookpath="$lookpath $prefixexp/man/p_man/man1"
6780 lookpath="$lookpath $prefixexp/man/u_man/man1"
6781 lookpath="$lookpath $prefixexp/man/man.1"
6783 */?_man*) dflt=`./loc . $prefixexp/l_man/man1 $lookpath` ;;
6784 *) dflt=`./loc . $prefixexp/man/man1 $lookpath` ;;
6794 rp="Where do the main $spackage manual pages (source) go?"
6796 if $test "X$man1direxp" != "X$ansexp"; then
6800 man1direxp="$ansexp"
6806 : Change installation prefix, if necessary.
6807 if $test X"$prefix" != X"$installprefix"; then
6808 installman1dir=`echo $man1direxp | $sed "s#^$prefix#$installprefix#"`
6810 installman1dir="$man1direxp"
6813 : What suffix to use on installed man pages
6820 rp="What suffix should be used for the main $spackage man pages?"
6822 '') case "$man1dir" in
6836 *) dflt="$man1ext";;
6843 : see if we can have long filenames
6845 first=123456789abcdef
6847 if (echo hi >$first) 2>/dev/null; then
6848 if $test -f 123456789abcde; then
6849 echo 'You cannot have filenames longer than 14 characters. Sigh.' >&4
6852 echo 'You can have filenames longer than 14 characters.'>&4
6857 You can't have filenames longer than 14 chars.
6858 You can't even think about them!
6864 $rm -rf 123456789abcde*
6866 : determine where library module manual pages go
6867 set man3dir man3dir none
6871 $spackage has manual pages for many of the library modules.
6877 However, you don't have nroff, so they're probably useless to you.
6880 '') man3dir="none";;
6884 case "$d_flexfnam" in
6887 However, your system can't handle the long file names like File::Basename.3.
6890 '') man3dir="none";;
6894 echo "If you don't want the manual sources installed, answer 'none'."
6895 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
6897 '') dflt=`echo "$man1dir" | $sed -e 's/man1/man3/g' -e 's/man\.1/man\.3/g'`
6898 if $test -d "$privlib/man/man3"; then
6901 WARNING: Previous versions of perl installed man3 pages into
6902 $privlib/man/man3. This version will suggest a
6903 new default of $dflt.
6907 rp='Do you wish to preserve the old behavior?(y/n)'
6910 y*) dflt="$privlib/man/man3" ;;
6915 *) dflt="$man3dir" ;;
6922 rp="Where do the $package library man pages (source) go?"
6925 man3direxp="$ansexp"
6931 : Change installation prefix, if necessary.
6932 if $test X"$prefix" != X"$installprefix"; then
6933 installman3dir=`echo $man3direxp | $sed "s#^$prefix#$installprefix#"`
6935 installman3dir="$man3direxp"
6938 : What suffix to use on installed man pages
6944 rp="What suffix should be used for the $package library man pages?"
6946 '') case "$man3dir" in
6960 *) dflt="$man3ext";;
6967 : see if we have to deal with yellow pages, now NIS.
6968 if $test -d /usr/etc/yp || $test -d /etc/yp; then
6969 if $test -f /usr/etc/nibindd; then
6971 echo "I'm fairly confident you're on a NeXT."
6973 rp='Do you get the hosts file via NetInfo?'
6982 y*) hostcat='nidump hosts .';;
6983 *) case "$hostcat" in
6984 nidump*) hostcat='';;
6994 '') if $contains '^\+' /etc/passwd >/dev/null 2>&1; then
7002 rp='Are you getting the hosts file via yellow pages?'
7005 y*) hostcat='ypcat hosts';;
7006 *) hostcat='cat /etc/hosts';;
7012 '') test -f /etc/hosts && hostcat='cat /etc/hosts';;
7015 '') test -f /etc/group && groupcat='cat /etc/group';;
7018 '') test -f /etc/passwd && passcat='cat /etc/passwd';;
7021 : now get the host name
7023 echo "Figuring out host name..." >&4
7024 case "$myhostname" in
7026 echo 'Maybe "hostname" will work...'
7027 if tans=`sh -c hostname 2>&1` ; then
7035 if $test "$cont"; then
7037 echo 'Oh, dear. Maybe "/etc/systemid" is the key...'
7038 if tans=`cat /etc/systemid 2>&1` ; then
7040 phostname='cat /etc/systemid'
7041 echo "Whadyaknow. Xenix always was a bit strange..."
7044 elif $test -r /etc/systemid; then
7045 echo "(What is a non-Xenix system doing with /etc/systemid?)"
7048 if $test "$cont"; then
7049 echo 'No, maybe "uuname -l" will work...'
7050 if tans=`sh -c 'uuname -l' 2>&1` ; then
7052 phostname='uuname -l'
7054 echo 'Strange. Maybe "uname -n" will work...'
7055 if tans=`sh -c 'uname -n' 2>&1` ; then
7057 phostname='uname -n'
7059 echo 'Oh well, maybe I can mine it out of whoami.h...'
7060 if tans=`sh -c $contains' sysname $usrinc/whoami.h' 2>&1` ; then
7061 myhostname=`echo "$tans" | $sed 's/^.*"\(.*\)"/\1/'`
7062 phostname="sed -n -e '"'/sysname/s/^.*\"\\(.*\\)\"/\1/{'"' -e p -e q -e '}' <$usrinc/whoami.h"
7064 case "$myhostname" in
7065 '') echo "Does this machine have an identity crisis or something?"
7068 echo "Well, you said $myhostname before..."
7069 phostname='echo $myhostname';;
7075 : you do not want to know about this
7080 if $test "$myhostname" ; then
7082 rp='Your host name appears to be "'$myhostname'".'" Right?"
7090 : bad guess or no guess
7091 while $test "X$myhostname" = X ; do
7093 rp="Please type the (one word) name of your host:"
7098 : translate upper to lower if necessary
7099 case "$myhostname" in
7101 echo "(Normalizing case in your host name)"
7102 myhostname=`echo $myhostname | ./tr '[A-Z]' '[a-z]'`
7106 case "$myhostname" in
7108 dflt=`expr "X$myhostname" : "X[^.]*\(\..*\)"`
7109 myhostname=`expr "X$myhostname" : "X\([^.]*\)\."`
7110 echo "(Trimming domain name from host name--host name is now $myhostname)"
7112 *) case "$mydomain" in
7115 test "X$hostcat" = "Xypcat hosts" &&
7116 ypmatch "$myhostname" hosts 2>/dev/null |\
7117 $sed -e 's/[ ]*#.*//; s/$/ /' > hosts && \
7120 test "X$hostcat" != "X" &&
7121 $hostcat | $sed -n -e "s/[ ]*#.*//; s/\$/ /
7122 /[ ]$myhostname[ . ]/p" > hosts
7125 $test x`$awk "/[0-9].*[ ]$myhostname$tmp_re/ { sum++ }
7126 END { print sum }" hosts` = x1 || tmp_re="[ ]"
7127 dflt=.`$awk "/[0-9].*[ ]$myhostname$tmp_re/ {for(i=2; i<=NF;i++) print \\\$i}" \
7128 hosts | $sort | $uniq | \
7129 $sed -n -e "s/$myhostname\.\([-a-zA-Z0-9_.]\)/\1/p"`
7130 case `$echo X$dflt` in
7131 X*\ *) echo "(Several hosts in /etc/hosts matched hostname)"
7134 X.) echo "(You do not have fully-qualified names in /etc/hosts)"
7139 tans=`./loc resolv.conf X /etc /usr/etc`
7140 if $test -f "$tans"; then
7141 echo "(Attempting domain name extraction from $tans)"
7142 dflt=.`$sed -n -e 's/ / /g' \
7143 -e 's/^search *\([^ ]*\).*/\1/p' $tans \
7144 | ./tr '[A-Z]' '[a-z]' 2>/dev/null`
7146 .) dflt=.`$sed -n -e 's/ / /g' \
7147 -e 's/^domain *\([^ ]*\).*/\1/p' $tans \
7148 | ./tr '[A-Z]' '[a-z]' 2>/dev/null`
7155 .) echo "(No help from resolv.conf either -- attempting clever guess)"
7156 dflt=.`sh -c domainname 2>/dev/null`
7159 .nis.*|.yp.*|.main.*) dflt=`echo $dflt | $sed -e 's/^\.[^.]*//'`;;
7164 .) echo "(Lost all hope -- silly guess then)"
7170 *) dflt="$mydomain";;
7174 rp="What is your domain name?"
7184 : translate upper to lower if necessary
7187 echo "(Normalizing case in your domain name)"
7188 mydomain=`echo $mydomain | ./tr '[A-Z]' '[a-z]'`
7192 : a little sanity check here
7193 case "$phostname" in
7196 case `$phostname | ./tr '[A-Z]' '[a-z]'` in
7197 $myhostname$mydomain|$myhostname) ;;
7199 case "$phostname" in
7201 echo "(That doesn't agree with your whoami.h file, by the way.)"
7204 echo "(That doesn't agree with your $phostname command, by the way.)"
7214 I need to get your e-mail address in Internet format if possible, i.e.
7215 something like user@host.domain. Please answer accurately since I have
7216 no easy means to double check it. The default value provided below
7217 is most probably close to reality but may not be valid from outside
7218 your organization...
7222 while test "$cont"; do
7224 '') dflt="$cf_by@$myhostname$mydomain";;
7225 *) dflt="$cf_email";;
7227 rp='What is your e-mail address?'
7233 rp='Address does not look like an Internet one. Use it anyway?'
7249 If you or somebody else will be maintaining perl at your site, please
7250 fill in the correct e-mail address here so that they may be contacted
7251 if necessary. Currently, the "perlbug" program included with perl
7252 will send mail to this address in addition to perlbug@perl.com. You may
7253 enter "none" for no administrator.
7256 case "$perladmin" in
7257 '') dflt="$cf_email";;
7258 *) dflt="$perladmin";;
7260 rp='Perl administrator e-mail address'
7264 : figure out how to guarantee perl startup
7265 case "$startperl" in
7267 case "$sharpbang" in
7271 I can use the #! construct to start perl on your system. This will
7272 make startup of perl scripts faster, but may cause problems if you
7273 want to share those scripts and perl is not in a standard place
7274 ($binexp/perl) on all your platforms. The alternative is to force
7275 a shell by starting the script with a single ':' character.
7279 rp='What shall I put after the #! to start up perl ("none" to not use #!)?'
7282 none) startperl=": # use perl";;
7283 *) startperl="#!$ans"
7284 if $test 30 -lt `echo "$ans" | wc -c`; then
7287 WARNING: Some systems limit the #! command to 32 characters.
7288 If you experience difficulty running Perl scripts with #!, try
7289 installing Perl in a directory with a shorter pathname.
7295 *) startperl=": # use perl"
7300 echo "I'll use $startperl to start perl scripts."
7302 : figure best path for perl in scripts
7305 perlpath="$binexp/perl"
7306 case "$startperl" in
7311 I will use the "eval 'exec'" idiom to start Perl on your system.
7312 I can use the full path of your Perl binary for this purpose, but
7313 doing so may cause problems if you want to share those scripts and
7314 Perl is not always in a standard place ($binexp/perl).
7318 rp="What path shall I use in \"eval 'exec'\"?"
7325 case "$startperl" in
7327 *) echo "I'll use $perlpath in \"eval 'exec'\"" ;;
7330 : determine where public executable scripts go
7331 set scriptdir scriptdir
7333 case "$scriptdir" in
7336 : guess some guesses
7337 $test -d /usr/share/scripts && dflt=/usr/share/scripts
7338 $test -d /usr/share/bin && dflt=/usr/share/bin
7339 $test -d /usr/local/script && dflt=/usr/local/script
7340 $test -d /usr/local/scripts && dflt=/usr/local/scripts
7341 $test -d $prefixexp/script && dflt=$prefixexp/script
7345 *) dflt="$scriptdir"
7350 Some installations have a separate directory just for executable scripts so
7351 that they can mount it across multiple architectures but keep the scripts in
7352 one spot. You might, for example, have a subdirectory of /usr/share for this.
7353 Or you might just lump your scripts in with all your other executables.
7357 rp='Where do you keep publicly executable scripts?'
7359 if $test "X$ansexp" != "X$scriptdirexp"; then
7363 scriptdirexp="$ansexp"
7364 : Change installation prefix, if necessary.
7365 if $test X"$prefix" != X"$installprefix"; then
7366 installscript=`echo $scriptdirexp | sed "s#^$prefix#$installprefix#"`
7368 installscript="$scriptdirexp"
7371 : determine where add-on public executables go
7373 '') dflt=$siteprefix/bin ;;
7377 rp='Pathname where the add-on public executables should be installed?'
7380 sitebinexp="$ansexp"
7381 : Change installation prefix, if necessary.
7382 if $test X"$prefix" != X"$installprefix"; then
7383 installsitebin=`echo $sitebinexp | sed "s#^$prefix#$installprefix#"`
7385 installsitebin="$sitebinexp"
7388 : see if sqrtl exists
7393 *-DUSE_LONG_DOUBLE*|*-DUSE_MORE_BITS*) uselongdouble="$define" ;;
7396 case "$uselongdouble" in
7397 $define|true|[yY]*) dflt='y';;
7402 Perl can be built to take advantage of long doubles which
7403 (if available) may give more accuracy and range for floating point numbers.
7405 If this doesn't make any sense to you, just accept the default '$dflt'.
7407 rp='Try to use long doubles if available?'
7410 y|Y) val="$define" ;;
7416 case "$uselongdouble" in
7417 true|[yY]*) uselongdouble="$define" ;;
7420 case "$uselongdouble" in
7422 : Look for a hint-file generated 'call-back-unit'. If the
7423 : user has specified that long doubles should be used,
7424 : we may need to set or change some other defaults.
7425 if $test -f uselongdouble.cbu; then
7426 echo "Your platform has some specific hints for long doubles, using them..."
7427 . ./uselongdouble.cbu
7430 (Your platform doesn't have any specific hints for long doubles.)
7436 case "$uselongdouble:$d_sqrtl" in
7440 *** You requested the use of long doubles but you do not seem to have
7441 *** the mathematic functions for long doubles. I'm disabling the use
7442 *** of long doubles.
7445 uselongdouble=$undef
7449 case "$useperlio" in
7450 $define|true|[yY]*) dflt='y';;
7455 Previous version of $package used the standard IO mechanisms as defined
7456 in <stdio.h>. Versions 5.003_02 and later of perl allow alternate IO
7457 mechanisms via a "PerlIO" abstraction, but the stdio mechanism is still
7458 the default. This abstraction layer can use AT&T's sfio (if you already
7459 have sfio installed) or regular stdio. Using PerlIO with sfio may cause
7460 problems with some extension modules. Using PerlIO with stdio is safe,
7461 but it is slower than plain stdio and therefore is not the default.
7463 If this doesn't make any sense to you, just accept the default '$dflt'.
7465 rp='Use the experimental PerlIO abstraction layer?'
7472 echo "Ok, doing things the stdio way"
7479 case "$vendorprefix" in
7480 '') d_vendorbin="$undef"
7484 *) d_vendorbin="$define"
7485 : determine where vendor-supplied executables go.
7486 case "$vendorbin" in
7487 '') dflt=$vendorprefix/bin ;;
7488 *) dflt="$vendorbin" ;;
7491 rp='Pathname for the vendor-supplied executables directory?'
7494 vendorbinexp="$ansexp"
7497 : Change installation prefix, if necessary.
7498 if $test X"$prefix" != X"$installprefix"; then
7499 installvendorbin=`echo $vendorbinexp | $sed "s#^$prefix#$installprefix#"`
7501 installvendorbin="$vendorbinexp"
7504 : see if qgcvt exists
7508 : check for length of double
7510 case "$doublesize" in
7512 echo "Checking to see how big your double precision numbers are..." >&4
7513 $cat >try.c <<'EOCP'
7517 printf("%d\n", (int)sizeof(double));
7522 if eval $compile_ok; then
7524 echo "Your double is $doublesize bytes long."
7527 echo "(I can't seem to compile the test program. Guessing...)"
7528 rp="What is the size of a double precision number (in bytes)?"
7536 : check for long doubles
7538 echo "Checking to see if you have long double..." >&4
7539 echo 'int main() { long double x = 7.0; }' > try.c
7541 if eval $compile; then
7543 echo "You have long double."
7546 echo "You do not have long double."
7552 : check for length of long double
7553 case "${d_longdbl}${longdblsize}" in
7556 echo "Checking to see how big your long doubles are..." >&4
7557 $cat >try.c <<'EOCP'
7561 printf("%d\n", sizeof(long double));
7566 if eval $compile; then
7567 longdblsize=`./try$exe_ext`
7568 echo "Your long doubles are $longdblsize bytes long."
7572 echo "(I can't seem to compile the test program. Guessing...)" >&4
7573 rp="What is the size of a long double (in bytes)?"
7577 if $test "X$doublesize" = "X$longdblsize"; then
7578 echo "(That isn't any different from an ordinary double.)"
7586 if $test X"$d_longdbl" = X"$define"; then
7588 echo "Checking how to print long doubles..." >&4
7590 if $test X"$sPRIfldbl" = X -a X"$doublesize" = X"$longdblsize"; then
7591 $cat >try.c <<'EOCP'
7592 #include <sys/types.h>
7596 printf("%.3f\n", d);
7600 if eval $compile; then
7604 sPRIfldbl='"f"'; sPRIgldbl='"g"'; sPRIeldbl='"e"';
7605 sPRIFldbl='"F"'; sPRIGldbl='"G"'; sPRIEldbl='"E"';
7606 echo "We will use %f."
7612 if $test X"$sPRIfldbl" = X; then
7613 $cat >try.c <<'EOCP'
7614 #include <sys/types.h>
7617 long double d = 123.456;
7618 printf("%.3llf\n", d);
7622 if eval $compile; then
7626 sPRIfldbl='"llf"'; sPRIgldbl='"llg"'; sPRIeldbl='"lle"';
7627 sPRIFldbl='"llF"'; sPRIGldbl='"llG"'; sPRIEldbl='"llE"';
7628 echo "We will use %llf."
7634 if $test X"$sPRIfldbl" = X; then
7635 $cat >try.c <<'EOCP'
7636 #include <sys/types.h>
7639 long double d = 123.456;
7640 printf("%.3Lf\n", d);
7644 if eval $compile; then
7648 sPRIfldbl='"Lf"'; sPRIgldbl='"Lg"'; sPRIeldbl='"Le"';
7649 sPRIFldbl='"LF"'; sPRIGldbl='"LG"'; sPRIEldbl='"LE"';
7650 echo "We will use %Lf."
7656 if $test X"$sPRIfldbl" = X; then
7657 $cat >try.c <<'EOCP'
7658 #include <sys/types.h>
7661 long double d = 123.456;
7662 printf("%.3lf\n", d);
7666 if eval $compile; then
7670 sPRIfldbl='"lf"'; sPRIgldbl='"lg"'; sPRIeldbl='"le"';
7671 sPRIFldbl='"lF"'; sPRIGldbl='"lG"'; sPRIEldbl='"lE"';
7672 echo "We will use %lf."
7678 if $test X"$sPRIfldbl" = X; then
7679 echo "Cannot figure out how to print long doubles." >&4
7686 case "$sPRIfldbl" in
7687 '') d_PRIfldbl="$undef"; d_PRIgldbl="$undef"; d_PRIeldbl="$undef";
7688 d_PRIFldbl="$undef"; d_PRIGldbl="$undef"; d_PRIEldbl="$undef";
7690 *) d_PRIfldbl="$define"; d_PRIgldbl="$define"; d_PRIeldbl="$define";
7691 d_PRIFldbl="$define"; d_PRIGldbl="$define"; d_PRIEldbl="$define";
7695 : Check how to convert floats to strings.
7696 if test "X$d_Gconvert" = X; then
7698 echo "Checking for an efficient way to convert floats to strings."
7700 case "$uselongdouble" in
7701 "$define") echo "#define USE_LONG_DOUBLE" >>try.c ;;
7703 case "$d_longdbl" in
7704 "$define") echo "#define HAS_LONG_DOUBLE" >>try.c ;;
7706 case "$d_PRIgldbl" in
7707 "$define") echo "#define HAS_PRIgldbl" >>try.c ;;
7711 #define Gconvert(x,n,t,b) gconvert((x),(n),(t),(b))
7712 char *myname = "gconvert";
7715 #define Gconvert(x,n,t,b) gcvt((x),(n),(b))
7716 char *myname = "gcvt";
7719 #define Gconvert(x,n,t,b) qgcvt((x),(n),(b))
7720 char *myname = "qgcvt";
7721 #define DOUBLETYPE long double
7724 #if defined(USE_LONG_DOUBLE) && defined(HAS_LONG_DOUBLE) && defined(HAS_PRIgldbl)
7725 #define Gconvert(x,n,t,b) sprintf((b),"%.*"$sPRIgldbl,(n),(x))
7727 #define Gconvert(x,n,t,b) sprintf((b),"%.*g",(n),(x))
7729 char *myname = "sprintf";
7733 #if defined(USE_LONG_DOUBLE) && defined(HAS_LONG_DOUBLE)
7734 #define DOUBLETYPE long double
7736 #define DOUBLETYPE double
7742 #define I_STDLIB $i_stdlib
7748 checkit(expect, got)
7752 if (strcmp(expect, got)) {
7753 printf("%s oddity: Expected %s, got %s\n",
7754 myname, expect, got);
7764 /* This must be 1st test on (which?) platform */
7765 /* Alan Burlison <AlanBurlsin@unn.unisys.com> */
7766 Gconvert((DOUBLETYPE)0.1, 8, 0, buf);
7767 checkit("0.1", buf);
7769 Gconvert((DOUBLETYPE)1.0, 8, 0, buf);
7772 Gconvert((DOUBLETYPE)1.1, 8, 0, buf);
7773 checkit("1.1", buf);
7775 Gconvert((DOUBLETYPE)1.01, 8, 0, buf);
7776 checkit("1.01", buf);
7778 Gconvert((DOUBLETYPE)1.001, 8, 0, buf);
7779 checkit("1.001", buf);
7781 Gconvert((DOUBLETYPE)1.0001, 8, 0, buf);
7782 checkit("1.0001", buf);
7784 Gconvert((DOUBLETYPE)1.00001, 8, 0, buf);
7785 checkit("1.00001", buf);
7787 Gconvert((DOUBLETYPE)1.000001, 8, 0, buf);
7788 checkit("1.000001", buf);
7790 Gconvert((DOUBLETYPE)0.0, 8, 0, buf);
7793 Gconvert((DOUBLETYPE)-1.0, 8, 0, buf);
7796 /* Some Linux gcvt's give 1.e+5 here. */
7797 Gconvert((DOUBLETYPE)100000.0, 8, 0, buf);
7798 checkit("100000", buf);
7800 /* Some Linux gcvt's give -1.e+5 here. */
7801 Gconvert((DOUBLETYPE)-100000.0, 8, 0, buf);
7802 checkit("-100000", buf);
7807 case "$d_Gconvert" in
7808 gconvert*) xxx_list='gconvert gcvt sprintf' ;;
7809 gcvt*) xxx_list='gcvt gconvert sprintf' ;;
7810 sprintf*) xxx_list='sprintf gconvert gcvt' ;;
7811 *) xxx_list='gconvert gcvt sprintf' ;;
7814 case "$d_longdbl$uselongdouble$d_qgcvt" in
7815 "$define$define$define") xxx_list="`echo $xxx_list|sed 's/gcvt/qgcvt gcvt/'`" ;;
7818 for xxx_convert in $xxx_list; do
7819 echo "Trying $xxx_convert..."
7821 set try -DTRY_$xxx_convert
7822 if eval $compile; then
7823 echo "$xxx_convert() found." >&4
7825 echo "I'll use $xxx_convert to convert floats into a string." >&4
7828 echo "...But $xxx_convert didn't work as I expected."
7831 echo "$xxx_convert NOT found." >&4
7835 case "$xxx_convert" in
7836 gconvert) d_Gconvert='gconvert((x),(n),(t),(b))' ;;
7837 gcvt) d_Gconvert='gcvt((x),(n),(b))' ;;
7838 qgcvt) d_Gconvert='qgcvt((x),(n),(b))' ;;
7839 *) case "$uselongdouble$d_longdbl$d_PRIgldbl" in
7840 "$define$define$define")
7841 d_Gconvert="sprintf((b),\"%.*$sPRIgldbl\",(n),(x))" ;;
7842 *) d_Gconvert='sprintf((b),"%.*g",(n),(x))' ;;
7848 : Initialize h_fcntl
7851 : Initialize h_sysfile
7854 : access call always available on UNIX
7858 : locate the flags for 'access()'
7862 $cat >access.c <<'EOCP'
7863 #include <sys/types.h>
7868 #include <sys/file.h>
7877 : check sys/file.h first, no particular reason here
7878 if $test `./findhdr sys/file.h` && \
7879 $cc $cppflags -DI_SYS_FILE -o access access.c >/dev/null 2>&1 ; then
7881 echo "<sys/file.h> defines the *_OK access constants." >&4
7882 elif $test `./findhdr fcntl.h` && \
7883 $cc $cppflags -DI_FCNTL -o access access.c >/dev/null 2>&1 ; then
7885 echo "<fcntl.h> defines the *_OK access constants." >&4
7886 elif $test `./findhdr unistd.h` && \
7887 $cc $cppflags -DI_UNISTD -o access access.c >/dev/null 2>&1 ; then
7888 echo "<unistd.h> defines the *_OK access constants." >&4
7890 echo "I can't find the four *_OK access constants--I'll use mine." >&4
7896 : see if accessx exists
7897 set accessx d_accessx
7900 : see if alarm exists
7904 : see if atolf exists
7908 : see if atoll exists
7912 : Look for GNU-cc style attribute checking
7914 echo "Checking whether your compiler can handle __attribute__ ..." >&4
7915 $cat >attrib.c <<'EOCP'
7917 void croak (char* pat,...) __attribute__((format(printf,1,2),noreturn));
7919 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
7920 if $contains 'warning' attrib.out >/dev/null 2>&1; then
7921 echo "Your C compiler doesn't fully support __attribute__."
7924 echo "Your C compiler supports __attribute__."
7928 echo "Your C compiler doesn't seem to understand __attribute__ at all."
7935 : see if bcmp exists
7939 : see if bcopy exists
7943 : see if this is a unistd.h system
7944 set unistd.h i_unistd
7947 : see if getpgrp exists
7948 set getpgrp d_getpgrp
7951 case "$d_getpgrp" in
7954 echo "Checking to see which flavor of getpgrp is in use..."
7957 #include <sys/types.h>
7959 # include <unistd.h>
7963 if (getuid() == 0) {
7964 printf("(I see you are running Configure as super-user...)\n");
7968 if (getpgrp(1) == 0)
7977 if $cc -DTRY_BSD_PGRP $ccflags $ldflags -o set set.c $libs >/dev/null 2>&1 && ./set; then
7978 echo "You have to use getpgrp(pid) instead of getpgrp()." >&4
7980 elif $cc $ccflags $ldflags -o set set.c $libs >/dev/null 2>&1 && ./set; then
7981 echo "You have to use getpgrp() instead of getpgrp(pid)." >&4
7984 echo "I can't seem to compile and run the test program."
7986 xxx="a USG one, i.e. you use getpgrp()."
7988 # SVR4 systems can appear rather BSD-ish.
7991 xxx="a BSD one, i.e. you use getpgrp(pid)."
7995 xxx="probably a USG one, i.e. you use getpgrp()."
8000 echo "Assuming your getpgrp is $xxx" >&4
8009 : see if setpgrp exists
8010 set setpgrp d_setpgrp
8013 case "$d_setpgrp" in
8016 echo "Checking to see which flavor of setpgrp is in use..."
8019 #include <sys/types.h>
8021 # include <unistd.h>
8025 if (getuid() == 0) {
8026 printf("(I see you are running Configure as super-user...)\n");
8030 if (-1 == setpgrp(1, 1))
8033 if (setpgrp() != -1)
8039 if $cc -DTRY_BSD_PGRP $ccflags $ldflags -o set set.c $libs >/dev/null 2>&1 && ./set; then
8040 echo 'You have to use setpgrp(pid,pgrp) instead of setpgrp().' >&4
8042 elif $cc $ccflags $ldflags -o set set.c $libs >/dev/null 2>&1 && ./set; then
8043 echo 'You have to use setpgrp() instead of setpgrp(pid,pgrp).' >&4
8046 echo "(I can't seem to compile and run the test program.)"
8048 xxx="a USG one, i.e. you use setpgrp()."
8050 # SVR4 systems can appear rather BSD-ish.
8053 xxx="a BSD one, i.e. you use setpgrp(pid,pgrp)."
8057 xxx="probably a USG one, i.e. you use setpgrp()."
8062 echo "Assuming your setpgrp is $xxx" >&4
8070 : see if bzero exists
8074 : see if signal is declared as pointer to function returning int or void
8076 xxx=`./findhdr signal.h`
8077 $test "$xxx" && $cppstdin $cppminus $cppflags < $xxx >$$.tmp 2>/dev/null
8078 if $contains 'int.*\*[ ]*signal' $$.tmp >/dev/null 2>&1 ; then
8079 echo "You have int (*signal())() instead of void." >&4
8081 elif $contains 'void.*\*[ ]*signal' $$.tmp >/dev/null 2>&1 ; then
8082 echo "You have void (*signal())()." >&4
8084 elif $contains 'extern[ ]*[(\*]*signal' $$.tmp >/dev/null 2>&1 ; then
8085 echo "You have int (*signal())() instead of void." >&4
8087 elif $contains 'void.*\*.*sig' $$.tmp >/dev/null 2>&1 ; then
8088 echo "You have void (*signal())()." >&4
8091 case "$d_voidsig" in
8093 echo "I can't determine whether signal handler returns void or int..." >&4
8095 rp="What type does your signal handler return?"
8102 echo "As you already told me, signal handler returns void." >&4
8105 *) echo "As you already told me, signal handler returns int." >&4
8112 case "$d_voidsig" in
8113 "$define") signal_t="void";;
8118 : check for ability to cast large floats to 32-bit ints.
8120 echo 'Checking whether your C compiler can cast large floats to int32.' >&4
8121 if $test "$intsize" -ge 4; then
8128 #include <sys/types.h>
8130 $signal_t blech(s) int s; { exit(3); }
8137 signal(SIGFPE, blech);
8139 /* Don't let compiler optimize the test away. Store the number
8140 in a writable string for gcc to pass to sscanf under HP/UX.
8142 sprintf(str, "2147483647");
8143 sscanf(str, "%lf", &f); /* f = (double) 0x7fffffff; */
8147 /* x86 processors will probably give 0x8000 0000, which is a
8148 sign change. We don't want that. We want to mimic SPARC
8149 behavior here, which is to preserve the sign and give
8152 if (i32 != ($xxx) f)
8158 if eval $compile_ok; then
8162 echo "(I can't seem to compile the test program--assuming it can't)"
8170 echo "Nope, it can't."
8177 : check for ability to cast negative floats to unsigned
8179 echo 'Checking whether your C compiler can cast negative float to unsigned.' >&4
8182 #include <sys/types.h>
8184 $signal_t blech(s) int s; { exit(7); }
8185 $signal_t blech_in_list(s) int s; { exit(4); }
8186 unsigned long dummy_long(p) unsigned long p; { return p; }
8187 unsigned int dummy_int(p) unsigned int p; { return p; }
8188 unsigned short dummy_short(p) unsigned short p; { return p; }
8192 unsigned long along;
8194 unsigned short ashort;
8198 /* Frustrate gcc-2.7.2's optimizer which failed this test with
8199 a direct f = -123. assignment. gcc-2.8.0 reportedly
8200 optimized the whole file away
8202 /* Store the number in a writable string for gcc to pass to
8205 sprintf(str, "-123");
8206 sscanf(str, "%lf", &f); /* f = -123.; */
8208 signal(SIGFPE, blech);
8209 along = (unsigned long)f;
8210 aint = (unsigned int)f;
8211 ashort = (unsigned short)f;
8212 if (along != (unsigned long)-123)
8214 if (aint != (unsigned int)-123)
8216 if (ashort != (unsigned short)-123)
8218 sprintf(str, "1073741824.");
8219 sscanf(str, "%lf", &f); /* f = (double)0x40000000; */
8222 along = (unsigned long)f;
8223 if (along != 0x80000000)
8227 along = (unsigned long)f;
8228 if (along != 0x7fffffff)
8232 along = (unsigned long)f;
8233 if (along != 0x80000001)
8237 signal(SIGFPE, blech_in_list);
8238 sprintf(str, "123.");
8239 sscanf(str, "%lf", &f); /* f = 123.; */
8240 along = dummy_long((unsigned long)f);
8241 aint = dummy_int((unsigned int)f);
8242 ashort = dummy_short((unsigned short)f);
8243 if (along != (unsigned long)123)
8245 if (aint != (unsigned int)123)
8247 if (ashort != (unsigned short)123)
8254 if eval $compile_ok; then
8258 echo "(I can't seem to compile the test program--assuming it can't)"
8261 case "$castflags" in
8266 echo "Nope, it can't."
8273 : see if vprintf exists
8275 if set vprintf val -f d_vprintf; eval $csym; $val; then
8276 echo 'vprintf() found.' >&4
8278 $cat >vprintf.c <<'EOF'
8279 #include <varargs.h>
8281 int main() { xxx("foo"); }
8290 exit((unsigned long)vsprintf(buf,"%s",args) > 10L);
8294 if eval $compile && ./vprintf; then
8295 echo "Your vsprintf() returns (int)." >&4
8298 echo "Your vsprintf() returns (char*)." >&4
8302 echo 'vprintf() NOT found.' >&4
8312 : see if chown exists
8316 : see if chroot exists
8320 : see if chsize exists
8324 : check for const keyword
8326 echo 'Checking to see if your C compiler knows about "const"...' >&4
8327 $cat >const.c <<'EOCP'
8328 typedef struct spug { int drokk; } spug;
8335 if $cc -c $ccflags const.c >/dev/null 2>&1 ; then
8337 echo "Yup, it does."
8340 echo "Nope, it doesn't."
8345 : see if crypt exists
8347 if set crypt val -f d_crypt; eval $csym; $val; then
8348 echo 'crypt() found.' >&4
8352 cryptlib=`./loc Slibcrypt$_a "" $xlibpth`
8353 if $test -z "$cryptlib"; then
8354 cryptlib=`./loc Mlibcrypt$_a "" $xlibpth`
8358 if $test -z "$cryptlib"; then
8359 cryptlib=`./loc Llibcrypt$_a "" $xlibpth`
8363 if $test -z "$cryptlib"; then
8364 cryptlib=`./loc libcrypt$_a "" $libpth`
8368 if $test -z "$cryptlib"; then
8369 echo 'crypt() NOT found.' >&4
8378 : get csh whereabouts
8380 'csh') val="$undef" ;;
8385 : Respect a hint or command line value for full_csh.
8387 '') full_csh=$csh ;;
8390 : see if cuserid exists
8391 set cuserid d_cuserid
8394 : see if this is a limits.h system
8395 set limits.h i_limits
8398 : see if this is a float.h system
8402 : See if number of significant digits in a double precision number is known
8404 $cat >dbl_dig.c <<EOM
8414 printf("Contains DBL_DIG");
8417 $cppstdin $cppflags $cppminus < dbl_dig.c >dbl_dig.E 2>/dev/null
8418 if $contains 'DBL_DIG' dbl_dig.E >/dev/null 2>&1; then
8419 echo "DBL_DIG found." >&4
8422 echo "DBL_DIG NOT found." >&4
8429 : see if difftime exists
8430 set difftime d_difftime
8433 : see if this is a dirent system
8435 if xinc=`./findhdr dirent.h`; $test "$xinc"; then
8437 echo "<dirent.h> found." >&4
8440 if xinc=`./findhdr sys/dir.h`; $test "$xinc"; then
8441 echo "<sys/dir.h> found." >&4
8444 xinc=`./findhdr sys/ndir.h`
8446 echo "<dirent.h> NOT found." >&4
8451 : Look for type of directory structure.
8453 $cppstdin $cppflags $cppminus < "$xinc" > try.c
8455 case "$direntrytype" in
8458 $define) guess1='struct dirent' ;;
8459 *) guess1='struct direct' ;;
8462 *) guess1="$direntrytype"
8467 'struct dirent') guess2='struct direct' ;;
8468 *) guess2='struct dirent' ;;
8471 if $contains "$guess1" try.c >/dev/null 2>&1; then
8472 direntrytype="$guess1"
8473 echo "Your directory entries are $direntrytype." >&4
8474 elif $contains "$guess2" try.c >/dev/null 2>&1; then
8475 direntrytype="$guess2"
8476 echo "Your directory entries seem to be $direntrytype." >&4
8478 echo "I don't recognize your system's directory entries." >&4
8479 rp="What type is used for directory entries on this system?"
8487 : see if the directory entry stores field length
8489 $cppstdin $cppflags $cppminus < "$xinc" > try.c
8490 if $contains 'd_namlen' try.c >/dev/null 2>&1; then
8491 echo "Good, your directory entry keeps length information in d_namlen." >&4
8494 echo "Your directory entry does not know about the d_namlen field." >&4
8501 : see if dlerror exists
8504 set dlerror d_dlerror
8508 : see if dlfcn is available
8516 On a few systems, the dynamically loaded modules that perl generates and uses
8517 will need a different extension than shared libs. The default will probably
8525 rp='What is the extension of dynamically loaded modules'
8534 : Check if dlsym need a leading underscore
8540 echo "Checking whether your dlsym() needs a leading underscore ..." >&4
8541 $cat >dyna.c <<'EOM'
8550 #include <dlfcn.h> /* the dynamic linker include file for Sunos/Solaris */
8552 #include <sys/types.h>
8566 int mode = RTLD_LAZY ;
8568 handle = dlopen("./dyna.$dlext", mode) ;
8569 if (handle == NULL) {
8574 symbol = dlsym(handle, "fred") ;
8575 if (symbol == NULL) {
8576 /* try putting a leading underscore */
8577 symbol = dlsym(handle, "_fred") ;
8578 if (symbol == NULL) {
8591 : Call the object file tmp-dyna.o in case dlext=o.
8592 if $cc $ccflags $cccdlflags -c dyna.c > /dev/null 2>&1 &&
8593 mv dyna${_o} tmp-dyna${_o} > /dev/null 2>&1 &&
8594 $ld $lddlflags -o dyna.$dlext tmp-dyna${_o} > /dev/null 2>&1 &&
8595 $cc $ccflags -o fred $ldflags $cccdlflags $ccdlflags fred.c $libs > /dev/null 2>&1; then
8598 1) echo "Test program failed using dlopen." >&4
8599 echo "Perhaps you should not use dynamic loading." >&4;;
8600 2) echo "Test program failed using dlsym." >&4
8601 echo "Perhaps you should not use dynamic loading." >&4;;
8602 3) echo "dlsym needs a leading underscore" >&4
8604 4) echo "dlsym doesn't need a leading underscore." >&4;;
8607 echo "I can't compile and run the test program." >&4
8608 echo "I'm guessing that dlsym doesn't need a leading underscore." >&4
8613 $rm -f fred fred.? dyna.$dlext dyna.? tmp-dyna.?
8618 hasproto='varname=$1; func=$2; shift; shift;
8619 while $test $# -ge 2; do
8621 $define) echo "#include <$2>";;
8625 $cppstdin $cppflags $cppminus < try.c > tryout.c 2>/dev/null;
8626 if $contains "$func.*(" tryout.c >/dev/null 2>&1; then
8627 echo "$func() prototype found.";
8630 echo "$func() prototype NOT found.";
8635 $rm -f try.c tryout.c'
8637 : see if prototype for drand48 is available
8639 set d_drand48proto drand48 $i_stdlib stdlib.h $i_unistd unistd.h
8642 : see if dup2 exists
8646 : see if eaccess exists
8647 set eaccess d_eaccess
8650 : see if endgrent exists
8651 set endgrent d_endgrent
8654 : see if endhostent exists
8655 set endhostent d_endhent
8658 : see if endnetent exists
8659 set endnetent d_endnent
8662 : see if endprotoent exists
8663 set endprotoent d_endpent
8666 : see if endpwent exists
8667 set endpwent d_endpwent
8670 : see if endservent exists
8671 set endservent d_endsent
8674 : Locate the flags for 'open()'
8676 $cat >open3.c <<'EOCP'
8677 #include <sys/types.h>
8682 #include <sys/file.h>
8693 : check sys/file.h first to get FREAD on Sun
8694 if $test `./findhdr sys/file.h` && \
8695 set open3 -DI_SYS_FILE && eval $compile; then
8697 echo "<sys/file.h> defines the O_* constants..." >&4
8699 echo "and you have the 3 argument form of open()." >&4
8702 echo "but not the 3 argument form of open(). Oh, well." >&4
8705 elif $test `./findhdr fcntl.h` && \
8706 set open3 -DI_FCNTL && eval $compile; then
8708 echo "<fcntl.h> defines the O_* constants..." >&4
8710 echo "and you have the 3 argument form of open()." >&4
8713 echo "but not the 3 argument form of open(). Oh, well." >&4
8718 echo "I can't find the O_* constant definitions! You got problems." >&4
8724 : see which of string.h or strings.h is needed
8726 strings=`./findhdr string.h`
8727 if $test "$strings" && $test -r "$strings"; then
8728 echo "Using <string.h> instead of <strings.h>." >&4
8732 strings=`./findhdr strings.h`
8733 if $test "$strings" && $test -r "$strings"; then
8734 echo "Using <strings.h> instead of <string.h>." >&4
8736 echo "No string header found -- You'll surely have problems." >&4
8742 "$undef") strings=`./findhdr strings.h`;;
8743 *) strings=`./findhdr string.h`;;
8746 : check for non-blocking I/O stuff
8747 case "$h_sysfile" in
8748 true) echo "#include <sys/file.h>" > head.c;;
8751 true) echo "#include <fcntl.h>" > head.c;;
8752 *) echo "#include <sys/fcntl.h>" > head.c;;
8757 echo "Figuring out the flag used by open() for non-blocking I/O..." >&4
8758 case "$o_nonblock" in
8761 $cat >>try.c <<'EOCP'
8765 printf("O_NONBLOCK\n");
8769 printf("O_NDELAY\n");
8773 printf("FNDELAY\n");
8780 if eval $compile_ok; then
8782 case "$o_nonblock" in
8783 '') echo "I can't figure it out, assuming O_NONBLOCK will do.";;
8784 *) echo "Seems like we can use $o_nonblock.";;
8787 echo "(I can't compile the test program; pray O_NONBLOCK is right!)"
8790 *) echo "Using $hint value $o_nonblock.";;
8792 $rm -f try try.* .out core
8795 echo "Let's see what value errno gets from read() on a $o_nonblock file..." >&4
8801 #include <sys/types.h>
8804 #define MY_O_NONBLOCK $o_nonblock
8805 #ifndef errno /* XXX need better Configure test */
8816 #include <strings.h>
8818 $signal_t blech(x) int x; { exit(3); }
8820 $cat >> try.c <<'EOCP'
8828 pipe(pd); /* Down: child -> parent */
8829 pipe(pu); /* Up: parent -> child */
8832 close(pd[1]); /* Parent reads from pd[0] */
8833 close(pu[0]); /* Parent writes (blocking) to pu[1] */
8834 if (-1 == fcntl(pd[0], F_SETFL, MY_O_NONBLOCK))
8836 signal(SIGALRM, blech);
8838 if ((ret = read(pd[0], buf, 1)) > 0) /* Nothing to read! */
8840 sprintf(string, "%d\n", ret);
8841 write(2, string, strlen(string));
8844 if (errno == EAGAIN) {
8850 if (errno == EWOULDBLOCK)
8851 printf("EWOULDBLOCK\n");
8854 write(pu[1], buf, 1); /* Unblocks child, tell it to close our pipe */
8855 sleep(2); /* Give it time to close our pipe */
8857 ret = read(pd[0], buf, 1); /* Should read EOF */
8859 sprintf(string, "%d\n", ret);
8860 write(3, string, strlen(string));
8864 close(pd[0]); /* We write to pd[1] */
8865 close(pu[1]); /* We read from pu[0] */
8866 read(pu[0], buf, 1); /* Wait for parent to signal us we may continue */
8867 close(pd[1]); /* Pipe pd is now fully closed! */
8868 exit(0); /* Bye bye, thank you for playing! */
8872 if eval $compile_ok; then
8873 echo "$startsh" >mtry
8874 echo "./try >try.out 2>try.ret 3>try.err || exit 4" >>mtry
8876 ./mtry >/dev/null 2>&1
8878 0) eagain=`$cat try.out`;;
8879 1) echo "Could not perform non-blocking setting!";;
8880 2) echo "I did a successful read() for something that was not there!";;
8881 3) echo "Hmm... non-blocking I/O does not seem to be working!";;
8882 *) echo "Something terribly wrong happened during testing.";;
8884 rd_nodata=`$cat try.ret`
8885 echo "A read() system call with no data present returns $rd_nodata."
8886 case "$rd_nodata" in
8889 echo "(That's peculiar, fixing that to be -1.)"
8895 echo "Forcing errno EAGAIN on read() with no data available."
8899 echo "Your read() sets errno to $eagain when no data is available."
8902 status=`$cat try.err`
8904 0) echo "And it correctly returns 0 to signal EOF.";;
8905 -1) echo "But it also returns -1 to signal EOF, so be careful!";;
8906 *) echo "However, your read() returns '$status' on EOF??";;
8909 if test "$status" = "$rd_nodata"; then
8910 echo "WARNING: you can't distinguish between EOF and no data!"
8914 echo "I can't compile the test program--assuming errno EAGAIN will do."
8921 echo "Using $hint value $eagain."
8922 echo "Your read() returns $rd_nodata when no data is present."
8923 case "$d_eofnblk" in
8924 "$define") echo "And you can see EOF because read() returns 0.";;
8925 "$undef") echo "But you can't see EOF status from read() returned value.";;
8927 echo "(Assuming you can't see EOF status from read anyway.)"
8933 $rm -f try try.* .out core head.c mtry
8935 : see if fchmod exists
8939 : see if fchown exists
8943 : see if this is an fcntl system
8947 hasfield='varname=$1; struct=$2; field=$3; shift; shift; shift;
8948 while $test $# -ge 2; do
8950 $define) echo "#include <$2>";;
8954 echo "int main () { struct $struct foo; char* bar; bar = (char*)foo.$field; }" >> try.c;
8956 if eval $compile; then
8967 : see whether socket exists
8969 $echo $n "Hmm... $c" >&4
8970 if set socket val -f d_socket; eval $csym; $val; then
8971 echo "Looks like you have Berkeley networking support." >&4
8973 if set setsockopt val -f; eval $csym; $val; then
8976 echo "...but it uses the old BSD 4.1c interface, rather than 4.2." >&4
8980 if $contains socklib libc.list >/dev/null 2>&1; then
8981 echo "Looks like you have Berkeley networking support." >&4
8983 : we will have to assume that it supports the 4.2 BSD interface
8986 echo "You don't have Berkeley networking in libc$_a..." >&4
8987 if test "X$d_socket" = "X$define"; then
8988 echo "...but you seem to believe that you have sockets." >&4
8990 for net in net socket
8992 if test -f /usr/lib/lib$net$_a; then
8993 ( ($nm $nm_opt /usr/lib/lib$net$_a | eval $nm_extract) || \
8994 $ar t /usr/lib/lib$net$_a) 2>/dev/null >> libc.list
8995 if $contains socket libc.list >/dev/null 2>&1; then
9000 echo "...but the Wollongong group seems to have hacked it in." >&4
9001 sockethdr="-I/usr/netinclude"
9004 echo "Found Berkeley sockets interface in lib$net." >& 4
9005 if $contains setsockopt libc.list >/dev/null 2>&1; then
9008 echo "...using the old BSD 4.1c interface, rather than 4.2." >&4
9015 if test "X$d_socket" != "X$define"; then
9016 echo "or anywhere else I see." >&4
9024 : see if socketpair exists
9025 set socketpair d_sockpair
9030 echo "Checking the availability of certain socket constants..." >& 4
9031 for ENUM in MSG_CTRUNC MSG_DONTROUTE MSG_OOB MSG_PEEK MSG_PROXY SCM_RIGHTS; do
9032 enum=`$echo $ENUM|./tr '[A-Z]' '[a-z]'`
9034 #include <sys/types.h>
9035 #include <sys/socket.h>
9041 set try; if eval $compile; then
9044 set d_${enum}; eval $setvar
9048 : see if sys/select.h has to be included
9049 set sys/select.h i_sysselct
9052 : see if we should include time.h, sys/time.h, or both
9054 if test "X$timeincl" = X; then
9055 echo "Testing to see if we should include <time.h>, <sys/time.h> or both." >&4
9056 $echo $n "I'm now running the test program...$c"
9057 $cat >try.c <<'EOCP'
9058 #include <sys/types.h>
9063 #ifdef SYSTIMEKERNEL
9066 #include <sys/time.h>
9069 #include <sys/select.h>
9078 struct timezone tzp;
9080 if (foo.tm_sec == foo.tm_sec)
9083 if (bar.tv_sec == bar.tv_sec)
9090 for s_timezone in '-DS_TIMEZONE' ''; do
9092 for s_timeval in '-DS_TIMEVAL' ''; do
9093 for i_systimek in '' '-DSYSTIMEKERNEL'; do
9094 for i_time in '' '-DI_TIME'; do
9095 for i_systime in '-DI_SYSTIME' ''; do
9098 set try $i_time $i_systime $i_systimek $sysselect $s_timeval $s_timezone
9099 if eval $compile; then
9100 set X $i_time $i_systime $i_systimek $sysselect $s_timeval
9104 $echo $n "Succeeded with $flags$c"
9116 *SYSTIMEKERNEL*) i_systimek="$define"
9117 timeincl=`./findhdr sys/time.h`
9118 echo "We'll include <sys/time.h> with KERNEL defined." >&4;;
9119 *) i_systimek="$undef";;
9122 *I_TIME*) i_time="$define"
9123 timeincl=`./findhdr time.h`" $timeincl"
9124 echo "We'll include <time.h>." >&4;;
9125 *) i_time="$undef";;
9128 *I_SYSTIME*) i_systime="$define"
9129 timeincl=`./findhdr sys/time.h`" $timeincl"
9130 echo "We'll include <sys/time.h>." >&4;;
9131 *) i_systime="$undef";;
9136 : check for fd_set items
9139 Checking to see how well your C compiler handles fd_set and friends ...
9141 $cat >fd_set.c <<EOCP
9142 #$i_systime I_SYS_TIME
9143 #$i_sysselct I_SYS_SELECT
9144 #$d_socket HAS_SOCKET
9145 #include <sys/types.h>
9147 #include <sys/socket.h> /* Might include <sys/bsdtypes.h> */
9150 #include <sys/time.h>
9153 #include <sys/select.h>
9162 #if defined(FD_SET) && defined(FD_CLR) && defined(FD_ISSET) && defined(FD_ZERO)
9169 set fd_set -DTRYBITS
9170 if eval $compile; then
9171 d_fds_bits="$define"
9173 echo "Well, your system knows about the normal fd_set typedef..." >&4
9175 echo "and you have the normal fd_set macros (just as I'd expect)." >&4
9176 d_fd_macros="$define"
9179 but not the normal fd_set macros! Gaaack! I'll have to cover for you.
9181 d_fd_macros="$undef"
9185 Hmm, your compiler has some difficulty with fd_set. Checking further...
9188 if eval $compile; then
9191 echo "Well, your system has some sort of fd_set available..." >&4
9193 echo "and you have the normal fd_set macros." >&4
9194 d_fd_macros="$define"
9197 but not the normal fd_set macros! Gross! More work for me...
9199 d_fd_macros="$undef"
9202 echo "Well, you got zip. That's OK, I can roll my own fd_set stuff." >&4
9205 d_fd_macros="$undef"
9210 : see if fgetpos exists
9211 set fgetpos d_fgetpos
9214 : see if flock exists
9218 : see if fork exists
9222 : see if pathconf exists
9223 set pathconf d_pathconf
9226 : see if fpathconf exists
9227 set fpathconf d_fpathconf
9231 : check for fpos64_t
9233 echo "Checking to see if you have fpos64_t..." >&4
9236 int main() { fpos64_t x = 7; }
9239 if eval $compile; then
9241 echo "You have fpos64_t."
9244 echo "You do not have fpos64_t."
9246 8) echo "(Your fpos_t is 64 bits, so you could use that.)" ;;
9253 : see if frexpl exists
9257 hasstruct='varname=$1; struct=$2; shift; shift;
9258 while $test $# -ge 2; do
9260 $define) echo "#include <$2>";;
9264 echo "int main () { struct $struct foo; }" >> try.c;
9266 if eval $compile; then
9275 : see if this is a sys/param system
9276 set sys/param.h i_sysparam
9279 : see if this is a sys/mount.h system
9280 set sys/mount.h i_sysmount
9283 : see if sys/types.h has to be included
9284 set sys/types.h i_systypes
9289 echo "Checking to see if your system supports struct fs_data..." >&4
9290 set d_fs_data_s fs_data $i_systypes sys/types.h $i_sysparam sys/param.h $i_sysmount sys/mount.h
9292 case "$d_fs_data_s" in
9293 "$define") echo "Yes, it does." ;;
9294 *) echo "No, it doesn't." ;;
9297 : see if fseeko exists
9301 8) echo "(Your long is 64 bits, so you could use fseek.)" ;;
9304 : see if fsetpos exists
9305 set fsetpos d_fsetpos
9309 : see if fstatfs exists
9310 set fstatfs d_fstatfs
9314 : see if statvfs exists
9315 set statvfs d_statvfs
9318 : see if fstatvfs exists
9319 set fstatvfs d_fstatvfs
9323 : see if ftello exists
9327 8) echo "(Your long is 64 bits, so you could use ftell.)" ;;
9330 : see if getcwd exists
9334 : see if getespwnam exists
9335 set getespwnam d_getespwnam
9339 : see if getfsstat exists
9340 set getfsstat d_getfsstat
9343 : see if getgrent exists
9344 set getgrent d_getgrent
9347 : see if gethostbyaddr exists
9348 set gethostbyaddr d_gethbyaddr
9351 : see if gethostbyname exists
9352 set gethostbyname d_gethbyname
9355 : see if gethostent exists
9356 set gethostent d_gethent
9359 : see how we will look up host name
9362 if set gethostname val -f d_gethname; eval $csym; $val; then
9363 echo 'gethostname() found.' >&4
9364 d_gethname="$define"
9367 if set uname val -f d_uname; eval $csym; $val; then
9370 uname() was found, but you're running xenix, and older versions of xenix
9371 have a broken uname(). If you don't really know whether your xenix is old
9372 enough to have a broken system call, use the default answer.
9379 rp='Is your uname() broken?'
9382 n*) d_uname="$define"; call=uname;;
9385 echo 'uname() found.' >&4
9392 case "$d_gethname" in
9393 '') d_gethname="$undef";;
9396 '') d_uname="$undef";;
9398 case "$d_uname$d_gethname" in
9403 Every now and then someone has a $call() that lies about the hostname
9404 but can't be fixed for political or economic reasons. If you wish, I can
9405 pretend $call() isn't there and maybe compute hostname at run-time
9406 thanks to the '$phostname' command.
9409 rp="Shall I ignore $call() from now on?"
9412 y*) d_uname="$undef" d_gethname="$undef"; $echo $n "Okay...$c";;
9415 case "$phostname" in
9417 *) case "$aphostname" in
9423 file=`./loc $file $file $pth`
9424 aphostname=`echo $file $*`
9429 case "$d_uname$d_gethname" in
9432 case "$phostname" in
9434 echo "There will be no way for $package to get your hostname." >&4;;
9436 echo "I'll use 'popen("'"'$aphostname'", "r")'"' to get your hostname." >&4
9440 case "$d_phostname" in
9441 '') d_phostname="$undef";;
9444 : see if this is a netdb.h system
9448 : see if prototypes for various gethostxxx netdb.h functions are available
9450 set d_gethostprotos gethostent $i_netdb netdb.h
9453 : see if getlogin exists
9454 set getlogin d_getlogin
9457 : see if getmnt exists
9461 : see if getmntent exists
9462 set getmntent d_getmntent
9465 : see if getnetbyaddr exists
9466 set getnetbyaddr d_getnbyaddr
9469 : see if getnetbyname exists
9470 set getnetbyname d_getnbyname
9473 : see if getnetent exists
9474 set getnetent d_getnent
9477 : see if prototypes for various getnetxxx netdb.h functions are available
9479 set d_getnetprotos getnetent $i_netdb netdb.h
9483 : see if getprotobyname exists
9484 set getprotobyname d_getpbyname
9487 : see if getprotobynumber exists
9488 set getprotobynumber d_getpbynumber
9491 : see if getprotoent exists
9492 set getprotoent d_getpent
9495 : see if getpgid exists
9496 set getpgid d_getpgid
9499 : see if getpgrp2 exists
9500 set getpgrp2 d_getpgrp2
9503 : see if getppid exists
9504 set getppid d_getppid
9507 : see if getpriority exists
9508 set getpriority d_getprior
9511 : see if prototypes for various getprotoxxx netdb.h functions are available
9513 set d_getprotoprotos getprotoent $i_netdb netdb.h
9516 : see if getprpwnam exists
9517 set getprpwnam d_getprpwnam
9520 : see if getpwent exists
9521 set getpwent d_getpwent
9525 : see if getservbyname exists
9526 set getservbyname d_getsbyname
9529 : see if getservbyport exists
9530 set getservbyport d_getsbyport
9533 : see if getservent exists
9534 set getservent d_getsent
9537 : see if prototypes for various getservxxx netdb.h functions are available
9539 set d_getservprotos getservent $i_netdb netdb.h
9542 : see if getspnam exists
9543 set getspnam d_getspnam
9546 : see if gettimeofday or ftime exists
9547 set gettimeofday d_gettimeod
9549 case "$d_gettimeod" in
9555 val="$undef"; set d_ftime; eval $setvar
9558 case "$d_gettimeod$d_ftime" in
9561 echo 'No ftime() nor gettimeofday() -- timing may be less accurate.' >&4
9565 : see if this is an grp system
9571 xxx=`./findhdr grp.h`
9572 $cppstdin $cppflags $cppminus < $xxx >$$.h
9574 if $contains 'gr_passwd' $$.h >/dev/null 2>&1; then
9586 set d_grpasswd; eval $setvar
9590 : see if hasmntopt exists
9591 set hasmntopt d_hasmntopt
9594 : see if this is a netinet/in.h or sys/in.h system
9595 set netinet/in.h i_niin sys/in.h i_sysin
9598 : see if arpa/inet.h has to be included
9599 set arpa/inet.h i_arpainet
9602 : see if htonl --and friends-- exists
9607 : Maybe they are macros.
9612 #include <sys/types.h>
9613 #$i_niin I_NETINET_IN
9615 #$i_arpainet I_ARPA_INET
9617 #include <netinet/in.h>
9623 #include <arpa/inet.h>
9626 printf("Defined as a macro.");
9629 $cppstdin $cppflags $cppminus < htonl.c >htonl.E 2>/dev/null
9630 if $contains 'Defined as a macro' htonl.E >/dev/null 2>&1; then
9632 echo "But it seems to be defined as a macro." >&4
9640 : see if iconv exists
9646 if set index val -f; eval $csym; $val; then
9647 if set strchr val -f d_strchr; eval $csym; $val; then
9648 if $contains strchr "$strings" >/dev/null 2>&1 ; then
9651 echo "strchr() found." >&4
9655 echo "index() found." >&4
9660 echo "index() found." >&4
9663 if set strchr val -f d_strchr; eval $csym; $val; then
9666 echo "strchr() found." >&4
9668 echo "No index() or strchr() found!" >&4
9673 set d_strchr; eval $setvar
9675 set d_index; eval $setvar
9677 : check whether inet_aton exists
9678 set inet_aton d_inetaton
9681 : see if inttypes.h is available
9682 : we want a real compile instead of Inhdr because some systems
9683 : have an inttypes.h which includes non-existent headers
9686 #include <inttypes.h>
9688 static int32_t foo32 = 0x12345678;
9692 if eval $compile; then
9693 echo "<inttypes.h> found." >&4
9696 echo "<inttypes.h> NOT found." >&4
9705 echo "Checking to see if you have int64_t..." >&4
9707 #include <sys/types.h>
9708 #$i_inttypes I_INTTYPES
9710 #include <inttypes.h>
9712 int main() { int64_t x = 7; }
9715 if eval $compile; then
9717 echo "You have int64_t."
9720 echo "You do not have int64_t."
9728 $cat >isascii.c <<'EOCP'
9740 if eval $compile; then
9741 echo "isascii() found." >&4
9744 echo "isascii() NOT found." >&4
9751 : see if isnan exists
9755 : see if isnanl exists
9759 : see if killpg exists
9763 : see if lchown exists
9765 $cat > try.c <<'EOCP'
9766 /* System header to define __stub macros and hopefully few prototypes,
9767 which can conflict with char lchown(); below. */
9769 /* Override any gcc2 internal prototype to avoid an error. */
9770 /* We use char because int might match the return type of a gcc2
9771 builtin and then its argument prototype would still apply. */
9774 /* The GNU C library defines this for functions which it implements
9775 to always fail with ENOSYS. Some functions are actually named
9776 something starting with __ and the normal name is an alias. */
9777 #if defined (__stub_lchown) || defined (__stub___lchown)
9785 if eval $compile; then
9786 $echo "lchown() found." >&4
9789 $echo "lchown() NOT found." >&4
9795 : See if number of significant digits in a double precision number is known
9797 $cat >ldbl_dig.c <<EOM
9807 printf("Contains LDBL_DIG");
9810 $cppstdin $cppflags $cppminus < ldbl_dig.c >ldbl_dig.E 2>/dev/null
9811 if $contains 'LDBL_DIG' ldbl_dig.E >/dev/null 2>&1; then
9812 echo "LDBL_DIG found." >&4
9815 echo "LDBL_DIG NOT found." >&4
9822 : see if link exists
9826 : see if localeconv exists
9827 set localeconv d_locconv
9830 : see if lockf exists
9834 : check for long long
9836 echo "Checking to see if you have long long..." >&4
9837 echo 'int main() { long long x = 7; return 0; }' > try.c
9839 if eval $compile; then
9841 echo "You have long long."
9844 echo "You do not have long long."
9850 : check for length of long long
9851 case "${d_longlong}${longlongsize}" in
9854 echo "Checking to see how big your long longs are..." >&4
9855 $cat >try.c <<'EOCP'
9859 printf("%d\n", (int)sizeof(long long));
9864 if eval $compile_ok; then
9865 longlongsize=`./try$exe_ext`
9866 echo "Your long longs are $longlongsize bytes long."
9870 echo "(I can't seem to compile the test program. Guessing...)"
9871 rp="What is the size of a long long (in bytes)?"
9875 if $test "X$longsize" = "X$longlongsize"; then
9876 echo "(That isn't any different from an ordinary long.)"
9882 : see if prototype for lseek is available
9884 set d_lseekproto lseek $i_systypes sys/types.h $i_unistd unistd.h
9887 : see if lstat exists
9891 : see if madvise exists
9892 set madvise d_madvise
9895 : see if mblen exists
9899 : see if mbstowcs exists
9900 set mbstowcs d_mbstowcs
9903 : see if mbtowc exists
9907 : see if memchr exists
9911 : see if memcmp exists
9915 : see if memcpy exists
9919 : see if memmove exists
9920 set memmove d_memmove
9923 : see if memset exists
9927 : see if mkdir exists
9931 : see if mkdtemp exists
9932 set mkdtemp d_mkdtemp
9935 : see if mkfifo exists
9939 : see if mkstemp exists
9940 set mkstemp d_mkstemp
9943 : see if mkstemps exists
9944 set mkstemps d_mkstemps
9947 : see if mktime exists
9951 : see if this is a sys/mman.h system
9952 set sys/mman.h i_sysmman
9955 : see if mmap exists
9958 : see what shmat returns
9959 : default to something harmless
9961 case "$i_sysmman$d_mmap" in
9963 $cat >mmap.c <<'END'
9964 #include <sys/mman.h>
9967 if $cc $ccflags -c mmap.c >/dev/null 2>&1; then
9972 echo "and it returns ($mmaptype)." >&4
9978 : see if modfl exists
9982 : see if mprotect exists
9983 set mprotect d_mprotect
9986 : see if msgctl exists
9990 : see if msgget exists
9994 : see if msgsnd exists
9998 : see if msgrcv exists
10002 : see how much of the 'msg*(2)' library is present.
10005 case "$d_msgctl$d_msgget$d_msgsnd$d_msgrcv" in
10006 *"$undef"*) h_msg=false;;
10010 case "`ipcs 2>&1`" in
10011 "SVID messages"*"not configured"*)
10012 echo "Your $osname does not have the msg*(2) configured." >&4
10015 set msgctl d_msgctl
10017 set msgget d_msgget
10019 set msgsnd d_msgsnd
10021 set msgrcv d_msgrcv
10027 : we could also check for sys/ipc.h ...
10028 if $h_msg && $test `./findhdr sys/msg.h`; then
10029 echo "You have the full msg*(2) library." >&4
10032 echo "You don't have the full msg*(2) library." >&4
10038 : see if msync exists
10042 : see if munmap exists
10043 set munmap d_munmap
10046 : see if nice exists
10052 echo "Checking which 64-bit integer type we could use..." >&4
10058 val='"unsigned int"'
10063 *) case "$longsize" in
10067 val='"unsigned long"'
10072 *) case "$d_longlong:$longlongsize" in
10077 val='"unsigned long long"'
10082 *) case "$d_int64_t" in
10100 case "$quadtype" in
10101 '') echo "Alas, no 64-bit integer types in sight." >&4
10104 *) if test X"$use64bitint" = Xdefine -o X"$longsize" = X8; then
10109 echo "We $verb use '$quadtype' for 64-bit integers." >&4
10114 : check for length of character
10116 case "$charsize" in
10118 echo "Checking to see how big your characters are (hey, you never know)..." >&4
10119 $cat >try.c <<'EOCP'
10123 printf("%d\n", (int)sizeof(char));
10128 if eval $compile_ok; then
10132 echo "(I can't seem to compile the test program. Guessing...)"
10139 rp="What is the size of a character (in bytes)?"
10146 $echo "Choosing the C types to be used for Perl's internal types..." >&4
10148 case "$use64bitint:$d_quad:$quadtype" in
10151 uvtype="$uquadtype"
10156 uvtype="unsigned long"
10162 case "$uselongdouble:$d_longdbl" in
10164 nvtype="long double"
10165 nvsize=$longdblsize
10172 $echo "(IV will be "$ivtype", $ivsize bytes)"
10173 $echo "(UV will be "$uvtype", $uvsize bytes)"
10174 $echo "(NV will be "$nvtype", $nvsize bytes)"
10177 #$i_inttypes I_INTTYPES
10179 #include <inttypes.h>
10184 int8_t i = INT8_MAX;
10185 uint8_t u = UINT8_MAX;
10186 printf("int8_t\n");
10189 int16_t i = INT16_MAX;
10190 uint16_t i = UINT16_MAX;
10191 printf("int16_t\n");
10194 int32_t i = INT32_MAX;
10195 uint32_t u = UINT32_MAX;
10196 printf("int32_t\n");
10202 '') case "$charsize" in
10204 u8type="unsigned char"
10213 if eval $compile; then
10214 case "`./try$exe_ext`" in
10215 int8_t) i8type=int8_t
10225 '') if $test $charsize -ge 1; then
10227 u8type="unsigned char"
10235 '') case "$shortsize" in
10237 u16type="unsigned short"
10245 '') set try -DINT16
10246 if eval $compile; then
10247 case "`./try$exe_ext`" in
10259 '') if $test $shortsize -ge 2; then
10261 u16type="unsigned short"
10269 '') case "$longsize" in
10271 u32type="unsigned long"
10275 *) case "$intsize" in
10277 u32type="unsigned int"
10287 '') set try -DINT32
10288 if eval $compile; then
10289 case "`./try$exe_ext`" in
10301 '') if $test $intsize -ge 4; then
10303 u32type="unsigned int"
10311 '') case "$d_quad:$quadtype" in
10313 i64type="$quadtype"
10314 u64type="$uquadtype"
10322 $echo "Checking whether your NVs can preserve your UVs..." >&4
10326 $uvtype k = ($uvtype)~0, l;
10332 printf("preserve\n");
10337 if eval $compile; then
10338 case "`./try$exe_ext`" in
10339 preserve) d_nv_preserves_uv="$define" ;;
10342 case "$d_nv_preserves_uv" in
10343 $define) $echo "Yes, they can." 2>&1 ;;
10344 *) $echo "No, they can't." 2>&1
10345 d_nv_preserves_uv="$undef"
10351 case "$d_nv_preserves_uv" in
10352 "$define") d_nv_preserves_uv_bits=`expr $uvsize \* 8` ;;
10353 *) $echo "Checking how many bits of your UVs your NVs can preserve..." >&4
10358 int n = 8 * $uvsize;
10360 for (i = 0; i < n; i++) {
10361 u = u << 1 | ($uvtype)1;
10362 if (($uvtype)($nvtype)u != u)
10370 if eval $compile; then
10371 d_nv_preserves_uv_bits="`./try$exe_ext`"
10373 case "$d_nv_preserves_uv_bits" in
10374 [1-9]*) $echo "Your NVs can preserve $d_nv_preserves_uv_bits bits of your UVs." 2>&1 ;;
10375 *) $echo "Can't figure out how many bits your NVs preserve." 2>&1
10376 d_nv_preserves_uv_bits="$undef"
10385 : check for off64_t
10387 echo "Checking to see if you have off64_t..." >&4
10389 #include <sys/types.h>
10390 #include <unistd.h>
10391 int main() { off64_t x = 7; }
10394 if eval $compile; then
10396 echo "You have off64_t."
10399 echo "You do not have off64_t."
10400 case "$lseeksize" in
10401 8) echo "(Your off_t is 64 bits, so you could use that.)" ;;
10408 : see if POSIX threads are available
10409 set pthread.h i_pthread
10415 : how to create joinable pthreads
10416 if test "X$usethreads" = "X$define" -a "X$i_pthread" = "X$define"; then
10418 echo "Checking what constant to use for creating joinable pthreads..." >&4
10419 $cat >try.c <<'EOCP'
10420 #include <pthread.h>
10422 int detachstate = JOINABLE;
10425 set try -DJOINABLE=PTHREAD_CREATE_JOINABLE
10426 if eval $compile; then
10427 echo "You seem to use PTHREAD_CREATE_JOINABLE." >&4
10428 val="$undef" # Yes, undef.
10429 set d_old_pthread_create_joinable
10432 set old_pthread_create_joinable
10435 set try -DJOINABLE=PTHREAD_CREATE_UNDETACHED
10436 if eval $compile; then
10437 echo "You seem to use PTHREAD_CREATE_UNDETACHED." >&4
10439 set d_old_pthread_create_joinable
10441 val=PTHREAD_CREATE_UNDETACHED
10442 set old_pthread_create_joinable
10445 set try -DJOINABLE=__UNDETACHED
10446 if eval $compile; then
10447 echo "You seem to use __UNDETACHED." >&4
10449 set d_old_pthread_create_joinable
10452 set old_pthread_create_joinable
10455 echo "Egads, nothing obvious found. Guessing that you use 0." >&4
10457 set d_old_pthread_create_joinable
10460 set old_pthread_create_joinable
10467 d_old_pthread_create_joinable="$undef"
10468 old_pthread_create_joinable=""
10471 : see if pause exists
10475 : see if pipe exists
10479 : see if poll exists
10484 echo "Checking how many exponent digits your sprintf formats use..."
10485 $cat >try.c <<'EOSC'
10489 exit(sprintf(b, "%0.1e", 1.2) - 5);
10493 if eval $compile; then
10496 2|3) d_printf_exp_digits=$? ;;
10499 case "$d_printf_exp_digits" in
10500 2|3) echo "Your sprintf seems to use $d_printf_exp_digits exponent digits."
10503 I do not understand what your sprintf is saying.
10504 I'm guessing it uses at least 2 exponent digits.
10506 d_printf_exp_digits=2
10512 : see whether the various POSIXish _yields exist
10514 #include <pthread.h>
10520 #ifdef PTHREAD_YIELD
10523 #ifdef PTHREAD_YIELD_NULL
10524 pthread_yield(NULL);
10530 : see if sched_yield exists
10531 set try -DSCHED_YIELD
10532 if eval $compile; then
10534 sched_yield='sched_yield()'
10538 case "$usethreads" in
10541 $define) echo 'sched_yield() found.' >&4 ;;
10542 *) echo 'sched_yield() NOT found.' >&4 ;;
10548 : see if pthread_yield exists
10549 set try -DPTHREAD_YIELD
10550 if eval $compile; then
10552 case "$sched_yield" in
10553 '') sched_yield='pthread_yield()' ;;
10556 set try -DPTHREAD_YIELD_NULL
10557 if eval $compile; then
10559 case "$sched_yield" in
10560 '') sched_yield='pthread_yield(NULL)' ;;
10566 case "$usethreads" in
10569 $define) echo 'pthread_yield() found.' >&4 ;;
10570 *) echo 'pthread_yield() NOT found.' >&4 ;;
10574 set d_pthread_yield
10577 case "$sched_yield" in
10578 '') sched_yield=undef ;;
10583 : see if this is a pwd.h system
10589 xxx=`./findhdr pwd.h`
10590 $cppstdin $cppflags $cppminus < $xxx >$$.h
10592 if $contains 'pw_quota' $$.h >/dev/null 2>&1; then
10600 if $contains 'pw_age' $$.h >/dev/null 2>&1; then
10608 if $contains 'pw_change' $$.h >/dev/null 2>&1; then
10616 if $contains 'pw_class' $$.h >/dev/null 2>&1; then
10624 if $contains 'pw_expire' $$.h >/dev/null 2>&1; then
10632 if $contains 'pw_comment' $$.h >/dev/null 2>&1; then
10640 if $contains 'pw_gecos' $$.h >/dev/null 2>&1; then
10648 if $contains 'pw_passwd' $$.h >/dev/null 2>&1; then
10660 set d_pwquota; eval $setvar
10661 set d_pwage; eval $setvar
10662 set d_pwchange; eval $setvar
10663 set d_pwclass; eval $setvar
10664 set d_pwexpire; eval $setvar
10665 set d_pwcomment; eval $setvar
10666 set d_pwgecos; eval $setvar
10667 set d_pwpasswd; eval $setvar
10671 : see if readdir and friends exist
10672 set readdir d_readdir
10674 set seekdir d_seekdir
10676 set telldir d_telldir
10678 set rewinddir d_rewinddir
10681 : see if readlink exists
10682 set readlink d_readlink
10685 : see if rename exists
10686 set rename d_rename
10689 : see if rmdir exists
10693 : see if memory.h is available.
10698 : See if it conflicts with string.h
10704 $cppstdin $cppflags $cppminus < $strings > mem.h
10705 if $contains 'memcpy' mem.h >/dev/null 2>&1; then
10707 echo "We won't be including <memory.h>."
10717 : can bcopy handle overlapping blocks?
10722 echo "Checking to see if your bcopy() can do overlapping copies..." >&4
10724 #$i_memory I_MEMORY
10725 #$i_stdlib I_STDLIB
10726 #$i_string I_STRING
10727 #$i_unistd I_UNISTD
10729 $cat >>try.c <<'EOCP'
10732 # include <memory.h>
10735 # include <stdlib.h>
10738 # include <string.h>
10740 # include <strings.h>
10743 # include <unistd.h> /* Needed for NetBSD */
10747 char buf[128], abc[128];
10753 bcopy("abcdefghijklmnopqrstuvwxyz0123456789", abc, 36);
10755 for (align = 7; align >= 0; align--) {
10756 for (len = 36; len; len--) {
10758 bcopy(abc, b, len);
10759 for (off = 1; off <= len; off++) {
10760 bcopy(b, b+off, len);
10761 bcopy(b+off, b, len);
10762 if (bcmp(b, abc, len))
10771 if eval $compile_ok; then
10772 if ./try 2>/dev/null; then
10773 echo "Yes, it can."
10776 echo "It can't, sorry."
10777 case "$d_memmove" in
10778 "$define") echo "But that's Ok since you have memmove()." ;;
10782 echo "(I can't compile the test program, so we'll assume not...)"
10783 case "$d_memmove" in
10784 "$define") echo "But that's Ok since you have memmove()." ;;
10789 $rm -f try.* try core
10793 : can memcpy handle overlapping blocks?
10795 case "$d_memcpy" in
10798 echo "Checking to see if your memcpy() can do overlapping copies..." >&4
10800 #$i_memory I_MEMORY
10801 #$i_stdlib I_STDLIB
10802 #$i_string I_STRING
10803 #$i_unistd I_UNISTD
10805 $cat >>try.c <<'EOCP'
10808 # include <memory.h>
10811 # include <stdlib.h>
10814 # include <string.h>
10816 # include <strings.h>
10819 # include <unistd.h> /* Needed for NetBSD */
10823 char buf[128], abc[128];
10829 /* Copy "abcde..." string to char abc[] so that gcc doesn't
10830 try to store the string in read-only memory. */
10831 memcpy(abc, "abcdefghijklmnopqrstuvwxyz0123456789", 36);
10833 for (align = 7; align >= 0; align--) {
10834 for (len = 36; len; len--) {
10836 memcpy(b, abc, len);
10837 for (off = 1; off <= len; off++) {
10838 memcpy(b+off, b, len);
10839 memcpy(b, b+off, len);
10840 if (memcmp(b, abc, len))
10849 if eval $compile_ok; then
10850 if ./try 2>/dev/null; then
10851 echo "Yes, it can."
10854 echo "It can't, sorry."
10855 case "$d_memmove" in
10856 "$define") echo "But that's Ok since you have memmove()." ;;
10860 echo "(I can't compile the test program, so we'll assume not...)"
10861 case "$d_memmove" in
10862 "$define") echo "But that's Ok since you have memmove()." ;;
10867 $rm -f try.* try core
10871 : can memcmp be trusted to compare relative magnitude?
10873 case "$d_memcmp" in
10876 echo "Checking if your memcmp() can compare relative magnitude..." >&4
10878 #$i_memory I_MEMORY
10879 #$i_stdlib I_STDLIB
10880 #$i_string I_STRING
10881 #$i_unistd I_UNISTD
10883 $cat >>try.c <<'EOCP'
10886 # include <memory.h>
10889 # include <stdlib.h>
10892 # include <string.h>
10894 # include <strings.h>
10897 # include <unistd.h> /* Needed for NetBSD */
10903 if ((a < b) && memcmp(&a, &b, 1) < 0)
10909 if eval $compile_ok; then
10910 if ./try 2>/dev/null; then
10911 echo "Yes, it can."
10914 echo "No, it can't (it uses signed chars)."
10917 echo "(I can't compile the test program, so we'll assume not...)"
10921 $rm -f try.* try core
10925 : see if select exists
10926 set select d_select
10929 : see if semctl exists
10930 set semctl d_semctl
10933 : see if semget exists
10934 set semget d_semget
10937 : see if semop exists
10941 : see how much of the 'sem*(2)' library is present.
10944 case "$d_semctl$d_semget$d_semop" in
10945 *"$undef"*) h_sem=false;;
10949 case "`ipcs 2>&1`" in
10950 "SVID messages"*"not configured"*)
10951 echo "Your $osname does not have the sem*(2) configured." >&4
10954 set semctl d_semctl
10956 set semget d_semget
10964 : we could also check for sys/ipc.h ...
10965 if $h_sem && $test `./findhdr sys/sem.h`; then
10966 echo "You have the full sem*(2) library." >&4
10969 echo "You don't have the full sem*(2) library." >&4
10975 : see whether sys/sem.h defines union semun
10977 $cat > try.c <<'END'
10978 #include <sys/types.h>
10979 #include <sys/ipc.h>
10980 #include <sys/sem.h>
10981 int main () { union semun semun; semun.buf = 0; }
10984 if eval $compile; then
10985 echo "You have union semun in <sys/sem.h>." >&4
10988 echo "You do not have union semun in <sys/sem.h>." >&4
10991 $rm -f try try.c try.h
10995 : see how to do semctl IPC_STAT
10998 : see whether semctl IPC_STAT can use union semun
11003 # define S_IRUSR S_IREAD
11004 # define S_IWUSR S_IWRITE
11005 # define S_IXUSR S_IEXEC
11007 # define S_IRUSR 0400
11008 # define S_IWUSR 0200
11009 # define S_IXUSR 0100
11011 # define S_IRGRP (S_IRUSR>>3)
11012 # define S_IWGRP (S_IWUSR>>3)
11013 # define S_IXGRP (S_IXUSR>>3)
11014 # define S_IROTH (S_IRUSR>>6)
11015 # define S_IWOTH (S_IWUSR>>6)
11016 # define S_IXOTH (S_IXUSR>>6)
11019 # define S_IRWXU (S_IRUSR|S_IWUSR|S_IXUSR)
11020 # define S_IRWXG (S_IRGRP|S_IWGRP|S_IXGRP)
11021 # define S_IRWXO (S_IROTH|S_IWOTH|S_IXOTH)
11026 #include <sys/types.h>
11027 #include <sys/ipc.h>
11028 #include <sys/sem.h>
11029 #include <sys/stat.h>
11036 #$d_union_semun HAS_UNION_SEMUN
11039 #ifndef HAS_UNION_SEMUN
11042 struct semid_ds *buf;
11043 unsigned short *array;
11049 #if defined(IPC_PRIVATE) && defined(S_IRWXU) && defined(S_IRWXG) && defined(S_IRWXO) && defined(IPC_CREAT)
11050 sem = semget(IPC_PRIVATE, 1, S_IRWXU|S_IRWXG|S_IRWXO|IPC_CREAT);
11052 struct semid_ds argbuf;
11055 st = semctl(sem, 0, IPC_STAT, arg);
11059 # endif /* IPC_STAT */
11060 printf("semctl IPC_STAT failed: errno = %d\n", errno);
11062 if (semctl(sem, 0, IPC_RMID, arg) != 0)
11063 # endif /* IPC_RMID */
11064 printf("semctl IPC_RMID failed: errno = %d\n", errno);
11066 #endif /* IPC_PRIVATE && ... */
11067 printf("semget failed: errno = %d\n", errno);
11073 if eval $compile; then
11076 semun) val="$define" ;;
11082 case "$d_semctl_semun" in
11084 echo "You can use union semun for semctl IPC_STAT." >&4
11087 *) echo "You cannot use union semun for semctl IPC_STAT." >&4
11092 : see whether semctl IPC_STAT can use struct semid_ds pointer
11093 $cat > try.c <<'END'
11094 #include <sys/types.h>
11095 #include <sys/ipc.h>
11096 #include <sys/sem.h>
11097 #include <sys/stat.h>
11105 struct semid_ds arg;
11108 #if defined(IPC_PRIVATE) && defined(S_IRWXU) && defined(S_IRWXG) && defined(S_IRWXO) && defined(IPC_CREAT)
11109 sem = semget(IPC_PRIVATE, 1, S_IRWXU|S_IRWXG|S_IRWXO|IPC_CREAT);
11112 st = semctl(sem, 0, IPC_STAT, &arg);
11114 printf("semid_ds\n");
11116 # endif /* IPC_STAT */
11117 printf("semctl IPC_STAT failed: errno = %d\n", errno);
11119 if (semctl(sem, 0, IPC_RMID, &arg) != 0)
11120 # endif /* IPC_RMID */
11121 printf("semctl IPC_RMID failed: errno = %d\n", errno);
11123 #endif /* IPC_PRIVATE && ... */
11124 printf("semget failed: errno = %d\n", errno);
11131 if eval $compile; then
11134 semid_ds) val="$define" ;;
11138 set d_semctl_semid_ds
11140 case "$d_semctl_semid_ds" in
11142 echo "You can $also use struct semid_ds* for semctl IPC_STAT." >&4
11144 *) echo "You cannot use struct semid_ds* for semctl IPC_STAT." >&4
11151 # We do not have the full sem*(2) library, so assume we can not
11157 set d_semctl_semid_ds
11162 : see if setegid exists
11163 set setegid d_setegid
11166 : see if seteuid exists
11167 set seteuid d_seteuid
11170 : see if setgrent exists
11171 set setgrent d_setgrent
11174 : see if sethostent exists
11175 set sethostent d_sethent
11178 : see if setlinebuf exists
11179 set setlinebuf d_setlinebuf
11182 : see if setlocale exists
11183 set setlocale d_setlocale
11186 : see if setnetent exists
11187 set setnetent d_setnent
11190 : see if setprotoent exists
11191 set setprotoent d_setpent
11194 : see if setpgid exists
11195 set setpgid d_setpgid
11198 : see if setpgrp2 exists
11199 set setpgrp2 d_setpgrp2
11202 : see if setpriority exists
11203 set setpriority d_setprior
11206 : see if setproctitle exists
11207 set setproctitle d_setproctitle
11210 : see if setpwent exists
11211 set setpwent d_setpwent
11214 : see if setregid exists
11215 set setregid d_setregid
11217 set setresgid d_setresgid
11220 : see if setreuid exists
11221 set setreuid d_setreuid
11223 set setresuid d_setresuid
11226 : see if setrgid exists
11227 set setrgid d_setrgid
11230 : see if setruid exists
11231 set setruid d_setruid
11234 : see if setservent exists
11235 set setservent d_setsent
11238 : see if setsid exists
11239 set setsid d_setsid
11242 : see if setvbuf exists
11243 set setvbuf d_setvbuf
11246 : see if sfio.h is available
11251 : see if sfio library is available
11262 : Ok, but do we want to use it.
11266 true|$define|[yY]*) dflt='y';;
11269 echo "$package can use the sfio library, but it is experimental."
11270 rp="You seem to have sfio available, do you want to try using it?"
11274 *) echo "Ok, avoiding sfio this time. I'll use stdio instead."
11276 : Remove sfio from list of libraries to use
11277 set `echo X $libs | $sed -e 's/-lsfio / /' -e 's/-lsfio$//'`
11280 echo "libs = $libs" >&4
11284 *) case "$usesfio" in
11285 true|$define|[yY]*)
11286 echo "Sorry, cannot find sfio on this machine" >&4
11287 echo "Ignoring your setting of usesfio=$usesfio" >&4
11295 $define) usesfio='true';;
11296 *) usesfio='false';;
11299 : see if shmctl exists
11300 set shmctl d_shmctl
11303 : see if shmget exists
11304 set shmget d_shmget
11307 : see if shmat exists
11310 : see what shmat returns
11313 $cat >shmat.c <<'END'
11314 #include <sys/shm.h>
11317 if $cc $ccflags -c shmat.c >/dev/null 2>&1; then
11322 echo "and it returns ($shmattype)." >&4
11323 : see if a prototype for shmat is available
11324 xxx=`./findhdr sys/shm.h`
11325 $cppstdin $cppflags $cppminus < $xxx > shmat.c 2>/dev/null
11326 if $contains 'shmat.*(' shmat.c >/dev/null 2>&1; then
11337 set d_shmatprototype
11340 : see if shmdt exists
11344 : see how much of the 'shm*(2)' library is present.
11347 case "$d_shmctl$d_shmget$d_shmat$d_shmdt" in
11348 *"$undef"*) h_shm=false;;
11352 case "`ipcs 2>&1`" in
11353 "SVID shared memory"*"not configured"*)
11354 echo "Your $osname does not have the shm*(2) configured." >&4
11357 set shmctl d_shmctl
11359 set shmget d_shmget
11369 : we could also check for sys/ipc.h ...
11370 if $h_shm && $test `./findhdr sys/shm.h`; then
11371 echo "You have the full shm*(2) library." >&4
11374 echo "You don't have the full shm*(2) library." >&4
11381 : see if we have sigaction
11382 if set sigaction val -f d_sigaction; eval $csym; $val; then
11383 echo 'sigaction() found.' >&4
11384 $cat > try.c <<'EOP'
11386 #include <sys/types.h>
11387 #include <signal.h>
11390 struct sigaction act, oact;
11392 oact.sa_handler = 0;
11393 /* so that act and oact are used */
11394 exit(act.sa_flags == 0 && oact.sa_handler == 0);
11398 if eval $compile_ok; then
11401 echo "But you don't seem to have a useable struct sigaction." >&4
11405 echo 'sigaction NOT found.' >&4
11408 set d_sigaction; eval $setvar
11409 $rm -f try try$_o try.c
11411 : see if sigsetjmp exists
11413 case "$d_sigsetjmp" in
11415 $cat >try.c <<'EOP'
11416 #include <setjmp.h>
11421 if (sigsetjmp(env,1))
11424 siglongjmp(env, 1);
11429 if eval $compile; then
11430 if ./try >/dev/null 2>&1; then
11431 echo "POSIX sigsetjmp found." >&4
11435 Uh-Oh! You have POSIX sigsetjmp and siglongjmp, but they do not work properly!!
11441 echo "sigsetjmp not found." >&4
11445 *) val="$d_sigsetjmp"
11446 case "$d_sigsetjmp" in
11447 $define) echo "POSIX sigsetjmp found." >&4;;
11448 $undef) echo "sigsetjmp not found." >&4;;
11456 : see if sys/stat.h is available
11457 set sys/stat.h i_sysstat
11461 : see if stat knows about block sizes
11463 echo "Checking to see if your struct stat has st_blocks field..." >&4
11464 set d_statblks stat st_blocks $i_sysstat sys/stat.h
11468 : see if this is a sys/vfs.h system
11469 set sys/vfs.h i_sysvfs
11473 : see if this is a sys/statfs.h system
11474 set sys/statfs.h i_sysstatfs
11479 echo "Checking to see if your system supports struct statfs..." >&4
11480 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
11482 case "$d_statfs_s" in
11483 "$define") echo "Yes, it does." ;;
11484 *) echo "No, it doesn't." ;;
11489 : see if struct statfs knows about f_flags
11490 case "$d_statfs_s" in
11493 echo "Checking to see if your struct statfs has f_flags field..." >&4
11494 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
11498 set d_statfs_f_flags
11502 case "$d_statfs_f_flags" in
11503 "$define") echo "Yes, it does." ;;
11504 *) echo "No, it doesn't." ;;
11507 : see if _ptr and _cnt from stdio act std
11509 if $contains '_IO_fpos_t' `./findhdr stdio.h` `./findhdr libio.h` >/dev/null 2>&1 ; then
11510 echo "(Looks like you have stdio.h from Linux.)"
11511 case "$stdio_ptr" in
11512 '') stdio_ptr='((fp)->_IO_read_ptr)'
11515 *) ptr_lval=$d_stdio_ptr_lval;;
11517 case "$stdio_cnt" in
11518 '') stdio_cnt='((fp)->_IO_read_end - (fp)->_IO_read_ptr)'
11521 *) cnt_lval=$d_stdio_cnt_lval;;
11523 case "$stdio_base" in
11524 '') stdio_base='((fp)->_IO_read_base)';;
11526 case "$stdio_bufsiz" in
11527 '') stdio_bufsiz='((fp)->_IO_read_end - (fp)->_IO_read_base)';;
11530 case "$stdio_ptr" in
11531 '') stdio_ptr='((fp)->_ptr)'
11534 *) ptr_lval=$d_stdio_ptr_lval;;
11536 case "$stdio_cnt" in
11537 '') stdio_cnt='((fp)->_cnt)'
11540 *) cnt_lval=$d_stdio_cnt_lval;;
11542 case "$stdio_base" in
11543 '') stdio_base='((fp)->_base)';;
11545 case "$stdio_bufsiz" in
11546 '') stdio_bufsiz='((fp)->_cnt + (fp)->_ptr - (fp)->_base)';;
11549 : test whether _ptr and _cnt really work
11550 echo "Checking how std your stdio is..." >&4
11553 #define FILE_ptr(fp) $stdio_ptr
11554 #define FILE_cnt(fp) $stdio_cnt
11556 FILE *fp = fopen("try.c", "r");
11559 18 <= FILE_cnt(fp) &&
11560 strncmp(FILE_ptr(fp), "include <stdio.h>\n", 18) == 0
11568 if eval $compile; then
11570 echo "Your stdio acts pretty std."
11573 echo "Your stdio isn't very std."
11576 echo "Your stdio doesn't appear very std."
11582 : Can _ptr be used as an lvalue?
11583 case "$d_stdstdio$ptr_lval" in
11584 $define$define) val=$define ;;
11587 set d_stdio_ptr_lval
11590 : Can _cnt be used as an lvalue?
11591 case "$d_stdstdio$cnt_lval" in
11592 $define$define) val=$define ;;
11595 set d_stdio_cnt_lval
11598 : see if _base is also standard
11600 case "$d_stdstdio" in
11604 #define FILE_base(fp) $stdio_base
11605 #define FILE_bufsiz(fp) $stdio_bufsiz
11607 FILE *fp = fopen("try.c", "r");
11610 19 <= FILE_bufsiz(fp) &&
11611 strncmp(FILE_base(fp), "#include <stdio.h>\n", 19) == 0
11618 if eval $compile; then
11620 echo "And its _base field acts std."
11623 echo "But its _base field isn't std."
11626 echo "However, it seems to be lacking the _base field."
11635 Checking how to access stdio streams by file descriptor number...
11637 case "$stdio_stream_array" in
11638 '') $cat >try.c <<EOCP
11641 if (&STDIO_STREAM_ARRAY[fileno(stdin)] == stdin)
11645 for s in _iob __iob __sF
11647 set try -DSTDIO_STREAM_ARRAY=$s
11648 if eval $compile; then
11649 case "`./try$exe_ext`" in
11650 yes) stdio_stream_array=$s; break ;;
11654 $rm -f try.* try$exe_ext
11656 case "$stdio_stream_array" in
11658 I can't figure out how to access stdio streams by file descriptor number.
11660 d_stdio_stream_array="$undef"
11663 You can access stdio streams by file descriptor number by the $stdio_stream_array array.
11665 d_stdio_stream_array="$define"
11669 : see if strcoll exists
11670 set strcoll d_strcoll
11673 : check for structure copying
11675 echo "Checking to see if your C compiler can copy structs..." >&4
11676 $cat >try.c <<'EOCP'
11686 if $cc -c try.c >/dev/null 2>&1 ; then
11688 echo "Yup, it can."
11691 echo "Nope, it can't."
11697 : see if strerror and/or sys_errlist[] exist
11699 if test "X$d_strerror" = X -o "X$d_syserrlst" = X; then
11700 if set strerror val -f d_strerror; eval $csym; $val; then
11701 echo 'strerror() found.' >&4
11702 d_strerror="$define"
11703 d_strerrm='strerror(e)'
11704 if set sys_errlist val -a d_syserrlst; eval $csym; $val; then
11705 echo "(You also have sys_errlist[], so we could roll our own strerror.)"
11706 d_syserrlst="$define"
11708 echo "(Since you don't have sys_errlist[], sterror() is welcome.)"
11709 d_syserrlst="$undef"
11711 elif xxx=`./findhdr string.h`; test "$xxx" || xxx=`./findhdr strings.h`; \
11712 $contains '#[ ]*define.*strerror' "$xxx" >/dev/null 2>&1; then
11713 echo 'strerror() found in string header.' >&4
11714 d_strerror="$define"
11715 d_strerrm='strerror(e)'
11716 if set sys_errlist val -a d_syserrlst; eval $csym; $val; then
11717 echo "(Most probably, strerror() uses sys_errlist[] for descriptions.)"
11718 d_syserrlst="$define"
11720 echo "(You don't appear to have any sys_errlist[], how can this be?)"
11721 d_syserrlst="$undef"
11723 elif set sys_errlist val -a d_syserrlst; eval $csym; $val; then
11724 echo "strerror() not found, but you have sys_errlist[] so we'll use that." >&4
11725 d_strerror="$undef"
11726 d_syserrlst="$define"
11727 d_strerrm='((e)<0||(e)>=sys_nerr?"unknown":sys_errlist[e])'
11729 echo 'strerror() and sys_errlist[] NOT found.' >&4
11730 d_strerror="$undef"
11731 d_syserrlst="$undef"
11732 d_strerrm='"unknown"'
11736 : see if strtod exists
11737 set strtod d_strtod
11740 : see if strtol exists
11741 set strtol d_strtol
11744 : see if strtold exists
11745 set strtold d_strtold
11748 : see if strtoll exists
11749 set strtoll d_strtoll
11752 case "$d_longlong-$d_strtoll" in
11755 Checking whether your strtoll() works okay...
11757 $cat >try.c <<'EOCP'
11760 #define strtoll __strtoll
11763 extern long long int strtoll(char *s, char **, int);
11764 static int bad = 0;
11765 int check(char *s, long long ell, int een) {
11768 gll = strtoll(s, 0, 10);
11769 if (!((gll == ell) && (errno == een)))
11773 check(" 1", 1LL, 0);
11774 check(" 0", 0LL, 0);
11775 check("-1", -1LL, 0);
11776 check("-9223372036854775808", -9223372036854775808LL, 0);
11777 check("-9223372036854775808", -9223372036854775808LL, 0);
11778 check(" 9223372036854775807", 9223372036854775807LL, 0);
11779 check("-9223372036854775808", -9223372036854775808LL, 0);
11780 check(" 9223372036854775808", 9223372036854775807LL, ERANGE);
11781 check("-9223372036854775809", -9223372036854775808LL, ERANGE);
11787 if eval $compile; then
11789 ok) echo "Your strtoll() seems to be working okay." ;;
11791 Your strtoll() doesn't seem to be working okay.
11800 : see if strtoul exists
11801 set strtoul d_strtoul
11804 : see if strtoull exists
11805 set strtoull d_strtoull
11808 case "$d_longlong-$d_strtoull" in
11811 Checking whether your strtoull() works okay...
11813 $cat >try.c <<'EOCP'
11816 #define strtoull __strtoull
11819 extern unsigned long long int strtoull(char *s, char **, int);
11820 static int bad = 0;
11821 int check(char *s, long long eull, int een) {
11824 gull = strtoull(s, 0, 10);
11825 if (!((gull == eull) && (errno == een)))
11829 check(" 1", 1LL, 0);
11830 check(" 0", 0LL, 0);
11831 check("18446744073709551615", 18446744073709551615ULL, 0);
11832 check("18446744073709551616", 18446744073709551615ULL, ERANGE);
11838 if eval $compile; then
11840 ok) echo "Your strtoull() seems to be working okay." ;;
11842 Your strtoull() doesn't seem to be working okay.
11844 d_strtoull="$undef"
11851 : see if strtouq exists
11852 set strtouq d_strtouq
11855 : see if strxfrm exists
11856 set strxfrm d_strxfrm
11859 : see if symlink exists
11860 set symlink d_symlink
11863 : see if syscall exists
11864 set syscall d_syscall
11867 : see if sysconf exists
11868 set sysconf d_sysconf
11871 : see if system exists
11872 set system d_system
11875 : see if tcgetpgrp exists
11876 set tcgetpgrp d_tcgetpgrp
11879 : see if tcsetpgrp exists
11880 set tcsetpgrp d_tcsetpgrp
11883 : see if prototype for telldir is available
11885 set d_telldirproto telldir $i_systypes sys/types.h $i_dirent dirent.h
11888 : see if this is a sys/times.h system
11889 set sys/times.h i_systimes
11892 : see if times exists
11894 if set times val -f d_times; eval $csym; $val; then
11895 echo 'times() found.' >&4
11898 case "$i_systimes" in
11899 "$define") inc='sys/times.h';;
11901 rp="What is the type returned by times() on this system?"
11902 set clock_t clocktype long stdio.h sys/types.h $inc
11905 echo 'times() NOT found, hope that will do.' >&4
11910 : see if truncate exists
11911 set truncate d_truncate
11914 : see if tzname[] exists
11916 if set tzname val -a d_tzname; eval $csym; $val; then
11918 echo 'tzname[] found.' >&4
11921 echo 'tzname[] NOT found.' >&4
11926 : see if umask exists
11930 : see if ustat exists
11934 : backward compatibility for d_hvfork
11935 if test X$d_hvfork != X; then
11936 d_vfork="$d_hvfork"
11939 : see if there is a vfork
11944 : Ok, but do we want to use it. vfork is reportedly unreliable in
11945 : perl on Solaris 2.x, and probably elsewhere.
11949 case "$usevfork" in
11955 Perl can only use a vfork() that doesn't suffer from strict
11956 restrictions on calling functions or modifying global data in
11957 the child. For example, glibc-2.1 contains such a vfork()
11958 that is unsuitable. If your system provides a proper fork()
11959 call, chances are that you do NOT want perl to use vfork().
11962 rp="Do you still want to use vfork()?"
11967 echo "Ok, we won't use vfork()."
11976 $define) usevfork='true';;
11977 *) usevfork='false';;
11980 : see if this is an sysdir system
11981 set sys/dir.h i_sysdir
11984 : see if this is an sysndir system
11985 set sys/ndir.h i_sysndir
11988 : see if closedir exists
11989 set closedir d_closedir
11992 case "$d_closedir" in
11995 echo "Checking whether closedir() returns a status..." >&4
11996 cat > closedir.c <<EOM
11997 #$i_dirent I_DIRENT /**/
11998 #$i_sysdir I_SYS_DIR /**/
11999 #$i_sysndir I_SYS_NDIR /**/
12000 #$i_systypes I_SYS_TYPES /**/
12002 #if defined(I_SYS_TYPES)
12003 #include <sys/types.h>
12005 #if defined(I_DIRENT)
12006 #include <dirent.h>
12007 #if defined(NeXT) && defined(I_SYS_DIR) /* NeXT needs dirent + sys/dir.h */
12008 #include <sys/dir.h>
12012 #include <sys/ndir.h>
12016 #include <ndir.h> /* may be wrong in the future */
12018 #include <sys/dir.h>
12023 int main() { return closedir(opendir(".")); }
12026 if eval $compile_ok; then
12027 if ./closedir > /dev/null 2>&1 ; then
12028 echo "Yes, it does."
12031 echo "No, it doesn't."
12035 echo "(I can't seem to compile the test program--assuming it doesn't)"
12043 set d_void_closedir
12046 : check for volatile keyword
12048 echo 'Checking to see if your C compiler knows about "volatile"...' >&4
12049 $cat >try.c <<'EOCP'
12052 typedef struct _goo_struct goo_struct;
12053 goo_struct * volatile goo = ((goo_struct *)0);
12054 struct _goo_struct {
12059 typedef unsigned short foo_t;
12060 char *volatile foo;
12062 volatile foo_t blech;
12066 if $cc -c $ccflags try.c >/dev/null 2>&1 ; then
12068 echo "Yup, it does."
12071 echo "Nope, it doesn't."
12077 : see if there is a wait4
12081 : see if waitpid exists
12082 set waitpid d_waitpid
12085 : see if wcstombs exists
12086 set wcstombs d_wcstombs
12089 : see if wctomb exists
12090 set wctomb d_wctomb
12093 : preserve RCS keywords in files with variable substitution, grrr
12098 Revision='$Revision'
12100 case "$crosscompile" in
12101 ''|[nN]*) crosscompile="$undef" ;;
12105 next|rhapsody|darwin) multiarch="$define" ;;
12107 case "$multiarch" in
12108 ''|[nN]*) multiarch="$undef" ;;
12111 : check for alignment requirements
12113 case "$crosscompile$multiarch" in
12116 You seem to be either cross-compiling or doing a multiarchitecture build,
12117 skipping the memory alignment check.
12120 case "$alignbytes" in
12121 '') alignbytes=8 ;;
12125 case "$alignbytes" in
12126 '') echo "Checking alignment constraints..." >&4
12127 if $test "X$uselongdouble" = Xdefine -a "X$d_longdbl" = Xdefine; then
12128 $cat >try.c <<'EOCP'
12129 typedef long double NV;
12132 $cat >try.c <<'EOCP'
12136 $cat >>try.c <<'EOCP'
12144 printf("%d\n", (int)((char *)&try_algn.bar - (char *)&try_algn.foo));
12149 if eval $compile_ok; then
12153 echo "(I can't seem to compile the test program...)"
12156 *) dflt="$alignbytes"
12159 rp="Doubles must be aligned on a how-many-byte boundary?"
12167 : set the base revision
12170 : check for ordering of bytes in a long
12172 case "$crosscompile$multiarch" in
12175 You seem to be either cross-compiling or doing a multiarchitecture build,
12176 skipping the byteorder check.
12182 case "$byteorder" in
12185 In the following, larger digits indicate more significance. A big-endian
12186 machine like a Pyramid or a Motorola 680?0 chip will come out to 4321. A
12187 little-endian machine like a Vax or an Intel 80?86 chip would be 1234. Other
12188 machines may have weird orders like 3412. A Cray will report 87654321,
12189 an Alpha will report 12345678. If the test program works the default is
12191 I'm now running the test program...
12193 $cat >try.c <<'EOCP'
12200 char c[sizeof(long)];
12203 if (sizeof(long) > 4)
12204 u.l = (0x08070605L << 32) | 0x04030201L;
12207 for (i = 0; i < sizeof(long); i++)
12208 printf("%c", u.c[i]+'0');
12215 if eval $compile && ./try > /dev/null; then
12218 [1-4][1-4][1-4][1-4]|12345678|87654321)
12219 echo "(The test program ran ok.)"
12220 echo "byteorder=$dflt"
12223 ????|????????) echo "(The test program ran ok.)" ;;
12224 *) echo "(The test program didn't run right for some reason.)" ;;
12229 (I can't seem to compile the test program. Guessing big-endian...)
12232 case "$xxx_prompt" in
12234 rp="What is the order of bytes in a long?"
12248 : how do we catenate cpp tokens here?
12250 echo "Checking to see how your cpp does stuff like catenate tokens..." >&4
12251 $cat >cpp_stuff.c <<'EOCP'
12252 #define RCAT(a,b)a/**/b
12253 #define ACAT(a,b)a ## b
12257 $cppstdin $cppflags $cppminus <cpp_stuff.c >cpp_stuff.out 2>&1
12258 if $contains 'Circus' cpp_stuff.out >/dev/null 2>&1; then
12259 echo "Oh! Smells like ANSI's been here." >&4
12260 echo "We can catify or stringify, separately or together!"
12262 elif $contains 'Reiser' cpp_stuff.out >/dev/null 2>&1; then
12263 echo "Ah, yes! The good old days!" >&4
12264 echo "However, in the good old days we don't know how to stringify and"
12265 echo "catify at the same time."
12269 Hmm, I don't seem to be able to catenate tokens with your cpp. You're going
12270 to have to edit the values of CAT[2-5] in config.h...
12272 cpp_stuff="/* Help! How do we handle cpp_stuff? */*/"
12276 : see if this is a db.h system
12282 : Check db version.
12284 echo "Checking Berkeley DB version ..." >&4
12290 #include <sys/types.h>
12295 #ifdef DB_VERSION_MAJOR /* DB version >= 2 */
12296 int Major, Minor, Patch ;
12297 unsigned long Version ;
12298 (void)db_version(&Major, &Minor, &Patch) ;
12299 printf("You have Berkeley DB Version 2 or greater\n");
12301 printf("db.h is from Berkeley DB Version %d.%d.%d\n",
12302 DB_VERSION_MAJOR, DB_VERSION_MINOR, DB_VERSION_PATCH);
12303 printf("libdb is from Berkeley DB Version %d.%d.%d\n",
12304 Major, Minor, Patch) ;
12306 /* check that db.h & libdb are compatible */
12307 if (DB_VERSION_MAJOR != Major || DB_VERSION_MINOR != Minor || DB_VERSION_PATCH != Patch) {
12308 printf("db.h and libdb are incompatible\n") ;
12312 printf("db.h and libdb are compatible\n") ;
12314 Version = DB_VERSION_MAJOR * 1000000 + DB_VERSION_MINOR * 1000
12315 + DB_VERSION_PATCH ;
12317 /* needs to be >= 2.3.4 */
12318 if (Version < 2003004) {
12319 /* if (DB_VERSION_MAJOR == 2 && DB_VERSION_MINOR == 0 && DB_VERSION_PATCH < 5) { */
12320 printf("but Perl needs Berkeley DB 2.3.4 or greater\n") ;
12326 #if defined(_DB_H_) && defined(BTREEMAGIC) && defined(HASHMAGIC)
12327 printf("You have Berkeley DB Version 1\n");
12328 exit(0); /* DB version < 2: the coast is clear. */
12330 exit(1); /* <db.h> not Berkeley DB? */
12336 if eval $compile_ok && ./try; then
12337 echo 'Looks OK.' >&4
12339 echo "I can't use Berkeley DB with your <db.h>. I'll disable Berkeley DB." >&4
12343 : Remove db from list of libraries to use
12344 echo "Removing unusable -ldb from library list" >&4
12345 set `echo X $libs | $sed -e 's/-ldb / /' -e 's/-ldb$//'`
12348 echo "libs = $libs" >&4
12358 : Check the return type needed for hash
12360 echo "Checking return type needed for hash for Berkeley DB ..." >&4
12366 #include <sys/types.h>
12369 #ifndef DB_VERSION_MAJOR
12370 u_int32_t hash_cb (ptr, size)
12378 info.hash = hash_cb;
12382 if $cc $ccflags -c try.c >try.out 2>&1 ; then
12383 if $contains warning try.out >>/dev/null 2>&1 ; then
12386 db_hashtype='u_int32_t'
12389 : XXX Maybe we should just give up here.
12390 db_hashtype=u_int32_t
12392 echo "Help: I can't seem to compile the db test program." >&4
12393 echo "Something's wrong, but I'll assume you use $db_hashtype." >&4
12396 echo "Your version of Berkeley DB uses $db_hashtype for hash."
12398 *) db_hashtype=u_int32_t
12403 : Check the return type needed for prefix
12405 echo "Checking return type needed for prefix for Berkeley DB ..." >&4
12411 #include <sys/types.h>
12414 #ifndef DB_VERSION_MAJOR
12415 size_t prefix_cb (key1, key2)
12423 info.prefix = prefix_cb;
12427 if $cc $ccflags -c try.c >try.out 2>&1 ; then
12428 if $contains warning try.out >>/dev/null 2>&1 ; then
12429 db_prefixtype='int'
12431 db_prefixtype='size_t'
12434 db_prefixtype='size_t'
12435 : XXX Maybe we should just give up here.
12437 echo "Help: I can't seem to compile the db test program." >&4
12438 echo "Something's wrong, but I'll assume you use $db_prefixtype." >&4
12441 echo "Your version of Berkeley DB uses $db_prefixtype for prefix."
12443 *) db_prefixtype='size_t'
12447 : check for void type
12449 echo "Checking to see how well your C compiler groks the void type..." >&4
12450 case "$voidflags" in
12452 $cat >try.c <<'EOCP'
12458 extern void moo(); /* function returning void */
12459 void (*goo)(); /* ptr to func returning void */
12461 void *hue; /* generic ptr */
12474 int main() { sub(); }
12476 if $cc $ccflags -c -DTRY=$defvoidused try.c >.out 2>&1 ; then
12477 voidflags=$defvoidused
12478 echo "Good. It appears to support void to the level $package wants.">&4
12479 if $contains warning .out >/dev/null 2>&1; then
12480 echo "However, you might get some warnings that look like this:"
12484 echo "Hmm, your compiler has some difficulty with void. Checking further..." >&4
12485 if $cc $ccflags -c -DTRY=1 try.c >/dev/null 2>&1; then
12486 echo "It supports 1..."
12487 if $cc $ccflags -c -DTRY=3 try.c >/dev/null 2>&1; then
12488 echo "It also supports 2..."
12489 if $cc $ccflags -c -DTRY=7 try.c >/dev/null 2>&1; then
12491 echo "And it supports 4 but not 8 definitely."
12493 echo "It doesn't support 4..."
12494 if $cc $ccflags -c -DTRY=11 try.c >/dev/null 2>&1; then
12496 echo "But it supports 8."
12499 echo "Neither does it support 8."
12503 echo "It does not support 2..."
12504 if $cc $ccflags -c -DTRY=13 try.c >/dev/null 2>&1; then
12506 echo "But it supports 4 and 8."
12508 if $cc $ccflags -c -DTRY=5 try.c >/dev/null 2>&1; then
12510 echo "And it supports 4 but has not heard about 8."
12512 echo "However it supports 8 but not 4."
12517 echo "There is no support at all for void."
12522 case "$voidflags" in
12524 *) $cat >&4 <<'EOM'
12525 Support flag bits are:
12526 1: basic void declarations.
12527 2: arrays of pointers to functions returning void.
12528 4: operations between pointers to and addresses of void functions.
12529 8: generic void pointers.
12532 rp="Your void support flags add up to what?"
12540 : How can we generate normalized random numbers ?
12542 echo "Looking for a random number function..." >&4
12543 case "$randfunc" in
12545 if set drand48 val -f; eval $csym; $val; then
12547 echo "Good, found drand48()." >&4
12548 elif set random val -f; eval $csym; $val; then
12550 echo "OK, found random()." >&4
12553 echo "Yick, looks like I have to use rand()." >&4
12564 *-Dmy_rand=*|*-Dmy_srand=*)
12565 echo "Removing obsolete -Dmy_rand, -Dmy_srand, and -Drandbits from ccflags." >&4
12566 ccflags="`echo $ccflags | sed -e 's/-Dmy_rand=random/ /'`"
12567 ccflags="`echo $ccflags | sed -e 's/-Dmy_srand=srandom/ /'`"
12568 ccflags="`echo $ccflags | sed -e 's/-Drandbits=[0-9][0-9]*/ /'`"
12572 while $test "$cont"; do
12573 rp="Use which function to generate random numbers?"
12575 if $test "$ans" = "$dflt"; then
12581 if set $ans val -f; eval $csym; $val; then
12585 rp="I cannot find function $ans. Use that name anyway?"
12594 case "$randfunc" in
12596 drand01="drand48()"
12602 case "$randbits" in
12604 echo "Checking to see how many bits your $randfunc() function produces..." >&4
12606 #$i_unistd I_UNISTD
12607 #$i_stdlib I_STDLIB
12610 # include <unistd.h>
12613 # include <stdlib.h>
12618 register unsigned long tmp;
12619 register unsigned long max = 0L;
12621 for (i = 1000; i; i--) {
12622 tmp = (unsigned long) $randfunc();
12623 if (tmp > max) max = tmp;
12625 for (i = 0; max; i++)
12631 if eval $compile_ok; then
12635 echo "(I can't seem to compile the test program...)"
12642 rp="How many bits does your $randfunc() function produce?"
12646 drand01="($randfunc() / (double) ((unsigned long)1 << $randbits))"
12647 seedfunc="s$randfunc"
12648 randseedtype=unsigned
12652 rp="How many bits does your $randfunc() function produce?"
12655 seedfunc="s$randfunc"
12656 drand01="($randfunc() / (double) ((unsigned long)1 << $randbits))"
12657 if set $seedfunc val -f; eval $csym; $val; then
12658 echo "(Using $seedfunc() to seed random generator)"
12660 echo "(Warning: no $seedfunc() to seed random generator)"
12663 randseedtype=unsigned
12671 echo "Determining whether or not we are on an EBCDIC system..." >&4
12672 $cat >tebcdic.c <<'EOM'
12675 if ('M'==0xd4) return 0;
12682 if eval $compile_ok; then
12684 echo "You have EBCDIC." >&4
12687 echo "Nope, no EBCDIC, probably ASCII or some ISO Latin." >&4
12690 echo "I'm unable to compile the test program." >&4
12691 echo "I'll assume ASCII or some ISO Latin." >&4
12693 $rm -f tebcdic.c tebcdic
12699 Checking how to flush all pending stdio output...
12701 # I only know how to find the first 32 possibly open files on SunOS.
12702 # See also hints/sunos_4_1.sh and util.c --AD
12704 sunos) $echo '#define PERL_FFLUSH_ALL_FOPEN_MAX 32' > try.c ;;
12706 $cat >>try.c <<EOCP
12708 #$i_unistd I_UNISTD
12710 # include <unistd.h>
12712 #$d_sysconf HAS_SYSCONF
12713 #$d_stdio_stream_array HAS_STDIO_STREAM_ARRAY
12714 #ifdef HAS_STDIO_STREAM_ARRAY
12715 # define STDIO_STREAM_ARRAY $stdio_stream_array
12718 FILE* p = fopen("try.out", "w");
12722 # ifdef TRY_FPRINTF
12726 #ifdef TRY_FFLUSH_NULL
12729 #ifdef TRY_FFLUSH_ALL
12731 long open_max = -1;
12732 # ifdef PERL_FFLUSH_ALL_FOPEN_MAX
12733 open_max = PERL_FFLUSH_ALL_FOPEN_MAX;
12735 # if defined(HAS_SYSCONF) && defined(_SC_OPEN_MAX)
12736 open_max = sysconf(_SC_OPEN_MAX);
12739 open_max = FOPEN_MAX;
12742 open_max = OPEN_MAX;
12751 # ifdef HAS_STDIO_STREAM_ARRAY
12752 if (open_max > 0) {
12754 for (i = 0; i < open_max; i++)
12755 if (STDIO_STREAM_ARRAY[i]._file >= 0 &&
12756 STDIO_STREAM_ARRAY[i]._file < open_max &&
12757 STDIO_STREAM_ARRAY[i]._flag)
12758 fflush(&STDIO_STREAM_ARRAY[i]);
12766 : first we have to find out how _not_ to flush
12767 if $test "X$fflushNULL" = X -o "X$fflushall" = X; then
12769 set try -DTRY_FPUTC
12770 if eval $compile; then
12772 ./try$exe_ext 2>/dev/null
12773 if $test ! -s try.out -a "X$?" = X42; then
12779 set try -DTRY_FPRINTF
12781 if eval $compile; then
12783 ./try$exe_ext 2>/dev/null
12784 if $test ! -s try.out -a "X$?" = X42; then
12785 output=-DTRY_FPRINTF
12791 : check for fflush NULL behaviour
12792 case "$fflushNULL" in
12793 '') set try -DTRY_FFLUSH_NULL $output
12794 if eval $compile; then
12796 ./try$exe_ext 2>/dev/null
12798 if $test -s try.out -a "X$code" = X42; then
12799 fflushNULL="`$cat try.out`"
12801 if $test "X$code" != X42; then
12803 (If this test failed, don't worry, we'll try another method shortly.)
12808 $rm -f core try.core core.try.*
12809 case "$fflushNULL" in
12811 Your fflush(NULL) works okay for output streams.
12812 Let's see if it clobbers input pipes...
12814 # As of mid-March 2000 all versions of Solaris appear to have a stdio
12815 # bug that improperly flushes the input end of pipes. So we avoid the
12816 # autoflush on fork/system/exec support for now. :-(
12817 $cat >tryp.c <<EOCP
12820 main(int argc, char **argv)
12826 while ((i = getc(stdin)) != -1
12827 && (*bp++ = i) != '\n'
12828 && bp < &buf[1024])
12831 fprintf(stdout, "%s", buf);
12839 fflushNULL="$define"
12841 if eval $compile; then
12843 $cat tryp.c | ./tryp$exe_ext 2>/dev/null > tryp.out
12844 if cmp tryp.c tryp.out >/dev/null 2>&1; then
12846 fflush(NULL) seems to behave okay with input streams.
12848 fflushNULL="$define"
12851 Ouch, fflush(NULL) clobbers input pipes! We will not use it.
12853 fflushNULL="$undef"
12856 $rm -f core tryp.c tryp.core core.tryp.*
12859 Your fflush(NULL) isn't working (contrary to ANSI C).
12861 fflushNULL="$undef"
12864 Cannot figure out whether your fflush(NULL) works or not.
12865 I'm assuming it doesn't (contrary to ANSI C).
12867 fflushNULL="$undef"
12871 $define|true|[yY]*)
12872 fflushNULL="$define"
12875 fflushNULL="$undef"
12878 : check explicit looping only if NULL did not work, and if the pipe
12879 : bug does not show up on an explicit flush too
12880 case "$fflushNULL" in
12882 $cat >tryp.c <<EOCP
12885 main(int argc, char **argv)
12891 while ((i = getc(stdin)) != -1
12892 && (*bp++ = i) != '\n'
12893 && bp < &buf[1024])
12896 fprintf(stdout, "%s", buf);
12905 if eval $compile; then
12907 $cat tryp.c | ./tryp$exe_ext 2>/dev/null > tryp.out
12908 if cmp tryp.c tryp.out >/dev/null 2>&1; then
12910 Good, at least fflush(stdin) seems to behave okay when stdin is a pipe.
12912 : now check for fflushall behaviour
12913 case "$fflushall" in
12914 '') set try -DTRY_FFLUSH_ALL $output
12915 if eval $compile; then
12917 (Now testing the other method--but note that this also may fail.)
12920 ./try$exe_ext 2>/dev/null
12921 if $test -s try.out -a "X$?" = X42; then
12922 fflushall="`$cat try.out`"
12925 $rm -f core try.core core.try.*
12926 case "$fflushall" in
12928 Whew. Flushing explicitly all the stdio streams works.
12930 fflushall="$define"
12933 Sigh. Flushing explicitly all the stdio streams doesn't work.
12938 Cannot figure out whether flushing stdio streams explicitly works or not.
12939 I'm assuming it doesn't.
12945 "$define"|true|[yY]*)
12946 fflushall="$define"
12954 All is futile. Even fflush(stdin) clobbers input pipes!
12961 $rm -f core tryp.c tryp.core core.tryp.*
12963 *) fflushall="$undef"
12967 case "$fflushNULL$fflushall" in
12970 OK, I give up. I cannot figure out how to flush pending stdio output.
12971 We won't be flushing handles at all before fork/exec/popen.
12975 $rm -f try.* try$exe_ext
12977 : Store the full pathname to the ar program for use in the C program
12978 : Respect a hint or command line value for full_ar.
12983 : Store the full pathname to the sed program for use in the C program
12986 : see what type gids are declared as in the kernel
12988 echo "Looking for the type for group ids returned by getgid()."
12989 set gid_t gidtype xxx stdio.h sys/types.h
12993 xxx=`./findhdr sys/user.h`
12994 set `grep 'groups\[NGROUPS\];' "$xxx" 2>/dev/null` unsigned short
12996 unsigned) dflt="$1 $2" ;;
13000 *) dflt="$gidtype";;
13003 gid_t) echo "gid_t found." ;;
13004 *) rp="What is the type for group ids returned by getgid()?"
13012 *_t) zzz="$gidtype" ;;
13015 echo "Checking the size of $zzz..." >&4
13017 #include <sys/types.h>
13020 printf("%d\n", (int)sizeof($gidtype));
13025 if eval $compile_ok; then
13029 echo "(I can't execute the test program--guessing $gidsize.)" >&4
13032 echo "Your $zzz is $gidsize bytes long."
13037 echo "(I can't compile the test program--guessing $gidsize.)" >&4
13043 *_t) zzz="$gidtype" ;;
13046 echo "Checking the sign of $zzz..." >&4
13048 #include <sys/types.h>
13059 if eval $compile; then
13063 echo "(I can't execute the test program--guessing unsigned.)" >&4
13067 1) echo "Your $zzz is unsigned." ;;
13068 -1) echo "Your $zzz is signed." ;;
13074 echo "(I can't compile the test program--guessing unsigned.)" >&4
13080 if $test X"$quadtype" != X; then
13082 echo "Checking how to print 64-bit integers..." >&4
13084 if $test X"$sPRId64" = X -a X"$quadtype" = Xint; then
13085 $cat >try.c <<'EOCP'
13086 #include <sys/types.h>
13089 int q = 12345678901;
13090 printf("%ld\n", q);
13094 if eval $compile; then
13095 yyy=`./try$exe_ext`
13098 sPRId64='"d"'; sPRIi64='"i"'; sPRIu64='"u"';
13099 sPRIo64='"o"'; sPRIx64='"x"'; sPRIX64='"X"';
13100 echo "We will use %d."
13106 if $test X"$sPRId64" = X -a X"$quadtype" = Xlong; then
13107 $cat >try.c <<'EOCP'
13108 #include <sys/types.h>
13111 long q = 12345678901;
13112 printf("%ld\n", q);
13116 if eval $compile; then
13117 yyy=`./try$exe_ext`
13120 sPRId64='"ld"'; sPRIi64='"li"'; sPRIu64='"lu"';
13121 sPRIo64='"lo"'; sPRIx64='"lx"'; sPRIX64='"lX"';
13122 echo "We will use %ld."
13128 if $test X"$sPRId64" = X -a X"$i_inttypes" = X"$define" -a X"$quadtype" = Xint64_t; then
13129 $cat >try.c <<'EOCP'
13130 #include <sys/types.h>
13131 #include <inttypes.h>
13134 int64_t q = 12345678901;
13135 printf("%" PRId64 "\n", q);
13139 if eval $compile; then
13140 yyy=`./try$exe_ext`
13143 sPRId64=PRId64; sPRIi64=PRIi64; sPRIu64=PRIu64;
13144 sPRIo64=PRIo64; sPRIx64=PRIx64; sPRIX64=PRIX64;
13145 echo "We will use the C9X style."
13151 if $test X"$sPRId64" = X -a X"$quadtype" = X"long long"; then
13152 $cat >try.c <<'EOCP'
13153 #include <sys/types.h>
13156 long long q = 12345678901LL; /* AIX cc requires the LL prefix. */
13157 printf("%lld\n", q);
13161 if eval $compile; then
13162 yyy=`./try$exe_ext`
13165 sPRId64='"lld"'; sPRIi64='"lli"'; sPRIu64='"llu"';
13166 sPRIo64='"llo"'; sPRIx64='"llx"'; sPRIX64='"llX"';
13167 echo "We will use the %lld style."
13173 if $test X"$sPRId64" = X -a X"$quadtype" != X; then
13175 #include <sys/types.h>
13178 $quadtype q = 12345678901;
13179 printf("%Ld\n", q);
13183 if eval $compile; then
13184 yyy=`./try$exe_ext`
13187 sPRId64='"Ld"'; sPRIi64='"Li"'; sPRIu64='"Lu"';
13188 sPRIo64='"Lo"'; sPRIx64='"Lx"'; sPRIX64='"LX"';
13189 echo "We will use %Ld."
13195 if $test X"$sPRId64" = X -a X"$quadtype" != X; then
13197 #include <sys/types.h>
13200 $quadtype q = 12345678901;
13201 printf("%qd\n", q);
13205 if eval $compile; then
13206 yyy=`./try$exe_ext`
13209 sPRId64='"qd"'; sPRIi64='"qi"'; sPRIu64='"qu"';
13210 sPRIo64='"qo"'; sPRIx64='"qx"'; sPRIX64='"qX"';
13211 echo "We will use %qd."
13217 if $test X"$sPRId64" = X; then
13218 echo "Cannot figure out how to print 64-bit integers." >&4
13226 '') d_PRId64="$undef"; d_PRIi64="$undef"; d_PRIu64="$undef";
13227 d_PRIo64="$undef"; d_PRIx64="$undef"; d_PRIX64="$undef";
13229 *) d_PRId64="$define"; d_PRIi64="$define"; d_PRIu64="$define";
13230 d_PRIo64="$define"; d_PRIx64="$define"; d_PRIX64="$define";
13236 $echo "Checking the format strings to be used for Perl's internal types..." >&4
13238 if $test X"$ivsize" = X8; then
13239 ivdformat="$sPRId64"
13240 uvuformat="$sPRIu64"
13241 uvoformat="$sPRIo64"
13242 uvxformat="$sPRIx64"
13244 if $test X"$ivsize" = X"$longsize"; then
13250 if $test X"$ivsize" = X"$intsize"; then
13257 if $test X"$ivsize" = X"$shortsize"; then
13267 case "$ivdformat" in
13268 '') echo "$0: Fatal: failed to find format strings, cannot continue." >& 4
13275 $echo "Checking the format string to be used for gids..." >&4
13278 -1) if $test X"$gidsize" = X"$ivsize"; then
13279 gidformat="$ivdformat"
13281 if $test X"$gidsize" = X"$longsize"; then
13284 if $test X"$gidsize" = X"$intsize"; then
13287 if $test X"$gidsize" = X"$shortsize"; then
13294 *) if $test X"$gidsize" = X"$uvsize"; then
13295 gidformat="$uvuformat"
13297 if $test X"$gidsize" = X"$longsize"; then
13300 if $test X"$gidsize" = X"$intsize"; then
13303 if $test X"$gidsize" = X"$shortsize"; then
13312 : see if getgroups exists
13313 set getgroups d_getgrps
13316 : see if setgroups exists
13317 set setgroups d_setgrps
13321 : Find type of 2nd arg to 'getgroups()' and 'setgroups()'
13323 case "$d_getgrps$d_setgrps" in
13325 case "$groupstype" in
13326 '') dflt="$gidtype" ;;
13327 *) dflt="$groupstype" ;;
13330 What type of pointer is the second argument to getgroups() and setgroups()?
13331 Usually this is the same as group ids, $gidtype, but not always.
13334 rp='What type pointer is the second argument to getgroups() and setgroups()?'
13338 *) groupstype="$gidtype";;
13342 echo "Checking if your $make program sets \$(MAKE)..." >&4
13343 case "$make_set_make" in
13345 $sed 's/^X //' > testmake.mak << 'EOF'
13347 X @echo 'maketemp="$(MAKE)"'
13349 case "`$make -f testmake.mak 2>/dev/null`" in
13350 *maketemp=*) make_set_make='#' ;;
13351 *) make_set_make="MAKE=$make" ;;
13353 $rm -f testmake.mak
13356 case "$make_set_make" in
13357 '#') echo "Yup, it does.";;
13358 *) echo "Nope, it doesn't.";;
13361 : see what type is used for mode_t
13362 rp="What is the type used for file modes for system calls (e.g. fchmod())?"
13363 set mode_t modetype int stdio.h sys/types.h
13366 : define a fucntion to check prototypes
13367 $cat > protochk <<EOSH
13370 optimize="$optimize"
13372 prototype="$prototype"
13377 $cat >> protochk <<'EOSH'
13382 while test $# -ge 2; do
13384 $define) echo "#include <$2>" >> try.c ;;
13385 literal) echo "$2" >> try.c ;;
13389 test "$prototype" = "$define" && echo '#define CAN_PROTOTYPE' >> try.c
13390 cat >> try.c <<'EOCP'
13391 #ifdef CAN_PROTOTYPE
13392 #define _(args) args
13397 echo "$foo" >> try.c
13398 echo 'int no_real_function_has_this_name _((void)) { return 0; }' >> try.c
13399 $cc $optimize $ccflags -c try.c > /dev/null 2>&1
13405 $eunicefix protochk
13407 : see what type is used for size_t
13408 rp="What is the type used for the length parameter for string functions?"
13409 set size_t sizetype 'unsigned int' stdio.h sys/types.h
13412 : check for type of arguments to gethostbyaddr.
13413 if test "X$netdb_host_type" = X -o "X$netdb_hlen_type" = X; then
13414 case "$d_gethbyaddr" in
13418 Checking to see what type of arguments are accepted by gethostbyaddr().
13420 hdrs="$define sys/types.h
13421 $d_socket sys/socket.h
13422 $i_niin netinet/in.h
13424 $i_unistd unistd.h"
13425 : The first arg can 'char *' or 'void *'
13426 : The second arg is some of integral type
13427 for xxx in in_addr_t 'const void *' 'const char *' 'void *' 'char *'; do
13428 for yyy in size_t long int; do
13429 case "$netdb_host_type" in
13430 '') try="extern struct hostent *gethostbyaddr($xxx, $yyy, int);"
13431 if ./protochk "$try" $hdrs; then
13432 echo "Your system accepts $xxx for the first arg."
13433 echo "...and $yyy for the second arg."
13434 netdb_host_type="$xxx"
13435 netdb_hlen_type="$yyy"
13441 : In case none of those worked, prompt the user.
13442 case "$netdb_host_type" in
13443 '') rp='What is the type for the 1st argument to gethostbyaddr?'
13446 netdb_host_type=$ans
13447 rp='What is the type for the 2nd argument to gethostbyaddr?'
13450 netdb_hlen_type=$ans
13454 *) : no gethostbyaddr, so pick harmless defaults
13455 netdb_host_type='char *'
13456 netdb_hlen_type="$sizetype"
13459 # Remove the "const" if needed. -- but then we'll have a
13461 # netdb_host_type=`echo "$netdb_host_type" | sed 's/^const //'`
13464 : check for type of argument to gethostbyname.
13465 if test "X$netdb_name_type" = X ; then
13466 case "$d_gethbyname" in
13470 Checking to see what type of argument is accepted by gethostbyname().
13472 hdrs="$define sys/types.h
13473 $d_socket sys/socket.h
13474 $i_niin netinet/in.h
13476 $i_unistd unistd.h"
13477 for xxx in "const char *" "char *"; do
13478 case "$netdb_name_type" in
13479 '') try="extern struct hostent *gethostbyname($xxx);"
13480 if ./protochk "$try" $hdrs; then
13481 echo "Your system accepts $xxx."
13482 netdb_name_type="$xxx"
13487 : In case none of those worked, prompt the user.
13488 case "$netdb_name_type" in
13489 '') rp='What is the type for the 1st argument to gethostbyname?'
13492 netdb_name_type=$ans
13496 *) : no gethostbyname, so pick harmless default
13497 netdb_name_type='char *'
13502 : check for type of 1st argument to getnetbyaddr.
13503 if test "X$netdb_net_type" = X ; then
13504 case "$d_getnbyaddr" in
13508 Checking to see what type of 1st argument is accepted by getnetbyaddr().
13510 hdrs="$define sys/types.h
13511 $d_socket sys/socket.h
13512 $i_niin netinet/in.h
13514 $i_unistd unistd.h"
13515 for xxx in in_addr_t "unsigned long" long "unsigned int" int; do
13516 case "$netdb_net_type" in
13517 '') try="extern struct netent *getnetbyaddr($xxx, int);"
13518 if ./protochk "$try" $hdrs; then
13519 echo "Your system accepts $xxx."
13520 netdb_net_type="$xxx"
13525 : In case none of those worked, prompt the user.
13526 case "$netdb_net_type" in
13527 '') rp='What is the type for the 1st argument to getnetbyaddr?'
13530 netdb_net_type=$ans
13534 *) : no getnetbyaddr, so pick harmless default
13535 netdb_net_type='long'
13539 : locate the preferred pager for this system
13553 '') dflt=/usr/ucb/more;;
13560 rp='What pager is used on your system?'
13564 : see what type pids are declared as in the kernel
13565 rp="What is the type of process ids on this system?"
13566 set pid_t pidtype int stdio.h sys/types.h
13569 : Find earliest binary compatible site_perl subdirectory perl can use.
13570 case "$bincompat5005" in
13571 "$define") xs_apiversion='5.005' ;;
13572 *) xs_apiversion=$version ;; # The current site_perl version.
13574 : Find earliest pure perl site_perl subdirectory perl can use.
13575 : The versioned directories started at 5.005.
13576 pm_apiversion='5.005'
13578 : check for length of pointer
13582 echo "Checking to see how big your pointers are..." >&4
13583 if test "$voidflags" -gt 7; then
13584 echo '#define VOID_PTR char *' > try.c
13586 echo '#define VOID_PTR void *' > try.c
13588 $cat >>try.c <<'EOCP'
13592 printf("%d\n", (int)sizeof(VOID_PTR));
13597 if eval $compile_ok; then
13599 echo "Your pointers are $ptrsize bytes long."
13602 echo "(I can't seem to compile the test program. Guessing...)" >&4
13603 rp="What is the size of a pointer (in bytes)?"
13611 : see if ar generates random libraries by itself
13613 echo "Checking how to generate random libraries on your machine..." >&4
13614 echo 'int bar1() { return bar2(); }' > bar1.c
13615 echo 'int bar2() { return 2; }' > bar2.c
13616 $cat > foo.c <<'EOP'
13617 int main() { printf("%d\n", bar1()); exit(0); }
13619 $cc $ccflags -c bar1.c >/dev/null 2>&1
13620 $cc $ccflags -c bar2.c >/dev/null 2>&1
13621 $cc $ccflags -c foo.c >/dev/null 2>&1
13622 $ar rc bar$_a bar2$_o bar1$_o >/dev/null 2>&1
13623 if $cc $ccflags $ldflags -o foobar foo$_o bar$_a $libs > /dev/null 2>&1 &&
13624 ./foobar >/dev/null 2>&1; then
13625 echo "$ar appears to generate random libraries itself."
13628 elif $ar ts bar$_a >/dev/null 2>&1 &&
13629 $cc $ccflags $ldflags -o foobar foo$_o bar$_a $libs > /dev/null 2>&1 &&
13630 ./foobar >/dev/null 2>&1; then
13631 echo "a table of contents needs to be added with '$ar ts'."
13638 ranlib=`./loc ranlib X /usr/bin /bin /usr/local/bin`
13639 $test -f $ranlib || ranlib=''
13642 if $test -n "$ranlib"; then
13643 echo "your system has '$ranlib'; we'll use that."
13646 echo "your system doesn't seem to support random libraries"
13647 echo "so we'll use lorder and tsort to order the libraries."
13654 : check for type of arguments to select.
13655 case "$selecttype" in
13656 '') case "$d_select" in
13660 Checking to see what type of arguments are accepted by select().
13662 hdrs="$define sys/types.h
13663 $i_systime sys/time.h
13664 $i_sysselct sys/select.h
13665 $d_socket sys/socket.h"
13666 : The first arg can be int, unsigned, or size_t
13667 : The last arg may or may not be 'const'
13669 : void pointer has been seen but using that
13670 : breaks the selectminbits test
13671 for xxx in 'fd_set *' 'int *'; do
13672 for nfd in 'int' 'size_t' 'unsigned long' 'unsigned' ; do
13673 for tmo in 'struct timeval *' 'const struct timeval *'; do
13675 '') try="extern select _(($nfd, $xxx, $xxx, $xxx, $tmo));"
13676 if ./protochk "$try" $hdrs; then
13677 echo "Your system accepts $xxx."
13686 '') rp='What is the type for the 2nd, 3rd, and 4th arguments to select?'
13687 case "$d_fd_set" in
13688 $define) dflt="fd_set *" ;;
13697 *) : no select, so pick a harmless default
13704 : check for the select 'width'
13705 case "$selectminbits" in
13706 '') case "$d_select" in
13710 Checking to see on how many bits at a time your select() operates...
13713 #include <sys/types.h>
13715 #$i_systime I_SYS_TIME
13716 #$i_systimek I_SYS_TIME_KERNEL
13721 # ifdef I_SYS_TIME_KERNEL
13724 # include <sys/time.h>
13725 # ifdef I_SYS_TIME_KERNEL
13729 #$i_sysselct I_SYS_SELECT
13730 #ifdef I_SYS_SELECT
13731 #include <sys/select.h>
13733 #$d_socket HAS_SOCKET
13735 # include <sys/socket.h> /* Might include <sys/bsdtypes.h> */
13739 #define S sizeof(*(b))
13741 #define NBYTES (S * 8 > MINBITS ? S : MINBITS/8)
13742 #define NBITS (NBYTES * 8)
13751 fp = fopen("try.c", "r");
13757 b = ($selecttype)s;
13758 for (i = 0; i < NBITS; i++)
13762 select(fd + 1, b, 0, 0, &t);
13763 for (i = NBITS - 1; i > fd && FD_ISSET(i, b); i--);
13764 printf("%d\n", i + 1);
13769 if eval $compile_ok; then
13770 selectminbits=`./try`
13771 case "$selectminbits" in
13773 Cannot figure out on how many bits at a time your select() operates.
13774 I'll play safe and guess it is 32 bits.
13780 *) bits="$selectminbits bits" ;;
13782 echo "Your select() operates on $bits at a time." >&4
13784 rp='What is the minimum number of bits your select() operates on?'
13785 case "$byteorder" in
13786 1234|12345678) dflt=32 ;;
13791 selectminbits="$val"
13795 *) : no select, so pick a harmless default
13802 : Trace out the files included by signal.h, then look for SIGxxx names.
13803 : Remove SIGARRAYSIZE used by HPUX.
13804 : Remove SIGSTKSIZE used by Linux.
13805 : Remove SIGSTKSZ used by Posix.
13806 : Remove SIGTYP void lines used by OS2.
13807 : Some cpps, like os390, dont give the file name anywhere
13808 if [ "X$fieldn" = X ]; then
13809 : Just make some guesses. We check them later.
13810 xxx='/usr/include/signal.h /usr/include/sys/signal.h'
13812 xxx=`echo '#include <signal.h>' |
13813 $cppstdin $cppminus $cppflags 2>/dev/null |
13814 $grep '^[ ]*#.*include' |
13815 $awk "{print \\$$fieldn}" | $sed 's!"!!g' | $sort | $uniq`
13817 : Check this list of files to be sure we have parsed the cpp output ok.
13818 : This will also avoid potentially non-existent files, such
13821 for xx in $xxx /dev/null ; do
13822 $test -f "$xx" && xxxfiles="$xxxfiles $xx"
13824 : If we have found no files, at least try signal.h
13825 case "$xxxfiles" in
13826 '') xxxfiles=`./findhdr signal.h` ;;
13829 $1 ~ /^#define$/ && $2 ~ /^SIG[A-Z0-9]*$/ && $2 !~ /SIGARRAYSIZE/ && $2 !~ /SIGSTKSIZE/ && $2 !~ /SIGSTKSZ/ && $3 !~ /void/ {
13830 print substr($2, 4, 20)
13832 $1 == "#" && $2 ~ /^define$/ && $3 ~ /^SIG[A-Z0-9]*$/ && $3 !~ /SIGARRAYSIZE/ && $4 !~ /void/ {
13833 print substr($3, 4, 20)
13835 : Append some common names just in case the awk scan failed.
13836 xxx="$xxx ABRT ALRM BUS CANCEL CHLD CLD CONT DIL EMT FPE"
13837 xxx="$xxx FREEZE HUP ILL INT IO IOT KILL LOST LWP PHONE"
13838 xxx="$xxx PIPE POLL PROF PWR QUIT RTMAX RTMIN SEGV STKFLT STOP"
13839 xxx="$xxx SYS TERM THAW TRAP TSTP TTIN TTOU URG USR1 USR2"
13840 xxx="$xxx USR3 USR4 VTALRM WAITING WINCH WIND WINDOW XCPU XFSZ"
13842 : generate a few handy files for later
13843 $cat > signal.c <<'EOCP'
13844 #include <sys/types.h>
13845 #include <signal.h>
13849 /* Strange style to avoid deeply-nested #if/#else/#endif */
13852 # define NSIG (_NSIG)
13858 # define NSIG (SIGMAX+1)
13864 # define NSIG (SIG_MAX+1)
13870 # define NSIG (MAXSIG+1)
13876 # define NSIG (MAX_SIG+1)
13881 # ifdef SIGARRAYSIZE
13882 # define NSIG (SIGARRAYSIZE+1) /* Not sure of the +1 */
13888 # define NSIG (_sys_nsig) /* Solaris 2.5 */
13892 /* Default to some arbitrary number that's big enough to get most
13893 of the common signals.
13899 printf("NSIG %d\n", NSIG);
13905 echo $xxx | $tr ' ' $trnl | $sort | $uniq | $awk '
13907 printf "#ifdef SIG"; printf $1; printf "\n"
13908 printf "printf(\""; printf $1; printf " %%d\\n\",SIG";
13909 printf $1; printf ");\n"
13913 printf "#endif /* JUST_NSIG */\n";
13914 printf "exit(0);\n}\n";
13917 $cat >signal.awk <<'EOP'
13918 BEGIN { ndups = 0 }
13919 $1 ~ /^NSIG$/ { nsig = $2 }
13920 ($1 !~ /^NSIG$/) && (NF == 2) {
13921 if ($2 > maxsig) { maxsig = $2 }
13922 if (sig_name[$2]) {
13923 dup_name[ndups] = $1
13924 dup_num[ndups] = $2
13936 printf("NSIG %d\n", nsig);
13937 for (n = 1; n < nsig; n++) {
13939 printf("%s %d\n", sig_name[n], sig_num[n])
13942 printf("NUM%d %d\n", n, n)
13945 for (n = 0; n < ndups; n++) {
13946 printf("%s %d\n", dup_name[n], dup_num[n])
13950 $cat >signal_cmd <<EOS
13952 if $test -s signal.lst; then
13953 echo "Using your existing signal.lst file"
13958 $cat >>signal_cmd <<'EOS'
13961 if eval $compile_ok; then
13962 ./signal$_exe | $sort -n +1 | $uniq | $awk -f signal.awk >signal.lst
13964 echo "(I can't seem be able to compile the whole test program)" >&4
13965 echo "(I'll try it in little pieces.)" >&4
13966 set signal -DJUST_NSIG
13967 if eval $compile_ok; then
13968 ./signal$_exe > signal.nsg
13971 echo "I can't seem to figure out how many signals you have." >&4
13972 echo "Guessing 50." >&4
13973 echo 'NSIG 50' > signal.nsg
13975 : Now look at all the signal names, one at a time.
13976 for xx in `echo $xxx | $tr ' ' $trnl | $sort | $uniq`; do
13977 $cat > signal.c <<EOCP
13978 #include <sys/types.h>
13979 #include <signal.h>
13982 printf("$xx %d\n", SIG${xx});
13987 if eval $compile; then
13988 echo "SIG${xx} found."
13989 ./signal$_exe >> signal.ls1
13991 echo "SIG${xx} NOT found."
13994 if $test -s signal.ls1; then
13995 $cat signal.nsg signal.ls1 |
13996 $sort -n +1 | $uniq | $awk -f signal.awk >signal.lst
14000 if $test -s signal.lst; then
14003 echo "(AAK! I can't compile the test programs -- Guessing)" >&4
14004 echo 'kill -l' >signal
14005 set X `csh -f <signal`
14009 0) set HUP INT QUIT ILL TRAP ABRT EMT FPE KILL BUS SEGV SYS PIPE ALRM TERM;;
14011 echo $@ | $tr ' ' $trnl | \
14012 $awk '{ printf "%s %d\n", $1, ++s; }
14013 END { printf "NSIG %d\n", ++s }' >signal.lst
14015 $rm -f signal.c signal$_exe signal$_o signal.nsg signal.ls1
14017 chmod a+x signal_cmd
14018 $eunicefix signal_cmd
14020 : generate list of signal names
14022 case "$sig_name_init" in
14024 *) case "$sig_num_init" in
14025 ''|*,*) doinit=yes ;;
14030 echo "Generating a list of signal names and numbers..." >&4
14032 sig_count=`$awk '/^NSIG/ { printf "%d", $2 }' signal.lst`
14033 sig_name=`$awk 'BEGIN { printf "ZERO " }
14034 !/^NSIG/ { printf "%s ", $1 }' signal.lst`
14035 sig_num=`$awk 'BEGIN { printf "0 " }
14036 !/^NSIG/ { printf "%d ", $2 }' signal.lst`
14037 sig_name_init=`$awk 'BEGIN { printf "\"ZERO\", " }
14038 !/^NSIG/ { printf "\"%s\", ", $1 }
14039 END { printf "0\n" }' signal.lst`
14040 sig_num_init=`$awk 'BEGIN { printf "0, " }
14041 !/^NSIG/ { printf "%d, ", $2}
14042 END { printf "0\n"}' signal.lst`
14045 echo "The following $sig_count signals are available:"
14047 echo $sig_name | $awk \
14048 'BEGIN { linelen = 0 }
14050 for (i = 1; i <= NF; i++) {
14051 name = "SIG" $i " "
14052 linelen = linelen + length(name)
14053 if (linelen > 70) {
14055 linelen = length(name)
14061 $rm -f signal signal.c signal.awk signal.lst signal_cmd
14064 case "$sizetype" in
14065 *_t) zzz="$sizetype" ;;
14066 *) zzz="filesize" ;;
14068 echo "Checking the size of $zzz..." >&4
14070 #include <sys/types.h>
14073 printf("%d\n", (int)sizeof($sizetype));
14078 if eval $compile_ok; then
14082 echo "(I can't execute the test program--guessing $sizesize.)" >&4
14085 echo "Your $zzz size is $sizesize bytes."
14090 echo "(I can't compile the test program--guessing $sizesize.)" >&4
14094 : check for socklen_t
14096 echo "Checking to see if you have socklen_t..." >&4
14098 #include <sys/types.h>
14099 #$d_socket HAS_SOCKET
14101 #include <sys/socket.h>
14103 int main() { socklen_t x = 16; }
14106 if eval $compile; then
14108 echo "You have socklen_t."
14111 echo "You do not have socklen_t."
14112 case "$sizetype" in
14113 size_t) echo "(You do have size_t, that might work. Some people are happy with just an int.)" ;;
14120 : check for type of the size argument to socket calls
14121 case "$d_socket" in
14125 Checking to see what type is the last argument of accept().
14127 hdrs="$define sys/types.h $d_socket sys/socket.h"
14129 case "$d_socklen_t" in
14130 "$define") yyy="$yyy socklen_t"
14132 yyy="$yyy $sizetype int long unsigned"
14133 for xxx in $yyy; do
14134 case "$socksizetype" in
14135 '') try="extern int accept(int, struct sockaddr *, $xxx *);"
14136 if ./protochk "$try" $hdrs; then
14137 echo "Your system accepts '$xxx *' for the last argument of accept()."
14138 socksizetype="$xxx"
14143 : In case none of those worked, prompt the user.
14144 case "$socksizetype" in
14145 '') rp='What is the type for socket address structure sizes?'
14152 *) : no sockets, so pick relatively harmless default
14157 : see what type is used for signed size_t
14158 set ssize_t ssizetype int stdio.h sys/types.h
14161 $cat > ssize.c <<EOM
14163 #include <sys/types.h>
14164 #define Size_t $sizetype
14165 #define SSize_t $dflt
14168 if (sizeof(Size_t) == sizeof(SSize_t))
14170 else if (sizeof(Size_t) == sizeof(int))
14179 if eval $compile_ok && ./ssize > /dev/null; then
14180 ssizetype=`./ssize`
14181 echo "I'll be using $ssizetype for functions returning a byte count." >&4
14184 Help! I can't compile and run the ssize_t test program: please enlighten me!
14185 (This is probably a misconfiguration in your system or libraries, and
14186 you really ought to fix it. Still, I'll try anyway.)
14188 I need a type that is the same size as $sizetype, but is guaranteed to
14189 be signed. Common values are ssize_t, int and long.
14192 rp="What signed type is the same size as $sizetype?"
14196 $rm -f ssize ssize.*
14198 : see what type of char stdio uses.
14200 if $contains 'unsigned.*char.*_ptr;' `./findhdr stdio.h` >/dev/null 2>&1 ; then
14201 echo "Your stdio uses unsigned chars." >&4
14202 stdchar="unsigned char"
14204 echo "Your stdio uses signed chars." >&4
14208 : see if time exists
14210 if test "X$d_time" = X -o X"$timetype" = X; then
14211 if set time val -f d_time; eval $csym; $val; then
14212 echo 'time() found.' >&4
14214 rp="What is the type returned by time() on this system?"
14215 set time_t timetype long stdio.h sys/types.h
14218 echo 'time() not found, hope that will do.' >&4
14226 : see what type uids are declared as in the kernel
14228 echo "Looking for the type for user ids returned by getuid()."
14229 set uid_t uidtype xxx stdio.h sys/types.h
14233 xxx=`./findhdr sys/user.h`
14234 set `grep '_ruid;' "$xxx" 2>/dev/null` unsigned short
14236 unsigned) dflt="$1 $2" ;;
14240 *) dflt="$uidtype";;
14243 uid_t) echo "uid_t found." ;;
14244 *) rp="What is the type for user ids returned by getuid()?"
14252 *_t) zzz="$uidtype" ;;
14255 echo "Checking the size of $zzz..." >&4
14257 #include <sys/types.h>
14260 printf("%d\n", (int)sizeof($uidtype));
14265 if eval $compile_ok; then
14269 echo "(I can't execute the test program--guessing $uidsize.)" >&4
14272 echo "Your $zzz is $uidsize bytes long."
14277 echo "(I can't compile the test program--guessing $uidsize.)" >&4
14282 *_t) zzz="$uidtype" ;;
14285 echo "Checking the sign of $zzz..." >&4
14287 #include <sys/types.h>
14298 if eval $compile; then
14302 echo "(I can't execute the test program--guessing unsigned.)" >&4
14306 1) echo "Your $zzz is unsigned." ;;
14307 -1) echo "Your $zzz is signed." ;;
14313 echo "(I can't compile the test program--guessing unsigned.)" >&4
14319 $echo "Checking the format string to be used for uids..." >&4
14322 -1) if $test X"$uidsize" = X"$ivsize"; then
14323 uidformat="$ivdformat"
14325 if $test X"$uidsize" = X"$longsize"; then
14328 if $test X"$uidsize" = X"$intsize"; then
14331 if $test X"$uidsize" = X"$shortsize"; then
14338 *) if $test X"$uidsize" = X"$uvsize"; then
14339 uidformat="$uvuformat"
14341 if $test X"$uidsize" = X"$longsize"; then
14344 if $test X"$uidsize" = X"$intsize"; then
14347 if $test X"$uidsize" = X"$shortsize"; then
14356 : see if dbm.h is available
14357 : see if dbmclose exists
14358 set dbmclose d_dbmclose
14361 case "$d_dbmclose" in
14371 *) set rpcsvc/dbm.h i_rpcsvcdbm
14376 *) echo "We won't be including <dbm.h>"
14386 : see if this is a sys/file.h system
14391 : do we need to include sys/file.h ?
14395 if $h_sysfile; then
14397 echo "We'll be including <sys/file.h>." >&4
14400 echo "We won't be including <sys/file.h>." >&4
14410 : see if fcntl.h is there
14415 : see if we can include fcntl.h
14421 echo "We'll be including <fcntl.h>." >&4
14424 if $h_sysfile; then
14425 echo "We don't need to include <fcntl.h> if we include <sys/file.h>." >&4
14427 echo "We won't be including <fcntl.h>." >&4
14439 : see if this is a iconv.h system
14440 set iconv.h i_iconv
14443 : see if this is a ieeefp.h system
14444 set ieeefp.h i_ieeefp
14447 : see if this is a libutil.h system
14448 set libutil.h i_libutil
14451 : see if locale.h is available
14452 set locale.h i_locale
14455 : see if mach cthreads are available
14456 if test "X$usethreads" = "X$define"; then
14457 set mach/cthreads.h i_machcthr
14460 i_machcthr="$undef"
14465 : see if this is a math.h system
14469 : see if this is a mntent.h system
14470 set mntent.h i_mntent
14473 : see if ndbm.h is available
14478 : see if dbm_open exists
14479 set dbm_open d_dbm_open
14481 case "$d_dbm_open" in
14484 echo "We won't be including <ndbm.h>"
14493 : see if net/errno.h is available
14495 set net/errno.h val
14498 : Unfortunately, it causes problems on some systems. Arrgh.
14501 cat > try.c <<'EOM'
14504 #include <net/errno.h>
14510 if $cc $ccflags -c try.c >/dev/null 2>&1; then
14511 echo "We'll be including <net/errno.h>." >&4
14513 echo "We won't be including <net/errno.h>." >&4
14522 : see if netinet/tcp.h is available
14523 set netinet/tcp.h i_netinettcp
14526 : see if this is a poll.h system
14530 : see if this is a prot.h system
14535 $echo "Guessing which symbols your C compiler and preprocessor define..." >&4
14536 $cat <<'EOSH' > Cppsym.know
14537 a29k ABI64 aegis AES_SOURCE AIX AIX32 AIX370
14538 AIX41 AIX42 AIX43 AIX_SOURCE aixpc ALL_SOURCE
14539 alliant alpha am29000 AM29000 amiga AMIGAOS AMIX
14540 ansi ANSI_C_SOURCE apollo ardent atarist att386 att3b BeOS
14541 BIG_ENDIAN BIT_MSF bsd BSD bsd43 bsd4_2 bsd4_3 BSD4_3 bsd4_4
14542 BSD_4_3 BSD_4_4 BSD_NET2 BSD_TIME BSD_TYPES BSDCOMPAT bsdi
14543 bull c cadmus clipper CMU COFF COMPILER_VERSION
14544 concurrent convex cpu cray CRAY CRAYMPP ctix CX_UX
14545 CYGWIN DGUX DGUX_SOURCE DJGPP dmert DOLPHIN DPX2 DSO
14546 Dynix DynixPTX ELF encore EPI EXTENSIONS FILE_OFFSET_BITS
14547 FreeBSD GCC_NEW_VARARGS gcos gcx gimpel
14548 GNU_SOURCE GNUC GNUC_MINOR GO32 gould GOULD_PN
14549 H3050R H3050RX hbullx20 hcx host_mips
14550 hp200 hp300 hp700 HP700 hp800 hp9000
14551 hp9000s200 hp9000s300 hp9000s400 hp9000s500
14552 hp9000s700 hp9000s800 hp9k8 hp_osf hppa hpux HPUX_SOURCE
14553 i186 i286 i386 i486 i586 i686 i8086 i80960 i860 I960
14554 iAPX286 ibm ibm032 ibmesa IBMR2 ibmrt ILP32 ILP64
14555 INLINE_INTRINSICS INTRINSICS INT64 interdata is68k ksr1
14556 LANGUAGE_C LARGE_FILE_API LARGEFILE64_SOURCE
14557 LARGEFILE_SOURCE LFS64_LARGEFILE LFS_LARGEFILE
14558 Linux LITTLE_ENDIAN LONG64 LONG_DOUBLE LONG_LONG
14559 LONGDOUBLE LONGLONG LP64 luna luna88k Lynx
14560 M68000 m68k m88100 m88k M88KBCS_TARGET M_COFF
14561 M_I186 M_I286 M_I386 M_I8086 M_I86 M_I86SM M_SYS3
14562 M_SYS5 M_SYSIII M_SYSV M_UNIX M_XENIX MACH machine MachTen
14563 MATH_HAS_NO_SIDE_EFFECTS
14564 mc300 mc500 mc68000 mc68010 mc68020 mc68030 mc68040
14565 mc68060 mc68k mc68k32 mc700 mc88000 mc88100 merlin
14566 mert MiNT mips MIPS_FPSET MIPS_ISA MIPS_SIM MIPS_SZINT
14567 MIPS_SZLONG MIPS_SZPTR MIPSEB MIPSEL MODERN_C motorola
14568 mpeix MSDOS MTXINU MULTIMAX mvs MVS n16 ncl_el ncl_mr
14569 NetBSD news1500 news1700 news1800 news1900 news3700
14570 news700 news800 news900 NeXT NLS ns16000 ns32000
14571 ns32016 ns32332 ns32k nsc32000
14572 OCS88 OEMVS OpenBSD os OS2 OS390 osf OSF1 OSF_SOURCE
14573 pa_risc PA_RISC1_1 PA_RISC2_0 PARAGON parisc
14574 pc532 pdp11 PGC PIC plexus PORTAR posix
14575 POSIX1B_SOURCE POSIX2_SOURCE POSIX4_SOURCE
14576 POSIX_C_SOURCE POSIX_SOURCE POWER
14577 PROTOTYPES PWB pyr QNX R3000 REENTRANT RES Rhapsody RISC6000
14578 riscix riscos RT scs SCO sequent sgi SGI_SOURCE sinix
14579 SIZE_INT SIZE_LONG SIZE_PTR SOCKET_SOURCE SOCKETS_SOURCE
14580 sony sony_news sonyrisc sparc sparclite spectrum
14581 stardent stdc STDC_EXT stratos sun sun3 sun386
14582 Sun386i svr3 svr4 SVR4_2 SVR4_SOURCE svr5
14583 SX system SYSTYPE_BSD SYSTYPE_BSD43 SYSTYPE_BSD44
14584 SYSTYPE_SVR4 SYSTYPE_SVR5 SYSTYPE_SYSV SYSV SYSV3 SYSV4 SYSV5
14585 sysV68 sysV88 Tek4132 Tek4300 titan
14586 tower tower32 tower32_200 tower32_600 tower32_700
14587 tower32_800 tower32_850 tss
14588 u370 u3b u3b2 u3b20 u3b200 u3b20d u3b5
14589 ultrix UMAXV UnicomPBB UnicomPBD UNICOS UNICOSMK
14590 unix UNIX95 UNIX99 unixpc unos USGr4 USGr4_2
14591 Utek UTek UTS UWIN uxpm uxps vax venix VMESA vms xenix Xenix286
14592 XOPEN_SOURCE XOPEN_SOURCE_EXTENDED XPG2 XPG2_EXTENDED
14593 XPG3 XPG3_EXTENDED XPG4 XPG4_EXTENDED
14596 # Maybe put other stuff here too.
14597 cat <<EOSH >>Cppsym.know
14600 ./tr '[a-z]' '[A-Z]' < Cppsym.know > Cppsym.a
14601 ./tr '[A-Z]' '[a-z]' < Cppsym.know > Cppsym.b
14602 $cat Cppsym.know > Cppsym.c
14603 $cat Cppsym.a Cppsym.b Cppsym.c | $tr ' ' $trnl | sort | uniq > Cppsym.know
14604 $rm -f Cppsym.a Cppsym.b Cppsym.c
14605 cat <<EOSH > Cppsym
14607 if $test \$# -gt 0; then
14608 echo \$* | $tr " " "$trnl" | ./Cppsym.try > Cppsym.got
14609 if $test -s Cppsym.got; then
14616 $tr " " "$trnl" | ./Cppsym.try
14622 cat <<EOSH > Cppsym.try
14624 cat <<'EOCP' > try.c
14630 cat <<'EOSH' >> Cppsym.try
14632 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
14633 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
14634 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
14635 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
14639 cat <<EOSH >> Cppsym.try
14641 case "$osname-$gccversion" in
14642 irix-) ccflags="\$ccflags -woff 1178" ;;
14643 os2-*) ccflags="\$ccflags -Zlinker /PM:VIO" ;;
14645 $cc $optimize \$ccflags $ldflags -o try try.c $libs && ./try$exe_ext
14647 chmod +x Cppsym.try
14648 $eunicefix Cppsym.try
14649 ./Cppsym < Cppsym.know > Cppsym.true
14650 : now check the C compiler for additional symbols
14651 postprocess_cc_v=''
14653 aix) postprocess_cc_v="|$tr , ' '" ;;
14660 for i in \`$cc -v -c tmp.c 2>&1 $postprocess_cc_v\`
14663 -D*) echo "\$i" | $sed 's/^-D//';;
14664 -A*) $test "$gccversion" && echo "\$i" | $sed 's/^-A\(.*\)(\(.*\))/\1=\2/';;
14669 postprocess_cc_v=''
14672 ./ccsym > ccsym1.raw
14673 if $test -s ccsym1.raw; then
14674 $sort ccsym1.raw | $uniq >ccsym.raw
14676 mv ccsym1.raw ccsym.raw
14679 $awk '/\=/ { print $0; next }
14680 { print $0"=1" }' ccsym.raw >ccsym.list
14681 $awk '/\=/ { print $0; next }
14682 { print $0"=1" }' Cppsym.true >ccsym.true
14683 $comm -13 ccsym.true ccsym.list >ccsym.own
14684 $comm -12 ccsym.true ccsym.list >ccsym.com
14685 $comm -23 ccsym.true ccsym.list >ccsym.cpp
14687 if $test -z ccsym.raw; then
14688 echo "Your C compiler doesn't seem to define any symbols!" >&4
14690 echo "However, your C preprocessor defines the following symbols:"
14693 cppsymbols=`$cat Cppsym.true`
14694 cppsymbols=`echo $cppsymbols`
14695 cppccsymbols="$cppsymbols"
14697 if $test -s ccsym.com; then
14698 echo "Your C compiler and pre-processor define these symbols:"
14699 $sed -e 's/\(..*\)=.*/\1/' ccsym.com
14702 cppccsymbols=`$cat ccsym.com`
14703 cppccsymbols=`echo $cppccsymbols`
14704 $test "$silent" || sleep 1
14706 if $test -s ccsym.cpp; then
14707 $test "$also" && echo " "
14708 echo "Your C pre-processor ${also}defines the following symbols:"
14709 $sed -e 's/\(..*\)=.*/\1/' ccsym.cpp
14711 cppsymbols=`$cat ccsym.cpp`
14712 cppsymbols=`echo $cppsymbols`
14713 $test "$silent" || sleep 1
14715 if $test -s ccsym.own; then
14716 $test "$also" && echo " "
14717 echo "Your C compiler ${also}defines the following cpp symbols:"
14718 $sed -e 's/\(..*\)=1/\1/' ccsym.own
14719 $sed -e 's/\(..*\)=.*/\1/' ccsym.own | $uniq >>Cppsym.true
14720 ccsymbols=`$cat ccsym.own`
14721 ccsymbols=`echo $ccsymbols`
14722 $test "$silent" || sleep 1
14725 $rm -f ccsym* Cppsym.*
14727 : see if this is a termio system
14731 if $test `./findhdr termios.h`; then
14732 set tcsetattr i_termios
14738 "$define") echo "You have POSIX termios.h... good!" >&4;;
14739 *) if ./Cppsym pyr; then
14740 case "`/bin/universe`" in
14741 ucb) if $test `./findhdr sgtty.h`; then
14743 echo "<sgtty.h> found." >&4
14745 echo "System is pyramid with BSD universe."
14746 echo "<sgtty.h> not found--you could have problems." >&4
14748 *) if $test `./findhdr termio.h`; then
14750 echo "<termio.h> found." >&4
14752 echo "System is pyramid with USG universe."
14753 echo "<termio.h> not found--you could have problems." >&4
14757 if $test `./findhdr termio.h`; then
14758 echo "<termio.h> found." >&4
14760 elif $test `./findhdr sgtty.h`; then
14761 echo "<sgtty.h> found." >&4
14764 echo "Neither <termio.h> nor <sgtty.h> found--you could have problems." >&4
14767 if $test `./findhdr sgtty.h`; then
14768 echo "<sgtty.h> found." >&4
14770 elif $test `./findhdr termio.h`; then
14771 echo "<termio.h> found." >&4
14774 echo "Neither <sgtty.h> nor <termio.h> found--you could have problems." >&4
14778 set i_termio; eval $setvar
14779 val=$val2; set i_sgtty; eval $setvar
14780 val=$val3; set i_termios; eval $setvar
14782 : see if this is a shadow.h system
14783 set shadow.h i_shadow
14786 : see if this is a socks.h system
14787 set socks.h i_socks
14790 : see if stdarg is available
14792 if $test `./findhdr stdarg.h`; then
14793 echo "<stdarg.h> found." >&4
14796 echo "<stdarg.h> NOT found." >&4
14800 : see if varags is available
14802 if $test `./findhdr varargs.h`; then
14803 echo "<varargs.h> found." >&4
14805 echo "<varargs.h> NOT found, but that's ok (I hope)." >&4
14808 : set up the varargs testing programs
14809 $cat > varargs.c <<EOP
14811 #include <stdarg.h>
14814 #include <varargs.h>
14818 int f(char *p, ...)
14832 p = va_arg(ap, char *);
14837 $cat > varargs <<EOP
14839 if $cc -c $ccflags -D\$1 varargs.c >/dev/null 2>&1; then
14848 : now check which varargs header should be included
14853 if `./varargs I_STDARG`; then
14855 elif `./varargs I_VARARGS`; then
14860 if `./varargs I_VARARGS`; then
14867 echo "I could not find the definition for va_dcl... You have problems..." >&4
14868 val="$undef"; set i_stdarg; eval $setvar
14869 val="$undef"; set i_varargs; eval $setvar
14874 case "$i_varhdr" in
14876 val="$define"; set i_stdarg; eval $setvar
14877 val="$undef"; set i_varargs; eval $setvar
14880 val="$undef"; set i_stdarg; eval $setvar
14881 val="$define"; set i_varargs; eval $setvar
14884 echo "We'll include <$i_varhdr> to get va_dcl definition." >&4;;
14888 : see if stddef is available
14889 set stddef.h i_stddef
14892 : see if this is a sunmath.h system
14893 set sunmath.h i_sunmath
14896 : see if sys/access.h is available
14897 set sys/access.h i_sysaccess
14900 : see if ioctl defs are in sgtty, termio, sys/filio or sys/ioctl
14901 set sys/filio.h i_sysfilio
14904 if $test `./findhdr sys/ioctl.h`; then
14906 echo '<sys/ioctl.h> found.' >&4
14909 if $test $i_sysfilio = "$define"; then
14910 echo '<sys/ioctl.h> NOT found.' >&4
14912 $test $i_sgtty = "$define" && xxx="sgtty.h"
14913 $test $i_termio = "$define" && xxx="termio.h"
14914 $test $i_termios = "$define" && xxx="termios.h"
14915 echo "No <sys/ioctl.h> found, assuming ioctl args are defined in <$xxx>." >&4
14922 : see if this is a syslog.h system
14923 set syslog.h i_syslog
14927 : see if this is a sys/mode.h system
14928 set sys/mode.h i_sysmode
14931 : see if sys/resource.h has to be included
14932 set sys/resource.h i_sysresrc
14935 : see if sys/security.h is available
14936 set sys/security.h i_syssecrt
14939 : see if this is a sys/statvfs.h system
14940 set sys/statvfs.h i_sysstatvfs
14943 : see if this is a sys/uio.h system
14944 set sys/uio.h i_sysuio
14947 : see if this is a sys/un.h system
14948 set sys/un.h i_sysun
14952 : see if this is a sys/utsname.h system
14953 set sys/utsname.h i_sysutsname
14956 : see if this is a syswait system
14957 set sys/wait.h i_syswait
14960 : see if this is a ustat.h system
14961 set ustat.h i_ustat
14964 : see if this is an utime system
14965 set utime.h i_utime
14968 : see if this is a values.h system
14969 set values.h i_values
14972 : see if this is a vfork system
14975 set vfork.h i_vfork
14983 : see if gdbm.h is available
14988 : see if gdbm_open exists
14989 set gdbm_open d_gdbm_open
14991 case "$d_gdbm_open" in
14994 echo "We won't be including <gdbm.h>"
15004 echo "Looking for extensions..." >&4
15005 : If we are using the old config.sh, known_extensions may contain
15006 : old or inaccurate or duplicate values.
15007 known_extensions=''
15008 nonxs_extensions=''
15009 : We do not use find because it might not be available.
15010 : We do not just use MANIFEST because the user may have dropped
15011 : some additional extensions into the source tree and expect them
15014 : Function to recursively find available extensions, ignoring DynaLoader
15015 : NOTE: recursion limit of 10 to prevent runaway in case of symlink madness
15019 DynaLoader|dynaload) ;;
15021 if $test -f $xxx/$xxx.xs; then
15022 known_extensions="$known_extensions $1$xxx";
15023 elif $test -f $xxx/Makefile.PL; then
15024 nonxs_extensions="$nonxs_extensions $1$xxx";
15026 if $test -d $xxx -a $# -lt 10; then
15029 eval $find_extensions;
15041 eval $find_extensions
15042 set X $nonxs_extensions
15044 nonxs_extensions="$*"
15045 set X $known_extensions
15047 known_extensions="$*"
15050 : Now see which are supported on this system.
15052 for xxx in $known_extensions ; do
15056 $define) avail_ext="$avail_ext $xxx" ;;
15059 GDBM_File|gdbm_fil)
15061 $define) avail_ext="$avail_ext $xxx" ;;
15064 NDBM_File|ndbm_fil)
15067 case "$osname-$use64bitint" in
15070 *-lndbm*) avail_ext="$avail_ext $xxx" ;;
15073 *) avail_ext="$avail_ext $xxx" ;;
15078 ODBM_File|odbm_fil)
15079 case "${i_dbm}${i_rpcsvcdbm}" in
15081 case "$osname-$use64bitint" in
15084 *-ldbm*) avail_ext="$avail_ext $xxx" ;;
15087 *) avail_ext="$avail_ext $xxx" ;;
15093 case "$useposix" in
15094 true|define|y) avail_ext="$avail_ext $xxx" ;;
15098 case "$useopcode" in
15099 true|define|y) avail_ext="$avail_ext $xxx" ;;
15103 case "$d_socket" in
15104 true|$define|y) avail_ext="$avail_ext $xxx" ;;
15107 Sys/Syslog|sys/syslog)
15108 : XXX syslog requires socket
15109 case "$d_socket" in
15110 true|$define|y) avail_ext="$avail_ext $xxx" ;;
15114 case "$usethreads" in
15115 true|$define|y) avail_ext="$avail_ext $xxx" ;;
15119 : XXX Do we need a useipcsysv variable here
15120 case "${d_msg}${d_sem}${d_shm}" in
15121 *"${define}"*) avail_ext="$avail_ext $xxx" ;;
15124 *) avail_ext="$avail_ext $xxx"
15133 : Now see which nonxs extensions are supported on this system.
15134 : For now assume all are.
15136 for xxx in $nonxs_extensions ; do
15138 *) nonxs_ext="$nonxs_ext $xxx"
15150 A number of extensions are supplied with $package. You may choose to
15151 compile these extensions for dynamic loading (the default), compile
15152 them into the $package executable (static loading), or not include
15153 them at all. Answer "none" to include no extensions.
15154 Note that DynaLoader is always built and need not be mentioned here.
15157 case "$dynamic_ext" in
15158 '') dflt="$avail_ext" ;;
15159 *) dflt="$dynamic_ext"
15160 # Perhaps we are reusing an old out-of-date config.sh.
15163 if test X"$dynamic_ext" != X"$avail_ext"; then
15165 NOTICE: Your previous config.sh list may be incorrect.
15166 The extensions now available to you are
15168 but the default list from your previous config.sh is
15180 rp="What extensions do you wish to load dynamically?"
15183 none) dynamic_ext=' ' ;;
15184 *) dynamic_ext="$ans" ;;
15187 case "$static_ext" in
15189 : Exclude those already listed in dynamic linking
15191 for xxx in $avail_ext; do
15192 case " $dynamic_ext " in
15194 *) dflt="$dflt $xxx" ;;
15201 *) dflt="$static_ext"
15208 rp="What extensions do you wish to load statically?"
15211 none) static_ext=' ' ;;
15212 *) static_ext="$ans" ;;
15217 A number of extensions are supplied with $package. Answer "none"
15218 to include no extensions.
15219 Note that DynaLoader is always built and need not be mentioned here.
15222 case "$static_ext" in
15223 '') dflt="$avail_ext" ;;
15224 *) dflt="$static_ext"
15225 # Perhaps we are reusing an old out-of-date config.sh.
15228 if test X"$static_ext" != X"$avail_ext"; then
15230 NOTICE: Your previous config.sh list may be incorrect.
15231 The extensions now available to you are
15233 but the default list from your previous config.sh is
15242 : Exclude those that are not xs extensions
15246 rp="What extensions do you wish to include?"
15249 none) static_ext=' ' ;;
15250 *) static_ext="$ans" ;;
15255 set X $dynamic_ext $static_ext $nonxs_ext
15259 : Remove build directory name from cppstdin so it can be used from
15260 : either the present location or the final installed location.
15262 : Get out of the UU directory to get correct path name.
15264 case "$cppstdin" in
15266 echo "Stripping down cppstdin path name"
15272 : end of configuration questions
15274 echo "End of configuration questions."
15277 : back to where it started
15278 if test -d ../UU; then
15282 : configuration may be patched via a 'config.over' file
15283 if $test -f config.over; then
15286 rp='I see a config.over file. Do you wish to load it?'
15289 n*) echo "OK, I'll ignore it.";;
15291 echo "Configuration override changes have been loaded."
15296 : in case they want portability, strip down executable paths
15297 case "$d_portable" in
15300 echo "Stripping down executable paths..." >&4
15301 for file in $loclist $trylist; do
15303 eval $file=`basename $temp`
15308 : create config.sh file
15310 echo "Creating config.sh..." >&4
15311 $spitshell <<EOT >config.sh
15314 # This file was produced by running the Configure script. It holds all the
15315 # definitions figured out by Configure. Should you modify one of these values,
15316 # do not forget to propagate your changes by running "Configure -der". You may
15317 # instead choose to run each of the .SH files by yourself, or "Configure -S".
15320 # Package name : $package
15321 # Source directory : $src
15322 # Configuration time: $cf_time
15323 # Configured by : $cf_by
15324 # Target system : $myuname
15334 Revision='$Revision'
15341 alignbytes='$alignbytes'
15342 ansi2knr='$ansi2knr'
15343 aphostname='$aphostname'
15344 api_revision='$api_revision'
15345 api_subversion='$api_subversion'
15346 api_version='$api_version'
15347 api_versionstring='$api_versionstring'
15350 archlibexp='$archlibexp'
15351 archname64='$archname64'
15352 archname='$archname'
15353 archobjs='$archobjs'
15358 bincompat5005='$bincompat5005'
15362 byteorder='$byteorder'
15364 castflags='$castflags'
15367 cccdlflags='$cccdlflags'
15368 ccdlflags='$ccdlflags'
15370 ccflags_uselargefiles='$ccflags_uselargefiles'
15371 ccsymbols='$ccsymbols'
15373 cf_email='$cf_email'
15375 charsize='$charsize'
15379 clocktype='$clocktype'
15381 compress='$compress'
15382 contains='$contains'
15386 cpp_stuff='$cpp_stuff'
15387 cppccsymbols='$cppccsymbols'
15388 cppflags='$cppflags'
15390 cppminus='$cppminus'
15392 cppstdin='$cppstdin'
15393 cppsymbols='$cppsymbols'
15394 crosscompile='$crosscompile'
15395 cryptlib='$cryptlib'
15397 d_Gconvert='$d_Gconvert'
15398 d_PRIEldbl='$d_PRIEldbl'
15399 d_PRIFldbl='$d_PRIFldbl'
15400 d_PRIGldbl='$d_PRIGldbl'
15401 d_PRIX64='$d_PRIX64'
15402 d_PRId64='$d_PRId64'
15403 d_PRIeldbl='$d_PRIeldbl'
15404 d_PRIfldbl='$d_PRIfldbl'
15405 d_PRIgldbl='$d_PRIgldbl'
15406 d_PRIi64='$d_PRIi64'
15407 d_PRIo64='$d_PRIo64'
15408 d_PRIu64='$d_PRIu64'
15409 d_PRIx64='$d_PRIx64'
15410 d_access='$d_access'
15411 d_accessx='$d_accessx'
15413 d_archlib='$d_archlib'
15416 d_attribut='$d_attribut'
15419 d_bincompat5005='$d_bincompat5005'
15421 d_bsdgetpgrp='$d_bsdgetpgrp'
15422 d_bsdsetpgrp='$d_bsdsetpgrp'
15424 d_casti32='$d_casti32'
15425 d_castneg='$d_castneg'
15426 d_charvspr='$d_charvspr'
15428 d_chroot='$d_chroot'
15429 d_chsize='$d_chsize'
15430 d_closedir='$d_closedir'
15434 d_cuserid='$d_cuserid'
15435 d_dbl_dig='$d_dbl_dig'
15436 d_difftime='$d_difftime'
15437 d_dirnamlen='$d_dirnamlen'
15438 d_dlerror='$d_dlerror'
15439 d_dlopen='$d_dlopen'
15440 d_dlsymun='$d_dlsymun'
15441 d_dosuid='$d_dosuid'
15442 d_drand48proto='$d_drand48proto'
15444 d_eaccess='$d_eaccess'
15445 d_endgrent='$d_endgrent'
15446 d_endhent='$d_endhent'
15447 d_endnent='$d_endnent'
15448 d_endpent='$d_endpent'
15449 d_endpwent='$d_endpwent'
15450 d_endsent='$d_endsent'
15451 d_eofnblk='$d_eofnblk'
15452 d_eunice='$d_eunice'
15453 d_fchmod='$d_fchmod'
15454 d_fchown='$d_fchown'
15456 d_fd_macros='$d_fd_macros'
15457 d_fd_set='$d_fd_set'
15458 d_fds_bits='$d_fds_bits'
15459 d_fgetpos='$d_fgetpos'
15460 d_flexfnam='$d_flexfnam'
15463 d_fpathconf='$d_fpathconf'
15464 d_fpos64_t='$d_fpos64_t'
15465 d_frexpl='$d_frexpl'
15466 d_fs_data_s='$d_fs_data_s'
15467 d_fseeko='$d_fseeko'
15468 d_fsetpos='$d_fsetpos'
15469 d_fstatfs='$d_fstatfs'
15470 d_fstatvfs='$d_fstatvfs'
15471 d_ftello='$d_ftello'
15473 d_getcwd='$d_getcwd'
15474 d_getespwnam='$d_getespwnam'
15475 d_getfsstat='$d_getfsstat'
15476 d_getgrent='$d_getgrent'
15477 d_getgrps='$d_getgrps'
15478 d_gethbyaddr='$d_gethbyaddr'
15479 d_gethbyname='$d_gethbyname'
15480 d_gethent='$d_gethent'
15481 d_gethname='$d_gethname'
15482 d_gethostprotos='$d_gethostprotos'
15483 d_getlogin='$d_getlogin'
15484 d_getmnt='$d_getmnt'
15485 d_getmntent='$d_getmntent'
15486 d_getnbyaddr='$d_getnbyaddr'
15487 d_getnbyname='$d_getnbyname'
15488 d_getnent='$d_getnent'
15489 d_getnetprotos='$d_getnetprotos'
15490 d_getpbyname='$d_getpbyname'
15491 d_getpbynumber='$d_getpbynumber'
15492 d_getpent='$d_getpent'
15493 d_getpgid='$d_getpgid'
15494 d_getpgrp2='$d_getpgrp2'
15495 d_getpgrp='$d_getpgrp'
15496 d_getppid='$d_getppid'
15497 d_getprior='$d_getprior'
15498 d_getprotoprotos='$d_getprotoprotos'
15499 d_getprpwnam='$d_getprpwnam'
15500 d_getpwent='$d_getpwent'
15501 d_getsbyname='$d_getsbyname'
15502 d_getsbyport='$d_getsbyport'
15503 d_getsent='$d_getsent'
15504 d_getservprotos='$d_getservprotos'
15505 d_getspnam='$d_getspnam'
15506 d_gettimeod='$d_gettimeod'
15507 d_gnulibc='$d_gnulibc'
15508 d_grpasswd='$d_grpasswd'
15509 d_hasmntopt='$d_hasmntopt'
15513 d_inetaton='$d_inetaton'
15514 d_int64_t='$d_int64_t'
15515 d_isascii='$d_isascii'
15517 d_isnanl='$d_isnanl'
15518 d_killpg='$d_killpg'
15519 d_lchown='$d_lchown'
15520 d_ldbl_dig='$d_ldbl_dig'
15522 d_locconv='$d_locconv'
15524 d_longdbl='$d_longdbl'
15525 d_longlong='$d_longlong'
15526 d_lseekproto='$d_lseekproto'
15528 d_madvise='$d_madvise'
15530 d_mbstowcs='$d_mbstowcs'
15531 d_mbtowc='$d_mbtowc'
15532 d_memchr='$d_memchr'
15533 d_memcmp='$d_memcmp'
15534 d_memcpy='$d_memcpy'
15535 d_memmove='$d_memmove'
15536 d_memset='$d_memset'
15538 d_mkdtemp='$d_mkdtemp'
15539 d_mkfifo='$d_mkfifo'
15540 d_mkstemp='$d_mkstemp'
15541 d_mkstemps='$d_mkstemps'
15542 d_mktime='$d_mktime'
15545 d_mprotect='$d_mprotect'
15547 d_msg_ctrunc='$d_msg_ctrunc'
15548 d_msg_dontroute='$d_msg_dontroute'
15549 d_msg_oob='$d_msg_oob'
15550 d_msg_peek='$d_msg_peek'
15551 d_msg_proxy='$d_msg_proxy'
15552 d_msgctl='$d_msgctl'
15553 d_msgget='$d_msgget'
15554 d_msgrcv='$d_msgrcv'
15555 d_msgsnd='$d_msgsnd'
15557 d_munmap='$d_munmap'
15558 d_mymalloc='$d_mymalloc'
15560 d_nv_preserves_uv='$d_nv_preserves_uv'
15561 d_nv_preserves_uv_bits='$d_nv_preserves_uv_bits'
15562 d_off64_t='$d_off64_t'
15563 d_old_pthread_create_joinable='$d_old_pthread_create_joinable'
15564 d_oldpthreads='$d_oldpthreads'
15565 d_oldsock='$d_oldsock'
15567 d_pathconf='$d_pathconf'
15569 d_perl_otherlibdirs='$d_perl_otherlibdirs'
15570 d_phostname='$d_phostname'
15573 d_portable='$d_portable'
15574 d_printf_exp_digits='$d_printf_exp_digits'
15575 d_pthread_yield='$d_pthread_yield'
15577 d_pwchange='$d_pwchange'
15578 d_pwclass='$d_pwclass'
15579 d_pwcomment='$d_pwcomment'
15580 d_pwexpire='$d_pwexpire'
15581 d_pwgecos='$d_pwgecos'
15582 d_pwpasswd='$d_pwpasswd'
15583 d_pwquota='$d_pwquota'
15586 d_readdir='$d_readdir'
15587 d_readlink='$d_readlink'
15588 d_rename='$d_rename'
15589 d_rewinddir='$d_rewinddir'
15591 d_safebcpy='$d_safebcpy'
15592 d_safemcpy='$d_safemcpy'
15593 d_sanemcmp='$d_sanemcmp'
15594 d_sched_yield='$d_sched_yield'
15595 d_scm_rights='$d_scm_rights'
15596 d_seekdir='$d_seekdir'
15597 d_select='$d_select'
15599 d_semctl='$d_semctl'
15600 d_semctl_semid_ds='$d_semctl_semid_ds'
15601 d_semctl_semun='$d_semctl_semun'
15602 d_semget='$d_semget'
15604 d_setegid='$d_setegid'
15605 d_seteuid='$d_seteuid'
15606 d_setgrent='$d_setgrent'
15607 d_setgrps='$d_setgrps'
15608 d_sethent='$d_sethent'
15609 d_setlinebuf='$d_setlinebuf'
15610 d_setlocale='$d_setlocale'
15611 d_setnent='$d_setnent'
15612 d_setpent='$d_setpent'
15613 d_setpgid='$d_setpgid'
15614 d_setpgrp2='$d_setpgrp2'
15615 d_setpgrp='$d_setpgrp'
15616 d_setprior='$d_setprior'
15617 d_setproctitle='$d_setproctitle'
15618 d_setpwent='$d_setpwent'
15619 d_setregid='$d_setregid'
15620 d_setresgid='$d_setresgid'
15621 d_setresuid='$d_setresuid'
15622 d_setreuid='$d_setreuid'
15623 d_setrgid='$d_setrgid'
15624 d_setruid='$d_setruid'
15625 d_setsent='$d_setsent'
15626 d_setsid='$d_setsid'
15627 d_setvbuf='$d_setvbuf'
15631 d_shmatprototype='$d_shmatprototype'
15632 d_shmctl='$d_shmctl'
15634 d_shmget='$d_shmget'
15635 d_sigaction='$d_sigaction'
15636 d_sigsetjmp='$d_sigsetjmp'
15637 d_socket='$d_socket'
15638 d_socklen_t='$d_socklen_t'
15639 d_sockpair='$d_sockpair'
15641 d_statblks='$d_statblks'
15642 d_statfs_f_flags='$d_statfs_f_flags'
15643 d_statfs_s='$d_statfs_s'
15644 d_statvfs='$d_statvfs'
15645 d_stdio_cnt_lval='$d_stdio_cnt_lval'
15646 d_stdio_ptr_lval='$d_stdio_ptr_lval'
15647 d_stdio_stream_array='$d_stdio_stream_array'
15648 d_stdiobase='$d_stdiobase'
15649 d_stdstdio='$d_stdstdio'
15650 d_strchr='$d_strchr'
15651 d_strcoll='$d_strcoll'
15652 d_strctcpy='$d_strctcpy'
15653 d_strerrm='$d_strerrm'
15654 d_strerror='$d_strerror'
15655 d_strtod='$d_strtod'
15656 d_strtol='$d_strtol'
15657 d_strtold='$d_strtold'
15658 d_strtoll='$d_strtoll'
15659 d_strtoul='$d_strtoul'
15660 d_strtoull='$d_strtoull'
15661 d_strtouq='$d_strtouq'
15662 d_strxfrm='$d_strxfrm'
15663 d_suidsafe='$d_suidsafe'
15664 d_symlink='$d_symlink'
15665 d_syscall='$d_syscall'
15666 d_sysconf='$d_sysconf'
15667 d_sysernlst='$d_sysernlst'
15668 d_syserrlst='$d_syserrlst'
15669 d_system='$d_system'
15670 d_tcgetpgrp='$d_tcgetpgrp'
15671 d_tcsetpgrp='$d_tcsetpgrp'
15672 d_telldir='$d_telldir'
15673 d_telldirproto='$d_telldirproto'
15676 d_truncate='$d_truncate'
15677 d_tzname='$d_tzname'
15680 d_union_semun='$d_union_semun'
15682 d_vendorarch='$d_vendorarch'
15683 d_vendorbin='$d_vendorbin'
15684 d_vendorlib='$d_vendorlib'
15686 d_void_closedir='$d_void_closedir'
15687 d_voidsig='$d_voidsig'
15688 d_voidtty='$d_voidtty'
15689 d_volatile='$d_volatile'
15690 d_vprintf='$d_vprintf'
15692 d_waitpid='$d_waitpid'
15693 d_wcstombs='$d_wcstombs'
15694 d_wctomb='$d_wctomb'
15697 db_hashtype='$db_hashtype'
15698 db_prefixtype='$db_prefixtype'
15699 defvoidused='$defvoidused'
15700 direntrytype='$direntrytype'
15703 doublesize='$doublesize'
15705 dynamic_ext='$dynamic_ext'
15711 eunicefix='$eunicefix'
15714 extensions='$extensions'
15715 fflushNULL='$fflushNULL'
15716 fflushall='$fflushall'
15718 firstmakefile='$firstmakefile'
15720 fpossize='$fpossize'
15721 fpostype='$fpostype'
15722 freetype='$freetype'
15724 full_csh='$full_csh'
15725 full_sed='$full_sed'
15726 gccosandvers='$gccosandvers'
15727 gccversion='$gccversion'
15728 gidformat='$gidformat'
15734 groupcat='$groupcat'
15735 groupstype='$groupstype'
15738 h_sysfile='$h_sysfile'
15750 i_arpainet='$i_arpainet'
15751 i_bsdioctl='$i_bsdioctl'
15754 i_dirent='$i_dirent'
15762 i_ieeefp='$i_ieeefp'
15763 i_inttypes='$i_inttypes'
15764 i_libutil='$i_libutil'
15765 i_limits='$i_limits'
15766 i_locale='$i_locale'
15767 i_machcthr='$i_machcthr'
15768 i_malloc='$i_malloc'
15770 i_memory='$i_memory'
15771 i_mntent='$i_mntent'
15774 i_neterrno='$i_neterrno'
15775 i_netinettcp='$i_netinettcp'
15779 i_pthread='$i_pthread'
15781 i_rpcsvcdbm='$i_rpcsvcdbm'
15784 i_shadow='$i_shadow'
15786 i_stdarg='$i_stdarg'
15787 i_stddef='$i_stddef'
15788 i_stdlib='$i_stdlib'
15789 i_string='$i_string'
15790 i_sunmath='$i_sunmath'
15791 i_sysaccess='$i_sysaccess'
15792 i_sysdir='$i_sysdir'
15793 i_sysfile='$i_sysfile'
15794 i_sysfilio='$i_sysfilio'
15796 i_sysioctl='$i_sysioctl'
15797 i_syslog='$i_syslog'
15798 i_sysmman='$i_sysmman'
15799 i_sysmode='$i_sysmode'
15800 i_sysmount='$i_sysmount'
15801 i_sysndir='$i_sysndir'
15802 i_sysparam='$i_sysparam'
15803 i_sysresrc='$i_sysresrc'
15804 i_syssecrt='$i_syssecrt'
15805 i_sysselct='$i_sysselct'
15806 i_syssockio='$i_syssockio'
15807 i_sysstat='$i_sysstat'
15808 i_sysstatfs='$i_sysstatfs'
15809 i_sysstatvfs='$i_sysstatvfs'
15810 i_systime='$i_systime'
15811 i_systimek='$i_systimek'
15812 i_systimes='$i_systimes'
15813 i_systypes='$i_systypes'
15814 i_sysuio='$i_sysuio'
15816 i_sysutsname='$i_sysutsname'
15817 i_sysvfs='$i_sysvfs'
15818 i_syswait='$i_syswait'
15819 i_termio='$i_termio'
15820 i_termios='$i_termios'
15822 i_unistd='$i_unistd'
15825 i_values='$i_values'
15826 i_varargs='$i_varargs'
15827 i_varhdr='$i_varhdr'
15829 ignore_versioned_solibs='$ignore_versioned_solibs'
15830 inc_version_list='$inc_version_list'
15831 inc_version_list_init='$inc_version_list_init'
15834 installarchlib='$installarchlib'
15835 installbin='$installbin'
15836 installman1dir='$installman1dir'
15837 installman3dir='$installman3dir'
15838 installprefix='$installprefix'
15839 installprefixexp='$installprefixexp'
15840 installprivlib='$installprivlib'
15841 installscript='$installscript'
15842 installsitearch='$installsitearch'
15843 installsitebin='$installsitebin'
15844 installsitelib='$installsitelib'
15845 installstyle='$installstyle'
15846 installusrbinperl='$installusrbinperl'
15847 installvendorarch='$installvendorarch'
15848 installvendorbin='$installvendorbin'
15849 installvendorlib='$installvendorlib'
15851 ivdformat='$ivdformat'
15854 known_extensions='$known_extensions'
15858 lddlflags='$lddlflags'
15860 ldflags_uselargefiles='$ldflags_uselargefiles'
15861 ldlibpthname='$ldlibpthname'
15868 libsdirs='$libsdirs'
15869 libsfiles='$libsfiles'
15870 libsfound='$libsfound'
15871 libspath='$libspath'
15872 libswanted='$libswanted'
15873 libswanted_uselargefiles='$libswanted_uselargefiles'
15879 locincpth='$locincpth'
15880 loclibpth='$loclibpth'
15881 longdblsize='$longdblsize'
15882 longlongsize='$longlongsize'
15883 longsize='$longsize'
15887 lseeksize='$lseeksize'
15888 lseektype='$lseektype'
15892 make_set_make='$make_set_make'
15893 mallocobj='$mallocobj'
15894 mallocsrc='$mallocsrc'
15895 malloctype='$malloctype'
15897 man1direxp='$man1direxp'
15900 man3direxp='$man3direxp'
15903 mips_type='$mips_type'
15905 mmaptype='$mmaptype'
15907 modetype='$modetype'
15909 multiarch='$multiarch'
15911 myarchname='$myarchname'
15912 mydomain='$mydomain'
15913 myhostname='$myhostname'
15916 netdb_hlen_type='$netdb_hlen_type'
15917 netdb_host_type='$netdb_host_type'
15918 netdb_name_type='$netdb_name_type'
15919 netdb_net_type='$netdb_net_type'
15922 nm_so_opt='$nm_so_opt'
15923 nonxs_ext='$nonxs_ext'
15927 o_nonblock='$o_nonblock'
15929 old_pthread_create_joinable='$old_pthread_create_joinable'
15930 optimize='$optimize'
15931 orderlib='$orderlib'
15934 otherlibdirs='$otherlibdirs'
15938 patchlevel='$patchlevel'
15939 path_sep='$path_sep'
15942 perladmin='$perladmin'
15943 perlpath='$perlpath'
15945 phostname='$phostname'
15948 pm_apiversion='$pm_apiversion'
15952 prefixexp='$prefixexp'
15954 privlibexp='$privlibexp'
15955 prototype='$prototype'
15957 quadkind='$quadkind'
15958 quadtype='$quadtype'
15959 randbits='$randbits'
15960 randfunc='$randfunc'
15961 randseedtype='$randseedtype'
15963 rd_nodata='$rd_nodata'
15964 revision='$revision'
15968 sPRIEldbl='$sPRIEldbl'
15969 sPRIFldbl='$sPRIFldbl'
15970 sPRIGldbl='$sPRIGldbl'
15973 sPRIeldbl='$sPRIeldbl'
15974 sPRIfldbl='$sPRIfldbl'
15975 sPRIgldbl='$sPRIgldbl'
15980 sched_yield='$sched_yield'
15981 scriptdir='$scriptdir'
15982 scriptdirexp='$scriptdirexp'
15984 seedfunc='$seedfunc'
15985 selectminbits='$selectminbits'
15986 selecttype='$selecttype'
15987 sendmail='$sendmail'
15990 sharpbang='$sharpbang'
15991 shmattype='$shmattype'
15992 shortsize='$shortsize'
15995 sig_count='$sig_count'
15996 sig_name='$sig_name'
15997 sig_name_init='$sig_name_init'
15999 sig_num_init='$sig_num_init'
16000 signal_t='$signal_t'
16001 sitearch='$sitearch'
16002 sitearchexp='$sitearchexp'
16004 sitebinexp='$sitebinexp'
16006 sitelib_stem='$sitelib_stem'
16007 sitelibexp='$sitelibexp'
16008 siteprefix='$siteprefix'
16009 siteprefixexp='$siteprefixexp'
16010 sizesize='$sizesize'
16011 sizetype='$sizetype'
16016 sockethdr='$sockethdr'
16017 socketlib='$socketlib'
16018 socksizetype='$socksizetype'
16020 spackage='$spackage'
16021 spitshell='$spitshell'
16024 ssizetype='$ssizetype'
16025 startperl='$startperl'
16027 static_ext='$static_ext'
16029 stdio_base='$stdio_base'
16030 stdio_bufsiz='$stdio_bufsiz'
16031 stdio_cnt='$stdio_cnt'
16032 stdio_filbuf='$stdio_filbuf'
16033 stdio_ptr='$stdio_ptr'
16034 stdio_stream_array='$stdio_stream_array'
16037 subversion='$subversion'
16044 timeincl='$timeincl'
16045 timetype='$timetype'
16058 uidformat='$uidformat'
16064 uquadtype='$uquadtype'
16065 use5005threads='$use5005threads'
16066 use64bitall='$use64bitall'
16067 use64bitint='$use64bitint'
16069 useithreads='$useithreads'
16070 uselargefiles='$uselargefiles'
16071 uselongdouble='$uselongdouble'
16072 usemorebits='$usemorebits'
16073 usemultiplicity='$usemultiplicity'
16074 usemymalloc='$usemymalloc'
16076 useopcode='$useopcode'
16077 useperlio='$useperlio'
16078 useposix='$useposix'
16080 useshrplib='$useshrplib'
16081 usesocks='$usesocks'
16082 usethreads='$usethreads'
16083 usevendorprefix='$usevendorprefix'
16084 usevfork='$usevfork'
16087 uvoformat='$uvoformat'
16090 uvuformat='$uvuformat'
16091 uvxformat='$uvxformat'
16092 vendorarch='$vendorarch'
16093 vendorarchexp='$vendorarchexp'
16094 vendorbin='$vendorbin'
16095 vendorbinexp='$vendorbinexp'
16096 vendorlib='$vendorlib'
16097 vendorlib_stem='$vendorlib_stem'
16098 vendorlibexp='$vendorlibexp'
16099 vendorprefix='$vendorprefix'
16100 vendorprefixexp='$vendorprefixexp'
16103 voidflags='$voidflags'
16105 xs_apiversion='$xs_apiversion'
16110 : Add in command line options if available
16111 $test -f UU/cmdline.opt && $cat UU/cmdline.opt >> config.sh
16113 : add special variables
16114 $test -f $src/patchlevel.h && \
16115 awk '/^#define[ ]+PERL_/ {printf "%s=%s\n",$2,$3}' $src/patchlevel.h >>config.sh
16116 echo "CONFIGDOTSH=true" >>config.sh
16118 : propagate old symbols
16119 if $test -f UU/config.sh; then
16120 <UU/config.sh sort | uniq >UU/oldconfig.sh
16121 sed -n 's/^\([a-zA-Z_0-9]*\)=.*/\1/p' config.sh config.sh UU/oldconfig.sh |\
16122 sort | uniq -u >UU/oldsyms
16123 set X `cat UU/oldsyms`
16129 Hmm...You had some extra variables I don't know about...I'll try to keep 'em...
16131 echo "# Variables propagated from previous config.sh file." >>config.sh
16132 for sym in `cat UU/oldsyms`; do
16133 echo " Propagating $hint variable "'$'"$sym..."
16134 eval 'tmp="$'"${sym}"'"'
16136 sed -e "s/'/'\"'\"'/g" -e "s/^/$sym='/" -e "s/$/'/" >>config.sh
16142 : Finish up by extracting the .SH files
16156 If you'd like to make any changes to the config.sh file before I begin
16157 to configure things, do it as a shell escape now (e.g. !vi config.sh).
16160 rp="Press return or use a shell escape to edit config.sh:"
16165 *) : in case they cannot read
16166 sh 1>&4 -c "$ans";;
16171 : if this fails, just run all the .SH files by hand
16178 if $contains '^depend:' [Mm]akefile >/dev/null 2>&1; then
16185 Now you need to generate make dependencies by running "$make depend".
16186 You might prefer to run it in background: "$make depend > makedepend.out &"
16187 It can take a while, so you might not want to run it right now.
16192 rp="Run $make depend now?"
16196 $make depend && echo "Now you must run a $make."
16199 echo "You must run '$make depend' then '$make'."
16202 elif test -f [Mm]akefile; then
16204 echo "Now you must run a $make."
16209 if $test -f Policy.sh; then
16212 If you compile $package on a different machine or from a different object
16213 directory, copy the Policy.sh file from this object directory to the
16214 new one before you run Configure -- this will help you with most of
16215 the policy defaults.
16219 if $test -f config.msg; then
16220 echo "Hmm. I also noted the following information while running:"
16222 $cat config.msg >&4
16225 $rm -f kit*isdone ark*isdone