3 # If these # comments don't work, trim them. Don't worry about any other
4 # shell scripts, Configure will trim # comments from them for you.
6 # (If you are trying to port this package to a machine without sh,
7 # I would suggest you have a look at the prototypical config_h.SH file
8 # and edit it to reflect your system. Some packages may include samples
9 # of config.h for certain machines, so you might look for one of those.)
11 # Yes, you may rip this off to use in other distribution packages. This
12 # script belongs to the public domain and cannot be copyrighted.
14 # (Note: this Configure script was generated automatically. Rather than
15 # working with this copy of Configure, you may wish to get metaconfig.
16 # The dist-3.0 package (which contains metaconfig) was posted in
17 # comp.sources.misc and is available on CPAN under authors/id/RAM so
18 # you may fetch it yourself from your nearest archive site.)
21 # $Id: Head.U,v 3.0.1.9 1997/02/28 15:02:09 ram Exp $
23 # Generated on Wed Aug 30 03:53:15 EET DST 2000 [metaconfig 3.0 PL70]
24 # (with additional metaconfig patches by perlbug@perl.org)
29 SCO csh still thinks true is false. Write to SCO today and tell them that next
30 year Configure ought to "rm /bin/csh" unless they fix their blasted shell. :-)
32 (Actually, Configure ought to just patch csh in place. Hmm. Hmmmmm. All
33 we'd have to do is go in and swap the && and || tokens, wherever they are.)
35 [End of diatribe. We now return you to your regularly scheduled programming...]
39 OOPS! You naughty creature! You didn't run Configure with sh!
40 I will attempt to remedy the situation by running sh for you...
43 true || cat /tmp/c1$$ /tmp/c2$$
44 true || exec sh $0 $argv:q
46 (exit $?0) || cat /tmp/c2$$
47 (exit $?0) || exec sh $0 $argv:q
48 rm -f /tmp/c1$$ /tmp/c2$$
50 : compute my invocation name
54 me=`echo $0 | sed -e 's!.*/\(.*\)!\1!' 2>/dev/null`
59 : Proper separator for the PATH environment variable
61 : On OS/2 this directory should exist if this is not floppy only system :-]
62 if test -d c:/. ; then
63 if test -n "$OS2_SHELL"; then
65 PATH=`cmd /c "echo %PATH%" | tr '\\\\' / `
66 OS2_SHELL=`cmd /c "echo %OS2_SHELL%" | tr '\\\\' / | tr '[A-Z]' '[a-z]'`
67 elif test -n "$DJGPP"; then
73 paths='/bin /usr/bin /usr/local/bin /usr/ucb /usr/local /usr/lbin'
74 paths="$paths /opt/bin /opt/local/bin /opt/local /opt/lbin"
75 paths="$paths /usr/5bin /etc /usr/gnu/bin /usr/new /usr/new/bin /usr/nbin"
76 paths="$paths /opt/gnu/bin /opt/new /opt/new/bin /opt/nbin"
77 paths="$paths /sys5.3/bin /sys5.3/usr/bin /bsd4.3/bin /bsd4.3/usr/ucb"
78 paths="$paths /bsd4.3/usr/bin /usr/bsd /bsd43/bin /usr/ccs/bin"
79 paths="$paths /etc /usr/lib /usr/ucblib /lib /usr/ccs/lib"
80 paths="$paths /sbin /usr/sbin /usr/libexec"
86 *) test -d $p && PATH=$PATH$p_$p ;;
93 : shall we be using ksh?
99 if (PATH=.; alias -x) >/dev/null 2>&1; then
102 if test -f /hp-ux -a -f /bin/ksh; then
103 needksh='to avoid sh bug in "here document" expansion'
105 if test -d /usr/lpp -a -f /usr/bin/bsh -a -f /usr/bin/uname; then
106 if test X`/usr/bin/uname -v` = X4; then
107 avoidksh="to avoid AIX 4's /bin/sh"
111 if test -f /osf_boot -a -f /usr/sbin/setld; then
112 if test X`/usr/bin/uname -s` = XOSF1; then
113 avoidksh="to avoid Digital UNIX' ksh"
115 unset BIN_SH # if this is 'xpg4' sh will start up ksh
118 case "$inksh/$needksh" in
125 case "$inksh/$avoidksh" in
131 case "$inksh/$needksh-$avoidksh-" in
134 (I see you are using the Korn shell. Some ksh's blow up on $me,
135 mainly on older exotic systems. If yours does, try the Bourne shell instead.)
141 echo "(Feeding myself to $newsh $reason.)"
143 Configure|*/Configure) exec $newsh $0 "$@";;
144 *) exec $newsh Configure "$@";;
149 : if needed set CDPATH to a harmless value that is not chatty
150 : avoid bash 2.02 problems with empty CDPATH.
154 *bash*) CDPATH='.' ;;
159 : Configure runs within the UU subdirectory
160 test -d UU || mkdir UU
458 d_old_pthread_create_joinable=''
459 old_pthread_create_joinable=''
707 inc_version_list_init=''
725 ignore_versioned_solibs=''
787 d_perl_otherlibdirs=''
804 d_nv_preserves_uv_bits=''
902 d_stdio_stream_array=''
903 stdio_stream_array=''
913 ccflags_uselargefiles=''
914 ldflags_uselargefiles=''
915 libswanted_uselargefiles=''
957 smallmach='pdp11 i8086 z8000 i80286 iAPX286'
960 : We must find out about Eunice early
962 if test -f /etc/unixtovms; then
963 eunicefix=/etc/unixtovms
965 if test -f /etc/unixtovms.exe; then
966 eunicefix=/etc/unixtovms.exe
970 : set useposix=false in your hint file to disable the POSIX extension.
972 : set useopcode=false in your hint file to disable the Opcode extension.
974 : Trailing extension. Override this in a hint file, if needed.
976 : Extra object files, if any, needed on this platform.
978 : Possible local include directories to search.
979 : Set locincpth to "" in a hint file to defeat local include searches.
980 locincpth="/usr/local/include /opt/local/include /usr/gnu/include"
981 locincpth="$locincpth /opt/gnu/include /usr/GNU/include /opt/GNU/include"
983 : no include file wanted by default
987 : change the next line if compiling for Xenix/286 on Xenix/386
988 xlibpth='/usr/lib/386 /lib/386'
989 : Possible local library directories to search.
990 loclibpth="/usr/local/lib /opt/local/lib /usr/gnu/lib"
991 loclibpth="$loclibpth /opt/gnu/lib /usr/GNU/lib /opt/GNU/lib"
993 : general looking path for locating libraries
994 glibpth="/usr/lib/large /lib /usr/lib $xlibpth"
995 glibpth="$glibpth /lib/large /usr/lib/small /lib/small"
996 glibpth="$glibpth /usr/ccs/lib /usr/ucblib /usr/local/lib"
997 test -f /usr/shlib/libc.so && glibpth="/usr/shlib $glibpth"
998 test -f /shlib/libc.so && glibpth="/shlib $glibpth"
1000 : Private path used by Configure to find libraries. Its value
1001 : is prepended to libpth. This variable takes care of special
1002 : machines, like the mips. Usually, it should be empty.
1005 : default library list
1007 : some systems want to use only the non-versioned libso:s
1008 ignore_versioned_solibs=''
1009 ccflags_uselargefiles=''
1010 ldflags_uselargefiles=''
1011 libswanted_uselargefiles=''
1012 : set usemultiplicity on the Configure command line to enable multiplicity.
1013 : set usesocks on the Configure command line to enable socks.
1014 : set usethreads on the Configure command line to enable threads.
1015 : full support for void wanted by default
1018 : List of libraries we want.
1019 : If anyone needs -lnet, put it in a hint file.
1020 libswanted='sfio socket bind inet nsl nm ndbm gdbm dbm db malloc dl'
1021 libswanted="$libswanted dld ld sun m c cposix posix"
1022 libswanted="$libswanted ndir dir crypt sec"
1023 libswanted="$libswanted ucb bsd BSD PW x iconv util"
1024 : We probably want to search /usr/shlib before most other libraries.
1025 : This is only used by the lib/ExtUtils/MakeMaker.pm routine extliblist.
1026 glibpth=`echo " $glibpth " | sed -e 's! /usr/shlib ! !'`
1027 glibpth="/usr/shlib $glibpth"
1028 : Do not use vfork unless overridden by a hint file.
1031 : Find the basic shell for Bourne shell scripts
1035 *bsd*|sys5*) xxx="/$SYSTYPE/bin/sh";;
1038 if test -f "$xxx"; then
1041 : Build up a list and do a single loop so we can 'break' out.
1042 pth=`echo $PATH | sed -e "s/$p_/ /g"`
1043 for xxx in sh bash ksh pdksh ash; do
1045 try="$try ${p}/${xxx}"
1049 if test -f "$xxx"; then
1052 elif test -f "$xxx.exe"; then
1063 $me: Fatal Error: I can't find a Bourne Shell anywhere.
1065 Usually it's in /bin/sh. How did you even get this far?
1066 Please contact me (Perl Maintainers) at perlbug@perl.org and
1067 we'll try to straighten this all out.
1073 : see if sh knows # comments
1074 if `$sh -c '#' >/dev/null 2>&1`; then
1078 test -f $xcat || xcat=/usr/bin/cat
1083 if test -s today; then
1086 echo "#! $xcat" > try
1090 if test -s today; then
1098 echo "Your $sh doesn't grok # comments--I will strip them later on."
1101 echo "exec grep -v '^[ ]*#'" >spitshell
1103 $eunicefix spitshell
1104 spitshell=`pwd`/spitshell
1106 echo "I presume that if # doesn't work, #! won't work either!"
1111 : figure out how to guarantee sh startup
1113 '') startsh=${sharpbang}${sh} ;;
1125 : echo "Yup, it does."
1127 echo "Hmm... '$startsh' does not guarantee sh startup..."
1128 echo "You may have to fix up the shell scripts to make sure $sh runs them."
1133 : Save command line options in file UU/cmdline.opt for later use in
1134 : generating config.sh.
1135 cat > cmdline.opt <<EOSH
1136 # Configure command line arguments.
1143 cat >>cmdline.opt <<EOSH
1144 config_arg$argn='$arg'
1146 argn=`expr $argn + 1`
1149 : produce awk script to parse command line options
1150 cat >options.awk <<'EOF'
1152 optstr = "A:dD:eEf:hKOrsSU:V"; # getopt-style specification
1154 len = length(optstr);
1155 for (i = 1; i <= len; i++) {
1156 c = substr(optstr, i, 1);
1157 if (i < len) a = substr(optstr, i + 1, 1); else a = "";
1168 if (substr(str, 1, 1) != "-") {
1169 printf("'%s'\n", str);
1173 for (i = 2; i <= len; i++) {
1174 c = substr(str, i, 1);
1176 printf("-%s\n", substr(str, i));
1182 printf("'%s'\n", substr(str, i + 1));
1195 : process the command line options
1196 set X `for arg in "$@"; do echo "X$arg"; done |
1197 sed -e s/X// | awk -f options.awk`
1202 : set up default values
1212 rm -f optdef.sh posthint.sh
1213 cat >optdef.sh <<EOS
1219 while test $# -gt 0; do
1221 -d) shift; fastread=yes;;
1222 -e) shift; alldone=cont;;
1226 if test -r "$1"; then
1229 echo "$me: cannot read config file $1." >&2
1234 -h) shift; error=true;;
1235 -r) shift; reuseval=true;;
1236 -s) shift; silent=true; realsilent=true;;
1237 -E) shift; alldone=exit;;
1238 -K) shift; knowitall=true;;
1239 -O) shift; override=true;;
1240 -S) shift; silent=true; extractsh=true;;
1245 echo "$me: use '-U symbol=', not '-D symbol='." >&2
1246 echo "$me: ignoring -D $1" >&2
1249 sed -e "s/'/'\"'\"'/g" -e "s/=\(.*\)/='\1'/" >> optdef.sh;;
1250 *) echo "$1='define'" >> optdef.sh;;
1257 *=) echo "$1" >> optdef.sh;;
1259 echo "$me: use '-D symbol=val', not '-U symbol=val'." >&2
1260 echo "$me: ignoring -U $1" >&2
1262 *) echo "$1='undef'" >> optdef.sh;;
1273 *=*) zzz=`echo $yyy|sed 's!=.*!!'`
1277 zzz=" "`echo $yyy|sed 's!^[^=]*=!!'`
1278 yyy=`echo $yyy|sed 's!=.*!!'` ;;
1284 *:*) xxx=`echo $yyy|sed 's!:.*!!'`
1285 yyy=`echo $yyy|sed 's!^[^:]*:!!'`
1286 zzz=`echo $yyy|sed 's!^[^=]*=!!'`
1287 yyy=`echo $yyy|sed 's!=.*!!'` ;;
1288 *) xxx=`echo $yyy|sed 's!:.*!!'`
1289 yyy=`echo $yyy|sed 's!^[^:]*:!!'` ;;
1295 echo "$yyy=\"\${$yyy}$zzz\"" >> posthint.sh ;;
1297 echo "$yyy=''" >> posthint.sh ;;
1302 echo "$yyy='$zzz'" >> posthint.sh ;;
1304 echo "eval \"$yyy=$zzz\"" >> posthint.sh ;;
1306 echo "$yyy=\"$zzz\${$yyy}\"" >> posthint.sh ;;
1311 echo "$yyy=$zzz" >> posthint.sh ;;
1312 *) echo "$me: unknown -A command '$xxx', ignoring -A $1" >&2 ;;
1316 -V) echo "$me generated by metaconfig 3.0 PL70." >&2
1319 -*) echo "$me: unknown option $1" >&2; shift; error=true;;
1327 Usage: $me [-dehrsEKOSV] [-f config.sh] [-D symbol] [-D symbol=value]
1328 [-U symbol] [-U symbol=] [-A command:symbol...]
1329 -d : use defaults for all answers.
1330 -e : go on without questioning past the production of config.sh.
1331 -f : specify an alternate default configuration file.
1332 -h : print this help message and exit (with an error status).
1333 -r : reuse C symbols value if possible (skips costly nm extraction).
1334 -s : silent mode, only echoes questions and essential information.
1335 -D : define symbol to have some value:
1336 -D symbol symbol gets the value 'define'
1337 -D symbol=value symbol gets the value 'value'
1338 -E : stop at the end of questions, after having produced config.sh.
1339 -K : do not use unless you know what you are doing.
1340 -O : let -D and -U override definitions from loaded configuration file.
1341 -S : perform variable substitutions on all .SH files (can mix with -f)
1342 -U : undefine symbol:
1343 -U symbol symbol gets the value 'undef'
1344 -U symbol= symbol gets completely empty
1345 -A : manipulate symbol after the platform specific hints have been applied:
1346 -A symbol=value append " "value to symbol
1347 -A append:symbol=value append value to symbol
1348 -A define:symbol=value define symbol to have value
1349 -A clear:symbol define symbol to be ''
1350 -A define:symbol define symbol to be 'define'
1351 -A eval:symbol=value define symbol to be eval of value
1352 -A prepend:symbol=value prepend value to symbol
1353 -A undef:symbol define symbol to be 'undef'
1354 -A undef:symbol= define symbol to be ''
1355 -V : print version number and exit (with a zero status).
1362 case "$fastread$alldone" in
1365 case "$extractsh" in
1368 if test ! -t 0; then
1369 echo "Say 'sh Configure', not 'sh <Configure'"
1379 true) exec 1>/dev/null;;
1382 : run the defines and the undefines, if any, but leave the file out there...
1385 : create the posthint manipulation script and leave the file out there...
1390 first=`echo $package | sed -e 's/^\(.\).*/\1/'`
1391 last=`echo $package | sed -e 's/^.\(.*\)/\1/'`
1392 case "`echo AbyZ | tr '[:lower:]' '[:upper:]' 2>/dev/null`" in
1393 ABYZ) spackage=`echo $first | tr '[:lower:]' '[:upper:]'`$last;;
1394 *) spackage=`echo $first | tr '[a-z]' '[A-Z]'`$last;;
1397 : Some greps do not return status, grrr.
1398 echo "grimblepritz" >grimble
1399 if grep blurfldyick grimble >/dev/null 2>&1 ; then
1401 elif grep grimblepritz grimble >/dev/null 2>&1 ; then
1407 : the following should work in any shell
1411 echo "AGH! Grep doesn't return a status. Attempting remedial action."
1412 cat >contains <<'EOSS'
1413 grep "$1" "$2" >.greptmp && cat .greptmp && test -s .greptmp
1418 : Find the path to the source tree
1421 */*) src=`echo $0 | sed -e 's%/[^/][^/]*$%%'`
1424 *) src=`cd ../$src && pwd` ;;
1437 if test -f $rsrc/Configure && \
1438 $contains "^package=$package$" $rsrc/Configure >/dev/null 2>&1
1440 : found it, so we are ok.
1443 for src in . .. ../.. ../../.. ../../../..; do
1444 if test -f ../$src/Configure && \
1445 $contains "^package=$package$" ../$src/Configure >/dev/null 2>&1
1456 Sorry, I can't seem to locate the source dir for $package. Please start
1457 Configure with an explicit path -- i.e. /some/path/Configure.
1465 echo "Sources for $package found in \"$src\"." >&4
1469 : script used to extract .SH files with variable substitutions
1470 cat >extract <<'EOS'
1472 echo "Doing variable substitutions on .SH files..."
1473 if test -f $src/MANIFEST; then
1474 set x `awk '{print $1}' <$src/MANIFEST | grep '\.SH$'`
1476 echo "(Looking for .SH files under the source directory.)"
1477 set x `(cd $src; find . -name "*.SH" -print)`
1481 0) set x `(cd $src; echo *.SH)`; shift;;
1483 if test ! -f $src/$1; then
1489 while test $name; do
1490 if test ! -d "$name"; then
1491 create="$name $create";
1492 name=`echo $name | sed -e "s|^[^/]*$||"`;
1493 name=`echo $name | sed -e "s|\(.*\)/.*|\1|"`;
1498 for file in $create; do
1507 dir=`expr X$file : 'X\(.*\)/'`
1508 file=`expr X$file : 'X.*/\(.*\)'`
1509 (cd $dir && . ./$file)
1519 dir=`expr X$file : 'X\(.*\)/'`
1520 file=`expr X$file : 'X.*/\(.*\)'`
1521 (set x $dir; shift; eval $mkdir_p)
1531 if test -f $src/config_h.SH; then
1532 if test ! -f config.h; then
1533 : oops, they left it out of MANIFEST, probably, so do it anyway.
1539 : extract files and exit if asked to do so
1540 case "$extractsh" in
1542 case "$realsilent" in
1546 case "$config_sh" in
1547 '') config_sh='config.sh';;
1550 echo "Fetching answers from $config_sh..."
1553 test "$override" && . ./optdef.sh
1562 : Eunice requires " " instead of "", can you believe it
1565 echo "Beginning of configuration questions for $package."
1567 trap 'echo " "; test -d ../UU && rm -rf X $rmlist; exit 1' 1 2 3 15
1569 : first determine how to suppress newline on echo command
1571 echo "Checking echo to see how to suppress newlines..."
1572 (echo "hi there\c" ; echo " ") >.echotmp
1573 if $contains c .echotmp >/dev/null 2>&1 ; then
1584 echo $n "The star should be here-->$c"
1588 : Now test for existence of everything in MANIFEST
1590 if test -f $rsrc/MANIFEST; then
1591 echo "First let's make sure your kit is complete. Checking..." >&4
1592 awk '$1 !~ /PACK[A-Z]+/ {print $1}' $rsrc/MANIFEST | split -50
1595 for filelist in x??; do
1596 (cd $rsrc; ls `cat $tmppwd/$filelist` >/dev/null 2>>$tmppwd/missing)
1598 if test -s missing; then
1602 THIS PACKAGE SEEMS TO BE INCOMPLETE.
1604 You have the option of continuing the configuration process, despite the
1605 distinct possibility that your kit is damaged, by typing 'y'es. If you
1606 do, don't blame me if something goes wrong. I advise you to type 'n'o
1607 and contact the author (perlbug@perl.org).
1610 echo $n "Continue? [n] $c" >&4
1614 echo "Continuing..." >&4
1618 echo "ABORTING..." >&4
1623 echo "Looks good..."
1626 echo "There is no MANIFEST file. I hope your kit is complete !"
1631 : Find the appropriate value for a newline for tr
1632 if test -n "$DJGPP"; then
1635 if test X"$trnl" = X; then
1636 case "`echo foo|tr '\n' x 2>/dev/null`" in
1640 if test X"$trnl" = X; then
1641 case "`echo foo|tr '\012' x 2>/dev/null`" in
1642 foox) trnl='\012' ;;
1645 if test X"$trnl" = X; then
1648 $me: Fatal Error: cannot figure out how to translate newlines with 'tr'.
1654 : compute the number of columns on the terminal for proper question formatting
1659 : set up the echo used in my read
1660 myecho="case \"\$xxxm\" in
1661 '') echo $n \"\$rp $c\" >&4;;
1663 '') echo $n \"[\$xxxm] $c\";;
1665 if test \`echo \"\$rp [\$xxxm] \" | wc -c\` -ge $COLUMNS; then
1667 echo $n \"[\$xxxm] $c\" >&4
1669 echo $n \"\$rp [\$xxxm] $c\" >&4
1675 : now set up to do reads with possible shell escape and default assignment
1681 case "\$fastread" in
1682 yes) case "\$dflt" in
1685 case "\$silent-\$rp" in
1690 *) case "\$silent" in
1691 true) case "\$rp" in
1696 while expr "X\$ans" : "X!" >/dev/null; do
1700 aok=''; eval "ans=\\"\$answ\\"" && aok=y
1708 set x \`expr "X\$ans" : "X!\(.*\)\$"\`
1717 set x \`expr "X\$ans" : "X&\(.*\)\$"\`
1722 echo "(OK, I'll run with -d after this question.)" >&4
1725 echo "*** Sorry, \$1 not supported yet." >&4
1735 echo "*** Substitution done -- please confirm."
1737 ans=\`echo $n "\$ans$c" | tr '$trnl' ' '\`
1742 echo "*** Error -- try again."
1749 case "\$ans\$xxxm\$nostick" in
1761 : create .config dir to save info across Configure sessions
1762 test -d ../.config || mkdir ../.config
1763 cat >../.config/README <<EOF
1764 This directory created by Configure to save information that should
1765 persist across sessions for $package.
1767 You may safely delete it if you wish.
1770 xversion=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
1772 $define|true|[yY]*) ;;
1773 *) case "$xversion" in
1776 *** WHOA THERE!!! ***
1778 This is an UNSTABLE DEVELOPMENT release.
1779 The version of this $package distribution is $xversion, that is, odd,
1780 (as opposed to even) and that signifies a development release.
1781 If you want a maintenance release, you want an even-numbered version.)
1783 Do ***NOT*** install this into production use.
1784 Data corruption and crashes are possible.
1786 It is most seriously suggested that you do not continue any further
1787 unless you want to help in developing and debugging Perl.
1790 rp='Do you really want to continue?'
1794 [yY]) echo >&4 "Okay, continuing." ;;
1795 *) echo >&4 "Okay, bye."
1804 : general instructions
1807 user=`(logname) 2>/dev/null`
1809 '') user=`whoami 2>&1`;;
1811 if $contains "^$user\$" ../.config/instruct >/dev/null 2>&1; then
1814 rp='Would you like to see the instructions?'
1825 This installation shell script will examine your system and ask you questions
1826 to determine how the perl5 package should be installed. If you get
1827 stuck on a question, you may use a ! shell escape to start a subshell or
1828 execute a command. Many of the questions will have default answers in square
1829 brackets; typing carriage return will give you the default.
1831 On some of the questions which ask for file or directory names you are allowed
1832 to use the ~name construct to specify the login directory belonging to "name",
1833 even if you don't have a shell which knows about that. Questions where this is
1834 allowed will be marked "(~name ok)".
1838 dflt='Type carriage return to continue'
1842 The prompter used in this script allows you to use shell variables and
1843 backticks in your answers. You may use $1, $2, etc... to refer to the words
1844 in the default answer, as if the default line was a set of arguments given to a
1845 script shell. This means you may also use $* to repeat the whole default line,
1846 so you do not have to re-type everything to add something to the default.
1848 Everytime there is a substitution, you will have to confirm. If there is an
1849 error (e.g. an unmatched backtick), the default answer will remain unchanged
1850 and you will be prompted again.
1852 If you are in a hurry, you may run 'Configure -d'. This will bypass nearly all
1853 the questions and use the computed defaults (or the previous answers if there
1854 was already a config.sh file). Type 'Configure -h' for a list of options.
1855 You may also start interactively and then answer '& -d' at any prompt to turn
1856 on the non-interactive behaviour for the remainder of the execution.
1862 Much effort has been expended to ensure that this shell script will run on any
1863 Unix system. If despite that it blows up on yours, your best bet is to edit
1864 Configure and run it again. If you can't run Configure for some reason,
1865 you'll have to generate a config.sh file by hand. Whatever problems you
1866 have, let me (perlbug@perl.org) know how I blew it.
1868 This installation script affects things in two ways:
1870 1) it may do direct variable substitutions on some of the files included
1872 2) it builds a config.h file for inclusion in C programs. You may edit
1873 any of these files as the need arises after running this script.
1875 If you make a mistake on a question, there is no easy way to back up to it
1876 currently. The easiest thing to do is to edit config.sh and rerun all the SH
1877 files. Configure will offer to let you do this before it runs the SH files.
1880 dflt='Type carriage return to continue'
1882 case "$firsttime" in
1883 true) echo $user >>../.config/instruct;;
1887 : find out where common programs are
1889 echo "Locating common programs..." >&4
1902 if test -d \$dir/\$thing; then
1908 for thisthing in \$dir/\$thing; do
1909 : just loop through to pick last item
1911 if test -f \$thisthing; then
1914 elif test -f \$dir/\$thing.exe; then
1915 if test -n "$DJGPP"; then
1916 echo \$dir/\$thing.exe
1918 : on Eunice apparently
1968 pth=`echo $PATH | sed -e "s/$p_/ /g"`
1969 pth="$pth /lib /usr/lib"
1970 for file in $loclist; do
1974 if test -f "$xxx"; then
1977 echo "WARNING: no $xxx -- ignoring your setting for $file." >&4
1978 xxx=`./loc $file $file $pth`
1981 '') xxx=`./loc $file $file $pth`;;
1982 *) xxx=`./loc $xxx $xxx $pth`;;
1988 echo $file is in $xxx.
1991 echo $file is in $xxx.
1994 echo "I don't know where '$file' is, and my life depends on it." >&4
1995 echo "Go find a public domain implementation or fix your PATH setting!" >&4
2001 echo "Don't worry if any of the following aren't found..."
2003 for file in $trylist; do
2007 if test -f "$xxx"; then
2010 echo "WARNING: no $xxx -- ignoring your setting for $file." >&4
2011 xxx=`./loc $file $file $pth`
2014 '') xxx=`./loc $file $file $pth`;;
2015 *) xxx=`./loc $xxx $xxx $pth`;;
2021 echo $file is in $xxx.
2024 echo $file is in $xxx.
2027 echo "I don't see $file out there, $say."
2034 echo "Substituting grep for egrep."
2040 echo "Substituting cp for ln."
2046 echo "Hopefully test is built into your sh."
2049 if `sh -c "PATH= test true" >/dev/null 2>&1`; then
2050 echo "Using the test built into your sh."
2058 echo "Hopefully echo is built into your sh."
2063 echo "Checking compatibility between $echo and builtin echo (if any)..." >&4
2064 $echo $n "hi there$c" >foo1
2065 echo $n "hi there$c" >foo2
2066 if cmp foo1 foo2 >/dev/null 2>&1; then
2067 echo "They are compatible. In fact, they may be identical."
2074 They are not compatible! You are probably running ksh on a non-USG system.
2075 I'll have to use $echo instead of the builtin, since Bourne shell doesn't
2076 have echo built in and we may have to run some Bourne shell scripts. That
2077 means I'll have to use '$n$c' to suppress newlines now. Life is ridiculous.
2080 $echo $n "The star should be here-->$c"
2090 cat <<'EOSC' >>checkcc
2095 int main(int argc, char *argv[]) {
2099 if $cc -o try try.c; then
2102 echo "Uh-oh, the C compiler '$cc' doesn't seem to be working." >&4
2108 case "`$cc -v -c try.c 2>&1`" in
2111 if $test X"$trygcc" = Xyes; then
2112 if gcc -o try -c try.c; then
2114 echo "You seem to have a working gcc, though." >&4
2115 rp="Would you like to use it?"
2117 if $test -f myread; then
2120 if $test -f UU/myread; then
2123 echo "Cannot find myread, sorry. Aborting." >&2
2128 [yY]*) cc=gcc; ccname=gcc; ccflags=''; despair=no ;;
2132 if $test X"$despair" = Xyes; then
2133 echo "You need to find a working C compiler." >&4
2134 echo "I cannot continue any further, aborting." >&4
2143 : determine whether symbolic links are supported
2146 if $ln -s blurfl sym > /dev/null 2>&1 ; then
2147 echo "Symbolic links are supported." >&4
2150 echo "Symbolic links are NOT supported." >&4
2155 : see whether [:lower:] and [:upper:] are supported character classes
2157 case "`echo AbyZ | $tr '[:lower:]' '[:upper:]' 2>/dev/null`" in
2159 echo "Good, your tr supports [:lower:] and [:upper:] to convert case." >&4
2163 *) # There is a discontinuity in EBCDIC between 'I' and 'J'
2164 # (0xc9 and 0xd1), therefore that is a nice testing point.
2165 if test "X$up" = X -o "X$low" = X; then
2166 case "`echo IJ | $tr '[I-J]' '[i-j]' 2>/dev/null`" in
2172 if test "X$up" = X -o "X$low" = X; then
2173 case "`echo IJ | $tr I-J i-j 2>/dev/null`" in
2179 if test "X$up" = X -o "X$low" = X; then
2180 case "`echo IJ | od -x 2>/dev/null`" in
2182 echo "Hey, this might be EBCDIC." >&4
2183 if test "X$up" = X -o "X$low" = X; then
2184 case "`echo IJ | $tr '[A-IJ-RS-Z]' '[a-ij-rs-z]' 2>/dev/null`" in
2185 ij) up='[A-IJ-RS-Z]'
2190 if test "X$up" = X -o "X$low" = X; then
2191 case "`echo IJ | $tr A-IJ-RS-Z a-ij-rs-z 2>/dev/null`" in
2201 case "`echo IJ | $tr \"$up\" \"$low\" 2>/dev/null`" in
2203 echo "Using $up and $low to convert case." >&4
2206 echo "I don't know how to translate letters from upper to lower case." >&4
2207 echo "Your tr is not acting any way I know of." >&4
2211 : set up the translation script tr, must be called with ./tr of course
2215 '[A-Z][a-z]') exec $tr '$up' '$low';;
2216 '[a-z][A-Z]') exec $tr '$low' '$up';;
2223 : Try to determine whether config.sh was made on this system
2224 case "$config_sh" in
2226 myuname=`$uname -a 2>/dev/null`
2227 $test -z "$myuname" && myuname=`hostname 2>/dev/null`
2228 # tr '[A-Z]' '[a-z]' would not work in EBCDIC
2229 # because the A-Z/a-z are not consecutive.
2230 myuname=`echo $myuname | $sed -e 's/^[^=]*=//' -e 's/\///g' | \
2231 ./tr '[A-Z]' '[a-z]' | $tr $trnl ' '`
2232 newmyuname="$myuname"
2234 case "$knowitall" in
2236 if test -f ../config.sh; then
2237 if $contains myuname= ../config.sh >/dev/null 2>&1; then
2238 eval "`grep myuname= ../config.sh`"
2240 if test "X$myuname" = "X$newmyuname"; then
2248 : Get old answers from old config file if Configure was run on the
2249 : same system, otherwise use the hints.
2252 if test -f config.sh; then
2254 rp="I see a config.sh file. Shall I use it to set the defaults?"
2257 n*|N*) echo "OK, I'll ignore it."; mv config.sh config.sh.old;;
2258 *) echo "Fetching default answers from your old config.sh file..." >&4
2266 : Older versions did not always set $sh. Catch re-use of such
2276 if test ! -f config.sh; then
2279 First time through, eh? I have some defaults handy for some systems
2280 that need some extra help getting the Configure answers right:
2283 (cd $src/hints; ls -C *.sh) | $sed 's/\.sh/ /g' >&4
2285 : Half the following guesses are probably wrong... If you have better
2286 : tests or hints, please send them to perlbug@perl.org
2287 : The metaconfig authors would also appreciate a copy...
2288 $test -f /irix && osname=irix
2289 $test -f /xenix && osname=sco_xenix
2290 $test -f /dynix && osname=dynix
2291 $test -f /dnix && osname=dnix
2292 $test -f /lynx.os && osname=lynxos
2293 $test -f /unicos && osname=unicos && osvers=`$uname -r`
2294 $test -f /unicosmk && osname=unicosmk && osvers=`$uname -r`
2295 $test -f /unicosmk.ar && osname=unicosmk && osvers=`$uname -r`
2296 $test -f /bin/mips && /bin/mips && osname=mips
2297 $test -d /NextApps && set X `hostinfo | grep 'NeXT Mach.*:' | \
2298 $sed -e 's/://' -e 's/\./_/'` && osname=next && osvers=$4
2299 $test -d /usr/apollo/bin && osname=apollo
2300 $test -f /etc/saf/_sactab && osname=svr4
2301 $test -d /usr/include/minix && osname=minix
2302 if $test -d /MachTen -o -d /MachTen_Folder; then
2304 if $test -x /sbin/version; then
2305 osvers=`/sbin/version | $awk '{print $2}' |
2306 $sed -e 's/[A-Za-z]$//'`
2307 elif $test -x /usr/etc/version; then
2308 osvers=`/usr/etc/version | $awk '{print $2}' |
2309 $sed -e 's/[A-Za-z]$//'`
2315 $test -f /sys/posix.dll &&
2316 $test -f /usr/bin/what &&
2317 set X `/usr/bin/what /sys/posix.dll` &&
2318 $test "$3" = UWIN &&
2322 if $test -f $uname; then
2330 umips) osname=umips ;;
2333 [23]100) osname=mips ;;
2334 next*) osname=next ;;
2336 tmp=`/bin/uname -X 2>/dev/null|awk '/3\.2v[45]/{ print $(NF) }'`
2337 if $test "$tmp" != "" -a "$3" = "3.2" -a -f '/etc/systemid'; then
2340 elif $test -f /etc/kconfig; then
2342 if test "$lns" = "$ln -s"; then
2344 elif $contains _SYSV3 /usr/include/stdio.h > /dev/null 2>&1 ; then
2346 elif $contains _POSIX_SOURCE /usr/include/stdio.h > /dev/null 2>&1 ; then
2353 if test -n "$DJGPP"; then
2362 tmp=`( (oslevel) 2>/dev/null || echo "not found") 2>&1`
2364 'not found') osvers="$4"."$3" ;;
2365 '<3240'|'<>3240') osvers=3.2.0 ;;
2366 '=3240'|'>3240'|'<3250'|'<>3250') osvers=3.2.4 ;;
2367 '=3250'|'>3250') osvers=3.2.5 ;;
2371 bsd386) osname=bsd386
2374 cygwin*) osname=cygwin
2377 *dc.osx) osname=dcosx
2383 domainos) osname=apollo
2389 dynixptx*) osname=dynixptx
2390 osvers=`echo "$4"|sed 's/^v//'`
2392 freebsd) osname=freebsd
2394 genix) osname=genix ;;
2396 osvers=`echo "$3" | $sed 's,.*\.\([0-9]*\.[0-9]*\),\1,'`
2412 netbsd*) osname=netbsd
2415 news-os) osvers="$3"
2417 4*) osname=newsos4 ;;
2421 next*) osname=next ;;
2422 POSIX-BC | posix-bc ) osname=posix-bc
2425 powerux | power_ux | powermax_os | powermaxos | \
2426 powerunix | power_unix) osname=powerux
2432 solaris) osname=solaris
2434 5*) osvers=`echo $3 | $sed 's/^5/2/g'` ;;
2441 osvers=`echo $3 | $sed 's/^5/2/g'` ;;
2445 titanos) osname=titanos
2454 ultrix) osname=ultrix
2457 osf1|mls+) case "$5" in
2460 osvers=`sizer -v | awk '{print $3}' | tr '[A-Z]' '[a-z]' | sed 's/^[xvt]//'`
2463 *) osvers=`echo "$3" | sed 's/^[xvt]//'` ;;
2466 hp*) osname=hp_osf1 ;;
2467 mips) osname=mips_osf1 ;;
2470 unixware) osname=svr5
2476 $2) case "$osname" in
2480 : svr4.x or possibly later
2490 if test -f /stand/boot ; then
2491 eval `grep '^INITPROG=[a-z/0-9]*$' /stand/boot`
2492 if test -n "$INITPROG" -a -f "$INITPROG"; then
2493 isesix=`strings -a $INITPROG|grep 'ESIX SYSTEM V/386 Release 4.0'`
2494 if test -n "$isesix"; then
2502 *) if test -f /etc/systemid; then
2504 set `echo $3 | $sed 's/\./ /g'` $4
2505 if $test -f $src/hints/sco_$1_$2_$3.sh; then
2507 elif $test -f $src/hints/sco_$1_$2.sh; then
2509 elif $test -f $src/hints/sco_$1.sh; then
2514 '') : Still unknown. Probably a generic Sys V.
2523 *) case "$osname" in
2524 '') : Still unknown. Probably a generic BSD.
2532 if test -f /vmunix -a -f $src/hints/news_os.sh; then
2533 (what /vmunix | UU/tr '[A-Z]' '[a-z]') > UU/kernel.what 2>&1
2534 if $contains news-os UU/kernel.what >/dev/null 2>&1; then
2537 $rm -f UU/kernel.what
2538 elif test -d c:/.; then
2545 : Now look for a hint file osname_osvers, unless one has been
2546 : specified already.
2549 file=`echo "${osname}_${osvers}" | $sed -e 's%\.%_%g' -e 's%_$%%'`
2550 : Also try without trailing minor version numbers.
2551 xfile=`echo $file | $sed -e 's%_[^_]*$%%'`
2552 xxfile=`echo $xfile | $sed -e 's%_[^_]*$%%'`
2553 xxxfile=`echo $xxfile | $sed -e 's%_[^_]*$%%'`
2554 xxxxfile=`echo $xxxfile | $sed -e 's%_[^_]*$%%'`
2557 *) case "$osvers" in
2560 *) if $test -f $src/hints/$file.sh ; then
2562 elif $test -f $src/hints/$xfile.sh ; then
2564 elif $test -f $src/hints/$xxfile.sh ; then
2566 elif $test -f $src/hints/$xxxfile.sh ; then
2568 elif $test -f $src/hints/$xxxxfile.sh ; then
2570 elif $test -f "$src/hints/${osname}.sh" ; then
2579 if $test -f Policy.sh ; then
2582 none) dflt="Policy" ;;
2583 *) dflt="Policy $dflt" ;;
2588 dflt=`echo $hintfile | $sed 's/\.sh$//'`
2592 if $test -f Policy.sh ; then
2595 There's also a Policy hint file available, which should make the
2596 site-specific (policy) questions easier to answer.
2603 You may give one or more space-separated answers, or "none" if appropriate.
2604 A well-behaved OS will have no hints, so answering "none" or just "Policy"
2605 is a good thing. DO NOT give a wrong version or a wrong OS.
2609 rp="Which of these apply, if any?"
2612 for file in $tans; do
2613 if $test X$file = XPolicy -a -f Policy.sh; then
2615 $cat Policy.sh >> UU/config.sh
2616 elif $test -f $src/hints/$file.sh; then
2617 . $src/hints/$file.sh
2618 $cat $src/hints/$file.sh >> UU/config.sh
2619 elif $test X$tans = X -o X$tans = Xnone ; then
2622 : Give one chance to correct a possible typo.
2623 echo "$file.sh does not exist"
2625 rp="hint to use instead?"
2627 for file in $ans; do
2628 if $test -f "$src/hints/$file.sh"; then
2629 . $src/hints/$file.sh
2630 $cat $src/hints/$file.sh >> UU/config.sh
2631 elif $test X$ans = X -o X$ans = Xnone ; then
2634 echo "$file.sh does not exist -- ignored."
2641 : Remember our hint file for later.
2642 if $test -f "$src/hints/$file.sh" ; then
2652 echo "Fetching default answers from $config_sh..." >&4
2656 cp $config_sh config.sh 2>/dev/null
2666 test "$override" && . ./optdef.sh
2667 myuname="$newmyuname"
2669 : Restore computed paths
2670 for file in $loclist $trylist; do
2671 eval $file="\$_$file"
2676 Configure uses the operating system name and version to set some defaults.
2677 The default value is probably right if the name rings a bell. Otherwise,
2678 since spelling matters for me, either accept the default or answer "none"
2685 ''|' '|none) dflt=none ;;
2686 *) dflt=`echo $hintfile | $sed -e 's/\.sh$//' -e 's/_.*$//'` ;;
2689 *) dflt="$osname" ;;
2691 rp="Operating system name?"
2695 *) osname=`echo "$ans" | $sed -e 's/[ ][ ]*/_/g' | ./tr '[A-Z]' '[a-z]'`;;
2701 ''|' '|none) dflt=none ;;
2702 *) dflt=`echo $hintfile | $sed -e 's/\.sh$//' -e 's/^[^_]*//'`
2703 dflt=`echo $dflt | $sed -e 's/^_//' -e 's/_/./g'`
2705 ''|' ') dflt=none ;;
2710 *) dflt="$osvers" ;;
2712 rp="Operating system version?"
2722 : who configured the system
2723 cf_time=`LC_ALL=C; LANGUAGE=C; export LC_ALL; export LANGUAGE; $date 2>&1`
2724 cf_by=`(logname) 2>/dev/null`
2727 cf_by=`(whoami) 2>/dev/null`
2729 "") cf_by=unknown ;;
2733 : set up the script used to warn in case of inconsistency
2740 echo "*** WHOA THERE!!! ***" >&4
2741 echo " The $hint value for \$$var on this machine was \"$was\"!" >&4
2742 rp=" Keep the $hint value?"
2745 y) td=$was; tu=$was;;
2749 : function used to set $1 to $val
2750 setvar='var=$1; eval "was=\$$1"; td=$define; tu=$undef;
2752 $define$undef) . ./whoa; eval "$var=\$td";;
2753 $undef$define) . ./whoa; eval "$var=\$tu";;
2754 *) eval "$var=$val";;
2757 case "$usethreads" in
2758 $define|true|[yY]*) dflt='y';;
2763 Perl can be built to take advantage of threads on some systems.
2764 To do so, Configure can be run with -Dusethreads.
2766 Note that threading is a highly experimental feature, and
2767 some known race conditions still remain. If you choose to try
2768 it, be very sure to not actually deploy it for production
2769 purposes. README.threads has more details, and is required
2770 reading if you enable threads.
2772 If this doesn't make any sense to you, just accept the default '$dflt'.
2774 rp='Build a threading Perl?'
2777 y|Y) val="$define" ;;
2783 case "$usethreads" in
2787 As of 5.5.640, Perl has two different internal threading implementations,
2788 the 5.005 version (5005threads) and an interpreter-based version
2789 (ithreads) that has one interpreter per thread. Both are very
2790 experimental. This arrangement exists to help developers work out
2791 which one is better.
2793 If you're a casual user, you probably don't want interpreter-threads
2794 at this time. There doesn't yet exist a way to create threads from
2795 within Perl in this model, i.e., "use Thread;" will NOT work.
2797 : Default to ithreads unless overridden on command line or with
2800 case "$use5005threads" in
2801 $define|true|[yY]*) dflt='n';;
2803 case "$useithreads" in
2804 $undef|false|[nN]*) dflt='n';;
2806 rp='Use interpreter-based ithreads?'
2809 y|Y) val="$define" ;;
2814 : Now set use5005threads to the opposite value.
2815 case "$useithreads" in
2816 $define) val="$undef" ;;
2823 useithreads="$undef"
2824 use5005threads="$undef"
2828 case "$d_oldpthreads" in
2829 '') : Configure tests would be welcome here. For now, assume undef.
2831 *) val="$d_oldpthreads" ;;
2837 case "$usethreads" in
2838 "$define"|true|[yY]*)
2839 : Look for a hint-file generated 'call-back-unit'. If the
2840 : user has specified that a threading perl is to be built,
2841 : we may need to set or change some other defaults.
2842 if $test -f usethreads.cbu; then
2843 echo "Your platform has some specific hints for threaded builds, using them..."
2847 (Your platform doesn't have any specific hints for threaded builds.
2848 Assuming POSIX threads, then.)
2856 Perl can be built so that multiple Perl interpreters can coexist
2857 within the same Perl executable.
2860 case "$useithreads" in
2863 This multiple interpreter support is required for interpreter-based threads.
2867 *) case "$usemultiplicity" in
2868 $define|true|[yY]*) dflt='y';;
2872 echo "If this doesn't make any sense to you, just accept the default '$dflt'."
2873 rp='Build Perl for multiplicity?'
2876 y|Y) val="$define" ;;
2884 : determine where manual pages are on this system
2888 syspath='/usr/man/man1 /usr/man/mann /usr/man/manl /usr/man/local/man1'
2889 syspath="$syspath /usr/man/u_man/man1 /usr/share/man/man1"
2890 syspath="$syspath /usr/catman/u_man/man1 /usr/man/l_man/man1"
2891 syspath="$syspath /usr/local/man/u_man/man1 /usr/local/man/l_man/man1"
2892 syspath="$syspath /usr/man/man.L /local/man/man1 /usr/local/man/man1"
2893 sysman=`./loc . /usr/man/man1 $syspath`
2896 if $test -d "$sysman"; then
2897 echo "System manual is in $sysman." >&4
2899 echo "Could not find manual pages in source form." >&4
2902 : see what memory models we can support
2905 $cat >pdp11.c <<'EOP'
2915 '') modelcc="$cc" ;;
2918 ( $modelcc -o pdp11 pdp11.c ) >/dev/null 2>&1
2919 if $test -f pdp11 && ./pdp11 2>/dev/null; then
2920 dflt='unsplit split'
2922 tans=`./loc . X /lib/small /lib/large /usr/lib/small /usr/lib/large /lib/medium /usr/lib/medium /lib/huge`
2925 *) if $test -d /lib/small || $test -d /usr/lib/small; then
2930 if $test -d /lib/medium || $test -d /usr/lib/medium; then
2933 if $test -d /lib/large || $test -d /usr/lib/large; then
2936 if $test -d /lib/huge || $test -d /usr/lib/huge; then
2945 Some systems have different model sizes. On most systems they are called
2946 small, medium, large, and huge. On the PDP11 they are called unsplit and
2947 split. If your system doesn't support different memory models, say "none".
2948 If you wish to force everything to one memory model, say "none" here and
2949 put the appropriate flags later when it asks you for other cc and ld flags.
2950 Venix systems may wish to put "none" and let the compiler figure things out.
2951 (In the following question multiple model names should be space separated.)
2953 The default for most systems is "none".
2956 rp="Which memory models are supported?"
2971 '') if $contains '\-i' $sysman/ld.1 >/dev/null 2>&1 || \
2972 $contains '\-i' $sysman/cc.1 >/dev/null 2>&1; then
2979 rp="What flag indicates separate I and D space?"
2987 *large*|*small*|*medium*|*huge*)
2994 rp="What flag indicates large model?"
3004 *huge*) case "$huge" in
3008 rp="What flag indicates huge model?"
3018 *medium*) case "$medium" in
3022 rp="What flag indicates medium model?"
3029 *) medium="$large";;
3032 *small*) case "$small" in
3036 rp="What flag indicates small model?"
3047 echo "Unrecognized memory models--you may have to edit Makefile.SH" >&4
3050 $rm -f pdp11.* pdp11
3052 : make some quick guesses about what we are up against
3054 $echo $n "Hmm... $c"
3064 $cat /usr/include/signal.h /usr/include/sys/signal.h >foo 2>/dev/null
3065 if test -f /osf_boot || $contains 'OSF/1' /usr/include/ctype.h >/dev/null 2>&1
3067 echo "Looks kind of like an OSF/1 system, but we'll see..."
3069 elif test `echo abc | tr a-z A-Z` = Abc ; then
3070 xxx=`./loc addbib blurfl $pth`
3071 if $test -f $xxx; then
3072 echo "Looks kind of like a USG system with BSD features, but we'll see..."
3076 if $contains SIGTSTP foo >/dev/null 2>&1 ; then
3077 echo "Looks kind of like an extended USG system, but we'll see..."
3079 echo "Looks kind of like a USG system, but we'll see..."
3083 elif $contains SIGTSTP foo >/dev/null 2>&1 ; then
3084 echo "Looks kind of like a BSD system, but we'll see..."
3088 echo "Looks kind of like a Version 7 system, but we'll see..."
3091 case "$eunicefix" in
3094 There is, however, a strange, musty smell in the air that reminds me of
3095 something...hmm...yes...I've got it...there's a VMS nearby, or I'm a Blit.
3099 : it so happens the Eunice I know will not run shell scripts in Unix format
3103 echo "Congratulations. You aren't running Eunice."
3107 : Detect OS2. The p_ variable is set above in the Head.U unit.
3112 I have the feeling something is not exactly right, however...don't tell me...
3113 lemme think...does HAL ring a bell?...no, of course, you're only running OS/2!
3118 if test -f /xenix; then
3119 echo "Actually, this looks more like a XENIX system..."
3124 echo "It's not Xenix..."
3129 if test -f /venix; then
3130 echo "Actually, this looks more like a VENIX system..."
3137 echo "Nor is it Venix..."
3140 chmod +x bsd usg v7 osf1 eunice xenix venix os2
3141 $eunicefix bsd usg v7 osf1 eunice xenix venix os2
3144 : see if we need a special compiler
3152 *) if $contains '\-M' $sysman/cc.1 >/dev/null 2>&1 ; then
3153 if $contains '\-M' $sysman/cpp.1 >/dev/null 2>&1; then
3167 On some older systems the default C compiler will not resolve multiple global
3168 references that happen to have the same name. On some such systems the "Mcc"
3169 command may be used to force these to be resolved. On other systems a "cc -M"
3170 command is required. (Note that the -M flag on other systems indicates a
3171 memory model to use!) If you have the Gnu C compiler, you might wish to use
3177 rp="Use which C compiler?"
3185 rp="Use which C compiler?"
3189 : Look for a hint-file generated 'call-back-unit'. Now that the
3190 : user has specified the compiler, we may need to set or change some
3192 if $test -f cc.cbu; then
3198 echo "Checking for GNU cc in disguise and/or its version number..." >&4
3199 $cat >gccvers.c <<EOM
3204 printf("%s\n", __VERSION__);
3206 printf("%s\n", "1");
3212 if $cc $ldflags -o gccvers gccvers.c; then
3213 gccversion=`./gccvers`
3214 case "$gccversion" in
3215 '') echo "You are not using GNU cc." ;;
3216 *) echo "You are using GNU cc $gccversion."
3222 echo "*** WHOA THERE!!! ***" >&4
3223 echo " Your C compiler \"$cc\" doesn't seem to be working!" >&4
3224 case "$knowitall" in
3226 echo " You'd better start hunting for one and let me know about it." >&4
3232 case "$gccversion" in
3233 1*) cpp=`./loc gcc-cpp $cpp $pth` ;;
3235 case "$gccversion" in
3236 '') gccosandvers='' ;;
3237 *) gccshortvers=`echo "$gccversion"|sed 's/ .*//'`
3238 gccosandvers=`$cc -v 2>&1|grep '/specs$'|sed "s!.*/[^-/]*-[^-/]*-\([^-/]*\)/$gccshortvers/specs!\1!"`
3240 case "$gccosandvers" in
3241 $osname) gccosandvers='' ;; # linux gccs seem to have no linux osvers, grr
3242 $osname$osvers) ;; # looking good
3243 $osname*) cat <<EOM >&4
3245 *** WHOA THERE!!! ***
3247 Your gcc has not been compiled for the exact release of
3248 your operating system ($gccosandvers versus $osname$osvers).
3250 In general it is a good idea to keep gcc synchronized with
3251 the operating system because otherwise serious problems
3252 may ensue when trying to compile software, like Perl.
3254 I'm trying to be optimistic here, though, and will continue.
3255 If later during the configuration and build icky compilation
3256 problems appear (headerfile conflicts being the most common
3257 manifestation), I suggest reinstalling the gcc to match
3258 your operating system release.
3262 *) gccosandvers='' ;; # failed to parse, better be silent
3270 : see how we invoke the C preprocessor
3272 echo "Now, how can we feed standard input to your C preprocessor..." >&4
3273 cat <<'EOT' >testcpp.c
3279 if test ! -f cppstdin; then
3280 if test "X$osname" = "Xaix" -a "X$gccversion" = X; then
3281 # AIX cc -E doesn't show the absolute headerfile
3282 # locations but we'll cheat by using the -M flag.
3283 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
3285 echo 'cat >.$$.c; '"$cc"' -E ${1+"$@"} .$$.c; rm .$$.c' >cppstdin
3288 echo "Keeping your $hint cppstdin wrapper."
3291 wrapper=`pwd`/cppstdin
3295 if $test "X$cppstdin" != "X" && \
3296 $cppstdin $cppminus <testcpp.c >testcpp.out 2>&1 && \
3297 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
3299 echo "You used to use $cppstdin $cppminus so we'll use that again."
3301 '') echo "But let's see if we can live without a wrapper..." ;;
3303 if $cpprun $cpplast <testcpp.c >testcpp.out 2>&1 && \
3304 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
3306 echo "(And we'll use $cpprun $cpplast to preprocess directly.)"
3309 echo "(However, $cpprun $cpplast does not work, let's see...)"
3317 echo "Good old $cppstdin $cppminus does not seem to be of any help..."
3324 elif echo 'Maybe "'"$cc"' -E" will work...'; \
3325 $cc -E <testcpp.c >testcpp.out 2>&1; \
3326 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3327 echo "Yup, it does."
3330 elif echo 'Nope...maybe "'"$cc"' -E -" will work...'; \
3331 $cc -E - <testcpp.c >testcpp.out 2>&1; \
3332 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3333 echo "Yup, it does."
3336 elif echo 'Nope...maybe "'"$cc"' -P" will work...'; \
3337 $cc -P <testcpp.c >testcpp.out 2>&1; \
3338 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3339 echo "Yipee, that works!"
3342 elif echo 'Nope...maybe "'"$cc"' -P -" will work...'; \
3343 $cc -P - <testcpp.c >testcpp.out 2>&1; \
3344 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3345 echo "At long last!"
3348 elif echo 'No such luck, maybe "'$cpp'" will work...'; \
3349 $cpp <testcpp.c >testcpp.out 2>&1; \
3350 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3354 elif echo 'Nixed again...maybe "'$cpp' -" will work...'; \
3355 $cpp - <testcpp.c >testcpp.out 2>&1; \
3356 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3357 echo "Hooray, it works! I was beginning to wonder."
3360 elif echo 'Uh-uh. Time to get fancy. Trying a wrapper...'; \
3361 $wrapper <testcpp.c >testcpp.out 2>&1; \
3362 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3368 rp="No dice. I can't find a C preprocessor. Name one:"
3372 $x_cpp <testcpp.c >testcpp.out 2>&1
3373 if $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3374 echo "OK, that will do." >&4
3376 echo "Sorry, I can't get that to work. Go find one and rerun Configure." >&4
3391 echo "Perhaps can we force $cc -E using a wrapper..."
3392 if $wrapper <testcpp.c >testcpp.out 2>&1; \
3393 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
3399 echo "Nope, we'll have to live without it..."
3413 "$wrapper"|'cppstdin') ;;
3414 *) $rm -f $wrapper;;
3416 $rm -f testcpp.c testcpp.out
3418 : decide how portable to be. Allow command line overrides.
3419 case "$d_portable" in
3421 *) d_portable="$define" ;;
3424 : set up shell script to do ~ expansion
3430 echo \$1 | $sed "s|~|\${HOME-\$LOGDIR}|"
3433 if $test -f /bin/csh; then
3434 /bin/csh -f -c "glob \$1"
3439 name=\`$expr x\$1 : '..\([^/]*\)'\`
3440 dir=\`$sed -n -e "/^\${name}:/{s/^[^:]*:[^:]*:[^:]*:[^:]*:[^:]*:\([^:]*\).*"'\$'"/\1/" -e p -e q -e '}' </etc/passwd\`
3441 if $test ! -d "\$dir"; then
3443 echo "\$me: can't locate home directory for: \$name" >&2
3448 echo \$dir/\`$expr x\$1 : '..[^/]*/\(.*\)'\`
3464 : now set up to get a file name
3468 cat <<'EOSC' >>getfile
3484 expr $fn : '.*(\(.*\)).*' | tr ',' $trnl >getfile.ok
3485 fn=`echo $fn | sed 's/(.*)//'`
3491 loc_file=`expr $fn : '.*:\(.*\)'`
3492 fn=`expr $fn : '\(.*\):.*'`
3500 */*) fullpath=true;;
3509 *e*) exp_file=true;;
3512 *p*) nopath_ok=true;;
3517 *d*) type='Directory';;
3518 *l*) type='Locate';;
3523 Locate) what='File';;
3528 case "$d_portable" in
3536 while test "$type"; do
3541 true) rp="$rp (~name ok)";;
3544 if test -f UU/getfile.ok && \
3545 $contains "^$ans\$" UU/getfile.ok >/dev/null 2>&1
3564 value=`UU/filexp $ans`
3567 if test "$ans" != "$value"; then
3568 echo "(That expands to $value on this system.)"
3582 /*) value="$ansexp" ;;
3583 [a-zA-Z]:/*) value="$ansexp" ;;
3588 echo "I shall only accept a full path name, as in /bin/ls." >&4
3589 echo "Use a ! shell escape if you wish to check pathnames." >&4
3592 echo "Please give a full path name, starting with slash." >&4
3595 echo "Note that using ~name is ok provided it expands well." >&4
3608 for fp in $gfpth; do
3609 if test "X$fp" = X.; then
3614 if test -f "$pf"; then
3616 elif test -r "$pf" || (test -h "$pf") >/dev/null 2>&1
3618 echo "($value is not a plain file, but that's ok.)"
3621 if test X"$type" = X; then
3628 for fp in $gfpth; do
3629 if test "X$fp" = X.; then
3634 direxp="$fp/$ansexp"
3636 if test -d "$direxp"; then
3644 if test -d "$ansexp"; then
3645 echo "(Looking for $loc_file in directory $value.)"
3646 value="$value/$loc_file"
3647 ansexp="$ansexp/$loc_file"
3649 if test -f "$ansexp"; then
3652 case "$nopath_ok" in
3653 true) case "$value" in
3655 *) echo "Assuming $value will be in people's path."
3671 if test "$fastread" = yes; then
3676 rp="$what $value doesn't exist. Use that name anyway?"
3695 test "X$gfpthkeep" != Xy && gfpth=""
3698 : What should the include directory be ?
3700 $echo $n "Hmm... $c"
3704 if $test -f /bin/mips && /bin/mips; then
3705 echo "Looks like a MIPS system..."
3706 $cat >usr.c <<'EOCP'
3707 #ifdef SYSTYPE_BSD43
3711 if cc -E usr.c > usr.out && $contains / usr.out >/dev/null 2>&1; then
3712 dflt='/bsd43/usr/include'
3716 mips_type='System V'
3718 $rm -f usr.c usr.out
3719 echo "and you're compiling with the $mips_type compiler and libraries."
3723 echo "Doesn't look like a MIPS system."
3733 case "$xxx_prompt" in
3736 rp='Where are the include files you want to use?'
3744 : Set private lib path
3747 plibpth="$incpath/usr/lib /usr/local/lib /usr/ccs/lib"
3752 '') dlist="$loclibpth $plibpth $glibpth";;
3753 *) dlist="$libpth";;
3756 : Now check and see which directories actually exist, avoiding duplicates
3760 if $test -d $xxx; then
3763 *) libpth="$libpth $xxx";;
3769 Some systems have incompatible or broken versions of libraries. Among
3770 the directories listed in the question below, please remove any you
3771 know not to be holding relevant libraries, and add any that are needed.
3772 Say "none" for none.
3783 rp="Directories to use for library searches?"
3790 : compute shared library extension
3793 if xxx=`./loc libc.sl X $libpth`; $test -f "$xxx"; then
3803 On some systems, shared libraries may be available. Answer 'none' if
3804 you want to suppress searching of shared libraries for the remainder
3805 of this configuration.
3808 rp='What is the file extension used for shared libraries?'
3812 : Define several unixisms.
3813 : Hints files or command line option can be used to override them.
3814 : The convoluted testing is in case hints files set either the old
3817 '') case "$exe_ext" in
3819 *) _exe="$exe_ext" ;;
3824 '') case "$lib_ext" in
3831 '') case "$obj_ext" in
3838 '') case "$path_sep" in
3849 : Which makefile gets called first. This is used by make depend.
3850 case "$firstmakefile" in
3851 '') firstmakefile='makefile';;
3855 $define|true|[yY]*) dflt='y';;
3860 Perl can be built to use the SOCKS proxy protocol library. To do so,
3861 Configure must be run with -Dusesocks.
3863 If this doesn't make any sense to you, just accept the default '$dflt'.
3865 rp='Build Perl for SOCKS?'
3868 y|Y) val="$define" ;;
3874 : Looking for optional libraries
3876 echo "Checking for optional libraries..." >&4
3881 case "$libswanted" in
3882 '') libswanted='c_s';;
3885 "$define") libswanted="$libswanted socks5 socks5_sh" ;;
3891 for thisdir in $libpth $xlibpth; do
3892 test -d $thisdir && libspath="$libspath $thisdir"
3894 for thislib in $libswanted; do
3895 for thisdir in $libspath; do
3897 if $test ! -f "$xxx" -a "X$ignore_versioned_solibs" = "X"; then
3898 xxx=`ls $thisdir/lib$thislib.$so.[0-9] 2>/dev/null|tail -1`
3899 $test -f "$xxx" && eval $libscheck
3900 $test -f "$xxx" && libstyle=shared
3902 if test ! -f "$xxx"; then
3903 xxx=$thisdir/lib$thislib.$so
3904 $test -f "$xxx" && eval $libscheck
3905 $test -f "$xxx" && libstyle=shared
3907 if test ! -f "$xxx"; then
3908 xxx=$thisdir/lib$thislib$_a
3909 $test -f "$xxx" && eval $libscheck
3910 $test -f "$xxx" && libstyle=static
3912 if test ! -f "$xxx"; then
3913 xxx=$thisdir/$thislib$_a
3914 $test -f "$xxx" && eval $libscheck
3915 $test -f "$xxx" && libstyle=static
3917 if test ! -f "$xxx"; then
3918 xxx=$thisdir/lib${thislib}_s$_a
3919 $test -f "$xxx" && eval $libscheck
3920 $test -f "$xxx" && libstyle=static
3921 $test -f "$xxx" && thislib=${thislib}_s
3923 if test ! -f "$xxx"; then
3924 xxx=$thisdir/Slib$thislib$_a
3925 $test -f "$xxx" && eval $libscheck
3926 $test -f "$xxx" && libstyle=static
3928 if $test -f "$xxx"; then
3930 shared) echo "Found -l$thislib (shared)." ;;
3931 static) echo "Found -l$thislib." ;;
3932 *) echo "Found -l$thislib ($libstyle)." ;;
3936 *) dflt="$dflt -l$thislib"
3937 libsfound="$libsfound $xxx"
3939 libsfiles="$libsfiles $yyy"
3940 yyy=`echo $xxx|$sed -e "s%/$yyy\\$%%"`
3941 case " $libsdirs " in
3943 *) libsdirs="$libsdirs $yyy" ;;
3950 if $test ! -f "$xxx"; then
3951 echo "No -l$thislib."
3962 ' '|'') dflt='none';;
3967 In order to compile $package on your machine, a number of libraries
3968 are usually needed. Include any other special libraries here as well.
3969 Say "none" for none. The default list is almost always right.
3973 rp="What libraries to use?"
3980 : determine optimization, if desired, or use for debug flag also
3982 ' '|$undef) dflt='none';;
3984 *) dflt="$optimize";;
3988 By default, $package compiles with the -O flag to use the optimizer.
3989 Alternately, you might want to use the symbolic debugger, which uses
3990 the -g flag (on traditional Unix systems). Either flag can be
3991 specified here. To use neither flag, specify the word "none".
3994 rp="What optimizer/debugger flag should be used?"
3998 'none') optimize=" ";;
4002 : We will not override a previous value, but we might want to
4003 : augment a hint file
4005 default|recommended)
4006 case "$gccversion" in
4007 1*) dflt='-fpcc-struct-return' ;;
4010 *-g*) dflt="$dflt -DDEBUGGING";;
4012 case "$gccversion" in
4013 2*) if test -d /etc/conf/kconfig.d &&
4014 $contains _POSIX_VERSION $usrinc/sys/unistd.h >/dev/null 2>&1
4020 case "$gccversion" in
4024 echo "Checking if your compiler accepts -fno-strict-aliasing" 2>&1
4025 echo 'int main(void) { return 0; }' > gcctest.c
4026 if $cc -O2 -fno-strict-aliasing -o gcctest gcctest.c; then
4027 echo "Yes, it does." 2>&1
4030 echo "Leaving current flags $ccflags alone." 2>&1
4032 *) dflt="$dflt -fno-strict-aliasing" ;;
4035 echo "Nope, it doesn't, but that's ok." 2>&1
4042 case "$mips_type" in
4043 *BSD*|'') inclwanted="$locincpth $usrinc";;
4044 *) inclwanted="$locincpth $inclwanted $usrinc/bsd";;
4046 for thisincl in $inclwanted; do
4047 if $test -d $thisincl; then
4048 if $test x$thisincl != x$usrinc; then
4051 *) dflt="$dflt -I$thisincl";;
4057 inctest='if $contains $2 $usrinc/$1 >/dev/null 2>&1; then
4059 elif $contains $2 $usrinc/sys/$1 >/dev/null 2>&1; then
4067 *) dflt="$dflt -D$2";;
4071 set signal.h LANGUAGE_C; eval $inctest
4075 ccflags="$ccflags -DSOCKS"
4080 default|recommended) dflt="$ccflags $dflt" ;;
4081 *) dflt="$ccflags";;
4089 Your C compiler may want other flags. For this question you should include
4090 -I/whatever and -DWHATEVER flags and any other flags used by the C compiler,
4091 but you should NOT include libraries or ld flags like -lwhatever. If you
4092 want $package to honor its debug switch, you should include -DDEBUGGING here.
4093 Your C compiler might also need additional flags, such as -D_POSIX_SOURCE.
4095 To use no flags, specify the word "none".
4101 rp="Any additional cc flags?"
4108 : the following weeds options from ccflags that are of no interest to cpp
4110 case "$gccversion" in
4111 1*) cppflags="$cppflags -D__GNUC__"
4113 case "$mips_type" in
4115 *BSD*) cppflags="$cppflags -DSYSTYPE_BSD43";;
4121 echo "Let me guess what the preprocessor flags are..." >&4
4135 *) ftry="$previous $flag";;
4137 if $cppstdin -DLFRULB=bar $cppflags $ftry $cppminus <cpp.c \
4138 >cpp1.out 2>/dev/null && \
4139 $cpprun -DLFRULB=bar $cppflags $ftry $cpplast <cpp.c \
4140 >cpp2.out 2>/dev/null && \
4141 $contains 'foo.*xx.*bar' cpp1.out >/dev/null 2>&1 && \
4142 $contains 'foo.*xx.*bar' cpp2.out >/dev/null 2>&1
4144 cppflags="$cppflags $ftry"
4154 *-*) echo "They appear to be: $cppflags";;
4156 $rm -f cpp.c cpp?.out
4160 : flags used in final linking phase
4162 '') if ./venix; then
4168 *-posix*) dflt="$dflt -posix" ;;
4171 *) dflt="$ldflags";;
4174 : Try to guess additional flags to pick up local libraries.
4175 for thislibdir in $libpth; do
4176 case " $loclibpth " in
4179 *"-L$thislibdir "*) ;;
4180 *) dflt="$dflt -L$thislibdir" ;;
4192 Your C linker may need flags. For this question you should
4193 include -L/whatever and any other flags used by the C linker, but you
4194 should NOT include libraries like -lwhatever.
4196 Make sure you include the appropriate -L/path flags if your C linker
4197 does not normally search all of the directories you specified above,
4200 To use no flags, specify the word "none".
4204 rp="Any additional ld flags (NOT including libraries)?"
4210 rmlist="$rmlist pdp11"
4214 echo "Checking your choice of C compiler and flags for coherency..." >&4
4215 $cat > try.c <<'EOF'
4217 int main() { printf("Ok\n"); exit(0); }
4219 set X $cc $optimize $ccflags -o try $ldflags try.c $libs
4221 $cat >try.msg <<'EOM'
4222 I've tried to compile and run the following simple program:
4225 $cat try.c >> try.msg
4227 $cat >> try.msg <<EOM
4234 and I got the following output:
4238 if sh -c "$cc $optimize $ccflags -o try $ldflags try.c $libs" >>try.msg 2>&1; then
4239 if sh -c './try' >>try.msg 2>&1; then
4243 *) echo 'The program compiled OK, but produced no output.' >> try.msg
4246 cat >> try.msg <<'EOQS'
4247 If $libs contains -lsfio, and sfio is mis-configured, then it
4248 sometimes (apparently) runs and exits with a 0 status, but with no
4249 output! It may have to do with sfio's use of _exit vs. exit.
4252 rp="You have a big problem. Shall I abort Configure"
4259 echo "The program compiled OK, but exited with status $?." >>try.msg
4260 rp="You have a problem. Shall I abort Configure"
4264 echo "I can't compile the test program." >>try.msg
4265 rp="You have a BIG problem. Shall I abort Configure"
4271 case "$knowitall" in
4273 echo "(The supplied flags or libraries might be incorrect.)"
4281 *) echo "Ok. Stopping Configure." >&4
4286 n) echo "OK, that should do.";;
4288 $rm -f try try.* core
4290 : define an is-a-typedef? function
4291 typedef='type=$1; var=$2; def=$3; shift; shift; shift; inclist=$@;
4293 "") inclist="sys/types.h";;
4295 eval "varval=\$$var";
4299 for inc in $inclist; do
4300 echo "#include <$inc>" >>temp.c;
4302 echo "#ifdef $type" >> temp.c;
4303 echo "printf(\"We have $type\");" >> temp.c;
4304 echo "#endif" >> temp.c;
4305 $cppstdin $cppflags $cppminus < temp.c >temp.E 2>/dev/null;
4306 if $contains $type temp.E >/dev/null 2>&1; then
4312 *) eval "$var=\$varval";;
4315 : define an is-a-typedef? function that prompts if the type is not available.
4316 typedef_ask='type=$1; var=$2; def=$3; shift; shift; shift; inclist=$@;
4318 "") inclist="sys/types.h";;
4320 eval "varval=\$$var";
4324 for inc in $inclist; do
4325 echo "#include <$inc>" >>temp.c;
4327 echo "#ifdef $type" >> temp.c;
4328 echo "printf(\"We have $type\");" >> temp.c;
4329 echo "#endif" >> temp.c;
4330 $cppstdin $cppflags $cppminus < temp.c >temp.E 2>/dev/null;
4332 echo "$rp" | $sed -e "s/What is/Looking for/" -e "s/?/./";
4333 if $contains $type temp.E >/dev/null 2>&1; then
4334 echo "$type found." >&4;
4337 echo "$type NOT found." >&4;
4343 *) eval "$var=\$varval";;
4346 : define a shorthand compile call
4350 $cc $optimize $ccflags $ldflags -o ${mc_file} $* ${mc_file}.c $libs > /dev/null 2>&1;'
4351 : define a shorthand compile call for compilations that should be ok.
4355 $cc $optimize $ccflags $ldflags -o ${mc_file} $* ${mc_file}.c $libs;'
4357 : check for lengths of integral types
4361 echo "Checking to see how big your integers are..." >&4
4362 $cat >intsize.c <<'EOCP'
4366 printf("intsize=%d;\n", (int)sizeof(int));
4367 printf("longsize=%d;\n", (int)sizeof(long));
4368 printf("shortsize=%d;\n", (int)sizeof(short));
4373 if eval $compile_ok && ./intsize > /dev/null; then
4375 echo "Your integers are $intsize bytes long."
4376 echo "Your long integers are $longsize bytes long."
4377 echo "Your short integers are $shortsize bytes long."
4381 Help! I can't compile and run the intsize test program: please enlighten me!
4382 (This is probably a misconfiguration in your system or libraries, and
4383 you really ought to fix it. Still, I'll try anyway.)
4387 rp="What is the size of an integer (in bytes)?"
4391 rp="What is the size of a long integer (in bytes)?"
4395 rp="What is the size of a short integer (in bytes)?"
4401 $rm -f intsize intsize.*
4403 : see what type lseek is declared as in the kernel
4404 rp="What is the type used for lseek's offset on this system?"
4405 set off_t lseektype long stdio.h sys/types.h
4409 echo "Checking to see how big your file offsets are..." >&4
4411 #include <sys/types.h>
4415 printf("%d\n", (int)sizeof($lseektype));
4420 if eval $compile_ok; then
4422 echo "Your file offsets are $lseeksize bytes long."
4426 echo "(I can't seem to compile the test program. Guessing...)"
4427 rp="What is the size of your file offsets (in bytes)?"
4433 : see what type file positions are declared as in the library
4434 rp="What is the type for file position used by fsetpos()?"
4435 set fpos_t fpostype long stdio.h sys/types.h
4440 *_t) zzz="$fpostype" ;;
4443 echo "Checking the size of $zzz..." >&4
4445 #include <sys/types.h>
4448 printf("%d\n", (int)sizeof($fpostype));
4453 if eval $compile_ok; then
4457 echo "(I can't execute the test program--guessing $fpossize.)" >&4
4460 echo "Your $zzz is $fpossize bytes long."
4466 echo "(I can't compile the test program. Guessing...)" >&4
4467 rp="What is the size of your file positions (in bytes)?"
4474 # Backward compatibility (uselfs is deprecated).
4476 "$define"|true|[yY]*)
4479 *** Configure -Duselfs is deprecated, using -Duselargefiles instead.
4481 uselargefiles="$define"
4485 case "$lseeksize:$fpossize" in
4488 You can have files larger than 2 gigabytes.
4491 *) case "$uselargefiles" in
4492 "$undef"|false|[nN]*) dflt='n' ;;
4497 Perl can be built to understand large files (files larger than 2 gigabytes)
4498 on some systems. To do so, Configure can be run with -Duselargefiles.
4500 If this doesn't make any sense to you, just accept the default '$dflt'.
4502 rp='Try to understand large files, if available?'
4505 y|Y) val="$define" ;;
4512 case "$uselargefiles" in
4514 : Look for a hint-file generated 'call-back-unit'. If the
4515 : user has specified that a large files perl is to be built,
4516 : we may need to set or change some other defaults.
4517 if $test -f uselargefiles.cbu; then
4518 echo "Your platform has some specific hints for large file builds, using them..."
4519 . ./uselargefiles.cbu
4521 echo "Rechecking to see how big your file offsets are..." >&4
4523 #include <sys/types.h>
4527 printf("%d\n", (int)sizeof($lseektype));
4532 if eval $compile_ok; then
4534 $echo "Your file offsets are now $lseeksize bytes long."
4538 echo "(I can't seem to compile the test program. Guessing...)"
4539 rp="What is the size of your file offsets (in bytes)?"
4544 *_t) zzz="$fpostype" ;;
4547 $echo $n "Rechecking the size of $zzz...$c" >&4
4549 #include <sys/types.h>
4552 printf("%d\n", (int)sizeof($fpostype));
4557 if eval $compile_ok; then
4562 echo "(I can't execute the test program--guessing $fpossize.)" >&4
4565 echo " $fpossize bytes." >&4
4571 echo "(I can't compile the test program. Guessing...)" >&4
4572 rp="What is the size of your file positions (in bytes)?"
4582 case "$usemorebits" in
4583 "$define"|true|[yY]*)
4584 use64bitint="$define"
4585 uselongdouble="$define"
4586 usemorebits="$define"
4588 *) usemorebits="$undef"
4593 case "$uselonglong" in
4594 "$define"|true|[yY]*)
4597 *** Configure -Duselonglong is deprecated, using -Duse64bitint instead.
4599 use64bitint="$define"
4602 case "$use64bits" in
4603 "$define"|true|[yY]*)
4606 *** Configure -Duse64bits is deprecated, using -Duse64bitint instead.
4608 use64bitint="$define"
4611 case "$use64bitints" in
4612 "$define"|true|[yY]*)
4615 *** There is no Configure -Duse64bitints, using -Duse64bitint instead.
4617 use64bitint="$define"
4620 case "$use64bitsint" in
4621 "$define"|true|[yY]*)
4624 *** There is no Configure -Duse64bitsint, using -Duse64bitint instead.
4626 use64bitint="$define"
4629 case "$uselonglongs" in
4630 "$define"|true|[yY]*)
4633 *** There is no Configure -Duselonglongs, using -Duse64bitint instead.
4635 use64bitint="$define"
4638 case "$use64bitsall" in
4639 "$define"|true|[yY]*)
4642 *** There is no Configure -Duse64bitsall, using -Duse64bitall instead.
4644 use64bitall="$define"
4649 *-DUSE_LONG_LONG*|*-DUSE_64_BIT_INT*|*-DUSE_64_BIT_ALL*) use64bitint="$define";;
4651 case "$use64bitall" in
4652 "$define"|true|[yY]*) use64bitint="$define" ;;
4658 You have natively 64-bit long integers.
4662 *) case "$use64bitint" in
4663 "$define"|true|[yY]*) dflt='y';;
4668 Perl can be built to take advantage of 64-bit integer types
4669 on some systems. To do so, Configure can be run with -Duse64bitint.
4670 Choosing this option will most probably introduce binary incompatibilities.
4672 If this doesn't make any sense to you, just accept the default '$dflt'.
4674 rp='Try to use 64-bit integers, if available?'
4677 [yY]*) val="$define" ;;
4685 case "$use64bitall" in
4686 "$define"|true|[yY]*) dflt='y' ;;
4687 *) case "$longsize" in
4695 You may also choose to try maximal 64-bitness. It means using as much
4696 64-bitness as possible on the platform. This in turn means even more
4697 binary incompatibilities. On the other hand, your platform may not
4698 have any more 64-bitness available than what you already have chosen.
4700 If this doesn't make any sense to you, just accept the default '$dflt'.
4702 rp='Try to use maximal 64-bit support, if available?'
4705 [yY]*) val="$define" ;;
4710 case "$use64bitall" in
4712 case "$use64bitint" in
4716 Since you have chosen a maximally 64-bit build, I'm also turning on
4717 the use of 64-bit integers.
4719 use64bitint="$define" ;;
4724 case "$use64bitint" in
4725 "$define"|true|[yY]*)
4726 : Look for a hint-file generated 'call-back-unit'. If the
4727 : user has specified that a 64-bit perl is to be built,
4728 : we may need to set or change some other defaults.
4729 if $test -f use64bitint.cbu; then
4730 echo "Your platform has some specific hints for 64-bit integers, using them..."
4734 4) case "$archname64" in
4735 '') archname64=64int ;;
4742 case "$use64bitall" in
4743 "$define"|true|[yY]*)
4744 : Look for a hint-file generated 'call-back-unit'. If the
4745 : user has specified that a maximally 64-bit perl is to be built,
4746 : we may need to set or change some other defaults.
4747 if $test -f use64bitall.cbu; then
4748 echo "Your platform has some specific hints for 64-bit builds, using them..."
4752 4) case "$archname64" in
4753 ''|64int) archname64=64all ;;
4761 echo "Checking for GNU C Library..." >&4
4762 cat >gnulibc.c <<EOM
4774 if eval $compile_ok && ./gnulibc; then
4776 echo "You are using the GNU C Library"
4779 echo "You are not using the GNU C Library"
4785 : see if nm is to be used to determine whether a symbol is defined or not
4789 case "$d_gnulibc" in
4792 echo "nm probably won't work on the GNU C Library." >&4
4798 if $test "$osname" = aix -a ! -f /lib/syscalls.exp; then
4800 echo "Whoops! This is an AIX system without /lib/syscalls.exp!" >&4
4801 echo "'nm' won't be sufficient on this sytem." >&4
4807 '') dflt=`$egrep 'inlibc|csym' $rsrc/Configure | wc -l 2>/dev/null`
4808 if $test $dflt -gt 20; then
4818 true|$define) dflt=y;;
4825 I can use $nm to extract the symbols from your C libraries. This
4826 is a time consuming task which may generate huge output on the disk (up
4827 to 3 megabytes) but that should make the symbols extraction faster. The
4828 alternative is to skip the 'nm' extraction part and to compile a small
4829 test program instead to determine whether each symbol is present. If
4830 you have a fast C compiler and/or if your 'nm' output cannot be parsed,
4831 this may be the best solution.
4833 You probably shouldn't let me use 'nm' if you are using the GNU C Library.
4836 rp="Shall I use $nm to extract C symbols from the libraries?"
4839 [Nn]*) usenm=false;;
4848 : nm options which may be necessary
4850 '') if $test -f /mach_boot; then
4852 elif $test -d /usr/ccs/lib; then
4853 nm_opt='-p' # Solaris (and SunOS?)
4854 elif $test -f /dgux; then
4856 elif $test -f /lib64/rld; then
4857 nm_opt='-p' # 64-bit Irix
4863 : nm options which may be necessary for shared libraries but illegal
4864 : for archive libraries. Thank you, Linux.
4865 case "$nm_so_opt" in
4866 '') case "$myuname" in
4868 if $nm --help | $grep 'dynamic' > /dev/null 2>&1; then
4869 nm_so_opt='--dynamic'
4878 : get list of predefined functions in a handy place
4883 *-lc_s*) libc=`./loc libc_s$_a $libc $libpth`
4890 *) for thislib in $libs; do
4893 : Handle C library specially below.
4896 thislib=`echo $thislib | $sed -e 's/^-l//'`
4897 if try=`./loc lib$thislib.$so.'*' X $libpth`; $test -f "$try"; then
4899 elif try=`./loc lib$thislib.$so X $libpth`; $test -f "$try"; then
4901 elif try=`./loc lib$thislib$_a X $libpth`; $test -f "$try"; then
4903 elif try=`./loc $thislib$_a X $libpth`; $test -f "$try"; then
4905 elif try=`./loc lib$thislib X $libpth`; $test -f "$try"; then
4907 elif try=`./loc $thislib X $libpth`; $test -f "$try"; then
4909 elif try=`./loc Slib$thislib$_a X $xlibpth`; $test -f "$try"; then
4914 libnames="$libnames $try"
4916 *) libnames="$libnames $thislib" ;;
4925 for xxx in $libpth; do
4926 $test -r $1 || set $xxx/libc.$so
4927 : The messy sed command sorts on library version numbers.
4929 set `echo blurfl; echo $xxx/libc.$so.[0-9]* | \
4930 tr ' ' $trnl | egrep -v '\.[A-Za-z]*$' | $sed -e '
4932 s/[0-9][0-9]*/0000&/g
4933 s/0*\([0-9][0-9][0-9][0-9][0-9]\)/\1/g
4936 sort | $sed -e 's/^.* //'`
4939 $test -r $1 || set /usr/ccs/lib/libc.$so
4940 $test -r $1 || set /lib/libsys_s$_a
4946 if $test -r "$1"; then
4947 echo "Your (shared) C library seems to be in $1."
4949 elif $test -r /lib/libc && $test -r /lib/clib; then
4950 echo "Your C library seems to be in both /lib/clib and /lib/libc."
4952 libc='/lib/clib /lib/libc'
4953 if $test -r /lib/syslib; then
4954 echo "(Your math library is in /lib/syslib.)"
4955 libc="$libc /lib/syslib"
4957 elif $test -r "$libc" || (test -h "$libc") >/dev/null 2>&1; then
4958 echo "Your C library seems to be in $libc, as you said before."
4959 elif $test -r $incpath/usr/lib/libc$_a; then
4960 libc=$incpath/usr/lib/libc$_a;
4961 echo "Your C library seems to be in $libc. That's fine."
4962 elif $test -r /lib/libc$_a; then
4964 echo "Your C library seems to be in $libc. You're normal."
4966 if tans=`./loc libc$_a blurfl/dyick $libpth`; $test -r "$tans"; then
4968 elif tans=`./loc libc blurfl/dyick $libpth`; $test -r "$tans"; then
4969 libnames="$libnames "`./loc clib blurfl/dyick $libpth`
4970 elif tans=`./loc clib blurfl/dyick $libpth`; $test -r "$tans"; then
4972 elif tans=`./loc Slibc$_a blurfl/dyick $xlibpth`; $test -r "$tans"; then
4974 elif tans=`./loc Mlibc$_a blurfl/dyick $xlibpth`; $test -r "$tans"; then
4977 tans=`./loc Llibc$_a blurfl/dyick $xlibpth`
4979 if $test -r "$tans"; then
4980 echo "Your C library seems to be in $tans, of all places."
4986 if $test $xxx = apollo -o -r "$libc" || (test -h "$libc") >/dev/null 2>&1; then
4990 If the guess above is wrong (which it might be if you're using a strange
4991 compiler, or your machine supports multiple models), you can override it here.
4996 echo $libpth | tr ' ' $trnl | sort | uniq > libpath
4998 I can't seem to find your C library. I've looked in the following places:
5001 $sed 's/^/ /' libpath
5004 None of these seems to contain your C library. I need to get its name...
5009 rp='Where is your C library?'
5014 echo $libc $libnames | tr ' ' $trnl | sort | uniq > libnames
5015 set X `cat libnames`
5018 case $# in 1) xxx=file; esac
5019 echo "Extracting names from the following $xxx for later perusal:" >&4
5021 $sed 's/^/ /' libnames >&4
5023 $echo $n "This may take a while...$c" >&4
5027 *$so*) $nm $nm_so_opt $nm_opt $file 2>/dev/null;;
5028 *) $nm $nm_opt $file 2>/dev/null;;
5033 $grep fprintf libc.tmp > libc.ptf
5034 xscan='eval "<libc.ptf $com >libc.list"; $echo $n ".$c" >&4'
5035 xrun='eval "<libc.tmp $com >libc.list"; echo "done" >&4'
5037 if com="$sed -n -e 's/__IO//' -e 's/^.* $xxx *_[_.]*//p' -e 's/^.* $xxx *//p'";\
5039 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5041 elif com="$sed -n -e 's/^__*//' -e 's/^\([a-zA-Z_0-9$]*\).*xtern.*/\1/p'";\
5043 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5045 elif com="$sed -n -e '/|UNDEF/d' -e '/FUNC..GL/s/^.*|__*//p'";\
5047 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5049 elif com="$sed -n -e 's/^.* D __*//p' -e 's/^.* D //p'";\
5051 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5053 elif com="$sed -n -e 's/^_//' -e 's/^\([a-zA-Z_0-9]*\).*xtern.*text.*/\1/p'";\
5055 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5057 elif com="$sed -n -e 's/^.*|FUNC |GLOB .*|//p'";\
5059 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5061 elif com="$grep '|' | $sed -n -e '/|COMMON/d' -e '/|DATA/d' \
5062 -e '/ file/d' -e 's/^\([^ ]*\).*/\1/p'";\
5064 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5066 elif com="$sed -n -e 's/^.*|FUNC |GLOB .*|//p' -e 's/^.*|FUNC |WEAK .*|//p'";\
5068 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5070 elif com="$sed -n -e 's/^__//' -e '/|Undef/d' -e '/|Proc/s/ .*//p'";\
5072 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5074 elif com="$sed -n -e 's/^.*|Proc .*|Text *| *//p'";\
5076 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5078 elif com="$sed -n -e '/Def. Text/s/.* \([^ ]*\)\$/\1/p'";\
5080 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5082 elif com="$sed -n -e 's/^[-0-9a-f ]*_\(.*\)=.*/\1/p'";\
5084 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5086 elif com="$sed -n -e 's/.*\.text n\ \ \ \.//p'";\
5088 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5090 elif com="sed -n -e 's/^__.*//' -e 's/[ ]*D[ ]*[0-9]*.*//p'";\
5092 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5095 $nm -p $* 2>/dev/null >libc.tmp
5096 $grep fprintf libc.tmp > libc.ptf
5097 if com="$sed -n -e 's/^.* [ADTSIW] *_[_.]*//p' -e 's/^.* [ADTSIW] //p'";\
5098 eval $xscan; $contains '^fprintf$' libc.list >/dev/null 2>&1
5104 echo "$nm didn't seem to work right. Trying $ar instead..." >&4
5106 if $ar t $libc > libc.tmp && $contains '^fprintf$' libc.tmp >/dev/null 2>&1; then
5107 for thisname in $libnames $libc; do
5108 $ar t $thisname >>libc.tmp
5110 $sed -e "s/\\$_o\$//" < libc.tmp > libc.list
5112 elif test "X$osname" = "Xos2" && $ar tv $libc > libc.tmp; then
5113 # Repeat libc to extract forwarders to DLL entries too
5114 for thisname in $libnames $libc; do
5115 $ar tv $thisname >>libc.tmp
5116 # Revision 50 of EMX has bug in $ar.
5117 # it will not extract forwarders to DLL entries
5118 # Use emximp which will extract exactly them.
5119 emximp -o tmp.imp $thisname \
5121 $sed -e 's/^\([_a-zA-Z0-9]*\) .*$/\1/p' \
5122 < tmp.imp >>libc.tmp
5125 $sed -e "s/\\$_o\$//" -e 's/^ \+//' < libc.tmp > libc.list
5128 echo "$ar didn't seem to work right." >&4
5129 echo "Maybe this is a Cray...trying bld instead..." >&4
5130 if bld t $libc | $sed -e 's/.*\///' -e "s/\\$_o:.*\$//" > libc.list
5132 for thisname in $libnames; do
5134 $sed -e 's/.*\///' -e "s/\\$_o:.*\$//" >>libc.list
5135 $ar t $thisname >>libc.tmp
5139 echo "That didn't work either. Giving up." >&4
5146 if $test -f /lib/syscalls.exp; then
5148 echo "Also extracting names from /lib/syscalls.exp for good ole AIX..." >&4
5149 $sed -n 's/^\([^ ]*\)[ ]*syscall[0-9]*$/\1/p' /lib/syscalls.exp >>libc.list
5153 $rm -f libnames libpath
5155 : is a C symbol defined?
5158 -v) tf=libc.tmp; tc=""; tdc="";;
5159 -a) tf=libc.tmp; tc="[0]"; tdc="[]";;
5160 *) tlook="^$1\$"; tf=libc.list; tc="()"; tdc="()";;
5163 case "$reuseval-$4" in
5165 true-*) tx=no; eval "tval=\$$4"; case "$tval" in "") tx=yes;; esac;;
5171 if $contains $tlook $tf >/dev/null 2>&1;
5176 echo "int main() { extern short $1$tdc; printf(\"%hd\", $1$tc); }" > t.c;
5177 if $cc $optimize $ccflags $ldflags -o t t.c $libs >/dev/null 2>&1;
5185 $define) tval=true;;
5191 : define an is-in-libc? function
5192 inlibc='echo " "; td=$define; tu=$undef;
5193 sym=$1; var=$2; eval "was=\$$2";
5195 case "$reuseval$was" in
5205 echo "$sym() found." >&4;
5206 case "$was" in $undef) . ./whoa; esac; eval "$var=\$td";;
5208 echo "$sym() NOT found." >&4;
5209 case "$was" in $define) . ./whoa; esac; eval "$var=\$tu";;
5213 $define) echo "$sym() found." >&4;;
5214 *) echo "$sym() NOT found." >&4;;
5218 : see if sqrtl exists
5223 *-DUSE_LONG_DOUBLE*|*-DUSE_MORE_BITS*) uselongdouble="$define" ;;
5226 case "$uselongdouble" in
5227 $define|true|[yY]*) dflt='y';;
5232 Perl can be built to take advantage of long doubles which
5233 (if available) may give more accuracy and range for floating point numbers.
5235 If this doesn't make any sense to you, just accept the default '$dflt'.
5237 rp='Try to use long doubles if available?'
5240 y|Y) val="$define" ;;
5246 case "$uselongdouble" in
5247 true|[yY]*) uselongdouble="$define" ;;
5250 case "$uselongdouble" in
5252 : Look for a hint-file generated 'call-back-unit'. If the
5253 : user has specified that long doubles should be used,
5254 : we may need to set or change some other defaults.
5255 if $test -f uselongdouble.cbu; then
5256 echo "Your platform has some specific hints for long doubles, using them..."
5257 . ./uselongdouble.cbu
5260 (Your platform doesn't have any specific hints for long doubles.)
5266 case "$uselongdouble:$d_sqrtl" in
5270 *** You requested the use of long doubles but you do not seem to have
5271 *** the mathematic functions for long doubles. I'm disabling the use
5272 *** of long doubles.
5275 uselongdouble=$undef
5279 : determine the architecture name
5281 if xxx=`./loc arch blurfl $pth`; $test -f "$xxx"; then
5282 tarch=`arch`"-$osname"
5283 elif xxx=`./loc uname blurfl $pth`; $test -f "$xxx" ; then
5284 if uname -m > tmparch 2>&1 ; then
5285 tarch=`$sed -e 's/ *$//' -e 's/ /_/g' \
5286 -e 's/$/'"-$osname/" tmparch`
5294 case "$myarchname" in
5297 echo "(Your architecture name used to be $myarchname.)"
5304 *) dflt="$archname";;
5306 rp='What is your architecture name'
5309 case "$usethreads" in
5311 echo "Threads selected." >&4
5313 *-thread*) echo "...and architecture name already has -thread." >&4
5315 *) archname="$archname-thread"
5316 echo "...setting architecture name to $archname." >&4
5321 case "$usemultiplicity" in
5323 echo "Multiplicity selected." >&4
5325 *-multi*) echo "...and architecture name already has -multi." >&4
5327 *) archname="$archname-multi"
5328 echo "...setting architecture name to $archname." >&4
5333 case "$use64bitint$use64bitall" in
5335 case "$archname64" in
5339 case "$use64bitint" in
5340 "$define") echo "64 bit integers selected." >&4 ;;
5342 case "$use64bitall" in
5343 "$define") echo "64 bit memory model selected." >&4 ;;
5346 *-$archname64*) echo "...and architecture name already has $archname64." >&4
5348 *) archname="$archname-$archname64"
5349 echo "...setting architecture name to $archname." >&4
5355 case "$uselongdouble" in
5357 echo "Long doubles selected." >&4
5359 *-ld*) echo "...and architecture name already has -ld." >&4
5361 *) archname="$archname-ld"
5362 echo "...setting architecture name to $archname." >&4
5368 : determine root of directory hierarchy where package will be installed.
5371 dflt=`./loc . /usr/local /usr/local /local /opt /usr`
5379 By default, $package will be installed in $dflt/bin, manual pages
5380 under $dflt/man, etc..., i.e. with $dflt as prefix for all
5381 installation directories. Typically this is something like /usr/local.
5382 If you wish to have binaries under /usr/bin but other parts of the
5383 installation under /usr/local, that's ok: you will be prompted
5384 separately for each of the installation directories, the prefix being
5385 only used to set the defaults.
5389 rp='Installation prefix to use?'
5397 *) oldprefix="$prefix";;
5407 $define|true) afs=true ;;
5408 $undef|false) afs=false ;;
5409 *) if test -d /afs; then
5417 echo "AFS may be running... I'll be extra cautious then..." >&4
5419 echo "AFS does not seem to be running..." >&4
5422 : determine installation prefix for where package is to be installed.
5426 Since you are running AFS, I need to distinguish the directory in which
5427 files will reside from the directory in which they are installed (and from
5428 which they are presumably copied to the former directory by occult means).
5431 case "$installprefix" in
5432 '') dflt=`echo $prefix | sed 's#^/afs/#/afs/.#'`;;
5433 *) dflt="$installprefix";;
5438 In some special cases, particularly when building $package for distribution,
5439 it is convenient to distinguish between the directory in which files should
5440 be installed from the directory ($prefix) in which they
5441 will eventually reside. For most users, these two directories are the same.
5444 case "$installprefix" in
5446 *) dflt=$installprefix;;
5450 rp='What installation prefix should I use for installing files?'
5452 installprefix="$ans"
5453 installprefixexp="$ansexp"
5455 : set the prefixit variable, to compute a suitable default value
5456 prefixit='case "$3" in
5458 case "$oldprefix" in
5459 "") eval "$1=\"\$$2\"";;
5466 ""|" ") eval "$1=\"\$$2\"";;
5472 eval "tp=\"$oldprefix-\$$2-\""; eval "tp=\"$tp\"";
5474 --|/*--|\~*--) eval "$1=\"$prefix/$3\"";;
5475 /*-$oldprefix/*|\~*-$oldprefix/*)
5476 eval "$1=\`echo \$$2 | sed \"s,^$oldprefix,$prefix,\"\`";;
5477 *) eval "$1=\"\$$2\"";;
5482 : get the patchlevel
5484 echo "Getting the current patchlevel..." >&4
5485 if $test -r $rsrc/patchlevel.h;then
5486 revision=`awk '/define[ ]+PERL_REVISION/ {print $3}' $rsrc/patchlevel.h`
5487 patchlevel=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
5488 subversion=`awk '/define[ ]+PERL_SUBVERSION/ {print $3}' $rsrc/patchlevel.h`
5489 api_revision=`awk '/define[ ]+PERL_API_REVISION/ {print $3}' $rsrc/patchlevel.h`
5490 api_version=`awk '/define[ ]+PERL_API_VERSION/ {print $3}' $rsrc/patchlevel.h`
5491 api_subversion=`awk '/define[ ]+PERL_API_SUBVERSION/ {print $3}' $rsrc/patchlevel.h`
5500 $echo "(You have $package version $patchlevel subversion $subversion.)"
5503 : XXX Should be a Configure test for double-dots in filenames.
5504 version=`echo $revision $patchlevel $subversion | \
5505 $awk '{ printf "%d_%d_%d\n", $1, $2, $3 }'`
5506 api_versionstring=`echo $api_revision $api_version $api_subversion | \
5507 $awk '{ printf "%d_%d_%d\n", $1, $2, $3 }'`
5510 version=`echo $revision $patchlevel $subversion | \
5511 $awk '{ printf "%d.%d.%d\n", $1, $2, $3 }'`
5512 api_versionstring=`echo $api_revision $api_version $api_subversion | \
5513 $awk '{ printf "%d.%d.%d\n", $1, $2, $3 }'`
5516 : Special case the 5.005_xx maintenance series, which used 5.005
5517 : without any subversion label as a subdirectory in $sitelib
5518 if test "${api_revision}${api_version}${api_subversion}" = "550"; then
5519 api_versionstring='5.005'
5522 : determine installation style
5523 : For now, try to deduce it from prefix unless it is already set.
5524 : Reproduce behavior of 5.005 and earlier, maybe drop that in 5.7.
5525 case "$installstyle" in
5526 '') case "$prefix" in
5527 *perl*) dflt='lib';;
5528 *) dflt='lib/perl5' ;;
5531 *) dflt="$installstyle" ;;
5533 : Probably not worth prompting for this since we prompt for all
5534 : the directories individually, and the prompt would be too long and
5538 : determine where private library files go
5539 : Usual default is /usr/local/lib/perl5/$version.
5540 : Also allow things like /opt/perl/lib/$version, since
5541 : /opt/perl/lib/perl5... would be redundant.
5542 : The default "style" setting is made in installstyle.U
5543 case "$installstyle" in
5544 *lib/perl5*) set dflt privlib lib/$package/$version ;;
5545 *) set dflt privlib lib/$version ;;
5550 There are some auxiliary files for $package that need to be put into a
5551 private library directory that is accessible by everyone.
5555 rp='Pathname where the private library files will reside?'
5558 privlibexp="$ansexp"
5559 : Change installation prefix, if necessary.
5560 if $test X"$prefix" != X"$installprefix"; then
5561 installprivlib=`echo $privlibexp | sed "s#^$prefix#$installprefix#"`
5563 installprivlib="$privlibexp"
5566 : set the prefixup variable, to restore leading tilda escape
5567 prefixup='case "$prefixexp" in
5569 *) eval "$1=\`echo \$$1 | sed \"s,^$prefixexp,$prefix,\"\`";;
5572 : determine where public architecture dependent libraries go
5575 : privlib default is /usr/local/lib/$package/$version
5576 : archlib default is /usr/local/lib/$package/$version/$archname
5577 : privlib may have an optional trailing /share.
5578 tdflt=`echo $privlib | $sed 's,/share$,,'`
5579 tdflt=$tdflt/$archname
5588 $spackage contains architecture-dependent library files. If you are
5589 sharing libraries in a heterogeneous environment, you might store
5590 these files in a separate location. Otherwise, you can just include
5591 them with the rest of the public library files.
5595 rp='Where do you want to put the public architecture-dependent libraries?'
5598 archlibexp="$ansexp"
5599 if $test X"$archlib" = X"$privlib"; then
5604 : Change installation prefix, if necessary.
5605 if $test X"$prefix" != X"$installprefix"; then
5606 installarchlib=`echo $archlibexp | sed "s#^$prefix#$installprefix#"`
5608 installarchlib="$archlibexp"
5612 : Binary compatibility with 5.005 is not possible for builds
5613 : with advanced features
5614 case "$usethreads$usemultiplicity" in
5616 bincompat5005="$undef"
5617 d_bincompat5005="$undef"
5621 This version of Perl can be compiled for binary compatibility with 5.005.
5622 If you decide to do so, you will be able to continue using most of the
5623 extensions that were compiled for Perl 5.005.
5626 case "$bincompat5005$d_bincompat5005" in
5627 *"$undef"*) dflt=n ;;
5630 rp='Binary compatibility with Perl 5.005?'
5633 y*) val="$define" ;;
5638 case "$d_bincompat5005" in
5640 bincompat5005="$define"
5642 *) bincompat5005="$undef"
5643 d_bincompat5005="$undef"
5650 : see if setuid scripts can be secure
5653 Some kernels have a bug that prevents setuid #! scripts from being
5654 secure. Some sites have disabled setuid #! scripts because of this.
5656 First let's decide if your kernel supports secure setuid #! scripts.
5657 (If setuid #! scripts would be secure but have been disabled anyway,
5658 don't say that they are secure if asked.)
5663 if $test -d /dev/fd; then
5664 echo "#!$ls" >reflect
5665 chmod +x,u+s reflect
5666 ./reflect >flect 2>&1
5667 if $contains "/dev/fd" flect >/dev/null; then
5668 echo "Congratulations, your kernel has secure setuid scripts!" >&4
5672 If you are not sure if they are secure, I can check but I'll need a
5673 username and password different from the one you are using right now.
5674 If you don't have such a username or don't want me to test, simply
5678 rp='Other username to test security of setuid scripts with?'
5683 case "$d_suidsafe" in
5684 '') echo "I'll assume setuid scripts are *not* secure." >&4
5687 echo "Well, the $hint value is *not* secure." >&4
5689 *) echo "Well, the $hint value *is* secure." >&4
5694 $rm -f reflect flect
5695 echo "#!$ls" >reflect
5696 chmod +x,u+s reflect
5699 echo '"su" will (probably) prompt you for '"$ans's password."
5700 su $ans -c './reflect >flect'
5701 if $contains "/dev/fd" flect >/dev/null; then
5702 echo "Okay, it looks like setuid scripts are secure." >&4
5705 echo "I don't think setuid scripts are secure." >&4
5710 rp='Does your kernel have *secure* setuid scripts?'
5713 [yY]*) val="$define";;
5718 echo "I don't think setuid scripts are secure (no /dev/fd directory)." >&4
5719 echo "(That's for file descriptors, not floppy disks.)"
5725 $rm -f reflect flect
5727 : now see if they want to do setuid emulation
5730 case "$d_suidsafe" in
5733 echo "No need to emulate SUID scripts since they are secure here." >& 4
5737 Some systems have disabled setuid scripts, especially systems where
5738 setuid scripts cannot be secure. On systems where setuid scripts have
5739 been disabled, the setuid/setgid bits on scripts are currently
5740 useless. It is possible for $package to detect those bits and emulate
5741 setuid/setgid in a secure fashion. This emulation will only work if
5742 setuid scripts have been disabled in your kernel.
5746 "$define") dflt=y ;;
5749 rp="Do you want to do setuid/setgid emulation?"
5752 [yY]*) val="$define";;
5760 : determine filename position in cpp output
5762 echo "Computing filename position in cpp output for #include directives..." >&4
5763 echo '#include <stdio.h>' > foo.c
5766 $cppstdin $cppflags $cppminus <foo.c 2>/dev/null | \
5767 $grep '^[ ]*#.*stdio\.h' | \
5768 while read cline; do
5771 while $test \$# -gt 0; do
5772 if $test -r \`echo \$1 | $tr -d '"'\`; then
5777 pos=\`expr \$pos + 1\`
5789 *) pos="${fieldn}th";;
5791 echo "Your cpp writes the filename in the $pos field of the line."
5793 : locate header file
5798 for usrincdir in $usrinc
5800 if test -f \$usrincdir/\$wanted; then
5801 echo "\$usrincdir/\$wanted"
5805 awkprg='{ print \$$fieldn }'
5806 echo "#include <\$wanted>" > foo\$\$.c
5807 $cppstdin $cppminus $cppflags < foo\$\$.c 2>/dev/null | \
5808 $grep "^[ ]*#.*\$wanted" | \
5809 while read cline; do
5810 name=\`echo \$cline | $awk "\$awkprg" | $tr -d '"'\`
5812 *[/\\\\]\$wanted) echo "\$name"; exit 1;;
5813 *[\\\\/]\$wanted) echo "\$name"; exit 1;;
5818 # status = 0: grep returned 0 lines, case statement not executed
5819 # status = 1: headerfile found
5820 # status = 2: while loop executed, no headerfile found
5824 if test \$status -eq 1; then
5831 : define an alternate in-header-list? function
5832 inhdr='echo " "; td=$define; tu=$undef; yyy=$@;
5833 cont=true; xxf="echo \"<\$1> found.\" >&4";
5834 case $# in 2) xxnf="echo \"<\$1> NOT found.\" >&4";;
5835 *) xxnf="echo \"<\$1> NOT found, ...\" >&4";;
5837 case $# in 4) instead=instead;; *) instead="at last";; esac;
5838 while $test "$cont"; do
5840 var=$2; eval "was=\$$2";
5841 if $test "$xxx" && $test -r "$xxx";
5843 eval "case \"\$$var\" in $undef) . ./whoa; esac"; eval "$var=\$td";
5846 eval "case \"\$$var\" in $define) . ./whoa; esac"; eval "$var=\$tu"; fi;
5847 set $yyy; shift; shift; yyy=$@;
5848 case $# in 0) cont="";;
5849 2) xxf="echo \"but I found <\$1> $instead.\" >&4";
5850 xxnf="echo \"and I did not find <\$1> either.\" >&4";;
5851 *) xxf="echo \"but I found <\$1\> instead.\" >&4";
5852 xxnf="echo \"there is no <\$1>, ...\" >&4";;
5856 do set $yyy; var=$2; eval "was=\$$2";
5857 eval "case \"\$$var\" in $define) . ./whoa; esac"; eval "$var=\$tu";
5858 set $yyy; shift; shift; yyy=$@;
5861 : see if this is a malloc.h system
5862 set malloc.h i_malloc
5865 : see if stdlib is available
5866 set stdlib.h i_stdlib
5869 : determine which malloc to compile in
5871 case "$usemymalloc" in
5872 ''|[yY]*|true|$define) dflt='y' ;;
5875 rp="Do you wish to attempt to use the malloc that comes with $package?"
5881 mallocsrc='malloc.c'
5882 mallocobj="malloc$_o"
5883 d_mymalloc="$define"
5886 : Remove malloc from list of libraries to use
5887 echo "Removing unneeded -lmalloc from library list" >&4
5888 set `echo X $libs | $sed -e 's/-lmalloc / /' -e 's/-lmalloc$//'`
5891 echo "libs = $libs" >&4
5903 : compute the return types of malloc and free
5905 $cat >malloc.c <<END
5909 #include <sys/types.h>
5923 case "$malloctype" in
5925 if $cc $ccflags -c -DTRY_MALLOC malloc.c >/dev/null 2>&1; then
5932 echo "Your system wants malloc to return '$malloctype', it would seem." >&4
5936 if $cc $ccflags -c -DTRY_FREE malloc.c >/dev/null 2>&1; then
5943 echo "Your system uses $freetype free(), it would seem." >&4
5947 After $package is installed, you may wish to install various
5948 add-on modules and utilities. Typically, these add-ons will
5949 be installed under $prefix with the rest
5950 of this package. However, you may wish to install such add-ons
5951 elsewhere under a different prefix.
5953 If you do not wish to put everything under a single prefix, that's
5954 ok. You will be prompted for the individual locations; this siteprefix
5955 is only used to suggest the defaults.
5957 The default should be fine for most people.
5961 rp='Installation prefix to use for add-on modules and utilities?'
5962 : XXX Here might be another good place for an installstyle setting.
5963 case "$siteprefix" in
5965 *) dflt=$siteprefix ;;
5968 : XXX Prefixit unit does not yet support siteprefix and vendorprefix
5970 case "$siteprefix" in
5974 *) oldsiteprefix="$prefix";;
5979 siteprefixexp="$ansexp"
5981 : determine where site specific libraries go.
5982 : Usual default is /usr/local/lib/perl5/site_perl/$version
5983 : The default "style" setting is made in installstyle.U
5984 : XXX No longer works with Prefixit stuff.
5985 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
5987 '') case "$installstyle" in
5988 *lib/perl5*) dflt=$siteprefix/lib/$package/site_$prog/$version ;;
5989 *) dflt=$siteprefix/lib/site_$prog/$version ;;
5997 The installation process will create a directory for
5998 site-specific extensions and modules. Most users find it convenient
5999 to place all site-specific files in this directory rather than in the
6000 main distribution directory.
6004 rp='Pathname for the site-specific library files?'
6007 sitelibexp="$ansexp"
6008 sitelib_stem=`echo "$sitelibexp" | sed "s,/$version$,,"`
6009 : Change installation prefix, if necessary.
6010 if $test X"$prefix" != X"$installprefix"; then
6011 installsitelib=`echo $sitelibexp | $sed "s#^$prefix#$installprefix#"`
6013 installsitelib="$sitelibexp"
6016 : determine where site specific architecture-dependent libraries go.
6017 : sitelib default is /usr/local/lib/perl5/site_perl/$version
6018 : sitearch default is /usr/local/lib/perl5/site_perl/$version/$archname
6019 : sitelib may have an optional trailing /share.
6021 '') dflt=`echo $sitelib | $sed 's,/share$,,'`
6022 dflt="$dflt/$archname"
6027 set sitearch sitearch none
6031 The installation process will also create a directory for
6032 architecture-dependent site-specific extensions and modules.
6036 rp='Pathname for the site-specific architecture-dependent library files?'
6039 sitearchexp="$ansexp"
6040 : Change installation prefix, if necessary.
6041 if $test X"$prefix" != X"$installprefix"; then
6042 installsitearch=`echo $sitearchexp | sed "s#^$prefix#$installprefix#"`
6044 installsitearch="$sitearchexp"
6049 The installation process will also create a directory for
6050 vendor-supplied add-ons. Vendors who supply perl with their system
6051 may find it convenient to place all vendor-supplied files in this
6052 directory rather than in the main distribution directory. This will
6053 ease upgrades between binary-compatible maintenance versions of perl.
6055 Of course you may also use these directories in whatever way you see
6056 fit. For example, you might use them to access modules shared over a
6057 company-wide network.
6059 The default answer should be fine for most people.
6060 This causes further questions about vendor add-ons to be skipped
6061 and no vendor-specific directories will be configured for perl.
6064 rp='Do you want to configure vendor-specific add-on directories?'
6065 case "$usevendorprefix" in
6066 define|true|[yY]*) dflt=y ;;
6067 *) : User may have set vendorprefix directly on Configure command line.
6068 case "$vendorprefix" in
6077 rp='Installation prefix to use for vendor-supplied add-ons?'
6078 case "$vendorprefix" in
6080 *) dflt=$vendorprefix ;;
6083 : XXX Prefixit unit does not yet support siteprefix and vendorprefix
6085 case "$vendorprefix" in
6089 *) oldvendorprefix="$prefix";;
6093 usevendorprefix="$define"
6095 vendorprefixexp="$ansexp"
6097 *) usevendorprefix="$undef"
6103 case "$vendorprefix" in
6104 '') d_vendorlib="$undef"
6108 *) d_vendorlib="$define"
6109 : determine where vendor-supplied modules go.
6110 : Usual default is /usr/local/lib/perl5/vendor_perl/$version
6111 case "$vendorlib" in
6113 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
6114 case "$installstyle" in
6115 *lib/perl5*) dflt=$vendorprefix/lib/$package/vendor_$prog/$version ;;
6116 *) dflt=$vendorprefix/lib/vendor_$prog/$version ;;
6119 *) dflt="$vendorlib"
6123 rp='Pathname for the vendor-supplied library files?'
6126 vendorlibexp="$ansexp"
6129 vendorlib_stem=`echo "$vendorlibexp" | sed "s,/$version$,,"`
6130 : Change installation prefix, if necessary.
6131 if $test X"$prefix" != X"$installprefix"; then
6132 installvendorlib=`echo $vendorlibexp | $sed "s#^$prefix#$installprefix#"`
6134 installvendorlib="$vendorlibexp"
6137 case "$vendorprefix" in
6138 '') d_vendorarch="$undef"
6142 *) d_vendorarch="$define"
6143 : determine where vendor-supplied architecture-dependent libraries go.
6144 : vendorlib default is /usr/local/lib/perl5/vendor_perl/$version
6145 : vendorarch default is /usr/local/lib/perl5/vendor_perl/$version/$archname
6146 : vendorlib may have an optional trailing /share.
6147 case "$vendorarch" in
6148 '') dflt=`echo $vendorlib | $sed 's,/share$,,'`
6149 dflt="$dflt/$archname"
6151 *) dflt="$vendorarch" ;;
6154 rp='Pathname for vendor-supplied architecture-dependent files?'
6157 vendorarchexp="$ansexp"
6160 : Change installation prefix, if necessary.
6161 if $test X"$prefix" != X"$installprefix"; then
6162 installvendorarch=`echo $vendorarchexp | sed "s#^$prefix#$installprefix#"`
6164 installvendorarch="$vendorarchexp"
6167 : Final catch-all directories to search
6170 Lastly, you can have perl look in other directories for extensions and
6171 modules in addition to those already specified.
6172 These directories will be searched after
6176 test X"$vendorlib" != "X" && echo ' ' $vendorlib
6177 test X"$vendorarch" != "X" && echo ' ' $vendorarch
6179 case "$otherlibdirs" in
6180 ''|' ') dflt='none' ;;
6181 *) dflt="$otherlibdirs" ;;
6184 Enter a colon-separated set of extra paths to include in perl's @INC
6185 search path, or enter 'none' for no extra paths.
6189 rp='Colon-separated list of additional directories for perl to search?'
6192 ' '|''|none) otherlibdirs=' ' ;;
6193 *) otherlibdirs="$ans" ;;
6195 case "$otherlibdirs" in
6199 set d_perl_otherlibdirs
6202 : Cruising for prototypes
6204 echo "Checking out function prototypes..." >&4
6205 $cat >prototype.c <<'EOCP'
6206 int main(int argc, char *argv[]) {
6209 if $cc $ccflags -c prototype.c >prototype.out 2>&1 ; then
6210 echo "Your C compiler appears to support function prototypes."
6213 echo "Your C compiler doesn't seem to understand function prototypes."
6220 case "$prototype" in
6222 *) ansi2knr='ansi2knr'
6227 This version of $package can only be compiled by a compiler that
6228 understands function prototypes. Unfortunately, your C compiler
6230 doesn't seem to understand them. Sorry about that.
6232 If GNU cc is available for your system, perhaps you could try that instead.
6234 Eventually, we hope to support building Perl with pre-ANSI compilers.
6235 If you would like to help in that effort, please contact <perlbug@perl.org>.
6237 Aborting Configure now.
6243 : determine where public executables go
6248 rp='Pathname where the public executables will reside?'
6250 if $test "X$ansexp" != "X$binexp"; then
6255 : Change installation prefix, if necessary.
6256 : XXX Bug? -- ignores Configure -Dinstallprefix setting.
6257 if $test X"$prefix" != X"$installprefix"; then
6258 installbin=`echo $binexp | sed "s#^$prefix#$installprefix#"`
6260 installbin="$binexp"
6263 : Find perl5.005 or later.
6264 echo "Looking for a previously installed perl5.005 or later... "
6266 '') for tdir in `echo "$binexp:$PATH" | $sed "s/$path_sep/ /g"`; do
6267 : Check if this perl is recent and can load a simple module
6268 if $test -x $tdir/perl && $tdir/perl -Mless -e 'use 5.005;' >/dev/null 2>&1; then
6271 elif $test -x $tdir/perl5 && $tdir/perl5 -Mless -e 'use 5.005;' >/dev/null 2>&1; then
6281 '') echo "None found. That's ok.";;
6282 *) echo "Using $perl5." ;;
6285 : Determine list of previous versions to include in @INC
6286 $cat > getverlist <<EOPL
6289 \$api_versionstring = "$api_versionstring";
6290 \$version = "$version";
6291 \$stem = "$sitelib_stem";
6292 \$archname = "$archname";
6294 $cat >> getverlist <<'EOPL'
6295 # Can't have leading @ because metaconfig interprets it as a command!
6296 ;@inc_version_list=();
6297 # XXX Redo to do opendir/readdir?
6300 ;@candidates = glob("5.*");
6306 # XXX ToDo: These comparisons must be reworked when two-digit
6307 # subversions come along, so that 5.7.10 compares as greater than
6308 # 5.7.3! By that time, hope that 5.6.x is sufficiently
6309 # widespread that we can use the built-in version vectors rather
6310 # than reinventing them here. For 5.6.0, however, we must
6311 # assume this script will likely be run by 5.005_0x. --AD 1/2000.
6312 foreach $d (@candidates) {
6313 if ($d lt $version) {
6314 if ($d ge $api_versionstring) {
6315 unshift(@inc_version_list, grep { -d } "$d/$archname", $d);
6317 elsif ($d ge "5.005") {
6318 unshift(@inc_version_list, grep { -d } $d);
6322 # Skip newer version. I.e. don't look in
6323 # 5.7.0 if we're installing 5.6.1.
6327 if (@inc_version_list) {
6328 print join(' ', @inc_version_list);
6331 # Blank space to preserve value for next Configure run.
6336 case "$inc_version_list" in
6337 '') if test -x "$perl5"; then
6338 dflt=`$perl5 getverlist`
6343 $undef) dflt='none' ;;
6344 *) dflt="$inc_version_list" ;;
6347 ''|' ') dflt=none ;;
6350 5.005) case "$bincompat5005" in
6351 $define|true|[yY]*) ;;
6358 In order to ease the process of upgrading, this version of perl
6359 can be configured to use modules built and installed with earlier
6360 versions of perl that were installed under $prefix. Specify here
6361 the list of earlier versions that this version of perl should check.
6362 If Configure detected no earlier versions of perl installed under
6363 $prefix, then the list will be empty. Answer 'none' to tell perl
6364 to not search earlier versions.
6366 The default should almost always be sensible, so if you're not sure,
6367 just accept the default.
6370 rp='List of earlier versions to include in @INC?'
6373 [Nn]one|''|' ') inc_version_list=' ' ;;
6374 *) inc_version_list="$ans" ;;
6376 case "$inc_version_list" in
6378 inc_version_list_init='0';;
6379 *) inc_version_list_init=`echo $inc_version_list |
6380 $sed -e 's/^/"/' -e 's/ /","/g' -e 's/$/",0/'`
6385 : determine whether to install perl also as /usr/bin/perl
6388 if $test -d /usr/bin -a "X$installbin" != X/usr/bin; then
6390 Many scripts expect perl to be installed as /usr/bin/perl.
6391 I can install the perl you are about to compile also as /usr/bin/perl
6392 (in addition to $installbin/perl).
6394 case "$installusrbinperl" in
6395 "$undef"|[nN]*) dflt='n';;
6398 rp="Do you want to install perl as /usr/bin/perl?"
6401 [yY]*) val="$define";;
6407 set installusrbinperl
6410 : see if dld is available
6414 : see if dlopen exists
6421 : determine which dynamic loading, if any, to compile in
6423 dldir="ext/DynaLoader"
6436 $define) dflt='y' ;;
6439 $define) dflt='y' ;;
6441 : Does a dl_xxx.xs file exist for this operating system
6442 $test -f $rsrc/$dldir/dl_${osname}.xs && dflt='y'
6445 rp="Do you wish to use dynamic loading?"
6452 if $test -f $rsrc/$dldir/dl_${osname}.xs ; then
6453 dflt="$dldir/dl_${osname}.xs"
6454 elif $test "$d_dlopen" = "$define" ; then
6455 dflt="$dldir/dl_dlopen.xs"
6456 elif $test "$i_dld" = "$define" ; then
6457 dflt="$dldir/dl_dld.xs"
6462 *) dflt="$dldir/$dlsrc"
6465 echo "The following dynamic loading files are available:"
6466 : Can not go over to $dldir because getfile has path hard-coded in.
6467 tdir=`pwd`; cd $rsrc; $ls -C $dldir/dl*.xs; cd $tdir
6468 rp="Source file to use for dynamic loading"
6474 dlsrc=`echo $ans | $sed -e 's%.*/\([^/]*\)$%\1%'`
6478 Some systems may require passing special flags to $cc -c to
6479 compile modules that will be used to create a shared library.
6480 To use no flags, say "none".
6483 case "$cccdlflags" in
6484 '') case "$gccversion" in
6485 '') case "$osname" in
6487 next) dflt='none' ;;
6488 irix*) dflt='-KPIC' ;;
6489 svr4*|esix*|solaris) dflt='-KPIC' ;;
6490 sunos) dflt='-pic' ;;
6494 *) case "$osname" in
6495 svr4*|esix*|solaris) dflt='-fPIC' ;;
6500 *) dflt="$cccdlflags" ;;
6502 rp="Any special flags to pass to $cc -c to compile shared library modules?"
6505 none) cccdlflags=' ' ;;
6506 *) cccdlflags="$ans" ;;
6511 Some systems use ld to create libraries that can be dynamically loaded,
6512 while other systems (such as those using ELF) use $cc.
6516 '') $cat >try.c <<'EOM'
6517 /* Test for whether ELF binaries are produced */
6522 int i = open("a.out",O_RDONLY);
6525 if(read(i,b,4)==4 && b[0]==127 && b[1]=='E' && b[2]=='L' && b[3]=='F')
6526 exit(0); /* succeed (yes, it's ELF) */
6531 if $cc $ccflags try.c >/dev/null 2>&1 && ./a.out; then
6533 You appear to have ELF support. I'll use $cc to build dynamic libraries.
6537 echo "I'll use ld to build dynamic libraries."
6546 rp="What command should be used to create dynamic libraries?"
6552 Some systems may require passing special flags to $ld to create a
6553 library that can be dynamically loaded. If your ld flags include
6554 -L/other/path options to locate libraries outside your loader's normal
6555 search path, you may need to specify those -L options here as well. To
6556 use no flags, say "none".
6559 case "$lddlflags" in
6560 '') case "$osname" in
6561 beos) dflt='-nostart' ;;
6563 case "$gccversion" in
6564 '') dflt="$dflt +vnocompatwarnings" ;;
6567 linux|irix*) dflt='-shared' ;;
6568 next) dflt='none' ;;
6569 solaris) dflt='-G' ;;
6570 sunos) dflt='-assert nodefinitions' ;;
6571 svr4*|esix*) dflt="-G $ldflags" ;;
6575 *) dflt="$lddlflags" ;;
6578 : Try to guess additional flags to pick up local libraries.
6579 : Be careful not to append to a plain 'none'
6583 for thisflag in $ldflags; do
6588 *) dflt="$dflt $thisflag" ;;
6595 ''|' ') dflt='none' ;;
6598 rp="Any special flags to pass to $ld to create a dynamically loaded library?"
6601 none) lddlflags=' ' ;;
6602 *) lddlflags="$ans" ;;
6607 Some systems may require passing special flags to $cc to indicate that
6608 the resulting executable will use dynamic linking. To use no flags,
6612 case "$ccdlflags" in
6613 '') case "$osname" in
6614 hpux) dflt='-Wl,-E' ;;
6615 linux) dflt='-rdynamic' ;;
6616 next) dflt='none' ;;
6617 sunos) dflt='none' ;;
6621 *) dflt="$ccdlflags" ;;
6623 rp="Any special flags to pass to $cc to use dynamic linking?"
6626 none) ccdlflags=' ' ;;
6627 *) ccdlflags="$ans" ;;
6641 # No dynamic loading being used, so don't bother even to prompt.
6644 *) case "$useshrplib" in
6645 '') case "$osname" in
6646 svr4*|dgux|dynixptx|esix|powerux|beos|cygwin*)
6648 also='Building a shared libperl is required for dynamic loading to work on your system.'
6653 also='Building a shared libperl is needed for MAB support.'
6671 The perl executable is normally obtained by linking perlmain.c with
6672 libperl${_a}, any static extensions (usually just DynaLoader), and
6673 any other libraries needed on this system (such as -lm, etc.). Since
6674 your system supports dynamic loading, it is probably possible to build
6675 a shared libperl.$so. If you will have more than one executable linked
6676 to libperl.$so, this will significantly reduce the size of each
6677 executable, but it may have a noticeable affect on performance. The
6678 default is probably sensible for your system.
6682 rp="Build a shared libperl.$so (y/n)"
6686 useshrplib='true' ;;
6687 *) useshrplib='false' ;;
6692 case "$useshrplib" in
6696 # Figure out a good name for libperl.so. Since it gets stored in
6697 # a version-specific architecture-dependent library, the version
6698 # number isn't really that important, except for making cc/ld happy.
6700 # A name such as libperl.so.3.1
6701 majmin="libperl.$so.$patchlevel.$subversion"
6702 # A name such as libperl.so.301
6703 majonly=`echo $patchlevel $subversion |
6704 $awk '{printf "%d%02d", $1, $2}'`
6705 majonly=libperl.$so.$majonly
6706 # I'd prefer to keep the os-specific stuff here to a minimum, and
6707 # rely on figuring it out from the naming of libc.
6708 case "${osname}${osvers}" in
6711 # XXX How handle the --version stuff for MAB?
6713 linux*) # ld won't link with a bare -lperl otherwise.
6716 cygwin*) # include version
6717 dflt=`echo libperl$version | sed -e 's/\./_/g'`$lib_ext
6719 *) # Try to guess based on whether libc has major.minor.
6721 *libc.$so.[0-9]*.[0-9]*) dflt=$majmin ;;
6722 *libc.$so.[0-9]*) dflt=$majonly ;;
6723 *) dflt=libperl.$so ;;
6733 I need to select a good name for the shared libperl. If your system uses
6734 library names with major and minor numbers, then you might want something
6735 like $majmin. Alternatively, if your system uses a single version
6736 number for shared libraries, then you might want to use $majonly.
6737 Or, your system might be quite happy with a simple libperl.$so.
6739 Since the shared libperl will get installed into a version-specific
6740 architecture-dependent directory, the version number of the shared perl
6741 library probably isn't important, so the default should be o.k.
6744 rp='What name do you want to give to the shared libperl?'
6747 echo "Ok, I'll use $libperl"
6750 libperl="libperl${_a}"
6754 # Detect old use of shrpdir via undocumented Configure -Dshrpdir
6758 WARNING: Use of the shrpdir variable for the installation location of
6759 the shared $libperl is not supported. It was never documented and
6760 will not work in this version. Let me (perlbug@perl.org)
6761 know of any problems this may cause.
6767 But your current setting of $shrpdir is
6768 the default anyway, so it's harmless.
6773 Further, your current attempted setting of $shrpdir
6774 conflicts with the value of $archlibexp/CORE
6775 that installperl will use.
6782 # How will the perl executable find the installed shared $libperl?
6783 # Add $xxx to ccdlflags.
6784 # If we can't figure out a command-line option, use $shrpenv to
6785 # set env LD_RUN_PATH. The main perl makefile uses this.
6786 shrpdir=$archlibexp/CORE
6789 if "$useshrplib"; then
6792 # We'll set it in Makefile.SH...
6798 xxx="-Wl,-R$shrpdir"
6800 linux|irix*|dec_osf)
6801 xxx="-Wl,-rpath,$shrpdir"
6804 # next doesn't like the default...
6807 # beos doesn't like the default, either.
6810 # hpux doesn't like the default, either.
6811 tmp_shrpenv="env LDOPTS=\"+s +b${shrpdir}\""
6814 tmp_shrpenv="env LD_RUN_PATH=$shrpdir"
6820 # Only add $xxx if it isn't already in ccdlflags.
6821 case " $ccdlflags " in
6823 *) ccdlflags="$ccdlflags $xxx"
6826 Adding $xxx to the flags
6827 passed to $ld so that the perl executable will find the
6828 installed shared $libperl.
6836 # Fix ccdlflags in AIX for building external extensions.
6837 # (For building Perl itself bare -bE:perl.exp is needed,
6838 # Makefile.SH takes care of this.)
6840 aix) ccdlflags="$ccdlflags -bE:$installarchlib/CORE/perl.exp" ;;
6842 # Respect a hint or command-line value.
6844 '') shrpenv="$tmp_shrpenv" ;;
6846 case "$ldlibpthname" in
6847 '') ldlibpthname=LD_LIBRARY_PATH ;;
6848 none) ldlibpthname='' ;;
6851 : determine where manual pages go
6852 set man1dir man1dir none
6856 $spackage has manual pages available in source form.
6860 echo "However, you don't have nroff, so they're probably useless to you."
6862 '') man1dir="none";;
6865 echo "If you don't want the manual sources installed, answer 'none'."
6870 lookpath="$prefixexp/man/man1 $prefixexp/man/l_man/man1"
6871 lookpath="$lookpath $prefixexp/man/p_man/man1"
6872 lookpath="$lookpath $prefixexp/man/u_man/man1"
6873 lookpath="$lookpath $prefixexp/man/man.1"
6875 */?_man*) dflt=`./loc . $prefixexp/l_man/man1 $lookpath` ;;
6876 *) dflt=`./loc . $prefixexp/man/man1 $lookpath` ;;
6886 rp="Where do the main $spackage manual pages (source) go?"
6888 if $test "X$man1direxp" != "X$ansexp"; then
6892 man1direxp="$ansexp"
6898 : Change installation prefix, if necessary.
6899 if $test X"$prefix" != X"$installprefix"; then
6900 installman1dir=`echo $man1direxp | $sed "s#^$prefix#$installprefix#"`
6902 installman1dir="$man1direxp"
6905 : What suffix to use on installed man pages
6912 rp="What suffix should be used for the main $spackage man pages?"
6914 '') case "$man1dir" in
6928 *) dflt="$man1ext";;
6935 : see if we can have long filenames
6937 first=123456789abcdef
6939 if (echo hi >$first) 2>/dev/null; then
6940 if $test -f 123456789abcde; then
6941 echo 'You cannot have filenames longer than 14 characters. Sigh.' >&4
6944 echo 'You can have filenames longer than 14 characters.'>&4
6949 You can't have filenames longer than 14 chars.
6950 You can't even think about them!
6956 $rm -rf 123456789abcde*
6958 : determine where library module manual pages go
6959 set man3dir man3dir none
6963 $spackage has manual pages for many of the library modules.
6969 However, you don't have nroff, so they're probably useless to you.
6972 '') man3dir="none";;
6976 case "$d_flexfnam" in
6979 However, your system can't handle the long file names like File::Basename.3.
6982 '') man3dir="none";;
6986 echo "If you don't want the manual sources installed, answer 'none'."
6987 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
6989 '') dflt=`echo "$man1dir" | $sed -e 's/man1/man3/g' -e 's/man\.1/man\.3/g'`
6990 if $test -d "$privlib/man/man3"; then
6993 WARNING: Previous versions of perl installed man3 pages into
6994 $privlib/man/man3. This version will suggest a
6995 new default of $dflt.
6999 rp='Do you wish to preserve the old behavior?(y/n)'
7002 y*) dflt="$privlib/man/man3" ;;
7007 *) dflt="$man3dir" ;;
7014 rp="Where do the $package library man pages (source) go?"
7017 man3direxp="$ansexp"
7023 : Change installation prefix, if necessary.
7024 if $test X"$prefix" != X"$installprefix"; then
7025 installman3dir=`echo $man3direxp | $sed "s#^$prefix#$installprefix#"`
7027 installman3dir="$man3direxp"
7030 : What suffix to use on installed man pages
7036 rp="What suffix should be used for the $package library man pages?"
7038 '') case "$man3dir" in
7052 *) dflt="$man3ext";;
7059 : see if we have to deal with yellow pages, now NIS.
7060 if $test -d /usr/etc/yp || $test -d /etc/yp; then
7061 if $test -f /usr/etc/nibindd; then
7063 echo "I'm fairly confident you're on a NeXT."
7065 rp='Do you get the hosts file via NetInfo?'
7074 y*) hostcat='nidump hosts .';;
7075 *) case "$hostcat" in
7076 nidump*) hostcat='';;
7086 '') if $contains '^\+' /etc/passwd >/dev/null 2>&1; then
7094 rp='Are you getting the hosts file via yellow pages?'
7097 y*) hostcat='ypcat hosts';;
7098 *) hostcat='cat /etc/hosts';;
7104 '') test -f /etc/hosts && hostcat='cat /etc/hosts';;
7107 '') test -f /etc/group && groupcat='cat /etc/group';;
7110 '') test -f /etc/passwd && passcat='cat /etc/passwd';;
7113 : now get the host name
7115 echo "Figuring out host name..." >&4
7116 case "$myhostname" in
7118 echo 'Maybe "hostname" will work...'
7119 if tans=`sh -c hostname 2>&1` ; then
7127 if $test "$cont"; then
7129 echo 'Oh, dear. Maybe "/etc/systemid" is the key...'
7130 if tans=`cat /etc/systemid 2>&1` ; then
7132 phostname='cat /etc/systemid'
7133 echo "Whadyaknow. Xenix always was a bit strange..."
7136 elif $test -r /etc/systemid; then
7137 echo "(What is a non-Xenix system doing with /etc/systemid?)"
7140 if $test "$cont"; then
7141 echo 'No, maybe "uuname -l" will work...'
7142 if tans=`sh -c 'uuname -l' 2>&1` ; then
7144 phostname='uuname -l'
7146 echo 'Strange. Maybe "uname -n" will work...'
7147 if tans=`sh -c 'uname -n' 2>&1` ; then
7149 phostname='uname -n'
7151 echo 'Oh well, maybe I can mine it out of whoami.h...'
7152 if tans=`sh -c $contains' sysname $usrinc/whoami.h' 2>&1` ; then
7153 myhostname=`echo "$tans" | $sed 's/^.*"\(.*\)"/\1/'`
7154 phostname="sed -n -e '"'/sysname/s/^.*\"\\(.*\\)\"/\1/{'"' -e p -e q -e '}' <$usrinc/whoami.h"
7156 case "$myhostname" in
7157 '') echo "Does this machine have an identity crisis or something?"
7160 echo "Well, you said $myhostname before..."
7161 phostname='echo $myhostname';;
7167 : you do not want to know about this
7172 if $test "$myhostname" ; then
7174 rp='Your host name appears to be "'$myhostname'".'" Right?"
7182 : bad guess or no guess
7183 while $test "X$myhostname" = X ; do
7185 rp="Please type the (one word) name of your host:"
7190 : translate upper to lower if necessary
7191 case "$myhostname" in
7193 echo "(Normalizing case in your host name)"
7194 myhostname=`echo $myhostname | ./tr '[A-Z]' '[a-z]'`
7198 case "$myhostname" in
7200 dflt=`expr "X$myhostname" : "X[^.]*\(\..*\)"`
7201 myhostname=`expr "X$myhostname" : "X\([^.]*\)\."`
7202 echo "(Trimming domain name from host name--host name is now $myhostname)"
7204 *) case "$mydomain" in
7207 test "X$hostcat" = "Xypcat hosts" &&
7208 ypmatch "$myhostname" hosts 2>/dev/null |\
7209 $sed -e 's/[ ]*#.*//; s/$/ /' > hosts && \
7212 test "X$hostcat" != "X" &&
7213 $hostcat | $sed -n -e "s/[ ]*#.*//; s/\$/ /
7214 /[ ]$myhostname[ . ]/p" > hosts
7217 $test x`$awk "/[0-9].*[ ]$myhostname$tmp_re/ { sum++ }
7218 END { print sum }" hosts` = x1 || tmp_re="[ ]"
7219 dflt=.`$awk "/[0-9].*[ ]$myhostname$tmp_re/ {for(i=2; i<=NF;i++) print \\\$i}" \
7220 hosts | $sort | $uniq | \
7221 $sed -n -e "s/$myhostname\.\([-a-zA-Z0-9_.]\)/\1/p"`
7222 case `$echo X$dflt` in
7223 X*\ *) echo "(Several hosts in /etc/hosts matched hostname)"
7226 X.) echo "(You do not have fully-qualified names in /etc/hosts)"
7231 tans=`./loc resolv.conf X /etc /usr/etc`
7232 if $test -f "$tans"; then
7233 echo "(Attempting domain name extraction from $tans)"
7234 dflt=.`$sed -n -e 's/ / /g' \
7235 -e 's/^search *\([^ ]*\).*/\1/p' $tans \
7236 | ./tr '[A-Z]' '[a-z]' 2>/dev/null`
7238 .) dflt=.`$sed -n -e 's/ / /g' \
7239 -e 's/^domain *\([^ ]*\).*/\1/p' $tans \
7240 | ./tr '[A-Z]' '[a-z]' 2>/dev/null`
7247 .) echo "(No help from resolv.conf either -- attempting clever guess)"
7248 dflt=.`sh -c domainname 2>/dev/null`
7251 .nis.*|.yp.*|.main.*) dflt=`echo $dflt | $sed -e 's/^\.[^.]*//'`;;
7256 .) echo "(Lost all hope -- silly guess then)"
7262 *) dflt="$mydomain";;
7266 rp="What is your domain name?"
7276 : translate upper to lower if necessary
7279 echo "(Normalizing case in your domain name)"
7280 mydomain=`echo $mydomain | ./tr '[A-Z]' '[a-z]'`
7284 : a little sanity check here
7285 case "$phostname" in
7288 case `$phostname | ./tr '[A-Z]' '[a-z]'` in
7289 $myhostname$mydomain|$myhostname) ;;
7291 case "$phostname" in
7293 echo "(That doesn't agree with your whoami.h file, by the way.)"
7296 echo "(That doesn't agree with your $phostname command, by the way.)"
7306 I need to get your e-mail address in Internet format if possible, i.e.
7307 something like user@host.domain. Please answer accurately since I have
7308 no easy means to double check it. The default value provided below
7309 is most probably close to reality but may not be valid from outside
7310 your organization...
7314 while test "$cont"; do
7316 '') dflt="$cf_by@$myhostname$mydomain";;
7317 *) dflt="$cf_email";;
7319 rp='What is your e-mail address?'
7325 rp='Address does not look like an Internet one. Use it anyway?'
7341 If you or somebody else will be maintaining perl at your site, please
7342 fill in the correct e-mail address here so that they may be contacted
7343 if necessary. Currently, the "perlbug" program included with perl
7344 will send mail to this address in addition to perlbug@perl.org. You may
7345 enter "none" for no administrator.
7348 case "$perladmin" in
7349 '') dflt="$cf_email";;
7350 *) dflt="$perladmin";;
7352 rp='Perl administrator e-mail address'
7356 : figure out how to guarantee perl startup
7357 case "$startperl" in
7359 case "$sharpbang" in
7363 I can use the #! construct to start perl on your system. This will
7364 make startup of perl scripts faster, but may cause problems if you
7365 want to share those scripts and perl is not in a standard place
7366 ($binexp/perl) on all your platforms. The alternative is to force
7367 a shell by starting the script with a single ':' character.
7371 rp='What shall I put after the #! to start up perl ("none" to not use #!)?'
7374 none) startperl=": # use perl";;
7375 *) startperl="#!$ans"
7376 if $test 30 -lt `echo "$ans" | wc -c`; then
7379 WARNING: Some systems limit the #! command to 32 characters.
7380 If you experience difficulty running Perl scripts with #!, try
7381 installing Perl in a directory with a shorter pathname.
7387 *) startperl=": # use perl"
7392 echo "I'll use $startperl to start perl scripts."
7394 : figure best path for perl in scripts
7397 perlpath="$binexp/perl"
7398 case "$startperl" in
7403 I will use the "eval 'exec'" idiom to start Perl on your system.
7404 I can use the full path of your Perl binary for this purpose, but
7405 doing so may cause problems if you want to share those scripts and
7406 Perl is not always in a standard place ($binexp/perl).
7410 rp="What path shall I use in \"eval 'exec'\"?"
7417 case "$startperl" in
7419 *) echo "I'll use $perlpath in \"eval 'exec'\"" ;;
7422 : determine where public executable scripts go
7423 set scriptdir scriptdir
7425 case "$scriptdir" in
7428 : guess some guesses
7429 $test -d /usr/share/scripts && dflt=/usr/share/scripts
7430 $test -d /usr/share/bin && dflt=/usr/share/bin
7431 $test -d /usr/local/script && dflt=/usr/local/script
7432 $test -d /usr/local/scripts && dflt=/usr/local/scripts
7433 $test -d $prefixexp/script && dflt=$prefixexp/script
7437 *) dflt="$scriptdir"
7442 Some installations have a separate directory just for executable scripts so
7443 that they can mount it across multiple architectures but keep the scripts in
7444 one spot. You might, for example, have a subdirectory of /usr/share for this.
7445 Or you might just lump your scripts in with all your other executables.
7449 rp='Where do you keep publicly executable scripts?'
7451 if $test "X$ansexp" != "X$scriptdirexp"; then
7455 scriptdirexp="$ansexp"
7456 : Change installation prefix, if necessary.
7457 if $test X"$prefix" != X"$installprefix"; then
7458 installscript=`echo $scriptdirexp | sed "s#^$prefix#$installprefix#"`
7460 installscript="$scriptdirexp"
7463 : determine where add-on public executables go
7465 '') dflt=$siteprefix/bin ;;
7469 rp='Pathname where the add-on public executables should be installed?'
7472 sitebinexp="$ansexp"
7473 : Change installation prefix, if necessary.
7474 if $test X"$prefix" != X"$installprefix"; then
7475 installsitebin=`echo $sitebinexp | sed "s#^$prefix#$installprefix#"`
7477 installsitebin="$sitebinexp"
7480 case "$useperlio" in
7481 $define|true|[yY]*) dflt='y';;
7486 Previous version of $package used the standard IO mechanisms as defined
7487 in <stdio.h>. Versions 5.003_02 and later of perl allow alternate IO
7488 mechanisms via a "PerlIO" abstraction, but the stdio mechanism is still
7489 the default. This abstraction layer can use AT&T's sfio (if you already
7490 have sfio installed) or regular stdio. Using PerlIO with sfio may cause
7491 problems with some extension modules. Using PerlIO with stdio is safe,
7492 but it is slower than plain stdio and therefore is not the default.
7494 If this doesn't make any sense to you, just accept the default '$dflt'.
7496 rp='Use the experimental PerlIO abstraction layer?'
7503 echo "Ok, doing things the stdio way"
7510 case "$vendorprefix" in
7511 '') d_vendorbin="$undef"
7515 *) d_vendorbin="$define"
7516 : determine where vendor-supplied executables go.
7517 case "$vendorbin" in
7518 '') dflt=$vendorprefix/bin ;;
7519 *) dflt="$vendorbin" ;;
7522 rp='Pathname for the vendor-supplied executables directory?'
7525 vendorbinexp="$ansexp"
7528 : Change installation prefix, if necessary.
7529 if $test X"$prefix" != X"$installprefix"; then
7530 installvendorbin=`echo $vendorbinexp | $sed "s#^$prefix#$installprefix#"`
7532 installvendorbin="$vendorbinexp"
7535 : see if qgcvt exists
7539 : check for length of double
7541 case "$doublesize" in
7543 echo "Checking to see how big your double precision numbers are..." >&4
7544 $cat >try.c <<'EOCP'
7548 printf("%d\n", (int)sizeof(double));
7553 if eval $compile_ok; then
7555 echo "Your double is $doublesize bytes long."
7558 echo "(I can't seem to compile the test program. Guessing...)"
7559 rp="What is the size of a double precision number (in bytes)?"
7567 : check for long doubles
7569 echo "Checking to see if you have long double..." >&4
7570 echo 'int main() { long double x = 7.0; }' > try.c
7572 if eval $compile; then
7574 echo "You have long double."
7577 echo "You do not have long double."
7583 : check for length of long double
7584 case "${d_longdbl}${longdblsize}" in
7587 echo "Checking to see how big your long doubles are..." >&4
7588 $cat >try.c <<'EOCP'
7592 printf("%d\n", sizeof(long double));
7597 if eval $compile; then
7598 longdblsize=`./try$exe_ext`
7599 echo "Your long doubles are $longdblsize bytes long."
7603 echo "(I can't seem to compile the test program. Guessing...)" >&4
7604 rp="What is the size of a long double (in bytes)?"
7608 if $test "X$doublesize" = "X$longdblsize"; then
7609 echo "(That isn't any different from an ordinary double.)"
7617 if $test X"$d_longdbl" = X"$define"; then
7619 echo "Checking how to print long doubles..." >&4
7621 if $test X"$sPRIfldbl" = X -a X"$doublesize" = X"$longdblsize"; then
7622 $cat >try.c <<'EOCP'
7623 #include <sys/types.h>
7627 printf("%.3f\n", d);
7631 if eval $compile; then
7635 sPRIfldbl='"f"'; sPRIgldbl='"g"'; sPRIeldbl='"e"';
7636 sPRIFldbl='"F"'; sPRIGldbl='"G"'; sPRIEldbl='"E"';
7637 echo "We will use %f."
7643 if $test X"$sPRIfldbl" = X; then
7644 $cat >try.c <<'EOCP'
7645 #include <sys/types.h>
7648 long double d = 123.456;
7649 printf("%.3llf\n", d);
7653 if eval $compile; then
7657 sPRIfldbl='"llf"'; sPRIgldbl='"llg"'; sPRIeldbl='"lle"';
7658 sPRIFldbl='"llF"'; sPRIGldbl='"llG"'; sPRIEldbl='"llE"';
7659 echo "We will use %llf."
7665 if $test X"$sPRIfldbl" = X; then
7666 $cat >try.c <<'EOCP'
7667 #include <sys/types.h>
7670 long double d = 123.456;
7671 printf("%.3Lf\n", d);
7675 if eval $compile; then
7679 sPRIfldbl='"Lf"'; sPRIgldbl='"Lg"'; sPRIeldbl='"Le"';
7680 sPRIFldbl='"LF"'; sPRIGldbl='"LG"'; sPRIEldbl='"LE"';
7681 echo "We will use %Lf."
7687 if $test X"$sPRIfldbl" = X; then
7688 $cat >try.c <<'EOCP'
7689 #include <sys/types.h>
7692 long double d = 123.456;
7693 printf("%.3lf\n", d);
7697 if eval $compile; then
7701 sPRIfldbl='"lf"'; sPRIgldbl='"lg"'; sPRIeldbl='"le"';
7702 sPRIFldbl='"lF"'; sPRIGldbl='"lG"'; sPRIEldbl='"lE"';
7703 echo "We will use %lf."
7709 if $test X"$sPRIfldbl" = X; then
7710 echo "Cannot figure out how to print long doubles." >&4
7717 case "$sPRIfldbl" in
7718 '') d_PRIfldbl="$undef"; d_PRIgldbl="$undef"; d_PRIeldbl="$undef";
7719 d_PRIFldbl="$undef"; d_PRIGldbl="$undef"; d_PRIEldbl="$undef";
7721 *) d_PRIfldbl="$define"; d_PRIgldbl="$define"; d_PRIeldbl="$define";
7722 d_PRIFldbl="$define"; d_PRIGldbl="$define"; d_PRIEldbl="$define";
7726 : Check how to convert floats to strings.
7728 echo "Checking for an efficient way to convert floats to strings."
7730 case "$uselongdouble" in
7731 "$define") echo "#define USE_LONG_DOUBLE" >>try.c ;;
7733 case "$d_longdbl" in
7734 "$define") echo "#define HAS_LONG_DOUBLE" >>try.c ;;
7736 case "$d_PRIgldbl" in
7737 "$define") echo "#define HAS_PRIgldbl" >>try.c ;;
7741 #define Gconvert(x,n,t,b) gconvert((x),(n),(t),(b))
7742 char *myname = "gconvert";
7745 #define Gconvert(x,n,t,b) gcvt((x),(n),(b))
7746 char *myname = "gcvt";
7749 #define Gconvert(x,n,t,b) qgcvt((x),(n),(b))
7750 char *myname = "qgcvt";
7751 #define DOUBLETYPE long double
7754 #if defined(USE_LONG_DOUBLE) && defined(HAS_LONG_DOUBLE) && defined(HAS_PRIgldbl)
7755 #define Gconvert(x,n,t,b) sprintf((b),"%.*"$sPRIgldbl,(n),(x))
7757 #define Gconvert(x,n,t,b) sprintf((b),"%.*g",(n),(x))
7759 char *myname = "sprintf";
7763 #if defined(USE_LONG_DOUBLE) && defined(HAS_LONG_DOUBLE)
7764 #define DOUBLETYPE long double
7766 #define DOUBLETYPE double
7772 #define I_STDLIB $i_stdlib
7778 checkit(expect, got)
7782 if (strcmp(expect, got)) {
7783 printf("%s oddity: Expected %s, got %s\n",
7784 myname, expect, got);
7794 /* This must be 1st test on (which?) platform */
7795 /* Alan Burlison <AlanBurlsin@unn.unisys.com> */
7796 Gconvert((DOUBLETYPE)0.1, 8, 0, buf);
7797 checkit("0.1", buf);
7799 Gconvert((DOUBLETYPE)1.0, 8, 0, buf);
7802 Gconvert((DOUBLETYPE)1.1, 8, 0, buf);
7803 checkit("1.1", buf);
7805 Gconvert((DOUBLETYPE)1.01, 8, 0, buf);
7806 checkit("1.01", buf);
7808 Gconvert((DOUBLETYPE)1.001, 8, 0, buf);
7809 checkit("1.001", buf);
7811 Gconvert((DOUBLETYPE)1.0001, 8, 0, buf);
7812 checkit("1.0001", buf);
7814 Gconvert((DOUBLETYPE)1.00001, 8, 0, buf);
7815 checkit("1.00001", buf);
7817 Gconvert((DOUBLETYPE)1.000001, 8, 0, buf);
7818 checkit("1.000001", buf);
7820 Gconvert((DOUBLETYPE)0.0, 8, 0, buf);
7823 Gconvert((DOUBLETYPE)-1.0, 8, 0, buf);
7826 /* Some Linux gcvt's give 1.e+5 here. */
7827 Gconvert((DOUBLETYPE)100000.0, 8, 0, buf);
7828 checkit("100000", buf);
7830 /* Some Linux gcvt's give -1.e+5 here. */
7831 Gconvert((DOUBLETYPE)-100000.0, 8, 0, buf);
7832 checkit("-100000", buf);
7837 case "$d_Gconvert" in
7838 gconvert*) xxx_list='gconvert gcvt sprintf' ;;
7839 gcvt*) xxx_list='gcvt gconvert sprintf' ;;
7840 *) xxx_list='sprintf gconvert gcvt' ;;
7843 case "$d_longdbl$uselongdouble$d_PRIgldbl" in
7844 "$define$define$define")
7845 xxx_list="`echo $xxx_list|sed s/sprintf//`"
7846 xxx_list="sprintf $xxx_list"
7848 "$define") xxx_list="qgcvt $xxx_list" ;;
7853 for xxx_convert in $xxx_list; do
7854 echo "Trying $xxx_convert..."
7856 set try -DTRY_$xxx_convert
7857 if eval $compile; then
7858 echo "$xxx_convert() found." >&4
7860 echo "I'll use $xxx_convert to convert floats into a string." >&4
7863 echo "...But $xxx_convert didn't work as I expected."
7866 echo "$xxx_convert NOT found." >&4
7870 case "$xxx_convert" in
7871 gconvert) d_Gconvert='gconvert((x),(n),(t),(b))' ;;
7872 gcvt) d_Gconvert='gcvt((x),(n),(b))' ;;
7873 qgcvt) d_Gconvert='qgcvt((x),(n),(b))' ;;
7874 *) case "$uselongdouble$d_longdbl$d_PRIgldbl" in
7875 "$define$define$define")
7876 d_Gconvert="sprintf((b),\"%.*\"$sPRIgldbl,(n),(x))" ;;
7877 *) d_Gconvert='sprintf((b),"%.*g",(n),(x))' ;;
7882 : Initialize h_fcntl
7885 : Initialize h_sysfile
7888 : access call always available on UNIX
7892 : locate the flags for 'access()'
7896 $cat >access.c <<'EOCP'
7897 #include <sys/types.h>
7902 #include <sys/file.h>
7911 : check sys/file.h first, no particular reason here
7912 if $test `./findhdr sys/file.h` && \
7913 $cc $cppflags -DI_SYS_FILE -o access access.c >/dev/null 2>&1 ; then
7915 echo "<sys/file.h> defines the *_OK access constants." >&4
7916 elif $test `./findhdr fcntl.h` && \
7917 $cc $cppflags -DI_FCNTL -o access access.c >/dev/null 2>&1 ; then
7919 echo "<fcntl.h> defines the *_OK access constants." >&4
7920 elif $test `./findhdr unistd.h` && \
7921 $cc $cppflags -DI_UNISTD -o access access.c >/dev/null 2>&1 ; then
7922 echo "<unistd.h> defines the *_OK access constants." >&4
7924 echo "I can't find the four *_OK access constants--I'll use mine." >&4
7930 : see if accessx exists
7931 set accessx d_accessx
7934 : see if alarm exists
7938 : see if atolf exists
7942 : see if atoll exists
7946 : Look for GNU-cc style attribute checking
7948 echo "Checking whether your compiler can handle __attribute__ ..." >&4
7949 $cat >attrib.c <<'EOCP'
7951 void croak (char* pat,...) __attribute__((format(printf,1,2),noreturn));
7953 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
7954 if $contains 'warning' attrib.out >/dev/null 2>&1; then
7955 echo "Your C compiler doesn't fully support __attribute__."
7958 echo "Your C compiler supports __attribute__."
7962 echo "Your C compiler doesn't seem to understand __attribute__ at all."
7969 : see if bcmp exists
7973 : see if bcopy exists
7977 : see if this is a unistd.h system
7978 set unistd.h i_unistd
7981 : see if getpgrp exists
7982 set getpgrp d_getpgrp
7985 case "$d_getpgrp" in
7988 echo "Checking to see which flavor of getpgrp is in use..."
7991 #include <sys/types.h>
7993 # include <unistd.h>
7997 if (getuid() == 0) {
7998 printf("(I see you are running Configure as super-user...)\n");
8002 if (getpgrp(1) == 0)
8011 if $cc -DTRY_BSD_PGRP $ccflags $ldflags -o set set.c $libs >/dev/null 2>&1 && ./set; then
8012 echo "You have to use getpgrp(pid) instead of getpgrp()." >&4
8014 elif $cc $ccflags $ldflags -o set set.c $libs >/dev/null 2>&1 && ./set; then
8015 echo "You have to use getpgrp() instead of getpgrp(pid)." >&4
8018 echo "I can't seem to compile and run the test program."
8020 xxx="a USG one, i.e. you use getpgrp()."
8022 # SVR4 systems can appear rather BSD-ish.
8025 xxx="a BSD one, i.e. you use getpgrp(pid)."
8029 xxx="probably a USG one, i.e. you use getpgrp()."
8034 echo "Assuming your getpgrp is $xxx" >&4
8043 : see if setpgrp exists
8044 set setpgrp d_setpgrp
8047 case "$d_setpgrp" in
8050 echo "Checking to see which flavor of setpgrp is in use..."
8053 #include <sys/types.h>
8055 # include <unistd.h>
8059 if (getuid() == 0) {
8060 printf("(I see you are running Configure as super-user...)\n");
8064 if (-1 == setpgrp(1, 1))
8067 if (setpgrp() != -1)
8073 if $cc -DTRY_BSD_PGRP $ccflags $ldflags -o set set.c $libs >/dev/null 2>&1 && ./set; then
8074 echo 'You have to use setpgrp(pid,pgrp) instead of setpgrp().' >&4
8076 elif $cc $ccflags $ldflags -o set set.c $libs >/dev/null 2>&1 && ./set; then
8077 echo 'You have to use setpgrp() instead of setpgrp(pid,pgrp).' >&4
8080 echo "(I can't seem to compile and run the test program.)"
8082 xxx="a USG one, i.e. you use setpgrp()."
8084 # SVR4 systems can appear rather BSD-ish.
8087 xxx="a BSD one, i.e. you use setpgrp(pid,pgrp)."
8091 xxx="probably a USG one, i.e. you use setpgrp()."
8096 echo "Assuming your setpgrp is $xxx" >&4
8104 : see if bzero exists
8108 : see if signal is declared as pointer to function returning int or void
8110 xxx=`./findhdr signal.h`
8111 $test "$xxx" && $cppstdin $cppminus $cppflags < $xxx >$$.tmp 2>/dev/null
8112 if $contains 'int.*\*[ ]*signal' $$.tmp >/dev/null 2>&1 ; then
8113 echo "You have int (*signal())() instead of void." >&4
8115 elif $contains 'void.*\*[ ]*signal' $$.tmp >/dev/null 2>&1 ; then
8116 echo "You have void (*signal())()." >&4
8118 elif $contains 'extern[ ]*[(\*]*signal' $$.tmp >/dev/null 2>&1 ; then
8119 echo "You have int (*signal())() instead of void." >&4
8121 elif $contains 'void.*\*.*sig' $$.tmp >/dev/null 2>&1 ; then
8122 echo "You have void (*signal())()." >&4
8125 case "$d_voidsig" in
8127 echo "I can't determine whether signal handler returns void or int..." >&4
8129 rp="What type does your signal handler return?"
8136 echo "As you already told me, signal handler returns void." >&4
8139 *) echo "As you already told me, signal handler returns int." >&4
8146 case "$d_voidsig" in
8147 "$define") signal_t="void";;
8152 : check for ability to cast large floats to 32-bit ints.
8154 echo 'Checking whether your C compiler can cast large floats to int32.' >&4
8155 if $test "$intsize" -ge 4; then
8162 #include <sys/types.h>
8164 $signal_t blech(s) int s; { exit(3); }
8171 signal(SIGFPE, blech);
8173 /* Don't let compiler optimize the test away. Store the number
8174 in a writable string for gcc to pass to sscanf under HP/UX.
8176 sprintf(str, "2147483647");
8177 sscanf(str, "%lf", &f); /* f = (double) 0x7fffffff; */
8181 /* x86 processors will probably give 0x8000 0000, which is a
8182 sign change. We don't want that. We want to mimic SPARC
8183 behavior here, which is to preserve the sign and give
8186 if (i32 != ($xxx) f)
8192 if eval $compile_ok; then
8196 echo "(I can't seem to compile the test program--assuming it can't)"
8204 echo "Nope, it can't."
8211 : check for ability to cast negative floats to unsigned
8213 echo 'Checking whether your C compiler can cast negative float to unsigned.' >&4
8216 #include <sys/types.h>
8218 $signal_t blech(s) int s; { exit(7); }
8219 $signal_t blech_in_list(s) int s; { exit(4); }
8220 unsigned long dummy_long(p) unsigned long p; { return p; }
8221 unsigned int dummy_int(p) unsigned int p; { return p; }
8222 unsigned short dummy_short(p) unsigned short p; { return p; }
8226 unsigned long along;
8228 unsigned short ashort;
8232 /* Frustrate gcc-2.7.2's optimizer which failed this test with
8233 a direct f = -123. assignment. gcc-2.8.0 reportedly
8234 optimized the whole file away
8236 /* Store the number in a writable string for gcc to pass to
8239 sprintf(str, "-123");
8240 sscanf(str, "%lf", &f); /* f = -123.; */
8242 signal(SIGFPE, blech);
8243 along = (unsigned long)f;
8244 aint = (unsigned int)f;
8245 ashort = (unsigned short)f;
8246 if (along != (unsigned long)-123)
8248 if (aint != (unsigned int)-123)
8250 if (ashort != (unsigned short)-123)
8252 sprintf(str, "1073741824.");
8253 sscanf(str, "%lf", &f); /* f = (double)0x40000000; */
8256 along = (unsigned long)f;
8257 if (along != 0x80000000)
8261 along = (unsigned long)f;
8262 if (along != 0x7fffffff)
8266 along = (unsigned long)f;
8267 if (along != 0x80000001)
8271 signal(SIGFPE, blech_in_list);
8272 sprintf(str, "123.");
8273 sscanf(str, "%lf", &f); /* f = 123.; */
8274 along = dummy_long((unsigned long)f);
8275 aint = dummy_int((unsigned int)f);
8276 ashort = dummy_short((unsigned short)f);
8277 if (along != (unsigned long)123)
8279 if (aint != (unsigned int)123)
8281 if (ashort != (unsigned short)123)
8288 if eval $compile_ok; then
8292 echo "(I can't seem to compile the test program--assuming it can't)"
8295 case "$castflags" in
8300 echo "Nope, it can't."
8307 : see if vprintf exists
8309 if set vprintf val -f d_vprintf; eval $csym; $val; then
8310 echo 'vprintf() found.' >&4
8312 $cat >vprintf.c <<'EOF'
8313 #include <varargs.h>
8315 int main() { xxx("foo"); }
8324 exit((unsigned long)vsprintf(buf,"%s",args) > 10L);
8328 if eval $compile && ./vprintf; then
8329 echo "Your vsprintf() returns (int)." >&4
8332 echo "Your vsprintf() returns (char*)." >&4
8336 echo 'vprintf() NOT found.' >&4
8346 : see if chown exists
8350 : see if chroot exists
8354 : see if chsize exists
8358 : check for const keyword
8360 echo 'Checking to see if your C compiler knows about "const"...' >&4
8361 $cat >const.c <<'EOCP'
8362 typedef struct spug { int drokk; } spug;
8369 if $cc -c $ccflags const.c >/dev/null 2>&1 ; then
8371 echo "Yup, it does."
8374 echo "Nope, it doesn't."
8379 : see if crypt exists
8381 if set crypt val -f d_crypt; eval $csym; $val; then
8382 echo 'crypt() found.' >&4
8386 cryptlib=`./loc Slibcrypt$_a "" $xlibpth`
8387 if $test -z "$cryptlib"; then
8388 cryptlib=`./loc Mlibcrypt$_a "" $xlibpth`
8392 if $test -z "$cryptlib"; then
8393 cryptlib=`./loc Llibcrypt$_a "" $xlibpth`
8397 if $test -z "$cryptlib"; then
8398 cryptlib=`./loc libcrypt$_a "" $libpth`
8402 if $test -z "$cryptlib"; then
8403 echo 'crypt() NOT found.' >&4
8412 : get csh whereabouts
8414 'csh') val="$undef" ;;
8419 : Respect a hint or command line value for full_csh.
8421 '') full_csh=$csh ;;
8424 : see if cuserid exists
8425 set cuserid d_cuserid
8428 : see if this is a limits.h system
8429 set limits.h i_limits
8432 : see if this is a float.h system
8436 : See if number of significant digits in a double precision number is known
8438 $cat >dbl_dig.c <<EOM
8448 printf("Contains DBL_DIG");
8451 $cppstdin $cppflags $cppminus < dbl_dig.c >dbl_dig.E 2>/dev/null
8452 if $contains 'DBL_DIG' dbl_dig.E >/dev/null 2>&1; then
8453 echo "DBL_DIG found." >&4
8456 echo "DBL_DIG NOT found." >&4
8463 : see if difftime exists
8464 set difftime d_difftime
8467 : see if this is a dirent system
8469 if xinc=`./findhdr dirent.h`; $test "$xinc"; then
8471 echo "<dirent.h> found." >&4
8474 if xinc=`./findhdr sys/dir.h`; $test "$xinc"; then
8475 echo "<sys/dir.h> found." >&4
8478 xinc=`./findhdr sys/ndir.h`
8480 echo "<dirent.h> NOT found." >&4
8485 : Look for type of directory structure.
8487 $cppstdin $cppflags $cppminus < "$xinc" > try.c
8489 case "$direntrytype" in
8492 $define) guess1='struct dirent' ;;
8493 *) guess1='struct direct' ;;
8496 *) guess1="$direntrytype"
8501 'struct dirent') guess2='struct direct' ;;
8502 *) guess2='struct dirent' ;;
8505 if $contains "$guess1" try.c >/dev/null 2>&1; then
8506 direntrytype="$guess1"
8507 echo "Your directory entries are $direntrytype." >&4
8508 elif $contains "$guess2" try.c >/dev/null 2>&1; then
8509 direntrytype="$guess2"
8510 echo "Your directory entries seem to be $direntrytype." >&4
8512 echo "I don't recognize your system's directory entries." >&4
8513 rp="What type is used for directory entries on this system?"
8521 : see if the directory entry stores field length
8523 $cppstdin $cppflags $cppminus < "$xinc" > try.c
8524 if $contains 'd_namlen' try.c >/dev/null 2>&1; then
8525 echo "Good, your directory entry keeps length information in d_namlen." >&4
8528 echo "Your directory entry does not know about the d_namlen field." >&4
8535 : see if dlerror exists
8538 set dlerror d_dlerror
8542 : see if dlfcn is available
8550 On a few systems, the dynamically loaded modules that perl generates and uses
8551 will need a different extension than shared libs. The default will probably
8559 rp='What is the extension of dynamically loaded modules'
8568 : Check if dlsym need a leading underscore
8574 echo "Checking whether your dlsym() needs a leading underscore ..." >&4
8575 $cat >dyna.c <<'EOM'
8584 #include <dlfcn.h> /* the dynamic linker include file for Sunos/Solaris */
8586 #include <sys/types.h>
8600 int mode = RTLD_LAZY ;
8602 handle = dlopen("./dyna.$dlext", mode) ;
8603 if (handle == NULL) {
8608 symbol = dlsym(handle, "fred") ;
8609 if (symbol == NULL) {
8610 /* try putting a leading underscore */
8611 symbol = dlsym(handle, "_fred") ;
8612 if (symbol == NULL) {
8625 : Call the object file tmp-dyna.o in case dlext=o.
8626 if $cc $ccflags $cccdlflags -c dyna.c > /dev/null 2>&1 &&
8627 mv dyna${_o} tmp-dyna${_o} > /dev/null 2>&1 &&
8628 $ld $lddlflags -o dyna.$dlext tmp-dyna${_o} > /dev/null 2>&1 &&
8629 $cc $ccflags -o fred $ldflags $cccdlflags $ccdlflags fred.c $libs > /dev/null 2>&1; then
8632 1) echo "Test program failed using dlopen." >&4
8633 echo "Perhaps you should not use dynamic loading." >&4;;
8634 2) echo "Test program failed using dlsym." >&4
8635 echo "Perhaps you should not use dynamic loading." >&4;;
8636 3) echo "dlsym needs a leading underscore" >&4
8638 4) echo "dlsym doesn't need a leading underscore." >&4;;
8641 echo "I can't compile and run the test program." >&4
8642 echo "I'm guessing that dlsym doesn't need a leading underscore." >&4
8647 $rm -f fred fred.? dyna.$dlext dyna.? tmp-dyna.?
8652 hasproto='varname=$1; func=$2; shift; shift;
8653 while $test $# -ge 2; do
8655 $define) echo "#include <$2>";;
8659 $cppstdin $cppflags $cppminus < try.c > tryout.c 2>/dev/null;
8660 if $contains "$func.*(" tryout.c >/dev/null 2>&1; then
8661 echo "$func() prototype found.";
8664 echo "$func() prototype NOT found.";
8669 $rm -f try.c tryout.c'
8671 : see if prototype for drand48 is available
8673 set d_drand48proto drand48 $i_stdlib stdlib.h $i_unistd unistd.h
8676 : see if dup2 exists
8680 : see if eaccess exists
8681 set eaccess d_eaccess
8684 : see if endgrent exists
8685 set endgrent d_endgrent
8688 : see if endhostent exists
8689 set endhostent d_endhent
8692 : see if endnetent exists
8693 set endnetent d_endnent
8696 : see if endprotoent exists
8697 set endprotoent d_endpent
8700 : see if endpwent exists
8701 set endpwent d_endpwent
8704 : see if endservent exists
8705 set endservent d_endsent
8708 : Locate the flags for 'open()'
8710 $cat >open3.c <<'EOCP'
8711 #include <sys/types.h>
8716 #include <sys/file.h>
8727 : check sys/file.h first to get FREAD on Sun
8728 if $test `./findhdr sys/file.h` && \
8729 set open3 -DI_SYS_FILE && eval $compile; then
8731 echo "<sys/file.h> defines the O_* constants..." >&4
8733 echo "and you have the 3 argument form of open()." >&4
8736 echo "but not the 3 argument form of open(). Oh, well." >&4
8739 elif $test `./findhdr fcntl.h` && \
8740 set open3 -DI_FCNTL && eval $compile; then
8742 echo "<fcntl.h> defines the O_* constants..." >&4
8744 echo "and you have the 3 argument form of open()." >&4
8747 echo "but not the 3 argument form of open(). Oh, well." >&4
8752 echo "I can't find the O_* constant definitions! You got problems." >&4
8758 : see which of string.h or strings.h is needed
8760 strings=`./findhdr string.h`
8761 if $test "$strings" && $test -r "$strings"; then
8762 echo "Using <string.h> instead of <strings.h>." >&4
8766 strings=`./findhdr strings.h`
8767 if $test "$strings" && $test -r "$strings"; then
8768 echo "Using <strings.h> instead of <string.h>." >&4
8770 echo "No string header found -- You'll surely have problems." >&4
8776 "$undef") strings=`./findhdr strings.h`;;
8777 *) strings=`./findhdr string.h`;;
8780 : check for non-blocking I/O stuff
8781 case "$h_sysfile" in
8782 true) echo "#include <sys/file.h>" > head.c;;
8785 true) echo "#include <fcntl.h>" > head.c;;
8786 *) echo "#include <sys/fcntl.h>" > head.c;;
8791 echo "Figuring out the flag used by open() for non-blocking I/O..." >&4
8792 case "$o_nonblock" in
8795 $cat >>try.c <<'EOCP'
8799 printf("O_NONBLOCK\n");
8803 printf("O_NDELAY\n");
8807 printf("FNDELAY\n");
8814 if eval $compile_ok; then
8816 case "$o_nonblock" in
8817 '') echo "I can't figure it out, assuming O_NONBLOCK will do.";;
8818 *) echo "Seems like we can use $o_nonblock.";;
8821 echo "(I can't compile the test program; pray O_NONBLOCK is right!)"
8824 *) echo "Using $hint value $o_nonblock.";;
8826 $rm -f try try.* .out core
8829 echo "Let's see what value errno gets from read() on a $o_nonblock file..." >&4
8835 #include <sys/types.h>
8838 #define MY_O_NONBLOCK $o_nonblock
8839 #ifndef errno /* XXX need better Configure test */
8850 #include <strings.h>
8852 $signal_t blech(x) int x; { exit(3); }
8854 $cat >> try.c <<'EOCP'
8862 pipe(pd); /* Down: child -> parent */
8863 pipe(pu); /* Up: parent -> child */
8866 close(pd[1]); /* Parent reads from pd[0] */
8867 close(pu[0]); /* Parent writes (blocking) to pu[1] */
8868 if (-1 == fcntl(pd[0], F_SETFL, MY_O_NONBLOCK))
8870 signal(SIGALRM, blech);
8872 if ((ret = read(pd[0], buf, 1)) > 0) /* Nothing to read! */
8874 sprintf(string, "%d\n", ret);
8875 write(2, string, strlen(string));
8878 if (errno == EAGAIN) {
8884 if (errno == EWOULDBLOCK)
8885 printf("EWOULDBLOCK\n");
8888 write(pu[1], buf, 1); /* Unblocks child, tell it to close our pipe */
8889 sleep(2); /* Give it time to close our pipe */
8891 ret = read(pd[0], buf, 1); /* Should read EOF */
8893 sprintf(string, "%d\n", ret);
8894 write(3, string, strlen(string));
8898 close(pd[0]); /* We write to pd[1] */
8899 close(pu[1]); /* We read from pu[0] */
8900 read(pu[0], buf, 1); /* Wait for parent to signal us we may continue */
8901 close(pd[1]); /* Pipe pd is now fully closed! */
8902 exit(0); /* Bye bye, thank you for playing! */
8906 if eval $compile_ok; then
8907 echo "$startsh" >mtry
8908 echo "./try >try.out 2>try.ret 3>try.err || exit 4" >>mtry
8910 ./mtry >/dev/null 2>&1
8912 0) eagain=`$cat try.out`;;
8913 1) echo "Could not perform non-blocking setting!";;
8914 2) echo "I did a successful read() for something that was not there!";;
8915 3) echo "Hmm... non-blocking I/O does not seem to be working!";;
8916 *) echo "Something terribly wrong happened during testing.";;
8918 rd_nodata=`$cat try.ret`
8919 echo "A read() system call with no data present returns $rd_nodata."
8920 case "$rd_nodata" in
8923 echo "(That's peculiar, fixing that to be -1.)"
8929 echo "Forcing errno EAGAIN on read() with no data available."
8933 echo "Your read() sets errno to $eagain when no data is available."
8936 status=`$cat try.err`
8938 0) echo "And it correctly returns 0 to signal EOF.";;
8939 -1) echo "But it also returns -1 to signal EOF, so be careful!";;
8940 *) echo "However, your read() returns '$status' on EOF??";;
8943 if test "$status" = "$rd_nodata"; then
8944 echo "WARNING: you can't distinguish between EOF and no data!"
8948 echo "I can't compile the test program--assuming errno EAGAIN will do."
8955 echo "Using $hint value $eagain."
8956 echo "Your read() returns $rd_nodata when no data is present."
8957 case "$d_eofnblk" in
8958 "$define") echo "And you can see EOF because read() returns 0.";;
8959 "$undef") echo "But you can't see EOF status from read() returned value.";;
8961 echo "(Assuming you can't see EOF status from read anyway.)"
8967 $rm -f try try.* .out core head.c mtry
8969 : see if fchmod exists
8973 : see if fchown exists
8977 : see if this is an fcntl system
8981 hasfield='varname=$1; struct=$2; field=$3; shift; shift; shift;
8982 while $test $# -ge 2; do
8984 $define) echo "#include <$2>";;
8988 echo "int main () { struct $struct foo; char* bar; bar = (char*)foo.$field; }" >> try.c;
8990 if eval $compile; then
9001 : see whether socket exists
9003 $echo $n "Hmm... $c" >&4
9004 if set socket val -f d_socket; eval $csym; $val; then
9005 echo "Looks like you have Berkeley networking support." >&4
9007 if set setsockopt val -f; eval $csym; $val; then
9010 echo "...but it uses the old BSD 4.1c interface, rather than 4.2." >&4
9014 if $contains socklib libc.list >/dev/null 2>&1; then
9015 echo "Looks like you have Berkeley networking support." >&4
9017 : we will have to assume that it supports the 4.2 BSD interface
9020 echo "You don't have Berkeley networking in libc$_a..." >&4
9021 if test "X$d_socket" = "X$define"; then
9022 echo "...but you seem to believe that you have sockets." >&4
9024 for net in net socket
9026 if test -f /usr/lib/lib$net$_a; then
9027 ( ($nm $nm_opt /usr/lib/lib$net$_a | eval $nm_extract) || \
9028 $ar t /usr/lib/lib$net$_a) 2>/dev/null >> libc.list
9029 if $contains socket libc.list >/dev/null 2>&1; then
9034 echo "...but the Wollongong group seems to have hacked it in." >&4
9035 sockethdr="-I/usr/netinclude"
9038 echo "Found Berkeley sockets interface in lib$net." >& 4
9039 if $contains setsockopt libc.list >/dev/null 2>&1; then
9042 echo "...using the old BSD 4.1c interface, rather than 4.2." >&4
9049 if test "X$d_socket" != "X$define"; then
9050 echo "or anywhere else I see." >&4
9058 : see if socketpair exists
9059 set socketpair d_sockpair
9064 echo "Checking the availability of certain socket constants..." >& 4
9065 for ENUM in MSG_CTRUNC MSG_DONTROUTE MSG_OOB MSG_PEEK MSG_PROXY SCM_RIGHTS; do
9066 enum=`$echo $ENUM|./tr '[A-Z]' '[a-z]'`
9068 #include <sys/types.h>
9069 #include <sys/socket.h>
9075 set try; if eval $compile; then
9078 set d_${enum}; eval $setvar
9082 : see if sys/select.h has to be included
9083 set sys/select.h i_sysselct
9086 : see if we should include time.h, sys/time.h, or both
9088 if test "X$timeincl" = X; then
9089 echo "Testing to see if we should include <time.h>, <sys/time.h> or both." >&4
9090 $echo $n "I'm now running the test program...$c"
9091 $cat >try.c <<'EOCP'
9092 #include <sys/types.h>
9097 #ifdef SYSTIMEKERNEL
9100 #include <sys/time.h>
9103 #include <sys/select.h>
9112 struct timezone tzp;
9114 if (foo.tm_sec == foo.tm_sec)
9117 if (bar.tv_sec == bar.tv_sec)
9124 for s_timezone in '-DS_TIMEZONE' ''; do
9126 for s_timeval in '-DS_TIMEVAL' ''; do
9127 for i_systimek in '' '-DSYSTIMEKERNEL'; do
9128 for i_time in '' '-DI_TIME'; do
9129 for i_systime in '-DI_SYSTIME' ''; do
9132 set try $i_time $i_systime $i_systimek $sysselect $s_timeval $s_timezone
9133 if eval $compile; then
9134 set X $i_time $i_systime $i_systimek $sysselect $s_timeval
9138 $echo $n "Succeeded with $flags$c"
9150 *SYSTIMEKERNEL*) i_systimek="$define"
9151 timeincl=`./findhdr sys/time.h`
9152 echo "We'll include <sys/time.h> with KERNEL defined." >&4;;
9153 *) i_systimek="$undef";;
9156 *I_TIME*) i_time="$define"
9157 timeincl=`./findhdr time.h`" $timeincl"
9158 echo "We'll include <time.h>." >&4;;
9159 *) i_time="$undef";;
9162 *I_SYSTIME*) i_systime="$define"
9163 timeincl=`./findhdr sys/time.h`" $timeincl"
9164 echo "We'll include <sys/time.h>." >&4;;
9165 *) i_systime="$undef";;
9170 : check for fd_set items
9173 Checking to see how well your C compiler handles fd_set and friends ...
9175 $cat >fd_set.c <<EOCP
9176 #$i_systime I_SYS_TIME
9177 #$i_sysselct I_SYS_SELECT
9178 #$d_socket HAS_SOCKET
9179 #include <sys/types.h>
9181 #include <sys/socket.h> /* Might include <sys/bsdtypes.h> */
9184 #include <sys/time.h>
9187 #include <sys/select.h>
9196 #if defined(FD_SET) && defined(FD_CLR) && defined(FD_ISSET) && defined(FD_ZERO)
9203 set fd_set -DTRYBITS
9204 if eval $compile; then
9205 d_fds_bits="$define"
9207 echo "Well, your system knows about the normal fd_set typedef..." >&4
9209 echo "and you have the normal fd_set macros (just as I'd expect)." >&4
9210 d_fd_macros="$define"
9213 but not the normal fd_set macros! Gaaack! I'll have to cover for you.
9215 d_fd_macros="$undef"
9219 Hmm, your compiler has some difficulty with fd_set. Checking further...
9222 if eval $compile; then
9225 echo "Well, your system has some sort of fd_set available..." >&4
9227 echo "and you have the normal fd_set macros." >&4
9228 d_fd_macros="$define"
9231 but not the normal fd_set macros! Gross! More work for me...
9233 d_fd_macros="$undef"
9236 echo "Well, you got zip. That's OK, I can roll my own fd_set stuff." >&4
9239 d_fd_macros="$undef"
9244 : see if fgetpos exists
9245 set fgetpos d_fgetpos
9248 : see if flock exists
9252 : see if fork exists
9256 : see if pathconf exists
9257 set pathconf d_pathconf
9260 : see if fpathconf exists
9261 set fpathconf d_fpathconf
9265 : check for fpos64_t
9267 echo "Checking to see if you have fpos64_t..." >&4
9270 int main() { fpos64_t x = 7; }
9273 if eval $compile; then
9275 echo "You have fpos64_t."
9278 echo "You do not have fpos64_t."
9280 8) echo "(Your fpos_t is 64 bits, so you could use that.)" ;;
9287 : see if frexpl exists
9291 hasstruct='varname=$1; struct=$2; shift; shift;
9292 while $test $# -ge 2; do
9294 $define) echo "#include <$2>";;
9298 echo "int main () { struct $struct foo; }" >> try.c;
9300 if eval $compile; then
9309 : see if this is a sys/param system
9310 set sys/param.h i_sysparam
9313 : see if this is a sys/mount.h system
9314 set sys/mount.h i_sysmount
9317 : see if sys/types.h has to be included
9318 set sys/types.h i_systypes
9323 echo "Checking to see if your system supports struct fs_data..." >&4
9324 set d_fs_data_s fs_data $i_systypes sys/types.h $i_sysparam sys/param.h $i_sysmount sys/mount.h
9326 case "$d_fs_data_s" in
9327 "$define") echo "Yes, it does." ;;
9328 *) echo "No, it doesn't." ;;
9331 : see if fseeko exists
9335 8) echo "(Your long is 64 bits, so you could use fseek.)" ;;
9338 : see if fsetpos exists
9339 set fsetpos d_fsetpos
9343 : see if fstatfs exists
9344 set fstatfs d_fstatfs
9348 : see if statvfs exists
9349 set statvfs d_statvfs
9352 : see if fstatvfs exists
9353 set fstatvfs d_fstatvfs
9357 : see if ftello exists
9361 8) echo "(Your long is 64 bits, so you could use ftell.)" ;;
9364 : see if getcwd exists
9368 : see if getespwnam exists
9369 set getespwnam d_getespwnam
9373 : see if getfsstat exists
9374 set getfsstat d_getfsstat
9377 : see if getgrent exists
9378 set getgrent d_getgrent
9381 : see if gethostbyaddr exists
9382 set gethostbyaddr d_gethbyaddr
9385 : see if gethostbyname exists
9386 set gethostbyname d_gethbyname
9389 : see if gethostent exists
9390 set gethostent d_gethent
9393 : see how we will look up host name
9396 if set gethostname val -f d_gethname; eval $csym; $val; then
9397 echo 'gethostname() found.' >&4
9398 d_gethname="$define"
9401 if set uname val -f d_uname; eval $csym; $val; then
9404 uname() was found, but you're running xenix, and older versions of xenix
9405 have a broken uname(). If you don't really know whether your xenix is old
9406 enough to have a broken system call, use the default answer.
9413 rp='Is your uname() broken?'
9416 n*) d_uname="$define"; call=uname;;
9419 echo 'uname() found.' >&4
9426 case "$d_gethname" in
9427 '') d_gethname="$undef";;
9430 '') d_uname="$undef";;
9432 case "$d_uname$d_gethname" in
9437 Every now and then someone has a $call() that lies about the hostname
9438 but can't be fixed for political or economic reasons. If you wish, I can
9439 pretend $call() isn't there and maybe compute hostname at run-time
9440 thanks to the '$phostname' command.
9443 rp="Shall I ignore $call() from now on?"
9446 y*) d_uname="$undef" d_gethname="$undef"; $echo $n "Okay...$c";;
9449 case "$phostname" in
9451 *) case "$aphostname" in
9457 file=`./loc $file $file $pth`
9458 aphostname=`echo $file $*`
9463 case "$d_uname$d_gethname" in
9466 case "$phostname" in
9468 echo "There will be no way for $package to get your hostname." >&4;;
9470 echo "I'll use 'popen("'"'$aphostname'", "r")'"' to get your hostname." >&4
9474 case "$d_phostname" in
9475 '') d_phostname="$undef";;
9478 : see if this is a netdb.h system
9482 : see if prototypes for various gethostxxx netdb.h functions are available
9484 set d_gethostprotos gethostent $i_netdb netdb.h
9487 : see if getlogin exists
9488 set getlogin d_getlogin
9491 : see if getmnt exists
9495 : see if getmntent exists
9496 set getmntent d_getmntent
9499 : see if getnetbyaddr exists
9500 set getnetbyaddr d_getnbyaddr
9503 : see if getnetbyname exists
9504 set getnetbyname d_getnbyname
9507 : see if getnetent exists
9508 set getnetent d_getnent
9511 : see if prototypes for various getnetxxx netdb.h functions are available
9513 set d_getnetprotos getnetent $i_netdb netdb.h
9517 : see if getprotobyname exists
9518 set getprotobyname d_getpbyname
9521 : see if getprotobynumber exists
9522 set getprotobynumber d_getpbynumber
9525 : see if getprotoent exists
9526 set getprotoent d_getpent
9529 : see if getpgid exists
9530 set getpgid d_getpgid
9533 : see if getpgrp2 exists
9534 set getpgrp2 d_getpgrp2
9537 : see if getppid exists
9538 set getppid d_getppid
9541 : see if getpriority exists
9542 set getpriority d_getprior
9545 : see if prototypes for various getprotoxxx netdb.h functions are available
9547 set d_getprotoprotos getprotoent $i_netdb netdb.h
9550 : see if getprpwnam exists
9551 set getprpwnam d_getprpwnam
9554 : see if getpwent exists
9555 set getpwent d_getpwent
9559 : see if getservbyname exists
9560 set getservbyname d_getsbyname
9563 : see if getservbyport exists
9564 set getservbyport d_getsbyport
9567 : see if getservent exists
9568 set getservent d_getsent
9571 : see if prototypes for various getservxxx netdb.h functions are available
9573 set d_getservprotos getservent $i_netdb netdb.h
9576 : see if getspnam exists
9577 set getspnam d_getspnam
9580 : see if gettimeofday or ftime exists
9581 set gettimeofday d_gettimeod
9583 case "$d_gettimeod" in
9589 val="$undef"; set d_ftime; eval $setvar
9592 case "$d_gettimeod$d_ftime" in
9595 echo 'No ftime() nor gettimeofday() -- timing may be less accurate.' >&4
9599 : see if this is an grp system
9605 xxx=`./findhdr grp.h`
9606 $cppstdin $cppflags $cppminus < $xxx >$$.h
9608 if $contains 'gr_passwd' $$.h >/dev/null 2>&1; then
9620 set d_grpasswd; eval $setvar
9624 : see if hasmntopt exists
9625 set hasmntopt d_hasmntopt
9628 : see if this is a netinet/in.h or sys/in.h system
9629 set netinet/in.h i_niin sys/in.h i_sysin
9632 : see if arpa/inet.h has to be included
9633 set arpa/inet.h i_arpainet
9636 : see if htonl --and friends-- exists
9641 : Maybe they are macros.
9646 #include <sys/types.h>
9647 #$i_niin I_NETINET_IN
9649 #$i_arpainet I_ARPA_INET
9651 #include <netinet/in.h>
9657 #include <arpa/inet.h>
9660 printf("Defined as a macro.");
9663 $cppstdin $cppflags $cppminus < htonl.c >htonl.E 2>/dev/null
9664 if $contains 'Defined as a macro' htonl.E >/dev/null 2>&1; then
9666 echo "But it seems to be defined as a macro." >&4
9674 : see if iconv exists
9680 if set index val -f; eval $csym; $val; then
9681 if set strchr val -f d_strchr; eval $csym; $val; then
9682 if $contains strchr "$strings" >/dev/null 2>&1 ; then
9685 echo "strchr() found." >&4
9689 echo "index() found." >&4
9694 echo "index() found." >&4
9697 if set strchr val -f d_strchr; eval $csym; $val; then
9700 echo "strchr() found." >&4
9702 echo "No index() or strchr() found!" >&4
9707 set d_strchr; eval $setvar
9709 set d_index; eval $setvar
9711 : check whether inet_aton exists
9712 set inet_aton d_inetaton
9715 : see if inttypes.h is available
9716 : we want a real compile instead of Inhdr because some systems
9717 : have an inttypes.h which includes non-existent headers
9720 #include <inttypes.h>
9722 static int32_t foo32 = 0x12345678;
9726 if eval $compile; then
9727 echo "<inttypes.h> found." >&4
9730 echo "<inttypes.h> NOT found." >&4
9739 echo "Checking to see if you have int64_t..." >&4
9741 #include <sys/types.h>
9742 #$i_inttypes I_INTTYPES
9744 #include <inttypes.h>
9746 int main() { int64_t x = 7; }
9749 if eval $compile; then
9751 echo "You have int64_t."
9754 echo "You do not have int64_t."
9762 $cat >isascii.c <<'EOCP'
9774 if eval $compile; then
9775 echo "isascii() found." >&4
9778 echo "isascii() NOT found." >&4
9785 : see if isnan exists
9789 : see if isnanl exists
9793 : see if killpg exists
9797 : see if lchown exists
9799 $cat > try.c <<'EOCP'
9800 /* System header to define __stub macros and hopefully few prototypes,
9801 which can conflict with char lchown(); below. */
9803 /* Override any gcc2 internal prototype to avoid an error. */
9804 /* We use char because int might match the return type of a gcc2
9805 builtin and then its argument prototype would still apply. */
9808 /* The GNU C library defines this for functions which it implements
9809 to always fail with ENOSYS. Some functions are actually named
9810 something starting with __ and the normal name is an alias. */
9811 #if defined (__stub_lchown) || defined (__stub___lchown)
9819 if eval $compile; then
9820 $echo "lchown() found." >&4
9823 $echo "lchown() NOT found." >&4
9829 : See if number of significant digits in a double precision number is known
9831 $cat >ldbl_dig.c <<EOM
9841 printf("Contains LDBL_DIG");
9844 $cppstdin $cppflags $cppminus < ldbl_dig.c >ldbl_dig.E 2>/dev/null
9845 if $contains 'LDBL_DIG' ldbl_dig.E >/dev/null 2>&1; then
9846 echo "LDBL_DIG found." >&4
9849 echo "LDBL_DIG NOT found." >&4
9856 : see if link exists
9860 : see if localeconv exists
9861 set localeconv d_locconv
9864 : see if lockf exists
9868 : check for long long
9870 echo "Checking to see if you have long long..." >&4
9871 echo 'int main() { long long x = 7; return 0; }' > try.c
9873 if eval $compile; then
9875 echo "You have long long."
9878 echo "You do not have long long."
9884 : check for length of long long
9885 case "${d_longlong}${longlongsize}" in
9888 echo "Checking to see how big your long longs are..." >&4
9889 $cat >try.c <<'EOCP'
9893 printf("%d\n", (int)sizeof(long long));
9898 if eval $compile_ok; then
9899 longlongsize=`./try$exe_ext`
9900 echo "Your long longs are $longlongsize bytes long."
9904 echo "(I can't seem to compile the test program. Guessing...)"
9905 rp="What is the size of a long long (in bytes)?"
9909 if $test "X$longsize" = "X$longlongsize"; then
9910 echo "(That isn't any different from an ordinary long.)"
9916 : see if prototype for lseek is available
9918 set d_lseekproto lseek $i_systypes sys/types.h $i_unistd unistd.h
9921 : see if lstat exists
9925 : see if madvise exists
9926 set madvise d_madvise
9929 : see if mblen exists
9933 : see if mbstowcs exists
9934 set mbstowcs d_mbstowcs
9937 : see if mbtowc exists
9941 : see if memchr exists
9945 : see if memcmp exists
9949 : see if memcpy exists
9953 : see if memmove exists
9954 set memmove d_memmove
9957 : see if memset exists
9961 : see if mkdir exists
9965 : see if mkdtemp exists
9966 set mkdtemp d_mkdtemp
9969 : see if mkfifo exists
9973 : see if mkstemp exists
9974 set mkstemp d_mkstemp
9977 : see if mkstemps exists
9978 set mkstemps d_mkstemps
9981 : see if mktime exists
9985 : see if this is a sys/mman.h system
9986 set sys/mman.h i_sysmman
9989 : see if mmap exists
9992 : see what shmat returns
9993 : default to something harmless
9995 case "$i_sysmman$d_mmap" in
9997 $cat >mmap.c <<'END'
9998 #include <sys/mman.h>
10001 if $cc $ccflags -c mmap.c >/dev/null 2>&1; then
10006 echo "and it returns ($mmaptype)." >&4
10012 : see if modfl exists
10016 : see if mprotect exists
10017 set mprotect d_mprotect
10020 : see if msgctl exists
10021 set msgctl d_msgctl
10024 : see if msgget exists
10025 set msgget d_msgget
10028 : see if msgsnd exists
10029 set msgsnd d_msgsnd
10032 : see if msgrcv exists
10033 set msgrcv d_msgrcv
10036 : see how much of the 'msg*(2)' library is present.
10039 case "$d_msgctl$d_msgget$d_msgsnd$d_msgrcv" in
10040 *"$undef"*) h_msg=false;;
10044 case "`ipcs 2>&1`" in
10045 "SVID messages"*"not configured"*)
10046 echo "Your $osname does not have the msg*(2) configured." >&4
10049 set msgctl d_msgctl
10051 set msgget d_msgget
10053 set msgsnd d_msgsnd
10055 set msgrcv d_msgrcv
10061 : we could also check for sys/ipc.h ...
10062 if $h_msg && $test `./findhdr sys/msg.h`; then
10063 echo "You have the full msg*(2) library." >&4
10066 echo "You don't have the full msg*(2) library." >&4
10072 : see if msync exists
10076 : see if munmap exists
10077 set munmap d_munmap
10080 : see if nice exists
10086 echo "Checking which 64-bit integer type we could use..." >&4
10092 val='"unsigned int"'
10097 *) case "$longsize" in
10101 val='"unsigned long"'
10106 *) case "$d_longlong:$longlongsize" in
10111 val='"unsigned long long"'
10116 *) case "$d_int64_t" in
10134 case "$quadtype" in
10135 '') echo "Alas, no 64-bit integer types in sight." >&4
10138 *) if test X"$use64bitint" = Xdefine -o X"$longsize" = X8; then
10143 echo "We $verb use '$quadtype' for 64-bit integers." >&4
10148 : check for length of character
10150 case "$charsize" in
10152 echo "Checking to see how big your characters are (hey, you never know)..." >&4
10153 $cat >try.c <<'EOCP'
10157 printf("%d\n", (int)sizeof(char));
10162 if eval $compile_ok; then
10166 echo "(I can't seem to compile the test program. Guessing...)"
10173 rp="What is the size of a character (in bytes)?"
10180 $echo "Choosing the C types to be used for Perl's internal types..." >&4
10182 case "$use64bitint:$d_quad:$quadtype" in
10185 uvtype="$uquadtype"
10190 uvtype="unsigned long"
10196 case "$uselongdouble:$d_longdbl" in
10198 nvtype="long double"
10199 nvsize=$longdblsize
10206 $echo "(IV will be "$ivtype", $ivsize bytes)"
10207 $echo "(UV will be "$uvtype", $uvsize bytes)"
10208 $echo "(NV will be "$nvtype", $nvsize bytes)"
10211 #$i_inttypes I_INTTYPES
10213 #include <inttypes.h>
10218 int8_t i = INT8_MAX;
10219 uint8_t u = UINT8_MAX;
10220 printf("int8_t\n");
10223 int16_t i = INT16_MAX;
10224 uint16_t i = UINT16_MAX;
10225 printf("int16_t\n");
10228 int32_t i = INT32_MAX;
10229 uint32_t u = UINT32_MAX;
10230 printf("int32_t\n");
10236 '') case "$charsize" in
10238 u8type="unsigned char"
10247 if eval $compile; then
10248 case "`./try$exe_ext`" in
10249 int8_t) i8type=int8_t
10259 '') if $test $charsize -ge 1; then
10261 u8type="unsigned char"
10269 '') case "$shortsize" in
10271 u16type="unsigned short"
10279 '') set try -DINT16
10280 if eval $compile; then
10281 case "`./try$exe_ext`" in
10293 '') if $test $shortsize -ge 2; then
10295 u16type="unsigned short"
10303 '') case "$longsize" in
10305 u32type="unsigned long"
10309 *) case "$intsize" in
10311 u32type="unsigned int"
10321 '') set try -DINT32
10322 if eval $compile; then
10323 case "`./try$exe_ext`" in
10335 '') if $test $intsize -ge 4; then
10337 u32type="unsigned int"
10345 '') case "$d_quad:$quadtype" in
10347 i64type="$quadtype"
10348 u64type="$uquadtype"
10356 $echo "Checking whether your NVs can preserve your UVs..." >&4
10360 $uvtype k = ($uvtype)~0, l;
10366 printf("preserve\n");
10371 if eval $compile; then
10372 case "`./try$exe_ext`" in
10373 preserve) d_nv_preserves_uv="$define" ;;
10376 case "$d_nv_preserves_uv" in
10377 $define) $echo "Yes, they can." 2>&1 ;;
10378 *) $echo "No, they can't." 2>&1
10379 d_nv_preserves_uv="$undef"
10385 case "$d_nv_preserves_uv" in
10386 "$define") d_nv_preserves_uv_bits=`expr $uvsize \* 8` ;;
10387 *) $echo "Checking how many bits of your UVs your NVs can preserve..." >&4
10392 int n = 8 * $uvsize;
10394 for (i = 0; i < n; i++) {
10395 u = u << 1 | ($uvtype)1;
10396 if (($uvtype)($nvtype)u != u)
10404 if eval $compile; then
10405 d_nv_preserves_uv_bits="`./try$exe_ext`"
10407 case "$d_nv_preserves_uv_bits" in
10408 [1-9]*) $echo "Your NVs can preserve $d_nv_preserves_uv_bits bits of your UVs." 2>&1 ;;
10409 *) $echo "Can't figure out how many bits your NVs preserve." 2>&1
10410 d_nv_preserves_uv_bits="$undef"
10419 : check for off64_t
10421 echo "Checking to see if you have off64_t..." >&4
10423 #include <sys/types.h>
10424 #include <unistd.h>
10425 int main() { off64_t x = 7; }
10428 if eval $compile; then
10430 echo "You have off64_t."
10433 echo "You do not have off64_t."
10434 case "$lseeksize" in
10435 8) echo "(Your off_t is 64 bits, so you could use that.)" ;;
10442 : see if POSIX threads are available
10443 set pthread.h i_pthread
10449 : how to create joinable pthreads
10450 if test "X$usethreads" = "X$define" -a "X$i_pthread" = "X$define"; then
10452 echo "Checking what constant to use for creating joinable pthreads..." >&4
10453 $cat >try.c <<'EOCP'
10454 #include <pthread.h>
10456 int detachstate = JOINABLE;
10459 set try -DJOINABLE=PTHREAD_CREATE_JOINABLE
10460 if eval $compile; then
10461 echo "You seem to use PTHREAD_CREATE_JOINABLE." >&4
10462 val="$undef" # Yes, undef.
10463 set d_old_pthread_create_joinable
10466 set old_pthread_create_joinable
10469 set try -DJOINABLE=PTHREAD_CREATE_UNDETACHED
10470 if eval $compile; then
10471 echo "You seem to use PTHREAD_CREATE_UNDETACHED." >&4
10473 set d_old_pthread_create_joinable
10475 val=PTHREAD_CREATE_UNDETACHED
10476 set old_pthread_create_joinable
10479 set try -DJOINABLE=__UNDETACHED
10480 if eval $compile; then
10481 echo "You seem to use __UNDETACHED." >&4
10483 set d_old_pthread_create_joinable
10486 set old_pthread_create_joinable
10489 echo "Egads, nothing obvious found. Guessing that you use 0." >&4
10491 set d_old_pthread_create_joinable
10494 set old_pthread_create_joinable
10501 d_old_pthread_create_joinable="$undef"
10502 old_pthread_create_joinable=""
10505 : see if pause exists
10509 : see if pipe exists
10513 : see if poll exists
10518 : see whether the various POSIXish _yields exist
10520 #include <pthread.h>
10526 #ifdef PTHREAD_YIELD
10529 #ifdef PTHREAD_YIELD_NULL
10530 pthread_yield(NULL);
10536 : see if sched_yield exists
10537 set try -DSCHED_YIELD
10538 if eval $compile; then
10540 sched_yield='sched_yield()'
10544 case "$usethreads" in
10547 $define) echo 'sched_yield() found.' >&4 ;;
10548 *) echo 'sched_yield() NOT found.' >&4 ;;
10554 : see if pthread_yield exists
10555 set try -DPTHREAD_YIELD
10556 if eval $compile; then
10558 case "$sched_yield" in
10559 '') sched_yield='pthread_yield()' ;;
10562 set try -DPTHREAD_YIELD_NULL
10563 if eval $compile; then
10565 case "$sched_yield" in
10566 '') sched_yield='pthread_yield(NULL)' ;;
10572 case "$usethreads" in
10575 $define) echo 'pthread_yield() found.' >&4 ;;
10576 *) echo 'pthread_yield() NOT found.' >&4 ;;
10580 set d_pthread_yield
10583 case "$sched_yield" in
10584 '') sched_yield=undef ;;
10589 : see if this is a pwd.h system
10595 xxx=`./findhdr pwd.h`
10596 $cppstdin $cppflags $cppminus < $xxx >$$.h
10598 if $contains 'pw_quota' $$.h >/dev/null 2>&1; then
10606 if $contains 'pw_age' $$.h >/dev/null 2>&1; then
10614 if $contains 'pw_change' $$.h >/dev/null 2>&1; then
10622 if $contains 'pw_class' $$.h >/dev/null 2>&1; then
10630 if $contains 'pw_expire' $$.h >/dev/null 2>&1; then
10638 if $contains 'pw_comment' $$.h >/dev/null 2>&1; then
10646 if $contains 'pw_gecos' $$.h >/dev/null 2>&1; then
10654 if $contains 'pw_passwd' $$.h >/dev/null 2>&1; then
10666 set d_pwquota; eval $setvar
10667 set d_pwage; eval $setvar
10668 set d_pwchange; eval $setvar
10669 set d_pwclass; eval $setvar
10670 set d_pwexpire; eval $setvar
10671 set d_pwcomment; eval $setvar
10672 set d_pwgecos; eval $setvar
10673 set d_pwpasswd; eval $setvar
10677 : see if readdir and friends exist
10678 set readdir d_readdir
10680 set seekdir d_seekdir
10682 set telldir d_telldir
10684 set rewinddir d_rewinddir
10687 : see if readlink exists
10688 set readlink d_readlink
10691 : see if rename exists
10692 set rename d_rename
10695 : see if rmdir exists
10699 : see if memory.h is available.
10704 : See if it conflicts with string.h
10710 $cppstdin $cppflags $cppminus < $strings > mem.h
10711 if $contains 'memcpy' mem.h >/dev/null 2>&1; then
10713 echo "We won't be including <memory.h>."
10723 : can bcopy handle overlapping blocks?
10728 echo "Checking to see if your bcopy() can do overlapping copies..." >&4
10730 #$i_memory I_MEMORY
10731 #$i_stdlib I_STDLIB
10732 #$i_string I_STRING
10733 #$i_unistd I_UNISTD
10735 $cat >>try.c <<'EOCP'
10738 # include <memory.h>
10741 # include <stdlib.h>
10744 # include <string.h>
10746 # include <strings.h>
10749 # include <unistd.h> /* Needed for NetBSD */
10753 char buf[128], abc[128];
10759 bcopy("abcdefghijklmnopqrstuvwxyz0123456789", abc, 36);
10761 for (align = 7; align >= 0; align--) {
10762 for (len = 36; len; len--) {
10764 bcopy(abc, b, len);
10765 for (off = 1; off <= len; off++) {
10766 bcopy(b, b+off, len);
10767 bcopy(b+off, b, len);
10768 if (bcmp(b, abc, len))
10777 if eval $compile_ok; then
10778 if ./try 2>/dev/null; then
10779 echo "Yes, it can."
10782 echo "It can't, sorry."
10783 case "$d_memmove" in
10784 "$define") echo "But that's Ok since you have memmove()." ;;
10788 echo "(I can't compile the test program, so we'll assume not...)"
10789 case "$d_memmove" in
10790 "$define") echo "But that's Ok since you have memmove()." ;;
10795 $rm -f try.* try core
10799 : can memcpy handle overlapping blocks?
10801 case "$d_memcpy" in
10804 echo "Checking to see if your memcpy() can do overlapping copies..." >&4
10806 #$i_memory I_MEMORY
10807 #$i_stdlib I_STDLIB
10808 #$i_string I_STRING
10809 #$i_unistd I_UNISTD
10811 $cat >>try.c <<'EOCP'
10814 # include <memory.h>
10817 # include <stdlib.h>
10820 # include <string.h>
10822 # include <strings.h>
10825 # include <unistd.h> /* Needed for NetBSD */
10829 char buf[128], abc[128];
10835 /* Copy "abcde..." string to char abc[] so that gcc doesn't
10836 try to store the string in read-only memory. */
10837 memcpy(abc, "abcdefghijklmnopqrstuvwxyz0123456789", 36);
10839 for (align = 7; align >= 0; align--) {
10840 for (len = 36; len; len--) {
10842 memcpy(b, abc, len);
10843 for (off = 1; off <= len; off++) {
10844 memcpy(b+off, b, len);
10845 memcpy(b, b+off, len);
10846 if (memcmp(b, abc, len))
10855 if eval $compile_ok; then
10856 if ./try 2>/dev/null; then
10857 echo "Yes, it can."
10860 echo "It can't, sorry."
10861 case "$d_memmove" in
10862 "$define") echo "But that's Ok since you have memmove()." ;;
10866 echo "(I can't compile the test program, so we'll assume not...)"
10867 case "$d_memmove" in
10868 "$define") echo "But that's Ok since you have memmove()." ;;
10873 $rm -f try.* try core
10877 : can memcmp be trusted to compare relative magnitude?
10879 case "$d_memcmp" in
10882 echo "Checking if your memcmp() can compare relative magnitude..." >&4
10884 #$i_memory I_MEMORY
10885 #$i_stdlib I_STDLIB
10886 #$i_string I_STRING
10887 #$i_unistd I_UNISTD
10889 $cat >>try.c <<'EOCP'
10892 # include <memory.h>
10895 # include <stdlib.h>
10898 # include <string.h>
10900 # include <strings.h>
10903 # include <unistd.h> /* Needed for NetBSD */
10909 if ((a < b) && memcmp(&a, &b, 1) < 0)
10915 if eval $compile_ok; then
10916 if ./try 2>/dev/null; then
10917 echo "Yes, it can."
10920 echo "No, it can't (it uses signed chars)."
10923 echo "(I can't compile the test program, so we'll assume not...)"
10927 $rm -f try.* try core
10931 : see if select exists
10932 set select d_select
10935 : see if semctl exists
10936 set semctl d_semctl
10939 : see if semget exists
10940 set semget d_semget
10943 : see if semop exists
10947 : see how much of the 'sem*(2)' library is present.
10950 case "$d_semctl$d_semget$d_semop" in
10951 *"$undef"*) h_sem=false;;
10955 case "`ipcs 2>&1`" in
10956 "SVID messages"*"not configured"*)
10957 echo "Your $osname does not have the sem*(2) configured." >&4
10960 set semctl d_semctl
10962 set semget d_semget
10970 : we could also check for sys/ipc.h ...
10971 if $h_sem && $test `./findhdr sys/sem.h`; then
10972 echo "You have the full sem*(2) library." >&4
10975 echo "You don't have the full sem*(2) library." >&4
10981 : see whether sys/sem.h defines union semun
10983 $cat > try.c <<'END'
10984 #include <sys/types.h>
10985 #include <sys/ipc.h>
10986 #include <sys/sem.h>
10987 int main () { union semun semun; semun.buf = 0; }
10990 if eval $compile; then
10991 echo "You have union semun in <sys/sem.h>." >&4
10994 echo "You do not have union semun in <sys/sem.h>." >&4
10997 $rm -f try try.c try.h
11001 : see how to do semctl IPC_STAT
11004 : see whether semctl IPC_STAT can use union semun
11009 # define S_IRUSR S_IREAD
11010 # define S_IWUSR S_IWRITE
11011 # define S_IXUSR S_IEXEC
11013 # define S_IRUSR 0400
11014 # define S_IWUSR 0200
11015 # define S_IXUSR 0100
11017 # define S_IRGRP (S_IRUSR>>3)
11018 # define S_IWGRP (S_IWUSR>>3)
11019 # define S_IXGRP (S_IXUSR>>3)
11020 # define S_IROTH (S_IRUSR>>6)
11021 # define S_IWOTH (S_IWUSR>>6)
11022 # define S_IXOTH (S_IXUSR>>6)
11025 # define S_IRWXU (S_IRUSR|S_IWUSR|S_IXUSR)
11026 # define S_IRWXG (S_IRGRP|S_IWGRP|S_IXGRP)
11027 # define S_IRWXO (S_IROTH|S_IWOTH|S_IXOTH)
11032 #include <sys/types.h>
11033 #include <sys/ipc.h>
11034 #include <sys/sem.h>
11035 #include <sys/stat.h>
11042 #$d_union_semun HAS_UNION_SEMUN
11045 #ifndef HAS_UNION_SEMUN
11048 struct semid_ds *buf;
11049 unsigned short *array;
11055 #if defined(IPC_PRIVATE) && defined(S_IRWXU) && defined(S_IRWXG) && defined(S_IRWXO) && defined(IPC_CREAT)
11056 sem = semget(IPC_PRIVATE, 1, S_IRWXU|S_IRWXG|S_IRWXO|IPC_CREAT);
11058 struct semid_ds argbuf;
11061 st = semctl(sem, 0, IPC_STAT, arg);
11065 # endif /* IPC_STAT */
11066 printf("semctl IPC_STAT failed: errno = %d\n", errno);
11068 if (semctl(sem, 0, IPC_RMID, arg) != 0)
11069 # endif /* IPC_RMID */
11070 printf("semctl IPC_RMID failed: errno = %d\n", errno);
11072 #endif /* IPC_PRIVATE && ... */
11073 printf("semget failed: errno = %d\n", errno);
11079 if eval $compile; then
11082 semun) val="$define" ;;
11088 case "$d_semctl_semun" in
11090 echo "You can use union semun for semctl IPC_STAT." >&4
11093 *) echo "You cannot use union semun for semctl IPC_STAT." >&4
11098 : see whether semctl IPC_STAT can use struct semid_ds pointer
11099 $cat > try.c <<'END'
11100 #include <sys/types.h>
11101 #include <sys/ipc.h>
11102 #include <sys/sem.h>
11103 #include <sys/stat.h>
11111 struct semid_ds arg;
11114 #if defined(IPC_PRIVATE) && defined(S_IRWXU) && defined(S_IRWXG) && defined(S_IRWXO) && defined(IPC_CREAT)
11115 sem = semget(IPC_PRIVATE, 1, S_IRWXU|S_IRWXG|S_IRWXO|IPC_CREAT);
11118 st = semctl(sem, 0, IPC_STAT, &arg);
11120 printf("semid_ds\n");
11122 # endif /* IPC_STAT */
11123 printf("semctl IPC_STAT failed: errno = %d\n", errno);
11125 if (semctl(sem, 0, IPC_RMID, &arg) != 0)
11126 # endif /* IPC_RMID */
11127 printf("semctl IPC_RMID failed: errno = %d\n", errno);
11129 #endif /* IPC_PRIVATE && ... */
11130 printf("semget failed: errno = %d\n", errno);
11137 if eval $compile; then
11140 semid_ds) val="$define" ;;
11144 set d_semctl_semid_ds
11146 case "$d_semctl_semid_ds" in
11148 echo "You can $also use struct semid_ds* for semctl IPC_STAT." >&4
11150 *) echo "You cannot use struct semid_ds* for semctl IPC_STAT." >&4
11157 # We do not have the full sem*(2) library, so assume we can not
11163 set d_semctl_semid_ds
11168 : see if setegid exists
11169 set setegid d_setegid
11172 : see if seteuid exists
11173 set seteuid d_seteuid
11176 : see if setgrent exists
11177 set setgrent d_setgrent
11180 : see if sethostent exists
11181 set sethostent d_sethent
11184 : see if setlinebuf exists
11185 set setlinebuf d_setlinebuf
11188 : see if setlocale exists
11189 set setlocale d_setlocale
11192 : see if setnetent exists
11193 set setnetent d_setnent
11196 : see if setprotoent exists
11197 set setprotoent d_setpent
11200 : see if setpgid exists
11201 set setpgid d_setpgid
11204 : see if setpgrp2 exists
11205 set setpgrp2 d_setpgrp2
11208 : see if setpriority exists
11209 set setpriority d_setprior
11212 : see if setproctitle exists
11213 set setproctitle d_setproctitle
11216 : see if setpwent exists
11217 set setpwent d_setpwent
11220 : see if setregid exists
11221 set setregid d_setregid
11223 set setresgid d_setresgid
11226 : see if setreuid exists
11227 set setreuid d_setreuid
11229 set setresuid d_setresuid
11232 : see if setrgid exists
11233 set setrgid d_setrgid
11236 : see if setruid exists
11237 set setruid d_setruid
11240 : see if setservent exists
11241 set setservent d_setsent
11244 : see if setsid exists
11245 set setsid d_setsid
11248 : see if setvbuf exists
11249 set setvbuf d_setvbuf
11252 : see if sfio.h is available
11257 : see if sfio library is available
11268 : Ok, but do we want to use it.
11272 true|$define|[yY]*) dflt='y';;
11275 echo "$package can use the sfio library, but it is experimental."
11276 case "$useperlio" in
11278 echo "For sfio also the PerlIO abstraction layer is needed."
11279 echo "Earlier you said you wouldn't want that."
11282 rp="You seem to have sfio available, do you want to try using it?"
11285 y|Y) echo "Ok, turning on both sfio and PerlIO, then."
11286 useperlio="$define"
11289 *) echo "Ok, avoiding sfio this time. I'll use stdio instead."
11291 : Remove sfio from list of libraries to use
11292 set `echo X $libs | $sed -e 's/-lsfio / /' -e 's/-lsfio$//'`
11295 echo "libs = $libs" >&4
11299 *) case "$usesfio" in
11300 true|$define|[yY]*)
11301 echo "Sorry, cannot find sfio on this machine." >&4
11302 echo "Ignoring your setting of usesfio=$usesfio." >&4
11311 $define) usesfio='true';;
11312 *) usesfio='false';;
11315 : see if shmctl exists
11316 set shmctl d_shmctl
11319 : see if shmget exists
11320 set shmget d_shmget
11323 : see if shmat exists
11326 : see what shmat returns
11329 $cat >shmat.c <<'END'
11330 #include <sys/shm.h>
11333 if $cc $ccflags -c shmat.c >/dev/null 2>&1; then
11338 echo "and it returns ($shmattype)." >&4
11339 : see if a prototype for shmat is available
11340 xxx=`./findhdr sys/shm.h`
11341 $cppstdin $cppflags $cppminus < $xxx > shmat.c 2>/dev/null
11342 if $contains 'shmat.*(' shmat.c >/dev/null 2>&1; then
11353 set d_shmatprototype
11356 : see if shmdt exists
11360 : see how much of the 'shm*(2)' library is present.
11363 case "$d_shmctl$d_shmget$d_shmat$d_shmdt" in
11364 *"$undef"*) h_shm=false;;
11368 case "`ipcs 2>&1`" in
11369 "SVID shared memory"*"not configured"*)
11370 echo "Your $osname does not have the shm*(2) configured." >&4
11373 set shmctl d_shmctl
11375 set shmget d_shmget
11385 : we could also check for sys/ipc.h ...
11386 if $h_shm && $test `./findhdr sys/shm.h`; then
11387 echo "You have the full shm*(2) library." >&4
11390 echo "You don't have the full shm*(2) library." >&4
11397 : see if we have sigaction
11398 if set sigaction val -f d_sigaction; eval $csym; $val; then
11399 echo 'sigaction() found.' >&4
11400 $cat > try.c <<'EOP'
11402 #include <sys/types.h>
11403 #include <signal.h>
11406 struct sigaction act, oact;
11408 oact.sa_handler = 0;
11409 /* so that act and oact are used */
11410 exit(act.sa_flags == 0 && oact.sa_handler == 0);
11414 if eval $compile_ok; then
11417 echo "But you don't seem to have a useable struct sigaction." >&4
11421 echo 'sigaction NOT found.' >&4
11424 set d_sigaction; eval $setvar
11425 $rm -f try try$_o try.c
11427 : see if sigsetjmp exists
11429 case "$d_sigsetjmp" in
11431 $cat >try.c <<'EOP'
11432 #include <setjmp.h>
11437 if (sigsetjmp(env,1))
11440 siglongjmp(env, 1);
11445 if eval $compile; then
11446 if ./try >/dev/null 2>&1; then
11447 echo "POSIX sigsetjmp found." >&4
11451 Uh-Oh! You have POSIX sigsetjmp and siglongjmp, but they do not work properly!!
11457 echo "sigsetjmp not found." >&4
11461 *) val="$d_sigsetjmp"
11462 case "$d_sigsetjmp" in
11463 $define) echo "POSIX sigsetjmp found." >&4;;
11464 $undef) echo "sigsetjmp not found." >&4;;
11472 : see if socks5_init exists
11473 set socks5_init d_socks5_init
11476 : see if sys/stat.h is available
11477 set sys/stat.h i_sysstat
11481 : see if stat knows about block sizes
11483 echo "Checking to see if your struct stat has st_blocks field..." >&4
11484 set d_statblks stat st_blocks $i_sysstat sys/stat.h
11488 : see if this is a sys/vfs.h system
11489 set sys/vfs.h i_sysvfs
11493 : see if this is a sys/statfs.h system
11494 set sys/statfs.h i_sysstatfs
11499 echo "Checking to see if your system supports struct statfs..." >&4
11500 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
11502 case "$d_statfs_s" in
11503 "$define") echo "Yes, it does." ;;
11504 *) echo "No, it doesn't." ;;
11509 : see if struct statfs knows about f_flags
11510 case "$d_statfs_s" in
11513 echo "Checking to see if your struct statfs has f_flags field..." >&4
11514 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
11518 set d_statfs_f_flags
11522 case "$d_statfs_f_flags" in
11523 "$define") echo "Yes, it does." ;;
11524 *) echo "No, it doesn't." ;;
11527 : see if _ptr and _cnt from stdio act std
11529 if $contains '_IO_fpos_t' `./findhdr stdio.h` `./findhdr libio.h` >/dev/null 2>&1 ; then
11530 echo "(Looks like you have stdio.h from Linux.)"
11531 case "$stdio_ptr" in
11532 '') stdio_ptr='((fp)->_IO_read_ptr)'
11535 *) ptr_lval=$d_stdio_ptr_lval;;
11537 case "$stdio_cnt" in
11538 '') stdio_cnt='((fp)->_IO_read_end - (fp)->_IO_read_ptr)'
11541 *) cnt_lval=$d_stdio_cnt_lval;;
11543 case "$stdio_base" in
11544 '') stdio_base='((fp)->_IO_read_base)';;
11546 case "$stdio_bufsiz" in
11547 '') stdio_bufsiz='((fp)->_IO_read_end - (fp)->_IO_read_base)';;
11550 case "$stdio_ptr" in
11551 '') stdio_ptr='((fp)->_ptr)'
11554 *) ptr_lval=$d_stdio_ptr_lval;;
11556 case "$stdio_cnt" in
11557 '') stdio_cnt='((fp)->_cnt)'
11560 *) cnt_lval=$d_stdio_cnt_lval;;
11562 case "$stdio_base" in
11563 '') stdio_base='((fp)->_base)';;
11565 case "$stdio_bufsiz" in
11566 '') stdio_bufsiz='((fp)->_cnt + (fp)->_ptr - (fp)->_base)';;
11569 : test whether _ptr and _cnt really work
11570 echo "Checking how std your stdio is..." >&4
11573 #define FILE_ptr(fp) $stdio_ptr
11574 #define FILE_cnt(fp) $stdio_cnt
11576 FILE *fp = fopen("try.c", "r");
11579 18 <= FILE_cnt(fp) &&
11580 strncmp(FILE_ptr(fp), "include <stdio.h>\n", 18) == 0
11588 if eval $compile; then
11590 echo "Your stdio acts pretty std."
11593 echo "Your stdio isn't very std."
11596 echo "Your stdio doesn't appear very std."
11602 : Can _ptr be used as an lvalue?
11603 case "$d_stdstdio$ptr_lval" in
11604 $define$define) val=$define ;;
11607 set d_stdio_ptr_lval
11610 : Can _cnt be used as an lvalue?
11611 case "$d_stdstdio$cnt_lval" in
11612 $define$define) val=$define ;;
11615 set d_stdio_cnt_lval
11618 : see if _base is also standard
11620 case "$d_stdstdio" in
11624 #define FILE_base(fp) $stdio_base
11625 #define FILE_bufsiz(fp) $stdio_bufsiz
11627 FILE *fp = fopen("try.c", "r");
11630 19 <= FILE_bufsiz(fp) &&
11631 strncmp(FILE_base(fp), "#include <stdio.h>\n", 19) == 0
11638 if eval $compile; then
11640 echo "And its _base field acts std."
11643 echo "But its _base field isn't std."
11646 echo "However, it seems to be lacking the _base field."
11655 Checking how to access stdio streams by file descriptor number...
11657 case "$stdio_stream_array" in
11658 '') $cat >try.c <<EOCP
11661 if (&STDIO_STREAM_ARRAY[fileno(stdin)] == stdin)
11665 for s in _iob __iob __sF
11667 set try -DSTDIO_STREAM_ARRAY=$s
11668 if eval $compile; then
11669 case "`./try$exe_ext`" in
11670 yes) stdio_stream_array=$s; break ;;
11674 $rm -f try.* try$exe_ext
11676 case "$stdio_stream_array" in
11678 I can't figure out how to access stdio streams by file descriptor number.
11680 d_stdio_stream_array="$undef"
11683 You can access stdio streams by file descriptor number by the $stdio_stream_array array.
11685 d_stdio_stream_array="$define"
11689 : see if strcoll exists
11690 set strcoll d_strcoll
11693 : check for structure copying
11695 echo "Checking to see if your C compiler can copy structs..." >&4
11696 $cat >try.c <<'EOCP'
11706 if $cc -c try.c >/dev/null 2>&1 ; then
11708 echo "Yup, it can."
11711 echo "Nope, it can't."
11717 : see if strerror and/or sys_errlist[] exist
11719 if test "X$d_strerror" = X -o "X$d_syserrlst" = X; then
11720 if set strerror val -f d_strerror; eval $csym; $val; then
11721 echo 'strerror() found.' >&4
11722 d_strerror="$define"
11723 d_strerrm='strerror(e)'
11724 if set sys_errlist val -a d_syserrlst; eval $csym; $val; then
11725 echo "(You also have sys_errlist[], so we could roll our own strerror.)"
11726 d_syserrlst="$define"
11728 echo "(Since you don't have sys_errlist[], sterror() is welcome.)"
11729 d_syserrlst="$undef"
11731 elif xxx=`./findhdr string.h`; test "$xxx" || xxx=`./findhdr strings.h`; \
11732 $contains '#[ ]*define.*strerror' "$xxx" >/dev/null 2>&1; then
11733 echo 'strerror() found in string header.' >&4
11734 d_strerror="$define"
11735 d_strerrm='strerror(e)'
11736 if set sys_errlist val -a d_syserrlst; eval $csym; $val; then
11737 echo "(Most probably, strerror() uses sys_errlist[] for descriptions.)"
11738 d_syserrlst="$define"
11740 echo "(You don't appear to have any sys_errlist[], how can this be?)"
11741 d_syserrlst="$undef"
11743 elif set sys_errlist val -a d_syserrlst; eval $csym; $val; then
11744 echo "strerror() not found, but you have sys_errlist[] so we'll use that." >&4
11745 d_strerror="$undef"
11746 d_syserrlst="$define"
11747 d_strerrm='((e)<0||(e)>=sys_nerr?"unknown":sys_errlist[e])'
11749 echo 'strerror() and sys_errlist[] NOT found.' >&4
11750 d_strerror="$undef"
11751 d_syserrlst="$undef"
11752 d_strerrm='"unknown"'
11756 : see if strtod exists
11757 set strtod d_strtod
11760 : see if strtol exists
11761 set strtol d_strtol
11764 : see if strtold exists
11765 set strtold d_strtold
11768 : see if strtoll exists
11769 set strtoll d_strtoll
11772 case "$d_longlong-$d_strtoll" in
11775 Checking whether your strtoll() works okay...
11777 $cat >try.c <<'EOCP'
11780 #define strtoll __strtoll
11783 extern long long int strtoll(char *s, char **, int);
11784 static int bad = 0;
11785 int check(char *s, long long ell, int een) {
11788 gll = strtoll(s, 0, 10);
11789 if (!((gll == ell) && (errno == een)))
11793 check(" 1", 1LL, 0);
11794 check(" 0", 0LL, 0);
11795 check("-1", -1LL, 0);
11796 check("-9223372036854775808", -9223372036854775808LL, 0);
11797 check("-9223372036854775808", -9223372036854775808LL, 0);
11798 check(" 9223372036854775807", 9223372036854775807LL, 0);
11799 check("-9223372036854775808", -9223372036854775808LL, 0);
11800 check(" 9223372036854775808", 9223372036854775807LL, ERANGE);
11801 check("-9223372036854775809", -9223372036854775808LL, ERANGE);
11807 if eval $compile; then
11809 ok) echo "Your strtoll() seems to be working okay." ;;
11811 Your strtoll() doesn't seem to be working okay.
11820 : see if strtoul exists
11821 set strtoul d_strtoul
11824 : see if strtoull exists
11825 set strtoull d_strtoull
11828 case "$d_longlong-$d_strtoull" in
11831 Checking whether your strtoull() works okay...
11833 $cat >try.c <<'EOCP'
11836 #define strtoull __strtoull
11839 extern unsigned long long int strtoull(char *s, char **, int);
11840 static int bad = 0;
11841 int check(char *s, long long eull, int een) {
11844 gull = strtoull(s, 0, 10);
11845 if (!((gull == eull) && (errno == een)))
11849 check(" 1", 1LL, 0);
11850 check(" 0", 0LL, 0);
11851 check("18446744073709551615", 18446744073709551615ULL, 0);
11852 check("18446744073709551616", 18446744073709551615ULL, ERANGE);
11858 if eval $compile; then
11860 ok) echo "Your strtoull() seems to be working okay." ;;
11862 Your strtoull() doesn't seem to be working okay.
11864 d_strtoull="$undef"
11871 : see if strtouq exists
11872 set strtouq d_strtouq
11875 : see if strxfrm exists
11876 set strxfrm d_strxfrm
11879 : see if symlink exists
11880 set symlink d_symlink
11883 : see if syscall exists
11884 set syscall d_syscall
11887 : see if sysconf exists
11888 set sysconf d_sysconf
11891 : see if system exists
11892 set system d_system
11895 : see if tcgetpgrp exists
11896 set tcgetpgrp d_tcgetpgrp
11899 : see if tcsetpgrp exists
11900 set tcsetpgrp d_tcsetpgrp
11903 : see if prototype for telldir is available
11905 set d_telldirproto telldir $i_systypes sys/types.h $i_dirent dirent.h
11908 : see if this is a sys/times.h system
11909 set sys/times.h i_systimes
11912 : see if times exists
11914 if set times val -f d_times; eval $csym; $val; then
11915 echo 'times() found.' >&4
11918 case "$i_systimes" in
11919 "$define") inc='sys/times.h';;
11921 rp="What is the type returned by times() on this system?"
11922 set clock_t clocktype long stdio.h sys/types.h $inc
11925 echo 'times() NOT found, hope that will do.' >&4
11930 : see if truncate exists
11931 set truncate d_truncate
11934 : see if tzname[] exists
11936 if set tzname val -a d_tzname; eval $csym; $val; then
11938 echo 'tzname[] found.' >&4
11941 echo 'tzname[] NOT found.' >&4
11946 : see if umask exists
11950 : see if ustat exists
11954 : backward compatibility for d_hvfork
11955 if test X$d_hvfork != X; then
11956 d_vfork="$d_hvfork"
11959 : see if there is a vfork
11964 : Ok, but do we want to use it. vfork is reportedly unreliable in
11965 : perl on Solaris 2.x, and probably elsewhere.
11969 case "$usevfork" in
11975 Perl can only use a vfork() that doesn't suffer from strict
11976 restrictions on calling functions or modifying global data in
11977 the child. For example, glibc-2.1 contains such a vfork()
11978 that is unsuitable. If your system provides a proper fork()
11979 call, chances are that you do NOT want perl to use vfork().
11982 rp="Do you still want to use vfork()?"
11987 echo "Ok, we won't use vfork()."
11996 $define) usevfork='true';;
11997 *) usevfork='false';;
12000 : see if this is an sysdir system
12001 set sys/dir.h i_sysdir
12004 : see if this is an sysndir system
12005 set sys/ndir.h i_sysndir
12008 : see if closedir exists
12009 set closedir d_closedir
12012 case "$d_closedir" in
12015 echo "Checking whether closedir() returns a status..." >&4
12016 cat > closedir.c <<EOM
12017 #$i_dirent I_DIRENT /**/
12018 #$i_sysdir I_SYS_DIR /**/
12019 #$i_sysndir I_SYS_NDIR /**/
12020 #$i_systypes I_SYS_TYPES /**/
12022 #if defined(I_SYS_TYPES)
12023 #include <sys/types.h>
12025 #if defined(I_DIRENT)
12026 #include <dirent.h>
12027 #if defined(NeXT) && defined(I_SYS_DIR) /* NeXT needs dirent + sys/dir.h */
12028 #include <sys/dir.h>
12032 #include <sys/ndir.h>
12036 #include <ndir.h> /* may be wrong in the future */
12038 #include <sys/dir.h>
12043 int main() { return closedir(opendir(".")); }
12046 if eval $compile_ok; then
12047 if ./closedir > /dev/null 2>&1 ; then
12048 echo "Yes, it does."
12051 echo "No, it doesn't."
12055 echo "(I can't seem to compile the test program--assuming it doesn't)"
12063 set d_void_closedir
12066 : check for volatile keyword
12068 echo 'Checking to see if your C compiler knows about "volatile"...' >&4
12069 $cat >try.c <<'EOCP'
12072 typedef struct _goo_struct goo_struct;
12073 goo_struct * volatile goo = ((goo_struct *)0);
12074 struct _goo_struct {
12079 typedef unsigned short foo_t;
12080 char *volatile foo;
12082 volatile foo_t blech;
12086 if $cc -c $ccflags try.c >/dev/null 2>&1 ; then
12088 echo "Yup, it does."
12091 echo "Nope, it doesn't."
12097 : see if there is a wait4
12101 : see if waitpid exists
12102 set waitpid d_waitpid
12105 : see if wcstombs exists
12106 set wcstombs d_wcstombs
12109 : see if wctomb exists
12110 set wctomb d_wctomb
12113 : preserve RCS keywords in files with variable substitution, grrr
12118 Revision='$Revision'
12120 case "$crosscompile" in
12121 ''|[nN]*) crosscompile="$undef" ;;
12125 next|rhapsody|darwin) multiarch="$define" ;;
12127 case "$multiarch" in
12128 ''|[nN]*) multiarch="$undef" ;;
12131 : check for alignment requirements
12133 case "$crosscompile$multiarch" in
12136 You seem to be either cross-compiling or doing a multiarchitecture build,
12137 skipping the memory alignment check.
12140 case "$alignbytes" in
12141 '') alignbytes=8 ;;
12145 case "$alignbytes" in
12146 '') echo "Checking alignment constraints..." >&4
12147 if $test "X$uselongdouble" = Xdefine -a "X$d_longdbl" = Xdefine; then
12148 $cat >try.c <<'EOCP'
12149 typedef long double NV;
12152 $cat >try.c <<'EOCP'
12156 $cat >>try.c <<'EOCP'
12164 printf("%d\n", (int)((char *)&try_algn.bar - (char *)&try_algn.foo));
12169 if eval $compile_ok; then
12173 echo "(I can't seem to compile the test program...)"
12176 *) dflt="$alignbytes"
12179 rp="Doubles must be aligned on a how-many-byte boundary?"
12187 : set the base revision
12190 : check for ordering of bytes in a long
12192 case "$crosscompile$multiarch" in
12195 You seem to be either cross-compiling or doing a multiarchitecture build,
12196 skipping the byteorder check.
12202 case "$byteorder" in
12205 In the following, larger digits indicate more significance. A big-endian
12206 machine like a Pyramid or a Motorola 680?0 chip will come out to 4321. A
12207 little-endian machine like a Vax or an Intel 80?86 chip would be 1234. Other
12208 machines may have weird orders like 3412. A Cray will report 87654321,
12209 an Alpha will report 12345678. If the test program works the default is
12211 I'm now running the test program...
12213 $cat >try.c <<'EOCP'
12220 char c[sizeof(long)];
12223 if (sizeof(long) > 4)
12224 u.l = (0x08070605L << 32) | 0x04030201L;
12227 for (i = 0; i < sizeof(long); i++)
12228 printf("%c", u.c[i]+'0');
12235 if eval $compile && ./try > /dev/null; then
12238 [1-4][1-4][1-4][1-4]|12345678|87654321)
12239 echo "(The test program ran ok.)"
12240 echo "byteorder=$dflt"
12243 ????|????????) echo "(The test program ran ok.)" ;;
12244 *) echo "(The test program didn't run right for some reason.)" ;;
12249 (I can't seem to compile the test program. Guessing big-endian...)
12252 case "$xxx_prompt" in
12254 rp="What is the order of bytes in a long?"
12268 : how do we catenate cpp tokens here?
12270 echo "Checking to see how your cpp does stuff like catenate tokens..." >&4
12271 $cat >cpp_stuff.c <<'EOCP'
12272 #define RCAT(a,b)a/**/b
12273 #define ACAT(a,b)a ## b
12277 $cppstdin $cppflags $cppminus <cpp_stuff.c >cpp_stuff.out 2>&1
12278 if $contains 'Circus' cpp_stuff.out >/dev/null 2>&1; then
12279 echo "Oh! Smells like ANSI's been here." >&4
12280 echo "We can catify or stringify, separately or together!"
12282 elif $contains 'Reiser' cpp_stuff.out >/dev/null 2>&1; then
12283 echo "Ah, yes! The good old days!" >&4
12284 echo "However, in the good old days we don't know how to stringify and"
12285 echo "catify at the same time."
12289 Hmm, I don't seem to be able to catenate tokens with your cpp. You're going
12290 to have to edit the values of CAT[2-5] in config.h...
12292 cpp_stuff="/* Help! How do we handle cpp_stuff? */*/"
12296 : see if this is a db.h system
12302 : Check db version.
12304 echo "Checking Berkeley DB version ..." >&4
12310 #include <sys/types.h>
12315 #ifdef DB_VERSION_MAJOR /* DB version >= 2 */
12316 int Major, Minor, Patch ;
12317 unsigned long Version ;
12318 (void)db_version(&Major, &Minor, &Patch) ;
12319 printf("You have Berkeley DB Version 2 or greater\n");
12321 printf("db.h is from Berkeley DB Version %d.%d.%d\n",
12322 DB_VERSION_MAJOR, DB_VERSION_MINOR, DB_VERSION_PATCH);
12323 printf("libdb is from Berkeley DB Version %d.%d.%d\n",
12324 Major, Minor, Patch) ;
12326 /* check that db.h & libdb are compatible */
12327 if (DB_VERSION_MAJOR != Major || DB_VERSION_MINOR != Minor || DB_VERSION_PATCH != Patch) {
12328 printf("db.h and libdb are incompatible\n") ;
12332 printf("db.h and libdb are compatible\n") ;
12334 Version = DB_VERSION_MAJOR * 1000000 + DB_VERSION_MINOR * 1000
12335 + DB_VERSION_PATCH ;
12337 /* needs to be >= 2.3.4 */
12338 if (Version < 2003004) {
12339 /* if (DB_VERSION_MAJOR == 2 && DB_VERSION_MINOR == 0 && DB_VERSION_PATCH < 5) { */
12340 printf("but Perl needs Berkeley DB 2.3.4 or greater\n") ;
12346 #if defined(_DB_H_) && defined(BTREEMAGIC) && defined(HASHMAGIC)
12347 printf("You have Berkeley DB Version 1\n");
12348 exit(0); /* DB version < 2: the coast is clear. */
12350 exit(1); /* <db.h> not Berkeley DB? */
12356 if eval $compile_ok && ./try; then
12357 echo 'Looks OK.' >&4
12359 echo "I can't use Berkeley DB with your <db.h>. I'll disable Berkeley DB." >&4
12363 : Remove db from list of libraries to use
12364 echo "Removing unusable -ldb from library list" >&4
12365 set `echo X $libs | $sed -e 's/-ldb / /' -e 's/-ldb$//'`
12368 echo "libs = $libs" >&4
12378 : Check the return type needed for hash
12380 echo "Checking return type needed for hash for Berkeley DB ..." >&4
12386 #include <sys/types.h>
12389 #ifndef DB_VERSION_MAJOR
12390 u_int32_t hash_cb (ptr, size)
12398 info.hash = hash_cb;
12402 if $cc $ccflags -c try.c >try.out 2>&1 ; then
12403 if $contains warning try.out >>/dev/null 2>&1 ; then
12406 db_hashtype='u_int32_t'
12409 : XXX Maybe we should just give up here.
12410 db_hashtype=u_int32_t
12412 echo "Help: I can't seem to compile the db test program." >&4
12413 echo "Something's wrong, but I'll assume you use $db_hashtype." >&4
12416 echo "Your version of Berkeley DB uses $db_hashtype for hash."
12418 *) db_hashtype=u_int32_t
12423 : Check the return type needed for prefix
12425 echo "Checking return type needed for prefix for Berkeley DB ..." >&4
12431 #include <sys/types.h>
12434 #ifndef DB_VERSION_MAJOR
12435 size_t prefix_cb (key1, key2)
12443 info.prefix = prefix_cb;
12447 if $cc $ccflags -c try.c >try.out 2>&1 ; then
12448 if $contains warning try.out >>/dev/null 2>&1 ; then
12449 db_prefixtype='int'
12451 db_prefixtype='size_t'
12454 db_prefixtype='size_t'
12455 : XXX Maybe we should just give up here.
12457 echo "Help: I can't seem to compile the db test program." >&4
12458 echo "Something's wrong, but I'll assume you use $db_prefixtype." >&4
12461 echo "Your version of Berkeley DB uses $db_prefixtype for prefix."
12463 *) db_prefixtype='size_t'
12467 : check for void type
12469 echo "Checking to see how well your C compiler groks the void type..." >&4
12470 case "$voidflags" in
12472 $cat >try.c <<'EOCP'
12478 extern void moo(); /* function returning void */
12479 void (*goo)(); /* ptr to func returning void */
12481 void *hue; /* generic ptr */
12494 int main() { sub(); }
12496 if $cc $ccflags -c -DTRY=$defvoidused try.c >.out 2>&1 ; then
12497 voidflags=$defvoidused
12498 echo "Good. It appears to support void to the level $package wants.">&4
12499 if $contains warning .out >/dev/null 2>&1; then
12500 echo "However, you might get some warnings that look like this:"
12504 echo "Hmm, your compiler has some difficulty with void. Checking further..." >&4
12505 if $cc $ccflags -c -DTRY=1 try.c >/dev/null 2>&1; then
12506 echo "It supports 1..."
12507 if $cc $ccflags -c -DTRY=3 try.c >/dev/null 2>&1; then
12508 echo "It also supports 2..."
12509 if $cc $ccflags -c -DTRY=7 try.c >/dev/null 2>&1; then
12511 echo "And it supports 4 but not 8 definitely."
12513 echo "It doesn't support 4..."
12514 if $cc $ccflags -c -DTRY=11 try.c >/dev/null 2>&1; then
12516 echo "But it supports 8."
12519 echo "Neither does it support 8."
12523 echo "It does not support 2..."
12524 if $cc $ccflags -c -DTRY=13 try.c >/dev/null 2>&1; then
12526 echo "But it supports 4 and 8."
12528 if $cc $ccflags -c -DTRY=5 try.c >/dev/null 2>&1; then
12530 echo "And it supports 4 but has not heard about 8."
12532 echo "However it supports 8 but not 4."
12537 echo "There is no support at all for void."
12542 case "$voidflags" in
12544 *) $cat >&4 <<'EOM'
12545 Support flag bits are:
12546 1: basic void declarations.
12547 2: arrays of pointers to functions returning void.
12548 4: operations between pointers to and addresses of void functions.
12549 8: generic void pointers.
12552 rp="Your void support flags add up to what?"
12560 : How can we generate normalized random numbers ?
12562 echo "Looking for a random number function..." >&4
12563 case "$randfunc" in
12565 if set drand48 val -f; eval $csym; $val; then
12567 echo "Good, found drand48()." >&4
12568 elif set random val -f; eval $csym; $val; then
12570 echo "OK, found random()." >&4
12573 echo "Yick, looks like I have to use rand()." >&4
12584 *-Dmy_rand=*|*-Dmy_srand=*)
12585 echo "Removing obsolete -Dmy_rand, -Dmy_srand, and -Drandbits from ccflags." >&4
12586 ccflags="`echo $ccflags | sed -e 's/-Dmy_rand=random/ /'`"
12587 ccflags="`echo $ccflags | sed -e 's/-Dmy_srand=srandom/ /'`"
12588 ccflags="`echo $ccflags | sed -e 's/-Drandbits=[0-9][0-9]*/ /'`"
12592 while $test "$cont"; do
12593 rp="Use which function to generate random numbers?"
12595 if $test "$ans" = "$dflt"; then
12601 if set $ans val -f; eval $csym; $val; then
12605 rp="I cannot find function $ans. Use that name anyway?"
12614 case "$randfunc" in
12616 drand01="drand48()"
12622 case "$randbits" in
12624 echo "Checking to see how many bits your $randfunc() function produces..." >&4
12626 #$i_unistd I_UNISTD
12627 #$i_stdlib I_STDLIB
12630 # include <unistd.h>
12633 # include <stdlib.h>
12638 register unsigned long tmp;
12639 register unsigned long max = 0L;
12641 for (i = 1000; i; i--) {
12642 tmp = (unsigned long) $randfunc();
12643 if (tmp > max) max = tmp;
12645 for (i = 0; max; i++)
12651 if eval $compile_ok; then
12655 echo "(I can't seem to compile the test program...)"
12662 rp="How many bits does your $randfunc() function produce?"
12666 drand01="($randfunc() / (double) ((unsigned long)1 << $randbits))"
12667 seedfunc="s$randfunc"
12668 randseedtype=unsigned
12672 rp="How many bits does your $randfunc() function produce?"
12675 seedfunc="s$randfunc"
12676 drand01="($randfunc() / (double) ((unsigned long)1 << $randbits))"
12677 if set $seedfunc val -f; eval $csym; $val; then
12678 echo "(Using $seedfunc() to seed random generator)"
12680 echo "(Warning: no $seedfunc() to seed random generator)"
12683 randseedtype=unsigned
12691 echo "Determining whether or not we are on an EBCDIC system..." >&4
12692 $cat >tebcdic.c <<'EOM'
12695 if ('M'==0xd4) return 0;
12702 if eval $compile_ok; then
12704 echo "You have EBCDIC." >&4
12707 echo "Nope, no EBCDIC, probably ASCII or some ISO Latin." >&4
12710 echo "I'm unable to compile the test program." >&4
12711 echo "I'll assume ASCII or some ISO Latin." >&4
12713 $rm -f tebcdic.c tebcdic
12719 Checking how to flush all pending stdio output...
12721 # I only know how to find the first 32 possibly open files on SunOS.
12722 # See also hints/sunos_4_1.sh and util.c --AD
12724 sunos) $echo '#define PERL_FFLUSH_ALL_FOPEN_MAX 32' > try.c ;;
12726 $cat >>try.c <<EOCP
12728 #$i_unistd I_UNISTD
12730 # include <unistd.h>
12732 #$d_sysconf HAS_SYSCONF
12733 #$d_stdio_stream_array HAS_STDIO_STREAM_ARRAY
12734 #ifdef HAS_STDIO_STREAM_ARRAY
12735 # define STDIO_STREAM_ARRAY $stdio_stream_array
12738 FILE* p = fopen("try.out", "w");
12742 # ifdef TRY_FPRINTF
12746 #ifdef TRY_FFLUSH_NULL
12749 #ifdef TRY_FFLUSH_ALL
12751 long open_max = -1;
12752 # ifdef PERL_FFLUSH_ALL_FOPEN_MAX
12753 open_max = PERL_FFLUSH_ALL_FOPEN_MAX;
12755 # if defined(HAS_SYSCONF) && defined(_SC_OPEN_MAX)
12756 open_max = sysconf(_SC_OPEN_MAX);
12759 open_max = FOPEN_MAX;
12762 open_max = OPEN_MAX;
12771 # ifdef HAS_STDIO_STREAM_ARRAY
12772 if (open_max > 0) {
12774 for (i = 0; i < open_max; i++)
12775 if (STDIO_STREAM_ARRAY[i]._file >= 0 &&
12776 STDIO_STREAM_ARRAY[i]._file < open_max &&
12777 STDIO_STREAM_ARRAY[i]._flag)
12778 fflush(&STDIO_STREAM_ARRAY[i]);
12786 : first we have to find out how _not_ to flush
12787 if $test "X$fflushNULL" = X -o "X$fflushall" = X; then
12789 set try -DTRY_FPUTC
12790 if eval $compile; then
12792 ./try$exe_ext 2>/dev/null
12793 if $test ! -s try.out -a "X$?" = X42; then
12799 set try -DTRY_FPRINTF
12801 if eval $compile; then
12803 ./try$exe_ext 2>/dev/null
12804 if $test ! -s try.out -a "X$?" = X42; then
12805 output=-DTRY_FPRINTF
12811 : check for fflush NULL behaviour
12812 case "$fflushNULL" in
12813 '') set try -DTRY_FFLUSH_NULL $output
12814 if eval $compile; then
12816 ./try$exe_ext 2>/dev/null
12818 if $test -s try.out -a "X$code" = X42; then
12819 fflushNULL="`$cat try.out`"
12821 if $test "X$code" != X42; then
12823 (If this test failed, don't worry, we'll try another method shortly.)
12828 $rm -f core try.core core.try.*
12829 case "$fflushNULL" in
12831 Your fflush(NULL) works okay for output streams.
12832 Let's see if it clobbers input pipes...
12834 # As of mid-March 2000 all versions of Solaris appear to have a stdio
12835 # bug that improperly flushes the input end of pipes. So we avoid the
12836 # autoflush on fork/system/exec support for now. :-(
12837 $cat >tryp.c <<EOCP
12840 main(int argc, char **argv)
12846 while ((i = getc(stdin)) != -1
12847 && (*bp++ = i) != '\n'
12848 && bp < &buf[1024])
12851 fprintf(stdout, "%s", buf);
12859 fflushNULL="$define"
12861 if eval $compile; then
12863 $cat tryp.c | ./tryp$exe_ext 2>/dev/null > tryp.out
12864 if cmp tryp.c tryp.out >/dev/null 2>&1; then
12866 fflush(NULL) seems to behave okay with input streams.
12868 fflushNULL="$define"
12871 Ouch, fflush(NULL) clobbers input pipes! We will not use it.
12873 fflushNULL="$undef"
12876 $rm -f core tryp.c tryp.core core.tryp.*
12879 Your fflush(NULL) isn't working (contrary to ANSI C).
12881 fflushNULL="$undef"
12884 Cannot figure out whether your fflush(NULL) works or not.
12885 I'm assuming it doesn't (contrary to ANSI C).
12887 fflushNULL="$undef"
12891 $define|true|[yY]*)
12892 fflushNULL="$define"
12895 fflushNULL="$undef"
12898 : check explicit looping only if NULL did not work, and if the pipe
12899 : bug does not show up on an explicit flush too
12900 case "$fflushNULL" in
12902 $cat >tryp.c <<EOCP
12905 main(int argc, char **argv)
12911 while ((i = getc(stdin)) != -1
12912 && (*bp++ = i) != '\n'
12913 && bp < &buf[1024])
12916 fprintf(stdout, "%s", buf);
12925 if eval $compile; then
12927 $cat tryp.c | ./tryp$exe_ext 2>/dev/null > tryp.out
12928 if cmp tryp.c tryp.out >/dev/null 2>&1; then
12930 Good, at least fflush(stdin) seems to behave okay when stdin is a pipe.
12932 : now check for fflushall behaviour
12933 case "$fflushall" in
12934 '') set try -DTRY_FFLUSH_ALL $output
12935 if eval $compile; then
12937 (Now testing the other method--but note that this also may fail.)
12940 ./try$exe_ext 2>/dev/null
12941 if $test -s try.out -a "X$?" = X42; then
12942 fflushall="`$cat try.out`"
12945 $rm -f core try.core core.try.*
12946 case "$fflushall" in
12948 Whew. Flushing explicitly all the stdio streams works.
12950 fflushall="$define"
12953 Sigh. Flushing explicitly all the stdio streams doesn't work.
12958 Cannot figure out whether flushing stdio streams explicitly works or not.
12959 I'm assuming it doesn't.
12965 "$define"|true|[yY]*)
12966 fflushall="$define"
12974 All is futile. Even fflush(stdin) clobbers input pipes!
12981 $rm -f core tryp.c tryp.core core.tryp.*
12983 *) fflushall="$undef"
12987 case "$fflushNULL$fflushall" in
12990 OK, I give up. I cannot figure out how to flush pending stdio output.
12991 We won't be flushing handles at all before fork/exec/popen.
12995 $rm -f try.* try$exe_ext
12997 : Store the full pathname to the ar program for use in the C program
12998 : Respect a hint or command line value for full_ar.
13003 : Store the full pathname to the sed program for use in the C program
13006 : see what type gids are declared as in the kernel
13008 echo "Looking for the type for group ids returned by getgid()."
13009 set gid_t gidtype xxx stdio.h sys/types.h
13013 xxx=`./findhdr sys/user.h`
13014 set `grep 'groups\[NGROUPS\];' "$xxx" 2>/dev/null` unsigned short
13016 unsigned) dflt="$1 $2" ;;
13020 *) dflt="$gidtype";;
13023 gid_t) echo "gid_t found." ;;
13024 *) rp="What is the type for group ids returned by getgid()?"
13032 *_t) zzz="$gidtype" ;;
13035 echo "Checking the size of $zzz..." >&4
13037 #include <sys/types.h>
13040 printf("%d\n", (int)sizeof($gidtype));
13045 if eval $compile_ok; then
13049 echo "(I can't execute the test program--guessing $gidsize.)" >&4
13052 echo "Your $zzz is $gidsize bytes long."
13057 echo "(I can't compile the test program--guessing $gidsize.)" >&4
13063 *_t) zzz="$gidtype" ;;
13066 echo "Checking the sign of $zzz..." >&4
13068 #include <sys/types.h>
13079 if eval $compile; then
13083 echo "(I can't execute the test program--guessing unsigned.)" >&4
13087 1) echo "Your $zzz is unsigned." ;;
13088 -1) echo "Your $zzz is signed." ;;
13094 echo "(I can't compile the test program--guessing unsigned.)" >&4
13100 if $test X"$quadtype" != X; then
13102 echo "Checking how to print 64-bit integers..." >&4
13104 if $test X"$sPRId64" = X -a X"$quadtype" = Xint; then
13105 $cat >try.c <<'EOCP'
13106 #include <sys/types.h>
13109 int q = 12345678901;
13110 printf("%ld\n", q);
13114 if eval $compile; then
13115 yyy=`./try$exe_ext`
13118 sPRId64='"d"'; sPRIi64='"i"'; sPRIu64='"u"';
13119 sPRIo64='"o"'; sPRIx64='"x"'; sPRIX64='"X"';
13120 echo "We will use %d."
13126 if $test X"$sPRId64" = X -a X"$quadtype" = Xlong; then
13127 $cat >try.c <<'EOCP'
13128 #include <sys/types.h>
13131 long q = 12345678901;
13132 printf("%ld\n", q);
13136 if eval $compile; then
13137 yyy=`./try$exe_ext`
13140 sPRId64='"ld"'; sPRIi64='"li"'; sPRIu64='"lu"';
13141 sPRIo64='"lo"'; sPRIx64='"lx"'; sPRIX64='"lX"';
13142 echo "We will use %ld."
13148 if $test X"$sPRId64" = X -a X"$i_inttypes" = X"$define" -a X"$quadtype" = Xint64_t; then
13149 $cat >try.c <<'EOCP'
13150 #include <sys/types.h>
13151 #include <inttypes.h>
13154 int64_t q = 12345678901;
13155 printf("%" PRId64 "\n", q);
13159 if eval $compile; then
13160 yyy=`./try$exe_ext`
13163 sPRId64=PRId64; sPRIi64=PRIi64; sPRIu64=PRIu64;
13164 sPRIo64=PRIo64; sPRIx64=PRIx64; sPRIX64=PRIX64;
13165 echo "We will use the C9X style."
13171 if $test X"$sPRId64" = X -a X"$quadtype" = X"long long"; then
13172 $cat >try.c <<'EOCP'
13173 #include <sys/types.h>
13176 long long q = 12345678901LL; /* AIX cc requires the LL prefix. */
13177 printf("%lld\n", q);
13181 if eval $compile; then
13182 yyy=`./try$exe_ext`
13185 sPRId64='"lld"'; sPRIi64='"lli"'; sPRIu64='"llu"';
13186 sPRIo64='"llo"'; sPRIx64='"llx"'; sPRIX64='"llX"';
13187 echo "We will use the %lld style."
13193 if $test X"$sPRId64" = X -a X"$quadtype" != X; then
13195 #include <sys/types.h>
13198 $quadtype q = 12345678901;
13199 printf("%Ld\n", q);
13203 if eval $compile; then
13204 yyy=`./try$exe_ext`
13207 sPRId64='"Ld"'; sPRIi64='"Li"'; sPRIu64='"Lu"';
13208 sPRIo64='"Lo"'; sPRIx64='"Lx"'; sPRIX64='"LX"';
13209 echo "We will use %Ld."
13215 if $test X"$sPRId64" = X -a X"$quadtype" != X; then
13217 #include <sys/types.h>
13220 $quadtype q = 12345678901;
13221 printf("%qd\n", q);
13225 if eval $compile; then
13226 yyy=`./try$exe_ext`
13229 sPRId64='"qd"'; sPRIi64='"qi"'; sPRIu64='"qu"';
13230 sPRIo64='"qo"'; sPRIx64='"qx"'; sPRIX64='"qX"';
13231 echo "We will use %qd."
13237 if $test X"$sPRId64" = X; then
13238 echo "Cannot figure out how to print 64-bit integers." >&4
13246 '') d_PRId64="$undef"; d_PRIi64="$undef"; d_PRIu64="$undef";
13247 d_PRIo64="$undef"; d_PRIx64="$undef"; d_PRIX64="$undef";
13249 *) d_PRId64="$define"; d_PRIi64="$define"; d_PRIu64="$define";
13250 d_PRIo64="$define"; d_PRIx64="$define"; d_PRIX64="$define";
13256 $echo "Checking the format strings to be used for Perl's internal types..." >&4
13258 if $test X"$ivsize" = X8; then
13259 ivdformat="$sPRId64"
13260 uvuformat="$sPRIu64"
13261 uvoformat="$sPRIo64"
13262 uvxformat="$sPRIx64"
13263 uvXformat="$sPRIX64"
13265 if $test X"$ivsize" = X"$longsize"; then
13272 if $test X"$ivsize" = X"$intsize"; then
13280 if $test X"$ivsize" = X"$shortsize"; then
13291 if $test X"$uselongdouble" = X"$define" -a X"$d_longdbl" = X"$define" -a X"$d_PRIgldbl" = X"$define"; then
13292 nveformat="$sPRIeldbl"
13293 nvfformat="$sPRIfldbl"
13294 nvgformat="$sPRIgldbl"
13295 nvEformat="$sPRIEldbl"
13296 nvFformat="$sPRIFldbl"
13297 nvGformat="$sPRIGldbl"
13307 case "$ivdformat" in
13308 '') echo "$0: Fatal: failed to find format strings, cannot continue." >& 4
13315 $echo "Checking the format string to be used for gids..." >&4
13318 -1) if $test X"$gidsize" = X"$ivsize"; then
13319 gidformat="$ivdformat"
13321 if $test X"$gidsize" = X"$longsize"; then
13324 if $test X"$gidsize" = X"$intsize"; then
13327 if $test X"$gidsize" = X"$shortsize"; then
13334 *) if $test X"$gidsize" = X"$uvsize"; then
13335 gidformat="$uvuformat"
13337 if $test X"$gidsize" = X"$longsize"; then
13340 if $test X"$gidsize" = X"$intsize"; then
13343 if $test X"$gidsize" = X"$shortsize"; then
13352 : see if getgroups exists
13353 set getgroups d_getgrps
13356 : see if setgroups exists
13357 set setgroups d_setgrps
13361 : Find type of 2nd arg to 'getgroups()' and 'setgroups()'
13363 case "$d_getgrps$d_setgrps" in
13365 case "$groupstype" in
13366 '') dflt="$gidtype" ;;
13367 *) dflt="$groupstype" ;;
13370 What type of pointer is the second argument to getgroups() and setgroups()?
13371 Usually this is the same as group ids, $gidtype, but not always.
13374 rp='What type pointer is the second argument to getgroups() and setgroups()?'
13378 *) groupstype="$gidtype";;
13382 echo "Checking if your $make program sets \$(MAKE)..." >&4
13383 case "$make_set_make" in
13385 $sed 's/^X //' > testmake.mak << 'EOF'
13387 X @echo 'maketemp="$(MAKE)"'
13389 case "`$make -f testmake.mak 2>/dev/null`" in
13390 *maketemp=*) make_set_make='#' ;;
13391 *) make_set_make="MAKE=$make" ;;
13393 $rm -f testmake.mak
13396 case "$make_set_make" in
13397 '#') echo "Yup, it does.";;
13398 *) echo "Nope, it doesn't.";;
13401 : see what type is used for mode_t
13402 rp="What is the type used for file modes for system calls (e.g. fchmod())?"
13403 set mode_t modetype int stdio.h sys/types.h
13406 : define a fucntion to check prototypes
13407 $cat > protochk <<EOSH
13410 optimize="$optimize"
13412 prototype="$prototype"
13417 $cat >> protochk <<'EOSH'
13422 while test $# -ge 2; do
13424 $define) echo "#include <$2>" >> try.c ;;
13425 literal) echo "$2" >> try.c ;;
13429 test "$prototype" = "$define" && echo '#define CAN_PROTOTYPE' >> try.c
13430 cat >> try.c <<'EOCP'
13431 #ifdef CAN_PROTOTYPE
13432 #define _(args) args
13437 echo "$foo" >> try.c
13438 echo 'int no_real_function_has_this_name _((void)) { return 0; }' >> try.c
13439 $cc $optimize $ccflags -c try.c > /dev/null 2>&1
13445 $eunicefix protochk
13447 : see what type is used for size_t
13448 rp="What is the type used for the length parameter for string functions?"
13449 set size_t sizetype 'unsigned int' stdio.h sys/types.h
13452 : check for type of arguments to gethostbyaddr.
13453 if test "X$netdb_host_type" = X -o "X$netdb_hlen_type" = X; then
13454 case "$d_gethbyaddr" in
13458 Checking to see what type of arguments are accepted by gethostbyaddr().
13460 hdrs="$define sys/types.h
13461 $d_socket sys/socket.h
13462 $i_niin netinet/in.h
13464 $i_unistd unistd.h"
13465 : The first arg can 'char *' or 'void *'
13466 : The second arg is some of integral type
13467 for xxx in in_addr_t 'const void *' 'const char *' 'void *' 'char *'; do
13468 for yyy in size_t long int; do
13469 case "$netdb_host_type" in
13470 '') try="extern struct hostent *gethostbyaddr($xxx, $yyy, int);"
13471 if ./protochk "$try" $hdrs; then
13472 echo "Your system accepts $xxx for the first arg."
13473 echo "...and $yyy for the second arg."
13474 netdb_host_type="$xxx"
13475 netdb_hlen_type="$yyy"
13481 : In case none of those worked, prompt the user.
13482 case "$netdb_host_type" in
13483 '') rp='What is the type for the 1st argument to gethostbyaddr?'
13486 netdb_host_type=$ans
13487 rp='What is the type for the 2nd argument to gethostbyaddr?'
13490 netdb_hlen_type=$ans
13494 *) : no gethostbyaddr, so pick harmless defaults
13495 netdb_host_type='char *'
13496 netdb_hlen_type="$sizetype"
13499 # Remove the "const" if needed. -- but then we'll have a
13501 # netdb_host_type=`echo "$netdb_host_type" | sed 's/^const //'`
13504 : check for type of argument to gethostbyname.
13505 if test "X$netdb_name_type" = X ; then
13506 case "$d_gethbyname" in
13510 Checking to see what type of argument is accepted by gethostbyname().
13512 hdrs="$define sys/types.h
13513 $d_socket sys/socket.h
13514 $i_niin netinet/in.h
13516 $i_unistd unistd.h"
13517 for xxx in "const char *" "char *"; do
13518 case "$netdb_name_type" in
13519 '') try="extern struct hostent *gethostbyname($xxx);"
13520 if ./protochk "$try" $hdrs; then
13521 echo "Your system accepts $xxx."
13522 netdb_name_type="$xxx"
13527 : In case none of those worked, prompt the user.
13528 case "$netdb_name_type" in
13529 '') rp='What is the type for the 1st argument to gethostbyname?'
13532 netdb_name_type=$ans
13536 *) : no gethostbyname, so pick harmless default
13537 netdb_name_type='char *'
13542 : check for type of 1st argument to getnetbyaddr.
13543 if test "X$netdb_net_type" = X ; then
13544 case "$d_getnbyaddr" in
13548 Checking to see what type of 1st argument is accepted by getnetbyaddr().
13550 hdrs="$define sys/types.h
13551 $d_socket sys/socket.h
13552 $i_niin netinet/in.h
13554 $i_unistd unistd.h"
13555 for xxx in in_addr_t "unsigned long" long "unsigned int" int; do
13556 case "$netdb_net_type" in
13557 '') try="extern struct netent *getnetbyaddr($xxx, int);"
13558 if ./protochk "$try" $hdrs; then
13559 echo "Your system accepts $xxx."
13560 netdb_net_type="$xxx"
13565 : In case none of those worked, prompt the user.
13566 case "$netdb_net_type" in
13567 '') rp='What is the type for the 1st argument to getnetbyaddr?'
13570 netdb_net_type=$ans
13574 *) : no getnetbyaddr, so pick harmless default
13575 netdb_net_type='long'
13579 : locate the preferred pager for this system
13593 '') dflt=/usr/ucb/more;;
13600 rp='What pager is used on your system?'
13604 : see what type pids are declared as in the kernel
13605 rp="What is the type of process ids on this system?"
13606 set pid_t pidtype int stdio.h sys/types.h
13609 : Find earliest binary compatible site_perl subdirectory perl can use.
13610 case "$bincompat5005" in
13611 "$define") xs_apiversion='5.005' ;;
13612 *) xs_apiversion=$version ;; # The current site_perl version.
13614 : Find earliest pure perl site_perl subdirectory perl can use.
13615 : The versioned directories started at 5.005.
13616 pm_apiversion='5.005'
13618 : check for length of pointer
13622 echo "Checking to see how big your pointers are..." >&4
13623 if test "$voidflags" -gt 7; then
13624 echo '#define VOID_PTR char *' > try.c
13626 echo '#define VOID_PTR void *' > try.c
13628 $cat >>try.c <<'EOCP'
13632 printf("%d\n", (int)sizeof(VOID_PTR));
13637 if eval $compile_ok; then
13639 echo "Your pointers are $ptrsize bytes long."
13642 echo "(I can't seem to compile the test program. Guessing...)" >&4
13643 rp="What is the size of a pointer (in bytes)?"
13651 : see if ar generates random libraries by itself
13653 echo "Checking how to generate random libraries on your machine..." >&4
13654 echo 'int bar1() { return bar2(); }' > bar1.c
13655 echo 'int bar2() { return 2; }' > bar2.c
13656 $cat > foo.c <<'EOP'
13657 int main() { printf("%d\n", bar1()); exit(0); }
13659 $cc $ccflags -c bar1.c >/dev/null 2>&1
13660 $cc $ccflags -c bar2.c >/dev/null 2>&1
13661 $cc $ccflags -c foo.c >/dev/null 2>&1
13662 $ar rc bar$_a bar2$_o bar1$_o >/dev/null 2>&1
13663 if $cc $ccflags $ldflags -o foobar foo$_o bar$_a $libs > /dev/null 2>&1 &&
13664 ./foobar >/dev/null 2>&1; then
13665 echo "$ar appears to generate random libraries itself."
13668 elif $ar ts bar$_a >/dev/null 2>&1 &&
13669 $cc $ccflags $ldflags -o foobar foo$_o bar$_a $libs > /dev/null 2>&1 &&
13670 ./foobar >/dev/null 2>&1; then
13671 echo "a table of contents needs to be added with '$ar ts'."
13678 ranlib=`./loc ranlib X /usr/bin /bin /usr/local/bin`
13679 $test -f $ranlib || ranlib=''
13682 if $test -n "$ranlib"; then
13683 echo "your system has '$ranlib'; we'll use that."
13686 echo "your system doesn't seem to support random libraries"
13687 echo "so we'll use lorder and tsort to order the libraries."
13694 : check for type of arguments to select.
13695 case "$selecttype" in
13696 '') case "$d_select" in
13700 Checking to see what type of arguments are accepted by select().
13702 hdrs="$define sys/types.h
13703 $i_systime sys/time.h
13704 $i_sysselct sys/select.h
13705 $d_socket sys/socket.h"
13706 : The first arg can be int, unsigned, or size_t
13707 : The last arg may or may not be 'const'
13709 : void pointer has been seen but using that
13710 : breaks the selectminbits test
13711 for xxx in 'fd_set *' 'int *'; do
13712 for nfd in 'int' 'size_t' 'unsigned long' 'unsigned' ; do
13713 for tmo in 'struct timeval *' 'const struct timeval *'; do
13715 '') try="extern select _(($nfd, $xxx, $xxx, $xxx, $tmo));"
13716 if ./protochk "$try" $hdrs; then
13717 echo "Your system accepts $xxx."
13726 '') rp='What is the type for the 2nd, 3rd, and 4th arguments to select?'
13727 case "$d_fd_set" in
13728 $define) dflt="fd_set *" ;;
13737 *) : no select, so pick a harmless default
13744 : check for the select 'width'
13745 case "$selectminbits" in
13746 '') case "$d_select" in
13750 Checking to see on how many bits at a time your select() operates...
13753 #include <sys/types.h>
13755 #$i_systime I_SYS_TIME
13756 #$i_systimek I_SYS_TIME_KERNEL
13761 # ifdef I_SYS_TIME_KERNEL
13764 # include <sys/time.h>
13765 # ifdef I_SYS_TIME_KERNEL
13769 #$i_sysselct I_SYS_SELECT
13770 #ifdef I_SYS_SELECT
13771 #include <sys/select.h>
13773 #$d_socket HAS_SOCKET
13775 # include <sys/socket.h> /* Might include <sys/bsdtypes.h> */
13779 #define S sizeof(*(b))
13781 #define NBYTES (S * 8 > MINBITS ? S : MINBITS/8)
13782 #define NBITS (NBYTES * 8)
13791 fp = fopen("try.c", "r");
13797 b = ($selecttype)s;
13798 for (i = 0; i < NBITS; i++)
13802 select(fd + 1, b, 0, 0, &t);
13803 for (i = NBITS - 1; i > fd && FD_ISSET(i, b); i--);
13804 printf("%d\n", i + 1);
13809 if eval $compile_ok; then
13810 selectminbits=`./try`
13811 case "$selectminbits" in
13813 Cannot figure out on how many bits at a time your select() operates.
13814 I'll play safe and guess it is 32 bits.
13820 *) bits="$selectminbits bits" ;;
13822 echo "Your select() operates on $bits at a time." >&4
13824 rp='What is the minimum number of bits your select() operates on?'
13825 case "$byteorder" in
13826 1234|12345678) dflt=32 ;;
13831 selectminbits="$val"
13835 *) : no select, so pick a harmless default
13842 : Trace out the files included by signal.h, then look for SIGxxx names.
13843 : Remove SIGARRAYSIZE used by HPUX.
13844 : Remove SIGSTKSIZE used by Linux.
13845 : Remove SIGSTKSZ used by Posix.
13846 : Remove SIGTYP void lines used by OS2.
13847 : Some cpps, like os390, dont give the file name anywhere
13848 if [ "X$fieldn" = X ]; then
13849 : Just make some guesses. We check them later.
13850 xxx='/usr/include/signal.h /usr/include/sys/signal.h'
13852 xxx=`echo '#include <signal.h>' |
13853 $cppstdin $cppminus $cppflags 2>/dev/null |
13854 $grep '^[ ]*#.*include' |
13855 $awk "{print \\$$fieldn}" | $sed 's!"!!g' | $sort | $uniq`
13857 : Check this list of files to be sure we have parsed the cpp output ok.
13858 : This will also avoid potentially non-existent files, such
13861 for xx in $xxx /dev/null ; do
13862 $test -f "$xx" && xxxfiles="$xxxfiles $xx"
13864 : If we have found no files, at least try signal.h
13865 case "$xxxfiles" in
13866 '') xxxfiles=`./findhdr signal.h` ;;
13869 $1 ~ /^#define$/ && $2 ~ /^SIG[A-Z0-9]*$/ && $2 !~ /SIGARRAYSIZE/ && $2 !~ /SIGSTKSIZE/ && $2 !~ /SIGSTKSZ/ && $3 !~ /void/ {
13870 print substr($2, 4, 20)
13872 $1 == "#" && $2 ~ /^define$/ && $3 ~ /^SIG[A-Z0-9]*$/ && $3 !~ /SIGARRAYSIZE/ && $4 !~ /void/ {
13873 print substr($3, 4, 20)
13875 : Append some common names just in case the awk scan failed.
13876 xxx="$xxx ABRT ALRM BUS CANCEL CHLD CLD CONT DIL EMT FPE"
13877 xxx="$xxx FREEZE HUP ILL INT IO IOT KILL LOST LWP PHONE"
13878 xxx="$xxx PIPE POLL PROF PWR QUIT RTMAX RTMIN SEGV STKFLT STOP"
13879 xxx="$xxx SYS TERM THAW TRAP TSTP TTIN TTOU URG USR1 USR2"
13880 xxx="$xxx USR3 USR4 VTALRM WAITING WINCH WIND WINDOW XCPU XFSZ"
13882 : generate a few handy files for later
13883 $cat > signal.c <<'EOCP'
13884 #include <sys/types.h>
13885 #include <signal.h>
13889 /* Strange style to avoid deeply-nested #if/#else/#endif */
13892 # define NSIG (_NSIG)
13898 # define NSIG (SIGMAX+1)
13904 # define NSIG (SIG_MAX+1)
13910 # define NSIG (MAXSIG+1)
13916 # define NSIG (MAX_SIG+1)
13921 # ifdef SIGARRAYSIZE
13922 # define NSIG (SIGARRAYSIZE+1) /* Not sure of the +1 */
13928 # define NSIG (_sys_nsig) /* Solaris 2.5 */
13932 /* Default to some arbitrary number that's big enough to get most
13933 of the common signals.
13939 printf("NSIG %d\n", NSIG);
13945 echo $xxx | $tr ' ' $trnl | $sort | $uniq | $awk '
13947 printf "#ifdef SIG"; printf $1; printf "\n"
13948 printf "printf(\""; printf $1; printf " %%d\\n\",SIG";
13949 printf $1; printf ");\n"
13953 printf "#endif /* JUST_NSIG */\n";
13954 printf "exit(0);\n}\n";
13957 $cat >signal.awk <<'EOP'
13958 BEGIN { ndups = 0 }
13959 $1 ~ /^NSIG$/ { nsig = $2 }
13960 ($1 !~ /^NSIG$/) && (NF == 2) {
13961 if ($2 > maxsig) { maxsig = $2 }
13962 if (sig_name[$2]) {
13963 dup_name[ndups] = $1
13964 dup_num[ndups] = $2
13976 printf("NSIG %d\n", nsig);
13977 for (n = 1; n < nsig; n++) {
13979 printf("%s %d\n", sig_name[n], sig_num[n])
13982 printf("NUM%d %d\n", n, n)
13985 for (n = 0; n < ndups; n++) {
13986 printf("%s %d\n", dup_name[n], dup_num[n])
13990 $cat >signal_cmd <<EOS
13992 if $test -s signal.lst; then
13993 echo "Using your existing signal.lst file"
13998 $cat >>signal_cmd <<'EOS'
14001 if eval $compile_ok; then
14002 ./signal$_exe | $sort -n +1 | $uniq | $awk -f signal.awk >signal.lst
14004 echo "(I can't seem be able to compile the whole test program)" >&4
14005 echo "(I'll try it in little pieces.)" >&4
14006 set signal -DJUST_NSIG
14007 if eval $compile_ok; then
14008 ./signal$_exe > signal.nsg
14011 echo "I can't seem to figure out how many signals you have." >&4
14012 echo "Guessing 50." >&4
14013 echo 'NSIG 50' > signal.nsg
14015 : Now look at all the signal names, one at a time.
14016 for xx in `echo $xxx | $tr ' ' $trnl | $sort | $uniq`; do
14017 $cat > signal.c <<EOCP
14018 #include <sys/types.h>
14019 #include <signal.h>
14022 printf("$xx %d\n", SIG${xx});
14027 if eval $compile; then
14028 echo "SIG${xx} found."
14029 ./signal$_exe >> signal.ls1
14031 echo "SIG${xx} NOT found."
14034 if $test -s signal.ls1; then
14035 $cat signal.nsg signal.ls1 |
14036 $sort -n +1 | $uniq | $awk -f signal.awk >signal.lst
14040 if $test -s signal.lst; then
14043 echo "(AAK! I can't compile the test programs -- Guessing)" >&4
14044 echo 'kill -l' >signal
14045 set X `csh -f <signal`
14049 0) set HUP INT QUIT ILL TRAP ABRT EMT FPE KILL BUS SEGV SYS PIPE ALRM TERM;;
14051 echo $@ | $tr ' ' $trnl | \
14052 $awk '{ printf "%s %d\n", $1, ++s; }
14053 END { printf "NSIG %d\n", ++s }' >signal.lst
14055 $rm -f signal.c signal$_exe signal$_o signal.nsg signal.ls1
14057 chmod a+x signal_cmd
14058 $eunicefix signal_cmd
14060 : generate list of signal names
14062 case "$sig_name_init" in
14064 *) case "$sig_num_init" in
14065 ''|*,*) doinit=yes ;;
14070 echo "Generating a list of signal names and numbers..." >&4
14072 sig_count=`$awk '/^NSIG/ { printf "%d", $2 }' signal.lst`
14073 sig_name=`$awk 'BEGIN { printf "ZERO " }
14074 !/^NSIG/ { printf "%s ", $1 }' signal.lst`
14075 sig_num=`$awk 'BEGIN { printf "0 " }
14076 !/^NSIG/ { printf "%d ", $2 }' signal.lst`
14077 sig_name_init=`$awk 'BEGIN { printf "\"ZERO\", " }
14078 !/^NSIG/ { printf "\"%s\", ", $1 }
14079 END { printf "0\n" }' signal.lst`
14080 sig_num_init=`$awk 'BEGIN { printf "0, " }
14081 !/^NSIG/ { printf "%d, ", $2}
14082 END { printf "0\n"}' signal.lst`
14085 echo "The following $sig_count signals are available:"
14087 echo $sig_name | $awk \
14088 'BEGIN { linelen = 0 }
14090 for (i = 1; i <= NF; i++) {
14091 name = "SIG" $i " "
14092 linelen = linelen + length(name)
14093 if (linelen > 70) {
14095 linelen = length(name)
14101 $rm -f signal signal.c signal.awk signal.lst signal_cmd
14104 case "$sizetype" in
14105 *_t) zzz="$sizetype" ;;
14106 *) zzz="filesize" ;;
14108 echo "Checking the size of $zzz..." >&4
14110 #include <sys/types.h>
14113 printf("%d\n", (int)sizeof($sizetype));
14118 if eval $compile_ok; then
14122 echo "(I can't execute the test program--guessing $sizesize.)" >&4
14125 echo "Your $zzz size is $sizesize bytes."
14130 echo "(I can't compile the test program--guessing $sizesize.)" >&4
14134 : check for socklen_t
14136 echo "Checking to see if you have socklen_t..." >&4
14138 #include <sys/types.h>
14139 #$d_socket HAS_SOCKET
14141 #include <sys/socket.h>
14143 int main() { socklen_t x = 16; }
14146 if eval $compile; then
14148 echo "You have socklen_t."
14151 echo "You do not have socklen_t."
14152 case "$sizetype" in
14153 size_t) echo "(You do have size_t, that might work. Some people are happy with just an int.)" ;;
14160 : check for type of the size argument to socket calls
14161 case "$d_socket" in
14165 Checking to see what type is the last argument of accept().
14167 hdrs="$define sys/types.h $d_socket sys/socket.h"
14169 case "$d_socklen_t" in
14170 "$define") yyy="$yyy socklen_t"
14172 yyy="$yyy $sizetype int long unsigned"
14173 for xxx in $yyy; do
14174 case "$socksizetype" in
14175 '') try="extern int accept(int, struct sockaddr *, $xxx *);"
14176 if ./protochk "$try" $hdrs; then
14177 echo "Your system accepts '$xxx *' for the last argument of accept()."
14178 socksizetype="$xxx"
14183 : In case none of those worked, prompt the user.
14184 case "$socksizetype" in
14185 '') rp='What is the type for socket address structure sizes?'
14192 *) : no sockets, so pick relatively harmless default
14197 : see what type is used for signed size_t
14198 set ssize_t ssizetype int stdio.h sys/types.h
14201 $cat > ssize.c <<EOM
14203 #include <sys/types.h>
14204 #define Size_t $sizetype
14205 #define SSize_t $dflt
14208 if (sizeof(Size_t) == sizeof(SSize_t))
14210 else if (sizeof(Size_t) == sizeof(int))
14219 if eval $compile_ok && ./ssize > /dev/null; then
14220 ssizetype=`./ssize`
14221 echo "I'll be using $ssizetype for functions returning a byte count." >&4
14224 Help! I can't compile and run the ssize_t test program: please enlighten me!
14225 (This is probably a misconfiguration in your system or libraries, and
14226 you really ought to fix it. Still, I'll try anyway.)
14228 I need a type that is the same size as $sizetype, but is guaranteed to
14229 be signed. Common values are ssize_t, int and long.
14232 rp="What signed type is the same size as $sizetype?"
14236 $rm -f ssize ssize.*
14238 : see what type of char stdio uses.
14240 if $contains 'unsigned.*char.*_ptr;' `./findhdr stdio.h` >/dev/null 2>&1 ; then
14241 echo "Your stdio uses unsigned chars." >&4
14242 stdchar="unsigned char"
14244 echo "Your stdio uses signed chars." >&4
14248 : see if time exists
14250 if test "X$d_time" = X -o X"$timetype" = X; then
14251 if set time val -f d_time; eval $csym; $val; then
14252 echo 'time() found.' >&4
14254 rp="What is the type returned by time() on this system?"
14255 set time_t timetype long stdio.h sys/types.h
14258 echo 'time() not found, hope that will do.' >&4
14266 : see what type uids are declared as in the kernel
14268 echo "Looking for the type for user ids returned by getuid()."
14269 set uid_t uidtype xxx stdio.h sys/types.h
14273 xxx=`./findhdr sys/user.h`
14274 set `grep '_ruid;' "$xxx" 2>/dev/null` unsigned short
14276 unsigned) dflt="$1 $2" ;;
14280 *) dflt="$uidtype";;
14283 uid_t) echo "uid_t found." ;;
14284 *) rp="What is the type for user ids returned by getuid()?"
14292 *_t) zzz="$uidtype" ;;
14295 echo "Checking the size of $zzz..." >&4
14297 #include <sys/types.h>
14300 printf("%d\n", (int)sizeof($uidtype));
14305 if eval $compile_ok; then
14309 echo "(I can't execute the test program--guessing $uidsize.)" >&4
14312 echo "Your $zzz is $uidsize bytes long."
14317 echo "(I can't compile the test program--guessing $uidsize.)" >&4
14322 *_t) zzz="$uidtype" ;;
14325 echo "Checking the sign of $zzz..." >&4
14327 #include <sys/types.h>
14338 if eval $compile; then
14342 echo "(I can't execute the test program--guessing unsigned.)" >&4
14346 1) echo "Your $zzz is unsigned." ;;
14347 -1) echo "Your $zzz is signed." ;;
14353 echo "(I can't compile the test program--guessing unsigned.)" >&4
14359 $echo "Checking the format string to be used for uids..." >&4
14362 -1) if $test X"$uidsize" = X"$ivsize"; then
14363 uidformat="$ivdformat"
14365 if $test X"$uidsize" = X"$longsize"; then
14368 if $test X"$uidsize" = X"$intsize"; then
14371 if $test X"$uidsize" = X"$shortsize"; then
14378 *) if $test X"$uidsize" = X"$uvsize"; then
14379 uidformat="$uvuformat"
14381 if $test X"$uidsize" = X"$longsize"; then
14384 if $test X"$uidsize" = X"$intsize"; then
14387 if $test X"$uidsize" = X"$shortsize"; then
14396 : see if dbm.h is available
14397 : see if dbmclose exists
14398 set dbmclose d_dbmclose
14401 case "$d_dbmclose" in
14411 *) set rpcsvc/dbm.h i_rpcsvcdbm
14416 *) echo "We won't be including <dbm.h>"
14426 : see if this is a sys/file.h system
14431 : do we need to include sys/file.h ?
14435 if $h_sysfile; then
14437 echo "We'll be including <sys/file.h>." >&4
14440 echo "We won't be including <sys/file.h>." >&4
14450 : see if fcntl.h is there
14455 : see if we can include fcntl.h
14461 echo "We'll be including <fcntl.h>." >&4
14464 if $h_sysfile; then
14465 echo "We don't need to include <fcntl.h> if we include <sys/file.h>." >&4
14467 echo "We won't be including <fcntl.h>." >&4
14479 : see if this is a iconv.h system
14480 set iconv.h i_iconv
14483 : see if this is a ieeefp.h system
14484 set ieeefp.h i_ieeefp
14487 : see if this is a libutil.h system
14488 set libutil.h i_libutil
14491 : see if locale.h is available
14492 set locale.h i_locale
14495 : see if mach cthreads are available
14496 if test "X$usethreads" = "X$define"; then
14497 set mach/cthreads.h i_machcthr
14500 i_machcthr="$undef"
14505 : see if this is a math.h system
14509 : see if this is a mntent.h system
14510 set mntent.h i_mntent
14513 : see if ndbm.h is available
14518 : see if dbm_open exists
14519 set dbm_open d_dbm_open
14521 case "$d_dbm_open" in
14524 echo "We won't be including <ndbm.h>"
14533 : see if net/errno.h is available
14535 set net/errno.h val
14538 : Unfortunately, it causes problems on some systems. Arrgh.
14541 cat > try.c <<'EOM'
14544 #include <net/errno.h>
14550 if $cc $ccflags -c try.c >/dev/null 2>&1; then
14551 echo "We'll be including <net/errno.h>." >&4
14553 echo "We won't be including <net/errno.h>." >&4
14562 : see if netinet/tcp.h is available
14563 set netinet/tcp.h i_netinettcp
14566 : see if this is a poll.h system
14570 : see if this is a prot.h system
14575 $echo "Guessing which symbols your C compiler and preprocessor define..." >&4
14576 $cat <<'EOSH' > Cppsym.know
14577 a29k ABI64 aegis AES_SOURCE AIX AIX32 AIX370
14578 AIX41 AIX42 AIX43 AIX_SOURCE aixpc ALL_SOURCE
14579 alliant alpha am29000 AM29000 amiga AMIGAOS AMIX
14580 ansi ANSI_C_SOURCE apollo ardent atarist att386 att3b BeOS
14581 BIG_ENDIAN BIT_MSF bsd BSD bsd43 bsd4_2 bsd4_3 BSD4_3 bsd4_4
14582 BSD_4_3 BSD_4_4 BSD_NET2 BSD_TIME BSD_TYPES BSDCOMPAT bsdi
14583 bull c cadmus clipper CMU COFF COMPILER_VERSION
14584 concurrent convex cpu cray CRAY CRAYMPP ctix CX_UX
14585 CYGWIN DGUX DGUX_SOURCE DJGPP dmert DOLPHIN DPX2 DSO
14586 Dynix DynixPTX ELF encore EPI EXTENSIONS FILE_OFFSET_BITS
14587 FreeBSD GCC_NEW_VARARGS gcos gcx gimpel
14588 GNU_SOURCE GNUC GNUC_MINOR GO32 gould GOULD_PN
14589 H3050R H3050RX hbullx20 hcx host_mips
14590 hp200 hp300 hp700 HP700 hp800 hp9000
14591 hp9000s200 hp9000s300 hp9000s400 hp9000s500
14592 hp9000s700 hp9000s800 hp9k8 hp_osf hppa hpux HPUX_SOURCE
14593 i186 i286 i386 i486 i586 i686 i8086 i80960 i860 I960
14594 iAPX286 ibm ibm032 ibmesa IBMR2 ibmrt ILP32 ILP64
14595 INLINE_INTRINSICS INTRINSICS INT64 interdata is68k ksr1
14596 LANGUAGE_C LARGE_FILE_API LARGEFILE64_SOURCE
14597 LARGEFILE_SOURCE LFS64_LARGEFILE LFS_LARGEFILE
14598 Linux LITTLE_ENDIAN LONG64 LONG_DOUBLE LONG_LONG
14599 LONGDOUBLE LONGLONG LP64 luna luna88k Lynx
14600 M68000 m68k m88100 m88k M88KBCS_TARGET M_COFF
14601 M_I186 M_I286 M_I386 M_I8086 M_I86 M_I86SM M_SYS3
14602 M_SYS5 M_SYSIII M_SYSV M_UNIX M_XENIX MACH machine MachTen
14603 MATH_HAS_NO_SIDE_EFFECTS
14604 mc300 mc500 mc68000 mc68010 mc68020 mc68030 mc68040
14605 mc68060 mc68k mc68k32 mc700 mc88000 mc88100 merlin
14606 mert MiNT mips MIPS_FPSET MIPS_ISA MIPS_SIM MIPS_SZINT
14607 MIPS_SZLONG MIPS_SZPTR MIPSEB MIPSEL MODERN_C motorola
14608 mpeix MSDOS MTXINU MULTIMAX mvs MVS n16 ncl_el ncl_mr
14609 NetBSD news1500 news1700 news1800 news1900 news3700
14610 news700 news800 news900 NeXT NLS ns16000 ns32000
14611 ns32016 ns32332 ns32k nsc32000
14612 OCS88 OEMVS OpenBSD os OS2 OS390 osf OSF1 OSF_SOURCE
14613 pa_risc PA_RISC1_1 PA_RISC2_0 PARAGON parisc
14614 pc532 pdp11 PGC PIC plexus PORTAR posix
14615 POSIX1B_SOURCE POSIX2_SOURCE POSIX4_SOURCE
14616 POSIX_C_SOURCE POSIX_SOURCE POWER
14617 PROTOTYPES PWB pyr QNX R3000 REENTRANT RES Rhapsody RISC6000
14618 riscix riscos RT scs SCO sequent sgi SGI_SOURCE sinix
14619 SIZE_INT SIZE_LONG SIZE_PTR SOCKET_SOURCE SOCKETS_SOURCE
14620 sony sony_news sonyrisc sparc sparclite spectrum
14621 stardent stdc STDC_EXT stratos sun sun3 sun386
14622 Sun386i svr3 svr4 SVR4_2 SVR4_SOURCE svr5
14623 SX system SYSTYPE_BSD SYSTYPE_BSD43 SYSTYPE_BSD44
14624 SYSTYPE_SVR4 SYSTYPE_SVR5 SYSTYPE_SYSV SYSV SYSV3 SYSV4 SYSV5
14625 sysV68 sysV88 Tek4132 Tek4300 titan
14626 tower tower32 tower32_200 tower32_600 tower32_700
14627 tower32_800 tower32_850 tss
14628 u370 u3b u3b2 u3b20 u3b200 u3b20d u3b5
14629 ultrix UMAXV UnicomPBB UnicomPBD UNICOS UNICOSMK
14630 unix UNIX95 UNIX99 unixpc unos USGr4 USGr4_2
14631 Utek UTek UTS UWIN uxpm uxps vax venix VMESA vms xenix Xenix286
14632 XOPEN_SOURCE XOPEN_SOURCE_EXTENDED XPG2 XPG2_EXTENDED
14633 XPG3 XPG3_EXTENDED XPG4 XPG4_EXTENDED
14636 # Maybe put other stuff here too.
14637 cat <<EOSH >>Cppsym.know
14640 ./tr '[a-z]' '[A-Z]' < Cppsym.know > Cppsym.a
14641 ./tr '[A-Z]' '[a-z]' < Cppsym.know > Cppsym.b
14642 $cat Cppsym.know > Cppsym.c
14643 $cat Cppsym.a Cppsym.b Cppsym.c | $tr ' ' $trnl | sort | uniq > Cppsym.know
14644 $rm -f Cppsym.a Cppsym.b Cppsym.c
14645 cat <<EOSH > Cppsym
14647 if $test \$# -gt 0; then
14648 echo \$* | $tr " " "$trnl" | ./Cppsym.try > Cppsym.got
14649 if $test -s Cppsym.got; then
14656 $tr " " "$trnl" | ./Cppsym.try
14662 cat <<EOSH > Cppsym.try
14664 cat <<'EOCP' > try.c
14670 cat <<'EOSH' >> Cppsym.try
14672 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
14673 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
14674 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
14675 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
14679 cat <<EOSH >> Cppsym.try
14681 case "$osname-$gccversion" in
14682 irix-) ccflags="\$ccflags -woff 1178" ;;
14683 os2-*) ccflags="\$ccflags -Zlinker /PM:VIO" ;;
14685 $cc $optimize \$ccflags $ldflags -o try try.c $libs && ./try$exe_ext
14687 chmod +x Cppsym.try
14688 $eunicefix Cppsym.try
14689 ./Cppsym < Cppsym.know > Cppsym.true
14690 : now check the C compiler for additional symbols
14691 postprocess_cc_v=''
14693 aix) postprocess_cc_v="|$tr , ' '" ;;
14700 for i in \`$cc -v -c tmp.c 2>&1 $postprocess_cc_v\`
14703 -D*) echo "\$i" | $sed 's/^-D//';;
14704 -A*) $test "$gccversion" && echo "\$i" | $sed 's/^-A\(.*\)(\(.*\))/\1=\2/';;
14709 postprocess_cc_v=''
14712 ./ccsym > ccsym1.raw
14713 if $test -s ccsym1.raw; then
14714 $sort ccsym1.raw | $uniq >ccsym.raw
14716 mv ccsym1.raw ccsym.raw
14719 $awk '/\=/ { print $0; next }
14720 { print $0"=1" }' ccsym.raw >ccsym.list
14721 $awk '/\=/ { print $0; next }
14722 { print $0"=1" }' Cppsym.true >ccsym.true
14723 $comm -13 ccsym.true ccsym.list >ccsym.own
14724 $comm -12 ccsym.true ccsym.list >ccsym.com
14725 $comm -23 ccsym.true ccsym.list >ccsym.cpp
14727 if $test -z ccsym.raw; then
14728 echo "Your C compiler doesn't seem to define any symbols!" >&4
14730 echo "However, your C preprocessor defines the following symbols:"
14733 cppsymbols=`$cat Cppsym.true`
14734 cppsymbols=`echo $cppsymbols`
14735 cppccsymbols="$cppsymbols"
14737 if $test -s ccsym.com; then
14738 echo "Your C compiler and pre-processor define these symbols:"
14739 $sed -e 's/\(..*\)=.*/\1/' ccsym.com
14742 cppccsymbols=`$cat ccsym.com`
14743 cppccsymbols=`echo $cppccsymbols`
14744 $test "$silent" || sleep 1
14746 if $test -s ccsym.cpp; then
14747 $test "$also" && echo " "
14748 echo "Your C pre-processor ${also}defines the following symbols:"
14749 $sed -e 's/\(..*\)=.*/\1/' ccsym.cpp
14751 cppsymbols=`$cat ccsym.cpp`
14752 cppsymbols=`echo $cppsymbols`
14753 $test "$silent" || sleep 1
14755 if $test -s ccsym.own; then
14756 $test "$also" && echo " "
14757 echo "Your C compiler ${also}defines the following cpp symbols:"
14758 $sed -e 's/\(..*\)=1/\1/' ccsym.own
14759 $sed -e 's/\(..*\)=.*/\1/' ccsym.own | $uniq >>Cppsym.true
14760 ccsymbols=`$cat ccsym.own`
14761 ccsymbols=`echo $ccsymbols`
14762 $test "$silent" || sleep 1
14765 $rm -f ccsym* Cppsym.*
14767 : see if this is a termio system
14771 if $test `./findhdr termios.h`; then
14772 set tcsetattr i_termios
14778 "$define") echo "You have POSIX termios.h... good!" >&4;;
14779 *) if ./Cppsym pyr; then
14780 case "`/bin/universe`" in
14781 ucb) if $test `./findhdr sgtty.h`; then
14783 echo "<sgtty.h> found." >&4
14785 echo "System is pyramid with BSD universe."
14786 echo "<sgtty.h> not found--you could have problems." >&4
14788 *) if $test `./findhdr termio.h`; then
14790 echo "<termio.h> found." >&4
14792 echo "System is pyramid with USG universe."
14793 echo "<termio.h> not found--you could have problems." >&4
14797 if $test `./findhdr termio.h`; then
14798 echo "<termio.h> found." >&4
14800 elif $test `./findhdr sgtty.h`; then
14801 echo "<sgtty.h> found." >&4
14804 echo "Neither <termio.h> nor <sgtty.h> found--you could have problems." >&4
14807 if $test `./findhdr sgtty.h`; then
14808 echo "<sgtty.h> found." >&4
14810 elif $test `./findhdr termio.h`; then
14811 echo "<termio.h> found." >&4
14814 echo "Neither <sgtty.h> nor <termio.h> found--you could have problems." >&4
14818 set i_termio; eval $setvar
14819 val=$val2; set i_sgtty; eval $setvar
14820 val=$val3; set i_termios; eval $setvar
14822 : see if this is a shadow.h system
14823 set shadow.h i_shadow
14826 : see if this is a socks.h system
14827 set socks.h i_socks
14830 : see if stdarg is available
14832 if $test `./findhdr stdarg.h`; then
14833 echo "<stdarg.h> found." >&4
14836 echo "<stdarg.h> NOT found." >&4
14840 : see if varags is available
14842 if $test `./findhdr varargs.h`; then
14843 echo "<varargs.h> found." >&4
14845 echo "<varargs.h> NOT found, but that's ok (I hope)." >&4
14848 : set up the varargs testing programs
14849 $cat > varargs.c <<EOP
14851 #include <stdarg.h>
14854 #include <varargs.h>
14858 int f(char *p, ...)
14872 p = va_arg(ap, char *);
14877 $cat > varargs <<EOP
14879 if $cc -c $ccflags -D\$1 varargs.c >/dev/null 2>&1; then
14888 : now check which varargs header should be included
14893 if `./varargs I_STDARG`; then
14895 elif `./varargs I_VARARGS`; then
14900 if `./varargs I_VARARGS`; then
14907 echo "I could not find the definition for va_dcl... You have problems..." >&4
14908 val="$undef"; set i_stdarg; eval $setvar
14909 val="$undef"; set i_varargs; eval $setvar
14914 case "$i_varhdr" in
14916 val="$define"; set i_stdarg; eval $setvar
14917 val="$undef"; set i_varargs; eval $setvar
14920 val="$undef"; set i_stdarg; eval $setvar
14921 val="$define"; set i_varargs; eval $setvar
14924 echo "We'll include <$i_varhdr> to get va_dcl definition." >&4;;
14928 : see if stddef is available
14929 set stddef.h i_stddef
14932 : see if this is a sunmath.h system
14933 set sunmath.h i_sunmath
14936 : see if sys/access.h is available
14937 set sys/access.h i_sysaccess
14940 : see if ioctl defs are in sgtty, termio, sys/filio or sys/ioctl
14941 set sys/filio.h i_sysfilio
14944 if $test `./findhdr sys/ioctl.h`; then
14946 echo '<sys/ioctl.h> found.' >&4
14949 if $test $i_sysfilio = "$define"; then
14950 echo '<sys/ioctl.h> NOT found.' >&4
14952 $test $i_sgtty = "$define" && xxx="sgtty.h"
14953 $test $i_termio = "$define" && xxx="termio.h"
14954 $test $i_termios = "$define" && xxx="termios.h"
14955 echo "No <sys/ioctl.h> found, assuming ioctl args are defined in <$xxx>." >&4
14962 : see if this is a syslog.h system
14963 set syslog.h i_syslog
14967 : see if this is a sys/mode.h system
14968 set sys/mode.h i_sysmode
14971 : see if sys/resource.h has to be included
14972 set sys/resource.h i_sysresrc
14975 : see if sys/security.h is available
14976 set sys/security.h i_syssecrt
14979 : see if this is a sys/statvfs.h system
14980 set sys/statvfs.h i_sysstatvfs
14983 : see if this is a sys/uio.h system
14984 set sys/uio.h i_sysuio
14987 : see if this is a sys/un.h system
14988 set sys/un.h i_sysun
14992 : see if this is a sys/utsname.h system
14993 set sys/utsname.h i_sysutsname
14996 : see if this is a syswait system
14997 set sys/wait.h i_syswait
15000 : see if this is a ustat.h system
15001 set ustat.h i_ustat
15004 : see if this is an utime system
15005 set utime.h i_utime
15008 : see if this is a values.h system
15009 set values.h i_values
15012 : see if this is a vfork system
15015 set vfork.h i_vfork
15023 : see if gdbm.h is available
15028 : see if gdbm_open exists
15029 set gdbm_open d_gdbm_open
15031 case "$d_gdbm_open" in
15034 echo "We won't be including <gdbm.h>"
15044 echo "Looking for extensions..." >&4
15045 : If we are using the old config.sh, known_extensions may contain
15046 : old or inaccurate or duplicate values.
15047 known_extensions=''
15048 nonxs_extensions=''
15049 : We do not use find because it might not be available.
15050 : We do not just use MANIFEST because the user may have dropped
15051 : some additional extensions into the source tree and expect them
15054 : Function to recursively find available extensions, ignoring DynaLoader
15055 : NOTE: recursion limit of 10 to prevent runaway in case of symlink madness
15059 DynaLoader|dynaload) ;;
15061 if $test -f $xxx/$xxx.xs; then
15062 known_extensions="$known_extensions $1$xxx";
15063 elif $test -f $xxx/Makefile.PL; then
15064 nonxs_extensions="$nonxs_extensions $1$xxx";
15066 if $test -d $xxx -a $# -lt 10; then
15069 eval $find_extensions;
15081 eval $find_extensions
15082 set X $nonxs_extensions
15084 nonxs_extensions="$*"
15085 set X $known_extensions
15087 known_extensions="$*"
15090 : Now see which are supported on this system.
15092 for xxx in $known_extensions ; do
15096 $define) avail_ext="$avail_ext $xxx" ;;
15099 GDBM_File|gdbm_fil)
15101 $define) avail_ext="$avail_ext $xxx" ;;
15104 NDBM_File|ndbm_fil)
15107 case "$osname-$use64bitint" in
15110 *-lndbm*) avail_ext="$avail_ext $xxx" ;;
15113 *) avail_ext="$avail_ext $xxx" ;;
15118 ODBM_File|odbm_fil)
15119 case "${i_dbm}${i_rpcsvcdbm}" in
15121 case "$osname-$use64bitint" in
15124 *-ldbm*) avail_ext="$avail_ext $xxx" ;;
15127 *) avail_ext="$avail_ext $xxx" ;;
15133 case "$useposix" in
15134 true|define|y) avail_ext="$avail_ext $xxx" ;;
15138 case "$useopcode" in
15139 true|define|y) avail_ext="$avail_ext $xxx" ;;
15143 case "$d_socket" in
15144 true|$define|y) avail_ext="$avail_ext $xxx" ;;
15147 Sys/Syslog|sys/syslog)
15148 : XXX syslog requires socket
15149 case "$d_socket" in
15150 true|$define|y) avail_ext="$avail_ext $xxx" ;;
15154 case "$usethreads" in
15155 true|$define|y) avail_ext="$avail_ext $xxx" ;;
15159 : XXX Do we need a useipcsysv variable here
15160 case "${d_msg}${d_sem}${d_shm}" in
15161 *"${define}"*) avail_ext="$avail_ext $xxx" ;;
15164 *) avail_ext="$avail_ext $xxx"
15173 : Now see which nonxs extensions are supported on this system.
15174 : For now assume all are.
15176 for xxx in $nonxs_extensions ; do
15178 *) nonxs_ext="$nonxs_ext $xxx"
15190 A number of extensions are supplied with $package. You may choose to
15191 compile these extensions for dynamic loading (the default), compile
15192 them into the $package executable (static loading), or not include
15193 them at all. Answer "none" to include no extensions.
15194 Note that DynaLoader is always built and need not be mentioned here.
15197 case "$dynamic_ext" in
15198 '') dflt="$avail_ext" ;;
15199 *) dflt="$dynamic_ext"
15200 # Perhaps we are reusing an old out-of-date config.sh.
15203 if test X"$dynamic_ext" != X"$avail_ext"; then
15205 NOTICE: Your previous config.sh list may be incorrect.
15206 The extensions now available to you are
15208 but the default list from your previous config.sh is
15220 rp="What extensions do you wish to load dynamically?"
15223 none) dynamic_ext=' ' ;;
15224 *) dynamic_ext="$ans" ;;
15227 case "$static_ext" in
15229 : Exclude those already listed in dynamic linking
15231 for xxx in $avail_ext; do
15232 case " $dynamic_ext " in
15234 *) dflt="$dflt $xxx" ;;
15241 *) dflt="$static_ext"
15248 rp="What extensions do you wish to load statically?"
15251 none) static_ext=' ' ;;
15252 *) static_ext="$ans" ;;
15257 A number of extensions are supplied with $package. Answer "none"
15258 to include no extensions.
15259 Note that DynaLoader is always built and need not be mentioned here.
15262 case "$static_ext" in
15263 '') dflt="$avail_ext" ;;
15264 *) dflt="$static_ext"
15265 # Perhaps we are reusing an old out-of-date config.sh.
15268 if test X"$static_ext" != X"$avail_ext"; then
15270 NOTICE: Your previous config.sh list may be incorrect.
15271 The extensions now available to you are
15273 but the default list from your previous config.sh is
15282 : Exclude those that are not xs extensions
15286 rp="What extensions do you wish to include?"
15289 none) static_ext=' ' ;;
15290 *) static_ext="$ans" ;;
15295 set X $dynamic_ext $static_ext $nonxs_ext
15299 : Remove build directory name from cppstdin so it can be used from
15300 : either the present location or the final installed location.
15302 : Get out of the UU directory to get correct path name.
15304 case "$cppstdin" in
15306 echo "Stripping down cppstdin path name"
15312 : end of configuration questions
15314 echo "End of configuration questions."
15317 : back to where it started
15318 if test -d ../UU; then
15322 : configuration may be patched via a 'config.over' file
15323 if $test -f config.over; then
15326 rp='I see a config.over file. Do you wish to load it?'
15329 n*) echo "OK, I'll ignore it.";;
15331 echo "Configuration override changes have been loaded."
15336 : in case they want portability, strip down executable paths
15337 case "$d_portable" in
15340 echo "Stripping down executable paths..." >&4
15341 for file in $loclist $trylist; do
15343 eval $file=`basename $temp`
15348 : create config.sh file
15350 echo "Creating config.sh..." >&4
15351 $spitshell <<EOT >config.sh
15354 # This file was produced by running the Configure script. It holds all the
15355 # definitions figured out by Configure. Should you modify one of these values,
15356 # do not forget to propagate your changes by running "Configure -der". You may
15357 # instead choose to run each of the .SH files by yourself, or "Configure -S".
15360 # Package name : $package
15361 # Source directory : $src
15362 # Configuration time: $cf_time
15363 # Configured by : $cf_by
15364 # Target system : $myuname
15374 Revision='$Revision'
15381 alignbytes='$alignbytes'
15382 ansi2knr='$ansi2knr'
15383 aphostname='$aphostname'
15384 api_revision='$api_revision'
15385 api_subversion='$api_subversion'
15386 api_version='$api_version'
15387 api_versionstring='$api_versionstring'
15390 archlibexp='$archlibexp'
15391 archname64='$archname64'
15392 archname='$archname'
15393 archobjs='$archobjs'
15398 bincompat5005='$bincompat5005'
15402 byteorder='$byteorder'
15404 castflags='$castflags'
15407 cccdlflags='$cccdlflags'
15408 ccdlflags='$ccdlflags'
15410 ccflags_uselargefiles='$ccflags_uselargefiles'
15412 ccsymbols='$ccsymbols'
15414 cf_email='$cf_email'
15416 charsize='$charsize'
15420 clocktype='$clocktype'
15422 compress='$compress'
15423 contains='$contains'
15427 cpp_stuff='$cpp_stuff'
15428 cppccsymbols='$cppccsymbols'
15429 cppflags='$cppflags'
15431 cppminus='$cppminus'
15433 cppstdin='$cppstdin'
15434 cppsymbols='$cppsymbols'
15435 crosscompile='$crosscompile'
15436 cryptlib='$cryptlib'
15438 d_Gconvert='$d_Gconvert'
15439 d_PRIEldbl='$d_PRIEldbl'
15440 d_PRIFldbl='$d_PRIFldbl'
15441 d_PRIGldbl='$d_PRIGldbl'
15442 d_PRIX64='$d_PRIX64'
15443 d_PRId64='$d_PRId64'
15444 d_PRIeldbl='$d_PRIeldbl'
15445 d_PRIfldbl='$d_PRIfldbl'
15446 d_PRIgldbl='$d_PRIgldbl'
15447 d_PRIi64='$d_PRIi64'
15448 d_PRIo64='$d_PRIo64'
15449 d_PRIu64='$d_PRIu64'
15450 d_PRIx64='$d_PRIx64'
15451 d_access='$d_access'
15452 d_accessx='$d_accessx'
15454 d_archlib='$d_archlib'
15457 d_attribut='$d_attribut'
15460 d_bincompat5005='$d_bincompat5005'
15462 d_bsdgetpgrp='$d_bsdgetpgrp'
15463 d_bsdsetpgrp='$d_bsdsetpgrp'
15465 d_casti32='$d_casti32'
15466 d_castneg='$d_castneg'
15467 d_charvspr='$d_charvspr'
15469 d_chroot='$d_chroot'
15470 d_chsize='$d_chsize'
15471 d_closedir='$d_closedir'
15475 d_cuserid='$d_cuserid'
15476 d_dbl_dig='$d_dbl_dig'
15477 d_difftime='$d_difftime'
15478 d_dirnamlen='$d_dirnamlen'
15479 d_dlerror='$d_dlerror'
15480 d_dlopen='$d_dlopen'
15481 d_dlsymun='$d_dlsymun'
15482 d_dosuid='$d_dosuid'
15483 d_drand48proto='$d_drand48proto'
15485 d_eaccess='$d_eaccess'
15486 d_endgrent='$d_endgrent'
15487 d_endhent='$d_endhent'
15488 d_endnent='$d_endnent'
15489 d_endpent='$d_endpent'
15490 d_endpwent='$d_endpwent'
15491 d_endsent='$d_endsent'
15492 d_eofnblk='$d_eofnblk'
15493 d_eunice='$d_eunice'
15494 d_fchmod='$d_fchmod'
15495 d_fchown='$d_fchown'
15497 d_fd_macros='$d_fd_macros'
15498 d_fd_set='$d_fd_set'
15499 d_fds_bits='$d_fds_bits'
15500 d_fgetpos='$d_fgetpos'
15501 d_flexfnam='$d_flexfnam'
15504 d_fpathconf='$d_fpathconf'
15505 d_fpos64_t='$d_fpos64_t'
15506 d_frexpl='$d_frexpl'
15507 d_fs_data_s='$d_fs_data_s'
15508 d_fseeko='$d_fseeko'
15509 d_fsetpos='$d_fsetpos'
15510 d_fstatfs='$d_fstatfs'
15511 d_fstatvfs='$d_fstatvfs'
15512 d_ftello='$d_ftello'
15514 d_getcwd='$d_getcwd'
15515 d_getespwnam='$d_getespwnam'
15516 d_getfsstat='$d_getfsstat'
15517 d_getgrent='$d_getgrent'
15518 d_getgrps='$d_getgrps'
15519 d_gethbyaddr='$d_gethbyaddr'
15520 d_gethbyname='$d_gethbyname'
15521 d_gethent='$d_gethent'
15522 d_gethname='$d_gethname'
15523 d_gethostprotos='$d_gethostprotos'
15524 d_getlogin='$d_getlogin'
15525 d_getmnt='$d_getmnt'
15526 d_getmntent='$d_getmntent'
15527 d_getnbyaddr='$d_getnbyaddr'
15528 d_getnbyname='$d_getnbyname'
15529 d_getnent='$d_getnent'
15530 d_getnetprotos='$d_getnetprotos'
15531 d_getpbyname='$d_getpbyname'
15532 d_getpbynumber='$d_getpbynumber'
15533 d_getpent='$d_getpent'
15534 d_getpgid='$d_getpgid'
15535 d_getpgrp2='$d_getpgrp2'
15536 d_getpgrp='$d_getpgrp'
15537 d_getppid='$d_getppid'
15538 d_getprior='$d_getprior'
15539 d_getprotoprotos='$d_getprotoprotos'
15540 d_getprpwnam='$d_getprpwnam'
15541 d_getpwent='$d_getpwent'
15542 d_getsbyname='$d_getsbyname'
15543 d_getsbyport='$d_getsbyport'
15544 d_getsent='$d_getsent'
15545 d_getservprotos='$d_getservprotos'
15546 d_getspnam='$d_getspnam'
15547 d_gettimeod='$d_gettimeod'
15548 d_gnulibc='$d_gnulibc'
15549 d_grpasswd='$d_grpasswd'
15550 d_hasmntopt='$d_hasmntopt'
15554 d_inetaton='$d_inetaton'
15555 d_int64_t='$d_int64_t'
15556 d_isascii='$d_isascii'
15558 d_isnanl='$d_isnanl'
15559 d_killpg='$d_killpg'
15560 d_lchown='$d_lchown'
15561 d_ldbl_dig='$d_ldbl_dig'
15563 d_locconv='$d_locconv'
15565 d_longdbl='$d_longdbl'
15566 d_longlong='$d_longlong'
15567 d_lseekproto='$d_lseekproto'
15569 d_madvise='$d_madvise'
15571 d_mbstowcs='$d_mbstowcs'
15572 d_mbtowc='$d_mbtowc'
15573 d_memchr='$d_memchr'
15574 d_memcmp='$d_memcmp'
15575 d_memcpy='$d_memcpy'
15576 d_memmove='$d_memmove'
15577 d_memset='$d_memset'
15579 d_mkdtemp='$d_mkdtemp'
15580 d_mkfifo='$d_mkfifo'
15581 d_mkstemp='$d_mkstemp'
15582 d_mkstemps='$d_mkstemps'
15583 d_mktime='$d_mktime'
15586 d_mprotect='$d_mprotect'
15588 d_msg_ctrunc='$d_msg_ctrunc'
15589 d_msg_dontroute='$d_msg_dontroute'
15590 d_msg_oob='$d_msg_oob'
15591 d_msg_peek='$d_msg_peek'
15592 d_msg_proxy='$d_msg_proxy'
15593 d_msgctl='$d_msgctl'
15594 d_msgget='$d_msgget'
15595 d_msgrcv='$d_msgrcv'
15596 d_msgsnd='$d_msgsnd'
15598 d_munmap='$d_munmap'
15599 d_mymalloc='$d_mymalloc'
15601 d_nv_preserves_uv='$d_nv_preserves_uv'
15602 d_nv_preserves_uv_bits='$d_nv_preserves_uv_bits'
15603 d_off64_t='$d_off64_t'
15604 d_old_pthread_create_joinable='$d_old_pthread_create_joinable'
15605 d_oldpthreads='$d_oldpthreads'
15606 d_oldsock='$d_oldsock'
15608 d_pathconf='$d_pathconf'
15610 d_perl_otherlibdirs='$d_perl_otherlibdirs'
15611 d_phostname='$d_phostname'
15614 d_portable='$d_portable'
15615 d_pthread_yield='$d_pthread_yield'
15617 d_pwchange='$d_pwchange'
15618 d_pwclass='$d_pwclass'
15619 d_pwcomment='$d_pwcomment'
15620 d_pwexpire='$d_pwexpire'
15621 d_pwgecos='$d_pwgecos'
15622 d_pwpasswd='$d_pwpasswd'
15623 d_pwquota='$d_pwquota'
15626 d_readdir='$d_readdir'
15627 d_readlink='$d_readlink'
15628 d_rename='$d_rename'
15629 d_rewinddir='$d_rewinddir'
15631 d_safebcpy='$d_safebcpy'
15632 d_safemcpy='$d_safemcpy'
15633 d_sanemcmp='$d_sanemcmp'
15634 d_sched_yield='$d_sched_yield'
15635 d_scm_rights='$d_scm_rights'
15636 d_seekdir='$d_seekdir'
15637 d_select='$d_select'
15639 d_semctl='$d_semctl'
15640 d_semctl_semid_ds='$d_semctl_semid_ds'
15641 d_semctl_semun='$d_semctl_semun'
15642 d_semget='$d_semget'
15644 d_setegid='$d_setegid'
15645 d_seteuid='$d_seteuid'
15646 d_setgrent='$d_setgrent'
15647 d_setgrps='$d_setgrps'
15648 d_sethent='$d_sethent'
15649 d_setlinebuf='$d_setlinebuf'
15650 d_setlocale='$d_setlocale'
15651 d_setnent='$d_setnent'
15652 d_setpent='$d_setpent'
15653 d_setpgid='$d_setpgid'
15654 d_setpgrp2='$d_setpgrp2'
15655 d_setpgrp='$d_setpgrp'
15656 d_setprior='$d_setprior'
15657 d_setproctitle='$d_setproctitle'
15658 d_setpwent='$d_setpwent'
15659 d_setregid='$d_setregid'
15660 d_setresgid='$d_setresgid'
15661 d_setresuid='$d_setresuid'
15662 d_setreuid='$d_setreuid'
15663 d_setrgid='$d_setrgid'
15664 d_setruid='$d_setruid'
15665 d_setsent='$d_setsent'
15666 d_setsid='$d_setsid'
15667 d_setvbuf='$d_setvbuf'
15671 d_shmatprototype='$d_shmatprototype'
15672 d_shmctl='$d_shmctl'
15674 d_shmget='$d_shmget'
15675 d_sigaction='$d_sigaction'
15676 d_sigsetjmp='$d_sigsetjmp'
15677 d_socket='$d_socket'
15678 d_socklen_t='$d_socklen_t'
15679 d_sockpair='$d_sockpair'
15680 d_socks5_init='$d_socks5_init'
15682 d_statblks='$d_statblks'
15683 d_statfs_f_flags='$d_statfs_f_flags'
15684 d_statfs_s='$d_statfs_s'
15685 d_statvfs='$d_statvfs'
15686 d_stdio_cnt_lval='$d_stdio_cnt_lval'
15687 d_stdio_ptr_lval='$d_stdio_ptr_lval'
15688 d_stdio_stream_array='$d_stdio_stream_array'
15689 d_stdiobase='$d_stdiobase'
15690 d_stdstdio='$d_stdstdio'
15691 d_strchr='$d_strchr'
15692 d_strcoll='$d_strcoll'
15693 d_strctcpy='$d_strctcpy'
15694 d_strerrm='$d_strerrm'
15695 d_strerror='$d_strerror'
15696 d_strtod='$d_strtod'
15697 d_strtol='$d_strtol'
15698 d_strtold='$d_strtold'
15699 d_strtoll='$d_strtoll'
15700 d_strtoul='$d_strtoul'
15701 d_strtoull='$d_strtoull'
15702 d_strtouq='$d_strtouq'
15703 d_strxfrm='$d_strxfrm'
15704 d_suidsafe='$d_suidsafe'
15705 d_symlink='$d_symlink'
15706 d_syscall='$d_syscall'
15707 d_sysconf='$d_sysconf'
15708 d_sysernlst='$d_sysernlst'
15709 d_syserrlst='$d_syserrlst'
15710 d_system='$d_system'
15711 d_tcgetpgrp='$d_tcgetpgrp'
15712 d_tcsetpgrp='$d_tcsetpgrp'
15713 d_telldir='$d_telldir'
15714 d_telldirproto='$d_telldirproto'
15717 d_truncate='$d_truncate'
15718 d_tzname='$d_tzname'
15721 d_union_semun='$d_union_semun'
15723 d_vendorarch='$d_vendorarch'
15724 d_vendorbin='$d_vendorbin'
15725 d_vendorlib='$d_vendorlib'
15727 d_void_closedir='$d_void_closedir'
15728 d_voidsig='$d_voidsig'
15729 d_voidtty='$d_voidtty'
15730 d_volatile='$d_volatile'
15731 d_vprintf='$d_vprintf'
15733 d_waitpid='$d_waitpid'
15734 d_wcstombs='$d_wcstombs'
15735 d_wctomb='$d_wctomb'
15738 db_hashtype='$db_hashtype'
15739 db_prefixtype='$db_prefixtype'
15740 defvoidused='$defvoidused'
15741 direntrytype='$direntrytype'
15744 doublesize='$doublesize'
15746 dynamic_ext='$dynamic_ext'
15752 eunicefix='$eunicefix'
15755 extensions='$extensions'
15756 fflushNULL='$fflushNULL'
15757 fflushall='$fflushall'
15759 firstmakefile='$firstmakefile'
15761 fpossize='$fpossize'
15762 fpostype='$fpostype'
15763 freetype='$freetype'
15765 full_csh='$full_csh'
15766 full_sed='$full_sed'
15767 gccosandvers='$gccosandvers'
15768 gccversion='$gccversion'
15769 gidformat='$gidformat'
15775 groupcat='$groupcat'
15776 groupstype='$groupstype'
15779 h_sysfile='$h_sysfile'
15791 i_arpainet='$i_arpainet'
15792 i_bsdioctl='$i_bsdioctl'
15795 i_dirent='$i_dirent'
15803 i_ieeefp='$i_ieeefp'
15804 i_inttypes='$i_inttypes'
15805 i_libutil='$i_libutil'
15806 i_limits='$i_limits'
15807 i_locale='$i_locale'
15808 i_machcthr='$i_machcthr'
15809 i_malloc='$i_malloc'
15811 i_memory='$i_memory'
15812 i_mntent='$i_mntent'
15815 i_neterrno='$i_neterrno'
15816 i_netinettcp='$i_netinettcp'
15820 i_pthread='$i_pthread'
15822 i_rpcsvcdbm='$i_rpcsvcdbm'
15825 i_shadow='$i_shadow'
15827 i_stdarg='$i_stdarg'
15828 i_stddef='$i_stddef'
15829 i_stdlib='$i_stdlib'
15830 i_string='$i_string'
15831 i_sunmath='$i_sunmath'
15832 i_sysaccess='$i_sysaccess'
15833 i_sysdir='$i_sysdir'
15834 i_sysfile='$i_sysfile'
15835 i_sysfilio='$i_sysfilio'
15837 i_sysioctl='$i_sysioctl'
15838 i_syslog='$i_syslog'
15839 i_sysmman='$i_sysmman'
15840 i_sysmode='$i_sysmode'
15841 i_sysmount='$i_sysmount'
15842 i_sysndir='$i_sysndir'
15843 i_sysparam='$i_sysparam'
15844 i_sysresrc='$i_sysresrc'
15845 i_syssecrt='$i_syssecrt'
15846 i_sysselct='$i_sysselct'
15847 i_syssockio='$i_syssockio'
15848 i_sysstat='$i_sysstat'
15849 i_sysstatfs='$i_sysstatfs'
15850 i_sysstatvfs='$i_sysstatvfs'
15851 i_systime='$i_systime'
15852 i_systimek='$i_systimek'
15853 i_systimes='$i_systimes'
15854 i_systypes='$i_systypes'
15855 i_sysuio='$i_sysuio'
15857 i_sysutsname='$i_sysutsname'
15858 i_sysvfs='$i_sysvfs'
15859 i_syswait='$i_syswait'
15860 i_termio='$i_termio'
15861 i_termios='$i_termios'
15863 i_unistd='$i_unistd'
15866 i_values='$i_values'
15867 i_varargs='$i_varargs'
15868 i_varhdr='$i_varhdr'
15870 ignore_versioned_solibs='$ignore_versioned_solibs'
15871 inc_version_list='$inc_version_list'
15872 inc_version_list_init='$inc_version_list_init'
15875 installarchlib='$installarchlib'
15876 installbin='$installbin'
15877 installman1dir='$installman1dir'
15878 installman3dir='$installman3dir'
15879 installprefix='$installprefix'
15880 installprefixexp='$installprefixexp'
15881 installprivlib='$installprivlib'
15882 installscript='$installscript'
15883 installsitearch='$installsitearch'
15884 installsitebin='$installsitebin'
15885 installsitelib='$installsitelib'
15886 installstyle='$installstyle'
15887 installusrbinperl='$installusrbinperl'
15888 installvendorarch='$installvendorarch'
15889 installvendorbin='$installvendorbin'
15890 installvendorlib='$installvendorlib'
15892 ivdformat='$ivdformat'
15895 known_extensions='$known_extensions'
15899 lddlflags='$lddlflags'
15901 ldflags_uselargefiles='$ldflags_uselargefiles'
15902 ldlibpthname='$ldlibpthname'
15909 libsdirs='$libsdirs'
15910 libsfiles='$libsfiles'
15911 libsfound='$libsfound'
15912 libspath='$libspath'
15913 libswanted='$libswanted'
15914 libswanted_uselargefiles='$libswanted_uselargefiles'
15920 locincpth='$locincpth'
15921 loclibpth='$loclibpth'
15922 longdblsize='$longdblsize'
15923 longlongsize='$longlongsize'
15924 longsize='$longsize'
15928 lseeksize='$lseeksize'
15929 lseektype='$lseektype'
15933 make_set_make='$make_set_make'
15934 mallocobj='$mallocobj'
15935 mallocsrc='$mallocsrc'
15936 malloctype='$malloctype'
15938 man1direxp='$man1direxp'
15941 man3direxp='$man3direxp'
15944 mips_type='$mips_type'
15946 mmaptype='$mmaptype'
15948 modetype='$modetype'
15950 multiarch='$multiarch'
15952 myarchname='$myarchname'
15953 mydomain='$mydomain'
15954 myhostname='$myhostname'
15957 netdb_hlen_type='$netdb_hlen_type'
15958 netdb_host_type='$netdb_host_type'
15959 netdb_name_type='$netdb_name_type'
15960 netdb_net_type='$netdb_net_type'
15963 nm_so_opt='$nm_so_opt'
15964 nonxs_ext='$nonxs_ext'
15966 nvEformat='$nvEformat'
15967 nvFformat='$nvFformat'
15968 nvGformat='$nvGformat'
15969 nveformat='$nveformat'
15970 nvfformat='$nvfformat'
15971 nvgformat='$nvgformat'
15974 o_nonblock='$o_nonblock'
15976 old_pthread_create_joinable='$old_pthread_create_joinable'
15977 optimize='$optimize'
15978 orderlib='$orderlib'
15981 otherlibdirs='$otherlibdirs'
15985 patchlevel='$patchlevel'
15986 path_sep='$path_sep'
15989 perladmin='$perladmin'
15990 perlpath='$perlpath'
15992 phostname='$phostname'
15995 pm_apiversion='$pm_apiversion'
15999 prefixexp='$prefixexp'
16001 privlibexp='$privlibexp'
16002 prototype='$prototype'
16004 quadkind='$quadkind'
16005 quadtype='$quadtype'
16006 randbits='$randbits'
16007 randfunc='$randfunc'
16008 randseedtype='$randseedtype'
16010 rd_nodata='$rd_nodata'
16011 revision='$revision'
16015 sPRIEldbl='$sPRIEldbl'
16016 sPRIFldbl='$sPRIFldbl'
16017 sPRIGldbl='$sPRIGldbl'
16020 sPRIeldbl='$sPRIeldbl'
16021 sPRIfldbl='$sPRIfldbl'
16022 sPRIgldbl='$sPRIgldbl'
16027 sched_yield='$sched_yield'
16028 scriptdir='$scriptdir'
16029 scriptdirexp='$scriptdirexp'
16031 seedfunc='$seedfunc'
16032 selectminbits='$selectminbits'
16033 selecttype='$selecttype'
16034 sendmail='$sendmail'
16037 sharpbang='$sharpbang'
16038 shmattype='$shmattype'
16039 shortsize='$shortsize'
16042 sig_count='$sig_count'
16043 sig_name='$sig_name'
16044 sig_name_init='$sig_name_init'
16046 sig_num_init='$sig_num_init'
16047 signal_t='$signal_t'
16048 sitearch='$sitearch'
16049 sitearchexp='$sitearchexp'
16051 sitebinexp='$sitebinexp'
16053 sitelib_stem='$sitelib_stem'
16054 sitelibexp='$sitelibexp'
16055 siteprefix='$siteprefix'
16056 siteprefixexp='$siteprefixexp'
16057 sizesize='$sizesize'
16058 sizetype='$sizetype'
16063 sockethdr='$sockethdr'
16064 socketlib='$socketlib'
16065 socksizetype='$socksizetype'
16067 spackage='$spackage'
16068 spitshell='$spitshell'
16071 ssizetype='$ssizetype'
16072 startperl='$startperl'
16074 static_ext='$static_ext'
16076 stdio_base='$stdio_base'
16077 stdio_bufsiz='$stdio_bufsiz'
16078 stdio_cnt='$stdio_cnt'
16079 stdio_filbuf='$stdio_filbuf'
16080 stdio_ptr='$stdio_ptr'
16081 stdio_stream_array='$stdio_stream_array'
16084 subversion='$subversion'
16091 timeincl='$timeincl'
16092 timetype='$timetype'
16105 uidformat='$uidformat'
16111 uquadtype='$uquadtype'
16112 use5005threads='$use5005threads'
16113 use64bitall='$use64bitall'
16114 use64bitint='$use64bitint'
16116 useithreads='$useithreads'
16117 uselargefiles='$uselargefiles'
16118 uselongdouble='$uselongdouble'
16119 usemorebits='$usemorebits'
16120 usemultiplicity='$usemultiplicity'
16121 usemymalloc='$usemymalloc'
16123 useopcode='$useopcode'
16124 useperlio='$useperlio'
16125 useposix='$useposix'
16127 useshrplib='$useshrplib'
16128 usesocks='$usesocks'
16129 usethreads='$usethreads'
16130 usevendorprefix='$usevendorprefix'
16131 usevfork='$usevfork'
16134 uvXformat='$uvXformat'
16135 uvoformat='$uvoformat'
16138 uvuformat='$uvuformat'
16139 uvxformat='$uvxformat'
16140 vendorarch='$vendorarch'
16141 vendorarchexp='$vendorarchexp'
16142 vendorbin='$vendorbin'
16143 vendorbinexp='$vendorbinexp'
16144 vendorlib='$vendorlib'
16145 vendorlib_stem='$vendorlib_stem'
16146 vendorlibexp='$vendorlibexp'
16147 vendorprefix='$vendorprefix'
16148 vendorprefixexp='$vendorprefixexp'
16151 voidflags='$voidflags'
16153 xs_apiversion='$xs_apiversion'
16158 : Add in command line options if available
16159 $test -f UU/cmdline.opt && $cat UU/cmdline.opt >> config.sh
16161 : add special variables
16162 $test -f $src/patchlevel.h && \
16163 awk '/^#define[ ]+PERL_/ {printf "%s=%s\n",$2,$3}' $src/patchlevel.h >>config.sh
16164 echo "CONFIGDOTSH=true" >>config.sh
16166 : propagate old symbols
16167 if $test -f UU/config.sh; then
16168 <UU/config.sh sort | uniq >UU/oldconfig.sh
16169 sed -n 's/^\([a-zA-Z_0-9]*\)=.*/\1/p' config.sh config.sh UU/oldconfig.sh |\
16170 sort | uniq -u >UU/oldsyms
16171 set X `cat UU/oldsyms`
16177 Hmm...You had some extra variables I don't know about...I'll try to keep 'em...
16179 echo "# Variables propagated from previous config.sh file." >>config.sh
16180 for sym in `cat UU/oldsyms`; do
16181 echo " Propagating $hint variable "'$'"$sym..."
16182 eval 'tmp="$'"${sym}"'"'
16184 sed -e "s/'/'\"'\"'/g" -e "s/^/$sym='/" -e "s/$/'/" >>config.sh
16190 : Finish up by extracting the .SH files
16204 If you'd like to make any changes to the config.sh file before I begin
16205 to configure things, do it as a shell escape now (e.g. !vi config.sh).
16208 rp="Press return or use a shell escape to edit config.sh:"
16213 *) : in case they cannot read
16214 sh 1>&4 -c "$ans";;
16219 : if this fails, just run all the .SH files by hand
16226 if $contains '^depend:' [Mm]akefile >/dev/null 2>&1; then
16233 Now you need to generate make dependencies by running "$make depend".
16234 You might prefer to run it in background: "$make depend > makedepend.out &"
16235 It can take a while, so you might not want to run it right now.
16240 rp="Run $make depend now?"
16244 $make depend && echo "Now you must run a $make."
16247 echo "You must run '$make depend' then '$make'."
16250 elif test -f [Mm]akefile; then
16252 echo "Now you must run a $make."
16257 if $test -f Policy.sh; then
16260 If you compile $package on a different machine or from a different object
16261 directory, copy the Policy.sh file from this object directory to the
16262 new one before you run Configure -- this will help you with most of
16263 the policy defaults.
16267 if $test -f config.msg; then
16268 echo "Hmm. I also noted the following information while running:"
16270 $cat config.msg >&4
16273 $rm -f kit*isdone ark*isdone