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 16:44:38 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.
979 : Possible local include directories to search.
980 : Set locincpth to "" in a hint file to defeat local include searches.
981 locincpth="/usr/local/include /opt/local/include /usr/gnu/include"
982 locincpth="$locincpth /opt/gnu/include /usr/GNU/include /opt/GNU/include"
984 : no include file wanted by default
988 : change the next line if compiling for Xenix/286 on Xenix/386
989 xlibpth='/usr/lib/386 /lib/386'
990 : Possible local library directories to search.
991 loclibpth="/usr/local/lib /opt/local/lib /usr/gnu/lib"
992 loclibpth="$loclibpth /opt/gnu/lib /usr/GNU/lib /opt/GNU/lib"
994 : general looking path for locating libraries
995 glibpth="/usr/lib/large /lib /usr/lib $xlibpth"
996 glibpth="$glibpth /lib/large /usr/lib/small /lib/small"
997 glibpth="$glibpth /usr/ccs/lib /usr/ucblib /usr/local/lib"
998 test -f /usr/shlib/libc.so && glibpth="/usr/shlib $glibpth"
999 test -f /shlib/libc.so && glibpth="/shlib $glibpth"
1001 : Private path used by Configure to find libraries. Its value
1002 : is prepended to libpth. This variable takes care of special
1003 : machines, like the mips. Usually, it should be empty.
1006 : default library list
1008 : some systems want to use only the non-versioned libso:s
1009 ignore_versioned_solibs=''
1011 ccflags_uselargefiles=''
1012 ldflags_uselargefiles=''
1013 libswanted_uselargefiles=''
1014 : set usemultiplicity on the Configure command line to enable multiplicity.
1015 : set usesocks on the Configure command line to enable socks.
1016 : set usethreads on the Configure command line to enable threads.
1017 : full support for void wanted by default
1020 : List of libraries we want.
1021 : If anyone needs -lnet, put it in a hint file.
1022 libswanted='sfio socket bind inet nsl nm ndbm gdbm dbm db malloc dl'
1023 libswanted="$libswanted dld ld sun m c cposix posix"
1024 libswanted="$libswanted ndir dir crypt sec"
1025 libswanted="$libswanted ucb bsd BSD PW x iconv util"
1026 : We probably want to search /usr/shlib before most other libraries.
1027 : This is only used by the lib/ExtUtils/MakeMaker.pm routine extliblist.
1028 glibpth=`echo " $glibpth " | sed -e 's! /usr/shlib ! !'`
1029 glibpth="/usr/shlib $glibpth"
1030 : Do not use vfork unless overridden by a hint file.
1033 : Find the basic shell for Bourne shell scripts
1037 *bsd*|sys5*) xxx="/$SYSTYPE/bin/sh";;
1040 if test -f "$xxx"; then
1043 : Build up a list and do a single loop so we can 'break' out.
1044 pth=`echo $PATH | sed -e "s/$p_/ /g"`
1045 for xxx in sh bash ksh pdksh ash; do
1047 try="$try ${p}/${xxx}"
1051 if test -f "$xxx"; then
1054 elif test -f "$xxx.exe"; then
1065 $me: Fatal Error: I can't find a Bourne Shell anywhere.
1067 Usually it's in /bin/sh. How did you even get this far?
1068 Please contact me (Perl Maintainers) at perlbug@perl.org and
1069 we'll try to straighten this all out.
1075 : see if sh knows # comments
1076 if `$sh -c '#' >/dev/null 2>&1`; then
1080 test -f $xcat || xcat=/usr/bin/cat
1085 if test -s today; then
1088 echo "#! $xcat" > try
1092 if test -s today; then
1100 echo "Your $sh doesn't grok # comments--I will strip them later on."
1103 echo "exec grep -v '^[ ]*#'" >spitshell
1105 $eunicefix spitshell
1106 spitshell=`pwd`/spitshell
1108 echo "I presume that if # doesn't work, #! won't work either!"
1113 : figure out how to guarantee sh startup
1115 '') startsh=${sharpbang}${sh} ;;
1127 : echo "Yup, it does."
1129 echo "Hmm... '$startsh' does not guarantee sh startup..."
1130 echo "You may have to fix up the shell scripts to make sure $sh runs them."
1135 : Save command line options in file UU/cmdline.opt for later use in
1136 : generating config.sh.
1137 cat > cmdline.opt <<EOSH
1138 # Configure command line arguments.
1145 cat >>cmdline.opt <<EOSH
1146 config_arg$argn='$arg'
1148 argn=`expr $argn + 1`
1151 : produce awk script to parse command line options
1152 cat >options.awk <<'EOF'
1154 optstr = "A:dD:eEf:hKOrsSU:V"; # getopt-style specification
1156 len = length(optstr);
1157 for (i = 1; i <= len; i++) {
1158 c = substr(optstr, i, 1);
1159 if (i < len) a = substr(optstr, i + 1, 1); else a = "";
1170 if (substr(str, 1, 1) != "-") {
1171 printf("'%s'\n", str);
1175 for (i = 2; i <= len; i++) {
1176 c = substr(str, i, 1);
1178 printf("-%s\n", substr(str, i));
1184 printf("'%s'\n", substr(str, i + 1));
1197 : process the command line options
1198 set X `for arg in "$@"; do echo "X$arg"; done |
1199 sed -e s/X// | awk -f options.awk`
1204 : set up default values
1214 rm -f optdef.sh posthint.sh
1215 cat >optdef.sh <<EOS
1221 while test $# -gt 0; do
1223 -d) shift; fastread=yes;;
1224 -e) shift; alldone=cont;;
1228 if test -r "$1"; then
1231 echo "$me: cannot read config file $1." >&2
1236 -h) shift; error=true;;
1237 -r) shift; reuseval=true;;
1238 -s) shift; silent=true; realsilent=true;;
1239 -E) shift; alldone=exit;;
1240 -K) shift; knowitall=true;;
1241 -O) shift; override=true;;
1242 -S) shift; silent=true; extractsh=true;;
1247 echo "$me: use '-U symbol=', not '-D symbol='." >&2
1248 echo "$me: ignoring -D $1" >&2
1251 sed -e "s/'/'\"'\"'/g" -e "s/=\(.*\)/='\1'/" >> optdef.sh;;
1252 *) echo "$1='define'" >> optdef.sh;;
1259 *=) echo "$1" >> optdef.sh;;
1261 echo "$me: use '-D symbol=val', not '-U symbol=val'." >&2
1262 echo "$me: ignoring -U $1" >&2
1264 *) echo "$1='undef'" >> optdef.sh;;
1275 *=*) zzz=`echo $yyy|sed 's!=.*!!'`
1279 zzz=" "`echo $yyy|sed 's!^[^=]*=!!'`
1280 yyy=`echo $yyy|sed 's!=.*!!'` ;;
1286 *:*) xxx=`echo $yyy|sed 's!:.*!!'`
1287 yyy=`echo $yyy|sed 's!^[^:]*:!!'`
1288 zzz=`echo $yyy|sed 's!^[^=]*=!!'`
1289 yyy=`echo $yyy|sed 's!=.*!!'` ;;
1290 *) xxx=`echo $yyy|sed 's!:.*!!'`
1291 yyy=`echo $yyy|sed 's!^[^:]*:!!'` ;;
1297 echo "$yyy=\"\${$yyy}$zzz\"" >> posthint.sh ;;
1299 echo "$yyy=''" >> posthint.sh ;;
1304 echo "$yyy='$zzz'" >> posthint.sh ;;
1306 echo "eval \"$yyy=$zzz\"" >> posthint.sh ;;
1308 echo "$yyy=\"$zzz\${$yyy}\"" >> posthint.sh ;;
1313 echo "$yyy=$zzz" >> posthint.sh ;;
1314 *) echo "$me: unknown -A command '$xxx', ignoring -A $1" >&2 ;;
1318 -V) echo "$me generated by metaconfig 3.0 PL70." >&2
1321 -*) echo "$me: unknown option $1" >&2; shift; error=true;;
1329 Usage: $me [-dehrsEKOSV] [-f config.sh] [-D symbol] [-D symbol=value]
1330 [-U symbol] [-U symbol=] [-A command:symbol...]
1331 -d : use defaults for all answers.
1332 -e : go on without questioning past the production of config.sh.
1333 -f : specify an alternate default configuration file.
1334 -h : print this help message and exit (with an error status).
1335 -r : reuse C symbols value if possible (skips costly nm extraction).
1336 -s : silent mode, only echoes questions and essential information.
1337 -D : define symbol to have some value:
1338 -D symbol symbol gets the value 'define'
1339 -D symbol=value symbol gets the value 'value'
1340 -E : stop at the end of questions, after having produced config.sh.
1341 -K : do not use unless you know what you are doing.
1342 -O : let -D and -U override definitions from loaded configuration file.
1343 -S : perform variable substitutions on all .SH files (can mix with -f)
1344 -U : undefine symbol:
1345 -U symbol symbol gets the value 'undef'
1346 -U symbol= symbol gets completely empty
1347 -A : manipulate symbol after the platform specific hints have been applied:
1348 -A symbol=value append " "value to symbol
1349 -A append:symbol=value append value to symbol
1350 -A define:symbol=value define symbol to have value
1351 -A clear:symbol define symbol to be ''
1352 -A define:symbol define symbol to be 'define'
1353 -A eval:symbol=value define symbol to be eval of value
1354 -A prepend:symbol=value prepend value to symbol
1355 -A undef:symbol define symbol to be 'undef'
1356 -A undef:symbol= define symbol to be ''
1357 -V : print version number and exit (with a zero status).
1364 case "$fastread$alldone" in
1367 case "$extractsh" in
1370 if test ! -t 0; then
1371 echo "Say 'sh Configure', not 'sh <Configure'"
1381 true) exec 1>/dev/null;;
1384 : run the defines and the undefines, if any, but leave the file out there...
1387 : create the posthint manipulation script and leave the file out there...
1392 first=`echo $package | sed -e 's/^\(.\).*/\1/'`
1393 last=`echo $package | sed -e 's/^.\(.*\)/\1/'`
1394 case "`echo AbyZ | tr '[:lower:]' '[:upper:]' 2>/dev/null`" in
1395 ABYZ) spackage=`echo $first | tr '[:lower:]' '[:upper:]'`$last;;
1396 *) spackage=`echo $first | tr '[a-z]' '[A-Z]'`$last;;
1399 : Some greps do not return status, grrr.
1400 echo "grimblepritz" >grimble
1401 if grep blurfldyick grimble >/dev/null 2>&1 ; then
1403 elif grep grimblepritz grimble >/dev/null 2>&1 ; then
1409 : the following should work in any shell
1413 echo "AGH! Grep doesn't return a status. Attempting remedial action."
1414 cat >contains <<'EOSS'
1415 grep "$1" "$2" >.greptmp && cat .greptmp && test -s .greptmp
1420 : Find the path to the source tree
1423 */*) src=`echo $0 | sed -e 's%/[^/][^/]*$%%'`
1426 *) src=`cd ../$src && pwd` ;;
1439 if test -f $rsrc/Configure && \
1440 $contains "^package=$package$" $rsrc/Configure >/dev/null 2>&1
1442 : found it, so we are ok.
1445 for src in . .. ../.. ../../.. ../../../..; do
1446 if test -f ../$src/Configure && \
1447 $contains "^package=$package$" ../$src/Configure >/dev/null 2>&1
1458 Sorry, I can't seem to locate the source dir for $package. Please start
1459 Configure with an explicit path -- i.e. /some/path/Configure.
1467 echo "Sources for $package found in \"$src\"." >&4
1471 : script used to extract .SH files with variable substitutions
1472 cat >extract <<'EOS'
1474 echo "Doing variable substitutions on .SH files..."
1475 if test -f $src/MANIFEST; then
1476 set x `awk '{print $1}' <$src/MANIFEST | grep '\.SH$'`
1478 echo "(Looking for .SH files under the source directory.)"
1479 set x `(cd $src; find . -name "*.SH" -print)`
1483 0) set x `(cd $src; echo *.SH)`; shift;;
1485 if test ! -f $src/$1; then
1491 while test $name; do
1492 if test ! -d "$name"; then
1493 create="$name $create";
1494 name=`echo $name | sed -e "s|^[^/]*$||"`;
1495 name=`echo $name | sed -e "s|\(.*\)/.*|\1|"`;
1500 for file in $create; do
1509 dir=`expr X$file : 'X\(.*\)/'`
1510 file=`expr X$file : 'X.*/\(.*\)'`
1511 (cd $dir && . ./$file)
1521 dir=`expr X$file : 'X\(.*\)/'`
1522 file=`expr X$file : 'X.*/\(.*\)'`
1523 (set x $dir; shift; eval $mkdir_p)
1533 if test -f $src/config_h.SH; then
1534 if test ! -f config.h; then
1535 : oops, they left it out of MANIFEST, probably, so do it anyway.
1541 : extract files and exit if asked to do so
1542 case "$extractsh" in
1544 case "$realsilent" in
1548 case "$config_sh" in
1549 '') config_sh='config.sh';;
1552 echo "Fetching answers from $config_sh..."
1555 test "$override" && . ./optdef.sh
1564 : Eunice requires " " instead of "", can you believe it
1567 echo "Beginning of configuration questions for $package."
1569 trap 'echo " "; test -d ../UU && rm -rf X $rmlist; exit 1' 1 2 3 15
1571 : first determine how to suppress newline on echo command
1573 echo "Checking echo to see how to suppress newlines..."
1574 (echo "hi there\c" ; echo " ") >.echotmp
1575 if $contains c .echotmp >/dev/null 2>&1 ; then
1586 echo $n "The star should be here-->$c"
1590 : Now test for existence of everything in MANIFEST
1592 if test -f $rsrc/MANIFEST; then
1593 echo "First let's make sure your kit is complete. Checking..." >&4
1594 awk '$1 !~ /PACK[A-Z]+/ {print $1}' $rsrc/MANIFEST | split -50
1597 for filelist in x??; do
1598 (cd $rsrc; ls `cat $tmppwd/$filelist` >/dev/null 2>>$tmppwd/missing)
1600 if test -s missing; then
1604 THIS PACKAGE SEEMS TO BE INCOMPLETE.
1606 You have the option of continuing the configuration process, despite the
1607 distinct possibility that your kit is damaged, by typing 'y'es. If you
1608 do, don't blame me if something goes wrong. I advise you to type 'n'o
1609 and contact the author (perlbug@perl.org).
1612 echo $n "Continue? [n] $c" >&4
1616 echo "Continuing..." >&4
1620 echo "ABORTING..." >&4
1625 echo "Looks good..."
1628 echo "There is no MANIFEST file. I hope your kit is complete !"
1633 : Find the appropriate value for a newline for tr
1634 if test -n "$DJGPP"; then
1637 if test X"$trnl" = X; then
1638 case "`echo foo|tr '\n' x 2>/dev/null`" in
1642 if test X"$trnl" = X; then
1643 case "`echo foo|tr '\012' x 2>/dev/null`" in
1644 foox) trnl='\012' ;;
1647 if test X"$trnl" = X; then
1650 $me: Fatal Error: cannot figure out how to translate newlines with 'tr'.
1656 : compute the number of columns on the terminal for proper question formatting
1661 : set up the echo used in my read
1662 myecho="case \"\$xxxm\" in
1663 '') echo $n \"\$rp $c\" >&4;;
1665 '') echo $n \"[\$xxxm] $c\";;
1667 if test \`echo \"\$rp [\$xxxm] \" | wc -c\` -ge $COLUMNS; then
1669 echo $n \"[\$xxxm] $c\" >&4
1671 echo $n \"\$rp [\$xxxm] $c\" >&4
1677 : now set up to do reads with possible shell escape and default assignment
1683 case "\$fastread" in
1684 yes) case "\$dflt" in
1687 case "\$silent-\$rp" in
1692 *) case "\$silent" in
1693 true) case "\$rp" in
1698 while expr "X\$ans" : "X!" >/dev/null; do
1702 aok=''; eval "ans=\\"\$answ\\"" && aok=y
1710 set x \`expr "X\$ans" : "X!\(.*\)\$"\`
1719 set x \`expr "X\$ans" : "X&\(.*\)\$"\`
1724 echo "(OK, I'll run with -d after this question.)" >&4
1727 echo "*** Sorry, \$1 not supported yet." >&4
1737 echo "*** Substitution done -- please confirm."
1739 ans=\`echo $n "\$ans$c" | tr '$trnl' ' '\`
1744 echo "*** Error -- try again."
1751 case "\$ans\$xxxm\$nostick" in
1763 : create .config dir to save info across Configure sessions
1764 test -d ../.config || mkdir ../.config
1765 cat >../.config/README <<EOF
1766 This directory created by Configure to save information that should
1767 persist across sessions for $package.
1769 You may safely delete it if you wish.
1772 xversion=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
1774 $define|true|[yY]*) ;;
1775 *) case "$xversion" in
1778 *** WHOA THERE!!! ***
1780 This is an UNSTABLE DEVELOPMENT release.
1781 The version of this $package distribution is $xversion, that is, odd,
1782 (as opposed to even) and that signifies a development release.
1783 If you want a maintenance release, you want an even-numbered version.)
1785 Do ***NOT*** install this into production use.
1786 Data corruption and crashes are possible.
1788 It is most seriously suggested that you do not continue any further
1789 unless you want to help in developing and debugging Perl.
1792 rp='Do you really want to continue?'
1796 [yY]) echo >&4 "Okay, continuing." ;;
1797 *) echo >&4 "Okay, bye."
1806 : general instructions
1809 user=`(logname) 2>/dev/null`
1811 '') user=`whoami 2>&1`;;
1813 if $contains "^$user\$" ../.config/instruct >/dev/null 2>&1; then
1816 rp='Would you like to see the instructions?'
1827 This installation shell script will examine your system and ask you questions
1828 to determine how the perl5 package should be installed. If you get
1829 stuck on a question, you may use a ! shell escape to start a subshell or
1830 execute a command. Many of the questions will have default answers in square
1831 brackets; typing carriage return will give you the default.
1833 On some of the questions which ask for file or directory names you are allowed
1834 to use the ~name construct to specify the login directory belonging to "name",
1835 even if you don't have a shell which knows about that. Questions where this is
1836 allowed will be marked "(~name ok)".
1840 dflt='Type carriage return to continue'
1844 The prompter used in this script allows you to use shell variables and
1845 backticks in your answers. You may use $1, $2, etc... to refer to the words
1846 in the default answer, as if the default line was a set of arguments given to a
1847 script shell. This means you may also use $* to repeat the whole default line,
1848 so you do not have to re-type everything to add something to the default.
1850 Everytime there is a substitution, you will have to confirm. If there is an
1851 error (e.g. an unmatched backtick), the default answer will remain unchanged
1852 and you will be prompted again.
1854 If you are in a hurry, you may run 'Configure -d'. This will bypass nearly all
1855 the questions and use the computed defaults (or the previous answers if there
1856 was already a config.sh file). Type 'Configure -h' for a list of options.
1857 You may also start interactively and then answer '& -d' at any prompt to turn
1858 on the non-interactive behaviour for the remainder of the execution.
1864 Much effort has been expended to ensure that this shell script will run on any
1865 Unix system. If despite that it blows up on yours, your best bet is to edit
1866 Configure and run it again. If you can't run Configure for some reason,
1867 you'll have to generate a config.sh file by hand. Whatever problems you
1868 have, let me (perlbug@perl.org) know how I blew it.
1870 This installation script affects things in two ways:
1872 1) it may do direct variable substitutions on some of the files included
1874 2) it builds a config.h file for inclusion in C programs. You may edit
1875 any of these files as the need arises after running this script.
1877 If you make a mistake on a question, there is no easy way to back up to it
1878 currently. The easiest thing to do is to edit config.sh and rerun all the SH
1879 files. Configure will offer to let you do this before it runs the SH files.
1882 dflt='Type carriage return to continue'
1884 case "$firsttime" in
1885 true) echo $user >>../.config/instruct;;
1889 : find out where common programs are
1891 echo "Locating common programs..." >&4
1904 if test -d \$dir/\$thing; then
1910 for thisthing in \$dir/\$thing; do
1911 : just loop through to pick last item
1913 if test -f \$thisthing; then
1916 elif test -f \$dir/\$thing.exe; then
1917 if test -n "$DJGPP"; then
1918 echo \$dir/\$thing.exe
1920 : on Eunice apparently
1970 pth=`echo $PATH | sed -e "s/$p_/ /g"`
1971 pth="$pth /lib /usr/lib"
1972 for file in $loclist; do
1976 if test -f "$xxx"; then
1979 echo "WARNING: no $xxx -- ignoring your setting for $file." >&4
1980 xxx=`./loc $file $file $pth`
1983 '') xxx=`./loc $file $file $pth`;;
1984 *) xxx=`./loc $xxx $xxx $pth`;;
1990 echo $file is in $xxx.
1993 echo $file is in $xxx.
1996 echo "I don't know where '$file' is, and my life depends on it." >&4
1997 echo "Go find a public domain implementation or fix your PATH setting!" >&4
2003 echo "Don't worry if any of the following aren't found..."
2005 for file in $trylist; do
2009 if test -f "$xxx"; then
2012 echo "WARNING: no $xxx -- ignoring your setting for $file." >&4
2013 xxx=`./loc $file $file $pth`
2016 '') xxx=`./loc $file $file $pth`;;
2017 *) xxx=`./loc $xxx $xxx $pth`;;
2023 echo $file is in $xxx.
2026 echo $file is in $xxx.
2029 echo "I don't see $file out there, $say."
2036 echo "Substituting grep for egrep."
2042 echo "Substituting cp for ln."
2048 echo "Hopefully test is built into your sh."
2051 if `sh -c "PATH= test true" >/dev/null 2>&1`; then
2052 echo "Using the test built into your sh."
2060 echo "Hopefully echo is built into your sh."
2065 echo "Checking compatibility between $echo and builtin echo (if any)..." >&4
2066 $echo $n "hi there$c" >foo1
2067 echo $n "hi there$c" >foo2
2068 if cmp foo1 foo2 >/dev/null 2>&1; then
2069 echo "They are compatible. In fact, they may be identical."
2076 They are not compatible! You are probably running ksh on a non-USG system.
2077 I'll have to use $echo instead of the builtin, since Bourne shell doesn't
2078 have echo built in and we may have to run some Bourne shell scripts. That
2079 means I'll have to use '$n$c' to suppress newlines now. Life is ridiculous.
2082 $echo $n "The star should be here-->$c"
2092 cat <<'EOSC' >>checkcc
2097 int main(int argc, char *argv[]) {
2101 if $cc -o try try.c; then
2104 echo "Uh-oh, the C compiler '$cc' doesn't seem to be working." >&4
2110 case "`$cc -v -c try.c 2>&1`" in
2113 if $test X"$trygcc" = Xyes; then
2114 if gcc -o try -c try.c; then
2116 echo "You seem to have a working gcc, though." >&4
2117 rp="Would you like to use it?"
2119 if $test -f myread; then
2122 if $test -f UU/myread; then
2125 echo "Cannot find myread, sorry. Aborting." >&2
2130 [yY]*) cc=gcc; ccname=gcc; ccflags=''; despair=no ;;
2134 if $test X"$despair" = Xyes; then
2135 echo "You need to find a working C compiler." >&4
2136 echo "I cannot continue any further, aborting." >&4
2145 : determine whether symbolic links are supported
2148 if $ln -s blurfl sym > /dev/null 2>&1 ; then
2149 echo "Symbolic links are supported." >&4
2152 echo "Symbolic links are NOT supported." >&4
2157 : see whether [:lower:] and [:upper:] are supported character classes
2159 case "`echo AbyZ | $tr '[:lower:]' '[:upper:]' 2>/dev/null`" in
2161 echo "Good, your tr supports [:lower:] and [:upper:] to convert case." >&4
2165 *) # There is a discontinuity in EBCDIC between 'I' and 'J'
2166 # (0xc9 and 0xd1), therefore that is a nice testing point.
2167 if test "X$up" = X -o "X$low" = X; then
2168 case "`echo IJ | $tr '[I-J]' '[i-j]' 2>/dev/null`" in
2174 if test "X$up" = X -o "X$low" = X; then
2175 case "`echo IJ | $tr I-J i-j 2>/dev/null`" in
2181 if test "X$up" = X -o "X$low" = X; then
2182 case "`echo IJ | od -x 2>/dev/null`" in
2184 echo "Hey, this might be EBCDIC." >&4
2185 if test "X$up" = X -o "X$low" = X; then
2186 case "`echo IJ | $tr '[A-IJ-RS-Z]' '[a-ij-rs-z]' 2>/dev/null`" in
2187 ij) up='[A-IJ-RS-Z]'
2192 if test "X$up" = X -o "X$low" = X; then
2193 case "`echo IJ | $tr A-IJ-RS-Z a-ij-rs-z 2>/dev/null`" in
2203 case "`echo IJ | $tr \"$up\" \"$low\" 2>/dev/null`" in
2205 echo "Using $up and $low to convert case." >&4
2208 echo "I don't know how to translate letters from upper to lower case." >&4
2209 echo "Your tr is not acting any way I know of." >&4
2213 : set up the translation script tr, must be called with ./tr of course
2217 '[A-Z][a-z]') exec $tr '$up' '$low';;
2218 '[a-z][A-Z]') exec $tr '$low' '$up';;
2225 : Try to determine whether config.sh was made on this system
2226 case "$config_sh" in
2228 myuname=`$uname -a 2>/dev/null`
2229 $test -z "$myuname" && myuname=`hostname 2>/dev/null`
2230 # tr '[A-Z]' '[a-z]' would not work in EBCDIC
2231 # because the A-Z/a-z are not consecutive.
2232 myuname=`echo $myuname | $sed -e 's/^[^=]*=//' -e 's/\///g' | \
2233 ./tr '[A-Z]' '[a-z]' | $tr $trnl ' '`
2234 newmyuname="$myuname"
2236 case "$knowitall" in
2238 if test -f ../config.sh; then
2239 if $contains myuname= ../config.sh >/dev/null 2>&1; then
2240 eval "`grep myuname= ../config.sh`"
2242 if test "X$myuname" = "X$newmyuname"; then
2250 : Get old answers from old config file if Configure was run on the
2251 : same system, otherwise use the hints.
2254 if test -f config.sh; then
2256 rp="I see a config.sh file. Shall I use it to set the defaults?"
2259 n*|N*) echo "OK, I'll ignore it."; mv config.sh config.sh.old;;
2260 *) echo "Fetching default answers from your old config.sh file..." >&4
2268 : Older versions did not always set $sh. Catch re-use of such
2278 if test ! -f config.sh; then
2281 First time through, eh? I have some defaults handy for some systems
2282 that need some extra help getting the Configure answers right:
2285 (cd $src/hints; ls -C *.sh) | $sed 's/\.sh/ /g' >&4
2287 : Half the following guesses are probably wrong... If you have better
2288 : tests or hints, please send them to perlbug@perl.org
2289 : The metaconfig authors would also appreciate a copy...
2290 $test -f /irix && osname=irix
2291 $test -f /xenix && osname=sco_xenix
2292 $test -f /dynix && osname=dynix
2293 $test -f /dnix && osname=dnix
2294 $test -f /lynx.os && osname=lynxos
2295 $test -f /unicos && osname=unicos && osvers=`$uname -r`
2296 $test -f /unicosmk && osname=unicosmk && osvers=`$uname -r`
2297 $test -f /unicosmk.ar && osname=unicosmk && osvers=`$uname -r`
2298 $test -f /bin/mips && /bin/mips && osname=mips
2299 $test -d /NextApps && set X `hostinfo | grep 'NeXT Mach.*:' | \
2300 $sed -e 's/://' -e 's/\./_/'` && osname=next && osvers=$4
2301 $test -d /usr/apollo/bin && osname=apollo
2302 $test -f /etc/saf/_sactab && osname=svr4
2303 $test -d /usr/include/minix && osname=minix
2304 if $test -d /MachTen -o -d /MachTen_Folder; then
2306 if $test -x /sbin/version; then
2307 osvers=`/sbin/version | $awk '{print $2}' |
2308 $sed -e 's/[A-Za-z]$//'`
2309 elif $test -x /usr/etc/version; then
2310 osvers=`/usr/etc/version | $awk '{print $2}' |
2311 $sed -e 's/[A-Za-z]$//'`
2317 $test -f /sys/posix.dll &&
2318 $test -f /usr/bin/what &&
2319 set X `/usr/bin/what /sys/posix.dll` &&
2320 $test "$3" = UWIN &&
2324 if $test -f $uname; then
2332 umips) osname=umips ;;
2335 [23]100) osname=mips ;;
2336 next*) osname=next ;;
2338 tmp=`/bin/uname -X 2>/dev/null|awk '/3\.2v[45]/{ print $(NF) }'`
2339 if $test "$tmp" != "" -a "$3" = "3.2" -a -f '/etc/systemid'; then
2342 elif $test -f /etc/kconfig; then
2344 if test "$lns" = "$ln -s"; then
2346 elif $contains _SYSV3 /usr/include/stdio.h > /dev/null 2>&1 ; then
2348 elif $contains _POSIX_SOURCE /usr/include/stdio.h > /dev/null 2>&1 ; then
2355 if test -n "$DJGPP"; then
2364 tmp=`( (oslevel) 2>/dev/null || echo "not found") 2>&1`
2366 'not found') osvers="$4"."$3" ;;
2367 '<3240'|'<>3240') osvers=3.2.0 ;;
2368 '=3240'|'>3240'|'<3250'|'<>3250') osvers=3.2.4 ;;
2369 '=3250'|'>3250') osvers=3.2.5 ;;
2373 bsd386) osname=bsd386
2376 cygwin*) osname=cygwin
2379 *dc.osx) osname=dcosx
2385 domainos) osname=apollo
2391 dynixptx*) osname=dynixptx
2392 osvers=`echo "$4"|sed 's/^v//'`
2394 freebsd) osname=freebsd
2396 genix) osname=genix ;;
2398 osvers=`echo "$3" | $sed 's,.*\.\([0-9]*\.[0-9]*\),\1,'`
2414 netbsd*) osname=netbsd
2417 news-os) osvers="$3"
2419 4*) osname=newsos4 ;;
2423 next*) osname=next ;;
2424 POSIX-BC | posix-bc ) osname=posix-bc
2427 powerux | power_ux | powermax_os | powermaxos | \
2428 powerunix | power_unix) osname=powerux
2434 solaris) osname=solaris
2436 5*) osvers=`echo $3 | $sed 's/^5/2/g'` ;;
2443 osvers=`echo $3 | $sed 's/^5/2/g'` ;;
2447 titanos) osname=titanos
2456 ultrix) osname=ultrix
2459 osf1|mls+) case "$5" in
2462 osvers=`sizer -v | awk '{print $3}' | tr '[A-Z]' '[a-z]' | sed 's/^[xvt]//'`
2465 *) osvers=`echo "$3" | sed 's/^[xvt]//'` ;;
2468 hp*) osname=hp_osf1 ;;
2469 mips) osname=mips_osf1 ;;
2472 unixware) osname=svr5
2478 $2) case "$osname" in
2482 : svr4.x or possibly later
2492 if test -f /stand/boot ; then
2493 eval `grep '^INITPROG=[a-z/0-9]*$' /stand/boot`
2494 if test -n "$INITPROG" -a -f "$INITPROG"; then
2495 isesix=`strings -a $INITPROG|grep 'ESIX SYSTEM V/386 Release 4.0'`
2496 if test -n "$isesix"; then
2504 *) if test -f /etc/systemid; then
2506 set `echo $3 | $sed 's/\./ /g'` $4
2507 if $test -f $src/hints/sco_$1_$2_$3.sh; then
2509 elif $test -f $src/hints/sco_$1_$2.sh; then
2511 elif $test -f $src/hints/sco_$1.sh; then
2516 '') : Still unknown. Probably a generic Sys V.
2525 *) case "$osname" in
2526 '') : Still unknown. Probably a generic BSD.
2534 if test -f /vmunix -a -f $src/hints/news_os.sh; then
2535 (what /vmunix | UU/tr '[A-Z]' '[a-z]') > UU/kernel.what 2>&1
2536 if $contains news-os UU/kernel.what >/dev/null 2>&1; then
2539 $rm -f UU/kernel.what
2540 elif test -d c:/.; then
2547 : Now look for a hint file osname_osvers, unless one has been
2548 : specified already.
2551 file=`echo "${osname}_${osvers}" | $sed -e 's%\.%_%g' -e 's%_$%%'`
2552 : Also try without trailing minor version numbers.
2553 xfile=`echo $file | $sed -e 's%_[^_]*$%%'`
2554 xxfile=`echo $xfile | $sed -e 's%_[^_]*$%%'`
2555 xxxfile=`echo $xxfile | $sed -e 's%_[^_]*$%%'`
2556 xxxxfile=`echo $xxxfile | $sed -e 's%_[^_]*$%%'`
2559 *) case "$osvers" in
2562 *) if $test -f $src/hints/$file.sh ; then
2564 elif $test -f $src/hints/$xfile.sh ; then
2566 elif $test -f $src/hints/$xxfile.sh ; then
2568 elif $test -f $src/hints/$xxxfile.sh ; then
2570 elif $test -f $src/hints/$xxxxfile.sh ; then
2572 elif $test -f "$src/hints/${osname}.sh" ; then
2581 if $test -f Policy.sh ; then
2584 none) dflt="Policy" ;;
2585 *) dflt="Policy $dflt" ;;
2590 dflt=`echo $hintfile | $sed 's/\.sh$//'`
2594 if $test -f Policy.sh ; then
2597 There's also a Policy hint file available, which should make the
2598 site-specific (policy) questions easier to answer.
2605 You may give one or more space-separated answers, or "none" if appropriate.
2606 A well-behaved OS will have no hints, so answering "none" or just "Policy"
2607 is a good thing. DO NOT give a wrong version or a wrong OS.
2611 rp="Which of these apply, if any?"
2614 for file in $tans; do
2615 if $test X$file = XPolicy -a -f Policy.sh; then
2617 $cat Policy.sh >> UU/config.sh
2618 elif $test -f $src/hints/$file.sh; then
2619 . $src/hints/$file.sh
2620 $cat $src/hints/$file.sh >> UU/config.sh
2621 elif $test X$tans = X -o X$tans = Xnone ; then
2624 : Give one chance to correct a possible typo.
2625 echo "$file.sh does not exist"
2627 rp="hint to use instead?"
2629 for file in $ans; do
2630 if $test -f "$src/hints/$file.sh"; then
2631 . $src/hints/$file.sh
2632 $cat $src/hints/$file.sh >> UU/config.sh
2633 elif $test X$ans = X -o X$ans = Xnone ; then
2636 echo "$file.sh does not exist -- ignored."
2643 : Remember our hint file for later.
2644 if $test -f "$src/hints/$file.sh" ; then
2654 echo "Fetching default answers from $config_sh..." >&4
2658 cp $config_sh config.sh 2>/dev/null
2668 test "$override" && . ./optdef.sh
2669 myuname="$newmyuname"
2671 : Restore computed paths
2672 for file in $loclist $trylist; do
2673 eval $file="\$_$file"
2678 Configure uses the operating system name and version to set some defaults.
2679 The default value is probably right if the name rings a bell. Otherwise,
2680 since spelling matters for me, either accept the default or answer "none"
2687 ''|' '|none) dflt=none ;;
2688 *) dflt=`echo $hintfile | $sed -e 's/\.sh$//' -e 's/_.*$//'` ;;
2691 *) dflt="$osname" ;;
2693 rp="Operating system name?"
2697 *) osname=`echo "$ans" | $sed -e 's/[ ][ ]*/_/g' | ./tr '[A-Z]' '[a-z]'`;;
2703 ''|' '|none) dflt=none ;;
2704 *) dflt=`echo $hintfile | $sed -e 's/\.sh$//' -e 's/^[^_]*//'`
2705 dflt=`echo $dflt | $sed -e 's/^_//' -e 's/_/./g'`
2707 ''|' ') dflt=none ;;
2712 *) dflt="$osvers" ;;
2714 rp="Operating system version?"
2724 : who configured the system
2725 cf_time=`LC_ALL=C; LANGUAGE=C; export LC_ALL; export LANGUAGE; $date 2>&1`
2726 cf_by=`(logname) 2>/dev/null`
2729 cf_by=`(whoami) 2>/dev/null`
2731 "") cf_by=unknown ;;
2735 : set up the script used to warn in case of inconsistency
2742 echo "*** WHOA THERE!!! ***" >&4
2743 echo " The $hint value for \$$var on this machine was \"$was\"!" >&4
2744 rp=" Keep the $hint value?"
2747 y) td=$was; tu=$was;;
2751 : function used to set $1 to $val
2752 setvar='var=$1; eval "was=\$$1"; td=$define; tu=$undef;
2754 $define$undef) . ./whoa; eval "$var=\$td";;
2755 $undef$define) . ./whoa; eval "$var=\$tu";;
2756 *) eval "$var=$val";;
2759 case "$usethreads" in
2760 $define|true|[yY]*) dflt='y';;
2765 Perl can be built to take advantage of threads on some systems.
2766 To do so, Configure can be run with -Dusethreads.
2768 Note that threading is a highly experimental feature, and
2769 some known race conditions still remain. If you choose to try
2770 it, be very sure to not actually deploy it for production
2771 purposes. README.threads has more details, and is required
2772 reading if you enable threads.
2774 If this doesn't make any sense to you, just accept the default '$dflt'.
2776 rp='Build a threading Perl?'
2779 y|Y) val="$define" ;;
2785 case "$usethreads" in
2789 As of 5.5.640, Perl has two different internal threading implementations,
2790 the 5.005 version (5005threads) and an interpreter-based version
2791 (ithreads) that has one interpreter per thread. Both are very
2792 experimental. This arrangement exists to help developers work out
2793 which one is better.
2795 If you're a casual user, you probably don't want interpreter-threads
2796 at this time. There doesn't yet exist a way to create threads from
2797 within Perl in this model, i.e., "use Thread;" will NOT work.
2799 : Default to ithreads unless overridden on command line or with
2802 case "$use5005threads" in
2803 $define|true|[yY]*) dflt='n';;
2805 case "$useithreads" in
2806 $undef|false|[nN]*) dflt='n';;
2808 rp='Use interpreter-based ithreads?'
2811 y|Y) val="$define" ;;
2816 : Now set use5005threads to the opposite value.
2817 case "$useithreads" in
2818 $define) val="$undef" ;;
2825 useithreads="$undef"
2826 use5005threads="$undef"
2830 case "$d_oldpthreads" in
2831 '') : Configure tests would be welcome here. For now, assume undef.
2833 *) val="$d_oldpthreads" ;;
2839 case "$usethreads" in
2840 "$define"|true|[yY]*)
2841 : Look for a hint-file generated 'call-back-unit'. If the
2842 : user has specified that a threading perl is to be built,
2843 : we may need to set or change some other defaults.
2844 if $test -f usethreads.cbu; then
2845 echo "Your platform has some specific hints for threaded builds, using them..."
2849 (Your platform doesn't have any specific hints for threaded builds.
2850 Assuming POSIX threads, then.)
2858 Perl can be built so that multiple Perl interpreters can coexist
2859 within the same Perl executable.
2862 case "$useithreads" in
2865 This multiple interpreter support is required for interpreter-based threads.
2869 *) case "$usemultiplicity" in
2870 $define|true|[yY]*) dflt='y';;
2874 echo "If this doesn't make any sense to you, just accept the default '$dflt'."
2875 rp='Build Perl for multiplicity?'
2878 y|Y) val="$define" ;;
2886 : determine where manual pages are on this system
2890 syspath='/usr/man/man1 /usr/man/mann /usr/man/manl /usr/man/local/man1'
2891 syspath="$syspath /usr/man/u_man/man1 /usr/share/man/man1"
2892 syspath="$syspath /usr/catman/u_man/man1 /usr/man/l_man/man1"
2893 syspath="$syspath /usr/local/man/u_man/man1 /usr/local/man/l_man/man1"
2894 syspath="$syspath /usr/man/man.L /local/man/man1 /usr/local/man/man1"
2895 sysman=`./loc . /usr/man/man1 $syspath`
2898 if $test -d "$sysman"; then
2899 echo "System manual is in $sysman." >&4
2901 echo "Could not find manual pages in source form." >&4
2904 : see what memory models we can support
2907 $cat >pdp11.c <<'EOP'
2917 '') modelcc="$cc" ;;
2920 ( $modelcc -o pdp11 pdp11.c ) >/dev/null 2>&1
2921 if $test -f pdp11 && ./pdp11 2>/dev/null; then
2922 dflt='unsplit split'
2924 tans=`./loc . X /lib/small /lib/large /usr/lib/small /usr/lib/large /lib/medium /usr/lib/medium /lib/huge`
2927 *) if $test -d /lib/small || $test -d /usr/lib/small; then
2932 if $test -d /lib/medium || $test -d /usr/lib/medium; then
2935 if $test -d /lib/large || $test -d /usr/lib/large; then
2938 if $test -d /lib/huge || $test -d /usr/lib/huge; then
2947 Some systems have different model sizes. On most systems they are called
2948 small, medium, large, and huge. On the PDP11 they are called unsplit and
2949 split. If your system doesn't support different memory models, say "none".
2950 If you wish to force everything to one memory model, say "none" here and
2951 put the appropriate flags later when it asks you for other cc and ld flags.
2952 Venix systems may wish to put "none" and let the compiler figure things out.
2953 (In the following question multiple model names should be space separated.)
2955 The default for most systems is "none".
2958 rp="Which memory models are supported?"
2973 '') if $contains '\-i' $sysman/ld.1 >/dev/null 2>&1 || \
2974 $contains '\-i' $sysman/cc.1 >/dev/null 2>&1; then
2981 rp="What flag indicates separate I and D space?"
2989 *large*|*small*|*medium*|*huge*)
2996 rp="What flag indicates large model?"
3006 *huge*) case "$huge" in
3010 rp="What flag indicates huge model?"
3020 *medium*) case "$medium" in
3024 rp="What flag indicates medium model?"
3031 *) medium="$large";;
3034 *small*) case "$small" in
3038 rp="What flag indicates small model?"
3049 echo "Unrecognized memory models--you may have to edit Makefile.SH" >&4
3052 $rm -f pdp11.* pdp11
3054 : make some quick guesses about what we are up against
3056 $echo $n "Hmm... $c"
3066 $cat /usr/include/signal.h /usr/include/sys/signal.h >foo 2>/dev/null
3067 if test -f /osf_boot || $contains 'OSF/1' /usr/include/ctype.h >/dev/null 2>&1
3069 echo "Looks kind of like an OSF/1 system, but we'll see..."
3071 elif test `echo abc | tr a-z A-Z` = Abc ; then
3072 xxx=`./loc addbib blurfl $pth`
3073 if $test -f $xxx; then
3074 echo "Looks kind of like a USG system with BSD features, but we'll see..."
3078 if $contains SIGTSTP foo >/dev/null 2>&1 ; then
3079 echo "Looks kind of like an extended USG system, but we'll see..."
3081 echo "Looks kind of like a USG system, but we'll see..."
3085 elif $contains SIGTSTP foo >/dev/null 2>&1 ; then
3086 echo "Looks kind of like a BSD system, but we'll see..."
3090 echo "Looks kind of like a Version 7 system, but we'll see..."
3093 case "$eunicefix" in
3096 There is, however, a strange, musty smell in the air that reminds me of
3097 something...hmm...yes...I've got it...there's a VMS nearby, or I'm a Blit.
3101 : it so happens the Eunice I know will not run shell scripts in Unix format
3105 echo "Congratulations. You aren't running Eunice."
3109 : Detect OS2. The p_ variable is set above in the Head.U unit.
3114 I have the feeling something is not exactly right, however...don't tell me...
3115 lemme think...does HAL ring a bell?...no, of course, you're only running OS/2!
3120 if test -f /xenix; then
3121 echo "Actually, this looks more like a XENIX system..."
3126 echo "It's not Xenix..."
3131 if test -f /venix; then
3132 echo "Actually, this looks more like a VENIX system..."
3139 echo "Nor is it Venix..."
3142 chmod +x bsd usg v7 osf1 eunice xenix venix os2
3143 $eunicefix bsd usg v7 osf1 eunice xenix venix os2
3146 : see if we need a special compiler
3154 *) if $contains '\-M' $sysman/cc.1 >/dev/null 2>&1 ; then
3155 if $contains '\-M' $sysman/cpp.1 >/dev/null 2>&1; then
3169 On some older systems the default C compiler will not resolve multiple global
3170 references that happen to have the same name. On some such systems the "Mcc"
3171 command may be used to force these to be resolved. On other systems a "cc -M"
3172 command is required. (Note that the -M flag on other systems indicates a
3173 memory model to use!) If you have the Gnu C compiler, you might wish to use
3179 rp="Use which C compiler?"
3187 rp="Use which C compiler?"
3191 : Look for a hint-file generated 'call-back-unit'. Now that the
3192 : user has specified the compiler, we may need to set or change some
3194 if $test -f cc.cbu; then
3200 echo "Checking for GNU cc in disguise and/or its version number..." >&4
3201 $cat >gccvers.c <<EOM
3206 printf("%s\n", __VERSION__);
3208 printf("%s\n", "1");
3214 if $cc $ldflags -o gccvers gccvers.c; then
3215 gccversion=`./gccvers`
3216 case "$gccversion" in
3217 '') echo "You are not using GNU cc." ;;
3218 *) echo "You are using GNU cc $gccversion."
3224 echo "*** WHOA THERE!!! ***" >&4
3225 echo " Your C compiler \"$cc\" doesn't seem to be working!" >&4
3226 case "$knowitall" in
3228 echo " You'd better start hunting for one and let me know about it." >&4
3234 case "$gccversion" in
3235 1*) cpp=`./loc gcc-cpp $cpp $pth` ;;
3237 case "$gccversion" in
3238 '') gccosandvers='' ;;
3239 *) gccshortvers=`echo "$gccversion"|sed 's/ .*//'`
3240 gccosandvers=`$cc -v 2>&1|grep '/specs$'|sed "s!.*/[^-/]*-[^-/]*-\([^-/]*\)/$gccshortvers/specs!\1!"`
3242 case "$gccosandvers" in
3243 $osname) gccosandvers='' ;; # linux gccs seem to have no linux osvers, grr
3244 $osname$osvers) ;; # looking good
3245 $osname*) cat <<EOM >&4
3247 *** WHOA THERE!!! ***
3249 Your gcc has not been compiled for the exact release of
3250 your operating system ($gccosandvers versus $osname$osvers).
3252 In general it is a good idea to keep gcc synchronized with
3253 the operating system because otherwise serious problems
3254 may ensue when trying to compile software, like Perl.
3256 I'm trying to be optimistic here, though, and will continue.
3257 If later during the configuration and build icky compilation
3258 problems appear (headerfile conflicts being the most common
3259 manifestation), I suggest reinstalling the gcc to match
3260 your operating system release.
3264 *) gccosandvers='' ;; # failed to parse, better be silent
3272 : see how we invoke the C preprocessor
3274 echo "Now, how can we feed standard input to your C preprocessor..." >&4
3275 cat <<'EOT' >testcpp.c
3281 if test ! -f cppstdin; then
3282 if test "X$osname" = "Xaix" -a "X$gccversion" = X; then
3283 # AIX cc -E doesn't show the absolute headerfile
3284 # locations but we'll cheat by using the -M flag.
3285 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
3287 echo 'cat >.$$.c; '"$cc"' -E ${1+"$@"} .$$.c; rm .$$.c' >cppstdin
3290 echo "Keeping your $hint cppstdin wrapper."
3293 wrapper=`pwd`/cppstdin
3297 if $test "X$cppstdin" != "X" && \
3298 $cppstdin $cppminus <testcpp.c >testcpp.out 2>&1 && \
3299 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
3301 echo "You used to use $cppstdin $cppminus so we'll use that again."
3303 '') echo "But let's see if we can live without a wrapper..." ;;
3305 if $cpprun $cpplast <testcpp.c >testcpp.out 2>&1 && \
3306 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
3308 echo "(And we'll use $cpprun $cpplast to preprocess directly.)"
3311 echo "(However, $cpprun $cpplast does not work, let's see...)"
3319 echo "Good old $cppstdin $cppminus does not seem to be of any help..."
3326 elif echo 'Maybe "'"$cc"' -E" will work...'; \
3327 $cc -E <testcpp.c >testcpp.out 2>&1; \
3328 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3329 echo "Yup, it does."
3332 elif echo 'Nope...maybe "'"$cc"' -E -" will work...'; \
3333 $cc -E - <testcpp.c >testcpp.out 2>&1; \
3334 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3335 echo "Yup, it does."
3338 elif echo 'Nope...maybe "'"$cc"' -P" will work...'; \
3339 $cc -P <testcpp.c >testcpp.out 2>&1; \
3340 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3341 echo "Yipee, that works!"
3344 elif echo 'Nope...maybe "'"$cc"' -P -" will work...'; \
3345 $cc -P - <testcpp.c >testcpp.out 2>&1; \
3346 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3347 echo "At long last!"
3350 elif echo 'No such luck, maybe "'$cpp'" will work...'; \
3351 $cpp <testcpp.c >testcpp.out 2>&1; \
3352 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3356 elif echo 'Nixed again...maybe "'$cpp' -" will work...'; \
3357 $cpp - <testcpp.c >testcpp.out 2>&1; \
3358 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3359 echo "Hooray, it works! I was beginning to wonder."
3362 elif echo 'Uh-uh. Time to get fancy. Trying a wrapper...'; \
3363 $wrapper <testcpp.c >testcpp.out 2>&1; \
3364 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3370 rp="No dice. I can't find a C preprocessor. Name one:"
3374 $x_cpp <testcpp.c >testcpp.out 2>&1
3375 if $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3376 echo "OK, that will do." >&4
3378 echo "Sorry, I can't get that to work. Go find one and rerun Configure." >&4
3393 echo "Perhaps can we force $cc -E using a wrapper..."
3394 if $wrapper <testcpp.c >testcpp.out 2>&1; \
3395 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
3401 echo "Nope, we'll have to live without it..."
3415 "$wrapper"|'cppstdin') ;;
3416 *) $rm -f $wrapper;;
3418 $rm -f testcpp.c testcpp.out
3420 : decide how portable to be. Allow command line overrides.
3421 case "$d_portable" in
3423 *) d_portable="$define" ;;
3426 : set up shell script to do ~ expansion
3432 echo \$1 | $sed "s|~|\${HOME-\$LOGDIR}|"
3435 if $test -f /bin/csh; then
3436 /bin/csh -f -c "glob \$1"
3441 name=\`$expr x\$1 : '..\([^/]*\)'\`
3442 dir=\`$sed -n -e "/^\${name}:/{s/^[^:]*:[^:]*:[^:]*:[^:]*:[^:]*:\([^:]*\).*"'\$'"/\1/" -e p -e q -e '}' </etc/passwd\`
3443 if $test ! -d "\$dir"; then
3445 echo "\$me: can't locate home directory for: \$name" >&2
3450 echo \$dir/\`$expr x\$1 : '..[^/]*/\(.*\)'\`
3466 : now set up to get a file name
3470 cat <<'EOSC' >>getfile
3486 expr $fn : '.*(\(.*\)).*' | tr ',' $trnl >getfile.ok
3487 fn=`echo $fn | sed 's/(.*)//'`
3493 loc_file=`expr $fn : '.*:\(.*\)'`
3494 fn=`expr $fn : '\(.*\):.*'`
3502 */*) fullpath=true;;
3511 *e*) exp_file=true;;
3514 *p*) nopath_ok=true;;
3519 *d*) type='Directory';;
3520 *l*) type='Locate';;
3525 Locate) what='File';;
3530 case "$d_portable" in
3538 while test "$type"; do
3543 true) rp="$rp (~name ok)";;
3546 if test -f UU/getfile.ok && \
3547 $contains "^$ans\$" UU/getfile.ok >/dev/null 2>&1
3566 value=`UU/filexp $ans`
3569 if test "$ans" != "$value"; then
3570 echo "(That expands to $value on this system.)"
3584 /*) value="$ansexp" ;;
3585 [a-zA-Z]:/*) value="$ansexp" ;;
3590 echo "I shall only accept a full path name, as in /bin/ls." >&4
3591 echo "Use a ! shell escape if you wish to check pathnames." >&4
3594 echo "Please give a full path name, starting with slash." >&4
3597 echo "Note that using ~name is ok provided it expands well." >&4
3610 for fp in $gfpth; do
3611 if test "X$fp" = X.; then
3616 if test -f "$pf"; then
3618 elif test -r "$pf" || (test -h "$pf") >/dev/null 2>&1
3620 echo "($value is not a plain file, but that's ok.)"
3623 if test X"$type" = X; then
3630 for fp in $gfpth; do
3631 if test "X$fp" = X.; then
3636 direxp="$fp/$ansexp"
3638 if test -d "$direxp"; then
3646 if test -d "$ansexp"; then
3647 echo "(Looking for $loc_file in directory $value.)"
3648 value="$value/$loc_file"
3649 ansexp="$ansexp/$loc_file"
3651 if test -f "$ansexp"; then
3654 case "$nopath_ok" in
3655 true) case "$value" in
3657 *) echo "Assuming $value will be in people's path."
3673 if test "$fastread" = yes; then
3678 rp="$what $value doesn't exist. Use that name anyway?"
3697 test "X$gfpthkeep" != Xy && gfpth=""
3700 : What should the include directory be ?
3702 $echo $n "Hmm... $c"
3706 if $test -f /bin/mips && /bin/mips; then
3707 echo "Looks like a MIPS system..."
3708 $cat >usr.c <<'EOCP'
3709 #ifdef SYSTYPE_BSD43
3713 if cc -E usr.c > usr.out && $contains / usr.out >/dev/null 2>&1; then
3714 dflt='/bsd43/usr/include'
3718 mips_type='System V'
3720 $rm -f usr.c usr.out
3721 echo "and you're compiling with the $mips_type compiler and libraries."
3725 echo "Doesn't look like a MIPS system."
3735 case "$xxx_prompt" in
3738 rp='Where are the include files you want to use?'
3746 : Set private lib path
3749 plibpth="$incpath/usr/lib /usr/local/lib /usr/ccs/lib"
3754 '') dlist="$loclibpth $plibpth $glibpth";;
3755 *) dlist="$libpth";;
3758 : Now check and see which directories actually exist, avoiding duplicates
3762 if $test -d $xxx; then
3765 *) libpth="$libpth $xxx";;
3771 Some systems have incompatible or broken versions of libraries. Among
3772 the directories listed in the question below, please remove any you
3773 know not to be holding relevant libraries, and add any that are needed.
3774 Say "none" for none.
3785 rp="Directories to use for library searches?"
3792 : compute shared library extension
3795 if xxx=`./loc libc.sl X $libpth`; $test -f "$xxx"; then
3805 On some systems, shared libraries may be available. Answer 'none' if
3806 you want to suppress searching of shared libraries for the remainder
3807 of this configuration.
3810 rp='What is the file extension used for shared libraries?'
3814 : Define several unixisms.
3815 : Hints files or command line option can be used to override them.
3816 : The convoluted testing is in case hints files set either the old
3819 '') case "$exe_ext" in
3821 *) _exe="$exe_ext" ;;
3826 '') case "$lib_ext" in
3833 '') case "$obj_ext" in
3840 '') case "$path_sep" in
3851 : Which makefile gets called first. This is used by make depend.
3852 case "$firstmakefile" in
3853 '') firstmakefile='makefile';;
3857 $define|true|[yY]*) dflt='y';;
3862 Perl can be built to use the SOCKS proxy protocol library. To do so,
3863 Configure must be run with -Dusesocks.
3865 If this doesn't make any sense to you, just accept the default '$dflt'.
3867 rp='Build Perl for SOCKS?'
3870 y|Y) val="$define" ;;
3876 : Looking for optional libraries
3878 echo "Checking for optional libraries..." >&4
3883 case "$libswanted" in
3884 '') libswanted='c_s';;
3887 "$define") libswanted="$libswanted socks5 socks5_sh" ;;
3893 for thisdir in $libpth $xlibpth; do
3894 test -d $thisdir && libspath="$libspath $thisdir"
3896 for thislib in $libswanted; do
3897 for thisdir in $libspath; do
3899 if $test ! -f "$xxx" -a "X$ignore_versioned_solibs" = "X"; then
3900 xxx=`ls $thisdir/lib$thislib.$so.[0-9] 2>/dev/null|tail -1`
3901 $test -f "$xxx" && eval $libscheck
3902 $test -f "$xxx" && libstyle=shared
3904 if test ! -f "$xxx"; then
3905 xxx=$thisdir/lib$thislib.$so
3906 $test -f "$xxx" && eval $libscheck
3907 $test -f "$xxx" && libstyle=shared
3909 if test ! -f "$xxx"; then
3910 xxx=$thisdir/lib$thislib$_a
3911 $test -f "$xxx" && eval $libscheck
3912 $test -f "$xxx" && libstyle=static
3914 if test ! -f "$xxx"; then
3915 xxx=$thisdir/$thislib$_a
3916 $test -f "$xxx" && eval $libscheck
3917 $test -f "$xxx" && libstyle=static
3919 if test ! -f "$xxx"; then
3920 xxx=$thisdir/lib${thislib}_s$_a
3921 $test -f "$xxx" && eval $libscheck
3922 $test -f "$xxx" && libstyle=static
3923 $test -f "$xxx" && thislib=${thislib}_s
3925 if test ! -f "$xxx"; then
3926 xxx=$thisdir/Slib$thislib$_a
3927 $test -f "$xxx" && eval $libscheck
3928 $test -f "$xxx" && libstyle=static
3930 if $test -f "$xxx"; then
3932 shared) echo "Found -l$thislib (shared)." ;;
3933 static) echo "Found -l$thislib." ;;
3934 *) echo "Found -l$thislib ($libstyle)." ;;
3938 *) dflt="$dflt -l$thislib"
3939 libsfound="$libsfound $xxx"
3941 libsfiles="$libsfiles $yyy"
3942 yyy=`echo $xxx|$sed -e "s%/$yyy\\$%%"`
3943 case " $libsdirs " in
3945 *) libsdirs="$libsdirs $yyy" ;;
3952 if $test ! -f "$xxx"; then
3953 echo "No -l$thislib."
3964 ' '|'') dflt='none';;
3969 In order to compile $package on your machine, a number of libraries
3970 are usually needed. Include any other special libraries here as well.
3971 Say "none" for none. The default list is almost always right.
3975 rp="What libraries to use?"
3982 : determine optimization, if desired, or use for debug flag also
3984 ' '|$undef) dflt='none';;
3986 *) dflt="$optimize";;
3990 By default, $package compiles with the -O flag to use the optimizer.
3991 Alternately, you might want to use the symbolic debugger, which uses
3992 the -g flag (on traditional Unix systems). Either flag can be
3993 specified here. To use neither flag, specify the word "none".
3996 rp="What optimizer/debugger flag should be used?"
4000 'none') optimize=" ";;
4004 : We will not override a previous value, but we might want to
4005 : augment a hint file
4007 default|recommended)
4008 case "$gccversion" in
4009 1*) dflt='-fpcc-struct-return' ;;
4012 *-g*) dflt="$dflt -DDEBUGGING";;
4014 case "$gccversion" in
4015 2*) if test -d /etc/conf/kconfig.d &&
4016 $contains _POSIX_VERSION $usrinc/sys/unistd.h >/dev/null 2>&1
4022 case "$gccversion" in
4026 echo "Checking if your compiler accepts -fno-strict-aliasing" 2>&1
4027 echo 'int main(void) { return 0; }' > gcctest.c
4028 if $cc -O2 -fno-strict-aliasing -o gcctest gcctest.c; then
4029 echo "Yes, it does." 2>&1
4032 echo "Leaving current flags $ccflags alone." 2>&1
4034 *) dflt="$dflt -fno-strict-aliasing" ;;
4037 echo "Nope, it doesn't, but that's ok." 2>&1
4044 case "$mips_type" in
4045 *BSD*|'') inclwanted="$locincpth $usrinc";;
4046 *) inclwanted="$locincpth $inclwanted $usrinc/bsd";;
4048 for thisincl in $inclwanted; do
4049 if $test -d $thisincl; then
4050 if $test x$thisincl != x$usrinc; then
4053 *) dflt="$dflt -I$thisincl";;
4059 inctest='if $contains $2 $usrinc/$1 >/dev/null 2>&1; then
4061 elif $contains $2 $usrinc/sys/$1 >/dev/null 2>&1; then
4069 *) dflt="$dflt -D$2";;
4073 set signal.h LANGUAGE_C; eval $inctest
4077 ccflags="$ccflags -DSOCKS"
4082 default|recommended) dflt="$ccflags $dflt" ;;
4083 *) dflt="$ccflags";;
4091 Your C compiler may want other flags. For this question you should include
4092 -I/whatever and -DWHATEVER flags and any other flags used by the C compiler,
4093 but you should NOT include libraries or ld flags like -lwhatever. If you
4094 want $package to honor its debug switch, you should include -DDEBUGGING here.
4095 Your C compiler might also need additional flags, such as -D_POSIX_SOURCE.
4097 To use no flags, specify the word "none".
4103 rp="Any additional cc flags?"
4110 : the following weeds options from ccflags that are of no interest to cpp
4112 case "$gccversion" in
4113 1*) cppflags="$cppflags -D__GNUC__"
4115 case "$mips_type" in
4117 *BSD*) cppflags="$cppflags -DSYSTYPE_BSD43";;
4123 echo "Let me guess what the preprocessor flags are..." >&4
4137 *) ftry="$previous $flag";;
4139 if $cppstdin -DLFRULB=bar $cppflags $ftry $cppminus <cpp.c \
4140 >cpp1.out 2>/dev/null && \
4141 $cpprun -DLFRULB=bar $cppflags $ftry $cpplast <cpp.c \
4142 >cpp2.out 2>/dev/null && \
4143 $contains 'foo.*xx.*bar' cpp1.out >/dev/null 2>&1 && \
4144 $contains 'foo.*xx.*bar' cpp2.out >/dev/null 2>&1
4146 cppflags="$cppflags $ftry"
4156 *-*) echo "They appear to be: $cppflags";;
4158 $rm -f cpp.c cpp?.out
4162 : flags used in final linking phase
4164 '') if ./venix; then
4170 *-posix*) dflt="$dflt -posix" ;;
4173 *) dflt="$ldflags";;
4176 : Try to guess additional flags to pick up local libraries.
4177 for thislibdir in $libpth; do
4178 case " $loclibpth " in
4181 *"-L$thislibdir "*) ;;
4182 *) dflt="$dflt -L$thislibdir" ;;
4194 Your C linker may need flags. For this question you should
4195 include -L/whatever and any other flags used by the C linker, but you
4196 should NOT include libraries like -lwhatever.
4198 Make sure you include the appropriate -L/path flags if your C linker
4199 does not normally search all of the directories you specified above,
4202 To use no flags, specify the word "none".
4206 rp="Any additional ld flags (NOT including libraries)?"
4212 rmlist="$rmlist pdp11"
4216 echo "Checking your choice of C compiler and flags for coherency..." >&4
4217 $cat > try.c <<'EOF'
4219 int main() { printf("Ok\n"); exit(0); }
4221 set X $cc $optimize $ccflags -o try $ldflags try.c $libs
4223 $cat >try.msg <<'EOM'
4224 I've tried to compile and run the following simple program:
4227 $cat try.c >> try.msg
4229 $cat >> try.msg <<EOM
4236 and I got the following output:
4240 if sh -c "$cc $optimize $ccflags -o try $ldflags try.c $libs" >>try.msg 2>&1; then
4241 if sh -c './try' >>try.msg 2>&1; then
4245 *) echo 'The program compiled OK, but produced no output.' >> try.msg
4248 cat >> try.msg <<'EOQS'
4249 If $libs contains -lsfio, and sfio is mis-configured, then it
4250 sometimes (apparently) runs and exits with a 0 status, but with no
4251 output! It may have to do with sfio's use of _exit vs. exit.
4254 rp="You have a big problem. Shall I abort Configure"
4261 echo "The program compiled OK, but exited with status $?." >>try.msg
4262 rp="You have a problem. Shall I abort Configure"
4266 echo "I can't compile the test program." >>try.msg
4267 rp="You have a BIG problem. Shall I abort Configure"
4273 case "$knowitall" in
4275 echo "(The supplied flags or libraries might be incorrect.)"
4283 *) echo "Ok. Stopping Configure." >&4
4288 n) echo "OK, that should do.";;
4290 $rm -f try try.* core
4292 : define an is-a-typedef? function
4293 typedef='type=$1; var=$2; def=$3; shift; shift; shift; inclist=$@;
4295 "") inclist="sys/types.h";;
4297 eval "varval=\$$var";
4301 for inc in $inclist; do
4302 echo "#include <$inc>" >>temp.c;
4304 echo "#ifdef $type" >> temp.c;
4305 echo "printf(\"We have $type\");" >> temp.c;
4306 echo "#endif" >> temp.c;
4307 $cppstdin $cppflags $cppminus < temp.c >temp.E 2>/dev/null;
4308 if $contains $type temp.E >/dev/null 2>&1; then
4314 *) eval "$var=\$varval";;
4317 : define an is-a-typedef? function that prompts if the type is not available.
4318 typedef_ask='type=$1; var=$2; def=$3; shift; shift; shift; inclist=$@;
4320 "") inclist="sys/types.h";;
4322 eval "varval=\$$var";
4326 for inc in $inclist; do
4327 echo "#include <$inc>" >>temp.c;
4329 echo "#ifdef $type" >> temp.c;
4330 echo "printf(\"We have $type\");" >> temp.c;
4331 echo "#endif" >> temp.c;
4332 $cppstdin $cppflags $cppminus < temp.c >temp.E 2>/dev/null;
4334 echo "$rp" | $sed -e "s/What is/Looking for/" -e "s/?/./";
4335 if $contains $type temp.E >/dev/null 2>&1; then
4336 echo "$type found." >&4;
4339 echo "$type NOT found." >&4;
4345 *) eval "$var=\$varval";;
4348 : define a shorthand compile call
4352 $cc $optimize $ccflags $ldflags -o ${mc_file} $* ${mc_file}.c $libs > /dev/null 2>&1;'
4353 : define a shorthand compile call for compilations that should be ok.
4357 $cc $optimize $ccflags $ldflags -o ${mc_file} $* ${mc_file}.c $libs;'
4359 : check for lengths of integral types
4363 echo "Checking to see how big your integers are..." >&4
4364 $cat >intsize.c <<'EOCP'
4368 printf("intsize=%d;\n", (int)sizeof(int));
4369 printf("longsize=%d;\n", (int)sizeof(long));
4370 printf("shortsize=%d;\n", (int)sizeof(short));
4375 if eval $compile_ok && ./intsize > /dev/null; then
4377 echo "Your integers are $intsize bytes long."
4378 echo "Your long integers are $longsize bytes long."
4379 echo "Your short integers are $shortsize bytes long."
4383 Help! I can't compile and run the intsize test program: please enlighten me!
4384 (This is probably a misconfiguration in your system or libraries, and
4385 you really ought to fix it. Still, I'll try anyway.)
4389 rp="What is the size of an integer (in bytes)?"
4393 rp="What is the size of a long integer (in bytes)?"
4397 rp="What is the size of a short integer (in bytes)?"
4403 $rm -f intsize intsize.*
4405 : see what type lseek is declared as in the kernel
4406 rp="What is the type used for lseek's offset on this system?"
4407 set off_t lseektype long stdio.h sys/types.h
4411 echo "Checking to see how big your file offsets are..." >&4
4413 #include <sys/types.h>
4417 printf("%d\n", (int)sizeof($lseektype));
4422 if eval $compile_ok; then
4424 echo "Your file offsets are $lseeksize bytes long."
4428 echo "(I can't seem to compile the test program. Guessing...)"
4429 rp="What is the size of your file offsets (in bytes)?"
4435 : see what type file positions are declared as in the library
4436 rp="What is the type for file position used by fsetpos()?"
4437 set fpos_t fpostype long stdio.h sys/types.h
4442 *_t) zzz="$fpostype" ;;
4445 echo "Checking the size of $zzz..." >&4
4447 #include <sys/types.h>
4450 printf("%d\n", (int)sizeof($fpostype));
4455 if eval $compile_ok; then
4459 echo "(I can't execute the test program--guessing $fpossize.)" >&4
4462 echo "Your $zzz is $fpossize bytes long."
4468 echo "(I can't compile the test program. Guessing...)" >&4
4469 rp="What is the size of your file positions (in bytes)?"
4476 # Backward compatibility (uselfs is deprecated).
4478 "$define"|true|[yY]*)
4481 *** Configure -Duselfs is deprecated, using -Duselargefiles instead.
4483 uselargefiles="$define"
4487 case "$lseeksize:$fpossize" in
4490 You can have files larger than 2 gigabytes.
4493 *) case "$uselargefiles" in
4494 "$undef"|false|[nN]*) dflt='n' ;;
4499 Perl can be built to understand large files (files larger than 2 gigabytes)
4500 on some systems. To do so, Configure can be run with -Duselargefiles.
4502 If this doesn't make any sense to you, just accept the default '$dflt'.
4504 rp='Try to understand large files, if available?'
4507 y|Y) val="$define" ;;
4514 case "$uselargefiles" in
4516 : Look for a hint-file generated 'call-back-unit'. If the
4517 : user has specified that a large files perl is to be built,
4518 : we may need to set or change some other defaults.
4519 if $test -f uselargefiles.cbu; then
4520 echo "Your platform has some specific hints for large file builds, using them..."
4521 . ./uselargefiles.cbu
4523 echo "Rechecking to see how big your file offsets are..." >&4
4525 #include <sys/types.h>
4529 printf("%d\n", (int)sizeof($lseektype));
4534 if eval $compile_ok; then
4536 $echo "Your file offsets are now $lseeksize bytes long."
4540 echo "(I can't seem to compile the test program. Guessing...)"
4541 rp="What is the size of your file offsets (in bytes)?"
4546 *_t) zzz="$fpostype" ;;
4549 $echo $n "Rechecking the size of $zzz...$c" >&4
4551 #include <sys/types.h>
4554 printf("%d\n", (int)sizeof($fpostype));
4559 if eval $compile_ok; then
4564 echo "(I can't execute the test program--guessing $fpossize.)" >&4
4567 echo " $fpossize bytes." >&4
4573 echo "(I can't compile the test program. Guessing...)" >&4
4574 rp="What is the size of your file positions (in bytes)?"
4584 case "$usemorebits" in
4585 "$define"|true|[yY]*)
4586 use64bitint="$define"
4587 uselongdouble="$define"
4588 usemorebits="$define"
4590 *) usemorebits="$undef"
4595 case "$uselonglong" in
4596 "$define"|true|[yY]*)
4599 *** Configure -Duselonglong is deprecated, using -Duse64bitint instead.
4601 use64bitint="$define"
4604 case "$use64bits" in
4605 "$define"|true|[yY]*)
4608 *** Configure -Duse64bits is deprecated, using -Duse64bitint instead.
4610 use64bitint="$define"
4613 case "$use64bitints" in
4614 "$define"|true|[yY]*)
4617 *** There is no Configure -Duse64bitints, using -Duse64bitint instead.
4619 use64bitint="$define"
4622 case "$use64bitsint" in
4623 "$define"|true|[yY]*)
4626 *** There is no Configure -Duse64bitsint, using -Duse64bitint instead.
4628 use64bitint="$define"
4631 case "$uselonglongs" in
4632 "$define"|true|[yY]*)
4635 *** There is no Configure -Duselonglongs, using -Duse64bitint instead.
4637 use64bitint="$define"
4640 case "$use64bitsall" in
4641 "$define"|true|[yY]*)
4644 *** There is no Configure -Duse64bitsall, using -Duse64bitall instead.
4646 use64bitall="$define"
4651 *-DUSE_LONG_LONG*|*-DUSE_64_BIT_INT*|*-DUSE_64_BIT_ALL*) use64bitint="$define";;
4653 case "$use64bitall" in
4654 "$define"|true|[yY]*) use64bitint="$define" ;;
4660 You have natively 64-bit long integers.
4664 *) case "$use64bitint" in
4665 "$define"|true|[yY]*) dflt='y';;
4670 Perl can be built to take advantage of 64-bit integer types
4671 on some systems. To do so, Configure can be run with -Duse64bitint.
4672 Choosing this option will most probably introduce binary incompatibilities.
4674 If this doesn't make any sense to you, just accept the default '$dflt'.
4676 rp='Try to use 64-bit integers, if available?'
4679 [yY]*) val="$define" ;;
4687 case "$use64bitall" in
4688 "$define"|true|[yY]*) dflt='y' ;;
4689 *) case "$longsize" in
4697 You may also choose to try maximal 64-bitness. It means using as much
4698 64-bitness as possible on the platform. This in turn means even more
4699 binary incompatibilities. On the other hand, your platform may not
4700 have any more 64-bitness available than what you already have chosen.
4702 If this doesn't make any sense to you, just accept the default '$dflt'.
4704 rp='Try to use maximal 64-bit support, if available?'
4707 [yY]*) val="$define" ;;
4712 case "$use64bitall" in
4714 case "$use64bitint" in
4718 Since you have chosen a maximally 64-bit build, I'm also turning on
4719 the use of 64-bit integers.
4721 use64bitint="$define" ;;
4726 case "$use64bitint" in
4727 "$define"|true|[yY]*)
4728 : Look for a hint-file generated 'call-back-unit'. If the
4729 : user has specified that a 64-bit perl is to be built,
4730 : we may need to set or change some other defaults.
4731 if $test -f use64bitint.cbu; then
4732 echo "Your platform has some specific hints for 64-bit integers, using them..."
4736 4) case "$archname64" in
4737 '') archname64=64int ;;
4744 case "$use64bitall" in
4745 "$define"|true|[yY]*)
4746 : Look for a hint-file generated 'call-back-unit'. If the
4747 : user has specified that a maximally 64-bit perl is to be built,
4748 : we may need to set or change some other defaults.
4749 if $test -f use64bitall.cbu; then
4750 echo "Your platform has some specific hints for 64-bit builds, using them..."
4754 4) case "$archname64" in
4755 ''|64int) archname64=64all ;;
4763 echo "Checking for GNU C Library..." >&4
4764 cat >gnulibc.c <<EOM
4776 if eval $compile_ok && ./gnulibc; then
4778 echo "You are using the GNU C Library"
4781 echo "You are not using the GNU C Library"
4787 : see if nm is to be used to determine whether a symbol is defined or not
4791 case "$d_gnulibc" in
4794 echo "nm probably won't work on the GNU C Library." >&4
4800 if $test "$osname" = aix -a ! -f /lib/syscalls.exp; then
4802 echo "Whoops! This is an AIX system without /lib/syscalls.exp!" >&4
4803 echo "'nm' won't be sufficient on this sytem." >&4
4809 '') dflt=`$egrep 'inlibc|csym' $rsrc/Configure | wc -l 2>/dev/null`
4810 if $test $dflt -gt 20; then
4820 true|$define) dflt=y;;
4827 I can use $nm to extract the symbols from your C libraries. This
4828 is a time consuming task which may generate huge output on the disk (up
4829 to 3 megabytes) but that should make the symbols extraction faster. The
4830 alternative is to skip the 'nm' extraction part and to compile a small
4831 test program instead to determine whether each symbol is present. If
4832 you have a fast C compiler and/or if your 'nm' output cannot be parsed,
4833 this may be the best solution.
4835 You probably shouldn't let me use 'nm' if you are using the GNU C Library.
4838 rp="Shall I use $nm to extract C symbols from the libraries?"
4841 [Nn]*) usenm=false;;
4850 : nm options which may be necessary
4852 '') if $test -f /mach_boot; then
4854 elif $test -d /usr/ccs/lib; then
4855 nm_opt='-p' # Solaris (and SunOS?)
4856 elif $test -f /dgux; then
4858 elif $test -f /lib64/rld; then
4859 nm_opt='-p' # 64-bit Irix
4865 : nm options which may be necessary for shared libraries but illegal
4866 : for archive libraries. Thank you, Linux.
4867 case "$nm_so_opt" in
4868 '') case "$myuname" in
4870 if $nm --help | $grep 'dynamic' > /dev/null 2>&1; then
4871 nm_so_opt='--dynamic'
4880 : get list of predefined functions in a handy place
4885 *-lc_s*) libc=`./loc libc_s$_a $libc $libpth`
4892 *) for thislib in $libs; do
4895 : Handle C library specially below.
4898 thislib=`echo $thislib | $sed -e 's/^-l//'`
4899 if try=`./loc lib$thislib.$so.'*' X $libpth`; $test -f "$try"; then
4901 elif try=`./loc lib$thislib.$so X $libpth`; $test -f "$try"; then
4903 elif try=`./loc lib$thislib$_a X $libpth`; $test -f "$try"; then
4905 elif try=`./loc $thislib$_a X $libpth`; $test -f "$try"; then
4907 elif try=`./loc lib$thislib X $libpth`; $test -f "$try"; then
4909 elif try=`./loc $thislib X $libpth`; $test -f "$try"; then
4911 elif try=`./loc Slib$thislib$_a X $xlibpth`; $test -f "$try"; then
4916 libnames="$libnames $try"
4918 *) libnames="$libnames $thislib" ;;
4927 for xxx in $libpth; do
4928 $test -r $1 || set $xxx/libc.$so
4929 : The messy sed command sorts on library version numbers.
4931 set `echo blurfl; echo $xxx/libc.$so.[0-9]* | \
4932 tr ' ' $trnl | egrep -v '\.[A-Za-z]*$' | $sed -e '
4934 s/[0-9][0-9]*/0000&/g
4935 s/0*\([0-9][0-9][0-9][0-9][0-9]\)/\1/g
4938 sort | $sed -e 's/^.* //'`
4941 $test -r $1 || set /usr/ccs/lib/libc.$so
4942 $test -r $1 || set /lib/libsys_s$_a
4948 if $test -r "$1"; then
4949 echo "Your (shared) C library seems to be in $1."
4951 elif $test -r /lib/libc && $test -r /lib/clib; then
4952 echo "Your C library seems to be in both /lib/clib and /lib/libc."
4954 libc='/lib/clib /lib/libc'
4955 if $test -r /lib/syslib; then
4956 echo "(Your math library is in /lib/syslib.)"
4957 libc="$libc /lib/syslib"
4959 elif $test -r "$libc" || (test -h "$libc") >/dev/null 2>&1; then
4960 echo "Your C library seems to be in $libc, as you said before."
4961 elif $test -r $incpath/usr/lib/libc$_a; then
4962 libc=$incpath/usr/lib/libc$_a;
4963 echo "Your C library seems to be in $libc. That's fine."
4964 elif $test -r /lib/libc$_a; then
4966 echo "Your C library seems to be in $libc. You're normal."
4968 if tans=`./loc libc$_a blurfl/dyick $libpth`; $test -r "$tans"; then
4970 elif tans=`./loc libc blurfl/dyick $libpth`; $test -r "$tans"; then
4971 libnames="$libnames "`./loc clib blurfl/dyick $libpth`
4972 elif tans=`./loc clib blurfl/dyick $libpth`; $test -r "$tans"; then
4974 elif tans=`./loc Slibc$_a blurfl/dyick $xlibpth`; $test -r "$tans"; then
4976 elif tans=`./loc Mlibc$_a blurfl/dyick $xlibpth`; $test -r "$tans"; then
4979 tans=`./loc Llibc$_a blurfl/dyick $xlibpth`
4981 if $test -r "$tans"; then
4982 echo "Your C library seems to be in $tans, of all places."
4988 if $test $xxx = apollo -o -r "$libc" || (test -h "$libc") >/dev/null 2>&1; then
4992 If the guess above is wrong (which it might be if you're using a strange
4993 compiler, or your machine supports multiple models), you can override it here.
4998 echo $libpth | tr ' ' $trnl | sort | uniq > libpath
5000 I can't seem to find your C library. I've looked in the following places:
5003 $sed 's/^/ /' libpath
5006 None of these seems to contain your C library. I need to get its name...
5011 rp='Where is your C library?'
5016 echo $libc $libnames | tr ' ' $trnl | sort | uniq > libnames
5017 set X `cat libnames`
5020 case $# in 1) xxx=file; esac
5021 echo "Extracting names from the following $xxx for later perusal:" >&4
5023 $sed 's/^/ /' libnames >&4
5025 $echo $n "This may take a while...$c" >&4
5029 *$so*) $nm $nm_so_opt $nm_opt $file 2>/dev/null;;
5030 *) $nm $nm_opt $file 2>/dev/null;;
5035 $grep fprintf libc.tmp > libc.ptf
5036 xscan='eval "<libc.ptf $com >libc.list"; $echo $n ".$c" >&4'
5037 xrun='eval "<libc.tmp $com >libc.list"; echo "done" >&4'
5039 if com="$sed -n -e 's/__IO//' -e 's/^.* $xxx *_[_.]*//p' -e 's/^.* $xxx *//p'";\
5041 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5043 elif com="$sed -n -e 's/^__*//' -e 's/^\([a-zA-Z_0-9$]*\).*xtern.*/\1/p'";\
5045 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5047 elif com="$sed -n -e '/|UNDEF/d' -e '/FUNC..GL/s/^.*|__*//p'";\
5049 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5051 elif com="$sed -n -e 's/^.* D __*//p' -e 's/^.* D //p'";\
5053 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5055 elif com="$sed -n -e 's/^_//' -e 's/^\([a-zA-Z_0-9]*\).*xtern.*text.*/\1/p'";\
5057 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5059 elif com="$sed -n -e 's/^.*|FUNC |GLOB .*|//p'";\
5061 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5063 elif com="$grep '|' | $sed -n -e '/|COMMON/d' -e '/|DATA/d' \
5064 -e '/ file/d' -e 's/^\([^ ]*\).*/\1/p'";\
5066 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5068 elif com="$sed -n -e 's/^.*|FUNC |GLOB .*|//p' -e 's/^.*|FUNC |WEAK .*|//p'";\
5070 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5072 elif com="$sed -n -e 's/^__//' -e '/|Undef/d' -e '/|Proc/s/ .*//p'";\
5074 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5076 elif com="$sed -n -e 's/^.*|Proc .*|Text *| *//p'";\
5078 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5080 elif com="$sed -n -e '/Def. Text/s/.* \([^ ]*\)\$/\1/p'";\
5082 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5084 elif com="$sed -n -e 's/^[-0-9a-f ]*_\(.*\)=.*/\1/p'";\
5086 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5088 elif com="$sed -n -e 's/.*\.text n\ \ \ \.//p'";\
5090 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5092 elif com="sed -n -e 's/^__.*//' -e 's/[ ]*D[ ]*[0-9]*.*//p'";\
5094 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5097 $nm -p $* 2>/dev/null >libc.tmp
5098 $grep fprintf libc.tmp > libc.ptf
5099 if com="$sed -n -e 's/^.* [ADTSIW] *_[_.]*//p' -e 's/^.* [ADTSIW] //p'";\
5100 eval $xscan; $contains '^fprintf$' libc.list >/dev/null 2>&1
5106 echo "$nm didn't seem to work right. Trying $ar instead..." >&4
5108 if $ar t $libc > libc.tmp && $contains '^fprintf$' libc.tmp >/dev/null 2>&1; then
5109 for thisname in $libnames $libc; do
5110 $ar t $thisname >>libc.tmp
5112 $sed -e "s/\\$_o\$//" < libc.tmp > libc.list
5114 elif test "X$osname" = "Xos2" && $ar tv $libc > libc.tmp; then
5115 # Repeat libc to extract forwarders to DLL entries too
5116 for thisname in $libnames $libc; do
5117 $ar tv $thisname >>libc.tmp
5118 # Revision 50 of EMX has bug in $ar.
5119 # it will not extract forwarders to DLL entries
5120 # Use emximp which will extract exactly them.
5121 emximp -o tmp.imp $thisname \
5123 $sed -e 's/^\([_a-zA-Z0-9]*\) .*$/\1/p' \
5124 < tmp.imp >>libc.tmp
5127 $sed -e "s/\\$_o\$//" -e 's/^ \+//' < libc.tmp > libc.list
5130 echo "$ar didn't seem to work right." >&4
5131 echo "Maybe this is a Cray...trying bld instead..." >&4
5132 if bld t $libc | $sed -e 's/.*\///' -e "s/\\$_o:.*\$//" > libc.list
5134 for thisname in $libnames; do
5136 $sed -e 's/.*\///' -e "s/\\$_o:.*\$//" >>libc.list
5137 $ar t $thisname >>libc.tmp
5141 echo "That didn't work either. Giving up." >&4
5148 if $test -f /lib/syscalls.exp; then
5150 echo "Also extracting names from /lib/syscalls.exp for good ole AIX..." >&4
5151 $sed -n 's/^\([^ ]*\)[ ]*syscall[0-9]*$/\1/p' /lib/syscalls.exp >>libc.list
5155 $rm -f libnames libpath
5157 : is a C symbol defined?
5160 -v) tf=libc.tmp; tc=""; tdc="";;
5161 -a) tf=libc.tmp; tc="[0]"; tdc="[]";;
5162 *) tlook="^$1\$"; tf=libc.list; tc="()"; tdc="()";;
5165 case "$reuseval-$4" in
5167 true-*) tx=no; eval "tval=\$$4"; case "$tval" in "") tx=yes;; esac;;
5173 if $contains $tlook $tf >/dev/null 2>&1;
5178 echo "int main() { extern short $1$tdc; printf(\"%hd\", $1$tc); }" > t.c;
5179 if $cc $optimize $ccflags $ldflags -o t t.c $libs >/dev/null 2>&1;
5187 $define) tval=true;;
5193 : define an is-in-libc? function
5194 inlibc='echo " "; td=$define; tu=$undef;
5195 sym=$1; var=$2; eval "was=\$$2";
5197 case "$reuseval$was" in
5207 echo "$sym() found." >&4;
5208 case "$was" in $undef) . ./whoa; esac; eval "$var=\$td";;
5210 echo "$sym() NOT found." >&4;
5211 case "$was" in $define) . ./whoa; esac; eval "$var=\$tu";;
5215 $define) echo "$sym() found." >&4;;
5216 *) echo "$sym() NOT found." >&4;;
5220 : see if sqrtl exists
5225 *-DUSE_LONG_DOUBLE*|*-DUSE_MORE_BITS*) uselongdouble="$define" ;;
5228 case "$uselongdouble" in
5229 $define|true|[yY]*) dflt='y';;
5234 Perl can be built to take advantage of long doubles which
5235 (if available) may give more accuracy and range for floating point numbers.
5237 If this doesn't make any sense to you, just accept the default '$dflt'.
5239 rp='Try to use long doubles if available?'
5242 y|Y) val="$define" ;;
5248 case "$uselongdouble" in
5249 true|[yY]*) uselongdouble="$define" ;;
5252 case "$uselongdouble" in
5254 : Look for a hint-file generated 'call-back-unit'. If the
5255 : user has specified that long doubles should be used,
5256 : we may need to set or change some other defaults.
5257 if $test -f uselongdouble.cbu; then
5258 echo "Your platform has some specific hints for long doubles, using them..."
5259 . ./uselongdouble.cbu
5262 (Your platform doesn't have any specific hints for long doubles.)
5268 case "$uselongdouble:$d_sqrtl" in
5272 *** You requested the use of long doubles but you do not seem to have
5273 *** the mathematic functions for long doubles. I'm disabling the use
5274 *** of long doubles.
5277 uselongdouble=$undef
5281 : determine the architecture name
5283 if xxx=`./loc arch blurfl $pth`; $test -f "$xxx"; then
5284 tarch=`arch`"-$osname"
5285 elif xxx=`./loc uname blurfl $pth`; $test -f "$xxx" ; then
5286 if uname -m > tmparch 2>&1 ; then
5287 tarch=`$sed -e 's/ *$//' -e 's/ /_/g' \
5288 -e 's/$/'"-$osname/" tmparch`
5296 case "$myarchname" in
5299 echo "(Your architecture name used to be $myarchname.)"
5306 *) dflt="$archname";;
5308 rp='What is your architecture name'
5311 case "$usethreads" in
5313 echo "Threads selected." >&4
5315 *-thread*) echo "...and architecture name already has -thread." >&4
5317 *) archname="$archname-thread"
5318 echo "...setting architecture name to $archname." >&4
5323 case "$usemultiplicity" in
5325 echo "Multiplicity selected." >&4
5327 *-multi*) echo "...and architecture name already has -multi." >&4
5329 *) archname="$archname-multi"
5330 echo "...setting architecture name to $archname." >&4
5335 case "$use64bitint$use64bitall" in
5337 case "$archname64" in
5341 case "$use64bitint" in
5342 "$define") echo "64 bit integers selected." >&4 ;;
5344 case "$use64bitall" in
5345 "$define") echo "64 bit memory model selected." >&4 ;;
5348 *-$archname64*) echo "...and architecture name already has $archname64." >&4
5350 *) archname="$archname-$archname64"
5351 echo "...setting architecture name to $archname." >&4
5357 case "$uselongdouble" in
5359 echo "Long doubles selected." >&4
5361 *-ld*) echo "...and architecture name already has -ld." >&4
5363 *) archname="$archname-ld"
5364 echo "...setting architecture name to $archname." >&4
5370 : determine root of directory hierarchy where package will be installed.
5373 dflt=`./loc . /usr/local /usr/local /local /opt /usr`
5381 By default, $package will be installed in $dflt/bin, manual pages
5382 under $dflt/man, etc..., i.e. with $dflt as prefix for all
5383 installation directories. Typically this is something like /usr/local.
5384 If you wish to have binaries under /usr/bin but other parts of the
5385 installation under /usr/local, that's ok: you will be prompted
5386 separately for each of the installation directories, the prefix being
5387 only used to set the defaults.
5391 rp='Installation prefix to use?'
5399 *) oldprefix="$prefix";;
5409 $define|true) afs=true ;;
5410 $undef|false) afs=false ;;
5411 *) if test -d /afs; then
5419 echo "AFS may be running... I'll be extra cautious then..." >&4
5421 echo "AFS does not seem to be running..." >&4
5424 : determine installation prefix for where package is to be installed.
5428 Since you are running AFS, I need to distinguish the directory in which
5429 files will reside from the directory in which they are installed (and from
5430 which they are presumably copied to the former directory by occult means).
5433 case "$installprefix" in
5434 '') dflt=`echo $prefix | sed 's#^/afs/#/afs/.#'`;;
5435 *) dflt="$installprefix";;
5440 In some special cases, particularly when building $package for distribution,
5441 it is convenient to distinguish between the directory in which files should
5442 be installed from the directory ($prefix) in which they
5443 will eventually reside. For most users, these two directories are the same.
5446 case "$installprefix" in
5448 *) dflt=$installprefix;;
5452 rp='What installation prefix should I use for installing files?'
5454 installprefix="$ans"
5455 installprefixexp="$ansexp"
5457 : set the prefixit variable, to compute a suitable default value
5458 prefixit='case "$3" in
5460 case "$oldprefix" in
5461 "") eval "$1=\"\$$2\"";;
5468 ""|" ") eval "$1=\"\$$2\"";;
5474 eval "tp=\"$oldprefix-\$$2-\""; eval "tp=\"$tp\"";
5476 --|/*--|\~*--) eval "$1=\"$prefix/$3\"";;
5477 /*-$oldprefix/*|\~*-$oldprefix/*)
5478 eval "$1=\`echo \$$2 | sed \"s,^$oldprefix,$prefix,\"\`";;
5479 *) eval "$1=\"\$$2\"";;
5484 : get the patchlevel
5486 echo "Getting the current patchlevel..." >&4
5487 if $test -r $rsrc/patchlevel.h;then
5488 revision=`awk '/define[ ]+PERL_REVISION/ {print $3}' $rsrc/patchlevel.h`
5489 patchlevel=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
5490 subversion=`awk '/define[ ]+PERL_SUBVERSION/ {print $3}' $rsrc/patchlevel.h`
5491 api_revision=`awk '/define[ ]+PERL_API_REVISION/ {print $3}' $rsrc/patchlevel.h`
5492 api_version=`awk '/define[ ]+PERL_API_VERSION/ {print $3}' $rsrc/patchlevel.h`
5493 api_subversion=`awk '/define[ ]+PERL_API_SUBVERSION/ {print $3}' $rsrc/patchlevel.h`
5502 $echo "(You have $package version $patchlevel subversion $subversion.)"
5505 : XXX Should be a Configure test for double-dots in filenames.
5506 version=`echo $revision $patchlevel $subversion | \
5507 $awk '{ printf "%d_%d_%d\n", $1, $2, $3 }'`
5508 api_versionstring=`echo $api_revision $api_version $api_subversion | \
5509 $awk '{ printf "%d_%d_%d\n", $1, $2, $3 }'`
5512 version=`echo $revision $patchlevel $subversion | \
5513 $awk '{ printf "%d.%d.%d\n", $1, $2, $3 }'`
5514 api_versionstring=`echo $api_revision $api_version $api_subversion | \
5515 $awk '{ printf "%d.%d.%d\n", $1, $2, $3 }'`
5518 : Special case the 5.005_xx maintenance series, which used 5.005
5519 : without any subversion label as a subdirectory in $sitelib
5520 if test "${api_revision}${api_version}${api_subversion}" = "550"; then
5521 api_versionstring='5.005'
5524 : determine installation style
5525 : For now, try to deduce it from prefix unless it is already set.
5526 : Reproduce behavior of 5.005 and earlier, maybe drop that in 5.7.
5527 case "$installstyle" in
5528 '') case "$prefix" in
5529 *perl*) dflt='lib';;
5530 *) dflt='lib/perl5' ;;
5533 *) dflt="$installstyle" ;;
5535 : Probably not worth prompting for this since we prompt for all
5536 : the directories individually, and the prompt would be too long and
5540 : determine where private library files go
5541 : Usual default is /usr/local/lib/perl5/$version.
5542 : Also allow things like /opt/perl/lib/$version, since
5543 : /opt/perl/lib/perl5... would be redundant.
5544 : The default "style" setting is made in installstyle.U
5545 case "$installstyle" in
5546 *lib/perl5*) set dflt privlib lib/$package/$version ;;
5547 *) set dflt privlib lib/$version ;;
5552 There are some auxiliary files for $package that need to be put into a
5553 private library directory that is accessible by everyone.
5557 rp='Pathname where the private library files will reside?'
5560 privlibexp="$ansexp"
5561 : Change installation prefix, if necessary.
5562 if $test X"$prefix" != X"$installprefix"; then
5563 installprivlib=`echo $privlibexp | sed "s#^$prefix#$installprefix#"`
5565 installprivlib="$privlibexp"
5568 : set the prefixup variable, to restore leading tilda escape
5569 prefixup='case "$prefixexp" in
5571 *) eval "$1=\`echo \$$1 | sed \"s,^$prefixexp,$prefix,\"\`";;
5574 : determine where public architecture dependent libraries go
5577 : privlib default is /usr/local/lib/$package/$version
5578 : archlib default is /usr/local/lib/$package/$version/$archname
5579 : privlib may have an optional trailing /share.
5580 tdflt=`echo $privlib | $sed 's,/share$,,'`
5581 tdflt=$tdflt/$archname
5590 $spackage contains architecture-dependent library files. If you are
5591 sharing libraries in a heterogeneous environment, you might store
5592 these files in a separate location. Otherwise, you can just include
5593 them with the rest of the public library files.
5597 rp='Where do you want to put the public architecture-dependent libraries?'
5600 archlibexp="$ansexp"
5601 if $test X"$archlib" = X"$privlib"; then
5606 : Change installation prefix, if necessary.
5607 if $test X"$prefix" != X"$installprefix"; then
5608 installarchlib=`echo $archlibexp | sed "s#^$prefix#$installprefix#"`
5610 installarchlib="$archlibexp"
5614 : Binary compatibility with 5.005 is not possible for builds
5615 : with advanced features
5616 case "$usethreads$usemultiplicity" in
5618 bincompat5005="$undef"
5619 d_bincompat5005="$undef"
5623 This version of Perl can be compiled for binary compatibility with 5.005.
5624 If you decide to do so, you will be able to continue using most of the
5625 extensions that were compiled for Perl 5.005.
5628 case "$bincompat5005$d_bincompat5005" in
5629 *"$undef"*) dflt=n ;;
5632 rp='Binary compatibility with Perl 5.005?'
5635 y*) val="$define" ;;
5640 case "$d_bincompat5005" in
5642 bincompat5005="$define"
5644 *) bincompat5005="$undef"
5645 d_bincompat5005="$undef"
5652 : see if setuid scripts can be secure
5655 Some kernels have a bug that prevents setuid #! scripts from being
5656 secure. Some sites have disabled setuid #! scripts because of this.
5658 First let's decide if your kernel supports secure setuid #! scripts.
5659 (If setuid #! scripts would be secure but have been disabled anyway,
5660 don't say that they are secure if asked.)
5665 if $test -d /dev/fd; then
5666 echo "#!$ls" >reflect
5667 chmod +x,u+s reflect
5668 ./reflect >flect 2>&1
5669 if $contains "/dev/fd" flect >/dev/null; then
5670 echo "Congratulations, your kernel has secure setuid scripts!" >&4
5674 If you are not sure if they are secure, I can check but I'll need a
5675 username and password different from the one you are using right now.
5676 If you don't have such a username or don't want me to test, simply
5680 rp='Other username to test security of setuid scripts with?'
5685 case "$d_suidsafe" in
5686 '') echo "I'll assume setuid scripts are *not* secure." >&4
5689 echo "Well, the $hint value is *not* secure." >&4
5691 *) echo "Well, the $hint value *is* secure." >&4
5696 $rm -f reflect flect
5697 echo "#!$ls" >reflect
5698 chmod +x,u+s reflect
5701 echo '"su" will (probably) prompt you for '"$ans's password."
5702 su $ans -c './reflect >flect'
5703 if $contains "/dev/fd" flect >/dev/null; then
5704 echo "Okay, it looks like setuid scripts are secure." >&4
5707 echo "I don't think setuid scripts are secure." >&4
5712 rp='Does your kernel have *secure* setuid scripts?'
5715 [yY]*) val="$define";;
5720 echo "I don't think setuid scripts are secure (no /dev/fd directory)." >&4
5721 echo "(That's for file descriptors, not floppy disks.)"
5727 $rm -f reflect flect
5729 : now see if they want to do setuid emulation
5732 case "$d_suidsafe" in
5735 echo "No need to emulate SUID scripts since they are secure here." >& 4
5739 Some systems have disabled setuid scripts, especially systems where
5740 setuid scripts cannot be secure. On systems where setuid scripts have
5741 been disabled, the setuid/setgid bits on scripts are currently
5742 useless. It is possible for $package to detect those bits and emulate
5743 setuid/setgid in a secure fashion. This emulation will only work if
5744 setuid scripts have been disabled in your kernel.
5748 "$define") dflt=y ;;
5751 rp="Do you want to do setuid/setgid emulation?"
5754 [yY]*) val="$define";;
5762 : determine filename position in cpp output
5764 echo "Computing filename position in cpp output for #include directives..." >&4
5765 echo '#include <stdio.h>' > foo.c
5768 $cppstdin $cppflags $cppminus <foo.c 2>/dev/null | \
5769 $grep '^[ ]*#.*stdio\.h' | \
5770 while read cline; do
5773 while $test \$# -gt 0; do
5774 if $test -r \`echo \$1 | $tr -d '"'\`; then
5779 pos=\`expr \$pos + 1\`
5791 *) pos="${fieldn}th";;
5793 echo "Your cpp writes the filename in the $pos field of the line."
5795 : locate header file
5800 for usrincdir in $usrinc
5802 if test -f \$usrincdir/\$wanted; then
5803 echo "\$usrincdir/\$wanted"
5807 awkprg='{ print \$$fieldn }'
5808 echo "#include <\$wanted>" > foo\$\$.c
5809 $cppstdin $cppminus $cppflags < foo\$\$.c 2>/dev/null | \
5810 $grep "^[ ]*#.*\$wanted" | \
5811 while read cline; do
5812 name=\`echo \$cline | $awk "\$awkprg" | $tr -d '"'\`
5814 *[/\\\\]\$wanted) echo "\$name"; exit 1;;
5815 *[\\\\/]\$wanted) echo "\$name"; exit 1;;
5820 # status = 0: grep returned 0 lines, case statement not executed
5821 # status = 1: headerfile found
5822 # status = 2: while loop executed, no headerfile found
5826 if test \$status -eq 1; then
5833 : define an alternate in-header-list? function
5834 inhdr='echo " "; td=$define; tu=$undef; yyy=$@;
5835 cont=true; xxf="echo \"<\$1> found.\" >&4";
5836 case $# in 2) xxnf="echo \"<\$1> NOT found.\" >&4";;
5837 *) xxnf="echo \"<\$1> NOT found, ...\" >&4";;
5839 case $# in 4) instead=instead;; *) instead="at last";; esac;
5840 while $test "$cont"; do
5842 var=$2; eval "was=\$$2";
5843 if $test "$xxx" && $test -r "$xxx";
5845 eval "case \"\$$var\" in $undef) . ./whoa; esac"; eval "$var=\$td";
5848 eval "case \"\$$var\" in $define) . ./whoa; esac"; eval "$var=\$tu"; fi;
5849 set $yyy; shift; shift; yyy=$@;
5850 case $# in 0) cont="";;
5851 2) xxf="echo \"but I found <\$1> $instead.\" >&4";
5852 xxnf="echo \"and I did not find <\$1> either.\" >&4";;
5853 *) xxf="echo \"but I found <\$1\> instead.\" >&4";
5854 xxnf="echo \"there is no <\$1>, ...\" >&4";;
5858 do set $yyy; var=$2; eval "was=\$$2";
5859 eval "case \"\$$var\" in $define) . ./whoa; esac"; eval "$var=\$tu";
5860 set $yyy; shift; shift; yyy=$@;
5863 : see if this is a malloc.h system
5864 set malloc.h i_malloc
5867 : see if stdlib is available
5868 set stdlib.h i_stdlib
5871 : determine which malloc to compile in
5873 case "$usemymalloc" in
5874 ''|[yY]*|true|$define) dflt='y' ;;
5877 rp="Do you wish to attempt to use the malloc that comes with $package?"
5883 mallocsrc='malloc.c'
5884 mallocobj="malloc$_o"
5885 d_mymalloc="$define"
5888 : Remove malloc from list of libraries to use
5889 echo "Removing unneeded -lmalloc from library list" >&4
5890 set `echo X $libs | $sed -e 's/-lmalloc / /' -e 's/-lmalloc$//'`
5893 echo "libs = $libs" >&4
5905 : compute the return types of malloc and free
5907 $cat >malloc.c <<END
5911 #include <sys/types.h>
5925 case "$malloctype" in
5927 if $cc $ccflags -c -DTRY_MALLOC malloc.c >/dev/null 2>&1; then
5934 echo "Your system wants malloc to return '$malloctype', it would seem." >&4
5938 if $cc $ccflags -c -DTRY_FREE malloc.c >/dev/null 2>&1; then
5945 echo "Your system uses $freetype free(), it would seem." >&4
5949 After $package is installed, you may wish to install various
5950 add-on modules and utilities. Typically, these add-ons will
5951 be installed under $prefix with the rest
5952 of this package. However, you may wish to install such add-ons
5953 elsewhere under a different prefix.
5955 If you do not wish to put everything under a single prefix, that's
5956 ok. You will be prompted for the individual locations; this siteprefix
5957 is only used to suggest the defaults.
5959 The default should be fine for most people.
5963 rp='Installation prefix to use for add-on modules and utilities?'
5964 : XXX Here might be another good place for an installstyle setting.
5965 case "$siteprefix" in
5967 *) dflt=$siteprefix ;;
5970 : XXX Prefixit unit does not yet support siteprefix and vendorprefix
5972 case "$siteprefix" in
5976 *) oldsiteprefix="$prefix";;
5981 siteprefixexp="$ansexp"
5983 : determine where site specific libraries go.
5984 : Usual default is /usr/local/lib/perl5/site_perl/$version
5985 : The default "style" setting is made in installstyle.U
5986 : XXX No longer works with Prefixit stuff.
5987 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
5989 '') case "$installstyle" in
5990 *lib/perl5*) dflt=$siteprefix/lib/$package/site_$prog/$version ;;
5991 *) dflt=$siteprefix/lib/site_$prog/$version ;;
5999 The installation process will create a directory for
6000 site-specific extensions and modules. Most users find it convenient
6001 to place all site-specific files in this directory rather than in the
6002 main distribution directory.
6006 rp='Pathname for the site-specific library files?'
6009 sitelibexp="$ansexp"
6010 sitelib_stem=`echo "$sitelibexp" | sed "s,/$version$,,"`
6011 : Change installation prefix, if necessary.
6012 if $test X"$prefix" != X"$installprefix"; then
6013 installsitelib=`echo $sitelibexp | $sed "s#^$prefix#$installprefix#"`
6015 installsitelib="$sitelibexp"
6018 : determine where site specific architecture-dependent libraries go.
6019 : sitelib default is /usr/local/lib/perl5/site_perl/$version
6020 : sitearch default is /usr/local/lib/perl5/site_perl/$version/$archname
6021 : sitelib may have an optional trailing /share.
6023 '') dflt=`echo $sitelib | $sed 's,/share$,,'`
6024 dflt="$dflt/$archname"
6029 set sitearch sitearch none
6033 The installation process will also create a directory for
6034 architecture-dependent site-specific extensions and modules.
6038 rp='Pathname for the site-specific architecture-dependent library files?'
6041 sitearchexp="$ansexp"
6042 : Change installation prefix, if necessary.
6043 if $test X"$prefix" != X"$installprefix"; then
6044 installsitearch=`echo $sitearchexp | sed "s#^$prefix#$installprefix#"`
6046 installsitearch="$sitearchexp"
6051 The installation process will also create a directory for
6052 vendor-supplied add-ons. Vendors who supply perl with their system
6053 may find it convenient to place all vendor-supplied files in this
6054 directory rather than in the main distribution directory. This will
6055 ease upgrades between binary-compatible maintenance versions of perl.
6057 Of course you may also use these directories in whatever way you see
6058 fit. For example, you might use them to access modules shared over a
6059 company-wide network.
6061 The default answer should be fine for most people.
6062 This causes further questions about vendor add-ons to be skipped
6063 and no vendor-specific directories will be configured for perl.
6066 rp='Do you want to configure vendor-specific add-on directories?'
6067 case "$usevendorprefix" in
6068 define|true|[yY]*) dflt=y ;;
6069 *) : User may have set vendorprefix directly on Configure command line.
6070 case "$vendorprefix" in
6079 rp='Installation prefix to use for vendor-supplied add-ons?'
6080 case "$vendorprefix" in
6082 *) dflt=$vendorprefix ;;
6085 : XXX Prefixit unit does not yet support siteprefix and vendorprefix
6087 case "$vendorprefix" in
6091 *) oldvendorprefix="$prefix";;
6095 usevendorprefix="$define"
6097 vendorprefixexp="$ansexp"
6099 *) usevendorprefix="$undef"
6105 case "$vendorprefix" in
6106 '') d_vendorlib="$undef"
6110 *) d_vendorlib="$define"
6111 : determine where vendor-supplied modules go.
6112 : Usual default is /usr/local/lib/perl5/vendor_perl/$version
6113 case "$vendorlib" in
6115 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
6116 case "$installstyle" in
6117 *lib/perl5*) dflt=$vendorprefix/lib/$package/vendor_$prog/$version ;;
6118 *) dflt=$vendorprefix/lib/vendor_$prog/$version ;;
6121 *) dflt="$vendorlib"
6125 rp='Pathname for the vendor-supplied library files?'
6128 vendorlibexp="$ansexp"
6131 vendorlib_stem=`echo "$vendorlibexp" | sed "s,/$version$,,"`
6132 : Change installation prefix, if necessary.
6133 if $test X"$prefix" != X"$installprefix"; then
6134 installvendorlib=`echo $vendorlibexp | $sed "s#^$prefix#$installprefix#"`
6136 installvendorlib="$vendorlibexp"
6139 case "$vendorprefix" in
6140 '') d_vendorarch="$undef"
6144 *) d_vendorarch="$define"
6145 : determine where vendor-supplied architecture-dependent libraries go.
6146 : vendorlib default is /usr/local/lib/perl5/vendor_perl/$version
6147 : vendorarch default is /usr/local/lib/perl5/vendor_perl/$version/$archname
6148 : vendorlib may have an optional trailing /share.
6149 case "$vendorarch" in
6150 '') dflt=`echo $vendorlib | $sed 's,/share$,,'`
6151 dflt="$dflt/$archname"
6153 *) dflt="$vendorarch" ;;
6156 rp='Pathname for vendor-supplied architecture-dependent files?'
6159 vendorarchexp="$ansexp"
6162 : Change installation prefix, if necessary.
6163 if $test X"$prefix" != X"$installprefix"; then
6164 installvendorarch=`echo $vendorarchexp | sed "s#^$prefix#$installprefix#"`
6166 installvendorarch="$vendorarchexp"
6169 : Final catch-all directories to search
6172 Lastly, you can have perl look in other directories for extensions and
6173 modules in addition to those already specified.
6174 These directories will be searched after
6178 test X"$vendorlib" != "X" && echo ' ' $vendorlib
6179 test X"$vendorarch" != "X" && echo ' ' $vendorarch
6181 case "$otherlibdirs" in
6182 ''|' ') dflt='none' ;;
6183 *) dflt="$otherlibdirs" ;;
6186 Enter a colon-separated set of extra paths to include in perl's @INC
6187 search path, or enter 'none' for no extra paths.
6191 rp='Colon-separated list of additional directories for perl to search?'
6194 ' '|''|none) otherlibdirs=' ' ;;
6195 *) otherlibdirs="$ans" ;;
6197 case "$otherlibdirs" in
6201 set d_perl_otherlibdirs
6204 : Cruising for prototypes
6206 echo "Checking out function prototypes..." >&4
6207 $cat >prototype.c <<'EOCP'
6208 int main(int argc, char *argv[]) {
6211 if $cc $ccflags -c prototype.c >prototype.out 2>&1 ; then
6212 echo "Your C compiler appears to support function prototypes."
6215 echo "Your C compiler doesn't seem to understand function prototypes."
6222 case "$prototype" in
6224 *) ansi2knr='ansi2knr'
6229 This version of $package can only be compiled by a compiler that
6230 understands function prototypes. Unfortunately, your C compiler
6232 doesn't seem to understand them. Sorry about that.
6234 If GNU cc is available for your system, perhaps you could try that instead.
6236 Eventually, we hope to support building Perl with pre-ANSI compilers.
6237 If you would like to help in that effort, please contact <perlbug@perl.org>.
6239 Aborting Configure now.
6245 : determine where public executables go
6250 rp='Pathname where the public executables will reside?'
6252 if $test "X$ansexp" != "X$binexp"; then
6257 : Change installation prefix, if necessary.
6258 : XXX Bug? -- ignores Configure -Dinstallprefix setting.
6259 if $test X"$prefix" != X"$installprefix"; then
6260 installbin=`echo $binexp | sed "s#^$prefix#$installprefix#"`
6262 installbin="$binexp"
6265 : Find perl5.005 or later.
6266 echo "Looking for a previously installed perl5.005 or later... "
6268 '') for tdir in `echo "$binexp:$PATH" | $sed "s/$path_sep/ /g"`; do
6269 : Check if this perl is recent and can load a simple module
6270 if $test -x $tdir/perl && $tdir/perl -Mless -e 'use 5.005;' >/dev/null 2>&1; then
6273 elif $test -x $tdir/perl5 && $tdir/perl5 -Mless -e 'use 5.005;' >/dev/null 2>&1; then
6283 '') echo "None found. That's ok.";;
6284 *) echo "Using $perl5." ;;
6287 : Determine list of previous versions to include in @INC
6288 $cat > getverlist <<EOPL
6291 \$api_versionstring = "$api_versionstring";
6292 \$version = "$version";
6293 \$stem = "$sitelib_stem";
6294 \$archname = "$archname";
6296 $cat >> getverlist <<'EOPL'
6297 # Can't have leading @ because metaconfig interprets it as a command!
6298 ;@inc_version_list=();
6299 # XXX Redo to do opendir/readdir?
6302 ;@candidates = glob("5.*");
6308 # XXX ToDo: These comparisons must be reworked when two-digit
6309 # subversions come along, so that 5.7.10 compares as greater than
6310 # 5.7.3! By that time, hope that 5.6.x is sufficiently
6311 # widespread that we can use the built-in version vectors rather
6312 # than reinventing them here. For 5.6.0, however, we must
6313 # assume this script will likely be run by 5.005_0x. --AD 1/2000.
6314 foreach $d (@candidates) {
6315 if ($d lt $version) {
6316 if ($d ge $api_versionstring) {
6317 unshift(@inc_version_list, grep { -d } "$d/$archname", $d);
6319 elsif ($d ge "5.005") {
6320 unshift(@inc_version_list, grep { -d } $d);
6324 # Skip newer version. I.e. don't look in
6325 # 5.7.0 if we're installing 5.6.1.
6329 if (@inc_version_list) {
6330 print join(' ', @inc_version_list);
6333 # Blank space to preserve value for next Configure run.
6338 case "$inc_version_list" in
6339 '') if test -x "$perl5"; then
6340 dflt=`$perl5 getverlist`
6345 $undef) dflt='none' ;;
6346 *) dflt="$inc_version_list" ;;
6349 ''|' ') dflt=none ;;
6352 5.005) case "$bincompat5005" in
6353 $define|true|[yY]*) ;;
6360 In order to ease the process of upgrading, this version of perl
6361 can be configured to use modules built and installed with earlier
6362 versions of perl that were installed under $prefix. Specify here
6363 the list of earlier versions that this version of perl should check.
6364 If Configure detected no earlier versions of perl installed under
6365 $prefix, then the list will be empty. Answer 'none' to tell perl
6366 to not search earlier versions.
6368 The default should almost always be sensible, so if you're not sure,
6369 just accept the default.
6372 rp='List of earlier versions to include in @INC?'
6375 [Nn]one|''|' ') inc_version_list=' ' ;;
6376 *) inc_version_list="$ans" ;;
6378 case "$inc_version_list" in
6380 inc_version_list_init='0';;
6381 *) inc_version_list_init=`echo $inc_version_list |
6382 $sed -e 's/^/"/' -e 's/ /","/g' -e 's/$/",0/'`
6387 : determine whether to install perl also as /usr/bin/perl
6390 if $test -d /usr/bin -a "X$installbin" != X/usr/bin; then
6392 Many scripts expect perl to be installed as /usr/bin/perl.
6393 I can install the perl you are about to compile also as /usr/bin/perl
6394 (in addition to $installbin/perl).
6396 case "$installusrbinperl" in
6397 "$undef"|[nN]*) dflt='n';;
6400 rp="Do you want to install perl as /usr/bin/perl?"
6403 [yY]*) val="$define";;
6409 set installusrbinperl
6412 : see if dld is available
6416 : see if dlopen exists
6423 : determine which dynamic loading, if any, to compile in
6425 dldir="ext/DynaLoader"
6438 $define) dflt='y' ;;
6441 $define) dflt='y' ;;
6443 : Does a dl_xxx.xs file exist for this operating system
6444 $test -f $rsrc/$dldir/dl_${osname}.xs && dflt='y'
6447 rp="Do you wish to use dynamic loading?"
6454 if $test -f $rsrc/$dldir/dl_${osname}.xs ; then
6455 dflt="$dldir/dl_${osname}.xs"
6456 elif $test "$d_dlopen" = "$define" ; then
6457 dflt="$dldir/dl_dlopen.xs"
6458 elif $test "$i_dld" = "$define" ; then
6459 dflt="$dldir/dl_dld.xs"
6464 *) dflt="$dldir/$dlsrc"
6467 echo "The following dynamic loading files are available:"
6468 : Can not go over to $dldir because getfile has path hard-coded in.
6469 tdir=`pwd`; cd $rsrc; $ls -C $dldir/dl*.xs; cd $tdir
6470 rp="Source file to use for dynamic loading"
6476 dlsrc=`echo $ans | $sed -e 's%.*/\([^/]*\)$%\1%'`
6480 Some systems may require passing special flags to $cc -c to
6481 compile modules that will be used to create a shared library.
6482 To use no flags, say "none".
6485 case "$cccdlflags" in
6486 '') case "$gccversion" in
6487 '') case "$osname" in
6489 next) dflt='none' ;;
6490 irix*) dflt='-KPIC' ;;
6491 svr4*|esix*|solaris) dflt='-KPIC' ;;
6492 sunos) dflt='-pic' ;;
6496 *) case "$osname" in
6497 svr4*|esix*|solaris) dflt='-fPIC' ;;
6502 *) dflt="$cccdlflags" ;;
6504 rp="Any special flags to pass to $cc -c to compile shared library modules?"
6507 none) cccdlflags=' ' ;;
6508 *) cccdlflags="$ans" ;;
6513 Some systems use ld to create libraries that can be dynamically loaded,
6514 while other systems (such as those using ELF) use $cc.
6518 '') $cat >try.c <<'EOM'
6519 /* Test for whether ELF binaries are produced */
6524 int i = open("a.out",O_RDONLY);
6527 if(read(i,b,4)==4 && b[0]==127 && b[1]=='E' && b[2]=='L' && b[3]=='F')
6528 exit(0); /* succeed (yes, it's ELF) */
6533 if $cc $ccflags try.c >/dev/null 2>&1 && ./a.out; then
6535 You appear to have ELF support. I'll use $cc to build dynamic libraries.
6539 echo "I'll use ld to build dynamic libraries."
6548 rp="What command should be used to create dynamic libraries?"
6554 Some systems may require passing special flags to $ld to create a
6555 library that can be dynamically loaded. If your ld flags include
6556 -L/other/path options to locate libraries outside your loader's normal
6557 search path, you may need to specify those -L options here as well. To
6558 use no flags, say "none".
6561 case "$lddlflags" in
6562 '') case "$osname" in
6563 beos) dflt='-nostart' ;;
6565 case "$gccversion" in
6566 '') dflt="$dflt +vnocompatwarnings" ;;
6569 linux|irix*) dflt='-shared' ;;
6570 next) dflt='none' ;;
6571 solaris) dflt='-G' ;;
6572 sunos) dflt='-assert nodefinitions' ;;
6573 svr4*|esix*) dflt="-G $ldflags" ;;
6577 *) dflt="$lddlflags" ;;
6580 : Try to guess additional flags to pick up local libraries.
6581 : Be careful not to append to a plain 'none'
6585 for thisflag in $ldflags; do
6590 *) dflt="$dflt $thisflag" ;;
6597 ''|' ') dflt='none' ;;
6600 rp="Any special flags to pass to $ld to create a dynamically loaded library?"
6603 none) lddlflags=' ' ;;
6604 *) lddlflags="$ans" ;;
6609 Some systems may require passing special flags to $cc to indicate that
6610 the resulting executable will use dynamic linking. To use no flags,
6614 case "$ccdlflags" in
6615 '') case "$osname" in
6616 hpux) dflt='-Wl,-E' ;;
6617 linux) dflt='-rdynamic' ;;
6618 next) dflt='none' ;;
6619 sunos) dflt='none' ;;
6623 *) dflt="$ccdlflags" ;;
6625 rp="Any special flags to pass to $cc to use dynamic linking?"
6628 none) ccdlflags=' ' ;;
6629 *) ccdlflags="$ans" ;;
6643 # No dynamic loading being used, so don't bother even to prompt.
6646 *) case "$useshrplib" in
6647 '') case "$osname" in
6648 svr4*|dgux|dynixptx|esix|powerux|beos|cygwin*)
6650 also='Building a shared libperl is required for dynamic loading to work on your system.'
6655 also='Building a shared libperl is needed for MAB support.'
6673 The perl executable is normally obtained by linking perlmain.c with
6674 libperl${_a}, any static extensions (usually just DynaLoader), and
6675 any other libraries needed on this system (such as -lm, etc.). Since
6676 your system supports dynamic loading, it is probably possible to build
6677 a shared libperl.$so. If you will have more than one executable linked
6678 to libperl.$so, this will significantly reduce the size of each
6679 executable, but it may have a noticeable affect on performance. The
6680 default is probably sensible for your system.
6684 rp="Build a shared libperl.$so (y/n)"
6688 useshrplib='true' ;;
6689 *) useshrplib='false' ;;
6694 case "$useshrplib" in
6698 # Figure out a good name for libperl.so. Since it gets stored in
6699 # a version-specific architecture-dependent library, the version
6700 # number isn't really that important, except for making cc/ld happy.
6702 # A name such as libperl.so.3.1
6703 majmin="libperl.$so.$patchlevel.$subversion"
6704 # A name such as libperl.so.301
6705 majonly=`echo $patchlevel $subversion |
6706 $awk '{printf "%d%02d", $1, $2}'`
6707 majonly=libperl.$so.$majonly
6708 # I'd prefer to keep the os-specific stuff here to a minimum, and
6709 # rely on figuring it out from the naming of libc.
6710 case "${osname}${osvers}" in
6713 # XXX How handle the --version stuff for MAB?
6715 linux*) # ld won't link with a bare -lperl otherwise.
6718 cygwin*) # include version
6719 dflt=`echo libperl$version | sed -e 's/\./_/g'`$lib_ext
6721 *) # Try to guess based on whether libc has major.minor.
6723 *libc.$so.[0-9]*.[0-9]*) dflt=$majmin ;;
6724 *libc.$so.[0-9]*) dflt=$majonly ;;
6725 *) dflt=libperl.$so ;;
6735 I need to select a good name for the shared libperl. If your system uses
6736 library names with major and minor numbers, then you might want something
6737 like $majmin. Alternatively, if your system uses a single version
6738 number for shared libraries, then you might want to use $majonly.
6739 Or, your system might be quite happy with a simple libperl.$so.
6741 Since the shared libperl will get installed into a version-specific
6742 architecture-dependent directory, the version number of the shared perl
6743 library probably isn't important, so the default should be o.k.
6746 rp='What name do you want to give to the shared libperl?'
6749 echo "Ok, I'll use $libperl"
6752 libperl="libperl${_a}"
6756 # Detect old use of shrpdir via undocumented Configure -Dshrpdir
6760 WARNING: Use of the shrpdir variable for the installation location of
6761 the shared $libperl is not supported. It was never documented and
6762 will not work in this version. Let me (perlbug@perl.org)
6763 know of any problems this may cause.
6769 But your current setting of $shrpdir is
6770 the default anyway, so it's harmless.
6775 Further, your current attempted setting of $shrpdir
6776 conflicts with the value of $archlibexp/CORE
6777 that installperl will use.
6784 # How will the perl executable find the installed shared $libperl?
6785 # Add $xxx to ccdlflags.
6786 # If we can't figure out a command-line option, use $shrpenv to
6787 # set env LD_RUN_PATH. The main perl makefile uses this.
6788 shrpdir=$archlibexp/CORE
6791 if "$useshrplib"; then
6794 # We'll set it in Makefile.SH...
6800 xxx="-Wl,-R$shrpdir"
6802 linux|irix*|dec_osf)
6803 xxx="-Wl,-rpath,$shrpdir"
6806 # next doesn't like the default...
6809 # beos doesn't like the default, either.
6812 # hpux doesn't like the default, either.
6813 tmp_shrpenv="env LDOPTS=\"+s +b${shrpdir}\""
6816 tmp_shrpenv="env LD_RUN_PATH=$shrpdir"
6822 # Only add $xxx if it isn't already in ccdlflags.
6823 case " $ccdlflags " in
6825 *) ccdlflags="$ccdlflags $xxx"
6828 Adding $xxx to the flags
6829 passed to $ld so that the perl executable will find the
6830 installed shared $libperl.
6838 # Fix ccdlflags in AIX for building external extensions.
6839 # (For building Perl itself bare -bE:perl.exp is needed,
6840 # Makefile.SH takes care of this.)
6842 aix) ccdlflags="$ccdlflags -bE:$installarchlib/CORE/perl.exp" ;;
6844 # Respect a hint or command-line value.
6846 '') shrpenv="$tmp_shrpenv" ;;
6848 case "$ldlibpthname" in
6849 '') ldlibpthname=LD_LIBRARY_PATH ;;
6850 none) ldlibpthname='' ;;
6853 : determine where manual pages go
6854 set man1dir man1dir none
6858 $spackage has manual pages available in source form.
6862 echo "However, you don't have nroff, so they're probably useless to you."
6864 '') man1dir="none";;
6867 echo "If you don't want the manual sources installed, answer 'none'."
6872 lookpath="$prefixexp/man/man1 $prefixexp/man/l_man/man1"
6873 lookpath="$lookpath $prefixexp/man/p_man/man1"
6874 lookpath="$lookpath $prefixexp/man/u_man/man1"
6875 lookpath="$lookpath $prefixexp/man/man.1"
6877 */?_man*) dflt=`./loc . $prefixexp/l_man/man1 $lookpath` ;;
6878 *) dflt=`./loc . $prefixexp/man/man1 $lookpath` ;;
6888 rp="Where do the main $spackage manual pages (source) go?"
6890 if $test "X$man1direxp" != "X$ansexp"; then
6894 man1direxp="$ansexp"
6900 : Change installation prefix, if necessary.
6901 if $test X"$prefix" != X"$installprefix"; then
6902 installman1dir=`echo $man1direxp | $sed "s#^$prefix#$installprefix#"`
6904 installman1dir="$man1direxp"
6907 : What suffix to use on installed man pages
6914 rp="What suffix should be used for the main $spackage man pages?"
6916 '') case "$man1dir" in
6930 *) dflt="$man1ext";;
6937 : see if we can have long filenames
6939 first=123456789abcdef
6941 if (echo hi >$first) 2>/dev/null; then
6942 if $test -f 123456789abcde; then
6943 echo 'You cannot have filenames longer than 14 characters. Sigh.' >&4
6946 echo 'You can have filenames longer than 14 characters.'>&4
6951 You can't have filenames longer than 14 chars.
6952 You can't even think about them!
6958 $rm -rf 123456789abcde*
6960 : determine where library module manual pages go
6961 set man3dir man3dir none
6965 $spackage has manual pages for many of the library modules.
6971 However, you don't have nroff, so they're probably useless to you.
6974 '') man3dir="none";;
6978 case "$d_flexfnam" in
6981 However, your system can't handle the long file names like File::Basename.3.
6984 '') man3dir="none";;
6988 echo "If you don't want the manual sources installed, answer 'none'."
6989 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
6991 '') dflt=`echo "$man1dir" | $sed -e 's/man1/man3/g' -e 's/man\.1/man\.3/g'`
6992 if $test -d "$privlib/man/man3"; then
6995 WARNING: Previous versions of perl installed man3 pages into
6996 $privlib/man/man3. This version will suggest a
6997 new default of $dflt.
7001 rp='Do you wish to preserve the old behavior?(y/n)'
7004 y*) dflt="$privlib/man/man3" ;;
7009 *) dflt="$man3dir" ;;
7016 rp="Where do the $package library man pages (source) go?"
7019 man3direxp="$ansexp"
7025 : Change installation prefix, if necessary.
7026 if $test X"$prefix" != X"$installprefix"; then
7027 installman3dir=`echo $man3direxp | $sed "s#^$prefix#$installprefix#"`
7029 installman3dir="$man3direxp"
7032 : What suffix to use on installed man pages
7038 rp="What suffix should be used for the $package library man pages?"
7040 '') case "$man3dir" in
7054 *) dflt="$man3ext";;
7061 : see if we have to deal with yellow pages, now NIS.
7062 if $test -d /usr/etc/yp || $test -d /etc/yp; then
7063 if $test -f /usr/etc/nibindd; then
7065 echo "I'm fairly confident you're on a NeXT."
7067 rp='Do you get the hosts file via NetInfo?'
7076 y*) hostcat='nidump hosts .';;
7077 *) case "$hostcat" in
7078 nidump*) hostcat='';;
7088 '') if $contains '^\+' /etc/passwd >/dev/null 2>&1; then
7096 rp='Are you getting the hosts file via yellow pages?'
7099 y*) hostcat='ypcat hosts';;
7100 *) hostcat='cat /etc/hosts';;
7106 '') test -f /etc/hosts && hostcat='cat /etc/hosts';;
7109 '') test -f /etc/group && groupcat='cat /etc/group';;
7112 '') test -f /etc/passwd && passcat='cat /etc/passwd';;
7115 : now get the host name
7117 echo "Figuring out host name..." >&4
7118 case "$myhostname" in
7120 echo 'Maybe "hostname" will work...'
7121 if tans=`sh -c hostname 2>&1` ; then
7129 if $test "$cont"; then
7131 echo 'Oh, dear. Maybe "/etc/systemid" is the key...'
7132 if tans=`cat /etc/systemid 2>&1` ; then
7134 phostname='cat /etc/systemid'
7135 echo "Whadyaknow. Xenix always was a bit strange..."
7138 elif $test -r /etc/systemid; then
7139 echo "(What is a non-Xenix system doing with /etc/systemid?)"
7142 if $test "$cont"; then
7143 echo 'No, maybe "uuname -l" will work...'
7144 if tans=`sh -c 'uuname -l' 2>&1` ; then
7146 phostname='uuname -l'
7148 echo 'Strange. Maybe "uname -n" will work...'
7149 if tans=`sh -c 'uname -n' 2>&1` ; then
7151 phostname='uname -n'
7153 echo 'Oh well, maybe I can mine it out of whoami.h...'
7154 if tans=`sh -c $contains' sysname $usrinc/whoami.h' 2>&1` ; then
7155 myhostname=`echo "$tans" | $sed 's/^.*"\(.*\)"/\1/'`
7156 phostname="sed -n -e '"'/sysname/s/^.*\"\\(.*\\)\"/\1/{'"' -e p -e q -e '}' <$usrinc/whoami.h"
7158 case "$myhostname" in
7159 '') echo "Does this machine have an identity crisis or something?"
7162 echo "Well, you said $myhostname before..."
7163 phostname='echo $myhostname';;
7169 : you do not want to know about this
7174 if $test "$myhostname" ; then
7176 rp='Your host name appears to be "'$myhostname'".'" Right?"
7184 : bad guess or no guess
7185 while $test "X$myhostname" = X ; do
7187 rp="Please type the (one word) name of your host:"
7192 : translate upper to lower if necessary
7193 case "$myhostname" in
7195 echo "(Normalizing case in your host name)"
7196 myhostname=`echo $myhostname | ./tr '[A-Z]' '[a-z]'`
7200 case "$myhostname" in
7202 dflt=`expr "X$myhostname" : "X[^.]*\(\..*\)"`
7203 myhostname=`expr "X$myhostname" : "X\([^.]*\)\."`
7204 echo "(Trimming domain name from host name--host name is now $myhostname)"
7206 *) case "$mydomain" in
7209 test "X$hostcat" = "Xypcat hosts" &&
7210 ypmatch "$myhostname" hosts 2>/dev/null |\
7211 $sed -e 's/[ ]*#.*//; s/$/ /' > hosts && \
7214 test "X$hostcat" != "X" &&
7215 $hostcat | $sed -n -e "s/[ ]*#.*//; s/\$/ /
7216 /[ ]$myhostname[ . ]/p" > hosts
7219 $test x`$awk "/[0-9].*[ ]$myhostname$tmp_re/ { sum++ }
7220 END { print sum }" hosts` = x1 || tmp_re="[ ]"
7221 dflt=.`$awk "/[0-9].*[ ]$myhostname$tmp_re/ {for(i=2; i<=NF;i++) print \\\$i}" \
7222 hosts | $sort | $uniq | \
7223 $sed -n -e "s/$myhostname\.\([-a-zA-Z0-9_.]\)/\1/p"`
7224 case `$echo X$dflt` in
7225 X*\ *) echo "(Several hosts in /etc/hosts matched hostname)"
7228 X.) echo "(You do not have fully-qualified names in /etc/hosts)"
7233 tans=`./loc resolv.conf X /etc /usr/etc`
7234 if $test -f "$tans"; then
7235 echo "(Attempting domain name extraction from $tans)"
7236 dflt=.`$sed -n -e 's/ / /g' \
7237 -e 's/^search *\([^ ]*\).*/\1/p' $tans \
7238 | ./tr '[A-Z]' '[a-z]' 2>/dev/null`
7240 .) dflt=.`$sed -n -e 's/ / /g' \
7241 -e 's/^domain *\([^ ]*\).*/\1/p' $tans \
7242 | ./tr '[A-Z]' '[a-z]' 2>/dev/null`
7249 .) echo "(No help from resolv.conf either -- attempting clever guess)"
7250 dflt=.`sh -c domainname 2>/dev/null`
7253 .nis.*|.yp.*|.main.*) dflt=`echo $dflt | $sed -e 's/^\.[^.]*//'`;;
7258 .) echo "(Lost all hope -- silly guess then)"
7264 *) dflt="$mydomain";;
7268 rp="What is your domain name?"
7278 : translate upper to lower if necessary
7281 echo "(Normalizing case in your domain name)"
7282 mydomain=`echo $mydomain | ./tr '[A-Z]' '[a-z]'`
7286 : a little sanity check here
7287 case "$phostname" in
7290 case `$phostname | ./tr '[A-Z]' '[a-z]'` in
7291 $myhostname$mydomain|$myhostname) ;;
7293 case "$phostname" in
7295 echo "(That doesn't agree with your whoami.h file, by the way.)"
7298 echo "(That doesn't agree with your $phostname command, by the way.)"
7308 I need to get your e-mail address in Internet format if possible, i.e.
7309 something like user@host.domain. Please answer accurately since I have
7310 no easy means to double check it. The default value provided below
7311 is most probably close to reality but may not be valid from outside
7312 your organization...
7316 while test "$cont"; do
7318 '') dflt="$cf_by@$myhostname$mydomain";;
7319 *) dflt="$cf_email";;
7321 rp='What is your e-mail address?'
7327 rp='Address does not look like an Internet one. Use it anyway?'
7343 If you or somebody else will be maintaining perl at your site, please
7344 fill in the correct e-mail address here so that they may be contacted
7345 if necessary. Currently, the "perlbug" program included with perl
7346 will send mail to this address in addition to perlbug@perl.org. You may
7347 enter "none" for no administrator.
7350 case "$perladmin" in
7351 '') dflt="$cf_email";;
7352 *) dflt="$perladmin";;
7354 rp='Perl administrator e-mail address'
7358 : figure out how to guarantee perl startup
7359 case "$startperl" in
7361 case "$sharpbang" in
7365 I can use the #! construct to start perl on your system. This will
7366 make startup of perl scripts faster, but may cause problems if you
7367 want to share those scripts and perl is not in a standard place
7368 ($binexp/perl) on all your platforms. The alternative is to force
7369 a shell by starting the script with a single ':' character.
7373 rp='What shall I put after the #! to start up perl ("none" to not use #!)?'
7376 none) startperl=": # use perl";;
7377 *) startperl="#!$ans"
7378 if $test 30 -lt `echo "$ans" | wc -c`; then
7381 WARNING: Some systems limit the #! command to 32 characters.
7382 If you experience difficulty running Perl scripts with #!, try
7383 installing Perl in a directory with a shorter pathname.
7389 *) startperl=": # use perl"
7394 echo "I'll use $startperl to start perl scripts."
7396 : figure best path for perl in scripts
7399 perlpath="$binexp/perl"
7400 case "$startperl" in
7405 I will use the "eval 'exec'" idiom to start Perl on your system.
7406 I can use the full path of your Perl binary for this purpose, but
7407 doing so may cause problems if you want to share those scripts and
7408 Perl is not always in a standard place ($binexp/perl).
7412 rp="What path shall I use in \"eval 'exec'\"?"
7419 case "$startperl" in
7421 *) echo "I'll use $perlpath in \"eval 'exec'\"" ;;
7424 : determine where public executable scripts go
7425 set scriptdir scriptdir
7427 case "$scriptdir" in
7430 : guess some guesses
7431 $test -d /usr/share/scripts && dflt=/usr/share/scripts
7432 $test -d /usr/share/bin && dflt=/usr/share/bin
7433 $test -d /usr/local/script && dflt=/usr/local/script
7434 $test -d /usr/local/scripts && dflt=/usr/local/scripts
7435 $test -d $prefixexp/script && dflt=$prefixexp/script
7439 *) dflt="$scriptdir"
7444 Some installations have a separate directory just for executable scripts so
7445 that they can mount it across multiple architectures but keep the scripts in
7446 one spot. You might, for example, have a subdirectory of /usr/share for this.
7447 Or you might just lump your scripts in with all your other executables.
7451 rp='Where do you keep publicly executable scripts?'
7453 if $test "X$ansexp" != "X$scriptdirexp"; then
7457 scriptdirexp="$ansexp"
7458 : Change installation prefix, if necessary.
7459 if $test X"$prefix" != X"$installprefix"; then
7460 installscript=`echo $scriptdirexp | sed "s#^$prefix#$installprefix#"`
7462 installscript="$scriptdirexp"
7465 : determine where add-on public executables go
7467 '') dflt=$siteprefix/bin ;;
7471 rp='Pathname where the add-on public executables should be installed?'
7474 sitebinexp="$ansexp"
7475 : Change installation prefix, if necessary.
7476 if $test X"$prefix" != X"$installprefix"; then
7477 installsitebin=`echo $sitebinexp | sed "s#^$prefix#$installprefix#"`
7479 installsitebin="$sitebinexp"
7482 case "$useperlio" in
7483 $define|true|[yY]*) dflt='y';;
7488 Previous version of $package used the standard IO mechanisms as defined
7489 in <stdio.h>. Versions 5.003_02 and later of perl allow alternate IO
7490 mechanisms via a "PerlIO" abstraction, but the stdio mechanism is still
7491 the default. This abstraction layer can use AT&T's sfio (if you already
7492 have sfio installed) or regular stdio. Using PerlIO with sfio may cause
7493 problems with some extension modules. Using PerlIO with stdio is safe,
7494 but it is slower than plain stdio and therefore is not the default.
7496 If this doesn't make any sense to you, just accept the default '$dflt'.
7498 rp='Use the experimental PerlIO abstraction layer?'
7505 echo "Ok, doing things the stdio way"
7512 case "$vendorprefix" in
7513 '') d_vendorbin="$undef"
7517 *) d_vendorbin="$define"
7518 : determine where vendor-supplied executables go.
7519 case "$vendorbin" in
7520 '') dflt=$vendorprefix/bin ;;
7521 *) dflt="$vendorbin" ;;
7524 rp='Pathname for the vendor-supplied executables directory?'
7527 vendorbinexp="$ansexp"
7530 : Change installation prefix, if necessary.
7531 if $test X"$prefix" != X"$installprefix"; then
7532 installvendorbin=`echo $vendorbinexp | $sed "s#^$prefix#$installprefix#"`
7534 installvendorbin="$vendorbinexp"
7537 : see if qgcvt exists
7541 : check for length of double
7543 case "$doublesize" in
7545 echo "Checking to see how big your double precision numbers are..." >&4
7546 $cat >try.c <<'EOCP'
7550 printf("%d\n", (int)sizeof(double));
7555 if eval $compile_ok; then
7557 echo "Your double is $doublesize bytes long."
7560 echo "(I can't seem to compile the test program. Guessing...)"
7561 rp="What is the size of a double precision number (in bytes)?"
7569 : check for long doubles
7571 echo "Checking to see if you have long double..." >&4
7572 echo 'int main() { long double x = 7.0; }' > try.c
7574 if eval $compile; then
7576 echo "You have long double."
7579 echo "You do not have long double."
7585 : check for length of long double
7586 case "${d_longdbl}${longdblsize}" in
7589 echo "Checking to see how big your long doubles are..." >&4
7590 $cat >try.c <<'EOCP'
7594 printf("%d\n", sizeof(long double));
7599 if eval $compile; then
7600 longdblsize=`./try$exe_ext`
7601 echo "Your long doubles are $longdblsize bytes long."
7605 echo "(I can't seem to compile the test program. Guessing...)" >&4
7606 rp="What is the size of a long double (in bytes)?"
7610 if $test "X$doublesize" = "X$longdblsize"; then
7611 echo "(That isn't any different from an ordinary double.)"
7619 if $test X"$d_longdbl" = X"$define"; then
7621 echo "Checking how to print long doubles..." >&4
7623 if $test X"$sPRIfldbl" = X -a X"$doublesize" = X"$longdblsize"; then
7624 $cat >try.c <<'EOCP'
7625 #include <sys/types.h>
7629 printf("%.3f\n", d);
7633 if eval $compile; then
7637 sPRIfldbl='"f"'; sPRIgldbl='"g"'; sPRIeldbl='"e"';
7638 sPRIFldbl='"F"'; sPRIGldbl='"G"'; sPRIEldbl='"E"';
7639 echo "We will use %f."
7645 if $test X"$sPRIfldbl" = X; then
7646 $cat >try.c <<'EOCP'
7647 #include <sys/types.h>
7650 long double d = 123.456;
7651 printf("%.3llf\n", d);
7655 if eval $compile; then
7659 sPRIfldbl='"llf"'; sPRIgldbl='"llg"'; sPRIeldbl='"lle"';
7660 sPRIFldbl='"llF"'; sPRIGldbl='"llG"'; sPRIEldbl='"llE"';
7661 echo "We will use %llf."
7667 if $test X"$sPRIfldbl" = X; then
7668 $cat >try.c <<'EOCP'
7669 #include <sys/types.h>
7672 long double d = 123.456;
7673 printf("%.3Lf\n", d);
7677 if eval $compile; then
7681 sPRIfldbl='"Lf"'; sPRIgldbl='"Lg"'; sPRIeldbl='"Le"';
7682 sPRIFldbl='"LF"'; sPRIGldbl='"LG"'; sPRIEldbl='"LE"';
7683 echo "We will use %Lf."
7689 if $test X"$sPRIfldbl" = X; then
7690 $cat >try.c <<'EOCP'
7691 #include <sys/types.h>
7694 long double d = 123.456;
7695 printf("%.3lf\n", d);
7699 if eval $compile; then
7703 sPRIfldbl='"lf"'; sPRIgldbl='"lg"'; sPRIeldbl='"le"';
7704 sPRIFldbl='"lF"'; sPRIGldbl='"lG"'; sPRIEldbl='"lE"';
7705 echo "We will use %lf."
7711 if $test X"$sPRIfldbl" = X; then
7712 echo "Cannot figure out how to print long doubles." >&4
7719 case "$sPRIfldbl" in
7720 '') d_PRIfldbl="$undef"; d_PRIgldbl="$undef"; d_PRIeldbl="$undef";
7721 d_PRIFldbl="$undef"; d_PRIGldbl="$undef"; d_PRIEldbl="$undef";
7723 *) d_PRIfldbl="$define"; d_PRIgldbl="$define"; d_PRIeldbl="$define";
7724 d_PRIFldbl="$define"; d_PRIGldbl="$define"; d_PRIEldbl="$define";
7728 : Check how to convert floats to strings.
7730 echo "Checking for an efficient way to convert floats to strings."
7732 case "$uselongdouble" in
7733 "$define") echo "#define USE_LONG_DOUBLE" >>try.c ;;
7735 case "$d_longdbl" in
7736 "$define") echo "#define HAS_LONG_DOUBLE" >>try.c ;;
7738 case "$d_PRIgldbl" in
7739 "$define") echo "#define HAS_PRIgldbl" >>try.c ;;
7743 #define Gconvert(x,n,t,b) gconvert((x),(n),(t),(b))
7744 char *myname = "gconvert";
7747 #define Gconvert(x,n,t,b) gcvt((x),(n),(b))
7748 char *myname = "gcvt";
7751 #define Gconvert(x,n,t,b) qgcvt((x),(n),(b))
7752 char *myname = "qgcvt";
7753 #define DOUBLETYPE long double
7756 #if defined(USE_LONG_DOUBLE) && defined(HAS_LONG_DOUBLE) && defined(HAS_PRIgldbl)
7757 #define Gconvert(x,n,t,b) sprintf((b),"%.*"$sPRIgldbl,(n),(x))
7759 #define Gconvert(x,n,t,b) sprintf((b),"%.*g",(n),(x))
7761 char *myname = "sprintf";
7765 #if defined(USE_LONG_DOUBLE) && defined(HAS_LONG_DOUBLE)
7766 #define DOUBLETYPE long double
7768 #define DOUBLETYPE double
7774 #define I_STDLIB $i_stdlib
7780 checkit(expect, got)
7784 if (strcmp(expect, got)) {
7785 printf("%s oddity: Expected %s, got %s\n",
7786 myname, expect, got);
7796 /* This must be 1st test on (which?) platform */
7797 /* Alan Burlison <AlanBurlsin@unn.unisys.com> */
7798 Gconvert((DOUBLETYPE)0.1, 8, 0, buf);
7799 checkit("0.1", buf);
7801 Gconvert((DOUBLETYPE)1.0, 8, 0, buf);
7804 Gconvert((DOUBLETYPE)1.1, 8, 0, buf);
7805 checkit("1.1", buf);
7807 Gconvert((DOUBLETYPE)1.01, 8, 0, buf);
7808 checkit("1.01", buf);
7810 Gconvert((DOUBLETYPE)1.001, 8, 0, buf);
7811 checkit("1.001", buf);
7813 Gconvert((DOUBLETYPE)1.0001, 8, 0, buf);
7814 checkit("1.0001", buf);
7816 Gconvert((DOUBLETYPE)1.00001, 8, 0, buf);
7817 checkit("1.00001", buf);
7819 Gconvert((DOUBLETYPE)1.000001, 8, 0, buf);
7820 checkit("1.000001", buf);
7822 Gconvert((DOUBLETYPE)0.0, 8, 0, buf);
7825 Gconvert((DOUBLETYPE)-1.0, 8, 0, buf);
7828 /* Some Linux gcvt's give 1.e+5 here. */
7829 Gconvert((DOUBLETYPE)100000.0, 8, 0, buf);
7830 checkit("100000", buf);
7832 /* Some Linux gcvt's give -1.e+5 here. */
7833 Gconvert((DOUBLETYPE)-100000.0, 8, 0, buf);
7834 checkit("-100000", buf);
7839 case "$d_Gconvert" in
7840 gconvert*) xxx_list='gconvert gcvt sprintf' ;;
7841 gcvt*) xxx_list='gcvt gconvert sprintf' ;;
7842 *) xxx_list='sprintf gconvert gcvt' ;;
7845 case "$d_longdbl$uselongdouble$d_PRIgldbl" in
7846 "$define$define$define")
7847 xxx_list="`echo $xxx_list|sed s/sprintf//`"
7848 xxx_list="sprintf $xxx_list"
7850 "$define") xxx_list="qgcvt $xxx_list" ;;
7855 for xxx_convert in $xxx_list; do
7856 echo "Trying $xxx_convert..."
7858 set try -DTRY_$xxx_convert
7859 if eval $compile; then
7860 echo "$xxx_convert() found." >&4
7862 echo "I'll use $xxx_convert to convert floats into a string." >&4
7865 echo "...But $xxx_convert didn't work as I expected."
7868 echo "$xxx_convert NOT found." >&4
7872 case "$xxx_convert" in
7873 gconvert) d_Gconvert='gconvert((x),(n),(t),(b))' ;;
7874 gcvt) d_Gconvert='gcvt((x),(n),(b))' ;;
7875 qgcvt) d_Gconvert='qgcvt((x),(n),(b))' ;;
7876 *) case "$uselongdouble$d_longdbl$d_PRIgldbl" in
7877 "$define$define$define")
7878 d_Gconvert="sprintf((b),\"%.*\"$sPRIgldbl,(n),(x))" ;;
7879 *) d_Gconvert='sprintf((b),"%.*g",(n),(x))' ;;
7884 : Initialize h_fcntl
7887 : Initialize h_sysfile
7890 : access call always available on UNIX
7894 : locate the flags for 'access()'
7898 $cat >access.c <<'EOCP'
7899 #include <sys/types.h>
7904 #include <sys/file.h>
7913 : check sys/file.h first, no particular reason here
7914 if $test `./findhdr sys/file.h` && \
7915 $cc $cppflags -DI_SYS_FILE -o access access.c >/dev/null 2>&1 ; then
7917 echo "<sys/file.h> defines the *_OK access constants." >&4
7918 elif $test `./findhdr fcntl.h` && \
7919 $cc $cppflags -DI_FCNTL -o access access.c >/dev/null 2>&1 ; then
7921 echo "<fcntl.h> defines the *_OK access constants." >&4
7922 elif $test `./findhdr unistd.h` && \
7923 $cc $cppflags -DI_UNISTD -o access access.c >/dev/null 2>&1 ; then
7924 echo "<unistd.h> defines the *_OK access constants." >&4
7926 echo "I can't find the four *_OK access constants--I'll use mine." >&4
7932 : see if accessx exists
7933 set accessx d_accessx
7936 : see if alarm exists
7940 : see if atolf exists
7944 : see if atoll exists
7948 : Look for GNU-cc style attribute checking
7950 echo "Checking whether your compiler can handle __attribute__ ..." >&4
7951 $cat >attrib.c <<'EOCP'
7953 void croak (char* pat,...) __attribute__((format(printf,1,2),noreturn));
7955 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
7956 if $contains 'warning' attrib.out >/dev/null 2>&1; then
7957 echo "Your C compiler doesn't fully support __attribute__."
7960 echo "Your C compiler supports __attribute__."
7964 echo "Your C compiler doesn't seem to understand __attribute__ at all."
7971 : see if bcmp exists
7975 : see if bcopy exists
7979 : see if this is a unistd.h system
7980 set unistd.h i_unistd
7983 : see if getpgrp exists
7984 set getpgrp d_getpgrp
7987 case "$d_getpgrp" in
7990 echo "Checking to see which flavor of getpgrp is in use..."
7993 #include <sys/types.h>
7995 # include <unistd.h>
7999 if (getuid() == 0) {
8000 printf("(I see you are running Configure as super-user...)\n");
8004 if (getpgrp(1) == 0)
8013 if $cc -DTRY_BSD_PGRP $ccflags $ldflags -o set set.c $libs >/dev/null 2>&1 && ./set; then
8014 echo "You have to use getpgrp(pid) instead of getpgrp()." >&4
8016 elif $cc $ccflags $ldflags -o set set.c $libs >/dev/null 2>&1 && ./set; then
8017 echo "You have to use getpgrp() instead of getpgrp(pid)." >&4
8020 echo "I can't seem to compile and run the test program."
8022 xxx="a USG one, i.e. you use getpgrp()."
8024 # SVR4 systems can appear rather BSD-ish.
8027 xxx="a BSD one, i.e. you use getpgrp(pid)."
8031 xxx="probably a USG one, i.e. you use getpgrp()."
8036 echo "Assuming your getpgrp is $xxx" >&4
8045 : see if setpgrp exists
8046 set setpgrp d_setpgrp
8049 case "$d_setpgrp" in
8052 echo "Checking to see which flavor of setpgrp is in use..."
8055 #include <sys/types.h>
8057 # include <unistd.h>
8061 if (getuid() == 0) {
8062 printf("(I see you are running Configure as super-user...)\n");
8066 if (-1 == setpgrp(1, 1))
8069 if (setpgrp() != -1)
8075 if $cc -DTRY_BSD_PGRP $ccflags $ldflags -o set set.c $libs >/dev/null 2>&1 && ./set; then
8076 echo 'You have to use setpgrp(pid,pgrp) instead of setpgrp().' >&4
8078 elif $cc $ccflags $ldflags -o set set.c $libs >/dev/null 2>&1 && ./set; then
8079 echo 'You have to use setpgrp() instead of setpgrp(pid,pgrp).' >&4
8082 echo "(I can't seem to compile and run the test program.)"
8084 xxx="a USG one, i.e. you use setpgrp()."
8086 # SVR4 systems can appear rather BSD-ish.
8089 xxx="a BSD one, i.e. you use setpgrp(pid,pgrp)."
8093 xxx="probably a USG one, i.e. you use setpgrp()."
8098 echo "Assuming your setpgrp is $xxx" >&4
8106 : see if bzero exists
8110 : see if signal is declared as pointer to function returning int or void
8112 xxx=`./findhdr signal.h`
8113 $test "$xxx" && $cppstdin $cppminus $cppflags < $xxx >$$.tmp 2>/dev/null
8114 if $contains 'int.*\*[ ]*signal' $$.tmp >/dev/null 2>&1 ; then
8115 echo "You have int (*signal())() instead of void." >&4
8117 elif $contains 'void.*\*[ ]*signal' $$.tmp >/dev/null 2>&1 ; then
8118 echo "You have void (*signal())()." >&4
8120 elif $contains 'extern[ ]*[(\*]*signal' $$.tmp >/dev/null 2>&1 ; then
8121 echo "You have int (*signal())() instead of void." >&4
8123 elif $contains 'void.*\*.*sig' $$.tmp >/dev/null 2>&1 ; then
8124 echo "You have void (*signal())()." >&4
8127 case "$d_voidsig" in
8129 echo "I can't determine whether signal handler returns void or int..." >&4
8131 rp="What type does your signal handler return?"
8138 echo "As you already told me, signal handler returns void." >&4
8141 *) echo "As you already told me, signal handler returns int." >&4
8148 case "$d_voidsig" in
8149 "$define") signal_t="void";;
8154 : check for ability to cast large floats to 32-bit ints.
8156 echo 'Checking whether your C compiler can cast large floats to int32.' >&4
8157 if $test "$intsize" -ge 4; then
8164 #include <sys/types.h>
8166 $signal_t blech(s) int s; { exit(3); }
8173 signal(SIGFPE, blech);
8175 /* Don't let compiler optimize the test away. Store the number
8176 in a writable string for gcc to pass to sscanf under HP/UX.
8178 sprintf(str, "2147483647");
8179 sscanf(str, "%lf", &f); /* f = (double) 0x7fffffff; */
8183 /* x86 processors will probably give 0x8000 0000, which is a
8184 sign change. We don't want that. We want to mimic SPARC
8185 behavior here, which is to preserve the sign and give
8188 if (i32 != ($xxx) f)
8194 if eval $compile_ok; then
8198 echo "(I can't seem to compile the test program--assuming it can't)"
8206 echo "Nope, it can't."
8213 : check for ability to cast negative floats to unsigned
8215 echo 'Checking whether your C compiler can cast negative float to unsigned.' >&4
8218 #include <sys/types.h>
8220 $signal_t blech(s) int s; { exit(7); }
8221 $signal_t blech_in_list(s) int s; { exit(4); }
8222 unsigned long dummy_long(p) unsigned long p; { return p; }
8223 unsigned int dummy_int(p) unsigned int p; { return p; }
8224 unsigned short dummy_short(p) unsigned short p; { return p; }
8228 unsigned long along;
8230 unsigned short ashort;
8234 /* Frustrate gcc-2.7.2's optimizer which failed this test with
8235 a direct f = -123. assignment. gcc-2.8.0 reportedly
8236 optimized the whole file away
8238 /* Store the number in a writable string for gcc to pass to
8241 sprintf(str, "-123");
8242 sscanf(str, "%lf", &f); /* f = -123.; */
8244 signal(SIGFPE, blech);
8245 along = (unsigned long)f;
8246 aint = (unsigned int)f;
8247 ashort = (unsigned short)f;
8248 if (along != (unsigned long)-123)
8250 if (aint != (unsigned int)-123)
8252 if (ashort != (unsigned short)-123)
8254 sprintf(str, "1073741824.");
8255 sscanf(str, "%lf", &f); /* f = (double)0x40000000; */
8258 along = (unsigned long)f;
8259 if (along != 0x80000000)
8263 along = (unsigned long)f;
8264 if (along != 0x7fffffff)
8268 along = (unsigned long)f;
8269 if (along != 0x80000001)
8273 signal(SIGFPE, blech_in_list);
8274 sprintf(str, "123.");
8275 sscanf(str, "%lf", &f); /* f = 123.; */
8276 along = dummy_long((unsigned long)f);
8277 aint = dummy_int((unsigned int)f);
8278 ashort = dummy_short((unsigned short)f);
8279 if (along != (unsigned long)123)
8281 if (aint != (unsigned int)123)
8283 if (ashort != (unsigned short)123)
8290 if eval $compile_ok; then
8294 echo "(I can't seem to compile the test program--assuming it can't)"
8297 case "$castflags" in
8302 echo "Nope, it can't."
8309 : see if vprintf exists
8311 if set vprintf val -f d_vprintf; eval $csym; $val; then
8312 echo 'vprintf() found.' >&4
8314 $cat >vprintf.c <<'EOF'
8315 #include <varargs.h>
8317 int main() { xxx("foo"); }
8326 exit((unsigned long)vsprintf(buf,"%s",args) > 10L);
8330 if eval $compile && ./vprintf; then
8331 echo "Your vsprintf() returns (int)." >&4
8334 echo "Your vsprintf() returns (char*)." >&4
8338 echo 'vprintf() NOT found.' >&4
8348 : see if chown exists
8352 : see if chroot exists
8356 : see if chsize exists
8360 : check for const keyword
8362 echo 'Checking to see if your C compiler knows about "const"...' >&4
8363 $cat >const.c <<'EOCP'
8364 typedef struct spug { int drokk; } spug;
8371 if $cc -c $ccflags const.c >/dev/null 2>&1 ; then
8373 echo "Yup, it does."
8376 echo "Nope, it doesn't."
8381 : see if crypt exists
8383 if set crypt val -f d_crypt; eval $csym; $val; then
8384 echo 'crypt() found.' >&4
8388 cryptlib=`./loc Slibcrypt$_a "" $xlibpth`
8389 if $test -z "$cryptlib"; then
8390 cryptlib=`./loc Mlibcrypt$_a "" $xlibpth`
8394 if $test -z "$cryptlib"; then
8395 cryptlib=`./loc Llibcrypt$_a "" $xlibpth`
8399 if $test -z "$cryptlib"; then
8400 cryptlib=`./loc libcrypt$_a "" $libpth`
8404 if $test -z "$cryptlib"; then
8405 echo 'crypt() NOT found.' >&4
8414 : get csh whereabouts
8416 'csh') val="$undef" ;;
8421 : Respect a hint or command line value for full_csh.
8423 '') full_csh=$csh ;;
8426 : see if cuserid exists
8427 set cuserid d_cuserid
8430 : see if this is a limits.h system
8431 set limits.h i_limits
8434 : see if this is a float.h system
8438 : See if number of significant digits in a double precision number is known
8440 $cat >dbl_dig.c <<EOM
8450 printf("Contains DBL_DIG");
8453 $cppstdin $cppflags $cppminus < dbl_dig.c >dbl_dig.E 2>/dev/null
8454 if $contains 'DBL_DIG' dbl_dig.E >/dev/null 2>&1; then
8455 echo "DBL_DIG found." >&4
8458 echo "DBL_DIG NOT found." >&4
8465 : see if difftime exists
8466 set difftime d_difftime
8469 : see if this is a dirent system
8471 if xinc=`./findhdr dirent.h`; $test "$xinc"; then
8473 echo "<dirent.h> found." >&4
8476 if xinc=`./findhdr sys/dir.h`; $test "$xinc"; then
8477 echo "<sys/dir.h> found." >&4
8480 xinc=`./findhdr sys/ndir.h`
8482 echo "<dirent.h> NOT found." >&4
8487 : Look for type of directory structure.
8489 $cppstdin $cppflags $cppminus < "$xinc" > try.c
8491 case "$direntrytype" in
8494 $define) guess1='struct dirent' ;;
8495 *) guess1='struct direct' ;;
8498 *) guess1="$direntrytype"
8503 'struct dirent') guess2='struct direct' ;;
8504 *) guess2='struct dirent' ;;
8507 if $contains "$guess1" try.c >/dev/null 2>&1; then
8508 direntrytype="$guess1"
8509 echo "Your directory entries are $direntrytype." >&4
8510 elif $contains "$guess2" try.c >/dev/null 2>&1; then
8511 direntrytype="$guess2"
8512 echo "Your directory entries seem to be $direntrytype." >&4
8514 echo "I don't recognize your system's directory entries." >&4
8515 rp="What type is used for directory entries on this system?"
8523 : see if the directory entry stores field length
8525 $cppstdin $cppflags $cppminus < "$xinc" > try.c
8526 if $contains 'd_namlen' try.c >/dev/null 2>&1; then
8527 echo "Good, your directory entry keeps length information in d_namlen." >&4
8530 echo "Your directory entry does not know about the d_namlen field." >&4
8537 : see if dlerror exists
8540 set dlerror d_dlerror
8544 : see if dlfcn is available
8552 On a few systems, the dynamically loaded modules that perl generates and uses
8553 will need a different extension than shared libs. The default will probably
8561 rp='What is the extension of dynamically loaded modules'
8570 : Check if dlsym need a leading underscore
8576 echo "Checking whether your dlsym() needs a leading underscore ..." >&4
8577 $cat >dyna.c <<'EOM'
8586 #include <dlfcn.h> /* the dynamic linker include file for Sunos/Solaris */
8588 #include <sys/types.h>
8602 int mode = RTLD_LAZY ;
8604 handle = dlopen("./dyna.$dlext", mode) ;
8605 if (handle == NULL) {
8610 symbol = dlsym(handle, "fred") ;
8611 if (symbol == NULL) {
8612 /* try putting a leading underscore */
8613 symbol = dlsym(handle, "_fred") ;
8614 if (symbol == NULL) {
8627 : Call the object file tmp-dyna.o in case dlext=o.
8628 if $cc $ccflags $cccdlflags -c dyna.c > /dev/null 2>&1 &&
8629 mv dyna${_o} tmp-dyna${_o} > /dev/null 2>&1 &&
8630 $ld $lddlflags -o dyna.$dlext tmp-dyna${_o} > /dev/null 2>&1 &&
8631 $cc $ccflags -o fred $ldflags $cccdlflags $ccdlflags fred.c $libs > /dev/null 2>&1; then
8634 1) echo "Test program failed using dlopen." >&4
8635 echo "Perhaps you should not use dynamic loading." >&4;;
8636 2) echo "Test program failed using dlsym." >&4
8637 echo "Perhaps you should not use dynamic loading." >&4;;
8638 3) echo "dlsym needs a leading underscore" >&4
8640 4) echo "dlsym doesn't need a leading underscore." >&4;;
8643 echo "I can't compile and run the test program." >&4
8644 echo "I'm guessing that dlsym doesn't need a leading underscore." >&4
8649 $rm -f fred fred.? dyna.$dlext dyna.? tmp-dyna.?
8654 hasproto='varname=$1; func=$2; shift; shift;
8655 while $test $# -ge 2; do
8657 $define) echo "#include <$2>";;
8661 $cppstdin $cppflags $cppminus < try.c > tryout.c 2>/dev/null;
8662 if $contains "$func.*(" tryout.c >/dev/null 2>&1; then
8663 echo "$func() prototype found.";
8666 echo "$func() prototype NOT found.";
8671 $rm -f try.c tryout.c'
8673 : see if prototype for drand48 is available
8675 set d_drand48proto drand48 $i_stdlib stdlib.h $i_unistd unistd.h
8678 : see if dup2 exists
8682 : see if eaccess exists
8683 set eaccess d_eaccess
8686 : see if endgrent exists
8687 set endgrent d_endgrent
8690 : see if endhostent exists
8691 set endhostent d_endhent
8694 : see if endnetent exists
8695 set endnetent d_endnent
8698 : see if endprotoent exists
8699 set endprotoent d_endpent
8702 : see if endpwent exists
8703 set endpwent d_endpwent
8706 : see if endservent exists
8707 set endservent d_endsent
8710 : Locate the flags for 'open()'
8712 $cat >open3.c <<'EOCP'
8713 #include <sys/types.h>
8718 #include <sys/file.h>
8729 : check sys/file.h first to get FREAD on Sun
8730 if $test `./findhdr sys/file.h` && \
8731 set open3 -DI_SYS_FILE && eval $compile; then
8733 echo "<sys/file.h> defines the O_* constants..." >&4
8735 echo "and you have the 3 argument form of open()." >&4
8738 echo "but not the 3 argument form of open(). Oh, well." >&4
8741 elif $test `./findhdr fcntl.h` && \
8742 set open3 -DI_FCNTL && eval $compile; then
8744 echo "<fcntl.h> defines the O_* constants..." >&4
8746 echo "and you have the 3 argument form of open()." >&4
8749 echo "but not the 3 argument form of open(). Oh, well." >&4
8754 echo "I can't find the O_* constant definitions! You got problems." >&4
8760 : see which of string.h or strings.h is needed
8762 strings=`./findhdr string.h`
8763 if $test "$strings" && $test -r "$strings"; then
8764 echo "Using <string.h> instead of <strings.h>." >&4
8768 strings=`./findhdr strings.h`
8769 if $test "$strings" && $test -r "$strings"; then
8770 echo "Using <strings.h> instead of <string.h>." >&4
8772 echo "No string header found -- You'll surely have problems." >&4
8778 "$undef") strings=`./findhdr strings.h`;;
8779 *) strings=`./findhdr string.h`;;
8782 : check for non-blocking I/O stuff
8783 case "$h_sysfile" in
8784 true) echo "#include <sys/file.h>" > head.c;;
8787 true) echo "#include <fcntl.h>" > head.c;;
8788 *) echo "#include <sys/fcntl.h>" > head.c;;
8793 echo "Figuring out the flag used by open() for non-blocking I/O..." >&4
8794 case "$o_nonblock" in
8797 $cat >>try.c <<'EOCP'
8801 printf("O_NONBLOCK\n");
8805 printf("O_NDELAY\n");
8809 printf("FNDELAY\n");
8816 if eval $compile_ok; then
8818 case "$o_nonblock" in
8819 '') echo "I can't figure it out, assuming O_NONBLOCK will do.";;
8820 *) echo "Seems like we can use $o_nonblock.";;
8823 echo "(I can't compile the test program; pray O_NONBLOCK is right!)"
8826 *) echo "Using $hint value $o_nonblock.";;
8828 $rm -f try try.* .out core
8831 echo "Let's see what value errno gets from read() on a $o_nonblock file..." >&4
8837 #include <sys/types.h>
8840 #define MY_O_NONBLOCK $o_nonblock
8841 #ifndef errno /* XXX need better Configure test */
8852 #include <strings.h>
8854 $signal_t blech(x) int x; { exit(3); }
8856 $cat >> try.c <<'EOCP'
8864 pipe(pd); /* Down: child -> parent */
8865 pipe(pu); /* Up: parent -> child */
8868 close(pd[1]); /* Parent reads from pd[0] */
8869 close(pu[0]); /* Parent writes (blocking) to pu[1] */
8870 if (-1 == fcntl(pd[0], F_SETFL, MY_O_NONBLOCK))
8872 signal(SIGALRM, blech);
8874 if ((ret = read(pd[0], buf, 1)) > 0) /* Nothing to read! */
8876 sprintf(string, "%d\n", ret);
8877 write(2, string, strlen(string));
8880 if (errno == EAGAIN) {
8886 if (errno == EWOULDBLOCK)
8887 printf("EWOULDBLOCK\n");
8890 write(pu[1], buf, 1); /* Unblocks child, tell it to close our pipe */
8891 sleep(2); /* Give it time to close our pipe */
8893 ret = read(pd[0], buf, 1); /* Should read EOF */
8895 sprintf(string, "%d\n", ret);
8896 write(3, string, strlen(string));
8900 close(pd[0]); /* We write to pd[1] */
8901 close(pu[1]); /* We read from pu[0] */
8902 read(pu[0], buf, 1); /* Wait for parent to signal us we may continue */
8903 close(pd[1]); /* Pipe pd is now fully closed! */
8904 exit(0); /* Bye bye, thank you for playing! */
8908 if eval $compile_ok; then
8909 echo "$startsh" >mtry
8910 echo "./try >try.out 2>try.ret 3>try.err || exit 4" >>mtry
8912 ./mtry >/dev/null 2>&1
8914 0) eagain=`$cat try.out`;;
8915 1) echo "Could not perform non-blocking setting!";;
8916 2) echo "I did a successful read() for something that was not there!";;
8917 3) echo "Hmm... non-blocking I/O does not seem to be working!";;
8918 *) echo "Something terribly wrong happened during testing.";;
8920 rd_nodata=`$cat try.ret`
8921 echo "A read() system call with no data present returns $rd_nodata."
8922 case "$rd_nodata" in
8925 echo "(That's peculiar, fixing that to be -1.)"
8931 echo "Forcing errno EAGAIN on read() with no data available."
8935 echo "Your read() sets errno to $eagain when no data is available."
8938 status=`$cat try.err`
8940 0) echo "And it correctly returns 0 to signal EOF.";;
8941 -1) echo "But it also returns -1 to signal EOF, so be careful!";;
8942 *) echo "However, your read() returns '$status' on EOF??";;
8945 if test "$status" = "$rd_nodata"; then
8946 echo "WARNING: you can't distinguish between EOF and no data!"
8950 echo "I can't compile the test program--assuming errno EAGAIN will do."
8957 echo "Using $hint value $eagain."
8958 echo "Your read() returns $rd_nodata when no data is present."
8959 case "$d_eofnblk" in
8960 "$define") echo "And you can see EOF because read() returns 0.";;
8961 "$undef") echo "But you can't see EOF status from read() returned value.";;
8963 echo "(Assuming you can't see EOF status from read anyway.)"
8969 $rm -f try try.* .out core head.c mtry
8971 : see if fchmod exists
8975 : see if fchown exists
8979 : see if this is an fcntl system
8983 hasfield='varname=$1; struct=$2; field=$3; shift; shift; shift;
8984 while $test $# -ge 2; do
8986 $define) echo "#include <$2>";;
8990 echo "int main () { struct $struct foo; char* bar; bar = (char*)foo.$field; }" >> try.c;
8992 if eval $compile; then
9003 : see whether socket exists
9005 $echo $n "Hmm... $c" >&4
9006 if set socket val -f d_socket; eval $csym; $val; then
9007 echo "Looks like you have Berkeley networking support." >&4
9009 if set setsockopt val -f; eval $csym; $val; then
9012 echo "...but it uses the old BSD 4.1c interface, rather than 4.2." >&4
9016 if $contains socklib libc.list >/dev/null 2>&1; then
9017 echo "Looks like you have Berkeley networking support." >&4
9019 : we will have to assume that it supports the 4.2 BSD interface
9022 echo "You don't have Berkeley networking in libc$_a..." >&4
9023 if test "X$d_socket" = "X$define"; then
9024 echo "...but you seem to believe that you have sockets." >&4
9026 for net in net socket
9028 if test -f /usr/lib/lib$net$_a; then
9029 ( ($nm $nm_opt /usr/lib/lib$net$_a | eval $nm_extract) || \
9030 $ar t /usr/lib/lib$net$_a) 2>/dev/null >> libc.list
9031 if $contains socket libc.list >/dev/null 2>&1; then
9036 echo "...but the Wollongong group seems to have hacked it in." >&4
9037 sockethdr="-I/usr/netinclude"
9040 echo "Found Berkeley sockets interface in lib$net." >& 4
9041 if $contains setsockopt libc.list >/dev/null 2>&1; then
9044 echo "...using the old BSD 4.1c interface, rather than 4.2." >&4
9051 if test "X$d_socket" != "X$define"; then
9052 echo "or anywhere else I see." >&4
9060 : see if socketpair exists
9061 set socketpair d_sockpair
9066 echo "Checking the availability of certain socket constants..." >& 4
9067 for ENUM in MSG_CTRUNC MSG_DONTROUTE MSG_OOB MSG_PEEK MSG_PROXY SCM_RIGHTS; do
9068 enum=`$echo $ENUM|./tr '[A-Z]' '[a-z]'`
9070 #include <sys/types.h>
9071 #include <sys/socket.h>
9077 set try; if eval $compile; then
9080 set d_${enum}; eval $setvar
9084 : see if sys/select.h has to be included
9085 set sys/select.h i_sysselct
9088 : see if we should include time.h, sys/time.h, or both
9090 if test "X$timeincl" = X; then
9091 echo "Testing to see if we should include <time.h>, <sys/time.h> or both." >&4
9092 $echo $n "I'm now running the test program...$c"
9093 $cat >try.c <<'EOCP'
9094 #include <sys/types.h>
9099 #ifdef SYSTIMEKERNEL
9102 #include <sys/time.h>
9105 #include <sys/select.h>
9114 struct timezone tzp;
9116 if (foo.tm_sec == foo.tm_sec)
9119 if (bar.tv_sec == bar.tv_sec)
9126 for s_timezone in '-DS_TIMEZONE' ''; do
9128 for s_timeval in '-DS_TIMEVAL' ''; do
9129 for i_systimek in '' '-DSYSTIMEKERNEL'; do
9130 for i_time in '' '-DI_TIME'; do
9131 for i_systime in '-DI_SYSTIME' ''; do
9134 set try $i_time $i_systime $i_systimek $sysselect $s_timeval $s_timezone
9135 if eval $compile; then
9136 set X $i_time $i_systime $i_systimek $sysselect $s_timeval
9140 $echo $n "Succeeded with $flags$c"
9152 *SYSTIMEKERNEL*) i_systimek="$define"
9153 timeincl=`./findhdr sys/time.h`
9154 echo "We'll include <sys/time.h> with KERNEL defined." >&4;;
9155 *) i_systimek="$undef";;
9158 *I_TIME*) i_time="$define"
9159 timeincl=`./findhdr time.h`" $timeincl"
9160 echo "We'll include <time.h>." >&4;;
9161 *) i_time="$undef";;
9164 *I_SYSTIME*) i_systime="$define"
9165 timeincl=`./findhdr sys/time.h`" $timeincl"
9166 echo "We'll include <sys/time.h>." >&4;;
9167 *) i_systime="$undef";;
9172 : check for fd_set items
9175 Checking to see how well your C compiler handles fd_set and friends ...
9177 $cat >fd_set.c <<EOCP
9178 #$i_systime I_SYS_TIME
9179 #$i_sysselct I_SYS_SELECT
9180 #$d_socket HAS_SOCKET
9181 #include <sys/types.h>
9183 #include <sys/socket.h> /* Might include <sys/bsdtypes.h> */
9186 #include <sys/time.h>
9189 #include <sys/select.h>
9198 #if defined(FD_SET) && defined(FD_CLR) && defined(FD_ISSET) && defined(FD_ZERO)
9205 set fd_set -DTRYBITS
9206 if eval $compile; then
9207 d_fds_bits="$define"
9209 echo "Well, your system knows about the normal fd_set typedef..." >&4
9211 echo "and you have the normal fd_set macros (just as I'd expect)." >&4
9212 d_fd_macros="$define"
9215 but not the normal fd_set macros! Gaaack! I'll have to cover for you.
9217 d_fd_macros="$undef"
9221 Hmm, your compiler has some difficulty with fd_set. Checking further...
9224 if eval $compile; then
9227 echo "Well, your system has some sort of fd_set available..." >&4
9229 echo "and you have the normal fd_set macros." >&4
9230 d_fd_macros="$define"
9233 but not the normal fd_set macros! Gross! More work for me...
9235 d_fd_macros="$undef"
9238 echo "Well, you got zip. That's OK, I can roll my own fd_set stuff." >&4
9241 d_fd_macros="$undef"
9246 : see if fgetpos exists
9247 set fgetpos d_fgetpos
9250 : see if flock exists
9254 : see if fork exists
9258 : see if pathconf exists
9259 set pathconf d_pathconf
9262 : see if fpathconf exists
9263 set fpathconf d_fpathconf
9267 : check for fpos64_t
9269 echo "Checking to see if you have fpos64_t..." >&4
9272 int main() { fpos64_t x = 7; }
9275 if eval $compile; then
9277 echo "You have fpos64_t."
9280 echo "You do not have fpos64_t."
9282 8) echo "(Your fpos_t is 64 bits, so you could use that.)" ;;
9289 : see if frexpl exists
9293 hasstruct='varname=$1; struct=$2; shift; shift;
9294 while $test $# -ge 2; do
9296 $define) echo "#include <$2>";;
9300 echo "int main () { struct $struct foo; }" >> try.c;
9302 if eval $compile; then
9311 : see if this is a sys/param system
9312 set sys/param.h i_sysparam
9315 : see if this is a sys/mount.h system
9316 set sys/mount.h i_sysmount
9319 : see if sys/types.h has to be included
9320 set sys/types.h i_systypes
9325 echo "Checking to see if your system supports struct fs_data..." >&4
9326 set d_fs_data_s fs_data $i_systypes sys/types.h $i_sysparam sys/param.h $i_sysmount sys/mount.h
9328 case "$d_fs_data_s" in
9329 "$define") echo "Yes, it does." ;;
9330 *) echo "No, it doesn't." ;;
9333 : see if fseeko exists
9337 8) echo "(Your long is 64 bits, so you could use fseek.)" ;;
9340 : see if fsetpos exists
9341 set fsetpos d_fsetpos
9345 : see if fstatfs exists
9346 set fstatfs d_fstatfs
9350 : see if statvfs exists
9351 set statvfs d_statvfs
9354 : see if fstatvfs exists
9355 set fstatvfs d_fstatvfs
9359 : see if ftello exists
9363 8) echo "(Your long is 64 bits, so you could use ftell.)" ;;
9366 : see if getcwd exists
9370 : see if getespwnam exists
9371 set getespwnam d_getespwnam
9375 : see if getfsstat exists
9376 set getfsstat d_getfsstat
9379 : see if getgrent exists
9380 set getgrent d_getgrent
9383 : see if gethostbyaddr exists
9384 set gethostbyaddr d_gethbyaddr
9387 : see if gethostbyname exists
9388 set gethostbyname d_gethbyname
9391 : see if gethostent exists
9392 set gethostent d_gethent
9395 : see how we will look up host name
9398 if set gethostname val -f d_gethname; eval $csym; $val; then
9399 echo 'gethostname() found.' >&4
9400 d_gethname="$define"
9403 if set uname val -f d_uname; eval $csym; $val; then
9406 uname() was found, but you're running xenix, and older versions of xenix
9407 have a broken uname(). If you don't really know whether your xenix is old
9408 enough to have a broken system call, use the default answer.
9415 rp='Is your uname() broken?'
9418 n*) d_uname="$define"; call=uname;;
9421 echo 'uname() found.' >&4
9428 case "$d_gethname" in
9429 '') d_gethname="$undef";;
9432 '') d_uname="$undef";;
9434 case "$d_uname$d_gethname" in
9439 Every now and then someone has a $call() that lies about the hostname
9440 but can't be fixed for political or economic reasons. If you wish, I can
9441 pretend $call() isn't there and maybe compute hostname at run-time
9442 thanks to the '$phostname' command.
9445 rp="Shall I ignore $call() from now on?"
9448 y*) d_uname="$undef" d_gethname="$undef"; $echo $n "Okay...$c";;
9451 case "$phostname" in
9453 *) case "$aphostname" in
9459 file=`./loc $file $file $pth`
9460 aphostname=`echo $file $*`
9465 case "$d_uname$d_gethname" in
9468 case "$phostname" in
9470 echo "There will be no way for $package to get your hostname." >&4;;
9472 echo "I'll use 'popen("'"'$aphostname'", "r")'"' to get your hostname." >&4
9476 case "$d_phostname" in
9477 '') d_phostname="$undef";;
9480 : see if this is a netdb.h system
9484 : see if prototypes for various gethostxxx netdb.h functions are available
9486 set d_gethostprotos gethostent $i_netdb netdb.h
9489 : see if getlogin exists
9490 set getlogin d_getlogin
9493 : see if getmnt exists
9497 : see if getmntent exists
9498 set getmntent d_getmntent
9501 : see if getnetbyaddr exists
9502 set getnetbyaddr d_getnbyaddr
9505 : see if getnetbyname exists
9506 set getnetbyname d_getnbyname
9509 : see if getnetent exists
9510 set getnetent d_getnent
9513 : see if prototypes for various getnetxxx netdb.h functions are available
9515 set d_getnetprotos getnetent $i_netdb netdb.h
9519 : see if getprotobyname exists
9520 set getprotobyname d_getpbyname
9523 : see if getprotobynumber exists
9524 set getprotobynumber d_getpbynumber
9527 : see if getprotoent exists
9528 set getprotoent d_getpent
9531 : see if getpgid exists
9532 set getpgid d_getpgid
9535 : see if getpgrp2 exists
9536 set getpgrp2 d_getpgrp2
9539 : see if getppid exists
9540 set getppid d_getppid
9543 : see if getpriority exists
9544 set getpriority d_getprior
9547 : see if prototypes for various getprotoxxx netdb.h functions are available
9549 set d_getprotoprotos getprotoent $i_netdb netdb.h
9552 : see if getprpwnam exists
9553 set getprpwnam d_getprpwnam
9556 : see if getpwent exists
9557 set getpwent d_getpwent
9561 : see if getservbyname exists
9562 set getservbyname d_getsbyname
9565 : see if getservbyport exists
9566 set getservbyport d_getsbyport
9569 : see if getservent exists
9570 set getservent d_getsent
9573 : see if prototypes for various getservxxx netdb.h functions are available
9575 set d_getservprotos getservent $i_netdb netdb.h
9578 : see if getspnam exists
9579 set getspnam d_getspnam
9582 : see if gettimeofday or ftime exists
9583 set gettimeofday d_gettimeod
9585 case "$d_gettimeod" in
9591 val="$undef"; set d_ftime; eval $setvar
9594 case "$d_gettimeod$d_ftime" in
9597 echo 'No ftime() nor gettimeofday() -- timing may be less accurate.' >&4
9601 : see if this is an grp system
9607 xxx=`./findhdr grp.h`
9608 $cppstdin $cppflags $cppminus < $xxx >$$.h
9610 if $contains 'gr_passwd' $$.h >/dev/null 2>&1; then
9622 set d_grpasswd; eval $setvar
9626 : see if hasmntopt exists
9627 set hasmntopt d_hasmntopt
9630 : see if this is a netinet/in.h or sys/in.h system
9631 set netinet/in.h i_niin sys/in.h i_sysin
9634 : see if arpa/inet.h has to be included
9635 set arpa/inet.h i_arpainet
9638 : see if htonl --and friends-- exists
9643 : Maybe they are macros.
9648 #include <sys/types.h>
9649 #$i_niin I_NETINET_IN
9651 #$i_arpainet I_ARPA_INET
9653 #include <netinet/in.h>
9659 #include <arpa/inet.h>
9662 printf("Defined as a macro.");
9665 $cppstdin $cppflags $cppminus < htonl.c >htonl.E 2>/dev/null
9666 if $contains 'Defined as a macro' htonl.E >/dev/null 2>&1; then
9668 echo "But it seems to be defined as a macro." >&4
9676 : see if iconv exists
9682 if set index val -f; eval $csym; $val; then
9683 if set strchr val -f d_strchr; eval $csym; $val; then
9684 if $contains strchr "$strings" >/dev/null 2>&1 ; then
9687 echo "strchr() found." >&4
9691 echo "index() found." >&4
9696 echo "index() found." >&4
9699 if set strchr val -f d_strchr; eval $csym; $val; then
9702 echo "strchr() found." >&4
9704 echo "No index() or strchr() found!" >&4
9709 set d_strchr; eval $setvar
9711 set d_index; eval $setvar
9713 : check whether inet_aton exists
9714 set inet_aton d_inetaton
9717 : see if inttypes.h is available
9718 : we want a real compile instead of Inhdr because some systems
9719 : have an inttypes.h which includes non-existent headers
9722 #include <inttypes.h>
9724 static int32_t foo32 = 0x12345678;
9728 if eval $compile; then
9729 echo "<inttypes.h> found." >&4
9732 echo "<inttypes.h> NOT found." >&4
9741 echo "Checking to see if you have int64_t..." >&4
9743 #include <sys/types.h>
9744 #$i_inttypes I_INTTYPES
9746 #include <inttypes.h>
9748 int main() { int64_t x = 7; }
9751 if eval $compile; then
9753 echo "You have int64_t."
9756 echo "You do not have int64_t."
9764 $cat >isascii.c <<'EOCP'
9776 if eval $compile; then
9777 echo "isascii() found." >&4
9780 echo "isascii() NOT found." >&4
9787 : see if isnan exists
9791 : see if isnanl exists
9795 : see if killpg exists
9799 : see if lchown exists
9801 $cat > try.c <<'EOCP'
9802 /* System header to define __stub macros and hopefully few prototypes,
9803 which can conflict with char lchown(); below. */
9805 /* Override any gcc2 internal prototype to avoid an error. */
9806 /* We use char because int might match the return type of a gcc2
9807 builtin and then its argument prototype would still apply. */
9810 /* The GNU C library defines this for functions which it implements
9811 to always fail with ENOSYS. Some functions are actually named
9812 something starting with __ and the normal name is an alias. */
9813 #if defined (__stub_lchown) || defined (__stub___lchown)
9821 if eval $compile; then
9822 $echo "lchown() found." >&4
9825 $echo "lchown() NOT found." >&4
9831 : See if number of significant digits in a double precision number is known
9833 $cat >ldbl_dig.c <<EOM
9843 printf("Contains LDBL_DIG");
9846 $cppstdin $cppflags $cppminus < ldbl_dig.c >ldbl_dig.E 2>/dev/null
9847 if $contains 'LDBL_DIG' ldbl_dig.E >/dev/null 2>&1; then
9848 echo "LDBL_DIG found." >&4
9851 echo "LDBL_DIG NOT found." >&4
9858 : see if link exists
9862 : see if localeconv exists
9863 set localeconv d_locconv
9866 : see if lockf exists
9870 : check for long long
9872 echo "Checking to see if you have long long..." >&4
9873 echo 'int main() { long long x = 7; return 0; }' > try.c
9875 if eval $compile; then
9877 echo "You have long long."
9880 echo "You do not have long long."
9886 : check for length of long long
9887 case "${d_longlong}${longlongsize}" in
9890 echo "Checking to see how big your long longs are..." >&4
9891 $cat >try.c <<'EOCP'
9895 printf("%d\n", (int)sizeof(long long));
9900 if eval $compile_ok; then
9901 longlongsize=`./try$exe_ext`
9902 echo "Your long longs are $longlongsize bytes long."
9906 echo "(I can't seem to compile the test program. Guessing...)"
9907 rp="What is the size of a long long (in bytes)?"
9911 if $test "X$longsize" = "X$longlongsize"; then
9912 echo "(That isn't any different from an ordinary long.)"
9918 : see if prototype for lseek is available
9920 set d_lseekproto lseek $i_systypes sys/types.h $i_unistd unistd.h
9923 : see if lstat exists
9927 : see if madvise exists
9928 set madvise d_madvise
9931 : see if mblen exists
9935 : see if mbstowcs exists
9936 set mbstowcs d_mbstowcs
9939 : see if mbtowc exists
9943 : see if memchr exists
9947 : see if memcmp exists
9951 : see if memcpy exists
9955 : see if memmove exists
9956 set memmove d_memmove
9959 : see if memset exists
9963 : see if mkdir exists
9967 : see if mkdtemp exists
9968 set mkdtemp d_mkdtemp
9971 : see if mkfifo exists
9975 : see if mkstemp exists
9976 set mkstemp d_mkstemp
9979 : see if mkstemps exists
9980 set mkstemps d_mkstemps
9983 : see if mktime exists
9987 : see if this is a sys/mman.h system
9988 set sys/mman.h i_sysmman
9991 : see if mmap exists
9994 : see what shmat returns
9995 : default to something harmless
9997 case "$i_sysmman$d_mmap" in
9999 $cat >mmap.c <<'END'
10000 #include <sys/mman.h>
10003 if $cc $ccflags -c mmap.c >/dev/null 2>&1; then
10008 echo "and it returns ($mmaptype)." >&4
10014 : see if modfl exists
10018 : see if mprotect exists
10019 set mprotect d_mprotect
10022 : see if msgctl exists
10023 set msgctl d_msgctl
10026 : see if msgget exists
10027 set msgget d_msgget
10030 : see if msgsnd exists
10031 set msgsnd d_msgsnd
10034 : see if msgrcv exists
10035 set msgrcv d_msgrcv
10038 : see how much of the 'msg*(2)' library is present.
10041 case "$d_msgctl$d_msgget$d_msgsnd$d_msgrcv" in
10042 *"$undef"*) h_msg=false;;
10046 case "`ipcs 2>&1`" in
10047 "SVID messages"*"not configured"*)
10048 echo "Your $osname does not have the msg*(2) configured." >&4
10051 set msgctl d_msgctl
10053 set msgget d_msgget
10055 set msgsnd d_msgsnd
10057 set msgrcv d_msgrcv
10063 : we could also check for sys/ipc.h ...
10064 if $h_msg && $test `./findhdr sys/msg.h`; then
10065 echo "You have the full msg*(2) library." >&4
10068 echo "You don't have the full msg*(2) library." >&4
10074 : see if msync exists
10078 : see if munmap exists
10079 set munmap d_munmap
10082 : see if nice exists
10088 echo "Checking which 64-bit integer type we could use..." >&4
10094 val='"unsigned int"'
10099 *) case "$longsize" in
10103 val='"unsigned long"'
10108 *) case "$d_longlong:$longlongsize" in
10113 val='"unsigned long long"'
10118 *) case "$d_int64_t" in
10136 case "$quadtype" in
10137 '') echo "Alas, no 64-bit integer types in sight." >&4
10140 *) if test X"$use64bitint" = Xdefine -o X"$longsize" = X8; then
10145 echo "We $verb use '$quadtype' for 64-bit integers." >&4
10150 : check for length of character
10152 case "$charsize" in
10154 echo "Checking to see how big your characters are (hey, you never know)..." >&4
10155 $cat >try.c <<'EOCP'
10159 printf("%d\n", (int)sizeof(char));
10164 if eval $compile_ok; then
10168 echo "(I can't seem to compile the test program. Guessing...)"
10175 rp="What is the size of a character (in bytes)?"
10182 $echo "Choosing the C types to be used for Perl's internal types..." >&4
10184 case "$use64bitint:$d_quad:$quadtype" in
10187 uvtype="$uquadtype"
10192 uvtype="unsigned long"
10198 case "$uselongdouble:$d_longdbl" in
10200 nvtype="long double"
10201 nvsize=$longdblsize
10208 $echo "(IV will be "$ivtype", $ivsize bytes)"
10209 $echo "(UV will be "$uvtype", $uvsize bytes)"
10210 $echo "(NV will be "$nvtype", $nvsize bytes)"
10213 #$i_inttypes I_INTTYPES
10215 #include <inttypes.h>
10220 int8_t i = INT8_MAX;
10221 uint8_t u = UINT8_MAX;
10222 printf("int8_t\n");
10225 int16_t i = INT16_MAX;
10226 uint16_t i = UINT16_MAX;
10227 printf("int16_t\n");
10230 int32_t i = INT32_MAX;
10231 uint32_t u = UINT32_MAX;
10232 printf("int32_t\n");
10238 '') case "$charsize" in
10240 u8type="unsigned char"
10249 if eval $compile; then
10250 case "`./try$exe_ext`" in
10251 int8_t) i8type=int8_t
10261 '') if $test $charsize -ge 1; then
10263 u8type="unsigned char"
10271 '') case "$shortsize" in
10273 u16type="unsigned short"
10281 '') set try -DINT16
10282 if eval $compile; then
10283 case "`./try$exe_ext`" in
10295 '') if $test $shortsize -ge 2; then
10297 u16type="unsigned short"
10305 '') case "$longsize" in
10307 u32type="unsigned long"
10311 *) case "$intsize" in
10313 u32type="unsigned int"
10323 '') set try -DINT32
10324 if eval $compile; then
10325 case "`./try$exe_ext`" in
10337 '') if $test $intsize -ge 4; then
10339 u32type="unsigned int"
10347 '') case "$d_quad:$quadtype" in
10349 i64type="$quadtype"
10350 u64type="$uquadtype"
10358 $echo "Checking whether your NVs can preserve your UVs..." >&4
10362 $uvtype k = ($uvtype)~0, l;
10368 printf("preserve\n");
10373 if eval $compile; then
10374 case "`./try$exe_ext`" in
10375 preserve) d_nv_preserves_uv="$define" ;;
10378 case "$d_nv_preserves_uv" in
10379 $define) $echo "Yes, they can." 2>&1 ;;
10380 *) $echo "No, they can't." 2>&1
10381 d_nv_preserves_uv="$undef"
10387 case "$d_nv_preserves_uv" in
10388 "$define") d_nv_preserves_uv_bits=`expr $uvsize \* 8` ;;
10389 *) $echo "Checking how many bits of your UVs your NVs can preserve..." >&4
10394 int n = 8 * $uvsize;
10396 for (i = 0; i < n; i++) {
10397 u = u << 1 | ($uvtype)1;
10398 if (($uvtype)($nvtype)u != u)
10406 if eval $compile; then
10407 d_nv_preserves_uv_bits="`./try$exe_ext`"
10409 case "$d_nv_preserves_uv_bits" in
10410 [1-9]*) $echo "Your NVs can preserve $d_nv_preserves_uv_bits bits of your UVs." 2>&1 ;;
10411 *) $echo "Can't figure out how many bits your NVs preserve." 2>&1
10412 d_nv_preserves_uv_bits="$undef"
10421 : check for off64_t
10423 echo "Checking to see if you have off64_t..." >&4
10425 #include <sys/types.h>
10426 #include <unistd.h>
10427 int main() { off64_t x = 7; }
10430 if eval $compile; then
10432 echo "You have off64_t."
10435 echo "You do not have off64_t."
10436 case "$lseeksize" in
10437 8) echo "(Your off_t is 64 bits, so you could use that.)" ;;
10444 : see if POSIX threads are available
10445 set pthread.h i_pthread
10451 : how to create joinable pthreads
10452 if test "X$usethreads" = "X$define" -a "X$i_pthread" = "X$define"; then
10454 echo "Checking what constant to use for creating joinable pthreads..." >&4
10455 $cat >try.c <<'EOCP'
10456 #include <pthread.h>
10458 int detachstate = JOINABLE;
10461 set try -DJOINABLE=PTHREAD_CREATE_JOINABLE
10462 if eval $compile; then
10463 echo "You seem to use PTHREAD_CREATE_JOINABLE." >&4
10464 val="$undef" # Yes, undef.
10465 set d_old_pthread_create_joinable
10468 set old_pthread_create_joinable
10471 set try -DJOINABLE=PTHREAD_CREATE_UNDETACHED
10472 if eval $compile; then
10473 echo "You seem to use PTHREAD_CREATE_UNDETACHED." >&4
10475 set d_old_pthread_create_joinable
10477 val=PTHREAD_CREATE_UNDETACHED
10478 set old_pthread_create_joinable
10481 set try -DJOINABLE=__UNDETACHED
10482 if eval $compile; then
10483 echo "You seem to use __UNDETACHED." >&4
10485 set d_old_pthread_create_joinable
10488 set old_pthread_create_joinable
10491 echo "Egads, nothing obvious found. Guessing that you use 0." >&4
10493 set d_old_pthread_create_joinable
10496 set old_pthread_create_joinable
10503 d_old_pthread_create_joinable="$undef"
10504 old_pthread_create_joinable=""
10507 : see if pause exists
10511 : see if pipe exists
10515 : see if poll exists
10520 : see whether the various POSIXish _yields exist
10522 #include <pthread.h>
10528 #ifdef PTHREAD_YIELD
10531 #ifdef PTHREAD_YIELD_NULL
10532 pthread_yield(NULL);
10538 : see if sched_yield exists
10539 set try -DSCHED_YIELD
10540 if eval $compile; then
10542 sched_yield='sched_yield()'
10546 case "$usethreads" in
10549 $define) echo 'sched_yield() found.' >&4 ;;
10550 *) echo 'sched_yield() NOT found.' >&4 ;;
10556 : see if pthread_yield exists
10557 set try -DPTHREAD_YIELD
10558 if eval $compile; then
10560 case "$sched_yield" in
10561 '') sched_yield='pthread_yield()' ;;
10564 set try -DPTHREAD_YIELD_NULL
10565 if eval $compile; then
10567 case "$sched_yield" in
10568 '') sched_yield='pthread_yield(NULL)' ;;
10574 case "$usethreads" in
10577 $define) echo 'pthread_yield() found.' >&4 ;;
10578 *) echo 'pthread_yield() NOT found.' >&4 ;;
10582 set d_pthread_yield
10585 case "$sched_yield" in
10586 '') sched_yield=undef ;;
10591 : see if this is a pwd.h system
10597 xxx=`./findhdr pwd.h`
10598 $cppstdin $cppflags $cppminus < $xxx >$$.h
10600 if $contains 'pw_quota' $$.h >/dev/null 2>&1; then
10608 if $contains 'pw_age' $$.h >/dev/null 2>&1; then
10616 if $contains 'pw_change' $$.h >/dev/null 2>&1; then
10624 if $contains 'pw_class' $$.h >/dev/null 2>&1; then
10632 if $contains 'pw_expire' $$.h >/dev/null 2>&1; then
10640 if $contains 'pw_comment' $$.h >/dev/null 2>&1; then
10648 if $contains 'pw_gecos' $$.h >/dev/null 2>&1; then
10656 if $contains 'pw_passwd' $$.h >/dev/null 2>&1; then
10668 set d_pwquota; eval $setvar
10669 set d_pwage; eval $setvar
10670 set d_pwchange; eval $setvar
10671 set d_pwclass; eval $setvar
10672 set d_pwexpire; eval $setvar
10673 set d_pwcomment; eval $setvar
10674 set d_pwgecos; eval $setvar
10675 set d_pwpasswd; eval $setvar
10679 : see if readdir and friends exist
10680 set readdir d_readdir
10682 set seekdir d_seekdir
10684 set telldir d_telldir
10686 set rewinddir d_rewinddir
10689 : see if readlink exists
10690 set readlink d_readlink
10693 : see if rename exists
10694 set rename d_rename
10697 : see if rmdir exists
10701 : see if memory.h is available.
10706 : See if it conflicts with string.h
10712 $cppstdin $cppflags $cppminus < $strings > mem.h
10713 if $contains 'memcpy' mem.h >/dev/null 2>&1; then
10715 echo "We won't be including <memory.h>."
10725 : can bcopy handle overlapping blocks?
10730 echo "Checking to see if your bcopy() can do overlapping copies..." >&4
10732 #$i_memory I_MEMORY
10733 #$i_stdlib I_STDLIB
10734 #$i_string I_STRING
10735 #$i_unistd I_UNISTD
10737 $cat >>try.c <<'EOCP'
10740 # include <memory.h>
10743 # include <stdlib.h>
10746 # include <string.h>
10748 # include <strings.h>
10751 # include <unistd.h> /* Needed for NetBSD */
10755 char buf[128], abc[128];
10761 bcopy("abcdefghijklmnopqrstuvwxyz0123456789", abc, 36);
10763 for (align = 7; align >= 0; align--) {
10764 for (len = 36; len; len--) {
10766 bcopy(abc, b, len);
10767 for (off = 1; off <= len; off++) {
10768 bcopy(b, b+off, len);
10769 bcopy(b+off, b, len);
10770 if (bcmp(b, abc, len))
10779 if eval $compile_ok; then
10780 if ./try 2>/dev/null; then
10781 echo "Yes, it can."
10784 echo "It can't, sorry."
10785 case "$d_memmove" in
10786 "$define") echo "But that's Ok since you have memmove()." ;;
10790 echo "(I can't compile the test program, so we'll assume not...)"
10791 case "$d_memmove" in
10792 "$define") echo "But that's Ok since you have memmove()." ;;
10797 $rm -f try.* try core
10801 : can memcpy handle overlapping blocks?
10803 case "$d_memcpy" in
10806 echo "Checking to see if your memcpy() can do overlapping copies..." >&4
10808 #$i_memory I_MEMORY
10809 #$i_stdlib I_STDLIB
10810 #$i_string I_STRING
10811 #$i_unistd I_UNISTD
10813 $cat >>try.c <<'EOCP'
10816 # include <memory.h>
10819 # include <stdlib.h>
10822 # include <string.h>
10824 # include <strings.h>
10827 # include <unistd.h> /* Needed for NetBSD */
10831 char buf[128], abc[128];
10837 /* Copy "abcde..." string to char abc[] so that gcc doesn't
10838 try to store the string in read-only memory. */
10839 memcpy(abc, "abcdefghijklmnopqrstuvwxyz0123456789", 36);
10841 for (align = 7; align >= 0; align--) {
10842 for (len = 36; len; len--) {
10844 memcpy(b, abc, len);
10845 for (off = 1; off <= len; off++) {
10846 memcpy(b+off, b, len);
10847 memcpy(b, b+off, len);
10848 if (memcmp(b, abc, len))
10857 if eval $compile_ok; then
10858 if ./try 2>/dev/null; then
10859 echo "Yes, it can."
10862 echo "It can't, sorry."
10863 case "$d_memmove" in
10864 "$define") echo "But that's Ok since you have memmove()." ;;
10868 echo "(I can't compile the test program, so we'll assume not...)"
10869 case "$d_memmove" in
10870 "$define") echo "But that's Ok since you have memmove()." ;;
10875 $rm -f try.* try core
10879 : can memcmp be trusted to compare relative magnitude?
10881 case "$d_memcmp" in
10884 echo "Checking if your memcmp() can compare relative magnitude..." >&4
10886 #$i_memory I_MEMORY
10887 #$i_stdlib I_STDLIB
10888 #$i_string I_STRING
10889 #$i_unistd I_UNISTD
10891 $cat >>try.c <<'EOCP'
10894 # include <memory.h>
10897 # include <stdlib.h>
10900 # include <string.h>
10902 # include <strings.h>
10905 # include <unistd.h> /* Needed for NetBSD */
10911 if ((a < b) && memcmp(&a, &b, 1) < 0)
10917 if eval $compile_ok; then
10918 if ./try 2>/dev/null; then
10919 echo "Yes, it can."
10922 echo "No, it can't (it uses signed chars)."
10925 echo "(I can't compile the test program, so we'll assume not...)"
10929 $rm -f try.* try core
10933 : see if select exists
10934 set select d_select
10937 : see if semctl exists
10938 set semctl d_semctl
10941 : see if semget exists
10942 set semget d_semget
10945 : see if semop exists
10949 : see how much of the 'sem*(2)' library is present.
10952 case "$d_semctl$d_semget$d_semop" in
10953 *"$undef"*) h_sem=false;;
10957 case "`ipcs 2>&1`" in
10958 "SVID messages"*"not configured"*)
10959 echo "Your $osname does not have the sem*(2) configured." >&4
10962 set semctl d_semctl
10964 set semget d_semget
10972 : we could also check for sys/ipc.h ...
10973 if $h_sem && $test `./findhdr sys/sem.h`; then
10974 echo "You have the full sem*(2) library." >&4
10977 echo "You don't have the full sem*(2) library." >&4
10983 : see whether sys/sem.h defines union semun
10985 $cat > try.c <<'END'
10986 #include <sys/types.h>
10987 #include <sys/ipc.h>
10988 #include <sys/sem.h>
10989 int main () { union semun semun; semun.buf = 0; }
10992 if eval $compile; then
10993 echo "You have union semun in <sys/sem.h>." >&4
10996 echo "You do not have union semun in <sys/sem.h>." >&4
10999 $rm -f try try.c try.h
11003 : see how to do semctl IPC_STAT
11006 : see whether semctl IPC_STAT can use union semun
11011 # define S_IRUSR S_IREAD
11012 # define S_IWUSR S_IWRITE
11013 # define S_IXUSR S_IEXEC
11015 # define S_IRUSR 0400
11016 # define S_IWUSR 0200
11017 # define S_IXUSR 0100
11019 # define S_IRGRP (S_IRUSR>>3)
11020 # define S_IWGRP (S_IWUSR>>3)
11021 # define S_IXGRP (S_IXUSR>>3)
11022 # define S_IROTH (S_IRUSR>>6)
11023 # define S_IWOTH (S_IWUSR>>6)
11024 # define S_IXOTH (S_IXUSR>>6)
11027 # define S_IRWXU (S_IRUSR|S_IWUSR|S_IXUSR)
11028 # define S_IRWXG (S_IRGRP|S_IWGRP|S_IXGRP)
11029 # define S_IRWXO (S_IROTH|S_IWOTH|S_IXOTH)
11034 #include <sys/types.h>
11035 #include <sys/ipc.h>
11036 #include <sys/sem.h>
11037 #include <sys/stat.h>
11044 #$d_union_semun HAS_UNION_SEMUN
11047 #ifndef HAS_UNION_SEMUN
11050 struct semid_ds *buf;
11051 unsigned short *array;
11057 #if defined(IPC_PRIVATE) && defined(S_IRWXU) && defined(S_IRWXG) && defined(S_IRWXO) && defined(IPC_CREAT)
11058 sem = semget(IPC_PRIVATE, 1, S_IRWXU|S_IRWXG|S_IRWXO|IPC_CREAT);
11060 struct semid_ds argbuf;
11063 st = semctl(sem, 0, IPC_STAT, arg);
11067 # endif /* IPC_STAT */
11068 printf("semctl IPC_STAT failed: errno = %d\n", errno);
11070 if (semctl(sem, 0, IPC_RMID, arg) != 0)
11071 # endif /* IPC_RMID */
11072 printf("semctl IPC_RMID failed: errno = %d\n", errno);
11074 #endif /* IPC_PRIVATE && ... */
11075 printf("semget failed: errno = %d\n", errno);
11081 if eval $compile; then
11084 semun) val="$define" ;;
11090 case "$d_semctl_semun" in
11092 echo "You can use union semun for semctl IPC_STAT." >&4
11095 *) echo "You cannot use union semun for semctl IPC_STAT." >&4
11100 : see whether semctl IPC_STAT can use struct semid_ds pointer
11101 $cat > try.c <<'END'
11102 #include <sys/types.h>
11103 #include <sys/ipc.h>
11104 #include <sys/sem.h>
11105 #include <sys/stat.h>
11113 struct semid_ds arg;
11116 #if defined(IPC_PRIVATE) && defined(S_IRWXU) && defined(S_IRWXG) && defined(S_IRWXO) && defined(IPC_CREAT)
11117 sem = semget(IPC_PRIVATE, 1, S_IRWXU|S_IRWXG|S_IRWXO|IPC_CREAT);
11120 st = semctl(sem, 0, IPC_STAT, &arg);
11122 printf("semid_ds\n");
11124 # endif /* IPC_STAT */
11125 printf("semctl IPC_STAT failed: errno = %d\n", errno);
11127 if (semctl(sem, 0, IPC_RMID, &arg) != 0)
11128 # endif /* IPC_RMID */
11129 printf("semctl IPC_RMID failed: errno = %d\n", errno);
11131 #endif /* IPC_PRIVATE && ... */
11132 printf("semget failed: errno = %d\n", errno);
11139 if eval $compile; then
11142 semid_ds) val="$define" ;;
11146 set d_semctl_semid_ds
11148 case "$d_semctl_semid_ds" in
11150 echo "You can $also use struct semid_ds* for semctl IPC_STAT." >&4
11152 *) echo "You cannot use struct semid_ds* for semctl IPC_STAT." >&4
11159 # We do not have the full sem*(2) library, so assume we can not
11165 set d_semctl_semid_ds
11170 : see if setegid exists
11171 set setegid d_setegid
11174 : see if seteuid exists
11175 set seteuid d_seteuid
11178 : see if setgrent exists
11179 set setgrent d_setgrent
11182 : see if sethostent exists
11183 set sethostent d_sethent
11186 : see if setlinebuf exists
11187 set setlinebuf d_setlinebuf
11190 : see if setlocale exists
11191 set setlocale d_setlocale
11194 : see if setnetent exists
11195 set setnetent d_setnent
11198 : see if setprotoent exists
11199 set setprotoent d_setpent
11202 : see if setpgid exists
11203 set setpgid d_setpgid
11206 : see if setpgrp2 exists
11207 set setpgrp2 d_setpgrp2
11210 : see if setpriority exists
11211 set setpriority d_setprior
11214 : see if setproctitle exists
11215 set setproctitle d_setproctitle
11218 : see if setpwent exists
11219 set setpwent d_setpwent
11222 : see if setregid exists
11223 set setregid d_setregid
11225 set setresgid d_setresgid
11228 : see if setreuid exists
11229 set setreuid d_setreuid
11231 set setresuid d_setresuid
11234 : see if setrgid exists
11235 set setrgid d_setrgid
11238 : see if setruid exists
11239 set setruid d_setruid
11242 : see if setservent exists
11243 set setservent d_setsent
11246 : see if setsid exists
11247 set setsid d_setsid
11250 : see if setvbuf exists
11251 set setvbuf d_setvbuf
11254 : see if sfio.h is available
11259 : see if sfio library is available
11270 : Ok, but do we want to use it.
11274 true|$define|[yY]*) dflt='y';;
11277 echo "$package can use the sfio library, but it is experimental."
11278 case "$useperlio" in
11280 echo "For sfio also the PerlIO abstraction layer is needed."
11281 echo "Earlier you said you wouldn't want that."
11284 rp="You seem to have sfio available, do you want to try using it?"
11287 y|Y) echo "Ok, turning on both sfio and PerlIO, then."
11288 useperlio="$define"
11291 *) echo "Ok, avoiding sfio this time. I'll use stdio instead."
11293 : Remove sfio from list of libraries to use
11294 set `echo X $libs | $sed -e 's/-lsfio / /' -e 's/-lsfio$//'`
11297 echo "libs = $libs" >&4
11301 *) case "$usesfio" in
11302 true|$define|[yY]*)
11303 echo "Sorry, cannot find sfio on this machine." >&4
11304 echo "Ignoring your setting of usesfio=$usesfio." >&4
11313 $define) usesfio='true';;
11314 *) usesfio='false';;
11317 : see if shmctl exists
11318 set shmctl d_shmctl
11321 : see if shmget exists
11322 set shmget d_shmget
11325 : see if shmat exists
11328 : see what shmat returns
11331 $cat >shmat.c <<'END'
11332 #include <sys/shm.h>
11335 if $cc $ccflags -c shmat.c >/dev/null 2>&1; then
11340 echo "and it returns ($shmattype)." >&4
11341 : see if a prototype for shmat is available
11342 xxx=`./findhdr sys/shm.h`
11343 $cppstdin $cppflags $cppminus < $xxx > shmat.c 2>/dev/null
11344 if $contains 'shmat.*(' shmat.c >/dev/null 2>&1; then
11355 set d_shmatprototype
11358 : see if shmdt exists
11362 : see how much of the 'shm*(2)' library is present.
11365 case "$d_shmctl$d_shmget$d_shmat$d_shmdt" in
11366 *"$undef"*) h_shm=false;;
11370 case "`ipcs 2>&1`" in
11371 "SVID shared memory"*"not configured"*)
11372 echo "Your $osname does not have the shm*(2) configured." >&4
11375 set shmctl d_shmctl
11377 set shmget d_shmget
11387 : we could also check for sys/ipc.h ...
11388 if $h_shm && $test `./findhdr sys/shm.h`; then
11389 echo "You have the full shm*(2) library." >&4
11392 echo "You don't have the full shm*(2) library." >&4
11399 : see if we have sigaction
11400 if set sigaction val -f d_sigaction; eval $csym; $val; then
11401 echo 'sigaction() found.' >&4
11402 $cat > try.c <<'EOP'
11404 #include <sys/types.h>
11405 #include <signal.h>
11408 struct sigaction act, oact;
11410 oact.sa_handler = 0;
11411 /* so that act and oact are used */
11412 exit(act.sa_flags == 0 && oact.sa_handler == 0);
11416 if eval $compile_ok; then
11419 echo "But you don't seem to have a useable struct sigaction." >&4
11423 echo 'sigaction NOT found.' >&4
11426 set d_sigaction; eval $setvar
11427 $rm -f try try$_o try.c
11429 : see if sigsetjmp exists
11431 case "$d_sigsetjmp" in
11433 $cat >try.c <<'EOP'
11434 #include <setjmp.h>
11439 if (sigsetjmp(env,1))
11442 siglongjmp(env, 1);
11447 if eval $compile; then
11448 if ./try >/dev/null 2>&1; then
11449 echo "POSIX sigsetjmp found." >&4
11453 Uh-Oh! You have POSIX sigsetjmp and siglongjmp, but they do not work properly!!
11459 echo "sigsetjmp not found." >&4
11463 *) val="$d_sigsetjmp"
11464 case "$d_sigsetjmp" in
11465 $define) echo "POSIX sigsetjmp found." >&4;;
11466 $undef) echo "sigsetjmp not found." >&4;;
11474 : see if socks5_init exists
11475 set socks5_init d_socks5_init
11478 : see if sys/stat.h is available
11479 set sys/stat.h i_sysstat
11483 : see if stat knows about block sizes
11485 echo "Checking to see if your struct stat has st_blocks field..." >&4
11486 set d_statblks stat st_blocks $i_sysstat sys/stat.h
11490 : see if this is a sys/vfs.h system
11491 set sys/vfs.h i_sysvfs
11495 : see if this is a sys/statfs.h system
11496 set sys/statfs.h i_sysstatfs
11501 echo "Checking to see if your system supports struct statfs..." >&4
11502 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
11504 case "$d_statfs_s" in
11505 "$define") echo "Yes, it does." ;;
11506 *) echo "No, it doesn't." ;;
11511 : see if struct statfs knows about f_flags
11512 case "$d_statfs_s" in
11515 echo "Checking to see if your struct statfs has f_flags field..." >&4
11516 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
11520 set d_statfs_f_flags
11524 case "$d_statfs_f_flags" in
11525 "$define") echo "Yes, it does." ;;
11526 *) echo "No, it doesn't." ;;
11529 : see if _ptr and _cnt from stdio act std
11531 if $contains '_IO_fpos_t' `./findhdr stdio.h` `./findhdr libio.h` >/dev/null 2>&1 ; then
11532 echo "(Looks like you have stdio.h from Linux.)"
11533 case "$stdio_ptr" in
11534 '') stdio_ptr='((fp)->_IO_read_ptr)'
11537 *) ptr_lval=$d_stdio_ptr_lval;;
11539 case "$stdio_cnt" in
11540 '') stdio_cnt='((fp)->_IO_read_end - (fp)->_IO_read_ptr)'
11543 *) cnt_lval=$d_stdio_cnt_lval;;
11545 case "$stdio_base" in
11546 '') stdio_base='((fp)->_IO_read_base)';;
11548 case "$stdio_bufsiz" in
11549 '') stdio_bufsiz='((fp)->_IO_read_end - (fp)->_IO_read_base)';;
11552 case "$stdio_ptr" in
11553 '') stdio_ptr='((fp)->_ptr)'
11556 *) ptr_lval=$d_stdio_ptr_lval;;
11558 case "$stdio_cnt" in
11559 '') stdio_cnt='((fp)->_cnt)'
11562 *) cnt_lval=$d_stdio_cnt_lval;;
11564 case "$stdio_base" in
11565 '') stdio_base='((fp)->_base)';;
11567 case "$stdio_bufsiz" in
11568 '') stdio_bufsiz='((fp)->_cnt + (fp)->_ptr - (fp)->_base)';;
11571 : test whether _ptr and _cnt really work
11572 echo "Checking how std your stdio is..." >&4
11575 #define FILE_ptr(fp) $stdio_ptr
11576 #define FILE_cnt(fp) $stdio_cnt
11578 FILE *fp = fopen("try.c", "r");
11581 18 <= FILE_cnt(fp) &&
11582 strncmp(FILE_ptr(fp), "include <stdio.h>\n", 18) == 0
11590 if eval $compile; then
11592 echo "Your stdio acts pretty std."
11595 echo "Your stdio isn't very std."
11598 echo "Your stdio doesn't appear very std."
11604 : Can _ptr be used as an lvalue?
11605 case "$d_stdstdio$ptr_lval" in
11606 $define$define) val=$define ;;
11609 set d_stdio_ptr_lval
11612 : Can _cnt be used as an lvalue?
11613 case "$d_stdstdio$cnt_lval" in
11614 $define$define) val=$define ;;
11617 set d_stdio_cnt_lval
11620 : see if _base is also standard
11622 case "$d_stdstdio" in
11626 #define FILE_base(fp) $stdio_base
11627 #define FILE_bufsiz(fp) $stdio_bufsiz
11629 FILE *fp = fopen("try.c", "r");
11632 19 <= FILE_bufsiz(fp) &&
11633 strncmp(FILE_base(fp), "#include <stdio.h>\n", 19) == 0
11640 if eval $compile; then
11642 echo "And its _base field acts std."
11645 echo "But its _base field isn't std."
11648 echo "However, it seems to be lacking the _base field."
11657 Checking how to access stdio streams by file descriptor number...
11659 case "$stdio_stream_array" in
11660 '') $cat >try.c <<EOCP
11663 if (&STDIO_STREAM_ARRAY[fileno(stdin)] == stdin)
11667 for s in _iob __iob __sF
11669 set try -DSTDIO_STREAM_ARRAY=$s
11670 if eval $compile; then
11671 case "`./try$exe_ext`" in
11672 yes) stdio_stream_array=$s; break ;;
11676 $rm -f try.* try$exe_ext
11678 case "$stdio_stream_array" in
11680 I can't figure out how to access stdio streams by file descriptor number.
11682 d_stdio_stream_array="$undef"
11685 You can access stdio streams by file descriptor number by the $stdio_stream_array array.
11687 d_stdio_stream_array="$define"
11691 : see if strcoll exists
11692 set strcoll d_strcoll
11695 : check for structure copying
11697 echo "Checking to see if your C compiler can copy structs..." >&4
11698 $cat >try.c <<'EOCP'
11708 if $cc -c try.c >/dev/null 2>&1 ; then
11710 echo "Yup, it can."
11713 echo "Nope, it can't."
11719 : see if strerror and/or sys_errlist[] exist
11721 if test "X$d_strerror" = X -o "X$d_syserrlst" = X; then
11722 if set strerror val -f d_strerror; eval $csym; $val; then
11723 echo 'strerror() found.' >&4
11724 d_strerror="$define"
11725 d_strerrm='strerror(e)'
11726 if set sys_errlist val -a d_syserrlst; eval $csym; $val; then
11727 echo "(You also have sys_errlist[], so we could roll our own strerror.)"
11728 d_syserrlst="$define"
11730 echo "(Since you don't have sys_errlist[], sterror() is welcome.)"
11731 d_syserrlst="$undef"
11733 elif xxx=`./findhdr string.h`; test "$xxx" || xxx=`./findhdr strings.h`; \
11734 $contains '#[ ]*define.*strerror' "$xxx" >/dev/null 2>&1; then
11735 echo 'strerror() found in string header.' >&4
11736 d_strerror="$define"
11737 d_strerrm='strerror(e)'
11738 if set sys_errlist val -a d_syserrlst; eval $csym; $val; then
11739 echo "(Most probably, strerror() uses sys_errlist[] for descriptions.)"
11740 d_syserrlst="$define"
11742 echo "(You don't appear to have any sys_errlist[], how can this be?)"
11743 d_syserrlst="$undef"
11745 elif set sys_errlist val -a d_syserrlst; eval $csym; $val; then
11746 echo "strerror() not found, but you have sys_errlist[] so we'll use that." >&4
11747 d_strerror="$undef"
11748 d_syserrlst="$define"
11749 d_strerrm='((e)<0||(e)>=sys_nerr?"unknown":sys_errlist[e])'
11751 echo 'strerror() and sys_errlist[] NOT found.' >&4
11752 d_strerror="$undef"
11753 d_syserrlst="$undef"
11754 d_strerrm='"unknown"'
11758 : see if strtod exists
11759 set strtod d_strtod
11762 : see if strtol exists
11763 set strtol d_strtol
11766 : see if strtold exists
11767 set strtold d_strtold
11770 : see if strtoll exists
11771 set strtoll d_strtoll
11774 case "$d_longlong-$d_strtoll" in
11777 Checking whether your strtoll() works okay...
11779 $cat >try.c <<'EOCP'
11782 #define strtoll __strtoll
11785 extern long long int strtoll(char *s, char **, int);
11786 static int bad = 0;
11787 int check(char *s, long long ell, int een) {
11790 gll = strtoll(s, 0, 10);
11791 if (!((gll == ell) && (errno == een)))
11795 check(" 1", 1LL, 0);
11796 check(" 0", 0LL, 0);
11797 check("-1", -1LL, 0);
11798 check("-9223372036854775808", -9223372036854775808LL, 0);
11799 check("-9223372036854775808", -9223372036854775808LL, 0);
11800 check(" 9223372036854775807", 9223372036854775807LL, 0);
11801 check("-9223372036854775808", -9223372036854775808LL, 0);
11802 check(" 9223372036854775808", 9223372036854775807LL, ERANGE);
11803 check("-9223372036854775809", -9223372036854775808LL, ERANGE);
11809 if eval $compile; then
11811 ok) echo "Your strtoll() seems to be working okay." ;;
11813 Your strtoll() doesn't seem to be working okay.
11822 : see if strtoul exists
11823 set strtoul d_strtoul
11826 : see if strtoull exists
11827 set strtoull d_strtoull
11830 case "$d_longlong-$d_strtoull" in
11833 Checking whether your strtoull() works okay...
11835 $cat >try.c <<'EOCP'
11838 #define strtoull __strtoull
11841 extern unsigned long long int strtoull(char *s, char **, int);
11842 static int bad = 0;
11843 int check(char *s, long long eull, int een) {
11846 gull = strtoull(s, 0, 10);
11847 if (!((gull == eull) && (errno == een)))
11851 check(" 1", 1LL, 0);
11852 check(" 0", 0LL, 0);
11853 check("18446744073709551615", 18446744073709551615ULL, 0);
11854 check("18446744073709551616", 18446744073709551615ULL, ERANGE);
11860 if eval $compile; then
11862 ok) echo "Your strtoull() seems to be working okay." ;;
11864 Your strtoull() doesn't seem to be working okay.
11866 d_strtoull="$undef"
11873 : see if strtouq exists
11874 set strtouq d_strtouq
11877 : see if strxfrm exists
11878 set strxfrm d_strxfrm
11881 : see if symlink exists
11882 set symlink d_symlink
11885 : see if syscall exists
11886 set syscall d_syscall
11889 : see if sysconf exists
11890 set sysconf d_sysconf
11893 : see if system exists
11894 set system d_system
11897 : see if tcgetpgrp exists
11898 set tcgetpgrp d_tcgetpgrp
11901 : see if tcsetpgrp exists
11902 set tcsetpgrp d_tcsetpgrp
11905 : see if prototype for telldir is available
11907 set d_telldirproto telldir $i_systypes sys/types.h $i_dirent dirent.h
11910 : see if this is a sys/times.h system
11911 set sys/times.h i_systimes
11914 : see if times exists
11916 if set times val -f d_times; eval $csym; $val; then
11917 echo 'times() found.' >&4
11920 case "$i_systimes" in
11921 "$define") inc='sys/times.h';;
11923 rp="What is the type returned by times() on this system?"
11924 set clock_t clocktype long stdio.h sys/types.h $inc
11927 echo 'times() NOT found, hope that will do.' >&4
11932 : see if truncate exists
11933 set truncate d_truncate
11936 : see if tzname[] exists
11938 if set tzname val -a d_tzname; eval $csym; $val; then
11940 echo 'tzname[] found.' >&4
11943 echo 'tzname[] NOT found.' >&4
11948 : see if umask exists
11952 : see if ustat exists
11956 : backward compatibility for d_hvfork
11957 if test X$d_hvfork != X; then
11958 d_vfork="$d_hvfork"
11961 : see if there is a vfork
11966 : Ok, but do we want to use it. vfork is reportedly unreliable in
11967 : perl on Solaris 2.x, and probably elsewhere.
11971 case "$usevfork" in
11977 Perl can only use a vfork() that doesn't suffer from strict
11978 restrictions on calling functions or modifying global data in
11979 the child. For example, glibc-2.1 contains such a vfork()
11980 that is unsuitable. If your system provides a proper fork()
11981 call, chances are that you do NOT want perl to use vfork().
11984 rp="Do you still want to use vfork()?"
11989 echo "Ok, we won't use vfork()."
11998 $define) usevfork='true';;
11999 *) usevfork='false';;
12002 : see if this is an sysdir system
12003 set sys/dir.h i_sysdir
12006 : see if this is an sysndir system
12007 set sys/ndir.h i_sysndir
12010 : see if closedir exists
12011 set closedir d_closedir
12014 case "$d_closedir" in
12017 echo "Checking whether closedir() returns a status..." >&4
12018 cat > closedir.c <<EOM
12019 #$i_dirent I_DIRENT /**/
12020 #$i_sysdir I_SYS_DIR /**/
12021 #$i_sysndir I_SYS_NDIR /**/
12022 #$i_systypes I_SYS_TYPES /**/
12024 #if defined(I_SYS_TYPES)
12025 #include <sys/types.h>
12027 #if defined(I_DIRENT)
12028 #include <dirent.h>
12029 #if defined(NeXT) && defined(I_SYS_DIR) /* NeXT needs dirent + sys/dir.h */
12030 #include <sys/dir.h>
12034 #include <sys/ndir.h>
12038 #include <ndir.h> /* may be wrong in the future */
12040 #include <sys/dir.h>
12045 int main() { return closedir(opendir(".")); }
12048 if eval $compile_ok; then
12049 if ./closedir > /dev/null 2>&1 ; then
12050 echo "Yes, it does."
12053 echo "No, it doesn't."
12057 echo "(I can't seem to compile the test program--assuming it doesn't)"
12065 set d_void_closedir
12068 : check for volatile keyword
12070 echo 'Checking to see if your C compiler knows about "volatile"...' >&4
12071 $cat >try.c <<'EOCP'
12074 typedef struct _goo_struct goo_struct;
12075 goo_struct * volatile goo = ((goo_struct *)0);
12076 struct _goo_struct {
12081 typedef unsigned short foo_t;
12082 char *volatile foo;
12084 volatile foo_t blech;
12088 if $cc -c $ccflags try.c >/dev/null 2>&1 ; then
12090 echo "Yup, it does."
12093 echo "Nope, it doesn't."
12099 : see if there is a wait4
12103 : see if waitpid exists
12104 set waitpid d_waitpid
12107 : see if wcstombs exists
12108 set wcstombs d_wcstombs
12111 : see if wctomb exists
12112 set wctomb d_wctomb
12115 : preserve RCS keywords in files with variable substitution, grrr
12120 Revision='$Revision'
12122 case "$crosscompile" in
12123 ''|[nN]*) crosscompile="$undef" ;;
12127 next|rhapsody|darwin) multiarch="$define" ;;
12129 case "$multiarch" in
12130 ''|[nN]*) multiarch="$undef" ;;
12133 : check for alignment requirements
12135 case "$crosscompile$multiarch" in
12138 You seem to be either cross-compiling or doing a multiarchitecture build,
12139 skipping the memory alignment check.
12142 case "$alignbytes" in
12143 '') alignbytes=8 ;;
12147 case "$alignbytes" in
12148 '') echo "Checking alignment constraints..." >&4
12149 if $test "X$uselongdouble" = Xdefine -a "X$d_longdbl" = Xdefine; then
12150 $cat >try.c <<'EOCP'
12151 typedef long double NV;
12154 $cat >try.c <<'EOCP'
12158 $cat >>try.c <<'EOCP'
12166 printf("%d\n", (int)((char *)&try_algn.bar - (char *)&try_algn.foo));
12171 if eval $compile_ok; then
12175 echo "(I can't seem to compile the test program...)"
12178 *) dflt="$alignbytes"
12181 rp="Doubles must be aligned on a how-many-byte boundary?"
12189 : set the base revision
12192 : check for ordering of bytes in a long
12194 case "$crosscompile$multiarch" in
12197 You seem to be either cross-compiling or doing a multiarchitecture build,
12198 skipping the byteorder check.
12204 case "$byteorder" in
12207 In the following, larger digits indicate more significance. A big-endian
12208 machine like a Pyramid or a Motorola 680?0 chip will come out to 4321. A
12209 little-endian machine like a Vax or an Intel 80?86 chip would be 1234. Other
12210 machines may have weird orders like 3412. A Cray will report 87654321,
12211 an Alpha will report 12345678. If the test program works the default is
12213 I'm now running the test program...
12215 $cat >try.c <<'EOCP'
12222 char c[sizeof(long)];
12225 if (sizeof(long) > 4)
12226 u.l = (0x08070605L << 32) | 0x04030201L;
12229 for (i = 0; i < sizeof(long); i++)
12230 printf("%c", u.c[i]+'0');
12237 if eval $compile && ./try > /dev/null; then
12240 [1-4][1-4][1-4][1-4]|12345678|87654321)
12241 echo "(The test program ran ok.)"
12242 echo "byteorder=$dflt"
12245 ????|????????) echo "(The test program ran ok.)" ;;
12246 *) echo "(The test program didn't run right for some reason.)" ;;
12251 (I can't seem to compile the test program. Guessing big-endian...)
12254 case "$xxx_prompt" in
12256 rp="What is the order of bytes in a long?"
12270 : how do we catenate cpp tokens here?
12272 echo "Checking to see how your cpp does stuff like catenate tokens..." >&4
12273 $cat >cpp_stuff.c <<'EOCP'
12274 #define RCAT(a,b)a/**/b
12275 #define ACAT(a,b)a ## b
12279 $cppstdin $cppflags $cppminus <cpp_stuff.c >cpp_stuff.out 2>&1
12280 if $contains 'Circus' cpp_stuff.out >/dev/null 2>&1; then
12281 echo "Oh! Smells like ANSI's been here." >&4
12282 echo "We can catify or stringify, separately or together!"
12284 elif $contains 'Reiser' cpp_stuff.out >/dev/null 2>&1; then
12285 echo "Ah, yes! The good old days!" >&4
12286 echo "However, in the good old days we don't know how to stringify and"
12287 echo "catify at the same time."
12291 Hmm, I don't seem to be able to catenate tokens with your cpp. You're going
12292 to have to edit the values of CAT[2-5] in config.h...
12294 cpp_stuff="/* Help! How do we handle cpp_stuff? */*/"
12298 : see if this is a db.h system
12304 : Check db version.
12306 echo "Checking Berkeley DB version ..." >&4
12312 #include <sys/types.h>
12317 #ifdef DB_VERSION_MAJOR /* DB version >= 2 */
12318 int Major, Minor, Patch ;
12319 unsigned long Version ;
12320 (void)db_version(&Major, &Minor, &Patch) ;
12321 printf("You have Berkeley DB Version 2 or greater\n");
12323 printf("db.h is from Berkeley DB Version %d.%d.%d\n",
12324 DB_VERSION_MAJOR, DB_VERSION_MINOR, DB_VERSION_PATCH);
12325 printf("libdb is from Berkeley DB Version %d.%d.%d\n",
12326 Major, Minor, Patch) ;
12328 /* check that db.h & libdb are compatible */
12329 if (DB_VERSION_MAJOR != Major || DB_VERSION_MINOR != Minor || DB_VERSION_PATCH != Patch) {
12330 printf("db.h and libdb are incompatible\n") ;
12334 printf("db.h and libdb are compatible\n") ;
12336 Version = DB_VERSION_MAJOR * 1000000 + DB_VERSION_MINOR * 1000
12337 + DB_VERSION_PATCH ;
12339 /* needs to be >= 2.3.4 */
12340 if (Version < 2003004) {
12341 /* if (DB_VERSION_MAJOR == 2 && DB_VERSION_MINOR == 0 && DB_VERSION_PATCH < 5) { */
12342 printf("but Perl needs Berkeley DB 2.3.4 or greater\n") ;
12348 #if defined(_DB_H_) && defined(BTREEMAGIC) && defined(HASHMAGIC)
12349 printf("You have Berkeley DB Version 1\n");
12350 exit(0); /* DB version < 2: the coast is clear. */
12352 exit(1); /* <db.h> not Berkeley DB? */
12358 if eval $compile_ok && ./try; then
12359 echo 'Looks OK.' >&4
12361 echo "I can't use Berkeley DB with your <db.h>. I'll disable Berkeley DB." >&4
12365 : Remove db from list of libraries to use
12366 echo "Removing unusable -ldb from library list" >&4
12367 set `echo X $libs | $sed -e 's/-ldb / /' -e 's/-ldb$//'`
12370 echo "libs = $libs" >&4
12380 : Check the return type needed for hash
12382 echo "Checking return type needed for hash for Berkeley DB ..." >&4
12388 #include <sys/types.h>
12391 #ifndef DB_VERSION_MAJOR
12392 u_int32_t hash_cb (ptr, size)
12400 info.hash = hash_cb;
12404 if $cc $ccflags -c try.c >try.out 2>&1 ; then
12405 if $contains warning try.out >>/dev/null 2>&1 ; then
12408 db_hashtype='u_int32_t'
12411 : XXX Maybe we should just give up here.
12412 db_hashtype=u_int32_t
12414 echo "Help: I can't seem to compile the db test program." >&4
12415 echo "Something's wrong, but I'll assume you use $db_hashtype." >&4
12418 echo "Your version of Berkeley DB uses $db_hashtype for hash."
12420 *) db_hashtype=u_int32_t
12425 : Check the return type needed for prefix
12427 echo "Checking return type needed for prefix for Berkeley DB ..." >&4
12433 #include <sys/types.h>
12436 #ifndef DB_VERSION_MAJOR
12437 size_t prefix_cb (key1, key2)
12445 info.prefix = prefix_cb;
12449 if $cc $ccflags -c try.c >try.out 2>&1 ; then
12450 if $contains warning try.out >>/dev/null 2>&1 ; then
12451 db_prefixtype='int'
12453 db_prefixtype='size_t'
12456 db_prefixtype='size_t'
12457 : XXX Maybe we should just give up here.
12459 echo "Help: I can't seem to compile the db test program." >&4
12460 echo "Something's wrong, but I'll assume you use $db_prefixtype." >&4
12463 echo "Your version of Berkeley DB uses $db_prefixtype for prefix."
12465 *) db_prefixtype='size_t'
12469 : check for void type
12471 echo "Checking to see how well your C compiler groks the void type..." >&4
12472 case "$voidflags" in
12474 $cat >try.c <<'EOCP'
12480 extern void moo(); /* function returning void */
12481 void (*goo)(); /* ptr to func returning void */
12483 void *hue; /* generic ptr */
12496 int main() { sub(); }
12498 if $cc $ccflags -c -DTRY=$defvoidused try.c >.out 2>&1 ; then
12499 voidflags=$defvoidused
12500 echo "Good. It appears to support void to the level $package wants.">&4
12501 if $contains warning .out >/dev/null 2>&1; then
12502 echo "However, you might get some warnings that look like this:"
12506 echo "Hmm, your compiler has some difficulty with void. Checking further..." >&4
12507 if $cc $ccflags -c -DTRY=1 try.c >/dev/null 2>&1; then
12508 echo "It supports 1..."
12509 if $cc $ccflags -c -DTRY=3 try.c >/dev/null 2>&1; then
12510 echo "It also supports 2..."
12511 if $cc $ccflags -c -DTRY=7 try.c >/dev/null 2>&1; then
12513 echo "And it supports 4 but not 8 definitely."
12515 echo "It doesn't support 4..."
12516 if $cc $ccflags -c -DTRY=11 try.c >/dev/null 2>&1; then
12518 echo "But it supports 8."
12521 echo "Neither does it support 8."
12525 echo "It does not support 2..."
12526 if $cc $ccflags -c -DTRY=13 try.c >/dev/null 2>&1; then
12528 echo "But it supports 4 and 8."
12530 if $cc $ccflags -c -DTRY=5 try.c >/dev/null 2>&1; then
12532 echo "And it supports 4 but has not heard about 8."
12534 echo "However it supports 8 but not 4."
12539 echo "There is no support at all for void."
12544 case "$voidflags" in
12546 *) $cat >&4 <<'EOM'
12547 Support flag bits are:
12548 1: basic void declarations.
12549 2: arrays of pointers to functions returning void.
12550 4: operations between pointers to and addresses of void functions.
12551 8: generic void pointers.
12554 rp="Your void support flags add up to what?"
12562 : How can we generate normalized random numbers ?
12564 echo "Looking for a random number function..." >&4
12565 case "$randfunc" in
12567 if set drand48 val -f; eval $csym; $val; then
12569 echo "Good, found drand48()." >&4
12570 elif set random val -f; eval $csym; $val; then
12572 echo "OK, found random()." >&4
12575 echo "Yick, looks like I have to use rand()." >&4
12586 *-Dmy_rand=*|*-Dmy_srand=*)
12587 echo "Removing obsolete -Dmy_rand, -Dmy_srand, and -Drandbits from ccflags." >&4
12588 ccflags="`echo $ccflags | sed -e 's/-Dmy_rand=random/ /'`"
12589 ccflags="`echo $ccflags | sed -e 's/-Dmy_srand=srandom/ /'`"
12590 ccflags="`echo $ccflags | sed -e 's/-Drandbits=[0-9][0-9]*/ /'`"
12594 while $test "$cont"; do
12595 rp="Use which function to generate random numbers?"
12597 if $test "$ans" = "$dflt"; then
12603 if set $ans val -f; eval $csym; $val; then
12607 rp="I cannot find function $ans. Use that name anyway?"
12616 case "$randfunc" in
12618 drand01="drand48()"
12624 case "$randbits" in
12626 echo "Checking to see how many bits your $randfunc() function produces..." >&4
12628 #$i_unistd I_UNISTD
12629 #$i_stdlib I_STDLIB
12632 # include <unistd.h>
12635 # include <stdlib.h>
12640 register unsigned long tmp;
12641 register unsigned long max = 0L;
12643 for (i = 1000; i; i--) {
12644 tmp = (unsigned long) $randfunc();
12645 if (tmp > max) max = tmp;
12647 for (i = 0; max; i++)
12653 if eval $compile_ok; then
12657 echo "(I can't seem to compile the test program...)"
12664 rp="How many bits does your $randfunc() function produce?"
12668 drand01="($randfunc() / (double) ((unsigned long)1 << $randbits))"
12669 seedfunc="s$randfunc"
12670 randseedtype=unsigned
12674 rp="How many bits does your $randfunc() function produce?"
12677 seedfunc="s$randfunc"
12678 drand01="($randfunc() / (double) ((unsigned long)1 << $randbits))"
12679 if set $seedfunc val -f; eval $csym; $val; then
12680 echo "(Using $seedfunc() to seed random generator)"
12682 echo "(Warning: no $seedfunc() to seed random generator)"
12685 randseedtype=unsigned
12693 echo "Determining whether or not we are on an EBCDIC system..." >&4
12694 $cat >tebcdic.c <<'EOM'
12697 if ('M'==0xd4) return 0;
12704 if eval $compile_ok; then
12706 echo "You have EBCDIC." >&4
12709 echo "Nope, no EBCDIC, probably ASCII or some ISO Latin." >&4
12712 echo "I'm unable to compile the test program." >&4
12713 echo "I'll assume ASCII or some ISO Latin." >&4
12715 $rm -f tebcdic.c tebcdic
12721 Checking how to flush all pending stdio output...
12723 # I only know how to find the first 32 possibly open files on SunOS.
12724 # See also hints/sunos_4_1.sh and util.c --AD
12726 sunos) $echo '#define PERL_FFLUSH_ALL_FOPEN_MAX 32' > try.c ;;
12728 $cat >>try.c <<EOCP
12730 #$i_unistd I_UNISTD
12732 # include <unistd.h>
12734 #$d_sysconf HAS_SYSCONF
12735 #$d_stdio_stream_array HAS_STDIO_STREAM_ARRAY
12736 #ifdef HAS_STDIO_STREAM_ARRAY
12737 # define STDIO_STREAM_ARRAY $stdio_stream_array
12740 FILE* p = fopen("try.out", "w");
12744 # ifdef TRY_FPRINTF
12748 #ifdef TRY_FFLUSH_NULL
12751 #ifdef TRY_FFLUSH_ALL
12753 long open_max = -1;
12754 # ifdef PERL_FFLUSH_ALL_FOPEN_MAX
12755 open_max = PERL_FFLUSH_ALL_FOPEN_MAX;
12757 # if defined(HAS_SYSCONF) && defined(_SC_OPEN_MAX)
12758 open_max = sysconf(_SC_OPEN_MAX);
12761 open_max = FOPEN_MAX;
12764 open_max = OPEN_MAX;
12773 # ifdef HAS_STDIO_STREAM_ARRAY
12774 if (open_max > 0) {
12776 for (i = 0; i < open_max; i++)
12777 if (STDIO_STREAM_ARRAY[i]._file >= 0 &&
12778 STDIO_STREAM_ARRAY[i]._file < open_max &&
12779 STDIO_STREAM_ARRAY[i]._flag)
12780 fflush(&STDIO_STREAM_ARRAY[i]);
12788 : first we have to find out how _not_ to flush
12789 if $test "X$fflushNULL" = X -o "X$fflushall" = X; then
12791 set try -DTRY_FPUTC
12792 if eval $compile; then
12794 ./try$exe_ext 2>/dev/null
12795 if $test ! -s try.out -a "X$?" = X42; then
12801 set try -DTRY_FPRINTF
12803 if eval $compile; then
12805 ./try$exe_ext 2>/dev/null
12806 if $test ! -s try.out -a "X$?" = X42; then
12807 output=-DTRY_FPRINTF
12813 : check for fflush NULL behaviour
12814 case "$fflushNULL" in
12815 '') set try -DTRY_FFLUSH_NULL $output
12816 if eval $compile; then
12818 ./try$exe_ext 2>/dev/null
12820 if $test -s try.out -a "X$code" = X42; then
12821 fflushNULL="`$cat try.out`"
12823 if $test "X$code" != X42; then
12825 (If this test failed, don't worry, we'll try another method shortly.)
12830 $rm -f core try.core core.try.*
12831 case "$fflushNULL" in
12833 Your fflush(NULL) works okay for output streams.
12834 Let's see if it clobbers input pipes...
12836 # As of mid-March 2000 all versions of Solaris appear to have a stdio
12837 # bug that improperly flushes the input end of pipes. So we avoid the
12838 # autoflush on fork/system/exec support for now. :-(
12839 $cat >tryp.c <<EOCP
12842 main(int argc, char **argv)
12848 while ((i = getc(stdin)) != -1
12849 && (*bp++ = i) != '\n'
12850 && bp < &buf[1024])
12853 fprintf(stdout, "%s", buf);
12861 fflushNULL="$define"
12863 if eval $compile; then
12865 $cat tryp.c | ./tryp$exe_ext 2>/dev/null > tryp.out
12866 if cmp tryp.c tryp.out >/dev/null 2>&1; then
12868 fflush(NULL) seems to behave okay with input streams.
12870 fflushNULL="$define"
12873 Ouch, fflush(NULL) clobbers input pipes! We will not use it.
12875 fflushNULL="$undef"
12878 $rm -f core tryp.c tryp.core core.tryp.*
12881 Your fflush(NULL) isn't working (contrary to ANSI C).
12883 fflushNULL="$undef"
12886 Cannot figure out whether your fflush(NULL) works or not.
12887 I'm assuming it doesn't (contrary to ANSI C).
12889 fflushNULL="$undef"
12893 $define|true|[yY]*)
12894 fflushNULL="$define"
12897 fflushNULL="$undef"
12900 : check explicit looping only if NULL did not work, and if the pipe
12901 : bug does not show up on an explicit flush too
12902 case "$fflushNULL" in
12904 $cat >tryp.c <<EOCP
12907 main(int argc, char **argv)
12913 while ((i = getc(stdin)) != -1
12914 && (*bp++ = i) != '\n'
12915 && bp < &buf[1024])
12918 fprintf(stdout, "%s", buf);
12927 if eval $compile; then
12929 $cat tryp.c | ./tryp$exe_ext 2>/dev/null > tryp.out
12930 if cmp tryp.c tryp.out >/dev/null 2>&1; then
12932 Good, at least fflush(stdin) seems to behave okay when stdin is a pipe.
12934 : now check for fflushall behaviour
12935 case "$fflushall" in
12936 '') set try -DTRY_FFLUSH_ALL $output
12937 if eval $compile; then
12939 (Now testing the other method--but note that this also may fail.)
12942 ./try$exe_ext 2>/dev/null
12943 if $test -s try.out -a "X$?" = X42; then
12944 fflushall="`$cat try.out`"
12947 $rm -f core try.core core.try.*
12948 case "$fflushall" in
12950 Whew. Flushing explicitly all the stdio streams works.
12952 fflushall="$define"
12955 Sigh. Flushing explicitly all the stdio streams doesn't work.
12960 Cannot figure out whether flushing stdio streams explicitly works or not.
12961 I'm assuming it doesn't.
12967 "$define"|true|[yY]*)
12968 fflushall="$define"
12976 All is futile. Even fflush(stdin) clobbers input pipes!
12983 $rm -f core tryp.c tryp.core core.tryp.*
12985 *) fflushall="$undef"
12989 case "$fflushNULL$fflushall" in
12992 OK, I give up. I cannot figure out how to flush pending stdio output.
12993 We won't be flushing handles at all before fork/exec/popen.
12997 $rm -f try.* try$exe_ext
12999 : Store the full pathname to the ar program for use in the C program
13000 : Respect a hint or command line value for full_ar.
13005 : Store the full pathname to the sed program for use in the C program
13008 : see what type gids are declared as in the kernel
13010 echo "Looking for the type for group ids returned by getgid()."
13011 set gid_t gidtype xxx stdio.h sys/types.h
13015 xxx=`./findhdr sys/user.h`
13016 set `grep 'groups\[NGROUPS\];' "$xxx" 2>/dev/null` unsigned short
13018 unsigned) dflt="$1 $2" ;;
13022 *) dflt="$gidtype";;
13025 gid_t) echo "gid_t found." ;;
13026 *) rp="What is the type for group ids returned by getgid()?"
13034 *_t) zzz="$gidtype" ;;
13037 echo "Checking the size of $zzz..." >&4
13039 #include <sys/types.h>
13042 printf("%d\n", (int)sizeof($gidtype));
13047 if eval $compile_ok; then
13051 echo "(I can't execute the test program--guessing $gidsize.)" >&4
13054 echo "Your $zzz is $gidsize bytes long."
13059 echo "(I can't compile the test program--guessing $gidsize.)" >&4
13065 *_t) zzz="$gidtype" ;;
13068 echo "Checking the sign of $zzz..." >&4
13070 #include <sys/types.h>
13081 if eval $compile; then
13085 echo "(I can't execute the test program--guessing unsigned.)" >&4
13089 1) echo "Your $zzz is unsigned." ;;
13090 -1) echo "Your $zzz is signed." ;;
13096 echo "(I can't compile the test program--guessing unsigned.)" >&4
13102 if $test X"$quadtype" != X; then
13104 echo "Checking how to print 64-bit integers..." >&4
13106 if $test X"$sPRId64" = X -a X"$quadtype" = Xint; then
13107 $cat >try.c <<'EOCP'
13108 #include <sys/types.h>
13111 int q = 12345678901;
13112 printf("%ld\n", q);
13116 if eval $compile; then
13117 yyy=`./try$exe_ext`
13120 sPRId64='"d"'; sPRIi64='"i"'; sPRIu64='"u"';
13121 sPRIo64='"o"'; sPRIx64='"x"'; sPRIX64='"X"';
13122 echo "We will use %d."
13128 if $test X"$sPRId64" = X -a X"$quadtype" = Xlong; then
13129 $cat >try.c <<'EOCP'
13130 #include <sys/types.h>
13133 long q = 12345678901;
13134 printf("%ld\n", q);
13138 if eval $compile; then
13139 yyy=`./try$exe_ext`
13142 sPRId64='"ld"'; sPRIi64='"li"'; sPRIu64='"lu"';
13143 sPRIo64='"lo"'; sPRIx64='"lx"'; sPRIX64='"lX"';
13144 echo "We will use %ld."
13150 if $test X"$sPRId64" = X -a X"$i_inttypes" = X"$define" -a X"$quadtype" = Xint64_t; then
13151 $cat >try.c <<'EOCP'
13152 #include <sys/types.h>
13153 #include <inttypes.h>
13156 int64_t q = 12345678901;
13157 printf("%" PRId64 "\n", q);
13161 if eval $compile; then
13162 yyy=`./try$exe_ext`
13165 sPRId64=PRId64; sPRIi64=PRIi64; sPRIu64=PRIu64;
13166 sPRIo64=PRIo64; sPRIx64=PRIx64; sPRIX64=PRIX64;
13167 echo "We will use the C9X style."
13173 if $test X"$sPRId64" = X -a X"$quadtype" = X"long long"; then
13174 $cat >try.c <<'EOCP'
13175 #include <sys/types.h>
13178 long long q = 12345678901LL; /* AIX cc requires the LL prefix. */
13179 printf("%lld\n", q);
13183 if eval $compile; then
13184 yyy=`./try$exe_ext`
13187 sPRId64='"lld"'; sPRIi64='"lli"'; sPRIu64='"llu"';
13188 sPRIo64='"llo"'; sPRIx64='"llx"'; sPRIX64='"llX"';
13189 echo "We will use the %lld style."
13195 if $test X"$sPRId64" = X -a X"$quadtype" != X; then
13197 #include <sys/types.h>
13200 $quadtype q = 12345678901;
13201 printf("%Ld\n", q);
13205 if eval $compile; then
13206 yyy=`./try$exe_ext`
13209 sPRId64='"Ld"'; sPRIi64='"Li"'; sPRIu64='"Lu"';
13210 sPRIo64='"Lo"'; sPRIx64='"Lx"'; sPRIX64='"LX"';
13211 echo "We will use %Ld."
13217 if $test X"$sPRId64" = X -a X"$quadtype" != X; then
13219 #include <sys/types.h>
13222 $quadtype q = 12345678901;
13223 printf("%qd\n", q);
13227 if eval $compile; then
13228 yyy=`./try$exe_ext`
13231 sPRId64='"qd"'; sPRIi64='"qi"'; sPRIu64='"qu"';
13232 sPRIo64='"qo"'; sPRIx64='"qx"'; sPRIX64='"qX"';
13233 echo "We will use %qd."
13239 if $test X"$sPRId64" = X; then
13240 echo "Cannot figure out how to print 64-bit integers." >&4
13248 '') d_PRId64="$undef"; d_PRIi64="$undef"; d_PRIu64="$undef";
13249 d_PRIo64="$undef"; d_PRIx64="$undef"; d_PRIX64="$undef";
13251 *) d_PRId64="$define"; d_PRIi64="$define"; d_PRIu64="$define";
13252 d_PRIo64="$define"; d_PRIx64="$define"; d_PRIX64="$define";
13258 $echo "Checking the format strings to be used for Perl's internal types..." >&4
13260 if $test X"$ivsize" = X8; then
13261 ivdformat="$sPRId64"
13262 uvuformat="$sPRIu64"
13263 uvoformat="$sPRIo64"
13264 uvxformat="$sPRIx64"
13265 uvXformat="$sPRIX64"
13267 if $test X"$ivsize" = X"$longsize"; then
13274 if $test X"$ivsize" = X"$intsize"; then
13282 if $test X"$ivsize" = X"$shortsize"; then
13293 if $test X"$uselongdouble" = X"$define" -a X"$d_longdbl" = X"$define" -a X"$d_PRIgldbl" = X"$define"; then
13294 nveformat="$sPRIeldbl"
13295 nvfformat="$sPRIfldbl"
13296 nvgformat="$sPRIgldbl"
13297 nvEformat="$sPRIEldbl"
13298 nvFformat="$sPRIFldbl"
13299 nvGformat="$sPRIGldbl"
13309 case "$ivdformat" in
13310 '') echo "$0: Fatal: failed to find format strings, cannot continue." >& 4
13317 $echo "Checking the format string to be used for gids..." >&4
13320 -1) if $test X"$gidsize" = X"$ivsize"; then
13321 gidformat="$ivdformat"
13323 if $test X"$gidsize" = X"$longsize"; then
13326 if $test X"$gidsize" = X"$intsize"; then
13329 if $test X"$gidsize" = X"$shortsize"; then
13336 *) if $test X"$gidsize" = X"$uvsize"; then
13337 gidformat="$uvuformat"
13339 if $test X"$gidsize" = X"$longsize"; then
13342 if $test X"$gidsize" = X"$intsize"; then
13345 if $test X"$gidsize" = X"$shortsize"; then
13354 : see if getgroups exists
13355 set getgroups d_getgrps
13358 : see if setgroups exists
13359 set setgroups d_setgrps
13363 : Find type of 2nd arg to 'getgroups()' and 'setgroups()'
13365 case "$d_getgrps$d_setgrps" in
13367 case "$groupstype" in
13368 '') dflt="$gidtype" ;;
13369 *) dflt="$groupstype" ;;
13372 What type of pointer is the second argument to getgroups() and setgroups()?
13373 Usually this is the same as group ids, $gidtype, but not always.
13376 rp='What type pointer is the second argument to getgroups() and setgroups()?'
13380 *) groupstype="$gidtype";;
13384 echo "Checking if your $make program sets \$(MAKE)..." >&4
13385 case "$make_set_make" in
13387 $sed 's/^X //' > testmake.mak << 'EOF'
13389 X @echo 'maketemp="$(MAKE)"'
13391 case "`$make -f testmake.mak 2>/dev/null`" in
13392 *maketemp=*) make_set_make='#' ;;
13393 *) make_set_make="MAKE=$make" ;;
13395 $rm -f testmake.mak
13398 case "$make_set_make" in
13399 '#') echo "Yup, it does.";;
13400 *) echo "Nope, it doesn't.";;
13403 : see what type is used for mode_t
13404 rp="What is the type used for file modes for system calls (e.g. fchmod())?"
13405 set mode_t modetype int stdio.h sys/types.h
13408 : define a fucntion to check prototypes
13409 $cat > protochk <<EOSH
13412 optimize="$optimize"
13414 prototype="$prototype"
13419 $cat >> protochk <<'EOSH'
13424 while test $# -ge 2; do
13426 $define) echo "#include <$2>" >> try.c ;;
13427 literal) echo "$2" >> try.c ;;
13431 test "$prototype" = "$define" && echo '#define CAN_PROTOTYPE' >> try.c
13432 cat >> try.c <<'EOCP'
13433 #ifdef CAN_PROTOTYPE
13434 #define _(args) args
13439 echo "$foo" >> try.c
13440 echo 'int no_real_function_has_this_name _((void)) { return 0; }' >> try.c
13441 $cc $optimize $ccflags -c try.c > /dev/null 2>&1
13447 $eunicefix protochk
13449 : see what type is used for size_t
13450 rp="What is the type used for the length parameter for string functions?"
13451 set size_t sizetype 'unsigned int' stdio.h sys/types.h
13454 : check for type of arguments to gethostbyaddr.
13455 if test "X$netdb_host_type" = X -o "X$netdb_hlen_type" = X; then
13456 case "$d_gethbyaddr" in
13460 Checking to see what type of arguments are accepted by gethostbyaddr().
13462 hdrs="$define sys/types.h
13463 $d_socket sys/socket.h
13464 $i_niin netinet/in.h
13466 $i_unistd unistd.h"
13467 : The first arg can 'char *' or 'void *'
13468 : The second arg is some of integral type
13469 for xxx in in_addr_t 'const void *' 'const char *' 'void *' 'char *'; do
13470 for yyy in size_t long int; do
13471 case "$netdb_host_type" in
13472 '') try="extern struct hostent *gethostbyaddr($xxx, $yyy, int);"
13473 if ./protochk "$try" $hdrs; then
13474 echo "Your system accepts $xxx for the first arg."
13475 echo "...and $yyy for the second arg."
13476 netdb_host_type="$xxx"
13477 netdb_hlen_type="$yyy"
13483 : In case none of those worked, prompt the user.
13484 case "$netdb_host_type" in
13485 '') rp='What is the type for the 1st argument to gethostbyaddr?'
13488 netdb_host_type=$ans
13489 rp='What is the type for the 2nd argument to gethostbyaddr?'
13492 netdb_hlen_type=$ans
13496 *) : no gethostbyaddr, so pick harmless defaults
13497 netdb_host_type='char *'
13498 netdb_hlen_type="$sizetype"
13501 # Remove the "const" if needed. -- but then we'll have a
13503 # netdb_host_type=`echo "$netdb_host_type" | sed 's/^const //'`
13506 : check for type of argument to gethostbyname.
13507 if test "X$netdb_name_type" = X ; then
13508 case "$d_gethbyname" in
13512 Checking to see what type of argument is accepted by gethostbyname().
13514 hdrs="$define sys/types.h
13515 $d_socket sys/socket.h
13516 $i_niin netinet/in.h
13518 $i_unistd unistd.h"
13519 for xxx in "const char *" "char *"; do
13520 case "$netdb_name_type" in
13521 '') try="extern struct hostent *gethostbyname($xxx);"
13522 if ./protochk "$try" $hdrs; then
13523 echo "Your system accepts $xxx."
13524 netdb_name_type="$xxx"
13529 : In case none of those worked, prompt the user.
13530 case "$netdb_name_type" in
13531 '') rp='What is the type for the 1st argument to gethostbyname?'
13534 netdb_name_type=$ans
13538 *) : no gethostbyname, so pick harmless default
13539 netdb_name_type='char *'
13544 : check for type of 1st argument to getnetbyaddr.
13545 if test "X$netdb_net_type" = X ; then
13546 case "$d_getnbyaddr" in
13550 Checking to see what type of 1st argument is accepted by getnetbyaddr().
13552 hdrs="$define sys/types.h
13553 $d_socket sys/socket.h
13554 $i_niin netinet/in.h
13556 $i_unistd unistd.h"
13557 for xxx in in_addr_t "unsigned long" long "unsigned int" int; do
13558 case "$netdb_net_type" in
13559 '') try="extern struct netent *getnetbyaddr($xxx, int);"
13560 if ./protochk "$try" $hdrs; then
13561 echo "Your system accepts $xxx."
13562 netdb_net_type="$xxx"
13567 : In case none of those worked, prompt the user.
13568 case "$netdb_net_type" in
13569 '') rp='What is the type for the 1st argument to getnetbyaddr?'
13572 netdb_net_type=$ans
13576 *) : no getnetbyaddr, so pick harmless default
13577 netdb_net_type='long'
13581 : locate the preferred pager for this system
13595 '') dflt=/usr/ucb/more;;
13602 rp='What pager is used on your system?'
13606 : see what type pids are declared as in the kernel
13607 rp="What is the type of process ids on this system?"
13608 set pid_t pidtype int stdio.h sys/types.h
13611 : Find earliest binary compatible site_perl subdirectory perl can use.
13612 case "$bincompat5005" in
13613 "$define") xs_apiversion='5.005' ;;
13614 *) xs_apiversion=$version ;; # The current site_perl version.
13616 : Find earliest pure perl site_perl subdirectory perl can use.
13617 : The versioned directories started at 5.005.
13618 pm_apiversion='5.005'
13620 : check for length of pointer
13624 echo "Checking to see how big your pointers are..." >&4
13625 if test "$voidflags" -gt 7; then
13626 echo '#define VOID_PTR char *' > try.c
13628 echo '#define VOID_PTR void *' > try.c
13630 $cat >>try.c <<'EOCP'
13634 printf("%d\n", (int)sizeof(VOID_PTR));
13639 if eval $compile_ok; then
13641 echo "Your pointers are $ptrsize bytes long."
13644 echo "(I can't seem to compile the test program. Guessing...)" >&4
13645 rp="What is the size of a pointer (in bytes)?"
13653 : see if ar generates random libraries by itself
13655 echo "Checking how to generate random libraries on your machine..." >&4
13656 echo 'int bar1() { return bar2(); }' > bar1.c
13657 echo 'int bar2() { return 2; }' > bar2.c
13658 $cat > foo.c <<'EOP'
13659 int main() { printf("%d\n", bar1()); exit(0); }
13661 $cc $ccflags -c bar1.c >/dev/null 2>&1
13662 $cc $ccflags -c bar2.c >/dev/null 2>&1
13663 $cc $ccflags -c foo.c >/dev/null 2>&1
13664 $ar rc bar$_a bar2$_o bar1$_o >/dev/null 2>&1
13665 if $cc $ccflags $ldflags -o foobar foo$_o bar$_a $libs > /dev/null 2>&1 &&
13666 ./foobar >/dev/null 2>&1; then
13667 echo "$ar appears to generate random libraries itself."
13670 elif $ar ts bar$_a >/dev/null 2>&1 &&
13671 $cc $ccflags $ldflags -o foobar foo$_o bar$_a $libs > /dev/null 2>&1 &&
13672 ./foobar >/dev/null 2>&1; then
13673 echo "a table of contents needs to be added with '$ar ts'."
13680 ranlib=`./loc ranlib X /usr/bin /bin /usr/local/bin`
13681 $test -f $ranlib || ranlib=''
13684 if $test -n "$ranlib"; then
13685 echo "your system has '$ranlib'; we'll use that."
13688 echo "your system doesn't seem to support random libraries"
13689 echo "so we'll use lorder and tsort to order the libraries."
13696 : check for type of arguments to select.
13697 case "$selecttype" in
13698 '') case "$d_select" in
13702 Checking to see what type of arguments are accepted by select().
13704 hdrs="$define sys/types.h
13705 $i_systime sys/time.h
13706 $i_sysselct sys/select.h
13707 $d_socket sys/socket.h"
13708 : The first arg can be int, unsigned, or size_t
13709 : The last arg may or may not be 'const'
13711 : void pointer has been seen but using that
13712 : breaks the selectminbits test
13713 for xxx in 'fd_set *' 'int *'; do
13714 for nfd in 'int' 'size_t' 'unsigned long' 'unsigned' ; do
13715 for tmo in 'struct timeval *' 'const struct timeval *'; do
13717 '') try="extern select _(($nfd, $xxx, $xxx, $xxx, $tmo));"
13718 if ./protochk "$try" $hdrs; then
13719 echo "Your system accepts $xxx."
13728 '') rp='What is the type for the 2nd, 3rd, and 4th arguments to select?'
13729 case "$d_fd_set" in
13730 $define) dflt="fd_set *" ;;
13739 *) : no select, so pick a harmless default
13746 : check for the select 'width'
13747 case "$selectminbits" in
13748 '') case "$d_select" in
13752 Checking to see on how many bits at a time your select() operates...
13755 #include <sys/types.h>
13757 #$i_systime I_SYS_TIME
13758 #$i_systimek I_SYS_TIME_KERNEL
13763 # ifdef I_SYS_TIME_KERNEL
13766 # include <sys/time.h>
13767 # ifdef I_SYS_TIME_KERNEL
13771 #$i_sysselct I_SYS_SELECT
13772 #ifdef I_SYS_SELECT
13773 #include <sys/select.h>
13775 #$d_socket HAS_SOCKET
13777 # include <sys/socket.h> /* Might include <sys/bsdtypes.h> */
13781 #define S sizeof(*(b))
13783 #define NBYTES (S * 8 > MINBITS ? S : MINBITS/8)
13784 #define NBITS (NBYTES * 8)
13793 fp = fopen("try.c", "r");
13799 b = ($selecttype)s;
13800 for (i = 0; i < NBITS; i++)
13804 select(fd + 1, b, 0, 0, &t);
13805 for (i = NBITS - 1; i > fd && FD_ISSET(i, b); i--);
13806 printf("%d\n", i + 1);
13811 if eval $compile_ok; then
13812 selectminbits=`./try`
13813 case "$selectminbits" in
13815 Cannot figure out on how many bits at a time your select() operates.
13816 I'll play safe and guess it is 32 bits.
13822 *) bits="$selectminbits bits" ;;
13824 echo "Your select() operates on $bits at a time." >&4
13826 rp='What is the minimum number of bits your select() operates on?'
13827 case "$byteorder" in
13828 1234|12345678) dflt=32 ;;
13833 selectminbits="$val"
13837 *) : no select, so pick a harmless default
13844 : Trace out the files included by signal.h, then look for SIGxxx names.
13845 : Remove SIGARRAYSIZE used by HPUX.
13846 : Remove SIGSTKSIZE used by Linux.
13847 : Remove SIGSTKSZ used by Posix.
13848 : Remove SIGTYP void lines used by OS2.
13849 : Some cpps, like os390, dont give the file name anywhere
13850 if [ "X$fieldn" = X ]; then
13851 : Just make some guesses. We check them later.
13852 xxx='/usr/include/signal.h /usr/include/sys/signal.h'
13854 xxx=`echo '#include <signal.h>' |
13855 $cppstdin $cppminus $cppflags 2>/dev/null |
13856 $grep '^[ ]*#.*include' |
13857 $awk "{print \\$$fieldn}" | $sed 's!"!!g' | $sort | $uniq`
13859 : Check this list of files to be sure we have parsed the cpp output ok.
13860 : This will also avoid potentially non-existent files, such
13863 for xx in $xxx /dev/null ; do
13864 $test -f "$xx" && xxxfiles="$xxxfiles $xx"
13866 : If we have found no files, at least try signal.h
13867 case "$xxxfiles" in
13868 '') xxxfiles=`./findhdr signal.h` ;;
13871 $1 ~ /^#define$/ && $2 ~ /^SIG[A-Z0-9]*$/ && $2 !~ /SIGARRAYSIZE/ && $2 !~ /SIGSTKSIZE/ && $2 !~ /SIGSTKSZ/ && $3 !~ /void/ {
13872 print substr($2, 4, 20)
13874 $1 == "#" && $2 ~ /^define$/ && $3 ~ /^SIG[A-Z0-9]*$/ && $3 !~ /SIGARRAYSIZE/ && $4 !~ /void/ {
13875 print substr($3, 4, 20)
13877 : Append some common names just in case the awk scan failed.
13878 xxx="$xxx ABRT ALRM BUS CANCEL CHLD CLD CONT DIL EMT FPE"
13879 xxx="$xxx FREEZE HUP ILL INT IO IOT KILL LOST LWP PHONE"
13880 xxx="$xxx PIPE POLL PROF PWR QUIT RTMAX RTMIN SEGV STKFLT STOP"
13881 xxx="$xxx SYS TERM THAW TRAP TSTP TTIN TTOU URG USR1 USR2"
13882 xxx="$xxx USR3 USR4 VTALRM WAITING WINCH WIND WINDOW XCPU XFSZ"
13884 : generate a few handy files for later
13885 $cat > signal.c <<'EOCP'
13886 #include <sys/types.h>
13887 #include <signal.h>
13891 /* Strange style to avoid deeply-nested #if/#else/#endif */
13894 # define NSIG (_NSIG)
13900 # define NSIG (SIGMAX+1)
13906 # define NSIG (SIG_MAX+1)
13912 # define NSIG (MAXSIG+1)
13918 # define NSIG (MAX_SIG+1)
13923 # ifdef SIGARRAYSIZE
13924 # define NSIG (SIGARRAYSIZE+1) /* Not sure of the +1 */
13930 # define NSIG (_sys_nsig) /* Solaris 2.5 */
13934 /* Default to some arbitrary number that's big enough to get most
13935 of the common signals.
13941 printf("NSIG %d\n", NSIG);
13947 echo $xxx | $tr ' ' $trnl | $sort | $uniq | $awk '
13949 printf "#ifdef SIG"; printf $1; printf "\n"
13950 printf "printf(\""; printf $1; printf " %%d\\n\",SIG";
13951 printf $1; printf ");\n"
13955 printf "#endif /* JUST_NSIG */\n";
13956 printf "exit(0);\n}\n";
13959 $cat >signal.awk <<'EOP'
13960 BEGIN { ndups = 0 }
13961 $1 ~ /^NSIG$/ { nsig = $2 }
13962 ($1 !~ /^NSIG$/) && (NF == 2) {
13963 if ($2 > maxsig) { maxsig = $2 }
13964 if (sig_name[$2]) {
13965 dup_name[ndups] = $1
13966 dup_num[ndups] = $2
13978 printf("NSIG %d\n", nsig);
13979 for (n = 1; n < nsig; n++) {
13981 printf("%s %d\n", sig_name[n], sig_num[n])
13984 printf("NUM%d %d\n", n, n)
13987 for (n = 0; n < ndups; n++) {
13988 printf("%s %d\n", dup_name[n], dup_num[n])
13992 $cat >signal_cmd <<EOS
13994 if $test -s signal.lst; then
13995 echo "Using your existing signal.lst file"
14000 $cat >>signal_cmd <<'EOS'
14003 if eval $compile_ok; then
14004 ./signal$_exe | $sort -n +1 | $uniq | $awk -f signal.awk >signal.lst
14006 echo "(I can't seem be able to compile the whole test program)" >&4
14007 echo "(I'll try it in little pieces.)" >&4
14008 set signal -DJUST_NSIG
14009 if eval $compile_ok; then
14010 ./signal$_exe > signal.nsg
14013 echo "I can't seem to figure out how many signals you have." >&4
14014 echo "Guessing 50." >&4
14015 echo 'NSIG 50' > signal.nsg
14017 : Now look at all the signal names, one at a time.
14018 for xx in `echo $xxx | $tr ' ' $trnl | $sort | $uniq`; do
14019 $cat > signal.c <<EOCP
14020 #include <sys/types.h>
14021 #include <signal.h>
14024 printf("$xx %d\n", SIG${xx});
14029 if eval $compile; then
14030 echo "SIG${xx} found."
14031 ./signal$_exe >> signal.ls1
14033 echo "SIG${xx} NOT found."
14036 if $test -s signal.ls1; then
14037 $cat signal.nsg signal.ls1 |
14038 $sort -n +1 | $uniq | $awk -f signal.awk >signal.lst
14042 if $test -s signal.lst; then
14045 echo "(AAK! I can't compile the test programs -- Guessing)" >&4
14046 echo 'kill -l' >signal
14047 set X `csh -f <signal`
14051 0) set HUP INT QUIT ILL TRAP ABRT EMT FPE KILL BUS SEGV SYS PIPE ALRM TERM;;
14053 echo $@ | $tr ' ' $trnl | \
14054 $awk '{ printf "%s %d\n", $1, ++s; }
14055 END { printf "NSIG %d\n", ++s }' >signal.lst
14057 $rm -f signal.c signal$_exe signal$_o signal.nsg signal.ls1
14059 chmod a+x signal_cmd
14060 $eunicefix signal_cmd
14062 : generate list of signal names
14064 case "$sig_name_init" in
14066 *) case "$sig_num_init" in
14067 ''|*,*) doinit=yes ;;
14072 echo "Generating a list of signal names and numbers..." >&4
14074 sig_count=`$awk '/^NSIG/ { printf "%d", $2 }' signal.lst`
14075 sig_name=`$awk 'BEGIN { printf "ZERO " }
14076 !/^NSIG/ { printf "%s ", $1 }' signal.lst`
14077 sig_num=`$awk 'BEGIN { printf "0 " }
14078 !/^NSIG/ { printf "%d ", $2 }' signal.lst`
14079 sig_name_init=`$awk 'BEGIN { printf "\"ZERO\", " }
14080 !/^NSIG/ { printf "\"%s\", ", $1 }
14081 END { printf "0\n" }' signal.lst`
14082 sig_num_init=`$awk 'BEGIN { printf "0, " }
14083 !/^NSIG/ { printf "%d, ", $2}
14084 END { printf "0\n"}' signal.lst`
14087 echo "The following $sig_count signals are available:"
14089 echo $sig_name | $awk \
14090 'BEGIN { linelen = 0 }
14092 for (i = 1; i <= NF; i++) {
14093 name = "SIG" $i " "
14094 linelen = linelen + length(name)
14095 if (linelen > 70) {
14097 linelen = length(name)
14103 $rm -f signal signal.c signal.awk signal.lst signal_cmd
14106 case "$sizetype" in
14107 *_t) zzz="$sizetype" ;;
14108 *) zzz="filesize" ;;
14110 echo "Checking the size of $zzz..." >&4
14112 #include <sys/types.h>
14115 printf("%d\n", (int)sizeof($sizetype));
14120 if eval $compile_ok; then
14124 echo "(I can't execute the test program--guessing $sizesize.)" >&4
14127 echo "Your $zzz size is $sizesize bytes."
14132 echo "(I can't compile the test program--guessing $sizesize.)" >&4
14136 : check for socklen_t
14138 echo "Checking to see if you have socklen_t..." >&4
14140 #include <sys/types.h>
14141 #$d_socket HAS_SOCKET
14143 #include <sys/socket.h>
14145 int main() { socklen_t x = 16; }
14148 if eval $compile; then
14150 echo "You have socklen_t."
14153 echo "You do not have socklen_t."
14154 case "$sizetype" in
14155 size_t) echo "(You do have size_t, that might work. Some people are happy with just an int.)" ;;
14162 : check for type of the size argument to socket calls
14163 case "$d_socket" in
14167 Checking to see what type is the last argument of accept().
14169 hdrs="$define sys/types.h $d_socket sys/socket.h"
14171 case "$d_socklen_t" in
14172 "$define") yyy="$yyy socklen_t"
14174 yyy="$yyy $sizetype int long unsigned"
14175 for xxx in $yyy; do
14176 case "$socksizetype" in
14177 '') try="extern int accept(int, struct sockaddr *, $xxx *);"
14178 if ./protochk "$try" $hdrs; then
14179 echo "Your system accepts '$xxx *' for the last argument of accept()."
14180 socksizetype="$xxx"
14185 : In case none of those worked, prompt the user.
14186 case "$socksizetype" in
14187 '') rp='What is the type for socket address structure sizes?'
14194 *) : no sockets, so pick relatively harmless default
14199 : see what type is used for signed size_t
14200 set ssize_t ssizetype int stdio.h sys/types.h
14203 $cat > ssize.c <<EOM
14205 #include <sys/types.h>
14206 #define Size_t $sizetype
14207 #define SSize_t $dflt
14210 if (sizeof(Size_t) == sizeof(SSize_t))
14212 else if (sizeof(Size_t) == sizeof(int))
14221 if eval $compile_ok && ./ssize > /dev/null; then
14222 ssizetype=`./ssize`
14223 echo "I'll be using $ssizetype for functions returning a byte count." >&4
14226 Help! I can't compile and run the ssize_t test program: please enlighten me!
14227 (This is probably a misconfiguration in your system or libraries, and
14228 you really ought to fix it. Still, I'll try anyway.)
14230 I need a type that is the same size as $sizetype, but is guaranteed to
14231 be signed. Common values are ssize_t, int and long.
14234 rp="What signed type is the same size as $sizetype?"
14238 $rm -f ssize ssize.*
14240 : see what type of char stdio uses.
14242 if $contains 'unsigned.*char.*_ptr;' `./findhdr stdio.h` >/dev/null 2>&1 ; then
14243 echo "Your stdio uses unsigned chars." >&4
14244 stdchar="unsigned char"
14246 echo "Your stdio uses signed chars." >&4
14250 : see if time exists
14252 if test "X$d_time" = X -o X"$timetype" = X; then
14253 if set time val -f d_time; eval $csym; $val; then
14254 echo 'time() found.' >&4
14256 rp="What is the type returned by time() on this system?"
14257 set time_t timetype long stdio.h sys/types.h
14260 echo 'time() not found, hope that will do.' >&4
14268 : see what type uids are declared as in the kernel
14270 echo "Looking for the type for user ids returned by getuid()."
14271 set uid_t uidtype xxx stdio.h sys/types.h
14275 xxx=`./findhdr sys/user.h`
14276 set `grep '_ruid;' "$xxx" 2>/dev/null` unsigned short
14278 unsigned) dflt="$1 $2" ;;
14282 *) dflt="$uidtype";;
14285 uid_t) echo "uid_t found." ;;
14286 *) rp="What is the type for user ids returned by getuid()?"
14294 *_t) zzz="$uidtype" ;;
14297 echo "Checking the size of $zzz..." >&4
14299 #include <sys/types.h>
14302 printf("%d\n", (int)sizeof($uidtype));
14307 if eval $compile_ok; then
14311 echo "(I can't execute the test program--guessing $uidsize.)" >&4
14314 echo "Your $zzz is $uidsize bytes long."
14319 echo "(I can't compile the test program--guessing $uidsize.)" >&4
14324 *_t) zzz="$uidtype" ;;
14327 echo "Checking the sign of $zzz..." >&4
14329 #include <sys/types.h>
14340 if eval $compile; then
14344 echo "(I can't execute the test program--guessing unsigned.)" >&4
14348 1) echo "Your $zzz is unsigned." ;;
14349 -1) echo "Your $zzz is signed." ;;
14355 echo "(I can't compile the test program--guessing unsigned.)" >&4
14361 $echo "Checking the format string to be used for uids..." >&4
14364 -1) if $test X"$uidsize" = X"$ivsize"; then
14365 uidformat="$ivdformat"
14367 if $test X"$uidsize" = X"$longsize"; then
14370 if $test X"$uidsize" = X"$intsize"; then
14373 if $test X"$uidsize" = X"$shortsize"; then
14380 *) if $test X"$uidsize" = X"$uvsize"; then
14381 uidformat="$uvuformat"
14383 if $test X"$uidsize" = X"$longsize"; then
14386 if $test X"$uidsize" = X"$intsize"; then
14389 if $test X"$uidsize" = X"$shortsize"; then
14398 : see if dbm.h is available
14399 : see if dbmclose exists
14400 set dbmclose d_dbmclose
14403 case "$d_dbmclose" in
14413 *) set rpcsvc/dbm.h i_rpcsvcdbm
14418 *) echo "We won't be including <dbm.h>"
14428 : see if this is a sys/file.h system
14433 : do we need to include sys/file.h ?
14437 if $h_sysfile; then
14439 echo "We'll be including <sys/file.h>." >&4
14442 echo "We won't be including <sys/file.h>." >&4
14452 : see if fcntl.h is there
14457 : see if we can include fcntl.h
14463 echo "We'll be including <fcntl.h>." >&4
14466 if $h_sysfile; then
14467 echo "We don't need to include <fcntl.h> if we include <sys/file.h>." >&4
14469 echo "We won't be including <fcntl.h>." >&4
14481 : see if this is a iconv.h system
14482 set iconv.h i_iconv
14485 : see if this is a ieeefp.h system
14486 set ieeefp.h i_ieeefp
14489 : see if this is a libutil.h system
14490 set libutil.h i_libutil
14493 : see if locale.h is available
14494 set locale.h i_locale
14497 : see if mach cthreads are available
14498 if test "X$usethreads" = "X$define"; then
14499 set mach/cthreads.h i_machcthr
14502 i_machcthr="$undef"
14507 : see if this is a math.h system
14511 : see if this is a mntent.h system
14512 set mntent.h i_mntent
14515 : see if ndbm.h is available
14520 : see if dbm_open exists
14521 set dbm_open d_dbm_open
14523 case "$d_dbm_open" in
14526 echo "We won't be including <ndbm.h>"
14535 : see if net/errno.h is available
14537 set net/errno.h val
14540 : Unfortunately, it causes problems on some systems. Arrgh.
14543 cat > try.c <<'EOM'
14546 #include <net/errno.h>
14552 if $cc $ccflags -c try.c >/dev/null 2>&1; then
14553 echo "We'll be including <net/errno.h>." >&4
14555 echo "We won't be including <net/errno.h>." >&4
14564 : see if netinet/tcp.h is available
14565 set netinet/tcp.h i_netinettcp
14568 : see if this is a poll.h system
14572 : see if this is a prot.h system
14577 $echo "Guessing which symbols your C compiler and preprocessor define..." >&4
14578 $cat <<'EOSH' > Cppsym.know
14579 a29k ABI64 aegis AES_SOURCE AIX AIX32 AIX370
14580 AIX41 AIX42 AIX43 AIX_SOURCE aixpc ALL_SOURCE
14581 alliant alpha am29000 AM29000 amiga AMIGAOS AMIX
14582 ansi ANSI_C_SOURCE apollo ardent atarist att386 att3b BeOS
14583 BIG_ENDIAN BIT_MSF bsd BSD bsd43 bsd4_2 bsd4_3 BSD4_3 bsd4_4
14584 BSD_4_3 BSD_4_4 BSD_NET2 BSD_TIME BSD_TYPES BSDCOMPAT bsdi
14585 bull c cadmus clipper CMU COFF COMPILER_VERSION
14586 concurrent convex cpu cray CRAY CRAYMPP ctix CX_UX
14587 CYGWIN DGUX DGUX_SOURCE DJGPP dmert DOLPHIN DPX2 DSO
14588 Dynix DynixPTX ELF encore EPI EXTENSIONS FILE_OFFSET_BITS
14589 FreeBSD GCC_NEW_VARARGS gcos gcx gimpel
14590 GNU_SOURCE GNUC GNUC_MINOR GO32 gould GOULD_PN
14591 H3050R H3050RX hbullx20 hcx host_mips
14592 hp200 hp300 hp700 HP700 hp800 hp9000
14593 hp9000s200 hp9000s300 hp9000s400 hp9000s500
14594 hp9000s700 hp9000s800 hp9k8 hp_osf hppa hpux HPUX_SOURCE
14595 i186 i286 i386 i486 i586 i686 i8086 i80960 i860 I960
14596 iAPX286 ibm ibm032 ibmesa IBMR2 ibmrt ILP32 ILP64
14597 INLINE_INTRINSICS INTRINSICS INT64 interdata is68k ksr1
14598 LANGUAGE_C LARGE_FILE_API LARGEFILE64_SOURCE
14599 LARGEFILE_SOURCE LFS64_LARGEFILE LFS_LARGEFILE
14600 Linux LITTLE_ENDIAN LONG64 LONG_DOUBLE LONG_LONG
14601 LONGDOUBLE LONGLONG LP64 luna luna88k Lynx
14602 M68000 m68k m88100 m88k M88KBCS_TARGET M_COFF
14603 M_I186 M_I286 M_I386 M_I8086 M_I86 M_I86SM M_SYS3
14604 M_SYS5 M_SYSIII M_SYSV M_UNIX M_XENIX MACH machine MachTen
14605 MATH_HAS_NO_SIDE_EFFECTS
14606 mc300 mc500 mc68000 mc68010 mc68020 mc68030 mc68040
14607 mc68060 mc68k mc68k32 mc700 mc88000 mc88100 merlin
14608 mert MiNT mips MIPS_FPSET MIPS_ISA MIPS_SIM MIPS_SZINT
14609 MIPS_SZLONG MIPS_SZPTR MIPSEB MIPSEL MODERN_C motorola
14610 mpeix MSDOS MTXINU MULTIMAX mvs MVS n16 ncl_el ncl_mr
14611 NetBSD news1500 news1700 news1800 news1900 news3700
14612 news700 news800 news900 NeXT NLS ns16000 ns32000
14613 ns32016 ns32332 ns32k nsc32000
14614 OCS88 OEMVS OpenBSD os OS2 OS390 osf OSF1 OSF_SOURCE
14615 pa_risc PA_RISC1_1 PA_RISC2_0 PARAGON parisc
14616 pc532 pdp11 PGC PIC plexus PORTAR posix
14617 POSIX1B_SOURCE POSIX2_SOURCE POSIX4_SOURCE
14618 POSIX_C_SOURCE POSIX_SOURCE POWER
14619 PROTOTYPES PWB pyr QNX R3000 REENTRANT RES Rhapsody RISC6000
14620 riscix riscos RT scs SCO sequent sgi SGI_SOURCE sinix
14621 SIZE_INT SIZE_LONG SIZE_PTR SOCKET_SOURCE SOCKETS_SOURCE
14622 sony sony_news sonyrisc sparc sparclite spectrum
14623 stardent stdc STDC_EXT stratos sun sun3 sun386
14624 Sun386i svr3 svr4 SVR4_2 SVR4_SOURCE svr5
14625 SX system SYSTYPE_BSD SYSTYPE_BSD43 SYSTYPE_BSD44
14626 SYSTYPE_SVR4 SYSTYPE_SVR5 SYSTYPE_SYSV SYSV SYSV3 SYSV4 SYSV5
14627 sysV68 sysV88 Tek4132 Tek4300 titan
14628 tower tower32 tower32_200 tower32_600 tower32_700
14629 tower32_800 tower32_850 tss
14630 u370 u3b u3b2 u3b20 u3b200 u3b20d u3b5
14631 ultrix UMAXV UnicomPBB UnicomPBD UNICOS UNICOSMK
14632 unix UNIX95 UNIX99 unixpc unos USGr4 USGr4_2
14633 Utek UTek UTS UWIN uxpm uxps vax venix VMESA vms xenix Xenix286
14634 XOPEN_SOURCE XOPEN_SOURCE_EXTENDED XPG2 XPG2_EXTENDED
14635 XPG3 XPG3_EXTENDED XPG4 XPG4_EXTENDED
14638 # Maybe put other stuff here too.
14639 cat <<EOSH >>Cppsym.know
14642 ./tr '[a-z]' '[A-Z]' < Cppsym.know > Cppsym.a
14643 ./tr '[A-Z]' '[a-z]' < Cppsym.know > Cppsym.b
14644 $cat Cppsym.know > Cppsym.c
14645 $cat Cppsym.a Cppsym.b Cppsym.c | $tr ' ' $trnl | sort | uniq > Cppsym.know
14646 $rm -f Cppsym.a Cppsym.b Cppsym.c
14647 cat <<EOSH > Cppsym
14649 if $test \$# -gt 0; then
14650 echo \$* | $tr " " "$trnl" | ./Cppsym.try > Cppsym.got
14651 if $test -s Cppsym.got; then
14658 $tr " " "$trnl" | ./Cppsym.try
14664 cat <<EOSH > Cppsym.try
14666 cat <<'EOCP' > try.c
14672 cat <<'EOSH' >> Cppsym.try
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
14676 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
14677 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
14681 cat <<EOSH >> Cppsym.try
14683 case "$osname-$gccversion" in
14684 irix-) ccflags="\$ccflags -woff 1178" ;;
14685 os2-*) ccflags="\$ccflags -Zlinker /PM:VIO" ;;
14687 $cc $optimize \$ccflags $ldflags -o try try.c $libs && ./try$exe_ext
14689 chmod +x Cppsym.try
14690 $eunicefix Cppsym.try
14691 ./Cppsym < Cppsym.know > Cppsym.true
14692 : now check the C compiler for additional symbols
14693 postprocess_cc_v=''
14695 aix) postprocess_cc_v="|$tr , ' '" ;;
14702 for i in \`$cc -v -c tmp.c 2>&1 $postprocess_cc_v\`
14705 -D*) echo "\$i" | $sed 's/^-D//';;
14706 -A*) $test "$gccversion" && echo "\$i" | $sed 's/^-A\(.*\)(\(.*\))/\1=\2/';;
14711 postprocess_cc_v=''
14714 ./ccsym > ccsym1.raw
14715 if $test -s ccsym1.raw; then
14716 $sort ccsym1.raw | $uniq >ccsym.raw
14718 mv ccsym1.raw ccsym.raw
14721 $awk '/\=/ { print $0; next }
14722 { print $0"=1" }' ccsym.raw >ccsym.list
14723 $awk '/\=/ { print $0; next }
14724 { print $0"=1" }' Cppsym.true >ccsym.true
14725 $comm -13 ccsym.true ccsym.list >ccsym.own
14726 $comm -12 ccsym.true ccsym.list >ccsym.com
14727 $comm -23 ccsym.true ccsym.list >ccsym.cpp
14729 if $test -z ccsym.raw; then
14730 echo "Your C compiler doesn't seem to define any symbols!" >&4
14732 echo "However, your C preprocessor defines the following symbols:"
14735 cppsymbols=`$cat Cppsym.true`
14736 cppsymbols=`echo $cppsymbols`
14737 cppccsymbols="$cppsymbols"
14739 if $test -s ccsym.com; then
14740 echo "Your C compiler and pre-processor define these symbols:"
14741 $sed -e 's/\(..*\)=.*/\1/' ccsym.com
14744 cppccsymbols=`$cat ccsym.com`
14745 cppccsymbols=`echo $cppccsymbols`
14746 $test "$silent" || sleep 1
14748 if $test -s ccsym.cpp; then
14749 $test "$also" && echo " "
14750 echo "Your C pre-processor ${also}defines the following symbols:"
14751 $sed -e 's/\(..*\)=.*/\1/' ccsym.cpp
14753 cppsymbols=`$cat ccsym.cpp`
14754 cppsymbols=`echo $cppsymbols`
14755 $test "$silent" || sleep 1
14757 if $test -s ccsym.own; then
14758 $test "$also" && echo " "
14759 echo "Your C compiler ${also}defines the following cpp symbols:"
14760 $sed -e 's/\(..*\)=1/\1/' ccsym.own
14761 $sed -e 's/\(..*\)=.*/\1/' ccsym.own | $uniq >>Cppsym.true
14762 ccsymbols=`$cat ccsym.own`
14763 ccsymbols=`echo $ccsymbols`
14764 $test "$silent" || sleep 1
14767 $rm -f ccsym* Cppsym.*
14769 : see if this is a termio system
14773 if $test `./findhdr termios.h`; then
14774 set tcsetattr i_termios
14780 "$define") echo "You have POSIX termios.h... good!" >&4;;
14781 *) if ./Cppsym pyr; then
14782 case "`/bin/universe`" in
14783 ucb) if $test `./findhdr sgtty.h`; then
14785 echo "<sgtty.h> found." >&4
14787 echo "System is pyramid with BSD universe."
14788 echo "<sgtty.h> not found--you could have problems." >&4
14790 *) if $test `./findhdr termio.h`; then
14792 echo "<termio.h> found." >&4
14794 echo "System is pyramid with USG universe."
14795 echo "<termio.h> not found--you could have problems." >&4
14799 if $test `./findhdr termio.h`; then
14800 echo "<termio.h> found." >&4
14802 elif $test `./findhdr sgtty.h`; then
14803 echo "<sgtty.h> found." >&4
14806 echo "Neither <termio.h> nor <sgtty.h> found--you could have problems." >&4
14809 if $test `./findhdr sgtty.h`; then
14810 echo "<sgtty.h> found." >&4
14812 elif $test `./findhdr termio.h`; then
14813 echo "<termio.h> found." >&4
14816 echo "Neither <sgtty.h> nor <termio.h> found--you could have problems." >&4
14820 set i_termio; eval $setvar
14821 val=$val2; set i_sgtty; eval $setvar
14822 val=$val3; set i_termios; eval $setvar
14824 : see if this is a shadow.h system
14825 set shadow.h i_shadow
14828 : see if this is a socks.h system
14829 set socks.h i_socks
14832 : see if stdarg is available
14834 if $test `./findhdr stdarg.h`; then
14835 echo "<stdarg.h> found." >&4
14838 echo "<stdarg.h> NOT found." >&4
14842 : see if varags is available
14844 if $test `./findhdr varargs.h`; then
14845 echo "<varargs.h> found." >&4
14847 echo "<varargs.h> NOT found, but that's ok (I hope)." >&4
14850 : set up the varargs testing programs
14851 $cat > varargs.c <<EOP
14853 #include <stdarg.h>
14856 #include <varargs.h>
14860 int f(char *p, ...)
14874 p = va_arg(ap, char *);
14879 $cat > varargs <<EOP
14881 if $cc -c $ccflags -D\$1 varargs.c >/dev/null 2>&1; then
14890 : now check which varargs header should be included
14895 if `./varargs I_STDARG`; then
14897 elif `./varargs I_VARARGS`; then
14902 if `./varargs I_VARARGS`; then
14909 echo "I could not find the definition for va_dcl... You have problems..." >&4
14910 val="$undef"; set i_stdarg; eval $setvar
14911 val="$undef"; set i_varargs; eval $setvar
14916 case "$i_varhdr" in
14918 val="$define"; set i_stdarg; eval $setvar
14919 val="$undef"; set i_varargs; eval $setvar
14922 val="$undef"; set i_stdarg; eval $setvar
14923 val="$define"; set i_varargs; eval $setvar
14926 echo "We'll include <$i_varhdr> to get va_dcl definition." >&4;;
14930 : see if stddef is available
14931 set stddef.h i_stddef
14934 : see if this is a sunmath.h system
14935 set sunmath.h i_sunmath
14938 : see if sys/access.h is available
14939 set sys/access.h i_sysaccess
14942 : see if ioctl defs are in sgtty, termio, sys/filio or sys/ioctl
14943 set sys/filio.h i_sysfilio
14946 if $test `./findhdr sys/ioctl.h`; then
14948 echo '<sys/ioctl.h> found.' >&4
14951 if $test $i_sysfilio = "$define"; then
14952 echo '<sys/ioctl.h> NOT found.' >&4
14954 $test $i_sgtty = "$define" && xxx="sgtty.h"
14955 $test $i_termio = "$define" && xxx="termio.h"
14956 $test $i_termios = "$define" && xxx="termios.h"
14957 echo "No <sys/ioctl.h> found, assuming ioctl args are defined in <$xxx>." >&4
14964 : see if this is a syslog.h system
14965 set syslog.h i_syslog
14969 : see if this is a sys/mode.h system
14970 set sys/mode.h i_sysmode
14973 : see if sys/resource.h has to be included
14974 set sys/resource.h i_sysresrc
14977 : see if sys/security.h is available
14978 set sys/security.h i_syssecrt
14981 : see if this is a sys/statvfs.h system
14982 set sys/statvfs.h i_sysstatvfs
14985 : see if this is a sys/uio.h system
14986 set sys/uio.h i_sysuio
14989 : see if this is a sys/un.h system
14990 set sys/un.h i_sysun
14994 : see if this is a sys/utsname.h system
14995 set sys/utsname.h i_sysutsname
14998 : see if this is a syswait system
14999 set sys/wait.h i_syswait
15002 : see if this is a ustat.h system
15003 set ustat.h i_ustat
15006 : see if this is an utime system
15007 set utime.h i_utime
15010 : see if this is a values.h system
15011 set values.h i_values
15014 : see if this is a vfork system
15017 set vfork.h i_vfork
15025 : see if gdbm.h is available
15030 : see if gdbm_open exists
15031 set gdbm_open d_gdbm_open
15033 case "$d_gdbm_open" in
15036 echo "We won't be including <gdbm.h>"
15046 echo "Looking for extensions..." >&4
15047 : If we are using the old config.sh, known_extensions may contain
15048 : old or inaccurate or duplicate values.
15049 known_extensions=''
15050 nonxs_extensions=''
15051 : We do not use find because it might not be available.
15052 : We do not just use MANIFEST because the user may have dropped
15053 : some additional extensions into the source tree and expect them
15056 : Function to recursively find available extensions, ignoring DynaLoader
15057 : NOTE: recursion limit of 10 to prevent runaway in case of symlink madness
15061 DynaLoader|dynaload) ;;
15063 if $test -f $xxx/$xxx.xs; then
15064 known_extensions="$known_extensions $1$xxx";
15065 elif $test -f $xxx/Makefile.PL; then
15066 nonxs_extensions="$nonxs_extensions $1$xxx";
15068 if $test -d $xxx -a $# -lt 10; then
15071 eval $find_extensions;
15083 eval $find_extensions
15084 set X $nonxs_extensions
15086 nonxs_extensions="$*"
15087 set X $known_extensions
15089 known_extensions="$*"
15092 : Now see which are supported on this system.
15094 for xxx in $known_extensions ; do
15098 $define) avail_ext="$avail_ext $xxx" ;;
15101 GDBM_File|gdbm_fil)
15103 $define) avail_ext="$avail_ext $xxx" ;;
15106 NDBM_File|ndbm_fil)
15109 case "$osname-$use64bitint" in
15112 *-lndbm*) avail_ext="$avail_ext $xxx" ;;
15115 *) avail_ext="$avail_ext $xxx" ;;
15120 ODBM_File|odbm_fil)
15121 case "${i_dbm}${i_rpcsvcdbm}" in
15123 case "$osname-$use64bitint" in
15126 *-ldbm*) avail_ext="$avail_ext $xxx" ;;
15129 *) avail_ext="$avail_ext $xxx" ;;
15135 case "$useposix" in
15136 true|define|y) avail_ext="$avail_ext $xxx" ;;
15140 case "$useopcode" in
15141 true|define|y) avail_ext="$avail_ext $xxx" ;;
15145 case "$d_socket" in
15146 true|$define|y) avail_ext="$avail_ext $xxx" ;;
15149 Sys/Syslog|sys/syslog)
15150 : XXX syslog requires socket
15151 case "$d_socket" in
15152 true|$define|y) avail_ext="$avail_ext $xxx" ;;
15156 case "$usethreads" in
15157 true|$define|y) avail_ext="$avail_ext $xxx" ;;
15161 : XXX Do we need a useipcsysv variable here
15162 case "${d_msg}${d_sem}${d_shm}" in
15163 *"${define}"*) avail_ext="$avail_ext $xxx" ;;
15166 *) avail_ext="$avail_ext $xxx"
15175 : Now see which nonxs extensions are supported on this system.
15176 : For now assume all are.
15178 for xxx in $nonxs_extensions ; do
15180 *) nonxs_ext="$nonxs_ext $xxx"
15192 A number of extensions are supplied with $package. You may choose to
15193 compile these extensions for dynamic loading (the default), compile
15194 them into the $package executable (static loading), or not include
15195 them at all. Answer "none" to include no extensions.
15196 Note that DynaLoader is always built and need not be mentioned here.
15199 case "$dynamic_ext" in
15200 '') dflt="$avail_ext" ;;
15201 *) dflt="$dynamic_ext"
15202 # Perhaps we are reusing an old out-of-date config.sh.
15205 if test X"$dynamic_ext" != X"$avail_ext"; then
15207 NOTICE: Your previous config.sh list may be incorrect.
15208 The extensions now available to you are
15210 but the default list from your previous config.sh is
15222 rp="What extensions do you wish to load dynamically?"
15225 none) dynamic_ext=' ' ;;
15226 *) dynamic_ext="$ans" ;;
15229 case "$static_ext" in
15231 : Exclude those already listed in dynamic linking
15233 for xxx in $avail_ext; do
15234 case " $dynamic_ext " in
15236 *) dflt="$dflt $xxx" ;;
15243 *) dflt="$static_ext"
15250 rp="What extensions do you wish to load statically?"
15253 none) static_ext=' ' ;;
15254 *) static_ext="$ans" ;;
15259 A number of extensions are supplied with $package. Answer "none"
15260 to include no extensions.
15261 Note that DynaLoader is always built and need not be mentioned here.
15264 case "$static_ext" in
15265 '') dflt="$avail_ext" ;;
15266 *) dflt="$static_ext"
15267 # Perhaps we are reusing an old out-of-date config.sh.
15270 if test X"$static_ext" != X"$avail_ext"; then
15272 NOTICE: Your previous config.sh list may be incorrect.
15273 The extensions now available to you are
15275 but the default list from your previous config.sh is
15284 : Exclude those that are not xs extensions
15288 rp="What extensions do you wish to include?"
15291 none) static_ext=' ' ;;
15292 *) static_ext="$ans" ;;
15297 set X $dynamic_ext $static_ext $nonxs_ext
15301 : Remove build directory name from cppstdin so it can be used from
15302 : either the present location or the final installed location.
15304 : Get out of the UU directory to get correct path name.
15306 case "$cppstdin" in
15308 echo "Stripping down cppstdin path name"
15314 : end of configuration questions
15316 echo "End of configuration questions."
15319 : back to where it started
15320 if test -d ../UU; then
15324 : configuration may be patched via a 'config.over' file
15325 if $test -f config.over; then
15328 rp='I see a config.over file. Do you wish to load it?'
15331 n*) echo "OK, I'll ignore it.";;
15333 echo "Configuration override changes have been loaded."
15338 : in case they want portability, strip down executable paths
15339 case "$d_portable" in
15342 echo "Stripping down executable paths..." >&4
15343 for file in $loclist $trylist; do
15345 eval $file=`basename $temp`
15350 : create config.sh file
15352 echo "Creating config.sh..." >&4
15353 $spitshell <<EOT >config.sh
15356 # This file was produced by running the Configure script. It holds all the
15357 # definitions figured out by Configure. Should you modify one of these values,
15358 # do not forget to propagate your changes by running "Configure -der". You may
15359 # instead choose to run each of the .SH files by yourself, or "Configure -S".
15362 # Package name : $package
15363 # Source directory : $src
15364 # Configuration time: $cf_time
15365 # Configured by : $cf_by
15366 # Target system : $myuname
15376 Revision='$Revision'
15383 alignbytes='$alignbytes'
15384 ansi2knr='$ansi2knr'
15385 aphostname='$aphostname'
15386 api_revision='$api_revision'
15387 api_subversion='$api_subversion'
15388 api_version='$api_version'
15389 api_versionstring='$api_versionstring'
15392 archlibexp='$archlibexp'
15393 archname64='$archname64'
15394 archname='$archname'
15395 archobjs='$archobjs'
15400 bincompat5005='$bincompat5005'
15404 byteorder='$byteorder'
15406 castflags='$castflags'
15409 cccdlflags='$cccdlflags'
15410 ccdlflags='$ccdlflags'
15412 ccflags_uselargefiles='$ccflags_uselargefiles'
15414 ccsymbols='$ccsymbols'
15416 cf_email='$cf_email'
15418 charsize='$charsize'
15422 clocktype='$clocktype'
15424 compress='$compress'
15425 contains='$contains'
15429 cpp_stuff='$cpp_stuff'
15430 cppccsymbols='$cppccsymbols'
15431 cppflags='$cppflags'
15433 cppminus='$cppminus'
15435 cppstdin='$cppstdin'
15436 cppsymbols='$cppsymbols'
15437 crosscompile='$crosscompile'
15438 cryptlib='$cryptlib'
15440 d_Gconvert='$d_Gconvert'
15441 d_PRIEldbl='$d_PRIEldbl'
15442 d_PRIFldbl='$d_PRIFldbl'
15443 d_PRIGldbl='$d_PRIGldbl'
15444 d_PRIX64='$d_PRIX64'
15445 d_PRId64='$d_PRId64'
15446 d_PRIeldbl='$d_PRIeldbl'
15447 d_PRIfldbl='$d_PRIfldbl'
15448 d_PRIgldbl='$d_PRIgldbl'
15449 d_PRIi64='$d_PRIi64'
15450 d_PRIo64='$d_PRIo64'
15451 d_PRIu64='$d_PRIu64'
15452 d_PRIx64='$d_PRIx64'
15453 d_access='$d_access'
15454 d_accessx='$d_accessx'
15456 d_archlib='$d_archlib'
15459 d_attribut='$d_attribut'
15462 d_bincompat5005='$d_bincompat5005'
15464 d_bsdgetpgrp='$d_bsdgetpgrp'
15465 d_bsdsetpgrp='$d_bsdsetpgrp'
15467 d_casti32='$d_casti32'
15468 d_castneg='$d_castneg'
15469 d_charvspr='$d_charvspr'
15471 d_chroot='$d_chroot'
15472 d_chsize='$d_chsize'
15473 d_closedir='$d_closedir'
15477 d_cuserid='$d_cuserid'
15478 d_dbl_dig='$d_dbl_dig'
15479 d_difftime='$d_difftime'
15480 d_dirnamlen='$d_dirnamlen'
15481 d_dlerror='$d_dlerror'
15482 d_dlopen='$d_dlopen'
15483 d_dlsymun='$d_dlsymun'
15484 d_dosuid='$d_dosuid'
15485 d_drand48proto='$d_drand48proto'
15487 d_eaccess='$d_eaccess'
15488 d_endgrent='$d_endgrent'
15489 d_endhent='$d_endhent'
15490 d_endnent='$d_endnent'
15491 d_endpent='$d_endpent'
15492 d_endpwent='$d_endpwent'
15493 d_endsent='$d_endsent'
15494 d_eofnblk='$d_eofnblk'
15495 d_eunice='$d_eunice'
15496 d_fchmod='$d_fchmod'
15497 d_fchown='$d_fchown'
15499 d_fd_macros='$d_fd_macros'
15500 d_fd_set='$d_fd_set'
15501 d_fds_bits='$d_fds_bits'
15502 d_fgetpos='$d_fgetpos'
15503 d_flexfnam='$d_flexfnam'
15506 d_fpathconf='$d_fpathconf'
15507 d_fpos64_t='$d_fpos64_t'
15508 d_frexpl='$d_frexpl'
15509 d_fs_data_s='$d_fs_data_s'
15510 d_fseeko='$d_fseeko'
15511 d_fsetpos='$d_fsetpos'
15512 d_fstatfs='$d_fstatfs'
15513 d_fstatvfs='$d_fstatvfs'
15514 d_ftello='$d_ftello'
15516 d_getcwd='$d_getcwd'
15517 d_getespwnam='$d_getespwnam'
15518 d_getfsstat='$d_getfsstat'
15519 d_getgrent='$d_getgrent'
15520 d_getgrps='$d_getgrps'
15521 d_gethbyaddr='$d_gethbyaddr'
15522 d_gethbyname='$d_gethbyname'
15523 d_gethent='$d_gethent'
15524 d_gethname='$d_gethname'
15525 d_gethostprotos='$d_gethostprotos'
15526 d_getlogin='$d_getlogin'
15527 d_getmnt='$d_getmnt'
15528 d_getmntent='$d_getmntent'
15529 d_getnbyaddr='$d_getnbyaddr'
15530 d_getnbyname='$d_getnbyname'
15531 d_getnent='$d_getnent'
15532 d_getnetprotos='$d_getnetprotos'
15533 d_getpbyname='$d_getpbyname'
15534 d_getpbynumber='$d_getpbynumber'
15535 d_getpent='$d_getpent'
15536 d_getpgid='$d_getpgid'
15537 d_getpgrp2='$d_getpgrp2'
15538 d_getpgrp='$d_getpgrp'
15539 d_getppid='$d_getppid'
15540 d_getprior='$d_getprior'
15541 d_getprotoprotos='$d_getprotoprotos'
15542 d_getprpwnam='$d_getprpwnam'
15543 d_getpwent='$d_getpwent'
15544 d_getsbyname='$d_getsbyname'
15545 d_getsbyport='$d_getsbyport'
15546 d_getsent='$d_getsent'
15547 d_getservprotos='$d_getservprotos'
15548 d_getspnam='$d_getspnam'
15549 d_gettimeod='$d_gettimeod'
15550 d_gnulibc='$d_gnulibc'
15551 d_grpasswd='$d_grpasswd'
15552 d_hasmntopt='$d_hasmntopt'
15556 d_inetaton='$d_inetaton'
15557 d_int64_t='$d_int64_t'
15558 d_isascii='$d_isascii'
15560 d_isnanl='$d_isnanl'
15561 d_killpg='$d_killpg'
15562 d_lchown='$d_lchown'
15563 d_ldbl_dig='$d_ldbl_dig'
15565 d_locconv='$d_locconv'
15567 d_longdbl='$d_longdbl'
15568 d_longlong='$d_longlong'
15569 d_lseekproto='$d_lseekproto'
15571 d_madvise='$d_madvise'
15573 d_mbstowcs='$d_mbstowcs'
15574 d_mbtowc='$d_mbtowc'
15575 d_memchr='$d_memchr'
15576 d_memcmp='$d_memcmp'
15577 d_memcpy='$d_memcpy'
15578 d_memmove='$d_memmove'
15579 d_memset='$d_memset'
15581 d_mkdtemp='$d_mkdtemp'
15582 d_mkfifo='$d_mkfifo'
15583 d_mkstemp='$d_mkstemp'
15584 d_mkstemps='$d_mkstemps'
15585 d_mktime='$d_mktime'
15588 d_mprotect='$d_mprotect'
15590 d_msg_ctrunc='$d_msg_ctrunc'
15591 d_msg_dontroute='$d_msg_dontroute'
15592 d_msg_oob='$d_msg_oob'
15593 d_msg_peek='$d_msg_peek'
15594 d_msg_proxy='$d_msg_proxy'
15595 d_msgctl='$d_msgctl'
15596 d_msgget='$d_msgget'
15597 d_msgrcv='$d_msgrcv'
15598 d_msgsnd='$d_msgsnd'
15600 d_munmap='$d_munmap'
15601 d_mymalloc='$d_mymalloc'
15603 d_nv_preserves_uv='$d_nv_preserves_uv'
15604 d_nv_preserves_uv_bits='$d_nv_preserves_uv_bits'
15605 d_off64_t='$d_off64_t'
15606 d_old_pthread_create_joinable='$d_old_pthread_create_joinable'
15607 d_oldpthreads='$d_oldpthreads'
15608 d_oldsock='$d_oldsock'
15610 d_pathconf='$d_pathconf'
15612 d_perl_otherlibdirs='$d_perl_otherlibdirs'
15613 d_phostname='$d_phostname'
15616 d_portable='$d_portable'
15617 d_pthread_yield='$d_pthread_yield'
15619 d_pwchange='$d_pwchange'
15620 d_pwclass='$d_pwclass'
15621 d_pwcomment='$d_pwcomment'
15622 d_pwexpire='$d_pwexpire'
15623 d_pwgecos='$d_pwgecos'
15624 d_pwpasswd='$d_pwpasswd'
15625 d_pwquota='$d_pwquota'
15628 d_readdir='$d_readdir'
15629 d_readlink='$d_readlink'
15630 d_rename='$d_rename'
15631 d_rewinddir='$d_rewinddir'
15633 d_safebcpy='$d_safebcpy'
15634 d_safemcpy='$d_safemcpy'
15635 d_sanemcmp='$d_sanemcmp'
15636 d_sched_yield='$d_sched_yield'
15637 d_scm_rights='$d_scm_rights'
15638 d_seekdir='$d_seekdir'
15639 d_select='$d_select'
15641 d_semctl='$d_semctl'
15642 d_semctl_semid_ds='$d_semctl_semid_ds'
15643 d_semctl_semun='$d_semctl_semun'
15644 d_semget='$d_semget'
15646 d_setegid='$d_setegid'
15647 d_seteuid='$d_seteuid'
15648 d_setgrent='$d_setgrent'
15649 d_setgrps='$d_setgrps'
15650 d_sethent='$d_sethent'
15651 d_setlinebuf='$d_setlinebuf'
15652 d_setlocale='$d_setlocale'
15653 d_setnent='$d_setnent'
15654 d_setpent='$d_setpent'
15655 d_setpgid='$d_setpgid'
15656 d_setpgrp2='$d_setpgrp2'
15657 d_setpgrp='$d_setpgrp'
15658 d_setprior='$d_setprior'
15659 d_setproctitle='$d_setproctitle'
15660 d_setpwent='$d_setpwent'
15661 d_setregid='$d_setregid'
15662 d_setresgid='$d_setresgid'
15663 d_setresuid='$d_setresuid'
15664 d_setreuid='$d_setreuid'
15665 d_setrgid='$d_setrgid'
15666 d_setruid='$d_setruid'
15667 d_setsent='$d_setsent'
15668 d_setsid='$d_setsid'
15669 d_setvbuf='$d_setvbuf'
15673 d_shmatprototype='$d_shmatprototype'
15674 d_shmctl='$d_shmctl'
15676 d_shmget='$d_shmget'
15677 d_sigaction='$d_sigaction'
15678 d_sigsetjmp='$d_sigsetjmp'
15679 d_socket='$d_socket'
15680 d_socklen_t='$d_socklen_t'
15681 d_sockpair='$d_sockpair'
15682 d_socks5_init='$d_socks5_init'
15684 d_statblks='$d_statblks'
15685 d_statfs_f_flags='$d_statfs_f_flags'
15686 d_statfs_s='$d_statfs_s'
15687 d_statvfs='$d_statvfs'
15688 d_stdio_cnt_lval='$d_stdio_cnt_lval'
15689 d_stdio_ptr_lval='$d_stdio_ptr_lval'
15690 d_stdio_stream_array='$d_stdio_stream_array'
15691 d_stdiobase='$d_stdiobase'
15692 d_stdstdio='$d_stdstdio'
15693 d_strchr='$d_strchr'
15694 d_strcoll='$d_strcoll'
15695 d_strctcpy='$d_strctcpy'
15696 d_strerrm='$d_strerrm'
15697 d_strerror='$d_strerror'
15698 d_strtod='$d_strtod'
15699 d_strtol='$d_strtol'
15700 d_strtold='$d_strtold'
15701 d_strtoll='$d_strtoll'
15702 d_strtoul='$d_strtoul'
15703 d_strtoull='$d_strtoull'
15704 d_strtouq='$d_strtouq'
15705 d_strxfrm='$d_strxfrm'
15706 d_suidsafe='$d_suidsafe'
15707 d_symlink='$d_symlink'
15708 d_syscall='$d_syscall'
15709 d_sysconf='$d_sysconf'
15710 d_sysernlst='$d_sysernlst'
15711 d_syserrlst='$d_syserrlst'
15712 d_system='$d_system'
15713 d_tcgetpgrp='$d_tcgetpgrp'
15714 d_tcsetpgrp='$d_tcsetpgrp'
15715 d_telldir='$d_telldir'
15716 d_telldirproto='$d_telldirproto'
15719 d_truncate='$d_truncate'
15720 d_tzname='$d_tzname'
15723 d_union_semun='$d_union_semun'
15725 d_vendorarch='$d_vendorarch'
15726 d_vendorbin='$d_vendorbin'
15727 d_vendorlib='$d_vendorlib'
15729 d_void_closedir='$d_void_closedir'
15730 d_voidsig='$d_voidsig'
15731 d_voidtty='$d_voidtty'
15732 d_volatile='$d_volatile'
15733 d_vprintf='$d_vprintf'
15735 d_waitpid='$d_waitpid'
15736 d_wcstombs='$d_wcstombs'
15737 d_wctomb='$d_wctomb'
15740 db_hashtype='$db_hashtype'
15741 db_prefixtype='$db_prefixtype'
15742 defvoidused='$defvoidused'
15743 direntrytype='$direntrytype'
15746 doublesize='$doublesize'
15748 dynamic_ext='$dynamic_ext'
15754 eunicefix='$eunicefix'
15757 extensions='$extensions'
15758 fflushNULL='$fflushNULL'
15759 fflushall='$fflushall'
15761 firstmakefile='$firstmakefile'
15763 fpossize='$fpossize'
15764 fpostype='$fpostype'
15765 freetype='$freetype'
15767 full_csh='$full_csh'
15768 full_sed='$full_sed'
15769 gccosandvers='$gccosandvers'
15770 gccversion='$gccversion'
15771 gidformat='$gidformat'
15777 groupcat='$groupcat'
15778 groupstype='$groupstype'
15781 h_sysfile='$h_sysfile'
15793 i_arpainet='$i_arpainet'
15794 i_bsdioctl='$i_bsdioctl'
15797 i_dirent='$i_dirent'
15805 i_ieeefp='$i_ieeefp'
15806 i_inttypes='$i_inttypes'
15807 i_libutil='$i_libutil'
15808 i_limits='$i_limits'
15809 i_locale='$i_locale'
15810 i_machcthr='$i_machcthr'
15811 i_malloc='$i_malloc'
15813 i_memory='$i_memory'
15814 i_mntent='$i_mntent'
15817 i_neterrno='$i_neterrno'
15818 i_netinettcp='$i_netinettcp'
15822 i_pthread='$i_pthread'
15824 i_rpcsvcdbm='$i_rpcsvcdbm'
15827 i_shadow='$i_shadow'
15829 i_stdarg='$i_stdarg'
15830 i_stddef='$i_stddef'
15831 i_stdlib='$i_stdlib'
15832 i_string='$i_string'
15833 i_sunmath='$i_sunmath'
15834 i_sysaccess='$i_sysaccess'
15835 i_sysdir='$i_sysdir'
15836 i_sysfile='$i_sysfile'
15837 i_sysfilio='$i_sysfilio'
15839 i_sysioctl='$i_sysioctl'
15840 i_syslog='$i_syslog'
15841 i_sysmman='$i_sysmman'
15842 i_sysmode='$i_sysmode'
15843 i_sysmount='$i_sysmount'
15844 i_sysndir='$i_sysndir'
15845 i_sysparam='$i_sysparam'
15846 i_sysresrc='$i_sysresrc'
15847 i_syssecrt='$i_syssecrt'
15848 i_sysselct='$i_sysselct'
15849 i_syssockio='$i_syssockio'
15850 i_sysstat='$i_sysstat'
15851 i_sysstatfs='$i_sysstatfs'
15852 i_sysstatvfs='$i_sysstatvfs'
15853 i_systime='$i_systime'
15854 i_systimek='$i_systimek'
15855 i_systimes='$i_systimes'
15856 i_systypes='$i_systypes'
15857 i_sysuio='$i_sysuio'
15859 i_sysutsname='$i_sysutsname'
15860 i_sysvfs='$i_sysvfs'
15861 i_syswait='$i_syswait'
15862 i_termio='$i_termio'
15863 i_termios='$i_termios'
15865 i_unistd='$i_unistd'
15868 i_values='$i_values'
15869 i_varargs='$i_varargs'
15870 i_varhdr='$i_varhdr'
15872 ignore_versioned_solibs='$ignore_versioned_solibs'
15873 inc_version_list='$inc_version_list'
15874 inc_version_list_init='$inc_version_list_init'
15877 installarchlib='$installarchlib'
15878 installbin='$installbin'
15879 installman1dir='$installman1dir'
15880 installman3dir='$installman3dir'
15881 installprefix='$installprefix'
15882 installprefixexp='$installprefixexp'
15883 installprivlib='$installprivlib'
15884 installscript='$installscript'
15885 installsitearch='$installsitearch'
15886 installsitebin='$installsitebin'
15887 installsitelib='$installsitelib'
15888 installstyle='$installstyle'
15889 installusrbinperl='$installusrbinperl'
15890 installvendorarch='$installvendorarch'
15891 installvendorbin='$installvendorbin'
15892 installvendorlib='$installvendorlib'
15894 ivdformat='$ivdformat'
15897 known_extensions='$known_extensions'
15901 lddlflags='$lddlflags'
15903 ldflags_uselargefiles='$ldflags_uselargefiles'
15904 ldlibpthname='$ldlibpthname'
15911 libsdirs='$libsdirs'
15912 libsfiles='$libsfiles'
15913 libsfound='$libsfound'
15914 libspath='$libspath'
15915 libswanted='$libswanted'
15916 libswanted_uselargefiles='$libswanted_uselargefiles'
15922 locincpth='$locincpth'
15923 loclibpth='$loclibpth'
15924 longdblsize='$longdblsize'
15925 longlongsize='$longlongsize'
15926 longsize='$longsize'
15930 lseeksize='$lseeksize'
15931 lseektype='$lseektype'
15935 make_set_make='$make_set_make'
15936 mallocobj='$mallocobj'
15937 mallocsrc='$mallocsrc'
15938 malloctype='$malloctype'
15940 man1direxp='$man1direxp'
15943 man3direxp='$man3direxp'
15946 mips_type='$mips_type'
15948 mmaptype='$mmaptype'
15950 modetype='$modetype'
15952 multiarch='$multiarch'
15954 myarchname='$myarchname'
15955 mydomain='$mydomain'
15956 myhostname='$myhostname'
15959 netdb_hlen_type='$netdb_hlen_type'
15960 netdb_host_type='$netdb_host_type'
15961 netdb_name_type='$netdb_name_type'
15962 netdb_net_type='$netdb_net_type'
15965 nm_so_opt='$nm_so_opt'
15966 nonxs_ext='$nonxs_ext'
15968 nvEformat='$nvEformat'
15969 nvFformat='$nvFformat'
15970 nvGformat='$nvGformat'
15971 nveformat='$nveformat'
15972 nvfformat='$nvfformat'
15973 nvgformat='$nvgformat'
15976 o_nonblock='$o_nonblock'
15978 old_pthread_create_joinable='$old_pthread_create_joinable'
15979 optimize='$optimize'
15980 orderlib='$orderlib'
15983 otherlibdirs='$otherlibdirs'
15987 patchlevel='$patchlevel'
15988 path_sep='$path_sep'
15991 perladmin='$perladmin'
15992 perlpath='$perlpath'
15994 phostname='$phostname'
15997 pm_apiversion='$pm_apiversion'
16001 prefixexp='$prefixexp'
16003 privlibexp='$privlibexp'
16004 prototype='$prototype'
16006 quadkind='$quadkind'
16007 quadtype='$quadtype'
16008 randbits='$randbits'
16009 randfunc='$randfunc'
16010 randseedtype='$randseedtype'
16012 rd_nodata='$rd_nodata'
16013 revision='$revision'
16017 sPRIEldbl='$sPRIEldbl'
16018 sPRIFldbl='$sPRIFldbl'
16019 sPRIGldbl='$sPRIGldbl'
16022 sPRIeldbl='$sPRIeldbl'
16023 sPRIfldbl='$sPRIfldbl'
16024 sPRIgldbl='$sPRIgldbl'
16029 sched_yield='$sched_yield'
16030 scriptdir='$scriptdir'
16031 scriptdirexp='$scriptdirexp'
16033 seedfunc='$seedfunc'
16034 selectminbits='$selectminbits'
16035 selecttype='$selecttype'
16036 sendmail='$sendmail'
16039 sharpbang='$sharpbang'
16040 shmattype='$shmattype'
16041 shortsize='$shortsize'
16044 sig_count='$sig_count'
16045 sig_name='$sig_name'
16046 sig_name_init='$sig_name_init'
16048 sig_num_init='$sig_num_init'
16049 signal_t='$signal_t'
16050 sitearch='$sitearch'
16051 sitearchexp='$sitearchexp'
16053 sitebinexp='$sitebinexp'
16055 sitelib_stem='$sitelib_stem'
16056 sitelibexp='$sitelibexp'
16057 siteprefix='$siteprefix'
16058 siteprefixexp='$siteprefixexp'
16059 sizesize='$sizesize'
16060 sizetype='$sizetype'
16065 sockethdr='$sockethdr'
16066 socketlib='$socketlib'
16067 socksizetype='$socksizetype'
16069 spackage='$spackage'
16070 spitshell='$spitshell'
16073 ssizetype='$ssizetype'
16074 startperl='$startperl'
16076 static_ext='$static_ext'
16078 stdio_base='$stdio_base'
16079 stdio_bufsiz='$stdio_bufsiz'
16080 stdio_cnt='$stdio_cnt'
16081 stdio_filbuf='$stdio_filbuf'
16082 stdio_ptr='$stdio_ptr'
16083 stdio_stream_array='$stdio_stream_array'
16086 subversion='$subversion'
16093 timeincl='$timeincl'
16094 timetype='$timetype'
16107 uidformat='$uidformat'
16113 uquadtype='$uquadtype'
16114 use5005threads='$use5005threads'
16115 use64bitall='$use64bitall'
16116 use64bitint='$use64bitint'
16118 useithreads='$useithreads'
16119 uselargefiles='$uselargefiles'
16120 uselongdouble='$uselongdouble'
16121 usemorebits='$usemorebits'
16122 usemultiplicity='$usemultiplicity'
16123 usemymalloc='$usemymalloc'
16125 useopcode='$useopcode'
16126 useperlio='$useperlio'
16127 useposix='$useposix'
16129 useshrplib='$useshrplib'
16130 usesocks='$usesocks'
16131 usethreads='$usethreads'
16132 usevendorprefix='$usevendorprefix'
16133 usevfork='$usevfork'
16136 uvXformat='$uvXformat'
16137 uvoformat='$uvoformat'
16140 uvuformat='$uvuformat'
16141 uvxformat='$uvxformat'
16142 vendorarch='$vendorarch'
16143 vendorarchexp='$vendorarchexp'
16144 vendorbin='$vendorbin'
16145 vendorbinexp='$vendorbinexp'
16146 vendorlib='$vendorlib'
16147 vendorlib_stem='$vendorlib_stem'
16148 vendorlibexp='$vendorlibexp'
16149 vendorprefix='$vendorprefix'
16150 vendorprefixexp='$vendorprefixexp'
16153 voidflags='$voidflags'
16155 xs_apiversion='$xs_apiversion'
16160 : Add in command line options if available
16161 $test -f UU/cmdline.opt && $cat UU/cmdline.opt >> config.sh
16163 : add special variables
16164 $test -f $src/patchlevel.h && \
16165 awk '/^#define[ ]+PERL_/ {printf "%s=%s\n",$2,$3}' $src/patchlevel.h >>config.sh
16166 echo "CONFIGDOTSH=true" >>config.sh
16168 : propagate old symbols
16169 if $test -f UU/config.sh; then
16170 <UU/config.sh sort | uniq >UU/oldconfig.sh
16171 sed -n 's/^\([a-zA-Z_0-9]*\)=.*/\1/p' config.sh config.sh UU/oldconfig.sh |\
16172 sort | uniq -u >UU/oldsyms
16173 set X `cat UU/oldsyms`
16179 Hmm...You had some extra variables I don't know about...I'll try to keep 'em...
16181 echo "# Variables propagated from previous config.sh file." >>config.sh
16182 for sym in `cat UU/oldsyms`; do
16183 echo " Propagating $hint variable "'$'"$sym..."
16184 eval 'tmp="$'"${sym}"'"'
16186 sed -e "s/'/'\"'\"'/g" -e "s/^/$sym='/" -e "s/$/'/" >>config.sh
16192 : Finish up by extracting the .SH files
16206 If you'd like to make any changes to the config.sh file before I begin
16207 to configure things, do it as a shell escape now (e.g. !vi config.sh).
16210 rp="Press return or use a shell escape to edit config.sh:"
16215 *) : in case they cannot read
16216 sh 1>&4 -c "$ans";;
16221 : if this fails, just run all the .SH files by hand
16228 if $contains '^depend:' [Mm]akefile >/dev/null 2>&1; then
16235 Now you need to generate make dependencies by running "$make depend".
16236 You might prefer to run it in background: "$make depend > makedepend.out &"
16237 It can take a while, so you might not want to run it right now.
16242 rp="Run $make depend now?"
16246 $make depend && echo "Now you must run a $make."
16249 echo "You must run '$make depend' then '$make'."
16252 elif test -f [Mm]akefile; then
16254 echo "Now you must run a $make."
16259 if $test -f Policy.sh; then
16262 If you compile $package on a different machine or from a different object
16263 directory, copy the Policy.sh file from this object directory to the
16264 new one before you run Configure -- this will help you with most of
16265 the policy defaults.
16269 if $test -f config.msg; then
16270 echo "Hmm. I also noted the following information while running:"
16272 $cat config.msg >&4
16275 $rm -f kit*isdone ark*isdone