3 # If these # comments don't work, trim them. Don't worry about any other
4 # shell scripts, Configure will trim # comments from them for you.
6 # (If you are trying to port this package to a machine without sh,
7 # I would suggest you have a look at the prototypical config_h.SH file
8 # and edit it to reflect your system. Some packages may include samples
9 # of config.h for certain machines, so you might look for one of those.)
11 # Yes, you may rip this off to use in other distribution packages. This
12 # script belongs to the public domain and cannot be copyrighted.
14 # (Note: this Configure script was generated automatically. Rather than
15 # working with this copy of Configure, you may wish to get metaconfig.
16 # The dist-3.0 package (which contains metaconfig) was posted in
17 # comp.sources.misc and is available on CPAN under authors/id/RAM so
18 # you may fetch it yourself from your nearest archive site.)
21 # $Id: Head.U,v 3.0.1.9 1997/02/28 15:02:09 ram Exp $
23 # Generated on Fri Dec 1 22:20:01 EET 2000 [metaconfig 3.0 PL70]
24 # (with additional metaconfig patches by perlbug@perl.org)
29 SCO csh still thinks true is false. Write to SCO today and tell them that next
30 year Configure ought to "rm /bin/csh" unless they fix their blasted shell. :-)
32 (Actually, Configure ought to just patch csh in place. Hmm. Hmmmmm. All
33 we'd have to do is go in and swap the && and || tokens, wherever they are.)
35 [End of diatribe. We now return you to your regularly scheduled programming...]
39 OOPS! You naughty creature! You didn't run Configure with sh!
40 I will attempt to remedy the situation by running sh for you...
43 true || cat /tmp/c1$$ /tmp/c2$$
44 true || exec sh $0 $argv:q
46 (exit $?0) || cat /tmp/c2$$
47 (exit $?0) || exec sh $0 $argv:q
48 rm -f /tmp/c1$$ /tmp/c2$$
50 : compute my invocation name
54 me=`echo $0 | sed -e 's!.*/\(.*\)!\1!' 2>/dev/null`
59 : Proper separator for the PATH environment variable
61 : On OS/2 this directory should exist if this is not floppy only system :-]
62 if test -d c:/. ; then
63 if test -n "$OS2_SHELL"; then
65 PATH=`cmd /c "echo %PATH%" | tr '\\\\' / `
66 OS2_SHELL=`cmd /c "echo %OS2_SHELL%" | tr '\\\\' / | tr '[A-Z]' '[a-z]'`
67 elif test -n "$DJGPP"; then
73 paths='/bin /usr/bin /usr/local/bin /usr/ucb /usr/local /usr/lbin'
74 paths="$paths /opt/bin /opt/local/bin /opt/local /opt/lbin"
75 paths="$paths /usr/5bin /etc /usr/gnu/bin /usr/new /usr/new/bin /usr/nbin"
76 paths="$paths /opt/gnu/bin /opt/new /opt/new/bin /opt/nbin"
77 paths="$paths /sys5.3/bin /sys5.3/usr/bin /bsd4.3/bin /bsd4.3/usr/ucb"
78 paths="$paths /bsd4.3/usr/bin /usr/bsd /bsd43/bin /usr/ccs/bin"
79 paths="$paths /etc /usr/lib /usr/ucblib /lib /usr/ccs/lib"
80 paths="$paths /sbin /usr/sbin /usr/libexec"
86 *) test -d $p && PATH=$PATH$p_$p ;;
93 : shall we be using ksh?
99 if (PATH=.; alias -x) >/dev/null 2>&1; then
102 if test -f /hp-ux -a -f /bin/ksh; then
103 needksh='to avoid sh bug in "here document" expansion'
105 if test -d /usr/lpp -a -f /usr/bin/bsh -a -f /usr/bin/uname; then
106 if test X`/usr/bin/uname -v` = X4; then
107 avoidksh="to avoid AIX 4's /bin/sh"
111 if test -f /osf_boot -a -f /usr/sbin/setld; then
112 if test X`/usr/bin/uname -s` = XOSF1; then
113 avoidksh="to avoid Digital UNIX' ksh"
115 unset BIN_SH # if this is 'xpg4' sh will start up ksh
118 case "$inksh/$needksh" in
125 case "$inksh/$avoidksh" in
131 case "$inksh/$needksh-$avoidksh-" in
134 (I see you are using the Korn shell. Some ksh's blow up on $me,
135 mainly on older exotic systems. If yours does, try the Bourne shell instead.)
141 echo "(Feeding myself to $newsh $reason.)"
143 Configure|*/Configure) exec $newsh $0 "$@";;
144 *) exec $newsh Configure "$@";;
149 : if needed set CDPATH to a harmless value that is not chatty
150 : avoid bash 2.02 problems with empty CDPATH.
154 *bash*) CDPATH='.' ;;
159 : Configure runs within the UU subdirectory
160 test -d UU || mkdir UU
465 d_old_pthread_create_joinable=''
466 old_pthread_create_joinable=''
544 d_stdio_ptr_lval_nochange_cnt=''
545 d_stdio_ptr_lval_sets_cnt=''
716 inc_version_list_init=''
734 ignore_versioned_solibs=''
793 d_perl_otherlibdirs=''
810 d_nv_preserves_uv_bits=''
908 d_stdio_stream_array=''
909 stdio_stream_array=''
919 ccflags_uselargefiles=''
920 ldflags_uselargefiles=''
921 libswanted_uselargefiles=''
964 smallmach='pdp11 i8086 z8000 i80286 iAPX286'
967 : We must find out about Eunice early
969 if test -f /etc/unixtovms; then
970 eunicefix=/etc/unixtovms
972 if test -f /etc/unixtovms.exe; then
973 eunicefix=/etc/unixtovms.exe
980 : set useposix=false in your hint file to disable the POSIX extension.
982 : set useopcode=false in your hint file to disable the Opcode extension.
984 : Trailing extension. Override this in a hint file, if needed.
986 : Extra object files, if any, needed on this platform.
989 : Possible local include directories to search.
990 : Set locincpth to "" in a hint file to defeat local include searches.
991 locincpth="/usr/local/include /opt/local/include /usr/gnu/include"
992 locincpth="$locincpth /opt/gnu/include /usr/GNU/include /opt/GNU/include"
994 : no include file wanted by default
998 : change the next line if compiling for Xenix/286 on Xenix/386
999 xlibpth='/usr/lib/386 /lib/386'
1000 : Possible local library directories to search.
1001 loclibpth="/usr/local/lib /opt/local/lib /usr/gnu/lib"
1002 loclibpth="$loclibpth /opt/gnu/lib /usr/GNU/lib /opt/GNU/lib"
1004 : general looking path for locating libraries
1005 glibpth="/lib /usr/lib $xlibpth"
1006 glibpth="$glibpth /usr/ccs/lib /usr/ucblib /usr/local/lib"
1007 test -f /usr/shlib/libc.so && glibpth="/usr/shlib $glibpth"
1008 test -f /shlib/libc.so && glibpth="/shlib $glibpth"
1010 : Private path used by Configure to find libraries. Its value
1011 : is prepended to libpth. This variable takes care of special
1012 : machines, like the mips. Usually, it should be empty.
1015 : default library list
1017 : some systems want to use only the non-versioned libso:s
1018 ignore_versioned_solibs=''
1020 ccflags_uselargefiles=''
1021 ldflags_uselargefiles=''
1022 libswanted_uselargefiles=''
1023 : set usemultiplicity on the Configure command line to enable multiplicity.
1024 : set usesocks on the Configure command line to enable socks.
1025 : set usethreads on the Configure command line to enable threads.
1026 : full support for void wanted by default
1029 : List of libraries we want.
1030 : If anyone needs -lnet, put it in a hint file.
1031 libswanted='sfio socket bind inet nsl nm ndbm gdbm dbm db malloc dl'
1032 libswanted="$libswanted dld ld sun m c cposix posix"
1033 libswanted="$libswanted ndir dir crypt sec"
1034 libswanted="$libswanted ucb bsd BSD PW x iconv util"
1035 : We probably want to search /usr/shlib before most other libraries.
1036 : This is only used by the lib/ExtUtils/MakeMaker.pm routine extliblist.
1037 glibpth=`echo " $glibpth " | sed -e 's! /usr/shlib ! !'`
1038 glibpth="/usr/shlib $glibpth"
1039 : Do not use vfork unless overridden by a hint file.
1042 : Find the basic shell for Bourne shell scripts
1046 *bsd*|sys5*) xxx="/$SYSTYPE/bin/sh";;
1049 if test -f "$xxx"; then
1052 : Build up a list and do a single loop so we can 'break' out.
1053 pth=`echo $PATH | sed -e "s/$p_/ /g"`
1054 for xxx in sh bash ksh pdksh ash; do
1056 try="$try ${p}/${xxx}"
1060 if test -f "$xxx"; then
1063 elif test -f "$xxx.exe"; then
1074 $me: Fatal Error: I can't find a Bourne Shell anywhere.
1076 Usually it's in /bin/sh. How did you even get this far?
1077 Please contact me (Perl Maintainers) at perlbug@perl.org and
1078 we'll try to straighten this all out.
1084 : see if sh knows # comments
1085 if `$sh -c '#' >/dev/null 2>&1`; then
1089 test -f $xcat || xcat=/usr/bin/cat
1094 if test -s today; then
1097 echo "#! $xcat" > try
1101 if test -s today; then
1109 echo "Your $sh doesn't grok # comments--I will strip them later on."
1112 echo "exec grep -v '^[ ]*#'" >spitshell
1114 $eunicefix spitshell
1115 spitshell=`pwd`/spitshell
1117 echo "I presume that if # doesn't work, #! won't work either!"
1122 : figure out how to guarantee sh startup
1124 '') startsh=${sharpbang}${sh} ;;
1136 : echo "Yup, it does."
1138 echo "Hmm... '$startsh' does not guarantee sh startup..."
1139 echo "You may have to fix up the shell scripts to make sure $sh runs them."
1144 : Save command line options in file UU/cmdline.opt for later use in
1145 : generating config.sh.
1146 cat > cmdline.opt <<EOSH
1147 # Configure command line arguments.
1154 cat >>cmdline.opt <<EOSH
1155 config_arg$argn='$arg'
1157 argn=`expr $argn + 1`
1160 : produce awk script to parse command line options
1161 cat >options.awk <<'EOF'
1163 optstr = "A:dD:eEf:hKOrsSU:V"; # getopt-style specification
1165 len = length(optstr);
1166 for (i = 1; i <= len; i++) {
1167 c = substr(optstr, i, 1);
1168 if (i < len) a = substr(optstr, i + 1, 1); else a = "";
1179 if (substr(str, 1, 1) != "-") {
1180 printf("'%s'\n", str);
1184 for (i = 2; i <= len; i++) {
1185 c = substr(str, i, 1);
1187 printf("-%s\n", substr(str, i));
1193 printf("'%s'\n", substr(str, i + 1));
1206 : process the command line options
1207 set X `for arg in "$@"; do echo "X$arg"; done |
1208 sed -e s/X// | awk -f options.awk`
1213 : set up default values
1223 rm -f optdef.sh posthint.sh
1224 cat >optdef.sh <<EOS
1230 while test $# -gt 0; do
1232 -d) shift; fastread=yes;;
1233 -e) shift; alldone=cont;;
1237 if test -r "$1"; then
1240 echo "$me: cannot read config file $1." >&2
1245 -h) shift; error=true;;
1246 -r) shift; reuseval=true;;
1247 -s) shift; silent=true; realsilent=true;;
1248 -E) shift; alldone=exit;;
1249 -K) shift; knowitall=true;;
1250 -O) shift; override=true;;
1251 -S) shift; silent=true; extractsh=true;;
1256 echo "$me: use '-U symbol=', not '-D symbol='." >&2
1257 echo "$me: ignoring -D $1" >&2
1260 sed -e "s/'/'\"'\"'/g" -e "s/=\(.*\)/='\1'/" >> optdef.sh;;
1261 *) echo "$1='define'" >> optdef.sh;;
1268 *=) echo "$1" >> optdef.sh;;
1270 echo "$me: use '-D symbol=val', not '-U symbol=val'." >&2
1271 echo "$me: ignoring -U $1" >&2
1273 *) echo "$1='undef'" >> optdef.sh;;
1284 *=*) zzz=`echo $yyy|sed 's!=.*!!'`
1288 zzz=" "`echo $yyy|sed 's!^[^=]*=!!'`
1289 yyy=`echo $yyy|sed 's!=.*!!'` ;;
1295 *:*) xxx=`echo $yyy|sed 's!:.*!!'`
1296 yyy=`echo $yyy|sed 's!^[^:]*:!!'`
1297 zzz=`echo $yyy|sed 's!^[^=]*=!!'`
1298 yyy=`echo $yyy|sed 's!=.*!!'` ;;
1299 *) xxx=`echo $yyy|sed 's!:.*!!'`
1300 yyy=`echo $yyy|sed 's!^[^:]*:!!'` ;;
1306 echo "$yyy=\"\${$yyy}$zzz\"" >> posthint.sh ;;
1308 echo "$yyy=''" >> posthint.sh ;;
1313 echo "$yyy='$zzz'" >> posthint.sh ;;
1315 echo "eval \"$yyy=$zzz\"" >> posthint.sh ;;
1317 echo "$yyy=\"$zzz\${$yyy}\"" >> posthint.sh ;;
1322 echo "$yyy=$zzz" >> posthint.sh ;;
1323 *) echo "$me: unknown -A command '$xxx', ignoring -A $1" >&2 ;;
1327 -V) echo "$me generated by metaconfig 3.0 PL70." >&2
1330 -*) echo "$me: unknown option $1" >&2; shift; error=true;;
1338 Usage: $me [-dehrsEKOSV] [-f config.sh] [-D symbol] [-D symbol=value]
1339 [-U symbol] [-U symbol=] [-A command:symbol...]
1340 -d : use defaults for all answers.
1341 -e : go on without questioning past the production of config.sh.
1342 -f : specify an alternate default configuration file.
1343 -h : print this help message and exit (with an error status).
1344 -r : reuse C symbols value if possible (skips costly nm extraction).
1345 -s : silent mode, only echoes questions and essential information.
1346 -D : define symbol to have some value:
1347 -D symbol symbol gets the value 'define'
1348 -D symbol=value symbol gets the value 'value'
1349 -E : stop at the end of questions, after having produced config.sh.
1350 -K : do not use unless you know what you are doing.
1351 -O : let -D and -U override definitions from loaded configuration file.
1352 -S : perform variable substitutions on all .SH files (can mix with -f)
1353 -U : undefine symbol:
1354 -U symbol symbol gets the value 'undef'
1355 -U symbol= symbol gets completely empty
1356 -A : manipulate symbol after the platform specific hints have been applied:
1357 -A symbol=value append " "value to symbol
1358 -A append:symbol=value append value to symbol
1359 -A define:symbol=value define symbol to have value
1360 -A clear:symbol define symbol to be ''
1361 -A define:symbol define symbol to be 'define'
1362 -A eval:symbol=value define symbol to be eval of value
1363 -A prepend:symbol=value prepend value to symbol
1364 -A undef:symbol define symbol to be 'undef'
1365 -A undef:symbol= define symbol to be ''
1366 -V : print version number and exit (with a zero status).
1373 case "$fastread$alldone" in
1376 case "$extractsh" in
1379 if test ! -t 0; then
1380 echo "Say 'sh Configure', not 'sh <Configure'"
1390 true) exec 1>/dev/null;;
1393 : run the defines and the undefines, if any, but leave the file out there...
1396 : create the posthint manipulation script and leave the file out there...
1401 first=`echo $package | sed -e 's/^\(.\).*/\1/'`
1402 last=`echo $package | sed -e 's/^.\(.*\)/\1/'`
1403 case "`echo AbyZ | tr '[:lower:]' '[:upper:]' 2>/dev/null`" in
1404 ABYZ) spackage=`echo $first | tr '[:lower:]' '[:upper:]'`$last;;
1405 *) spackage=`echo $first | tr '[a-z]' '[A-Z]'`$last;;
1408 : Some greps do not return status, grrr.
1409 echo "grimblepritz" >grimble
1410 if grep blurfldyick grimble >/dev/null 2>&1 ; then
1412 elif grep grimblepritz grimble >/dev/null 2>&1 ; then
1418 : the following should work in any shell
1422 echo "AGH! Grep doesn't return a status. Attempting remedial action."
1423 cat >contains <<'EOSS'
1424 grep "$1" "$2" >.greptmp && cat .greptmp && test -s .greptmp
1429 : Find the path to the source tree
1432 */*) src=`echo $0 | sed -e 's%/[^/][^/]*$%%'`
1435 *) src=`cd ../$src && pwd` ;;
1448 if test -f $rsrc/Configure && \
1449 $contains "^package=$package$" $rsrc/Configure >/dev/null 2>&1
1451 : found it, so we are ok.
1454 for src in . .. ../.. ../../.. ../../../..; do
1455 if test -f ../$src/Configure && \
1456 $contains "^package=$package$" ../$src/Configure >/dev/null 2>&1
1467 Sorry, I can't seem to locate the source dir for $package. Please start
1468 Configure with an explicit path -- i.e. /some/path/Configure.
1476 echo "Sources for $package found in \"$src\"." >&4
1480 : script used to extract .SH files with variable substitutions
1481 cat >extract <<'EOS'
1483 echo "Doing variable substitutions on .SH files..."
1484 if test -f $src/MANIFEST; then
1485 set x `awk '{print $1}' <$src/MANIFEST | grep '\.SH$'`
1487 echo "(Looking for .SH files under the source directory.)"
1488 set x `(cd $src; find . -name "*.SH" -print)`
1492 0) set x `(cd $src; echo *.SH)`; shift;;
1494 if test ! -f $src/$1; then
1500 while test $name; do
1501 if test ! -d "$name"; then
1502 create="$name $create";
1503 name=`echo $name | sed -e "s|^[^/]*$||"`;
1504 name=`echo $name | sed -e "s|\(.*\)/.*|\1|"`;
1509 for file in $create; do
1518 dir=`expr X$file : 'X\(.*\)/'`
1519 file=`expr X$file : 'X.*/\(.*\)'`
1520 (cd $dir && . ./$file)
1530 dir=`expr X$file : 'X\(.*\)/'`
1531 file=`expr X$file : 'X.*/\(.*\)'`
1532 (set x $dir; shift; eval $mkdir_p)
1542 if test -f $src/config_h.SH; then
1543 if test ! -f config.h; then
1544 : oops, they left it out of MANIFEST, probably, so do it anyway.
1550 : extract files and exit if asked to do so
1551 case "$extractsh" in
1553 case "$realsilent" in
1557 case "$config_sh" in
1558 '') config_sh='config.sh';;
1561 echo "Fetching answers from $config_sh..."
1564 test "$override" && . ./optdef.sh
1573 : Eunice requires " " instead of "", can you believe it
1576 echo "Beginning of configuration questions for $package."
1578 trap 'echo " "; test -d ../UU && rm -rf X $rmlist; exit 1' 1 2 3 15
1580 : first determine how to suppress newline on echo command
1582 echo "Checking echo to see how to suppress newlines..."
1583 (echo "hi there\c" ; echo " ") >.echotmp
1584 if $contains c .echotmp >/dev/null 2>&1 ; then
1595 echo $n "The star should be here-->$c"
1599 : Now test for existence of everything in MANIFEST
1601 if test -f $rsrc/MANIFEST; then
1602 echo "First let's make sure your kit is complete. Checking..." >&4
1603 awk '$1 !~ /PACK[A-Z]+/ {print $1}' $rsrc/MANIFEST | split -50
1606 for filelist in x??; do
1607 (cd $rsrc; ls `cat $tmppwd/$filelist` >/dev/null 2>>$tmppwd/missing)
1609 if test -s missing; then
1613 THIS PACKAGE SEEMS TO BE INCOMPLETE.
1615 You have the option of continuing the configuration process, despite the
1616 distinct possibility that your kit is damaged, by typing 'y'es. If you
1617 do, don't blame me if something goes wrong. I advise you to type 'n'o
1618 and contact the author (perlbug@perl.org).
1621 echo $n "Continue? [n] $c" >&4
1625 echo "Continuing..." >&4
1629 echo "ABORTING..." >&4
1634 echo "Looks good..."
1637 echo "There is no MANIFEST file. I hope your kit is complete !"
1642 : Find the appropriate value for a newline for tr
1643 if test -n "$DJGPP"; then
1646 if test X"$trnl" = X; then
1647 case "`echo foo|tr '\n' x 2>/dev/null`" in
1651 if test X"$trnl" = X; then
1652 case "`echo foo|tr '\012' x 2>/dev/null`" in
1653 foox) trnl='\012' ;;
1656 if test X"$trnl" = X; then
1659 $me: Fatal Error: cannot figure out how to translate newlines with 'tr'.
1665 : compute the number of columns on the terminal for proper question formatting
1670 : set up the echo used in my read
1671 myecho="case \"\$xxxm\" in
1672 '') echo $n \"\$rp $c\" >&4;;
1674 '') echo $n \"[\$xxxm] $c\";;
1676 if test \`echo \"\$rp [\$xxxm] \" | wc -c\` -ge $COLUMNS; then
1678 echo $n \"[\$xxxm] $c\" >&4
1680 echo $n \"\$rp [\$xxxm] $c\" >&4
1686 : now set up to do reads with possible shell escape and default assignment
1692 case "\$fastread" in
1693 yes) case "\$dflt" in
1696 case "\$silent-\$rp" in
1701 *) case "\$silent" in
1702 true) case "\$rp" in
1707 while expr "X\$ans" : "X!" >/dev/null; do
1711 aok=''; eval "ans=\\"\$answ\\"" && aok=y
1719 set x \`expr "X\$ans" : "X!\(.*\)\$"\`
1728 set x \`expr "X\$ans" : "X&\(.*\)\$"\`
1733 echo "(OK, I'll run with -d after this question.)" >&4
1736 echo "*** Sorry, \$1 not supported yet." >&4
1746 echo "*** Substitution done -- please confirm."
1748 ans=\`echo $n "\$ans$c" | tr '$trnl' ' '\`
1753 echo "*** Error -- try again."
1760 case "\$ans\$xxxm\$nostick" in
1772 : create .config dir to save info across Configure sessions
1773 test -d ../.config || mkdir ../.config
1774 cat >../.config/README <<EOF
1775 This directory created by Configure to save information that should
1776 persist across sessions for $package.
1778 You may safely delete it if you wish.
1781 xversion=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
1783 $define|true|[yY]*) ;;
1784 *) case "$xversion" in
1787 *** WHOA THERE!!! ***
1789 This is an UNSTABLE DEVELOPMENT release.
1790 The version of this $package distribution is $xversion, that is, odd,
1791 (as opposed to even) and that signifies a development release.
1792 If you want a maintenance release, you want an even-numbered version.
1794 Do ***NOT*** install this into production use.
1795 Data corruption and crashes are possible.
1797 It is most seriously suggested that you do not continue any further
1798 unless you want to help in developing and debugging Perl.
1801 rp='Do you really want to continue?'
1805 [yY]) echo >&4 "Okay, continuing." ;;
1806 *) echo >&4 "Okay, bye."
1815 : general instructions
1818 user=`(logname) 2>/dev/null`
1820 '') user=`whoami 2>&1`;;
1822 if $contains "^$user\$" ../.config/instruct >/dev/null 2>&1; then
1825 rp='Would you like to see the instructions?'
1836 This installation shell script will examine your system and ask you questions
1837 to determine how the perl5 package should be installed. If you get
1838 stuck on a question, you may use a ! shell escape to start a subshell or
1839 execute a command. Many of the questions will have default answers in square
1840 brackets; typing carriage return will give you the default.
1842 On some of the questions which ask for file or directory names you are allowed
1843 to use the ~name construct to specify the login directory belonging to "name",
1844 even if you don't have a shell which knows about that. Questions where this is
1845 allowed will be marked "(~name ok)".
1849 dflt='Type carriage return to continue'
1853 The prompter used in this script allows you to use shell variables and
1854 backticks in your answers. You may use $1, $2, etc... to refer to the words
1855 in the default answer, as if the default line was a set of arguments given to a
1856 script shell. This means you may also use $* to repeat the whole default line,
1857 so you do not have to re-type everything to add something to the default.
1859 Everytime there is a substitution, you will have to confirm. If there is an
1860 error (e.g. an unmatched backtick), the default answer will remain unchanged
1861 and you will be prompted again.
1863 If you are in a hurry, you may run 'Configure -d'. This will bypass nearly all
1864 the questions and use the computed defaults (or the previous answers if there
1865 was already a config.sh file). Type 'Configure -h' for a list of options.
1866 You may also start interactively and then answer '& -d' at any prompt to turn
1867 on the non-interactive behaviour for the remainder of the execution.
1873 Much effort has been expended to ensure that this shell script will run on any
1874 Unix system. If despite that it blows up on yours, your best bet is to edit
1875 Configure and run it again. If you can't run Configure for some reason,
1876 you'll have to generate a config.sh file by hand. Whatever problems you
1877 have, let me (perlbug@perl.org) know how I blew it.
1879 This installation script affects things in two ways:
1881 1) it may do direct variable substitutions on some of the files included
1883 2) it builds a config.h file for inclusion in C programs. You may edit
1884 any of these files as the need arises after running this script.
1886 If you make a mistake on a question, there is no easy way to back up to it
1887 currently. The easiest thing to do is to edit config.sh and rerun all the SH
1888 files. Configure will offer to let you do this before it runs the SH files.
1891 dflt='Type carriage return to continue'
1893 case "$firsttime" in
1894 true) echo $user >>../.config/instruct;;
1898 : find out where common programs are
1900 echo "Locating common programs..." >&4
1913 if test -d \$dir/\$thing; then
1919 for thisthing in \$dir/\$thing; do
1920 : just loop through to pick last item
1922 if test -f \$thisthing; then
1925 elif test -f \$dir/\$thing.exe; then
1926 if test -n "$DJGPP"; then
1927 echo \$dir/\$thing.exe
1929 : on Eunice apparently
1979 pth=`echo $PATH | sed -e "s/$p_/ /g"`
1980 pth="$pth /lib /usr/lib"
1981 for file in $loclist; do
1985 if test -f "$xxx"; then
1988 echo "WARNING: no $xxx -- ignoring your setting for $file." >&4
1989 xxx=`./loc $file $file $pth`
1992 '') xxx=`./loc $file $file $pth`;;
1993 *) xxx=`./loc $xxx $xxx $pth`;;
1999 echo $file is in $xxx.
2002 echo $file is in $xxx.
2005 echo "I don't know where '$file' is, and my life depends on it." >&4
2006 echo "Go find a public domain implementation or fix your PATH setting!" >&4
2012 echo "Don't worry if any of the following aren't found..."
2014 for file in $trylist; do
2018 if test -f "$xxx"; then
2021 echo "WARNING: no $xxx -- ignoring your setting for $file." >&4
2022 xxx=`./loc $file $file $pth`
2025 '') xxx=`./loc $file $file $pth`;;
2026 *) xxx=`./loc $xxx $xxx $pth`;;
2032 echo $file is in $xxx.
2035 echo $file is in $xxx.
2038 echo "I don't see $file out there, $say."
2045 echo "Substituting grep for egrep."
2051 echo "Substituting cp for ln."
2057 echo "Hopefully test is built into your sh."
2060 if `sh -c "PATH= test true" >/dev/null 2>&1`; then
2061 echo "Using the test built into your sh."
2069 echo "Hopefully echo is built into your sh."
2074 echo "Checking compatibility between $echo and builtin echo (if any)..." >&4
2075 $echo $n "hi there$c" >foo1
2076 echo $n "hi there$c" >foo2
2077 if cmp foo1 foo2 >/dev/null 2>&1; then
2078 echo "They are compatible. In fact, they may be identical."
2085 They are not compatible! You are probably running ksh on a non-USG system.
2086 I'll have to use $echo instead of the builtin, since Bourne shell doesn't
2087 have echo built in and we may have to run some Bourne shell scripts. That
2088 means I'll have to use '$n$c' to suppress newlines now. Life is ridiculous.
2091 $echo $n "The star should be here-->$c"
2101 cat <<'EOSC' >>checkcc
2106 int main(int argc, char *argv[]) {
2110 if $cc -o try $ccflags try.c; then
2113 echo "Uh-oh, the C compiler '$cc' doesn't seem to be working." >&4
2119 case "`$cc -v -c try.c 2>&1`" in
2122 if $test X"$trygcc" = Xyes; then
2123 if gcc -o try -c try.c; then
2125 echo "You seem to have a working gcc, though." >&4
2126 rp="Would you like to use it?"
2128 if $test -f myread; then
2131 if $test -f UU/myread; then
2134 echo "Cannot find myread, sorry. Aborting." >&2
2139 [yY]*) cc=gcc; ccname=gcc; ccflags=''; despair=no ;;
2143 if $test X"$despair" = Xyes; then
2145 You need to find a working C compiler.
2146 Either (purchase and) install the C compiler supplied by your OS vendor,
2147 or for a free C compiler try http://gcc.gnu.org/
2148 I cannot continue any further, aborting.
2158 : determine whether symbolic links are supported
2161 if $ln -s blurfl sym > /dev/null 2>&1 ; then
2162 echo "Symbolic links are supported." >&4
2165 echo "Symbolic links are NOT supported." >&4
2170 : see whether [:lower:] and [:upper:] are supported character classes
2172 case "`echo AbyZ | $tr '[:lower:]' '[:upper:]' 2>/dev/null`" in
2174 echo "Good, your tr supports [:lower:] and [:upper:] to convert case." >&4
2178 *) # There is a discontinuity in EBCDIC between 'I' and 'J'
2179 # (0xc9 and 0xd1), therefore that is a nice testing point.
2180 if test "X$up" = X -o "X$low" = X; then
2181 case "`echo IJ | $tr '[I-J]' '[i-j]' 2>/dev/null`" in
2187 if test "X$up" = X -o "X$low" = X; then
2188 case "`echo IJ | $tr I-J i-j 2>/dev/null`" in
2194 if test "X$up" = X -o "X$low" = X; then
2195 case "`echo IJ | od -x 2>/dev/null`" in
2197 echo "Hey, this might be EBCDIC." >&4
2198 if test "X$up" = X -o "X$low" = X; then
2199 case "`echo IJ | $tr '[A-IJ-RS-Z]' '[a-ij-rs-z]' 2>/dev/null`" in
2200 ij) up='[A-IJ-RS-Z]'
2205 if test "X$up" = X -o "X$low" = X; then
2206 case "`echo IJ | $tr A-IJ-RS-Z a-ij-rs-z 2>/dev/null`" in
2216 case "`echo IJ | $tr \"$up\" \"$low\" 2>/dev/null`" in
2218 echo "Using $up and $low to convert case." >&4
2221 echo "I don't know how to translate letters from upper to lower case." >&4
2222 echo "Your tr is not acting any way I know of." >&4
2226 : set up the translation script tr, must be called with ./tr of course
2230 '[A-Z][a-z]') exec $tr '$up' '$low';;
2231 '[a-z][A-Z]') exec $tr '$low' '$up';;
2238 : Try to determine whether config.sh was made on this system
2239 case "$config_sh" in
2241 myuname=`$uname -a 2>/dev/null`
2242 $test -z "$myuname" && myuname=`hostname 2>/dev/null`
2243 # tr '[A-Z]' '[a-z]' would not work in EBCDIC
2244 # because the A-Z/a-z are not consecutive.
2245 myuname=`echo $myuname | $sed -e 's/^[^=]*=//' -e 's/\///g' | \
2246 ./tr '[A-Z]' '[a-z]' | $tr $trnl ' '`
2247 newmyuname="$myuname"
2249 case "$knowitall" in
2251 if test -f ../config.sh; then
2252 if $contains myuname= ../config.sh >/dev/null 2>&1; then
2253 eval "`grep myuname= ../config.sh`"
2255 if test "X$myuname" = "X$newmyuname"; then
2263 : Get old answers from old config file if Configure was run on the
2264 : same system, otherwise use the hints.
2267 if test -f config.sh; then
2269 rp="I see a config.sh file. Shall I use it to set the defaults?"
2272 n*|N*) echo "OK, I'll ignore it."
2273 mv config.sh config.sh.old
2274 myuname="$newmyuname"
2276 *) echo "Fetching default answers from your old config.sh file..." >&4
2284 : Older versions did not always set $sh. Catch re-use of such
2294 if test ! -f config.sh; then
2297 First time through, eh? I have some defaults handy for some systems
2298 that need some extra help getting the Configure answers right:
2301 (cd $src/hints; ls -C *.sh) | $sed 's/\.sh/ /g' >&4
2303 : Half the following guesses are probably wrong... If you have better
2304 : tests or hints, please send them to perlbug@perl.org
2305 : The metaconfig authors would also appreciate a copy...
2306 $test -f /irix && osname=irix
2307 $test -f /xenix && osname=sco_xenix
2308 $test -f /dynix && osname=dynix
2309 $test -f /dnix && osname=dnix
2310 $test -f /lynx.os && osname=lynxos
2311 $test -f /unicos && osname=unicos && osvers=`$uname -r`
2312 $test -f /unicosmk && osname=unicosmk && osvers=`$uname -r`
2313 $test -f /unicosmk.ar && osname=unicosmk && osvers=`$uname -r`
2314 $test -f /bin/mips && /bin/mips && osname=mips
2315 $test -d /NextApps && set X `hostinfo | grep 'NeXT Mach.*:' | \
2316 $sed -e 's/://' -e 's/\./_/'` && osname=next && osvers=$4
2317 $test -d /usr/apollo/bin && osname=apollo
2318 $test -f /etc/saf/_sactab && osname=svr4
2319 $test -d /usr/include/minix && osname=minix
2320 if $test -d /MachTen -o -d /MachTen_Folder; then
2322 if $test -x /sbin/version; then
2323 osvers=`/sbin/version | $awk '{print $2}' |
2324 $sed -e 's/[A-Za-z]$//'`
2325 elif $test -x /usr/etc/version; then
2326 osvers=`/usr/etc/version | $awk '{print $2}' |
2327 $sed -e 's/[A-Za-z]$//'`
2333 $test -f /sys/posix.dll &&
2334 $test -f /usr/bin/what &&
2335 set X `/usr/bin/what /sys/posix.dll` &&
2336 $test "$3" = UWIN &&
2340 if $test -f $uname; then
2348 umips) osname=umips ;;
2351 [23]100) osname=mips ;;
2352 next*) osname=next ;;
2354 tmp=`/bin/uname -X 2>/dev/null|awk '/3\.2v[45]/{ print $(NF) }'`
2355 if $test "$tmp" != "" -a "$3" = "3.2" -a -f '/etc/systemid'; then
2358 elif $test -f /etc/kconfig; then
2360 if test "$lns" = "$ln -s"; then
2362 elif $contains _SYSV3 /usr/include/stdio.h > /dev/null 2>&1 ; then
2364 elif $contains _POSIX_SOURCE /usr/include/stdio.h > /dev/null 2>&1 ; then
2371 if test -n "$DJGPP"; then
2380 tmp=`( (oslevel) 2>/dev/null || echo "not found") 2>&1`
2382 'not found') osvers="$4"."$3" ;;
2383 '<3240'|'<>3240') osvers=3.2.0 ;;
2384 '=3240'|'>3240'|'<3250'|'<>3250') osvers=3.2.4 ;;
2385 '=3250'|'>3250') osvers=3.2.5 ;;
2389 bsd386) osname=bsd386
2392 cygwin*) osname=cygwin
2395 *dc.osx) osname=dcosx
2401 domainos) osname=apollo
2407 dynixptx*) osname=dynixptx
2408 osvers=`echo "$4"|sed 's/^v//'`
2410 freebsd) osname=freebsd
2412 genix) osname=genix ;;
2414 osvers=`echo "$3" | $sed 's,.*\.\([0-9]*\.[0-9]*\),\1,'`
2430 netbsd*) osname=netbsd
2433 news-os) osvers="$3"
2435 4*) osname=newsos4 ;;
2439 next*) osname=next ;;
2440 nonstop-ux) osname=nonstopux ;;
2441 POSIX-BC | posix-bc ) osname=posix-bc
2444 powerux | power_ux | powermax_os | powermaxos | \
2445 powerunix | power_unix) osname=powerux
2451 solaris) osname=solaris
2453 5*) osvers=`echo $3 | $sed 's/^5/2/g'` ;;
2460 osvers=`echo $3 | $sed 's/^5/2/g'` ;;
2464 titanos) osname=titanos
2473 ultrix) osname=ultrix
2476 osf1|mls+) case "$5" in
2479 osvers=`sizer -v | awk '{print $3}' | tr '[A-Z]' '[a-z]' | sed 's/^[xvt]//'`
2482 *) osvers=`echo "$3" | sed 's/^[xvt]//'` ;;
2485 hp*) osname=hp_osf1 ;;
2486 mips) osname=mips_osf1 ;;
2489 unixware) osname=svr5
2495 $2) case "$osname" in
2499 : svr4.x or possibly later
2509 if test -f /stand/boot ; then
2510 eval `grep '^INITPROG=[a-z/0-9]*$' /stand/boot`
2511 if test -n "$INITPROG" -a -f "$INITPROG"; then
2512 isesix=`strings -a $INITPROG|grep 'ESIX SYSTEM V/386 Release 4.0'`
2513 if test -n "$isesix"; then
2521 *) if test -f /etc/systemid; then
2523 set `echo $3 | $sed 's/\./ /g'` $4
2524 if $test -f $src/hints/sco_$1_$2_$3.sh; then
2526 elif $test -f $src/hints/sco_$1_$2.sh; then
2528 elif $test -f $src/hints/sco_$1.sh; then
2533 '') : Still unknown. Probably a generic Sys V.
2542 *) case "$osname" in
2543 '') : Still unknown. Probably a generic BSD.
2551 if test -f /vmunix -a -f $src/hints/news_os.sh; then
2552 (what /vmunix | UU/tr '[A-Z]' '[a-z]') > UU/kernel.what 2>&1
2553 if $contains news-os UU/kernel.what >/dev/null 2>&1; then
2556 $rm -f UU/kernel.what
2557 elif test -d c:/.; then
2564 : Now look for a hint file osname_osvers, unless one has been
2565 : specified already.
2568 file=`echo "${osname}_${osvers}" | $sed -e 's%\.%_%g' -e 's%_$%%'`
2569 : Also try without trailing minor version numbers.
2570 xfile=`echo $file | $sed -e 's%_[^_]*$%%'`
2571 xxfile=`echo $xfile | $sed -e 's%_[^_]*$%%'`
2572 xxxfile=`echo $xxfile | $sed -e 's%_[^_]*$%%'`
2573 xxxxfile=`echo $xxxfile | $sed -e 's%_[^_]*$%%'`
2576 *) case "$osvers" in
2579 *) if $test -f $src/hints/$file.sh ; then
2581 elif $test -f $src/hints/$xfile.sh ; then
2583 elif $test -f $src/hints/$xxfile.sh ; then
2585 elif $test -f $src/hints/$xxxfile.sh ; then
2587 elif $test -f $src/hints/$xxxxfile.sh ; then
2589 elif $test -f "$src/hints/${osname}.sh" ; then
2598 if $test -f Policy.sh ; then
2601 none) dflt="Policy" ;;
2602 *) dflt="Policy $dflt" ;;
2607 dflt=`echo $hintfile | $sed 's/\.sh$//'`
2611 if $test -f Policy.sh ; then
2614 There's also a Policy hint file available, which should make the
2615 site-specific (policy) questions easier to answer.
2622 You may give one or more space-separated answers, or "none" if appropriate.
2623 A well-behaved OS will have no hints, so answering "none" or just "Policy"
2624 is a good thing. DO NOT give a wrong version or a wrong OS.
2628 rp="Which of these apply, if any?"
2631 for file in $tans; do
2632 if $test X$file = XPolicy -a -f Policy.sh; then
2634 $cat Policy.sh >> UU/config.sh
2635 elif $test -f $src/hints/$file.sh; then
2636 . $src/hints/$file.sh
2637 $cat $src/hints/$file.sh >> UU/config.sh
2638 elif $test X$tans = X -o X$tans = Xnone ; then
2641 : Give one chance to correct a possible typo.
2642 echo "$file.sh does not exist"
2644 rp="hint to use instead?"
2646 for file in $ans; do
2647 if $test -f "$src/hints/$file.sh"; then
2648 . $src/hints/$file.sh
2649 $cat $src/hints/$file.sh >> UU/config.sh
2650 elif $test X$ans = X -o X$ans = Xnone ; then
2653 echo "$file.sh does not exist -- ignored."
2660 : Remember our hint file for later.
2661 if $test -f "$src/hints/$file.sh" ; then
2671 echo "Fetching default answers from $config_sh..." >&4
2675 cp $config_sh config.sh 2>/dev/null
2685 test "$override" && . ./optdef.sh
2687 : Restore computed paths
2688 for file in $loclist $trylist; do
2689 eval $file="\$_$file"
2694 Configure uses the operating system name and version to set some defaults.
2695 The default value is probably right if the name rings a bell. Otherwise,
2696 since spelling matters for me, either accept the default or answer "none"
2703 ''|' '|none) dflt=none ;;
2704 *) dflt=`echo $hintfile | $sed -e 's/\.sh$//' -e 's/_.*$//'` ;;
2707 *) dflt="$osname" ;;
2709 rp="Operating system name?"
2713 *) osname=`echo "$ans" | $sed -e 's/[ ][ ]*/_/g' | ./tr '[A-Z]' '[a-z]'`;;
2719 ''|' '|none) dflt=none ;;
2720 *) dflt=`echo $hintfile | $sed -e 's/\.sh$//' -e 's/^[^_]*//'`
2721 dflt=`echo $dflt | $sed -e 's/^_//' -e 's/_/./g'`
2723 ''|' ') dflt=none ;;
2728 *) dflt="$osvers" ;;
2730 rp="Operating system version?"
2740 : who configured the system
2741 cf_time=`LC_ALL=C; LANGUAGE=C; export LC_ALL; export LANGUAGE; $date 2>&1`
2742 cf_by=`(logname) 2>/dev/null`
2745 cf_by=`(whoami) 2>/dev/null`
2747 "") cf_by=unknown ;;
2751 : set up the script used to warn in case of inconsistency
2758 echo "*** WHOA THERE!!! ***" >&4
2759 echo " The $hint value for \$$var on this machine was \"$was\"!" >&4
2760 rp=" Keep the $hint value?"
2763 y) td=$was; tu=$was;;
2767 : function used to set $1 to $val
2768 setvar='var=$1; eval "was=\$$1"; td=$define; tu=$undef;
2770 $define$undef) . ./whoa; eval "$var=\$td";;
2771 $undef$define) . ./whoa; eval "$var=\$tu";;
2772 *) eval "$var=$val";;
2775 case "$usethreads" in
2776 $define|true|[yY]*) dflt='y';;
2781 Perl can be built to take advantage of threads on some systems.
2782 To do so, Configure can be run with -Dusethreads.
2784 Note that threading is a highly experimental feature, and
2785 some known race conditions still remain. If you choose to try
2786 it, be very sure to not actually deploy it for production
2787 purposes. README.threads has more details, and is required
2788 reading if you enable threads.
2790 If this doesn't make any sense to you, just accept the default '$dflt'.
2792 rp='Build a threading Perl?'
2795 y|Y) val="$define" ;;
2801 case "$usethreads" in
2805 As of 5.5.640, Perl has two different internal threading implementations,
2806 the 5.005 version (5005threads) and an interpreter-based version
2807 (ithreads) that has one interpreter per thread. Both are very
2808 experimental. This arrangement exists to help developers work out
2809 which one is better.
2811 If you're a casual user, you probably don't want interpreter-threads
2812 at this time. There doesn't yet exist a way to create threads from
2813 within Perl in this model, i.e., "use Thread;" will NOT work.
2815 : Default to ithreads unless overridden on command line or with
2818 case "$use5005threads" in
2819 $define|true|[yY]*) dflt='n';;
2821 case "$useithreads" in
2822 $undef|false|[nN]*) dflt='n';;
2824 rp='Use interpreter-based ithreads?'
2827 y|Y) val="$define" ;;
2832 : Now set use5005threads to the opposite value.
2833 case "$useithreads" in
2834 $define) val="$undef" ;;
2841 useithreads="$undef"
2842 use5005threads="$undef"
2846 case "$d_oldpthreads" in
2847 '') : Configure tests would be welcome here. For now, assume undef.
2849 *) val="$d_oldpthreads" ;;
2855 case "$usethreads" in
2856 "$define"|true|[yY]*)
2857 : Look for a hint-file generated 'call-back-unit'. If the
2858 : user has specified that a threading perl is to be built,
2859 : we may need to set or change some other defaults.
2860 if $test -f usethreads.cbu; then
2861 echo "Your platform has some specific hints for threaded builds, using them..."
2865 (Your platform doesn't have any specific hints for threaded builds.
2866 Assuming POSIX threads, then.)
2874 Perl can be built so that multiple Perl interpreters can coexist
2875 within the same Perl executable.
2878 case "$useithreads" in
2881 This multiple interpreter support is required for interpreter-based threads.
2885 *) case "$usemultiplicity" in
2886 $define|true|[yY]*) dflt='y';;
2890 echo "If this doesn't make any sense to you, just accept the default '$dflt'."
2891 rp='Build Perl for multiplicity?'
2894 y|Y) val="$define" ;;
2902 : make some quick guesses about what we are up against
2904 $echo $n "Hmm... $c"
2914 $cat /usr/include/signal.h /usr/include/sys/signal.h >foo 2>/dev/null
2915 if test -f /osf_boot || $contains 'OSF/1' /usr/include/ctype.h >/dev/null 2>&1
2917 echo "Looks kind of like an OSF/1 system, but we'll see..."
2919 elif test `echo abc | $tr a-z A-Z` = Abc ; then
2920 xxx=`./loc addbib blurfl $pth`
2921 if $test -f $xxx; then
2922 echo "Looks kind of like a USG system with BSD features, but we'll see..."
2926 if $contains SIGTSTP foo >/dev/null 2>&1 ; then
2927 echo "Looks kind of like an extended USG system, but we'll see..."
2929 echo "Looks kind of like a USG system, but we'll see..."
2933 elif $contains SIGTSTP foo >/dev/null 2>&1 ; then
2934 echo "Looks kind of like a BSD system, but we'll see..."
2938 echo "Looks kind of like a Version 7 system, but we'll see..."
2941 case "$eunicefix" in
2944 There is, however, a strange, musty smell in the air that reminds me of
2945 something...hmm...yes...I've got it...there's a VMS nearby, or I'm a Blit.
2949 : it so happens the Eunice I know will not run shell scripts in Unix format
2953 echo "Congratulations. You aren't running Eunice."
2957 : Detect OS2. The p_ variable is set above in the Head.U unit.
2958 : Note that this also -- wrongly -- detects e.g. dos-djgpp, which also uses
2959 : semicolon as a patch separator
2964 I have the feeling something is not exactly right, however...don't tell me...
2965 lemme think...does HAL ring a bell?...no, of course, you're only running OS/2!
2966 (Or you may be running DOS with DJGPP.)
2971 if test -f /xenix; then
2972 echo "Actually, this looks more like a XENIX system..."
2977 echo "It's not Xenix..."
2982 if test -f /venix; then
2983 echo "Actually, this looks more like a VENIX system..."
2990 echo "Nor is it Venix..."
2993 chmod +x bsd usg v7 osf1 eunice xenix venix os2
2994 $eunicefix bsd usg v7 osf1 eunice xenix venix os2
3001 rp="Use which C compiler?"
3004 : Look for a hint-file generated 'call-back-unit'. Now that the
3005 : user has specified the compiler, we may need to set or change some
3007 if $test -f cc.cbu; then
3013 echo "Checking for GNU cc in disguise and/or its version number..." >&4
3014 $cat >gccvers.c <<EOM
3019 printf("%s\n", __VERSION__);
3021 printf("%s\n", "1");
3027 if $cc -o gccvers $ldflags gccvers.c; then
3028 gccversion=`./gccvers`
3029 case "$gccversion" in
3030 '') echo "You are not using GNU cc." ;;
3031 *) echo "You are using GNU cc $gccversion."
3037 echo "*** WHOA THERE!!! ***" >&4
3038 echo " Your C compiler \"$cc\" doesn't seem to be working!" >&4
3039 case "$knowitall" in
3041 echo " You'd better start hunting for one and let me know about it." >&4
3047 case "$gccversion" in
3048 1*) cpp=`./loc gcc-cpp $cpp $pth` ;;
3050 case "$gccversion" in
3051 '') gccosandvers='' ;;
3052 *) gccshortvers=`echo "$gccversion"|sed 's/ .*//'`
3053 gccosandvers=`$cc -v 2>&1|grep '/specs$'|sed "s!.*/[^-/]*-[^-/]*-\([^-/]*\)/$gccshortvers/specs!\1!"`
3055 case "$gccosandvers" in
3056 $osname) gccosandvers='' ;; # linux gccs seem to have no linux osvers, grr
3057 $osname$osvers) ;; # looking good
3058 $osname*) cat <<EOM >&4
3060 *** WHOA THERE!!! ***
3062 Your gcc has not been compiled for the exact release of
3063 your operating system ($gccosandvers versus $osname$osvers).
3065 In general it is a good idea to keep gcc synchronized with
3066 the operating system because otherwise serious problems
3067 may ensue when trying to compile software, like Perl.
3069 I'm trying to be optimistic here, though, and will continue.
3070 If later during the configuration and build icky compilation
3071 problems appear (headerfile conflicts being the most common
3072 manifestation), I suggest reinstalling the gcc to match
3073 your operating system release.
3077 *) gccosandvers='' ;; # failed to parse, better be silent
3085 : see how we invoke the C preprocessor
3087 echo "Now, how can we feed standard input to your C preprocessor..." >&4
3088 cat <<'EOT' >testcpp.c
3094 if test ! -f cppstdin; then
3095 if test "X$osname" = "Xaix" -a "X$gccversion" = X; then
3096 # AIX cc -E doesn't show the absolute headerfile
3097 # locations but we'll cheat by using the -M flag.
3098 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
3100 echo 'cat >.$$.c; '"$cc"' -E ${1+"$@"} .$$.c; rm .$$.c' >cppstdin
3103 echo "Keeping your $hint cppstdin wrapper."
3106 wrapper=`pwd`/cppstdin
3110 if $test "X$cppstdin" != "X" && \
3111 $cppstdin $cppminus <testcpp.c >testcpp.out 2>&1 && \
3112 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
3114 echo "You used to use $cppstdin $cppminus so we'll use that again."
3116 '') echo "But let's see if we can live without a wrapper..." ;;
3118 if $cpprun $cpplast <testcpp.c >testcpp.out 2>&1 && \
3119 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
3121 echo "(And we'll use $cpprun $cpplast to preprocess directly.)"
3124 echo "(However, $cpprun $cpplast does not work, let's see...)"
3132 echo "Good old $cppstdin $cppminus does not seem to be of any help..."
3139 elif echo 'Maybe "'"$cc"' -E" will work...'; \
3140 $cc -E <testcpp.c >testcpp.out 2>&1; \
3141 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3142 echo "Yup, it does."
3145 elif echo 'Nope...maybe "'"$cc"' -E -" will work...'; \
3146 $cc -E - <testcpp.c >testcpp.out 2>&1; \
3147 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3148 echo "Yup, it does."
3151 elif echo 'Nope...maybe "'"$cc"' -P" will work...'; \
3152 $cc -P <testcpp.c >testcpp.out 2>&1; \
3153 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3154 echo "Yipee, that works!"
3157 elif echo 'Nope...maybe "'"$cc"' -P -" will work...'; \
3158 $cc -P - <testcpp.c >testcpp.out 2>&1; \
3159 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3160 echo "At long last!"
3163 elif echo 'No such luck, maybe "'$cpp'" will work...'; \
3164 $cpp <testcpp.c >testcpp.out 2>&1; \
3165 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3169 elif echo 'Nixed again...maybe "'$cpp' -" will work...'; \
3170 $cpp - <testcpp.c >testcpp.out 2>&1; \
3171 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3172 echo "Hooray, it works! I was beginning to wonder."
3175 elif echo 'Uh-uh. Time to get fancy. Trying a wrapper...'; \
3176 $wrapper <testcpp.c >testcpp.out 2>&1; \
3177 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3183 rp="No dice. I can't find a C preprocessor. Name one:"
3187 $x_cpp <testcpp.c >testcpp.out 2>&1
3188 if $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3189 echo "OK, that will do." >&4
3191 echo "Sorry, I can't get that to work. Go find one and rerun Configure." >&4
3206 echo "Perhaps can we force $cc -E using a wrapper..."
3207 if $wrapper <testcpp.c >testcpp.out 2>&1; \
3208 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
3214 echo "Nope, we'll have to live without it..."
3228 "$wrapper"|'cppstdin') ;;
3229 *) $rm -f $wrapper;;
3231 $rm -f testcpp.c testcpp.out
3233 : decide how portable to be. Allow command line overrides.
3234 case "$d_portable" in
3236 *) d_portable="$define" ;;
3239 : set up shell script to do ~ expansion
3245 echo \$1 | $sed "s|~|\${HOME-\$LOGDIR}|"
3248 if $test -f /bin/csh; then
3249 /bin/csh -f -c "glob \$1"
3254 name=\`$expr x\$1 : '..\([^/]*\)'\`
3255 dir=\`$sed -n -e "/^\${name}:/{s/^[^:]*:[^:]*:[^:]*:[^:]*:[^:]*:\([^:]*\).*"'\$'"/\1/" -e p -e q -e '}' </etc/passwd\`
3256 if $test ! -d "\$dir"; then
3258 echo "\$me: can't locate home directory for: \$name" >&2
3263 echo \$dir/\`$expr x\$1 : '..[^/]*/\(.*\)'\`
3279 : now set up to get a file name
3283 cat <<'EOSC' >>getfile
3299 expr $fn : '.*(\(.*\)).*' | $tr ',' $trnl >getfile.ok
3300 fn=`echo $fn | sed 's/(.*)//'`
3306 loc_file=`expr $fn : '.*:\(.*\)'`
3307 fn=`expr $fn : '\(.*\):.*'`
3315 */*) fullpath=true;;
3324 *e*) exp_file=true;;
3327 *p*) nopath_ok=true;;
3332 *d*) type='Directory';;
3333 *l*) type='Locate';;
3338 Locate) what='File';;
3343 case "$d_portable" in
3351 while test "$type"; do
3356 true) rp="$rp (~name ok)";;
3359 if test -f UU/getfile.ok && \
3360 $contains "^$ans\$" UU/getfile.ok >/dev/null 2>&1
3379 value=`UU/filexp $ans`
3382 if test "$ans" != "$value"; then
3383 echo "(That expands to $value on this system.)"
3397 /*) value="$ansexp" ;;
3398 [a-zA-Z]:/*) value="$ansexp" ;;
3403 echo "I shall only accept a full path name, as in /bin/ls." >&4
3404 echo "Use a ! shell escape if you wish to check pathnames." >&4
3407 echo "Please give a full path name, starting with slash." >&4
3410 echo "Note that using ~name is ok provided it expands well." >&4
3423 for fp in $gfpth; do
3424 if test "X$fp" = X.; then
3429 if test -f "$pf"; then
3431 elif test -r "$pf" || (test -h "$pf") >/dev/null 2>&1
3433 echo "($value is not a plain file, but that's ok.)"
3436 if test X"$type" = X; then
3443 for fp in $gfpth; do
3444 if test "X$fp" = X.; then
3449 direxp="$fp/$ansexp"
3451 if test -d "$direxp"; then
3459 if test -d "$ansexp"; then
3460 echo "(Looking for $loc_file in directory $value.)"
3461 value="$value/$loc_file"
3462 ansexp="$ansexp/$loc_file"
3464 if test -f "$ansexp"; then
3467 case "$nopath_ok" in
3468 true) case "$value" in
3470 *) echo "Assuming $value will be in people's path."
3486 if test "$fastread" = yes; then
3491 rp="$what $value doesn't exist. Use that name anyway?"
3510 test "X$gfpthkeep" != Xy && gfpth=""
3513 : What should the include directory be ?
3515 $echo $n "Hmm... $c"
3519 if $test -f /bin/mips && /bin/mips; then
3520 echo "Looks like a MIPS system..."
3521 $cat >usr.c <<'EOCP'
3522 #ifdef SYSTYPE_BSD43
3526 if cc -E usr.c > usr.out && $contains / usr.out >/dev/null 2>&1; then
3527 dflt='/bsd43/usr/include'
3531 mips_type='System V'
3533 $rm -f usr.c usr.out
3534 echo "and you're compiling with the $mips_type compiler and libraries."
3538 echo "Doesn't look like a MIPS system."
3548 case "$xxx_prompt" in
3551 rp='Where are the include files you want to use?'
3559 : Set private lib path
3562 plibpth="$incpath/usr/lib /usr/local/lib /usr/ccs/lib"
3567 '') dlist="$loclibpth $plibpth $glibpth";;
3568 *) dlist="$libpth";;
3571 : Now check and see which directories actually exist, avoiding duplicates
3575 if $test -d $xxx; then
3578 *) libpth="$libpth $xxx";;
3584 Some systems have incompatible or broken versions of libraries. Among
3585 the directories listed in the question below, please remove any you
3586 know not to be holding relevant libraries, and add any that are needed.
3587 Say "none" for none.
3598 rp="Directories to use for library searches?"
3605 : compute shared library extension
3608 if xxx=`./loc libc.sl X $libpth`; $test -f "$xxx"; then
3618 On some systems, shared libraries may be available. Answer 'none' if
3619 you want to suppress searching of shared libraries for the remainder
3620 of this configuration.
3623 rp='What is the file extension used for shared libraries?'
3627 : Define several unixisms.
3628 : Hints files or command line option can be used to override them.
3629 : The convoluted testing is in case hints files set either the old
3632 '') case "$exe_ext" in
3634 *) _exe="$exe_ext" ;;
3639 '') case "$lib_ext" in
3646 '') case "$obj_ext" in
3653 '') case "$path_sep" in
3664 : Which makefile gets called first. This is used by make depend.
3665 case "$firstmakefile" in
3666 '') firstmakefile='makefile';;
3670 $define|true|[yY]*) dflt='y';;
3675 Perl can be built to use the SOCKS proxy protocol library. To do so,
3676 Configure must be run with -Dusesocks. If you use SOCKS you also need
3677 to use the PerlIO abstraction layer, this will be implicitly selected.
3679 If this doesn't make any sense to you, just accept the default '$dflt'.
3681 rp='Build Perl for SOCKS?'
3684 y|Y) val="$define" ;;
3691 $define|true|[yY]*) useperlio="$define";;
3694 : Looking for optional libraries
3696 echo "Checking for optional libraries..." >&4
3701 case "$libswanted" in
3702 '') libswanted='c_s';;
3705 "$define") libswanted="$libswanted socks5 socks5_sh" ;;
3711 for thisdir in $libpth $xlibpth; do
3712 test -d $thisdir && libspath="$libspath $thisdir"
3714 for thislib in $libswanted; do
3715 for thisdir in $libspath; do
3717 if $test ! -f "$xxx" -a "X$ignore_versioned_solibs" = "X"; then
3718 xxx=`ls $thisdir/lib$thislib.$so.[0-9] 2>/dev/null|tail -1`
3719 $test -f "$xxx" && eval $libscheck
3720 $test -f "$xxx" && libstyle=shared
3722 if test ! -f "$xxx"; then
3723 xxx=$thisdir/lib$thislib.$so
3724 $test -f "$xxx" && eval $libscheck
3725 $test -f "$xxx" && libstyle=shared
3727 if test ! -f "$xxx"; then
3728 xxx=$thisdir/lib$thislib$_a
3729 $test -f "$xxx" && eval $libscheck
3730 $test -f "$xxx" && libstyle=static
3732 if test ! -f "$xxx"; then
3733 xxx=$thisdir/$thislib$_a
3734 $test -f "$xxx" && eval $libscheck
3735 $test -f "$xxx" && libstyle=static
3737 if test ! -f "$xxx"; then
3738 xxx=$thisdir/lib${thislib}_s$_a
3739 $test -f "$xxx" && eval $libscheck
3740 $test -f "$xxx" && libstyle=static
3741 $test -f "$xxx" && thislib=${thislib}_s
3743 if test ! -f "$xxx"; then
3744 xxx=$thisdir/Slib$thislib$_a
3745 $test -f "$xxx" && eval $libscheck
3746 $test -f "$xxx" && libstyle=static
3748 if $test -f "$xxx"; then
3750 shared) echo "Found -l$thislib (shared)." ;;
3751 static) echo "Found -l$thislib." ;;
3752 *) echo "Found -l$thislib ($libstyle)." ;;
3756 *) dflt="$dflt -l$thislib"
3757 libsfound="$libsfound $xxx"
3759 libsfiles="$libsfiles $yyy"
3760 yyy=`echo $xxx|$sed -e "s%/$yyy\\$%%"`
3761 case " $libsdirs " in
3763 *) libsdirs="$libsdirs $yyy" ;;
3770 if $test ! -f "$xxx"; then
3771 echo "No -l$thislib."
3782 ' '|'') dflt='none';;
3787 In order to compile $package on your machine, a number of libraries
3788 are usually needed. Include any other special libraries here as well.
3789 Say "none" for none. The default list is almost always right.
3793 rp="What libraries to use?"
3800 : determine optimization, if desired, or use for debug flag also
3802 ' '|$undef) dflt='none';;
3804 *) dflt="$optimize";;
3808 By default, $package compiles with the -O flag to use the optimizer.
3809 Alternately, you might want to use the symbolic debugger, which uses
3810 the -g flag (on traditional Unix systems). Either flag can be
3811 specified here. To use neither flag, specify the word "none".
3814 rp="What optimizer/debugger flag should be used?"
3818 'none') optimize=" ";;
3822 : We will not override a previous value, but we might want to
3823 : augment a hint file
3825 default|recommended)
3826 case "$gccversion" in
3827 1*) dflt='-fpcc-struct-return' ;;
3830 *-g*) dflt="$dflt -DDEBUGGING";;
3832 case "$gccversion" in
3833 2*) if test -d /etc/conf/kconfig.d &&
3834 $contains _POSIX_VERSION $usrinc/sys/unistd.h >/dev/null 2>&1
3840 case "$gccversion" in
3844 echo "Checking if your compiler accepts -fno-strict-aliasing" 2>&1
3845 echo 'int main(void) { return 0; }' > gcctest.c
3846 if $cc -O2 -fno-strict-aliasing -o gcctest gcctest.c; then
3847 echo "Yes, it does." 2>&1
3850 echo "Leaving current flags $ccflags alone." 2>&1
3852 *) dflt="$dflt -fno-strict-aliasing" ;;
3855 echo "Nope, it doesn't, but that's ok." 2>&1
3862 case "$mips_type" in
3863 *BSD*|'') inclwanted="$locincpth $usrinc";;
3864 *) inclwanted="$locincpth $inclwanted $usrinc/bsd";;
3866 for thisincl in $inclwanted; do
3867 if $test -d $thisincl; then
3868 if $test x$thisincl != x$usrinc; then
3870 *" -I$thisincl "*);;
3871 *) dflt="$dflt -I$thisincl ";;
3877 inctest='if $contains $2 $usrinc/$1 >/dev/null 2>&1; then
3879 elif $contains $2 $usrinc/sys/$1 >/dev/null 2>&1; then
3887 *) dflt="$dflt -D$2";;
3891 set signal.h LANGUAGE_C; eval $inctest
3895 ccflags="$ccflags -DSOCKS"
3900 default|recommended) dflt="$ccflags $dflt" ;;
3901 *) dflt="$ccflags";;
3910 Your C compiler may want other flags. For this question you should include
3911 -I/whatever and -DWHATEVER flags and any other flags used by the C compiler,
3912 but you should NOT include libraries or ld flags like -lwhatever. If you
3913 want $package to honor its debug switch, you should include -DDEBUGGING here.
3914 Your C compiler might also need additional flags, such as -D_POSIX_SOURCE.
3916 To use no flags, specify the word "none".
3922 rp="Any additional cc flags?"
3929 : the following weeds options from ccflags that are of no interest to cpp
3931 case "$gccversion" in
3932 1*) cppflags="$cppflags -D__GNUC__"
3934 case "$mips_type" in
3936 *BSD*) cppflags="$cppflags -DSYSTYPE_BSD43";;
3942 echo "Let me guess what the preprocessor flags are..." >&4
3956 *) ftry="$previous $flag";;
3958 if $cppstdin -DLFRULB=bar $cppflags $ftry $cppminus <cpp.c \
3959 >cpp1.out 2>/dev/null && \
3960 $cpprun -DLFRULB=bar $cppflags $ftry $cpplast <cpp.c \
3961 >cpp2.out 2>/dev/null && \
3962 $contains 'foo.*xx.*bar' cpp1.out >/dev/null 2>&1 && \
3963 $contains 'foo.*xx.*bar' cpp2.out >/dev/null 2>&1
3965 cppflags="$cppflags $ftry"
3975 *-*) echo "They appear to be: $cppflags";;
3977 $rm -f cpp.c cpp?.out
3981 : flags used in final linking phase
3983 '') if ./venix; then
3989 *-posix*) dflt="$dflt -posix" ;;
3992 *) dflt="$ldflags";;
3995 : Try to guess additional flags to pick up local libraries.
3996 for thislibdir in $libpth; do
3997 case " $loclibpth " in
4000 *"-L$thislibdir "*) ;;
4001 *) dflt="$dflt -L$thislibdir" ;;
4013 Your C linker may need flags. For this question you should
4014 include -L/whatever and any other flags used by the C linker, but you
4015 should NOT include libraries like -lwhatever.
4017 Make sure you include the appropriate -L/path flags if your C linker
4018 does not normally search all of the directories you specified above,
4021 To use no flags, specify the word "none".
4025 rp="Any additional ld flags (NOT including libraries)?"
4031 rmlist="$rmlist pdp11"
4035 echo "Checking your choice of C compiler and flags for coherency..." >&4
4036 $cat > try.c <<'EOF'
4038 int main() { printf("Ok\n"); exit(0); }
4040 set X $cc -o try $optimize $ccflags $ldflags try.c $libs
4042 $cat >try.msg <<'EOM'
4043 I've tried to compile and run the following simple program:
4046 $cat try.c >> try.msg
4048 $cat >> try.msg <<EOM
4055 and I got the following output:
4059 if sh -c "$cc -o try $optimize $ccflags $ldflags try.c $libs" >>try.msg 2>&1; then
4060 if sh -c './try' >>try.msg 2>&1; then
4064 *) echo 'The program compiled OK, but produced no output.' >> try.msg
4067 cat >> try.msg <<'EOQS'
4068 If $libs contains -lsfio, and sfio is mis-configured, then it
4069 sometimes (apparently) runs and exits with a 0 status, but with no
4070 output! It may have to do with sfio's use of _exit vs. exit.
4073 rp="You have a big problem. Shall I abort Configure"
4080 echo "The program compiled OK, but exited with status $?." >>try.msg
4081 rp="You have a problem. Shall I abort Configure"
4085 echo "I can't compile the test program." >>try.msg
4086 rp="You have a BIG problem. Shall I abort Configure"
4092 case "$knowitall" in
4094 echo "(The supplied flags or libraries might be incorrect.)"
4102 *) echo "Ok. Stopping Configure." >&4
4107 n) echo "OK, that should do.";;
4109 $rm -f try try.* core
4111 : define an is-a-typedef? function
4112 typedef='type=$1; var=$2; def=$3; shift; shift; shift; inclist=$@;
4114 "") inclist="sys/types.h";;
4116 eval "varval=\$$var";
4120 for inc in $inclist; do
4121 echo "#include <$inc>" >>temp.c;
4123 echo "#ifdef $type" >> temp.c;
4124 echo "printf(\"We have $type\");" >> temp.c;
4125 echo "#endif" >> temp.c;
4126 $cppstdin $cppflags $cppminus < temp.c >temp.E 2>/dev/null;
4127 if $contains $type temp.E >/dev/null 2>&1; then
4133 *) eval "$var=\$varval";;
4136 : define an is-a-typedef? function that prompts if the type is not available.
4137 typedef_ask='type=$1; var=$2; def=$3; shift; shift; shift; inclist=$@;
4139 "") inclist="sys/types.h";;
4141 eval "varval=\$$var";
4145 for inc in $inclist; do
4146 echo "#include <$inc>" >>temp.c;
4148 echo "#ifdef $type" >> temp.c;
4149 echo "printf(\"We have $type\");" >> temp.c;
4150 echo "#endif" >> temp.c;
4151 $cppstdin $cppflags $cppminus < temp.c >temp.E 2>/dev/null;
4153 echo "$rp" | $sed -e "s/What is/Looking for/" -e "s/?/./";
4154 if $contains $type temp.E >/dev/null 2>&1; then
4155 echo "$type found." >&4;
4158 echo "$type NOT found." >&4;
4164 *) eval "$var=\$varval";;
4167 : define a shorthand compile call
4171 $cc -o ${mc_file} $optimize $ccflags $ldflags $* ${mc_file}.c $libs > /dev/null 2>&1;'
4172 : define a shorthand compile call for compilations that should be ok.
4176 $cc -o ${mc_file} $optimize $ccflags $ldflags $* ${mc_file}.c $libs;'
4178 : check for lengths of integral types
4182 echo "Checking to see how big your integers are..." >&4
4183 $cat >intsize.c <<'EOCP'
4187 printf("intsize=%d;\n", (int)sizeof(int));
4188 printf("longsize=%d;\n", (int)sizeof(long));
4189 printf("shortsize=%d;\n", (int)sizeof(short));
4194 if eval $compile_ok && ./intsize > /dev/null; then
4196 echo "Your integers are $intsize bytes long."
4197 echo "Your long integers are $longsize bytes long."
4198 echo "Your short integers are $shortsize bytes long."
4202 Help! I can't compile and run the intsize test program: please enlighten me!
4203 (This is probably a misconfiguration in your system or libraries, and
4204 you really ought to fix it. Still, I'll try anyway.)
4208 rp="What is the size of an integer (in bytes)?"
4212 rp="What is the size of a long integer (in bytes)?"
4216 rp="What is the size of a short integer (in bytes)?"
4222 $rm -f intsize intsize.*
4224 : see what type lseek is declared as in the kernel
4225 rp="What is the type used for lseek's offset on this system?"
4226 set off_t lseektype long stdio.h sys/types.h
4230 echo "Checking to see how big your file offsets are..." >&4
4232 #include <sys/types.h>
4236 printf("%d\n", (int)sizeof($lseektype));
4241 if eval $compile_ok; then
4243 echo "Your file offsets are $lseeksize bytes long."
4247 echo "(I can't seem to compile the test program. Guessing...)"
4248 rp="What is the size of your file offsets (in bytes)?"
4254 : see what type file positions are declared as in the library
4255 rp="What is the type for file position used by fsetpos()?"
4256 set fpos_t fpostype long stdio.h sys/types.h
4261 *_t) zzz="$fpostype" ;;
4264 echo "Checking the size of $zzz..." >&4
4266 #include <sys/types.h>
4269 printf("%d\n", (int)sizeof($fpostype));
4274 if eval $compile_ok; then
4278 echo "(I can't execute the test program--guessing $fpossize.)" >&4
4281 echo "Your $zzz is $fpossize bytes long."
4287 echo "(I can't compile the test program. Guessing...)" >&4
4288 rp="What is the size of your file positions (in bytes)?"
4295 # Backward compatibility (uselfs is deprecated).
4297 "$define"|true|[yY]*)
4300 *** Configure -Duselfs is deprecated, using -Duselargefiles instead.
4302 uselargefiles="$define"
4306 case "$lseeksize:$fpossize" in
4309 You can have files larger than 2 gigabytes.
4312 *) case "$uselargefiles" in
4313 "$undef"|false|[nN]*) dflt='n' ;;
4318 Perl can be built to understand large files (files larger than 2 gigabytes)
4319 on some systems. To do so, Configure can be run with -Duselargefiles.
4321 If this doesn't make any sense to you, just accept the default '$dflt'.
4323 rp='Try to understand large files, if available?'
4326 y|Y) val="$define" ;;
4333 case "$uselargefiles" in
4335 : Look for a hint-file generated 'call-back-unit'. If the
4336 : user has specified that a large files perl is to be built,
4337 : we may need to set or change some other defaults.
4338 if $test -f uselargefiles.cbu; then
4339 echo "Your platform has some specific hints for large file builds, using them..."
4340 . ./uselargefiles.cbu
4342 echo "Rechecking to see how big your file offsets are..." >&4
4344 #include <sys/types.h>
4348 printf("%d\n", (int)sizeof($lseektype));
4353 if eval $compile_ok; then
4355 $echo "Your file offsets are now $lseeksize bytes long."
4359 echo "(I can't seem to compile the test program. Guessing...)"
4360 rp="What is the size of your file offsets (in bytes)?"
4365 *_t) zzz="$fpostype" ;;
4368 $echo $n "Rechecking the size of $zzz...$c" >&4
4370 #include <sys/types.h>
4373 printf("%d\n", (int)sizeof($fpostype));
4378 if eval $compile_ok; then
4383 echo "(I can't execute the test program--guessing $fpossize.)" >&4
4386 echo " $fpossize bytes." >&4
4392 echo "(I can't compile the test program. Guessing...)" >&4
4393 rp="What is the size of your file positions (in bytes)?"
4403 case "$usemorebits" in
4404 "$define"|true|[yY]*)
4405 use64bitint="$define"
4406 uselongdouble="$define"
4407 usemorebits="$define"
4409 *) usemorebits="$undef"
4414 case "$uselonglong" in
4415 "$define"|true|[yY]*)
4418 *** Configure -Duselonglong is deprecated, using -Duse64bitint instead.
4420 use64bitint="$define"
4423 case "$use64bits" in
4424 "$define"|true|[yY]*)
4427 *** Configure -Duse64bits is deprecated, using -Duse64bitint instead.
4429 use64bitint="$define"
4432 case "$use64bitints" in
4433 "$define"|true|[yY]*)
4436 *** There is no Configure -Duse64bitints, using -Duse64bitint instead.
4438 use64bitint="$define"
4441 case "$use64bitsint" in
4442 "$define"|true|[yY]*)
4445 *** There is no Configure -Duse64bitsint, using -Duse64bitint instead.
4447 use64bitint="$define"
4450 case "$uselonglongs" in
4451 "$define"|true|[yY]*)
4454 *** There is no Configure -Duselonglongs, using -Duse64bitint instead.
4456 use64bitint="$define"
4459 case "$use64bitsall" in
4460 "$define"|true|[yY]*)
4463 *** There is no Configure -Duse64bitsall, using -Duse64bitall instead.
4465 use64bitall="$define"
4470 *-DUSE_LONG_LONG*|*-DUSE_64_BIT_INT*|*-DUSE_64_BIT_ALL*) use64bitint="$define";;
4472 case "$use64bitall" in
4473 "$define"|true|[yY]*) use64bitint="$define" ;;
4479 You have natively 64-bit long integers.
4483 *) case "$use64bitint" in
4484 "$define"|true|[yY]*) dflt='y';;
4489 Perl can be built to take advantage of 64-bit integer types
4490 on some systems. To do so, Configure can be run with -Duse64bitint.
4491 Choosing this option will most probably introduce binary incompatibilities.
4493 If this doesn't make any sense to you, just accept the default '$dflt'.
4495 rp='Try to use 64-bit integers, if available?'
4498 [yY]*) val="$define" ;;
4506 case "$use64bitall" in
4507 "$define"|true|[yY]*) dflt='y' ;;
4508 *) case "$longsize" in
4516 You may also choose to try maximal 64-bitness. It means using as much
4517 64-bitness as possible on the platform. This in turn means even more
4518 binary incompatibilities. On the other hand, your platform may not
4519 have any more 64-bitness available than what you already have chosen.
4521 If this doesn't make any sense to you, just accept the default '$dflt'.
4523 rp='Try to use maximal 64-bit support, if available?'
4526 [yY]*) val="$define" ;;
4531 case "$use64bitall" in
4533 case "$use64bitint" in
4537 Since you have chosen a maximally 64-bit build, I'm also turning on
4538 the use of 64-bit integers.
4540 use64bitint="$define" ;;
4545 case "$use64bitint" in
4546 "$define"|true|[yY]*)
4547 : Look for a hint-file generated 'call-back-unit'. If the
4548 : user has specified that a 64-bit perl is to be built,
4549 : we may need to set or change some other defaults.
4550 if $test -f use64bitint.cbu; then
4551 echo "Your platform has some specific hints for 64-bit integers, using them..."
4555 4) case "$archname64" in
4556 '') archname64=64int ;;
4563 case "$use64bitall" in
4564 "$define"|true|[yY]*)
4565 : Look for a hint-file generated 'call-back-unit'. If the
4566 : user has specified that a maximally 64-bit perl is to be built,
4567 : we may need to set or change some other defaults.
4568 if $test -f use64bitall.cbu; then
4569 echo "Your platform has some specific hints for 64-bit builds, using them..."
4573 4) case "$archname64" in
4574 ''|64int) archname64=64all ;;
4582 echo "Checking for GNU C Library..." >&4
4583 cat >gnulibc.c <<EOM
4595 if eval $compile_ok && ./gnulibc; then
4597 echo "You are using the GNU C Library"
4600 echo "You are not using the GNU C Library"
4606 : see if nm is to be used to determine whether a symbol is defined or not
4610 case "$d_gnulibc" in
4613 echo "nm probably won't work on the GNU C Library." >&4
4619 if $test "$osname" = aix -a ! -f /lib/syscalls.exp; then
4621 echo "Whoops! This is an AIX system without /lib/syscalls.exp!" >&4
4622 echo "'nm' won't be sufficient on this sytem." >&4
4628 '') dflt=`$egrep 'inlibc|csym' $rsrc/Configure | wc -l 2>/dev/null`
4629 if $test $dflt -gt 20; then
4639 true|$define) dflt=y;;
4646 I can use $nm to extract the symbols from your C libraries. This
4647 is a time consuming task which may generate huge output on the disk (up
4648 to 3 megabytes) but that should make the symbols extraction faster. The
4649 alternative is to skip the 'nm' extraction part and to compile a small
4650 test program instead to determine whether each symbol is present. If
4651 you have a fast C compiler and/or if your 'nm' output cannot be parsed,
4652 this may be the best solution.
4654 You probably shouldn't let me use 'nm' if you are using the GNU C Library.
4657 rp="Shall I use $nm to extract C symbols from the libraries?"
4660 [Nn]*) usenm=false;;
4669 : nm options which may be necessary
4671 '') if $test -f /mach_boot; then
4673 elif $test -d /usr/ccs/lib; then
4674 nm_opt='-p' # Solaris (and SunOS?)
4675 elif $test -f /dgux; then
4677 elif $test -f /lib64/rld; then
4678 nm_opt='-p' # 64-bit Irix
4684 : nm options which may be necessary for shared libraries but illegal
4685 : for archive libraries. Thank you, Linux.
4686 case "$nm_so_opt" in
4687 '') case "$myuname" in
4689 if $nm --help | $grep 'dynamic' > /dev/null 2>&1; then
4690 nm_so_opt='--dynamic'
4699 : get list of predefined functions in a handy place
4704 *-lc_s*) libc=`./loc libc_s$_a $libc $libpth`
4711 *) for thislib in $libs; do
4714 : Handle C library specially below.
4717 thislib=`echo $thislib | $sed -e 's/^-l//'`
4718 if try=`./loc lib$thislib.$so.'*' X $libpth`; $test -f "$try"; then
4720 elif try=`./loc lib$thislib.$so X $libpth`; $test -f "$try"; then
4722 elif try=`./loc lib$thislib$_a X $libpth`; $test -f "$try"; then
4724 elif try=`./loc $thislib$_a X $libpth`; $test -f "$try"; then
4726 elif try=`./loc lib$thislib X $libpth`; $test -f "$try"; then
4728 elif try=`./loc $thislib X $libpth`; $test -f "$try"; then
4730 elif try=`./loc Slib$thislib$_a X $xlibpth`; $test -f "$try"; then
4735 libnames="$libnames $try"
4737 *) libnames="$libnames $thislib" ;;
4746 for xxx in $libpth; do
4747 $test -r $1 || set $xxx/libc.$so
4748 : The messy sed command sorts on library version numbers.
4750 set `echo blurfl; echo $xxx/libc.$so.[0-9]* | \
4751 tr ' ' $trnl | egrep -v '\.[A-Za-z]*$' | $sed -e '
4753 s/[0-9][0-9]*/0000&/g
4754 s/0*\([0-9][0-9][0-9][0-9][0-9]\)/\1/g
4757 $sort | $sed -e 's/^.* //'`
4760 $test -r $1 || set /usr/ccs/lib/libc.$so
4761 $test -r $1 || set /lib/libsys_s$_a
4767 if $test -r "$1"; then
4768 echo "Your (shared) C library seems to be in $1."
4770 elif $test -r /lib/libc && $test -r /lib/clib; then
4771 echo "Your C library seems to be in both /lib/clib and /lib/libc."
4773 libc='/lib/clib /lib/libc'
4774 if $test -r /lib/syslib; then
4775 echo "(Your math library is in /lib/syslib.)"
4776 libc="$libc /lib/syslib"
4778 elif $test -r "$libc" || (test -h "$libc") >/dev/null 2>&1; then
4779 echo "Your C library seems to be in $libc, as you said before."
4780 elif $test -r $incpath/usr/lib/libc$_a; then
4781 libc=$incpath/usr/lib/libc$_a;
4782 echo "Your C library seems to be in $libc. That's fine."
4783 elif $test -r /lib/libc$_a; then
4785 echo "Your C library seems to be in $libc. You're normal."
4787 if tans=`./loc libc$_a blurfl/dyick $libpth`; $test -r "$tans"; then
4789 elif tans=`./loc libc blurfl/dyick $libpth`; $test -r "$tans"; then
4790 libnames="$libnames "`./loc clib blurfl/dyick $libpth`
4791 elif tans=`./loc clib blurfl/dyick $libpth`; $test -r "$tans"; then
4793 elif tans=`./loc Slibc$_a blurfl/dyick $xlibpth`; $test -r "$tans"; then
4795 elif tans=`./loc Mlibc$_a blurfl/dyick $xlibpth`; $test -r "$tans"; then
4798 tans=`./loc Llibc$_a blurfl/dyick $xlibpth`
4800 if $test -r "$tans"; then
4801 echo "Your C library seems to be in $tans, of all places."
4807 if $test $xxx = apollo -o -r "$libc" || (test -h "$libc") >/dev/null 2>&1; then
4811 If the guess above is wrong (which it might be if you're using a strange
4812 compiler, or your machine supports multiple models), you can override it here.
4817 echo $libpth | $tr ' ' $trnl | $sort | $uniq > libpath
4819 I can't seem to find your C library. I've looked in the following places:
4822 $sed 's/^/ /' libpath
4825 None of these seems to contain your C library. I need to get its name...
4830 rp='Where is your C library?'
4835 echo $libc $libnames | $tr ' ' $trnl | $sort | $uniq > libnames
4836 set X `cat libnames`
4839 case $# in 1) xxx=file; esac
4840 echo "Extracting names from the following $xxx for later perusal:" >&4
4842 $sed 's/^/ /' libnames >&4
4844 $echo $n "This may take a while...$c" >&4
4848 *$so*) $nm $nm_so_opt $nm_opt $file 2>/dev/null;;
4849 *) $nm $nm_opt $file 2>/dev/null;;
4854 $grep fprintf libc.tmp > libc.ptf
4855 xscan='eval "<libc.ptf $com >libc.list"; $echo $n ".$c" >&4'
4856 xrun='eval "<libc.tmp $com >libc.list"; echo "done" >&4'
4858 if com="$sed -n -e 's/__IO//' -e 's/^.* $xxx *_[_.]*//p' -e 's/^.* $xxx *//p'";\
4860 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
4862 elif com="$sed -n -e 's/^__*//' -e 's/^\([a-zA-Z_0-9$]*\).*xtern.*/\1/p'";\
4864 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
4866 elif com="$sed -n -e '/|UNDEF/d' -e '/FUNC..GL/s/^.*|__*//p'";\
4868 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
4870 elif com="$sed -n -e 's/^.* D __*//p' -e 's/^.* D //p'";\
4872 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
4874 elif com="$sed -n -e 's/^_//' -e 's/^\([a-zA-Z_0-9]*\).*xtern.*text.*/\1/p'";\
4876 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
4878 elif com="$sed -n -e 's/^.*|FUNC |GLOB .*|//p'";\
4880 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
4882 elif com="$grep '|' | $sed -n -e '/|COMMON/d' -e '/|DATA/d' \
4883 -e '/ file/d' -e 's/^\([^ ]*\).*/\1/p'";\
4885 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
4887 elif com="$sed -n -e 's/^.*|FUNC |GLOB .*|//p' -e 's/^.*|FUNC |WEAK .*|//p'";\
4889 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
4891 elif com="$sed -n -e 's/^__//' -e '/|Undef/d' -e '/|Proc/s/ .*//p'";\
4893 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
4895 elif com="$sed -n -e 's/^.*|Proc .*|Text *| *//p'";\
4897 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
4899 elif com="$sed -n -e '/Def. Text/s/.* \([^ ]*\)\$/\1/p'";\
4901 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
4903 elif com="$sed -n -e 's/^[-0-9a-f ]*_\(.*\)=.*/\1/p'";\
4905 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
4907 elif com="$sed -n -e 's/.*\.text n\ \ \ \.//p'";\
4909 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
4911 elif com="sed -n -e 's/^__.*//' -e 's/[ ]*D[ ]*[0-9]*.*//p'";\
4913 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
4916 $nm -p $* 2>/dev/null >libc.tmp
4917 $grep fprintf libc.tmp > libc.ptf
4918 if com="$sed -n -e 's/^.* [ADTSIW] *_[_.]*//p' -e 's/^.* [ADTSIW] //p'";\
4919 eval $xscan; $contains '^fprintf$' libc.list >/dev/null 2>&1
4925 echo "$nm didn't seem to work right. Trying $ar instead..." >&4
4927 if $ar t $libc > libc.tmp && $contains '^fprintf$' libc.tmp >/dev/null 2>&1; then
4928 for thisname in $libnames $libc; do
4929 $ar t $thisname >>libc.tmp
4931 $sed -e "s/\\$_o\$//" < libc.tmp > libc.list
4933 elif test "X$osname" = "Xos2" && $ar tv $libc > libc.tmp; then
4934 # Repeat libc to extract forwarders to DLL entries too
4935 for thisname in $libnames $libc; do
4936 $ar tv $thisname >>libc.tmp
4937 # Revision 50 of EMX has bug in $ar.
4938 # it will not extract forwarders to DLL entries
4939 # Use emximp which will extract exactly them.
4940 emximp -o tmp.imp $thisname \
4942 $sed -e 's/^\([_a-zA-Z0-9]*\) .*$/\1/p' \
4943 < tmp.imp >>libc.tmp
4946 $sed -e "s/\\$_o\$//" -e 's/^ \+//' < libc.tmp > libc.list
4949 echo "$ar didn't seem to work right." >&4
4950 echo "Maybe this is a Cray...trying bld instead..." >&4
4951 if bld t $libc | $sed -e 's/.*\///' -e "s/\\$_o:.*\$//" > libc.list
4953 for thisname in $libnames; do
4955 $sed -e 's/.*\///' -e "s/\\$_o:.*\$//" >>libc.list
4956 $ar t $thisname >>libc.tmp
4960 echo "That didn't work either. Giving up." >&4
4967 if $test -f /lib/syscalls.exp; then
4969 echo "Also extracting names from /lib/syscalls.exp for good ole AIX..." >&4
4970 $sed -n 's/^\([^ ]*\)[ ]*syscall[0-9]*$/\1/p' /lib/syscalls.exp >>libc.list
4974 $rm -f libnames libpath
4976 : is a C symbol defined?
4979 -v) tf=libc.tmp; tc=""; tdc="";;
4980 -a) tf=libc.tmp; tc="[0]"; tdc="[]";;
4981 *) tlook="^$1\$"; tf=libc.list; tc="()"; tdc="()";;
4984 case "$reuseval-$4" in
4986 true-*) tx=no; eval "tval=\$$4"; case "$tval" in "") tx=yes;; esac;;
4992 if $contains $tlook $tf >/dev/null 2>&1;
4997 echo "int main() { extern short $1$tdc; printf(\"%hd\", $1$tc); }" > t.c;
4998 if $cc -o t $optimize $ccflags $ldflags t.c $libs >/dev/null 2>&1;
5006 $define) tval=true;;
5012 : define an is-in-libc? function
5013 inlibc='echo " "; td=$define; tu=$undef;
5014 sym=$1; var=$2; eval "was=\$$2";
5016 case "$reuseval$was" in
5026 echo "$sym() found." >&4;
5027 case "$was" in $undef) . ./whoa; esac; eval "$var=\$td";;
5029 echo "$sym() NOT found." >&4;
5030 case "$was" in $define) . ./whoa; esac; eval "$var=\$tu";;
5034 $define) echo "$sym() found." >&4;;
5035 *) echo "$sym() NOT found." >&4;;
5039 : see if sqrtl exists
5044 *-DUSE_LONG_DOUBLE*|*-DUSE_MORE_BITS*) uselongdouble="$define" ;;
5047 case "$uselongdouble" in
5048 $define|true|[yY]*) dflt='y';;
5053 Perl can be built to take advantage of long doubles which
5054 (if available) may give more accuracy and range for floating point numbers.
5056 If this doesn't make any sense to you, just accept the default '$dflt'.
5058 rp='Try to use long doubles if available?'
5061 y|Y) val="$define" ;;
5067 case "$uselongdouble" in
5068 true|[yY]*) uselongdouble="$define" ;;
5071 case "$uselongdouble" in
5073 : Look for a hint-file generated 'call-back-unit'. If the
5074 : user has specified that long doubles should be used,
5075 : we may need to set or change some other defaults.
5076 if $test -f uselongdouble.cbu; then
5077 echo "Your platform has some specific hints for long doubles, using them..."
5078 . ./uselongdouble.cbu
5081 (Your platform doesn't have any specific hints for long doubles.)
5087 case "$uselongdouble:$d_sqrtl" in
5091 *** You requested the use of long doubles but you do not seem to have
5092 *** the mathematic functions for long doubles. I'm disabling the use
5093 *** of long doubles.
5096 uselongdouble=$undef
5100 : check for length of double
5102 case "$doublesize" in
5104 echo "Checking to see how big your double precision numbers are..." >&4
5105 $cat >try.c <<'EOCP'
5109 printf("%d\n", (int)sizeof(double));
5114 if eval $compile_ok; then
5116 echo "Your double is $doublesize bytes long."
5119 echo "(I can't seem to compile the test program. Guessing...)"
5120 rp="What is the size of a double precision number (in bytes)?"
5128 : check for long doubles
5130 echo "Checking to see if you have long double..." >&4
5131 echo 'int main() { long double x = 7.0; }' > try.c
5133 if eval $compile; then
5135 echo "You have long double."
5138 echo "You do not have long double."
5144 : check for length of long double
5145 case "${d_longdbl}${longdblsize}" in
5148 echo "Checking to see how big your long doubles are..." >&4
5149 $cat >try.c <<'EOCP'
5153 printf("%d\n", sizeof(long double));
5158 if eval $compile; then
5159 longdblsize=`./try$exe_ext`
5160 echo "Your long doubles are $longdblsize bytes long."
5164 echo "(I can't seem to compile the test program. Guessing...)" >&4
5165 rp="What is the size of a long double (in bytes)?"
5169 if $test "X$doublesize" = "X$longdblsize"; then
5170 echo "(That isn't any different from an ordinary double.)"
5176 : determine the architecture name
5178 if xxx=`./loc arch blurfl $pth`; $test -f "$xxx"; then
5179 tarch=`arch`"-$osname"
5180 elif xxx=`./loc uname blurfl $pth`; $test -f "$xxx" ; then
5181 if uname -m > tmparch 2>&1 ; then
5182 tarch=`$sed -e 's/ *$//' -e 's/ /_/g' \
5183 -e 's/$/'"-$osname/" tmparch`
5191 case "$myarchname" in
5194 echo "(Your architecture name used to be $myarchname.)"
5201 *) dflt="$archname";;
5203 rp='What is your architecture name'
5206 case "$usethreads" in
5208 echo "Threads selected." >&4
5210 *-thread*) echo "...and architecture name already has -thread." >&4
5212 *) archname="$archname-thread"
5213 echo "...setting architecture name to $archname." >&4
5218 case "$usemultiplicity" in
5220 echo "Multiplicity selected." >&4
5222 *-multi*) echo "...and architecture name already has -multi." >&4
5224 *) archname="$archname-multi"
5225 echo "...setting architecture name to $archname." >&4
5230 case "$use64bitint$use64bitall" in
5232 case "$archname64" in
5234 echo "This architecture is naturally 64-bit, not changing architecture name." >&4
5237 case "$use64bitint" in
5238 "$define") echo "64 bit integers selected." >&4 ;;
5240 case "$use64bitall" in
5241 "$define") echo "Maximal 64 bitness selected." >&4 ;;
5244 *-$archname64*) echo "...and architecture name already has $archname64." >&4
5246 *) archname="$archname-$archname64"
5247 echo "...setting architecture name to $archname." >&4
5253 case "$uselongdouble" in
5255 echo "Long doubles selected." >&4
5256 case "$longdblsize" in
5258 "...but long doubles are equal to doubles, not changing architecture name." >&4
5262 *-ld*) echo "...and architecture name already has -ld." >&4
5264 *) archname="$archname-ld"
5265 echo "...setting architecture name to $archname." >&4
5273 : determine root of directory hierarchy where package will be installed.
5276 dflt=`./loc . /usr/local /usr/local /local /opt /usr`
5284 By default, $package will be installed in $dflt/bin, manual pages
5285 under $dflt/man, etc..., i.e. with $dflt as prefix for all
5286 installation directories. Typically this is something like /usr/local.
5287 If you wish to have binaries under /usr/bin but other parts of the
5288 installation under /usr/local, that's ok: you will be prompted
5289 separately for each of the installation directories, the prefix being
5290 only used to set the defaults.
5294 rp='Installation prefix to use?'
5302 *) oldprefix="$prefix";;
5312 $define|true) afs=true ;;
5313 $undef|false) afs=false ;;
5314 *) if test -d /afs; then
5322 echo "AFS may be running... I'll be extra cautious then..." >&4
5324 echo "AFS does not seem to be running..." >&4
5327 : determine installation prefix for where package is to be installed.
5331 Since you are running AFS, I need to distinguish the directory in which
5332 files will reside from the directory in which they are installed (and from
5333 which they are presumably copied to the former directory by occult means).
5336 case "$installprefix" in
5337 '') dflt=`echo $prefix | sed 's#^/afs/#/afs/.#'`;;
5338 *) dflt="$installprefix";;
5343 In some special cases, particularly when building $package for distribution,
5344 it is convenient to distinguish between the directory in which files should
5345 be installed from the directory ($prefix) in which they
5346 will eventually reside. For most users, these two directories are the same.
5349 case "$installprefix" in
5351 *) dflt=$installprefix;;
5355 rp='What installation prefix should I use for installing files?'
5357 installprefix="$ans"
5358 installprefixexp="$ansexp"
5360 : set the prefixit variable, to compute a suitable default value
5361 prefixit='case "$3" in
5363 case "$oldprefix" in
5364 "") eval "$1=\"\$$2\"";;
5371 ""|" ") eval "$1=\"\$$2\"";;
5377 eval "tp=\"$oldprefix-\$$2-\""; eval "tp=\"$tp\"";
5379 --|/*--|\~*--) eval "$1=\"$prefix/$3\"";;
5380 /*-$oldprefix/*|\~*-$oldprefix/*)
5381 eval "$1=\`echo \$$2 | sed \"s,^$oldprefix,$prefix,\"\`";;
5382 *) eval "$1=\"\$$2\"";;
5387 : get the patchlevel
5389 echo "Getting the current patchlevel..." >&4
5390 if $test -r $rsrc/patchlevel.h;then
5391 revision=`awk '/define[ ]+PERL_REVISION/ {print $3}' $rsrc/patchlevel.h`
5392 patchlevel=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
5393 subversion=`awk '/define[ ]+PERL_SUBVERSION/ {print $3}' $rsrc/patchlevel.h`
5394 api_revision=`awk '/define[ ]+PERL_API_REVISION/ {print $3}' $rsrc/patchlevel.h`
5395 api_version=`awk '/define[ ]+PERL_API_VERSION/ {print $3}' $rsrc/patchlevel.h`
5396 api_subversion=`awk '/define[ ]+PERL_API_SUBVERSION/ {print $3}' $rsrc/patchlevel.h`
5405 $echo "(You have $package version $patchlevel subversion $subversion.)"
5408 : XXX Should be a Configure test for double-dots in filenames.
5409 version=`echo $revision $patchlevel $subversion | \
5410 $awk '{ printf "%d_%d_%d\n", $1, $2, $3 }'`
5411 api_versionstring=`echo $api_revision $api_version $api_subversion | \
5412 $awk '{ printf "%d_%d_%d\n", $1, $2, $3 }'`
5415 version=`echo $revision $patchlevel $subversion | \
5416 $awk '{ printf "%d.%d.%d\n", $1, $2, $3 }'`
5417 api_versionstring=`echo $api_revision $api_version $api_subversion | \
5418 $awk '{ printf "%d.%d.%d\n", $1, $2, $3 }'`
5421 : Special case the 5.005_xx maintenance series, which used 5.005
5422 : without any subversion label as a subdirectory in $sitelib
5423 if test "${api_revision}${api_version}${api_subversion}" = "550"; then
5424 api_versionstring='5.005'
5427 : determine installation style
5428 : For now, try to deduce it from prefix unless it is already set.
5429 : Reproduce behavior of 5.005 and earlier, maybe drop that in 5.7.
5430 case "$installstyle" in
5431 '') case "$prefix" in
5432 *perl*) dflt='lib';;
5433 *) dflt='lib/perl5' ;;
5436 *) dflt="$installstyle" ;;
5438 : Probably not worth prompting for this since we prompt for all
5439 : the directories individually, and the prompt would be too long and
5443 : determine where private library files go
5444 : Usual default is /usr/local/lib/perl5/$version.
5445 : Also allow things like /opt/perl/lib/$version, since
5446 : /opt/perl/lib/perl5... would be redundant.
5447 : The default "style" setting is made in installstyle.U
5448 case "$installstyle" in
5449 *lib/perl5*) set dflt privlib lib/$package/$version ;;
5450 *) set dflt privlib lib/$version ;;
5455 There are some auxiliary files for $package that need to be put into a
5456 private library directory that is accessible by everyone.
5460 rp='Pathname where the private library files will reside?'
5463 privlibexp="$ansexp"
5464 : Change installation prefix, if necessary.
5465 if $test X"$prefix" != X"$installprefix"; then
5466 installprivlib=`echo $privlibexp | sed "s#^$prefix#$installprefix#"`
5468 installprivlib="$privlibexp"
5471 : set the prefixup variable, to restore leading tilda escape
5472 prefixup='case "$prefixexp" in
5474 *) eval "$1=\`echo \$$1 | sed \"s,^$prefixexp,$prefix,\"\`";;
5477 : determine where public architecture dependent libraries go
5480 : privlib default is /usr/local/lib/$package/$version
5481 : archlib default is /usr/local/lib/$package/$version/$archname
5482 : privlib may have an optional trailing /share.
5483 tdflt=`echo $privlib | $sed 's,/share$,,'`
5484 tdflt=$tdflt/$archname
5493 $spackage contains architecture-dependent library files. If you are
5494 sharing libraries in a heterogeneous environment, you might store
5495 these files in a separate location. Otherwise, you can just include
5496 them with the rest of the public library files.
5500 rp='Where do you want to put the public architecture-dependent libraries?'
5503 archlibexp="$ansexp"
5504 if $test X"$archlib" = X"$privlib"; then
5509 : Change installation prefix, if necessary.
5510 if $test X"$prefix" != X"$installprefix"; then
5511 installarchlib=`echo $archlibexp | sed "s#^$prefix#$installprefix#"`
5513 installarchlib="$archlibexp"
5517 : Binary compatibility with 5.005 is not possible for builds
5518 : with advanced features
5519 case "$usethreads$usemultiplicity" in
5521 bincompat5005="$undef"
5522 d_bincompat5005="$undef"
5526 This version of Perl can be compiled for binary compatibility with 5.005.
5527 If you decide to do so, you will be able to continue using most of the
5528 extensions that were compiled for Perl 5.005.
5531 case "$bincompat5005$d_bincompat5005" in
5532 *"$undef"*) dflt=n ;;
5535 rp='Binary compatibility with Perl 5.005?'
5538 y*) val="$define" ;;
5543 case "$d_bincompat5005" in
5545 bincompat5005="$define"
5547 *) bincompat5005="$undef"
5548 d_bincompat5005="$undef"
5555 : see if setuid scripts can be secure
5558 Some kernels have a bug that prevents setuid #! scripts from being
5559 secure. Some sites have disabled setuid #! scripts because of this.
5561 First let's decide if your kernel supports secure setuid #! scripts.
5562 (If setuid #! scripts would be secure but have been disabled anyway,
5563 don't say that they are secure if asked.)
5568 if $test -d /dev/fd; then
5569 echo "#!$ls" >reflect
5570 chmod +x,u+s reflect
5571 ./reflect >flect 2>&1
5572 if $contains "/dev/fd" flect >/dev/null; then
5573 echo "Congratulations, your kernel has secure setuid scripts!" >&4
5577 If you are not sure if they are secure, I can check but I'll need a
5578 username and password different from the one you are using right now.
5579 If you don't have such a username or don't want me to test, simply
5583 rp='Other username to test security of setuid scripts with?'
5588 case "$d_suidsafe" in
5589 '') echo "I'll assume setuid scripts are *not* secure." >&4
5592 echo "Well, the $hint value is *not* secure." >&4
5594 *) echo "Well, the $hint value *is* secure." >&4
5599 $rm -f reflect flect
5600 echo "#!$ls" >reflect
5601 chmod +x,u+s reflect
5604 echo '"su" will (probably) prompt you for '"$ans's password."
5605 su $ans -c './reflect >flect'
5606 if $contains "/dev/fd" flect >/dev/null; then
5607 echo "Okay, it looks like setuid scripts are secure." >&4
5610 echo "I don't think setuid scripts are secure." >&4
5615 rp='Does your kernel have *secure* setuid scripts?'
5618 [yY]*) val="$define";;
5623 echo "I don't think setuid scripts are secure (no /dev/fd directory)." >&4
5624 echo "(That's for file descriptors, not floppy disks.)"
5630 $rm -f reflect flect
5632 : now see if they want to do setuid emulation
5635 case "$d_suidsafe" in
5638 echo "No need to emulate SUID scripts since they are secure here." >& 4
5642 Some systems have disabled setuid scripts, especially systems where
5643 setuid scripts cannot be secure. On systems where setuid scripts have
5644 been disabled, the setuid/setgid bits on scripts are currently
5645 useless. It is possible for $package to detect those bits and emulate
5646 setuid/setgid in a secure fashion. This emulation will only work if
5647 setuid scripts have been disabled in your kernel.
5651 "$define") dflt=y ;;
5654 rp="Do you want to do setuid/setgid emulation?"
5657 [yY]*) val="$define";;
5665 : determine filename position in cpp output
5667 echo "Computing filename position in cpp output for #include directives..." >&4
5668 echo '#include <stdio.h>' > foo.c
5671 $cppstdin $cppflags $cppminus <foo.c 2>/dev/null | \
5672 $grep '^[ ]*#.*stdio\.h' | \
5673 while read cline; do
5676 while $test \$# -gt 0; do
5677 if $test -r \`echo \$1 | $tr -d '"'\`; then
5682 pos=\`expr \$pos + 1\`
5694 *) pos="${fieldn}th";;
5696 echo "Your cpp writes the filename in the $pos field of the line."
5698 : locate header file
5703 for usrincdir in $usrinc
5705 if test -f \$usrincdir/\$wanted; then
5706 echo "\$usrincdir/\$wanted"
5710 awkprg='{ print \$$fieldn }'
5711 echo "#include <\$wanted>" > foo\$\$.c
5712 $cppstdin $cppminus $cppflags < foo\$\$.c 2>/dev/null | \
5713 $grep "^[ ]*#.*\$wanted" | \
5714 while read cline; do
5715 name=\`echo \$cline | $awk "\$awkprg" | $tr -d '"'\`
5717 *[/\\\\]\$wanted) echo "\$name"; exit 1;;
5718 *[\\\\/]\$wanted) echo "\$name"; exit 1;;
5723 # status = 0: grep returned 0 lines, case statement not executed
5724 # status = 1: headerfile found
5725 # status = 2: while loop executed, no headerfile found
5729 if test \$status -eq 1; then
5736 : define an alternate in-header-list? function
5737 inhdr='echo " "; td=$define; tu=$undef; yyy=$@;
5738 cont=true; xxf="echo \"<\$1> found.\" >&4";
5739 case $# in 2) xxnf="echo \"<\$1> NOT found.\" >&4";;
5740 *) xxnf="echo \"<\$1> NOT found, ...\" >&4";;
5742 case $# in 4) instead=instead;; *) instead="at last";; esac;
5743 while $test "$cont"; do
5745 var=$2; eval "was=\$$2";
5746 if $test "$xxx" && $test -r "$xxx";
5748 eval "case \"\$$var\" in $undef) . ./whoa; esac"; eval "$var=\$td";
5751 eval "case \"\$$var\" in $define) . ./whoa; esac"; eval "$var=\$tu"; fi;
5752 set $yyy; shift; shift; yyy=$@;
5753 case $# in 0) cont="";;
5754 2) xxf="echo \"but I found <\$1> $instead.\" >&4";
5755 xxnf="echo \"and I did not find <\$1> either.\" >&4";;
5756 *) xxf="echo \"but I found <\$1\> instead.\" >&4";
5757 xxnf="echo \"there is no <\$1>, ...\" >&4";;
5761 do set $yyy; var=$2; eval "was=\$$2";
5762 eval "case \"\$$var\" in $define) . ./whoa; esac"; eval "$var=\$tu";
5763 set $yyy; shift; shift; yyy=$@;
5766 : see if this is a malloc.h system
5767 set malloc.h i_malloc
5770 : see if stdlib is available
5771 set stdlib.h i_stdlib
5774 : determine which malloc to compile in
5776 case "$usemymalloc" in
5777 ''|[yY]*|true|$define) dflt='y' ;;
5780 rp="Do you wish to attempt to use the malloc that comes with $package?"
5786 mallocsrc='malloc.c'
5787 mallocobj="malloc$_o"
5788 d_mymalloc="$define"
5791 : Remove malloc from list of libraries to use
5792 echo "Removing unneeded -lmalloc from library list" >&4
5793 set `echo X $libs | $sed -e 's/-lmalloc / /' -e 's/-lmalloc$//'`
5796 echo "libs = $libs" >&4
5808 : compute the return types of malloc and free
5810 $cat >malloc.c <<END
5814 #include <sys/types.h>
5828 case "$malloctype" in
5830 if $cc $ccflags -c -DTRY_MALLOC malloc.c >/dev/null 2>&1; then
5837 echo "Your system wants malloc to return '$malloctype', it would seem." >&4
5841 if $cc $ccflags -c -DTRY_FREE malloc.c >/dev/null 2>&1; then
5848 echo "Your system uses $freetype free(), it would seem." >&4
5852 After $package is installed, you may wish to install various
5853 add-on modules and utilities. Typically, these add-ons will
5854 be installed under $prefix with the rest
5855 of this package. However, you may wish to install such add-ons
5856 elsewhere under a different prefix.
5858 If you do not wish to put everything under a single prefix, that's
5859 ok. You will be prompted for the individual locations; this siteprefix
5860 is only used to suggest the defaults.
5862 The default should be fine for most people.
5866 rp='Installation prefix to use for add-on modules and utilities?'
5867 : XXX Here might be another good place for an installstyle setting.
5868 case "$siteprefix" in
5870 *) dflt=$siteprefix ;;
5873 : XXX Prefixit unit does not yet support siteprefix and vendorprefix
5875 case "$siteprefix" in
5879 *) oldsiteprefix="$prefix";;
5884 siteprefixexp="$ansexp"
5886 : determine where site specific libraries go.
5887 : Usual default is /usr/local/lib/perl5/site_perl/$version
5888 : The default "style" setting is made in installstyle.U
5889 : XXX No longer works with Prefixit stuff.
5890 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
5892 '') case "$installstyle" in
5893 *lib/perl5*) dflt=$siteprefix/lib/$package/site_$prog/$version ;;
5894 *) dflt=$siteprefix/lib/site_$prog/$version ;;
5902 The installation process will create a directory for
5903 site-specific extensions and modules. Most users find it convenient
5904 to place all site-specific files in this directory rather than in the
5905 main distribution directory.
5909 rp='Pathname for the site-specific library files?'
5912 sitelibexp="$ansexp"
5913 sitelib_stem=`echo "$sitelibexp" | sed "s,/$version$,,"`
5914 : Change installation prefix, if necessary.
5915 if $test X"$prefix" != X"$installprefix"; then
5916 installsitelib=`echo $sitelibexp | $sed "s#^$prefix#$installprefix#"`
5918 installsitelib="$sitelibexp"
5921 : determine where site specific architecture-dependent libraries go.
5922 : sitelib default is /usr/local/lib/perl5/site_perl/$version
5923 : sitearch default is /usr/local/lib/perl5/site_perl/$version/$archname
5924 : sitelib may have an optional trailing /share.
5926 '') dflt=`echo $sitelib | $sed 's,/share$,,'`
5927 dflt="$dflt/$archname"
5932 set sitearch sitearch none
5936 The installation process will also create a directory for
5937 architecture-dependent site-specific extensions and modules.
5941 rp='Pathname for the site-specific architecture-dependent library files?'
5944 sitearchexp="$ansexp"
5945 : Change installation prefix, if necessary.
5946 if $test X"$prefix" != X"$installprefix"; then
5947 installsitearch=`echo $sitearchexp | sed "s#^$prefix#$installprefix#"`
5949 installsitearch="$sitearchexp"
5954 The installation process will also create a directory for
5955 vendor-supplied add-ons. Vendors who supply perl with their system
5956 may find it convenient to place all vendor-supplied files in this
5957 directory rather than in the main distribution directory. This will
5958 ease upgrades between binary-compatible maintenance versions of perl.
5960 Of course you may also use these directories in whatever way you see
5961 fit. For example, you might use them to access modules shared over a
5962 company-wide network.
5964 The default answer should be fine for most people.
5965 This causes further questions about vendor add-ons to be skipped
5966 and no vendor-specific directories will be configured for perl.
5969 rp='Do you want to configure vendor-specific add-on directories?'
5970 case "$usevendorprefix" in
5971 define|true|[yY]*) dflt=y ;;
5972 *) : User may have set vendorprefix directly on Configure command line.
5973 case "$vendorprefix" in
5982 rp='Installation prefix to use for vendor-supplied add-ons?'
5983 case "$vendorprefix" in
5985 *) dflt=$vendorprefix ;;
5988 : XXX Prefixit unit does not yet support siteprefix and vendorprefix
5990 case "$vendorprefix" in
5994 *) oldvendorprefix="$prefix";;
5998 usevendorprefix="$define"
6000 vendorprefixexp="$ansexp"
6002 *) usevendorprefix="$undef"
6008 case "$vendorprefix" in
6009 '') d_vendorlib="$undef"
6013 *) d_vendorlib="$define"
6014 : determine where vendor-supplied modules go.
6015 : Usual default is /usr/local/lib/perl5/vendor_perl/$version
6016 case "$vendorlib" in
6018 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
6019 case "$installstyle" in
6020 *lib/perl5*) dflt=$vendorprefix/lib/$package/vendor_$prog/$version ;;
6021 *) dflt=$vendorprefix/lib/vendor_$prog/$version ;;
6024 *) dflt="$vendorlib"
6028 rp='Pathname for the vendor-supplied library files?'
6031 vendorlibexp="$ansexp"
6034 vendorlib_stem=`echo "$vendorlibexp" | sed "s,/$version$,,"`
6035 : Change installation prefix, if necessary.
6036 if $test X"$prefix" != X"$installprefix"; then
6037 installvendorlib=`echo $vendorlibexp | $sed "s#^$prefix#$installprefix#"`
6039 installvendorlib="$vendorlibexp"
6042 case "$vendorprefix" in
6043 '') d_vendorarch="$undef"
6047 *) d_vendorarch="$define"
6048 : determine where vendor-supplied architecture-dependent libraries go.
6049 : vendorlib default is /usr/local/lib/perl5/vendor_perl/$version
6050 : vendorarch default is /usr/local/lib/perl5/vendor_perl/$version/$archname
6051 : vendorlib may have an optional trailing /share.
6052 case "$vendorarch" in
6053 '') dflt=`echo $vendorlib | $sed 's,/share$,,'`
6054 dflt="$dflt/$archname"
6056 *) dflt="$vendorarch" ;;
6059 rp='Pathname for vendor-supplied architecture-dependent files?'
6062 vendorarchexp="$ansexp"
6065 : Change installation prefix, if necessary.
6066 if $test X"$prefix" != X"$installprefix"; then
6067 installvendorarch=`echo $vendorarchexp | sed "s#^$prefix#$installprefix#"`
6069 installvendorarch="$vendorarchexp"
6072 : Final catch-all directories to search
6075 Lastly, you can have perl look in other directories for extensions and
6076 modules in addition to those already specified.
6077 These directories will be searched after
6081 test X"$vendorlib" != "X" && echo ' ' $vendorlib
6082 test X"$vendorarch" != "X" && echo ' ' $vendorarch
6084 case "$otherlibdirs" in
6085 ''|' ') dflt='none' ;;
6086 *) dflt="$otherlibdirs" ;;
6089 Enter a colon-separated set of extra paths to include in perl's @INC
6090 search path, or enter 'none' for no extra paths.
6094 rp='Colon-separated list of additional directories for perl to search?'
6097 ' '|''|none) otherlibdirs=' ' ;;
6098 *) otherlibdirs="$ans" ;;
6100 case "$otherlibdirs" in
6104 set d_perl_otherlibdirs
6107 : Cruising for prototypes
6109 echo "Checking out function prototypes..." >&4
6110 $cat >prototype.c <<'EOCP'
6111 int main(int argc, char *argv[]) {
6114 if $cc $ccflags -c prototype.c >prototype.out 2>&1 ; then
6115 echo "Your C compiler appears to support function prototypes."
6118 echo "Your C compiler doesn't seem to understand function prototypes."
6125 case "$prototype" in
6127 *) ansi2knr='ansi2knr'
6132 This version of $package can only be compiled by a compiler that
6133 understands function prototypes. Unfortunately, your C compiler
6135 doesn't seem to understand them. Sorry about that.
6137 If GNU cc is available for your system, perhaps you could try that instead.
6139 Eventually, we hope to support building Perl with pre-ANSI compilers.
6140 If you would like to help in that effort, please contact <perlbug@perl.org>.
6142 Aborting Configure now.
6148 : determine where public executables go
6153 rp='Pathname where the public executables will reside?'
6155 if $test "X$ansexp" != "X$binexp"; then
6160 : Change installation prefix, if necessary.
6161 : XXX Bug? -- ignores Configure -Dinstallprefix setting.
6162 if $test X"$prefix" != X"$installprefix"; then
6163 installbin=`echo $binexp | sed "s#^$prefix#$installprefix#"`
6165 installbin="$binexp"
6168 : Find perl5.005 or later.
6169 echo "Looking for a previously installed perl5.005 or later... "
6171 '') for tdir in `echo "$binexp:$PATH" | $sed "s/$path_sep/ /g"`; do
6172 : Check if this perl is recent and can load a simple module
6173 if $test -x $tdir/perl && $tdir/perl -Mless -e 'use 5.005;' >/dev/null 2>&1; then
6176 elif $test -x $tdir/perl5 && $tdir/perl5 -Mless -e 'use 5.005;' >/dev/null 2>&1; then
6186 '') echo "None found. That's ok.";;
6187 *) echo "Using $perl5." ;;
6190 : Determine list of previous versions to include in @INC
6191 $cat > getverlist <<EOPL
6194 \$api_versionstring = "$api_versionstring";
6195 \$version = "$version";
6196 \$stem = "$sitelib_stem";
6197 \$archname = "$archname";
6199 $cat >> getverlist <<'EOPL'
6200 # Can't have leading @ because metaconfig interprets it as a command!
6201 ;@inc_version_list=();
6202 # XXX Redo to do opendir/readdir?
6205 ;@candidates = glob("5.*");
6211 # XXX ToDo: These comparisons must be reworked when two-digit
6212 # subversions come along, so that 5.7.10 compares as greater than
6213 # 5.7.3! By that time, hope that 5.6.x is sufficiently
6214 # widespread that we can use the built-in version vectors rather
6215 # than reinventing them here. For 5.6.0, however, we must
6216 # assume this script will likely be run by 5.005_0x. --AD 1/2000.
6217 foreach $d (@candidates) {
6218 if ($d lt $version) {
6219 if ($d ge $api_versionstring) {
6220 unshift(@inc_version_list, grep { -d } "$d/$archname", $d);
6222 elsif ($d ge "5.005") {
6223 unshift(@inc_version_list, grep { -d } $d);
6227 # Skip newer version. I.e. don't look in
6228 # 5.7.0 if we're installing 5.6.1.
6232 if (@inc_version_list) {
6233 print join(' ', @inc_version_list);
6236 # Blank space to preserve value for next Configure run.
6241 case "$inc_version_list" in
6242 '') if test -x "$perl5"; then
6243 dflt=`$perl5 getverlist`
6248 $undef) dflt='none' ;;
6249 *) dflt="$inc_version_list" ;;
6252 ''|' ') dflt=none ;;
6255 5.005) case "$bincompat5005" in
6256 $define|true|[yY]*) ;;
6263 In order to ease the process of upgrading, this version of perl
6264 can be configured to use modules built and installed with earlier
6265 versions of perl that were installed under $prefix. Specify here
6266 the list of earlier versions that this version of perl should check.
6267 If Configure detected no earlier versions of perl installed under
6268 $prefix, then the list will be empty. Answer 'none' to tell perl
6269 to not search earlier versions.
6271 The default should almost always be sensible, so if you're not sure,
6272 just accept the default.
6275 rp='List of earlier versions to include in @INC?'
6278 [Nn]one|''|' ') inc_version_list=' ' ;;
6279 *) inc_version_list="$ans" ;;
6281 case "$inc_version_list" in
6283 inc_version_list_init='0';;
6284 *) inc_version_list_init=`echo $inc_version_list |
6285 $sed -e 's/^/"/' -e 's/ /","/g' -e 's/$/",0/'`
6290 : determine whether to install perl also as /usr/bin/perl
6293 if $test -d /usr/bin -a "X$installbin" != X/usr/bin; then
6295 Many scripts expect perl to be installed as /usr/bin/perl.
6296 I can install the perl you are about to compile also as /usr/bin/perl
6297 (in addition to $installbin/perl).
6299 case "$installusrbinperl" in
6300 "$undef"|[nN]*) dflt='n';;
6303 rp="Do you want to install perl as /usr/bin/perl?"
6306 [yY]*) val="$define";;
6312 set installusrbinperl
6315 : see if dld is available
6319 : see if dlopen exists
6326 : determine which dynamic loading, if any, to compile in
6328 dldir="ext/DynaLoader"
6341 $define) dflt='y' ;;
6344 $define) dflt='y' ;;
6346 : Does a dl_xxx.xs file exist for this operating system
6347 $test -f $rsrc/$dldir/dl_${osname}.xs && dflt='y'
6350 rp="Do you wish to use dynamic loading?"
6357 if $test -f $rsrc/$dldir/dl_${osname}.xs ; then
6358 dflt="$dldir/dl_${osname}.xs"
6359 elif $test "$d_dlopen" = "$define" ; then
6360 dflt="$dldir/dl_dlopen.xs"
6361 elif $test "$i_dld" = "$define" ; then
6362 dflt="$dldir/dl_dld.xs"
6367 *) dflt="$dldir/$dlsrc"
6370 echo "The following dynamic loading files are available:"
6371 : Can not go over to $dldir because getfile has path hard-coded in.
6372 tdir=`pwd`; cd $rsrc; $ls -C $dldir/dl*.xs; cd $tdir
6373 rp="Source file to use for dynamic loading"
6379 dlsrc=`echo $ans | $sed -e 's%.*/\([^/]*\)$%\1%'`
6383 Some systems may require passing special flags to $cc -c to
6384 compile modules that will be used to create a shared library.
6385 To use no flags, say "none".
6388 case "$cccdlflags" in
6389 '') case "$gccversion" in
6390 '') case "$osname" in
6392 next) dflt='none' ;;
6393 irix*) dflt='-KPIC' ;;
6394 svr4*|esix*|solaris|nonstopux) dflt='-KPIC' ;;
6395 sunos) dflt='-pic' ;;
6399 *) case "$osname" in
6400 svr4*|esix*|solaris|nonstopux) dflt='-fPIC' ;;
6405 *) dflt="$cccdlflags" ;;
6407 rp="Any special flags to pass to $cc -c to compile shared library modules?"
6410 none) cccdlflags=' ' ;;
6411 *) cccdlflags="$ans" ;;
6416 Some systems use ld to create libraries that can be dynamically loaded,
6417 while other systems (such as those using ELF) use $cc.
6421 '') $cat >try.c <<'EOM'
6422 /* Test for whether ELF binaries are produced */
6427 int i = open("a.out",O_RDONLY);
6430 if(read(i,b,4)==4 && b[0]==127 && b[1]=='E' && b[2]=='L' && b[3]=='F')
6431 exit(0); /* succeed (yes, it's ELF) */
6436 if $cc $ccflags try.c >/dev/null 2>&1 && ./a.out; then
6438 You appear to have ELF support. I'll use $cc to build dynamic libraries.
6442 echo "I'll use ld to build dynamic libraries."
6451 rp="What command should be used to create dynamic libraries?"
6457 Some systems may require passing special flags to $ld to create a
6458 library that can be dynamically loaded. If your ld flags include
6459 -L/other/path options to locate libraries outside your loader's normal
6460 search path, you may need to specify those -L options here as well. To
6461 use no flags, say "none".
6464 case "$lddlflags" in
6465 '') case "$osname" in
6466 beos) dflt='-nostart' ;;
6468 case "$gccversion" in
6469 '') dflt="$dflt +vnocompatwarnings" ;;
6472 linux|irix*) dflt='-shared' ;;
6473 next) dflt='none' ;;
6474 solaris) dflt='-G' ;;
6475 sunos) dflt='-assert nodefinitions' ;;
6476 svr4*|esix*|nonstopux) dflt="-G $ldflags" ;;
6480 *) dflt="$lddlflags" ;;
6483 : Try to guess additional flags to pick up local libraries.
6484 : Be careful not to append to a plain 'none'
6488 for thisflag in $ldflags; do
6493 *) dflt="$dflt $thisflag" ;;
6500 ''|' ') dflt='none' ;;
6503 rp="Any special flags to pass to $ld to create a dynamically loaded library?"
6506 none) lddlflags=' ' ;;
6507 *) lddlflags="$ans" ;;
6512 Some systems may require passing special flags to $cc to indicate that
6513 the resulting executable will use dynamic linking. To use no flags,
6517 case "$ccdlflags" in
6518 '') case "$osname" in
6519 hpux) dflt='-Wl,-E' ;;
6520 linux) dflt='-rdynamic' ;;
6521 next) dflt='none' ;;
6522 sunos) dflt='none' ;;
6526 *) dflt="$ccdlflags" ;;
6528 rp="Any special flags to pass to $cc to use dynamic linking?"
6531 none) ccdlflags=' ' ;;
6532 *) ccdlflags="$ans" ;;
6546 # No dynamic loading being used, so don't bother even to prompt.
6549 *) case "$useshrplib" in
6550 '') case "$osname" in
6551 svr4*|nonstopux|dgux|dynixptx|esix|powerux|beos|cygwin*)
6553 also='Building a shared libperl is required for dynamic loading to work on your system.'
6558 also='Building a shared libperl is needed for MAB support.'
6576 The perl executable is normally obtained by linking perlmain.c with
6577 libperl${_a}, any static extensions (usually just DynaLoader), and
6578 any other libraries needed on this system (such as -lm, etc.). Since
6579 your system supports dynamic loading, it is probably possible to build
6580 a shared libperl.$so. If you will have more than one executable linked
6581 to libperl.$so, this will significantly reduce the size of each
6582 executable, but it may have a noticeable affect on performance. The
6583 default is probably sensible for your system.
6587 rp="Build a shared libperl.$so (y/n)"
6591 useshrplib='true' ;;
6592 *) useshrplib='false' ;;
6597 case "$useshrplib" in
6601 # Figure out a good name for libperl.so. Since it gets stored in
6602 # a version-specific architecture-dependent library, the version
6603 # number isn't really that important, except for making cc/ld happy.
6605 # A name such as libperl.so.3.1
6606 majmin="libperl.$so.$patchlevel.$subversion"
6607 # A name such as libperl.so.301
6608 majonly=`echo $patchlevel $subversion |
6609 $awk '{printf "%d%02d", $1, $2}'`
6610 majonly=libperl.$so.$majonly
6611 # I'd prefer to keep the os-specific stuff here to a minimum, and
6612 # rely on figuring it out from the naming of libc.
6613 case "${osname}${osvers}" in
6616 # XXX How handle the --version stuff for MAB?
6618 linux*) # ld won't link with a bare -lperl otherwise.
6621 cygwin*) # include version
6622 dflt=`echo libperl$version | sed -e 's/\./_/g'`$lib_ext
6624 *) # Try to guess based on whether libc has major.minor.
6626 *libc.$so.[0-9]*.[0-9]*) dflt=$majmin ;;
6627 *libc.$so.[0-9]*) dflt=$majonly ;;
6628 *) dflt=libperl.$so ;;
6638 I need to select a good name for the shared libperl. If your system uses
6639 library names with major and minor numbers, then you might want something
6640 like $majmin. Alternatively, if your system uses a single version
6641 number for shared libraries, then you might want to use $majonly.
6642 Or, your system might be quite happy with a simple libperl.$so.
6644 Since the shared libperl will get installed into a version-specific
6645 architecture-dependent directory, the version number of the shared perl
6646 library probably isn't important, so the default should be o.k.
6649 rp='What name do you want to give to the shared libperl?'
6652 echo "Ok, I'll use $libperl"
6655 libperl="libperl${_a}"
6659 # Detect old use of shrpdir via undocumented Configure -Dshrpdir
6663 WARNING: Use of the shrpdir variable for the installation location of
6664 the shared $libperl is not supported. It was never documented and
6665 will not work in this version. Let me (perlbug@perl.org)
6666 know of any problems this may cause.
6672 But your current setting of $shrpdir is
6673 the default anyway, so it's harmless.
6678 Further, your current attempted setting of $shrpdir
6679 conflicts with the value of $archlibexp/CORE
6680 that installperl will use.
6687 # How will the perl executable find the installed shared $libperl?
6688 # Add $xxx to ccdlflags.
6689 # If we can't figure out a command-line option, use $shrpenv to
6690 # set env LD_RUN_PATH. The main perl makefile uses this.
6691 shrpdir=$archlibexp/CORE
6694 if "$useshrplib"; then
6697 # We'll set it in Makefile.SH...
6703 xxx="-Wl,-R$shrpdir"
6705 linux|irix*|dec_osf)
6706 xxx="-Wl,-rpath,$shrpdir"
6709 # next doesn't like the default...
6712 # beos doesn't like the default, either.
6715 # hpux doesn't like the default, either.
6716 tmp_shrpenv="env LDOPTS=\"+s +b${shrpdir}\""
6719 tmp_shrpenv="env LD_RUN_PATH=$shrpdir"
6725 # Only add $xxx if it isn't already in ccdlflags.
6726 case " $ccdlflags " in
6728 *) ccdlflags="$ccdlflags $xxx"
6731 Adding $xxx to the flags
6732 passed to $ld so that the perl executable will find the
6733 installed shared $libperl.
6741 # Fix ccdlflags in AIX for building external extensions.
6742 # (For building Perl itself bare -bE:perl.exp is needed,
6743 # Makefile.SH takes care of this.)
6745 aix) ccdlflags="$ccdlflags -bE:$installarchlib/CORE/perl.exp" ;;
6747 # Respect a hint or command-line value.
6749 '') shrpenv="$tmp_shrpenv" ;;
6751 case "$ldlibpthname" in
6752 '') ldlibpthname=LD_LIBRARY_PATH ;;
6753 none) ldlibpthname='' ;;
6756 : determine where manual pages are on this system
6760 syspath='/usr/man/man1 /usr/man/mann /usr/man/manl /usr/man/local/man1'
6761 syspath="$syspath /usr/man/u_man/man1 /usr/share/man/man1"
6762 syspath="$syspath /usr/catman/u_man/man1 /usr/man/l_man/man1"
6763 syspath="$syspath /usr/local/man/u_man/man1 /usr/local/man/l_man/man1"
6764 syspath="$syspath /usr/man/man.L /local/man/man1 /usr/local/man/man1"
6765 sysman=`./loc . /usr/man/man1 $syspath`
6768 if $test -d "$sysman"; then
6769 echo "System manual is in $sysman." >&4
6771 echo "Could not find manual pages in source form." >&4
6774 : determine where manual pages go
6775 set man1dir man1dir none
6779 $spackage has manual pages available in source form.
6783 echo "However, you don't have nroff, so they're probably useless to you."
6785 '') man1dir="none";;
6788 echo "If you don't want the manual sources installed, answer 'none'."
6793 lookpath="$prefixexp/man/man1 $prefixexp/man/l_man/man1"
6794 lookpath="$lookpath $prefixexp/man/p_man/man1"
6795 lookpath="$lookpath $prefixexp/man/u_man/man1"
6796 lookpath="$lookpath $prefixexp/man/man.1"
6798 */?_man*) dflt=`./loc . $prefixexp/l_man/man1 $lookpath` ;;
6799 *) dflt=`./loc . $prefixexp/man/man1 $lookpath` ;;
6809 rp="Where do the main $spackage manual pages (source) go?"
6811 if $test "X$man1direxp" != "X$ansexp"; then
6815 man1direxp="$ansexp"
6821 : Change installation prefix, if necessary.
6822 if $test X"$prefix" != X"$installprefix"; then
6823 installman1dir=`echo $man1direxp | $sed "s#^$prefix#$installprefix#"`
6825 installman1dir="$man1direxp"
6828 : What suffix to use on installed man pages
6835 rp="What suffix should be used for the main $spackage man pages?"
6837 '') case "$man1dir" in
6851 *) dflt="$man1ext";;
6858 : see if we can have long filenames
6860 first=123456789abcdef
6862 if (echo hi >$first) 2>/dev/null; then
6863 if $test -f 123456789abcde; then
6864 echo 'You cannot have filenames longer than 14 characters. Sigh.' >&4
6867 echo 'You can have filenames longer than 14 characters.'>&4
6872 You can't have filenames longer than 14 chars.
6873 You can't even think about them!
6879 $rm -rf 123456789abcde*
6881 : determine where library module manual pages go
6882 set man3dir man3dir none
6886 $spackage has manual pages for many of the library modules.
6892 However, you don't have nroff, so they're probably useless to you.
6895 '') man3dir="none";;
6899 case "$d_flexfnam" in
6902 However, your system can't handle the long file names like File::Basename.3.
6905 '') man3dir="none";;
6909 echo "If you don't want the manual sources installed, answer 'none'."
6910 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
6912 '') dflt=`echo "$man1dir" | $sed -e 's/man1/man3/g' -e 's/man\.1/man\.3/g'`
6913 if $test -d "$privlib/man/man3"; then
6916 WARNING: Previous versions of perl installed man3 pages into
6917 $privlib/man/man3. This version will suggest a
6918 new default of $dflt.
6922 rp='Do you wish to preserve the old behavior?(y/n)'
6925 y*) dflt="$privlib/man/man3" ;;
6930 *) dflt="$man3dir" ;;
6937 rp="Where do the $package library man pages (source) go?"
6940 man3direxp="$ansexp"
6946 : Change installation prefix, if necessary.
6947 if $test X"$prefix" != X"$installprefix"; then
6948 installman3dir=`echo $man3direxp | $sed "s#^$prefix#$installprefix#"`
6950 installman3dir="$man3direxp"
6953 : What suffix to use on installed man pages
6959 rp="What suffix should be used for the $package library man pages?"
6961 '') case "$man3dir" in
6975 *) dflt="$man3ext";;
6982 : see if we have to deal with yellow pages, now NIS.
6983 if $test -d /usr/etc/yp || $test -d /etc/yp; then
6984 if $test -f /usr/etc/nibindd; then
6986 echo "I'm fairly confident you're on a NeXT."
6988 rp='Do you get the hosts file via NetInfo?'
6997 y*) hostcat='nidump hosts .';;
6998 *) case "$hostcat" in
6999 nidump*) hostcat='';;
7009 '') if $contains '^\+' /etc/passwd >/dev/null 2>&1; then
7017 rp='Are you getting the hosts file via yellow pages?'
7020 y*) hostcat='ypcat hosts';;
7021 *) hostcat='cat /etc/hosts';;
7027 '') test -f /etc/hosts && hostcat='cat /etc/hosts';;
7030 '') test -f /etc/group && groupcat='cat /etc/group';;
7033 '') test -f /etc/passwd && passcat='cat /etc/passwd';;
7036 : now get the host name
7038 echo "Figuring out host name..." >&4
7039 case "$myhostname" in
7041 echo 'Maybe "hostname" will work...'
7042 if tans=`sh -c hostname 2>&1` ; then
7050 if $test "$cont"; then
7052 echo 'Oh, dear. Maybe "/etc/systemid" is the key...'
7053 if tans=`cat /etc/systemid 2>&1` ; then
7055 phostname='cat /etc/systemid'
7056 echo "Whadyaknow. Xenix always was a bit strange..."
7059 elif $test -r /etc/systemid; then
7060 echo "(What is a non-Xenix system doing with /etc/systemid?)"
7063 if $test "$cont"; then
7064 echo 'No, maybe "uuname -l" will work...'
7065 if tans=`sh -c 'uuname -l' 2>&1` ; then
7067 phostname='uuname -l'
7069 echo 'Strange. Maybe "uname -n" will work...'
7070 if tans=`sh -c 'uname -n' 2>&1` ; then
7072 phostname='uname -n'
7074 echo 'Oh well, maybe I can mine it out of whoami.h...'
7075 if tans=`sh -c $contains' sysname $usrinc/whoami.h' 2>&1` ; then
7076 myhostname=`echo "$tans" | $sed 's/^.*"\(.*\)"/\1/'`
7077 phostname="sed -n -e '"'/sysname/s/^.*\"\\(.*\\)\"/\1/{'"' -e p -e q -e '}' <$usrinc/whoami.h"
7079 case "$myhostname" in
7080 '') echo "Does this machine have an identity crisis or something?"
7083 echo "Well, you said $myhostname before..."
7084 phostname='echo $myhostname';;
7090 : you do not want to know about this
7095 if $test "$myhostname" ; then
7097 rp='Your host name appears to be "'$myhostname'".'" Right?"
7105 : bad guess or no guess
7106 while $test "X$myhostname" = X ; do
7108 rp="Please type the (one word) name of your host:"
7113 : translate upper to lower if necessary
7114 case "$myhostname" in
7116 echo "(Normalizing case in your host name)"
7117 myhostname=`echo $myhostname | ./tr '[A-Z]' '[a-z]'`
7121 case "$myhostname" in
7123 dflt=`expr "X$myhostname" : "X[^.]*\(\..*\)"`
7124 myhostname=`expr "X$myhostname" : "X\([^.]*\)\."`
7125 echo "(Trimming domain name from host name--host name is now $myhostname)"
7127 *) case "$mydomain" in
7130 test "X$hostcat" = "Xypcat hosts" &&
7131 ypmatch "$myhostname" hosts 2>/dev/null |\
7132 $sed -e 's/[ ]*#.*//; s/$/ /' > hosts && \
7135 test "X$hostcat" != "X" &&
7136 $hostcat | $sed -n -e "s/[ ]*#.*//; s/\$/ /
7137 /[ ]$myhostname[ . ]/p" > hosts
7140 if $test -f hosts; then
7141 $test x`$awk "/[0-9].*[ ]$myhostname$tmp_re/ { sum++ }
7142 END { print sum }" hosts` = x1 || tmp_re="[ ]"
7143 dflt=.`$awk "/[0-9].*[ ]$myhostname$tmp_re/ {for(i=2; i<=NF;i++) print \\\$i}" \
7144 hosts | $sort | $uniq | \
7145 $sed -n -e "s/$myhostname\.\([-a-zA-Z0-9_.]\)/\1/p"`
7146 case `$echo X$dflt` in
7147 X*\ *) echo "(Several hosts in the database matched hostname)"
7150 X.) echo "(You do not have fully-qualified names in the hosts database)"
7154 echo "(I cannot locate a hosts database anywhere)"
7159 tans=`./loc resolv.conf X /etc /usr/etc`
7160 if $test -f "$tans"; then
7161 echo "(Attempting domain name extraction from $tans)"
7162 dflt=.`$sed -n -e 's/ / /g' \
7163 -e 's/^search *\([^ ]*\).*/\1/p' $tans \
7164 | ./tr '[A-Z]' '[a-z]' 2>/dev/null`
7166 .) dflt=.`$sed -n -e 's/ / /g' \
7167 -e 's/^domain *\([^ ]*\).*/\1/p' $tans \
7168 | ./tr '[A-Z]' '[a-z]' 2>/dev/null`
7175 .) echo "(No help from resolv.conf either -- attempting clever guess)"
7176 dflt=.`sh -c domainname 2>/dev/null`
7179 .nis.*|.yp.*|.main.*) dflt=`echo $dflt | $sed -e 's/^\.[^.]*//'`;;
7184 .) echo "(Lost all hope -- silly guess then)"
7190 *) dflt="$mydomain";;
7194 rp="What is your domain name?"
7204 : translate upper to lower if necessary
7207 echo "(Normalizing case in your domain name)"
7208 mydomain=`echo $mydomain | ./tr '[A-Z]' '[a-z]'`
7212 : a little sanity check here
7213 case "$phostname" in
7216 case `$phostname | ./tr '[A-Z]' '[a-z]'` in
7217 $myhostname$mydomain|$myhostname) ;;
7219 case "$phostname" in
7221 echo "(That doesn't agree with your whoami.h file, by the way.)"
7224 echo "(That doesn't agree with your $phostname command, by the way.)"
7234 I need to get your e-mail address in Internet format if possible, i.e.
7235 something like user@host.domain. Please answer accurately since I have
7236 no easy means to double check it. The default value provided below
7237 is most probably close to reality but may not be valid from outside
7238 your organization...
7242 while test "$cont"; do
7244 '') dflt="$cf_by@$myhostname$mydomain";;
7245 *) dflt="$cf_email";;
7247 rp='What is your e-mail address?'
7253 rp='Address does not look like an Internet one. Use it anyway?'
7269 If you or somebody else will be maintaining perl at your site, please
7270 fill in the correct e-mail address here so that they may be contacted
7271 if necessary. Currently, the "perlbug" program included with perl
7272 will send mail to this address in addition to perlbug@perl.org. You may
7273 enter "none" for no administrator.
7276 case "$perladmin" in
7277 '') dflt="$cf_email";;
7278 *) dflt="$perladmin";;
7280 rp='Perl administrator e-mail address'
7284 : determine whether to only install version-specific parts.
7287 Do you want to install only the version-specific parts of the perl
7288 distribution? Usually you do *not* want to do this.
7290 case "$versiononly" in
7291 "$define"|[Yy]*|true) dflt='y' ;;
7294 rp="Do you want to install only the version-specific parts of perl?"
7297 [yY]*) val="$define";;
7303 : figure out how to guarantee perl startup
7304 case "$startperl" in
7306 case "$sharpbang" in
7310 I can use the #! construct to start perl on your system. This will
7311 make startup of perl scripts faster, but may cause problems if you
7312 want to share those scripts and perl is not in a standard place
7313 ($binexp/perl) on all your platforms. The alternative is to force
7314 a shell by starting the script with a single ':' character.
7317 case "$versiononly" in
7318 "$define") dflt="$binexp/perl$version";;
7319 *) dflt="$binexp/perl";;
7321 rp='What shall I put after the #! to start up perl ("none" to not use #!)?'
7324 none) startperl=": # use perl";;
7325 *) startperl="#!$ans"
7326 if $test 30 -lt `echo "$ans" | wc -c`; then
7329 WARNING: Some systems limit the #! command to 32 characters.
7330 If you experience difficulty running Perl scripts with #!, try
7331 installing Perl in a directory with a shorter pathname.
7337 *) startperl=": # use perl"
7342 echo "I'll use $startperl to start perl scripts."
7344 : figure best path for perl in scripts
7347 perlpath="$binexp/perl"
7348 case "$startperl" in
7353 I will use the "eval 'exec'" idiom to start Perl on your system.
7354 I can use the full path of your Perl binary for this purpose, but
7355 doing so may cause problems if you want to share those scripts and
7356 Perl is not always in a standard place ($binexp/perl).
7360 rp="What path shall I use in \"eval 'exec'\"?"
7367 case "$startperl" in
7369 *) echo "I'll use $perlpath in \"eval 'exec'\"" ;;
7372 : determine where public executable scripts go
7373 set scriptdir scriptdir
7375 case "$scriptdir" in
7378 : guess some guesses
7379 $test -d /usr/share/scripts && dflt=/usr/share/scripts
7380 $test -d /usr/share/bin && dflt=/usr/share/bin
7381 $test -d /usr/local/script && dflt=/usr/local/script
7382 $test -d /usr/local/scripts && dflt=/usr/local/scripts
7383 $test -d $prefixexp/script && dflt=$prefixexp/script
7387 *) dflt="$scriptdir"
7392 Some installations have a separate directory just for executable scripts so
7393 that they can mount it across multiple architectures but keep the scripts in
7394 one spot. You might, for example, have a subdirectory of /usr/share for this.
7395 Or you might just lump your scripts in with all your other executables.
7399 rp='Where do you keep publicly executable scripts?'
7401 if $test "X$ansexp" != "X$scriptdirexp"; then
7405 scriptdirexp="$ansexp"
7406 : Change installation prefix, if necessary.
7407 if $test X"$prefix" != X"$installprefix"; then
7408 installscript=`echo $scriptdirexp | sed "s#^$prefix#$installprefix#"`
7410 installscript="$scriptdirexp"
7413 : determine where add-on public executables go
7415 '') dflt=$siteprefix/bin ;;
7419 rp='Pathname where the add-on public executables should be installed?'
7422 sitebinexp="$ansexp"
7423 : Change installation prefix, if necessary.
7424 if $test X"$prefix" != X"$installprefix"; then
7425 installsitebin=`echo $sitebinexp | sed "s#^$prefix#$installprefix#"`
7427 installsitebin="$sitebinexp"
7430 case "$useperlio" in
7431 $define|true|[yY]*) dflt='y';;
7436 Previous version of $package used the standard IO mechanisms as
7437 defined in <stdio.h>. Versions 5.003_02 and later of perl allow
7438 alternate IO mechanisms via the PerlIO abstraction layer, but the
7439 stdio mechanism is still the default. This abstraction layer can
7440 use AT&T's sfio (if you already have sfio installed) or regular stdio.
7441 Using PerlIO with sfio may cause problems with some extension modules.
7443 If this doesn't make any sense to you, just accept the default '$dflt'.
7445 rp='Use the experimental PerlIO abstraction layer?'
7452 echo "Ok, doing things the stdio way."
7461 case "$useperlio" in
7462 $define|true|[yY]*) ;;
7465 You are using the SOCKS proxy protocol library which means that you
7466 should also use the PerlIO layer. You may be headed for trouble.
7475 case "$vendorprefix" in
7476 '') d_vendorbin="$undef"
7480 *) d_vendorbin="$define"
7481 : determine where vendor-supplied executables go.
7482 case "$vendorbin" in
7483 '') dflt=$vendorprefix/bin ;;
7484 *) dflt="$vendorbin" ;;
7487 rp='Pathname for the vendor-supplied executables directory?'
7490 vendorbinexp="$ansexp"
7493 : Change installation prefix, if necessary.
7494 if $test X"$prefix" != X"$installprefix"; then
7495 installvendorbin=`echo $vendorbinexp | $sed "s#^$prefix#$installprefix#"`
7497 installvendorbin="$vendorbinexp"
7500 : see if qgcvt exists
7506 if $test X"$d_longdbl" = X"$define"; then
7508 echo "Checking how to print long doubles..." >&4
7510 if $test X"$sPRIfldbl" = X -a X"$doublesize" = X"$longdblsize"; then
7511 $cat >try.c <<'EOCP'
7512 #include <sys/types.h>
7516 printf("%.3f\n", d);
7520 if eval $compile; then
7524 sPRIfldbl='"f"'; sPRIgldbl='"g"'; sPRIeldbl='"e"';
7525 sPRIFUldbl='"F"'; sPRIGUldbl='"G"'; sPRIEUldbl='"E"';
7526 echo "We will use %f."
7532 if $test X"$sPRIfldbl" = X; then
7533 $cat >try.c <<'EOCP'
7534 #include <sys/types.h>
7537 long double d = 123.456;
7538 printf("%.3llf\n", d);
7542 if eval $compile; then
7546 sPRIfldbl='"llf"'; sPRIgldbl='"llg"'; sPRIeldbl='"lle"';
7547 sPRIFUldbl='"llF"'; sPRIGUldbl='"llG"'; sPRIEUldbl='"llE"';
7548 echo "We will use %llf."
7554 if $test X"$sPRIfldbl" = X; then
7555 $cat >try.c <<'EOCP'
7556 #include <sys/types.h>
7559 long double d = 123.456;
7560 printf("%.3Lf\n", d);
7564 if eval $compile; then
7568 sPRIfldbl='"Lf"'; sPRIgldbl='"Lg"'; sPRIeldbl='"Le"';
7569 sPRIFUldbl='"LF"'; sPRIGUldbl='"LG"'; sPRIEUldbl='"LE"';
7570 echo "We will use %Lf."
7576 if $test X"$sPRIfldbl" = X; then
7577 $cat >try.c <<'EOCP'
7578 #include <sys/types.h>
7581 long double d = 123.456;
7582 printf("%.3lf\n", d);
7586 if eval $compile; then
7590 sPRIfldbl='"lf"'; sPRIgldbl='"lg"'; sPRIeldbl='"le"';
7591 sPRIFUldbl='"lF"'; sPRIGUldbl='"lG"'; sPRIEUldbl='"lE"';
7592 echo "We will use %lf."
7598 if $test X"$sPRIfldbl" = X; then
7599 echo "Cannot figure out how to print long doubles." >&4
7601 sSCNfldbl=$sPRIfldbl # expect consistency
7608 case "$sPRIfldbl" in
7609 '') d_PRIfldbl="$undef"; d_PRIgldbl="$undef"; d_PRIeldbl="$undef";
7610 d_PRIFUldbl="$undef"; d_PRIGUldbl="$undef"; d_PRIEUldbl="$undef";
7611 d_SCNfldbl="$undef";
7613 *) d_PRIfldbl="$define"; d_PRIgldbl="$define"; d_PRIeldbl="$define";
7614 d_PRIFUldbl="$define"; d_PRIGUldbl="$define"; d_PRIEUldbl="$define";
7615 d_SCNfldbl="$define";
7619 : Check how to convert floats to strings.
7621 echo "Checking for an efficient way to convert floats to strings."
7623 case "$uselongdouble" in
7624 "$define") echo "#define USE_LONG_DOUBLE" >>try.c ;;
7626 case "$d_longdbl" in
7627 "$define") echo "#define HAS_LONG_DOUBLE" >>try.c ;;
7629 case "$d_PRIgldbl" in
7630 "$define") echo "#define HAS_PRIgldbl" >>try.c ;;
7634 #define Gconvert(x,n,t,b) gconvert((x),(n),(t),(b))
7635 char *myname = "gconvert";
7638 #define Gconvert(x,n,t,b) gcvt((x),(n),(b))
7639 char *myname = "gcvt";
7642 #define Gconvert(x,n,t,b) qgcvt((x),(n),(b))
7643 char *myname = "qgcvt";
7644 #define DOUBLETYPE long double
7647 #if defined(USE_LONG_DOUBLE) && defined(HAS_LONG_DOUBLE) && defined(HAS_PRIgldbl)
7648 #define Gconvert(x,n,t,b) sprintf((b),"%.*"$sPRIgldbl,(n),(x))
7650 #define Gconvert(x,n,t,b) sprintf((b),"%.*g",(n),(x))
7652 char *myname = "sprintf";
7656 #if defined(USE_LONG_DOUBLE) && defined(HAS_LONG_DOUBLE)
7657 #define DOUBLETYPE long double
7659 #define DOUBLETYPE double
7665 #define I_STDLIB $i_stdlib
7671 checkit(expect, got)
7675 if (strcmp(expect, got)) {
7676 printf("%s oddity: Expected %s, got %s\n",
7677 myname, expect, got);
7687 /* This must be 1st test on (which?) platform */
7688 /* Alan Burlison <AlanBurlsin@unn.unisys.com> */
7689 Gconvert((DOUBLETYPE)0.1, 8, 0, buf);
7690 checkit("0.1", buf);
7692 Gconvert((DOUBLETYPE)1.0, 8, 0, buf);
7695 Gconvert((DOUBLETYPE)1.1, 8, 0, buf);
7696 checkit("1.1", buf);
7698 Gconvert((DOUBLETYPE)1.01, 8, 0, buf);
7699 checkit("1.01", buf);
7701 Gconvert((DOUBLETYPE)1.001, 8, 0, buf);
7702 checkit("1.001", buf);
7704 Gconvert((DOUBLETYPE)1.0001, 8, 0, buf);
7705 checkit("1.0001", buf);
7707 Gconvert((DOUBLETYPE)1.00001, 8, 0, buf);
7708 checkit("1.00001", buf);
7710 Gconvert((DOUBLETYPE)1.000001, 8, 0, buf);
7711 checkit("1.000001", buf);
7713 Gconvert((DOUBLETYPE)0.0, 8, 0, buf);
7716 Gconvert((DOUBLETYPE)-1.0, 8, 0, buf);
7719 /* Some Linux gcvt's give 1.e+5 here. */
7720 Gconvert((DOUBLETYPE)100000.0, 8, 0, buf);
7721 checkit("100000", buf);
7723 /* Some Linux gcvt's give -1.e+5 here. */
7724 Gconvert((DOUBLETYPE)-100000.0, 8, 0, buf);
7725 checkit("-100000", buf);
7727 Gconvert((DOUBLETYPE)123.456, 8, 0, buf);
7728 checkit("123.456", buf);
7733 case "$d_Gconvert" in
7734 gconvert*) xxx_list='gconvert gcvt sprintf' ;;
7735 gcvt*) xxx_list='gcvt gconvert sprintf' ;;
7736 sprintf*) xxx_list='sprintf gconvert gcvt' ;;
7737 *) xxx_list='gconvert gcvt sprintf' ;;
7740 case "$d_longdbl$uselongdouble$d_PRIgldbl" in
7741 "$define$define$define")
7742 # for long doubles prefer first qgcvt, then sprintf
7743 xxx_list="`echo $xxx_list|sed s/sprintf//`"
7744 xxx_list="sprintf $xxx_list"
7746 "$define") xxx_list="qgcvt $xxx_list" ;;
7751 for xxx_convert in $xxx_list; do
7752 echo "Trying $xxx_convert..."
7754 set try -DTRY_$xxx_convert
7755 if eval $compile; then
7756 echo "$xxx_convert() found." >&4
7758 echo "I'll use $xxx_convert to convert floats into a string." >&4
7761 echo "...But $xxx_convert didn't work as I expected."
7764 echo "$xxx_convert NOT found." >&4
7768 case "$xxx_convert" in
7769 gconvert) d_Gconvert='gconvert((x),(n),(t),(b))' ;;
7770 gcvt) d_Gconvert='gcvt((x),(n),(b))' ;;
7771 qgcvt) d_Gconvert='qgcvt((x),(n),(b))' ;;
7772 *) case "$uselongdouble$d_longdbl$d_PRIgldbl" in
7773 "$define$define$define")
7774 d_Gconvert="sprintf((b),\"%.*\"$sPRIgldbl,(n),(x))" ;;
7775 *) d_Gconvert='sprintf((b),"%.*g",(n),(x))' ;;
7780 : see if _fwalk exists
7784 : Initialize h_fcntl
7787 : Initialize h_sysfile
7790 : access call always available on UNIX
7794 : locate the flags for 'access()'
7798 $cat >access.c <<'EOCP'
7799 #include <sys/types.h>
7804 #include <sys/file.h>
7813 : check sys/file.h first, no particular reason here
7814 if $test `./findhdr sys/file.h` && \
7815 $cc -o access $cppflags -DI_SYS_FILE access.c >/dev/null 2>&1 ; then
7817 echo "<sys/file.h> defines the *_OK access constants." >&4
7818 elif $test `./findhdr fcntl.h` && \
7819 $cc -o access $cppflags -DI_FCNTL access.c >/dev/null 2>&1 ; then
7821 echo "<fcntl.h> defines the *_OK access constants." >&4
7822 elif $test `./findhdr unistd.h` && \
7823 $cc -o access $cppflags -DI_UNISTD access.c >/dev/null 2>&1 ; then
7824 echo "<unistd.h> defines the *_OK access constants." >&4
7826 echo "I can't find the four *_OK access constants--I'll use mine." >&4
7832 : see if accessx exists
7833 set accessx d_accessx
7836 : see if alarm exists
7840 : see if atolf exists
7844 : see if atoll exists
7848 : Look for GNU-cc style attribute checking
7850 echo "Checking whether your compiler can handle __attribute__ ..." >&4
7851 $cat >attrib.c <<'EOCP'
7853 void croak (char* pat,...) __attribute__((format(printf,1,2),noreturn));
7855 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
7856 if $contains 'warning' attrib.out >/dev/null 2>&1; then
7857 echo "Your C compiler doesn't fully support __attribute__."
7860 echo "Your C compiler supports __attribute__."
7864 echo "Your C compiler doesn't seem to understand __attribute__ at all."
7871 : see if bcmp exists
7875 : see if bcopy exists
7879 : see if this is a unistd.h system
7880 set unistd.h i_unistd
7883 : see if getpgrp exists
7884 set getpgrp d_getpgrp
7887 case "$d_getpgrp" in
7890 echo "Checking to see which flavor of getpgrp is in use..."
7893 #include <sys/types.h>
7895 # include <unistd.h>
7899 if (getuid() == 0) {
7900 printf("(I see you are running Configure as super-user...)\n");
7904 if (getpgrp(1) == 0)
7913 if $cc -o set -DTRY_BSD_PGRP $ccflags $ldflags set.c $libs >/dev/null 2>&1 && ./set; then
7914 echo "You have to use getpgrp(pid) instead of getpgrp()." >&4
7916 elif $cc -o set $ccflags $ldflags set.c $libs >/dev/null 2>&1 && ./set; then
7917 echo "You have to use getpgrp() instead of getpgrp(pid)." >&4
7920 echo "I can't seem to compile and run the test program."
7922 xxx="a USG one, i.e. you use getpgrp()."
7924 # SVR4 systems can appear rather BSD-ish.
7927 xxx="a BSD one, i.e. you use getpgrp(pid)."
7931 xxx="probably a USG one, i.e. you use getpgrp()."
7936 echo "Assuming your getpgrp is $xxx" >&4
7945 : see if setpgrp exists
7946 set setpgrp d_setpgrp
7949 case "$d_setpgrp" in
7952 echo "Checking to see which flavor of setpgrp is in use..."
7955 #include <sys/types.h>
7957 # include <unistd.h>
7961 if (getuid() == 0) {
7962 printf("(I see you are running Configure as super-user...)\n");
7966 if (-1 == setpgrp(1, 1))
7969 if (setpgrp() != -1)
7975 if $cc -o set -DTRY_BSD_PGRP $ccflags $ldflags set.c $libs >/dev/null 2>&1 && ./set; then
7976 echo 'You have to use setpgrp(pid,pgrp) instead of setpgrp().' >&4
7978 elif $cc -o set $ccflags $ldflags set.c $libs >/dev/null 2>&1 && ./set; then
7979 echo 'You have to use setpgrp() instead of setpgrp(pid,pgrp).' >&4
7982 echo "(I can't seem to compile and run the test program.)"
7984 xxx="a USG one, i.e. you use setpgrp()."
7986 # SVR4 systems can appear rather BSD-ish.
7989 xxx="a BSD one, i.e. you use setpgrp(pid,pgrp)."
7993 xxx="probably a USG one, i.e. you use setpgrp()."
7998 echo "Assuming your setpgrp is $xxx" >&4
8006 : see if bzero exists
8010 : see if signal is declared as pointer to function returning int or void
8012 xxx=`./findhdr signal.h`
8013 $test "$xxx" && $cppstdin $cppminus $cppflags < $xxx >$$.tmp 2>/dev/null
8014 if $contains 'int.*\*[ ]*signal' $$.tmp >/dev/null 2>&1 ; then
8015 echo "You have int (*signal())() instead of void." >&4
8017 elif $contains 'void.*\*[ ]*signal' $$.tmp >/dev/null 2>&1 ; then
8018 echo "You have void (*signal())()." >&4
8020 elif $contains 'extern[ ]*[(\*]*signal' $$.tmp >/dev/null 2>&1 ; then
8021 echo "You have int (*signal())() instead of void." >&4
8023 elif $contains 'void.*\*.*sig' $$.tmp >/dev/null 2>&1 ; then
8024 echo "You have void (*signal())()." >&4
8027 case "$d_voidsig" in
8029 echo "I can't determine whether signal handler returns void or int..." >&4
8031 rp="What type does your signal handler return?"
8038 echo "As you already told me, signal handler returns void." >&4
8041 *) echo "As you already told me, signal handler returns int." >&4
8048 case "$d_voidsig" in
8049 "$define") signal_t="void";;
8054 : check for ability to cast large floats to 32-bit ints.
8056 echo 'Checking whether your C compiler can cast large floats to int32.' >&4
8057 if $test "$intsize" -ge 4; then
8064 #include <sys/types.h>
8066 $signal_t blech(s) int s; { exit(3); }
8073 signal(SIGFPE, blech);
8075 /* Don't let compiler optimize the test away. Store the number
8076 in a writable string for gcc to pass to sscanf under HP/UX.
8078 sprintf(str, "2147483647");
8079 sscanf(str, "%lf", &f); /* f = (double) 0x7fffffff; */
8083 /* x86 processors will probably give 0x8000 0000, which is a
8084 sign change. We don't want that. We want to mimic SPARC
8085 behavior here, which is to preserve the sign and give
8088 if (i32 != ($xxx) f)
8094 if eval $compile_ok; then
8098 echo "(I can't seem to compile the test program--assuming it can't)"
8106 echo "Nope, it can't."
8113 : check for ability to cast negative floats to unsigned
8115 echo 'Checking whether your C compiler can cast negative float to unsigned.' >&4
8118 #include <sys/types.h>
8120 $signal_t blech(s) int s; { exit(7); }
8121 $signal_t blech_in_list(s) int s; { exit(4); }
8122 unsigned long dummy_long(p) unsigned long p; { return p; }
8123 unsigned int dummy_int(p) unsigned int p; { return p; }
8124 unsigned short dummy_short(p) unsigned short p; { return p; }
8128 unsigned long along;
8130 unsigned short ashort;
8134 /* Frustrate gcc-2.7.2's optimizer which failed this test with
8135 a direct f = -123. assignment. gcc-2.8.0 reportedly
8136 optimized the whole file away
8138 /* Store the number in a writable string for gcc to pass to
8141 sprintf(str, "-123");
8142 sscanf(str, "%lf", &f); /* f = -123.; */
8144 signal(SIGFPE, blech);
8145 along = (unsigned long)f;
8146 aint = (unsigned int)f;
8147 ashort = (unsigned short)f;
8148 if (along != (unsigned long)-123)
8150 if (aint != (unsigned int)-123)
8152 if (ashort != (unsigned short)-123)
8154 sprintf(str, "1073741824.");
8155 sscanf(str, "%lf", &f); /* f = (double)0x40000000; */
8158 along = (unsigned long)f;
8159 if (along != 0x80000000)
8163 along = (unsigned long)f;
8164 if (along != 0x7fffffff)
8168 along = (unsigned long)f;
8169 if (along != 0x80000001)
8173 signal(SIGFPE, blech_in_list);
8174 sprintf(str, "123.");
8175 sscanf(str, "%lf", &f); /* f = 123.; */
8176 along = dummy_long((unsigned long)f);
8177 aint = dummy_int((unsigned int)f);
8178 ashort = dummy_short((unsigned short)f);
8179 if (along != (unsigned long)123)
8181 if (aint != (unsigned int)123)
8183 if (ashort != (unsigned short)123)
8190 if eval $compile_ok; then
8194 echo "(I can't seem to compile the test program--assuming it can't)"
8197 case "$castflags" in
8202 echo "Nope, it can't."
8209 : see if vprintf exists
8211 if set vprintf val -f d_vprintf; eval $csym; $val; then
8212 echo 'vprintf() found.' >&4
8214 $cat >vprintf.c <<'EOF'
8215 #include <varargs.h>
8217 int main() { xxx("foo"); }
8226 exit((unsigned long)vsprintf(buf,"%s",args) > 10L);
8230 if eval $compile && ./vprintf; then
8231 echo "Your vsprintf() returns (int)." >&4
8234 echo "Your vsprintf() returns (char*)." >&4
8238 echo 'vprintf() NOT found.' >&4
8248 : see if chown exists
8252 : see if chroot exists
8256 : see if chsize exists
8260 : check for const keyword
8262 echo 'Checking to see if your C compiler knows about "const"...' >&4
8263 $cat >const.c <<'EOCP'
8264 typedef struct spug { int drokk; } spug;
8271 if $cc -c $ccflags const.c >/dev/null 2>&1 ; then
8273 echo "Yup, it does."
8276 echo "Nope, it doesn't."
8281 : see if crypt exists
8283 if set crypt val -f d_crypt; eval $csym; $val; then
8284 echo 'crypt() found.' >&4
8288 cryptlib=`./loc Slibcrypt$_a "" $xlibpth`
8289 if $test -z "$cryptlib"; then
8290 cryptlib=`./loc Mlibcrypt$_a "" $xlibpth`
8294 if $test -z "$cryptlib"; then
8295 cryptlib=`./loc Llibcrypt$_a "" $xlibpth`
8299 if $test -z "$cryptlib"; then
8300 cryptlib=`./loc libcrypt$_a "" $libpth`
8304 if $test -z "$cryptlib"; then
8305 echo 'crypt() NOT found.' >&4
8314 : get csh whereabouts
8316 'csh') val="$undef" ;;
8321 : Respect a hint or command line value for full_csh.
8323 '') full_csh=$csh ;;
8326 : see if cuserid exists
8327 set cuserid d_cuserid
8330 : see if this is a limits.h system
8331 set limits.h i_limits
8334 : see if this is a float.h system
8338 : See if number of significant digits in a double precision number is known
8340 $cat >dbl_dig.c <<EOM
8350 printf("Contains DBL_DIG");
8353 $cppstdin $cppflags $cppminus < dbl_dig.c >dbl_dig.E 2>/dev/null
8354 if $contains 'DBL_DIG' dbl_dig.E >/dev/null 2>&1; then
8355 echo "DBL_DIG found." >&4
8358 echo "DBL_DIG NOT found." >&4
8365 : see if difftime exists
8366 set difftime d_difftime
8369 : see if this is a dirent system
8371 if xinc=`./findhdr dirent.h`; $test "$xinc"; then
8373 echo "<dirent.h> found." >&4
8376 if xinc=`./findhdr sys/dir.h`; $test "$xinc"; then
8377 echo "<sys/dir.h> found." >&4
8380 xinc=`./findhdr sys/ndir.h`
8382 echo "<dirent.h> NOT found." >&4
8387 : Look for type of directory structure.
8389 $cppstdin $cppflags $cppminus < "$xinc" > try.c
8391 case "$direntrytype" in
8394 $define) guess1='struct dirent' ;;
8395 *) guess1='struct direct' ;;
8398 *) guess1="$direntrytype"
8403 'struct dirent') guess2='struct direct' ;;
8404 *) guess2='struct dirent' ;;
8407 if $contains "$guess1" try.c >/dev/null 2>&1; then
8408 direntrytype="$guess1"
8409 echo "Your directory entries are $direntrytype." >&4
8410 elif $contains "$guess2" try.c >/dev/null 2>&1; then
8411 direntrytype="$guess2"
8412 echo "Your directory entries seem to be $direntrytype." >&4
8414 echo "I don't recognize your system's directory entries." >&4
8415 rp="What type is used for directory entries on this system?"
8423 : see if the directory entry stores field length
8425 $cppstdin $cppflags $cppminus < "$xinc" > try.c
8426 if $contains 'd_namlen' try.c >/dev/null 2>&1; then
8427 echo "Good, your directory entry keeps length information in d_namlen." >&4
8430 echo "Your directory entry does not know about the d_namlen field." >&4
8437 : see if dlerror exists
8440 set dlerror d_dlerror
8444 : see if dlfcn is available
8452 On a few systems, the dynamically loaded modules that perl generates and uses
8453 will need a different extension than shared libs. The default will probably
8461 rp='What is the extension of dynamically loaded modules'
8470 : Check if dlsym need a leading underscore
8476 echo "Checking whether your dlsym() needs a leading underscore ..." >&4
8477 $cat >dyna.c <<'EOM'
8486 #include <dlfcn.h> /* the dynamic linker include file for Sunos/Solaris */
8488 #include <sys/types.h>
8502 int mode = RTLD_LAZY ;
8504 handle = dlopen("./dyna.$dlext", mode) ;
8505 if (handle == NULL) {
8510 symbol = dlsym(handle, "fred") ;
8511 if (symbol == NULL) {
8512 /* try putting a leading underscore */
8513 symbol = dlsym(handle, "_fred") ;
8514 if (symbol == NULL) {
8527 : Call the object file tmp-dyna.o in case dlext=o.
8528 if $cc $ccflags $cccdlflags -c dyna.c > /dev/null 2>&1 &&
8529 mv dyna${_o} tmp-dyna${_o} > /dev/null 2>&1 &&
8530 $ld -o dyna.$dlext $lddlflags tmp-dyna${_o} > /dev/null 2>&1 &&
8531 $cc -o fred $ccflags $ldflags $cccdlflags $ccdlflags fred.c $libs > /dev/null 2>&1; then
8534 1) echo "Test program failed using dlopen." >&4
8535 echo "Perhaps you should not use dynamic loading." >&4;;
8536 2) echo "Test program failed using dlsym." >&4
8537 echo "Perhaps you should not use dynamic loading." >&4;;
8538 3) echo "dlsym needs a leading underscore" >&4
8540 4) echo "dlsym doesn't need a leading underscore." >&4;;
8543 echo "I can't compile and run the test program." >&4
8544 echo "I'm guessing that dlsym doesn't need a leading underscore." >&4
8549 $rm -f fred fred.? dyna.$dlext dyna.? tmp-dyna.?
8554 hasproto='varname=$1; func=$2; shift; shift;
8555 while $test $# -ge 2; do
8557 $define) echo "#include <$2>";;
8561 $cppstdin $cppflags $cppminus < try.c > tryout.c 2>/dev/null;
8562 if $contains "$func.*(" tryout.c >/dev/null 2>&1; then
8563 echo "$func() prototype found.";
8566 echo "$func() prototype NOT found.";
8571 $rm -f try.c tryout.c'
8573 : see if prototype for drand48 is available
8575 set d_drand48proto drand48 $i_stdlib stdlib.h $i_unistd unistd.h
8578 : see if dup2 exists
8582 : see if eaccess exists
8583 set eaccess d_eaccess
8586 : see if endgrent exists
8587 set endgrent d_endgrent
8590 : see if endhostent exists
8591 set endhostent d_endhent
8594 : see if endnetent exists
8595 set endnetent d_endnent
8598 : see if endprotoent exists
8599 set endprotoent d_endpent
8602 : see if endpwent exists
8603 set endpwent d_endpwent
8606 : see if endservent exists
8607 set endservent d_endsent
8610 : Locate the flags for 'open()'
8612 $cat >open3.c <<'EOCP'
8613 #include <sys/types.h>
8618 #include <sys/file.h>
8629 : check sys/file.h first to get FREAD on Sun
8630 if $test `./findhdr sys/file.h` && \
8631 set open3 -DI_SYS_FILE && eval $compile; then
8633 echo "<sys/file.h> defines the O_* constants..." >&4
8635 echo "and you have the 3 argument form of open()." >&4
8638 echo "but not the 3 argument form of open(). Oh, well." >&4
8641 elif $test `./findhdr fcntl.h` && \
8642 set open3 -DI_FCNTL && eval $compile; then
8644 echo "<fcntl.h> defines the O_* constants..." >&4
8646 echo "and you have the 3 argument form of open()." >&4
8649 echo "but not the 3 argument form of open(). Oh, well." >&4
8654 echo "I can't find the O_* constant definitions! You got problems." >&4
8660 : see which of string.h or strings.h is needed
8662 strings=`./findhdr string.h`
8663 if $test "$strings" && $test -r "$strings"; then
8664 echo "Using <string.h> instead of <strings.h>." >&4
8668 strings=`./findhdr strings.h`
8669 if $test "$strings" && $test -r "$strings"; then
8670 echo "Using <strings.h> instead of <string.h>." >&4
8672 echo "No string header found -- You'll surely have problems." >&4
8678 "$undef") strings=`./findhdr strings.h`;;
8679 *) strings=`./findhdr string.h`;;
8682 : check for non-blocking I/O stuff
8683 case "$h_sysfile" in
8684 true) echo "#include <sys/file.h>" > head.c;;
8687 true) echo "#include <fcntl.h>" > head.c;;
8688 *) echo "#include <sys/fcntl.h>" > head.c;;
8693 echo "Figuring out the flag used by open() for non-blocking I/O..." >&4
8694 case "$o_nonblock" in
8697 $cat >>try.c <<'EOCP'
8701 printf("O_NONBLOCK\n");
8705 printf("O_NDELAY\n");
8709 printf("FNDELAY\n");
8716 if eval $compile_ok; then
8718 case "$o_nonblock" in
8719 '') echo "I can't figure it out, assuming O_NONBLOCK will do.";;
8720 *) echo "Seems like we can use $o_nonblock.";;
8723 echo "(I can't compile the test program; pray O_NONBLOCK is right!)"
8726 *) echo "Using $hint value $o_nonblock.";;
8728 $rm -f try try.* .out core
8731 echo "Let's see what value errno gets from read() on a $o_nonblock file..." >&4
8737 #include <sys/types.h>
8740 #define MY_O_NONBLOCK $o_nonblock
8741 #ifndef errno /* XXX need better Configure test */
8752 #include <strings.h>
8754 $signal_t blech(x) int x; { exit(3); }
8756 $cat >> try.c <<'EOCP'
8764 pipe(pd); /* Down: child -> parent */
8765 pipe(pu); /* Up: parent -> child */
8768 close(pd[1]); /* Parent reads from pd[0] */
8769 close(pu[0]); /* Parent writes (blocking) to pu[1] */
8770 if (-1 == fcntl(pd[0], F_SETFL, MY_O_NONBLOCK))
8772 signal(SIGALRM, blech);
8774 if ((ret = read(pd[0], buf, 1)) > 0) /* Nothing to read! */
8776 sprintf(string, "%d\n", ret);
8777 write(2, string, strlen(string));
8780 if (errno == EAGAIN) {
8786 if (errno == EWOULDBLOCK)
8787 printf("EWOULDBLOCK\n");
8790 write(pu[1], buf, 1); /* Unblocks child, tell it to close our pipe */
8791 sleep(2); /* Give it time to close our pipe */
8793 ret = read(pd[0], buf, 1); /* Should read EOF */
8795 sprintf(string, "%d\n", ret);
8796 write(3, string, strlen(string));
8800 close(pd[0]); /* We write to pd[1] */
8801 close(pu[1]); /* We read from pu[0] */
8802 read(pu[0], buf, 1); /* Wait for parent to signal us we may continue */
8803 close(pd[1]); /* Pipe pd is now fully closed! */
8804 exit(0); /* Bye bye, thank you for playing! */
8808 if eval $compile_ok; then
8809 echo "$startsh" >mtry
8810 echo "./try >try.out 2>try.ret 3>try.err || exit 4" >>mtry
8812 ./mtry >/dev/null 2>&1
8814 0) eagain=`$cat try.out`;;
8815 1) echo "Could not perform non-blocking setting!";;
8816 2) echo "I did a successful read() for something that was not there!";;
8817 3) echo "Hmm... non-blocking I/O does not seem to be working!";;
8818 *) echo "Something terribly wrong happened during testing.";;
8820 rd_nodata=`$cat try.ret`
8821 echo "A read() system call with no data present returns $rd_nodata."
8822 case "$rd_nodata" in
8825 echo "(That's peculiar, fixing that to be -1.)"
8831 echo "Forcing errno EAGAIN on read() with no data available."
8835 echo "Your read() sets errno to $eagain when no data is available."
8838 status=`$cat try.err`
8840 0) echo "And it correctly returns 0 to signal EOF.";;
8841 -1) echo "But it also returns -1 to signal EOF, so be careful!";;
8842 *) echo "However, your read() returns '$status' on EOF??";;
8845 if test "$status" = "$rd_nodata"; then
8846 echo "WARNING: you can't distinguish between EOF and no data!"
8850 echo "I can't compile the test program--assuming errno EAGAIN will do."
8857 echo "Using $hint value $eagain."
8858 echo "Your read() returns $rd_nodata when no data is present."
8859 case "$d_eofnblk" in
8860 "$define") echo "And you can see EOF because read() returns 0.";;
8861 "$undef") echo "But you can't see EOF status from read() returned value.";;
8863 echo "(Assuming you can't see EOF status from read anyway.)"
8869 $rm -f try try.* .out core head.c mtry
8871 : see if fchmod exists
8875 : see if fchown exists
8879 : see if this is an fcntl system
8884 : See if fcntl-based locking works.
8885 $cat >try.c <<'EOCP'
8890 #if defined(F_SETLK) && defined(F_SETLKW)
8893 fd = open("try.c", O_RDONLY);
8894 flock.l_type = F_RDLCK;
8895 flock.l_whence = SEEK_SET;
8896 flock.l_start = flock.l_len = 0;
8897 retval = fcntl(fd, F_SETLK, &flock);
8899 (retval < 0 ? exit(2) : exit(0));
8905 echo "Checking if fcntl-based file locking works... "
8909 if eval $compile_ok; then
8911 echo "Yes, it seems to work."
8914 echo "Nope, it didn't work."
8918 echo "I'm unable to compile the test program, so I'll assume not."
8923 echo "Nope, since you don't even have fcntl()."
8926 set d_fcntl_can_lock
8931 hasfield='varname=$1; struct=$2; field=$3; shift; shift; shift;
8932 while $test $# -ge 2; do
8934 $define) echo "#include <$2>";;
8938 echo "int main () { struct $struct foo; char* bar; bar = (char*)foo.$field; }" >> try.c;
8940 if eval $compile; then
8951 : see whether socket exists
8953 $echo $n "Hmm... $c" >&4
8954 if set socket val -f d_socket; eval $csym; $val; then
8955 echo "Looks like you have Berkeley networking support." >&4
8957 if set setsockopt val -f; eval $csym; $val; then
8960 echo "...but it uses the old BSD 4.1c interface, rather than 4.2." >&4
8964 if $contains socklib libc.list >/dev/null 2>&1; then
8965 echo "Looks like you have Berkeley networking support." >&4
8967 : we will have to assume that it supports the 4.2 BSD interface
8970 echo "You don't have Berkeley networking in libc$_a..." >&4
8971 if test "X$d_socket" = "X$define"; then
8972 echo "...but you seem to believe that you have sockets." >&4
8974 for net in net socket
8976 if test -f /usr/lib/lib$net$_a; then
8977 ( ($nm $nm_opt /usr/lib/lib$net$_a | eval $nm_extract) || \
8978 $ar t /usr/lib/lib$net$_a) 2>/dev/null >> libc.list
8979 if $contains socket libc.list >/dev/null 2>&1; then
8984 echo "...but the Wollongong group seems to have hacked it in." >&4
8985 sockethdr="-I/usr/netinclude"
8988 echo "Found Berkeley sockets interface in lib$net." >& 4
8989 if $contains setsockopt libc.list >/dev/null 2>&1; then
8992 echo "...using the old BSD 4.1c interface, rather than 4.2." >&4
8999 if test "X$d_socket" != "X$define"; then
9000 echo "or anywhere else I see." >&4
9008 : see if socketpair exists
9009 set socketpair d_sockpair
9014 echo "Checking the availability of certain socket constants..." >& 4
9015 for ENUM in MSG_CTRUNC MSG_DONTROUTE MSG_OOB MSG_PEEK MSG_PROXY SCM_RIGHTS; do
9016 enum=`$echo $ENUM|./tr '[A-Z]' '[a-z]'`
9018 #include <sys/types.h>
9019 #include <sys/socket.h>
9025 set try; if eval $compile; then
9028 set d_${enum}; eval $setvar
9032 : see if sys/select.h has to be included
9033 set sys/select.h i_sysselct
9036 : see if we should include time.h, sys/time.h, or both
9038 if test "X$timeincl" = X; then
9039 echo "Testing to see if we should include <time.h>, <sys/time.h> or both." >&4
9040 $echo $n "I'm now running the test program...$c"
9041 $cat >try.c <<'EOCP'
9042 #include <sys/types.h>
9047 #ifdef SYSTIMEKERNEL
9050 #include <sys/time.h>
9053 #include <sys/select.h>
9062 struct timezone tzp;
9064 if (foo.tm_sec == foo.tm_sec)
9067 if (bar.tv_sec == bar.tv_sec)
9074 for s_timezone in '-DS_TIMEZONE' ''; do
9076 for s_timeval in '-DS_TIMEVAL' ''; do
9077 for i_systimek in '' '-DSYSTIMEKERNEL'; do
9078 for i_time in '' '-DI_TIME'; do
9079 for i_systime in '-DI_SYSTIME' ''; do
9082 set try $i_time $i_systime $i_systimek $sysselect $s_timeval $s_timezone
9083 if eval $compile; then
9084 set X $i_time $i_systime $i_systimek $sysselect $s_timeval
9088 $echo $n "Succeeded with $flags$c"
9100 *SYSTIMEKERNEL*) i_systimek="$define"
9101 timeincl=`./findhdr sys/time.h`
9102 echo "We'll include <sys/time.h> with KERNEL defined." >&4;;
9103 *) i_systimek="$undef";;
9106 *I_TIME*) i_time="$define"
9107 timeincl=`./findhdr time.h`" $timeincl"
9108 echo "We'll include <time.h>." >&4;;
9109 *) i_time="$undef";;
9112 *I_SYSTIME*) i_systime="$define"
9113 timeincl=`./findhdr sys/time.h`" $timeincl"
9114 echo "We'll include <sys/time.h>." >&4;;
9115 *) i_systime="$undef";;
9120 : check for fd_set items
9123 Checking to see how well your C compiler handles fd_set and friends ...
9125 $cat >fd_set.c <<EOCP
9126 #$i_systime I_SYS_TIME
9127 #$i_sysselct I_SYS_SELECT
9128 #$d_socket HAS_SOCKET
9129 #include <sys/types.h>
9131 #include <sys/socket.h> /* Might include <sys/bsdtypes.h> */
9134 #include <sys/time.h>
9137 #include <sys/select.h>
9146 #if defined(FD_SET) && defined(FD_CLR) && defined(FD_ISSET) && defined(FD_ZERO)
9153 set fd_set -DTRYBITS
9154 if eval $compile; then
9155 d_fds_bits="$define"
9157 echo "Well, your system knows about the normal fd_set typedef..." >&4
9159 echo "and you have the normal fd_set macros (just as I'd expect)." >&4
9160 d_fd_macros="$define"
9163 but not the normal fd_set macros! Gaaack! I'll have to cover for you.
9165 d_fd_macros="$undef"
9169 Hmm, your compiler has some difficulty with fd_set. Checking further...
9172 if eval $compile; then
9175 echo "Well, your system has some sort of fd_set available..." >&4
9177 echo "and you have the normal fd_set macros." >&4
9178 d_fd_macros="$define"
9181 but not the normal fd_set macros! Gross! More work for me...
9183 d_fd_macros="$undef"
9186 echo "Well, you got zip. That's OK, I can roll my own fd_set stuff." >&4
9189 d_fd_macros="$undef"
9194 : see if fgetpos exists
9195 set fgetpos d_fgetpos
9198 : see if flock exists
9202 : see if fork exists
9206 : see if pathconf exists
9207 set pathconf d_pathconf
9210 : see if fpathconf exists
9211 set fpathconf d_fpathconf
9215 : check for fpos64_t
9217 echo "Checking to see if you have fpos64_t..." >&4
9220 int main() { fpos64_t x = 7; }
9223 if eval $compile; then
9225 echo "You have fpos64_t."
9228 echo "You do not have fpos64_t."
9230 8) echo "(Your fpos_t is 64 bits, so you could use that.)" ;;
9237 : see if frexpl exists
9241 hasstruct='varname=$1; struct=$2; shift; shift;
9242 while $test $# -ge 2; do
9244 $define) echo "#include <$2>";;
9248 echo "int main () { struct $struct foo; }" >> try.c;
9250 if eval $compile; then
9259 : see if this is a sys/param system
9260 set sys/param.h i_sysparam
9263 : see if this is a sys/mount.h system
9264 set sys/mount.h i_sysmount
9267 : see if sys/types.h has to be included
9268 set sys/types.h i_systypes
9273 echo "Checking to see if your system supports struct fs_data..." >&4
9274 set d_fs_data_s fs_data $i_systypes sys/types.h $i_sysparam sys/param.h $i_sysmount sys/mount.h
9276 case "$d_fs_data_s" in
9277 "$define") echo "Yes, it does." ;;
9278 *) echo "No, it doesn't." ;;
9281 : see if fseeko exists
9285 8) echo "(Your long is 64 bits, so you could use fseek.)" ;;
9288 : see if fsetpos exists
9289 set fsetpos d_fsetpos
9293 : see if fstatfs exists
9294 set fstatfs d_fstatfs
9298 : see if statvfs exists
9299 set statvfs d_statvfs
9302 : see if fstatvfs exists
9303 set fstatvfs d_fstatvfs
9307 : see if fsync exists
9311 : see if ftello exists
9315 8) echo "(Your long is 64 bits, so you could use ftell.)" ;;
9318 : see if getcwd exists
9322 : see if getespwnam exists
9323 set getespwnam d_getespwnam
9327 : see if getfsstat exists
9328 set getfsstat d_getfsstat
9331 : see if getgrent exists
9332 set getgrent d_getgrent
9335 : see if gethostbyaddr exists
9336 set gethostbyaddr d_gethbyaddr
9339 : see if gethostbyname exists
9340 set gethostbyname d_gethbyname
9343 : see if gethostent exists
9344 set gethostent d_gethent
9347 : see how we will look up host name
9350 if set gethostname val -f d_gethname; eval $csym; $val; then
9351 echo 'gethostname() found.' >&4
9352 d_gethname="$define"
9355 if set uname val -f d_uname; eval $csym; $val; then
9358 uname() was found, but you're running xenix, and older versions of xenix
9359 have a broken uname(). If you don't really know whether your xenix is old
9360 enough to have a broken system call, use the default answer.
9367 rp='Is your uname() broken?'
9370 n*) d_uname="$define"; call=uname;;
9373 echo 'uname() found.' >&4
9380 case "$d_gethname" in
9381 '') d_gethname="$undef";;
9384 '') d_uname="$undef";;
9386 case "$d_uname$d_gethname" in
9391 Every now and then someone has a $call() that lies about the hostname
9392 but can't be fixed for political or economic reasons. If you wish, I can
9393 pretend $call() isn't there and maybe compute hostname at run-time
9394 thanks to the '$phostname' command.
9397 rp="Shall I ignore $call() from now on?"
9400 y*) d_uname="$undef" d_gethname="$undef"; $echo $n "Okay...$c";;
9403 case "$phostname" in
9405 *) case "$aphostname" in
9411 file=`./loc $file $file $pth`
9412 aphostname=`echo $file $*`
9417 case "$d_uname$d_gethname" in
9420 case "$phostname" in
9422 echo "There will be no way for $package to get your hostname." >&4;;
9424 echo "I'll use 'popen("'"'$aphostname'", "r")'"' to get your hostname." >&4
9428 case "$d_phostname" in
9429 '') d_phostname="$undef";;
9432 : see if this is a netdb.h system
9436 : see if prototypes for various gethostxxx netdb.h functions are available
9438 set d_gethostprotos gethostent $i_netdb netdb.h
9441 : see if getlogin exists
9442 set getlogin d_getlogin
9445 : see if getmnt exists
9449 : see if getmntent exists
9450 set getmntent d_getmntent
9453 : see if getnetbyaddr exists
9454 set getnetbyaddr d_getnbyaddr
9457 : see if getnetbyname exists
9458 set getnetbyname d_getnbyname
9461 : see if getnetent exists
9462 set getnetent d_getnent
9465 : see if prototypes for various getnetxxx netdb.h functions are available
9467 set d_getnetprotos getnetent $i_netdb netdb.h
9470 : see if getpagesize exists
9471 set getpagesize d_getpagsz
9475 : see if getprotobyname exists
9476 set getprotobyname d_getpbyname
9479 : see if getprotobynumber exists
9480 set getprotobynumber d_getpbynumber
9483 : see if getprotoent exists
9484 set getprotoent d_getpent
9487 : see if getpgid exists
9488 set getpgid d_getpgid
9491 : see if getpgrp2 exists
9492 set getpgrp2 d_getpgrp2
9495 : see if getppid exists
9496 set getppid d_getppid
9499 : see if getpriority exists
9500 set getpriority d_getprior
9503 : see if prototypes for various getprotoxxx netdb.h functions are available
9505 set d_getprotoprotos getprotoent $i_netdb netdb.h
9508 : see if getprpwnam exists
9509 set getprpwnam d_getprpwnam
9512 : see if getpwent exists
9513 set getpwent d_getpwent
9517 : see if getservbyname exists
9518 set getservbyname d_getsbyname
9521 : see if getservbyport exists
9522 set getservbyport d_getsbyport
9525 : see if getservent exists
9526 set getservent d_getsent
9529 : see if prototypes for various getservxxx netdb.h functions are available
9531 set d_getservprotos getservent $i_netdb netdb.h
9534 : see if getspnam exists
9535 set getspnam d_getspnam
9538 : see if gettimeofday or ftime exists
9539 set gettimeofday d_gettimeod
9541 case "$d_gettimeod" in
9547 val="$undef"; set d_ftime; eval $setvar
9550 case "$d_gettimeod$d_ftime" in
9553 echo 'No ftime() nor gettimeofday() -- timing may be less accurate.' >&4
9557 : see if this is an grp system
9563 xxx=`./findhdr grp.h`
9564 $cppstdin $cppflags $cppminus < $xxx >$$.h
9566 if $contains 'gr_passwd' $$.h >/dev/null 2>&1; then
9578 set d_grpasswd; eval $setvar
9582 : see if hasmntopt exists
9583 set hasmntopt d_hasmntopt
9586 : see if this is a netinet/in.h or sys/in.h system
9587 set netinet/in.h i_niin sys/in.h i_sysin
9590 : see if arpa/inet.h has to be included
9591 set arpa/inet.h i_arpainet
9594 : see if htonl --and friends-- exists
9599 : Maybe they are macros.
9604 #include <sys/types.h>
9605 #$i_niin I_NETINET_IN
9607 #$i_arpainet I_ARPA_INET
9609 #include <netinet/in.h>
9615 #include <arpa/inet.h>
9618 printf("Defined as a macro.");
9621 $cppstdin $cppflags $cppminus < htonl.c >htonl.E 2>/dev/null
9622 if $contains 'Defined as a macro' htonl.E >/dev/null 2>&1; then
9624 echo "But it seems to be defined as a macro." >&4
9632 : see if iconv exists
9638 if set index val -f; eval $csym; $val; then
9639 if set strchr val -f d_strchr; eval $csym; $val; then
9640 if $contains strchr "$strings" >/dev/null 2>&1 ; then
9643 echo "strchr() found." >&4
9647 echo "index() found." >&4
9652 echo "index() found." >&4
9655 if set strchr val -f d_strchr; eval $csym; $val; then
9658 echo "strchr() found." >&4
9660 echo "No index() or strchr() found!" >&4
9665 set d_strchr; eval $setvar
9667 set d_index; eval $setvar
9669 : check whether inet_aton exists
9670 set inet_aton d_inetaton
9673 : see if inttypes.h is available
9674 : we want a real compile instead of Inhdr because some systems
9675 : have an inttypes.h which includes non-existent headers
9678 #include <inttypes.h>
9680 static int32_t foo32 = 0x12345678;
9684 if eval $compile; then
9685 echo "<inttypes.h> found." >&4
9688 echo "<inttypes.h> NOT found." >&4
9697 echo "Checking to see if you have int64_t..." >&4
9699 #include <sys/types.h>
9700 #$i_inttypes I_INTTYPES
9702 #include <inttypes.h>
9704 int main() { int64_t x = 7; }
9707 if eval $compile; then
9709 echo "You have int64_t."
9712 echo "You do not have int64_t."
9720 $cat >isascii.c <<'EOCP'
9732 if eval $compile; then
9733 echo "isascii() found." >&4
9736 echo "isascii() NOT found." >&4
9743 : see if isnan exists
9747 : see if isnanl exists
9751 : see if killpg exists
9755 : see if lchown exists
9757 $cat > try.c <<'EOCP'
9758 /* System header to define __stub macros and hopefully few prototypes,
9759 which can conflict with char lchown(); below. */
9761 /* Override any gcc2 internal prototype to avoid an error. */
9762 /* We use char because int might match the return type of a gcc2
9763 builtin and then its argument prototype would still apply. */
9766 /* The GNU C library defines this for functions which it implements
9767 to always fail with ENOSYS. Some functions are actually named
9768 something starting with __ and the normal name is an alias. */
9769 #if defined (__stub_lchown) || defined (__stub___lchown)
9777 if eval $compile; then
9778 $echo "lchown() found." >&4
9781 $echo "lchown() NOT found." >&4
9787 : See if number of significant digits in a double precision number is known
9789 $cat >ldbl_dig.c <<EOM
9799 printf("Contains LDBL_DIG");
9802 $cppstdin $cppflags $cppminus < ldbl_dig.c >ldbl_dig.E 2>/dev/null
9803 if $contains 'LDBL_DIG' ldbl_dig.E >/dev/null 2>&1; then
9804 echo "LDBL_DIG found." >&4
9807 echo "LDBL_DIG NOT found." >&4
9814 : see if link exists
9818 : see if localeconv exists
9819 set localeconv d_locconv
9822 : see if lockf exists
9826 : check for long long
9828 echo "Checking to see if you have long long..." >&4
9829 echo 'int main() { long long x = 7; return 0; }' > try.c
9831 if eval $compile; then
9833 echo "You have long long."
9836 echo "You do not have long long."
9842 : check for length of long long
9843 case "${d_longlong}${longlongsize}" in
9846 echo "Checking to see how big your long longs are..." >&4
9847 $cat >try.c <<'EOCP'
9851 printf("%d\n", (int)sizeof(long long));
9856 if eval $compile_ok; then
9857 longlongsize=`./try$exe_ext`
9858 echo "Your long longs are $longlongsize bytes long."
9862 echo "(I can't seem to compile the test program. Guessing...)"
9863 rp="What is the size of a long long (in bytes)?"
9867 if $test "X$longsize" = "X$longlongsize"; then
9868 echo "(That isn't any different from an ordinary long.)"
9874 : see if prototype for lseek is available
9876 set d_lseekproto lseek $i_systypes sys/types.h $i_unistd unistd.h
9879 : see if lstat exists
9883 : see if madvise exists
9884 set madvise d_madvise
9887 : see if mblen exists
9891 : see if mbstowcs exists
9892 set mbstowcs d_mbstowcs
9895 : see if mbtowc exists
9899 : see if memchr exists
9903 : see if memcmp exists
9907 : see if memcpy exists
9911 : see if memmove exists
9912 set memmove d_memmove
9915 : see if memset exists
9919 : see if mkdir exists
9923 : see if mkdtemp exists
9924 set mkdtemp d_mkdtemp
9927 : see if mkfifo exists
9931 : see if mkstemp exists
9932 set mkstemp d_mkstemp
9935 : see if mkstemps exists
9936 set mkstemps d_mkstemps
9939 : see if mktime exists
9943 : see if this is a sys/mman.h system
9944 set sys/mman.h i_sysmman
9947 : see if mmap exists
9950 : see what shmat returns
9951 : default to something harmless
9953 case "$i_sysmman$d_mmap" in
9955 $cat >mmap.c <<'END'
9956 #include <sys/mman.h>
9959 if $cc $ccflags -c mmap.c >/dev/null 2>&1; then
9964 echo "and it returns ($mmaptype)." >&4
9970 : see if modfl exists
9974 : see if mprotect exists
9975 set mprotect d_mprotect
9978 : see if msgctl exists
9982 : see if msgget exists
9986 : see if msgsnd exists
9990 : see if msgrcv exists
9994 : see how much of the 'msg*(2)' library is present.
9997 case "$d_msgctl$d_msgget$d_msgsnd$d_msgrcv" in
9998 *"$undef"*) h_msg=false;;
10002 case "`ipcs 2>&1`" in
10003 "SVID messages"*"not configured"*)
10004 echo "Your $osname does not have the msg*(2) configured." >&4
10007 set msgctl d_msgctl
10009 set msgget d_msgget
10011 set msgsnd d_msgsnd
10013 set msgrcv d_msgrcv
10019 : we could also check for sys/ipc.h ...
10020 if $h_msg && $test `./findhdr sys/msg.h`; then
10021 echo "You have the full msg*(2) library." >&4
10024 echo "You don't have the full msg*(2) library." >&4
10030 : see if msync exists
10034 : see if munmap exists
10035 set munmap d_munmap
10038 : see if nice exists
10044 echo "Checking which 64-bit integer type we could use..." >&4
10050 val='"unsigned int"'
10055 *) case "$longsize" in
10059 val='"unsigned long"'
10064 *) case "$d_longlong:$longlongsize" in
10069 val='"unsigned long long"'
10074 *) case "$d_int64_t" in
10092 case "$quadtype" in
10093 '') echo "Alas, no 64-bit integer types in sight." >&4
10096 *) if test X"$use64bitint" = Xdefine -o X"$longsize" = X8; then
10101 echo "We $verb use '$quadtype' for 64-bit integers." >&4
10106 : check for length of character
10108 case "$charsize" in
10110 echo "Checking to see how big your characters are (hey, you never know)..." >&4
10111 $cat >try.c <<'EOCP'
10115 printf("%d\n", (int)sizeof(char));
10120 if eval $compile_ok; then
10124 echo "(I can't seem to compile the test program. Guessing...)"
10131 rp="What is the size of a character (in bytes)?"
10136 : check for volatile keyword
10138 echo 'Checking to see if your C compiler knows about "volatile"...' >&4
10139 $cat >try.c <<'EOCP'
10142 typedef struct _goo_struct goo_struct;
10143 goo_struct * volatile goo = ((goo_struct *)0);
10144 struct _goo_struct {
10149 typedef unsigned short foo_t;
10150 char *volatile foo;
10152 volatile foo_t blech;
10156 if $cc -c $ccflags try.c >/dev/null 2>&1 ; then
10158 echo "Yup, it does."
10161 echo "Nope, it doesn't."
10169 $echo "Choosing the C types to be used for Perl's internal types..." >&4
10171 case "$use64bitint:$d_quad:$quadtype" in
10174 uvtype="$uquadtype"
10179 uvtype="unsigned long"
10185 case "$uselongdouble:$d_longdbl" in
10187 nvtype="long double"
10188 nvsize=$longdblsize
10195 $echo "(IV will be "$ivtype", $ivsize bytes)"
10196 $echo "(UV will be "$uvtype", $uvsize bytes)"
10197 $echo "(NV will be "$nvtype", $nvsize bytes)"
10200 #$i_inttypes I_INTTYPES
10202 #include <inttypes.h>
10207 int8_t i = INT8_MAX;
10208 uint8_t u = UINT8_MAX;
10209 printf("int8_t\n");
10212 int16_t i = INT16_MAX;
10213 uint16_t i = UINT16_MAX;
10214 printf("int16_t\n");
10217 int32_t i = INT32_MAX;
10218 uint32_t u = UINT32_MAX;
10219 printf("int32_t\n");
10225 '') case "$charsize" in
10227 u8type="unsigned char"
10236 if eval $compile; then
10237 case "`./try$exe_ext`" in
10238 int8_t) i8type=int8_t
10248 '') if $test $charsize -ge 1; then
10250 u8type="unsigned char"
10258 '') case "$shortsize" in
10260 u16type="unsigned short"
10268 '') set try -DINT16
10269 if eval $compile; then
10270 case "`./try$exe_ext`" in
10282 '') if $test $shortsize -ge 2; then
10284 u16type="unsigned short"
10292 '') case "$longsize" in
10294 u32type="unsigned long"
10298 *) case "$intsize" in
10300 u32type="unsigned int"
10310 '') set try -DINT32
10311 if eval $compile; then
10312 case "`./try$exe_ext`" in
10324 '') if $test $intsize -ge 4; then
10326 u32type="unsigned int"
10334 '') case "$d_quad:$quadtype" in
10336 i64type="$quadtype"
10337 u64type="$uquadtype"
10345 $echo "Checking how many bits of your UVs your NVs can preserve..." >&4
10346 : volatile so that the compiler has to store it out to memory.
10347 if test X"$d_volatile" = X"$define"; then
10352 #include <sys/types.h>
10353 #include <signal.h>
10355 $volatile int bletched = 0;
10356 $signal_t blech(s) int s; { bletched = 1; }
10361 int n = 8 * $uvsize;
10364 signal(SIGFPE, blech);
10367 for (i = 0; i < n; i++) {
10368 u = u << 1 | ($uvtype)1;
10370 if (($uvtype)d != u)
10374 d = ($nvtype)(u - 1);
10375 if (($uvtype)d != (u - 1))
10383 printf("%d\n", ((i == n) ? -n : i));
10389 d_nv_preserves_uv="$undef"
10390 if eval $compile; then
10391 d_nv_preserves_uv_bits="`./try$exe_ext`"
10393 case "$d_nv_preserves_uv_bits" in
10395 d_nv_preserves_uv_bits=`expr 0 - $d_nv_preserves_uv_bits`
10396 $echo "Your NVs can preserve all $d_nv_preserves_uv_bits bits of your UVs." 2>&1
10397 d_nv_preserves_uv="$define"
10399 [1-9]*) $echo "Your NVs can preserve only $d_nv_preserves_uv_bits bits of your UVs." 2>&1
10400 d_nv_preserves_uv="$undef" ;;
10401 *) $echo "Can't figure out how many bits your NVs preserve." 2>&1
10402 d_nv_preserves_uv_bits="$undef" ;;
10408 : check for off64_t
10410 echo "Checking to see if you have off64_t..." >&4
10412 #include <sys/types.h>
10413 #include <unistd.h>
10414 int main() { off64_t x = 7; }
10417 if eval $compile; then
10419 echo "You have off64_t."
10422 echo "You do not have off64_t."
10423 case "$lseeksize" in
10424 8) echo "(Your off_t is 64 bits, so you could use that.)" ;;
10431 : see if POSIX threads are available
10432 set pthread.h i_pthread
10438 : how to create joinable pthreads
10439 if test "X$usethreads" = "X$define" -a "X$i_pthread" = "X$define"; then
10441 echo "Checking what constant to use for creating joinable pthreads..." >&4
10442 $cat >try.c <<'EOCP'
10443 #include <pthread.h>
10445 int detachstate = JOINABLE;
10448 set try -DJOINABLE=PTHREAD_CREATE_JOINABLE
10449 if eval $compile; then
10450 echo "You seem to use PTHREAD_CREATE_JOINABLE." >&4
10451 val="$undef" # Yes, undef.
10452 set d_old_pthread_create_joinable
10455 set old_pthread_create_joinable
10458 set try -DJOINABLE=PTHREAD_CREATE_UNDETACHED
10459 if eval $compile; then
10460 echo "You seem to use PTHREAD_CREATE_UNDETACHED." >&4
10462 set d_old_pthread_create_joinable
10464 val=PTHREAD_CREATE_UNDETACHED
10465 set old_pthread_create_joinable
10468 set try -DJOINABLE=__UNDETACHED
10469 if eval $compile; then
10470 echo "You seem to use __UNDETACHED." >&4
10472 set d_old_pthread_create_joinable
10475 set old_pthread_create_joinable
10478 echo "Egads, nothing obvious found. Guessing that you use 0." >&4
10480 set d_old_pthread_create_joinable
10483 set old_pthread_create_joinable
10490 d_old_pthread_create_joinable="$undef"
10491 old_pthread_create_joinable=""
10494 : see if pause exists
10498 : see if pipe exists
10502 : see if poll exists
10507 : see whether the various POSIXish _yields exist
10509 #include <pthread.h>
10515 #ifdef PTHREAD_YIELD
10518 #ifdef PTHREAD_YIELD_NULL
10519 pthread_yield(NULL);
10525 : see if sched_yield exists
10526 set try -DSCHED_YIELD
10527 if eval $compile; then
10529 sched_yield='sched_yield()'
10533 case "$usethreads" in
10536 $define) echo 'sched_yield() found.' >&4 ;;
10537 *) echo 'sched_yield() NOT found.' >&4 ;;
10543 : see if pthread_yield exists
10544 set try -DPTHREAD_YIELD
10545 if eval $compile; then
10547 case "$sched_yield" in
10548 '') sched_yield='pthread_yield()' ;;
10551 set try -DPTHREAD_YIELD_NULL
10552 if eval $compile; then
10554 case "$sched_yield" in
10555 '') sched_yield='pthread_yield(NULL)' ;;
10561 case "$usethreads" in
10564 $define) echo 'pthread_yield() found.' >&4 ;;
10565 *) echo 'pthread_yield() NOT found.' >&4 ;;
10569 set d_pthread_yield
10572 case "$sched_yield" in
10573 '') sched_yield=undef ;;
10578 : see if this is a pwd.h system
10584 xxx=`./findhdr pwd.h`
10585 $cppstdin $cppflags $cppminus < $xxx >$$.h
10587 if $contains 'pw_quota' $$.h >/dev/null 2>&1; then
10595 if $contains 'pw_age' $$.h >/dev/null 2>&1; then
10603 if $contains 'pw_change' $$.h >/dev/null 2>&1; then
10611 if $contains 'pw_class' $$.h >/dev/null 2>&1; then
10619 if $contains 'pw_expire' $$.h >/dev/null 2>&1; then
10627 if $contains 'pw_comment' $$.h >/dev/null 2>&1; then
10635 if $contains 'pw_gecos' $$.h >/dev/null 2>&1; then
10643 if $contains 'pw_passwd' $$.h >/dev/null 2>&1; then
10655 set d_pwquota; eval $setvar
10656 set d_pwage; eval $setvar
10657 set d_pwchange; eval $setvar
10658 set d_pwclass; eval $setvar
10659 set d_pwexpire; eval $setvar
10660 set d_pwcomment; eval $setvar
10661 set d_pwgecos; eval $setvar
10662 set d_pwpasswd; eval $setvar
10666 : see if readdir and friends exist
10667 set readdir d_readdir
10669 set seekdir d_seekdir
10671 set telldir d_telldir
10673 set rewinddir d_rewinddir
10676 : see if readlink exists
10677 set readlink d_readlink
10680 : see if rename exists
10681 set rename d_rename
10684 : see if rmdir exists
10688 : see if memory.h is available.
10693 : See if it conflicts with string.h
10699 $cppstdin $cppflags $cppminus < $strings > mem.h
10700 if $contains 'memcpy' mem.h >/dev/null 2>&1; then
10702 echo "We won't be including <memory.h>."
10712 : can bcopy handle overlapping blocks?
10717 echo "Checking to see if your bcopy() can do overlapping copies..." >&4
10719 #$i_memory I_MEMORY
10720 #$i_stdlib I_STDLIB
10721 #$i_string I_STRING
10722 #$i_unistd I_UNISTD
10724 $cat >>try.c <<'EOCP'
10727 # include <memory.h>
10730 # include <stdlib.h>
10733 # include <string.h>
10735 # include <strings.h>
10738 # include <unistd.h> /* Needed for NetBSD */
10742 char buf[128], abc[128];
10748 bcopy("abcdefghijklmnopqrstuvwxyz0123456789", abc, 36);
10750 for (align = 7; align >= 0; align--) {
10751 for (len = 36; len; len--) {
10753 bcopy(abc, b, len);
10754 for (off = 1; off <= len; off++) {
10755 bcopy(b, b+off, len);
10756 bcopy(b+off, b, len);
10757 if (bcmp(b, abc, len))
10766 if eval $compile_ok; then
10767 if ./try 2>/dev/null; then
10768 echo "Yes, it can."
10771 echo "It can't, sorry."
10772 case "$d_memmove" in
10773 "$define") echo "But that's Ok since you have memmove()." ;;
10777 echo "(I can't compile the test program, so we'll assume not...)"
10778 case "$d_memmove" in
10779 "$define") echo "But that's Ok since you have memmove()." ;;
10784 $rm -f try.* try core
10788 : can memcpy handle overlapping blocks?
10790 case "$d_memcpy" in
10793 echo "Checking to see if your memcpy() can do overlapping copies..." >&4
10795 #$i_memory I_MEMORY
10796 #$i_stdlib I_STDLIB
10797 #$i_string I_STRING
10798 #$i_unistd I_UNISTD
10800 $cat >>try.c <<'EOCP'
10803 # include <memory.h>
10806 # include <stdlib.h>
10809 # include <string.h>
10811 # include <strings.h>
10814 # include <unistd.h> /* Needed for NetBSD */
10818 char buf[128], abc[128];
10824 /* Copy "abcde..." string to char abc[] so that gcc doesn't
10825 try to store the string in read-only memory. */
10826 memcpy(abc, "abcdefghijklmnopqrstuvwxyz0123456789", 36);
10828 for (align = 7; align >= 0; align--) {
10829 for (len = 36; len; len--) {
10831 memcpy(b, abc, len);
10832 for (off = 1; off <= len; off++) {
10833 memcpy(b+off, b, len);
10834 memcpy(b, b+off, len);
10835 if (memcmp(b, abc, len))
10844 if eval $compile_ok; then
10845 if ./try 2>/dev/null; then
10846 echo "Yes, it can."
10849 echo "It can't, sorry."
10850 case "$d_memmove" in
10851 "$define") echo "But that's Ok since you have memmove()." ;;
10855 echo "(I can't compile the test program, so we'll assume not...)"
10856 case "$d_memmove" in
10857 "$define") echo "But that's Ok since you have memmove()." ;;
10862 $rm -f try.* try core
10866 : can memcmp be trusted to compare relative magnitude?
10868 case "$d_memcmp" in
10871 echo "Checking if your memcmp() can compare relative magnitude..." >&4
10873 #$i_memory I_MEMORY
10874 #$i_stdlib I_STDLIB
10875 #$i_string I_STRING
10876 #$i_unistd I_UNISTD
10878 $cat >>try.c <<'EOCP'
10881 # include <memory.h>
10884 # include <stdlib.h>
10887 # include <string.h>
10889 # include <strings.h>
10892 # include <unistd.h> /* Needed for NetBSD */
10898 if ((a < b) && memcmp(&a, &b, 1) < 0)
10904 if eval $compile_ok; then
10905 if ./try 2>/dev/null; then
10906 echo "Yes, it can."
10909 echo "No, it can't (it uses signed chars)."
10912 echo "(I can't compile the test program, so we'll assume not...)"
10916 $rm -f try.* try core
10920 : see if prototype for sbrk is available
10922 set d_sbrkproto sbrk $i_unistd unistd.h
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 case "$useperlio" in
11272 echo "For sfio also the PerlIO abstraction layer is needed."
11273 echo "Earlier you said you wouldn't want that."
11276 rp="You seem to have sfio available, do you want to try using it?"
11279 y|Y) echo "Ok, turning on both sfio and PerlIO, then."
11280 useperlio="$define"
11283 *) echo "Ok, avoiding sfio this time. I'll use stdio instead."
11285 : Remove sfio from list of libraries to use
11286 set `echo X $libs | $sed -e 's/-lsfio / /' -e 's/-lsfio$//'`
11289 echo "libs = $libs" >&4
11293 *) case "$usesfio" in
11294 true|$define|[yY]*)
11295 echo "Sorry, cannot find sfio on this machine." >&4
11296 echo "Ignoring your setting of usesfio=$usesfio." >&4
11305 $define) usesfio='true';;
11306 *) usesfio='false';;
11309 : see if shmctl exists
11310 set shmctl d_shmctl
11313 : see if shmget exists
11314 set shmget d_shmget
11317 : see if shmat exists
11320 : see what shmat returns
11323 $cat >shmat.c <<'END'
11324 #include <sys/shm.h>
11327 if $cc $ccflags -c shmat.c >/dev/null 2>&1; then
11332 echo "and it returns ($shmattype)." >&4
11333 : see if a prototype for shmat is available
11334 xxx=`./findhdr sys/shm.h`
11335 $cppstdin $cppflags $cppminus < $xxx > shmat.c 2>/dev/null
11336 if $contains 'shmat.*(' shmat.c >/dev/null 2>&1; then
11347 set d_shmatprototype
11350 : see if shmdt exists
11354 : see how much of the 'shm*(2)' library is present.
11357 case "$d_shmctl$d_shmget$d_shmat$d_shmdt" in
11358 *"$undef"*) h_shm=false;;
11362 case "`ipcs 2>&1`" in
11363 "SVID shared memory"*"not configured"*)
11364 echo "Your $osname does not have the shm*(2) configured." >&4
11367 set shmctl d_shmctl
11369 set shmget d_shmget
11379 : we could also check for sys/ipc.h ...
11380 if $h_shm && $test `./findhdr sys/shm.h`; then
11381 echo "You have the full shm*(2) library." >&4
11384 echo "You don't have the full shm*(2) library." >&4
11391 : see if we have sigaction
11392 if set sigaction val -f d_sigaction; eval $csym; $val; then
11393 echo 'sigaction() found.' >&4
11394 $cat > try.c <<'EOP'
11396 #include <sys/types.h>
11397 #include <signal.h>
11400 struct sigaction act, oact;
11402 oact.sa_handler = 0;
11403 /* so that act and oact are used */
11404 exit(act.sa_flags == 0 && oact.sa_handler == 0);
11408 if eval $compile_ok; then
11411 echo "But you don't seem to have a useable struct sigaction." >&4
11415 echo 'sigaction NOT found.' >&4
11418 set d_sigaction; eval $setvar
11419 $rm -f try try$_o try.c
11421 : see if sigsetjmp exists
11423 case "$d_sigsetjmp" in
11425 $cat >try.c <<'EOP'
11426 #include <setjmp.h>
11431 if (sigsetjmp(env,1))
11434 siglongjmp(env, 1);
11439 if eval $compile; then
11440 if ./try >/dev/null 2>&1; then
11441 echo "POSIX sigsetjmp found." >&4
11445 Uh-Oh! You have POSIX sigsetjmp and siglongjmp, but they do not work properly!!
11451 echo "sigsetjmp not found." >&4
11455 *) val="$d_sigsetjmp"
11456 case "$d_sigsetjmp" in
11457 $define) echo "POSIX sigsetjmp found." >&4;;
11458 $undef) echo "sigsetjmp not found." >&4;;
11466 : see if socks5_init exists
11467 set socks5_init d_socks5_init
11470 : see if sys/stat.h is available
11471 set sys/stat.h i_sysstat
11475 : see if stat knows about block sizes
11477 echo "Checking to see if your struct stat has st_blocks field..." >&4
11478 set d_statblks stat st_blocks $i_sysstat sys/stat.h
11482 : see if this is a sys/vfs.h system
11483 set sys/vfs.h i_sysvfs
11487 : see if this is a sys/statfs.h system
11488 set sys/statfs.h i_sysstatfs
11493 echo "Checking to see if your system supports struct statfs..." >&4
11494 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
11496 case "$d_statfs_s" in
11497 "$define") echo "Yes, it does." ;;
11498 *) echo "No, it doesn't." ;;
11503 : see if struct statfs knows about f_flags
11504 case "$d_statfs_s" in
11507 echo "Checking to see if your struct statfs has f_flags field..." >&4
11508 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
11512 set d_statfs_f_flags
11516 case "$d_statfs_f_flags" in
11517 "$define") echo "Yes, it does." ;;
11518 *) echo "No, it doesn't." ;;
11521 : see if _ptr and _cnt from stdio act std
11524 if $contains '_lbfsize' `./findhdr stdio.h` >/dev/null 2>&1 ; then
11525 echo "(Looks like you have stdio.h from BSD.)"
11526 case "$stdio_ptr" in
11527 '') stdio_ptr='((fp)->_p)'
11530 *) ptr_lval=$d_stdio_ptr_lval;;
11532 case "$stdio_cnt" in
11533 '') stdio_cnt='((fp)->_r)'
11536 *) cnt_lval=$d_stdio_cnt_lval;;
11538 case "$stdio_base" in
11539 '') stdio_base='((fp)->_ub._base ? (fp)->_ub._base : (fp)->_bf._base)';;
11541 case "$stdio_bufsiz" in
11542 '') stdio_bufsiz='((fp)->_ub._base ? (fp)->_ub._size : (fp)->_bf._size)';;
11544 elif $contains '_IO_fpos_t' `./findhdr stdio.h` `./findhdr libio.h` >/dev/null 2>&1 ; then
11545 echo "(Looks like you have stdio.h from Linux.)"
11546 case "$stdio_ptr" in
11547 '') stdio_ptr='((fp)->_IO_read_ptr)'
11550 *) ptr_lval=$d_stdio_ptr_lval;;
11552 case "$stdio_cnt" in
11553 '') stdio_cnt='((fp)->_IO_read_end - (fp)->_IO_read_ptr)'
11556 *) cnt_lval=$d_stdio_cnt_lval;;
11558 case "$stdio_base" in
11559 '') stdio_base='((fp)->_IO_read_base)';;
11561 case "$stdio_bufsiz" in
11562 '') stdio_bufsiz='((fp)->_IO_read_end - (fp)->_IO_read_base)';;
11565 case "$stdio_ptr" in
11566 '') stdio_ptr='((fp)->_ptr)'
11569 *) ptr_lval=$d_stdio_ptr_lval;;
11571 case "$stdio_cnt" in
11572 '') stdio_cnt='((fp)->_cnt)'
11575 *) cnt_lval=$d_stdio_cnt_lval;;
11577 case "$stdio_base" in
11578 '') stdio_base='((fp)->_base)';;
11580 case "$stdio_bufsiz" in
11581 '') stdio_bufsiz='((fp)->_cnt + (fp)->_ptr - (fp)->_base)';;
11585 : test whether _ptr and _cnt really work
11586 echo "Checking how std your stdio is..." >&4
11589 #define FILE_ptr(fp) $stdio_ptr
11590 #define FILE_cnt(fp) $stdio_cnt
11592 FILE *fp = fopen("try.c", "r");
11595 18 <= FILE_cnt(fp) &&
11596 strncmp(FILE_ptr(fp), "include <stdio.h>\n", 18) == 0
11604 if eval $compile; then
11606 echo "Your stdio acts pretty std."
11609 echo "Your stdio isn't very std."
11612 echo "Your stdio doesn't appear very std."
11618 : Can _ptr be used as an lvalue?
11619 case "$d_stdstdio$ptr_lval" in
11620 $define$define) val=$define ;;
11623 set d_stdio_ptr_lval
11626 : Can _cnt be used as an lvalue?
11627 case "$d_stdstdio$cnt_lval" in
11628 $define$define) val=$define ;;
11631 set d_stdio_cnt_lval
11635 : test whether setting _ptr sets _cnt as a side effect
11636 d_stdio_ptr_lval_sets_cnt="$undef"
11637 d_stdio_ptr_lval_nochange_cnt="$undef"
11638 case "$d_stdio_ptr_lval$d_stdstdio" in
11640 echo "Checking to see what happens if we set the stdio ptr..." >&4
11643 /* Can we scream? */
11644 /* Eat dust sed :-) */
11645 /* In the buffer space, no one can hear you scream. */
11646 #define FILE_ptr(fp) $stdio_ptr
11647 #define FILE_cnt(fp) $stdio_cnt
11648 #include <sys/types.h>
11650 FILE *fp = fopen("try.c", "r");
11655 puts("Fail even to read");
11658 c = getc(fp); /* Read away the first # */
11660 puts("Fail even to read");
11664 18 <= FILE_cnt(fp) &&
11665 strncmp(FILE_ptr(fp), "include <stdio.h>\n", 18) == 0
11667 puts("Fail even to read");
11670 ptr = (char*) FILE_ptr(fp);
11671 cnt = (size_t)FILE_cnt(fp);
11673 FILE_ptr(fp) += 42;
11675 if ((char*)FILE_ptr(fp) != (ptr + 42)) {
11676 printf("Fail ptr check %p != %p", FILE_ptr(fp), (ptr + 42));
11679 if (FILE_cnt(fp) <= 20) {
11680 printf ("Fail (<20 chars to test)");
11683 if (strncmp(FILE_ptr(fp), "Eat dust sed :-) */\n", 20) != 0) {
11684 puts("Fail compare");
11687 if (cnt == FILE_cnt(fp)) {
11688 puts("Pass_unchanged");
11691 if (FILE_cnt(fp) == (cnt - 42)) {
11692 puts("Pass_changed");
11695 printf("Fail count was %d now %d\n", cnt, FILE_cnt(fp));
11701 if eval $compile; then
11702 case `./try$exe_ext` in
11704 echo "Increasing ptr in your stdio decreases cnt by the same amount. Good." >&4
11705 d_stdio_ptr_lval_sets_cnt="$define" ;;
11707 echo "Increasing ptr in your stdio leaves cnt unchanged. Good." >&4
11708 d_stdio_ptr_lval_nochange_cnt="$define" ;;
11710 echo "Increasing ptr in your stdio didn't do exactly what I expected. We'll not be doing that then." >&4 ;;
11712 echo "It appears attempting to set ptr in your stdio is a bad plan." >&4 ;;
11715 echo "It seems we can't set ptr in your stdio. Nevermind." >&4
11721 : see if _base is also standard
11723 case "$d_stdstdio" in
11727 #define FILE_base(fp) $stdio_base
11728 #define FILE_bufsiz(fp) $stdio_bufsiz
11730 FILE *fp = fopen("try.c", "r");
11733 19 <= FILE_bufsiz(fp) &&
11734 strncmp(FILE_base(fp), "#include <stdio.h>\n", 19) == 0
11741 if eval $compile; then
11743 echo "And its _base field acts std."
11746 echo "But its _base field isn't std."
11749 echo "However, it seems to be lacking the _base field."
11758 Checking how to access stdio streams by file descriptor number...
11760 case "$stdio_stream_array" in
11761 '') $cat >try.c <<EOCP
11764 if (&STDIO_STREAM_ARRAY[fileno(stdin)] == stdin)
11768 for s in _iob __iob __sF
11770 set try -DSTDIO_STREAM_ARRAY=$s
11771 if eval $compile; then
11772 case "`./try$exe_ext`" in
11773 yes) stdio_stream_array=$s; break ;;
11777 $rm -f try.* try$exe_ext
11779 case "$stdio_stream_array" in
11781 I can't figure out how to access stdio streams by file descriptor number.
11783 d_stdio_stream_array="$undef"
11786 You can access stdio streams by file descriptor number by the $stdio_stream_array array.
11788 d_stdio_stream_array="$define"
11792 : see if strcoll exists
11793 set strcoll d_strcoll
11796 : check for structure copying
11798 echo "Checking to see if your C compiler can copy structs..." >&4
11799 $cat >try.c <<'EOCP'
11809 if $cc -c try.c >/dev/null 2>&1 ; then
11811 echo "Yup, it can."
11814 echo "Nope, it can't."
11820 : see if strerror and/or sys_errlist[] exist
11822 if test "X$d_strerror" = X -o "X$d_syserrlst" = X; then
11823 if set strerror val -f d_strerror; eval $csym; $val; then
11824 echo 'strerror() found.' >&4
11825 d_strerror="$define"
11826 d_strerrm='strerror(e)'
11827 if set sys_errlist val -a d_syserrlst; eval $csym; $val; then
11828 echo "(You also have sys_errlist[], so we could roll our own strerror.)"
11829 d_syserrlst="$define"
11831 echo "(Since you don't have sys_errlist[], sterror() is welcome.)"
11832 d_syserrlst="$undef"
11834 elif xxx=`./findhdr string.h`; test "$xxx" || xxx=`./findhdr strings.h`; \
11835 $contains '#[ ]*define.*strerror' "$xxx" >/dev/null 2>&1; then
11836 echo 'strerror() found in string header.' >&4
11837 d_strerror="$define"
11838 d_strerrm='strerror(e)'
11839 if set sys_errlist val -a d_syserrlst; eval $csym; $val; then
11840 echo "(Most probably, strerror() uses sys_errlist[] for descriptions.)"
11841 d_syserrlst="$define"
11843 echo "(You don't appear to have any sys_errlist[], how can this be?)"
11844 d_syserrlst="$undef"
11846 elif set sys_errlist val -a d_syserrlst; eval $csym; $val; then
11847 echo "strerror() not found, but you have sys_errlist[] so we'll use that." >&4
11848 d_strerror="$undef"
11849 d_syserrlst="$define"
11850 d_strerrm='((e)<0||(e)>=sys_nerr?"unknown":sys_errlist[e])'
11852 echo 'strerror() and sys_errlist[] NOT found.' >&4
11853 d_strerror="$undef"
11854 d_syserrlst="$undef"
11855 d_strerrm='"unknown"'
11859 : see if strtod exists
11860 set strtod d_strtod
11863 : see if strtol exists
11864 set strtol d_strtol
11867 : see if strtold exists
11868 set strtold d_strtold
11871 : see if strtoll exists
11872 set strtoll d_strtoll
11875 case "$d_longlong-$d_strtoll" in
11878 Checking whether your strtoll() works okay...
11880 $cat >try.c <<'EOCP'
11883 #define strtoll __strtoll
11886 #define strtoll _strtoll
11889 extern long long int strtoll(char *s, char **, int);
11890 static int bad = 0;
11891 int check(char *s, long long ell, int een) {
11894 gll = strtoll(s, 0, 10);
11895 if (!((gll == ell) && (errno == een)))
11899 check(" 1", 1LL, 0);
11900 check(" 0", 0LL, 0);
11901 check("-1", -1LL, 0);
11902 check("-9223372036854775808", -9223372036854775808LL, 0);
11903 check("-9223372036854775808", -9223372036854775808LL, 0);
11904 check(" 9223372036854775807", 9223372036854775807LL, 0);
11905 check("-9223372036854775808", -9223372036854775808LL, 0);
11906 check(" 9223372036854775808", 9223372036854775807LL, ERANGE);
11907 check("-9223372036854775809", -9223372036854775808LL, ERANGE);
11913 if eval $compile; then
11916 ok) echo "Your strtoll() seems to be working okay." ;;
11918 Your strtoll() doesn't seem to be working okay.
11924 echo "(I can't seem to compile the test program--assuming it doesn't)"
11930 : see if strtoul exists
11931 set strtoul d_strtoul
11934 : see if strtoull exists
11935 set strtoull d_strtoull
11938 case "$d_longlong-$d_strtoull" in
11941 Checking whether your strtoull() works okay...
11943 $cat >try.c <<'EOCP'
11946 #define strtoull __strtoull
11949 extern unsigned long long int strtoull(char *s, char **, int);
11950 static int bad = 0;
11951 int check(char *s, long long eull, int een) {
11954 gull = strtoull(s, 0, 10);
11955 if (!((gull == eull) && (errno == een)))
11959 check(" 1", 1LL, 0);
11960 check(" 0", 0LL, 0);
11961 check("18446744073709551615", 18446744073709551615ULL, 0);
11962 check("18446744073709551616", 18446744073709551615ULL, ERANGE);
11968 if eval $compile; then
11970 ok) echo "Your strtoull() seems to be working okay." ;;
11972 Your strtoull() doesn't seem to be working okay.
11974 d_strtoull="$undef"
11981 : see if strtouq exists
11982 set strtouq d_strtouq
11985 : see if strxfrm exists
11986 set strxfrm d_strxfrm
11989 : see if symlink exists
11990 set symlink d_symlink
11993 : see if syscall exists
11994 set syscall d_syscall
11997 : see if sysconf exists
11998 set sysconf d_sysconf
12001 : see if system exists
12002 set system d_system
12005 : see if tcgetpgrp exists
12006 set tcgetpgrp d_tcgetpgrp
12009 : see if tcsetpgrp exists
12010 set tcsetpgrp d_tcsetpgrp
12013 : see if prototype for telldir is available
12015 set d_telldirproto telldir $i_systypes sys/types.h $i_dirent dirent.h
12018 : see if this is a sys/times.h system
12019 set sys/times.h i_systimes
12022 : see if times exists
12024 if set times val -f d_times; eval $csym; $val; then
12025 echo 'times() found.' >&4
12028 case "$i_systimes" in
12029 "$define") inc='sys/times.h';;
12031 rp="What is the type returned by times() on this system?"
12032 set clock_t clocktype long stdio.h sys/types.h $inc
12035 echo 'times() NOT found, hope that will do.' >&4
12040 : see if truncate exists
12041 set truncate d_truncate
12044 : see if tzname[] exists
12046 if set tzname val -a d_tzname; eval $csym; $val; then
12048 echo 'tzname[] found.' >&4
12051 echo 'tzname[] NOT found.' >&4
12056 : see if umask exists
12060 : see if ustat exists
12064 : backward compatibility for d_hvfork
12065 if test X$d_hvfork != X; then
12066 d_vfork="$d_hvfork"
12069 : see if there is a vfork
12074 : Ok, but do we want to use it. vfork is reportedly unreliable in
12075 : perl on Solaris 2.x, and probably elsewhere.
12079 case "$usevfork" in
12085 Perl can only use a vfork() that doesn't suffer from strict
12086 restrictions on calling functions or modifying global data in
12087 the child. For example, glibc-2.1 contains such a vfork()
12088 that is unsuitable. If your system provides a proper fork()
12089 call, chances are that you do NOT want perl to use vfork().
12092 rp="Do you still want to use vfork()?"
12097 echo "Ok, we won't use vfork()."
12106 $define) usevfork='true';;
12107 *) usevfork='false';;
12110 : see if this is an sysdir system
12111 set sys/dir.h i_sysdir
12114 : see if this is an sysndir system
12115 set sys/ndir.h i_sysndir
12118 : see if closedir exists
12119 set closedir d_closedir
12122 case "$d_closedir" in
12125 echo "Checking whether closedir() returns a status..." >&4
12126 cat > closedir.c <<EOM
12127 #$i_dirent I_DIRENT /**/
12128 #$i_sysdir I_SYS_DIR /**/
12129 #$i_sysndir I_SYS_NDIR /**/
12130 #$i_systypes I_SYS_TYPES /**/
12132 #if defined(I_SYS_TYPES)
12133 #include <sys/types.h>
12135 #if defined(I_DIRENT)
12136 #include <dirent.h>
12137 #if defined(NeXT) && defined(I_SYS_DIR) /* NeXT needs dirent + sys/dir.h */
12138 #include <sys/dir.h>
12142 #include <sys/ndir.h>
12146 #include <ndir.h> /* may be wrong in the future */
12148 #include <sys/dir.h>
12153 int main() { return closedir(opendir(".")); }
12156 if eval $compile_ok; then
12157 if ./closedir > /dev/null 2>&1 ; then
12158 echo "Yes, it does."
12161 echo "No, it doesn't."
12165 echo "(I can't seem to compile the test program--assuming it doesn't)"
12173 set d_void_closedir
12176 : see if there is a wait4
12180 : see if waitpid exists
12181 set waitpid d_waitpid
12184 : see if wcstombs exists
12185 set wcstombs d_wcstombs
12188 : see if wctomb exists
12189 set wctomb d_wctomb
12192 : preserve RCS keywords in files with variable substitution, grrr
12197 Revision='$Revision'
12199 case "$crosscompile" in
12200 ''|[nN]*) crosscompile="$undef" ;;
12204 next|rhapsody|darwin) multiarch="$define" ;;
12206 case "$multiarch" in
12207 ''|[nN]*) multiarch="$undef" ;;
12210 : check for alignment requirements
12212 case "$crosscompile$multiarch" in
12215 You seem to be either cross-compiling or doing a multiarchitecture build,
12216 skipping the memory alignment check.
12219 case "$alignbytes" in
12220 '') alignbytes=8 ;;
12224 case "$alignbytes" in
12225 '') echo "Checking alignment constraints..." >&4
12226 if $test "X$uselongdouble" = Xdefine -a "X$d_longdbl" = Xdefine; then
12227 $cat >try.c <<'EOCP'
12228 typedef long double NV;
12231 $cat >try.c <<'EOCP'
12235 $cat >>try.c <<'EOCP'
12243 printf("%d\n", (int)((char *)&try_algn.bar - (char *)&try_algn.foo));
12248 if eval $compile_ok; then
12252 echo "(I can't seem to compile the test program...)"
12255 *) dflt="$alignbytes"
12258 rp="Doubles must be aligned on a how-many-byte boundary?"
12266 : set the base revision
12269 : check for ordering of bytes in a long
12271 case "$crosscompile$multiarch" in
12274 You seem to be either cross-compiling or doing a multiarchitecture build,
12275 skipping the byteorder check.
12281 case "$byteorder" in
12284 In the following, larger digits indicate more significance. A big-endian
12285 machine like a Pyramid or a Motorola 680?0 chip will come out to 4321. A
12286 little-endian machine like a Vax or an Intel 80?86 chip would be 1234. Other
12287 machines may have weird orders like 3412. A Cray will report 87654321,
12288 an Alpha will report 12345678. If the test program works the default is
12290 I'm now running the test program...
12292 $cat >try.c <<'EOCP'
12299 char c[sizeof(long)];
12302 if (sizeof(long) > 4)
12303 u.l = (0x08070605L << 32) | 0x04030201L;
12306 for (i = 0; i < sizeof(long); i++)
12307 printf("%c", u.c[i]+'0');
12314 if eval $compile && ./try > /dev/null; then
12317 [1-4][1-4][1-4][1-4]|12345678|87654321)
12318 echo "(The test program ran ok.)"
12319 echo "byteorder=$dflt"
12322 ????|????????) echo "(The test program ran ok.)" ;;
12323 *) echo "(The test program didn't run right for some reason.)" ;;
12328 (I can't seem to compile the test program. Guessing big-endian...)
12331 case "$xxx_prompt" in
12333 rp="What is the order of bytes in a long?"
12347 : how do we catenate cpp tokens here?
12349 echo "Checking to see how your cpp does stuff like catenate tokens..." >&4
12350 $cat >cpp_stuff.c <<'EOCP'
12351 #define RCAT(a,b)a/**/b
12352 #define ACAT(a,b)a ## b
12356 $cppstdin $cppflags $cppminus <cpp_stuff.c >cpp_stuff.out 2>&1
12357 if $contains 'Circus' cpp_stuff.out >/dev/null 2>&1; then
12358 echo "Oh! Smells like ANSI's been here." >&4
12359 echo "We can catify or stringify, separately or together!"
12361 elif $contains 'Reiser' cpp_stuff.out >/dev/null 2>&1; then
12362 echo "Ah, yes! The good old days!" >&4
12363 echo "However, in the good old days we don't know how to stringify and"
12364 echo "catify at the same time."
12368 Hmm, I don't seem to be able to catenate tokens with your cpp. You're going
12369 to have to edit the values of CAT[2-5] in config.h...
12371 cpp_stuff="/* Help! How do we handle cpp_stuff? */*/"
12375 : see if this is a db.h system
12381 : Check db version.
12383 echo "Checking Berkeley DB version ..." >&4
12389 #include <sys/types.h>
12394 #ifdef DB_VERSION_MAJOR /* DB version >= 2 */
12395 int Major, Minor, Patch ;
12396 unsigned long Version ;
12397 (void)db_version(&Major, &Minor, &Patch) ;
12398 printf("You have Berkeley DB Version 2 or greater\n");
12400 printf("db.h is from Berkeley DB Version %d.%d.%d\n",
12401 DB_VERSION_MAJOR, DB_VERSION_MINOR, DB_VERSION_PATCH);
12402 printf("libdb is from Berkeley DB Version %d.%d.%d\n",
12403 Major, Minor, Patch) ;
12405 /* check that db.h & libdb are compatible */
12406 if (DB_VERSION_MAJOR != Major || DB_VERSION_MINOR != Minor || DB_VERSION_PATCH != Patch) {
12407 printf("db.h and libdb are incompatible\n") ;
12411 printf("db.h and libdb are compatible\n") ;
12413 Version = DB_VERSION_MAJOR * 1000000 + DB_VERSION_MINOR * 1000
12414 + DB_VERSION_PATCH ;
12416 /* needs to be >= 2.3.4 */
12417 if (Version < 2003004) {
12418 /* if (DB_VERSION_MAJOR == 2 && DB_VERSION_MINOR == 0 && DB_VERSION_PATCH < 5) { */
12419 printf("but Perl needs Berkeley DB 2.3.4 or greater\n") ;
12425 #if defined(_DB_H_) && defined(BTREEMAGIC) && defined(HASHMAGIC)
12426 printf("You have Berkeley DB Version 1\n");
12427 exit(0); /* DB version < 2: the coast is clear. */
12429 exit(1); /* <db.h> not Berkeley DB? */
12435 if eval $compile_ok && ./try; then
12436 echo 'Looks OK.' >&4
12438 echo "I can't use Berkeley DB with your <db.h>. I'll disable Berkeley DB." >&4
12442 : Remove db from list of libraries to use
12443 echo "Removing unusable -ldb from library list" >&4
12444 set `echo X $libs | $sed -e 's/-ldb / /' -e 's/-ldb$//'`
12447 echo "libs = $libs" >&4
12457 : Check the return type needed for hash
12459 echo "Checking return type needed for hash for Berkeley DB ..." >&4
12465 #include <sys/types.h>
12468 #ifndef DB_VERSION_MAJOR
12469 u_int32_t hash_cb (ptr, size)
12477 info.hash = hash_cb;
12481 if $cc $ccflags -c try.c >try.out 2>&1 ; then
12482 if $contains warning try.out >>/dev/null 2>&1 ; then
12485 db_hashtype='u_int32_t'
12488 : XXX Maybe we should just give up here.
12489 db_hashtype=u_int32_t
12491 echo "Help: I can't seem to compile the db test program." >&4
12492 echo "Something's wrong, but I'll assume you use $db_hashtype." >&4
12495 echo "Your version of Berkeley DB uses $db_hashtype for hash."
12497 *) db_hashtype=u_int32_t
12502 : Check the return type needed for prefix
12504 echo "Checking return type needed for prefix for Berkeley DB ..." >&4
12510 #include <sys/types.h>
12513 #ifndef DB_VERSION_MAJOR
12514 size_t prefix_cb (key1, key2)
12522 info.prefix = prefix_cb;
12526 if $cc $ccflags -c try.c >try.out 2>&1 ; then
12527 if $contains warning try.out >>/dev/null 2>&1 ; then
12528 db_prefixtype='int'
12530 db_prefixtype='size_t'
12533 db_prefixtype='size_t'
12534 : XXX Maybe we should just give up here.
12536 echo "Help: I can't seem to compile the db test program." >&4
12537 echo "Something's wrong, but I'll assume you use $db_prefixtype." >&4
12540 echo "Your version of Berkeley DB uses $db_prefixtype for prefix."
12542 *) db_prefixtype='size_t'
12546 : check for void type
12548 echo "Checking to see how well your C compiler groks the void type..." >&4
12549 case "$voidflags" in
12551 $cat >try.c <<'EOCP'
12557 extern void moo(); /* function returning void */
12558 void (*goo)(); /* ptr to func returning void */
12560 void *hue; /* generic ptr */
12573 int main() { sub(); }
12575 if $cc $ccflags -c -DTRY=$defvoidused try.c >.out 2>&1 ; then
12576 voidflags=$defvoidused
12577 echo "Good. It appears to support void to the level $package wants.">&4
12578 if $contains warning .out >/dev/null 2>&1; then
12579 echo "However, you might get some warnings that look like this:"
12583 echo "Hmm, your compiler has some difficulty with void. Checking further..." >&4
12584 if $cc $ccflags -c -DTRY=1 try.c >/dev/null 2>&1; then
12585 echo "It supports 1..."
12586 if $cc $ccflags -c -DTRY=3 try.c >/dev/null 2>&1; then
12587 echo "It also supports 2..."
12588 if $cc $ccflags -c -DTRY=7 try.c >/dev/null 2>&1; then
12590 echo "And it supports 4 but not 8 definitely."
12592 echo "It doesn't support 4..."
12593 if $cc $ccflags -c -DTRY=11 try.c >/dev/null 2>&1; then
12595 echo "But it supports 8."
12598 echo "Neither does it support 8."
12602 echo "It does not support 2..."
12603 if $cc $ccflags -c -DTRY=13 try.c >/dev/null 2>&1; then
12605 echo "But it supports 4 and 8."
12607 if $cc $ccflags -c -DTRY=5 try.c >/dev/null 2>&1; then
12609 echo "And it supports 4 but has not heard about 8."
12611 echo "However it supports 8 but not 4."
12616 echo "There is no support at all for void."
12621 case "$voidflags" in
12623 *) $cat >&4 <<'EOM'
12624 Support flag bits are:
12625 1: basic void declarations.
12626 2: arrays of pointers to functions returning void.
12627 4: operations between pointers to and addresses of void functions.
12628 8: generic void pointers.
12631 rp="Your void support flags add up to what?"
12639 : How can we generate normalized random numbers ?
12641 echo "Looking for a random number function..." >&4
12642 case "$randfunc" in
12644 if set drand48 val -f; eval $csym; $val; then
12646 echo "Good, found drand48()." >&4
12647 elif set random val -f; eval $csym; $val; then
12649 echo "OK, found random()." >&4
12652 echo "Yick, looks like I have to use rand()." >&4
12663 *-Dmy_rand=*|*-Dmy_srand=*)
12664 echo "Removing obsolete -Dmy_rand, -Dmy_srand, and -Drandbits from ccflags." >&4
12665 ccflags="`echo $ccflags | sed -e 's/-Dmy_rand=random/ /'`"
12666 ccflags="`echo $ccflags | sed -e 's/-Dmy_srand=srandom/ /'`"
12667 ccflags="`echo $ccflags | sed -e 's/-Drandbits=[0-9][0-9]*/ /'`"
12671 while $test "$cont"; do
12672 rp="Use which function to generate random numbers?"
12674 if $test "$ans" = "$dflt"; then
12680 if set $ans val -f; eval $csym; $val; then
12684 rp="I cannot find function $ans. Use that name anyway?"
12693 case "$randfunc" in
12695 drand01="drand48()"
12701 case "$randbits" in
12703 echo "Checking to see how many bits your $randfunc() function produces..." >&4
12705 #$i_unistd I_UNISTD
12706 #$i_stdlib I_STDLIB
12709 # include <unistd.h>
12712 # include <stdlib.h>
12717 register unsigned long tmp;
12718 register unsigned long max = 0L;
12720 for (i = 1000; i; i--) {
12721 tmp = (unsigned long) $randfunc();
12722 if (tmp > max) max = tmp;
12724 for (i = 0; max; i++)
12730 if eval $compile_ok; then
12734 echo "(I can't seem to compile the test program...)"
12741 rp="How many bits does your $randfunc() function produce?"
12745 drand01="($randfunc() / (double) ((unsigned long)1 << $randbits))"
12746 seedfunc="s$randfunc"
12747 randseedtype=unsigned
12751 rp="How many bits does your $randfunc() function produce?"
12754 seedfunc="s$randfunc"
12755 drand01="($randfunc() / (double) ((unsigned long)1 << $randbits))"
12756 if set $seedfunc val -f; eval $csym; $val; then
12757 echo "(Using $seedfunc() to seed random generator)"
12759 echo "(Warning: no $seedfunc() to seed random generator)"
12762 randseedtype=unsigned
12770 echo "Determining whether or not we are on an EBCDIC system..." >&4
12771 $cat >tebcdic.c <<'EOM'
12774 if ('M'==0xd4) return 0;
12781 if eval $compile_ok; then
12783 echo "You seem to speak EBCDIC." >&4
12786 echo "Nope, no EBCDIC, probably ASCII or some ISO Latin. Or UTF8." >&4
12789 echo "I'm unable to compile the test program." >&4
12790 echo "I'll assume ASCII or some ISO Latin. Or UTF8." >&4
12792 $rm -f tebcdic.c tebcdic
12798 Checking how to flush all pending stdio output...
12800 # I only know how to find the first 32 possibly open files on SunOS.
12801 # See also hints/sunos_4_1.sh and util.c --AD
12803 sunos) $echo '#define PERL_FFLUSH_ALL_FOPEN_MAX 32' > try.c ;;
12805 $cat >>try.c <<EOCP
12807 #$i_unistd I_UNISTD
12809 # include <unistd.h>
12811 #$d_sysconf HAS_SYSCONF
12812 #$d_stdio_stream_array HAS_STDIO_STREAM_ARRAY
12813 #ifdef HAS_STDIO_STREAM_ARRAY
12814 # define STDIO_STREAM_ARRAY $stdio_stream_array
12817 FILE* p = fopen("try.out", "w");
12821 # ifdef TRY_FPRINTF
12825 #ifdef TRY_FFLUSH_NULL
12828 #ifdef TRY_FFLUSH_ALL
12830 long open_max = -1;
12831 # ifdef PERL_FFLUSH_ALL_FOPEN_MAX
12832 open_max = PERL_FFLUSH_ALL_FOPEN_MAX;
12834 # if defined(HAS_SYSCONF) && defined(_SC_OPEN_MAX)
12835 open_max = sysconf(_SC_OPEN_MAX);
12838 open_max = FOPEN_MAX;
12841 open_max = OPEN_MAX;
12850 # ifdef HAS_STDIO_STREAM_ARRAY
12851 if (open_max > 0) {
12853 for (i = 0; i < open_max; i++)
12854 if (STDIO_STREAM_ARRAY[i]._file >= 0 &&
12855 STDIO_STREAM_ARRAY[i]._file < open_max &&
12856 STDIO_STREAM_ARRAY[i]._flag)
12857 fflush(&STDIO_STREAM_ARRAY[i]);
12865 : first we have to find out how _not_ to flush
12866 if $test "X$fflushNULL" = X -o "X$fflushall" = X; then
12868 set try -DTRY_FPUTC
12869 if eval $compile; then
12871 ./try$exe_ext 2>/dev/null
12872 if $test ! -s try.out -a "X$?" = X42; then
12878 set try -DTRY_FPRINTF
12880 if eval $compile; then
12882 ./try$exe_ext 2>/dev/null
12883 if $test ! -s try.out -a "X$?" = X42; then
12884 output=-DTRY_FPRINTF
12890 : check for fflush NULL behaviour
12891 case "$fflushNULL" in
12892 '') set try -DTRY_FFLUSH_NULL $output
12893 if eval $compile; then
12895 ./try$exe_ext 2>/dev/null
12897 if $test -s try.out -a "X$code" = X42; then
12898 fflushNULL="`$cat try.out`"
12900 if $test "X$code" != X42; then
12902 (If this test failed, don't worry, we'll try another method shortly.)
12907 $rm -f core try.core core.try.*
12908 case "$fflushNULL" in
12910 Your fflush(NULL) works okay for output streams.
12911 Let's see if it clobbers input pipes...
12913 # As of mid-March 2000 all versions of Solaris appear to have a stdio
12914 # bug that improperly flushes the input end of pipes. So we avoid the
12915 # autoflush on fork/system/exec support for now. :-(
12916 $cat >tryp.c <<EOCP
12919 main(int argc, char **argv)
12925 while ((i = getc(stdin)) != -1
12926 && (*bp++ = i) != '\n'
12927 && bp < &buf[1024])
12930 fprintf(stdout, "%s", buf);
12938 fflushNULL="$define"
12940 if eval $compile; then
12942 $cat tryp.c | ./tryp$exe_ext 2>/dev/null > tryp.out
12943 if cmp tryp.c tryp.out >/dev/null 2>&1; then
12945 fflush(NULL) seems to behave okay with input streams.
12947 fflushNULL="$define"
12950 Ouch, fflush(NULL) clobbers input pipes! We will not use it.
12952 fflushNULL="$undef"
12955 $rm -f core tryp.c tryp.core core.tryp.*
12958 Your fflush(NULL) isn't working (contrary to ANSI C).
12960 fflushNULL="$undef"
12963 Cannot figure out whether your fflush(NULL) works or not.
12964 I'm assuming it doesn't (contrary to ANSI C).
12966 fflushNULL="$undef"
12970 $define|true|[yY]*)
12971 fflushNULL="$define"
12974 fflushNULL="$undef"
12977 : check explicit looping only if NULL did not work, and if the pipe
12978 : bug does not show up on an explicit flush too
12979 case "$fflushNULL" in
12981 $cat >tryp.c <<EOCP
12984 main(int argc, char **argv)
12990 while ((i = getc(stdin)) != -1
12991 && (*bp++ = i) != '\n'
12992 && bp < &buf[1024])
12995 fprintf(stdout, "%s", buf);
13004 if eval $compile; then
13006 $cat tryp.c | ./tryp$exe_ext 2>/dev/null > tryp.out
13007 if cmp tryp.c tryp.out >/dev/null 2>&1; then
13009 Good, at least fflush(stdin) seems to behave okay when stdin is a pipe.
13011 : now check for fflushall behaviour
13012 case "$fflushall" in
13013 '') set try -DTRY_FFLUSH_ALL $output
13014 if eval $compile; then
13016 (Now testing the other method--but note that this also may fail.)
13019 ./try$exe_ext 2>/dev/null
13020 if $test -s try.out -a "X$?" = X42; then
13021 fflushall="`$cat try.out`"
13024 $rm -f core try.core core.try.*
13025 case "$fflushall" in
13027 Whew. Flushing explicitly all the stdio streams works.
13029 fflushall="$define"
13032 Sigh. Flushing explicitly all the stdio streams doesn't work.
13037 Cannot figure out whether flushing stdio streams explicitly works or not.
13038 I'm assuming it doesn't.
13044 "$define"|true|[yY]*)
13045 fflushall="$define"
13053 All is futile. Even fflush(stdin) clobbers input pipes!
13060 $rm -f core tryp.c tryp.core core.tryp.*
13062 *) fflushall="$undef"
13066 case "$fflushNULL$fflushall" in
13069 OK, I give up. I cannot figure out how to flush pending stdio output.
13070 We won't be flushing handles at all before fork/exec/popen.
13074 $rm -f try.* try$exe_ext
13076 : Store the full pathname to the ar program for use in the C program
13077 : Respect a hint or command line value for full_ar.
13082 : Store the full pathname to the sed program for use in the C program
13085 : see what type gids are declared as in the kernel
13087 echo "Looking for the type for group ids returned by getgid()."
13088 set gid_t gidtype xxx stdio.h sys/types.h
13092 xxx=`./findhdr sys/user.h`
13093 set `grep 'groups\[NGROUPS\];' "$xxx" 2>/dev/null` unsigned short
13095 unsigned) dflt="$1 $2" ;;
13099 *) dflt="$gidtype";;
13102 gid_t) echo "gid_t found." ;;
13103 *) rp="What is the type for group ids returned by getgid()?"
13111 *_t) zzz="$gidtype" ;;
13114 echo "Checking the size of $zzz..." >&4
13116 #include <sys/types.h>
13119 printf("%d\n", (int)sizeof($gidtype));
13124 if eval $compile_ok; then
13128 echo "(I can't execute the test program--guessing $gidsize.)" >&4
13131 echo "Your $zzz is $gidsize bytes long."
13136 echo "(I can't compile the test program--guessing $gidsize.)" >&4
13142 *_t) zzz="$gidtype" ;;
13145 echo "Checking the sign of $zzz..." >&4
13147 #include <sys/types.h>
13158 if eval $compile; then
13162 echo "(I can't execute the test program--guessing unsigned.)" >&4
13166 1) echo "Your $zzz is unsigned." ;;
13167 -1) echo "Your $zzz is signed." ;;
13173 echo "(I can't compile the test program--guessing unsigned.)" >&4
13179 if $test X"$quadtype" != X; then
13181 echo "Checking how to print 64-bit integers..." >&4
13183 if $test X"$sPRId64" = X -a X"$quadtype" = Xint; then
13184 $cat >try.c <<'EOCP'
13185 #include <sys/types.h>
13188 int q = 12345678901;
13189 printf("%ld\n", q);
13193 if eval $compile; then
13194 yyy=`./try$exe_ext`
13197 sPRId64='"d"'; sPRIi64='"i"'; sPRIu64='"u"';
13198 sPRIo64='"o"'; sPRIx64='"x"'; sPRIXU64='"X"';
13199 echo "We will use %d."
13205 if $test X"$sPRId64" = X -a X"$quadtype" = Xlong; then
13206 $cat >try.c <<'EOCP'
13207 #include <sys/types.h>
13210 long q = 12345678901;
13211 printf("%ld\n", q);
13215 if eval $compile; then
13216 yyy=`./try$exe_ext`
13219 sPRId64='"ld"'; sPRIi64='"li"'; sPRIu64='"lu"';
13220 sPRIo64='"lo"'; sPRIx64='"lx"'; sPRIXU64='"lX"';
13221 echo "We will use %ld."
13227 if $test X"$sPRId64" = X -a X"$i_inttypes" = X"$define" -a X"$quadtype" = Xint64_t; then
13228 $cat >try.c <<'EOCP'
13229 #include <sys/types.h>
13230 #include <inttypes.h>
13233 int64_t q = 12345678901;
13234 printf("%" PRId64 "\n", q);
13238 if eval $compile; then
13239 yyy=`./try$exe_ext`
13242 sPRId64=PRId64; sPRIi64=PRIi64; sPRIu64=PRIu64;
13243 sPRIo64=PRIo64; sPRIx64=PRIx64; sPRIXU64=PRIXU64;
13244 echo "We will use the C9X style."
13250 if $test X"$sPRId64" = X -a X"$quadtype" = X"long long"; then
13251 $cat >try.c <<'EOCP'
13252 #include <sys/types.h>
13255 long long q = 12345678901LL; /* AIX cc requires the LL suffix. */
13256 printf("%lld\n", q);
13260 if eval $compile; then
13261 yyy=`./try$exe_ext`
13264 sPRId64='"lld"'; sPRIi64='"lli"'; sPRIu64='"llu"';
13265 sPRIo64='"llo"'; sPRIx64='"llx"'; sPRIXU64='"llX"';
13266 echo "We will use the %lld style."
13272 if $test X"$sPRId64" = X -a X"$quadtype" != X; then
13274 #include <sys/types.h>
13277 $quadtype q = 12345678901;
13278 printf("%Ld\n", q);
13282 if eval $compile; then
13283 yyy=`./try$exe_ext`
13286 sPRId64='"Ld"'; sPRIi64='"Li"'; sPRIu64='"Lu"';
13287 sPRIo64='"Lo"'; sPRIx64='"Lx"'; sPRIXU64='"LX"';
13288 echo "We will use %Ld."
13294 if $test X"$sPRId64" = X -a X"$quadtype" != X; then
13296 #include <sys/types.h>
13299 $quadtype q = 12345678901;
13300 printf("%qd\n", q);
13304 if eval $compile; then
13305 yyy=`./try$exe_ext`
13308 sPRId64='"qd"'; sPRIi64='"qi"'; sPRIu64='"qu"';
13309 sPRIo64='"qo"'; sPRIx64='"qx"'; sPRIXU64='"qX"';
13310 echo "We will use %qd."
13316 if $test X"$sPRId64" = X; then
13317 echo "Cannot figure out how to print 64-bit integers." >&4
13325 '') d_PRId64="$undef"; d_PRIi64="$undef"; d_PRIu64="$undef";
13326 d_PRIo64="$undef"; d_PRIx64="$undef"; d_PRIXU64="$undef";
13328 *) d_PRId64="$define"; d_PRIi64="$define"; d_PRIu64="$define";
13329 d_PRIo64="$define"; d_PRIx64="$define"; d_PRIXU64="$define";
13335 $echo "Checking the format strings to be used for Perl's internal types..." >&4
13337 if $test X"$ivsize" = X8; then
13338 ivdformat="$sPRId64"
13339 uvuformat="$sPRIu64"
13340 uvoformat="$sPRIo64"
13341 uvxformat="$sPRIx64"
13342 uvXUformat="$sPRIXU64"
13344 if $test X"$ivsize" = X"$longsize"; then
13351 if $test X"$ivsize" = X"$intsize"; then
13359 if $test X"$ivsize" = X"$shortsize"; then
13370 if $test X"$uselongdouble" = X"$define" -a X"$d_longdbl" = X"$define" -a X"$d_PRIgldbl" = X"$define"; then
13371 nveformat="$sPRIeldbl"
13372 nvfformat="$sPRIfldbl"
13373 nvgformat="$sPRIgldbl"
13374 nvEUformat="$sPRIEUldbl"
13375 nvFUformat="$sPRIFUldbl"
13376 nvGUformat="$sPRIGUldbl"
13386 case "$ivdformat" in
13387 '') echo "$0: Fatal: failed to find format strings, cannot continue." >& 4
13394 $echo "Checking the format string to be used for gids..." >&4
13397 -1) if $test X"$gidsize" = X"$ivsize"; then
13398 gidformat="$ivdformat"
13400 if $test X"$gidsize" = X"$longsize"; then
13403 if $test X"$gidsize" = X"$intsize"; then
13406 if $test X"$gidsize" = X"$shortsize"; then
13413 *) if $test X"$gidsize" = X"$uvsize"; then
13414 gidformat="$uvuformat"
13416 if $test X"$gidsize" = X"$longsize"; then
13419 if $test X"$gidsize" = X"$intsize"; then
13422 if $test X"$gidsize" = X"$shortsize"; then
13431 : see if getgroups exists
13432 set getgroups d_getgrps
13435 : see if setgroups exists
13436 set setgroups d_setgrps
13440 : Find type of 2nd arg to 'getgroups()' and 'setgroups()'
13442 case "$d_getgrps$d_setgrps" in
13444 case "$groupstype" in
13445 '') dflt="$gidtype" ;;
13446 *) dflt="$groupstype" ;;
13449 What type of pointer is the second argument to getgroups() and setgroups()?
13450 Usually this is the same as group ids, $gidtype, but not always.
13453 rp='What type pointer is the second argument to getgroups() and setgroups()?'
13457 *) groupstype="$gidtype";;
13461 echo "Checking if your $make program sets \$(MAKE)..." >&4
13462 case "$make_set_make" in
13464 $sed 's/^X //' > testmake.mak << 'EOF'
13466 X @echo 'maketemp="$(MAKE)"'
13468 case "`$make -f testmake.mak 2>/dev/null`" in
13469 *maketemp=*) make_set_make='#' ;;
13470 *) make_set_make="MAKE=$make" ;;
13472 $rm -f testmake.mak
13475 case "$make_set_make" in
13476 '#') echo "Yup, it does.";;
13477 *) echo "Nope, it doesn't.";;
13480 : see what type is used for mode_t
13481 rp="What is the type used for file modes for system calls (e.g. fchmod())?"
13482 set mode_t modetype int stdio.h sys/types.h
13485 : see if stdarg is available
13487 if $test `./findhdr stdarg.h`; then
13488 echo "<stdarg.h> found." >&4
13491 echo "<stdarg.h> NOT found." >&4
13495 : see if varags is available
13497 if $test `./findhdr varargs.h`; then
13498 echo "<varargs.h> found." >&4
13500 echo "<varargs.h> NOT found, but that's ok (I hope)." >&4
13503 : set up the varargs testing programs
13504 $cat > varargs.c <<EOP
13506 #include <stdarg.h>
13509 #include <varargs.h>
13513 int f(char *p, ...)
13527 p = va_arg(ap, char *);
13532 $cat > varargs <<EOP
13534 if $cc -c $ccflags -D\$1 varargs.c >/dev/null 2>&1; then
13543 : now check which varargs header should be included
13548 if `./varargs I_STDARG`; then
13550 elif `./varargs I_VARARGS`; then
13555 if `./varargs I_VARARGS`; then
13562 echo "I could not find the definition for va_dcl... You have problems..." >&4
13563 val="$undef"; set i_stdarg; eval $setvar
13564 val="$undef"; set i_varargs; eval $setvar
13569 case "$i_varhdr" in
13571 val="$define"; set i_stdarg; eval $setvar
13572 val="$undef"; set i_varargs; eval $setvar
13575 val="$undef"; set i_stdarg; eval $setvar
13576 val="$define"; set i_varargs; eval $setvar
13579 echo "We'll include <$i_varhdr> to get va_dcl definition." >&4;;
13583 : see if we need va_copy
13585 case "$i_stdarg" in
13588 #include <stdarg.h>
13590 #$i_stdlib I_STDLIB
13592 #include <stdlib.h>
13594 #include <signal.h>
13597 ivfprintf(FILE *f, const char *fmt, va_list *valp)
13599 return vfprintf(f, fmt, *valp);
13603 myvfprintf(FILE *f, const char *fmt, va_list val)
13605 return ivfprintf(f, fmt, &val);
13609 myprintf(char *fmt, ...)
13612 va_start(val, fmt);
13613 return myvfprintf(stdout, fmt, val);
13617 main(int ac, char **av)
13619 signal(SIGSEGV, exit);
13621 myprintf("%s%cs all right, then\n", "that", '\'');
13626 if eval $compile && ./try 2>&1 >/dev/null; then
13628 "that's all right, then")
13634 yes) echo "It seems that you don't need va_copy()." >&4
13635 need_va_copy="$undef"
13637 *) echo "It seems that va_copy() or similar will be needed." >&4
13638 need_va_copy="$define"
13641 $rm -f try.* core core.* *.core *.core.*
13643 *) echo "You don't have <stdarg.h>, not checking for va_copy()." >&4
13647 : define a fucntion to check prototypes
13648 $cat > protochk <<EOSH
13651 optimize="$optimize"
13653 prototype="$prototype"
13658 $cat >> protochk <<'EOSH'
13663 while test $# -ge 2; do
13665 $define) echo "#include <$2>" >> try.c ;;
13666 literal) echo "$2" >> try.c ;;
13670 test "$prototype" = "$define" && echo '#define CAN_PROTOTYPE' >> try.c
13671 cat >> try.c <<'EOCP'
13672 #ifdef CAN_PROTOTYPE
13673 #define _(args) args
13678 echo "$foo" >> try.c
13679 echo 'int no_real_function_has_this_name _((void)) { return 0; }' >> try.c
13680 $cc $optimize $ccflags -c try.c > /dev/null 2>&1
13686 $eunicefix protochk
13688 : see what type is used for size_t
13689 rp="What is the type used for the length parameter for string functions?"
13690 set size_t sizetype 'unsigned int' stdio.h sys/types.h
13693 : check for type of arguments to gethostbyaddr.
13694 if test "X$netdb_host_type" = X -o "X$netdb_hlen_type" = X; then
13695 case "$d_gethbyaddr" in
13699 Checking to see what type of arguments are accepted by gethostbyaddr().
13701 hdrs="$define sys/types.h
13702 $d_socket sys/socket.h
13703 $i_niin netinet/in.h
13705 $i_unistd unistd.h"
13706 : The first arg can 'char *' or 'void *'
13707 : The second arg is some of integral type
13708 for xxx in in_addr_t 'const void *' 'const char *' 'void *' 'char *'; do
13709 for yyy in size_t long int; do
13710 case "$netdb_host_type" in
13711 '') try="extern struct hostent *gethostbyaddr($xxx, $yyy, int);"
13712 if ./protochk "$try" $hdrs; then
13713 echo "Your system accepts $xxx for the first arg."
13714 echo "...and $yyy for the second arg."
13715 netdb_host_type="$xxx"
13716 netdb_hlen_type="$yyy"
13722 : In case none of those worked, prompt the user.
13723 case "$netdb_host_type" in
13724 '') rp='What is the type for the 1st argument to gethostbyaddr?'
13727 netdb_host_type=$ans
13728 rp='What is the type for the 2nd argument to gethostbyaddr?'
13731 netdb_hlen_type=$ans
13735 *) : no gethostbyaddr, so pick harmless defaults
13736 netdb_host_type='char *'
13737 netdb_hlen_type="$sizetype"
13740 # Remove the "const" if needed. -- but then we'll have a
13742 # netdb_host_type=`echo "$netdb_host_type" | sed 's/^const //'`
13745 : check for type of argument to gethostbyname.
13746 if test "X$netdb_name_type" = X ; then
13747 case "$d_gethbyname" in
13751 Checking to see what type of argument is accepted by gethostbyname().
13753 hdrs="$define sys/types.h
13754 $d_socket sys/socket.h
13755 $i_niin netinet/in.h
13757 $i_unistd unistd.h"
13758 for xxx in "const char *" "char *"; do
13759 case "$netdb_name_type" in
13760 '') try="extern struct hostent *gethostbyname($xxx);"
13761 if ./protochk "$try" $hdrs; then
13762 echo "Your system accepts $xxx."
13763 netdb_name_type="$xxx"
13768 : In case none of those worked, prompt the user.
13769 case "$netdb_name_type" in
13770 '') rp='What is the type for the 1st argument to gethostbyname?'
13773 netdb_name_type=$ans
13777 *) : no gethostbyname, so pick harmless default
13778 netdb_name_type='char *'
13783 : check for type of 1st argument to getnetbyaddr.
13784 if test "X$netdb_net_type" = X ; then
13785 case "$d_getnbyaddr" in
13789 Checking to see what type of 1st argument is accepted by getnetbyaddr().
13791 hdrs="$define sys/types.h
13792 $d_socket sys/socket.h
13793 $i_niin netinet/in.h
13795 $i_unistd unistd.h"
13796 for xxx in in_addr_t "unsigned long" long "unsigned int" int; do
13797 case "$netdb_net_type" in
13798 '') try="extern struct netent *getnetbyaddr($xxx, int);"
13799 if ./protochk "$try" $hdrs; then
13800 echo "Your system accepts $xxx."
13801 netdb_net_type="$xxx"
13806 : In case none of those worked, prompt the user.
13807 case "$netdb_net_type" in
13808 '') rp='What is the type for the 1st argument to getnetbyaddr?'
13811 netdb_net_type=$ans
13815 *) : no getnetbyaddr, so pick harmless default
13816 netdb_net_type='long'
13820 : locate the preferred pager for this system
13826 [a-zA-Z]:/*) dflt=$pg;;
13830 [a-zA-Z]:/*) dflt=$more;;
13834 [a-zA-Z]:/*) dflt=$less;;
13837 '') dflt=/usr/ucb/more;;
13844 rp='What pager is used on your system?'
13848 : see what type pids are declared as in the kernel
13849 rp="What is the type of process ids on this system?"
13850 set pid_t pidtype int stdio.h sys/types.h
13853 : Find earliest binary compatible site_perl subdirectory perl can use.
13854 case "$bincompat5005" in
13855 "$define") xs_apiversion='5.005' ;;
13856 *) xs_apiversion=$version ;; # The current site_perl version.
13858 : Find earliest pure perl site_perl subdirectory perl can use.
13859 : The versioned directories started at 5.005.
13860 pm_apiversion='5.005'
13862 : check for length of pointer
13866 echo "Checking to see how big your pointers are..." >&4
13867 if test "$voidflags" -gt 7; then
13868 echo '#define VOID_PTR char *' > try.c
13870 echo '#define VOID_PTR void *' > try.c
13872 $cat >>try.c <<'EOCP'
13876 printf("%d\n", (int)sizeof(VOID_PTR));
13881 if eval $compile_ok; then
13883 echo "Your pointers are $ptrsize bytes long."
13886 echo "(I can't seem to compile the test program. Guessing...)" >&4
13887 rp="What is the size of a pointer (in bytes)?"
13895 : see if ar generates random libraries by itself
13897 echo "Checking how to generate random libraries on your machine..." >&4
13898 echo 'int bar1() { return bar2(); }' > bar1.c
13899 echo 'int bar2() { return 2; }' > bar2.c
13900 $cat > foo.c <<'EOP'
13901 int main() { printf("%d\n", bar1()); exit(0); }
13903 $cc $ccflags -c bar1.c >/dev/null 2>&1
13904 $cc $ccflags -c bar2.c >/dev/null 2>&1
13905 $cc $ccflags -c foo.c >/dev/null 2>&1
13906 $ar rc bar$_a bar2$_o bar1$_o >/dev/null 2>&1
13907 if $cc -o foobar $ccflags $ldflags foo$_o bar$_a $libs > /dev/null 2>&1 &&
13908 ./foobar >/dev/null 2>&1; then
13909 echo "$ar appears to generate random libraries itself."
13912 elif $ar ts bar$_a >/dev/null 2>&1 &&
13913 $cc -o foobar $ccflags $ldflags foo$_o bar$_a $libs > /dev/null 2>&1 &&
13914 ./foobar >/dev/null 2>&1; then
13915 echo "a table of contents needs to be added with '$ar ts'."
13922 ranlib=`./loc ranlib X /usr/bin /bin /usr/local/bin`
13923 $test -f $ranlib || ranlib=''
13926 if $test -n "$ranlib"; then
13927 echo "your system has '$ranlib'; we'll use that."
13930 echo "your system doesn't seem to support random libraries"
13931 echo "so we'll use lorder and tsort to order the libraries."
13938 : check for type of arguments to select.
13939 case "$selecttype" in
13940 '') case "$d_select" in
13944 Checking to see what type of arguments are accepted by select().
13946 hdrs="$define sys/types.h
13947 $i_systime sys/time.h
13948 $i_sysselct sys/select.h
13949 $d_socket sys/socket.h"
13950 : The first arg can be int, unsigned, or size_t
13951 : The last arg may or may not be 'const'
13953 : void pointer has been seen but using that
13954 : breaks the selectminbits test
13955 for xxx in 'fd_set *' 'int *'; do
13956 for nfd in 'int' 'size_t' 'unsigned long' 'unsigned' ; do
13957 for tmo in 'struct timeval *' 'const struct timeval *'; do
13959 '') try="extern select _(($nfd, $xxx, $xxx, $xxx, $tmo));"
13960 if ./protochk "$try" $hdrs; then
13961 echo "Your system accepts $xxx."
13970 '') rp='What is the type for the 2nd, 3rd, and 4th arguments to select?'
13971 case "$d_fd_set" in
13972 $define) dflt="fd_set *" ;;
13981 *) : no select, so pick a harmless default
13988 : check for the select 'width'
13989 case "$selectminbits" in
13990 '') case "$d_select" in
13994 Checking to see on how many bits at a time your select() operates...
13997 #include <sys/types.h>
13999 #$i_systime I_SYS_TIME
14000 #$i_systimek I_SYS_TIME_KERNEL
14005 # ifdef I_SYS_TIME_KERNEL
14008 # include <sys/time.h>
14009 # ifdef I_SYS_TIME_KERNEL
14013 #$i_sysselct I_SYS_SELECT
14014 #ifdef I_SYS_SELECT
14015 #include <sys/select.h>
14017 #$d_socket HAS_SOCKET
14019 # include <sys/socket.h> /* Might include <sys/bsdtypes.h> */
14023 #define S sizeof(*(b))
14025 #define NBYTES (S * 8 > MINBITS ? S : MINBITS/8)
14026 #define NBITS (NBYTES * 8)
14035 fp = fopen("try.c", "r");
14041 b = ($selecttype)s;
14042 for (i = 0; i < NBITS; i++)
14046 select(fd + 1, b, 0, 0, &t);
14047 for (i = NBITS - 1; i > fd && FD_ISSET(i, b); i--);
14048 printf("%d\n", i + 1);
14053 if eval $compile_ok; then
14054 selectminbits=`./try`
14055 case "$selectminbits" in
14057 Cannot figure out on how many bits at a time your select() operates.
14058 I'll play safe and guess it is 32 bits.
14064 *) bits="$selectminbits bits" ;;
14066 echo "Your select() operates on $bits at a time." >&4
14068 rp='What is the minimum number of bits your select() operates on?'
14069 case "$byteorder" in
14070 1234|12345678) dflt=32 ;;
14075 selectminbits="$val"
14079 *) : no select, so pick a harmless default
14086 : Trace out the files included by signal.h, then look for SIGxxx names.
14087 : Remove SIGARRAYSIZE used by HPUX.
14088 : Remove SIGSTKSIZE used by Linux.
14089 : Remove SIGSTKSZ used by Posix.
14090 : Remove SIGTYP void lines used by OS2.
14091 : Some cpps, like os390, dont give the file name anywhere
14092 if [ "X$fieldn" = X ]; then
14093 : Just make some guesses. We check them later.
14094 xxx='/usr/include/signal.h /usr/include/sys/signal.h'
14096 xxx=`echo '#include <signal.h>' |
14097 $cppstdin $cppminus $cppflags 2>/dev/null |
14098 $grep '^[ ]*#.*include' |
14099 $awk "{print \\$$fieldn}" | $sed 's!"!!g' | $sort | $uniq`
14101 : Check this list of files to be sure we have parsed the cpp output ok.
14102 : This will also avoid potentially non-existent files, such
14105 for xx in $xxx /dev/null ; do
14106 $test -f "$xx" && xxxfiles="$xxxfiles $xx"
14108 : If we have found no files, at least try signal.h
14109 case "$xxxfiles" in
14110 '') xxxfiles=`./findhdr signal.h` ;;
14113 $1 ~ /^#define$/ && $2 ~ /^SIG[A-Z0-9]*$/ && $2 !~ /SIGARRAYSIZE/ && $2 !~ /SIGSTKSIZE/ && $2 !~ /SIGSTKSZ/ && $3 !~ /void/ {
14114 print substr($2, 4, 20)
14116 $1 == "#" && $2 ~ /^define$/ && $3 ~ /^SIG[A-Z0-9]*$/ && $3 !~ /SIGARRAYSIZE/ && $4 !~ /void/ {
14117 print substr($3, 4, 20)
14119 : Append some common names just in case the awk scan failed.
14120 xxx="$xxx ABRT ALRM BUS CANCEL CHLD CLD CONT DIL EMT FPE"
14121 xxx="$xxx FREEZE HUP ILL INT IO IOT KILL LOST LWP PHONE"
14122 xxx="$xxx PIPE POLL PROF PWR QUIT RTMAX RTMIN SEGV STKFLT STOP"
14123 xxx="$xxx SYS TERM THAW TRAP TSTP TTIN TTOU URG USR1 USR2"
14124 xxx="$xxx USR3 USR4 VTALRM WAITING WINCH WIND WINDOW XCPU XFSZ"
14126 : generate a few handy files for later
14127 $cat > signal.c <<'EOCP'
14128 #include <sys/types.h>
14129 #include <signal.h>
14133 /* Strange style to avoid deeply-nested #if/#else/#endif */
14136 # define NSIG (_NSIG)
14142 # define NSIG (SIGMAX+1)
14148 # define NSIG (SIG_MAX+1)
14154 # define NSIG (MAXSIG+1)
14160 # define NSIG (MAX_SIG+1)
14165 # ifdef SIGARRAYSIZE
14166 # define NSIG (SIGARRAYSIZE+1) /* Not sure of the +1 */
14172 # define NSIG (_sys_nsig) /* Solaris 2.5 */
14176 /* Default to some arbitrary number that's big enough to get most
14177 of the common signals.
14183 printf("NSIG %d\n", NSIG);
14189 echo $xxx | $tr ' ' $trnl | $sort | $uniq | $awk '
14191 printf "#ifdef SIG"; printf $1; printf "\n"
14192 printf "printf(\""; printf $1; printf " %%d\\n\",SIG";
14193 printf $1; printf ");\n"
14197 printf "#endif /* JUST_NSIG */\n";
14198 printf "exit(0);\n}\n";
14201 $cat >signal.awk <<'EOP'
14202 BEGIN { ndups = 0 }
14203 $1 ~ /^NSIG$/ { nsig = $2 }
14204 ($1 !~ /^NSIG$/) && (NF == 2) {
14205 if ($2 > maxsig) { maxsig = $2 }
14206 if (sig_name[$2]) {
14207 dup_name[ndups] = $1
14208 dup_num[ndups] = $2
14220 printf("NSIG %d\n", nsig);
14221 for (n = 1; n < nsig; n++) {
14223 printf("%s %d\n", sig_name[n], sig_num[n])
14226 printf("NUM%d %d\n", n, n)
14229 for (n = 0; n < ndups; n++) {
14230 printf("%s %d\n", dup_name[n], dup_num[n])
14234 $cat >signal_cmd <<EOS
14236 if $test -s signal.lst; then
14237 echo "Using your existing signal.lst file"
14242 $cat >>signal_cmd <<'EOS'
14245 if eval $compile_ok; then
14246 ./signal$_exe | $sort -n +1 | $uniq | $awk -f signal.awk >signal.lst
14248 echo "(I can't seem be able to compile the whole test program)" >&4
14249 echo "(I'll try it in little pieces.)" >&4
14250 set signal -DJUST_NSIG
14251 if eval $compile_ok; then
14252 ./signal$_exe > signal.nsg
14255 echo "I can't seem to figure out how many signals you have." >&4
14256 echo "Guessing 50." >&4
14257 echo 'NSIG 50' > signal.nsg
14259 : Now look at all the signal names, one at a time.
14260 for xx in `echo $xxx | $tr ' ' $trnl | $sort | $uniq`; do
14261 $cat > signal.c <<EOCP
14262 #include <sys/types.h>
14263 #include <signal.h>
14266 printf("$xx %d\n", SIG${xx});
14271 if eval $compile; then
14272 echo "SIG${xx} found."
14273 ./signal$_exe >> signal.ls1
14275 echo "SIG${xx} NOT found."
14278 if $test -s signal.ls1; then
14279 $cat signal.nsg signal.ls1 |
14280 $sort -n +1 | $uniq | $awk -f signal.awk >signal.lst
14284 if $test -s signal.lst; then
14287 echo "(AAK! I can't compile the test programs -- Guessing)" >&4
14288 echo 'kill -l' >signal
14289 set X `csh -f <signal`
14293 0) set HUP INT QUIT ILL TRAP ABRT EMT FPE KILL BUS SEGV SYS PIPE ALRM TERM;;
14295 echo $@ | $tr ' ' $trnl | \
14296 $awk '{ printf "%s %d\n", $1, ++s; }
14297 END { printf "NSIG %d\n", ++s }' >signal.lst
14299 $rm -f signal.c signal$_exe signal$_o signal.nsg signal.ls1
14301 chmod a+x signal_cmd
14302 $eunicefix signal_cmd
14304 : generate list of signal names
14306 case "$sig_name_init" in
14308 *) case "$sig_num_init" in
14309 ''|*,*) doinit=yes ;;
14314 echo "Generating a list of signal names and numbers..." >&4
14316 sig_count=`$awk '/^NSIG/ { printf "%d", $2 }' signal.lst`
14317 sig_name=`$awk 'BEGIN { printf "ZERO " }
14318 !/^NSIG/ { printf "%s ", $1 }' signal.lst`
14319 sig_num=`$awk 'BEGIN { printf "0 " }
14320 !/^NSIG/ { printf "%d ", $2 }' signal.lst`
14321 sig_name_init=`$awk 'BEGIN { printf "\"ZERO\", " }
14322 !/^NSIG/ { printf "\"%s\", ", $1 }
14323 END { printf "0\n" }' signal.lst`
14324 sig_num_init=`$awk 'BEGIN { printf "0, " }
14325 !/^NSIG/ { printf "%d, ", $2}
14326 END { printf "0\n"}' signal.lst`
14329 echo "The following $sig_count signals are available:"
14331 echo $sig_name | $awk \
14332 'BEGIN { linelen = 0 }
14334 for (i = 1; i <= NF; i++) {
14335 name = "SIG" $i " "
14336 linelen = linelen + length(name)
14337 if (linelen > 70) {
14339 linelen = length(name)
14345 $rm -f signal signal.c signal.awk signal.lst signal_cmd
14348 case "$sizetype" in
14349 *_t) zzz="$sizetype" ;;
14350 *) zzz="filesize" ;;
14352 echo "Checking the size of $zzz..." >&4
14354 #include <sys/types.h>
14357 printf("%d\n", (int)sizeof($sizetype));
14362 if eval $compile_ok; then
14366 echo "(I can't execute the test program--guessing $sizesize.)" >&4
14369 echo "Your $zzz size is $sizesize bytes."
14374 echo "(I can't compile the test program--guessing $sizesize.)" >&4
14378 : check for socklen_t
14380 echo "Checking to see if you have socklen_t..." >&4
14382 #include <sys/types.h>
14383 #$d_socket HAS_SOCKET
14385 #include <sys/socket.h>
14387 int main() { socklen_t x = 16; }
14390 if eval $compile; then
14392 echo "You have socklen_t."
14395 echo "You do not have socklen_t."
14396 case "$sizetype" in
14397 size_t) echo "(You do have size_t, that might work. Some people are happy with just an int.)" ;;
14404 : see if this is a socks.h system
14405 set socks.h i_socks
14408 : check for type of the size argument to socket calls
14409 case "$d_socket" in
14413 Checking to see what type is the last argument of accept().
14416 case "$d_socklen_t" in
14417 "$define") yyy="$yyy socklen_t"
14419 yyy="$yyy $sizetype int long unsigned"
14420 for xxx in $yyy; do
14421 case "$socksizetype" in
14422 '') try="extern int accept(int, struct sockaddr *, $xxx *);"
14423 case "$usesocks" in
14425 if ./protochk "$try" $i_systypes sys/types.h $d_socket sys/socket.h literal '#define INCLUDE_PROTOTYPES' $i_socks socks.h.; then
14426 echo "Your system accepts '$xxx *' for the last argument of accept()."
14427 socksizetype="$xxx"
14430 *) if ./protochk "$try" $i_systypes sys/types.h $d_socket sys/socket.h; then
14431 echo "Your system accepts '$xxx *' for the last argument of accept()."
14432 socksizetype="$xxx"
14439 : In case none of those worked, prompt the user.
14440 case "$socksizetype" in
14441 '') rp='What is the type for socket address structure sizes?'
14448 *) : no sockets, so pick relatively harmless default
14453 : see what type is used for signed size_t
14454 set ssize_t ssizetype int stdio.h sys/types.h
14457 $cat > ssize.c <<EOM
14459 #include <sys/types.h>
14460 #define Size_t $sizetype
14461 #define SSize_t $dflt
14464 if (sizeof(Size_t) == sizeof(SSize_t))
14466 else if (sizeof(Size_t) == sizeof(int))
14475 if eval $compile_ok && ./ssize > /dev/null; then
14476 ssizetype=`./ssize`
14477 echo "I'll be using $ssizetype for functions returning a byte count." >&4
14480 Help! I can't compile and run the ssize_t test program: please enlighten me!
14481 (This is probably a misconfiguration in your system or libraries, and
14482 you really ought to fix it. Still, I'll try anyway.)
14484 I need a type that is the same size as $sizetype, but is guaranteed to
14485 be signed. Common values are ssize_t, int and long.
14488 rp="What signed type is the same size as $sizetype?"
14492 $rm -f ssize ssize.*
14494 : see what type of char stdio uses.
14496 if $contains 'unsigned.*char.*_ptr;' `./findhdr stdio.h` >/dev/null 2>&1 ; then
14497 echo "Your stdio uses unsigned chars." >&4
14498 stdchar="unsigned char"
14501 if $contains 'unsigned.*char.*_ptr;' `./findhdr stdio_impl.h` >/dev/null 2>&1 ; then
14502 echo "Your stdio uses unsigned chars." >&4
14503 stdchar="unsigned char"
14505 echo "Your stdio uses signed chars." >&4
14510 : see if time exists
14512 if test "X$d_time" = X -o X"$timetype" = X; then
14513 if set time val -f d_time; eval $csym; $val; then
14514 echo 'time() found.' >&4
14516 rp="What is the type returned by time() on this system?"
14517 set time_t timetype long stdio.h sys/types.h
14520 echo 'time() not found, hope that will do.' >&4
14528 : see what type uids are declared as in the kernel
14530 echo "Looking for the type for user ids returned by getuid()."
14531 set uid_t uidtype xxx stdio.h sys/types.h
14535 xxx=`./findhdr sys/user.h`
14536 set `grep '_ruid;' "$xxx" 2>/dev/null` unsigned short
14538 unsigned) dflt="$1 $2" ;;
14542 *) dflt="$uidtype";;
14545 uid_t) echo "uid_t found." ;;
14546 *) rp="What is the type for user ids returned by getuid()?"
14554 *_t) zzz="$uidtype" ;;
14557 echo "Checking the size of $zzz..." >&4
14559 #include <sys/types.h>
14562 printf("%d\n", (int)sizeof($uidtype));
14567 if eval $compile_ok; then
14571 echo "(I can't execute the test program--guessing $uidsize.)" >&4
14574 echo "Your $zzz is $uidsize bytes long."
14579 echo "(I can't compile the test program--guessing $uidsize.)" >&4
14584 *_t) zzz="$uidtype" ;;
14587 echo "Checking the sign of $zzz..." >&4
14589 #include <sys/types.h>
14600 if eval $compile; then
14604 echo "(I can't execute the test program--guessing unsigned.)" >&4
14608 1) echo "Your $zzz is unsigned." ;;
14609 -1) echo "Your $zzz is signed." ;;
14615 echo "(I can't compile the test program--guessing unsigned.)" >&4
14621 $echo "Checking the format string to be used for uids..." >&4
14624 -1) if $test X"$uidsize" = X"$ivsize"; then
14625 uidformat="$ivdformat"
14627 if $test X"$uidsize" = X"$longsize"; then
14630 if $test X"$uidsize" = X"$intsize"; then
14633 if $test X"$uidsize" = X"$shortsize"; then
14640 *) if $test X"$uidsize" = X"$uvsize"; then
14641 uidformat="$uvuformat"
14643 if $test X"$uidsize" = X"$longsize"; then
14646 if $test X"$uidsize" = X"$intsize"; then
14649 if $test X"$uidsize" = X"$shortsize"; then
14658 : see if dbm.h is available
14659 : see if dbmclose exists
14660 set dbmclose d_dbmclose
14663 case "$d_dbmclose" in
14673 *) set rpcsvc/dbm.h i_rpcsvcdbm
14678 *) echo "We won't be including <dbm.h>"
14688 : see if this is a sys/file.h system
14693 : do we need to include sys/file.h ?
14697 if $h_sysfile; then
14699 echo "We'll be including <sys/file.h>." >&4
14702 echo "We won't be including <sys/file.h>." >&4
14712 : see if fcntl.h is there
14717 : see if we can include fcntl.h
14723 echo "We'll be including <fcntl.h>." >&4
14726 if $h_sysfile; then
14727 echo "We don't need to include <fcntl.h> if we include <sys/file.h>." >&4
14729 echo "We won't be including <fcntl.h>." >&4
14741 : see if this is a iconv.h system
14742 set iconv.h i_iconv
14745 : see if this is a ieeefp.h system
14746 set ieeefp.h i_ieeefp
14749 : see if this is a libutil.h system
14750 set libutil.h i_libutil
14753 : see if locale.h is available
14754 set locale.h i_locale
14757 : see if mach cthreads are available
14758 if test "X$usethreads" = "X$define"; then
14759 set mach/cthreads.h i_machcthr
14762 i_machcthr="$undef"
14767 : see if this is a math.h system
14771 : see if this is a mntent.h system
14772 set mntent.h i_mntent
14775 : see if ndbm.h is available
14780 : see if dbm_open exists
14781 set dbm_open d_dbm_open
14783 case "$d_dbm_open" in
14786 echo "We won't be including <ndbm.h>"
14795 : see if net/errno.h is available
14797 set net/errno.h val
14800 : Unfortunately, it causes problems on some systems. Arrgh.
14803 cat > try.c <<'EOM'
14806 #include <net/errno.h>
14812 if $cc $ccflags -c try.c >/dev/null 2>&1; then
14813 echo "We'll be including <net/errno.h>." >&4
14815 echo "We won't be including <net/errno.h>." >&4
14824 : see if netinet/tcp.h is available
14825 set netinet/tcp.h i_netinettcp
14828 : see if this is a poll.h system
14832 : see if this is a prot.h system
14837 $echo "Guessing which symbols your C compiler and preprocessor define..." >&4
14838 $cat <<'EOSH' > Cppsym.know
14839 a29k ABI64 aegis AES_SOURCE AIX AIX32 AIX370
14840 AIX41 AIX42 AIX43 AIX_SOURCE aixpc ALL_SOURCE
14841 alliant alpha am29000 AM29000 amiga AMIGAOS AMIX
14842 ansi ANSI_C_SOURCE apollo ardent atarist att386 att3b BeOS
14843 BIG_ENDIAN BIT_MSF bsd BSD bsd43 bsd4_2 bsd4_3 BSD4_3 bsd4_4
14844 BSD_4_3 BSD_4_4 BSD_NET2 BSD_TIME BSD_TYPES BSDCOMPAT bsdi
14845 bull c cadmus clipper CMU COFF COMPILER_VERSION
14846 concurrent convex cpu cray CRAY CRAYMPP ctix CX_UX
14847 CYGWIN DGUX DGUX_SOURCE DJGPP dmert DOLPHIN DPX2 DSO
14848 Dynix DynixPTX ELF encore EPI EXTENSIONS FILE_OFFSET_BITS
14849 FreeBSD GCC_NEW_VARARGS gcos gcx gimpel
14850 GNU_SOURCE GNUC GNUC_MINOR GO32 gould GOULD_PN
14851 H3050R H3050RX hbullx20 hcx host_mips
14852 hp200 hp300 hp700 HP700 hp800 hp9000
14853 hp9000s200 hp9000s300 hp9000s400 hp9000s500
14854 hp9000s700 hp9000s800 hp9k8 hp_osf hppa hpux HPUX_SOURCE
14855 i186 i286 i386 i486 i586 i686 i8086 i80960 i860 I960
14856 iAPX286 ibm ibm032 ibmesa IBMR2 ibmrt ILP32 ILP64
14857 INLINE_INTRINSICS INTRINSICS INT64 interdata is68k ksr1
14858 LANGUAGE_C LARGE_FILE_API LARGEFILE64_SOURCE
14859 LARGEFILE_SOURCE LFS64_LARGEFILE LFS_LARGEFILE
14860 Linux LITTLE_ENDIAN LONG64 LONG_DOUBLE LONG_LONG
14861 LONGDOUBLE LONGLONG LP64 luna luna88k Lynx
14862 M68000 m68k m88100 m88k M88KBCS_TARGET M_COFF
14863 M_I186 M_I286 M_I386 M_I8086 M_I86 M_I86SM M_SYS3
14864 M_SYS5 M_SYSIII M_SYSV M_UNIX M_XENIX MACH machine MachTen
14865 MATH_HAS_NO_SIDE_EFFECTS
14866 mc300 mc500 mc68000 mc68010 mc68020 mc68030 mc68040
14867 mc68060 mc68k mc68k32 mc700 mc88000 mc88100 merlin
14868 mert MiNT mips MIPS_FPSET MIPS_ISA MIPS_SIM MIPS_SZINT
14869 MIPS_SZLONG MIPS_SZPTR MIPSEB MIPSEL MODERN_C motorola
14870 mpeix MSDOS MTXINU MULTIMAX mvs MVS n16 ncl_el ncl_mr
14871 NetBSD news1500 news1700 news1800 news1900 news3700
14872 news700 news800 news900 NeXT NLS nonstopux ns16000 ns32000
14873 ns32016 ns32332 ns32k nsc32000
14874 OCS88 OEMVS OpenBSD os OS2 OS390 osf OSF1 OSF_SOURCE
14875 pa_risc PA_RISC1_1 PA_RISC2_0 PARAGON parisc
14876 pc532 pdp11 PGC PIC plexus PORTAR posix
14877 POSIX1B_SOURCE POSIX2_SOURCE POSIX4_SOURCE
14878 POSIX_C_SOURCE POSIX_SOURCE POWER
14879 PROTOTYPES PWB pyr QNX R3000 REENTRANT RES Rhapsody RISC6000
14880 riscix riscos RT scs SCO sequent sgi SGI_SOURCE sinix
14881 SIZE_INT SIZE_LONG SIZE_PTR SOCKET_SOURCE SOCKETS_SOURCE
14882 sony sony_news sonyrisc sparc sparclite spectrum
14883 stardent stdc STDC_EXT stratos sun sun3 sun386
14884 Sun386i svr3 svr4 SVR4_2 SVR4_SOURCE svr5
14885 SX system SYSTYPE_BSD SYSTYPE_BSD43 SYSTYPE_BSD44
14886 SYSTYPE_SVR4 SYSTYPE_SVR5 SYSTYPE_SYSV SYSV SYSV3 SYSV4 SYSV5
14887 sysV68 sysV88 Tek4132 Tek4300 titan
14888 tower tower32 tower32_200 tower32_600 tower32_700
14889 tower32_800 tower32_850 tss
14890 u370 u3b u3b2 u3b20 u3b200 u3b20d u3b5
14891 ultrix UMAXV UnicomPBB UnicomPBD UNICOS UNICOSMK
14892 unix UNIX95 UNIX99 unixpc unos USGr4 USGr4_2
14893 Utek UTek UTS UWIN uxpm uxps vax venix VMESA vms xenix Xenix286
14894 XOPEN_SOURCE XOPEN_SOURCE_EXTENDED XPG2 XPG2_EXTENDED
14895 XPG3 XPG3_EXTENDED XPG4 XPG4_EXTENDED
14898 # Maybe put other stuff here too.
14899 cat <<EOSH >>Cppsym.know
14902 ./tr '[a-z]' '[A-Z]' < Cppsym.know > Cppsym.a
14903 ./tr '[A-Z]' '[a-z]' < Cppsym.know > Cppsym.b
14904 $cat Cppsym.know > Cppsym.c
14905 $cat Cppsym.a Cppsym.b Cppsym.c | $tr ' ' $trnl | $sort | $uniq > Cppsym.know
14906 $rm -f Cppsym.a Cppsym.b Cppsym.c
14907 cat <<EOSH > Cppsym
14909 if $test \$# -gt 0; then
14910 echo \$* | $tr " " "$trnl" | ./Cppsym.try > Cppsym.got
14911 if $test -s Cppsym.got; then
14918 $tr " " "$trnl" | ./Cppsym.try
14924 cat <<EOSH > Cppsym.try
14926 cat <<'EOCP' > try.c
14932 cat <<'EOSH' >> Cppsym.try
14934 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
14935 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
14936 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
14937 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
14941 cat <<EOSH >> Cppsym.try
14943 case "$osname-$gccversion" in
14944 irix-) ccflags="\$ccflags -woff 1178" ;;
14945 os2-*) ccflags="\$ccflags -Zlinker /PM:VIO" ;;
14947 $cc -o try $optimize \$ccflags $ldflags try.c $libs && ./try$exe_ext
14949 chmod +x Cppsym.try
14950 $eunicefix Cppsym.try
14951 ./Cppsym < Cppsym.know > Cppsym.true
14952 : now check the C compiler for additional symbols
14953 postprocess_cc_v=''
14955 aix) postprocess_cc_v="|$tr , ' '" ;;
14962 for i in \`$cc -v -c tmp.c 2>&1 $postprocess_cc_v\`
14965 -D*) echo "\$i" | $sed 's/^-D//';;
14966 -A*) $test "$gccversion" && echo "\$i" | $sed 's/^-A\(.*\)(\(.*\))/\1=\2/';;
14971 postprocess_cc_v=''
14974 ./ccsym > ccsym1.raw
14975 if $test -s ccsym1.raw; then
14976 $sort ccsym1.raw | $uniq >ccsym.raw
14978 mv ccsym1.raw ccsym.raw
14981 $awk '/\=/ { print $0; next }
14982 { print $0"=1" }' ccsym.raw >ccsym.list
14983 $awk '/\=/ { print $0; next }
14984 { print $0"=1" }' Cppsym.true >ccsym.true
14985 $comm -13 ccsym.true ccsym.list >ccsym.own
14986 $comm -12 ccsym.true ccsym.list >ccsym.com
14987 $comm -23 ccsym.true ccsym.list >ccsym.cpp
14989 if $test -z ccsym.raw; then
14990 echo "Your C compiler doesn't seem to define any symbols!" >&4
14992 echo "However, your C preprocessor defines the following symbols:"
14995 cppsymbols=`$cat Cppsym.true`
14996 cppsymbols=`echo $cppsymbols`
14997 cppccsymbols="$cppsymbols"
14999 if $test -s ccsym.com; then
15000 echo "Your C compiler and pre-processor define these symbols:"
15001 $sed -e 's/\(..*\)=.*/\1/' ccsym.com
15004 cppccsymbols=`$cat ccsym.com`
15005 cppccsymbols=`echo $cppccsymbols`
15006 $test "$silent" || sleep 1
15008 if $test -s ccsym.cpp; then
15009 $test "$also" && echo " "
15010 echo "Your C pre-processor ${also}defines the following symbols:"
15011 $sed -e 's/\(..*\)=.*/\1/' ccsym.cpp
15013 cppsymbols=`$cat ccsym.cpp`
15014 cppsymbols=`echo $cppsymbols`
15015 $test "$silent" || sleep 1
15017 if $test -s ccsym.own; then
15018 $test "$also" && echo " "
15019 echo "Your C compiler ${also}defines the following cpp symbols:"
15020 $sed -e 's/\(..*\)=1/\1/' ccsym.own
15021 $sed -e 's/\(..*\)=.*/\1/' ccsym.own | $uniq >>Cppsym.true
15022 ccsymbols=`$cat ccsym.own`
15023 ccsymbols=`echo $ccsymbols`
15024 $test "$silent" || sleep 1
15027 $rm -f ccsym* Cppsym.*
15029 : see if this is a termio system
15033 if $test `./findhdr termios.h`; then
15034 set tcsetattr i_termios
15040 "$define") echo "You have POSIX termios.h... good!" >&4;;
15041 *) if ./Cppsym pyr; then
15042 case "`/bin/universe`" in
15043 ucb) if $test `./findhdr sgtty.h`; then
15045 echo "<sgtty.h> found." >&4
15047 echo "System is pyramid with BSD universe."
15048 echo "<sgtty.h> not found--you could have problems." >&4
15050 *) if $test `./findhdr termio.h`; then
15052 echo "<termio.h> found." >&4
15054 echo "System is pyramid with USG universe."
15055 echo "<termio.h> not found--you could have problems." >&4
15059 if $test `./findhdr termio.h`; then
15060 echo "<termio.h> found." >&4
15062 elif $test `./findhdr sgtty.h`; then
15063 echo "<sgtty.h> found." >&4
15066 echo "Neither <termio.h> nor <sgtty.h> found--you could have problems." >&4
15069 if $test `./findhdr sgtty.h`; then
15070 echo "<sgtty.h> found." >&4
15072 elif $test `./findhdr termio.h`; then
15073 echo "<termio.h> found." >&4
15076 echo "Neither <sgtty.h> nor <termio.h> found--you could have problems." >&4
15080 set i_termio; eval $setvar
15081 val=$val2; set i_sgtty; eval $setvar
15082 val=$val3; set i_termios; eval $setvar
15084 : see if this is a shadow.h system
15085 set shadow.h i_shadow
15088 : see if stddef is available
15089 set stddef.h i_stddef
15092 : see if this is a sunmath.h system
15093 set sunmath.h i_sunmath
15096 : see if sys/access.h is available
15097 set sys/access.h i_sysaccess
15100 : see if ioctl defs are in sgtty, termio, sys/filio or sys/ioctl
15101 set sys/filio.h i_sysfilio
15104 if $test `./findhdr sys/ioctl.h`; then
15106 echo '<sys/ioctl.h> found.' >&4
15109 if $test $i_sysfilio = "$define"; then
15110 echo '<sys/ioctl.h> NOT found.' >&4
15112 $test $i_sgtty = "$define" && xxx="sgtty.h"
15113 $test $i_termio = "$define" && xxx="termio.h"
15114 $test $i_termios = "$define" && xxx="termios.h"
15115 echo "No <sys/ioctl.h> found, assuming ioctl args are defined in <$xxx>." >&4
15122 : see if this is a syslog.h system
15123 set syslog.h i_syslog
15127 : see if this is a sys/mode.h system
15128 set sys/mode.h i_sysmode
15131 : see if sys/resource.h has to be included
15132 set sys/resource.h i_sysresrc
15135 : see if sys/security.h is available
15136 set sys/security.h i_syssecrt
15139 : see if this is a sys/statvfs.h system
15140 set sys/statvfs.h i_sysstatvfs
15143 : see if this is a sys/uio.h system
15144 set sys/uio.h i_sysuio
15147 : see if this is a sys/un.h system
15148 set sys/un.h i_sysun
15152 : see if this is a sys/utsname.h system
15153 set sys/utsname.h i_sysutsname
15156 : see if this is a syswait system
15157 set sys/wait.h i_syswait
15160 : see if this is a ustat.h system
15161 set ustat.h i_ustat
15164 : see if this is an utime system
15165 set utime.h i_utime
15168 : see if this is a values.h system
15169 set values.h i_values
15172 : see if this is a vfork system
15175 set vfork.h i_vfork
15183 : see if gdbm.h is available
15188 : see if gdbm_open exists
15189 set gdbm_open d_gdbm_open
15191 case "$d_gdbm_open" in
15194 echo "We won't be including <gdbm.h>"
15204 echo "Looking for extensions..." >&4
15205 : If we are using the old config.sh, known_extensions may contain
15206 : old or inaccurate or duplicate values.
15207 known_extensions=''
15208 nonxs_extensions=''
15209 : We do not use find because it might not be available.
15210 : We do not just use MANIFEST because the user may have dropped
15211 : some additional extensions into the source tree and expect them
15214 : Function to recursively find available extensions, ignoring DynaLoader
15215 : NOTE: recursion limit of 10 to prevent runaway in case of symlink madness
15219 DynaLoader|dynaload) ;;
15221 if $test -f $xxx/$xxx.xs; then
15222 known_extensions="$known_extensions $1$xxx";
15223 elif $test -f $xxx/Makefile.PL; then
15224 nonxs_extensions="$nonxs_extensions $1$xxx";
15226 if $test -d $xxx -a $# -lt 10; then
15229 eval $find_extensions;
15241 eval $find_extensions
15242 set X $nonxs_extensions
15244 nonxs_extensions="$*"
15245 set X $known_extensions
15247 known_extensions="$*"
15250 : Now see which are supported on this system.
15252 for xxx in $known_extensions ; do
15256 $define) avail_ext="$avail_ext $xxx" ;;
15259 GDBM_File|gdbm_fil)
15261 $define) avail_ext="$avail_ext $xxx" ;;
15264 NDBM_File|ndbm_fil)
15267 case "$osname-$use64bitint" in
15270 *-lndbm*) avail_ext="$avail_ext $xxx" ;;
15273 *) avail_ext="$avail_ext $xxx" ;;
15278 ODBM_File|odbm_fil)
15279 case "${i_dbm}${i_rpcsvcdbm}" in
15281 case "$osname-$use64bitint" in
15284 *-ldbm*) avail_ext="$avail_ext $xxx" ;;
15287 *) avail_ext="$avail_ext $xxx" ;;
15293 case "$useposix" in
15294 true|define|y) avail_ext="$avail_ext $xxx" ;;
15298 case "$useopcode" in
15299 true|define|y) avail_ext="$avail_ext $xxx" ;;
15303 case "$d_socket" in
15304 true|$define|y) avail_ext="$avail_ext $xxx" ;;
15307 Sys/Syslog|sys/syslog)
15308 : XXX syslog requires socket
15309 case "$d_socket" in
15310 true|$define|y) avail_ext="$avail_ext $xxx" ;;
15314 case "$usethreads" in
15315 true|$define|y) avail_ext="$avail_ext $xxx" ;;
15319 : XXX Do we need a useipcsysv variable here
15320 case "${d_msg}${d_sem}${d_shm}" in
15321 *"${define}"*) avail_ext="$avail_ext $xxx" ;;
15324 *) avail_ext="$avail_ext $xxx"
15333 : Now see which nonxs extensions are supported on this system.
15334 : For now assume all are.
15336 for xxx in $nonxs_extensions ; do
15338 *) nonxs_ext="$nonxs_ext $xxx"
15350 A number of extensions are supplied with $package. You may choose to
15351 compile these extensions for dynamic loading (the default), compile
15352 them into the $package executable (static loading), or not include
15353 them at all. Answer "none" to include no extensions.
15354 Note that DynaLoader is always built and need not be mentioned here.
15357 case "$dynamic_ext" in
15358 '') dflt="$avail_ext" ;;
15359 *) dflt="$dynamic_ext"
15360 # Perhaps we are reusing an old out-of-date config.sh.
15363 if test X"$dynamic_ext" != X"$avail_ext"; then
15365 NOTICE: Your previous config.sh list may be incorrect.
15366 The extensions now available to you are
15368 but the default list from your previous config.sh is
15380 rp="What extensions do you wish to load dynamically?"
15383 none) dynamic_ext=' ' ;;
15384 *) dynamic_ext="$ans" ;;
15387 case "$static_ext" in
15389 : Exclude those already listed in dynamic linking
15391 for xxx in $avail_ext; do
15392 case " $dynamic_ext " in
15394 *) dflt="$dflt $xxx" ;;
15401 *) dflt="$static_ext"
15408 rp="What extensions do you wish to load statically?"
15411 none) static_ext=' ' ;;
15412 *) static_ext="$ans" ;;
15417 A number of extensions are supplied with $package. Answer "none"
15418 to include no extensions.
15419 Note that DynaLoader is always built and need not be mentioned here.
15422 case "$static_ext" in
15423 '') dflt="$avail_ext" ;;
15424 *) dflt="$static_ext"
15425 # Perhaps we are reusing an old out-of-date config.sh.
15428 if test X"$static_ext" != X"$avail_ext"; then
15430 NOTICE: Your previous config.sh list may be incorrect.
15431 The extensions now available to you are
15433 but the default list from your previous config.sh is
15442 : Exclude those that are not xs extensions
15446 rp="What extensions do you wish to include?"
15449 none) static_ext=' ' ;;
15450 *) static_ext="$ans" ;;
15455 set X $dynamic_ext $static_ext $nonxs_ext
15459 : Remove libraries needed only for extensions
15460 : The appropriate ext/Foo/Makefile.PL will add them back in, if necessary.
15461 : The exception is SunOS 4.x, which needs them.
15462 case "${osname}X${osvers}" in
15466 *) case "$usedl" in
15467 $define|true|[yY]*)
15468 set X `echo " $libs " | sed -e 's@ -lndbm @ @' -e 's@ -lgdbm @ @' -e 's@ -ldbm @ @' -e 's@ -ldb @ @'`
15472 *) perllibs="$libs"
15478 : Remove build directory name from cppstdin so it can be used from
15479 : either the present location or the final installed location.
15481 : Get out of the UU directory to get correct path name.
15483 case "$cppstdin" in
15485 echo "Stripping down cppstdin path name"
15491 : end of configuration questions
15493 echo "End of configuration questions."
15496 : back to where it started
15497 if test -d ../UU; then
15501 : configuration may be patched via a 'config.over' file
15502 if $test -f config.over; then
15505 rp='I see a config.over file. Do you wish to load it?'
15508 n*) echo "OK, I'll ignore it.";;
15510 echo "Configuration override changes have been loaded."
15515 : in case they want portability, strip down executable paths
15516 case "$d_portable" in
15519 echo "Stripping down executable paths..." >&4
15520 for file in $loclist $trylist; do
15522 eval $file=`basename $temp`
15527 : create config.sh file
15529 echo "Creating config.sh..." >&4
15530 $spitshell <<EOT >config.sh
15533 # This file was produced by running the Configure script. It holds all the
15534 # definitions figured out by Configure. Should you modify one of these values,
15535 # do not forget to propagate your changes by running "Configure -der". You may
15536 # instead choose to run each of the .SH files by yourself, or "Configure -S".
15539 # Package name : $package
15540 # Source directory : $src
15541 # Configuration time: $cf_time
15542 # Configured by : $cf_by
15543 # Target system : $myuname
15553 Revision='$Revision'
15560 alignbytes='$alignbytes'
15561 ansi2knr='$ansi2knr'
15562 aphostname='$aphostname'
15563 api_revision='$api_revision'
15564 api_subversion='$api_subversion'
15565 api_version='$api_version'
15566 api_versionstring='$api_versionstring'
15569 archlibexp='$archlibexp'
15570 archname64='$archname64'
15571 archname='$archname'
15572 archobjs='$archobjs'
15577 bincompat5005='$bincompat5005'
15581 byteorder='$byteorder'
15583 castflags='$castflags'
15586 cccdlflags='$cccdlflags'
15587 ccdlflags='$ccdlflags'
15589 ccflags_uselargefiles='$ccflags_uselargefiles'
15591 ccsymbols='$ccsymbols'
15592 ccversion='$ccversion'
15594 cf_email='$cf_email'
15596 charsize='$charsize'
15600 clocktype='$clocktype'
15602 compress='$compress'
15603 contains='$contains'
15607 cpp_stuff='$cpp_stuff'
15608 cppccsymbols='$cppccsymbols'
15609 cppflags='$cppflags'
15611 cppminus='$cppminus'
15613 cppstdin='$cppstdin'
15614 cppsymbols='$cppsymbols'
15615 crosscompile='$crosscompile'
15616 cryptlib='$cryptlib'
15618 d_Gconvert='$d_Gconvert'
15619 d_PRIEUldbl='$d_PRIEUldbl'
15620 d_PRIFUldbl='$d_PRIFUldbl'
15621 d_PRIGUldbl='$d_PRIGUldbl'
15622 d_PRIXU64='$d_PRIXU64'
15623 d_PRId64='$d_PRId64'
15624 d_PRIeldbl='$d_PRIeldbl'
15625 d_PRIfldbl='$d_PRIfldbl'
15626 d_PRIgldbl='$d_PRIgldbl'
15627 d_PRIi64='$d_PRIi64'
15628 d_PRIo64='$d_PRIo64'
15629 d_PRIu64='$d_PRIu64'
15630 d_PRIx64='$d_PRIx64'
15631 d_SCNfldbl='$d_SCNfldbl'
15632 d__fwalk='$d__fwalk'
15633 d_access='$d_access'
15634 d_accessx='$d_accessx'
15636 d_archlib='$d_archlib'
15639 d_attribut='$d_attribut'
15642 d_bincompat5005='$d_bincompat5005'
15644 d_bsdgetpgrp='$d_bsdgetpgrp'
15645 d_bsdsetpgrp='$d_bsdsetpgrp'
15647 d_casti32='$d_casti32'
15648 d_castneg='$d_castneg'
15649 d_charvspr='$d_charvspr'
15651 d_chroot='$d_chroot'
15652 d_chsize='$d_chsize'
15653 d_closedir='$d_closedir'
15657 d_cuserid='$d_cuserid'
15658 d_dbl_dig='$d_dbl_dig'
15659 d_difftime='$d_difftime'
15660 d_dirnamlen='$d_dirnamlen'
15661 d_dlerror='$d_dlerror'
15662 d_dlopen='$d_dlopen'
15663 d_dlsymun='$d_dlsymun'
15664 d_dosuid='$d_dosuid'
15665 d_drand48proto='$d_drand48proto'
15667 d_eaccess='$d_eaccess'
15668 d_endgrent='$d_endgrent'
15669 d_endhent='$d_endhent'
15670 d_endnent='$d_endnent'
15671 d_endpent='$d_endpent'
15672 d_endpwent='$d_endpwent'
15673 d_endsent='$d_endsent'
15674 d_eofnblk='$d_eofnblk'
15675 d_eunice='$d_eunice'
15676 d_fchmod='$d_fchmod'
15677 d_fchown='$d_fchown'
15679 d_fcntl_can_lock='$d_fcntl_can_lock'
15680 d_fd_macros='$d_fd_macros'
15681 d_fd_set='$d_fd_set'
15682 d_fds_bits='$d_fds_bits'
15683 d_fgetpos='$d_fgetpos'
15684 d_flexfnam='$d_flexfnam'
15687 d_fpathconf='$d_fpathconf'
15688 d_fpos64_t='$d_fpos64_t'
15689 d_frexpl='$d_frexpl'
15690 d_fs_data_s='$d_fs_data_s'
15691 d_fseeko='$d_fseeko'
15692 d_fsetpos='$d_fsetpos'
15693 d_fstatfs='$d_fstatfs'
15694 d_fstatvfs='$d_fstatvfs'
15696 d_ftello='$d_ftello'
15698 d_getcwd='$d_getcwd'
15699 d_getespwnam='$d_getespwnam'
15700 d_getfsstat='$d_getfsstat'
15701 d_getgrent='$d_getgrent'
15702 d_getgrps='$d_getgrps'
15703 d_gethbyaddr='$d_gethbyaddr'
15704 d_gethbyname='$d_gethbyname'
15705 d_gethent='$d_gethent'
15706 d_gethname='$d_gethname'
15707 d_gethostprotos='$d_gethostprotos'
15708 d_getlogin='$d_getlogin'
15709 d_getmnt='$d_getmnt'
15710 d_getmntent='$d_getmntent'
15711 d_getnbyaddr='$d_getnbyaddr'
15712 d_getnbyname='$d_getnbyname'
15713 d_getnent='$d_getnent'
15714 d_getnetprotos='$d_getnetprotos'
15715 d_getpagsz='$d_getpagsz'
15716 d_getpbyname='$d_getpbyname'
15717 d_getpbynumber='$d_getpbynumber'
15718 d_getpent='$d_getpent'
15719 d_getpgid='$d_getpgid'
15720 d_getpgrp2='$d_getpgrp2'
15721 d_getpgrp='$d_getpgrp'
15722 d_getppid='$d_getppid'
15723 d_getprior='$d_getprior'
15724 d_getprotoprotos='$d_getprotoprotos'
15725 d_getprpwnam='$d_getprpwnam'
15726 d_getpwent='$d_getpwent'
15727 d_getsbyname='$d_getsbyname'
15728 d_getsbyport='$d_getsbyport'
15729 d_getsent='$d_getsent'
15730 d_getservprotos='$d_getservprotos'
15731 d_getspnam='$d_getspnam'
15732 d_gettimeod='$d_gettimeod'
15733 d_gnulibc='$d_gnulibc'
15734 d_grpasswd='$d_grpasswd'
15735 d_hasmntopt='$d_hasmntopt'
15739 d_inetaton='$d_inetaton'
15740 d_int64_t='$d_int64_t'
15741 d_isascii='$d_isascii'
15743 d_isnanl='$d_isnanl'
15744 d_killpg='$d_killpg'
15745 d_lchown='$d_lchown'
15746 d_ldbl_dig='$d_ldbl_dig'
15748 d_locconv='$d_locconv'
15750 d_longdbl='$d_longdbl'
15751 d_longlong='$d_longlong'
15752 d_lseekproto='$d_lseekproto'
15754 d_madvise='$d_madvise'
15756 d_mbstowcs='$d_mbstowcs'
15757 d_mbtowc='$d_mbtowc'
15758 d_memchr='$d_memchr'
15759 d_memcmp='$d_memcmp'
15760 d_memcpy='$d_memcpy'
15761 d_memmove='$d_memmove'
15762 d_memset='$d_memset'
15764 d_mkdtemp='$d_mkdtemp'
15765 d_mkfifo='$d_mkfifo'
15766 d_mkstemp='$d_mkstemp'
15767 d_mkstemps='$d_mkstemps'
15768 d_mktime='$d_mktime'
15771 d_mprotect='$d_mprotect'
15773 d_msg_ctrunc='$d_msg_ctrunc'
15774 d_msg_dontroute='$d_msg_dontroute'
15775 d_msg_oob='$d_msg_oob'
15776 d_msg_peek='$d_msg_peek'
15777 d_msg_proxy='$d_msg_proxy'
15778 d_msgctl='$d_msgctl'
15779 d_msgget='$d_msgget'
15780 d_msgrcv='$d_msgrcv'
15781 d_msgsnd='$d_msgsnd'
15783 d_munmap='$d_munmap'
15784 d_mymalloc='$d_mymalloc'
15786 d_nv_preserves_uv='$d_nv_preserves_uv'
15787 d_nv_preserves_uv_bits='$d_nv_preserves_uv_bits'
15788 d_off64_t='$d_off64_t'
15789 d_old_pthread_create_joinable='$d_old_pthread_create_joinable'
15790 d_oldpthreads='$d_oldpthreads'
15791 d_oldsock='$d_oldsock'
15793 d_pathconf='$d_pathconf'
15795 d_perl_otherlibdirs='$d_perl_otherlibdirs'
15796 d_phostname='$d_phostname'
15799 d_portable='$d_portable'
15800 d_pthread_yield='$d_pthread_yield'
15802 d_pwchange='$d_pwchange'
15803 d_pwclass='$d_pwclass'
15804 d_pwcomment='$d_pwcomment'
15805 d_pwexpire='$d_pwexpire'
15806 d_pwgecos='$d_pwgecos'
15807 d_pwpasswd='$d_pwpasswd'
15808 d_pwquota='$d_pwquota'
15811 d_readdir='$d_readdir'
15812 d_readlink='$d_readlink'
15813 d_rename='$d_rename'
15814 d_rewinddir='$d_rewinddir'
15816 d_safebcpy='$d_safebcpy'
15817 d_safemcpy='$d_safemcpy'
15818 d_sanemcmp='$d_sanemcmp'
15819 d_sbrkproto='$d_sbrkproto'
15820 d_sched_yield='$d_sched_yield'
15821 d_scm_rights='$d_scm_rights'
15822 d_seekdir='$d_seekdir'
15823 d_select='$d_select'
15825 d_semctl='$d_semctl'
15826 d_semctl_semid_ds='$d_semctl_semid_ds'
15827 d_semctl_semun='$d_semctl_semun'
15828 d_semget='$d_semget'
15830 d_setegid='$d_setegid'
15831 d_seteuid='$d_seteuid'
15832 d_setgrent='$d_setgrent'
15833 d_setgrps='$d_setgrps'
15834 d_sethent='$d_sethent'
15835 d_setlinebuf='$d_setlinebuf'
15836 d_setlocale='$d_setlocale'
15837 d_setnent='$d_setnent'
15838 d_setpent='$d_setpent'
15839 d_setpgid='$d_setpgid'
15840 d_setpgrp2='$d_setpgrp2'
15841 d_setpgrp='$d_setpgrp'
15842 d_setprior='$d_setprior'
15843 d_setproctitle='$d_setproctitle'
15844 d_setpwent='$d_setpwent'
15845 d_setregid='$d_setregid'
15846 d_setresgid='$d_setresgid'
15847 d_setresuid='$d_setresuid'
15848 d_setreuid='$d_setreuid'
15849 d_setrgid='$d_setrgid'
15850 d_setruid='$d_setruid'
15851 d_setsent='$d_setsent'
15852 d_setsid='$d_setsid'
15853 d_setvbuf='$d_setvbuf'
15857 d_shmatprototype='$d_shmatprototype'
15858 d_shmctl='$d_shmctl'
15860 d_shmget='$d_shmget'
15861 d_sigaction='$d_sigaction'
15862 d_sigsetjmp='$d_sigsetjmp'
15863 d_socket='$d_socket'
15864 d_socklen_t='$d_socklen_t'
15865 d_sockpair='$d_sockpair'
15866 d_socks5_init='$d_socks5_init'
15868 d_statblks='$d_statblks'
15869 d_statfs_f_flags='$d_statfs_f_flags'
15870 d_statfs_s='$d_statfs_s'
15871 d_statvfs='$d_statvfs'
15872 d_stdio_cnt_lval='$d_stdio_cnt_lval'
15873 d_stdio_ptr_lval='$d_stdio_ptr_lval'
15874 d_stdio_ptr_lval_nochange_cnt='$d_stdio_ptr_lval_nochange_cnt'
15875 d_stdio_ptr_lval_sets_cnt='$d_stdio_ptr_lval_sets_cnt'
15876 d_stdio_stream_array='$d_stdio_stream_array'
15877 d_stdiobase='$d_stdiobase'
15878 d_stdstdio='$d_stdstdio'
15879 d_strchr='$d_strchr'
15880 d_strcoll='$d_strcoll'
15881 d_strctcpy='$d_strctcpy'
15882 d_strerrm='$d_strerrm'
15883 d_strerror='$d_strerror'
15884 d_strtod='$d_strtod'
15885 d_strtol='$d_strtol'
15886 d_strtold='$d_strtold'
15887 d_strtoll='$d_strtoll'
15888 d_strtoul='$d_strtoul'
15889 d_strtoull='$d_strtoull'
15890 d_strtouq='$d_strtouq'
15891 d_strxfrm='$d_strxfrm'
15892 d_suidsafe='$d_suidsafe'
15893 d_symlink='$d_symlink'
15894 d_syscall='$d_syscall'
15895 d_sysconf='$d_sysconf'
15896 d_sysernlst='$d_sysernlst'
15897 d_syserrlst='$d_syserrlst'
15898 d_system='$d_system'
15899 d_tcgetpgrp='$d_tcgetpgrp'
15900 d_tcsetpgrp='$d_tcsetpgrp'
15901 d_telldir='$d_telldir'
15902 d_telldirproto='$d_telldirproto'
15905 d_truncate='$d_truncate'
15906 d_tzname='$d_tzname'
15909 d_union_semun='$d_union_semun'
15911 d_vendorarch='$d_vendorarch'
15912 d_vendorbin='$d_vendorbin'
15913 d_vendorlib='$d_vendorlib'
15915 d_void_closedir='$d_void_closedir'
15916 d_voidsig='$d_voidsig'
15917 d_voidtty='$d_voidtty'
15918 d_volatile='$d_volatile'
15919 d_vprintf='$d_vprintf'
15921 d_waitpid='$d_waitpid'
15922 d_wcstombs='$d_wcstombs'
15923 d_wctomb='$d_wctomb'
15926 db_hashtype='$db_hashtype'
15927 db_prefixtype='$db_prefixtype'
15928 defvoidused='$defvoidused'
15929 direntrytype='$direntrytype'
15932 doublesize='$doublesize'
15934 dynamic_ext='$dynamic_ext'
15940 eunicefix='$eunicefix'
15943 extensions='$extensions'
15944 fflushNULL='$fflushNULL'
15945 fflushall='$fflushall'
15947 firstmakefile='$firstmakefile'
15949 fpossize='$fpossize'
15950 fpostype='$fpostype'
15951 freetype='$freetype'
15953 full_csh='$full_csh'
15954 full_sed='$full_sed'
15955 gccosandvers='$gccosandvers'
15956 gccversion='$gccversion'
15957 gidformat='$gidformat'
15963 groupcat='$groupcat'
15964 groupstype='$groupstype'
15967 h_sysfile='$h_sysfile'
15978 i_arpainet='$i_arpainet'
15979 i_bsdioctl='$i_bsdioctl'
15982 i_dirent='$i_dirent'
15990 i_ieeefp='$i_ieeefp'
15991 i_inttypes='$i_inttypes'
15992 i_libutil='$i_libutil'
15993 i_limits='$i_limits'
15994 i_locale='$i_locale'
15995 i_machcthr='$i_machcthr'
15996 i_malloc='$i_malloc'
15998 i_memory='$i_memory'
15999 i_mntent='$i_mntent'
16002 i_neterrno='$i_neterrno'
16003 i_netinettcp='$i_netinettcp'
16007 i_pthread='$i_pthread'
16009 i_rpcsvcdbm='$i_rpcsvcdbm'
16012 i_shadow='$i_shadow'
16014 i_stdarg='$i_stdarg'
16015 i_stddef='$i_stddef'
16016 i_stdlib='$i_stdlib'
16017 i_string='$i_string'
16018 i_sunmath='$i_sunmath'
16019 i_sysaccess='$i_sysaccess'
16020 i_sysdir='$i_sysdir'
16021 i_sysfile='$i_sysfile'
16022 i_sysfilio='$i_sysfilio'
16024 i_sysioctl='$i_sysioctl'
16025 i_syslog='$i_syslog'
16026 i_sysmman='$i_sysmman'
16027 i_sysmode='$i_sysmode'
16028 i_sysmount='$i_sysmount'
16029 i_sysndir='$i_sysndir'
16030 i_sysparam='$i_sysparam'
16031 i_sysresrc='$i_sysresrc'
16032 i_syssecrt='$i_syssecrt'
16033 i_sysselct='$i_sysselct'
16034 i_syssockio='$i_syssockio'
16035 i_sysstat='$i_sysstat'
16036 i_sysstatfs='$i_sysstatfs'
16037 i_sysstatvfs='$i_sysstatvfs'
16038 i_systime='$i_systime'
16039 i_systimek='$i_systimek'
16040 i_systimes='$i_systimes'
16041 i_systypes='$i_systypes'
16042 i_sysuio='$i_sysuio'
16044 i_sysutsname='$i_sysutsname'
16045 i_sysvfs='$i_sysvfs'
16046 i_syswait='$i_syswait'
16047 i_termio='$i_termio'
16048 i_termios='$i_termios'
16050 i_unistd='$i_unistd'
16053 i_values='$i_values'
16054 i_varargs='$i_varargs'
16055 i_varhdr='$i_varhdr'
16057 ignore_versioned_solibs='$ignore_versioned_solibs'
16058 inc_version_list='$inc_version_list'
16059 inc_version_list_init='$inc_version_list_init'
16062 installarchlib='$installarchlib'
16063 installbin='$installbin'
16064 installman1dir='$installman1dir'
16065 installman3dir='$installman3dir'
16066 installprefix='$installprefix'
16067 installprefixexp='$installprefixexp'
16068 installprivlib='$installprivlib'
16069 installscript='$installscript'
16070 installsitearch='$installsitearch'
16071 installsitebin='$installsitebin'
16072 installsitelib='$installsitelib'
16073 installstyle='$installstyle'
16074 installusrbinperl='$installusrbinperl'
16075 installvendorarch='$installvendorarch'
16076 installvendorbin='$installvendorbin'
16077 installvendorlib='$installvendorlib'
16079 ivdformat='$ivdformat'
16082 known_extensions='$known_extensions'
16085 lddlflags='$lddlflags'
16087 ldflags_uselargefiles='$ldflags_uselargefiles'
16088 ldlibpthname='$ldlibpthname'
16095 libsdirs='$libsdirs'
16096 libsfiles='$libsfiles'
16097 libsfound='$libsfound'
16098 libspath='$libspath'
16099 libswanted='$libswanted'
16100 libswanted_uselargefiles='$libswanted_uselargefiles'
16106 locincpth='$locincpth'
16107 loclibpth='$loclibpth'
16108 longdblsize='$longdblsize'
16109 longlongsize='$longlongsize'
16110 longsize='$longsize'
16114 lseeksize='$lseeksize'
16115 lseektype='$lseektype'
16119 make_set_make='$make_set_make'
16120 mallocobj='$mallocobj'
16121 mallocsrc='$mallocsrc'
16122 malloctype='$malloctype'
16124 man1direxp='$man1direxp'
16127 man3direxp='$man3direxp'
16129 mips_type='$mips_type'
16131 mmaptype='$mmaptype'
16132 modetype='$modetype'
16134 multiarch='$multiarch'
16136 myarchname='$myarchname'
16137 mydomain='$mydomain'
16138 myhostname='$myhostname'
16141 need_va_copy='$need_va_copy'
16142 netdb_hlen_type='$netdb_hlen_type'
16143 netdb_host_type='$netdb_host_type'
16144 netdb_name_type='$netdb_name_type'
16145 netdb_net_type='$netdb_net_type'
16148 nm_so_opt='$nm_so_opt'
16149 nonxs_ext='$nonxs_ext'
16151 nvEUformat='$nvEUformat'
16152 nvFUformat='$nvFUformat'
16153 nvGUformat='$nvGUformat'
16154 nveformat='$nveformat'
16155 nvfformat='$nvfformat'
16156 nvgformat='$nvgformat'
16159 o_nonblock='$o_nonblock'
16161 old_pthread_create_joinable='$old_pthread_create_joinable'
16162 optimize='$optimize'
16163 orderlib='$orderlib'
16166 otherlibdirs='$otherlibdirs'
16170 patchlevel='$patchlevel'
16171 path_sep='$path_sep'
16174 perladmin='$perladmin'
16175 perllibs='$perllibs'
16176 perlpath='$perlpath'
16178 phostname='$phostname'
16181 pm_apiversion='$pm_apiversion'
16185 prefixexp='$prefixexp'
16187 privlibexp='$privlibexp'
16188 prototype='$prototype'
16190 quadkind='$quadkind'
16191 quadtype='$quadtype'
16192 randbits='$randbits'
16193 randfunc='$randfunc'
16194 randseedtype='$randseedtype'
16196 rd_nodata='$rd_nodata'
16197 revision='$revision'
16201 sPRIEUldbl='$sPRIEUldbl'
16202 sPRIFUldbl='$sPRIFUldbl'
16203 sPRIGUldbl='$sPRIGUldbl'
16204 sPRIXU64='$sPRIXU64'
16206 sPRIeldbl='$sPRIeldbl'
16207 sPRIfldbl='$sPRIfldbl'
16208 sPRIgldbl='$sPRIgldbl'
16213 sSCNfldbl='$sSCNfldbl'
16214 sched_yield='$sched_yield'
16215 scriptdir='$scriptdir'
16216 scriptdirexp='$scriptdirexp'
16218 seedfunc='$seedfunc'
16219 selectminbits='$selectminbits'
16220 selecttype='$selecttype'
16221 sendmail='$sendmail'
16224 sharpbang='$sharpbang'
16225 shmattype='$shmattype'
16226 shortsize='$shortsize'
16229 sig_count='$sig_count'
16230 sig_name='$sig_name'
16231 sig_name_init='$sig_name_init'
16233 sig_num_init='$sig_num_init'
16234 signal_t='$signal_t'
16235 sitearch='$sitearch'
16236 sitearchexp='$sitearchexp'
16238 sitebinexp='$sitebinexp'
16240 sitelib_stem='$sitelib_stem'
16241 sitelibexp='$sitelibexp'
16242 siteprefix='$siteprefix'
16243 siteprefixexp='$siteprefixexp'
16244 sizesize='$sizesize'
16245 sizetype='$sizetype'
16249 sockethdr='$sockethdr'
16250 socketlib='$socketlib'
16251 socksizetype='$socksizetype'
16253 spackage='$spackage'
16254 spitshell='$spitshell'
16256 ssizetype='$ssizetype'
16257 startperl='$startperl'
16259 static_ext='$static_ext'
16261 stdio_base='$stdio_base'
16262 stdio_bufsiz='$stdio_bufsiz'
16263 stdio_cnt='$stdio_cnt'
16264 stdio_filbuf='$stdio_filbuf'
16265 stdio_ptr='$stdio_ptr'
16266 stdio_stream_array='$stdio_stream_array'
16269 subversion='$subversion'
16276 timeincl='$timeincl'
16277 timetype='$timetype'
16290 uidformat='$uidformat'
16296 uquadtype='$uquadtype'
16297 use5005threads='$use5005threads'
16298 use64bitall='$use64bitall'
16299 use64bitint='$use64bitint'
16301 useithreads='$useithreads'
16302 uselargefiles='$uselargefiles'
16303 uselongdouble='$uselongdouble'
16304 usemorebits='$usemorebits'
16305 usemultiplicity='$usemultiplicity'
16306 usemymalloc='$usemymalloc'
16308 useopcode='$useopcode'
16309 useperlio='$useperlio'
16310 useposix='$useposix'
16312 useshrplib='$useshrplib'
16313 usesocks='$usesocks'
16314 usethreads='$usethreads'
16315 usevendorprefix='$usevendorprefix'
16316 usevfork='$usevfork'
16319 uvXUformat='$uvXUformat'
16320 uvoformat='$uvoformat'
16323 uvuformat='$uvuformat'
16324 uvxformat='$uvxformat'
16325 vendorarch='$vendorarch'
16326 vendorarchexp='$vendorarchexp'
16327 vendorbin='$vendorbin'
16328 vendorbinexp='$vendorbinexp'
16329 vendorlib='$vendorlib'
16330 vendorlib_stem='$vendorlib_stem'
16331 vendorlibexp='$vendorlibexp'
16332 vendorprefix='$vendorprefix'
16333 vendorprefixexp='$vendorprefixexp'
16335 versiononly='$versiononly'
16337 voidflags='$voidflags'
16339 xs_apiversion='$xs_apiversion'
16344 : Add in command line options if available
16345 $test -f UU/cmdline.opt && $cat UU/cmdline.opt >> config.sh
16347 : add special variables
16348 $test -f $src/patchlevel.h && \
16349 awk '/^#define[ ]+PERL_/ {printf "%s=%s\n",$2,$3}' $src/patchlevel.h >>config.sh
16350 echo "CONFIGDOTSH=true" >>config.sh
16352 : propagate old symbols
16353 if $test -f UU/config.sh; then
16354 <UU/config.sh $sort | $uniq >UU/oldconfig.sh
16355 sed -n 's/^\([a-zA-Z_0-9]*\)=.*/\1/p' config.sh config.sh UU/oldconfig.sh |\
16356 $sort | $uniq -u >UU/oldsyms
16357 set X `cat UU/oldsyms`
16363 Hmm...You had some extra variables I don't know about...I'll try to keep 'em...
16365 echo "# Variables propagated from previous config.sh file." >>config.sh
16366 for sym in `cat UU/oldsyms`; do
16367 echo " Propagating $hint variable "'$'"$sym..."
16368 eval 'tmp="$'"${sym}"'"'
16370 sed -e "s/'/'\"'\"'/g" -e "s/^/$sym='/" -e "s/$/'/" >>config.sh
16376 : Finish up by extracting the .SH files
16390 If you'd like to make any changes to the config.sh file before I begin
16391 to configure things, do it as a shell escape now (e.g. !vi config.sh).
16394 rp="Press return or use a shell escape to edit config.sh:"
16399 *) : in case they cannot read
16400 sh 1>&4 -c "$ans";;
16405 : if this fails, just run all the .SH files by hand
16412 if $contains '^depend:' [Mm]akefile >/dev/null 2>&1; then
16419 Now you need to generate make dependencies by running "$make depend".
16420 You might prefer to run it in background: "$make depend > makedepend.out &"
16421 It can take a while, so you might not want to run it right now.
16426 rp="Run $make depend now?"
16430 $make depend && echo "Now you must run '$make'."
16433 echo "You must run '$make depend' then '$make'."
16436 elif test -f [Mm]akefile; then
16438 echo "Now you must run a $make."
16443 if $test -f Policy.sh; then
16446 If you compile $package on a different machine or from a different object
16447 directory, copy the Policy.sh file from this object directory to the
16448 new one before you run Configure -- this will help you with most of
16449 the policy defaults.
16453 if $test -f config.msg; then
16454 echo "Hmm. I also noted the following information while running:"
16456 $cat config.msg >&4
16459 $rm -f kit*isdone ark*isdone